@webiny/api 0.0.0-unstable.e622468070 → 0.0.0-unstable.e9333b3f0b
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/Benchmark.js +120 -149
- package/Benchmark.js.map +1 -1
- package/Context.d.ts +1 -3
- package/Context.js +59 -130
- package/Context.js.map +1 -1
- package/abstractions.d.ts +5 -0
- package/abstractions.js +5 -0
- package/abstractions.js.map +1 -0
- package/createConditionalPluginFactory.js +5 -8
- package/createConditionalPluginFactory.js.map +1 -1
- package/decorateContext.js +10 -12
- package/decorateContext.js.map +1 -1
- package/helpers/InterfaceGenerator/date.js +0 -3
- package/helpers/InterfaceGenerator/id.js +0 -3
- package/helpers/InterfaceGenerator/identity.js +0 -3
- package/helpers/InterfaceGenerator/index.d.ts +1 -0
- package/helpers/InterfaceGenerator/index.js +0 -3
- package/helpers/InterfaceGenerator/numeric.js +0 -3
- package/helpers/InterfaceGenerator/text.d.ts +11 -0
- package/helpers/InterfaceGenerator/text.js +0 -0
- package/helpers/InterfaceGenerator/truthful.js +0 -3
- package/index.d.ts +1 -3
- package/index.js +1 -5
- package/package.json +17 -14
- package/plugins/BenchmarkPlugin.js +18 -19
- package/plugins/BenchmarkPlugin.js.map +1 -1
- package/testing/index.d.ts +3 -0
- package/testing/index.js +3 -0
- package/testing/lifecycleTracker.d.ts +14 -0
- package/testing/lifecycleTracker.js +37 -0
- package/testing/lifecycleTracker.js.map +1 -0
- package/testing/sleep.d.ts +1 -0
- package/testing/sleep.js +6 -0
- package/testing/sleep.js.map +1 -0
- package/testing/until.d.ts +7 -0
- package/testing/until.js +22 -0
- package/testing/until.js.map +1 -0
- package/types.d.ts +1 -6
- package/types.js +0 -3
- package/ServiceDiscovery.d.ts +0 -12
- package/ServiceDiscovery.js +0 -70
- package/ServiceDiscovery.js.map +0 -1
- package/helpers/InterfaceGenerator/date.js.map +0 -1
- package/helpers/InterfaceGenerator/id.js.map +0 -1
- package/helpers/InterfaceGenerator/identity.js.map +0 -1
- package/helpers/InterfaceGenerator/index.js.map +0 -1
- package/helpers/InterfaceGenerator/numeric.js.map +0 -1
- package/helpers/InterfaceGenerator/truthful.js.map +0 -1
- package/index.js.map +0 -1
- package/plugins/CompressorPlugin.d.ts +0 -14
- package/plugins/CompressorPlugin.js +0 -14
- package/plugins/CompressorPlugin.js.map +0 -1
- package/plugins/ContextPlugin.d.ts +0 -16
- package/plugins/ContextPlugin.js +0 -23
- package/plugins/ContextPlugin.js.map +0 -1
- package/types.js.map +0 -1
package/decorateContext.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"decorateContext.js","sources":["../src/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"],"names":["decorateContext","decoratee","decorators","Object","acc","key","decoratedMethod","args"],"mappings":"AAIO,MAAMA,kBAAkB,CAC3BC,WACAC,aAEOC,OAAO,IAAI,CAACD,YAAY,MAAM,CAAC,CAACE,KAAKC;QACxC,MAAMC,kBAAkBF,GAAG,CAACC,IAAI;QAEhC,OAAO;YACH,GAAGD,GAAG;YACN,CAACC,IAAI,EAAE,SAAU,GAAGE,IAAW;gBAE3B,OAAOL,UAAU,CAACG,IAAI,CAACC,gBAAgB,IAAI,CAACL,eAAeM;YAC/D;QACJ;IACJ,GAAGN"}
|
|
@@ -3,3 +3,4 @@ export type { DateInterfaceGenerator, DateStringInterfaceGenerator } from "./dat
|
|
|
3
3
|
export type { IdentityInterfaceGenerator } from "./identity.js";
|
|
4
4
|
export type { NumericInterfaceGenerator } from "./numeric.js";
|
|
5
5
|
export type { TruthfulInterfaceGenerator } from "./truthful.js";
|
|
6
|
+
export type { TextInterfaceGenerator } from "./text.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type TextOperators<TType extends string> = {
|
|
2
|
+
"": TType;
|
|
3
|
+
_not: TType;
|
|
4
|
+
_in: TType[];
|
|
5
|
+
_not_in: TType[];
|
|
6
|
+
_contains: TType;
|
|
7
|
+
};
|
|
8
|
+
export type TextInterfaceGenerator<TName extends string, TType extends string = string> = {
|
|
9
|
+
[K in keyof TextOperators<TType> as `${TName}${K}`]?: TextOperators<TType>[K];
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
1
2
|
export * from "./Context.js";
|
|
2
|
-
export * from "./plugins/CompressorPlugin.js";
|
|
3
3
|
export * from "./decorateContext.js";
|
|
4
4
|
export * from "./createConditionalPluginFactory.js";
|
|
5
|
-
export * from "./ServiceDiscovery.js";
|
|
6
|
-
export * from "./plugins/ContextPlugin.js";
|
|
7
5
|
export * from "./helpers/InterfaceGenerator/index.js";
|
package/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
1
2
|
export * from "./Context.js";
|
|
2
|
-
export * from "./plugins/CompressorPlugin.js";
|
|
3
3
|
export * from "./decorateContext.js";
|
|
4
4
|
export * from "./createConditionalPluginFactory.js";
|
|
5
|
-
export * from "./ServiceDiscovery.js";
|
|
6
|
-
export * from "./plugins/ContextPlugin.js";
|
|
7
5
|
export * from "./helpers/InterfaceGenerator/index.js";
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.e9333b3f0b",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
8
11
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -13,21 +16,21 @@
|
|
|
13
16
|
],
|
|
14
17
|
"license": "MIT",
|
|
15
18
|
"dependencies": {
|
|
16
|
-
"@webiny/
|
|
17
|
-
"@webiny/
|
|
18
|
-
"@webiny/
|
|
19
|
-
"@webiny/utils": "0.0.0-unstable.e622468070"
|
|
19
|
+
"@webiny/feature": "0.0.0-unstable.e9333b3f0b",
|
|
20
|
+
"@webiny/plugins": "0.0.0-unstable.e9333b3f0b",
|
|
21
|
+
"@webiny/utils": "0.0.0-unstable.e9333b3f0b"
|
|
20
22
|
},
|
|
21
23
|
"devDependencies": {
|
|
22
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"vitest": "3.2.4"
|
|
24
|
+
"@webiny/build-tools": "0.0.0-unstable.e9333b3f0b",
|
|
25
|
+
"rimraf": "6.1.3",
|
|
26
|
+
"typescript": "7.0.2",
|
|
27
|
+
"vitest": "4.1.11"
|
|
27
28
|
},
|
|
28
29
|
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
30
|
-
"directory": "dist"
|
|
30
|
+
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "8476da73b653c89cc1474d968baf55c1b0ae0e5f",
|
|
33
|
+
"webiny": {
|
|
34
|
+
"publishFrom": "dist"
|
|
35
|
+
}
|
|
33
36
|
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return this.benchmark.measure(name, cb);
|
|
20
|
-
}
|
|
2
|
+
class BenchmarkPlugin extends Plugin {
|
|
3
|
+
static{
|
|
4
|
+
this.type = "context.benchmark";
|
|
5
|
+
}
|
|
6
|
+
constructor(benchmark){
|
|
7
|
+
super(), this.name = "context.benchmark";
|
|
8
|
+
this.benchmark = benchmark;
|
|
9
|
+
}
|
|
10
|
+
enable() {
|
|
11
|
+
this.benchmark.enable();
|
|
12
|
+
}
|
|
13
|
+
disable() {
|
|
14
|
+
this.benchmark.disable();
|
|
15
|
+
}
|
|
16
|
+
async measure(name, cb) {
|
|
17
|
+
return this.benchmark.measure(name, cb);
|
|
18
|
+
}
|
|
21
19
|
}
|
|
20
|
+
export { BenchmarkPlugin };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=BenchmarkPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"plugins/BenchmarkPlugin.js","sources":["../../src/plugins/BenchmarkPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Benchmark } from \"~/types.js\";\n\n/**\n * This plugin should be initialized only once per context, hence the name of the plugin.\n */\nexport class BenchmarkPlugin extends Plugin {\n public static override readonly type: string = \"context.benchmark\";\n public override name = \"context.benchmark\";\n public readonly benchmark: Benchmark;\n\n public constructor(benchmark: Benchmark) {\n super();\n this.benchmark = benchmark;\n }\n\n public enable(): void {\n this.benchmark.enable();\n }\n\n public disable(): void {\n this.benchmark.disable();\n }\n\n public async measure<T = any>(name: string, cb: () => Promise<T>): Promise<T> {\n return this.benchmark.measure<T>(name, cb);\n }\n}\n"],"names":["BenchmarkPlugin","Plugin","benchmark","name","cb"],"mappings":";AAMO,MAAMA,wBAAwBC;;aACD,IAAI,GAAW;;IAI/C,YAAmBC,SAAoB,CAAE;QACrC,KAAK,SAJO,IAAI,GAAG;QAKnB,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEO,SAAe;QAClB,IAAI,CAAC,SAAS,CAAC,MAAM;IACzB;IAEO,UAAgB;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO;IAC1B;IAEA,MAAa,QAAiBC,IAAY,EAAEC,EAAoB,EAAc;QAC1E,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAID,MAAMC;IAC3C;AACJ"}
|
package/testing/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Track {
|
|
2
|
+
count: number;
|
|
3
|
+
params: any;
|
|
4
|
+
}
|
|
5
|
+
export declare class LifecycleEventTracker {
|
|
6
|
+
private _tracked;
|
|
7
|
+
track(name: string, params: any): void;
|
|
8
|
+
getLast(name: string): Track | null;
|
|
9
|
+
reset(): void;
|
|
10
|
+
isExecutedOnce(name: string): boolean;
|
|
11
|
+
isExecuted(name: string): boolean;
|
|
12
|
+
getExecuted(name: string): number;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class LifecycleEventTracker {
|
|
2
|
+
track(name, params) {
|
|
3
|
+
if (!this._tracked[name]) this._tracked[name] = {
|
|
4
|
+
count: 0,
|
|
5
|
+
params: []
|
|
6
|
+
};
|
|
7
|
+
this._tracked[name] = {
|
|
8
|
+
count: this._tracked[name].count + 1,
|
|
9
|
+
params: this._tracked[name].params.concat([
|
|
10
|
+
params
|
|
11
|
+
])
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
getLast(name) {
|
|
15
|
+
return this._tracked[name] || null;
|
|
16
|
+
}
|
|
17
|
+
reset() {
|
|
18
|
+
this._tracked = {};
|
|
19
|
+
}
|
|
20
|
+
isExecutedOnce(name) {
|
|
21
|
+
if (!this._tracked[name]) return false;
|
|
22
|
+
return 1 === this._tracked[name].count;
|
|
23
|
+
}
|
|
24
|
+
isExecuted(name) {
|
|
25
|
+
return !!this._tracked[name];
|
|
26
|
+
}
|
|
27
|
+
getExecuted(name) {
|
|
28
|
+
if (!this._tracked[name]) return 0;
|
|
29
|
+
return this._tracked[name].count;
|
|
30
|
+
}
|
|
31
|
+
constructor(){
|
|
32
|
+
this._tracked = {};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export { LifecycleEventTracker };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=lifecycleTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing/lifecycleTracker.js","sources":["../../src/testing/lifecycleTracker.ts"],"sourcesContent":["interface Track {\n count: number;\n params: any;\n}\n\ninterface Trackers {\n [key: string]: Track;\n}\n\nexport class LifecycleEventTracker {\n private _tracked: Trackers = {};\n\n public track(name: string, params: any): void {\n if (!this._tracked[name]) {\n this._tracked[name] = {\n count: 0,\n params: []\n };\n }\n this._tracked[name] = {\n count: this._tracked[name].count + 1,\n params: this._tracked[name].params.concat([params])\n };\n }\n\n public getLast(name: string): Track | null {\n return this._tracked[name] || null;\n }\n\n public reset(): void {\n this._tracked = {};\n }\n\n public isExecutedOnce(name: string): boolean {\n if (!this._tracked[name]) {\n return false;\n }\n return this._tracked[name].count === 1;\n }\n\n public isExecuted(name: string): boolean {\n return !!this._tracked[name];\n }\n\n public getExecuted(name: string): number {\n if (!this._tracked[name]) {\n return 0;\n }\n return this._tracked[name].count;\n }\n}\n"],"names":["LifecycleEventTracker","name","params"],"mappings":"AASO,MAAMA;IAGF,MAAMC,IAAY,EAAEC,MAAW,EAAQ;QAC1C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAACD,KAAK,EACpB,IAAI,CAAC,QAAQ,CAACA,KAAK,GAAG;YAClB,OAAO;YACP,QAAQ,EAAE;QACd;QAEJ,IAAI,CAAC,QAAQ,CAACA,KAAK,GAAG;YAClB,OAAO,IAAI,CAAC,QAAQ,CAACA,KAAK,CAAC,KAAK,GAAG;YACnC,QAAQ,IAAI,CAAC,QAAQ,CAACA,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;gBAACC;aAAO;QACtD;IACJ;IAEO,QAAQD,IAAY,EAAgB;QACvC,OAAO,IAAI,CAAC,QAAQ,CAACA,KAAK,IAAI;IAClC;IAEO,QAAc;QACjB,IAAI,CAAC,QAAQ,GAAG,CAAC;IACrB;IAEO,eAAeA,IAAY,EAAW;QACzC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAACA,KAAK,EACpB,OAAO;QAEX,OAAO,AAA8B,MAA9B,IAAI,CAAC,QAAQ,CAACA,KAAK,CAAC,KAAK;IACpC;IAEO,WAAWA,IAAY,EAAW;QACrC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAACA,KAAK;IAChC;IAEO,YAAYA,IAAY,EAAU;QACrC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAACA,KAAK,EACpB,OAAO;QAEX,OAAO,IAAI,CAAC,QAAQ,CAACA,KAAK,CAAC,KAAK;IACpC;;aAvCQ,QAAQ,GAAa,CAAC;;AAwClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sleep: (ms?: number) => Promise<unknown>;
|
package/testing/sleep.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing/sleep.js","sources":["../../src/testing/sleep.ts"],"sourcesContent":["export const sleep = (ms = 333) => {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n};\n"],"names":["sleep","ms","Promise","resolve","setTimeout"],"mappings":"AAAO,MAAMA,QAAQ,CAACC,KAAK,GAAG,GACnB,IAAIC,QAAQC,CAAAA;QACfC,WAAWD,SAASF;IACxB"}
|
package/testing/until.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sleep } from "./sleep.js";
|
|
2
|
+
const until_until = async (execute, until, options = {})=>{
|
|
3
|
+
const { name = "NO_NAME", tries = 10, wait = 1000, debounce = 0 } = options;
|
|
4
|
+
let result;
|
|
5
|
+
let triesCount = 0;
|
|
6
|
+
if (debounce > 0) await sleep(debounce);
|
|
7
|
+
while(true){
|
|
8
|
+
result = await execute();
|
|
9
|
+
let done;
|
|
10
|
+
try {
|
|
11
|
+
done = await until(result);
|
|
12
|
+
} catch {}
|
|
13
|
+
if (done) return result;
|
|
14
|
+
triesCount++;
|
|
15
|
+
if (triesCount === tries) break;
|
|
16
|
+
await sleep(wait);
|
|
17
|
+
}
|
|
18
|
+
throw new Error(`[${name}] Tried ${tries} times but failed.`);
|
|
19
|
+
};
|
|
20
|
+
export { until_until as until };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=until.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing/until.js","sources":["../../src/testing/until.ts"],"sourcesContent":["import { sleep } from \"./sleep.js\";\n\nexport interface UntilOptions {\n name?: string;\n tries?: number;\n wait?: number;\n debounce?: number;\n}\n\nexport const until = async (\n execute: () => Promise<any>,\n until: (response: any) => boolean,\n options: UntilOptions = {}\n) => {\n const { name = \"NO_NAME\", tries = 10, wait = 1000, debounce = 0 } = options;\n\n let result;\n let triesCount = 0;\n\n if (debounce > 0) {\n await sleep(debounce);\n }\n\n while (true) {\n result = await execute();\n\n let done;\n try {\n done = await until(result);\n } catch {}\n\n if (done) {\n return result;\n }\n\n triesCount++;\n if (triesCount === tries) {\n break;\n }\n\n // Wait.\n await sleep(wait);\n }\n\n throw new Error(`[${name}] Tried ${tries} times but failed.`);\n};\n"],"names":["until","execute","options","name","tries","wait","debounce","result","triesCount","sleep","done","Error"],"mappings":";AASO,MAAMA,cAAQ,OACjBC,SACAD,OACAE,UAAwB,CAAC,CAAC;IAE1B,MAAM,EAAEC,OAAO,SAAS,EAAEC,QAAQ,EAAE,EAAEC,OAAO,IAAI,EAAEC,WAAW,CAAC,EAAE,GAAGJ;IAEpE,IAAIK;IACJ,IAAIC,aAAa;IAEjB,IAAIF,WAAW,GACX,MAAMG,MAAMH;IAGhB,MAAO,KAAM;QACTC,SAAS,MAAMN;QAEf,IAAIS;QACJ,IAAI;YACAA,OAAO,MAAMV,MAAMO;QACvB,EAAE,OAAM,CAAC;QAET,IAAIG,MACA,OAAOH;QAGXC;QACA,IAAIA,eAAeJ,OACf;QAIJ,MAAMK,MAAMJ;IAChB;IAEA,MAAM,IAAIM,MAAM,CAAC,CAAC,EAAER,KAAK,QAAQ,EAAEC,MAAM,kBAAkB,CAAC;AAChE"}
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Container } from "@webiny/
|
|
1
|
+
import type { Container } from "@webiny/feature/api";
|
|
2
2
|
import type { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
import type { ICompressor } from "@webiny/utils/compression/Compressor.js";
|
|
4
3
|
export type GenericRecord<K extends PropertyKey = PropertyKey, V = any> = Record<K, V>;
|
|
5
4
|
export type NonEmptyArray<T> = [T, ...T[]];
|
|
6
5
|
export type PossiblyUndefinedProperties<T> = {
|
|
@@ -77,8 +76,4 @@ export interface Context {
|
|
|
77
76
|
* Benchmark instance to help determine possible bugs and slow code.
|
|
78
77
|
*/
|
|
79
78
|
benchmark: Benchmark;
|
|
80
|
-
/**
|
|
81
|
-
* Compressor instance to compress and decompress the data.
|
|
82
|
-
*/
|
|
83
|
-
compressor: ICompressor;
|
|
84
79
|
}
|
package/types.js
CHANGED
package/ServiceDiscovery.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
-
import type { GenericRecord } from "./types.js";
|
|
3
|
-
type Manifest = GenericRecord<string>;
|
|
4
|
-
export declare class ServiceDiscovery {
|
|
5
|
-
static setDocumentClient(client: Pick<DynamoDBDocument, "send">): void;
|
|
6
|
-
static load(): Promise<Manifest | undefined>;
|
|
7
|
-
/**
|
|
8
|
-
* Should be used for testing purposes only!
|
|
9
|
-
*/
|
|
10
|
-
static clear(): void;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
package/ServiceDiscovery.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { getDocumentClient, QueryCommand, unmarshall } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
-
class ServiceManifestLoader {
|
|
3
|
-
manifest = undefined;
|
|
4
|
-
async load() {
|
|
5
|
-
if (this.manifest) {
|
|
6
|
-
return this.manifest;
|
|
7
|
-
}
|
|
8
|
-
const manifests = await this.loadManifests();
|
|
9
|
-
if (!manifests) {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Service manifests are already merged by unique names in the database, so we only need to construct
|
|
15
|
-
* a final object containing all manifests by name.
|
|
16
|
-
*/
|
|
17
|
-
this.manifest = manifests.reduce((acc, manifest) => {
|
|
18
|
-
return {
|
|
19
|
-
...acc,
|
|
20
|
-
[manifest.name]: manifest.manifest
|
|
21
|
-
};
|
|
22
|
-
}, {});
|
|
23
|
-
return this.manifest;
|
|
24
|
-
}
|
|
25
|
-
setDocumentClient(client) {
|
|
26
|
-
this.client = client;
|
|
27
|
-
}
|
|
28
|
-
clear() {
|
|
29
|
-
this.manifest = undefined;
|
|
30
|
-
}
|
|
31
|
-
async loadManifests() {
|
|
32
|
-
const client = this.client || getDocumentClient();
|
|
33
|
-
const {
|
|
34
|
-
Items
|
|
35
|
-
} = await client.send(new QueryCommand({
|
|
36
|
-
TableName: String(process.env.DB_TABLE),
|
|
37
|
-
IndexName: "GSI1",
|
|
38
|
-
KeyConditionExpression: "GSI1_PK = :GSI1_PK AND GSI1_SK > :GSI1_SK",
|
|
39
|
-
ExpressionAttributeValues: {
|
|
40
|
-
":GSI1_PK": {
|
|
41
|
-
S: `SERVICE_MANIFESTS`
|
|
42
|
-
},
|
|
43
|
-
":GSI1_SK": {
|
|
44
|
-
S: " "
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}));
|
|
48
|
-
if (!Array.isArray(Items)) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
return Items.map(item => unmarshall(item).data);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const serviceManifestLoader = new ServiceManifestLoader();
|
|
55
|
-
export class ServiceDiscovery {
|
|
56
|
-
static setDocumentClient(client) {
|
|
57
|
-
serviceManifestLoader.setDocumentClient(client);
|
|
58
|
-
}
|
|
59
|
-
static async load() {
|
|
60
|
-
return serviceManifestLoader.load();
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Should be used for testing purposes only!
|
|
64
|
-
*/
|
|
65
|
-
static clear() {
|
|
66
|
-
serviceManifestLoader.clear();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=ServiceDiscovery.js.map
|
package/ServiceDiscovery.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDocumentClient","QueryCommand","unmarshall","ServiceManifestLoader","manifest","undefined","load","manifests","loadManifests","reduce","acc","name","setDocumentClient","client","clear","Items","send","TableName","String","process","env","DB_TABLE","IndexName","KeyConditionExpression","ExpressionAttributeValues","S","Array","isArray","map","item","data","serviceManifestLoader","ServiceDiscovery"],"sources":["ServiceDiscovery.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport {\n getDocumentClient,\n QueryCommand,\n unmarshall\n} from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { GenericRecord } from \"~/types.js\";\n\ninterface ServiceManifest {\n name: string;\n manifest: Manifest;\n}\n\ntype Manifest = GenericRecord<string>;\n\nclass ServiceManifestLoader {\n private client: Pick<DynamoDBDocument, \"send\"> | undefined;\n private manifest: Manifest | undefined = undefined;\n\n public async load() {\n if (this.manifest) {\n return this.manifest;\n }\n\n const manifests = await this.loadManifests();\n\n if (!manifests) {\n return undefined;\n }\n\n /**\n * Service manifests are already merged by unique names in the database, so we only need to construct\n * a final object containing all manifests by name.\n */\n this.manifest = manifests.reduce((acc, manifest) => {\n return { ...acc, [manifest.name]: manifest.manifest };\n }, {});\n\n return this.manifest;\n }\n\n public setDocumentClient(client: Pick<DynamoDBDocument, \"send\">) {\n this.client = client;\n }\n\n public clear(): void {\n this.manifest = undefined;\n }\n\n private async loadManifests(): Promise<ServiceManifest[] | undefined> {\n const client = this.client || getDocumentClient();\n const { Items } = await client.send(\n new QueryCommand({\n TableName: String(process.env.DB_TABLE),\n IndexName: \"GSI1\",\n KeyConditionExpression: \"GSI1_PK = :GSI1_PK AND GSI1_SK > :GSI1_SK\",\n ExpressionAttributeValues: {\n \":GSI1_PK\": { S: `SERVICE_MANIFESTS` },\n \":GSI1_SK\": { S: \" \" }\n }\n })\n );\n\n if (!Array.isArray(Items)) {\n return undefined;\n }\n\n return Items.map(item => unmarshall(item).data);\n }\n}\n\nconst serviceManifestLoader = new ServiceManifestLoader();\n\nexport class ServiceDiscovery {\n static setDocumentClient(client: Pick<DynamoDBDocument, \"send\">): void {\n serviceManifestLoader.setDocumentClient(client);\n }\n\n static async load() {\n return serviceManifestLoader.load();\n }\n /**\n * Should be used for testing purposes only!\n */\n static clear(): void {\n serviceManifestLoader.clear();\n }\n}\n"],"mappings":"AACA,SACIA,iBAAiB,EACjBC,YAAY,EACZC,UAAU,QACP,0CAA0C;AAUjD,MAAMC,qBAAqB,CAAC;EAEhBC,QAAQ,GAAyBC,SAAS;EAElD,MAAaC,IAAIA,CAAA,EAAG;IAChB,IAAI,IAAI,CAACF,QAAQ,EAAE;MACf,OAAO,IAAI,CAACA,QAAQ;IACxB;IAEA,MAAMG,SAAS,GAAG,MAAM,IAAI,CAACC,aAAa,CAAC,CAAC;IAE5C,IAAI,CAACD,SAAS,EAAE;MACZ,OAAOF,SAAS;IACpB;;IAEA;AACR;AACA;AACA;IACQ,IAAI,CAACD,QAAQ,GAAGG,SAAS,CAACE,MAAM,CAAC,CAACC,GAAG,EAAEN,QAAQ,KAAK;MAChD,OAAO;QAAE,GAAGM,GAAG;QAAE,CAACN,QAAQ,CAACO,IAAI,GAAGP,QAAQ,CAACA;MAAS,CAAC;IACzD,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,OAAO,IAAI,CAACA,QAAQ;EACxB;EAEOQ,iBAAiBA,CAACC,MAAsC,EAAE;IAC7D,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOC,KAAKA,CAAA,EAAS;IACjB,IAAI,CAACV,QAAQ,GAAGC,SAAS;EAC7B;EAEA,MAAcG,aAAaA,CAAA,EAA2C;IAClE,MAAMK,MAAM,GAAG,IAAI,CAACA,MAAM,IAAIb,iBAAiB,CAAC,CAAC;IACjD,MAAM;MAAEe;IAAM,CAAC,GAAG,MAAMF,MAAM,CAACG,IAAI,CAC/B,IAAIf,YAAY,CAAC;MACbgB,SAAS,EAAEC,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,CAAC;MACvCC,SAAS,EAAE,MAAM;MACjBC,sBAAsB,EAAE,2CAA2C;MACnEC,yBAAyB,EAAE;QACvB,UAAU,EAAE;UAAEC,CAAC,EAAE;QAAoB,CAAC;QACtC,UAAU,EAAE;UAAEA,CAAC,EAAE;QAAI;MACzB;IACJ,CAAC,CACL,CAAC;IAED,IAAI,CAACC,KAAK,CAACC,OAAO,CAACZ,KAAK,CAAC,EAAE;MACvB,OAAOV,SAAS;IACpB;IAEA,OAAOU,KAAK,CAACa,GAAG,CAACC,IAAI,IAAI3B,UAAU,CAAC2B,IAAI,CAAC,CAACC,IAAI,CAAC;EACnD;AACJ;AAEA,MAAMC,qBAAqB,GAAG,IAAI5B,qBAAqB,CAAC,CAAC;AAEzD,OAAO,MAAM6B,gBAAgB,CAAC;EAC1B,OAAOpB,iBAAiBA,CAACC,MAAsC,EAAQ;IACnEkB,qBAAqB,CAACnB,iBAAiB,CAACC,MAAM,CAAC;EACnD;EAEA,aAAaP,IAAIA,CAAA,EAAG;IAChB,OAAOyB,qBAAqB,CAACzB,IAAI,CAAC,CAAC;EACvC;EACA;AACJ;AACA;EACI,OAAOQ,KAAKA,CAAA,EAAS;IACjBiB,qBAAqB,CAACjB,KAAK,CAAC,CAAC;EACjC;AACJ","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["date.ts"],"sourcesContent":["type DateOps<T> = {\n \"\": T;\n _gt: T;\n _gte: T;\n _lt: T;\n _lte: T;\n _between: [T, T];\n};\n\nexport type DateInterfaceGenerator<Name extends string> = {\n [K in keyof DateOps<Date> as `${Name}${K}`]?: DateOps<Date>[K];\n};\n\nexport type DateStringInterfaceGenerator<Name extends string> = {\n [K in keyof DateOps<string> as `${Name}${K}`]?: DateOps<string>[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["id.ts"],"sourcesContent":["type IdOperators<TType extends string> = {\n \"\": TType;\n _not: TType;\n _in: TType[];\n _not_in: TType[];\n};\n\nexport type IdInterfaceGenerator<TName extends string, TType extends string = string> = {\n [K in keyof IdOperators<TType> as `${TName}${K}`]?: IdOperators<TType>[K];\n};\n\ntype IdMixedOperators = {\n \"\": string;\n _not: string;\n _in: string[];\n _not_in: string[];\n _gt: number | string;\n _gte: number | string;\n _lt: number | string;\n _lte: number | string;\n};\n\nexport type IdMixedInterfaceGenerator<TName extends string> = {\n [K in keyof IdMixedOperators as `${TName}${K}`]?: IdMixedOperators[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["identity.ts"],"sourcesContent":["type IdentityOps<TId> = {\n \"\": TId;\n _not: TId;\n _in: TId[];\n _not_in: TId[];\n};\n\nexport type IdentityInterfaceGenerator<Name extends string, TId = string> = {\n [K in keyof IdentityOps<TId> as `${Name}${K}`]?: IdentityOps<TId>[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export type { IdInterfaceGenerator, IdMixedInterfaceGenerator } from \"./id.js\";\nexport type { DateInterfaceGenerator, DateStringInterfaceGenerator } from \"./date.js\";\nexport type { IdentityInterfaceGenerator } from \"./identity.js\";\nexport type { NumericInterfaceGenerator } from \"./numeric.js\";\nexport type { TruthfulInterfaceGenerator } from \"./truthful.js\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["numeric.ts"],"sourcesContent":["type Numeric = {\n \"\": number;\n _gt: number;\n _gte: number;\n _lt: number;\n _lte: number;\n _between: [number, number];\n};\n\nexport type NumericInterfaceGenerator<Name extends string> = {\n [K in keyof Numeric as `${Name}${K}`]?: Numeric[K];\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["truthful.ts"],"sourcesContent":["type Truthful = {\n \"\": boolean;\n};\n\nexport type TruthfulInterfaceGenerator<Name extends string> = {\n [K in keyof Truthful as `${Name}${K}`]?: Truthful[K];\n};\n"],"mappings":"","ignoreList":[]}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Context.js\";\nexport * from \"./plugins/CompressorPlugin.js\";\nexport * from \"./decorateContext.js\";\nexport * from \"./createConditionalPluginFactory.js\";\nexport * from \"./ServiceDiscovery.js\";\nexport * from \"./plugins/ContextPlugin.js\";\nexport * from \"./helpers/InterfaceGenerator/index.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins/Plugin.js";
|
|
2
|
-
import type { ICompressor } from "@webiny/utils/compression/Compressor.js";
|
|
3
|
-
export interface ICompressorPluginParams {
|
|
4
|
-
getCompressor(): ICompressor;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Should never be initialized outside the api package.
|
|
8
|
-
*/
|
|
9
|
-
export declare class CompressorPlugin extends Plugin {
|
|
10
|
-
readonly name: string;
|
|
11
|
-
static type: string;
|
|
12
|
-
readonly getCompressor: () => ICompressor;
|
|
13
|
-
constructor(params: ICompressorPluginParams);
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins/Plugin.js";
|
|
2
|
-
/**
|
|
3
|
-
* Should never be initialized outside the api package.
|
|
4
|
-
*/
|
|
5
|
-
export class CompressorPlugin extends Plugin {
|
|
6
|
-
name = "context.compressor";
|
|
7
|
-
static type = "context.compressor";
|
|
8
|
-
constructor(params) {
|
|
9
|
-
super();
|
|
10
|
-
this.getCompressor = params.getCompressor;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=CompressorPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Plugin","CompressorPlugin","name","type","constructor","params","getCompressor"],"sources":["CompressorPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { ICompressor } from \"@webiny/utils/compression/Compressor.js\";\n\nexport interface ICompressorPluginParams {\n getCompressor(): ICompressor;\n}\n\n/**\n * Should never be initialized outside the api package.\n */\nexport class CompressorPlugin extends Plugin {\n public override readonly name: string = \"context.compressor\";\n public static override type: string = \"context.compressor\";\n\n public readonly getCompressor: () => ICompressor;\n\n public constructor(params: ICompressorPluginParams) {\n super();\n this.getCompressor = params.getCompressor;\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,2BAA2B;AAOlD;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASD,MAAM,CAAC;EAChBE,IAAI,GAAW,oBAAoB;EAC5D,OAAuBC,IAAI,GAAW,oBAAoB;EAInDC,WAAWA,CAACC,MAA+B,EAAE;IAChD,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,aAAa,GAAGD,MAAM,CAACC,aAAa;EAC7C;AACJ","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import type { Context } from "../types.js";
|
|
3
|
-
export interface ContextPluginCallable<T extends Context = Context> {
|
|
4
|
-
(context: T): void | Promise<void>;
|
|
5
|
-
}
|
|
6
|
-
export declare class ContextPlugin<T extends Context = Context> extends Plugin {
|
|
7
|
-
static readonly type: string;
|
|
8
|
-
private readonly _callable;
|
|
9
|
-
constructor(callable: ContextPluginCallable<T>);
|
|
10
|
-
apply(context: T): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
interface ContextPluginOptions {
|
|
13
|
-
name?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const createContextPlugin: <T extends Context = Context>(callable: ContextPluginCallable<T>, options?: ContextPluginOptions) => ContextPlugin<T>;
|
|
16
|
-
export {};
|
package/plugins/ContextPlugin.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
export class ContextPlugin extends Plugin {
|
|
3
|
-
static type = "context";
|
|
4
|
-
constructor(callable) {
|
|
5
|
-
super();
|
|
6
|
-
this._callable = callable;
|
|
7
|
-
}
|
|
8
|
-
async apply(context) {
|
|
9
|
-
if (typeof this._callable !== "function") {
|
|
10
|
-
throw Error(`Missing callable in ContextPlugin! Either pass a callable to plugin constructor or extend the plugin and override the "apply" method.`);
|
|
11
|
-
}
|
|
12
|
-
return this._callable(context);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export const createContextPlugin = (callable, options) => {
|
|
16
|
-
const plugin = new ContextPlugin(callable);
|
|
17
|
-
if (options && options.name) {
|
|
18
|
-
plugin.name = options.name;
|
|
19
|
-
}
|
|
20
|
-
return plugin;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=ContextPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Plugin","ContextPlugin","type","constructor","callable","_callable","apply","context","Error","createContextPlugin","options","plugin","name"],"sources":["ContextPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Context } from \"~/types.js\";\n\nexport interface ContextPluginCallable<T extends Context = Context> {\n (context: T): void | Promise<void>;\n}\n\nexport class ContextPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"context\";\n private readonly _callable: ContextPluginCallable<T>;\n\n constructor(callable: ContextPluginCallable<T>) {\n super();\n this._callable = callable;\n }\n\n public async apply(context: T): Promise<void> {\n if (typeof this._callable !== \"function\") {\n throw Error(\n `Missing callable in ContextPlugin! Either pass a callable to plugin constructor or extend the plugin and override the \"apply\" method.`\n );\n }\n\n return this._callable(context);\n }\n}\n\ninterface ContextPluginOptions {\n name?: string;\n}\n\nexport const createContextPlugin = <T extends Context = Context>(\n callable: ContextPluginCallable<T>,\n options?: ContextPluginOptions\n): ContextPlugin<T> => {\n const plugin = new ContextPlugin<T>(callable);\n if (options && options.name) {\n plugin.name = options.name;\n }\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,iBAAiB;AAOxC,OAAO,MAAMC,aAAa,SAAsCD,MAAM,CAAC;EACnE,OAAgCE,IAAI,GAAW,SAAS;EAGxDC,WAAWA,CAACC,QAAkC,EAAE;IAC5C,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,SAAS,GAAGD,QAAQ;EAC7B;EAEA,MAAaE,KAAKA,CAACC,OAAU,EAAiB;IAC1C,IAAI,OAAO,IAAI,CAACF,SAAS,KAAK,UAAU,EAAE;MACtC,MAAMG,KAAK,CACP,uIACJ,CAAC;IACL;IAEA,OAAO,IAAI,CAACH,SAAS,CAACE,OAAO,CAAC;EAClC;AACJ;AAMA,OAAO,MAAME,mBAAmB,GAAGA,CAC/BL,QAAkC,EAClCM,OAA8B,KACX;EACnB,MAAMC,MAAM,GAAG,IAAIV,aAAa,CAAIG,QAAQ,CAAC;EAC7C,IAAIM,OAAO,IAAIA,OAAO,CAACE,IAAI,EAAE;IACzBD,MAAM,CAACC,IAAI,GAAGF,OAAO,CAACE,IAAI;EAC9B;EACA,OAAOD,MAAM;AACjB,CAAC","ignoreList":[]}
|
package/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { ICompressor } from \"@webiny/utils/compression/Compressor.js\";\n\nexport type GenericRecord<K extends PropertyKey = PropertyKey, V = any> = Record<K, V>;\n\nexport type NonEmptyArray<T> = [T, ...T[]];\n\nexport type PossiblyUndefinedProperties<T> = {\n [K in keyof T]: T[K] extends undefined ? T[K] : T[K] | undefined;\n};\n\nexport type BenchmarkRuns = GenericRecord<string, number>;\n\nexport interface BenchmarkMeasurement {\n name: string;\n category: string;\n start: Date;\n end: Date;\n elapsed: number;\n memory: number;\n}\n\nexport interface BenchmarkEnableOnCallable {\n (): Promise<boolean>;\n}\n\nexport interface BenchmarkOutputCallableParams {\n benchmark: Benchmark;\n stop: () => \"stop\";\n}\nexport interface BenchmarkOutputCallable {\n (params: BenchmarkOutputCallableParams): Promise<\"stop\" | undefined | null | void>;\n}\nexport interface BenchmarkMeasureOptions {\n name: string;\n category: string;\n}\nexport interface Benchmark {\n elapsed: number;\n runs: BenchmarkRuns;\n measurements: BenchmarkMeasurement[];\n output: () => Promise<void>;\n onOutput: (cb: BenchmarkOutputCallable) => void;\n enableOn: (cb: BenchmarkEnableOnCallable) => void;\n measure: <T = any>(\n options: BenchmarkMeasureOptions | string,\n cb: () => Promise<T>\n ) => Promise<T>;\n enable: () => void;\n disable: () => void;\n}\n\n/**\n * The main context which is constructed on every request.\n * All other contexts should extend or augment this one.\n */\nexport interface Context {\n plugins: PluginsContainer;\n /**\n * @internal\n */\n container: Container;\n readonly WEBINY_VERSION: string;\n /**\n * Not to be used outside of Webiny internal code.\n * @internal\n */\n hasResult: () => boolean;\n /**\n * Not to be used outside of Webiny internal code.\n * @internal\n *\n * @private\n */\n _result?: unknown;\n /**\n * Not to be used outside of Webiny internal code.\n * @internal\n */\n setResult: (value: unknown) => void;\n /**\n * Not to be used outside of Webiny internal code.\n * @internal\n */\n getResult: () => void;\n /**\n * Benchmark instance to help determine possible bugs and slow code.\n */\n benchmark: Benchmark;\n /**\n * Compressor instance to compress and decompress the data.\n */\n compressor: ICompressor;\n}\n"],"mappings":"","ignoreList":[]}
|