@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.
Files changed (94) hide show
  1. package/CHANGELOG.md +65 -40
  2. package/README.md +361 -167
  3. package/dist/client.d.ts +37 -49
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +47 -58
  6. package/dist/client.js.map +1 -1
  7. package/dist/config.d.ts +6 -6
  8. package/dist/config.js +6 -6
  9. package/dist/generated/openapi.d.ts +910 -91
  10. package/dist/index.d.ts +3 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/internal/sleep.d.ts +2 -2
  15. package/dist/internal/sleep.js +5 -5
  16. package/dist/internal/sleep.js.map +1 -1
  17. package/dist/resources/apps.d.ts +11 -18
  18. package/dist/resources/apps.d.ts.map +1 -1
  19. package/dist/resources/apps.js +11 -18
  20. package/dist/resources/apps.js.map +1 -1
  21. package/dist/resources/area-codes.d.ts +5 -6
  22. package/dist/resources/area-codes.d.ts.map +1 -1
  23. package/dist/resources/area-codes.js +5 -6
  24. package/dist/resources/area-codes.js.map +1 -1
  25. package/dist/resources/attachments.d.ts +51 -17
  26. package/dist/resources/attachments.d.ts.map +1 -1
  27. package/dist/resources/attachments.js +42 -22
  28. package/dist/resources/attachments.js.map +1 -1
  29. package/dist/resources/byod.d.ts +14 -4
  30. package/dist/resources/byod.d.ts.map +1 -1
  31. package/dist/resources/byod.js +14 -4
  32. package/dist/resources/byod.js.map +1 -1
  33. package/dist/resources/chats.d.ts +32 -22
  34. package/dist/resources/chats.d.ts.map +1 -1
  35. package/dist/resources/chats.js +31 -21
  36. package/dist/resources/chats.js.map +1 -1
  37. package/dist/resources/fleet.d.ts +23 -0
  38. package/dist/resources/fleet.d.ts.map +1 -0
  39. package/dist/resources/fleet.js +20 -0
  40. package/dist/resources/fleet.js.map +1 -0
  41. package/dist/resources/lines.d.ts +258 -268
  42. package/dist/resources/lines.d.ts.map +1 -1
  43. package/dist/resources/lines.js +251 -266
  44. package/dist/resources/lines.js.map +1 -1
  45. package/dist/resources/lookup.d.ts +10 -13
  46. package/dist/resources/lookup.d.ts.map +1 -1
  47. package/dist/resources/lookup.js +10 -13
  48. package/dist/resources/lookup.js.map +1 -1
  49. package/dist/resources/macos-sessions.d.ts +42 -36
  50. package/dist/resources/macos-sessions.d.ts.map +1 -1
  51. package/dist/resources/macos-sessions.js +24 -22
  52. package/dist/resources/macos-sessions.js.map +1 -1
  53. package/dist/resources/messages.d.ts +35 -25
  54. package/dist/resources/messages.d.ts.map +1 -1
  55. package/dist/resources/messages.js +30 -19
  56. package/dist/resources/messages.js.map +1 -1
  57. package/dist/resources/preorders.d.ts +42 -47
  58. package/dist/resources/preorders.d.ts.map +1 -1
  59. package/dist/resources/preorders.js +42 -47
  60. package/dist/resources/preorders.js.map +1 -1
  61. package/dist/resources/trial.d.ts +30 -21
  62. package/dist/resources/trial.d.ts.map +1 -1
  63. package/dist/resources/trial.js +30 -21
  64. package/dist/resources/trial.js.map +1 -1
  65. package/dist/resources/webhooks.d.ts +39 -22
  66. package/dist/resources/webhooks.d.ts.map +1 -1
  67. package/dist/resources/webhooks.js +39 -22
  68. package/dist/resources/webhooks.js.map +1 -1
  69. package/dist/retry.d.ts +9 -10
  70. package/dist/retry.d.ts.map +1 -1
  71. package/dist/retry.js +11 -12
  72. package/dist/retry.js.map +1 -1
  73. package/dist/types.d.ts +10 -0
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/version.d.ts +1 -1
  76. package/dist/version.d.ts.map +1 -1
  77. package/dist/version.js +13 -37
  78. package/dist/version.js.map +1 -1
  79. package/dist/webhooks/parse.d.ts +10 -9
  80. package/dist/webhooks/parse.d.ts.map +1 -1
  81. package/dist/webhooks/parse.js +14 -13
  82. package/dist/webhooks/parse.js.map +1 -1
  83. package/dist/webhooks/types.d.ts +75 -111
  84. package/dist/webhooks/types.d.ts.map +1 -1
  85. package/dist/webhooks/types.js.map +1 -1
  86. package/dist/webhooks/verify.d.ts +27 -29
  87. package/dist/webhooks/verify.d.ts.map +1 -1
  88. package/dist/webhooks/verify.js +29 -35
  89. package/dist/webhooks/verify.js.map +1 -1
  90. package/examples/handle-webhook.ts +146 -0
  91. package/examples/paginate-messages.ts +54 -0
  92. package/examples/send-message.ts +37 -0
  93. package/examples/upload-attachment.ts +91 -0
  94. 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';
@@ -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;AACh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B,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,aAAa,EACd,MAAM,4BAA4B,CAAA;AACnC,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,CAA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C1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAmG1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,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"}
@@ -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 retry loop's exponential-backoff sleep AND the attachments
7
- * resource's polling loop — same semantics in both places.
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
@@ -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 retry loop's exponential-backoff sleep AND the attachments
8
- * resource's polling loop — same semantics in both places.
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 — accumulating one leak per call
19
- // across the lifetime of a long-lived signal (e.g. a process-wide
20
- // shutdown signal). Both resolve and reject paths detach.
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,kEAAkE;QAClE,kEAAkE;QAClE,0DAA0D;QAC1D,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,CAA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E,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -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` — the app/bridge download manifest: per-platform installer
9
- * URL, the version currently published for that platform, and whether this
10
- * deployment has an artifact configured for it. Public (no auth) and, unlike
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
- * The URLs are the same stable redirects `byod.pair` returns in
16
- * `download_urls` — one builder server-side, so they cannot drift.
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 `string | null`. It is read from the release feed beside the
19
- * artifact `url` resolves to, so the number and the file cannot name
20
- * different releases, and it is `null` when that feed publishes nothing.
21
- * Render the absence ("version not published"); never substitute a number,
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;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;CAGtD"}
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"}
@@ -1,26 +1,19 @@
1
1
  import { BaseResource } from './base.js';
2
2
  export class AppsResource extends BaseResource {
3
3
  /**
4
- * `GET /v1/apps` — the app/bridge download manifest: per-platform installer
5
- * URL, the version currently published for that platform, and whether this
6
- * deployment has an artifact configured for it. Public (no auth) and, unlike
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
- * The URLs are the same stable redirects `byod.pair` returns in
12
- * `download_urls` — one builder server-side, so they cannot drift.
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 `string | null`. It is read from the release feed beside the
15
- * artifact `url` resolves to, so the number and the file cannot name
16
- * different releases, and it is `null` when that feed publishes nothing.
17
- * Render the absence ("version not published"); never substitute a number,
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;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,IAAqB;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAc,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;IAC7E,CAAC;CACF"}
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` — list the selectable area codes a customer can
11
- * request as `preferred_area_codes` on a pre-order, for rendering an
12
- * area-code picker. Public (no auth required). Pass `{ country }` (ISO 3166-1
13
- * alpha-2, case-insensitive) to filter the area-code list; the `countries`
14
- * list in the response is always the full selectable set so it can drive a
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,M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@ -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` — list the selectable area codes a customer can
5
- * request as `preferred_area_codes` on a pre-order, for rendering an
6
- * area-code picker. Public (no auth required). Pass `{ country }` (ISO 3166-1
7
- * alpha-2, case-insensitive) to filter the area-code list; the `countries`
8
- * list in the response is always the full selectable set so it can drive a
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;;;;;;;OAOG;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"}
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
- /** Override the polling interval in ms while waiting for `status: ready`. Default 500. */
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
- /** Override the maximum number of polls before giving up. Default 60 (≈30s at 500ms). */
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` — register an attachment and receive a
21
- * presigned R2 upload URL. Step 1 of the 3-step upload flow; prefer the
22
- * high-level `upload()` unless you need control over each step.
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
- * Note: the contract has no DELETE /v1/attachments/{id} endpoint — rows
25
- * auto-expire after 72h via the retention worker. Don't add a delete
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
- /** `GET /v1/attachments/{id}` — fetch an attachment's status and download URL. */
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
- * Transparent 3-step attachment upload:
33
- * 1. `POST /v1/attachments` to register the file and get a presigned R2 URL
34
- * 2. `PUT` the body directly to R2 with the required headers
35
- * 3. Poll `GET /v1/attachments/{id}` every `pollIntervalMs` until `status === 'ready'`
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
- * - `BadRequestError` if `size_bytes` exceeds the 5 GB cap
39
- * - `APIError` (`upload_failed`) if the R2 PUT returns non-2xx
40
- * - `APIError` (`upload_failed`) if the server transitions to `status: failed`
41
- * - `APIError` (`upload_timeout`) if `status` is still `uploading` after `maxPolls × pollIntervalMs`
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,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAeD,qBAAa,mBAAoB,SAAQ,YAAY;IACnD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI5F,kFAAkF;IAClF,GAAG,CAAC,EAAE,EAAE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AE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAS3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,MAAM,CACV,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,cAAc,EACxB,IAAI,GAAE,aAAkB,GACvB,OAAO,CAAC,UAAU,CAAC;CA8EvB"}
@@ -17,32 +17,54 @@ function computeSize(file) {
17
17
  }
18
18
  export class AttachmentsResource extends BaseResource {
19
19
  /**
20
- * `POST /v1/attachments` — register an attachment and receive a
21
- * presigned R2 upload URL. Step 1 of the 3-step upload flow; prefer the
22
- * high-level `upload()` unless you need control over each step.
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
- * Note: the contract has no DELETE /v1/attachments/{id} endpoint — rows
25
- * auto-expire after 72h via the retention worker. Don't add a delete
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
- /** `GET /v1/attachments/{id}` — fetch an attachment's status and download URL. */
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
- * Transparent 3-step attachment upload:
37
- * 1. `POST /v1/attachments` to register the file and get a presigned R2 URL
38
- * 2. `PUT` the body directly to R2 with the required headers
39
- * 3. Poll `GET /v1/attachments/{id}` every `pollIntervalMs` until `status === 'ready'`
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
- * - `BadRequestError` if `size_bytes` exceeds the 5 GB cap
43
- * - `APIError` (`upload_failed`) if the R2 PUT returns non-2xx
44
- * - `APIError` (`upload_failed`) if the server transitions to `status: failed`
45
- * - `APIError` (`upload_timeout`) if `status` is still `uploading` after `maxPolls × pollIntervalMs`
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 PUT headers via the Headers constructor so case-insensitive
64
- // dedup happens for us — the server may return `required_headers` with
65
- // any casing of `content-type` / `content-length`, and a plain
66
- // `Record<string, string>` spread would emit duplicate-cased keys that
67
- // some R2 deploys reject as `SignatureDoesNotMatch`. We trust the
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;AAoBxC,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;;;;;;;;OAQG;IACH,MAAM,CAAC,IAA0B,EAAE,IAAqB;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA2B,MAAM,EAAE,iBAAiB,EAAE,IAA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AAE,OAAO,GAAG,CAAA;YACtC,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;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"}
@@ -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` — mint a 5-minute activation code and presigned
9
- * bridge installer URL for a customer-owned device. Returns 402 if the
10
- * caller has no available BYOD slot. After the customer runs the bridge
11
- * and pairs, `device.activate` mints the BYOD line server-side.
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;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG3E"}
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"}
@@ -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` — mint a 5-minute activation code and presigned
5
- * bridge installer URL for a customer-owned device. Returns 402 if the
6
- * caller has no available BYOD slot. After the customer runs the bridge
7
- * and pairs, `device.activate` mints the BYOD line server-side.
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;;;;;OAKG;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"}
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"}