@rymi/node 2.4.0 → 2.5.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 CHANGED
@@ -74,15 +74,15 @@ The client exposes one namespace per resource group:
74
74
  | `numbers` | Register and attach phone numbers |
75
75
  | `telephony` | Inspect carrier status and provisioned numbers |
76
76
  | `keys` | Manage publishable keys |
77
- | `billing` | Usage summaries and balance |
77
+ | `billing` | Usage summaries, balance, and `setCountry` (billing country, locked after the first paid invoice) |
78
78
  | `templates` | Prebuilt agent templates |
79
79
  | `webhooks` | Create webhooks and verify incoming signatures |
80
80
  | `dnc` | Do-not-call list management |
81
81
  | `campaigns` | Outbound/inbound calling campaigns: members, launch/pause, reports, improvement suggestions, inbound routes, and the lead-intake URL (`campaigns.intake`) |
82
82
  | `contacts` | Contacts and per-channel consent |
83
- | `compliance` | Compliance attestations (e.g. an external DNC scrub) |
83
+ | `compliance` | Attestations, plus workspace settings: `getSettings`, `updateSettings`, `previewSettings` |
84
84
  | `toolSecrets` | Secrets for API-tool headers, referenced as `{{secrets.NAME}}` |
85
- | `workspaces` | List, create and update workspaces, including client workspaces (`create({ name, parent })`) that your agency pays for, with a monthly `spend_cap_cents_monthly`. `usage(id, { month })` for invoicing; `listMembers`, `addMember`, `removeMember`. Pass `workspace` (or `RYMI_WORKSPACE`) to act in one of them. |
85
+ | `workspaces` | List, create and update workspaces, including client workspaces (`create({ name, parent })`) that your agency pays for, with a monthly `spend_cap_cents_monthly`. `usage(id, { month })` for invoicing; `listMembers`, `addMember`, `removeMember`. Pass `workspace` (or `RYMI_WORKSPACE`), or call `withWorkspace(id)`, to act in one of them. |
86
86
 
87
87
  ## 📖 Documentation
88
88
 
package/dist/index.d.mts CHANGED
@@ -877,6 +877,11 @@ declare class BillingResource {
877
877
  }): Promise<{
878
878
  ok: true;
879
879
  }>;
880
+ /** Set the billing country. Locked after the first paid invoice (409 billing_country_locked). */
881
+ setCountry(billingCountry: string): Promise<{
882
+ ok: true;
883
+ billing_country: string;
884
+ }>;
880
885
  }
881
886
 
882
887
  interface AgentTemplateSummary {
@@ -1372,6 +1377,28 @@ interface AttestResponse {
1372
1377
  interface ListAttestationsResponse {
1373
1378
  attestations: Attestation[];
1374
1379
  }
1380
+ interface CallingRules {
1381
+ /** Callee-local hours; null = any hour. */
1382
+ calling_hours: {
1383
+ start_hour: number;
1384
+ end_hour: number;
1385
+ } | null;
1386
+ dnc_check: boolean;
1387
+ require_voice_consent: boolean;
1388
+ /** Recording notice default for new agents. */
1389
+ recording_notice: boolean;
1390
+ /** null = every supported country. */
1391
+ destination_countries: string[] | null;
1392
+ apply_to_single_calls: boolean;
1393
+ }
1394
+ interface ComplianceSettings {
1395
+ operating_country: string | null;
1396
+ configured: boolean;
1397
+ inherited_from: string | null;
1398
+ rules: CallingRules;
1399
+ edited: Array<keyof CallingRules>;
1400
+ presets: Record<string, CallingRules>;
1401
+ }
1375
1402
  declare class ComplianceResource {
1376
1403
  private client;
1377
1404
  constructor(client: RymiClient);
@@ -1380,6 +1407,22 @@ declare class ComplianceResource {
1380
1407
  attest(data: AttestParams): Promise<AttestResponse>;
1381
1408
  /** List the tenant's 50 most recent compliance attestations, newest first. */
1382
1409
  listAttestations(): Promise<ListAttestationsResponse>;
1410
+ /** The workspace's compliance settings, with every country preset. */
1411
+ getSettings(): Promise<ComplianceSettings>;
1412
+ /** Choosing operating_country fills every setting you haven't edited from its preset. */
1413
+ updateSettings(data: {
1414
+ operating_country?: string | null;
1415
+ rules?: Partial<CallingRules>;
1416
+ }): Promise<ComplianceSettings>;
1417
+ /** What choosing a country would change, before saving. */
1418
+ previewSettings(country: string): Promise<{
1419
+ country: string;
1420
+ changes: Array<{
1421
+ key: keyof CallingRules;
1422
+ from: unknown;
1423
+ to: unknown;
1424
+ }>;
1425
+ }>;
1383
1426
  }
1384
1427
 
1385
1428
  /** A stored API-tool secret. Values are write-only — never returned. */
@@ -1485,6 +1528,7 @@ declare class WorkspacesResource {
1485
1528
 
1486
1529
  declare class Rymi {
1487
1530
  private client;
1531
+ private options?;
1488
1532
  agents: AgentsResource;
1489
1533
  calls: CallsResource;
1490
1534
  dnc: DncResource;
@@ -1500,6 +1544,8 @@ declare class Rymi {
1500
1544
  toolSecrets: ToolSecretsResource;
1501
1545
  workspaces: WorkspacesResource;
1502
1546
  constructor(options?: ClientOptions);
1547
+ /** The same client acting in another workspace: `rymi.withWorkspace(id).calls.create(…)`. */
1548
+ withWorkspace(workspace: string): Rymi;
1503
1549
  }
1504
1550
 
1505
- 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 UpdateWorkspaceParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, type Workspace, type WorkspaceMember, type WorkspaceUsage, WorkspacesResource, Rymi as default };
1551
+ 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, type CallingRules, 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 ComplianceSettings, 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 UpdateWorkspaceParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, type Workspace, type WorkspaceMember, type WorkspaceUsage, WorkspacesResource, Rymi as default };
package/dist/index.d.ts CHANGED
@@ -877,6 +877,11 @@ declare class BillingResource {
877
877
  }): Promise<{
878
878
  ok: true;
879
879
  }>;
880
+ /** Set the billing country. Locked after the first paid invoice (409 billing_country_locked). */
881
+ setCountry(billingCountry: string): Promise<{
882
+ ok: true;
883
+ billing_country: string;
884
+ }>;
880
885
  }
881
886
 
882
887
  interface AgentTemplateSummary {
@@ -1372,6 +1377,28 @@ interface AttestResponse {
1372
1377
  interface ListAttestationsResponse {
1373
1378
  attestations: Attestation[];
1374
1379
  }
1380
+ interface CallingRules {
1381
+ /** Callee-local hours; null = any hour. */
1382
+ calling_hours: {
1383
+ start_hour: number;
1384
+ end_hour: number;
1385
+ } | null;
1386
+ dnc_check: boolean;
1387
+ require_voice_consent: boolean;
1388
+ /** Recording notice default for new agents. */
1389
+ recording_notice: boolean;
1390
+ /** null = every supported country. */
1391
+ destination_countries: string[] | null;
1392
+ apply_to_single_calls: boolean;
1393
+ }
1394
+ interface ComplianceSettings {
1395
+ operating_country: string | null;
1396
+ configured: boolean;
1397
+ inherited_from: string | null;
1398
+ rules: CallingRules;
1399
+ edited: Array<keyof CallingRules>;
1400
+ presets: Record<string, CallingRules>;
1401
+ }
1375
1402
  declare class ComplianceResource {
1376
1403
  private client;
1377
1404
  constructor(client: RymiClient);
@@ -1380,6 +1407,22 @@ declare class ComplianceResource {
1380
1407
  attest(data: AttestParams): Promise<AttestResponse>;
1381
1408
  /** List the tenant's 50 most recent compliance attestations, newest first. */
1382
1409
  listAttestations(): Promise<ListAttestationsResponse>;
1410
+ /** The workspace's compliance settings, with every country preset. */
1411
+ getSettings(): Promise<ComplianceSettings>;
1412
+ /** Choosing operating_country fills every setting you haven't edited from its preset. */
1413
+ updateSettings(data: {
1414
+ operating_country?: string | null;
1415
+ rules?: Partial<CallingRules>;
1416
+ }): Promise<ComplianceSettings>;
1417
+ /** What choosing a country would change, before saving. */
1418
+ previewSettings(country: string): Promise<{
1419
+ country: string;
1420
+ changes: Array<{
1421
+ key: keyof CallingRules;
1422
+ from: unknown;
1423
+ to: unknown;
1424
+ }>;
1425
+ }>;
1383
1426
  }
1384
1427
 
1385
1428
  /** A stored API-tool secret. Values are write-only — never returned. */
@@ -1485,6 +1528,7 @@ declare class WorkspacesResource {
1485
1528
 
1486
1529
  declare class Rymi {
1487
1530
  private client;
1531
+ private options?;
1488
1532
  agents: AgentsResource;
1489
1533
  calls: CallsResource;
1490
1534
  dnc: DncResource;
@@ -1500,6 +1544,8 @@ declare class Rymi {
1500
1544
  toolSecrets: ToolSecretsResource;
1501
1545
  workspaces: WorkspacesResource;
1502
1546
  constructor(options?: ClientOptions);
1547
+ /** The same client acting in another workspace: `rymi.withWorkspace(id).calls.create(…)`. */
1548
+ withWorkspace(workspace: string): Rymi;
1503
1549
  }
1504
1550
 
1505
- 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 UpdateWorkspaceParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, type Workspace, type WorkspaceMember, type WorkspaceUsage, WorkspacesResource, Rymi as default };
1551
+ 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, type CallingRules, 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 ComplianceSettings, 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 UpdateWorkspaceParams, type UsageSummary, type ValidatePublishParams, type WebhookProvisionResult, type WebhookRecord, WebhooksResource, type Workspace, type WorkspaceMember, type WorkspaceUsage, WorkspacesResource, Rymi as default };
package/dist/index.js CHANGED
@@ -601,6 +601,10 @@ var BillingResource = class {
601
601
  async setAlerts(data) {
602
602
  return this.client.put("/billing/alerts", data);
603
603
  }
604
+ /** Set the billing country. Locked after the first paid invoice (409 billing_country_locked). */
605
+ async setCountry(billingCountry) {
606
+ return this.client.put("/billing/country", { billing_country: billingCountry });
607
+ }
604
608
  };
605
609
 
606
610
  // src/resources/templates.ts
@@ -843,6 +847,18 @@ var ComplianceResource = class {
843
847
  async listAttestations() {
844
848
  return this.client.get("/compliance/attestations");
845
849
  }
850
+ /** The workspace's compliance settings, with every country preset. */
851
+ async getSettings() {
852
+ return this.client.get("/compliance/settings");
853
+ }
854
+ /** Choosing operating_country fills every setting you haven't edited from its preset. */
855
+ async updateSettings(data) {
856
+ return this.client.put("/compliance/settings", data);
857
+ }
858
+ /** What choosing a country would change, before saving. */
859
+ async previewSettings(country) {
860
+ return this.client.get(`/compliance/settings/preview?country=${encodeURIComponent(country)}`);
861
+ }
846
862
  };
847
863
 
848
864
  // src/resources/toolSecrets.ts
@@ -895,8 +911,9 @@ var WorkspacesResource = class {
895
911
 
896
912
  // src/index.ts
897
913
  __reExport(index_exports, require("@rymi/sdk-types"), module.exports);
898
- var Rymi = class {
914
+ var Rymi = class _Rymi {
899
915
  client;
916
+ options;
900
917
  agents;
901
918
  calls;
902
919
  dnc;
@@ -912,6 +929,7 @@ var Rymi = class {
912
929
  toolSecrets;
913
930
  workspaces;
914
931
  constructor(options) {
932
+ this.options = options;
915
933
  this.client = new RymiClient(options);
916
934
  this.agents = new AgentsResource(this.client);
917
935
  this.calls = new CallsResource(this.client);
@@ -928,6 +946,10 @@ var Rymi = class {
928
946
  this.toolSecrets = new ToolSecretsResource(this.client);
929
947
  this.workspaces = new WorkspacesResource(this.client);
930
948
  }
949
+ /** The same client acting in another workspace: `rymi.withWorkspace(id).calls.create(…)`. */
950
+ withWorkspace(workspace) {
951
+ return new _Rymi({ ...this.options, workspace });
952
+ }
931
953
  };
932
954
  var index_default = Rymi;
933
955
  // Annotate the CommonJS export names for ESM import in node: