@webiny/api-headless-cms-ddb 6.4.0-beta.3 → 6.4.0-beta.5

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.
@@ -54,6 +54,10 @@ export interface IEntryEntityAttributesData {
54
54
  system?: ICmsEntrySystem;
55
55
  live: ICmsEntryLive | null;
56
56
  revisionDescription: string | undefined;
57
+ /**
58
+ * A timestamp of when the entry should be automatically deleted from the database.
59
+ */
60
+ expiresAt: number | null;
57
61
  }
58
62
  export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
59
63
  export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
@@ -1,13 +1,20 @@
1
- import dot_object from "dot-object";
2
1
  import { CmsEntryFieldFilterPlugin } from "../../../../plugins/CmsEntryFieldFilterPlugin.js";
3
2
  import { extractWhereParams } from "../where.js";
3
+ function dotFlatten(obj, prefix = "") {
4
+ return Object.entries(obj).reduce((acc, [key, val])=>{
5
+ const path = prefix ? `${prefix}.${key}` : key;
6
+ if (val && "object" == typeof val && !Array.isArray(val)) Object.assign(acc, dotFlatten(val, path));
7
+ else acc[path] = val;
8
+ return acc;
9
+ }, {});
10
+ }
4
11
  const searchableJsonFilterCreate = ()=>{
5
12
  const plugin = new CmsEntryFieldFilterPlugin({
6
13
  fieldType: "searchable-json",
7
14
  create: (params)=>{
8
15
  const { value: objectValue, valueFilterRegistry, field: parentField } = params;
9
16
  const filters = [];
10
- const accessPatterns = dot_object.dot(objectValue);
17
+ const accessPatterns = dotFlatten(objectValue);
11
18
  for(const key in accessPatterns){
12
19
  const value = accessPatterns[key];
13
20
  if (void 0 === value) continue;
@@ -1 +1 @@
1
- {"version":3,"file":"operations/entry/filtering/plugins/searchableJsonFilterCreate.js","sources":["../../../../../src/operations/entry/filtering/plugins/searchableJsonFilterCreate.ts"],"sourcesContent":["import dot from \"dot-object\";\nimport type { CmsEntryFieldFilterPluginCreateResponse } from \"~/plugins/CmsEntryFieldFilterPlugin.js\";\nimport { CmsEntryFieldFilterPlugin } from \"~/plugins/CmsEntryFieldFilterPlugin.js\";\nimport { extractWhereParams } from \"~/operations/entry/filtering/where.js\";\n\nexport const searchableJsonFilterCreate = () => {\n const plugin = new CmsEntryFieldFilterPlugin({\n fieldType: \"searchable-json\",\n create: params => {\n const { value: objectValue, valueFilterRegistry, field: parentField } = params;\n\n const filters = [];\n\n const accessPatterns = dot.dot(objectValue);\n\n for (const key in accessPatterns) {\n const value = accessPatterns[key];\n if (value === undefined) {\n continue;\n }\n\n const whereParams = extractWhereParams(key);\n if (!whereParams) {\n continue;\n }\n const { negate, operation } = whereParams;\n\n const transformValueCallable = (value: any) => {\n return value;\n };\n\n const fieldId = `${parentField.fieldId}.${whereParams.fieldId ?? key}`;\n\n const filter = valueFilterRegistry.get(operation);\n if (!filter) {\n console.error(`Missing operation filter for \"${operation}\".`);\n continue;\n }\n\n const result: CmsEntryFieldFilterPluginCreateResponse = {\n field: parentField,\n path: `values.${fieldId}`,\n fieldPathId: `values.${fieldId}`,\n negate,\n filter,\n compareValue: value,\n transformValue: transformValueCallable\n };\n\n if (!result) {\n continue;\n }\n if (Array.isArray(result)) {\n filters.push(...result);\n continue;\n }\n\n filters.push(result);\n }\n return filters;\n }\n });\n\n plugin.name = `headless-cms.ddb.filter.searchable-json`;\n\n return plugin;\n};\n"],"names":["searchableJsonFilterCreate","plugin","CmsEntryFieldFilterPlugin","params","objectValue","valueFilterRegistry","parentField","filters","accessPatterns","dot","key","value","undefined","whereParams","extractWhereParams","negate","operation","transformValueCallable","fieldId","filter","console","result","Array"],"mappings":";;;AAKO,MAAMA,6BAA6B;IACtC,MAAMC,SAAS,IAAIC,0BAA0B;QACzC,WAAW;QACX,QAAQC,CAAAA;YACJ,MAAM,EAAE,OAAOC,WAAW,EAAEC,mBAAmB,EAAE,OAAOC,WAAW,EAAE,GAAGH;YAExE,MAAMI,UAAU,EAAE;YAElB,MAAMC,iBAAiBC,WAAAA,GAAO,CAACL;YAE/B,IAAK,MAAMM,OAAOF,eAAgB;gBAC9B,MAAMG,QAAQH,cAAc,CAACE,IAAI;gBACjC,IAAIC,AAAUC,WAAVD,OACA;gBAGJ,MAAME,cAAcC,mBAAmBJ;gBACvC,IAAI,CAACG,aACD;gBAEJ,MAAM,EAAEE,MAAM,EAAEC,SAAS,EAAE,GAAGH;gBAE9B,MAAMI,yBAAyB,CAACN,QACrBA;gBAGX,MAAMO,UAAU,GAAGZ,YAAY,OAAO,CAAC,CAAC,EAAEO,YAAY,OAAO,IAAIH,KAAK;gBAEtE,MAAMS,SAASd,oBAAoB,GAAG,CAACW;gBACvC,IAAI,CAACG,QAAQ;oBACTC,QAAQ,KAAK,CAAC,CAAC,8BAA8B,EAAEJ,UAAU,EAAE,CAAC;oBAC5D;gBACJ;gBAEA,MAAMK,SAAkD;oBACpD,OAAOf;oBACP,MAAM,CAAC,OAAO,EAAEY,SAAS;oBACzB,aAAa,CAAC,OAAO,EAAEA,SAAS;oBAChCH;oBACAI;oBACA,cAAcR;oBACd,gBAAgBM;gBACpB;gBAEA,IAAKI;oBAGL,IAAIC,MAAM,OAAO,CAACD,SAAS;wBACvBd,QAAQ,IAAI,IAAIc;wBAChB;oBACJ;oBAEAd,QAAQ,IAAI,CAACc;;YACjB;YACA,OAAOd;QACX;IACJ;IAEAN,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
1
+ {"version":3,"file":"operations/entry/filtering/plugins/searchableJsonFilterCreate.js","sources":["../../../../../src/operations/entry/filtering/plugins/searchableJsonFilterCreate.ts"],"sourcesContent":["import type { CmsEntryFieldFilterPluginCreateResponse } from \"~/plugins/CmsEntryFieldFilterPlugin.js\";\nimport { CmsEntryFieldFilterPlugin } from \"~/plugins/CmsEntryFieldFilterPlugin.js\";\nimport { extractWhereParams } from \"~/operations/entry/filtering/where.js\";\n\nfunction dotFlatten(obj: Record<string, any>, prefix = \"\"): Record<string, any> {\n return Object.entries(obj).reduce<Record<string, any>>((acc, [key, val]) => {\n const path = prefix ? `${prefix}.${key}` : key;\n if (val && typeof val === \"object\" && !Array.isArray(val)) {\n Object.assign(acc, dotFlatten(val, path));\n } else {\n acc[path] = val;\n }\n return acc;\n }, {});\n}\n\nexport const searchableJsonFilterCreate = () => {\n const plugin = new CmsEntryFieldFilterPlugin({\n fieldType: \"searchable-json\",\n create: params => {\n const { value: objectValue, valueFilterRegistry, field: parentField } = params;\n\n const filters = [];\n\n const accessPatterns = dotFlatten(objectValue);\n\n for (const key in accessPatterns) {\n const value = accessPatterns[key];\n if (value === undefined) {\n continue;\n }\n\n const whereParams = extractWhereParams(key);\n if (!whereParams) {\n continue;\n }\n const { negate, operation } = whereParams;\n\n const transformValueCallable = (value: any) => {\n return value;\n };\n\n const fieldId = `${parentField.fieldId}.${whereParams.fieldId ?? key}`;\n\n const filter = valueFilterRegistry.get(operation);\n if (!filter) {\n console.error(`Missing operation filter for \"${operation}\".`);\n continue;\n }\n\n const result: CmsEntryFieldFilterPluginCreateResponse = {\n field: parentField,\n path: `values.${fieldId}`,\n fieldPathId: `values.${fieldId}`,\n negate,\n filter,\n compareValue: value,\n transformValue: transformValueCallable\n };\n\n if (!result) {\n continue;\n }\n if (Array.isArray(result)) {\n filters.push(...result);\n continue;\n }\n\n filters.push(result);\n }\n return filters;\n }\n });\n\n plugin.name = `headless-cms.ddb.filter.searchable-json`;\n\n return plugin;\n};\n"],"names":["dotFlatten","obj","prefix","Object","acc","key","val","path","Array","searchableJsonFilterCreate","plugin","CmsEntryFieldFilterPlugin","params","objectValue","valueFilterRegistry","parentField","filters","accessPatterns","value","undefined","whereParams","extractWhereParams","negate","operation","transformValueCallable","fieldId","filter","console","result"],"mappings":";;AAIA,SAASA,WAAWC,GAAwB,EAAEC,SAAS,EAAE;IACrD,OAAOC,OAAO,OAAO,CAACF,KAAK,MAAM,CAAsB,CAACG,KAAK,CAACC,KAAKC,IAAI;QACnE,MAAMC,OAAOL,SAAS,GAAGA,OAAO,CAAC,EAAEG,KAAK,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;IACJ;IAEAN,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
@@ -24,6 +24,7 @@ export interface ICreateEntryPublishedKeysParams {
24
24
  id: string;
25
25
  tenant: string;
26
26
  modelId: string;
27
+ expiresAt: number | null;
27
28
  }
28
29
  export declare const createEntryPublishedKeys: (params: ICreateEntryPublishedKeysParams) => {
29
30
  PK: string;
@@ -32,11 +33,13 @@ export declare const createEntryPublishedKeys: (params: ICreateEntryPublishedKey
32
33
  GSI1_SK: string;
33
34
  TYPE: string;
34
35
  GSI_TENANT: string;
36
+ expiresAt: number | null;
35
37
  };
36
38
  export interface ICreateEntryLatestKeysParams {
37
39
  id: string;
38
40
  tenant: string;
39
41
  modelId: string;
42
+ expiresAt: number | null;
40
43
  }
41
44
  export declare const createEntryLatestKeys: (params: ICreateEntryLatestKeysParams) => {
42
45
  PK: string;
@@ -45,12 +48,14 @@ export declare const createEntryLatestKeys: (params: ICreateEntryLatestKeysParam
45
48
  GSI1_SK: string;
46
49
  TYPE: string;
47
50
  GSI_TENANT: string;
51
+ expiresAt: number | null;
48
52
  };
49
53
  export interface ICreateRevisionKeysParams {
50
54
  id: string;
51
55
  tenant: string;
52
56
  version: number;
53
57
  modelId: string;
58
+ expiresAt: number | null;
54
59
  }
55
60
  export declare const createEntryRevisionKeys: (params: ICreateRevisionKeysParams) => {
56
61
  PK: string;
@@ -59,5 +64,6 @@ export declare const createEntryRevisionKeys: (params: ICreateRevisionKeysParams
59
64
  GSI1_SK: string;
60
65
  TYPE: string;
61
66
  GSI_TENANT: string;
67
+ expiresAt: number | null;
62
68
  };
63
69
  export {};
@@ -20,36 +20,39 @@ const createGSIPartitionKey = (params, type)=>{
20
20
  };
21
21
  const createGSISortKey = (params)=>params.id;
22
22
  const createEntryPublishedKeys = (params)=>{
23
- const { tenant } = params;
23
+ const { tenant, expiresAt } = params;
24
24
  return {
25
25
  PK: createPartitionKey(params),
26
26
  SK: createPublishedSortKey(),
27
27
  GSI1_PK: createGSIPartitionKey(params, "P"),
28
28
  GSI1_SK: createGSISortKey(params),
29
29
  TYPE: "cms.entry.p",
30
- GSI_TENANT: tenant
30
+ GSI_TENANT: tenant,
31
+ expiresAt
31
32
  };
32
33
  };
33
34
  const createEntryLatestKeys = (params)=>{
34
- const { tenant } = params;
35
+ const { tenant, expiresAt } = params;
35
36
  return {
36
37
  PK: createPartitionKey(params),
37
38
  SK: createLatestSortKey(),
38
39
  GSI1_PK: createGSIPartitionKey(params, "L"),
39
40
  GSI1_SK: createGSISortKey(params),
40
41
  TYPE: "cms.entry.l",
41
- GSI_TENANT: tenant
42
+ GSI_TENANT: tenant,
43
+ expiresAt
42
44
  };
43
45
  };
44
46
  const createEntryRevisionKeys = (params)=>{
45
- const { tenant } = params;
47
+ const { tenant, expiresAt } = params;
46
48
  return {
47
49
  PK: createPartitionKey(params),
48
50
  SK: createRevisionSortKey(params),
49
51
  GSI1_PK: createGSIPartitionKey(params, "A"),
50
52
  GSI1_SK: createGSISortKey(params),
51
53
  TYPE: "cms.entry",
52
- GSI_TENANT: tenant
54
+ GSI_TENANT: tenant,
55
+ expiresAt
53
56
  };
54
57
  };
55
58
  export { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys, createGSIPartitionKey, createGSISortKey, createLatestSortKey, createPartitionKey, createPublishedSortKey, createRevisionSortKey };
@@ -1 +1 @@
1
- {"version":3,"file":"operations/entry/keys.js","sources":["../../../src/operations/entry/keys.ts"],"sourcesContent":["import { parseIdentifier, zeroPad } from \"@webiny/utils\";\nimport WebinyError from \"@webiny/error\";\n\ninterface BasePartitionKeyParams {\n tenant: string;\n}\nconst createBasePartitionKey = (params: BasePartitionKeyParams): string => {\n const { tenant } = params;\n if (!tenant) {\n throw new WebinyError(`Missing tenant variable when creating entry basePartitionKey`);\n }\n return `T#${tenant}#CMS#CME`;\n};\n\nexport interface PartitionKeyParams extends BasePartitionKeyParams {\n id: string;\n}\nexport const createPartitionKey = (params: PartitionKeyParams): string => {\n const { id: initialId } = params;\n const { id } = parseIdentifier(initialId);\n return `${createBasePartitionKey(params)}#${id}`;\n};\n\nexport interface SortKeyParams {\n version: number;\n}\nexport const createRevisionSortKey = (params: SortKeyParams): string => {\n return `REV#${zeroPad(params.version)}`;\n};\n\nexport const createLatestSortKey = (): string => {\n return \"L\";\n};\n\nexport const createPublishedSortKey = (): string => {\n return \"P\";\n};\n\nexport interface GSIPartitionKeyParams {\n tenant: string;\n modelId: string;\n}\nexport const createGSIPartitionKey = (params: GSIPartitionKeyParams, type: \"A\" | \"L\" | \"P\") => {\n const { modelId } = params;\n const partitionKey = createBasePartitionKey(params);\n return `${partitionKey}#M#${modelId}#${type}`;\n};\n\nexport interface GSISortKeyParams {\n id: string;\n}\nexport const createGSISortKey = (params: GSISortKeyParams): string => {\n return params.id;\n};\n\nexport interface ICreateEntryPublishedKeysParams {\n id: string;\n tenant: string;\n modelId: string;\n}\n\nexport const createEntryPublishedKeys = (params: ICreateEntryPublishedKeysParams) => {\n const { tenant } = params;\n return {\n PK: createPartitionKey(params),\n SK: createPublishedSortKey(),\n GSI1_PK: createGSIPartitionKey(params, \"P\"),\n GSI1_SK: createGSISortKey(params),\n TYPE: `cms.entry.p`,\n GSI_TENANT: tenant\n };\n};\n\nexport interface ICreateEntryLatestKeysParams {\n id: string;\n tenant: string;\n modelId: string;\n}\n\nexport const createEntryLatestKeys = (params: ICreateEntryLatestKeysParams) => {\n const { tenant } = params;\n return {\n PK: createPartitionKey(params),\n SK: createLatestSortKey(),\n GSI1_PK: createGSIPartitionKey(params, \"L\"),\n GSI1_SK: createGSISortKey(params),\n TYPE: `cms.entry.l`,\n GSI_TENANT: tenant\n };\n};\n\nexport interface ICreateRevisionKeysParams {\n id: string;\n tenant: string;\n version: number;\n modelId: string;\n}\n\nexport const createEntryRevisionKeys = (params: ICreateRevisionKeysParams) => {\n const { tenant } = params;\n return {\n PK: createPartitionKey(params),\n SK: createRevisionSortKey(params),\n GSI1_PK: createGSIPartitionKey(params, \"A\"),\n GSI1_SK: createGSISortKey(params),\n TYPE: `cms.entry`,\n GSI_TENANT: tenant\n };\n};\n"],"names":["createBasePartitionKey","params","tenant","WebinyError","createPartitionKey","initialId","id","parseIdentifier","createRevisionSortKey","zeroPad","createLatestSortKey","createPublishedSortKey","createGSIPartitionKey","type","modelId","partitionKey","createGSISortKey","createEntryPublishedKeys","createEntryLatestKeys","createEntryRevisionKeys"],"mappings":";;AAMA,MAAMA,yBAAyB,CAACC;IAC5B,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,IAAI,CAACC,QACD,MAAM,IAAIC,MAAY;IAE1B,OAAO,CAAC,EAAE,EAAED,OAAO,QAAQ,CAAC;AAChC;AAKO,MAAME,qBAAqB,CAACH;IAC/B,MAAM,EAAE,IAAII,SAAS,EAAE,GAAGJ;IAC1B,MAAM,EAAEK,EAAE,EAAE,GAAGC,gBAAgBF;IAC/B,OAAO,GAAGL,uBAAuBC,QAAQ,CAAC,EAAEK,IAAI;AACpD;AAKO,MAAME,wBAAwB,CAACP,SAC3B,CAAC,IAAI,EAAEQ,QAAQR,OAAO,OAAO,GAAG;AAGpC,MAAMS,sBAAsB,IACxB;AAGJ,MAAMC,yBAAyB,IAC3B;AAOJ,MAAMC,wBAAwB,CAACX,QAA+BY;IACjE,MAAM,EAAEC,OAAO,EAAE,GAAGb;IACpB,MAAMc,eAAef,uBAAuBC;IAC5C,OAAO,GAAGc,aAAa,GAAG,EAAED,QAAQ,CAAC,EAAED,MAAM;AACjD;AAKO,MAAMG,mBAAmB,CAACf,SACtBA,OAAO,EAAE;AASb,MAAMgB,2BAA2B,CAAChB;IACrC,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,OAAO;QACH,IAAIG,mBAAmBH;QACvB,IAAIU;QACJ,SAASC,sBAAsBX,QAAQ;QACvC,SAASe,iBAAiBf;QAC1B,MAAM;QACN,YAAYC;IAChB;AACJ;AAQO,MAAMgB,wBAAwB,CAACjB;IAClC,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,OAAO;QACH,IAAIG,mBAAmBH;QACvB,IAAIS;QACJ,SAASE,sBAAsBX,QAAQ;QACvC,SAASe,iBAAiBf;QAC1B,MAAM;QACN,YAAYC;IAChB;AACJ;AASO,MAAMiB,0BAA0B,CAAClB;IACpC,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,OAAO;QACH,IAAIG,mBAAmBH;QACvB,IAAIO,sBAAsBP;QAC1B,SAASW,sBAAsBX,QAAQ;QACvC,SAASe,iBAAiBf;QAC1B,MAAM;QACN,YAAYC;IAChB;AACJ"}
1
+ {"version":3,"file":"operations/entry/keys.js","sources":["../../../src/operations/entry/keys.ts"],"sourcesContent":["import { parseIdentifier, zeroPad } from \"@webiny/utils\";\nimport WebinyError from \"@webiny/error\";\n\ninterface BasePartitionKeyParams {\n tenant: string;\n}\nconst createBasePartitionKey = (params: BasePartitionKeyParams): string => {\n const { tenant } = params;\n if (!tenant) {\n throw new WebinyError(`Missing tenant variable when creating entry basePartitionKey`);\n }\n return `T#${tenant}#CMS#CME`;\n};\n\nexport interface PartitionKeyParams extends BasePartitionKeyParams {\n id: string;\n}\nexport const createPartitionKey = (params: PartitionKeyParams): string => {\n const { id: initialId } = params;\n const { id } = parseIdentifier(initialId);\n return `${createBasePartitionKey(params)}#${id}`;\n};\n\nexport interface SortKeyParams {\n version: number;\n}\nexport const createRevisionSortKey = (params: SortKeyParams): string => {\n return `REV#${zeroPad(params.version)}`;\n};\n\nexport const createLatestSortKey = (): string => {\n return \"L\";\n};\n\nexport const createPublishedSortKey = (): string => {\n return \"P\";\n};\n\nexport interface GSIPartitionKeyParams {\n tenant: string;\n modelId: string;\n}\nexport const createGSIPartitionKey = (params: GSIPartitionKeyParams, type: \"A\" | \"L\" | \"P\") => {\n const { modelId } = params;\n const partitionKey = createBasePartitionKey(params);\n return `${partitionKey}#M#${modelId}#${type}`;\n};\n\nexport interface GSISortKeyParams {\n id: string;\n}\nexport const createGSISortKey = (params: GSISortKeyParams): string => {\n return params.id;\n};\n\nexport interface ICreateEntryPublishedKeysParams {\n id: string;\n tenant: string;\n modelId: string;\n expiresAt: number | null;\n}\n\nexport const createEntryPublishedKeys = (params: ICreateEntryPublishedKeysParams) => {\n const { tenant, expiresAt } = params;\n return {\n PK: createPartitionKey(params),\n SK: createPublishedSortKey(),\n GSI1_PK: createGSIPartitionKey(params, \"P\"),\n GSI1_SK: createGSISortKey(params),\n TYPE: `cms.entry.p`,\n GSI_TENANT: tenant,\n expiresAt\n };\n};\n\nexport interface ICreateEntryLatestKeysParams {\n id: string;\n tenant: string;\n modelId: string;\n expiresAt: number | null;\n}\n\nexport const createEntryLatestKeys = (params: ICreateEntryLatestKeysParams) => {\n const { tenant, expiresAt } = params;\n return {\n PK: createPartitionKey(params),\n SK: createLatestSortKey(),\n GSI1_PK: createGSIPartitionKey(params, \"L\"),\n GSI1_SK: createGSISortKey(params),\n TYPE: `cms.entry.l`,\n GSI_TENANT: tenant,\n expiresAt\n };\n};\n\nexport interface ICreateRevisionKeysParams {\n id: string;\n tenant: string;\n version: number;\n modelId: string;\n expiresAt: number | null;\n}\n\nexport const createEntryRevisionKeys = (params: ICreateRevisionKeysParams) => {\n const { tenant, expiresAt } = params;\n return {\n PK: createPartitionKey(params),\n SK: createRevisionSortKey(params),\n GSI1_PK: createGSIPartitionKey(params, \"A\"),\n GSI1_SK: createGSISortKey(params),\n TYPE: `cms.entry`,\n GSI_TENANT: tenant,\n expiresAt\n };\n};\n"],"names":["createBasePartitionKey","params","tenant","WebinyError","createPartitionKey","initialId","id","parseIdentifier","createRevisionSortKey","zeroPad","createLatestSortKey","createPublishedSortKey","createGSIPartitionKey","type","modelId","partitionKey","createGSISortKey","createEntryPublishedKeys","expiresAt","createEntryLatestKeys","createEntryRevisionKeys"],"mappings":";;AAMA,MAAMA,yBAAyB,CAACC;IAC5B,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,IAAI,CAACC,QACD,MAAM,IAAIC,MAAY;IAE1B,OAAO,CAAC,EAAE,E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ACN,YAAYC;QACZgB;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms-ddb",
3
- "version": "6.4.0-beta.3",
3
+ "version": "6.4.0-beta.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -26,34 +26,34 @@
26
26
  ],
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@webiny/api": "6.4.0-beta.3",
30
- "@webiny/api-headless-cms": "6.4.0-beta.3",
31
- "@webiny/aws-sdk": "6.4.0-beta.3",
32
- "@webiny/db-dynamodb": "6.4.0-beta.3",
33
- "@webiny/error": "6.4.0-beta.3",
34
- "@webiny/feature": "6.4.0-beta.3",
35
- "@webiny/handler": "6.4.0-beta.3",
36
- "@webiny/handler-db": "6.4.0-beta.3",
37
- "@webiny/utils": "6.4.0-beta.3",
29
+ "@webiny/api": "6.4.0-beta.5",
30
+ "@webiny/api-headless-cms": "6.4.0-beta.5",
31
+ "@webiny/aws-sdk": "6.4.0-beta.5",
32
+ "@webiny/db-dynamodb": "6.4.0-beta.5",
33
+ "@webiny/error": "6.4.0-beta.5",
34
+ "@webiny/feature": "6.4.0-beta.5",
35
+ "@webiny/handler": "6.4.0-beta.5",
36
+ "@webiny/handler-db": "6.4.0-beta.5",
37
+ "@webiny/utils": "6.4.0-beta.5",
38
38
  "dataloader": "2.2.3",
39
- "dot-object": "2.1.5",
40
39
  "dot-prop": "10.1.0",
41
40
  "lodash": "4.18.1"
42
41
  },
43
42
  "devDependencies": {
44
- "@types/dot-object": "2.1.6",
45
43
  "@types/jsonpack": "1.1.6",
46
- "@webiny/build-tools": "6.4.0-beta.3",
44
+ "@webiny/build-tools": "6.4.0-beta.5",
47
45
  "@webiny/di": "1.0.1",
48
- "@webiny/plugins": "6.4.0-beta.3",
49
- "@webiny/project-utils": "6.4.0-beta.3",
46
+ "@webiny/plugins": "6.4.0-beta.5",
47
+ "@webiny/project-utils": "6.4.0-beta.5",
50
48
  "jest-dynalite": "3.6.1",
51
49
  "typescript": "6.0.3",
52
- "vitest": "4.1.6"
50
+ "vitest": "4.1.7"
53
51
  },
54
52
  "publishConfig": {
55
- "access": "public",
56
- "directory": "dist"
53
+ "access": "public"
57
54
  },
58
- "gitHead": "2e58681d4344024bfb60e6180338e2f154ec87f0"
55
+ "gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae",
56
+ "webiny": {
57
+ "publishFrom": "dist"
58
+ }
59
59
  }