@isnap/sdk 2.3.0 → 2.3.1-next.43615425532.1
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 +65 -40
- package/README.md +361 -167
- package/dist/client.d.ts +37 -49
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +47 -58
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +6 -6
- package/dist/config.js +6 -6
- package/dist/generated/openapi.d.ts +910 -91
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/sleep.d.ts +2 -2
- package/dist/internal/sleep.js +5 -5
- package/dist/internal/sleep.js.map +1 -1
- package/dist/resources/apps.d.ts +11 -18
- package/dist/resources/apps.d.ts.map +1 -1
- package/dist/resources/apps.js +11 -18
- package/dist/resources/apps.js.map +1 -1
- package/dist/resources/area-codes.d.ts +5 -6
- package/dist/resources/area-codes.d.ts.map +1 -1
- package/dist/resources/area-codes.js +5 -6
- package/dist/resources/area-codes.js.map +1 -1
- package/dist/resources/attachments.d.ts +51 -17
- package/dist/resources/attachments.d.ts.map +1 -1
- package/dist/resources/attachments.js +42 -22
- package/dist/resources/attachments.js.map +1 -1
- package/dist/resources/byod.d.ts +14 -4
- package/dist/resources/byod.d.ts.map +1 -1
- package/dist/resources/byod.js +14 -4
- package/dist/resources/byod.js.map +1 -1
- package/dist/resources/chats.d.ts +32 -22
- package/dist/resources/chats.d.ts.map +1 -1
- package/dist/resources/chats.js +31 -21
- package/dist/resources/chats.js.map +1 -1
- package/dist/resources/fleet.d.ts +23 -0
- package/dist/resources/fleet.d.ts.map +1 -0
- package/dist/resources/fleet.js +20 -0
- package/dist/resources/fleet.js.map +1 -0
- package/dist/resources/lines.d.ts +258 -268
- package/dist/resources/lines.d.ts.map +1 -1
- package/dist/resources/lines.js +251 -266
- package/dist/resources/lines.js.map +1 -1
- package/dist/resources/lookup.d.ts +10 -13
- package/dist/resources/lookup.d.ts.map +1 -1
- package/dist/resources/lookup.js +10 -13
- package/dist/resources/lookup.js.map +1 -1
- package/dist/resources/macos-sessions.d.ts +42 -36
- package/dist/resources/macos-sessions.d.ts.map +1 -1
- package/dist/resources/macos-sessions.js +24 -22
- package/dist/resources/macos-sessions.js.map +1 -1
- package/dist/resources/messages.d.ts +35 -25
- package/dist/resources/messages.d.ts.map +1 -1
- package/dist/resources/messages.js +30 -19
- package/dist/resources/messages.js.map +1 -1
- package/dist/resources/preorders.d.ts +42 -47
- package/dist/resources/preorders.d.ts.map +1 -1
- package/dist/resources/preorders.js +42 -47
- package/dist/resources/preorders.js.map +1 -1
- package/dist/resources/trial.d.ts +30 -21
- package/dist/resources/trial.d.ts.map +1 -1
- package/dist/resources/trial.js +30 -21
- package/dist/resources/trial.js.map +1 -1
- package/dist/resources/webhooks.d.ts +39 -22
- package/dist/resources/webhooks.d.ts.map +1 -1
- package/dist/resources/webhooks.js +39 -22
- package/dist/resources/webhooks.js.map +1 -1
- package/dist/retry.d.ts +9 -10
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +11 -12
- package/dist/retry.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +13 -37
- package/dist/version.js.map +1 -1
- package/dist/webhooks/parse.d.ts +10 -9
- package/dist/webhooks/parse.d.ts.map +1 -1
- package/dist/webhooks/parse.js +14 -13
- package/dist/webhooks/parse.js.map +1 -1
- package/dist/webhooks/types.d.ts +75 -111
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/webhooks/types.js.map +1 -1
- package/dist/webhooks/verify.d.ts +27 -29
- package/dist/webhooks/verify.d.ts.map +1 -1
- package/dist/webhooks/verify.js +29 -35
- package/dist/webhooks/verify.js.map +1 -1
- package/examples/handle-webhook.ts +146 -0
- package/examples/paginate-messages.ts +54 -0
- package/examples/send-message.ts +37 -0
- package/examples/upload-attachment.ts +91 -0
- package/package.json +4 -8
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { AreaCodesResource } from './resources/area-codes.js';
|
|
|
11
11
|
export { AttachmentsResource } from './resources/attachments.js';
|
|
12
12
|
export { ByodResource } from './resources/byod.js';
|
|
13
13
|
export { ChatsResource } from './resources/chats.js';
|
|
14
|
+
export { FleetResource } from './resources/fleet.js';
|
|
14
15
|
export { LinesResource } from './resources/lines.js';
|
|
15
16
|
export { LookupResource } from './resources/lookup.js';
|
|
16
17
|
export { MacosSessionsResource } from './resources/macos-sessions.js';
|
|
@@ -20,8 +21,9 @@ export { TrialResource } from './resources/trial.js';
|
|
|
20
21
|
export { WebhooksResource } from './resources/webhooks.js';
|
|
21
22
|
export type { AppDownloadEntry, AppManifest } from './resources/apps.js';
|
|
22
23
|
export type { AreaCode, AreaCodes, Country, ListAreaCodesQuery } from './resources/area-codes.js';
|
|
24
|
+
export type { FleetHealthLine, FleetHealthReport, FleetHealthSummary } from './resources/fleet.js';
|
|
23
25
|
export type { Chat, ChatMarkRead, ChatTypingStart, ChatTypingStop, ListChatsQuery, MarkReadBody, ShareContactCardBody, ShareContactCardResult, TypingStartBody } from './resources/chats.js';
|
|
24
|
-
export type { ActivateLineBody, AssignLineBody, CreateLineInviteBody, Line, LineConfigPatch, LineConfigResponseData, LineHealth, LineInvite, LineList, ListLinesQuery, ListQueueQuery, MintSharedLineBody, MyLines, PatchLineBody, QueueResponseData, QuotaSnapshot, SetLineAnniversaryBody, SetLineVariantBody, TerminateLineBody, TransferOwnershipBody } from './resources/lines.js';
|
|
26
|
+
export type { ActivateLineBody, AssignLineBody, CreateLineInviteBody, Line, LineConfigPatch, LineConfigResponseData, LineHealth, LineHealthScore, LineHealthScoreFactor, LineHealthReport, LineInvite, LineList, ListLinesQuery, ListQueueQuery, MintSharedLineBody, MyLines, PatchLineBody, QueueResponseData, QuotaSnapshot, SetLineAnniversaryBody, SetLineVariantBody, TerminateLineBody, TransferOwnershipBody } from './resources/lines.js';
|
|
25
27
|
export type { LookupRequest, LookupResult } from './resources/lookup.js';
|
|
26
28
|
export type { MacosSession, PatchMacosSessionBody, RentMacosSessionBody } from './resources/macos-sessions.js';
|
|
27
29
|
export type { ListMessagesQuery, Message, Reaction, ReactionRemoval, ReactionType, SendMessageBody, SendReactionBody } from './resources/messages.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AACvF,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,M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ACnC,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACzE,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACf,MAAM,0BAA0B,CAAA;AACjC,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,aAAa,EAGb,eAAe,EACf,eAAe,EACf,eAAe,EACf,KAAK,EACL,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACpB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EACL,YAAY,EACZ,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,sBAAsB,EACvB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { AreaCodesResource } from './resources/area-codes.js';
|
|
|
6
6
|
export { AttachmentsResource } from './resources/attachments.js';
|
|
7
7
|
export { ByodResource } from './resources/byod.js';
|
|
8
8
|
export { ChatsResource } from './resources/chats.js';
|
|
9
|
+
export { FleetResource } from './resources/fleet.js';
|
|
9
10
|
export { LinesResource } from './resources/lines.js';
|
|
10
11
|
export { LookupResource } from './resources/lookup.js';
|
|
11
12
|
export { MacosSessionsResource } from './resources/macos-sessions.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;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sBAAsB,CAAA;AAEpD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,sBAAsB,EACvB,MAAM,qBAAqB,CAAA"}
|
package/dist/internal/sleep.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* AbortSignal. If the signal aborts first, the promise rejects with
|
|
4
4
|
* `APIConnectionError` carrying the signal's `.reason` as the cause.
|
|
5
5
|
*
|
|
6
|
-
* Used by the
|
|
7
|
-
*
|
|
6
|
+
* Used by the wait before a retry and by the polling loop of
|
|
7
|
+
* `attachments.upload`, with the same behavior in both places.
|
|
8
8
|
*/
|
|
9
9
|
export declare function sleep(ms: number, signal?: AbortSignal, abortMessage?: string): Promise<void>;
|
|
10
10
|
//# sourceMappingURL=sleep.d.ts.map
|
package/dist/internal/sleep.js
CHANGED
|
@@ -4,8 +4,8 @@ import { APIConnectionError } from '../errors.js';
|
|
|
4
4
|
* AbortSignal. If the signal aborts first, the promise rejects with
|
|
5
5
|
* `APIConnectionError` carrying the signal's `.reason` as the cause.
|
|
6
6
|
*
|
|
7
|
-
* Used by the
|
|
8
|
-
*
|
|
7
|
+
* Used by the wait before a retry and by the polling loop of
|
|
8
|
+
* `attachments.upload`, with the same behavior in both places.
|
|
9
9
|
*/
|
|
10
10
|
export function sleep(ms, signal, abortMessage = 'Aborted during sleep') {
|
|
11
11
|
return new Promise((resolve, reject) => {
|
|
@@ -15,9 +15,9 @@ export function sleep(ms, signal, abortMessage = 'Aborted during sleep') {
|
|
|
15
15
|
}
|
|
16
16
|
// Track the abort listener so the timer's resolve path can detach it.
|
|
17
17
|
// Without detachment, sleeps that complete normally still hold a
|
|
18
|
-
// closure on the caller's signal
|
|
19
|
-
//
|
|
20
|
-
//
|
|
18
|
+
// closure on the caller's signal: one leak per call, for the lifetime
|
|
19
|
+
// of a long-lived signal such as a process-wide shutdown signal. Both
|
|
20
|
+
// the resolve path and the reject path detach.
|
|
21
21
|
let abortListener;
|
|
22
22
|
const timer = setTimeout(() => {
|
|
23
23
|
if (abortListener)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/internal/sleep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CACnB,EAAU,EACV,MAAoB,EACpB,YAAY,GAAG,sBAAsB;IAErC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,kBAAkB,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;YACtE,OAAM;QACR,CAAC;QACD,sEAAsE;QACtE,iEAAiE;QACjE,
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/internal/sleep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CACnB,EAAU,EACV,MAAoB,EACpB,YAAY,GAAG,sBAAsB;IAErC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,kBAAkB,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;YACtE,OAAM;QACR,CAAC;QACD,sEAAsE;QACtE,iEAAiE;QACjE,sEAAsE;QACtE,sEAAsE;QACtE,+CAA+C;QAC/C,IAAI,aAAuC,CAAA;QAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,IAAI,aAAa;gBAAE,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;YACtE,OAAO,EAAE,CAAA;QACX,CAAC,EAAE,EAAE,CAAC,CAAA;QACN,IAAI,MAAM,EAAE,CAAC;YACX,aAAa,GAAG,GAAG,EAAE;gBACnB,YAAY,CAAC,KAAK,CAAC,CAAA;gBACnB,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,aAA2B,CAAC,CAAA;gBAChE,MAAM,CAAC,IAAI,kBAAkB,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;YACxE,CAAC,CAAA;YACD,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/resources/apps.d.ts
CHANGED
|
@@ -5,26 +5,19 @@ export type AppManifest = components['schemas']['AppManifestResponse'];
|
|
|
5
5
|
export type AppDownloadEntry = components['schemas']['AppDownloadEntry'];
|
|
6
6
|
export declare class AppsResource extends BaseResource {
|
|
7
7
|
/**
|
|
8
|
-
* `GET /v1/apps
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `byod.pair`, requires no pairing in flight — use it for setup guides,
|
|
12
|
-
* "add a device" flows, reinstalls, and update prompts (compare `version`
|
|
13
|
-
* against the version the device reports).
|
|
8
|
+
* `GET /v1/apps`: where to download the bridge app. One entry for `macos`,
|
|
9
|
+
* with `url`, `version`, `version_status` and `available`. The operation
|
|
10
|
+
* needs no credential.
|
|
14
11
|
*
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
12
|
+
* `url` is a stable link that redirects to the current installer. It is the
|
|
13
|
+
* link `byod.pair` returns in `download_urls`. When `available` is `false`,
|
|
14
|
+
* no installer is offered for that platform and `url` returns `404`: do not
|
|
15
|
+
* show the link.
|
|
17
16
|
*
|
|
18
|
-
* `version` is
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* and do not treat `null` as an error. It is deliberately NOT the
|
|
23
|
-
* `bridge_version` string `byod.pair` returns — that field is a separate,
|
|
24
|
-
* device-facing value (WHA-2538).
|
|
25
|
-
*
|
|
26
|
-
* A platform with `available: false` still appears in the response; hide the
|
|
27
|
-
* affordance rather than offering a link that 404s on click.
|
|
17
|
+
* `version` is a string exactly when `version_status` is `published`, and
|
|
18
|
+
* `null` otherwise. Show that no version is published: do not substitute a
|
|
19
|
+
* number, and do not treat `null` as an error. It is not the
|
|
20
|
+
* `bridge_version` that `byod.pair` returns.
|
|
28
21
|
*/
|
|
29
22
|
manifest(opts?: RequestOptions): Promise<AppManifest>;
|
|
30
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/resources/apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,CAAA;AACtE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAExE,qBAAa,YAAa,SAAQ,YAAY;IAC5C
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/resources/apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,CAAA;AACtE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAExE,qBAAa,YAAa,SAAQ,YAAY;IAC5C;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;CAGtD"}
|
package/dist/resources/apps.js
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
import { BaseResource } from './base.js';
|
|
2
2
|
export class AppsResource extends BaseResource {
|
|
3
3
|
/**
|
|
4
|
-
* `GET /v1/apps
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `byod.pair`, requires no pairing in flight — use it for setup guides,
|
|
8
|
-
* "add a device" flows, reinstalls, and update prompts (compare `version`
|
|
9
|
-
* against the version the device reports).
|
|
4
|
+
* `GET /v1/apps`: where to download the bridge app. One entry for `macos`,
|
|
5
|
+
* with `url`, `version`, `version_status` and `available`. The operation
|
|
6
|
+
* needs no credential.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
12
|
-
* `
|
|
8
|
+
* `url` is a stable link that redirects to the current installer. It is the
|
|
9
|
+
* link `byod.pair` returns in `download_urls`. When `available` is `false`,
|
|
10
|
+
* no installer is offered for that platform and `url` returns `404`: do not
|
|
11
|
+
* show the link.
|
|
13
12
|
*
|
|
14
|
-
* `version` is
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* and do not treat `null` as an error. It is deliberately NOT the
|
|
19
|
-
* `bridge_version` string `byod.pair` returns — that field is a separate,
|
|
20
|
-
* device-facing value (WHA-2538).
|
|
21
|
-
*
|
|
22
|
-
* A platform with `available: false` still appears in the response; hide the
|
|
23
|
-
* affordance rather than offering a link that 404s on click.
|
|
13
|
+
* `version` is a string exactly when `version_status` is `published`, and
|
|
14
|
+
* `null` otherwise. Show that no version is published: do not substitute a
|
|
15
|
+
* number, and do not treat `null` as an error. It is not the
|
|
16
|
+
* `bridge_version` that `byod.pair` returns.
|
|
24
17
|
*/
|
|
25
18
|
manifest(opts) {
|
|
26
19
|
return this.client.request('GET', '/v1/apps', undefined, opts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/resources/apps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAC5C
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/resources/apps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAC5C;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,IAAqB;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAc,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;IAC7E,CAAC;CACF"}
|
|
@@ -7,12 +7,11 @@ export type Country = components['schemas']['Country'];
|
|
|
7
7
|
export type ListAreaCodesQuery = NonNullable<paths['/v1/area-codes']['get']['parameters']['query']>;
|
|
8
8
|
export declare class AreaCodesResource extends BaseResource {
|
|
9
9
|
/**
|
|
10
|
-
* `GET /v1/area-codes
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* alpha-2, case-insensitive) to
|
|
14
|
-
*
|
|
15
|
-
* country dropdown in the same round-trip.
|
|
10
|
+
* `GET /v1/area-codes`: the area codes that can be requested as
|
|
11
|
+
* `preferred_area_codes` on a pre-order, and the countries they belong to.
|
|
12
|
+
* It does not list the lines in stock. The operation needs no credential.
|
|
13
|
+
* Pass `{ country }` (ISO 3166-1 alpha-2, case-insensitive) to keep the area
|
|
14
|
+
* codes of one country; `countries` is never filtered.
|
|
16
15
|
*/
|
|
17
16
|
list(query?: ListAreaCodesQuery, opts?: RequestOptions): Promise<AreaCodes>;
|
|
18
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area-codes.d.ts","sourceRoot":"","sources":["../../src/resources/area-codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAA;AAC1D,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAA;AACtD,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAC1C,KAAK,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CACtD,CAAA;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACjD
|
|
1
|
+
{"version":3,"file":"area-codes.d.ts","sourceRoot":"","sources":["../../src/resources/area-codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAA;AAC1D,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAA;AACtD,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAC1C,KAAK,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CACtD,CAAA;AAED,qBAAa,iBAAkB,SAAQ,YAAY;IACjD;;;;;;OAMG;IACH,IAAI,CAAC,KAAK,GAAE,kBAAuB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC;CAMhF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { BaseResource } from './base.js';
|
|
2
2
|
export class AreaCodesResource extends BaseResource {
|
|
3
3
|
/**
|
|
4
|
-
* `GET /v1/area-codes
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* alpha-2, case-insensitive) to
|
|
8
|
-
*
|
|
9
|
-
* country dropdown in the same round-trip.
|
|
4
|
+
* `GET /v1/area-codes`: the area codes that can be requested as
|
|
5
|
+
* `preferred_area_codes` on a pre-order, and the countries they belong to.
|
|
6
|
+
* It does not list the lines in stock. The operation needs no credential.
|
|
7
|
+
* Pass `{ country }` (ISO 3166-1 alpha-2, case-insensitive) to keep the area
|
|
8
|
+
* codes of one country; `countries` is never filtered.
|
|
10
9
|
*/
|
|
11
10
|
list(query = {}, opts) {
|
|
12
11
|
return this.client.request('GET', '/v1/area-codes', undefined, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area-codes.js","sourceRoot":"","sources":["../../src/resources/area-codes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AASxC,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IACjD
|
|
1
|
+
{"version":3,"file":"area-codes.js","sourceRoot":"","sources":["../../src/resources/area-codes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AASxC,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IACjD;;;;;;OAMG;IACH,IAAI,CAAC,QAA4B,EAAE,EAAE,IAAqB;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAY,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE;YACxE,GAAG,IAAI;YACP,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;SACpC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -10,35 +10,69 @@ export interface UploadMetadata {
|
|
|
10
10
|
contentType: string;
|
|
11
11
|
}
|
|
12
12
|
export interface UploadOptions extends RequestOptions {
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Wait between two reads of the attachment, in milliseconds. Default 500.
|
|
15
|
+
* Each read is one request and counts toward the request-rate limit. To wait
|
|
16
|
+
* longer for an attachment, raise this value to between 2,000 and 5,000.
|
|
17
|
+
*/
|
|
14
18
|
pollIntervalMs?: number;
|
|
15
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Number of reads of the attachment before `upload()` gives up. Default 60:
|
|
21
|
+
* with the default interval, 30 seconds plus request time. iSnap confirms a
|
|
22
|
+
* finished upload on a 30-second cycle and converts an audio file before it
|
|
23
|
+
* is `ready`, so the default can run out on an upload that succeeds. To wait
|
|
24
|
+
* longer, raise `pollIntervalMs`, not this value alone: at the default
|
|
25
|
+
* interval the reads reach up to 120 per minute, above the request-rate
|
|
26
|
+
* limit of 100.
|
|
27
|
+
*/
|
|
16
28
|
maxPolls?: number;
|
|
17
29
|
}
|
|
18
30
|
export declare class AttachmentsResource extends BaseResource {
|
|
19
31
|
/**
|
|
20
|
-
* `POST /v1/attachments
|
|
21
|
-
*
|
|
22
|
-
*
|
|
32
|
+
* `POST /v1/attachments`: register an attachment and get the URL to upload
|
|
33
|
+
* its bytes to (`upload_url`, with `required_headers`). It is the first step
|
|
34
|
+
* of an upload; `upload()` runs the whole upload in one call.
|
|
23
35
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* method here unless the backend ships one.
|
|
36
|
+
* The API has no operation that deletes an attachment. An attachment expires
|
|
37
|
+
* 72 hours after this call.
|
|
27
38
|
*/
|
|
28
39
|
create(body: CreateAttachmentBody, opts?: RequestOptions): Promise<CreateAttachmentResponse>;
|
|
29
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* `GET /v1/attachments/{id}`: one attachment, with its `status`.
|
|
42
|
+
* `download_url` is set only when `status` is `ready`.
|
|
43
|
+
*/
|
|
30
44
|
get(id: string, opts?: RequestOptions): Promise<Attachment>;
|
|
31
45
|
/**
|
|
32
|
-
*
|
|
33
|
-
* 1. `POST /v1/attachments`
|
|
34
|
-
*
|
|
35
|
-
*
|
|
46
|
+
* Upload a file in one call:
|
|
47
|
+
* 1. `POST /v1/attachments` registers the attachment and returns an upload
|
|
48
|
+
* URL.
|
|
49
|
+
* 2. One `PUT` sends the bytes to that URL. This request is sent once: it is
|
|
50
|
+
* not retried.
|
|
51
|
+
* 3. `GET /v1/attachments/{id}` is read every `pollIntervalMs` until `status`
|
|
52
|
+
* is `ready`, at most `maxPolls` times.
|
|
53
|
+
*
|
|
54
|
+
* Resolves with the attachment once it is `ready`. `file` is a `Blob`, an
|
|
55
|
+
* `ArrayBuffer` or a `Uint8Array` (a Node.js `Buffer` qualifies): the whole
|
|
56
|
+
* file is held in memory. Each call registers a new attachment, unless you
|
|
57
|
+
* pass an `opts.idempotencyKey` that an earlier call used.
|
|
36
58
|
*
|
|
37
59
|
* Throws:
|
|
38
|
-
* - `
|
|
39
|
-
* - `APIError`
|
|
40
|
-
*
|
|
41
|
-
*
|
|
60
|
+
* - `TypeError` when `file` is none of these types.
|
|
61
|
+
* - `APIError` with status 413 and code `attachment_exceeds_storage_limit`
|
|
62
|
+
* when the file is larger than 5 GB (5,368,709,120 bytes), before any
|
|
63
|
+
* request.
|
|
64
|
+
* - `APIConnectionError` when the upload request fails or times out.
|
|
65
|
+
* - `APIError` with code `upload_failed` when the upload request is refused
|
|
66
|
+
* (with the status of that response), or when `status` becomes `failed`
|
|
67
|
+
* (with status 422).
|
|
68
|
+
* - `APIError` with status 504 and code `upload_timeout` when the attachment
|
|
69
|
+
* is not `ready` after `maxPolls` reads. The attachment is not canceled.
|
|
70
|
+
*
|
|
71
|
+
* On `upload_timeout`, and on `upload_failed` after `status` became
|
|
72
|
+
* `failed`, the attachment id is only in the error message. When the upload
|
|
73
|
+
* request is refused, the error carries no id. To keep the id, call
|
|
74
|
+
* `create()`, upload the bytes yourself, and read `get()` until `status` is
|
|
75
|
+
* `ready`.
|
|
42
76
|
*/
|
|
43
77
|
upload(file: UploadInput, metadata: UploadMetadata, opts?: UploadOptions): Promise<Attachment>;
|
|
44
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/resources/attachments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAA;AAC5D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAC5E,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,0BAA0B,CAAC,CAAA;AAExF,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,WAAW,GAAG,UAAU,CAAA;AAEzD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/resources/attachments.ts"],"names":[],"mappings":"AACA,O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Resource {
|
|
19
19
|
/**
|
|
20
|
-
* `POST /v1/attachments
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* `POST /v1/attachments`: register an attachment and get the URL to upload
|
|
21
|
+
* its bytes to (`upload_url`, with `required_headers`). It is the first step
|
|
22
|
+
* of an upload; `upload()` runs the whole upload in one call.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* method here unless the backend ships one.
|
|
24
|
+
* The API has no operation that deletes an attachment. An attachment expires
|
|
25
|
+
* 72 hours after this call.
|
|
27
26
|
*/
|
|
28
27
|
create(body, opts) {
|
|
29
28
|
return this.client.request('POST', '/v1/attachments', body, opts);
|
|
30
29
|
}
|
|
31
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* `GET /v1/attachments/{id}`: one attachment, with its `status`.
|
|
32
|
+
* `download_url` is set only when `status` is `ready`.
|
|
33
|
+
*/
|
|
32
34
|
get(id, opts) {
|
|
33
35
|
return this.client.request('GET', `/v1/attachments/${encodeURIComponent(id)}`, undefined, opts);
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
|
-
*
|
|
37
|
-
* 1. `POST /v1/attachments`
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* Upload a file in one call:
|
|
39
|
+
* 1. `POST /v1/attachments` registers the attachment and returns an upload
|
|
40
|
+
* URL.
|
|
41
|
+
* 2. One `PUT` sends the bytes to that URL. This request is sent once: it is
|
|
42
|
+
* not retried.
|
|
43
|
+
* 3. `GET /v1/attachments/{id}` is read every `pollIntervalMs` until `status`
|
|
44
|
+
* is `ready`, at most `maxPolls` times.
|
|
45
|
+
*
|
|
46
|
+
* Resolves with the attachment once it is `ready`. `file` is a `Blob`, an
|
|
47
|
+
* `ArrayBuffer` or a `Uint8Array` (a Node.js `Buffer` qualifies): the whole
|
|
48
|
+
* file is held in memory. Each call registers a new attachment, unless you
|
|
49
|
+
* pass an `opts.idempotencyKey` that an earlier call used.
|
|
40
50
|
*
|
|
41
51
|
* Throws:
|
|
42
|
-
* - `
|
|
43
|
-
* - `APIError`
|
|
44
|
-
*
|
|
45
|
-
*
|
|
52
|
+
* - `TypeError` when `file` is none of these types.
|
|
53
|
+
* - `APIError` with status 413 and code `attachment_exceeds_storage_limit`
|
|
54
|
+
* when the file is larger than 5 GB (5,368,709,120 bytes), before any
|
|
55
|
+
* request.
|
|
56
|
+
* - `APIConnectionError` when the upload request fails or times out.
|
|
57
|
+
* - `APIError` with code `upload_failed` when the upload request is refused
|
|
58
|
+
* (with the status of that response), or when `status` becomes `failed`
|
|
59
|
+
* (with status 422).
|
|
60
|
+
* - `APIError` with status 504 and code `upload_timeout` when the attachment
|
|
61
|
+
* is not `ready` after `maxPolls` reads. The attachment is not canceled.
|
|
62
|
+
*
|
|
63
|
+
* On `upload_timeout`, and on `upload_failed` after `status` became
|
|
64
|
+
* `failed`, the attachment id is only in the error message. When the upload
|
|
65
|
+
* request is refused, the error carries no id. To keep the id, call
|
|
66
|
+
* `create()`, upload the bytes yourself, and read `get()` until `status` is
|
|
67
|
+
* `ready`.
|
|
46
68
|
*/
|
|
47
69
|
async upload(file, metadata, opts = {}) {
|
|
48
70
|
const size = computeSize(file);
|
|
@@ -60,13 +82,11 @@ export class AttachmentsResource extends BaseResource {
|
|
|
60
82
|
content_type: metadata.contentType,
|
|
61
83
|
size_bytes: size
|
|
62
84
|
}, opts);
|
|
63
|
-
// Build
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
// server's `required_headers` because R2 ignores non-AWS keys, so a
|
|
69
|
-
// compromised value cannot be used to inject auth into the upload.
|
|
85
|
+
// Build the upload headers with the Headers constructor, which merges
|
|
86
|
+
// names case-insensitively: `required_headers` can carry any casing of
|
|
87
|
+
// `content-type` and `content-length`, and a plain object spread would
|
|
88
|
+
// send the same header twice, which the upload URL can refuse.
|
|
89
|
+
// `required_headers` comes from the API response and is sent as given.
|
|
70
90
|
const putHeaders = new Headers(created.required_headers);
|
|
71
91
|
putHeaders.set('Content-Type', metadata.contentType);
|
|
72
92
|
putHeaders.set('Content-Length', String(size));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../../src/resources/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../../src/resources/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAgCxC,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AACtC,MAAM,wBAAwB,GAAG,GAAG,CAAA;AACpC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,SAAS,WAAW,CAAC,IAAiB;IACpC,IAAI,IAAI,YAAY,UAAU;QAAE,OAAO,IAAI,CAAC,UAAU,CAAA;IACtD,IAAI,IAAI,YAAY,WAAW;QAAE,OAAO,IAAI,CAAC,UAAU,CAAA;IACvD,uEAAuE;IACvE,yCAAyC;IACzC,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,YAAY,IAAI;QAAE,OAAO,IAAI,CAAC,IAAI,CAAA;IACzE,MAAM,IAAI,SAAS,CAAC,mEAAmE,CAAC,CAAA;AAC1F,CAAC;AAED,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IACnD;;;;;;;OAOG;IACH,MAAM,CAAC,IAA0B,EAAE,IAAqB;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,OAA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C;gBAC5B,MAAM,IAAI,QAAQ,CAAC;oBACjB,MAAM,EAAE,GAAG;oBACX,IAAI,EAAE,eAAe;oBACrB,OAAO,EAAE,cAAc,OAAO,CAAC,EAAE,iCAAiC;oBAClE,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,EAAE;iBACd,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QACD,MAAM,IAAI,QAAQ,CAAC;YACjB,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,cAAc,OAAO,CAAC,EAAE,gCAAgC,QAAQ,GAAG,cAAc,IAAI;YAC9F,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/dist/resources/byod.d.ts
CHANGED
|
@@ -5,10 +5,20 @@ export type ByodPairBody = components['schemas']['ByodPairBody'];
|
|
|
5
5
|
export type ByodPairResponse = components['schemas']['ByodPairResponse'];
|
|
6
6
|
export declare class ByodResource extends BaseResource {
|
|
7
7
|
/**
|
|
8
|
-
* `POST /v1/byod/pair
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* `POST /v1/byod/pair`: issue an activation code for a BYOD pairing.
|
|
9
|
+
* Resolves with `activation_code` (single use, valid 5 minutes),
|
|
10
|
+
* `expires_at`, `download_urls` and `bridge_version`. The body takes an
|
|
11
|
+
* optional `metadata`, copied onto the line the pairing creates.
|
|
12
|
+
*
|
|
13
|
+
* The line appears on your account, already `active`, when the bridge app
|
|
14
|
+
* completes the pairing with the code.
|
|
15
|
+
*
|
|
16
|
+
* An account that is not a wholesale partner needs a free BYOD slot. With no
|
|
17
|
+
* BYOD subscription the call is a `PaymentRequiredError` (402
|
|
18
|
+
* `payment_required`); with every slot used it is a `NotFoundError` (404
|
|
19
|
+
* `no_slot_available`).
|
|
20
|
+
*
|
|
21
|
+
* The API does not deduplicate this call: a retry issues another code.
|
|
12
22
|
*/
|
|
13
23
|
pair(body: ByodPairBody, opts?: RequestOptions): Promise<ByodPairResponse>;
|
|
14
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byod.d.ts","sourceRoot":"","sources":["../../src/resources/byod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAA;AAChE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAExE,qBAAa,YAAa,SAAQ,YAAY;IAC5C
|
|
1
|
+
{"version":3,"file":"byod.d.ts","sourceRoot":"","sources":["../../src/resources/byod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAA;AAChE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CAAA;AAExE,qBAAa,YAAa,SAAQ,YAAY;IAC5C;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG3E"}
|
package/dist/resources/byod.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { BaseResource } from './base.js';
|
|
2
2
|
export class ByodResource extends BaseResource {
|
|
3
3
|
/**
|
|
4
|
-
* `POST /v1/byod/pair
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* `POST /v1/byod/pair`: issue an activation code for a BYOD pairing.
|
|
5
|
+
* Resolves with `activation_code` (single use, valid 5 minutes),
|
|
6
|
+
* `expires_at`, `download_urls` and `bridge_version`. The body takes an
|
|
7
|
+
* optional `metadata`, copied onto the line the pairing creates.
|
|
8
|
+
*
|
|
9
|
+
* The line appears on your account, already `active`, when the bridge app
|
|
10
|
+
* completes the pairing with the code.
|
|
11
|
+
*
|
|
12
|
+
* An account that is not a wholesale partner needs a free BYOD slot. With no
|
|
13
|
+
* BYOD subscription the call is a `PaymentRequiredError` (402
|
|
14
|
+
* `payment_required`); with every slot used it is a `NotFoundError` (404
|
|
15
|
+
* `no_slot_available`).
|
|
16
|
+
*
|
|
17
|
+
* The API does not deduplicate this call: a retry issues another code.
|
|
8
18
|
*/
|
|
9
19
|
pair(body, opts) {
|
|
10
20
|
return this.client.request('POST', '/v1/byod/pair', body, opts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byod.js","sourceRoot":"","sources":["../../src/resources/byod.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAC5C
|
|
1
|
+
{"version":3,"file":"byod.js","sourceRoot":"","sources":["../../src/resources/byod.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAC5C;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,IAAkB,EAAE,IAAqB;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAmB,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACnF,CAAC;CACF"}
|