@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.
- package/core-modules/dist/erxes-api-shared-core-modules.cjs.dev.js +5 -1
- package/core-modules/dist/erxes-api-shared-core-modules.cjs.prod.js +5 -1
- package/core-modules/dist/erxes-api-shared-core-modules.esm.js +2 -2
- package/dist/declarations/src/core-modules/automations/constants.d.ts +6 -0
- package/dist/declarations/src/core-modules/automations/constants.d.ts.map +1 -1
- package/dist/declarations/src/core-modules/automations/outputResolvers.d.ts +29 -0
- package/dist/declarations/src/core-modules/automations/outputResolvers.d.ts.map +1 -1
- package/dist/declarations/src/core-modules/automations/types.d.ts +40 -1
- package/dist/declarations/src/core-modules/automations/types.d.ts.map +1 -1
- package/dist/declarations/src/core-modules/automations/utils.d.ts +2 -1
- package/dist/declarations/src/core-modules/automations/utils.d.ts.map +1 -1
- package/dist/declarations/src/core-modules/notifications/definitions/emailAddresses.d.ts +6 -0
- package/dist/declarations/src/core-modules/notifications/definitions/emailAddresses.d.ts.map +1 -1
- package/dist/{start-plugin-6687b329.cjs.dev.js → start-plugin-2944ceaa.cjs.dev.js} +287 -222
- package/dist/{start-plugin-46baacee.cjs.prod.js → start-plugin-7ebe8e9b.cjs.prod.js} +287 -222
- package/dist/{start-plugin-2b3e89f5.esm.js → start-plugin-b4d9fece.esm.js} +284 -223
- package/package.json +1 -1
- package/src/core-modules/automations/constants.ts +26 -0
- package/src/core-modules/automations/outputResolvers.ts +8 -0
- package/src/core-modules/automations/types.ts +54 -1
- package/src/core-modules/automations/utils.ts +31 -2
- package/src/core-modules/notifications/definitions/emailAddresses.ts +15 -0
- package/utils/dist/erxes-api-shared-utils.cjs.dev.js +1 -1
- package/utils/dist/erxes-api-shared-utils.cjs.prod.js +1 -1
- package/utils/dist/erxes-api-shared-utils.esm.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@erxes/api-shared",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3-next.1",
|
|
4
4
|
"description": "Shared platform utilities for erxes backend plugins: plugin startup, tenant-scoped models, service discovery, messaging and core types.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATION_ACTION_CONTRIBUTIONS,
|
|
3
|
+
TAutomationActionPlacement,
|
|
4
|
+
} from './types';
|
|
5
|
+
|
|
1
6
|
export const AUTOMATION_PROPERTY_OPERATORS = {
|
|
2
7
|
SET: 'set',
|
|
3
8
|
CLEAR: 'clear',
|
|
@@ -141,6 +146,27 @@ export const AUTOMATION_CORE_ACTION_DEFERRED: Record<
|
|
|
141
146
|
[AUTOMATION_CORE_ACTIONS.AI_AGENT]: { mode: 'standby', timeoutMinutes: 3 },
|
|
142
147
|
};
|
|
143
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Core actions have no plugin constants either, so how they combine with the
|
|
151
|
+
* actions around them is declared here.
|
|
152
|
+
*/
|
|
153
|
+
export const AUTOMATION_CORE_ACTION_PLACEMENTS: Record<
|
|
154
|
+
string,
|
|
155
|
+
TAutomationActionPlacement
|
|
156
|
+
> = {
|
|
157
|
+
[AUTOMATION_CORE_ACTIONS.AI_AGENT]: {
|
|
158
|
+
accepts: [AUTOMATION_ACTION_CONTRIBUTIONS.REMEMBERED_RECORD_CHOICE],
|
|
159
|
+
},
|
|
160
|
+
[AUTOMATION_CORE_ACTIONS.SET_PROPERTY]: {
|
|
161
|
+
addsToPrevious: [
|
|
162
|
+
{
|
|
163
|
+
actionType: AUTOMATION_CORE_ACTIONS.AI_AGENT,
|
|
164
|
+
kind: AUTOMATION_ACTION_CONTRIBUTIONS.REMEMBERED_RECORD_CHOICE,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
144
170
|
export const AUTOMATION_DEFERRED_TIMEOUT = {
|
|
145
171
|
DEFAULT_MINUTES: 10,
|
|
146
172
|
MAX_MINUTES: 60,
|
|
@@ -793,6 +793,14 @@ const findAutomationNodeConstant = async (
|
|
|
793
793
|
});
|
|
794
794
|
};
|
|
795
795
|
|
|
796
|
+
/** The action's own declaration from its plugin, e.g. isTargetSource. */
|
|
797
|
+
export const getAutomationActionConstant = async (actionType: string) =>
|
|
798
|
+
(await findAutomationNodeConstant(actionType, ['actions'])) as
|
|
799
|
+
| (IAutomationsActionConfig & {
|
|
800
|
+
output?: TAutomationRuntimeOutputDefinition;
|
|
801
|
+
})
|
|
802
|
+
| undefined;
|
|
803
|
+
|
|
796
804
|
const getAutomationOutputDefinition = async (nodeType: string) =>
|
|
797
805
|
(
|
|
798
806
|
await findAutomationNodeConstant(nodeType, [
|
|
@@ -157,7 +157,44 @@ export type IAutomationDeferredMarker = {
|
|
|
157
157
|
timeoutMinutes?: number;
|
|
158
158
|
};
|
|
159
159
|
|
|
160
|
-
export
|
|
160
|
+
export const AUTOMATION_ACTION_CONTRIBUTIONS = {
|
|
161
|
+
// Acts on a record a sibling branch remembered: the agent picks which one.
|
|
162
|
+
REMEMBERED_RECORD_CHOICE: 'rememberedRecordChoice',
|
|
163
|
+
} as const;
|
|
164
|
+
|
|
165
|
+
export type TAutomationActionContribution =
|
|
166
|
+
(typeof AUTOMATION_ACTION_CONTRIBUTIONS)[keyof typeof AUTOMATION_ACTION_CONTRIBUTIONS];
|
|
167
|
+
|
|
168
|
+
export type TAutomationRememberConfig = {
|
|
169
|
+
// What a later step calls the record when it picks one: 'ticket' → the
|
|
170
|
+
// agent names it as `ticketId`. Not a UI label or a record type.
|
|
171
|
+
as: string;
|
|
172
|
+
// Kept with the record so one can be told from another.
|
|
173
|
+
fields: string[];
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export type TAutomationActionPlacement = {
|
|
177
|
+
/**
|
|
178
|
+
* Config this action takes when it runs after an action of the given type
|
|
179
|
+
* on the same path. The node's own config wins over it.
|
|
180
|
+
*/
|
|
181
|
+
defaultsWhenAfter?: {
|
|
182
|
+
actionType: string;
|
|
183
|
+
config: Record<string, unknown>;
|
|
184
|
+
}[];
|
|
185
|
+
/**
|
|
186
|
+
* What this action adds to an earlier action of the given type on its
|
|
187
|
+
* path. The earlier action must list the kind in `accepts`, so no action
|
|
188
|
+
* reaches into another's config uninvited.
|
|
189
|
+
*/
|
|
190
|
+
addsToPrevious?: {
|
|
191
|
+
actionType: string;
|
|
192
|
+
kind: TAutomationActionContribution;
|
|
193
|
+
}[];
|
|
194
|
+
accepts?: TAutomationActionContribution[];
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export type IAutomationsActionConfig = TAutomationActionPlacement & {
|
|
161
198
|
type?: string;
|
|
162
199
|
moduleName?: string;
|
|
163
200
|
collectionName?: string;
|
|
@@ -255,6 +292,11 @@ export type TAiContextHistoryItem = {
|
|
|
255
292
|
meta?: Record<string, unknown>;
|
|
256
293
|
};
|
|
257
294
|
|
|
295
|
+
export type TAiMemoryScope = {
|
|
296
|
+
type: string;
|
|
297
|
+
id: string;
|
|
298
|
+
};
|
|
299
|
+
|
|
258
300
|
export type TAiContext = {
|
|
259
301
|
version: 1;
|
|
260
302
|
input?: {
|
|
@@ -266,6 +308,12 @@ export type TAiContext = {
|
|
|
266
308
|
facts?: Record<string, unknown>;
|
|
267
309
|
memory?: {
|
|
268
310
|
scopeKey?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Everything this run is about, as content type and id — the conversation,
|
|
313
|
+
* the customer. Long-term memory is written under all of them and read
|
|
314
|
+
* back by any, so it outlives the channel it was made in.
|
|
315
|
+
*/
|
|
316
|
+
scopes?: TAiMemoryScope[];
|
|
269
317
|
};
|
|
270
318
|
};
|
|
271
319
|
|
|
@@ -365,6 +413,11 @@ export type TAutomationFindObjectResult = {
|
|
|
365
413
|
field: string;
|
|
366
414
|
value: string;
|
|
367
415
|
};
|
|
416
|
+
// A later request about the same matter is added to this record (true) or
|
|
417
|
+
// starts a new one (false): an open ticket takes it, a resolved one does not.
|
|
418
|
+
// It says nothing about editing, assigning or reopening — people and other
|
|
419
|
+
// automations still change the record as before. Absent means true.
|
|
420
|
+
acceptsFollowUp?: boolean;
|
|
368
421
|
};
|
|
369
422
|
|
|
370
423
|
type TAutomationAdditionalAttribute = {
|
|
@@ -927,6 +927,26 @@ const getAutomationBaseType = (type: string) => {
|
|
|
927
927
|
: `${pluginName}:${moduleName}`;
|
|
928
928
|
};
|
|
929
929
|
|
|
930
|
+
// The record an earlier action produced or found: Create returns targetId,
|
|
931
|
+
// Find object returns objectId and the object itself.
|
|
932
|
+
const getTargetActionRecord = (
|
|
933
|
+
execution: IPropertyProps<unknown>['execution'],
|
|
934
|
+
targetActionId: string,
|
|
935
|
+
) => {
|
|
936
|
+
const result = (execution.actions || []).find(
|
|
937
|
+
({ actionId }) => actionId === targetActionId,
|
|
938
|
+
)?.result as
|
|
939
|
+
| { targetId?: unknown; objectId?: unknown; object?: unknown }
|
|
940
|
+
| undefined;
|
|
941
|
+
const object =
|
|
942
|
+
result?.object && typeof result.object === 'object'
|
|
943
|
+
? (result.object as Record<string, unknown>)
|
|
944
|
+
: {};
|
|
945
|
+
const id = result?.objectId ?? result?.targetId ?? object._id;
|
|
946
|
+
|
|
947
|
+
return { id: id == null ? '' : String(id), object };
|
|
948
|
+
};
|
|
949
|
+
|
|
930
950
|
export const getSetPropertySelector = async ({
|
|
931
951
|
subdomain,
|
|
932
952
|
module,
|
|
@@ -934,6 +954,7 @@ export const getSetPropertySelector = async ({
|
|
|
934
954
|
targetType,
|
|
935
955
|
relation,
|
|
936
956
|
targetPath,
|
|
957
|
+
targetActionId,
|
|
937
958
|
}: {
|
|
938
959
|
subdomain: string;
|
|
939
960
|
module: string;
|
|
@@ -944,9 +965,17 @@ export const getSetPropertySelector = async ({
|
|
|
944
965
|
relatedContentType: string;
|
|
945
966
|
};
|
|
946
967
|
targetPath?: string;
|
|
968
|
+
// Set when the action's target is an earlier action's record, not the
|
|
969
|
+
// trigger's: the record's id has to come from that action, not the trigger.
|
|
970
|
+
targetActionId?: string;
|
|
947
971
|
}) => {
|
|
948
|
-
const
|
|
949
|
-
|
|
972
|
+
const actionRecord = targetActionId
|
|
973
|
+
? getTargetActionRecord(execution, targetActionId)
|
|
974
|
+
: undefined;
|
|
975
|
+
const target = actionRecord ? actionRecord.object : execution.target || {};
|
|
976
|
+
const targetId = actionRecord
|
|
977
|
+
? actionRecord.id
|
|
978
|
+
: String(execution.targetId || target._id || '');
|
|
950
979
|
|
|
951
980
|
if (targetPath) {
|
|
952
981
|
const { found, value } = getValueByPath(target, targetPath);
|
|
@@ -7,6 +7,15 @@ export type TEmailSuppressionReason =
|
|
|
7
7
|
| 'screened'
|
|
8
8
|
| 'manual';
|
|
9
9
|
|
|
10
|
+
export type TEmailScreenReason = 'syntax' | 'no_mx' | 'disposable' | 'random';
|
|
11
|
+
|
|
12
|
+
export const EMAIL_SCREEN_REASONS: TEmailScreenReason[] = [
|
|
13
|
+
'syntax',
|
|
14
|
+
'no_mx',
|
|
15
|
+
'disposable',
|
|
16
|
+
'random',
|
|
17
|
+
];
|
|
18
|
+
|
|
10
19
|
export type TEmailLane = 'proven' | 'unknown' | 'suppressed';
|
|
11
20
|
|
|
12
21
|
export const EMAIL_LANES: TEmailLane[] = ['proven', 'unknown', 'suppressed'];
|
|
@@ -26,6 +35,7 @@ export interface IEmailAddressDocument extends Document {
|
|
|
26
35
|
|
|
27
36
|
suppressedAt?: Date;
|
|
28
37
|
suppressionReason?: TEmailSuppressionReason;
|
|
38
|
+
screenReason?: TEmailScreenReason;
|
|
29
39
|
suppressedBy?: string;
|
|
30
40
|
|
|
31
41
|
releasedAt?: Date;
|
|
@@ -74,6 +84,11 @@ export const emailAddressSchema = new Schema({
|
|
|
74
84
|
enum: ['hard_bounce', 'complaint', 'unsubscribe', 'screened', 'manual'],
|
|
75
85
|
},
|
|
76
86
|
|
|
87
|
+
screenReason: {
|
|
88
|
+
type: String,
|
|
89
|
+
enum: EMAIL_SCREEN_REASONS,
|
|
90
|
+
},
|
|
91
|
+
|
|
77
92
|
suppressedBy: {
|
|
78
93
|
type: String,
|
|
79
94
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var startPlugin = require('../../dist/start-plugin-
|
|
5
|
+
var startPlugin = require('../../dist/start-plugin-2944ceaa.cjs.dev.js');
|
|
6
6
|
var mongoose = require('mongoose');
|
|
7
7
|
var stream$1 = require('stream');
|
|
8
8
|
var _loadash = require('lodash');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var startPlugin = require('../../dist/start-plugin-
|
|
5
|
+
var startPlugin = require('../../dist/start-plugin-7ebe8e9b.cjs.prod.js');
|
|
6
6
|
var mongoose = require('mongoose');
|
|
7
7
|
var stream$1 = require('stream');
|
|
8
8
|
var _loadash = require('lodash');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as userHeaderName, g as getEnv, c as connect, _ as _asyncToGenerator, a as _regeneratorRuntime, b as coreModelOrganizations, d as getSubdomain, e as getSaasCoreConnection, f as createScopedEventHandlers, h as _slicedToArray, l as logHandler, r as runBeforeResolvers, s as sendWorkerQueue, i as _objectSpread2, j as chunkArray, k as _createForOfIteratorHelper, m as _createClass, n as _classCallCheck, o as isValidURL, p as sendTRPCMessage, q as _inherits, t as _wrapNativeSuper, v as _callSuper, w as _defineProperty, x as _toConsumableArray } from '../../dist/start-plugin-
|
|
2
|
-
export { K as AGENT_TOOL_DEFAULT_MAX_RESPONSE_BYTES, ak as DEFAULT_JOB_OPTIONS, c1 as EXPECTED_ERROR_NAME, c2 as ExpectedError, aU as GP_STATUS, W as HEADER_SIZE_WARN_BYTES, bc as MAX_HEADER_BYTES, aA as ORGANIZATION_ID_MAPPING, T as TBeforeResolversProducers, V as USER_HEADER_OMITTED_FIELDS, N as agentToolResponseTooLargeError, F as agentToolsAuthHeaderName, y as apolloCustomScalars, bn as applyTrustProxy, bp as authCookieOptions, I as buildAgentToolManifest, bW as buildCursorQuery, ag as buildSearchTokenFilter, D as checkBeforeResolvers, aa as checkCollectionCodeDuplication, bM as checkServiceRunning, by as checkUserIds, j as chunkArray, c4 as classifyError, b$ as cleanHtml, b5 as clearServiceDiscoveryCache, P as clientPortalHeaderName, ad as closeMongooose, X as compactUserForHeader, ah as configureSchemaSearchTokens, c as connect, bo as connectionOptions, ar as coreModelAddons, as as coreModelBundles, av as coreModelEndpoints, ay as coreModelExperiences, at as coreModelInstallations, az as coreModelOrganizationPlanHistories, b as coreModelOrganizations, ax as coreModelPlugins, aw as coreModelPromoCodes, au as coreModelUsers, Q as cpUserHeaderName, c3 as createExpectedError, bL as createHealthRoute, al as createMQWorkerWithListeners, bh as createPluginTRPCContext, bi as createTRPCContext, a8 as cursorPaginate, a9 as cursorPaginateAggregation, bH as dateToShortStr, H as decodeAgentToolsAuthHeader, bV as decodeCursor, bg as decodeTRPCContextHeader, a7 as defaultPaginate, G as encodeAgentToolsAuthHeader, bU as encodeCursor, bf as encodeTRPCContextHeader, bk as err, bu as escapeRegExp, E as expectedErrorPlugin, S as extractCPUserFromHeader, U as extractClientPortalFromHeader, c6 as extractMessage, R as extractUserFromHeader, bx as fixDate, bG as fixNum, bP as flattenObject, z as generateApolloContext, af as generateConfiguredSearchTokens, bN as generateRequestProcess, b3 as getActivePlugins, L as getAgentToolMaxResponseBytes, b4 as getAvailablePlugins, bt as getCoreDomain, bA as getDate, bO as getDiffObjects, g as getEnv, bC as getFullDate, aY as getGlobalProfileV2Plugins, bF as getNextMonth, b6 as getPlugin, ba as getPluginAddress, b1 as getPlugins, bD as getPureDate, e as getSaasCoreConnection, aT as getSaasOrgPromoCodes, aO as getSaasOrganizationActiveAddons, aH as getSaasOrganizationByHelpCenterDomain, aM as getSaasOrganizationDetail, aI as getSaasOrganizationHelpCenterDomains, aB as getSaasOrganizationIdBySubdomain, aN as getSaasOrganizationPlanHistories, aD as getSaasOrganizations, aE as getSaasOrganizationsByFilter, aJ as getSaasOrganizationsWithPendingHelpCenterDomain, aC as getSaasOrgsCache, aR as getSaasPlugin, aQ as getSaasPlugins, aS as getSaasPromoCodes, ai as getSchemaSearchTokenConfig, d as getSubdomain, bB as getToday, bE as getTomorrow, bm as getTrustProxySetting, bz as getUniqueValue, O as graphqlPubsub, aG as helpCenterDomainsOf, c8 as initErxesSentry, bb as initializePluginConfig, a$ as isDev, b9 as isEnabled, c5 as isExpectedError, aV as isGlobalProfileV2, bJ as isImage, o as isValidURL, bK as isVideo, b7 as joinErxesGateway, b0 as keyForConfig, b8 as leaveErxesGateway, l as logHandler, B as markResolvers, a3 as mongoStringRequired, ac as mongooseConnectionOptions, a5 as mongooseField, a2 as mongooseStringNonBlank, a1 as mongooseStringRandomId, a4 as mongooseStringRequiredNonBlank, J as mountAgentTools, bj as ok, M as oversizedAgentToolResultBytes, bq as paginate, aX as pluginsFromStripe, aW as pluginsOfStripeItem, bw as pluralFormation, c0 as random, an as randomAlphanumeric, ao as randomLowercase, bR as readFileFromStorage, bS as readFileStreamFromStorage, bQ as readFileUrl, ap as redis, bs as regexSearchText, bZ as removeExtraSpaces, bY as removeLastTrailingSlash, aP as removeOrgsCache, aL as removeSaasOrganizationHelpCenterDomain, aq as resetConfigsCache, r as runBeforeResolvers, aZ as sanitizeFilename, a_ as sanitizeKey, aK as saveSaasOrganizationHelpCenterDomain, ab as schemaWrapper, bl as sendCoreModuleProducer, p as sendTRPCMessage, am as sendWorkerMessage, s as sendWorkerQueue, c7 as sentryExpectedErrorFilter, b2 as setActivePlugins, Z as setCPUserHeader, $ as setClientPortalHeader, Y as setUserHeader, bI as shortStrToDate, ae as splitSearchWords, b_ as splitStr, a0 as startAfterProcess, C as startBeforeResolvers, bd as startPlugin, bX as stripAnsi, aj as toSerializablePayload, be as trpcContextHeaderName, a6 as updateMongoDocumentOrder, bv as updateOrder, aF as updateSaasOrganization, bT as uploadFileToStorage, u as userHeaderName, br as validSearchText, A as wrapApolloResolvers } from '../../dist/start-plugin-
|
|
1
|
+
import { u as userHeaderName, g as getEnv, c as connect, _ as _asyncToGenerator, a as _regeneratorRuntime, b as coreModelOrganizations, d as getSubdomain, e as getSaasCoreConnection, f as createScopedEventHandlers, h as _slicedToArray, l as logHandler, r as runBeforeResolvers, s as sendWorkerQueue, i as _objectSpread2, j as chunkArray, k as _createForOfIteratorHelper, m as _createClass, n as _classCallCheck, o as isValidURL, p as sendTRPCMessage, q as _inherits, t as _wrapNativeSuper, v as _callSuper, w as _defineProperty, x as _toConsumableArray } from '../../dist/start-plugin-b4d9fece.esm.js';
|
|
2
|
+
export { K as AGENT_TOOL_DEFAULT_MAX_RESPONSE_BYTES, ak as DEFAULT_JOB_OPTIONS, c1 as EXPECTED_ERROR_NAME, c2 as ExpectedError, aU as GP_STATUS, W as HEADER_SIZE_WARN_BYTES, bc as MAX_HEADER_BYTES, aA as ORGANIZATION_ID_MAPPING, T as TBeforeResolversProducers, V as USER_HEADER_OMITTED_FIELDS, N as agentToolResponseTooLargeError, F as agentToolsAuthHeaderName, y as apolloCustomScalars, bn as applyTrustProxy, bp as authCookieOptions, I as buildAgentToolManifest, bW as buildCursorQuery, ag as buildSearchTokenFilter, D as checkBeforeResolvers, aa as checkCollectionCodeDuplication, bM as checkServiceRunning, by as checkUserIds, j as chunkArray, c4 as classifyError, b$ as cleanHtml, b5 as clearServiceDiscoveryCache, P as clientPortalHeaderName, ad as closeMongooose, X as compactUserForHeader, ah as configureSchemaSearchTokens, c as connect, bo as connectionOptions, ar as coreModelAddons, as as coreModelBundles, av as coreModelEndpoints, ay as coreModelExperiences, at as coreModelInstallations, az as coreModelOrganizationPlanHistories, b as coreModelOrganizations, ax as coreModelPlugins, aw as coreModelPromoCodes, au as coreModelUsers, Q as cpUserHeaderName, c3 as createExpectedError, bL as createHealthRoute, al as createMQWorkerWithListeners, bh as createPluginTRPCContext, bi as createTRPCContext, a8 as cursorPaginate, a9 as cursorPaginateAggregation, bH as dateToShortStr, H as decodeAgentToolsAuthHeader, bV as decodeCursor, bg as decodeTRPCContextHeader, a7 as defaultPaginate, G as encodeAgentToolsAuthHeader, bU as encodeCursor, bf as encodeTRPCContextHeader, bk as err, bu as escapeRegExp, E as expectedErrorPlugin, S as extractCPUserFromHeader, U as extractClientPortalFromHeader, c6 as extractMessage, R as extractUserFromHeader, bx as fixDate, bG as fixNum, bP as flattenObject, z as generateApolloContext, af as generateConfiguredSearchTokens, bN as generateRequestProcess, b3 as getActivePlugins, L as getAgentToolMaxResponseBytes, b4 as getAvailablePlugins, bt as getCoreDomain, bA as getDate, bO as getDiffObjects, g as getEnv, bC as getFullDate, aY as getGlobalProfileV2Plugins, bF as getNextMonth, b6 as getPlugin, ba as getPluginAddress, b1 as getPlugins, bD as getPureDate, e as getSaasCoreConnection, aT as getSaasOrgPromoCodes, aO as getSaasOrganizationActiveAddons, aH as getSaasOrganizationByHelpCenterDomain, aM as getSaasOrganizationDetail, aI as getSaasOrganizationHelpCenterDomains, aB as getSaasOrganizationIdBySubdomain, aN as getSaasOrganizationPlanHistories, aD as getSaasOrganizations, aE as getSaasOrganizationsByFilter, aJ as getSaasOrganizationsWithPendingHelpCenterDomain, aC as getSaasOrgsCache, aR as getSaasPlugin, aQ as getSaasPlugins, aS as getSaasPromoCodes, ai as getSchemaSearchTokenConfig, d as getSubdomain, bB as getToday, bE as getTomorrow, bm as getTrustProxySetting, bz as getUniqueValue, O as graphqlPubsub, aG as helpCenterDomainsOf, c8 as initErxesSentry, bb as initializePluginConfig, a$ as isDev, b9 as isEnabled, c5 as isExpectedError, aV as isGlobalProfileV2, bJ as isImage, o as isValidURL, bK as isVideo, b7 as joinErxesGateway, b0 as keyForConfig, b8 as leaveErxesGateway, l as logHandler, B as markResolvers, a3 as mongoStringRequired, ac as mongooseConnectionOptions, a5 as mongooseField, a2 as mongooseStringNonBlank, a1 as mongooseStringRandomId, a4 as mongooseStringRequiredNonBlank, J as mountAgentTools, bj as ok, M as oversizedAgentToolResultBytes, bq as paginate, aX as pluginsFromStripe, aW as pluginsOfStripeItem, bw as pluralFormation, c0 as random, an as randomAlphanumeric, ao as randomLowercase, bR as readFileFromStorage, bS as readFileStreamFromStorage, bQ as readFileUrl, ap as redis, bs as regexSearchText, bZ as removeExtraSpaces, bY as removeLastTrailingSlash, aP as removeOrgsCache, aL as removeSaasOrganizationHelpCenterDomain, aq as resetConfigsCache, r as runBeforeResolvers, aZ as sanitizeFilename, a_ as sanitizeKey, aK as saveSaasOrganizationHelpCenterDomain, ab as schemaWrapper, bl as sendCoreModuleProducer, p as sendTRPCMessage, am as sendWorkerMessage, s as sendWorkerQueue, c7 as sentryExpectedErrorFilter, b2 as setActivePlugins, Z as setCPUserHeader, $ as setClientPortalHeader, Y as setUserHeader, bI as shortStrToDate, ae as splitSearchWords, b_ as splitStr, a0 as startAfterProcess, C as startBeforeResolvers, bd as startPlugin, bX as stripAnsi, aj as toSerializablePayload, be as trpcContextHeaderName, a6 as updateMongoDocumentOrder, bv as updateOrder, aF as updateSaasOrganization, bT as uploadFileToStorage, u as userHeaderName, br as validSearchText, A as wrapApolloResolvers } from '../../dist/start-plugin-b4d9fece.esm.js';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
import { Transform } from 'stream';
|
|
5
5
|
import { keyBy } from 'lodash';
|