@webiny/api-headless-cms-ddb 0.0.0-mt-2 → 0.0.0-unstable.0156a4c312
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/README.md +6 -20
- package/abstractions/CmsDdbDataLoaders.d.ts +5 -0
- package/abstractions/CmsDdbDataLoaders.js +5 -0
- package/abstractions/CmsDdbDataLoaders.js.map +1 -0
- package/abstractions/CmsDdbEntryEntity.d.ts +5 -0
- package/abstractions/CmsDdbEntryEntity.js +5 -0
- package/abstractions/CmsDdbEntryEntity.js.map +1 -0
- package/abstractions/CmsDdbGroupEntity.d.ts +5 -0
- package/abstractions/CmsDdbGroupEntity.js +5 -0
- package/abstractions/CmsDdbGroupEntity.js.map +1 -0
- package/abstractions/CmsDdbModelEntity.d.ts +5 -0
- package/abstractions/CmsDdbModelEntity.js +5 -0
- package/abstractions/CmsDdbModelEntity.js.map +1 -0
- package/abstractions/CmsDdbTable.d.ts +5 -0
- package/abstractions/CmsDdbTable.js +5 -0
- package/abstractions/CmsDdbTable.js.map +1 -0
- package/definitions/entry.d.ts +6 -6
- package/definitions/entry.js +9 -95
- package/definitions/entry.js.map +1 -0
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +9 -72
- package/definitions/group.js.map +1 -0
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +9 -94
- package/definitions/model.js.map +1 -0
- package/definitions/table.d.ts +6 -7
- package/definitions/table.js +8 -30
- package/definitions/table.js.map +1 -0
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/index.d.ts +10 -2
- package/index.js +45 -123
- package/index.js.map +1 -0
- package/operations/entry/DdbCreateEntry.d.ts +16 -0
- package/operations/entry/DdbCreateEntry.js +77 -0
- package/operations/entry/DdbCreateEntry.js.map +1 -0
- package/operations/entry/DdbCreateEntryRevisionFrom.d.ts +16 -0
- package/operations/entry/DdbCreateEntryRevisionFrom.js +85 -0
- package/operations/entry/DdbCreateEntryRevisionFrom.js.map +1 -0
- package/operations/entry/DdbDeleteEntry.d.ts +16 -0
- package/operations/entry/DdbDeleteEntry.js +65 -0
- package/operations/entry/DdbDeleteEntry.js.map +1 -0
- package/operations/entry/DdbDeleteEntryRevision.d.ts +17 -0
- package/operations/entry/DdbDeleteEntryRevision.js +91 -0
- package/operations/entry/DdbDeleteEntryRevision.js.map +1 -0
- package/operations/entry/DdbDeleteMultipleEntries.d.ts +16 -0
- package/operations/entry/DdbDeleteMultipleEntries.js +59 -0
- package/operations/entry/DdbDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/DdbGetEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbGetEntriesByIds.js +31 -0
- package/operations/entry/DdbGetEntriesByIds.js.map +1 -0
- package/operations/entry/DdbGetEntry.d.ts +14 -0
- package/operations/entry/DdbGetEntry.js +27 -0
- package/operations/entry/DdbGetEntry.js.map +1 -0
- package/operations/entry/DdbGetLatestEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbGetLatestEntriesByIds.js +31 -0
- package/operations/entry/DdbGetLatestEntriesByIds.js.map +1 -0
- package/operations/entry/DdbGetLatestRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbGetLatestRevisionByEntryId.js +35 -0
- package/operations/entry/DdbGetLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbGetPreviousRevision.d.ts +14 -0
- package/operations/entry/DdbGetPreviousRevision.js +53 -0
- package/operations/entry/DdbGetPreviousRevision.js.map +1 -0
- package/operations/entry/DdbGetPublishedEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbGetPublishedEntriesByIds.js +31 -0
- package/operations/entry/DdbGetPublishedEntriesByIds.js.map +1 -0
- package/operations/entry/DdbGetPublishedRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbGetPublishedRevisionByEntryId.js +35 -0
- package/operations/entry/DdbGetPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbGetRevisionById.d.ts +14 -0
- package/operations/entry/DdbGetRevisionById.js +34 -0
- package/operations/entry/DdbGetRevisionById.js.map +1 -0
- package/operations/entry/DdbGetRevisions.d.ts +14 -0
- package/operations/entry/DdbGetRevisions.js +33 -0
- package/operations/entry/DdbGetRevisions.js.map +1 -0
- package/operations/entry/DdbGetUniqueFieldValues.d.ts +12 -0
- package/operations/entry/DdbGetUniqueFieldValues.js +31 -0
- package/operations/entry/DdbGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbListEntries.d.ts +30 -0
- package/operations/entry/DdbListEntries.js +133 -0
- package/operations/entry/DdbListEntries.js.map +1 -0
- package/operations/entry/DdbMoveEntry.d.ts +16 -0
- package/operations/entry/DdbMoveEntry.js +63 -0
- package/operations/entry/DdbMoveEntry.js.map +1 -0
- package/operations/entry/DdbMoveToBin.d.ts +16 -0
- package/operations/entry/DdbMoveToBin.js +77 -0
- package/operations/entry/DdbMoveToBin.js.map +1 -0
- package/operations/entry/DdbPublishEntry.d.ts +18 -0
- package/operations/entry/DdbPublishEntry.js +162 -0
- package/operations/entry/DdbPublishEntry.js.map +1 -0
- package/operations/entry/DdbRestoreFromBin.d.ts +16 -0
- package/operations/entry/DdbRestoreFromBin.js +78 -0
- package/operations/entry/DdbRestoreFromBin.js.map +1 -0
- package/operations/entry/DdbUnpublishEntry.d.ts +17 -0
- package/operations/entry/DdbUnpublishEntry.js +112 -0
- package/operations/entry/DdbUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbUpdateEntry.d.ts +17 -0
- package/operations/entry/DdbUpdateEntry.js +105 -0
- package/operations/entry/DdbUpdateEntry.js.map +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +5 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +40 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +40 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +42 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +18 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +0 -0
- package/operations/entry/dataLoaders.d.ts +20 -31
- package/operations/entry/dataLoaders.js +91 -296
- package/operations/entry/dataLoaders.js.map +1 -0
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +46 -2
- package/operations/entry/keys.js +53 -55
- package/operations/entry/keys.js.map +1 -0
- package/operations/entry/storageEntryUtils.d.ts +8 -0
- package/operations/entry/storageEntryUtils.js +25 -0
- package/operations/entry/storageEntryUtils.js.map +1 -0
- package/operations/group/DdbCreateGroup.d.ts +12 -0
- package/operations/group/DdbCreateGroup.js +35 -0
- package/operations/group/DdbCreateGroup.js.map +1 -0
- package/operations/group/DdbDeleteGroup.d.ts +12 -0
- package/operations/group/DdbDeleteGroup.js +31 -0
- package/operations/group/DdbDeleteGroup.js.map +1 -0
- package/operations/group/DdbGetGroup.d.ts +12 -0
- package/operations/group/DdbGetGroup.js +31 -0
- package/operations/group/DdbGetGroup.js.map +1 -0
- package/operations/group/DdbListGroups.d.ts +14 -0
- package/operations/group/DdbListGroups.js +52 -0
- package/operations/group/DdbListGroups.js.map +1 -0
- package/operations/group/DdbUpdateGroup.d.ts +12 -0
- package/operations/group/DdbUpdateGroup.js +35 -0
- package/operations/group/DdbUpdateGroup.js.map +1 -0
- package/operations/group/feature.d.ts +4 -0
- package/operations/group/feature.js +19 -0
- package/operations/group/feature.js.map +1 -0
- package/operations/group/keys.d.ts +15 -0
- package/operations/group/keys.js +17 -0
- package/operations/group/keys.js.map +1 -0
- package/operations/model/DdbCreateModel.d.ts +12 -0
- package/operations/model/DdbCreateModel.js +37 -0
- package/operations/model/DdbCreateModel.js.map +1 -0
- package/operations/model/DdbDeleteModel.d.ts +12 -0
- package/operations/model/DdbDeleteModel.js +31 -0
- package/operations/model/DdbDeleteModel.js.map +1 -0
- package/operations/model/DdbGetModel.d.ts +12 -0
- package/operations/model/DdbGetModel.js +30 -0
- package/operations/model/DdbGetModel.js.map +1 -0
- package/operations/model/DdbListModels.d.ts +12 -0
- package/operations/model/DdbListModels.js +36 -0
- package/operations/model/DdbListModels.js.map +1 -0
- package/operations/model/DdbUpdateModel.d.ts +12 -0
- package/operations/model/DdbUpdateModel.js +36 -0
- package/operations/model/DdbUpdateModel.js.map +1 -0
- package/operations/model/feature.d.ts +4 -0
- package/operations/model/feature.js +19 -0
- package/operations/model/feature.js.map +1 -0
- package/operations/model/keys.d.ts +15 -0
- package/operations/model/keys.js +16 -0
- package/operations/model/keys.js.map +1 -0
- package/package.json +30 -34
- package/types.d.ts +12 -76
- package/types.js +8 -15
- package/types.js.map +1 -0
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -62
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -50
- package/dynamoDb/index.d.ts +0 -2
- package/dynamoDb/index.js +0 -24
- package/dynamoDb/path/plainObject.d.ts +0 -3
- package/dynamoDb/path/plainObject.js +0 -33
- package/dynamoDb/path/ref.d.ts +0 -3
- package/dynamoDb/path/ref.js +0 -27
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -65
- package/dynamoDb/storage/longText.d.ts +0 -7
- package/dynamoDb/storage/longText.js +0 -83
- package/dynamoDb/storage/richText.d.ts +0 -8
- package/dynamoDb/storage/richText.js +0 -110
- package/dynamoDb/transformValue/datetime.d.ts +0 -3
- package/dynamoDb/transformValue/datetime.js +0 -47
- package/operations/entry/index.d.ts +0 -8
- package/operations/entry/index.js +0 -823
- package/operations/entry/systemFields.d.ts +0 -2
- package/operations/entry/systemFields.js +0 -50
- package/operations/entry/utils.d.ts +0 -31
- package/operations/entry/utils.js +0 -406
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -198
- package/operations/model/index.d.ts +0 -6
- package/operations/model/index.js +0 -161
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -141
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -105
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { ListModelsStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/ListModelsStorageOperation.js";
|
|
3
|
+
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
|
+
import { createPartitionKey } from "./keys.js";
|
|
5
|
+
class DdbListModelsImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const { where } = params;
|
|
11
|
+
const partitionKey = createPartitionKey(where);
|
|
12
|
+
try {
|
|
13
|
+
const result = await this.entity.queryAll({
|
|
14
|
+
partitionKey,
|
|
15
|
+
options: {
|
|
16
|
+
gte: " "
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return result.map((item)=>item.data);
|
|
20
|
+
} catch (ex) {
|
|
21
|
+
throw new error(ex.message || "Could not list models.", ex.code || "MODEL_LIST_ERROR", {
|
|
22
|
+
error: ex,
|
|
23
|
+
partitionKey
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const DdbListModels = ListModelsStorageOperation.createImplementation({
|
|
29
|
+
implementation: DdbListModelsImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
CmsDdbModelEntity
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
export { DdbListModels };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=DdbListModels.js.map
|
|
@@ -0,0 +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(params: CmsModelStorageOperationsListParams) {\n const { where } = params;\n const partitionKey = createPartitionKey(where);\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]\n});\n"],"names":["DdbListModelsImpl","entity","params","where","partitionKey","createPartitionKey","result","item","ex","WebinyError","DdbListModels","ListModelsStorageOperation","CmsDdbModelEntity"],"mappings":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA2C,EAAE;QACvD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,eAAeC,mBAAmBF;QACxC,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,gBAAgBX;IAChB,cAAc;QAACY;KAAkB;AACrC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsModelStorageOperationsUpdateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { UpdateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
|
+
declare class DdbUpdateModelImpl implements UpdateModelStorageOperation.Interface {
|
|
5
|
+
private entity;
|
|
6
|
+
constructor(entity: CmsDdbModelEntity.Interface);
|
|
7
|
+
execute(params: CmsModelStorageOperationsUpdateParams): Promise<import("@webiny/api-headless-cms/types/model.js").StorageCmsModel>;
|
|
8
|
+
}
|
|
9
|
+
export declare const DdbUpdateModel: typeof DdbUpdateModelImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js").IUpdateModelStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { UpdateModelStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/model/UpdateModelStorageOperation.js";
|
|
3
|
+
import { CmsDdbModelEntity } from "../../abstractions/CmsDdbModelEntity.js";
|
|
4
|
+
import { createKeys, createType } from "./keys.js";
|
|
5
|
+
class DdbUpdateModelImpl {
|
|
6
|
+
constructor(entity){
|
|
7
|
+
this.entity = entity;
|
|
8
|
+
}
|
|
9
|
+
async execute(params) {
|
|
10
|
+
const { model } = params;
|
|
11
|
+
const keys = createKeys(model);
|
|
12
|
+
try {
|
|
13
|
+
await this.entity.put({
|
|
14
|
+
data: model,
|
|
15
|
+
...keys,
|
|
16
|
+
TYPE: createType()
|
|
17
|
+
});
|
|
18
|
+
return model;
|
|
19
|
+
} catch (ex) {
|
|
20
|
+
throw new error(ex.message || "Could not update model.", ex.code || "MODEL_UPDATE_ERROR", {
|
|
21
|
+
error: ex,
|
|
22
|
+
model,
|
|
23
|
+
keys
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const DdbUpdateModel = UpdateModelStorageOperation.createImplementation({
|
|
29
|
+
implementation: DdbUpdateModelImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
CmsDdbModelEntity
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
export { DdbUpdateModel };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=DdbUpdateModel.js.map
|
|
@@ -0,0 +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":";;;;AAMA,MAAMA;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAME,OAAOC,WAAWF;QACxB,IAAI;YACA,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBAClB,MAAMA;gBACN,GAAGC,IAAI;gBACP,MAAME;YACV;YACA,OAAOH;QACX,EAAE,OAAOI,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,sBACX;gBAAE,OAAOA;gBAAIJ;gBAAOC;YAAK;QAEjC;IACJ;AACJ;AAEO,MAAMK,iBAAiBC,4BAA4B,oBAAoB,CAAC;IAC3E,gBAAgBV;IAChB,cAAc;QAACW;KAAkB;AACrC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
+
import { DdbGetModel } from "./DdbGetModel.js";
|
|
3
|
+
import { DdbListModels } from "./DdbListModels.js";
|
|
4
|
+
import { DdbCreateModel } from "./DdbCreateModel.js";
|
|
5
|
+
import { DdbUpdateModel } from "./DdbUpdateModel.js";
|
|
6
|
+
import { DdbDeleteModel } from "./DdbDeleteModel.js";
|
|
7
|
+
const DdbModelStorageOpsFeature = createFeature({
|
|
8
|
+
name: "cms.ddb.modelStorageOps",
|
|
9
|
+
register: (container)=>{
|
|
10
|
+
container.register(DdbGetModel);
|
|
11
|
+
container.register(DdbListModels);
|
|
12
|
+
container.register(DdbCreateModel);
|
|
13
|
+
container.register(DdbUpdateModel);
|
|
14
|
+
container.register(DdbDeleteModel);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export { DdbModelStorageOpsFeature };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/feature.js","sources":["../../../src/operations/model/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { DdbGetModel } from \"./DdbGetModel.js\";\nimport { DdbListModels } from \"./DdbListModels.js\";\nimport { DdbCreateModel } from \"./DdbCreateModel.js\";\nimport { DdbUpdateModel } from \"./DdbUpdateModel.js\";\nimport { DdbDeleteModel } from \"./DdbDeleteModel.js\";\n\nexport const DdbModelStorageOpsFeature = createFeature({\n name: \"cms.ddb.modelStorageOps\",\n register: container => {\n container.register(DdbGetModel);\n container.register(DdbListModels);\n container.register(DdbCreateModel);\n container.register(DdbUpdateModel);\n container.register(DdbDeleteModel);\n }\n});\n"],"names":["DdbModelStorageOpsFeature","createFeature","container","DdbGetModel","DdbListModels","DdbCreateModel","DdbUpdateModel","DdbDeleteModel"],"mappings":";;;;;;AAOO,MAAMA,4BAA4BC,cAAc;IACnD,MAAM;IACN,UAAUC,CAAAA;QACNA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;IACvB;AACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface PartitionKeysParams {
|
|
2
|
+
tenant: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const createPartitionKey: (params: PartitionKeysParams) => string;
|
|
5
|
+
interface SortKeyParams {
|
|
6
|
+
modelId: string;
|
|
7
|
+
}
|
|
8
|
+
interface Keys {
|
|
9
|
+
PK: string;
|
|
10
|
+
SK: string;
|
|
11
|
+
GSI_TENANT: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const createKeys: (params: PartitionKeysParams & SortKeyParams) => Keys;
|
|
14
|
+
export declare const createType: () => string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
const createPartitionKey = (params)=>{
|
|
3
|
+
const { tenant } = params;
|
|
4
|
+
if (!tenant) throw new error("Missing tenant variable when creating model partitionKey.");
|
|
5
|
+
return `T#${tenant}#CMS#CM`;
|
|
6
|
+
};
|
|
7
|
+
const createSortKey = (params)=>params.modelId;
|
|
8
|
+
const createKeys = (params)=>({
|
|
9
|
+
PK: createPartitionKey(params),
|
|
10
|
+
SK: createSortKey(params),
|
|
11
|
+
GSI_TENANT: params.tenant
|
|
12
|
+
});
|
|
13
|
+
const createType = ()=>"cms.model";
|
|
14
|
+
export { createKeys, createPartitionKey, createType };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/keys.js","sources":["../../../src/operations/model/keys.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\ninterface PartitionKeysParams {\n tenant: string;\n}\n\nexport const 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}\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}\n\nexport const createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params),\n GSI_TENANT: params.tenant\n };\n};\n\nexport const createType = (): string => {\n return \"cms.model\";\n};\n"],"names":["createPartitionKey","params","tenant","WebinyError","createSortKey","createKeys","createType"],"mappings":";AAMO,MAAMA,qBAAqB,CAACC;IAC/B,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,IAAI,CAACC,QACD,MAAM,IAAIC,MAAY;IAE1B,OAAO,CAAC,EAAE,EAAED,OAAO,OAAO,CAAC;AAC/B;AAMA,MAAME,gBAAgB,CAACH,SACZA,OAAO,OAAO;AASlB,MAAMI,aAAa,CAACJ,SAChB;QACH,IAAID,mBAAmBC;QACvB,IAAIG,cAAcH;QAClB,YAAYA,OAAO,MAAM;IAC7B;AAGG,MAAMK,aAAa,IACf"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb",
|
|
3
|
-
"version": "0.0.0-
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.0156a4c312",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
5
9
|
"keywords": [
|
|
6
10
|
"@webiny/api-headless-cms",
|
|
7
11
|
"storage-operations",
|
|
8
12
|
"dynamodb",
|
|
13
|
+
"ddb",
|
|
9
14
|
"cms:ddb"
|
|
10
15
|
],
|
|
11
16
|
"repository": {
|
|
@@ -21,41 +26,32 @@
|
|
|
21
26
|
],
|
|
22
27
|
"license": "MIT",
|
|
23
28
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@webiny/api-headless-cms": "0.0.0-
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/utils": "0.0.0-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"lodash.sortby": "4.7.0"
|
|
29
|
+
"@webiny/api": "0.0.0-unstable.0156a4c312",
|
|
30
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.0156a4c312",
|
|
31
|
+
"@webiny/api-headless-cms-storage": "0.0.0-unstable.0156a4c312",
|
|
32
|
+
"@webiny/aws-sdk": "0.0.0-unstable.0156a4c312",
|
|
33
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.0156a4c312",
|
|
34
|
+
"@webiny/db-utils": "0.0.0-unstable.0156a4c312",
|
|
35
|
+
"@webiny/error": "0.0.0-unstable.0156a4c312",
|
|
36
|
+
"@webiny/feature": "0.0.0-unstable.0156a4c312",
|
|
37
|
+
"@webiny/handler": "0.0.0-unstable.0156a4c312",
|
|
38
|
+
"@webiny/utils": "0.0.0-unstable.0156a4c312",
|
|
39
|
+
"dataloader": "2.2.3"
|
|
36
40
|
},
|
|
37
41
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"@webiny/project-utils": "^0.0.0-mt-2",
|
|
46
|
-
"jest": "^26.6.3",
|
|
47
|
-
"jest-dynalite": "^3.2.0",
|
|
48
|
-
"jest-environment-node": "^26.6.2",
|
|
49
|
-
"ttypescript": "^1.5.12",
|
|
50
|
-
"typescript": "^4.1.3"
|
|
42
|
+
"@types/jsonpack": "1.1.6",
|
|
43
|
+
"@webiny/api-core": "0.0.0-unstable.0156a4c312",
|
|
44
|
+
"@webiny/build-tools": "0.0.0-unstable.0156a4c312",
|
|
45
|
+
"@webiny/di": "2.0.0",
|
|
46
|
+
"jest-dynalite": "3.6.1",
|
|
47
|
+
"typescript": "7.0.2",
|
|
48
|
+
"vitest": "5.0.5"
|
|
51
49
|
},
|
|
52
50
|
"publishConfig": {
|
|
53
|
-
"access": "public"
|
|
54
|
-
"directory": "dist"
|
|
55
|
-
},
|
|
56
|
-
"scripts": {
|
|
57
|
-
"build": "yarn webiny run build",
|
|
58
|
-
"watch": "yarn webiny run watch"
|
|
51
|
+
"access": "public"
|
|
59
52
|
},
|
|
60
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae",
|
|
54
|
+
"webiny": {
|
|
55
|
+
"publishFrom": "dist"
|
|
56
|
+
}
|
|
61
57
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,84 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CmsModelField, CmsModelFieldToGraphQLPlugin, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
3
|
-
import { DynamoDBTypes, TableConstructor } from "dynamodb-toolbox/dist/classes/Table";
|
|
4
|
-
import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
|
|
5
|
-
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
6
|
-
import { Entity, Table } from "dynamodb-toolbox";
|
|
7
|
-
interface CmsFieldFilterValueTransformParams {
|
|
8
|
-
/**
|
|
9
|
-
* A field which value we are transforming.
|
|
10
|
-
*/
|
|
11
|
-
field: CmsModelField;
|
|
12
|
-
value: any;
|
|
13
|
-
}
|
|
14
|
-
export interface CmsFieldFilterValueTransformPlugin extends Plugin {
|
|
15
|
-
/**
|
|
16
|
-
* A plugin type.
|
|
17
|
-
*/
|
|
18
|
-
type: "cms-field-filter-value-transform";
|
|
19
|
-
/**
|
|
20
|
-
* A field type this plugin is for.
|
|
21
|
-
*/
|
|
22
|
-
fieldType: string;
|
|
23
|
-
/**
|
|
24
|
-
* Transform method which expect field definition and value to transform.
|
|
25
|
-
*/
|
|
26
|
-
transform: (params: CmsFieldFilterValueTransformParams) => any;
|
|
27
|
-
}
|
|
28
|
-
interface CmsFieldFilterPathParams {
|
|
29
|
-
/**
|
|
30
|
-
* A field for which we are creating the value path.
|
|
31
|
-
*/
|
|
32
|
-
field: CmsModelField;
|
|
33
|
-
/**
|
|
34
|
-
* If value is an array we will need index position.
|
|
35
|
-
* It is up to the developer to add.
|
|
36
|
-
*/
|
|
37
|
-
index?: number | string;
|
|
38
|
-
}
|
|
39
|
-
export interface CmsFieldFilterPathPlugin extends Plugin {
|
|
40
|
-
/**
|
|
41
|
-
* A plugin type.
|
|
42
|
-
*/
|
|
43
|
-
type: "cms-field-filter-path";
|
|
44
|
-
/**
|
|
45
|
-
* A field type this plugin is for.
|
|
46
|
-
*/
|
|
47
|
-
fieldType: string;
|
|
48
|
-
/**
|
|
49
|
-
* A field id this plugin is for.
|
|
50
|
-
* It is meant for targeting only specific fields in a certain type.
|
|
51
|
-
*/
|
|
52
|
-
fieldId?: string[];
|
|
53
|
-
/**
|
|
54
|
-
* Get a path for given field.
|
|
55
|
-
*/
|
|
56
|
-
createPath: (params: CmsFieldFilterPathParams) => string;
|
|
57
|
-
}
|
|
58
|
-
export declare type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;
|
|
59
|
-
export declare type Attributes = Record<string, AttributeDefinition>;
|
|
1
|
+
import type { CmsEntryValues, CmsModel, CmsStorageEntry } from "@webiny/api-headless-cms/types/index.js";
|
|
60
2
|
export declare enum ENTITIES {
|
|
61
|
-
SYSTEM = "CmsSystem",
|
|
62
|
-
SETTINGS = "CmsSettings",
|
|
63
3
|
GROUPS = "CmsGroups",
|
|
64
4
|
MODELS = "CmsModels",
|
|
65
5
|
ENTRIES = "CmsEntries"
|
|
66
6
|
}
|
|
67
|
-
export interface
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
export interface StorageOperationsFactoryParams {
|
|
71
|
-
documentClient: DocumentClient;
|
|
72
|
-
table?: TableModifier;
|
|
73
|
-
modelFieldToGraphQLPlugins: CmsModelFieldToGraphQLPlugin[];
|
|
74
|
-
attributes?: Record<ENTITIES, Attributes>;
|
|
75
|
-
plugins?: Plugin[] | Plugin[][];
|
|
7
|
+
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
8
|
+
tenant: string;
|
|
76
9
|
}
|
|
77
|
-
export interface
|
|
78
|
-
|
|
79
|
-
|
|
10
|
+
export interface DataLoadersHandlerDataLoaderParams {
|
|
11
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
12
|
+
ids: readonly string[];
|
|
80
13
|
}
|
|
81
|
-
export interface
|
|
82
|
-
(params:
|
|
14
|
+
export interface IDataLoadersHandler {
|
|
15
|
+
getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
16
|
+
getRevisionById<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
17
|
+
getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
18
|
+
getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
19
|
+
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
83
20
|
}
|
|
84
|
-
export {};
|
package/types.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
var types_ENTITIES = /*#__PURE__*/ function(ENTITIES) {
|
|
2
|
+
ENTITIES["GROUPS"] = "CmsGroups";
|
|
3
|
+
ENTITIES["MODELS"] = "CmsModels";
|
|
4
|
+
ENTITIES["ENTRIES"] = "CmsEntries";
|
|
5
|
+
return ENTITIES;
|
|
6
|
+
}({});
|
|
7
|
+
export { types_ENTITIES as ENTITIES };
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ENTITIES = void 0;
|
|
7
|
-
let ENTITIES;
|
|
8
|
-
exports.ENTITIES = ENTITIES;
|
|
9
|
-
|
|
10
|
-
(function (ENTITIES) {
|
|
11
|
-
ENTITIES["SYSTEM"] = "CmsSystem";
|
|
12
|
-
ENTITIES["SETTINGS"] = "CmsSettings";
|
|
13
|
-
ENTITIES["GROUPS"] = "CmsGroups";
|
|
14
|
-
ENTITIES["MODELS"] = "CmsModels";
|
|
15
|
-
ENTITIES["ENTRIES"] = "CmsEntries";
|
|
16
|
-
})(ENTITIES || (exports.ENTITIES = ENTITIES = {}));
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
package/types.js.map
ADDED
|
@@ -0,0 +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,SAARA,QAAQ;;;;WAARA"}
|
package/definitions/settings.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createSettingsEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
|
-
const createSettingsEntity = params => {
|
|
19
|
-
const {
|
|
20
|
-
entityName,
|
|
21
|
-
table,
|
|
22
|
-
attributes
|
|
23
|
-
} = params;
|
|
24
|
-
return new _dynamodbToolbox.Entity({
|
|
25
|
-
name: entityName,
|
|
26
|
-
table,
|
|
27
|
-
attributes: _objectSpread({
|
|
28
|
-
PK: {
|
|
29
|
-
partitionKey: true
|
|
30
|
-
},
|
|
31
|
-
SK: {
|
|
32
|
-
sortKey: true
|
|
33
|
-
},
|
|
34
|
-
TYPE: {
|
|
35
|
-
type: "string"
|
|
36
|
-
},
|
|
37
|
-
key: {
|
|
38
|
-
type: "string"
|
|
39
|
-
},
|
|
40
|
-
uploadMinFileSize: {
|
|
41
|
-
type: "number"
|
|
42
|
-
},
|
|
43
|
-
uploadMaxFileSize: {
|
|
44
|
-
type: "number"
|
|
45
|
-
},
|
|
46
|
-
srcPrefix: {
|
|
47
|
-
type: "string"
|
|
48
|
-
},
|
|
49
|
-
contentModelLastChange: {
|
|
50
|
-
type: "string"
|
|
51
|
-
},
|
|
52
|
-
tenant: {
|
|
53
|
-
type: "string"
|
|
54
|
-
},
|
|
55
|
-
locale: {
|
|
56
|
-
type: "string"
|
|
57
|
-
}
|
|
58
|
-
}, attributes || {})
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
exports.createSettingsEntity = createSettingsEntity;
|
package/definitions/system.d.ts
DELETED
package/definitions/system.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createSystemEntity = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
|
-
const createSystemEntity = params => {
|
|
19
|
-
const {
|
|
20
|
-
entityName,
|
|
21
|
-
attributes,
|
|
22
|
-
table
|
|
23
|
-
} = params;
|
|
24
|
-
return new _dynamodbToolbox.Entity({
|
|
25
|
-
name: entityName,
|
|
26
|
-
table,
|
|
27
|
-
attributes: _objectSpread({
|
|
28
|
-
PK: {
|
|
29
|
-
partitionKey: true
|
|
30
|
-
},
|
|
31
|
-
SK: {
|
|
32
|
-
sortKey: true
|
|
33
|
-
},
|
|
34
|
-
version: {
|
|
35
|
-
type: "string"
|
|
36
|
-
},
|
|
37
|
-
locale: {
|
|
38
|
-
type: "string"
|
|
39
|
-
},
|
|
40
|
-
tenant: {
|
|
41
|
-
type: "string"
|
|
42
|
-
},
|
|
43
|
-
readAPIKey: {
|
|
44
|
-
type: "string"
|
|
45
|
-
}
|
|
46
|
-
}, attributes || {})
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
exports.createSystemEntity = createSystemEntity;
|
package/dynamoDb/index.d.ts
DELETED
package/dynamoDb/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _richText = _interopRequireDefault(require("./storage/richText"));
|
|
11
|
-
|
|
12
|
-
var _longText = _interopRequireDefault(require("./storage/longText"));
|
|
13
|
-
|
|
14
|
-
var _date = _interopRequireDefault(require("./storage/date"));
|
|
15
|
-
|
|
16
|
-
var _plainObject = _interopRequireDefault(require("./path/plainObject"));
|
|
17
|
-
|
|
18
|
-
var _ref = _interopRequireDefault(require("./path/ref"));
|
|
19
|
-
|
|
20
|
-
var _datetime = _interopRequireDefault(require("./transformValue/datetime"));
|
|
21
|
-
|
|
22
|
-
var _default = () => [(0, _richText.default)(), (0, _longText.default)(), (0, _date.default)(), (0, _plainObject.default)(), (0, _ref.default)(), (0, _datetime.default)()];
|
|
23
|
-
|
|
24
|
-
exports.default = _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
|
-
var _default = () => ({
|
|
13
|
-
type: "cms-field-filter-path",
|
|
14
|
-
name: "cms-field-filter-path-plain-object",
|
|
15
|
-
fieldType: "plainObject",
|
|
16
|
-
createPath: ({
|
|
17
|
-
field
|
|
18
|
-
}) => {
|
|
19
|
-
const {
|
|
20
|
-
path
|
|
21
|
-
} = field.settings || {};
|
|
22
|
-
|
|
23
|
-
if (!path) {
|
|
24
|
-
throw new _error.default("Missing path settings value.", "FIELD_SETTINGS_ERROR", {
|
|
25
|
-
field
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return path;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
exports.default = _default;
|
package/dynamoDb/path/ref.d.ts
DELETED
package/dynamoDb/path/ref.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _default = () => ({
|
|
9
|
-
type: "cms-field-filter-path",
|
|
10
|
-
name: "cms-field-filter-path-ref",
|
|
11
|
-
fieldType: "ref",
|
|
12
|
-
createPath: ({
|
|
13
|
-
field,
|
|
14
|
-
index
|
|
15
|
-
}) => {
|
|
16
|
-
const paths = [field.fieldId];
|
|
17
|
-
|
|
18
|
-
if (index !== undefined) {
|
|
19
|
-
paths.push(String(index));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
paths.push("entryId");
|
|
23
|
-
return paths.join(".");
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
exports.default = _default;
|