@voxie/contacts.js 1.5.0 → 1.6.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 +32 -37
- package/dist/browser.d.ts +16 -0
- package/dist/config.d.ts +20 -0
- package/dist/contacts.js +39 -3462
- package/dist/index.d.ts +42 -0
- package/dist/index.js +3559 -0
- package/dist/pop-up.d.ts +23 -0
- package/package.json +15 -14
- package/dist/index.css +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PopUp } from './pop-up';
|
|
2
|
+
export type SubscriptionType = 'transactional' | 'marketing';
|
|
3
|
+
export type SubscriptionStatus = 'opt_in' | 'opt_out';
|
|
4
|
+
export type ContactData = {
|
|
5
|
+
firstName?: string;
|
|
6
|
+
lastName?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
timeZone?: string;
|
|
9
|
+
tags?: Set<string>;
|
|
10
|
+
customAttributes?: Map<string, string>;
|
|
11
|
+
subscriptionStatuses?: Map<SubscriptionType, SubscriptionStatus>;
|
|
12
|
+
groupId?: string;
|
|
13
|
+
};
|
|
14
|
+
export type ShareMapping = {
|
|
15
|
+
phone: string;
|
|
16
|
+
firstName?: string;
|
|
17
|
+
lastName?: string;
|
|
18
|
+
email?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ShareMetadata = {
|
|
21
|
+
tags?: Set<string>;
|
|
22
|
+
customAttributes?: Map<string, string>;
|
|
23
|
+
subscriptionStatuses?: Map<SubscriptionType, SubscriptionStatus>;
|
|
24
|
+
groupId?: string;
|
|
25
|
+
};
|
|
26
|
+
export type PopUpArguments = {
|
|
27
|
+
name: string;
|
|
28
|
+
terms: string;
|
|
29
|
+
};
|
|
30
|
+
export default class Voxie {
|
|
31
|
+
private authorization;
|
|
32
|
+
private connectBaseUri;
|
|
33
|
+
private constructor();
|
|
34
|
+
static init(params: {
|
|
35
|
+
publicKeyId: string;
|
|
36
|
+
publicSecret: string;
|
|
37
|
+
connectBaseUri?: string;
|
|
38
|
+
}): Voxie;
|
|
39
|
+
capture(phoneNumber: string, contactData?: ContactData): Promise<boolean>;
|
|
40
|
+
popUp(args: PopUpArguments): PopUp;
|
|
41
|
+
share(formEl: HTMLFormElement, mappings: ShareMapping, metadata?: ShareMetadata): void;
|
|
42
|
+
}
|