@rymi/node 2.1.0 → 2.3.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/README.md +8 -0
- package/dist/index.d.mts +74 -1
- package/dist/index.d.ts +74 -1
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,9 @@ yarn add @rymi/node
|
|
|
43
43
|
import { Rymi } from '@rymi/node';
|
|
44
44
|
|
|
45
45
|
const rymi = new Rymi({ apiKey: process.env.RYMI_API_KEY });
|
|
46
|
+
// Optional: act in another workspace you can reach.
|
|
47
|
+
// const rymi = new Rymi({ apiKey: process.env.RYMI_API_KEY, workspace: 'workspace-id' });
|
|
48
|
+
// Or set RYMI_WORKSPACE. The client sends it as the Rymi-Workspace header.
|
|
46
49
|
|
|
47
50
|
// Create a voice agent
|
|
48
51
|
const agent = await rymi.agents.create({
|
|
@@ -75,6 +78,11 @@ The client exposes one namespace per resource group:
|
|
|
75
78
|
| `templates` | Prebuilt agent templates |
|
|
76
79
|
| `webhooks` | Create webhooks and verify incoming signatures |
|
|
77
80
|
| `dnc` | Do-not-call list management |
|
|
81
|
+
| `campaigns` | Outbound/inbound calling campaigns: members, launch/pause, reports, improvement suggestions, inbound routes, and the lead-intake URL (`campaigns.intake`) |
|
|
82
|
+
| `contacts` | Contacts and per-channel consent |
|
|
83
|
+
| `compliance` | Compliance attestations (e.g. an external DNC scrub) |
|
|
84
|
+
| `toolSecrets` | Secrets for API-tool headers, referenced as `{{secrets.NAME}}` |
|
|
85
|
+
| `workspaces` | List, create and rename workspaces. Pass `workspace` (or `RYMI_WORKSPACE`) to act in one of them. A workspace you create does not get the free monthly credit. You can own at most 20. |
|
|
78
86
|
|
|
79
87
|
## 📖 Documentation
|
|
80
88
|
|
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,11 @@ interface ClientOptions {
|
|
|
15
15
|
* network socket (e.g. Fastify app.inject). Defaults to global fetch.
|
|
16
16
|
*/
|
|
17
17
|
fetch?: typeof globalThis.fetch;
|
|
18
|
+
/**
|
|
19
|
+
* Act in this workspace (sent as `Rymi-Workspace`). Defaults to the
|
|
20
|
+
* `RYMI_WORKSPACE` environment variable, else the key's own workspace.
|
|
21
|
+
*/
|
|
22
|
+
workspace?: string;
|
|
18
23
|
}
|
|
19
24
|
declare class RymiError extends Error {
|
|
20
25
|
status?: number;
|
|
@@ -25,6 +30,7 @@ declare class RymiClient {
|
|
|
25
30
|
private apiKey;
|
|
26
31
|
private baseURL;
|
|
27
32
|
private fetchImpl;
|
|
33
|
+
private workspace?;
|
|
28
34
|
constructor(options?: ClientOptions);
|
|
29
35
|
private request;
|
|
30
36
|
get<T>(path: string): Promise<T>;
|
|
@@ -1149,10 +1155,46 @@ interface CampaignSuggestionListResponse {
|
|
|
1149
1155
|
offset: number;
|
|
1150
1156
|
limit: number;
|
|
1151
1157
|
}
|
|
1158
|
+
/** A campaign's lead-intake URL settings. The URL itself is only returned on create/rotate. */
|
|
1159
|
+
interface CampaignIntake {
|
|
1160
|
+
enabled: true;
|
|
1161
|
+
assume_voice_consent: boolean;
|
|
1162
|
+
default_country: string | null;
|
|
1163
|
+
created_at: string;
|
|
1164
|
+
rotated_at: string;
|
|
1165
|
+
last_used_at: string | null;
|
|
1166
|
+
}
|
|
1167
|
+
interface CampaignIntakeSettings {
|
|
1168
|
+
/** Treat every lead posted to the URL as having voice consent (e.g. a subscribe form with a consent line). */
|
|
1169
|
+
assume_voice_consent?: boolean;
|
|
1170
|
+
/** ISO-3166 alpha-2 (e.g. "IN") used for numbers posted without a +country code. */
|
|
1171
|
+
default_country?: string | null;
|
|
1172
|
+
}
|
|
1173
|
+
declare class CampaignIntakeResource {
|
|
1174
|
+
private client;
|
|
1175
|
+
constructor(client: RymiClient);
|
|
1176
|
+
/** Get the campaign's lead-intake settings, or `intake: null` if it has none. */
|
|
1177
|
+
get(campaignId: string): Promise<{
|
|
1178
|
+
intake: CampaignIntake | null;
|
|
1179
|
+
}>;
|
|
1180
|
+
/** Create the lead-intake URL (returned once as `url`), or update its settings (`url: null`). */
|
|
1181
|
+
set(campaignId: string, settings?: CampaignIntakeSettings): Promise<{
|
|
1182
|
+
intake: CampaignIntake;
|
|
1183
|
+
url: string | null;
|
|
1184
|
+
}>;
|
|
1185
|
+
/** Issue a new URL. The old one stops accepting leads immediately. */
|
|
1186
|
+
rotate(campaignId: string): Promise<{
|
|
1187
|
+
intake: CampaignIntake;
|
|
1188
|
+
url: string;
|
|
1189
|
+
}>;
|
|
1190
|
+
/** Remove the lead-intake URL. */
|
|
1191
|
+
disable(campaignId: string): Promise<void>;
|
|
1192
|
+
}
|
|
1152
1193
|
declare class CampaignsResource {
|
|
1153
1194
|
private client;
|
|
1154
1195
|
members: CampaignMembersResource;
|
|
1155
1196
|
routes: CampaignRoutesResource;
|
|
1197
|
+
intake: CampaignIntakeResource;
|
|
1156
1198
|
constructor(client: RymiClient);
|
|
1157
1199
|
/** List campaigns for the authenticated tenant, paginated. */
|
|
1158
1200
|
list(params?: ListCampaignsParams): Promise<CampaignListResponse>;
|
|
@@ -1372,6 +1414,36 @@ declare class ToolSecretsResource {
|
|
|
1372
1414
|
}>;
|
|
1373
1415
|
}
|
|
1374
1416
|
|
|
1417
|
+
interface Workspace {
|
|
1418
|
+
id: string;
|
|
1419
|
+
name: string;
|
|
1420
|
+
role: 'owner' | 'admin' | 'client';
|
|
1421
|
+
parent_id: string | null;
|
|
1422
|
+
operating_country: string | null;
|
|
1423
|
+
current?: boolean;
|
|
1424
|
+
}
|
|
1425
|
+
interface CreateWorkspaceParams {
|
|
1426
|
+
name: string;
|
|
1427
|
+
/** ISO-3166 alpha-2, e.g. "IN". */
|
|
1428
|
+
operating_country?: string | null;
|
|
1429
|
+
}
|
|
1430
|
+
declare class WorkspacesResource {
|
|
1431
|
+
private client;
|
|
1432
|
+
constructor(client: RymiClient);
|
|
1433
|
+
list(): Promise<{
|
|
1434
|
+
workspaces: Workspace[];
|
|
1435
|
+
}>;
|
|
1436
|
+
create(data: CreateWorkspaceParams): Promise<{
|
|
1437
|
+
workspace: Workspace;
|
|
1438
|
+
}>;
|
|
1439
|
+
update(id: string, data: {
|
|
1440
|
+
name?: string;
|
|
1441
|
+
operating_country?: string | null;
|
|
1442
|
+
}): Promise<{
|
|
1443
|
+
ok: true;
|
|
1444
|
+
}>;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1375
1447
|
declare class Rymi {
|
|
1376
1448
|
private client;
|
|
1377
1449
|
agents: AgentsResource;
|
|
@@ -1387,7 +1459,8 @@ declare class Rymi {
|
|
|
1387
1459
|
contacts: ContactsResource;
|
|
1388
1460
|
compliance: ComplianceResource;
|
|
1389
1461
|
toolSecrets: ToolSecretsResource;
|
|
1462
|
+
workspaces: WorkspacesResource;
|
|
1390
1463
|
constructor(options?: ClientOptions);
|
|
1391
1464
|
}
|
|
1392
1465
|
|
|
1393
|
-
export { type AddCampaignMembersParams, type AddKnowledgeSourceParams, type AgentCallListResponse, type AgentChange, type AgentKnowledgeSource, type AgentListResponse, type AgentShareLink, type AgentShareLinkSettings, type AgentTemplateSummary, AgentsResource, type ApplyChangesParams, type ApplyChangesResponse, type AttestParams, type AttestResponse, type Attestation, type BatchCallParams, BillingResource, type CallListResponse, type CallRecord, CallsResource, type CampaignAttemptListResponse, type CampaignBatch, type CampaignBatchListResponse, type CampaignFollowupJob, type CampaignFollowupListResponse, type CampaignListResponse, type CampaignMemberListResponse, type CampaignReportResponse, type CampaignRoute, type CampaignRouteListResponse, type CampaignSuggestion, type CampaignSuggestionListResponse, CampaignsResource, type ChangeEntry, type ClientOptions, ComplianceResource, type ConnectTelephonyParams, type ContactListResponse, ContactsResource, type CreateAgentParams, type CreateCallParams, type CreateCallResponse, type CreateCampaignParams, type CreateCampaignRouteParams, type CreateContactParams, type CreateContactResponse, type CreatePublishableKeyParams, type DncCheckResult, type DncEntry, type DncListResponse, DncResource, type EnrichCompanyParams, type EnrichCompanyResponse, type FanoutCallParams, type ImportCampaignMembersParams, type ImportCampaignMembersResponse, type ImportContactsParams, type ImportContactsResponse, type ImproveCampaignResponse, KeysResource, type LaunchBlocker, type LaunchCampaignResponse, type ListAttestationsResponse, type ListCallsParams, type ListCampaignAttemptsParams, type ListCampaignBatchesParams, type ListCampaignFollowupsParams, type ListCampaignMembersParams, type ListCampaignRoutesParams, type ListCampaignSuggestionsParams, type ListCampaignsParams, type ListContactsParams, type NumberRecord, NumbersResource, type PreviewStackParams, type PublishAgentResponse, type PublishValidationIssue, type PublishableKeyRecord, Rymi, RymiClient, RymiError, type SetConsentParams, type SetConsentResponse, type TelephonyProvider, TelephonyResource, TemplatesResource, type ToolSecretRecord, ToolSecretsResource, type UpdateAgentParams, type UpdateCampaignMemberParams, type UpdateCampaignParams, type UpdateCampaignRouteParams, type UpdateContactParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, Rymi as default };
|
|
1466
|
+
export { type AddCampaignMembersParams, type AddKnowledgeSourceParams, type AgentCallListResponse, type AgentChange, type AgentKnowledgeSource, type AgentListResponse, type AgentShareLink, type AgentShareLinkSettings, type AgentTemplateSummary, AgentsResource, type ApplyChangesParams, type ApplyChangesResponse, type AttestParams, type AttestResponse, type Attestation, type BatchCallParams, BillingResource, type CallListResponse, type CallRecord, CallsResource, type CampaignAttemptListResponse, type CampaignBatch, type CampaignBatchListResponse, type CampaignFollowupJob, type CampaignFollowupListResponse, type CampaignIntake, type CampaignIntakeSettings, type CampaignListResponse, type CampaignMemberListResponse, type CampaignReportResponse, type CampaignRoute, type CampaignRouteListResponse, type CampaignSuggestion, type CampaignSuggestionListResponse, CampaignsResource, type ChangeEntry, type ClientOptions, ComplianceResource, type ConnectTelephonyParams, type ContactListResponse, ContactsResource, type CreateAgentParams, type CreateCallParams, type CreateCallResponse, type CreateCampaignParams, type CreateCampaignRouteParams, type CreateContactParams, type CreateContactResponse, type CreatePublishableKeyParams, type CreateWorkspaceParams, type DncCheckResult, type DncEntry, type DncListResponse, DncResource, type EnrichCompanyParams, type EnrichCompanyResponse, type FanoutCallParams, type ImportCampaignMembersParams, type ImportCampaignMembersResponse, type ImportContactsParams, type ImportContactsResponse, type ImproveCampaignResponse, KeysResource, type LaunchBlocker, type LaunchCampaignResponse, type ListAttestationsResponse, type ListCallsParams, type ListCampaignAttemptsParams, type ListCampaignBatchesParams, type ListCampaignFollowupsParams, type ListCampaignMembersParams, type ListCampaignRoutesParams, type ListCampaignSuggestionsParams, type ListCampaignsParams, type ListContactsParams, type NumberRecord, NumbersResource, type PreviewStackParams, type PublishAgentResponse, type PublishValidationIssue, type PublishableKeyRecord, Rymi, RymiClient, RymiError, type SetConsentParams, type SetConsentResponse, type TelephonyProvider, TelephonyResource, TemplatesResource, type ToolSecretRecord, ToolSecretsResource, type UpdateAgentParams, type UpdateCampaignMemberParams, type UpdateCampaignParams, type UpdateCampaignRouteParams, type UpdateContactParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, type Workspace, WorkspacesResource, Rymi as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ interface ClientOptions {
|
|
|
15
15
|
* network socket (e.g. Fastify app.inject). Defaults to global fetch.
|
|
16
16
|
*/
|
|
17
17
|
fetch?: typeof globalThis.fetch;
|
|
18
|
+
/**
|
|
19
|
+
* Act in this workspace (sent as `Rymi-Workspace`). Defaults to the
|
|
20
|
+
* `RYMI_WORKSPACE` environment variable, else the key's own workspace.
|
|
21
|
+
*/
|
|
22
|
+
workspace?: string;
|
|
18
23
|
}
|
|
19
24
|
declare class RymiError extends Error {
|
|
20
25
|
status?: number;
|
|
@@ -25,6 +30,7 @@ declare class RymiClient {
|
|
|
25
30
|
private apiKey;
|
|
26
31
|
private baseURL;
|
|
27
32
|
private fetchImpl;
|
|
33
|
+
private workspace?;
|
|
28
34
|
constructor(options?: ClientOptions);
|
|
29
35
|
private request;
|
|
30
36
|
get<T>(path: string): Promise<T>;
|
|
@@ -1149,10 +1155,46 @@ interface CampaignSuggestionListResponse {
|
|
|
1149
1155
|
offset: number;
|
|
1150
1156
|
limit: number;
|
|
1151
1157
|
}
|
|
1158
|
+
/** A campaign's lead-intake URL settings. The URL itself is only returned on create/rotate. */
|
|
1159
|
+
interface CampaignIntake {
|
|
1160
|
+
enabled: true;
|
|
1161
|
+
assume_voice_consent: boolean;
|
|
1162
|
+
default_country: string | null;
|
|
1163
|
+
created_at: string;
|
|
1164
|
+
rotated_at: string;
|
|
1165
|
+
last_used_at: string | null;
|
|
1166
|
+
}
|
|
1167
|
+
interface CampaignIntakeSettings {
|
|
1168
|
+
/** Treat every lead posted to the URL as having voice consent (e.g. a subscribe form with a consent line). */
|
|
1169
|
+
assume_voice_consent?: boolean;
|
|
1170
|
+
/** ISO-3166 alpha-2 (e.g. "IN") used for numbers posted without a +country code. */
|
|
1171
|
+
default_country?: string | null;
|
|
1172
|
+
}
|
|
1173
|
+
declare class CampaignIntakeResource {
|
|
1174
|
+
private client;
|
|
1175
|
+
constructor(client: RymiClient);
|
|
1176
|
+
/** Get the campaign's lead-intake settings, or `intake: null` if it has none. */
|
|
1177
|
+
get(campaignId: string): Promise<{
|
|
1178
|
+
intake: CampaignIntake | null;
|
|
1179
|
+
}>;
|
|
1180
|
+
/** Create the lead-intake URL (returned once as `url`), or update its settings (`url: null`). */
|
|
1181
|
+
set(campaignId: string, settings?: CampaignIntakeSettings): Promise<{
|
|
1182
|
+
intake: CampaignIntake;
|
|
1183
|
+
url: string | null;
|
|
1184
|
+
}>;
|
|
1185
|
+
/** Issue a new URL. The old one stops accepting leads immediately. */
|
|
1186
|
+
rotate(campaignId: string): Promise<{
|
|
1187
|
+
intake: CampaignIntake;
|
|
1188
|
+
url: string;
|
|
1189
|
+
}>;
|
|
1190
|
+
/** Remove the lead-intake URL. */
|
|
1191
|
+
disable(campaignId: string): Promise<void>;
|
|
1192
|
+
}
|
|
1152
1193
|
declare class CampaignsResource {
|
|
1153
1194
|
private client;
|
|
1154
1195
|
members: CampaignMembersResource;
|
|
1155
1196
|
routes: CampaignRoutesResource;
|
|
1197
|
+
intake: CampaignIntakeResource;
|
|
1156
1198
|
constructor(client: RymiClient);
|
|
1157
1199
|
/** List campaigns for the authenticated tenant, paginated. */
|
|
1158
1200
|
list(params?: ListCampaignsParams): Promise<CampaignListResponse>;
|
|
@@ -1372,6 +1414,36 @@ declare class ToolSecretsResource {
|
|
|
1372
1414
|
}>;
|
|
1373
1415
|
}
|
|
1374
1416
|
|
|
1417
|
+
interface Workspace {
|
|
1418
|
+
id: string;
|
|
1419
|
+
name: string;
|
|
1420
|
+
role: 'owner' | 'admin' | 'client';
|
|
1421
|
+
parent_id: string | null;
|
|
1422
|
+
operating_country: string | null;
|
|
1423
|
+
current?: boolean;
|
|
1424
|
+
}
|
|
1425
|
+
interface CreateWorkspaceParams {
|
|
1426
|
+
name: string;
|
|
1427
|
+
/** ISO-3166 alpha-2, e.g. "IN". */
|
|
1428
|
+
operating_country?: string | null;
|
|
1429
|
+
}
|
|
1430
|
+
declare class WorkspacesResource {
|
|
1431
|
+
private client;
|
|
1432
|
+
constructor(client: RymiClient);
|
|
1433
|
+
list(): Promise<{
|
|
1434
|
+
workspaces: Workspace[];
|
|
1435
|
+
}>;
|
|
1436
|
+
create(data: CreateWorkspaceParams): Promise<{
|
|
1437
|
+
workspace: Workspace;
|
|
1438
|
+
}>;
|
|
1439
|
+
update(id: string, data: {
|
|
1440
|
+
name?: string;
|
|
1441
|
+
operating_country?: string | null;
|
|
1442
|
+
}): Promise<{
|
|
1443
|
+
ok: true;
|
|
1444
|
+
}>;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1375
1447
|
declare class Rymi {
|
|
1376
1448
|
private client;
|
|
1377
1449
|
agents: AgentsResource;
|
|
@@ -1387,7 +1459,8 @@ declare class Rymi {
|
|
|
1387
1459
|
contacts: ContactsResource;
|
|
1388
1460
|
compliance: ComplianceResource;
|
|
1389
1461
|
toolSecrets: ToolSecretsResource;
|
|
1462
|
+
workspaces: WorkspacesResource;
|
|
1390
1463
|
constructor(options?: ClientOptions);
|
|
1391
1464
|
}
|
|
1392
1465
|
|
|
1393
|
-
export { type AddCampaignMembersParams, type AddKnowledgeSourceParams, type AgentCallListResponse, type AgentChange, type AgentKnowledgeSource, type AgentListResponse, type AgentShareLink, type AgentShareLinkSettings, type AgentTemplateSummary, AgentsResource, type ApplyChangesParams, type ApplyChangesResponse, type AttestParams, type AttestResponse, type Attestation, type BatchCallParams, BillingResource, type CallListResponse, type CallRecord, CallsResource, type CampaignAttemptListResponse, type CampaignBatch, type CampaignBatchListResponse, type CampaignFollowupJob, type CampaignFollowupListResponse, type CampaignListResponse, type CampaignMemberListResponse, type CampaignReportResponse, type CampaignRoute, type CampaignRouteListResponse, type CampaignSuggestion, type CampaignSuggestionListResponse, CampaignsResource, type ChangeEntry, type ClientOptions, ComplianceResource, type ConnectTelephonyParams, type ContactListResponse, ContactsResource, type CreateAgentParams, type CreateCallParams, type CreateCallResponse, type CreateCampaignParams, type CreateCampaignRouteParams, type CreateContactParams, type CreateContactResponse, type CreatePublishableKeyParams, type DncCheckResult, type DncEntry, type DncListResponse, DncResource, type EnrichCompanyParams, type EnrichCompanyResponse, type FanoutCallParams, type ImportCampaignMembersParams, type ImportCampaignMembersResponse, type ImportContactsParams, type ImportContactsResponse, type ImproveCampaignResponse, KeysResource, type LaunchBlocker, type LaunchCampaignResponse, type ListAttestationsResponse, type ListCallsParams, type ListCampaignAttemptsParams, type ListCampaignBatchesParams, type ListCampaignFollowupsParams, type ListCampaignMembersParams, type ListCampaignRoutesParams, type ListCampaignSuggestionsParams, type ListCampaignsParams, type ListContactsParams, type NumberRecord, NumbersResource, type PreviewStackParams, type PublishAgentResponse, type PublishValidationIssue, type PublishableKeyRecord, Rymi, RymiClient, RymiError, type SetConsentParams, type SetConsentResponse, type TelephonyProvider, TelephonyResource, TemplatesResource, type ToolSecretRecord, ToolSecretsResource, type UpdateAgentParams, type UpdateCampaignMemberParams, type UpdateCampaignParams, type UpdateCampaignRouteParams, type UpdateContactParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, Rymi as default };
|
|
1466
|
+
export { type AddCampaignMembersParams, type AddKnowledgeSourceParams, type AgentCallListResponse, type AgentChange, type AgentKnowledgeSource, type AgentListResponse, type AgentShareLink, type AgentShareLinkSettings, type AgentTemplateSummary, AgentsResource, type ApplyChangesParams, type ApplyChangesResponse, type AttestParams, type AttestResponse, type Attestation, type BatchCallParams, BillingResource, type CallListResponse, type CallRecord, CallsResource, type CampaignAttemptListResponse, type CampaignBatch, type CampaignBatchListResponse, type CampaignFollowupJob, type CampaignFollowupListResponse, type CampaignIntake, type CampaignIntakeSettings, type CampaignListResponse, type CampaignMemberListResponse, type CampaignReportResponse, type CampaignRoute, type CampaignRouteListResponse, type CampaignSuggestion, type CampaignSuggestionListResponse, CampaignsResource, type ChangeEntry, type ClientOptions, ComplianceResource, type ConnectTelephonyParams, type ContactListResponse, ContactsResource, type CreateAgentParams, type CreateCallParams, type CreateCallResponse, type CreateCampaignParams, type CreateCampaignRouteParams, type CreateContactParams, type CreateContactResponse, type CreatePublishableKeyParams, type CreateWorkspaceParams, type DncCheckResult, type DncEntry, type DncListResponse, DncResource, type EnrichCompanyParams, type EnrichCompanyResponse, type FanoutCallParams, type ImportCampaignMembersParams, type ImportCampaignMembersResponse, type ImportContactsParams, type ImportContactsResponse, type ImproveCampaignResponse, KeysResource, type LaunchBlocker, type LaunchCampaignResponse, type ListAttestationsResponse, type ListCallsParams, type ListCampaignAttemptsParams, type ListCampaignBatchesParams, type ListCampaignFollowupsParams, type ListCampaignMembersParams, type ListCampaignRoutesParams, type ListCampaignSuggestionsParams, type ListCampaignsParams, type ListContactsParams, type NumberRecord, NumbersResource, type PreviewStackParams, type PublishAgentResponse, type PublishValidationIssue, type PublishableKeyRecord, Rymi, RymiClient, RymiError, type SetConsentParams, type SetConsentResponse, type TelephonyProvider, TelephonyResource, TemplatesResource, type ToolSecretRecord, ToolSecretsResource, type UpdateAgentParams, type UpdateCampaignMemberParams, type UpdateCampaignParams, type UpdateCampaignRouteParams, type UpdateContactParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, type Workspace, WorkspacesResource, Rymi as default };
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __export(index_exports, {
|
|
|
47
47
|
TemplatesResource: () => TemplatesResource,
|
|
48
48
|
ToolSecretsResource: () => ToolSecretsResource,
|
|
49
49
|
WebhooksResource: () => WebhooksResource,
|
|
50
|
+
WorkspacesResource: () => WorkspacesResource,
|
|
50
51
|
default: () => index_default
|
|
51
52
|
});
|
|
52
53
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -66,6 +67,7 @@ var RymiClient = class {
|
|
|
66
67
|
apiKey;
|
|
67
68
|
baseURL;
|
|
68
69
|
fetchImpl;
|
|
70
|
+
workspace;
|
|
69
71
|
constructor(options) {
|
|
70
72
|
const key = options?.apiKey || (typeof process !== "undefined" ? process.env.RYMI_API_KEY : void 0);
|
|
71
73
|
if (!key) {
|
|
@@ -77,6 +79,7 @@ var RymiClient = class {
|
|
|
77
79
|
if (this.baseURL.endsWith("/")) {
|
|
78
80
|
this.baseURL = this.baseURL.slice(0, -1);
|
|
79
81
|
}
|
|
82
|
+
this.workspace = options?.workspace || (typeof process !== "undefined" ? process.env.RYMI_WORKSPACE : void 0) || void 0;
|
|
80
83
|
}
|
|
81
84
|
async request(method, path, body) {
|
|
82
85
|
const url = `${this.baseURL}${path.startsWith("/") ? path : `/${path}`}`;
|
|
@@ -85,6 +88,7 @@ var RymiClient = class {
|
|
|
85
88
|
"Accept": "application/json",
|
|
86
89
|
"User-Agent": "rymi-node/1.0.0"
|
|
87
90
|
};
|
|
91
|
+
if (this.workspace) headers["Rymi-Workspace"] = this.workspace;
|
|
88
92
|
const init = {
|
|
89
93
|
method,
|
|
90
94
|
headers
|
|
@@ -668,14 +672,37 @@ var CampaignRoutesResource = class {
|
|
|
668
672
|
return this.client.delete(`/campaigns/${campaignId}/routes/${routeId}`);
|
|
669
673
|
}
|
|
670
674
|
};
|
|
675
|
+
var CampaignIntakeResource = class {
|
|
676
|
+
constructor(client) {
|
|
677
|
+
this.client = client;
|
|
678
|
+
}
|
|
679
|
+
/** Get the campaign's lead-intake settings, or `intake: null` if it has none. */
|
|
680
|
+
async get(campaignId) {
|
|
681
|
+
return this.client.get(`/campaigns/${campaignId}/intake`);
|
|
682
|
+
}
|
|
683
|
+
/** Create the lead-intake URL (returned once as `url`), or update its settings (`url: null`). */
|
|
684
|
+
async set(campaignId, settings = {}) {
|
|
685
|
+
return this.client.put(`/campaigns/${campaignId}/intake`, settings);
|
|
686
|
+
}
|
|
687
|
+
/** Issue a new URL. The old one stops accepting leads immediately. */
|
|
688
|
+
async rotate(campaignId) {
|
|
689
|
+
return this.client.post(`/campaigns/${campaignId}/intake/rotate`, {});
|
|
690
|
+
}
|
|
691
|
+
/** Remove the lead-intake URL. */
|
|
692
|
+
async disable(campaignId) {
|
|
693
|
+
return this.client.delete(`/campaigns/${campaignId}/intake`);
|
|
694
|
+
}
|
|
695
|
+
};
|
|
671
696
|
var CampaignsResource = class {
|
|
672
697
|
constructor(client) {
|
|
673
698
|
this.client = client;
|
|
674
699
|
this.members = new CampaignMembersResource(client);
|
|
675
700
|
this.routes = new CampaignRoutesResource(client);
|
|
701
|
+
this.intake = new CampaignIntakeResource(client);
|
|
676
702
|
}
|
|
677
703
|
members;
|
|
678
704
|
routes;
|
|
705
|
+
intake;
|
|
679
706
|
/** List campaigns for the authenticated tenant, paginated. */
|
|
680
707
|
async list(params = {}) {
|
|
681
708
|
return this.client.get(`/campaigns${buildQuery4(params)}`);
|
|
@@ -835,6 +862,22 @@ var ToolSecretsResource = class {
|
|
|
835
862
|
}
|
|
836
863
|
};
|
|
837
864
|
|
|
865
|
+
// src/resources/workspaces.ts
|
|
866
|
+
var WorkspacesResource = class {
|
|
867
|
+
constructor(client) {
|
|
868
|
+
this.client = client;
|
|
869
|
+
}
|
|
870
|
+
async list() {
|
|
871
|
+
return this.client.get("/workspaces");
|
|
872
|
+
}
|
|
873
|
+
async create(data) {
|
|
874
|
+
return this.client.post("/workspaces", data);
|
|
875
|
+
}
|
|
876
|
+
async update(id, data) {
|
|
877
|
+
return this.client.patch(`/workspaces/${encodeURIComponent(id)}`, data);
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
|
|
838
881
|
// src/index.ts
|
|
839
882
|
__reExport(index_exports, require("@rymi/sdk-types"), module.exports);
|
|
840
883
|
var Rymi = class {
|
|
@@ -852,6 +895,7 @@ var Rymi = class {
|
|
|
852
895
|
contacts;
|
|
853
896
|
compliance;
|
|
854
897
|
toolSecrets;
|
|
898
|
+
workspaces;
|
|
855
899
|
constructor(options) {
|
|
856
900
|
this.client = new RymiClient(options);
|
|
857
901
|
this.agents = new AgentsResource(this.client);
|
|
@@ -867,6 +911,7 @@ var Rymi = class {
|
|
|
867
911
|
this.contacts = new ContactsResource(this.client);
|
|
868
912
|
this.compliance = new ComplianceResource(this.client);
|
|
869
913
|
this.toolSecrets = new ToolSecretsResource(this.client);
|
|
914
|
+
this.workspaces = new WorkspacesResource(this.client);
|
|
870
915
|
}
|
|
871
916
|
};
|
|
872
917
|
var index_default = Rymi;
|
|
@@ -888,6 +933,7 @@ var index_default = Rymi;
|
|
|
888
933
|
TemplatesResource,
|
|
889
934
|
ToolSecretsResource,
|
|
890
935
|
WebhooksResource,
|
|
936
|
+
WorkspacesResource,
|
|
891
937
|
...require("@rymi/sdk-types")
|
|
892
938
|
});
|
|
893
939
|
//# sourceMappingURL=index.js.map
|