@arbol-ai/sdk 5.38.0 → 5.39.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/account/permissions/models.d.ts +1 -1
- package/dist/axxa/client.d.ts +2 -0
- package/dist/axxa/client.js +5 -0
- package/dist/axxa/coverage/client.d.ts +24 -0
- package/dist/axxa/coverage/client.js +18 -0
- package/dist/axxa/coverage/index.d.ts +5 -0
- package/dist/axxa/coverage/index.js +4 -0
- package/dist/axxa/coverage/models.d.ts +139 -0
- package/dist/axxa/coverage/models.js +3 -0
- package/dist/raiz/agents/client.d.ts +12 -8
- package/dist/raiz/agents/models.d.ts +2 -0
- package/dist/raiz/campaigns/client.d.ts +98 -66
- package/dist/raiz/campaigns/client.js +4 -4
- package/dist/raiz/campaigns/index.d.ts +1 -1
- package/dist/raiz/campaigns/models.d.ts +124 -13
- package/dist/raiz/campaigns/models.js +3 -1
- package/dist/raiz/models.d.ts +37 -1
- package/dist/sanitas/affiliations/models.d.ts +7 -2
- package/dist/sanitas/connections/client.d.ts +6 -1
- package/dist/sanitas/connections/client.js +1 -0
- package/dist/sanitas/connections/models.d.ts +7 -2
- package/dist/sanitas/index.d.ts +1 -1
- package/dist/sanitas/models.d.ts +22 -0
- package/dist/sura/affiliations/models.d.ts +3 -2
- package/dist/sura/authorizations/client.d.ts +6 -5
- package/dist/sura/authorizations/models.d.ts +3 -2
- package/dist/sura/models.d.ts +22 -3
- package/package.json +3 -3
|
@@ -22,7 +22,7 @@ export interface AccountPermission {
|
|
|
22
22
|
/**
|
|
23
23
|
* The product or integration the permission belongs to.
|
|
24
24
|
*/
|
|
25
|
-
group: "raiz" | "agenda" | "ambar" | "sura" | "visoft" | "salud-total" | "nueva-eps" | "comfachoco" | "account";
|
|
25
|
+
group: "raiz" | "agenda" | "ambar" | "sura" | "visoft" | "salud-total" | "nueva-eps" | "comfachoco" | "oficlinic" | "sanitas" | "account";
|
|
26
26
|
value: string;
|
|
27
27
|
}
|
|
28
28
|
export interface AccountPermissionPage {
|
package/dist/axxa/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BaseClientOptions, Transport } from "../_/index.js";
|
|
2
2
|
import { type Client as AuthorizationsClient } from "./authorizations/client.js";
|
|
3
3
|
import { type Client as ConnectionsClient } from "./connections/client.js";
|
|
4
|
+
import { type Client as CoverageClient } from "./coverage/client.js";
|
|
4
5
|
import { type Client as EligibilityClient } from "./eligibility/client.js";
|
|
5
6
|
import { type Client as ProviderClient } from "./provider/client.js";
|
|
6
7
|
export interface ClientOptions extends BaseClientOptions {
|
|
@@ -12,6 +13,7 @@ export interface ClientOptions extends BaseClientOptions {
|
|
|
12
13
|
export interface Client {
|
|
13
14
|
readonly authorizations: AuthorizationsClient;
|
|
14
15
|
readonly connections: ConnectionsClient;
|
|
16
|
+
readonly coverage: CoverageClient;
|
|
15
17
|
readonly eligibility: EligibilityClient;
|
|
16
18
|
readonly provider: ProviderClient;
|
|
17
19
|
}
|
package/dist/axxa/client.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Transport } from "../_/index.js";
|
|
4
4
|
import { bind as bindAuthorizations, } from "./authorizations/client.js";
|
|
5
5
|
import { bind as bindConnections, } from "./connections/client.js";
|
|
6
|
+
import { bind as bindCoverage, } from "./coverage/client.js";
|
|
6
7
|
import { bind as bindEligibility, } from "./eligibility/client.js";
|
|
7
8
|
import { bind as bindProvider, } from "./provider/client.js";
|
|
8
9
|
export function createClient(options) {
|
|
@@ -11,6 +12,7 @@ export function createClient(options) {
|
|
|
11
12
|
export function bind(transport) {
|
|
12
13
|
let authorizationsClient;
|
|
13
14
|
let connectionsClient;
|
|
15
|
+
let coverageClient;
|
|
14
16
|
let eligibilityClient;
|
|
15
17
|
let providerClient;
|
|
16
18
|
return {
|
|
@@ -20,6 +22,9 @@ export function bind(transport) {
|
|
|
20
22
|
get connections() {
|
|
21
23
|
return (connectionsClient ??= bindConnections(transport));
|
|
22
24
|
},
|
|
25
|
+
get coverage() {
|
|
26
|
+
return (coverageClient ??= bindCoverage(transport));
|
|
27
|
+
},
|
|
23
28
|
get eligibility() {
|
|
24
29
|
return (eligibilityClient ??= bindEligibility(transport));
|
|
25
30
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
|
|
2
|
+
import type { AxxaLookupCoverageBody, AxxaLookupCoverageResultResponse } from "./models.js";
|
|
3
|
+
export interface ClientOptions extends BaseClientOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The URL the paths of the API are relative to.
|
|
6
|
+
*/
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Client {
|
|
10
|
+
/**
|
|
11
|
+
* Look up coverage of a service
|
|
12
|
+
*
|
|
13
|
+
* Read whether a person's plan and this provider cover one exact service code
|
|
14
|
+
* in one service category, whether it requires an authorization and, when
|
|
15
|
+
* both cover it, the voucher quote. AXA lists each service under one
|
|
16
|
+
* category, so service_not_found there does not mean it is not covered.
|
|
17
|
+
* Generates no authorization.
|
|
18
|
+
*/
|
|
19
|
+
lookup(request: LookupRequest, options?: RequestOptions): Promise<LookupResponse>;
|
|
20
|
+
}
|
|
21
|
+
export declare function createClient(options: ClientOptions): Client;
|
|
22
|
+
export declare function bind(transport: Transport): Client;
|
|
23
|
+
export type LookupRequest = AxxaLookupCoverageBody;
|
|
24
|
+
export type LookupResponse = AxxaLookupCoverageResultResponse;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Code generated by forge. DO NOT EDIT.
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { Transport, } from "../../_/index.js";
|
|
4
|
+
export function createClient(options) {
|
|
5
|
+
return bind(new Transport(options));
|
|
6
|
+
}
|
|
7
|
+
export function bind(transport) {
|
|
8
|
+
return {
|
|
9
|
+
lookup: (request, options) => transport.send(LookupOperation, request, options),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const LookupOperation = {
|
|
13
|
+
method: "POST",
|
|
14
|
+
route: "/v1/axxa/coverage/lookup",
|
|
15
|
+
body: "flat",
|
|
16
|
+
response: null,
|
|
17
|
+
errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "428": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
18
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ApiError } from "../../_/index.js";
|
|
2
|
+
export type { RequestOptions } from "../../_/index.js";
|
|
3
|
+
export { createClient } from "./client.js";
|
|
4
|
+
export type { Client, ClientOptions, LookupRequest, LookupResponse, } from "./client.js";
|
|
5
|
+
export type { AxxaLookupCoverageBadGatewayError, AxxaLookupCoverageBadGatewayFailure, AxxaLookupCoverageBody, AxxaLookupCoverageConflictError, AxxaLookupCoverageConflictFailure, AxxaLookupCoverageForbiddenError, AxxaLookupCoverageForbiddenFailure, AxxaLookupCoverageResult, AxxaLookupCoverageResultResponse, AxxaLookupCoverageServiceUnavailableError, AxxaLookupCoverageServiceUnavailableFailure, AxxaLookupCoverageTooManyRequestsError, AxxaLookupCoverageTooManyRequestsFailure, } from "./models.js";
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { ForbiddenFailure, OutcomeUnknownFailure, RateLimitedFailure, ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
|
|
2
|
+
import type { AxxaAccountMismatchFailure, AxxaCaptchaPausedFailure, AxxaCaptchaUnavailableFailure, AxxaLoginCooldownFailure, AxxaLoginRejectedFailure, AxxaNotConfiguredFailure, AxxaPortalChangedFailure, AxxaPortalUnavailableFailure, AxxaSessionBusyFailure, AxxaSessionRequiredFailure } from "../models.js";
|
|
3
|
+
/**
|
|
4
|
+
* A failed answer.
|
|
5
|
+
*/
|
|
6
|
+
export interface AxxaLookupCoverageBadGatewayError {
|
|
7
|
+
data: null;
|
|
8
|
+
error: AxxaLookupCoverageBadGatewayFailure;
|
|
9
|
+
/**
|
|
10
|
+
* What every answer carries besides its data or error.
|
|
11
|
+
*/
|
|
12
|
+
metadata: ResponseMetadata;
|
|
13
|
+
success: false;
|
|
14
|
+
}
|
|
15
|
+
export type AxxaLookupCoverageBadGatewayFailure = OutcomeUnknownFailure | AxxaPortalChangedFailure;
|
|
16
|
+
export interface AxxaLookupCoverageBody {
|
|
17
|
+
connectionId?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The plan to read, from an eligibility lookup. Required only when the person
|
|
20
|
+
* has several.
|
|
21
|
+
*/
|
|
22
|
+
contractNumber?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The exact service code. Only this code is answered, never one that merely
|
|
25
|
+
* starts with it.
|
|
26
|
+
*/
|
|
27
|
+
cupsCode: string;
|
|
28
|
+
documentNumber: string;
|
|
29
|
+
documentType: "CC" | "CE" | "TI" | "RC" | "PA";
|
|
30
|
+
serviceType: "outpatient" | "emergency" | "laboratory" | "therapy" | "radiology" | "other";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A failed answer.
|
|
34
|
+
*/
|
|
35
|
+
export interface AxxaLookupCoverageConflictError {
|
|
36
|
+
data: null;
|
|
37
|
+
error: AxxaLookupCoverageConflictFailure;
|
|
38
|
+
/**
|
|
39
|
+
* What every answer carries besides its data or error.
|
|
40
|
+
*/
|
|
41
|
+
metadata: ResponseMetadata;
|
|
42
|
+
success: false;
|
|
43
|
+
}
|
|
44
|
+
export type AxxaLookupCoverageConflictFailure = AxxaNotConfiguredFailure | AxxaSessionRequiredFailure | AxxaSessionBusyFailure;
|
|
45
|
+
/**
|
|
46
|
+
* A failed answer.
|
|
47
|
+
*/
|
|
48
|
+
export interface AxxaLookupCoverageForbiddenError {
|
|
49
|
+
data: null;
|
|
50
|
+
error: AxxaLookupCoverageForbiddenFailure;
|
|
51
|
+
/**
|
|
52
|
+
* What every answer carries besides its data or error.
|
|
53
|
+
*/
|
|
54
|
+
metadata: ResponseMetadata;
|
|
55
|
+
success: false;
|
|
56
|
+
}
|
|
57
|
+
export type AxxaLookupCoverageForbiddenFailure = ForbiddenFailure | AxxaLoginRejectedFailure | AxxaAccountMismatchFailure;
|
|
58
|
+
/**
|
|
59
|
+
* AXA's answer for one exact service, in one service category. Affiliation,
|
|
60
|
+
* coverage, authorization and the voucher are separate facts, and none confirms
|
|
61
|
+
* an appointment.
|
|
62
|
+
*/
|
|
63
|
+
export interface AxxaLookupCoverageResult {
|
|
64
|
+
plans: {
|
|
65
|
+
contractNumber: string;
|
|
66
|
+
name: string;
|
|
67
|
+
notice: string | null;
|
|
68
|
+
}[];
|
|
69
|
+
selectedPlan: {
|
|
70
|
+
contractNumber: string;
|
|
71
|
+
name: string;
|
|
72
|
+
notice: string | null;
|
|
73
|
+
} | null;
|
|
74
|
+
service: {
|
|
75
|
+
affiliateCovered: boolean;
|
|
76
|
+
authorizationRequired: boolean | null;
|
|
77
|
+
cupsCode: string;
|
|
78
|
+
description: string;
|
|
79
|
+
providerCovered: boolean;
|
|
80
|
+
} | null;
|
|
81
|
+
/**
|
|
82
|
+
* found: the service exists in this category. service_not_found: this
|
|
83
|
+
* category does not list that code; another category may. plan_required: name
|
|
84
|
+
* one of the plans. plan_restricted: AXA offers no service search on this
|
|
85
|
+
* plan, see its notice. validation_required: see the messages.
|
|
86
|
+
*/
|
|
87
|
+
status: "found" | "service_not_found" | "plan_required" | "plan_restricted" | "validation_required";
|
|
88
|
+
validationMessages: string[];
|
|
89
|
+
/**
|
|
90
|
+
* Read only when both coverages hold.
|
|
91
|
+
*/
|
|
92
|
+
voucher: {
|
|
93
|
+
amount: number | null;
|
|
94
|
+
status: "quoted" | "not_enabled" | "unavailable";
|
|
95
|
+
} | null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A successful answer.
|
|
99
|
+
*/
|
|
100
|
+
export interface AxxaLookupCoverageResultResponse {
|
|
101
|
+
/**
|
|
102
|
+
* AXA's answer for one exact service, in one service category. Affiliation,
|
|
103
|
+
* coverage, authorization and the voucher are separate facts, and none
|
|
104
|
+
* confirms an appointment.
|
|
105
|
+
*/
|
|
106
|
+
data: AxxaLookupCoverageResult;
|
|
107
|
+
error: null;
|
|
108
|
+
/**
|
|
109
|
+
* What every answer carries besides its data or error.
|
|
110
|
+
*/
|
|
111
|
+
metadata: ResponseMetadata;
|
|
112
|
+
success: true;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A failed answer.
|
|
116
|
+
*/
|
|
117
|
+
export interface AxxaLookupCoverageServiceUnavailableError {
|
|
118
|
+
data: null;
|
|
119
|
+
error: AxxaLookupCoverageServiceUnavailableFailure;
|
|
120
|
+
/**
|
|
121
|
+
* What every answer carries besides its data or error.
|
|
122
|
+
*/
|
|
123
|
+
metadata: ResponseMetadata;
|
|
124
|
+
success: false;
|
|
125
|
+
}
|
|
126
|
+
export type AxxaLookupCoverageServiceUnavailableFailure = UpstreamUnavailableFailure | AxxaCaptchaUnavailableFailure | AxxaCaptchaPausedFailure | AxxaPortalUnavailableFailure;
|
|
127
|
+
/**
|
|
128
|
+
* A failed answer.
|
|
129
|
+
*/
|
|
130
|
+
export interface AxxaLookupCoverageTooManyRequestsError {
|
|
131
|
+
data: null;
|
|
132
|
+
error: AxxaLookupCoverageTooManyRequestsFailure;
|
|
133
|
+
/**
|
|
134
|
+
* What every answer carries besides its data or error.
|
|
135
|
+
*/
|
|
136
|
+
metadata: ResponseMetadata;
|
|
137
|
+
success: false;
|
|
138
|
+
}
|
|
139
|
+
export type AxxaLookupCoverageTooManyRequestsFailure = RateLimitedFailure | AxxaLoginCooldownFailure;
|
|
@@ -58,8 +58,8 @@ export interface Client {
|
|
|
58
58
|
*
|
|
59
59
|
* Change an Agent: instructions, first message, name, language, time zone,
|
|
60
60
|
* settings, integration tools, Knowledge, procedures, connection procedures
|
|
61
|
-
* or status. Omitted fields stay and `null` clears one
|
|
62
|
-
* `integrationTools`, `integrationProcedures`, `procedures` and
|
|
61
|
+
* or status. Omitted fields stay and `null` clears one, also inside
|
|
62
|
+
* `settings`; `integrationTools`, `integrationProcedures`, `procedures` and
|
|
63
63
|
* `knowledgeDocumentIds` replace the whole value when given (keep each
|
|
64
64
|
* existing procedure's `id`), so read the Agent with `get_agent` first and
|
|
65
65
|
* send its `version` as `expectedVersion` (VERSION_CONFLICT: read it again).
|
|
@@ -109,9 +109,11 @@ export interface CreateRequest {
|
|
|
109
109
|
*/
|
|
110
110
|
procedures?: RaizAgentProcedureInput[];
|
|
111
111
|
/**
|
|
112
|
-
* How the Agent behaves. In an update, the
|
|
113
|
-
* out
|
|
114
|
-
*
|
|
112
|
+
* How the Agent behaves. In an update, only the keys you send change: a key
|
|
113
|
+
* left out stays and `null` returns it to its default. A key's own value,
|
|
114
|
+
* such as `policy` or `voice`, is replaced whole. An update that changes
|
|
115
|
+
* `modality` starts from the defaults. Text and voice settings apply only to
|
|
116
|
+
* Agents of that modality.
|
|
115
117
|
*/
|
|
116
118
|
settings?: RaizAgentSettingsInput;
|
|
117
119
|
/**
|
|
@@ -223,9 +225,11 @@ export interface UpdateRequest {
|
|
|
223
225
|
*/
|
|
224
226
|
procedures?: RaizAgentProcedureInput[];
|
|
225
227
|
/**
|
|
226
|
-
* How the Agent behaves. In an update, the
|
|
227
|
-
* out
|
|
228
|
-
*
|
|
228
|
+
* How the Agent behaves. In an update, only the keys you send change: a key
|
|
229
|
+
* left out stays and `null` returns it to its default. A key's own value,
|
|
230
|
+
* such as `policy` or `voice`, is replaced whole. An update that changes
|
|
231
|
+
* `modality` starts from the defaults. Text and voice settings apply only to
|
|
232
|
+
* Agents of that modality.
|
|
229
233
|
*/
|
|
230
234
|
settings?: RaizAgentSettingsInput;
|
|
231
235
|
/**
|
|
@@ -320,6 +320,7 @@ export interface RaizAgentSettings {
|
|
|
320
320
|
automaticKnowledge: boolean | null;
|
|
321
321
|
budgetExhaustedMessage: string | null;
|
|
322
322
|
closingMessage: string | null;
|
|
323
|
+
deferLongOperations: boolean | null;
|
|
323
324
|
evalGate: boolean | null;
|
|
324
325
|
followUpAfterMinutes: number | null;
|
|
325
326
|
followUpMessage: string | null;
|
|
@@ -362,6 +363,7 @@ export interface RaizAgentSettingsInput {
|
|
|
362
363
|
budgetExhaustedMessage?: string | null;
|
|
363
364
|
businessHours?: RaizBusinessHours | null;
|
|
364
365
|
closingMessage?: string | null;
|
|
366
|
+
deferLongOperations?: boolean | null;
|
|
365
367
|
evalGate?: boolean | null;
|
|
366
368
|
followUpAfterMinutes?: number | null;
|
|
367
369
|
followUpMessage?: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
|
|
2
2
|
import type { RaizContactHoursWindow, RaizResponseMetadata } from "../models.js";
|
|
3
|
-
import { type RaizCampaign, type RaizCampaignPage, type RaizCampaignRecipientInput } from "./models.js";
|
|
3
|
+
import { type RaizCampaign, type RaizCampaignPage, type RaizCampaignRecipientInput, type RaizCampaignTemplateInput } from "./models.js";
|
|
4
4
|
export interface ClientOptions extends BaseClientOptions {
|
|
5
5
|
/**
|
|
6
6
|
* The URL the paths of the API are relative to.
|
|
@@ -9,17 +9,22 @@ export interface ClientOptions extends BaseClientOptions {
|
|
|
9
9
|
}
|
|
10
10
|
export interface Client {
|
|
11
11
|
/**
|
|
12
|
-
* Create a
|
|
12
|
+
* Create a campaign
|
|
13
13
|
*
|
|
14
|
-
* Prepare
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* Prepare a campaign with up to 10000 recipients, each a phone `address` with
|
|
15
|
+
* an optional `contactId` and `variables`. A call campaign (the default) has
|
|
16
|
+
* a voice Agent call each one. With `channelType: whatsapp` and an approved
|
|
17
|
+
* `template`, each one is sent the template, its `parameters` filled from
|
|
18
|
+
* their `variables` (`{{name}}`), and its text Agent answers whoever replies.
|
|
19
|
+
* Nobody is reached until it is started. A list adds nobody to the
|
|
20
|
+
* organization's contacts: a recipient becomes the contact it names, or the
|
|
21
|
+
* owner of its number (created when none exists), when the campaign first
|
|
22
|
+
* reaches them. A longer list continues with `updateCampaign` and
|
|
23
|
+
* `addRecipients`. Nothing happens outside `contactHours` (in `timeZone`, the
|
|
24
|
+
* organization's by default) or outside `scheduledStartAt` and
|
|
25
|
+
* `scheduledEndAt`; each recipient gets up to `maxAttempts` attempts,
|
|
26
|
+
* `retryAfterMinutes` apart, after the results in `retryOn`. Read it with
|
|
27
|
+
* `expand=readiness` to see whether it can start. Starting it (REST `POST
|
|
23
28
|
* /v1/campaigns/{campaignId}/start`) is not an AI tool. Read the
|
|
24
29
|
* `run-a-campaign` skill.
|
|
25
30
|
*/
|
|
@@ -27,19 +32,22 @@ export interface Client {
|
|
|
27
32
|
/**
|
|
28
33
|
* Get a campaign
|
|
29
34
|
*
|
|
30
|
-
* Read one campaign: Agent, schedule, contact hours, retries and
|
|
31
|
-
* `
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
+
* Read one campaign: Agent, schedule, contact hours, retries, progress and,
|
|
36
|
+
* in `errorCode`, why it cannot reach anyone now. `expand=recipients` adds
|
|
37
|
+
* its recipients in the order they were added, each with attempts, next
|
|
38
|
+
* attempt, error and latest call or message; continue with `recipientsCursor`
|
|
39
|
+
* (`recipientsDirection` reads the other way). `expand=readiness` says
|
|
40
|
+
* whether it can start and lists what has to be fixed first, without reaching
|
|
41
|
+
* anyone. Read it before `update_campaign` and send `expectedVersion`.
|
|
35
42
|
*/
|
|
36
43
|
get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
|
|
37
44
|
/**
|
|
38
45
|
* List campaigns
|
|
39
46
|
*
|
|
40
|
-
* List the organization's
|
|
41
|
-
*
|
|
42
|
-
*
|
|
47
|
+
* List the organization's campaigns, newest first, each with its progress
|
|
48
|
+
* (recipients pending, in progress, completed, failed and succeeded; on
|
|
49
|
+
* WhatsApp also delivered, read and replied). Filter by `channelType`,
|
|
50
|
+
* `status` or `agentId`. A campaign's calls and messages:
|
|
43
51
|
* `list_conversations` with `campaignId`; its numbers by day: `get_report`
|
|
44
52
|
* with `name: campaign_progress`.
|
|
45
53
|
*/
|
|
@@ -48,61 +56,57 @@ export interface Client {
|
|
|
48
56
|
* Update a campaign
|
|
49
57
|
*
|
|
50
58
|
* Change a campaign. Omitted fields stay. `paused: true` pauses a started
|
|
51
|
-
* campaign (no new call starts;
|
|
52
|
-
* resumes it, with the same checks as starting. Before the
|
|
53
|
-
* `recipients` is the complete set
|
|
54
|
-
* only adds
|
|
55
|
-
*
|
|
59
|
+
* campaign (no new call or message starts; those in progress finish) and
|
|
60
|
+
* `paused: false` resumes it, with the same checks as starting. Before the
|
|
61
|
+
* start, `recipients` is the complete set, replacing whoever was there; once
|
|
62
|
+
* started it only adds. `addRecipients` adds at any moment, which is how a
|
|
63
|
+
* list longer than one request arrives: a number the campaign already has is
|
|
64
|
+
* skipped, so repeating a part reaches nobody twice. The Agent changes only
|
|
65
|
+
* before the start, and a completed campaign accepts only its name and
|
|
66
|
+
* metadata. A change lifts the wait of a campaign held by `errorCode`: fixing
|
|
67
|
+
* a template and sending it here tries again at once.
|
|
56
68
|
*/
|
|
57
69
|
update(request: UpdateRequest, options?: RequestOptions): Promise<UpdateResponse>;
|
|
58
70
|
}
|
|
59
71
|
export declare function createClient(options: ClientOptions): Client;
|
|
60
72
|
export declare function bind(transport: Transport): Client;
|
|
61
|
-
export
|
|
62
|
-
/**
|
|
63
|
-
* Agent id.
|
|
64
|
-
*/
|
|
73
|
+
export type CreateRequest = {
|
|
65
74
|
agentId: string;
|
|
66
75
|
channelId?: string | null;
|
|
67
|
-
|
|
68
|
-
* When calls may start, in the campaign's time zone. Empty: any time.
|
|
69
|
-
*/
|
|
76
|
+
channelType?: "voice";
|
|
70
77
|
contactHours?: RaizContactHoursWindow[];
|
|
71
78
|
firstMessage?: string | null;
|
|
72
79
|
instructions?: string | null;
|
|
73
|
-
/**
|
|
74
|
-
* Calls per recipient at most, retries included. Default 1.
|
|
75
|
-
*/
|
|
76
80
|
maxAttempts?: number;
|
|
77
|
-
/**
|
|
78
|
-
* Your own keys and labels for this resource (up to 50 keys of 40 characters;
|
|
79
|
-
* values up to 500 characters). Raíz never interprets them.
|
|
80
|
-
*/
|
|
81
81
|
metadata?: {
|
|
82
82
|
[key: string]: unknown;
|
|
83
83
|
};
|
|
84
84
|
name: string;
|
|
85
|
-
/**
|
|
86
|
-
* Who to call, unique by `address`. A recipient's contact is `contactId`, or
|
|
87
|
-
* else the contact that owns its number (created when the organization has
|
|
88
|
-
* none).
|
|
89
|
-
*/
|
|
90
85
|
recipients?: RaizCampaignRecipientInput[];
|
|
91
|
-
/**
|
|
92
|
-
* Wait before a retry. Default 60.
|
|
93
|
-
*/
|
|
94
86
|
retryAfterMinutes?: number;
|
|
95
|
-
/**
|
|
96
|
-
* Which results earn a retry. Default `["no_answer"]`.
|
|
97
|
-
*/
|
|
98
87
|
retryOn?: ("no_answer" | "failure")[];
|
|
99
88
|
scheduledEndAt?: Temporal.Instant | null;
|
|
100
89
|
scheduledStartAt?: Temporal.Instant | null;
|
|
101
|
-
/**
|
|
102
|
-
* IANA time zone name.
|
|
103
|
-
*/
|
|
104
90
|
timeZone?: string;
|
|
105
|
-
}
|
|
91
|
+
} | {
|
|
92
|
+
agentId: string;
|
|
93
|
+
channelId?: string | null;
|
|
94
|
+
channelType: "whatsapp";
|
|
95
|
+
contactHours?: RaizContactHoursWindow[];
|
|
96
|
+
instructions?: string | null;
|
|
97
|
+
maxAttempts?: number;
|
|
98
|
+
metadata?: {
|
|
99
|
+
[key: string]: unknown;
|
|
100
|
+
};
|
|
101
|
+
name: string;
|
|
102
|
+
recipients?: RaizCampaignRecipientInput[];
|
|
103
|
+
retryAfterMinutes?: number;
|
|
104
|
+
retryOn?: ("no_answer" | "not_delivered")[];
|
|
105
|
+
scheduledEndAt?: Temporal.Instant | null;
|
|
106
|
+
scheduledStartAt?: Temporal.Instant | null;
|
|
107
|
+
template: RaizCampaignTemplateInput;
|
|
108
|
+
timeZone?: string;
|
|
109
|
+
};
|
|
106
110
|
export interface CreateResponse {
|
|
107
111
|
data: RaizCampaign;
|
|
108
112
|
error: null;
|
|
@@ -115,7 +119,7 @@ export interface GetRequest {
|
|
|
115
119
|
*/
|
|
116
120
|
campaignId: string;
|
|
117
121
|
/**
|
|
118
|
-
* Related data to include, comma-separated: `recipients`.
|
|
122
|
+
* Related data to include, comma-separated: `recipients`, `readiness`.
|
|
119
123
|
*/
|
|
120
124
|
expand?: string;
|
|
121
125
|
/**
|
|
@@ -131,6 +135,18 @@ export interface GetRequest {
|
|
|
131
135
|
* Maximum `recipients` items in one page. Defaults to 100.
|
|
132
136
|
*/
|
|
133
137
|
recipientsLimit?: number;
|
|
138
|
+
/**
|
|
139
|
+
* With `expand=recipients`: only those whose number contains these digits or
|
|
140
|
+
* whose name contains this text.
|
|
141
|
+
*/
|
|
142
|
+
recipientsQ?: string;
|
|
143
|
+
/**
|
|
144
|
+
* `pending`: waiting for its (next) call or message. `in_progress`: being
|
|
145
|
+
* called, or on WhatsApp waiting for a reply until a reminder is due.
|
|
146
|
+
* `completed`: an attempt succeeded; on WhatsApp, the message arrived.
|
|
147
|
+
* `failed`: its attempts ran out, or it cannot be reached.
|
|
148
|
+
*/
|
|
149
|
+
recipientsStatus?: "pending" | "in_progress" | "completed" | "failed" | "cancelled";
|
|
134
150
|
}
|
|
135
151
|
export interface GetResponse {
|
|
136
152
|
data: RaizCampaign;
|
|
@@ -157,9 +173,13 @@ export interface ListRequest {
|
|
|
157
173
|
*/
|
|
158
174
|
agentId?: string;
|
|
159
175
|
/**
|
|
160
|
-
*
|
|
161
|
-
|
|
162
|
-
|
|
176
|
+
* How the campaign reaches people: by call or by WhatsApp.
|
|
177
|
+
*/
|
|
178
|
+
channelType?: "voice" | "whatsapp";
|
|
179
|
+
/**
|
|
180
|
+
* `queued`: not started yet (or its start is scheduled). `running`: reaching
|
|
181
|
+
* due recipients. `paused`: started, then paused; what is in progress
|
|
182
|
+
* finishes. `completed`: no recipient is left to reach.
|
|
163
183
|
*/
|
|
164
184
|
status?: "queued" | "running" | "paused" | "completed" | "cancelled" | "failed";
|
|
165
185
|
}
|
|
@@ -174,13 +194,21 @@ export interface UpdateRequest {
|
|
|
174
194
|
* Campaign id.
|
|
175
195
|
*/
|
|
176
196
|
campaignId: string;
|
|
197
|
+
/**
|
|
198
|
+
* Adds these recipients, before or after the start, skipping numbers the
|
|
199
|
+
* campaign already has. A list longer than one request arrives in parts this
|
|
200
|
+
* way, and repeating a part reaches nobody twice.
|
|
201
|
+
*/
|
|
202
|
+
addRecipients?: RaizCampaignRecipientInput[];
|
|
177
203
|
/**
|
|
178
204
|
* Changes only before the campaign starts.
|
|
179
205
|
*/
|
|
180
206
|
agentId?: string;
|
|
181
207
|
channelId?: string | null;
|
|
182
208
|
/**
|
|
183
|
-
* When calls may start, in the campaign's time zone.
|
|
209
|
+
* When calls may start and messages may leave, in the campaign's time zone.
|
|
210
|
+
* Empty: any time. Public holidays count like any other day: whether to reach
|
|
211
|
+
* people on one is the organization's decision.
|
|
184
212
|
*/
|
|
185
213
|
contactHours?: RaizContactHoursWindow[];
|
|
186
214
|
/**
|
|
@@ -191,7 +219,7 @@ export interface UpdateRequest {
|
|
|
191
219
|
firstMessage?: string | null;
|
|
192
220
|
instructions?: string | null;
|
|
193
221
|
/**
|
|
194
|
-
* Calls per recipient at most, retries included.
|
|
222
|
+
* Calls or messages per recipient at most, retries included.
|
|
195
223
|
*/
|
|
196
224
|
maxAttempts?: number;
|
|
197
225
|
/**
|
|
@@ -208,22 +236,26 @@ export interface UpdateRequest {
|
|
|
208
236
|
*/
|
|
209
237
|
paused?: boolean;
|
|
210
238
|
/**
|
|
211
|
-
* Before the campaign starts: the complete set,
|
|
212
|
-
*
|
|
213
|
-
* Once it started: only additions, so a long list can be sent in batches;
|
|
214
|
-
* addresses already in the campaign are left as they are, listed or not.
|
|
239
|
+
* Before the campaign starts: the complete set, replacing whoever was there.
|
|
240
|
+
* Once it started: only adds, skipping numbers it already has.
|
|
215
241
|
*/
|
|
216
242
|
recipients?: RaizCampaignRecipientInput[];
|
|
217
243
|
/**
|
|
218
|
-
* Wait before a retry
|
|
244
|
+
* Wait before a retry or reminder, up to a week.
|
|
219
245
|
*/
|
|
220
246
|
retryAfterMinutes?: number;
|
|
221
247
|
/**
|
|
222
|
-
*
|
|
248
|
+
* What earns another attempt: `no_answer` and `failure` on a call,
|
|
249
|
+
* `no_answer` and `not_delivered` on WhatsApp.
|
|
223
250
|
*/
|
|
224
|
-
retryOn?: ("no_answer" | "failure")[];
|
|
251
|
+
retryOn?: ("no_answer" | "failure" | "not_delivered")[];
|
|
225
252
|
scheduledEndAt?: Temporal.Instant | null;
|
|
226
253
|
scheduledStartAt?: Temporal.Instant | null;
|
|
254
|
+
/**
|
|
255
|
+
* WhatsApp only. On a started campaign it applies to the messages still to
|
|
256
|
+
* go.
|
|
257
|
+
*/
|
|
258
|
+
template?: RaizCampaignTemplateInput;
|
|
227
259
|
/**
|
|
228
260
|
* IANA time zone name.
|
|
229
261
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by forge. DO NOT EDIT.
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
import { Transport, instant, object, } from "../../_/index.js";
|
|
3
|
+
import { Transport, instant, object, union, } from "../../_/index.js";
|
|
4
4
|
import { RaizCampaignCodec, RaizCampaignPageCodec, } from "./models.js";
|
|
5
5
|
export function createClient(options) {
|
|
6
6
|
return bind(new Transport(options));
|
|
@@ -17,21 +17,21 @@ const CreateOperation = {
|
|
|
17
17
|
method: "POST",
|
|
18
18
|
route: "/v1/raiz/campaigns",
|
|
19
19
|
body: "flat",
|
|
20
|
-
request: object([["scheduledEndAt", null, instant], ["scheduledStartAt", null, instant]]),
|
|
20
|
+
request: union([object([["scheduledEndAt", null, instant], ["scheduledStartAt", null, instant]]), object([["scheduledEndAt", null, instant], ["scheduledStartAt", null, instant]])]),
|
|
21
21
|
response: object([["data", null, () => RaizCampaignCodec]]),
|
|
22
22
|
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
23
23
|
};
|
|
24
24
|
const GetOperation = {
|
|
25
25
|
method: "GET",
|
|
26
26
|
route: "/v1/raiz/campaigns/{campaignId}",
|
|
27
|
-
query: { expand: "expand", recipientsCursor: "recipientsCursor", recipientsDirection: "recipientsDirection", recipientsLimit: "recipientsLimit" },
|
|
27
|
+
query: { expand: "expand", recipientsCursor: "recipientsCursor", recipientsDirection: "recipientsDirection", recipientsLimit: "recipientsLimit", recipientsQ: "recipientsQ", recipientsStatus: "recipientsStatus" },
|
|
28
28
|
response: object([["data", null, () => RaizCampaignCodec]]),
|
|
29
29
|
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
30
30
|
};
|
|
31
31
|
const ListOperation = {
|
|
32
32
|
method: "GET",
|
|
33
33
|
route: "/v1/raiz/campaigns",
|
|
34
|
-
query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", status: "status" },
|
|
34
|
+
query: { cursor: "cursor", direction: "direction", limit: "limit", agentId: "agentId", channelType: "channelType", status: "status" },
|
|
35
35
|
response: object([["data", null, () => RaizCampaignPageCodec]]),
|
|
36
36
|
errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
37
37
|
};
|
|
@@ -2,4 +2,4 @@ export { ApiError } from "../../_/index.js";
|
|
|
2
2
|
export type { RequestOptions } from "../../_/index.js";
|
|
3
3
|
export { createClient } from "./client.js";
|
|
4
4
|
export type { Client, ClientOptions, CreateRequest, CreateResponse, GetRequest, GetResponse, ListRequest, ListResponse, UpdateRequest, UpdateResponse, } from "./client.js";
|
|
5
|
-
export type { RaizCampaign, RaizCampaignPage, RaizCampaignProgress, RaizCampaignRecipientInput, RaizCampaignRecipientPage, } from "./models.js";
|
|
5
|
+
export type { RaizCampaign, RaizCampaignBlocker, RaizCampaignPage, RaizCampaignProgress, RaizCampaignReadiness, RaizCampaignRecipientInput, RaizCampaignRecipientPage, RaizCampaignTemplate, RaizCampaignTemplateInput, } from "./models.js";
|
|
@@ -7,7 +7,13 @@ export interface RaizCampaign {
|
|
|
7
7
|
agentId: string;
|
|
8
8
|
channelId: string | null;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* How the campaign reaches people: by call or by WhatsApp.
|
|
11
|
+
*/
|
|
12
|
+
channelType: "voice" | "whatsapp";
|
|
13
|
+
/**
|
|
14
|
+
* When calls may start and messages may leave, in the campaign's time zone.
|
|
15
|
+
* Empty: any time. Public holidays count like any other day: whether to reach
|
|
16
|
+
* people on one is the organization's decision.
|
|
11
17
|
*/
|
|
12
18
|
contactHours: RaizContactHoursWindow[];
|
|
13
19
|
/**
|
|
@@ -15,6 +21,8 @@ export interface RaizCampaign {
|
|
|
15
21
|
*/
|
|
16
22
|
createdAt: Temporal.Instant;
|
|
17
23
|
endedAt: Temporal.Instant | null;
|
|
24
|
+
errorAt: Temporal.Instant | null;
|
|
25
|
+
errorCode: string | null;
|
|
18
26
|
firstMessage: string | null;
|
|
19
27
|
/**
|
|
20
28
|
* Campaign id.
|
|
@@ -34,28 +42,51 @@ export interface RaizCampaign {
|
|
|
34
42
|
* How many recipients are in each state.
|
|
35
43
|
*/
|
|
36
44
|
progress: RaizCampaignProgress;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the campaign can start, checked against its Agent, line, template
|
|
47
|
+
* and recipients without reaching anyone. Present only when expanded.
|
|
48
|
+
*/
|
|
49
|
+
readiness?: RaizCampaignReadiness;
|
|
37
50
|
/**
|
|
38
51
|
* The campaign's recipients in the order they were added, each with its
|
|
39
52
|
* latest attempt. Present only when expanded.
|
|
40
53
|
*/
|
|
41
54
|
recipients?: RaizCampaignRecipientPage;
|
|
42
55
|
retryAfterMinutes: number;
|
|
43
|
-
retryOn: ("no_answer" | "failure")[];
|
|
56
|
+
retryOn: ("no_answer" | "failure" | "not_delivered")[];
|
|
44
57
|
scheduledEndAt: Temporal.Instant | null;
|
|
45
58
|
scheduledStartAt: Temporal.Instant | null;
|
|
46
59
|
startedAt: Temporal.Instant | null;
|
|
47
60
|
/**
|
|
48
|
-
* `queued`: not started yet (or its start is scheduled). `running`:
|
|
49
|
-
* due recipients. `paused`: started, then paused;
|
|
50
|
-
* `completed`: no recipient is left to
|
|
61
|
+
* `queued`: not started yet (or its start is scheduled). `running`: reaching
|
|
62
|
+
* due recipients. `paused`: started, then paused; what is in progress
|
|
63
|
+
* finishes. `completed`: no recipient is left to reach.
|
|
51
64
|
*/
|
|
52
65
|
status: "queued" | "running" | "paused" | "completed" | "cancelled" | "failed";
|
|
66
|
+
template: RaizCampaignTemplate | null;
|
|
53
67
|
timeZone: string;
|
|
54
68
|
/**
|
|
55
69
|
* An instant in RFC 3339 format, in UTC.
|
|
56
70
|
*/
|
|
57
71
|
updatedAt: Temporal.Instant;
|
|
58
72
|
version: number;
|
|
73
|
+
waitingUntilAt: Temporal.Instant | null;
|
|
74
|
+
}
|
|
75
|
+
export interface RaizCampaignBlocker {
|
|
76
|
+
/**
|
|
77
|
+
* The recipient it is about, when it is one.
|
|
78
|
+
*/
|
|
79
|
+
address?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The error `startCampaign` would refuse with: `CAMPAIGN_AGENT_NOT_READY`,
|
|
82
|
+
* `CAMPAIGN_NO_RECIPIENTS`, `CAMPAIGN_VARIABLE_MISSING`, `CHANNEL_NOT_READY`,
|
|
83
|
+
* a `TEMPLATE_*` code, `UPSTREAM_UNAVAILABLE` or `VOICE_AGENT_NOT_READY`.
|
|
84
|
+
*/
|
|
85
|
+
code: string;
|
|
86
|
+
/**
|
|
87
|
+
* The variable it lacks, when it is one.
|
|
88
|
+
*/
|
|
89
|
+
variable?: string;
|
|
59
90
|
}
|
|
60
91
|
export interface RaizCampaignPage {
|
|
61
92
|
/**
|
|
@@ -72,34 +103,71 @@ export interface RaizCampaignPage {
|
|
|
72
103
|
pageInfo: PageInfo;
|
|
73
104
|
}
|
|
74
105
|
export interface RaizCampaignProgress {
|
|
106
|
+
/**
|
|
107
|
+
* Calls: recipients whose latest call someone answered and its analysis
|
|
108
|
+
* judged.
|
|
109
|
+
*/
|
|
110
|
+
answered: number;
|
|
75
111
|
completed: number;
|
|
112
|
+
/**
|
|
113
|
+
* WhatsApp: recipients who received a message.
|
|
114
|
+
*/
|
|
115
|
+
delivered: number;
|
|
76
116
|
failed: number;
|
|
77
117
|
inProgress: number;
|
|
118
|
+
/**
|
|
119
|
+
* Calls: recipients who failed because their calls ran out without anyone
|
|
120
|
+
* answering. A voicemail counts here.
|
|
121
|
+
*/
|
|
122
|
+
noAnswer: number;
|
|
78
123
|
pending: number;
|
|
124
|
+
/**
|
|
125
|
+
* WhatsApp: recipients who read a message.
|
|
126
|
+
*/
|
|
127
|
+
read: number;
|
|
79
128
|
recipients: number;
|
|
80
129
|
/**
|
|
81
|
-
*
|
|
130
|
+
* WhatsApp: recipients who replied.
|
|
131
|
+
*/
|
|
132
|
+
replied: number;
|
|
133
|
+
/**
|
|
134
|
+
* Recipients whose latest conversation's analysis judged it successful.
|
|
82
135
|
*/
|
|
83
136
|
succeeded: number;
|
|
84
137
|
}
|
|
138
|
+
export interface RaizCampaignReadiness {
|
|
139
|
+
/**
|
|
140
|
+
* What has to be fixed first. Empty when it can start.
|
|
141
|
+
*/
|
|
142
|
+
blockers: RaizCampaignBlocker[];
|
|
143
|
+
preview: string | null;
|
|
144
|
+
/**
|
|
145
|
+
* Whether `startCampaign` would accept it now.
|
|
146
|
+
*/
|
|
147
|
+
ready: boolean;
|
|
148
|
+
}
|
|
85
149
|
export interface RaizCampaignRecipientInput {
|
|
86
150
|
/**
|
|
87
151
|
* Phone number in E.164 format.
|
|
88
152
|
*/
|
|
89
153
|
address: RaizPhoneNumber;
|
|
90
154
|
/**
|
|
91
|
-
* The contact
|
|
92
|
-
* created when the organization has
|
|
155
|
+
* The contact this recipient is. Omitted: the contact that owns `address`
|
|
156
|
+
* when the campaign first reaches them, created when the organization has
|
|
157
|
+
* none.
|
|
93
158
|
*/
|
|
94
159
|
contactId?: string;
|
|
160
|
+
familyName?: string | null;
|
|
95
161
|
firstMessage?: string | null;
|
|
162
|
+
givenName?: string | null;
|
|
96
163
|
instructions?: string | null;
|
|
97
164
|
/**
|
|
98
|
-
* Values for the `{{name}}` variables
|
|
99
|
-
* or this campaign's texts
|
|
100
|
-
*
|
|
101
|
-
* `
|
|
102
|
-
* never
|
|
165
|
+
* Values for the `{{name}}` variables a WhatsApp template's parameters, or
|
|
166
|
+
* the Agent's instructions, first message or this campaign's texts on a call,
|
|
167
|
+
* reference. Raíz always provides `contact_name`, `contact_given_name` and
|
|
168
|
+
* `contact_phone`, and on a call also `contact_id`, `conversation_id` and
|
|
169
|
+
* `bulletins` (the business bulletins in force); a recipient's values never
|
|
170
|
+
* replace them.
|
|
103
171
|
*/
|
|
104
172
|
variables?: {
|
|
105
173
|
[key: string]: unknown;
|
|
@@ -114,8 +182,11 @@ export interface RaizCampaignRecipientPage {
|
|
|
114
182
|
attemptCount: number;
|
|
115
183
|
contactId: string | null;
|
|
116
184
|
createdAt: Temporal.Instant;
|
|
185
|
+
deliveredAt: Temporal.Instant | null;
|
|
117
186
|
errorCode: string | null;
|
|
187
|
+
familyName: string | null;
|
|
118
188
|
firstMessage: string | null;
|
|
189
|
+
givenName: string | null;
|
|
119
190
|
id: string;
|
|
120
191
|
instructions: string | null;
|
|
121
192
|
lastAttempt: {
|
|
@@ -125,6 +196,8 @@ export interface RaizCampaignRecipientPage {
|
|
|
125
196
|
status: "open" | "closed";
|
|
126
197
|
} | null;
|
|
127
198
|
nextAttemptAt: Temporal.Instant | null;
|
|
199
|
+
readAt: Temporal.Instant | null;
|
|
200
|
+
repliedAt: Temporal.Instant | null;
|
|
128
201
|
status: "pending" | "in_progress" | "completed" | "failed" | "cancelled";
|
|
129
202
|
updatedAt: Temporal.Instant;
|
|
130
203
|
variables: {
|
|
@@ -140,6 +213,44 @@ export interface RaizCampaignRecipientPage {
|
|
|
140
213
|
*/
|
|
141
214
|
pageInfo: PageInfo;
|
|
142
215
|
}
|
|
216
|
+
export interface RaizCampaignTemplate {
|
|
217
|
+
/**
|
|
218
|
+
* The template's language: WhatsApp's code (`es`, `es_MX`) or a BCP 47 tag
|
|
219
|
+
* (`es-MX`).
|
|
220
|
+
*/
|
|
221
|
+
language: string;
|
|
222
|
+
/**
|
|
223
|
+
* An approved template of the line's WhatsApp Business Account. Its body may
|
|
224
|
+
* have variables; a file in its header and button parameters cannot be used
|
|
225
|
+
* in a campaign.
|
|
226
|
+
*/
|
|
227
|
+
name: string;
|
|
228
|
+
/**
|
|
229
|
+
* The template's body parameters, in order. Each is a text that may reference
|
|
230
|
+
* each recipient's `variables` as `{{name}}`, for example `{{patient_name}}`
|
|
231
|
+
* or `Dr. {{doctor}}`.
|
|
232
|
+
*/
|
|
233
|
+
parameters: string[];
|
|
234
|
+
}
|
|
235
|
+
export interface RaizCampaignTemplateInput {
|
|
236
|
+
/**
|
|
237
|
+
* The template's language: WhatsApp's code (`es`, `es_MX`) or a BCP 47 tag
|
|
238
|
+
* (`es-MX`).
|
|
239
|
+
*/
|
|
240
|
+
language: string;
|
|
241
|
+
/**
|
|
242
|
+
* An approved template of the line's WhatsApp Business Account. Its body may
|
|
243
|
+
* have variables; a file in its header and button parameters cannot be used
|
|
244
|
+
* in a campaign.
|
|
245
|
+
*/
|
|
246
|
+
name: string;
|
|
247
|
+
/**
|
|
248
|
+
* The template's body parameters, in order. Each is a text that may reference
|
|
249
|
+
* each recipient's `variables` as `{{name}}`, for example `{{patient_name}}`
|
|
250
|
+
* or `Dr. {{doctor}}`.
|
|
251
|
+
*/
|
|
252
|
+
parameters?: string[];
|
|
253
|
+
}
|
|
143
254
|
export declare const RaizCampaignCodec: import("../../_/codec.js").Codec;
|
|
144
255
|
export declare const RaizCampaignPageCodec: import("../../_/codec.js").Codec;
|
|
145
256
|
export declare const RaizCampaignRecipientPageCodec: import("../../_/codec.js").Codec;
|
|
@@ -4,15 +4,17 @@ import { array, instant, object } from "../../_/index.js";
|
|
|
4
4
|
export const RaizCampaignCodec = object([
|
|
5
5
|
["createdAt", null, instant],
|
|
6
6
|
["endedAt", null, instant],
|
|
7
|
+
["errorAt", null, instant],
|
|
7
8
|
["recipients", null, () => RaizCampaignRecipientPageCodec],
|
|
8
9
|
["scheduledEndAt", null, instant],
|
|
9
10
|
["scheduledStartAt", null, instant],
|
|
10
11
|
["startedAt", null, instant],
|
|
11
12
|
["updatedAt", null, instant],
|
|
13
|
+
["waitingUntilAt", null, instant],
|
|
12
14
|
]);
|
|
13
15
|
export const RaizCampaignPageCodec = object([
|
|
14
16
|
["data", null, array(() => RaizCampaignCodec)],
|
|
15
17
|
]);
|
|
16
18
|
export const RaizCampaignRecipientPageCodec = object([
|
|
17
|
-
["data", null, array(object([["createdAt", null, instant], ["lastAttempt", null, object([["startedAt", null, instant]])], ["nextAttemptAt", null, instant], ["updatedAt", null, instant]]))],
|
|
19
|
+
["data", null, array(object([["createdAt", null, instant], ["deliveredAt", null, instant], ["lastAttempt", null, object([["startedAt", null, instant]])], ["nextAttemptAt", null, instant], ["readAt", null, instant], ["repliedAt", null, instant], ["updatedAt", null, instant]]))],
|
|
18
20
|
]);
|
package/dist/raiz/models.d.ts
CHANGED
|
@@ -373,7 +373,7 @@ export interface RaizFailureResponse {
|
|
|
373
373
|
data: {
|
|
374
374
|
[key: string]: unknown;
|
|
375
375
|
};
|
|
376
|
-
message: "Only a text Agent can hold a web conversation.";
|
|
376
|
+
message: "Only a text Agent can hold a web conversation; a voice Agent only with `origin: test`, to try it by text.";
|
|
377
377
|
retryable: false;
|
|
378
378
|
} | {
|
|
379
379
|
code: "CALL_IN_PROGRESS";
|
|
@@ -571,6 +571,28 @@ export interface RaizFailureResponse {
|
|
|
571
571
|
};
|
|
572
572
|
message: "The time zone is not in the IANA time zone database.";
|
|
573
573
|
retryable: false;
|
|
574
|
+
} | {
|
|
575
|
+
code: "CAMPAIGN_AGENT_NOT_READY";
|
|
576
|
+
data: {
|
|
577
|
+
[key: string]: unknown;
|
|
578
|
+
};
|
|
579
|
+
message: "The campaign's Agent must be an active text Agent: it answers whoever replies to the message.";
|
|
580
|
+
retryable: false;
|
|
581
|
+
} | {
|
|
582
|
+
code: "CAMPAIGN_NO_RECIPIENTS";
|
|
583
|
+
data: {
|
|
584
|
+
[key: string]: unknown;
|
|
585
|
+
};
|
|
586
|
+
message: "The campaign has nobody left to reach. Add recipients first.";
|
|
587
|
+
retryable: false;
|
|
588
|
+
} | {
|
|
589
|
+
code: "CAMPAIGN_VARIABLE_MISSING";
|
|
590
|
+
data: {
|
|
591
|
+
address: string;
|
|
592
|
+
variable: string;
|
|
593
|
+
};
|
|
594
|
+
message: "A recipient has no value for a variable the template's parameters use. An empty value cannot be sent on WhatsApp.";
|
|
595
|
+
retryable: false;
|
|
574
596
|
} | {
|
|
575
597
|
code: "CHANNEL_AGENT_MISMATCH";
|
|
576
598
|
data: {
|
|
@@ -676,6 +698,13 @@ export interface RaizFailureResponse {
|
|
|
676
698
|
};
|
|
677
699
|
message: "The template needs header text variables, a location header or button parameters, which cannot be sent yet.";
|
|
678
700
|
retryable: false;
|
|
701
|
+
} | {
|
|
702
|
+
code: "WHATSAPP_ACCOUNT_RESTRICTED";
|
|
703
|
+
data: {
|
|
704
|
+
[key: string]: unknown;
|
|
705
|
+
};
|
|
706
|
+
message: "WhatsApp has restricted this number or its business account. Review the account's status before sending again.";
|
|
707
|
+
retryable: false;
|
|
679
708
|
} | {
|
|
680
709
|
code: "WHATSAPP_AI_PAUSED";
|
|
681
710
|
data: {
|
|
@@ -711,6 +740,13 @@ export interface RaizFailureResponse {
|
|
|
711
740
|
};
|
|
712
741
|
message: "WhatsApp never confirmed whether the message was sent. It was not sent again.";
|
|
713
742
|
retryable: false;
|
|
743
|
+
} | {
|
|
744
|
+
code: "WHATSAPP_ENGAGEMENT_LIMITED";
|
|
745
|
+
data: {
|
|
746
|
+
[key: string]: unknown;
|
|
747
|
+
};
|
|
748
|
+
message: "WhatsApp limited how many marketing messages this person receives. Wait at least a day before sending again.";
|
|
749
|
+
retryable: true;
|
|
714
750
|
} | {
|
|
715
751
|
code: "WHATSAPP_MARKETING_STOPPED";
|
|
716
752
|
data: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OutcomeUnknownFailure, RateLimitedFailure, ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
|
|
2
|
-
import type { SanitasConnectionRequiredFailure, SanitasLoginCoolingDownFailure, SanitasPatientUnresolvedFailure, SanitasProviderChallengeRequiredFailure, SanitasProviderProtocolChangedFailure, SanitasProviderSessionExpiredFailure, SanitasProviderUnavailableFailure } from "../models.js";
|
|
2
|
+
import type { SanitasConnectionRequiredFailure, SanitasLoginCoolingDownFailure, SanitasPatientUnresolvedFailure, SanitasProviderChallengeRequiredFailure, SanitasProviderContextRequiredFailure, SanitasProviderProtocolChangedFailure, SanitasProviderSessionExpiredFailure, SanitasProviderUnavailableFailure } from "../models.js";
|
|
3
3
|
/**
|
|
4
4
|
* A failed answer.
|
|
5
5
|
*/
|
|
@@ -18,6 +18,11 @@ export interface SanitasLookupAffiliationBody {
|
|
|
18
18
|
connectionId?: string;
|
|
19
19
|
documentNumber: string;
|
|
20
20
|
documentType: "AS" | "CC" | "CD" | "CE" | "CN" | "MS" | "NI" | "NU" | "PA" | "PD" | "PE" | "PT" | "RC" | "SC" | "TI";
|
|
21
|
+
/**
|
|
22
|
+
* An exact provider context id from getConnection(expand: providers),
|
|
23
|
+
* required when the source has no selected default.
|
|
24
|
+
*/
|
|
25
|
+
providerId?: string;
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
28
|
* A failed answer.
|
|
@@ -31,7 +36,7 @@ export interface SanitasLookupAffiliationConflictError {
|
|
|
31
36
|
metadata: ResponseMetadata;
|
|
32
37
|
success: false;
|
|
33
38
|
}
|
|
34
|
-
export type SanitasLookupAffiliationConflictFailure = SanitasConnectionRequiredFailure | SanitasProviderSessionExpiredFailure | SanitasPatientUnresolvedFailure;
|
|
39
|
+
export type SanitasLookupAffiliationConflictFailure = SanitasConnectionRequiredFailure | SanitasProviderContextRequiredFailure | SanitasProviderSessionExpiredFailure | SanitasPatientUnresolvedFailure;
|
|
35
40
|
/**
|
|
36
41
|
* A failed answer.
|
|
37
42
|
*/
|
|
@@ -10,7 +10,8 @@ export interface Client {
|
|
|
10
10
|
/**
|
|
11
11
|
* Get connection
|
|
12
12
|
*
|
|
13
|
-
* Read safe status
|
|
13
|
+
* Read safe status. expand providers reads the available business provider
|
|
14
|
+
* contexts with the retained session, without submitting credentials.
|
|
14
15
|
*/
|
|
15
16
|
get(request: GetRequest, options?: RequestOptions): Promise<GetResponse>;
|
|
16
17
|
}
|
|
@@ -21,5 +22,9 @@ export interface GetRequest {
|
|
|
21
22
|
* The connection id.
|
|
22
23
|
*/
|
|
23
24
|
connectionId: string;
|
|
25
|
+
/**
|
|
26
|
+
* The expand.
|
|
27
|
+
*/
|
|
28
|
+
expand?: "providers";
|
|
24
29
|
}
|
|
25
30
|
export type GetResponse = SanitasSanitasConnectionResponse;
|
|
@@ -13,6 +13,7 @@ export function bind(transport) {
|
|
|
13
13
|
const GetOperation = {
|
|
14
14
|
method: "GET",
|
|
15
15
|
route: "/v1/sanitas/connections/{connectionId}",
|
|
16
|
+
query: { expand: "expand" },
|
|
16
17
|
response: SanitasSanitasConnectionResponseCodec,
|
|
17
18
|
errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "422": true, "429": true, "500": true, "502": true, "503": true, "504": true },
|
|
18
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OutcomeUnknownFailure, RateLimitedFailure, ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
|
|
2
|
-
import type { SanitasConnectionRequiredFailure, SanitasLoginCoolingDownFailure, SanitasPatientUnresolvedFailure, SanitasProviderChallengeRequiredFailure, SanitasProviderProtocolChangedFailure, SanitasProviderSessionExpiredFailure, SanitasProviderUnavailableFailure } from "../models.js";
|
|
2
|
+
import type { SanitasConnectionRequiredFailure, SanitasLoginCoolingDownFailure, SanitasPatientUnresolvedFailure, SanitasProviderChallengeRequiredFailure, SanitasProviderContextRequiredFailure, SanitasProviderProtocolChangedFailure, SanitasProviderSessionExpiredFailure, SanitasProviderUnavailableFailure } from "../models.js";
|
|
3
3
|
/**
|
|
4
4
|
* A failed answer.
|
|
5
5
|
*/
|
|
@@ -25,7 +25,7 @@ export interface SanitasGetConnectionConflictError {
|
|
|
25
25
|
metadata: ResponseMetadata;
|
|
26
26
|
success: false;
|
|
27
27
|
}
|
|
28
|
-
export type SanitasGetConnectionConflictFailure = SanitasConnectionRequiredFailure | SanitasProviderSessionExpiredFailure | SanitasPatientUnresolvedFailure;
|
|
28
|
+
export type SanitasGetConnectionConflictFailure = SanitasConnectionRequiredFailure | SanitasProviderContextRequiredFailure | SanitasProviderSessionExpiredFailure | SanitasPatientUnresolvedFailure;
|
|
29
29
|
/**
|
|
30
30
|
* A failed answer.
|
|
31
31
|
*/
|
|
@@ -55,6 +55,11 @@ export type SanitasGetConnectionTooManyRequestsFailure = RateLimitedFailure | Sa
|
|
|
55
55
|
export interface SanitasSanitasConnection {
|
|
56
56
|
errorCode: string | null;
|
|
57
57
|
id: string;
|
|
58
|
+
providers: {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
selected: boolean;
|
|
62
|
+
}[] | null;
|
|
58
63
|
status: "active" | "failed";
|
|
59
64
|
verifiedAt: Temporal.Instant | null;
|
|
60
65
|
}
|
package/dist/sanitas/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { ApiError } from "../_/index.js";
|
|
|
2
2
|
export type { RequestOptions } from "../_/index.js";
|
|
3
3
|
export { createClient } from "./client.js";
|
|
4
4
|
export type { Client, ClientOptions, } from "./client.js";
|
|
5
|
-
export type { SanitasConnectionNotFoundError, SanitasConnectionNotFoundFailure, SanitasConnectionRequiredFailure, SanitasCredentialsRejectedError, SanitasCredentialsRejectedFailure, SanitasLoginCoolingDownFailure, SanitasPatientUnresolvedFailure, SanitasProviderChallengeRequiredFailure, SanitasProviderProtocolChangedFailure, SanitasProviderSessionExpiredFailure, SanitasProviderUnavailableFailure, } from "./models.js";
|
|
5
|
+
export type { SanitasConnectionNotFoundError, SanitasConnectionNotFoundFailure, SanitasConnectionRequiredFailure, SanitasCredentialsRejectedError, SanitasCredentialsRejectedFailure, SanitasLoginCoolingDownFailure, SanitasPatientUnresolvedFailure, SanitasProviderChallengeRequiredFailure, SanitasProviderContextRequiredFailure, SanitasProviderProtocolChangedFailure, SanitasProviderSessionExpiredFailure, SanitasProviderUnavailableFailure, } from "./models.js";
|
package/dist/sanitas/models.d.ts
CHANGED
|
@@ -155,6 +155,28 @@ export interface SanitasProviderChallengeRequiredFailure {
|
|
|
155
155
|
*/
|
|
156
156
|
retryable: false;
|
|
157
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Select one of this connection’s provider contexts before querying
|
|
160
|
+
* affiliation.
|
|
161
|
+
*/
|
|
162
|
+
export interface SanitasProviderContextRequiredFailure {
|
|
163
|
+
/**
|
|
164
|
+
* The failure code, stable across releases.
|
|
165
|
+
*/
|
|
166
|
+
code: "PROVIDER_CONTEXT_REQUIRED";
|
|
167
|
+
/**
|
|
168
|
+
* No fields.
|
|
169
|
+
*/
|
|
170
|
+
data: Empty;
|
|
171
|
+
/**
|
|
172
|
+
* What went wrong, for people; it never contains input values.
|
|
173
|
+
*/
|
|
174
|
+
message: string;
|
|
175
|
+
/**
|
|
176
|
+
* Whether repeating the same request may succeed.
|
|
177
|
+
*/
|
|
178
|
+
retryable: false;
|
|
179
|
+
}
|
|
158
180
|
/**
|
|
159
181
|
* The provider response could not be verified.
|
|
160
182
|
*/
|
|
@@ -37,9 +37,10 @@ export interface SuraLookupEligibilityBody {
|
|
|
37
37
|
*/
|
|
38
38
|
documentNumber: string;
|
|
39
39
|
/**
|
|
40
|
-
* Document type. Defaults to CC.
|
|
40
|
+
* Document type. Defaults to CC. CE, RC and TI are read through the same
|
|
41
|
+
* form.
|
|
41
42
|
*/
|
|
42
|
-
documentType?: "CC" | null;
|
|
43
|
+
documentType?: "CC" | "CE" | "RC" | "TI" | null;
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* A failed answer.
|
|
@@ -10,11 +10,12 @@ export interface Client {
|
|
|
10
10
|
/**
|
|
11
11
|
* Look up an authorization
|
|
12
12
|
*
|
|
13
|
-
* Read an existing SaludWeb authorization for the exact
|
|
14
|
-
*
|
|
15
|
-
* type, fixed fee or copay
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* Read an existing SaludWeb authorization for the exact patient, issuer and
|
|
14
|
+
* authorization number. Reports its status, dates, the authorized procedures,
|
|
15
|
+
* the provider it is directed to, explicit charge type, fixed fee or copay
|
|
16
|
+
* percentage and provider-reported payments. Procedures that could not be
|
|
17
|
+
* read, unknown balance and copay cap remain null. Does not issue, attend,
|
|
18
|
+
* modify or pay an authorization.
|
|
18
19
|
*/
|
|
19
20
|
lookup(request: LookupRequest, options?: RequestOptions): Promise<LookupResponse>;
|
|
20
21
|
}
|
|
@@ -41,9 +41,10 @@ export interface SuraLookupAuthorizationBody {
|
|
|
41
41
|
*/
|
|
42
42
|
documentNumber: string;
|
|
43
43
|
/**
|
|
44
|
-
* Document type. Defaults to CC.
|
|
44
|
+
* Document type. Defaults to CC. CE, RC and TI are read through the same
|
|
45
|
+
* form.
|
|
45
46
|
*/
|
|
46
|
-
documentType?: "CC" | null;
|
|
47
|
+
documentType?: "CC" | "CE" | "RC" | "TI" | null;
|
|
47
48
|
/**
|
|
48
49
|
* Issuer code before the hyphen in the authorization identifier.
|
|
49
50
|
*/
|
package/dist/sura/models.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface SuraAffiliation {
|
|
|
7
7
|
*/
|
|
8
8
|
aiHint: string;
|
|
9
9
|
documentNumber: string;
|
|
10
|
-
documentType: "CC";
|
|
10
|
+
documentType: "CC" | "CE" | "RC" | "TI";
|
|
11
11
|
incomeGroup: string;
|
|
12
12
|
ok: true;
|
|
13
13
|
outcome: "eligible";
|
|
@@ -76,7 +76,7 @@ export interface SuraAuthorization {
|
|
|
76
76
|
aiHint: string;
|
|
77
77
|
authorizationNumber: string;
|
|
78
78
|
documentNumber: string;
|
|
79
|
-
documentType: "CC";
|
|
79
|
+
documentType: "CC" | "CE" | "RC" | "TI";
|
|
80
80
|
/**
|
|
81
81
|
* YYYY/MM/DD, as SURA writes it.
|
|
82
82
|
*/
|
|
@@ -100,8 +100,27 @@ export interface SuraAuthorization {
|
|
|
100
100
|
issuerCode: string;
|
|
101
101
|
ok: true;
|
|
102
102
|
outcome: "found";
|
|
103
|
+
/**
|
|
104
|
+
* What it covers. Null means the portal did not establish it, never that it
|
|
105
|
+
* covers nothing.
|
|
106
|
+
*/
|
|
107
|
+
procedures: {
|
|
108
|
+
code: string;
|
|
109
|
+
description: string;
|
|
110
|
+
quantity: number;
|
|
111
|
+
}[] | null;
|
|
103
112
|
providerCode: string;
|
|
113
|
+
/**
|
|
114
|
+
* ENTREGADA, POR CONVENIO or ANULADA. An ANULADA authorization no longer
|
|
115
|
+
* serves.
|
|
116
|
+
*/
|
|
104
117
|
providerStatus: string;
|
|
118
|
+
receivingProvider: {
|
|
119
|
+
branchCode: string;
|
|
120
|
+
branchName: string;
|
|
121
|
+
documentNumber: string;
|
|
122
|
+
name: string;
|
|
123
|
+
} | null;
|
|
105
124
|
}
|
|
106
125
|
export interface SuraAvailability {
|
|
107
126
|
/**
|
|
@@ -273,7 +292,7 @@ export interface SuraNoContract {
|
|
|
273
292
|
*/
|
|
274
293
|
aiHint: string;
|
|
275
294
|
documentNumber: string;
|
|
276
|
-
documentType: "CC";
|
|
295
|
+
documentType: "CC" | "CE" | "RC" | "TI";
|
|
277
296
|
ok: true;
|
|
278
297
|
outcome: "noContract";
|
|
279
298
|
providerCode: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbol-ai/sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.39.0",
|
|
4
4
|
"description": "The Arbol API for TypeScript and JavaScript, generated by Cloudflare Forge from the platform's public OpenAPI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arbol",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"packageManager": "bun@1.4.3",
|
|
59
59
|
"arbol": {
|
|
60
60
|
"openapi": {
|
|
61
|
-
"release": "1.20261105.
|
|
62
|
-
"sha256": "
|
|
61
|
+
"release": "1.20261105.193553",
|
|
62
|
+
"sha256": "a7fefc26e04f60595cdd40d058867d090d19e0976d5bae8aa3d2bcd2d3b2b7ff"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|