@ixblix/sdk-js 0.4.2 → 0.5.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.
- package/README.md +4 -1
- package/dist/types.d.ts +20 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,10 +154,13 @@ Register a company (keyless), then activate it after payment to obtain the API
|
|
|
154
154
|
key:
|
|
155
155
|
|
|
156
156
|
```ts
|
|
157
|
+
const plans = await ixblix.listPlans();
|
|
158
|
+
const plan = plans.find((p) => p.isActive && p.isPublic);
|
|
159
|
+
|
|
157
160
|
const { company, payment } = await ixblix.registerCompany({
|
|
158
161
|
name: "Acme CRM",
|
|
159
162
|
handle: "acme-crm",
|
|
160
|
-
|
|
163
|
+
planId: plan?.id,
|
|
161
164
|
});
|
|
162
165
|
|
|
163
166
|
// After the payment is confirmed:
|
package/dist/types.d.ts
CHANGED
|
@@ -19,17 +19,8 @@ export interface Contact {
|
|
|
19
19
|
externalId: string;
|
|
20
20
|
name?: string;
|
|
21
21
|
metadata?: Record<string, unknown>;
|
|
22
|
-
/**
|
|
23
|
-
* LGPD consent status. Consent is memorized per company: once `GRANTED`, it
|
|
24
|
-
* is reused by every conversation with the same company and the customer is
|
|
25
|
-
* not asked again.
|
|
26
|
-
*/
|
|
27
22
|
consentStatus: ConsentStatus;
|
|
28
|
-
|
|
29
|
-
* Timestamp of the first time the customer granted consent for this company.
|
|
30
|
-
* Absent/null when consent was never granted.
|
|
31
|
-
*/
|
|
32
|
-
consentedAt?: string | null;
|
|
23
|
+
consentedAt?: string;
|
|
33
24
|
}
|
|
34
25
|
/** Payload used to create a conversation for a contact. */
|
|
35
26
|
export interface ContactInput {
|
|
@@ -206,6 +197,8 @@ export interface Message {
|
|
|
206
197
|
clientMessageId?: string | null;
|
|
207
198
|
/** Identifier of the operator that sent this message (COMPANY-sent only). */
|
|
208
199
|
operatorUuid?: string;
|
|
200
|
+
/** Identity of the operator that sent this message (COMPANY-sent only). */
|
|
201
|
+
operator?: Operator;
|
|
209
202
|
/**
|
|
210
203
|
* Identifier of the message this one replies to, when it is a reply.
|
|
211
204
|
* Absent/null when the message is not a reply.
|
|
@@ -237,14 +230,19 @@ export interface MessageReaction {
|
|
|
237
230
|
operatorUuid?: string | null;
|
|
238
231
|
createdAt: string;
|
|
239
232
|
}
|
|
240
|
-
/** Result of adding, replacing or removing
|
|
233
|
+
/** Result of adding, replacing or removing an emoji reaction. */
|
|
241
234
|
export interface MessageReactionResult {
|
|
242
|
-
|
|
235
|
+
conversationId: string;
|
|
243
236
|
messageId: string;
|
|
237
|
+
/** The message's reactions after the change. */
|
|
238
|
+
reactions: MessageReaction[];
|
|
239
|
+
/** `added` when a reaction was set or replaced, `removed` when cleared. */
|
|
240
|
+
action: "added" | "removed";
|
|
241
|
+
/** The emoji that was set, or null when removed. */
|
|
244
242
|
emoji: string | null;
|
|
245
243
|
senderType: SenderType;
|
|
246
244
|
operatorUuid?: string | null;
|
|
247
|
-
|
|
245
|
+
reactedAt: string;
|
|
248
246
|
}
|
|
249
247
|
/** Metadata of a media file attached to a message. */
|
|
250
248
|
export interface Media {
|
|
@@ -282,8 +280,11 @@ export interface RegisterCompanyInput {
|
|
|
282
280
|
name: string;
|
|
283
281
|
handle: string;
|
|
284
282
|
planId?: string;
|
|
285
|
-
paymentProvider?: string;
|
|
286
283
|
confirmationWebhookUrl?: string;
|
|
284
|
+
/** Contact e-mail forwarded to the gateway as the checkout customer e-mail. */
|
|
285
|
+
email?: string;
|
|
286
|
+
/** Tax id (CPF/CNPJ) required by some gateways such as Asaas. */
|
|
287
|
+
taxId?: string;
|
|
287
288
|
}
|
|
288
289
|
/** Payment instructions returned when registering a company. */
|
|
289
290
|
export interface PaymentInstructions {
|
|
@@ -293,6 +294,11 @@ export interface PaymentInstructions {
|
|
|
293
294
|
currency: string;
|
|
294
295
|
confirmationUrl: string;
|
|
295
296
|
status: string;
|
|
297
|
+
/**
|
|
298
|
+
* Hosted checkout URL the customer must be redirected to. Absent for free
|
|
299
|
+
* plans and for providers that settle the charge inline.
|
|
300
|
+
*/
|
|
301
|
+
checkoutUrl?: string;
|
|
296
302
|
}
|
|
297
303
|
/** Result of registering a company. */
|
|
298
304
|
export interface RegisterCompanyResult {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixblix/sdk-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Official ixblix SDK for desk/CRM integrations. Create overflow conversations, exchange end-to-end encrypted messages and media, and manage company onboarding.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|