@gravity-rail/sdk 0.6.0 → 0.7.0
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-DX42AMVM.js → chunk-PEWFZXNK.js} +193 -1
- package/dist/chunk-PEWFZXNK.js.map +1 -0
- package/dist/{client-BKGhDv14.d.cts → client-CLxHFOeB.d.cts} +276 -7
- package/dist/{client-dP29995A.d.ts → client-Dft3Kmkn.d.ts} +276 -7
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/{index-Q5qU2JFt.d.ts → index-CeVDRf6l.d.cts} +20 -2
- package/dist/{index-CBfaxd3y.d.cts → index-D1G8EKz2.d.ts} +20 -2
- package/dist/index.cjs +185 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{inquiries-BH6I8-SF.d.cts → inquiries-BIlL6Obb.d.cts} +27 -2
- package/dist/{inquiries-BH6I8-SF.d.ts → inquiries-BIlL6Obb.d.ts} +27 -2
- package/dist/internal.cjs +194 -0
- 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 +5 -1
- package/dist/schemas.cjs +7 -3
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +28 -6
- package/dist/schemas.d.ts +28 -6
- package/dist/schemas.js +6 -3
- package/dist/schemas.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-DX42AMVM.js.map +0 -1
|
@@ -1693,6 +1693,22 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
1693
1693
|
body: JSON.stringify(chat)
|
|
1694
1694
|
});
|
|
1695
1695
|
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Create a workflow assignment chat on `phone-voice` and initiate an outbound call
|
|
1698
|
+
* to the member (same as POST /chats with channel phone-voice + send_initial_message).
|
|
1699
|
+
*/
|
|
1700
|
+
async createWorkflowOutboundVoiceChat(wid, input) {
|
|
1701
|
+
const { memberId, workflowId, phoneNumberId, title, chatType } = input;
|
|
1702
|
+
return this.createChat(wid, {
|
|
1703
|
+
channel: "phone-voice",
|
|
1704
|
+
chatType: chatType ?? "assignment",
|
|
1705
|
+
workflowId,
|
|
1706
|
+
phoneNumberId,
|
|
1707
|
+
memberId,
|
|
1708
|
+
title: title ?? `Outbound voice \u2192 member ${memberId}`,
|
|
1709
|
+
participants: [{ memberId, role: "user" }]
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1696
1712
|
/** Delete a chat, optionally providing a reason. */
|
|
1697
1713
|
async deleteChat(wid, id, reason) {
|
|
1698
1714
|
return this.fetch(`w/${wid}/chats/${id}`, {
|
|
@@ -5888,6 +5904,20 @@ var SupportRequestsApi = class extends BaseApiClient {
|
|
|
5888
5904
|
body: JSON.stringify(data)
|
|
5889
5905
|
});
|
|
5890
5906
|
}
|
|
5907
|
+
/**
|
|
5908
|
+
* Record a click on a pushed resource (Proactive Support). For a
|
|
5909
|
+
* manager_prompt, pass the Manager Chat UUID it opened so the
|
|
5910
|
+
* resource→chat linkage is preserved.
|
|
5911
|
+
*/
|
|
5912
|
+
async clickWorkspaceSupportRequestResource(workspaceUuid, uuid, resourceUuid, data = {}) {
|
|
5913
|
+
return this.fetch(
|
|
5914
|
+
`w/${workspaceUuid}/support-requests/${uuid}/resources/${resourceUuid}/click`,
|
|
5915
|
+
{
|
|
5916
|
+
method: "POST",
|
|
5917
|
+
body: JSON.stringify(data)
|
|
5918
|
+
}
|
|
5919
|
+
);
|
|
5920
|
+
}
|
|
5891
5921
|
};
|
|
5892
5922
|
|
|
5893
5923
|
// src/api/customers.ts
|
|
@@ -6701,6 +6731,9 @@ var Scope = /* @__PURE__ */ ((Scope2) => {
|
|
|
6701
6731
|
Scope2["JOURNEYS_READ"] = "journeys:read";
|
|
6702
6732
|
Scope2["JOURNEYS_WRITE"] = "journeys:write";
|
|
6703
6733
|
Scope2["JOURNEYS_ADMIN"] = "journeys:admin";
|
|
6734
|
+
Scope2["EXPERIMENTS_READ"] = "experiments:read";
|
|
6735
|
+
Scope2["EXPERIMENTS_WRITE"] = "experiments:write";
|
|
6736
|
+
Scope2["EXPERIMENTS_ADMIN"] = "experiments:admin";
|
|
6704
6737
|
Scope2["WORKFLOWS_READ"] = "workflows:read";
|
|
6705
6738
|
Scope2["WORKFLOWS_WRITE"] = "workflows:write";
|
|
6706
6739
|
Scope2["WORKFLOWS_ADMIN"] = "workflows:admin";
|
|
@@ -6878,6 +6911,7 @@ var WorkspaceFeature = /* @__PURE__ */ ((WorkspaceFeature2) => {
|
|
|
6878
6911
|
WorkspaceFeature2["CALENDAR"] = "calendar";
|
|
6879
6912
|
WorkspaceFeature2["DIRECT_MESSAGES"] = "direct_messages";
|
|
6880
6913
|
WorkspaceFeature2["JOURNEYS"] = "journeys";
|
|
6914
|
+
WorkspaceFeature2["EXPERIMENTS"] = "experiments";
|
|
6881
6915
|
WorkspaceFeature2["OPERATOR"] = "operator";
|
|
6882
6916
|
WorkspaceFeature2["PRESENCE"] = "presence";
|
|
6883
6917
|
WorkspaceFeature2["GMAIL"] = "gmail";
|
|
@@ -7088,6 +7122,11 @@ var ConsentMethod = /* @__PURE__ */ ((ConsentMethod2) => {
|
|
|
7088
7122
|
return ConsentMethod2;
|
|
7089
7123
|
})(ConsentMethod || {});
|
|
7090
7124
|
|
|
7125
|
+
// src/types/experiment-types.ts
|
|
7126
|
+
function parseExperimentStatCount(value) {
|
|
7127
|
+
return typeof value === "number" ? value : null;
|
|
7128
|
+
}
|
|
7129
|
+
|
|
7091
7130
|
// src/types/agent-task-types.ts
|
|
7092
7131
|
var TERMINAL_TASK_STATES = [
|
|
7093
7132
|
"TASK_STATE_COMPLETED",
|
|
@@ -7616,6 +7655,99 @@ var TeamsAppsApi = class extends BaseApiClient {
|
|
|
7616
7655
|
}
|
|
7617
7656
|
};
|
|
7618
7657
|
|
|
7658
|
+
// src/api/experiments.ts
|
|
7659
|
+
var ExperimentsApi = class extends BaseApiClient {
|
|
7660
|
+
/** List experiments with group summaries and assignment counts. */
|
|
7661
|
+
async getExperiments(wid, params) {
|
|
7662
|
+
const query = new URLSearchParams();
|
|
7663
|
+
if (params?.page !== void 0) query.set("page", String(params.page));
|
|
7664
|
+
if (params?.pageSize !== void 0) query.set("pageSize", String(params.pageSize));
|
|
7665
|
+
if (params?.includeArchived) query.set("includeArchived", "true");
|
|
7666
|
+
const qs = query.toString() ? `?${query.toString()}` : "";
|
|
7667
|
+
return this.fetch(`w/${wid}/experiments${qs}`);
|
|
7668
|
+
}
|
|
7669
|
+
/** Get a single experiment by ID (includes groups). */
|
|
7670
|
+
async getExperiment(wid, experimentId) {
|
|
7671
|
+
return this.fetch(`w/${wid}/experiments/${experimentId}`);
|
|
7672
|
+
}
|
|
7673
|
+
/** Create a draft experiment. */
|
|
7674
|
+
async createExperiment(wid, data) {
|
|
7675
|
+
return this.fetch(`w/${wid}/experiments`, {
|
|
7676
|
+
method: "POST",
|
|
7677
|
+
body: JSON.stringify(data)
|
|
7678
|
+
});
|
|
7679
|
+
}
|
|
7680
|
+
/** Update experiment metadata or lifecycle status. */
|
|
7681
|
+
async updateExperiment(wid, experimentId, data) {
|
|
7682
|
+
return this.fetch(`w/${wid}/experiments/${experimentId}`, {
|
|
7683
|
+
method: "PATCH",
|
|
7684
|
+
body: JSON.stringify(data)
|
|
7685
|
+
});
|
|
7686
|
+
}
|
|
7687
|
+
/** Hard-delete a draft experiment, or archive otherwise. */
|
|
7688
|
+
async deleteExperiment(wid, experimentId) {
|
|
7689
|
+
return this.fetch(`w/${wid}/experiments/${experimentId}`, {
|
|
7690
|
+
method: "DELETE"
|
|
7691
|
+
});
|
|
7692
|
+
}
|
|
7693
|
+
/** Create a group within an experiment. */
|
|
7694
|
+
async createExperimentGroup(wid, experimentId, data) {
|
|
7695
|
+
return this.fetch(`w/${wid}/experiments/${experimentId}/groups`, {
|
|
7696
|
+
method: "POST",
|
|
7697
|
+
body: JSON.stringify(data)
|
|
7698
|
+
});
|
|
7699
|
+
}
|
|
7700
|
+
/** Update a group within an experiment. */
|
|
7701
|
+
async updateExperimentGroup(wid, experimentId, groupId, data) {
|
|
7702
|
+
return this.fetch(`w/${wid}/experiments/${experimentId}/groups/${groupId}`, {
|
|
7703
|
+
method: "PATCH",
|
|
7704
|
+
body: JSON.stringify(data)
|
|
7705
|
+
});
|
|
7706
|
+
}
|
|
7707
|
+
/** Delete a group that has no member assignments. */
|
|
7708
|
+
async deleteExperimentGroup(wid, experimentId, groupId) {
|
|
7709
|
+
return this.fetch(
|
|
7710
|
+
`w/${wid}/experiments/${experimentId}/groups/${groupId}`,
|
|
7711
|
+
{ method: "DELETE" }
|
|
7712
|
+
);
|
|
7713
|
+
}
|
|
7714
|
+
/** Aggregate assignment and exposure counts by group. */
|
|
7715
|
+
async getExperimentStats(wid, experimentId) {
|
|
7716
|
+
return this.fetch(`w/${wid}/experiments/${experimentId}/stats`);
|
|
7717
|
+
}
|
|
7718
|
+
/** List experiment assignments for a member (member profile panel). */
|
|
7719
|
+
async getMemberExperiments(wid, memberId) {
|
|
7720
|
+
return this.fetch(`w/${wid}/members/${memberId}/experiments`);
|
|
7721
|
+
}
|
|
7722
|
+
/** Manually assign a member to an experiment (optional group, or weighted random). */
|
|
7723
|
+
async createExperimentAssignment(wid, experimentId, data) {
|
|
7724
|
+
return this.fetch(
|
|
7725
|
+
`w/${wid}/experiments/${experimentId}/assignments`,
|
|
7726
|
+
{
|
|
7727
|
+
method: "POST",
|
|
7728
|
+
body: JSON.stringify(data)
|
|
7729
|
+
}
|
|
7730
|
+
);
|
|
7731
|
+
}
|
|
7732
|
+
/** Move an assigned member to a different experiment group. */
|
|
7733
|
+
async updateExperimentAssignment(wid, experimentId, memberId, data) {
|
|
7734
|
+
return this.fetch(
|
|
7735
|
+
`w/${wid}/experiments/${experimentId}/assignments/${memberId}`,
|
|
7736
|
+
{
|
|
7737
|
+
method: "PATCH",
|
|
7738
|
+
body: JSON.stringify(data)
|
|
7739
|
+
}
|
|
7740
|
+
);
|
|
7741
|
+
}
|
|
7742
|
+
/** Remove a member's assignment from an experiment. */
|
|
7743
|
+
async deleteExperimentAssignment(wid, experimentId, memberId) {
|
|
7744
|
+
return this.fetch(
|
|
7745
|
+
`w/${wid}/experiments/${experimentId}/assignments/${memberId}`,
|
|
7746
|
+
{ method: "DELETE" }
|
|
7747
|
+
);
|
|
7748
|
+
}
|
|
7749
|
+
};
|
|
7750
|
+
|
|
7619
7751
|
// src/app-context.ts
|
|
7620
7752
|
function formatAppContextAsMarkdown(context) {
|
|
7621
7753
|
if (!context) {
|
|
@@ -7704,6 +7836,7 @@ function createApiModules(apiKey, baseUrl, customFetch) {
|
|
|
7704
7836
|
slackApps: new SlackAppsApi(apiKey, baseUrl, customFetch),
|
|
7705
7837
|
teamsApps: new TeamsAppsApi(apiKey, baseUrl, customFetch),
|
|
7706
7838
|
events: new EventsApi(apiKey, baseUrl, customFetch),
|
|
7839
|
+
experiments: new ExperimentsApi(apiKey, baseUrl, customFetch),
|
|
7707
7840
|
fhirConnections: new FhirConnectionsApi(apiKey, baseUrl, customFetch),
|
|
7708
7841
|
healthie: new HealthieApi(apiKey, baseUrl, customFetch),
|
|
7709
7842
|
hubspot: new HubspotApi(apiKey, baseUrl, customFetch),
|
|
@@ -7803,6 +7936,7 @@ function bindChatsMethods(target, chats) {
|
|
|
7803
7936
|
target.archiveChat = chats.archiveChat.bind(chats);
|
|
7804
7937
|
target.unarchiveChat = chats.unarchiveChat.bind(chats);
|
|
7805
7938
|
target.createChat = chats.createChat.bind(chats);
|
|
7939
|
+
target.createWorkflowOutboundVoiceChat = chats.createWorkflowOutboundVoiceChat.bind(chats);
|
|
7806
7940
|
target.deleteChat = chats.deleteChat.bind(chats);
|
|
7807
7941
|
target.updateChat = chats.updateChat.bind(chats);
|
|
7808
7942
|
target.updateChatMute = chats.updateChatMute.bind(chats);
|
|
@@ -8137,6 +8271,23 @@ function bindEventsMethods(target, events) {
|
|
|
8137
8271
|
target.previewSchedule = events.previewSchedule.bind(events);
|
|
8138
8272
|
}
|
|
8139
8273
|
|
|
8274
|
+
// src/client/bindings/experiments.ts
|
|
8275
|
+
function bindExperimentsMethods(target, experiments) {
|
|
8276
|
+
target.getExperiments = experiments.getExperiments.bind(experiments);
|
|
8277
|
+
target.getExperiment = experiments.getExperiment.bind(experiments);
|
|
8278
|
+
target.createExperiment = experiments.createExperiment.bind(experiments);
|
|
8279
|
+
target.updateExperiment = experiments.updateExperiment.bind(experiments);
|
|
8280
|
+
target.deleteExperiment = experiments.deleteExperiment.bind(experiments);
|
|
8281
|
+
target.createExperimentGroup = experiments.createExperimentGroup.bind(experiments);
|
|
8282
|
+
target.updateExperimentGroup = experiments.updateExperimentGroup.bind(experiments);
|
|
8283
|
+
target.deleteExperimentGroup = experiments.deleteExperimentGroup.bind(experiments);
|
|
8284
|
+
target.getExperimentStats = experiments.getExperimentStats.bind(experiments);
|
|
8285
|
+
target.getMemberExperiments = experiments.getMemberExperiments.bind(experiments);
|
|
8286
|
+
target.createExperimentAssignment = experiments.createExperimentAssignment.bind(experiments);
|
|
8287
|
+
target.updateExperimentAssignment = experiments.updateExperimentAssignment.bind(experiments);
|
|
8288
|
+
target.deleteExperimentAssignment = experiments.deleteExperimentAssignment.bind(experiments);
|
|
8289
|
+
}
|
|
8290
|
+
|
|
8140
8291
|
// src/client/bindings/workflows.ts
|
|
8141
8292
|
function bindWorkflowsMethods(target, workflows, workflowNotes, voice, supervisors) {
|
|
8142
8293
|
target.getWorkflows = workflows.getWorkflows.bind(workflows);
|
|
@@ -8676,6 +8827,7 @@ function bindSupportRequestMethods(target, supportRequests) {
|
|
|
8676
8827
|
target.createWorkspaceSupportRequest = supportRequests.createWorkspaceSupportRequest.bind(supportRequests);
|
|
8677
8828
|
target.commentOnWorkspaceSupportRequest = supportRequests.commentOnWorkspaceSupportRequest.bind(supportRequests);
|
|
8678
8829
|
target.closeWorkspaceSupportRequest = supportRequests.closeWorkspaceSupportRequest.bind(supportRequests);
|
|
8830
|
+
target.clickWorkspaceSupportRequestResource = supportRequests.clickWorkspaceSupportRequestResource.bind(supportRequests);
|
|
8679
8831
|
}
|
|
8680
8832
|
|
|
8681
8833
|
// src/client/client.ts
|
|
@@ -8706,6 +8858,7 @@ var GravityRailClient = class {
|
|
|
8706
8858
|
archiveChat;
|
|
8707
8859
|
unarchiveChat;
|
|
8708
8860
|
createChat;
|
|
8861
|
+
createWorkflowOutboundVoiceChat;
|
|
8709
8862
|
deleteChat;
|
|
8710
8863
|
updateChat;
|
|
8711
8864
|
updateChatMute;
|
|
@@ -8876,6 +9029,20 @@ var GravityRailClient = class {
|
|
|
8876
9029
|
createJourneyNote;
|
|
8877
9030
|
updateJourneyNote;
|
|
8878
9031
|
deleteJourneyNote;
|
|
9032
|
+
// Experiments API
|
|
9033
|
+
getExperiments;
|
|
9034
|
+
getExperiment;
|
|
9035
|
+
createExperiment;
|
|
9036
|
+
updateExperiment;
|
|
9037
|
+
deleteExperiment;
|
|
9038
|
+
createExperimentGroup;
|
|
9039
|
+
updateExperimentGroup;
|
|
9040
|
+
deleteExperimentGroup;
|
|
9041
|
+
getExperimentStats;
|
|
9042
|
+
getMemberExperiments;
|
|
9043
|
+
createExperimentAssignment;
|
|
9044
|
+
updateExperimentAssignment;
|
|
9045
|
+
deleteExperimentAssignment;
|
|
8879
9046
|
// Operator Groups API
|
|
8880
9047
|
getOperatorGroups;
|
|
8881
9048
|
getOperatorGroup;
|
|
@@ -9542,6 +9709,7 @@ var GravityRailClient = class {
|
|
|
9542
9709
|
createWorkspaceSupportRequest;
|
|
9543
9710
|
commentOnWorkspaceSupportRequest;
|
|
9544
9711
|
closeWorkspaceSupportRequest;
|
|
9712
|
+
clickWorkspaceSupportRequestResource;
|
|
9545
9713
|
constructor(apiKey, baseUrl, customFetch) {
|
|
9546
9714
|
const apis = createApiModules(apiKey, baseUrl, customFetch);
|
|
9547
9715
|
this.apis = apis;
|
|
@@ -9556,6 +9724,7 @@ var GravityRailClient = class {
|
|
|
9556
9724
|
bindQualificationsMethods(this, apis.qualifications);
|
|
9557
9725
|
bindPersonasMethods(this, apis.personas);
|
|
9558
9726
|
bindJourneysMethods(this, apis.journeys);
|
|
9727
|
+
bindExperimentsMethods(this, apis.experiments);
|
|
9559
9728
|
bindOperatorMethods(this, apis.operatorGroups);
|
|
9560
9729
|
bindOrgMethods(this, apis.org);
|
|
9561
9730
|
bindAccessGrantsMethods(this, apis.accessGrants);
|
|
@@ -10160,6 +10329,7 @@ var ScopeCategory = /* @__PURE__ */ ((ScopeCategory2) => {
|
|
|
10160
10329
|
ScopeCategory2["RECORDS"] = "records";
|
|
10161
10330
|
ScopeCategory2["FILES"] = "files";
|
|
10162
10331
|
ScopeCategory2["JOURNEYS"] = "journeys";
|
|
10332
|
+
ScopeCategory2["EXPERIMENTS"] = "experiments";
|
|
10163
10333
|
ScopeCategory2["SITES"] = "sites";
|
|
10164
10334
|
ScopeCategory2["AGENTS"] = "agents";
|
|
10165
10335
|
ScopeCategory2["CALENDARS"] = "calendars";
|
|
@@ -10419,6 +10589,26 @@ var SCOPES = {
|
|
|
10419
10589
|
implies: ["journeys:write"]
|
|
10420
10590
|
},
|
|
10421
10591
|
// =========================================================================
|
|
10592
|
+
// EXPERIMENTS
|
|
10593
|
+
// =========================================================================
|
|
10594
|
+
"experiments:read": {
|
|
10595
|
+
name: "experiments:read",
|
|
10596
|
+
category: "experiments" /* EXPERIMENTS */,
|
|
10597
|
+
description: "View experiments and assignments"
|
|
10598
|
+
},
|
|
10599
|
+
"experiments:write": {
|
|
10600
|
+
name: "experiments:write",
|
|
10601
|
+
category: "experiments" /* EXPERIMENTS */,
|
|
10602
|
+
description: "Create and edit experiments",
|
|
10603
|
+
implies: ["experiments:read"]
|
|
10604
|
+
},
|
|
10605
|
+
"experiments:admin": {
|
|
10606
|
+
name: "experiments:admin",
|
|
10607
|
+
category: "experiments" /* EXPERIMENTS */,
|
|
10608
|
+
description: "Delete draft experiments and archive experiments",
|
|
10609
|
+
implies: ["experiments:write"]
|
|
10610
|
+
},
|
|
10611
|
+
// =========================================================================
|
|
10422
10612
|
// SITES
|
|
10423
10613
|
// =========================================================================
|
|
10424
10614
|
"sites:read": {
|
|
@@ -10885,6 +11075,7 @@ export {
|
|
|
10885
11075
|
AccessGrantStatus,
|
|
10886
11076
|
AccessGrantTrigger,
|
|
10887
11077
|
ConsentMethod,
|
|
11078
|
+
parseExperimentStatCount,
|
|
10888
11079
|
TERMINAL_TASK_STATES,
|
|
10889
11080
|
WorkspaceInvitationsApi,
|
|
10890
11081
|
WorkspacesApi,
|
|
@@ -10903,6 +11094,7 @@ export {
|
|
|
10903
11094
|
bindSitesMethods,
|
|
10904
11095
|
bindFilesMethods,
|
|
10905
11096
|
bindEventsMethods,
|
|
11097
|
+
bindExperimentsMethods,
|
|
10906
11098
|
bindWorkflowsMethods,
|
|
10907
11099
|
bindCalendarsMethods,
|
|
10908
11100
|
bindCommunicationsMethods,
|
|
@@ -10974,4 +11166,4 @@ export {
|
|
|
10974
11166
|
ScopeManager,
|
|
10975
11167
|
SCOPE_PRESETS
|
|
10976
11168
|
};
|
|
10977
|
-
//# sourceMappingURL=chunk-
|
|
11169
|
+
//# sourceMappingURL=chunk-PEWFZXNK.js.map
|