@wix/crm 1.0.0 → 1.0.2

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 (79) hide show
  1. package/build/cjs/index.d.ts +4 -1
  2. package/build/cjs/index.js +5 -2
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/contacts-v4-contact.http.d.ts +192 -0
  5. package/build/cjs/src/contacts-v4-contact.http.js +522 -0
  6. package/build/cjs/src/contacts-v4-contact.http.js.map +1 -0
  7. package/build/cjs/src/contacts-v4-contact.public.d.ts +14 -0
  8. package/build/cjs/src/contacts-v4-contact.public.js +64 -0
  9. package/build/cjs/src/contacts-v4-contact.public.js.map +1 -0
  10. package/build/cjs/src/contacts-v4-contact.types.d.ts +1310 -0
  11. package/build/cjs/src/contacts-v4-contact.types.js +202 -0
  12. package/build/cjs/src/contacts-v4-contact.types.js.map +1 -0
  13. package/build/cjs/src/contacts-v4-contact.universal.d.ts +1663 -0
  14. package/build/cjs/src/contacts-v4-contact.universal.js +903 -0
  15. package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -0
  16. package/build/cjs/src/contacts-v4-extended-field.http.d.ts +31 -0
  17. package/build/cjs/src/contacts-v4-extended-field.http.js +215 -0
  18. package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -0
  19. package/build/cjs/src/contacts-v4-extended-field.public.d.ts +12 -0
  20. package/build/cjs/src/contacts-v4-extended-field.public.js +40 -0
  21. package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -0
  22. package/build/cjs/src/contacts-v4-extended-field.types.d.ts +257 -0
  23. package/build/cjs/src/contacts-v4-extended-field.types.js +23 -0
  24. package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -0
  25. package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +476 -0
  26. package/build/cjs/src/contacts-v4-extended-field.universal.js +393 -0
  27. package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -0
  28. package/build/cjs/src/contacts-v4-label.http.d.ts +31 -0
  29. package/build/cjs/src/contacts-v4-label.http.js +191 -0
  30. package/build/cjs/src/contacts-v4-label.http.js.map +1 -0
  31. package/build/cjs/src/contacts-v4-label.public.d.ts +11 -0
  32. package/build/cjs/src/contacts-v4-label.public.js +33 -0
  33. package/build/cjs/src/contacts-v4-label.public.js.map +1 -0
  34. package/build/cjs/src/contacts-v4-label.types.d.ts +253 -0
  35. package/build/cjs/src/contacts-v4-label.types.js +17 -0
  36. package/build/cjs/src/contacts-v4-label.types.js.map +1 -0
  37. package/build/cjs/src/contacts-v4-label.universal.d.ts +442 -0
  38. package/build/cjs/src/contacts-v4-label.universal.js +326 -0
  39. package/build/cjs/src/contacts-v4-label.universal.js.map +1 -0
  40. package/build/es/index.d.ts +4 -1
  41. package/build/es/index.js +4 -1
  42. package/build/es/index.js.map +1 -1
  43. package/build/es/src/contacts-v4-contact.http.d.ts +192 -0
  44. package/build/es/src/contacts-v4-contact.http.js +512 -0
  45. package/build/es/src/contacts-v4-contact.http.js.map +1 -0
  46. package/build/es/src/contacts-v4-contact.public.d.ts +14 -0
  47. package/build/es/src/contacts-v4-contact.public.js +39 -0
  48. package/build/es/src/contacts-v4-contact.public.js.map +1 -0
  49. package/build/es/src/contacts-v4-contact.types.d.ts +1310 -0
  50. package/build/es/src/contacts-v4-contact.types.js +199 -0
  51. package/build/es/src/contacts-v4-contact.types.js.map +1 -0
  52. package/build/es/src/contacts-v4-contact.universal.d.ts +1663 -0
  53. package/build/es/src/contacts-v4-contact.universal.js +874 -0
  54. package/build/es/src/contacts-v4-contact.universal.js.map +1 -0
  55. package/build/es/src/contacts-v4-extended-field.http.d.ts +31 -0
  56. package/build/es/src/contacts-v4-extended-field.http.js +207 -0
  57. package/build/es/src/contacts-v4-extended-field.http.js.map +1 -0
  58. package/build/es/src/contacts-v4-extended-field.public.d.ts +12 -0
  59. package/build/es/src/contacts-v4-extended-field.public.js +29 -0
  60. package/build/es/src/contacts-v4-extended-field.public.js.map +1 -0
  61. package/build/es/src/contacts-v4-extended-field.types.d.ts +257 -0
  62. package/build/es/src/contacts-v4-extended-field.types.js +20 -0
  63. package/build/es/src/contacts-v4-extended-field.types.js.map +1 -0
  64. package/build/es/src/contacts-v4-extended-field.universal.d.ts +476 -0
  65. package/build/es/src/contacts-v4-extended-field.universal.js +366 -0
  66. package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -0
  67. package/build/es/src/contacts-v4-label.http.d.ts +31 -0
  68. package/build/es/src/contacts-v4-label.http.js +184 -0
  69. package/build/es/src/contacts-v4-label.http.js.map +1 -0
  70. package/build/es/src/contacts-v4-label.public.d.ts +11 -0
  71. package/build/es/src/contacts-v4-label.public.js +24 -0
  72. package/build/es/src/contacts-v4-label.public.js.map +1 -0
  73. package/build/es/src/contacts-v4-label.types.d.ts +253 -0
  74. package/build/es/src/contacts-v4-label.types.js +14 -0
  75. package/build/es/src/contacts-v4-label.types.js.map +1 -0
  76. package/build/es/src/contacts-v4-label.universal.d.ts +442 -0
  77. package/build/es/src/contacts-v4-label.universal.js +300 -0
  78. package/build/es/src/contacts-v4-label.universal.js.map +1 -0
  79. package/package.json +2 -2
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SortOrder = exports.LabelType = exports.queryLabels = exports.deleteLabel = exports.renameLabel = exports.findOrCreateLabel = exports.__metadata = void 0;
4
+ const contacts_v4_label_universal_1 = require("./contacts-v4-label.universal");
5
+ exports.__metadata = { PACKAGE_NAME: '@wix/crm' };
6
+ function findOrCreateLabel(httpClient) {
7
+ return (displayName, options) => (0, contacts_v4_label_universal_1.findOrCreateLabel)(displayName, options,
8
+ // @ts-ignore
9
+ { httpClient });
10
+ }
11
+ exports.findOrCreateLabel = findOrCreateLabel;
12
+ function renameLabel(httpClient) {
13
+ return (key, options) => (0, contacts_v4_label_universal_1.renameLabel)(key, options,
14
+ // @ts-ignore
15
+ { httpClient });
16
+ }
17
+ exports.renameLabel = renameLabel;
18
+ function deleteLabel(httpClient) {
19
+ return (key) => (0, contacts_v4_label_universal_1.deleteLabel)(key,
20
+ // @ts-ignore
21
+ { httpClient });
22
+ }
23
+ exports.deleteLabel = deleteLabel;
24
+ function queryLabels(httpClient) {
25
+ return (options) => (0, contacts_v4_label_universal_1.queryLabels)(options,
26
+ // @ts-ignore
27
+ { httpClient });
28
+ }
29
+ exports.queryLabels = queryLabels;
30
+ var contacts_v4_label_universal_2 = require("./contacts-v4-label.universal");
31
+ Object.defineProperty(exports, "LabelType", { enumerable: true, get: function () { return contacts_v4_label_universal_2.LabelType; } });
32
+ Object.defineProperty(exports, "SortOrder", { enumerable: true, get: function () { return contacts_v4_label_universal_2.SortOrder; } });
33
+ //# sourceMappingURL=contacts-v4-label.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contacts-v4-label.public.js","sourceRoot":"","sources":["../../../src/contacts-v4-label.public.ts"],"names":[],"mappings":";;;AACA,+EAQuC;AAE1B,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AAEvD,SAAgB,iBAAiB,CAAC,UAAsB;IACtD,OAAO,CAAC,WAAmB,EAAE,OAAkC,EAAE,EAAE,CACjE,IAAA,+CAA0B,EACxB,WAAW,EACX,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,8CAQC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,GAAW,EAAE,OAA4B,EAAE,EAAE,CACnD,IAAA,yCAAoB,EAClB,GAAG,EACH,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,kCAQC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,GAAW,EAAE,EAAE,CACrB,IAAA,yCAAoB,EAClB,GAAG;IACH,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,kCAOC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,OAA4B,EAAE,EAAE,CACtC,IAAA,yCAAoB,EAClB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,kCAOC;AAED,6EAAqE;AAA5D,wHAAA,SAAS,OAAA;AAAE,wHAAA,SAAS,OAAA"}
@@ -0,0 +1,253 @@
1
+ /** Label that was found or created. */
2
+ export interface ContactLabel {
3
+ /**
4
+ * Label namespace.
5
+ *
6
+ * Labels created by site contributors or 3rd-party apps
7
+ * are automatically assigned to the `custom` namespace.
8
+ * @readonly
9
+ */
10
+ namespace?: string | null;
11
+ /**
12
+ * Display name for the namespace,
13
+ * used to organize the list of labels in the site Dashboard.
14
+ * @readonly
15
+ */
16
+ namespaceDisplayName?: string | null;
17
+ /**
18
+ * Label key.
19
+ *
20
+ * `key` is generated when the label is created
21
+ * and cannot be modified, even if `displayName` changes.
22
+ * @readonly
23
+ */
24
+ key?: string;
25
+ /** Label display name shown in the Dashboard. */
26
+ displayName?: string;
27
+ /**
28
+ * Label type.
29
+ *
30
+ * - `SYSTEM`: The label is a default system label for the Contact List.
31
+ * - `USER_DEFINED`: The label was created by a site contributor or 3rd-party app.
32
+ * - `WIX_APP_DEFINED`: The label was created by a Wix app.
33
+ * @readonly
34
+ */
35
+ labelType?: LabelType;
36
+ /**
37
+ * Date and time the label was created.
38
+ * @readonly
39
+ */
40
+ createdDate?: Date;
41
+ /**
42
+ * Date and time the label was last updated.
43
+ * @readonly
44
+ */
45
+ updatedDate?: Date;
46
+ }
47
+ export declare enum LabelType {
48
+ /** Need UNKNOWN to be able to fetch all labels */
49
+ UNKNOWN = "UNKNOWN",
50
+ SYSTEM = "SYSTEM",
51
+ USER_DEFINED = "USER_DEFINED",
52
+ WIX_APP_DEFINED = "WIX_APP_DEFINED"
53
+ }
54
+ /** Label filter options. */
55
+ export interface ListLabelsRequest {
56
+ /** Filter for labels of the specified type. */
57
+ labelType?: LabelType;
58
+ /** Filter for labels in the specified namespace. */
59
+ namespace?: string | null;
60
+ /** Filter for labels where `displayName` starts with the specified case-sensitive string. */
61
+ startsWith?: string | null;
62
+ /** Sorting options. */
63
+ sort?: Sorting;
64
+ /** Paging options. */
65
+ paging?: Paging;
66
+ /** Language for localization. */
67
+ language?: string | null;
68
+ }
69
+ export interface Sorting {
70
+ /** Name of the field to sort by. */
71
+ fieldName?: string;
72
+ /**
73
+ * Sort order. Use `ASC` for ascending order or `DESC` for descending order.
74
+ *
75
+ * Defaults to `ASC`.
76
+ */
77
+ order?: SortOrder;
78
+ }
79
+ export declare enum SortOrder {
80
+ ASC = "ASC",
81
+ DESC = "DESC"
82
+ }
83
+ export interface Paging {
84
+ /**
85
+ * Number of items to return.
86
+ *
87
+ * Defaults to `1000`. <br>
88
+ * Maximum: `2000`.
89
+ */
90
+ limit?: number | null;
91
+ /** Number of items to skip in the current sort order. */
92
+ offset?: number | null;
93
+ }
94
+ /** List of labels. */
95
+ export interface ListLabelsResponse {
96
+ /** List of labels. */
97
+ labels?: ContactLabel[];
98
+ /** Metadata for the page of results. */
99
+ metadata?: PagingMetadata;
100
+ }
101
+ export interface PagingMetadata {
102
+ /** Number of items returned. */
103
+ count?: number | null;
104
+ /** Requested offset. */
105
+ offset?: number | null;
106
+ /** Number of items that matched the query. */
107
+ total?: number | null;
108
+ /**
109
+ * Indicates if `total` calculation timed out before the response was sent.
110
+ * Typically this happens if there is a large set of results.
111
+ */
112
+ tooManyToCount?: boolean | null;
113
+ }
114
+ /** Label to find or create. */
115
+ export interface FindOrCreateLabelRequest {
116
+ /**
117
+ * Display name to retrieve or create.
118
+ *
119
+ * If an existing label is an exact match
120
+ * for the specified display name,
121
+ * the existing label is returned.
122
+ * If not, a new label is created and returned.
123
+ */
124
+ displayName: string;
125
+ /** Language for localization. */
126
+ language?: string | null;
127
+ }
128
+ /** Label that was found or created. */
129
+ export interface FindOrCreateLabelResponse {
130
+ /** Label that was found or created. */
131
+ label?: ContactLabel;
132
+ /**
133
+ * Indicates whether the label was just created or already existed.
134
+ *
135
+ * If the label was just created, returns `true`.
136
+ * If it already existed, returns `false`.
137
+ */
138
+ newLabel?: boolean;
139
+ }
140
+ export interface LabelsQuotaReached {
141
+ labelsQuota?: string | null;
142
+ labelsCurrentTotal?: string | null;
143
+ }
144
+ export interface ListLabelNamespacesRequest {
145
+ /** Language for localization */
146
+ language?: string | null;
147
+ }
148
+ export interface ListLabelNamespacesResponse {
149
+ namespaces?: ContactLabelNamespace[];
150
+ }
151
+ export interface ContactLabelNamespace {
152
+ /**
153
+ * Namespace key
154
+ * @readonly
155
+ */
156
+ key?: string;
157
+ /**
158
+ * Namespace display name
159
+ * @readonly
160
+ */
161
+ displayName?: string | null;
162
+ }
163
+ export interface GetLabelRequest {
164
+ /**
165
+ * Label key.
166
+ *
167
+ * `key` is generated when the label is created
168
+ * and cannot be modified, even if `displayName` changes.
169
+ */
170
+ key?: string;
171
+ /** Language for localization. */
172
+ language?: string | null;
173
+ }
174
+ /** The specified label. */
175
+ export interface GetLabelResponse {
176
+ /** The specified label. */
177
+ label?: ContactLabel;
178
+ }
179
+ export interface GetLabelByLegacyIdRequest {
180
+ legacyId?: string;
181
+ /** Language for localization */
182
+ language?: string | null;
183
+ }
184
+ export interface GetLabelByLegacyIdResponse {
185
+ label?: ContactLabel;
186
+ }
187
+ export interface UpdateLabelRequest {
188
+ /** Label details to update. */
189
+ label?: ContactLabel;
190
+ /** Language for localization. */
191
+ language?: string | null;
192
+ }
193
+ /** Updated label. */
194
+ export interface UpdateLabelResponse {
195
+ /** Updated label. */
196
+ label?: ContactLabel;
197
+ }
198
+ export interface DeleteLabelRequest {
199
+ /** Label key to delete. */
200
+ key: string;
201
+ }
202
+ export interface DeleteLabelResponse {
203
+ }
204
+ export interface PurgeRequest {
205
+ instanceId?: string;
206
+ exludingLabelKeys?: string[];
207
+ }
208
+ export interface PurgeResponse {
209
+ deletedItems?: number;
210
+ }
211
+ export interface GdprListRequest {
212
+ instanceId?: string;
213
+ }
214
+ export interface GdprListResponse {
215
+ labels?: ContactLabel[];
216
+ }
217
+ export interface QueryLabelsRequest {
218
+ /** Query options. */
219
+ query?: Query;
220
+ /** Language for localization. */
221
+ language?: string | null;
222
+ }
223
+ export interface Query {
224
+ /**
225
+ * ilter object.
226
+ *
227
+ * Possible filters: `$eq`, `$gt`, `$gte`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.
228
+ *
229
+ * For a detailed list of supported filters, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).
230
+ *
231
+ * Example: `{ "filter": {
232
+ * "displayName": {
233
+ * "$startsWith": "Referral"
234
+ * }
235
+ * }
236
+ * }`
237
+ */
238
+ filter?: Record<string, any> | null;
239
+ /**
240
+ * Sorting options. For a list of fields that can be sorted, see [sorting and filtering for labels](https://dev.wix.com/api/rest/contacts/labels/sort-and-filter).
241
+ *
242
+ * Example: `{ "sort": [{"fieldName": "displayName", "order": "DESC"}] }`
243
+ */
244
+ sort?: Sorting[];
245
+ /** Pagination options. */
246
+ paging?: Paging;
247
+ }
248
+ export interface QueryLabelsResponse {
249
+ /** List of labels */
250
+ labels?: ContactLabel[];
251
+ /** Details on the paged set of results returned. */
252
+ pagingMetadata?: PagingMetadata;
253
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SortOrder = exports.LabelType = void 0;
4
+ var LabelType;
5
+ (function (LabelType) {
6
+ /** Need UNKNOWN to be able to fetch all labels */
7
+ LabelType["UNKNOWN"] = "UNKNOWN";
8
+ LabelType["SYSTEM"] = "SYSTEM";
9
+ LabelType["USER_DEFINED"] = "USER_DEFINED";
10
+ LabelType["WIX_APP_DEFINED"] = "WIX_APP_DEFINED";
11
+ })(LabelType = exports.LabelType || (exports.LabelType = {}));
12
+ var SortOrder;
13
+ (function (SortOrder) {
14
+ SortOrder["ASC"] = "ASC";
15
+ SortOrder["DESC"] = "DESC";
16
+ })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
17
+ //# sourceMappingURL=contacts-v4-label.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contacts-v4-label.types.js","sourceRoot":"","sources":["../../../src/contacts-v4-label.types.ts"],"names":[],"mappings":";;;AA+CA,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,kDAAkD;IAClD,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,0CAA6B,CAAA;IAC7B,gDAAmC,CAAA;AACrC,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB;AA6BD,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}