@deliverart/sdk-js-lead 0.0.0-dev-20260721002647
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 +68 -0
- package/dist/index.cjs +420 -0
- package/dist/index.d.cts +3920 -0
- package/dist/index.d.ts +3920 -0
- package/dist/index.js +375 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @deliverart/sdk-js-lead
|
|
2
|
+
|
|
3
|
+
Lead management package for the DeliverArt JavaScript SDK.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @deliverart/sdk-js-lead @deliverart/sdk-js-core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Available Requests
|
|
12
|
+
|
|
13
|
+
- `GetLeads`
|
|
14
|
+
- `CreateLead`
|
|
15
|
+
- `GetLeadDetails`
|
|
16
|
+
- `UpdateLead`
|
|
17
|
+
- `DeleteLead`
|
|
18
|
+
- `InitializeLead`
|
|
19
|
+
- `GenerateLeadApiToken`
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { CreateLead, GetLeads, InitializeLead } from '@deliverart/sdk-js-lead'
|
|
25
|
+
|
|
26
|
+
const lead = await sdk.call(
|
|
27
|
+
new CreateLead({
|
|
28
|
+
email: 'owner@example.com',
|
|
29
|
+
firstName: 'Mario',
|
|
30
|
+
lastName: 'Rossi',
|
|
31
|
+
businessName: 'Pizzeria Rossi SRL',
|
|
32
|
+
posName: 'Pizzeria Rossi',
|
|
33
|
+
vat: 'IT12345678901',
|
|
34
|
+
billingAddress: {
|
|
35
|
+
line1: 'Via Roma 1',
|
|
36
|
+
city: 'Milano',
|
|
37
|
+
region: 'MI',
|
|
38
|
+
postalCode: '20121',
|
|
39
|
+
country: 'IT',
|
|
40
|
+
},
|
|
41
|
+
posAddress: {
|
|
42
|
+
line1: 'Via Roma 1',
|
|
43
|
+
city: 'Milano',
|
|
44
|
+
region: 'MI',
|
|
45
|
+
postalCode: '20121',
|
|
46
|
+
country: 'IT',
|
|
47
|
+
},
|
|
48
|
+
billingData: {
|
|
49
|
+
pec: 'amministrazione@pec.example.it',
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
const leads = await sdk.call(
|
|
55
|
+
new GetLeads({
|
|
56
|
+
query: {
|
|
57
|
+
status: 'pending',
|
|
58
|
+
'order[createdAt]': 'desc',
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
const initialized = await sdk.call(
|
|
64
|
+
new InitializeLead(lead.id, {
|
|
65
|
+
convertLeadIntegrations: true,
|
|
66
|
+
}),
|
|
67
|
+
)
|
|
68
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
CreateLead: () => CreateLead,
|
|
24
|
+
DeleteLead: () => DeleteLead,
|
|
25
|
+
GenerateLeadApiToken: () => GenerateLeadApiToken,
|
|
26
|
+
GetLeadDetails: () => GetLeadDetails,
|
|
27
|
+
GetLeads: () => GetLeads,
|
|
28
|
+
InitializeLead: () => InitializeLead,
|
|
29
|
+
UpdateLead: () => UpdateLead,
|
|
30
|
+
createLeadInputSchema: () => createLeadInputSchema,
|
|
31
|
+
createLeadResponseSchema: () => createLeadResponseSchema,
|
|
32
|
+
deleteLeadInputSchema: () => deleteLeadInputSchema,
|
|
33
|
+
deleteLeadResponseSchema: () => deleteLeadResponseSchema,
|
|
34
|
+
generateLeadApiTokenInputSchema: () => generateLeadApiTokenInputSchema,
|
|
35
|
+
generateLeadApiTokenResponseSchema: () => generateLeadApiTokenResponseSchema,
|
|
36
|
+
getLeadDetailsInputSchema: () => getLeadDetailsInputSchema,
|
|
37
|
+
getLeadDetailsResponseSchema: () => getLeadDetailsResponseSchema,
|
|
38
|
+
getLeadsInputSchema: () => getLeadsInputSchema,
|
|
39
|
+
getLeadsQuerySchema: () => getLeadsQuerySchema,
|
|
40
|
+
getLeadsResponseSchema: () => getLeadsResponseSchema,
|
|
41
|
+
initializeLeadInputSchema: () => initializeLeadInputSchema,
|
|
42
|
+
initializeLeadQuerySchema: () => initializeLeadQuerySchema,
|
|
43
|
+
initializeLeadResponseSchema: () => initializeLeadResponseSchema,
|
|
44
|
+
leadCompletionStepSchema: () => leadCompletionStepSchema,
|
|
45
|
+
leadCompletionSteps: () => leadCompletionSteps,
|
|
46
|
+
leadDetailsSchema: () => leadDetailsSchema,
|
|
47
|
+
leadIntegrationsStatsSchema: () => leadIntegrationsStatsSchema,
|
|
48
|
+
leadIriSchema: () => leadIriSchema,
|
|
49
|
+
leadListItemSchema: () => leadListItemSchema,
|
|
50
|
+
leadNullableIriSchema: () => leadNullableIriSchema,
|
|
51
|
+
leadSchema: () => leadSchema,
|
|
52
|
+
leadStatusSchema: () => leadStatusSchema,
|
|
53
|
+
leadStatuses: () => leadStatuses,
|
|
54
|
+
leadsQuerySchema: () => leadsQuerySchema,
|
|
55
|
+
updateLeadInputSchema: () => updateLeadInputSchema,
|
|
56
|
+
updateLeadResponseSchema: () => updateLeadResponseSchema,
|
|
57
|
+
writableCreateLeadSchema: () => writableCreateLeadSchema,
|
|
58
|
+
writableLeadIntegrationSchema: () => writableLeadIntegrationSchema,
|
|
59
|
+
writableLeadSchema: () => writableLeadSchema
|
|
60
|
+
});
|
|
61
|
+
module.exports = __toCommonJS(index_exports);
|
|
62
|
+
|
|
63
|
+
// src/models.ts
|
|
64
|
+
var import_sdk_js_company = require("@deliverart/sdk-js-company");
|
|
65
|
+
var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
|
|
66
|
+
var import_sdk_js_integration_types = require("@deliverart/sdk-js-integration-types");
|
|
67
|
+
var import_sdk_js_point_of_sale = require("@deliverart/sdk-js-point-of-sale");
|
|
68
|
+
var import_sdk_js_user = require("@deliverart/sdk-js-user");
|
|
69
|
+
var import_zod2 = require("zod");
|
|
70
|
+
|
|
71
|
+
// src/types.ts
|
|
72
|
+
var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
|
|
73
|
+
var import_zod = require("zod");
|
|
74
|
+
var leadIriSchema = (0, import_sdk_js_global_types.iriSchema)("/leads/:id");
|
|
75
|
+
var leadNullableIriSchema = (0, import_sdk_js_global_types.iriNullableSchema)("/leads/:id");
|
|
76
|
+
var leadStatuses = [
|
|
77
|
+
"pending",
|
|
78
|
+
"partially_initialized",
|
|
79
|
+
"initialized",
|
|
80
|
+
"completed"
|
|
81
|
+
];
|
|
82
|
+
var leadStatusSchema = import_zod.z.enum(leadStatuses);
|
|
83
|
+
var leadCompletionSteps = [
|
|
84
|
+
"CREATE_USER_MANAGER",
|
|
85
|
+
"CREATE_COMPANY",
|
|
86
|
+
"CREATE_POINT_OF_SALE",
|
|
87
|
+
"CONFIGURE_INTEGRATIONS"
|
|
88
|
+
];
|
|
89
|
+
var leadCompletionStepSchema = import_zod.z.enum(leadCompletionSteps);
|
|
90
|
+
|
|
91
|
+
// src/models.ts
|
|
92
|
+
var leadBillingDataObjectSchema = import_zod2.z.object({
|
|
93
|
+
sdi: import_zod2.z.string().trim().optional().nullable(),
|
|
94
|
+
pec: import_zod2.z.email({ message: "Invalid email format" }).optional().nullable()
|
|
95
|
+
}).catchall(import_zod2.z.unknown());
|
|
96
|
+
var leadBillingDataSchema = import_zod2.z.union([
|
|
97
|
+
leadBillingDataObjectSchema,
|
|
98
|
+
import_zod2.z.array(import_zod2.z.never()).transform(() => ({}))
|
|
99
|
+
]);
|
|
100
|
+
var leadIntegrationsStatsSchema = import_zod2.z.object({
|
|
101
|
+
count: import_zod2.z.coerce.number(),
|
|
102
|
+
statuses: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.coerce.number())
|
|
103
|
+
});
|
|
104
|
+
var leadSchema = import_zod2.z.object({
|
|
105
|
+
id: import_zod2.z.string(),
|
|
106
|
+
status: leadStatusSchema,
|
|
107
|
+
email: import_zod2.z.email(),
|
|
108
|
+
firstName: import_zod2.z.string(),
|
|
109
|
+
lastName: import_zod2.z.string(),
|
|
110
|
+
businessName: import_zod2.z.string(),
|
|
111
|
+
posName: import_zod2.z.string(),
|
|
112
|
+
posAddress: import_sdk_js_global_types2.addressSchema,
|
|
113
|
+
numberOfCouriers: import_zod2.z.coerce.number(),
|
|
114
|
+
notificationsEnabled: import_zod2.z.boolean(),
|
|
115
|
+
uncompletedSteps: import_zod2.z.array(leadCompletionStepSchema),
|
|
116
|
+
completedSteps: import_zod2.z.array(leadCompletionStepSchema),
|
|
117
|
+
percentageCompletion: import_zod2.z.coerce.number(),
|
|
118
|
+
integrationsStats: leadIntegrationsStatsSchema,
|
|
119
|
+
createdAt: import_sdk_js_global_types2.datetimeSchema,
|
|
120
|
+
updatedAt: import_sdk_js_global_types2.datetimeSchema
|
|
121
|
+
});
|
|
122
|
+
var leadDetailsSchema = leadSchema.extend({
|
|
123
|
+
user: import_sdk_js_user.userNullableIriSchema,
|
|
124
|
+
company: import_sdk_js_company.companyNullableIriSchema,
|
|
125
|
+
pointOfSale: import_sdk_js_point_of_sale.pointOfSaleNullableIriSchema,
|
|
126
|
+
vat: import_zod2.z.string(),
|
|
127
|
+
taxCode: import_zod2.z.string().nullable(),
|
|
128
|
+
billingAddress: import_sdk_js_global_types2.addressSchema,
|
|
129
|
+
billingData: leadBillingDataSchema
|
|
130
|
+
});
|
|
131
|
+
var leadListItemSchema = leadDetailsSchema.extend({
|
|
132
|
+
integrations: import_zod2.z.array(import_sdk_js_integration_types.activatableIntegrationSchema).optional().default([])
|
|
133
|
+
});
|
|
134
|
+
var writableLeadIntegrationBaseSchema = import_zod2.z.object({
|
|
135
|
+
name: import_zod2.z.string(),
|
|
136
|
+
provider: import_sdk_js_integration_types.integrationProviderSchema
|
|
137
|
+
});
|
|
138
|
+
var writableLeadIntegrationSchema = import_zod2.z.discriminatedUnion("service", [
|
|
139
|
+
import_zod2.z.object({
|
|
140
|
+
service: import_zod2.z.literal("kitchen"),
|
|
141
|
+
data: import_sdk_js_integration_types.integrationKitchenDataSchema
|
|
142
|
+
}).extend(writableLeadIntegrationBaseSchema.shape),
|
|
143
|
+
import_zod2.z.object({
|
|
144
|
+
service: import_zod2.z.literal("deliveroo"),
|
|
145
|
+
data: import_sdk_js_integration_types.integrationDeliverooDataSchema
|
|
146
|
+
}).extend(writableLeadIntegrationBaseSchema.shape),
|
|
147
|
+
import_zod2.z.object({
|
|
148
|
+
service: import_zod2.z.literal("glovo"),
|
|
149
|
+
data: import_sdk_js_integration_types.integrationGlovoDataSchema
|
|
150
|
+
}).extend(writableLeadIntegrationBaseSchema.shape),
|
|
151
|
+
import_zod2.z.object({
|
|
152
|
+
service: import_zod2.z.literal("justeat"),
|
|
153
|
+
data: import_sdk_js_integration_types.integrationJustEatDataSchema
|
|
154
|
+
}).extend(writableLeadIntegrationBaseSchema.shape),
|
|
155
|
+
import_zod2.z.object({
|
|
156
|
+
service: import_zod2.z.literal("cassa_in_cloud"),
|
|
157
|
+
data: import_sdk_js_integration_types.integrationCassaInCloudDataSchema
|
|
158
|
+
}).extend(writableLeadIntegrationBaseSchema.shape),
|
|
159
|
+
import_zod2.z.object({
|
|
160
|
+
service: import_zod2.z.literal("tilby"),
|
|
161
|
+
data: import_sdk_js_integration_types.integrationTilbyDataSchema
|
|
162
|
+
}).extend(writableLeadIntegrationBaseSchema.shape)
|
|
163
|
+
]);
|
|
164
|
+
var writableLeadSchema = import_zod2.z.object({
|
|
165
|
+
email: import_zod2.z.email(),
|
|
166
|
+
firstName: import_zod2.z.string(),
|
|
167
|
+
lastName: import_zod2.z.string(),
|
|
168
|
+
businessName: import_zod2.z.string(),
|
|
169
|
+
posName: import_zod2.z.string(),
|
|
170
|
+
vat: import_zod2.z.string(),
|
|
171
|
+
taxCode: import_zod2.z.string().nullable().optional(),
|
|
172
|
+
billingAddress: import_sdk_js_global_types2.addressSchema,
|
|
173
|
+
posAddress: import_sdk_js_global_types2.addressSchema,
|
|
174
|
+
billingData: leadBillingDataSchema.optional(),
|
|
175
|
+
numberOfCouriers: import_zod2.z.coerce.number().int().nonnegative().optional(),
|
|
176
|
+
notificationsEnabled: import_zod2.z.boolean().optional()
|
|
177
|
+
});
|
|
178
|
+
var writableCreateLeadSchema = writableLeadSchema.extend({
|
|
179
|
+
integrations: import_zod2.z.array(writableLeadIntegrationSchema).optional()
|
|
180
|
+
});
|
|
181
|
+
var leadEnumFilter = (schema) => import_zod2.z.union([schema, import_zod2.z.array(schema)]);
|
|
182
|
+
var leadsQuerySchema = import_zod2.z.object({
|
|
183
|
+
id: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
184
|
+
email: import_zod2.z.string().optional(),
|
|
185
|
+
firstName: import_zod2.z.string().optional(),
|
|
186
|
+
lastName: import_zod2.z.string().optional(),
|
|
187
|
+
businessName: import_zod2.z.string().optional(),
|
|
188
|
+
posName: import_zod2.z.string().optional(),
|
|
189
|
+
vat: import_zod2.z.string().optional(),
|
|
190
|
+
taxCode: import_zod2.z.string().optional(),
|
|
191
|
+
"integrations.connectionId": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
192
|
+
status: leadEnumFilter(leadStatusSchema).optional(),
|
|
193
|
+
"integrations.status": leadEnumFilter(import_sdk_js_integration_types.activatableIntegrationStatusSchema).optional(),
|
|
194
|
+
"integrations.healthStatus": leadEnumFilter(
|
|
195
|
+
import_sdk_js_integration_types.activatableIntegrationHealthStatusSchema
|
|
196
|
+
).optional(),
|
|
197
|
+
"integrations.service": leadEnumFilter(import_sdk_js_integration_types.integrationServiceSchema).optional(),
|
|
198
|
+
uncompletedSteps: leadEnumFilter(leadCompletionStepSchema).optional(),
|
|
199
|
+
completedSteps: leadEnumFilter(leadCompletionStepSchema).optional(),
|
|
200
|
+
"billingAddress.city": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
201
|
+
"billingAddress.region": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
202
|
+
"billingAddress.postalCode": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
203
|
+
"billingAddress.country": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
204
|
+
"posAddress.city": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
205
|
+
"posAddress.region": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
206
|
+
"posAddress.postalCode": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
207
|
+
"posAddress.country": import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())]).optional(),
|
|
208
|
+
"order[businessName]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
209
|
+
"order[firstName]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
210
|
+
"order[lastName]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
211
|
+
"order[posName]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
212
|
+
"order[createdAt]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
213
|
+
"order[updatedAt]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
214
|
+
page: import_zod2.z.coerce.number().optional(),
|
|
215
|
+
itemsPerPage: import_zod2.z.coerce.number().optional(),
|
|
216
|
+
pagination: import_sdk_js_global_types2.booleanSchema.optional()
|
|
217
|
+
}).extend(import_sdk_js_global_types2.timestampsFilterSchema.shape);
|
|
218
|
+
|
|
219
|
+
// src/requests/leads/CreateLead.ts
|
|
220
|
+
var import_sdk_js_core = require("@deliverart/sdk-js-core");
|
|
221
|
+
var createLeadInputSchema = writableCreateLeadSchema;
|
|
222
|
+
var createLeadResponseSchema = leadDetailsSchema;
|
|
223
|
+
var CreateLead = class extends import_sdk_js_core.AbstractApiRequest {
|
|
224
|
+
constructor(input) {
|
|
225
|
+
super(input);
|
|
226
|
+
this.method = "POST";
|
|
227
|
+
this.contentType = "application/json";
|
|
228
|
+
this.accept = "application/json";
|
|
229
|
+
this.inputSchema = createLeadInputSchema;
|
|
230
|
+
this.outputSchema = createLeadResponseSchema;
|
|
231
|
+
this.querySchema = void 0;
|
|
232
|
+
this.headersSchema = void 0;
|
|
233
|
+
}
|
|
234
|
+
getPath() {
|
|
235
|
+
return "/leads";
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// src/requests/leads/DeleteLead.ts
|
|
240
|
+
var import_sdk_js_core2 = require("@deliverart/sdk-js-core");
|
|
241
|
+
var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
|
|
242
|
+
var import_zod3 = require("zod");
|
|
243
|
+
var deleteLeadInputSchema = import_zod3.z.undefined();
|
|
244
|
+
var deleteLeadResponseSchema = import_sdk_js_global_types3.emptyResponseSchema;
|
|
245
|
+
var DeleteLead = class extends import_sdk_js_core2.AbstractApiRequest {
|
|
246
|
+
constructor(leadId) {
|
|
247
|
+
super(void 0);
|
|
248
|
+
this.method = "DELETE";
|
|
249
|
+
this.contentType = "application/json";
|
|
250
|
+
this.accept = "application/json";
|
|
251
|
+
this.inputSchema = deleteLeadInputSchema;
|
|
252
|
+
this.outputSchema = deleteLeadResponseSchema;
|
|
253
|
+
this.querySchema = void 0;
|
|
254
|
+
this.headersSchema = void 0;
|
|
255
|
+
this.leadId = leadId;
|
|
256
|
+
}
|
|
257
|
+
getPath() {
|
|
258
|
+
return `/leads/${this.leadId}`;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
// src/requests/leads/GenerateLeadApiToken.ts
|
|
263
|
+
var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
|
|
264
|
+
var import_zod4 = require("zod");
|
|
265
|
+
var generateLeadApiTokenInputSchema = import_zod4.z.undefined();
|
|
266
|
+
var generateLeadApiTokenResponseSchema = import_zod4.z.object({
|
|
267
|
+
api_token: import_zod4.z.string().length(64)
|
|
268
|
+
});
|
|
269
|
+
var GenerateLeadApiToken = class extends import_sdk_js_core3.AbstractApiRequest {
|
|
270
|
+
constructor(leadId) {
|
|
271
|
+
super(void 0);
|
|
272
|
+
this.method = "POST";
|
|
273
|
+
this.contentType = "application/json";
|
|
274
|
+
this.accept = "application/json";
|
|
275
|
+
this.inputSchema = generateLeadApiTokenInputSchema;
|
|
276
|
+
this.outputSchema = generateLeadApiTokenResponseSchema;
|
|
277
|
+
this.querySchema = void 0;
|
|
278
|
+
this.headersSchema = void 0;
|
|
279
|
+
this.leadId = leadId;
|
|
280
|
+
}
|
|
281
|
+
getPath() {
|
|
282
|
+
return `/leads/${this.leadId}/api_token/generate`;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
// src/requests/leads/GetLeadDetails.ts
|
|
287
|
+
var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
|
|
288
|
+
var import_zod5 = require("zod");
|
|
289
|
+
var getLeadDetailsInputSchema = import_zod5.z.undefined();
|
|
290
|
+
var getLeadDetailsResponseSchema = leadDetailsSchema;
|
|
291
|
+
var GetLeadDetails = class extends import_sdk_js_core4.AbstractApiRequest {
|
|
292
|
+
constructor(leadId) {
|
|
293
|
+
super(void 0);
|
|
294
|
+
this.method = "GET";
|
|
295
|
+
this.contentType = "application/json";
|
|
296
|
+
this.accept = "application/json";
|
|
297
|
+
this.inputSchema = getLeadDetailsInputSchema;
|
|
298
|
+
this.outputSchema = getLeadDetailsResponseSchema;
|
|
299
|
+
this.querySchema = void 0;
|
|
300
|
+
this.headersSchema = void 0;
|
|
301
|
+
this.leadId = leadId;
|
|
302
|
+
}
|
|
303
|
+
getPath() {
|
|
304
|
+
return `/leads/${this.leadId}`;
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
// src/requests/leads/GetLeads.ts
|
|
309
|
+
var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
|
|
310
|
+
var import_sdk_js_global_types4 = require("@deliverart/sdk-js-global-types");
|
|
311
|
+
var import_zod6 = require("zod");
|
|
312
|
+
var getLeadsQuerySchema = leadsQuerySchema;
|
|
313
|
+
var getLeadsInputSchema = import_zod6.z.undefined();
|
|
314
|
+
var getLeadsResponseSchema = (0, import_sdk_js_global_types4.createPaginatedSchema)(leadListItemSchema);
|
|
315
|
+
var GetLeads = class extends import_sdk_js_core5.AbstractApiRequest {
|
|
316
|
+
constructor(options) {
|
|
317
|
+
super(void 0, options);
|
|
318
|
+
this.method = "GET";
|
|
319
|
+
this.contentType = "application/json";
|
|
320
|
+
this.accept = "application/json";
|
|
321
|
+
this.inputSchema = getLeadsInputSchema;
|
|
322
|
+
this.outputSchema = getLeadsResponseSchema;
|
|
323
|
+
this.querySchema = getLeadsQuerySchema;
|
|
324
|
+
this.headersSchema = void 0;
|
|
325
|
+
this.listItemSchema = leadListItemSchema;
|
|
326
|
+
this.paginationDefaultEnabled = true;
|
|
327
|
+
}
|
|
328
|
+
getPath() {
|
|
329
|
+
return "/leads";
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
// src/requests/leads/InitializeLead.ts
|
|
334
|
+
var import_sdk_js_core6 = require("@deliverart/sdk-js-core");
|
|
335
|
+
var import_sdk_js_global_types5 = require("@deliverart/sdk-js-global-types");
|
|
336
|
+
var import_zod7 = require("zod");
|
|
337
|
+
var initializeLeadInputSchema = import_zod7.z.object({
|
|
338
|
+
convertLeadIntegrations: import_zod7.z.boolean().optional()
|
|
339
|
+
}).optional();
|
|
340
|
+
var initializeLeadQuerySchema = import_zod7.z.object({
|
|
341
|
+
convertLeadIntegrations: import_sdk_js_global_types5.booleanSchema.optional()
|
|
342
|
+
});
|
|
343
|
+
var initializeLeadResponseSchema = leadDetailsSchema;
|
|
344
|
+
var InitializeLead = class extends import_sdk_js_core6.AbstractApiRequest {
|
|
345
|
+
constructor(leadId, input, options) {
|
|
346
|
+
super(input, options);
|
|
347
|
+
this.method = "POST";
|
|
348
|
+
this.contentType = "application/json";
|
|
349
|
+
this.accept = "application/json";
|
|
350
|
+
this.inputSchema = initializeLeadInputSchema;
|
|
351
|
+
this.outputSchema = initializeLeadResponseSchema;
|
|
352
|
+
this.querySchema = initializeLeadQuerySchema;
|
|
353
|
+
this.headersSchema = void 0;
|
|
354
|
+
this.leadId = leadId;
|
|
355
|
+
}
|
|
356
|
+
getPath() {
|
|
357
|
+
return `/leads/${this.leadId}/initialize`;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
// src/requests/leads/UpdateLead.ts
|
|
362
|
+
var import_sdk_js_core7 = require("@deliverart/sdk-js-core");
|
|
363
|
+
var updateLeadInputSchema = writableLeadSchema.partial();
|
|
364
|
+
var updateLeadResponseSchema = leadDetailsSchema;
|
|
365
|
+
var UpdateLead = class extends import_sdk_js_core7.AbstractApiRequest {
|
|
366
|
+
constructor(leadId, input) {
|
|
367
|
+
super(input);
|
|
368
|
+
this.method = "PATCH";
|
|
369
|
+
this.contentType = "application/merge-patch+json";
|
|
370
|
+
this.accept = "application/json";
|
|
371
|
+
this.inputSchema = updateLeadInputSchema;
|
|
372
|
+
this.outputSchema = updateLeadResponseSchema;
|
|
373
|
+
this.querySchema = void 0;
|
|
374
|
+
this.headersSchema = void 0;
|
|
375
|
+
this.leadId = leadId;
|
|
376
|
+
}
|
|
377
|
+
getPath() {
|
|
378
|
+
return `/leads/${this.leadId}`;
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
382
|
+
0 && (module.exports = {
|
|
383
|
+
CreateLead,
|
|
384
|
+
DeleteLead,
|
|
385
|
+
GenerateLeadApiToken,
|
|
386
|
+
GetLeadDetails,
|
|
387
|
+
GetLeads,
|
|
388
|
+
InitializeLead,
|
|
389
|
+
UpdateLead,
|
|
390
|
+
createLeadInputSchema,
|
|
391
|
+
createLeadResponseSchema,
|
|
392
|
+
deleteLeadInputSchema,
|
|
393
|
+
deleteLeadResponseSchema,
|
|
394
|
+
generateLeadApiTokenInputSchema,
|
|
395
|
+
generateLeadApiTokenResponseSchema,
|
|
396
|
+
getLeadDetailsInputSchema,
|
|
397
|
+
getLeadDetailsResponseSchema,
|
|
398
|
+
getLeadsInputSchema,
|
|
399
|
+
getLeadsQuerySchema,
|
|
400
|
+
getLeadsResponseSchema,
|
|
401
|
+
initializeLeadInputSchema,
|
|
402
|
+
initializeLeadQuerySchema,
|
|
403
|
+
initializeLeadResponseSchema,
|
|
404
|
+
leadCompletionStepSchema,
|
|
405
|
+
leadCompletionSteps,
|
|
406
|
+
leadDetailsSchema,
|
|
407
|
+
leadIntegrationsStatsSchema,
|
|
408
|
+
leadIriSchema,
|
|
409
|
+
leadListItemSchema,
|
|
410
|
+
leadNullableIriSchema,
|
|
411
|
+
leadSchema,
|
|
412
|
+
leadStatusSchema,
|
|
413
|
+
leadStatuses,
|
|
414
|
+
leadsQuerySchema,
|
|
415
|
+
updateLeadInputSchema,
|
|
416
|
+
updateLeadResponseSchema,
|
|
417
|
+
writableCreateLeadSchema,
|
|
418
|
+
writableLeadIntegrationSchema,
|
|
419
|
+
writableLeadSchema
|
|
420
|
+
});
|