@deliverart/sdk-js-integration-diagnostics 0.0.0-stage → 2.40.0-dev.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.
package/dist/index.cjs ADDED
@@ -0,0 +1,2647 @@
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
+ CloseDiagnosticOperation: () => CloseDiagnosticOperation,
24
+ GetDiagnosticAssistanceDetails: () => GetDiagnosticAssistanceDetails,
25
+ GetDiagnosticAssistanceHistory: () => GetDiagnosticAssistanceHistory,
26
+ GetDiagnosticAssistanceInternal: () => GetDiagnosticAssistanceInternal,
27
+ GetDiagnosticAssistanceQueue: () => GetDiagnosticAssistanceQueue,
28
+ GetDiagnosticAttemptHistory: () => GetDiagnosticAttemptHistory,
29
+ GetDiagnosticOperationDetails: () => GetDiagnosticOperationDetails,
30
+ GetDiagnosticOverview: () => GetDiagnosticOverview,
31
+ GetDiagnosticProblemDetails: () => GetDiagnosticProblemDetails,
32
+ GetDiagnosticProblemQueue: () => GetDiagnosticProblemQueue,
33
+ GetDiagnosticProblems: () => GetDiagnosticProblems,
34
+ GetDiagnosticRecoveryHistory: () => GetDiagnosticRecoveryHistory,
35
+ GetDiagnosticRecoveryRequestDetails: () => GetDiagnosticRecoveryRequestDetails,
36
+ PreviewDiagnosticRecovery: () => PreviewDiagnosticRecovery,
37
+ ReplyDiagnosticAssistance: () => ReplyDiagnosticAssistance,
38
+ RequestDiagnosticAssistance: () => RequestDiagnosticAssistance,
39
+ RequestDiagnosticRecovery: () => RequestDiagnosticRecovery,
40
+ UpdateDiagnosticAssistance: () => UpdateDiagnosticAssistance,
41
+ VerifyDiagnosticProblem: () => VerifyDiagnosticProblem,
42
+ canCloseDiagnosticOperation: () => canCloseDiagnosticOperation,
43
+ canSelectDiagnosticOperation: () => canSelectDiagnosticOperation,
44
+ describeDiagnostic: () => describeDiagnostic,
45
+ describeDiagnosticActionAvailability: () => describeDiagnosticActionAvailability,
46
+ describeDiagnosticAttempt: () => describeDiagnosticAttempt,
47
+ describeDiagnosticOperation: () => describeDiagnosticOperation,
48
+ describeDiagnosticRecovery: () => describeDiagnosticRecovery,
49
+ describeDiagnosticRecoveryItem: () => describeDiagnosticRecoveryItem,
50
+ describeDiagnosticResourcePath: () => describeDiagnosticResourcePath,
51
+ describeDiagnosticScope: () => describeDiagnosticScope,
52
+ describeLocalDiagnostic: () => describeLocalDiagnostic,
53
+ describeVerification: () => describeVerification,
54
+ diagnosticAffectedOperationSchema: () => diagnosticAffectedOperationSchema,
55
+ diagnosticAssistanceEventSchema: () => diagnosticAssistanceEventSchema,
56
+ diagnosticAssistanceHistorySchema: () => diagnosticAssistanceHistorySchema,
57
+ diagnosticAssistanceInternalSchema: () => diagnosticAssistanceInternalSchema,
58
+ diagnosticAssistanceQuerySchema: () => diagnosticAssistanceQuerySchema,
59
+ diagnosticAssistanceQueueItemSchema: () => diagnosticAssistanceQueueItemSchema,
60
+ diagnosticAssistanceQueueQuerySchema: () => diagnosticAssistanceQueueQuerySchema,
61
+ diagnosticAssistanceReplyInputSchema: () => diagnosticAssistanceReplyInputSchema,
62
+ diagnosticAssistanceRequestInputSchema: () => diagnosticAssistanceRequestInputSchema,
63
+ diagnosticAssistanceSchema: () => diagnosticAssistanceSchema,
64
+ diagnosticAssistanceSummarySchema: () => diagnosticAssistanceSummarySchema,
65
+ diagnosticAssistanceUpdateInputSchema: () => diagnosticAssistanceUpdateInputSchema,
66
+ diagnosticAttemptHistoryQuerySchema: () => diagnosticAttemptHistoryQuerySchema,
67
+ diagnosticAttemptHistorySchema: () => diagnosticAttemptHistorySchema,
68
+ diagnosticAttemptSchema: () => diagnosticAttemptSchema,
69
+ diagnosticAttentionSchema: () => diagnosticAttentionSchema,
70
+ diagnosticCodeSchema: () => diagnosticCodeSchema,
71
+ diagnosticDateSchema: () => diagnosticDateSchema,
72
+ diagnosticFindingSchema: () => diagnosticFindingSchema,
73
+ diagnosticIdSchema: () => diagnosticIdSchema,
74
+ diagnosticInvalidationRevision: () => diagnosticInvalidationRevision,
75
+ diagnosticInvalidationSchema: () => diagnosticInvalidationSchema,
76
+ diagnosticManualClosureInputSchema: () => diagnosticManualClosureInputSchema,
77
+ diagnosticOperationActionsSchema: () => diagnosticOperationActionsSchema,
78
+ diagnosticOperationContextSchema: () => diagnosticOperationContextSchema,
79
+ diagnosticOperationSchema: () => diagnosticOperationSchema,
80
+ diagnosticOverviewSchema: () => diagnosticOverviewSchema,
81
+ diagnosticProblemPageQuerySchema: () => diagnosticProblemPageQuerySchema,
82
+ diagnosticProblemQueueItemSchema: () => diagnosticProblemQueueItemSchema,
83
+ diagnosticProblemQueueQuerySchema: () => diagnosticProblemQueueQuerySchema,
84
+ diagnosticProblemQueueSchema: () => diagnosticProblemQueueSchema,
85
+ diagnosticProblemSchema: () => diagnosticProblemSchema,
86
+ diagnosticProblemSummarySchema: () => diagnosticProblemSummarySchema,
87
+ diagnosticProblemsQuerySchema: () => diagnosticProblemsQuerySchema,
88
+ diagnosticRecoveryActionSchema: () => diagnosticRecoveryActionSchema,
89
+ diagnosticRecoveryHistoryItemSchema: () => diagnosticRecoveryHistoryItemSchema,
90
+ diagnosticRecoveryHistoryQuerySchema: () => diagnosticRecoveryHistoryQuerySchema,
91
+ diagnosticRecoveryInputSchema: () => diagnosticRecoveryInputSchema,
92
+ diagnosticRecoveryPreviewSchema: () => diagnosticRecoveryPreviewSchema,
93
+ diagnosticRecoveryRequestSchema: () => diagnosticRecoveryRequestSchema,
94
+ diagnosticRecoveryStateSchema: () => diagnosticRecoveryStateSchema,
95
+ diagnosticRecoverySummarySchema: () => diagnosticRecoverySummarySchema,
96
+ diagnosticResourceName: () => diagnosticResourceName,
97
+ diagnosticResourceSchema: () => diagnosticResourceSchema,
98
+ diagnosticSelection: () => diagnosticSelection,
99
+ diagnosticServiceName: () => diagnosticServiceName,
100
+ diagnosticSourceSchema: () => diagnosticSourceSchema,
101
+ diagnosticVerificationSchema: () => diagnosticVerificationSchema,
102
+ eligibleDiagnosticSelection: () => eligibleDiagnosticSelection,
103
+ readableDiagnosticFindingSchema: () => readableDiagnosticFindingSchema
104
+ });
105
+ module.exports = __toCommonJS(index_exports);
106
+
107
+ // src/action-availability.ts
108
+ var import_zod2 = require("zod");
109
+
110
+ // src/evidence.ts
111
+ var import_zod = require("zod");
112
+ var diagnosticIdSchema = import_zod.z.string().regex(/^[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}$/i);
113
+ var diagnosticCodeSchema = import_zod.z.string().regex(/^[a-z][a-z0-9_]{2,99}$/);
114
+ var diagnosticDateSchema = import_zod.z.iso.datetime({ offset: true });
115
+ var diagnosticSourceSchema = import_zod.z.object({
116
+ kind: diagnosticCodeSchema,
117
+ identifier: import_zod.z.string().min(1).max(200),
118
+ generation: import_zod.z.string().min(1).max(200)
119
+ });
120
+ var diagnosticResourceSchema = import_zod.z.object({
121
+ kind: import_zod.z.enum([
122
+ "integration",
123
+ "order",
124
+ "order_item",
125
+ "order_modifier",
126
+ "product",
127
+ "variant",
128
+ "modifier",
129
+ "choice",
130
+ "category",
131
+ "restaurant",
132
+ "configuration",
133
+ "publication",
134
+ "process",
135
+ "process_step",
136
+ "payment_method",
137
+ "tax"
138
+ ]),
139
+ identifier: import_zod.z.string().min(1).max(200),
140
+ role: import_zod.z.enum(["cause", "affected", "context"]),
141
+ name: import_zod.z.string().nullable(),
142
+ parentIdentifier: import_zod.z.string().nullable(),
143
+ translations: import_zod.z.union([import_zod.z.record(import_zod.z.string(), import_zod.z.string()), import_zod.z.array(import_zod.z.never())]).transform((value) => Array.isArray(value) ? {} : value)
144
+ });
145
+ var diagnosticFindingSchema = import_zod.z.object({
146
+ schemaVersion: import_zod.z.literal(1),
147
+ code: diagnosticCodeSchema,
148
+ confirmed: import_zod.z.boolean(),
149
+ resources: import_zod.z.array(diagnosticResourceSchema).max(100),
150
+ evidenceFingerprint: import_zod.z.string().regex(/^[a-f\d]{64}$/),
151
+ classifierVersion: import_zod.z.number().int().positive()
152
+ });
153
+ var readableDiagnosticFindingSchema = import_zod.z.unknown().transform((value) => {
154
+ const result = diagnosticFindingSchema.safeParse(value);
155
+ return result.success ? result.data : null;
156
+ });
157
+ var diagnosticRecoveryActionSchema = import_zod.z.enum(["retry", "reconcile", "sync_current_state"]).nullable().catch(null);
158
+ var diagnosticRecoveryStateSchema = import_zod.z.enum([
159
+ "action_required",
160
+ "automatic_recovery",
161
+ "in_progress",
162
+ "outcome_unknown",
163
+ "succeeded",
164
+ "superseded"
165
+ ]);
166
+ var diagnosticVerificationSchema = import_zod.z.object({
167
+ scope: import_zod.z.literal("local"),
168
+ outcome: import_zod.z.enum(["cause_present", "cause_absent", "unknown"]),
169
+ reason: diagnosticCodeSchema,
170
+ checkedAt: diagnosticDateSchema.nullable(),
171
+ expiresAt: diagnosticDateSchema.nullable(),
172
+ fresh: import_zod.z.boolean(),
173
+ findings: import_zod.z.array(diagnosticFindingSchema).max(100).optional()
174
+ });
175
+
176
+ // src/action-availability.ts
177
+ var recovery = import_zod2.z.discriminatedUnion("eligible", [
178
+ import_zod2.z.object({
179
+ eligible: import_zod2.z.literal(true),
180
+ code: import_zod2.z.literal("recovery_available"),
181
+ action: import_zod2.z.enum(["retry", "reconcile", "sync_current_state"])
182
+ }),
183
+ import_zod2.z.object({ eligible: import_zod2.z.literal(false), code: diagnosticCodeSchema, action: import_zod2.z.null() })
184
+ ]);
185
+ var closure = import_zod2.z.discriminatedUnion("eligible", [
186
+ import_zod2.z.object({ eligible: import_zod2.z.literal(true), code: import_zod2.z.literal("closure_available") }),
187
+ import_zod2.z.object({ eligible: import_zod2.z.literal(false), code: diagnosticCodeSchema })
188
+ ]);
189
+ var diagnosticOperationActionsSchema = import_zod2.z.object({
190
+ recovery,
191
+ manualClosure: closure,
192
+ evaluatedAt: diagnosticDateSchema
193
+ });
194
+ var reasons = {
195
+ it: {
196
+ reconciliation_required: "Un invio precedente ha un esito ancora incerto. Prima di ripubblicare occorre verificarne il risultato; consulta lo stato o richiedi assistenza.",
197
+ recovery_unsupported: "Il recupero da questa pagina non \xE8 ancora supportato per questa lavorazione. Consulta i dettagli o richiedi assistenza.",
198
+ closure_unsupported: "La chiusura manuale non \xE8 supportata per questa lavorazione.",
199
+ operation_unavailable: "Azione non disponibile con i permessi o lo stato attuale della risorsa.",
200
+ operation_manually_closed: "Operazione gi\xE0 segnata come gestita. Questo non certifica un successo del servizio.",
201
+ operation_in_progress: "La lavorazione \xE8 in corso: attendi il suo risultato prima di chiuderla.",
202
+ recovery_already_active: "Una lavorazione o un tentativo \xE8 gi\xE0 in corso o programmato. Non avviarne un altro.",
203
+ operation_completed: "Operazione gi\xE0 completata con successo.",
204
+ operation_cancelled: "Operazione annullata: questa azione non \xE8 disponibile.",
205
+ source_changed: "La lavorazione \xE8 cambiata. Aggiorna il problema prima di scegliere un\u2019azione.",
206
+ destination_unavailable: "Il collegamento di destinazione non \xE8 disponibile per questa azione.",
207
+ source_not_ready: "La vendita Tilby non \xE8 ancora pronta per essere importata. Verifica lo stato della vendita e aggiorna il problema.",
208
+ operation_changed: "L\u2019operazione \xE8 cambiata. Aggiorna il problema prima di scegliere un\u2019azione."
209
+ },
210
+ en: {
211
+ reconciliation_required: "An earlier submission still has an uncertain outcome. Its result must be checked before republishing; review its status or request assistance.",
212
+ recovery_unsupported: "Recovery from this page is not yet supported for this operation. Review its details or request assistance.",
213
+ closure_unsupported: "Manual closure is not supported for this operation.",
214
+ operation_unavailable: "This action is unavailable with the current permissions or resource state.",
215
+ operation_manually_closed: "The operation is already marked as handled. This does not certify provider success.",
216
+ operation_in_progress: "Work is in progress: wait for its result before closing it.",
217
+ recovery_already_active: "Work or an attempt is already running or scheduled. Do not start another one.",
218
+ operation_completed: "The operation has already succeeded.",
219
+ operation_cancelled: "The operation was cancelled: this action is unavailable.",
220
+ source_changed: "The underlying work changed. Refresh the problem before choosing an action.",
221
+ destination_unavailable: "The destination connection is unavailable for this action.",
222
+ source_not_ready: "The Tilby sale is not ready to import yet. Check its status and refresh the problem.",
223
+ operation_changed: "The operation changed. Refresh the problem before choosing an action."
224
+ }
225
+ };
226
+ function describeDiagnosticActionAvailability(actions2, action, locale) {
227
+ const decision = actions2?.[action];
228
+ if (decision?.eligible) {
229
+ if (action === "manualClosure")
230
+ return locale === "it" ? "Puoi segnarla come gestita indicando il motivo, senza dichiarare un successo del servizio." : "You can mark it as handled with a reason, without declaring provider success.";
231
+ return locale === "it" ? "Puoi selezionarla e verificare il recupero prima di confermare." : "You can select it and review recovery before confirming.";
232
+ }
233
+ return decision && Object.hasOwn(reasons[locale], decision.code) ? reasons[locale][decision.code] : locale === "it" ? "Disponibilit\xE0 dell\u2019azione non verificata. Aggiorna il problema." : "Action availability has not been verified. Refresh the problem.";
234
+ }
235
+
236
+ // src/assistance.ts
237
+ var import_zod3 = require("zod");
238
+ var diagnosticAssistanceQuerySchema = import_zod3.z.object({
239
+ page: import_zod3.z.number().int().min(1).max(1e5).optional(),
240
+ itemsPerPage: import_zod3.z.number().int().min(1).max(100).optional()
241
+ });
242
+ var pagination = {
243
+ page: import_zod3.z.number().int().positive(),
244
+ itemsPerPage: import_zod3.z.number().int().min(1).max(100)
245
+ };
246
+ var note = import_zod3.z.string().trim().min(1).max(2e3);
247
+ var diagnosticAssistanceRequestInputSchema = import_zod3.z.strictObject({
248
+ requestKey: diagnosticIdSchema,
249
+ note: note.nullable().optional()
250
+ });
251
+ var diagnosticAssistanceReplyInputSchema = import_zod3.z.strictObject({
252
+ actionKey: diagnosticIdSchema,
253
+ revision: import_zod3.z.number().int().positive(),
254
+ note
255
+ });
256
+ var supportAction = { actionKey: diagnosticIdSchema, revision: import_zod3.z.number().int().positive() };
257
+ var diagnosticAssistanceUpdateInputSchema = import_zod3.z.discriminatedUnion("action", [
258
+ import_zod3.z.strictObject({
259
+ ...supportAction,
260
+ action: import_zod3.z.literal("note"),
261
+ audience: import_zod3.z.enum(["public", "internal"]).default("internal"),
262
+ body: note
263
+ }),
264
+ import_zod3.z.strictObject({
265
+ ...supportAction,
266
+ action: import_zod3.z.literal("wait_for_customer"),
267
+ audience: import_zod3.z.literal("public"),
268
+ body: note
269
+ }),
270
+ import_zod3.z.strictObject({ ...supportAction, action: import_zod3.z.enum(["claim", "release", "complete"]) })
271
+ ]);
272
+ var diagnosticAssistanceSummarySchema = import_zod3.z.object({
273
+ id: diagnosticIdSchema,
274
+ problemId: diagnosticIdSchema,
275
+ state: import_zod3.z.enum(["requested", "assigned", "waiting_for_customer", "completed"]),
276
+ revision: import_zod3.z.number().int().positive(),
277
+ assigned: import_zod3.z.boolean(),
278
+ createdAt: diagnosticDateSchema,
279
+ updatedAt: diagnosticDateSchema,
280
+ completedAt: diagnosticDateSchema.nullable()
281
+ });
282
+ var diagnosticAssistanceEventSchema = import_zod3.z.object({
283
+ id: diagnosticIdSchema,
284
+ kind: import_zod3.z.enum(["requested", "claim", "release", "wait_for_customer", "complete", "note"]),
285
+ body: import_zod3.z.string().max(2e3).nullable(),
286
+ authorKind: import_zod3.z.enum(["customer", "support"]),
287
+ occurredAt: diagnosticDateSchema
288
+ });
289
+ var diagnosticAssistanceSchema = diagnosticAssistanceSummarySchema.extend({
290
+ ...pagination,
291
+ events: import_zod3.z.object({
292
+ data: import_zod3.z.array(diagnosticAssistanceEventSchema).max(100),
293
+ hasNextPage: import_zod3.z.boolean()
294
+ })
295
+ });
296
+ var diagnosticAssistanceHistorySchema = import_zod3.z.object({
297
+ id: diagnosticIdSchema,
298
+ ...pagination,
299
+ data: import_zod3.z.array(diagnosticAssistanceSummarySchema).max(100),
300
+ hasNextPage: import_zod3.z.boolean()
301
+ });
302
+ var diagnosticAssistanceInternalSchema = import_zod3.z.object({
303
+ id: diagnosticIdSchema,
304
+ assignedTo: diagnosticIdSchema.nullable(),
305
+ requestedBy: diagnosticIdSchema,
306
+ ...pagination,
307
+ events: import_zod3.z.object({
308
+ data: import_zod3.z.array(
309
+ diagnosticAssistanceEventSchema.extend({
310
+ kind: import_zod3.z.literal("note"),
311
+ authorKind: import_zod3.z.literal("support"),
312
+ actorId: diagnosticIdSchema
313
+ })
314
+ ).max(100),
315
+ hasNextPage: import_zod3.z.boolean()
316
+ })
317
+ });
318
+ var diagnosticAssistanceQueueItemSchema = diagnosticAssistanceSummarySchema.omit({ assigned: true }).extend({
319
+ pointOfSaleId: diagnosticIdSchema,
320
+ integrationId: diagnosticIdSchema,
321
+ code: diagnosticCodeSchema,
322
+ assignedTo: diagnosticIdSchema.nullable()
323
+ });
324
+
325
+ // src/attempt-history.ts
326
+ var import_zod4 = require("zod");
327
+ var diagnosticAttemptSchema = import_zod4.z.object({
328
+ id: diagnosticIdSchema,
329
+ generation: import_zod4.z.number().int().nonnegative().nullable(),
330
+ number: import_zod4.z.number().int().positive().nullable(),
331
+ result: import_zod4.z.enum(["running", "succeeded", "retry_scheduled", "outcome_unknown", "failed", "manual_action", "skipped", "cancelled", "stale", "timed_out", "accepted", "remote_state_matches", "rate_limited", "remote_state_differs", "not_found", "unavailable", "interrupted", "observation_ignored", "unknown"]),
332
+ phase: import_zod4.z.enum(["eligibility", "catalog_preparation", "payload_validation", "sending", "reconciling", "completed", "menu_submission", "menu_verification", "availability_sync", "unknown"]),
333
+ startedAt: diagnosticDateSchema.nullable(),
334
+ finishedAt: diagnosticDateSchema.nullable()
335
+ });
336
+ var diagnosticAttemptHistorySchema = import_zod4.z.object({
337
+ id: diagnosticIdSchema,
338
+ supported: import_zod4.z.boolean(),
339
+ entries: import_zod4.z.array(diagnosticAttemptSchema).max(100),
340
+ page: import_zod4.z.number().int().positive(),
341
+ itemsPerPage: import_zod4.z.number().int().min(1).max(100),
342
+ hasNextPage: import_zod4.z.boolean()
343
+ });
344
+ var results = {
345
+ remote_state_differs: ["Dati remoti differenti", "Remote data differs"],
346
+ not_found: ["Menu remoto non trovato", "Remote menu not found"],
347
+ unavailable: ["Verifica non disponibile", "Verification unavailable"],
348
+ interrupted: ["Verifica interrotta", "Verification interrupted"],
349
+ observation_ignored: ["Verifica non applicata", "Verification not applied"],
350
+ accepted: ["Richiesta accettata", "Request accepted"],
351
+ remote_state_matches: ["Dati remoti corrispondenti", "Remote data matches"],
352
+ rate_limited: ["Limite del servizio raggiunto", "Service rate limit reached"],
353
+ running: ["In corso", "Running"],
354
+ succeeded: ["Riuscito", "Succeeded"],
355
+ retry_scheduled: ["Nuovo tentativo programmato", "Retry scheduled"],
356
+ outcome_unknown: ["Esito da verificare", "Outcome needs verification"],
357
+ failed: ["Non riuscito", "Failed"],
358
+ manual_action: ["Intervento richiesto", "Action required"],
359
+ skipped: ["Non eseguito", "Skipped"],
360
+ cancelled: ["Annullato", "Cancelled"],
361
+ stale: ["Superato da dati pi\xF9 recenti", "Superseded by newer data"],
362
+ timed_out: ["Tempo di attesa scaduto", "Timed out"],
363
+ unknown: ["Esito non disponibile", "Outcome unavailable"]
364
+ };
365
+ var phases = {
366
+ availability_sync: ["Aggiornamento disponibilit\xE0", "Availability update"],
367
+ menu_verification: ["Verifica menu remoto", "Remote menu verification"],
368
+ menu_submission: ["Invio menu", "Menu submission"],
369
+ eligibility: ["Controllo requisiti", "Eligibility check"],
370
+ catalog_preparation: ["Preparazione catalogo", "Catalog preparation"],
371
+ payload_validation: ["Controllo dati ordine", "Order data validation"],
372
+ sending: ["Invio", "Sending"],
373
+ reconciling: ["Verifica ricezione", "Receipt verification"],
374
+ completed: ["Completamento", "Completion"],
375
+ unknown: ["Fase non disponibile", "Phase unavailable"]
376
+ };
377
+ function describeDiagnosticAttempt(attempt, locale) {
378
+ const language = locale === "it" ? 0 : 1;
379
+ return {
380
+ title: attempt.generation !== null && attempt.number !== null ? locale === "it" ? `Ciclo ${attempt.generation} \xB7 Tentativo ${attempt.number}` : `Cycle ${attempt.generation} \xB7 Attempt ${attempt.number}` : attempt.generation !== null ? locale === "it" ? `Ciclo ${attempt.generation} \xB7 Tentativo \xB7 ${attempt.id.slice(0, 8)}` : `Cycle ${attempt.generation} \xB7 Attempt \xB7 ${attempt.id.slice(0, 8)}` : attempt.number !== null ? locale === "it" ? `Tentativo ${attempt.number} \xB7 ${attempt.id.slice(0, 8)}` : `Attempt ${attempt.number} \xB7 ${attempt.id.slice(0, 8)}` : locale === "it" ? `Tentativo \xB7 ${attempt.id.slice(0, 8)}` : `Attempt \xB7 ${attempt.id.slice(0, 8)}`,
381
+ explanation: attempt.result === "observation_ignored" ? locale === "it" ? "Questa osservazione non \xE8 stata applicata al processo. Non conferma la pubblicazione n\xE9 autorizza un nuovo invio." : "This observation was not applied to the workflow. It does not confirm publication or authorize another submission." : attempt.result === "accepted" ? locale === "it" ? "Il servizio ha accettato la richiesta. La pubblicazione del menu non \xE8 ancora confermata da questo esito." : "The service accepted the request. This outcome does not yet confirm menu publication." : attempt.result === "remote_state_matches" ? locale === "it" ? "I dati letti sul servizio corrispondono a quelli attesi. Questo confronto non certifica l\u2019esito di altri invii ancora incerti." : "Data read from the service matches the expected content. This comparison does not establish the outcome of other uncertain submissions." : attempt.result === "rate_limited" ? locale === "it" ? "Il servizio ha limitato le richieste. Questo risultato non indica da solo se seguir\xE0 un altro tentativo." : "The service limited requests. This result alone does not indicate whether another attempt will follow." : null,
382
+ result: results[attempt.result][language],
383
+ phase: phases[attempt.phase][language]
384
+ };
385
+ }
386
+
387
+ // src/cassa-resource-name.ts
388
+ var labels = {
389
+ categories: { kind: "category", it: "Categoria CassaInCloud", en: "CassaInCloud category" },
390
+ products: { kind: "product", it: "Prodotto CassaInCloud", en: "CassaInCloud product" },
391
+ composite_products: { kind: "product", it: "Prodotto composto CassaInCloud", en: "CassaInCloud composite product" },
392
+ options: { kind: "configuration", it: "Opzione CassaInCloud", en: "CassaInCloud option" },
393
+ departments: { kind: "configuration", it: "Reparto CassaInCloud", en: "CassaInCloud department" },
394
+ sales_modes: { kind: "configuration", it: "Modalit\xE0 di vendita CassaInCloud", en: "CassaInCloud sales mode" }
395
+ };
396
+ function cassaResourceName(resource, locale) {
397
+ const match = resource.identifier.match(/^cassa_in_cloud:([a-z_]+):([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/);
398
+ if (!match || match[0] !== resource.identifier || !Object.hasOwn(labels, match[1])) return null;
399
+ const label = labels[match[1]];
400
+ return label.kind === resource.kind ? `${label[locale]} \xB7 ID ${match[2]}` : null;
401
+ }
402
+
403
+ // src/deliveroo-publication-narrative.ts
404
+ var messages = {
405
+ it: {
406
+ deliveroo_publication_application_failed: {
407
+ title: "Menu pubblicato, aggiornamento locale da verificare",
408
+ explanation: "Deliveroo ha confermato la pubblicazione, ma l\u2019applicazione del risultato al punto vendita non \xE8 stata completata oppure la configurazione \xE8 cambiata.",
409
+ nextStep: "Chiedi assistenza per verificare lo stato locale. Non serve duplicare la pubblicazione gi\xE0 confermata."
410
+ },
411
+ deliveroo_publication_availability_paused: {
412
+ title: "Menu pubblicato, disponibilit\xE0 sospese",
413
+ explanation: "La pubblicazione \xE8 conclusa. L\u2019aggiornamento dei prodotti disponibili \xE8 sospeso per un errore aperto o una modifica della configurazione.",
414
+ nextStep: "Correggi gli errori delle disponibilit\xE0 e controlla la configurazione. Quando il ritentativo \xE8 disponibile, seleziona questa operazione: ripartir\xE0 solo l\u2019aggiornamento delle disponibilit\xE0, senza ripubblicare il menu."
415
+ },
416
+ deliveroo_publication_availability_failed: {
417
+ title: "Menu pubblicato, disponibilit\xE0 da completare",
418
+ explanation: "Deliveroo ha confermato il menu, ma non \xE8 stato completato l\u2019aggiornamento dei prodotti disponibili. I tentativi previsti sono terminati oppure il passaggio non \xE8 stato avviato.",
419
+ nextStep: "Verifica gli errori delle disponibilit\xE0. Quando il ritentativo \xE8 disponibile, seleziona questa operazione per riprendere solo l\u2019aggiornamento; se non \xE8 disponibile, chiedi assistenza. Il menu non verr\xE0 reinviato."
420
+ },
421
+ deliveroo_previous_upload_pending: {
422
+ title: "Nuovo invio in attesa del precedente",
423
+ explanation: "Una versione precedente del menu ha ancora un esito incerto. La nuova lavorazione \xE8 conservata, ma il suo invio resta sospeso per evitare pubblicazioni sovrapposte.",
424
+ nextStep: "Attendi la verifica dell\u2019invio precedente. Se l\u2019incertezza persiste, chiedi assistenza senza creare un altro invio."
425
+ },
426
+ deliveroo_menu_generation_paused: {
427
+ title: "Preparazione del menu sospesa",
428
+ explanation: "La richiesta si \xE8 fermata prima di preparare il menu perch\xE9 l\u2019integrazione o la sincronizzazione automatica non era disponibile.",
429
+ nextStep: "Controlla lo stato dell\u2019integrazione e gli errori aperti prima di scegliere una nuova sincronizzazione."
430
+ },
431
+ deliveroo_menu_delivery_failed: {
432
+ title: "Invio del menu non avviato",
433
+ explanation: "La preparazione locale \xE8 terminata, ma non \xE8 stato completato il passaggio al servizio che invia il menu. Non \xE8 una conferma di rifiuto da parte di Deliveroo.",
434
+ nextStep: "Chiedi all\u2019assistenza di verificare la lavorazione prima di richiedere un altro invio."
435
+ },
436
+ deliveroo_upload_uncertain: {
437
+ title: "Esito dell\u2019invio ancora incerto",
438
+ explanation: "L\u2019invio non ha ancora un esito verificato. Anche un menu diverso o non trovato durante il controllo non esclude una pubblicazione ancora in corso.",
439
+ nextStep: "Non duplicare l\u2019invio. Se il controllo dell\u2019esito \xE8 disponibile, seleziona l\u2019operazione e conferma il controllo: il menu non verr\xE0 reinviato. Se non \xE8 disponibile o l\u2019esito resta incerto, consulta lo storico e chiedi assistenza."
440
+ },
441
+ deliveroo_upload_rejected: {
442
+ title: "Invio del menu rifiutato",
443
+ explanation: "Deliveroo ha rifiutato questo invio. Il riepilogo non identifica ancora con certezza un singolo prodotto o modificatore responsabile.",
444
+ nextStep: "Controlla i dettagli disponibili e chiedi assistenza per individuare la correzione prima di ritentare."
445
+ },
446
+ deliveroo_upload_rate_limited: {
447
+ title: "Invio rallentato dal limite di richieste",
448
+ explanation: "Deliveroo ha applicato un limite alle richieste. Lo stato della lavorazione indica se \xE8 previsto un altro tentativo automatico o se quelli disponibili sono terminati.",
449
+ nextStep: "Attendi se il recupero automatico \xE8 in corso. Se \xE8 richiesta attenzione, verifica lo storico prima di scegliere un nuovo invio."
450
+ },
451
+ deliveroo_publication_review: {
452
+ title: "Menu verificato, chiusura da confermare",
453
+ explanation: "Il menu \xE8 stato osservato come corrispondente oppure Deliveroo ha confermato che era gi\xE0 identico. Resta da verificare che gli altri invii e lo stato locale consentano di chiudere la lavorazione.",
454
+ nextStep: "Non avviare un invio duplicato. Chiedi all\u2019assistenza di verificare gli invii ancora aperti."
455
+ },
456
+ deliveroo_menu_result_unavailable: {
457
+ title: "Esito finale Deliveroo da verificare",
458
+ explanation: "\xC8 presente una comunicazione finale di Deliveroo, ma non sono disponibili dettagli normalizzati sufficienti per stabilirne l\u2019esito. Questo non significa che il menu sia stato rifiutato.",
459
+ nextStep: "Chiedi all\u2019assistenza di verificare questa comunicazione prima di scegliere un nuovo invio."
460
+ },
461
+ deliveroo_menu_rejected: {
462
+ title: "Deliveroo ha segnalato un problema nella pubblicazione",
463
+ explanation: "La comunicazione finale contiene un rifiuto o errori di elaborazione. Da questa evidenza non \xE8 possibile identificare con certezza il singolo invio locale o l\u2019articolo responsabile.",
464
+ nextStep: "Verifica i dettagli della pubblicazione e gli invii gi\xE0 in corso con l\u2019assistenza prima di riprovare."
465
+ },
466
+ deliveroo_menu_access_denied: {
467
+ title: "Accesso negato durante la pubblicazione Deliveroo",
468
+ explanation: "Deliveroo ha segnalato un errore di autorizzazione nella comunicazione finale relativa al menu.",
469
+ nextStep: "Chiedi all\u2019assistenza di verificare credenziali e autorizzazioni dell\u2019integrazione prima di un nuovo invio."
470
+ },
471
+ deliveroo_menu_rate_limited: {
472
+ title: "Limite di richieste Deliveroo raggiunto",
473
+ explanation: "La comunicazione finale di Deliveroo segnala un limite di richieste. Non identifica un difetto di un articolo.",
474
+ nextStep: "Verifica con l\u2019assistenza il ripristino del servizio e gli invii gi\xE0 in corso prima di ripetere la pubblicazione."
475
+ },
476
+ deliveroo_menu_provider_failed: {
477
+ title: "Errore Deliveroo nella pubblicazione",
478
+ explanation: "Deliveroo ha segnalato un errore del proprio sistema nella comunicazione finale relativa al menu.",
479
+ nextStep: "Controlla lo stato del servizio e gli invii gi\xE0 in corso con l\u2019assistenza prima di scegliere un nuovo invio."
480
+ },
481
+ deliveroo_menu_images_rejected: {
482
+ title: "Immagini segnalate da Deliveroo",
483
+ explanation: "La comunicazione finale contiene errori relativi alle immagini. Non \xE8 ancora disponibile un collegamento certo ai prodotti del menu inviato.",
484
+ nextStep: "Chiedi all\u2019assistenza di identificare le immagini coinvolte e verificare i requisiti segnalati prima di modificarle o inviare nuovamente il menu."
485
+ },
486
+ deliveroo_menu_barcodes_rejected: {
487
+ title: "Codici a barre segnalati da Deliveroo",
488
+ explanation: "La comunicazione finale contiene errori relativi ai codici a barre. Non \xE8 ancora disponibile un collegamento certo ai prodotti del menu inviato.",
489
+ nextStep: "Chiedi all\u2019assistenza di identificare i prodotti coinvolti e verificare i codici a barre prima di un nuovo invio."
490
+ }
491
+ },
492
+ en: {
493
+ deliveroo_publication_application_failed: {
494
+ title: "Menu published, local update needs review",
495
+ explanation: "Deliveroo confirmed publication, but applying the result to the point of sale did not finish or its configuration changed.",
496
+ nextStep: "Ask support to review the local state. Do not duplicate the confirmed publication."
497
+ },
498
+ deliveroo_publication_availability_paused: {
499
+ title: "Menu published, availability paused",
500
+ explanation: "Publication is complete. The available-products update is paused because of an open issue or a configuration change.",
501
+ nextStep: "Correct availability issues and review integration settings. When retry is available, select this operation: only availability will be updated, without republishing the menu."
502
+ },
503
+ deliveroo_publication_availability_failed: {
504
+ title: "Menu published, availability needs completion",
505
+ explanation: "Deliveroo confirmed the menu, but the available-products update did not finish. Its attempts were exhausted or the step did not start.",
506
+ nextStep: "Review availability issues. When retry is available, select this operation to resume only the update; otherwise, ask support. The menu will not be submitted again."
507
+ },
508
+ deliveroo_previous_upload_pending: {
509
+ title: "New submission waiting for the previous one",
510
+ explanation: "A previous menu version still has an uncertain outcome. The new work is retained, but its submission is held to avoid overlapping publications.",
511
+ nextStep: "Wait for verification of the previous submission. If uncertainty persists, ask support without creating another submission."
512
+ },
513
+ deliveroo_menu_generation_paused: {
514
+ title: "Menu preparation paused",
515
+ explanation: "The request stopped before preparing the menu because the integration or automatic synchronization was unavailable.",
516
+ nextStep: "Check the integration status and open issues before choosing a new synchronization."
517
+ },
518
+ deliveroo_menu_delivery_failed: {
519
+ title: "Menu submission did not start",
520
+ explanation: "Local preparation completed, but handing the menu to the submission service did not complete. This does not confirm a Deliveroo rejection.",
521
+ nextStep: "Ask support to inspect this operation before requesting another submission."
522
+ },
523
+ deliveroo_upload_uncertain: {
524
+ title: "Submission outcome remains uncertain",
525
+ explanation: "The submission has no verified final outcome. A different or missing menu during a check does not rule out publication still being processed.",
526
+ nextStep: "Do not duplicate the submission. If an outcome check is available, select the operation and confirm the check: the menu will not be resent. If it is unavailable or the outcome remains uncertain, review the history and ask support."
527
+ },
528
+ deliveroo_upload_rejected: {
529
+ title: "Menu submission rejected",
530
+ explanation: "Deliveroo rejected this submission. The summary cannot yet reliably identify one responsible product or modifier.",
531
+ nextStep: "Review available details and ask support to identify the correction before retrying."
532
+ },
533
+ deliveroo_upload_rate_limited: {
534
+ title: "Submission slowed by request limits",
535
+ explanation: "Deliveroo applied a request limit. The operation status shows whether another automatic attempt is pending or the available attempts are exhausted.",
536
+ nextStep: "Wait while automatic recovery is in progress. If attention is required, review the history before choosing another submission."
537
+ },
538
+ deliveroo_publication_review: {
539
+ title: "Menu checked, closure needs confirmation",
540
+ explanation: "The menu was observed to match, or Deliveroo confirmed it was already identical. Other submissions and local state still need to be checked before closing this operation.",
541
+ nextStep: "Do not submit a duplicate. Ask support to review outstanding submissions."
542
+ },
543
+ deliveroo_menu_result_unavailable: {
544
+ title: "Deliveroo final outcome needs verification",
545
+ explanation: "A final Deliveroo notification exists, but sufficient normalized details are unavailable to establish its outcome. This does not mean that the menu was rejected.",
546
+ nextStep: "Ask support to verify this notification before choosing another submission."
547
+ },
548
+ deliveroo_menu_rejected: {
549
+ title: "Deliveroo reported a publication problem",
550
+ explanation: "The final notification contains a rejection or processing errors. This evidence cannot reliably identify the individual local submission or the responsible item.",
551
+ nextStep: "Review publication details and existing submissions with support before retrying."
552
+ },
553
+ deliveroo_menu_access_denied: {
554
+ title: "Access denied during Deliveroo publication",
555
+ explanation: "Deliveroo reported an authorization error in its final menu notification.",
556
+ nextStep: "Ask support to verify integration credentials and permissions before another submission."
557
+ },
558
+ deliveroo_menu_rate_limited: {
559
+ title: "Deliveroo request limit reached",
560
+ explanation: "The final Deliveroo notification reports a request limit. It does not identify an item defect.",
561
+ nextStep: "Review service availability and existing submissions with support before repeating publication."
562
+ },
563
+ deliveroo_menu_provider_failed: {
564
+ title: "Deliveroo publication service error",
565
+ explanation: "Deliveroo reported a system error in its final menu notification.",
566
+ nextStep: "Check service status and existing submissions with support before choosing another submission."
567
+ },
568
+ deliveroo_menu_images_rejected: {
569
+ title: "Images reported by Deliveroo",
570
+ explanation: "The final notification contains image errors. A reliable link to products in the submitted menu is not yet available.",
571
+ nextStep: "Ask support to identify the affected images and check the reported requirements before changing them or submitting the menu again."
572
+ },
573
+ deliveroo_menu_barcodes_rejected: {
574
+ title: "Barcodes reported by Deliveroo",
575
+ explanation: "The final notification contains barcode errors. A reliable link to products in the submitted menu is not yet available.",
576
+ nextStep: "Ask support to identify the affected products and verify their barcodes before another submission."
577
+ }
578
+ }
579
+ };
580
+ function describeDeliverooPublication(code, locale) {
581
+ if (!code || !Object.hasOwn(messages[locale], code)) return null;
582
+ return messages[locale][code];
583
+ }
584
+
585
+ // src/elephant-import-narrative.ts
586
+ var messages2 = {
587
+ it: {
588
+ catalog_import_evidence_incomplete: {
589
+ title: "Dettagli dell\u2019importazione incompleti",
590
+ explanation: "Alcuni errori del processo non hanno dettagli riconosciuti oppure superano il limite di elementi mostrati. Gli elementi elencati non rappresentano necessariamente tutti quelli coinvolti.",
591
+ nextStep: "Richiedi assistenza sul processo per verificare gli elementi mancanti. Non considerare risolta l\u2019importazione soltanto perch\xE9 hai corretto le risorse gi\xE0 mostrate."
592
+ },
593
+ elephant_catalog_product_import_failed: {
594
+ title: "Prodotto non importato completamente",
595
+ explanation: "L\u2019importazione si \xE8 fermata durante l\u2019elaborazione del prodotto indicato. Il prodotto o alcune dipendenze potrebbero essere gi\xE0 stati creati. Il nome identifica l\u2019elemento coinvolto, ma non dimostra quale campo abbia causato l\u2019errore.",
596
+ nextStep: "Controlla il prodotto e i suoi gruppi di scelta nel catalogo Elephant. Se non \xE8 indicata una correzione verificabile, richiedi assistenza. Un nuovo tentativo importa l\u2019intero catalogo attuale del ristorante."
597
+ },
598
+ elephant_catalog_variant_not_supported: {
599
+ title: "Variante non supportata dall\u2019importazione",
600
+ explanation: "Questa importazione ha rilevato una variante che non pu\xF2 rappresentare in modo sicuro nel catalogo Deliverart. Il prodotto mostrato come contesto non \xE8 necessariamente errato; la variante non \xE8 stata importata.",
601
+ nextStep: "Richiedi assistenza per una rappresentazione compatibile della variante. Ritentare lo stesso catalogo senza modifiche non supera questo limite. Non eliminare varianti o collegamenti soltanto per far terminare l\u2019importazione."
602
+ },
603
+ elephant_catalog_option_reference_missing: {
604
+ title: "Riferimento della scelta mancante",
605
+ explanation: "La scelta indicata non aveva un riferimento stabile nel catalogo Elephant ed \xE8 stata saltata. Il gruppo mostrato serve a localizzarla: non \xE8 una prova che manchi il collegamento del gruppo in Deliverart.",
606
+ nextStep: "Verifica con l\u2019assistenza il riferimento della scelta in Elephant. Dopo la correzione, scegli se avviare una nuova importazione dell\u2019intero catalogo del ristorante. Le altre scelte riuscite non dimostrano che questa sia stata recuperata."
607
+ }
608
+ },
609
+ en: {
610
+ catalog_import_evidence_incomplete: {
611
+ title: "Import details incomplete",
612
+ explanation: "Some process errors lack recognized details or exceed the displayed resource limit. The listed resources do not necessarily include every affected item.",
613
+ nextStep: "Request assistance on this process to inspect missing details. Correcting the displayed resources alone does not establish that the import is resolved."
614
+ },
615
+ elephant_catalog_product_import_failed: {
616
+ title: "Product not fully imported",
617
+ explanation: "The import stopped while processing the indicated product. The product or some dependencies may already have been created. Its name identifies the affected resource, but does not establish which field caused the failure.",
618
+ nextStep: "Check the product and its option groups in the Elephant catalog. Request assistance if no verified correction is available. A new attempt imports the restaurant\u2019s entire current catalog."
619
+ },
620
+ elephant_catalog_variant_not_supported: {
621
+ title: "Variant unsupported by the import",
622
+ explanation: "This import encountered a variant it cannot safely represent in the Deliverart catalog. The product shown as context is not necessarily incorrect; the variant was not imported.",
623
+ nextStep: "Request assistance for a compatible representation of this variant. Retrying the unchanged catalog does not overcome this limitation. Do not delete variants or mappings just to complete the import."
624
+ },
625
+ elephant_catalog_option_reference_missing: {
626
+ title: "Option reference missing",
627
+ explanation: "The indicated option had no stable reference in the Elephant catalog and was skipped. The group provides context to locate it; this does not prove its Deliverart mapping is missing.",
628
+ nextStep: "Ask support to check the option reference in Elephant. After correction, choose whether to start a new import of the restaurant\u2019s entire catalog. Other successful options do not prove this one was recovered."
629
+ }
630
+ }
631
+ };
632
+ function describeElephantImport(code, locale) {
633
+ return code && Object.hasOwn(messages2[locale], code) ? messages2[locale][code] : null;
634
+ }
635
+
636
+ // src/elephant-operational-narrative.ts
637
+ var reasons2 = {
638
+ elephant_parent_tenant_missing: { it: "Manca la configurazione del tenant gestito.", en: "The managed tenant configuration is missing." },
639
+ elephant_deliverart_base_url_invalid: { it: "L\u2019indirizzo di richiamata di Deliverart non \xE8 valido.", en: "The Deliverart callback address is invalid." },
640
+ elephant_sales_mode_missing: { it: "Il ristorante non ha una modalit\xE0 di vendita valida.", en: "The restaurant has no valid sales mode." },
641
+ elephant_app_connection_failed: { it: "Il test di collegamento dell\u2019app non \xE8 riuscito.", en: "The app connection test failed." },
642
+ elephant_restaurant_connection_failed: { it: "Il test di collegamento del ristorante non \xE8 riuscito.", en: "The restaurant connection test failed." },
643
+ elephant_delivery_test_failed: { it: "Il test di invio dati dal ristorante non \xE8 riuscito.", en: "The restaurant data delivery test failed." },
644
+ elephant_app_deletion_not_confirmed: { it: "La rimozione dell\u2019app non \xE8 ancora confermata.", en: "App removal has not been confirmed." },
645
+ elephant_operational_failure: { it: "Elephant segnala un problema operativo. La causa esatta non \xE8 ancora verificata.", en: "Elephant reports an operational problem. The exact cause has not been verified." }
646
+ };
647
+ function describeElephantOperation(code, locale) {
648
+ if (code === "elephant_legacy_delivery_unattributed") return locale === "it" ? {
649
+ title: "Invio storico alla cassa da verificare",
650
+ explanation: "Per questo ordine esiste una vecchia registrazione Elephant di preparazione o messa in coda. Non permette di ricostruire con certezza tutte le casse destinatarie e il relativo esito. Messo in coda non significa consegnato.",
651
+ nextStep: "Apri l\u2019ordine e controlla gli invii alla cassa. Verifica anche la ricezione sulla cassa o richiedi assistenza prima di reinviare, per evitare duplicati. Da questa segnalazione non \xE8 disponibile un nuovo tentativo."
652
+ } : {
653
+ title: "Historical cash-register delivery needs verification",
654
+ explanation: "This order has an old Elephant preparation or queueing record. It does not reliably identify every destination cash register and its outcome. Queued does not mean delivered.",
655
+ nextStep: "Open the order and check its cash-register exports. Verify receipt on the cash register or request assistance before resending to avoid duplicates. Retry is unavailable from this historical finding."
656
+ };
657
+ if (!code || !Object.hasOwn(reasons2, code)) return null;
658
+ return {
659
+ title: locale === "it" ? "Operazione Elephant da verificare" : "Elephant operation needs attention",
660
+ explanation: `${reasons2[code][locale]} ${locale === "it" ? "La risorsa indica dove controllare. La fase mostrata \xE8 l\u2019ultimo passaggio di configurazione salvato e pu\xF2 non coincidere con l\u2019attivit\xE0 fallita. Lo stato distingue un tentativo programmato da un intervento necessario." : "The resource indicates where to investigate. The phase shown is the last saved configuration checkpoint and may not be the activity that failed. Status distinguishes a scheduled retry from required action."}`,
661
+ nextStep: code === "elephant_sales_mode_missing" ? locale === "it" ? "Apri le impostazioni del ristorante Elephant e verifica la modalit\xE0 di vendita e la categoria Deliverart associate allo stesso POS. Dopo la correzione aggiorna la verifica; questo non conferma da solo il collegamento remoto." : "Open the Elephant restaurant settings and check that its sales mode and Deliverart category belong to the same POS. Refresh verification after correcting them; this alone does not confirm the remote connection." : code === "elephant_parent_tenant_missing" ? locale === "it" ? "La configurazione del tenant gestito \xE8 gestita da Deliverart. Richiedi assistenza indicando questa integrazione; non creare o rimuovere tenant per aggirare il problema." : "Deliverart manages the parent tenant configuration. Contact support and identify this integration; do not create or remove tenants to bypass the issue." : code === "elephant_deliverart_base_url_invalid" ? locale === "it" ? "L\u2019indirizzo HTTPS usato da Elephant per richiamare Deliverart richiede una correzione tecnica. Richiedi assistenza indicando questa integrazione; non modificare le credenziali." : "The HTTPS address Elephant uses to call Deliverart needs a technical correction. Contact support and identify this integration; do not change credentials." : locale === "it" ? "Controlla lo stato dell\u2019integrazione e del ristorante indicato. Se la configurazione non \xE8 modificabile, richiedi assistenza. Non ricreare o rimuovere risorse per aggirare il problema." : "Check the integration and indicated restaurant status. Request assistance if the configuration cannot be edited. Do not recreate or remove resources to bypass the problem."
662
+ };
663
+ }
664
+ var phases2 = {
665
+ pending: ["Avvio", "Startup"],
666
+ credentials: ["Credenziali", "Credentials"],
667
+ tenant: ["Tenant", "Tenant"],
668
+ app: ["App", "App"],
669
+ api_token: ["Accesso alle API", "API access"],
670
+ app_configuration: ["Configurazione app", "App configuration"],
671
+ app_connection_test: ["Test collegamento app", "App connection test"],
672
+ restaurants: ["Collegamento ristoranti", "Restaurant connection"],
673
+ catalog: ["Catalogo", "Catalog"],
674
+ complete: ["Attivazione completata", "Activation completed"],
675
+ deprovisioning: ["Rimozione collegamento", "Disconnection"]
676
+ };
677
+ function describeElephantPhase(identifier, locale) {
678
+ if (!identifier.startsWith("elephant_step_")) return null;
679
+ const key = identifier.slice("elephant_step_".length);
680
+ if (!Object.hasOwn(phases2, key)) return locale === "it" ? "Fase Elephant non riconosciuta" : "Unrecognized Elephant phase";
681
+ return `${locale === "it" ? "Ultima fase registrata" : "Last recorded phase"}: ${phases2[key][locale === "it" ? 0 : 1]}`;
682
+ }
683
+
684
+ // src/integration-issue-narrative.ts
685
+ var messages3 = {
686
+ it: {
687
+ unauthorized: {
688
+ title: "Accesso al servizio non autorizzato",
689
+ explanation: "Il servizio ha segnalato un errore di autenticazione per questa operazione. La segnalazione non identifica da sola quale credenziale o collegamento debba essere corretto.",
690
+ nextStep: "Controlla lo stato del collegamento e l\u2019account associato all\u2019integrazione. Se non \xE8 indicata una correzione verificabile, richiedi assistenza. Correggere l\u2019accesso non recupera automaticamente le operazioni ferme."
691
+ },
692
+ forbidden: {
693
+ title: "Permesso negato dal servizio",
694
+ explanation: "Il servizio ha negato il permesso necessario all\u2019operazione. Non \xE8 una prova che il catalogo sia errato o che un prodotto sia mancante.",
695
+ nextStep: "Verifica che l\u2019account collegato sia autorizzato a gestire il punto vendita e l\u2019attivit\xE0 indicata. Richiedi assistenza se i permessi risultano corretti."
696
+ },
697
+ remote_not_found: {
698
+ title: "Riferimento non trovato nel servizio",
699
+ explanation: "Il servizio non ha trovato il riferimento richiesto. Il dato disponibile non stabilisce se riguardi il punto vendita, una risorsa o il collegamento utilizzato.",
700
+ nextStep: "Verifica i riferimenti del collegamento e le eventuali risorse indicate. Se manca un riferimento preciso, richiedi assistenza prima di ricreare o eliminare elementi."
701
+ },
702
+ invalid_menu: {
703
+ title: "Problema di validazione del menu",
704
+ explanation: "La validazione del menu ha segnalato un problema. In assenza di dettagli sui singoli elementi, questa segnalazione non identifica quale prodotto, modificatore o scelta correggere.",
705
+ nextStep: "Apri i dettagli della sincronizzazione e controlla gli elementi segnalati. Se i dettagli non bastano, richiedi assistenza; ritentare un menu invariato pu\xF2 ripetere lo stesso errore."
706
+ },
707
+ remote_validation_failed: {
708
+ title: "Dati non accettati dal servizio",
709
+ explanation: "Il servizio ha rifiutato i dati dell\u2019operazione. Questa classificazione non dimostra quale campo o elemento abbia causato il rifiuto.",
710
+ nextStep: "Controlla i dettagli e le risorse segnalate, poi correggi i dati identificati. Se non \xE8 indicato un elemento preciso, richiedi assistenza invece di modificare il catalogo per tentativi."
711
+ },
712
+ daily_limit_reached: {
713
+ title: "Limite giornaliero del servizio raggiunto",
714
+ explanation: "Questa attivit\xE0 ha raggiunto il limite giornaliero registrato dall\u2019integrazione. Il limite pu\xF2 essere applicato prima dell\u2019invio e non indica un difetto di un prodotto o modificatore.",
715
+ nextStep: "Controlla lo stato della lavorazione e l\u2019eventuale prossimo tentativo. Evita invii ripetuti durante il limite; chiedi assistenza se resta bloccata dopo il ripristino previsto."
716
+ },
717
+ process_failed: {
718
+ title: "Lavorazione dell\u2019integrazione interrotta",
719
+ explanation: "La lavorazione ha registrato un errore, ma questa segnalazione non contiene una causa precisa verificata. Non conferma che tutte le risorse coinvolte siano fallite.",
720
+ nextStep: "Controlla il risultato della lavorazione e i dettagli disponibili. Richiedi assistenza se non \xE8 indicata una correzione verificabile; scegli un recupero soltanto quando disponibile."
721
+ }
722
+ },
723
+ en: {
724
+ unauthorized: {
725
+ title: "Service access not authorized",
726
+ explanation: "The service reported an authentication error for this operation. This report alone does not establish which credential or connection needs correction.",
727
+ nextStep: "Check the integration connection and linked account. Request assistance if no verified correction is available. Restoring access does not automatically recover stopped operations."
728
+ },
729
+ forbidden: {
730
+ title: "Permission denied by the service",
731
+ explanation: "The service denied the permission required for this operation. This does not prove that the catalog is invalid or a product is missing.",
732
+ nextStep: "Check that the linked account is authorized to manage this store and activity. Request assistance if its permissions appear correct."
733
+ },
734
+ remote_not_found: {
735
+ title: "Reference not found in the service",
736
+ explanation: "The service could not find the requested reference. The available evidence does not establish whether this concerns the store, a resource or the connection used.",
737
+ nextStep: "Check the connection references and any identified resources. Request assistance before recreating or removing resources when the exact reference is unknown."
738
+ },
739
+ invalid_menu: {
740
+ title: "Menu validation problem",
741
+ explanation: "Menu validation reported a problem. Without resource details, this report does not identify which product, modifier or option needs correction.",
742
+ nextStep: "Open the synchronization details and review the reported resources. Request assistance if details are insufficient; retrying an unchanged menu can repeat the same failure."
743
+ },
744
+ remote_validation_failed: {
745
+ title: "Data not accepted by the service",
746
+ explanation: "The service rejected the operation data. This classification does not establish which field or resource caused the rejection.",
747
+ nextStep: "Review the details and identified resources, then correct the identified data. Request assistance when no exact resource is known instead of changing the catalog by trial and error."
748
+ },
749
+ daily_limit_reached: {
750
+ title: "Service daily limit reached",
751
+ explanation: "This activity reached the daily limit recorded by the integration. The limit may be applied before submission and does not indicate a product or modifier defect.",
752
+ nextStep: "Check the operation status and any scheduled next attempt. Avoid repeated submissions while the limit applies; request assistance if work remains blocked after the expected reset."
753
+ },
754
+ process_failed: {
755
+ title: "Integration operation stopped",
756
+ explanation: "The operation recorded an error, but this report does not contain a verified precise cause. It does not establish that every involved resource failed.",
757
+ nextStep: "Review the operation result and available details. Request assistance when no verified correction is available; select recovery only when supported."
758
+ }
759
+ }
760
+ };
761
+ function describeIntegrationIssue(code, locale) {
762
+ if (!code?.startsWith("integration_")) return null;
763
+ const key = code.slice("integration_".length);
764
+ return Object.hasOwn(messages3[locale], key) ? messages3[locale][key] : null;
765
+ }
766
+
767
+ // src/kitchen-setup-narrative.ts
768
+ var copy = {
769
+ it: {
770
+ title: "Preparazione dell\u2019accesso Kitchen non riuscita",
771
+ explanation: "Il sistema ha esaurito i tentativi di preparazione di questo accesso Kitchen. La causa tecnica non \xE8 ancora identificata. Questo esito non indica se il monitor cucina \xE8 connesso o se altri accessi funzionano.",
772
+ nextStep: "Se il ritento \xE8 disponibile, seleziona questa operazione e conferma per preparare nuovamente l\u2019accesso. Se il problema si ripete, richiedi assistenza dalla scheda del problema. Non condividere codici di accesso o credenziali nella richiesta."
773
+ },
774
+ en: {
775
+ title: "Kitchen access setup failed",
776
+ explanation: "The system exhausted its attempts to prepare this Kitchen access. The technical cause has not yet been identified. This outcome does not establish whether the kitchen monitor is connected or other access credentials work.",
777
+ nextStep: "If retry is available, select this operation and confirm to prepare access again. If the problem recurs, request assistance from the problem details. Do not include access codes or credentials in your request."
778
+ }
779
+ };
780
+ var inactiveCopy = {
781
+ it: {
782
+ title: "Preparazione dell\u2019accesso Kitchen interrotta",
783
+ explanation: "L\u2019integrazione Kitchen non era pi\xF9 attiva quando \xE8 iniziato il ritento selezionato. Non sono state create nuove credenziali. Questo esito non descrive la connessione del monitor cucina.",
784
+ nextStep: "Controlla lo stato dell\u2019integrazione Kitchen. Se la sospensione era intenzionale, mantienila. Per riprendere, riattiva l\u2019integrazione se consentito, poi seleziona e conferma un nuovo ritento: la riattivazione da sola non lo avvia."
785
+ },
786
+ en: {
787
+ title: "Kitchen access setup stopped",
788
+ explanation: "The Kitchen integration was no longer active when the selected retry started. No new credentials were created. This outcome does not describe the kitchen monitor connection.",
789
+ nextStep: "Check the Kitchen integration status. Keep it suspended if that was intentional. To resume, reactivate the integration if permitted, then select and confirm another retry: reactivation alone does not start it."
790
+ }
791
+ };
792
+ function describeKitchenSetup(code, locale) {
793
+ if (code === "kitchen_access_setup_inactive") return inactiveCopy[locale];
794
+ return code === "kitchen_access_setup_failed" ? copy[locale] : null;
795
+ }
796
+
797
+ // src/local-verification-narrative.ts
798
+ var unknownReasons = {
799
+ current_local_blockers: {
800
+ it: "Il controllo locale ha rilevato i problemi descritti qui sotto. Riguardano la configurazione al momento del controllo: non ricostruiscono con certezza la causa del vecchio errore. Nessuna operazione \xE8 stata ritentata.",
801
+ en: "The local check found the problems below. They describe configuration at the time of the check, not a confirmed reconstruction of the historical failure. No operation has been retried."
802
+ },
803
+ local_validation_passed: {
804
+ it: "Il controllo locale non ha rilevato problemi nei dati da inviare. Questo non conferma la causa del vecchio errore n\xE9 l\u2019arrivo dell\u2019ordine in cassa. Nessuna operazione \xE8 stata ritentata.",
805
+ en: "The local check found no problems in the data to send. This does not confirm the historical cause or delivery to the cash register. No operation has been retried."
806
+ },
807
+ local_validation_incomplete: {
808
+ it: "Il controllo locale non ha prodotto una diagnosi completa. Consulta lo storico o richiedi assistenza. Nessuna operazione \xE8 stata ritentata.",
809
+ en: "The local check did not produce a complete diagnosis. Review the history or request assistance. No operation has been retried."
810
+ },
811
+ source_changed: {
812
+ it: "L\u2019operazione \xE8 cambiata rispetto all\u2019errore registrato. Aggiorna il dettaglio prima di richiedere una nuova verifica. Nessuna operazione \xE8 stata ritentata.",
813
+ en: "The operation has changed since the recorded failure. Refresh the details before requesting another check. No operation has been retried."
814
+ },
815
+ mapping_ambiguous: {
816
+ it: "La verifica ha trovato collegamenti duplicati. Controlla il collegamento corretto prima di scegliere un recupero: la correzione della causa non \xE8 confermata.",
817
+ en: "Verification found duplicate mappings. Check the correct mapping before selecting recovery: correction of the cause is not confirmed."
818
+ },
819
+ mapping_missing: {
820
+ it: "Durante la verifica manca un collegamento necessario. Il problema pu\xF2 essere cambiato: controlla i dettagli prima di scegliere un recupero.",
821
+ en: "A required mapping is missing during verification. The problem may have changed: review the details before selecting recovery."
822
+ },
823
+ resource_unavailable: {
824
+ it: "Una risorsa necessaria alla verifica non \xE8 disponibile. Controlla l\u2019ordine e il catalogo indicati o richiedi assistenza; non \xE8 possibile confermare la correzione.",
825
+ en: "A resource needed for verification is unavailable. Check the indicated order and catalog or request assistance; correction cannot be confirmed."
826
+ },
827
+ evidence_incomplete: {
828
+ it: "I dati disponibili non bastano per verificare la causa. Consulta i dettagli dell\u2019operazione o richiedi assistenza; il problema resta da verificare.",
829
+ en: "The available data is insufficient to verify the cause. Review the operation details or request assistance; the problem remains unverified."
830
+ },
831
+ check_unsupported: {
832
+ it: "Per questo problema non \xE8 disponibile una verifica automatica locale. Segui le indicazioni della diagnosi o richiedi assistenza; aggiornare la verifica non ritenta l\u2019operazione.",
833
+ en: "Automatic local verification is not available for this problem. Follow the diagnosis guidance or request assistance; refreshing verification does not retry the operation."
834
+ },
835
+ check_unavailable: {
836
+ it: "Non \xE8 stato possibile completare la verifica. Riprova la verifica pi\xF9 tardi o richiedi assistenza: il risultato non conferma che la causa sia stata corretta.",
837
+ en: "Verification could not be completed. Refresh verification later or request assistance: this result does not confirm that the cause was corrected."
838
+ },
839
+ evidence_changed: {
840
+ it: "I dati del problema sono cambiati durante la verifica. Aggiorna il dettaglio e richiedi una nuova verifica prima di scegliere un recupero.",
841
+ en: "The problem evidence changed during verification. Refresh the details and request a new verification before selecting recovery."
842
+ }
843
+ };
844
+ function describeLocalVerification(verification, locale) {
845
+ if (verification.scope !== "local" || !verification.checkedAt || !verification.fresh) return null;
846
+ if (verification.outcome === "cause_absent" && verification.reason === "local_configuration_present") {
847
+ return locale === "it" ? "La configurazione locale richiesta \xE8 presente. Nessuna operazione \xE8 stata ritentata e la configurazione nella cassa non \xE8 stata verificata." : "The required local configuration exists. No operation has been retried and cash register configuration has not been verified.";
848
+ }
849
+ if (verification.outcome === "cause_present" && verification.reason === "configuration_missing") {
850
+ return locale === "it" ? "La configurazione locale richiesta manca ancora. Completa l\u2019impostazione indicata e aggiorna la verifica; nessuna operazione \xE8 stata ritentata." : "The required local configuration is still missing. Complete the indicated setting and refresh verification; no operation has been retried.";
851
+ }
852
+ if (verification.outcome === "cause_present" && verification.reason === "mapping_ambiguous") {
853
+ return locale === "it" ? "I collegamenti duplicati sono ancora presenti. Correggi l\u2019ambiguit\xE0 nel gruppo e nel prodotto indicati, poi aggiorna la verifica. Nessuna operazione \xE8 stata ritentata." : "The duplicate mappings are still present. Resolve the ambiguity for the indicated group and product, then refresh verification. No operation has been retried.";
854
+ }
855
+ if (verification.outcome !== "unknown" || !Object.hasOwn(unknownReasons, verification.reason))
856
+ return null;
857
+ return unknownReasons[verification.reason][locale];
858
+ }
859
+
860
+ // src/menu-validation-narrative.ts
861
+ var fields = {
862
+ name: { it: "Nome", en: "Name" },
863
+ description: { it: "Descrizione", en: "Description" },
864
+ price: { it: "Prezzo", en: "Price" },
865
+ tax: { it: "Aliquota IVA", en: "Tax rate" },
866
+ selection: { it: "Limiti di scelta", en: "Selection limits" },
867
+ image: { it: "Immagine", en: "Image" },
868
+ references: { it: "Collegamenti del menu", en: "Menu references" }
869
+ };
870
+ var actions = {
871
+ name: {
872
+ it: "Controlla che il nome sia presente e rispetti i limiti del canale in ogni lingua.",
873
+ en: "Check that the name is present and meets channel limits in every language."
874
+ },
875
+ description: {
876
+ it: "Controlla lunghezza e formato delle descrizioni nelle lingue indicate.",
877
+ en: "Check the length and format of descriptions in the indicated languages."
878
+ },
879
+ price: {
880
+ it: "Controlla prezzo, maggiorazioni e prezzi specifici dell\u2019elemento.",
881
+ en: "Check the resource price, fees and price overrides."
882
+ },
883
+ tax: {
884
+ it: "Controlla il valore e il formato dell\u2019aliquota IVA dell\u2019elemento.",
885
+ en: "Check the value and format of the resource tax rate."
886
+ },
887
+ selection: {
888
+ it: "Controlla che minimo e massimo delle scelte siano validi e coerenti.",
889
+ en: "Check that minimum and maximum selection limits are valid and consistent."
890
+ },
891
+ image: {
892
+ it: "Controlla l\u2019immagine associata all\u2019elemento e il suo indirizzo pubblico.",
893
+ en: "Check the resource image and its public address."
894
+ },
895
+ references: {
896
+ it: "Controlla gli elementi e i modificatori collegati alla voce del menu.",
897
+ en: "Check the items and modifiers referenced by this menu entry."
898
+ }
899
+ };
900
+ function describeMenuValidation(code, locale) {
901
+ if (code === "menu_modifier_cycle") return {
902
+ title: locale === "it" ? "Collegamento circolare tra modificatori" : "Circular modifier reference",
903
+ explanation: locale === "it" ? "Seguendo le scelte dei modificatori indicati si torna a un modificatore gi\xE0 incontrato. Questo ciclo ha impedito la preparazione del menu Deliveroo. L\u2019elemento mostrato indica dove \xE8 stato rilevato; condividere un modificatore fra pi\xF9 prodotti non \xE8 di per s\xE9 un errore." : "Following the choices of the indicated modifiers returns to a modifier already visited. This cycle prevented preparation of the Deliveroo menu. The shown item identifies where it was detected; sharing a modifier across products is not itself an error.",
904
+ nextStep: locale === "it" ? "Apri i modificatori indicati e controlla le loro scelte e i modificatori associati a quelle scelte. Correggi il collegamento che chiude il ciclo. Poi scegli se avviare una nuova sincronizzazione dalla pagina dell\u2019integrazione; se non sai quale collegamento cambiare, richiedi assistenza. La correzione non avvia un invio automatico." : "Open the indicated modifiers and inspect their choices and the modifiers attached to those choices. Correct the reference that closes the cycle. Then choose whether to start a new synchronization from the integration page; request assistance if you are unsure which reference to change. Correcting it does not automatically submit the menu."
905
+ };
906
+ const remote = code?.startsWith("remote_") ?? false;
907
+ const normalizedCode = remote ? code?.slice("remote_".length) : code;
908
+ if (normalizedCode === "menu_validation_details_unavailable")
909
+ return {
910
+ title: locale === "it" ? "Altri errori di validazione del menu" : "Additional menu validation errors",
911
+ explanation: locale === "it" ? "Una parte degli errori non ha ancora un elemento identificato con certezza. L\u2019elenco potrebbe non essere completo." : "Some errors do not yet have a reliably identified resource. The list may be incomplete.",
912
+ nextStep: locale === "it" ? "Correggi gli elementi identificati e richiedi assistenza per i dettagli mancanti. Non \xE8 stata confermata la pubblicazione." : "Correct identified resources and request help for missing details. Publication has not been confirmed."
913
+ };
914
+ const entry = Object.entries(fields).find(
915
+ ([field2]) => normalizedCode === `menu_resource_${field2}_invalid`
916
+ );
917
+ if (!entry) return null;
918
+ const field = entry[0];
919
+ return {
920
+ title: locale === "it" ? `${fields[field].it}: dati non validi` : `${fields[field].en}: invalid data`,
921
+ explanation: remote ? locale === "it" ? "Il provider ha rifiutato il campo indicato durante la validazione remota del menu, prima dell\u2019upload. L\u2019elemento mostrato appartiene alla versione verificata. Questo esito non conferma la pubblicazione del menu." : "The provider rejected the indicated field during remote menu validation, before upload. The shown resource belongs to the checked version. This result does not confirm menu publication." : locale === "it" ? "La validazione locale ha impedito l\u2019invio della parte di menu contenente l\u2019elemento mostrato, per il campo indicato. Altre parti del menu possono avere un esito diverso. Questo \xE8 un controllo prima della pubblicazione, non un esito del marketplace." : "Local validation prevented submission of the menu portion containing the shown resource because of the indicated field. Other portions may have a different outcome. This check runs before publication; it is not a marketplace result.",
922
+ nextStep: `${actions[field][locale]} ${locale === "it" ? "Dopo la correzione, scegli se avviare la sincronizzazione del menu aggiornato." : "After correcting it, choose whether to synchronize the updated menu."}`
923
+ };
924
+ }
925
+
926
+ // src/operation-context.ts
927
+ var import_zod5 = require("zod");
928
+
929
+ // src/service-name.ts
930
+ var names = {
931
+ deliveroo: "Deliveroo",
932
+ glovo: "Glovo",
933
+ justeat: "Just Eat",
934
+ cassa_in_cloud: "CassaInCloud",
935
+ tilby: "Tilby",
936
+ elephant: "Elephant",
937
+ ecommerce: "Ecommerce",
938
+ kitchen: "Kitchen"
939
+ };
940
+ function diagnosticServiceName(service) {
941
+ return service && Object.hasOwn(names, service) ? names[service] : null;
942
+ }
943
+
944
+ // src/operation-context.ts
945
+ var diagnosticOperationContextSchema = import_zod5.z.object({
946
+ kind: import_zod5.z.enum([
947
+ "order",
948
+ "integration_lifecycle",
949
+ "sync_process",
950
+ "catalog_import",
951
+ "integration_issue",
952
+ "publication_validation",
953
+ "publication_receipt"
954
+ ]),
955
+ resourceId: diagnosticIdSchema,
956
+ direction: import_zod5.z.enum(["inbound", "outbound"]).nullish(),
957
+ reference: import_zod5.z.string().max(255).refine(
958
+ (value) => Array.from(value).every(
959
+ (character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127
960
+ )
961
+ ).nullable(),
962
+ scope: import_zod5.z.string().regex(/^[a-z][a-z0-9_]{1,63}$/).nullable()
963
+ });
964
+ var scopes = {
965
+ it: {
966
+ menu: "Menu",
967
+ customers: "Clienti",
968
+ sales_modes: "Modalit\xE0 di vendita",
969
+ timetables: "Orari",
970
+ fiscal_mappings: "Dati fiscali",
971
+ orders: "Ordini",
972
+ stock: "Disponibilit\xE0"
973
+ },
974
+ en: {
975
+ menu: "Menu",
976
+ customers: "Customers",
977
+ sales_modes: "Sales modes",
978
+ timetables: "Opening hours",
979
+ fiscal_mappings: "Fiscal mappings",
980
+ orders: "Orders",
981
+ stock: "Availability"
982
+ }
983
+ };
984
+ function describeDiagnosticScope(scope, locale) {
985
+ return Object.hasOwn(scopes[locale], scope) ? scopes[locale][scope] : null;
986
+ }
987
+ function describeOperationContext(context, locale) {
988
+ if (!context) return null;
989
+ const id = context.resourceId.slice(0, 8);
990
+ switch (context.kind) {
991
+ case "integration_lifecycle":
992
+ if (context.scope === "access_setup") return `${locale === "it" ? "Preparazione accesso" : "Access setup"} \xB7 ${id}`;
993
+ return `${context.scope === "restaurant" ? locale === "it" ? "Ristorante" : "Restaurant" : locale === "it" ? "Integrazione" : "Integration"} \xB7 ${locale === "it" ? "Stato operativo" : "Operational status"} \xB7 ${id}`;
994
+ case "order":
995
+ return `${locale === "it" ? "Ordine" : "Order"} #${context.reference || context.resourceId}`;
996
+ case "sync_process": {
997
+ const direction = context.direction === "inbound" ? locale === "it" ? "Dall\u2019integrazione a Deliverart" : "From the integration to Deliverart" : context.direction === "outbound" ? locale === "it" ? "Da Deliverart all\u2019integrazione" : "From Deliverart to the integration" : locale === "it" ? "Direzione non registrata" : "Direction not recorded";
998
+ return `${locale === "it" ? "Sincronizzazione" : "Synchronization"} \xB7 ${describeDiagnosticScope(context.scope ?? "", locale) ?? (locale === "it" ? "Dati" : "Data")} \xB7 ${direction} \xB7 ${id}`;
999
+ }
1000
+ case "publication_receipt":
1001
+ if (context.scope === "availability")
1002
+ return `${locale === "it" ? "Aggiornamento parziale" : "Partial update"} \xB7 ${id}`;
1003
+ return `${locale === "it" ? "Pubblicazione menu" : "Menu publication"} \xB7 ${id}`;
1004
+ case "publication_validation":
1005
+ return `${locale === "it" ? "Validazione menu" : "Menu validation"} \xB7 ${id}`;
1006
+ case "catalog_import":
1007
+ return `${locale === "it" ? "Importazione catalogo" : "Catalog import"} \xB7 ${id}`;
1008
+ case "integration_issue":
1009
+ return `${locale === "it" ? "Problema integrazione" : "Integration issue"} \xB7 ${id}`;
1010
+ }
1011
+ }
1012
+ function describeDiagnosticOperation(context, locale, service) {
1013
+ const description = describeOperationContext(context, locale);
1014
+ const name = diagnosticServiceName(service);
1015
+ return description && name ? `${name} \xB7 ${description}` : description;
1016
+ }
1017
+
1018
+ // src/order-dependency-narrative.ts
1019
+ var removedGroup = {
1020
+ it: {
1021
+ explanation: "Il gruppo indicato nell\u2019ordine non ha pi\xF9 il suo riferimento al catalogo. Il nome visualizzato proviene dall\u2019ordine e descrive il gruppo storico: non \xE8 la prova che esista ancora nel catalogo.",
1022
+ nextStep: "Controlla l\u2019ordine e il catalogo. Un nuovo tentativo senza correggere il riferimento mancante si fermer\xE0 di nuovo. Se l\u2019ordine non \xE8 correggibile, richiedi assistenza oppure registra la gestione esterna quando l\u2019azione \xE8 disponibile."
1023
+ },
1024
+ en: {
1025
+ explanation: "The indicated order group no longer has its catalog reference. The displayed name comes from the order and describes the historical group; it does not prove the group still exists in the catalog.",
1026
+ nextStep: "Check the order and catalog. Retrying without correcting the missing reference will stop again. If the order cannot be corrected, request assistance or record external handling when that action is available."
1027
+ }
1028
+ };
1029
+ var unavailableReference = {
1030
+ it: {
1031
+ explanation: "La riga indicata nell\u2019ordine non ha un riferimento utilizzabile al catalogo. Il nome \xE8 quello registrato nell\u2019ordine: questo dato non permette di stabilire se il prodotto sia stato eliminato o non fosse collegato in origine.",
1032
+ nextStep: "Controlla la riga e il gruppo indicati nell\u2019ordine. Ritentare senza correggere il riferimento mancante fermer\xE0 nuovamente l\u2019invio. Se non puoi correggere l\u2019ordine, richiedi assistenza oppure registra la gestione esterna quando l\u2019azione \xE8 disponibile."
1033
+ },
1034
+ en: {
1035
+ explanation: "The indicated order row has no usable catalog reference. Its name was recorded in the order; this does not establish whether the product was deleted or was never linked.",
1036
+ nextStep: "Check the indicated order row and group. Retrying without correcting the missing reference will stop the export again. If you cannot correct the order, request assistance or record external handling when that action is available."
1037
+ }
1038
+ };
1039
+ var explanations = {
1040
+ catalog_component_tax_mapping_missing: {
1041
+ it: {
1042
+ title: "Reparto fiscale della scelta non trovato",
1043
+ explanation: "Per il prodotto selezionato nel menu composto non \xE8 stato trovato un reparto della cassa collegato alla sua aliquota IVA. Il percorso mostrato identifica la scelta e il gruppo nell\u2019ordine.",
1044
+ nextStep: "Controlla l\u2019aliquota del prodotto e i reparti nell\u2019integrazione con la cassa. Aggiorna i collegamenti corretti o richiedi assistenza. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1045
+ },
1046
+ en: {
1047
+ title: "Selected product tax department not found",
1048
+ explanation: "No cash register department was found for the tax rate of the selected bundle product. The displayed path identifies the choice and group in the order.",
1049
+ nextStep: "Check the product tax rate and departments in the cash register integration. Update the correct mappings or request assistance. After correcting them, refresh verification and select the operations to retry."
1050
+ }
1051
+ },
1052
+ catalog_component_category_unresolved: {
1053
+ it: {
1054
+ title: "Categoria in cassa della scelta non determinabile",
1055
+ explanation: "Il prodotto selezionato nel menu composto non ha una categoria della cassa registrata sul suo collegamento. La ricerca nella categoria locale non ha trovato un unico risultato utilizzabile: pu\xF2 essere assente o ambiguo.",
1056
+ nextStep: "Controlla il collegamento del prodotto e aggiorna il catalogo dalla cassa per recuperare la sua categoria esatta. Se il problema persiste, richiedi assistenza. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1057
+ },
1058
+ en: {
1059
+ title: "Selected product cash register category unresolved",
1060
+ explanation: "The selected bundle product has no cash register category recorded on its mapping. Looking up its local category did not produce one usable result: it may be missing or ambiguous.",
1061
+ nextStep: "Check the product mapping and refresh the catalog from the cash register to recover its exact category. If the issue persists, request assistance. After correcting it, refresh verification and select the operations to retry."
1062
+ }
1063
+ },
1064
+ catalog_component_variant_id_missing: {
1065
+ it: {
1066
+ title: "Identificativo in cassa della scelta mancante",
1067
+ explanation: "Il prodotto selezionato nel menu composto \xE8 collegato alla cassa, ma manca l\u2019identificativo necessario per inviare la scelta, anche dopo la ricerca della variante base.",
1068
+ nextStep: "Controlla il prodotto e le varianti in cassa, poi aggiorna i relativi collegamenti in Deliverart. Se non puoi ripristinarli, richiedi assistenza. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1069
+ },
1070
+ en: {
1071
+ title: "Selected product cash register variant ID missing",
1072
+ explanation: "The selected bundle product is mapped to the cash register, but the identifier required to send the choice is missing, including after checking the base variant.",
1073
+ nextStep: "Check the product and variants in the cash register, then refresh their Deliverart mappings. If you cannot restore them, request assistance. After correcting them, refresh verification and select the operations to retry."
1074
+ }
1075
+ },
1076
+ catalog_product_reference_unavailable: {
1077
+ it: { ...unavailableReference.it, title: "Prodotto dell\u2019ordine senza riferimento al catalogo" },
1078
+ en: { ...unavailableReference.en, title: "Order product has no catalog reference" }
1079
+ },
1080
+ catalog_choice_reference_unavailable: {
1081
+ it: { ...unavailableReference.it, title: "Scelta del modificatore senza riferimento al catalogo" },
1082
+ en: { ...unavailableReference.en, title: "Modifier choice has no catalog reference" }
1083
+ },
1084
+ catalog_component_reference_unavailable: {
1085
+ it: { ...unavailableReference.it, title: "Scelta del menu composto senza riferimento al catalogo" },
1086
+ en: { ...unavailableReference.en, title: "Bundle choice has no catalog reference" }
1087
+ },
1088
+ catalog_component_mapping_ambiguous: {
1089
+ it: {
1090
+ title: "Pi\xF9 collegamenti per lo stesso gruppo del menu composto",
1091
+ explanation: "Il gruppo indicato ha pi\xF9 collegamenti al componente della stessa composizione in cassa. Deliverart non pu\xF2 scegliere in modo sicuro quale usare.",
1092
+ nextStep: "Controlla i collegamenti del gruppo per il prodotto composto indicato e correggi l\u2019ambiguit\xE0. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1093
+ },
1094
+ en: {
1095
+ title: "Multiple mappings for the same bundle component",
1096
+ explanation: "The indicated group has multiple component mappings for the same cash register bundle. Deliverart cannot safely choose one.",
1097
+ nextStep: "Check the group mappings for the indicated bundle product and resolve the ambiguity. After correcting it, refresh verification and select the operations to retry."
1098
+ }
1099
+ },
1100
+ catalog_component_definition_removed: {
1101
+ it: { ...removedGroup.it, title: "Gruppo del menu composto rimosso" },
1102
+ en: { ...removedGroup.en, title: "Bundle component group removed" }
1103
+ },
1104
+ catalog_modifier_definition_removed: {
1105
+ it: { ...removedGroup.it, title: "Gruppo del modificatore rimosso" },
1106
+ en: { ...removedGroup.en, title: "Modifier group removed" }
1107
+ },
1108
+ catalog_component_mapping_missing: {
1109
+ it: {
1110
+ title: "Collegamento del gruppo del menu composto mancante",
1111
+ explanation: "Il gruppo indicato del menu composto non aveva un collegamento al componente di quello specifico prodotto composto in cassa quando l\u2019operazione si \xE8 fermata. I prodotti scelti nel gruppo sono mostrati come contesto: questo errore non prova che manchino anche i loro collegamenti.",
1112
+ nextStep: "Controlla il gruppo del menu composto e il suo collegamento al componente corretto in cassa. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1113
+ },
1114
+ en: {
1115
+ title: "Bundle component mapping missing",
1116
+ explanation: "The indicated bundle group had no component mapping for that specific cash register bundle when the operation stopped. Products selected in the group are shown as context; this finding does not prove their mappings are also missing.",
1117
+ nextStep: "Check the bundle group and its mapping to the correct cash register component. After correcting it, refresh verification and select the operations to retry."
1118
+ }
1119
+ },
1120
+ catalog_choice_mapping_missing: {
1121
+ it: {
1122
+ title: "Collegamento della scelta mancante",
1123
+ explanation: "La scelta indicata, all\u2019interno del modificatore dell\u2019ordine, non aveva un collegamento alla cassa quando l\u2019operazione si \xE8 fermata. Il gruppo del modificatore era collegato: il problema rilevato riguarda questa scelta.",
1124
+ nextStep: "Controlla la scelta e il suo collegamento nell\u2019integrazione con la cassa, usando il modificatore e la riga dell\u2019ordine indicati come riferimento. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1125
+ },
1126
+ en: {
1127
+ title: "Choice mapping missing",
1128
+ explanation: "The indicated choice within the order modifier had no cash register mapping when the operation stopped. The modifier group was mapped: this finding concerns the selected choice.",
1129
+ nextStep: "Check the choice and its mapping in the cash register integration, using the indicated modifier and order row as context. After correcting it, refresh verification and select the operations to retry."
1130
+ }
1131
+ },
1132
+ catalog_variant_mapping_missing: {
1133
+ it: {
1134
+ title: "Collegamento della variante mancante",
1135
+ explanation: "La variante selezionata non aveva un collegamento al prodotto della cassa quando l\u2019operazione si \xE8 fermata. Il prodotto principale pu\xF2 essere gi\xE0 collegato.",
1136
+ nextStep: "Controlla la variante indicata e il suo collegamento al prodotto corretto in cassa. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1137
+ },
1138
+ en: {
1139
+ title: "Variant mapping missing",
1140
+ explanation: "The selected variant had no mapping to the cash register product when the operation stopped. The main product may already be mapped.",
1141
+ nextStep: "Check the indicated variant and its mapping to the correct cash register product. After correcting it, refresh verification and select the operations to retry."
1142
+ }
1143
+ },
1144
+ catalog_sales_mode_mapping_missing: {
1145
+ it: {
1146
+ title: "Collegamento della modalit\xE0 di vendita mancante",
1147
+ explanation: "La modalit\xE0 di vendita indicata sulla riga dell\u2019ordine non aveva un collegamento alla cassa. Questo errore non identifica un problema del prodotto o del pagamento.",
1148
+ nextStep: "Controlla la modalit\xE0 di vendita e il suo collegamento nell\u2019integrazione con la cassa. Dopo la correzione, aggiorna la verifica e scegli quali operazioni ritentare."
1149
+ },
1150
+ en: {
1151
+ title: "Sales mode mapping missing",
1152
+ explanation: "The sales mode on the indicated order row had no cash register mapping. This error does not identify a product or payment problem.",
1153
+ nextStep: "Check the sales mode and its mapping in the cash register integration. After correcting it, refresh verification and select the operations to retry."
1154
+ }
1155
+ }
1156
+ };
1157
+ function describeOrderDependency(finding, locale) {
1158
+ if (!finding?.confirmed || !Object.hasOwn(explanations, finding.code)) return null;
1159
+ return explanations[finding.code][locale];
1160
+ }
1161
+
1162
+ // src/process-step.ts
1163
+ var steps = {
1164
+ options: { it: "Scelte e opzioni", en: "Choices and options" },
1165
+ categories: { it: "Categorie", en: "Categories" },
1166
+ departments: { it: "Reparti fiscali", en: "Fiscal departments" },
1167
+ sales_modes: { it: "Modalit\xE0 di vendita", en: "Sales modes" },
1168
+ products: { it: "Prodotti", en: "Products" },
1169
+ composite_products: { it: "Prodotti composti", en: "Composite products" },
1170
+ clean_obsolete_sales_modes: { it: "Rimozione delle modalit\xE0 di vendita obsolete", en: "Removing obsolete sales modes" },
1171
+ clean_obsolete_products: { it: "Rimozione dei prodotti obsoleti", en: "Removing obsolete products" },
1172
+ clean_obsolete_options: { it: "Rimozione delle opzioni obsolete", en: "Removing obsolete options" },
1173
+ clean_obsolete_categories: { it: "Rimozione delle categorie obsolete", en: "Removing obsolete categories" },
1174
+ components: { it: "Componenti", en: "Components" },
1175
+ customers: { it: "Clienti", en: "Customers" },
1176
+ vat: { it: "Aliquote IVA", en: "VAT rates" },
1177
+ orders: { it: "Ordini", en: "Orders" },
1178
+ stock: { it: "Disponibilit\xE0", en: "Availability" },
1179
+ timetables: { it: "Orari", en: "Opening hours" }
1180
+ };
1181
+ function describeProcessStep(identifier, locale) {
1182
+ if (!Object.hasOwn(steps, identifier))
1183
+ return locale === "it" ? "Fase non riconosciuta" : "Unrecognized step";
1184
+ return `${locale === "it" ? "Fase" : "Step"}: ${steps[identifier][locale]}`;
1185
+ }
1186
+
1187
+ // src/publication-narrative.ts
1188
+ var messages4 = {
1189
+ it: {
1190
+ menu_publication_generation_failed: {
1191
+ title: "Preparazione del menu non riuscita",
1192
+ explanation: "Il sistema ha esaurito i tentativi di preparazione del nuovo menu. Questo tentativo non ha raggiunto la fase di pubblicazione sul servizio esterno.",
1193
+ nextStep: "Controlla i dettagli di validazione disponibili e chiedi assistenza con il riferimento dell\u2019operazione. Correggi la causa prima di scegliere un nuovo tentativo."
1194
+ },
1195
+ menu_publication_queue_delivery_failed: {
1196
+ title: "Consegna della pubblicazione da verificare",
1197
+ explanation: "Il menu \xE8 stato preparato, ma il sistema non ha confermato la consegna al processo di pubblicazione dopo i tentativi previsti. Questo non dimostra un rifiuto del servizio esterno.",
1198
+ nextStep: "Contatta l\u2019assistenza con il riferimento dell\u2019operazione per verificare la consegna prima di richiedere un altro invio."
1199
+ },
1200
+ bulk_update_products_not_updated: {
1201
+ title: "Prodotti non aggiornati su Glovo",
1202
+ explanation: "Glovo ha indicato che i prodotti elencati non sono stati aggiornati in questo invio. I riferimenti corrispondono ai dati inviati; questo non identifica ancora la causa del rifiuto.",
1203
+ nextStep: "Controlla questi prodotti e i tentativi gi\xE0 in corso con l\u2019assistenza prima di scegliere un nuovo invio."
1204
+ },
1205
+ bulk_update_attributes_not_updated: {
1206
+ title: "Scelte dei modificatori non aggiornate su Glovo",
1207
+ explanation: "Glovo ha indicato che le scelte elencate non sono state aggiornate in questo invio. I riferimenti corrispondono ai dati inviati; questo non identifica ancora la causa del rifiuto.",
1208
+ nextStep: "Controlla queste scelte e i tentativi gi\xE0 in corso con l\u2019assistenza prima di scegliere un nuovo invio."
1209
+ },
1210
+ bulk_update_evidence_incomplete: {
1211
+ title: "Altri elementi non identificabili con certezza",
1212
+ explanation: "Una parte dei dettagli di questo aggiornamento parziale non pu\xF2 essere collegata in modo univoco ai dati inviati. Gli elementi identificati nelle altre segnalazioni potrebbero non essere tutti quelli coinvolti.",
1213
+ nextStep: "Chiedi all\u2019assistenza di verificare il resto dell\u2019esito prima di considerare completo l\u2019elenco o ripetere l\u2019invio."
1214
+ },
1215
+ bulk_update_outcome_unknown: {
1216
+ title: "Esito dell\u2019aggiornamento Glovo non confermato",
1217
+ explanation: "I controlli automatici sono terminati mentre questo aggiornamento parziale risultava ancora in elaborazione. Non \xE8 confermato quali modifiche siano state applicate.",
1218
+ nextStep: "Chiedi all\u2019assistenza di verificare questo invio prima di ripeterlo."
1219
+ },
1220
+ bulk_update_partially_processed: {
1221
+ title: "Aggiornamento Glovo applicato solo in parte",
1222
+ explanation: "Glovo ha confermato che una parte di questo invio non \xE8 stata applicata. Questa segnalazione non identifica ancora gli articoli coinvolti n\xE9 dimostra che un eventuale invio successivo li abbia corretti.",
1223
+ nextStep: "Verifica con l\u2019assistenza gli elementi non aggiornati e i tentativi gi\xE0 in corso prima di scegliere un nuovo invio."
1224
+ },
1225
+ bulk_update_not_processed: {
1226
+ title: "Aggiornamento Glovo non elaborato",
1227
+ explanation: "Glovo ha segnalato che questo aggiornamento parziale non \xE8 stato elaborato. La causa precisa richiede una verifica.",
1228
+ nextStep: "Controlla con l\u2019assistenza la configurazione e i tentativi gi\xE0 in corso prima di scegliere un nuovo invio."
1229
+ },
1230
+ bulk_update_provider_failed: {
1231
+ title: "Errore Glovo durante l\u2019aggiornamento",
1232
+ explanation: "Glovo ha segnalato un errore del proprio sistema per questo aggiornamento parziale. Non \xE8 stata identificata una causa legata a un articolo.",
1233
+ nextStep: "Verifica con l\u2019assistenza lo stato del servizio e gli invii gi\xE0 in corso prima di ripetere l\u2019aggiornamento."
1234
+ },
1235
+ menu_publication_outcome_unknown: {
1236
+ title: "Esito della pubblicazione non confermato",
1237
+ explanation: "Non \xE8 arrivata una conferma conclusiva per questo invio. Non \xE8 confermato se il menu sia stato applicato.",
1238
+ nextStep: "Verifica l\u2019esito di questa pubblicazione con l\u2019assistenza prima di inviarla nuovamente."
1239
+ },
1240
+ menu_publication_payload_rejected: {
1241
+ title: "Menu rifiutato durante la pubblicazione",
1242
+ explanation: "Il servizio esterno ha segnalato dati non validi per questo upload. Lo stato non identifica da solo il prodotto o il modificatore errato.",
1243
+ nextStep: "Controlla la validazione del menu e i dettagli disponibili. Correggi la causa prima di scegliere una nuova sincronizzazione."
1244
+ },
1245
+ menu_publication_access_denied: {
1246
+ title: "Il servizio esterno non pu\xF2 accedere al menu",
1247
+ explanation: "Il servizio esterno ha segnalato un accesso non autorizzato al contenuto di questo upload.",
1248
+ nextStep: "Chiedi all\u2019assistenza di verificare l\u2019accessibilit\xE0 del menu e la configurazione dell\u2019integrazione."
1249
+ },
1250
+ menu_publication_fetch_failed: {
1251
+ title: "Il servizio esterno non ha scaricato il menu",
1252
+ explanation: "Il servizio esterno ha segnalato un errore durante il recupero del contenuto di questa pubblicazione. Non \xE8 una diagnosi su uno specifico articolo.",
1253
+ nextStep: "Verifica con l\u2019assistenza la disponibilit\xE0 del contenuto prima di scegliere un nuovo invio."
1254
+ },
1255
+ menu_publication_configuration_invalid: {
1256
+ title: "Pubblicazione non elaborata",
1257
+ explanation: "Il servizio esterno ha segnalato che questa pubblicazione non \xE8 stata elaborata per la configurazione dell\u2019integrazione.",
1258
+ nextStep: "Verifica la configurazione con l\u2019assistenza prima di avviare un nuovo upload."
1259
+ },
1260
+ menu_publication_limit_reached: {
1261
+ title: "Limite di pubblicazione Glovo raggiunto",
1262
+ explanation: "Glovo ha rifiutato questa pubblicazione perch\xE9 \xE8 stato raggiunto il limite di aggiornamenti.",
1263
+ nextStep: "Attendi il ripristino del limite e controlla lo stato delle sincronizzazioni prima di scegliere un nuovo invio."
1264
+ },
1265
+ menu_publication_provider_failed: {
1266
+ title: "Errore del servizio esterno durante la pubblicazione",
1267
+ explanation: "Il servizio esterno ha segnalato un errore del proprio sistema per questo upload. La causa non \xE8 attribuita a un articolo del menu.",
1268
+ nextStep: "Controlla lo stato del servizio con l\u2019assistenza prima di scegliere una nuova sincronizzazione."
1269
+ },
1270
+ menu_publication_schedule_disabled: {
1271
+ title: "Orari del catalogo non abilitati su Glovo",
1272
+ explanation: "Glovo ha rifiutato questa pubblicazione perch\xE9 la funzione di pianificazione del catalogo non \xE8 abilitata per il punto vendita.",
1273
+ nextStep: "Verifica l\u2019abilitazione della funzione con l\u2019assistenza e la configurazione degli orari prima di un nuovo invio."
1274
+ }
1275
+ },
1276
+ en: {
1277
+ menu_publication_generation_failed: {
1278
+ title: "Menu preparation failed",
1279
+ explanation: "The system exhausted its attempts to prepare the new menu. This attempt did not reach publication to the external service.",
1280
+ nextStep: "Review available validation details and contact support with the operation reference. Correct the cause before choosing another attempt."
1281
+ },
1282
+ menu_publication_queue_delivery_failed: {
1283
+ title: "Publication delivery needs verification",
1284
+ explanation: "The menu was prepared, but delivery to the publication process was not confirmed within the allowed attempts. This does not prove rejection by the external service.",
1285
+ nextStep: "Contact support with the operation reference to verify delivery before requesting another submission."
1286
+ },
1287
+ bulk_update_products_not_updated: {
1288
+ title: "Products not updated on Glovo",
1289
+ explanation: "Glovo reported that the listed products were not updated in this submission. Their references match the submitted data; this does not yet identify the rejection cause.",
1290
+ nextStep: "Review these products and existing attempts with support before choosing another submission."
1291
+ },
1292
+ bulk_update_attributes_not_updated: {
1293
+ title: "Modifier choices not updated on Glovo",
1294
+ explanation: "Glovo reported that the listed choices were not updated in this submission. Their references match the submitted data; this does not yet identify the rejection cause.",
1295
+ nextStep: "Review these choices and existing attempts with support before choosing another submission."
1296
+ },
1297
+ bulk_update_evidence_incomplete: {
1298
+ title: "Other affected items cannot be identified reliably",
1299
+ explanation: "Some details of this partial update cannot be uniquely matched to submitted data. Items identified in other reports may not include every affected item.",
1300
+ nextStep: "Ask support to verify the remaining outcome before treating the list as complete or repeating the submission."
1301
+ },
1302
+ bulk_update_outcome_unknown: {
1303
+ title: "Glovo update outcome not confirmed",
1304
+ explanation: "Automatic checks ended while this partial update was still processing. Which changes were applied is not confirmed.",
1305
+ nextStep: "Ask support to verify this submission before repeating it."
1306
+ },
1307
+ bulk_update_partially_processed: {
1308
+ title: "Glovo update only partly applied",
1309
+ explanation: "Glovo confirmed that part of this submission was not applied. This report does not yet identify the affected items or prove that a later submission corrected them.",
1310
+ nextStep: "Review the affected items and existing attempts with support before choosing another submission."
1311
+ },
1312
+ bulk_update_not_processed: {
1313
+ title: "Glovo update not processed",
1314
+ explanation: "Glovo reported that this partial update was not processed. The precise cause requires verification.",
1315
+ nextStep: "Review configuration and existing attempts with support before choosing another submission."
1316
+ },
1317
+ bulk_update_provider_failed: {
1318
+ title: "Glovo update error",
1319
+ explanation: "Glovo reported a system error for this partial update. No item-specific cause has been identified.",
1320
+ nextStep: "Check service status and existing submissions with support before repeating the update."
1321
+ },
1322
+ menu_publication_outcome_unknown: {
1323
+ title: "Menu publication outcome not confirmed",
1324
+ explanation: "No conclusive confirmation has arrived for this submission. Whether the menu was applied is not confirmed.",
1325
+ nextStep: "Ask support to verify this publication before sending it again."
1326
+ },
1327
+ menu_publication_payload_rejected: {
1328
+ title: "Menu rejected during publication",
1329
+ explanation: "The external service reported invalid data for this upload. The status alone does not identify the faulty product or modifier.",
1330
+ nextStep: "Review menu validation and available details. Correct the cause before choosing another synchronization."
1331
+ },
1332
+ menu_publication_access_denied: {
1333
+ title: "The external service cannot access the menu",
1334
+ explanation: "The external service reported unauthorized access to the content of this upload.",
1335
+ nextStep: "Ask support to check menu access and integration configuration."
1336
+ },
1337
+ menu_publication_fetch_failed: {
1338
+ title: "The external service could not download the menu",
1339
+ explanation: "The external service reported an error retrieving this publication content. This does not diagnose a specific item.",
1340
+ nextStep: "Ask support to verify content availability before choosing another submission."
1341
+ },
1342
+ menu_publication_configuration_invalid: {
1343
+ title: "Publication not processed",
1344
+ explanation: "The external service reported that this publication was not processed because of integration configuration.",
1345
+ nextStep: "Review the configuration with support before starting another upload."
1346
+ },
1347
+ menu_publication_limit_reached: {
1348
+ title: "Glovo publication limit reached",
1349
+ explanation: "Glovo rejected this publication because the update limit was reached.",
1350
+ nextStep: "Wait for the limit to reset and review synchronization status before choosing another submission."
1351
+ },
1352
+ menu_publication_provider_failed: {
1353
+ title: "External service publication error",
1354
+ explanation: "The external service reported a system error for this upload. No menu item has been identified as the cause.",
1355
+ nextStep: "Check provider service status with support before choosing another synchronization."
1356
+ },
1357
+ menu_publication_schedule_disabled: {
1358
+ title: "Glovo catalog scheduling is disabled",
1359
+ explanation: "Glovo rejected this publication because catalog scheduling is not enabled for the store.",
1360
+ nextStep: "Check feature activation with support and review scheduling configuration before submitting again."
1361
+ }
1362
+ }
1363
+ };
1364
+ function describeMenuPublication(code, locale) {
1365
+ if (!code || !Object.hasOwn(messages4[locale], code)) return null;
1366
+ return messages4[locale][code];
1367
+ }
1368
+
1369
+ // src/recorded-order-narrative.ts
1370
+ function describeRecordedOrderRows(finding, locale) {
1371
+ if (!finding || finding.confirmed || finding.resources.some((resource) => resource.role === "cause")) return null;
1372
+ const orders = finding.resources.filter((resource) => resource.kind === "order" && resource.role === "affected");
1373
+ if (orders.length !== 1 || !finding.resources.some(
1374
+ (resource) => resource.kind === "order_item" && resource.role === "affected" && resource.parentIdentifier === orders[0]?.identifier
1375
+ )) return null;
1376
+ return locale === "it" ? {
1377
+ title: "Righe segnalate, causa da verificare",
1378
+ explanation: "Le righe mostrate sono state registrate insieme all\u2019errore. Aiutano a individuare la parte dell\u2019ordine coinvolta, ma non dimostrano quale prodotto, variante o modificatore abbia causato il problema. I nomi appartengono alla registrazione storica e non confermano lo stato attuale del catalogo.",
1379
+ nextStep: "Apri l\u2019ordine e controlla le righe indicate. Richiedi assistenza se non \xE8 disponibile una causa verificabile. Un nuovo tentativo non corregge automaticamente il problema: scegli quali operazioni ritentare soltanto dopo aver chiarito cosa sistemare."
1380
+ } : {
1381
+ title: "Recorded rows, cause still to verify",
1382
+ explanation: "The displayed rows were recorded with the error. They identify the affected part of the order, but do not prove which product, variant or modifier caused the problem. Names come from the historical record and do not confirm the current catalog state.",
1383
+ nextStep: "Open the order and check the indicated rows. Request assistance if no verifiable cause is available. Retrying does not automatically fix the problem: select operations to retry after establishing what needs correction."
1384
+ };
1385
+ }
1386
+
1387
+ // src/tilby-inbound-order-narrative.ts
1388
+ var failures = {
1389
+ tilby_inbound_order_import_failed: {
1390
+ it: [
1391
+ "Importazione ordine Tilby non completata",
1392
+ "La vendita Tilby non \xE8 stata importata come ordine Deliverart. I dati disponibili non identificano un prodotto o una scelta specifici.",
1393
+ "Apri la mappatura dell\u2019ordine e controlla il codice del problema. Correggi i dati necessari, poi seleziona questa importazione per un nuovo tentativo."
1394
+ ],
1395
+ en: [
1396
+ "Tilby order import did not complete",
1397
+ "The Tilby sale was not imported as a Deliverart order. Available evidence does not identify a specific product or choice.",
1398
+ "Open the order mapping and review its failure code. Correct the required data, then select this import for another attempt."
1399
+ ]
1400
+ },
1401
+ tilby_inbound_product_mapping_missing: {
1402
+ it: [
1403
+ "Prodotto Tilby non collegato",
1404
+ "La riga indicata della vendita Tilby non \xE8 collegata a un prodotto del menu Deliverart.",
1405
+ "Controlla il prodotto mostrato e completa il collegamento in Deliverart. Dopo la correzione, scegli quali importazioni ordine ritentare."
1406
+ ],
1407
+ en: [
1408
+ "Tilby product not mapped",
1409
+ "The indicated row in the Tilby sale is not linked to a Deliverart menu product.",
1410
+ "Check the displayed product and complete its mapping in Deliverart. After correcting it, select which order imports to retry."
1411
+ ]
1412
+ },
1413
+ tilby_inbound_variant_mapping_missing: {
1414
+ it: [
1415
+ "Variante Tilby non collegata",
1416
+ "La riga indicata richiede una variante Deliverart, ma non \xE8 stato trovato il collegamento della combinazione Tilby.",
1417
+ "Controlla il prodotto e la variante mostrati, completa il collegamento e poi scegli quali importazioni ordine ritentare."
1418
+ ],
1419
+ en: [
1420
+ "Tilby variant not mapped",
1421
+ "The indicated row requires a Deliverart variant, but its Tilby combination has no mapping.",
1422
+ "Check the displayed product and variant, complete the mapping, then select which order imports to retry."
1423
+ ]
1424
+ },
1425
+ tilby_inbound_modifier_choice_unresolved: {
1426
+ it: [
1427
+ "Scelta del modificatore Tilby non risolta",
1428
+ "La riga e la scelta indicate non corrispondono a un modificatore valido del prodotto Deliverart.",
1429
+ "Controlla il prodotto, il gruppo e la scelta mostrati. Correggi la configurazione e seleziona l\u2019importazione da ritentare."
1430
+ ],
1431
+ en: [
1432
+ "Tilby modifier choice unresolved",
1433
+ "The indicated sale row and choice do not resolve to a valid Deliverart product modifier.",
1434
+ "Check the displayed product, group, and choice. Correct the setup and select the import to retry."
1435
+ ]
1436
+ },
1437
+ tilby_inbound_order_item_unsupported: {
1438
+ it: [
1439
+ "Riga Tilby non importabile",
1440
+ "La riga indicata non pu\xF2 essere rappresentata fedelmente come articolo di un ordine Deliverart.",
1441
+ "Verifica la vendita e la riga mostrata. Se la struttura non \xE8 supportata, chiedi assistenza prima di ritentare."
1442
+ ],
1443
+ en: [
1444
+ "Tilby sale row cannot be imported",
1445
+ "The indicated row cannot be represented faithfully as a Deliverart order item.",
1446
+ "Review the sale and displayed row. If its structure is unsupported, request assistance before retrying."
1447
+ ]
1448
+ }
1449
+ };
1450
+ function describeTilbyInboundOrder(code, locale) {
1451
+ if (!code || !Object.hasOwn(failures, code)) return null;
1452
+ const [title, explanation, nextStep] = failures[code][locale];
1453
+ return { title, explanation, nextStep };
1454
+ }
1455
+
1456
+ // src/tilby-menu-narrative.ts
1457
+ var causes = {
1458
+ tilby_menu_item_identifier_missing: {
1459
+ it: ["Identificativo del prodotto Tilby assente", "La risposta ricevuta durante il tentativo non conteneva l\u2019identificativo del prodotto richiesto. Il riferimento mostrato identifica l\u2019articolo richiesto, non un prodotto Deliverart.", "Controlla che l\u2019articolo esista ancora in Tilby. Se \xE8 presente, chiedi assistenza indicando il riferimento mostrato."],
1460
+ en: ["Tilby product identifier missing", "The response received during the attempt did not contain the requested product\u2019s identifier. The displayed reference identifies the requested item, not a Deliverart product.", "Check whether the item still exists in Tilby. If it does, request assistance and include the displayed reference."]
1461
+ },
1462
+ tilby_menu_category_missing: {
1463
+ it: ["Categoria assente sul prodotto Tilby", "Durante il tentativo, il prodotto Tilby non indicava una categoria. L\u2019importazione del prodotto si \xE8 fermata.", "Assegna al prodotto la categoria corretta in Tilby e controlla che questa possa essere importata."],
1464
+ en: ["Category missing on the Tilby product", "During the attempt, the Tilby product did not reference a category. The product import stopped.", "Assign the correct category to the product in Tilby and check that it can be imported."]
1465
+ },
1466
+ tilby_menu_category_mapping_missing: {
1467
+ it: ["Categoria del prodotto non collegata", "Durante il tentativo, la categoria indicata dal prodotto Tilby non aveva una categoria Deliverart associata.", "Controlla prima gli errori di importazione delle categorie e il collegamento della categoria del prodotto. Correggi la causa prima di riprovare il menu."],
1468
+ en: ["Product category not mapped", "During the attempt, the category referenced by the Tilby product had no associated Deliverart category.", "First review category import errors and the mapping for the product\u2019s category. Correct the cause before retrying the menu."]
1469
+ },
1470
+ tilby_menu_department_missing: {
1471
+ it: ["Reparto fiscale assente sul prodotto Tilby", "Durante il tentativo, il prodotto Tilby non indicava un reparto fiscale. L\u2019importazione non poteva determinare l\u2019IVA del prodotto.", "Controlla il reparto fiscale assegnato al prodotto in Tilby. Fai verificare l\u2019associazione corretta prima di modificare dati fiscali."],
1472
+ en: ["Fiscal department missing on the Tilby product", "During the attempt, the Tilby product did not reference a fiscal department. The import could not determine the product\u2019s VAT.", "Review the product\u2019s fiscal department in Tilby. Have the correct association verified before changing fiscal data."]
1473
+ },
1474
+ tilby_menu_department_mapping_unresolved: {
1475
+ it: ["Reparto fiscale del prodotto da verificare", "Durante il tentativo, il reparto fiscale del prodotto non aveva un collegamento risolto con un\u2019aliquota IVA utilizzabile in Deliverart.", "Controlla gli errori della sincronizzazione fiscale e il collegamento del reparto. Fai verificare reparto e aliquota prima di riprovare il menu."],
1476
+ en: ["Product fiscal department needs review", "During the attempt, the product\u2019s fiscal department had no resolved mapping with a usable VAT rate in Deliverart.", "Review fiscal synchronization errors and the department mapping. Have the department and VAT rate verified before retrying the menu."]
1477
+ },
1478
+ tilby_menu_bundle_unsupported: {
1479
+ it: ["Prodotto raggruppato Tilby non importabile", "Il tentativo ha ricevuto un articolo contrassegnato come prodotto raggruppato in Tilby, una struttura che questo importatore non pu\xF2 convertire.", "Controlla la struttura del prodotto in Tilby e chiedi assistenza per una rappresentazione supportata. Riprovare senza correggere la struttura non risolve questo errore."],
1480
+ en: ["Tilby grouped product cannot be imported", "The attempt received an item marked as a grouped product in Tilby, a structure this importer cannot convert.", "Review the product\u2019s structure in Tilby and request assistance with a supported representation. Retrying without correcting the structure does not resolve this error."]
1481
+ },
1482
+ tilby_menu_components_unsupported: {
1483
+ it: ["Composizione del prodotto non importabile", "Il tentativo ha ricevuto componenti del prodotto che non possono essere convertiti in ingredienti rimovibili con la struttura attuale.", "Controlla la composizione del prodotto in Tilby e chiedi assistenza per i componenti non compatibili. Il riferimento disponibile identifica il prodotto; non individua il singolo componente."],
1484
+ en: ["Product composition cannot be imported", "The attempt received product components that cannot be converted into removable ingredients with their current structure.", "Review the product\u2019s composition in Tilby and request assistance with incompatible components. The available reference identifies the product, not an individual component."]
1485
+ },
1486
+ tilby_menu_variations_unsupported: {
1487
+ it: ["Varianti o modificatori del prodotto non importabili", "Durante il tentativo, la struttura delle varianti o dei modificatori del prodotto non poteva essere convertita in Deliverart. La segnalazione identifica il prodotto, ma non una singola scelta.", "Controlla combinazioni, varianti e modificatori del prodotto e della sua categoria in Tilby. Chiedi assistenza per individuare la struttura non supportata prima di riprovare."],
1488
+ en: ["Product variants or modifiers cannot be imported", "During the attempt, the product\u2019s variant or modifier structure could not be converted into Deliverart. The finding identifies the product, but not an individual choice.", "Review combinations, variants and modifiers on the product and its category in Tilby. Request assistance identifying the unsupported structure before retrying."]
1489
+ }
1490
+ };
1491
+ function describeTilbyMenu(code, locale) {
1492
+ if (!code || !Object.hasOwn(causes, code)) return null;
1493
+ const [title, explanation, nextStep] = causes[code][locale];
1494
+ return {
1495
+ title,
1496
+ explanation: `${explanation} ${locale === "it" ? "Questa segnalazione descrive il tentativo registrato; lo stato attuale non \xE8 ancora verificato." : "This finding describes the recorded attempt; the current state has not been verified."}`,
1497
+ nextStep: `${nextStep} ${locale === "it" ? "Dopo il controllo, scegli quali operazioni recuperare." : "After reviewing it, choose which operations to recover."}`
1498
+ };
1499
+ }
1500
+
1501
+ // src/tilby-order-narrative.ts
1502
+ var causes2 = {
1503
+ tilby_seller_missing: {
1504
+ it: ["Venditore Tilby non configurato", "La configurazione non indica il venditore da associare alla vendita Tilby.", "Controlla il venditore predefinito nella configurazione Tilby; chiedi assistenza se non puoi modificarlo."],
1505
+ en: ["Tilby seller not configured", "The configuration does not identify the seller to assign to the Tilby sale.", "Check the default seller in the Tilby configuration; request assistance if you cannot change it."]
1506
+ },
1507
+ tilby_department_mapping_missing: {
1508
+ it: ["Reparto fiscale Tilby non risolto", "Non \xE8 stato trovato un reparto Tilby utilizzabile per l\u2019aliquota della riga indicata.", "Controlla i collegamenti dei reparti fiscali Tilby e l\u2019aliquota dell\u2019elemento."],
1509
+ en: ["Tilby fiscal department unresolved", "No usable Tilby department was found for the indicated row\u2019s tax rate.", "Check Tilby fiscal department mappings and the item\u2019s tax rate."]
1510
+ },
1511
+ tilby_product_mapping_missing_for_variant: {
1512
+ it: ["Prodotto Tilby non collegato per la variante", "La variante selezionata richiede un collegamento del prodotto a Tilby che non \xE8 disponibile. Questo non significa che ogni prodotto senza collegamento sia bloccato.", "Controlla il riferimento del prodotto e il suo collegamento Tilby prima di verificare la combinazione della variante."],
1513
+ en: ["Tilby product mapping unavailable for variant", "The selected variant requires a Tilby product mapping that is unavailable. This does not mean every unmapped product is blocked.", "Check the product reference and its Tilby mapping before checking the variant combination."]
1514
+ },
1515
+ tilby_variant_mapping_missing: {
1516
+ it: ["Combinazione della variante Tilby mancante", "Il prodotto \xE8 collegato, ma la variante selezionata non ha una combinazione Tilby utilizzabile.", "Controlla la variante indicata e il suo collegamento alla combinazione del prodotto Tilby."],
1517
+ en: ["Tilby variant combination missing", "The product is mapped, but the selected variant has no usable Tilby combination.", "Check the indicated variant and its mapping to the Tilby product combination."]
1518
+ },
1519
+ tilby_modifier_mapping_missing: {
1520
+ it: ["Modificatore Tilby non risolto", "Non \xE8 stato possibile risolvere la variazione Tilby per il modificatore e il prodotto indicati. Le scelte mostrano il contesto; non sono tutte necessariamente mancanti.", "Controlla il collegamento del modificatore e le variazioni del prodotto Tilby."],
1521
+ en: ["Tilby modifier unresolved", "The Tilby variation could not be resolved for the indicated modifier and product. Choices provide context; they are not necessarily all missing.", "Check the modifier mapping and the Tilby product variations."]
1522
+ },
1523
+ tilby_choice_mapping_missing: {
1524
+ it: ["Scelta del modificatore Tilby non risolta", "La variazione Tilby \xE8 stata identificata, ma il valore della scelta indicata non \xE8 disponibile.", "Controlla quella scelta, l\u2019eventuale prezzo specifico e il valore associato alla variazione Tilby."],
1525
+ en: ["Tilby modifier choice unresolved", "The Tilby variation was identified, but the indicated choice value is unavailable.", "Check that choice, any price override, and the value mapped to the Tilby variation."]
1526
+ }
1527
+ };
1528
+ function describeTilbyOrder(code, locale) {
1529
+ if (!code || !Object.hasOwn(causes2, code)) return null;
1530
+ const [title, explanation, action] = causes2[code][locale];
1531
+ return {
1532
+ title,
1533
+ explanation: `${explanation} ${locale === "it" ? "Questa validazione si \xE8 fermata prima dell\u2019invio e non conferma l\u2019esito di altri tentativi." : "This validation stopped before submission and does not establish the outcome of other attempts."}`,
1534
+ nextStep: `${action} ${locale === "it" ? "Dopo la correzione, scegli quali operazioni ritentare. Una mappatura locale non prova che la vendita sia arrivata in cassa." : "After correcting it, select which operations to retry. A local mapping does not prove that the sale reached the register."}`
1535
+ };
1536
+ }
1537
+
1538
+ // src/tilby-resource-name.ts
1539
+ var labels2 = {
1540
+ stock: { kind: "configuration", it: "Riga disponibilit\xE0 Tilby", en: "Tilby stock row" },
1541
+ vat: { kind: "tax", it: "Aliquota IVA Tilby", en: "Tilby VAT rate" },
1542
+ departments: { kind: "configuration", it: "Reparto Tilby", en: "Tilby department" },
1543
+ categories: { kind: "category", it: "Categoria Tilby", en: "Tilby category" },
1544
+ components: { kind: "configuration", it: "Componente Tilby", en: "Tilby component" },
1545
+ products: { kind: "product", it: "Prodotto Tilby", en: "Tilby product" }
1546
+ };
1547
+ function tilbyResourceName(resource, locale) {
1548
+ const match = resource.identifier.match(/^tilby:([a-z]+):(0|[1-9][0-9]{0,18})$/);
1549
+ if (!match || !Object.hasOwn(labels2, match[1])) return null;
1550
+ const label = labels2[match[1]];
1551
+ if (label.kind !== resource.kind) return null;
1552
+ const identity = `${label[locale]} \xB7 ID ${match[2]}`;
1553
+ return resource.name ? `${resource.name} \xB7 ${identity}` : identity;
1554
+ }
1555
+
1556
+ // src/tilby-stock-narrative.ts
1557
+ var causes3 = {
1558
+ tilby_stock_raw_material_unsupported: {
1559
+ it: ["Disponibilit\xE0 di una materia prima non importabile", "Il tentativo ha registrato una riga di magazzino riferita a una materia prima, senza un prodotto Deliverart a cui applicare la disponibilit\xE0.", "Controlla la disponibilit\xE0 del prodotto corrispondente in Tilby. Chiedi assistenza se devi gestire disponibilit\xE0 basate sulle materie prime."],
1560
+ en: ["Raw-material availability cannot be imported", "The attempt recorded a stock row for a raw material, with no Deliverart product to receive its availability.", "Review availability on the corresponding product in Tilby. Request assistance if you need raw-material-based availability."]
1561
+ },
1562
+ tilby_stock_item_identifier_missing: {
1563
+ it: ["Riferimento del prodotto assente nella disponibilit\xE0", "Il tentativo ha registrato una riga di disponibilit\xE0 senza il riferimento del prodotto Tilby.", "Controlla la riga di magazzino in Tilby e il prodotto a cui appartiene. Se il riferimento resta assente, chiedi assistenza prima di riprovare."],
1564
+ en: ["Product reference missing from availability", "The attempt recorded an availability row without its Tilby product reference.", "Review the stock row in Tilby and its associated product. If the reference remains missing, request assistance before retrying."]
1565
+ },
1566
+ tilby_stock_location_mismatch: {
1567
+ it: ["Disponibilit\xE0 riferita a un altro magazzino", "Il tentativo ha registrato una riga di disponibilit\xE0 appartenente a un magazzino diverso da quello configurato per questa integrazione.", "Controlla il magazzino configurato nell\u2019integrazione e quello della riga Tilby. Correggi la configurazione solo se non corrisponde al magazzino che vuoi sincronizzare."],
1568
+ en: ["Availability belongs to another stock location", "The attempt recorded an availability row belonging to a different stock location from the one configured for this integration.", "Check the integration\u2019s configured stock location and the Tilby row\u2019s location. Correct the configuration only if it does not match the location you intend to synchronize."]
1569
+ },
1570
+ tilby_stock_availability_missing: {
1571
+ it: ["Disponibilit\xE0 non determinabile", "Il tentativo non ha trovato nella riga Tilby un valore utilizzabile di disponibilit\xE0 o quantit\xE0.", "Controlla quantit\xE0 e disponibilit\xE0 della riga in Tilby. Se i dati sono presenti ma non vengono interpretati, chiedi assistenza."],
1572
+ en: ["Availability cannot be determined", "The attempt did not find a usable availability or quantity value in the Tilby row.", "Check the row\u2019s quantity and availability in Tilby. If the data exists but cannot be interpreted, request assistance."]
1573
+ },
1574
+ tilby_stock_product_mapping_missing: {
1575
+ it: ["Prodotto non collegato per la disponibilit\xE0", "Durante il tentativo, il prodotto associato alla riga Tilby non aveva un collegamento al catalogo Deliverart.", "Controlla il prodotto nel catalogo Tilby e il suo collegamento in Deliverart. Completa o correggi il collegamento prima di ritentare la sincronizzazione delle disponibilit\xE0."],
1576
+ en: ["Product not mapped for availability", "During the attempt, the product associated with the Tilby stock row had no mapping to the Deliverart catalog.", "Check the product in the Tilby catalog and its Deliverart mapping. Complete or correct the mapping before retrying availability synchronization."]
1577
+ },
1578
+ tilby_stock_variant_mapping_missing: {
1579
+ it: ["Variante non collegata per la disponibilit\xE0", "Durante il tentativo, la combinazione associata alla riga Tilby non aveva una variante Deliverart utilizzabile.", "Controlla il collegamento della combinazione Tilby alla variante del prodotto in Deliverart. Correggilo prima di ritentare le disponibilit\xE0."],
1580
+ en: ["Variant not mapped for availability", "During the attempt, the combination associated with the Tilby stock row had no usable Deliverart variant.", "Check the mapping from the Tilby combination to the Deliverart product variant. Correct it before retrying availability synchronization."]
1581
+ },
1582
+ tilby_stock_local_product_missing: {
1583
+ it: ["Prodotto Deliverart assente dal collegamento", "Il tentativo ha trovato un collegamento Tilby senza il prodotto Deliverart a cui applicare la disponibilit\xE0.", "Controlla se il prodotto Deliverart \xE8 stato rimosso e ripristina un collegamento valido al prodotto corretto. Chiedi assistenza se non puoi correggerlo."],
1584
+ en: ["Deliverart product missing from the mapping", "The attempt found a Tilby mapping without the Deliverart product that should receive availability.", "Check whether the Deliverart product was removed and restore a valid mapping to the correct product. Request assistance if you cannot correct it."]
1585
+ }
1586
+ };
1587
+ function describeTilbyStock(code, locale) {
1588
+ if (!code || !Object.hasOwn(causes3, code)) return null;
1589
+ const [title, explanation, nextStep] = causes3[code][locale];
1590
+ return {
1591
+ title,
1592
+ explanation: `${explanation} ${locale === "it" ? "Questa segnalazione descrive il tentativo registrato; lo stato attuale non \xE8 ancora verificato." : "This finding describes the recorded attempt; the current state has not been verified."}`,
1593
+ nextStep: `${nextStep} ${locale === "it" ? "Dopo il controllo, scegli quali operazioni recuperare." : "After reviewing it, choose which operations to recover."}`
1594
+ };
1595
+ }
1596
+
1597
+ // src/workflow-narrative.ts
1598
+ var messages5 = {
1599
+ it: {
1600
+ sync_process_timed_out: {
1601
+ title: "Sincronizzazione oltre il tempo previsto",
1602
+ explanation: "La sincronizzazione non ha raggiunto il completamento entro il limite previsto ed \xE8 stata segnata come scaduta. Questo non dimostra che nessun dato sia stato aggiornato: il risultato potrebbe essere parziale.",
1603
+ nextStep: "Controlla il risultato e gli errori del processo prima di avviare una nuova sincronizzazione. Se manca una causa verificabile, chiedi assistenza. La diagnosi non riavvia il processo."
1604
+ },
1605
+ sync_process_partial_failure: {
1606
+ title: "Errori durante la sincronizzazione",
1607
+ explanation: "Il processo ha registrato errori. Le fasi indicate mostrano dove sono stati registrati, ma non identificano da sole la causa o tutti gli elementi coinvolti. Gli aggiornamenti riusciti non garantiscono che tutti i dati siano sincronizzati; lo stato della lavorazione indica se il processo \xE8 ancora in corso.",
1608
+ nextStep: "Esamina gli errori della sincronizzazione e correggi gli elementi per cui \xE8 disponibile una causa verificata. Attendi la fine di un processo ancora attivo prima di decidere il recupero."
1609
+ },
1610
+ sync_process_incomplete: {
1611
+ title: "Completamento della sincronizzazione non confermato",
1612
+ explanation: "Il processo riporta una fine senza lo stato di completamento previsto. Non \xE8 possibile confermare che tutti gli aggiornamenti siano stati applicati.",
1613
+ nextStep: "Controlla lo storico della sincronizzazione e chiedi assistenza prima di ripeterla. La segnalazione conserva il risultato incerto senza dichiarare riusciti gli aggiornamenti."
1614
+ }
1615
+ },
1616
+ en: {
1617
+ sync_process_timed_out: {
1618
+ title: "Synchronization exceeded its time limit",
1619
+ explanation: "The synchronization did not reach completion within its allowed time and was marked as timed out. This does not prove that no data was updated: the result may be partial.",
1620
+ nextStep: "Review the process result and errors before starting another synchronization. Request assistance when no verified cause is available. Diagnosis does not restart the process."
1621
+ },
1622
+ sync_process_partial_failure: {
1623
+ title: "Errors during synchronization",
1624
+ explanation: "The process recorded errors. Listed steps show where they were recorded, but do not by themselves identify the cause or every affected item. Successful updates do not guarantee that all data is synchronized; the operation status shows whether the process is still running.",
1625
+ nextStep: "Review synchronization errors and correct resources with a verified cause. Wait for an active process to finish before deciding how to recover it."
1626
+ },
1627
+ sync_process_incomplete: {
1628
+ title: "Synchronization completion not confirmed",
1629
+ explanation: "The process records an end without the expected completed state. It cannot confirm that every update was applied.",
1630
+ nextStep: "Review synchronization history and request assistance before repeating it. The issue preserves the uncertain result without declaring the updates successful."
1631
+ }
1632
+ }
1633
+ };
1634
+ function describeWorkflow(code, locale) {
1635
+ if (code !== "sync_process_timed_out" && code !== "sync_process_partial_failure" && code !== "sync_process_incomplete")
1636
+ return null;
1637
+ return messages5[locale][code];
1638
+ }
1639
+
1640
+ // src/narrative.ts
1641
+ var copy2 = {
1642
+ it: {
1643
+ importFailed: {
1644
+ title: "Importazione del catalogo interrotta",
1645
+ explanation: "L\u2019importazione del catalogo del ristorante si \xE8 fermata. Alcuni elementi potrebbero essere gi\xE0 stati importati; il processo non conferma un\u2019importazione completa. La causa precisa deve ancora essere verificata.",
1646
+ nextStep: "Controlla i dettagli dell\u2019importazione del ristorante e gli elementi segnalati. Il riepilogo non avvia una nuova importazione: richiedi assistenza se non \xE8 indicata una correzione verificabile."
1647
+ },
1648
+ importPartial: {
1649
+ title: "Errori durante l\u2019importazione del catalogo",
1650
+ explanation: "L\u2019importazione ha registrato errori su una parte del catalogo. Gli elementi elaborati correttamente non dimostrano che tutto il catalogo sia stato importato. Lo stato della lavorazione indica se \xE8 ancora in corso.",
1651
+ nextStep: "Controlla gli errori dell\u2019importazione del ristorante. Attendi la fine di una lavorazione ancora in corso prima di valutarne il risultato; non avviare importazioni duplicate."
1652
+ },
1653
+ incomplete: {
1654
+ title: "Diagnosi da completare",
1655
+ explanation: "Non ci sono ancora informazioni verificate sufficienti per identificare la causa e gli elementi coinvolti.",
1656
+ nextStep: "Aggiorna la verifica. Se il problema persiste, richiedi assistenza dalla scheda del problema."
1657
+ },
1658
+ missingProduct: {
1659
+ title: "Collegamento del prodotto mancante",
1660
+ explanation: "Il prodotto indicato non aveva un collegamento al catalogo della cassa quando questa operazione si \xE8 fermata. Questo errore non dimostra che manchino anche le varianti o i modificatori.",
1661
+ nextStep: "Verifica il prodotto nel catalogo della cassa e il suo collegamento in Deliverart. Dopo averlo corretto, aggiorna la verifica e scegli quali operazioni ritentare."
1662
+ },
1663
+ missingModifier: {
1664
+ title: "Collegamento del modificatore mancante",
1665
+ explanation: "Il modificatore indicato non aveva un collegamento al catalogo della cassa quando questa operazione si \xE8 fermata. Le scelte mostrate descrivono il contesto: non sono necessariamente mancanti.",
1666
+ nextStep: "Verifica il modificatore nel catalogo della cassa e il suo collegamento in Deliverart. Dopo averlo corretto, aggiorna la verifica e scegli quali operazioni ritentare."
1667
+ }
1668
+ },
1669
+ en: {
1670
+ importFailed: {
1671
+ title: "Catalog import stopped",
1672
+ explanation: "The restaurant catalog import stopped. Some resources may already have been imported; the process does not confirm a complete import. The precise cause still needs verification.",
1673
+ nextStep: "Review the restaurant import details and reported resources. This overview does not start another import: request assistance when no verified correction is available."
1674
+ },
1675
+ importPartial: {
1676
+ title: "Errors during catalog import",
1677
+ explanation: "The import recorded errors in part of the catalog. Successfully processed resources do not prove the entire catalog was imported. The operation status shows whether it is still running.",
1678
+ nextStep: "Review the restaurant import errors. Wait for any running operation to finish before assessing its result; do not start duplicate imports."
1679
+ },
1680
+ incomplete: {
1681
+ title: "Diagnosis incomplete",
1682
+ explanation: "There is not enough verified information yet to identify the cause and affected resources.",
1683
+ nextStep: "Refresh the verification. If the problem persists, request assistance from the problem details."
1684
+ },
1685
+ missingProduct: {
1686
+ title: "Product mapping missing",
1687
+ explanation: "The indicated product had no cash register catalog mapping when this operation stopped. This error does not prove that its variants or modifiers are also missing.",
1688
+ nextStep: "Check the product in the cash register catalog and its mapping in Deliverart. After correcting it, refresh the verification and select the operations to retry."
1689
+ },
1690
+ missingModifier: {
1691
+ title: "Modifier mapping missing",
1692
+ explanation: "The indicated modifier had no cash register catalog mapping when this operation stopped. The choices shown provide context; they are not necessarily missing.",
1693
+ nextStep: "Check the modifier in the cash register catalog and its mapping in Deliverart. After correcting it, refresh the verification and select the operations to retry."
1694
+ }
1695
+ }
1696
+ };
1697
+ function describeDiagnostic(finding, locale) {
1698
+ const kitchen = describeKitchenSetup(finding?.code, locale);
1699
+ if (kitchen) return kitchen;
1700
+ const tilbyInboundOrder = describeTilbyInboundOrder(finding?.code, locale);
1701
+ if (tilbyInboundOrder) return tilbyInboundOrder;
1702
+ const tilby = describeTilbyOrder(finding?.code, locale);
1703
+ if (tilby) return tilby;
1704
+ const integration = describeIntegrationIssue(finding?.code, locale);
1705
+ if (integration) return integration;
1706
+ const operational = describeElephantOperation(finding?.code, locale);
1707
+ if (operational) return operational;
1708
+ const imported = describeElephantImport(finding?.code, locale);
1709
+ if (imported) return imported;
1710
+ const menu = describeMenuValidation(finding?.code, locale);
1711
+ if (menu) return menu;
1712
+ const publication = describeMenuPublication(finding?.code, locale) ?? describeDeliverooPublication(finding?.code, locale);
1713
+ if (publication) return publication;
1714
+ const tilbyMenu = describeTilbyMenu(finding?.code, locale);
1715
+ if (tilbyMenu) return tilbyMenu;
1716
+ const stock = describeTilbyStock(finding?.code, locale);
1717
+ if (stock) return stock;
1718
+ const workflow = describeWorkflow(finding?.code, locale);
1719
+ if (workflow) return workflow;
1720
+ const dependency = describeOrderDependency(finding, locale);
1721
+ if (dependency) return dependency;
1722
+ if (finding?.code === "catalog_import_failed") return copy2[locale].importFailed;
1723
+ if (finding?.code === "catalog_import_partial_failure") return copy2[locale].importPartial;
1724
+ if (finding?.confirmed && finding.code === "catalog_product_mapping_missing")
1725
+ return copy2[locale].missingProduct;
1726
+ return finding?.confirmed && finding.code === "catalog_modifier_mapping_missing" ? copy2[locale].missingModifier : describeRecordedOrderRows(finding, locale) ?? copy2[locale].incomplete;
1727
+ }
1728
+ function resourceLanguageName(translations, locale) {
1729
+ if (translations[locale]) return translations[locale];
1730
+ return Object.entries(translations).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).find(
1731
+ ([key, value]) => Boolean(value) && key.replaceAll("_", "-").split("-")[0]?.toLowerCase() === locale
1732
+ )?.[1];
1733
+ }
1734
+ function diagnosticResourceName(resource, locale, service) {
1735
+ if (resource.kind === "configuration") {
1736
+ const phase = describeElephantPhase(resource.identifier, locale);
1737
+ if (phase) return phase;
1738
+ }
1739
+ if (resource.kind === "process_step") return describeProcessStep(resource.identifier, locale);
1740
+ const cassaLabel = cassaResourceName(resource, locale);
1741
+ if (cassaLabel) return cassaLabel;
1742
+ const tilbyLabel = tilbyResourceName(resource, locale);
1743
+ if (tilbyLabel) return tilbyLabel;
1744
+ const scopes2 = {
1745
+ tilby_default_seller: { it: "Venditore predefinito Tilby", en: "Default Tilby seller" },
1746
+ menu_sync: { it: "Sincronizzazione del menu", en: "Menu synchronization" },
1747
+ opening_hours_sync: { it: "Aggiornamento degli orari", en: "Opening hours update" },
1748
+ store_status: { it: "Stato del punto vendita", en: "Store status" },
1749
+ availability_sync: { it: "Aggiornamento delle disponibilit\xE0", en: "Availability update" },
1750
+ order_ingress: { it: "Ricezione degli ordini", en: "Order reception" },
1751
+ order_export: { it: "Invio degli ordini", en: "Order export" }
1752
+ };
1753
+ const integrationLabel = resource.kind === "integration" ? `${diagnosticServiceName(service) ?? (locale === "it" ? "Integrazione" : "Integration")} \xB7 ${resource.identifier.slice(0, 8)}` : null;
1754
+ const scopeLabel = resource.kind === "configuration" && Object.hasOwn(scopes2, resource.identifier) ? scopes2[resource.identifier][locale] : null;
1755
+ if (resource.kind === "configuration" && resource.identifier === "menu_type_delivery")
1756
+ return locale === "it" ? "Menu consegna" : "Delivery menu";
1757
+ if (resource.kind === "configuration" && resource.identifier === "menu_type_collection")
1758
+ return locale === "it" ? "Menu asporto" : "Collection menu";
1759
+ const external = resource.kind === "publication" && resource.identifier.match(
1760
+ /^elephant:[a-f\d-]{36}:(product|variant|option|option_group):([a-f\d]{64})$/
1761
+ );
1762
+ const externalLabels = {
1763
+ product: { it: "Prodotto Elephant", en: "Elephant product" },
1764
+ variant: { it: "Variante Elephant", en: "Elephant variant" },
1765
+ option: { it: "Scelta Elephant", en: "Elephant option" },
1766
+ option_group: { it: "Gruppo Elephant", en: "Elephant group" }
1767
+ };
1768
+ const externalLabel = external ? `${externalLabels[external[1]][locale]} \xB7 ${external[2].slice(0, 8)}` : null;
1769
+ return resourceLanguageName(resource.translations, locale) || resource.name || resourceLanguageName(resource.translations, "en") || resourceLanguageName(resource.translations, "it") || integrationLabel || scopeLabel || externalLabel || (resource.kind === "configuration" ? describeDiagnosticScope(resource.identifier, locale) : null) || (resource.kind === "process" ? `${locale === "it" ? "Lavorazione" : "Process"} \xB7 ${resource.identifier.slice(0, 8)}` : null) || resource.identifier;
1770
+ }
1771
+ function describeVerification(verification, locale) {
1772
+ if (!verification.checkedAt)
1773
+ return locale === "it" ? "Verifica non ancora eseguita" : "Not checked yet";
1774
+ if (!verification.fresh)
1775
+ return locale === "it" ? "Verifica da aggiornare: il risultato precedente non conferma lo stato attuale." : "Refresh needed: the previous result does not confirm the current state.";
1776
+ const localExplanation = describeLocalVerification(verification, locale);
1777
+ if (localExplanation) return localExplanation;
1778
+ if (verification.outcome === "cause_absent" && verification.reason === "publication_receipt_succeeded") {
1779
+ return locale === "it" ? "L\u2019esito salvato di questa specifica comunicazione \xE8 positivo. Non \xE8 stato eseguito un nuovo invio n\xE9 verificato il menu attualmente online." : "The saved outcome of this specific notification is successful. No submission was retried and the currently live menu was not checked.";
1780
+ }
1781
+ if (verification.outcome === "unknown" && verification.reason === "publication_receipt_rejected") {
1782
+ return locale === "it" ? "Il dettaglio ora disponibile per questa comunicazione conferma un errore. Verifica le nuove segnalazioni prima di scegliere come intervenire." : "The details now available for this notification confirm an error. Review the new findings before choosing how to proceed.";
1783
+ }
1784
+ if (verification.outcome === "cause_absent" && verification.reason === "local_mapping_present") {
1785
+ return locale === "it" ? "Il collegamento locale \xE8 presente. Le operazioni non sono state ritentate e la disponibilit\xE0 nella cassa non \xE8 stata verificata." : "The local mapping exists. Operations have not been retried and cash register availability has not been verified.";
1786
+ }
1787
+ if (verification.outcome === "cause_present" && verification.reason === "mapping_missing") {
1788
+ return locale === "it" ? "Il collegamento locale manca ancora." : "The local mapping is still missing.";
1789
+ }
1790
+ return locale === "it" ? "Verifica non conclusiva. Non \xE8 possibile confermare che la causa sia stata corretta." : "Verification is inconclusive. Correction of the cause cannot be confirmed.";
1791
+ }
1792
+
1793
+ // src/local-finding-narrative.ts
1794
+ var explanations2 = {
1795
+ catalog_product_mapping_missing: { it: "Al momento del controllo manca il collegamento locale del prodotto alla cassa.", en: "At check time, the local product mapping to the cash register is missing." },
1796
+ catalog_variant_mapping_missing: { it: "Al momento del controllo manca il collegamento locale della variante alla cassa.", en: "At check time, the local variant mapping to the cash register is missing." },
1797
+ catalog_sales_mode_mapping_missing: { it: "Al momento del controllo manca il collegamento locale della modalit\xE0 di vendita alla cassa.", en: "At check time, the local sales mode mapping to the cash register is missing." },
1798
+ catalog_modifier_mapping_missing: { it: "Al momento del controllo manca il collegamento locale del gruppo di modificatori alla cassa. Le scelte mostrate servono a individuare il gruppo nell\u2019ordine.", en: "At check time, the local modifier group mapping to the cash register is missing. The displayed choices locate the group in the order." },
1799
+ catalog_choice_mapping_missing: { it: "Al momento del controllo manca il collegamento locale della scelta alla cassa.", en: "At check time, the local choice mapping to the cash register is missing." },
1800
+ catalog_component_mapping_missing: { it: "Al momento del controllo manca il collegamento locale del gruppo al prodotto composto indicato.", en: "At check time, the local group mapping for the indicated bundle is missing." },
1801
+ catalog_component_mapping_ambiguous: { it: "Al momento del controllo esistono pi\xF9 collegamenti per lo stesso gruppo nel prodotto composto. Non \xE8 possibile scegliere in modo univoco.", en: "At check time, multiple mappings exist for the same group in the bundle. A unique mapping cannot be selected." },
1802
+ catalog_modifier_definition_removed: { it: "Al momento del controllo il gruppo dell\u2019ordine non ha pi\xF9 un riferimento al catalogo. Il nome \xE8 quello registrato nell\u2019ordine.", en: "At check time, the order modifier group no longer references the catalog. Its name comes from the recorded order." },
1803
+ catalog_component_definition_removed: { it: "Al momento del controllo il gruppo del menu composto non ha pi\xF9 un riferimento al catalogo. Il nome \xE8 quello registrato nell\u2019ordine.", en: "At check time, the bundle group no longer references the catalog. Its name comes from the recorded order." },
1804
+ catalog_product_reference_unavailable: { it: "Al momento del controllo la riga dell\u2019ordine non ha un riferimento disponibile al prodotto del catalogo.", en: "At check time, the order row has no available catalog product reference." },
1805
+ catalog_choice_reference_unavailable: { it: "Al momento del controllo la scelta dell\u2019ordine non ha un riferimento disponibile al catalogo.", en: "At check time, the order choice has no available catalog reference." },
1806
+ catalog_component_reference_unavailable: { it: "Al momento del controllo la scelta del menu composto non ha un riferimento disponibile al catalogo.", en: "At check time, the bundle choice has no available catalog reference." },
1807
+ catalog_component_category_unresolved: { it: "Al momento del controllo il collegamento della scelta non identifica una categoria della cassa univoca. La categoria pu\xF2 essere assente o ambigua.", en: "At check time, the choice mapping does not identify a unique cash register category. The category may be missing or ambiguous." },
1808
+ catalog_component_tax_mapping_missing: { it: "Al momento del controllo manca un reparto della cassa collegato all\u2019aliquota IVA della scelta.", en: "At check time, no cash register department is mapped to the choice\u2019s VAT rate." },
1809
+ catalog_component_variant_id_missing: { it: "Al momento del controllo il prodotto \xE8 collegato alla cassa, ma manca l\u2019identificativo necessario per inviare la scelta, anche dopo la ricerca della variante base.", en: "At check time, the product is mapped to the cash register, but the identifier needed to send the choice is missing, including after checking the base variant." }
1810
+ };
1811
+ function describeLocalDiagnostic(finding, locale) {
1812
+ const narrative = describeDiagnostic(finding, locale);
1813
+ const explanation = finding.confirmed && Object.hasOwn(explanations2, finding.code) ? explanations2[finding.code][locale] : locale === "it" ? "Il controllo locale non dispone di una spiegazione verificata per questo risultato. Consulta gli elementi indicati o richiedi assistenza." : "The local check has no verified explanation for this result. Review the indicated resources or request assistance.";
1814
+ return { ...narrative, explanation };
1815
+ }
1816
+
1817
+ // src/problem-queue.ts
1818
+ var import_zod6 = require("zod");
1819
+ var diagnosticProblemQueueItemSchema = import_zod6.z.object({
1820
+ id: diagnosticIdSchema,
1821
+ pointOfSaleId: diagnosticIdSchema,
1822
+ integrationId: diagnosticIdSchema,
1823
+ code: import_zod6.z.string().regex(/^[a-z][a-z0-9_]{2,99}$/),
1824
+ confirmed: import_zod6.z.boolean(),
1825
+ firstSeenAt: import_zod6.z.string().datetime({ offset: true }),
1826
+ lastSeenAt: import_zod6.z.string().datetime({ offset: true }),
1827
+ resolvedAt: import_zod6.z.string().datetime({ offset: true }).nullable()
1828
+ });
1829
+ var diagnosticProblemQueueSchema = import_zod6.z.object({
1830
+ data: import_zod6.z.array(diagnosticProblemQueueItemSchema).max(100),
1831
+ nextCursor: import_zod6.z.string().min(1).max(512).nullable()
1832
+ });
1833
+ var diagnosticProblemQueueQuerySchema = import_zod6.z.object({
1834
+ state: import_zod6.z.enum(["open", "resolved", "all"]).optional(),
1835
+ pointOfSaleId: diagnosticIdSchema.optional(),
1836
+ integrationId: diagnosticIdSchema.optional(),
1837
+ code: import_zod6.z.string().regex(/^[a-z][a-z0-9_]{2,99}$/).optional(),
1838
+ itemsPerPage: import_zod6.z.number().int().min(1).max(100).optional(),
1839
+ cursor: import_zod6.z.string().min(1).max(512).optional()
1840
+ });
1841
+
1842
+ // src/problems.ts
1843
+ var import_zod7 = require("zod");
1844
+ var count = import_zod7.z.number().int().nonnegative();
1845
+ var diagnosticAttentionSchema = import_zod7.z.enum([
1846
+ "action_required",
1847
+ "automatic_recovery",
1848
+ "resolved"
1849
+ ]);
1850
+ var diagnosticRecoverySummarySchema = import_zod7.z.object({
1851
+ attention: diagnosticAttentionSchema,
1852
+ total: count,
1853
+ succeeded: count,
1854
+ manuallyHandled: count,
1855
+ superseded: count,
1856
+ actionRequired: count,
1857
+ automaticRecovery: count,
1858
+ inProgress: count,
1859
+ outcomeUnknown: count,
1860
+ outstanding: count
1861
+ });
1862
+ var operationShape = {
1863
+ actions: diagnosticOperationActionsSchema.nullable().optional().catch(null),
1864
+ context: diagnosticOperationContextSchema.nullable().optional().catch(null),
1865
+ id: diagnosticIdSchema,
1866
+ service: import_zod7.z.string().nullable(),
1867
+ source: diagnosticSourceSchema,
1868
+ recoveryState: diagnosticRecoveryStateSchema,
1869
+ revision: import_zod7.z.number().int().positive(),
1870
+ observedAt: diagnosticDateSchema,
1871
+ nextRecoveryAt: diagnosticDateSchema.nullable(),
1872
+ manuallyClosedAt: diagnosticDateSchema.nullable()
1873
+ };
1874
+ var diagnosticOperationSchema = import_zod7.z.object({
1875
+ ...operationShape,
1876
+ pointOfSaleId: diagnosticIdSchema,
1877
+ integrationId: diagnosticIdSchema
1878
+ });
1879
+ var diagnosticAffectedOperationSchema = import_zod7.z.object({
1880
+ ...operationShape,
1881
+ evidence: readableDiagnosticFindingSchema,
1882
+ evidenceComplete: import_zod7.z.boolean(),
1883
+ evidenceSource: diagnosticSourceSchema.nullable()
1884
+ }).transform((value) => ({
1885
+ ...value,
1886
+ evidenceComplete: value.evidenceComplete && value.evidence !== null
1887
+ }));
1888
+ var diagnosticProblemSchema = import_zod7.z.object({
1889
+ id: diagnosticIdSchema,
1890
+ pointOfSaleId: diagnosticIdSchema,
1891
+ integrationId: diagnosticIdSchema,
1892
+ code: diagnosticCodeSchema,
1893
+ confirmed: import_zod7.z.boolean(),
1894
+ causeCorrectedAt: diagnosticDateSchema.nullable(),
1895
+ summary: diagnosticRecoverySummarySchema,
1896
+ operations: import_zod7.z.array(diagnosticAffectedOperationSchema).max(100),
1897
+ page: import_zod7.z.number().int().positive(),
1898
+ itemsPerPage: import_zod7.z.number().int().min(1).max(100),
1899
+ hasNextPage: import_zod7.z.boolean(),
1900
+ verification: diagnosticVerificationSchema
1901
+ });
1902
+ var diagnosticProblemSummarySchema = import_zod7.z.object({
1903
+ id: diagnosticIdSchema,
1904
+ pointOfSaleId: diagnosticIdSchema,
1905
+ integrationId: diagnosticIdSchema,
1906
+ code: diagnosticCodeSchema,
1907
+ confirmed: import_zod7.z.boolean(),
1908
+ summary: diagnosticRecoverySummarySchema,
1909
+ exampleOperation: diagnosticAffectedOperationSchema.nullable(),
1910
+ detailPath: import_zod7.z.string().regex(/^\/integration_diagnostic_problems\/[a-f\d-]+$/i)
1911
+ });
1912
+ var diagnosticOverviewSchema = import_zod7.z.object({
1913
+ pointOfSaleId: diagnosticIdSchema,
1914
+ openProblems: count,
1915
+ affectedOperations: count,
1916
+ outstandingOperations: count,
1917
+ generatedAt: diagnosticDateSchema,
1918
+ problemAttention: import_zod7.z.object({
1919
+ action_required: count,
1920
+ automatic_recovery: count,
1921
+ resolved: count
1922
+ }),
1923
+ operationOutcomes: import_zod7.z.object({
1924
+ action_required: count,
1925
+ automatic_recovery: count,
1926
+ in_progress: count,
1927
+ outcome_unknown: count,
1928
+ succeeded: count,
1929
+ superseded: count,
1930
+ manually_handled: count
1931
+ })
1932
+ });
1933
+
1934
+ // src/realtime.ts
1935
+ var import_zod8 = require("zod");
1936
+ var diagnosticInvalidationSchema = import_zod8.z.object({
1937
+ type: import_zod8.z.literal("update"),
1938
+ class: import_zod8.z.literal("App\\IntegrationDiagnostics\\Realtime\\DiagnosticInvalidation"),
1939
+ payload: import_zod8.z.object({
1940
+ event: import_zod8.z.literal("update"),
1941
+ data: import_zod8.z.object({
1942
+ pointOfSaleId: diagnosticIdSchema,
1943
+ revision: import_zod8.z.string().regex(/^[1-9][0-9]{0,18}$/)
1944
+ })
1945
+ })
1946
+ });
1947
+ function diagnosticInvalidationRevision(envelope, pointOfSaleId) {
1948
+ const result = diagnosticInvalidationSchema.safeParse(envelope);
1949
+ return result.success && result.data.payload.data.pointOfSaleId === pointOfSaleId ? result.data.payload.data.revision : null;
1950
+ }
1951
+
1952
+ // src/recovery.ts
1953
+ var import_zod9 = require("zod");
1954
+ var diagnosticRecoveryInputSchema = import_zod9.z.strictObject({
1955
+ requestKey: diagnosticIdSchema,
1956
+ operations: import_zod9.z.array(
1957
+ import_zod9.z.strictObject({ operationId: diagnosticIdSchema, revision: import_zod9.z.number().int().positive() })
1958
+ ).min(1).max(100)
1959
+ });
1960
+ var diagnosticManualClosureInputSchema = import_zod9.z.strictObject({
1961
+ revision: import_zod9.z.number().int().positive(),
1962
+ reason: import_zod9.z.string().trim().min(1).max(1e3)
1963
+ });
1964
+ var diagnosticRecoveryPreviewSchema = import_zod9.z.object({
1965
+ id: diagnosticIdSchema,
1966
+ pointOfSaleId: diagnosticIdSchema,
1967
+ evaluatedAt: diagnosticDateSchema,
1968
+ items: import_zod9.z.array(
1969
+ import_zod9.z.object({
1970
+ operationId: diagnosticIdSchema,
1971
+ revision: import_zod9.z.number().int().positive(),
1972
+ eligible: import_zod9.z.boolean(),
1973
+ code: diagnosticCodeSchema,
1974
+ action: diagnosticRecoveryActionSchema
1975
+ }).transform((value) => ({ ...value, eligible: value.eligible && value.action !== null }))
1976
+ ).max(100)
1977
+ });
1978
+ var diagnosticRecoveryRequestSchema = import_zod9.z.object({
1979
+ id: diagnosticIdSchema,
1980
+ pointOfSaleId: diagnosticIdSchema,
1981
+ requestedAt: diagnosticDateSchema,
1982
+ items: import_zod9.z.array(
1983
+ import_zod9.z.object({
1984
+ id: diagnosticIdSchema,
1985
+ operationId: diagnosticIdSchema,
1986
+ expectedRevision: import_zod9.z.number().int().positive(),
1987
+ status: import_zod9.z.enum(["queued", "running", "submitted", "rejected", "failed", "unavailable"]),
1988
+ resultCode: diagnosticCodeSchema,
1989
+ action: diagnosticRecoveryActionSchema,
1990
+ submittedSource: diagnosticSourceSchema.nullable(),
1991
+ service: import_zod9.z.string().max(64).nullable().optional().catch(null),
1992
+ context: diagnosticOperationContextSchema.nullable().optional().catch(null),
1993
+ recoveryState: diagnosticRecoveryStateSchema.nullable().optional().catch(null),
1994
+ observedAt: diagnosticDateSchema.nullable().optional(),
1995
+ completedAt: diagnosticDateSchema.nullable(),
1996
+ deliveryState: import_zod9.z.enum(["not_required", "attention_required", "published", "pending"]).nullable()
1997
+ })
1998
+ ).max(100)
1999
+ });
2000
+
2001
+ // src/recovery-narrative.ts
2002
+ function describeDiagnosticRecovery(sourceKind, action, locale) {
2003
+ if (sourceKind === "deliveroo_menu_generation" && action === "reconcile")
2004
+ return locale === "it" ? "Richiederai un nuovo ciclo di controlli sullo stato della pubblicazione gi\xE0 inviata a Deliveroo. Il menu non verr\xE0 reinviato. I risultati precedenti resteranno nello storico. Se manca una conferma riferita all\u2019invio esatto, l\u2019esito rester\xE0 incerto anche quando il menu remoto risulta uguale." : "You will request another cycle of checks on the publication already submitted to Deliveroo. The menu will not be resent. Previous results will remain in history. Without confirmation tied to the exact submission, its outcome remains uncertain even when the remote menu matches.";
2005
+ if ((sourceKind === "glovo_menu_publication" || sourceKind === "glovo_bulk_update") && action === "reconcile")
2006
+ return locale === "it" ? "Richiederai fino a quattro controlli sullo stato dello stesso invio a Glovo. Il menu o gli aggiornamenti delle disponibilit\xE0 non verranno reinviati. I risultati precedenti resteranno nello storico. Se Glovo non conferma l\u2019esito di questo invio, lo stato rester\xE0 incerto: potrai scegliere se richiedere un altro controllo." : "You will request up to four status checks for the same submission to Glovo. The menu or availability updates will not be resent. Previous results will remain in history. If Glovo does not confirm this submission\u2019s outcome, its status will remain uncertain: you can choose whether to request another check.";
2007
+ if (action !== "sync_current_state") return null;
2008
+ if (sourceKind === "glovo_menu_submission" || sourceKind === "glovo_menu_publication")
2009
+ return locale === "it" ? "Avvierai una nuova pubblicazione dell\u2019intero menu attuale su Glovo. Correggi prima gli elementi segnalati: verr\xE0 usato il catalogo aggiornato. Il tentativo precedente rester\xE0 nello storico. La preparazione del menu e l\u2019accettazione dell\u2019invio non confermano la pubblicazione: attendi l\u2019esito di Glovo. Un invio dall\u2019esito incerto blocca una nuova pubblicazione. Questa azione non ritenta gli ordini." : "You will start a new publication of the entire current menu to Glovo. Correct the reported items first: the updated catalog will be used. The previous attempt will remain in history. Menu preparation and submission acceptance do not confirm publication: wait for Glovo\u2019s outcome. An uncertain submission blocks a new publication. This action does not retry orders.";
2010
+ if (sourceKind === "justeat_menu_submission")
2011
+ return locale === "it" ? "Avvierai una nuova pubblicazione dell\u2019intero menu attuale su Just Eat. Correggi prima gli elementi segnalati: il nuovo tentativo user\xE0 il catalogo aggiornato. Il tentativo precedente rester\xE0 nello storico. La richiesta accettata e il menu generato non confermano la pubblicazione: attendi la conferma di Just Eat. Un invio con esito incerto impedisce una nuova pubblicazione." : "You will start a new publication of the entire current menu to Just Eat. Correct the reported items first: the new attempt will use the updated catalog. The previous attempt will remain in history. An accepted request and a generated menu do not confirm publication: wait for Just Eat\u2019s confirmation. A submission with an uncertain outcome prevents a new publication.";
2012
+ if (sourceKind === "deliveroo_menu_generation")
2013
+ return locale === "it" ? "Avvierai una nuova pubblicazione dell\u2019intero menu attuale su Deliveroo, non soltanto degli elementi segnalati. Correggi prima il menu. Il tentativo precedente rester\xE0 nello storico. L\u2019accettazione della richiesta non conferma la pubblicazione: attendi l\u2019esito di Deliveroo e il successivo aggiornamento delle disponibilit\xE0. Un invio precedente con esito incerto impedisce una nuova pubblicazione." : "You will start a new publication of the entire current menu to Deliveroo, not only the reported items. Correct the menu first. The previous attempt will remain in history. Request acceptance does not confirm publication: wait for Deliveroo\u2019s outcome and the subsequent availability update. An earlier submission with an uncertain outcome prevents a new publication.";
2014
+ if (sourceKind === "cassa_in_cloud_sync_customers")
2015
+ return locale === "it" ? "Avvierai una nuova importazione completa dei clienti da CassaInCloud a Deliverart. Verranno aggiornati i clienti collegati e importati quelli mancanti, non soltanto gli elementi segnalati. Il tentativo precedente rester\xE0 nello storico. Gli aggiornamenti in Deliverart possono attivare le altre sincronizzazioni configurate." : "You will start a new full customer import from CassaInCloud into Deliverart. Linked customers will be updated and missing customers imported, not only the reported items. The previous attempt will remain in history. Updates in Deliverart may trigger other configured synchronizations.";
2016
+ if (sourceKind === "cassa_in_cloud_sync_sales_modes")
2017
+ return locale === "it" ? "Avvierai una nuova importazione completa delle modalit\xE0 di vendita da CassaInCloud a Deliverart. Verranno aggiornati i nomi delle modalit\xE0 collegate e importate quelle mancanti, non soltanto gli elementi segnalati. Il tentativo precedente rester\xE0 nello storico. Gli aggiornamenti in Deliverart possono attivare le altre sincronizzazioni configurate." : "You will start a new full sales mode import from CassaInCloud into Deliverart. Names of linked sales modes will be updated and missing sales modes imported, not only the reported items. The previous attempt will remain in history. Updates in Deliverart may trigger other configured synchronizations.";
2018
+ if (sourceKind === "cassa_in_cloud_sync_timetables")
2019
+ return locale === "it" ? "Avvierai una nuova importazione completa degli orari da CassaInCloud a Deliverart. Gli orari attuali di apertura, ritiro e consegna del punto vendita verranno sostituiti in base alla configurazione in cassa, non soltanto gli elementi segnalati. Controlla gli orari in cassa prima di confermare. Il tentativo precedente rester\xE0 nello storico. Gli aggiornamenti possono attivare le altre sincronizzazioni configurate." : "You will start a new full timetable import from CassaInCloud into Deliverart. Current opening, collection and delivery hours for the point of sale will be replaced according to the cash register configuration, not only the reported items. Review the cash register hours before confirming. The previous attempt will remain in history. Updates may trigger other configured synchronizations.";
2020
+ if (sourceKind === "tilby_sync_stock")
2021
+ return locale === "it" ? "Avvierai una nuova lettura completa delle disponibilit\xE0 da Tilby per il magazzino configurato. La disponibilit\xE0 dei prodotti e delle varianti collegati in Deliverart verr\xE0 aggiornata, non soltanto quella degli elementi segnalati. Correggi prima i collegamenti mancanti. Il tentativo precedente rester\xE0 nello storico. Gli aggiornamenti possono attivare le altre sincronizzazioni configurate. Questa azione non crea movimenti di magazzino in Tilby e non ritenta gli ordini." : "You will start a new full availability read from Tilby for the configured stock location. Availability of linked products and variants in Deliverart will be updated, not only the reported items. Correct missing mappings first. The previous attempt will remain in history. Updates may trigger other configured synchronizations. This action does not create stock movements in Tilby or retry orders.";
2022
+ if (sourceKind === "cassa_in_cloud_sync_menu")
2023
+ return locale === "it" ? "Avvierai una nuova importazione completa del menu da CassaInCloud a Deliverart, non soltanto degli elementi segnalati. Controlla prima il catalogo in cassa: i dati collegati verranno aggiornati e gli elementi collegati non pi\xF9 presenti in cassa possono essere rimossi da Deliverart. Il tentativo precedente rester\xE0 nello storico. Questa azione non ritenta gli ordini: scegli separatamente quali recuperare." : "You will start a new full menu import from CassaInCloud into Deliverart, not only the reported items. Review the cash register catalog first: linked data will be updated and linked items no longer present in the register may be removed from Deliverart. The previous attempt will remain in history. This action does not retry orders: select which orders to recover separately.";
2024
+ if (sourceKind === "tilby_sync_menu")
2025
+ return locale === "it" ? "Avvierai una nuova importazione completa del menu da Tilby a Deliverart: categorie, componenti e prodotti, non soltanto gli elementi segnalati. Il catalogo collegato pu\xF2 essere aggiornato: controlla prima i dati in Tilby. Gli elementi che richiedono una correzione manuale possono restare da risolvere. Il tentativo precedente rester\xE0 nello storico. Questa azione non ritenta gli ordini: scegli separatamente quali recuperare." : "You will start a new full menu import from Tilby into Deliverart: categories, components and products, not only the reported items. Linked catalog data may be updated: review the data in Tilby first. Items requiring manual correction may remain unresolved. The previous attempt will remain in history. This action does not retry orders: select which orders to recover separately.";
2026
+ if (sourceKind === "tilby_sync_customers")
2027
+ return locale === "it" ? "Avvierai una nuova importazione completa dei clienti da Tilby a Deliverart. Verranno aggiornati i clienti collegati e importati quelli mancanti, non soltanto gli elementi segnalati. Il tentativo precedente rester\xE0 nello storico. Gli aggiornamenti in Deliverart possono attivare le altre sincronizzazioni configurate. Questa azione non ritenta gli ordini." : "You will start a new full customer import from Tilby into Deliverart. Linked customers will be updated and missing customers imported, not only the reported items. The previous attempt will remain in history. Updates in Deliverart may trigger other configured synchronizations. This action does not retry orders.";
2028
+ if (sourceKind === "tilby_sync_fiscal_mappings")
2029
+ return locale === "it" ? "Avvierai una nuova importazione completa di aliquote IVA e reparti da Tilby a Deliverart. Verranno aggiornati i collegamenti locali e creati quelli mancanti, mantenendo le risoluzioni manuali esistenti. Il tentativo precedente rester\xE0 nello storico. Questa azione non modifica i dati fiscali in Tilby e non ritenta gli ordini: scegli separatamente quali ordini recuperare dopo la verifica." : "You will start a new full import of VAT rates and departments from Tilby into Deliverart. Local mappings will be updated and missing mappings created, preserving existing manual resolutions. The previous attempt will remain in history. This action does not change fiscal data in Tilby or retry orders: select orders to recover separately after verification.";
2030
+ if (sourceKind !== "elephant_catalog_import") return null;
2031
+ return locale === "it" ? "Avvierai una nuova importazione dell\u2019intero catalogo attuale di questo ristorante da Elephant a Deliverart, non soltanto degli elementi segnalati. Verranno riutilizzati i collegamenti esistenti; il tentativo precedente rester\xE0 nello storico. Usa questa azione per correggere un disallineamento: gli aggiornamenti ordinari arrivano gi\xE0 tramite Elephant." : "You will start a new import of this restaurant\u2019s entire current catalog from Elephant into Deliverart, not only the reported items. Existing mappings will be reused and the previous attempt will remain in history. Use this action to correct a mismatch: routine updates already arrive through Elephant.";
2032
+ }
2033
+ function describeDiagnosticRecoveryItem(item, locale) {
2034
+ const state = item.status === "unavailable" ? "unavailable" : item.status === "rejected" ? "rejected" : item.status === "failed" || item.deliveryState === "attention_required" ? "attention" : item.status === "submitted" ? item.deliveryState === "published" ? "published" : "submitted" : item.status === "queued" || item.status === "running" ? "queued" : "unavailable";
2035
+ const copy3 = {
2036
+ it: {
2037
+ queued: [
2038
+ "Richiesta in coda",
2039
+ "Il sistema deve ancora ricontrollare i permessi e lo stato dell\u2019operazione. Nessun risultato \xE8 ancora confermato."
2040
+ ],
2041
+ submitted: [
2042
+ "Tentativo preparato",
2043
+ "Il nuovo tentativo \xE8 registrato e attende l\u2019invio al processo di esecuzione. Non \xE8 ancora un\u2019operazione riuscita."
2044
+ ],
2045
+ published: [
2046
+ "Inviato al processo",
2047
+ "Il tentativo \xE8 stato consegnato al processo di esecuzione. Controlla lo stato dell\u2019operazione nella gestione errori per conoscerne l\u2019esito."
2048
+ ],
2049
+ attention: [
2050
+ "Invio da verificare",
2051
+ "Il recupero automatico di questa richiesta si \xE8 fermato. Richiedi assistenza con il riferimento della ricevuta prima di avviare altri tentativi."
2052
+ ],
2053
+ rejected: [
2054
+ "Tentativo non avviato",
2055
+ "Lo stato o i permessi sono cambiati dopo la selezione. Aggiorna la gestione errori e controlla quali operazioni sono ancora recuperabili."
2056
+ ],
2057
+ unavailable: [
2058
+ "Dettagli non disponibili",
2059
+ "Non hai pi\xF9 accesso ai dettagli di questa operazione, oppure la sorgente non \xE8 disponibile. Non \xE8 possibile dedurne l\u2019esito."
2060
+ ]
2061
+ },
2062
+ en: {
2063
+ queued: [
2064
+ "Request queued",
2065
+ "The system still needs to recheck permissions and operation state. No outcome has been confirmed yet."
2066
+ ],
2067
+ submitted: [
2068
+ "Attempt prepared",
2069
+ "The new attempt is recorded and waiting for delivery to the execution process. This does not mean the operation succeeded."
2070
+ ],
2071
+ published: [
2072
+ "Sent for execution",
2073
+ "The attempt was delivered to the execution process. Check the operation in error management for its outcome."
2074
+ ],
2075
+ attention: [
2076
+ "Delivery needs attention",
2077
+ "Automatic recovery of this request stopped. Contact support with the receipt reference before starting further attempts."
2078
+ ],
2079
+ rejected: [
2080
+ "Attempt not started",
2081
+ "State or permissions changed after selection. Refresh error management and check which operations can still be recovered."
2082
+ ],
2083
+ unavailable: [
2084
+ "Details unavailable",
2085
+ "You no longer have access to this operation\u2019s details, or its source is unavailable. Its outcome cannot be inferred."
2086
+ ]
2087
+ }
2088
+ };
2089
+ const [title, explanation] = copy3[locale][state];
2090
+ return { state, title, explanation };
2091
+ }
2092
+
2093
+ // src/requests/CloseDiagnosticOperation.ts
2094
+ var import_sdk_js_core = require("@deliverart/sdk-js-core");
2095
+ var CloseDiagnosticOperation = class extends import_sdk_js_core.AbstractApiRequest {
2096
+ constructor(operationId, input) {
2097
+ super(input);
2098
+ this.operationId = operationId;
2099
+ this.method = "POST";
2100
+ this.contentType = "application/json";
2101
+ this.accept = "application/json";
2102
+ this.inputSchema = diagnosticManualClosureInputSchema;
2103
+ this.outputSchema = diagnosticOperationSchema;
2104
+ this.querySchema = void 0;
2105
+ this.headersSchema = void 0;
2106
+ }
2107
+ getPath() {
2108
+ return `/integration_diagnostic_operations/${encodeURIComponent(this.operationId)}/close`;
2109
+ }
2110
+ };
2111
+
2112
+ // src/requests/GetDiagnosticAssistanceDetails.ts
2113
+ var import_sdk_js_core2 = require("@deliverart/sdk-js-core");
2114
+ var import_zod10 = require("zod");
2115
+ var emptyInputSchema = import_zod10.z.undefined();
2116
+ var GetDiagnosticAssistanceDetails = class extends import_sdk_js_core2.AbstractApiRequest {
2117
+ constructor(id, options) {
2118
+ super(void 0, options);
2119
+ this.id = id;
2120
+ this.method = "GET";
2121
+ this.contentType = "application/json";
2122
+ this.accept = "application/json";
2123
+ this.inputSchema = emptyInputSchema;
2124
+ this.outputSchema = diagnosticAssistanceSchema;
2125
+ this.querySchema = diagnosticAssistanceQuerySchema;
2126
+ this.headersSchema = void 0;
2127
+ }
2128
+ getPath() {
2129
+ return `/integration_diagnostic_assistance/${encodeURIComponent(this.id)}`;
2130
+ }
2131
+ };
2132
+
2133
+ // src/requests/GetDiagnosticAssistanceHistory.ts
2134
+ var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
2135
+ var import_zod11 = require("zod");
2136
+ var emptyInputSchema2 = import_zod11.z.undefined();
2137
+ var GetDiagnosticAssistanceHistory = class extends import_sdk_js_core3.AbstractApiRequest {
2138
+ constructor(id, options) {
2139
+ super(void 0, options);
2140
+ this.id = id;
2141
+ this.method = "GET";
2142
+ this.contentType = "application/json";
2143
+ this.accept = "application/json";
2144
+ this.inputSchema = emptyInputSchema2;
2145
+ this.outputSchema = diagnosticAssistanceHistorySchema;
2146
+ this.querySchema = diagnosticAssistanceQuerySchema;
2147
+ this.headersSchema = void 0;
2148
+ }
2149
+ getPath() {
2150
+ return `/integration_diagnostic_problems/${encodeURIComponent(this.id)}/assistance`;
2151
+ }
2152
+ };
2153
+
2154
+ // src/requests/GetDiagnosticAssistanceInternal.ts
2155
+ var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
2156
+ var import_zod12 = require("zod");
2157
+ var emptyInputSchema3 = import_zod12.z.undefined();
2158
+ var GetDiagnosticAssistanceInternal = class extends import_sdk_js_core4.AbstractApiRequest {
2159
+ constructor(id, options) {
2160
+ super(void 0, options);
2161
+ this.id = id;
2162
+ this.method = "GET";
2163
+ this.contentType = "application/json";
2164
+ this.accept = "application/json";
2165
+ this.inputSchema = emptyInputSchema3;
2166
+ this.outputSchema = diagnosticAssistanceInternalSchema;
2167
+ this.querySchema = diagnosticAssistanceQuerySchema;
2168
+ this.headersSchema = void 0;
2169
+ }
2170
+ getPath() {
2171
+ return `/integration_diagnostic_assistance/${encodeURIComponent(this.id)}/internal`;
2172
+ }
2173
+ };
2174
+
2175
+ // src/requests/GetDiagnosticAssistanceQueue.ts
2176
+ var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
2177
+ var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
2178
+ var import_zod13 = require("zod");
2179
+ var emptyInputSchema4 = import_zod13.z.undefined();
2180
+ var diagnosticAssistanceQueueQuerySchema = import_zod13.z.object({
2181
+ page: import_zod13.z.number().int().min(1).max(1e5).optional(),
2182
+ itemsPerPage: import_zod13.z.number().int().min(1).max(100).optional(),
2183
+ state: import_zod13.z.enum(["open", "all", "requested", "assigned", "waiting_for_customer", "completed"]).optional(),
2184
+ assignment: import_zod13.z.enum(["all", "mine", "unassigned"]).optional(),
2185
+ pointOfSaleId: diagnosticIdSchema.optional(),
2186
+ integrationId: diagnosticIdSchema.optional()
2187
+ });
2188
+ var GetDiagnosticAssistanceQueue = class extends import_sdk_js_core5.AbstractApiRequest {
2189
+ constructor(options) {
2190
+ super(void 0, options);
2191
+ this.method = "GET";
2192
+ this.contentType = "application/json";
2193
+ this.accept = "application/json";
2194
+ this.inputSchema = emptyInputSchema4;
2195
+ this.outputSchema = (0, import_sdk_js_global_types.createPaginatedSchema)(diagnosticAssistanceQueueItemSchema);
2196
+ this.listItemSchema = diagnosticAssistanceQueueItemSchema;
2197
+ this.paginationDefaultEnabled = true;
2198
+ this.querySchema = diagnosticAssistanceQueueQuerySchema;
2199
+ this.headersSchema = void 0;
2200
+ }
2201
+ getPath() {
2202
+ return "/integration_diagnostic_assistance_queue";
2203
+ }
2204
+ };
2205
+
2206
+ // src/requests/GetDiagnosticAttemptHistory.ts
2207
+ var import_sdk_js_core6 = require("@deliverart/sdk-js-core");
2208
+ var import_zod14 = require("zod");
2209
+ var empty = import_zod14.z.undefined();
2210
+ var diagnosticAttemptHistoryQuerySchema = import_zod14.z.object({
2211
+ page: import_zod14.z.number().int().min(1).max(1e5).optional(),
2212
+ itemsPerPage: import_zod14.z.number().int().min(1).max(100).optional()
2213
+ });
2214
+ var GetDiagnosticAttemptHistory = class extends import_sdk_js_core6.AbstractApiRequest {
2215
+ constructor(operationId, options) {
2216
+ super(void 0, options);
2217
+ this.operationId = operationId;
2218
+ this.method = "GET";
2219
+ this.contentType = "application/json";
2220
+ this.accept = "application/json";
2221
+ this.inputSchema = empty;
2222
+ this.outputSchema = diagnosticAttemptHistorySchema;
2223
+ this.querySchema = diagnosticAttemptHistoryQuerySchema;
2224
+ this.headersSchema = void 0;
2225
+ }
2226
+ getPath() {
2227
+ return `/integration_diagnostic_operations/${encodeURIComponent(this.operationId)}/attempts`;
2228
+ }
2229
+ };
2230
+
2231
+ // src/requests/GetDiagnosticOperationDetails.ts
2232
+ var import_sdk_js_core7 = require("@deliverart/sdk-js-core");
2233
+ var import_zod15 = require("zod");
2234
+ var emptyInputSchema5 = import_zod15.z.undefined();
2235
+ var GetDiagnosticOperationDetails = class extends import_sdk_js_core7.AbstractApiRequest {
2236
+ constructor(operationId) {
2237
+ super(void 0);
2238
+ this.operationId = operationId;
2239
+ this.method = "GET";
2240
+ this.contentType = "application/json";
2241
+ this.accept = "application/json";
2242
+ this.inputSchema = emptyInputSchema5;
2243
+ this.outputSchema = diagnosticOperationSchema;
2244
+ this.querySchema = void 0;
2245
+ this.headersSchema = void 0;
2246
+ }
2247
+ getPath() {
2248
+ return `/integration_diagnostic_operations/${encodeURIComponent(this.operationId)}`;
2249
+ }
2250
+ };
2251
+
2252
+ // src/requests/GetDiagnosticOverview.ts
2253
+ var import_sdk_js_core8 = require("@deliverart/sdk-js-core");
2254
+ var import_zod16 = require("zod");
2255
+ var emptyInputSchema6 = import_zod16.z.undefined();
2256
+ var GetDiagnosticOverview = class extends import_sdk_js_core8.AbstractApiRequest {
2257
+ constructor(posId) {
2258
+ super(void 0);
2259
+ this.posId = posId;
2260
+ this.method = "GET";
2261
+ this.contentType = "application/json";
2262
+ this.accept = "application/json";
2263
+ this.inputSchema = emptyInputSchema6;
2264
+ this.outputSchema = diagnosticOverviewSchema;
2265
+ this.querySchema = void 0;
2266
+ this.headersSchema = void 0;
2267
+ }
2268
+ getPath() {
2269
+ return `/point_of_sales/${encodeURIComponent(this.posId)}/integration_diagnostic_overview`;
2270
+ }
2271
+ };
2272
+
2273
+ // src/requests/GetDiagnosticProblemDetails.ts
2274
+ var import_sdk_js_core9 = require("@deliverart/sdk-js-core");
2275
+ var import_zod17 = require("zod");
2276
+ var emptyInputSchema7 = import_zod17.z.undefined();
2277
+ var diagnosticProblemPageQuerySchema = import_zod17.z.object({
2278
+ page: import_zod17.z.number().int().min(1).max(1e5).optional(),
2279
+ itemsPerPage: import_zod17.z.number().int().min(1).max(100).optional()
2280
+ });
2281
+ var GetDiagnosticProblemDetails = class extends import_sdk_js_core9.AbstractApiRequest {
2282
+ constructor(problemId, options) {
2283
+ super(void 0, options);
2284
+ this.problemId = problemId;
2285
+ this.method = "GET";
2286
+ this.contentType = "application/json";
2287
+ this.accept = "application/json";
2288
+ this.inputSchema = emptyInputSchema7;
2289
+ this.outputSchema = diagnosticProblemSchema;
2290
+ this.querySchema = diagnosticProblemPageQuerySchema;
2291
+ this.headersSchema = void 0;
2292
+ }
2293
+ getPath() {
2294
+ return `/integration_diagnostic_problems/${encodeURIComponent(this.problemId)}`;
2295
+ }
2296
+ };
2297
+
2298
+ // src/requests/GetDiagnosticProblemQueue.ts
2299
+ var import_sdk_js_core10 = require("@deliverart/sdk-js-core");
2300
+ var import_zod18 = require("zod");
2301
+ var emptyInputSchema8 = import_zod18.z.undefined();
2302
+ var GetDiagnosticProblemQueue = class extends import_sdk_js_core10.AbstractApiRequest {
2303
+ constructor(options) {
2304
+ super(void 0, options);
2305
+ this.method = "GET";
2306
+ this.contentType = "application/json";
2307
+ this.accept = "application/json";
2308
+ this.inputSchema = emptyInputSchema8;
2309
+ this.outputSchema = diagnosticProblemQueueSchema;
2310
+ this.querySchema = diagnosticProblemQueueQuerySchema;
2311
+ this.headersSchema = void 0;
2312
+ }
2313
+ getPath() {
2314
+ return "/integration_diagnostic_problem_queue";
2315
+ }
2316
+ };
2317
+
2318
+ // src/requests/GetDiagnosticProblems.ts
2319
+ var import_sdk_js_core11 = require("@deliverart/sdk-js-core");
2320
+ var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
2321
+ var import_zod19 = require("zod");
2322
+ var emptyInputSchema9 = import_zod19.z.undefined();
2323
+ var diagnosticProblemsQuerySchema = import_zod19.z.object({
2324
+ page: import_zod19.z.number().int().min(1).max(1e5).optional(),
2325
+ itemsPerPage: import_zod19.z.number().int().min(1).max(100).optional(),
2326
+ state: import_zod19.z.enum(["open", "resolved", "all"]).optional(),
2327
+ integrationId: diagnosticIdSchema.optional(),
2328
+ attention: diagnosticAttentionSchema.optional()
2329
+ });
2330
+ var GetDiagnosticProblems = class extends import_sdk_js_core11.AbstractApiRequest {
2331
+ constructor(posId, options) {
2332
+ super(void 0, options);
2333
+ this.posId = posId;
2334
+ this.method = "GET";
2335
+ this.contentType = "application/json";
2336
+ this.accept = "application/json";
2337
+ this.inputSchema = emptyInputSchema9;
2338
+ this.outputSchema = (0, import_sdk_js_global_types2.createPaginatedSchema)(diagnosticProblemSummarySchema);
2339
+ this.listItemSchema = diagnosticProblemSummarySchema;
2340
+ this.paginationDefaultEnabled = true;
2341
+ this.querySchema = diagnosticProblemsQuerySchema;
2342
+ this.headersSchema = void 0;
2343
+ }
2344
+ getPath() {
2345
+ return `/point_of_sales/${encodeURIComponent(this.posId)}/integration_diagnostic_problems`;
2346
+ }
2347
+ };
2348
+
2349
+ // src/requests/GetDiagnosticRecoveryHistory.ts
2350
+ var import_sdk_js_core12 = require("@deliverart/sdk-js-core");
2351
+ var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
2352
+ var import_zod20 = require("zod");
2353
+ var emptyInputSchema10 = import_zod20.z.undefined();
2354
+ var diagnosticRecoveryHistoryItemSchema = import_zod20.z.object({
2355
+ id: diagnosticIdSchema,
2356
+ pointOfSaleId: diagnosticIdSchema,
2357
+ requestedAt: diagnosticDateSchema,
2358
+ selectedOperations: import_zod20.z.number().int().min(0).max(100)
2359
+ });
2360
+ var diagnosticRecoveryHistoryQuerySchema = import_zod20.z.object({
2361
+ page: import_zod20.z.number().int().min(1).max(1e5).optional(),
2362
+ itemsPerPage: import_zod20.z.number().int().min(1).max(100).optional()
2363
+ });
2364
+ var GetDiagnosticRecoveryHistory = class extends import_sdk_js_core12.AbstractApiRequest {
2365
+ constructor(posId, options) {
2366
+ super(void 0, options);
2367
+ this.posId = posId;
2368
+ this.method = "GET";
2369
+ this.contentType = "application/json";
2370
+ this.accept = "application/json";
2371
+ this.inputSchema = emptyInputSchema10;
2372
+ this.outputSchema = (0, import_sdk_js_global_types3.createPaginatedSchema)(diagnosticRecoveryHistoryItemSchema);
2373
+ this.listItemSchema = diagnosticRecoveryHistoryItemSchema;
2374
+ this.paginationDefaultEnabled = true;
2375
+ this.querySchema = diagnosticRecoveryHistoryQuerySchema;
2376
+ this.headersSchema = void 0;
2377
+ }
2378
+ getPath() {
2379
+ return `/point_of_sales/${encodeURIComponent(this.posId)}/integration_diagnostic_recovery_requests`;
2380
+ }
2381
+ };
2382
+
2383
+ // src/requests/GetDiagnosticRecoveryRequestDetails.ts
2384
+ var import_sdk_js_core13 = require("@deliverart/sdk-js-core");
2385
+ var import_zod21 = require("zod");
2386
+ var emptyInputSchema11 = import_zod21.z.undefined();
2387
+ var GetDiagnosticRecoveryRequestDetails = class extends import_sdk_js_core13.AbstractApiRequest {
2388
+ constructor(requestId) {
2389
+ super(void 0);
2390
+ this.requestId = requestId;
2391
+ this.method = "GET";
2392
+ this.contentType = "application/json";
2393
+ this.accept = "application/json";
2394
+ this.inputSchema = emptyInputSchema11;
2395
+ this.outputSchema = diagnosticRecoveryRequestSchema;
2396
+ this.querySchema = void 0;
2397
+ this.headersSchema = void 0;
2398
+ }
2399
+ getPath() {
2400
+ return `/integration_diagnostic_recovery_requests/${encodeURIComponent(this.requestId)}`;
2401
+ }
2402
+ };
2403
+
2404
+ // src/requests/PreviewDiagnosticRecovery.ts
2405
+ var import_sdk_js_core14 = require("@deliverart/sdk-js-core");
2406
+ var PreviewDiagnosticRecovery = class extends import_sdk_js_core14.AbstractApiRequest {
2407
+ constructor(posId, input) {
2408
+ super(input);
2409
+ this.posId = posId;
2410
+ this.method = "POST";
2411
+ this.contentType = "application/json";
2412
+ this.accept = "application/json";
2413
+ this.inputSchema = diagnosticRecoveryInputSchema;
2414
+ this.outputSchema = diagnosticRecoveryPreviewSchema;
2415
+ this.querySchema = void 0;
2416
+ this.headersSchema = void 0;
2417
+ }
2418
+ getPath() {
2419
+ return `/point_of_sales/${encodeURIComponent(this.posId)}/integration_diagnostic_recovery_preview`;
2420
+ }
2421
+ };
2422
+
2423
+ // src/requests/ReplyDiagnosticAssistance.ts
2424
+ var import_sdk_js_core15 = require("@deliverart/sdk-js-core");
2425
+ var ReplyDiagnosticAssistance = class extends import_sdk_js_core15.AbstractApiRequest {
2426
+ constructor(id, input) {
2427
+ super(input);
2428
+ this.id = id;
2429
+ this.method = "POST";
2430
+ this.contentType = "application/json";
2431
+ this.accept = "application/json";
2432
+ this.inputSchema = diagnosticAssistanceReplyInputSchema;
2433
+ this.outputSchema = diagnosticAssistanceSchema;
2434
+ this.querySchema = void 0;
2435
+ this.headersSchema = void 0;
2436
+ }
2437
+ getPath() {
2438
+ return `/integration_diagnostic_assistance/${encodeURIComponent(this.id)}/reply`;
2439
+ }
2440
+ };
2441
+
2442
+ // src/requests/RequestDiagnosticAssistance.ts
2443
+ var import_sdk_js_core16 = require("@deliverart/sdk-js-core");
2444
+ var RequestDiagnosticAssistance = class extends import_sdk_js_core16.AbstractApiRequest {
2445
+ constructor(id, input) {
2446
+ super(input);
2447
+ this.id = id;
2448
+ this.method = "POST";
2449
+ this.contentType = "application/json";
2450
+ this.accept = "application/json";
2451
+ this.inputSchema = diagnosticAssistanceRequestInputSchema;
2452
+ this.outputSchema = diagnosticAssistanceSchema;
2453
+ this.querySchema = void 0;
2454
+ this.headersSchema = void 0;
2455
+ }
2456
+ getPath() {
2457
+ return `/integration_diagnostic_problems/${encodeURIComponent(this.id)}/assistance`;
2458
+ }
2459
+ };
2460
+
2461
+ // src/requests/RequestDiagnosticRecovery.ts
2462
+ var import_sdk_js_core17 = require("@deliverart/sdk-js-core");
2463
+ var RequestDiagnosticRecovery = class extends import_sdk_js_core17.AbstractApiRequest {
2464
+ constructor(posId, input) {
2465
+ super(input);
2466
+ this.posId = posId;
2467
+ this.method = "POST";
2468
+ this.contentType = "application/json";
2469
+ this.accept = "application/json";
2470
+ this.inputSchema = diagnosticRecoveryInputSchema;
2471
+ this.outputSchema = diagnosticRecoveryRequestSchema;
2472
+ this.querySchema = void 0;
2473
+ this.headersSchema = void 0;
2474
+ }
2475
+ getPath() {
2476
+ return `/point_of_sales/${encodeURIComponent(this.posId)}/integration_diagnostic_recovery_requests`;
2477
+ }
2478
+ };
2479
+
2480
+ // src/requests/UpdateDiagnosticAssistance.ts
2481
+ var import_sdk_js_core18 = require("@deliverart/sdk-js-core");
2482
+ var UpdateDiagnosticAssistance = class extends import_sdk_js_core18.AbstractApiRequest {
2483
+ constructor(id, input) {
2484
+ super(input);
2485
+ this.id = id;
2486
+ this.method = "POST";
2487
+ this.contentType = "application/json";
2488
+ this.accept = "application/json";
2489
+ this.inputSchema = diagnosticAssistanceUpdateInputSchema;
2490
+ this.outputSchema = diagnosticAssistanceSchema;
2491
+ this.querySchema = void 0;
2492
+ this.headersSchema = void 0;
2493
+ }
2494
+ getPath() {
2495
+ return `/integration_diagnostic_assistance/${encodeURIComponent(this.id)}/update`;
2496
+ }
2497
+ };
2498
+
2499
+ // src/requests/VerifyDiagnosticProblem.ts
2500
+ var import_sdk_js_core19 = require("@deliverart/sdk-js-core");
2501
+ var import_zod22 = require("zod");
2502
+ var emptyInputSchema12 = import_zod22.z.undefined();
2503
+ var VerifyDiagnosticProblem = class extends import_sdk_js_core19.AbstractApiRequest {
2504
+ constructor(problemId) {
2505
+ super(void 0);
2506
+ this.problemId = problemId;
2507
+ this.method = "POST";
2508
+ this.contentType = "application/json";
2509
+ this.accept = "application/json";
2510
+ this.inputSchema = emptyInputSchema12;
2511
+ this.outputSchema = diagnosticProblemSchema;
2512
+ this.querySchema = void 0;
2513
+ this.headersSchema = void 0;
2514
+ }
2515
+ getPath() {
2516
+ return `/integration_diagnostic_problems/${encodeURIComponent(this.problemId)}/verify`;
2517
+ }
2518
+ };
2519
+
2520
+ // src/resource-path.ts
2521
+ function describeDiagnosticResourcePath(resource, resources, locale, service) {
2522
+ const names2 = [];
2523
+ const visited = /* @__PURE__ */ new Set([resource.identifier]);
2524
+ let parentId = resource.parentIdentifier;
2525
+ while (parentId !== null) {
2526
+ if (visited.has(parentId) || names2.length >= 8) return null;
2527
+ visited.add(parentId);
2528
+ const matches = resources.filter((candidate) => candidate.identifier === parentId);
2529
+ if (matches.length !== 1) return null;
2530
+ const parent = matches[0];
2531
+ const name = diagnosticResourceName(parent, locale, service);
2532
+ if (name === parent.identifier) return null;
2533
+ names2.unshift(name);
2534
+ parentId = parent.parentIdentifier;
2535
+ }
2536
+ if (names2.length === 0) return null;
2537
+ return `${locale === "it" ? "All\u2019interno di" : "Within"}: ${names2.join(" \u203A ")}`;
2538
+ }
2539
+
2540
+ // src/selection.ts
2541
+ function canSelectDiagnosticOperation(operation) {
2542
+ return operation.manuallyClosedAt === null && operation.actions?.recovery.eligible === true;
2543
+ }
2544
+ function canCloseDiagnosticOperation(operation) {
2545
+ return operation.manuallyClosedAt === null && operation.actions?.manualClosure.eligible === true;
2546
+ }
2547
+ function diagnosticSelection(operations, selected, requestKey) {
2548
+ const ids = new Set(selected);
2549
+ return {
2550
+ requestKey,
2551
+ operations: operations.filter((operation) => ids.has(operation.id) && canSelectDiagnosticOperation(operation)).map((operation) => ({ operationId: operation.id, revision: operation.revision }))
2552
+ };
2553
+ }
2554
+ function eligibleDiagnosticSelection(input, preview) {
2555
+ return {
2556
+ ...input,
2557
+ operations: input.operations.filter(
2558
+ (operation) => preview.items.some(
2559
+ (item) => item.operationId === operation.operationId && item.revision === operation.revision && item.eligible && item.action !== null
2560
+ )
2561
+ )
2562
+ };
2563
+ }
2564
+ // Annotate the CommonJS export names for ESM import in node:
2565
+ 0 && (module.exports = {
2566
+ CloseDiagnosticOperation,
2567
+ GetDiagnosticAssistanceDetails,
2568
+ GetDiagnosticAssistanceHistory,
2569
+ GetDiagnosticAssistanceInternal,
2570
+ GetDiagnosticAssistanceQueue,
2571
+ GetDiagnosticAttemptHistory,
2572
+ GetDiagnosticOperationDetails,
2573
+ GetDiagnosticOverview,
2574
+ GetDiagnosticProblemDetails,
2575
+ GetDiagnosticProblemQueue,
2576
+ GetDiagnosticProblems,
2577
+ GetDiagnosticRecoveryHistory,
2578
+ GetDiagnosticRecoveryRequestDetails,
2579
+ PreviewDiagnosticRecovery,
2580
+ ReplyDiagnosticAssistance,
2581
+ RequestDiagnosticAssistance,
2582
+ RequestDiagnosticRecovery,
2583
+ UpdateDiagnosticAssistance,
2584
+ VerifyDiagnosticProblem,
2585
+ canCloseDiagnosticOperation,
2586
+ canSelectDiagnosticOperation,
2587
+ describeDiagnostic,
2588
+ describeDiagnosticActionAvailability,
2589
+ describeDiagnosticAttempt,
2590
+ describeDiagnosticOperation,
2591
+ describeDiagnosticRecovery,
2592
+ describeDiagnosticRecoveryItem,
2593
+ describeDiagnosticResourcePath,
2594
+ describeDiagnosticScope,
2595
+ describeLocalDiagnostic,
2596
+ describeVerification,
2597
+ diagnosticAffectedOperationSchema,
2598
+ diagnosticAssistanceEventSchema,
2599
+ diagnosticAssistanceHistorySchema,
2600
+ diagnosticAssistanceInternalSchema,
2601
+ diagnosticAssistanceQuerySchema,
2602
+ diagnosticAssistanceQueueItemSchema,
2603
+ diagnosticAssistanceQueueQuerySchema,
2604
+ diagnosticAssistanceReplyInputSchema,
2605
+ diagnosticAssistanceRequestInputSchema,
2606
+ diagnosticAssistanceSchema,
2607
+ diagnosticAssistanceSummarySchema,
2608
+ diagnosticAssistanceUpdateInputSchema,
2609
+ diagnosticAttemptHistoryQuerySchema,
2610
+ diagnosticAttemptHistorySchema,
2611
+ diagnosticAttemptSchema,
2612
+ diagnosticAttentionSchema,
2613
+ diagnosticCodeSchema,
2614
+ diagnosticDateSchema,
2615
+ diagnosticFindingSchema,
2616
+ diagnosticIdSchema,
2617
+ diagnosticInvalidationRevision,
2618
+ diagnosticInvalidationSchema,
2619
+ diagnosticManualClosureInputSchema,
2620
+ diagnosticOperationActionsSchema,
2621
+ diagnosticOperationContextSchema,
2622
+ diagnosticOperationSchema,
2623
+ diagnosticOverviewSchema,
2624
+ diagnosticProblemPageQuerySchema,
2625
+ diagnosticProblemQueueItemSchema,
2626
+ diagnosticProblemQueueQuerySchema,
2627
+ diagnosticProblemQueueSchema,
2628
+ diagnosticProblemSchema,
2629
+ diagnosticProblemSummarySchema,
2630
+ diagnosticProblemsQuerySchema,
2631
+ diagnosticRecoveryActionSchema,
2632
+ diagnosticRecoveryHistoryItemSchema,
2633
+ diagnosticRecoveryHistoryQuerySchema,
2634
+ diagnosticRecoveryInputSchema,
2635
+ diagnosticRecoveryPreviewSchema,
2636
+ diagnosticRecoveryRequestSchema,
2637
+ diagnosticRecoveryStateSchema,
2638
+ diagnosticRecoverySummarySchema,
2639
+ diagnosticResourceName,
2640
+ diagnosticResourceSchema,
2641
+ diagnosticSelection,
2642
+ diagnosticServiceName,
2643
+ diagnosticSourceSchema,
2644
+ diagnosticVerificationSchema,
2645
+ eligibleDiagnosticSelection,
2646
+ readableDiagnosticFindingSchema
2647
+ });