@webiny/api 5.42.0-beta.4 → 5.42.1-beta.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/createConditionalPluginFactory.d.ts +3 -0
- package/createConditionalPluginFactory.js +17 -0
- package/createConditionalPluginFactory.js.map +1 -0
- package/decorateContext.d.ts +5 -0
- package/decorateContext.js +21 -0
- package/decorateContext.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +22 -0
- package/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createConditionalPluginFactory = void 0;
|
|
7
|
+
const createConditionalPluginFactory = (condition, cb) => {
|
|
8
|
+
return () => {
|
|
9
|
+
if (condition()) {
|
|
10
|
+
return cb();
|
|
11
|
+
}
|
|
12
|
+
return Promise.resolve([]);
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.createConditionalPluginFactory = createConditionalPluginFactory;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=createConditionalPluginFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createConditionalPluginFactory","condition","cb","Promise","resolve","exports"],"sources":["createConditionalPluginFactory.ts"],"sourcesContent":["import { PluginFactory } from \"@webiny/plugins/types\";\n\nexport type Condition = () => boolean;\n\nexport const createConditionalPluginFactory = (\n condition: Condition,\n cb: PluginFactory\n): PluginFactory => {\n return () => {\n if (condition()) {\n return cb();\n }\n\n return Promise.resolve([]);\n };\n};\n"],"mappings":";;;;;;AAIO,MAAMA,8BAA8B,GAAGA,CAC1CC,SAAoB,EACpBC,EAAiB,KACD;EAChB,OAAO,MAAM;IACT,IAAID,SAAS,CAAC,CAAC,EAAE;MACb,OAAOC,EAAE,CAAC,CAAC;IACf;IAEA,OAAOC,OAAO,CAACC,OAAO,CAAC,EAAE,CAAC;EAC9B,CAAC;AACL,CAAC;AAACC,OAAA,CAAAL,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.decorateContext = void 0;
|
|
7
|
+
const decorateContext = (decoratee, decorators) => {
|
|
8
|
+
return Object.keys(decorators).reduce((acc, key) => {
|
|
9
|
+
const decoratedMethod = acc[key];
|
|
10
|
+
return {
|
|
11
|
+
...acc,
|
|
12
|
+
[key]: function (...args) {
|
|
13
|
+
// @ts-expect-error
|
|
14
|
+
return decorators[key](decoratedMethod.bind(decoratee))(...args);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}, decoratee);
|
|
18
|
+
};
|
|
19
|
+
exports.decorateContext = decorateContext;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=decorateContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["decorateContext","decoratee","decorators","Object","keys","reduce","acc","key","decoratedMethod","args","bind","exports"],"sources":["decorateContext.ts"],"sourcesContent":["type Decorators<TDecoratee> = {\n [K in keyof TDecoratee]?: (decoratee: TDecoratee[K]) => TDecoratee[K];\n};\n\nexport const decorateContext = <T extends Record<string, any>>(\n decoratee: T,\n decorators: Decorators<T>\n) => {\n return Object.keys(decorators).reduce((acc, key) => {\n const decoratedMethod = acc[key];\n\n return {\n ...acc,\n [key]: function (...args: any[]) {\n // @ts-expect-error\n return decorators[key](decoratedMethod.bind(decoratee))(...args);\n }\n };\n }, decoratee);\n};\n"],"mappings":";;;;;;AAIO,MAAMA,eAAe,GAAGA,CAC3BC,SAAY,EACZC,UAAyB,KACxB;EACD,OAAOC,MAAM,CAACC,IAAI,CAACF,UAAU,CAAC,CAACG,MAAM,CAAC,CAACC,GAAG,EAAEC,GAAG,KAAK;IAChD,MAAMC,eAAe,GAAGF,GAAG,CAACC,GAAG,CAAC;IAEhC,OAAO;MACH,GAAGD,GAAG;MACN,CAACC,GAAG,GAAG,UAAU,GAAGE,IAAW,EAAE;QAC7B;QACA,OAAOP,UAAU,CAACK,GAAG,CAAC,CAACC,eAAe,CAACE,IAAI,CAACT,SAAS,CAAC,CAAC,CAAC,GAAGQ,IAAI,CAAC;MACpE;IACJ,CAAC;EACL,CAAC,EAAER,SAAS,CAAC;AACjB,CAAC;AAACU,OAAA,CAAAX,eAAA,GAAAA,eAAA","ignoreList":[]}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -14,6 +14,28 @@ Object.keys(_Context).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
+
var _decorateContext = require("./decorateContext");
|
|
18
|
+
Object.keys(_decorateContext).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _decorateContext[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _decorateContext[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _createConditionalPluginFactory = require("./createConditionalPluginFactory");
|
|
29
|
+
Object.keys(_createConditionalPluginFactory).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _createConditionalPluginFactory[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _createConditionalPluginFactory[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
17
39
|
var _ServiceDiscovery = require("./ServiceDiscovery");
|
|
18
40
|
Object.keys(_ServiceDiscovery).forEach(function (key) {
|
|
19
41
|
if (key === "default" || key === "__esModule") return;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Context","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_ServiceDiscovery","_ContextPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"
|
|
1
|
+
{"version":3,"names":["_Context","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_decorateContext","_createConditionalPluginFactory","_ServiceDiscovery","_ContextPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./Context\";\nexport * from \"./decorateContext\";\nexport * from \"./createConditionalPluginFactory\";\nexport * from \"./ServiceDiscovery\";\nexport * from \"./plugins/ContextPlugin\";\n"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,gBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,gBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,gBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,gBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,+BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,+BAAA,E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
@@ -12,12 +12,12 @@
|
|
|
12
12
|
],
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@webiny/aws-sdk": "5.42.
|
|
16
|
-
"@webiny/plugins": "5.42.
|
|
15
|
+
"@webiny/aws-sdk": "5.42.1-beta.0",
|
|
16
|
+
"@webiny/plugins": "5.42.1-beta.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@webiny/cli": "5.42.
|
|
20
|
-
"@webiny/project-utils": "5.42.
|
|
19
|
+
"@webiny/cli": "5.42.1-beta.0",
|
|
20
|
+
"@webiny/project-utils": "5.42.1-beta.0",
|
|
21
21
|
"rimraf": "6.0.1",
|
|
22
22
|
"ttypescript": "1.5.15",
|
|
23
23
|
"typescript": "4.9.5"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"build": "yarn webiny run build",
|
|
31
31
|
"watch": "yarn webiny run watch"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "16fb9009f44f242bbc8ba0e02c1d49b1f7ab935b"
|
|
34
34
|
}
|