@erxes/api-shared 3.3.2-next.1 → 3.3.3-next.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.
Files changed (25) hide show
  1. package/core-modules/dist/erxes-api-shared-core-modules.cjs.dev.js +5 -1
  2. package/core-modules/dist/erxes-api-shared-core-modules.cjs.prod.js +5 -1
  3. package/core-modules/dist/erxes-api-shared-core-modules.esm.js +2 -2
  4. package/dist/declarations/src/core-modules/automations/constants.d.ts +6 -0
  5. package/dist/declarations/src/core-modules/automations/constants.d.ts.map +1 -1
  6. package/dist/declarations/src/core-modules/automations/outputResolvers.d.ts +29 -0
  7. package/dist/declarations/src/core-modules/automations/outputResolvers.d.ts.map +1 -1
  8. package/dist/declarations/src/core-modules/automations/types.d.ts +40 -1
  9. package/dist/declarations/src/core-modules/automations/types.d.ts.map +1 -1
  10. package/dist/declarations/src/core-modules/automations/utils.d.ts +2 -1
  11. package/dist/declarations/src/core-modules/automations/utils.d.ts.map +1 -1
  12. package/dist/declarations/src/core-modules/notifications/definitions/emailAddresses.d.ts +6 -0
  13. package/dist/declarations/src/core-modules/notifications/definitions/emailAddresses.d.ts.map +1 -1
  14. package/dist/{start-plugin-6687b329.cjs.dev.js → start-plugin-2944ceaa.cjs.dev.js} +287 -222
  15. package/dist/{start-plugin-46baacee.cjs.prod.js → start-plugin-7ebe8e9b.cjs.prod.js} +287 -222
  16. package/dist/{start-plugin-2b3e89f5.esm.js → start-plugin-b4d9fece.esm.js} +284 -223
  17. package/package.json +1 -1
  18. package/src/core-modules/automations/constants.ts +26 -0
  19. package/src/core-modules/automations/outputResolvers.ts +8 -0
  20. package/src/core-modules/automations/types.ts +54 -1
  21. package/src/core-modules/automations/utils.ts +31 -2
  22. package/src/core-modules/notifications/definitions/emailAddresses.ts +15 -0
  23. package/utils/dist/erxes-api-shared-utils.cjs.dev.js +1 -1
  24. package/utils/dist/erxes-api-shared-utils.cjs.prod.js +1 -1
  25. package/utils/dist/erxes-api-shared-utils.esm.js +2 -2
@@ -5271,6 +5271,67 @@ var parsePropertyColumnKey = function parsePropertyColumnKey(columnKey) {
5271
5271
  };
5272
5272
  };
5273
5273
 
5274
+ /**
5275
+ * A value an action reads from whatever started the run. The action names
5276
+ * what it needs; it never learns which record supplied it.
5277
+ */
5278
+
5279
+ /**
5280
+ * Per action type, which of the trigger's own output keys fills each of that
5281
+ * action's inputs. Declared by the trigger's plugin, so no one maps by hand.
5282
+ */
5283
+
5284
+ // Set by the action author, not the end user: 'ignore' lets the flow continue
5285
+ // while the work is queued, 'standby' pauses until the result is back.
5286
+
5287
+ // Returned by the owning plugin instead of a result: it queued the work and
5288
+ // tells the engine whether the flow may carry on without it.
5289
+
5290
+ var AUTOMATION_ACTION_CONTRIBUTIONS = {
5291
+ // Acts on a record a sibling branch remembered: the agent picks which one.
5292
+ REMEMBERED_RECORD_CHOICE: 'rememberedRecordChoice'
5293
+ };
5294
+
5295
+ /**
5296
+ * A step of a built-in template.
5297
+ *
5298
+ * Addressed by `order` rather than by id: ids are generated per automation, so
5299
+ * a template that hardcoded them could never be installed twice. Installing
5300
+ * maps every order to a fresh id and rewrites the connections with it.
5301
+ */
5302
+
5303
+ /**
5304
+ * Something the tenant must already have before a template can work — a bot, a
5305
+ * pipeline stage, an integration. The value is chosen once, while installing,
5306
+ * by a component the owning plugin provides: only that plugin knows what
5307
+ * counts as a valid candidate and how to list them.
5308
+ */
5309
+
5310
+ var EXECUTE_WAIT_TYPES = /*#__PURE__*/function (EXECUTE_WAIT_TYPES) {
5311
+ EXECUTE_WAIT_TYPES["DELAY"] = "delay";
5312
+ EXECUTE_WAIT_TYPES["IS_IN_SEGMENT"] = "isInSegment";
5313
+ EXECUTE_WAIT_TYPES["CHECK_OBJECT"] = "checkObject";
5314
+ EXECUTE_WAIT_TYPES["WEBHOOK"] = "webhook";
5315
+ return EXECUTE_WAIT_TYPES;
5316
+ }({});
5317
+ var TAutomationProducers = /*#__PURE__*/function (TAutomationProducers) {
5318
+ TAutomationProducers["RECEIVE_ACTIONS"] = "receiveActions";
5319
+ TAutomationProducers["RESOLVE_OUTPUT_PATHS"] = "resolveOutputPaths";
5320
+ TAutomationProducers["CHECK_CUSTOM_TRIGGER"] = "checkCustomTrigger";
5321
+ TAutomationProducers["FIND_OBJECT"] = "findObject";
5322
+ TAutomationProducers["SET_PROPERTIES"] = "setProperties";
5323
+ TAutomationProducers["GENERATE_AI_CONTEXT"] = "generateAiContext";
5324
+ TAutomationProducers["LOAD_AI_KNOWLEDGE_DOCUMENT_BATCH"] = "loadAiKnowledgeDocumentBatch";
5325
+ TAutomationProducers["LOOKUP_AI_TOOL"] = "lookupAiTool";
5326
+ return TAutomationProducers;
5327
+ }({});
5328
+ var TAutomationActionFolks = /*#__PURE__*/function (TAutomationActionFolks) {
5329
+ TAutomationActionFolks["DEFAULT"] = "default";
5330
+ TAutomationActionFolks["SUCCESS"] = "success";
5331
+ TAutomationActionFolks["ERROR"] = "error";
5332
+ return TAutomationActionFolks;
5333
+ }({});
5334
+
5274
5335
  var AUTOMATION_PROPERTY_OPERATORS = {
5275
5336
  SET: 'set',
5276
5337
  CLEAR: 'clear',
@@ -5375,6 +5436,19 @@ var AUTOMATION_CORE_ACTION_DEFERRED = _defineProperty({}, AUTOMATION_CORE_ACTION
5375
5436
  mode: 'standby',
5376
5437
  timeoutMinutes: 3
5377
5438
  });
5439
+
5440
+ /**
5441
+ * Core actions have no plugin constants either, so how they combine with the
5442
+ * actions around them is declared here.
5443
+ */
5444
+ var AUTOMATION_CORE_ACTION_PLACEMENTS = _defineProperty(_defineProperty({}, AUTOMATION_CORE_ACTIONS.AI_AGENT, {
5445
+ accepts: [AUTOMATION_ACTION_CONTRIBUTIONS.REMEMBERED_RECORD_CHOICE]
5446
+ }), AUTOMATION_CORE_ACTIONS.SET_PROPERTY, {
5447
+ addsToPrevious: [{
5448
+ actionType: AUTOMATION_CORE_ACTIONS.AI_AGENT,
5449
+ kind: AUTOMATION_ACTION_CONTRIBUTIONS.REMEMBERED_RECORD_CHOICE
5450
+ }]
5451
+ });
5378
5452
  var AUTOMATION_DEFERRED_TIMEOUT = {
5379
5453
  DEFAULT_MINUTES: 10,
5380
5454
  MAX_MINUTES: 60
@@ -6314,62 +6388,6 @@ var resolveRecordReferenceValue = /*#__PURE__*/function () {
6314
6388
  };
6315
6389
  }();
6316
6390
 
6317
- /**
6318
- * A value an action reads from whatever started the run. The action names
6319
- * what it needs; it never learns which record supplied it.
6320
- */
6321
-
6322
- /**
6323
- * Per action type, which of the trigger's own output keys fills each of that
6324
- * action's inputs. Declared by the trigger's plugin, so no one maps by hand.
6325
- */
6326
-
6327
- // Set by the action author, not the end user: 'ignore' lets the flow continue
6328
- // while the work is queued, 'standby' pauses until the result is back.
6329
-
6330
- // Returned by the owning plugin instead of a result: it queued the work and
6331
- // tells the engine whether the flow may carry on without it.
6332
-
6333
- /**
6334
- * A step of a built-in template.
6335
- *
6336
- * Addressed by `order` rather than by id: ids are generated per automation, so
6337
- * a template that hardcoded them could never be installed twice. Installing
6338
- * maps every order to a fresh id and rewrites the connections with it.
6339
- */
6340
-
6341
- /**
6342
- * Something the tenant must already have before a template can work — a bot, a
6343
- * pipeline stage, an integration. The value is chosen once, while installing,
6344
- * by a component the owning plugin provides: only that plugin knows what
6345
- * counts as a valid candidate and how to list them.
6346
- */
6347
-
6348
- var EXECUTE_WAIT_TYPES = /*#__PURE__*/function (EXECUTE_WAIT_TYPES) {
6349
- EXECUTE_WAIT_TYPES["DELAY"] = "delay";
6350
- EXECUTE_WAIT_TYPES["IS_IN_SEGMENT"] = "isInSegment";
6351
- EXECUTE_WAIT_TYPES["CHECK_OBJECT"] = "checkObject";
6352
- EXECUTE_WAIT_TYPES["WEBHOOK"] = "webhook";
6353
- return EXECUTE_WAIT_TYPES;
6354
- }({});
6355
- var TAutomationProducers = /*#__PURE__*/function (TAutomationProducers) {
6356
- TAutomationProducers["RECEIVE_ACTIONS"] = "receiveActions";
6357
- TAutomationProducers["RESOLVE_OUTPUT_PATHS"] = "resolveOutputPaths";
6358
- TAutomationProducers["CHECK_CUSTOM_TRIGGER"] = "checkCustomTrigger";
6359
- TAutomationProducers["FIND_OBJECT"] = "findObject";
6360
- TAutomationProducers["SET_PROPERTIES"] = "setProperties";
6361
- TAutomationProducers["GENERATE_AI_CONTEXT"] = "generateAiContext";
6362
- TAutomationProducers["LOAD_AI_KNOWLEDGE_DOCUMENT_BATCH"] = "loadAiKnowledgeDocumentBatch";
6363
- TAutomationProducers["LOOKUP_AI_TOOL"] = "lookupAiTool";
6364
- return TAutomationProducers;
6365
- }({});
6366
- var TAutomationActionFolks = /*#__PURE__*/function (TAutomationActionFolks) {
6367
- TAutomationActionFolks["DEFAULT"] = "default";
6368
- TAutomationActionFolks["SUCCESS"] = "success";
6369
- TAutomationActionFolks["ERROR"] = "error";
6370
- return TAutomationActionFolks;
6371
- }({});
6372
-
6373
6391
  var splitType = function splitType(type) {
6374
6392
  return type.replace(/\./g, ':').split(':');
6375
6393
  };
@@ -7199,91 +7217,70 @@ var findAutomationNodeConstant = /*#__PURE__*/function () {
7199
7217
  return _ref15.apply(this, arguments);
7200
7218
  };
7201
7219
  }();
7202
- var getAutomationOutputDefinition = /*#__PURE__*/function () {
7203
- var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(nodeType) {
7204
- var _yield$findAutomation;
7220
+
7221
+ /** The action's own declaration from its plugin, e.g. isTargetSource. */
7222
+ var getAutomationActionConstant = /*#__PURE__*/function () {
7223
+ var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(actionType) {
7205
7224
  return _regeneratorRuntime().wrap(function _callee8$(_context9) {
7206
7225
  while (1) switch (_context9.prev = _context9.next) {
7207
7226
  case 0:
7208
7227
  _context9.next = 2;
7209
- return findAutomationNodeConstant(nodeType, ['triggers', 'actions', 'findObjectTargets']);
7228
+ return findAutomationNodeConstant(actionType, ['actions']);
7210
7229
  case 2:
7211
- _context9.t1 = _yield$findAutomation = _context9.sent;
7212
- _context9.t0 = _context9.t1 === null;
7213
- if (_context9.t0) {
7214
- _context9.next = 6;
7215
- break;
7216
- }
7217
- _context9.t0 = _yield$findAutomation === void 0;
7218
- case 6:
7219
- if (!_context9.t0) {
7220
- _context9.next = 10;
7221
- break;
7222
- }
7223
- _context9.t2 = void 0;
7224
- _context9.next = 11;
7225
- break;
7226
- case 10:
7227
- _context9.t2 = _yield$findAutomation.output;
7228
- case 11:
7229
- return _context9.abrupt("return", _context9.t2);
7230
- case 12:
7230
+ return _context9.abrupt("return", _context9.sent);
7231
+ case 3:
7231
7232
  case "end":
7232
7233
  return _context9.stop();
7233
7234
  }
7234
7235
  }, _callee8);
7235
7236
  }));
7236
- return function getAutomationOutputDefinition(_x0) {
7237
+ return function getAutomationActionConstant(_x0) {
7237
7238
  return _ref16.apply(this, arguments);
7238
7239
  };
7239
7240
  }();
7240
-
7241
- /** Whether the trigger's own plugin lets an automation re-run on every event. */
7242
- var isReEnrollableTrigger = /*#__PURE__*/function () {
7243
- var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(triggerType) {
7244
- var _yield$findAutomation2;
7241
+ var getAutomationOutputDefinition = /*#__PURE__*/function () {
7242
+ var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(nodeType) {
7243
+ var _yield$findAutomation;
7245
7244
  return _regeneratorRuntime().wrap(function _callee9$(_context0) {
7246
7245
  while (1) switch (_context0.prev = _context0.next) {
7247
7246
  case 0:
7248
- _context0.t0 = Boolean;
7249
- _context0.next = 3;
7250
- return findAutomationNodeConstant(triggerType, ['triggers']);
7251
- case 3:
7252
- _context0.t2 = _yield$findAutomation2 = _context0.sent;
7253
- _context0.t1 = _context0.t2 === null;
7254
- if (_context0.t1) {
7255
- _context0.next = 7;
7247
+ _context0.next = 2;
7248
+ return findAutomationNodeConstant(nodeType, ['triggers', 'actions', 'findObjectTargets']);
7249
+ case 2:
7250
+ _context0.t1 = _yield$findAutomation = _context0.sent;
7251
+ _context0.t0 = _context0.t1 === null;
7252
+ if (_context0.t0) {
7253
+ _context0.next = 6;
7256
7254
  break;
7257
7255
  }
7258
- _context0.t1 = _yield$findAutomation2 === void 0;
7259
- case 7:
7260
- if (!_context0.t1) {
7261
- _context0.next = 11;
7256
+ _context0.t0 = _yield$findAutomation === void 0;
7257
+ case 6:
7258
+ if (!_context0.t0) {
7259
+ _context0.next = 10;
7262
7260
  break;
7263
7261
  }
7264
- _context0.t3 = void 0;
7265
- _context0.next = 12;
7262
+ _context0.t2 = void 0;
7263
+ _context0.next = 11;
7266
7264
  break;
7265
+ case 10:
7266
+ _context0.t2 = _yield$findAutomation.output;
7267
7267
  case 11:
7268
- _context0.t3 = _yield$findAutomation2.reEnrollable;
7268
+ return _context0.abrupt("return", _context0.t2);
7269
7269
  case 12:
7270
- _context0.t4 = _context0.t3;
7271
- return _context0.abrupt("return", (0, _context0.t0)(_context0.t4));
7272
- case 14:
7273
7270
  case "end":
7274
7271
  return _context0.stop();
7275
7272
  }
7276
7273
  }, _callee9);
7277
7274
  }));
7278
- return function isReEnrollableTrigger(_x1) {
7275
+ return function getAutomationOutputDefinition(_x1) {
7279
7276
  return _ref17.apply(this, arguments);
7280
7277
  };
7281
7278
  }();
7282
7279
 
7283
- /** Whether the trigger's own plugin declared every event a new run. */
7284
- var isReEnrollingTrigger = /*#__PURE__*/function () {
7280
+ /** Whether the trigger's own plugin lets an automation re-run on every event. */
7281
+ var isReEnrollableTrigger = /*#__PURE__*/function () {
7285
7282
  var _ref18 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(triggerType) {
7286
- var _yield$findAutomation3;
7283
+ var _yield$findAutomation2;
7287
7284
  return _regeneratorRuntime().wrap(function _callee0$(_context1) {
7288
7285
  while (1) switch (_context1.prev = _context1.next) {
7289
7286
  case 0:
@@ -7291,13 +7288,13 @@ var isReEnrollingTrigger = /*#__PURE__*/function () {
7291
7288
  _context1.next = 3;
7292
7289
  return findAutomationNodeConstant(triggerType, ['triggers']);
7293
7290
  case 3:
7294
- _context1.t2 = _yield$findAutomation3 = _context1.sent;
7291
+ _context1.t2 = _yield$findAutomation2 = _context1.sent;
7295
7292
  _context1.t1 = _context1.t2 === null;
7296
7293
  if (_context1.t1) {
7297
7294
  _context1.next = 7;
7298
7295
  break;
7299
7296
  }
7300
- _context1.t1 = _yield$findAutomation3 === void 0;
7297
+ _context1.t1 = _yield$findAutomation2 === void 0;
7301
7298
  case 7:
7302
7299
  if (!_context1.t1) {
7303
7300
  _context1.next = 11;
@@ -7307,7 +7304,7 @@ var isReEnrollingTrigger = /*#__PURE__*/function () {
7307
7304
  _context1.next = 12;
7308
7305
  break;
7309
7306
  case 11:
7310
- _context1.t3 = _yield$findAutomation3.reEnrollment;
7307
+ _context1.t3 = _yield$findAutomation2.reEnrollable;
7311
7308
  case 12:
7312
7309
  _context1.t4 = _context1.t3;
7313
7310
  return _context1.abrupt("return", (0, _context1.t0)(_context1.t4));
@@ -7317,36 +7314,78 @@ var isReEnrollingTrigger = /*#__PURE__*/function () {
7317
7314
  }
7318
7315
  }, _callee0);
7319
7316
  }));
7320
- return function isReEnrollingTrigger(_x10) {
7317
+ return function isReEnrollableTrigger(_x10) {
7321
7318
  return _ref18.apply(this, arguments);
7322
7319
  };
7323
7320
  }();
7324
7321
 
7322
+ /** Whether the trigger's own plugin declared every event a new run. */
7323
+ var isReEnrollingTrigger = /*#__PURE__*/function () {
7324
+ var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(triggerType) {
7325
+ var _yield$findAutomation3;
7326
+ return _regeneratorRuntime().wrap(function _callee1$(_context10) {
7327
+ while (1) switch (_context10.prev = _context10.next) {
7328
+ case 0:
7329
+ _context10.t0 = Boolean;
7330
+ _context10.next = 3;
7331
+ return findAutomationNodeConstant(triggerType, ['triggers']);
7332
+ case 3:
7333
+ _context10.t2 = _yield$findAutomation3 = _context10.sent;
7334
+ _context10.t1 = _context10.t2 === null;
7335
+ if (_context10.t1) {
7336
+ _context10.next = 7;
7337
+ break;
7338
+ }
7339
+ _context10.t1 = _yield$findAutomation3 === void 0;
7340
+ case 7:
7341
+ if (!_context10.t1) {
7342
+ _context10.next = 11;
7343
+ break;
7344
+ }
7345
+ _context10.t3 = void 0;
7346
+ _context10.next = 12;
7347
+ break;
7348
+ case 11:
7349
+ _context10.t3 = _yield$findAutomation3.reEnrollment;
7350
+ case 12:
7351
+ _context10.t4 = _context10.t3;
7352
+ return _context10.abrupt("return", (0, _context10.t0)(_context10.t4));
7353
+ case 14:
7354
+ case "end":
7355
+ return _context10.stop();
7356
+ }
7357
+ }, _callee1);
7358
+ }));
7359
+ return function isReEnrollingTrigger(_x11) {
7360
+ return _ref19.apply(this, arguments);
7361
+ };
7362
+ }();
7363
+
7325
7364
  /**
7326
7365
  * Fills an action's inputs from the trigger that started the run, through the
7327
7366
  * mapping the trigger's own plugin declared. Nothing is returned when the
7328
7367
  * trigger declares no mapping for that action.
7329
7368
  */
7330
7369
  var resolveAutomationActionInputs = /*#__PURE__*/function () {
7331
- var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(_ref19) {
7370
+ var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_ref20) {
7332
7371
  var _trigger$actionInputs;
7333
7372
  var subdomain, triggerType, actionType, target, trigger, mapping, resolved;
7334
- return _regeneratorRuntime().wrap(function _callee1$(_context10) {
7335
- while (1) switch (_context10.prev = _context10.next) {
7373
+ return _regeneratorRuntime().wrap(function _callee10$(_context11) {
7374
+ while (1) switch (_context11.prev = _context11.next) {
7336
7375
  case 0:
7337
- subdomain = _ref19.subdomain, triggerType = _ref19.triggerType, actionType = _ref19.actionType, target = _ref19.target;
7338
- _context10.next = 3;
7376
+ subdomain = _ref20.subdomain, triggerType = _ref20.triggerType, actionType = _ref20.actionType, target = _ref20.target;
7377
+ _context11.next = 3;
7339
7378
  return findAutomationNodeConstant(triggerType, ['triggers']);
7340
7379
  case 3:
7341
- trigger = _context10.sent;
7380
+ trigger = _context11.sent;
7342
7381
  mapping = trigger === null || trigger === void 0 || (_trigger$actionInputs = trigger.actionInputs) === null || _trigger$actionInputs === void 0 ? void 0 : _trigger$actionInputs[actionType];
7343
7382
  if (!(!mapping || !Object.keys(mapping).length)) {
7344
- _context10.next = 7;
7383
+ _context11.next = 7;
7345
7384
  break;
7346
7385
  }
7347
- return _context10.abrupt("return", undefined);
7386
+ return _context11.abrupt("return", undefined);
7348
7387
  case 7:
7349
- _context10.next = 9;
7388
+ _context11.next = 9;
7350
7389
  return resolveOutputPathsByNodeType({
7351
7390
  subdomain: subdomain,
7352
7391
  nodeType: triggerType,
@@ -7354,21 +7393,21 @@ var resolveAutomationActionInputs = /*#__PURE__*/function () {
7354
7393
  paths: _toConsumableArray(new Set(Object.values(mapping)))
7355
7394
  });
7356
7395
  case 9:
7357
- resolved = _context10.sent;
7358
- return _context10.abrupt("return", Object.fromEntries(Object.entries(mapping).map(function (_ref21) {
7359
- var _ref22 = _slicedToArray(_ref21, 2),
7360
- inputKey = _ref22[0],
7361
- outputKey = _ref22[1];
7396
+ resolved = _context11.sent;
7397
+ return _context11.abrupt("return", Object.fromEntries(Object.entries(mapping).map(function (_ref22) {
7398
+ var _ref23 = _slicedToArray(_ref22, 2),
7399
+ inputKey = _ref23[0],
7400
+ outputKey = _ref23[1];
7362
7401
  return [inputKey, resolved === null || resolved === void 0 ? void 0 : resolved[outputKey]];
7363
7402
  })));
7364
7403
  case 11:
7365
7404
  case "end":
7366
- return _context10.stop();
7405
+ return _context11.stop();
7367
7406
  }
7368
- }, _callee1);
7407
+ }, _callee10);
7369
7408
  }));
7370
- return function resolveAutomationActionInputs(_x11) {
7371
- return _ref20.apply(this, arguments);
7409
+ return function resolveAutomationActionInputs(_x12) {
7410
+ return _ref21.apply(this, arguments);
7372
7411
  };
7373
7412
  }();
7374
7413
  var hasMatchingResolverKey = function hasMatchingResolverKey(definition, paths) {
@@ -7380,36 +7419,36 @@ var hasMatchingResolverKey = function hasMatchingResolverKey(definition, paths)
7380
7419
  });
7381
7420
  };
7382
7421
  var resolveOutputPathsByNodeType = /*#__PURE__*/function () {
7383
- var _ref24 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_ref23) {
7422
+ var _ref25 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref24) {
7384
7423
  var subdomain, nodeType, source, paths, defaultValue, runtimeOutputs, _splitType3, _splitType4, pluginName, runtimeDefinition, definition;
7385
- return _regeneratorRuntime().wrap(function _callee10$(_context11) {
7386
- while (1) switch (_context11.prev = _context11.next) {
7424
+ return _regeneratorRuntime().wrap(function _callee11$(_context12) {
7425
+ while (1) switch (_context12.prev = _context12.next) {
7387
7426
  case 0:
7388
- subdomain = _ref23.subdomain, nodeType = _ref23.nodeType, source = _ref23.source, paths = _ref23.paths, defaultValue = _ref23.defaultValue, runtimeOutputs = _ref23.runtimeOutputs;
7427
+ subdomain = _ref24.subdomain, nodeType = _ref24.nodeType, source = _ref24.source, paths = _ref24.paths, defaultValue = _ref24.defaultValue, runtimeOutputs = _ref24.runtimeOutputs;
7389
7428
  _splitType3 = splitType(nodeType || ''), _splitType4 = _slicedToArray(_splitType3, 1), pluginName = _splitType4[0];
7390
7429
  runtimeDefinition = runtimeOutputs === null || runtimeOutputs === void 0 ? void 0 : runtimeOutputs[nodeType];
7391
- _context11.t0 = runtimeDefinition;
7392
- if (_context11.t0) {
7393
- _context11.next = 8;
7430
+ _context12.t0 = runtimeDefinition;
7431
+ if (_context12.t0) {
7432
+ _context12.next = 8;
7394
7433
  break;
7395
7434
  }
7396
- _context11.next = 7;
7435
+ _context12.next = 7;
7397
7436
  return getAutomationOutputDefinition(nodeType);
7398
7437
  case 7:
7399
- _context11.t0 = _context11.sent;
7438
+ _context12.t0 = _context12.sent;
7400
7439
  case 8:
7401
- definition = _context11.t0;
7440
+ definition = _context12.t0;
7402
7441
  if (definition) {
7403
- _context11.next = 11;
7442
+ _context12.next = 11;
7404
7443
  break;
7405
7444
  }
7406
- return _context11.abrupt("return", resolveDirectOutputValues(source, paths, defaultValue));
7445
+ return _context12.abrupt("return", resolveDirectOutputValues(source, paths, defaultValue));
7407
7446
  case 11:
7408
7447
  if (!runtimeDefinition) {
7409
- _context11.next = 13;
7448
+ _context12.next = 13;
7410
7449
  break;
7411
7450
  }
7412
- return _context11.abrupt("return", resolveOutputPathsFromDefinition({
7451
+ return _context12.abrupt("return", resolveOutputPathsFromDefinition({
7413
7452
  definition: runtimeDefinition,
7414
7453
  subdomain: subdomain,
7415
7454
  source: source,
@@ -7418,10 +7457,10 @@ var resolveOutputPathsByNodeType = /*#__PURE__*/function () {
7418
7457
  }));
7419
7458
  case 13:
7420
7459
  if (!(pluginName && hasMatchingResolverKey(definition, paths))) {
7421
- _context11.next = 15;
7460
+ _context12.next = 15;
7422
7461
  break;
7423
7462
  }
7424
- return _context11.abrupt("return", sendCoreModuleProducer({
7463
+ return _context12.abrupt("return", sendCoreModuleProducer({
7425
7464
  subdomain: subdomain,
7426
7465
  moduleName: 'automations',
7427
7466
  pluginName: pluginName,
@@ -7435,7 +7474,7 @@ var resolveOutputPathsByNodeType = /*#__PURE__*/function () {
7435
7474
  defaultValue: resolveDirectOutputValues(source, paths, defaultValue)
7436
7475
  }));
7437
7476
  case 15:
7438
- return _context11.abrupt("return", resolveOutputPathsFromDefinition({
7477
+ return _context12.abrupt("return", resolveOutputPathsFromDefinition({
7439
7478
  definition: definition,
7440
7479
  subdomain: subdomain,
7441
7480
  source: source,
@@ -7444,32 +7483,32 @@ var resolveOutputPathsByNodeType = /*#__PURE__*/function () {
7444
7483
  }));
7445
7484
  case 16:
7446
7485
  case "end":
7447
- return _context11.stop();
7486
+ return _context12.stop();
7448
7487
  }
7449
- }, _callee10);
7488
+ }, _callee11);
7450
7489
  }));
7451
- return function resolveOutputPathsByNodeType(_x12) {
7452
- return _ref24.apply(this, arguments);
7490
+ return function resolveOutputPathsByNodeType(_x13) {
7491
+ return _ref25.apply(this, arguments);
7453
7492
  };
7454
7493
  }();
7455
7494
  var resolveOutputGroups = /*#__PURE__*/function () {
7456
- var _ref26 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref25) {
7495
+ var _ref27 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref26) {
7457
7496
  var subdomain, groups, defaultValue, runtimeOutputs, resolvedByToken, _iterator5, _step5, group, resolvedValues, _i5, _Object$entries2, _Object$entries2$_i, path, value;
7458
- return _regeneratorRuntime().wrap(function _callee11$(_context12) {
7459
- while (1) switch (_context12.prev = _context12.next) {
7497
+ return _regeneratorRuntime().wrap(function _callee12$(_context13) {
7498
+ while (1) switch (_context13.prev = _context13.next) {
7460
7499
  case 0:
7461
- subdomain = _ref25.subdomain, groups = _ref25.groups, defaultValue = _ref25.defaultValue, runtimeOutputs = _ref25.runtimeOutputs;
7500
+ subdomain = _ref26.subdomain, groups = _ref26.groups, defaultValue = _ref26.defaultValue, runtimeOutputs = _ref26.runtimeOutputs;
7462
7501
  resolvedByToken = {};
7463
7502
  _iterator5 = _createForOfIteratorHelper(groups);
7464
- _context12.prev = 3;
7503
+ _context13.prev = 3;
7465
7504
  _iterator5.s();
7466
7505
  case 5:
7467
7506
  if ((_step5 = _iterator5.n()).done) {
7468
- _context12.next = 13;
7507
+ _context13.next = 13;
7469
7508
  break;
7470
7509
  }
7471
7510
  group = _step5.value;
7472
- _context12.next = 9;
7511
+ _context13.next = 9;
7473
7512
  return resolveOutputPathsByNodeType({
7474
7513
  subdomain: subdomain,
7475
7514
  nodeType: group.nodeType,
@@ -7479,44 +7518,44 @@ var resolveOutputGroups = /*#__PURE__*/function () {
7479
7518
  runtimeOutputs: runtimeOutputs
7480
7519
  });
7481
7520
  case 9:
7482
- resolvedValues = _context12.sent;
7521
+ resolvedValues = _context13.sent;
7483
7522
  for (_i5 = 0, _Object$entries2 = Object.entries(resolvedValues || {}); _i5 < _Object$entries2.length; _i5++) {
7484
7523
  _Object$entries2$_i = _slicedToArray(_Object$entries2[_i5], 2), path = _Object$entries2$_i[0], value = _Object$entries2$_i[1];
7485
7524
  resolvedByToken["".concat(group.groupKey, ".").concat(path)] = value;
7486
7525
  }
7487
7526
  case 11:
7488
- _context12.next = 5;
7527
+ _context13.next = 5;
7489
7528
  break;
7490
7529
  case 13:
7491
- _context12.next = 18;
7530
+ _context13.next = 18;
7492
7531
  break;
7493
7532
  case 15:
7494
- _context12.prev = 15;
7495
- _context12.t0 = _context12["catch"](3);
7496
- _iterator5.e(_context12.t0);
7533
+ _context13.prev = 15;
7534
+ _context13.t0 = _context13["catch"](3);
7535
+ _iterator5.e(_context13.t0);
7497
7536
  case 18:
7498
- _context12.prev = 18;
7537
+ _context13.prev = 18;
7499
7538
  _iterator5.f();
7500
- return _context12.finish(18);
7539
+ return _context13.finish(18);
7501
7540
  case 21:
7502
- return _context12.abrupt("return", resolvedByToken);
7541
+ return _context13.abrupt("return", resolvedByToken);
7503
7542
  case 22:
7504
7543
  case "end":
7505
- return _context12.stop();
7544
+ return _context13.stop();
7506
7545
  }
7507
- }, _callee11, null, [[3, 15, 18, 21]]);
7546
+ }, _callee12, null, [[3, 15, 18, 21]]);
7508
7547
  }));
7509
- return function resolveOutputGroups(_x13) {
7510
- return _ref26.apply(this, arguments);
7548
+ return function resolveOutputGroups(_x14) {
7549
+ return _ref27.apply(this, arguments);
7511
7550
  };
7512
7551
  }();
7513
7552
 
7514
7553
  // {{ token }} -> resolved raw value (object/number/string), or undefined
7515
7554
  var resolveCurlyPlaceholderToken = function resolveCurlyPlaceholderToken(token, resolvedByToken) {
7516
- var _ref27;
7555
+ var _ref28;
7517
7556
  var trimmedToken = token.trim();
7518
7557
  var staticValue = resolveStaticOutputPlaceholder(trimmedToken);
7519
- return (_ref27 = staticValue !== null && staticValue !== void 0 ? staticValue : resolvedByToken[trimmedToken]) !== null && _ref27 !== void 0 ? _ref27 : resolvedByToken["trigger.".concat(trimmedToken)];
7558
+ return (_ref28 = staticValue !== null && staticValue !== void 0 ? staticValue : resolvedByToken[trimmedToken]) !== null && _ref28 !== void 0 ? _ref28 : resolvedByToken["trigger.".concat(trimmedToken)];
7520
7559
  };
7521
7560
 
7522
7561
  // Replace all {{ }} placeholders in a string.
@@ -7564,28 +7603,28 @@ var _replaceOutputPlaceholdersInValue = function replaceOutputPlaceholdersInValu
7564
7603
  });
7565
7604
  }
7566
7605
  if (value && _typeof(value) === 'object') {
7567
- return Object.fromEntries(Object.entries(value).map(function (_ref28) {
7568
- var _ref29 = _slicedToArray(_ref28, 2),
7569
- key = _ref29[0],
7570
- item = _ref29[1];
7606
+ return Object.fromEntries(Object.entries(value).map(function (_ref29) {
7607
+ var _ref30 = _slicedToArray(_ref29, 2),
7608
+ key = _ref30[0],
7609
+ item = _ref30[1];
7571
7610
  return [key, _replaceOutputPlaceholdersInValue(item, resolvedByToken, defaultValue, keepUnresolvedPlaceholders)];
7572
7611
  }));
7573
7612
  }
7574
7613
  return value;
7575
7614
  };
7576
7615
  var replaceOutputPlaceholders = /*#__PURE__*/function () {
7577
- var _ref31 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref30) {
7578
- var subdomain, execution, values, defaultValue, runtimeOutputs, _ref30$keepUnresolved, keepUnresolvedPlaceholders, tokensByValueKey, resolvedByToken;
7579
- return _regeneratorRuntime().wrap(function _callee12$(_context13) {
7580
- while (1) switch (_context13.prev = _context13.next) {
7616
+ var _ref32 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(_ref31) {
7617
+ var subdomain, execution, values, defaultValue, runtimeOutputs, _ref31$keepUnresolved, keepUnresolvedPlaceholders, tokensByValueKey, resolvedByToken;
7618
+ return _regeneratorRuntime().wrap(function _callee13$(_context14) {
7619
+ while (1) switch (_context14.prev = _context14.next) {
7581
7620
  case 0:
7582
- subdomain = _ref30.subdomain, execution = _ref30.execution, values = _ref30.values, defaultValue = _ref30.defaultValue, runtimeOutputs = _ref30.runtimeOutputs, _ref30$keepUnresolved = _ref30.keepUnresolvedPlaceholders, keepUnresolvedPlaceholders = _ref30$keepUnresolved === void 0 ? true : _ref30$keepUnresolved;
7621
+ subdomain = _ref31.subdomain, execution = _ref31.execution, values = _ref31.values, defaultValue = _ref31.defaultValue, runtimeOutputs = _ref31.runtimeOutputs, _ref31$keepUnresolved = _ref31.keepUnresolvedPlaceholders, keepUnresolvedPlaceholders = _ref31$keepUnresolved === void 0 ? true : _ref31$keepUnresolved;
7583
7622
  tokensByValueKey = getOutputPlaceholderTokensByValueKey(values);
7584
7623
  if (!Object.keys(tokensByValueKey).length) {
7585
- _context13.next = 8;
7624
+ _context14.next = 8;
7586
7625
  break;
7587
7626
  }
7588
- _context13.next = 5;
7627
+ _context14.next = 5;
7589
7628
  return resolveOutputGroups({
7590
7629
  subdomain: subdomain,
7591
7630
  groups: buildOutputResolveGroups({
@@ -7596,34 +7635,34 @@ var replaceOutputPlaceholders = /*#__PURE__*/function () {
7596
7635
  runtimeOutputs: runtimeOutputs
7597
7636
  });
7598
7637
  case 5:
7599
- _context13.t0 = _context13.sent;
7600
- _context13.next = 9;
7638
+ _context14.t0 = _context14.sent;
7639
+ _context14.next = 9;
7601
7640
  break;
7602
7641
  case 8:
7603
- _context13.t0 = {};
7642
+ _context14.t0 = {};
7604
7643
  case 9:
7605
- resolvedByToken = _context13.t0;
7606
- return _context13.abrupt("return", Object.entries(values).reduce(function (acc, _ref32) {
7607
- var _ref33 = _slicedToArray(_ref32, 2),
7608
- key = _ref33[0],
7609
- value = _ref33[1];
7644
+ resolvedByToken = _context14.t0;
7645
+ return _context14.abrupt("return", Object.entries(values).reduce(function (acc, _ref33) {
7646
+ var _ref34 = _slicedToArray(_ref33, 2),
7647
+ key = _ref34[0],
7648
+ value = _ref34[1];
7610
7649
  acc[key] = _replaceOutputPlaceholdersInValue(value, resolvedByToken, defaultValue, keepUnresolvedPlaceholders);
7611
7650
  return acc;
7612
7651
  }, {}));
7613
7652
  case 11:
7614
7653
  case "end":
7615
- return _context13.stop();
7654
+ return _context14.stop();
7616
7655
  }
7617
- }, _callee12);
7656
+ }, _callee13);
7618
7657
  }));
7619
- return function replaceOutputPlaceholders(_x14) {
7620
- return _ref31.apply(this, arguments);
7658
+ return function replaceOutputPlaceholders(_x15) {
7659
+ return _ref32.apply(this, arguments);
7621
7660
  };
7622
7661
  }();
7623
- var getAutomationNodeType = function getAutomationNodeType(_ref34) {
7624
- var pluginName = _ref34.pluginName,
7625
- node = _ref34.node,
7626
- kind = _ref34.kind;
7662
+ var getAutomationNodeType = function getAutomationNodeType(_ref35) {
7663
+ var pluginName = _ref35.pluginName,
7664
+ node = _ref35.node,
7665
+ kind = _ref35.kind;
7627
7666
  if (node.type) {
7628
7667
  return node.type;
7629
7668
  }
@@ -8658,17 +8697,34 @@ var getAutomationBaseType = function getAutomationBaseType(type) {
8658
8697
  var normalizedCollectionName = collectionName && collectionName.endsWith('s') ? collectionName : pluralFormation(collectionName || '');
8659
8698
  return collectionName ? "".concat(pluginName, ":").concat(moduleName, ".").concat(normalizedCollectionName) : "".concat(pluginName, ":").concat(moduleName);
8660
8699
  };
8700
+
8701
+ // The record an earlier action produced or found: Create returns targetId,
8702
+ // Find object returns objectId and the object itself.
8703
+ var getTargetActionRecord = function getTargetActionRecord(execution, targetActionId) {
8704
+ var _find, _ref23, _result$objectId;
8705
+ var result = (_find = (execution.actions || []).find(function (_ref22) {
8706
+ var actionId = _ref22.actionId;
8707
+ return actionId === targetActionId;
8708
+ })) === null || _find === void 0 ? void 0 : _find.result;
8709
+ var object = result !== null && result !== void 0 && result.object && _typeof(result.object) === 'object' ? result.object : {};
8710
+ var id = (_ref23 = (_result$objectId = result === null || result === void 0 ? void 0 : result.objectId) !== null && _result$objectId !== void 0 ? _result$objectId : result === null || result === void 0 ? void 0 : result.targetId) !== null && _ref23 !== void 0 ? _ref23 : object._id;
8711
+ return {
8712
+ id: id == null ? '' : String(id),
8713
+ object: object
8714
+ };
8715
+ };
8661
8716
  var getSetPropertySelector = /*#__PURE__*/function () {
8662
- var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(_ref22) {
8663
- var subdomain, module, execution, targetType, relation, targetPath, target, targetId, _getValueByPath, found, value, rawValue, ids, _ref24, contentType, relatedContentType, relationIds;
8717
+ var _ref25 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(_ref24) {
8718
+ var subdomain, module, execution, targetType, relation, targetPath, targetActionId, actionRecord, target, targetId, _getValueByPath, found, value, rawValue, ids, _ref26, contentType, relatedContentType, relationIds;
8664
8719
  return _regeneratorRuntime().wrap(function _callee0$(_context0) {
8665
8720
  while (1) switch (_context0.prev = _context0.next) {
8666
8721
  case 0:
8667
- subdomain = _ref22.subdomain, module = _ref22.module, execution = _ref22.execution, targetType = _ref22.targetType, relation = _ref22.relation, targetPath = _ref22.targetPath;
8668
- target = execution.target || {};
8669
- targetId = String(execution.targetId || target._id || '');
8722
+ subdomain = _ref24.subdomain, module = _ref24.module, execution = _ref24.execution, targetType = _ref24.targetType, relation = _ref24.relation, targetPath = _ref24.targetPath, targetActionId = _ref24.targetActionId;
8723
+ actionRecord = targetActionId ? getTargetActionRecord(execution, targetActionId) : undefined;
8724
+ target = actionRecord ? actionRecord.object : execution.target || {};
8725
+ targetId = actionRecord ? actionRecord.id : String(execution.targetId || target._id || '');
8670
8726
  if (!targetPath) {
8671
- _context0.next = 8;
8727
+ _context0.next = 9;
8672
8728
  break;
8673
8729
  }
8674
8730
  _getValueByPath = getValueByPath(target, targetPath), found = _getValueByPath.found, value = _getValueByPath.value;
@@ -8681,9 +8737,9 @@ var getSetPropertySelector = /*#__PURE__*/function () {
8681
8737
  $in: Array.from(new Set(ids))
8682
8738
  }
8683
8739
  });
8684
- case 8:
8740
+ case 9:
8685
8741
  if (targetId) {
8686
- _context0.next = 10;
8742
+ _context0.next = 11;
8687
8743
  break;
8688
8744
  }
8689
8745
  return _context0.abrupt("return", {
@@ -8691,18 +8747,18 @@ var getSetPropertySelector = /*#__PURE__*/function () {
8691
8747
  $in: []
8692
8748
  }
8693
8749
  });
8694
- case 10:
8750
+ case 11:
8695
8751
  if (!(!relation && getAutomationBaseType(module) === getAutomationBaseType(targetType))) {
8696
- _context0.next = 12;
8752
+ _context0.next = 13;
8697
8753
  break;
8698
8754
  }
8699
8755
  return _context0.abrupt("return", {
8700
8756
  _id: targetId
8701
8757
  });
8702
- case 12:
8703
- _ref24 = relation || {}, contentType = _ref24.contentType, relatedContentType = _ref24.relatedContentType;
8758
+ case 13:
8759
+ _ref26 = relation || {}, contentType = _ref26.contentType, relatedContentType = _ref26.relatedContentType;
8704
8760
  if (!(!contentType || !relatedContentType)) {
8705
- _context0.next = 15;
8761
+ _context0.next = 16;
8706
8762
  break;
8707
8763
  }
8708
8764
  return _context0.abrupt("return", {
@@ -8710,8 +8766,8 @@ var getSetPropertySelector = /*#__PURE__*/function () {
8710
8766
  $in: []
8711
8767
  }
8712
8768
  });
8713
- case 15:
8714
- _context0.next = 17;
8769
+ case 16:
8770
+ _context0.next = 18;
8715
8771
  return sendTRPCMessage({
8716
8772
  subdomain: subdomain,
8717
8773
  pluginName: 'core',
@@ -8724,30 +8780,30 @@ var getSetPropertySelector = /*#__PURE__*/function () {
8724
8780
  },
8725
8781
  defaultValue: []
8726
8782
  });
8727
- case 17:
8783
+ case 18:
8728
8784
  relationIds = _context0.sent;
8729
8785
  return _context0.abrupt("return", {
8730
8786
  _id: {
8731
8787
  $in: Array.from(new Set((relationIds || []).filter(Boolean)))
8732
8788
  }
8733
8789
  });
8734
- case 19:
8790
+ case 20:
8735
8791
  case "end":
8736
8792
  return _context0.stop();
8737
8793
  }
8738
8794
  }, _callee0);
8739
8795
  }));
8740
8796
  return function getSetPropertySelector(_x0) {
8741
- return _ref23.apply(this, arguments);
8797
+ return _ref25.apply(this, arguments);
8742
8798
  };
8743
8799
  }();
8744
8800
  var setProperty = /*#__PURE__*/function () {
8745
- var _ref26 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(_ref25) {
8746
- var subdomain, module, rules, execution, setPropertyTarget, _ref25$relatedItems, relatedItems, selector, fetchItems, update, updateRecord, needsCurrentValue, baseSelector, _yield$buildSetProper, modifier, _changes, updateResult, count, items, _yield$buildSetProper2, _changes2, updatedCount, changes, _iterator4, _step4, relatedItem, ruleUpdate, _modifier, itemSelector, _updateResult, itemCount;
8801
+ var _ref28 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee1(_ref27) {
8802
+ var subdomain, module, rules, execution, setPropertyTarget, _ref27$relatedItems, relatedItems, selector, fetchItems, update, updateRecord, needsCurrentValue, baseSelector, _yield$buildSetProper, modifier, _changes, updateResult, count, items, _yield$buildSetProper2, _changes2, updatedCount, changes, _iterator4, _step4, relatedItem, ruleUpdate, _modifier, itemSelector, _updateResult, itemCount;
8747
8803
  return _regeneratorRuntime().wrap(function _callee1$(_context1) {
8748
8804
  while (1) switch (_context1.prev = _context1.next) {
8749
8805
  case 0:
8750
- subdomain = _ref25.subdomain, module = _ref25.module, rules = _ref25.rules, execution = _ref25.execution, setPropertyTarget = _ref25.setPropertyTarget, _ref25$relatedItems = _ref25.relatedItems, relatedItems = _ref25$relatedItems === void 0 ? [] : _ref25$relatedItems, selector = _ref25.selector, fetchItems = _ref25.fetchItems, update = _ref25.update;
8806
+ subdomain = _ref27.subdomain, module = _ref27.module, rules = _ref27.rules, execution = _ref27.execution, setPropertyTarget = _ref27.setPropertyTarget, _ref27$relatedItems = _ref27.relatedItems, relatedItems = _ref27$relatedItems === void 0 ? [] : _ref27$relatedItems, selector = _ref27.selector, fetchItems = _ref27.fetchItems, update = _ref27.update;
8751
8807
  updateRecord = getSetPropertyUpdate({
8752
8808
  subdomain: subdomain,
8753
8809
  module: module,
@@ -8916,7 +8972,7 @@ var setProperty = /*#__PURE__*/function () {
8916
8972
  }, _callee1, null, [[12, 20], [40, 69, 72, 75], [52, 61]]);
8917
8973
  }));
8918
8974
  return function setProperty(_x1) {
8919
- return _ref26.apply(this, arguments);
8975
+ return _ref28.apply(this, arguments);
8920
8976
  };
8921
8977
  }();
8922
8978
  var getContentType = function getContentType(type) {
@@ -11155,6 +11211,7 @@ var segmentJoinChanges = /*#__PURE__*/function () {
11155
11211
  };
11156
11212
  }();
11157
11213
 
11214
+ var EMAIL_SCREEN_REASONS = ['syntax', 'no_mx', 'disposable', 'random'];
11158
11215
  var EMAIL_LANES = ['proven', 'unknown', 'suppressed'];
11159
11216
  var emailAddressSchema = new mongoose.Schema({
11160
11217
  email: {
@@ -11186,6 +11243,10 @@ var emailAddressSchema = new mongoose.Schema({
11186
11243
  type: String,
11187
11244
  "enum": ['hard_bounce', 'complaint', 'unsubscribe', 'screened', 'manual']
11188
11245
  },
11246
+ screenReason: {
11247
+ type: String,
11248
+ "enum": EMAIL_SCREEN_REASONS
11249
+ },
11189
11250
  suppressedBy: {
11190
11251
  type: String
11191
11252
  },
@@ -23133,8 +23194,10 @@ exports.APPROVAL_NOTIFICATION_ACTIONS = APPROVAL_NOTIFICATION_ACTIONS;
23133
23194
  exports.APPROVAL_NOTIFICATION_CONTENT_TYPE = APPROVAL_NOTIFICATION_CONTENT_TYPE;
23134
23195
  exports.APPROVAL_REQUEST_KINDS = APPROVAL_REQUEST_KINDS;
23135
23196
  exports.APPROVAL_REQUEST_STATUSES = APPROVAL_REQUEST_STATUSES;
23197
+ exports.AUTOMATION_ACTION_CONTRIBUTIONS = AUTOMATION_ACTION_CONTRIBUTIONS;
23136
23198
  exports.AUTOMATION_CORE_ACTIONS = AUTOMATION_CORE_ACTIONS;
23137
23199
  exports.AUTOMATION_CORE_ACTION_DEFERRED = AUTOMATION_CORE_ACTION_DEFERRED;
23200
+ exports.AUTOMATION_CORE_ACTION_PLACEMENTS = AUTOMATION_CORE_ACTION_PLACEMENTS;
23138
23201
  exports.AUTOMATION_CORE_TRIGGER_TYPES = AUTOMATION_CORE_TRIGGER_TYPES;
23139
23202
  exports.AUTOMATION_DEFERRED_TIMEOUT = AUTOMATION_DEFERRED_TIMEOUT;
23140
23203
  exports.AUTOMATION_EMAIL_RECIPIENTS_TYPES = AUTOMATION_EMAIL_RECIPIENTS_TYPES;
@@ -23168,6 +23231,7 @@ exports.DEFAULT_SEX_CHOICES = DEFAULT_SEX_CHOICES;
23168
23231
  exports.DEFAULT_SOCIAL_LINKS = DEFAULT_SOCIAL_LINKS;
23169
23232
  exports.EMAIL_LANES = EMAIL_LANES;
23170
23233
  exports.EMAIL_RAMP_ID = EMAIL_RAMP_ID;
23234
+ exports.EMAIL_SCREEN_REASONS = EMAIL_SCREEN_REASONS;
23171
23235
  exports.EXECUTE_WAIT_TYPES = EXECUTE_WAIT_TYPES;
23172
23236
  exports.EXPECTED_ERROR_NAME = EXPECTED_ERROR_NAME;
23173
23237
  exports.EvaluateFieldsInput = EvaluateFieldsInput;
@@ -23358,6 +23422,7 @@ exports.generateEventHandlersFromRequest = generateEventHandlersFromRequest;
23358
23422
  exports.generateRequestProcess = generateRequestProcess;
23359
23423
  exports.getActivePlugins = getActivePlugins;
23360
23424
  exports.getAgentToolMaxResponseBytes = getAgentToolMaxResponseBytes;
23425
+ exports.getAutomationActionConstant = getAutomationActionConstant;
23361
23426
  exports.getAutomationNodeType = getAutomationNodeType;
23362
23427
  exports.getAvailablePlugins = getAvailablePlugins;
23363
23428
  exports.getContentType = getContentType;