@wix/crm 1.0.0 → 1.0.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/build/cjs/index.d.ts +4 -1
- package/build/cjs/index.js +5 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/contacts-v4-contact.http.d.ts +192 -0
- package/build/cjs/src/contacts-v4-contact.http.js +522 -0
- package/build/cjs/src/contacts-v4-contact.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.public.d.ts +14 -0
- package/build/cjs/src/contacts-v4-contact.public.js +64 -0
- package/build/cjs/src/contacts-v4-contact.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.types.d.ts +1310 -0
- package/build/cjs/src/contacts-v4-contact.types.js +202 -0
- package/build/cjs/src/contacts-v4-contact.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-contact.universal.d.ts +1663 -0
- package/build/cjs/src/contacts-v4-contact.universal.js +903 -0
- package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.http.d.ts +31 -0
- package/build/cjs/src/contacts-v4-extended-field.http.js +215 -0
- package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.public.d.ts +12 -0
- package/build/cjs/src/contacts-v4-extended-field.public.js +40 -0
- package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.types.d.ts +257 -0
- package/build/cjs/src/contacts-v4-extended-field.types.js +23 -0
- package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +476 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.js +393 -0
- package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.http.d.ts +31 -0
- package/build/cjs/src/contacts-v4-label.http.js +191 -0
- package/build/cjs/src/contacts-v4-label.http.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.public.d.ts +11 -0
- package/build/cjs/src/contacts-v4-label.public.js +33 -0
- package/build/cjs/src/contacts-v4-label.public.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.types.d.ts +253 -0
- package/build/cjs/src/contacts-v4-label.types.js +17 -0
- package/build/cjs/src/contacts-v4-label.types.js.map +1 -0
- package/build/cjs/src/contacts-v4-label.universal.d.ts +442 -0
- package/build/cjs/src/contacts-v4-label.universal.js +326 -0
- package/build/cjs/src/contacts-v4-label.universal.js.map +1 -0
- package/build/es/index.d.ts +4 -1
- package/build/es/index.js +4 -1
- package/build/es/index.js.map +1 -1
- package/build/es/src/contacts-v4-contact.http.d.ts +192 -0
- package/build/es/src/contacts-v4-contact.http.js +512 -0
- package/build/es/src/contacts-v4-contact.http.js.map +1 -0
- package/build/es/src/contacts-v4-contact.public.d.ts +14 -0
- package/build/es/src/contacts-v4-contact.public.js +39 -0
- package/build/es/src/contacts-v4-contact.public.js.map +1 -0
- package/build/es/src/contacts-v4-contact.types.d.ts +1310 -0
- package/build/es/src/contacts-v4-contact.types.js +199 -0
- package/build/es/src/contacts-v4-contact.types.js.map +1 -0
- package/build/es/src/contacts-v4-contact.universal.d.ts +1663 -0
- package/build/es/src/contacts-v4-contact.universal.js +874 -0
- package/build/es/src/contacts-v4-contact.universal.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.http.d.ts +31 -0
- package/build/es/src/contacts-v4-extended-field.http.js +207 -0
- package/build/es/src/contacts-v4-extended-field.http.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.public.d.ts +12 -0
- package/build/es/src/contacts-v4-extended-field.public.js +29 -0
- package/build/es/src/contacts-v4-extended-field.public.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.types.d.ts +257 -0
- package/build/es/src/contacts-v4-extended-field.types.js +20 -0
- package/build/es/src/contacts-v4-extended-field.types.js.map +1 -0
- package/build/es/src/contacts-v4-extended-field.universal.d.ts +476 -0
- package/build/es/src/contacts-v4-extended-field.universal.js +366 -0
- package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -0
- package/build/es/src/contacts-v4-label.http.d.ts +31 -0
- package/build/es/src/contacts-v4-label.http.js +184 -0
- package/build/es/src/contacts-v4-label.http.js.map +1 -0
- package/build/es/src/contacts-v4-label.public.d.ts +11 -0
- package/build/es/src/contacts-v4-label.public.js +24 -0
- package/build/es/src/contacts-v4-label.public.js.map +1 -0
- package/build/es/src/contacts-v4-label.types.d.ts +253 -0
- package/build/es/src/contacts-v4-label.types.js +14 -0
- package/build/es/src/contacts-v4-label.types.js.map +1 -0
- package/build/es/src/contacts-v4-label.universal.d.ts +442 -0
- package/build/es/src/contacts-v4-label.universal.js +300 -0
- package/build/es/src/contacts-v4-label.universal.js.map +1 -0
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export * as contacts from './src/contacts-v4-
|
|
1
|
+
export * as contacts from './src/contacts-v4-contact.public';
|
|
2
|
+
export * as extendedFields from './src/contacts-v4-extended-field.public';
|
|
3
|
+
export * as labels from './src/contacts-v4-label.public';
|
|
4
|
+
export * as submittedContact from './src/contacts-v4-submit-contact.public';
|
package/build/cjs/index.js
CHANGED
|
@@ -19,6 +19,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.contacts = void 0;
|
|
23
|
-
exports.contacts = __importStar(require("./src/contacts-v4-
|
|
22
|
+
exports.submittedContact = exports.labels = exports.extendedFields = exports.contacts = void 0;
|
|
23
|
+
exports.contacts = __importStar(require("./src/contacts-v4-contact.public"));
|
|
24
|
+
exports.extendedFields = __importStar(require("./src/contacts-v4-extended-field.public"));
|
|
25
|
+
exports.labels = __importStar(require("./src/contacts-v4-label.public"));
|
|
26
|
+
exports.submittedContact = __importStar(require("./src/contacts-v4-submit-contact.public"));
|
|
24
27
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6EAA6D;AAC7D,0FAA0E;AAC1E,yEAAyD;AACzD,4FAA4E"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { CreateContactRequest, CreateContactResponse, DeleteContactRequest, DeleteContactResponse, GetContactRequest, GetContactResponse, LabelContactRequest, LabelContactResponse, MergeContactsRequest, MergeContactsResponse, UnlabelContactRequest, UnlabelContactResponse, UpdateContactRequest, UpdateContactResponse } from './contacts-v4-contact.types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new contact.
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* The `createContact()` function returns a Promise
|
|
8
|
+
* that resolves to the new contact when it is created.
|
|
9
|
+
* > **Note:**
|
|
10
|
+
* > This function replaces the deprecated
|
|
11
|
+
* > `wixCrmBackend.createContact()`.
|
|
12
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
13
|
+
* > To keep any existing code compatible with future changes, see the
|
|
14
|
+
* > [migration instructions](wix-crm-backend/createcontact#migration-instructions).
|
|
15
|
+
*
|
|
16
|
+
* The `contactInfo` parameter object must include a name, phone number, or email address.
|
|
17
|
+
* If all 3 of these parameters are missing,
|
|
18
|
+
* the contact won't be created.
|
|
19
|
+
*
|
|
20
|
+
* <!--
|
|
21
|
+
* > **Note:**
|
|
22
|
+
* > Only visitors with
|
|
23
|
+
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
24
|
+
* > can create contacts.
|
|
25
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
26
|
+
* -->
|
|
27
|
+
* By default,
|
|
28
|
+
* if the call contains an email already in use by another contact,
|
|
29
|
+
* the new contact won't be created.
|
|
30
|
+
* To override this behavior,
|
|
31
|
+
* set `allowDuplicates` in the `options` object to `true`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createContact(payload: CreateContactRequest): RequestOptionsFactory<CreateContactResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Updates a contact's properties.
|
|
36
|
+
*
|
|
37
|
+
* The `updateContact()` function returns a Promise that resolves
|
|
38
|
+
* when the specified contact's information is updated.
|
|
39
|
+
*
|
|
40
|
+
* > **Note:**
|
|
41
|
+
* > This function replaces the deprecated
|
|
42
|
+
* > `wixCrmBackend.updateContact()`.
|
|
43
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
44
|
+
* > To keep any existing code compatible with future changes, see the
|
|
45
|
+
* > [migration instructions](wix-crm-backend/updatecontact#migration-instructions).
|
|
46
|
+
*
|
|
47
|
+
* Each time the contact is updated,
|
|
48
|
+
* `revision` increments by 1.
|
|
49
|
+
* The existing `revision` must be included when updating the contact.
|
|
50
|
+
* This ensures you're working with the latest contact information,
|
|
51
|
+
* and it prevents unintended overwrites.
|
|
52
|
+
*
|
|
53
|
+
* <!--
|
|
54
|
+
* > **Note:**
|
|
55
|
+
* > Only visitors with
|
|
56
|
+
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
57
|
+
* > can update contacts.
|
|
58
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
59
|
+
* -->
|
|
60
|
+
*/
|
|
61
|
+
export declare function updateContact(payload: UpdateContactRequest): RequestOptionsFactory<UpdateContactResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Merges source contacts into a target contact.
|
|
64
|
+
*
|
|
65
|
+
* Merging contacts has these effects on the target contact:
|
|
66
|
+
*
|
|
67
|
+
* - No target contact data is overwritten or deleted.
|
|
68
|
+
* - Arrays (emails, phones, addresses, and labels) are merged from the source contacts.
|
|
69
|
+
* - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
|
|
70
|
+
*
|
|
71
|
+
* <blockquote class="important">
|
|
72
|
+
*
|
|
73
|
+
* __Important:__
|
|
74
|
+
* Merges cannot be undone.
|
|
75
|
+
* Use [Preview Merge Contacts](#preview-merge-contacts)
|
|
76
|
+
* to test before merging.
|
|
77
|
+
*
|
|
78
|
+
* </blockquote>
|
|
79
|
+
*
|
|
80
|
+
* Source contacts are deleted when merging.
|
|
81
|
+
* However, if a source contact is a site member or contributor,
|
|
82
|
+
* the merge fails because site contributors and members can't be deleted.
|
|
83
|
+
* Site members and contributors can be target contacts only.
|
|
84
|
+
*
|
|
85
|
+
* After merging,
|
|
86
|
+
* if you call [Get Contact](#get-contact) with a deleted source contact ID,
|
|
87
|
+
* the target contact ID is returned.
|
|
88
|
+
* This is supported when calling Get Contact only.
|
|
89
|
+
* Deleted source contact IDs are not supported on any other endpoint.
|
|
90
|
+
*
|
|
91
|
+
* Merging contacts triggers these webhooks:
|
|
92
|
+
*
|
|
93
|
+
* - [Contact Merged](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-merged-webhook) is triggered.
|
|
94
|
+
* - [Contact Updated](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-updated-webhook) is triggered for the target contact. `originatedFrom` is set to `merge`.
|
|
95
|
+
* - [Contact Deleted](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-deleted-webhook) is triggered for each source contact. `originatedFrom` is set to `merge`.
|
|
96
|
+
*/
|
|
97
|
+
export declare function mergeContacts(payload: MergeContactsRequest): RequestOptionsFactory<MergeContactsResponse>;
|
|
98
|
+
/**
|
|
99
|
+
* Deletes a contact who is not a site member or contributor.
|
|
100
|
+
*
|
|
101
|
+
* The `deleteContact()` function returns a Promise
|
|
102
|
+
* that resolves when the specified contact is deleted.
|
|
103
|
+
* > **Note:**
|
|
104
|
+
* > This function replaces the deprecated
|
|
105
|
+
* > `wixCrmBackend.deleteContact()`.
|
|
106
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
107
|
+
* > To keep any existing code compatible with future changes, see the
|
|
108
|
+
* > [migration instructions](wix-crm-backend/deletecontact#migration-instructions).
|
|
109
|
+
*
|
|
110
|
+
* Deleting a contact permanently removes them from your Contact List.
|
|
111
|
+
*
|
|
112
|
+
* If the contact is also a site member,
|
|
113
|
+
* the member must be deleted first,
|
|
114
|
+
* and then the contact can be deleted.
|
|
115
|
+
*
|
|
116
|
+
* <!--
|
|
117
|
+
* > **Note:**
|
|
118
|
+
* > Only visitors with
|
|
119
|
+
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
120
|
+
* > can delete contacts.
|
|
121
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
122
|
+
* -->
|
|
123
|
+
*/
|
|
124
|
+
export declare function deleteContact(payload: DeleteContactRequest): RequestOptionsFactory<DeleteContactResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* Adds labels to a contact.
|
|
127
|
+
*
|
|
128
|
+
*
|
|
129
|
+
* The `labelContact()` function returns a Promise
|
|
130
|
+
* that resolves when the specified labels are added to the contact.
|
|
131
|
+
* - **To create new labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel).
|
|
132
|
+
* - **To find labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel), [`getLabel()`](wix-crm-backend/contacts/getlabel), or [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
|
|
133
|
+
*
|
|
134
|
+
* <!--
|
|
135
|
+
* > **Note:**
|
|
136
|
+
* > Only visitors with
|
|
137
|
+
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
138
|
+
* > can label contacts.
|
|
139
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
140
|
+
* -->
|
|
141
|
+
*/
|
|
142
|
+
export declare function labelContact(payload: LabelContactRequest): RequestOptionsFactory<LabelContactResponse>;
|
|
143
|
+
/**
|
|
144
|
+
* Removes labels from a contact.
|
|
145
|
+
*
|
|
146
|
+
* The `unlabelContact()` function returns a Promise
|
|
147
|
+
* that resolves when the specified labels are removed from the contact.
|
|
148
|
+
*
|
|
149
|
+
* If a label is no longer needed
|
|
150
|
+
* and you want to remove it from all contacts,
|
|
151
|
+
* you can delete it with
|
|
152
|
+
* [`deleteLabel()`](wix-crm-backend/contacts/deletelabel).
|
|
153
|
+
*
|
|
154
|
+
* <!--
|
|
155
|
+
* > **Note:**
|
|
156
|
+
* > Only visitors with
|
|
157
|
+
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
158
|
+
* > can unlabel contacts.
|
|
159
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
160
|
+
* -->
|
|
161
|
+
*/
|
|
162
|
+
export declare function unlabelContact(payload: UnlabelContactRequest): RequestOptionsFactory<UnlabelContactResponse>;
|
|
163
|
+
/**
|
|
164
|
+
* Retrieves a contact.
|
|
165
|
+
*
|
|
166
|
+
*
|
|
167
|
+
* The `getContact()` function returns a Promise
|
|
168
|
+
* that resolves when the contact is found.
|
|
169
|
+
* #### Getting Merged Contacts
|
|
170
|
+
* When a source contact is merged
|
|
171
|
+
* with a target contact, the source contact is deleted.
|
|
172
|
+
* When calling `getContact()` for a merged contact,
|
|
173
|
+
* you can use the source or target contact ID.
|
|
174
|
+
* In both cases, the target contact is returned.
|
|
175
|
+
*
|
|
176
|
+
* This is supported only when calling `getContact()`,
|
|
177
|
+
* and only for merged contacts.
|
|
178
|
+
* Deleted source contact IDs are not supported on any other function.
|
|
179
|
+
* > **Notes:**
|
|
180
|
+
* >
|
|
181
|
+
* > - This function replaces the deprecated
|
|
182
|
+
* > `wixCrmBackend.getContactById()`.
|
|
183
|
+
* > The deprecated function will continue to work, but it will not receive updates.
|
|
184
|
+
* > To keep any existing code compatible with future changes, see the
|
|
185
|
+
* > [migration instructions](wix-crm-backend/getcontactbyid#migration-instructions).
|
|
186
|
+
* <!-- > - Only visitors with
|
|
187
|
+
* > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
|
|
188
|
+
* > can retrieve contacts.
|
|
189
|
+
* > You can override the permissions by setting the `suppressAuth` option to `true`.
|
|
190
|
+
* -->
|
|
191
|
+
*/
|
|
192
|
+
export declare function getContact(payload: GetContactRequest): RequestOptionsFactory<GetContactResponse>;
|