@linqapp/sdk 0.32.1 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +82 -112
  3. package/client.d.mts +41 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +41 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +38 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +38 -2
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/available-number.d.mts +13 -1
  13. package/resources/available-number.d.mts.map +1 -1
  14. package/resources/available-number.d.ts +13 -1
  15. package/resources/available-number.d.ts.map +1 -1
  16. package/resources/available-number.js +2 -1
  17. package/resources/available-number.js.map +1 -1
  18. package/resources/available-number.mjs +2 -1
  19. package/resources/available-number.mjs.map +1 -1
  20. package/resources/chats/chats.d.mts +125 -64
  21. package/resources/chats/chats.d.mts.map +1 -1
  22. package/resources/chats/chats.d.ts +125 -64
  23. package/resources/chats/chats.d.ts.map +1 -1
  24. package/resources/chats/chats.js +59 -59
  25. package/resources/chats/chats.js.map +1 -1
  26. package/resources/chats/chats.mjs +59 -59
  27. package/resources/chats/chats.mjs.map +1 -1
  28. package/resources/chats/index.d.mts +2 -2
  29. package/resources/chats/index.d.mts.map +1 -1
  30. package/resources/chats/index.d.ts +2 -2
  31. package/resources/chats/index.d.ts.map +1 -1
  32. package/resources/chats/location.d.mts +25 -25
  33. package/resources/chats/location.d.mts.map +1 -1
  34. package/resources/chats/location.d.ts +25 -25
  35. package/resources/chats/location.d.ts.map +1 -1
  36. package/resources/chats/location.js +27 -27
  37. package/resources/chats/location.js.map +1 -1
  38. package/resources/chats/location.mjs +27 -27
  39. package/resources/chats/location.mjs.map +1 -1
  40. package/resources/chats/messages.d.mts +17 -17
  41. package/resources/chats/messages.d.mts.map +1 -1
  42. package/resources/chats/messages.d.ts +17 -17
  43. package/resources/chats/messages.d.ts.map +1 -1
  44. package/resources/chats/messages.js +16 -16
  45. package/resources/chats/messages.js.map +1 -1
  46. package/resources/chats/messages.mjs +16 -16
  47. package/resources/chats/messages.mjs.map +1 -1
  48. package/resources/contact-card.d.mts +29 -28
  49. package/resources/contact-card.d.mts.map +1 -1
  50. package/resources/contact-card.d.ts +29 -28
  51. package/resources/contact-card.d.ts.map +1 -1
  52. package/resources/contact-card.js +23 -22
  53. package/resources/contact-card.js.map +1 -1
  54. package/resources/contact-card.mjs +23 -22
  55. package/resources/contact-card.mjs.map +1 -1
  56. package/resources/experiences.d.mts +91 -0
  57. package/resources/experiences.d.mts.map +1 -0
  58. package/resources/experiences.d.ts +91 -0
  59. package/resources/experiences.d.ts.map +1 -0
  60. package/resources/experiences.js +29 -0
  61. package/resources/experiences.js.map +1 -0
  62. package/resources/experiences.mjs +25 -0
  63. package/resources/experiences.mjs.map +1 -0
  64. package/resources/index.d.mts +7 -3
  65. package/resources/index.d.mts.map +1 -1
  66. package/resources/index.d.ts +7 -3
  67. package/resources/index.d.ts.map +1 -1
  68. package/resources/index.js +9 -1
  69. package/resources/index.js.map +1 -1
  70. package/resources/index.mjs +4 -0
  71. package/resources/index.mjs.map +1 -1
  72. package/resources/messages.d.mts +71 -35
  73. package/resources/messages.d.mts.map +1 -1
  74. package/resources/messages.d.ts +71 -35
  75. package/resources/messages.d.ts.map +1 -1
  76. package/resources/messages.js +41 -30
  77. package/resources/messages.js.map +1 -1
  78. package/resources/messages.mjs +41 -30
  79. package/resources/messages.mjs.map +1 -1
  80. package/resources/payment-handles.d.mts +87 -0
  81. package/resources/payment-handles.d.mts.map +1 -0
  82. package/resources/payment-handles.d.ts +87 -0
  83. package/resources/payment-handles.d.ts.map +1 -0
  84. package/resources/payment-handles.js +76 -0
  85. package/resources/payment-handles.js.map +1 -0
  86. package/resources/payment-handles.mjs +72 -0
  87. package/resources/payment-handles.mjs.map +1 -0
  88. package/resources/payment-providers.d.mts +58 -0
  89. package/resources/payment-providers.d.mts.map +1 -0
  90. package/resources/payment-providers.d.ts +58 -0
  91. package/resources/payment-providers.d.ts.map +1 -0
  92. package/resources/payment-providers.js +45 -0
  93. package/resources/payment-providers.js.map +1 -0
  94. package/resources/payment-providers.mjs +41 -0
  95. package/resources/payment-providers.mjs.map +1 -0
  96. package/resources/payment-requests.d.mts +2 -2
  97. package/resources/payment-requests.d.ts +2 -2
  98. package/resources/payment-requests.js +2 -2
  99. package/resources/payment-requests.mjs +2 -2
  100. package/resources/payments.d.mts +116 -0
  101. package/resources/payments.d.mts.map +1 -0
  102. package/resources/payments.d.ts +116 -0
  103. package/resources/payments.d.ts.map +1 -0
  104. package/resources/payments.js +70 -0
  105. package/resources/payments.js.map +1 -0
  106. package/resources/payments.mjs +66 -0
  107. package/resources/payments.mjs.map +1 -0
  108. package/resources/phone-numbers.d.mts +11 -11
  109. package/resources/phone-numbers.d.mts.map +1 -1
  110. package/resources/phone-numbers.d.ts +11 -11
  111. package/resources/phone-numbers.d.ts.map +1 -1
  112. package/resources/phone-numbers.js +13 -13
  113. package/resources/phone-numbers.js.map +1 -1
  114. package/resources/phone-numbers.mjs +13 -13
  115. package/resources/phone-numbers.mjs.map +1 -1
  116. package/resources/webhook-subscriptions.d.mts +11 -11
  117. package/resources/webhook-subscriptions.d.mts.map +1 -1
  118. package/resources/webhook-subscriptions.d.ts +11 -11
  119. package/resources/webhook-subscriptions.d.ts.map +1 -1
  120. package/resources/webhook-subscriptions.js +13 -13
  121. package/resources/webhook-subscriptions.js.map +1 -1
  122. package/resources/webhook-subscriptions.mjs +13 -13
  123. package/resources/webhook-subscriptions.mjs.map +1 -1
  124. package/resources/webhooks.d.mts +59 -0
  125. package/resources/webhooks.d.mts.map +1 -1
  126. package/resources/webhooks.d.ts +59 -0
  127. package/resources/webhooks.d.ts.map +1 -1
  128. package/src/client.ts +77 -6
  129. package/src/resources/available-number.ts +14 -1
  130. package/src/resources/chats/chats.ts +142 -79
  131. package/src/resources/chats/index.ts +2 -2
  132. package/src/resources/chats/location.ts +28 -28
  133. package/src/resources/chats/messages.ts +28 -28
  134. package/src/resources/contact-card.ts +36 -35
  135. package/src/resources/experiences.ts +118 -0
  136. package/src/resources/index.ts +22 -4
  137. package/src/resources/messages.ts +85 -47
  138. package/src/resources/payment-handles.ts +114 -0
  139. package/src/resources/payment-providers.ts +81 -0
  140. package/src/resources/payment-requests.ts +2 -2
  141. package/src/resources/payments.ts +163 -0
  142. package/src/resources/phone-numbers.ts +14 -14
  143. package/src/resources/webhook-subscriptions.ts +14 -14
  144. package/src/resources/webhooks.ts +61 -0
  145. package/src/version.ts +1 -1
  146. package/version.d.mts +1 -1
  147. package/version.d.ts +1 -1
  148. package/version.js +1 -1
  149. package/version.mjs +1 -1
@@ -115,42 +115,6 @@ class Chats extends resource_1.APIResource {
115
115
  create(body, options) {
116
116
  return this._client.post('/v3/chats', { body, ...options });
117
117
  }
118
- /**
119
- * Retrieves a paginated list of chats for the authenticated partner.
120
- *
121
- * **Filtering:**
122
- *
123
- * - If `from` is provided, returns chats for that specific phone number
124
- * - If `from` is omitted, returns chats across all phone numbers owned by the
125
- * partner
126
- * - If `to` is provided, only returns chats where the specified handle is a
127
- * participant
128
- *
129
- * **Pagination:**
130
- *
131
- * - Use `limit` to control page size (default: 20, max: 100)
132
- * - The response includes `next_cursor` for fetching the next page
133
- * - When `next_cursor` is `null`, there are no more results to fetch
134
- * - Pass the `next_cursor` value as the `cursor` parameter for the next request
135
- *
136
- * **Example pagination flow:**
137
- *
138
- * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
139
- * 2. Response includes `next_cursor: "20"` (more results exist)
140
- * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
141
- * 4. Response includes `next_cursor: null` (no more results)
142
- *
143
- * @example
144
- * ```ts
145
- * // Automatically fetches more pages as needed.
146
- * for await (const chat of client.chats.listChats()) {
147
- * // ...
148
- * }
149
- * ```
150
- */
151
- listChats(query = {}, options) {
152
- return this._client.getAPIList('/v3/chats', (pagination_1.ListChatsPagination), { query, ...options });
153
- }
154
118
  /**
155
119
  * Retrieve a chat by its unique identifier.
156
120
  *
@@ -182,22 +146,6 @@ class Chats extends resource_1.APIResource {
182
146
  update(chatID, body, options) {
183
147
  return this._client.put((0, path_1.path) `/v3/chats/${chatID}`, { body, ...options });
184
148
  }
185
- /**
186
- * Mark all messages in a chat as read.
187
- *
188
- * @example
189
- * ```ts
190
- * await client.chats.markAsRead(
191
- * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
192
- * );
193
- * ```
194
- */
195
- markAsRead(chatID, options) {
196
- return this._client.post((0, path_1.path) `/v3/chats/${chatID}/read`, {
197
- ...options,
198
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
199
- });
200
- }
201
149
  /**
202
150
  * Removes your phone number from a group chat. Once you leave, you will no longer
203
151
  * receive messages from the group and all interaction endpoints (send message,
@@ -224,21 +172,53 @@ class Chats extends resource_1.APIResource {
224
172
  return this._client.post((0, path_1.path) `/v3/chats/${chatID}/leave`, options);
225
173
  }
226
174
  /**
227
- * Share your contact information (Name and Photo Sharing) with a chat.
175
+ * Retrieves a paginated list of chats for the authenticated partner.
228
176
  *
229
- * **Note:** A contact card must be configured before sharing. You can set up your
230
- * contact card via the [Contact Card API](#tag/Contact-Card) or on the
231
- * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
177
+ * **Filtering:**
178
+ *
179
+ * - If `from` is provided, returns chats for that specific phone number
180
+ * - If `from` is omitted, returns chats across all phone numbers owned by the
181
+ * partner
182
+ * - If `to` is provided, only returns chats where the specified handle is a
183
+ * participant
184
+ *
185
+ * **Pagination:**
186
+ *
187
+ * - Use `limit` to control page size (default: 20, max: 100)
188
+ * - The response includes `next_cursor` for fetching the next page
189
+ * - When `next_cursor` is `null`, there are no more results to fetch
190
+ * - Pass the `next_cursor` value as the `cursor` parameter for the next request
191
+ *
192
+ * **Example pagination flow:**
193
+ *
194
+ * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
195
+ * 2. Response includes `next_cursor: "20"` (more results exist)
196
+ * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
197
+ * 4. Response includes `next_cursor: null` (no more results)
232
198
  *
233
199
  * @example
234
200
  * ```ts
235
- * await client.chats.shareContactCard(
201
+ * // Automatically fetches more pages as needed.
202
+ * for await (const chat of client.chats.listChats()) {
203
+ * // ...
204
+ * }
205
+ * ```
206
+ */
207
+ listChats(query = {}, options) {
208
+ return this._client.getAPIList('/v3/chats', (pagination_1.ListChatsPagination), { query, ...options });
209
+ }
210
+ /**
211
+ * Mark all messages in a chat as read.
212
+ *
213
+ * @example
214
+ * ```ts
215
+ * await client.chats.markAsRead(
236
216
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
237
217
  * );
238
218
  * ```
239
219
  */
240
- shareContactCard(chatID, options) {
241
- return this._client.post((0, path_1.path) `/v3/chats/${chatID}/share_contact_card`, {
220
+ markAsRead(chatID, options) {
221
+ return this._client.post((0, path_1.path) `/v3/chats/${chatID}/read`, {
242
222
  ...options,
243
223
  headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
244
224
  });
@@ -270,6 +250,26 @@ class Chats extends resource_1.APIResource {
270
250
  sendVoicememo(chatID, body, options) {
271
251
  return this._client.post((0, path_1.path) `/v3/chats/${chatID}/voicememo`, { body, ...options });
272
252
  }
253
+ /**
254
+ * Share your contact information (Name and Photo Sharing) with a chat.
255
+ *
256
+ * **Note:** A contact card must be configured before sharing. You can set up your
257
+ * contact card via the [Contact Card API](#tag/Contact-Card) or on the
258
+ * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
259
+ *
260
+ * @example
261
+ * ```ts
262
+ * await client.chats.shareContactCard(
263
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
264
+ * );
265
+ * ```
266
+ */
267
+ shareContactCard(chatID, options) {
268
+ return this._client.post((0, path_1.path) `/v3/chats/${chatID}/share_contact_card`, {
269
+ ...options,
270
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
271
+ });
272
+ }
273
273
  }
274
274
  exports.Chats = Chats;
275
275
  Chats.Participants = participants_1.Participants;
@@ -1 +1 @@
1
- {"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/resources/chats/chats.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,mEAA0C;AAC1C,4CAAwF;AACxF,wEAA+C;AAC/C,4CAA8G;AAC9G,2EAAkD;AAClD,oDAMwB;AACxB,+DAAsC;AACtC,wCAAkC;AAElC,yDAAyG;AACzG,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,aAAQ,GAA8B,IAAI,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClF,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAuQ1E,CAAC;IArQC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwFG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,SAAS,CACP,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAA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EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,aAAa,CACX,MAAc,EACd,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,MAAc,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,qBAAqB,EAAE;YACrE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA3QD,sBA2QC;AAowBD,KAAK,CAAC,YAAY,GAAG,2BAAY,CAAC;AAClC,KAAK,CAAC,MAAM,GAAG,eAAM,CAAC;AACtB,KAAK,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AAC1B,KAAK,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
@@ -111,42 +111,6 @@ export class Chats extends APIResource {
111
111
  create(body, options) {
112
112
  return this._client.post('/v3/chats', { body, ...options });
113
113
  }
114
- /**
115
- * Retrieves a paginated list of chats for the authenticated partner.
116
- *
117
- * **Filtering:**
118
- *
119
- * - If `from` is provided, returns chats for that specific phone number
120
- * - If `from` is omitted, returns chats across all phone numbers owned by the
121
- * partner
122
- * - If `to` is provided, only returns chats where the specified handle is a
123
- * participant
124
- *
125
- * **Pagination:**
126
- *
127
- * - Use `limit` to control page size (default: 20, max: 100)
128
- * - The response includes `next_cursor` for fetching the next page
129
- * - When `next_cursor` is `null`, there are no more results to fetch
130
- * - Pass the `next_cursor` value as the `cursor` parameter for the next request
131
- *
132
- * **Example pagination flow:**
133
- *
134
- * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
135
- * 2. Response includes `next_cursor: "20"` (more results exist)
136
- * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
137
- * 4. Response includes `next_cursor: null` (no more results)
138
- *
139
- * @example
140
- * ```ts
141
- * // Automatically fetches more pages as needed.
142
- * for await (const chat of client.chats.listChats()) {
143
- * // ...
144
- * }
145
- * ```
146
- */
147
- listChats(query = {}, options) {
148
- return this._client.getAPIList('/v3/chats', (ListChatsPagination), { query, ...options });
149
- }
150
114
  /**
151
115
  * Retrieve a chat by its unique identifier.
152
116
  *
@@ -178,22 +142,6 @@ export class Chats extends APIResource {
178
142
  update(chatID, body, options) {
179
143
  return this._client.put(path `/v3/chats/${chatID}`, { body, ...options });
180
144
  }
181
- /**
182
- * Mark all messages in a chat as read.
183
- *
184
- * @example
185
- * ```ts
186
- * await client.chats.markAsRead(
187
- * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
188
- * );
189
- * ```
190
- */
191
- markAsRead(chatID, options) {
192
- return this._client.post(path `/v3/chats/${chatID}/read`, {
193
- ...options,
194
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
195
- });
196
- }
197
145
  /**
198
146
  * Removes your phone number from a group chat. Once you leave, you will no longer
199
147
  * receive messages from the group and all interaction endpoints (send message,
@@ -220,21 +168,53 @@ export class Chats extends APIResource {
220
168
  return this._client.post(path `/v3/chats/${chatID}/leave`, options);
221
169
  }
222
170
  /**
223
- * Share your contact information (Name and Photo Sharing) with a chat.
171
+ * Retrieves a paginated list of chats for the authenticated partner.
224
172
  *
225
- * **Note:** A contact card must be configured before sharing. You can set up your
226
- * contact card via the [Contact Card API](#tag/Contact-Card) or on the
227
- * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
173
+ * **Filtering:**
174
+ *
175
+ * - If `from` is provided, returns chats for that specific phone number
176
+ * - If `from` is omitted, returns chats across all phone numbers owned by the
177
+ * partner
178
+ * - If `to` is provided, only returns chats where the specified handle is a
179
+ * participant
180
+ *
181
+ * **Pagination:**
182
+ *
183
+ * - Use `limit` to control page size (default: 20, max: 100)
184
+ * - The response includes `next_cursor` for fetching the next page
185
+ * - When `next_cursor` is `null`, there are no more results to fetch
186
+ * - Pass the `next_cursor` value as the `cursor` parameter for the next request
187
+ *
188
+ * **Example pagination flow:**
189
+ *
190
+ * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
191
+ * 2. Response includes `next_cursor: "20"` (more results exist)
192
+ * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
193
+ * 4. Response includes `next_cursor: null` (no more results)
228
194
  *
229
195
  * @example
230
196
  * ```ts
231
- * await client.chats.shareContactCard(
197
+ * // Automatically fetches more pages as needed.
198
+ * for await (const chat of client.chats.listChats()) {
199
+ * // ...
200
+ * }
201
+ * ```
202
+ */
203
+ listChats(query = {}, options) {
204
+ return this._client.getAPIList('/v3/chats', (ListChatsPagination), { query, ...options });
205
+ }
206
+ /**
207
+ * Mark all messages in a chat as read.
208
+ *
209
+ * @example
210
+ * ```ts
211
+ * await client.chats.markAsRead(
232
212
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
233
213
  * );
234
214
  * ```
235
215
  */
236
- shareContactCard(chatID, options) {
237
- return this._client.post(path `/v3/chats/${chatID}/share_contact_card`, {
216
+ markAsRead(chatID, options) {
217
+ return this._client.post(path `/v3/chats/${chatID}/read`, {
238
218
  ...options,
239
219
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
240
220
  });
@@ -266,6 +246,26 @@ export class Chats extends APIResource {
266
246
  sendVoicememo(chatID, body, options) {
267
247
  return this._client.post(path `/v3/chats/${chatID}/voicememo`, { body, ...options });
268
248
  }
249
+ /**
250
+ * Share your contact information (Name and Photo Sharing) with a chat.
251
+ *
252
+ * **Note:** A contact card must be configured before sharing. You can set up your
253
+ * contact card via the [Contact Card API](#tag/Contact-Card) or on the
254
+ * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
255
+ *
256
+ * @example
257
+ * ```ts
258
+ * await client.chats.shareContactCard(
259
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
260
+ * );
261
+ * ```
262
+ */
263
+ shareContactCard(chatID, options) {
264
+ return this._client.post(path `/v3/chats/${chatID}/share_contact_card`, {
265
+ ...options,
266
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
267
+ });
268
+ }
269
269
  }
270
270
  Chats.Participants = Participants;
271
271
  Chats.Typing = Typing;
@@ -1 +1 @@
1
- {"version":3,"file":"chats.mjs","sourceRoot":"","sources":["../../src/resources/chats/chats.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAA2B,QAAQ,EAA2B,uBAAmB;AACxF,OAAO,KAAK,gBAAgB,uBAAmB;AAC/C,OAAO,EAA6D,QAAQ,EAAe,uBAAmB;AAC9G,OAAO,KAAK,eAAe,2BAAuB;AAClD,OAAO,EAKL,YAAY,GACb,2BAAuB;AACxB,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAElC,OAAO,EAAE,mBAAmB,EAA+C,kCAA8B;AACzG,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,aAAQ,GAA8B,IAAI,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AA,aAAa,MAAM,qBAAqB,EAAE;YACrE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAowBD,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;AAClC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACtB,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC1B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -1,6 +1,6 @@
1
- export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatListChatsParams, type ChatUpdateParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats.mjs";
1
+ export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatUpdateParams, type ChatListChatsParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats.mjs";
2
2
  export { Location, type GetChatLocationResponse, type LocationRequestResponse } from "./location.mjs";
3
- export { Messages, type SentMessage, type MessageSendResponse, type MessageSendParams, type MessageListParams, } from "./messages.mjs";
3
+ export { Messages, type SentMessage, type MessageSendResponse, type MessageListParams, type MessageSendParams, } from "./messages.mjs";
4
4
  export { Participants, type ParticipantAddResponse, type ParticipantRemoveResponse, type ParticipantAddParams, type ParticipantRemoveParams, } from "./participants.mjs";
5
5
  export { Typing } from "./typing.mjs";
6
6
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,IAAI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ACL,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,2BAAuB;AACxB,OAAO,EAAE,MAAM,EAAE,qBAAiB"}
@@ -1,6 +1,6 @@
1
- export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatListChatsParams, type ChatUpdateParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats.js";
1
+ export { Chats, type Chat, type LinkPart, type MediaPart, type MessageContent, type TextPart, type ChatCreateResponse, type ChatUpdateResponse, type ChatLeaveChatResponse, type ChatSendVoicememoResponse, type ChatCreateParams, type ChatUpdateParams, type ChatListChatsParams, type ChatSendVoicememoParams, type ChatsListChatsPagination, } from "./chats.js";
2
2
  export { Location, type GetChatLocationResponse, type LocationRequestResponse } from "./location.js";
3
- export { Messages, type SentMessage, type MessageSendResponse, type MessageSendParams, type MessageListParams, } from "./messages.js";
3
+ export { Messages, type SentMessage, type MessageSendResponse, type MessageListParams, type MessageSendParams, } from "./messages.js";
4
4
  export { Participants, type ParticipantAddResponse, type ParticipantRemoveResponse, type ParticipantAddParams, type ParticipantRemoveParams, } from "./participants.js";
5
5
  export { Typing } from "./typing.js";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,mBAAgB;AACjB,OAAO,EAAE,QAAQ,EAAE,KAAK,uBAAuB,EAAE,KAAK,uBAAuB,EAAE,sBAAmB;AAClG,OAAO,EACL,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,sBAAmB;AACpB,OAAO,EACL,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,0BAAuB;AACxB,OAAO,EAAE,MAAM,EAAE,oBAAiB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/chats/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,mBAAgB;AACjB,OAAO,EAAE,QAAQ,EAAE,KAAK,uBAAuB,EAAE,KAAK,uBAAuB,EAAE,sBAAmB;AAClG,OAAO,EACL,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,sBAAmB;AACpB,OAAO,EACL,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,0BAAuB;AACxB,OAAO,EAAE,MAAM,EAAE,oBAAiB"}
@@ -40,31 +40,6 @@ import { RequestOptions } from "../../internal/request-options.mjs";
40
40
  * Messages conversation** with your number.
41
41
  */
42
42
  export declare class Location extends APIResource {
43
- /**
44
- * Request a contact in a chat to share their location. They receive an iMessage
45
- * prompt and must accept before any location is available; once they do, read
46
- * their location coordinates with `GET /v3/chats/{chatId}/location`.
47
- *
48
- * The request is delivered asynchronously. The endpoint returns immediately with
49
- * `{ "success": true, "message": "Location request sent" }` and does not return
50
- * coordinates.
51
- *
52
- * Location requests only work in **1:1 iMessage chats** (Apple limitation):
53
- *
54
- * - Group chats (any service) return `409` with code `2016`
55
- * (`GroupChatNotSupported`).
56
- * - 1:1 SMS and RCS chats return `409` with code `2017`
57
- * (`ChatServiceNotSupported`).
58
- *
59
- * @example
60
- * ```ts
61
- * const locationRequestResponse =
62
- * await client.chats.location.request(
63
- * '975d0776-bd17-4273-8337-f346b4c661b0',
64
- * );
65
- * ```
66
- */
67
- request(chatID: string, options?: RequestOptions): APIPromise<LocationRequestResponse>;
68
43
  /**
69
44
  * Retrieve the current location for contacts sharing with you in a chat.
70
45
  *
@@ -94,6 +69,31 @@ export declare class Location extends APIResource {
94
69
  * ```
95
70
  */
96
71
  retrieve(chatID: string, options?: RequestOptions): APIPromise<GetChatLocationResponse>;
72
+ /**
73
+ * Request a contact in a chat to share their location. They receive an iMessage
74
+ * prompt and must accept before any location is available; once they do, read
75
+ * their location coordinates with `GET /v3/chats/{chatId}/location`.
76
+ *
77
+ * The request is delivered asynchronously. The endpoint returns immediately with
78
+ * `{ "success": true, "message": "Location request sent" }` and does not return
79
+ * coordinates.
80
+ *
81
+ * Location requests only work in **1:1 iMessage chats** (Apple limitation):
82
+ *
83
+ * - Group chats (any service) return `409` with code `2016`
84
+ * (`GroupChatNotSupported`).
85
+ * - 1:1 SMS and RCS chats return `409` with code `2017`
86
+ * (`ChatServiceNotSupported`).
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const locationRequestResponse =
91
+ * await client.chats.location.request(
92
+ * '975d0776-bd17-4273-8337-f346b4c661b0',
93
+ * );
94
+ * ```
95
+ */
96
+ request(chatID: string, options?: RequestOptions): APIPromise<LocationRequestResponse>;
97
97
  }
98
98
  export interface GetChatLocationResponse {
99
99
  data: GetChatLocationResponse.Data;
@@ -1 +1 @@
1
- {"version":3,"file":"location.d.mts","sourceRoot":"","sources":["../../src/resources/chats/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAItF;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAMxF;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC;IAEnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,IAAI;QACnB,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE9B,IAAI,EAAE,mBAAmB,CAAC;KAC3B;IAED,UAAiB,IAAI,CAAC;QACpB,UAAiB,OAAO;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;YAE3B,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC;YAE/B,IAAI,EAAE,SAAS,CAAC;SACjB;QAED,UAAiB,OAAO,CAAC;YACvB,UAAiB,QAAQ;gBACvB;;mBAEG;gBACH,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBAE3B,IAAI,EAAE,OAAO,CAAC;aACf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AAI,CAAC,OAAO,CAAC,CAAC;QAE9B,IAAI,EAAE,mBAAmB,CAAC;KAC3B;IAED,UAAiB,IAAI,CAAC;QACpB,UAAiB,OAAO;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;YAE3B,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC;YAE/B,IAAI,EAAE,SAAS,CAAC;SACjB;QAED,UAAiB,OAAO,CAAC;YACvB,UAAiB,QAAQ;gBACvB;;mBAEG;gBACH,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBAE3B,IAAI,EAAE,OAAO,CAAC;aACf;YAED,UAAiB,UAAU;gBACzB;;mBAEG;gBACH,MAAM,EAAE,MAAM,CAAC;gBAEf;;mBAEG;gBACH,OAAO,CAAC,EAAE,MAAM,CAAC;gBAEjB;;mBAEG;gBACH,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAElB;;mBAEG;gBACH,UAAU,CAAC,EAAE,MAAM,CAAC;aACrB;SACF;KACF;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -40,31 +40,6 @@ import { RequestOptions } from "../../internal/request-options.js";
40
40
  * Messages conversation** with your number.
41
41
  */
42
42
  export declare class Location extends APIResource {
43
- /**
44
- * Request a contact in a chat to share their location. They receive an iMessage
45
- * prompt and must accept before any location is available; once they do, read
46
- * their location coordinates with `GET /v3/chats/{chatId}/location`.
47
- *
48
- * The request is delivered asynchronously. The endpoint returns immediately with
49
- * `{ "success": true, "message": "Location request sent" }` and does not return
50
- * coordinates.
51
- *
52
- * Location requests only work in **1:1 iMessage chats** (Apple limitation):
53
- *
54
- * - Group chats (any service) return `409` with code `2016`
55
- * (`GroupChatNotSupported`).
56
- * - 1:1 SMS and RCS chats return `409` with code `2017`
57
- * (`ChatServiceNotSupported`).
58
- *
59
- * @example
60
- * ```ts
61
- * const locationRequestResponse =
62
- * await client.chats.location.request(
63
- * '975d0776-bd17-4273-8337-f346b4c661b0',
64
- * );
65
- * ```
66
- */
67
- request(chatID: string, options?: RequestOptions): APIPromise<LocationRequestResponse>;
68
43
  /**
69
44
  * Retrieve the current location for contacts sharing with you in a chat.
70
45
  *
@@ -94,6 +69,31 @@ export declare class Location extends APIResource {
94
69
  * ```
95
70
  */
96
71
  retrieve(chatID: string, options?: RequestOptions): APIPromise<GetChatLocationResponse>;
72
+ /**
73
+ * Request a contact in a chat to share their location. They receive an iMessage
74
+ * prompt and must accept before any location is available; once they do, read
75
+ * their location coordinates with `GET /v3/chats/{chatId}/location`.
76
+ *
77
+ * The request is delivered asynchronously. The endpoint returns immediately with
78
+ * `{ "success": true, "message": "Location request sent" }` and does not return
79
+ * coordinates.
80
+ *
81
+ * Location requests only work in **1:1 iMessage chats** (Apple limitation):
82
+ *
83
+ * - Group chats (any service) return `409` with code `2016`
84
+ * (`GroupChatNotSupported`).
85
+ * - 1:1 SMS and RCS chats return `409` with code `2017`
86
+ * (`ChatServiceNotSupported`).
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const locationRequestResponse =
91
+ * await client.chats.location.request(
92
+ * '975d0776-bd17-4273-8337-f346b4c661b0',
93
+ * );
94
+ * ```
95
+ */
96
+ request(chatID: string, options?: RequestOptions): APIPromise<LocationRequestResponse>;
97
97
  }
98
98
  export interface GetChatLocationResponse {
99
99
  data: GetChatLocationResponse.Data;
@@ -1 +1 @@
1
- {"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/resources/chats/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;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G;gBACH,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBAE3B,IAAI,EAAE,OAAO,CAAC;aACf;YAED,UAAiB,UAAU;gBACzB;;mBAEG;gBACH,MAAM,EAAE,MAAM,CAAC;gBAEf;;mBAEG;gBACH,OAAO,CAAC,EAAE,MAAM,CAAC;gBAEjB;;mBAEG;gBACH,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAElB;;mBAEG;gBACH,UAAU,CAAC,EAAE,MAAM,CAAC;aACrB;SACF;KACF;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -44,33 +44,6 @@ const path_1 = require("../../internal/utils/path.js");
44
44
  * Messages conversation** with your number.
45
45
  */
46
46
  class Location extends resource_1.APIResource {
47
- /**
48
- * Request a contact in a chat to share their location. They receive an iMessage
49
- * prompt and must accept before any location is available; once they do, read
50
- * their location coordinates with `GET /v3/chats/{chatId}/location`.
51
- *
52
- * The request is delivered asynchronously. The endpoint returns immediately with
53
- * `{ "success": true, "message": "Location request sent" }` and does not return
54
- * coordinates.
55
- *
56
- * Location requests only work in **1:1 iMessage chats** (Apple limitation):
57
- *
58
- * - Group chats (any service) return `409` with code `2016`
59
- * (`GroupChatNotSupported`).
60
- * - 1:1 SMS and RCS chats return `409` with code `2017`
61
- * (`ChatServiceNotSupported`).
62
- *
63
- * @example
64
- * ```ts
65
- * const locationRequestResponse =
66
- * await client.chats.location.request(
67
- * '975d0776-bd17-4273-8337-f346b4c661b0',
68
- * );
69
- * ```
70
- */
71
- request(chatID, options) {
72
- return this._client.post((0, path_1.path) `/v3/chats/${chatID}/location/request`, options);
73
- }
74
47
  /**
75
48
  * Retrieve the current location for contacts sharing with you in a chat.
76
49
  *
@@ -105,6 +78,33 @@ class Location extends resource_1.APIResource {
105
78
  headers: (0, headers_1.buildHeaders)([{ Accept: 'application/geo+json' }, options?.headers]),
106
79
  });
107
80
  }
81
+ /**
82
+ * Request a contact in a chat to share their location. They receive an iMessage
83
+ * prompt and must accept before any location is available; once they do, read
84
+ * their location coordinates with `GET /v3/chats/{chatId}/location`.
85
+ *
86
+ * The request is delivered asynchronously. The endpoint returns immediately with
87
+ * `{ "success": true, "message": "Location request sent" }` and does not return
88
+ * coordinates.
89
+ *
90
+ * Location requests only work in **1:1 iMessage chats** (Apple limitation):
91
+ *
92
+ * - Group chats (any service) return `409` with code `2016`
93
+ * (`GroupChatNotSupported`).
94
+ * - 1:1 SMS and RCS chats return `409` with code `2017`
95
+ * (`ChatServiceNotSupported`).
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * const locationRequestResponse =
100
+ * await client.chats.location.request(
101
+ * '975d0776-bd17-4273-8337-f346b4c661b0',
102
+ * );
103
+ * ```
104
+ */
105
+ request(chatID, options) {
106
+ return this._client.post((0, path_1.path) `/v3/chats/${chatID}/location/request`, options);
107
+ }
108
108
  }
109
109
  exports.Location = Location;
110
110
  //# sourceMappingURL=location.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/resources/chats/location.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;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