@deliverart/sdk-js-integration-types 2.25.2 → 2.26.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 +47 -0
- package/dist/index.cjs +325 -8
- package/dist/index.d.cts +1410 -19
- package/dist/index.d.ts +1410 -19
- package/dist/index.js +285 -5
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -5,3 +5,50 @@ Shared integration type and Zod schema package for the DeliverArt JavaScript SDK
|
|
|
5
5
|
Use this package when another SDK package needs integration enum values, IRI schemas,
|
|
6
6
|
activatable integration schemas, or service-specific integration data schemas without
|
|
7
7
|
depending on `@deliverart/sdk-js-integration`.
|
|
8
|
+
|
|
9
|
+
## Elephant Contracts
|
|
10
|
+
|
|
11
|
+
The package exports Elephant service, lifecycle, health, catalog, credential-mode, and
|
|
12
|
+
Restaurant-membership enums together with typed IRIs. It also exports
|
|
13
|
+
`integrationElephantDataSchema` for lead and activation request payloads.
|
|
14
|
+
Catalog import status, step, and resource-error enums are exported for consumers that
|
|
15
|
+
render the asynchronous manual import without depending on the request package.
|
|
16
|
+
|
|
17
|
+
Managed provisioning requires one or more Restaurant definitions and strips client-supplied
|
|
18
|
+
`tenantId`, `appId`, and `personalAccessToken` values because Deliverart resolves them.
|
|
19
|
+
Provided provisioning requires all three fields. Every Restaurant
|
|
20
|
+
must use `delivery` or `collection` and include both the `application` and `elephant`
|
|
21
|
+
catalog channels. Supported platforms are `migros_yemek`, `trendyol_go_meal`, `fuudy`,
|
|
22
|
+
`getir`, and `yemeksepeti`; when platform credentials are supplied, the selected
|
|
23
|
+
platform's complete authentication object is required.
|
|
24
|
+
|
|
25
|
+
`salesModeId` is optional. Omit it when the Restaurant should use Deliverart base
|
|
26
|
+
catalog prices; `categoryId` remains required for runtime creation of unmapped items.
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { integrationElephantDataSchema } from '@deliverart/sdk-js-integration-types'
|
|
30
|
+
|
|
31
|
+
const payload = integrationElephantDataSchema.parse({
|
|
32
|
+
credentialMode: 'managed',
|
|
33
|
+
restaurants: [
|
|
34
|
+
{
|
|
35
|
+
name: 'Restaurant Centre',
|
|
36
|
+
platform: 'migros_yemek',
|
|
37
|
+
platformRestaurantId: 'restaurant-123',
|
|
38
|
+
platformChainId: 'group-456',
|
|
39
|
+
authentication: {
|
|
40
|
+
secret_key: '12345678901234567890123456789012',
|
|
41
|
+
x_api_key: 'write-only-platform-key',
|
|
42
|
+
store_id: 'restaurant-123',
|
|
43
|
+
store_group_id: 'group-456',
|
|
44
|
+
},
|
|
45
|
+
categoryId: '20c71a6a-c924-42e0-9078-e3f672704dbb',
|
|
46
|
+
defaultTaxRate: 10,
|
|
47
|
+
channels: ['application', 'elephant'],
|
|
48
|
+
orderType: 'delivery',
|
|
49
|
+
defaultPreparationTime: 15,
|
|
50
|
+
acceptanceTimeout: 5,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
})
|
|
54
|
+
```
|
package/dist/index.cjs
CHANGED
|
@@ -114,6 +114,39 @@ __export(index_exports, {
|
|
|
114
114
|
integrationEcommerceOrderingModeSchema: () => integrationEcommerceOrderingModeSchema,
|
|
115
115
|
integrationEcommerceOrderingModes: () => integrationEcommerceOrderingModes,
|
|
116
116
|
integrationEcommerceThemeSchema: () => integrationEcommerceThemeSchema,
|
|
117
|
+
integrationElephantCatalogImportResourceTypeSchema: () => integrationElephantCatalogImportResourceTypeSchema,
|
|
118
|
+
integrationElephantCatalogImportResourceTypes: () => integrationElephantCatalogImportResourceTypes,
|
|
119
|
+
integrationElephantCatalogImportStatusSchema: () => integrationElephantCatalogImportStatusSchema,
|
|
120
|
+
integrationElephantCatalogImportStatuses: () => integrationElephantCatalogImportStatuses,
|
|
121
|
+
integrationElephantCatalogImportStepSchema: () => integrationElephantCatalogImportStepSchema,
|
|
122
|
+
integrationElephantCatalogImportSteps: () => integrationElephantCatalogImportSteps,
|
|
123
|
+
integrationElephantCatalogRoleSchema: () => integrationElephantCatalogRoleSchema,
|
|
124
|
+
integrationElephantCatalogRoles: () => integrationElephantCatalogRoles,
|
|
125
|
+
integrationElephantCatalogSideSchema: () => integrationElephantCatalogSideSchema,
|
|
126
|
+
integrationElephantCatalogSides: () => integrationElephantCatalogSides,
|
|
127
|
+
integrationElephantCatalogStatusSchema: () => integrationElephantCatalogStatusSchema,
|
|
128
|
+
integrationElephantCatalogStatuses: () => integrationElephantCatalogStatuses,
|
|
129
|
+
integrationElephantCredentialModeSchema: () => integrationElephantCredentialModeSchema,
|
|
130
|
+
integrationElephantCredentialModes: () => integrationElephantCredentialModes,
|
|
131
|
+
integrationElephantDataSchema: () => integrationElephantDataSchema,
|
|
132
|
+
integrationElephantFuudyAuthenticationSchema: () => integrationElephantFuudyAuthenticationSchema,
|
|
133
|
+
integrationElephantGetirAuthenticationSchema: () => integrationElephantGetirAuthenticationSchema,
|
|
134
|
+
integrationElephantIriSchema: () => integrationElephantIriSchema,
|
|
135
|
+
integrationElephantMigrosYemekAuthenticationSchema: () => integrationElephantMigrosYemekAuthenticationSchema,
|
|
136
|
+
integrationElephantNullableIriSchema: () => integrationElephantNullableIriSchema,
|
|
137
|
+
integrationElephantOrderReleaseStatusSchema: () => integrationElephantOrderReleaseStatusSchema,
|
|
138
|
+
integrationElephantOrderReleaseStatuses: () => integrationElephantOrderReleaseStatuses,
|
|
139
|
+
integrationElephantPlatformSchema: () => integrationElephantPlatformSchema,
|
|
140
|
+
integrationElephantProvisioningStepSchema: () => integrationElephantProvisioningStepSchema,
|
|
141
|
+
integrationElephantProvisioningSteps: () => integrationElephantProvisioningSteps,
|
|
142
|
+
integrationElephantRestaurantAuthenticationSchema: () => integrationElephantRestaurantAuthenticationSchema,
|
|
143
|
+
integrationElephantRestaurantDataSchema: () => integrationElephantRestaurantDataSchema,
|
|
144
|
+
integrationElephantRestaurantIriSchema: () => integrationElephantRestaurantIriSchema,
|
|
145
|
+
integrationElephantRestaurantNullableIriSchema: () => integrationElephantRestaurantNullableIriSchema,
|
|
146
|
+
integrationElephantRestaurantStatusSchema: () => integrationElephantRestaurantStatusSchema,
|
|
147
|
+
integrationElephantRestaurantStatuses: () => integrationElephantRestaurantStatuses,
|
|
148
|
+
integrationElephantTrendyolGoMealAuthenticationSchema: () => integrationElephantTrendyolGoMealAuthenticationSchema,
|
|
149
|
+
integrationElephantYemeksepetiAuthenticationSchema: () => integrationElephantYemeksepetiAuthenticationSchema,
|
|
117
150
|
integrationGlovoBulkUpdateIriSchema: () => integrationGlovoBulkUpdateIriSchema,
|
|
118
151
|
integrationGlovoBulkUpdateStatusSchema: () => integrationGlovoBulkUpdateStatusSchema,
|
|
119
152
|
integrationGlovoBulkUpdateStatuses: () => integrationGlovoBulkUpdateStatuses,
|
|
@@ -132,6 +165,8 @@ __export(index_exports, {
|
|
|
132
165
|
integrationGlovoSyncStatuses: () => integrationGlovoSyncStatuses,
|
|
133
166
|
integrationGlovoWebhookEventTypeSchema: () => integrationGlovoWebhookEventTypeSchema,
|
|
134
167
|
integrationGlovoWebhookEventTypes: () => integrationGlovoWebhookEventTypes,
|
|
168
|
+
integrationHealthStatusSchema: () => integrationHealthStatusSchema,
|
|
169
|
+
integrationHealthStatuses: () => integrationHealthStatuses,
|
|
135
170
|
integrationIriSchema: () => integrationIriSchema,
|
|
136
171
|
integrationIssueCodeSchema: () => integrationIssueCodeSchema,
|
|
137
172
|
integrationIssueCodes: () => integrationIssueCodes,
|
|
@@ -162,6 +197,8 @@ __export(index_exports, {
|
|
|
162
197
|
integrationPathSchemas: () => integrationPathSchemas,
|
|
163
198
|
integrationProviderSchema: () => integrationProviderSchema,
|
|
164
199
|
integrationProviders: () => integrationProviders,
|
|
200
|
+
integrationRequestLogOutcomeSchema: () => integrationRequestLogOutcomeSchema,
|
|
201
|
+
integrationRequestLogOutcomes: () => integrationRequestLogOutcomes,
|
|
165
202
|
integrationServiceDataSchema: () => integrationServiceDataSchema,
|
|
166
203
|
integrationServiceSchema: () => integrationServiceSchema,
|
|
167
204
|
integrationServices: () => integrationServices,
|
|
@@ -222,10 +259,11 @@ __export(index_exports, {
|
|
|
222
259
|
module.exports = __toCommonJS(index_exports);
|
|
223
260
|
|
|
224
261
|
// src/activatable-integration.ts
|
|
225
|
-
var
|
|
262
|
+
var import_sdk_js_global_types4 = require("@deliverart/sdk-js-global-types");
|
|
226
263
|
var import_zod5 = require("zod");
|
|
227
264
|
|
|
228
265
|
// src/activatable-integration-data-schemas.ts
|
|
266
|
+
var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
|
|
229
267
|
var import_zod3 = require("zod");
|
|
230
268
|
|
|
231
269
|
// src/tilby-sync-settings.ts
|
|
@@ -260,8 +298,16 @@ var integrationTilbyEditableSyncSettingsSchema = integrationTilbySyncSettingsSch
|
|
|
260
298
|
// src/types.ts
|
|
261
299
|
var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
|
|
262
300
|
var import_zod2 = require("zod");
|
|
263
|
-
var integrationStatuses = [
|
|
301
|
+
var integrationStatuses = [
|
|
302
|
+
"pending",
|
|
303
|
+
"provisioning",
|
|
304
|
+
"paused",
|
|
305
|
+
"active",
|
|
306
|
+
"deleting"
|
|
307
|
+
];
|
|
264
308
|
var integrationStatusSchema = import_zod2.z.enum(integrationStatuses);
|
|
309
|
+
var integrationHealthStatuses = ["unknown", "healthy", "degraded", "failed"];
|
|
310
|
+
var integrationHealthStatusSchema = import_zod2.z.enum(integrationHealthStatuses);
|
|
265
311
|
var integrationProviders = ["deliverart", "cassa_in_cloud"];
|
|
266
312
|
var integrationProviderSchema = import_zod2.z.enum(integrationProviders);
|
|
267
313
|
var integrationServices = [
|
|
@@ -271,11 +317,99 @@ var integrationServices = [
|
|
|
271
317
|
"cassa_in_cloud",
|
|
272
318
|
"tilby",
|
|
273
319
|
"kitchen",
|
|
274
|
-
"ecommerce"
|
|
320
|
+
"ecommerce",
|
|
321
|
+
"elephant"
|
|
275
322
|
];
|
|
276
323
|
var integrationServiceSchema = import_zod2.z.enum(integrationServices);
|
|
277
|
-
var exclusiveIntegrationServices = [
|
|
324
|
+
var exclusiveIntegrationServices = [
|
|
325
|
+
"kitchen",
|
|
326
|
+
"cassa_in_cloud",
|
|
327
|
+
"tilby",
|
|
328
|
+
"ecommerce",
|
|
329
|
+
"elephant"
|
|
330
|
+
];
|
|
278
331
|
var exclusiveIntegrationServiceSchema = import_zod2.z.enum(exclusiveIntegrationServices);
|
|
332
|
+
var integrationElephantCredentialModes = ["managed", "provided"];
|
|
333
|
+
var integrationElephantCredentialModeSchema = import_zod2.z.enum(integrationElephantCredentialModes);
|
|
334
|
+
var integrationElephantRestaurantStatuses = [
|
|
335
|
+
"pending",
|
|
336
|
+
"provisioning",
|
|
337
|
+
"active",
|
|
338
|
+
"paused",
|
|
339
|
+
"removing"
|
|
340
|
+
];
|
|
341
|
+
var integrationElephantRestaurantStatusSchema = import_zod2.z.enum(
|
|
342
|
+
integrationElephantRestaurantStatuses
|
|
343
|
+
);
|
|
344
|
+
var integrationElephantCatalogStatuses = [
|
|
345
|
+
"unknown",
|
|
346
|
+
"refreshing",
|
|
347
|
+
"ready",
|
|
348
|
+
"stale",
|
|
349
|
+
"unsupported",
|
|
350
|
+
"failed"
|
|
351
|
+
];
|
|
352
|
+
var integrationElephantCatalogStatusSchema = import_zod2.z.enum(integrationElephantCatalogStatuses);
|
|
353
|
+
var integrationElephantCatalogImportStatuses = [
|
|
354
|
+
"pending",
|
|
355
|
+
"running",
|
|
356
|
+
"completed",
|
|
357
|
+
"completed_with_errors",
|
|
358
|
+
"failed"
|
|
359
|
+
];
|
|
360
|
+
var integrationElephantCatalogImportStatusSchema = import_zod2.z.enum(
|
|
361
|
+
integrationElephantCatalogImportStatuses
|
|
362
|
+
);
|
|
363
|
+
var integrationElephantCatalogImportSteps = [
|
|
364
|
+
"queued",
|
|
365
|
+
"refreshing_snapshot",
|
|
366
|
+
"importing_products",
|
|
367
|
+
"completed"
|
|
368
|
+
];
|
|
369
|
+
var integrationElephantCatalogImportStepSchema = import_zod2.z.enum(
|
|
370
|
+
integrationElephantCatalogImportSteps
|
|
371
|
+
);
|
|
372
|
+
var integrationElephantCatalogImportResourceTypes = [
|
|
373
|
+
"process",
|
|
374
|
+
"product",
|
|
375
|
+
"option_group",
|
|
376
|
+
"option",
|
|
377
|
+
"variant"
|
|
378
|
+
];
|
|
379
|
+
var integrationElephantCatalogImportResourceTypeSchema = import_zod2.z.enum(
|
|
380
|
+
integrationElephantCatalogImportResourceTypes
|
|
381
|
+
);
|
|
382
|
+
var integrationElephantProvisioningSteps = [
|
|
383
|
+
"pending",
|
|
384
|
+
"credentials",
|
|
385
|
+
"tenant",
|
|
386
|
+
"app",
|
|
387
|
+
"api_token",
|
|
388
|
+
"app_configuration",
|
|
389
|
+
"app_connection_test",
|
|
390
|
+
"restaurants",
|
|
391
|
+
"catalog",
|
|
392
|
+
"complete",
|
|
393
|
+
"deprovisioning"
|
|
394
|
+
];
|
|
395
|
+
var integrationElephantProvisioningStepSchema = import_zod2.z.enum(
|
|
396
|
+
integrationElephantProvisioningSteps
|
|
397
|
+
);
|
|
398
|
+
var integrationElephantCatalogRoles = ["product", "option", "variant"];
|
|
399
|
+
var integrationElephantCatalogRoleSchema = import_zod2.z.enum(integrationElephantCatalogRoles);
|
|
400
|
+
var integrationElephantCatalogSides = ["platform", "app"];
|
|
401
|
+
var integrationElephantCatalogSideSchema = import_zod2.z.enum(integrationElephantCatalogSides);
|
|
402
|
+
var integrationElephantOrderReleaseStatuses = [
|
|
403
|
+
"preparing",
|
|
404
|
+
"ready",
|
|
405
|
+
"released",
|
|
406
|
+
"failed"
|
|
407
|
+
];
|
|
408
|
+
var integrationElephantOrderReleaseStatusSchema = import_zod2.z.enum(
|
|
409
|
+
integrationElephantOrderReleaseStatuses
|
|
410
|
+
);
|
|
411
|
+
var integrationRequestLogOutcomes = ["success", "client_error", "server_error"];
|
|
412
|
+
var integrationRequestLogOutcomeSchema = import_zod2.z.enum(integrationRequestLogOutcomes);
|
|
279
413
|
var integrationClientLogRequestMethods = ["DELETE", "GET", "PATCH", "POST", "PUT"];
|
|
280
414
|
var integrationClientLogRequestMethodSchema = import_zod2.z.enum(integrationClientLogRequestMethods);
|
|
281
415
|
var integrationKitchenViewModes = ["column"];
|
|
@@ -612,6 +746,14 @@ var integrationTilbyIriSchema = integrationPathSchemas.tilby.iriSchema;
|
|
|
612
746
|
var integrationTilbyNullableIriSchema = integrationPathSchemas.tilby.iriNullableSchema;
|
|
613
747
|
var integrationEcommerceIriSchema = integrationPathSchemas.ecommerce.iriSchema;
|
|
614
748
|
var integrationEcommerceNullableIriSchema = integrationPathSchemas.ecommerce.iriNullableSchema;
|
|
749
|
+
var integrationElephantIriSchema = integrationPathSchemas.elephant.iriSchema;
|
|
750
|
+
var integrationElephantNullableIriSchema = integrationPathSchemas.elephant.iriNullableSchema;
|
|
751
|
+
var integrationElephantRestaurantIriSchema = (0, import_sdk_js_global_types2.iriSchema)(
|
|
752
|
+
"/integrations/elephant/:id/restaurants/:membershipId"
|
|
753
|
+
);
|
|
754
|
+
var integrationElephantRestaurantNullableIriSchema = (0, import_sdk_js_global_types2.iriNullableSchema)(
|
|
755
|
+
"/integrations/elephant/:id/restaurants/:membershipId"
|
|
756
|
+
);
|
|
615
757
|
var integrationIriSchema = (0, import_sdk_js_global_types2.iriSchema)("/integrations/:id");
|
|
616
758
|
var integrationNullableIriSchema = (0, import_sdk_js_global_types2.iriNullableSchema)("/integrations/:id");
|
|
617
759
|
var integrationDetailsPathPatterns = [
|
|
@@ -868,6 +1010,133 @@ var integrationEcommerceDataSchema = import_zod3.z.object({
|
|
|
868
1010
|
heroImage: optionalCleanField(import_zod3.z.string().trim().min(1).max(80)),
|
|
869
1011
|
theme: optionalCleanField(integrationEcommerceThemeSchema)
|
|
870
1012
|
});
|
|
1013
|
+
var integrationElephantPlatformSchema = import_zod3.z.enum([
|
|
1014
|
+
"migros_yemek",
|
|
1015
|
+
"yemeksepeti",
|
|
1016
|
+
"getir",
|
|
1017
|
+
"trendyol_go_meal",
|
|
1018
|
+
"fuudy"
|
|
1019
|
+
]);
|
|
1020
|
+
var elephantPlatformIdentifierSchema = import_zod3.z.union([import_zod3.z.string().trim().min(1), import_zod3.z.number().int()]);
|
|
1021
|
+
var elephantPlatformBaseUrlSchema = import_zod3.z.url().optional();
|
|
1022
|
+
var integrationElephantMigrosYemekAuthenticationSchema = import_zod3.z.object({
|
|
1023
|
+
secret_key: import_zod3.z.string().length(32, "authentication.secret_key.length"),
|
|
1024
|
+
x_api_key: import_zod3.z.string().trim().min(1, "authentication.x_api_key.required"),
|
|
1025
|
+
store_id: elephantPlatformIdentifierSchema,
|
|
1026
|
+
store_group_id: elephantPlatformIdentifierSchema,
|
|
1027
|
+
base_url: elephantPlatformBaseUrlSchema
|
|
1028
|
+
}).strict();
|
|
1029
|
+
var integrationElephantTrendyolGoMealAuthenticationSchema = import_zod3.z.object({
|
|
1030
|
+
api_key: import_zod3.z.string().trim().min(1, "authentication.api_key.required"),
|
|
1031
|
+
api_secret: import_zod3.z.string().trim().min(1, "authentication.api_secret.required"),
|
|
1032
|
+
shop_id: elephantPlatformIdentifierSchema,
|
|
1033
|
+
seller_id: elephantPlatformIdentifierSchema,
|
|
1034
|
+
base_url: elephantPlatformBaseUrlSchema
|
|
1035
|
+
}).strict();
|
|
1036
|
+
var integrationElephantFuudyAuthenticationSchema = import_zod3.z.object({
|
|
1037
|
+
app_secret_key: import_zod3.z.string().trim().min(1, "authentication.app_secret_key.required"),
|
|
1038
|
+
rest_secret_key: import_zod3.z.string().trim().min(1, "authentication.rest_secret_key.required"),
|
|
1039
|
+
base_url: elephantPlatformBaseUrlSchema
|
|
1040
|
+
}).strict();
|
|
1041
|
+
var integrationElephantGetirAuthenticationSchema = import_zod3.z.object({
|
|
1042
|
+
app_secret_key: import_zod3.z.string().trim().min(1, "authentication.app_secret_key.required"),
|
|
1043
|
+
restaurant_secret_key: import_zod3.z.string().trim().min(1, "authentication.restaurant_secret_key.required"),
|
|
1044
|
+
base_url: elephantPlatformBaseUrlSchema
|
|
1045
|
+
}).strict();
|
|
1046
|
+
var integrationElephantYemeksepetiAuthenticationSchema = import_zod3.z.object({
|
|
1047
|
+
username: import_zod3.z.string().trim().min(1, "authentication.username.required"),
|
|
1048
|
+
password: import_zod3.z.string().min(1, "authentication.password.required"),
|
|
1049
|
+
chain_code: import_zod3.z.string().trim().min(1, "authentication.chain_code.required"),
|
|
1050
|
+
remote_id: import_zod3.z.string().trim().min(1, "authentication.remote_id.required"),
|
|
1051
|
+
webhook_token: optionalCleanField(import_zod3.z.string().trim().min(1)),
|
|
1052
|
+
base_url: elephantPlatformBaseUrlSchema
|
|
1053
|
+
}).strict();
|
|
1054
|
+
var integrationElephantRestaurantAuthenticationSchema = import_zod3.z.union([
|
|
1055
|
+
integrationElephantMigrosYemekAuthenticationSchema,
|
|
1056
|
+
integrationElephantTrendyolGoMealAuthenticationSchema,
|
|
1057
|
+
integrationElephantFuudyAuthenticationSchema,
|
|
1058
|
+
integrationElephantGetirAuthenticationSchema,
|
|
1059
|
+
integrationElephantYemeksepetiAuthenticationSchema
|
|
1060
|
+
]);
|
|
1061
|
+
var integrationElephantRestaurantCommonSchema = import_zod3.z.object({
|
|
1062
|
+
name: import_zod3.z.string().trim().min(1, "name.required").max(255),
|
|
1063
|
+
platformRestaurantId: import_zod3.z.string().trim().min(1, "platformRestaurantId.required").max(255),
|
|
1064
|
+
platformChainId: optionalCleanField(import_zod3.z.string().trim().max(255)),
|
|
1065
|
+
salesModeId: optionalCleanField(import_zod3.z.string().trim().min(1, "salesModeId.required")),
|
|
1066
|
+
categoryId: import_zod3.z.string().trim().min(1, "categoryId.required"),
|
|
1067
|
+
defaultTaxRate: import_zod3.z.coerce.number().min(0).max(100),
|
|
1068
|
+
channels: import_zod3.z.array(import_sdk_js_global_types3.menuChannelSchema).min(2),
|
|
1069
|
+
orderType: import_sdk_js_global_types3.orderTypeSchema.refine((value) => value !== "kitchen", "orderType.invalid"),
|
|
1070
|
+
defaultPreparationTime: import_zod3.z.coerce.number().int().min(0).max(240),
|
|
1071
|
+
acceptanceTimeout: import_zod3.z.coerce.number().int().min(0).max(120)
|
|
1072
|
+
});
|
|
1073
|
+
var integrationElephantRestaurantDataSchema = import_zod3.z.discriminatedUnion("platform", [
|
|
1074
|
+
integrationElephantRestaurantCommonSchema.extend({
|
|
1075
|
+
platform: import_zod3.z.literal("migros_yemek"),
|
|
1076
|
+
authentication: integrationElephantMigrosYemekAuthenticationSchema.nullish()
|
|
1077
|
+
}),
|
|
1078
|
+
integrationElephantRestaurantCommonSchema.extend({
|
|
1079
|
+
platform: import_zod3.z.literal("trendyol_go_meal"),
|
|
1080
|
+
authentication: integrationElephantTrendyolGoMealAuthenticationSchema.nullish()
|
|
1081
|
+
}),
|
|
1082
|
+
integrationElephantRestaurantCommonSchema.extend({
|
|
1083
|
+
platform: import_zod3.z.literal("fuudy"),
|
|
1084
|
+
authentication: integrationElephantFuudyAuthenticationSchema.nullish()
|
|
1085
|
+
}),
|
|
1086
|
+
integrationElephantRestaurantCommonSchema.extend({
|
|
1087
|
+
platform: import_zod3.z.literal("getir"),
|
|
1088
|
+
authentication: integrationElephantGetirAuthenticationSchema.nullish()
|
|
1089
|
+
}),
|
|
1090
|
+
integrationElephantRestaurantCommonSchema.extend({
|
|
1091
|
+
platform: import_zod3.z.literal("yemeksepeti"),
|
|
1092
|
+
authentication: integrationElephantYemeksepetiAuthenticationSchema.nullish()
|
|
1093
|
+
})
|
|
1094
|
+
]).superRefine((value, context) => {
|
|
1095
|
+
for (const requiredChannel of ["application", "elephant"]) {
|
|
1096
|
+
if (!value.channels.includes(requiredChannel)) {
|
|
1097
|
+
context.addIssue({
|
|
1098
|
+
code: "custom",
|
|
1099
|
+
message: `channels.${requiredChannel}.required`,
|
|
1100
|
+
path: ["channels"],
|
|
1101
|
+
input: value.channels
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (!value.authentication) return;
|
|
1106
|
+
const authentication = value.authentication;
|
|
1107
|
+
const restaurantAuthenticationField = value.platform === "migros_yemek" ? "store_id" : value.platform === "trendyol_go_meal" ? "shop_id" : value.platform === "yemeksepeti" ? "remote_id" : null;
|
|
1108
|
+
const chainAuthenticationField = value.platform === "migros_yemek" ? "store_group_id" : value.platform === "yemeksepeti" ? "chain_code" : null;
|
|
1109
|
+
if (restaurantAuthenticationField && String(authentication[restaurantAuthenticationField]) !== value.platformRestaurantId) {
|
|
1110
|
+
context.addIssue({
|
|
1111
|
+
code: "custom",
|
|
1112
|
+
message: `authentication.${restaurantAuthenticationField}.mismatch`,
|
|
1113
|
+
path: ["authentication", restaurantAuthenticationField],
|
|
1114
|
+
input: authentication[restaurantAuthenticationField]
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
if (chainAuthenticationField && value.platformChainId && String(authentication[chainAuthenticationField]) !== value.platformChainId) {
|
|
1118
|
+
context.addIssue({
|
|
1119
|
+
code: "custom",
|
|
1120
|
+
message: `authentication.${chainAuthenticationField}.mismatch`,
|
|
1121
|
+
path: ["authentication", chainAuthenticationField],
|
|
1122
|
+
input: authentication[chainAuthenticationField]
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
var integrationElephantDataCommonSchema = import_zod3.z.object({
|
|
1127
|
+
restaurants: import_zod3.z.array(integrationElephantRestaurantDataSchema).min(1, "restaurants.required")
|
|
1128
|
+
});
|
|
1129
|
+
var integrationElephantDataSchema = import_zod3.z.discriminatedUnion("credentialMode", [
|
|
1130
|
+
integrationElephantDataCommonSchema.extend({
|
|
1131
|
+
credentialMode: integrationElephantCredentialModeSchema.extract(["managed"])
|
|
1132
|
+
}),
|
|
1133
|
+
integrationElephantDataCommonSchema.extend({
|
|
1134
|
+
credentialMode: integrationElephantCredentialModeSchema.extract(["provided"]),
|
|
1135
|
+
tenantId: import_zod3.z.string().trim().min(1, "tenantId.required").max(36),
|
|
1136
|
+
appId: import_zod3.z.string().trim().min(1, "appId.required").max(36),
|
|
1137
|
+
personalAccessToken: import_zod3.z.string().trim().min(1, "personalAccessToken.required")
|
|
1138
|
+
})
|
|
1139
|
+
]);
|
|
871
1140
|
var integrationServiceDataSchema = import_zod3.z.discriminatedUnion("service", [
|
|
872
1141
|
import_zod3.z.object({
|
|
873
1142
|
service: import_zod3.z.literal("kitchen"),
|
|
@@ -896,6 +1165,10 @@ var integrationServiceDataSchema = import_zod3.z.discriminatedUnion("service", [
|
|
|
896
1165
|
import_zod3.z.object({
|
|
897
1166
|
service: import_zod3.z.literal("ecommerce"),
|
|
898
1167
|
data: integrationEcommerceDataSchema
|
|
1168
|
+
}),
|
|
1169
|
+
import_zod3.z.object({
|
|
1170
|
+
service: import_zod3.z.literal("elephant"),
|
|
1171
|
+
data: integrationElephantDataSchema
|
|
899
1172
|
})
|
|
900
1173
|
]);
|
|
901
1174
|
|
|
@@ -905,6 +1178,7 @@ var activatableIntegrationStatuses = [
|
|
|
905
1178
|
"waiting_for_user",
|
|
906
1179
|
"waiting_for_admin",
|
|
907
1180
|
"request_sent_partner",
|
|
1181
|
+
"provisioning",
|
|
908
1182
|
"active",
|
|
909
1183
|
"failed"
|
|
910
1184
|
];
|
|
@@ -923,7 +1197,8 @@ var activatableIntegrationBaseSchema = import_zod5.z.object({
|
|
|
923
1197
|
integrationJustEatIriSchema,
|
|
924
1198
|
integrationCassaInCloudIriSchema,
|
|
925
1199
|
integrationTilbyIriSchema,
|
|
926
|
-
integrationEcommerceIriSchema
|
|
1200
|
+
integrationEcommerceIriSchema,
|
|
1201
|
+
integrationElephantIriSchema
|
|
927
1202
|
]).nullable(),
|
|
928
1203
|
status: activatableIntegrationStatusSchema,
|
|
929
1204
|
healthStatus: activatableIntegrationHealthStatusSchema,
|
|
@@ -931,13 +1206,13 @@ var activatableIntegrationBaseSchema = import_zod5.z.object({
|
|
|
931
1206
|
name: import_zod5.z.string(),
|
|
932
1207
|
message: import_zod5.z.string().nullable(),
|
|
933
1208
|
internalNotes: import_zod5.z.string().nullish(),
|
|
934
|
-
createdAt:
|
|
935
|
-
updatedAt:
|
|
1209
|
+
createdAt: import_sdk_js_global_types4.datetimeSchema,
|
|
1210
|
+
updatedAt: import_sdk_js_global_types4.datetimeSchema,
|
|
936
1211
|
updates: import_zod5.z.array(
|
|
937
1212
|
import_zod5.z.object({
|
|
938
1213
|
status: activatableIntegrationStatusSchema,
|
|
939
1214
|
message: import_zod5.z.string().nullable(),
|
|
940
|
-
updatedAt:
|
|
1215
|
+
updatedAt: import_sdk_js_global_types4.datetimeSchema
|
|
941
1216
|
})
|
|
942
1217
|
).optional().default([])
|
|
943
1218
|
});
|
|
@@ -975,6 +1250,11 @@ var activatableIntegrationSchema = import_zod5.z.discriminatedUnion("service", [
|
|
|
975
1250
|
"ecommerce",
|
|
976
1251
|
integrationEcommerceDataSchema,
|
|
977
1252
|
integrationEcommerceNullableIriSchema
|
|
1253
|
+
),
|
|
1254
|
+
createIntegrationSchema(
|
|
1255
|
+
"elephant",
|
|
1256
|
+
integrationElephantDataSchema,
|
|
1257
|
+
integrationElephantNullableIriSchema
|
|
978
1258
|
)
|
|
979
1259
|
]);
|
|
980
1260
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1073,6 +1353,39 @@ var activatableIntegrationSchema = import_zod5.z.discriminatedUnion("service", [
|
|
|
1073
1353
|
integrationEcommerceOrderingModeSchema,
|
|
1074
1354
|
integrationEcommerceOrderingModes,
|
|
1075
1355
|
integrationEcommerceThemeSchema,
|
|
1356
|
+
integrationElephantCatalogImportResourceTypeSchema,
|
|
1357
|
+
integrationElephantCatalogImportResourceTypes,
|
|
1358
|
+
integrationElephantCatalogImportStatusSchema,
|
|
1359
|
+
integrationElephantCatalogImportStatuses,
|
|
1360
|
+
integrationElephantCatalogImportStepSchema,
|
|
1361
|
+
integrationElephantCatalogImportSteps,
|
|
1362
|
+
integrationElephantCatalogRoleSchema,
|
|
1363
|
+
integrationElephantCatalogRoles,
|
|
1364
|
+
integrationElephantCatalogSideSchema,
|
|
1365
|
+
integrationElephantCatalogSides,
|
|
1366
|
+
integrationElephantCatalogStatusSchema,
|
|
1367
|
+
integrationElephantCatalogStatuses,
|
|
1368
|
+
integrationElephantCredentialModeSchema,
|
|
1369
|
+
integrationElephantCredentialModes,
|
|
1370
|
+
integrationElephantDataSchema,
|
|
1371
|
+
integrationElephantFuudyAuthenticationSchema,
|
|
1372
|
+
integrationElephantGetirAuthenticationSchema,
|
|
1373
|
+
integrationElephantIriSchema,
|
|
1374
|
+
integrationElephantMigrosYemekAuthenticationSchema,
|
|
1375
|
+
integrationElephantNullableIriSchema,
|
|
1376
|
+
integrationElephantOrderReleaseStatusSchema,
|
|
1377
|
+
integrationElephantOrderReleaseStatuses,
|
|
1378
|
+
integrationElephantPlatformSchema,
|
|
1379
|
+
integrationElephantProvisioningStepSchema,
|
|
1380
|
+
integrationElephantProvisioningSteps,
|
|
1381
|
+
integrationElephantRestaurantAuthenticationSchema,
|
|
1382
|
+
integrationElephantRestaurantDataSchema,
|
|
1383
|
+
integrationElephantRestaurantIriSchema,
|
|
1384
|
+
integrationElephantRestaurantNullableIriSchema,
|
|
1385
|
+
integrationElephantRestaurantStatusSchema,
|
|
1386
|
+
integrationElephantRestaurantStatuses,
|
|
1387
|
+
integrationElephantTrendyolGoMealAuthenticationSchema,
|
|
1388
|
+
integrationElephantYemeksepetiAuthenticationSchema,
|
|
1076
1389
|
integrationGlovoBulkUpdateIriSchema,
|
|
1077
1390
|
integrationGlovoBulkUpdateStatusSchema,
|
|
1078
1391
|
integrationGlovoBulkUpdateStatuses,
|
|
@@ -1091,6 +1404,8 @@ var activatableIntegrationSchema = import_zod5.z.discriminatedUnion("service", [
|
|
|
1091
1404
|
integrationGlovoSyncStatuses,
|
|
1092
1405
|
integrationGlovoWebhookEventTypeSchema,
|
|
1093
1406
|
integrationGlovoWebhookEventTypes,
|
|
1407
|
+
integrationHealthStatusSchema,
|
|
1408
|
+
integrationHealthStatuses,
|
|
1094
1409
|
integrationIriSchema,
|
|
1095
1410
|
integrationIssueCodeSchema,
|
|
1096
1411
|
integrationIssueCodes,
|
|
@@ -1121,6 +1436,8 @@ var activatableIntegrationSchema = import_zod5.z.discriminatedUnion("service", [
|
|
|
1121
1436
|
integrationPathSchemas,
|
|
1122
1437
|
integrationProviderSchema,
|
|
1123
1438
|
integrationProviders,
|
|
1439
|
+
integrationRequestLogOutcomeSchema,
|
|
1440
|
+
integrationRequestLogOutcomes,
|
|
1124
1441
|
integrationServiceDataSchema,
|
|
1125
1442
|
integrationServiceSchema,
|
|
1126
1443
|
integrationServices,
|