@pnp/queryable 3.6.0 → 3.7.0
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/behaviors/cancelable.js +4 -4
- package/invokable.d.ts.map +1 -1
- package/invokable.js +2 -2
- package/invokable.js.map +1 -1
- package/package.json +2 -2
package/behaviors/cancelable.js
CHANGED
|
@@ -12,17 +12,17 @@ import { asyncBroadcast, isArray, getGUID, objectDefinedNotNull } from "@pnp/cor
|
|
|
12
12
|
*
|
|
13
13
|
* 2. Complex method present a larger challenge because they are comprised of > 1 request and the promise
|
|
14
14
|
* that is actually returned to the user is not directly from one of our calls. This promise is the
|
|
15
|
-
* one "created" by the language when you await. For complex
|
|
15
|
+
* one "created" by the language when you await. For complex methods we have two things that solve these
|
|
16
16
|
* needs.
|
|
17
17
|
*
|
|
18
|
-
* The first is the use of either the cancelableScope decorator
|
|
18
|
+
* The first is the use of either the cancelableScope decorator or the asCancelableScope method
|
|
19
19
|
* wrapper. These create an upper level cancel info that is then shared across the child requests within
|
|
20
20
|
* the complex method. Meaning if I do a files.addChunked the same cancel info (and cancel method)
|
|
21
21
|
* are set on the current "this" which is user object on which the method was called. This info is then
|
|
22
22
|
* passed down to any child requests using the original "this" as a base using the construct moment.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* The CancelAction behavior is used to apply additional actions to a request once it is canceled. For example
|
|
25
|
+
* in the case of uploading files chunked in sp we cancel the upload by id.
|
|
26
26
|
*/
|
|
27
27
|
// this is a special moment used to broadcast when a request is canceled
|
|
28
28
|
const MomentName = "__CancelMoment__";
|
package/invokable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invokable.d.ts","sourceRoot":"","sources":["../../../packages/queryable/invokable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invokable.d.ts","sourceRoot":"","sources":["../../../packages/queryable/invokable.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,YAQxE,GAAG,SAoBtB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG;IAC/B,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3C"}
|
package/invokable.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { get, op } from "./operations.js";
|
|
2
|
+
import { isFunc } from "@pnp/core";
|
|
2
3
|
/**
|
|
3
4
|
* Allows a decorated object to be invoked as a function, optionally providing an implementation for that action
|
|
4
5
|
*
|
|
@@ -6,7 +7,7 @@ import { get, op } from "./operations.js";
|
|
|
6
7
|
* @returns Decorator which applies the invokable logic to the tagged class
|
|
7
8
|
*/
|
|
8
9
|
export function invokable(invokeableAction) {
|
|
9
|
-
if (
|
|
10
|
+
if (!isFunc(invokeableAction)) {
|
|
10
11
|
invokeableAction = function (init) {
|
|
11
12
|
return op(this, get, init);
|
|
12
13
|
};
|
|
@@ -17,7 +18,6 @@ export function invokable(invokeableAction) {
|
|
|
17
18
|
const invokableInstance = Object.assign(function (init) {
|
|
18
19
|
// the "this" for our invoked object will be set by extendable OR we use invokableInstance directly
|
|
19
20
|
const localThis = typeof this === "undefined" ? invokableInstance : this;
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
21
|
return Reflect.apply(invokeableAction, localThis, [init]);
|
|
22
22
|
}, Reflect.construct(clz, args, newTarget));
|
|
23
23
|
Reflect.setPrototypeOf(invokableInstance, newTarget.prototype);
|
package/invokable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invokable.js","sourceRoot":"","sources":["../../../packages/queryable/invokable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"invokable.js","sourceRoot":"","sources":["../../../packages/queryable/invokable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,gBAAkE;IAExF,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE;QAC3B,gBAAgB,GAAG,UAAqB,IAAkB;YACtD,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC;KACL;IAED,OAAO,CAAC,MAAW,EAAE,EAAE;QAEnB,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE;YAErB,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,SAAc;gBAE/B,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,IAAkB;oBAEhE,mGAAmG;oBACnG,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC;oBACzE,OAAO,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;gBAE9D,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;gBAE5C,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;gBAE/D,OAAO,iBAAiB,CAAC;YAC7B,CAAC;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/queryable",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "pnp - provides shared odata functionality and base classes",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"tslib": "2.4.0",
|
|
9
|
-
"@pnp/core": "3.
|
|
9
|
+
"@pnp/core": "3.7.0"
|
|
10
10
|
},
|
|
11
11
|
"funding": {
|
|
12
12
|
"type": "individual",
|