@erxes/api-shared 3.2.20-1 → 3.2.20-3

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 +1 -1
  2. package/core-modules/dist/erxes-api-shared-core-modules.cjs.prod.js +1 -1
  3. package/core-modules/dist/erxes-api-shared-core-modules.esm.js +2 -2
  4. package/dist/declarations/src/utils/saas/global-profile-v2.d.ts +32 -0
  5. package/dist/declarations/src/utils/saas/global-profile-v2.d.ts.map +1 -0
  6. package/dist/declarations/src/utils/saas/index.d.ts +1 -0
  7. package/dist/declarations/src/utils/saas/index.d.ts.map +1 -1
  8. package/dist/declarations/src/utils/saas/saas-mongo-connection.d.ts.map +1 -1
  9. package/dist/declarations/src/utils/saas/types.d.ts +2 -0
  10. package/dist/declarations/src/utils/saas/types.d.ts.map +1 -1
  11. package/dist/declarations/src/utils/service-discovery.d.ts.map +1 -1
  12. package/dist/{start-plugin-89fa2bd2.cjs.dev.js → start-plugin-7dc096bc.cjs.dev.js} +351 -16
  13. package/dist/{start-plugin-6e76556c.esm.js → start-plugin-a2f6eca9.esm.js} +350 -20
  14. package/dist/{start-plugin-576e707d.cjs.prod.js → start-plugin-b095acca.cjs.prod.js} +351 -16
  15. package/package.json +1 -1
  16. package/src/utils/saas/definition.ts +6 -0
  17. package/src/utils/saas/global-profile-v2.test.ts +81 -0
  18. package/src/utils/saas/global-profile-v2.ts +203 -0
  19. package/src/utils/saas/index.ts +1 -0
  20. package/src/utils/saas/saas-mongo-connection.ts +19 -1
  21. package/src/utils/saas/types.ts +3 -0
  22. package/src/utils/service-discovery.ts +15 -1
  23. package/utils/dist/erxes-api-shared-utils.cjs.dev.js +6 -1
  24. package/utils/dist/erxes-api-shared-utils.cjs.prod.js +6 -1
  25. package/utils/dist/erxes-api-shared-utils.esm.js +2 -2
@@ -16,7 +16,7 @@ import rateLimit from 'express-rate-limit';
16
16
  import { GraphQLScalarType } from 'graphql';
17
17
  import { Kind } from 'graphql/language';
18
18
  import dayjs from 'dayjs';
19
- import fetch from 'node-fetch';
19
+ import fetch$1 from 'node-fetch';
20
20
  import { customAlphabet, nanoid } from 'nanoid';
21
21
  import Redis from 'ioredis';
22
22
  import * as _loadash from 'lodash';
@@ -1293,7 +1293,7 @@ var checkServiceRunning = /*#__PURE__*/function () {
1293
1293
  case 5:
1294
1294
  _context3.prev = 5;
1295
1295
  _context3.next = 8;
1296
- return fetch("".concat(address, "/health"));
1296
+ return fetch$1("".concat(address, "/health"));
1297
1297
  case 8:
1298
1298
  res = _context3.sent;
1299
1299
  if (res.ok) {
@@ -1849,6 +1849,15 @@ var saasOrganizationsSchema = new mongoose.Schema({
1849
1849
  cycleEnabled: {
1850
1850
  type: Boolean
1851
1851
  },
1852
+ // Which global profile owns the organization. Missing or 'old': the original
1853
+ // erxes.io profile, billed through `charge`. 'new': dashboard.erxes.io, whose
1854
+ // plugins come from the Stripe customer below (see global-profile-v2.ts).
1855
+ gpStatus: {
1856
+ type: String
1857
+ },
1858
+ gpStripeCustomerId: {
1859
+ type: String
1860
+ },
1852
1861
  // Kept apart from `domain` / `dnsStatus`, which drive the white-label app
1853
1862
  // domain, so a help center hostname never changes how the app sets cookies.
1854
1863
  helpCenterDomain: {
@@ -3130,7 +3139,7 @@ var getSaasOrganizationIdBySubdomain = /*#__PURE__*/function () {
3130
3139
  }();
3131
3140
  var getSaasOrgsCache = /*#__PURE__*/function () {
3132
3141
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref3) {
3133
- var subdomain, excludeSubdomains, domain, value, organizations;
3142
+ var subdomain, excludeSubdomains, domain, value, organizations, cached, organization;
3134
3143
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3135
3144
  while (1) switch (_context3.prev = _context3.next) {
3136
3145
  case 0:
@@ -3151,31 +3160,54 @@ var getSaasOrgsCache = /*#__PURE__*/function () {
3151
3160
  redis.set('core_organizations', JSON.stringify(organizations));
3152
3161
  case 10:
3153
3162
  if (!subdomain) {
3154
- _context3.next = 12;
3163
+ _context3.next = 23;
3155
3164
  break;
3156
3165
  }
3157
- return _context3.abrupt("return", organizations.find(function (org) {
3166
+ cached = organizations.find(function (org) {
3158
3167
  return org.subdomain === subdomain;
3159
- }));
3160
- case 12:
3161
- if (!excludeSubdomains) {
3168
+ });
3169
+ if (!cached) {
3162
3170
  _context3.next = 14;
3163
3171
  break;
3164
3172
  }
3173
+ return _context3.abrupt("return", cached);
3174
+ case 14:
3175
+ _context3.next = 16;
3176
+ return getSaasCoreConnection();
3177
+ case 16:
3178
+ _context3.next = 18;
3179
+ return coreModelOrganizations.findOne({
3180
+ subdomain: subdomain
3181
+ }).lean();
3182
+ case 18:
3183
+ organization = _context3.sent;
3184
+ if (!organization) {
3185
+ _context3.next = 22;
3186
+ break;
3187
+ }
3188
+ _context3.next = 22;
3189
+ return redis.set('core_organizations', '');
3190
+ case 22:
3191
+ return _context3.abrupt("return", organization || undefined);
3192
+ case 23:
3193
+ if (!excludeSubdomains) {
3194
+ _context3.next = 25;
3195
+ break;
3196
+ }
3165
3197
  return _context3.abrupt("return", organizations.filter(function (org) {
3166
3198
  return !excludeSubdomains.includes(org.subdomain);
3167
3199
  }));
3168
- case 14:
3200
+ case 25:
3169
3201
  if (!domain) {
3170
- _context3.next = 16;
3202
+ _context3.next = 27;
3171
3203
  break;
3172
3204
  }
3173
3205
  return _context3.abrupt("return", organizations.find(function (org) {
3174
3206
  return org.domain === domain;
3175
3207
  }));
3176
- case 16:
3208
+ case 27:
3177
3209
  return _context3.abrupt("return", organizations);
3178
- case 17:
3210
+ case 28:
3179
3211
  case "end":
3180
3212
  return _context3.stop();
3181
3213
  }
@@ -4033,6 +4065,291 @@ var getSaasOrgPromoCodes = /*#__PURE__*/function () {
4033
4065
  };
4034
4066
  }();
4035
4067
 
4068
+ /*
4069
+ * Organizations created on dashboard.erxes.io (the v2 global profile) carry
4070
+ * gpStatus 'new'. Their plugins come from Stripe, not from `charge`:
4071
+ * - every item on the organization's subscriptions while it is active, trialing
4072
+ * or past due. A removed item drops to quantity 0 but stays until the period
4073
+ * ends; the v2 profile stamps that date on the item as `ends_at` metadata.
4074
+ * - every plugin inside a bundle item (`plugins` in the price metadata).
4075
+ * - plugins the organization has without a Stripe item (free plans, always-free
4076
+ * plugins, admin gifts), kept in the customer's `free_plugins` metadata.
4077
+ * Organizations without gpStatus, or with 'old', are untouched.
4078
+ */
4079
+
4080
+ var GP_STATUS = {
4081
+ OLD: 'old',
4082
+ NEW: 'new'
4083
+ };
4084
+ var isGlobalProfileV2 = function isGlobalProfileV2(organization) {
4085
+ return (organization === null || organization === void 0 ? void 0 : organization.gpStatus) === GP_STATUS.NEW;
4086
+ };
4087
+ var STRIPE_API = 'https://api.stripe.com/v1';
4088
+ var LIVE_STATUSES = ['active', 'trialing', 'past_due'];
4089
+ var FRESH_SECONDS = 60;
4090
+ // Served when Stripe can't be reached, so a short outage doesn't empty workspaces.
4091
+ var STALE_SECONDS = 24 * 60 * 60;
4092
+ var list = function list(value) {
4093
+ return (value || '').split(',').map(function (code) {
4094
+ return code.trim();
4095
+ }).filter(Boolean);
4096
+ };
4097
+ var stripeGet = /*#__PURE__*/function () {
4098
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {
4099
+ var key, response;
4100
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
4101
+ while (1) switch (_context.prev = _context.next) {
4102
+ case 0:
4103
+ key = getEnv({
4104
+ name: 'GP2_STRIPE_SECRET_KEY'
4105
+ });
4106
+ if (key) {
4107
+ _context.next = 3;
4108
+ break;
4109
+ }
4110
+ throw new Error('GP2_STRIPE_SECRET_KEY is not configured');
4111
+ case 3:
4112
+ _context.next = 5;
4113
+ return fetch("".concat(STRIPE_API).concat(path), {
4114
+ headers: {
4115
+ Authorization: "Bearer ".concat(key)
4116
+ },
4117
+ signal: AbortSignal.timeout(8000)
4118
+ });
4119
+ case 5:
4120
+ response = _context.sent;
4121
+ if (response.ok) {
4122
+ _context.next = 8;
4123
+ break;
4124
+ }
4125
+ throw new Error("Stripe ".concat(path.split('?')[0], ": ").concat(response.status));
4126
+ case 8:
4127
+ return _context.abrupt("return", response.json());
4128
+ case 9:
4129
+ case "end":
4130
+ return _context.stop();
4131
+ }
4132
+ }, _callee);
4133
+ }));
4134
+ return function stripeGet(_x) {
4135
+ return _ref.apply(this, arguments);
4136
+ };
4137
+ }();
4138
+
4139
+ /** Plugin codes one subscription item grants right now. */
4140
+ var pluginsOfStripeItem = function pluginsOfStripeItem(item) {
4141
+ var _item$metadata, _item$quantity, _item$price, _item$price2;
4142
+ var nowSeconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Date.now() / 1000;
4143
+ var endsAt = Number(((_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.ends_at) || 0);
4144
+ var entitled = ((_item$quantity = item.quantity) !== null && _item$quantity !== void 0 ? _item$quantity : 0) > 0 || endsAt > nowSeconds;
4145
+ if (!entitled) {
4146
+ return [];
4147
+ }
4148
+ var product = _typeof((_item$price = item.price) === null || _item$price === void 0 ? void 0 : _item$price.product) === 'object' ? item.price.product : undefined;
4149
+ var metadata = _objectSpread2(_objectSpread2({}, (product === null || product === void 0 ? void 0 : product.metadata) || {}), ((_item$price2 = item.price) === null || _item$price2 === void 0 ? void 0 : _item$price2.metadata) || {});
4150
+ if (metadata.kind === 'bundle') {
4151
+ return list(metadata.plugins);
4152
+ }
4153
+ return metadata.plugin_code ? [metadata.plugin_code] : [];
4154
+ };
4155
+
4156
+ /** Plugin codes granted by a customer's free list and live subscriptions. */
4157
+ var pluginsFromStripe = function pluginsFromStripe(freePlugins, subscriptions) {
4158
+ var nowSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Date.now() / 1000;
4159
+ var plugins = new Set(list(freePlugins));
4160
+ var _iterator = _createForOfIteratorHelper(subscriptions),
4161
+ _step;
4162
+ try {
4163
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
4164
+ var _subscription$items;
4165
+ var subscription = _step.value;
4166
+ if (!LIVE_STATUSES.includes(subscription.status)) {
4167
+ continue;
4168
+ }
4169
+ var _iterator2 = _createForOfIteratorHelper(((_subscription$items = subscription.items) === null || _subscription$items === void 0 ? void 0 : _subscription$items.data) || []),
4170
+ _step2;
4171
+ try {
4172
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
4173
+ var item = _step2.value;
4174
+ pluginsOfStripeItem(item, nowSeconds).forEach(function (code) {
4175
+ return plugins.add(code);
4176
+ });
4177
+ }
4178
+ } catch (err) {
4179
+ _iterator2.e(err);
4180
+ } finally {
4181
+ _iterator2.f();
4182
+ }
4183
+ }
4184
+ } catch (err) {
4185
+ _iterator.e(err);
4186
+ } finally {
4187
+ _iterator.f();
4188
+ }
4189
+ return _toConsumableArray(plugins);
4190
+ };
4191
+ var fetchPlugins = /*#__PURE__*/function () {
4192
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(customerId) {
4193
+ var _customer$metadata;
4194
+ var customer, subscriptions, products, _iterator3, _step3, _subscription$items2, subscription, _iterator4, _step4, _price$metadata, item, price, product;
4195
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4196
+ while (1) switch (_context2.prev = _context2.next) {
4197
+ case 0:
4198
+ _context2.next = 2;
4199
+ return stripeGet("/customers/".concat(encodeURIComponent(customerId)));
4200
+ case 2:
4201
+ customer = _context2.sent;
4202
+ if (!customer.deleted) {
4203
+ _context2.next = 5;
4204
+ break;
4205
+ }
4206
+ return _context2.abrupt("return", []);
4207
+ case 5:
4208
+ _context2.next = 7;
4209
+ return stripeGet("/subscriptions?customer=".concat(encodeURIComponent(customerId), "&status=all&limit=100"));
4210
+ case 7:
4211
+ subscriptions = _context2.sent;
4212
+ products = new Map();
4213
+ _iterator3 = _createForOfIteratorHelper(subscriptions.data);
4214
+ _context2.prev = 10;
4215
+ _iterator3.s();
4216
+ case 12:
4217
+ if ((_step3 = _iterator3.n()).done) {
4218
+ _context2.next = 42;
4219
+ break;
4220
+ }
4221
+ subscription = _step3.value;
4222
+ _iterator4 = _createForOfIteratorHelper(((_subscription$items2 = subscription.items) === null || _subscription$items2 === void 0 ? void 0 : _subscription$items2.data) || []);
4223
+ _context2.prev = 15;
4224
+ _iterator4.s();
4225
+ case 17:
4226
+ if ((_step4 = _iterator4.n()).done) {
4227
+ _context2.next = 32;
4228
+ break;
4229
+ }
4230
+ item = _step4.value;
4231
+ price = item.price;
4232
+ product = price === null || price === void 0 ? void 0 : price.product;
4233
+ if (!(price && !((_price$metadata = price.metadata) !== null && _price$metadata !== void 0 && _price$metadata.kind) && typeof product === 'string')) {
4234
+ _context2.next = 30;
4235
+ break;
4236
+ }
4237
+ if (products.has(product)) {
4238
+ _context2.next = 29;
4239
+ break;
4240
+ }
4241
+ _context2.t0 = products;
4242
+ _context2.t1 = product;
4243
+ _context2.next = 27;
4244
+ return stripeGet("/products/".concat(encodeURIComponent(product)));
4245
+ case 27:
4246
+ _context2.t2 = _context2.sent;
4247
+ _context2.t0.set.call(_context2.t0, _context2.t1, _context2.t2);
4248
+ case 29:
4249
+ price.product = products.get(product);
4250
+ case 30:
4251
+ _context2.next = 17;
4252
+ break;
4253
+ case 32:
4254
+ _context2.next = 37;
4255
+ break;
4256
+ case 34:
4257
+ _context2.prev = 34;
4258
+ _context2.t3 = _context2["catch"](15);
4259
+ _iterator4.e(_context2.t3);
4260
+ case 37:
4261
+ _context2.prev = 37;
4262
+ _iterator4.f();
4263
+ return _context2.finish(37);
4264
+ case 40:
4265
+ _context2.next = 12;
4266
+ break;
4267
+ case 42:
4268
+ _context2.next = 47;
4269
+ break;
4270
+ case 44:
4271
+ _context2.prev = 44;
4272
+ _context2.t4 = _context2["catch"](10);
4273
+ _iterator3.e(_context2.t4);
4274
+ case 47:
4275
+ _context2.prev = 47;
4276
+ _iterator3.f();
4277
+ return _context2.finish(47);
4278
+ case 50:
4279
+ return _context2.abrupt("return", pluginsFromStripe((_customer$metadata = customer.metadata) === null || _customer$metadata === void 0 ? void 0 : _customer$metadata.free_plugins, subscriptions.data));
4280
+ case 51:
4281
+ case "end":
4282
+ return _context2.stop();
4283
+ }
4284
+ }, _callee2, null, [[10, 44, 47, 50], [15, 34, 37, 40]]);
4285
+ }));
4286
+ return function fetchPlugins(_x2) {
4287
+ return _ref2.apply(this, arguments);
4288
+ };
4289
+ }();
4290
+
4291
+ /** Plugin codes a v2 organization may use. Cached for a minute per organization. */
4292
+ var getGlobalProfileV2Plugins = /*#__PURE__*/function () {
4293
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(organization) {
4294
+ var customerId, freshKey, staleKey, cached, plugins, value, stale;
4295
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
4296
+ while (1) switch (_context3.prev = _context3.next) {
4297
+ case 0:
4298
+ customerId = organization.gpStripeCustomerId;
4299
+ if (customerId) {
4300
+ _context3.next = 3;
4301
+ break;
4302
+ }
4303
+ return _context3.abrupt("return", []);
4304
+ case 3:
4305
+ freshKey = "gp2_plugins:".concat(customerId);
4306
+ staleKey = "gp2_plugins_stale:".concat(customerId);
4307
+ _context3.next = 7;
4308
+ return redis.get(freshKey)["catch"](function () {
4309
+ return null;
4310
+ });
4311
+ case 7:
4312
+ cached = _context3.sent;
4313
+ if (!cached) {
4314
+ _context3.next = 10;
4315
+ break;
4316
+ }
4317
+ return _context3.abrupt("return", JSON.parse(cached));
4318
+ case 10:
4319
+ _context3.prev = 10;
4320
+ _context3.next = 13;
4321
+ return fetchPlugins(customerId);
4322
+ case 13:
4323
+ plugins = _context3.sent;
4324
+ value = JSON.stringify(plugins);
4325
+ _context3.next = 17;
4326
+ return Promise.all([redis.set(freshKey, value, 'EX', FRESH_SECONDS), redis.set(staleKey, value, 'EX', STALE_SECONDS)])["catch"](function () {
4327
+ return undefined;
4328
+ });
4329
+ case 17:
4330
+ return _context3.abrupt("return", plugins);
4331
+ case 20:
4332
+ _context3.prev = 20;
4333
+ _context3.t0 = _context3["catch"](10);
4334
+ console.error("[gp2] plugins for ".concat(organization.subdomain, ": ").concat(_context3.t0.message));
4335
+ _context3.next = 25;
4336
+ return redis.get(staleKey)["catch"](function () {
4337
+ return null;
4338
+ });
4339
+ case 25:
4340
+ stale = _context3.sent;
4341
+ return _context3.abrupt("return", stale ? JSON.parse(stale) : []);
4342
+ case 27:
4343
+ case "end":
4344
+ return _context3.stop();
4345
+ }
4346
+ }, _callee3, null, [[10, 20]]);
4347
+ }));
4348
+ return function getGlobalProfileV2Plugins(_x3) {
4349
+ return _ref3.apply(this, arguments);
4350
+ };
4351
+ }();
4352
+
4036
4353
  dotenv.config();
4037
4354
  var _process$env$1 = process.env,
4038
4355
  NODE_ENV = _process$env$1.NODE_ENV,
@@ -4114,7 +4431,7 @@ var getActivePlugins = /*#__PURE__*/function () {
4114
4431
  }();
4115
4432
  var getAvailablePlugins = /*#__PURE__*/function () {
4116
4433
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(subdomain) {
4117
- var ENABLED_PLUGINS, ENABLED_API_PLUGINS, VERSION, organizationInfo, charges, plugins;
4434
+ var ENABLED_PLUGINS, ENABLED_API_PLUGINS, VERSION, organizationInfo, enabled, _plugins, charges, plugins;
4118
4435
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
4119
4436
  while (1) switch (_context4.prev = _context4.next) {
4120
4437
  case 0:
@@ -4129,7 +4446,7 @@ var getAvailablePlugins = /*#__PURE__*/function () {
4129
4446
  defaultValue: 'os'
4130
4447
  });
4131
4448
  if (!(VERSION && VERSION === 'saas')) {
4132
- _context4.next = 13;
4449
+ _context4.next = 19;
4133
4450
  break;
4134
4451
  }
4135
4452
  _context4.next = 6;
@@ -4138,6 +4455,19 @@ var getAvailablePlugins = /*#__PURE__*/function () {
4138
4455
  });
4139
4456
  case 6:
4140
4457
  organizationInfo = _context4.sent;
4458
+ if (!isGlobalProfileV2(organizationInfo)) {
4459
+ _context4.next = 13;
4460
+ break;
4461
+ }
4462
+ enabled = [].concat(_toConsumableArray(ENABLED_PLUGINS.split(',')), _toConsumableArray(ENABLED_API_PLUGINS.split(',')));
4463
+ _context4.next = 11;
4464
+ return getGlobalProfileV2Plugins(organizationInfo);
4465
+ case 11:
4466
+ _plugins = _context4.sent;
4467
+ return _context4.abrupt("return", ['core'].concat(_toConsumableArray(_plugins.filter(function (plugin) {
4468
+ return enabled.includes(plugin);
4469
+ }))));
4470
+ case 13:
4141
4471
  charges = organizationInfo.charge;
4142
4472
  plugins = [];
4143
4473
  Object.keys(charges).forEach(function (key) {
@@ -4151,9 +4481,9 @@ var getAvailablePlugins = /*#__PURE__*/function () {
4151
4481
  }
4152
4482
  });
4153
4483
  return _context4.abrupt("return", ['core'].concat(plugins));
4154
- case 13:
4484
+ case 19:
4155
4485
  return _context4.abrupt("return", getPlugins());
4156
- case 14:
4486
+ case 20:
4157
4487
  case "end":
4158
4488
  return _context4.stop();
4159
4489
  }
@@ -18526,7 +18856,7 @@ var readFromCFImages = /*#__PURE__*/function () {
18526
18856
  url = width ? "https://imagedelivery.net/".concat(accountHash, "/").concat(fileName, "/w=").concat(width) : "https://imagedelivery.net/".concat(accountHash, "/").concat(fileName, "/public");
18527
18857
  _context5.prev = 6;
18528
18858
  _context5.next = 9;
18529
- return fetch(url);
18859
+ return fetch$1(url);
18530
18860
  case 9:
18531
18861
  response = _context5.sent;
18532
18862
  if (!(!response.ok || response.status !== 200)) {
@@ -20810,7 +21140,7 @@ var uploadToCFImages = /*#__PURE__*/function () {
20810
21140
  formData.append('file', fs$1.createReadStream(filePath));
20811
21141
  formData.append('id', "".concat(bucketName, "/").concat(finalFileName));
20812
21142
  _context2.next = 18;
20813
- return fetch(url, {
21143
+ return fetch$1(url, {
20814
21144
  method: 'POST',
20815
21145
  headers: headers,
20816
21146
  body: formData
@@ -20874,7 +21204,7 @@ var uploadToCFStream = /*#__PURE__*/function () {
20874
21204
  formData.append('file', fs$1.createReadStream(filePath));
20875
21205
  formData.append('id', finalFileName);
20876
21206
  _context3.next = 13;
20877
- return fetch(url, {
21207
+ return fetch$1(url, {
20878
21208
  method: 'POST',
20879
21209
  headers: headers,
20880
21210
  body: formData
@@ -22739,4 +23069,4 @@ function _startPlugin() {
22739
23069
  return _startPlugin.apply(this, arguments);
22740
23070
  }
22741
23071
 
22742
- export { setClientPortalHeader as $, wrapApolloResolvers as A, markResolvers as B, startBeforeResolvers as C, checkBeforeResolvers as D, expectedErrorPlugin as E, agentToolsAuthHeaderName as F, encodeAgentToolsAuthHeader as G, decodeAgentToolsAuthHeader as H, buildAgentToolManifest as I, mountAgentTools as J, AGENT_TOOL_DEFAULT_MAX_RESPONSE_BYTES as K, getAgentToolMaxResponseBytes as L, oversizedAgentToolResultBytes as M, agentToolResponseTooLargeError as N, graphqlPubsub as O, clientPortalHeaderName as P, cpUserHeaderName as Q, extractUserFromHeader as R, extractCPUserFromHeader as S, TBeforeResolversProducers as T, extractClientPortalFromHeader as U, USER_HEADER_OMITTED_FIELDS as V, HEADER_SIZE_WARN_BYTES as W, compactUserForHeader as X, setUserHeader as Y, setCPUserHeader as Z, _asyncToGenerator as _, _regeneratorRuntime as a, getAvailablePlugins as a$, startAfterProcess as a0, mongooseStringRandomId as a1, mongooseStringNonBlank as a2, mongoStringRequired as a3, mongooseStringRequiredNonBlank as a4, mongooseField as a5, updateMongoDocumentOrder as a6, defaultPaginate as a7, cursorPaginate as a8, cursorPaginateAggregation as a9, ORGANIZATION_ID_MAPPING as aA, getSaasOrganizationIdBySubdomain as aB, getSaasOrgsCache as aC, getSaasOrganizations as aD, getSaasOrganizationsByFilter as aE, updateSaasOrganization as aF, helpCenterDomainsOf as aG, getSaasOrganizationByHelpCenterDomain as aH, getSaasOrganizationHelpCenterDomains as aI, getSaasOrganizationsWithPendingHelpCenterDomain as aJ, saveSaasOrganizationHelpCenterDomain as aK, removeSaasOrganizationHelpCenterDomain as aL, getSaasOrganizationDetail as aM, getSaasOrganizationPlanHistories as aN, getSaasOrganizationActiveAddons as aO, removeOrgsCache as aP, getSaasPlugins as aQ, getSaasPlugin as aR, getSaasPromoCodes as aS, getSaasOrgPromoCodes as aT, sanitizeFilename as aU, sanitizeKey as aV, isDev as aW, keyForConfig as aX, getPlugins as aY, setActivePlugins as aZ, getActivePlugins as a_, checkCollectionCodeDuplication as aa, schemaWrapper as ab, mongooseConnectionOptions as ac, closeMongooose as ad, splitSearchWords as ae, generateConfiguredSearchTokens as af, buildSearchTokenFilter as ag, configureSchemaSearchTokens as ah, getSchemaSearchTokenConfig as ai, toSerializablePayload as aj, DEFAULT_JOB_OPTIONS as ak, createMQWorkerWithListeners as al, sendWorkerMessage as am, randomAlphanumeric as an, randomLowercase as ao, redis as ap, resetConfigsCache as aq, coreModelAddons as ar, coreModelBundles as as, coreModelInstallations as at, coreModelUsers as au, coreModelEndpoints as av, coreModelPromoCodes as aw, coreModelPlugins as ax, coreModelExperiences as ay, coreModelOrganizationPlanHistories as az, coreModelOrganizations as b, classifyError as b$, clearServiceDiscoveryCache as b0, getPlugin as b1, joinErxesGateway as b2, leaveErxesGateway as b3, isEnabled as b4, getPluginAddress as b5, initializePluginConfig as b6, MAX_HEADER_BYTES as b7, startPlugin as b8, trpcContextHeaderName as b9, getNextMonth as bA, fixNum as bB, dateToShortStr as bC, shortStrToDate as bD, isImage as bE, isVideo as bF, createHealthRoute as bG, checkServiceRunning as bH, generateRequestProcess as bI, getDiffObjects as bJ, flattenObject as bK, readFileUrl as bL, readFileFromStorage as bM, readFileStreamFromStorage as bN, uploadFileToStorage as bO, encodeCursor as bP, decodeCursor as bQ, buildCursorQuery as bR, stripAnsi as bS, removeLastTrailingSlash as bT, removeExtraSpaces as bU, splitStr as bV, cleanHtml as bW, random as bX, EXPECTED_ERROR_NAME as bY, ExpectedError as bZ, createExpectedError as b_, encodeTRPCContextHeader as ba, decodeTRPCContextHeader as bb, createPluginTRPCContext as bc, createTRPCContext as bd, ok as be, err as bf, sendCoreModuleProducer as bg, getTrustProxySetting as bh, applyTrustProxy as bi, connectionOptions as bj, authCookieOptions as bk, paginate as bl, validSearchText as bm, regexSearchText as bn, getCoreDomain as bo, escapeRegExp as bp, updateOrder as bq, pluralFormation as br, fixDate as bs, checkUserIds as bt, getUniqueValue as bu, getDate as bv, getToday as bw, getFullDate as bx, getPureDate as by, getTomorrow as bz, connect as c, DEFAULT_SOCIAL_LINKS as c$, isExpectedError as c0, extractMessage as c1, sentryExpectedErrorFilter as c2, initErxesSentry as c3, isSameRecordReferenceType as c4, normalizeRecordReferenceTypes as c5, normalizeRecordReferenceExtensions as c6, propertyDataPath as c7, toPropertyRowKey as c8, getLocalRecordReferenceType as c9, propertyGroupIdFromKey as cA, toPropertyRowColumnKey as cB, PROPERTIES_DATA as cC, logActivityLogError as cD, matchesFieldPattern as cE, findResolver as cF, getSnapshot as cG, detectAssignmentDelta as cH, permissionGroupSchema as cI, userGroupSchema as cJ, permissionSchema as cK, roleSchema as cL, checkLogin as cM, wrapPermission as cN, getGroupActionsMap as cO, clearGroupActionsCache as cP, canGroup as cQ, hasDeclaredOAuthScopes as cR, resolveActionOAuthScopes as cS, checkPermissionGroup as cT, wrapPublicResolver as cU, userSchema as cV, userMovemmentSchema as cW, STATUSES as cX, COMPANY_BUSINESS_TYPES as cY, DEFAULT_COMPANY_INDUSTRY_TYPES as cZ, COMPANY_INDUSTRY_TYPES as c_, getRecordReferencePluginName as ca, _typeof as cb, resolveRecordReferenceValue as cc, _toArray as cd, AUTOMATION_ERROR_CODES as ce, SEGMENT_MEMBERSHIP_FIELD as cf, parsePropertyDataKey as cg, toPropertyGroupKey as ch, walkSegmentNodes as ci, segmentFieldRef as cj, segmentReferenceRef as ck, segmentRelationRef as cl, DEFAULT_SEGMENT_TIME_ZONE as cm, normalizeSegmentOperator as cn, SegmentOperator as co, PERIOD_OPERATORS as cp, zonedPeriodRange as cq, shiftZonedDays as cr, zonedDate as cs, isAnniversary as ct, _objectWithoutProperties as cu, compileSegmentMongoFilter as cv, gatherSegmentRelations as cw, mergePropertyRowConditions as cx, parsePropertyColumnKey as cy, isPropertyGroupKey as cz, getSubdomain as d, AutomationExecActionInput as d$, SOCIAL_LINKS as d0, DEFAULT_SEX_CHOICES as d1, SEX_OPTIONS as d2, DEFAULT_CONSTANT_VALUES as d3, USER_ROLES as d4, USER_PROPERTIES_INFO as d5, STRUCTURE_STATUSES as d6, USER_MOVEMENT_STATUSES as d7, CUSTOMER_SELECT_OPTIONS as d8, USER_EXTENDED_FIELDS as d9, AUTOMATION_NON_DEFERRABLE_CORE_ACTIONS as dA, AUTOMATION_CORE_ACTION_DEFERRED as dB, AUTOMATION_DEFERRED_TIMEOUT as dC, BROADCAST_TRIGGER_TYPE as dD, BROADCAST_TARGET_TYPE as dE, getTriggerTargetType as dF, EXECUTE_WAIT_TYPES as dG, TAutomationProducers as dH, TAutomationActionFolks as dI, automationSchema as dJ, AUTOMATION_EXECUTION_STATUS as dK, automationExecutionSchema as dL, aiAgentSchema as dM, resolveFromSourceField as dN, matchAutomationResolverKey as dO, getValueByPath as dP, AUTOMATION_OUTPUT_ITEM_COUNT as dQ, isReEnrollableTrigger as dR, isReEnrollingTrigger as dS, resolveAutomationActionInputs as dT, resolveOutputPathsByNodeType as dU, replaceOutputPlaceholders as dV, getAutomationNodeType as dW, toTransportOutput as dX, normalizeAutomationConstantsForTransport as dY, buildRuntimeOutputsIndex as dZ, AutomationBaseInput as d_, USER_EXPORT_EXTENDED_FIELDS as da, INPUT_TYPE as db, customFieldSchema as dc, ruleSchema as dd, attachmentSchema as de, initRecordReferences as df, createEventHandlers as dg, setEventHandlerRuntimeContext as dh, generateEventHandlersFromRequest as di, appSchema as dj, buildSetPropertyModifier as dk, getSetPropertySelector as dl, setProperty as dm, getContentType as dn, getModuleName as dp, getPluginName as dq, splitType as dr, startAutomations as ds, AUTOMATION_PROPERTY_OPERATORS as dt, STATIC_PLACEHOLDER as du, AUTOMATION_STATUSES as dv, AUTOMATION_CORE_ACTIONS as dw, AUTOMATION_CORE_TRIGGER_TYPES as dx, TAutomationFindObjectType as dy, AUTOMATION_EMAIL_RECIPIENTS_TYPES as dz, getSaasCoreConnection as e, PROPERTY_ROW_KEY_SEP as e$, AutomationExecutionInput as e0, AutomationActionInput as e1, ReceiveActionsInputData as e2, ReceiveActionsInput as e3, CheckCustomTriggerInputData as e4, FindObjectInputData as e5, ResolveOutputPathsInputData as e6, SetPropertiesInputData as e7, GenerateAiContextInputData as e8, LoadAiKnowledgeDocumentBatchInputData as e9, sendSegmentForget as eA, segmentJoinChanges as eB, gatherSegmentEventTypes as eC, gatherSegmentRecordTypes as eD, gatherSegmentFieldSources as eE, gatherSegmentJoinPaths as eF, zonedDayStart as eG, isLeapYear as eH, anniversaryRanges as eI, collectSegmentValueRefs as eJ, collectSegmentReferences as eK, hasSegmentReferenceInRelation as eL, DEFAULT_SEGMENT_VALUE_FIELD as eM, resolveSegmentFieldOperators as eN, resolveSegmentFieldDependencies as eO, resolveSegmentValueField as eP, SEGMENT_OPERATOR_SPECS as eQ, SEGMENT_IMPLICIT_OPERATORS as eR, initSegmentProducers as eS, TSegmentProducers as eT, SegmentNodeSchema as eU, SegmentBaseInput as eV, EvaluateFieldsInput as eW, ListSegmentMembersInput as eX, CountSegmentMembersInput as eY, ApplyMembershipInput as eZ, PROPERTY_GROUP_KEY_PREFIX as e_, LookupAiToolInputData as ea, CheckCustomTriggerInput as eb, FindObjectInput as ec, ResolveOutputPathsInput as ed, SetPropertiesInput as ee, GenerateAiContextInput as ef, LoadAiKnowledgeDocumentBatchInput as eg, LookupAiToolInput as eh, sendAutomationTrigger as ei, sendAutomationRun as ej, sendAutomationDeferredCompletion as ek, SEGMENT_TEXT_OPERATORS as el, SEGMENT_ID_OPERATORS as em, SEGMENT_NUMBER_OPERATORS as en, SEGMENT_DATE_OPERATORS as eo, SEGMENT_BOOLEAN_OPERATORS as ep, SegmentField as eq, segmentDependencyKey as er, segmentDependencies as es, segmentDependsOnClock as et, SEGMENT_QUEUES as eu, segmentQueueFor as ev, scheduleSegmentReconcile as ew, sendSegmentChanged as ex, sendSegmentReconcile as ey, sendSegmentRebuild as ez, createScopedEventHandlers as f, BatchSkipRowInput as f$, PROPERTY_ANY_ROW_KEY_SEP as f0, isPropertyDataPath as f1, fieldIdFromPropertyDataPath as f2, propertyDataExistsFilter as f3, propertyDataRegexFilter as f4, PROPERTY_ROW_INDEX_SEP as f5, initPropertyProducers as f6, TPropertyProducers as f7, PropertyValueUsageInput as f8, UNKNOWN_VALUE_SAMPLES as f9, APPROVAL_REQUEST_STATUSES as fA, APPROVAL_REQUEST_KINDS as fB, APPROVAL_DECISIONS as fC, APPROVAL_NOTIFICATION_CONTENT_TYPE as fD, APPROVAL_NOTIFICATION_ACTIONS as fE, TApprovalChangeProducers as fF, approvalLockCheckInputSchema as fG, approvalLockStatesInputSchema as fH, approvalLockCreateInputSchema as fI, approvalRequestCreateInputSchema as fJ, approvalChangeApplyInputSchema as fK, clientPortalSchema as fL, cpNotificationConfigUserSchema as fM, cpTwoFactor as fN, cpNotificationSettingsSchema as fO, refreshTokenSchema as fP, socialAuthProviderSchema as fQ, fcmDeviceSchema as fR, cpUserSchema as fS, USER_TYPES as fT, commentSchema as fU, cpNotificationSchema as fV, InsertImportRowsInputSchema as fW, TImportExportProducers as fX, startImportExportWorker as fY, InsertImportRowsInput as fZ, GetExportHeadersInput as f_, UNKNOWN_VALUE_COUNTS as fa, unknownValueUsage as fb, measurePropertyValueSamples as fc, measurePropertyValueCounts as fd, measurePropertyValueUsage as fe, logsSchema as ff, activityLogsSchema as fg, EMAIL_LANES as fh, emailAddressSchema as fi, emailDeliverySchema as fj, EMAIL_RAMP_ID as fk, emailRampSchema as fl, emailSenderSchema as fm, notificationSchema as fn, notificationSettingsSchema as fo, notificationZTypeSchema as fp, sendNotification as fq, sendNotificationChannels as fr, approvalChangePluginName as fs, normalizeApprovalChangeType as ft, localApprovalChangeType as fu, normalizeApprovalConfig as fv, initApproval as fw, APPROVAL_LOCK_STATUSES as fx, APPROVAL_APPROVER_SCOPES as fy, APPROVAL_MODES as fz, getEnv as g, GetExportDataInput as g0, InsertImportRowsOutput as g1, GetImportHeadersInput as g2, GetImportHeadersOutput as g3, getImportExportJobOptions as g4, toTerminalImportExportError as g5, logImportExportEvent as g6, safeCleanup as g7, AUTO_MATCH_CONFIDENCE as g8, SUGGEST_CONFIDENCE as g9, normalizeHeader as ga, matchImportHeaders as gb, processCSVStream as gc, countCsvDataRows as gd, _slicedToArray as h, _objectSpread2 as i, chunkArray as j, _createForOfIteratorHelper as k, logHandler as l, _createClass as m, _classCallCheck as n, isValidURL as o, sendTRPCMessage as p, _inherits as q, runBeforeResolvers as r, sendWorkerQueue as s, _wrapNativeSuper as t, userHeaderName as u, _callSuper as v, _defineProperty as w, _toConsumableArray as x, apolloCustomScalars as y, generateApolloContext as z };
23072
+ export { setClientPortalHeader as $, wrapApolloResolvers as A, markResolvers as B, startBeforeResolvers as C, checkBeforeResolvers as D, expectedErrorPlugin as E, agentToolsAuthHeaderName as F, encodeAgentToolsAuthHeader as G, decodeAgentToolsAuthHeader as H, buildAgentToolManifest as I, mountAgentTools as J, AGENT_TOOL_DEFAULT_MAX_RESPONSE_BYTES as K, getAgentToolMaxResponseBytes as L, oversizedAgentToolResultBytes as M, agentToolResponseTooLargeError as N, graphqlPubsub as O, clientPortalHeaderName as P, cpUserHeaderName as Q, extractUserFromHeader as R, extractCPUserFromHeader as S, TBeforeResolversProducers as T, extractClientPortalFromHeader as U, USER_HEADER_OMITTED_FIELDS as V, HEADER_SIZE_WARN_BYTES as W, compactUserForHeader as X, setUserHeader as Y, setCPUserHeader as Z, _asyncToGenerator as _, _regeneratorRuntime as a, isDev as a$, startAfterProcess as a0, mongooseStringRandomId as a1, mongooseStringNonBlank as a2, mongoStringRequired as a3, mongooseStringRequiredNonBlank as a4, mongooseField as a5, updateMongoDocumentOrder as a6, defaultPaginate as a7, cursorPaginate as a8, cursorPaginateAggregation as a9, ORGANIZATION_ID_MAPPING as aA, getSaasOrganizationIdBySubdomain as aB, getSaasOrgsCache as aC, getSaasOrganizations as aD, getSaasOrganizationsByFilter as aE, updateSaasOrganization as aF, helpCenterDomainsOf as aG, getSaasOrganizationByHelpCenterDomain as aH, getSaasOrganizationHelpCenterDomains as aI, getSaasOrganizationsWithPendingHelpCenterDomain as aJ, saveSaasOrganizationHelpCenterDomain as aK, removeSaasOrganizationHelpCenterDomain as aL, getSaasOrganizationDetail as aM, getSaasOrganizationPlanHistories as aN, getSaasOrganizationActiveAddons as aO, removeOrgsCache as aP, getSaasPlugins as aQ, getSaasPlugin as aR, getSaasPromoCodes as aS, getSaasOrgPromoCodes as aT, GP_STATUS as aU, isGlobalProfileV2 as aV, pluginsOfStripeItem as aW, pluginsFromStripe as aX, getGlobalProfileV2Plugins as aY, sanitizeFilename as aZ, sanitizeKey as a_, checkCollectionCodeDuplication as aa, schemaWrapper as ab, mongooseConnectionOptions as ac, closeMongooose as ad, splitSearchWords as ae, generateConfiguredSearchTokens as af, buildSearchTokenFilter as ag, configureSchemaSearchTokens as ah, getSchemaSearchTokenConfig as ai, toSerializablePayload as aj, DEFAULT_JOB_OPTIONS as ak, createMQWorkerWithListeners as al, sendWorkerMessage as am, randomAlphanumeric as an, randomLowercase as ao, redis as ap, resetConfigsCache as aq, coreModelAddons as ar, coreModelBundles as as, coreModelInstallations as at, coreModelUsers as au, coreModelEndpoints as av, coreModelPromoCodes as aw, coreModelPlugins as ax, coreModelExperiences as ay, coreModelOrganizationPlanHistories as az, coreModelOrganizations as b, cleanHtml as b$, keyForConfig as b0, getPlugins as b1, setActivePlugins as b2, getActivePlugins as b3, getAvailablePlugins as b4, clearServiceDiscoveryCache as b5, getPlugin as b6, joinErxesGateway as b7, leaveErxesGateway as b8, isEnabled as b9, getDate as bA, getToday as bB, getFullDate as bC, getPureDate as bD, getTomorrow as bE, getNextMonth as bF, fixNum as bG, dateToShortStr as bH, shortStrToDate as bI, isImage as bJ, isVideo as bK, createHealthRoute as bL, checkServiceRunning as bM, generateRequestProcess as bN, getDiffObjects as bO, flattenObject as bP, readFileUrl as bQ, readFileFromStorage as bR, readFileStreamFromStorage as bS, uploadFileToStorage as bT, encodeCursor as bU, decodeCursor as bV, buildCursorQuery as bW, stripAnsi as bX, removeLastTrailingSlash as bY, removeExtraSpaces as bZ, splitStr as b_, getPluginAddress as ba, initializePluginConfig as bb, MAX_HEADER_BYTES as bc, startPlugin as bd, trpcContextHeaderName as be, encodeTRPCContextHeader as bf, decodeTRPCContextHeader as bg, createPluginTRPCContext as bh, createTRPCContext as bi, ok as bj, err as bk, sendCoreModuleProducer as bl, getTrustProxySetting as bm, applyTrustProxy as bn, connectionOptions as bo, authCookieOptions as bp, paginate as bq, validSearchText as br, regexSearchText as bs, getCoreDomain as bt, escapeRegExp as bu, updateOrder as bv, pluralFormation as bw, fixDate as bx, checkUserIds as by, getUniqueValue as bz, connect as c, userMovemmentSchema as c$, random as c0, EXPECTED_ERROR_NAME as c1, ExpectedError as c2, createExpectedError as c3, classifyError as c4, isExpectedError as c5, extractMessage as c6, sentryExpectedErrorFilter as c7, initErxesSentry as c8, isSameRecordReferenceType as c9, compileSegmentMongoFilter as cA, gatherSegmentRelations as cB, mergePropertyRowConditions as cC, parsePropertyColumnKey as cD, isPropertyGroupKey as cE, propertyGroupIdFromKey as cF, toPropertyRowColumnKey as cG, PROPERTIES_DATA as cH, logActivityLogError as cI, matchesFieldPattern as cJ, findResolver as cK, getSnapshot as cL, detectAssignmentDelta as cM, permissionGroupSchema as cN, userGroupSchema as cO, permissionSchema as cP, roleSchema as cQ, checkLogin as cR, wrapPermission as cS, getGroupActionsMap as cT, clearGroupActionsCache as cU, canGroup as cV, hasDeclaredOAuthScopes as cW, resolveActionOAuthScopes as cX, checkPermissionGroup as cY, wrapPublicResolver as cZ, userSchema as c_, normalizeRecordReferenceTypes as ca, normalizeRecordReferenceExtensions as cb, propertyDataPath as cc, toPropertyRowKey as cd, getLocalRecordReferenceType as ce, getRecordReferencePluginName as cf, _typeof as cg, resolveRecordReferenceValue as ch, _toArray as ci, AUTOMATION_ERROR_CODES as cj, SEGMENT_MEMBERSHIP_FIELD as ck, parsePropertyDataKey as cl, toPropertyGroupKey as cm, walkSegmentNodes as cn, segmentFieldRef as co, segmentReferenceRef as cp, segmentRelationRef as cq, DEFAULT_SEGMENT_TIME_ZONE as cr, normalizeSegmentOperator as cs, SegmentOperator as ct, PERIOD_OPERATORS as cu, zonedPeriodRange as cv, shiftZonedDays as cw, zonedDate as cx, isAnniversary as cy, _objectWithoutProperties as cz, getSubdomain as d, getAutomationNodeType as d$, STATUSES as d0, COMPANY_BUSINESS_TYPES as d1, DEFAULT_COMPANY_INDUSTRY_TYPES as d2, COMPANY_INDUSTRY_TYPES as d3, DEFAULT_SOCIAL_LINKS as d4, SOCIAL_LINKS as d5, DEFAULT_SEX_CHOICES as d6, SEX_OPTIONS as d7, DEFAULT_CONSTANT_VALUES as d8, USER_ROLES as d9, AUTOMATION_STATUSES as dA, AUTOMATION_CORE_ACTIONS as dB, AUTOMATION_CORE_TRIGGER_TYPES as dC, TAutomationFindObjectType as dD, AUTOMATION_EMAIL_RECIPIENTS_TYPES as dE, AUTOMATION_NON_DEFERRABLE_CORE_ACTIONS as dF, AUTOMATION_CORE_ACTION_DEFERRED as dG, AUTOMATION_DEFERRED_TIMEOUT as dH, BROADCAST_TRIGGER_TYPE as dI, BROADCAST_TARGET_TYPE as dJ, getTriggerTargetType as dK, EXECUTE_WAIT_TYPES as dL, TAutomationProducers as dM, TAutomationActionFolks as dN, automationSchema as dO, AUTOMATION_EXECUTION_STATUS as dP, automationExecutionSchema as dQ, aiAgentSchema as dR, resolveFromSourceField as dS, matchAutomationResolverKey as dT, getValueByPath as dU, AUTOMATION_OUTPUT_ITEM_COUNT as dV, isReEnrollableTrigger as dW, isReEnrollingTrigger as dX, resolveAutomationActionInputs as dY, resolveOutputPathsByNodeType as dZ, replaceOutputPlaceholders as d_, USER_PROPERTIES_INFO as da, STRUCTURE_STATUSES as db, USER_MOVEMENT_STATUSES as dc, CUSTOMER_SELECT_OPTIONS as dd, USER_EXTENDED_FIELDS as de, USER_EXPORT_EXTENDED_FIELDS as df, INPUT_TYPE as dg, customFieldSchema as dh, ruleSchema as di, attachmentSchema as dj, initRecordReferences as dk, createEventHandlers as dl, setEventHandlerRuntimeContext as dm, generateEventHandlersFromRequest as dn, appSchema as dp, buildSetPropertyModifier as dq, getSetPropertySelector as dr, setProperty as ds, getContentType as dt, getModuleName as du, getPluginName as dv, splitType as dw, startAutomations as dx, AUTOMATION_PROPERTY_OPERATORS as dy, STATIC_PLACEHOLDER as dz, getSaasCoreConnection as e, EvaluateFieldsInput as e$, toTransportOutput as e0, normalizeAutomationConstantsForTransport as e1, buildRuntimeOutputsIndex as e2, AutomationBaseInput as e3, AutomationExecActionInput as e4, AutomationExecutionInput as e5, AutomationActionInput as e6, ReceiveActionsInputData as e7, ReceiveActionsInput as e8, CheckCustomTriggerInputData as e9, segmentQueueFor as eA, scheduleSegmentReconcile as eB, sendSegmentChanged as eC, sendSegmentReconcile as eD, sendSegmentRebuild as eE, sendSegmentForget as eF, segmentJoinChanges as eG, gatherSegmentEventTypes as eH, gatherSegmentRecordTypes as eI, gatherSegmentFieldSources as eJ, gatherSegmentJoinPaths as eK, zonedDayStart as eL, isLeapYear as eM, anniversaryRanges as eN, collectSegmentValueRefs as eO, collectSegmentReferences as eP, hasSegmentReferenceInRelation as eQ, DEFAULT_SEGMENT_VALUE_FIELD as eR, resolveSegmentFieldOperators as eS, resolveSegmentFieldDependencies as eT, resolveSegmentValueField as eU, SEGMENT_OPERATOR_SPECS as eV, SEGMENT_IMPLICIT_OPERATORS as eW, initSegmentProducers as eX, TSegmentProducers as eY, SegmentNodeSchema as eZ, SegmentBaseInput as e_, FindObjectInputData as ea, ResolveOutputPathsInputData as eb, SetPropertiesInputData as ec, GenerateAiContextInputData as ed, LoadAiKnowledgeDocumentBatchInputData as ee, LookupAiToolInputData as ef, CheckCustomTriggerInput as eg, FindObjectInput as eh, ResolveOutputPathsInput as ei, SetPropertiesInput as ej, GenerateAiContextInput as ek, LoadAiKnowledgeDocumentBatchInput as el, LookupAiToolInput as em, sendAutomationTrigger as en, sendAutomationRun as eo, sendAutomationDeferredCompletion as ep, SEGMENT_TEXT_OPERATORS as eq, SEGMENT_ID_OPERATORS as er, SEGMENT_NUMBER_OPERATORS as es, SEGMENT_DATE_OPERATORS as et, SEGMENT_BOOLEAN_OPERATORS as eu, SegmentField as ev, segmentDependencyKey as ew, segmentDependencies as ex, segmentDependsOnClock as ey, SEGMENT_QUEUES as ez, createScopedEventHandlers as f, InsertImportRowsInputSchema as f$, ListSegmentMembersInput as f0, CountSegmentMembersInput as f1, ApplyMembershipInput as f2, PROPERTY_GROUP_KEY_PREFIX as f3, PROPERTY_ROW_KEY_SEP as f4, PROPERTY_ANY_ROW_KEY_SEP as f5, isPropertyDataPath as f6, fieldIdFromPropertyDataPath as f7, propertyDataExistsFilter as f8, propertyDataRegexFilter as f9, normalizeApprovalConfig as fA, initApproval as fB, APPROVAL_LOCK_STATUSES as fC, APPROVAL_APPROVER_SCOPES as fD, APPROVAL_MODES as fE, APPROVAL_REQUEST_STATUSES as fF, APPROVAL_REQUEST_KINDS as fG, APPROVAL_DECISIONS as fH, APPROVAL_NOTIFICATION_CONTENT_TYPE as fI, APPROVAL_NOTIFICATION_ACTIONS as fJ, TApprovalChangeProducers as fK, approvalLockCheckInputSchema as fL, approvalLockStatesInputSchema as fM, approvalLockCreateInputSchema as fN, approvalRequestCreateInputSchema as fO, approvalChangeApplyInputSchema as fP, clientPortalSchema as fQ, cpNotificationConfigUserSchema as fR, cpTwoFactor as fS, cpNotificationSettingsSchema as fT, refreshTokenSchema as fU, socialAuthProviderSchema as fV, fcmDeviceSchema as fW, cpUserSchema as fX, USER_TYPES as fY, commentSchema as fZ, cpNotificationSchema as f_, PROPERTY_ROW_INDEX_SEP as fa, initPropertyProducers as fb, TPropertyProducers as fc, PropertyValueUsageInput as fd, UNKNOWN_VALUE_SAMPLES as fe, UNKNOWN_VALUE_COUNTS as ff, unknownValueUsage as fg, measurePropertyValueSamples as fh, measurePropertyValueCounts as fi, measurePropertyValueUsage as fj, logsSchema as fk, activityLogsSchema as fl, EMAIL_LANES as fm, emailAddressSchema as fn, emailDeliverySchema as fo, EMAIL_RAMP_ID as fp, emailRampSchema as fq, emailSenderSchema as fr, notificationSchema as fs, notificationSettingsSchema as ft, notificationZTypeSchema as fu, sendNotification as fv, sendNotificationChannels as fw, approvalChangePluginName as fx, normalizeApprovalChangeType as fy, localApprovalChangeType as fz, getEnv as g, TImportExportProducers as g0, startImportExportWorker as g1, InsertImportRowsInput as g2, GetExportHeadersInput as g3, BatchSkipRowInput as g4, GetExportDataInput as g5, InsertImportRowsOutput as g6, GetImportHeadersInput as g7, GetImportHeadersOutput as g8, getImportExportJobOptions as g9, toTerminalImportExportError as ga, logImportExportEvent as gb, safeCleanup as gc, AUTO_MATCH_CONFIDENCE as gd, SUGGEST_CONFIDENCE as ge, normalizeHeader as gf, matchImportHeaders as gg, processCSVStream as gh, countCsvDataRows as gi, _slicedToArray as h, _objectSpread2 as i, chunkArray as j, _createForOfIteratorHelper as k, logHandler as l, _createClass as m, _classCallCheck as n, isValidURL as o, sendTRPCMessage as p, _inherits as q, runBeforeResolvers as r, sendWorkerQueue as s, _wrapNativeSuper as t, userHeaderName as u, _callSuper as v, _defineProperty as w, _toConsumableArray as x, apolloCustomScalars as y, generateApolloContext as z };