@isnap/sdk 2.3.0-next.240 → 2.3.0-next.43424264448.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/dist/generated/openapi.d.ts +136 -8
- package/package.json +1 -1
|
@@ -5009,11 +5009,11 @@ export interface paths {
|
|
|
5009
5009
|
};
|
|
5010
5010
|
/**
|
|
5011
5011
|
* List messages
|
|
5012
|
-
* @description Lists the messages your account sent and received that iSnap still keeps: it deletes a message at least 72 hours after it recorded it. Newest first by default. Filter with `line_id`, `status`, `direction`, `kind`, `since` and `until`.
|
|
5012
|
+
* @description Lists the messages your account sent and received that iSnap still keeps: it deletes a message at least 72 hours after it recorded it. Newest first by default. Filter with `line_id`, `contact`, `status`, `direction`, `kind`, `since` and `until`. `contact` selects one conversation of a line: with `line_id`, `contact` and `since`, the page holds only the messages exchanged with that handle from `since`, in both directions. A phone number is brought to E.164 and an email handle is compared without regard to case. `limit` counts the messages that match every filter. No filter selects one chat. A `line_id` that does not exist, or that is not a line of your account, returns an empty page and not `404`. Each item is the same message object as `GET /v1/messages/{id}` returns, with `queue_info` set to `null`. An item whose `kind` is `reaction` does not say which message it reacts to: filter with `kind=message` and read the `reactions` of each message.
|
|
5013
5013
|
*
|
|
5014
|
-
* The response carries `items`, `has_more` and `next_cursor`. Pass `next_cursor` as `cursor` to get the next page, and stop when `has_more` is `false`: `next_cursor` is then `null`. A cursor is valid only with the `sort`, `order` and filters of the request that returned it: write `since` and `until` the same way on every page. A malformed cursor, or one sent with another sort, order or filter, is not an error: the list restarts from the first page, and nothing in the response says so. With `sort=created_at`, a page that holds an id you already have means that the list restarted. Cursors do not expire.
|
|
5014
|
+
* The response carries `items`, `has_more` and `next_cursor`. Pass `next_cursor` as `cursor` to get the next page, and stop when `has_more` is `false`: `next_cursor` is then `null`. A cursor is valid only with the `sort`, `order` and filters of the request that returned it, `contact` included: write `since` and `until` the same way on every page. A malformed cursor, or one sent with another sort, order or filter, is not an error: the list restarts from the first page, and nothing in the response says so. With `sort=created_at`, a page that holds an id you already have means that the list restarted. Cursors do not expire.
|
|
5015
5015
|
*
|
|
5016
|
-
* Accepts an API key or a trial key. A line-scoped key lists only the messages of the lines in its `line_ids`. A trial key lists only the messages of its trial
|
|
5016
|
+
* Accepts an API key or a trial key. A line-scoped key lists only the messages of the lines in its `line_ids`. A trial key lists only the messages of its trial, and the notices iSnap sent to its paired handle since the trial started: those carry `system: true`. `GET /v1/messages` and `POST /v1/messages` share one budget of 60 requests in 60 seconds, per account with an API key and per network address with a trial key: above it the API returns `429 rate_limit_exceeded` with `Retry-After: 60`. Each item carries personal data: handles, message text, file names and `metadata`.
|
|
5017
5017
|
*/
|
|
5018
5018
|
get: {
|
|
5019
5019
|
parameters: {
|
|
@@ -5030,6 +5030,8 @@ export interface paths {
|
|
|
5030
5030
|
until?: string;
|
|
5031
5031
|
/** @description `message` leaves out voice notes and reaction entries. `voice` and `reaction` return only those. Omit it for all kinds. */
|
|
5032
5032
|
kind?: "message" | "voice" | "reaction";
|
|
5033
|
+
/** @description Only the messages exchanged with this contact: the inbound messages whose `from` is the handle and the outbound messages whose `to` is the handle. A phone number in any form that parses as a valid number (a number without a country code is read as a US number) is brought to E.164. An email handle is compared without regard to case. An invalid handle gives `400 validation_failed`. */
|
|
5034
|
+
contact?: string;
|
|
5033
5035
|
/** @description `created_at`, the default, orders by the time iSnap recorded each message. `scheduled_for` orders by planned departure, the value of the `scheduled_for` field: messages that have none, which are the inbound messages and the messages typed on the device of a line, come last in both directions. */
|
|
5034
5036
|
sort?: "created_at" | "scheduled_for";
|
|
5035
5037
|
/** @description `desc` or `asc`. When omitted: `desc` for `sort=created_at` (newest first) and `asc` for `sort=scheduled_for` (soonest first). */
|
|
@@ -5164,6 +5166,8 @@ export interface paths {
|
|
|
5164
5166
|
use_typing_indicator?: boolean;
|
|
5165
5167
|
/** @description `true` to let this message leave during the quiet hours of the line: the hours whose weight is 0 in the line's `activity_curve`, counted in the recipient's local time. Use it for a recipient of your own, such as an alert to your own phone number. The default is `false`. The message still waits for the sending limits of the line, for the spacing between messages and behind an earlier message to the same recipient that iSnap holds. No effect on a shared line. The response returns the value in effect. */
|
|
5166
5168
|
ignore_quiet_hours?: boolean;
|
|
5169
|
+
/** @description `true` to cancel the message if its recipient writes to the line before the message is with the line's device. iSnap then cancels it as `DELETE /v1/messages/{message_id}` does (status `cancelled`, one `message.cancelled` event) and never sends it. A message that the device already holds, or that was sent, is not cancelled. Use it for a follow-up that is pointless once the recipient has answered. Only a message created before the recipient's message was received is cancelled. The default is `false`. The response returns the value in effect. */
|
|
5170
|
+
cancel_on_reply?: boolean;
|
|
5167
5171
|
/**
|
|
5168
5172
|
* @description Your own keys and values for this message: at most 20 keys and 8,192 bytes once serialized as JSON, otherwise the API returns `400 validation_failed`. iSnap stores the object as sent and returns it in `metadata` of the message, in every response and in the events of the message.
|
|
5169
5173
|
* @example {
|
|
@@ -6556,7 +6560,7 @@ export interface paths {
|
|
|
6556
6560
|
};
|
|
6557
6561
|
/**
|
|
6558
6562
|
* Get an attachment
|
|
6559
|
-
* @description Returns one attachment and, when its `status` is `ready`, a signed `download_url` valid for 15 minutes: until `download_expires_at`. Call again for a new URL. For any other `status`, `download_url` and `download_expires_at` are `null`. An account can read the attachments it created and the files received on its inbound messages: any other id returns `404 not_found`. Once `expires_at` has passed, 72 hours after the attachment was created, or after iSnap registered a received file, the API returns `410 attachment_expired` and iSnap deletes the file. No event announces a change of `status`. Accepts an API key. The `line_ids` of a line-scoped key are not checked: the key reads every attachment the account can read. `filename` can carry personal data.
|
|
6563
|
+
* @description Returns one attachment and, when its `status` is `ready`, a signed `download_url` valid for 15 minutes: until `download_expires_at`. Call again for a new URL. For any other `status`, `download_url` and `download_expires_at` are `null`. An account can read the attachments it created and the files received on its inbound messages: any other id returns `404 not_found`. Once `expires_at` has passed, 72 hours after the attachment was created, or after iSnap registered a received file, the API returns `410 attachment_expired` and iSnap deletes the file. No event announces a change of `status`. Accepts an API key or a trial key. The `line_ids` of a line-scoped key are not checked: the key reads every attachment the account can read. A trial key reads only the files received in its own trial thread, that is on messages on the line of the trial, to or from the phone number paired with the trial, and gets `404 not_found` for any other attachment, including those of another trial on the same line or of an earlier trial of the same number. A trial key cannot create attachments: `POST /v1/attachments` refuses it with `401`. `filename` can carry personal data.
|
|
6560
6564
|
*/
|
|
6561
6565
|
get: {
|
|
6562
6566
|
parameters: {
|
|
@@ -6608,7 +6612,7 @@ export interface paths {
|
|
|
6608
6612
|
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
6609
6613
|
};
|
|
6610
6614
|
};
|
|
6611
|
-
/** @description Not found. `error.code` is `not_found`: the attachment does not exist, or it is neither an attachment your account created nor a file received on one of its inbound messages. */
|
|
6615
|
+
/** @description Not found. `error.code` is `not_found`: the attachment does not exist, or it is neither an attachment your account created nor a file received on one of its inbound messages, or, with a trial key, it is not a file received in the thread of the trial. */
|
|
6612
6616
|
404: {
|
|
6613
6617
|
headers: {
|
|
6614
6618
|
[name: string]: unknown;
|
|
@@ -7073,6 +7077,96 @@ export interface paths {
|
|
|
7073
7077
|
patch?: never;
|
|
7074
7078
|
trace?: never;
|
|
7075
7079
|
};
|
|
7080
|
+
"/v1/chats/{chat_id}/participants": {
|
|
7081
|
+
parameters: {
|
|
7082
|
+
query?: never;
|
|
7083
|
+
header?: never;
|
|
7084
|
+
path?: never;
|
|
7085
|
+
cookie?: never;
|
|
7086
|
+
};
|
|
7087
|
+
/**
|
|
7088
|
+
* List the members of a chat
|
|
7089
|
+
* @description Returns the members of a chat, oldest first, each with its `handle` and `joined_at`. On a group (`is_group` is `true` on the chat), these are the members iSnap has recorded for it: the current ones, or, with `at`, the ones it had at that time. A group whose members iSnap has not recorded yet returns an empty list. A chat that is not a group returns its one contact, whatever `at` is. A malformed `at` returns `400 validation_failed`. Accepts an API key. A chat that does not exist, whose line is not yours, or that is on a line outside a line-scoped key's `line_ids` returns `404 not_found`. `handle` is personal data.
|
|
7090
|
+
*/
|
|
7091
|
+
get: {
|
|
7092
|
+
parameters: {
|
|
7093
|
+
query?: {
|
|
7094
|
+
/** @description An ISO 8601 timestamp with a UTC offset, for example `2026-01-15T14:00:00Z`. Returns the members the group had at that time. Omit it for the current members. It has no effect on a chat that is not a group. */
|
|
7095
|
+
at?: string;
|
|
7096
|
+
};
|
|
7097
|
+
header?: never;
|
|
7098
|
+
path: {
|
|
7099
|
+
/** @description Chat id: `chat_` followed by 25 letters or digits. */
|
|
7100
|
+
chat_id: string;
|
|
7101
|
+
};
|
|
7102
|
+
cookie?: never;
|
|
7103
|
+
};
|
|
7104
|
+
requestBody?: never;
|
|
7105
|
+
responses: {
|
|
7106
|
+
/** @description The members of the chat. */
|
|
7107
|
+
200: {
|
|
7108
|
+
headers: {
|
|
7109
|
+
[name: string]: unknown;
|
|
7110
|
+
};
|
|
7111
|
+
content: {
|
|
7112
|
+
"application/json": components["schemas"]["ChatParticipantListEnvelope"];
|
|
7113
|
+
};
|
|
7114
|
+
};
|
|
7115
|
+
/** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. */
|
|
7116
|
+
400: {
|
|
7117
|
+
headers: {
|
|
7118
|
+
[name: string]: unknown;
|
|
7119
|
+
};
|
|
7120
|
+
content: {
|
|
7121
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7122
|
+
};
|
|
7123
|
+
};
|
|
7124
|
+
/** @description No valid credential. `error.code` is `unauthorized`. */
|
|
7125
|
+
401: {
|
|
7126
|
+
headers: {
|
|
7127
|
+
[name: string]: unknown;
|
|
7128
|
+
};
|
|
7129
|
+
content: {
|
|
7130
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7131
|
+
};
|
|
7132
|
+
};
|
|
7133
|
+
/** @description Not found. `error.code` is `not_found`: the chat does not exist, its line is not yours, or it is on a line outside the key's `line_ids`. */
|
|
7134
|
+
404: {
|
|
7135
|
+
headers: {
|
|
7136
|
+
[name: string]: unknown;
|
|
7137
|
+
};
|
|
7138
|
+
content: {
|
|
7139
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7140
|
+
};
|
|
7141
|
+
};
|
|
7142
|
+
/** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came in 60 seconds from the same account, for requests authenticated by an API key, or from the same network address, for any other request. An account can have a different limit. Wait `error.retry_after` seconds. */
|
|
7143
|
+
429: {
|
|
7144
|
+
headers: {
|
|
7145
|
+
[name: string]: unknown;
|
|
7146
|
+
};
|
|
7147
|
+
content: {
|
|
7148
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7149
|
+
};
|
|
7150
|
+
};
|
|
7151
|
+
/** @description Unexpected failure. `error.code` is `internal_error`. An operation that takes a JSON body also returns it when the body, sent as `application/json`, is not valid JSON. Quote `trace_id` when you report it to iSnap. */
|
|
7152
|
+
500: {
|
|
7153
|
+
headers: {
|
|
7154
|
+
[name: string]: unknown;
|
|
7155
|
+
};
|
|
7156
|
+
content: {
|
|
7157
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
7158
|
+
};
|
|
7159
|
+
};
|
|
7160
|
+
};
|
|
7161
|
+
};
|
|
7162
|
+
put?: never;
|
|
7163
|
+
post?: never;
|
|
7164
|
+
delete?: never;
|
|
7165
|
+
options?: never;
|
|
7166
|
+
head?: never;
|
|
7167
|
+
patch?: never;
|
|
7168
|
+
trace?: never;
|
|
7169
|
+
};
|
|
7076
7170
|
"/v1/chats/{chat_id}/share-contact-card": {
|
|
7077
7171
|
parameters: {
|
|
7078
7172
|
query?: never;
|
|
@@ -9434,6 +9528,8 @@ export interface components {
|
|
|
9434
9528
|
device_state: "online" | "degraded" | "offline" | "initializing" | "blocked" | null;
|
|
9435
9529
|
/** @description Free storage on the device, in bytes, as last reported. `null` means not reported, not zero. */
|
|
9436
9530
|
storage_free_bytes: number | null;
|
|
9531
|
+
/** @description The reason codes of the warnings the device currently raises, each a setting of the Mac that the customer can change: `messages_spam_filter_on` means Filter spam is on in Messages, so iMessages from new contacts can be held back. An open list: ignore the values you do not know. `[]` means no warning among the checks the device reports. `null` means not measured: the line has no active device session, the device is not reporting (it has not reported since it was paired, or for 5 minutes or more), it has sent no diagnostics, or the line is suspended or cancelled. `null` is never "no warning". */
|
|
9532
|
+
warnings: string[] | null;
|
|
9437
9533
|
};
|
|
9438
9534
|
LineConfigEnvelope: {
|
|
9439
9535
|
/**
|
|
@@ -10048,10 +10144,12 @@ export interface components {
|
|
|
10048
10144
|
reply_to_message_id: string | null;
|
|
10049
10145
|
/** @description On an outbound message, whether the line's device shows the typing indicator to the recipient before it sends the message. A message sent with an API key on a line that is not an iMessage line always has `false`. It has no meaning on an inbound message. */
|
|
10050
10146
|
use_typing_indicator: boolean;
|
|
10051
|
-
/** @description The `metadata` you sent with the message, unchanged. `null` when you sent none,
|
|
10147
|
+
/** @description The `metadata` you sent with the message, unchanged. `null` when you sent none, on an inbound message and on a message iSnap sent itself (`system: true`). */
|
|
10052
10148
|
metadata: {
|
|
10053
10149
|
[key: string]: unknown;
|
|
10054
10150
|
} | null;
|
|
10151
|
+
/** @description `true` on a message iSnap itself sent to a contact, such as the notices a free line sends to its paired phone. `false` on every message sent or received through your own lines and keys. A message with `system: true` does not count toward the limits of a free line. */
|
|
10152
|
+
system: boolean;
|
|
10055
10153
|
/** @description The files of the message, in order. Empty when the message has none. Files received with an inbound message are listed here too. */
|
|
10056
10154
|
attachments: components["schemas"]["MessageAttachmentV1"][];
|
|
10057
10155
|
/** @description The reactions on the message, at most one per author. Empty when the message has none, and always empty on an entry whose `kind` is `reaction`. The line's own reaction appears as soon as the API accepts it, and disappears as soon as the API accepts its removal, before the line's device confirms either. It stays listed when the device fails to place it. */
|
|
@@ -10064,6 +10162,8 @@ export interface components {
|
|
|
10064
10162
|
reply_lane: boolean;
|
|
10065
10163
|
/** @description `true` when the message was sent with `ignore_quiet_hours: true` on a line that is not a shared line: quiet hours do not hold it. `false` otherwise, on a shared line, on an inbound message and on a message typed on the device of the line. Set when the message is accepted and never changed after that. */
|
|
10066
10164
|
ignore_quiet_hours: boolean;
|
|
10165
|
+
/** @description `true` when the message was sent with `cancel_on_reply: true`: iSnap cancels it if its recipient writes to the line before the message is with the line's device. `false` otherwise, on an inbound message and on a message typed on the device of the line. Set when the message is accepted and never changed after that. */
|
|
10166
|
+
cancel_on_reply: boolean;
|
|
10067
10167
|
/** @description The state of the line's sending limits when the message was accepted. Filled only in the response of `POST /v1/messages` to a new request: `null` on every read, in the response to a retry with the same `Idempotency-Key`, and in events. */
|
|
10068
10168
|
queue_info: {
|
|
10069
10169
|
/** @description 0 when the message leaves immediately. Otherwise the rank of the message among the line's held messages, starting at 1. */
|
|
@@ -10688,7 +10788,7 @@ export interface components {
|
|
|
10688
10788
|
/** @description Pass it as `cursor` to get the next page. `null` on the last page. */
|
|
10689
10789
|
next_cursor: string | null;
|
|
10690
10790
|
};
|
|
10691
|
-
/** @description The messages between one line and one contact. iSnap creates a chat at the first message in either direction and never deletes it: a chat stays listed after its messages are deleted. It uses the same chat for both directions when the device of the line stores the handle of the contact in the form of the `to` you send to. A chat belongs to its line, not to an account: after a line changes owner, the account that owns the line lists its chats, those of earlier owners included, and their counters include the messages of earlier owners. */
|
|
10791
|
+
/** @description The messages between one line and one contact, or in one group. iSnap creates a chat at the first message in either direction and never deletes it: a chat stays listed after its messages are deleted. It uses the same chat for both directions when the device of the line stores the handle of the contact in the form of the `to` you send to. A chat belongs to its line, not to an account: after a line changes owner, the account that owns the line lists its chats, those of earlier owners included, and their counters include the messages of earlier owners. */
|
|
10692
10792
|
Chat: {
|
|
10693
10793
|
/**
|
|
10694
10794
|
* @description Chat id: `chat_` followed by 25 letters or digits.
|
|
@@ -10697,8 +10797,12 @@ export interface components {
|
|
|
10697
10797
|
id: string;
|
|
10698
10798
|
/** @description Id of the line of the chat. */
|
|
10699
10799
|
line_id: string;
|
|
10700
|
-
/** @description
|
|
10800
|
+
/** @description On a chat that is not a group, the handle that opened it: the E.164 form of `to` when a message you sent opened it, or the sender's handle as the line's device stores it, a phone number or an email address, when a received message opened it. The typing and read operations take only a chat whose `contact_handle` is a phone number in E.164. It is personal data. On a group (`is_group` is `true`), the identifier of the group, not a person: read its members with `GET /v1/chats/{chat_id}/participants`. A group that iSnap recorded before it told groups apart can still show the handle of one sender. */
|
|
10701
10801
|
contact_handle: string;
|
|
10802
|
+
/** @description `true` when the chat is a group conversation, `false` when it is between the line and one contact. */
|
|
10803
|
+
is_group: boolean;
|
|
10804
|
+
/** @description On a group, the number of members iSnap has recorded for it now: 0 while none is recorded yet. `null` on a chat that is not a group. */
|
|
10805
|
+
member_count: number | null;
|
|
10702
10806
|
/** @description On a shared line, the phone number that serves this contact, or `null` when none is assigned: the next message to the contact is then given a number. Always `null` on a line that is not a shared line. */
|
|
10703
10807
|
outbound_number: string | null;
|
|
10704
10808
|
/** @description Time of the last message of the chat, sent or received. Equals `created_at` while the chat has no message. */
|
|
@@ -10724,6 +10828,30 @@ export interface components {
|
|
|
10724
10828
|
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
10725
10829
|
request_id: string;
|
|
10726
10830
|
};
|
|
10831
|
+
ChatParticipantListEnvelope: {
|
|
10832
|
+
/**
|
|
10833
|
+
* @description Always `true` on a success response.
|
|
10834
|
+
* @enum {boolean}
|
|
10835
|
+
*/
|
|
10836
|
+
success: true;
|
|
10837
|
+
data: components["schemas"]["ChatParticipantList"];
|
|
10838
|
+
/** @description Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap. */
|
|
10839
|
+
trace_id: string;
|
|
10840
|
+
/** @description Id of the request that produced this response: `req_` followed by 25 letters or digits. */
|
|
10841
|
+
request_id: string;
|
|
10842
|
+
};
|
|
10843
|
+
/** @description The members of a chat. */
|
|
10844
|
+
ChatParticipantList: {
|
|
10845
|
+
/** @description The members, oldest first. On a chat that is not a group, its one contact. Empty on a group whose members iSnap has not recorded yet. */
|
|
10846
|
+
items: components["schemas"]["ChatParticipant"][];
|
|
10847
|
+
};
|
|
10848
|
+
/** @description One member of a chat. */
|
|
10849
|
+
ChatParticipant: {
|
|
10850
|
+
/** @description The handle of the member, a phone number or an email address. It is personal data. */
|
|
10851
|
+
handle: string;
|
|
10852
|
+
/** @description When iSnap first saw the member in the group, as an ISO 8601 timestamp. On a chat that is not a group, when iSnap created the chat. */
|
|
10853
|
+
joined_at: string;
|
|
10854
|
+
};
|
|
10727
10855
|
ShareContactCardEnvelope: {
|
|
10728
10856
|
/**
|
|
10729
10857
|
* @description Always `true` on a success response.
|