@webiny/api 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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.
Files changed (59) hide show
  1. package/Benchmark.d.ts +1 -1
  2. package/Benchmark.js +120 -156
  3. package/Benchmark.js.map +1 -1
  4. package/Context.d.ts +5 -5
  5. package/Context.js +61 -137
  6. package/Context.js.map +1 -1
  7. package/README.md +10 -14
  8. package/abstractions.d.ts +5 -0
  9. package/abstractions.js +5 -0
  10. package/abstractions.js.map +1 -0
  11. package/createConditionalPluginFactory.d.ts +1 -1
  12. package/createConditionalPluginFactory.js +5 -15
  13. package/createConditionalPluginFactory.js.map +1 -1
  14. package/decorateContext.js +10 -19
  15. package/decorateContext.js.map +1 -1
  16. package/helpers/InterfaceGenerator/date.d.ts +15 -0
  17. package/helpers/InterfaceGenerator/date.js +0 -0
  18. package/helpers/InterfaceGenerator/id.d.ts +23 -0
  19. package/helpers/InterfaceGenerator/id.js +0 -0
  20. package/helpers/InterfaceGenerator/identity.d.ts +10 -0
  21. package/helpers/InterfaceGenerator/identity.js +0 -0
  22. package/helpers/InterfaceGenerator/index.d.ts +6 -0
  23. package/helpers/InterfaceGenerator/index.js +0 -0
  24. package/helpers/InterfaceGenerator/numeric.d.ts +12 -0
  25. package/helpers/InterfaceGenerator/numeric.js +0 -0
  26. package/helpers/InterfaceGenerator/text.d.ts +11 -0
  27. package/helpers/InterfaceGenerator/text.js +0 -0
  28. package/helpers/InterfaceGenerator/truthful.d.ts +7 -0
  29. package/helpers/InterfaceGenerator/truthful.js +0 -0
  30. package/index.d.ts +5 -6
  31. package/index.js +5 -73
  32. package/package.json +18 -15
  33. package/plugins/BenchmarkPlugin.d.ts +1 -1
  34. package/plugins/BenchmarkPlugin.js +19 -27
  35. package/plugins/BenchmarkPlugin.js.map +1 -1
  36. package/testing/index.d.ts +3 -0
  37. package/testing/index.js +3 -0
  38. package/testing/lifecycleTracker.d.ts +14 -0
  39. package/testing/lifecycleTracker.js +37 -0
  40. package/testing/lifecycleTracker.js.map +1 -0
  41. package/testing/sleep.d.ts +1 -0
  42. package/testing/sleep.js +6 -0
  43. package/testing/sleep.js.map +1 -0
  44. package/testing/until.d.ts +7 -0
  45. package/testing/until.js +22 -0
  46. package/testing/until.js.map +1 -0
  47. package/types.d.ts +5 -10
  48. package/types.js +0 -7
  49. package/ServiceDiscovery.d.ts +0 -12
  50. package/ServiceDiscovery.js +0 -77
  51. package/ServiceDiscovery.js.map +0 -1
  52. package/index.js.map +0 -1
  53. package/plugins/CompressorPlugin.d.ts +0 -14
  54. package/plugins/CompressorPlugin.js +0 -21
  55. package/plugins/CompressorPlugin.js.map +0 -1
  56. package/plugins/ContextPlugin.d.ts +0 -16
  57. package/plugins/ContextPlugin.js +0 -31
  58. package/plugins/ContextPlugin.js.map +0 -1
  59. package/types.js.map +0 -1
@@ -1,77 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ServiceDiscovery = void 0;
7
- var _clientDynamodb = require("@webiny/aws-sdk/client-dynamodb");
8
- class ServiceManifestLoader {
9
- manifest = undefined;
10
- async load() {
11
- if (this.manifest) {
12
- return this.manifest;
13
- }
14
- const manifests = await this.loadManifests();
15
- if (!manifests) {
16
- return undefined;
17
- }
18
-
19
- /**
20
- * Service manifests are already merged by unique names in the database, so we only need to construct
21
- * a final object containing all manifests by name.
22
- */
23
- this.manifest = manifests.reduce((acc, manifest) => {
24
- return {
25
- ...acc,
26
- [manifest.name]: manifest.manifest
27
- };
28
- }, {});
29
- return this.manifest;
30
- }
31
- setDocumentClient(client) {
32
- this.client = client;
33
- }
34
- clear() {
35
- this.manifest = undefined;
36
- }
37
- async loadManifests() {
38
- const client = this.client || (0, _clientDynamodb.getDocumentClient)();
39
- const {
40
- Items
41
- } = await client.send(new _clientDynamodb.QueryCommand({
42
- TableName: String(process.env.DB_TABLE),
43
- IndexName: "GSI1",
44
- KeyConditionExpression: "GSI1_PK = :GSI1_PK AND GSI1_SK > :GSI1_SK",
45
- ExpressionAttributeValues: {
46
- ":GSI1_PK": {
47
- S: `SERVICE_MANIFESTS`
48
- },
49
- ":GSI1_SK": {
50
- S: " "
51
- }
52
- }
53
- }));
54
- if (!Array.isArray(Items)) {
55
- return undefined;
56
- }
57
- return Items.map(item => (0, _clientDynamodb.unmarshall)(item).data);
58
- }
59
- }
60
- const serviceManifestLoader = new ServiceManifestLoader();
61
- class ServiceDiscovery {
62
- static setDocumentClient(client) {
63
- serviceManifestLoader.setDocumentClient(client);
64
- }
65
- static async load() {
66
- return serviceManifestLoader.load();
67
- }
68
- /**
69
- * Should be used for testing purposes only!
70
- */
71
- static clear() {
72
- serviceManifestLoader.clear();
73
- }
74
- }
75
- exports.ServiceDiscovery = ServiceDiscovery;
76
-
77
- //# sourceMappingURL=ServiceDiscovery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_clientDynamodb","require","ServiceManifestLoader","manifest","undefined","load","manifests","loadManifests","reduce","acc","name","setDocumentClient","client","clear","getDocumentClient","Items","send","QueryCommand","TableName","String","process","env","DB_TABLE","IndexName","KeyConditionExpression","ExpressionAttributeValues","S","Array","isArray","map","item","unmarshall","data","serviceManifestLoader","ServiceDiscovery","exports"],"sources":["ServiceDiscovery.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { getDocumentClient, QueryCommand, unmarshall } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { GenericRecord } from \"~/types\";\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,IAAAA,eAAA,GAAAC,OAAA;AAUA,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,OA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AAI,CAAC,CAAC;EACvC;EACA;AACJ;AACA;EACI,OAAOQ,KAAKA,CAAA,EAAS;IACjBoB,qBAAqB,CAACpB,KAAK,CAAC,CAAC;EACjC;AACJ;AAACsB,OAAA,CAAAD,gBAAA,GAAAA,gBAAA","ignoreList":[]}
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":["_Context","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CompressorPlugin","_decorateContext","_createConditionalPluginFactory","_ServiceDiscovery","_ContextPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./Context\";\nexport * from \"./plugins/CompressorPlugin\";\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,iBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,iBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,iBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,iBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;A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A,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,cAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,cAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin";
2
- import type { ICompressor } from "@webiny/utils/compression/Compressor";
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,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CompressorPlugin = void 0;
7
- var _Plugin = require("@webiny/plugins/Plugin");
8
- /**
9
- * Should never be initialized outside the api package.
10
- */
11
- class CompressorPlugin extends _Plugin.Plugin {
12
- name = "context.compressor";
13
- static type = "context.compressor";
14
- constructor(params) {
15
- super();
16
- this.getCompressor = params.getCompressor;
17
- }
18
- }
19
- exports.CompressorPlugin = CompressorPlugin;
20
-
21
- //# sourceMappingURL=CompressorPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_Plugin","require","CompressorPlugin","Plugin","name","type","constructor","params","getCompressor","exports"],"sources":["CompressorPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport type { ICompressor } from \"@webiny/utils/compression/Compressor\";\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,IAAAA,OAAA,GAAAC,OAAA;AAOA;AACA;AACA;AACO,MAAMC,gBAAgB,SAASC,cAAM,CAAC;EAChBC,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;AAACC,OAAA,CAAAP,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import type { Context } from "../types";
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 {};
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createContextPlugin = exports.ContextPlugin = void 0;
7
- var _plugins = require("@webiny/plugins");
8
- class ContextPlugin extends _plugins.Plugin {
9
- static type = "context";
10
- constructor(callable) {
11
- super();
12
- this._callable = callable;
13
- }
14
- async apply(context) {
15
- if (typeof this._callable !== "function") {
16
- throw Error(`Missing callable in ContextPlugin! Either pass a callable to plugin constructor or extend the plugin and override the "apply" method.`);
17
- }
18
- return this._callable(context);
19
- }
20
- }
21
- exports.ContextPlugin = ContextPlugin;
22
- const createContextPlugin = (callable, options) => {
23
- const plugin = new ContextPlugin(callable);
24
- if (options && options.name) {
25
- plugin.name = options.name;
26
- }
27
- return plugin;
28
- };
29
- exports.createContextPlugin = createContextPlugin;
30
-
31
- //# sourceMappingURL=ContextPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_plugins","require","ContextPlugin","Plugin","type","constructor","callable","_callable","apply","context","Error","exports","createContextPlugin","options","plugin","name"],"sources":["ContextPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Context } from \"~/types\";\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,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,aAAa,SAAsCC,eAAM,CAAC;EACnE,OAAgCC,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;AAACE,OAAA,CAAAT,aAAA,GAAAA,aAAA;AAMM,MAAMU,mBAAmB,GAAGA,CAC/BN,QAAkC,EAClCO,OAA8B,KACX;EACnB,MAAMC,MAAM,GAAG,IAAIZ,aAAa,CAAII,QAAQ,CAAC;EAC7C,IAAIO,OAAO,IAAIA,OAAO,CAACE,IAAI,EAAE;IACzBD,MAAM,CAACC,IAAI,GAAGF,OAAO,CAACE,IAAI;EAC9B;EACA,OAAOD,MAAM;AACjB,CAAC;AAACH,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
package/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport type { ICompressor } from \"@webiny/utils/compression/Compressor\";\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 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 * Wait for property to be defined on the object and then execute the callable.\n * In case of multiple objects defined, wait for all of them.\n */\n waitFor: <T extends Context = Context>(\n obj: string[] | string,\n cb: (context: T) => void\n ) => 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":[]}