-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3153 from patrick-rodgers/version-4
site open extensions, graph pages support, DebugHeaders
- Loading branch information
Showing
25 changed files
with
603 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Site Open Extensions | ||
|
||
// TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import "./site.js"; | ||
|
||
export { | ||
IBaseExtensionData as IBaseOpenExtension, | ||
IOpenExtension, | ||
IOpenExtensions, | ||
OpenExtension, | ||
OpenExtensions, | ||
} from "./types.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { addProp } from "@pnp/queryable"; | ||
import { _Site } from "../sites/types.js"; | ||
import { IOpenExtensions, OpenExtensions } from "./types.js"; | ||
|
||
declare module "../sites/types" { | ||
interface _Site { | ||
readonly extensions: IOpenExtensions; | ||
} | ||
interface ISite { | ||
readonly extensions: IOpenExtensions; | ||
} | ||
} | ||
addProp(_Site, "extensions", OpenExtensions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { body } from "@pnp/queryable"; | ||
import { Extension as ExtensionType } from "@microsoft/microsoft-graph-types"; | ||
import { _GraphCollection, graphInvokableFactory, graphPatch, graphPost } from "../graphqueryable.js"; | ||
import { getById, IGetById, deleteable, IDeleteable, defaultPath } from "../decorators.js"; | ||
|
||
export interface IBaseExtensionData { | ||
extensionName: string; | ||
} | ||
|
||
/** | ||
* Open Extension | ||
*/ | ||
@deleteable() | ||
export class _OpenExtension extends _GraphCollection<ExtensionType> { | ||
|
||
public update<T extends IBaseExtensionData>(extension: T): Promise<any> { | ||
return graphPatch(this, body(extension)); | ||
} | ||
} | ||
export interface IOpenExtension extends _OpenExtension, IDeleteable { } | ||
export const OpenExtension = graphInvokableFactory<IOpenExtension>(_OpenExtension); | ||
|
||
/** | ||
* Open Extensions | ||
*/ | ||
@defaultPath("extensions") | ||
@getById(OpenExtension) | ||
export class _OpenExtensions extends _GraphCollection<ExtensionType> { | ||
|
||
public create<T extends IBaseExtensionData>(extension: T): Promise<any> { | ||
|
||
if (extension.extensionName.length > 30) { | ||
throw Error("Extension id length should be less than or equal to 30 characters."); | ||
} | ||
|
||
return graphPost(this, body(extension)); | ||
} | ||
} | ||
export interface IOpenExtensions extends _OpenExtensions, IGetById<IOpenExtension> { } | ||
export const OpenExtensions = graphInvokableFactory<IOpenExtensions>(_OpenExtensions); |
Oops, something went wrong.