@strapi/strapi 4.11.0-beta.1 → 4.11.0-exp.push-transfer-push-stuck
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.
|
@@ -59,10 +59,6 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
59
59
|
return options;
|
|
60
60
|
},
|
|
61
61
|
|
|
62
|
-
async wrapResult(result) {
|
|
63
|
-
return result;
|
|
64
|
-
},
|
|
65
|
-
|
|
66
62
|
async emitEvent(uid, event, entity) {
|
|
67
63
|
// Ignore audit log events to prevent infinite loops
|
|
68
64
|
if (uid === 'admin::audit-log') {
|
|
@@ -87,12 +83,10 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
87
83
|
const query = transformParamsToQuery(uid, wrappedParams);
|
|
88
84
|
|
|
89
85
|
if (kind === 'singleType') {
|
|
90
|
-
|
|
91
|
-
return this.wrapResult(entity, { uid, action: 'findOne' });
|
|
86
|
+
return db.query(uid).findOne(query);
|
|
92
87
|
}
|
|
93
88
|
|
|
94
|
-
|
|
95
|
-
return this.wrapResult(entities, { uid, action: 'findMany' });
|
|
89
|
+
return db.query(uid).findMany(query);
|
|
96
90
|
},
|
|
97
91
|
|
|
98
92
|
async findPage(uid, opts) {
|
|
@@ -100,11 +94,7 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
100
94
|
|
|
101
95
|
const query = transformParamsToQuery(uid, wrappedParams);
|
|
102
96
|
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
...page,
|
|
106
|
-
results: await this.wrapResult(page.results, { uid, action: 'findPage' }),
|
|
107
|
-
};
|
|
97
|
+
return db.query(uid).findPage(query);
|
|
108
98
|
},
|
|
109
99
|
|
|
110
100
|
// TODO: streamline the logic based on the populate option
|
|
@@ -113,11 +103,7 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
113
103
|
|
|
114
104
|
const query = transformParamsToQuery(uid, wrappedParams);
|
|
115
105
|
|
|
116
|
-
|
|
117
|
-
return {
|
|
118
|
-
...entities,
|
|
119
|
-
results: await this.wrapResult(entities.results, { uid, action: 'findWithRelationCounts' }),
|
|
120
|
-
};
|
|
106
|
+
return db.query(uid).findPage(query);
|
|
121
107
|
},
|
|
122
108
|
|
|
123
109
|
async findWithRelationCounts(uid, opts) {
|
|
@@ -125,8 +111,7 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
125
111
|
|
|
126
112
|
const query = transformParamsToQuery(uid, wrappedParams);
|
|
127
113
|
|
|
128
|
-
|
|
129
|
-
return this.wrapResult(entities, { uid, action: 'findWithRelationCounts' });
|
|
114
|
+
return db.query(uid).findMany(query);
|
|
130
115
|
},
|
|
131
116
|
|
|
132
117
|
async findOne(uid, entityId, opts) {
|
|
@@ -134,8 +119,7 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
134
119
|
|
|
135
120
|
const query = transformParamsToQuery(uid, pickSelectionParams(wrappedParams));
|
|
136
121
|
|
|
137
|
-
|
|
138
|
-
return this.wrapResult(entity, { uid, action: 'findOne' });
|
|
122
|
+
return db.query(uid).findOne({ ...query, where: { id: entityId } });
|
|
139
123
|
},
|
|
140
124
|
|
|
141
125
|
async count(uid, opts) {
|
|
@@ -178,8 +162,6 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
178
162
|
entity = await this.findOne(uid, entity.id, wrappedParams);
|
|
179
163
|
}
|
|
180
164
|
|
|
181
|
-
entity = await this.wrapResult(entity, { uid, action: 'create' });
|
|
182
|
-
|
|
183
165
|
await this.emitEvent(uid, ENTRY_CREATE, entity);
|
|
184
166
|
|
|
185
167
|
return entity;
|
|
@@ -231,8 +213,6 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
231
213
|
entity = await this.findOne(uid, entity.id, wrappedParams);
|
|
232
214
|
}
|
|
233
215
|
|
|
234
|
-
entity = await this.wrapResult(entity, { uid, action: 'update' });
|
|
235
|
-
|
|
236
216
|
await this.emitEvent(uid, ENTRY_UPDATE, entity);
|
|
237
217
|
|
|
238
218
|
return entity;
|
|
@@ -244,7 +224,7 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
244
224
|
// select / populate
|
|
245
225
|
const query = transformParamsToQuery(uid, pickSelectionParams(wrappedParams));
|
|
246
226
|
|
|
247
|
-
|
|
227
|
+
const entityToDelete = await db.query(uid).findOne({
|
|
248
228
|
...query,
|
|
249
229
|
where: { id: entityId },
|
|
250
230
|
});
|
|
@@ -258,8 +238,6 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
258
238
|
await db.query(uid).delete({ where: { id: entityToDelete.id } });
|
|
259
239
|
await deleteComponents(uid, componentsToDelete, { loadComponents: false });
|
|
260
240
|
|
|
261
|
-
entityToDelete = await this.wrapResult(entityToDelete, { uid, action: 'delete' });
|
|
262
|
-
|
|
263
241
|
await this.emitEvent(uid, ENTRY_DELETE, entityToDelete);
|
|
264
242
|
|
|
265
243
|
return entityToDelete;
|
|
@@ -272,7 +250,7 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
272
250
|
// select / populate
|
|
273
251
|
const query = transformParamsToQuery(uid, wrappedParams);
|
|
274
252
|
|
|
275
|
-
|
|
253
|
+
const entitiesToDelete = await db.query(uid).findMany(query);
|
|
276
254
|
|
|
277
255
|
if (!entitiesToDelete.length) {
|
|
278
256
|
return null;
|
|
@@ -287,27 +265,21 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
287
265
|
componentsToDelete.map((compos) => deleteComponents(uid, compos, { loadComponents: false }))
|
|
288
266
|
);
|
|
289
267
|
|
|
290
|
-
entitiesToDelete = await this.wrapResult(entitiesToDelete, { uid, action: 'delete' });
|
|
291
|
-
|
|
292
268
|
// Trigger webhooks. One for each entity
|
|
293
269
|
await Promise.all(entitiesToDelete.map((entity) => this.emitEvent(uid, ENTRY_DELETE, entity)));
|
|
294
270
|
|
|
295
271
|
return deletedEntities;
|
|
296
272
|
},
|
|
297
273
|
|
|
298
|
-
|
|
274
|
+
load(uid, entity, field, params = {}) {
|
|
299
275
|
if (!_.isString(field)) {
|
|
300
276
|
throw new Error(`Invalid load. Expected "${field}" to be a string`);
|
|
301
277
|
}
|
|
302
278
|
|
|
303
|
-
|
|
304
|
-
.query(uid)
|
|
305
|
-
.load(entity, field, transformLoadParamsToQuery(uid, field, params));
|
|
306
|
-
|
|
307
|
-
return this.wrapResult(loadedEntity, { uid, field, action: 'load' });
|
|
279
|
+
return db.query(uid).load(entity, field, transformLoadParamsToQuery(uid, field, params));
|
|
308
280
|
},
|
|
309
281
|
|
|
310
|
-
|
|
282
|
+
loadPages(uid, entity, field, params = {}, pagination = {}) {
|
|
311
283
|
if (!_.isString(field)) {
|
|
312
284
|
throw new Error(`Invalid load. Expected "${field}" to be a string`);
|
|
313
285
|
}
|
|
@@ -321,12 +293,7 @@ const createDefaultImplementation = ({ strapi, db, eventHub, entityValidator })
|
|
|
321
293
|
|
|
322
294
|
const query = transformLoadParamsToQuery(uid, field, params, pagination);
|
|
323
295
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
return {
|
|
327
|
-
...loadedPage,
|
|
328
|
-
results: await this.wrapResult(loadedPage.results, { uid, field, action: 'load' }),
|
|
329
|
-
};
|
|
296
|
+
return db.query(uid).loadPages(entity, field, query);
|
|
330
297
|
},
|
|
331
298
|
});
|
|
332
299
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/strapi",
|
|
3
|
-
"version": "4.11.0-
|
|
3
|
+
"version": "4.11.0-exp.push-transfer-push-stuck",
|
|
4
4
|
"description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -81,19 +81,19 @@
|
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@koa/cors": "3.4.3",
|
|
83
83
|
"@koa/router": "10.1.1",
|
|
84
|
-
"@strapi/admin": "4.11.0-
|
|
85
|
-
"@strapi/data-transfer": "4.11.0-
|
|
86
|
-
"@strapi/database": "4.11.0-
|
|
87
|
-
"@strapi/generate-new": "4.11.0-
|
|
88
|
-
"@strapi/generators": "4.11.0-
|
|
89
|
-
"@strapi/logger": "4.11.0-
|
|
90
|
-
"@strapi/permissions": "4.11.0-
|
|
91
|
-
"@strapi/plugin-content-manager": "4.11.0-
|
|
92
|
-
"@strapi/plugin-content-type-builder": "4.11.0-
|
|
93
|
-
"@strapi/plugin-email": "4.11.0-
|
|
94
|
-
"@strapi/plugin-upload": "4.11.0-
|
|
95
|
-
"@strapi/typescript-utils": "4.11.0-
|
|
96
|
-
"@strapi/utils": "4.11.0-
|
|
84
|
+
"@strapi/admin": "4.11.0-exp.push-transfer-push-stuck",
|
|
85
|
+
"@strapi/data-transfer": "4.11.0-exp.push-transfer-push-stuck",
|
|
86
|
+
"@strapi/database": "4.11.0-exp.push-transfer-push-stuck",
|
|
87
|
+
"@strapi/generate-new": "4.11.0-exp.push-transfer-push-stuck",
|
|
88
|
+
"@strapi/generators": "4.11.0-exp.push-transfer-push-stuck",
|
|
89
|
+
"@strapi/logger": "4.11.0-exp.push-transfer-push-stuck",
|
|
90
|
+
"@strapi/permissions": "4.11.0-exp.push-transfer-push-stuck",
|
|
91
|
+
"@strapi/plugin-content-manager": "4.11.0-exp.push-transfer-push-stuck",
|
|
92
|
+
"@strapi/plugin-content-type-builder": "4.11.0-exp.push-transfer-push-stuck",
|
|
93
|
+
"@strapi/plugin-email": "4.11.0-exp.push-transfer-push-stuck",
|
|
94
|
+
"@strapi/plugin-upload": "4.11.0-exp.push-transfer-push-stuck",
|
|
95
|
+
"@strapi/typescript-utils": "4.11.0-exp.push-transfer-push-stuck",
|
|
96
|
+
"@strapi/utils": "4.11.0-exp.push-transfer-push-stuck",
|
|
97
97
|
"bcryptjs": "2.4.3",
|
|
98
98
|
"boxen": "5.1.2",
|
|
99
99
|
"chalk": "4.1.2",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"node": ">=14.19.1 <=18.x.x",
|
|
143
143
|
"npm": ">=6.0.0"
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "90032a791f5413b9f139ea01687eda04c057eacd"
|
|
146
146
|
}
|