@zavudev/sdk 0.30.0 → 0.38.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/CHANGELOG.md +124 -0
- package/client.d.mts +28 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +28 -4
- package/client.d.ts.map +1 -1
- package/client.js +25 -1
- package/client.js.map +1 -1
- package/client.mjs +25 -1
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/balance.d.mts +33 -0
- package/resources/balance.d.mts.map +1 -0
- package/resources/balance.d.ts +33 -0
- package/resources/balance.d.ts.map +1 -0
- package/resources/balance.js +16 -0
- package/resources/balance.js.map +1 -0
- package/resources/balance.mjs +12 -0
- package/resources/balance.mjs.map +1 -0
- package/resources/broadcasts/broadcasts.d.mts +31 -1
- package/resources/broadcasts/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts/broadcasts.d.ts +31 -1
- package/resources/broadcasts/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts/broadcasts.js +28 -0
- package/resources/broadcasts/broadcasts.js.map +1 -1
- package/resources/broadcasts/broadcasts.mjs +28 -0
- package/resources/broadcasts/broadcasts.mjs.map +1 -1
- package/resources/broadcasts/index.d.mts +1 -1
- package/resources/broadcasts/index.d.mts.map +1 -1
- package/resources/broadcasts/index.d.ts +1 -1
- package/resources/broadcasts/index.d.ts.map +1 -1
- package/resources/broadcasts/index.js.map +1 -1
- package/resources/broadcasts/index.mjs.map +1 -1
- package/resources/contacts/channels.d.mts +127 -0
- package/resources/contacts/channels.d.mts.map +1 -0
- package/resources/contacts/channels.d.ts +127 -0
- package/resources/contacts/channels.d.ts.map +1 -0
- package/resources/contacts/channels.js +76 -0
- package/resources/contacts/channels.js.map +1 -0
- package/resources/contacts/channels.mjs +72 -0
- package/resources/contacts/channels.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +262 -0
- package/resources/contacts/contacts.d.mts.map +1 -0
- package/resources/contacts/contacts.d.ts +262 -0
- package/resources/contacts/contacts.d.ts.map +1 -0
- package/resources/contacts/contacts.js +118 -0
- package/resources/contacts/contacts.js.map +1 -0
- package/resources/contacts/contacts.mjs +113 -0
- package/resources/contacts/contacts.mjs.map +1 -0
- package/resources/contacts/index.d.mts +3 -0
- package/resources/contacts/index.d.mts.map +1 -0
- package/resources/contacts/index.d.ts +3 -0
- package/resources/contacts/index.d.ts.map +1 -0
- package/resources/contacts/index.js +9 -0
- package/resources/contacts/index.js.map +1 -0
- package/resources/contacts/index.mjs +4 -0
- package/resources/contacts/index.mjs.map +1 -0
- package/resources/contacts.d.mts +1 -144
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +1 -144
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +2 -31
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +1 -29
- package/resources/contacts.mjs.map +1 -1
- package/resources/exports.d.mts +101 -0
- package/resources/exports.d.mts.map +1 -0
- package/resources/exports.d.ts +101 -0
- package/resources/exports.d.ts.map +1 -0
- package/resources/exports.js +53 -0
- package/resources/exports.js.map +1 -0
- package/resources/exports.mjs +49 -0
- package/resources/exports.mjs.map +1 -0
- package/resources/index.d.mts +10 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +10 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +18 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +9 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invitations.d.mts +133 -0
- package/resources/invitations.d.mts.map +1 -0
- package/resources/invitations.d.ts +133 -0
- package/resources/invitations.d.ts.map +1 -0
- package/resources/invitations.js +67 -0
- package/resources/invitations.js.map +1 -0
- package/resources/invitations.mjs +63 -0
- package/resources/invitations.mjs.map +1 -0
- package/resources/messages.d.mts +37 -4
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +37 -4
- package/resources/messages.d.ts.map +1 -1
- package/resources/number-10dlc/brands.d.mts +258 -0
- package/resources/number-10dlc/brands.d.mts.map +1 -0
- package/resources/number-10dlc/brands.d.ts +258 -0
- package/resources/number-10dlc/brands.d.ts.map +1 -0
- package/resources/number-10dlc/brands.js +132 -0
- package/resources/number-10dlc/brands.js.map +1 -0
- package/resources/number-10dlc/brands.mjs +128 -0
- package/resources/number-10dlc/brands.mjs.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.d.mts +223 -0
- package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.d.ts +223 -0
- package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.js +133 -0
- package/resources/number-10dlc/campaigns/campaigns.js.map +1 -0
- package/resources/number-10dlc/campaigns/campaigns.mjs +128 -0
- package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -0
- package/resources/number-10dlc/campaigns/index.d.mts +3 -0
- package/resources/number-10dlc/campaigns/index.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns/index.d.ts +3 -0
- package/resources/number-10dlc/campaigns/index.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns/index.js +9 -0
- package/resources/number-10dlc/campaigns/index.js.map +1 -0
- package/resources/number-10dlc/campaigns/index.mjs +4 -0
- package/resources/number-10dlc/campaigns/index.mjs.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.mts +79 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.ts +79 -0
- package/resources/number-10dlc/campaigns/phone-numbers.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.js +59 -0
- package/resources/number-10dlc/campaigns/phone-numbers.js.map +1 -0
- package/resources/number-10dlc/campaigns/phone-numbers.mjs +55 -0
- package/resources/number-10dlc/campaigns/phone-numbers.mjs.map +1 -0
- package/resources/number-10dlc/campaigns.d.mts +2 -0
- package/resources/number-10dlc/campaigns.d.mts.map +1 -0
- package/resources/number-10dlc/campaigns.d.ts +2 -0
- package/resources/number-10dlc/campaigns.d.ts.map +1 -0
- package/resources/number-10dlc/campaigns.js +6 -0
- package/resources/number-10dlc/campaigns.js.map +1 -0
- package/resources/number-10dlc/campaigns.mjs +3 -0
- package/resources/number-10dlc/campaigns.mjs.map +1 -0
- package/resources/number-10dlc/index.d.mts +4 -0
- package/resources/number-10dlc/index.d.mts.map +1 -0
- package/resources/number-10dlc/index.d.ts +4 -0
- package/resources/number-10dlc/index.d.ts.map +1 -0
- package/resources/number-10dlc/index.js +11 -0
- package/resources/number-10dlc/index.js.map +1 -0
- package/resources/number-10dlc/index.mjs +5 -0
- package/resources/number-10dlc/index.mjs.map +1 -0
- package/resources/number-10dlc/number-10dlc.d.mts +14 -0
- package/resources/number-10dlc/number-10dlc.d.mts.map +1 -0
- package/resources/number-10dlc/number-10dlc.d.ts +14 -0
- package/resources/number-10dlc/number-10dlc.d.ts.map +1 -0
- package/resources/number-10dlc/number-10dlc.js +21 -0
- package/resources/number-10dlc/number-10dlc.js.map +1 -0
- package/resources/number-10dlc/number-10dlc.mjs +16 -0
- package/resources/number-10dlc/number-10dlc.mjs.map +1 -0
- package/resources/number-10dlc.d.mts +2 -0
- package/resources/number-10dlc.d.mts.map +1 -0
- package/resources/number-10dlc.d.ts +2 -0
- package/resources/number-10dlc.d.ts.map +1 -0
- package/resources/number-10dlc.js +6 -0
- package/resources/number-10dlc.js.map +1 -0
- package/resources/number-10dlc.mjs +3 -0
- package/resources/number-10dlc.mjs.map +1 -0
- package/resources/plan.d.mts +43 -0
- package/resources/plan.d.mts.map +1 -0
- package/resources/plan.d.ts +43 -0
- package/resources/plan.d.ts.map +1 -0
- package/resources/plan.js +16 -0
- package/resources/plan.js.map +1 -0
- package/resources/plan.mjs +12 -0
- package/resources/plan.mjs.map +1 -0
- package/resources/senders/agent/agent.d.mts +4 -4
- package/resources/senders/agent/agent.d.mts.map +1 -1
- package/resources/senders/agent/agent.d.ts +4 -4
- package/resources/senders/agent/agent.d.ts.map +1 -1
- package/resources/senders/agent/agent.js.map +1 -1
- package/resources/senders/agent/agent.mjs.map +1 -1
- package/resources/senders/agent/flows.d.mts +40 -114
- package/resources/senders/agent/flows.d.mts.map +1 -1
- package/resources/senders/agent/flows.d.ts +40 -114
- package/resources/senders/agent/flows.d.ts.map +1 -1
- package/resources/senders/agent/index.d.mts +2 -2
- package/resources/senders/agent/index.d.mts.map +1 -1
- package/resources/senders/agent/index.d.ts +2 -2
- package/resources/senders/agent/index.d.ts.map +1 -1
- package/resources/senders/agent/index.js.map +1 -1
- package/resources/senders/agent/index.mjs.map +1 -1
- package/resources/senders/agent/tools.d.mts +15 -47
- package/resources/senders/agent/tools.d.mts.map +1 -1
- package/resources/senders/agent/tools.d.ts +15 -47
- package/resources/senders/agent/tools.d.ts.map +1 -1
- package/resources/senders/index.d.mts +1 -0
- package/resources/senders/index.d.mts.map +1 -1
- package/resources/senders/index.d.ts +1 -0
- package/resources/senders/index.d.ts.map +1 -1
- package/resources/senders/index.js +3 -1
- package/resources/senders/index.js.map +1 -1
- package/resources/senders/index.mjs +1 -0
- package/resources/senders/index.mjs.map +1 -1
- package/resources/senders/senders.d.mts +17 -1
- package/resources/senders/senders.d.mts.map +1 -1
- package/resources/senders/senders.d.ts +17 -1
- package/resources/senders/senders.d.ts.map +1 -1
- package/resources/senders/senders.js +4 -0
- package/resources/senders/senders.js.map +1 -1
- package/resources/senders/senders.mjs +4 -0
- package/resources/senders/senders.mjs.map +1 -1
- package/resources/senders/whatsapp-sync.d.mts +134 -0
- package/resources/senders/whatsapp-sync.d.mts.map +1 -0
- package/resources/senders/whatsapp-sync.d.ts +134 -0
- package/resources/senders/whatsapp-sync.d.ts.map +1 -0
- package/resources/senders/whatsapp-sync.js +56 -0
- package/resources/senders/whatsapp-sync.js.map +1 -0
- package/resources/senders/whatsapp-sync.mjs +52 -0
- package/resources/senders/whatsapp-sync.mjs.map +1 -0
- package/resources/sub-accounts/api-keys.d.mts +85 -0
- package/resources/sub-accounts/api-keys.d.mts.map +1 -0
- package/resources/sub-accounts/api-keys.d.ts +85 -0
- package/resources/sub-accounts/api-keys.d.ts.map +1 -0
- package/resources/sub-accounts/api-keys.js +53 -0
- package/resources/sub-accounts/api-keys.js.map +1 -0
- package/resources/sub-accounts/api-keys.mjs +49 -0
- package/resources/sub-accounts/api-keys.mjs.map +1 -0
- package/resources/sub-accounts/index.d.mts +3 -0
- package/resources/sub-accounts/index.d.mts.map +1 -0
- package/resources/sub-accounts/index.d.ts +3 -0
- package/resources/sub-accounts/index.d.ts.map +1 -0
- package/resources/sub-accounts/index.js +9 -0
- package/resources/sub-accounts/index.js.map +1 -0
- package/resources/sub-accounts/index.mjs +4 -0
- package/resources/sub-accounts/index.mjs.map +1 -0
- package/resources/sub-accounts/sub-accounts.d.mts +168 -0
- package/resources/sub-accounts/sub-accounts.d.mts.map +1 -0
- package/resources/sub-accounts/sub-accounts.d.ts +168 -0
- package/resources/sub-accounts/sub-accounts.d.ts.map +1 -0
- package/resources/sub-accounts/sub-accounts.js +94 -0
- package/resources/sub-accounts/sub-accounts.js.map +1 -0
- package/resources/sub-accounts/sub-accounts.mjs +89 -0
- package/resources/sub-accounts/sub-accounts.mjs.map +1 -0
- package/resources/sub-accounts.d.mts +2 -0
- package/resources/sub-accounts.d.mts.map +1 -0
- package/resources/sub-accounts.d.ts +2 -0
- package/resources/sub-accounts.d.ts.map +1 -0
- package/resources/sub-accounts.js +6 -0
- package/resources/sub-accounts.js.map +1 -0
- package/resources/sub-accounts.mjs +3 -0
- package/resources/sub-accounts.mjs.map +1 -0
- package/resources/templates.d.mts +42 -2
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +42 -2
- package/resources/templates.d.ts.map +1 -1
- package/resources/urls.d.mts +88 -0
- package/resources/urls.d.mts.map +1 -0
- package/resources/urls.d.ts +88 -0
- package/resources/urls.d.ts.map +1 -0
- package/resources/urls.js +55 -0
- package/resources/urls.js.map +1 -0
- package/resources/urls.mjs +51 -0
- package/resources/urls.mjs.map +1 -0
- package/resources/usage.d.mts +36 -0
- package/resources/usage.d.mts.map +1 -0
- package/resources/usage.d.ts +36 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +16 -0
- package/resources/usage.js.map +1 -0
- package/resources/usage.mjs +12 -0
- package/resources/usage.mjs.map +1 -0
- package/src/client.ts +130 -6
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/balance.ts +43 -0
- package/src/resources/broadcasts/broadcasts.ts +40 -0
- package/src/resources/broadcasts/index.ts +2 -0
- package/src/resources/contacts/channels.ts +177 -0
- package/src/resources/contacts/contacts.ts +360 -0
- package/src/resources/contacts/index.ts +22 -0
- package/src/resources/contacts.ts +1 -196
- package/src/resources/exports.ts +141 -0
- package/src/resources/index.ts +51 -1
- package/src/resources/invitations.ts +188 -0
- package/src/resources/messages.ts +43 -3
- package/src/resources/number-10dlc/brands.ts +377 -0
- package/src/resources/number-10dlc/campaigns/campaigns.ts +349 -0
- package/src/resources/number-10dlc/campaigns/index.ts +23 -0
- package/src/resources/number-10dlc/campaigns/phone-numbers.ts +123 -0
- package/src/resources/number-10dlc/campaigns.ts +3 -0
- package/src/resources/number-10dlc/index.ts +30 -0
- package/src/resources/number-10dlc/number-10dlc.ts +71 -0
- package/src/resources/number-10dlc.ts +3 -0
- package/src/resources/plan.ts +62 -0
- package/src/resources/senders/agent/agent.ts +6 -0
- package/src/resources/senders/agent/flows.ts +44 -126
- package/src/resources/senders/agent/index.ts +3 -0
- package/src/resources/senders/agent/tools.ts +13 -50
- package/src/resources/senders/index.ts +9 -0
- package/src/resources/senders/senders.ts +38 -1
- package/src/resources/senders/whatsapp-sync.ts +175 -0
- package/src/resources/sub-accounts/api-keys.ts +126 -0
- package/src/resources/sub-accounts/index.ts +22 -0
- package/src/resources/sub-accounts/sub-accounts.ts +246 -0
- package/src/resources/sub-accounts.ts +3 -0
- package/src/resources/templates.ts +51 -2
- package/src/resources/urls.ts +125 -0
- package/src/resources/usage.ts +48 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.d.mts","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAIhF;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAI1E;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC;IAIvC;;;;;;;OAOG;IACH,sBAAsB,CAAC,SAAS,EAAE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,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as ChannelsAPI from "./channels.js";
|
|
3
|
+
import { ChannelAddParams, ChannelAddResponse, ChannelRemoveParams, ChannelSetPrimaryParams, ChannelSetPrimaryResponse, ChannelUpdateParams, ChannelUpdateResponse, Channels } from "./channels.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { Cursor, type CursorParams, PagePromise } from "../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
export declare class Contacts extends APIResource {
|
|
8
|
+
channels: ChannelsAPI.Channels;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new contact with one or more communication channels.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const contact = await client.contacts.create({
|
|
15
|
+
* channels: [
|
|
16
|
+
* {
|
|
17
|
+
* channel: 'sms',
|
|
18
|
+
* identifier: '+14155551234',
|
|
19
|
+
* isPrimary: true,
|
|
20
|
+
* },
|
|
21
|
+
* ],
|
|
22
|
+
* displayName: 'John Doe',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
create(body: ContactCreateParams, options?: RequestOptions): APIPromise<Contact>;
|
|
27
|
+
/**
|
|
28
|
+
* Get contact
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const contact = await client.contacts.retrieve('contactId');
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
retrieve(contactID: string, options?: RequestOptions): APIPromise<Contact>;
|
|
36
|
+
/**
|
|
37
|
+
* Update contact
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const contact = await client.contacts.update('contactId');
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
update(contactID: string, body: ContactUpdateParams, options?: RequestOptions): APIPromise<Contact>;
|
|
45
|
+
/**
|
|
46
|
+
* List contacts with their communication channels.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* // Automatically fetches more pages as needed.
|
|
51
|
+
* for await (const contact of client.contacts.list()) {
|
|
52
|
+
* // ...
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
list(query?: ContactListParams | null | undefined, options?: RequestOptions): PagePromise<ContactsCursor, Contact>;
|
|
57
|
+
/**
|
|
58
|
+
* Dismiss the merge suggestion for a contact.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* await client.contacts.dismissMergeSuggestion('contactId');
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
dismissMergeSuggestion(contactID: string, options?: RequestOptions): APIPromise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Merge a source contact into this contact. All channels from the source contact
|
|
68
|
+
* will be moved to the target contact, and the source contact will be marked as
|
|
69
|
+
* merged.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const contact = await client.contacts.merge('contactId', {
|
|
74
|
+
* sourceContactId: 'jx7xyz789',
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
merge(contactID: string, body: ContactMergeParams, options?: RequestOptions): APIPromise<Contact>;
|
|
79
|
+
/**
|
|
80
|
+
* Get contact by phone number
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const contact = await client.contacts.retrieveByPhone(
|
|
85
|
+
* 'phoneNumber',
|
|
86
|
+
* );
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
retrieveByPhone(phoneNumber: string, options?: RequestOptions): APIPromise<Contact>;
|
|
90
|
+
}
|
|
91
|
+
export type ContactsCursor = Cursor<Contact>;
|
|
92
|
+
export interface Contact {
|
|
93
|
+
id: string;
|
|
94
|
+
/**
|
|
95
|
+
* List of available messaging channels for this contact.
|
|
96
|
+
*/
|
|
97
|
+
availableChannels: Array<string>;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
metadata: {
|
|
100
|
+
[key: string]: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Whether this contact has been verified.
|
|
104
|
+
*/
|
|
105
|
+
verified: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* All communication channels for this contact.
|
|
108
|
+
*/
|
|
109
|
+
channels?: Array<ContactChannel>;
|
|
110
|
+
countryCode?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Preferred channel for this contact.
|
|
113
|
+
*/
|
|
114
|
+
defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice';
|
|
115
|
+
/**
|
|
116
|
+
* Display name for the contact.
|
|
117
|
+
*/
|
|
118
|
+
displayName?: string;
|
|
119
|
+
/**
|
|
120
|
+
* DEPRECATED: Use primaryPhone instead. Primary phone number in E.164 format.
|
|
121
|
+
*/
|
|
122
|
+
phoneNumber?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Primary email address.
|
|
125
|
+
*/
|
|
126
|
+
primaryEmail?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Primary phone number in E.164 format.
|
|
129
|
+
*/
|
|
130
|
+
primaryPhone?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Contact's WhatsApp profile name. Only available for WhatsApp contacts.
|
|
133
|
+
*/
|
|
134
|
+
profileName?: string | null;
|
|
135
|
+
/**
|
|
136
|
+
* ID of a contact suggested for merging.
|
|
137
|
+
*/
|
|
138
|
+
suggestedMergeWith?: string;
|
|
139
|
+
updatedAt?: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* A communication channel for a contact.
|
|
143
|
+
*/
|
|
144
|
+
export interface ContactChannel {
|
|
145
|
+
id: string;
|
|
146
|
+
/**
|
|
147
|
+
* Channel type.
|
|
148
|
+
*/
|
|
149
|
+
channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
|
|
150
|
+
createdAt: string;
|
|
151
|
+
/**
|
|
152
|
+
* Channel identifier (phone number or email address).
|
|
153
|
+
*/
|
|
154
|
+
identifier: string;
|
|
155
|
+
/**
|
|
156
|
+
* Whether this is the primary channel for its type.
|
|
157
|
+
*/
|
|
158
|
+
isPrimary: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Whether this channel has been verified.
|
|
161
|
+
*/
|
|
162
|
+
verified: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* ISO country code for phone numbers.
|
|
165
|
+
*/
|
|
166
|
+
countryCode?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Optional label for the channel.
|
|
169
|
+
*/
|
|
170
|
+
label?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Last time a message was received on this channel.
|
|
173
|
+
*/
|
|
174
|
+
lastInboundAt?: string;
|
|
175
|
+
metadata?: {
|
|
176
|
+
[key: string]: string;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Delivery metrics for this channel.
|
|
180
|
+
*/
|
|
181
|
+
metrics?: ContactChannel.Metrics;
|
|
182
|
+
updatedAt?: string;
|
|
183
|
+
}
|
|
184
|
+
export declare namespace ContactChannel {
|
|
185
|
+
/**
|
|
186
|
+
* Delivery metrics for this channel.
|
|
187
|
+
*/
|
|
188
|
+
interface Metrics {
|
|
189
|
+
avgDeliveryTimeMs?: number;
|
|
190
|
+
failureCount?: number;
|
|
191
|
+
lastSuccessAt?: string;
|
|
192
|
+
successCount?: number;
|
|
193
|
+
totalAttempts?: number;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
export interface ContactCreateParams {
|
|
197
|
+
/**
|
|
198
|
+
* Communication channels for the contact.
|
|
199
|
+
*/
|
|
200
|
+
channels: Array<ContactCreateParams.Channel>;
|
|
201
|
+
/**
|
|
202
|
+
* Display name for the contact.
|
|
203
|
+
*/
|
|
204
|
+
displayName?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Arbitrary metadata to associate with the contact.
|
|
207
|
+
*/
|
|
208
|
+
metadata?: {
|
|
209
|
+
[key: string]: string;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export declare namespace ContactCreateParams {
|
|
213
|
+
/**
|
|
214
|
+
* Input for creating a contact channel.
|
|
215
|
+
*/
|
|
216
|
+
interface Channel {
|
|
217
|
+
/**
|
|
218
|
+
* Channel type.
|
|
219
|
+
*/
|
|
220
|
+
channel: 'sms' | 'whatsapp' | 'email' | 'telegram' | 'voice';
|
|
221
|
+
/**
|
|
222
|
+
* Channel identifier (phone number in E.164 format or email address).
|
|
223
|
+
*/
|
|
224
|
+
identifier: string;
|
|
225
|
+
/**
|
|
226
|
+
* ISO country code for phone numbers.
|
|
227
|
+
*/
|
|
228
|
+
countryCode?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Whether this should be the primary channel for its type.
|
|
231
|
+
*/
|
|
232
|
+
isPrimary?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Optional label for the channel.
|
|
235
|
+
*/
|
|
236
|
+
label?: string;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export interface ContactUpdateParams {
|
|
240
|
+
/**
|
|
241
|
+
* Preferred channel for this contact. Set to null to clear.
|
|
242
|
+
*/
|
|
243
|
+
defaultChannel?: 'sms' | 'whatsapp' | 'telegram' | 'email' | 'instagram' | 'voice' | null;
|
|
244
|
+
metadata?: {
|
|
245
|
+
[key: string]: string;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
export interface ContactListParams extends CursorParams {
|
|
249
|
+
phoneNumber?: string;
|
|
250
|
+
}
|
|
251
|
+
export interface ContactMergeParams {
|
|
252
|
+
/**
|
|
253
|
+
* ID of the contact to merge into the target contact. The source contact will be
|
|
254
|
+
* marked as merged.
|
|
255
|
+
*/
|
|
256
|
+
sourceContactId: string;
|
|
257
|
+
}
|
|
258
|
+
export declare namespace Contacts {
|
|
259
|
+
export { type Contact as Contact, type ContactChannel as ContactChannel, type ContactsCursor as ContactsCursor, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactMergeParams as ContactMergeParams, };
|
|
260
|
+
export { Channels as Channels, type ChannelUpdateResponse as ChannelUpdateResponse, type ChannelAddResponse as ChannelAddResponse, type ChannelSetPrimaryResponse as ChannelSetPrimaryResponse, type ChannelUpdateParams as ChannelUpdateParams, type ChannelAddParams as ChannelAddParams, type ChannelRemoveParams as ChannelRemoveParams, type ChannelSetPrimaryParams as ChannelSetPrimaryParams, };
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=contacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAIhF;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAI1E;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,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AC3C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Contacts = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const ChannelsAPI = tslib_1.__importStar(require("./channels.js"));
|
|
8
|
+
const channels_1 = require("./channels.js");
|
|
9
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
10
|
+
const headers_1 = require("../../internal/headers.js");
|
|
11
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
12
|
+
class Contacts extends resource_1.APIResource {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.channels = new ChannelsAPI.Channels(this._client);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a new contact with one or more communication channels.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const contact = await client.contacts.create({
|
|
23
|
+
* channels: [
|
|
24
|
+
* {
|
|
25
|
+
* channel: 'sms',
|
|
26
|
+
* identifier: '+14155551234',
|
|
27
|
+
* isPrimary: true,
|
|
28
|
+
* },
|
|
29
|
+
* ],
|
|
30
|
+
* displayName: 'John Doe',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
create(body, options) {
|
|
35
|
+
return this._client.post('/v1/contacts', { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get contact
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const contact = await client.contacts.retrieve('contactId');
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
retrieve(contactID, options) {
|
|
46
|
+
return this._client.get((0, path_1.path) `/v1/contacts/${contactID}`, options);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Update contact
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const contact = await client.contacts.update('contactId');
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
update(contactID, body, options) {
|
|
57
|
+
return this._client.patch((0, path_1.path) `/v1/contacts/${contactID}`, { body, ...options });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* List contacts with their communication channels.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* // Automatically fetches more pages as needed.
|
|
65
|
+
* for await (const contact of client.contacts.list()) {
|
|
66
|
+
* // ...
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
list(query = {}, options) {
|
|
71
|
+
return this._client.getAPIList('/v1/contacts', (pagination_1.Cursor), { query, ...options });
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Dismiss the merge suggestion for a contact.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* await client.contacts.dismissMergeSuggestion('contactId');
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
dismissMergeSuggestion(contactID, options) {
|
|
82
|
+
return this._client.delete((0, path_1.path) `/v1/contacts/${contactID}/merge-suggestion`, {
|
|
83
|
+
...options,
|
|
84
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Merge a source contact into this contact. All channels from the source contact
|
|
89
|
+
* will be moved to the target contact, and the source contact will be marked as
|
|
90
|
+
* merged.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const contact = await client.contacts.merge('contactId', {
|
|
95
|
+
* sourceContactId: 'jx7xyz789',
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
merge(contactID, body, options) {
|
|
100
|
+
return this._client.post((0, path_1.path) `/v1/contacts/${contactID}/merge`, { body, ...options });
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get contact by phone number
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const contact = await client.contacts.retrieveByPhone(
|
|
108
|
+
* 'phoneNumber',
|
|
109
|
+
* );
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
retrieveByPhone(phoneNumber, options) {
|
|
113
|
+
return this._client.get((0, path_1.path) `/v1/contacts/phone/${phoneNumber}`, options);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.Contacts = Contacts;
|
|
117
|
+
Contacts.Channels = channels_1.Channels;
|
|
118
|
+
//# sourceMappingURL=contacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,mEAA0C;AAC1C,4CASoB;AAEpB,yDAA+E;AAC/E,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAA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OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;OASG;IACH,eAAe,CAAC,WAAmB,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,sBAAsB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AA9GD,4BA8GC;AA8MD,QAAQ,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as ChannelsAPI from "./channels.mjs";
|
|
4
|
+
import { Channels, } from "./channels.mjs";
|
|
5
|
+
import { Cursor } from "../../core/pagination.mjs";
|
|
6
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
7
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
8
|
+
export class Contacts extends APIResource {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.channels = new ChannelsAPI.Channels(this._client);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Create a new contact with one or more communication channels.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const contact = await client.contacts.create({
|
|
19
|
+
* channels: [
|
|
20
|
+
* {
|
|
21
|
+
* channel: 'sms',
|
|
22
|
+
* identifier: '+14155551234',
|
|
23
|
+
* isPrimary: true,
|
|
24
|
+
* },
|
|
25
|
+
* ],
|
|
26
|
+
* displayName: 'John Doe',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
create(body, options) {
|
|
31
|
+
return this._client.post('/v1/contacts', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get contact
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const contact = await client.contacts.retrieve('contactId');
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
retrieve(contactID, options) {
|
|
42
|
+
return this._client.get(path `/v1/contacts/${contactID}`, options);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Update contact
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const contact = await client.contacts.update('contactId');
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
update(contactID, body, options) {
|
|
53
|
+
return this._client.patch(path `/v1/contacts/${contactID}`, { body, ...options });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* List contacts with their communication channels.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* // Automatically fetches more pages as needed.
|
|
61
|
+
* for await (const contact of client.contacts.list()) {
|
|
62
|
+
* // ...
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
list(query = {}, options) {
|
|
67
|
+
return this._client.getAPIList('/v1/contacts', (Cursor), { query, ...options });
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Dismiss the merge suggestion for a contact.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* await client.contacts.dismissMergeSuggestion('contactId');
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
dismissMergeSuggestion(contactID, options) {
|
|
78
|
+
return this._client.delete(path `/v1/contacts/${contactID}/merge-suggestion`, {
|
|
79
|
+
...options,
|
|
80
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Merge a source contact into this contact. All channels from the source contact
|
|
85
|
+
* will be moved to the target contact, and the source contact will be marked as
|
|
86
|
+
* merged.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const contact = await client.contacts.merge('contactId', {
|
|
91
|
+
* sourceContactId: 'jx7xyz789',
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
merge(contactID, body, options) {
|
|
96
|
+
return this._client.post(path `/v1/contacts/${contactID}/merge`, { body, ...options });
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get contact by phone number
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const contact = await client.contacts.retrieveByPhone(
|
|
104
|
+
* 'phoneNumber',
|
|
105
|
+
* );
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
retrieveByPhone(phoneNumber, options) {
|
|
109
|
+
return this._client.get(path `/v1/contacts/phone/${phoneNumber}`, options);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
Contacts.Channels = Channels;
|
|
113
|
+
//# sourceMappingURL=contacts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts.mjs","sourceRoot":"","sources":["../../src/resources/contacts/contacts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAQL,QAAQ,GACT;OAEM,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6G1E,CAAC;IA3GC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,c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AAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,sBAAsB,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AA8MD,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Channels, type ChannelUpdateResponse, type ChannelAddResponse, type ChannelSetPrimaryResponse, type ChannelUpdateParams, type ChannelAddParams, type ChannelRemoveParams, type ChannelSetPrimaryParams, } from "./channels.mjs";
|
|
2
|
+
export { Contacts, type Contact, type ContactChannel, type ContactCreateParams, type ContactUpdateParams, type ContactListParams, type ContactMergeParams, type ContactsCursor, } from "./contacts.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/contacts/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,GAC7B;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Channels, type ChannelUpdateResponse, type ChannelAddResponse, type ChannelSetPrimaryResponse, type ChannelUpdateParams, type ChannelAddParams, type ChannelRemoveParams, type ChannelSetPrimaryParams, } from "./channels.js";
|
|
2
|
+
export { Contacts, type Contact, type ContactChannel, type ContactCreateParams, type ContactUpdateParams, type ContactListParams, type ContactMergeParams, type ContactsCursor, } from "./contacts.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/contacts/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,GAC7B;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Contacts = exports.Channels = void 0;
|
|
5
|
+
var channels_1 = require("./channels.js");
|
|
6
|
+
Object.defineProperty(exports, "Channels", { enumerable: true, get: function () { return channels_1.Channels; } });
|
|
7
|
+
var contacts_1 = require("./contacts.js");
|
|
8
|
+
Object.defineProperty(exports, "Contacts", { enumerable: true, get: function () { return contacts_1.Contacts; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/contacts/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CASoB;AARlB,oGAAA,QAAQ,OAAA;AASV,0CASoB;AARlB,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/contacts/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAQT;OACM,EACL,QAAQ,GAQT"}
|