@isnap/sdk 0.1.0 → 1.1.0-next.49

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 (104) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +173 -167
  3. package/dist/client.d.ts +48 -50
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +258 -89
  6. package/dist/client.js.map +1 -1
  7. package/dist/config.d.ts +43 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +55 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/errors.d.ts +53 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +100 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/generated/openapi.d.ts +10924 -0
  16. package/dist/idempotency.d.ts +2 -0
  17. package/dist/idempotency.d.ts.map +1 -0
  18. package/dist/idempotency.js +4 -0
  19. package/dist/idempotency.js.map +1 -0
  20. package/dist/index.d.ts +26 -8
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +12 -6
  23. package/dist/index.js.map +1 -1
  24. package/dist/internal/sleep.d.ts +10 -0
  25. package/dist/internal/sleep.d.ts.map +1 -0
  26. package/dist/internal/sleep.js +37 -0
  27. package/dist/internal/sleep.js.map +1 -0
  28. package/dist/pagination.d.ts +10 -0
  29. package/dist/pagination.d.ts.map +1 -0
  30. package/dist/pagination.js +16 -0
  31. package/dist/pagination.js.map +1 -0
  32. package/dist/resources/attachments.d.ts +45 -0
  33. package/dist/resources/attachments.d.ts.map +1 -0
  34. package/dist/resources/attachments.js +120 -0
  35. package/dist/resources/attachments.js.map +1 -0
  36. package/dist/resources/base.d.ts +6 -0
  37. package/dist/resources/base.d.ts.map +1 -0
  38. package/dist/resources/base.js +7 -0
  39. package/dist/resources/base.js.map +1 -0
  40. package/dist/resources/byod.d.ts +15 -0
  41. package/dist/resources/byod.d.ts.map +1 -0
  42. package/dist/resources/byod.js +13 -0
  43. package/dist/resources/byod.js.map +1 -0
  44. package/dist/resources/chats.d.ts +29 -0
  45. package/dist/resources/chats.d.ts.map +1 -0
  46. package/dist/resources/chats.js +28 -0
  47. package/dist/resources/chats.js.map +1 -0
  48. package/dist/resources/lines.d.ts +64 -27
  49. package/dist/resources/lines.d.ts.map +1 -1
  50. package/dist/resources/lines.js +77 -37
  51. package/dist/resources/lines.js.map +1 -1
  52. package/dist/resources/lookup.d.ts +15 -0
  53. package/dist/resources/lookup.d.ts.map +1 -0
  54. package/dist/resources/lookup.js +13 -0
  55. package/dist/resources/lookup.js.map +1 -0
  56. package/dist/resources/messages.d.ts +36 -67
  57. package/dist/resources/messages.d.ts.map +1 -1
  58. package/dist/resources/messages.js +37 -94
  59. package/dist/resources/messages.js.map +1 -1
  60. package/dist/resources/trial.d.ts +28 -0
  61. package/dist/resources/trial.d.ts.map +1 -0
  62. package/dist/resources/trial.js +31 -0
  63. package/dist/resources/trial.js.map +1 -0
  64. package/dist/resources/webhooks.d.ts +49 -39
  65. package/dist/resources/webhooks.d.ts.map +1 -1
  66. package/dist/resources/webhooks.js +52 -39
  67. package/dist/resources/webhooks.js.map +1 -1
  68. package/dist/retry.d.ts +14 -0
  69. package/dist/retry.d.ts.map +1 -0
  70. package/dist/retry.js +47 -0
  71. package/dist/retry.js.map +1 -0
  72. package/dist/types.d.ts +30 -196
  73. package/dist/types.d.ts.map +1 -1
  74. package/dist/types.js +1 -28
  75. package/dist/types.js.map +1 -1
  76. package/dist/version.d.ts +3 -0
  77. package/dist/version.d.ts.map +1 -0
  78. package/dist/version.js +20 -0
  79. package/dist/version.js.map +1 -0
  80. package/dist/webhooks/parse.d.ts +15 -0
  81. package/dist/webhooks/parse.d.ts.map +1 -0
  82. package/dist/webhooks/parse.js +47 -0
  83. package/dist/webhooks/parse.js.map +1 -0
  84. package/dist/webhooks/types.d.ts +93 -0
  85. package/dist/webhooks/types.d.ts.map +1 -0
  86. package/dist/webhooks/types.js +20 -0
  87. package/dist/webhooks/types.js.map +1 -0
  88. package/dist/webhooks/verify.d.ts +41 -0
  89. package/dist/webhooks/verify.d.ts.map +1 -0
  90. package/dist/webhooks/verify.js +110 -0
  91. package/dist/webhooks/verify.js.map +1 -0
  92. package/package.json +45 -30
  93. package/dist/paginate.d.ts +0 -33
  94. package/dist/paginate.d.ts.map +0 -1
  95. package/dist/paginate.js +0 -40
  96. package/dist/paginate.js.map +0 -1
  97. package/dist/webhook-events.d.ts +0 -61
  98. package/dist/webhook-events.d.ts.map +0 -1
  99. package/dist/webhook-events.js +0 -44
  100. package/dist/webhook-events.js.map +0 -1
  101. package/dist/webhook-verify.d.ts +0 -27
  102. package/dist/webhook-verify.d.ts.map +0 -1
  103. package/dist/webhook-verify.js +0 -42
  104. package/dist/webhook-verify.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/resources/lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEvC;;;;;;;;;;OAUG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAUhE;;;;;;;;;;;;OAYG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC"}
1
+ {"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/resources/lines.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,IA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G;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAS9D,6FAA6F;IAC7F,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAS7E;;;;OAIG;IACH,YAAY,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,eAAe,EACrB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,sBAAsB,CAAC;CAQnC"}
@@ -1,46 +1,86 @@
1
- export class LinesResource {
2
- client;
3
- constructor(client) {
4
- this.client = client;
1
+ import { BaseResource } from './base.js';
2
+ export class LinesResource extends BaseResource {
3
+ /**
4
+ * `GET /v1/lines` — page/limit-paginated list of lines visible to the
5
+ * caller. Returns the wire-format envelope contents (`{lines, total,
6
+ * page, limit}`); not cursor-paginated like messages because the
7
+ * marketplace UI shows real "page X of Y" pagination.
8
+ */
9
+ list(query = {}, opts) {
10
+ return this.client.request('GET', '/v1/lines', undefined, {
11
+ ...opts,
12
+ query: { ...opts?.query, ...query }
13
+ });
14
+ }
15
+ /** `GET /v1/lines/my` — list of lines owned by the calling account. */
16
+ listMine(opts) {
17
+ return this.client.request('GET', '/v1/lines/my', undefined, opts);
18
+ }
19
+ /** `GET /v1/lines/{id}` — fetch a single line by ID or `line_<base62>` public ID. */
20
+ get(id, opts) {
21
+ return this.client.request('GET', `/v1/lines/${encodeURIComponent(id)}`, undefined, opts);
22
+ }
23
+ /**
24
+ * `POST /v1/lines/assign` — atomically find an available line matching
25
+ * the requested billing tier (and optional area code), reserve it, and
26
+ * activate it on the calling account in a single round-trip.
27
+ */
28
+ assign(body, opts) {
29
+ return this.client.request('POST', '/v1/lines/assign', body, opts);
30
+ }
31
+ /** `POST /v1/lines/{id}/reserve` — soft-hold a marketplace line for 15 minutes. */
32
+ reserve(id, opts) {
33
+ return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/reserve`, undefined, opts);
34
+ }
35
+ /** `POST /v1/lines/{id}/activate` — flip a reserved line to `active`. */
36
+ activate(id, opts) {
37
+ return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/activate`, undefined, opts);
38
+ }
39
+ /** `POST /v1/lines/{id}/release` — release an active or reserved line back to the pool. */
40
+ release(id, opts) {
41
+ return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/release`, undefined, opts);
5
42
  }
6
43
  /**
7
- * List phone lines with optional filters and pagination.
8
- *
9
- * @param params - Optional filters (type, area_code) and pagination
10
- * @returns Paginated list of lines
11
- *
12
- * @example
13
- * ```ts
14
- * const { lines } = await client.lines.list({ type: 'iphone', limit: 10 });
15
- * ```
44
+ * `POST /v1/lines/{id}/transfer-ownership` reassign a line to a
45
+ * different end-user account without re-pairing the underlying device.
16
46
  */
17
- async list(params) {
18
- const query = {};
19
- if (params?.type)
20
- query.type = params.type;
21
- if (params?.area_code)
22
- query.area_code = params.area_code;
23
- if (params?.page)
24
- query.page = String(params.page);
25
- if (params?.limit)
26
- query.limit = String(params.limit);
27
- return this.client.request('GET', '/lines', undefined, query);
47
+ transferOwnership(id, body, opts) {
48
+ return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/transfer-ownership`, body, opts);
49
+ }
50
+ /**
51
+ * `PATCH /v1/lines/{id}` — merge-patch the line's free-form metadata
52
+ * object. Null-valued keys delete those keys from the stored object.
53
+ */
54
+ patch(id, body, opts) {
55
+ return this.client.request('PATCH', `/v1/lines/${encodeURIComponent(id)}`, body, opts);
56
+ }
57
+ /** `GET /v1/lines/{id}/quota` — the line's current 5-bucket quota snapshot. */
58
+ quota(id, opts) {
59
+ return this.client.request('GET', `/v1/lines/${encodeURIComponent(id)}/quota`, undefined, opts);
60
+ }
61
+ /** `GET /v1/lines/{id}/queue` — pending scheduled / queued messages for the line. */
62
+ queue(id, query = {}, opts) {
63
+ return this.client.request('GET', `/v1/lines/${encodeURIComponent(id)}/queue`, undefined, { ...opts, query: { ...opts?.query, ...query } });
64
+ }
65
+ /**
66
+ * `GET /v1/lines/{id}/health` — BYOD-only line health snapshot. Throws
67
+ * `PermissionDeniedError` (`rental_health_not_exposed`) for rental
68
+ * tiers per contract §2.13.
69
+ */
70
+ health(id, opts) {
71
+ return this.client.request('GET', `/v1/lines/${encodeURIComponent(id)}/health`, undefined, opts);
72
+ }
73
+ /** `GET /v1/lines/{id}/config` — effective per-line config (system defaults + overrides). */
74
+ getConfig(id, opts) {
75
+ return this.client.request('GET', `/v1/lines/${encodeURIComponent(id)}/config`, undefined, opts);
28
76
  }
29
77
  /**
30
- * Retrieve a single line by ID.
31
- *
32
- * @param lineId - The line ID
33
- * @returns The line
34
- * @throws {iSnapError} If the line is not found
35
- *
36
- * @example
37
- * ```ts
38
- * const line = await client.lines.get('ln-abc123');
39
- * console.log(line.phone_number);
40
- * ```
78
+ * `PATCH /v1/lines/{id}/config` partial override of the line's
79
+ * config. BYOD callers can only lower limits / raise delays per
80
+ * contract §2.13.
41
81
  */
42
- async get(lineId) {
43
- return this.client.request('GET', `/lines/${lineId}`);
82
+ updateConfig(id, body, opts) {
83
+ return this.client.request('PATCH', `/v1/lines/${encodeURIComponent(id)}/config`, body, opts);
44
84
  }
45
85
  }
46
86
  //# sourceMappingURL=lines.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,aAAa;IACJ;IAApB,YAAoB,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAE3C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAI,CAAC,MAAwB;QACjC,MAAM,KAAK,GAA2B,EAAE,CAAC;QACzC,IAAI,MAAM,EAAE,IAAI;YAAE,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QAC3C,IAAI,MAAM,EAAE,SAAS;YAAE,KAAK,CAAC,SAAS,GAAG,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ED,+EAA+E;IAC/E,KAAK,CAAC,EAAU,EAAE,IAAqB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,aAAa,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAC3C,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED,qFAAqF;IACrF,KAAK,CACH,EAAU,EACV,QAAwB,EAAE,EAC1B,IAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,aAAa,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAC3C,SAAS,EACT,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,CACjD,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,IAAqB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,aAAa,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAC5C,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED,6FAA6F;IAC7F,SAAS,CAAC,EAAU,EAAE,IAAqB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,aAAa,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAC5C,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,YAAY,CACV,EAAU,EACV,IAAqB,EACrB,IAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,OAAO,EACP,aAAa,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAC5C,IAAI,EACJ,IAAI,CACL,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { components } from '../generated/openapi.js';
2
+ import type { RequestOptions } from '../types.js';
3
+ import { BaseResource } from './base.js';
4
+ export type LookupRequest = components['schemas']['LookupRequest'];
5
+ export type LookupResult = components['schemas']['Lookup'];
6
+ export declare class LookupResource extends BaseResource {
7
+ /**
8
+ * `POST /v1/lookup` — check whether a handle is reachable on iMessage.
9
+ * Synchronous: returns `imessage: true | false | null`. `null` means
10
+ * the iMessage status is unknown and the handle should be treated as
11
+ * SMS-safe (degrade to SMS instead of relying on iMessage delivery).
12
+ */
13
+ check(params: LookupRequest, opts?: RequestOptions): Promise<LookupResult>;
14
+ }
15
+ //# sourceMappingURL=lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../src/resources/lookup.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,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAA;AAClE,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAA;AAE1D,qBAAa,cAAe,SAAQ,YAAY;IAC9C;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;CAG3E"}
@@ -0,0 +1,13 @@
1
+ import { BaseResource } from './base.js';
2
+ export class LookupResource extends BaseResource {
3
+ /**
4
+ * `POST /v1/lookup` — check whether a handle is reachable on iMessage.
5
+ * Synchronous: returns `imessage: true | false | null`. `null` means
6
+ * the iMessage status is unknown and the handle should be treated as
7
+ * SMS-safe (degrade to SMS instead of relying on iMessage delivery).
8
+ */
9
+ check(params, opts) {
10
+ return this.client.request('POST', '/v1/lookup', params, opts);
11
+ }
12
+ }
13
+ //# sourceMappingURL=lookup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../src/resources/lookup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,MAAM,OAAO,cAAe,SAAQ,YAAY;IAC9C;;;;;OAKG;IACH,KAAK,CAAC,MAAqB,EAAE,IAAqB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAe,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IAC9E,CAAC;CACF"}
@@ -1,77 +1,46 @@
1
- import type { iSnapClient } from '../client.js';
2
- import type { Message, SendMessageParams, ListMessagesParams, ListMessagesResponse, ListConversationsParams, ListConversationsResponse, ConversationThreadParams, ConversationThreadResponse } from '../types.js';
3
- export declare class MessagesResource {
4
- private client;
5
- constructor(client: iSnapClient);
1
+ import type { components, paths } from '../generated/openapi.js';
2
+ import type { RequestOptions } from '../types.js';
3
+ import { BaseResource } from './base.js';
4
+ /** Full message shape returned by send/get/list/cancel (contract §2.2 fat shape). */
5
+ export type Message = components['schemas']['MessageV1'];
6
+ export type SendMessageBody = NonNullable<paths['/v1/messages']['post']['requestBody']>['content']['application/json'];
7
+ export type ListMessagesQuery = NonNullable<paths['/v1/messages']['get']['parameters']['query']>;
8
+ export type SendReactionBody = components['schemas']['SendReactionRequest'];
9
+ export type Reaction = components['schemas']['Reaction'];
10
+ export type ReactionRemoval = components['schemas']['ReactionRemoval'];
11
+ export declare class MessagesResource extends BaseResource {
12
+ /** `POST /v1/messages` — send a new outbound message (queued, returns `MessageV1`). */
13
+ send(body: SendMessageBody, opts?: RequestOptions): Promise<Message>;
14
+ /** `GET /v1/messages/{id}` — fetch the full fat-shape message by ID. */
15
+ get(id: string, opts?: RequestOptions): Promise<Message>;
6
16
  /**
7
- * Send a new message.
8
- *
9
- * @param params - Message details (line, recipient, body)
10
- * @returns The created message
11
- * @throws {iSnapError} On validation or delivery errors
12
- *
13
- * @example
14
- * ```ts
15
- * const msg = await client.messages.send({
16
- * line_id: 'ln-1',
17
- * to: '+15551234567',
18
- * body: 'Hello from iSnap!',
19
- * });
20
- * ```
17
+ * `GET /v1/messages` cursor-paginated list as an AsyncIterable. The
18
+ * iterator threads the next_cursor across pages so the consumer can
19
+ * `for await (const m of client.messages.list({...}))` and get every
20
+ * matching message. Items use the fat `Message` shape — same fields as
21
+ * `send()` / `get()` (contract §2.2).
21
22
  */
22
- send(params: SendMessageParams): Promise<Message>;
23
+ list(filters?: Omit<ListMessagesQuery, 'cursor'>, opts?: RequestOptions): AsyncIterable<Message>;
23
24
  /**
24
- * Retrieve a single message by ID.
25
- *
26
- * @param messageId - The message ID
27
- * @returns The message
28
- * @throws {iSnapError} If the message is not found
29
- *
30
- * @example
31
- * ```ts
32
- * const msg = await client.messages.get('msg-abc123');
33
- * ```
25
+ * `POST /v1/messages/{id}/reactions` add an Apple-native tapback
26
+ * (love / like / dislike / laugh / emphasize / question). Replace-on-add
27
+ * semantics: posting a different `type` against the same parent updates
28
+ * the existing reaction in place. Reactions require iMessage; SMS / RCS
29
+ * parents are rejected with 422.
34
30
  */
35
- get(messageId: string): Promise<Message>;
31
+ addReaction(messageId: string, body: SendReactionBody, opts?: RequestOptions): Promise<Reaction>;
36
32
  /**
37
- * List messages with optional filters and pagination.
38
- *
39
- * @param params - Optional filters (line_id, status, direction) and pagination
40
- * @returns Paginated list of messages
41
- *
42
- * @example
43
- * ```ts
44
- * const { messages, total } = await client.messages.list({ status: 'delivered', limit: 50 });
45
- * ```
33
+ * `DELETE /v1/messages/{id}/reactions` remove the active tapback on a
34
+ * message. Idempotent: returns 200 with `removed: false` when there
35
+ * was nothing to remove (no 404), so partners can fire-and-forget. The
36
+ * response carries the `type` that was removed when applicable — handy
37
+ * for UI feedback ("removed your 'love'").
46
38
  */
47
- list(params?: ListMessagesParams): Promise<ListMessagesResponse>;
39
+ removeReaction(messageId: string, opts?: RequestOptions): Promise<ReactionRemoval>;
48
40
  /**
49
- * List all conversations with optional filters and pagination.
50
- *
51
- * @param params - Optional line_id filter and pagination
52
- * @returns Paginated list of conversations
53
- *
54
- * @example
55
- * ```ts
56
- * const { conversations } = await client.messages.listConversations({ line_id: 'ln-1' });
57
- * ```
41
+ * `DELETE /v1/messages/{id}` cancel a queued or scheduled message before
42
+ * it dispatches. Once `status: sent` the cancel is a 409.
58
43
  */
59
- listConversations(params?: ListConversationsParams): Promise<ListConversationsResponse>;
60
- /**
61
- * Retrieve a full conversation thread by ID, including its messages.
62
- *
63
- * @param conversationId - The conversation ID
64
- * @param params - Optional pagination for messages within the thread
65
- * @returns The conversation with paginated messages
66
- * @throws {iSnapError} If the conversation is not found
67
- *
68
- * @example
69
- * ```ts
70
- * const thread = await client.messages.getConversation('conv-abc123', { page: 1, limit: 25 });
71
- * console.log(thread.conversation.contact_number);
72
- * console.log(thread.messages.length);
73
- * ```
74
- */
75
- getConversation(conversationId: string, params?: ConversationThreadParams): Promise<ConversationThreadResponse>;
44
+ cancel(id: string, opts?: RequestOptions): Promise<Message>;
76
45
  }
77
46
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEvC;;;;;;;;;;;;;;;OAeG;IACG,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD;;;;;;;;;;;OAWG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C;;;;;;;;;;OAUG;IACG,IA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vF,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAIpE,wEAAwE;IACxE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxD;;;;;;OAMG;IACH,IAAI,CACF,OAAO,GAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAM,EAC/C,IAAI,CAAC,EAAE,cAAc,GACpB,aAAa,CAAC,OAAO,CAAC;IAWzB;;;;;;OAMG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAShG;;;;;;OAMG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IASlF;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAQ5D"}
@@ -1,110 +1,53 @@
1
- export class MessagesResource {
2
- client;
3
- constructor(client) {
4
- this.client = client;
1
+ import { paginate } from '../pagination.js';
2
+ import { BaseResource } from './base.js';
3
+ export class MessagesResource extends BaseResource {
4
+ /** `POST /v1/messages` — send a new outbound message (queued, returns `MessageV1`). */
5
+ send(body, opts) {
6
+ return this.client.request('POST', '/v1/messages', body, opts);
5
7
  }
6
- /**
7
- * Send a new message.
8
- *
9
- * @param params - Message details (line, recipient, body)
10
- * @returns The created message
11
- * @throws {iSnapError} On validation or delivery errors
12
- *
13
- * @example
14
- * ```ts
15
- * const msg = await client.messages.send({
16
- * line_id: 'ln-1',
17
- * to: '+15551234567',
18
- * body: 'Hello from iSnap!',
19
- * });
20
- * ```
21
- */
22
- async send(params) {
23
- return this.client.request('POST', '/v1/messages', params);
8
+ /** `GET /v1/messages/{id}` — fetch the full fat-shape message by ID. */
9
+ get(id, opts) {
10
+ return this.client.request('GET', `/v1/messages/${encodeURIComponent(id)}`, undefined, opts);
24
11
  }
25
12
  /**
26
- * Retrieve a single message by ID.
27
- *
28
- * @param messageId - The message ID
29
- * @returns The message
30
- * @throws {iSnapError} If the message is not found
31
- *
32
- * @example
33
- * ```ts
34
- * const msg = await client.messages.get('msg-abc123');
35
- * ```
13
+ * `GET /v1/messages` cursor-paginated list as an AsyncIterable. The
14
+ * iterator threads the next_cursor across pages so the consumer can
15
+ * `for await (const m of client.messages.list({...}))` and get every
16
+ * matching message. Items use the fat `Message` shape — same fields as
17
+ * `send()` / `get()` (contract §2.2).
36
18
  */
37
- async get(messageId) {
38
- return this.client.request('GET', `/v1/messages/${messageId}`);
19
+ list(filters = {}, opts) {
20
+ return paginate((cursor) => this.client.request('GET', '/v1/messages', undefined, {
21
+ ...opts,
22
+ query: { ...filters, cursor }
23
+ }), { signal: opts?.signal });
39
24
  }
40
25
  /**
41
- * List messages with optional filters and pagination.
42
- *
43
- * @param params - Optional filters (line_id, status, direction) and pagination
44
- * @returns Paginated list of messages
45
- *
46
- * @example
47
- * ```ts
48
- * const { messages, total } = await client.messages.list({ status: 'delivered', limit: 50 });
49
- * ```
26
+ * `POST /v1/messages/{id}/reactions` add an Apple-native tapback
27
+ * (love / like / dislike / laugh / emphasize / question). Replace-on-add
28
+ * semantics: posting a different `type` against the same parent updates
29
+ * the existing reaction in place. Reactions require iMessage; SMS / RCS
30
+ * parents are rejected with 422.
50
31
  */
51
- async list(params) {
52
- const query = {};
53
- if (params?.line_id)
54
- query.line_id = params.line_id;
55
- if (params?.status)
56
- query.status = params.status;
57
- if (params?.direction)
58
- query.direction = params.direction;
59
- if (params?.page)
60
- query.page = String(params.page);
61
- if (params?.limit)
62
- query.limit = String(params.limit);
63
- return this.client.request('GET', '/v1/messages', undefined, query);
32
+ addReaction(messageId, body, opts) {
33
+ return this.client.request('POST', `/v1/messages/${encodeURIComponent(messageId)}/reactions`, body, opts);
64
34
  }
65
35
  /**
66
- * List all conversations with optional filters and pagination.
67
- *
68
- * @param params - Optional line_id filter and pagination
69
- * @returns Paginated list of conversations
70
- *
71
- * @example
72
- * ```ts
73
- * const { conversations } = await client.messages.listConversations({ line_id: 'ln-1' });
74
- * ```
36
+ * `DELETE /v1/messages/{id}/reactions` remove the active tapback on a
37
+ * message. Idempotent: returns 200 with `removed: false` when there
38
+ * was nothing to remove (no 404), so partners can fire-and-forget. The
39
+ * response carries the `type` that was removed when applicable — handy
40
+ * for UI feedback ("removed your 'love'").
75
41
  */
76
- async listConversations(params) {
77
- const query = {};
78
- if (params?.line_id)
79
- query.line_id = params.line_id;
80
- if (params?.page)
81
- query.page = String(params.page);
82
- if (params?.limit)
83
- query.limit = String(params.limit);
84
- return this.client.request('GET', '/v1/messages/conversations', undefined, query);
42
+ removeReaction(messageId, opts) {
43
+ return this.client.request('DELETE', `/v1/messages/${encodeURIComponent(messageId)}/reactions`, undefined, opts);
85
44
  }
86
45
  /**
87
- * Retrieve a full conversation thread by ID, including its messages.
88
- *
89
- * @param conversationId - The conversation ID
90
- * @param params - Optional pagination for messages within the thread
91
- * @returns The conversation with paginated messages
92
- * @throws {iSnapError} If the conversation is not found
93
- *
94
- * @example
95
- * ```ts
96
- * const thread = await client.messages.getConversation('conv-abc123', { page: 1, limit: 25 });
97
- * console.log(thread.conversation.contact_number);
98
- * console.log(thread.messages.length);
99
- * ```
46
+ * `DELETE /v1/messages/{id}` cancel a queued or scheduled message before
47
+ * it dispatches. Once `status: sent` the cancel is a 409.
100
48
  */
101
- async getConversation(conversationId, params) {
102
- const query = {};
103
- if (params?.page)
104
- query.page = String(params.page);
105
- if (params?.limit)
106
- query.limit = String(params.limit);
107
- return this.client.request('GET', `/v1/messages/conversations/${conversationId}`, undefined, query);
49
+ cancel(id, opts) {
50
+ return this.client.request('DELETE', `/v1/messages/${encodeURIComponent(id)}`, undefined, opts);
108
51
  }
109
52
  }
110
53
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/messages.ts"],"names":[],"mappings":"AAYA,MAAM,OAAO,gBAAgB;IACP;IAApB,YAAoB,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAE3C;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,IAAI,CAAC,MAAyB;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAU,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,GAAG,CAAC,SAAiB;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAU,KAAK,EAAE,gBAAgB,SAAS,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAI,CAAC,MAA2B;QACpC,MAAM,KAAK,GAA2B,EAAE,CAAC;QACzC,IAAI,MAAM,EAAE,OAAO;YAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QACpD,IAAI,MAAM,EAAE,MAAM;YAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACjD,IAAI,MAAM,EAAE,SAAS;YAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAC1D,IAAI,MAAM,EAAE,IAAI;YAAE,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,MAAM,EAAE,KAAK;YAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEtD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAuB,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;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;IACH,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import type { components } from '../generated/openapi.js';
2
+ import type { RequestOptions } from '../types.js';
3
+ import { BaseResource } from './base.js';
4
+ export type TrialInitBody = components['schemas']['TrialInitBody'];
5
+ export type TrialInitData = components['schemas']['TrialInitData'];
6
+ export type TrialStatusData = components['schemas']['TrialStatusData'];
7
+ export type TrialActivityData = components['schemas']['TrialActivityData'];
8
+ export declare class TrialResource extends BaseResource {
9
+ /**
10
+ * `POST /v1/trial/init` — create a new trial session. Returns the pool
11
+ * line phone number the partner must text from their device to pair
12
+ * within the 15-minute window, the opaque `token` to fetch status, and
13
+ * the `instructions_url` to deep-link the user.
14
+ */
15
+ init(body?: TrialInitBody, opts?: RequestOptions): Promise<TrialInitData>;
16
+ /**
17
+ * `GET /v1/trial/status?token=...` — poll status during the
18
+ * pairing-pending window or to retrieve the trial API key after
19
+ * pairing succeeds.
20
+ */
21
+ status(token: string, opts?: RequestOptions): Promise<TrialStatusData>;
22
+ /**
23
+ * `GET /v1/trial/activity` — current send/receive counters + dormancy
24
+ * remaining. Auth-gated by the trial API key issued from `init`/`status`.
25
+ */
26
+ activity(opts?: RequestOptions): Promise<TrialActivityData>;
27
+ }
28
+ //# sourceMappingURL=trial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trial.d.ts","sourceRoot":"","sources":["../../src/resources/trial.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,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAA;AAClE,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAA;AAClE,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAA;AACtE,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAAA;AAE1E,qBAAa,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACH,IAAI,CAAC,IAAI,GAAE,aAAkB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAI7E;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAOtE;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAG5D"}
@@ -0,0 +1,31 @@
1
+ import { BaseResource } from './base.js';
2
+ export class TrialResource extends BaseResource {
3
+ /**
4
+ * `POST /v1/trial/init` — create a new trial session. Returns the pool
5
+ * line phone number the partner must text from their device to pair
6
+ * within the 15-minute window, the opaque `token` to fetch status, and
7
+ * the `instructions_url` to deep-link the user.
8
+ */
9
+ init(body = {}, opts) {
10
+ return this.client.request('POST', '/v1/trial/init', body, opts);
11
+ }
12
+ /**
13
+ * `GET /v1/trial/status?token=...` — poll status during the
14
+ * pairing-pending window or to retrieve the trial API key after
15
+ * pairing succeeds.
16
+ */
17
+ status(token, opts) {
18
+ return this.client.request('GET', '/v1/trial/status', undefined, {
19
+ ...opts,
20
+ query: { ...opts?.query, token }
21
+ });
22
+ }
23
+ /**
24
+ * `GET /v1/trial/activity` — current send/receive counters + dormancy
25
+ * remaining. Auth-gated by the trial API key issued from `init`/`status`.
26
+ */
27
+ activity(opts) {
28
+ return this.client.request('GET', '/v1/trial/activity', undefined, opts);
29
+ }
30
+ }
31
+ //# sourceMappingURL=trial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trial.js","sourceRoot":"","sources":["../../src/resources/trial.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAOxC,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACH,IAAI,CAAC,OAAsB,EAAE,EAAE,IAAqB;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAgB,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACjF,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAa,EAAE,IAAqB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAkB,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE;YAChF,GAAG,IAAI;YACP,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;SACjC,CAAC,CAAA;IACJ,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,IAAqB;QAC5B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAoB,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;IAC7F,CAAC;CACF"}