@gravity-rail/sdk 0.7.1 → 0.7.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.
- package/dist/{chunk-PEWFZXNK.js → chunk-YCASSXLL.js} +856 -2
- package/dist/chunk-YCASSXLL.js.map +1 -0
- package/dist/{client-CLxHFOeB.d.cts → client-B_cweJhP.d.cts} +138 -36
- package/dist/{client-Dft3Kmkn.d.ts → client-C-on7whi.d.ts} +138 -36
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/index.cjs +2090 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +276 -3
- package/dist/index.d.ts +276 -3
- package/dist/index.js +1223 -1
- package/dist/index.js.map +1 -1
- package/dist/{inquiries-BIlL6Obb.d.cts → inquiries-BX3PuU-7.d.cts} +1 -1
- package/dist/{inquiries-BIlL6Obb.d.ts → inquiries-BX3PuU-7.d.ts} +1 -1
- package/dist/internal.cjs +856 -1
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +4 -4
- package/dist/internal.d.ts +4 -4
- package/dist/internal.js +3 -1
- package/dist/schemas.d.cts +2 -2
- package/dist/schemas.d.ts +2 -2
- package/dist/{index-CeVDRf6l.d.cts → scopes-CNbQi30F.d.cts} +3 -3
- package/dist/{index-D1G8EKz2.d.ts → scopes-ColqadkM.d.ts} +3 -3
- package/package.json +2 -2
- package/dist/chunk-PEWFZXNK.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -27,7 +27,9 @@ __export(src_exports, {
|
|
|
27
27
|
AccessGrantStatus: () => AccessGrantStatus,
|
|
28
28
|
AccessGrantTrigger: () => AccessGrantTrigger,
|
|
29
29
|
AccessLevel: () => AccessLevel2,
|
|
30
|
+
AgentBuilder: () => AgentBuilder,
|
|
30
31
|
ApiError: () => ApiError,
|
|
32
|
+
ApplyError: () => ApplyError,
|
|
31
33
|
AppsApi: () => AppsApi,
|
|
32
34
|
AttendeeResponseStatus: () => AttendeeResponseStatus,
|
|
33
35
|
AttendeeStatus: () => AttendeeStatus,
|
|
@@ -64,19 +66,25 @@ __export(src_exports, {
|
|
|
64
66
|
FhirClientType: () => FhirClientType,
|
|
65
67
|
FhirConnectionState: () => FhirConnectionState,
|
|
66
68
|
FhirVendor: () => FhirVendor,
|
|
69
|
+
FormBuilder: () => FormBuilder,
|
|
67
70
|
GravityRailClient: () => GravityRailClient,
|
|
68
71
|
IndexStatus: () => IndexStatus,
|
|
69
72
|
InvitationStatus: () => InvitationStatus,
|
|
70
73
|
JobPosition: () => JobPosition,
|
|
74
|
+
JourneyBuilder: () => JourneyBuilder,
|
|
75
|
+
JourneyStepBuilder: () => JourneyStepBuilder,
|
|
71
76
|
MASKED_SECRET_SENTINEL: () => MASKED_SECRET_SENTINEL,
|
|
72
77
|
McpServerState: () => McpServerState,
|
|
73
78
|
MemberFeature: () => MemberFeature,
|
|
79
|
+
MemberFilterBuilder: () => MemberFilterBuilder,
|
|
80
|
+
MemberLabelBuilder: () => MemberLabelBuilder,
|
|
74
81
|
MemberType: () => MemberType,
|
|
75
82
|
MenuItemResponseItemType: () => MenuItemResponseItemType,
|
|
76
83
|
MenuItemType: () => MenuItemResponseItemType,
|
|
77
84
|
ModelProvider: () => ModelProvider,
|
|
78
85
|
ModelType: () => ModelType,
|
|
79
86
|
NO_ASSISTANT_PARTICIPANT_CHAT_TYPES: () => NO_ASSISTANT_PARTICIPANT_CHAT_TYPES,
|
|
87
|
+
NotificationRuleBuilder: () => NotificationRuleBuilder,
|
|
80
88
|
OIDCAdminConfigViewProviderType: () => OIDCAdminConfigViewProviderType,
|
|
81
89
|
ORG_ONLY_RESOURCES: () => ORG_ONLY_RESOURCES,
|
|
82
90
|
OrgApi: () => OrgApi,
|
|
@@ -102,6 +110,8 @@ __export(src_exports, {
|
|
|
102
110
|
Region: () => Region,
|
|
103
111
|
RegistrationIdentifier: () => RegistrationIdentifier,
|
|
104
112
|
Resource: () => Resource,
|
|
113
|
+
RoleUpdate: () => RoleUpdate,
|
|
114
|
+
RoutineBuilder: () => RoutineBuilder,
|
|
105
115
|
SCOPES: () => SCOPES,
|
|
106
116
|
SCOPE_PRESETS: () => SCOPE_PRESETS,
|
|
107
117
|
SMS_DELIVERY_FAILURE_STATUSES: () => SMS_DELIVERY_FAILURE_STATUSES,
|
|
@@ -121,15 +131,19 @@ __export(src_exports, {
|
|
|
121
131
|
TTS_MODEL_ELEVENLABS_TURBO: () => TTS_MODEL_ELEVENLABS_TURBO,
|
|
122
132
|
TTS_MODEL_POCKET: () => TTS_MODEL_POCKET,
|
|
123
133
|
TTS_PREVIEW_PROVIDERS: () => TTS_PREVIEW_PROVIDERS,
|
|
134
|
+
TaskBuilder: () => TaskBuilder,
|
|
124
135
|
TemplatesApi: () => TemplatesApi,
|
|
125
136
|
ToolkitState: () => ToolkitState,
|
|
126
137
|
WorkflowAccessWarningResourceType: () => WorkflowAccessWarningResourceType,
|
|
138
|
+
WorkflowBuilder: () => WorkflowBuilder,
|
|
127
139
|
WorkflowResourceType: () => WorkflowAccessWarningResourceType,
|
|
140
|
+
WorkspaceBuilder: () => WorkspaceBuilder,
|
|
128
141
|
WorkspaceFeature: () => WorkspaceFeature,
|
|
129
142
|
WorkspaceProvisionStatus: () => WorkspaceProvisionStatus,
|
|
130
143
|
areDependenciesSatisfied: () => areDependenciesSatisfied,
|
|
131
144
|
canPreviewVoice: () => canPreviewVoice,
|
|
132
145
|
clearRegistry: () => clearRegistry,
|
|
146
|
+
createWorkspaceClient: () => createWorkspaceClient,
|
|
133
147
|
decodePermissions: () => decodePermissions,
|
|
134
148
|
encodePermissions: () => encodePermissions,
|
|
135
149
|
eventRuleActionParams: () => eventRuleActionParams,
|
|
@@ -154,6 +168,7 @@ __export(src_exports, {
|
|
|
154
168
|
isRegistryInitialized: () => isRegistryInitialized,
|
|
155
169
|
isSMSDeliveryFailureStatus: () => isSMSDeliveryFailureStatus,
|
|
156
170
|
requiresAssistantParticipant: () => requiresAssistantParticipant,
|
|
171
|
+
runWorkspaceScript: () => runWorkspaceScript,
|
|
157
172
|
usesBuiltinAssistant: () => usesBuiltinAssistant,
|
|
158
173
|
validateFeatureDependencies: () => validateFeatureDependencies
|
|
159
174
|
});
|
|
@@ -778,6 +793,13 @@ var AgentsApi = class extends BaseApiClient {
|
|
|
778
793
|
method: "POST"
|
|
779
794
|
});
|
|
780
795
|
}
|
|
796
|
+
/** Resolve runtime tools for an agent on a simulated channel. */
|
|
797
|
+
async resolveAgentTools(wid, id, options) {
|
|
798
|
+
const params = new URLSearchParams();
|
|
799
|
+
params.append("channel", options.channel);
|
|
800
|
+
params.append("taskId", options.taskId.toString());
|
|
801
|
+
return this.fetch(`w/${wid}/agents/${id}/resolve-tools?${params}`);
|
|
802
|
+
}
|
|
781
803
|
};
|
|
782
804
|
|
|
783
805
|
// src/api/ai-models.ts
|
|
@@ -1712,6 +1734,23 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
1712
1734
|
|
|
1713
1735
|
// src/api/calls.ts
|
|
1714
1736
|
var CallsApi = class extends BaseApiClient {
|
|
1737
|
+
/** List workspace phone calls with optional filtering. */
|
|
1738
|
+
async getPhoneCalls(wid, options = {}) {
|
|
1739
|
+
const params = new URLSearchParams();
|
|
1740
|
+
if (options.page) params.set("page", String(options.page));
|
|
1741
|
+
if (options.pageSize) params.set("pageSize", String(options.pageSize));
|
|
1742
|
+
if (options.phoneNumberId !== void 0)
|
|
1743
|
+
params.set("phoneNumberId", String(options.phoneNumberId));
|
|
1744
|
+
if (options.chatId !== void 0) params.set("chatId", String(options.chatId));
|
|
1745
|
+
if (options.workflowId !== void 0) params.set("workflowId", String(options.workflowId));
|
|
1746
|
+
if (options.status) params.set("status", options.status);
|
|
1747
|
+
if (options.inbound !== void 0) params.set("inbound", String(options.inbound));
|
|
1748
|
+
if (options.dateFrom) params.set("dateFrom", options.dateFrom);
|
|
1749
|
+
if (options.dateTo) params.set("dateTo", options.dateTo);
|
|
1750
|
+
return this.fetch(
|
|
1751
|
+
`w/${wid}/calls${params.toString() ? `?${params.toString()}` : ""}`
|
|
1752
|
+
);
|
|
1753
|
+
}
|
|
1715
1754
|
/** Initiate a new outbound call. */
|
|
1716
1755
|
async initiateCall(wid, request) {
|
|
1717
1756
|
return this.fetch(`w/${wid}/call`, {
|
|
@@ -2236,10 +2275,17 @@ var DataTypesApi = class extends BaseApiClient {
|
|
|
2236
2275
|
const queryString = params.toString();
|
|
2237
2276
|
return this.fetch(`w/${wid}/data-types${queryString ? `?${queryString}` : ""}`);
|
|
2238
2277
|
}
|
|
2239
|
-
/** Get a single data type by ID. */
|
|
2278
|
+
/** Get a single data type by numeric ID, or by UUID when a UUID string is supplied. */
|
|
2240
2279
|
async getDataType(wid, id) {
|
|
2280
|
+
if (typeof id === "string" && isUuid(id)) {
|
|
2281
|
+
return this.getDataTypeByUuid(wid, id);
|
|
2282
|
+
}
|
|
2241
2283
|
return this.fetch(`w/${wid}/data-types/${id}`);
|
|
2242
2284
|
}
|
|
2285
|
+
/** Get a single data type by UUID. */
|
|
2286
|
+
async getDataTypeByUuid(wid, uuid) {
|
|
2287
|
+
return this.fetch(`w/${wid}/data-types/${uuid}`);
|
|
2288
|
+
}
|
|
2243
2289
|
/** Get a single data type by its slug. */
|
|
2244
2290
|
async getDataTypeBySlug(wid, slug) {
|
|
2245
2291
|
return this.fetch(`w/${wid}/data-types/slug/${slug}`);
|
|
@@ -2366,6 +2412,9 @@ var DataTypesApi = class extends BaseApiClient {
|
|
|
2366
2412
|
return this.fetch(`w/${wid}/data-types/member-record-counts?member_id=${memberId}`);
|
|
2367
2413
|
}
|
|
2368
2414
|
};
|
|
2415
|
+
function isUuid(value) {
|
|
2416
|
+
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
2417
|
+
}
|
|
2369
2418
|
|
|
2370
2419
|
// src/api/discord-bots.ts
|
|
2371
2420
|
var DiscordBotsApi = class extends BaseApiClient {
|
|
@@ -3293,6 +3342,25 @@ var FilesApi = class extends BaseApiClient {
|
|
|
3293
3342
|
body: JSON.stringify(file)
|
|
3294
3343
|
});
|
|
3295
3344
|
}
|
|
3345
|
+
/** Upload in-memory file content through the API's database-backed file path. */
|
|
3346
|
+
async uploadFile(wid, request) {
|
|
3347
|
+
const mimeType = request.mimeType ?? "application/octet-stream";
|
|
3348
|
+
const bytes = await dataToBytes(request.data);
|
|
3349
|
+
return this.createFile(wid, {
|
|
3350
|
+
title: request.title ?? request.filename,
|
|
3351
|
+
filename: request.filename,
|
|
3352
|
+
description: request.description,
|
|
3353
|
+
mimeType,
|
|
3354
|
+
folderId: request.folderId,
|
|
3355
|
+
siteId: request.siteId,
|
|
3356
|
+
dataBase64: bytesToBase64(bytes),
|
|
3357
|
+
externalId: request.externalId,
|
|
3358
|
+
oauthCredentialUuid: request.oauthCredentialUuid,
|
|
3359
|
+
access: request.access,
|
|
3360
|
+
labelIds: request.labelIds,
|
|
3361
|
+
overwrite: request.overwrite
|
|
3362
|
+
});
|
|
3363
|
+
}
|
|
3296
3364
|
/** Update an existing file's metadata. */
|
|
3297
3365
|
async updateFile(wid, id, file) {
|
|
3298
3366
|
return this.fetch(`w/${wid}/files/${id}`, {
|
|
@@ -3473,6 +3541,38 @@ var FilesApi = class extends BaseApiClient {
|
|
|
3473
3541
|
);
|
|
3474
3542
|
}
|
|
3475
3543
|
};
|
|
3544
|
+
async function dataToBytes(data) {
|
|
3545
|
+
if (typeof data === "string") {
|
|
3546
|
+
return new TextEncoder().encode(data);
|
|
3547
|
+
}
|
|
3548
|
+
if (data instanceof Uint8Array) {
|
|
3549
|
+
return data;
|
|
3550
|
+
}
|
|
3551
|
+
if (data instanceof ArrayBuffer) {
|
|
3552
|
+
return new Uint8Array(data);
|
|
3553
|
+
}
|
|
3554
|
+
if (ArrayBuffer.isView(data)) {
|
|
3555
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
3556
|
+
}
|
|
3557
|
+
if (typeof Blob !== "undefined" && data instanceof Blob) {
|
|
3558
|
+
return new Uint8Array(await data.arrayBuffer());
|
|
3559
|
+
}
|
|
3560
|
+
throw new Error("Unsupported file data type");
|
|
3561
|
+
}
|
|
3562
|
+
function bytesToBase64(bytes) {
|
|
3563
|
+
if (typeof btoa === "function") {
|
|
3564
|
+
const chunkSize = 32768;
|
|
3565
|
+
let binary = "";
|
|
3566
|
+
for (let i = 0; i < bytes.length; i += chunkSize) {
|
|
3567
|
+
binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
|
|
3568
|
+
}
|
|
3569
|
+
return btoa(binary);
|
|
3570
|
+
}
|
|
3571
|
+
if (typeof Buffer !== "undefined") {
|
|
3572
|
+
return Buffer.from(bytes).toString("base64");
|
|
3573
|
+
}
|
|
3574
|
+
throw new Error("No base64 encoder is available in this runtime");
|
|
3575
|
+
}
|
|
3476
3576
|
|
|
3477
3577
|
// src/api/inboxes.ts
|
|
3478
3578
|
var InboxesApi = class extends BaseApiClient {
|
|
@@ -6623,6 +6723,36 @@ var JourneysApi = class extends BaseApiClient {
|
|
|
6623
6723
|
async getMemberJourneys(wid, memberId) {
|
|
6624
6724
|
return this.fetch(`w/${wid}/journeys/by-member/${memberId}`);
|
|
6625
6725
|
}
|
|
6726
|
+
/** List members currently or historically associated with one journey step. */
|
|
6727
|
+
async getStepMembers(wid, journeyId, stepUuid, params = {}) {
|
|
6728
|
+
const qs = new URLSearchParams();
|
|
6729
|
+
if (params.status) qs.set("status", params.status);
|
|
6730
|
+
if (params.mode) qs.set("mode", params.mode);
|
|
6731
|
+
if (params.page) qs.set("page", String(params.page));
|
|
6732
|
+
if (params.pageSize) qs.set("pageSize", String(params.pageSize));
|
|
6733
|
+
const query = qs.toString();
|
|
6734
|
+
return this.fetch(
|
|
6735
|
+
`w/${wid}/journeys/${journeyId}/steps/${stepUuid}/members${query ? `?${query}` : ""}`
|
|
6736
|
+
);
|
|
6737
|
+
}
|
|
6738
|
+
/** Get member counts by status for each journey step. */
|
|
6739
|
+
async getStepMemberCounts(wid, journeyId) {
|
|
6740
|
+
return this.fetch(`w/${wid}/journeys/${journeyId}/step-member-counts`);
|
|
6741
|
+
}
|
|
6742
|
+
/** Advance a journey step in the current execution context. */
|
|
6743
|
+
async advanceStep(wid, journeyId, stepUuid, data = {}) {
|
|
6744
|
+
return this.fetch(
|
|
6745
|
+
`w/${wid}/journeys/${journeyId}/steps/${stepUuid}/advance`,
|
|
6746
|
+
{ method: "POST", body: JSON.stringify(data) }
|
|
6747
|
+
);
|
|
6748
|
+
}
|
|
6749
|
+
/** Skip a journey step in the current execution context. */
|
|
6750
|
+
async skipStep(wid, journeyId, stepUuid, data = {}) {
|
|
6751
|
+
return this.fetch(
|
|
6752
|
+
`w/${wid}/journeys/${journeyId}/steps/${stepUuid}/skip`,
|
|
6753
|
+
{ method: "POST", body: JSON.stringify(data) }
|
|
6754
|
+
);
|
|
6755
|
+
}
|
|
6626
6756
|
/**
|
|
6627
6757
|
* Dry-run heartbeat CEL evaluation for an enrolled member.
|
|
6628
6758
|
*
|
|
@@ -8092,6 +8222,714 @@ function createApiModules(apiKey, baseUrl, customFetch) {
|
|
|
8092
8222
|
};
|
|
8093
8223
|
}
|
|
8094
8224
|
|
|
8225
|
+
// src/client/workspace-client.ts
|
|
8226
|
+
var WORKSPACE_METHOD_NAMES = [
|
|
8227
|
+
"activateWorkflowVersion",
|
|
8228
|
+
"addGroupMember",
|
|
8229
|
+
"advanceStep",
|
|
8230
|
+
"approveWorkspaceInvitation",
|
|
8231
|
+
"archiveAgent",
|
|
8232
|
+
"archiveChat",
|
|
8233
|
+
"archiveDataType",
|
|
8234
|
+
"archiveJourney",
|
|
8235
|
+
"archiveMember",
|
|
8236
|
+
"archivePhoneNumber",
|
|
8237
|
+
"archiveStep",
|
|
8238
|
+
"archiveTask",
|
|
8239
|
+
"archiveWorkflow",
|
|
8240
|
+
"authorizeMondayConnection",
|
|
8241
|
+
"autoCreateDataTypeFromBoard",
|
|
8242
|
+
"blockWorkspaceInvitation",
|
|
8243
|
+
"bookHealthieAppointment",
|
|
8244
|
+
"buildWorkspace",
|
|
8245
|
+
"bulkLinkMembersToHubspot",
|
|
8246
|
+
"bulkLinkMembersToMonday",
|
|
8247
|
+
"bulkLinkMembersToSalesforce",
|
|
8248
|
+
"cancelAgentTask",
|
|
8249
|
+
"cancelAssignment",
|
|
8250
|
+
"cancelCalendarEvent",
|
|
8251
|
+
"cancelCredentialUpdateInvite",
|
|
8252
|
+
"checkAvailability",
|
|
8253
|
+
"checkSiteDomainAvailability",
|
|
8254
|
+
"checkSiteSlugAvailability",
|
|
8255
|
+
"clearConnectionMemberExclusion",
|
|
8256
|
+
"clearMemberSwitch",
|
|
8257
|
+
"clickWorkspaceSupportRequestResource",
|
|
8258
|
+
"cloneDataType",
|
|
8259
|
+
"cloneTask",
|
|
8260
|
+
"cloneWorkflow",
|
|
8261
|
+
"closeWorkspaceSupportRequest",
|
|
8262
|
+
"commentOnWorkspaceSupportRequest",
|
|
8263
|
+
"configureConfluence",
|
|
8264
|
+
"configureHealthie",
|
|
8265
|
+
"configureHubspot",
|
|
8266
|
+
"configureMondayConnection",
|
|
8267
|
+
"configureSalesforce",
|
|
8268
|
+
"convertEmail",
|
|
8269
|
+
"convertFile",
|
|
8270
|
+
"crawlSite",
|
|
8271
|
+
"createAccessGrant",
|
|
8272
|
+
"createAgent",
|
|
8273
|
+
"createApiKey",
|
|
8274
|
+
"createAssignment",
|
|
8275
|
+
"createCalendar",
|
|
8276
|
+
"createCalendarEvent",
|
|
8277
|
+
"createCalendarSchedule",
|
|
8278
|
+
"createChat",
|
|
8279
|
+
"createChatCompletion",
|
|
8280
|
+
"createChatFilter",
|
|
8281
|
+
"createChatLabel",
|
|
8282
|
+
"createClientWorkspace",
|
|
8283
|
+
"createConnection",
|
|
8284
|
+
"createCustomTool",
|
|
8285
|
+
"createCustomToolkit",
|
|
8286
|
+
"createDataRecord",
|
|
8287
|
+
"createDataType",
|
|
8288
|
+
"createDiscordBot",
|
|
8289
|
+
"createEventRule",
|
|
8290
|
+
"createEventType",
|
|
8291
|
+
"createExperiment",
|
|
8292
|
+
"createExperimentAssignment",
|
|
8293
|
+
"createExperimentGroup",
|
|
8294
|
+
"createFhirConnection",
|
|
8295
|
+
"createFile",
|
|
8296
|
+
"createFileLabel",
|
|
8297
|
+
"createFolder",
|
|
8298
|
+
"createGoal",
|
|
8299
|
+
"createInbox",
|
|
8300
|
+
"createJourney",
|
|
8301
|
+
"createJourneyNote",
|
|
8302
|
+
"createMcpServer",
|
|
8303
|
+
"createMemberField",
|
|
8304
|
+
"createMemberFilter",
|
|
8305
|
+
"createMemberLabel",
|
|
8306
|
+
"createMemberMemory",
|
|
8307
|
+
"createMemberRole",
|
|
8308
|
+
"createMenuItem",
|
|
8309
|
+
"createMilestone",
|
|
8310
|
+
"createNotificationRule",
|
|
8311
|
+
"createOperatorGroup",
|
|
8312
|
+
"createPage",
|
|
8313
|
+
"createPersona",
|
|
8314
|
+
"createPhoneNumber",
|
|
8315
|
+
"createProduct",
|
|
8316
|
+
"createRoutine",
|
|
8317
|
+
"createScenario",
|
|
8318
|
+
"createSignup",
|
|
8319
|
+
"createSite",
|
|
8320
|
+
"createSlackApp",
|
|
8321
|
+
"createSnippet",
|
|
8322
|
+
"createStep",
|
|
8323
|
+
"createSupervisor",
|
|
8324
|
+
"createTask",
|
|
8325
|
+
"createTeamsApp",
|
|
8326
|
+
"createWorkflow",
|
|
8327
|
+
"createWorkflowContributor",
|
|
8328
|
+
"createWorkflowFromTemplate",
|
|
8329
|
+
"createWorkflowNote",
|
|
8330
|
+
"createWorkflowOutboundVoiceChat",
|
|
8331
|
+
"createWorkspaceMember",
|
|
8332
|
+
"createWorkspaceSupportRequest",
|
|
8333
|
+
"deactivateWorkflowVersion",
|
|
8334
|
+
"deleteAgent",
|
|
8335
|
+
"deleteAssignment",
|
|
8336
|
+
"deleteCalendar",
|
|
8337
|
+
"deleteCalendarEvent",
|
|
8338
|
+
"deleteCalendarSchedule",
|
|
8339
|
+
"deleteChat",
|
|
8340
|
+
"deleteChatFilter",
|
|
8341
|
+
"deleteChatLabel",
|
|
8342
|
+
"deleteClientWorkspace",
|
|
8343
|
+
"deleteConfluence",
|
|
8344
|
+
"deleteConnection",
|
|
8345
|
+
"deleteCustomTool",
|
|
8346
|
+
"deleteCustomToolkit",
|
|
8347
|
+
"deleteDataRecord",
|
|
8348
|
+
"deleteDataType",
|
|
8349
|
+
"deleteDiscordBot",
|
|
8350
|
+
"deleteEnrollment",
|
|
8351
|
+
"deleteEventRule",
|
|
8352
|
+
"deleteEventType",
|
|
8353
|
+
"deleteExperiment",
|
|
8354
|
+
"deleteExperimentAssignment",
|
|
8355
|
+
"deleteExperimentGroup",
|
|
8356
|
+
"deleteFhirConnection",
|
|
8357
|
+
"deleteFile",
|
|
8358
|
+
"deleteFileLabel",
|
|
8359
|
+
"deleteFolder",
|
|
8360
|
+
"deleteGoal",
|
|
8361
|
+
"deleteHubspot",
|
|
8362
|
+
"deleteInbox",
|
|
8363
|
+
"deleteJourneyNote",
|
|
8364
|
+
"deleteMcpServer",
|
|
8365
|
+
"deleteMember",
|
|
8366
|
+
"deleteMemberField",
|
|
8367
|
+
"deleteMemberFilter",
|
|
8368
|
+
"deleteMemberLabel",
|
|
8369
|
+
"deleteMemberMemory",
|
|
8370
|
+
"deleteMemberRole",
|
|
8371
|
+
"deleteMenuItem",
|
|
8372
|
+
"deleteMilestone",
|
|
8373
|
+
"deleteMondayConnection",
|
|
8374
|
+
"deleteNotificationRule",
|
|
8375
|
+
"deleteOperatorGroup",
|
|
8376
|
+
"deletePage",
|
|
8377
|
+
"deletePersona",
|
|
8378
|
+
"deletePlatformApp",
|
|
8379
|
+
"deleteProduct",
|
|
8380
|
+
"deleteRoutine",
|
|
8381
|
+
"deleteSalesforce",
|
|
8382
|
+
"deleteScenario",
|
|
8383
|
+
"deleteSite",
|
|
8384
|
+
"deleteSlackApp",
|
|
8385
|
+
"deleteSnippet",
|
|
8386
|
+
"deleteSupervisor",
|
|
8387
|
+
"deleteTask",
|
|
8388
|
+
"deleteTeamsApp",
|
|
8389
|
+
"deleteWorkflow",
|
|
8390
|
+
"deleteWorkflowContributor",
|
|
8391
|
+
"deleteWorkflowNote",
|
|
8392
|
+
"deleteWorkspace",
|
|
8393
|
+
"deleteWorkspaceInvitationAdmin",
|
|
8394
|
+
"denyWorkspaceInvitation",
|
|
8395
|
+
"describeSalesforceObject",
|
|
8396
|
+
"diffWorkflowVersions",
|
|
8397
|
+
"disableConfluence",
|
|
8398
|
+
"disableCustomToolkit",
|
|
8399
|
+
"disableHubspot",
|
|
8400
|
+
"disableMcpServer",
|
|
8401
|
+
"disableMondayConnection",
|
|
8402
|
+
"disableSalesforce",
|
|
8403
|
+
"disconnectConfluence",
|
|
8404
|
+
"disconnectHubspot",
|
|
8405
|
+
"disconnectMondayConnection",
|
|
8406
|
+
"disconnectPresence",
|
|
8407
|
+
"disconnectSalesforce",
|
|
8408
|
+
"discoverOAuthMetadata",
|
|
8409
|
+
"dismissAllNotifications",
|
|
8410
|
+
"dismissNotification",
|
|
8411
|
+
"downloadEmailAttachment",
|
|
8412
|
+
"enableConfluence",
|
|
8413
|
+
"enableCustomToolkit",
|
|
8414
|
+
"enableHubspot",
|
|
8415
|
+
"enableMcpServer",
|
|
8416
|
+
"enableMondayConnection",
|
|
8417
|
+
"enablePlatformApp",
|
|
8418
|
+
"enableSalesforce",
|
|
8419
|
+
"endTestChatRun",
|
|
8420
|
+
"enrollMembers",
|
|
8421
|
+
"evaluateTestChatRun",
|
|
8422
|
+
"executeAssignmentTool",
|
|
8423
|
+
"expireAnonymousMember",
|
|
8424
|
+
"exportChat",
|
|
8425
|
+
"exportChats",
|
|
8426
|
+
"exportMembers",
|
|
8427
|
+
"exportWorkspace",
|
|
8428
|
+
"fetchVoicemailAudio",
|
|
8429
|
+
"fhirBackfillEncounterSync",
|
|
8430
|
+
"fhirCreateEncounter",
|
|
8431
|
+
"fhirCsvImportApply",
|
|
8432
|
+
"fhirCsvImportInspect",
|
|
8433
|
+
"fhirFetchCareTeam",
|
|
8434
|
+
"fhirFetchEncounters",
|
|
8435
|
+
"fhirGetCsvImportRunItems",
|
|
8436
|
+
"fhirGetCsvImportRuns",
|
|
8437
|
+
"fhirGetCsvImportSettings",
|
|
8438
|
+
"fhirGetEncounterSyncRuns",
|
|
8439
|
+
"fhirGetEncounterSyncStatus",
|
|
8440
|
+
"fhirImportPatient",
|
|
8441
|
+
"fhirLinkMember",
|
|
8442
|
+
"fhirListLinkedMembers",
|
|
8443
|
+
"fhirRefreshEncounterPatient",
|
|
8444
|
+
"fhirRunEncounterSync",
|
|
8445
|
+
"fhirSearchLocations",
|
|
8446
|
+
"fhirSearchPatients",
|
|
8447
|
+
"fhirSearchPractitioners",
|
|
8448
|
+
"fhirSyncMember",
|
|
8449
|
+
"fhirUnlinkMember",
|
|
8450
|
+
"fhirUpdateCsvImportSettings",
|
|
8451
|
+
"fhirUpdateEncounterSync",
|
|
8452
|
+
"findOrCreateDMChat",
|
|
8453
|
+
"generateFileUploadUrl",
|
|
8454
|
+
"generateICalToken",
|
|
8455
|
+
"generateSiteMediaUploadUrl",
|
|
8456
|
+
"getAIUsageReport",
|
|
8457
|
+
"getAbilityTypes",
|
|
8458
|
+
"getAccessGrant",
|
|
8459
|
+
"getAccessGrants",
|
|
8460
|
+
"getAgent",
|
|
8461
|
+
"getAgentTask",
|
|
8462
|
+
"getAgentTaskMessages",
|
|
8463
|
+
"getAgentTasks",
|
|
8464
|
+
"getAgents",
|
|
8465
|
+
"getAnonymousResolution",
|
|
8466
|
+
"getAnonymousResolutions",
|
|
8467
|
+
"getApiKeys",
|
|
8468
|
+
"getArchiveBlockers",
|
|
8469
|
+
"getAssignment",
|
|
8470
|
+
"getAssignmentCelContext",
|
|
8471
|
+
"getAssignmentMessages",
|
|
8472
|
+
"getAssignmentTask",
|
|
8473
|
+
"getAssignmentTaskDetail",
|
|
8474
|
+
"getAssignmentTools",
|
|
8475
|
+
"getAssignments",
|
|
8476
|
+
"getAvailableActions",
|
|
8477
|
+
"getAvailablePhoneNumbers",
|
|
8478
|
+
"getAvailableSlots",
|
|
8479
|
+
"getBoardColumns",
|
|
8480
|
+
"getBoardGroups",
|
|
8481
|
+
"getBoards",
|
|
8482
|
+
"getBusinessHoursStatus",
|
|
8483
|
+
"getCalendar",
|
|
8484
|
+
"getCalendarEvent",
|
|
8485
|
+
"getCalendarEvents",
|
|
8486
|
+
"getCalendarSchedules",
|
|
8487
|
+
"getCalendars",
|
|
8488
|
+
"getCelContext",
|
|
8489
|
+
"getChat",
|
|
8490
|
+
"getChatAssignmentTasks",
|
|
8491
|
+
"getChatEmails",
|
|
8492
|
+
"getChatFilter",
|
|
8493
|
+
"getChatFilterByUuid",
|
|
8494
|
+
"getChatFilterCount",
|
|
8495
|
+
"getChatFilters",
|
|
8496
|
+
"getChatLabel",
|
|
8497
|
+
"getChatLabelByUuid",
|
|
8498
|
+
"getChatLabels",
|
|
8499
|
+
"getChatMessages",
|
|
8500
|
+
"getChatPhoneCalls",
|
|
8501
|
+
"getChatSkills",
|
|
8502
|
+
"getChatTodos",
|
|
8503
|
+
"getChatTokenUsage",
|
|
8504
|
+
"getChatToolCallMessages",
|
|
8505
|
+
"getChatTools",
|
|
8506
|
+
"getChats",
|
|
8507
|
+
"getChatsDailyCreationStats",
|
|
8508
|
+
"getChatsNeedsResponse",
|
|
8509
|
+
"getClientWorkspace",
|
|
8510
|
+
"getConfluenceStatus",
|
|
8511
|
+
"getConnectionSyncCapabilities",
|
|
8512
|
+
"getConnectionSyncCheckpoint",
|
|
8513
|
+
"getConnectionSyncConfig",
|
|
8514
|
+
"getCredentialUpdateInvites",
|
|
8515
|
+
"getCurrentMember",
|
|
8516
|
+
"getCurrentUserInfo",
|
|
8517
|
+
"getCustomToolkit",
|
|
8518
|
+
"getCustomToolkits",
|
|
8519
|
+
"getDataRecord",
|
|
8520
|
+
"getDataRecordChanges",
|
|
8521
|
+
"getDataRecords",
|
|
8522
|
+
"getDataType",
|
|
8523
|
+
"getDataTypeByUuid",
|
|
8524
|
+
"getDataTypeBySlug",
|
|
8525
|
+
"getDataTypes",
|
|
8526
|
+
"getDiscordBot",
|
|
8527
|
+
"getDiscordBotAccounts",
|
|
8528
|
+
"getDiscordBotByUuid",
|
|
8529
|
+
"getDiscordBots",
|
|
8530
|
+
"getDiscordGuilds",
|
|
8531
|
+
"getDiscordThreads",
|
|
8532
|
+
"getEventRule",
|
|
8533
|
+
"getEventRules",
|
|
8534
|
+
"getEventType",
|
|
8535
|
+
"getEventTypes",
|
|
8536
|
+
"getExperiment",
|
|
8537
|
+
"getExperimentStats",
|
|
8538
|
+
"getExperiments",
|
|
8539
|
+
"getFhirConnection",
|
|
8540
|
+
"getFhirConnectionByUuid",
|
|
8541
|
+
"getFhirConnections",
|
|
8542
|
+
"getFieldIndexStatus",
|
|
8543
|
+
"getFile",
|
|
8544
|
+
"getFileLabel",
|
|
8545
|
+
"getFileLabelByUuid",
|
|
8546
|
+
"getFileLabels",
|
|
8547
|
+
"getFileSharing",
|
|
8548
|
+
"getFiles",
|
|
8549
|
+
"getFirstRunState",
|
|
8550
|
+
"getFolder",
|
|
8551
|
+
"getFolderSharing",
|
|
8552
|
+
"getFolders",
|
|
8553
|
+
"getGoogleCalendarStatus",
|
|
8554
|
+
"getHealthieAvailableSlots",
|
|
8555
|
+
"getHealthieReconciliationMatches",
|
|
8556
|
+
"getHealthieStatus",
|
|
8557
|
+
"getHubspotContactProperties",
|
|
8558
|
+
"getHubspotManagedRules",
|
|
8559
|
+
"getHubspotReconciliationMatches",
|
|
8560
|
+
"getHubspotStatus",
|
|
8561
|
+
"getHubspotSyncLogs",
|
|
8562
|
+
"getHubspotTransformPresets",
|
|
8563
|
+
"getICalFeedUrl",
|
|
8564
|
+
"getInbox",
|
|
8565
|
+
"getInboxEmail",
|
|
8566
|
+
"getInboxEmails",
|
|
8567
|
+
"getInboxThreads",
|
|
8568
|
+
"getInboxes",
|
|
8569
|
+
"getJourney",
|
|
8570
|
+
"getJourneyHealth",
|
|
8571
|
+
"getJourneyMembers",
|
|
8572
|
+
"getJourneyNotes",
|
|
8573
|
+
"getJourneys",
|
|
8574
|
+
"getLinkablePhones",
|
|
8575
|
+
"getLinkedHealthieMembers",
|
|
8576
|
+
"getLinkedHubspotMembers",
|
|
8577
|
+
"getLinkedMondayMembers",
|
|
8578
|
+
"getLinkedRecords",
|
|
8579
|
+
"getLinkedSalesforceMembers",
|
|
8580
|
+
"getLiveOperators",
|
|
8581
|
+
"getMcpServer",
|
|
8582
|
+
"getMcpServerPrompts",
|
|
8583
|
+
"getMcpServerResources",
|
|
8584
|
+
"getMcpServerTools",
|
|
8585
|
+
"getMcpServers",
|
|
8586
|
+
"getMemberExperiments",
|
|
8587
|
+
"getMemberFieldDefinitions",
|
|
8588
|
+
"getMemberFields",
|
|
8589
|
+
"getMemberFilter",
|
|
8590
|
+
"getMemberFilterCount",
|
|
8591
|
+
"getMemberFilters",
|
|
8592
|
+
"getMemberGrants",
|
|
8593
|
+
"getMemberJourneys",
|
|
8594
|
+
"getMemberLabel",
|
|
8595
|
+
"getMemberLabelByUuid",
|
|
8596
|
+
"getMemberLabels",
|
|
8597
|
+
"getMemberMemories",
|
|
8598
|
+
"getMemberRecordCounts",
|
|
8599
|
+
"getMemberRole",
|
|
8600
|
+
"getMemberRoleByUuid",
|
|
8601
|
+
"getMemberRoles",
|
|
8602
|
+
"getMemberSyncSummary",
|
|
8603
|
+
"getMemberUsage",
|
|
8604
|
+
"getMembersMessageActivity",
|
|
8605
|
+
"getMenuItems",
|
|
8606
|
+
"getMessageTiming",
|
|
8607
|
+
"getMilestone",
|
|
8608
|
+
"getMilestones",
|
|
8609
|
+
"getMondayConnectionBoardColumns",
|
|
8610
|
+
"getMondayConnectionBoardGroups",
|
|
8611
|
+
"getMondayConnectionBoards",
|
|
8612
|
+
"getMondayConnectionStatus",
|
|
8613
|
+
"getMondayReconciliationMatches",
|
|
8614
|
+
"getMondaySyncConfig",
|
|
8615
|
+
"getMyCredentials",
|
|
8616
|
+
"getMyGivenGrants",
|
|
8617
|
+
"getMyReceivedGrants",
|
|
8618
|
+
"getNotification",
|
|
8619
|
+
"getNotificationRules",
|
|
8620
|
+
"getNotifications",
|
|
8621
|
+
"getOperatorChatMessages",
|
|
8622
|
+
"getOperatorGroup",
|
|
8623
|
+
"getOperatorGroups",
|
|
8624
|
+
"getOrCreateQualificationForWorkflow",
|
|
8625
|
+
"getOwnedMembers",
|
|
8626
|
+
"getPage",
|
|
8627
|
+
"getPageBySlug",
|
|
8628
|
+
"getPersona",
|
|
8629
|
+
"getPhoneCalls",
|
|
8630
|
+
"getPhoneNumber",
|
|
8631
|
+
"getPhoneNumberCalls",
|
|
8632
|
+
"getPhoneNumberMessages",
|
|
8633
|
+
"getPhoneNumberVoicemails",
|
|
8634
|
+
"getPhoneNumbers",
|
|
8635
|
+
"getPhoneUsageReport",
|
|
8636
|
+
"getPlatformApp",
|
|
8637
|
+
"getPresenceStatus",
|
|
8638
|
+
"getProducts",
|
|
8639
|
+
"getPublicFile",
|
|
8640
|
+
"getPublicFolder",
|
|
8641
|
+
"getPublicFolderFiles",
|
|
8642
|
+
"getPublicProducts",
|
|
8643
|
+
"getQualification",
|
|
8644
|
+
"getQualifications",
|
|
8645
|
+
"getResellerWorkspaces",
|
|
8646
|
+
"getRoutine",
|
|
8647
|
+
"getRoutineRuns",
|
|
8648
|
+
"getRoutines",
|
|
8649
|
+
"getRuleExecutions",
|
|
8650
|
+
"getSMSUsageReport",
|
|
8651
|
+
"getSalesforceReconciliationMatches",
|
|
8652
|
+
"getSalesforceStatus",
|
|
8653
|
+
"getSalesforceSyncConfig",
|
|
8654
|
+
"getScenario",
|
|
8655
|
+
"getSite",
|
|
8656
|
+
"getSiteByUuid",
|
|
8657
|
+
"getSiteCounts",
|
|
8658
|
+
"getSiteMenu",
|
|
8659
|
+
"getSitePages",
|
|
8660
|
+
"getSiteRenderedMenu",
|
|
8661
|
+
"getSiteRenderedPage",
|
|
8662
|
+
"getSites",
|
|
8663
|
+
"getSlackApp",
|
|
8664
|
+
"getSlackAppAccounts",
|
|
8665
|
+
"getSlackApps",
|
|
8666
|
+
"getSlackInstallations",
|
|
8667
|
+
"getSlackThreads",
|
|
8668
|
+
"getSnippet",
|
|
8669
|
+
"getStepMemberCounts",
|
|
8670
|
+
"getStepMembers",
|
|
8671
|
+
"getSupervisor",
|
|
8672
|
+
"getSupervisors",
|
|
8673
|
+
"getSyncRunItems",
|
|
8674
|
+
"getSyncRuns",
|
|
8675
|
+
"getTask",
|
|
8676
|
+
"getTaskChats",
|
|
8677
|
+
"getTasks",
|
|
8678
|
+
"getTeamsApp",
|
|
8679
|
+
"getTeamsAppAccounts",
|
|
8680
|
+
"getTeamsApps",
|
|
8681
|
+
"getTeamsConversations",
|
|
8682
|
+
"getTeamsInstallations",
|
|
8683
|
+
"getTemplateContext",
|
|
8684
|
+
"getTestChatRun",
|
|
8685
|
+
"getThreadEmails",
|
|
8686
|
+
"getTool",
|
|
8687
|
+
"getToolCallNames",
|
|
8688
|
+
"getToolkits",
|
|
8689
|
+
"getUnreadNotificationCount",
|
|
8690
|
+
"getUsageDashboard",
|
|
8691
|
+
"getVariableRegistry",
|
|
8692
|
+
"getVoiceToken",
|
|
8693
|
+
"getVoiceUsageReport",
|
|
8694
|
+
"getWebhookLogs",
|
|
8695
|
+
"getWorkflow",
|
|
8696
|
+
"getWorkflowAccessValidation",
|
|
8697
|
+
"getWorkflowActivity",
|
|
8698
|
+
"getWorkflowConfigValidation",
|
|
8699
|
+
"getWorkflowContributors",
|
|
8700
|
+
"getWorkflowDeletionPreview",
|
|
8701
|
+
"getWorkflowDiagram",
|
|
8702
|
+
"getWorkflowNotes",
|
|
8703
|
+
"getWorkflowRouteDryRun",
|
|
8704
|
+
"getWorkflowTaskAssignmentStats",
|
|
8705
|
+
"getWorkflowTemplates",
|
|
8706
|
+
"getWorkflowThumbnailUrl",
|
|
8707
|
+
"getWorkflowVersion",
|
|
8708
|
+
"getWorkflowVersionActive",
|
|
8709
|
+
"getWorkflowVersions",
|
|
8710
|
+
"getWorkflows",
|
|
8711
|
+
"getWorkflowsActivityBatch",
|
|
8712
|
+
"getWorkspace",
|
|
8713
|
+
"getWorkspaceBuilder",
|
|
8714
|
+
"getWorkspaceBuilders",
|
|
8715
|
+
"getWorkspaceCounts",
|
|
8716
|
+
"getWorkspaceDefaults",
|
|
8717
|
+
"getWorkspaceEmailDomains",
|
|
8718
|
+
"getWorkspaceMember",
|
|
8719
|
+
"getWorkspaceMembers",
|
|
8720
|
+
"getWorkspaceNotices",
|
|
8721
|
+
"getWorkspaceProduct",
|
|
8722
|
+
"getWorkspaceSiteDomains",
|
|
8723
|
+
"getWorkspaceSubscriptions",
|
|
8724
|
+
"getWorkspaceSupportRequest",
|
|
8725
|
+
"getWorkspaceThemes",
|
|
8726
|
+
"importFromBoard",
|
|
8727
|
+
"importHubspotMembers",
|
|
8728
|
+
"importMembers",
|
|
8729
|
+
"importSalesforceMembers",
|
|
8730
|
+
"importWorkspace",
|
|
8731
|
+
"initiateCall",
|
|
8732
|
+
"initiateOutboundCall",
|
|
8733
|
+
"inspectPrompt",
|
|
8734
|
+
"inviteMemberCredentialUpdate",
|
|
8735
|
+
"inviteToWorkspace",
|
|
8736
|
+
"leaveWorkspace",
|
|
8737
|
+
"linkCalendarToGoogle",
|
|
8738
|
+
"linkCalendarToHealthie",
|
|
8739
|
+
"linkMemberToHealthie",
|
|
8740
|
+
"linkMemberToHubspot",
|
|
8741
|
+
"linkMemberToMonday",
|
|
8742
|
+
"linkMemberToSalesforce",
|
|
8743
|
+
"linkPhoneNumber",
|
|
8744
|
+
"listAppConnections",
|
|
8745
|
+
"listAvailableAppConnections",
|
|
8746
|
+
"listConfluencePages",
|
|
8747
|
+
"listConfluenceSpaces",
|
|
8748
|
+
"listConnectionMemberFieldKeys",
|
|
8749
|
+
"listGoogleCalendars",
|
|
8750
|
+
"listHealthieAppointmentTypes",
|
|
8751
|
+
"listHealthiePatients",
|
|
8752
|
+
"listHealthieProviders",
|
|
8753
|
+
"listPersonas",
|
|
8754
|
+
"listPushSubscriptions",
|
|
8755
|
+
"listScenarios",
|
|
8756
|
+
"listSnippets",
|
|
8757
|
+
"listTestChatRuns",
|
|
8758
|
+
"listWorkspaceInvitationsAdmin",
|
|
8759
|
+
"listWorkspaceSupportRequests",
|
|
8760
|
+
"markEmailAsRead",
|
|
8761
|
+
"markEmailAsUnread",
|
|
8762
|
+
"markNotificationAsRead",
|
|
8763
|
+
"previewImportWorkspace",
|
|
8764
|
+
"previewSchedule",
|
|
8765
|
+
"previewTTS",
|
|
8766
|
+
"previewTemplate",
|
|
8767
|
+
"previewThinkingSound",
|
|
8768
|
+
"previewWorkspaceImport",
|
|
8769
|
+
"provisionClientWorkspace",
|
|
8770
|
+
"publishWorkflowVersion",
|
|
8771
|
+
"rateMessage",
|
|
8772
|
+
"reenrollMember",
|
|
8773
|
+
"registerLinkedRolesMetadata",
|
|
8774
|
+
"registerPushSubscription",
|
|
8775
|
+
"registerSlashCommands",
|
|
8776
|
+
"reindexFolder",
|
|
8777
|
+
"releasePhoneNumber",
|
|
8778
|
+
"removeFileRole",
|
|
8779
|
+
"removeFolderRole",
|
|
8780
|
+
"removeGroupMember",
|
|
8781
|
+
"reorderEventRules",
|
|
8782
|
+
"reorderMenuItems",
|
|
8783
|
+
"replyToEmail",
|
|
8784
|
+
"requestPhoneNumber",
|
|
8785
|
+
"requestWorkspaceMembership",
|
|
8786
|
+
"resetRoutineRuns",
|
|
8787
|
+
"resolveAccessGrant",
|
|
8788
|
+
"resolveAgentTools",
|
|
8789
|
+
"resolveAnonymousMember",
|
|
8790
|
+
"revokeAccessGrant",
|
|
8791
|
+
"revokeApiKey",
|
|
8792
|
+
"revokeICalToken",
|
|
8793
|
+
"runRoutine",
|
|
8794
|
+
"searchEventRules",
|
|
8795
|
+
"searchFolder",
|
|
8796
|
+
"searchHubspotRecords",
|
|
8797
|
+
"searchSalesforceRecords",
|
|
8798
|
+
"selectCurrentAssignmentTask",
|
|
8799
|
+
"sendAssistantMessage",
|
|
8800
|
+
"sendChatMessage",
|
|
8801
|
+
"sendOperatorMessage",
|
|
8802
|
+
"siteGoogleOAuthInitiate",
|
|
8803
|
+
"siteSendEmailCode",
|
|
8804
|
+
"siteSendPhoneCode",
|
|
8805
|
+
"siteSignup",
|
|
8806
|
+
"siteVerifyCode",
|
|
8807
|
+
"skipStep",
|
|
8808
|
+
"startConfluenceOAuth",
|
|
8809
|
+
"startHubspotOAuth",
|
|
8810
|
+
"startSalesforceOAuth",
|
|
8811
|
+
"startSyncRun",
|
|
8812
|
+
"startTestChatRun",
|
|
8813
|
+
"summarizeChat",
|
|
8814
|
+
"switchMember",
|
|
8815
|
+
"syncCalendarWithGoogle",
|
|
8816
|
+
"syncCalendarWithHealthie",
|
|
8817
|
+
"testFhirConnection",
|
|
8818
|
+
"testMcpServerConnection",
|
|
8819
|
+
"testMondayConnection",
|
|
8820
|
+
"testRunJourney",
|
|
8821
|
+
"toggleFieldIndex",
|
|
8822
|
+
"unarchiveAgent",
|
|
8823
|
+
"unarchiveChat",
|
|
8824
|
+
"unarchiveDataType",
|
|
8825
|
+
"unarchiveMember",
|
|
8826
|
+
"unarchiveTask",
|
|
8827
|
+
"unarchiveWorkflow",
|
|
8828
|
+
"unenrollMembers",
|
|
8829
|
+
"unlinkCalendarFromGoogle",
|
|
8830
|
+
"unlinkCalendarFromHealthie",
|
|
8831
|
+
"unlinkCredential",
|
|
8832
|
+
"unlinkMemberFromHealthie",
|
|
8833
|
+
"unlinkMemberFromHubspot",
|
|
8834
|
+
"unlinkMemberFromMonday",
|
|
8835
|
+
"unlinkMemberFromSalesforce",
|
|
8836
|
+
"unregisterPushSubscription",
|
|
8837
|
+
"updateAgent",
|
|
8838
|
+
"updateAssignment",
|
|
8839
|
+
"updateCalendar",
|
|
8840
|
+
"updateCalendarEvent",
|
|
8841
|
+
"updateCalendarSchedule",
|
|
8842
|
+
"updateChat",
|
|
8843
|
+
"updateChatFilter",
|
|
8844
|
+
"updateChatLabel",
|
|
8845
|
+
"updateChatMute",
|
|
8846
|
+
"updateChatNeedsResponse",
|
|
8847
|
+
"updateClientWorkspace",
|
|
8848
|
+
"updateConnection",
|
|
8849
|
+
"updateConnectionSyncConfig",
|
|
8850
|
+
"updateCurrentMember",
|
|
8851
|
+
"updateCustomTool",
|
|
8852
|
+
"updateCustomToolkit",
|
|
8853
|
+
"updateDataRecord",
|
|
8854
|
+
"updateDataType",
|
|
8855
|
+
"updateDiscordBot",
|
|
8856
|
+
"updateEventAttendee",
|
|
8857
|
+
"updateEventRule",
|
|
8858
|
+
"updateEventType",
|
|
8859
|
+
"updateExperiment",
|
|
8860
|
+
"updateExperimentAssignment",
|
|
8861
|
+
"updateExperimentGroup",
|
|
8862
|
+
"updateFhirConnection",
|
|
8863
|
+
"updateFile",
|
|
8864
|
+
"updateFileLabel",
|
|
8865
|
+
"updateFileRoles",
|
|
8866
|
+
"updateFileSharing",
|
|
8867
|
+
"updateFirstRunState",
|
|
8868
|
+
"updateFolder",
|
|
8869
|
+
"updateFolderRoles",
|
|
8870
|
+
"updateFolderSharing",
|
|
8871
|
+
"updateGoal",
|
|
8872
|
+
"updateInbox",
|
|
8873
|
+
"updateJourney",
|
|
8874
|
+
"updateJourneyNote",
|
|
8875
|
+
"updateMcpServer",
|
|
8876
|
+
"updateMember",
|
|
8877
|
+
"updateMemberField",
|
|
8878
|
+
"updateMemberFilter",
|
|
8879
|
+
"updateMemberLabel",
|
|
8880
|
+
"updateMemberRole",
|
|
8881
|
+
"updateMenuItem",
|
|
8882
|
+
"updateMilestone",
|
|
8883
|
+
"updateMondaySyncConfig",
|
|
8884
|
+
"updateNotificationRule",
|
|
8885
|
+
"updateOperatorGroup",
|
|
8886
|
+
"updatePage",
|
|
8887
|
+
"updatePersona",
|
|
8888
|
+
"updatePhoneNumber",
|
|
8889
|
+
"updatePlatformApp",
|
|
8890
|
+
"updateProduct",
|
|
8891
|
+
"updateRoutine",
|
|
8892
|
+
"updateSalesforceSyncConfig",
|
|
8893
|
+
"updateScenario",
|
|
8894
|
+
"updateSite",
|
|
8895
|
+
"updateSlackApp",
|
|
8896
|
+
"updateSnippet",
|
|
8897
|
+
"updateStep",
|
|
8898
|
+
"updateSupervisor",
|
|
8899
|
+
"updateTask",
|
|
8900
|
+
"updateTeamsApp",
|
|
8901
|
+
"uploadFile",
|
|
8902
|
+
"updateVoicemailStatus",
|
|
8903
|
+
"updateWorkflow",
|
|
8904
|
+
"updateWorkflowContributor",
|
|
8905
|
+
"updateWorkflowNote",
|
|
8906
|
+
"updateWorkflowVersion",
|
|
8907
|
+
"updateWorkspace",
|
|
8908
|
+
"updateWorkspaceDefaults",
|
|
8909
|
+
"updateWorkspaceInvitationAdmin",
|
|
8910
|
+
"updateWorkspaceThemes",
|
|
8911
|
+
"upsertDataRecord",
|
|
8912
|
+
"validateDataTypeSlug",
|
|
8913
|
+
"validateWorkflowName"
|
|
8914
|
+
];
|
|
8915
|
+
var WORKSPACE_METHOD_NAME_SET = new Set(WORKSPACE_METHOD_NAMES);
|
|
8916
|
+
function createWorkspaceClient(root, workspaceUuid) {
|
|
8917
|
+
return new Proxy(
|
|
8918
|
+
{ root, workspaceUuid },
|
|
8919
|
+
{
|
|
8920
|
+
get(target, prop, receiver) {
|
|
8921
|
+
if (prop in target) return Reflect.get(target, prop, receiver);
|
|
8922
|
+
if (typeof prop !== "string" || !WORKSPACE_METHOD_NAME_SET.has(prop)) {
|
|
8923
|
+
return void 0;
|
|
8924
|
+
}
|
|
8925
|
+
const value = root[prop];
|
|
8926
|
+
if (typeof value !== "function") return void 0;
|
|
8927
|
+
return (...args) => value.call(root, workspaceUuid, ...args);
|
|
8928
|
+
}
|
|
8929
|
+
}
|
|
8930
|
+
);
|
|
8931
|
+
}
|
|
8932
|
+
|
|
8095
8933
|
// src/client/bindings/access-grants.ts
|
|
8096
8934
|
function bindAccessGrantsMethods(target, accessGrants) {
|
|
8097
8935
|
target.getMyReceivedGrants = accessGrants.getMyReceivedGrants.bind(accessGrants);
|
|
@@ -8121,6 +8959,7 @@ function bindAgentsMethods(target, agents) {
|
|
|
8121
8959
|
target.deleteAgent = agents.deleteAgent.bind(agents);
|
|
8122
8960
|
target.archiveAgent = agents.archiveAgent.bind(agents);
|
|
8123
8961
|
target.unarchiveAgent = agents.unarchiveAgent.bind(agents);
|
|
8962
|
+
target.resolveAgentTools = agents.resolveAgentTools.bind(agents);
|
|
8124
8963
|
}
|
|
8125
8964
|
|
|
8126
8965
|
// src/client/bindings/tasks.ts
|
|
@@ -8185,6 +9024,7 @@ function bindChatsMethods(target, chats) {
|
|
|
8185
9024
|
|
|
8186
9025
|
// src/client/bindings/calls.ts
|
|
8187
9026
|
function bindCallsMethods(target, calls, cel) {
|
|
9027
|
+
target.getPhoneCalls = calls.getPhoneCalls.bind(calls);
|
|
8188
9028
|
target.initiateCall = calls.initiateCall.bind(calls);
|
|
8189
9029
|
target.getVoiceToken = calls.getVoiceToken.bind(calls);
|
|
8190
9030
|
target.getMessageTiming = calls.getMessageTiming.bind(calls);
|
|
@@ -8195,6 +9035,7 @@ function bindCallsMethods(target, calls, cel) {
|
|
|
8195
9035
|
function bindDataTypesMethods(target, dataTypes) {
|
|
8196
9036
|
target.getDataTypes = dataTypes.getDataTypes.bind(dataTypes);
|
|
8197
9037
|
target.getDataType = dataTypes.getDataType.bind(dataTypes);
|
|
9038
|
+
target.getDataTypeByUuid = dataTypes.getDataTypeByUuid.bind(dataTypes);
|
|
8198
9039
|
target.getDataTypeBySlug = dataTypes.getDataTypeBySlug.bind(dataTypes);
|
|
8199
9040
|
target.createDataType = dataTypes.createDataType.bind(dataTypes);
|
|
8200
9041
|
target.updateDataType = dataTypes.updateDataType.bind(dataTypes);
|
|
@@ -8431,6 +9272,7 @@ function bindFilesMethods(target, files) {
|
|
|
8431
9272
|
target.getFiles = files.getFiles.bind(files);
|
|
8432
9273
|
target.getFile = files.getFile.bind(files);
|
|
8433
9274
|
target.createFile = files.createFile.bind(files);
|
|
9275
|
+
target.uploadFile = files.uploadFile.bind(files);
|
|
8434
9276
|
target.updateFile = files.updateFile.bind(files);
|
|
8435
9277
|
target.deleteFile = files.deleteFile.bind(files);
|
|
8436
9278
|
target.convertFile = files.convertFile.bind(files);
|
|
@@ -8961,6 +9803,10 @@ function bindJourneysMethods(target, journeys) {
|
|
|
8961
9803
|
target.reenrollMember = journeys.reenrollMember.bind(journeys);
|
|
8962
9804
|
target.deleteEnrollment = journeys.deleteEnrollment.bind(journeys);
|
|
8963
9805
|
target.getMemberJourneys = journeys.getMemberJourneys.bind(journeys);
|
|
9806
|
+
target.getStepMembers = journeys.getStepMembers.bind(journeys);
|
|
9807
|
+
target.getStepMemberCounts = journeys.getStepMemberCounts.bind(journeys);
|
|
9808
|
+
target.advanceStep = journeys.advanceStep.bind(journeys);
|
|
9809
|
+
target.skipStep = journeys.skipStep.bind(journeys);
|
|
8964
9810
|
target.testRunJourney = journeys.testRunJourney.bind(journeys);
|
|
8965
9811
|
target.getJourneyNotes = journeys.getJourneyNotes.bind(journeys);
|
|
8966
9812
|
target.createJourneyNote = journeys.createJourneyNote.bind(journeys);
|
|
@@ -9104,6 +9950,7 @@ var GravityRailClient = class {
|
|
|
9104
9950
|
deleteChatFilter;
|
|
9105
9951
|
getChatFilterCount;
|
|
9106
9952
|
// Calls API
|
|
9953
|
+
getPhoneCalls;
|
|
9107
9954
|
initiateCall;
|
|
9108
9955
|
getVoiceToken;
|
|
9109
9956
|
getMessageTiming;
|
|
@@ -9111,6 +9958,7 @@ var GravityRailClient = class {
|
|
|
9111
9958
|
// Data Types API
|
|
9112
9959
|
getDataTypes;
|
|
9113
9960
|
getDataType;
|
|
9961
|
+
getDataTypeByUuid;
|
|
9114
9962
|
getDataTypeBySlug;
|
|
9115
9963
|
createDataType;
|
|
9116
9964
|
updateDataType;
|
|
@@ -9195,6 +10043,7 @@ var GravityRailClient = class {
|
|
|
9195
10043
|
deleteAgent;
|
|
9196
10044
|
archiveAgent;
|
|
9197
10045
|
unarchiveAgent;
|
|
10046
|
+
resolveAgentTools;
|
|
9198
10047
|
// Qualifications API
|
|
9199
10048
|
getQualifications;
|
|
9200
10049
|
getQualification;
|
|
@@ -9237,6 +10086,10 @@ var GravityRailClient = class {
|
|
|
9237
10086
|
reenrollMember;
|
|
9238
10087
|
deleteEnrollment;
|
|
9239
10088
|
getMemberJourneys;
|
|
10089
|
+
getStepMembers;
|
|
10090
|
+
getStepMemberCounts;
|
|
10091
|
+
advanceStep;
|
|
10092
|
+
skipStep;
|
|
9240
10093
|
testRunJourney;
|
|
9241
10094
|
getJourneyNotes;
|
|
9242
10095
|
createJourneyNote;
|
|
@@ -9452,6 +10305,7 @@ var GravityRailClient = class {
|
|
|
9452
10305
|
getFiles;
|
|
9453
10306
|
getFile;
|
|
9454
10307
|
createFile;
|
|
10308
|
+
uploadFile;
|
|
9455
10309
|
updateFile;
|
|
9456
10310
|
deleteFile;
|
|
9457
10311
|
convertFile;
|
|
@@ -9987,6 +10841,20 @@ var GravityRailClient = class {
|
|
|
9987
10841
|
bindResellersMethods(this, apis.resellers);
|
|
9988
10842
|
bindSupportRequestMethods(this, apis.supportRequests);
|
|
9989
10843
|
}
|
|
10844
|
+
/**
|
|
10845
|
+
* Return a workspace-scoped client facade.
|
|
10846
|
+
*
|
|
10847
|
+
* Methods on the returned client are the same public SDK methods, but with
|
|
10848
|
+
* the workspace UUID pre-bound:
|
|
10849
|
+
*
|
|
10850
|
+
* ```ts
|
|
10851
|
+
* const workspace = client.workspace("workspace-uuid");
|
|
10852
|
+
* await workspace.getAccessGrants({ status: "approved" });
|
|
10853
|
+
* ```
|
|
10854
|
+
*/
|
|
10855
|
+
workspace(workspaceUuid) {
|
|
10856
|
+
return createWorkspaceClient(this, workspaceUuid);
|
|
10857
|
+
}
|
|
9990
10858
|
/**
|
|
9991
10859
|
* Set the handler for enhanced authentication requirements (RFC 9470 Step-Up Auth).
|
|
9992
10860
|
* This handler is called when a 401 response includes WWW-Authenticate header
|
|
@@ -10070,6 +10938,1212 @@ var GravityRailClient = class {
|
|
|
10070
10938
|
}
|
|
10071
10939
|
};
|
|
10072
10940
|
|
|
10941
|
+
// src/workspace-builder/resource.ts
|
|
10942
|
+
function isRecord(value) {
|
|
10943
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
10944
|
+
}
|
|
10945
|
+
function isPlainRecord(value) {
|
|
10946
|
+
if (!isRecord(value)) return false;
|
|
10947
|
+
const prototype = Object.getPrototypeOf(value);
|
|
10948
|
+
return prototype === Object.prototype || prototype === null;
|
|
10949
|
+
}
|
|
10950
|
+
function slugify(name) {
|
|
10951
|
+
return name.toLowerCase().replaceAll(" ", "_").replaceAll("-", "_");
|
|
10952
|
+
}
|
|
10953
|
+
var WorkspaceBuilderResource = class {
|
|
10954
|
+
_id;
|
|
10955
|
+
_uuid;
|
|
10956
|
+
_created = false;
|
|
10957
|
+
_existed = false;
|
|
10958
|
+
matchKey() {
|
|
10959
|
+
return void 0;
|
|
10960
|
+
}
|
|
10961
|
+
adopt(existing) {
|
|
10962
|
+
this._id = existing.id;
|
|
10963
|
+
this._uuid = existing.uuid;
|
|
10964
|
+
this._existed = true;
|
|
10965
|
+
}
|
|
10966
|
+
};
|
|
10967
|
+
function resolveRefs(params) {
|
|
10968
|
+
return resolveRefValue(params);
|
|
10969
|
+
}
|
|
10970
|
+
function resolveRefValue(value) {
|
|
10971
|
+
if (value instanceof WorkspaceBuilderResource) return value._uuid;
|
|
10972
|
+
if (Array.isArray(value)) return value.map(resolveRefValue);
|
|
10973
|
+
if (!isPlainRecord(value)) return value;
|
|
10974
|
+
const out = {};
|
|
10975
|
+
for (const [key, nestedValue] of Object.entries(value)) {
|
|
10976
|
+
out[key] = resolveRefValue(nestedValue);
|
|
10977
|
+
}
|
|
10978
|
+
return out;
|
|
10979
|
+
}
|
|
10980
|
+
|
|
10981
|
+
// src/workspace-builder/automation.ts
|
|
10982
|
+
var MemberFilterBuilder = class extends WorkspaceBuilderResource {
|
|
10983
|
+
constructor(name, options = {}) {
|
|
10984
|
+
super();
|
|
10985
|
+
this.name = name;
|
|
10986
|
+
this.description = options.description ?? "";
|
|
10987
|
+
}
|
|
10988
|
+
description;
|
|
10989
|
+
rules = [];
|
|
10990
|
+
addRule(objectType, filterType, options = {}) {
|
|
10991
|
+
this.rules.push({
|
|
10992
|
+
objectType,
|
|
10993
|
+
filterType,
|
|
10994
|
+
...options.objectIds ? { objectIds: options.objectIds } : {},
|
|
10995
|
+
...options.query ? { query: options.query } : {}
|
|
10996
|
+
});
|
|
10997
|
+
return this;
|
|
10998
|
+
}
|
|
10999
|
+
planLine() {
|
|
11000
|
+
return `MemberFilter: ${this.name}${this.rules.length ? ` (${this.rules.length} rules)` : ""}`;
|
|
11001
|
+
}
|
|
11002
|
+
async apply(client) {
|
|
11003
|
+
const payload = {
|
|
11004
|
+
name: this.name,
|
|
11005
|
+
description: this.description,
|
|
11006
|
+
rules: this.rules
|
|
11007
|
+
};
|
|
11008
|
+
const result = await client.createMemberFilter(payload);
|
|
11009
|
+
this._id = result.id;
|
|
11010
|
+
this._uuid = result.uuid;
|
|
11011
|
+
this._created = true;
|
|
11012
|
+
}
|
|
11013
|
+
};
|
|
11014
|
+
var RoutineBuilder = class extends WorkspaceBuilderResource {
|
|
11015
|
+
constructor(name, cronSchedule = "", options = {}) {
|
|
11016
|
+
super();
|
|
11017
|
+
this.name = name;
|
|
11018
|
+
this.cronSchedule = cronSchedule;
|
|
11019
|
+
this.active = options.active ?? false;
|
|
11020
|
+
this.description = options.description ?? "";
|
|
11021
|
+
}
|
|
11022
|
+
active;
|
|
11023
|
+
description;
|
|
11024
|
+
rules = [];
|
|
11025
|
+
addRule(actionType, options = {}) {
|
|
11026
|
+
this.rules.push({
|
|
11027
|
+
actionType,
|
|
11028
|
+
workflow: options.workflow,
|
|
11029
|
+
memberFilter: options.memberFilter,
|
|
11030
|
+
actionParams: options.actionParams ?? {}
|
|
11031
|
+
});
|
|
11032
|
+
return this;
|
|
11033
|
+
}
|
|
11034
|
+
planLine() {
|
|
11035
|
+
const parts = [
|
|
11036
|
+
...this.cronSchedule ? [`cron=${this.cronSchedule}`] : [],
|
|
11037
|
+
...this.rules.length ? [`${this.rules.length} rules`] : [],
|
|
11038
|
+
this.active ? "active" : "inactive"
|
|
11039
|
+
];
|
|
11040
|
+
return `Routine: ${this.name} (${parts.join(", ")})`;
|
|
11041
|
+
}
|
|
11042
|
+
async apply(client) {
|
|
11043
|
+
const eventRules = this.rules.map((rule) => {
|
|
11044
|
+
const actionParams = { ...rule.actionParams };
|
|
11045
|
+
if (rule.workflow?._id !== void 0) actionParams.workflowId = rule.workflow._id;
|
|
11046
|
+
if (rule.memberFilter?._id !== void 0)
|
|
11047
|
+
actionParams.memberFilterId = rule.memberFilter._id;
|
|
11048
|
+
return {
|
|
11049
|
+
uuid: crypto.randomUUID(),
|
|
11050
|
+
objectType: "routine" /* ROUTINE */,
|
|
11051
|
+
eventType: "routine:triggered" /* ROUTINE_TRIGGERED */,
|
|
11052
|
+
actionType: rule.actionType,
|
|
11053
|
+
actionParams,
|
|
11054
|
+
active: true
|
|
11055
|
+
};
|
|
11056
|
+
});
|
|
11057
|
+
const payload = {
|
|
11058
|
+
name: this.name,
|
|
11059
|
+
cronString: this.cronSchedule,
|
|
11060
|
+
scheduleMode: this.cronSchedule ? "CRON" : void 0,
|
|
11061
|
+
scheduleEnabled: this.active,
|
|
11062
|
+
...this.description ? { description: this.description } : {},
|
|
11063
|
+
...eventRules.length ? { eventRules } : {}
|
|
11064
|
+
};
|
|
11065
|
+
const result = await client.createRoutine(payload);
|
|
11066
|
+
this._id = result.id;
|
|
11067
|
+
this._uuid = result.uuid;
|
|
11068
|
+
this._created = true;
|
|
11069
|
+
}
|
|
11070
|
+
};
|
|
11071
|
+
var NotificationRuleBuilder = class extends WorkspaceBuilderResource {
|
|
11072
|
+
constructor(name, options = {}) {
|
|
11073
|
+
super();
|
|
11074
|
+
this.name = name;
|
|
11075
|
+
this.noticeType = options.noticeType ?? options.notice_type ?? name;
|
|
11076
|
+
this.memberId = options.memberId ?? options.member_id;
|
|
11077
|
+
this.workflow = options.workflow;
|
|
11078
|
+
this.prompt = options.prompt ?? options.message;
|
|
11079
|
+
this.notifySms = Boolean(options.notifySms ?? options.notify_sms);
|
|
11080
|
+
this.notifyEmail = Boolean(options.notifyEmail ?? options.notify_email);
|
|
11081
|
+
this.notifyVoice = Boolean(options.notifyVoice ?? options.notify_voice);
|
|
11082
|
+
}
|
|
11083
|
+
noticeType;
|
|
11084
|
+
memberId;
|
|
11085
|
+
workflow;
|
|
11086
|
+
prompt;
|
|
11087
|
+
notifySms;
|
|
11088
|
+
notifyEmail;
|
|
11089
|
+
notifyVoice;
|
|
11090
|
+
planLine() {
|
|
11091
|
+
const parts = [];
|
|
11092
|
+
if (this.memberId !== void 0) parts.push(`memberId=${this.memberId}`);
|
|
11093
|
+
if (this.workflow) parts.push(`workflow='${this.workflow.name}'`);
|
|
11094
|
+
return `NotificationRule: ${this.name}${parts.length ? ` (${parts.join(", ")})` : ""}`;
|
|
11095
|
+
}
|
|
11096
|
+
async apply(client) {
|
|
11097
|
+
if (this.memberId === void 0) {
|
|
11098
|
+
throw new Error(`Notification rule '${this.name}' requires memberId`);
|
|
11099
|
+
}
|
|
11100
|
+
const payload = {
|
|
11101
|
+
noticeType: this.noticeType,
|
|
11102
|
+
memberId: this.memberId,
|
|
11103
|
+
workflowId: this.workflow?._id,
|
|
11104
|
+
prompt: this.prompt ?? null,
|
|
11105
|
+
notifySms: this.notifySms,
|
|
11106
|
+
notifyEmail: this.notifyEmail,
|
|
11107
|
+
notifyVoice: this.notifyVoice
|
|
11108
|
+
};
|
|
11109
|
+
const result = await client.createNotificationRule(payload);
|
|
11110
|
+
this._id = result.id;
|
|
11111
|
+
this._created = true;
|
|
11112
|
+
}
|
|
11113
|
+
};
|
|
11114
|
+
|
|
11115
|
+
// src/workspace-builder/forms.ts
|
|
11116
|
+
function normalizeOptions(options) {
|
|
11117
|
+
if (options.length === 0) return [];
|
|
11118
|
+
const first = options[0];
|
|
11119
|
+
if (isRecord(first)) return options;
|
|
11120
|
+
if (Array.isArray(first)) {
|
|
11121
|
+
return options.map((entry) => ({ label: String(entry[0]), value: entry[1] }));
|
|
11122
|
+
}
|
|
11123
|
+
return options.map((option) => ({ label: String(option), value: String(option) }));
|
|
11124
|
+
}
|
|
11125
|
+
function createFieldDraft(fieldType, name, slug, options = {}) {
|
|
11126
|
+
return {
|
|
11127
|
+
name,
|
|
11128
|
+
slug,
|
|
11129
|
+
fieldType,
|
|
11130
|
+
required: Boolean(options.required),
|
|
11131
|
+
order: options.order ?? 0,
|
|
11132
|
+
...options.description ? { description: options.description } : {},
|
|
11133
|
+
...options.choices ? { options: options.choices } : {},
|
|
11134
|
+
...options.cel ? { celFunction: options.cel } : {}
|
|
11135
|
+
};
|
|
11136
|
+
}
|
|
11137
|
+
var FormBuilder = class extends WorkspaceBuilderResource {
|
|
11138
|
+
name;
|
|
11139
|
+
slug;
|
|
11140
|
+
description;
|
|
11141
|
+
prompt;
|
|
11142
|
+
collection;
|
|
11143
|
+
fields = [];
|
|
11144
|
+
eventRules = [];
|
|
11145
|
+
constructor(name, slug, options = {}) {
|
|
11146
|
+
super();
|
|
11147
|
+
this.name = name;
|
|
11148
|
+
this.slug = slug ?? slugify(name);
|
|
11149
|
+
this.description = options.description ?? "";
|
|
11150
|
+
this.prompt = options.prompt ?? "";
|
|
11151
|
+
this.collection = options.collection ?? false;
|
|
11152
|
+
for (const field of options.fields ?? []) {
|
|
11153
|
+
if (!isRecord(field) || !field.name) continue;
|
|
11154
|
+
const choices = field.options ? normalizeOptions(field.options) : void 0;
|
|
11155
|
+
this.fields.push(
|
|
11156
|
+
createFieldDraft(
|
|
11157
|
+
field.fieldType ?? field.field_type ?? "text" /* TEXT */,
|
|
11158
|
+
field.name,
|
|
11159
|
+
field.slug ?? slugify(field.name),
|
|
11160
|
+
{
|
|
11161
|
+
required: Boolean(field.required ?? field.isRequired),
|
|
11162
|
+
order: field.order ?? 0,
|
|
11163
|
+
description: field.description,
|
|
11164
|
+
choices
|
|
11165
|
+
}
|
|
11166
|
+
)
|
|
11167
|
+
);
|
|
11168
|
+
}
|
|
11169
|
+
}
|
|
11170
|
+
field(fieldType, name, slug, options = {}) {
|
|
11171
|
+
this.fields.push(createFieldDraft(fieldType, name, slug, options));
|
|
11172
|
+
return this;
|
|
11173
|
+
}
|
|
11174
|
+
enumField(name, slug, options, settings = {}) {
|
|
11175
|
+
return this.field("enum" /* ENUM */, name, slug, {
|
|
11176
|
+
...settings,
|
|
11177
|
+
choices: normalizeOptions(options)
|
|
11178
|
+
});
|
|
11179
|
+
}
|
|
11180
|
+
textField(name, slug, settings = {}) {
|
|
11181
|
+
return this.field("text" /* TEXT */, name, slug, settings);
|
|
11182
|
+
}
|
|
11183
|
+
numberField(name, slug, settings = {}) {
|
|
11184
|
+
return this.field("number" /* NUMBER */, name, slug, settings);
|
|
11185
|
+
}
|
|
11186
|
+
dateField(name, slug, settings = {}) {
|
|
11187
|
+
return this.field("date" /* DATE */, name, slug, settings);
|
|
11188
|
+
}
|
|
11189
|
+
booleanField(name, slug, settings = {}) {
|
|
11190
|
+
return this.field("boolean" /* BOOLEAN */, name, slug, settings);
|
|
11191
|
+
}
|
|
11192
|
+
functionField(name, slug, cel, settings = {}) {
|
|
11193
|
+
return this.field("function" /* FUNCTION */, name, slug, { ...settings, cel });
|
|
11194
|
+
}
|
|
11195
|
+
emailField(name, slug, settings = {}) {
|
|
11196
|
+
return this.field("email" /* EMAIL */, name, slug, settings);
|
|
11197
|
+
}
|
|
11198
|
+
phoneField(name, slug, settings = {}) {
|
|
11199
|
+
return this.field("phone" /* PHONE */, name, slug, settings);
|
|
11200
|
+
}
|
|
11201
|
+
longtextField(name, slug, settings = {}) {
|
|
11202
|
+
return this.field("longtext" /* LONGTEXT */, name, slug, settings);
|
|
11203
|
+
}
|
|
11204
|
+
integerField(name, slug, settings = {}) {
|
|
11205
|
+
return this.field("integer" /* INTEGER */, name, slug, settings);
|
|
11206
|
+
}
|
|
11207
|
+
datetimeField(name, slug, settings = {}) {
|
|
11208
|
+
return this.field("datetime" /* DATETIME */, name, slug, settings);
|
|
11209
|
+
}
|
|
11210
|
+
timeOfDayField(name, slug, settings = {}) {
|
|
11211
|
+
return this.field("time_of_day" /* TIME_OF_DAY */, name, slug, settings);
|
|
11212
|
+
}
|
|
11213
|
+
usZipCodeField(name, slug, settings = {}) {
|
|
11214
|
+
return this.field("us_zip_code" /* US_ZIP_CODE */, name, slug, settings);
|
|
11215
|
+
}
|
|
11216
|
+
arrayField(name, slug, settings = {}) {
|
|
11217
|
+
return this.field("array" /* ARRAY */, name, slug, settings);
|
|
11218
|
+
}
|
|
11219
|
+
objectField(name, slug, settings = {}) {
|
|
11220
|
+
return this.field("object" /* OBJECT */, name, slug, settings);
|
|
11221
|
+
}
|
|
11222
|
+
onRecordCreated(action, params = {}, condition, name) {
|
|
11223
|
+
this.eventRules.push({
|
|
11224
|
+
eventType: "data_record:created" /* DATA_RECORD_CREATED */,
|
|
11225
|
+
actionType: action,
|
|
11226
|
+
actionParams: params,
|
|
11227
|
+
condition,
|
|
11228
|
+
name
|
|
11229
|
+
});
|
|
11230
|
+
return this;
|
|
11231
|
+
}
|
|
11232
|
+
onRecordUpdated(action, params = {}, condition, name) {
|
|
11233
|
+
this.eventRules.push({
|
|
11234
|
+
eventType: "data_record:updated" /* DATA_RECORD_UPDATED */,
|
|
11235
|
+
actionType: action,
|
|
11236
|
+
actionParams: params,
|
|
11237
|
+
condition,
|
|
11238
|
+
name
|
|
11239
|
+
});
|
|
11240
|
+
return this;
|
|
11241
|
+
}
|
|
11242
|
+
matchKey() {
|
|
11243
|
+
return this.slug;
|
|
11244
|
+
}
|
|
11245
|
+
planLine() {
|
|
11246
|
+
return `Form: ${this.name} (slug=${this.slug}, ${this.fields.length} fields)`;
|
|
11247
|
+
}
|
|
11248
|
+
async apply(client) {
|
|
11249
|
+
if (this._existed) return;
|
|
11250
|
+
const payload = {
|
|
11251
|
+
name: this.name,
|
|
11252
|
+
slug: this.slug,
|
|
11253
|
+
description: this.description,
|
|
11254
|
+
prompt: this.prompt,
|
|
11255
|
+
isCollection: this.collection,
|
|
11256
|
+
fields: this.fields
|
|
11257
|
+
};
|
|
11258
|
+
const result = await client.createDataType(payload);
|
|
11259
|
+
this._id = result.id;
|
|
11260
|
+
this._uuid = result.uuid;
|
|
11261
|
+
this._created = true;
|
|
11262
|
+
}
|
|
11263
|
+
};
|
|
11264
|
+
var MemberLabelBuilder = class extends WorkspaceBuilderResource {
|
|
11265
|
+
name;
|
|
11266
|
+
slug;
|
|
11267
|
+
color;
|
|
11268
|
+
description;
|
|
11269
|
+
constructor(name, slug, color = "8b5cf6", description = "") {
|
|
11270
|
+
super();
|
|
11271
|
+
this.name = name;
|
|
11272
|
+
this.slug = slug ?? slugify(name);
|
|
11273
|
+
this.color = color;
|
|
11274
|
+
this.description = description;
|
|
11275
|
+
}
|
|
11276
|
+
matchKey() {
|
|
11277
|
+
return this.slug;
|
|
11278
|
+
}
|
|
11279
|
+
planLine() {
|
|
11280
|
+
return `Label: ${this.name} (slug=${this.slug})`;
|
|
11281
|
+
}
|
|
11282
|
+
async apply(client) {
|
|
11283
|
+
if (this._existed) return;
|
|
11284
|
+
const payload = {
|
|
11285
|
+
name: this.name,
|
|
11286
|
+
slug: this.slug,
|
|
11287
|
+
color: this.color,
|
|
11288
|
+
description: this.description
|
|
11289
|
+
};
|
|
11290
|
+
const result = await client.createMemberLabel(payload);
|
|
11291
|
+
this._id = result.id;
|
|
11292
|
+
this._uuid = result.uuid;
|
|
11293
|
+
this._created = true;
|
|
11294
|
+
}
|
|
11295
|
+
};
|
|
11296
|
+
|
|
11297
|
+
// src/workspace-builder/journeys.ts
|
|
11298
|
+
var JourneyStepBuilder = class extends WorkspaceBuilderResource {
|
|
11299
|
+
constructor(name, journey, order = 0, workflow, description = "") {
|
|
11300
|
+
super();
|
|
11301
|
+
this.name = name;
|
|
11302
|
+
this.journey = journey;
|
|
11303
|
+
this.order = order;
|
|
11304
|
+
this.workflow = workflow;
|
|
11305
|
+
this.description = description;
|
|
11306
|
+
}
|
|
11307
|
+
connections = [];
|
|
11308
|
+
connectsTo(child, condition, required = false, timeoutSeconds) {
|
|
11309
|
+
this.connections.push({ parent: this, child, condition, required, timeoutSeconds });
|
|
11310
|
+
return this;
|
|
11311
|
+
}
|
|
11312
|
+
planLine() {
|
|
11313
|
+
return `Step: ${this.name}${this.workflow ? ` -> workflow '${this.workflow.name}'` : ""}`;
|
|
11314
|
+
}
|
|
11315
|
+
async apply(client) {
|
|
11316
|
+
if (this.journey._id === void 0) return;
|
|
11317
|
+
const payload = {
|
|
11318
|
+
name: this.name,
|
|
11319
|
+
description: this.description,
|
|
11320
|
+
order: this.order,
|
|
11321
|
+
...this.workflow?._id ? { workflowId: this.workflow._id } : {}
|
|
11322
|
+
};
|
|
11323
|
+
const result = await client.createStep(this.journey._id, payload);
|
|
11324
|
+
this._id = result.id;
|
|
11325
|
+
this._uuid = result.uuid;
|
|
11326
|
+
this._created = true;
|
|
11327
|
+
}
|
|
11328
|
+
};
|
|
11329
|
+
var JourneyBuilder = class extends WorkspaceBuilderResource {
|
|
11330
|
+
constructor(name, options = {}) {
|
|
11331
|
+
super();
|
|
11332
|
+
this.name = name;
|
|
11333
|
+
this.description = options.description ?? "";
|
|
11334
|
+
}
|
|
11335
|
+
description;
|
|
11336
|
+
steps = [];
|
|
11337
|
+
goals = [];
|
|
11338
|
+
step(name, options = {}) {
|
|
11339
|
+
const step = new JourneyStepBuilder(
|
|
11340
|
+
name,
|
|
11341
|
+
this,
|
|
11342
|
+
options.order ?? 0,
|
|
11343
|
+
options.workflow,
|
|
11344
|
+
options.description ?? ""
|
|
11345
|
+
);
|
|
11346
|
+
this.steps.push(step);
|
|
11347
|
+
return step;
|
|
11348
|
+
}
|
|
11349
|
+
goal(name, options = {}) {
|
|
11350
|
+
this.goals.push({
|
|
11351
|
+
name,
|
|
11352
|
+
description: options.description ?? "",
|
|
11353
|
+
step: options.step,
|
|
11354
|
+
completionCel: options.completionCel ?? options.completion_cel,
|
|
11355
|
+
value: options.value,
|
|
11356
|
+
order: options.order ?? 0
|
|
11357
|
+
});
|
|
11358
|
+
return this;
|
|
11359
|
+
}
|
|
11360
|
+
planLine() {
|
|
11361
|
+
const parts = [];
|
|
11362
|
+
if (this.steps.length) parts.push(`${this.steps.length} steps`);
|
|
11363
|
+
if (this.goals.length) parts.push(`${this.goals.length} goals`);
|
|
11364
|
+
return `Journey: ${this.name}${parts.length ? ` (${parts.join(", ")})` : ""}`;
|
|
11365
|
+
}
|
|
11366
|
+
async apply(client) {
|
|
11367
|
+
const result = await client.createJourney({
|
|
11368
|
+
name: this.name,
|
|
11369
|
+
description: this.description
|
|
11370
|
+
});
|
|
11371
|
+
this._id = result.id;
|
|
11372
|
+
this._uuid = result.uuid;
|
|
11373
|
+
this._created = true;
|
|
11374
|
+
}
|
|
11375
|
+
};
|
|
11376
|
+
function buildJourneyConnectionPayload(connection) {
|
|
11377
|
+
if (!connection.parent._uuid || !connection.child._uuid) return void 0;
|
|
11378
|
+
return {
|
|
11379
|
+
parentStepUuid: connection.parent._uuid,
|
|
11380
|
+
childStepUuid: connection.child._uuid,
|
|
11381
|
+
...connection.condition ? { celCondition: connection.condition } : {},
|
|
11382
|
+
...connection.required ? { required: true } : {},
|
|
11383
|
+
...connection.timeoutSeconds ? { timeoutSeconds: connection.timeoutSeconds } : {}
|
|
11384
|
+
};
|
|
11385
|
+
}
|
|
11386
|
+
function buildJourneyGoalPayload(goal) {
|
|
11387
|
+
return {
|
|
11388
|
+
name: goal.name,
|
|
11389
|
+
description: goal.description,
|
|
11390
|
+
order: goal.order,
|
|
11391
|
+
...goal.step?._uuid ? { goalStepUuid: goal.step._uuid } : {},
|
|
11392
|
+
...goal.completionCel ? { completionCel: goal.completionCel } : {},
|
|
11393
|
+
...goal.value !== void 0 ? { value: goal.value } : {}
|
|
11394
|
+
};
|
|
11395
|
+
}
|
|
11396
|
+
|
|
11397
|
+
// src/workspace-builder/role-update.ts
|
|
11398
|
+
var RoleUpdate = class extends WorkspaceBuilderResource {
|
|
11399
|
+
constructor(roleId, workflowIds, dataTypeIds) {
|
|
11400
|
+
super();
|
|
11401
|
+
this.roleId = roleId;
|
|
11402
|
+
this.workflowIds = workflowIds;
|
|
11403
|
+
this.dataTypeIds = dataTypeIds;
|
|
11404
|
+
}
|
|
11405
|
+
planLine() {
|
|
11406
|
+
const parts = [];
|
|
11407
|
+
if (this.workflowIds) parts.push(`workflows=${JSON.stringify(this.workflowIds)}`);
|
|
11408
|
+
if (this.dataTypeIds) parts.push(`dataTypes=${JSON.stringify(this.dataTypeIds)}`);
|
|
11409
|
+
return `RoleUpdate: roleId=${this.roleId}${parts.length ? ` (${parts.join(", ")})` : ""}`;
|
|
11410
|
+
}
|
|
11411
|
+
async apply(client) {
|
|
11412
|
+
const payload = {};
|
|
11413
|
+
if (this.workflowIds) payload.workflowIds = this.workflowIds;
|
|
11414
|
+
if (this.dataTypeIds) payload.dataTypeIds = this.dataTypeIds;
|
|
11415
|
+
if (Object.keys(payload).length) await client.updateMemberRole(this.roleId, payload);
|
|
11416
|
+
this._id = this.roleId;
|
|
11417
|
+
this._created = true;
|
|
11418
|
+
}
|
|
11419
|
+
};
|
|
11420
|
+
|
|
11421
|
+
// src/workspace-builder/workflows.ts
|
|
11422
|
+
var PERM_KEYS = {
|
|
11423
|
+
canRead: "canRead",
|
|
11424
|
+
canCreate: "canCreate",
|
|
11425
|
+
canEdit: "canEdit",
|
|
11426
|
+
can_read: "canRead",
|
|
11427
|
+
can_create: "canCreate",
|
|
11428
|
+
can_edit: "canEdit"
|
|
11429
|
+
};
|
|
11430
|
+
var ABILITY_TYPE_MAP = {
|
|
11431
|
+
data_access: "integration:data_access",
|
|
11432
|
+
file_access: "integration:file_access",
|
|
11433
|
+
escalation: "oversight:escalation"
|
|
11434
|
+
};
|
|
11435
|
+
var AbilityDef = class {
|
|
11436
|
+
constructor(abilityType, options = {}) {
|
|
11437
|
+
this.abilityType = abilityType;
|
|
11438
|
+
this.config = options.config ?? {};
|
|
11439
|
+
this.enabled = options.enabled ?? true;
|
|
11440
|
+
this.celCondition = options.celCondition ?? options.cel_condition;
|
|
11441
|
+
this.form = options.form;
|
|
11442
|
+
for (const [inputKey, outputKey] of Object.entries(PERM_KEYS)) {
|
|
11443
|
+
if (inputKey in options) this.perms[outputKey] = options[inputKey];
|
|
11444
|
+
}
|
|
11445
|
+
}
|
|
11446
|
+
uuid = crypto.randomUUID();
|
|
11447
|
+
config;
|
|
11448
|
+
enabled;
|
|
11449
|
+
celCondition;
|
|
11450
|
+
form;
|
|
11451
|
+
perms = {};
|
|
11452
|
+
toAbility() {
|
|
11453
|
+
const config = { ...this.config };
|
|
11454
|
+
if (this.form?._uuid) {
|
|
11455
|
+
config.dataTypeUuid = this.form._uuid;
|
|
11456
|
+
Object.assign(config, this.perms);
|
|
11457
|
+
}
|
|
11458
|
+
return {
|
|
11459
|
+
uuid: this.uuid,
|
|
11460
|
+
abilityType: ABILITY_TYPE_MAP[this.abilityType] ?? this.abilityType,
|
|
11461
|
+
config,
|
|
11462
|
+
enabled: this.enabled,
|
|
11463
|
+
...this.celCondition ? { celCondition: this.celCondition } : {}
|
|
11464
|
+
};
|
|
11465
|
+
}
|
|
11466
|
+
};
|
|
11467
|
+
var TaskBuilder = class extends WorkspaceBuilderResource {
|
|
11468
|
+
constructor(name, workflow, prompt = "", start = false, description = "") {
|
|
11469
|
+
super();
|
|
11470
|
+
this.name = name;
|
|
11471
|
+
this.workflow = workflow;
|
|
11472
|
+
this.prompt = prompt;
|
|
11473
|
+
this.start = start;
|
|
11474
|
+
this.description = description;
|
|
11475
|
+
}
|
|
11476
|
+
transitions = [];
|
|
11477
|
+
eventRules = [];
|
|
11478
|
+
transitionsTo(child, when, autoNext = false, required = false) {
|
|
11479
|
+
if (child === this) {
|
|
11480
|
+
throw new Error(`Task '${this.name}' cannot transition to itself`);
|
|
11481
|
+
}
|
|
11482
|
+
this.transitions.push({ parent: this, child, when, autoNext, required });
|
|
11483
|
+
return this;
|
|
11484
|
+
}
|
|
11485
|
+
onEnter(action, params = {}, name) {
|
|
11486
|
+
this.eventRules.push({
|
|
11487
|
+
eventType: "task:execute" /* TASK_EXECUTE */,
|
|
11488
|
+
actionType: action,
|
|
11489
|
+
actionParams: params,
|
|
11490
|
+
name
|
|
11491
|
+
});
|
|
11492
|
+
return this;
|
|
11493
|
+
}
|
|
11494
|
+
initialMessage(message, suggestions) {
|
|
11495
|
+
return this.onEnter("assistant:message", {
|
|
11496
|
+
message,
|
|
11497
|
+
...suggestions ? { suggestions } : {}
|
|
11498
|
+
});
|
|
11499
|
+
}
|
|
11500
|
+
planLine() {
|
|
11501
|
+
return `Task: ${this.name}${this.start ? " [start]" : ""}`;
|
|
11502
|
+
}
|
|
11503
|
+
async apply(client) {
|
|
11504
|
+
if (this._existed || this.workflow._id === void 0) return;
|
|
11505
|
+
const result = await client.createTask({
|
|
11506
|
+
workflowId: this.workflow._id,
|
|
11507
|
+
name: this.name,
|
|
11508
|
+
prompt: this.prompt,
|
|
11509
|
+
description: this.description
|
|
11510
|
+
});
|
|
11511
|
+
this._id = result.id;
|
|
11512
|
+
this._uuid = result.uuid;
|
|
11513
|
+
this._created = true;
|
|
11514
|
+
}
|
|
11515
|
+
};
|
|
11516
|
+
var WorkflowBuilder = class extends WorkspaceBuilderResource {
|
|
11517
|
+
constructor(name, options = {}) {
|
|
11518
|
+
super();
|
|
11519
|
+
this.name = name;
|
|
11520
|
+
this.description = options.description ?? "";
|
|
11521
|
+
this.prompt = options.prompt;
|
|
11522
|
+
this.agentId = options.agentId ?? options.agent_id;
|
|
11523
|
+
}
|
|
11524
|
+
description;
|
|
11525
|
+
prompt;
|
|
11526
|
+
agentId;
|
|
11527
|
+
tasks = [];
|
|
11528
|
+
abilities = [];
|
|
11529
|
+
task(name, options = {}) {
|
|
11530
|
+
const task = new TaskBuilder(
|
|
11531
|
+
name,
|
|
11532
|
+
this,
|
|
11533
|
+
options.prompt ?? "",
|
|
11534
|
+
options.start ?? false,
|
|
11535
|
+
options.description ?? ""
|
|
11536
|
+
);
|
|
11537
|
+
this.tasks.push(task);
|
|
11538
|
+
return task;
|
|
11539
|
+
}
|
|
11540
|
+
ability(abilityType, options = {}) {
|
|
11541
|
+
this.abilities.push(new AbilityDef(abilityType, options));
|
|
11542
|
+
return this;
|
|
11543
|
+
}
|
|
11544
|
+
get startTask() {
|
|
11545
|
+
return this.tasks.find((task) => task.start) ?? this.tasks[0];
|
|
11546
|
+
}
|
|
11547
|
+
matchKey() {
|
|
11548
|
+
return this.name;
|
|
11549
|
+
}
|
|
11550
|
+
adopt(existing) {
|
|
11551
|
+
super.adopt(existing);
|
|
11552
|
+
const start = this.startTask;
|
|
11553
|
+
if (start && existing.startTaskId) {
|
|
11554
|
+
start._id = existing.startTaskId;
|
|
11555
|
+
start._existed = true;
|
|
11556
|
+
}
|
|
11557
|
+
}
|
|
11558
|
+
planLine() {
|
|
11559
|
+
const details = [];
|
|
11560
|
+
if (this.tasks.length) details.push(`${this.tasks.length} tasks`);
|
|
11561
|
+
if (this.abilities.length) details.push(`${this.abilities.length} abilities`);
|
|
11562
|
+
return `Workflow: ${this.name}${details.length ? ` (${details.join(", ")})` : ""}`;
|
|
11563
|
+
}
|
|
11564
|
+
async apply(client) {
|
|
11565
|
+
if (this._existed) return;
|
|
11566
|
+
const payload = {
|
|
11567
|
+
name: this.name,
|
|
11568
|
+
description: this.description,
|
|
11569
|
+
createMode: "taskless",
|
|
11570
|
+
...this.prompt ? { prompt: this.prompt } : {},
|
|
11571
|
+
...this.agentId ? { agentId: this.agentId } : {},
|
|
11572
|
+
...this.abilities.length ? { abilities: this.abilities.map((ability) => ability.toAbility()) } : {}
|
|
11573
|
+
};
|
|
11574
|
+
const result = await client.createWorkflow(payload);
|
|
11575
|
+
this._id = result.id;
|
|
11576
|
+
this._uuid = result.uuid;
|
|
11577
|
+
this._created = true;
|
|
11578
|
+
}
|
|
11579
|
+
};
|
|
11580
|
+
var AgentBuilder = class extends WorkspaceBuilderResource {
|
|
11581
|
+
constructor(name, options = {}) {
|
|
11582
|
+
super();
|
|
11583
|
+
this.name = name;
|
|
11584
|
+
this.chatModelId = options.chatModelId ?? options.chat_model_id ?? "";
|
|
11585
|
+
this.systemPrompt = options.systemPrompt ?? options.system_prompt ?? "";
|
|
11586
|
+
this.memberRoleId = options.roleId ?? options.role_id;
|
|
11587
|
+
this.tools = options.tools ?? [];
|
|
11588
|
+
this.codeInterpreterEnabled = options.codeInterpreterEnabled ?? options.code_interpreter_enabled ?? false;
|
|
11589
|
+
}
|
|
11590
|
+
chatModelId;
|
|
11591
|
+
systemPrompt;
|
|
11592
|
+
memberRoleId;
|
|
11593
|
+
tools;
|
|
11594
|
+
codeInterpreterEnabled;
|
|
11595
|
+
planLine() {
|
|
11596
|
+
const parts = [];
|
|
11597
|
+
if (this.chatModelId) parts.push(`model=${this.chatModelId}`);
|
|
11598
|
+
if (this.tools.length) parts.push(`${this.tools.length} tools`);
|
|
11599
|
+
return `Agent: ${this.name}${parts.length ? ` (${parts.join(", ")})` : ""}`;
|
|
11600
|
+
}
|
|
11601
|
+
async apply(client) {
|
|
11602
|
+
if (this.memberRoleId === void 0) {
|
|
11603
|
+
throw new Error(`Agent '${this.name}' requires memberRoleId`);
|
|
11604
|
+
}
|
|
11605
|
+
if (!this.chatModelId) {
|
|
11606
|
+
throw new Error(`Agent '${this.name}' requires chatModelId`);
|
|
11607
|
+
}
|
|
11608
|
+
const payload = {
|
|
11609
|
+
name: this.name,
|
|
11610
|
+
memberRoleId: this.memberRoleId,
|
|
11611
|
+
chatModelId: this.chatModelId,
|
|
11612
|
+
systemPrompt: this.systemPrompt,
|
|
11613
|
+
...this.tools.length ? { tools: this.tools } : {},
|
|
11614
|
+
...this.codeInterpreterEnabled ? { codeInterpreterEnabled: true } : {}
|
|
11615
|
+
};
|
|
11616
|
+
const result = await client.createAgent(payload);
|
|
11617
|
+
this._id = result.id;
|
|
11618
|
+
this._uuid = result.uuid;
|
|
11619
|
+
this._created = true;
|
|
11620
|
+
}
|
|
11621
|
+
};
|
|
11622
|
+
|
|
11623
|
+
// src/workspace-builder/orchestrator.ts
|
|
11624
|
+
var PHASES = /* @__PURE__ */ new Map([
|
|
11625
|
+
[FormBuilder, 0],
|
|
11626
|
+
[MemberLabelBuilder, 0],
|
|
11627
|
+
[AgentBuilder, 1],
|
|
11628
|
+
[WorkflowBuilder, 2],
|
|
11629
|
+
[TaskBuilder, 3],
|
|
11630
|
+
[RoleUpdate, 4],
|
|
11631
|
+
[MemberFilterBuilder, 5],
|
|
11632
|
+
[RoutineBuilder, 6],
|
|
11633
|
+
[NotificationRuleBuilder, 6],
|
|
11634
|
+
[JourneyBuilder, 7],
|
|
11635
|
+
[JourneyStepBuilder, 8]
|
|
11636
|
+
]);
|
|
11637
|
+
var WorkspaceBuilder = class {
|
|
11638
|
+
constructor(client) {
|
|
11639
|
+
this.client = client;
|
|
11640
|
+
}
|
|
11641
|
+
resources = [];
|
|
11642
|
+
form(name, options = {}) {
|
|
11643
|
+
const form = new FormBuilder(name, options.slug, options);
|
|
11644
|
+
this.resources.push(form);
|
|
11645
|
+
return form;
|
|
11646
|
+
}
|
|
11647
|
+
workflow(name, options = {}) {
|
|
11648
|
+
const workflow = new WorkflowBuilder(name, options);
|
|
11649
|
+
this.resources.push(workflow);
|
|
11650
|
+
return workflow;
|
|
11651
|
+
}
|
|
11652
|
+
label(name, options = {}) {
|
|
11653
|
+
const label = new MemberLabelBuilder(
|
|
11654
|
+
name,
|
|
11655
|
+
options.slug,
|
|
11656
|
+
options.color,
|
|
11657
|
+
options.description ?? ""
|
|
11658
|
+
);
|
|
11659
|
+
this.resources.push(label);
|
|
11660
|
+
return label;
|
|
11661
|
+
}
|
|
11662
|
+
journey(name, options = {}) {
|
|
11663
|
+
const journey = new JourneyBuilder(name, options);
|
|
11664
|
+
this.resources.push(journey);
|
|
11665
|
+
return journey;
|
|
11666
|
+
}
|
|
11667
|
+
agent(name, options = {}) {
|
|
11668
|
+
const agent = new AgentBuilder(name, options);
|
|
11669
|
+
this.resources.push(agent);
|
|
11670
|
+
return agent;
|
|
11671
|
+
}
|
|
11672
|
+
routine(name, cronSchedule = "", options = {}) {
|
|
11673
|
+
const routine = new RoutineBuilder(name, cronSchedule, options);
|
|
11674
|
+
this.resources.push(routine);
|
|
11675
|
+
return routine;
|
|
11676
|
+
}
|
|
11677
|
+
memberFilter(name, options = {}) {
|
|
11678
|
+
const filter = new MemberFilterBuilder(name, options);
|
|
11679
|
+
this.resources.push(filter);
|
|
11680
|
+
return filter;
|
|
11681
|
+
}
|
|
11682
|
+
notificationRule(name, options = {}) {
|
|
11683
|
+
const rule = new NotificationRuleBuilder(name, options);
|
|
11684
|
+
this.resources.push(rule);
|
|
11685
|
+
return rule;
|
|
11686
|
+
}
|
|
11687
|
+
roleUpdate(roleId, workflowIds, dataTypeIds) {
|
|
11688
|
+
const update = new RoleUpdate(roleId, workflowIds, dataTypeIds);
|
|
11689
|
+
this.resources.push(update);
|
|
11690
|
+
return update;
|
|
11691
|
+
}
|
|
11692
|
+
plan() {
|
|
11693
|
+
const resources = this.sortedResources();
|
|
11694
|
+
writeLine(`
|
|
11695
|
+
${"=".repeat(50)}`);
|
|
11696
|
+
writeLine("Plan");
|
|
11697
|
+
writeLine("=".repeat(50));
|
|
11698
|
+
for (const resource of resources) {
|
|
11699
|
+
writeLine(` + ${resource.planLine()}`);
|
|
11700
|
+
}
|
|
11701
|
+
const wiring = this.collectWiringSummary(resources);
|
|
11702
|
+
if (wiring.length) {
|
|
11703
|
+
writeLine("\n Wiring:");
|
|
11704
|
+
for (const line of wiring) writeLine(` ${line}`);
|
|
11705
|
+
}
|
|
11706
|
+
writeLine(`
|
|
11707
|
+
Total: ${resources.length} resources, ${wiring.length} connections`);
|
|
11708
|
+
writeLine(`${"=".repeat(50)}
|
|
11709
|
+
`);
|
|
11710
|
+
}
|
|
11711
|
+
async preview() {
|
|
11712
|
+
const resources = this.sortedResources();
|
|
11713
|
+
await this.resolveExisting(resources);
|
|
11714
|
+
writeLine(`
|
|
11715
|
+
${"=".repeat(50)}`);
|
|
11716
|
+
writeLine("Preview");
|
|
11717
|
+
writeLine("=".repeat(50));
|
|
11718
|
+
for (const resource of resources) {
|
|
11719
|
+
if (resource._existed) {
|
|
11720
|
+
writeLine(` = ${resource.planLine()} (exists, id=${resource._id})`);
|
|
11721
|
+
} else {
|
|
11722
|
+
writeLine(` + ${resource.planLine()}`);
|
|
11723
|
+
}
|
|
11724
|
+
}
|
|
11725
|
+
const wiring = this.collectWiringSummary(resources);
|
|
11726
|
+
if (wiring.length) {
|
|
11727
|
+
writeLine("\n Wiring:");
|
|
11728
|
+
for (const line of wiring) writeLine(` ${line}`);
|
|
11729
|
+
}
|
|
11730
|
+
const toCreate = resources.filter((resource) => !resource._existed);
|
|
11731
|
+
const existing = resources.filter((resource) => resource._existed);
|
|
11732
|
+
writeLine(
|
|
11733
|
+
`
|
|
11734
|
+
Total: ${toCreate.length} to create, ${existing.length} existing, ${wiring.length} connections`
|
|
11735
|
+
);
|
|
11736
|
+
writeLine(`${"=".repeat(50)}
|
|
11737
|
+
`);
|
|
11738
|
+
}
|
|
11739
|
+
async apply() {
|
|
11740
|
+
const resources = this.sortedResources();
|
|
11741
|
+
await this.resolveExisting(resources);
|
|
11742
|
+
const summary = {};
|
|
11743
|
+
writeLine("Applying...");
|
|
11744
|
+
for (const resource of resources) {
|
|
11745
|
+
try {
|
|
11746
|
+
if (resource._existed) {
|
|
11747
|
+
const key = resourceKey(resource);
|
|
11748
|
+
summary[key] ??= [];
|
|
11749
|
+
summary[key].push(resource._id);
|
|
11750
|
+
writeLine(` Exists ${resource.planLine()} -> id=${resource._id}`);
|
|
11751
|
+
continue;
|
|
11752
|
+
}
|
|
11753
|
+
await resource.apply(this.client);
|
|
11754
|
+
if (resource._created || resource._id !== void 0) {
|
|
11755
|
+
const key = resourceKey(resource);
|
|
11756
|
+
summary[key] ??= [];
|
|
11757
|
+
summary[key].push(resource._id);
|
|
11758
|
+
const startTag = resource instanceof TaskBuilder && resource.start ? " [start]" : "";
|
|
11759
|
+
writeLine(` Created ${resource.planLine()}${startTag} -> id=${resource._id}`);
|
|
11760
|
+
} else {
|
|
11761
|
+
writeLine(` Skipped: ${resource.planLine()}`);
|
|
11762
|
+
}
|
|
11763
|
+
} catch (err) {
|
|
11764
|
+
writeLine(` FAILED: ${resource.planLine()}: ${summarizeError(err)}`);
|
|
11765
|
+
throw new ApplyError(resource, err, summary);
|
|
11766
|
+
}
|
|
11767
|
+
}
|
|
11768
|
+
await this.applyTransitions();
|
|
11769
|
+
await this.applyEventRules(resources);
|
|
11770
|
+
await this.applyJourneyConnections(resources);
|
|
11771
|
+
await this.applyJourneyGoals(resources);
|
|
11772
|
+
const count = Object.values(summary).reduce((total, ids) => total + ids.length, 0);
|
|
11773
|
+
writeLine(`
|
|
11774
|
+
Done! Created ${count} resources.`);
|
|
11775
|
+
return summary;
|
|
11776
|
+
}
|
|
11777
|
+
async resolveExisting(resources) {
|
|
11778
|
+
const formSlugs = new Map(
|
|
11779
|
+
resources.filter((resource) => resource instanceof FormBuilder).map((resource) => [resource.slug, resource])
|
|
11780
|
+
);
|
|
11781
|
+
const labelSlugs = new Map(
|
|
11782
|
+
resources.filter(
|
|
11783
|
+
(resource) => resource instanceof MemberLabelBuilder
|
|
11784
|
+
).map((resource) => [resource.slug, resource])
|
|
11785
|
+
);
|
|
11786
|
+
const workflowNames = new Map(
|
|
11787
|
+
resources.filter((resource) => resource instanceof WorkflowBuilder).map((resource) => [resource.name, resource])
|
|
11788
|
+
);
|
|
11789
|
+
if (formSlugs.size) {
|
|
11790
|
+
for (const existing of await this.client.getDataTypes()) {
|
|
11791
|
+
if (existing.slug && formSlugs.has(existing.slug)) {
|
|
11792
|
+
formSlugs.get(existing.slug).adopt(existing);
|
|
11793
|
+
}
|
|
11794
|
+
}
|
|
11795
|
+
}
|
|
11796
|
+
if (labelSlugs.size) {
|
|
11797
|
+
for (const existing of await this.client.getMemberLabels()) {
|
|
11798
|
+
if (existing.slug && labelSlugs.has(existing.slug)) {
|
|
11799
|
+
labelSlugs.get(existing.slug).adopt(existing);
|
|
11800
|
+
}
|
|
11801
|
+
}
|
|
11802
|
+
}
|
|
11803
|
+
if (!workflowNames.size) return;
|
|
11804
|
+
for (const existing of await this.client.getWorkflows()) {
|
|
11805
|
+
if (existing.name && workflowNames.has(existing.name)) {
|
|
11806
|
+
workflowNames.get(existing.name).adopt(existing);
|
|
11807
|
+
}
|
|
11808
|
+
}
|
|
11809
|
+
const adoptedWorkflows = resources.filter(
|
|
11810
|
+
(resource) => resource instanceof WorkflowBuilder && resource._existed && resource._id !== void 0
|
|
11811
|
+
);
|
|
11812
|
+
if (!adoptedWorkflows.length) return;
|
|
11813
|
+
const existingTasks = await this.client.getTasks();
|
|
11814
|
+
for (const workflow of adoptedWorkflows) {
|
|
11815
|
+
const workflowTasks = existingTasks.filter((task) => task.workflowId === workflow._id);
|
|
11816
|
+
const taskByName = new Map(workflowTasks.map((task) => [task.name, task]));
|
|
11817
|
+
for (const taskBuilder of workflow.tasks) {
|
|
11818
|
+
const match = taskByName.get(taskBuilder.name);
|
|
11819
|
+
if (match) taskBuilder.adopt(match);
|
|
11820
|
+
}
|
|
11821
|
+
const ids = /* @__PURE__ */ new Map();
|
|
11822
|
+
for (const taskBuilder of workflow.tasks) {
|
|
11823
|
+
if (taskBuilder._id !== void 0) {
|
|
11824
|
+
ids.set(taskBuilder._id, [...ids.get(taskBuilder._id) ?? [], taskBuilder]);
|
|
11825
|
+
}
|
|
11826
|
+
}
|
|
11827
|
+
for (const builders of ids.values()) {
|
|
11828
|
+
if (builders.length <= 1) continue;
|
|
11829
|
+
const nameAdopted = builders.filter((task) => taskByName.has(task.name));
|
|
11830
|
+
for (const task of builders.filter((builder) => !nameAdopted.includes(builder))) {
|
|
11831
|
+
task._id = void 0;
|
|
11832
|
+
task._existed = false;
|
|
11833
|
+
}
|
|
11834
|
+
}
|
|
11835
|
+
}
|
|
11836
|
+
}
|
|
11837
|
+
sortedResources() {
|
|
11838
|
+
const all = [];
|
|
11839
|
+
for (const resource of this.resources) {
|
|
11840
|
+
all.push(resource);
|
|
11841
|
+
if (resource instanceof WorkflowBuilder) {
|
|
11842
|
+
const start = resource.startTask;
|
|
11843
|
+
const tasks = start === void 0 ? resource.tasks : [start, ...resource.tasks.filter((task) => task !== start)];
|
|
11844
|
+
all.push(...tasks);
|
|
11845
|
+
} else if (resource instanceof JourneyBuilder) {
|
|
11846
|
+
all.push(...resource.steps);
|
|
11847
|
+
}
|
|
11848
|
+
}
|
|
11849
|
+
return all.sort(
|
|
11850
|
+
(a, b) => (PHASES.get(a.constructor) ?? 99) - (PHASES.get(b.constructor) ?? 99)
|
|
11851
|
+
);
|
|
11852
|
+
}
|
|
11853
|
+
collectWiringSummary(resources) {
|
|
11854
|
+
const lines = [];
|
|
11855
|
+
for (const resource of resources) {
|
|
11856
|
+
if (resource instanceof TaskBuilder) {
|
|
11857
|
+
for (const transition of resource.transitions) {
|
|
11858
|
+
lines.push(`${transition.parent.name} -> ${transition.child.name}`);
|
|
11859
|
+
}
|
|
11860
|
+
for (const rule of resource.eventRules) {
|
|
11861
|
+
lines.push(`${rule.actionType} on enter '${resource.name}'`);
|
|
11862
|
+
}
|
|
11863
|
+
} else if (resource instanceof FormBuilder) {
|
|
11864
|
+
for (const rule of resource.eventRules) {
|
|
11865
|
+
lines.push(`${rule.actionType} on ${rule.eventType} '${resource.name}'`);
|
|
11866
|
+
}
|
|
11867
|
+
} else if (resource instanceof RoutineBuilder) {
|
|
11868
|
+
for (const rule of resource.rules)
|
|
11869
|
+
lines.push(`${rule.actionType} rule on '${resource.name}'`);
|
|
11870
|
+
} else if (resource instanceof JourneyStepBuilder) {
|
|
11871
|
+
for (const connection of resource.connections) {
|
|
11872
|
+
lines.push(`${connection.parent.name} -> ${connection.child.name}`);
|
|
11873
|
+
}
|
|
11874
|
+
} else if (resource instanceof JourneyBuilder) {
|
|
11875
|
+
for (const goal of resource.goals) lines.push(`Goal: ${goal.name}`);
|
|
11876
|
+
}
|
|
11877
|
+
}
|
|
11878
|
+
return lines;
|
|
11879
|
+
}
|
|
11880
|
+
async applyTransitions() {
|
|
11881
|
+
const parentChildren = /* @__PURE__ */ new Map();
|
|
11882
|
+
for (const resource of this.sortedResources()) {
|
|
11883
|
+
if (!(resource instanceof TaskBuilder)) continue;
|
|
11884
|
+
for (const transition of resource.transitions) {
|
|
11885
|
+
parentChildren.set(transition.parent, [
|
|
11886
|
+
...parentChildren.get(transition.parent) ?? [],
|
|
11887
|
+
transition
|
|
11888
|
+
]);
|
|
11889
|
+
}
|
|
11890
|
+
}
|
|
11891
|
+
for (const [parent, transitions] of parentChildren) {
|
|
11892
|
+
if (parent._id === void 0) continue;
|
|
11893
|
+
const childTasks = transitions.flatMap((transition) => {
|
|
11894
|
+
const taskId = transition.child._id;
|
|
11895
|
+
if (taskId === void 0 || taskId === parent._id) return [];
|
|
11896
|
+
return [
|
|
11897
|
+
{
|
|
11898
|
+
taskId,
|
|
11899
|
+
choicePrompt: transition.when,
|
|
11900
|
+
celCondition: null,
|
|
11901
|
+
autoNext: transition.autoNext,
|
|
11902
|
+
required: transition.required
|
|
11903
|
+
}
|
|
11904
|
+
];
|
|
11905
|
+
});
|
|
11906
|
+
if (!childTasks.length) continue;
|
|
11907
|
+
await this.client.updateTask(parent._id, { childTasks });
|
|
11908
|
+
writeLine(
|
|
11909
|
+
` Wired: ${parent.name} -> [${transitions.map((tr) => tr.child.name).join(", ")}]`
|
|
11910
|
+
);
|
|
11911
|
+
}
|
|
11912
|
+
}
|
|
11913
|
+
async applyEventRules(resources) {
|
|
11914
|
+
for (const resource of resources) {
|
|
11915
|
+
if (resource instanceof TaskBuilder) {
|
|
11916
|
+
for (const rule of resource.eventRules) {
|
|
11917
|
+
try {
|
|
11918
|
+
const payload = {
|
|
11919
|
+
objectType: "task" /* TASK */,
|
|
11920
|
+
taskId: resource._id,
|
|
11921
|
+
eventType: rule.eventType,
|
|
11922
|
+
actionType: rule.actionType,
|
|
11923
|
+
actionParams: resolveRefs(rule.actionParams),
|
|
11924
|
+
...rule.name ? { name: rule.name } : {}
|
|
11925
|
+
};
|
|
11926
|
+
await this.applyEventRule(
|
|
11927
|
+
payload,
|
|
11928
|
+
`${rule.actionType} on enter '${resource.name}'`
|
|
11929
|
+
);
|
|
11930
|
+
} catch (err) {
|
|
11931
|
+
handleEventRuleApplyFailure(resource.name, err);
|
|
11932
|
+
}
|
|
11933
|
+
}
|
|
11934
|
+
} else if (resource instanceof FormBuilder) {
|
|
11935
|
+
for (const rule of resource.eventRules) {
|
|
11936
|
+
try {
|
|
11937
|
+
const payload = {
|
|
11938
|
+
objectType: "data_record" /* DATA_RECORD */,
|
|
11939
|
+
dataTypeId: resource._id,
|
|
11940
|
+
eventType: rule.eventType,
|
|
11941
|
+
actionType: rule.actionType,
|
|
11942
|
+
actionParams: resolveRefs(rule.actionParams),
|
|
11943
|
+
...rule.condition ? { conditions: rule.condition } : {},
|
|
11944
|
+
...rule.name ? { name: rule.name } : {}
|
|
11945
|
+
};
|
|
11946
|
+
await this.applyEventRule(
|
|
11947
|
+
payload,
|
|
11948
|
+
`${rule.actionType} on ${rule.eventType} '${resource.name}'`
|
|
11949
|
+
);
|
|
11950
|
+
} catch (err) {
|
|
11951
|
+
handleEventRuleApplyFailure(resource.name, err);
|
|
11952
|
+
}
|
|
11953
|
+
}
|
|
11954
|
+
}
|
|
11955
|
+
}
|
|
11956
|
+
}
|
|
11957
|
+
async applyEventRule(payload, label) {
|
|
11958
|
+
const existing = await this.findMatchingEventRule(payload);
|
|
11959
|
+
if (!existing) {
|
|
11960
|
+
await this.client.createEventRule(payload);
|
|
11961
|
+
writeLine(` Wired: ${label}`);
|
|
11962
|
+
return;
|
|
11963
|
+
}
|
|
11964
|
+
const update = eventRuleUpdate(existing, payload);
|
|
11965
|
+
if (Object.keys(update).length) {
|
|
11966
|
+
await this.client.updateEventRule(existing.id, update);
|
|
11967
|
+
writeLine(` Updated: ${label}`);
|
|
11968
|
+
} else {
|
|
11969
|
+
writeLine(` Exists: ${label}`);
|
|
11970
|
+
}
|
|
11971
|
+
}
|
|
11972
|
+
async findMatchingEventRule(payload) {
|
|
11973
|
+
const sourceFilter = eventRuleSourceFilter(payload);
|
|
11974
|
+
const candidates = await this.client.searchEventRules({
|
|
11975
|
+
objectType: payload.objectType,
|
|
11976
|
+
eventType: payload.eventType,
|
|
11977
|
+
actionType: payload.actionType,
|
|
11978
|
+
includeDisabled: true,
|
|
11979
|
+
...sourceFilter
|
|
11980
|
+
});
|
|
11981
|
+
return candidates.find((candidate) => eventRulesMatch(candidate, payload));
|
|
11982
|
+
}
|
|
11983
|
+
async applyJourneyConnections(resources) {
|
|
11984
|
+
for (const resource of resources) {
|
|
11985
|
+
if (!(resource instanceof JourneyStepBuilder)) continue;
|
|
11986
|
+
for (const connection of resource.connections) {
|
|
11987
|
+
if (resource.journey._id === void 0) continue;
|
|
11988
|
+
const payload = buildJourneyConnectionPayload(connection);
|
|
11989
|
+
if (!payload) continue;
|
|
11990
|
+
await this.client.createConnection(resource.journey._id, payload);
|
|
11991
|
+
writeLine(` Wired: ${connection.parent.name} -> ${connection.child.name}`);
|
|
11992
|
+
}
|
|
11993
|
+
}
|
|
11994
|
+
}
|
|
11995
|
+
async applyJourneyGoals(resources) {
|
|
11996
|
+
for (const resource of resources) {
|
|
11997
|
+
if (!(resource instanceof JourneyBuilder) || resource._id === void 0) continue;
|
|
11998
|
+
for (const goal of resource.goals) {
|
|
11999
|
+
await this.client.createGoal(resource._id, buildJourneyGoalPayload(goal));
|
|
12000
|
+
writeLine(` Created goal: ${goal.name}`);
|
|
12001
|
+
}
|
|
12002
|
+
}
|
|
12003
|
+
}
|
|
12004
|
+
};
|
|
12005
|
+
var ApplyError = class extends Error {
|
|
12006
|
+
constructor(resource, cause, createdSoFar) {
|
|
12007
|
+
super(
|
|
12008
|
+
`Failed creating ${resource.planLine()}: ${summarizeError(cause)}
|
|
12009
|
+
Already created: ${JSON.stringify(
|
|
12010
|
+
createdSoFar
|
|
12011
|
+
)}`
|
|
12012
|
+
);
|
|
12013
|
+
this.resource = resource;
|
|
12014
|
+
this.cause = cause;
|
|
12015
|
+
this.createdSoFar = createdSoFar;
|
|
12016
|
+
}
|
|
12017
|
+
};
|
|
12018
|
+
function resourceKey(resource) {
|
|
12019
|
+
if (resource instanceof RoleUpdate) return "roleUpdates";
|
|
12020
|
+
if (resource instanceof FormBuilder) return "forms";
|
|
12021
|
+
if (resource instanceof MemberLabelBuilder) return "labels";
|
|
12022
|
+
if (resource instanceof WorkflowBuilder) return "workflows";
|
|
12023
|
+
if (resource instanceof TaskBuilder) return "tasks";
|
|
12024
|
+
if (resource instanceof MemberFilterBuilder) return "memberFilters";
|
|
12025
|
+
if (resource instanceof RoutineBuilder) return "routines";
|
|
12026
|
+
if (resource instanceof NotificationRuleBuilder) return "notificationRules";
|
|
12027
|
+
if (resource instanceof JourneyBuilder) return "journeys";
|
|
12028
|
+
if (resource instanceof JourneyStepBuilder) return "journeySteps";
|
|
12029
|
+
if (resource instanceof AgentBuilder) return "agents";
|
|
12030
|
+
return "resources";
|
|
12031
|
+
}
|
|
12032
|
+
var SEARCHABLE_EVENT_RULE_SOURCE_FIELDS = [
|
|
12033
|
+
"taskId",
|
|
12034
|
+
"dataTypeId",
|
|
12035
|
+
"routineId",
|
|
12036
|
+
"workflowId",
|
|
12037
|
+
"journeyStepId"
|
|
12038
|
+
];
|
|
12039
|
+
var EVENT_RULE_SOURCE_FIELDS = [
|
|
12040
|
+
...SEARCHABLE_EVENT_RULE_SOURCE_FIELDS,
|
|
12041
|
+
"calendarId",
|
|
12042
|
+
"calendarEventTypeId"
|
|
12043
|
+
];
|
|
12044
|
+
function eventRuleSourceFilter(payload) {
|
|
12045
|
+
const filter = {};
|
|
12046
|
+
for (const field of SEARCHABLE_EVENT_RULE_SOURCE_FIELDS) {
|
|
12047
|
+
const value = payload[field];
|
|
12048
|
+
if (value !== void 0 && value !== null) {
|
|
12049
|
+
filter[field] = value;
|
|
12050
|
+
}
|
|
12051
|
+
}
|
|
12052
|
+
return filter;
|
|
12053
|
+
}
|
|
12054
|
+
function eventRulesMatch(existing, payload) {
|
|
12055
|
+
if (normalizeString(existing.name) !== normalizeString(payload.name)) return false;
|
|
12056
|
+
if (existing.objectType !== payload.objectType) return false;
|
|
12057
|
+
if (existing.eventType !== payload.eventType) return false;
|
|
12058
|
+
if (existing.actionType !== payload.actionType) return false;
|
|
12059
|
+
for (const field of EVENT_RULE_SOURCE_FIELDS) {
|
|
12060
|
+
if ((existing[field] ?? null) !== (payload[field] ?? null)) return false;
|
|
12061
|
+
}
|
|
12062
|
+
if (normalizeString(payload.name)) return true;
|
|
12063
|
+
if (normalizeString(existing.conditions) !== normalizeString(payload.conditions)) return false;
|
|
12064
|
+
if (!eventRuleValueEqual(existing.actionParams, payload.actionParams ?? null)) return false;
|
|
12065
|
+
if (!eventRuleValueEqual(existing.triggerParams, payload.triggerParams ?? null)) return false;
|
|
12066
|
+
return true;
|
|
12067
|
+
}
|
|
12068
|
+
function eventRuleUpdate(existing, payload) {
|
|
12069
|
+
const update = {};
|
|
12070
|
+
const conditions = payload.conditions ?? null;
|
|
12071
|
+
if (normalizeString(existing.conditions) !== normalizeString(conditions)) {
|
|
12072
|
+
update.conditions = conditions;
|
|
12073
|
+
}
|
|
12074
|
+
const actionParams = payload.actionParams ?? null;
|
|
12075
|
+
if (!eventRuleValueEqual(existing.actionParams, actionParams)) {
|
|
12076
|
+
update.actionParams = payload.actionParams;
|
|
12077
|
+
}
|
|
12078
|
+
const triggerParams = payload.triggerParams ?? null;
|
|
12079
|
+
if (!eventRuleValueEqual(existing.triggerParams, triggerParams)) {
|
|
12080
|
+
update.triggerParams = payload.triggerParams;
|
|
12081
|
+
}
|
|
12082
|
+
const active = payload.active ?? true;
|
|
12083
|
+
if (existing.active !== active) {
|
|
12084
|
+
update.active = active;
|
|
12085
|
+
}
|
|
12086
|
+
const delay = payload.delay ?? 0;
|
|
12087
|
+
if (existing.delay !== delay) {
|
|
12088
|
+
update.delay = delay;
|
|
12089
|
+
}
|
|
12090
|
+
const order = payload.order ?? 0;
|
|
12091
|
+
if (existing.order !== order) {
|
|
12092
|
+
update.order = order;
|
|
12093
|
+
}
|
|
12094
|
+
return update;
|
|
12095
|
+
}
|
|
12096
|
+
function normalizeString(value) {
|
|
12097
|
+
return value ?? "";
|
|
12098
|
+
}
|
|
12099
|
+
function eventRuleValueEqual(left, right) {
|
|
12100
|
+
return JSON.stringify(stableValue(left)) === JSON.stringify(stableValue(right));
|
|
12101
|
+
}
|
|
12102
|
+
function stableValue(value) {
|
|
12103
|
+
if (Array.isArray(value)) return value.map(stableValue);
|
|
12104
|
+
if (!value || typeof value !== "object") return value;
|
|
12105
|
+
const prototype = Object.getPrototypeOf(value);
|
|
12106
|
+
if (prototype !== Object.prototype && prototype !== null) return value;
|
|
12107
|
+
return Object.fromEntries(
|
|
12108
|
+
Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, stableValue(nested)])
|
|
12109
|
+
);
|
|
12110
|
+
}
|
|
12111
|
+
function writeLine(message = "") {
|
|
12112
|
+
process.stdout.write(`${message}
|
|
12113
|
+
`);
|
|
12114
|
+
}
|
|
12115
|
+
function handleEventRuleApplyFailure(resourceName, err) {
|
|
12116
|
+
if (hasStatus(err, 403)) {
|
|
12117
|
+
writeLine(
|
|
12118
|
+
` WARNING: Event rule on '${resourceName}' failed (retry exec() with scopes=['automations:admin'])`
|
|
12119
|
+
);
|
|
12120
|
+
return;
|
|
12121
|
+
}
|
|
12122
|
+
const summary = summarizeError(err);
|
|
12123
|
+
writeLine(` FAILED: Event rule on '${resourceName}': ${summary}`);
|
|
12124
|
+
throw new Error(`Failed wiring event rule on '${resourceName}': ${summary}`);
|
|
12125
|
+
}
|
|
12126
|
+
function summarizeError(err) {
|
|
12127
|
+
if (err instanceof Error) return err.name || "Error";
|
|
12128
|
+
return typeof err;
|
|
12129
|
+
}
|
|
12130
|
+
function hasStatus(err, status) {
|
|
12131
|
+
if (typeof err === "object" && err !== null) {
|
|
12132
|
+
const candidate = err;
|
|
12133
|
+
if (candidate.status === status || candidate.statusCode === status) return true;
|
|
12134
|
+
}
|
|
12135
|
+
const message = err instanceof Error ? err.message : typeof err === "string" ? err : "";
|
|
12136
|
+
return message.includes(String(status));
|
|
12137
|
+
}
|
|
12138
|
+
async function runWorkspaceScript(client, build, mode = "plan") {
|
|
12139
|
+
const workspace = new WorkspaceBuilder(client);
|
|
12140
|
+
await build(workspace);
|
|
12141
|
+
if (mode === "plan") return workspace.plan();
|
|
12142
|
+
if (mode === "preview") return workspace.preview();
|
|
12143
|
+
if (mode === "apply") return workspace.apply();
|
|
12144
|
+
throw new Error(`Unknown mode '${mode}'. Use plan, preview, or apply.`);
|
|
12145
|
+
}
|
|
12146
|
+
|
|
10073
12147
|
// src/types/ability-types.ts
|
|
10074
12148
|
var AbilityTypeSlugs = {
|
|
10075
12149
|
// Tools
|
|
@@ -11173,7 +13247,9 @@ var SCOPE_PRESETS = {
|
|
|
11173
13247
|
AccessGrantStatus,
|
|
11174
13248
|
AccessGrantTrigger,
|
|
11175
13249
|
AccessLevel,
|
|
13250
|
+
AgentBuilder,
|
|
11176
13251
|
ApiError,
|
|
13252
|
+
ApplyError,
|
|
11177
13253
|
AppsApi,
|
|
11178
13254
|
AttendeeResponseStatus,
|
|
11179
13255
|
AttendeeStatus,
|
|
@@ -11210,19 +13286,25 @@ var SCOPE_PRESETS = {
|
|
|
11210
13286
|
FhirClientType,
|
|
11211
13287
|
FhirConnectionState,
|
|
11212
13288
|
FhirVendor,
|
|
13289
|
+
FormBuilder,
|
|
11213
13290
|
GravityRailClient,
|
|
11214
13291
|
IndexStatus,
|
|
11215
13292
|
InvitationStatus,
|
|
11216
13293
|
JobPosition,
|
|
13294
|
+
JourneyBuilder,
|
|
13295
|
+
JourneyStepBuilder,
|
|
11217
13296
|
MASKED_SECRET_SENTINEL,
|
|
11218
13297
|
McpServerState,
|
|
11219
13298
|
MemberFeature,
|
|
13299
|
+
MemberFilterBuilder,
|
|
13300
|
+
MemberLabelBuilder,
|
|
11220
13301
|
MemberType,
|
|
11221
13302
|
MenuItemResponseItemType,
|
|
11222
13303
|
MenuItemType,
|
|
11223
13304
|
ModelProvider,
|
|
11224
13305
|
ModelType,
|
|
11225
13306
|
NO_ASSISTANT_PARTICIPANT_CHAT_TYPES,
|
|
13307
|
+
NotificationRuleBuilder,
|
|
11226
13308
|
OIDCAdminConfigViewProviderType,
|
|
11227
13309
|
ORG_ONLY_RESOURCES,
|
|
11228
13310
|
OrgApi,
|
|
@@ -11248,6 +13330,8 @@ var SCOPE_PRESETS = {
|
|
|
11248
13330
|
Region,
|
|
11249
13331
|
RegistrationIdentifier,
|
|
11250
13332
|
Resource,
|
|
13333
|
+
RoleUpdate,
|
|
13334
|
+
RoutineBuilder,
|
|
11251
13335
|
SCOPES,
|
|
11252
13336
|
SCOPE_PRESETS,
|
|
11253
13337
|
SMS_DELIVERY_FAILURE_STATUSES,
|
|
@@ -11267,15 +13351,19 @@ var SCOPE_PRESETS = {
|
|
|
11267
13351
|
TTS_MODEL_ELEVENLABS_TURBO,
|
|
11268
13352
|
TTS_MODEL_POCKET,
|
|
11269
13353
|
TTS_PREVIEW_PROVIDERS,
|
|
13354
|
+
TaskBuilder,
|
|
11270
13355
|
TemplatesApi,
|
|
11271
13356
|
ToolkitState,
|
|
11272
13357
|
WorkflowAccessWarningResourceType,
|
|
13358
|
+
WorkflowBuilder,
|
|
11273
13359
|
WorkflowResourceType,
|
|
13360
|
+
WorkspaceBuilder,
|
|
11274
13361
|
WorkspaceFeature,
|
|
11275
13362
|
WorkspaceProvisionStatus,
|
|
11276
13363
|
areDependenciesSatisfied,
|
|
11277
13364
|
canPreviewVoice,
|
|
11278
13365
|
clearRegistry,
|
|
13366
|
+
createWorkspaceClient,
|
|
11279
13367
|
decodePermissions,
|
|
11280
13368
|
encodePermissions,
|
|
11281
13369
|
eventRuleActionParams,
|
|
@@ -11300,6 +13388,7 @@ var SCOPE_PRESETS = {
|
|
|
11300
13388
|
isRegistryInitialized,
|
|
11301
13389
|
isSMSDeliveryFailureStatus,
|
|
11302
13390
|
requiresAssistantParticipant,
|
|
13391
|
+
runWorkspaceScript,
|
|
11303
13392
|
usesBuiltinAssistant,
|
|
11304
13393
|
validateFeatureDependencies
|
|
11305
13394
|
});
|