@gravity-rail/cli 0.1.0 → 0.2.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/gr.js +682 -158
- package/dist/gr.js.map +1 -1
- package/package.json +7 -2
package/dist/gr.js
CHANGED
|
@@ -2162,7 +2162,7 @@ function parsePhoneNumber4() {
|
|
|
2162
2162
|
return withMetadataArgument(parsePhoneNumber3, arguments);
|
|
2163
2163
|
}
|
|
2164
2164
|
|
|
2165
|
-
// ../client/dist/chunk-
|
|
2165
|
+
// ../client/dist/chunk-WFQXAPII.mjs
|
|
2166
2166
|
function getCookieValue(name) {
|
|
2167
2167
|
if (typeof document === "undefined") return void 0;
|
|
2168
2168
|
const cookies = document.cookie.split(";");
|
|
@@ -2562,8 +2562,7 @@ var AppsApi = class extends BaseApiClient {
|
|
|
2562
2562
|
};
|
|
2563
2563
|
var BuildersApi = class extends BaseApiClient {
|
|
2564
2564
|
/**
|
|
2565
|
-
* List all builders
|
|
2566
|
-
* @param all - If true, return all (superuser access required)
|
|
2565
|
+
* List all builders (optionally all with superuser access)
|
|
2567
2566
|
*/
|
|
2568
2567
|
async listBuilders(all) {
|
|
2569
2568
|
const params = new URLSearchParams();
|
|
@@ -2574,7 +2573,6 @@ var BuildersApi = class extends BaseApiClient {
|
|
|
2574
2573
|
}
|
|
2575
2574
|
/**
|
|
2576
2575
|
* Get a specific builder by UUID
|
|
2577
|
-
* @param builderId - Builder UUID
|
|
2578
2576
|
*/
|
|
2579
2577
|
async getBuilder(builderId) {
|
|
2580
2578
|
return this.fetch(`builders/${builderId}`);
|
|
@@ -2627,24 +2625,29 @@ var CELApi = class extends BaseApiClient {
|
|
|
2627
2625
|
}
|
|
2628
2626
|
};
|
|
2629
2627
|
var SupervisorsApi = class extends BaseApiClient {
|
|
2628
|
+
/** List all supervisors in a workspace. */
|
|
2630
2629
|
async getSupervisors(wid) {
|
|
2631
2630
|
return this.fetch(`w/${wid}/supervisors`);
|
|
2632
2631
|
}
|
|
2632
|
+
/** Get a single supervisor by ID. */
|
|
2633
2633
|
async getSupervisor(wid, id) {
|
|
2634
2634
|
return this.fetch(`w/${wid}/supervisors/${id}`);
|
|
2635
2635
|
}
|
|
2636
|
+
/** Create a new supervisor in a workspace. */
|
|
2636
2637
|
async createSupervisor(wid, supervisor) {
|
|
2637
2638
|
return this.fetch(`w/${wid}/supervisors`, {
|
|
2638
2639
|
method: "POST",
|
|
2639
2640
|
body: JSON.stringify(supervisor)
|
|
2640
2641
|
});
|
|
2641
2642
|
}
|
|
2643
|
+
/** Update an existing supervisor with partial data. */
|
|
2642
2644
|
async updateSupervisor(wid, id, supervisor) {
|
|
2643
2645
|
return this.fetch(`w/${wid}/supervisors/${id}`, {
|
|
2644
2646
|
method: "PUT",
|
|
2645
2647
|
body: JSON.stringify(supervisor)
|
|
2646
2648
|
});
|
|
2647
2649
|
}
|
|
2650
|
+
/** Delete a supervisor by ID. */
|
|
2648
2651
|
async deleteSupervisor(wid, id) {
|
|
2649
2652
|
return this.fetch(`w/${wid}/supervisors/${id}`, {
|
|
2650
2653
|
method: "DELETE"
|
|
@@ -2704,6 +2707,7 @@ var AbilitiesApi = class extends BaseApiClient {
|
|
|
2704
2707
|
}
|
|
2705
2708
|
};
|
|
2706
2709
|
var AccessGrantsApi = class extends BaseApiClient {
|
|
2710
|
+
/** List access grants received by the current member. */
|
|
2707
2711
|
async getMyReceivedGrants(wid, params) {
|
|
2708
2712
|
const searchParams = new URLSearchParams();
|
|
2709
2713
|
if (params?.status) searchParams.set("status", params.status);
|
|
@@ -2714,6 +2718,7 @@ var AccessGrantsApi = class extends BaseApiClient {
|
|
|
2714
2718
|
`w/${wid}/access-grants/my/received${qs ? `?${qs}` : ""}`
|
|
2715
2719
|
);
|
|
2716
2720
|
}
|
|
2721
|
+
/** List access grants given by the current member. */
|
|
2717
2722
|
async getMyGivenGrants(wid, params) {
|
|
2718
2723
|
const searchParams = new URLSearchParams();
|
|
2719
2724
|
if (params?.status) searchParams.set("status", params.status);
|
|
@@ -2724,39 +2729,45 @@ var AccessGrantsApi = class extends BaseApiClient {
|
|
|
2724
2729
|
`w/${wid}/access-grants/my/given${qs ? `?${qs}` : ""}`
|
|
2725
2730
|
);
|
|
2726
2731
|
}
|
|
2732
|
+
/** Get a single access grant by UUID. */
|
|
2727
2733
|
async getAccessGrant(wid, uuid) {
|
|
2728
2734
|
return this.fetch(`w/${wid}/access-grants/${uuid}`);
|
|
2729
2735
|
}
|
|
2736
|
+
/** Create a new access grant for a resource. */
|
|
2730
2737
|
async createAccessGrant(wid, data) {
|
|
2731
2738
|
return this.fetch(`w/${wid}/access-grants`, {
|
|
2732
2739
|
method: "POST",
|
|
2733
2740
|
body: JSON.stringify(data)
|
|
2734
2741
|
});
|
|
2735
2742
|
}
|
|
2743
|
+
/** Resolve a pending access grant by approving or denying it. */
|
|
2736
2744
|
async resolveAccessGrant(wid, uuid, data) {
|
|
2737
2745
|
return this.fetch(`w/${wid}/access-grants/${uuid}/resolve`, {
|
|
2738
2746
|
method: "PUT",
|
|
2739
2747
|
body: JSON.stringify(data)
|
|
2740
2748
|
});
|
|
2741
2749
|
}
|
|
2750
|
+
/** Revoke a previously approved access grant. */
|
|
2742
2751
|
async revokeAccessGrant(wid, uuid, data) {
|
|
2743
2752
|
return this.fetch(`w/${wid}/access-grants/${uuid}/revoke`, {
|
|
2744
2753
|
method: "PUT",
|
|
2745
2754
|
body: JSON.stringify(data)
|
|
2746
2755
|
});
|
|
2747
2756
|
}
|
|
2757
|
+
/** List all access grants with optional filtering by status, resource type, and resource ID. */
|
|
2748
2758
|
async getAccessGrants(wid, params) {
|
|
2749
2759
|
const searchParams = new URLSearchParams();
|
|
2750
2760
|
if (params?.status) searchParams.set("status", params.status);
|
|
2751
2761
|
if (params?.resourceType) searchParams.set("resource_type", params.resourceType);
|
|
2752
2762
|
if (params?.resourceId) searchParams.set("resource_id", params.resourceId.toString());
|
|
2753
2763
|
if (params?.page) searchParams.set("page", params.page.toString());
|
|
2754
|
-
if (params?.pageSize) searchParams.set("
|
|
2764
|
+
if (params?.pageSize) searchParams.set("page_size", params.pageSize.toString());
|
|
2755
2765
|
const qs = searchParams.toString();
|
|
2756
2766
|
return this.fetch(
|
|
2757
2767
|
`w/${wid}/access-grants${qs ? `?${qs}` : ""}`
|
|
2758
2768
|
);
|
|
2759
2769
|
}
|
|
2770
|
+
/** Get all access grants for a specific member. */
|
|
2760
2771
|
async getMemberGrants(wid, memberId) {
|
|
2761
2772
|
const resp = await this.fetch(
|
|
2762
2773
|
`w/${wid}/access-grants/member/${memberId}`
|
|
@@ -3529,6 +3540,7 @@ var AdminApi = class extends BaseApiClient {
|
|
|
3529
3540
|
}
|
|
3530
3541
|
};
|
|
3531
3542
|
var AgentsApi = class extends BaseApiClient {
|
|
3543
|
+
/** List agents in a workspace with optional pagination, sorting, and search. */
|
|
3532
3544
|
async getAgents(wid, options = {}) {
|
|
3533
3545
|
const params = new URLSearchParams();
|
|
3534
3546
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -3542,32 +3554,38 @@ var AgentsApi = class extends BaseApiClient {
|
|
|
3542
3554
|
`w/${wid}/agents${params.toString() ? `?${params.toString()}` : ""}`
|
|
3543
3555
|
);
|
|
3544
3556
|
}
|
|
3557
|
+
/** Get a single agent by ID. */
|
|
3545
3558
|
async getAgent(wid, id) {
|
|
3546
3559
|
return this.fetch(`w/${wid}/agents/${id}`);
|
|
3547
3560
|
}
|
|
3561
|
+
/** Create a new agent in a workspace. */
|
|
3548
3562
|
async createAgent(wid, agent) {
|
|
3549
3563
|
return this.fetch(`w/${wid}/agents`, {
|
|
3550
3564
|
method: "POST",
|
|
3551
3565
|
body: JSON.stringify(agent)
|
|
3552
3566
|
});
|
|
3553
3567
|
}
|
|
3568
|
+
/** Update an existing agent. */
|
|
3554
3569
|
async updateAgent(wid, id, agent) {
|
|
3555
3570
|
return this.fetch(`w/${wid}/agents/${id}`, {
|
|
3556
3571
|
method: "PUT",
|
|
3557
3572
|
body: JSON.stringify(agent)
|
|
3558
3573
|
});
|
|
3559
3574
|
}
|
|
3575
|
+
/** Delete an agent by ID, optionally forcing deletion of agents with active references. */
|
|
3560
3576
|
async deleteAgent(wid, id, force) {
|
|
3561
3577
|
const params = force ? "?force=true" : "";
|
|
3562
3578
|
return this.fetch(`w/${wid}/agents/${id}${params}`, {
|
|
3563
3579
|
method: "DELETE"
|
|
3564
3580
|
});
|
|
3565
3581
|
}
|
|
3582
|
+
/** Archive an agent, hiding it from default listings. */
|
|
3566
3583
|
async archiveAgent(wid, id) {
|
|
3567
3584
|
return this.fetch(`w/${wid}/agents/${id}/archive`, {
|
|
3568
3585
|
method: "POST"
|
|
3569
3586
|
});
|
|
3570
3587
|
}
|
|
3588
|
+
/** Restore an archived agent back to active status. */
|
|
3571
3589
|
async unarchiveAgent(wid, id) {
|
|
3572
3590
|
return this.fetch(`w/${wid}/agents/${id}/unarchive`, {
|
|
3573
3591
|
method: "POST"
|
|
@@ -3650,30 +3668,36 @@ var AIModelsApi = class extends BaseApiClient {
|
|
|
3650
3668
|
};
|
|
3651
3669
|
var ApiKeysApi = class extends BaseApiClient {
|
|
3652
3670
|
// Workspace-specific API key methods
|
|
3671
|
+
/** List all API keys for a workspace. */
|
|
3653
3672
|
async getApiKeys(wid) {
|
|
3654
3673
|
return this.fetch(`w/${wid}/api-keys`);
|
|
3655
3674
|
}
|
|
3675
|
+
/** Create a new API key for a workspace. */
|
|
3656
3676
|
async createApiKey(wid, apiKey) {
|
|
3657
3677
|
return this.fetch(`w/${wid}/api-keys`, {
|
|
3658
3678
|
method: "POST",
|
|
3659
3679
|
body: JSON.stringify(apiKey)
|
|
3660
3680
|
});
|
|
3661
3681
|
}
|
|
3682
|
+
/** Revoke a workspace API key. */
|
|
3662
3683
|
async revokeApiKey(wid, id) {
|
|
3663
3684
|
return this.fetch(`w/${wid}/api-keys/${id}`, {
|
|
3664
3685
|
method: "DELETE"
|
|
3665
3686
|
});
|
|
3666
3687
|
}
|
|
3667
3688
|
// Global (account-level) API key methods
|
|
3689
|
+
/** List all account-level API keys. */
|
|
3668
3690
|
async getGlobalApiKeys() {
|
|
3669
3691
|
return this.fetch(`account/api-keys`);
|
|
3670
3692
|
}
|
|
3693
|
+
/** Create a new account-level API key. */
|
|
3671
3694
|
async createGlobalApiKey(apiKey) {
|
|
3672
3695
|
return this.fetch(`account/api-keys`, {
|
|
3673
3696
|
method: "POST",
|
|
3674
3697
|
body: JSON.stringify(apiKey)
|
|
3675
3698
|
});
|
|
3676
3699
|
}
|
|
3700
|
+
/** Revoke an account-level API key. */
|
|
3677
3701
|
async revokeGlobalApiKey(id) {
|
|
3678
3702
|
return this.fetch(`account/api-keys/${id}`, {
|
|
3679
3703
|
method: "DELETE"
|
|
@@ -3681,6 +3705,7 @@ var ApiKeysApi = class extends BaseApiClient {
|
|
|
3681
3705
|
}
|
|
3682
3706
|
};
|
|
3683
3707
|
var AssignmentsApi = class extends BaseApiClient {
|
|
3708
|
+
/** List assignments with optional filtering, pagination, and sorting. */
|
|
3684
3709
|
async getAssignments(wid, options = {}) {
|
|
3685
3710
|
const params = new URLSearchParams();
|
|
3686
3711
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -3695,56 +3720,68 @@ var AssignmentsApi = class extends BaseApiClient {
|
|
|
3695
3720
|
`w/${wid}/assignments${params.toString() ? `?${params.toString()}` : ""}`
|
|
3696
3721
|
);
|
|
3697
3722
|
}
|
|
3723
|
+
/** Get a single assignment by ID. */
|
|
3698
3724
|
async getAssignment(wid, id) {
|
|
3699
3725
|
return this.fetch(`w/${wid}/assignments/${id}`);
|
|
3700
3726
|
}
|
|
3727
|
+
/** Get all chat messages for an assignment. */
|
|
3701
3728
|
async getAssignmentMessages(wid, id) {
|
|
3702
3729
|
return this.fetch(`w/${wid}/assignments/${id}/messages`);
|
|
3703
3730
|
}
|
|
3731
|
+
/** Update an assignment by ID. */
|
|
3704
3732
|
async updateAssignment(wid, id, assignment) {
|
|
3705
3733
|
return this.fetch(`w/${wid}/assignments/${id}`, {
|
|
3706
3734
|
method: "PUT",
|
|
3707
3735
|
body: JSON.stringify(assignment)
|
|
3708
3736
|
});
|
|
3709
3737
|
}
|
|
3738
|
+
/** Delete an assignment by ID. */
|
|
3710
3739
|
async deleteAssignment(wid, id) {
|
|
3711
3740
|
return this.fetch(`w/${wid}/assignments/${id}`, {
|
|
3712
3741
|
method: "DELETE"
|
|
3713
3742
|
});
|
|
3714
3743
|
}
|
|
3744
|
+
/** Get a specific task within an assignment. */
|
|
3715
3745
|
async getAssignmentTask(wid, id, assignmentTaskId) {
|
|
3716
3746
|
return this.fetch(`w/${wid}/assignments/${id}/tasks/${assignmentTaskId}`);
|
|
3717
3747
|
}
|
|
3748
|
+
/** Set the current active task for an assignment. */
|
|
3718
3749
|
async selectCurrentAssignmentTask(wid, id, assignmentTaskId) {
|
|
3719
3750
|
return this.fetch(`w/${wid}/assignments/${id}/tasks/${assignmentTaskId}/select`, {
|
|
3720
3751
|
method: "PUT"
|
|
3721
3752
|
});
|
|
3722
3753
|
}
|
|
3754
|
+
/** Create a new assignment for a member. */
|
|
3723
3755
|
async createAssignment(wid, data) {
|
|
3724
3756
|
return this.fetch(`w/${wid}/assignments`, {
|
|
3725
3757
|
method: "POST",
|
|
3726
3758
|
body: JSON.stringify(data)
|
|
3727
3759
|
});
|
|
3728
3760
|
}
|
|
3761
|
+
/** Get the current task detail for an assignment from the operator perspective. */
|
|
3729
3762
|
async getAssignmentTaskDetail(wid, assignmentId) {
|
|
3730
3763
|
return this.fetch(
|
|
3731
3764
|
`w/${wid}/assignments/${assignmentId}/current-task-detail`
|
|
3732
3765
|
);
|
|
3733
3766
|
}
|
|
3767
|
+
/** Get the CEL expression evaluation context for an assignment. */
|
|
3734
3768
|
async getAssignmentCelContext(wid, assignmentId) {
|
|
3735
3769
|
return this.fetch(
|
|
3736
3770
|
`w/${wid}/assignments/${assignmentId}/cel-context`
|
|
3737
3771
|
);
|
|
3738
3772
|
}
|
|
3773
|
+
/** Cancel an active assignment with an optional reason. */
|
|
3739
3774
|
async cancelAssignment(wid, id, data) {
|
|
3740
3775
|
return this.fetch(`w/${wid}/assignments/${id}/cancel`, {
|
|
3741
3776
|
method: "POST",
|
|
3742
3777
|
body: JSON.stringify(data ?? {})
|
|
3743
3778
|
});
|
|
3744
3779
|
}
|
|
3780
|
+
/** List available tools for an assignment. */
|
|
3745
3781
|
async getAssignmentTools(wid, assignmentId) {
|
|
3746
3782
|
return this.fetch(`w/${wid}/assignments/${assignmentId}/tools`);
|
|
3747
3783
|
}
|
|
3784
|
+
/** Execute a tool within an assignment context. */
|
|
3748
3785
|
async executeAssignmentTool(wid, assignmentId, toolName, parameters = {}) {
|
|
3749
3786
|
return this.fetch(`w/${wid}/assignments/${assignmentId}/execute-tool`, {
|
|
3750
3787
|
method: "POST",
|
|
@@ -3753,6 +3790,7 @@ var AssignmentsApi = class extends BaseApiClient {
|
|
|
3753
3790
|
}
|
|
3754
3791
|
};
|
|
3755
3792
|
var AssistantsApi = class extends BaseApiClient {
|
|
3793
|
+
/** List assistants in a workspace with optional pagination, sorting, and search. */
|
|
3756
3794
|
async getAssistants(wid, options = {}) {
|
|
3757
3795
|
const params = new URLSearchParams();
|
|
3758
3796
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -3767,9 +3805,11 @@ var AssistantsApi = class extends BaseApiClient {
|
|
|
3767
3805
|
`w/${wid}/assistants${params.toString() ? `?${params.toString()}` : ""}`
|
|
3768
3806
|
);
|
|
3769
3807
|
}
|
|
3808
|
+
/** Get a single assistant by ID. */
|
|
3770
3809
|
async getAssistant(wid, id) {
|
|
3771
3810
|
return this.fetch(`w/${wid}/assistants/${id}`);
|
|
3772
3811
|
}
|
|
3812
|
+
/** Create a new assistant in a workspace. */
|
|
3773
3813
|
async createAssistant(wid, assistant) {
|
|
3774
3814
|
const assistantData = { ...assistant };
|
|
3775
3815
|
return this.fetch(`w/${wid}/assistants`, {
|
|
@@ -3777,17 +3817,20 @@ var AssistantsApi = class extends BaseApiClient {
|
|
|
3777
3817
|
body: JSON.stringify(assistantData)
|
|
3778
3818
|
});
|
|
3779
3819
|
}
|
|
3820
|
+
/** Update an existing assistant with partial data. */
|
|
3780
3821
|
async updateAssistant(wid, id, assistant) {
|
|
3781
3822
|
return this.fetch(`w/${wid}/assistants/${id}`, {
|
|
3782
3823
|
method: "PUT",
|
|
3783
3824
|
body: JSON.stringify(assistant)
|
|
3784
3825
|
});
|
|
3785
3826
|
}
|
|
3827
|
+
/** Delete an assistant by ID. */
|
|
3786
3828
|
async deleteAssistant(wid, id) {
|
|
3787
3829
|
return this.fetch(`w/${wid}/assistants/${id}`, {
|
|
3788
3830
|
method: "DELETE"
|
|
3789
3831
|
});
|
|
3790
3832
|
}
|
|
3833
|
+
/** Generate a text-to-speech audio preview for a given voice model. */
|
|
3791
3834
|
async previewTTS(wid, request) {
|
|
3792
3835
|
const response = await this.fetchRaw(`w/${wid}/assistants/tts-preview`, {
|
|
3793
3836
|
method: "POST",
|
|
@@ -3798,6 +3841,17 @@ var AssistantsApi = class extends BaseApiClient {
|
|
|
3798
3841
|
});
|
|
3799
3842
|
return response.arrayBuffer();
|
|
3800
3843
|
}
|
|
3844
|
+
/** Generate a thinking sound audio preview. */
|
|
3845
|
+
async previewThinkingSound(wid, request) {
|
|
3846
|
+
const response = await this.fetchRaw(`w/${wid}/assistants/thinking-sound-preview`, {
|
|
3847
|
+
method: "POST",
|
|
3848
|
+
headers: {
|
|
3849
|
+
"Content-Type": "application/json"
|
|
3850
|
+
},
|
|
3851
|
+
body: JSON.stringify(request)
|
|
3852
|
+
});
|
|
3853
|
+
return response.arrayBuffer();
|
|
3854
|
+
}
|
|
3801
3855
|
};
|
|
3802
3856
|
function sanitizePhoneForBackend(phoneNumber) {
|
|
3803
3857
|
try {
|
|
@@ -3813,15 +3867,18 @@ function sanitizePhoneForBackend(phoneNumber) {
|
|
|
3813
3867
|
return phoneNumber;
|
|
3814
3868
|
}
|
|
3815
3869
|
var AuthApi = class extends BaseApiClient {
|
|
3870
|
+
/** Get the authenticated user's account. */
|
|
3816
3871
|
async getUserAccount() {
|
|
3817
3872
|
return this.fetch("account");
|
|
3818
3873
|
}
|
|
3874
|
+
/** Update the authenticated user's account information. */
|
|
3819
3875
|
async updateUserAccount(info) {
|
|
3820
3876
|
return this.fetch("account", {
|
|
3821
3877
|
method: "POST",
|
|
3822
3878
|
body: JSON.stringify(info)
|
|
3823
3879
|
});
|
|
3824
3880
|
}
|
|
3881
|
+
/** Initiate SMS login by sending a verification code to the given phone number. */
|
|
3825
3882
|
async login(phoneNumber, wid, organizationUuid) {
|
|
3826
3883
|
const params = new URLSearchParams();
|
|
3827
3884
|
if (wid) params.append("wid", wid);
|
|
@@ -3832,6 +3889,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
3832
3889
|
body: JSON.stringify(body)
|
|
3833
3890
|
});
|
|
3834
3891
|
}
|
|
3892
|
+
/** Resend the SMS verification code to the given phone number. */
|
|
3835
3893
|
async resendCode(phoneNumber, organizationUuid) {
|
|
3836
3894
|
const body = { phoneNumber: sanitizePhoneForBackend(phoneNumber) };
|
|
3837
3895
|
if (organizationUuid) body.organizationUuid = organizationUuid;
|
|
@@ -3840,6 +3898,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
3840
3898
|
body: JSON.stringify(body)
|
|
3841
3899
|
});
|
|
3842
3900
|
}
|
|
3901
|
+
/** Verify an SMS code and complete authentication, handling 2FA if required. */
|
|
3843
3902
|
async verifyCodeWith2FA(phoneNumber, code, organizationUuid) {
|
|
3844
3903
|
const verifyResponse = await this.fetch("auth/verify-with-2fa", {
|
|
3845
3904
|
method: "POST",
|
|
@@ -3867,33 +3926,39 @@ var AuthApi = class extends BaseApiClient {
|
|
|
3867
3926
|
}
|
|
3868
3927
|
return verifyResponse;
|
|
3869
3928
|
}
|
|
3929
|
+
/** Log in with email and password credentials. */
|
|
3870
3930
|
async emailPasswordLogin(email, password, organizationUuid) {
|
|
3871
3931
|
return await this.fetch(`auth/email-password-login`, {
|
|
3872
3932
|
method: "POST",
|
|
3873
3933
|
body: JSON.stringify({ email, password, organizationUuid })
|
|
3874
3934
|
});
|
|
3875
3935
|
}
|
|
3936
|
+
/** Sign up a new account with email and password. */
|
|
3876
3937
|
async emailPasswordSignup(email, password, name, organizationUuid) {
|
|
3877
3938
|
return await this.fetch(`auth/email-password-signup`, {
|
|
3878
3939
|
method: "POST",
|
|
3879
3940
|
body: JSON.stringify({ email, password, name, organizationUuid })
|
|
3880
3941
|
});
|
|
3881
3942
|
}
|
|
3943
|
+
/** Change the current account password by providing the existing password. */
|
|
3882
3944
|
async changePassword(currentPassword, newPassword) {
|
|
3883
3945
|
return await this.fetch(`auth/change-password`, {
|
|
3884
3946
|
method: "POST",
|
|
3885
3947
|
body: JSON.stringify({ currentPassword, newPassword })
|
|
3886
3948
|
});
|
|
3887
3949
|
}
|
|
3950
|
+
/** Set a password for an account that does not yet have one. */
|
|
3888
3951
|
async setPassword(newPassword) {
|
|
3889
3952
|
return await this.fetch(`auth/set-password`, {
|
|
3890
3953
|
method: "POST",
|
|
3891
3954
|
body: JSON.stringify({ newPassword })
|
|
3892
3955
|
});
|
|
3893
3956
|
}
|
|
3957
|
+
/** Check whether the current account has a password set. */
|
|
3894
3958
|
async getPasswordStatus() {
|
|
3895
3959
|
return await this.fetch(`auth/password-status`);
|
|
3896
3960
|
}
|
|
3961
|
+
/** Log out the current session by clearing auth cookies. */
|
|
3897
3962
|
async logout() {
|
|
3898
3963
|
const response = await fetch(`/api/auth/logout`, {
|
|
3899
3964
|
method: "POST",
|
|
@@ -3904,22 +3969,24 @@ var AuthApi = class extends BaseApiClient {
|
|
|
3904
3969
|
}
|
|
3905
3970
|
return await response.json();
|
|
3906
3971
|
}
|
|
3907
|
-
|
|
3972
|
+
/** Request a cross-domain authentication token for single sign-on across domains. */
|
|
3908
3973
|
async requestCrossDomainToken() {
|
|
3909
3974
|
return this.fetch("auth/cross-domain-token", {
|
|
3910
3975
|
method: "POST"
|
|
3911
3976
|
});
|
|
3912
3977
|
}
|
|
3978
|
+
/** Exchange a cross-domain token for an authenticated session token. */
|
|
3913
3979
|
async exchangeToken(token) {
|
|
3914
3980
|
return this.fetch("auth/exchange-token", {
|
|
3915
3981
|
method: "POST",
|
|
3916
3982
|
body: JSON.stringify({ token })
|
|
3917
3983
|
});
|
|
3918
3984
|
}
|
|
3985
|
+
/** Get the organization and workspace mapping for a custom domain. */
|
|
3919
3986
|
async getDomainMapping(customDomain) {
|
|
3920
3987
|
return this.fetch(`s/mapping/${customDomain}`);
|
|
3921
3988
|
}
|
|
3922
|
-
|
|
3989
|
+
/** Create a new signup with member and data records for a workspace. */
|
|
3923
3990
|
async createSignup(wid, data) {
|
|
3924
3991
|
return this.fetch(`w/${wid}/create-signup`, {
|
|
3925
3992
|
method: "POST",
|
|
@@ -3927,12 +3994,14 @@ var AuthApi = class extends BaseApiClient {
|
|
|
3927
3994
|
});
|
|
3928
3995
|
}
|
|
3929
3996
|
// ===== MAGIC LINK AUTHENTICATION METHODS =====
|
|
3997
|
+
/** Request a magic link to be sent to the given email address for passwordless login. */
|
|
3930
3998
|
async requestMagicLink(email, organizationUuid, redirectUrl) {
|
|
3931
3999
|
return await this.fetch(`auth/request-magic-link`, {
|
|
3932
4000
|
method: "POST",
|
|
3933
4001
|
body: JSON.stringify({ email, organizationUuid, redirectUrl })
|
|
3934
4002
|
});
|
|
3935
4003
|
}
|
|
4004
|
+
/** Validate a magic link token and optional OTP to complete authentication. */
|
|
3936
4005
|
async validateMagicLink(token, otp) {
|
|
3937
4006
|
const body = { token };
|
|
3938
4007
|
if (otp) {
|
|
@@ -3944,12 +4013,14 @@ var AuthApi = class extends BaseApiClient {
|
|
|
3944
4013
|
});
|
|
3945
4014
|
}
|
|
3946
4015
|
// ===== EMAIL VERIFICATION METHODS =====
|
|
4016
|
+
/** Send a verification code to the given email address for login. */
|
|
3947
4017
|
async sendEmailVerification(email, organizationUuid) {
|
|
3948
4018
|
return await this.fetch(`auth/send-email-verification`, {
|
|
3949
4019
|
method: "POST",
|
|
3950
4020
|
body: JSON.stringify({ email, organizationUuid })
|
|
3951
4021
|
});
|
|
3952
4022
|
}
|
|
4023
|
+
/** Verify an email code and complete authentication, handling 2FA if required. */
|
|
3953
4024
|
async verifyEmail(email, code, organizationUuid) {
|
|
3954
4025
|
const verifyResponse = await this.fetch(`auth/verify-email`, {
|
|
3955
4026
|
method: "POST",
|
|
@@ -3972,44 +4043,52 @@ var AuthApi = class extends BaseApiClient {
|
|
|
3972
4043
|
return verifyResponse;
|
|
3973
4044
|
}
|
|
3974
4045
|
// ===== TWO-FACTOR AUTHENTICATION METHODS =====
|
|
4046
|
+
/** Get the current two-factor authentication status and configured methods. */
|
|
3975
4047
|
async getTwoFactorStatus() {
|
|
3976
4048
|
return this.fetch("auth/2fa/status");
|
|
3977
4049
|
}
|
|
4050
|
+
/** Initiate TOTP two-factor setup and receive the secret and QR code URI. */
|
|
3978
4051
|
async setupTOTP(data) {
|
|
3979
4052
|
return this.fetch("auth/2fa/totp/setup", {
|
|
3980
4053
|
method: "POST",
|
|
3981
4054
|
body: JSON.stringify(data)
|
|
3982
4055
|
});
|
|
3983
4056
|
}
|
|
4057
|
+
/** Verify a TOTP code to complete two-factor setup. */
|
|
3984
4058
|
async verifyTOTPSetup(data) {
|
|
3985
4059
|
return this.fetch("auth/2fa/totp/verify", {
|
|
3986
4060
|
method: "POST",
|
|
3987
4061
|
body: JSON.stringify(data)
|
|
3988
4062
|
});
|
|
3989
4063
|
}
|
|
4064
|
+
/** Initiate WebAuthn (passkey/security key) two-factor setup. */
|
|
3990
4065
|
async setupWebAuthn(data) {
|
|
3991
4066
|
return this.fetch("auth/2fa/webauthn/setup", {
|
|
3992
4067
|
method: "POST",
|
|
3993
4068
|
body: JSON.stringify(data)
|
|
3994
4069
|
});
|
|
3995
4070
|
}
|
|
4071
|
+
/** Verify a WebAuthn assertion to complete two-factor setup. */
|
|
3996
4072
|
async verifyWebAuthnSetup(data) {
|
|
3997
4073
|
return this.fetch("auth/2fa/webauthn/verify", {
|
|
3998
4074
|
method: "POST",
|
|
3999
4075
|
body: JSON.stringify(data)
|
|
4000
4076
|
});
|
|
4001
4077
|
}
|
|
4078
|
+
/** Generate new two-factor recovery codes, invalidating any existing ones. */
|
|
4002
4079
|
async generateRecoveryCodes(data = {}) {
|
|
4003
4080
|
return this.fetch("auth/2fa/recovery-codes/generate", {
|
|
4004
4081
|
method: "POST",
|
|
4005
4082
|
body: JSON.stringify(data)
|
|
4006
4083
|
});
|
|
4007
4084
|
}
|
|
4085
|
+
/** Disable a specific two-factor authentication method. */
|
|
4008
4086
|
async disableTwoFactorMethod(methodId) {
|
|
4009
4087
|
return this.fetch(`auth/2fa/methods/${methodId}`, {
|
|
4010
4088
|
method: "DELETE"
|
|
4011
4089
|
});
|
|
4012
4090
|
}
|
|
4091
|
+
/** Update settings for a two-factor authentication method. */
|
|
4013
4092
|
async updateTwoFactorMethod(data) {
|
|
4014
4093
|
return this.fetch(`auth/2fa/methods/${data.methodId}`, {
|
|
4015
4094
|
method: "PUT",
|
|
@@ -4017,6 +4096,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
4017
4096
|
});
|
|
4018
4097
|
}
|
|
4019
4098
|
// ===== TWO-FACTOR AUTHENTICATION LOGIN METHODS =====
|
|
4099
|
+
/** Verify a TOTP code during login to complete two-factor authentication. */
|
|
4020
4100
|
async verifyTOTPAuth(tempToken, code) {
|
|
4021
4101
|
return this.fetch("auth/2fa/auth/totp", {
|
|
4022
4102
|
method: "POST",
|
|
@@ -4026,6 +4106,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
4026
4106
|
})
|
|
4027
4107
|
});
|
|
4028
4108
|
}
|
|
4109
|
+
/** Verify a recovery code during login to complete two-factor authentication. */
|
|
4029
4110
|
async verifyRecoveryCodeAuth(tempToken, code) {
|
|
4030
4111
|
return this.fetch("auth/2fa/auth/recovery", {
|
|
4031
4112
|
method: "POST",
|
|
@@ -4035,6 +4116,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
4035
4116
|
})
|
|
4036
4117
|
});
|
|
4037
4118
|
}
|
|
4119
|
+
/** Get WebAuthn credential request options for two-factor login verification. */
|
|
4038
4120
|
async getWebAuthnAuthOptions(tempToken) {
|
|
4039
4121
|
return this.fetch("auth/2fa/webauthn/options", {
|
|
4040
4122
|
method: "POST",
|
|
@@ -4043,6 +4125,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
4043
4125
|
})
|
|
4044
4126
|
});
|
|
4045
4127
|
}
|
|
4128
|
+
/** Verify a WebAuthn assertion during login to complete two-factor authentication. */
|
|
4046
4129
|
async verifyWebAuthnAuth(tempToken, assertionResponse) {
|
|
4047
4130
|
return this.fetch("auth/2fa/webauthn", {
|
|
4048
4131
|
method: "POST",
|
|
@@ -4053,6 +4136,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
4053
4136
|
});
|
|
4054
4137
|
}
|
|
4055
4138
|
// ===== ORGANIZATION MEMBERSHIP METHODS =====
|
|
4139
|
+
/** List all organizations the current account belongs to. */
|
|
4056
4140
|
async getMyOrganizations() {
|
|
4057
4141
|
return this.fetch("o/mine");
|
|
4058
4142
|
}
|
|
@@ -4118,7 +4202,7 @@ var AuthApi = class extends BaseApiClient {
|
|
|
4118
4202
|
}
|
|
4119
4203
|
};
|
|
4120
4204
|
var CalendarsApi = class extends BaseApiClient {
|
|
4121
|
-
|
|
4205
|
+
/** List calendars in a workspace with optional pagination. */
|
|
4122
4206
|
async getCalendars(wid, params) {
|
|
4123
4207
|
const queryParams = new URLSearchParams();
|
|
4124
4208
|
if (params?.page) queryParams.append("page", params.page.toString());
|
|
@@ -4129,6 +4213,7 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
4129
4213
|
`w/${wid}/calendars${queryString ? `?${queryString}` : ""}`
|
|
4130
4214
|
);
|
|
4131
4215
|
}
|
|
4216
|
+
/** Get a single calendar by ID, optionally including its schedules. */
|
|
4132
4217
|
async getCalendar(wid, id, includeSchedules) {
|
|
4133
4218
|
const params = new URLSearchParams();
|
|
4134
4219
|
if (includeSchedules) params.append("include_schedules", "true");
|
|
@@ -4136,33 +4221,38 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
4136
4221
|
`w/${wid}/calendars/${id}${params.toString() ? `?${params.toString()}` : ""}`
|
|
4137
4222
|
);
|
|
4138
4223
|
}
|
|
4224
|
+
/** Create a new calendar in the workspace. */
|
|
4139
4225
|
async createCalendar(wid, calendar) {
|
|
4140
4226
|
return this.fetch(`w/${wid}/calendars`, {
|
|
4141
4227
|
method: "POST",
|
|
4142
4228
|
body: JSON.stringify(calendar)
|
|
4143
4229
|
});
|
|
4144
4230
|
}
|
|
4231
|
+
/** Update a calendar's configuration. */
|
|
4145
4232
|
async updateCalendar(wid, id, calendar) {
|
|
4146
4233
|
return this.fetch(`w/${wid}/calendars/${id}`, {
|
|
4147
4234
|
method: "PUT",
|
|
4148
4235
|
body: JSON.stringify(calendar)
|
|
4149
4236
|
});
|
|
4150
4237
|
}
|
|
4238
|
+
/** Delete a calendar by ID. */
|
|
4151
4239
|
async deleteCalendar(wid, id) {
|
|
4152
4240
|
return this.fetch(`w/${wid}/calendars/${id}`, {
|
|
4153
4241
|
method: "DELETE"
|
|
4154
4242
|
});
|
|
4155
4243
|
}
|
|
4156
|
-
|
|
4244
|
+
/** List all schedules for a calendar. */
|
|
4157
4245
|
async getCalendarSchedules(wid, calendarId) {
|
|
4158
4246
|
return this.fetch(`w/${wid}/calendars/${calendarId}/schedules`);
|
|
4159
4247
|
}
|
|
4248
|
+
/** Create a new schedule for a calendar. */
|
|
4160
4249
|
async createCalendarSchedule(wid, calendarId, schedule) {
|
|
4161
4250
|
return this.fetch(`w/${wid}/calendars/${calendarId}/schedules`, {
|
|
4162
4251
|
method: "POST",
|
|
4163
4252
|
body: JSON.stringify(schedule)
|
|
4164
4253
|
});
|
|
4165
4254
|
}
|
|
4255
|
+
/** Update an existing calendar schedule. */
|
|
4166
4256
|
async updateCalendarSchedule(wid, calendarId, scheduleId, schedule) {
|
|
4167
4257
|
return this.fetch(
|
|
4168
4258
|
`w/${wid}/calendars/${calendarId}/schedules/${scheduleId}`,
|
|
@@ -4172,18 +4262,20 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
4172
4262
|
}
|
|
4173
4263
|
);
|
|
4174
4264
|
}
|
|
4265
|
+
/** Delete a calendar schedule. */
|
|
4175
4266
|
async deleteCalendarSchedule(wid, calendarId, scheduleId) {
|
|
4176
4267
|
return this.fetch(`w/${wid}/calendars/${calendarId}/schedules/${scheduleId}`, {
|
|
4177
4268
|
method: "DELETE"
|
|
4178
4269
|
});
|
|
4179
4270
|
}
|
|
4180
|
-
|
|
4271
|
+
/** Check availability for a time range on a calendar. */
|
|
4181
4272
|
async checkAvailability(wid, calendarId, check) {
|
|
4182
4273
|
return this.fetch(`w/${wid}/calendars/${calendarId}/availability`, {
|
|
4183
4274
|
method: "POST",
|
|
4184
4275
|
body: JSON.stringify(check)
|
|
4185
4276
|
});
|
|
4186
4277
|
}
|
|
4278
|
+
/** Get available booking slots for a calendar within a date range. */
|
|
4187
4279
|
async getAvailableSlots(wid, calendarId, request) {
|
|
4188
4280
|
return this.fetch(
|
|
4189
4281
|
`w/${wid}/calendars/${calendarId}/available-slots`,
|
|
@@ -4193,7 +4285,7 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
4193
4285
|
}
|
|
4194
4286
|
);
|
|
4195
4287
|
}
|
|
4196
|
-
|
|
4288
|
+
/** List calendar events with optional filtering by date range, status, and member. */
|
|
4197
4289
|
async getCalendarEvents(wid, options = {}) {
|
|
4198
4290
|
const params = new URLSearchParams();
|
|
4199
4291
|
if (options.calendarId) params.append("calendarId", options.calendarId.toString());
|
|
@@ -4207,70 +4299,80 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
4207
4299
|
`w/${wid}/calendar-events${params.toString() ? `?${params.toString()}` : ""}`
|
|
4208
4300
|
);
|
|
4209
4301
|
}
|
|
4302
|
+
/** Get a single calendar event by ID. */
|
|
4210
4303
|
async getCalendarEvent(wid, eventId) {
|
|
4211
4304
|
return this.fetch(`w/${wid}/calendar-events/${eventId}`);
|
|
4212
4305
|
}
|
|
4306
|
+
/** Create a new calendar event. */
|
|
4213
4307
|
async createCalendarEvent(wid, event) {
|
|
4214
4308
|
return this.fetch(`w/${wid}/calendar-events`, {
|
|
4215
4309
|
method: "POST",
|
|
4216
4310
|
body: JSON.stringify(event)
|
|
4217
4311
|
});
|
|
4218
4312
|
}
|
|
4313
|
+
/** Update an existing calendar event. */
|
|
4219
4314
|
async updateCalendarEvent(wid, eventId, event) {
|
|
4220
4315
|
return this.fetch(`w/${wid}/calendar-events/${eventId}`, {
|
|
4221
4316
|
method: "PUT",
|
|
4222
4317
|
body: JSON.stringify(event)
|
|
4223
4318
|
});
|
|
4224
4319
|
}
|
|
4320
|
+
/** Cancel a calendar event with an optional reason. */
|
|
4225
4321
|
async cancelCalendarEvent(wid, eventId, reason) {
|
|
4226
4322
|
return this.fetch(`w/${wid}/calendar-events/${eventId}/cancel`, {
|
|
4227
4323
|
method: "POST",
|
|
4228
4324
|
body: JSON.stringify({ cancellationReason: reason })
|
|
4229
4325
|
});
|
|
4230
4326
|
}
|
|
4327
|
+
/** Delete a calendar event by ID. */
|
|
4231
4328
|
async deleteCalendarEvent(wid, eventId) {
|
|
4232
4329
|
return this.fetch(`w/${wid}/calendar-events/${eventId}`, {
|
|
4233
4330
|
method: "DELETE"
|
|
4234
4331
|
});
|
|
4235
4332
|
}
|
|
4236
|
-
|
|
4333
|
+
/** Update an attendee's details on a calendar event. */
|
|
4237
4334
|
async updateEventAttendee(wid, eventId, attendeeId, update) {
|
|
4238
4335
|
return this.fetch(`w/${wid}/calendar-events/${eventId}/attendees/${attendeeId}`, {
|
|
4239
4336
|
method: "PUT",
|
|
4240
4337
|
body: JSON.stringify(update)
|
|
4241
4338
|
});
|
|
4242
4339
|
}
|
|
4243
|
-
|
|
4340
|
+
/** List all calendar event types in the workspace. */
|
|
4244
4341
|
async getEventTypes(wid) {
|
|
4245
4342
|
return this.fetch(`w/${wid}/calendar-event-types`);
|
|
4246
4343
|
}
|
|
4344
|
+
/** Get a single calendar event type by ID. */
|
|
4247
4345
|
async getEventType(wid, id) {
|
|
4248
4346
|
return this.fetch(`w/${wid}/calendar-event-types/${id}`);
|
|
4249
4347
|
}
|
|
4348
|
+
/** Create a new calendar event type. */
|
|
4250
4349
|
async createEventType(wid, eventType) {
|
|
4251
4350
|
return this.fetch(`w/${wid}/calendar-event-types`, {
|
|
4252
4351
|
method: "POST",
|
|
4253
4352
|
body: JSON.stringify(eventType)
|
|
4254
4353
|
});
|
|
4255
4354
|
}
|
|
4355
|
+
/** Update an existing calendar event type. */
|
|
4256
4356
|
async updateEventType(wid, id, eventType) {
|
|
4257
4357
|
return this.fetch(`w/${wid}/calendar-event-types/${id}`, {
|
|
4258
4358
|
method: "PUT",
|
|
4259
4359
|
body: JSON.stringify(eventType)
|
|
4260
4360
|
});
|
|
4261
4361
|
}
|
|
4362
|
+
/** Delete a calendar event type by ID. */
|
|
4262
4363
|
async deleteEventType(wid, id) {
|
|
4263
4364
|
return this.fetch(`w/${wid}/calendar-event-types/${id}`, {
|
|
4264
4365
|
method: "DELETE"
|
|
4265
4366
|
});
|
|
4266
4367
|
}
|
|
4267
|
-
|
|
4368
|
+
/** Generate or regenerate an iCal feed token for a calendar. */
|
|
4268
4369
|
async generateICalToken(wid, calendarId, regenerate = false) {
|
|
4269
4370
|
return this.fetch(`w/${wid}/calendars/${calendarId}/ical-token`, {
|
|
4270
4371
|
method: "POST",
|
|
4271
4372
|
body: JSON.stringify({ regenerate })
|
|
4272
4373
|
});
|
|
4273
4374
|
}
|
|
4375
|
+
/** Revoke the iCal feed token for a calendar, disabling external feed access. */
|
|
4274
4376
|
async revokeICalToken(wid, calendarId) {
|
|
4275
4377
|
return this.fetch(
|
|
4276
4378
|
`w/${wid}/calendars/${calendarId}/ical-token`,
|
|
@@ -4279,29 +4381,34 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
4279
4381
|
}
|
|
4280
4382
|
);
|
|
4281
4383
|
}
|
|
4384
|
+
/** Get the iCal feed URL for a calendar. */
|
|
4282
4385
|
async getICalFeedUrl(wid, calendarId) {
|
|
4283
4386
|
return this.fetch(`w/${wid}/calendars/${calendarId}/ical-url`);
|
|
4284
4387
|
}
|
|
4285
|
-
|
|
4388
|
+
/** List Google Calendars available for linking. */
|
|
4286
4389
|
async listGoogleCalendars(wid) {
|
|
4287
4390
|
return this.fetch(`w/${wid}/calendars/google/list`);
|
|
4288
4391
|
}
|
|
4392
|
+
/** Get the Google Calendar integration status for the workspace. */
|
|
4289
4393
|
async getGoogleCalendarStatus(wid) {
|
|
4290
4394
|
return this.fetch(
|
|
4291
4395
|
`w/${wid}/calendars/google/status`
|
|
4292
4396
|
);
|
|
4293
4397
|
}
|
|
4398
|
+
/** Link a calendar to a Google Calendar for two-way sync. */
|
|
4294
4399
|
async linkCalendarToGoogle(wid, calendarId, request) {
|
|
4295
4400
|
return this.fetch(`w/${wid}/calendars/${calendarId}/google/link`, {
|
|
4296
4401
|
method: "POST",
|
|
4297
4402
|
body: JSON.stringify(request)
|
|
4298
4403
|
});
|
|
4299
4404
|
}
|
|
4405
|
+
/** Unlink a calendar from its connected Google Calendar. */
|
|
4300
4406
|
async unlinkCalendarFromGoogle(wid, calendarId) {
|
|
4301
4407
|
return this.fetch(`w/${wid}/calendars/${calendarId}/google/link`, {
|
|
4302
4408
|
method: "DELETE"
|
|
4303
4409
|
});
|
|
4304
4410
|
}
|
|
4411
|
+
/** Trigger a manual sync between a calendar and its linked Google Calendar. */
|
|
4305
4412
|
async syncCalendarWithGoogle(wid, calendarId) {
|
|
4306
4413
|
return this.fetch(`w/${wid}/calendars/${calendarId}/google/sync`, {
|
|
4307
4414
|
method: "POST"
|
|
@@ -4309,15 +4416,18 @@ var CalendarsApi = class extends BaseApiClient {
|
|
|
4309
4416
|
}
|
|
4310
4417
|
};
|
|
4311
4418
|
var CallsApi = class extends BaseApiClient {
|
|
4419
|
+
/** Initiate a new outbound call. */
|
|
4312
4420
|
async initiateCall(wid, request) {
|
|
4313
4421
|
return this.fetch(`w/${wid}/call`, {
|
|
4314
4422
|
method: "POST",
|
|
4315
4423
|
body: JSON.stringify(request)
|
|
4316
4424
|
});
|
|
4317
4425
|
}
|
|
4426
|
+
/** Get a voice authentication token for real-time audio. */
|
|
4318
4427
|
async getVoiceToken(wid) {
|
|
4319
4428
|
return this.fetch(`w/${wid}/voice/token`);
|
|
4320
4429
|
}
|
|
4430
|
+
/** Get message timing data for a chat recording. */
|
|
4321
4431
|
async getMessageTiming(wid, chatId) {
|
|
4322
4432
|
return this.fetch(`w/${wid}/recordings/chat/${chatId}/message-timing`);
|
|
4323
4433
|
}
|
|
@@ -4355,6 +4465,7 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4355
4465
|
}
|
|
4356
4466
|
return params;
|
|
4357
4467
|
}
|
|
4468
|
+
/** List chats with optional filtering, sorting, and pagination. */
|
|
4358
4469
|
async getChats(wid, options = {}) {
|
|
4359
4470
|
const params = this.buildChatsQueryParams(options, true);
|
|
4360
4471
|
const queryString = params.toString();
|
|
@@ -4362,6 +4473,7 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4362
4473
|
`w/${wid}/chats${queryString ? `?${queryString}` : ""}`
|
|
4363
4474
|
);
|
|
4364
4475
|
}
|
|
4476
|
+
/** Export multiple chats as a downloadable blob. */
|
|
4365
4477
|
async exportChats(wid, options = {}) {
|
|
4366
4478
|
const params = this.buildChatsQueryParams(options, false);
|
|
4367
4479
|
const queryString = params.toString();
|
|
@@ -4370,27 +4482,34 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4370
4482
|
);
|
|
4371
4483
|
return response.blob();
|
|
4372
4484
|
}
|
|
4485
|
+
/** Export a single chat in the specified format as a downloadable blob. */
|
|
4373
4486
|
async exportChat(wid, chatId, format = "jsonl") {
|
|
4374
4487
|
const response = await this.fetchRaw(`w/${wid}/chats/${chatId}/export?format=${format}`);
|
|
4375
4488
|
return response.blob();
|
|
4376
4489
|
}
|
|
4490
|
+
/** Get a single chat by ID. */
|
|
4377
4491
|
async getChat(wid, id) {
|
|
4378
4492
|
return this.fetch(`w/${wid}/chats/${id}`);
|
|
4379
4493
|
}
|
|
4494
|
+
/** Get token usage statistics for a chat. */
|
|
4380
4495
|
async getChatTokenUsage(wid, chatId) {
|
|
4381
4496
|
return this.fetch(`w/${wid}/chats/${chatId}/token-usage`);
|
|
4382
4497
|
}
|
|
4498
|
+
/** Get todo items extracted from a chat. */
|
|
4383
4499
|
async getChatTodos(wid, chatId) {
|
|
4384
4500
|
return this.fetch(`w/${wid}/chats/${chatId}/todos`);
|
|
4385
4501
|
}
|
|
4502
|
+
/** Get loaded and revealed skills for a chat. */
|
|
4386
4503
|
async getChatSkills(wid, chatId) {
|
|
4387
4504
|
return this.fetch(
|
|
4388
4505
|
`w/${wid}/chats/${chatId}/skills`
|
|
4389
4506
|
);
|
|
4390
4507
|
}
|
|
4508
|
+
/** List chat IDs that need a response. */
|
|
4391
4509
|
async getChatsNeedsResponse(wid) {
|
|
4392
4510
|
return this.fetch(`w/${wid}/chats/needs-response`);
|
|
4393
4511
|
}
|
|
4512
|
+
/** Get daily chat creation statistics with optional filtering. */
|
|
4394
4513
|
async getChatsDailyCreationStats(wid, options) {
|
|
4395
4514
|
const params = new URLSearchParams();
|
|
4396
4515
|
if (options?.archived !== void 0) params.append("archived", options.archived.toString());
|
|
@@ -4400,40 +4519,47 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4400
4519
|
`w/${wid}/chats/stats/daily-creation${queryString ? `?${queryString}` : ""}`
|
|
4401
4520
|
);
|
|
4402
4521
|
}
|
|
4522
|
+
/** Archive a chat. */
|
|
4403
4523
|
async archiveChat(wid, id) {
|
|
4404
4524
|
return this.fetch(`w/${wid}/chats/${id}/archive`, {
|
|
4405
4525
|
method: "PUT"
|
|
4406
4526
|
});
|
|
4407
4527
|
}
|
|
4528
|
+
/** Unarchive a chat. */
|
|
4408
4529
|
async unarchiveChat(wid, id) {
|
|
4409
4530
|
return this.fetch(`w/${wid}/chats/${id}/unarchive`, {
|
|
4410
4531
|
method: "PUT"
|
|
4411
4532
|
});
|
|
4412
4533
|
}
|
|
4534
|
+
/** Create a new chat. */
|
|
4413
4535
|
async createChat(wid, chat) {
|
|
4414
4536
|
return this.fetch(`w/${wid}/chats`, {
|
|
4415
4537
|
method: "POST",
|
|
4416
4538
|
body: JSON.stringify(chat)
|
|
4417
4539
|
});
|
|
4418
4540
|
}
|
|
4541
|
+
/** Delete a chat, optionally providing a reason. */
|
|
4419
4542
|
async deleteChat(wid, id, reason) {
|
|
4420
4543
|
return this.fetch(`w/${wid}/chats/${id}`, {
|
|
4421
4544
|
method: "DELETE",
|
|
4422
4545
|
body: reason ? JSON.stringify({ reason }) : void 0
|
|
4423
4546
|
});
|
|
4424
4547
|
}
|
|
4548
|
+
/** Update a chat's properties. */
|
|
4425
4549
|
async updateChat(wid, id, chat) {
|
|
4426
4550
|
return this.fetch(`w/${wid}/chats/${id}`, {
|
|
4427
4551
|
method: "PUT",
|
|
4428
4552
|
body: JSON.stringify(chat)
|
|
4429
4553
|
});
|
|
4430
4554
|
}
|
|
4555
|
+
/** Update the mute status of a chat. */
|
|
4431
4556
|
async updateChatMute(wid, id, muted) {
|
|
4432
4557
|
return this.fetch(`w/${wid}/chats/${id}/mute`, {
|
|
4433
4558
|
method: "PUT",
|
|
4434
4559
|
body: JSON.stringify({ muted })
|
|
4435
4560
|
});
|
|
4436
4561
|
}
|
|
4562
|
+
/** Update the needs-response flag on a chat. */
|
|
4437
4563
|
async updateChatNeedsResponse(wid, id, needsResponse) {
|
|
4438
4564
|
return this.fetch(
|
|
4439
4565
|
`w/${wid}/chats/${id}/needs-response`,
|
|
@@ -4443,6 +4569,7 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4443
4569
|
}
|
|
4444
4570
|
);
|
|
4445
4571
|
}
|
|
4572
|
+
/** Generate an AI summary for a chat, optionally updating its labels. */
|
|
4446
4573
|
async summarizeChat(wid, id, updateLabels) {
|
|
4447
4574
|
const params = new URLSearchParams();
|
|
4448
4575
|
if (updateLabels !== void 0) {
|
|
@@ -4455,6 +4582,7 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4455
4582
|
}
|
|
4456
4583
|
);
|
|
4457
4584
|
}
|
|
4585
|
+
/** List messages in a chat with optional pagination. */
|
|
4458
4586
|
async getChatMessages(wid, id, limit, offset) {
|
|
4459
4587
|
const params = new URLSearchParams();
|
|
4460
4588
|
if (limit) params.append("limit", limit.toString());
|
|
@@ -4463,6 +4591,7 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4463
4591
|
`w/${wid}/chats/${id}/messages${params.toString() ? `?${params.toString()}` : ""}`
|
|
4464
4592
|
);
|
|
4465
4593
|
}
|
|
4594
|
+
/** List messages associated with a specific tool call in a chat. */
|
|
4466
4595
|
async getChatToolCallMessages(wid, chatId, callId, limit = 100, offset = 0) {
|
|
4467
4596
|
const params = new URLSearchParams();
|
|
4468
4597
|
params.append("limit", limit.toString());
|
|
@@ -4471,15 +4600,18 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4471
4600
|
`w/${wid}/chats/${chatId}/tool-calls/${callId}/messages?${params.toString()}`
|
|
4472
4601
|
);
|
|
4473
4602
|
}
|
|
4603
|
+
/** Get the tools available in a chat. */
|
|
4474
4604
|
async getChatTools(wid, chatId) {
|
|
4475
4605
|
return this.fetch(`w/${wid}/chats/${chatId}/tools`);
|
|
4476
4606
|
}
|
|
4607
|
+
/** Initiate an outbound phone call from a chat. */
|
|
4477
4608
|
async initiateOutboundCall(wid, chatId, phoneNumberId) {
|
|
4478
4609
|
return this.fetch(`w/${wid}/chats/${chatId}/outbound-call`, {
|
|
4479
4610
|
method: "POST",
|
|
4480
4611
|
body: JSON.stringify({ phoneNumberId, chatId })
|
|
4481
4612
|
});
|
|
4482
4613
|
}
|
|
4614
|
+
/** Send a message as the assistant in a chat, optionally including tool calls. */
|
|
4483
4615
|
async sendAssistantMessage(wid, chatId, message, toolCalls) {
|
|
4484
4616
|
return this.fetch(`w/${wid}/chats/${chatId}/send-assistant-message`, {
|
|
4485
4617
|
method: "POST",
|
|
@@ -4489,6 +4621,7 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4489
4621
|
})
|
|
4490
4622
|
});
|
|
4491
4623
|
}
|
|
4624
|
+
/** Rate a chat message by its UUID. */
|
|
4492
4625
|
async rateMessage(wid, chatId, messageUuid, rating) {
|
|
4493
4626
|
return this.fetch(
|
|
4494
4627
|
`w/${wid}/chats/${chatId}/messages/${messageUuid}/rate`,
|
|
@@ -4517,10 +4650,11 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4517
4650
|
body: JSON.stringify({ content })
|
|
4518
4651
|
});
|
|
4519
4652
|
}
|
|
4653
|
+
/** Get assignment tasks linked to a chat. */
|
|
4520
4654
|
async getChatAssignmentTasks(wid, chatId) {
|
|
4521
4655
|
return this.fetch(`w/${wid}/chats/${chatId}/assignment-tasks`);
|
|
4522
4656
|
}
|
|
4523
|
-
|
|
4657
|
+
/** Create a chat completion using the OpenAI-compatible API (used by eval scripts). */
|
|
4524
4658
|
async createChatCompletion(wid, chatId, data) {
|
|
4525
4659
|
return this.fetch(`w/${wid}/web-chat/${chatId}/chat/completions?stream=false`, {
|
|
4526
4660
|
method: "POST",
|
|
@@ -4530,55 +4664,65 @@ var ChatsApi = class extends BaseApiClient {
|
|
|
4530
4664
|
})
|
|
4531
4665
|
});
|
|
4532
4666
|
}
|
|
4533
|
-
|
|
4667
|
+
/** List all chat labels in a workspace. */
|
|
4534
4668
|
async getChatLabels(wid) {
|
|
4535
4669
|
return this.fetch(`w/${wid}/chat-labels`);
|
|
4536
4670
|
}
|
|
4671
|
+
/** Get a chat label by ID. */
|
|
4537
4672
|
async getChatLabel(wid, id) {
|
|
4538
4673
|
return this.fetch(`w/${wid}/chat-labels/${id}`);
|
|
4539
4674
|
}
|
|
4675
|
+
/** Get a chat label by UUID. */
|
|
4540
4676
|
async getChatLabelByUuid(wid, uuid) {
|
|
4541
4677
|
return this.fetch(`w/${wid}/chat-labels/${uuid}`);
|
|
4542
4678
|
}
|
|
4679
|
+
/** Create a new chat label. */
|
|
4543
4680
|
async createChatLabel(wid, label) {
|
|
4544
4681
|
return this.fetch(`w/${wid}/chat-labels`, {
|
|
4545
4682
|
method: "POST",
|
|
4546
4683
|
body: JSON.stringify(label)
|
|
4547
4684
|
});
|
|
4548
4685
|
}
|
|
4686
|
+
/** Update a chat label. */
|
|
4549
4687
|
async updateChatLabel(wid, id, label) {
|
|
4550
4688
|
return this.fetch(`w/${wid}/chat-labels/${id}`, {
|
|
4551
4689
|
method: "PUT",
|
|
4552
4690
|
body: JSON.stringify(label)
|
|
4553
4691
|
});
|
|
4554
4692
|
}
|
|
4693
|
+
/** Delete a chat label. */
|
|
4555
4694
|
async deleteChatLabel(wid, id) {
|
|
4556
4695
|
return this.fetch(`w/${wid}/chat-labels/${id}`, {
|
|
4557
4696
|
method: "DELETE"
|
|
4558
4697
|
});
|
|
4559
4698
|
}
|
|
4560
|
-
|
|
4699
|
+
/** List all chat filters in a workspace. */
|
|
4561
4700
|
async getChatFilters(wid) {
|
|
4562
4701
|
return this.fetch(`w/${wid}/chat-filters`);
|
|
4563
4702
|
}
|
|
4703
|
+
/** Get a chat filter by ID. */
|
|
4564
4704
|
async getChatFilter(wid, id) {
|
|
4565
4705
|
return this.fetch(`w/${wid}/chat-filters/${id}`);
|
|
4566
4706
|
}
|
|
4707
|
+
/** Get a chat filter by UUID. */
|
|
4567
4708
|
async getChatFilterByUuid(wid, uuid) {
|
|
4568
4709
|
return this.fetch(`w/${wid}/chat-filters/by-uuid/${uuid}`);
|
|
4569
4710
|
}
|
|
4711
|
+
/** Create a new chat filter. */
|
|
4570
4712
|
async createChatFilter(wid, filter) {
|
|
4571
4713
|
return this.fetch(`w/${wid}/chat-filters`, {
|
|
4572
4714
|
method: "POST",
|
|
4573
4715
|
body: JSON.stringify(filter)
|
|
4574
4716
|
});
|
|
4575
4717
|
}
|
|
4718
|
+
/** Update a chat filter. */
|
|
4576
4719
|
async updateChatFilter(wid, id, filter) {
|
|
4577
4720
|
return this.fetch(`w/${wid}/chat-filters/${id}`, {
|
|
4578
4721
|
method: "PUT",
|
|
4579
4722
|
body: JSON.stringify(filter)
|
|
4580
4723
|
});
|
|
4581
4724
|
}
|
|
4725
|
+
/** Delete a chat filter. */
|
|
4582
4726
|
async deleteChatFilter(wid, id) {
|
|
4583
4727
|
return this.fetch(`w/${wid}/chat-filters/${id}`, {
|
|
4584
4728
|
method: "DELETE"
|
|
@@ -4671,6 +4815,7 @@ var CustomToolkitsApi = class extends BaseApiClient {
|
|
|
4671
4815
|
}
|
|
4672
4816
|
};
|
|
4673
4817
|
var DataTypesApi = class extends BaseApiClient {
|
|
4818
|
+
/** List all data types for a workspace, optionally filtering by archived status. */
|
|
4674
4819
|
async getDataTypes(wid, options) {
|
|
4675
4820
|
const params = new URLSearchParams();
|
|
4676
4821
|
if (options?.archived !== void 0) {
|
|
@@ -4679,45 +4824,54 @@ var DataTypesApi = class extends BaseApiClient {
|
|
|
4679
4824
|
const queryString = params.toString();
|
|
4680
4825
|
return this.fetch(`w/${wid}/data-types${queryString ? `?${queryString}` : ""}`);
|
|
4681
4826
|
}
|
|
4827
|
+
/** Get a single data type by ID. */
|
|
4682
4828
|
async getDataType(wid, id) {
|
|
4683
4829
|
return this.fetch(`w/${wid}/data-types/${id}`);
|
|
4684
4830
|
}
|
|
4831
|
+
/** Get a single data type by its slug. */
|
|
4685
4832
|
async getDataTypeBySlug(wid, slug) {
|
|
4686
4833
|
return this.fetch(`w/${wid}/data-types/slug/${slug}`);
|
|
4687
4834
|
}
|
|
4835
|
+
/** Create a new data type definition in the workspace. */
|
|
4688
4836
|
async createDataType(wid, dataType) {
|
|
4689
4837
|
return this.fetch(`w/${wid}/data-types`, {
|
|
4690
4838
|
method: "POST",
|
|
4691
4839
|
body: JSON.stringify(dataType)
|
|
4692
4840
|
});
|
|
4693
4841
|
}
|
|
4842
|
+
/** Update an existing data type definition. */
|
|
4694
4843
|
async updateDataType(wid, id, dataType) {
|
|
4695
4844
|
return this.fetch(`w/${wid}/data-types/${id}`, {
|
|
4696
4845
|
method: "PUT",
|
|
4697
4846
|
body: JSON.stringify(dataType)
|
|
4698
4847
|
});
|
|
4699
4848
|
}
|
|
4849
|
+
/** Delete a data type definition by ID. */
|
|
4700
4850
|
async deleteDataType(wid, id) {
|
|
4701
4851
|
return this.fetch(`w/${wid}/data-types/${id}`, {
|
|
4702
4852
|
method: "DELETE"
|
|
4703
4853
|
});
|
|
4704
4854
|
}
|
|
4855
|
+
/** Archive a data type, hiding it from default listings. */
|
|
4705
4856
|
async archiveDataType(wid, id) {
|
|
4706
4857
|
return this.fetch(`w/${wid}/data-types/${id}/archive`, {
|
|
4707
4858
|
method: "POST"
|
|
4708
4859
|
});
|
|
4709
4860
|
}
|
|
4861
|
+
/** Restore an archived data type back to active status. */
|
|
4710
4862
|
async unarchiveDataType(wid, id) {
|
|
4711
4863
|
return this.fetch(`w/${wid}/data-types/${id}/unarchive`, {
|
|
4712
4864
|
method: "POST"
|
|
4713
4865
|
});
|
|
4714
4866
|
}
|
|
4867
|
+
/** Clone a data type with a new name and slug. */
|
|
4715
4868
|
async cloneDataType(wid, id, data) {
|
|
4716
4869
|
return this.fetch(`w/${wid}/data-types/${id}/clone`, {
|
|
4717
4870
|
method: "POST",
|
|
4718
4871
|
body: JSON.stringify(data)
|
|
4719
4872
|
});
|
|
4720
4873
|
}
|
|
4874
|
+
/** List data records for a data type with optional filtering and pagination. */
|
|
4721
4875
|
async getDataRecords(wid, dataTypeId, options) {
|
|
4722
4876
|
const params = new URLSearchParams();
|
|
4723
4877
|
if (options?.memberId) params.append("member_id", options.memberId.toString());
|
|
@@ -4729,32 +4883,37 @@ var DataTypesApi = class extends BaseApiClient {
|
|
|
4729
4883
|
`w/${wid}/data-types/${dataTypeId}/records${params?.toString() ? `?${params.toString()}` : ""}`
|
|
4730
4884
|
);
|
|
4731
4885
|
}
|
|
4886
|
+
/** Get a single data record by ID. */
|
|
4732
4887
|
async getDataRecord(wid, recordId) {
|
|
4733
4888
|
return this.fetch(`w/${wid}/data-types/records/${recordId}`);
|
|
4734
4889
|
}
|
|
4890
|
+
/** Create a new data record under the specified data type. */
|
|
4735
4891
|
async createDataRecord(wid, dataTypeId, record) {
|
|
4736
4892
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/records`, {
|
|
4737
4893
|
method: "POST",
|
|
4738
4894
|
body: JSON.stringify(record)
|
|
4739
4895
|
});
|
|
4740
4896
|
}
|
|
4897
|
+
/** Update an existing data record's field values. */
|
|
4741
4898
|
async updateDataRecord(wid, dataTypeId, recordId, record) {
|
|
4742
4899
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/records/${recordId}`, {
|
|
4743
4900
|
method: "PUT",
|
|
4744
4901
|
body: JSON.stringify(record)
|
|
4745
4902
|
});
|
|
4746
4903
|
}
|
|
4904
|
+
/** Delete a data record by ID. */
|
|
4747
4905
|
async deleteDataRecord(wid, dataTypeId, recordId) {
|
|
4748
4906
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/records/${recordId}`, {
|
|
4749
4907
|
method: "DELETE"
|
|
4750
4908
|
});
|
|
4751
4909
|
}
|
|
4910
|
+
/** Get the change history for a data record. */
|
|
4752
4911
|
async getDataRecordChanges(wid, dataTypeId, recordId) {
|
|
4753
4912
|
return this.fetch(
|
|
4754
4913
|
`w/${wid}/data-types/${dataTypeId}/records/${recordId}/changes`
|
|
4755
4914
|
);
|
|
4756
4915
|
}
|
|
4757
|
-
|
|
4916
|
+
/** Upsert a data record by external ID, creating or updating as needed. */
|
|
4758
4917
|
async upsertDataRecord(wid, dataTypeId, externalId, data) {
|
|
4759
4918
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/upsert/${externalId}`, {
|
|
4760
4919
|
method: "POST",
|
|
@@ -4764,14 +4923,14 @@ var DataTypesApi = class extends BaseApiClient {
|
|
|
4764
4923
|
})
|
|
4765
4924
|
});
|
|
4766
4925
|
}
|
|
4767
|
-
|
|
4926
|
+
/** Toggle search indexing for a data type field. */
|
|
4768
4927
|
async toggleFieldIndex(wid, dataTypeId, fieldSlug, shouldIndex) {
|
|
4769
4928
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/fields/${fieldSlug}/toggle-index`, {
|
|
4770
4929
|
method: "POST",
|
|
4771
4930
|
body: JSON.stringify({ shouldIndex })
|
|
4772
4931
|
});
|
|
4773
4932
|
}
|
|
4774
|
-
|
|
4933
|
+
/** Get the index status for a data type field. */
|
|
4775
4934
|
async getFieldIndexStatus(wid, dataTypeId, fieldSlug) {
|
|
4776
4935
|
return this.fetch(`w/${wid}/data-types/${dataTypeId}/fields/${fieldSlug}/index-status`);
|
|
4777
4936
|
}
|
|
@@ -4996,13 +5155,15 @@ var SlackAppsApi = class extends BaseApiClient {
|
|
|
4996
5155
|
}
|
|
4997
5156
|
};
|
|
4998
5157
|
var EventsApi = class extends BaseApiClient {
|
|
4999
|
-
|
|
5158
|
+
/** List all event rules in the workspace. */
|
|
5000
5159
|
async getEventRules(wid) {
|
|
5001
5160
|
return this.fetch(`w/${wid}/event-rules`);
|
|
5002
5161
|
}
|
|
5162
|
+
/** Get the available action types that can be used in event rules. */
|
|
5003
5163
|
async getAvailableActions(wid) {
|
|
5004
5164
|
return this.fetch(`w/${wid}/event-rules/actions/available`);
|
|
5005
5165
|
}
|
|
5166
|
+
/** Search event rules by object type, event type, action type, and related entities. */
|
|
5006
5167
|
async searchEventRules(wid, params) {
|
|
5007
5168
|
const searchParams = new URLSearchParams();
|
|
5008
5169
|
if (params.objectType) searchParams.append("objectType", params.objectType);
|
|
@@ -5016,33 +5177,38 @@ var EventsApi = class extends BaseApiClient {
|
|
|
5016
5177
|
if (params.includeDisabled) searchParams.append("includeDisabled", "true");
|
|
5017
5178
|
return this.fetch(`w/${wid}/event-rules/search?${searchParams.toString()}`);
|
|
5018
5179
|
}
|
|
5180
|
+
/** Get a single event rule by ID. */
|
|
5019
5181
|
async getEventRule(wid, id) {
|
|
5020
5182
|
return this.fetch(`w/${wid}/event-rules/${id}`);
|
|
5021
5183
|
}
|
|
5184
|
+
/** Create a new event rule in the workspace. */
|
|
5022
5185
|
async createEventRule(wid, rule) {
|
|
5023
5186
|
return this.fetch(`w/${wid}/event-rules`, {
|
|
5024
5187
|
method: "POST",
|
|
5025
5188
|
body: JSON.stringify(rule)
|
|
5026
5189
|
});
|
|
5027
5190
|
}
|
|
5191
|
+
/** Update an existing event rule. */
|
|
5028
5192
|
async updateEventRule(wid, id, rule) {
|
|
5029
5193
|
return this.fetch(`w/${wid}/event-rules/${id}`, {
|
|
5030
5194
|
method: "PUT",
|
|
5031
5195
|
body: JSON.stringify(rule)
|
|
5032
5196
|
});
|
|
5033
5197
|
}
|
|
5198
|
+
/** Delete an event rule by ID. */
|
|
5034
5199
|
async deleteEventRule(wid, id) {
|
|
5035
5200
|
return this.fetch(`w/${wid}/event-rules/${id}`, {
|
|
5036
5201
|
method: "DELETE"
|
|
5037
5202
|
});
|
|
5038
5203
|
}
|
|
5204
|
+
/** Reorder event rules by specifying the desired rule ID sequence. */
|
|
5039
5205
|
async reorderEventRules(wid, ruleIds) {
|
|
5040
5206
|
return this.fetch(`w/${wid}/event-rules/reorder`, {
|
|
5041
5207
|
method: "POST",
|
|
5042
5208
|
body: JSON.stringify(ruleIds)
|
|
5043
5209
|
});
|
|
5044
5210
|
}
|
|
5045
|
-
|
|
5211
|
+
/** List webhook logs with optional filtering by event type and success status. */
|
|
5046
5212
|
async getWebhookLogs(wid, options = {}) {
|
|
5047
5213
|
const params = new URLSearchParams();
|
|
5048
5214
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -5055,6 +5221,7 @@ var EventsApi = class extends BaseApiClient {
|
|
|
5055
5221
|
`w/${wid}/webhook-logs${params.toString() ? `?${params.toString()}` : ""}`
|
|
5056
5222
|
);
|
|
5057
5223
|
}
|
|
5224
|
+
/** List event rule executions with cursor-based pagination and filtering. */
|
|
5058
5225
|
async getRuleExecutions(wid, options = {}) {
|
|
5059
5226
|
const params = new URLSearchParams();
|
|
5060
5227
|
if (options.cursor) params.append("cursor", options.cursor);
|
|
@@ -5073,7 +5240,7 @@ var EventsApi = class extends BaseApiClient {
|
|
|
5073
5240
|
`w/${wid}/event-rules/executions${params.toString() ? `?${params.toString()}` : ""}`
|
|
5074
5241
|
);
|
|
5075
5242
|
}
|
|
5076
|
-
|
|
5243
|
+
/** List scheduled events with optional pagination and active status filtering. */
|
|
5077
5244
|
async getEvents(wid, options = {}) {
|
|
5078
5245
|
const params = new URLSearchParams();
|
|
5079
5246
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -5085,26 +5252,31 @@ var EventsApi = class extends BaseApiClient {
|
|
|
5085
5252
|
`w/${wid}/events${params.toString() ? `?${params.toString()}` : ""}`
|
|
5086
5253
|
);
|
|
5087
5254
|
}
|
|
5255
|
+
/** Get a single scheduled event by ID. */
|
|
5088
5256
|
async getEvent(wid, id) {
|
|
5089
5257
|
return this.fetch(`w/${wid}/events/${id}`);
|
|
5090
5258
|
}
|
|
5259
|
+
/** Create a new scheduled event. */
|
|
5091
5260
|
async createEvent(wid, event) {
|
|
5092
5261
|
return this.fetch(`w/${wid}/events`, {
|
|
5093
5262
|
method: "POST",
|
|
5094
5263
|
body: JSON.stringify(event)
|
|
5095
5264
|
});
|
|
5096
5265
|
}
|
|
5266
|
+
/** Update an existing scheduled event. */
|
|
5097
5267
|
async updateEvent(wid, id, event) {
|
|
5098
5268
|
return this.fetch(`w/${wid}/events/${id}`, {
|
|
5099
5269
|
method: "PUT",
|
|
5100
5270
|
body: JSON.stringify(event)
|
|
5101
5271
|
});
|
|
5102
5272
|
}
|
|
5273
|
+
/** Delete a scheduled event by ID. */
|
|
5103
5274
|
async deleteEvent(wid, id) {
|
|
5104
5275
|
return this.fetch(`w/${wid}/events/${id}`, {
|
|
5105
5276
|
method: "DELETE"
|
|
5106
5277
|
});
|
|
5107
5278
|
}
|
|
5279
|
+
/** Manually trigger a scheduled event for a specific member or member filter. */
|
|
5108
5280
|
async runEvent(wid, id, params) {
|
|
5109
5281
|
const searchParams = new URLSearchParams();
|
|
5110
5282
|
if (params.memberId) searchParams.append("member_id", params.memberId.toString());
|
|
@@ -5114,6 +5286,7 @@ var EventsApi = class extends BaseApiClient {
|
|
|
5114
5286
|
method: "POST"
|
|
5115
5287
|
});
|
|
5116
5288
|
}
|
|
5289
|
+
/** List event run history with optional filtering by event and status. */
|
|
5117
5290
|
async getEventRuns(wid, options = {}) {
|
|
5118
5291
|
const params = new URLSearchParams();
|
|
5119
5292
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -5124,6 +5297,7 @@ var EventsApi = class extends BaseApiClient {
|
|
|
5124
5297
|
if (options.status) params.append("status", options.status);
|
|
5125
5298
|
return this.fetch(`w/${wid}/events/runs?${params.toString()}`);
|
|
5126
5299
|
}
|
|
5300
|
+
/** Delete all run history for a scheduled event. */
|
|
5127
5301
|
async resetEventRuns(wid, eventId) {
|
|
5128
5302
|
return this.fetch(`w/${wid}/events/${eventId}/runs`, {
|
|
5129
5303
|
method: "DELETE"
|
|
@@ -5132,24 +5306,13 @@ var EventsApi = class extends BaseApiClient {
|
|
|
5132
5306
|
};
|
|
5133
5307
|
var FeaturesApi = class extends BaseApiClient {
|
|
5134
5308
|
/**
|
|
5135
|
-
* Get the full feature registry with all metadata
|
|
5136
|
-
*
|
|
5137
|
-
* Returns all feature definitions including:
|
|
5138
|
-
* - Dependencies between features
|
|
5139
|
-
* - Visibility settings for upgrade prompts
|
|
5140
|
-
* - Associated abilities, tools, routes, and event types
|
|
5141
|
-
* - UI configuration (icons, sidebar groups)
|
|
5142
|
-
*
|
|
5143
|
-
* @returns Feature registry response with all feature definitions
|
|
5309
|
+
* Get the full feature registry with all metadata
|
|
5144
5310
|
*/
|
|
5145
5311
|
async getFeatureRegistry() {
|
|
5146
5312
|
return this.fetch("features/registry");
|
|
5147
5313
|
}
|
|
5148
5314
|
/**
|
|
5149
|
-
* Get a specific feature definition by slug
|
|
5150
|
-
*
|
|
5151
|
-
* @param slug - The feature slug (e.g., "calendar", "gmail")
|
|
5152
|
-
* @returns The full feature definition
|
|
5315
|
+
* Get a specific feature definition by slug
|
|
5153
5316
|
*/
|
|
5154
5317
|
async getFeatureBySlug(slug) {
|
|
5155
5318
|
return this.fetch(`features/${slug}`);
|
|
@@ -5289,6 +5452,7 @@ var FhirConnectionsApi = class extends BaseApiClient {
|
|
|
5289
5452
|
}
|
|
5290
5453
|
};
|
|
5291
5454
|
var FilesApi = class extends BaseApiClient {
|
|
5455
|
+
/** List files in a workspace with optional folder filtering, sorting, and search. */
|
|
5292
5456
|
async getFiles(wid, options = {}) {
|
|
5293
5457
|
const params = new URLSearchParams();
|
|
5294
5458
|
if (options.folderId) params.append("folder_id", options.folderId.toString());
|
|
@@ -5301,9 +5465,11 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5301
5465
|
`w/${wid}/files${params.toString() ? `?${params.toString()}` : ""}`
|
|
5302
5466
|
);
|
|
5303
5467
|
}
|
|
5468
|
+
/** Get a single file by ID. */
|
|
5304
5469
|
async getFile(wid, id) {
|
|
5305
5470
|
return this.fetch(`w/${wid}/files/${id}`);
|
|
5306
5471
|
}
|
|
5472
|
+
/** Create a new file record in the workspace. */
|
|
5307
5473
|
async createFile(wid, file) {
|
|
5308
5474
|
return this.fetch(`w/${wid}/files`, {
|
|
5309
5475
|
method: "POST",
|
|
@@ -5311,6 +5477,7 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5311
5477
|
body: JSON.stringify(file)
|
|
5312
5478
|
});
|
|
5313
5479
|
}
|
|
5480
|
+
/** Update an existing file's metadata. */
|
|
5314
5481
|
async updateFile(wid, id, file) {
|
|
5315
5482
|
return this.fetch(`w/${wid}/files/${id}`, {
|
|
5316
5483
|
method: "PUT",
|
|
@@ -5318,11 +5485,13 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5318
5485
|
body: JSON.stringify(file)
|
|
5319
5486
|
});
|
|
5320
5487
|
}
|
|
5488
|
+
/** Delete a file by ID. */
|
|
5321
5489
|
async deleteFile(wid, id) {
|
|
5322
5490
|
return this.fetch(`w/${wid}/files/${id}`, {
|
|
5323
5491
|
method: "DELETE"
|
|
5324
5492
|
});
|
|
5325
5493
|
}
|
|
5494
|
+
/** Convert a file to the specified format (text, markdown, or PDF). */
|
|
5326
5495
|
async convertFile(wid, fileId, format = "pdf") {
|
|
5327
5496
|
return this.fetch(
|
|
5328
5497
|
`w/${wid}/files/${fileId}/convert?format=${format}`,
|
|
@@ -5331,6 +5500,7 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5331
5500
|
}
|
|
5332
5501
|
);
|
|
5333
5502
|
}
|
|
5503
|
+
/** Generate a pre-signed upload URL for uploading file content. */
|
|
5334
5504
|
async generateFileUploadUrl(wid, request) {
|
|
5335
5505
|
return this.fetch(`w/${wid}/files/upload-url`, {
|
|
5336
5506
|
method: "POST",
|
|
@@ -5338,7 +5508,7 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5338
5508
|
body: JSON.stringify(request)
|
|
5339
5509
|
});
|
|
5340
5510
|
}
|
|
5341
|
-
|
|
5511
|
+
/** List folders in a workspace, optionally filtered by parent folder. */
|
|
5342
5512
|
async getFolders(wid, parentId) {
|
|
5343
5513
|
const params = new URLSearchParams();
|
|
5344
5514
|
if (parentId) params.append("parent_id", parentId.toString());
|
|
@@ -5346,31 +5516,37 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5346
5516
|
`w/${wid}/folders${params.toString() ? `?${params.toString()}` : ""}`
|
|
5347
5517
|
);
|
|
5348
5518
|
}
|
|
5519
|
+
/** Get a single folder by ID. */
|
|
5349
5520
|
async getFolder(wid, id) {
|
|
5350
5521
|
return this.fetch(`w/${wid}/folders/${id}`);
|
|
5351
5522
|
}
|
|
5523
|
+
/** Create a new folder in the workspace. */
|
|
5352
5524
|
async createFolder(wid, directory) {
|
|
5353
5525
|
return this.fetch(`w/${wid}/folders`, {
|
|
5354
5526
|
method: "POST",
|
|
5355
5527
|
body: JSON.stringify(directory)
|
|
5356
5528
|
});
|
|
5357
5529
|
}
|
|
5530
|
+
/** Update a folder's properties. */
|
|
5358
5531
|
async updateFolder(wid, id, directory) {
|
|
5359
5532
|
return this.fetch(`w/${wid}/folders/${id}`, {
|
|
5360
5533
|
method: "PUT",
|
|
5361
5534
|
body: JSON.stringify(directory)
|
|
5362
5535
|
});
|
|
5363
5536
|
}
|
|
5537
|
+
/** Delete a folder by ID. */
|
|
5364
5538
|
async deleteFolder(wid, id) {
|
|
5365
5539
|
return this.fetch(`w/${wid}/folders/${id}`, {
|
|
5366
5540
|
method: "DELETE"
|
|
5367
5541
|
});
|
|
5368
5542
|
}
|
|
5543
|
+
/** Trigger reindexing of a folder's contents for search. */
|
|
5369
5544
|
async reindexFolder(wid, id) {
|
|
5370
5545
|
return this.fetch(`w/${wid}/folders/${id}/reindex`, {
|
|
5371
5546
|
method: "POST"
|
|
5372
5547
|
});
|
|
5373
5548
|
}
|
|
5549
|
+
/** Search for content within a folder using semantic search. */
|
|
5374
5550
|
async searchFolder(wid, id, params) {
|
|
5375
5551
|
const searchParams = new URLSearchParams();
|
|
5376
5552
|
searchParams.append("query", params.query);
|
|
@@ -5379,52 +5555,60 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5379
5555
|
`w/${wid}/folders/${id}/search?${searchParams.toString()}`
|
|
5380
5556
|
);
|
|
5381
5557
|
}
|
|
5382
|
-
|
|
5558
|
+
/** List all file labels in the workspace. */
|
|
5383
5559
|
async getFileLabels(wid) {
|
|
5384
5560
|
return this.fetch(`w/${wid}/file-labels`);
|
|
5385
5561
|
}
|
|
5562
|
+
/** Get a single file label by ID. */
|
|
5386
5563
|
async getFileLabel(wid, id) {
|
|
5387
5564
|
return this.fetch(`w/${wid}/file-labels/${id}`);
|
|
5388
5565
|
}
|
|
5566
|
+
/** Get a single file label by UUID. */
|
|
5389
5567
|
async getFileLabelByUuid(wid, uuid) {
|
|
5390
5568
|
return this.fetch(`w/${wid}/file-labels/${uuid}`);
|
|
5391
5569
|
}
|
|
5570
|
+
/** Create a new file label in the workspace. */
|
|
5392
5571
|
async createFileLabel(wid, label) {
|
|
5393
5572
|
return this.fetch(`w/${wid}/file-labels`, {
|
|
5394
5573
|
method: "POST",
|
|
5395
5574
|
body: JSON.stringify(label)
|
|
5396
5575
|
});
|
|
5397
5576
|
}
|
|
5577
|
+
/** Update a file label's properties. */
|
|
5398
5578
|
async updateFileLabel(wid, id, label) {
|
|
5399
5579
|
return this.fetch(`w/${wid}/file-labels/${id}`, {
|
|
5400
5580
|
method: "PUT",
|
|
5401
5581
|
body: JSON.stringify(label)
|
|
5402
5582
|
});
|
|
5403
5583
|
}
|
|
5584
|
+
/** Delete a file label by ID. */
|
|
5404
5585
|
async deleteFileLabel(wid, id) {
|
|
5405
5586
|
return this.fetch(`w/${wid}/file-labels/${id}`, {
|
|
5406
5587
|
method: "DELETE"
|
|
5407
5588
|
});
|
|
5408
5589
|
}
|
|
5409
|
-
|
|
5590
|
+
/** Get sharing settings for a file. */
|
|
5410
5591
|
async getFileSharing(wid, fileId) {
|
|
5411
5592
|
return this.fetch(`w/${wid}/files/${fileId}/sharing`);
|
|
5412
5593
|
}
|
|
5594
|
+
/** Update the role associations for a file's sharing permissions. */
|
|
5413
5595
|
async updateFileRoles(wid, fileId, data) {
|
|
5414
5596
|
return this.fetch(`w/${wid}/files/${fileId}/sharing/roles`, {
|
|
5415
5597
|
method: "PUT",
|
|
5416
5598
|
body: JSON.stringify(data)
|
|
5417
5599
|
});
|
|
5418
5600
|
}
|
|
5601
|
+
/** Remove a role's access to a file. */
|
|
5419
5602
|
async removeFileRole(wid, fileId, roleId) {
|
|
5420
5603
|
return this.fetch(`w/${wid}/files/${fileId}/sharing/roles/${roleId}`, {
|
|
5421
5604
|
method: "DELETE"
|
|
5422
5605
|
});
|
|
5423
5606
|
}
|
|
5424
|
-
|
|
5607
|
+
/** Get sharing settings for a folder. */
|
|
5425
5608
|
async getFolderSharing(wid, folderId) {
|
|
5426
5609
|
return this.fetch(`w/${wid}/folders/${folderId}/sharing`);
|
|
5427
5610
|
}
|
|
5611
|
+
/** Update the role associations for a folder's sharing permissions. */
|
|
5428
5612
|
async updateFolderRoles(wid, folderId, data) {
|
|
5429
5613
|
return this.fetch(
|
|
5430
5614
|
`w/${wid}/folders/${folderId}/sharing/roles`,
|
|
@@ -5434,33 +5618,37 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5434
5618
|
}
|
|
5435
5619
|
);
|
|
5436
5620
|
}
|
|
5621
|
+
/** Remove a role's access to a folder. */
|
|
5437
5622
|
async removeFolderRole(wid, folderId, roleId) {
|
|
5438
5623
|
return this.fetch(`w/${wid}/folders/${folderId}/sharing/roles/${roleId}`, {
|
|
5439
5624
|
method: "DELETE"
|
|
5440
5625
|
});
|
|
5441
5626
|
}
|
|
5442
|
-
|
|
5627
|
+
/** Update all sharing settings for a file in a single request. */
|
|
5443
5628
|
async updateFileSharing(wid, fileId, data) {
|
|
5444
5629
|
return this.fetch(`w/${wid}/files/${fileId}/sharing`, {
|
|
5445
5630
|
method: "PUT",
|
|
5446
5631
|
body: JSON.stringify(data)
|
|
5447
5632
|
});
|
|
5448
5633
|
}
|
|
5634
|
+
/** Update all sharing settings for a folder in a single request. */
|
|
5449
5635
|
async updateFolderSharing(wid, folderId, data) {
|
|
5450
5636
|
return this.fetch(`w/${wid}/folders/${folderId}/sharing`, {
|
|
5451
5637
|
method: "PUT",
|
|
5452
5638
|
body: JSON.stringify(data)
|
|
5453
5639
|
});
|
|
5454
5640
|
}
|
|
5455
|
-
|
|
5641
|
+
/** Get metadata for a publicly shared file (unauthenticated). */
|
|
5456
5642
|
async getPublicFile(wid, fileId) {
|
|
5457
5643
|
return this.fetch(`w/${wid}/sharing/files/${fileId}`);
|
|
5458
5644
|
}
|
|
5645
|
+
/** Get contents of a publicly shared folder (unauthenticated). */
|
|
5459
5646
|
async getPublicFolder(wid, folderId, page = 1, pageSize = 100) {
|
|
5460
5647
|
return this.fetch(
|
|
5461
5648
|
`w/${wid}/sharing/folders/${folderId}?page=${page}&pageSize=${pageSize}`
|
|
5462
5649
|
);
|
|
5463
5650
|
}
|
|
5651
|
+
/** List files within a publicly shared folder (unauthenticated). */
|
|
5464
5652
|
async getPublicFolderFiles(wid, folderId, page = 1, pageSize = 100) {
|
|
5465
5653
|
return this.fetch(
|
|
5466
5654
|
`w/${wid}/sharing/folders/${folderId}/files?page=${page}&pageSize=${pageSize}`
|
|
@@ -5468,29 +5656,35 @@ var FilesApi = class extends BaseApiClient {
|
|
|
5468
5656
|
}
|
|
5469
5657
|
};
|
|
5470
5658
|
var InboxesApi = class extends BaseApiClient {
|
|
5659
|
+
/** List all inboxes in a workspace. */
|
|
5471
5660
|
async getInboxes(wid) {
|
|
5472
5661
|
return this.fetch(`w/${wid}/inboxes`);
|
|
5473
5662
|
}
|
|
5663
|
+
/** Get an inbox by ID. */
|
|
5474
5664
|
async getInbox(wid, id) {
|
|
5475
5665
|
return this.fetch(`w/${wid}/inboxes/${id}`);
|
|
5476
5666
|
}
|
|
5667
|
+
/** Create a new inbox. */
|
|
5477
5668
|
async createInbox(wid, inbox) {
|
|
5478
5669
|
return this.fetch(`w/${wid}/inboxes`, {
|
|
5479
5670
|
method: "POST",
|
|
5480
5671
|
body: JSON.stringify(inbox)
|
|
5481
5672
|
});
|
|
5482
5673
|
}
|
|
5674
|
+
/** Update an inbox. */
|
|
5483
5675
|
async updateInbox(wid, id, inbox) {
|
|
5484
5676
|
return this.fetch(`w/${wid}/inboxes/${id}`, {
|
|
5485
5677
|
method: "PUT",
|
|
5486
5678
|
body: JSON.stringify(inbox)
|
|
5487
5679
|
});
|
|
5488
5680
|
}
|
|
5681
|
+
/** Delete an inbox. */
|
|
5489
5682
|
async deleteInbox(wid, id) {
|
|
5490
5683
|
return this.fetch(`w/${wid}/inboxes/${id}`, {
|
|
5491
5684
|
method: "DELETE"
|
|
5492
5685
|
});
|
|
5493
5686
|
}
|
|
5687
|
+
/** List emails in an inbox with optional pagination and attachment inclusion. */
|
|
5494
5688
|
async getInboxEmails(wid, inboxId, options = {}) {
|
|
5495
5689
|
const params = new URLSearchParams();
|
|
5496
5690
|
if (options.limit) params.append("limit", options.limit.toString());
|
|
@@ -5501,19 +5695,23 @@ var InboxesApi = class extends BaseApiClient {
|
|
|
5501
5695
|
`w/${wid}/inboxes/${inboxId}/emails${params.toString() ? `?${params.toString()}` : ""}`
|
|
5502
5696
|
);
|
|
5503
5697
|
}
|
|
5698
|
+
/** Get a single email from an inbox. */
|
|
5504
5699
|
async getInboxEmail(wid, inboxId, emailId) {
|
|
5505
5700
|
return this.fetch(`w/${wid}/inboxes/${inboxId}/emails/${emailId}`);
|
|
5506
5701
|
}
|
|
5702
|
+
/** Mark an email as read. */
|
|
5507
5703
|
async markEmailAsRead(wid, inboxId, emailId) {
|
|
5508
5704
|
return this.fetch(`w/${wid}/inboxes/${inboxId}/emails/${emailId}/mark-read`, {
|
|
5509
5705
|
method: "POST"
|
|
5510
5706
|
});
|
|
5511
5707
|
}
|
|
5708
|
+
/** Mark an email as unread. */
|
|
5512
5709
|
async markEmailAsUnread(wid, inboxId, emailId) {
|
|
5513
5710
|
return this.fetch(`w/${wid}/inboxes/${inboxId}/emails/${emailId}/unread`, {
|
|
5514
5711
|
method: "POST"
|
|
5515
5712
|
});
|
|
5516
5713
|
}
|
|
5714
|
+
/** Convert an email to text, markdown, or PDF format. */
|
|
5517
5715
|
async convertEmail(wid, emailId, format = "pdf") {
|
|
5518
5716
|
return this.fetch(
|
|
5519
5717
|
`w/${wid}/inboxes/emails/${emailId}/convert?format=${format}`,
|
|
@@ -5522,18 +5720,22 @@ var InboxesApi = class extends BaseApiClient {
|
|
|
5522
5720
|
}
|
|
5523
5721
|
);
|
|
5524
5722
|
}
|
|
5723
|
+
/** Download an email attachment as raw bytes. */
|
|
5525
5724
|
async downloadEmailAttachment(wid, inboxId, emailId, attachmentId) {
|
|
5526
5725
|
const response = await this.fetchRaw(
|
|
5527
5726
|
`w/${wid}/inboxes/${inboxId}/emails/${emailId}/attachments/${attachmentId}`
|
|
5528
5727
|
);
|
|
5529
5728
|
return response.arrayBuffer();
|
|
5530
5729
|
}
|
|
5730
|
+
/** List email threads in an inbox. */
|
|
5531
5731
|
async getInboxThreads(wid, inboxId) {
|
|
5532
5732
|
return this.fetch(`w/${wid}/inboxes/${inboxId}/threads`);
|
|
5533
5733
|
}
|
|
5734
|
+
/** List emails in a thread by assignment ID. */
|
|
5534
5735
|
async getThreadEmails(wid, inboxId, assignmentId) {
|
|
5535
5736
|
return this.fetch(`w/${wid}/inboxes/${inboxId}/assignments/${assignmentId}/emails`);
|
|
5536
5737
|
}
|
|
5738
|
+
/** List emails associated with a chat. */
|
|
5537
5739
|
async getChatEmails(wid, inboxId, chatId) {
|
|
5538
5740
|
return this.fetch(`w/${wid}/inboxes/${inboxId}/chats/${chatId}/emails`);
|
|
5539
5741
|
}
|
|
@@ -5584,9 +5786,7 @@ var InquiriesApi = class extends BaseApiClient {
|
|
|
5584
5786
|
});
|
|
5585
5787
|
}
|
|
5586
5788
|
/**
|
|
5587
|
-
* Export inquiries to CSV (superuser only)
|
|
5588
|
-
* @param statusFilter Optional status filter: 'new', 'in_progress', 'done', or undefined for all
|
|
5589
|
-
* @returns A Blob containing the CSV data
|
|
5789
|
+
* Export inquiries to CSV with optional status filtering (superuser only)
|
|
5590
5790
|
*/
|
|
5591
5791
|
async exportInquiriesCsv(statusFilter) {
|
|
5592
5792
|
const params = new URLSearchParams();
|
|
@@ -5773,6 +5973,7 @@ var McpServersApi = class extends BaseApiClient {
|
|
|
5773
5973
|
}
|
|
5774
5974
|
};
|
|
5775
5975
|
var MembersApi = class extends BaseApiClient {
|
|
5976
|
+
/** Get the currently authenticated member for a workspace. */
|
|
5776
5977
|
async getCurrentMember(wid) {
|
|
5777
5978
|
return this.fetch(`w/${wid}/me`);
|
|
5778
5979
|
}
|
|
@@ -5803,12 +6004,14 @@ var MembersApi = class extends BaseApiClient {
|
|
|
5803
6004
|
method: "DELETE"
|
|
5804
6005
|
});
|
|
5805
6006
|
}
|
|
6007
|
+
/** Update the currently authenticated member's profile. */
|
|
5806
6008
|
async updateCurrentMember(wid, member) {
|
|
5807
6009
|
return this.fetch(`w/${wid}/me`, {
|
|
5808
6010
|
method: "PUT",
|
|
5809
6011
|
body: JSON.stringify(member)
|
|
5810
6012
|
});
|
|
5811
6013
|
}
|
|
6014
|
+
/** List workspace members with pagination, filtering, and sorting. */
|
|
5812
6015
|
async getWorkspaceMembers(wid, page = 1, pageSize = 10, filters, search, role, sortBy, sortOrder, memberType, isArchived = false, isManager, memberTypes, hasAccount, excludeIds) {
|
|
5813
6016
|
const params = new URLSearchParams();
|
|
5814
6017
|
if (page) params.append("page", page.toString());
|
|
@@ -5841,21 +6044,25 @@ var MembersApi = class extends BaseApiClient {
|
|
|
5841
6044
|
}
|
|
5842
6045
|
return this.fetch(`w/${wid}/members?${params.toString()}`);
|
|
5843
6046
|
}
|
|
6047
|
+
/** Get a single workspace member by ID. */
|
|
5844
6048
|
async getWorkspaceMember(wid, memberId) {
|
|
5845
6049
|
return this.fetch(`w/${wid}/members/${memberId}`);
|
|
5846
6050
|
}
|
|
6051
|
+
/** Create a new workspace member. */
|
|
5847
6052
|
async createWorkspaceMember(wid, data) {
|
|
5848
6053
|
return this.fetch(`w/${wid}/members`, {
|
|
5849
6054
|
method: "POST",
|
|
5850
6055
|
body: JSON.stringify(data)
|
|
5851
6056
|
});
|
|
5852
6057
|
}
|
|
6058
|
+
/** Update a workspace member by ID. */
|
|
5853
6059
|
async updateMember(wid, memberId, data) {
|
|
5854
6060
|
return this.fetch(`w/${wid}/members/${memberId}`, {
|
|
5855
6061
|
method: "PUT",
|
|
5856
6062
|
body: JSON.stringify(data)
|
|
5857
6063
|
});
|
|
5858
6064
|
}
|
|
6065
|
+
/** Delete a workspace member, optionally forcing removal of associated data. */
|
|
5859
6066
|
async deleteMember(wid, memberId, options) {
|
|
5860
6067
|
const params = new URLSearchParams();
|
|
5861
6068
|
if (options?.force) {
|
|
@@ -5867,98 +6074,119 @@ var MembersApi = class extends BaseApiClient {
|
|
|
5867
6074
|
method: "DELETE"
|
|
5868
6075
|
});
|
|
5869
6076
|
}
|
|
6077
|
+
/** Archive a workspace member. */
|
|
5870
6078
|
async archiveMember(wid, memberId) {
|
|
5871
6079
|
return this.fetch(`w/${wid}/members/${memberId}/archive`, {
|
|
5872
6080
|
method: "POST"
|
|
5873
6081
|
});
|
|
5874
6082
|
}
|
|
6083
|
+
/** Unarchive a previously archived workspace member. */
|
|
5875
6084
|
async unarchiveMember(wid, memberId) {
|
|
5876
6085
|
return this.fetch(`w/${wid}/members/${memberId}/unarchive`, {
|
|
5877
6086
|
method: "POST"
|
|
5878
6087
|
});
|
|
5879
6088
|
}
|
|
5880
6089
|
// Member Filter APIs
|
|
6090
|
+
/** List all saved member filters for a workspace. */
|
|
5881
6091
|
async getMemberFilters(wid) {
|
|
5882
6092
|
return this.fetch(`w/${wid}/member-filters`);
|
|
5883
6093
|
}
|
|
6094
|
+
/** Get a single member filter by ID. */
|
|
5884
6095
|
async getMemberFilter(wid, filterId) {
|
|
5885
6096
|
return this.fetch(`w/${wid}/member-filters/${filterId}`);
|
|
5886
6097
|
}
|
|
6098
|
+
/** Create a new saved member filter. */
|
|
5887
6099
|
async createMemberFilter(wid, data) {
|
|
5888
6100
|
return this.fetch(`w/${wid}/member-filters`, {
|
|
5889
6101
|
method: "POST",
|
|
5890
6102
|
body: JSON.stringify(data)
|
|
5891
6103
|
});
|
|
5892
6104
|
}
|
|
6105
|
+
/** Update a saved member filter. */
|
|
5893
6106
|
async updateMemberFilter(wid, filterId, data) {
|
|
5894
6107
|
return this.fetch(`w/${wid}/member-filters/${filterId}`, {
|
|
5895
6108
|
method: "PUT",
|
|
5896
6109
|
body: JSON.stringify(data)
|
|
5897
6110
|
});
|
|
5898
6111
|
}
|
|
6112
|
+
/** Delete a saved member filter. */
|
|
5899
6113
|
async deleteMemberFilter(wid, filterId) {
|
|
5900
6114
|
return this.fetch(`w/${wid}/member-filters/${filterId}`, {
|
|
5901
6115
|
method: "DELETE"
|
|
5902
6116
|
});
|
|
5903
6117
|
}
|
|
6118
|
+
/** Get the count of members matching a saved filter. */
|
|
5904
6119
|
async getMemberFilterCount(wid, filterId) {
|
|
5905
6120
|
return this.fetch(`w/${wid}/member-filters/${filterId}/count`);
|
|
5906
6121
|
}
|
|
5907
6122
|
// Member Labels API
|
|
6123
|
+
/** List all member labels for a workspace. */
|
|
5908
6124
|
async getMemberLabels(wid) {
|
|
5909
6125
|
return this.fetch(`w/${wid}/member-labels`);
|
|
5910
6126
|
}
|
|
6127
|
+
/** Get a single member label by ID. */
|
|
5911
6128
|
async getMemberLabel(wid, id) {
|
|
5912
6129
|
return this.fetch(`w/${wid}/member-labels/${id}`);
|
|
5913
6130
|
}
|
|
6131
|
+
/** Get a single member label by UUID. */
|
|
5914
6132
|
async getMemberLabelByUuid(wid, uuid) {
|
|
5915
6133
|
return this.fetch(`w/${wid}/member-labels/${uuid}`);
|
|
5916
6134
|
}
|
|
6135
|
+
/** Create a new member label. */
|
|
5917
6136
|
async createMemberLabel(wid, label) {
|
|
5918
6137
|
return this.fetch(`w/${wid}/member-labels`, {
|
|
5919
6138
|
method: "POST",
|
|
5920
6139
|
body: JSON.stringify(label)
|
|
5921
6140
|
});
|
|
5922
6141
|
}
|
|
6142
|
+
/** Update a member label. */
|
|
5923
6143
|
async updateMemberLabel(wid, id, label) {
|
|
5924
6144
|
return this.fetch(`w/${wid}/member-labels/${id}`, {
|
|
5925
6145
|
method: "PUT",
|
|
5926
6146
|
body: JSON.stringify(label)
|
|
5927
6147
|
});
|
|
5928
6148
|
}
|
|
6149
|
+
/** Delete a member label. */
|
|
5929
6150
|
async deleteMemberLabel(wid, id) {
|
|
5930
6151
|
return this.fetch(`w/${wid}/member-labels/${id}`, {
|
|
5931
6152
|
method: "DELETE"
|
|
5932
6153
|
});
|
|
5933
6154
|
}
|
|
5934
6155
|
// Member Roles API
|
|
6156
|
+
/** List all member roles for a workspace. */
|
|
5935
6157
|
async getMemberRoles(wid) {
|
|
5936
6158
|
return this.fetch(`w/${wid}/member-roles`);
|
|
5937
6159
|
}
|
|
6160
|
+
/** Get a single member role by ID. */
|
|
5938
6161
|
async getMemberRole(wid, id) {
|
|
5939
6162
|
return this.fetch(`w/${wid}/member-roles/${id}`);
|
|
5940
6163
|
}
|
|
6164
|
+
/** Get a single member role by UUID. */
|
|
5941
6165
|
async getMemberRoleByUuid(wid, uuid) {
|
|
5942
6166
|
return this.fetch(`w/${wid}/member-roles/${uuid}`);
|
|
5943
6167
|
}
|
|
6168
|
+
/** Create a new member role. */
|
|
5944
6169
|
async createMemberRole(wid, memberRole) {
|
|
5945
6170
|
return this.fetch(`w/${wid}/member-roles`, {
|
|
5946
6171
|
method: "POST",
|
|
5947
6172
|
body: JSON.stringify(memberRole)
|
|
5948
6173
|
});
|
|
5949
6174
|
}
|
|
6175
|
+
/** Update a member role. */
|
|
5950
6176
|
async updateMemberRole(wid, id, memberRole) {
|
|
5951
6177
|
return this.fetch(`w/${wid}/member-roles/${id}`, {
|
|
5952
6178
|
method: "PUT",
|
|
5953
6179
|
body: JSON.stringify(memberRole)
|
|
5954
6180
|
});
|
|
5955
6181
|
}
|
|
6182
|
+
/** Delete a member role. */
|
|
5956
6183
|
async deleteMemberRole(wid, id) {
|
|
5957
6184
|
return this.fetch(`w/${wid}/member-roles/${id}`, {
|
|
5958
6185
|
method: "DELETE"
|
|
5959
6186
|
});
|
|
5960
6187
|
}
|
|
5961
6188
|
// Import/Export Members API
|
|
6189
|
+
/** Import members from a CSV file, streaming progress updates via callback. */
|
|
5962
6190
|
async importMembers(wid, file, newMemberRoleId, onProgress) {
|
|
5963
6191
|
const formData = new FormData();
|
|
5964
6192
|
formData.append("file", file);
|
|
@@ -6003,6 +6231,7 @@ var MembersApi = class extends BaseApiClient {
|
|
|
6003
6231
|
}
|
|
6004
6232
|
return { success: true };
|
|
6005
6233
|
}
|
|
6234
|
+
/** Export members as a downloadable file with selected fields and data types. */
|
|
6006
6235
|
async exportMembers(wid, selectedFields, selectedDataTypes, memberType) {
|
|
6007
6236
|
const params = new URLSearchParams();
|
|
6008
6237
|
selectedFields.forEach((field) => params.append("selected_fields", field));
|
|
@@ -6022,6 +6251,7 @@ var MembersApi = class extends BaseApiClient {
|
|
|
6022
6251
|
}
|
|
6023
6252
|
return response.blob();
|
|
6024
6253
|
}
|
|
6254
|
+
/** Get message activity counts for the specified members over a time period. */
|
|
6025
6255
|
async getMembersMessageActivity(wid, memberIds, days = 30) {
|
|
6026
6256
|
const memberIdsStr = memberIds.join(",");
|
|
6027
6257
|
const params = new URLSearchParams();
|
|
@@ -6170,6 +6400,7 @@ var MembersApi = class extends BaseApiClient {
|
|
|
6170
6400
|
}
|
|
6171
6401
|
};
|
|
6172
6402
|
var MilestonesApi = class extends BaseApiClient {
|
|
6403
|
+
/** List milestones in a workspace with optional pagination and sorting. */
|
|
6173
6404
|
async getMilestones(wid, options = {}) {
|
|
6174
6405
|
const params = new URLSearchParams();
|
|
6175
6406
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -6180,21 +6411,25 @@ var MilestonesApi = class extends BaseApiClient {
|
|
|
6180
6411
|
`w/${wid}/milestones${params.toString() ? `?${params.toString()}` : ""}`
|
|
6181
6412
|
);
|
|
6182
6413
|
}
|
|
6414
|
+
/** Get a single milestone by ID. */
|
|
6183
6415
|
async getMilestone(wid, id) {
|
|
6184
6416
|
return this.fetch(`w/${wid}/milestones/${id}`);
|
|
6185
6417
|
}
|
|
6418
|
+
/** Create a new milestone in a workspace. */
|
|
6186
6419
|
async createMilestone(wid, milestone) {
|
|
6187
6420
|
return this.fetch(`w/${wid}/milestones`, {
|
|
6188
6421
|
method: "POST",
|
|
6189
6422
|
body: JSON.stringify(milestone)
|
|
6190
6423
|
});
|
|
6191
6424
|
}
|
|
6425
|
+
/** Update an existing milestone with partial data. */
|
|
6192
6426
|
async updateMilestone(wid, id, milestone) {
|
|
6193
6427
|
return this.fetch(`w/${wid}/milestones/${id}`, {
|
|
6194
6428
|
method: "PUT",
|
|
6195
6429
|
body: JSON.stringify(milestone)
|
|
6196
6430
|
});
|
|
6197
6431
|
}
|
|
6432
|
+
/** Delete a milestone by ID. */
|
|
6198
6433
|
async deleteMilestone(wid, id) {
|
|
6199
6434
|
return this.fetch(`w/${wid}/milestones/${id}`, {
|
|
6200
6435
|
method: "DELETE"
|
|
@@ -6255,21 +6490,25 @@ var MondayIntegrationApi = class extends BaseApiClient {
|
|
|
6255
6490
|
}
|
|
6256
6491
|
};
|
|
6257
6492
|
var NotificationRulesApi = class extends BaseApiClient {
|
|
6493
|
+
/** List all notification rules in a workspace. */
|
|
6258
6494
|
async getNotificationRules(wid) {
|
|
6259
6495
|
return this.fetch(`w/${wid}/notification-rules`);
|
|
6260
6496
|
}
|
|
6497
|
+
/** Create a new notification rule. */
|
|
6261
6498
|
async createNotificationRule(wid, rule) {
|
|
6262
6499
|
return this.fetch(`w/${wid}/notification-rules`, {
|
|
6263
6500
|
method: "POST",
|
|
6264
6501
|
body: JSON.stringify(rule)
|
|
6265
6502
|
});
|
|
6266
6503
|
}
|
|
6504
|
+
/** Update a notification rule. */
|
|
6267
6505
|
async updateNotificationRule(wid, ruleId, rule) {
|
|
6268
6506
|
return this.fetch(`w/${wid}/notification-rules/${ruleId}`, {
|
|
6269
6507
|
method: "PUT",
|
|
6270
6508
|
body: JSON.stringify(rule)
|
|
6271
6509
|
});
|
|
6272
6510
|
}
|
|
6511
|
+
/** Delete a notification rule. */
|
|
6273
6512
|
async deleteNotificationRule(wid, ruleId) {
|
|
6274
6513
|
return this.fetch(`w/${wid}/notification-rules/${ruleId}`, {
|
|
6275
6514
|
method: "DELETE"
|
|
@@ -6277,57 +6516,69 @@ var NotificationRulesApi = class extends BaseApiClient {
|
|
|
6277
6516
|
}
|
|
6278
6517
|
};
|
|
6279
6518
|
var OperatorApi = class extends BaseApiClient {
|
|
6519
|
+
/** List all operator groups for a workspace. */
|
|
6280
6520
|
async getOperatorGroups(wid) {
|
|
6281
6521
|
return this.fetch(`w/${wid}/operator/groups`);
|
|
6282
6522
|
}
|
|
6523
|
+
/** Get a single operator group by ID. */
|
|
6283
6524
|
async getOperatorGroup(wid, groupId) {
|
|
6284
6525
|
return this.fetch(`w/${wid}/operator/groups/${groupId}`);
|
|
6285
6526
|
}
|
|
6527
|
+
/** Create a new operator group. */
|
|
6286
6528
|
async createOperatorGroup(wid, data) {
|
|
6287
6529
|
return this.fetch(`w/${wid}/operator/groups`, {
|
|
6288
6530
|
method: "POST",
|
|
6289
6531
|
body: JSON.stringify(data)
|
|
6290
6532
|
});
|
|
6291
6533
|
}
|
|
6534
|
+
/** Update an operator group. */
|
|
6292
6535
|
async updateOperatorGroup(wid, groupId, data) {
|
|
6293
6536
|
return this.fetch(`w/${wid}/operator/groups/${groupId}`, {
|
|
6294
6537
|
method: "PUT",
|
|
6295
6538
|
body: JSON.stringify(data)
|
|
6296
6539
|
});
|
|
6297
6540
|
}
|
|
6541
|
+
/** Delete an operator group. */
|
|
6298
6542
|
async deleteOperatorGroup(wid, groupId) {
|
|
6299
6543
|
return this.fetch(`w/${wid}/operator/groups/${groupId}`, {
|
|
6300
6544
|
method: "DELETE"
|
|
6301
6545
|
});
|
|
6302
6546
|
}
|
|
6547
|
+
/** Add a member to an operator group. */
|
|
6303
6548
|
async addGroupMember(wid, groupId, data) {
|
|
6304
6549
|
return this.fetch(`w/${wid}/operator/groups/${groupId}/members`, {
|
|
6305
6550
|
method: "POST",
|
|
6306
6551
|
body: JSON.stringify(data)
|
|
6307
6552
|
});
|
|
6308
6553
|
}
|
|
6554
|
+
/** Remove a member from an operator group. */
|
|
6309
6555
|
async removeGroupMember(wid, groupId, memberId) {
|
|
6310
6556
|
return this.fetch(`w/${wid}/operator/groups/${groupId}/members/${memberId}`, {
|
|
6311
6557
|
method: "DELETE"
|
|
6312
6558
|
});
|
|
6313
6559
|
}
|
|
6560
|
+
/** Get all currently live (online) operators in a workspace. */
|
|
6314
6561
|
async getLiveOperators(wid) {
|
|
6315
6562
|
return this.fetch(`w/${wid}/presence/live`);
|
|
6316
6563
|
}
|
|
6564
|
+
/** Get the current member's presence status. */
|
|
6317
6565
|
async getPresenceStatus(wid) {
|
|
6318
6566
|
return this.fetch(`w/${wid}/presence/me`);
|
|
6319
6567
|
}
|
|
6568
|
+
/** Disconnect the current member's presence session. */
|
|
6320
6569
|
async disconnectPresence(wid) {
|
|
6321
6570
|
return this.fetch(`w/${wid}/presence/disconnect-self`, {
|
|
6322
6571
|
method: "POST"
|
|
6323
6572
|
});
|
|
6324
6573
|
}
|
|
6325
6574
|
// Operator chat message methods
|
|
6575
|
+
/** Get paginated chat messages for an operator chat. */
|
|
6326
6576
|
async getOperatorChatMessages(wid, chatId, limit = 50, offset = 0) {
|
|
6327
6577
|
return this.fetch(
|
|
6328
6578
|
`w/${wid}/operator/chats/${chatId}/messages?limit=${limit}&offset=${offset}`
|
|
6329
6579
|
);
|
|
6330
6580
|
}
|
|
6581
|
+
/** Send a message in an operator chat. */
|
|
6331
6582
|
async sendOperatorMessage(wid, chatId, content) {
|
|
6332
6583
|
return this.fetch(`w/${wid}/operator/chats/${chatId}/messages`, {
|
|
6333
6584
|
method: "POST",
|
|
@@ -6411,45 +6662,54 @@ var OAuthApi = class extends BaseApiClient {
|
|
|
6411
6662
|
}
|
|
6412
6663
|
};
|
|
6413
6664
|
var PhoneNumbersApi = class extends BaseApiClient {
|
|
6665
|
+
/** List all phone numbers in a workspace. */
|
|
6414
6666
|
async getPhoneNumbers(wid) {
|
|
6415
6667
|
return this.fetch(`w/${wid}/phone-numbers`);
|
|
6416
6668
|
}
|
|
6669
|
+
/** List phone numbers available for provisioning. */
|
|
6417
6670
|
async getAvailablePhoneNumbers(wid) {
|
|
6418
6671
|
return this.fetch(
|
|
6419
6672
|
`w/${wid}/phone-numbers/available-numbers`
|
|
6420
6673
|
);
|
|
6421
6674
|
}
|
|
6675
|
+
/** Request provisioning of a specific phone number. */
|
|
6422
6676
|
async requestPhoneNumber(wid, phoneNumber) {
|
|
6423
6677
|
return this.fetch(`w/${wid}/phone-numbers/request`, {
|
|
6424
6678
|
method: "POST",
|
|
6425
6679
|
body: JSON.stringify({ phone_number: phoneNumber })
|
|
6426
6680
|
});
|
|
6427
6681
|
}
|
|
6682
|
+
/** Get a phone number by ID. */
|
|
6428
6683
|
async getPhoneNumber(wid, id) {
|
|
6429
6684
|
return this.fetch(`w/${wid}/phone-numbers/${id}`);
|
|
6430
6685
|
}
|
|
6686
|
+
/** Create a new phone number record. */
|
|
6431
6687
|
async createPhoneNumber(wid, phoneNumber) {
|
|
6432
6688
|
return this.fetch(`w/${wid}/phone-numbers`, {
|
|
6433
6689
|
method: "POST",
|
|
6434
6690
|
body: JSON.stringify(phoneNumber)
|
|
6435
6691
|
});
|
|
6436
6692
|
}
|
|
6693
|
+
/** Update a phone number record. */
|
|
6437
6694
|
async updatePhoneNumber(wid, id, phoneNumber) {
|
|
6438
6695
|
return this.fetch(`w/${wid}/phone-numbers/${id}`, {
|
|
6439
6696
|
method: "PUT",
|
|
6440
6697
|
body: JSON.stringify(phoneNumber)
|
|
6441
6698
|
});
|
|
6442
6699
|
}
|
|
6700
|
+
/** Delete a phone number. */
|
|
6443
6701
|
async deletePhoneNumber(wid, id) {
|
|
6444
6702
|
return this.fetch(`w/${wid}/phone-numbers/${id}`, {
|
|
6445
6703
|
method: "DELETE"
|
|
6446
6704
|
});
|
|
6447
6705
|
}
|
|
6706
|
+
/** List paginated call records for a phone number. */
|
|
6448
6707
|
async getPhoneNumberCalls(wid, id, page = 1, pageSize = 10) {
|
|
6449
6708
|
return this.fetch(
|
|
6450
6709
|
`w/${wid}/phone-numbers/${id}/calls?page=${page}&pageSize=${pageSize}`
|
|
6451
6710
|
);
|
|
6452
6711
|
}
|
|
6712
|
+
/** List paginated SMS messages for a phone number. */
|
|
6453
6713
|
async getPhoneNumberMessages(wid, id, page = 1, pageSize = 10) {
|
|
6454
6714
|
return this.fetch(
|
|
6455
6715
|
`w/${wid}/phone-numbers/${id}/messages?page=${page}&pageSize=${pageSize}`
|
|
@@ -6457,6 +6717,7 @@ var PhoneNumbersApi = class extends BaseApiClient {
|
|
|
6457
6717
|
}
|
|
6458
6718
|
};
|
|
6459
6719
|
var PronunciationsApi = class extends BaseApiClient {
|
|
6720
|
+
/** List pronunciation entries for an organization, optionally filtered by scope. */
|
|
6460
6721
|
async getPronunciationEntries(orgUuid, options = {}) {
|
|
6461
6722
|
const params = new URLSearchParams();
|
|
6462
6723
|
if (options.scope) params.append("scope", options.scope);
|
|
@@ -6466,55 +6727,65 @@ var PronunciationsApi = class extends BaseApiClient {
|
|
|
6466
6727
|
);
|
|
6467
6728
|
return response.items;
|
|
6468
6729
|
}
|
|
6730
|
+
/** Create a new pronunciation entry for an organization. */
|
|
6469
6731
|
async createPronunciationEntry(orgUuid, data) {
|
|
6470
6732
|
return this.fetch(`o/${orgUuid}/pronunciations`, {
|
|
6471
6733
|
method: "POST",
|
|
6472
6734
|
body: JSON.stringify(data)
|
|
6473
6735
|
});
|
|
6474
6736
|
}
|
|
6737
|
+
/** Update an existing organization pronunciation entry. */
|
|
6475
6738
|
async updatePronunciationEntry(orgUuid, id, data) {
|
|
6476
6739
|
return this.fetch(`o/${orgUuid}/pronunciations/${id}`, {
|
|
6477
6740
|
method: "PUT",
|
|
6478
6741
|
body: JSON.stringify(data)
|
|
6479
6742
|
});
|
|
6480
6743
|
}
|
|
6744
|
+
/** Delete a pronunciation entry from an organization. */
|
|
6481
6745
|
async deletePronunciationEntry(orgUuid, id) {
|
|
6482
6746
|
return this.fetch(`o/${orgUuid}/pronunciations/${id}`, {
|
|
6483
6747
|
method: "DELETE"
|
|
6484
6748
|
});
|
|
6485
6749
|
}
|
|
6750
|
+
/** Export all pronunciation entries for an organization as term/respelling pairs. */
|
|
6486
6751
|
async exportPronunciationEntries(orgUuid) {
|
|
6487
6752
|
return this.fetch(`o/${orgUuid}/pronunciations/export`);
|
|
6488
6753
|
}
|
|
6754
|
+
/** Bulk import pronunciation entries into an organization. */
|
|
6489
6755
|
async importPronunciationEntries(orgUuid, entries) {
|
|
6490
6756
|
return this.fetch(`o/${orgUuid}/pronunciations/import`, {
|
|
6491
6757
|
method: "POST",
|
|
6492
6758
|
body: JSON.stringify({ entries })
|
|
6493
6759
|
});
|
|
6494
6760
|
}
|
|
6761
|
+
/** List the current user's personal pronunciation entries. */
|
|
6495
6762
|
async getMyPronunciations() {
|
|
6496
6763
|
const response = await this.fetch(
|
|
6497
6764
|
"account/pronunciations"
|
|
6498
6765
|
);
|
|
6499
6766
|
return response.items;
|
|
6500
6767
|
}
|
|
6768
|
+
/** Create a personal pronunciation entry for the current user. */
|
|
6501
6769
|
async createMyPronunciation(data) {
|
|
6502
6770
|
return this.fetch("account/pronunciations", {
|
|
6503
6771
|
method: "POST",
|
|
6504
6772
|
body: JSON.stringify(data)
|
|
6505
6773
|
});
|
|
6506
6774
|
}
|
|
6775
|
+
/** Update a personal pronunciation entry. */
|
|
6507
6776
|
async updateMyPronunciation(id, data) {
|
|
6508
6777
|
return this.fetch(`account/pronunciations/${id}`, {
|
|
6509
6778
|
method: "PUT",
|
|
6510
6779
|
body: JSON.stringify(data)
|
|
6511
6780
|
});
|
|
6512
6781
|
}
|
|
6782
|
+
/** Delete a personal pronunciation entry. */
|
|
6513
6783
|
async deleteMyPronunciation(id) {
|
|
6514
6784
|
return this.fetch(`account/pronunciations/${id}`, {
|
|
6515
6785
|
method: "DELETE"
|
|
6516
6786
|
});
|
|
6517
6787
|
}
|
|
6788
|
+
/** Get AI-suggested respellings for a given term. */
|
|
6518
6789
|
async suggestPronunciations(term, language) {
|
|
6519
6790
|
const response = await this.fetch(
|
|
6520
6791
|
"account/pronunciations/suggest",
|
|
@@ -6525,12 +6796,14 @@ var PronunciationsApi = class extends BaseApiClient {
|
|
|
6525
6796
|
);
|
|
6526
6797
|
return response.suggestions;
|
|
6527
6798
|
}
|
|
6799
|
+
/** List recommended voices for pronunciation preview. */
|
|
6528
6800
|
async getRecommendedVoices() {
|
|
6529
6801
|
const response = await this.fetch(
|
|
6530
6802
|
"account/pronunciations/voices"
|
|
6531
6803
|
);
|
|
6532
6804
|
return response.voices;
|
|
6533
6805
|
}
|
|
6806
|
+
/** Generate an audio preview of a pronunciation respelling using a specified voice. */
|
|
6534
6807
|
async previewPronunciation(data) {
|
|
6535
6808
|
const response = await this.fetchRaw("account/pronunciations/preview", {
|
|
6536
6809
|
method: "POST",
|
|
@@ -6544,24 +6817,29 @@ var PronunciationsApi = class extends BaseApiClient {
|
|
|
6544
6817
|
}
|
|
6545
6818
|
};
|
|
6546
6819
|
var QualificationsApi = class extends BaseApiClient {
|
|
6820
|
+
/** List all qualifications in a workspace. */
|
|
6547
6821
|
async getQualifications(wid) {
|
|
6548
6822
|
return this.fetch(`w/${wid}/qualifications`);
|
|
6549
6823
|
}
|
|
6824
|
+
/** Get a single qualification by ID. */
|
|
6550
6825
|
async getQualification(wid, id) {
|
|
6551
6826
|
return this.fetch(`w/${wid}/qualifications/${id}`);
|
|
6552
6827
|
}
|
|
6828
|
+
/** Create a new qualification in a workspace. */
|
|
6553
6829
|
async createQualification(wid, data) {
|
|
6554
6830
|
return this.fetch(`w/${wid}/qualifications`, {
|
|
6555
6831
|
method: "POST",
|
|
6556
6832
|
body: JSON.stringify(data)
|
|
6557
6833
|
});
|
|
6558
6834
|
}
|
|
6835
|
+
/** Update an existing qualification. */
|
|
6559
6836
|
async updateQualification(wid, id, data) {
|
|
6560
6837
|
return this.fetch(`w/${wid}/qualifications/${id}`, {
|
|
6561
6838
|
method: "PUT",
|
|
6562
6839
|
body: JSON.stringify(data)
|
|
6563
6840
|
});
|
|
6564
6841
|
}
|
|
6842
|
+
/** List members assigned to a qualification with optional filtering. */
|
|
6565
6843
|
async getQualificationMembers(wid, id, params) {
|
|
6566
6844
|
const searchParams = new URLSearchParams();
|
|
6567
6845
|
if (params?.status) searchParams.set("status", params.status);
|
|
@@ -6573,16 +6851,19 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6573
6851
|
`w/${wid}/qualifications/${id}/members${qs ? `?${qs}` : ""}`
|
|
6574
6852
|
);
|
|
6575
6853
|
}
|
|
6854
|
+
/** Archive a qualification. */
|
|
6576
6855
|
async archiveQualification(wid, id) {
|
|
6577
6856
|
return this.fetch(`w/${wid}/qualifications/${id}`, {
|
|
6578
6857
|
method: "DELETE"
|
|
6579
6858
|
});
|
|
6580
6859
|
}
|
|
6860
|
+
/** List all qualifications assigned to a specific member. */
|
|
6581
6861
|
async getMemberQualifications(wid, memberId) {
|
|
6582
6862
|
return this.fetch(
|
|
6583
6863
|
`w/${wid}/qualifications/members/${memberId}/qualifications`
|
|
6584
6864
|
);
|
|
6585
6865
|
}
|
|
6866
|
+
/** Assign a qualification to a member. */
|
|
6586
6867
|
async assignQualification(wid, memberId, data) {
|
|
6587
6868
|
return this.fetch(
|
|
6588
6869
|
`w/${wid}/qualifications/members/${memberId}/qualifications`,
|
|
@@ -6592,6 +6873,7 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6592
6873
|
}
|
|
6593
6874
|
);
|
|
6594
6875
|
}
|
|
6876
|
+
/** Update a member's qualification status or settings. */
|
|
6595
6877
|
async updateMemberQualification(wid, memberId, qualificationId, data) {
|
|
6596
6878
|
return this.fetch(
|
|
6597
6879
|
`w/${wid}/qualifications/members/${memberId}/qualifications/${qualificationId}`,
|
|
@@ -6601,6 +6883,7 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6601
6883
|
}
|
|
6602
6884
|
);
|
|
6603
6885
|
}
|
|
6886
|
+
/** Remove a qualification assignment from a member. */
|
|
6604
6887
|
async removeMemberQualification(wid, memberId, qualificationId) {
|
|
6605
6888
|
return this.fetch(
|
|
6606
6889
|
`w/${wid}/qualifications/members/${memberId}/qualifications/${qualificationId}`,
|
|
@@ -6609,17 +6892,20 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6609
6892
|
}
|
|
6610
6893
|
);
|
|
6611
6894
|
}
|
|
6895
|
+
/** Get the status change history for a member's qualification. */
|
|
6612
6896
|
async getMemberQualificationLog(wid, memberId, qualificationId) {
|
|
6613
6897
|
return this.fetch(
|
|
6614
6898
|
`w/${wid}/qualifications/members/${memberId}/qualifications/${qualificationId}/log`
|
|
6615
6899
|
);
|
|
6616
6900
|
}
|
|
6617
6901
|
// ===== Requirements =====
|
|
6902
|
+
/** List all requirements for a qualification. */
|
|
6618
6903
|
async listRequirements(wid, qualificationId) {
|
|
6619
6904
|
return this.fetch(
|
|
6620
6905
|
`w/${wid}/qualifications/${qualificationId}/requirements`
|
|
6621
6906
|
);
|
|
6622
6907
|
}
|
|
6908
|
+
/** Create a new requirement for a qualification. */
|
|
6623
6909
|
async createRequirement(wid, qualificationId, data) {
|
|
6624
6910
|
return this.fetch(
|
|
6625
6911
|
`w/${wid}/qualifications/${qualificationId}/requirements`,
|
|
@@ -6629,11 +6915,13 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6629
6915
|
}
|
|
6630
6916
|
);
|
|
6631
6917
|
}
|
|
6918
|
+
/** Get a single qualification requirement by ID. */
|
|
6632
6919
|
async getRequirement(wid, requirementId) {
|
|
6633
6920
|
return this.fetch(
|
|
6634
6921
|
`w/${wid}/qualifications/requirements/${requirementId}`
|
|
6635
6922
|
);
|
|
6636
6923
|
}
|
|
6924
|
+
/** Update a qualification requirement. */
|
|
6637
6925
|
async updateRequirement(wid, requirementId, data) {
|
|
6638
6926
|
return this.fetch(
|
|
6639
6927
|
`w/${wid}/qualifications/requirements/${requirementId}`,
|
|
@@ -6643,12 +6931,14 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6643
6931
|
}
|
|
6644
6932
|
);
|
|
6645
6933
|
}
|
|
6934
|
+
/** Delete a qualification requirement. */
|
|
6646
6935
|
async deleteRequirement(wid, requirementId) {
|
|
6647
6936
|
return this.fetch(`w/${wid}/qualifications/requirements/${requirementId}`, {
|
|
6648
6937
|
method: "DELETE"
|
|
6649
6938
|
});
|
|
6650
6939
|
}
|
|
6651
6940
|
// ===== Submissions =====
|
|
6941
|
+
/** List submissions for a qualification, optionally filtered by status or member. */
|
|
6652
6942
|
async listSubmissions(wid, qualificationId, params) {
|
|
6653
6943
|
const searchParams = new URLSearchParams();
|
|
6654
6944
|
if (params?.status) searchParams.set("status", params.status);
|
|
@@ -6658,11 +6948,13 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6658
6948
|
`w/${wid}/qualifications/${qualificationId}/submissions${qs ? `?${qs}` : ""}`
|
|
6659
6949
|
);
|
|
6660
6950
|
}
|
|
6951
|
+
/** Get a single qualification submission by ID. */
|
|
6661
6952
|
async getSubmission(wid, submissionId) {
|
|
6662
6953
|
return this.fetch(
|
|
6663
6954
|
`w/${wid}/qualifications/submissions/${submissionId}`
|
|
6664
6955
|
);
|
|
6665
6956
|
}
|
|
6957
|
+
/** Submit an answer for a qualification requirement. */
|
|
6666
6958
|
async submitAnswer(wid, requirementId, data) {
|
|
6667
6959
|
return this.fetch(
|
|
6668
6960
|
`w/${wid}/qualifications/requirements/${requirementId}/submit`,
|
|
@@ -6672,6 +6964,7 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6672
6964
|
}
|
|
6673
6965
|
);
|
|
6674
6966
|
}
|
|
6967
|
+
/** Start a chat scenario for a qualification requirement. */
|
|
6675
6968
|
async startScenario(wid, requirementId) {
|
|
6676
6969
|
return this.fetch(
|
|
6677
6970
|
`w/${wid}/qualifications/requirements/${requirementId}/start-scenario`,
|
|
@@ -6680,11 +6973,13 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6680
6973
|
}
|
|
6681
6974
|
);
|
|
6682
6975
|
}
|
|
6976
|
+
/** Delete a submission to allow the member to retry. */
|
|
6683
6977
|
async retrySubmission(wid, submissionId) {
|
|
6684
6978
|
await this.fetch(`w/${wid}/qualifications/submissions/${submissionId}/retry`, {
|
|
6685
6979
|
method: "DELETE"
|
|
6686
6980
|
});
|
|
6687
6981
|
}
|
|
6982
|
+
/** Submit the current user's qualification for review. */
|
|
6688
6983
|
async submitForReview(wid, qualificationId) {
|
|
6689
6984
|
return this.fetch(
|
|
6690
6985
|
`w/${wid}/qualifications/members/me/qualifications/${qualificationId}/submit`,
|
|
@@ -6693,6 +6988,7 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6693
6988
|
}
|
|
6694
6989
|
);
|
|
6695
6990
|
}
|
|
6991
|
+
/** Review a qualification submission, approving or rejecting it. */
|
|
6696
6992
|
async reviewSubmission(wid, submissionId, data) {
|
|
6697
6993
|
return this.fetch(
|
|
6698
6994
|
`w/${wid}/qualifications/submissions/${submissionId}/review`,
|
|
@@ -6702,6 +6998,7 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6702
6998
|
}
|
|
6703
6999
|
);
|
|
6704
7000
|
}
|
|
7001
|
+
/** Override the score for a specific criterion on a submission. */
|
|
6705
7002
|
async overrideCriterionScore(wid, submissionId, criterionId, data) {
|
|
6706
7003
|
return this.fetch(
|
|
6707
7004
|
`w/${wid}/qualifications/submissions/${submissionId}/criteria/${criterionId}`,
|
|
@@ -6713,6 +7010,7 @@ var QualificationsApi = class extends BaseApiClient {
|
|
|
6713
7010
|
}
|
|
6714
7011
|
};
|
|
6715
7012
|
var ReportsApi = class extends BaseApiClient {
|
|
7013
|
+
/** Get AI model usage report for a workspace within an optional date range. */
|
|
6716
7014
|
async getAIUsageReport(wid, params) {
|
|
6717
7015
|
const queryParams = new URLSearchParams();
|
|
6718
7016
|
if (params?.start_date) {
|
|
@@ -6725,6 +7023,7 @@ var ReportsApi = class extends BaseApiClient {
|
|
|
6725
7023
|
const url = `w/${wid}/reports/ai-usage${queryString ? `?${queryString}` : ""}`;
|
|
6726
7024
|
return this.fetch(url);
|
|
6727
7025
|
}
|
|
7026
|
+
/** Get SMS usage report for a workspace within an optional date range. */
|
|
6728
7027
|
async getSMSUsageReport(wid, params) {
|
|
6729
7028
|
const queryParams = new URLSearchParams();
|
|
6730
7029
|
if (params?.start_date) {
|
|
@@ -6737,6 +7036,7 @@ var ReportsApi = class extends BaseApiClient {
|
|
|
6737
7036
|
const url = `w/${wid}/reports/sms-usage${queryString ? `?${queryString}` : ""}`;
|
|
6738
7037
|
return this.fetch(url);
|
|
6739
7038
|
}
|
|
7039
|
+
/** Get phone call usage report for a workspace within an optional date range. */
|
|
6740
7040
|
async getPhoneUsageReport(wid, params) {
|
|
6741
7041
|
const queryParams = new URLSearchParams();
|
|
6742
7042
|
if (params?.start_date) {
|
|
@@ -6749,6 +7049,7 @@ var ReportsApi = class extends BaseApiClient {
|
|
|
6749
7049
|
const url = `w/${wid}/reports/phone-usage${queryString ? `?${queryString}` : ""}`;
|
|
6750
7050
|
return this.fetch(url);
|
|
6751
7051
|
}
|
|
7052
|
+
/** Get usage report for a specific member within an optional date range. */
|
|
6752
7053
|
async getMemberUsage(wid, memberId, params) {
|
|
6753
7054
|
const queryParams = new URLSearchParams();
|
|
6754
7055
|
if (params?.start_date) {
|
|
@@ -6761,6 +7062,7 @@ var ReportsApi = class extends BaseApiClient {
|
|
|
6761
7062
|
const url = `w/${wid}/reports/member-usage/${memberId}${queryString ? `?${queryString}` : ""}`;
|
|
6762
7063
|
return this.fetch(url);
|
|
6763
7064
|
}
|
|
7065
|
+
/** Get voice (STT/TTS) usage report for a workspace within an optional date range. */
|
|
6764
7066
|
async getVoiceUsageReport(wid, params) {
|
|
6765
7067
|
const queryParams = new URLSearchParams();
|
|
6766
7068
|
if (params?.start_date) {
|
|
@@ -6775,9 +7077,11 @@ var ReportsApi = class extends BaseApiClient {
|
|
|
6775
7077
|
}
|
|
6776
7078
|
};
|
|
6777
7079
|
var SitesApi = class extends BaseApiClient {
|
|
7080
|
+
/** List all sites in a workspace. */
|
|
6778
7081
|
async getSites(wid) {
|
|
6779
7082
|
return this.fetch(`w/${wid}/sites`);
|
|
6780
7083
|
}
|
|
7084
|
+
/** Check whether a site slug is available for use. */
|
|
6781
7085
|
async checkSiteSlugAvailability(wid, slug, siteUuid = null) {
|
|
6782
7086
|
const params = new URLSearchParams();
|
|
6783
7087
|
if (siteUuid) params.append("site_uuid", siteUuid);
|
|
@@ -6785,6 +7089,7 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6785
7089
|
`w/${wid}/sites/available/${slug}?${params.toString()}`
|
|
6786
7090
|
);
|
|
6787
7091
|
}
|
|
7092
|
+
/** Check whether a custom domain is available for a site. */
|
|
6788
7093
|
async checkSiteDomainAvailability(wid, domain, siteUuid = null) {
|
|
6789
7094
|
const params = new URLSearchParams();
|
|
6790
7095
|
if (siteUuid) params.append("site_uuid", siteUuid);
|
|
@@ -6792,24 +7097,29 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6792
7097
|
`w/${wid}/sites/domain-available/${domain}?${params.toString()}`
|
|
6793
7098
|
);
|
|
6794
7099
|
}
|
|
7100
|
+
/** Get a single site by ID. */
|
|
6795
7101
|
async getSite(wid, id) {
|
|
6796
7102
|
return this.fetch(`w/${wid}/sites/${id}`);
|
|
6797
7103
|
}
|
|
7104
|
+
/** Get a single site by UUID. */
|
|
6798
7105
|
async getSiteByUuid(wid, uuid) {
|
|
6799
7106
|
return this.fetch(`s/${wid}/${uuid}`);
|
|
6800
7107
|
}
|
|
7108
|
+
/** Get a fully rendered page from a site by slug or ID. */
|
|
6801
7109
|
async getSiteRenderedPage(wid, siteUuid, pageSlugOrId) {
|
|
6802
7110
|
return this.fetch(`s/${wid}/${siteUuid}/pages/${pageSlugOrId}`);
|
|
6803
7111
|
}
|
|
7112
|
+
/** Get the rendered navigation menu for a site, including all translations. */
|
|
6804
7113
|
async getSiteRenderedMenu(wid, siteUuid) {
|
|
6805
7114
|
return this.fetch(`s/${wid}/${siteUuid}/menu`);
|
|
6806
7115
|
}
|
|
7116
|
+
/** Sign up a new user through a site's public registration. */
|
|
6807
7117
|
async siteSignup(wid, siteUuid) {
|
|
6808
7118
|
return this.fetch(`s/${wid}/${siteUuid}/signup`, {
|
|
6809
7119
|
method: "POST"
|
|
6810
7120
|
});
|
|
6811
7121
|
}
|
|
6812
|
-
|
|
7122
|
+
/** Send a phone verification code for site-specific authentication. */
|
|
6813
7123
|
async siteSendPhoneCode(wid, siteUuid, phoneNumber) {
|
|
6814
7124
|
return this.fetch(
|
|
6815
7125
|
`s/${wid}/${siteUuid}/auth/send-phone-code`,
|
|
@@ -6819,6 +7129,7 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6819
7129
|
}
|
|
6820
7130
|
);
|
|
6821
7131
|
}
|
|
7132
|
+
/** Send an email verification code for site-specific authentication. */
|
|
6822
7133
|
async siteSendEmailCode(wid, siteUuid, email) {
|
|
6823
7134
|
return this.fetch(
|
|
6824
7135
|
`s/${wid}/${siteUuid}/auth/send-email-code`,
|
|
@@ -6828,6 +7139,7 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6828
7139
|
}
|
|
6829
7140
|
);
|
|
6830
7141
|
}
|
|
7142
|
+
/** Verify a phone or email code and complete site authentication. */
|
|
6831
7143
|
async siteVerifyCode(wid, siteUuid, code, phoneNumber, email) {
|
|
6832
7144
|
const verifyResponse = await this.fetch(`s/${wid}/${siteUuid}/auth/verify`, {
|
|
6833
7145
|
method: "POST",
|
|
@@ -6843,28 +7155,33 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6843
7155
|
}
|
|
6844
7156
|
return verifyResponse;
|
|
6845
7157
|
}
|
|
7158
|
+
/** Trigger a crawl of the site's external content source. */
|
|
6846
7159
|
async crawlSite(wid, siteId) {
|
|
6847
7160
|
return this.fetch(`w/${wid}/sites/${siteId}/crawl`, {
|
|
6848
7161
|
method: "POST"
|
|
6849
7162
|
});
|
|
6850
7163
|
}
|
|
7164
|
+
/** Create a new site in the workspace. */
|
|
6851
7165
|
async createSite(wid, site) {
|
|
6852
7166
|
return this.fetch(`w/${wid}/sites`, {
|
|
6853
7167
|
method: "POST",
|
|
6854
7168
|
body: JSON.stringify(site)
|
|
6855
7169
|
});
|
|
6856
7170
|
}
|
|
7171
|
+
/** Update a site's configuration. */
|
|
6857
7172
|
async updateSite(wid, id, site) {
|
|
6858
7173
|
return this.fetch(`w/${wid}/sites/${id}`, {
|
|
6859
7174
|
method: "PUT",
|
|
6860
7175
|
body: JSON.stringify(site)
|
|
6861
7176
|
});
|
|
6862
7177
|
}
|
|
7178
|
+
/** Delete a site by ID. */
|
|
6863
7179
|
async deleteSite(wid, id) {
|
|
6864
7180
|
return this.fetch(`w/${wid}/sites/${id}`, {
|
|
6865
7181
|
method: "DELETE"
|
|
6866
7182
|
});
|
|
6867
7183
|
}
|
|
7184
|
+
/** List pages for a site with optional pagination, sorting, and search. */
|
|
6868
7185
|
async getSitePages(wid, siteId, options = {}) {
|
|
6869
7186
|
const params = new URLSearchParams();
|
|
6870
7187
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -6876,36 +7193,43 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6876
7193
|
`w/${wid}/sites/${siteId}/pages${params.toString() ? `?${params.toString()}` : ""}`
|
|
6877
7194
|
);
|
|
6878
7195
|
}
|
|
7196
|
+
/** Get a single page by ID within a site. */
|
|
6879
7197
|
async getPage(wid, siteId, pageId) {
|
|
6880
7198
|
return this.fetch(`w/${wid}/sites/${siteId}/pages/${pageId}`);
|
|
6881
7199
|
}
|
|
7200
|
+
/** Get a single page by its slug within a site. */
|
|
6882
7201
|
async getPageBySlug(wid, siteId, slug) {
|
|
6883
7202
|
return this.fetch(`w/${wid}/sites/${siteId}/pages/by-slug/${slug}`);
|
|
6884
7203
|
}
|
|
7204
|
+
/** Create a new page within a site. */
|
|
6885
7205
|
async createPage(wid, siteId, page) {
|
|
6886
7206
|
return this.fetch(`w/${wid}/sites/${siteId}/pages`, {
|
|
6887
7207
|
method: "POST",
|
|
6888
7208
|
body: JSON.stringify(page)
|
|
6889
7209
|
});
|
|
6890
7210
|
}
|
|
7211
|
+
/** Update a page's content or metadata. */
|
|
6891
7212
|
async updatePage(wid, siteId, pageId, page) {
|
|
6892
7213
|
return this.fetch(`w/${wid}/sites/${siteId}/pages/${pageId}`, {
|
|
6893
7214
|
method: "PUT",
|
|
6894
7215
|
body: JSON.stringify(page)
|
|
6895
7216
|
});
|
|
6896
7217
|
}
|
|
7218
|
+
/** Delete a page from a site. */
|
|
6897
7219
|
async deletePage(wid, siteId, pageId) {
|
|
6898
7220
|
return this.fetch(`w/${wid}/sites/${siteId}/pages/${pageId}`, {
|
|
6899
7221
|
method: "DELETE"
|
|
6900
7222
|
});
|
|
6901
7223
|
}
|
|
7224
|
+
/** Get aggregate counts (pages, menu items, etc.) for a site. */
|
|
6902
7225
|
async getSiteCounts(wid, siteId) {
|
|
6903
7226
|
return this.fetch(`w/${wid}/sites/${siteId}/counts`);
|
|
6904
7227
|
}
|
|
6905
|
-
|
|
7228
|
+
/** Get the full menu tree for a site. */
|
|
6906
7229
|
async getSiteMenu(wid, siteId) {
|
|
6907
7230
|
return this.fetch(`w/${wid}/sites/${siteId}/menu`);
|
|
6908
7231
|
}
|
|
7232
|
+
/** List menu items for a site, optionally filtered by parent item. */
|
|
6909
7233
|
async getMenuItems(wid, siteId, parentId) {
|
|
6910
7234
|
const params = new URLSearchParams();
|
|
6911
7235
|
if (parentId !== void 0 && parentId !== null) {
|
|
@@ -6916,36 +7240,41 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6916
7240
|
`w/${wid}/sites/${siteId}/menu/items${query ? `?${query}` : ""}`
|
|
6917
7241
|
);
|
|
6918
7242
|
}
|
|
7243
|
+
/** Create a new menu item in a site's navigation. */
|
|
6919
7244
|
async createMenuItem(wid, siteId, item) {
|
|
6920
7245
|
return this.fetch(`w/${wid}/sites/${siteId}/menu/items`, {
|
|
6921
7246
|
method: "POST",
|
|
6922
7247
|
body: JSON.stringify(item)
|
|
6923
7248
|
});
|
|
6924
7249
|
}
|
|
7250
|
+
/** Update a menu item's properties. */
|
|
6925
7251
|
async updateMenuItem(wid, siteId, itemId, item) {
|
|
6926
7252
|
return this.fetch(`w/${wid}/sites/${siteId}/menu/items/${itemId}`, {
|
|
6927
7253
|
method: "PUT",
|
|
6928
7254
|
body: JSON.stringify(item)
|
|
6929
7255
|
});
|
|
6930
7256
|
}
|
|
7257
|
+
/** Delete a menu item from a site's navigation. */
|
|
6931
7258
|
async deleteMenuItem(wid, siteId, itemId) {
|
|
6932
7259
|
return this.fetch(`w/${wid}/sites/${siteId}/menu/items/${itemId}`, {
|
|
6933
7260
|
method: "DELETE"
|
|
6934
7261
|
});
|
|
6935
7262
|
}
|
|
7263
|
+
/** Reorder menu items within a site's navigation. */
|
|
6936
7264
|
async reorderMenuItems(wid, siteId, data) {
|
|
6937
7265
|
return this.fetch(`w/${wid}/sites/${siteId}/menu/reorder`, {
|
|
6938
7266
|
method: "POST",
|
|
6939
7267
|
body: JSON.stringify(data)
|
|
6940
7268
|
});
|
|
6941
7269
|
}
|
|
6942
|
-
|
|
7270
|
+
/** Generate a pre-signed upload URL for site media content. */
|
|
6943
7271
|
async generateSiteMediaUploadUrl(wid, siteId, uploadRequest) {
|
|
6944
7272
|
return this.fetch(`w/${wid}/sites/${siteId}/media/upload-url`, {
|
|
6945
7273
|
method: "POST",
|
|
6946
7274
|
body: JSON.stringify(uploadRequest)
|
|
6947
7275
|
});
|
|
6948
7276
|
}
|
|
7277
|
+
/** Initiate Google OAuth flow for site-specific authentication. */
|
|
6949
7278
|
async siteGoogleOAuthInitiate(wid, siteUuid, origin) {
|
|
6950
7279
|
const params = new URLSearchParams({ origin });
|
|
6951
7280
|
return this.fetch(
|
|
@@ -6954,24 +7283,29 @@ var SitesApi = class extends BaseApiClient {
|
|
|
6954
7283
|
}
|
|
6955
7284
|
};
|
|
6956
7285
|
var SubscriptionsApi = class extends BaseApiClient {
|
|
7286
|
+
/** List all subscriptions for the current account. */
|
|
6957
7287
|
async getSubscriptions() {
|
|
6958
7288
|
return this.fetch("subscriptions");
|
|
6959
7289
|
}
|
|
7290
|
+
/** List all subscriptions associated with a workspace. */
|
|
6960
7291
|
async getWorkspaceSubscriptions(wid) {
|
|
6961
7292
|
return this.fetch(`w/${wid}/subscriptions`);
|
|
6962
7293
|
}
|
|
7294
|
+
/** Cancel an active subscription. */
|
|
6963
7295
|
async cancelSubscription(subscriptionId) {
|
|
6964
7296
|
return this.fetch(`subscriptions/${subscriptionId}/cancel`, {
|
|
6965
7297
|
method: "POST",
|
|
6966
7298
|
credentials: "include"
|
|
6967
7299
|
});
|
|
6968
7300
|
}
|
|
7301
|
+
/** Reactivate a previously cancelled subscription. */
|
|
6969
7302
|
async reactivateSubscription(subscriptionId) {
|
|
6970
7303
|
return this.fetch(`subscriptions/${subscriptionId}/reactivate`, {
|
|
6971
7304
|
method: "POST",
|
|
6972
7305
|
credentials: "include"
|
|
6973
7306
|
});
|
|
6974
7307
|
}
|
|
7308
|
+
/** Update a subscription's budget or plan period. */
|
|
6975
7309
|
async updateSubscription(subscriptionId, updates) {
|
|
6976
7310
|
return this.fetch(`subscriptions/${subscriptionId}`, {
|
|
6977
7311
|
method: "PUT",
|
|
@@ -6982,6 +7316,7 @@ var SubscriptionsApi = class extends BaseApiClient {
|
|
|
6982
7316
|
}
|
|
6983
7317
|
});
|
|
6984
7318
|
}
|
|
7319
|
+
/** Provision the member role associated with a subscription. */
|
|
6985
7320
|
async provisionMemberRole(subscriptionId) {
|
|
6986
7321
|
return this.fetch(`subscriptions/${subscriptionId}/provision-role`, {
|
|
6987
7322
|
method: "POST",
|
|
@@ -6990,6 +7325,7 @@ var SubscriptionsApi = class extends BaseApiClient {
|
|
|
6990
7325
|
}
|
|
6991
7326
|
};
|
|
6992
7327
|
var TasksApi = class extends BaseApiClient {
|
|
7328
|
+
/** List all tasks in a workspace, optionally filtering by workflow or including archived. */
|
|
6993
7329
|
async getTasks(wid, options = {}) {
|
|
6994
7330
|
const params = new URLSearchParams();
|
|
6995
7331
|
if (options.includeArchived) {
|
|
@@ -7002,31 +7338,37 @@ var TasksApi = class extends BaseApiClient {
|
|
|
7002
7338
|
`w/${wid}/tasks${params.toString() ? `?${params.toString()}` : ""}`
|
|
7003
7339
|
);
|
|
7004
7340
|
}
|
|
7341
|
+
/** Get a single task by ID. */
|
|
7005
7342
|
async getTask(wid, id) {
|
|
7006
7343
|
return this.fetch(`w/${wid}/tasks/${id}`);
|
|
7007
7344
|
}
|
|
7345
|
+
/** Create a new task in a workspace. */
|
|
7008
7346
|
async createTask(wid, task) {
|
|
7009
7347
|
return this.fetch(`w/${wid}/tasks`, {
|
|
7010
7348
|
method: "POST",
|
|
7011
7349
|
body: JSON.stringify(task)
|
|
7012
7350
|
});
|
|
7013
7351
|
}
|
|
7352
|
+
/** Update an existing task with partial data. */
|
|
7014
7353
|
async updateTask(wid, id, task) {
|
|
7015
7354
|
return this.fetch(`w/${wid}/tasks/${id}`, {
|
|
7016
7355
|
method: "PUT",
|
|
7017
7356
|
body: JSON.stringify(task)
|
|
7018
7357
|
});
|
|
7019
7358
|
}
|
|
7359
|
+
/** Delete a task by ID. */
|
|
7020
7360
|
async deleteTask(wid, id) {
|
|
7021
7361
|
return this.fetch(`w/${wid}/tasks/${id}`, {
|
|
7022
7362
|
method: "DELETE"
|
|
7023
7363
|
});
|
|
7024
7364
|
}
|
|
7365
|
+
/** Archive a task, hiding it from default listings. */
|
|
7025
7366
|
async archiveTask(wid, id) {
|
|
7026
7367
|
return this.fetch(`w/${wid}/tasks/${id}/archive`, {
|
|
7027
7368
|
method: "PUT"
|
|
7028
7369
|
});
|
|
7029
7370
|
}
|
|
7371
|
+
/** Restore an archived task back to active status. */
|
|
7030
7372
|
async unarchiveTask(wid, id) {
|
|
7031
7373
|
return this.fetch(`w/${wid}/tasks/${id}/unarchive`, {
|
|
7032
7374
|
method: "PUT"
|
|
@@ -7080,17 +7422,21 @@ var ToolkitsApi = class extends BaseApiClient {
|
|
|
7080
7422
|
}
|
|
7081
7423
|
};
|
|
7082
7424
|
var WorkflowsApi = class extends BaseApiClient {
|
|
7425
|
+
/** List all workflows in a workspace, optionally including archived ones. */
|
|
7083
7426
|
async getWorkflows(wid, archived = false) {
|
|
7084
7427
|
const url = archived ? `w/${wid}/workflows?archived=true` : `w/${wid}/workflows`;
|
|
7085
7428
|
return this.fetch(url);
|
|
7086
7429
|
}
|
|
7430
|
+
/** Get a single workflow by ID. */
|
|
7087
7431
|
async getWorkflow(wid, id) {
|
|
7088
7432
|
return this.fetch(`w/${wid}/workflows/${id}`);
|
|
7089
7433
|
}
|
|
7434
|
+
/** Get activity metrics for a single workflow. */
|
|
7090
7435
|
async getWorkflowActivity(wid, id, options) {
|
|
7091
7436
|
const params = options?.days ? `?days=${options.days}` : "";
|
|
7092
7437
|
return this.fetch(`w/${wid}/workflows/${id}/activity${params}`);
|
|
7093
7438
|
}
|
|
7439
|
+
/** Get activity metrics for multiple workflows in a single request. */
|
|
7094
7440
|
async getWorkflowsActivityBatch(wid, workflowIds, options) {
|
|
7095
7441
|
const params = new URLSearchParams();
|
|
7096
7442
|
params.set("workflow_ids", workflowIds.join(","));
|
|
@@ -7099,6 +7445,7 @@ var WorkflowsApi = class extends BaseApiClient {
|
|
|
7099
7445
|
`w/${wid}/workflows/activity/batch?${params.toString()}`
|
|
7100
7446
|
);
|
|
7101
7447
|
}
|
|
7448
|
+
/** Get the Mermaid diagram representation of a workflow. */
|
|
7102
7449
|
async getWorkflowDiagram(wid, id) {
|
|
7103
7450
|
return this.fetch(`w/${wid}/workflows/${id}/diagram`);
|
|
7104
7451
|
}
|
|
@@ -7113,52 +7460,62 @@ var WorkflowsApi = class extends BaseApiClient {
|
|
|
7113
7460
|
}
|
|
7114
7461
|
return `${this.baseUrl}/api/v2/w/${wid}/workflows/${id}/thumbnail`;
|
|
7115
7462
|
}
|
|
7463
|
+
/** Create a new workflow in a workspace. */
|
|
7116
7464
|
async createWorkflow(wid, workflow) {
|
|
7117
7465
|
return this.fetch(`w/${wid}/workflows`, {
|
|
7118
7466
|
method: "POST",
|
|
7119
7467
|
body: JSON.stringify(workflow)
|
|
7120
7468
|
});
|
|
7121
7469
|
}
|
|
7470
|
+
/** Update an existing workflow. */
|
|
7122
7471
|
async updateWorkflow(wid, id, workflow) {
|
|
7123
7472
|
return this.fetch(`w/${wid}/workflows/${id}`, {
|
|
7124
7473
|
method: "PUT",
|
|
7125
7474
|
body: JSON.stringify(workflow)
|
|
7126
7475
|
});
|
|
7127
7476
|
}
|
|
7477
|
+
/** Preview the impact of deleting a workflow, including affected tasks and assignments. */
|
|
7128
7478
|
async getWorkflowDeletionPreview(wid, id) {
|
|
7129
7479
|
return this.fetch(`w/${wid}/workflows/${id}/deletion-preview`);
|
|
7130
7480
|
}
|
|
7481
|
+
/** Delete a workflow, optionally cascading to delete its tasks. */
|
|
7131
7482
|
async deleteWorkflow(wid, id, cascade = false) {
|
|
7132
7483
|
const url = cascade ? `w/${wid}/workflows/${id}?cascade=true` : `w/${wid}/workflows/${id}`;
|
|
7133
7484
|
return this.fetch(url, {
|
|
7134
7485
|
method: "DELETE"
|
|
7135
7486
|
});
|
|
7136
7487
|
}
|
|
7488
|
+
/** Archive a workflow. */
|
|
7137
7489
|
async archiveWorkflow(wid, id) {
|
|
7138
7490
|
return this.fetch(`w/${wid}/workflows/${id}/archive`, {
|
|
7139
7491
|
method: "POST"
|
|
7140
7492
|
});
|
|
7141
7493
|
}
|
|
7494
|
+
/** Unarchive a previously archived workflow. */
|
|
7142
7495
|
async unarchiveWorkflow(wid, id) {
|
|
7143
7496
|
return this.fetch(`w/${wid}/workflows/${id}/unarchive`, {
|
|
7144
7497
|
method: "POST"
|
|
7145
7498
|
});
|
|
7146
7499
|
}
|
|
7500
|
+
/** Clone a workflow with a new name. */
|
|
7147
7501
|
async cloneWorkflow(wid, id, data) {
|
|
7148
7502
|
return this.fetch(`w/${wid}/workflows/${id}/clone`, {
|
|
7149
7503
|
method: "POST",
|
|
7150
7504
|
body: JSON.stringify(data)
|
|
7151
7505
|
});
|
|
7152
7506
|
}
|
|
7507
|
+
/** List available workflow templates. */
|
|
7153
7508
|
async getWorkflowTemplates(wid) {
|
|
7154
7509
|
return this.fetch(`w/${wid}/workflows/templates`);
|
|
7155
7510
|
}
|
|
7511
|
+
/** Create a new workflow from a template. */
|
|
7156
7512
|
async createWorkflowFromTemplate(wid, templateUuid, data) {
|
|
7157
7513
|
return this.fetch(`w/${wid}/workflows/templates/${templateUuid}/create-workflow`, {
|
|
7158
7514
|
method: "POST",
|
|
7159
7515
|
body: JSON.stringify(data)
|
|
7160
7516
|
});
|
|
7161
7517
|
}
|
|
7518
|
+
/** Get task assignment statistics for a workflow within an optional date range. */
|
|
7162
7519
|
async getWorkflowTaskAssignmentStats(wid, id, fromDate, toDate) {
|
|
7163
7520
|
const params = new URLSearchParams();
|
|
7164
7521
|
if (fromDate) params.append("from_date", fromDate);
|
|
@@ -7167,6 +7524,7 @@ var WorkflowsApi = class extends BaseApiClient {
|
|
|
7167
7524
|
`w/${wid}/workflows/${id}/task-assignment-stats?${params.toString()}`
|
|
7168
7525
|
);
|
|
7169
7526
|
}
|
|
7527
|
+
/** List chats for a specific task within a workflow. */
|
|
7170
7528
|
async getTaskChats(wid, workflowId, taskId, fromDate, toDate, limit = 100, offset = 0) {
|
|
7171
7529
|
const params = new URLSearchParams();
|
|
7172
7530
|
if (fromDate) params.append("from_date", fromDate);
|
|
@@ -7178,15 +7536,18 @@ var WorkflowsApi = class extends BaseApiClient {
|
|
|
7178
7536
|
);
|
|
7179
7537
|
}
|
|
7180
7538
|
// Workflow Contributors API
|
|
7539
|
+
/** List all contributors for a workflow. */
|
|
7181
7540
|
async getWorkflowContributors(wid, workflowId) {
|
|
7182
7541
|
return this.fetch(`w/${wid}/workflows/${workflowId}/contributors`);
|
|
7183
7542
|
}
|
|
7543
|
+
/** Add a contributor to a workflow. */
|
|
7184
7544
|
async createWorkflowContributor(wid, workflowId, data) {
|
|
7185
7545
|
return this.fetch(`w/${wid}/workflows/${workflowId}/contributors`, {
|
|
7186
7546
|
method: "POST",
|
|
7187
7547
|
body: JSON.stringify(data)
|
|
7188
7548
|
});
|
|
7189
7549
|
}
|
|
7550
|
+
/** Update a workflow contributor's settings. */
|
|
7190
7551
|
async updateWorkflowContributor(wid, workflowId, contributorId, data) {
|
|
7191
7552
|
return this.fetch(
|
|
7192
7553
|
`w/${wid}/workflows/${workflowId}/contributors/${contributorId}`,
|
|
@@ -7196,6 +7557,7 @@ var WorkflowsApi = class extends BaseApiClient {
|
|
|
7196
7557
|
}
|
|
7197
7558
|
);
|
|
7198
7559
|
}
|
|
7560
|
+
/** Remove a contributor from a workflow. */
|
|
7199
7561
|
async deleteWorkflowContributor(wid, workflowId, contributorId) {
|
|
7200
7562
|
return this.fetch(
|
|
7201
7563
|
`w/${wid}/workflows/${workflowId}/contributors/${contributorId}`,
|
|
@@ -7375,59 +7737,73 @@ var WorkspaceInvitationsApi = class extends BaseApiClient {
|
|
|
7375
7737
|
}
|
|
7376
7738
|
};
|
|
7377
7739
|
var WorkspacesApi = class extends BaseApiClient {
|
|
7740
|
+
/** List all workspaces accessible to the current user. */
|
|
7378
7741
|
async getWorkspaces() {
|
|
7379
7742
|
return this.fetch("w/");
|
|
7380
7743
|
}
|
|
7744
|
+
/** List all publicly visible workspaces. */
|
|
7381
7745
|
async getPublicWorkspaces() {
|
|
7382
7746
|
return this.fetch("w/public");
|
|
7383
7747
|
}
|
|
7748
|
+
/** Get a single workspace by ID. */
|
|
7384
7749
|
async getWorkspace(wid) {
|
|
7385
7750
|
return this.fetch(`w/${wid}`);
|
|
7386
7751
|
}
|
|
7752
|
+
/** Create a new workspace. */
|
|
7387
7753
|
async createWorkspace(workspace) {
|
|
7388
7754
|
return this.fetch("w/", {
|
|
7389
7755
|
method: "POST",
|
|
7390
7756
|
body: JSON.stringify(workspace)
|
|
7391
7757
|
});
|
|
7392
7758
|
}
|
|
7759
|
+
/** Update an existing workspace. */
|
|
7393
7760
|
async updateWorkspace(wid, workspace) {
|
|
7394
7761
|
return this.fetch(`w/${wid}`, {
|
|
7395
7762
|
method: "PUT",
|
|
7396
7763
|
body: JSON.stringify(workspace)
|
|
7397
7764
|
});
|
|
7398
7765
|
}
|
|
7766
|
+
/** Delete a workspace. */
|
|
7399
7767
|
async deleteWorkspace(wid) {
|
|
7400
7768
|
return this.fetch(`w/${wid}`, {
|
|
7401
7769
|
method: "DELETE"
|
|
7402
7770
|
});
|
|
7403
7771
|
}
|
|
7772
|
+
/** Leave a workspace as the current user. */
|
|
7404
7773
|
async leaveWorkspace(wid) {
|
|
7405
7774
|
return this.fetch(`w/${wid}/me`, {
|
|
7406
7775
|
method: "DELETE"
|
|
7407
7776
|
});
|
|
7408
7777
|
}
|
|
7778
|
+
/** Get the default settings for a workspace. */
|
|
7409
7779
|
async getWorkspaceDefaults(wid) {
|
|
7410
7780
|
return this.fetch(`w/${wid}/defaults`);
|
|
7411
7781
|
}
|
|
7782
|
+
/** Update the default settings for a workspace. */
|
|
7412
7783
|
async updateWorkspaceDefaults(wid, defaults) {
|
|
7413
7784
|
return this.fetch(`w/${wid}/defaults`, {
|
|
7414
7785
|
method: "PUT",
|
|
7415
7786
|
body: JSON.stringify(defaults)
|
|
7416
7787
|
});
|
|
7417
7788
|
}
|
|
7789
|
+
/** Get entity counts (members, tasks, workflows, etc.) for a workspace. */
|
|
7418
7790
|
async getWorkspaceCounts(wid) {
|
|
7419
7791
|
return this.fetch(`w/${wid}/counts`);
|
|
7420
7792
|
}
|
|
7793
|
+
/** Check whether the workspace is currently within business hours. */
|
|
7421
7794
|
async getBusinessHoursStatus(wid) {
|
|
7422
7795
|
return this.fetch(`w/${wid}/business-hours-status`);
|
|
7423
7796
|
}
|
|
7797
|
+
/** List all available workspace feature flags from the registry. */
|
|
7424
7798
|
async getAvailableWorkspaceFeatures() {
|
|
7425
7799
|
const result2 = await this.fetch(`features/registry`);
|
|
7426
7800
|
return result2.features;
|
|
7427
7801
|
}
|
|
7802
|
+
/** Get active notices for a workspace. */
|
|
7428
7803
|
async getWorkspaceNotices(wid) {
|
|
7429
7804
|
return this.fetch(`w/${wid}/notices`);
|
|
7430
7805
|
}
|
|
7806
|
+
/** List notifications for the current user in a workspace. */
|
|
7431
7807
|
async getNotifications(wid, options = {}) {
|
|
7432
7808
|
const params = new URLSearchParams();
|
|
7433
7809
|
if (options.page) params.append("page", options.page.toString());
|
|
@@ -7436,32 +7812,39 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7436
7812
|
const url = `w/${wid}/notifications${queryString ? `?${queryString}` : ""}`;
|
|
7437
7813
|
return this.fetch(url);
|
|
7438
7814
|
}
|
|
7815
|
+
/** Get a single notification by ID. */
|
|
7439
7816
|
async getNotification(wid, id) {
|
|
7440
7817
|
return this.fetch(`w/${wid}/notifications/${id}`);
|
|
7441
7818
|
}
|
|
7819
|
+
/** Get the count of unread notifications for the current user. */
|
|
7442
7820
|
async getUnreadNotificationCount(wid) {
|
|
7443
7821
|
return this.fetch(`w/${wid}/notifications/unread-count`);
|
|
7444
7822
|
}
|
|
7823
|
+
/** Mark a notification as read. */
|
|
7445
7824
|
async markNotificationAsRead(wid, id) {
|
|
7446
7825
|
return this.fetch(`w/${wid}/notifications/${id}/read`, {
|
|
7447
7826
|
method: "POST"
|
|
7448
7827
|
});
|
|
7449
7828
|
}
|
|
7829
|
+
/** Dismiss a single notification. */
|
|
7450
7830
|
async dismissNotification(wid, id) {
|
|
7451
7831
|
return this.fetch(`w/${wid}/notifications/${id}/dismiss`, {
|
|
7452
7832
|
method: "POST"
|
|
7453
7833
|
});
|
|
7454
7834
|
}
|
|
7835
|
+
/** Dismiss all notifications for the current user in a workspace. */
|
|
7455
7836
|
async dismissAllNotifications(wid) {
|
|
7456
7837
|
return this.fetch(`w/${wid}/notifications/dismiss-all`, {
|
|
7457
7838
|
method: "POST"
|
|
7458
7839
|
});
|
|
7459
7840
|
}
|
|
7460
7841
|
// ===== Push Notifications =====
|
|
7842
|
+
/** Get the VAPID public key for Web Push subscription registration. */
|
|
7461
7843
|
async getVapidPublicKey() {
|
|
7462
7844
|
const response = await this.fetch("push/vapid-public-key");
|
|
7463
7845
|
return response.publicKey;
|
|
7464
7846
|
}
|
|
7847
|
+
/** Register a Web Push subscription for the current user. */
|
|
7465
7848
|
async registerPushSubscription(wid, subscription) {
|
|
7466
7849
|
return this.fetch(
|
|
7467
7850
|
`w/${wid}/push-subscriptions`,
|
|
@@ -7471,6 +7854,7 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7471
7854
|
}
|
|
7472
7855
|
);
|
|
7473
7856
|
}
|
|
7857
|
+
/** Unregister a Web Push subscription by endpoint URL. */
|
|
7474
7858
|
async unregisterPushSubscription(wid, endpoint) {
|
|
7475
7859
|
return this.fetch(
|
|
7476
7860
|
`w/${wid}/push-subscriptions?endpoint=${encodeURIComponent(endpoint)}`,
|
|
@@ -7479,32 +7863,39 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7479
7863
|
}
|
|
7480
7864
|
);
|
|
7481
7865
|
}
|
|
7866
|
+
/** List all active Web Push subscriptions for the current user. */
|
|
7482
7867
|
async listPushSubscriptions(wid) {
|
|
7483
7868
|
return this.fetch(`w/${wid}/push-subscriptions`);
|
|
7484
7869
|
}
|
|
7870
|
+
/** List all client workspaces managed by this reseller workspace. */
|
|
7485
7871
|
async getResellerWorkspaces(wid) {
|
|
7486
7872
|
return this.fetch(`w/${wid}/reseller/workspaces`);
|
|
7487
7873
|
}
|
|
7874
|
+
/** Create a new client workspace under a reseller workspace. */
|
|
7488
7875
|
async createClientWorkspace(wid, data) {
|
|
7489
7876
|
return this.fetch(`w/${wid}/reseller/workspaces`, {
|
|
7490
7877
|
method: "POST",
|
|
7491
7878
|
body: JSON.stringify(data)
|
|
7492
7879
|
});
|
|
7493
7880
|
}
|
|
7881
|
+
/** Get a single client workspace by ID. */
|
|
7494
7882
|
async getClientWorkspace(wid, workspaceId) {
|
|
7495
7883
|
return this.fetch(`w/${wid}/reseller/workspaces/${workspaceId}`);
|
|
7496
7884
|
}
|
|
7885
|
+
/** Update a client workspace's name or slug. */
|
|
7497
7886
|
async updateClientWorkspace(wid, workspaceId, data) {
|
|
7498
7887
|
return this.fetch(`w/${wid}/reseller/workspaces/${workspaceId}`, {
|
|
7499
7888
|
method: "PUT",
|
|
7500
7889
|
body: JSON.stringify(data)
|
|
7501
7890
|
});
|
|
7502
7891
|
}
|
|
7892
|
+
/** Delete a client workspace. */
|
|
7503
7893
|
async deleteClientWorkspace(wid, workspaceId) {
|
|
7504
7894
|
return this.fetch(`w/${wid}/reseller/workspaces/${workspaceId}`, {
|
|
7505
7895
|
method: "DELETE"
|
|
7506
7896
|
});
|
|
7507
7897
|
}
|
|
7898
|
+
/** Provision a client workspace, setting up its database and resources. */
|
|
7508
7899
|
async provisionClientWorkspace(wid, workspaceId) {
|
|
7509
7900
|
return this.fetch(
|
|
7510
7901
|
`w/${wid}/reseller/workspaces/${workspaceId}/provision`,
|
|
@@ -7513,44 +7904,53 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7513
7904
|
}
|
|
7514
7905
|
);
|
|
7515
7906
|
}
|
|
7907
|
+
/** List products available from a reseller workspace, optionally filtering by featured status. */
|
|
7516
7908
|
async getProducts(wid, featured) {
|
|
7517
7909
|
const params = featured !== void 0 ? `?featured=${featured}` : "";
|
|
7518
7910
|
return this.fetch(`w/${wid}/reseller/products${params}`);
|
|
7519
7911
|
}
|
|
7912
|
+
/** Get a product by ID using the global endpoint. */
|
|
7520
7913
|
async getProduct(id) {
|
|
7521
7914
|
return this.fetch(`products/${id}`);
|
|
7522
7915
|
}
|
|
7916
|
+
/** Get a publicly accessible product by ID. */
|
|
7523
7917
|
async getPublicProduct(id) {
|
|
7524
7918
|
return this.fetch(`products/${id}`);
|
|
7525
7919
|
}
|
|
7920
|
+
/** Create a new product for a reseller workspace. */
|
|
7526
7921
|
async createProduct(wid, product) {
|
|
7527
7922
|
return this.fetch(`w/${wid}/reseller/products`, {
|
|
7528
7923
|
method: "POST",
|
|
7529
7924
|
body: JSON.stringify(product)
|
|
7530
7925
|
});
|
|
7531
7926
|
}
|
|
7927
|
+
/** Update an existing product. */
|
|
7532
7928
|
async updateProduct(wid, id, updates) {
|
|
7533
7929
|
return this.fetch(`w/${wid}/reseller/products/${id}`, {
|
|
7534
7930
|
method: "PUT",
|
|
7535
7931
|
body: JSON.stringify(updates)
|
|
7536
7932
|
});
|
|
7537
7933
|
}
|
|
7934
|
+
/** Delete a product from a reseller workspace. */
|
|
7538
7935
|
async deleteProduct(wid, id) {
|
|
7539
7936
|
return this.fetch(`w/${wid}/reseller/products/${id}`, {
|
|
7540
7937
|
method: "DELETE"
|
|
7541
7938
|
});
|
|
7542
7939
|
}
|
|
7543
7940
|
// Workspace Secret Key
|
|
7941
|
+
/** Reset and regenerate the workspace secret key. */
|
|
7544
7942
|
async resetWorkspaceSecretKey(wid) {
|
|
7545
7943
|
return this.fetch(`w/${wid}/defaults/reset-secret-key`, {
|
|
7546
7944
|
method: "POST"
|
|
7547
7945
|
});
|
|
7548
7946
|
}
|
|
7549
7947
|
// Workspace Export/Import API
|
|
7948
|
+
/** Export workspace configuration, optionally scoped to a single workflow. */
|
|
7550
7949
|
async exportWorkspace(wid, workflowId) {
|
|
7551
7950
|
const params = workflowId ? `?workflow_id=${workflowId}` : "";
|
|
7552
7951
|
return this.fetch(`w/${wid}/export${params}`);
|
|
7553
7952
|
}
|
|
7953
|
+
/** Preview the result of importing workspace configuration without applying changes. */
|
|
7554
7954
|
async previewWorkspaceImport(wid, exportData, importMappings, createNew, autoMap) {
|
|
7555
7955
|
return this.fetch(`w/${wid}/preview-import`, {
|
|
7556
7956
|
method: "POST",
|
|
@@ -7562,6 +7962,7 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7562
7962
|
})
|
|
7563
7963
|
});
|
|
7564
7964
|
}
|
|
7965
|
+
/** Import workspace configuration from exported data. */
|
|
7565
7966
|
async importWorkspace(wid, exportData, importMappings, createNew) {
|
|
7566
7967
|
return this.fetch(`w/${wid}/import`, {
|
|
7567
7968
|
method: "POST",
|
|
@@ -7572,6 +7973,7 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7572
7973
|
})
|
|
7573
7974
|
});
|
|
7574
7975
|
}
|
|
7976
|
+
/** Preview a workspace import using the legacy untyped interface. */
|
|
7575
7977
|
// Legacy method for backward compatibility
|
|
7576
7978
|
async previewImportWorkspace(wid, exportData, importMappings = {}, createNew = {}) {
|
|
7577
7979
|
return this.fetch(`w/${wid}/preview-import`, {
|
|
@@ -7583,9 +7985,11 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7583
7985
|
})
|
|
7584
7986
|
});
|
|
7585
7987
|
}
|
|
7988
|
+
/** List available themes for a workspace. */
|
|
7586
7989
|
async getWorkspaceThemes(wid) {
|
|
7587
7990
|
return this.fetch(`w/${wid}/themes`);
|
|
7588
7991
|
}
|
|
7992
|
+
/** Update the active themes for a workspace. */
|
|
7589
7993
|
async updateWorkspaceThemes(wid, themes) {
|
|
7590
7994
|
return this.fetch(`w/${wid}/themes`, {
|
|
7591
7995
|
method: "PUT",
|
|
@@ -7633,24 +8037,29 @@ var WorkspacesApi = class extends BaseApiClient {
|
|
|
7633
8037
|
}
|
|
7634
8038
|
};
|
|
7635
8039
|
var WorkflowNotesApi = class extends BaseApiClient {
|
|
8040
|
+
/** List all notes for a specific workflow. */
|
|
7636
8041
|
async getWorkflowNotes(wid, workflowId) {
|
|
7637
8042
|
return this.fetch(`w/${wid}/workflow-notes?workflow_id=${workflowId}`);
|
|
7638
8043
|
}
|
|
8044
|
+
/** Get a single workflow note by ID. */
|
|
7639
8045
|
async getWorkflowNote(wid, id) {
|
|
7640
8046
|
return this.fetch(`w/${wid}/workflow-notes/${id}`);
|
|
7641
8047
|
}
|
|
8048
|
+
/** Create a new note on a workflow. */
|
|
7642
8049
|
async createWorkflowNote(wid, note) {
|
|
7643
8050
|
return this.fetch(`w/${wid}/workflow-notes`, {
|
|
7644
8051
|
method: "POST",
|
|
7645
8052
|
body: JSON.stringify(note)
|
|
7646
8053
|
});
|
|
7647
8054
|
}
|
|
8055
|
+
/** Update an existing workflow note with partial data. */
|
|
7648
8056
|
async updateWorkflowNote(wid, id, note) {
|
|
7649
8057
|
return this.fetch(`w/${wid}/workflow-notes/${id}`, {
|
|
7650
8058
|
method: "PUT",
|
|
7651
8059
|
body: JSON.stringify(note)
|
|
7652
8060
|
});
|
|
7653
8061
|
}
|
|
8062
|
+
/** Delete a workflow note by ID. */
|
|
7654
8063
|
async deleteWorkflowNote(wid, id) {
|
|
7655
8064
|
return this.fetch(`w/${wid}/workflow-notes/${id}`, {
|
|
7656
8065
|
method: "DELETE"
|
|
@@ -8211,6 +8620,7 @@ function bindWorkflowsMethods(target, workflows, workflowNotes, assistants, supe
|
|
|
8211
8620
|
target.updateAssistant = assistants.updateAssistant.bind(assistants);
|
|
8212
8621
|
target.deleteAssistant = assistants.deleteAssistant.bind(assistants);
|
|
8213
8622
|
target.previewTTS = assistants.previewTTS.bind(assistants);
|
|
8623
|
+
target.previewThinkingSound = assistants.previewThinkingSound.bind(assistants);
|
|
8214
8624
|
target.getSupervisors = supervisors.getSupervisors.bind(supervisors);
|
|
8215
8625
|
target.getSupervisor = supervisors.getSupervisor.bind(supervisors);
|
|
8216
8626
|
target.createSupervisor = supervisors.createSupervisor.bind(supervisors);
|
|
@@ -8292,6 +8702,8 @@ function bindToolkitsMethods(target, toolkits, templates, aiModels, customToolki
|
|
|
8292
8702
|
target.getVariableRegistry = templates.getVariableRegistry.bind(templates);
|
|
8293
8703
|
target.getChatModels = aiModels.getChatModels.bind(aiModels);
|
|
8294
8704
|
target.getRealtimeModels = aiModels.getRealtimeModels.bind(aiModels);
|
|
8705
|
+
target.getSTTModels = aiModels.getSTTModels.bind(aiModels);
|
|
8706
|
+
target.getTTSModels = aiModels.getTTSModels.bind(aiModels);
|
|
8295
8707
|
target.getVoiceModels = aiModels.getVoiceModels.bind(aiModels);
|
|
8296
8708
|
target.getAllModels = aiModels.getAllModels.bind(aiModels);
|
|
8297
8709
|
target.getCustomToolkits = customToolkits.getCustomToolkits.bind(customToolkits);
|
|
@@ -8888,6 +9300,7 @@ var GravityRailClient = class {
|
|
|
8888
9300
|
updateAssistant;
|
|
8889
9301
|
deleteAssistant;
|
|
8890
9302
|
previewTTS;
|
|
9303
|
+
previewThinkingSound;
|
|
8891
9304
|
getSupervisors;
|
|
8892
9305
|
getSupervisor;
|
|
8893
9306
|
createSupervisor;
|
|
@@ -8966,6 +9379,8 @@ var GravityRailClient = class {
|
|
|
8966
9379
|
getVariableRegistry;
|
|
8967
9380
|
getChatModels;
|
|
8968
9381
|
getRealtimeModels;
|
|
9382
|
+
getSTTModels;
|
|
9383
|
+
getTTSModels;
|
|
8969
9384
|
getVoiceModels;
|
|
8970
9385
|
getAllModels;
|
|
8971
9386
|
getCustomToolkits;
|
|
@@ -9348,8 +9763,7 @@ var CHAT_TYPES = {
|
|
|
9348
9763
|
MANAGER: "manager",
|
|
9349
9764
|
CONTRIBUTOR: "contributor",
|
|
9350
9765
|
DEVELOPER: "developer",
|
|
9351
|
-
|
|
9352
|
-
};
|
|
9766
|
+
MEMBER: "member"};
|
|
9353
9767
|
var BUILTIN_ASSISTANT_CHAT_TYPES = /* @__PURE__ */ new Set([
|
|
9354
9768
|
CHAT_TYPES.MANAGER,
|
|
9355
9769
|
CHAT_TYPES.CONTRIBUTOR,
|
|
@@ -9357,7 +9771,7 @@ var BUILTIN_ASSISTANT_CHAT_TYPES = /* @__PURE__ */ new Set([
|
|
|
9357
9771
|
]);
|
|
9358
9772
|
/* @__PURE__ */ new Set([
|
|
9359
9773
|
...BUILTIN_ASSISTANT_CHAT_TYPES,
|
|
9360
|
-
CHAT_TYPES.
|
|
9774
|
+
CHAT_TYPES.MEMBER
|
|
9361
9775
|
]);
|
|
9362
9776
|
var ENVIRONMENTS = {
|
|
9363
9777
|
dev: {
|
|
@@ -9658,6 +10072,93 @@ function printTable(items, columns, options = {}) {
|
|
|
9658
10072
|
console.log("");
|
|
9659
10073
|
console.log(`Total: ${items.length} item(s)`);
|
|
9660
10074
|
}
|
|
10075
|
+
var AGUIClient = class {
|
|
10076
|
+
endpointUrl;
|
|
10077
|
+
accessToken;
|
|
10078
|
+
debug;
|
|
10079
|
+
constructor(options) {
|
|
10080
|
+
this.endpointUrl = `${options.baseUrl}/api/v2/w/${options.workspaceUuid}/web-chat/${options.chatId}/chat/agui`;
|
|
10081
|
+
this.accessToken = options.accessToken;
|
|
10082
|
+
this.debug = options.debug ?? false;
|
|
10083
|
+
}
|
|
10084
|
+
/**
|
|
10085
|
+
* Send messages and stream the response
|
|
10086
|
+
*/
|
|
10087
|
+
async sendMessage(messages, onEvent) {
|
|
10088
|
+
const body = JSON.stringify({
|
|
10089
|
+
model: "manager",
|
|
10090
|
+
messages
|
|
10091
|
+
});
|
|
10092
|
+
if (this.debug) {
|
|
10093
|
+
console.log(`
|
|
10094
|
+
[DEBUG] POST ${this.endpointUrl}`);
|
|
10095
|
+
console.log(`[DEBUG] Body: ${messages.length} message(s)`);
|
|
10096
|
+
}
|
|
10097
|
+
const response = await fetch(this.endpointUrl, {
|
|
10098
|
+
method: "POST",
|
|
10099
|
+
headers: {
|
|
10100
|
+
Authorization: `Bearer ${this.accessToken}`,
|
|
10101
|
+
"Content-Type": "application/json",
|
|
10102
|
+
Accept: "text/event-stream"
|
|
10103
|
+
},
|
|
10104
|
+
body
|
|
10105
|
+
});
|
|
10106
|
+
if (this.debug) {
|
|
10107
|
+
console.log(`[DEBUG] Response status: ${response.status}`);
|
|
10108
|
+
}
|
|
10109
|
+
if (!response.ok) {
|
|
10110
|
+
const errorText = await response.text().catch(() => "");
|
|
10111
|
+
if (this.debug) {
|
|
10112
|
+
console.log(`[DEBUG] Error response: ${errorText}`);
|
|
10113
|
+
}
|
|
10114
|
+
throw new Error(`Chat request failed: ${response.status}`);
|
|
10115
|
+
}
|
|
10116
|
+
const reader = response.body.getReader();
|
|
10117
|
+
const decoder = new TextDecoder();
|
|
10118
|
+
let buffer = "";
|
|
10119
|
+
while (true) {
|
|
10120
|
+
const { done, value } = await reader.read();
|
|
10121
|
+
if (done) break;
|
|
10122
|
+
buffer += decoder.decode(value, { stream: true });
|
|
10123
|
+
const lines = buffer.split("\n");
|
|
10124
|
+
buffer = lines.pop() || "";
|
|
10125
|
+
for (const line of lines) {
|
|
10126
|
+
if (line.startsWith("data: ")) {
|
|
10127
|
+
const data = line.slice(6);
|
|
10128
|
+
if (data === "[DONE]") {
|
|
10129
|
+
onEvent({ type: "done" });
|
|
10130
|
+
continue;
|
|
10131
|
+
}
|
|
10132
|
+
try {
|
|
10133
|
+
const event = JSON.parse(data);
|
|
10134
|
+
onEvent(event);
|
|
10135
|
+
} catch {
|
|
10136
|
+
}
|
|
10137
|
+
}
|
|
10138
|
+
}
|
|
10139
|
+
}
|
|
10140
|
+
}
|
|
10141
|
+
};
|
|
10142
|
+
function isTextContentEvent(event) {
|
|
10143
|
+
const type = event.type.toLowerCase();
|
|
10144
|
+
return type === "text_message_content";
|
|
10145
|
+
}
|
|
10146
|
+
function isErrorEvent(event) {
|
|
10147
|
+
const type = event.type.toLowerCase();
|
|
10148
|
+
return type === "run_error";
|
|
10149
|
+
}
|
|
10150
|
+
function getTextDelta(event) {
|
|
10151
|
+
if (isTextContentEvent(event) && event.delta) {
|
|
10152
|
+
return event.delta;
|
|
10153
|
+
}
|
|
10154
|
+
return null;
|
|
10155
|
+
}
|
|
10156
|
+
function getErrorMessage(event) {
|
|
10157
|
+
if (isErrorEvent(event)) {
|
|
10158
|
+
return event.message || event.code || "Unknown error";
|
|
10159
|
+
}
|
|
10160
|
+
return null;
|
|
10161
|
+
}
|
|
9661
10162
|
var CLIError = class extends Error {
|
|
9662
10163
|
constructor(message, exitCode = 1) {
|
|
9663
10164
|
super(message);
|
|
@@ -10299,28 +10800,67 @@ var chatsDomain = {
|
|
|
10299
10800
|
}),
|
|
10300
10801
|
// Messages
|
|
10301
10802
|
{
|
|
10302
|
-
path: ["chats", "messages"],
|
|
10303
|
-
description: "
|
|
10803
|
+
path: ["chats", "messages", "list"],
|
|
10804
|
+
description: "List messages for a chat",
|
|
10304
10805
|
requiresWorkspace: true,
|
|
10305
|
-
args: [{ name: "id", description: "Chat ID", required: true }],
|
|
10806
|
+
args: [{ name: "chat-id", description: "Chat ID", required: true }],
|
|
10306
10807
|
handler: async ({ ctx, workspace, args }) => {
|
|
10307
10808
|
const result2 = await ctx.apiClient.getChatMessages(
|
|
10308
10809
|
workspace,
|
|
10309
|
-
requireNumber(args, "id")
|
|
10810
|
+
requireNumber(args, "chat-id")
|
|
10310
10811
|
);
|
|
10311
10812
|
outputData(result2, ctx, MESSAGE_COLUMNS);
|
|
10312
10813
|
}
|
|
10313
10814
|
},
|
|
10314
10815
|
{
|
|
10315
|
-
path: ["chats", "send
|
|
10316
|
-
description: "Send
|
|
10816
|
+
path: ["chats", "messages", "send"],
|
|
10817
|
+
description: "Send a user message to a chat (triggers AI inference). Use --stream to stream the response.",
|
|
10317
10818
|
mutates: true,
|
|
10318
10819
|
requiresWorkspace: true,
|
|
10319
|
-
args: [
|
|
10820
|
+
args: [
|
|
10821
|
+
{ name: "chat-id", description: "Chat ID", required: true },
|
|
10822
|
+
{ name: "stream", description: "Stream the AI response via AG-UI", isFlag: true }
|
|
10823
|
+
],
|
|
10824
|
+
handler: async ({ ctx, workspace, args, data }) => {
|
|
10825
|
+
const content = typeof data === "string" ? data : data?.content;
|
|
10826
|
+
if (!content)
|
|
10827
|
+
throw new Error(
|
|
10828
|
+
`Message content is required (pass --data '"your message"' or --data '{"content":"your message"}')`
|
|
10829
|
+
);
|
|
10830
|
+
const chatId = requireNumber(args, "chat-id");
|
|
10831
|
+
if (args.stream) {
|
|
10832
|
+
const aguiClient = new AGUIClient({
|
|
10833
|
+
baseUrl: ctx.envConfig.apiUrl,
|
|
10834
|
+
workspaceUuid: workspace,
|
|
10835
|
+
chatId,
|
|
10836
|
+
accessToken: ctx.accessToken
|
|
10837
|
+
});
|
|
10838
|
+
process.stdout.write("\x1B[32mAssistant:\x1B[0m ");
|
|
10839
|
+
await aguiClient.sendMessage([{ role: "user", content }], (event) => {
|
|
10840
|
+
const delta = getTextDelta(event);
|
|
10841
|
+
if (delta) process.stdout.write(delta);
|
|
10842
|
+
const errorMsg = getErrorMessage(event);
|
|
10843
|
+
if (errorMsg) process.stderr.write(`
|
|
10844
|
+
\x1B[31mError: ${errorMsg}\x1B[0m
|
|
10845
|
+
`);
|
|
10846
|
+
});
|
|
10847
|
+
process.stdout.write("\n");
|
|
10848
|
+
} else {
|
|
10849
|
+
const result2 = await ctx.apiClient.sendChatMessage(workspace, chatId, content);
|
|
10850
|
+
outputSingle(result2, ctx, MESSAGE_COLUMNS);
|
|
10851
|
+
}
|
|
10852
|
+
}
|
|
10853
|
+
},
|
|
10854
|
+
{
|
|
10855
|
+
path: ["chats", "messages", "send-as-assistant"],
|
|
10856
|
+
description: "Send an assistant message to a chat (does not trigger AI inference)",
|
|
10857
|
+
mutates: true,
|
|
10858
|
+
requiresWorkspace: true,
|
|
10859
|
+
args: [{ name: "chat-id", description: "Chat ID", required: true }],
|
|
10320
10860
|
handler: async ({ ctx, workspace, args, data }) => {
|
|
10321
10861
|
const result2 = await ctx.apiClient.sendAssistantMessage(
|
|
10322
10862
|
workspace,
|
|
10323
|
-
requireNumber(args, "id"),
|
|
10863
|
+
requireNumber(args, "chat-id"),
|
|
10324
10864
|
data
|
|
10325
10865
|
);
|
|
10326
10866
|
outputSingle(result2, ctx, MESSAGE_COLUMNS);
|
|
@@ -10761,7 +11301,7 @@ var workspacesDomain = {
|
|
|
10761
11301
|
requiresWorkspace: true,
|
|
10762
11302
|
handler: async ({ ctx, workspace }) => {
|
|
10763
11303
|
const result2 = await ctx.apiClient.getChats(workspace, {
|
|
10764
|
-
chatType: "
|
|
11304
|
+
chatType: "member",
|
|
10765
11305
|
mine: true,
|
|
10766
11306
|
sortBy: "updatedAt",
|
|
10767
11307
|
sortOrder: "desc"
|
|
@@ -10801,8 +11341,7 @@ var COLUMNS5 = [
|
|
|
10801
11341
|
COL.id(),
|
|
10802
11342
|
COL.uuid(),
|
|
10803
11343
|
COL.name(),
|
|
10804
|
-
|
|
10805
|
-
{ header: "TYPE", getValue: (item) => item.workflow_type ?? "" },
|
|
11344
|
+
{ header: "TASKS", getValue: (item) => String(item.taskCount ?? "") },
|
|
10806
11345
|
COL.created()
|
|
10807
11346
|
];
|
|
10808
11347
|
var NOTE_COLUMNS = [
|
|
@@ -11018,16 +11557,13 @@ var assignmentsDomain = {
|
|
|
11018
11557
|
description: "Cancel an assignment",
|
|
11019
11558
|
mutates: true,
|
|
11020
11559
|
requiresWorkspace: true,
|
|
11021
|
-
args: [
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
],
|
|
11025
|
-
handler: async ({ ctx, workspace, args }) => {
|
|
11026
|
-
const data = args.reason ? { reason: args.reason } : {};
|
|
11560
|
+
args: [{ name: "id", description: "Assignment ID", required: true }],
|
|
11561
|
+
handler: async ({ ctx, workspace, args, data }) => {
|
|
11562
|
+
const body = data ?? {};
|
|
11027
11563
|
const result2 = await ctx.apiClient.cancelAssignment(
|
|
11028
11564
|
workspace,
|
|
11029
11565
|
requireNumber(args, "id"),
|
|
11030
|
-
|
|
11566
|
+
body
|
|
11031
11567
|
);
|
|
11032
11568
|
outputSingle(result2, ctx, COLUMNS8);
|
|
11033
11569
|
}
|
|
@@ -11036,11 +11572,11 @@ var assignmentsDomain = {
|
|
|
11036
11572
|
path: ["assignments", "messages", "list"],
|
|
11037
11573
|
description: "List messages for an assignment",
|
|
11038
11574
|
requiresWorkspace: true,
|
|
11039
|
-
args: [{ name: "id", description: "Assignment ID", required: true }],
|
|
11575
|
+
args: [{ name: "assignment-id", description: "Assignment ID", required: true }],
|
|
11040
11576
|
handler: async ({ ctx, workspace, args }) => {
|
|
11041
11577
|
const result2 = await ctx.apiClient.getAssignmentMessages(
|
|
11042
11578
|
workspace,
|
|
11043
|
-
requireNumber(args, "id")
|
|
11579
|
+
requireNumber(args, "assignment-id")
|
|
11044
11580
|
);
|
|
11045
11581
|
outputData(result2, ctx, MESSAGE_COLUMNS3);
|
|
11046
11582
|
}
|
|
@@ -11050,14 +11586,14 @@ var assignmentsDomain = {
|
|
|
11050
11586
|
description: "Get an assignment task",
|
|
11051
11587
|
requiresWorkspace: true,
|
|
11052
11588
|
args: [
|
|
11053
|
-
{ name: "id", description: "Assignment ID", required: true },
|
|
11054
|
-
{ name: "
|
|
11589
|
+
{ name: "assignment-id", description: "Assignment ID", required: true },
|
|
11590
|
+
{ name: "id", description: "Assignment task ID", required: true }
|
|
11055
11591
|
],
|
|
11056
11592
|
handler: async ({ ctx, workspace, args }) => {
|
|
11057
11593
|
const result2 = await ctx.apiClient.getAssignmentTask(
|
|
11058
11594
|
workspace,
|
|
11059
|
-
requireNumber(args, "id"),
|
|
11060
|
-
requireNumber(args, "
|
|
11595
|
+
requireNumber(args, "assignment-id"),
|
|
11596
|
+
requireNumber(args, "id")
|
|
11061
11597
|
);
|
|
11062
11598
|
outputSingle(result2, ctx, TASK_COLUMNS);
|
|
11063
11599
|
}
|
|
@@ -11066,11 +11602,11 @@ var assignmentsDomain = {
|
|
|
11066
11602
|
path: ["assignments", "tasks", "detail"],
|
|
11067
11603
|
description: "Get current task detail for an assignment",
|
|
11068
11604
|
requiresWorkspace: true,
|
|
11069
|
-
args: [{ name: "id", description: "Assignment ID", required: true }],
|
|
11605
|
+
args: [{ name: "assignment-id", description: "Assignment ID", required: true }],
|
|
11070
11606
|
handler: async ({ ctx, workspace, args }) => {
|
|
11071
11607
|
const result2 = await ctx.apiClient.getAssignmentTaskDetail(
|
|
11072
11608
|
workspace,
|
|
11073
|
-
requireNumber(args, "id")
|
|
11609
|
+
requireNumber(args, "assignment-id")
|
|
11074
11610
|
);
|
|
11075
11611
|
outputSingle(result2, ctx, TASK_COLUMNS);
|
|
11076
11612
|
}
|
|
@@ -11078,18 +11614,19 @@ var assignmentsDomain = {
|
|
|
11078
11614
|
{
|
|
11079
11615
|
path: ["assignments", "tasks", "select"],
|
|
11080
11616
|
description: "Select current assignment task",
|
|
11617
|
+
mutates: true,
|
|
11081
11618
|
requiresWorkspace: true,
|
|
11082
11619
|
args: [
|
|
11083
|
-
{ name: "id", description: "Assignment ID", required: true },
|
|
11084
|
-
{ name: "
|
|
11620
|
+
{ name: "assignment-id", description: "Assignment ID", required: true },
|
|
11621
|
+
{ name: "id", description: "Assignment task ID", required: true }
|
|
11085
11622
|
],
|
|
11086
11623
|
handler: async ({ ctx, workspace, args }) => {
|
|
11087
11624
|
await ctx.apiClient.selectCurrentAssignmentTask(
|
|
11088
11625
|
workspace,
|
|
11089
|
-
requireNumber(args, "id"),
|
|
11090
|
-
requireNumber(args, "
|
|
11626
|
+
requireNumber(args, "assignment-id"),
|
|
11627
|
+
requireNumber(args, "id")
|
|
11091
11628
|
);
|
|
11092
|
-
process.stdout.write(`Selected assignment task ${args
|
|
11629
|
+
process.stdout.write(`Selected assignment task ${args.id}
|
|
11093
11630
|
`);
|
|
11094
11631
|
}
|
|
11095
11632
|
},
|
|
@@ -11097,11 +11634,11 @@ var assignmentsDomain = {
|
|
|
11097
11634
|
path: ["assignments", "tools", "list"],
|
|
11098
11635
|
description: "List tools for an assignment",
|
|
11099
11636
|
requiresWorkspace: true,
|
|
11100
|
-
args: [{ name: "id", description: "Assignment ID", required: true }],
|
|
11637
|
+
args: [{ name: "assignment-id", description: "Assignment ID", required: true }],
|
|
11101
11638
|
handler: async ({ ctx, workspace, args }) => {
|
|
11102
11639
|
const result2 = await ctx.apiClient.getAssignmentTools(
|
|
11103
11640
|
workspace,
|
|
11104
|
-
requireNumber(args, "id")
|
|
11641
|
+
requireNumber(args, "assignment-id")
|
|
11105
11642
|
);
|
|
11106
11643
|
const tools = result2.tools ?? result2;
|
|
11107
11644
|
outputData(Array.isArray(tools) ? tools : [tools], ctx, TOOL_COLUMNS);
|
|
@@ -11183,10 +11720,7 @@ var dataTypesDomain = {
|
|
|
11183
11720
|
path: ["data-types", "records", "get"],
|
|
11184
11721
|
description: "Get a data record",
|
|
11185
11722
|
requiresWorkspace: true,
|
|
11186
|
-
args: [
|
|
11187
|
-
{ name: "data-type-id", description: "Data type ID", required: true },
|
|
11188
|
-
{ name: "id", description: "Record ID", required: true }
|
|
11189
|
-
],
|
|
11723
|
+
args: [{ name: "id", description: "Record ID", required: true }],
|
|
11190
11724
|
handler: async ({ ctx, workspace, args }) => {
|
|
11191
11725
|
const result2 = await ctx.apiClient.getDataRecord(workspace, requireNumber(args, "id"));
|
|
11192
11726
|
outputSingle(result2, ctx, RECORD_COLUMNS);
|
|
@@ -11530,9 +12064,12 @@ var eventsDomain = {
|
|
|
11530
12064
|
path: ["events", "rules", "executions"],
|
|
11531
12065
|
description: "List executions for an event rule",
|
|
11532
12066
|
requiresWorkspace: true,
|
|
11533
|
-
args: [{ name: "id", description: "Event rule ID"
|
|
11534
|
-
handler: async ({ ctx, workspace }) => {
|
|
11535
|
-
const
|
|
12067
|
+
args: [{ name: "rule-id", description: "Event rule ID" }],
|
|
12068
|
+
handler: async ({ ctx, workspace, args }) => {
|
|
12069
|
+
const ruleId = args["rule-id"] ? requireNumber(args, "rule-id") : void 0;
|
|
12070
|
+
const result2 = await ctx.apiClient.getRuleExecutions(workspace, {
|
|
12071
|
+
...ruleId ? { ruleId } : {}
|
|
12072
|
+
});
|
|
11536
12073
|
outputData(result2, ctx);
|
|
11537
12074
|
}
|
|
11538
12075
|
},
|
|
@@ -11566,9 +12103,12 @@ var eventsDomain = {
|
|
|
11566
12103
|
path: ["events", "custom", "runs"],
|
|
11567
12104
|
description: "List runs for a custom event",
|
|
11568
12105
|
requiresWorkspace: true,
|
|
11569
|
-
args: [{ name: "id", description: "Event ID"
|
|
11570
|
-
handler: async ({ ctx, workspace }) => {
|
|
11571
|
-
const
|
|
12106
|
+
args: [{ name: "event-id", description: "Event ID" }],
|
|
12107
|
+
handler: async ({ ctx, workspace, args }) => {
|
|
12108
|
+
const eventId = args["event-id"] ? requireNumber(args, "event-id") : void 0;
|
|
12109
|
+
const result2 = await ctx.apiClient.getEventRuns(workspace, {
|
|
12110
|
+
...eventId ? { eventId } : {}
|
|
12111
|
+
});
|
|
11572
12112
|
outputData(result2, ctx);
|
|
11573
12113
|
}
|
|
11574
12114
|
}
|
|
@@ -11681,11 +12221,14 @@ var calendarsDomain = {
|
|
|
11681
12221
|
// Events sub-resource
|
|
11682
12222
|
{
|
|
11683
12223
|
path: ["calendars", "events", "list"],
|
|
11684
|
-
description: "List events
|
|
12224
|
+
description: "List calendar events (optionally filter by calendar)",
|
|
11685
12225
|
requiresWorkspace: true,
|
|
11686
|
-
args: [{ name: "calendar-id", description: "Calendar ID
|
|
11687
|
-
handler: async ({ ctx, workspace }) => {
|
|
11688
|
-
const
|
|
12226
|
+
args: [{ name: "calendar-id", description: "Calendar ID (optional filter)" }],
|
|
12227
|
+
handler: async ({ ctx, workspace, args }) => {
|
|
12228
|
+
const calendarId = args["calendar-id"] ? requireNumber(args, "calendar-id") : void 0;
|
|
12229
|
+
const result2 = await ctx.apiClient.getCalendarEvents(workspace, {
|
|
12230
|
+
...calendarId ? { calendarId } : {}
|
|
12231
|
+
});
|
|
11689
12232
|
outputData(result2, ctx, EVENT_COLUMNS2);
|
|
11690
12233
|
}
|
|
11691
12234
|
},
|
|
@@ -11693,10 +12236,7 @@ var calendarsDomain = {
|
|
|
11693
12236
|
path: ["calendars", "events", "get"],
|
|
11694
12237
|
description: "Get a calendar event",
|
|
11695
12238
|
requiresWorkspace: true,
|
|
11696
|
-
args: [
|
|
11697
|
-
{ name: "calendar-id", description: "Calendar ID", required: true },
|
|
11698
|
-
{ name: "id", description: "Event ID", required: true }
|
|
11699
|
-
],
|
|
12239
|
+
args: [{ name: "id", description: "Event ID", required: true }],
|
|
11700
12240
|
handler: async ({ ctx, workspace, args }) => {
|
|
11701
12241
|
const result2 = await ctx.apiClient.getCalendarEvent(
|
|
11702
12242
|
workspace,
|
|
@@ -11710,7 +12250,6 @@ var calendarsDomain = {
|
|
|
11710
12250
|
description: "Create a calendar event",
|
|
11711
12251
|
mutates: true,
|
|
11712
12252
|
requiresWorkspace: true,
|
|
11713
|
-
args: [{ name: "calendar-id", description: "Calendar ID", required: true }],
|
|
11714
12253
|
handler: async ({ ctx, workspace, data }) => {
|
|
11715
12254
|
const result2 = await ctx.apiClient.createCalendarEvent(workspace, data);
|
|
11716
12255
|
outputSingle(result2, ctx, EVENT_COLUMNS2);
|
|
@@ -11721,10 +12260,7 @@ var calendarsDomain = {
|
|
|
11721
12260
|
description: "Update a calendar event",
|
|
11722
12261
|
mutates: true,
|
|
11723
12262
|
requiresWorkspace: true,
|
|
11724
|
-
args: [
|
|
11725
|
-
{ name: "calendar-id", description: "Calendar ID", required: true },
|
|
11726
|
-
{ name: "id", description: "Event ID", required: true }
|
|
11727
|
-
],
|
|
12263
|
+
args: [{ name: "id", description: "Event ID", required: true }],
|
|
11728
12264
|
handler: async ({ ctx, workspace, args, data }) => {
|
|
11729
12265
|
const result2 = await ctx.apiClient.updateCalendarEvent(
|
|
11730
12266
|
workspace,
|
|
@@ -11739,10 +12275,7 @@ var calendarsDomain = {
|
|
|
11739
12275
|
description: "Cancel a calendar event",
|
|
11740
12276
|
mutates: true,
|
|
11741
12277
|
requiresWorkspace: true,
|
|
11742
|
-
args: [
|
|
11743
|
-
{ name: "calendar-id", description: "Calendar ID", required: true },
|
|
11744
|
-
{ name: "id", description: "Event ID", required: true }
|
|
11745
|
-
],
|
|
12278
|
+
args: [{ name: "id", description: "Event ID", required: true }],
|
|
11746
12279
|
handler: async ({ ctx, workspace, args }) => {
|
|
11747
12280
|
const result2 = await ctx.apiClient.cancelCalendarEvent(
|
|
11748
12281
|
workspace,
|
|
@@ -11756,10 +12289,7 @@ var calendarsDomain = {
|
|
|
11756
12289
|
description: "Delete a calendar event",
|
|
11757
12290
|
mutates: true,
|
|
11758
12291
|
requiresWorkspace: true,
|
|
11759
|
-
args: [
|
|
11760
|
-
{ name: "calendar-id", description: "Calendar ID", required: true },
|
|
11761
|
-
{ name: "id", description: "Event ID", required: true }
|
|
11762
|
-
],
|
|
12292
|
+
args: [{ name: "id", description: "Event ID", required: true }],
|
|
11763
12293
|
handler: async ({ ctx, workspace, args }) => {
|
|
11764
12294
|
await ctx.apiClient.deleteCalendarEvent(workspace, requireNumber(args, "id"));
|
|
11765
12295
|
process.stdout.write(`Deleted calendar event ${args.id}
|
|
@@ -11769,9 +12299,8 @@ var calendarsDomain = {
|
|
|
11769
12299
|
// Event types sub-resource
|
|
11770
12300
|
{
|
|
11771
12301
|
path: ["calendars", "event-types", "list"],
|
|
11772
|
-
description: "List event types
|
|
12302
|
+
description: "List calendar event types",
|
|
11773
12303
|
requiresWorkspace: true,
|
|
11774
|
-
args: [{ name: "calendar-id", description: "Calendar ID", required: true }],
|
|
11775
12304
|
handler: async ({ ctx, workspace }) => {
|
|
11776
12305
|
const result2 = await ctx.apiClient.getCalendarEventTypes(workspace);
|
|
11777
12306
|
outputData(result2, ctx, EVENT_TYPE_COLUMNS);
|
|
@@ -11781,10 +12310,7 @@ var calendarsDomain = {
|
|
|
11781
12310
|
path: ["calendars", "event-types", "get"],
|
|
11782
12311
|
description: "Get a calendar event type",
|
|
11783
12312
|
requiresWorkspace: true,
|
|
11784
|
-
args: [
|
|
11785
|
-
{ name: "calendar-id", description: "Calendar ID", required: true },
|
|
11786
|
-
{ name: "id", description: "Event type ID", required: true }
|
|
11787
|
-
],
|
|
12313
|
+
args: [{ name: "id", description: "Event type ID", required: true }],
|
|
11788
12314
|
handler: async ({ ctx, workspace, args }) => {
|
|
11789
12315
|
const result2 = await ctx.apiClient.getCalendarEventType(
|
|
11790
12316
|
workspace,
|
|
@@ -11798,7 +12324,6 @@ var calendarsDomain = {
|
|
|
11798
12324
|
description: "Create a calendar event type",
|
|
11799
12325
|
mutates: true,
|
|
11800
12326
|
requiresWorkspace: true,
|
|
11801
|
-
args: [{ name: "calendar-id", description: "Calendar ID", required: true }],
|
|
11802
12327
|
handler: async ({ ctx, workspace, data }) => {
|
|
11803
12328
|
const result2 = await ctx.apiClient.createCalendarEventType(workspace, data);
|
|
11804
12329
|
outputSingle(result2, ctx, EVENT_TYPE_COLUMNS);
|
|
@@ -11809,10 +12334,7 @@ var calendarsDomain = {
|
|
|
11809
12334
|
description: "Update a calendar event type",
|
|
11810
12335
|
mutates: true,
|
|
11811
12336
|
requiresWorkspace: true,
|
|
11812
|
-
args: [
|
|
11813
|
-
{ name: "calendar-id", description: "Calendar ID", required: true },
|
|
11814
|
-
{ name: "id", description: "Event type ID", required: true }
|
|
11815
|
-
],
|
|
12337
|
+
args: [{ name: "id", description: "Event type ID", required: true }],
|
|
11816
12338
|
handler: async ({ ctx, workspace, args, data }) => {
|
|
11817
12339
|
const result2 = await ctx.apiClient.updateCalendarEventType(
|
|
11818
12340
|
workspace,
|
|
@@ -11827,10 +12349,7 @@ var calendarsDomain = {
|
|
|
11827
12349
|
description: "Delete a calendar event type",
|
|
11828
12350
|
mutates: true,
|
|
11829
12351
|
requiresWorkspace: true,
|
|
11830
|
-
args: [
|
|
11831
|
-
{ name: "calendar-id", description: "Calendar ID", required: true },
|
|
11832
|
-
{ name: "id", description: "Event type ID", required: true }
|
|
11833
|
-
],
|
|
12352
|
+
args: [{ name: "id", description: "Event type ID", required: true }],
|
|
11834
12353
|
handler: async ({ ctx, workspace, args }) => {
|
|
11835
12354
|
await ctx.apiClient.deleteCalendarEventType(workspace, requireNumber(args, "id"));
|
|
11836
12355
|
process.stdout.write(`Deleted event type ${args.id}
|
|
@@ -12024,27 +12543,27 @@ var phoneNumbersDomain = {
|
|
|
12024
12543
|
}
|
|
12025
12544
|
},
|
|
12026
12545
|
{
|
|
12027
|
-
path: ["phone-numbers", "calls"],
|
|
12546
|
+
path: ["phone-numbers", "calls", "list"],
|
|
12028
12547
|
description: "List calls for a phone number",
|
|
12029
12548
|
requiresWorkspace: true,
|
|
12030
|
-
args: [{ name: "id", description: "Phone number ID", required: true }],
|
|
12549
|
+
args: [{ name: "phone-number-id", description: "Phone number ID", required: true }],
|
|
12031
12550
|
handler: async ({ ctx, workspace, args }) => {
|
|
12032
12551
|
const result2 = await ctx.apiClient.getPhoneNumberCalls(
|
|
12033
12552
|
workspace,
|
|
12034
|
-
requireNumber(args, "id")
|
|
12553
|
+
requireNumber(args, "phone-number-id")
|
|
12035
12554
|
);
|
|
12036
12555
|
outputData(result2, ctx);
|
|
12037
12556
|
}
|
|
12038
12557
|
},
|
|
12039
12558
|
{
|
|
12040
|
-
path: ["phone-numbers", "messages"],
|
|
12559
|
+
path: ["phone-numbers", "messages", "list"],
|
|
12041
12560
|
description: "List messages for a phone number",
|
|
12042
12561
|
requiresWorkspace: true,
|
|
12043
|
-
args: [{ name: "id", description: "Phone number ID", required: true }],
|
|
12562
|
+
args: [{ name: "phone-number-id", description: "Phone number ID", required: true }],
|
|
12044
12563
|
handler: async ({ ctx, workspace, args }) => {
|
|
12045
12564
|
const result2 = await ctx.apiClient.getPhoneNumberMessages(
|
|
12046
12565
|
workspace,
|
|
12047
|
-
requireNumber(args, "id")
|
|
12566
|
+
requireNumber(args, "phone-number-id")
|
|
12048
12567
|
);
|
|
12049
12568
|
outputData(result2, ctx);
|
|
12050
12569
|
}
|
|
@@ -12079,77 +12598,80 @@ var inboxesDomain = {
|
|
|
12079
12598
|
columns: COLUMNS15
|
|
12080
12599
|
}),
|
|
12081
12600
|
{
|
|
12082
|
-
path: ["inboxes", "emails"],
|
|
12601
|
+
path: ["inboxes", "emails", "list"],
|
|
12083
12602
|
description: "List emails in an inbox",
|
|
12084
12603
|
requiresWorkspace: true,
|
|
12085
|
-
args: [{ name: "id", description: "Inbox ID", required: true }],
|
|
12604
|
+
args: [{ name: "inbox-id", description: "Inbox ID", required: true }],
|
|
12086
12605
|
handler: async ({ ctx, workspace, args }) => {
|
|
12087
|
-
const result2 = await ctx.apiClient.getInboxEmails(
|
|
12606
|
+
const result2 = await ctx.apiClient.getInboxEmails(
|
|
12607
|
+
workspace,
|
|
12608
|
+
requireNumber(args, "inbox-id")
|
|
12609
|
+
);
|
|
12088
12610
|
outputData(result2, ctx, EMAIL_COLUMNS);
|
|
12089
12611
|
}
|
|
12090
12612
|
},
|
|
12091
12613
|
{
|
|
12092
|
-
path: ["inboxes", "
|
|
12614
|
+
path: ["inboxes", "emails", "get"],
|
|
12093
12615
|
description: "Get a specific email",
|
|
12094
12616
|
requiresWorkspace: true,
|
|
12095
12617
|
args: [
|
|
12096
12618
|
{ name: "inbox-id", description: "Inbox ID", required: true },
|
|
12097
|
-
{ name: "
|
|
12619
|
+
{ name: "id", description: "Email ID", required: true }
|
|
12098
12620
|
],
|
|
12099
12621
|
handler: async ({ ctx, workspace, args }) => {
|
|
12100
12622
|
const result2 = await ctx.apiClient.getInboxEmail(
|
|
12101
12623
|
workspace,
|
|
12102
12624
|
requireNumber(args, "inbox-id"),
|
|
12103
|
-
requireNumber(args, "
|
|
12625
|
+
requireNumber(args, "id")
|
|
12104
12626
|
);
|
|
12105
12627
|
outputSingle(result2, ctx, EMAIL_COLUMNS);
|
|
12106
12628
|
}
|
|
12107
12629
|
},
|
|
12108
12630
|
{
|
|
12109
|
-
path: ["inboxes", "threads"],
|
|
12631
|
+
path: ["inboxes", "emails", "threads"],
|
|
12110
12632
|
description: "List email threads in an inbox",
|
|
12111
12633
|
requiresWorkspace: true,
|
|
12112
|
-
args: [{ name: "id", description: "Inbox ID", required: true }],
|
|
12634
|
+
args: [{ name: "inbox-id", description: "Inbox ID", required: true }],
|
|
12113
12635
|
handler: async ({ ctx, workspace, args }) => {
|
|
12114
12636
|
const result2 = await ctx.apiClient.getInboxThreads(
|
|
12115
12637
|
workspace,
|
|
12116
|
-
requireNumber(args, "id")
|
|
12638
|
+
requireNumber(args, "inbox-id")
|
|
12117
12639
|
);
|
|
12118
12640
|
outputData(result2, ctx);
|
|
12119
12641
|
}
|
|
12120
12642
|
},
|
|
12121
12643
|
{
|
|
12122
|
-
path: ["inboxes", "mark-read"],
|
|
12644
|
+
path: ["inboxes", "emails", "mark-read"],
|
|
12123
12645
|
description: "Mark an email as read",
|
|
12124
12646
|
mutates: true,
|
|
12125
12647
|
requiresWorkspace: true,
|
|
12126
12648
|
args: [
|
|
12127
12649
|
{ name: "inbox-id", description: "Inbox ID", required: true },
|
|
12128
|
-
{ name: "
|
|
12650
|
+
{ name: "id", description: "Email ID", required: true }
|
|
12129
12651
|
],
|
|
12130
12652
|
handler: async ({ ctx, workspace, args }) => {
|
|
12131
12653
|
await ctx.apiClient.markEmailAsRead(
|
|
12132
12654
|
workspace,
|
|
12133
12655
|
requireNumber(args, "inbox-id"),
|
|
12134
|
-
requireNumber(args, "
|
|
12656
|
+
requireNumber(args, "id")
|
|
12135
12657
|
);
|
|
12136
12658
|
process.stdout.write("Email marked as read\n");
|
|
12137
12659
|
}
|
|
12138
12660
|
},
|
|
12139
12661
|
{
|
|
12140
|
-
path: ["inboxes", "mark-unread"],
|
|
12662
|
+
path: ["inboxes", "emails", "mark-unread"],
|
|
12141
12663
|
description: "Mark an email as unread",
|
|
12142
12664
|
mutates: true,
|
|
12143
12665
|
requiresWorkspace: true,
|
|
12144
12666
|
args: [
|
|
12145
12667
|
{ name: "inbox-id", description: "Inbox ID", required: true },
|
|
12146
|
-
{ name: "
|
|
12668
|
+
{ name: "id", description: "Email ID", required: true }
|
|
12147
12669
|
],
|
|
12148
12670
|
handler: async ({ ctx, workspace, args }) => {
|
|
12149
12671
|
await ctx.apiClient.markEmailAsUnread(
|
|
12150
12672
|
workspace,
|
|
12151
12673
|
requireNumber(args, "inbox-id"),
|
|
12152
|
-
requireNumber(args, "
|
|
12674
|
+
requireNumber(args, "id")
|
|
12153
12675
|
);
|
|
12154
12676
|
process.stdout.write("Email marked as unread\n");
|
|
12155
12677
|
}
|
|
@@ -12499,14 +13021,14 @@ var mcpServersDomain = {
|
|
|
12499
13021
|
}
|
|
12500
13022
|
},
|
|
12501
13023
|
{
|
|
12502
|
-
path: ["mcp-servers", "tools"],
|
|
13024
|
+
path: ["mcp-servers", "tools", "list"],
|
|
12503
13025
|
description: "List tools for an MCP server",
|
|
12504
13026
|
requiresWorkspace: true,
|
|
12505
|
-
args: [{ name: "id", description: "MCP server ID", required: true }],
|
|
13027
|
+
args: [{ name: "mcp-server-id", description: "MCP server ID", required: true }],
|
|
12506
13028
|
handler: async ({ ctx, workspace, args }) => {
|
|
12507
13029
|
const result2 = await ctx.apiClient.getMcpServerTools(
|
|
12508
13030
|
workspace,
|
|
12509
|
-
requireNumber(args, "id")
|
|
13031
|
+
requireNumber(args, "mcp-server-id")
|
|
12510
13032
|
);
|
|
12511
13033
|
outputData(result2, ctx);
|
|
12512
13034
|
}
|
|
@@ -12556,7 +13078,7 @@ var apiKeysDomain = {
|
|
|
12556
13078
|
}
|
|
12557
13079
|
},
|
|
12558
13080
|
{
|
|
12559
|
-
path: ["api-keys", "global
|
|
13081
|
+
path: ["api-keys", "global", "list"],
|
|
12560
13082
|
description: "List global/account-level API keys",
|
|
12561
13083
|
requiresWorkspace: false,
|
|
12562
13084
|
handler: async ({ ctx }) => {
|
|
@@ -12565,8 +13087,9 @@ var apiKeysDomain = {
|
|
|
12565
13087
|
}
|
|
12566
13088
|
},
|
|
12567
13089
|
{
|
|
12568
|
-
path: ["api-keys", "global
|
|
13090
|
+
path: ["api-keys", "global", "create"],
|
|
12569
13091
|
description: "Create a global/account-level API key",
|
|
13092
|
+
mutates: true,
|
|
12570
13093
|
requiresWorkspace: false,
|
|
12571
13094
|
handler: async ({ ctx, data }) => {
|
|
12572
13095
|
const result2 = await ctx.apiClient.createGlobalApiKey(data);
|
|
@@ -12574,8 +13097,9 @@ var apiKeysDomain = {
|
|
|
12574
13097
|
}
|
|
12575
13098
|
},
|
|
12576
13099
|
{
|
|
12577
|
-
path: ["api-keys", "global
|
|
13100
|
+
path: ["api-keys", "global", "revoke"],
|
|
12578
13101
|
description: "Revoke a global/account-level API key",
|
|
13102
|
+
mutates: true,
|
|
12579
13103
|
requiresWorkspace: false,
|
|
12580
13104
|
args: [{ name: "id", description: "API key ID", required: true }],
|
|
12581
13105
|
handler: async ({ ctx, args }) => {
|