@webiny/api-apw 0.0.0-unstable.8c4d9f045a → 0.0.0-unstable.97a151f74d
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/ApwChangeRequestNotification.d.ts +27 -0
- package/ApwChangeRequestNotification.js +40 -0
- package/ApwChangeRequestNotification.js.map +1 -0
- package/ApwCommentNotification.d.ts +27 -0
- package/ApwCommentNotification.js +40 -0
- package/ApwCommentNotification.js.map +1 -0
- package/ApwContentReviewNotification.d.ts +26 -0
- package/ApwContentReviewNotification.js +40 -0
- package/ApwContentReviewNotification.js.map +1 -0
- package/ApwContentUrlPlugin.d.ts +19 -0
- package/ApwContentUrlPlugin.js +40 -0
- package/ApwContentUrlPlugin.js.map +1 -0
- package/ContentApwSettingsPlugin.js +1 -1
- package/crud/createChangeRequestMethods.js +21 -18
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +21 -18
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +60 -50
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +21 -18
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.d.ts +1 -1
- package/crud/createWorkflowMethods.js +42 -20
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +3 -7
- package/crud/index.js.map +1 -1
- package/crud/utils.js +4 -8
- package/crud/utils.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +8 -4
- package/index.js.map +1 -1
- package/package.json +38 -37
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +1 -1
- package/plugins/cms/apwEntryPlugins.js +4 -8
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +9 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +4 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +5 -5
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/cms/notifications/changeRequestNotification.js +35 -0
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -0
- package/plugins/cms/notifications/commentNotification.d.ts +1 -0
- package/plugins/cms/notifications/commentNotification.js +35 -0
- package/plugins/cms/notifications/commentNotification.js.map +1 -0
- package/plugins/cms/notifications/contentReviewNotification.d.ts +1 -0
- package/plugins/cms/notifications/contentReviewNotification.js +35 -0
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -0
- package/plugins/cms/notifications/contentUrl.d.ts +8 -0
- package/plugins/cms/notifications/contentUrl.js +60 -0
- package/plugins/cms/notifications/contentUrl.js.map +1 -0
- package/plugins/cms/triggerContentReview.js +3 -3
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +10 -14
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.js +4 -8
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.js +1 -1
- package/plugins/graphql/changeRequest.gql.js +1 -1
- package/plugins/graphql/comment.gql.js +1 -1
- package/plugins/graphql/contentReview.gql.js +4 -4
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +3 -1
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/workflow.gql.js +1 -1
- package/plugins/graphql.js +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +28 -8
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +6 -0
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +5 -8
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.d.ts +2 -0
- package/plugins/hooks/initializeNotifications.js +20 -0
- package/plugins/hooks/initializeNotifications.js.map +1 -0
- package/plugins/hooks/listContentReviews.d.ts +10 -0
- package/plugins/hooks/listContentReviews.js +68 -0
- package/plugins/hooks/listContentReviews.js.map +1 -0
- package/plugins/hooks/notifications/appUrl.d.ts +2 -0
- package/plugins/hooks/notifications/appUrl.js +22 -0
- package/plugins/hooks/notifications/appUrl.js.map +1 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +144 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/changeRequestUrl.d.ts +8 -0
- package/plugins/hooks/notifications/changeRequestUrl.js +31 -0
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -0
- package/plugins/hooks/notifications/commentAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/commentAfterCreate.js +157 -0
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/commentUrl.d.ts +8 -0
- package/plugins/hooks/notifications/commentUrl.js +31 -0
- package/plugins/hooks/notifications/commentUrl.js.map +1 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +122 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/contentReviewUrl.d.ts +7 -0
- package/plugins/hooks/notifications/contentReviewUrl.js +30 -0
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -0
- package/plugins/hooks/notifications/contentUrl.d.ts +7 -0
- package/plugins/hooks/notifications/contentUrl.js +29 -0
- package/plugins/hooks/notifications/contentUrl.js.map +1 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +25 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +25 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +25 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/reviewers.d.ts +15 -0
- package/plugins/hooks/notifications/reviewers.js +51 -0
- package/plugins/hooks/notifications/reviewers.js.map +1 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +52 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -0
- package/plugins/hooks/notifications/sendCommentNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendCommentNotification.js +52 -0
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.js +52 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -0
- package/plugins/hooks/updatePendingChangeRequests.js +7 -11
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +14 -18
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +30 -5
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +14 -4
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +2 -2
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +1 -1
- package/plugins/pageBuilder/index.js +9 -1
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +41 -29
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +18 -6
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +35 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/commentNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/commentNotification.js +35 -0
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +35 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/contentUrl.d.ts +1 -0
- package/plugins/pageBuilder/notifications/contentUrl.js +53 -0
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -0
- package/plugins/pageBuilder/triggerContentReview.js +3 -3
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +10 -14
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.js +1 -1
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +1 -1
- package/plugins/utils.js +4 -14
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +17 -14
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +1 -1
- package/scheduler/handlers/scheduleAction/index.js +8 -9
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +5 -9
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +1 -1
- package/scheduler/handlers/utils.js +1 -1
- package/storageOperations/changeRequestStorageOperations.js +5 -9
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +4 -8
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.js +5 -9
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.js +5 -9
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.js +3 -7
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -1
- package/storageOperations/models/contentReview.model.js +6 -5
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +1 -1
- package/storageOperations/models/reviewer.model.js +18 -2
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +3 -2
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.js +18 -14
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/workflowStorageOperations.js +8 -12
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +99 -84
- package/types.js.map +1 -1
- package/utils/errors.js +1 -1
- package/utils/fieldResolver.js +3 -9
- package/utils/fieldResolver.js.map +1 -1
- package/utils/resolve.d.ts +1 -1
package/types.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { Page,
|
1
|
+
import { CmsEntry as BaseCmsEntry, CmsModel, OnEntryBeforePublishTopicParams, OnEntryAfterPublishTopicParams, OnEntryAfterUnpublishTopicParams } from "@webiny/api-headless-cms/types";
|
2
|
+
import { Page, OnPageBeforeCreateTopicParams, OnPageBeforeCreateFromTopicParams, OnPageBeforeUpdateTopicParams, OnPageBeforePublishTopicParams, PageSettings } from "@webiny/api-page-builder/types";
|
3
3
|
import { Context } from "@webiny/api/types";
|
4
4
|
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
5
5
|
import { SecurityIdentity, SecurityPermission } from "@webiny/api-security/types";
|
@@ -10,6 +10,8 @@ import { ApwScheduleActionCrud, ScheduleActionContext } from "./scheduler/types"
|
|
10
10
|
import HandlerClient from "@webiny/handler-client/HandlerClient";
|
11
11
|
import { PluginsContainer } from "@webiny/plugins";
|
12
12
|
import { WcpContextObject } from "@webiny/api-wcp/types";
|
13
|
+
import { MailerContext } from "@webiny/api-mailer/types";
|
14
|
+
import { AdminSettingsContext } from "@webiny/api-admin-settings/types";
|
13
15
|
export interface ApwCmsEntry extends BaseCmsEntry {
|
14
16
|
title: string;
|
15
17
|
meta: {
|
@@ -75,11 +77,10 @@ export interface PageSettingsWithWorkflow extends PageSettings {
|
|
75
77
|
export interface PageWithWorkflow extends Page {
|
76
78
|
settings: PageSettingsWithWorkflow;
|
77
79
|
}
|
78
|
-
export declare type
|
79
|
-
export declare type
|
80
|
-
export declare type
|
81
|
-
export declare type
|
82
|
-
export declare type ApwOnBeforePageRequestReviewTopicParams = OnBeforePageRequestReviewTopicParams<PageWithWorkflow>;
|
80
|
+
export declare type ApwOnPageBeforeCreateTopicParams = OnPageBeforeCreateTopicParams<PageWithWorkflow>;
|
81
|
+
export declare type ApwOnPageBeforeCreateFromTopicParams = OnPageBeforeCreateFromTopicParams<PageWithWorkflow>;
|
82
|
+
export declare type ApwOnPageBeforeUpdateTopicParams = OnPageBeforeUpdateTopicParams<PageWithWorkflow>;
|
83
|
+
export declare type ApwOnPageBeforePublishTopicParams = OnPageBeforePublishTopicParams<PageWithWorkflow>;
|
83
84
|
export declare enum WorkflowScopeTypes {
|
84
85
|
DEFAULT = "default",
|
85
86
|
CUSTOM = "custom"
|
@@ -114,6 +115,7 @@ export interface CreatedBy {
|
|
114
115
|
}
|
115
116
|
export interface ApwBaseFields {
|
116
117
|
id: string;
|
118
|
+
entryId: string;
|
117
119
|
createdOn: string;
|
118
120
|
savedOn: string;
|
119
121
|
createdBy: CreatedBy;
|
@@ -122,6 +124,10 @@ export interface ApwReviewer extends ApwBaseFields {
|
|
122
124
|
identityId: string;
|
123
125
|
displayName: string | null;
|
124
126
|
type: string;
|
127
|
+
email?: string;
|
128
|
+
}
|
129
|
+
export interface ApwReviewerWithEmail extends Omit<ApwReviewer, "email"> {
|
130
|
+
email: string;
|
125
131
|
}
|
126
132
|
export interface ApwComment extends ApwBaseFields {
|
127
133
|
body: Record<string, any>;
|
@@ -149,10 +155,11 @@ export interface ApwContentReviewStep {
|
|
149
155
|
}
|
150
156
|
export interface ApwContentReview extends ApwBaseFields {
|
151
157
|
title: string;
|
152
|
-
|
158
|
+
reviewStatus: ApwContentReviewStatus;
|
153
159
|
content: ApwContentReviewContent;
|
154
160
|
steps: Array<ApwContentReviewStep>;
|
155
161
|
latestCommentId: string | null;
|
162
|
+
workflowId: string;
|
156
163
|
}
|
157
164
|
export interface ApwWorkflow extends ApwBaseFields {
|
158
165
|
title: string;
|
@@ -206,15 +213,10 @@ export interface UpdateApwWorkflowParams<TReviewer = string> {
|
|
206
213
|
steps?: ApwWorkflowStep<TReviewer>[];
|
207
214
|
}
|
208
215
|
export interface ListWorkflowsParams extends ListParams {
|
209
|
-
where
|
216
|
+
where?: ListWhere & {
|
210
217
|
app?: ApwWorkflowApplications;
|
211
218
|
};
|
212
219
|
}
|
213
|
-
interface CreateReviewerParams {
|
214
|
-
identityId: string;
|
215
|
-
displayName: string | null;
|
216
|
-
type: string;
|
217
|
-
}
|
218
220
|
interface CreateApwCommentParams {
|
219
221
|
body: Record<string, any>;
|
220
222
|
changeRequest: string;
|
@@ -265,11 +267,13 @@ export interface ApwContentReviewContent {
|
|
265
267
|
}
|
266
268
|
export interface CreateApwContentReviewParams {
|
267
269
|
content: ApwContentReviewContent;
|
270
|
+
reviewStatus: ApwContentReviewStatus;
|
271
|
+
workflowId?: string;
|
268
272
|
}
|
269
|
-
interface UpdateApwContentReviewParams {
|
273
|
+
export interface UpdateApwContentReviewParams {
|
270
274
|
title?: string;
|
271
275
|
steps?: ApwContentReviewStep[];
|
272
|
-
|
276
|
+
reviewStatus?: ApwContentReviewStatus;
|
273
277
|
content?: ApwContentReviewContent;
|
274
278
|
}
|
275
279
|
interface BaseApwCrud<TEntry, TCreateEntryParams, TUpdateEntryParams> {
|
@@ -279,33 +283,33 @@ interface BaseApwCrud<TEntry, TCreateEntryParams, TUpdateEntryParams> {
|
|
279
283
|
delete(id: string): Promise<Boolean>;
|
280
284
|
}
|
281
285
|
export interface ApwWorkflowCrud extends BaseApwCrud<ApwWorkflow, CreateApwWorkflowParams, UpdateApwWorkflowParams> {
|
282
|
-
list(params
|
286
|
+
list(params?: ListWorkflowsParams): Promise<[ApwWorkflow[], ListMeta]>;
|
283
287
|
/**
|
284
288
|
* Lifecycle events
|
285
289
|
*/
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
290
|
+
onWorkflowBeforeCreate: Topic<OnWorkflowBeforeCreateTopicParams>;
|
291
|
+
onWorkflowAfterCreate: Topic<OnWorkflowAfterCreateTopicParams>;
|
292
|
+
onWorkflowBeforeUpdate: Topic<OnWorkflowBeforeUpdateTopicParams>;
|
293
|
+
onWorkflowAfterUpdate: Topic<OnWorkflowAfterUpdateTopicParams>;
|
294
|
+
onWorkflowBeforeDelete: Topic<OnWorkflowBeforeDeleteTopicParams>;
|
295
|
+
onWorkflowAfterDelete: Topic<OnWorkflowAfterDeleteTopicParams>;
|
292
296
|
}
|
293
297
|
export interface ApwReviewerListParams extends ListParams {
|
294
298
|
where: ListParams["where"] & {
|
295
299
|
identityId?: string;
|
296
300
|
};
|
297
301
|
}
|
298
|
-
export interface ApwReviewerCrud extends BaseApwCrud<ApwReviewer,
|
302
|
+
export interface ApwReviewerCrud extends BaseApwCrud<ApwReviewer, CreateApwReviewerData, UpdateApwReviewerData> {
|
299
303
|
list(params: ApwReviewerListParams): Promise<[ApwReviewer[], ListMeta]>;
|
300
304
|
/**
|
301
305
|
* Lifecycle events
|
302
306
|
*/
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
307
|
+
onReviewerBeforeCreate: Topic<OnReviewerBeforeCreateTopicParams>;
|
308
|
+
onReviewerAfterCreate: Topic<OnReviewerAfterCreateTopicParams>;
|
309
|
+
onReviewerBeforeUpdate: Topic<OnReviewerBeforeUpdateTopicParams>;
|
310
|
+
onReviewerAfterUpdate: Topic<OnReviewerAfterUpdateTopicParams>;
|
311
|
+
onReviewerBeforeDelete: Topic<OnReviewerBeforeDeleteTopicParams>;
|
312
|
+
onReviewerAfterDelete: Topic<OnReviewerAfterDeleteTopicParams>;
|
309
313
|
}
|
310
314
|
export interface ApwCommentListParams extends ListParams {
|
311
315
|
where: ListParams["where"] & {
|
@@ -319,12 +323,12 @@ export interface ApwCommentCrud extends BaseApwCrud<ApwComment, CreateApwComment
|
|
319
323
|
/**
|
320
324
|
* Lifecycle events
|
321
325
|
*/
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
326
|
+
onCommentBeforeCreate: Topic<OnCommentBeforeCreateTopicParams>;
|
327
|
+
onCommentAfterCreate: Topic<OnCommentAfterCreateTopicParams>;
|
328
|
+
onCommentBeforeUpdate: Topic<OnCommentBeforeUpdateTopicParams>;
|
329
|
+
onCommentAfterUpdate: Topic<OnCommentAfterUpdateTopicParams>;
|
330
|
+
onCommentBeforeDelete: Topic<OnCommentBeforeDeleteTopicParams>;
|
331
|
+
onCommentAfterDelete: Topic<OnCommentAfterDeleteTopicParams>;
|
328
332
|
}
|
329
333
|
export interface ApwChangeRequestListParams extends ListParams {
|
330
334
|
where: ListParams["where"] & {
|
@@ -336,12 +340,12 @@ export interface ApwChangeRequestCrud extends BaseApwCrud<ApwChangeRequest, Crea
|
|
336
340
|
/**
|
337
341
|
* Lifecycle events
|
338
342
|
*/
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
343
|
+
onChangeRequestBeforeCreate: Topic<OnChangeRequestBeforeCreateTopicParams>;
|
344
|
+
onChangeRequestAfterCreate: Topic<OnChangeRequestAfterCreateTopicParams>;
|
345
|
+
onChangeRequestBeforeUpdate: Topic<OnChangeRequestBeforeUpdateTopicParams>;
|
346
|
+
onChangeRequestAfterUpdate: Topic<OnChangeRequestAfterUpdateTopicParams>;
|
347
|
+
onChangeRequestBeforeDelete: Topic<OnChangeRequestBeforeDeleteTopicParams>;
|
348
|
+
onChangeRequestAfterDelete: Topic<OnChangeRequestAfterDeleteTopicParams>;
|
345
349
|
}
|
346
350
|
export interface ApwContentReviewCrud extends BaseApwCrud<ApwContentReview, CreateApwContentReviewParams, UpdateApwContentReviewParams> {
|
347
351
|
list(params: ApwContentReviewListParams): Promise<[ApwContentReview[], ListMeta]>;
|
@@ -358,12 +362,13 @@ export interface ApwContentReviewCrud extends BaseApwCrud<ApwContentReview, Crea
|
|
358
362
|
/**
|
359
363
|
* Lifecycle events
|
360
364
|
*/
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
365
|
+
onContentReviewBeforeCreate: Topic<OnContentReviewBeforeCreateTopicParams>;
|
366
|
+
onContentReviewAfterCreate: Topic<OnContentReviewAfterCreateTopicParams>;
|
367
|
+
onContentReviewBeforeUpdate: Topic<OnContentReviewBeforeUpdateTopicParams>;
|
368
|
+
onContentReviewAfterUpdate: Topic<OnContentReviewAfterUpdateTopicParams>;
|
369
|
+
onContentReviewBeforeDelete: Topic<OnContentReviewBeforeDeleteTopicParams>;
|
370
|
+
onContentReviewAfterDelete: Topic<OnContentReviewAfterDeleteTopicParams>;
|
371
|
+
onContentReviewBeforeList: Topic<OnContentReviewBeforeListTopicParams>;
|
367
372
|
}
|
368
373
|
export declare type ContentGetter = (id: string, settings: {
|
369
374
|
modelId?: string;
|
@@ -388,7 +393,7 @@ export interface AdvancedPublishingWorkflow {
|
|
388
393
|
contentReview: ApwContentReviewCrud;
|
389
394
|
scheduleAction: ApwScheduleActionCrud;
|
390
395
|
}
|
391
|
-
export interface ApwContext extends Context,
|
396
|
+
export interface ApwContext extends Context, MailerContext, AdminSettingsContext {
|
392
397
|
apw: AdvancedPublishingWorkflow;
|
393
398
|
pageBuilder: PageBuilderContextObject;
|
394
399
|
wcp: WcpContextObject;
|
@@ -417,11 +422,13 @@ interface CreateApwReviewerData {
|
|
417
422
|
identityId: string;
|
418
423
|
displayName: string | null;
|
419
424
|
type: string;
|
425
|
+
email?: string | null;
|
420
426
|
}
|
421
427
|
interface UpdateApwReviewerData {
|
422
428
|
identityId: string;
|
423
429
|
displayName: string | null;
|
424
430
|
type: string;
|
431
|
+
email?: string | null;
|
425
432
|
}
|
426
433
|
interface StorageOperationsCreateReviewerParams {
|
427
434
|
data: CreateApwReviewerData;
|
@@ -451,10 +458,12 @@ interface StorageOperationsUpdateWorkflowParams {
|
|
451
458
|
declare type StorageOperationsDeleteWorkflowParams = StorageOperationsDeleteParams;
|
452
459
|
declare type StorageOperationsGetContentReviewParams = StorageOperationsGetParams;
|
453
460
|
export interface ApwContentReviewListParams extends ListParams {
|
454
|
-
where
|
455
|
-
|
461
|
+
where: ListWhere & {
|
462
|
+
reviewStatus?: ApwContentReviewListFilter;
|
456
463
|
title?: string;
|
457
464
|
title_contains?: string;
|
465
|
+
workflowId?: string;
|
466
|
+
workflowId_in?: string[];
|
458
467
|
};
|
459
468
|
}
|
460
469
|
declare type StorageOperationsListContentReviewsParams = ApwContentReviewListParams;
|
@@ -526,26 +535,26 @@ export interface ApwStorageOperations extends ApwReviewerStorageOperations, ApwW
|
|
526
535
|
/**
|
527
536
|
* @category Lifecycle events
|
528
537
|
*/
|
529
|
-
export interface
|
538
|
+
export interface OnCommentBeforeCreateTopicParams {
|
530
539
|
input: CreateApwCommentParams;
|
531
540
|
}
|
532
541
|
/**
|
533
542
|
* @category Lifecycle events
|
534
543
|
*/
|
535
|
-
export interface
|
544
|
+
export interface OnCommentAfterCreateTopicParams {
|
536
545
|
comment: ApwComment;
|
537
546
|
}
|
538
547
|
/**
|
539
548
|
* @category Lifecycle events
|
540
549
|
*/
|
541
|
-
export interface
|
550
|
+
export interface OnCommentBeforeUpdateTopicParams {
|
542
551
|
original: ApwComment;
|
543
552
|
input: Record<string, any>;
|
544
553
|
}
|
545
554
|
/**
|
546
555
|
* @category Lifecycle events
|
547
556
|
*/
|
548
|
-
export interface
|
557
|
+
export interface OnCommentAfterUpdateTopicParams {
|
549
558
|
original: ApwComment;
|
550
559
|
comment: ApwComment;
|
551
560
|
input: Record<string, any>;
|
@@ -553,38 +562,38 @@ export interface OnAfterCommentUpdateTopicParams {
|
|
553
562
|
/**
|
554
563
|
* @category Lifecycle events
|
555
564
|
*/
|
556
|
-
export interface
|
565
|
+
export interface OnCommentBeforeDeleteTopicParams {
|
557
566
|
comment: ApwComment;
|
558
567
|
}
|
559
568
|
/**
|
560
569
|
* @category Lifecycle events
|
561
570
|
*/
|
562
|
-
export interface
|
571
|
+
export interface OnCommentAfterDeleteTopicParams {
|
563
572
|
comment: ApwComment;
|
564
573
|
}
|
565
574
|
/**
|
566
575
|
* @category Lifecycle events
|
567
576
|
*/
|
568
|
-
export interface
|
577
|
+
export interface OnChangeRequestBeforeCreateTopicParams {
|
569
578
|
input: CreateApwChangeRequestParams;
|
570
579
|
}
|
571
580
|
/**
|
572
581
|
* @category Lifecycle events
|
573
582
|
*/
|
574
|
-
export interface
|
583
|
+
export interface OnChangeRequestAfterCreateTopicParams {
|
575
584
|
changeRequest: ApwChangeRequest;
|
576
585
|
}
|
577
586
|
/**
|
578
587
|
* @category Lifecycle events
|
579
588
|
*/
|
580
|
-
export interface
|
589
|
+
export interface OnChangeRequestBeforeUpdateTopicParams {
|
581
590
|
original: ApwChangeRequest;
|
582
591
|
input: Record<string, any>;
|
583
592
|
}
|
584
593
|
/**
|
585
594
|
* @category Lifecycle events
|
586
595
|
*/
|
587
|
-
export interface
|
596
|
+
export interface OnChangeRequestAfterUpdateTopicParams {
|
588
597
|
original: ApwChangeRequest;
|
589
598
|
changeRequest: ApwChangeRequest;
|
590
599
|
input: Record<string, any>;
|
@@ -592,38 +601,38 @@ export interface OnAfterChangeRequestUpdateTopicParams {
|
|
592
601
|
/**
|
593
602
|
* @category Lifecycle events
|
594
603
|
*/
|
595
|
-
export interface
|
604
|
+
export interface OnChangeRequestBeforeDeleteTopicParams {
|
596
605
|
changeRequest: ApwChangeRequest;
|
597
606
|
}
|
598
607
|
/**
|
599
608
|
* @category Lifecycle events
|
600
609
|
*/
|
601
|
-
export interface
|
610
|
+
export interface OnChangeRequestAfterDeleteTopicParams {
|
602
611
|
changeRequest: ApwChangeRequest;
|
603
612
|
}
|
604
613
|
/**
|
605
614
|
* @category Lifecycle events
|
606
615
|
*/
|
607
|
-
export interface
|
616
|
+
export interface OnContentReviewBeforeCreateTopicParams {
|
608
617
|
input: CreateApwContentReviewParams;
|
609
618
|
}
|
610
619
|
/**
|
611
620
|
* @category Lifecycle events
|
612
621
|
*/
|
613
|
-
export interface
|
622
|
+
export interface OnContentReviewAfterCreateTopicParams {
|
614
623
|
contentReview: ApwContentReview;
|
615
624
|
}
|
616
625
|
/**
|
617
626
|
* @category Lifecycle events
|
618
627
|
*/
|
619
|
-
export interface
|
628
|
+
export interface OnContentReviewBeforeUpdateTopicParams {
|
620
629
|
original: ApwContentReview;
|
621
630
|
input: Record<string, any>;
|
622
631
|
}
|
623
632
|
/**
|
624
633
|
* @category Lifecycle events
|
625
634
|
*/
|
626
|
-
export interface
|
635
|
+
export interface OnContentReviewAfterUpdateTopicParams {
|
627
636
|
original: ApwContentReview;
|
628
637
|
contentReview: ApwContentReview;
|
629
638
|
input: Record<string, any>;
|
@@ -631,41 +640,47 @@ export interface OnAfterContentReviewUpdateTopicParams {
|
|
631
640
|
/**
|
632
641
|
* @category Lifecycle events
|
633
642
|
*/
|
634
|
-
export interface
|
643
|
+
export interface OnContentReviewBeforeDeleteTopicParams {
|
635
644
|
contentReview: ApwContentReview;
|
636
645
|
}
|
637
646
|
/**
|
638
647
|
* @category Lifecycle events
|
639
648
|
*/
|
640
|
-
export interface
|
649
|
+
export interface OnContentReviewAfterDeleteTopicParams {
|
641
650
|
contentReview: ApwContentReview;
|
642
651
|
}
|
652
|
+
/**
|
653
|
+
* @category Lifecycle events
|
654
|
+
*/
|
655
|
+
export interface OnContentReviewBeforeListTopicParams {
|
656
|
+
where: ApwContentReviewListParams["where"];
|
657
|
+
}
|
643
658
|
export interface CreateApwReviewerParams {
|
644
659
|
type: string;
|
645
660
|
}
|
646
661
|
/**
|
647
662
|
* @category Lifecycle events
|
648
663
|
*/
|
649
|
-
export interface
|
664
|
+
export interface OnReviewerBeforeCreateTopicParams {
|
650
665
|
input: CreateApwReviewerParams;
|
651
666
|
}
|
652
667
|
/**
|
653
668
|
* @category Lifecycle events
|
654
669
|
*/
|
655
|
-
export interface
|
670
|
+
export interface OnReviewerAfterCreateTopicParams {
|
656
671
|
reviewer: ApwReviewer;
|
657
672
|
}
|
658
673
|
/**
|
659
674
|
* @category Lifecycle events
|
660
675
|
*/
|
661
|
-
export interface
|
676
|
+
export interface OnReviewerBeforeUpdateTopicParams {
|
662
677
|
original: ApwReviewer;
|
663
678
|
input: Record<string, any>;
|
664
679
|
}
|
665
680
|
/**
|
666
681
|
* @category Lifecycle events
|
667
682
|
*/
|
668
|
-
export interface
|
683
|
+
export interface OnReviewerAfterUpdateTopicParams {
|
669
684
|
original: ApwReviewer;
|
670
685
|
reviewer: ApwReviewer;
|
671
686
|
input: Record<string, any>;
|
@@ -673,38 +688,38 @@ export interface OnAfterReviewerUpdateTopicParams {
|
|
673
688
|
/**
|
674
689
|
* @category Lifecycle events
|
675
690
|
*/
|
676
|
-
export interface
|
691
|
+
export interface OnReviewerBeforeDeleteTopicParams {
|
677
692
|
reviewer: ApwReviewer;
|
678
693
|
}
|
679
694
|
/**
|
680
695
|
* @category Lifecycle events
|
681
696
|
*/
|
682
|
-
export interface
|
697
|
+
export interface OnReviewerAfterDeleteTopicParams {
|
683
698
|
reviewer: ApwReviewer;
|
684
699
|
}
|
685
700
|
/**
|
686
701
|
* @category Lifecycle events
|
687
702
|
*/
|
688
|
-
export interface
|
703
|
+
export interface OnWorkflowBeforeCreateTopicParams {
|
689
704
|
input: CreateApwWorkflowParams;
|
690
705
|
}
|
691
706
|
/**
|
692
707
|
* @category Lifecycle events
|
693
708
|
*/
|
694
|
-
export interface
|
709
|
+
export interface OnWorkflowAfterCreateTopicParams {
|
695
710
|
workflow: ApwWorkflow;
|
696
711
|
}
|
697
712
|
/**
|
698
713
|
* @category Lifecycle events
|
699
714
|
*/
|
700
|
-
export interface
|
715
|
+
export interface OnWorkflowBeforeUpdateTopicParams {
|
701
716
|
original: ApwWorkflow;
|
702
717
|
input: Record<string, any>;
|
703
718
|
}
|
704
719
|
/**
|
705
720
|
* @category Lifecycle events
|
706
721
|
*/
|
707
|
-
export interface
|
722
|
+
export interface OnWorkflowAfterUpdateTopicParams {
|
708
723
|
original: ApwWorkflow;
|
709
724
|
workflow: ApwWorkflow;
|
710
725
|
input: Record<string, any>;
|
@@ -712,26 +727,26 @@ export interface OnAfterWorkflowUpdateTopicParams {
|
|
712
727
|
/**
|
713
728
|
* @category Lifecycle events
|
714
729
|
*/
|
715
|
-
export interface
|
730
|
+
export interface OnWorkflowBeforeDeleteTopicParams {
|
716
731
|
workflow: ApwWorkflow;
|
717
732
|
}
|
718
733
|
/**
|
719
734
|
* @category Lifecycle events
|
720
735
|
*/
|
721
|
-
export interface
|
736
|
+
export interface OnWorkflowAfterDeleteTopicParams {
|
722
737
|
workflow: ApwWorkflow;
|
723
738
|
}
|
724
739
|
export declare type WorkflowModelDefinition = Pick<CmsModel, "name" | "modelId" | "layout" | "titleFieldId" | "description" | "fields" | "isPrivate">;
|
725
740
|
/**
|
726
741
|
* Headless CMS
|
727
742
|
*/
|
728
|
-
export interface
|
743
|
+
export interface OnCmsEntryBeforePublishTopicParams extends Omit<OnEntryBeforePublishTopicParams, "entry"> {
|
729
744
|
entry: ApwCmsEntry;
|
730
745
|
}
|
731
|
-
export interface
|
746
|
+
export interface OnCmsEntryAfterPublishTopicParams extends Omit<OnEntryAfterPublishTopicParams, "entry"> {
|
732
747
|
entry: ApwCmsEntry;
|
733
748
|
}
|
734
|
-
export interface
|
749
|
+
export interface OnCmsEntryAfterUnpublishTopicParams extends Omit<OnEntryAfterUnpublishTopicParams, "entry"> {
|
735
750
|
entry: ApwCmsEntry;
|
736
751
|
}
|
737
752
|
export {};
|
package/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ApwContentTypes","WorkflowScopeTypes","ApwContentReviewStepStatus","ApwWorkflowApplications","ApwWorkflowStepTypes","ApwContentReviewStatus","ApwScheduleActionTypes"],"sources":["types.ts"],"sourcesContent":["import {\n CmsContext,\n CmsEntry as BaseCmsEntry,\n CmsModel,\n BeforeEntryPublishTopicParams,\n AfterEntryPublishTopicParams,\n AfterEntryUnpublishTopicParams\n} from \"@webiny/api-headless-cms/types\";\nimport {\n Page,\n OnBeforePageCreateTopicParams,\n OnBeforePageCreateFromTopicParams,\n OnBeforePageUpdateTopicParams,\n OnBeforePagePublishTopicParams,\n OnBeforePageRequestReviewTopicParams,\n PageSettings\n} from \"@webiny/api-page-builder/types\";\nimport { Context } from \"@webiny/api/types\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\nimport { SecurityIdentity, SecurityPermission } from \"@webiny/api-security/types\";\nimport { I18NLocale } from \"@webiny/api-i18n/types\";\nimport { Tenant } from \"@webiny/api-tenancy/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport { ApwScheduleActionCrud, ScheduleActionContext } from \"~/scheduler/types\";\nimport HandlerClient from \"@webiny/handler-client/HandlerClient\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { WcpContextObject } from \"@webiny/api-wcp/types\";\n\nexport interface ApwCmsEntry extends BaseCmsEntry {\n title: string;\n meta: {\n apw?: {\n contentReviewId?: string | null;\n workflowId?: string | null;\n };\n };\n}\n\nexport interface ApwFile {\n id: string;\n key: string;\n size: number;\n type: string;\n name: string;\n}\n\nexport interface ListWhere {\n /**\n * Fields.\n */\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n /**\n * Who created the entry?\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n}\n\nexport interface ListParams {\n where?: ListWhere;\n sort?: string[];\n limit?: number;\n after?: string | null;\n}\n\nexport interface ListMeta {\n /**\n * A cursor for pagination.\n */\n cursor: string | null;\n /**\n * Is there more items to load?\n */\n hasMoreItems: boolean;\n /**\n * Total count of the items in the storage.\n */\n totalCount: number;\n}\n\nexport enum ApwContentTypes {\n PAGE = \"page\",\n CMS_ENTRY = \"cms_entry\"\n}\n\nexport interface PageSettingsWithWorkflow extends PageSettings {\n apw: {\n workflowId: string;\n contentReviewId: string | null;\n };\n}\nexport interface PageWithWorkflow extends Page {\n settings: PageSettingsWithWorkflow;\n}\n\nexport type ApwOnBeforePageCreateTopicParams = OnBeforePageCreateTopicParams<PageWithWorkflow>;\n\nexport type ApwOnBeforePageCreateFromTopicParams =\n OnBeforePageCreateFromTopicParams<PageWithWorkflow>;\n\nexport type ApwOnBeforePageUpdateTopicParams = OnBeforePageUpdateTopicParams<PageWithWorkflow>;\n\nexport type ApwOnBeforePagePublishTopicParams = OnBeforePagePublishTopicParams<PageWithWorkflow>;\n\nexport type ApwOnBeforePageRequestReviewTopicParams =\n OnBeforePageRequestReviewTopicParams<PageWithWorkflow>;\n\nexport enum WorkflowScopeTypes {\n DEFAULT = \"default\",\n CUSTOM = \"custom\"\n}\n\nexport enum ApwContentReviewStepStatus {\n DONE = \"done\",\n ACTIVE = \"active\",\n INACTIVE = \"inactive\"\n}\n\nexport enum ApwWorkflowApplications {\n PB = \"pageBuilder\",\n CMS = \"cms\"\n}\n\n/**\n * A interface describing the reference to a user that created some data in the database.\n *\n * @category General\n */\nexport interface CreatedBy {\n /**\n * ID if the user.\n */\n id: string;\n /**\n * Full name of the user.\n */\n displayName: string | null;\n /**\n * Type of the user (admin, user)\n */\n type: string;\n}\n\nexport interface ApwBaseFields {\n id: string;\n createdOn: string;\n savedOn: string;\n createdBy: CreatedBy;\n}\n\nexport interface ApwReviewer extends ApwBaseFields {\n identityId: string;\n displayName: string | null;\n type: string;\n}\n\nexport interface ApwComment extends ApwBaseFields {\n body: Record<string, any>;\n changeRequest: string;\n step: string;\n media: ApwFile;\n}\n\nexport interface ApwChangeRequest extends ApwBaseFields {\n body: Record<string, any>;\n title: string;\n resolved: boolean;\n step: string;\n media: ApwFile;\n}\n\nexport interface ApwContentReviewStep {\n type: ApwWorkflowStepTypes;\n title: string;\n slug: string;\n reviewers: ApwReviewer[];\n status: ApwContentReviewStepStatus;\n pendingChangeRequests: number;\n totalComments: number;\n signOffProvidedOn: string | null;\n signOffProvidedBy: CreatedBy | null;\n}\n\nexport interface ApwContentReview extends ApwBaseFields {\n title: string;\n status: ApwContentReviewStatus;\n content: ApwContentReviewContent;\n steps: Array<ApwContentReviewStep>;\n latestCommentId: string | null;\n}\n\nexport interface ApwWorkflow extends ApwBaseFields {\n title: string;\n steps: ApwWorkflowStep[];\n scope: ApwWorkflowScope;\n app: ApwWorkflowApplications;\n}\n\ninterface ApwWorkflowScopeCmsEntry {\n id: string;\n modelId: string;\n}\nexport interface ApwWorkflowScope {\n type: WorkflowScopeTypes;\n data: {\n categories?: string[];\n pages?: string[];\n models?: string[];\n entries?: ApwWorkflowScopeCmsEntry[];\n };\n}\n\nexport enum ApwWorkflowStepTypes {\n MANDATORY_BLOCKING = \"mandatoryBlocking\",\n MANDATORY_NON_BLOCKING = \"mandatoryNonBlocking\",\n NON_MANDATORY = \"notMandatory\"\n}\n\nexport enum ApwContentReviewStatus {\n UNDER_REVIEW = \"underReview\",\n READY_TO_BE_PUBLISHED = \"readyToBePublished\",\n PUBLISHED = \"published\"\n}\n\nexport type ApwContentReviewListFilter = ApwContentReviewStatus | \"requiresMyAttention\";\n\nexport interface ApwWorkflowStep<TReviewer = ApwReviewer> {\n title: string;\n type: ApwWorkflowStepTypes;\n reviewers: TReviewer[];\n id: string;\n}\n\nexport interface ApwContentReviewStep extends ApwWorkflowStep {\n status: ApwContentReviewStepStatus;\n pendingChangeRequests: number;\n}\n\nexport interface CreateApwWorkflowParams<TReviewer = string> {\n app: ApwWorkflowApplications;\n title: string;\n scope: ApwWorkflowScope;\n steps: ApwWorkflowStep<TReviewer>[];\n}\n\nexport interface UpdateApwWorkflowParams<TReviewer = string> {\n title?: string;\n scope?: ApwWorkflowScope;\n steps?: ApwWorkflowStep<TReviewer>[];\n}\n\nexport interface ListWorkflowsParams extends ListParams {\n where: ListWhere & {\n app?: ApwWorkflowApplications;\n };\n}\n\ninterface CreateReviewerParams {\n identityId: string;\n displayName: string | null;\n type: string;\n}\n\ninterface CreateApwCommentParams {\n body: Record<string, any>;\n changeRequest: string;\n step: string;\n media: ApwFile;\n}\n\ninterface UpdateApwCommentParams {\n body: Record<string, any>;\n}\n\ninterface CreateApwChangeRequestParams {\n title: string;\n step: string;\n body: Record<string, any>;\n resolved: boolean;\n media: Record<string, any>;\n}\n\ninterface UpdateApwChangeRequestParams {\n title: string;\n body: Record<string, any>;\n resolved: boolean;\n media: Record<string, any>;\n}\n\nenum ApwScheduleActionTypes {\n PUBLISH = \"publish\",\n UNPUBLISH = \"unpublish\"\n}\n\nexport interface ApwScheduleActionData {\n action: ApwScheduleActionTypes;\n type: ApwContentTypes;\n datetime: string;\n entryId: string;\n /**\n * We will add modelId to the data for now.\n * TODO extract in separate package?\n */\n modelId?: string;\n}\n\nexport interface ApwContentReviewContent {\n id: string;\n type: ApwContentTypes;\n settings: {\n modelId?: string;\n };\n scheduledOn?: string | null;\n scheduledBy?: string | null;\n scheduledActionId?: string | null;\n publishedBy?: string | null;\n}\n\nexport interface CreateApwContentReviewParams {\n content: ApwContentReviewContent;\n}\n\ninterface UpdateApwContentReviewParams {\n title?: string;\n steps?: ApwContentReviewStep[];\n status?: ApwContentReviewStatus;\n content?: ApwContentReviewContent;\n}\n\ninterface BaseApwCrud<TEntry, TCreateEntryParams, TUpdateEntryParams> {\n get(id: string): Promise<TEntry>;\n\n create(data: TCreateEntryParams): Promise<TEntry>;\n\n update(id: string, data: TUpdateEntryParams): Promise<TEntry>;\n\n delete(id: string): Promise<Boolean>;\n}\n\nexport interface ApwWorkflowCrud\n extends BaseApwCrud<ApwWorkflow, CreateApwWorkflowParams, UpdateApwWorkflowParams> {\n list(params: ListWorkflowsParams): Promise<[ApwWorkflow[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onBeforeWorkflowCreate: Topic<OnBeforeWorkflowCreateTopicParams>;\n onAfterWorkflowCreate: Topic<OnAfterWorkflowCreateTopicParams>;\n onBeforeWorkflowUpdate: Topic<OnBeforeWorkflowUpdateTopicParams>;\n onAfterWorkflowUpdate: Topic<OnAfterWorkflowUpdateTopicParams>;\n onBeforeWorkflowDelete: Topic<OnBeforeWorkflowDeleteTopicParams>;\n onAfterWorkflowDelete: Topic<OnAfterWorkflowDeleteTopicParams>;\n}\n\nexport interface ApwReviewerListParams extends ListParams {\n where: ListParams[\"where\"] & {\n identityId?: string;\n };\n}\n\nexport interface ApwReviewerCrud\n extends BaseApwCrud<ApwReviewer, CreateReviewerParams, UpdateApwReviewerData> {\n list(params: ApwReviewerListParams): Promise<[ApwReviewer[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onBeforeReviewerCreate: Topic<OnBeforeReviewerCreateTopicParams>;\n onAfterReviewerCreate: Topic<OnAfterReviewerCreateTopicParams>;\n onBeforeReviewerUpdate: Topic<OnBeforeReviewerUpdateTopicParams>;\n onAfterReviewerUpdate: Topic<OnAfterReviewerUpdateTopicParams>;\n onBeforeReviewerDelete: Topic<OnBeforeReviewerDeleteTopicParams>;\n onAfterReviewerDelete: Topic<OnAfterReviewerDeleteTopicParams>;\n}\n\nexport interface ApwCommentListParams extends ListParams {\n where: ListParams[\"where\"] & {\n changeRequest?: {\n id?: string;\n };\n };\n}\n\nexport interface ApwCommentCrud\n extends BaseApwCrud<ApwComment, CreateApwCommentParams, UpdateApwCommentParams> {\n list(params: ApwCommentListParams): Promise<[ApwComment[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onBeforeCommentCreate: Topic<OnBeforeCommentCreateTopicParams>;\n onAfterCommentCreate: Topic<OnAfterCommentCreateTopicParams>;\n onBeforeCommentUpdate: Topic<OnBeforeCommentUpdateTopicParams>;\n onAfterCommentUpdate: Topic<OnAfterCommentUpdateTopicParams>;\n onBeforeCommentDelete: Topic<OnBeforeCommentDeleteTopicParams>;\n onAfterCommentDelete: Topic<OnAfterCommentDeleteTopicParams>;\n}\n\nexport interface ApwChangeRequestListParams extends ListParams {\n where: ListParams[\"where\"] & {\n step?: string;\n };\n}\n\nexport interface ApwChangeRequestCrud\n extends BaseApwCrud<\n ApwChangeRequest,\n CreateApwChangeRequestParams,\n UpdateApwChangeRequestParams\n > {\n list(params: ApwChangeRequestListParams): Promise<[ApwChangeRequest[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onBeforeChangeRequestCreate: Topic<OnBeforeChangeRequestCreateTopicParams>;\n onAfterChangeRequestCreate: Topic<OnAfterChangeRequestCreateTopicParams>;\n onBeforeChangeRequestUpdate: Topic<OnBeforeChangeRequestUpdateTopicParams>;\n onAfterChangeRequestUpdate: Topic<OnAfterChangeRequestUpdateTopicParams>;\n onBeforeChangeRequestDelete: Topic<OnBeforeChangeRequestDeleteTopicParams>;\n onAfterChangeRequestDelete: Topic<OnAfterChangeRequestDeleteTopicParams>;\n}\n\nexport interface ApwContentReviewCrud\n extends BaseApwCrud<\n ApwContentReview,\n CreateApwContentReviewParams,\n UpdateApwContentReviewParams\n > {\n list(params: ApwContentReviewListParams): Promise<[ApwContentReview[], ListMeta]>;\n\n provideSignOff(id: string, step: string): Promise<Boolean>;\n\n retractSignOff(id: string, step: string): Promise<Boolean>;\n\n isReviewRequired(data: ApwContentReviewContent): Promise<{\n isReviewRequired: boolean;\n contentReviewId?: string | null;\n }>;\n\n publishContent(id: string, datetime?: string): Promise<Boolean>;\n\n unpublishContent(id: string, datetime?: string): Promise<Boolean>;\n\n scheduleAction(data: ApwScheduleActionData): Promise<string>;\n\n deleteScheduledAction(id: string): Promise<boolean>;\n\n /**\n * Lifecycle events\n */\n onBeforeContentReviewCreate: Topic<OnBeforeContentReviewCreateTopicParams>;\n onAfterContentReviewCreate: Topic<OnAfterContentReviewCreateTopicParams>;\n onBeforeContentReviewUpdate: Topic<OnBeforeContentReviewUpdateTopicParams>;\n onAfterContentReviewUpdate: Topic<OnAfterContentReviewUpdateTopicParams>;\n onBeforeContentReviewDelete: Topic<OnBeforeContentReviewDeleteTopicParams>;\n onAfterContentReviewDelete: Topic<OnAfterContentReviewDeleteTopicParams>;\n}\n\nexport type ContentGetter = (\n id: string,\n settings: { modelId?: string }\n) => Promise<PageWithWorkflow | ApwCmsEntry | null>;\n\nexport type ContentPublisher = (\n id: string,\n settings: { modelId?: string }\n) => Promise<Boolean | null>;\n\nexport type ContentUnPublisher = (\n id: string,\n settings: { modelId?: string }\n) => Promise<Boolean | null>;\n\nexport interface AdvancedPublishingWorkflow {\n addContentGetter: (type: ApwContentTypes, func: ContentGetter) => void;\n getContentGetter: (type: ApwContentTypes) => ContentGetter;\n addContentPublisher: (type: ApwContentTypes, func: ContentPublisher) => void;\n getContentPublisher: (type: ApwContentTypes) => ContentPublisher;\n addContentUnPublisher: (type: ApwContentTypes, func: ContentUnPublisher) => void;\n getContentUnPublisher: (type: ApwContentTypes) => ContentUnPublisher;\n workflow: ApwWorkflowCrud;\n reviewer: ApwReviewerCrud;\n comment: ApwCommentCrud;\n changeRequest: ApwChangeRequestCrud;\n contentReview: ApwContentReviewCrud;\n scheduleAction: ApwScheduleActionCrud;\n}\n\nexport interface ApwContext extends Context, CmsContext {\n apw: AdvancedPublishingWorkflow;\n pageBuilder: PageBuilderContextObject;\n wcp: WcpContextObject;\n scheduleAction: ScheduleActionContext[\"scheduleAction\"];\n}\n\nexport interface LifeCycleHookCallbackParams {\n apw: ApwContext[\"apw\"];\n security: ApwContext[\"security\"];\n cms?: ApwContext[\"cms\"];\n}\n\nexport interface CreateApwParams {\n getLocale: () => I18NLocale;\n getIdentity: () => SecurityIdentity;\n getTenant: () => Tenant;\n getPermission: (name: string) => Promise<SecurityPermission | null>;\n storageOperations: ApwStorageOperations;\n scheduler: ApwScheduleActionCrud;\n handlerClient: HandlerClient;\n plugins: PluginsContainer;\n}\n\ninterface StorageOperationsGetReviewerParams {\n id: string;\n}\n\ntype StorageOperationsListReviewersParams = ApwReviewerListParams;\n\ninterface CreateApwReviewerData {\n identityId: string;\n displayName: string | null;\n type: string;\n}\n\ninterface UpdateApwReviewerData {\n identityId: string;\n displayName: string | null;\n type: string;\n}\n\ninterface StorageOperationsCreateReviewerParams {\n data: CreateApwReviewerData;\n}\n\ninterface StorageOperationsUpdateReviewerParams {\n id: string;\n data: UpdateApwReviewerData;\n}\n\ninterface StorageOperationsDeleteReviewerParams {\n id: string;\n}\n\ninterface StorageOperationsGetParams {\n id: string;\n}\n\ninterface StorageOperationsDeleteParams {\n id: string;\n}\n\ntype StorageOperationsGetWorkflowParams = StorageOperationsGetParams;\n\ntype StorageOperationsListWorkflowsParams = ListParams;\n\ninterface StorageOperationsCreateWorkflowParams {\n data: CreateApwWorkflowParams;\n}\n\ninterface StorageOperationsUpdateWorkflowParams {\n id: string;\n data: UpdateApwWorkflowParams;\n}\n\ntype StorageOperationsDeleteWorkflowParams = StorageOperationsDeleteParams;\ntype StorageOperationsGetContentReviewParams = StorageOperationsGetParams;\n\nexport interface ApwContentReviewListParams extends ListParams {\n where?: ListWhere & {\n status?: ApwContentReviewListFilter;\n title?: string;\n title_contains?: string;\n };\n}\n\ntype StorageOperationsListContentReviewsParams = ApwContentReviewListParams;\n\ninterface StorageOperationsCreateContentReviewParams {\n data: CreateApwContentReviewParams;\n}\n\ninterface StorageOperationsUpdateContentReviewParams {\n id: string;\n data: UpdateApwContentReviewParams;\n}\n\ntype StorageOperationsDeleteContentReviewParams = StorageOperationsDeleteParams;\n\ntype StorageOperationsGetChangeRequestParams = StorageOperationsGetParams;\ntype StorageOperationsListChangeRequestsParams = ApwChangeRequestListParams;\n\ninterface StorageOperationsCreateChangeRequestParams {\n data: CreateApwChangeRequestParams;\n}\n\ninterface StorageOperationsUpdateChangeRequestParams {\n id: string;\n data: UpdateApwChangeRequestParams;\n}\n\ntype StorageOperationsDeleteChangeRequestParams = StorageOperationsDeleteParams;\n\ntype StorageOperationsGetCommentParams = StorageOperationsGetParams;\n\ntype StorageOperationsDeleteCommentParams = StorageOperationsDeleteParams;\ntype StorageOperationsListCommentsParams = ApwCommentListParams;\n\ninterface StorageOperationsCreateCommentParams {\n data: CreateApwCommentParams;\n}\n\ninterface StorageOperationsUpdateCommentParams {\n id: string;\n data: UpdateApwCommentParams;\n}\n\nexport interface ApwReviewerStorageOperations {\n /*\n * Reviewer methods\n */\n getReviewer(params: StorageOperationsGetReviewerParams): Promise<ApwReviewer>;\n\n listReviewers(params: StorageOperationsListReviewersParams): Promise<[ApwReviewer[], ListMeta]>;\n\n createReviewer(params: StorageOperationsCreateReviewerParams): Promise<ApwReviewer>;\n\n updateReviewer(params: StorageOperationsUpdateReviewerParams): Promise<ApwReviewer>;\n\n deleteReviewer(params: StorageOperationsDeleteReviewerParams): Promise<Boolean>;\n}\n\nexport interface ApwWorkflowStorageOperations {\n /*\n * Workflow methods\n */\n getWorkflow(params: StorageOperationsGetWorkflowParams): Promise<ApwWorkflow>;\n\n listWorkflows(params: StorageOperationsListWorkflowsParams): Promise<[ApwWorkflow[], ListMeta]>;\n\n createWorkflow(params: StorageOperationsCreateWorkflowParams): Promise<ApwWorkflow>;\n\n updateWorkflow(params: StorageOperationsUpdateWorkflowParams): Promise<ApwWorkflow>;\n\n deleteWorkflow(params: StorageOperationsDeleteWorkflowParams): Promise<Boolean>;\n}\n\nexport interface ApwContentReviewStorageOperations {\n /*\n * ContentReview methods\n */\n getContentReview(params: StorageOperationsGetContentReviewParams): Promise<ApwContentReview>;\n\n listContentReviews(\n params: StorageOperationsListContentReviewsParams\n ): Promise<[ApwContentReview[], ListMeta]>;\n\n createContentReview(\n params: StorageOperationsCreateContentReviewParams\n ): Promise<ApwContentReview>;\n\n updateContentReview(\n params: StorageOperationsUpdateContentReviewParams\n ): Promise<ApwContentReview>;\n\n deleteContentReview(params: StorageOperationsDeleteContentReviewParams): Promise<Boolean>;\n}\n\nexport interface ApwChangeRequestStorageOperations {\n /*\n * ChangeRequest methods\n */\n getChangeRequest(params: StorageOperationsGetChangeRequestParams): Promise<ApwChangeRequest>;\n\n listChangeRequests(\n params: StorageOperationsListChangeRequestsParams\n ): Promise<[ApwChangeRequest[], ListMeta]>;\n\n createChangeRequest(\n params: StorageOperationsCreateChangeRequestParams\n ): Promise<ApwChangeRequest>;\n\n updateChangeRequest(\n params: StorageOperationsUpdateChangeRequestParams\n ): Promise<ApwChangeRequest>;\n\n deleteChangeRequest(params: StorageOperationsDeleteChangeRequestParams): Promise<Boolean>;\n}\n\nexport interface ApwCommentStorageOperations {\n /*\n * Comment methods\n */\n getComment(params: StorageOperationsGetCommentParams): Promise<ApwComment>;\n\n listComments(params: StorageOperationsListCommentsParams): Promise<[ApwComment[], ListMeta]>;\n\n createComment(params: StorageOperationsCreateCommentParams): Promise<ApwComment>;\n\n updateComment(params: StorageOperationsUpdateCommentParams): Promise<ApwComment>;\n\n deleteComment(params: StorageOperationsDeleteCommentParams): Promise<Boolean>;\n}\n\nexport interface ApwStorageOperations\n extends ApwReviewerStorageOperations,\n ApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations,\n ApwCommentStorageOperations {}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeCommentCreateTopicParams {\n input: CreateApwCommentParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterCommentCreateTopicParams {\n comment: ApwComment;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeCommentUpdateTopicParams {\n original: ApwComment;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterCommentUpdateTopicParams {\n original: ApwComment;\n comment: ApwComment;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeCommentDeleteTopicParams {\n comment: ApwComment;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterCommentDeleteTopicParams {\n comment: ApwComment;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeChangeRequestCreateTopicParams {\n input: CreateApwChangeRequestParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterChangeRequestCreateTopicParams {\n changeRequest: ApwChangeRequest;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeChangeRequestUpdateTopicParams {\n original: ApwChangeRequest;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterChangeRequestUpdateTopicParams {\n original: ApwChangeRequest;\n changeRequest: ApwChangeRequest;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeChangeRequestDeleteTopicParams {\n changeRequest: ApwChangeRequest;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterChangeRequestDeleteTopicParams {\n changeRequest: ApwChangeRequest;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeContentReviewCreateTopicParams {\n input: CreateApwContentReviewParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterContentReviewCreateTopicParams {\n contentReview: ApwContentReview;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeContentReviewUpdateTopicParams {\n original: ApwContentReview;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterContentReviewUpdateTopicParams {\n original: ApwContentReview;\n contentReview: ApwContentReview;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeContentReviewDeleteTopicParams {\n contentReview: ApwContentReview;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterContentReviewDeleteTopicParams {\n contentReview: ApwContentReview;\n}\n\nexport interface CreateApwReviewerParams {\n type: string;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeReviewerCreateTopicParams {\n input: CreateApwReviewerParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterReviewerCreateTopicParams {\n reviewer: ApwReviewer;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeReviewerUpdateTopicParams {\n original: ApwReviewer;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterReviewerUpdateTopicParams {\n original: ApwReviewer;\n reviewer: ApwReviewer;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeReviewerDeleteTopicParams {\n reviewer: ApwReviewer;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterReviewerDeleteTopicParams {\n reviewer: ApwReviewer;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeWorkflowCreateTopicParams {\n input: CreateApwWorkflowParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterWorkflowCreateTopicParams {\n workflow: ApwWorkflow;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeWorkflowUpdateTopicParams {\n original: ApwWorkflow;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterWorkflowUpdateTopicParams {\n original: ApwWorkflow;\n workflow: ApwWorkflow;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnBeforeWorkflowDeleteTopicParams {\n workflow: ApwWorkflow;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnAfterWorkflowDeleteTopicParams {\n workflow: ApwWorkflow;\n}\n\nexport type WorkflowModelDefinition = Pick<\n CmsModel,\n \"name\" | \"modelId\" | \"layout\" | \"titleFieldId\" | \"description\" | \"fields\" | \"isPrivate\"\n>;\n\n/**\n * Headless CMS\n */\nexport interface OnBeforeCmsEntryPublishTopicParams\n extends Omit<BeforeEntryPublishTopicParams, \"entry\"> {\n entry: ApwCmsEntry;\n}\nexport interface OnAfterCmsEntryPublishTopicParams\n extends Omit<AfterEntryPublishTopicParams, \"entry\"> {\n entry: ApwCmsEntry;\n}\nexport interface OnAfterCmsEntryUnpublishTopicParams\n extends Omit<AfterEntryUnpublishTopicParams, \"entry\"> {\n entry: ApwCmsEntry;\n}\n"],"mappings":";;;;;;IAqFYA,e;;;WAAAA,e;EAAAA,e;EAAAA,e;GAAAA,e,+BAAAA,e;;IA2BAC,kB;;;WAAAA,kB;EAAAA,kB;EAAAA,kB;GAAAA,kB,kCAAAA,kB;;IAKAC,0B;;;WAAAA,0B;EAAAA,0B;EAAAA,0B;EAAAA,0B;GAAAA,0B,0CAAAA,0B;;IAMAC,uB;AAKZ;AACA;AACA;AACA;AACA;;;;WATYA,uB;EAAAA,uB;EAAAA,uB;GAAAA,uB,uCAAAA,uB;;IA8FAC,oB;;;WAAAA,oB;EAAAA,oB;EAAAA,oB;EAAAA,oB;GAAAA,oB,oCAAAA,oB;;IAMAC,sB;;;WAAAA,sB;EAAAA,sB;EAAAA,sB;EAAAA,sB;GAAAA,sB,sCAAAA,sB;;IAuEPC,sB;;WAAAA,sB;EAAAA,sB;EAAAA,sB;GAAAA,sB,KAAAA,sB"}
|
1
|
+
{"version":3,"names":["ApwContentTypes","WorkflowScopeTypes","ApwContentReviewStepStatus","ApwWorkflowApplications","ApwWorkflowStepTypes","ApwContentReviewStatus","ApwScheduleActionTypes"],"sources":["types.ts"],"sourcesContent":["import {\n CmsEntry as BaseCmsEntry,\n CmsModel,\n OnEntryBeforePublishTopicParams,\n OnEntryAfterPublishTopicParams,\n OnEntryAfterUnpublishTopicParams\n} from \"@webiny/api-headless-cms/types\";\nimport {\n Page,\n OnPageBeforeCreateTopicParams,\n OnPageBeforeCreateFromTopicParams,\n OnPageBeforeUpdateTopicParams,\n OnPageBeforePublishTopicParams,\n PageSettings\n} from \"@webiny/api-page-builder/types\";\nimport { Context } from \"@webiny/api/types\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\nimport { SecurityIdentity, SecurityPermission } from \"@webiny/api-security/types\";\nimport { I18NLocale } from \"@webiny/api-i18n/types\";\nimport { Tenant } from \"@webiny/api-tenancy/types\";\nimport { Topic } from \"@webiny/pubsub/types\";\nimport { ApwScheduleActionCrud, ScheduleActionContext } from \"~/scheduler/types\";\nimport HandlerClient from \"@webiny/handler-client/HandlerClient\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { WcpContextObject } from \"@webiny/api-wcp/types\";\nimport { MailerContext } from \"@webiny/api-mailer/types\";\nimport { AdminSettingsContext } from \"@webiny/api-admin-settings/types\";\n\nexport interface ApwCmsEntry extends BaseCmsEntry {\n title: string;\n meta: {\n apw?: {\n contentReviewId?: string | null;\n workflowId?: string | null;\n };\n };\n}\n\nexport interface ApwFile {\n id: string;\n key: string;\n size: number;\n type: string;\n name: string;\n}\n\nexport interface ListWhere {\n /**\n * Fields.\n */\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n /**\n * Who created the entry?\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n}\n\nexport interface ListParams {\n where?: ListWhere;\n sort?: string[];\n limit?: number;\n after?: string | null;\n}\n\nexport interface ListMeta {\n /**\n * A cursor for pagination.\n */\n cursor: string | null;\n /**\n * Is there more items to load?\n */\n hasMoreItems: boolean;\n /**\n * Total count of the items in the storage.\n */\n totalCount: number;\n}\n\nexport enum ApwContentTypes {\n PAGE = \"page\",\n CMS_ENTRY = \"cms_entry\"\n}\n\nexport interface PageSettingsWithWorkflow extends PageSettings {\n apw: {\n workflowId: string;\n contentReviewId: string | null;\n };\n}\nexport interface PageWithWorkflow extends Page {\n settings: PageSettingsWithWorkflow;\n}\n\nexport type ApwOnPageBeforeCreateTopicParams = OnPageBeforeCreateTopicParams<PageWithWorkflow>;\n\nexport type ApwOnPageBeforeCreateFromTopicParams =\n OnPageBeforeCreateFromTopicParams<PageWithWorkflow>;\n\nexport type ApwOnPageBeforeUpdateTopicParams = OnPageBeforeUpdateTopicParams<PageWithWorkflow>;\n\nexport type ApwOnPageBeforePublishTopicParams = OnPageBeforePublishTopicParams<PageWithWorkflow>;\n\nexport enum WorkflowScopeTypes {\n DEFAULT = \"default\",\n CUSTOM = \"custom\"\n}\n\nexport enum ApwContentReviewStepStatus {\n DONE = \"done\",\n ACTIVE = \"active\",\n INACTIVE = \"inactive\"\n}\n\nexport enum ApwWorkflowApplications {\n PB = \"pageBuilder\",\n CMS = \"cms\"\n}\n\n/**\n * A interface describing the reference to a user that created some data in the database.\n *\n * @category General\n */\nexport interface CreatedBy {\n /**\n * ID if the user.\n */\n id: string;\n /**\n * Full name of the user.\n */\n displayName: string | null;\n /**\n * Type of the user (admin, user)\n */\n type: string;\n}\n\nexport interface ApwBaseFields {\n id: string;\n entryId: string;\n createdOn: string;\n savedOn: string;\n createdBy: CreatedBy;\n}\n\nexport interface ApwReviewer extends ApwBaseFields {\n identityId: string;\n displayName: string | null;\n type: string;\n email?: string;\n}\nexport interface ApwReviewerWithEmail extends Omit<ApwReviewer, \"email\"> {\n email: string;\n}\n\nexport interface ApwComment extends ApwBaseFields {\n body: Record<string, any>;\n changeRequest: string;\n step: string;\n media: ApwFile;\n}\n\nexport interface ApwChangeRequest extends ApwBaseFields {\n body: Record<string, any>;\n title: string;\n resolved: boolean;\n step: string;\n media: ApwFile;\n}\n\nexport interface ApwContentReviewStep {\n type: ApwWorkflowStepTypes;\n title: string;\n slug: string;\n reviewers: ApwReviewer[];\n status: ApwContentReviewStepStatus;\n pendingChangeRequests: number;\n totalComments: number;\n signOffProvidedOn: string | null;\n signOffProvidedBy: CreatedBy | null;\n}\n\nexport interface ApwContentReview extends ApwBaseFields {\n title: string;\n reviewStatus: ApwContentReviewStatus;\n content: ApwContentReviewContent;\n steps: Array<ApwContentReviewStep>;\n latestCommentId: string | null;\n workflowId: string;\n}\n\nexport interface ApwWorkflow extends ApwBaseFields {\n title: string;\n steps: ApwWorkflowStep[];\n scope: ApwWorkflowScope;\n app: ApwWorkflowApplications;\n}\n\ninterface ApwWorkflowScopeCmsEntry {\n id: string;\n modelId: string;\n}\nexport interface ApwWorkflowScope {\n type: WorkflowScopeTypes;\n data: {\n categories?: string[];\n pages?: string[];\n models?: string[];\n entries?: ApwWorkflowScopeCmsEntry[];\n };\n}\n\nexport enum ApwWorkflowStepTypes {\n MANDATORY_BLOCKING = \"mandatoryBlocking\",\n MANDATORY_NON_BLOCKING = \"mandatoryNonBlocking\",\n NON_MANDATORY = \"notMandatory\"\n}\n\nexport enum ApwContentReviewStatus {\n UNDER_REVIEW = \"underReview\",\n READY_TO_BE_PUBLISHED = \"readyToBePublished\",\n PUBLISHED = \"published\"\n}\n\nexport type ApwContentReviewListFilter = ApwContentReviewStatus | \"requiresMyAttention\";\n\nexport interface ApwWorkflowStep<TReviewer = ApwReviewer> {\n title: string;\n type: ApwWorkflowStepTypes;\n reviewers: TReviewer[];\n id: string;\n}\n\nexport interface ApwContentReviewStep extends ApwWorkflowStep {\n status: ApwContentReviewStepStatus;\n pendingChangeRequests: number;\n}\n\nexport interface CreateApwWorkflowParams<TReviewer = string> {\n app: ApwWorkflowApplications;\n title: string;\n scope: ApwWorkflowScope;\n steps: ApwWorkflowStep<TReviewer>[];\n}\n\nexport interface UpdateApwWorkflowParams<TReviewer = string> {\n title?: string;\n scope?: ApwWorkflowScope;\n steps?: ApwWorkflowStep<TReviewer>[];\n}\n\nexport interface ListWorkflowsParams extends ListParams {\n where?: ListWhere & {\n app?: ApwWorkflowApplications;\n };\n}\n\ninterface CreateApwCommentParams {\n body: Record<string, any>;\n changeRequest: string;\n step: string;\n media: ApwFile;\n}\n\ninterface UpdateApwCommentParams {\n body: Record<string, any>;\n}\n\ninterface CreateApwChangeRequestParams {\n title: string;\n step: string;\n body: Record<string, any>;\n resolved: boolean;\n media: Record<string, any>;\n}\n\ninterface UpdateApwChangeRequestParams {\n title: string;\n body: Record<string, any>;\n resolved: boolean;\n media: Record<string, any>;\n}\n\nenum ApwScheduleActionTypes {\n PUBLISH = \"publish\",\n UNPUBLISH = \"unpublish\"\n}\n\nexport interface ApwScheduleActionData {\n action: ApwScheduleActionTypes;\n type: ApwContentTypes;\n datetime: string;\n entryId: string;\n /**\n * We will add modelId to the data for now.\n * TODO extract in separate package?\n */\n modelId?: string;\n}\n\nexport interface ApwContentReviewContent {\n id: string;\n type: ApwContentTypes;\n settings: {\n modelId?: string;\n };\n scheduledOn?: string | null;\n scheduledBy?: string | null;\n scheduledActionId?: string | null;\n publishedBy?: string | null;\n}\n\nexport interface CreateApwContentReviewParams {\n content: ApwContentReviewContent;\n reviewStatus: ApwContentReviewStatus;\n workflowId?: string;\n}\n\nexport interface UpdateApwContentReviewParams {\n title?: string;\n steps?: ApwContentReviewStep[];\n reviewStatus?: ApwContentReviewStatus;\n content?: ApwContentReviewContent;\n}\n\ninterface BaseApwCrud<TEntry, TCreateEntryParams, TUpdateEntryParams> {\n get(id: string): Promise<TEntry>;\n\n create(data: TCreateEntryParams): Promise<TEntry>;\n\n update(id: string, data: TUpdateEntryParams): Promise<TEntry>;\n\n delete(id: string): Promise<Boolean>;\n}\n\nexport interface ApwWorkflowCrud\n extends BaseApwCrud<ApwWorkflow, CreateApwWorkflowParams, UpdateApwWorkflowParams> {\n list(params?: ListWorkflowsParams): Promise<[ApwWorkflow[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onWorkflowBeforeCreate: Topic<OnWorkflowBeforeCreateTopicParams>;\n onWorkflowAfterCreate: Topic<OnWorkflowAfterCreateTopicParams>;\n onWorkflowBeforeUpdate: Topic<OnWorkflowBeforeUpdateTopicParams>;\n onWorkflowAfterUpdate: Topic<OnWorkflowAfterUpdateTopicParams>;\n onWorkflowBeforeDelete: Topic<OnWorkflowBeforeDeleteTopicParams>;\n onWorkflowAfterDelete: Topic<OnWorkflowAfterDeleteTopicParams>;\n}\n\nexport interface ApwReviewerListParams extends ListParams {\n where: ListParams[\"where\"] & {\n identityId?: string;\n };\n}\n\nexport interface ApwReviewerCrud\n extends BaseApwCrud<ApwReviewer, CreateApwReviewerData, UpdateApwReviewerData> {\n list(params: ApwReviewerListParams): Promise<[ApwReviewer[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onReviewerBeforeCreate: Topic<OnReviewerBeforeCreateTopicParams>;\n onReviewerAfterCreate: Topic<OnReviewerAfterCreateTopicParams>;\n onReviewerBeforeUpdate: Topic<OnReviewerBeforeUpdateTopicParams>;\n onReviewerAfterUpdate: Topic<OnReviewerAfterUpdateTopicParams>;\n onReviewerBeforeDelete: Topic<OnReviewerBeforeDeleteTopicParams>;\n onReviewerAfterDelete: Topic<OnReviewerAfterDeleteTopicParams>;\n}\n\nexport interface ApwCommentListParams extends ListParams {\n where: ListParams[\"where\"] & {\n changeRequest?: {\n id?: string;\n };\n };\n}\n\nexport interface ApwCommentCrud\n extends BaseApwCrud<ApwComment, CreateApwCommentParams, UpdateApwCommentParams> {\n list(params: ApwCommentListParams): Promise<[ApwComment[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onCommentBeforeCreate: Topic<OnCommentBeforeCreateTopicParams>;\n onCommentAfterCreate: Topic<OnCommentAfterCreateTopicParams>;\n onCommentBeforeUpdate: Topic<OnCommentBeforeUpdateTopicParams>;\n onCommentAfterUpdate: Topic<OnCommentAfterUpdateTopicParams>;\n onCommentBeforeDelete: Topic<OnCommentBeforeDeleteTopicParams>;\n onCommentAfterDelete: Topic<OnCommentAfterDeleteTopicParams>;\n}\n\nexport interface ApwChangeRequestListParams extends ListParams {\n where: ListParams[\"where\"] & {\n step?: string;\n };\n}\n\nexport interface ApwChangeRequestCrud\n extends BaseApwCrud<\n ApwChangeRequest,\n CreateApwChangeRequestParams,\n UpdateApwChangeRequestParams\n > {\n list(params: ApwChangeRequestListParams): Promise<[ApwChangeRequest[], ListMeta]>;\n\n /**\n * Lifecycle events\n */\n onChangeRequestBeforeCreate: Topic<OnChangeRequestBeforeCreateTopicParams>;\n onChangeRequestAfterCreate: Topic<OnChangeRequestAfterCreateTopicParams>;\n onChangeRequestBeforeUpdate: Topic<OnChangeRequestBeforeUpdateTopicParams>;\n onChangeRequestAfterUpdate: Topic<OnChangeRequestAfterUpdateTopicParams>;\n onChangeRequestBeforeDelete: Topic<OnChangeRequestBeforeDeleteTopicParams>;\n onChangeRequestAfterDelete: Topic<OnChangeRequestAfterDeleteTopicParams>;\n}\n\nexport interface ApwContentReviewCrud\n extends BaseApwCrud<\n ApwContentReview,\n CreateApwContentReviewParams,\n UpdateApwContentReviewParams\n > {\n list(params: ApwContentReviewListParams): Promise<[ApwContentReview[], ListMeta]>;\n\n provideSignOff(id: string, step: string): Promise<Boolean>;\n\n retractSignOff(id: string, step: string): Promise<Boolean>;\n\n isReviewRequired(data: ApwContentReviewContent): Promise<{\n isReviewRequired: boolean;\n contentReviewId?: string | null;\n }>;\n\n publishContent(id: string, datetime?: string): Promise<Boolean>;\n\n unpublishContent(id: string, datetime?: string): Promise<Boolean>;\n\n scheduleAction(data: ApwScheduleActionData): Promise<string>;\n\n deleteScheduledAction(id: string): Promise<boolean>;\n\n /**\n * Lifecycle events\n */\n onContentReviewBeforeCreate: Topic<OnContentReviewBeforeCreateTopicParams>;\n onContentReviewAfterCreate: Topic<OnContentReviewAfterCreateTopicParams>;\n onContentReviewBeforeUpdate: Topic<OnContentReviewBeforeUpdateTopicParams>;\n onContentReviewAfterUpdate: Topic<OnContentReviewAfterUpdateTopicParams>;\n onContentReviewBeforeDelete: Topic<OnContentReviewBeforeDeleteTopicParams>;\n onContentReviewAfterDelete: Topic<OnContentReviewAfterDeleteTopicParams>;\n onContentReviewBeforeList: Topic<OnContentReviewBeforeListTopicParams>;\n}\n\nexport type ContentGetter = (\n id: string,\n settings: { modelId?: string }\n) => Promise<PageWithWorkflow | ApwCmsEntry | null>;\n\nexport type ContentPublisher = (\n id: string,\n settings: { modelId?: string }\n) => Promise<Boolean | null>;\n\nexport type ContentUnPublisher = (\n id: string,\n settings: { modelId?: string }\n) => Promise<Boolean | null>;\n\nexport interface AdvancedPublishingWorkflow {\n addContentGetter: (type: ApwContentTypes, func: ContentGetter) => void;\n getContentGetter: (type: ApwContentTypes) => ContentGetter;\n addContentPublisher: (type: ApwContentTypes, func: ContentPublisher) => void;\n getContentPublisher: (type: ApwContentTypes) => ContentPublisher;\n addContentUnPublisher: (type: ApwContentTypes, func: ContentUnPublisher) => void;\n getContentUnPublisher: (type: ApwContentTypes) => ContentUnPublisher;\n workflow: ApwWorkflowCrud;\n reviewer: ApwReviewerCrud;\n comment: ApwCommentCrud;\n changeRequest: ApwChangeRequestCrud;\n contentReview: ApwContentReviewCrud;\n scheduleAction: ApwScheduleActionCrud;\n}\n\nexport interface ApwContext extends Context, MailerContext, AdminSettingsContext {\n apw: AdvancedPublishingWorkflow;\n pageBuilder: PageBuilderContextObject;\n wcp: WcpContextObject;\n scheduleAction: ScheduleActionContext[\"scheduleAction\"];\n}\n\nexport interface LifeCycleHookCallbackParams {\n apw: ApwContext[\"apw\"];\n security: ApwContext[\"security\"];\n cms?: ApwContext[\"cms\"];\n}\n\nexport interface CreateApwParams {\n getLocale: () => I18NLocale;\n getIdentity: () => SecurityIdentity;\n getTenant: () => Tenant;\n getPermission: (name: string) => Promise<SecurityPermission | null>;\n storageOperations: ApwStorageOperations;\n scheduler: ApwScheduleActionCrud;\n handlerClient: HandlerClient;\n plugins: PluginsContainer;\n}\n\ninterface StorageOperationsGetReviewerParams {\n id: string;\n}\n\ntype StorageOperationsListReviewersParams = ApwReviewerListParams;\n\ninterface CreateApwReviewerData {\n identityId: string;\n displayName: string | null;\n type: string;\n email?: string | null;\n}\n\ninterface UpdateApwReviewerData {\n identityId: string;\n displayName: string | null;\n type: string;\n email?: string | null;\n}\n\ninterface StorageOperationsCreateReviewerParams {\n data: CreateApwReviewerData;\n}\n\ninterface StorageOperationsUpdateReviewerParams {\n id: string;\n data: UpdateApwReviewerData;\n}\n\ninterface StorageOperationsDeleteReviewerParams {\n id: string;\n}\n\ninterface StorageOperationsGetParams {\n id: string;\n}\n\ninterface StorageOperationsDeleteParams {\n id: string;\n}\n\ntype StorageOperationsGetWorkflowParams = StorageOperationsGetParams;\n\ntype StorageOperationsListWorkflowsParams = ListParams;\n\ninterface StorageOperationsCreateWorkflowParams {\n data: CreateApwWorkflowParams;\n}\n\ninterface StorageOperationsUpdateWorkflowParams {\n id: string;\n data: UpdateApwWorkflowParams;\n}\n\ntype StorageOperationsDeleteWorkflowParams = StorageOperationsDeleteParams;\ntype StorageOperationsGetContentReviewParams = StorageOperationsGetParams;\n\nexport interface ApwContentReviewListParams extends ListParams {\n where: ListWhere & {\n reviewStatus?: ApwContentReviewListFilter;\n title?: string;\n title_contains?: string;\n workflowId?: string;\n workflowId_in?: string[];\n };\n}\n\ntype StorageOperationsListContentReviewsParams = ApwContentReviewListParams;\n\ninterface StorageOperationsCreateContentReviewParams {\n data: CreateApwContentReviewParams;\n}\n\ninterface StorageOperationsUpdateContentReviewParams {\n id: string;\n data: UpdateApwContentReviewParams;\n}\n\ntype StorageOperationsDeleteContentReviewParams = StorageOperationsDeleteParams;\n\ntype StorageOperationsGetChangeRequestParams = StorageOperationsGetParams;\ntype StorageOperationsListChangeRequestsParams = ApwChangeRequestListParams;\n\ninterface StorageOperationsCreateChangeRequestParams {\n data: CreateApwChangeRequestParams;\n}\n\ninterface StorageOperationsUpdateChangeRequestParams {\n id: string;\n data: UpdateApwChangeRequestParams;\n}\n\ntype StorageOperationsDeleteChangeRequestParams = StorageOperationsDeleteParams;\n\ntype StorageOperationsGetCommentParams = StorageOperationsGetParams;\n\ntype StorageOperationsDeleteCommentParams = StorageOperationsDeleteParams;\ntype StorageOperationsListCommentsParams = ApwCommentListParams;\n\ninterface StorageOperationsCreateCommentParams {\n data: CreateApwCommentParams;\n}\n\ninterface StorageOperationsUpdateCommentParams {\n id: string;\n data: UpdateApwCommentParams;\n}\n\nexport interface ApwReviewerStorageOperations {\n /*\n * Reviewer methods\n */\n getReviewer(params: StorageOperationsGetReviewerParams): Promise<ApwReviewer>;\n\n listReviewers(params: StorageOperationsListReviewersParams): Promise<[ApwReviewer[], ListMeta]>;\n\n createReviewer(params: StorageOperationsCreateReviewerParams): Promise<ApwReviewer>;\n\n updateReviewer(params: StorageOperationsUpdateReviewerParams): Promise<ApwReviewer>;\n\n deleteReviewer(params: StorageOperationsDeleteReviewerParams): Promise<Boolean>;\n}\n\nexport interface ApwWorkflowStorageOperations {\n /*\n * Workflow methods\n */\n getWorkflow(params: StorageOperationsGetWorkflowParams): Promise<ApwWorkflow>;\n\n listWorkflows(params: StorageOperationsListWorkflowsParams): Promise<[ApwWorkflow[], ListMeta]>;\n\n createWorkflow(params: StorageOperationsCreateWorkflowParams): Promise<ApwWorkflow>;\n\n updateWorkflow(params: StorageOperationsUpdateWorkflowParams): Promise<ApwWorkflow>;\n\n deleteWorkflow(params: StorageOperationsDeleteWorkflowParams): Promise<Boolean>;\n}\n\nexport interface ApwContentReviewStorageOperations {\n /*\n * ContentReview methods\n */\n getContentReview(params: StorageOperationsGetContentReviewParams): Promise<ApwContentReview>;\n\n listContentReviews(\n params: StorageOperationsListContentReviewsParams\n ): Promise<[ApwContentReview[], ListMeta]>;\n\n createContentReview(\n params: StorageOperationsCreateContentReviewParams\n ): Promise<ApwContentReview>;\n\n updateContentReview(\n params: StorageOperationsUpdateContentReviewParams\n ): Promise<ApwContentReview>;\n\n deleteContentReview(params: StorageOperationsDeleteContentReviewParams): Promise<Boolean>;\n}\n\nexport interface ApwChangeRequestStorageOperations {\n /*\n * ChangeRequest methods\n */\n getChangeRequest(params: StorageOperationsGetChangeRequestParams): Promise<ApwChangeRequest>;\n\n listChangeRequests(\n params: StorageOperationsListChangeRequestsParams\n ): Promise<[ApwChangeRequest[], ListMeta]>;\n\n createChangeRequest(\n params: StorageOperationsCreateChangeRequestParams\n ): Promise<ApwChangeRequest>;\n\n updateChangeRequest(\n params: StorageOperationsUpdateChangeRequestParams\n ): Promise<ApwChangeRequest>;\n\n deleteChangeRequest(params: StorageOperationsDeleteChangeRequestParams): Promise<Boolean>;\n}\n\nexport interface ApwCommentStorageOperations {\n /*\n * Comment methods\n */\n getComment(params: StorageOperationsGetCommentParams): Promise<ApwComment>;\n\n listComments(params: StorageOperationsListCommentsParams): Promise<[ApwComment[], ListMeta]>;\n\n createComment(params: StorageOperationsCreateCommentParams): Promise<ApwComment>;\n\n updateComment(params: StorageOperationsUpdateCommentParams): Promise<ApwComment>;\n\n deleteComment(params: StorageOperationsDeleteCommentParams): Promise<Boolean>;\n}\n\nexport interface ApwStorageOperations\n extends ApwReviewerStorageOperations,\n ApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations,\n ApwCommentStorageOperations {}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnCommentBeforeCreateTopicParams {\n input: CreateApwCommentParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnCommentAfterCreateTopicParams {\n comment: ApwComment;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnCommentBeforeUpdateTopicParams {\n original: ApwComment;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnCommentAfterUpdateTopicParams {\n original: ApwComment;\n comment: ApwComment;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnCommentBeforeDeleteTopicParams {\n comment: ApwComment;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnCommentAfterDeleteTopicParams {\n comment: ApwComment;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnChangeRequestBeforeCreateTopicParams {\n input: CreateApwChangeRequestParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnChangeRequestAfterCreateTopicParams {\n changeRequest: ApwChangeRequest;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnChangeRequestBeforeUpdateTopicParams {\n original: ApwChangeRequest;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnChangeRequestAfterUpdateTopicParams {\n original: ApwChangeRequest;\n changeRequest: ApwChangeRequest;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnChangeRequestBeforeDeleteTopicParams {\n changeRequest: ApwChangeRequest;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnChangeRequestAfterDeleteTopicParams {\n changeRequest: ApwChangeRequest;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnContentReviewBeforeCreateTopicParams {\n input: CreateApwContentReviewParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnContentReviewAfterCreateTopicParams {\n contentReview: ApwContentReview;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnContentReviewBeforeUpdateTopicParams {\n original: ApwContentReview;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnContentReviewAfterUpdateTopicParams {\n original: ApwContentReview;\n contentReview: ApwContentReview;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnContentReviewBeforeDeleteTopicParams {\n contentReview: ApwContentReview;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnContentReviewAfterDeleteTopicParams {\n contentReview: ApwContentReview;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnContentReviewBeforeListTopicParams {\n where: ApwContentReviewListParams[\"where\"];\n}\n\nexport interface CreateApwReviewerParams {\n type: string;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnReviewerBeforeCreateTopicParams {\n input: CreateApwReviewerParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnReviewerAfterCreateTopicParams {\n reviewer: ApwReviewer;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnReviewerBeforeUpdateTopicParams {\n original: ApwReviewer;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnReviewerAfterUpdateTopicParams {\n original: ApwReviewer;\n reviewer: ApwReviewer;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnReviewerBeforeDeleteTopicParams {\n reviewer: ApwReviewer;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnReviewerAfterDeleteTopicParams {\n reviewer: ApwReviewer;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnWorkflowBeforeCreateTopicParams {\n input: CreateApwWorkflowParams;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnWorkflowAfterCreateTopicParams {\n workflow: ApwWorkflow;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnWorkflowBeforeUpdateTopicParams {\n original: ApwWorkflow;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnWorkflowAfterUpdateTopicParams {\n original: ApwWorkflow;\n workflow: ApwWorkflow;\n input: Record<string, any>;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnWorkflowBeforeDeleteTopicParams {\n workflow: ApwWorkflow;\n}\n\n/**\n * @category Lifecycle events\n */\nexport interface OnWorkflowAfterDeleteTopicParams {\n workflow: ApwWorkflow;\n}\n\nexport type WorkflowModelDefinition = Pick<\n CmsModel,\n \"name\" | \"modelId\" | \"layout\" | \"titleFieldId\" | \"description\" | \"fields\" | \"isPrivate\"\n>;\n\n/**\n * Headless CMS\n */\nexport interface OnCmsEntryBeforePublishTopicParams\n extends Omit<OnEntryBeforePublishTopicParams, \"entry\"> {\n entry: ApwCmsEntry;\n}\nexport interface OnCmsEntryAfterPublishTopicParams\n extends Omit<OnEntryAfterPublishTopicParams, \"entry\"> {\n entry: ApwCmsEntry;\n}\nexport interface OnCmsEntryAfterUnpublishTopicParams\n extends Omit<OnEntryAfterUnpublishTopicParams, \"entry\"> {\n entry: ApwCmsEntry;\n}\n"],"mappings":";;;;;;IAqFYA,e;;;WAAAA,e;EAAAA,e;EAAAA,e;GAAAA,e,+BAAAA,e;;IAwBAC,kB;;;WAAAA,kB;EAAAA,kB;EAAAA,kB;GAAAA,kB,kCAAAA,kB;;IAKAC,0B;;;WAAAA,0B;EAAAA,0B;EAAAA,0B;EAAAA,0B;GAAAA,0B,0CAAAA,0B;;IAMAC,uB;AAKZ;AACA;AACA;AACA;AACA;;;;WATYA,uB;EAAAA,uB;EAAAA,uB;GAAAA,uB,uCAAAA,uB;;IAoGAC,oB;;;WAAAA,oB;EAAAA,oB;EAAAA,oB;EAAAA,oB;GAAAA,oB,oCAAAA,oB;;IAMAC,sB;;;WAAAA,sB;EAAAA,sB;EAAAA,sB;EAAAA,sB;GAAAA,sB,sCAAAA,sB;;IAiEPC,sB;;WAAAA,sB;EAAAA,sB;EAAAA,sB;GAAAA,sB,KAAAA,sB"}
|
package/utils/errors.js
CHANGED