@webiny/api-headless-cms 5.20.0-beta.0 → 5.21.0-beta.0
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/content/graphQLHandlerFactory.js +5 -2
- package/content/plugins/crud/contentEntry/afterDelete.d.ts +1 -1
- package/content/plugins/crud/contentEntry/afterDelete.js +2 -2
- package/content/plugins/crud/contentEntry/beforeCreate.d.ts +1 -1
- package/content/plugins/crud/contentEntry/beforeCreate.js +2 -2
- package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +1 -1
- package/content/plugins/crud/contentEntry/beforeUpdate.js +2 -2
- package/content/plugins/crud/contentEntry.crud.js +72 -68
- package/content/plugins/crud/contentModel/afterCreate.d.ts +1 -1
- package/content/plugins/crud/contentModel/afterCreate.js +2 -2
- package/content/plugins/crud/contentModel/afterDelete.d.ts +1 -1
- package/content/plugins/crud/contentModel/afterDelete.js +2 -2
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +1 -1
- package/content/plugins/crud/contentModel/afterUpdate.js +2 -2
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +2 -2
- package/content/plugins/crud/contentModel/beforeCreate.js +4 -4
- package/content/plugins/crud/contentModel/beforeDelete.d.ts +1 -1
- package/content/plugins/crud/contentModel/beforeDelete.js +2 -2
- package/content/plugins/crud/contentModel/beforeUpdate.d.ts +1 -1
- package/content/plugins/crud/contentModel/beforeUpdate.js +2 -2
- package/content/plugins/crud/contentModel/models.d.ts +1 -0
- package/content/plugins/crud/contentModel/models.js +19 -1
- package/content/plugins/crud/contentModel.crud.js +86 -80
- package/content/plugins/graphqlFields/boolean.js +4 -2
- package/content/plugins/graphqlFields/datetime.js +4 -1
- package/content/plugins/graphqlFields/file.js +5 -2
- package/content/plugins/graphqlFields/longText.js +4 -2
- package/content/plugins/graphqlFields/number.js +4 -2
- package/content/plugins/graphqlFields/object.js +3 -1
- package/content/plugins/graphqlFields/ref.js +4 -2
- package/content/plugins/graphqlFields/requiredField.d.ts +2 -0
- package/content/plugins/graphqlFields/requiredField.js +24 -0
- package/content/plugins/graphqlFields/richText.js +5 -2
- package/content/plugins/graphqlFields/text.js +4 -2
- package/content/plugins/schema/contentModelGroups.js +6 -2
- package/content/plugins/schema/contentModels.js +1 -0
- package/content/plugins/storage/object.js +5 -0
- package/package.json +23 -23
- package/plugins/crud/system.crud.js +11 -3
- package/types.d.ts +64 -32
- package/types.js +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.21.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"@babel/runtime": "7.16.3",
|
|
22
22
|
"@commodo/fields": "1.1.2-beta.20",
|
|
23
23
|
"@graphql-tools/schema": "7.1.5",
|
|
24
|
-
"@webiny/api-file-manager": "5.
|
|
25
|
-
"@webiny/api-i18n": "5.
|
|
26
|
-
"@webiny/api-i18n-content": "5.
|
|
27
|
-
"@webiny/api-i18n-ddb": "5.
|
|
28
|
-
"@webiny/api-security": "5.
|
|
29
|
-
"@webiny/api-tenancy": "5.
|
|
30
|
-
"@webiny/api-upgrade": "5.
|
|
31
|
-
"@webiny/error": "5.
|
|
32
|
-
"@webiny/handler": "5.
|
|
33
|
-
"@webiny/handler-aws": "5.
|
|
34
|
-
"@webiny/handler-db": "5.
|
|
35
|
-
"@webiny/handler-graphql": "5.
|
|
36
|
-
"@webiny/handler-http": "5.
|
|
37
|
-
"@webiny/plugins": "5.
|
|
38
|
-
"@webiny/pubsub": "5.
|
|
39
|
-
"@webiny/utils": "5.
|
|
40
|
-
"@webiny/validation": "5.
|
|
24
|
+
"@webiny/api-file-manager": "5.21.0-beta.0",
|
|
25
|
+
"@webiny/api-i18n": "5.21.0-beta.0",
|
|
26
|
+
"@webiny/api-i18n-content": "5.21.0-beta.0",
|
|
27
|
+
"@webiny/api-i18n-ddb": "5.21.0-beta.0",
|
|
28
|
+
"@webiny/api-security": "5.21.0-beta.0",
|
|
29
|
+
"@webiny/api-tenancy": "5.21.0-beta.0",
|
|
30
|
+
"@webiny/api-upgrade": "5.21.0-beta.0",
|
|
31
|
+
"@webiny/error": "5.21.0-beta.0",
|
|
32
|
+
"@webiny/handler": "5.21.0-beta.0",
|
|
33
|
+
"@webiny/handler-aws": "5.21.0-beta.0",
|
|
34
|
+
"@webiny/handler-db": "5.21.0-beta.0",
|
|
35
|
+
"@webiny/handler-graphql": "5.21.0-beta.0",
|
|
36
|
+
"@webiny/handler-http": "5.21.0-beta.0",
|
|
37
|
+
"@webiny/plugins": "5.21.0-beta.0",
|
|
38
|
+
"@webiny/pubsub": "5.21.0-beta.0",
|
|
39
|
+
"@webiny/utils": "5.21.0-beta.0",
|
|
40
|
+
"@webiny/validation": "5.21.0-beta.0",
|
|
41
41
|
"boolean": "3.1.4",
|
|
42
42
|
"commodo-fields-object": "1.0.6",
|
|
43
43
|
"dataloader": "2.0.0",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"@babel/core": "^7.5.5",
|
|
55
55
|
"@babel/preset-env": "^7.5.5",
|
|
56
56
|
"@babel/preset-flow": "^7.0.0",
|
|
57
|
-
"@webiny/api-security-so-ddb": "^5.
|
|
58
|
-
"@webiny/api-tenancy-so-ddb": "^5.
|
|
59
|
-
"@webiny/cli": "^5.
|
|
60
|
-
"@webiny/project-utils": "^5.
|
|
57
|
+
"@webiny/api-security-so-ddb": "^5.21.0-beta.0",
|
|
58
|
+
"@webiny/api-tenancy-so-ddb": "^5.21.0-beta.0",
|
|
59
|
+
"@webiny/cli": "^5.21.0-beta.0",
|
|
60
|
+
"@webiny/project-utils": "^5.21.0-beta.0",
|
|
61
61
|
"apollo-graphql": "^0.4.1",
|
|
62
62
|
"get-yarn-workspaces": "^1.0.2",
|
|
63
63
|
"graphql": "^14.6.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"build": "yarn webiny run build",
|
|
78
78
|
"watch": "yarn webiny run watch"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "cad155812edbdd577a1cc858b41038fdd7a6d2d9"
|
|
81
81
|
}
|
|
@@ -120,6 +120,10 @@ const createSystemCrud = params => {
|
|
|
120
120
|
if (version) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* First trigger before install event.
|
|
125
|
+
*/
|
|
126
|
+
|
|
123
127
|
|
|
124
128
|
await onBeforeInstall.publish({
|
|
125
129
|
tenant: getTenant().id
|
|
@@ -136,9 +140,6 @@ const createSystemCrud = params => {
|
|
|
136
140
|
});
|
|
137
141
|
}
|
|
138
142
|
|
|
139
|
-
await onAfterInstall.publish({
|
|
140
|
-
tenant: getTenant().id
|
|
141
|
-
});
|
|
142
143
|
const system = {
|
|
143
144
|
version: context.WEBINY_VERSION,
|
|
144
145
|
readAPIKey: createReadAPIKey(),
|
|
@@ -151,6 +152,13 @@ const createSystemCrud = params => {
|
|
|
151
152
|
await storageOperations.system.create({
|
|
152
153
|
system
|
|
153
154
|
});
|
|
155
|
+
/**
|
|
156
|
+
* And trigger after install event.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
await onAfterInstall.publish({
|
|
160
|
+
tenant: getTenant().id
|
|
161
|
+
});
|
|
154
162
|
},
|
|
155
163
|
|
|
156
164
|
async upgradeSystem(version) {
|
package/types.d.ts
CHANGED
|
@@ -910,6 +910,18 @@ export interface CmsModelCreateInput {
|
|
|
910
910
|
*/
|
|
911
911
|
group: string;
|
|
912
912
|
}
|
|
913
|
+
/**
|
|
914
|
+
* A GraphQL params.data parameter received when creating content model from existing model.
|
|
915
|
+
*
|
|
916
|
+
* @category GraphQL params
|
|
917
|
+
* @category CmsModel
|
|
918
|
+
*/
|
|
919
|
+
export interface CmsModelCreateFromInput extends CmsModelCreateInput {
|
|
920
|
+
/**
|
|
921
|
+
* Locale into which we want to clone the model into.
|
|
922
|
+
*/
|
|
923
|
+
locale?: string;
|
|
924
|
+
}
|
|
913
925
|
/**
|
|
914
926
|
* A definition for content model field received from the user.
|
|
915
927
|
*
|
|
@@ -981,6 +993,10 @@ export interface CmsModelUpdateInput {
|
|
|
981
993
|
* A new content model name.
|
|
982
994
|
*/
|
|
983
995
|
name?: string;
|
|
996
|
+
/**
|
|
997
|
+
* A group we want to move the model to.
|
|
998
|
+
*/
|
|
999
|
+
group?: string;
|
|
984
1000
|
/**
|
|
985
1001
|
* A new description of the content model.
|
|
986
1002
|
*/
|
|
@@ -1156,30 +1172,30 @@ export interface CmsModelManager {
|
|
|
1156
1172
|
delete: (id: string) => Promise<void>;
|
|
1157
1173
|
}
|
|
1158
1174
|
export interface BeforeModelCreateTopicParams {
|
|
1159
|
-
input:
|
|
1175
|
+
input: CmsModelCreateInput;
|
|
1160
1176
|
model: CmsModel;
|
|
1161
1177
|
}
|
|
1162
1178
|
export interface AfterModelCreateTopicParams {
|
|
1163
|
-
input:
|
|
1179
|
+
input: CmsModelCreateInput;
|
|
1164
1180
|
model: CmsModel;
|
|
1165
1181
|
}
|
|
1166
1182
|
export interface BeforeModelCreateFromTopicParams {
|
|
1167
|
-
input:
|
|
1183
|
+
input: CmsModelCreateInput;
|
|
1168
1184
|
original: CmsModel;
|
|
1169
1185
|
model: CmsModel;
|
|
1170
1186
|
}
|
|
1171
1187
|
export interface AfterModelCreateFromTopicParams {
|
|
1172
|
-
input:
|
|
1188
|
+
input: CmsModelCreateInput;
|
|
1173
1189
|
original: CmsModel;
|
|
1174
1190
|
model: CmsModel;
|
|
1175
1191
|
}
|
|
1176
1192
|
export interface BeforeModelUpdateTopicParams {
|
|
1177
|
-
input:
|
|
1193
|
+
input: CmsModelUpdateInput;
|
|
1178
1194
|
original: CmsModel;
|
|
1179
1195
|
model: CmsModel;
|
|
1180
1196
|
}
|
|
1181
1197
|
export interface AfterModelUpdateTopicParams {
|
|
1182
|
-
input:
|
|
1198
|
+
input: CmsModelUpdateInput;
|
|
1183
1199
|
original: CmsModel;
|
|
1184
1200
|
model: CmsModel;
|
|
1185
1201
|
}
|
|
@@ -1200,15 +1216,6 @@ export interface CmsModelUpdateDirectParams {
|
|
|
1200
1216
|
* @category CmsModel
|
|
1201
1217
|
*/
|
|
1202
1218
|
export interface CmsModelContext {
|
|
1203
|
-
/**
|
|
1204
|
-
* A function defining usage of a method with authenticating the user but not throwing an error.
|
|
1205
|
-
*/
|
|
1206
|
-
silentAuthModel: () => {
|
|
1207
|
-
/**
|
|
1208
|
-
* Get all content models.
|
|
1209
|
-
*/
|
|
1210
|
-
list: () => Promise<CmsModel[]>;
|
|
1211
|
-
};
|
|
1212
1219
|
/**
|
|
1213
1220
|
* Get a single content model.
|
|
1214
1221
|
*/
|
|
@@ -1224,7 +1231,7 @@ export interface CmsModelContext {
|
|
|
1224
1231
|
/**
|
|
1225
1232
|
* Create a content model from the given model - clone.
|
|
1226
1233
|
*/
|
|
1227
|
-
createModelFrom: (modelId: string, data:
|
|
1234
|
+
createModelFrom: (modelId: string, data: CmsModelCreateFromInput) => Promise<CmsModel>;
|
|
1228
1235
|
/**
|
|
1229
1236
|
* Update content model without data validation. Used internally.
|
|
1230
1237
|
* @hidden
|
|
@@ -1243,7 +1250,7 @@ export interface CmsModelContext {
|
|
|
1243
1250
|
*
|
|
1244
1251
|
* @see CmsModelManager
|
|
1245
1252
|
*/
|
|
1246
|
-
getModelManager: (
|
|
1253
|
+
getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;
|
|
1247
1254
|
/**
|
|
1248
1255
|
* Get all content model managers mapped by modelId.
|
|
1249
1256
|
* @see CmsModelManager
|
|
@@ -1394,33 +1401,37 @@ export interface CmsEntryMeta {
|
|
|
1394
1401
|
totalCount: number;
|
|
1395
1402
|
}
|
|
1396
1403
|
export interface BeforeEntryCreateTopicParams {
|
|
1397
|
-
input:
|
|
1404
|
+
input: CreateCmsEntryInput;
|
|
1398
1405
|
entry: CmsEntry;
|
|
1399
1406
|
model: CmsModel;
|
|
1400
1407
|
}
|
|
1401
1408
|
export interface AfterEntryCreateTopicParams {
|
|
1402
|
-
input:
|
|
1409
|
+
input: CreateCmsEntryInput;
|
|
1403
1410
|
entry: CmsEntry;
|
|
1404
1411
|
model: CmsModel;
|
|
1405
1412
|
storageEntry: CmsEntry;
|
|
1406
1413
|
}
|
|
1407
|
-
export interface
|
|
1414
|
+
export interface BeforeEntryCreateRevisionTopicParams {
|
|
1415
|
+
input: CreateFromCmsEntryInput;
|
|
1408
1416
|
entry: CmsEntry;
|
|
1417
|
+
original: CmsEntry;
|
|
1409
1418
|
model: CmsModel;
|
|
1410
1419
|
}
|
|
1411
|
-
export interface
|
|
1420
|
+
export interface AfterEntryCreateRevisionTopicParams {
|
|
1421
|
+
input: CreateFromCmsEntryInput;
|
|
1412
1422
|
entry: CmsEntry;
|
|
1423
|
+
original: CmsEntry;
|
|
1413
1424
|
model: CmsModel;
|
|
1414
1425
|
storageEntry: CmsEntry;
|
|
1415
1426
|
}
|
|
1416
1427
|
export interface BeforeEntryUpdateTopicParams {
|
|
1417
|
-
input:
|
|
1428
|
+
input: UpdateCmsEntryInput;
|
|
1418
1429
|
original: CmsEntry;
|
|
1419
1430
|
entry: CmsEntry;
|
|
1420
1431
|
model: CmsModel;
|
|
1421
1432
|
}
|
|
1422
1433
|
export interface AfterEntryUpdateTopicParams {
|
|
1423
|
-
input:
|
|
1434
|
+
input: UpdateCmsEntryInput;
|
|
1424
1435
|
original: CmsEntry;
|
|
1425
1436
|
entry: CmsEntry;
|
|
1426
1437
|
model: CmsModel;
|
|
@@ -1470,11 +1481,11 @@ export interface AfterEntryDeleteTopicParams {
|
|
|
1470
1481
|
entry: CmsEntry;
|
|
1471
1482
|
model: CmsModel;
|
|
1472
1483
|
}
|
|
1473
|
-
export interface
|
|
1484
|
+
export interface BeforeEntryDeleteRevisionTopicParams {
|
|
1474
1485
|
entry: CmsEntry;
|
|
1475
1486
|
model: CmsModel;
|
|
1476
1487
|
}
|
|
1477
|
-
export interface
|
|
1488
|
+
export interface AfterEntryDeleteRevisionTopicParams {
|
|
1478
1489
|
entry: CmsEntry;
|
|
1479
1490
|
model: CmsModel;
|
|
1480
1491
|
}
|
|
@@ -1486,6 +1497,27 @@ export interface BeforeEntryListTopicParams {
|
|
|
1486
1497
|
where: CmsEntryListWhere;
|
|
1487
1498
|
model: CmsModel;
|
|
1488
1499
|
}
|
|
1500
|
+
/**
|
|
1501
|
+
* @category Context
|
|
1502
|
+
* @category CmsEntry
|
|
1503
|
+
*/
|
|
1504
|
+
export interface CreateCmsEntryInput {
|
|
1505
|
+
[key: string]: any;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* @category Context
|
|
1509
|
+
* @category CmsEntry
|
|
1510
|
+
*/
|
|
1511
|
+
export interface CreateFromCmsEntryInput {
|
|
1512
|
+
[key: string]: any;
|
|
1513
|
+
}
|
|
1514
|
+
/**
|
|
1515
|
+
* @category Context
|
|
1516
|
+
* @category CmsEntry
|
|
1517
|
+
*/
|
|
1518
|
+
export interface UpdateCmsEntryInput {
|
|
1519
|
+
[key: string]: any;
|
|
1520
|
+
}
|
|
1489
1521
|
/**
|
|
1490
1522
|
* Cms Entry CRUD methods in the context.
|
|
1491
1523
|
*
|
|
@@ -1528,15 +1560,15 @@ export interface CmsEntryContext {
|
|
|
1528
1560
|
/**
|
|
1529
1561
|
* Create a new content entry.
|
|
1530
1562
|
*/
|
|
1531
|
-
createEntry: (model: CmsModel,
|
|
1563
|
+
createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1532
1564
|
/**
|
|
1533
1565
|
* Create a new entry from already existing entry.
|
|
1534
1566
|
*/
|
|
1535
|
-
createEntryRevisionFrom: (model: CmsModel, id: string,
|
|
1567
|
+
createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput) => Promise<CmsEntry>;
|
|
1536
1568
|
/**
|
|
1537
1569
|
* Update existing entry.
|
|
1538
1570
|
*/
|
|
1539
|
-
updateEntry: (model: CmsModel, id: string,
|
|
1571
|
+
updateEntry: (model: CmsModel, id: string, input?: UpdateCmsEntryInput) => Promise<CmsEntry>;
|
|
1540
1572
|
/**
|
|
1541
1573
|
* Method that republishes entry with given identifier.
|
|
1542
1574
|
* @internal
|
|
@@ -1575,14 +1607,14 @@ export interface CmsEntryContext {
|
|
|
1575
1607
|
*/
|
|
1576
1608
|
onBeforeEntryCreate: Topic<BeforeEntryCreateTopicParams>;
|
|
1577
1609
|
onAfterEntryCreate: Topic<AfterEntryCreateTopicParams>;
|
|
1578
|
-
|
|
1579
|
-
|
|
1610
|
+
onBeforeEntryCreateRevision: Topic<BeforeEntryCreateRevisionTopicParams>;
|
|
1611
|
+
onAfterEntryCreateRevision: Topic<AfterEntryCreateRevisionTopicParams>;
|
|
1580
1612
|
onBeforeEntryUpdate: Topic<BeforeEntryUpdateTopicParams>;
|
|
1581
1613
|
onAfterEntryUpdate: Topic<AfterEntryUpdateTopicParams>;
|
|
1582
1614
|
onBeforeEntryDelete: Topic<BeforeEntryDeleteTopicParams>;
|
|
1583
1615
|
onAfterEntryDelete: Topic<AfterEntryDeleteTopicParams>;
|
|
1584
|
-
|
|
1585
|
-
|
|
1616
|
+
onBeforeEntryDeleteRevision: Topic<BeforeEntryDeleteRevisionTopicParams>;
|
|
1617
|
+
onAfterEntryDeleteRevision: Topic<AfterEntryDeleteRevisionTopicParams>;
|
|
1586
1618
|
onBeforeEntryPublish: Topic<BeforeEntryPublishTopicParams>;
|
|
1587
1619
|
onAfterEntryPublish: Topic<AfterEntryPublishTopicParams>;
|
|
1588
1620
|
onBeforeEntryUnpublish: Topic<BeforeEntryUnpublishTopicParams>;
|
package/types.js
CHANGED
|
@@ -191,6 +191,13 @@ exports.CONTENT_ENTRY_STATUS = void 0;
|
|
|
191
191
|
* @category CmsModel
|
|
192
192
|
*/
|
|
193
193
|
|
|
194
|
+
/**
|
|
195
|
+
* A GraphQL params.data parameter received when creating content model from existing model.
|
|
196
|
+
*
|
|
197
|
+
* @category GraphQL params
|
|
198
|
+
* @category CmsModel
|
|
199
|
+
*/
|
|
200
|
+
|
|
194
201
|
/**
|
|
195
202
|
* A definition for content model field received from the user.
|
|
196
203
|
*
|
|
@@ -284,6 +291,21 @@ exports.CONTENT_ENTRY_STATUS = void 0;
|
|
|
284
291
|
* @category GraphQL output
|
|
285
292
|
*/
|
|
286
293
|
|
|
294
|
+
/**
|
|
295
|
+
* @category Context
|
|
296
|
+
* @category CmsEntry
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @category Context
|
|
301
|
+
* @category CmsEntry
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @category Context
|
|
306
|
+
* @category CmsEntry
|
|
307
|
+
*/
|
|
308
|
+
|
|
287
309
|
/**
|
|
288
310
|
* Cms Entry CRUD methods in the context.
|
|
289
311
|
*
|