@webiny/api-headless-cms-ddb 0.0.0-unstable.5e7233243f → 0.0.0-unstable.615a930a68
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/definitions/entry.js +3 -7
- package/definitions/entry.js.map +1 -1
- package/definitions/group.js +3 -7
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +3 -7
- package/definitions/model.js.map +1 -1
- package/definitions/settings.js +3 -7
- package/definitions/settings.js.map +1 -1
- package/definitions/system.js +3 -7
- package/definitions/system.js.map +1 -1
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/path/plainObject.js +1 -1
- package/dynamoDb/storage/date.js +14 -4
- package/dynamoDb/storage/date.js.map +1 -1
- package/dynamoDb/storage/longText.js +1 -1
- package/dynamoDb/storage/richText.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +30 -6
- package/index.js.map +1 -1
- package/operations/entry/dataLoaders.js +7 -9
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/createFields.d.ts +18 -0
- package/operations/entry/filtering/createFields.js +124 -0
- package/operations/entry/filtering/createFields.js.map +1 -0
- package/operations/entry/filtering/createFilters.d.ts +20 -0
- package/operations/entry/filtering/createFilters.js +155 -0
- package/operations/entry/filtering/createFilters.js.map +1 -0
- package/operations/entry/filtering/extractSort.d.ts +13 -0
- package/operations/entry/filtering/extractSort.js +55 -0
- package/operations/entry/filtering/extractSort.js.map +1 -0
- package/operations/entry/filtering/filter.d.ts +16 -0
- package/operations/entry/filtering/filter.js +137 -0
- package/operations/entry/filtering/filter.js.map +1 -0
- package/operations/entry/filtering/fullTextSearch.d.ts +18 -0
- package/operations/entry/filtering/fullTextSearch.js +64 -0
- package/operations/entry/filtering/fullTextSearch.js.map +1 -0
- package/operations/entry/filtering/getValue.d.ts +5 -0
- package/operations/entry/filtering/getValue.js +81 -0
- package/operations/entry/filtering/getValue.js.map +1 -0
- package/operations/entry/filtering/index.d.ts +2 -0
- package/operations/entry/filtering/index.js +21 -0
- package/operations/entry/filtering/index.js.map +1 -0
- package/operations/entry/filtering/mapPlugins.d.ts +8 -0
- package/operations/entry/filtering/mapPlugins.js +39 -0
- package/operations/entry/filtering/mapPlugins.js.map +1 -0
- package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +48 -0
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -0
- package/operations/entry/filtering/plugins/index.d.ts +1 -0
- package/operations/entry/filtering/plugins/index.js +18 -0
- package/operations/entry/filtering/plugins/index.js.map +1 -0
- package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/objectFilterCreate.js +107 -0
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -0
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/refFilterCreate.js +89 -0
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -0
- package/operations/entry/filtering/sort.d.ts +9 -0
- package/operations/entry/filtering/sort.js +80 -0
- package/operations/entry/filtering/sort.js.map +1 -0
- package/operations/entry/filtering/systemFields.d.ts +4 -0
- package/operations/entry/filtering/systemFields.js +72 -0
- package/operations/entry/filtering/systemFields.js.map +1 -0
- package/operations/entry/filtering/transform.d.ts +6 -0
- package/operations/entry/filtering/transform.js +19 -0
- package/operations/entry/filtering/transform.js.map +1 -0
- package/operations/entry/filtering/types.d.ts +40 -0
- package/operations/entry/filtering/types.js +5 -0
- package/operations/entry/filtering/types.js.map +1 -0
- package/operations/entry/filtering/where.d.ts +5 -0
- package/operations/entry/filtering/where.js +38 -0
- package/operations/entry/filtering/where.js.map +1 -0
- package/operations/entry/index.js +30 -155
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +1 -1
- package/operations/entry/systemFields.js +6 -0
- package/operations/entry/systemFields.js.map +1 -1
- package/operations/group/index.js +6 -10
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.js +4 -8
- package/operations/model/index.js.map +1 -1
- package/operations/settings/index.js +6 -10
- package/operations/settings/index.js.map +1 -1
- package/operations/system/index.js +4 -8
- package/operations/system/index.js.map +1 -1
- package/package.json +15 -16
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +2 -2
- package/plugins/CmsEntryFieldFilterPathPlugin.js +1 -1
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +43 -0
- package/plugins/CmsEntryFieldFilterPlugin.js +31 -0
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -0
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +18 -0
- package/plugins/index.js.map +1 -0
- package/types.d.ts +1 -1
- package/types.js.map +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.createEntriesStorageOperations = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
11
|
|
|
12
12
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
13
|
|
|
@@ -15,8 +15,6 @@ var _dataLoaders = require("./dataLoaders");
|
|
|
15
15
|
|
|
16
16
|
var _types = require("@webiny/api-headless-cms/types");
|
|
17
17
|
|
|
18
|
-
var _utils = require("./utils");
|
|
19
|
-
|
|
20
18
|
var _keys = require("./keys");
|
|
21
19
|
|
|
22
20
|
var _batchWrite = require("@webiny/db-dynamodb/utils/batchWrite");
|
|
@@ -31,9 +29,9 @@ var _zeroPad = require("@webiny/utils/zeroPad");
|
|
|
31
29
|
|
|
32
30
|
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
var _createFields = require("./filtering/createFields");
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
var _filtering = require("./filtering");
|
|
37
35
|
|
|
38
36
|
const createType = () => {
|
|
39
37
|
return "cms.entry";
|
|
@@ -56,7 +54,7 @@ const convertToStorageEntry = params => {
|
|
|
56
54
|
fields: model.fields,
|
|
57
55
|
values: storageEntry.values
|
|
58
56
|
});
|
|
59
|
-
return
|
|
57
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
60
58
|
values
|
|
61
59
|
});
|
|
62
60
|
};
|
|
@@ -70,7 +68,7 @@ const convertFromStorageEntry = params => {
|
|
|
70
68
|
fields: model.fields,
|
|
71
69
|
values: storageEntry.values
|
|
72
70
|
});
|
|
73
|
-
return
|
|
71
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
74
72
|
values
|
|
75
73
|
});
|
|
76
74
|
};
|
|
@@ -132,14 +130,14 @@ const createEntriesStorageOperations = params => {
|
|
|
132
130
|
* - create new or update latest entry item
|
|
133
131
|
*/
|
|
134
132
|
|
|
135
|
-
const items = [entity.putBatch(
|
|
133
|
+
const items = [entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
136
134
|
locked,
|
|
137
135
|
PK: partitionKey,
|
|
138
136
|
SK: (0, _keys.createRevisionSortKey)(entry),
|
|
139
137
|
TYPE: createType(),
|
|
140
138
|
GSI1_PK: (0, _keys.createGSIPartitionKey)(model, "A"),
|
|
141
139
|
GSI1_SK: (0, _keys.createGSISortKey)(storageEntry)
|
|
142
|
-
})), entity.putBatch(
|
|
140
|
+
})), entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
143
141
|
locked,
|
|
144
142
|
PK: partitionKey,
|
|
145
143
|
SK: (0, _keys.createLatestSortKey)(),
|
|
@@ -152,7 +150,7 @@ const createEntriesStorageOperations = params => {
|
|
|
152
150
|
*/
|
|
153
151
|
|
|
154
152
|
if (isPublished) {
|
|
155
|
-
items.push(entity.putBatch(
|
|
153
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
156
154
|
locked,
|
|
157
155
|
PK: partitionKey,
|
|
158
156
|
SK: (0, _keys.createPublishedSortKey)(),
|
|
@@ -200,13 +198,13 @@ const createEntriesStorageOperations = params => {
|
|
|
200
198
|
* - update the last entry item to a current one
|
|
201
199
|
*/
|
|
202
200
|
|
|
203
|
-
const items = [entity.putBatch(
|
|
201
|
+
const items = [entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
204
202
|
PK: partitionKey,
|
|
205
203
|
SK: (0, _keys.createRevisionSortKey)(storageEntry),
|
|
206
204
|
TYPE: createType(),
|
|
207
205
|
GSI1_PK: (0, _keys.createGSIPartitionKey)(model, "A"),
|
|
208
206
|
GSI1_SK: (0, _keys.createGSISortKey)(storageEntry)
|
|
209
|
-
})), entity.putBatch(
|
|
207
|
+
})), entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
210
208
|
PK: partitionKey,
|
|
211
209
|
SK: (0, _keys.createLatestSortKey)(),
|
|
212
210
|
TYPE: createLatestType(),
|
|
@@ -260,7 +258,7 @@ const createEntriesStorageOperations = params => {
|
|
|
260
258
|
* - update the latest entry if the current entry is the latest one
|
|
261
259
|
*/
|
|
262
260
|
|
|
263
|
-
items.push(entity.putBatch(
|
|
261
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
264
262
|
locked,
|
|
265
263
|
PK: partitionKey,
|
|
266
264
|
SK: (0, _keys.createRevisionSortKey)(storageEntry),
|
|
@@ -270,7 +268,7 @@ const createEntriesStorageOperations = params => {
|
|
|
270
268
|
})));
|
|
271
269
|
|
|
272
270
|
if (isPublished) {
|
|
273
|
-
items.push(entity.putBatch(
|
|
271
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
274
272
|
locked,
|
|
275
273
|
PK: partitionKey,
|
|
276
274
|
SK: (0, _keys.createPublishedSortKey)(),
|
|
@@ -287,7 +285,7 @@ const createEntriesStorageOperations = params => {
|
|
|
287
285
|
const latestStorageEntry = await getLatestRevisionByEntryId(model, entry);
|
|
288
286
|
|
|
289
287
|
if (latestStorageEntry && latestStorageEntry.id === entry.id) {
|
|
290
|
-
items.push(entity.putBatch(
|
|
288
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
291
289
|
locked,
|
|
292
290
|
PK: partitionKey,
|
|
293
291
|
SK: (0, _keys.createLatestSortKey)(),
|
|
@@ -397,7 +395,7 @@ const createEntriesStorageOperations = params => {
|
|
|
397
395
|
storageEntry: initialLatestStorageEntry,
|
|
398
396
|
model
|
|
399
397
|
});
|
|
400
|
-
items.push(entity.putBatch(
|
|
398
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, latestStorageEntry), {}, {
|
|
401
399
|
PK: partitionKey,
|
|
402
400
|
SK: (0, _keys.createLatestSortKey)(),
|
|
403
401
|
TYPE: createLatestType(),
|
|
@@ -568,7 +566,7 @@ const createEntriesStorageOperations = params => {
|
|
|
568
566
|
model
|
|
569
567
|
});
|
|
570
568
|
} catch (ex) {
|
|
571
|
-
throw new _error.default(ex.message || "Could not get previous version of given entry.", ex.code || "GET_PREVIOUS_VERSION_ERROR",
|
|
569
|
+
throw new _error.default(ex.message || "Could not get previous version of given entry.", ex.code || "GET_PREVIOUS_VERSION_ERROR", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
572
570
|
error: ex,
|
|
573
571
|
partitionKey: queryParams.partitionKey,
|
|
574
572
|
options: queryParams.options,
|
|
@@ -582,7 +580,7 @@ const createEntriesStorageOperations = params => {
|
|
|
582
580
|
limit: initialLimit = 10,
|
|
583
581
|
where: initialWhere,
|
|
584
582
|
after,
|
|
585
|
-
sort,
|
|
583
|
+
sort: sortBy,
|
|
586
584
|
fields,
|
|
587
585
|
search
|
|
588
586
|
} = params;
|
|
@@ -617,16 +615,15 @@ const createEntriesStorageOperations = params => {
|
|
|
617
615
|
};
|
|
618
616
|
}
|
|
619
617
|
|
|
620
|
-
const where =
|
|
621
|
-
|
|
618
|
+
const where = (0, _objectSpread2.default)({}, initialWhere);
|
|
622
619
|
delete where["published"];
|
|
623
620
|
delete where["latest"];
|
|
624
621
|
/**
|
|
625
|
-
* We need
|
|
622
|
+
* We need an object containing field, transformers and paths.
|
|
626
623
|
* Just build it here and pass on into other methods that require it to avoid mapping multiple times.
|
|
627
624
|
*/
|
|
628
625
|
|
|
629
|
-
const modelFields = (0,
|
|
626
|
+
const modelFields = (0, _createFields.createFields)({
|
|
630
627
|
plugins,
|
|
631
628
|
model
|
|
632
629
|
});
|
|
@@ -635,7 +632,7 @@ const createEntriesStorageOperations = params => {
|
|
|
635
632
|
* It will build the filters out of the where input and transform the values it is using.
|
|
636
633
|
*/
|
|
637
634
|
|
|
638
|
-
const filteredItems = await (0,
|
|
635
|
+
const filteredItems = await (0, _filtering.filter)({
|
|
639
636
|
items: records.map(record => {
|
|
640
637
|
return convertFromStorageEntry({
|
|
641
638
|
storageEntry: record,
|
|
@@ -657,9 +654,9 @@ const createEntriesStorageOperations = params => {
|
|
|
657
654
|
* It takes the sort input and sorts by it via the lodash sortBy method.
|
|
658
655
|
*/
|
|
659
656
|
|
|
660
|
-
const sortedItems = (0,
|
|
657
|
+
const sortedItems = (0, _filtering.sort)({
|
|
661
658
|
items: filteredItems,
|
|
662
|
-
sort,
|
|
659
|
+
sort: sortBy,
|
|
663
660
|
fields: modelFields
|
|
664
661
|
});
|
|
665
662
|
const start = parseInt((0, _cursor.decodeCursor)(after) || "0") || 0;
|
|
@@ -683,132 +680,12 @@ const createEntriesStorageOperations = params => {
|
|
|
683
680
|
const get = async (model, params) => {
|
|
684
681
|
const {
|
|
685
682
|
items
|
|
686
|
-
} = await list(model,
|
|
683
|
+
} = await list(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
687
684
|
limit: 1
|
|
688
685
|
}));
|
|
689
686
|
return items.shift() || null;
|
|
690
687
|
};
|
|
691
688
|
|
|
692
|
-
const requestChanges = async (model, params) => {
|
|
693
|
-
const {
|
|
694
|
-
entry,
|
|
695
|
-
storageEntry: initialStorageEntry
|
|
696
|
-
} = params;
|
|
697
|
-
const partitionKey = (0, _keys.createPartitionKey)({
|
|
698
|
-
id: entry.id,
|
|
699
|
-
locale: model.locale,
|
|
700
|
-
tenant: model.tenant
|
|
701
|
-
});
|
|
702
|
-
const storageEntry = convertToStorageEntry({
|
|
703
|
-
storageEntry: initialStorageEntry,
|
|
704
|
-
model
|
|
705
|
-
});
|
|
706
|
-
/**
|
|
707
|
-
* We need to:
|
|
708
|
-
* - update the existing entry
|
|
709
|
-
* - update latest version - if existing entry is the latest version
|
|
710
|
-
*/
|
|
711
|
-
|
|
712
|
-
const items = [entity.putBatch(_objectSpread(_objectSpread({}, storageEntry), {}, {
|
|
713
|
-
TYPE: createType(),
|
|
714
|
-
PK: partitionKey,
|
|
715
|
-
SK: (0, _keys.createRevisionSortKey)(entry),
|
|
716
|
-
GSI1_PK: (0, _keys.createGSIPartitionKey)(model, "A"),
|
|
717
|
-
GSI1_SK: (0, _keys.createGSISortKey)(entry)
|
|
718
|
-
}))];
|
|
719
|
-
/**
|
|
720
|
-
* We need the latest entry to see if something needs to be updated along side the request changes one.
|
|
721
|
-
*/
|
|
722
|
-
|
|
723
|
-
const latestStorageEntry = await getLatestRevisionByEntryId(model, entry);
|
|
724
|
-
|
|
725
|
-
if (latestStorageEntry && latestStorageEntry.id === entry.id) {
|
|
726
|
-
items.push(entity.putBatch(_objectSpread(_objectSpread({}, storageEntry), {}, {
|
|
727
|
-
PK: partitionKey,
|
|
728
|
-
SK: (0, _keys.createLatestSortKey)(),
|
|
729
|
-
TYPE: createLatestType(),
|
|
730
|
-
GSI1_PK: (0, _keys.createGSIPartitionKey)(model, "L"),
|
|
731
|
-
GSI1_SK: (0, _keys.createGSISortKey)(entry)
|
|
732
|
-
})));
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
try {
|
|
736
|
-
await (0, _batchWrite.batchWriteAll)({
|
|
737
|
-
table: entity.table,
|
|
738
|
-
items
|
|
739
|
-
});
|
|
740
|
-
dataLoaders.clearAll({
|
|
741
|
-
model
|
|
742
|
-
});
|
|
743
|
-
} catch (ex) {
|
|
744
|
-
throw new _error.default(ex.message || "Could not execute the request changes batch.", ex.code || "REQUEST_CHANGES_ERROR", {
|
|
745
|
-
entry
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
return entry;
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
const requestReview = async (model, params) => {
|
|
753
|
-
const {
|
|
754
|
-
entry,
|
|
755
|
-
storageEntry: initialStorageEntry
|
|
756
|
-
} = params;
|
|
757
|
-
const partitionKey = (0, _keys.createPartitionKey)({
|
|
758
|
-
id: entry.id,
|
|
759
|
-
locale: model.locale,
|
|
760
|
-
tenant: model.tenant
|
|
761
|
-
});
|
|
762
|
-
const storageEntry = convertToStorageEntry({
|
|
763
|
-
storageEntry: initialStorageEntry,
|
|
764
|
-
model
|
|
765
|
-
});
|
|
766
|
-
/**
|
|
767
|
-
* We need to:
|
|
768
|
-
* - update existing entry
|
|
769
|
-
* - update latest entry - if existing entry is the latest entry
|
|
770
|
-
*/
|
|
771
|
-
|
|
772
|
-
const items = [entity.putBatch(_objectSpread(_objectSpread({}, storageEntry), {}, {
|
|
773
|
-
TYPE: createType(),
|
|
774
|
-
PK: partitionKey,
|
|
775
|
-
SK: (0, _keys.createRevisionSortKey)(entry),
|
|
776
|
-
GSI1_PK: (0, _keys.createGSIPartitionKey)(model, "A"),
|
|
777
|
-
GSI1_SK: (0, _keys.createGSISortKey)(entry)
|
|
778
|
-
}))];
|
|
779
|
-
/**
|
|
780
|
-
* We need the latest entry to see if something needs to be updated along side the request review one.
|
|
781
|
-
*/
|
|
782
|
-
|
|
783
|
-
const latestStorageEntry = await getLatestRevisionByEntryId(model, entry);
|
|
784
|
-
|
|
785
|
-
if (latestStorageEntry && latestStorageEntry.id === entry.id) {
|
|
786
|
-
items.push(entity.putBatch(_objectSpread(_objectSpread({}, storageEntry), {}, {
|
|
787
|
-
PK: partitionKey,
|
|
788
|
-
SK: (0, _keys.createLatestSortKey)(),
|
|
789
|
-
TYPE: createLatestType(),
|
|
790
|
-
GSI1_PK: (0, _keys.createGSIPartitionKey)(model, "L"),
|
|
791
|
-
GSI1_SK: (0, _keys.createGSISortKey)(entry)
|
|
792
|
-
})));
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
try {
|
|
796
|
-
await (0, _batchWrite.batchWriteAll)({
|
|
797
|
-
table: entity.table,
|
|
798
|
-
items
|
|
799
|
-
});
|
|
800
|
-
dataLoaders.clearAll({
|
|
801
|
-
model
|
|
802
|
-
});
|
|
803
|
-
return initialStorageEntry;
|
|
804
|
-
} catch (ex) {
|
|
805
|
-
throw new _error.default(ex.message || "Could not execute request review batch.", ex.code || "REQUEST_REVIEW_ERROR", {
|
|
806
|
-
entry,
|
|
807
|
-
storageEntry
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
};
|
|
811
|
-
|
|
812
689
|
const publish = async (model, params) => {
|
|
813
690
|
const {
|
|
814
691
|
entry,
|
|
@@ -837,13 +714,13 @@ const createEntriesStorageOperations = params => {
|
|
|
837
714
|
* - previous published entry to unpublished status - if any previously published entry
|
|
838
715
|
*/
|
|
839
716
|
|
|
840
|
-
const items = [entity.putBatch(
|
|
717
|
+
const items = [entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
841
718
|
PK: partitionKey,
|
|
842
719
|
SK: (0, _keys.createRevisionSortKey)(entry),
|
|
843
720
|
TYPE: createType(),
|
|
844
721
|
GSI1_PK: (0, _keys.createGSIPartitionKey)(model, "A"),
|
|
845
722
|
GSI1_SK: (0, _keys.createGSISortKey)(entry)
|
|
846
|
-
})), entity.putBatch(
|
|
723
|
+
})), entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
847
724
|
PK: partitionKey,
|
|
848
725
|
SK: (0, _keys.createPublishedSortKey)(),
|
|
849
726
|
TYPE: createPublishedType(),
|
|
@@ -852,7 +729,7 @@ const createEntriesStorageOperations = params => {
|
|
|
852
729
|
}))];
|
|
853
730
|
|
|
854
731
|
if (initialLatestStorageEntry && entry.id === initialLatestStorageEntry.id) {
|
|
855
|
-
items.push(entity.putBatch(
|
|
732
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
856
733
|
PK: partitionKey,
|
|
857
734
|
SK: (0, _keys.createLatestSortKey)(),
|
|
858
735
|
TYPE: createLatestType(),
|
|
@@ -866,7 +743,7 @@ const createEntriesStorageOperations = params => {
|
|
|
866
743
|
storageEntry: initialPublishedStorageEntry,
|
|
867
744
|
model
|
|
868
745
|
});
|
|
869
|
-
items.push(entity.putBatch(
|
|
746
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, publishedStorageEntry), {}, {
|
|
870
747
|
PK: partitionKey,
|
|
871
748
|
SK: (0, _keys.createRevisionSortKey)(publishedStorageEntry),
|
|
872
749
|
TYPE: createType(),
|
|
@@ -918,7 +795,7 @@ const createEntriesStorageOperations = params => {
|
|
|
918
795
|
const items = [entity.deleteBatch({
|
|
919
796
|
PK: partitionKey,
|
|
920
797
|
SK: (0, _keys.createPublishedSortKey)()
|
|
921
|
-
}), entity.putBatch(
|
|
798
|
+
}), entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
922
799
|
PK: partitionKey,
|
|
923
800
|
SK: (0, _keys.createRevisionSortKey)(entry),
|
|
924
801
|
TYPE: createType(),
|
|
@@ -932,7 +809,7 @@ const createEntriesStorageOperations = params => {
|
|
|
932
809
|
const latestStorageEntry = await getLatestRevisionByEntryId(model, entry);
|
|
933
810
|
|
|
934
811
|
if (latestStorageEntry && entry.id === latestStorageEntry.id) {
|
|
935
|
-
items.push(entity.putBatch(
|
|
812
|
+
items.push(entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
936
813
|
PK: partitionKey,
|
|
937
814
|
SK: (0, _keys.createLatestSortKey)(),
|
|
938
815
|
TYPE: createLatestType(),
|
|
@@ -973,8 +850,6 @@ const createEntriesStorageOperations = params => {
|
|
|
973
850
|
getLatestRevisionByEntryId,
|
|
974
851
|
get,
|
|
975
852
|
getRevisions,
|
|
976
|
-
requestChanges,
|
|
977
|
-
requestReview,
|
|
978
853
|
publish,
|
|
979
854
|
list,
|
|
980
855
|
unpublish
|