@webiny/api-headless-cms-ddb 6.3.0-beta.2 → 6.3.0-beta.4

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.
@@ -1 +1 @@
1
- {"version":3,"names":["createStandardEntity","createModelEntity","params","table","entityName","name"],"sources":["model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"./types.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createStandardEntity","createModelEntity","params","table","entityName","name"],"sources":["model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"./types.js\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<StorageCmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAkB;IACzCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
2
2
  import type { GenericRecord } from "@webiny/api/types.js";
3
- import type { CmsEntryStatus, CmsGroup, CmsIdentity, CmsModel, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem } from "@webiny/api-headless-cms/types/index.js";
3
+ import type { CmsEntryStatus, CmsGroup, CmsIdentity, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem, StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
4
4
  export interface IEntryEntityAttributesData {
5
5
  id: string;
6
6
  entryId: string;
@@ -55,6 +55,6 @@ export interface IEntryEntityAttributesData {
55
55
  live: ICmsEntryLive | null;
56
56
  }
57
57
  export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
58
- export type IModelEntity = IEntity<IStandardEntityAttributes<CmsModel>>;
58
+ export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
59
59
  export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
60
60
  export type IEntryEntity = IEntity<IEntryEntityAttributes>;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntity, IStandardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type {\n CmsEntryStatus,\n CmsGroup,\n CmsIdentity,\n CmsModel,\n ICmsEntryLive,\n ICmsEntryLocation,\n ICmsEntrySystem\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface IEntryEntityAttributesData {\n id: string;\n entryId: string;\n modelId: string;\n\n tenant: string;\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: string;\n revisionModifiedOn: string | null;\n revisionSavedOn: string;\n revisionDeletedOn: string | null;\n revisionRestoredOn: string | null;\n revisionFirstPublishedOn: string | null;\n revisionLastPublishedOn: string | null;\n revisionCreatedBy: CmsIdentity;\n revisionModifiedBy: CmsIdentity | null;\n revisionSavedBy: CmsIdentity;\n revisionDeletedBy: CmsIdentity | null;\n revisionRestoredBy: CmsIdentity | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: string;\n modifiedOn: string | null;\n savedOn: string;\n deletedOn: string | null;\n restoredOn: string | null;\n firstPublishedOn: string | null;\n lastPublishedOn: string | null;\n createdBy: CmsIdentity;\n modifiedBy: CmsIdentity | null;\n savedBy: CmsIdentity;\n deletedBy: CmsIdentity | null;\n restoredBy: CmsIdentity | null;\n firstPublishedBy: CmsIdentity | null;\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * The rest. 👇\n */\n version: number;\n locked: boolean;\n status: CmsEntryStatus;\n location?: ICmsEntryLocation;\n wbyDeleted?: boolean | null;\n binOriginalFolderId?: string;\n values: GenericRecord;\n meta?: GenericRecord;\n system?: ICmsEntrySystem;\n live: ICmsEntryLive | null;\n}\n\nexport type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;\n\nexport type IModelEntity = IEntity<IStandardEntityAttributes<CmsModel>>;\nexport type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;\nexport type IEntryEntity = IEntity<IEntryEntityAttributes>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntity, IStandardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type {\n CmsEntryStatus,\n CmsGroup,\n CmsIdentity,\n ICmsEntryLive,\n ICmsEntryLocation,\n ICmsEntrySystem,\n StorageCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface IEntryEntityAttributesData {\n id: string;\n entryId: string;\n modelId: string;\n\n tenant: string;\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: string;\n revisionModifiedOn: string | null;\n revisionSavedOn: string;\n revisionDeletedOn: string | null;\n revisionRestoredOn: string | null;\n revisionFirstPublishedOn: string | null;\n revisionLastPublishedOn: string | null;\n revisionCreatedBy: CmsIdentity;\n revisionModifiedBy: CmsIdentity | null;\n revisionSavedBy: CmsIdentity;\n revisionDeletedBy: CmsIdentity | null;\n revisionRestoredBy: CmsIdentity | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: string;\n modifiedOn: string | null;\n savedOn: string;\n deletedOn: string | null;\n restoredOn: string | null;\n firstPublishedOn: string | null;\n lastPublishedOn: string | null;\n createdBy: CmsIdentity;\n modifiedBy: CmsIdentity | null;\n savedBy: CmsIdentity;\n deletedBy: CmsIdentity | null;\n restoredBy: CmsIdentity | null;\n firstPublishedBy: CmsIdentity | null;\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * The rest. 👇\n */\n version: number;\n locked: boolean;\n status: CmsEntryStatus;\n location?: ICmsEntryLocation;\n wbyDeleted?: boolean | null;\n binOriginalFolderId?: string;\n values: GenericRecord;\n meta?: GenericRecord;\n system?: ICmsEntrySystem;\n live: ICmsEntryLive | null;\n}\n\nexport type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;\n\nexport type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;\nexport type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;\nexport type IEntryEntity = IEntity<IEntryEntityAttributes>;\n"],"mappings":"","ignoreList":[]}
@@ -73,7 +73,6 @@ export const createModelsStorageOperations = params => {
73
73
  const keys = createKeys(model);
74
74
  try {
75
75
  await entity.delete(keys);
76
- return model;
77
76
  } catch (ex) {
78
77
  throw new WebinyError(ex.message || "Could not delete model.", ex.code || "MODEL_DELETE_ERROR", {
79
78
  error: ex,
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","convertException","createPartitionKey","params","tenant","createSortKey","modelId","createKeys","PK","SK","GSI_TENANT","createType","createModelsStorageOperations","entity","create","model","keys","put","data","TYPE","ex","error","update","message","code","deleteModel","delete","get","result","list","where","partitionKey","queryAll","options","gte","map","item"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModelStorageOperations,\n CmsModelStorageOperationsCreateParams,\n CmsModelStorageOperationsDeleteParams,\n CmsModelStorageOperationsGetParams,\n CmsModelStorageOperationsListParams,\n CmsModelStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { convertException } from \"@webiny/utils\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\n\ninterface PartitionKeysParams {\n tenant: string;\n}\nconst createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant } = params;\n if (!tenant) {\n throw new WebinyError(`Missing tenant variable when creating model partitionKey.`);\n }\n return `T#${tenant}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\nconst createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params),\n GSI_TENANT: params.tenant\n };\n};\n\nconst createType = (): string => {\n return \"cms.model\";\n};\n\ninterface CreateModelsStorageOperationsParams {\n entity: IModelEntity;\n}\nexport const createModelsStorageOperations = (\n params: CreateModelsStorageOperationsParams\n): CmsModelStorageOperations => {\n const { entity } = params;\n\n const create = async (params: CmsModelStorageOperationsCreateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(`Could not create CMS Content Model.`, \"CREATE_MODEL_ERROR\", {\n error: convertException(ex),\n model,\n keys\n });\n }\n };\n\n const update = async (params: CmsModelStorageOperationsUpdateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update model.\",\n ex.code || \"MODEL_UPDATE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const deleteModel = async (params: CmsModelStorageOperationsDeleteParams) => {\n const { model } = params;\n const keys = createKeys(model);\n\n try {\n await entity.delete(keys);\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsModelStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const result = await entity.get(keys);\n return result?.data || null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get model.\",\n ex.code || \"MODEL_GET_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n const list = async (params: CmsModelStorageOperationsListParams) => {\n const { where } = params;\n\n const partitionKey = createPartitionKey(where);\n\n try {\n const result = await entity.queryAll({\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n return result.map(item => {\n return item.data;\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n {\n error: ex,\n partitionKey\n }\n );\n }\n };\n\n return {\n create,\n update,\n delete: deleteModel,\n get,\n list\n };\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AASvC,SAASC,gBAAgB,QAAQ,eAAe;AAMhD,MAAMC,kBAAkB,GAAIC,MAA2B,IAAa;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EACzB,IAAI,CAACC,MAAM,EAAE;IACT,MAAM,IAAIJ,WAAW,CAAC,2DAA2D,CAAC;EACtF;EACA,OAAO,KAAKI,MAAM,SAAS;AAC/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AAG3B,MAAM;IAExB,MAAM4B,YAAY,GAAG7B,kBAAkB,CAAC4B,KAAK,CAAC;IAE9C,IAAI;MACA,MAAMF,MAAM,GAAG,MAAMf,MAAM,CAACmB,QAAQ,CAAC;QACjCD,YAAY;QACZE,OAAO,EAAE;UACLC,GAAG,EAAE;QACT;MACJ,CAAC,CAAC;MACF,OAAON,MAAM,CAACO,GAAG,CAACC,IAAI,IAAI;QACtB,OAAOA,IAAI,CAAClB,IAAI;MACpB,CAAC,CAAC;IACN,CAAC,CAAC,OAAOE,EAAE,EAAE;MACT,MAAM,IAAIpB,WAAW,CACjBoB,EAAE,CAACG,OAAO,IAAI,wBAAwB,EACtCH,EAAE,CAACI,IAAI,IAAI,kBAAkB,EAC7B;QACIH,KAAK,EAAED,EAAE;QACTW;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHjB,MAAM;IACNQ,MAAM;IACNI,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHE;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","convertException","createPartitionKey","params","tenant","createSortKey","modelId","createKeys","PK","SK","GSI_TENANT","createType","createModelsStorageOperations","entity","create","model","keys","put","data","TYPE","ex","error","update","message","code","deleteModel","delete","get","result","list","where","partitionKey","queryAll","options","gte","map","item"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModelStorageOperations,\n CmsModelStorageOperationsCreateParams,\n CmsModelStorageOperationsDeleteParams,\n CmsModelStorageOperationsGetParams,\n CmsModelStorageOperationsListParams,\n CmsModelStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { convertException } from \"@webiny/utils\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\n\ninterface PartitionKeysParams {\n tenant: string;\n}\nconst createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant } = params;\n if (!tenant) {\n throw new WebinyError(`Missing tenant variable when creating model partitionKey.`);\n }\n return `T#${tenant}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\nconst createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params),\n GSI_TENANT: params.tenant\n };\n};\n\nconst createType = (): string => {\n return \"cms.model\";\n};\n\ninterface CreateModelsStorageOperationsParams {\n entity: IModelEntity;\n}\nexport const createModelsStorageOperations = (\n params: CreateModelsStorageOperationsParams\n): CmsModelStorageOperations => {\n const { entity } = params;\n\n const create = async (params: CmsModelStorageOperationsCreateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(`Could not create CMS Content Model.`, \"CREATE_MODEL_ERROR\", {\n error: convertException(ex),\n model,\n keys\n });\n }\n };\n\n const update = async (params: CmsModelStorageOperationsUpdateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update model.\",\n ex.code || \"MODEL_UPDATE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const deleteModel = async (params: CmsModelStorageOperationsDeleteParams) => {\n const { model } = params;\n const keys = createKeys(model);\n\n try {\n await entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsModelStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const result = await entity.get(keys);\n return result?.data || null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get model.\",\n ex.code || \"MODEL_GET_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n const list = async (params: CmsModelStorageOperationsListParams) => {\n const { where } = params;\n\n const partitionKey = createPartitionKey(where);\n\n try {\n const result = await entity.queryAll({\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n return result.map(item => {\n return item.data;\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n {\n error: ex,\n partitionKey\n }\n );\n }\n };\n\n return {\n create,\n update,\n delete: deleteModel,\n get,\n list\n };\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AASvC,SAASC,gBAAgB,QAAQ,eAAe;AAMhD,MAAMC,kBAAkB,GAAIC,MAA2B,IAAa;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EACzB,IAAI,CAACC,MAAM,EAAE;IACT,MAAM,IAAIJ,WAAW,CAAC,2DAA2D,CAAC;EACtF;EACA,OAAO,KAAKI,MAAM,SAAS;AAC/B,CAAC;AAKD,MAAMC,aAAa,GAAIF,MAAqB,IAAa;EACrD,OAAOA,MAAM,CAACG,OAAO;AACzB,CAAC;AAOD,MAAMC,UAAU,GAAIJ,MAA2C,IAAW;EACtE,OAAO;IACHK,EAAE,EAAEN,kBAAkB,CAACC,MAAM,CAAC;IAC9BM,EAAE,EAAEJ,aAAa,CAACF,MAAM,CAAC;IACzBO,UAAU,EAAEP,MAAM,CAACC;EACvB,CAAC;AACL,CAAC;AAED,MAAMO,UAAU,GAAGA,CAAA,KAAc;EAC7B,OAAO,WAAW;AACtB,CAAC;AAKD,OAAO,MAAMC,6BAA6B,GACtCT,MAA2C,IACf;EAC5B,MAAM;IAAEU;EAAO,CAAC,GAAGV,MAAM;EAEzB,MAAMW,MAAM,GAAG,MAAOX,MAA6C,IAAK;IACpE,MAAM;MAAEY;IAAM,CAAC,GAAGZ,MAAM;IAExB,MAAMa,IAAI,GAAGT,UAAU,CAACQ,KAAK,CAAC;IAE9B,IAAI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","ignoreList":[]}
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms-ddb",
3
- "version": "6.3.0-beta.2",
3
+ "version": "6.3.0-beta.4",
4
4
  "type": "module",
5
- "main": "index.js",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
6
9
  "keywords": [
7
10
  "@webiny/api-headless-cms",
8
11
  "storage-operations",
@@ -23,15 +26,15 @@
23
26
  ],
24
27
  "license": "MIT",
25
28
  "dependencies": {
26
- "@webiny/api": "6.3.0-beta.2",
27
- "@webiny/api-headless-cms": "6.3.0-beta.2",
28
- "@webiny/aws-sdk": "6.3.0-beta.2",
29
- "@webiny/db-dynamodb": "6.3.0-beta.2",
30
- "@webiny/error": "6.3.0-beta.2",
31
- "@webiny/feature": "6.3.0-beta.2",
32
- "@webiny/handler": "6.3.0-beta.2",
33
- "@webiny/handler-db": "6.3.0-beta.2",
34
- "@webiny/utils": "6.3.0-beta.2",
29
+ "@webiny/api": "6.3.0-beta.4",
30
+ "@webiny/api-headless-cms": "6.3.0-beta.4",
31
+ "@webiny/aws-sdk": "6.3.0-beta.4",
32
+ "@webiny/db-dynamodb": "6.3.0-beta.4",
33
+ "@webiny/error": "6.3.0-beta.4",
34
+ "@webiny/feature": "6.3.0-beta.4",
35
+ "@webiny/handler": "6.3.0-beta.4",
36
+ "@webiny/handler-db": "6.3.0-beta.4",
37
+ "@webiny/utils": "6.3.0-beta.4",
35
38
  "dataloader": "2.2.3",
36
39
  "dot-object": "2.1.5",
37
40
  "dot-prop": "10.1.0",
@@ -40,10 +43,10 @@
40
43
  "devDependencies": {
41
44
  "@types/dot-object": "2.1.6",
42
45
  "@types/jsonpack": "1.1.6",
43
- "@webiny/build-tools": "6.3.0-beta.2",
46
+ "@webiny/build-tools": "6.3.0-beta.4",
44
47
  "@webiny/di": "0.2.3",
45
- "@webiny/plugins": "6.3.0-beta.2",
46
- "@webiny/project-utils": "6.3.0-beta.2",
48
+ "@webiny/plugins": "6.3.0-beta.4",
49
+ "@webiny/project-utils": "6.3.0-beta.4",
47
50
  "jest-dynalite": "3.6.1",
48
51
  "typescript": "6.0.3",
49
52
  "vitest": "4.1.5"
@@ -52,5 +55,5 @@
52
55
  "access": "public",
53
56
  "directory": "dist"
54
57
  },
55
- "gitHead": "c5ae1dbcb99bf7457449ef67aef19c5b4b1ffc4c"
58
+ "gitHead": "7cefe15431dbd65504e1f58147dc9e55bcbfa693"
56
59
  }