@pnp/sp 4.9.0-v4nightly.20250204 → 4.9.0-v4nightly.20250206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./spqueryable.js";
2
2
  export * from "./decorators.js";
3
3
  export { SPFI, spfi, } from "./fi.js";
4
4
  export * from "./types.js";
5
+ export * from "./utils/create-change-token.js";
5
6
  export * from "./utils/extract-web-url.js";
6
7
  export * from "./utils/file-names.js";
7
8
  export * from "./utils/odata-url-from.js";
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/sp/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EACH,IAAI,EACJ,IAAI,GACP,MAAM,SAAS,CAAC;AAEjB,cAAc,YAAY,CAAC;AAE3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/sp/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EACH,IAAI,EACJ,IAAI,GACP,MAAM,SAAS,CAAC;AAEjB,cAAc,YAAY,CAAC;AAE3B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
package/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./spqueryable.js";
2
2
  export * from "./decorators.js";
3
3
  export { SPFI, spfi, } from "./fi.js";
4
4
  export * from "./types.js";
5
+ export * from "./utils/create-change-token.js";
5
6
  export * from "./utils/extract-web-url.js";
6
7
  export * from "./utils/file-names.js";
7
8
  export * from "./utils/odata-url-from.js";
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/sp/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EACH,IAAI,EACJ,IAAI,GACP,MAAM,SAAS,CAAC;AAEjB,cAAc,YAAY,CAAC;AAE3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/sp/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EACH,IAAI,EACJ,IAAI,GACP,MAAM,SAAS,CAAC;AAEjB,cAAc,YAAY,CAAC;AAE3B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pnp/sp",
3
- "version": "4.9.0-v4nightly.20250204",
3
+ "version": "4.9.0-v4nightly.20250206",
4
4
  "description": "pnp - provides a fluent api for working with SharePoint REST",
5
5
  "main": "./index.js",
6
6
  "typings": "./index",
7
7
  "dependencies": {
8
8
  "tslib": "2.7.0",
9
- "@pnp/core": "4.9.0-v4nightly.20250204",
10
- "@pnp/queryable": "4.9.0-v4nightly.20250204"
9
+ "@pnp/core": "4.9.0-v4nightly.20250206",
10
+ "@pnp/queryable": "4.9.0-v4nightly.20250206"
11
11
  },
12
12
  "type": "module",
13
13
  "engines": {
@@ -0,0 +1,12 @@
1
+ import { IChangeToken } from "../types.js";
2
+ /**
3
+ * Creates a change token for use with sites, webs, or lists
4
+ *
5
+ * @param resourceType The type of resource for which you want a change token
6
+ * @param resource The identifier (GUID) of the resource site.Id, web.Id, or List.Id
7
+ * @param tokenDate The date for this token (if start token, start date of chages; if end token, end date of the changes)
8
+ * @param versionNumber Version number for token (default = 1)
9
+ * @returns A properly formatted change token
10
+ */
11
+ export declare function createChangeToken(resourceType: "site" | "web" | "list", resource: string, tokenDate?: Date, versionNumber?: number): IChangeToken;
12
+ //# sourceMappingURL=create-change-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-change-token.d.ts","sourceRoot":"","sources":["../../../../packages/sp/utils/create-change-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,KAAK,GAAG,MAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,IAAiB,EAAE,aAAa,SAAI,GAAG,YAAY,CAYjK"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Creates a change token for use with sites, webs, or lists
3
+ *
4
+ * @param resourceType The type of resource for which you want a change token
5
+ * @param resource The identifier (GUID) of the resource site.Id, web.Id, or List.Id
6
+ * @param tokenDate The date for this token (if start token, start date of chages; if end token, end date of the changes)
7
+ * @param versionNumber Version number for token (default = 1)
8
+ * @returns A properly formatted change token
9
+ */
10
+ export function createChangeToken(resourceType = "site", resource, tokenDate = new Date(), versionNumber = 1) {
11
+ const resourceTypeMapping = new Map([["site", 1], ["web", 2], ["list", 3]]).get(resourceType);
12
+ // The value of the string assigned to ChangeTokenStart.StringValue is semicolon delimited, and takes the following parameters in the order listed:
13
+ // Version number.
14
+ // The change scope (0 - Content Database, 1 - site collection, 2 - site, 3 - list).
15
+ // GUID of the item the scope applies to (for example, GUID of the list).
16
+ // Time (in UTC) from when changes occurred in Ticks (but its .NET ticks so we do this math)
17
+ // Initialize the change item on the ChangeToken using a default value of -1.
18
+ const tokenDateTicks = (tokenDate.getTime() * 10000) + 621355968000000000;
19
+ return { StringValue: `${versionNumber};${resourceTypeMapping};${resource};${tokenDateTicks};-1` };
20
+ }
21
+ //# sourceMappingURL=create-change-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-change-token.js","sourceRoot":"","sources":["../../../../packages/sp/utils/create-change-token.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,eAAwC,MAAM,EAAE,QAAgB,EAAE,YAAkB,IAAI,IAAI,EAAE,EAAE,aAAa,GAAG,CAAC;IAE/I,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE9F,mJAAmJ;IACnJ,kBAAkB;IAClB,oFAAoF;IACpF,yEAAyE;IACzE,4FAA4F;IAC5F,6EAA6E;IAC7E,MAAM,cAAc,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,kBAAkB,CAAC;IAC1E,OAAO,EAAE,WAAW,EAAE,GAAG,aAAa,IAAI,mBAAmB,IAAI,QAAQ,IAAI,cAAc,KAAK,EAAE,CAAC;AACvG,CAAC"}