@webiny/api-headless-cms-ddb 5.17.4 → 5.18.0-beta.3
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.d.ts +6 -4
- package/definitions/entry.js +19 -8
- package/definitions/group.d.ts +8 -0
- package/definitions/group.js +74 -0
- package/definitions/model.d.ts +8 -0
- package/definitions/model.js +96 -0
- package/definitions/settings.d.ts +8 -0
- package/definitions/settings.js +62 -0
- package/definitions/system.d.ts +8 -0
- package/definitions/system.js +50 -0
- package/definitions/table.d.ts +6 -12
- package/definitions/table.js +15 -15
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/index.js +4 -3
- package/dynamoDb/path/plainObject.js +1 -2
- package/dynamoDb/path/ref.js +1 -2
- package/dynamoDb/storage/date.d.ts +2 -2
- package/dynamoDb/storage/date.js +17 -21
- package/dynamoDb/storage/longText.d.ts +7 -0
- package/dynamoDb/storage/longText.js +83 -0
- package/dynamoDb/storage/richText.d.ts +2 -2
- package/dynamoDb/storage/richText.js +69 -67
- package/dynamoDb/transformValue/datetime.d.ts +1 -1
- package/dynamoDb/transformValue/datetime.js +1 -2
- package/index.d.ts +2 -6
- package/index.js +108 -13
- package/operations/entry/dataLoaders.d.ts +34 -19
- package/operations/entry/dataLoaders.js +158 -138
- package/operations/entry/index.d.ts +8 -4
- package/operations/entry/index.js +812 -16
- package/operations/entry/keys.d.ts +25 -0
- package/operations/entry/keys.js +62 -0
- package/operations/entry/systemFields.d.ts +2 -2
- package/operations/entry/systemFields.js +1 -2
- package/operations/entry/utils.d.ts +13 -9
- package/operations/entry/utils.js +62 -18
- package/operations/group/index.d.ts +8 -0
- package/operations/group/index.js +198 -0
- package/operations/model/index.d.ts +6 -3
- package/operations/model/index.js +153 -18
- package/operations/settings/index.d.ts +6 -3
- package/operations/settings/index.js +132 -16
- package/operations/system/index.d.ts +6 -3
- package/operations/system/index.js +94 -14
- package/package.json +11 -11
- package/types.d.ts +38 -8
- package/types.js +11 -1
- package/configurations.d.ts +0 -18
- package/configurations.js +0 -24
- package/configurations.js.map +0 -1
- package/definitions/entry.js.map +0 -1
- package/definitions/table.js.map +0 -1
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/path/plainObject.js.map +0 -1
- package/dynamoDb/path/ref.js.map +0 -1
- package/dynamoDb/storage/date.js.map +0 -1
- package/dynamoDb/storage/richText.js.map +0 -1
- package/dynamoDb/transformValue/datetime.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/CmsContentEntryDynamo.d.ts +0 -86
- package/operations/entry/CmsContentEntryDynamo.js +0 -972
- package/operations/entry/CmsContentEntryDynamo.js.map +0 -1
- package/operations/entry/dataLoaders.js.map +0 -1
- package/operations/entry/index.js.map +0 -1
- package/operations/entry/systemFields.js.map +0 -1
- package/operations/entry/utils.js.map +0 -1
- package/operations/helpers.d.ts +0 -5
- package/operations/helpers.js +0 -96
- package/operations/helpers.js.map +0 -1
- package/operations/model/CmsContentModelDynamo.d.ts +0 -18
- package/operations/model/CmsContentModelDynamo.js +0 -234
- package/operations/model/CmsContentModelDynamo.js.map +0 -1
- package/operations/model/index.js.map +0 -1
- package/operations/modelGroup/CmsContentModelGroupDynamo.d.ts +0 -42
- package/operations/modelGroup/CmsContentModelGroupDynamo.js +0 -230
- package/operations/modelGroup/CmsContentModelGroupDynamo.js.map +0 -1
- package/operations/modelGroup/index.d.ts +0 -3
- package/operations/modelGroup/index.js +0 -26
- package/operations/modelGroup/index.js.map +0 -1
- package/operations/settings/CmsSettingsDynamo.d.ts +0 -16
- package/operations/settings/CmsSettingsDynamo.js +0 -145
- package/operations/settings/CmsSettingsDynamo.js.map +0 -1
- package/operations/settings/index.js.map +0 -1
- package/operations/system/CmsSystemDynamo.d.ts +0 -16
- package/operations/system/CmsSystemDynamo.js +0 -126
- package/operations/system/CmsSystemDynamo.js.map +0 -1
- package/operations/system/index.js.map +0 -1
- package/types.js.map +0 -1
- package/utils.d.ts +0 -5
- package/utils.js +0 -62
- package/utils.js.map +0 -1
|
@@ -13,146 +13,183 @@ var _dataloader = _interopRequireDefault(require("dataloader"));
|
|
|
13
13
|
|
|
14
14
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
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; }
|
|
16
|
+
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
* *** GLOBAL NOTE ***
|
|
22
|
-
* When records are received from the batch get, we get them in all sorts of order.
|
|
23
|
-
* What we need for DataLoader to work properly we must have id > records order.
|
|
24
|
-
* So in the order IDs got into the DataLoader, its records must go out in the same order / bundle.
|
|
25
|
-
*/
|
|
26
|
-
const flatResponses = responses => {
|
|
27
|
-
const entries = [];
|
|
28
|
-
const values = Object.values(responses);
|
|
29
|
-
|
|
30
|
-
for (const items of values) {
|
|
31
|
-
entries.push(...items);
|
|
32
|
-
}
|
|
18
|
+
var _keys = require("./keys");
|
|
33
19
|
|
|
34
|
-
|
|
35
|
-
};
|
|
20
|
+
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
36
21
|
|
|
37
|
-
|
|
38
|
-
const items = [];
|
|
39
|
-
const result = await storageOperations.table.batchGet(batch);
|
|
22
|
+
var _utils = require("@webiny/utils");
|
|
40
23
|
|
|
41
|
-
|
|
42
|
-
return items;
|
|
43
|
-
}
|
|
24
|
+
var _batchRead = require("@webiny/db-dynamodb/utils/batchRead");
|
|
44
25
|
|
|
45
|
-
|
|
46
|
-
items.push(...flatResponses(result.Responses));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (typeof result.next === "function") {
|
|
50
|
-
let previous = result;
|
|
51
|
-
let nResult;
|
|
52
|
-
|
|
53
|
-
while (nResult = await previous.next()) {
|
|
54
|
-
items.push(...flatResponses(nResult.Responses));
|
|
55
|
-
previous = nResult;
|
|
56
|
-
|
|
57
|
-
if (!nResult || typeof nResult.next !== "function") {
|
|
58
|
-
return items;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
26
|
+
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; }
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
};
|
|
28
|
+
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; }
|
|
65
29
|
|
|
66
|
-
const getAllEntryRevisions =
|
|
30
|
+
const getAllEntryRevisions = params => {
|
|
31
|
+
const {
|
|
32
|
+
entity,
|
|
33
|
+
model
|
|
34
|
+
} = params;
|
|
35
|
+
const {
|
|
36
|
+
tenant,
|
|
37
|
+
locale
|
|
38
|
+
} = model;
|
|
67
39
|
return new _dataloader.default(async ids => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
40
|
+
const results = [];
|
|
41
|
+
|
|
42
|
+
for (const id of ids) {
|
|
43
|
+
const queryAllParams = {
|
|
44
|
+
entity,
|
|
45
|
+
partitionKey: (0, _keys.createPartitionKey)({
|
|
46
|
+
tenant,
|
|
47
|
+
locale,
|
|
48
|
+
id
|
|
49
|
+
}),
|
|
72
50
|
options: {
|
|
73
51
|
beginsWith: "REV#"
|
|
74
52
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
53
|
+
};
|
|
54
|
+
const items = await (0, _query.queryAll)(queryAllParams);
|
|
55
|
+
const entries = (0, _cleanup.cleanupItems)(entity, items);
|
|
56
|
+
results.push(entries);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return results;
|
|
78
60
|
});
|
|
79
61
|
};
|
|
80
62
|
|
|
81
|
-
const getRevisionById =
|
|
63
|
+
const getRevisionById = params => {
|
|
64
|
+
const {
|
|
65
|
+
entity,
|
|
66
|
+
model
|
|
67
|
+
} = params;
|
|
68
|
+
const {
|
|
69
|
+
locale,
|
|
70
|
+
tenant
|
|
71
|
+
} = model;
|
|
82
72
|
return new _dataloader.default(async ids => {
|
|
83
|
-
const
|
|
84
|
-
const partitionKey =
|
|
85
|
-
|
|
73
|
+
const queries = ids.reduce((collection, id) => {
|
|
74
|
+
const partitionKey = (0, _keys.createPartitionKey)({
|
|
75
|
+
tenant,
|
|
76
|
+
locale,
|
|
77
|
+
id
|
|
78
|
+
});
|
|
79
|
+
const {
|
|
80
|
+
version
|
|
81
|
+
} = (0, _utils.parseIdentifier)(id);
|
|
82
|
+
const sortKey = (0, _keys.createRevisionSortKey)({
|
|
83
|
+
version
|
|
84
|
+
});
|
|
86
85
|
const keys = `${partitionKey}__${sortKey}`;
|
|
87
86
|
|
|
88
87
|
if (collection[keys]) {
|
|
89
88
|
return collection;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
collection[keys] =
|
|
91
|
+
collection[keys] = entity.getBatch({
|
|
93
92
|
PK: partitionKey,
|
|
94
93
|
SK: sortKey
|
|
95
94
|
});
|
|
96
95
|
return collection;
|
|
97
96
|
}, {});
|
|
98
|
-
const
|
|
97
|
+
const records = await (0, _batchRead.batchReadAll)({
|
|
98
|
+
table: entity.table,
|
|
99
|
+
items: Object.values(queries)
|
|
100
|
+
});
|
|
101
|
+
const items = (0, _cleanup.cleanupItems)(entity, records);
|
|
99
102
|
return ids.map(id => {
|
|
100
103
|
return items.filter(item => {
|
|
101
|
-
|
|
102
|
-
const sortKey = storageOperations.getSortKeyRevision(id);
|
|
103
|
-
return item.PK === partitionKey && item.SK === sortKey;
|
|
104
|
+
return id === item.id;
|
|
104
105
|
});
|
|
105
106
|
});
|
|
106
107
|
});
|
|
107
108
|
};
|
|
108
109
|
|
|
109
|
-
const getPublishedRevisionByEntryId =
|
|
110
|
+
const getPublishedRevisionByEntryId = params => {
|
|
111
|
+
const {
|
|
112
|
+
entity,
|
|
113
|
+
model
|
|
114
|
+
} = params;
|
|
115
|
+
const {
|
|
116
|
+
locale,
|
|
117
|
+
tenant
|
|
118
|
+
} = model;
|
|
119
|
+
const publishedKey = (0, _keys.createPublishedSortKey)();
|
|
110
120
|
return new _dataloader.default(async ids => {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
const queries = ids.reduce((collection, id) => {
|
|
122
|
+
const partitionKey = (0, _keys.createPartitionKey)({
|
|
123
|
+
tenant,
|
|
124
|
+
locale,
|
|
125
|
+
id
|
|
126
|
+
});
|
|
114
127
|
|
|
115
128
|
if (collection[partitionKey]) {
|
|
116
129
|
return collection;
|
|
117
130
|
}
|
|
118
131
|
|
|
119
|
-
collection[partitionKey] =
|
|
132
|
+
collection[partitionKey] = entity.getBatch({
|
|
120
133
|
PK: partitionKey,
|
|
121
|
-
SK:
|
|
134
|
+
SK: publishedKey
|
|
122
135
|
});
|
|
123
136
|
return collection;
|
|
124
137
|
}, {});
|
|
125
|
-
const
|
|
138
|
+
const records = await (0, _batchRead.batchReadAll)({
|
|
139
|
+
table: entity.table,
|
|
140
|
+
items: Object.values(queries)
|
|
141
|
+
});
|
|
142
|
+
const items = (0, _cleanup.cleanupItems)(entity, records);
|
|
126
143
|
return ids.map(id => {
|
|
144
|
+
const {
|
|
145
|
+
id: entryId
|
|
146
|
+
} = (0, _utils.parseIdentifier)(id);
|
|
127
147
|
return items.filter(item => {
|
|
128
|
-
|
|
129
|
-
return item.PK === partitionKey && item.SK === sortKey;
|
|
148
|
+
return entryId === item.entryId;
|
|
130
149
|
});
|
|
131
150
|
});
|
|
132
151
|
});
|
|
133
152
|
};
|
|
134
153
|
|
|
135
|
-
const getLatestRevisionByEntryId =
|
|
154
|
+
const getLatestRevisionByEntryId = params => {
|
|
155
|
+
const {
|
|
156
|
+
entity,
|
|
157
|
+
model
|
|
158
|
+
} = params;
|
|
159
|
+
const {
|
|
160
|
+
locale,
|
|
161
|
+
tenant
|
|
162
|
+
} = model;
|
|
163
|
+
const latestKey = (0, _keys.createLatestSortKey)();
|
|
136
164
|
return new _dataloader.default(async ids => {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
165
|
+
const queries = ids.reduce((collection, id) => {
|
|
166
|
+
const partitionKey = (0, _keys.createPartitionKey)({
|
|
167
|
+
tenant,
|
|
168
|
+
locale,
|
|
169
|
+
id
|
|
170
|
+
});
|
|
140
171
|
|
|
141
172
|
if (collection[partitionKey]) {
|
|
142
173
|
return collection;
|
|
143
174
|
}
|
|
144
175
|
|
|
145
|
-
collection[partitionKey] =
|
|
176
|
+
collection[partitionKey] = entity.getBatch({
|
|
146
177
|
PK: partitionKey,
|
|
147
|
-
SK:
|
|
178
|
+
SK: latestKey
|
|
148
179
|
});
|
|
149
180
|
return collection;
|
|
150
181
|
}, {});
|
|
151
|
-
const
|
|
182
|
+
const records = await (0, _batchRead.batchReadAll)({
|
|
183
|
+
table: entity.table,
|
|
184
|
+
items: Object.values(queries)
|
|
185
|
+
});
|
|
186
|
+
const items = (0, _cleanup.cleanupItems)(entity, records);
|
|
152
187
|
return ids.map(id => {
|
|
188
|
+
const {
|
|
189
|
+
id: entryId
|
|
190
|
+
} = (0, _utils.parseIdentifier)(id);
|
|
153
191
|
return items.filter(item => {
|
|
154
|
-
|
|
155
|
-
return item.PK === partitionKey && item.SK === sortKey;
|
|
192
|
+
return entryId === item.entryId;
|
|
156
193
|
});
|
|
157
194
|
});
|
|
158
195
|
});
|
|
@@ -164,80 +201,74 @@ const dataLoaders = {
|
|
|
164
201
|
getPublishedRevisionByEntryId,
|
|
165
202
|
getLatestRevisionByEntryId
|
|
166
203
|
};
|
|
204
|
+
const loaderNames = Object.keys(dataLoaders);
|
|
167
205
|
|
|
168
206
|
class DataLoadersHandler {
|
|
169
|
-
constructor(
|
|
170
|
-
(0, _defineProperty2.default)(this, "
|
|
171
|
-
(0, _defineProperty2.default)(this, "
|
|
172
|
-
|
|
173
|
-
this._context = context;
|
|
174
|
-
this._storageOperations = storageOperations;
|
|
207
|
+
constructor(params) {
|
|
208
|
+
(0, _defineProperty2.default)(this, "loaders", new Map());
|
|
209
|
+
(0, _defineProperty2.default)(this, "entity", void 0);
|
|
210
|
+
this.entity = params.entity;
|
|
175
211
|
}
|
|
176
212
|
|
|
177
|
-
async getAllEntryRevisions(
|
|
178
|
-
return await this.loadMany("getAllEntryRevisions",
|
|
213
|
+
async getAllEntryRevisions(params) {
|
|
214
|
+
return await this.loadMany("getAllEntryRevisions", params, params.ids);
|
|
179
215
|
}
|
|
180
216
|
|
|
181
|
-
|
|
182
|
-
this.
|
|
217
|
+
async getRevisionById(params) {
|
|
218
|
+
return await this.loadMany("getRevisionById", params, params.ids);
|
|
183
219
|
}
|
|
184
220
|
|
|
185
|
-
async
|
|
186
|
-
return await this.loadMany("
|
|
221
|
+
async getPublishedRevisionByEntryId(params) {
|
|
222
|
+
return await this.loadMany("getPublishedRevisionByEntryId", params, params.ids);
|
|
187
223
|
}
|
|
188
224
|
|
|
189
|
-
|
|
190
|
-
this.
|
|
225
|
+
async getLatestRevisionByEntryId(params) {
|
|
226
|
+
return await this.loadMany("getLatestRevisionByEntryId", params, params.ids);
|
|
191
227
|
}
|
|
192
228
|
|
|
193
|
-
|
|
194
|
-
return await this.loadMany("getPublishedRevisionByEntryId", model, ids);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
clearPublishedRevisionByEntryId(model, entry) {
|
|
198
|
-
this.clear("getPublishedRevisionByEntryId", model, entry);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
async getLatestRevisionByEntryId(model, ids) {
|
|
202
|
-
return await this.loadMany("getLatestRevisionByEntryId", model, ids);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
clearLatestRevisionByEntryId(model, entry) {
|
|
206
|
-
this.clear("getLatestRevisionByEntryId", model, entry);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
getLoader(name, model) {
|
|
229
|
+
getLoader(name, params) {
|
|
210
230
|
if (!dataLoaders[name]) {
|
|
211
231
|
throw new _error.default("Unknown data loader.", "UNKNOWN_DATA_LOADER", {
|
|
212
232
|
name
|
|
213
233
|
});
|
|
214
234
|
}
|
|
215
235
|
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
236
|
+
const {
|
|
237
|
+
model
|
|
238
|
+
} = params;
|
|
239
|
+
const {
|
|
240
|
+
tenant,
|
|
241
|
+
locale
|
|
242
|
+
} = model;
|
|
243
|
+
const loaderKey = `${name}-${tenant}-${locale}-${model.modelId}`;
|
|
244
|
+
|
|
245
|
+
if (!this.loaders.has(loaderKey)) {
|
|
246
|
+
this.loaders.set(loaderKey, dataLoaders[name](_objectSpread(_objectSpread({}, params), {}, {
|
|
247
|
+
entity: this.entity
|
|
248
|
+
})));
|
|
220
249
|
}
|
|
221
250
|
|
|
222
|
-
return this.
|
|
251
|
+
return this.loaders.get(loaderKey);
|
|
223
252
|
}
|
|
224
253
|
|
|
225
|
-
async loadMany(loader,
|
|
254
|
+
async loadMany(loader, params, ids) {
|
|
226
255
|
let results;
|
|
227
256
|
|
|
228
257
|
try {
|
|
229
|
-
results = await this.getLoader(loader,
|
|
258
|
+
results = await this.getLoader(loader, params).loadMany(ids);
|
|
230
259
|
|
|
231
260
|
if (Array.isArray(results) === true) {
|
|
232
261
|
return results.reduce((acc, res) => {
|
|
233
262
|
if (Array.isArray(res) === false) {
|
|
234
|
-
if (res
|
|
263
|
+
if (res && res.message) {
|
|
235
264
|
throw new _error.default(res.message, res.code, _objectSpread(_objectSpread({}, res), {}, {
|
|
236
265
|
data: JSON.stringify(res.data || {})
|
|
237
266
|
}));
|
|
238
267
|
}
|
|
239
268
|
|
|
240
|
-
throw new _error.default("Result from the data loader must be an array of arrays which contain requested items.")
|
|
269
|
+
throw new _error.default("Result from the data loader must be an array of arrays which contain requested items.", "DATA_LOADER_RESULTS_ERROR", _objectSpread(_objectSpread({}, params), {}, {
|
|
270
|
+
loader
|
|
271
|
+
}));
|
|
241
272
|
}
|
|
242
273
|
|
|
243
274
|
acc.push(...res);
|
|
@@ -245,12 +276,12 @@ class DataLoadersHandler {
|
|
|
245
276
|
}, []);
|
|
246
277
|
}
|
|
247
278
|
} catch (ex) {
|
|
248
|
-
throw new _error.default(ex.message || "Data loader error.", ex.code || "DATA_LOADER_ERROR", {
|
|
279
|
+
throw new _error.default(ex.message || "Data loader error.", ex.code || "DATA_LOADER_ERROR", _objectSpread(_objectSpread({
|
|
280
|
+
error: ex
|
|
281
|
+
}, params), {}, {
|
|
249
282
|
loader,
|
|
250
|
-
ids
|
|
251
|
-
|
|
252
|
-
data: ex.data || {}
|
|
253
|
-
});
|
|
283
|
+
ids
|
|
284
|
+
}));
|
|
254
285
|
}
|
|
255
286
|
|
|
256
287
|
throw new _error.default(`Data loader did not return array of items or empty array.`, "INVALID_DATA_LOADER_RESULT", {
|
|
@@ -259,25 +290,14 @@ class DataLoadersHandler {
|
|
|
259
290
|
results
|
|
260
291
|
});
|
|
261
292
|
}
|
|
262
|
-
/**
|
|
263
|
-
* Helper to clear the cache for certain data loader.
|
|
264
|
-
* If entry is passed then clear target key only.
|
|
265
|
-
*/
|
|
266
|
-
|
|
267
293
|
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
if (!entry) {
|
|
294
|
+
clearAll(params) {
|
|
295
|
+
for (const name of loaderNames) {
|
|
296
|
+
const loader = this.getLoader(name, params);
|
|
272
297
|
loader.clearAll();
|
|
273
|
-
return;
|
|
274
298
|
}
|
|
275
|
-
|
|
276
|
-
loader.clear(entry.id);
|
|
277
|
-
loader.clear(this._storageOperations.getPartitionKey(entry.id));
|
|
278
299
|
}
|
|
279
300
|
|
|
280
301
|
}
|
|
281
302
|
|
|
282
|
-
exports.DataLoadersHandler = DataLoadersHandler;
|
|
283
|
-
//# sourceMappingURL=dataLoaders.js.map
|
|
303
|
+
exports.DataLoadersHandler = DataLoadersHandler;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
import { CmsEntryStorageOperations } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import { Entity } from "dynamodb-toolbox";
|
|
3
|
+
import { PluginsContainer } from "@webiny/plugins";
|
|
4
|
+
export interface Params {
|
|
5
|
+
entity: Entity<any>;
|
|
6
|
+
plugins: PluginsContainer;
|
|
7
|
+
}
|
|
8
|
+
export declare const createEntriesStorageOperations: (params: Params) => CmsEntryStorageOperations;
|