@erxes/api-shared 0.0.0-stage → 3.2.19-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/LICENSE.md +672 -0
- package/core-modules/dist/erxes-api-shared-core-modules.cjs.d.ts +2 -0
- package/core-modules/dist/erxes-api-shared-core-modules.cjs.dev.js +6685 -0
- package/core-modules/dist/erxes-api-shared-core-modules.cjs.js +7 -0
- package/core-modules/dist/erxes-api-shared-core-modules.cjs.prod.js +6685 -0
- package/core-modules/dist/erxes-api-shared-core-modules.esm.js +6298 -0
- package/core-modules/package.json +5 -0
- package/core-types/dist/erxes-api-shared-core-types.cjs.d.ts +2 -0
- package/core-types/dist/erxes-api-shared-core-types.cjs.dev.js +12 -0
- package/core-types/dist/erxes-api-shared-core-types.cjs.js +7 -0
- package/core-types/dist/erxes-api-shared-core-types.cjs.prod.js +12 -0
- package/core-types/dist/erxes-api-shared-core-types.esm.js +8 -0
- package/core-types/package.json +5 -0
- package/dist/declarations/src/core-modules/approval/approvalChangeTypes.d.ts +15 -0
- package/dist/declarations/src/core-modules/approval/approvalChangeTypes.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/approval/checkApprovalLock.d.ts +7 -0
- package/dist/declarations/src/core-modules/approval/checkApprovalLock.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/approval/constants.d.ts +37 -0
- package/dist/declarations/src/core-modules/approval/constants.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/approval/index.d.ts +7 -0
- package/dist/declarations/src/core-modules/approval/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/approval/initApproval.d.ts +9 -0
- package/dist/declarations/src/core-modules/approval/initApproval.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/approval/types.d.ts +164 -0
- package/dist/declarations/src/core-modules/approval/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/approval/zodSchemas.d.ts +125 -0
- package/dist/declarations/src/core-modules/approval/zodSchemas.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/apps/@types/app.d.ts +15 -0
- package/dist/declarations/src/core-modules/apps/@types/app.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/apps/db/definitions/apps.d.ts +13 -0
- package/dist/declarations/src/core-modules/apps/db/definitions/apps.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/apps/index.d.ts +3 -0
- package/dist/declarations/src/core-modules/apps/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/actionErrorPolicy.d.ts +68 -0
- package/dist/declarations/src/core-modules/automations/actionErrorPolicy.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/actionOutcome.d.ts +51 -0
- package/dist/declarations/src/core-modules/automations/actionOutcome.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/constants.d.ts +101 -0
- package/dist/declarations/src/core-modules/automations/constants.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/definitions/aiAgents.d.ts +141 -0
- package/dist/declarations/src/core-modules/automations/definitions/aiAgents.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/definitions/automations.d.ts +868 -0
- package/dist/declarations/src/core-modules/automations/definitions/automations.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/definitions/executions.d.ts +316 -0
- package/dist/declarations/src/core-modules/automations/definitions/executions.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/definitions/index.d.ts +4 -0
- package/dist/declarations/src/core-modules/automations/definitions/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/index.d.ts +14 -0
- package/dist/declarations/src/core-modules/automations/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/outputResolvers.d.ts +67 -0
- package/dist/declarations/src/core-modules/automations/outputResolvers.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/reEnrollment.d.ts +23 -0
- package/dist/declarations/src/core-modules/automations/reEnrollment.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/segmentMembership.d.ts +19 -0
- package/dist/declarations/src/core-modules/automations/segmentMembership.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/sendAutomationMessage.d.ts +51 -0
- package/dist/declarations/src/core-modules/automations/sendAutomationMessage.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/setupAutomationProducers.d.ts +4 -0
- package/dist/declarations/src/core-modules/automations/setupAutomationProducers.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/typeUtils.d.ts +2 -0
- package/dist/declarations/src/core-modules/automations/typeUtils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/types.d.ts +474 -0
- package/dist/declarations/src/core-modules/automations/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/utils.d.ts +38 -0
- package/dist/declarations/src/core-modules/automations/utils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/workflowValidation.d.ts +3 -0
- package/dist/declarations/src/core-modules/automations/workflowValidation.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/automations/zodTypes.d.ts +2366 -0
- package/dist/declarations/src/core-modules/automations/zodTypes.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/clientPortal.d.ts +375 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/clientPortal.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/comment.d.ts +53 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/comment.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/cpNotification.d.ts +110 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/cpNotification.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/cpUser.d.ts +828 -0
- package/dist/declarations/src/core-modules/client-portals/definitions/cpUser.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/client-portals/index.d.ts +5 -0
- package/dist/declarations/src/core-modules/client-portals/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/db/definitions/common.d.ts +77 -0
- package/dist/declarations/src/core-modules/common/db/definitions/common.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/createEventHandlers.d.ts +8 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/createEventHandlers.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/generateEventHandlers.d.ts +4 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/generateEventHandlers.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/index.d.ts +5 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/runtimeContext.d.ts +9 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/runtimeContext.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/schemas.d.ts +82 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/schemas.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/types.d.ts +87 -0
- package/dist/declarations/src/core-modules/common/eventHandlers/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/index.d.ts +5 -0
- package/dist/declarations/src/core-modules/common/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/references/getRecordReferenceFields.d.ts +57 -0
- package/dist/declarations/src/core-modules/common/references/getRecordReferenceFields.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/references/index.d.ts +6 -0
- package/dist/declarations/src/core-modules/common/references/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/references/initRecordReferences.d.ts +4 -0
- package/dist/declarations/src/core-modules/common/references/initRecordReferences.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/references/resolveRecordReferencePlaceholders.d.ts +12 -0
- package/dist/declarations/src/core-modules/common/references/resolveRecordReferencePlaceholders.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/references/resolveRecordReferenceValue.d.ts +6 -0
- package/dist/declarations/src/core-modules/common/references/resolveRecordReferenceValue.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/references/types.d.ts +63 -0
- package/dist/declarations/src/core-modules/common/references/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/common/routeToModuleProducer.d.ts +55 -0
- package/dist/declarations/src/core-modules/common/routeToModuleProducer.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/blocksToHtml.d.ts +72 -0
- package/dist/declarations/src/core-modules/email-content/blocksToHtml.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/constants.d.ts +5 -0
- package/dist/declarations/src/core-modules/email-content/constants.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/emailFooter.d.ts +5 -0
- package/dist/declarations/src/core-modules/email-content/emailFooter.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/expandRepeatRows.d.ts +9 -0
- package/dist/declarations/src/core-modules/email-content/expandRepeatRows.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/index.d.ts +9 -0
- package/dist/declarations/src/core-modules/email-content/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/renderEmailContent.d.ts +19 -0
- package/dist/declarations/src/core-modules/email-content/renderEmailContent.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/replacePlaceholders.d.ts +36 -0
- package/dist/declarations/src/core-modules/email-content/replacePlaceholders.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/types.d.ts +48 -0
- package/dist/declarations/src/core-modules/email-content/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/email-content/unresolvedPlaceholders.d.ts +4 -0
- package/dist/declarations/src/core-modules/email-content/unresolvedPlaceholders.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/forms/index.d.ts +3 -0
- package/dist/declarations/src/core-modules/forms/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/forms/types.d.ts +55 -0
- package/dist/declarations/src/core-modules/forms/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/forms/utils.d.ts +4 -0
- package/dist/declarations/src/core-modules/forms/utils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/index.d.ts +8 -0
- package/dist/declarations/src/core-modules/import-export/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/types.d.ts +181 -0
- package/dist/declarations/src/core-modules/import-export/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/utils/exportCursor.d.ts +14 -0
- package/dist/declarations/src/core-modules/import-export/utils/exportCursor.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/utils/headerMatcher.d.ts +32 -0
- package/dist/declarations/src/core-modules/import-export/utils/headerMatcher.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/utils/importExportRuntime.d.ts +32 -0
- package/dist/declarations/src/core-modules/import-export/utils/importExportRuntime.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/utils/importUtils.d.ts +25 -0
- package/dist/declarations/src/core-modules/import-export/utils/importUtils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/worker.d.ts +8 -0
- package/dist/declarations/src/core-modules/import-export/worker.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/import-export/zodSchemas.d.ts +111 -0
- package/dist/declarations/src/core-modules/import-export/zodSchemas.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/index.d.ts +16 -0
- package/dist/declarations/src/core-modules/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/activityLog/builder.d.ts +3 -0
- package/dist/declarations/src/core-modules/logs/activityLog/builder.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/activityLog/index.d.ts +5 -0
- package/dist/declarations/src/core-modules/logs/activityLog/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/activityLog/sharedBuilders.d.ts +18 -0
- package/dist/declarations/src/core-modules/logs/activityLog/sharedBuilders.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/activityLog/types.d.ts +21 -0
- package/dist/declarations/src/core-modules/logs/activityLog/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/activityLog/utils.d.ts +10 -0
- package/dist/declarations/src/core-modules/logs/activityLog/utils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/activityLogUtils.d.ts +72 -0
- package/dist/declarations/src/core-modules/logs/activityLogUtils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/definitions/activityLog.d.ts +84 -0
- package/dist/declarations/src/core-modules/logs/definitions/activityLog.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/definitions/logs.d.ts +39 -0
- package/dist/declarations/src/core-modules/logs/definitions/logs.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/index.d.ts +6 -0
- package/dist/declarations/src/core-modules/logs/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/logs/types.d.ts +15 -0
- package/dist/declarations/src/core-modules/logs/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailAddresses.d.ts +73 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailAddresses.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailDeliveries.d.ts +115 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailDeliveries.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailRamp.d.ts +65 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailRamp.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailSenders.d.ts +58 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailSenders.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/definitions/notificationSettings.d.ts +66 -0
- package/dist/declarations/src/core-modules/notifications/definitions/notificationSettings.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/definitions/notifications.d.ts +89 -0
- package/dist/declarations/src/core-modules/notifications/definitions/notifications.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/index.d.ts +8 -0
- package/dist/declarations/src/core-modules/notifications/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/notifications/utils.d.ts +85 -0
- package/dist/declarations/src/core-modules/notifications/utils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/permissions/db/definitions/permissions.d.ts +60 -0
- package/dist/declarations/src/core-modules/permissions/db/definitions/permissions.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/permissions/index.d.ts +4 -0
- package/dist/declarations/src/core-modules/permissions/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/permissions/user-actions-map.d.ts +4 -0
- package/dist/declarations/src/core-modules/permissions/user-actions-map.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/permissions/utils.d.ts +22 -0
- package/dist/declarations/src/core-modules/permissions/utils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/filter.d.ts +5 -0
- package/dist/declarations/src/core-modules/properties/filter.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/importExport.d.ts +18 -0
- package/dist/declarations/src/core-modules/properties/importExport.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/index.d.ts +10 -0
- package/dist/declarations/src/core-modules/properties/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/keys.d.ts +46 -0
- package/dist/declarations/src/core-modules/properties/keys.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/mergeRows.d.ts +8 -0
- package/dist/declarations/src/core-modules/properties/mergeRows.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/operators.d.ts +6 -0
- package/dist/declarations/src/core-modules/properties/operators.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/options.d.ts +10 -0
- package/dist/declarations/src/core-modules/properties/options.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/setupPropertyProducers.d.ts +4 -0
- package/dist/declarations/src/core-modules/properties/setupPropertyProducers.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/types.d.ts +14 -0
- package/dist/declarations/src/core-modules/properties/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/properties/valueUsage.d.ts +56 -0
- package/dist/declarations/src/core-modules/properties/valueUsage.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/dependencies.d.ts +6 -0
- package/dist/declarations/src/core-modules/segments/dependencies.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/evaluate.d.ts +11 -0
- package/dist/declarations/src/core-modules/segments/evaluate.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/evaluateBatch.d.ts +42 -0
- package/dist/declarations/src/core-modules/segments/evaluateBatch.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/evaluateFieldsRouter.d.ts +29 -0
- package/dist/declarations/src/core-modules/segments/evaluateFieldsRouter.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/evaluateOwned.d.ts +27 -0
- package/dist/declarations/src/core-modules/segments/evaluateOwned.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/events.d.ts +45 -0
- package/dist/declarations/src/core-modules/segments/events.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/fieldBuilders.d.ts +35 -0
- package/dist/declarations/src/core-modules/segments/fieldBuilders.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/fieldMeta.d.ts +62 -0
- package/dist/declarations/src/core-modules/segments/fieldMeta.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/fieldRequests.d.ts +33 -0
- package/dist/declarations/src/core-modules/segments/fieldRequests.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/fingerprint.d.ts +6 -0
- package/dist/declarations/src/core-modules/segments/fingerprint.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/index.d.ts +31 -0
- package/dist/declarations/src/core-modules/segments/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/joinChanges.d.ts +11 -0
- package/dist/declarations/src/core-modules/segments/joinChanges.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/materialized.d.ts +9 -0
- package/dist/declarations/src/core-modules/segments/materialized.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/measureRelations.d.ts +18 -0
- package/dist/declarations/src/core-modules/segments/measureRelations.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/memberQuery.d.ts +13 -0
- package/dist/declarations/src/core-modules/segments/memberQuery.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/membership.d.ts +24 -0
- package/dist/declarations/src/core-modules/segments/membership.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/mongoFilter.d.ts +15 -0
- package/dist/declarations/src/core-modules/segments/mongoFilter.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/nodeRefs.d.ts +5 -0
- package/dist/declarations/src/core-modules/segments/nodeRefs.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/nodes.d.ts +42 -0
- package/dist/declarations/src/core-modules/segments/nodes.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/operators.d.ts +46 -0
- package/dist/declarations/src/core-modules/segments/operators.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/ownedSource.d.ts +7 -0
- package/dist/declarations/src/core-modules/segments/ownedSource.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/plan.d.ts +35 -0
- package/dist/declarations/src/core-modules/segments/plan.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/relationRegistry.d.ts +33 -0
- package/dist/declarations/src/core-modules/segments/relationRegistry.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/setupSegmentProducers.d.ts +4 -0
- package/dist/declarations/src/core-modules/segments/setupSegmentProducers.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/subjectsReachedBy.d.ts +11 -0
- package/dist/declarations/src/core-modules/segments/subjectsReachedBy.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/timeZone.d.ts +2 -0
- package/dist/declarations/src/core-modules/segments/timeZone.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/types.d.ts +67 -0
- package/dist/declarations/src/core-modules/segments/types.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/utils.d.ts +4 -0
- package/dist/declarations/src/core-modules/segments/utils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/walkNodes.d.ts +9 -0
- package/dist/declarations/src/core-modules/segments/walkNodes.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/zodSchemas.d.ts +532 -0
- package/dist/declarations/src/core-modules/segments/zodSchemas.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/segments/zonedTime.d.ts +25 -0
- package/dist/declarations/src/core-modules/segments/zonedTime.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/templates/index.d.ts +2 -0
- package/dist/declarations/src/core-modules/templates/index.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/templates/utils.d.ts +11 -0
- package/dist/declarations/src/core-modules/templates/utils.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/users/constants.d.ts +114 -0
- package/dist/declarations/src/core-modules/users/constants.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/users/db/definitions/users.d.ts +24 -0
- package/dist/declarations/src/core-modules/users/db/definitions/users.d.ts.map +1 -0
- package/dist/declarations/src/core-modules/users/index.d.ts +3 -0
- package/dist/declarations/src/core-modules/users/index.d.ts.map +1 -0
- package/dist/declarations/src/core-types/common.d.ts +149 -0
- package/dist/declarations/src/core-types/common.d.ts.map +1 -0
- package/dist/declarations/src/core-types/index.d.ts +20 -0
- package/dist/declarations/src/core-types/index.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/app/app.d.ts +12 -0
- package/dist/declarations/src/core-types/modules/app/app.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/automations/automations.d.ts +19 -0
- package/dist/declarations/src/core-types/modules/automations/automations.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/contacts/company.d.ts +53 -0
- package/dist/declarations/src/core-types/modules/contacts/company.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/contacts/contacts-common.d.ts +32 -0
- package/dist/declarations/src/core-types/modules/contacts/contacts-common.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/contacts/customer.d.ts +74 -0
- package/dist/declarations/src/core-types/modules/contacts/customer.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/emailTemplates/emailTemplate.d.ts +18 -0
- package/dist/declarations/src/core-types/modules/emailTemplates/emailTemplate.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/logs/logs.d.ts +28 -0
- package/dist/declarations/src/core-types/modules/logs/logs.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/permissions/permission.d.ts +56 -0
- package/dist/declarations/src/core-types/modules/permissions/permission.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/permissions/role.d.ts +21 -0
- package/dist/declarations/src/core-types/modules/permissions/role.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/products/product.d.ts +76 -0
- package/dist/declarations/src/core-types/modules/products/product.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/products/productCategory.d.ts +26 -0
- package/dist/declarations/src/core-types/modules/products/productCategory.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/products/productConfig.d.ts +9 -0
- package/dist/declarations/src/core-types/modules/products/productConfig.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/products/uom.d.ts +11 -0
- package/dist/declarations/src/core-types/modules/products/uom.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/relations/relations.d.ts +13 -0
- package/dist/declarations/src/core-types/modules/relations/relations.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/saas/organization.d.ts +8 -0
- package/dist/declarations/src/core-types/modules/saas/organization.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/tags/tag.d.ts +16 -0
- package/dist/declarations/src/core-types/modules/tags/tag.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/team-member/structure.d.ts +19 -0
- package/dist/declarations/src/core-types/modules/team-member/structure.d.ts.map +1 -0
- package/dist/declarations/src/core-types/modules/team-member/user.d.ts +90 -0
- package/dist/declarations/src/core-types/modules/team-member/user.d.ts.map +1 -0
- package/dist/declarations/src/index.d.ts +3 -0
- package/dist/declarations/src/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/agent-tools/auth.d.ts +18 -0
- package/dist/declarations/src/utils/agent-tools/auth.d.ts.map +1 -0
- package/dist/declarations/src/utils/agent-tools/endpoints.d.ts +16 -0
- package/dist/declarations/src/utils/agent-tools/endpoints.d.ts.map +1 -0
- package/dist/declarations/src/utils/agent-tools/index.d.ts +6 -0
- package/dist/declarations/src/utils/agent-tools/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/agent-tools/manifest.d.ts +11 -0
- package/dist/declarations/src/utils/agent-tools/manifest.d.ts.map +1 -0
- package/dist/declarations/src/utils/agent-tools/responseLimit.d.ts +26 -0
- package/dist/declarations/src/utils/agent-tools/responseLimit.d.ts.map +1 -0
- package/dist/declarations/src/utils/agent-tools/types.d.ts +48 -0
- package/dist/declarations/src/utils/agent-tools/types.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/beforeResolvers.d.ts +41 -0
- package/dist/declarations/src/utils/apollo/beforeResolvers.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/commonTypeDefs.d.ts +7 -0
- package/dist/declarations/src/utils/apollo/commonTypeDefs.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/constants.d.ts +3 -0
- package/dist/declarations/src/utils/apollo/constants.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/customScalars.d.ts +6 -0
- package/dist/declarations/src/utils/apollo/customScalars.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/expectedErrorPlugin.d.ts +11 -0
- package/dist/declarations/src/utils/apollo/expectedErrorPlugin.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/index.d.ts +10 -0
- package/dist/declarations/src/utils/apollo/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/runBeforeResolvers.d.ts +27 -0
- package/dist/declarations/src/utils/apollo/runBeforeResolvers.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/utils.d.ts +5 -0
- package/dist/declarations/src/utils/apollo/utils.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/wrapperMutations.d.ts +8 -0
- package/dist/declarations/src/utils/apollo/wrapperMutations.d.ts.map +1 -0
- package/dist/declarations/src/utils/apollo/wrapperResolvers.d.ts +8 -0
- package/dist/declarations/src/utils/apollo/wrapperResolvers.d.ts.map +1 -0
- package/dist/declarations/src/utils/bulkUtils.d.ts +7 -0
- package/dist/declarations/src/utils/bulkUtils.d.ts.map +1 -0
- package/dist/declarations/src/utils/constants.d.ts +40 -0
- package/dist/declarations/src/utils/constants.d.ts.map +1 -0
- package/dist/declarations/src/utils/editor.d.ts +45 -0
- package/dist/declarations/src/utils/editor.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/address.d.ts +10 -0
- package/dist/declarations/src/utils/email/address.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/attachments.d.ts +12 -0
- package/dist/declarations/src/utils/email/attachments.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/config.d.ts +10 -0
- package/dist/declarations/src/utils/email/config.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/constants.d.ts +6 -0
- package/dist/declarations/src/utils/email/constants.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/index.d.ts +12 -0
- package/dist/declarations/src/utils/email/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/providers/sendgrid.d.ts +17 -0
- package/dist/declarations/src/utils/email/providers/sendgrid.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/providers/sendgridEvents.d.ts +18 -0
- package/dist/declarations/src/utils/email/providers/sendgridEvents.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/providers/ses.d.ts +19 -0
- package/dist/declarations/src/utils/email/providers/ses.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/providers/smtp.d.ts +14 -0
- package/dist/declarations/src/utils/email/providers/smtp.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/resolveProvider.d.ts +6 -0
- package/dist/declarations/src/utils/email/resolveProvider.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/service.d.ts +50 -0
- package/dist/declarations/src/utils/email/service.d.ts.map +1 -0
- package/dist/declarations/src/utils/email/types.d.ts +87 -0
- package/dist/declarations/src/utils/email/types.d.ts.map +1 -0
- package/dist/declarations/src/utils/errorClassifier.d.ts +56 -0
- package/dist/declarations/src/utils/errorClassifier.d.ts.map +1 -0
- package/dist/declarations/src/utils/file/read.d.ts +14 -0
- package/dist/declarations/src/utils/file/read.d.ts.map +1 -0
- package/dist/declarations/src/utils/file/upload.d.ts +10 -0
- package/dist/declarations/src/utils/file/upload.d.ts.map +1 -0
- package/dist/declarations/src/utils/graphqlPubSub.d.ts +3 -0
- package/dist/declarations/src/utils/graphqlPubSub.d.ts.map +1 -0
- package/dist/declarations/src/utils/headers/get-hostname.d.ts +5 -0
- package/dist/declarations/src/utils/headers/get-hostname.d.ts.map +1 -0
- package/dist/declarations/src/utils/headers/index.d.ts +5 -0
- package/dist/declarations/src/utils/headers/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/headers/sanitize.d.ts +3 -0
- package/dist/declarations/src/utils/headers/sanitize.d.ts.map +1 -0
- package/dist/declarations/src/utils/headers/subdomain.d.ts +4 -0
- package/dist/declarations/src/utils/headers/subdomain.d.ts.map +1 -0
- package/dist/declarations/src/utils/headers/user.d.ts +14 -0
- package/dist/declarations/src/utils/headers/user.d.ts.map +1 -0
- package/dist/declarations/src/utils/index.d.ts +28 -0
- package/dist/declarations/src/utils/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/knowledge.d.ts +50 -0
- package/dist/declarations/src/utils/knowledge.d.ts.map +1 -0
- package/dist/declarations/src/utils/logs/index.d.ts +103 -0
- package/dist/declarations/src/utils/logs/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/mongo/cursor-util.d.ts +41 -0
- package/dist/declarations/src/utils/mongo/cursor-util.d.ts.map +1 -0
- package/dist/declarations/src/utils/mongo/generate-models.d.ts +4 -0
- package/dist/declarations/src/utils/mongo/generate-models.d.ts.map +1 -0
- package/dist/declarations/src/utils/mongo/index.d.ts +6 -0
- package/dist/declarations/src/utils/mongo/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/mongo/mongo-connection.d.ts +5 -0
- package/dist/declarations/src/utils/mongo/mongo-connection.d.ts.map +1 -0
- package/dist/declarations/src/utils/mongo/mongoose-types.d.ts +22 -0
- package/dist/declarations/src/utils/mongo/mongoose-types.d.ts.map +1 -0
- package/dist/declarations/src/utils/mongo/mongoose-utils.d.ts +30 -0
- package/dist/declarations/src/utils/mongo/mongoose-utils.d.ts.map +1 -0
- package/dist/declarations/src/utils/mongo/search-tokens.d.ts +21 -0
- package/dist/declarations/src/utils/mongo/search-tokens.d.ts.map +1 -0
- package/dist/declarations/src/utils/mq-worker.d.ts +19 -0
- package/dist/declarations/src/utils/mq-worker.d.ts.map +1 -0
- package/dist/declarations/src/utils/random.d.ts +3 -0
- package/dist/declarations/src/utils/random.d.ts.map +1 -0
- package/dist/declarations/src/utils/redis.d.ts +4 -0
- package/dist/declarations/src/utils/redis.d.ts.map +1 -0
- package/dist/declarations/src/utils/saas/index.d.ts +3 -0
- package/dist/declarations/src/utils/saas/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/saas/saas-mongo-connection.d.ts +59 -0
- package/dist/declarations/src/utils/saas/saas-mongo-connection.d.ts.map +1 -0
- package/dist/declarations/src/utils/saas/types.d.ts +96 -0
- package/dist/declarations/src/utils/saas/types.d.ts.map +1 -0
- package/dist/declarations/src/utils/sanitize.d.ts +3 -0
- package/dist/declarations/src/utils/sanitize.d.ts.map +1 -0
- package/dist/declarations/src/utils/sentry-init.d.ts +15 -0
- package/dist/declarations/src/utils/sentry-init.d.ts.map +1 -0
- package/dist/declarations/src/utils/sentry-instrument.d.ts +2 -0
- package/dist/declarations/src/utils/sentry-instrument.d.ts.map +1 -0
- package/dist/declarations/src/utils/serializablePayload.d.ts +11 -0
- package/dist/declarations/src/utils/serializablePayload.d.ts.map +1 -0
- package/dist/declarations/src/utils/service-discovery.d.ts +25 -0
- package/dist/declarations/src/utils/service-discovery.d.ts.map +1 -0
- package/dist/declarations/src/utils/start-plugin.d.ts +85 -0
- package/dist/declarations/src/utils/start-plugin.d.ts.map +1 -0
- package/dist/declarations/src/utils/string.d.ts +82 -0
- package/dist/declarations/src/utils/string.d.ts.map +1 -0
- package/dist/declarations/src/utils/trpc/index.d.ts +79 -0
- package/dist/declarations/src/utils/trpc/index.d.ts.map +1 -0
- package/dist/declarations/src/utils/trpc/sendCoreModuleProducer.d.ts +53 -0
- package/dist/declarations/src/utils/trpc/sendCoreModuleProducer.d.ts.map +1 -0
- package/dist/declarations/src/utils/utils.d.ts +69 -0
- package/dist/declarations/src/utils/utils.d.ts.map +1 -0
- package/dist/erxes-api-shared.cjs.d.ts +3 -0
- package/dist/erxes-api-shared.cjs.dev.js +7 -0
- package/dist/erxes-api-shared.cjs.js +7 -0
- package/dist/erxes-api-shared.cjs.prod.js +7 -0
- package/dist/erxes-api-shared.esm.js +3 -0
- package/dist/start-plugin-576e707d.cjs.prod.js +23223 -0
- package/dist/start-plugin-6e76556c.esm.js +22742 -0
- package/dist/start-plugin-89fa2bd2.cjs.dev.js +23225 -0
- package/package.json +105 -4
- package/src/common-modules/payment/worker.ts +53 -0
- package/src/core-modules/approval/approvalChangeTypes.ts +31 -0
- package/src/core-modules/approval/checkApprovalLock.ts +85 -0
- package/src/core-modules/approval/constants.ts +45 -0
- package/src/core-modules/approval/index.ts +6 -0
- package/src/core-modules/approval/initApproval.ts +59 -0
- package/src/core-modules/approval/types.ts +206 -0
- package/src/core-modules/approval/zodSchemas.ts +55 -0
- package/src/core-modules/apps/@types/app.ts +15 -0
- package/src/core-modules/apps/db/definitions/apps.ts +30 -0
- package/src/core-modules/apps/index.ts +2 -0
- package/src/core-modules/automations/actionErrorPolicy.test.ts +125 -0
- package/src/core-modules/automations/actionErrorPolicy.ts +162 -0
- package/src/core-modules/automations/actionInputs.test.ts +70 -0
- package/src/core-modules/automations/actionOutcome.test.ts +87 -0
- package/src/core-modules/automations/actionOutcome.ts +128 -0
- package/src/core-modules/automations/constants.ts +181 -0
- package/src/core-modules/automations/definitions/aiAgents.ts +343 -0
- package/src/core-modules/automations/definitions/automations.ts +207 -0
- package/src/core-modules/automations/definitions/executions.ts +190 -0
- package/src/core-modules/automations/definitions/index.ts +3 -0
- package/src/core-modules/automations/getValueByPath.test.ts +49 -0
- package/src/core-modules/automations/index.ts +13 -0
- package/src/core-modules/automations/outputResolvers.test.ts +97 -0
- package/src/core-modules/automations/outputResolvers.ts +1238 -0
- package/src/core-modules/automations/reEnrollment.ts +34 -0
- package/src/core-modules/automations/segmentMembership.ts +34 -0
- package/src/core-modules/automations/sendAutomationMessage.ts +219 -0
- package/src/core-modules/automations/setPropertyOutcome.test.ts +105 -0
- package/src/core-modules/automations/setPropertyRows.test.ts +61 -0
- package/src/core-modules/automations/setupAutomationProducers.ts +187 -0
- package/src/core-modules/automations/typeUtils.ts +3 -0
- package/src/core-modules/automations/types.ts +577 -0
- package/src/core-modules/automations/utils.ts +1128 -0
- package/src/core-modules/automations/workflowValidation.ts +32 -0
- package/src/core-modules/automations/zodTypes.ts +221 -0
- package/src/core-modules/client-portals/definitions/clientPortal.ts +230 -0
- package/src/core-modules/client-portals/definitions/comment.ts +26 -0
- package/src/core-modules/client-portals/definitions/cpNotification.ts +112 -0
- package/src/core-modules/client-portals/definitions/cpUser.ts +236 -0
- package/src/core-modules/client-portals/index.ts +4 -0
- package/src/core-modules/common/db/definitions/common.ts +43 -0
- package/src/core-modules/common/eventHandlers/createEventHandlers.ts +236 -0
- package/src/core-modules/common/eventHandlers/generateEventHandlers.ts +37 -0
- package/src/core-modules/common/eventHandlers/index.ts +11 -0
- package/src/core-modules/common/eventHandlers/runtimeContext.ts +36 -0
- package/src/core-modules/common/eventHandlers/schemas.ts +53 -0
- package/src/core-modules/common/eventHandlers/types.ts +97 -0
- package/src/core-modules/common/eventHandlers/utils.ts +113 -0
- package/src/core-modules/common/index.ts +4 -0
- package/src/core-modules/common/references/fetchRecordReferenceTargets.ts +43 -0
- package/src/core-modules/common/references/getRecordReferenceFields.ts +243 -0
- package/src/core-modules/common/references/index.ts +9 -0
- package/src/core-modules/common/references/initRecordReferences.ts +84 -0
- package/src/core-modules/common/references/normalizeRecordReferenceConfig.ts +59 -0
- package/src/core-modules/common/references/resolveRecordReferencePath.ts +473 -0
- package/src/core-modules/common/references/resolveRecordReferencePlaceholders.ts +173 -0
- package/src/core-modules/common/references/resolveRecordReferenceValue.ts +41 -0
- package/src/core-modules/common/references/resolveRecordRelationIds.ts +57 -0
- package/src/core-modules/common/references/types.ts +78 -0
- package/src/core-modules/common/references/utils.ts +60 -0
- package/src/core-modules/common/references/zodInputs.ts +13 -0
- package/src/core-modules/common/routeToModuleProducer.ts +118 -0
- package/src/core-modules/email-content/blocksToHtml.ts +551 -0
- package/src/core-modules/email-content/constants.ts +4 -0
- package/src/core-modules/email-content/emailFooter.ts +17 -0
- package/src/core-modules/email-content/expandRepeatRows.test.ts +36 -0
- package/src/core-modules/email-content/expandRepeatRows.ts +59 -0
- package/src/core-modules/email-content/index.ts +8 -0
- package/src/core-modules/email-content/renderEmailContent.ts +88 -0
- package/src/core-modules/email-content/replacePlaceholders.ts +143 -0
- package/src/core-modules/email-content/types.ts +49 -0
- package/src/core-modules/email-content/unresolvedPlaceholders.ts +27 -0
- package/src/core-modules/forms/index.ts +2 -0
- package/src/core-modules/forms/types.ts +86 -0
- package/src/core-modules/forms/utils.ts +34 -0
- package/src/core-modules/import-export/index.ts +7 -0
- package/src/core-modules/import-export/types.ts +204 -0
- package/src/core-modules/import-export/utils/createCoreImportClient.ts +131 -0
- package/src/core-modules/import-export/utils/exportBatchProcess.ts +560 -0
- package/src/core-modules/import-export/utils/exportCursor.ts +47 -0
- package/src/core-modules/import-export/utils/headerMatcher.test.ts +90 -0
- package/src/core-modules/import-export/utils/headerMatcher.ts +229 -0
- package/src/core-modules/import-export/utils/importBatchProcess.ts +780 -0
- package/src/core-modules/import-export/utils/importExportError.ts +71 -0
- package/src/core-modules/import-export/utils/importExportRuntime.ts +96 -0
- package/src/core-modules/import-export/utils/importUtils.ts +59 -0
- package/src/core-modules/import-export/utils/progressUpdate.ts +25 -0
- package/src/core-modules/import-export/utils/tempWorkspace.ts +34 -0
- package/src/core-modules/import-export/worker.ts +215 -0
- package/src/core-modules/import-export/zodSchemas.ts +63 -0
- package/src/core-modules/index.ts +15 -0
- package/src/core-modules/logs/activityLog/builder.ts +232 -0
- package/src/core-modules/logs/activityLog/index.ts +4 -0
- package/src/core-modules/logs/activityLog/sharedBuilders.ts +95 -0
- package/src/core-modules/logs/activityLog/types.ts +26 -0
- package/src/core-modules/logs/activityLog/utils.ts +61 -0
- package/src/core-modules/logs/activityLogUtils.ts +677 -0
- package/src/core-modules/logs/definitions/activityLog.ts +71 -0
- package/src/core-modules/logs/definitions/logs.ts +49 -0
- package/src/core-modules/logs/index.ts +5 -0
- package/src/core-modules/logs/types.ts +16 -0
- package/src/core-modules/notifications/definitions/emailAddresses.ts +105 -0
- package/src/core-modules/notifications/definitions/emailDeliveries.ts +188 -0
- package/src/core-modules/notifications/definitions/emailRamp.ts +83 -0
- package/src/core-modules/notifications/definitions/emailSenders.ts +84 -0
- package/src/core-modules/notifications/definitions/notificationConfigs.ts +110 -0
- package/src/core-modules/notifications/definitions/notificationSettings.ts +67 -0
- package/src/core-modules/notifications/definitions/notifications.ts +130 -0
- package/src/core-modules/notifications/emailUtils.ts +88 -0
- package/src/core-modules/notifications/index.ts +7 -0
- package/src/core-modules/notifications/utils.ts +143 -0
- package/src/core-modules/permissions/db/definitions/permissions.ts +82 -0
- package/src/core-modules/permissions/index.ts +3 -0
- package/src/core-modules/permissions/oauth-scopes.test.ts +102 -0
- package/src/core-modules/permissions/user-actions-map.ts +170 -0
- package/src/core-modules/permissions/utils.ts +317 -0
- package/src/core-modules/properties/README.md +161 -0
- package/src/core-modules/properties/filter.test.ts +74 -0
- package/src/core-modules/properties/filter.ts +156 -0
- package/src/core-modules/properties/importExport.ts +159 -0
- package/src/core-modules/properties/index.ts +9 -0
- package/src/core-modules/properties/keys.test.ts +71 -0
- package/src/core-modules/properties/keys.ts +128 -0
- package/src/core-modules/properties/mergePropertyData.test.ts +65 -0
- package/src/core-modules/properties/mergeRows.ts +93 -0
- package/src/core-modules/properties/operators.ts +91 -0
- package/src/core-modules/properties/options.test.ts +119 -0
- package/src/core-modules/properties/options.ts +55 -0
- package/src/core-modules/properties/setupPropertyProducers.ts +32 -0
- package/src/core-modules/properties/types.ts +31 -0
- package/src/core-modules/properties/valueUsage.test.ts +158 -0
- package/src/core-modules/properties/valueUsage.ts +153 -0
- package/src/core-modules/segments/anniversary.test.ts +122 -0
- package/src/core-modules/segments/dependencies.test.ts +173 -0
- package/src/core-modules/segments/dependencies.ts +70 -0
- package/src/core-modules/segments/evaluate.test.ts +339 -0
- package/src/core-modules/segments/evaluate.ts +388 -0
- package/src/core-modules/segments/evaluateBatch.test.ts +233 -0
- package/src/core-modules/segments/evaluateBatch.ts +263 -0
- package/src/core-modules/segments/evaluateFieldsRouter.test.ts +148 -0
- package/src/core-modules/segments/evaluateFieldsRouter.ts +94 -0
- package/src/core-modules/segments/evaluateOwned.ts +162 -0
- package/src/core-modules/segments/events.ts +142 -0
- package/src/core-modules/segments/fieldBuilders.ts +152 -0
- package/src/core-modules/segments/fieldMeta.ts +96 -0
- package/src/core-modules/segments/fieldRequests.test.ts +302 -0
- package/src/core-modules/segments/fieldRequests.ts +172 -0
- package/src/core-modules/segments/fieldSources.test.ts +99 -0
- package/src/core-modules/segments/fingerprint.test.ts +111 -0
- package/src/core-modules/segments/fingerprint.ts +70 -0
- package/src/core-modules/segments/index.ts +30 -0
- package/src/core-modules/segments/joinChanges.test.ts +96 -0
- package/src/core-modules/segments/joinChanges.ts +67 -0
- package/src/core-modules/segments/materialized.ts +23 -0
- package/src/core-modules/segments/measureRelations.test.ts +222 -0
- package/src/core-modules/segments/measureRelations.ts +322 -0
- package/src/core-modules/segments/memberQuery.test.ts +60 -0
- package/src/core-modules/segments/memberQuery.ts +45 -0
- package/src/core-modules/segments/membership.ts +170 -0
- package/src/core-modules/segments/mongoFilter.test.ts +326 -0
- package/src/core-modules/segments/mongoFilter.ts +355 -0
- package/src/core-modules/segments/nodeRefs.ts +29 -0
- package/src/core-modules/segments/nodes.ts +48 -0
- package/src/core-modules/segments/operators.ts +243 -0
- package/src/core-modules/segments/ownedSource.ts +16 -0
- package/src/core-modules/segments/plan.test.ts +172 -0
- package/src/core-modules/segments/plan.ts +155 -0
- package/src/core-modules/segments/relationRegistry.test.ts +64 -0
- package/src/core-modules/segments/relationRegistry.ts +198 -0
- package/src/core-modules/segments/segmentReference.test.ts +142 -0
- package/src/core-modules/segments/setupSegmentProducers.ts +77 -0
- package/src/core-modules/segments/subjectsReachedBy.ts +70 -0
- package/src/core-modules/segments/timeZone.ts +56 -0
- package/src/core-modules/segments/types.ts +97 -0
- package/src/core-modules/segments/utils.ts +122 -0
- package/src/core-modules/segments/walkNodes.ts +76 -0
- package/src/core-modules/segments/zodSchemas.ts +130 -0
- package/src/core-modules/segments/zonedTime.test.ts +163 -0
- package/src/core-modules/segments/zonedTime.ts +198 -0
- package/src/core-modules/templates/index.ts +1 -0
- package/src/core-modules/templates/utils.ts +91 -0
- package/src/core-modules/users/constants.ts +318 -0
- package/src/core-modules/users/db/definitions/users.ts +226 -0
- package/src/core-modules/users/index.ts +2 -0
- package/src/core-types/common.ts +183 -0
- package/src/core-types/index.ts +19 -0
- package/src/core-types/modules/app/app.ts +13 -0
- package/src/core-types/modules/automations/automations.ts +23 -0
- package/src/core-types/modules/contacts/company.ts +70 -0
- package/src/core-types/modules/contacts/contacts-common.ts +32 -0
- package/src/core-types/modules/contacts/customer.ts +94 -0
- package/src/core-types/modules/emailTemplates/emailTemplate.ts +19 -0
- package/src/core-types/modules/emailTemplates/index.ts +1 -0
- package/src/core-types/modules/logs/logs.ts +30 -0
- package/src/core-types/modules/permissions/permission.ts +63 -0
- package/src/core-types/modules/permissions/role.ts +24 -0
- package/src/core-types/modules/products/product.ts +100 -0
- package/src/core-types/modules/products/productCategory.ts +27 -0
- package/src/core-types/modules/products/productConfig.ts +10 -0
- package/src/core-types/modules/products/uom.ts +12 -0
- package/src/core-types/modules/relations/relations.ts +14 -0
- package/src/core-types/modules/saas/organization.ts +7 -0
- package/src/core-types/modules/structure/structure.ts +29 -0
- package/src/core-types/modules/tags/tag.ts +17 -0
- package/src/core-types/modules/team-member/structure.ts +23 -0
- package/src/core-types/modules/team-member/user.ts +93 -0
- package/src/index.ts +1 -0
- package/src/utils/agent-tools/auth.ts +129 -0
- package/src/utils/agent-tools/endpoints.ts +274 -0
- package/src/utils/agent-tools/index.ts +5 -0
- package/src/utils/agent-tools/manifest.ts +152 -0
- package/src/utils/agent-tools/responseLimit.test.ts +99 -0
- package/src/utils/agent-tools/responseLimit.ts +66 -0
- package/src/utils/agent-tools/types.ts +52 -0
- package/src/utils/apollo/beforeResolvers.ts +117 -0
- package/src/utils/apollo/commonTypeDefs.ts +78 -0
- package/src/utils/apollo/constants.ts +16 -0
- package/src/utils/apollo/customScalars.ts +69 -0
- package/src/utils/apollo/expectedErrorPlugin.ts +83 -0
- package/src/utils/apollo/index.ts +10 -0
- package/src/utils/apollo/runBeforeResolvers.ts +214 -0
- package/src/utils/apollo/utils.ts +80 -0
- package/src/utils/apollo/wrapperMutations.ts +75 -0
- package/src/utils/apollo/wrapperResolvers.ts +182 -0
- package/src/utils/bulkUtils.ts +62 -0
- package/src/utils/constants.ts +99 -0
- package/src/utils/editor.ts +412 -0
- package/src/utils/email/address.ts +42 -0
- package/src/utils/email/attachments.ts +74 -0
- package/src/utils/email/config.ts +46 -0
- package/src/utils/email/constants.ts +25 -0
- package/src/utils/email/index.ts +11 -0
- package/src/utils/email/providers/sendgrid.ts +280 -0
- package/src/utils/email/providers/sendgridEvents.ts +48 -0
- package/src/utils/email/providers/ses.ts +250 -0
- package/src/utils/email/providers/smtp.ts +99 -0
- package/src/utils/email/resolveProvider.ts +75 -0
- package/src/utils/email/service.ts +192 -0
- package/src/utils/email/types.ts +127 -0
- package/src/utils/errorClassifier.test.ts +231 -0
- package/src/utils/errorClassifier.ts +458 -0
- package/src/utils/file/read.ts +464 -0
- package/src/utils/file/upload.ts +531 -0
- package/src/utils/graphqlPubSub.ts +28 -0
- package/src/utils/headers/get-hostname.ts +18 -0
- package/src/utils/headers/index.ts +4 -0
- package/src/utils/headers/sanitize.ts +9 -0
- package/src/utils/headers/subdomain.ts +13 -0
- package/src/utils/headers/user.test.ts +76 -0
- package/src/utils/headers/user.ts +113 -0
- package/src/utils/index.ts +27 -0
- package/src/utils/knowledge.ts +107 -0
- package/src/utils/logs/index.ts +247 -0
- package/src/utils/mongo/cursor-util.ts +153 -0
- package/src/utils/mongo/generate-models.ts +97 -0
- package/src/utils/mongo/index.ts +5 -0
- package/src/utils/mongo/mongo-connection.ts +42 -0
- package/src/utils/mongo/mongoose-types.ts +26 -0
- package/src/utils/mongo/mongoose-utils.ts +329 -0
- package/src/utils/mongo/search-tokens.ts +193 -0
- package/src/utils/mq-worker.ts +150 -0
- package/src/utils/random.ts +6 -0
- package/src/utils/redis.ts +23 -0
- package/src/utils/saas/constants.ts +32 -0
- package/src/utils/saas/definition.ts +318 -0
- package/src/utils/saas/index.ts +2 -0
- package/src/utils/saas/saas-mongo-connection.ts +595 -0
- package/src/utils/saas/types.ts +107 -0
- package/src/utils/sanitize.ts +73 -0
- package/src/utils/sentry-init.ts +128 -0
- package/src/utils/sentry-instrument.ts +5 -0
- package/src/utils/serializablePayload.test.ts +65 -0
- package/src/utils/serializablePayload.ts +44 -0
- package/src/utils/service-discovery.ts +256 -0
- package/src/utils/start-plugin.ts +482 -0
- package/src/utils/string.ts +159 -0
- package/src/utils/trpc/index.ts +278 -0
- package/src/utils/trpc/sendCoreModuleProducer.ts +146 -0
- package/src/utils/trpc/trpc-setup.ts +91 -0
- package/src/utils/utils.ts +669 -0
- package/utils/dist/erxes-api-shared-utils.cjs.d.ts +2 -0
- package/utils/dist/erxes-api-shared-utils.cjs.dev.js +3066 -0
- package/utils/dist/erxes-api-shared-utils.cjs.js +7 -0
- package/utils/dist/erxes-api-shared-utils.cjs.prod.js +3066 -0
- package/utils/dist/erxes-api-shared-utils.esm.js +2776 -0
- package/utils/package.json +5 -0
- package/README.md +0 -3
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { Document, Schema } from 'mongoose';
|
|
2
|
+
import { AUTOMATION_STATUSES } from '../constants';
|
|
3
|
+
|
|
4
|
+
export type IAutomationActionsMap = { [key: string]: IAutomationAction };
|
|
5
|
+
|
|
6
|
+
// type for values
|
|
7
|
+
type TAutomationStatus =
|
|
8
|
+
(typeof AUTOMATION_STATUSES)[keyof typeof AUTOMATION_STATUSES];
|
|
9
|
+
|
|
10
|
+
export interface IAutomationAction<TConfig = any> {
|
|
11
|
+
id: string;
|
|
12
|
+
type: string;
|
|
13
|
+
nextActionId?: string;
|
|
14
|
+
config?: TConfig;
|
|
15
|
+
style?: any;
|
|
16
|
+
icon?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
workflowId?: string;
|
|
20
|
+
targetActionId?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface IAutomationTrigger<TConfig = any> {
|
|
24
|
+
id: string;
|
|
25
|
+
type: string;
|
|
26
|
+
actionId?: string;
|
|
27
|
+
config: {
|
|
28
|
+
contentId: string;
|
|
29
|
+
reEnrollment: boolean;
|
|
30
|
+
reEnrollmentRules: string[];
|
|
31
|
+
dateConfig: any;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
} & TConfig;
|
|
34
|
+
style?: any;
|
|
35
|
+
icon?: string;
|
|
36
|
+
label?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
isCustom?: boolean;
|
|
39
|
+
workflowId?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IAutomationWorkflow {
|
|
43
|
+
id: string;
|
|
44
|
+
// Empty for converted (containment) workflows that own their actions;
|
|
45
|
+
// set when the node references another automation.
|
|
46
|
+
automationId?: string;
|
|
47
|
+
// Source template when inserted from one
|
|
48
|
+
templateId?: string;
|
|
49
|
+
name: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
nextActionId?: string;
|
|
52
|
+
config?: {
|
|
53
|
+
entryActionId?: string;
|
|
54
|
+
// name -> default binding expression, e.g. { customerId: "{{ trigger.customerId }}" }
|
|
55
|
+
inputs?: Record<string, string>;
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
};
|
|
58
|
+
actions?: IAutomationAction[];
|
|
59
|
+
icon?: string;
|
|
60
|
+
position?: any;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IAutomationNote {
|
|
64
|
+
id: string;
|
|
65
|
+
content: string;
|
|
66
|
+
position?: any;
|
|
67
|
+
width?: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
color?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface IAutomation {
|
|
73
|
+
name: string;
|
|
74
|
+
status: TAutomationStatus;
|
|
75
|
+
edgeType?: string;
|
|
76
|
+
flowDirection?: string;
|
|
77
|
+
triggers: IAutomationTrigger[];
|
|
78
|
+
actions: IAutomationAction[];
|
|
79
|
+
workflows?: IAutomationWorkflow[];
|
|
80
|
+
// Canvas annotations. Deliberately outside actions so the executor and the
|
|
81
|
+
// builder's flow validation never see them.
|
|
82
|
+
notes?: IAutomationNote[];
|
|
83
|
+
/**
|
|
84
|
+
* Set when another module owns this automation and drives its lifecycle, so
|
|
85
|
+
* it stays out of the automations list the way an automation-owned segment
|
|
86
|
+
* stays out of the segments list. Never set through `automationsEdit`.
|
|
87
|
+
*/
|
|
88
|
+
ownedBy?: 'broadcast';
|
|
89
|
+
ownerContentId?: string;
|
|
90
|
+
duplicatedFrom?: string;
|
|
91
|
+
createdAt: Date;
|
|
92
|
+
createdBy: string;
|
|
93
|
+
updatedAt: Date;
|
|
94
|
+
updatedBy: string;
|
|
95
|
+
/**
|
|
96
|
+
* Whose automation this is: the records it creates are made on this
|
|
97
|
+
* person's behalf. Taken by whoever first puts it live, and moved only by
|
|
98
|
+
* consent — never derived from who edited it last, because editing a flow
|
|
99
|
+
* is not the same as answering for what it does.
|
|
100
|
+
*/
|
|
101
|
+
ownerId?: string;
|
|
102
|
+
/** Who last put it live, and when. Audit, not ownership. */
|
|
103
|
+
activatedBy?: string;
|
|
104
|
+
activatedAt?: Date;
|
|
105
|
+
tagIds: string[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface IAutomationDoc extends IAutomation {
|
|
109
|
+
_id?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface IAutomationDocument extends IAutomation, Document {
|
|
113
|
+
_id: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const triggerSchema = new Schema(
|
|
117
|
+
{
|
|
118
|
+
id: { type: String, required: true },
|
|
119
|
+
type: { type: String, required: true },
|
|
120
|
+
actionId: { type: String },
|
|
121
|
+
config: { type: Object },
|
|
122
|
+
style: { type: Object },
|
|
123
|
+
position: { type: Object },
|
|
124
|
+
icon: { type: String, optional: true },
|
|
125
|
+
label: { type: String, optional: true },
|
|
126
|
+
description: { type: String, optional: true },
|
|
127
|
+
isCustom: { type: Boolean, optional: true },
|
|
128
|
+
workflowId: { type: String, optional: true },
|
|
129
|
+
},
|
|
130
|
+
{ _id: false },
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const actionSchema = new Schema(
|
|
134
|
+
{
|
|
135
|
+
id: { type: String, required: true },
|
|
136
|
+
type: { type: String, required: true },
|
|
137
|
+
nextActionId: { type: String },
|
|
138
|
+
config: { type: Object },
|
|
139
|
+
style: { type: Object },
|
|
140
|
+
position: { type: Object },
|
|
141
|
+
icon: { type: String, optional: true },
|
|
142
|
+
label: { type: String, optional: true },
|
|
143
|
+
description: { type: String, optional: true },
|
|
144
|
+
workflowId: { type: String, optional: true },
|
|
145
|
+
targetActionId: { type: String, optional: true },
|
|
146
|
+
},
|
|
147
|
+
{ _id: false },
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
const workflowSchema = new Schema(
|
|
151
|
+
{
|
|
152
|
+
id: { type: String, required: true },
|
|
153
|
+
// Empty for converted (containment) workflows that own their actions;
|
|
154
|
+
// set when the node references another automation.
|
|
155
|
+
automationId: { type: String },
|
|
156
|
+
// Source template when inserted from one; lets edits offer to update it
|
|
157
|
+
templateId: { type: String },
|
|
158
|
+
name: { type: String, required: true },
|
|
159
|
+
description: { type: String },
|
|
160
|
+
nextActionId: { type: String },
|
|
161
|
+
config: { type: Object },
|
|
162
|
+
actions: { type: [actionSchema], optional: true },
|
|
163
|
+
icon: { type: String, optional: true },
|
|
164
|
+
position: { type: Object },
|
|
165
|
+
},
|
|
166
|
+
{ _id: false },
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const noteSchema = new Schema(
|
|
170
|
+
{
|
|
171
|
+
id: { type: String, required: true },
|
|
172
|
+
content: { type: String, default: '' },
|
|
173
|
+
position: { type: Object },
|
|
174
|
+
width: { type: Number, optional: true },
|
|
175
|
+
height: { type: Number, optional: true },
|
|
176
|
+
color: { type: String, optional: true },
|
|
177
|
+
},
|
|
178
|
+
{ _id: false },
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
export const automationSchema = new Schema({
|
|
182
|
+
name: { type: String, required: true },
|
|
183
|
+
status: { type: String, default: AUTOMATION_STATUSES.DRAFT },
|
|
184
|
+
edgeType: { type: String, optional: true },
|
|
185
|
+
flowDirection: { type: String, optional: true },
|
|
186
|
+
triggers: { type: [triggerSchema] },
|
|
187
|
+
actions: { type: [actionSchema] },
|
|
188
|
+
workflows: { type: [workflowSchema] },
|
|
189
|
+
notes: { type: [noteSchema], optional: true },
|
|
190
|
+
ownedBy: { type: String, optional: true, label: 'Owned by' },
|
|
191
|
+
ownerContentId: { type: String, optional: true, label: 'Owner content id' },
|
|
192
|
+
duplicatedFrom: { type: String, optional: true },
|
|
193
|
+
createdAt: {
|
|
194
|
+
type: Date,
|
|
195
|
+
default: new Date(),
|
|
196
|
+
label: 'Created date',
|
|
197
|
+
},
|
|
198
|
+
createdBy: { type: String },
|
|
199
|
+
updatedAt: { type: Date, default: new Date(), label: 'Updated date' },
|
|
200
|
+
updatedBy: { type: String },
|
|
201
|
+
ownerId: { type: String, label: 'Owner', optional: true },
|
|
202
|
+
activatedBy: { type: String, optional: true },
|
|
203
|
+
activatedAt: { type: Date, optional: true },
|
|
204
|
+
tagIds: { type: [String], label: 'Tag Ids', optional: true },
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
automationSchema.index({ ownedBy: 1, ownerContentId: 1 });
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { TCreatedVia } from '../../../core-types/common';
|
|
2
|
+
import { Document, Schema } from 'mongoose';
|
|
3
|
+
|
|
4
|
+
export interface IAutomationExecAction {
|
|
5
|
+
createdAt?: string;
|
|
6
|
+
startedAt?: string;
|
|
7
|
+
finishedAt?: string;
|
|
8
|
+
durationMs?: number;
|
|
9
|
+
status?:
|
|
10
|
+
| 'success'
|
|
11
|
+
| 'skipped'
|
|
12
|
+
| 'error'
|
|
13
|
+
| 'waiting'
|
|
14
|
+
| 'queued'
|
|
15
|
+
| 'standby'
|
|
16
|
+
| 'dropped';
|
|
17
|
+
actionId: string;
|
|
18
|
+
actionType: string;
|
|
19
|
+
actionConfig?: any;
|
|
20
|
+
nextActionId?: string;
|
|
21
|
+
result?: any;
|
|
22
|
+
// Why the action failed, from AUTOMATION_ERROR_CODES. Only set on errors.
|
|
23
|
+
errorCode?: string;
|
|
24
|
+
// Why the action deliberately did nothing. Only set on skipped actions.
|
|
25
|
+
skipReason?: string;
|
|
26
|
+
// Which try this row is. 1 unless an error policy asked for another one.
|
|
27
|
+
attempt?: number;
|
|
28
|
+
// Set on workflow node actions: links to the child execution for drill-in
|
|
29
|
+
childExecutionId?: string;
|
|
30
|
+
// Deferred actions only: matches the completion callback to this attempt so
|
|
31
|
+
// a stale or retried job can never overwrite a newer one.
|
|
32
|
+
jobId?: string;
|
|
33
|
+
// Date in-process, an ISO string once the execution crosses a producer
|
|
34
|
+
// boundary — both shapes reach this type.
|
|
35
|
+
queuedAt?: Date | string;
|
|
36
|
+
// When the sweep gives up on a deferred action that never reported back.
|
|
37
|
+
expiresAt?: Date | string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface IAutomationExecution {
|
|
41
|
+
createdAt?: string;
|
|
42
|
+
modifiedAt?: string;
|
|
43
|
+
automationId: string;
|
|
44
|
+
triggerId: string;
|
|
45
|
+
triggerType: string;
|
|
46
|
+
triggerConfig: any;
|
|
47
|
+
/**
|
|
48
|
+
* What set this run going. A caller that addressed the automation on
|
|
49
|
+
* someone's behalf declares its own — a campaign names itself and whoever
|
|
50
|
+
* put it live — and the runner stamps the run's own id onto it. Records the
|
|
51
|
+
* run creates carry it onward.
|
|
52
|
+
*/
|
|
53
|
+
createdVia?: TCreatedVia;
|
|
54
|
+
nextActionId?: string;
|
|
55
|
+
targetId: string;
|
|
56
|
+
target: any;
|
|
57
|
+
// Relation measures the trigger's re-enrollment watches, by rule.
|
|
58
|
+
watched?: Record<string, unknown>;
|
|
59
|
+
status: string;
|
|
60
|
+
description: string;
|
|
61
|
+
actions?: IAutomationExecAction[];
|
|
62
|
+
failedActionId?: string;
|
|
63
|
+
failedActionType?: string;
|
|
64
|
+
errorCode?: string;
|
|
65
|
+
// Actions that failed while the run itself carried on: a deferred 'ignore'
|
|
66
|
+
// action reporting late, or a failure taken by an error branch. The run is
|
|
67
|
+
// complete, so without this the failure would vanish with it.
|
|
68
|
+
handledFailureActionIds?: string[];
|
|
69
|
+
startWaitingDate?: Date;
|
|
70
|
+
waitingActionId?: string;
|
|
71
|
+
objToCheck?: any;
|
|
72
|
+
responseActionId?: string;
|
|
73
|
+
// Workflow child executions: run a workflow's member actions on behalf of
|
|
74
|
+
// a parent execution that waits on the workflow node.
|
|
75
|
+
parentExecutionId?: string;
|
|
76
|
+
workflowId?: string;
|
|
77
|
+
// Input values frozen when the workflow was entered; members resolve
|
|
78
|
+
// {{ input.* }} from here.
|
|
79
|
+
inputs?: Record<string, any>;
|
|
80
|
+
depth?: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface IAutomationExecutionDocument
|
|
84
|
+
extends IAutomationExecution,
|
|
85
|
+
Document {
|
|
86
|
+
_id: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const AUTOMATION_EXECUTION_STATUS = {
|
|
90
|
+
ACTIVE: 'active',
|
|
91
|
+
WAITING: 'waiting',
|
|
92
|
+
// Paused on a deferred action the flow still needs the result of.
|
|
93
|
+
STANDBY: 'standby',
|
|
94
|
+
ERROR: 'error',
|
|
95
|
+
MISSID: 'missed',
|
|
96
|
+
COMPLETE: 'complete',
|
|
97
|
+
ALL: ['active', 'waiting', 'standby', 'error', 'missed', 'complete'],
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const execActionSchema = new Schema({
|
|
101
|
+
createdAt: { type: Date, default: Date.now, required: true },
|
|
102
|
+
startedAt: { type: Date },
|
|
103
|
+
finishedAt: { type: Date },
|
|
104
|
+
durationMs: { type: Number },
|
|
105
|
+
status: {
|
|
106
|
+
type: String,
|
|
107
|
+
enum: [
|
|
108
|
+
'success',
|
|
109
|
+
'skipped',
|
|
110
|
+
'error',
|
|
111
|
+
'waiting',
|
|
112
|
+
'queued',
|
|
113
|
+
'standby',
|
|
114
|
+
'dropped',
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
actionId: { type: String },
|
|
118
|
+
actionType: { type: String },
|
|
119
|
+
actionConfig: { type: Object },
|
|
120
|
+
nextActionId: { type: String },
|
|
121
|
+
result: { type: Object },
|
|
122
|
+
childExecutionId: { type: String },
|
|
123
|
+
errorCode: { type: String },
|
|
124
|
+
skipReason: { type: String },
|
|
125
|
+
attempt: { type: Number },
|
|
126
|
+
jobId: { type: String },
|
|
127
|
+
queuedAt: { type: Date },
|
|
128
|
+
expiresAt: { type: Date },
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const automationExecutionSchema = new Schema({
|
|
132
|
+
createdAt: { type: Date, default: Date.now, required: true },
|
|
133
|
+
modifiedAt: { type: Date, default: Date.now, required: true },
|
|
134
|
+
automationId: { type: String, required: true },
|
|
135
|
+
triggerId: { type: String, required: true },
|
|
136
|
+
triggerType: { type: String },
|
|
137
|
+
triggerConfig: { type: Object },
|
|
138
|
+
createdVia: { type: Object },
|
|
139
|
+
nextActionId: { type: String },
|
|
140
|
+
targetId: { type: String, required: true, index: true },
|
|
141
|
+
target: { type: Object },
|
|
142
|
+
watched: { type: Object },
|
|
143
|
+
status: {
|
|
144
|
+
type: String,
|
|
145
|
+
enum: AUTOMATION_EXECUTION_STATUS.ALL,
|
|
146
|
+
default: AUTOMATION_EXECUTION_STATUS.ACTIVE,
|
|
147
|
+
label: 'Status',
|
|
148
|
+
index: true,
|
|
149
|
+
},
|
|
150
|
+
description: { type: String, required: true },
|
|
151
|
+
actions: { type: [execActionSchema] },
|
|
152
|
+
failedActionId: { type: String },
|
|
153
|
+
failedActionType: { type: String },
|
|
154
|
+
errorCode: { type: String },
|
|
155
|
+
handledFailureActionIds: { type: [String] },
|
|
156
|
+
startWaitingDate: { type: Date },
|
|
157
|
+
waitingActionId: { type: String },
|
|
158
|
+
responseActionId: { type: String },
|
|
159
|
+
objToCheck: { type: Object, optional: true },
|
|
160
|
+
parentExecutionId: { type: String, index: true },
|
|
161
|
+
workflowId: { type: String },
|
|
162
|
+
inputs: { type: Object },
|
|
163
|
+
depth: { type: Number, default: 0 },
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Executions are write-heavy, so only the compound indexes the real queries
|
|
167
|
+
// need. The `automationId` / `triggerId` prefixes cover single-field lookups.
|
|
168
|
+
|
|
169
|
+
// History list and stats: match by automation, order/range by createdAt.
|
|
170
|
+
automationExecutionSchema.index({ automationId: 1, createdAt: -1 });
|
|
171
|
+
|
|
172
|
+
// Status-filtered list and the status breakdown.
|
|
173
|
+
automationExecutionSchema.index({ automationId: 1, status: 1, createdAt: -1 });
|
|
174
|
+
|
|
175
|
+
// Engine hot path: latest execution of a target for re-enrollment checks.
|
|
176
|
+
automationExecutionSchema.index({
|
|
177
|
+
automationId: 1,
|
|
178
|
+
triggerId: 1,
|
|
179
|
+
targetId: 1,
|
|
180
|
+
createdAt: -1,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
automationExecutionSchema.index(
|
|
184
|
+
{ automationId: 1, failedActionId: 1, createdAt: -1 },
|
|
185
|
+
{ sparse: true },
|
|
186
|
+
);
|
|
187
|
+
automationExecutionSchema.index(
|
|
188
|
+
{ automationId: 1, errorCode: 1, createdAt: -1 },
|
|
189
|
+
{ sparse: true },
|
|
190
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getValueByPath } from './outputResolvers';
|
|
2
|
+
|
|
3
|
+
describe('getValueByPath', () => {
|
|
4
|
+
it('walks a plain path', () => {
|
|
5
|
+
expect(
|
|
6
|
+
getValueByPath(
|
|
7
|
+
{ propertiesData: { plan: 'pro' } },
|
|
8
|
+
'propertiesData.plan',
|
|
9
|
+
),
|
|
10
|
+
).toEqual({
|
|
11
|
+
found: true,
|
|
12
|
+
value: 'pro',
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('collects the leaf value of every row in a repeating group', () => {
|
|
17
|
+
const source = {
|
|
18
|
+
propertiesData: {
|
|
19
|
+
'g:edu': [
|
|
20
|
+
{ _id: 'r1', school: 'MUIS', year: 2018 },
|
|
21
|
+
{ _id: 'r2', school: 'SUIS' },
|
|
22
|
+
{ _id: 'r3', year: 2022 },
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
expect(getValueByPath(source, 'propertiesData.g:edu/school')).toEqual({
|
|
28
|
+
found: true,
|
|
29
|
+
value: ['MUIS', 'SUIS'],
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('finds nothing when no row holds the field', () => {
|
|
34
|
+
const source = { propertiesData: { 'g:edu': [{ _id: 'r1', year: 2018 }] } };
|
|
35
|
+
|
|
36
|
+
expect(getValueByPath(source, 'propertiesData.g:edu/school')).toEqual({
|
|
37
|
+
found: false,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('finds nothing when the group holds no rows', () => {
|
|
42
|
+
expect(
|
|
43
|
+
getValueByPath(
|
|
44
|
+
{ propertiesData: { plan: 'pro' } },
|
|
45
|
+
'propertiesData.g:edu/school',
|
|
46
|
+
),
|
|
47
|
+
).toEqual({ found: false });
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './utils';
|
|
2
|
+
export * from './setupAutomationProducers';
|
|
3
|
+
export * from './actionErrorPolicy';
|
|
4
|
+
export * from './actionOutcome';
|
|
5
|
+
export * from './constants';
|
|
6
|
+
export * from './types';
|
|
7
|
+
export * from './definitions';
|
|
8
|
+
export * from './outputResolvers';
|
|
9
|
+
export * from './workflowValidation';
|
|
10
|
+
export * from './zodTypes';
|
|
11
|
+
export * from './sendAutomationMessage';
|
|
12
|
+
export * from './segmentMembership';
|
|
13
|
+
export * from './reEnrollment';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { resolveRecordReferenceValue } from '../common/references';
|
|
2
|
+
import { resolveOutputPathsByNodeType } from './outputResolvers';
|
|
3
|
+
|
|
4
|
+
jest.mock('../common/references', () => ({
|
|
5
|
+
resolveRecordReferenceValue: jest.fn(),
|
|
6
|
+
}));
|
|
7
|
+
|
|
8
|
+
const mockedResolveRecordReferenceValue = jest.mocked(
|
|
9
|
+
resolveRecordReferenceValue,
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
describe('resolveOutputPathsByNodeType', () => {
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
mockedResolveRecordReferenceValue.mockReset();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('resolves action-created targets from their current entity state', async () => {
|
|
18
|
+
mockedResolveRecordReferenceValue.mockImplementation(async (input) => {
|
|
19
|
+
if (input.type === 'frontline:ticket' && input.path === 'description') {
|
|
20
|
+
return 'Resolved complaint';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (input.type === 'frontline:ticket' && input.path === 'assigneeId') {
|
|
24
|
+
return 'user-1';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (input.type === 'core:user' && input.path === 'displayName') {
|
|
28
|
+
return 'Support Agent';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return input.defaultValue;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const result = await resolveOutputPathsByNodeType({
|
|
35
|
+
subdomain: 'test',
|
|
36
|
+
nodeType: 'frontline:tickets.tickets.create',
|
|
37
|
+
source: {
|
|
38
|
+
targetId: 'ticket-1',
|
|
39
|
+
description: 'Original complaint',
|
|
40
|
+
assigneeId: 'user-old',
|
|
41
|
+
},
|
|
42
|
+
paths: ['description', 'assigneeId.displayName'],
|
|
43
|
+
runtimeOutputs: {
|
|
44
|
+
'frontline:tickets.tickets.create': {
|
|
45
|
+
variables: [
|
|
46
|
+
{ key: 'description', label: 'Description' },
|
|
47
|
+
{
|
|
48
|
+
key: 'assigneeId',
|
|
49
|
+
label: 'Assignee',
|
|
50
|
+
exposure: 'reference',
|
|
51
|
+
referenceType: 'core:user',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
propertySource: {
|
|
55
|
+
key: 'properties',
|
|
56
|
+
label: 'Ticket properties',
|
|
57
|
+
propertyType: 'frontline:ticket',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
expect(result).toEqual({
|
|
64
|
+
description: 'Resolved complaint',
|
|
65
|
+
'assigneeId.displayName': 'Support Agent',
|
|
66
|
+
});
|
|
67
|
+
expect(mockedResolveRecordReferenceValue).toHaveBeenCalledWith(
|
|
68
|
+
expect.objectContaining({
|
|
69
|
+
type: 'frontline:ticket',
|
|
70
|
+
targetId: 'ticket-1',
|
|
71
|
+
path: 'description',
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('keeps resolving root execution sources directly', async () => {
|
|
77
|
+
const result = await resolveOutputPathsByNodeType({
|
|
78
|
+
subdomain: 'test',
|
|
79
|
+
nodeType: 'frontline:tickets.tickets',
|
|
80
|
+
source: { description: 'Trigger description' },
|
|
81
|
+
paths: ['description'],
|
|
82
|
+
runtimeOutputs: {
|
|
83
|
+
'frontline:tickets.tickets': {
|
|
84
|
+
variables: [{ key: 'description', label: 'Description' }],
|
|
85
|
+
propertySource: {
|
|
86
|
+
key: 'properties',
|
|
87
|
+
label: 'Ticket properties',
|
|
88
|
+
propertyType: 'frontline:ticket',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
expect(result).toEqual({ description: 'Trigger description' });
|
|
95
|
+
expect(mockedResolveRecordReferenceValue).not.toHaveBeenCalled();
|
|
96
|
+
});
|
|
97
|
+
});
|