@webiny/api-headless-cms-ddb 6.6.0-alpha.12 → 6.6.0-alpha.13
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/operations/entry/DdbCreateEntry.d.ts +3 -1
- package/operations/entry/DdbCreateEntry.js +17 -10
- package/operations/entry/DdbCreateEntry.js.map +1 -1
- package/operations/entry/DdbCreateEntryRevisionFrom.d.ts +3 -1
- package/operations/entry/DdbCreateEntryRevisionFrom.js +22 -12
- package/operations/entry/DdbCreateEntryRevisionFrom.js.map +1 -1
- package/operations/entry/DdbDeleteEntry.d.ts +3 -3
- package/operations/entry/DdbDeleteEntry.js +7 -7
- package/operations/entry/DdbDeleteEntry.js.map +1 -1
- package/operations/entry/DdbDeleteEntryRevision.d.ts +3 -1
- package/operations/entry/DdbDeleteEntryRevision.js +23 -13
- package/operations/entry/DdbDeleteEntryRevision.js.map +1 -1
- package/operations/entry/DdbDeleteMultipleEntries.d.ts +3 -1
- package/operations/entry/DdbDeleteMultipleEntries.js +13 -6
- package/operations/entry/DdbDeleteMultipleEntries.js.map +1 -1
- package/operations/entry/DdbGetEntriesByIds.d.ts +3 -1
- package/operations/entry/DdbGetEntriesByIds.js +10 -3
- package/operations/entry/DdbGetEntriesByIds.js.map +1 -1
- package/operations/entry/DdbGetEntry.d.ts +3 -1
- package/operations/entry/DdbGetEntry.js +6 -2
- package/operations/entry/DdbGetEntry.js.map +1 -1
- package/operations/entry/DdbGetLatestEntriesByIds.d.ts +3 -1
- package/operations/entry/DdbGetLatestEntriesByIds.js +10 -3
- package/operations/entry/DdbGetLatestEntriesByIds.js.map +1 -1
- package/operations/entry/DdbGetLatestRevisionByEntryId.d.ts +3 -1
- package/operations/entry/DdbGetLatestRevisionByEntryId.js +10 -3
- package/operations/entry/DdbGetLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/DdbGetPreviousRevision.d.ts +3 -1
- package/operations/entry/DdbGetPreviousRevision.js +7 -3
- package/operations/entry/DdbGetPreviousRevision.js.map +1 -1
- package/operations/entry/DdbGetPublishedEntriesByIds.d.ts +3 -1
- package/operations/entry/DdbGetPublishedEntriesByIds.js +10 -3
- package/operations/entry/DdbGetPublishedEntriesByIds.js.map +1 -1
- package/operations/entry/DdbGetPublishedRevisionByEntryId.d.ts +3 -1
- package/operations/entry/DdbGetPublishedRevisionByEntryId.js +10 -3
- package/operations/entry/DdbGetPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/DdbGetRevisionById.d.ts +3 -1
- package/operations/entry/DdbGetRevisionById.js +10 -3
- package/operations/entry/DdbGetRevisionById.js.map +1 -1
- package/operations/entry/DdbGetRevisions.d.ts +3 -1
- package/operations/entry/DdbGetRevisions.js +10 -3
- package/operations/entry/DdbGetRevisions.js.map +1 -1
- package/operations/entry/DdbGetUniqueFieldValues.d.ts +3 -1
- package/operations/entry/DdbGetUniqueFieldValues.js +6 -2
- package/operations/entry/DdbGetUniqueFieldValues.js.map +1 -1
- package/operations/entry/DdbListEntries.d.ts +3 -1
- package/operations/entry/DdbListEntries.js +10 -3
- package/operations/entry/DdbListEntries.js.map +1 -1
- package/operations/entry/DdbMoveEntry.d.ts +3 -3
- package/operations/entry/DdbMoveEntry.js +7 -7
- package/operations/entry/DdbMoveEntry.js.map +1 -1
- package/operations/entry/DdbMoveToBin.d.ts +3 -1
- package/operations/entry/DdbMoveToBin.js +8 -4
- package/operations/entry/DdbMoveToBin.js.map +1 -1
- package/operations/entry/DdbPublishEntry.d.ts +3 -1
- package/operations/entry/DdbPublishEntry.js +54 -32
- package/operations/entry/DdbPublishEntry.js.map +1 -1
- package/operations/entry/DdbRestoreFromBin.d.ts +3 -1
- package/operations/entry/DdbRestoreFromBin.js +8 -4
- package/operations/entry/DdbRestoreFromBin.js.map +1 -1
- package/operations/entry/DdbUnpublishEntry.d.ts +3 -1
- package/operations/entry/DdbUnpublishEntry.js +32 -19
- package/operations/entry/DdbUnpublishEntry.js.map +1 -1
- package/operations/entry/DdbUpdateEntry.d.ts +3 -1
- package/operations/entry/DdbUpdateEntry.js +25 -15
- package/operations/entry/DdbUpdateEntry.js.map +1 -1
- package/operations/entry/keys.d.ts +15 -6
- package/operations/entry/keys.js +30 -12
- package/operations/entry/keys.js.map +1 -1
- package/operations/group/DdbCreateGroup.d.ts +3 -1
- package/operations/group/DdbCreateGroup.js +14 -4
- package/operations/group/DdbCreateGroup.js.map +1 -1
- package/operations/group/DdbDeleteGroup.d.ts +3 -1
- package/operations/group/DdbDeleteGroup.js +10 -3
- package/operations/group/DdbDeleteGroup.js.map +1 -1
- package/operations/group/DdbGetGroup.d.ts +3 -1
- package/operations/group/DdbGetGroup.js +10 -3
- package/operations/group/DdbGetGroup.js.map +1 -1
- package/operations/group/DdbListGroups.d.ts +3 -1
- package/operations/group/DdbListGroups.js +9 -3
- package/operations/group/DdbListGroups.js.map +1 -1
- package/operations/group/DdbUpdateGroup.d.ts +3 -1
- package/operations/group/DdbUpdateGroup.js +14 -4
- package/operations/group/DdbUpdateGroup.js.map +1 -1
- package/operations/model/DdbCreateModel.d.ts +3 -1
- package/operations/model/DdbCreateModel.js +14 -4
- package/operations/model/DdbCreateModel.js.map +1 -1
- package/operations/model/DdbDeleteModel.d.ts +3 -1
- package/operations/model/DdbDeleteModel.js +10 -3
- package/operations/model/DdbDeleteModel.js.map +1 -1
- package/operations/model/DdbGetModel.d.ts +3 -1
- package/operations/model/DdbGetModel.js +10 -3
- package/operations/model/DdbGetModel.js.map +1 -1
- package/operations/model/DdbListModels.d.ts +4 -2
- package/operations/model/DdbListModels.js +10 -5
- package/operations/model/DdbListModels.js.map +1 -1
- package/operations/model/DdbUpdateModel.d.ts +3 -1
- package/operations/model/DdbUpdateModel.js +14 -4
- package/operations/model/DdbUpdateModel.js.map +1 -1
- package/package.json +14 -14
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations/group/DdbUpdateGroup.js","sources":["../../../src/operations/group/DdbUpdateGroup.ts"],"sourcesContent":["import type { CmsGroupStorageOperationsUpdateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { UpdateGroupStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/group/UpdateGroupStorageOperation.js\";\nimport { CmsDdbGroupEntity } from \"~/abstractions/CmsDdbGroupEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbUpdateGroupImpl implements UpdateGroupStorageOperation.Interface {\n constructor(private entity: CmsDdbGroupEntity.Interface) {}\n\n async execute(params: CmsGroupStorageOperationsUpdateParams) {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await this.entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n { error: ex, group, keys }\n );\n }\n }\n}\n\nexport const DdbUpdateGroup = UpdateGroupStorageOperation.createImplementation({\n implementation: DdbUpdateGroupImpl,\n dependencies: [CmsDdbGroupEntity]\n});\n"],"names":["DdbUpdateGroupImpl","entity","params","group","keys","createKeys","createType","ex","WebinyError","DdbUpdateGroup","UpdateGroupStorageOperation","CmsDdbGroupEntity"],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations/group/DdbUpdateGroup.js","sources":["../../../src/operations/group/DdbUpdateGroup.ts"],"sourcesContent":["import type { CmsGroupStorageOperationsUpdateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { UpdateGroupStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/group/UpdateGroupStorageOperation.js\";\nimport { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport { CmsDdbGroupEntity } from \"~/abstractions/CmsDdbGroupEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbUpdateGroupImpl implements UpdateGroupStorageOperation.Interface {\n constructor(\n private entity: CmsDdbGroupEntity.Interface,\n private scopeTenant: ScopeTenant.Interface\n ) {}\n\n async execute(params: CmsGroupStorageOperationsUpdateParams) {\n const { group } = params;\n const tenant = this.scopeTenant.getId();\n const keys = createKeys({ tenant, id: group.id });\n try {\n await this.entity.put({\n data: { ...group, tenant },\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n { error: ex, group, keys }\n );\n }\n }\n}\n\nexport const DdbUpdateGroup = UpdateGroupStorageOperation.createImplementation({\n implementation: DdbUpdateGroupImpl,\n dependencies: [CmsDdbGroupEntity, ScopeTenant]\n});\n"],"names":["DdbUpdateGroupImpl","entity","scopeTenant","params","group","tenant","keys","createKeys","createType","ex","WebinyError","DdbUpdateGroup","UpdateGroupStorageOperation","CmsDdbGroupEntity","ScopeTenant"],"mappings":";;;;;AAOA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAkC,CAC5C;aAFUD,MAAM,GAANA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,SAAS,IAAI,CAAC,WAAW,CAAC,KAAK;QACrC,MAAMC,OAAOC,WAAW;YAAEF;YAAQ,IAAID,MAAM,EAAE;QAAC;QAC/C,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClB,MAAM;oBAAE,GAAGA,KAAK;oBAAEC;gBAAO;gBACzB,MAAMG;gBACN,GAAGF,IAAI;YACX;QACJ,EAAE,OAAOG,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBAAE,OAAOA;gBAAIL;gBAAOE;YAAK;QAEjC;IACJ;AACJ;AAEO,MAAMK,iBAAiBC,4BAA4B,oBAAoB,CAAC;IAC3E,gBAAgBZ;IAChB,cAAc;QAACa;QAAmBC;KAAY;AAClD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CmsModelStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
2
|
import { CreateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
declare class DdbCreateModelImpl implements CreateModelStorageOperation.Interface {
|
|
5
6
|
private entity;
|
|
6
|
-
|
|
7
|
+
private scopeTenant;
|
|
8
|
+
constructor(entity: CmsDdbModelEntity.Interface, scopeTenant: ScopeTenant.Interface);
|
|
7
9
|
execute(params: CmsModelStorageOperationsCreateParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel>;
|
|
8
10
|
}
|
|
9
11
|
export declare const DdbCreateModel: typeof DdbCreateModelImpl & {
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import error from "@webiny/error";
|
|
2
2
|
import { convertException } from "@webiny/utils";
|
|
3
3
|
import { CreateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js";
|
|
4
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
4
5
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
5
6
|
import { createKeys, createType } from "./keys.js";
|
|
6
7
|
class DdbCreateModelImpl {
|
|
7
|
-
constructor(entity){
|
|
8
|
+
constructor(entity, scopeTenant){
|
|
8
9
|
this.entity = entity;
|
|
10
|
+
this.scopeTenant = scopeTenant;
|
|
9
11
|
}
|
|
10
12
|
async execute(params) {
|
|
11
13
|
const { model } = params;
|
|
12
|
-
const
|
|
14
|
+
const tenant = this.scopeTenant.getId();
|
|
15
|
+
const keys = createKeys({
|
|
16
|
+
tenant,
|
|
17
|
+
modelId: model.modelId
|
|
18
|
+
});
|
|
13
19
|
try {
|
|
14
20
|
await this.entity.put({
|
|
15
|
-
data:
|
|
21
|
+
data: {
|
|
22
|
+
...model,
|
|
23
|
+
tenant
|
|
24
|
+
},
|
|
16
25
|
...keys,
|
|
17
26
|
TYPE: createType()
|
|
18
27
|
});
|
|
@@ -29,7 +38,8 @@ class DdbCreateModelImpl {
|
|
|
29
38
|
const DdbCreateModel = CreateModelStorageOperation.createImplementation({
|
|
30
39
|
implementation: DdbCreateModelImpl,
|
|
31
40
|
dependencies: [
|
|
32
|
-
CmsDdbModelEntity
|
|
41
|
+
CmsDdbModelEntity,
|
|
42
|
+
ScopeTenant
|
|
33
43
|
]
|
|
34
44
|
});
|
|
35
45
|
export { DdbCreateModel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations/model/DdbCreateModel.js","sources":["../../../src/operations/model/DdbCreateModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsCreateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { convertException } from \"@webiny/utils\";\nimport { CreateModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbCreateModelImpl implements CreateModelStorageOperation.Interface {\n constructor(private entity: CmsDdbModelEntity.Interface) {}\n\n async execute(params: CmsModelStorageOperationsCreateParams) {\n const { model } = params;\n const keys = createKeys(model);\n try {\n await this.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\nexport const DdbCreateModel = CreateModelStorageOperation.createImplementation({\n implementation: DdbCreateModelImpl,\n dependencies: [CmsDdbModelEntity]\n});\n"],"names":["DdbCreateModelImpl","entity","params","model","keys","createKeys","createType","ex","WebinyError","convertException","DdbCreateModel","CreateModelStorageOperation","CmsDdbModelEntity"],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations/model/DdbCreateModel.js","sources":["../../../src/operations/model/DdbCreateModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsCreateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { convertException } from \"@webiny/utils\";\nimport { CreateModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/CreateModelStorageOperation.js\";\nimport { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbCreateModelImpl implements CreateModelStorageOperation.Interface {\n constructor(\n private entity: CmsDdbModelEntity.Interface,\n private scopeTenant: ScopeTenant.Interface\n ) {}\n\n async execute(params: CmsModelStorageOperationsCreateParams) {\n const { model } = params;\n const tenant = this.scopeTenant.getId();\n const keys = createKeys({ tenant, modelId: model.modelId });\n try {\n await this.entity.put({\n data: { ...model, tenant },\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\nexport const DdbCreateModel = CreateModelStorageOperation.createImplementation({\n implementation: DdbCreateModelImpl,\n dependencies: [CmsDdbModelEntity, ScopeTenant]\n});\n"],"names":["DdbCreateModelImpl","entity","scopeTenant","params","model","tenant","keys","createKeys","createType","ex","WebinyError","convertException","DdbCreateModel","CreateModelStorageOperation","CmsDdbModelEntity","ScopeTenant"],"mappings":";;;;;;AAQA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAkC,CAC5C;aAFUD,MAAM,GAANA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,SAAS,IAAI,CAAC,WAAW,CAAC,KAAK;QACrC,MAAMC,OAAOC,WAAW;YAAEF;YAAQ,SAASD,MAAM,OAAO;QAAC;QACzD,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClB,MAAM;oBAAE,GAAGA,KAAK;oBAAEC;gBAAO;gBACzB,GAAGC,IAAI;gBACP,MAAME;YACV;YACA,OAAOJ;QACX,EAAE,OAAOK,IAAI;YACT,MAAM,IAAIC,MAAY,uCAAuC,sBAAsB;gBAC/E,OAAOC,iBAAiBF;gBACxBL;gBACAE;YACJ;QACJ;IACJ;AACJ;AAEO,MAAMM,iBAAiBC,4BAA4B,oBAAoB,CAAC;IAC3E,gBAAgBb;IAChB,cAAc;QAACc;QAAmBC;KAAY;AAClD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CmsModelStorageOperationsDeleteParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
2
|
import { DeleteModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
declare class DdbDeleteModelImpl implements DeleteModelStorageOperation.Interface {
|
|
5
6
|
private entity;
|
|
6
|
-
|
|
7
|
+
private scopeTenant;
|
|
8
|
+
constructor(entity: CmsDdbModelEntity.Interface, scopeTenant: ScopeTenant.Interface);
|
|
7
9
|
execute(params: CmsModelStorageOperationsDeleteParams): Promise<void>;
|
|
8
10
|
}
|
|
9
11
|
export declare const DdbDeleteModel: typeof DdbDeleteModelImpl & {
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import error from "@webiny/error";
|
|
2
2
|
import { DeleteModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
import { createKeys } from "./keys.js";
|
|
5
6
|
class DdbDeleteModelImpl {
|
|
6
|
-
constructor(entity){
|
|
7
|
+
constructor(entity, scopeTenant){
|
|
7
8
|
this.entity = entity;
|
|
9
|
+
this.scopeTenant = scopeTenant;
|
|
8
10
|
}
|
|
9
11
|
async execute(params) {
|
|
10
12
|
const { model } = params;
|
|
11
|
-
const
|
|
13
|
+
const tenant = this.scopeTenant.getId();
|
|
14
|
+
const keys = createKeys({
|
|
15
|
+
tenant,
|
|
16
|
+
modelId: model.modelId
|
|
17
|
+
});
|
|
12
18
|
try {
|
|
13
19
|
await this.entity.delete(keys);
|
|
14
20
|
} catch (ex) {
|
|
@@ -23,7 +29,8 @@ class DdbDeleteModelImpl {
|
|
|
23
29
|
const DdbDeleteModel = DeleteModelStorageOperation.createImplementation({
|
|
24
30
|
implementation: DdbDeleteModelImpl,
|
|
25
31
|
dependencies: [
|
|
26
|
-
CmsDdbModelEntity
|
|
32
|
+
CmsDdbModelEntity,
|
|
33
|
+
ScopeTenant
|
|
27
34
|
]
|
|
28
35
|
});
|
|
29
36
|
export { DdbDeleteModel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations/model/DdbDeleteModel.js","sources":["../../../src/operations/model/DdbDeleteModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsDeleteParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { DeleteModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbDeleteModelImpl implements DeleteModelStorageOperation.Interface {\n constructor(private entity: CmsDdbModelEntity.Interface) {}\n\n async execute(params: CmsModelStorageOperationsDeleteParams) {\n const { model } = params;\n const keys = createKeys(model);\n try {\n await this.entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n { error: ex, model, keys }\n );\n }\n }\n}\n\nexport const DdbDeleteModel = DeleteModelStorageOperation.createImplementation({\n implementation: DdbDeleteModelImpl,\n dependencies: [CmsDdbModelEntity]\n});\n"],"names":["DdbDeleteModelImpl","entity","params","model","keys","createKeys","ex","WebinyError","DdbDeleteModel","DeleteModelStorageOperation","CmsDdbModelEntity"],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations/model/DdbDeleteModel.js","sources":["../../../src/operations/model/DdbDeleteModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsDeleteParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { DeleteModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/DeleteModelStorageOperation.js\";\nimport { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbDeleteModelImpl implements DeleteModelStorageOperation.Interface {\n constructor(\n private entity: CmsDdbModelEntity.Interface,\n private scopeTenant: ScopeTenant.Interface\n ) {}\n\n async execute(params: CmsModelStorageOperationsDeleteParams) {\n const { model } = params;\n const tenant = this.scopeTenant.getId();\n const keys = createKeys({ tenant, modelId: model.modelId });\n try {\n await this.entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n { error: ex, model, keys }\n );\n }\n }\n}\n\nexport const DdbDeleteModel = DeleteModelStorageOperation.createImplementation({\n implementation: DdbDeleteModelImpl,\n dependencies: [CmsDdbModelEntity, ScopeTenant]\n});\n"],"names":["DdbDeleteModelImpl","entity","scopeTenant","params","model","tenant","keys","createKeys","ex","WebinyError","DdbDeleteModel","DeleteModelStorageOperation","CmsDdbModelEntity","ScopeTenant"],"mappings":";;;;;AAOA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAkC,CAC5C;aAFUD,MAAM,GAANA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,SAAS,IAAI,CAAC,WAAW,CAAC,KAAK;QACrC,MAAMC,OAAOC,WAAW;YAAEF;YAAQ,SAASD,MAAM,OAAO;QAAC;QACzD,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAACE;QAC7B,EAAE,OAAOE,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBAAE,OAAOA;gBAAIJ;gBAAOE;YAAK;QAEjC;IACJ;AACJ;AAEO,MAAMI,iBAAiBC,4BAA4B,oBAAoB,CAAC;IAC3E,gBAAgBX;IAChB,cAAc;QAACY;QAAmBC;KAAY;AAClD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CmsModelStorageOperationsGetParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
2
|
import { GetModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
declare class DdbGetModelImpl implements GetModelStorageOperation.Interface {
|
|
5
6
|
private entity;
|
|
6
|
-
|
|
7
|
+
private scopeTenant;
|
|
8
|
+
constructor(entity: CmsDdbModelEntity.Interface, scopeTenant: ScopeTenant.Interface);
|
|
7
9
|
execute(params: CmsModelStorageOperationsGetParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel | null>;
|
|
8
10
|
}
|
|
9
11
|
export declare const DdbGetModel: typeof DdbGetModelImpl & {
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import error from "@webiny/error";
|
|
2
2
|
import { GetModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
import { createKeys } from "./keys.js";
|
|
5
6
|
class DdbGetModelImpl {
|
|
6
|
-
constructor(entity){
|
|
7
|
+
constructor(entity, scopeTenant){
|
|
7
8
|
this.entity = entity;
|
|
9
|
+
this.scopeTenant = scopeTenant;
|
|
8
10
|
}
|
|
9
11
|
async execute(params) {
|
|
10
|
-
const
|
|
12
|
+
const tenant = this.scopeTenant.getId();
|
|
13
|
+
const keys = createKeys({
|
|
14
|
+
tenant,
|
|
15
|
+
modelId: params.modelId
|
|
16
|
+
});
|
|
11
17
|
try {
|
|
12
18
|
const result = await this.entity.get(keys);
|
|
13
19
|
return result?.data || null;
|
|
@@ -22,7 +28,8 @@ class DdbGetModelImpl {
|
|
|
22
28
|
const DdbGetModel = GetModelStorageOperation.createImplementation({
|
|
23
29
|
implementation: DdbGetModelImpl,
|
|
24
30
|
dependencies: [
|
|
25
|
-
CmsDdbModelEntity
|
|
31
|
+
CmsDdbModelEntity,
|
|
32
|
+
ScopeTenant
|
|
26
33
|
]
|
|
27
34
|
});
|
|
28
35
|
export { DdbGetModel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations/model/DdbGetModel.js","sources":["../../../src/operations/model/DdbGetModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsGetParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { GetModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbGetModelImpl implements GetModelStorageOperation.Interface {\n constructor(private entity: CmsDdbModelEntity.Interface) {}\n\n async execute(params: CmsModelStorageOperationsGetParams) {\n const keys = createKeys(params);\n try {\n const result = await this.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 { error: ex, keys }\n );\n }\n }\n}\n\nexport const DdbGetModel = GetModelStorageOperation.createImplementation({\n implementation: DdbGetModelImpl,\n dependencies: [CmsDdbModelEntity]\n});\n"],"names":["DdbGetModelImpl","entity","params","keys","createKeys","result","ex","WebinyError","DdbGetModel","GetModelStorageOperation","CmsDdbModelEntity"],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations/model/DdbGetModel.js","sources":["../../../src/operations/model/DdbGetModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsGetParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { GetModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/GetModelStorageOperation.js\";\nimport { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys } from \"./keys.js\";\n\nclass DdbGetModelImpl implements GetModelStorageOperation.Interface {\n constructor(\n private entity: CmsDdbModelEntity.Interface,\n private scopeTenant: ScopeTenant.Interface\n ) {}\n\n async execute(params: CmsModelStorageOperationsGetParams) {\n const tenant = this.scopeTenant.getId();\n const keys = createKeys({ tenant, modelId: params.modelId });\n try {\n const result = await this.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 { error: ex, keys }\n );\n }\n }\n}\n\nexport const DdbGetModel = GetModelStorageOperation.createImplementation({\n implementation: DdbGetModelImpl,\n dependencies: [CmsDdbModelEntity, ScopeTenant]\n});\n"],"names":["DdbGetModelImpl","entity","scopeTenant","params","tenant","keys","createKeys","result","ex","WebinyError","DdbGetModel","GetModelStorageOperation","CmsDdbModelEntity","ScopeTenant"],"mappings":";;;;;AAOA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAkC,CAC5C;aAFUD,MAAM,GAANA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,QAAQC,MAA0C,EAAE;QACtD,MAAMC,SAAS,IAAI,CAAC,WAAW,CAAC,KAAK;QACrC,MAAMC,OAAOC,WAAW;YAAEF;YAAQ,SAASD,OAAO,OAAO;QAAC;QAC1D,IAAI;YACA,MAAMI,SAAS,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAACF;YACrC,OAAOE,QAAQ,QAAQ;QAC3B,EAAE,OAAOC,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,wBACdA,GAAG,IAAI,IAAI,mBACX;gBAAE,OAAOA;gBAAIH;YAAK;QAE1B;IACJ;AACJ;AAEO,MAAMK,cAAcC,yBAAyB,oBAAoB,CAAC;IACrE,gBAAgBX;IAChB,cAAc;QAACY;QAAmBC;KAAY;AAClD"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { CmsModelStorageOperationsListParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
2
|
import { ListModelsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
declare class DdbListModelsImpl implements ListModelsStorageOperation.Interface {
|
|
5
6
|
private entity;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
private scopeTenant;
|
|
8
|
+
constructor(entity: CmsDdbModelEntity.Interface, scopeTenant: ScopeTenant.Interface);
|
|
9
|
+
execute(_params: CmsModelStorageOperationsListParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel[]>;
|
|
8
10
|
}
|
|
9
11
|
export declare const DdbListModels: typeof DdbListModelsImpl & {
|
|
10
12
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js").IListModelsStorageOperation>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import error from "@webiny/error";
|
|
2
2
|
import { ListModelsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
import { createPartitionKey } from "./keys.js";
|
|
5
6
|
class DdbListModelsImpl {
|
|
6
|
-
constructor(entity){
|
|
7
|
+
constructor(entity, scopeTenant){
|
|
7
8
|
this.entity = entity;
|
|
9
|
+
this.scopeTenant = scopeTenant;
|
|
8
10
|
}
|
|
9
|
-
async execute(
|
|
10
|
-
const
|
|
11
|
-
const partitionKey = createPartitionKey(
|
|
11
|
+
async execute(_params) {
|
|
12
|
+
const tenant = this.scopeTenant.getId();
|
|
13
|
+
const partitionKey = createPartitionKey({
|
|
14
|
+
tenant
|
|
15
|
+
});
|
|
12
16
|
try {
|
|
13
17
|
const result = await this.entity.queryAll({
|
|
14
18
|
partitionKey,
|
|
@@ -28,7 +32,8 @@ class DdbListModelsImpl {
|
|
|
28
32
|
const DdbListModels = ListModelsStorageOperation.createImplementation({
|
|
29
33
|
implementation: DdbListModelsImpl,
|
|
30
34
|
dependencies: [
|
|
31
|
-
CmsDdbModelEntity
|
|
35
|
+
CmsDdbModelEntity,
|
|
36
|
+
ScopeTenant
|
|
32
37
|
]
|
|
33
38
|
});
|
|
34
39
|
export { DdbListModels };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations/model/DdbListModels.js","sources":["../../../src/operations/model/DdbListModels.ts"],"sourcesContent":["import type { CmsModelStorageOperationsListParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { ListModelsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createPartitionKey } from \"./keys.js\";\n\nclass DdbListModelsImpl implements ListModelsStorageOperation.Interface {\n constructor(private entity: CmsDdbModelEntity.Interface) {}\n\n async execute(
|
|
1
|
+
{"version":3,"file":"operations/model/DdbListModels.js","sources":["../../../src/operations/model/DdbListModels.ts"],"sourcesContent":["import type { CmsModelStorageOperationsListParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { ListModelsStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js\";\nimport { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createPartitionKey } from \"./keys.js\";\n\nclass DdbListModelsImpl implements ListModelsStorageOperation.Interface {\n constructor(\n private entity: CmsDdbModelEntity.Interface,\n private scopeTenant: ScopeTenant.Interface\n ) {}\n\n async execute(_params: CmsModelStorageOperationsListParams) {\n const tenant = this.scopeTenant.getId();\n const partitionKey = createPartitionKey({ tenant });\n try {\n const result = await this.entity.queryAll({\n partitionKey,\n options: { gte: \" \" }\n });\n return result.map(item => item.data);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n { error: ex, partitionKey }\n );\n }\n }\n}\n\nexport const DdbListModels = ListModelsStorageOperation.createImplementation({\n implementation: DdbListModelsImpl,\n dependencies: [CmsDdbModelEntity, ScopeTenant]\n});\n"],"names":["DdbListModelsImpl","entity","scopeTenant","_params","tenant","partitionKey","createPartitionKey","result","item","ex","WebinyError","DdbListModels","ListModelsStorageOperation","CmsDdbModelEntity","ScopeTenant"],"mappings":";;;;;AAOA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAkC,CAC5C;aAFUD,MAAM,GAANA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,QAAQC,OAA4C,EAAE;QACxD,MAAMC,SAAS,IAAI,CAAC,WAAW,CAAC,KAAK;QACrC,MAAMC,eAAeC,mBAAmB;YAAEF;QAAO;QACjD,IAAI;YACA,MAAMG,SAAS,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;gBACtCF;gBACA,SAAS;oBAAE,KAAK;gBAAI;YACxB;YACA,OAAOE,OAAO,GAAG,CAACC,CAAAA,OAAQA,KAAK,IAAI;QACvC,EAAE,OAAOC,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,0BACdA,GAAG,IAAI,IAAI,oBACX;gBAAE,OAAOA;gBAAIJ;YAAa;QAElC;IACJ;AACJ;AAEO,MAAMM,gBAAgBC,2BAA2B,oBAAoB,CAAC;IACzE,gBAAgBZ;IAChB,cAAc;QAACa;QAAmBC;KAAY;AAClD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CmsModelStorageOperationsUpdateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
2
|
import { UpdateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
declare class DdbUpdateModelImpl implements UpdateModelStorageOperation.Interface {
|
|
5
6
|
private entity;
|
|
6
|
-
|
|
7
|
+
private scopeTenant;
|
|
8
|
+
constructor(entity: CmsDdbModelEntity.Interface, scopeTenant: ScopeTenant.Interface);
|
|
7
9
|
execute(params: CmsModelStorageOperationsUpdateParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel>;
|
|
8
10
|
}
|
|
9
11
|
export declare const DdbUpdateModel: typeof DdbUpdateModelImpl & {
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import error from "@webiny/error";
|
|
2
2
|
import { UpdateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js";
|
|
3
|
+
import { ScopeTenant } from "@webiny/api-core/features/tenancy/ScopeTenant/index.js";
|
|
3
4
|
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
5
|
import { createKeys, createType } from "./keys.js";
|
|
5
6
|
class DdbUpdateModelImpl {
|
|
6
|
-
constructor(entity){
|
|
7
|
+
constructor(entity, scopeTenant){
|
|
7
8
|
this.entity = entity;
|
|
9
|
+
this.scopeTenant = scopeTenant;
|
|
8
10
|
}
|
|
9
11
|
async execute(params) {
|
|
10
12
|
const { model } = params;
|
|
11
|
-
const
|
|
13
|
+
const tenant = this.scopeTenant.getId();
|
|
14
|
+
const keys = createKeys({
|
|
15
|
+
tenant,
|
|
16
|
+
modelId: model.modelId
|
|
17
|
+
});
|
|
12
18
|
try {
|
|
13
19
|
await this.entity.put({
|
|
14
|
-
data:
|
|
20
|
+
data: {
|
|
21
|
+
...model,
|
|
22
|
+
tenant
|
|
23
|
+
},
|
|
15
24
|
...keys,
|
|
16
25
|
TYPE: createType()
|
|
17
26
|
});
|
|
@@ -28,7 +37,8 @@ class DdbUpdateModelImpl {
|
|
|
28
37
|
const DdbUpdateModel = UpdateModelStorageOperation.createImplementation({
|
|
29
38
|
implementation: DdbUpdateModelImpl,
|
|
30
39
|
dependencies: [
|
|
31
|
-
CmsDdbModelEntity
|
|
40
|
+
CmsDdbModelEntity,
|
|
41
|
+
ScopeTenant
|
|
32
42
|
]
|
|
33
43
|
});
|
|
34
44
|
export { DdbUpdateModel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations/model/DdbUpdateModel.js","sources":["../../../src/operations/model/DdbUpdateModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsUpdateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { UpdateModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbUpdateModelImpl implements UpdateModelStorageOperation.Interface {\n constructor(private entity: CmsDdbModelEntity.Interface) {}\n\n async execute(params: CmsModelStorageOperationsUpdateParams) {\n const { model } = params;\n const keys = createKeys(model);\n try {\n await this.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 { error: ex, model, keys }\n );\n }\n }\n}\n\nexport const DdbUpdateModel = UpdateModelStorageOperation.createImplementation({\n implementation: DdbUpdateModelImpl,\n dependencies: [CmsDdbModelEntity]\n});\n"],"names":["DdbUpdateModelImpl","entity","params","model","keys","createKeys","createType","ex","WebinyError","DdbUpdateModel","UpdateModelStorageOperation","CmsDdbModelEntity"],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations/model/DdbUpdateModel.js","sources":["../../../src/operations/model/DdbUpdateModel.ts"],"sourcesContent":["import type { CmsModelStorageOperationsUpdateParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { UpdateModelStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js\";\nimport { ScopeTenant } from \"@webiny/api-core/features/tenancy/ScopeTenant/index.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { createKeys, createType } from \"./keys.js\";\n\nclass DdbUpdateModelImpl implements UpdateModelStorageOperation.Interface {\n constructor(\n private entity: CmsDdbModelEntity.Interface,\n private scopeTenant: ScopeTenant.Interface\n ) {}\n\n async execute(params: CmsModelStorageOperationsUpdateParams) {\n const { model } = params;\n const tenant = this.scopeTenant.getId();\n const keys = createKeys({ tenant, modelId: model.modelId });\n try {\n await this.entity.put({\n data: { ...model, tenant },\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 { error: ex, model, keys }\n );\n }\n }\n}\n\nexport const DdbUpdateModel = UpdateModelStorageOperation.createImplementation({\n implementation: DdbUpdateModelImpl,\n dependencies: [CmsDdbModelEntity, ScopeTenant]\n});\n"],"names":["DdbUpdateModelImpl","entity","scopeTenant","params","model","tenant","keys","createKeys","createType","ex","WebinyError","DdbUpdateModel","UpdateModelStorageOperation","CmsDdbModelEntity","ScopeTenant"],"mappings":";;;;;AAOA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAkC,CAC5C;aAFUD,MAAM,GAANA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,SAAS,IAAI,CAAC,WAAW,CAAC,KAAK;QACrC,MAAMC,OAAOC,WAAW;YAAEF;YAAQ,SAASD,MAAM,OAAO;QAAC;QACzD,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClB,MAAM;oBAAE,GAAGA,KAAK;oBAAEC;gBAAO;gBACzB,GAAGC,IAAI;gBACP,MAAME;YACV;YACA,OAAOJ;QACX,EAAE,OAAOK,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBAAE,OAAOA;gBAAIL;gBAAOE;YAAK;QAEjC;IACJ;AACJ;AAEO,MAAMK,iBAAiBC,4BAA4B,oBAAoB,CAAC;IAC3E,gBAAgBZ;IAChB,cAAc;QAACa;QAAmBC;KAAY;AAClD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb",
|
|
3
|
-
"version": "6.6.0-alpha.
|
|
3
|
+
"version": "6.6.0-alpha.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -26,26 +26,26 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@webiny/api": "6.6.0-alpha.
|
|
30
|
-
"@webiny/api-
|
|
31
|
-
"@webiny/api-headless-cms
|
|
32
|
-
"@webiny/
|
|
33
|
-
"@webiny/
|
|
34
|
-
"@webiny/db-
|
|
35
|
-
"@webiny/
|
|
36
|
-
"@webiny/
|
|
37
|
-
"@webiny/
|
|
38
|
-
"@webiny/
|
|
29
|
+
"@webiny/api": "6.6.0-alpha.13",
|
|
30
|
+
"@webiny/api-core": "6.6.0-alpha.13",
|
|
31
|
+
"@webiny/api-headless-cms": "6.6.0-alpha.13",
|
|
32
|
+
"@webiny/api-headless-cms-storage": "6.6.0-alpha.13",
|
|
33
|
+
"@webiny/aws-sdk": "6.6.0-alpha.13",
|
|
34
|
+
"@webiny/db-dynamodb": "6.6.0-alpha.13",
|
|
35
|
+
"@webiny/db-utils": "6.6.0-alpha.13",
|
|
36
|
+
"@webiny/error": "6.6.0-alpha.13",
|
|
37
|
+
"@webiny/feature": "6.6.0-alpha.13",
|
|
38
|
+
"@webiny/handler": "6.6.0-alpha.13",
|
|
39
|
+
"@webiny/utils": "6.6.0-alpha.13",
|
|
39
40
|
"dataloader": "2.2.3"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@types/jsonpack": "1.1.6",
|
|
43
|
-
"@webiny/
|
|
44
|
-
"@webiny/build-tools": "6.6.0-alpha.12",
|
|
44
|
+
"@webiny/build-tools": "6.6.0-alpha.13",
|
|
45
45
|
"@webiny/di": "2.0.0",
|
|
46
46
|
"jest-dynalite": "3.6.1",
|
|
47
47
|
"typescript": "7.0.2",
|
|
48
|
-
"vitest": "5.
|
|
48
|
+
"vitest": "5.1.1"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n CmsEntryValues,\n CmsModel,\n CmsStorageEntry\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n tenant: string;\n}\n\nexport interface DataLoadersHandlerDataLoaderParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n ids: readonly string[];\n}\n\nexport interface IDataLoadersHandler {\n getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getRevisionById<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"names":["ENTITIES"],"mappings":"AAMO,IAAKA,iBAAQA,WAAAA,GAAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n CmsEntryValues,\n CmsModel,\n CmsStorageEntry\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n tenant: string;\n}\n\nexport interface DataLoadersHandlerDataLoaderParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n ids: readonly string[];\n}\n\nexport interface IDataLoadersHandler {\n getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getRevisionById<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"names":["ENTITIES"],"mappings":"AAMO,IAAKA,iBAAQA,WAAAA,GAAAA,SAAAA,QAAAA"}
|