@webiny/api-headless-cms 5.20.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.crud.js +50 -65
- 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/storage/object.js +5 -0
- package/package.json +23 -23
- package/plugins/crud/system.crud.js +11 -3
- package/types.d.ts +43 -27
- package/types.js +15 -0
package/types.d.ts
CHANGED
|
@@ -1180,12 +1180,12 @@ export interface AfterModelCreateTopicParams {
|
|
|
1180
1180
|
model: CmsModel;
|
|
1181
1181
|
}
|
|
1182
1182
|
export interface BeforeModelCreateFromTopicParams {
|
|
1183
|
-
input:
|
|
1183
|
+
input: CmsModelCreateInput;
|
|
1184
1184
|
original: CmsModel;
|
|
1185
1185
|
model: CmsModel;
|
|
1186
1186
|
}
|
|
1187
1187
|
export interface AfterModelCreateFromTopicParams {
|
|
1188
|
-
input:
|
|
1188
|
+
input: CmsModelCreateInput;
|
|
1189
1189
|
original: CmsModel;
|
|
1190
1190
|
model: CmsModel;
|
|
1191
1191
|
}
|
|
@@ -1216,15 +1216,6 @@ export interface CmsModelUpdateDirectParams {
|
|
|
1216
1216
|
* @category CmsModel
|
|
1217
1217
|
*/
|
|
1218
1218
|
export interface CmsModelContext {
|
|
1219
|
-
/**
|
|
1220
|
-
* A function defining usage of a method with authenticating the user but not throwing an error.
|
|
1221
|
-
*/
|
|
1222
|
-
silentAuthModel: () => {
|
|
1223
|
-
/**
|
|
1224
|
-
* Get all content models.
|
|
1225
|
-
*/
|
|
1226
|
-
list: () => Promise<CmsModel[]>;
|
|
1227
|
-
};
|
|
1228
1219
|
/**
|
|
1229
1220
|
* Get a single content model.
|
|
1230
1221
|
*/
|
|
@@ -1259,7 +1250,7 @@ export interface CmsModelContext {
|
|
|
1259
1250
|
*
|
|
1260
1251
|
* @see CmsModelManager
|
|
1261
1252
|
*/
|
|
1262
|
-
getModelManager: (
|
|
1253
|
+
getModelManager: (model: CmsModel | string) => Promise<CmsModelManager>;
|
|
1263
1254
|
/**
|
|
1264
1255
|
* Get all content model managers mapped by modelId.
|
|
1265
1256
|
* @see CmsModelManager
|
|
@@ -1410,33 +1401,37 @@ export interface CmsEntryMeta {
|
|
|
1410
1401
|
totalCount: number;
|
|
1411
1402
|
}
|
|
1412
1403
|
export interface BeforeEntryCreateTopicParams {
|
|
1413
|
-
input:
|
|
1404
|
+
input: CreateCmsEntryInput;
|
|
1414
1405
|
entry: CmsEntry;
|
|
1415
1406
|
model: CmsModel;
|
|
1416
1407
|
}
|
|
1417
1408
|
export interface AfterEntryCreateTopicParams {
|
|
1418
|
-
input:
|
|
1409
|
+
input: CreateCmsEntryInput;
|
|
1419
1410
|
entry: CmsEntry;
|
|
1420
1411
|
model: CmsModel;
|
|
1421
1412
|
storageEntry: CmsEntry;
|
|
1422
1413
|
}
|
|
1423
|
-
export interface
|
|
1414
|
+
export interface BeforeEntryCreateRevisionTopicParams {
|
|
1415
|
+
input: CreateFromCmsEntryInput;
|
|
1424
1416
|
entry: CmsEntry;
|
|
1417
|
+
original: CmsEntry;
|
|
1425
1418
|
model: CmsModel;
|
|
1426
1419
|
}
|
|
1427
|
-
export interface
|
|
1420
|
+
export interface AfterEntryCreateRevisionTopicParams {
|
|
1421
|
+
input: CreateFromCmsEntryInput;
|
|
1428
1422
|
entry: CmsEntry;
|
|
1423
|
+
original: CmsEntry;
|
|
1429
1424
|
model: CmsModel;
|
|
1430
1425
|
storageEntry: CmsEntry;
|
|
1431
1426
|
}
|
|
1432
1427
|
export interface BeforeEntryUpdateTopicParams {
|
|
1433
|
-
input:
|
|
1428
|
+
input: UpdateCmsEntryInput;
|
|
1434
1429
|
original: CmsEntry;
|
|
1435
1430
|
entry: CmsEntry;
|
|
1436
1431
|
model: CmsModel;
|
|
1437
1432
|
}
|
|
1438
1433
|
export interface AfterEntryUpdateTopicParams {
|
|
1439
|
-
input:
|
|
1434
|
+
input: UpdateCmsEntryInput;
|
|
1440
1435
|
original: CmsEntry;
|
|
1441
1436
|
entry: CmsEntry;
|
|
1442
1437
|
model: CmsModel;
|
|
@@ -1486,11 +1481,11 @@ export interface AfterEntryDeleteTopicParams {
|
|
|
1486
1481
|
entry: CmsEntry;
|
|
1487
1482
|
model: CmsModel;
|
|
1488
1483
|
}
|
|
1489
|
-
export interface
|
|
1484
|
+
export interface BeforeEntryDeleteRevisionTopicParams {
|
|
1490
1485
|
entry: CmsEntry;
|
|
1491
1486
|
model: CmsModel;
|
|
1492
1487
|
}
|
|
1493
|
-
export interface
|
|
1488
|
+
export interface AfterEntryDeleteRevisionTopicParams {
|
|
1494
1489
|
entry: CmsEntry;
|
|
1495
1490
|
model: CmsModel;
|
|
1496
1491
|
}
|
|
@@ -1502,6 +1497,27 @@ export interface BeforeEntryListTopicParams {
|
|
|
1502
1497
|
where: CmsEntryListWhere;
|
|
1503
1498
|
model: CmsModel;
|
|
1504
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
|
+
}
|
|
1505
1521
|
/**
|
|
1506
1522
|
* Cms Entry CRUD methods in the context.
|
|
1507
1523
|
*
|
|
@@ -1544,15 +1560,15 @@ export interface CmsEntryContext {
|
|
|
1544
1560
|
/**
|
|
1545
1561
|
* Create a new content entry.
|
|
1546
1562
|
*/
|
|
1547
|
-
createEntry: (model: CmsModel,
|
|
1563
|
+
createEntry: (model: CmsModel, input: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1548
1564
|
/**
|
|
1549
1565
|
* Create a new entry from already existing entry.
|
|
1550
1566
|
*/
|
|
1551
|
-
createEntryRevisionFrom: (model: CmsModel, id: string,
|
|
1567
|
+
createEntryRevisionFrom: (model: CmsModel, id: string, input: CreateFromCmsEntryInput) => Promise<CmsEntry>;
|
|
1552
1568
|
/**
|
|
1553
1569
|
* Update existing entry.
|
|
1554
1570
|
*/
|
|
1555
|
-
updateEntry: (model: CmsModel, id: string,
|
|
1571
|
+
updateEntry: (model: CmsModel, id: string, input?: UpdateCmsEntryInput) => Promise<CmsEntry>;
|
|
1556
1572
|
/**
|
|
1557
1573
|
* Method that republishes entry with given identifier.
|
|
1558
1574
|
* @internal
|
|
@@ -1591,14 +1607,14 @@ export interface CmsEntryContext {
|
|
|
1591
1607
|
*/
|
|
1592
1608
|
onBeforeEntryCreate: Topic<BeforeEntryCreateTopicParams>;
|
|
1593
1609
|
onAfterEntryCreate: Topic<AfterEntryCreateTopicParams>;
|
|
1594
|
-
|
|
1595
|
-
|
|
1610
|
+
onBeforeEntryCreateRevision: Topic<BeforeEntryCreateRevisionTopicParams>;
|
|
1611
|
+
onAfterEntryCreateRevision: Topic<AfterEntryCreateRevisionTopicParams>;
|
|
1596
1612
|
onBeforeEntryUpdate: Topic<BeforeEntryUpdateTopicParams>;
|
|
1597
1613
|
onAfterEntryUpdate: Topic<AfterEntryUpdateTopicParams>;
|
|
1598
1614
|
onBeforeEntryDelete: Topic<BeforeEntryDeleteTopicParams>;
|
|
1599
1615
|
onAfterEntryDelete: Topic<AfterEntryDeleteTopicParams>;
|
|
1600
|
-
|
|
1601
|
-
|
|
1616
|
+
onBeforeEntryDeleteRevision: Topic<BeforeEntryDeleteRevisionTopicParams>;
|
|
1617
|
+
onAfterEntryDeleteRevision: Topic<AfterEntryDeleteRevisionTopicParams>;
|
|
1602
1618
|
onBeforeEntryPublish: Topic<BeforeEntryPublishTopicParams>;
|
|
1603
1619
|
onAfterEntryPublish: Topic<AfterEntryPublishTopicParams>;
|
|
1604
1620
|
onBeforeEntryUnpublish: Topic<BeforeEntryUnpublishTopicParams>;
|
package/types.js
CHANGED
|
@@ -291,6 +291,21 @@ exports.CONTENT_ENTRY_STATUS = void 0;
|
|
|
291
291
|
* @category GraphQL output
|
|
292
292
|
*/
|
|
293
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
|
+
|
|
294
309
|
/**
|
|
295
310
|
* Cms Entry CRUD methods in the context.
|
|
296
311
|
*
|