Skip to content

Commit

Permalink
Updated the v2 sites lib option for getting lists from a different site.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjandatta committed Dec 2, 2024
1 parent d8f3cb4 commit b408562
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion @types/v2/drives.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export interface Idrives {
* @param siteId - (Optional) The site id to target, current by default.
* @param targetInfo - (Optional) The target information.
*/
(props?: { id?: string, siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<driveCollection>;
(props?: { driveId?: string, siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<driveCollection>;
}
4 changes: 2 additions & 2 deletions @types/v2/sites.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export interface Isites {
* @param id - (Optional) The site id to target, current by default.
* @param targetInfo - (Optional) The target information.
*/
(props?: { id?: string, targetInfo?: ITargetInfoProps }): siteMethods & sites;
(props?: { siteId?: string, targetInfo?: ITargetInfoProps }): siteMethods & sites;

/** Returns the current web. */
static getCurrentWeb(): IBaseExecution<sites> & siteMethods;

/** Returns a list from the current web. */
static getList(title: string): IBaseExecution<list> & listMethods;
static getList(props: { siteId?: string, title: string }): IBaseExecution<list> & listMethods;
}
6 changes: 3 additions & 3 deletions dist/gd-sprest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4505,7 +4505,7 @@ declare module 'gd-sprest/v2/drives' {
* @param siteId - (Optional) The site id to target, current by default.
* @param targetInfo - (Optional) The target information.
*/
(props?: { id?: string, siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<driveCollection>;
(props?: { driveId?: string, siteId?: string, targetInfo?: ITargetInfoProps }): IBaseExecution<driveCollection>;
}
}

Expand Down Expand Up @@ -4542,13 +4542,13 @@ declare module 'gd-sprest/v2/sites' {
* @param id - (Optional) The site id to target, current by default.
* @param targetInfo - (Optional) The target information.
*/
(props?: { id?: string, targetInfo?: ITargetInfoProps }): siteMethods & sites;
(props?: { siteId?: string, targetInfo?: ITargetInfoProps }): siteMethods & sites;

/** Returns the current web. */
static getCurrentWeb(): IBaseExecution<sites> & siteMethods;

/** Returns a list from the current web. */
static getList(title: string): IBaseExecution<list> & listMethods;
static getList(props: { siteId?: string, title: string }): IBaseExecution<list> & listMethods;
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/gd-sprest.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gd-sprest.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gd-sprest",
"version": "8.4.3",
"version": "8.4.4",
"description": "An easy way to develop against the SharePoint REST API.",
"author": "Gunjan Datta <[email protected]> (https://gunjandatta.github.io)",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IREST } from "../@types";
* SharePoint REST Library
*/
export const $REST: IREST = {
__ver: 8.43,
__ver: 8.44,
AppContext: (siteUrl: string) => { return Lib.Site.getAppContext(siteUrl); },
Apps: Lib.Apps,
ContextInfo: Lib.ContextInfo,
Expand Down
2 changes: 1 addition & 1 deletion src/v2/sites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export const sites: Isites = ((props: { siteId?: string, targetInfo?: ITargetInf
sites.getCurrentWeb = () => { return sites().sites(ContextInfo.webId.replace(/^\{|\}$/g, '')) as any }

/** Returns a list by its title from the current web. */
sites.getList = (title: string) => { return sites().lists(title); }
sites.getList = (props: { siteId?: string, title: string }) => { return sites({ siteId: props.siteId }).lists(props.title); }

0 comments on commit b408562

Please sign in to comment.