@linqapp/sdk 0.32.0 → 0.33.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 +26 -0
- package/client.d.mts +41 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +41 -5
- package/client.d.ts.map +1 -1
- package/client.js +38 -2
- package/client.js.map +1 -1
- package/client.mjs +38 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/available-number.d.mts +13 -1
- package/resources/available-number.d.mts.map +1 -1
- package/resources/available-number.d.ts +13 -1
- package/resources/available-number.d.ts.map +1 -1
- package/resources/available-number.js +2 -1
- package/resources/available-number.js.map +1 -1
- package/resources/available-number.mjs +2 -1
- package/resources/available-number.mjs.map +1 -1
- package/resources/chats/chats.d.mts +125 -64
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +125 -64
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +59 -59
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +59 -59
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/index.d.mts +2 -2
- package/resources/chats/index.d.mts.map +1 -1
- package/resources/chats/index.d.ts +2 -2
- package/resources/chats/index.d.ts.map +1 -1
- package/resources/chats/location.d.mts +25 -25
- package/resources/chats/location.d.mts.map +1 -1
- package/resources/chats/location.d.ts +25 -25
- package/resources/chats/location.d.ts.map +1 -1
- package/resources/chats/location.js +27 -27
- package/resources/chats/location.js.map +1 -1
- package/resources/chats/location.mjs +27 -27
- package/resources/chats/location.mjs.map +1 -1
- package/resources/chats/messages.d.mts +17 -17
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +17 -17
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +16 -16
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +16 -16
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/contact-card.d.mts +29 -28
- package/resources/contact-card.d.mts.map +1 -1
- package/resources/contact-card.d.ts +29 -28
- package/resources/contact-card.d.ts.map +1 -1
- package/resources/contact-card.js +23 -22
- package/resources/contact-card.js.map +1 -1
- package/resources/contact-card.mjs +23 -22
- package/resources/contact-card.mjs.map +1 -1
- package/resources/experiences.d.mts +91 -0
- package/resources/experiences.d.mts.map +1 -0
- package/resources/experiences.d.ts +91 -0
- package/resources/experiences.d.ts.map +1 -0
- package/resources/experiences.js +29 -0
- package/resources/experiences.js.map +1 -0
- package/resources/experiences.mjs +25 -0
- package/resources/experiences.mjs.map +1 -0
- package/resources/index.d.mts +7 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +71 -35
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +71 -35
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +41 -30
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +41 -30
- package/resources/messages.mjs.map +1 -1
- package/resources/payment-handles.d.mts +87 -0
- package/resources/payment-handles.d.mts.map +1 -0
- package/resources/payment-handles.d.ts +87 -0
- package/resources/payment-handles.d.ts.map +1 -0
- package/resources/payment-handles.js +76 -0
- package/resources/payment-handles.js.map +1 -0
- package/resources/payment-handles.mjs +72 -0
- package/resources/payment-handles.mjs.map +1 -0
- package/resources/payment-providers.d.mts +58 -0
- package/resources/payment-providers.d.mts.map +1 -0
- package/resources/payment-providers.d.ts +58 -0
- package/resources/payment-providers.d.ts.map +1 -0
- package/resources/payment-providers.js +45 -0
- package/resources/payment-providers.js.map +1 -0
- package/resources/payment-providers.mjs +41 -0
- package/resources/payment-providers.mjs.map +1 -0
- package/resources/payment-requests.d.mts +2 -2
- package/resources/payment-requests.d.ts +2 -2
- package/resources/payment-requests.js +2 -2
- package/resources/payment-requests.mjs +2 -2
- package/resources/payments.d.mts +116 -0
- package/resources/payments.d.mts.map +1 -0
- package/resources/payments.d.ts +116 -0
- package/resources/payments.d.ts.map +1 -0
- package/resources/payments.js +70 -0
- package/resources/payments.js.map +1 -0
- package/resources/payments.mjs +66 -0
- package/resources/payments.mjs.map +1 -0
- package/resources/phone-numbers.d.mts +11 -11
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +11 -11
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +13 -13
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +13 -13
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/webhook-subscriptions.d.mts +11 -11
- package/resources/webhook-subscriptions.d.mts.map +1 -1
- package/resources/webhook-subscriptions.d.ts +11 -11
- package/resources/webhook-subscriptions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.js +13 -13
- package/resources/webhook-subscriptions.js.map +1 -1
- package/resources/webhook-subscriptions.mjs +13 -13
- package/resources/webhook-subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.mts +59 -0
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +59 -0
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +77 -6
- package/src/resources/available-number.ts +14 -1
- package/src/resources/chats/chats.ts +142 -79
- package/src/resources/chats/index.ts +2 -2
- package/src/resources/chats/location.ts +28 -28
- package/src/resources/chats/messages.ts +28 -28
- package/src/resources/contact-card.ts +36 -35
- package/src/resources/experiences.ts +118 -0
- package/src/resources/index.ts +22 -4
- package/src/resources/messages.ts +85 -47
- package/src/resources/payment-handles.ts +114 -0
- package/src/resources/payment-providers.ts +81 -0
- package/src/resources/payment-requests.ts +2 -2
- package/src/resources/payments.ts +163 -0
- package/src/resources/phone-numbers.ts +14 -14
- package/src/resources/webhook-subscriptions.ts +14 -14
- package/src/resources/webhooks.ts +61 -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
package/resources/messages.js
CHANGED
|
@@ -96,6 +96,15 @@ class Messages extends resource_1.APIResource {
|
|
|
96
96
|
* Recipients (`to`) are an order-independent set: a single handle is a direct
|
|
97
97
|
* chat, multiple handles a group chat.
|
|
98
98
|
*
|
|
99
|
+
* ## Excluding lines
|
|
100
|
+
*
|
|
101
|
+
* `exclude_from` keeps specific lines out of **this** send's line pick. It only
|
|
102
|
+
* affects picking a line for a new chat — an existing chat is always reused on its
|
|
103
|
+
* own line, preferring a chat on a non-excluded line when the recipients have more
|
|
104
|
+
* than one. An exclusion never abandons a live chat or moves it to a new number,
|
|
105
|
+
* so if the only chat these recipients have is on an excluded line, that chat is
|
|
106
|
+
* still used. `from` tells you the line that was actually used.
|
|
107
|
+
*
|
|
99
108
|
* ## Differences from POST /v3/chats
|
|
100
109
|
*
|
|
101
110
|
* - The first message **may contain a link** (including for a newly created chat).
|
|
@@ -139,46 +148,41 @@ class Messages extends resource_1.APIResource {
|
|
|
139
148
|
});
|
|
140
149
|
}
|
|
141
150
|
/**
|
|
142
|
-
* Retrieve
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* If the message is not part of a thread, returns just that single message.
|
|
146
|
-
*
|
|
147
|
-
* Supports pagination and configurable ordering.
|
|
151
|
+
* Retrieve a specific message by its ID. This endpoint returns the full message
|
|
152
|
+
* details including text, attachments, reactions, and metadata.
|
|
148
153
|
*
|
|
149
154
|
* @example
|
|
150
155
|
* ```ts
|
|
151
|
-
*
|
|
152
|
-
* for await (const message of client.messages.listMessagesThread(
|
|
156
|
+
* const message = await client.messages.retrieve(
|
|
153
157
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
154
|
-
* )
|
|
155
|
-
* // ...
|
|
156
|
-
* }
|
|
158
|
+
* );
|
|
157
159
|
* ```
|
|
158
160
|
*/
|
|
159
|
-
|
|
160
|
-
return this._client.
|
|
161
|
-
query,
|
|
162
|
-
...options,
|
|
163
|
-
});
|
|
161
|
+
retrieve(messageID, options) {
|
|
162
|
+
return this._client.get((0, path_1.path) `/v3/messages/${messageID}`, options);
|
|
164
163
|
}
|
|
165
164
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
165
|
+
* Edit the text content of a specific part of a previously sent message.
|
|
166
|
+
*
|
|
167
|
+
* **Note:** A message can be edited up to 5 times, and only within 15 minutes of
|
|
168
|
+
* when it was originally sent.
|
|
168
169
|
*
|
|
169
170
|
* @example
|
|
170
171
|
* ```ts
|
|
171
|
-
* const message = await client.messages.
|
|
172
|
+
* const message = await client.messages.update(
|
|
172
173
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
174
|
+
* { text: 'This is the edited message content' },
|
|
173
175
|
* );
|
|
174
176
|
* ```
|
|
175
177
|
*/
|
|
176
|
-
|
|
177
|
-
return this._client.
|
|
178
|
+
update(messageID, body, options) {
|
|
179
|
+
return this._client.patch((0, path_1.path) `/v3/messages/${messageID}`, { body, ...options });
|
|
178
180
|
}
|
|
179
181
|
/**
|
|
180
182
|
* Deletes a message from the Linq API only. This does NOT unsend or remove the
|
|
181
|
-
* message from the actual chat — recipients will still see the message.
|
|
183
|
+
* message from the actual chat — recipients will still see the message. Re-sending
|
|
184
|
+
* with a deleted message's idempotency key returns 404 — a deleted message is
|
|
185
|
+
* never resent.
|
|
182
186
|
*
|
|
183
187
|
* @example
|
|
184
188
|
* ```ts
|
|
@@ -219,21 +223,28 @@ class Messages extends resource_1.APIResource {
|
|
|
219
223
|
return this._client.post((0, path_1.path) `/v3/messages/${messageID}/reactions`, { body, ...options });
|
|
220
224
|
}
|
|
221
225
|
/**
|
|
222
|
-
*
|
|
226
|
+
* Retrieve all messages in a conversation thread. Given any message ID in the
|
|
227
|
+
* thread, returns the originator message and all replies in chronological order.
|
|
223
228
|
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
229
|
+
* If the message is not part of a thread, returns just that single message.
|
|
230
|
+
*
|
|
231
|
+
* Supports pagination and configurable ordering.
|
|
226
232
|
*
|
|
227
233
|
* @example
|
|
228
234
|
* ```ts
|
|
229
|
-
*
|
|
235
|
+
* // Automatically fetches more pages as needed.
|
|
236
|
+
* for await (const message of client.messages.listMessagesThread(
|
|
230
237
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
231
|
-
*
|
|
232
|
-
*
|
|
238
|
+
* )) {
|
|
239
|
+
* // ...
|
|
240
|
+
* }
|
|
233
241
|
* ```
|
|
234
242
|
*/
|
|
235
|
-
|
|
236
|
-
return this._client.
|
|
243
|
+
listMessagesThread(messageID, query = {}, options) {
|
|
244
|
+
return this._client.getAPIList((0, path_1.path) `/v3/messages/${messageID}/thread`, (pagination_1.ListMessagesPagination), {
|
|
245
|
+
query,
|
|
246
|
+
...options,
|
|
247
|
+
});
|
|
237
248
|
}
|
|
238
249
|
/**
|
|
239
250
|
* Replaces a previously delivered `imessage_app` card on the recipient's screen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,sDAA4G;AAC5G,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,sDAA4G;AAC5G,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoEG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,CACT,SAAiB,EACjB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,CAChB,SAAiB,EACjB,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,SAAS,EAAE,CAAA,mCAA+B,CAAA,EAAE;YACtG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,aAAa,CACX,SAAiB,EACjB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACF;AA7OD,4BA6OC"}
|
package/resources/messages.mjs
CHANGED
|
@@ -93,6 +93,15 @@ export class Messages extends APIResource {
|
|
|
93
93
|
* Recipients (`to`) are an order-independent set: a single handle is a direct
|
|
94
94
|
* chat, multiple handles a group chat.
|
|
95
95
|
*
|
|
96
|
+
* ## Excluding lines
|
|
97
|
+
*
|
|
98
|
+
* `exclude_from` keeps specific lines out of **this** send's line pick. It only
|
|
99
|
+
* affects picking a line for a new chat — an existing chat is always reused on its
|
|
100
|
+
* own line, preferring a chat on a non-excluded line when the recipients have more
|
|
101
|
+
* than one. An exclusion never abandons a live chat or moves it to a new number,
|
|
102
|
+
* so if the only chat these recipients have is on an excluded line, that chat is
|
|
103
|
+
* still used. `from` tells you the line that was actually used.
|
|
104
|
+
*
|
|
96
105
|
* ## Differences from POST /v3/chats
|
|
97
106
|
*
|
|
98
107
|
* - The first message **may contain a link** (including for a newly created chat).
|
|
@@ -136,46 +145,41 @@ export class Messages extends APIResource {
|
|
|
136
145
|
});
|
|
137
146
|
}
|
|
138
147
|
/**
|
|
139
|
-
* Retrieve
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* If the message is not part of a thread, returns just that single message.
|
|
143
|
-
*
|
|
144
|
-
* Supports pagination and configurable ordering.
|
|
148
|
+
* Retrieve a specific message by its ID. This endpoint returns the full message
|
|
149
|
+
* details including text, attachments, reactions, and metadata.
|
|
145
150
|
*
|
|
146
151
|
* @example
|
|
147
152
|
* ```ts
|
|
148
|
-
*
|
|
149
|
-
* for await (const message of client.messages.listMessagesThread(
|
|
153
|
+
* const message = await client.messages.retrieve(
|
|
150
154
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
151
|
-
* )
|
|
152
|
-
* // ...
|
|
153
|
-
* }
|
|
155
|
+
* );
|
|
154
156
|
* ```
|
|
155
157
|
*/
|
|
156
|
-
|
|
157
|
-
return this._client.
|
|
158
|
-
query,
|
|
159
|
-
...options,
|
|
160
|
-
});
|
|
158
|
+
retrieve(messageID, options) {
|
|
159
|
+
return this._client.get(path `/v3/messages/${messageID}`, options);
|
|
161
160
|
}
|
|
162
161
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
162
|
+
* Edit the text content of a specific part of a previously sent message.
|
|
163
|
+
*
|
|
164
|
+
* **Note:** A message can be edited up to 5 times, and only within 15 minutes of
|
|
165
|
+
* when it was originally sent.
|
|
165
166
|
*
|
|
166
167
|
* @example
|
|
167
168
|
* ```ts
|
|
168
|
-
* const message = await client.messages.
|
|
169
|
+
* const message = await client.messages.update(
|
|
169
170
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
171
|
+
* { text: 'This is the edited message content' },
|
|
170
172
|
* );
|
|
171
173
|
* ```
|
|
172
174
|
*/
|
|
173
|
-
|
|
174
|
-
return this._client.
|
|
175
|
+
update(messageID, body, options) {
|
|
176
|
+
return this._client.patch(path `/v3/messages/${messageID}`, { body, ...options });
|
|
175
177
|
}
|
|
176
178
|
/**
|
|
177
179
|
* Deletes a message from the Linq API only. This does NOT unsend or remove the
|
|
178
|
-
* message from the actual chat — recipients will still see the message.
|
|
180
|
+
* message from the actual chat — recipients will still see the message. Re-sending
|
|
181
|
+
* with a deleted message's idempotency key returns 404 — a deleted message is
|
|
182
|
+
* never resent.
|
|
179
183
|
*
|
|
180
184
|
* @example
|
|
181
185
|
* ```ts
|
|
@@ -216,21 +220,28 @@ export class Messages extends APIResource {
|
|
|
216
220
|
return this._client.post(path `/v3/messages/${messageID}/reactions`, { body, ...options });
|
|
217
221
|
}
|
|
218
222
|
/**
|
|
219
|
-
*
|
|
223
|
+
* Retrieve all messages in a conversation thread. Given any message ID in the
|
|
224
|
+
* thread, returns the originator message and all replies in chronological order.
|
|
220
225
|
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
226
|
+
* If the message is not part of a thread, returns just that single message.
|
|
227
|
+
*
|
|
228
|
+
* Supports pagination and configurable ordering.
|
|
223
229
|
*
|
|
224
230
|
* @example
|
|
225
231
|
* ```ts
|
|
226
|
-
*
|
|
232
|
+
* // Automatically fetches more pages as needed.
|
|
233
|
+
* for await (const message of client.messages.listMessagesThread(
|
|
227
234
|
* '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
|
|
228
|
-
*
|
|
229
|
-
*
|
|
235
|
+
* )) {
|
|
236
|
+
* // ...
|
|
237
|
+
* }
|
|
230
238
|
* ```
|
|
231
239
|
*/
|
|
232
|
-
|
|
233
|
-
return this._client.
|
|
240
|
+
listMessagesThread(messageID, query = {}, options) {
|
|
241
|
+
return this._client.getAPIList(path `/v3/messages/${messageID}/thread`, (ListMessagesPagination), {
|
|
242
|
+
query,
|
|
243
|
+
...options,
|
|
244
|
+
});
|
|
234
245
|
}
|
|
235
246
|
/**
|
|
236
247
|
* Replaces a previously delivered `imessage_app` card on the recipient's screen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAK/C,OAAO,EAAE,sBAAsB,EAAkD,+BAA2B;AAC5G,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAK/C,OAAO,EAAE,sBAAsB,EAAkD,+BAA2B;AAC5G,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoEG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,CACT,SAAiB,EACjB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,CAChB,SAAiB,EACjB,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,gBAAgB,SAAS,SAAS,EAAE,CAAA,sBAA+B,CAAA,EAAE;YACtG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,aAAa,CACX,SAAiB,EACjB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Let an agent pay on a customer's behalf with a single-use virtual card.
|
|
6
|
+
* Connect a customer once, then create a payment — a virtual card is minted
|
|
7
|
+
* scoped to that purchase and the card details are handed back for checkout.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PaymentHandles extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Starts connecting a customer (by phone/email) so an agent can pay on their
|
|
12
|
+
* behalf. Linq drives the OTP + consent ceremony through the messaging channel;
|
|
13
|
+
* this returns `pending` and a `connection.created` webhook fires once the
|
|
14
|
+
* customer completes it.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const paymentHandleConnection =
|
|
19
|
+
* await client.paymentHandles.connect('handle');
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
connect(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a handle's connection status
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const paymentHandleConnection =
|
|
29
|
+
* await client.paymentHandles.connection('handle');
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
connection(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
33
|
+
/**
|
|
34
|
+
* Revokes this partner's grant for the customer. Only your grant is removed; the
|
|
35
|
+
* customer's wallet at the provider is untouched.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const paymentHandleConnection =
|
|
40
|
+
* await client.paymentHandles.revoke('handle');
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
revoke(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
44
|
+
/**
|
|
45
|
+
* Completes the ceremony `connect` started: verifies the code, records the
|
|
46
|
+
* customer's consent, and stores the connection. Returns `connected` on success,
|
|
47
|
+
* after which payments for this handle no longer need the customer present.
|
|
48
|
+
*
|
|
49
|
+
* The code reaches you however your channel works — typically the customer replies
|
|
50
|
+
* with it in the thread. Codes are single-use and short-lived; if one has expired,
|
|
51
|
+
* call `connect` again for a fresh `connect_id`.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const paymentHandleConnection =
|
|
56
|
+
* await client.paymentHandles.verify('handle', {
|
|
57
|
+
* code: '482913',
|
|
58
|
+
* connect_id: 'cs_01HZY8',
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
verify(handle: string, body: PaymentHandleVerifyParams, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
63
|
+
}
|
|
64
|
+
export interface PaymentHandleConnection {
|
|
65
|
+
/**
|
|
66
|
+
* Returned only by `connect`, and only while the ceremony is pending. Nothing on
|
|
67
|
+
* our side persists it — it comes back from the provider and is required again to
|
|
68
|
+
* verify — so hold it until you submit the code.
|
|
69
|
+
*/
|
|
70
|
+
connect_id?: string;
|
|
71
|
+
handle?: string;
|
|
72
|
+
status?: 'not_connected' | 'pending' | 'connected' | 'revoked';
|
|
73
|
+
}
|
|
74
|
+
export interface PaymentHandleVerifyParams {
|
|
75
|
+
/**
|
|
76
|
+
* The one-time code the customer received.
|
|
77
|
+
*/
|
|
78
|
+
code: string;
|
|
79
|
+
/**
|
|
80
|
+
* The id returned by `connect`.
|
|
81
|
+
*/
|
|
82
|
+
connect_id: string;
|
|
83
|
+
}
|
|
84
|
+
export declare namespace PaymentHandles {
|
|
85
|
+
export { type PaymentHandleConnection as PaymentHandleConnection, type PaymentHandleVerifyParams as PaymentHandleVerifyParams, };
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=payment-handles.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-handles.d.mts","sourceRoot":"","sources":["../src/resources/payment-handles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAItF;;;;;;;;OAQG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIzF;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIrF;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;CAGvC;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;CAChE;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Let an agent pay on a customer's behalf with a single-use virtual card.
|
|
6
|
+
* Connect a customer once, then create a payment — a virtual card is minted
|
|
7
|
+
* scoped to that purchase and the card details are handed back for checkout.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PaymentHandles extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Starts connecting a customer (by phone/email) so an agent can pay on their
|
|
12
|
+
* behalf. Linq drives the OTP + consent ceremony through the messaging channel;
|
|
13
|
+
* this returns `pending` and a `connection.created` webhook fires once the
|
|
14
|
+
* customer completes it.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const paymentHandleConnection =
|
|
19
|
+
* await client.paymentHandles.connect('handle');
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
connect(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
23
|
+
/**
|
|
24
|
+
* Get a handle's connection status
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const paymentHandleConnection =
|
|
29
|
+
* await client.paymentHandles.connection('handle');
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
connection(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
33
|
+
/**
|
|
34
|
+
* Revokes this partner's grant for the customer. Only your grant is removed; the
|
|
35
|
+
* customer's wallet at the provider is untouched.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const paymentHandleConnection =
|
|
40
|
+
* await client.paymentHandles.revoke('handle');
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
revoke(handle: string, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
44
|
+
/**
|
|
45
|
+
* Completes the ceremony `connect` started: verifies the code, records the
|
|
46
|
+
* customer's consent, and stores the connection. Returns `connected` on success,
|
|
47
|
+
* after which payments for this handle no longer need the customer present.
|
|
48
|
+
*
|
|
49
|
+
* The code reaches you however your channel works — typically the customer replies
|
|
50
|
+
* with it in the thread. Codes are single-use and short-lived; if one has expired,
|
|
51
|
+
* call `connect` again for a fresh `connect_id`.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const paymentHandleConnection =
|
|
56
|
+
* await client.paymentHandles.verify('handle', {
|
|
57
|
+
* code: '482913',
|
|
58
|
+
* connect_id: 'cs_01HZY8',
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
verify(handle: string, body: PaymentHandleVerifyParams, options?: RequestOptions): APIPromise<PaymentHandleConnection>;
|
|
63
|
+
}
|
|
64
|
+
export interface PaymentHandleConnection {
|
|
65
|
+
/**
|
|
66
|
+
* Returned only by `connect`, and only while the ceremony is pending. Nothing on
|
|
67
|
+
* our side persists it — it comes back from the provider and is required again to
|
|
68
|
+
* verify — so hold it until you submit the code.
|
|
69
|
+
*/
|
|
70
|
+
connect_id?: string;
|
|
71
|
+
handle?: string;
|
|
72
|
+
status?: 'not_connected' | 'pending' | 'connected' | 'revoked';
|
|
73
|
+
}
|
|
74
|
+
export interface PaymentHandleVerifyParams {
|
|
75
|
+
/**
|
|
76
|
+
* The one-time code the customer received.
|
|
77
|
+
*/
|
|
78
|
+
code: string;
|
|
79
|
+
/**
|
|
80
|
+
* The id returned by `connect`.
|
|
81
|
+
*/
|
|
82
|
+
connect_id: string;
|
|
83
|
+
}
|
|
84
|
+
export declare namespace PaymentHandles {
|
|
85
|
+
export { type PaymentHandleConnection as PaymentHandleConnection, type PaymentHandleVerifyParams as PaymentHandleVerifyParams, };
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=payment-handles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-handles.d.ts","sourceRoot":"","sources":["../src/resources/payment-handles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAItF;;;;;;;;OAQG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIzF;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIrF;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,yBAAyB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;CAGvC;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;CAChE;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.PaymentHandles = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const path_1 = require("../internal/utils/path.js");
|
|
7
|
+
/**
|
|
8
|
+
* Let an agent pay on a customer's behalf with a single-use virtual card.
|
|
9
|
+
* Connect a customer once, then create a payment — a virtual card is minted
|
|
10
|
+
* scoped to that purchase and the card details are handed back for checkout.
|
|
11
|
+
*/
|
|
12
|
+
class PaymentHandles extends resource_1.APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Starts connecting a customer (by phone/email) so an agent can pay on their
|
|
15
|
+
* behalf. Linq drives the OTP + consent ceremony through the messaging channel;
|
|
16
|
+
* this returns `pending` and a `connection.created` webhook fires once the
|
|
17
|
+
* customer completes it.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const paymentHandleConnection =
|
|
22
|
+
* await client.paymentHandles.connect('handle');
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
connect(handle, options) {
|
|
26
|
+
return this._client.post((0, path_1.path) `/v3/payments/handles/${handle}/connect`, options);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get a handle's connection status
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const paymentHandleConnection =
|
|
34
|
+
* await client.paymentHandles.connection('handle');
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
connection(handle, options) {
|
|
38
|
+
return this._client.get((0, path_1.path) `/v3/payments/handles/${handle}/connection`, options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Revokes this partner's grant for the customer. Only your grant is removed; the
|
|
42
|
+
* customer's wallet at the provider is untouched.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const paymentHandleConnection =
|
|
47
|
+
* await client.paymentHandles.revoke('handle');
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
revoke(handle, options) {
|
|
51
|
+
return this._client.delete((0, path_1.path) `/v3/payments/handles/${handle}/connection`, options);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Completes the ceremony `connect` started: verifies the code, records the
|
|
55
|
+
* customer's consent, and stores the connection. Returns `connected` on success,
|
|
56
|
+
* after which payments for this handle no longer need the customer present.
|
|
57
|
+
*
|
|
58
|
+
* The code reaches you however your channel works — typically the customer replies
|
|
59
|
+
* with it in the thread. Codes are single-use and short-lived; if one has expired,
|
|
60
|
+
* call `connect` again for a fresh `connect_id`.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const paymentHandleConnection =
|
|
65
|
+
* await client.paymentHandles.verify('handle', {
|
|
66
|
+
* code: '482913',
|
|
67
|
+
* connect_id: 'cs_01HZY8',
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
verify(handle, body, options) {
|
|
72
|
+
return this._client.post((0, path_1.path) `/v3/payments/handles/${handle}/verify`, { body, ...options });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.PaymentHandles = PaymentHandles;
|
|
76
|
+
//# sourceMappingURL=payment-handles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-handles.js","sourceRoot":"","sources":["../src/resources/payment-handles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C;;;;GAIG;AACH,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,wBAAwB,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;OAQG;IACH,UAAU,CAAC,MAAc,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,MAAM,aAAa,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wBAAwB,MAAM,aAAa,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,MAAc,EACd,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,wBAAwB,MAAM,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF;AArED,wCAqEC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { path } from "../internal/utils/path.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Let an agent pay on a customer's behalf with a single-use virtual card.
|
|
6
|
+
* Connect a customer once, then create a payment — a virtual card is minted
|
|
7
|
+
* scoped to that purchase and the card details are handed back for checkout.
|
|
8
|
+
*/
|
|
9
|
+
export class PaymentHandles extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Starts connecting a customer (by phone/email) so an agent can pay on their
|
|
12
|
+
* behalf. Linq drives the OTP + consent ceremony through the messaging channel;
|
|
13
|
+
* this returns `pending` and a `connection.created` webhook fires once the
|
|
14
|
+
* customer completes it.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const paymentHandleConnection =
|
|
19
|
+
* await client.paymentHandles.connect('handle');
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
connect(handle, options) {
|
|
23
|
+
return this._client.post(path `/v3/payments/handles/${handle}/connect`, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a handle's connection status
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const paymentHandleConnection =
|
|
31
|
+
* await client.paymentHandles.connection('handle');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
connection(handle, options) {
|
|
35
|
+
return this._client.get(path `/v3/payments/handles/${handle}/connection`, options);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Revokes this partner's grant for the customer. Only your grant is removed; the
|
|
39
|
+
* customer's wallet at the provider is untouched.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const paymentHandleConnection =
|
|
44
|
+
* await client.paymentHandles.revoke('handle');
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
revoke(handle, options) {
|
|
48
|
+
return this._client.delete(path `/v3/payments/handles/${handle}/connection`, options);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Completes the ceremony `connect` started: verifies the code, records the
|
|
52
|
+
* customer's consent, and stores the connection. Returns `connected` on success,
|
|
53
|
+
* after which payments for this handle no longer need the customer present.
|
|
54
|
+
*
|
|
55
|
+
* The code reaches you however your channel works — typically the customer replies
|
|
56
|
+
* with it in the thread. Codes are single-use and short-lived; if one has expired,
|
|
57
|
+
* call `connect` again for a fresh `connect_id`.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const paymentHandleConnection =
|
|
62
|
+
* await client.paymentHandles.verify('handle', {
|
|
63
|
+
* code: '482913',
|
|
64
|
+
* connect_id: 'cs_01HZY8',
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
verify(handle, body, options) {
|
|
69
|
+
return this._client.post(path `/v3/payments/handles/${handle}/verify`, { body, ...options });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=payment-handles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-handles.mjs","sourceRoot":"","sources":["../src/resources/payment-handles.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wBAAwB,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;OAQG;IACH,UAAU,CAAC,MAAc,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,MAAM,aAAa,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,MAAM,aAAa,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,MAAc,EACd,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wBAAwB,MAAM,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF"}
|