@webiny/api-apw 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.e53eceafb5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApwChangeRequestNotification.d.ts +1 -1
- package/ApwChangeRequestNotification.js +4 -6
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.d.ts +1 -1
- package/ApwCommentNotification.js +4 -6
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.d.ts +1 -1
- package/ApwContentReviewNotification.js +4 -6
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.d.ts +1 -1
- package/ApwContentUrlPlugin.js +4 -6
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.d.ts +1 -1
- package/ContentApwSettingsPlugin.js +5 -4
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.d.ts +1 -1
- package/crud/createChangeRequestMethods.js +3 -1
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.d.ts +1 -1
- package/crud/createCommentMethods.js +3 -1
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.d.ts +2 -2
- package/crud/createContentReviewMethods.js +57 -32
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.d.ts +1 -1
- package/crud/createReviewerMethods.js +3 -1
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.d.ts +1 -1
- package/crud/createWorkflowMethods.js +3 -1
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.d.ts +1 -1
- package/crud/index.js +6 -5
- package/crud/index.js.map +1 -1
- package/crud/utils.d.ts +2 -2
- package/crud/utils.js +8 -8
- package/crud/utils.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/package.json +32 -50
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +1 -1
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.d.ts +2 -2
- package/plugins/cms/apwEntryPlugins.js +19 -7
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.d.ts +4 -4
- package/plugins/cms/index.js +3 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.d.ts +2 -2
- package/plugins/cms/linkContentReviewToEntry.js +5 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.d.ts +2 -2
- package/plugins/cms/linkWorkflowToEntry.js +17 -16
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +3 -1
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js +3 -1
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js +3 -1
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js +3 -1
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.d.ts +2 -2
- package/plugins/cms/triggerContentReview.js +6 -5
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.d.ts +3 -3
- package/plugins/cms/updateContentReviewStatus.js +15 -13
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +5 -4
- package/plugins/cms/utils.js +19 -13
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.d.ts +2 -2
- package/plugins/context.js +3 -1
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.d.ts +1 -1
- package/plugins/graphql/changeRequest.gql.js +16 -13
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.d.ts +1 -1
- package/plugins/graphql/comment.gql.js +41 -36
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.d.ts +1 -1
- package/plugins/graphql/contentReview.gql.js +26 -17
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.d.ts +1 -1
- package/plugins/graphql/reviewer.gql.js +15 -13
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.d.ts +2 -0
- package/plugins/graphql/utils.js +10 -0
- package/plugins/graphql/utils.js.map +1 -0
- package/plugins/graphql/workflow.gql.d.ts +1 -1
- package/plugins/graphql/workflow.gql.js +15 -13
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.d.ts +1 -1
- package/plugins/graphql.js +4 -2
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.d.ts +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +4 -2
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.d.ts +1 -1
- package/plugins/hooks/index.js +3 -1
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.d.ts +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +6 -4
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.d.ts +1 -1
- package/plugins/hooks/initializeNotifications.js +3 -1
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.d.ts +3 -3
- package/plugins/hooks/listContentReviews.js +4 -2
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +8 -11
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +8 -11
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js +3 -1
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +9 -12
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.d.ts +2 -2
- package/plugins/hooks/notifications/contentUrl.js +3 -1
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/getAppUrl.d.ts +2 -0
- package/plugins/hooks/notifications/getAppUrl.js +19 -0
- package/plugins/hooks/notifications/getAppUrl.js.map +1 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.d.ts +1 -1
- package/plugins/hooks/notifications/reviewers.js +18 -15
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.d.ts +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +8 -6
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.d.ts +1 -1
- package/plugins/hooks/updateTotalComments.js +22 -15
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.d.ts +1 -1
- package/plugins/hooks/validateChangeRequest.js +3 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.d.ts +1 -1
- package/plugins/hooks/validateComment.js +3 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.d.ts +1 -1
- package/plugins/hooks/validateContentReview.js +3 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +2 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +5 -5
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.d.ts +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.d.ts +4 -4
- package/plugins/pageBuilder/index.js +3 -1
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.d.ts +2 -2
- package/plugins/pageBuilder/linkContentReviewToPage.js +16 -12
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.d.ts +2 -2
- package/plugins/pageBuilder/linkWorkflowToPage.js +13 -12
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +3 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +3 -1
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +3 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +3 -1
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
- package/plugins/pageBuilder/triggerContentReview.d.ts +2 -2
- package/plugins/pageBuilder/triggerContentReview.js +5 -4
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.d.ts +3 -3
- package/plugins/pageBuilder/updateContentReviewStatus.js +13 -10
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.d.ts +4 -4
- package/plugins/pageBuilder/utils.js +7 -6
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +7 -6
- package/plugins/utils.js +12 -8
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.d.ts +1 -1
- package/scheduler/createScheduleActionMethods.js +105 -66
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +2 -2
- package/scheduler/handlers/executeAction/index.js +30 -9
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +5 -4
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +2 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +6 -7
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +3 -2
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.d.ts +2 -2
- package/scheduler/handlers/executeAction/security.js +3 -1
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +2 -2
- package/scheduler/handlers/scheduleAction/index.js +20 -15
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +3 -3
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +19 -14
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +2 -3
- package/scheduler/handlers/utils.js +20 -13
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.d.ts +1 -1
- package/scheduler/index.js +3 -1
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +20 -36
- package/scheduler/types.js +11 -17
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.d.ts +2 -2
- package/storageOperations/changeRequestStorageOperations.js +44 -23
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.d.ts +3 -3
- package/storageOperations/commentStorageOperations.js +17 -24
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +3 -3
- package/storageOperations/contentReviewStorageOperations.js +20 -25
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +3 -9
- package/storageOperations/index.js +11 -16
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.d.ts +1 -2
- package/storageOperations/models/changeRequest.model.js +10 -11
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -2
- package/storageOperations/models/comment.model.js +10 -11
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -2
- package/storageOperations/models/contentReview.model.js +16 -15
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.d.ts +1 -1
- package/storageOperations/models/index.js +11 -31
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -2
- package/storageOperations/models/reviewer.model.js +11 -12
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.d.ts +2 -2
- package/storageOperations/models/utils.js +3 -1
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +2 -3
- package/storageOperations/models/workflow.model.js +22 -23
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +3 -3
- package/storageOperations/reviewerStorageOperations.js +24 -34
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.d.ts +2 -2
- package/storageOperations/types.js +3 -1
- package/storageOperations/types.js.map +1 -1
- package/storageOperations/workflowStorageOperations.d.ts +2 -2
- package/storageOperations/workflowStorageOperations.js +25 -28
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +54 -53
- package/types.js +121 -29
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.d.ts +2 -2
- package/utils/contentApwSettingsPlugin.js +3 -1
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +3 -1
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.d.ts +2 -2
- package/utils/fieldResolver.js +7 -7
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +30 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js +3 -1
- package/utils/resolve.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.d.ts +0 -2
- package/plugins/hooks/notifications/appUrl.js +0 -18
- package/plugins/hooks/notifications/appUrl.js.map +0 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +0 -8
- package/storageOperations/models/contentModelPluginFactory.js +0 -19
- package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -7,11 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.shouldRestoreDatetime = exports.moveDateTimeToNextCentury = exports.moveDateTimeToCurrentCentury = exports.isDateTimeInNextCentury = exports.getIsoStringTillMinutes = exports.getApwSettings = exports.encodeToken = exports.documentClient = exports.decodeToken = exports.dateTimeToCronExpression = exports.basePlugins = exports.TOKEN_PREFIX = void 0;
|
8
8
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
9
9
|
var _utc = _interopRequireDefault(require("dayjs/plugin/utc"));
|
10
|
-
var
|
10
|
+
var _clientDynamodb = require("@webiny/aws-sdk/client-dynamodb");
|
11
11
|
var _handlerDb = _interopRequireDefault(require("@webiny/handler-db"));
|
12
12
|
var _dbDynamodb = require("@webiny/db-dynamodb");
|
13
13
|
var _plugins = _interopRequireDefault(require("@webiny/db-dynamodb/plugins"));
|
14
|
-
var _handlerLogs = _interopRequireDefault(require("@webiny/handler-logs"));
|
15
14
|
var _types = require("../types");
|
16
15
|
/**
|
17
16
|
* https://day.js.org/docs/en/plugin/utc
|
@@ -81,8 +80,7 @@ const encodeToken = ({
|
|
81
80
|
return `${TOKEN_PREFIX}${id}__${tenant}__${locale}`;
|
82
81
|
};
|
83
82
|
exports.encodeToken = encodeToken;
|
84
|
-
const TOKEN_PREFIX = "apw-";
|
85
|
-
exports.TOKEN_PREFIX = TOKEN_PREFIX;
|
83
|
+
const TOKEN_PREFIX = exports.TOKEN_PREFIX = "apw-";
|
86
84
|
const decodeToken = token => {
|
87
85
|
const auth = token.slice(TOKEN_PREFIX.length);
|
88
86
|
const [id, tenant, locale] = auth.split("__");
|
@@ -93,12 +91,8 @@ const decodeToken = token => {
|
|
93
91
|
};
|
94
92
|
};
|
95
93
|
exports.decodeToken = decodeToken;
|
96
|
-
const documentClient =
|
97
|
-
|
98
|
-
region: process.env.AWS_REGION
|
99
|
-
});
|
100
|
-
exports.documentClient = documentClient;
|
101
|
-
const basePlugins = () => [(0, _plugins.default)(), (0, _handlerLogs.default)(), (0, _handlerDb.default)({
|
94
|
+
const documentClient = exports.documentClient = (0, _clientDynamodb.getDocumentClient)();
|
95
|
+
const basePlugins = () => [(0, _plugins.default)(), (0, _handlerDb.default)({
|
102
96
|
table: process.env.DB_TABLE,
|
103
97
|
driver: new _dbDynamodb.DynamoDbDriver({
|
104
98
|
documentClient
|
@@ -109,8 +103,19 @@ const basePlugins = () => [(0, _plugins.default)(), (0, _handlerLogs.default)(),
|
|
109
103
|
* Get APW settings record from DDB.
|
110
104
|
*/
|
111
105
|
exports.basePlugins = basePlugins;
|
106
|
+
const getVariant = () => {
|
107
|
+
/**
|
108
|
+
* Variant can only be default for now.
|
109
|
+
*/
|
110
|
+
return "default";
|
111
|
+
// const value = process.env.WEBINY_ENV_VARIANT;
|
112
|
+
// if (!value || value === "undefined" || typeof value !== "string") {
|
113
|
+
// return "";
|
114
|
+
// }
|
115
|
+
// return String(value);
|
116
|
+
};
|
112
117
|
const getApwSettings = async () => {
|
113
|
-
const variant =
|
118
|
+
const variant = getVariant();
|
114
119
|
const params = {
|
115
120
|
TableName: process.env.DB_TABLE,
|
116
121
|
Key: {
|
@@ -120,11 +125,13 @@ const getApwSettings = async () => {
|
|
120
125
|
};
|
121
126
|
const {
|
122
127
|
Item
|
123
|
-
} = await documentClient.get(params)
|
128
|
+
} = await documentClient.get(params);
|
124
129
|
return {
|
125
130
|
mainGraphqlFunctionArn: Item ? Item["mainGraphqlFunctionArn"] : "mainGraphqlFunctionArn",
|
126
131
|
eventRuleName: Item ? Item["eventRuleName"] : "eventRuleName",
|
127
132
|
eventTargetId: Item ? Item["eventTargetId"] : "eventTargetId"
|
128
133
|
};
|
129
134
|
};
|
130
|
-
exports.getApwSettings = getApwSettings;
|
135
|
+
exports.getApwSettings = getApwSettings;
|
136
|
+
|
137
|
+
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["dayjs","extend","utc","TIME_SEPARATOR","ELAPSED_CRON_EXPRESSION","getIsoStringTillMinutes","datetime","isNaN","Date","parse","slice","lastIndexOf","dateTimeToCronExpression","dayOfWeek","format","moveDateTimeToNextCentury","add","toISOString","moveDateTimeToCurrentCentury","subtract","isDateTimeInNextCentury","isAfter","shouldRestoreDatetime","invocationType","selfInvoked","InvocationTypes","SCHEDULED","today","isExecutionPending","encodeToken","id","tenant","locale","TOKEN_PREFIX","decodeToken","token","auth","length","split","documentClient","
|
1
|
+
{"version":3,"names":["_dayjs","_interopRequireDefault","require","_utc","_clientDynamodb","_handlerDb","_dbDynamodb","_plugins","_types","dayjs","extend","utc","TIME_SEPARATOR","ELAPSED_CRON_EXPRESSION","getIsoStringTillMinutes","datetime","isNaN","Date","parse","slice","lastIndexOf","exports","dateTimeToCronExpression","dayOfWeek","format","moveDateTimeToNextCentury","add","toISOString","moveDateTimeToCurrentCentury","subtract","isDateTimeInNextCentury","isAfter","shouldRestoreDatetime","invocationType","selfInvoked","InvocationTypes","SCHEDULED","today","isExecutionPending","encodeToken","id","tenant","locale","TOKEN_PREFIX","decodeToken","token","auth","length","split","documentClient","getDocumentClient","basePlugins","dynamoDbPlugins","dbPlugins","table","process","env","DB_TABLE","driver","DynamoDbDriver","getVariant","getApwSettings","variant","params","TableName","Key","PK","SK","Item","get","mainGraphqlFunctionArn","eventRuleName","eventTargetId"],"sources":["utils.ts"],"sourcesContent":["import dayjs from \"dayjs\";\nimport utc from \"dayjs/plugin/utc\";\nimport { getDocumentClient } from \"@webiny/aws-sdk/client-dynamodb\";\nimport dbPlugins from \"@webiny/handler-db\";\nimport { DynamoDbDriver } from \"@webiny/db-dynamodb\";\nimport dynamoDbPlugins from \"@webiny/db-dynamodb/plugins\";\nimport { InvocationTypes } from \"~/scheduler/types\";\n\n/**\n * https://day.js.org/docs/en/plugin/utc\n */\ndayjs.extend(utc);\n\nconst TIME_SEPARATOR = \":\";\nconst ELAPSED_CRON_EXPRESSION = \"* * * * ? 2000\";\n\nexport const getIsoStringTillMinutes = (datetime: string): string => {\n /**\n * Validate datetime.\n */\n if (isNaN(Date.parse(datetime))) {\n return datetime;\n }\n // input = \"2022-03-08T05:41:13.230Z\"\n // output = \"2022-03-08T05:41\"\n return datetime.slice(0, datetime.lastIndexOf(TIME_SEPARATOR));\n};\n\nexport const dateTimeToCronExpression = (datetime: string): string => {\n if (!datetime) {\n return ELAPSED_CRON_EXPRESSION;\n }\n /**\n * You can't specify the Day-of-month and Day-of-week fields in the same cron expression.\n * If you specify a value (or a *) in one of the fields, you must use a ? (question mark) in the other.\n *\n * https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html\n */\n const dayOfWeek = \"?\";\n\n return dayjs.utc(datetime).format(`mm H D M [${dayOfWeek}] YYYY`);\n};\n\nexport const moveDateTimeToNextCentury = (datetime: string): string => {\n return dayjs.utc(datetime).add(100, \"year\").toISOString();\n};\n\nexport const moveDateTimeToCurrentCentury = (datetime: string): string => {\n return dayjs.utc(datetime).subtract(100, \"year\").toISOString();\n};\n\nexport const isDateTimeInNextCentury = (datetime: string): boolean => {\n return dayjs.utc(datetime).isAfter(\"2100-01-01\", \"year\");\n};\n\ninterface ShouldRestoreDatetimeParams {\n invocationType?: InvocationTypes;\n datetime: string;\n}\n\nexport const shouldRestoreDatetime = ({\n invocationType,\n datetime\n}: ShouldRestoreDatetimeParams): boolean => {\n /**\n * \"invocationType\" will not be SCHEDULED when the lambda is called from Main GQL handler.\n *\n * Which means a new content is scheduled for \"publish\"/\"unpublish\" therefore, we need to restore the previously\n * scheduled action if it has not been executed already.\n */\n const selfInvoked = invocationType === InvocationTypes.SCHEDULED;\n\n const today = dayjs.utc();\n const isExecutionPending = dayjs.utc(datetime).isAfter(today);\n\n return !selfInvoked && isExecutionPending;\n};\n\ninterface EncodeTokenParams {\n id: string;\n tenant: string;\n locale: string;\n}\n\nexport const encodeToken = ({ id, tenant, locale }: EncodeTokenParams) => {\n return `${TOKEN_PREFIX}${id}__${tenant}__${locale}`;\n};\n\nexport const TOKEN_PREFIX = \"apw-\";\n\nexport const decodeToken = (token: string): Partial<EncodeTokenParams> => {\n const auth = token.slice(TOKEN_PREFIX.length);\n const [id, tenant, locale] = auth.split(\"__\");\n\n return {\n id,\n tenant,\n locale\n };\n};\n\nexport const documentClient = getDocumentClient();\n\nexport const basePlugins = () => [\n dynamoDbPlugins(),\n dbPlugins({\n table: process.env.DB_TABLE,\n driver: new DynamoDbDriver({\n documentClient\n })\n })\n];\n\n/**\n * Get APW settings record from DDB.\n */\nexport interface ApwSettings {\n mainGraphqlFunctionArn: string;\n eventRuleName: string;\n eventTargetId: string;\n}\n\nconst getVariant = (): string => {\n /**\n * Variant can only be default for now.\n */\n return \"default\";\n // const value = process.env.WEBINY_ENV_VARIANT;\n // if (!value || value === \"undefined\" || typeof value !== \"string\") {\n // return \"\";\n // }\n // return String(value);\n};\n\nexport const getApwSettings = async (): Promise<ApwSettings> => {\n const variant = getVariant();\n\n const params = {\n TableName: process.env.DB_TABLE as string,\n Key: {\n PK: `APW#SETTINGS`,\n SK: variant || \"default\"\n }\n };\n\n const { Item } = await documentClient.get(params);\n\n return {\n mainGraphqlFunctionArn: Item ? Item[\"mainGraphqlFunctionArn\"] : \"mainGraphqlFunctionArn\",\n eventRuleName: Item ? Item[\"eventRuleName\"] : \"eventRuleName\",\n eventTargetId: Item ? Item[\"eventTargetId\"] : \"eventTargetId\"\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEA;AACA;AACA;AACAO,cAAK,CAACC,MAAM,CAACC,YAAG,CAAC;AAEjB,MAAMC,cAAc,GAAG,GAAG;AAC1B,MAAMC,uBAAuB,GAAG,gBAAgB;AAEzC,MAAMC,uBAAuB,GAAIC,QAAgB,IAAa;EACjE;AACJ;AACA;EACI,IAAIC,KAAK,CAACC,IAAI,CAACC,KAAK,CAACH,QAAQ,CAAC,CAAC,EAAE;IAC7B,OAAOA,QAAQ;EACnB;EACA;EACA;EACA,OAAOA,QAAQ,CAACI,KAAK,CAAC,CAAC,EAAEJ,QAAQ,CAACK,WAAW,CAACR,cAAc,CAAC,CAAC;AAClE,CAAC;AAACS,OAAA,CAAAP,uBAAA,GAAAA,uBAAA;AAEK,MAAMQ,wBAAwB,GAAIP,QAAgB,IAAa;EAClE,IAAI,CAACA,QAAQ,EAAE;IACX,OAAOF,uBAAuB;EAClC;EACA;AACJ;AACA;AACA;AACA;AACA;EACI,MAAMU,SAAS,GAAG,GAAG;EAErB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BC,EAAE,EAAEL,OAAO,IAAI;IACnB;EACJ,CAAC;EAED,MAAM;IAAEM;EAAK,CAAC,GAAG,MAAMnB,cAAc,CAACoB,GAAG,CAACN,MAAM,CAAC;EAEjD,OAAO;IACHO,sBAAsB,EAAEF,IAAI,GAAGA,IAAI,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;IACxFG,aAAa,EAAEH,IAAI,GAAGA,IAAI,CAAC,eAAe,CAAC,GAAG,eAAe;IAC7DI,aAAa,EAAEJ,IAAI,GAAGA,IAAI,CAAC,eAAe,CAAC,GAAG;EAClD,CAAC;AACL,CAAC;AAAC/C,OAAA,CAAAwC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
package/scheduler/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import { ApwScheduleActionCrud, CreateScheduleActionParams } from "./types";
|
1
|
+
import type { ApwScheduleActionCrud, CreateScheduleActionParams } from "./types";
|
2
2
|
export declare const createScheduler: (params: CreateScheduleActionParams) => ApwScheduleActionCrud;
|
package/scheduler/index.js
CHANGED
package/scheduler/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createScheduler","params","getLocale","getIdentity","getTenant","getPermission","storageOperations","createScheduleActionMethods"],"sources":["index.ts"],"sourcesContent":["import { createScheduleActionMethods } from \"./createScheduleActionMethods\";\nimport { ApwScheduleActionCrud, CreateScheduleActionParams } from \"./types\";\n\nexport const createScheduler = (params: CreateScheduleActionParams): ApwScheduleActionCrud => {\n const { getLocale, getIdentity, getTenant, getPermission, storageOperations } = params;\n\n return createScheduleActionMethods({\n getLocale,\n getIdentity,\n getTenant,\n getPermission,\n storageOperations\n });\n};\n"],"mappings":";;;;;;AAAA;AAGO,
|
1
|
+
{"version":3,"names":["_createScheduleActionMethods","require","createScheduler","params","getLocale","getIdentity","getTenant","getPermission","storageOperations","createScheduleActionMethods","exports"],"sources":["index.ts"],"sourcesContent":["import { createScheduleActionMethods } from \"./createScheduleActionMethods\";\nimport type { ApwScheduleActionCrud, CreateScheduleActionParams } from \"./types\";\n\nexport const createScheduler = (params: CreateScheduleActionParams): ApwScheduleActionCrud => {\n const { getLocale, getIdentity, getTenant, getPermission, storageOperations } = params;\n\n return createScheduleActionMethods({\n getLocale,\n getIdentity,\n getTenant,\n getPermission,\n storageOperations\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAGO,MAAMC,eAAe,GAAIC,MAAkC,IAA4B;EAC1F,MAAM;IAAEC,SAAS;IAAEC,WAAW;IAAEC,SAAS;IAAEC,aAAa;IAAEC;EAAkB,CAAC,GAAGL,MAAM;EAEtF,OAAO,IAAAM,wDAA2B,EAAC;IAC/BL,SAAS;IACTC,WAAW;IACXC,SAAS;IACTC,aAAa;IACbC;EACJ,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAAR,eAAA,GAAAA,eAAA","ignoreList":[]}
|
package/scheduler/types.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { Context } from "@webiny/api/types";
|
2
|
-
import { SecurityIdentity, SecurityPermission } from "@webiny/api-security/types";
|
3
|
-
import {
|
4
|
-
import { Tenant } from "@webiny/api-tenancy/types";
|
5
|
-
import {
|
1
|
+
import type { Context } from "@webiny/api/types";
|
2
|
+
import type { SecurityIdentity, SecurityPermission } from "@webiny/api-security/types";
|
3
|
+
import type { I18NContext, I18NLocale } from "@webiny/api-i18n/types";
|
4
|
+
import type { TenancyContext, Tenant } from "@webiny/api-tenancy/types";
|
5
|
+
import type { ApwIdentity } from "../types";
|
6
6
|
export interface ListWhere {
|
7
7
|
/**
|
8
8
|
* Fields.
|
@@ -29,25 +29,6 @@ export interface ListParams {
|
|
29
29
|
limit?: number;
|
30
30
|
after?: string;
|
31
31
|
}
|
32
|
-
/**
|
33
|
-
* A interface describing the reference to a user that created some data in the database.
|
34
|
-
*
|
35
|
-
* @category General
|
36
|
-
*/
|
37
|
-
export interface CreatedBy {
|
38
|
-
/**
|
39
|
-
* ID if the user.
|
40
|
-
*/
|
41
|
-
id: string;
|
42
|
-
/**
|
43
|
-
* Full name of the user.
|
44
|
-
*/
|
45
|
-
displayName: string | null;
|
46
|
-
/**
|
47
|
-
* Type of the user (admin, user)
|
48
|
-
*/
|
49
|
-
type: string;
|
50
|
-
}
|
51
32
|
export interface ListMeta {
|
52
33
|
/**
|
53
34
|
* A cursor for pagination.
|
@@ -69,8 +50,11 @@ export declare enum ApwContentTypes {
|
|
69
50
|
export interface BaseFields {
|
70
51
|
id: string;
|
71
52
|
createdOn: string;
|
72
|
-
|
73
|
-
|
53
|
+
modifiedOn: string | null;
|
54
|
+
savedOn: string;
|
55
|
+
createdBy: ApwIdentity;
|
56
|
+
modifiedBy: ApwIdentity | null;
|
57
|
+
savedBy: ApwIdentity;
|
74
58
|
tenant: string;
|
75
59
|
locale: string;
|
76
60
|
}
|
@@ -99,13 +83,13 @@ interface BaseApwCrud<TEntry, TCreateEntryParams, TUpdateEntryParams> {
|
|
99
83
|
get(id: string): Promise<TEntry | null>;
|
100
84
|
create(data: TCreateEntryParams): Promise<TEntry>;
|
101
85
|
update(id: string, data: TUpdateEntryParams): Promise<TEntry>;
|
102
|
-
delete(id: string): Promise<
|
86
|
+
delete(id: string): Promise<boolean>;
|
103
87
|
}
|
104
88
|
export interface ApwScheduleActionCrud extends BaseApwCrud<ApwScheduleAction, ApwScheduleActionData, ApwScheduleActionData> {
|
105
89
|
list(params: ListParams): Promise<[ApwScheduleAction[], ListMeta]>;
|
106
90
|
getCurrentTask(): Promise<ApwScheduleAction | null>;
|
107
91
|
updateCurrentTask(item: ApwScheduleAction): Promise<ApwScheduleAction>;
|
108
|
-
deleteCurrentTask(): Promise<
|
92
|
+
deleteCurrentTask(): Promise<boolean>;
|
109
93
|
}
|
110
94
|
export interface ScheduleActionContext extends Context, I18NContext, TenancyContext {
|
111
95
|
scheduleAction: ApwScheduleActionCrud;
|
@@ -139,31 +123,31 @@ export interface ApwScheduleActionListParams extends ListParams {
|
|
139
123
|
locale: string;
|
140
124
|
};
|
141
125
|
}
|
142
|
-
export
|
143
|
-
export
|
144
|
-
export
|
145
|
-
export
|
126
|
+
export type StorageOperationsGetScheduleActionParams = StorageOperationsGetParams;
|
127
|
+
export type StorageOperationsDeleteScheduleActionParams = StorageOperationsDeleteParams;
|
128
|
+
export type StorageOperationsListScheduleActionsParams = ApwScheduleActionListParams;
|
129
|
+
export type StorageOperationsCreateScheduleActionParams = CreateApwScheduleActionParams;
|
146
130
|
export interface StorageOperationsUpdateScheduleActionParams {
|
147
131
|
item: ApwScheduleAction;
|
148
132
|
input: ApwScheduleActionData;
|
149
133
|
}
|
150
|
-
export
|
134
|
+
export type StorageOperationsListScheduleActionsResponse = [ApwScheduleAction[], ListMeta];
|
151
135
|
export interface StorageOperationsUpdateCurrentTaskParams {
|
152
136
|
item: ApwScheduleAction;
|
153
137
|
}
|
154
138
|
export interface StorageOperationsGetCurrentTaskParams {
|
155
139
|
where: Pick<StorageOperationsGetParams["where"], "tenant" | "locale">;
|
156
140
|
}
|
157
|
-
export
|
141
|
+
export type StorageOperationsDeleteCurrentTaskParams = Pick<StorageOperationsDeleteParams, "tenant" | "locale">;
|
158
142
|
export interface ApwScheduleActionStorageOperations {
|
159
143
|
get(params: StorageOperationsGetScheduleActionParams): Promise<ApwScheduleAction | null>;
|
160
144
|
list(params: StorageOperationsListScheduleActionsParams): Promise<StorageOperationsListScheduleActionsResponse>;
|
161
145
|
create(params: StorageOperationsCreateScheduleActionParams): Promise<ApwScheduleAction>;
|
162
146
|
update(params: StorageOperationsUpdateScheduleActionParams): Promise<ApwScheduleAction>;
|
163
|
-
delete(params: StorageOperationsDeleteScheduleActionParams): Promise<
|
147
|
+
delete(params: StorageOperationsDeleteScheduleActionParams): Promise<boolean>;
|
164
148
|
getCurrentTask(params: StorageOperationsGetCurrentTaskParams): Promise<ApwScheduleAction | null>;
|
165
149
|
updateCurrentTask(params: StorageOperationsUpdateCurrentTaskParams): Promise<ApwScheduleAction>;
|
166
|
-
deleteCurrentTask(params: StorageOperationsDeleteCurrentTaskParams): Promise<
|
150
|
+
deleteCurrentTask(params: StorageOperationsDeleteCurrentTaskParams): Promise<boolean>;
|
167
151
|
}
|
168
152
|
export interface CreateApwContextParams {
|
169
153
|
storageOperations: ApwScheduleActionStorageOperations;
|
package/scheduler/types.js
CHANGED
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.InvocationTypes = exports.ApwScheduleActionTypes = exports.ApwContentTypes = void 0;
|
7
|
-
|
8
|
-
* A interface describing the reference to a user that created some data in the database.
|
9
|
-
*
|
10
|
-
* @category General
|
11
|
-
*/
|
12
|
-
let ApwContentTypes;
|
13
|
-
exports.ApwContentTypes = ApwContentTypes;
|
14
|
-
(function (ApwContentTypes) {
|
7
|
+
let ApwContentTypes = exports.ApwContentTypes = /*#__PURE__*/function (ApwContentTypes) {
|
15
8
|
ApwContentTypes["PAGE"] = "page";
|
16
9
|
ApwContentTypes["CMS_ENTRY"] = "cms_entry";
|
17
|
-
|
18
|
-
|
19
|
-
exports.ApwScheduleActionTypes = ApwScheduleActionTypes
|
20
|
-
(function (ApwScheduleActionTypes) {
|
10
|
+
return ApwContentTypes;
|
11
|
+
}({});
|
12
|
+
let ApwScheduleActionTypes = exports.ApwScheduleActionTypes = /*#__PURE__*/function (ApwScheduleActionTypes) {
|
21
13
|
ApwScheduleActionTypes["PUBLISH"] = "publish";
|
22
14
|
ApwScheduleActionTypes["UNPUBLISH"] = "unpublish";
|
23
|
-
|
24
|
-
|
25
|
-
exports.InvocationTypes = InvocationTypes
|
26
|
-
(function (InvocationTypes) {
|
15
|
+
return ApwScheduleActionTypes;
|
16
|
+
}({});
|
17
|
+
let InvocationTypes = exports.InvocationTypes = /*#__PURE__*/function (InvocationTypes) {
|
27
18
|
InvocationTypes["SCHEDULED"] = "scheduled";
|
28
|
-
|
19
|
+
return InvocationTypes;
|
20
|
+
}({});
|
21
|
+
|
22
|
+
//# sourceMappingURL=types.js.map
|
package/scheduler/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ApwContentTypes","ApwScheduleActionTypes","InvocationTypes"],"sources":["types.ts"],"sourcesContent":["import { Context } from \"@webiny/api/types\";\nimport { SecurityIdentity, SecurityPermission } from \"@webiny/api-security/types\";\nimport {
|
1
|
+
{"version":3,"names":["ApwContentTypes","exports","ApwScheduleActionTypes","InvocationTypes"],"sources":["types.ts"],"sourcesContent":["import type { Context } from \"@webiny/api/types\";\nimport type { SecurityIdentity, SecurityPermission } from \"@webiny/api-security/types\";\nimport type { I18NContext, I18NLocale } from \"@webiny/api-i18n/types\";\nimport type { TenancyContext, Tenant } from \"@webiny/api-tenancy/types\";\nimport type { ApwIdentity } from \"~/types\";\n\nexport interface ListWhere {\n /**\n * Fields.\n */\n id?: string;\n id_in?: string[];\n id_not?: string;\n id_not_in?: string[];\n /**\n * Who created the entry?\n */\n createdBy?: string;\n createdBy_not?: string;\n createdBy_in?: string[];\n createdBy_not_in?: string[];\n /**\n * By datetime field.\n */\n datetime_startsWith?: string;\n}\n\nexport interface ListParams {\n where: ListWhere;\n sort?: (\"datetime_ASC\" | \"datetime_DESC\")[];\n limit?: number;\n after?: string;\n}\n\nexport interface ListMeta {\n /**\n * A cursor for pagination.\n */\n cursor: string | null;\n /**\n * Is there more items to load?\n */\n hasMoreItems: boolean;\n /**\n * Total count of the items in the storage.\n */\n totalCount: number;\n}\n\nexport enum ApwContentTypes {\n PAGE = \"page\",\n CMS_ENTRY = \"cms_entry\"\n}\n\nexport interface BaseFields {\n id: string;\n\n createdOn: string;\n modifiedOn: string | null;\n savedOn: string;\n createdBy: ApwIdentity;\n modifiedBy: ApwIdentity | null;\n savedBy: ApwIdentity;\n\n tenant: string;\n locale: string;\n}\n\nexport interface ApwScheduleAction extends BaseFields {\n data: ApwScheduleActionData;\n}\n\nexport enum ApwScheduleActionTypes {\n PUBLISH = \"publish\",\n UNPUBLISH = \"unpublish\"\n}\n\nexport interface ApwScheduleActionData {\n action: ApwScheduleActionTypes;\n type: ApwContentTypes;\n datetime: string;\n entryId: string;\n /**\n * We will add modelId to the data for now.\n * TODO extract in separate package?\n */\n modelId?: string;\n}\n\nexport enum InvocationTypes {\n SCHEDULED = \"scheduled\"\n}\n\ninterface BaseApwCrud<TEntry, TCreateEntryParams, TUpdateEntryParams> {\n get(id: string): Promise<TEntry | null>;\n\n create(data: TCreateEntryParams): Promise<TEntry>;\n\n update(id: string, data: TUpdateEntryParams): Promise<TEntry>;\n\n delete(id: string): Promise<boolean>;\n}\n\nexport interface ApwScheduleActionCrud\n extends BaseApwCrud<ApwScheduleAction, ApwScheduleActionData, ApwScheduleActionData> {\n list(params: ListParams): Promise<[ApwScheduleAction[], ListMeta]>;\n\n getCurrentTask(): Promise<ApwScheduleAction | null>;\n\n updateCurrentTask(item: ApwScheduleAction): Promise<ApwScheduleAction>;\n\n deleteCurrentTask(): Promise<boolean>;\n}\n\nexport interface ScheduleActionContext extends Context, I18NContext, TenancyContext {\n scheduleAction: ApwScheduleActionCrud;\n}\n\nexport interface CreateScheduleActionParams {\n getLocale: () => I18NLocale;\n getIdentity: () => SecurityIdentity;\n getTenant: () => Tenant;\n getPermission: (name: string) => Promise<SecurityPermission | null>;\n storageOperations: ApwScheduleActionStorageOperations;\n}\n\ninterface CreateApwScheduleActionParams {\n item: ApwScheduleAction;\n input: ApwScheduleActionData;\n}\n\ninterface StorageOperationsGetParams {\n where: {\n id: string;\n tenant: string;\n locale: string;\n };\n}\n\ninterface StorageOperationsDeleteParams {\n id: string;\n tenant: string;\n locale: string;\n}\n\nexport interface ApwScheduleActionListParams extends ListParams {\n where: ListWhere & {\n tenant: string;\n locale: string;\n };\n}\n\nexport type StorageOperationsGetScheduleActionParams = StorageOperationsGetParams;\n\nexport type StorageOperationsDeleteScheduleActionParams = StorageOperationsDeleteParams;\nexport type StorageOperationsListScheduleActionsParams = ApwScheduleActionListParams;\n\nexport type StorageOperationsCreateScheduleActionParams = CreateApwScheduleActionParams;\n\nexport interface StorageOperationsUpdateScheduleActionParams {\n item: ApwScheduleAction;\n input: ApwScheduleActionData;\n}\n\nexport type StorageOperationsListScheduleActionsResponse = [ApwScheduleAction[], ListMeta];\n\nexport interface StorageOperationsUpdateCurrentTaskParams {\n item: ApwScheduleAction;\n}\n\nexport interface StorageOperationsGetCurrentTaskParams {\n where: Pick<StorageOperationsGetParams[\"where\"], \"tenant\" | \"locale\">;\n}\n\nexport type StorageOperationsDeleteCurrentTaskParams = Pick<\n StorageOperationsDeleteParams,\n \"tenant\" | \"locale\"\n>;\n\nexport interface ApwScheduleActionStorageOperations {\n get(params: StorageOperationsGetScheduleActionParams): Promise<ApwScheduleAction | null>;\n\n list(\n params: StorageOperationsListScheduleActionsParams\n ): Promise<StorageOperationsListScheduleActionsResponse>;\n\n create(params: StorageOperationsCreateScheduleActionParams): Promise<ApwScheduleAction>;\n\n update(params: StorageOperationsUpdateScheduleActionParams): Promise<ApwScheduleAction>;\n\n delete(params: StorageOperationsDeleteScheduleActionParams): Promise<boolean>;\n\n getCurrentTask(\n params: StorageOperationsGetCurrentTaskParams\n ): Promise<ApwScheduleAction | null>;\n\n updateCurrentTask(params: StorageOperationsUpdateCurrentTaskParams): Promise<ApwScheduleAction>;\n\n deleteCurrentTask(params: StorageOperationsDeleteCurrentTaskParams): Promise<boolean>;\n}\n\nexport interface CreateApwContextParams {\n storageOperations: ApwScheduleActionStorageOperations;\n}\n"],"mappings":";;;;;;IAiDYA,eAAe,GAAAC,OAAA,CAAAD,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;AAAA,IAuBfE,sBAAsB,GAAAD,OAAA,CAAAC,sBAAA,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAAA,IAiBtBC,eAAe,GAAAF,OAAA,CAAAE,eAAA,0BAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { ApwChangeRequestStorageOperations } from "./types";
|
2
|
-
import { CreateApwStorageOperationsParams } from "./index";
|
1
|
+
import type { ApwChangeRequestStorageOperations } from "./types";
|
2
|
+
import type { CreateApwStorageOperationsParams } from "./index";
|
3
3
|
export declare const createChangeRequestStorageOperations: (params: CreateApwStorageOperationsParams) => ApwChangeRequestStorageOperations;
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.createChangeRequestStorageOperations = void 0;
|
8
|
-
var
|
9
|
-
var _index = require("./index");
|
8
|
+
var _pickEntryFieldValues = require("../utils/pickEntryFieldValues");
|
10
9
|
var _fieldResolver = require("../utils/fieldResolver");
|
11
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
12
11
|
const createChangeRequestStorageOperations = params => {
|
@@ -16,9 +15,7 @@ const createChangeRequestStorageOperations = params => {
|
|
16
15
|
security
|
17
16
|
} = params;
|
18
17
|
const getChangeRequestModel = async () => {
|
19
|
-
security.disableAuthorization();
|
20
18
|
const model = await cms.getModel("apwChangeRequestModelDefinition");
|
21
|
-
security.enableAuthorization();
|
22
19
|
if (!model) {
|
23
20
|
throw new _error.default("Could not find `apwChangeRequestModelDefinition` model.", "MODEL_NOT_FOUND_ERROR");
|
24
21
|
}
|
@@ -28,12 +25,10 @@ const createChangeRequestStorageOperations = params => {
|
|
28
25
|
id
|
29
26
|
}) => {
|
30
27
|
const model = await getChangeRequestModel();
|
31
|
-
security.disableAuthorization();
|
32
28
|
const entry = await cms.getEntryById(model, id);
|
33
|
-
security.enableAuthorization();
|
34
29
|
return (0, _fieldResolver.getFieldValues)({
|
35
30
|
entry,
|
36
|
-
fields:
|
31
|
+
fields: _pickEntryFieldValues.baseFields,
|
37
32
|
context: getCmsContext(),
|
38
33
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
39
34
|
});
|
@@ -43,15 +38,16 @@ const createChangeRequestStorageOperations = params => {
|
|
43
38
|
getChangeRequest,
|
44
39
|
async listChangeRequests(params) {
|
45
40
|
const model = await getChangeRequestModel();
|
46
|
-
|
47
|
-
|
48
|
-
where:
|
49
|
-
|
50
|
-
|
41
|
+
const [entries, meta] = await cms.listLatestEntries(model, {
|
42
|
+
...params,
|
43
|
+
where: {
|
44
|
+
...params.where
|
45
|
+
}
|
46
|
+
});
|
51
47
|
try {
|
52
48
|
const all = await Promise.all(entries.map(entry => (0, _fieldResolver.getFieldValues)({
|
53
49
|
entry,
|
54
|
-
fields:
|
50
|
+
fields: _pickEntryFieldValues.baseFields,
|
55
51
|
context: getCmsContext(),
|
56
52
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
57
53
|
})));
|
@@ -62,18 +58,17 @@ const createChangeRequestStorageOperations = params => {
|
|
62
58
|
},
|
63
59
|
async createChangeRequest(params) {
|
64
60
|
const model = await getChangeRequestModel();
|
65
|
-
security.disableAuthorization();
|
66
61
|
const entry = await cms.createEntry(model, params.data);
|
67
|
-
security.enableAuthorization();
|
68
62
|
return (0, _fieldResolver.getFieldValues)({
|
69
63
|
entry,
|
70
|
-
fields:
|
64
|
+
fields: _pickEntryFieldValues.baseFields,
|
71
65
|
context: getCmsContext(),
|
72
66
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
73
67
|
});
|
74
68
|
},
|
75
69
|
async updateChangeRequest(params) {
|
76
70
|
const model = await getChangeRequestModel();
|
71
|
+
|
77
72
|
/**
|
78
73
|
* We're fetching the existing entry here because we're not accepting "app" field as input,
|
79
74
|
* but, we still need to retain its value after the "update" operation.
|
@@ -81,23 +76,49 @@ const createChangeRequestStorageOperations = params => {
|
|
81
76
|
const existingEntry = await getChangeRequest({
|
82
77
|
id: params.id
|
83
78
|
});
|
84
|
-
|
85
|
-
|
86
|
-
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Only creator can update the change request
|
82
|
+
*/
|
83
|
+
if (existingEntry.createdBy.id !== security.getIdentity().id) {
|
84
|
+
throw new _error.default("A change request can only be updated by its creator.", "ONLY_CREATOR_CAN_UPDATE_CHANGE_REQUEST");
|
85
|
+
}
|
86
|
+
const entry = await cms.updateEntry(model, params.id, {
|
87
|
+
...existingEntry,
|
88
|
+
...params.data,
|
89
|
+
savedOn: new Date()
|
90
|
+
});
|
87
91
|
return (0, _fieldResolver.getFieldValues)({
|
88
92
|
entry,
|
89
|
-
fields:
|
93
|
+
fields: _pickEntryFieldValues.baseFields,
|
90
94
|
context: getCmsContext(),
|
91
95
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
92
96
|
});
|
93
97
|
},
|
94
98
|
async deleteChangeRequest(params) {
|
95
99
|
const model = await getChangeRequestModel();
|
96
|
-
security.
|
100
|
+
if (!security.getIdentity()) {
|
101
|
+
return true;
|
102
|
+
}
|
103
|
+
|
104
|
+
/**
|
105
|
+
* We're fetching the existing entry
|
106
|
+
*/
|
107
|
+
const existingEntry = await getChangeRequest({
|
108
|
+
id: params.id
|
109
|
+
});
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Only creator can delete the change request
|
113
|
+
*/
|
114
|
+
if (existingEntry.createdBy.id !== security.getIdentity().id) {
|
115
|
+
throw new _error.default("A change request can only be deleted by its creator.", "ONLY_CREATOR_CAN_DELETE_CHANGE_REQUEST");
|
116
|
+
}
|
97
117
|
await cms.deleteEntry(model, params.id);
|
98
|
-
security.enableAuthorization();
|
99
118
|
return true;
|
100
119
|
}
|
101
120
|
};
|
102
121
|
};
|
103
|
-
exports.createChangeRequestStorageOperations = createChangeRequestStorageOperations;
|
122
|
+
exports.createChangeRequestStorageOperations = createChangeRequestStorageOperations;
|
123
|
+
|
124
|
+
//# sourceMappingURL=changeRequestStorageOperations.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createChangeRequestStorageOperations","params","cms","getCmsContext","security","getChangeRequestModel","
|
1
|
+
{"version":3,"names":["_pickEntryFieldValues","require","_fieldResolver","_error","_interopRequireDefault","createChangeRequestStorageOperations","params","cms","getCmsContext","security","getChangeRequestModel","model","getModel","WebinyError","getChangeRequest","id","entry","getEntryById","getFieldValues","fields","baseFields","context","transformers","getTransformer","listChangeRequests","entries","meta","listLatestEntries","where","all","Promise","map","ex","message","code","data","createChangeRequest","createEntry","updateChangeRequest","existingEntry","createdBy","getIdentity","updateEntry","savedOn","Date","deleteChangeRequest","deleteEntry","exports"],"sources":["changeRequestStorageOperations.ts"],"sourcesContent":["import type { ApwChangeRequestStorageOperations } from \"./types\";\nimport type { CreateApwStorageOperationsParams } from \"~/storageOperations/index\";\nimport { baseFields } from \"~/utils/pickEntryFieldValues\";\nimport { getFieldValues, getTransformer } from \"~/utils/fieldResolver\";\nimport WebinyError from \"@webiny/error\";\nimport type { ApwChangeRequest } from \"~/types\";\n\nexport const createChangeRequestStorageOperations = (\n params: CreateApwStorageOperationsParams\n): ApwChangeRequestStorageOperations => {\n const { cms, getCmsContext, security } = params;\n const getChangeRequestModel = async () => {\n const model = await cms.getModel(\"apwChangeRequestModelDefinition\");\n if (!model) {\n throw new WebinyError(\n \"Could not find `apwChangeRequestModelDefinition` model.\",\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getChangeRequest: ApwChangeRequestStorageOperations[\"getChangeRequest\"] = async ({\n id\n }) => {\n const model = await getChangeRequestModel();\n\n const entry = await cms.getEntryById(model, id);\n\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n };\n return {\n getChangeRequestModel,\n getChangeRequest,\n async listChangeRequests(params) {\n const model = await getChangeRequestModel();\n\n const [entries, meta] = await cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n\n try {\n const all = await Promise.all(\n entries.map(entry =>\n getFieldValues<ApwChangeRequest>({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n })\n )\n );\n return [all, meta];\n } catch (ex) {\n throw new WebinyError(ex.message, ex.code, ex.data);\n }\n },\n async createChangeRequest(params) {\n const model = await getChangeRequestModel();\n const entry = await cms.createEntry(model, params.data);\n\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n },\n async updateChangeRequest(params) {\n const model = await getChangeRequestModel();\n\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getChangeRequest({ id: params.id });\n\n /**\n * Only creator can update the change request\n */\n if (existingEntry.createdBy.id !== security.getIdentity().id) {\n throw new WebinyError(\n \"A change request can only be updated by its creator.\",\n \"ONLY_CREATOR_CAN_UPDATE_CHANGE_REQUEST\"\n );\n }\n\n const entry = await cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data,\n savedOn: new Date()\n });\n\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n },\n async deleteChangeRequest(params) {\n const model = await getChangeRequestModel();\n\n if (!security.getIdentity()) {\n return true;\n }\n\n /**\n * We're fetching the existing entry\n */\n const existingEntry = await getChangeRequest({ id: params.id });\n\n /**\n * Only creator can delete the change request\n */\n if (existingEntry.createdBy.id !== security.getIdentity().id) {\n throw new WebinyError(\n \"A change request can only be deleted by its creator.\",\n \"ONLY_CREATOR_CAN_DELETE_CHANGE_REQUEST\"\n );\n }\n\n await cms.deleteEntry(model, params.id);\n\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;AAEA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGO,MAAMI,oCAAoC,GAC7CC,MAAwC,IACJ;EACpC,MAAM;IAAEC,GAAG;IAAEC,aAAa;IAAEC;EAAS,CAAC,GAAGH,MAAM;EA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,OAAO,EAAE,IAAIC,IAAI,CAAC;MACtB,CAAC,CAAC;MAEF,OAAO,IAAA1B,6BAAc,EAAC;QAClBF,KAAK;QACLG,MAAM,EAAEC,gCAAU;QAClBC,OAAO,EAAEb,aAAa,CAAC,CAAC;QACxBc,YAAY,EAAE,CAAC,IAAAC,6BAAc,EAACZ,KAAK,EAAE,MAAM,CAAC;MAChD,CAAC,CAAC;IACN,CAAC;IACD,MAAMkC,mBAAmBA,CAACvC,MAAM,EAAE;MAC9B,MAAMK,KAAK,GAAG,MAAMD,qBAAqB,CAAC,CAAC;MAE3C,IAAI,CAACD,QAAQ,CAACgC,WAAW,CAAC,CAAC,EAAE;QACzB,OAAO,IAAI;MACf;;MAEA;AACZ;AACA;MACY,MAAMF,aAAa,GAAG,MAAMzB,gBAAgB,CAAC;QAAEC,EAAE,EAAET,MAAM,CAACS;MAAG,CAAC,CAAC;;MAE/D;AACZ;AACA;MACY,IAAIwB,aAAa,CAACC,SAAS,CAACzB,EAAE,KAAKN,QAAQ,CAACgC,WAAW,CAAC,CAAC,CAAC1B,EAAE,EAAE;QAC1D,MAAM,IAAIF,cAAW,CACjB,sDAAsD,EACtD,wCACJ,CAAC;MACL;MAEA,MAAMN,GAAG,CAACuC,WAAW,CAACnC,KAAK,EAAEL,MAAM,CAACS,EAAE,CAAC;MAEvC,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC;AAACgC,OAAA,CAAA1C,oCAAA,GAAAA,oCAAA","ignoreList":[]}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { ApwCommentStorageOperations } from "./types";
|
2
|
-
import { CreateApwStorageOperationsParams } from "./index";
|
3
|
-
export declare const createCommentStorageOperations: ({ cms, getCmsContext
|
1
|
+
import type { ApwCommentStorageOperations } from "./types";
|
2
|
+
import type { CreateApwStorageOperationsParams } from "./index";
|
3
|
+
export declare const createCommentStorageOperations: ({ cms, getCmsContext }: CreateApwStorageOperationsParams) => ApwCommentStorageOperations;
|