@wix/crm 1.0.107 → 1.0.109
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/context.d.ts +1 -0
- package/build/cjs/context.js +2 -1
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +2 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +2 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +1 -0
- package/build/es/context.js +1 -0
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +1 -0
- package/build/es/meta.js.map +1 -1
- package/package.json +5 -4
- package/type-bundles/context.bundle.d.ts +255 -36
- package/type-bundles/index.bundle.d.ts +478 -33
- package/type-bundles/meta.bundle.d.ts +352 -2
package/build/cjs/context.d.ts
CHANGED
package/build/cjs/context.js
CHANGED
|
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.tasks = exports.submittedContact = exports.labels = exports.extendedFields = exports.contacts = void 0;
|
|
26
|
+
exports.tasks = exports.submittedContact = exports.labels = exports.extendedFields = exports.contacts = exports.attachments = void 0;
|
|
27
|
+
exports.attachments = __importStar(require("@wix/crm_attachments/context"));
|
|
27
28
|
exports.contacts = __importStar(require("@wix/crm_contacts/context"));
|
|
28
29
|
exports.extendedFields = __importStar(require("@wix/crm_extended-fields/context"));
|
|
29
30
|
exports.labels = __importStar(require("@wix/crm_labels/context"));
|
package/build/cjs/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsD;AACtD,mFAAmE;AACnE,kEAAkD;AAClD,uFAAuE;AACvE,gEAAgD"}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4EAA4D;AAC5D,sEAAsD;AACtD,mFAAmE;AACnE,kEAAkD;AAClD,uFAAuE;AACvE,gEAAgD"}
|
package/build/cjs/index.d.ts
CHANGED
package/build/cjs/index.js
CHANGED
|
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.tasks = exports.submittedContact = exports.labels = exports.extendedFields = exports.contacts = void 0;
|
|
26
|
+
exports.tasks = exports.submittedContact = exports.labels = exports.extendedFields = exports.contacts = exports.attachments = void 0;
|
|
27
|
+
exports.attachments = __importStar(require("@wix/crm_attachments"));
|
|
27
28
|
exports.contacts = __importStar(require("@wix/crm_contacts"));
|
|
28
29
|
exports.extendedFields = __importStar(require("@wix/crm_extended-fields"));
|
|
29
30
|
exports.labels = __importStar(require("@wix/crm_labels"));
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA8C;AAC9C,2EAA2D;AAC3D,0DAA0C;AAC1C,+EAA+D;AAC/D,wDAAwC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAoD;AACpD,8DAA8C;AAC9C,2EAA2D;AAC3D,0DAA0C;AAC1C,+EAA+D;AAC/D,wDAAwC"}
|
package/build/cjs/meta.d.ts
CHANGED
package/build/cjs/meta.js
CHANGED
|
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.tasks = exports.submittedContact = exports.labels = exports.extendedFields = exports.contacts = void 0;
|
|
26
|
+
exports.tasks = exports.submittedContact = exports.labels = exports.extendedFields = exports.contacts = exports.attachments = void 0;
|
|
27
|
+
exports.attachments = __importStar(require("@wix/crm_attachments/meta"));
|
|
27
28
|
exports.contacts = __importStar(require("@wix/crm_contacts/meta"));
|
|
28
29
|
exports.extendedFields = __importStar(require("@wix/crm_extended-fields/meta"));
|
|
29
30
|
exports.labels = __importStar(require("@wix/crm_labels/meta"));
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmD;AACnD,gFAAgE;AAChE,+DAA+C;AAC/C,oFAAoE;AACpE,6DAA6C"}
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAyD;AACzD,mEAAmD;AACnD,gFAAgE;AAChE,+DAA+C;AAC/C,oFAAoE;AACpE,6DAA6C"}
|
package/build/es/context.d.ts
CHANGED
package/build/es/context.js
CHANGED
package/build/es/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,cAAc,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,cAAc,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,wBAAwB,CAAC"}
|
package/build/es/index.d.ts
CHANGED
package/build/es/index.js
CHANGED
package/build/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC"}
|
package/build/es/meta.d.ts
CHANGED
package/build/es/meta.js
CHANGED
package/build/es/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,gBAAgB,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,gBAAgB,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/crm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.109",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
"type-bundles"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wix/
|
|
21
|
+
"@wix/crm_attachments": "1.0.0",
|
|
22
|
+
"@wix/crm_contacts": "1.0.32",
|
|
22
23
|
"@wix/crm_extended-fields": "1.0.26",
|
|
23
24
|
"@wix/crm_labels": "1.0.26",
|
|
24
|
-
"@wix/crm_submitted-contact": "1.0.
|
|
25
|
+
"@wix/crm_submitted-contact": "1.0.21",
|
|
25
26
|
"@wix/crm_tasks": "1.0.27"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
@@ -47,5 +48,5 @@
|
|
|
47
48
|
"fqdn": ""
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
|
-
"falconPackageHash": "
|
|
51
|
+
"falconPackageHash": "412bba4236612da4c7712733441c56e2e82c8ff3fc6825dab97274da"
|
|
51
52
|
}
|
|
@@ -1,3 +1,257 @@
|
|
|
1
|
+
interface ContactAttachment extends ContactAttachmentMediaOneOf {
|
|
2
|
+
/** The attachment's image (if the attachment is of type IMAGE) */
|
|
3
|
+
image?: string;
|
|
4
|
+
/** The attachment's document (if the attachment is of type OTHER) */
|
|
5
|
+
document?: string;
|
|
6
|
+
/**
|
|
7
|
+
* The id of the attachment.
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
_id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Image preview (reduced image size) of the attachment (if the attachment is of type IMAGE).
|
|
13
|
+
* @readonly
|
|
14
|
+
*/
|
|
15
|
+
previewImage?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The file name of the attachment.
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
fileName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The mime type of the attachment.
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
25
|
+
mimeType?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The type of the attachment
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
attachmentType?: AttachmentType;
|
|
31
|
+
}
|
|
32
|
+
/** @oneof */
|
|
33
|
+
interface ContactAttachmentMediaOneOf {
|
|
34
|
+
/** The attachment's image (if the attachment is of type IMAGE) */
|
|
35
|
+
image?: string;
|
|
36
|
+
/** The attachment's document (if the attachment is of type OTHER) */
|
|
37
|
+
document?: string;
|
|
38
|
+
}
|
|
39
|
+
declare enum AttachmentType {
|
|
40
|
+
UNKNOWN = "UNKNOWN",
|
|
41
|
+
IMAGE = "IMAGE",
|
|
42
|
+
OTHER = "OTHER"
|
|
43
|
+
}
|
|
44
|
+
interface GenerateAttachmentUploadUrlResponse {
|
|
45
|
+
/** The URL for uploading a file as an attachment to the contact. */
|
|
46
|
+
uploadUrl?: string;
|
|
47
|
+
}
|
|
48
|
+
interface Paging {
|
|
49
|
+
/** Number of items to return (default 100, max 100). */
|
|
50
|
+
limit?: number | null;
|
|
51
|
+
/** number of items to skip in the current sort order */
|
|
52
|
+
offset?: number | null;
|
|
53
|
+
}
|
|
54
|
+
interface ListAttachmentsResponse {
|
|
55
|
+
/** The requested attachments */
|
|
56
|
+
attachments?: ContactAttachment[];
|
|
57
|
+
/** Metadata for the page of results. */
|
|
58
|
+
metadata?: PagingMetadata;
|
|
59
|
+
}
|
|
60
|
+
interface PagingMetadata {
|
|
61
|
+
/** The number of items returned in this response */
|
|
62
|
+
count?: number | null;
|
|
63
|
+
/** The offset which was requested */
|
|
64
|
+
offset?: number | null;
|
|
65
|
+
/** The total number of items that match the query */
|
|
66
|
+
total?: number | null;
|
|
67
|
+
/** A flag that indicates the server failed to calculate 'total' field */
|
|
68
|
+
tooManyToCount?: boolean | null;
|
|
69
|
+
}
|
|
70
|
+
interface IdentificationData$4 extends IdentificationDataIdOneOf$4 {
|
|
71
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
72
|
+
anonymousVisitorId?: string;
|
|
73
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
74
|
+
memberId?: string;
|
|
75
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
76
|
+
wixUserId?: string;
|
|
77
|
+
/** ID of an app. */
|
|
78
|
+
appId?: string;
|
|
79
|
+
/** @readonly */
|
|
80
|
+
identityType?: WebhookIdentityType$4;
|
|
81
|
+
}
|
|
82
|
+
/** @oneof */
|
|
83
|
+
interface IdentificationDataIdOneOf$4 {
|
|
84
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
85
|
+
anonymousVisitorId?: string;
|
|
86
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
87
|
+
memberId?: string;
|
|
88
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
89
|
+
wixUserId?: string;
|
|
90
|
+
/** ID of an app. */
|
|
91
|
+
appId?: string;
|
|
92
|
+
}
|
|
93
|
+
declare enum WebhookIdentityType$4 {
|
|
94
|
+
UNKNOWN = "UNKNOWN",
|
|
95
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
96
|
+
MEMBER = "MEMBER",
|
|
97
|
+
WIX_USER = "WIX_USER",
|
|
98
|
+
APP = "APP"
|
|
99
|
+
}
|
|
100
|
+
interface GenerateAttachmentUploadUrlResponseNonNullableFields {
|
|
101
|
+
uploadUrl: string;
|
|
102
|
+
}
|
|
103
|
+
interface ListAttachmentsResponseNonNullableFields {
|
|
104
|
+
attachments: {
|
|
105
|
+
image: string;
|
|
106
|
+
document: string;
|
|
107
|
+
_id: string;
|
|
108
|
+
previewImage: string;
|
|
109
|
+
fileName: string;
|
|
110
|
+
mimeType: string;
|
|
111
|
+
attachmentType: AttachmentType;
|
|
112
|
+
}[];
|
|
113
|
+
}
|
|
114
|
+
interface BaseEventMetadata$4 {
|
|
115
|
+
/** App instance ID. */
|
|
116
|
+
instanceId?: string | null;
|
|
117
|
+
/** Event type. */
|
|
118
|
+
eventType?: string;
|
|
119
|
+
/** The identification type and identity data. */
|
|
120
|
+
identity?: IdentificationData$4;
|
|
121
|
+
}
|
|
122
|
+
interface EventMetadata$4 extends BaseEventMetadata$4 {
|
|
123
|
+
/**
|
|
124
|
+
* Unique event ID.
|
|
125
|
+
* Allows clients to ignore duplicate webhooks.
|
|
126
|
+
*/
|
|
127
|
+
_id?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Assumes actions are also always typed to an entity_type
|
|
130
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
131
|
+
*/
|
|
132
|
+
entityFqdn?: string;
|
|
133
|
+
/**
|
|
134
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
135
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
136
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
137
|
+
*/
|
|
138
|
+
slug?: string;
|
|
139
|
+
/** ID of the entity associated with the event. */
|
|
140
|
+
entityId?: string;
|
|
141
|
+
/** Event timestamp. */
|
|
142
|
+
eventTime?: Date;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
145
|
+
* (for example, GDPR).
|
|
146
|
+
*/
|
|
147
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
148
|
+
/** If present, indicates the action that triggered the event. */
|
|
149
|
+
originatedFrom?: string | null;
|
|
150
|
+
/**
|
|
151
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
152
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
153
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
154
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
155
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
156
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
157
|
+
*/
|
|
158
|
+
entityEventSequence?: string | null;
|
|
159
|
+
}
|
|
160
|
+
interface AttachmentCreatedEnvelope {
|
|
161
|
+
entity: ContactAttachment;
|
|
162
|
+
metadata: EventMetadata$4;
|
|
163
|
+
}
|
|
164
|
+
interface AttachmentDeletedEnvelope {
|
|
165
|
+
metadata: EventMetadata$4;
|
|
166
|
+
}
|
|
167
|
+
interface GenerateAttachmentUploadUrlOptions {
|
|
168
|
+
/** Mime type e.g: `application/pdf` */
|
|
169
|
+
mimeType: string;
|
|
170
|
+
}
|
|
171
|
+
interface ListAttachmentsOptions {
|
|
172
|
+
/** Allow paginating, default: limit = 100 and offset = 0 */
|
|
173
|
+
paging?: Paging;
|
|
174
|
+
}
|
|
175
|
+
interface DeleteAttachmentIdentifiers {
|
|
176
|
+
/** Contact ID */
|
|
177
|
+
contactId: string;
|
|
178
|
+
/** Attachment ID. */
|
|
179
|
+
attachmentId: string;
|
|
180
|
+
}
|
|
181
|
+
interface GetAttachmentIdentifiers {
|
|
182
|
+
/** Contact ID */
|
|
183
|
+
contactId: string;
|
|
184
|
+
/** Attachment ID. */
|
|
185
|
+
attachmentId: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
189
|
+
interface HttpClient {
|
|
190
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
191
|
+
}
|
|
192
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
193
|
+
type HttpResponse<T = any> = {
|
|
194
|
+
data: T;
|
|
195
|
+
status: number;
|
|
196
|
+
statusText: string;
|
|
197
|
+
headers: any;
|
|
198
|
+
request?: any;
|
|
199
|
+
};
|
|
200
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
201
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
202
|
+
url: string;
|
|
203
|
+
data?: Data;
|
|
204
|
+
params?: URLSearchParams;
|
|
205
|
+
} & APIMetadata;
|
|
206
|
+
type APIMetadata = {
|
|
207
|
+
methodFqn?: string;
|
|
208
|
+
entityFqdn?: string;
|
|
209
|
+
packageName?: string;
|
|
210
|
+
};
|
|
211
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
212
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
213
|
+
__type: 'event-definition';
|
|
214
|
+
type: Type;
|
|
215
|
+
isDomainEvent?: boolean;
|
|
216
|
+
transformations?: unknown;
|
|
217
|
+
__payload: Payload;
|
|
218
|
+
};
|
|
219
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
220
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
221
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
222
|
+
|
|
223
|
+
declare function generateAttachmentUploadUrl$1(httpClient: HttpClient): (contactId: string, fileName: string, options: GenerateAttachmentUploadUrlOptions) => Promise<GenerateAttachmentUploadUrlResponse & GenerateAttachmentUploadUrlResponseNonNullableFields>;
|
|
224
|
+
declare function listAttachments$1(httpClient: HttpClient): (contactId: string, options?: ListAttachmentsOptions) => Promise<ListAttachmentsResponse & ListAttachmentsResponseNonNullableFields>;
|
|
225
|
+
declare function deleteAttachment$1(httpClient: HttpClient): (identifiers: DeleteAttachmentIdentifiers) => Promise<void>;
|
|
226
|
+
declare function getAttachment$1(httpClient: HttpClient): (identifiers: GetAttachmentIdentifiers) => Promise<ContactAttachment & {
|
|
227
|
+
image: string;
|
|
228
|
+
document: string;
|
|
229
|
+
_id: string;
|
|
230
|
+
previewImage: string;
|
|
231
|
+
fileName: string;
|
|
232
|
+
mimeType: string;
|
|
233
|
+
attachmentType: AttachmentType;
|
|
234
|
+
}>;
|
|
235
|
+
declare const onAttachmentCreated$1: EventDefinition<AttachmentCreatedEnvelope, "wix.contacts.v4.attachment_created">;
|
|
236
|
+
declare const onAttachmentDeleted$1: EventDefinition<AttachmentDeletedEnvelope, "wix.contacts.v4.attachment_deleted">;
|
|
237
|
+
|
|
238
|
+
declare const generateAttachmentUploadUrl: BuildRESTFunction<typeof generateAttachmentUploadUrl$1>;
|
|
239
|
+
declare const listAttachments: BuildRESTFunction<typeof listAttachments$1>;
|
|
240
|
+
declare const deleteAttachment: BuildRESTFunction<typeof deleteAttachment$1>;
|
|
241
|
+
declare const getAttachment: BuildRESTFunction<typeof getAttachment$1>;
|
|
242
|
+
declare const onAttachmentCreated: BuildEventDefinition<typeof onAttachmentCreated$1>;
|
|
243
|
+
declare const onAttachmentDeleted: BuildEventDefinition<typeof onAttachmentDeleted$1>;
|
|
244
|
+
|
|
245
|
+
declare const context$5_deleteAttachment: typeof deleteAttachment;
|
|
246
|
+
declare const context$5_generateAttachmentUploadUrl: typeof generateAttachmentUploadUrl;
|
|
247
|
+
declare const context$5_getAttachment: typeof getAttachment;
|
|
248
|
+
declare const context$5_listAttachments: typeof listAttachments;
|
|
249
|
+
declare const context$5_onAttachmentCreated: typeof onAttachmentCreated;
|
|
250
|
+
declare const context$5_onAttachmentDeleted: typeof onAttachmentDeleted;
|
|
251
|
+
declare namespace context$5 {
|
|
252
|
+
export { context$5_deleteAttachment as deleteAttachment, context$5_generateAttachmentUploadUrl as generateAttachmentUploadUrl, context$5_getAttachment as getAttachment, context$5_listAttachments as listAttachments, context$5_onAttachmentCreated as onAttachmentCreated, context$5_onAttachmentDeleted as onAttachmentDeleted };
|
|
253
|
+
}
|
|
254
|
+
|
|
1
255
|
interface Contact {
|
|
2
256
|
/**
|
|
3
257
|
* Contact ID.
|
|
@@ -867,41 +1121,6 @@ interface GetContactOptions {
|
|
|
867
1121
|
fieldsets?: ContactFieldSet[];
|
|
868
1122
|
}
|
|
869
1123
|
|
|
870
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
871
|
-
interface HttpClient {
|
|
872
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
873
|
-
}
|
|
874
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
875
|
-
type HttpResponse<T = any> = {
|
|
876
|
-
data: T;
|
|
877
|
-
status: number;
|
|
878
|
-
statusText: string;
|
|
879
|
-
headers: any;
|
|
880
|
-
request?: any;
|
|
881
|
-
};
|
|
882
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
883
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
884
|
-
url: string;
|
|
885
|
-
data?: Data;
|
|
886
|
-
params?: URLSearchParams;
|
|
887
|
-
} & APIMetadata;
|
|
888
|
-
type APIMetadata = {
|
|
889
|
-
methodFqn?: string;
|
|
890
|
-
entityFqdn?: string;
|
|
891
|
-
packageName?: string;
|
|
892
|
-
};
|
|
893
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
894
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
895
|
-
__type: 'event-definition';
|
|
896
|
-
type: Type;
|
|
897
|
-
isDomainEvent?: boolean;
|
|
898
|
-
transformations?: unknown;
|
|
899
|
-
__payload: Payload;
|
|
900
|
-
};
|
|
901
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
902
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
903
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
904
|
-
|
|
905
1124
|
declare function createContact$1(httpClient: HttpClient): (info: ContactInfo$2, options?: CreateContactOptions) => Promise<CreateContactResponse & CreateContactResponseNonNullableFields>;
|
|
906
1125
|
declare function updateContact$1(httpClient: HttpClient): (contactId: string, info: ContactInfo$2, revision: number | null, options?: UpdateContactOptions) => Promise<UpdateContactResponse & UpdateContactResponseNonNullableFields>;
|
|
907
1126
|
declare function mergeContacts$1(httpClient: HttpClient): (targetContactId: string, targetContactRevision: number | null, options?: MergeContactsOptions) => Promise<MergeContactsResponse & MergeContactsResponseNonNullableFields>;
|
|
@@ -2325,4 +2544,4 @@ declare namespace context {
|
|
|
2325
2544
|
export { context_countTasks as countTasks, context_createTask as createTask, context_deleteTask as deleteTask, context_getTask as getTask, context_moveTaskAfter as moveTaskAfter, context_onTaskCreated as onTaskCreated, context_onTaskDeleted as onTaskDeleted, context_onTaskOverdue as onTaskOverdue, context_onTaskUpdated as onTaskUpdated, context_queryTasks as queryTasks, context_updateTask as updateTask };
|
|
2326
2545
|
}
|
|
2327
2546
|
|
|
2328
|
-
export { context$4 as contacts, context$3 as extendedFields, context$2 as labels, context$1 as submittedContact, context as tasks };
|
|
2547
|
+
export { context$5 as attachments, context$4 as contacts, context$3 as extendedFields, context$2 as labels, context$1 as submittedContact, context as tasks };
|