@webiny/api-apw 5.41.4 → 5.42.0-beta.1
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/crud/createContentReviewMethods.js +1 -2
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/index.js.map +1 -1
- package/crud/utils.js.map +1 -1
- package/package.json +31 -38
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +1 -1
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +10 -11
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
- package/plugins/pageBuilder/triggerContentReview.js +2 -3
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +2 -4
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.js +4 -5
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.js +6 -5
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +63 -38
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.js.map +1 -1
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwQuery","getChangeRequest","_","args","context","resolve","apw","changeRequest","get","id","listChangeRequests","entries","meta","list","ListResponse","e","ErrorResponse","ApwMutation","createChangeRequest","create","data","updateChangeRequest","update","deleteChangeRequest","delete","_default","exports","default"],"sources":["changeRequest.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwChangeRequestListParams, ApwContext } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwChangeRequestListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ChangeRequest specific fields\n step: String!\n title: String!\n body: JSON!\n resolved: Boolean\n media: JSON\n }\n\n type ApwListChangeRequestsResponse {\n data: [ApwChangeRequestListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwChangeRequest {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ChangeRequest specific fields\n step: String!\n title: String!\n body: JSON!\n resolved: Boolean\n media: JSON\n }\n\n type ApwChangeRequestResponse {\n data: ApwChangeRequest\n error: ApwError\n }\n\n type ApwDeleteChangeRequestResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListChangeRequestSort {\n id_ASC\n id_DESC\n \n ${dateTimeFieldsSorters}\n \n publishedOn_ASC\n publishedOn_DESC\n \n title_ASC\n title_DESC\n }\n\n input ApwCreateChangeRequestInput {\n step: String!\n title: String!\n body: JSON!\n resolved: Boolean\n media: JSON\n }\n\n input ApwUpdateChangeRequestInput {\n title: String\n body: JSON\n resolved: Boolean\n media: JSON\n }\n\n input ApwListChangeRequestWhereInput {\n id: ID\n step: String\n }\n\n input ApwListChangeRequestSearchInput {\n query: String\n }\n\n extend type ApwQuery {\n getChangeRequest(id: ID!): ApwChangeRequestResponse\n\n listChangeRequests(\n where: ApwListChangeRequestWhereInput\n limit: Int\n after: String\n sort: [ApwListChangeRequestSort!]\n search: ApwListChangeRequestSearchInput\n ): ApwListChangeRequestsResponse\n }\n\n extend type ApwMutation {\n createChangeRequest(data: ApwCreateChangeRequestInput!): ApwChangeRequestResponse\n\n updateChangeRequest(\n id: ID!\n data: ApwUpdateChangeRequestInput!\n ): ApwChangeRequestResponse\n\n deleteChangeRequest(id: ID!): ApwDeleteChangeRequestResponse\n }\n `,\n resolvers: {\n ApwQuery: {\n getChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.get(args.id));\n },\n listChangeRequests: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwChangeRequestListParams.\n */\n const [entries, meta] = await context.apw.changeRequest.list(\n args as unknown as ApwChangeRequestListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n },\n ApwMutation: {\n createChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.create(args.data));\n },\n updateChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.update(args.id, args.data));\n },\n deleteChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.delete(args.id));\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAG,IAAIC,4BAAmB,CAAa;EACvD;EACAC,QAAQ,
|
1
|
+
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwQuery","getChangeRequest","_","args","context","resolve","apw","changeRequest","get","id","listChangeRequests","entries","meta","list","ListResponse","e","ErrorResponse","ApwMutation","createChangeRequest","create","data","updateChangeRequest","update","deleteChangeRequest","delete","_default","exports","default"],"sources":["changeRequest.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwChangeRequestListParams, ApwContext } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwChangeRequestListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ChangeRequest specific fields\n step: String!\n title: String!\n body: JSON!\n resolved: Boolean\n media: JSON\n }\n\n type ApwListChangeRequestsResponse {\n data: [ApwChangeRequestListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwChangeRequest {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ChangeRequest specific fields\n step: String!\n title: String!\n body: JSON!\n resolved: Boolean\n media: JSON\n }\n\n type ApwChangeRequestResponse {\n data: ApwChangeRequest\n error: ApwError\n }\n\n type ApwDeleteChangeRequestResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListChangeRequestSort {\n id_ASC\n id_DESC\n \n ${dateTimeFieldsSorters}\n \n publishedOn_ASC\n publishedOn_DESC\n \n title_ASC\n title_DESC\n }\n\n input ApwCreateChangeRequestInput {\n step: String!\n title: String!\n body: JSON!\n resolved: Boolean\n media: JSON\n }\n\n input ApwUpdateChangeRequestInput {\n title: String\n body: JSON\n resolved: Boolean\n media: JSON\n }\n\n input ApwListChangeRequestWhereInput {\n id: ID\n step: String\n }\n\n input ApwListChangeRequestSearchInput {\n query: String\n }\n\n extend type ApwQuery {\n getChangeRequest(id: ID!): ApwChangeRequestResponse\n\n listChangeRequests(\n where: ApwListChangeRequestWhereInput\n limit: Int\n after: String\n sort: [ApwListChangeRequestSort!]\n search: ApwListChangeRequestSearchInput\n ): ApwListChangeRequestsResponse\n }\n\n extend type ApwMutation {\n createChangeRequest(data: ApwCreateChangeRequestInput!): ApwChangeRequestResponse\n\n updateChangeRequest(\n id: ID!\n data: ApwUpdateChangeRequestInput!\n ): ApwChangeRequestResponse\n\n deleteChangeRequest(id: ID!): ApwDeleteChangeRequestResponse\n }\n `,\n resolvers: {\n ApwQuery: {\n getChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.get(args.id));\n },\n listChangeRequests: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwChangeRequestListParams.\n */\n const [entries, meta] = await context.apw.changeRequest.list(\n args as unknown as ApwChangeRequestListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n },\n ApwMutation: {\n createChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.create(args.data));\n },\n updateChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.update(args.id, args.data));\n },\n deleteChangeRequest: async (_, args: any, context) => {\n return resolve(() => context.apw.changeRequest.delete(args.id));\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAG,IAAIC,4BAAmB,CAAa;EACvD;EACAC,QAAQ,EAAE;AACd;AACA;AACA;AACA;AACA,cAAcC,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcA,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcC,4BAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;EACDC,SAAS,EAAE;IACPC,QAAQ,EAAE;MACNC,gBAAgB,EAAE,MAAAA,CAAOC,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC/C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,aAAa,CAACC,GAAG,CAACL,IAAI,CAACM,EAAE,CAAC,CAAC;MAChE,CAAC;MACDC,kBAAkB,EAAE,MAAAA,CAAOR,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QACjD,IAAI;UACA;AACpB;AACA;UACoB,MAAM,CAACO,OAAO,EAAEC,IAAI,CAAC,GAAG,MAAMR,OAAO,CAACE,GAAG,CAACC,aAAa,CAACM,IAAI,CACxDV,IACJ,CAAC;UACD,OAAO,IAAIW,4BAAY,CAACH,OAAO,EAAEC,IAAI,CAAC;QAC1C,CAAC,CAAC,OAAOG,CAAC,EAAE;UACR,OAAO,IAAIC,6BAAa,CAACD,CAAC,CAAC;QAC/B;MACJ;IACJ,CAAC;IACDE,WAAW,EAAE;MACTC,mBAAmB,EAAE,MAAAA,CAAOhB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAClD,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,aAAa,CAACY,MAAM,CAAChB,IAAI,CAACiB,IAAI,CAAC,CAAC;MACrE,CAAC;MACDC,mBAAmB,EAAE,MAAAA,CAAOnB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAClD,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,aAAa,CAACe,MAAM,CAACnB,IAAI,CAACM,EAAE,EAAEN,IAAI,CAACiB,IAAI,CAAC,CAAC;MAC9E,CAAC;MACDG,mBAAmB,EAAE,MAAAA,CAAOrB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAClD,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,aAAa,CAACiB,MAAM,CAACrB,IAAI,CAACM,EAAE,CAAC,CAAC;MACnE;IACJ;EACJ;AACJ,CAAC,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYjC,cAAc","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","metaFieldsBaseNames","dateTimeWhereFields","map","name","join","identityWhereFields","onByFields","dateTimeFieldsSorters","resolvers","ApwQuery","getComment","_","args","context","resolve","apw","comment","get","id","listComments","entries","meta","list","ListResponse","e","ErrorResponse","ApwMutation","createComment","create","data","updateComment","update","deleteComment","delete","_default","exports","default"],"sources":["comment.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwContext, ApwCommentListParams } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: () => {\n const metaFieldsBaseNames = [\"created\", \"modified\", \"saved\"];\n\n const dateTimeWhereFields = metaFieldsBaseNames\n .map(name => {\n return `\n ${name}On: DateTime\n ${name}On_gt: DateTime\n ${name}On_gte: DateTime\n ${name}On_lt: DateTime\n ${name}On_lte: DateTime\n ${name}On_between: [DateTime!]\n ${name}On_not_between: [DateTime!]\n `;\n })\n .join(\"\\n\");\n\n const identityWhereFields = metaFieldsBaseNames\n .map(name => {\n return `\n ${name}By: ID\n ${name}By_not: ID\n ${name}By_in: [ID!]\n ${name}By_not_in: [ID!]\n `;\n })\n .join(\"\\n\");\n\n return [\n `\n type ApwCommentListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Comment specific fields\n body: JSON\n changeRequest: ID\n # TODO: Remove ApwRefField\n media: JSON\n }\n\n type ApwListCommentsResponse {\n data: [ApwCommentListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwComment {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Comment specific fields\n body: JSON\n changeRequest: ID\n media: JSON\n }\n\n type ApwCommentResponse {\n data: ApwComment\n error: ApwError\n }\n\n type ApwDeleteCommentResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListCommentsSort {\n id_ASC\n id_DESC\n \n ${dateTimeFieldsSorters}\n }\n\n input ApwCreateCommentInput {\n body: JSON!\n changeRequest: ID!\n media: JSON\n }\n\n input ApwUpdateCommentInput {\n body: JSON!\n }\n\n input ApwListCommentsWhereInput {\n id: ID\n id_not: ID\n id_in: [ID!]\n id_not_in: [ID!]\n \n ${dateTimeWhereFields}\n ${identityWhereFields}\n \n changeRequest: ApwRefFieldWhereInput\n }\n\n extend type ApwQuery {\n getComment(id: ID!): ApwCommentResponse\n\n listComments(\n where: ApwListCommentsWhereInput\n limit: Int\n after: String\n sort: [ApwListCommentsSort!]\n ): ApwListCommentsResponse\n }\n\n extend type ApwMutation {\n createComment(data: ApwCreateCommentInput!): ApwCommentResponse\n\n updateComment(id: ID!, data: ApwUpdateCommentInput!): ApwCommentResponse\n\n deleteComment(id: ID!): ApwDeleteCommentResponse\n }\n `\n ];\n },\n resolvers: {\n ApwQuery: {\n getComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.get(args.id));\n },\n listComments: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwCommentListParams.\n */\n const [entries, meta] = await context.apw.comment.list(\n args as unknown as ApwCommentListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n },\n ApwMutation: {\n createComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.create(args.data));\n },\n updateComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.update(args.id, args.data));\n },\n deleteComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.delete(args.id));\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAG,IAAIC,4BAAmB,CAAa;EACvD;EACAC,QAAQ,EAAEA,CAAA,KAAM;IACZ,MAAMC,mBAAmB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC;IAE5D,MAAMC,mBAAmB,GAAGD,mBAAmB,CAC1CE,GAAG,CAACC,IAAI,IAAI;MACT,
|
1
|
+
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","metaFieldsBaseNames","dateTimeWhereFields","map","name","join","identityWhereFields","onByFields","dateTimeFieldsSorters","resolvers","ApwQuery","getComment","_","args","context","resolve","apw","comment","get","id","listComments","entries","meta","list","ListResponse","e","ErrorResponse","ApwMutation","createComment","create","data","updateComment","update","deleteComment","delete","_default","exports","default"],"sources":["comment.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwContext, ApwCommentListParams } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: () => {\n const metaFieldsBaseNames = [\"created\", \"modified\", \"saved\"];\n\n const dateTimeWhereFields = metaFieldsBaseNames\n .map(name => {\n return `\n ${name}On: DateTime\n ${name}On_gt: DateTime\n ${name}On_gte: DateTime\n ${name}On_lt: DateTime\n ${name}On_lte: DateTime\n ${name}On_between: [DateTime!]\n ${name}On_not_between: [DateTime!]\n `;\n })\n .join(\"\\n\");\n\n const identityWhereFields = metaFieldsBaseNames\n .map(name => {\n return `\n ${name}By: ID\n ${name}By_not: ID\n ${name}By_in: [ID!]\n ${name}By_not_in: [ID!]\n `;\n })\n .join(\"\\n\");\n\n return [\n `\n type ApwCommentListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Comment specific fields\n body: JSON\n changeRequest: ID\n # TODO: Remove ApwRefField\n media: JSON\n }\n\n type ApwListCommentsResponse {\n data: [ApwCommentListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwComment {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Comment specific fields\n body: JSON\n changeRequest: ID\n media: JSON\n }\n\n type ApwCommentResponse {\n data: ApwComment\n error: ApwError\n }\n\n type ApwDeleteCommentResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListCommentsSort {\n id_ASC\n id_DESC\n \n ${dateTimeFieldsSorters}\n }\n\n input ApwCreateCommentInput {\n body: JSON!\n changeRequest: ID!\n media: JSON\n }\n\n input ApwUpdateCommentInput {\n body: JSON!\n }\n\n input ApwListCommentsWhereInput {\n id: ID\n id_not: ID\n id_in: [ID!]\n id_not_in: [ID!]\n \n ${dateTimeWhereFields}\n ${identityWhereFields}\n \n changeRequest: ApwRefFieldWhereInput\n }\n\n extend type ApwQuery {\n getComment(id: ID!): ApwCommentResponse\n\n listComments(\n where: ApwListCommentsWhereInput\n limit: Int\n after: String\n sort: [ApwListCommentsSort!]\n ): ApwListCommentsResponse\n }\n\n extend type ApwMutation {\n createComment(data: ApwCreateCommentInput!): ApwCommentResponse\n\n updateComment(id: ID!, data: ApwUpdateCommentInput!): ApwCommentResponse\n\n deleteComment(id: ID!): ApwDeleteCommentResponse\n }\n `\n ];\n },\n resolvers: {\n ApwQuery: {\n getComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.get(args.id));\n },\n listComments: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwCommentListParams.\n */\n const [entries, meta] = await context.apw.comment.list(\n args as unknown as ApwCommentListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n },\n ApwMutation: {\n createComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.create(args.data));\n },\n updateComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.update(args.id, args.data));\n },\n deleteComment: async (_, args: any, context) => {\n return resolve(() => context.apw.comment.delete(args.id));\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAG,IAAIC,4BAAmB,CAAa;EACvD;EACAC,QAAQ,EAAEA,CAAA,KAAM;IACZ,MAAMC,mBAAmB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC;IAE5D,MAAMC,mBAAmB,GAAGD,mBAAmB,CAC1CE,GAAG,CAACC,IAAI,IAAI;MACT,OAAO;AACvB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,aAAa;IACD,CAAC,CAAC,CACDC,IAAI,CAAC,IAAI,CAAC;IAEf,MAAMC,mBAAmB,GAAGL,mBAAmB,CAC1CE,GAAG,CAACC,IAAI,IAAI;MACT,OAAO;AACvB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,kBAAkBA,IAAI;AACtB,aAAa;IACD,CAAC,CAAC,CACDC,IAAI,CAAC,IAAI,CAAC;IAEf,OAAO,CACH;AACZ;AACA;AACA;AACA;AACA,cAAcE,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcA,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcC,4BAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcN,mBAAmB;AACjC,cAAcI,mBAAmB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CACI;EACL,CAAC;EACDG,SAAS,EAAE;IACPC,QAAQ,EAAE;MACNC,UAAU,EAAE,MAAAA,CAAOC,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QACzC,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,OAAO,CAACC,GAAG,CAACL,IAAI,CAACM,EAAE,CAAC,CAAC;MAC1D,CAAC;MACDC,YAAY,EAAE,MAAAA,CAAOR,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC3C,IAAI;UACA;AACpB;AACA;UACoB,MAAM,CAACO,OAAO,EAAEC,IAAI,CAAC,GAAG,MAAMR,OAAO,CAACE,GAAG,CAACC,OAAO,CAACM,IAAI,CAClDV,IACJ,CAAC;UACD,OAAO,IAAIW,4BAAY,CAACH,OAAO,EAAEC,IAAI,CAAC;QAC1C,CAAC,CAAC,OAAOG,CAAC,EAAE;UACR,OAAO,IAAIC,6BAAa,CAACD,CAAC,CAAC;QAC/B;MACJ;IACJ,CAAC;IACDE,WAAW,EAAE;MACTC,aAAa,EAAE,MAAAA,CAAOhB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC5C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,OAAO,CAACY,MAAM,CAAChB,IAAI,CAACiB,IAAI,CAAC,CAAC;MAC/D,CAAC;MACDC,aAAa,EAAE,MAAAA,CAAOnB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC5C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,OAAO,CAACe,MAAM,CAACnB,IAAI,CAACM,EAAE,EAAEN,IAAI,CAACiB,IAAI,CAAC,CAAC;MACxE,CAAC;MACDG,aAAa,EAAE,MAAAA,CAAOrB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC5C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,OAAO,CAACiB,MAAM,CAACrB,IAAI,CAACM,EAAE,CAAC,CAAC;MAC7D;IACJ;EACJ;AACJ,CAAC,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYvC,cAAc","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_plugins","require","_handlerGraphql","_types","_resolve","_interopRequireDefault","_utils","contentReviewSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwContentReviewContent","version","parent","_","context","getContent","apw","getContentGetter","type","content","id","settings","publishedOn","lastPublishedOn","publishedBy","reviewer","list","where","identityId","scheduledBy","ApwContentReviewListItem","activeStep","steps","find","step","status","ApwContentReviewStepStatus","ACTIVE","totalComments","reduce","count","isNaN","reviewers","reviewerIds","includes","push","ApwQuery","getContentReview","args","resolve","contentReview","get","listContentReviews","entries","meta","ListResponse","e","ErrorResponse","isReviewRequired","data","ApwMutation","createContentReview","create","deleteContentReview","delete","provideSignOff","retractSignOff","publishContent","datetime","unpublishContent","deleteScheduledAction","_default","exports","default"],"sources":["contentReview.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport {\n ApwContentReviewStep,\n ApwContentReviewStepStatus,\n ApwContext,\n ApwContentReviewListParams,\n ApwContentReviewContent\n} from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst contentReviewSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwContentReviewListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ContentReview specific fields\n title: String\n steps: [ApwContentReviewStep]\n content: ApwContentReviewContent\n reviewStatus: ApwContentReviewStatus\n activeStep: ApwContentReviewStep\n totalComments: Int\n latestCommentId: String\n reviewers: [ID!]!\n }\n\n type ApwListContentReviewsResponse {\n data: [ApwContentReviewListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwContentReviewReviewer {\n id: ID\n displayName: String\n }\n\n type ApwContentReviewComment {\n body: JSON\n author: String\n }\n\n type ApwContentReviewChangeRequested {\n title: String\n body: JSON\n media: JSON\n step: String\n resolved: Boolean\n comments: [ApwContentReviewComment]\n }\n\n enum ApwContentReviewStepStatus {\n done\n active\n inactive\n }\n\n enum ApwContentReviewStatus {\n underReview\n readyToBePublished\n published\n requiresMyAttention\n }\n\n type ApwContentReviewStep {\n status: ApwContentReviewStepStatus\n id: String\n title: String\n pendingChangeRequests: Int\n signOffProvidedOn: DateTime\n signOffProvidedBy: ApwIdentity\n }\n\n type ApwContentReview {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ContentReview specific fields\n title: String\n steps: [ApwContentReviewStep]\n content: ApwContentReviewContent\n workflow: ID\n reviewStatus: ApwContentReviewStatus\n }\n\n type ApwContentReviewResponse {\n data: ApwContentReview\n error: ApwError\n }\n\n type ApwDeleteContentReviewResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListContentReviewsSort {\n id_ASC\n id_DESC\n\n ${dateTimeFieldsSorters}\n \n title_ASC\n title_DESC\n }\n\n input ApwContentReviewReviewerInput {\n id: ID\n }\n\n input ApwContentReviewScopeInput {\n type: String\n options: JSON\n }\n\n input ApwContentReviewCommentInput {\n body: JSON\n author: String\n }\n\n input ApwContentReviewChangeRequestedInput {\n title: String\n body: JSON\n media: JSON\n step: String\n resolved: Boolean\n comments: [ApwContentReviewCommentInput]\n }\n\n enum ApwContentReviewContentTypes {\n page\n cms_entry\n }\n\n type ApwContentReviewContentSettings {\n modelId: String\n }\n\n input ApwContentReviewContentSettingsInput {\n modelId: String\n }\n\n type ApwContentReviewContent {\n id: ID!\n type: ApwContentReviewContentTypes!\n version: Int!\n settings: ApwContentReviewContentSettings\n publishedOn: String\n publishedBy: ApwIdentity\n scheduledOn: DateTime\n scheduledBy: ApwIdentity\n }\n\n input ApwContentReviewContentInput {\n id: ID!\n type: ApwContentReviewContentTypes!\n settings: ApwContentReviewContentSettingsInput\n }\n\n input ApwCreateContentReviewInput {\n content: ApwContentReviewContentInput!\n }\n\n input ApwListContentReviewsWhereInput {\n id: ID\n reviewStatus: ApwContentReviewStatus\n title: String\n title_contains: String\n }\n\n type ApwProvideSignOffResponse {\n data: Boolean\n error: ApwError\n }\n\n type ApwIsReviewRequiredData {\n isReviewRequired: Boolean\n contentReviewId: ID\n }\n\n type ApwIsReviewRequiredResponse {\n data: ApwIsReviewRequiredData\n error: ApwError\n }\n\n type ApwPublishContentResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwContentActions {\n publish\n unpublish\n }\n\n type ApwScheduleActionResponse {\n data: Boolean\n error: ApwError\n }\n\n input ApwScheduleActionInput {\n action: ApwContentActions!\n datetime: String!\n type: ApwContentReviewContentTypes!\n entryId: ID!\n }\n\n extend type ApwQuery {\n getContentReview(id: ID!): ApwContentReviewResponse\n\n listContentReviews(\n where: ApwListContentReviewsWhereInput\n limit: Int\n after: String\n sort: [ApwListContentReviewsSort!]\n ): ApwListContentReviewsResponse\n\n isReviewRequired(data: ApwContentReviewContentInput!): ApwIsReviewRequiredResponse\n }\n\n extend type ApwMutation {\n createContentReview(data: ApwCreateContentReviewInput!): ApwContentReviewResponse\n\n deleteContentReview(id: ID!): ApwDeleteContentReviewResponse\n\n provideSignOff(id: ID!, step: String!): ApwProvideSignOffResponse\n\n retractSignOff(id: ID!, step: String!): ApwProvideSignOffResponse\n\n publishContent(id: ID!, datetime: String): ApwPublishContentResponse\n\n unpublishContent(id: ID!, datetime: String): ApwPublishContentResponse\n\n scheduleAction(data: ApwScheduleActionInput!): ApwScheduleActionResponse\n\n deleteScheduledAction(id: ID!): ApwScheduleActionResponse\n }\n `,\n resolvers: {\n ApwContentReviewContent: {\n version: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const getContent = context.apw.getContentGetter(parent.type);\n const content = await getContent(parent.id, parent.settings);\n if (!content) {\n return null;\n }\n return content.version;\n },\n publishedOn: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const getContent = context.apw.getContentGetter(parent.type);\n const content = await getContent(parent.id, parent.settings);\n if (!content) {\n return null;\n }\n\n // In case a page was returned, let's read the `publishedOn` field.\n if (\"publishedOn\" in content) {\n return content.publishedOn;\n }\n\n // In case a CMS entry was returned, let's read the entry-level `lastPublishedOn` field.\n return content.lastPublishedOn;\n },\n publishedBy: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const id = parent.publishedBy;\n if (id) {\n const [[reviewer]] = await context.apw.reviewer.list({\n where: { identityId: id }\n });\n return reviewer;\n }\n return null;\n },\n scheduledBy: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const id = parent.scheduledBy;\n if (id) {\n const [[reviewer]] = await context.apw.reviewer.list({\n where: { identityId: id }\n });\n return reviewer;\n }\n return null;\n }\n },\n ApwContentReviewListItem: {\n activeStep: async parent => {\n const steps: ApwContentReviewStep[] = parent.steps;\n return steps.find(step => step.status === ApwContentReviewStepStatus.ACTIVE);\n },\n totalComments: async parent => {\n const steps: ApwContentReviewStep[] = parent.steps;\n return steps.reduce((count, step) => {\n /**\n * Aggregate totalComments from each step.\n */\n if (!isNaN(step.totalComments)) {\n count += step.totalComments;\n }\n\n return count;\n }, 0);\n },\n reviewers: async parent => {\n const steps: ApwContentReviewStep[] = parent.steps;\n const reviewerIds: string[] = [];\n\n for (const step of steps) {\n for (const reviewer of step.reviewers) {\n if (!reviewerIds.includes(reviewer.id)) {\n reviewerIds.push(reviewer.id);\n }\n }\n }\n return reviewerIds;\n }\n },\n ApwQuery: {\n getContentReview: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.get(args.id));\n },\n listContentReviews: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwContentReviewListParams.\n */\n const [entries, meta] = await context.apw.contentReview.list(\n args as unknown as ApwContentReviewListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n },\n isReviewRequired: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.isReviewRequired(args.data));\n }\n },\n ApwMutation: {\n createContentReview: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.create(args.data));\n },\n deleteContentReview: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.delete(args.id));\n },\n provideSignOff: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.provideSignOff(args.id, args.step));\n },\n retractSignOff: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.retractSignOff(args.id, args.step));\n },\n publishContent: async (_, args: any, context) => {\n return resolve(() =>\n context.apw.contentReview.publishContent(args.id, args.datetime)\n );\n },\n unpublishContent: async (_, args: any, context) => {\n return resolve(() =>\n context.apw.contentReview.unpublishContent(args.id, args.datetime)\n );\n },\n deleteScheduledAction: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.deleteScheduledAction(args.id));\n }\n }\n }\n});\n\nexport default contentReviewSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,MAAMM,mBAAmB,GAAG,IAAIC,4BAAmB,CAAa;EAC5D;EACAC,QAAQ,EAAG;AACf;AACA;AACA;AACA;AACA,cAAcC,iBAAW;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcA,iBAAW;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcC,4BAAsB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;EACDC,SAAS,EAAE;IACPC,uBAAuB,EAAE;MACrBC,OAAO,EAAE,MAAAA,CAAOC,MAA+B,EAAEC,CAAC,EAAEC,OAAmB,KAAK;QACxE,MAAMC,UAAU,GAAGD,OAAO,CAACE,GAAG,CAACC,gBAAgB,CAACL,MAAM,CAACM,IAAI,CAAC;QAC5D,MAAMC,OAAO,GAAG,MAAMJ,UAAU,CAACH,MAAM,CAACQ,EAAE,EAAER,MAAM,CAACS,QAAQ,CAAC;QAC5D,IAAI,CAACF,OAAO,EAAE;UACV,OAAO,IAAI;QACf;QACA,OAAOA,OAAO,CAACR,OAAO;MAC1B,CAAC;MACDW,WAAW,EAAE,MAAAA,CAAOV,MAA+B,EAAEC,CAAC,EAAEC,OAAmB,KAAK;QAC5E,MAAMC,UAAU,GAAGD,OAAO,CAACE,GAAG,CAACC,gBAAgB,CAACL,MAAM,CAACM,IAAI,CAAC;QAC5D,MAAMC,OAAO,GAAG,MAAMJ,UAAU,CAACH,MAAM,CAACQ,EAAE,EAAER,MAAM,CAACS,QAAQ,CAAC;QAC5D,IAAI,CAACF,OAAO,EAAE;UACV,OAAO,IAAI;QACf;;QAEA;QACA,IAAI,aAAa,IAAIA,OAAO,EAAE;UAC1B,OAAOA,OAAO,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C,aAAa,CAACiB,cAAc,CAACnB,IAAI,CAAC5B,EAAE,EAAE4B,IAAI,CAACoB,QAAQ,CACnE,CAAC;MACL,CAAC;MACDC,gBAAgB,EAAE,MAAAA,CAAOxD,CAAC,EAAEmC,IAAS,EAAElC,OAAO,KAAK;QAC/C,OAAO,IAAAmC,gBAAO,EAAC,MACXnC,OAAO,CAACE,GAAG,CAACkC,aAAa,CAACmB,gBAAgB,CAACrB,IAAI,CAAC5B,EAAE,EAAE4B,IAAI,CAACoB,QAAQ,CACrE,CAAC;MACL,CAAC;MACDE,qBAAqB,EAAE,MAAAA,CAAOzD,CAAC,EAAEmC,IAAS,EAAElC,OAAO,KAAK;QACpD,OAAO,IAAAmC,gBAAO,EAAC,MAAMnC,OAAO,CAACE,GAAG,CAACkC,aAAa,CAACoB,qBAAqB,CAACtB,IAAI,CAAC5B,EAAE,CAAC,CAAC;MAClF;IACJ;EACJ;AACJ,CAAC,CAAC;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYrE,mBAAmB","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_plugins","require","_handlerGraphql","_types","_resolve","_interopRequireDefault","_utils","contentReviewSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwContentReviewContent","version","parent","_","context","getContent","apw","getContentGetter","type","content","id","settings","publishedOn","lastPublishedOn","publishedBy","reviewer","list","where","identityId","scheduledBy","ApwContentReviewListItem","activeStep","steps","find","step","status","ApwContentReviewStepStatus","ACTIVE","totalComments","reduce","count","isNaN","reviewers","reviewerIds","includes","push","ApwQuery","getContentReview","args","resolve","contentReview","get","listContentReviews","entries","meta","ListResponse","e","ErrorResponse","isReviewRequired","data","ApwMutation","createContentReview","create","deleteContentReview","delete","provideSignOff","retractSignOff","publishContent","datetime","unpublishContent","deleteScheduledAction","_default","exports","default"],"sources":["contentReview.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport {\n ApwContentReviewStep,\n ApwContentReviewStepStatus,\n ApwContext,\n ApwContentReviewListParams,\n ApwContentReviewContent\n} from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst contentReviewSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwContentReviewListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ContentReview specific fields\n title: String\n steps: [ApwContentReviewStep]\n content: ApwContentReviewContent\n reviewStatus: ApwContentReviewStatus\n activeStep: ApwContentReviewStep\n totalComments: Int\n latestCommentId: String\n reviewers: [ID!]!\n }\n\n type ApwListContentReviewsResponse {\n data: [ApwContentReviewListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwContentReviewReviewer {\n id: ID\n displayName: String\n }\n\n type ApwContentReviewComment {\n body: JSON\n author: String\n }\n\n type ApwContentReviewChangeRequested {\n title: String\n body: JSON\n media: JSON\n step: String\n resolved: Boolean\n comments: [ApwContentReviewComment]\n }\n\n enum ApwContentReviewStepStatus {\n done\n active\n inactive\n }\n\n enum ApwContentReviewStatus {\n underReview\n readyToBePublished\n published\n requiresMyAttention\n }\n\n type ApwContentReviewStep {\n status: ApwContentReviewStepStatus\n id: String\n title: String\n pendingChangeRequests: Int\n signOffProvidedOn: DateTime\n signOffProvidedBy: ApwIdentity\n }\n\n type ApwContentReview {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # ContentReview specific fields\n title: String\n steps: [ApwContentReviewStep]\n content: ApwContentReviewContent\n workflow: ID\n reviewStatus: ApwContentReviewStatus\n }\n\n type ApwContentReviewResponse {\n data: ApwContentReview\n error: ApwError\n }\n\n type ApwDeleteContentReviewResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListContentReviewsSort {\n id_ASC\n id_DESC\n\n ${dateTimeFieldsSorters}\n \n title_ASC\n title_DESC\n }\n\n input ApwContentReviewReviewerInput {\n id: ID\n }\n\n input ApwContentReviewScopeInput {\n type: String\n options: JSON\n }\n\n input ApwContentReviewCommentInput {\n body: JSON\n author: String\n }\n\n input ApwContentReviewChangeRequestedInput {\n title: String\n body: JSON\n media: JSON\n step: String\n resolved: Boolean\n comments: [ApwContentReviewCommentInput]\n }\n\n enum ApwContentReviewContentTypes {\n page\n cms_entry\n }\n\n type ApwContentReviewContentSettings {\n modelId: String\n }\n\n input ApwContentReviewContentSettingsInput {\n modelId: String\n }\n\n type ApwContentReviewContent {\n id: ID!\n type: ApwContentReviewContentTypes!\n version: Int!\n settings: ApwContentReviewContentSettings\n publishedOn: String\n publishedBy: ApwIdentity\n scheduledOn: DateTime\n scheduledBy: ApwIdentity\n }\n\n input ApwContentReviewContentInput {\n id: ID!\n type: ApwContentReviewContentTypes!\n settings: ApwContentReviewContentSettingsInput\n }\n\n input ApwCreateContentReviewInput {\n content: ApwContentReviewContentInput!\n }\n\n input ApwListContentReviewsWhereInput {\n id: ID\n reviewStatus: ApwContentReviewStatus\n title: String\n title_contains: String\n }\n\n type ApwProvideSignOffResponse {\n data: Boolean\n error: ApwError\n }\n\n type ApwIsReviewRequiredData {\n isReviewRequired: Boolean\n contentReviewId: ID\n }\n\n type ApwIsReviewRequiredResponse {\n data: ApwIsReviewRequiredData\n error: ApwError\n }\n\n type ApwPublishContentResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwContentActions {\n publish\n unpublish\n }\n\n type ApwScheduleActionResponse {\n data: Boolean\n error: ApwError\n }\n\n input ApwScheduleActionInput {\n action: ApwContentActions!\n datetime: String!\n type: ApwContentReviewContentTypes!\n entryId: ID!\n }\n\n extend type ApwQuery {\n getContentReview(id: ID!): ApwContentReviewResponse\n\n listContentReviews(\n where: ApwListContentReviewsWhereInput\n limit: Int\n after: String\n sort: [ApwListContentReviewsSort!]\n ): ApwListContentReviewsResponse\n\n isReviewRequired(data: ApwContentReviewContentInput!): ApwIsReviewRequiredResponse\n }\n\n extend type ApwMutation {\n createContentReview(data: ApwCreateContentReviewInput!): ApwContentReviewResponse\n\n deleteContentReview(id: ID!): ApwDeleteContentReviewResponse\n\n provideSignOff(id: ID!, step: String!): ApwProvideSignOffResponse\n\n retractSignOff(id: ID!, step: String!): ApwProvideSignOffResponse\n\n publishContent(id: ID!, datetime: String): ApwPublishContentResponse\n\n unpublishContent(id: ID!, datetime: String): ApwPublishContentResponse\n\n scheduleAction(data: ApwScheduleActionInput!): ApwScheduleActionResponse\n\n deleteScheduledAction(id: ID!): ApwScheduleActionResponse\n }\n `,\n resolvers: {\n ApwContentReviewContent: {\n version: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const getContent = context.apw.getContentGetter(parent.type);\n const content = await getContent(parent.id, parent.settings);\n if (!content) {\n return null;\n }\n return content.version;\n },\n publishedOn: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const getContent = context.apw.getContentGetter(parent.type);\n const content = await getContent(parent.id, parent.settings);\n if (!content) {\n return null;\n }\n\n // In case a page was returned, let's read the `publishedOn` field.\n if (\"publishedOn\" in content) {\n return content.publishedOn;\n }\n\n // In case a CMS entry was returned, let's read the entry-level `lastPublishedOn` field.\n return content.lastPublishedOn;\n },\n publishedBy: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const id = parent.publishedBy;\n if (id) {\n const [[reviewer]] = await context.apw.reviewer.list({\n where: { identityId: id }\n });\n return reviewer;\n }\n return null;\n },\n scheduledBy: async (parent: ApwContentReviewContent, _, context: ApwContext) => {\n const id = parent.scheduledBy;\n if (id) {\n const [[reviewer]] = await context.apw.reviewer.list({\n where: { identityId: id }\n });\n return reviewer;\n }\n return null;\n }\n },\n ApwContentReviewListItem: {\n activeStep: async parent => {\n const steps: ApwContentReviewStep[] = parent.steps;\n return steps.find(step => step.status === ApwContentReviewStepStatus.ACTIVE);\n },\n totalComments: async parent => {\n const steps: ApwContentReviewStep[] = parent.steps;\n return steps.reduce((count, step) => {\n /**\n * Aggregate totalComments from each step.\n */\n if (!isNaN(step.totalComments)) {\n count += step.totalComments;\n }\n\n return count;\n }, 0);\n },\n reviewers: async parent => {\n const steps: ApwContentReviewStep[] = parent.steps;\n const reviewerIds: string[] = [];\n\n for (const step of steps) {\n for (const reviewer of step.reviewers) {\n if (!reviewerIds.includes(reviewer.id)) {\n reviewerIds.push(reviewer.id);\n }\n }\n }\n return reviewerIds;\n }\n },\n ApwQuery: {\n getContentReview: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.get(args.id));\n },\n listContentReviews: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwContentReviewListParams.\n */\n const [entries, meta] = await context.apw.contentReview.list(\n args as unknown as ApwContentReviewListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n },\n isReviewRequired: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.isReviewRequired(args.data));\n }\n },\n ApwMutation: {\n createContentReview: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.create(args.data));\n },\n deleteContentReview: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.delete(args.id));\n },\n provideSignOff: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.provideSignOff(args.id, args.step));\n },\n retractSignOff: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.retractSignOff(args.id, args.step));\n },\n publishContent: async (_, args: any, context) => {\n return resolve(() =>\n context.apw.contentReview.publishContent(args.id, args.datetime)\n );\n },\n unpublishContent: async (_, args: any, context) => {\n return resolve(() =>\n context.apw.contentReview.unpublishContent(args.id, args.datetime)\n );\n },\n deleteScheduledAction: async (_, args: any, context) => {\n return resolve(() => context.apw.contentReview.deleteScheduledAction(args.id));\n }\n }\n }\n});\n\nexport default contentReviewSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,MAAMM,mBAAmB,GAAG,IAAIC,4BAAmB,CAAa;EAC5D;EACAC,QAAQ,EAAE;AACd;AACA;AACA;AACA;AACA,cAAcC,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcA,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcC,4BAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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CAAOzD,CAAC,EAAEmC,IAAS,EAAElC,OAAO,KAAK;QACpD,OAAO,IAAAmC,gBAAO,EAAC,MAAMnC,OAAO,CAACE,GAAG,CAACkC,aAAa,CAACoB,qBAAqB,CAACtB,IAAI,CAAC5B,EAAE,CAAC,CAAC;MAClF;IACJ;EACJ;AACJ,CAAC,CAAC;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYrE,mBAAmB","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwQuery","getReviewer","_","args","context","resolve","apw","reviewer","get","id","listReviewers","entries","meta","list","ListResponse","e","ErrorResponse","_default","exports","default"],"sources":["reviewer.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwContext, ApwReviewerListParams } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwReviewerListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Reviewer specific fields\n identityId: ID\n displayName: String\n type: String\n email: String\n }\n\n type ApwListReviewersResponse {\n data: [ApwReviewerListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwReviewer {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Reviewer specific fields\n identityId: ID\n displayName: String\n type: String\n email: String\n }\n\n type ApwReviewerResponse {\n data: ApwReviewer\n error: ApwError\n }\n\n type ApwDeleteReviewerResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListReviewersSort {\n id_ASC\n id_DESC\n\n ${dateTimeFieldsSorters}\n \n publishedOn_ASC\n publishedOn_DESC\n title_ASC\n title_DESC\n }\n\n input ApwListReviewersWhereInput {\n identityId: ID\n }\n\n input ApwListReviewersSearchInput {\n # By specifying \"query\", the search will be performed against workflow' \"title\" field.\n query: String\n }\n\n extend type ApwQuery {\n getReviewer(id: ID!): ApwReviewerResponse\n\n listReviewers(\n where: ApwListReviewersWhereInput\n limit: Int\n after: String\n sort: [ApwListReviewersSort!]\n search: ApwListReviewersSearchInput\n ): ApwListReviewersResponse\n }\n `,\n resolvers: {\n ApwQuery: {\n getReviewer: async (_, args: any, context) => {\n return resolve(() => context.apw.reviewer.get(args.id));\n },\n listReviewers: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwReviewerListParams.\n */\n const [entries, meta] = await context.apw.reviewer.list(\n args as unknown as ApwReviewerListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAG,IAAIC,4BAAmB,CAAa;EACvD;EACAC,QAAQ,
|
1
|
+
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwQuery","getReviewer","_","args","context","resolve","apw","reviewer","get","id","listReviewers","entries","meta","list","ListResponse","e","ErrorResponse","_default","exports","default"],"sources":["reviewer.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwContext, ApwReviewerListParams } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwReviewerListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Reviewer specific fields\n identityId: ID\n displayName: String\n type: String\n email: String\n }\n\n type ApwListReviewersResponse {\n data: [ApwReviewerListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwReviewer {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Reviewer specific fields\n identityId: ID\n displayName: String\n type: String\n email: String\n }\n\n type ApwReviewerResponse {\n data: ApwReviewer\n error: ApwError\n }\n\n type ApwDeleteReviewerResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwListReviewersSort {\n id_ASC\n id_DESC\n\n ${dateTimeFieldsSorters}\n \n publishedOn_ASC\n publishedOn_DESC\n title_ASC\n title_DESC\n }\n\n input ApwListReviewersWhereInput {\n identityId: ID\n }\n\n input ApwListReviewersSearchInput {\n # By specifying \"query\", the search will be performed against workflow' \"title\" field.\n query: String\n }\n\n extend type ApwQuery {\n getReviewer(id: ID!): ApwReviewerResponse\n\n listReviewers(\n where: ApwListReviewersWhereInput\n limit: Int\n after: String\n sort: [ApwListReviewersSort!]\n search: ApwListReviewersSearchInput\n ): ApwListReviewersResponse\n }\n `,\n resolvers: {\n ApwQuery: {\n getReviewer: async (_, args: any, context) => {\n return resolve(() => context.apw.reviewer.get(args.id));\n },\n listReviewers: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ApwReviewerListParams.\n */\n const [entries, meta] = await context.apw.reviewer.list(\n args as unknown as ApwReviewerListParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CA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","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwWorkflowStep","reviewers","parent","map","id","ApwQuery","getWorkflow","_","args","context","resolve","apw","workflow","get","listWorkflows","entries","meta","list","ListResponse","e","ErrorResponse","ApwMutation","createWorkflow","create","data","updateWorkflow","update","deleteWorkflow","delete","_default","exports","default"],"sources":["workflow.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwContext, ApwReviewer, ListWorkflowsParams } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwWorkflowListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Workflow specific fields\n app: ApwWorkflowApplication\n title: String\n steps: [ApwWorkflowStep]\n scope: ApwWorkflowScope\n }\n\n type ApwListWorkflowsResponse {\n data: [ApwWorkflowListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwWorkflowStep {\n title: String!\n id: String!\n type: ApwWorkflowStepTypes!\n reviewers: [ID!]\n }\n\n type ApwWorkflowScope {\n type: String\n data: JSON\n }\n\n type ApwWorkflow {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Workflow specific fields\n app: ApwWorkflowApplication\n title: String\n steps: [ApwWorkflowStep]\n scope: ApwWorkflowScope\n }\n\n type ApwWorkflowResponse {\n data: ApwWorkflow\n error: ApwError\n }\n\n type ApwDeleteWorkflowResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwWorkflowApplication {\n pageBuilder\n cms\n formBuilder\n }\n\n enum ApwWorkflowStepTypes {\n mandatoryBlocking\n mandatoryNonBlocking\n notMandatory\n }\n\n enum ApwListWorkflowsSort {\n id_ASC\n id_DESC\n \n ${dateTimeFieldsSorters}\n publishedOn_ASC\n publishedOn_DESC\n \n title_ASC\n title_DESC\n }\n\n input ApwWorkflowReviewerInput {\n id: ID\n }\n\n input ApwCreateWorkflowStepInput {\n id: String!\n title: String!\n type: ApwWorkflowStepTypes!\n reviewers: [ID!]!\n }\n\n input ApwUpdateWorkflowStepInput {\n id: String!\n title: String!\n type: ApwWorkflowStepTypes!\n reviewers: [ID!]\n }\n\n input ApwWorkflowScopeInput {\n type: String!\n data: JSON\n }\n\n input ApwCreateWorkflowInput {\n title: String!\n steps: [ApwCreateWorkflowStepInput!]!\n scope: ApwWorkflowScopeInput!\n app: ApwWorkflowApplication!\n }\n\n input ApwUpdateWorkflowInput {\n title: String\n steps: [ApwUpdateWorkflowStepInput!]\n scope: ApwWorkflowScopeInput\n }\n\n input ApwListWorkflowsWhereInput {\n app: ApwWorkflowApplication\n }\n\n input ApwListWorkflowsSearchInput {\n # By specifying \"query\", the search will be performed against workflow' \"title\" field.\n query: String\n }\n\n type ApwQuery {\n getWorkflow(id: ID!): ApwWorkflowResponse\n\n listWorkflows(\n where: ApwListWorkflowsWhereInput\n limit: Int\n after: String\n sort: [ApwListWorkflowsSort!]\n search: ApwListWorkflowsSearchInput\n ): ApwListWorkflowsResponse\n }\n\n type ApwMutation {\n createWorkflow(data: ApwCreateWorkflowInput!): ApwWorkflowResponse\n\n # Update workflow by given ID.\n updateWorkflow(id: ID!, data: ApwUpdateWorkflowInput!): ApwWorkflowResponse\n\n # Delete workflow\n deleteWorkflow(id: ID!): ApwDeleteWorkflowResponse\n }\n `,\n resolvers: {\n ApwWorkflowStep: {\n reviewers: parent => {\n const reviewers: ApwReviewer[] = parent.reviewers;\n return reviewers.map(({ id }) => id);\n }\n },\n ApwQuery: {\n getWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.get(args.id));\n },\n listWorkflows: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ListWorkflowsParams.\n */\n const [entries, meta] = await context.apw.workflow.list(\n args as unknown as ListWorkflowsParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n },\n ApwMutation: {\n createWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.create(args.data));\n },\n updateWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.update(args.id, args.data));\n },\n deleteWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.delete(args.id));\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAG,IAAIC,4BAAmB,CAAa;EACvD;EACAC,QAAQ,
|
1
|
+
{"version":3,"names":["_plugins","require","_handlerGraphql","_resolve","_interopRequireDefault","_utils","workflowSchema","GraphQLSchemaPlugin","typeDefs","onByFields","dateTimeFieldsSorters","resolvers","ApwWorkflowStep","reviewers","parent","map","id","ApwQuery","getWorkflow","_","args","context","resolve","apw","workflow","get","listWorkflows","entries","meta","list","ListResponse","e","ErrorResponse","ApwMutation","createWorkflow","create","data","updateWorkflow","update","deleteWorkflow","delete","_default","exports","default"],"sources":["workflow.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ErrorResponse, ListResponse } from \"@webiny/handler-graphql\";\nimport { ApwContext, ApwReviewer, ListWorkflowsParams } from \"~/types\";\nimport resolve from \"~/utils/resolve\";\nimport { onByFields, dateTimeFieldsSorters } from \"./utils\";\n\nconst workflowSchema = new GraphQLSchemaPlugin<ApwContext>({\n // Had to remove /* GraphQL */ because prettier would not format the code correctly.\n typeDefs: `\n type ApwWorkflowListItem {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Workflow specific fields\n app: ApwWorkflowApplication\n title: String\n steps: [ApwWorkflowStep]\n scope: ApwWorkflowScope\n }\n\n type ApwListWorkflowsResponse {\n data: [ApwWorkflowListItem]\n error: ApwError\n meta: ApwMeta\n }\n\n type ApwWorkflowStep {\n title: String!\n id: String!\n type: ApwWorkflowStepTypes!\n reviewers: [ID!]\n }\n\n type ApwWorkflowScope {\n type: String\n data: JSON\n }\n\n type ApwWorkflow {\n # System generated fields\n id: ID\n \n ${onByFields}\n \n # Workflow specific fields\n app: ApwWorkflowApplication\n title: String\n steps: [ApwWorkflowStep]\n scope: ApwWorkflowScope\n }\n\n type ApwWorkflowResponse {\n data: ApwWorkflow\n error: ApwError\n }\n\n type ApwDeleteWorkflowResponse {\n data: Boolean\n error: ApwError\n }\n\n enum ApwWorkflowApplication {\n pageBuilder\n cms\n formBuilder\n }\n\n enum ApwWorkflowStepTypes {\n mandatoryBlocking\n mandatoryNonBlocking\n notMandatory\n }\n\n enum ApwListWorkflowsSort {\n id_ASC\n id_DESC\n \n ${dateTimeFieldsSorters}\n publishedOn_ASC\n publishedOn_DESC\n \n title_ASC\n title_DESC\n }\n\n input ApwWorkflowReviewerInput {\n id: ID\n }\n\n input ApwCreateWorkflowStepInput {\n id: String!\n title: String!\n type: ApwWorkflowStepTypes!\n reviewers: [ID!]!\n }\n\n input ApwUpdateWorkflowStepInput {\n id: String!\n title: String!\n type: ApwWorkflowStepTypes!\n reviewers: [ID!]\n }\n\n input ApwWorkflowScopeInput {\n type: String!\n data: JSON\n }\n\n input ApwCreateWorkflowInput {\n title: String!\n steps: [ApwCreateWorkflowStepInput!]!\n scope: ApwWorkflowScopeInput!\n app: ApwWorkflowApplication!\n }\n\n input ApwUpdateWorkflowInput {\n title: String\n steps: [ApwUpdateWorkflowStepInput!]\n scope: ApwWorkflowScopeInput\n }\n\n input ApwListWorkflowsWhereInput {\n app: ApwWorkflowApplication\n }\n\n input ApwListWorkflowsSearchInput {\n # By specifying \"query\", the search will be performed against workflow' \"title\" field.\n query: String\n }\n\n type ApwQuery {\n getWorkflow(id: ID!): ApwWorkflowResponse\n\n listWorkflows(\n where: ApwListWorkflowsWhereInput\n limit: Int\n after: String\n sort: [ApwListWorkflowsSort!]\n search: ApwListWorkflowsSearchInput\n ): ApwListWorkflowsResponse\n }\n\n type ApwMutation {\n createWorkflow(data: ApwCreateWorkflowInput!): ApwWorkflowResponse\n\n # Update workflow by given ID.\n updateWorkflow(id: ID!, data: ApwUpdateWorkflowInput!): ApwWorkflowResponse\n\n # Delete workflow\n deleteWorkflow(id: ID!): ApwDeleteWorkflowResponse\n }\n `,\n resolvers: {\n ApwWorkflowStep: {\n reviewers: parent => {\n const reviewers: ApwReviewer[] = parent.reviewers;\n return reviewers.map(({ id }) => id);\n }\n },\n ApwQuery: {\n getWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.get(args.id));\n },\n listWorkflows: async (_, args: any, context) => {\n try {\n /**\n * We know that args is ListWorkflowsParams.\n */\n const [entries, meta] = await context.apw.workflow.list(\n args as unknown as ListWorkflowsParams\n );\n return new ListResponse(entries, meta);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n },\n ApwMutation: {\n createWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.create(args.data));\n },\n updateWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.update(args.id, args.data));\n },\n deleteWorkflow: async (_, args: any, context) => {\n return resolve(() => context.apw.workflow.delete(args.id));\n }\n }\n }\n});\n\nexport default workflowSchema;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,MAAMK,cAAc,GAAG,IAAIC,4BAAmB,CAAa;EACvD;EACAC,QAAQ,EAAE;AACd;AACA;AACA;AACA;AACA,cAAcC,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcA,iBAAU;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcC,4BAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;EACDC,SAAS,EAAE;IACPC,eAAe,EAAE;MACbC,SAAS,EAAEC,MAAM,IAAI;QACjB,MAAMD,SAAwB,GAAGC,MAAM,CAACD,SAAS;QACjD,OAAOA,SAAS,CAACE,GAAG,CAAC,CAAC;UAAEC;QAAG,CAAC,KAAKA,EAAE,CAAC;MACxC;IACJ,CAAC;IACDC,QAAQ,EAAE;MACNC,WAAW,EAAE,MAAAA,CAAOC,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC1C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,QAAQ,CAACC,GAAG,CAACL,IAAI,CAACJ,EAAE,CAAC,CAAC;MAC3D,CAAC;MACDU,aAAa,EAAE,MAAAA,CAAOP,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC5C,IAAI;UACA;AACpB;AACA;UACoB,MAAM,CAACM,OAAO,EAAEC,IAAI,CAAC,GAAG,MAAMP,OAAO,CAACE,GAAG,CAACC,QAAQ,CAACK,IAAI,CACnDT,IACJ,CAAC;UACD,OAAO,IAAIU,4BAAY,CAACH,OAAO,EAAEC,IAAI,CAAC;QAC1C,CAAC,CAAC,OAAOG,CAAC,EAAE;UACR,OAAO,IAAIC,6BAAa,CAACD,CAAC,CAAC;QAC/B;MACJ;IACJ,CAAC;IACDE,WAAW,EAAE;MACTC,cAAc,EAAE,MAAAA,CAAOf,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC7C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,QAAQ,CAACW,MAAM,CAACf,IAAI,CAACgB,IAAI,CAAC,CAAC;MAChE,CAAC;MACDC,cAAc,EAAE,MAAAA,CAAOlB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC7C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,QAAQ,CAACc,MAAM,CAAClB,IAAI,CAACJ,EAAE,EAAEI,IAAI,CAACgB,IAAI,CAAC,CAAC;MACzE,CAAC;MACDG,cAAc,EAAE,MAAAA,CAAOpB,CAAC,EAAEC,IAAS,EAAEC,OAAO,KAAK;QAC7C,OAAO,IAAAC,gBAAO,EAAC,MAAMD,OAAO,CAACE,GAAG,CAACC,QAAQ,CAACgB,MAAM,CAACpB,IAAI,CAACJ,EAAE,CAAC,CAAC;MAC9D;IACJ;EACJ;AACJ,CAAC,CAAC;AAAC,IAAAyB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEYrC,cAAc","ignoreList":[]}
|
package/plugins/graphql.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_workflow","_interopRequireDefault","require","_contentReview","_reviewer","_comment","_changeRequest","_plugins","_api","emptyResolver","baseSchema","GraphQLSchemaPlugin","typeDefs","resolvers","Query","apw","Mutation","_default","ContextPlugin","context","wcp","canUseFeature","plugins","register","workflowSchema","contentReviewSchema","reviewerSchema","commentSchema","changeRequestedSchema","exports","default"],"sources":["graphql.ts"],"sourcesContent":["import workflowSchema from \"./graphql/workflow.gql\";\nimport contentReviewSchema from \"./graphql/contentReview.gql\";\nimport reviewerSchema from \"./graphql/reviewer.gql\";\nimport commentSchema from \"./graphql/comment.gql\";\nimport changeRequestedSchema from \"./graphql/changeRequest.gql\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { ApwContext } from \"~/types\";\n\nconst emptyResolver = () => ({});\n\nconst baseSchema = new GraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n input ApwRefFieldInput {\n id: ID!\n modelId: String\n }\n\n input ApwRefFieldWhereInput {\n id: String\n id_not: String\n id_in: [String!]\n id_not_in: [String]\n entryId: String\n entryId_not: String\n entryId_in: [String!]\n entryId_not_in: [String!]\n }\n\n type ApwRefField {\n modelId: String!\n entryId: ID!\n id: ID!\n }\n\n type ApwMeta {\n hasMoreItems: Boolean\n totalCount: Int\n cursor: String\n }\n type ApwIdentity {\n id: ID\n displayName: String\n type: String\n }\n type ApwError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n extend type Query {\n apw: ApwQuery\n }\n extend type Mutation {\n apw: ApwMutation\n }\n `,\n resolvers: {\n Query: {\n apw: emptyResolver\n },\n Mutation: {\n apw: emptyResolver\n }\n }\n});\n\nexport default () => {\n return new ContextPlugin<ApwContext>(context => {\n if (!context.wcp.canUseFeature(\"advancedPublishingWorkflow\")) {\n return;\n }\n\n context.plugins.register([\n baseSchema,\n workflowSchema,\n contentReviewSchema,\n reviewerSchema,\n commentSchema,\n changeRequestedSchema\n ]);\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAGA,MAAMO,aAAa,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;AAEhC,MAAMC,UAAU,GAAG,IAAIC,4BAAmB,CAAC;EACvCC,QAAQ,EAAE,
|
1
|
+
{"version":3,"names":["_workflow","_interopRequireDefault","require","_contentReview","_reviewer","_comment","_changeRequest","_plugins","_api","emptyResolver","baseSchema","GraphQLSchemaPlugin","typeDefs","resolvers","Query","apw","Mutation","_default","ContextPlugin","context","wcp","canUseFeature","plugins","register","workflowSchema","contentReviewSchema","reviewerSchema","commentSchema","changeRequestedSchema","exports","default"],"sources":["graphql.ts"],"sourcesContent":["import workflowSchema from \"./graphql/workflow.gql\";\nimport contentReviewSchema from \"./graphql/contentReview.gql\";\nimport reviewerSchema from \"./graphql/reviewer.gql\";\nimport commentSchema from \"./graphql/comment.gql\";\nimport changeRequestedSchema from \"./graphql/changeRequest.gql\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { ApwContext } from \"~/types\";\n\nconst emptyResolver = () => ({});\n\nconst baseSchema = new GraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n input ApwRefFieldInput {\n id: ID!\n modelId: String\n }\n\n input ApwRefFieldWhereInput {\n id: String\n id_not: String\n id_in: [String!]\n id_not_in: [String]\n entryId: String\n entryId_not: String\n entryId_in: [String!]\n entryId_not_in: [String!]\n }\n\n type ApwRefField {\n modelId: String!\n entryId: ID!\n id: ID!\n }\n\n type ApwMeta {\n hasMoreItems: Boolean\n totalCount: Int\n cursor: String\n }\n type ApwIdentity {\n id: ID\n displayName: String\n type: String\n }\n type ApwError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n extend type Query {\n apw: ApwQuery\n }\n extend type Mutation {\n apw: ApwMutation\n }\n `,\n resolvers: {\n Query: {\n apw: emptyResolver\n },\n Mutation: {\n apw: emptyResolver\n }\n }\n});\n\nexport default () => {\n return new ContextPlugin<ApwContext>(context => {\n if (!context.wcp.canUseFeature(\"advancedPublishingWorkflow\")) {\n return;\n }\n\n context.plugins.register([\n baseSchema,\n workflowSchema,\n contentReviewSchema,\n reviewerSchema,\n commentSchema,\n changeRequestedSchema\n ]);\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAGA,MAAMO,aAAa,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;AAEhC,MAAMC,UAAU,GAAG,IAAIC,4BAAmB,CAAC;EACvCC,QAAQ,EAAE,aAAc;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;EACDC,SAAS,EAAE;IACPC,KAAK,EAAE;MACHC,GAAG,EAAEN;IACT,CAAC;IACDO,QAAQ,EAAE;MACND,GAAG,EAAEN;IACT;EACJ;AACJ,CAAC,CAAC;AAAC,IAAAQ,QAAA,GAEYA,CAAA,KAAM;EACjB,OAAO,IAAIC,kBAAa,CAAaC,OAAO,IAAI;IAC5C,IAAI,CAACA,OAAO,CAACC,GAAG,CAACC,aAAa,CAAC,4BAA4B,CAAC,EAAE;MAC1D;IACJ;IAEAF,OAAO,CAACG,OAAO,CAACC,QAAQ,CAAC,CACrBb,UAAU,EACVc,iBAAc,EACdC,sBAAmB,EACnBC,iBAAc,EACdC,gBAAa,EACbC,sBAAqB,CACxB,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAb,QAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createReviewerFromIdentity","security","apw","onAfterLogin","subscribe","identity","reviewer","list","where","identityId","id","limit","e","message","email","create","displayName","type","ex","console","log","JSON","stringify","update","exports"],"sources":["createReviewerFromIdentity.ts"],"sourcesContent":["import { LifeCycleHookCallbackParams } from \"~/types\";\n\nexport const createReviewerFromIdentity = ({ security, apw }: LifeCycleHookCallbackParams) => {\n /**\n * Replicate identity in \"AdvancedPublishingWorkflow\" system after login.\n */\n security.onAfterLogin.subscribe(async ({ identity }) => {\n let reviewer;\n try {\n [[reviewer]] = await apw.reviewer.list({\n where: { identityId: identity.id },\n limit: 1\n });\n } catch (e) {\n if (e.message === \"index_not_found_exception\") {\n // Do nothing\n } else {\n throw e;\n }\n }\n const email = identity?.email || null;\n /**\n * Create a reviewer if it doesn't exist already.\n */\n if (!reviewer) {\n try {\n await apw.reviewer.create({\n identityId: identity.id,\n displayName: identity.displayName,\n type: identity.type,\n email\n });\n } catch (ex) {\n console.log(\n `There was an error while creating reviewer with identity: ${identity.id}`\n );\n console.log(JSON.stringify(ex));\n throw ex;\n }\n return;\n }\n /**\n * If \"displayName\" doesn't match it means it has been updated in the identity,\n * therefore, we need to update it on reviewer as well keep them in sync.\n */\n const update = reviewer.displayName !== identity.displayName || reviewer.email !== email;\n if (!update) {\n return;\n }\n try {\n await apw.reviewer.update(reviewer.id, {\n identityId: reviewer.identityId,\n type: reviewer.type,\n displayName: identity.displayName,\n email\n });\n } catch (ex) {\n console.log(`There was an error while updating reviewer: ${reviewer.id}`);\n console.log(JSON.stringify(ex));\n throw ex;\n }\n });\n};\n"],"mappings":";;;;;;AAEO,MAAMA,0BAA0B,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAiC,CAAC,KAAK;EAC1F;AACJ;AACA;EACID,QAAQ,CAACE,YAAY,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAS,CAAC,KAAK;IACpD,IAAIC,QAAQ;IACZ,IAAI;MACA,CAAC,CAACA,QAAQ,CAAC,CAAC,GAAG,MAAMJ,GAAG,CAACI,QAAQ,CAACC,IAAI,CAAC;QACnCC,KAAK,EAAE;UAAEC,UAAU,EAAEJ,QAAQ,CAACK;QAAG,CAAC;QAClCC,KAAK,EAAE;MACX,CAAC,CAAC;IACN,CAAC,CAAC,OAAOC,CAAC,EAAE;MACR,IAAIA,CAAC,CAACC,OAAO,KAAK,2BAA2B,EAAE;QAC3C;MAAA,CACH,MAAM;QACH,MAAMD,CAAC;MACX;IACJ;IACA,MAAME,KAAK,GAAGT,QAAQ,EAAES,KAAK,IAAI,IAAI;IACrC;AACR;AACA;IACQ,IAAI,CAACR,QAAQ,EAAE;MACX,IAAI;QACA,MAAMJ,GAAG,CAACI,QAAQ,CAACS,MAAM,CAAC;UACtBN,UAAU,EAAEJ,QAAQ,CAACK,EAAE;UACvBM,WAAW,EAAEX,QAAQ,CAACW,WAAW;UACjCC,IAAI,EAAEZ,QAAQ,CAACY,IAAI;UACnBH;QACJ,CAAC,CAAC;MACN,CAAC,CAAC,OAAOI,EAAE,EAAE;QACTC,OAAO,CAACC,GAAG,
|
1
|
+
{"version":3,"names":["createReviewerFromIdentity","security","apw","onAfterLogin","subscribe","identity","reviewer","list","where","identityId","id","limit","e","message","email","create","displayName","type","ex","console","log","JSON","stringify","update","exports"],"sources":["createReviewerFromIdentity.ts"],"sourcesContent":["import { LifeCycleHookCallbackParams } from \"~/types\";\n\nexport const createReviewerFromIdentity = ({ security, apw }: LifeCycleHookCallbackParams) => {\n /**\n * Replicate identity in \"AdvancedPublishingWorkflow\" system after login.\n */\n security.onAfterLogin.subscribe(async ({ identity }) => {\n let reviewer;\n try {\n [[reviewer]] = await apw.reviewer.list({\n where: { identityId: identity.id },\n limit: 1\n });\n } catch (e) {\n if (e.message === \"index_not_found_exception\") {\n // Do nothing\n } else {\n throw e;\n }\n }\n const email = identity?.email || null;\n /**\n * Create a reviewer if it doesn't exist already.\n */\n if (!reviewer) {\n try {\n await apw.reviewer.create({\n identityId: identity.id,\n displayName: identity.displayName,\n type: identity.type,\n email\n });\n } catch (ex) {\n console.log(\n `There was an error while creating reviewer with identity: ${identity.id}`\n );\n console.log(JSON.stringify(ex));\n throw ex;\n }\n return;\n }\n /**\n * If \"displayName\" doesn't match it means it has been updated in the identity,\n * therefore, we need to update it on reviewer as well keep them in sync.\n */\n const update = reviewer.displayName !== identity.displayName || reviewer.email !== email;\n if (!update) {\n return;\n }\n try {\n await apw.reviewer.update(reviewer.id, {\n identityId: reviewer.identityId,\n type: reviewer.type,\n displayName: identity.displayName,\n email\n });\n } catch (ex) {\n console.log(`There was an error while updating reviewer: ${reviewer.id}`);\n console.log(JSON.stringify(ex));\n throw ex;\n }\n });\n};\n"],"mappings":";;;;;;AAEO,MAAMA,0BAA0B,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAiC,CAAC,KAAK;EAC1F;AACJ;AACA;EACID,QAAQ,CAACE,YAAY,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAS,CAAC,KAAK;IACpD,IAAIC,QAAQ;IACZ,IAAI;MACA,CAAC,CAACA,QAAQ,CAAC,CAAC,GAAG,MAAMJ,GAAG,CAACI,QAAQ,CAACC,IAAI,CAAC;QACnCC,KAAK,EAAE;UAAEC,UAAU,EAAEJ,QAAQ,CAACK;QAAG,CAAC;QAClCC,KAAK,EAAE;MACX,CAAC,CAAC;IACN,CAAC,CAAC,OAAOC,CAAC,EAAE;MACR,IAAIA,C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ACZ;EACJ,CAAC,CAAC;AACN,CAAC;AAACM,OAAA,CAAAxB,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["deleteChangeRequestsWithContentReview","apw","contentReview","onContentReviewAfterDelete","subscribe","steps","i","length","id","stepId","meta","totalCount","changeRequests","changeRequest","list","where","step","e","message","console","log","delete","exports"],"sources":["deleteChangeRequestsAfterContentReview.ts"],"sourcesContent":["import { ApwChangeRequest, LifeCycleHookCallbackParams, ListMeta } from \"~/types\";\n\nexport const deleteChangeRequestsWithContentReview = ({\n apw\n}: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.contentReview.onContentReviewAfterDelete.subscribe(async ({ contentReview }) => {\n /**\n * Also delete all associated \"changeRequest\" when a \"contentReview\" is deleted.\n */\n const steps = contentReview.steps;\n /**\n * For each step get associated change requests and delete them.\n */\n for (let i = 0; i < steps.length; i++) {\n const { id: stepId } = steps[i];\n\n let meta: Pick<ListMeta, \"totalCount\"> = {\n totalCount: 1\n };\n /**\n * Paginate through change requests.\n */\n while (meta.totalCount > 0) {\n let changeRequests: ApwChangeRequest[] = [];\n /**\n * Get all change requests.\n */\n try {\n [changeRequests, meta] = await apw.changeRequest.list({\n where: {\n step: `${contentReview.id}#${stepId}`\n }\n });\n } catch (e) {\n meta.totalCount = 0;\n if (e.message !== \"index_not_found_exception\") {\n throw e;\n }\n console.log(e);\n }\n\n /**\n * Delete change requests one by one.\n */\n for (const changeRequest of changeRequests) {\n await apw.changeRequest.delete(changeRequest.id);\n }\n }\n }\n });\n};\n"],"mappings":";;;;;;AAEO,MAAMA,qCAAqC,GAAGA,CAAC;EAClDC;AACsC,CAAC,KAAK;EAC5CA,GAAG,CAACC,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IAChF;AACR;AACA;IACQ,MAAMG,KAAK,GAAGH,aAAa,CAACG,KAAK;IACjC;AACR;AACA;IACQ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,KAAK,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;MACnC,MAAM;QAAEE,EAAE,EAAEC;MAAO,CAAC,GAAGJ,KAAK,CAACC,CAAC,CAAC;MAE/B,IAAII,IAAkC,GAAG;QACrCC,UAAU,EAAE;MAChB,CAAC;MACD;AACZ;AACA;MACY,OAAOD,IAAI,CAACC,UAAU,GAAG,CAAC,EAAE;QACxB,IAAIC,cAAkC,GAAG,EAAE;QAC3C;AAChB;AACA;QACgB,IAAI;UACA,CAACA,cAAc,EAAEF,IAAI,CAAC,GAAG,MAAMT,GAAG,CAACY,aAAa,CAACC,IAAI,CAAC;YAClDC,KAAK,EAAE;cACHC,IAAI,
|
1
|
+
{"version":3,"names":["deleteChangeRequestsWithContentReview","apw","contentReview","onContentReviewAfterDelete","subscribe","steps","i","length","id","stepId","meta","totalCount","changeRequests","changeRequest","list","where","step","e","message","console","log","delete","exports"],"sources":["deleteChangeRequestsAfterContentReview.ts"],"sourcesContent":["import { ApwChangeRequest, LifeCycleHookCallbackParams, ListMeta } from \"~/types\";\n\nexport const deleteChangeRequestsWithContentReview = ({\n apw\n}: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.contentReview.onContentReviewAfterDelete.subscribe(async ({ contentReview }) => {\n /**\n * Also delete all associated \"changeRequest\" when a \"contentReview\" is deleted.\n */\n const steps = contentReview.steps;\n /**\n * For each step get associated change requests and delete them.\n */\n for (let i = 0; i < steps.length; i++) {\n const { id: stepId } = steps[i];\n\n let meta: Pick<ListMeta, \"totalCount\"> = {\n totalCount: 1\n };\n /**\n * Paginate through change requests.\n */\n while (meta.totalCount > 0) {\n let changeRequests: ApwChangeRequest[] = [];\n /**\n * Get all change requests.\n */\n try {\n [changeRequests, meta] = await apw.changeRequest.list({\n where: {\n step: `${contentReview.id}#${stepId}`\n }\n });\n } catch (e) {\n meta.totalCount = 0;\n if (e.message !== \"index_not_found_exception\") {\n throw e;\n }\n console.log(e);\n }\n\n /**\n * Delete change requests one by one.\n */\n for (const changeRequest of changeRequests) {\n await apw.changeRequest.delete(changeRequest.id);\n }\n }\n }\n });\n};\n"],"mappings":";;;;;;AAEO,MAAMA,qCAAqC,GAAGA,CAAC;EAClDC;AACsC,CAAC,KAAK;EAC5CA,GAAG,CAACC,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IAChF;AACR;AACA;IACQ,MAAMG,KAAK,GAAGH,aAAa,CAACG,KAAK;IACjC;AACR;AACA;IACQ,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,KAAK,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;MACnC,MAAM;QAAEE,EAAE,EAAEC;MAAO,CAAC,GAAGJ,KAAK,CAACC,CAAC,CAAC;MAE/B,IAAII,IAAkC,GAAG;QACrCC,UAAU,EAAE;MAChB,CAAC;MACD;AACZ;AACA;MACY,OAAOD,IAAI,CAACC,UAAU,GAAG,CAAC,EAAE;QACxB,IAAIC,cAAkC,GAAG,EAAE;QAC3C;AAChB;AACA;QACgB,IAAI;UACA,CAACA,cAAc,EAAEF,IAAI,CAAC,GAAG,MAAMT,GAAG,CAACY,aAAa,CAACC,IAAI,CAAC;YAClDC,KAAK,EAAE;cACHC,IAAI,EAAE,GAAGd,aAAa,CAACM,EAAE,IAAIC,MAAM;YACvC;UACJ,CAAC,CAAC;QACN,CAAC,CAAC,OAAOQ,CAAC,EAAE;UACRP,IAAI,CAACC,UAAU,GAAG,CAAC;UACnB,IAAIM,CAAC,CAACC,OAAO,KAAK,2BAA2B,EAAE;YAC3C,MAAMD,CAAC;UACX;UACAE,OAAO,CAACC,GAAG,CAACH,CAAC,CAAC;QAClB;;QAEA;AAChB;AACA;QACgB,KAAK,MAAMJ,aAAa,IAAID,cAAc,EAAE;UACxC,MAAMX,GAAG,CAACY,aAAa,CAACQ,MAAM,CAACR,aAAa,CAACL,EAAE,CAAC;QACpD;MACJ;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAACc,OAAA,CAAAtB,qCAAA,GAAAA,qCAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_set","_interopRequireDefault","require","_types","_utils","_handlerGraphql","_contentApwSettingsPlugin","initializeContentReviewSteps","apw","plugins","contentReview","onContentReviewBeforeCreate","subscribe","input","type","id","settings","content","getContent","getContentGetter","NotFoundError","title","lodashSet","contentApwSettingsPlugin","getContentApwSettingsPlugin","workflowId","getWorkflowId","workflow","get","workflowSteps","steps","previousStepStatus","undefined","updatedSteps","map","step","index","status","getContentReviewStepInitialStatus","pendingChangeRequests","totalComments","isNonMandatory","every","ApwWorkflowStepTypes","NON_MANDATORY","reviewStatus","ApwContentReviewStatus","READY_TO_BE_PUBLISHED","exports"],"sources":["initializeContentReviewSteps.ts"],"sourcesContent":["import lodashSet from \"lodash/set\";\nimport {\n ApwContentReviewStatus,\n ApwContentReviewStepStatus,\n ApwContext,\n ApwWorkflowStepTypes\n} from \"~/types\";\nimport { getContentReviewStepInitialStatus } from \"~/plugins/utils\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\nimport { getContentApwSettingsPlugin } from \"~/utils/contentApwSettingsPlugin\";\n\nexport const initializeContentReviewSteps = ({ apw, plugins }: ApwContext) => {\n apw.contentReview.onContentReviewBeforeCreate.subscribe(async ({ input }) => {\n const { type, id, settings } = input.content;\n /*\n * Let's set \"title\" field value.\n */\n const getContent = apw.getContentGetter(type);\n const content = await getContent(id, settings);\n if (!content) {\n throw new NotFoundError(`Content \"${type}\" with id ${id} not found.`);\n }\n\n const { title } = content;\n input = lodashSet(input, \"title\", title);\n\n /**\n * We need to find a plugin which can get a workflow ID for the given type of content.\n */\n const contentApwSettingsPlugin = getContentApwSettingsPlugin({\n plugins,\n type\n });\n\n const workflowId = contentApwSettingsPlugin.getWorkflowId(content);\n\n /**\n * Let's initialize the \"ContentReview\" steps.\n */\n if (!workflowId) {\n throw new NotFoundError(`Unable to initiate a \"Content review\". No workflow found!`);\n }\n\n input.workflowId = workflowId;\n\n const workflow = await apw.workflow.get(workflowId);\n const workflowSteps = workflow.steps;\n\n let previousStepStatus: ApwContentReviewStepStatus | undefined = undefined;\n const updatedSteps = workflow.steps.map((step, index) => {\n const status = getContentReviewStepInitialStatus(\n workflowSteps,\n index,\n previousStepStatus\n );\n previousStepStatus = status;\n return {\n ...step,\n status,\n pendingChangeRequests: 0,\n totalComments: 0\n };\n });\n /**\n * If there are only steps which are not mandatory ones, put review status to ApwContentReviewStatus.READY_TO_BE_PUBLISHED.\n */\n const isNonMandatory = updatedSteps.every(step => {\n return step.type === ApwWorkflowStepTypes.NON_MANDATORY;\n });\n if (isNonMandatory) {\n input.reviewStatus = ApwContentReviewStatus.READY_TO_BE_PUBLISHED;\n }\n\n input = lodashSet(input, \"steps\", updatedSteps);\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AAEO,MAAMK,4BAA4B,GAAGA,CAAC;EAAEC,GAAG;EAAEC;AAAoB,CAAC,KAAK;EAC1ED,GAAG,CAACE,aAAa,CAACC,2BAA2B,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAM,CAAC,KAAK;IACzE,MAAM;MAAEC,IAAI;MAAEC,EAAE;MAAEC;IAAS,CAAC,GAAGH,KAAK,CAACI,OAAO;IAC5C;AACR;AACA;IACQ,MAAMC,UAAU,GAAGV,GAAG,CAACW,gBAAgB,CAACL,IAAI,CAAC;IAC7C,MAAMG,OAAO,GAAG,MAAMC,UAAU,CAACH,EAAE,EAAEC,QAAQ,CAAC;IAC9C,IAAI,CAACC,OAAO,EAAE;MACV,MAAM,IAAIG,6BAAa,
|
1
|
+
{"version":3,"names":["_set","_interopRequireDefault","require","_types","_utils","_handlerGraphql","_contentApwSettingsPlugin","initializeContentReviewSteps","apw","plugins","contentReview","onContentReviewBeforeCreate","subscribe","input","type","id","settings","content","getContent","getContentGetter","NotFoundError","title","lodashSet","contentApwSettingsPlugin","getContentApwSettingsPlugin","workflowId","getWorkflowId","workflow","get","workflowSteps","steps","previousStepStatus","undefined","updatedSteps","map","step","index","status","getContentReviewStepInitialStatus","pendingChangeRequests","totalComments","isNonMandatory","every","ApwWorkflowStepTypes","NON_MANDATORY","reviewStatus","ApwContentReviewStatus","READY_TO_BE_PUBLISHED","exports"],"sources":["initializeContentReviewSteps.ts"],"sourcesContent":["import lodashSet from \"lodash/set\";\nimport {\n ApwContentReviewStatus,\n ApwContentReviewStepStatus,\n ApwContext,\n ApwWorkflowStepTypes\n} from \"~/types\";\nimport { getContentReviewStepInitialStatus } from \"~/plugins/utils\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\nimport { getContentApwSettingsPlugin } from \"~/utils/contentApwSettingsPlugin\";\n\nexport const initializeContentReviewSteps = ({ apw, plugins }: ApwContext) => {\n apw.contentReview.onContentReviewBeforeCreate.subscribe(async ({ input }) => {\n const { type, id, settings } = input.content;\n /*\n * Let's set \"title\" field value.\n */\n const getContent = apw.getContentGetter(type);\n const content = await getContent(id, settings);\n if (!content) {\n throw new NotFoundError(`Content \"${type}\" with id ${id} not found.`);\n }\n\n const { title } = content;\n input = lodashSet(input, \"title\", title);\n\n /**\n * We need to find a plugin which can get a workflow ID for the given type of content.\n */\n const contentApwSettingsPlugin = getContentApwSettingsPlugin({\n plugins,\n type\n });\n\n const workflowId = contentApwSettingsPlugin.getWorkflowId(content);\n\n /**\n * Let's initialize the \"ContentReview\" steps.\n */\n if (!workflowId) {\n throw new NotFoundError(`Unable to initiate a \"Content review\". No workflow found!`);\n }\n\n input.workflowId = workflowId;\n\n const workflow = await apw.workflow.get(workflowId);\n const workflowSteps = workflow.steps;\n\n let previousStepStatus: ApwContentReviewStepStatus | undefined = undefined;\n const updatedSteps = workflow.steps.map((step, index) => {\n const status = getContentReviewStepInitialStatus(\n workflowSteps,\n index,\n previousStepStatus\n );\n previousStepStatus = status;\n return {\n ...step,\n status,\n pendingChangeRequests: 0,\n totalComments: 0\n };\n });\n /**\n * If there are only steps which are not mandatory ones, put review status to ApwContentReviewStatus.READY_TO_BE_PUBLISHED.\n */\n const isNonMandatory = updatedSteps.every(step => {\n return step.type === ApwWorkflowStepTypes.NON_MANDATORY;\n });\n if (isNonMandatory) {\n input.reviewStatus = ApwContentReviewStatus.READY_TO_BE_PUBLISHED;\n }\n\n input = lodashSet(input, \"steps\", updatedSteps);\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AAEO,MAAMK,4BAA4B,GAAGA,CAAC;EAAEC,GAAG;EAAEC;AAAoB,CAAC,KAAK;EAC1ED,GAAG,CAACE,aAAa,CAACC,2BAA2B,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAM,CAAC,KAAK;IACzE,MAAM;MAAEC,IAAI;MAAEC,EAAE;MAAEC;IAAS,CAAC,GAAGH,KAAK,CAACI,OAAO;IAC5C;AACR;AACA;IACQ,MAAMC,UAAU,GAAGV,GAAG,CAACW,gBAAgB,CAACL,IAAI,CAAC;IAC7C,MAAMG,OAAO,GAAG,MAAMC,UAAU,CAACH,EAAE,EAAEC,QAAQ,CAAC;IAC9C,IAAI,CAACC,OAAO,EAAE;MACV,MAAM,IAAIG,6BAAa,CAAC,YAAYN,IAAI,aAAaC,EAAE,aAAa,CAAC;IACzE;IAEA,MAAM;MAAEM;IAAM,CAAC,GAAGJ,OAAO;IACzBJ,KAAK,GAAG,IAAAS,YAAS,EAACT,KAAK,EAAE,OAAO,EAA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-1 +1 @@
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_utils","_contentUrl","_sendChangeRequestNotification","_reviewers","_changeRequestUrl","_appUrl","attachChangeRequestAfterCreate","context","apw","changeRequest","onChangeRequestAfterCreate","subscribe","execute","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","WebinyError","settings","getAppUrl","changeRequestUrl","createChangeRequestUrl","baseUrl","appUrl","changeRequestId","contentReview","get","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendChangeRequestNotification","ex","error","message","code","data","stack","security","withoutAuthorization","exports"],"sources":["changeRequestAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { sendChangeRequestNotification } from \"./sendChangeRequestNotification\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { createChangeRequestUrl } from \"./changeRequestUrl\";\nimport { getAppUrl } from \"~/plugins/hooks/notifications/appUrl\";\n\nexport const attachChangeRequestAfterCreate = (context: ApwContext): void => {\n context.apw.changeRequest.onChangeRequestAfterCreate.subscribe(async ({ changeRequest }) => {\n const execute = async () => {\n const { id: contentReviewId, stepId } = extractContentReviewIdAndStep(\n changeRequest.step\n );\n if (!stepId) {\n throw new WebinyError(\"Malformed changeRequest.step value.\", \"MALFORMED_VALUE\", {\n step: changeRequest.step\n });\n }\n\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n /**\n * We will check if we can create a comment url before we go digging further into the database.\n */\n const changeRequestUrl = createChangeRequestUrl({\n baseUrl: settings.appUrl,\n changeRequestId: changeRequest.id,\n contentReviewId,\n stepId\n });\n if (!changeRequestUrl) {\n return;\n }\n /**\n * Let's see if content review exists.\n */\n const contentReview = await context.apw.contentReview.get(contentReviewId);\n if (!contentReview) {\n throw new WebinyError(\n `There is no contentReview with id \"${contentReviewId}\".`,\n \"CONTENT_REVIEW_NOT_FOUND\",\n {\n contentReviewId\n }\n );\n }\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with workflowId \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [changeRequest.createdBy.id]\n });\n if (reviewers.length === 0) {\n return;\n }\n\n try {\n await sendChangeRequestNotification({\n context,\n reviewers,\n changeRequest,\n contentReview,\n workflow,\n changeRequestUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send change request notifications.`,\n \"CHANGE_REQUEST_NOTIFICATIONS_NOT_SENT\",\n {\n workflowId: workflow.id,\n changeRequestId: changeRequest.id,\n contentReviewId,\n changeRequestUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEO,MAAMO,8BAA8B,GAAIC,OAAmB,IAAW;EACzEA,OAAO,CAACC,GAAG,CAACC,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IACxF,MAAMG,OAAO,GAAG,MAAAA,CAAA,KAAY;MACxB,MAAM;QAAEC,EAAE,EAAEC,eAAe;QAAEC;MAAO,CAAC,GAAG,IAAAC,oCAA6B,EACjEP,aAAa,CAACQ,IAClB,CAAC;MACD,IAAI,CAACF,MAAM,EAAE;QACT,MAAM,IAAIG,cAAW,CAAC,qCAAqC,EAAE,iBAAiB,EAAE;UAC5ED,IAAI,EAAER,aAAa,CAACQ;QACxB,CAAC,CAAC;MACN;MAEA,MAAME,QAAQ,GAAG,MAAM,IAAAC,iBAAS,EAACb,OAAO,CAAC;MACzC,IAAI,CAACY,QAAQ,EAAE;QACX;MACJ;MACA;AACZ;AACA;MACY,MAAME,gBAAgB,GAAG,IAAAC,wCAAsB,EAAC;QAC5CC,OAAO,EAAEJ,QAAQ,CAACK,MAAM;QACxBC,eAAe,EAAEhB,aAAa,CAACI,EAAE;QACjCC,eAAe;QACfC;MACJ,CAAC,CAAC;MACF,IAAI,CAACM,gBAAgB,EAAE;QACnB;MACJ;MACA;AACZ;AACA;MACY,MAAMK,aAAa,GAAG,MAAMnB,OAAO,CAACC,GAAG,CAACkB,aAAa,CAACC,GAAG,CAACb,eAAe,CAAC;MAC1E,IAAI,CAACY,aAAa,EAAE;QAChB,MAAM,IAAIR,cAAW,
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_utils","_contentUrl","_sendChangeRequestNotification","_reviewers","_changeRequestUrl","_appUrl","attachChangeRequestAfterCreate","context","apw","changeRequest","onChangeRequestAfterCreate","subscribe","execute","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","WebinyError","settings","getAppUrl","changeRequestUrl","createChangeRequestUrl","baseUrl","appUrl","changeRequestId","contentReview","get","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendChangeRequestNotification","ex","error","message","code","data","stack","security","withoutAuthorization","exports"],"sources":["changeRequestAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { sendChangeRequestNotification } from \"./sendChangeRequestNotification\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { createChangeRequestUrl } from \"./changeRequestUrl\";\nimport { getAppUrl } from \"~/plugins/hooks/notifications/appUrl\";\n\nexport const attachChangeRequestAfterCreate = (context: ApwContext): void => {\n context.apw.changeRequest.onChangeRequestAfterCreate.subscribe(async ({ changeRequest }) => {\n const execute = async () => {\n const { id: contentReviewId, stepId } = extractContentReviewIdAndStep(\n changeRequest.step\n );\n if (!stepId) {\n throw new WebinyError(\"Malformed changeRequest.step value.\", \"MALFORMED_VALUE\", {\n step: changeRequest.step\n });\n }\n\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n /**\n * We will check if we can create a comment url before we go digging further into the database.\n */\n const changeRequestUrl = createChangeRequestUrl({\n baseUrl: settings.appUrl,\n changeRequestId: changeRequest.id,\n contentReviewId,\n stepId\n });\n if (!changeRequestUrl) {\n return;\n }\n /**\n * Let's see if content review exists.\n */\n const contentReview = await context.apw.contentReview.get(contentReviewId);\n if (!contentReview) {\n throw new WebinyError(\n `There is no contentReview with id \"${contentReviewId}\".`,\n \"CONTENT_REVIEW_NOT_FOUND\",\n {\n contentReviewId\n }\n );\n }\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with workflowId \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [changeRequest.createdBy.id]\n });\n if (reviewers.length === 0) {\n return;\n }\n\n try {\n await sendChangeRequestNotification({\n context,\n reviewers,\n changeRequest,\n contentReview,\n workflow,\n changeRequestUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send change request notifications.`,\n \"CHANGE_REQUEST_NOTIFICATIONS_NOT_SENT\",\n {\n workflowId: workflow.id,\n changeRequestId: changeRequest.id,\n contentReviewId,\n changeRequestUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEO,MAAMO,8BAA8B,GAAIC,OAAmB,IAAW;EACzEA,OAAO,CAACC,GAAG,CAACC,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IACxF,MAAMG,OAAO,GAAG,MAAAA,CAAA,KAAY;MACxB,MAAM;QAAEC,EAAE,EAAEC,eAAe;QAAEC;MAAO,CAAC,GAAG,IAAAC,oCAA6B,EACjEP,aAAa,CAACQ,IAClB,CAAC;MACD,IAAI,CAACF,MAAM,EAAE;QACT,MAAM,IAAIG,cAAW,CAAC,qCAAqC,EAAE,iBAAiB,EAAE;UAC5ED,IAAI,EAAER,aAAa,CAACQ;QACxB,CAAC,CAAC;MACN;MAEA,MAAME,QAAQ,GAAG,MAAM,IAAAC,iBAAS,EAACb,OAAO,CAAC;MACzC,IAAI,CAACY,QAAQ,EAAE;QACX;MACJ;MACA;AACZ;AACA;MACY,MAAME,gBAAgB,GAAG,IAAAC,wCAAsB,EAAC;QAC5CC,OAAO,EAAEJ,QAAQ,CAACK,MAAM;QACxBC,eAAe,EAAEhB,aAAa,CAACI,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AE,EAAE;QACT,MAAM,IAAIrB,cAAW,CACjB,8CAA8C,EAC9C,uCAAuC,EACvC;UACIW,UAAU,EAAED,QAAQ,CAACf,EAAE;UACvBY,eAAe,EAAEhB,aAAa,CAACI,EAAE;UACjCC,eAAe;UACfO,gBAAgB;UAChBS,UAAU;UACVU,KAAK,EAAE;YACHC,OAAO,EAAEF,EAAE,CAACE,OAAO;YACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;YACbC,IAAI,EAAEJ,EAAE,CAACI,IAAI;YACbC,KAAK,EAAEL,EAAE,CAACK;UACd;QACJ,CACJ,CAAC;MACL;IACJ,CAAC;IAED,MAAMrC,OAAO,CAACsC,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACpD,OAAOlC,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACmC,OAAA,CAAAzC,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createChangeRequestUrl","params","key","console","log","baseUrl","changeRequestId","contentReviewId","stepId","exports"],"sources":["changeRequestUrl.ts"],"sourcesContent":["interface Params {\n baseUrl?: string;\n changeRequestId: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createChangeRequestUrl = (params: Params) => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, changeRequestId, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;\n};\n"],"mappings":";;;;;;AAMO,MAAMA,sBAAsB,GAAIC,MAAc,IAAK;EACtD;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,
|
1
|
+
{"version":3,"names":["createChangeRequestUrl","params","key","console","log","baseUrl","changeRequestId","contentReviewId","stepId","exports"],"sources":["changeRequestUrl.ts"],"sourcesContent":["interface Params {\n baseUrl?: string;\n changeRequestId: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createChangeRequestUrl = (params: Params) => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, changeRequestId, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;\n};\n"],"mappings":";;;;;;AAMO,MAAMA,sBAAsB,GAAIC,MAAc,IAAK;EACtD;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,CAAC,qBAAqBF,GAAG,0CAA0C,CAAC;IAC/E,OAAO,IAAI;EACf;EACA,MAAM;IAAEG,OAAO;IAAEC,eAAe;IAAEC,eAAe;IAAEC;EAAO,CAAC,GAAGP,MAAM;EAEpE,OAAO,GAAGI,OAAO,wBAAwBE,eAAe,IAAIC,MAAM,IAAIF,eAAe,EAAE;AAC3F,CAAC;AAACG,OAAA,CAAAT,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_utils","_contentUrl","_commentUrl","_reviewers","_sendCommentNotification","_appUrl","attachCommentAfterCreate","context","apw","comment","onCommentAfterCreate","subscribe","execute","changeRequest","get","WebinyError","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","settings","getAppUrl","commentUrl","createCommentUrl","baseUrl","appUrl","changeRequestId","console","log","contentReview","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendCommentNotification","ex","commentId","error","message","code","data","stack","security","withoutAuthorization","exports"],"sources":["commentAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { createCommentUrl } from \"./commentUrl\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { sendCommentNotification } from \"./sendCommentNotification\";\nimport { getAppUrl } from \"~/plugins/hooks/notifications/appUrl\";\n\nexport const attachCommentAfterCreate = (context: ApwContext): void => {\n context.apw.comment.onCommentAfterCreate.subscribe(async ({ comment }) => {\n const execute = async () => {\n const changeRequest = await context.apw.changeRequest.get(comment.changeRequest);\n if (!changeRequest) {\n throw new WebinyError(\"Missing change request.\", \"CHANGE_REQUEST_NOT_FOUND\", {\n changeRequest: comment.changeRequest,\n comment: comment.id\n });\n }\n\n const { id: contentReviewId, stepId } = extractContentReviewIdAndStep(\n changeRequest.step\n );\n if (!stepId) {\n throw new WebinyError(\"Malformed changeRequest.step value.\", \"MALFORMED_VALUE\", {\n step: changeRequest.step\n });\n }\n\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n /**\n * We will check if we can create a comment url before we go digging further into the database.\n */\n const commentUrl = createCommentUrl({\n baseUrl: settings.appUrl,\n changeRequestId: changeRequest.id,\n contentReviewId,\n stepId\n });\n if (!commentUrl) {\n console.log(\"No comment url.\");\n return;\n }\n /**\n * Let's see if content review exists.\n */\n const contentReview = await context.apw.contentReview.get(contentReviewId);\n if (!contentReview) {\n throw new WebinyError(\n `There is no contentReview with id \"${contentReviewId}\".`,\n \"CONTENT_REVIEW_NOT_FOUND\",\n {\n contentReviewId\n }\n );\n }\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with workflowId \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n console.log(\"No content url.\");\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [comment.createdBy.id]\n });\n\n if (reviewers.length === 0) {\n console.log(\"No reviewers to send the e-mail notification to.\");\n return;\n }\n\n try {\n await sendCommentNotification({\n context,\n reviewers,\n changeRequest,\n contentReview,\n workflow,\n commentUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send comment notifications.`,\n \"COMMENT_NOTIFICATIONS_NOT_SENT\",\n {\n commentId: comment.id,\n workflowId: workflow.id,\n changeRequestId: changeRequest.id,\n contentReviewId,\n commentUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,wBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEO,MAAMO,wBAAwB,GAAIC,OAAmB,IAAW;EACnEA,OAAO,CAACC,GAAG,CAACC,OAAO,CAACC,oBAAoB,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAQ,CAAC,KAAK;IACtE,MAAMG,OAAO,GAAG,MAAAA,CAAA,KAAY;MACxB,MAAMC,aAAa,GAAG,MAAMN,OAAO,CAACC,GAAG,CAACK,aAAa,CAACC,GAAG,CAACL,OAAO,CAACI,aAAa,CAAC;MAChF,IAAI,CAACA,aAAa,EAAE;QAChB,MAAM,IAAIE,cAAW,CAAC,yBAAyB,EAAE,0BAA0B,EAAE;UACzEF,aAAa,EAAEJ,OAAO,CAACI,aAAa;UACpCJ,OAAO,EAAEA,OAAO,CAACO;QACrB,CAAC,CAAC;MACN;MAEA,MAAM;QAAEA,EAAE,EAAEC,eAAe;QAAEC;MAAO,CAAC,GAAG,IAAAC,oCAA6B,EACjEN,aAAa,CAACO,IAClB,CAAC;MACD,IAAI,CAACF,MAAM,EAAE;QACT,MAAM,IAAIH,cAAW,CAAC,qCAAqC,EAAE,iBAAiB,EAAE;UAC5EK,IAAI,EAAEP,aAAa,CAACO;QACxB,CAAC,CAAC;MACN;MAEA,MAAMC,QAAQ,GAAG,MAAM,IAAAC,iBAAS,EAACf,OAAO,CAAC;MACzC,IAAI,CAACc,QAAQ,EAAE;QACX;MACJ;MACA;AACZ;AACA;MACY,MAAME,UAAU,GAAG,IAAAC,4BAAgB,EAAC;QAChCC,OAAO,EAAEJ,QAAQ,CAACK,MAAM;QACxBC,eAAe,EAAEd,aAAa,CAACG,EAAE;QACjCC,eAAe;QACfC;MACJ,CAAC,CAAC;MACF,IAAI,CAACK,UAAU,EAAE;QACbK,OAAO,CAACC,GAAG,CAAC,iBAAiB,CAAC;QAC9B;MACJ;MACA;AACZ;AACA;MACY,MAAMC,aAAa,GAAG,MAAMvB,OAAO,CAACC,GAAG,CAACsB,aAAa,CAAChB,GAAG,CAACG,eAAe,CAAC;MAC1E,IAAI,CAACa,aAAa,EAAE;QAChB,MAAM,IAAIf,cAAW,
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_utils","_contentUrl","_commentUrl","_reviewers","_sendCommentNotification","_appUrl","attachCommentAfterCreate","context","apw","comment","onCommentAfterCreate","subscribe","execute","changeRequest","get","WebinyError","id","contentReviewId","stepId","extractContentReviewIdAndStep","step","settings","getAppUrl","commentUrl","createCommentUrl","baseUrl","appUrl","changeRequestId","console","log","contentReview","workflow","workflowId","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","length","sendCommentNotification","ex","commentId","error","message","code","data","stack","security","withoutAuthorization","exports"],"sources":["commentAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { createCommentUrl } from \"./commentUrl\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { sendCommentNotification } from \"./sendCommentNotification\";\nimport { getAppUrl } from \"~/plugins/hooks/notifications/appUrl\";\n\nexport const attachCommentAfterCreate = (context: ApwContext): void => {\n context.apw.comment.onCommentAfterCreate.subscribe(async ({ comment }) => {\n const execute = async () => {\n const changeRequest = await context.apw.changeRequest.get(comment.changeRequest);\n if (!changeRequest) {\n throw new WebinyError(\"Missing change request.\", \"CHANGE_REQUEST_NOT_FOUND\", {\n changeRequest: comment.changeRequest,\n comment: comment.id\n });\n }\n\n const { id: contentReviewId, stepId } = extractContentReviewIdAndStep(\n changeRequest.step\n );\n if (!stepId) {\n throw new WebinyError(\"Malformed changeRequest.step value.\", \"MALFORMED_VALUE\", {\n step: changeRequest.step\n });\n }\n\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n /**\n * We will check if we can create a comment url before we go digging further into the database.\n */\n const commentUrl = createCommentUrl({\n baseUrl: settings.appUrl,\n changeRequestId: changeRequest.id,\n contentReviewId,\n stepId\n });\n if (!commentUrl) {\n console.log(\"No comment url.\");\n return;\n }\n /**\n * Let's see if content review exists.\n */\n const contentReview = await context.apw.contentReview.get(contentReviewId);\n if (!contentReview) {\n throw new WebinyError(\n `There is no contentReview with id \"${contentReviewId}\".`,\n \"CONTENT_REVIEW_NOT_FOUND\",\n {\n contentReviewId\n }\n );\n }\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with workflowId \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n console.log(\"No content url.\");\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [comment.createdBy.id]\n });\n\n if (reviewers.length === 0) {\n console.log(\"No reviewers to send the e-mail notification to.\");\n return;\n }\n\n try {\n await sendCommentNotification({\n context,\n reviewers,\n changeRequest,\n contentReview,\n workflow,\n commentUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send comment notifications.`,\n \"COMMENT_NOTIFICATIONS_NOT_SENT\",\n {\n commentId: comment.id,\n workflowId: workflow.id,\n changeRequestId: changeRequest.id,\n contentReviewId,\n commentUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,wBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEO,MAAMO,wBAAwB,GAAIC,OAAmB,IAAW;EACnEA,OAAO,CAACC,GAAG,CAACC,OAAO,CAACC,oBAAoB,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAQ,CAAC,KAAK;IACtE,MAAMG,OAAO,GAAG,MAAAA,CAAA,KAAY;MACxB,MAAMC,aAAa,GAAG,MAAMN,OAAO,CAACC,GAAG,CAACK,aAAa,CAACC,GAAG,CAACL,OAAO,CAACI,aAAa,CAAC;MAChF,IAAI,CAACA,aAAa,EAAE;QAChB,MAAM,IAAIE,cAAW,CAAC,yBAAyB,EAAE,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AY;MACpD,OAAOtC,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACuC,OAAA,CAAA7C,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createCommentUrl","params","key","console","log","baseUrl","changeRequestId","contentReviewId","stepId","exports"],"sources":["commentUrl.ts"],"sourcesContent":["interface CreateCommentUrlParams {\n baseUrl?: string;\n changeRequestId: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createCommentUrl = (params: CreateCommentUrlParams): string | null => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, changeRequestId, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;\n};\n"],"mappings":";;;;;;AAMO,MAAMA,gBAAgB,GAAIC,MAA8B,IAAoB;EAC/E;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,
|
1
|
+
{"version":3,"names":["createCommentUrl","params","key","console","log","baseUrl","changeRequestId","contentReviewId","stepId","exports"],"sources":["commentUrl.ts"],"sourcesContent":["interface CreateCommentUrlParams {\n baseUrl?: string;\n changeRequestId: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createCommentUrl = (params: CreateCommentUrlParams): string | null => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, changeRequestId, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;\n};\n"],"mappings":";;;;;;AAMO,MAAMA,gBAAgB,GAAIC,MAA8B,IAAoB;EAC/E;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,CAAC,qBAAqBF,GAAG,0CAA0C,CAAC;IAC/E,OAAO,IAAI;EACf;EACA,MAAM;IAAEG,OAAO;IAAEC,eAAe;IAAEC,eAAe;IAAEC;EAAO,CAAC,GAAGP,MAAM;EAEpE,OAAO,GAAGI,OAAO,wBAAwBE,eAAe,IAAIC,MAAM,IAAIF,eAAe,EAAE;AAC3F,CAAC;AAACG,OAAA,CAAAT,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_appUrl","_contentReviewUrl","_contentUrl","_reviewers","_sendContentReviewNotification","attachContentReviewAfterCreate","context","apw","contentReview","onContentReviewAfterCreate","subscribe","execute","steps","length","step","id","settings","getAppUrl","contentReviewUrl","createContentReviewUrl","baseUrl","appUrl","contentReviewId","stepId","workflow","get","workflowId","WebinyError","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","sendContentReviewNotification","ex","error","message","code","data","stack","security","withoutAuthorization","exports"],"sources":["contentReviewAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { getAppUrl } from \"./appUrl\";\nimport { createContentReviewUrl } from \"./contentReviewUrl\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { sendContentReviewNotification } from \"./sendContentReviewNotification\";\n\nexport const attachContentReviewAfterCreate = (context: ApwContext): void => {\n context.apw.contentReview.onContentReviewAfterCreate.subscribe(async ({ contentReview }) => {\n const execute = async () => {\n if (contentReview.steps.length === 0) {\n return;\n }\n const [step] = contentReview.steps;\n if (!step?.id) {\n return;\n }\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n\n const contentReviewUrl = createContentReviewUrl({\n baseUrl: settings.appUrl,\n contentReviewId: contentReview.id,\n stepId: step.id\n });\n if (!contentReviewUrl) {\n return;\n }\n\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with Id \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [contentReview.createdBy.id]\n });\n if (reviewers.length === 0) {\n return;\n }\n\n try {\n await sendContentReviewNotification({\n context,\n reviewers,\n contentReview,\n workflow,\n contentReviewUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send content review notifications.`,\n \"CONTENT_REVIEW_NOTIFICATIONS_NOT_SENT\",\n {\n workflowId: workflow.id,\n contentReviewId: contentReview.id,\n contentReviewUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,8BAAA,GAAAL,OAAA;AAEO,MAAMM,8BAA8B,GAAIC,OAAmB,IAAW;EACzEA,OAAO,CAACC,GAAG,CAACC,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IACxF,MAAMG,OAAO,GAAG,MAAAA,CAAA,KAAY;MACxB,IAAIH,aAAa,CAACI,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;QAClC;MACJ;MACA,MAAM,CAACC,IAAI,CAAC,GAAGN,aAAa,CAACI,KAAK;MAClC,IAAI,CAACE,IAAI,EAAEC,EAAE,EAAE;QACX;MACJ;MACA,MAAMC,QAAQ,GAAG,MAAM,IAAAC,iBAAS,EAACX,OAAO,CAAC;MACzC,IAAI,CAACU,QAAQ,EAAE;QACX;MACJ;MAEA,MAAME,gBAAgB,GAAG,IAAAC,wCAAsB,EAAC;QAC5CC,OAAO,EAAEJ,QAAQ,CAACK,MAAM;QACxBC,eAAe,EAAEd,aAAa,CAACO,EAAE;QACjCQ,MAAM,EAAET,IAAI,CAACC;MACjB,CAAC,CAAC;MACF,IAAI,CAACG,gBAAgB,EAAE;QACnB;MACJ;;MAEA;AACZ;AACA;MACY,MAAMM,QAAQ,GAAG,MAAMlB,OAAO,CAACC,GAAG,CAACiB,QAAQ,CAACC,GAAG,CAACjB,aAAa,CAACkB,UAAU,CAAC;MACzE,IAAI,CAACF,QAAQ,EAAE;QACX,MAAM,IAAIG,cAAW,
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_appUrl","_contentReviewUrl","_contentUrl","_reviewers","_sendContentReviewNotification","attachContentReviewAfterCreate","context","apw","contentReview","onContentReviewAfterCreate","subscribe","execute","steps","length","step","id","settings","getAppUrl","contentReviewUrl","createContentReviewUrl","baseUrl","appUrl","contentReviewId","stepId","workflow","get","workflowId","WebinyError","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","sendContentReviewNotification","ex","error","message","code","data","stack","security","withoutAuthorization","exports"],"sources":["contentReviewAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { getAppUrl } from \"./appUrl\";\nimport { createContentReviewUrl } from \"./contentReviewUrl\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { sendContentReviewNotification } from \"./sendContentReviewNotification\";\n\nexport const attachContentReviewAfterCreate = (context: ApwContext): void => {\n context.apw.contentReview.onContentReviewAfterCreate.subscribe(async ({ contentReview }) => {\n const execute = async () => {\n if (contentReview.steps.length === 0) {\n return;\n }\n const [step] = contentReview.steps;\n if (!step?.id) {\n return;\n }\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n\n const contentReviewUrl = createContentReviewUrl({\n baseUrl: settings.appUrl,\n contentReviewId: contentReview.id,\n stepId: step.id\n });\n if (!contentReviewUrl) {\n return;\n }\n\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with Id \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [contentReview.createdBy.id]\n });\n if (reviewers.length === 0) {\n return;\n }\n\n try {\n await sendContentReviewNotification({\n context,\n reviewers,\n contentReview,\n workflow,\n contentReviewUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send content review notifications.`,\n \"CONTENT_REVIEW_NOTIFICATIONS_NOT_SENT\",\n {\n workflowId: workflow.id,\n contentReviewId: contentReview.id,\n contentReviewUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OA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Bb,aAAa;QACbgB;MACJ,CAAC,CAAC;MACF,IAAI,CAACI,UAAU,EAAE;QACb;MACJ;MAEA,MAAMG,SAAS,GAAG,MAAM,IAAAC,yBAAc,EAAC;QACnC1B,OAAO;QACPkB,QAAQ;QACRS,OAAO,EAAE,CAACzB,aAAa,CAAC0B,SAAS,CAACnB,EAAE;MACxC,CAAC,CAAC;MACF,IAAIgB,SAAS,CAAClB,MAAM,KAAK,CAAC,EAAE;QACxB;MACJ;MAEA,IAAI;QACA,MAAM,IAAAsB,4DAA6B,EAAC;UAChC7B,OAAO;UACPyB,SAAS;UACTvB,aAAa;UACbgB,QAAQ;UACRN,gBAAgB;UAChBU;QACJ,CAAC,CAAC;MACN,CAAC,CAAC,OAAOQ,EAAE,EAAE;QACT,MAAM,IAAIT,cAAW,CACjB,8CAA8C,EAC9C,uCAAuC,EACvC;UACID,UAAU,EAAEF,QAAQ,CAACT,EAAE;UACvBO,eAAe,EAAEd,aAAa,CAACO,EAAE;UACjCG,gBAAgB;UAChBU,UAAU;UACVS,KAAK,EAAE;YACHC,OAAO,EAAEF,EAAE,CAACE,OAAO;YACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;YACbC,IAAI,EAAEJ,EAAE,CAACI,IAAI;YACbC,KAAK,EAAEL,EAAE,CAACK;UACd;QACJ,CACJ,CAAC;MACL;IACJ,CAAC;IAED,MAAMnC,OAAO,CAACoC,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACpD,OAAOhC,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACiC,OAAA,CAAAvC,8BAAA,GAAAA,8BAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createContentReviewUrl","params","key","console","log","baseUrl","contentReviewId","stepId","exports"],"sources":["contentReviewUrl.ts"],"sourcesContent":["interface Params {\n baseUrl?: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createContentReviewUrl = (params: Params) => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}`;\n};\n"],"mappings":";;;;;;AAKO,MAAMA,sBAAsB,GAAIC,MAAc,IAAK;EACtD;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,
|
1
|
+
{"version":3,"names":["createContentReviewUrl","params","key","console","log","baseUrl","contentReviewId","stepId","exports"],"sources":["contentReviewUrl.ts"],"sourcesContent":["interface Params {\n baseUrl?: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createContentReviewUrl = (params: Params) => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}`;\n};\n"],"mappings":";;;;;;AAKO,MAAMA,sBAAsB,GAAIC,MAAc,IAAK;EACtD;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,CAAC,qBAAqBF,GAAG,0CAA0C,CAAC;IAC/E,OAAO,IAAI;EACf;EACA,MAAM;IAAEG,OAAO;IAAEC,eAAe;IAAEC;EAAO,CAAC,GAAGN,MAAM;EAEnD,OAAO,GAAGI,OAAO,wBAAwBC,eAAe,IAAIC,MAAM,EAAE;AACxE,CAAC;AAACC,OAAA,CAAAR,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_lastChangeRequestNotificationPlugin","require","sendChangeRequestNotification","params","context","reviewers","contentReview","length","changeRequestPlugin","getLastChangeRequestNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendChangeRequestNotification.ts"],"sourcesContent":["import { getLastChangeRequestNotificationPlugin } from \"./lastChangeRequestNotificationPlugin\";\nimport { ApwChangeRequestNotificationCbParams } from \"~/ApwChangeRequestNotification\";\n\nexport const sendChangeRequestNotification = async (\n params: ApwChangeRequestNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const changeRequestPlugin = getLastChangeRequestNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!changeRequestPlugin) {\n console.log(\"No e-mail body change request plugin.\");\n return;\n }\n\n const body = changeRequestPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the change request plugin: ${changeRequestPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new change request on the Content Review you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oCAAA,GAAAC,OAAA;AAGO,MAAMC,6BAA6B,GAAG,MACzCC,MAA4C,IAC5B;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,mBAAmB,GAAG,IAAAC,2EAAsC,EAAC;IAC/DL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,mBAAmB,EAAE;IACtBI,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;IACpD;EACJ;EAEA,MAAMC,IAAI,GAAGN,mBAAmB,CAACO,MAAM,CAACZ,MAAM,CAAC;EAC/C,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,
|
1
|
+
{"version":3,"names":["_lastChangeRequestNotificationPlugin","require","sendChangeRequestNotification","params","context","reviewers","contentReview","length","changeRequestPlugin","getLastChangeRequestNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendChangeRequestNotification.ts"],"sourcesContent":["import { getLastChangeRequestNotificationPlugin } from \"./lastChangeRequestNotificationPlugin\";\nimport { ApwChangeRequestNotificationCbParams } from \"~/ApwChangeRequestNotification\";\n\nexport const sendChangeRequestNotification = async (\n params: ApwChangeRequestNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const changeRequestPlugin = getLastChangeRequestNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!changeRequestPlugin) {\n console.log(\"No e-mail body change request plugin.\");\n return;\n }\n\n const body = changeRequestPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the change request plugin: ${changeRequestPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new change request on the Content Review you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oCAAA,GAAAC,OAAA;AAGO,MAAMC,6BAA6B,GAAG,MACzCC,MAA4C,IAC5B;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,mBAAmB,GAAG,IAAAC,2EAAsC,EAAC;IAC/DL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,mBAAmB,EAAE;IACtBI,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;IACpD;EACJ;EAEA,MAAMC,IAAI,GAAGN,mBAAmB,CAACO,MAAM,CAACZ,MAAM,CAAC;EAC/C,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,CAAC,kDAAkDL,mBAAmB,CAACQ,IAAI,EAAE,CAAC;IACzF;EACJ;EAEA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACc,MAAM,CAACC,QAAQ,CAAC;IACzCC,GAAG,EAAEf,SAAS,CAACgB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC;IAChCC,OAAO,EAAE,0EAA0E;IACnFC,IAAI,EAAEX,IAAI,CAACW,IAAI;IACfC,IAAI,EAAEZ,IAAI,CAACY,IAAI,IAAIZ,IAAI,CAACW;EAC5B,CAAC,CAAC;EACF,IAAI,CAACR,MAAM,CAACU,KAAK,EAAE;IACf;EACJ;EACAf,OAAO,CAACC,GAAG,CAAC,4BAA4B,EAAEe,IAAI,CAACC,SAAS,CAACZ,MAAM,CAACU,KAAK,CAAC,CAAC;AAC3E,CAAC;AAACG,OAAA,CAAA5B,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_lastCommentNotificationPlugin","require","sendCommentNotification","params","context","reviewers","contentReview","length","commentPlugin","getLastCommentNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendCommentNotification.ts"],"sourcesContent":["import { getLastCommentNotificationPlugin } from \"./lastCommentNotificationPlugin\";\nimport { ApwCommentNotificationCbParams } from \"~/ApwCommentNotification\";\n\nexport const sendCommentNotification = async (\n params: ApwCommentNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const commentPlugin = getLastCommentNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!commentPlugin) {\n console.log(\"No e-mail body comment plugin.\");\n return;\n }\n\n const body = commentPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the comment plugin: ${commentPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new comment on the Content Review you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAGO,MAAMC,uBAAuB,GAAG,MACnCC,MAAsC,IACtB;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,aAAa,GAAG,IAAAC,+DAAgC,EAAC;IACnDL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,aAAa,EAAE;IAChBI,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;IAC7C;EACJ;EAEA,MAAMC,IAAI,GAAGN,aAAa,CAACO,MAAM,CAACZ,MAAM,CAAC;EACzC,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,
|
1
|
+
{"version":3,"names":["_lastCommentNotificationPlugin","require","sendCommentNotification","params","context","reviewers","contentReview","length","commentPlugin","getLastCommentNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendCommentNotification.ts"],"sourcesContent":["import { getLastCommentNotificationPlugin } from \"./lastCommentNotificationPlugin\";\nimport { ApwCommentNotificationCbParams } from \"~/ApwCommentNotification\";\n\nexport const sendCommentNotification = async (\n params: ApwCommentNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const commentPlugin = getLastCommentNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!commentPlugin) {\n console.log(\"No e-mail body comment plugin.\");\n return;\n }\n\n const body = commentPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the comment plugin: ${commentPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new comment on the Content Review you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAGO,MAAMC,uBAAuB,GAAG,MACnCC,MAAsC,IACtB;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,aAAa,GAAG,IAAAC,+DAAgC,EAAC;IACnDL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,aAAa,EAAE;IAChBI,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;IAC7C;EACJ;EAEA,MAAMC,IAAI,GAAGN,aAAa,CAACO,MAAM,CAACZ,MAAM,CAAC;EACzC,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,CAAC,2CAA2CL,aAAa,CAACQ,IAAI,EAAE,CAAC;IAC5E;EACJ;EAEA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACc,MAAM,CAACC,QAAQ,CAAC;IACzCC,GAAG,EAAEf,SAAS,CAACgB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC;IAChCC,OAAO,EAAE,mEAAmE;IAC5EC,IAAI,EAAEX,IAAI,CAACW,IAAI;IACfC,IAAI,EAAEZ,IAAI,CAACY,IAAI,IAAIZ,IAAI,CAACW;EAC5B,CAAC,CAAC;EACF,IAAI,CAACR,MAAM,CAACU,KAAK,EAAE;IACf;EACJ;EACAf,OAAO,CAACC,GAAG,CAAC,4BAA4B,EAAEe,IAAI,CAACC,SAAS,CAACZ,MAAM,CAACU,KAAK,CAAC,CAAC;AAC3E,CAAC;AAACG,OAAA,CAAA5B,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_lastContentReviewNotificationPlugin","require","sendContentReviewNotification","params","context","reviewers","contentReview","length","contentReviewPlugin","getLastContentReviewNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendContentReviewNotification.ts"],"sourcesContent":["import { getLastContentReviewNotificationPlugin } from \"./lastContentReviewNotificationPlugin\";\nimport { ApwContentReviewNotificationCbParams } from \"~/ApwContentReviewNotification\";\n\nexport const sendContentReviewNotification = async (\n params: ApwContentReviewNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const contentReviewPlugin = getLastContentReviewNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!contentReviewPlugin) {\n console.log(\"No e-mail body content review plugin.\");\n return;\n }\n\n const body = contentReviewPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the content review plugin: ${contentReviewPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new content review which you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oCAAA,GAAAC,OAAA;AAGO,MAAMC,6BAA6B,GAAG,MACzCC,MAA4C,IAC5B;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,mBAAmB,GAAG,IAAAC,2EAAsC,EAAC;IAC/DL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,mBAAmB,EAAE;IACtBI,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;IACpD;EACJ;EAEA,MAAMC,IAAI,GAAGN,mBAAmB,CAACO,MAAM,CAACZ,MAAM,CAAC;EAC/C,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,
|
1
|
+
{"version":3,"names":["_lastContentReviewNotificationPlugin","require","sendContentReviewNotification","params","context","reviewers","contentReview","length","contentReviewPlugin","getLastContentReviewNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendContentReviewNotification.ts"],"sourcesContent":["import { getLastContentReviewNotificationPlugin } from \"./lastContentReviewNotificationPlugin\";\nimport { ApwContentReviewNotificationCbParams } from \"~/ApwContentReviewNotification\";\n\nexport const sendContentReviewNotification = async (\n params: ApwContentReviewNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const contentReviewPlugin = getLastContentReviewNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!contentReviewPlugin) {\n console.log(\"No e-mail body content review plugin.\");\n return;\n }\n\n const body = contentReviewPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the content review plugin: ${contentReviewPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new content review which you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oCAAA,GAAAC,OAAA;AAGO,MAAMC,6BAA6B,GAAG,MACzCC,MAA4C,IAC5B;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,mBAAmB,GAAG,IAAAC,2EAAsC,EAAC;IAC/DL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,mBAAmB,EAAE;IACtBI,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;IACpD;EACJ;EAEA,MAAMC,IAAI,GAAGN,mBAAmB,CAACO,MAAM,CAACZ,MAAM,CAAC;EAC/C,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,CAAC,kDAAkDL,mBAAmB,CAACQ,IAAI,EAAE,CAAC;IACzF;EACJ;EAEA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACc,MAAM,CAACC,QAAQ,CAAC;IACzCC,GAAG,EAAEf,SAAS,CAACgB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC;IAChCC,OAAO,EAAE,0DAA0D;IACnEC,IAAI,EAAEX,IAAI,CAACW,IAAI;IACfC,IAAI,EAAEZ,IAAI,CAACY,IAAI,IAAIZ,IAAI,CAACW;EAC5B,CAAC,CAAC;EACF,IAAI,CAACR,MAAM,CAACU,KAAK,EAAE;IACf;EACJ;EACAf,OAAO,CAACC,GAAG,CAAC,4BAA4B,EAAEe,IAAI,CAACC,SAAS,CAACZ,MAAM,CAACU,KAAK,CAAC,CAAC;AAC3E,CAAC;AAACG,OAAA,CAAA5B,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|