@webiny/api-prerendering-service-so-ddb 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.eb196ccd2f

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 (43) hide show
  1. package/definitions/queueJob.d.ts +4 -3
  2. package/definitions/queueJob.js +9 -8
  3. package/definitions/queueJob.js.map +1 -1
  4. package/definitions/render.d.ts +4 -3
  5. package/definitions/render.js +9 -8
  6. package/definitions/render.js.map +1 -1
  7. package/definitions/renderLegacy.d.ts +4 -3
  8. package/definitions/renderLegacy.js +9 -8
  9. package/definitions/renderLegacy.js.map +1 -1
  10. package/definitions/settings.d.ts +4 -3
  11. package/definitions/settings.js +9 -8
  12. package/definitions/settings.js.map +1 -1
  13. package/definitions/table.d.ts +5 -5
  14. package/definitions/table.js +8 -4
  15. package/definitions/table.js.map +1 -1
  16. package/definitions/tagPathLink.d.ts +51 -4
  17. package/definitions/tagPathLink.js +9 -8
  18. package/definitions/tagPathLink.js.map +1 -1
  19. package/definitions/tagPathLinkLegacy.d.ts +57 -4
  20. package/definitions/tagPathLinkLegacy.js +9 -8
  21. package/definitions/tagPathLinkLegacy.js.map +1 -1
  22. package/definitions/tenantEntity.d.ts +3 -2
  23. package/definitions/tenantEntity.js +5 -3
  24. package/definitions/tenantEntity.js.map +1 -1
  25. package/index.d.ts +1 -1
  26. package/index.js +19 -14
  27. package/index.js.map +1 -1
  28. package/operations/queueJob.d.ts +2 -2
  29. package/operations/queueJob.js +22 -18
  30. package/operations/queueJob.js.map +1 -1
  31. package/operations/render.d.ts +4 -5
  32. package/operations/render.js +68 -64
  33. package/operations/render.js.map +1 -1
  34. package/operations/settings.d.ts +2 -2
  35. package/operations/settings.js +13 -7
  36. package/operations/settings.js.map +1 -1
  37. package/operations/tenant.d.ts +2 -2
  38. package/operations/tenant.js +4 -3
  39. package/operations/tenant.js.map +1 -1
  40. package/package.json +16 -31
  41. package/types.d.ts +10 -11
  42. package/types.js +5 -4
  43. package/types.js.map +1 -1
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createTenantStorageOperations = void 0;
7
7
  var _query = require("@webiny/db-dynamodb/utils/query");
8
- var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
9
8
  const createTenantStorageOperations = params => {
10
9
  const {
11
10
  entity
@@ -19,10 +18,12 @@ const createTenantStorageOperations = params => {
19
18
  gt: " "
20
19
  }
21
20
  });
22
- return (0, _cleanup.cleanupItems)(entity, tenants).map(tenant => tenant.id);
21
+ return tenants.map(tenant => tenant.data.id);
23
22
  };
24
23
  return {
25
24
  getTenantIds
26
25
  };
27
26
  };
28
- exports.createTenantStorageOperations = createTenantStorageOperations;
27
+ exports.createTenantStorageOperations = createTenantStorageOperations;
28
+
29
+ //# sourceMappingURL=tenant.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createTenantStorageOperations","params","entity","getTenantIds","tenants","queryAll","partitionKey","options","index","gt","cleanupItems","map","tenant","id"],"sources":["tenant.ts"],"sourcesContent":["import { PrerenderingServiceTenantStorageOperations } from \"@webiny/api-prerendering-service/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport { queryAll } from \"@webiny/db-dynamodb/utils/query\";\nimport { cleanupItems } from \"@webiny/db-dynamodb/utils/cleanup\";\n\nexport interface CreateTenantStorageOperationsParams {\n entity: Entity<any>;\n}\n\nexport const createTenantStorageOperations = (\n params: CreateTenantStorageOperationsParams\n): PrerenderingServiceTenantStorageOperations => {\n const { entity } = params;\n\n const getTenantIds = async (): Promise<string[]> => {\n const tenants = await queryAll<{ id: string }>({\n entity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n return cleanupItems(entity, tenants).map(tenant => tenant.id);\n };\n\n return {\n getTenantIds\n };\n};\n"],"mappings":";;;;;;AAEA;AACA;AAMO,MAAMA,6BAA6B,GACtCC,MAA2C,IACE;EAC7C,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EAEzB,MAAME,YAAY,GAAG,YAA+B;IAChD,MAAMC,OAAO,GAAG,MAAM,IAAAC,eAAQ,EAAiB;MAC3CH,MAAM;MACNI,YAAY,EAAE,SAAS;MACvBC,OAAO,EAAE;QACLC,KAAK,EAAE,MAAM;QACbC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,OAAO,IAAAC,qBAAY,EAACR,MAAM,EAAEE,OAAO,CAAC,CAACO,GAAG,CAACC,MAAM,IAAIA,MAAM,CAACC,EAAE,CAAC;EACjE,CAAC;EAED,OAAO;IACHV;EACJ,CAAC;AACL,CAAC;AAAC"}
1
+ {"version":3,"names":["_query","require","createTenantStorageOperations","params","entity","getTenantIds","tenants","queryAll","partitionKey","options","index","gt","map","tenant","data","id","exports"],"sources":["tenant.ts"],"sourcesContent":["import type { PrerenderingServiceTenantStorageOperations } from \"@webiny/api-prerendering-service/types\";\nimport type { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport { queryAll } from \"@webiny/db-dynamodb/utils/query\";\n\nexport interface CreateTenantStorageOperationsParams {\n entity: Entity<any>;\n}\n\ninterface Tenant {\n data: { id: string };\n}\n\nexport const createTenantStorageOperations = (\n params: CreateTenantStorageOperationsParams\n): PrerenderingServiceTenantStorageOperations => {\n const { entity } = params;\n\n const getTenantIds = async (): Promise<string[]> => {\n const tenants = await queryAll<Tenant>({\n entity,\n partitionKey: \"TENANTS\",\n options: {\n index: \"GSI1\",\n gt: \" \"\n }\n });\n\n return tenants.map(tenant => tenant.data.id);\n };\n\n return { getTenantIds };\n};\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAUO,MAAMC,6BAA6B,GACtCC,MAA2C,IACE;EAC7C,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EAEzB,MAAME,YAAY,GAAG,MAAAA,CAAA,KAA+B;IAChD,MAAMC,OAAO,GAAG,MAAM,IAAAC,eAAQ,EAAS;MACnCH,MAAM;MACNI,YAAY,EAAE,SAAS;MACvBC,OAAO,EAAE;QACLC,KAAK,EAAE,MAAM;QACbC,EAAE,EAAE;MACR;IACJ,CAAC,CAAC;IAEF,OAAOL,OAAO,CAACM,GAAG,CAACC,MAAM,IAAIA,MAAM,CAACC,IAAI,CAACC,EAAE,CAAC;EAChD,CAAC;EAED,OAAO;IAAEV;EAAa,CAAC;AAC3B,CAAC;AAACW,OAAA,CAAAd,6BAAA,GAAAA,6BAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-prerendering-service-so-ddb",
3
- "version": "0.0.0-unstable.e3f4727c56",
3
+ "version": "0.0.0-unstable.eb196ccd2f",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,49 +11,34 @@
11
11
  "@webiny/api-prerendering-service",
12
12
  "storage-operations",
13
13
  "dynamodb",
14
+ "ddb",
14
15
  "ps:ddb"
15
16
  ],
16
17
  "description": "A DynamoDB storage operations for the Prerendering Service API.",
17
18
  "author": "Webiny Ltd",
18
19
  "license": "MIT",
19
20
  "dependencies": {
20
- "@babel/runtime": "7.20.13",
21
- "@webiny/api-prerendering-service": "0.0.0-unstable.e3f4727c56",
22
- "@webiny/error": "0.0.0-unstable.e3f4727c56",
23
- "dynamodb-toolbox": "0.3.5"
21
+ "@webiny/api-prerendering-service": "0.0.0-unstable.eb196ccd2f",
22
+ "@webiny/aws-sdk": "0.0.0-unstable.eb196ccd2f",
23
+ "@webiny/error": "0.0.0-unstable.eb196ccd2f"
24
24
  },
25
25
  "devDependencies": {
26
- "@babel/cli": "^7.19.3",
27
- "@babel/core": "^7.19.3",
28
- "@babel/plugin-proposal-export-default-from": "^7.16.0",
29
- "@babel/preset-env": "^7.19.4",
30
- "@babel/preset-typescript": "^7.18.6",
31
- "@webiny/cli": "^0.0.0-unstable.e3f4727c56",
32
- "@webiny/db": "^0.0.0-unstable.e3f4727c56",
33
- "@webiny/db-dynamodb": "^0.0.0-unstable.e3f4727c56",
34
- "@webiny/handler-aws": "^0.0.0-unstable.e3f4727c56",
35
- "@webiny/project-utils": "^0.0.0-unstable.e3f4727c56",
36
- "jest-dynalite": "^3.3.1",
37
- "jest-environment-node": "^27.3.0",
38
- "prettier": "^2.3.2",
39
- "rimraf": "^3.0.2",
40
- "ttypescript": "^1.5.12",
41
- "typescript": "4.7.4"
26
+ "@webiny/db": "0.0.0-unstable.eb196ccd2f",
27
+ "@webiny/db-dynamodb": "0.0.0-unstable.eb196ccd2f",
28
+ "@webiny/handler-aws": "0.0.0-unstable.eb196ccd2f",
29
+ "@webiny/project-utils": "0.0.0-unstable.eb196ccd2f",
30
+ "jest-dynalite": "3.6.1",
31
+ "prettier": "2.8.8",
32
+ "rimraf": "6.0.1",
33
+ "typescript": "5.3.3"
42
34
  },
43
35
  "publishConfig": {
44
36
  "access": "public",
45
37
  "directory": "dist"
46
38
  },
47
39
  "scripts": {
48
- "build": "yarn webiny run build",
49
- "watch": "yarn webiny run watch"
40
+ "build": "node ../cli/bin.js run build",
41
+ "watch": "node ../cli/bin.js run watch"
50
42
  },
51
- "adio": {
52
- "ignore": {
53
- "src": [
54
- "aws-sdk"
55
- ]
56
- }
57
- },
58
- "gitHead": "e3f4727c567484dc53e1efceacfb37dbacd7f4de"
43
+ "gitHead": "eb196ccd2f32296e10f7add6dd7220d4e3abece4"
59
44
  }
package/types.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { DocumentClient } from "aws-sdk/clients/dynamodb";
2
- import { Table, Entity } from "dynamodb-toolbox";
3
- import { DynamoDBTypes, TableConstructor } from "dynamodb-toolbox/dist/classes/Table";
4
- import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
5
- import { PrerenderingServiceStorageOperations as BasePrerenderingServiceStorageOperations } from "@webiny/api-prerendering-service/types";
6
- export declare type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;
7
- export declare type Attributes = Record<string, AttributeDefinition>;
1
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
2
+ import type { Entity, Table } from "@webiny/db-dynamodb/toolbox";
3
+ import type { TableConstructor } from "@webiny/db-dynamodb/toolbox";
4
+ import type { AttributeDefinition } from "@webiny/db-dynamodb/toolbox";
5
+ import type { PrerenderingServiceStorageOperations as BasePrerenderingServiceStorageOperations } from "@webiny/api-prerendering-service/types";
6
+ export type Attributes = Record<string, AttributeDefinition>;
8
7
  export declare enum ENTITIES {
9
8
  RENDER = "PrerenderingServiceRender",
10
9
  SETTINGS = "PrerenderingServiceSettings",
@@ -13,20 +12,20 @@ export declare enum ENTITIES {
13
12
  TENANT = "Tenant"
14
13
  }
15
14
  export interface PrerenderingServiceFactoryParams {
16
- documentClient: DocumentClient;
15
+ documentClient: DynamoDBDocument;
17
16
  table?: TableModifier;
18
17
  attributes?: Record<ENTITIES, Attributes>;
19
18
  }
20
- export declare type Entities = "render" | "queueJob" | "tagPathLink";
19
+ export type Entities = "render" | "queueJob" | "tagPathLink";
21
20
  export interface PrerenderingServiceStorageOperations extends BasePrerenderingServiceStorageOperations {
22
- getTable(): Table;
21
+ getTable(): Table<string, string, string>;
23
22
  getEntities(): Record<Entities, Entity<any>>;
24
23
  }
25
24
  export interface PrerenderingServiceFactory {
26
25
  (params: PrerenderingServiceFactoryParams): PrerenderingServiceStorageOperations;
27
26
  }
28
27
  export interface TableModifier {
29
- (table: TableConstructor): TableConstructor;
28
+ (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;
30
29
  }
31
30
  export interface DataContainer<T> {
32
31
  PK: string;
package/types.js CHANGED
@@ -4,12 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ENTITIES = void 0;
7
- let ENTITIES;
8
- exports.ENTITIES = ENTITIES;
9
- (function (ENTITIES) {
7
+ let ENTITIES = exports.ENTITIES = /*#__PURE__*/function (ENTITIES) {
10
8
  ENTITIES["RENDER"] = "PrerenderingServiceRender";
11
9
  ENTITIES["SETTINGS"] = "PrerenderingServiceSettings";
12
10
  ENTITIES["QUEUE_JOB"] = "PrerenderingServiceQueueJob";
13
11
  ENTITIES["TAG_PATH_LINK"] = "PrerenderingServiceTagPathLink";
14
12
  ENTITIES["TENANT"] = "Tenant";
15
- })(ENTITIES || (exports.ENTITIES = ENTITIES = {}));
13
+ return ENTITIES;
14
+ }({});
15
+
16
+ //# sourceMappingURL=types.js.map
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table, Entity } from \"dynamodb-toolbox\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { PrerenderingServiceStorageOperations as BasePrerenderingServiceStorageOperations } from \"@webiny/api-prerendering-service/types\";\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n RENDER = \"PrerenderingServiceRender\",\n SETTINGS = \"PrerenderingServiceSettings\",\n QUEUE_JOB = \"PrerenderingServiceQueueJob\",\n TAG_PATH_LINK = \"PrerenderingServiceTagPathLink\",\n TENANT = \"Tenant\"\n}\n\nexport interface PrerenderingServiceFactoryParams {\n documentClient: DocumentClient;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n}\n\nexport type Entities = \"render\" | \"queueJob\" | \"tagPathLink\";\n\nexport interface PrerenderingServiceStorageOperations\n extends BasePrerenderingServiceStorageOperations {\n getTable(): Table;\n getEntities(): Record<Entities, Entity<any>>;\n}\n\nexport interface PrerenderingServiceFactory {\n (params: PrerenderingServiceFactoryParams): PrerenderingServiceStorageOperations;\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface DataContainer<T> {\n PK: string;\n SK: string;\n data: T;\n}\n"],"mappings":";;;;;;IAaYA,QAAQ;AAAA;AAAA,WAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ"}
1
+ {"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport type { AttributeDefinition } from \"@webiny/db-dynamodb/toolbox\";\nimport type { PrerenderingServiceStorageOperations as BasePrerenderingServiceStorageOperations } from \"@webiny/api-prerendering-service/types\";\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n RENDER = \"PrerenderingServiceRender\",\n SETTINGS = \"PrerenderingServiceSettings\",\n QUEUE_JOB = \"PrerenderingServiceQueueJob\",\n TAG_PATH_LINK = \"PrerenderingServiceTagPathLink\",\n TENANT = \"Tenant\"\n}\n\nexport interface PrerenderingServiceFactoryParams {\n documentClient: DynamoDBDocument;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n}\n\nexport type Entities = \"render\" | \"queueJob\" | \"tagPathLink\";\n\nexport interface PrerenderingServiceStorageOperations\n extends BasePrerenderingServiceStorageOperations {\n getTable(): Table<string, string, string>;\n getEntities(): Record<Entities, Entity<any>>;\n}\n\nexport interface PrerenderingServiceFactory {\n (params: PrerenderingServiceFactoryParams): PrerenderingServiceStorageOperations;\n}\n\nexport interface TableModifier {\n (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;\n}\n\nexport interface DataContainer<T> {\n PK: string;\n SK: string;\n data: T;\n}\n"],"mappings":";;;;;;IAQYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}