@12-apps/marketplace 1.10.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/ADOPTING.md +126 -1
  2. package/README.md +100 -1
  3. package/dist/99food/index.d.ts +2 -2
  4. package/dist/99food/index.js +2 -2
  5. package/dist/{adapter-CYJzu1c9.d.ts → adapter-nUyZpLzz.d.ts} +448 -173
  6. package/dist/{chunk-2BA2EHNF.js → chunk-45ZVN5XI.js} +316 -42
  7. package/dist/chunk-45ZVN5XI.js.map +1 -0
  8. package/dist/{chunk-PYHNM47K.js → chunk-L6FG6T4S.js} +2 -2
  9. package/dist/{chunk-HEXLCTOG.js → chunk-LACBT6NC.js} +1 -1
  10. package/dist/chunk-LACBT6NC.js.map +1 -0
  11. package/dist/{chunk-WVZ2IXFH.js → chunk-MIPNQ7X5.js} +190 -12
  12. package/dist/chunk-MIPNQ7X5.js.map +1 -0
  13. package/dist/chunk-SGOTN5PX.js +345 -0
  14. package/dist/chunk-SGOTN5PX.js.map +1 -0
  15. package/dist/{client-B4EQCRD_.d.ts → client-Ctas7WCS.d.ts} +1 -1
  16. package/dist/{engine-DK3iV_Kk.d.ts → engine-CIy9P7Cq.d.ts} +149 -8
  17. package/dist/hono/index.d.ts +2 -2
  18. package/dist/hono/index.js +3 -3
  19. package/dist/ifood/index.d.ts +10 -2
  20. package/dist/ifood/index.js +297 -25
  21. package/dist/ifood/index.js.map +1 -1
  22. package/dist/index.d.ts +23 -4
  23. package/dist/index.js +424 -84
  24. package/dist/index.js.map +1 -1
  25. package/dist/keeta/index.d.ts +2 -18
  26. package/dist/keeta/index.js +12 -3
  27. package/dist/keeta/index.js.map +1 -1
  28. package/dist/manifest/index.d.ts +219 -1
  29. package/dist/manifest/index.js +1 -1
  30. package/dist/manifest/server.d.ts +2 -2
  31. package/dist/manifest/server.js +3 -3
  32. package/dist/rappi/index.d.ts +1 -1
  33. package/dist/rappi/index.js +1 -1
  34. package/dist/server/en-US.d.ts +13 -0
  35. package/dist/server/en-US.js +13 -0
  36. package/dist/server/en-US.js.map +1 -1
  37. package/dist/server/index.d.ts +241 -7
  38. package/dist/server/index.js +3 -3
  39. package/dist/server/pt-BR.d.ts +13 -0
  40. package/dist/server/pt-BR.js +13 -0
  41. package/dist/server/pt-BR.js.map +1 -1
  42. package/package.json +1 -1
  43. package/prisma/marketplace.prisma +41 -0
  44. package/prisma/migrations/20261127090000_marketplace_app_link/migration.sql +81 -0
  45. package/src/core/adapter.ts +27 -0
  46. package/src/core/bulk.ts +43 -8
  47. package/src/core/courier-port.ts +100 -0
  48. package/src/core/courier.ts +153 -0
  49. package/src/core/engine.ts +63 -4
  50. package/src/core/integration.ts +60 -32
  51. package/src/core/lifecycle.ts +27 -4
  52. package/src/core/link-store.ts +170 -0
  53. package/src/core/linking-port.ts +100 -0
  54. package/src/core/linking.ts +363 -0
  55. package/src/core/merchant-claim.ts +106 -0
  56. package/src/core/outbound-queue.ts +24 -11
  57. package/src/core/outbound.ts +8 -6
  58. package/src/core/pickup-code.ts +136 -0
  59. package/src/core/pipeline.ts +15 -6
  60. package/src/core/ports.ts +26 -1
  61. package/src/core/status-store.ts +2 -3
  62. package/src/core/types.ts +56 -4
  63. package/src/ifood/courier.ts +210 -0
  64. package/src/ifood/index.ts +8 -0
  65. package/src/ifood/linking.ts +170 -0
  66. package/src/ifood/normalize.ts +7 -0
  67. package/src/ifood/outbound.ts +10 -3
  68. package/src/index.ts +30 -0
  69. package/src/keeta/normalize.ts +21 -6
  70. package/src/server/copy.ts +20 -2
  71. package/src/server/en-US.ts +13 -0
  72. package/src/server/index.ts +1 -1
  73. package/src/server/link-routes.ts +140 -0
  74. package/src/server/mcp-link.ts +103 -0
  75. package/src/server/mcp.ts +6 -2
  76. package/src/server/pt-BR.ts +13 -0
  77. package/src/server/routes.ts +5 -2
  78. package/src/server/webhook.ts +86 -0
  79. package/dist/chunk-2BA2EHNF.js.map +0 -1
  80. package/dist/chunk-HEXLCTOG.js.map +0 -1
  81. package/dist/chunk-WVZ2IXFH.js.map +0 -1
  82. package/dist/chunk-ZO4S3LF4.js +0 -254
  83. package/dist/chunk-ZO4S3LF4.js.map +0 -1
  84. /package/dist/{chunk-PYHNM47K.js.map → chunk-L6FG6T4S.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { Q as MarketplaceDeliveredBy, q as CatalogueItem, p as CatalogueImage, a as NormalizedMarketplaceOrder, N as NormalizedEvent, a3 as StatusStep, T as MarketplaceHttp, c as MarketplaceAdapter, i as MarketplaceProvider, L as MarketplaceCredentials, H as CatalogueWarningCode, W as MarketplaceLifecycle, j as CancellationReason, a0 as OutboundOrderRef, b as CatalogueMenuOptions, w as CatalogueReadResult } from './adapter-CYJzu1c9.js';
1
+ import { a8 as MarketplaceDeliveredBy, ae as MarketplaceLinkAttemptDelegate, u as CatalogueItem, t as CatalogueImage, a as NormalizedMarketplaceOrder, N as NormalizedEvent, ap as StatusStep, i as NormalizedCourierEvent, a3 as MarketplaceCourierFacts, a1 as MarketplaceCourierAnswer, an as PickupCodeValidation, aa as MarketplaceHttp, Z as MarketplaceAppCredentialsPort, c as MarketplaceAdapter, l as MarketplaceProvider, a7 as MarketplaceCredentials, L as CatalogueWarningCode, Y as LinkedMerchant, ad as MarketplaceLifecycle, a4 as MarketplaceCourierStep, a2 as MarketplaceCourierEngine, m as CancellationReason, ak as OutboundOrderRef, b as CatalogueMenuOptions, B as CatalogueReadResult } from './adapter-nUyZpLzz.js';
2
2
 
3
3
  /** What the engine tells the host about the order a lifecycle event names. */
4
4
  interface MarketplaceLifecycleFacts {
@@ -187,6 +187,7 @@ interface MarketplaceDb {
187
187
  count: number;
188
188
  }>;
189
189
  };
190
+ marketplaceLinkAttempt?: MarketplaceLinkAttemptDelegate;
190
191
  }
191
192
  /** One decision as the host's admission sees it, BEFORE the claim commits. */
192
193
  interface MarketplaceAdmissionRequest {
@@ -285,6 +286,22 @@ interface MarketplaceOrderPort {
285
286
  * Absent: the engine cannot tell, and sends nothing.
286
287
  */
287
288
  statusHolds?(clientId: string, orderId: string, step: StatusStep): Promise<boolean>;
289
+ /**
290
+ * OPTIONAL (FUT-5665). The marketplace's courier moved: named, on the way,
291
+ * at the counter, holding the bag, or bringing it back. Store the facts on
292
+ * the order; never move it (a `COLLECTED` moves through `onLifecycle`).
293
+ * Idempotent: a redelivery is deduped, but the reconcile pass re-runs a
294
+ * FAILED row. Asked for an ACCEPTED order only, whatever the connection's
295
+ * `followStatus`. Absent: courier events are understood and ignored.
296
+ */
297
+ onCourier?(clientId: string, orderId: string, event: NormalizedCourierEvent, facts: MarketplaceCourierFacts): Promise<MarketplaceCourierAnswer>;
298
+ /**
299
+ * OPTIONAL (FUT-5665). The marketplace's verdict on the pickup code the host
300
+ * sent with `engine.validatePickupCode`. Called once per job, after the
301
+ * hand-over has committed: `INVALID` warns, it moves nothing. A throw is
302
+ * logged. Absent: the verdict is only logged.
303
+ */
304
+ onPickupCodeValidated?(clientId: string, orderId: string, validation: PickupCodeValidation): Promise<void>;
288
305
  /** Queue facts for a batch of orders, keyed by id. Missing ids are dropped. */
289
306
  summarize(clientId: string, orderIds: readonly string[]): Promise<Map<string, MarketplaceOrderSummary>>;
290
307
  }
@@ -389,6 +406,7 @@ interface MarketplacePorts {
389
406
  * catalogue. Absent: every catalogue call answers `UNSUPPORTED`.
390
407
  */
391
408
  catalogue?: MarketplaceCataloguePort;
409
+ appCredentials?: MarketplaceAppCredentialsPort;
392
410
  /** The acceptance window a connection gets when it does not state its own. */
393
411
  defaultAckSlaSeconds: number;
394
412
  /** How many stored deliveries one reconciliation pass re-runs. */
@@ -454,6 +472,18 @@ interface ExpirySweepResult {
454
472
  tenants: number;
455
473
  }
456
474
 
475
+ /**
476
+ * A LINKED connection's secrets and tokens (FUT-5613).
477
+ *
478
+ * The sealed `credentials` blob of a linked connection holds the store's
479
+ * refresh token and nothing of the app: the app's client id and secret are
480
+ * the host's configuration (`appCredentials`), read at each use so a rotation
481
+ * there reaches every store at once. The access token lives in the engine's
482
+ * per-process token cache only, like every other marketplace token.
483
+ */
484
+ /** How a connection authenticates. */
485
+ type MarketplaceAuthMode = "CREDENTIALS" | "LINKED";
486
+
457
487
  /**
458
488
  * The (tenant, marketplace) connection repository .
459
489
  *
@@ -488,6 +518,12 @@ interface MarketplaceIntegrationView {
488
518
  lastVerifiedAt: Date | null;
489
519
  /** Archived connections ingest nothing; null while live. */
490
520
  archivedAt: Date | null;
521
+ /**
522
+ * How the connection authenticates (FUT-5613): CREDENTIALS, the store's own
523
+ * app; LINKED, the software's app the store authorized. Always set by this
524
+ * version; optional in the type so a view built by hand against 1.x compiles.
525
+ */
526
+ authMode?: MarketplaceAuthMode;
491
527
  }
492
528
  /** What a save may change. Absent keys leave their column alone. */
493
529
  interface SaveMarketplaceIntegrationInput {
@@ -564,7 +600,9 @@ interface MarketplaceMenuLinkView {
564
600
  * link `(store, provider, externalSku)`.
565
601
  */
566
602
  /** Why a bulk row was refused. Vocabulary, not copy. */
567
- type BulkProblemCode = "DUPLICATE" | "UNKNOWN_PROVIDER" | "NOTHING_TO_UPDATE" | "NOT_FOUND" | "CATALOG_ITEM_NOT_FOUND";
603
+ type BulkProblemCode = "DUPLICATE" | "UNKNOWN_PROVIDER" | "NOTHING_TO_UPDATE" | "NOT_FOUND" | "CATALOG_ITEM_NOT_FOUND"
604
+ /** Another store's live connection holds the merchant id this row sets, or revives (FUT-5613). */
605
+ | "MERCHANT_TAKEN";
568
606
  interface BulkProblem {
569
607
  path: (string | number)[];
570
608
  code: BulkProblemCode;
@@ -998,6 +1036,48 @@ interface IngestSettings {
998
1036
  followStatus?: boolean;
999
1037
  }
1000
1038
 
1039
+ /** Why a linking call did nothing. Vocabulary, not copy: the host words each. */
1040
+ type LinkRefusalCode =
1041
+ /** No app configured for this marketplace, the adapter links nothing, or the host has no link table. */
1042
+ "UNAVAILABLE"
1043
+ /** `finish` with no `start` before it (or after another finish used it). */
1044
+ | "NO_LINK_IN_PROGRESS"
1045
+ /** The portal code's ten minutes are over: start again. */
1046
+ | "LINK_EXPIRED"
1047
+ /** The marketplace refused the authorization code (wrong, used, or for another code). */
1048
+ | "CODE_REFUSED"
1049
+ /** The marketplace refused another call (the code request, the merchant list). */
1050
+ | "MARKETPLACE_REFUSED"
1051
+ /** `selectMerchant` on a connection that is not linked, or is archived. */
1052
+ | "NOT_LINKED"
1053
+ /** The merchant is not one the grant covers. */
1054
+ | "UNKNOWN_MERCHANT"
1055
+ /** Another store's live connection already holds that merchant. */
1056
+ | "MERCHANT_TAKEN";
1057
+ /** A linking call that did nothing: refused for good, or worth trying again. */
1058
+ type LinkFailure = {
1059
+ kind: "refused";
1060
+ code: LinkRefusalCode;
1061
+ status: number | null;
1062
+ message: string | null;
1063
+ } | {
1064
+ kind: "retry";
1065
+ reason: string;
1066
+ };
1067
+ /** A linking in progress, as a person sees it: never the verifier. */
1068
+ interface LinkPendingView {
1069
+ userCode: string;
1070
+ verificationUrl: string;
1071
+ verificationUrlComplete: string;
1072
+ expiresAt: Date;
1073
+ }
1074
+ /** What `finishLink` answers: the connection, and the merchants the grant covers (null when they could not be listed). */
1075
+ interface LinkFinished {
1076
+ kind: "linked";
1077
+ integration: MarketplaceIntegrationView;
1078
+ merchants: LinkedMerchant[] | null;
1079
+ }
1080
+
1001
1081
  /**
1002
1082
  * The outbound job's name and payload — what a decision QUEUES.
1003
1083
  *
@@ -1010,10 +1090,11 @@ interface IngestSettings {
1010
1090
  /** The wire name, `<namespace>.<blueprint>` as the jobs contribution binds it. */
1011
1091
  declare const MARKETPLACE_OUTBOUND_JOB = "marketplace.outbound";
1012
1092
  /**
1013
- * What goes out: the store's aceite, the store's cancellation request, or a
1014
- * step of the order the store reached (`status`, FUT-4653).
1093
+ * What goes out: the store's aceite, the store's cancellation request, a
1094
+ * step of the order the store reached (`status`, FUT-4653), or the pickup code
1095
+ * the store checked at the hand-over (`validatePickupCode`, FUT-5665).
1015
1096
  */
1016
- type OutboundAction = "confirm" | "requestCancellation" | "status";
1097
+ type OutboundAction = "confirm" | "requestCancellation" | "status" | "validatePickupCode";
1017
1098
  /** The outbound job's payload. Identifiers only. */
1018
1099
  interface OutboundJobPayload {
1019
1100
  clientId: string;
@@ -1026,6 +1107,12 @@ interface OutboundJobPayload {
1026
1107
  * belongs to: the owner of its SENDING claim. Absent on every other action.
1027
1108
  */
1028
1109
  claimKey?: string;
1110
+ /**
1111
+ * OPTIONAL. The pickup code a `validatePickupCode` call sends; absent on every
1112
+ * other action. The one non-identifier in the payload: a short-lived code the
1113
+ * job needs to send, which no log line prints.
1114
+ */
1115
+ code?: string;
1029
1116
  }
1030
1117
  /** The dedupe key: at most one queued call per (order, action). */
1031
1118
  declare function outboundDedupeKey(payload: OutboundJobPayload): string;
@@ -1303,6 +1390,12 @@ type DeliveryOutcome = {
1303
1390
  kind: "moved";
1304
1391
  orderId: string;
1305
1392
  lifecycle: MarketplaceLifecycle;
1393
+ }
1394
+ /** A courier event's facts were stored by the host's `onCourier` (FUT-5665). */
1395
+ | {
1396
+ kind: "courier";
1397
+ orderId: string;
1398
+ step: MarketplaceCourierStep;
1306
1399
  } | {
1307
1400
  kind: "cancelled";
1308
1401
  } | {
@@ -1343,7 +1436,7 @@ interface MarketplaceOrderState {
1343
1436
  }
1344
1437
 
1345
1438
  /** Everything the mounted engine can do, with the ports and adapters bound in. */
1346
- interface MarketplaceEngine {
1439
+ interface MarketplaceEngine extends MarketplaceCourierEngine {
1347
1440
  /** Every registered marketplace, in registration order. */
1348
1441
  providers(): readonly MarketplaceProvider[];
1349
1442
  /** Whether a provider id (a URL segment, a body field) names a registered adapter. */
@@ -1388,7 +1481,7 @@ interface MarketplaceEngine {
1388
1481
  providers?: readonly string[];
1389
1482
  includeArchived?: boolean;
1390
1483
  }): Promise<MarketplaceIntegrationView[]>;
1391
- /** Create or patch ONE connection (the bulk call's single-row form, with no audit). */
1484
+ /** Create or patch ONE connection (the bulk call's single-row form, with no audit). Throws MarketplaceMerchantTakenError. */
1392
1485
  saveIntegration(input: SaveMarketplaceIntegrationInput): Promise<MarketplaceIntegrationView>;
1393
1486
  /** Create, patch, archive or unarchive many connections, all-or-nothing. */
1394
1487
  upsertIntegrations(input: {
@@ -1397,6 +1490,54 @@ interface MarketplaceEngine {
1397
1490
  rows: readonly IntegrationRowInput[];
1398
1491
  validateOnly?: boolean;
1399
1492
  }): Promise<BulkResult<MarketplaceIntegrationView>>;
1493
+ /**
1494
+ * Whether this store can link this marketplace through the software's own
1495
+ * app (FUT-5613), and the linking it left in progress. `available` is false
1496
+ * when the adapter links nothing, the host configured no app for it, or the
1497
+ * link table is not composed: the store's own credentials still work.
1498
+ */
1499
+ linkState(input: {
1500
+ clientId: string;
1501
+ provider: MarketplaceProvider;
1502
+ environment?: "SANDBOX" | "PRODUCTION";
1503
+ }): Promise<{
1504
+ available: boolean;
1505
+ pending: LinkPendingView | null;
1506
+ }>;
1507
+ /** Ask for the portal code; the verifier stays sealed server-side. Replaces an earlier attempt. */
1508
+ startLink(input: {
1509
+ clientId: string;
1510
+ provider: MarketplaceProvider;
1511
+ environment?: "SANDBOX" | "PRODUCTION";
1512
+ }): Promise<{
1513
+ kind: "started";
1514
+ pending: LinkPendingView;
1515
+ } | LinkFailure>;
1516
+ /** Exchange the pasted authorization code for the store's tokens; select the merchant when only one. */
1517
+ finishLink(input: {
1518
+ clientId: string;
1519
+ provider: MarketplaceProvider;
1520
+ authorizationCode: string;
1521
+ actorId: string | null;
1522
+ enabled?: boolean;
1523
+ }): Promise<LinkFinished | LinkFailure>;
1524
+ /** The merchants a linked connection's grant covers. */
1525
+ linkedMerchants(input: {
1526
+ clientId: string;
1527
+ provider: MarketplaceProvider;
1528
+ }): Promise<{
1529
+ kind: "listed";
1530
+ merchants: LinkedMerchant[];
1531
+ } | LinkFailure>;
1532
+ /** Choose the marketplace store of a linked connection whose grant covers several. */
1533
+ selectLinkedMerchant(input: {
1534
+ clientId: string;
1535
+ provider: MarketplaceProvider;
1536
+ merchantId: string;
1537
+ }): Promise<{
1538
+ kind: "selected";
1539
+ integration: MarketplaceIntegrationView;
1540
+ } | LinkFailure>;
1400
1541
  /** The SKU map. `unmappedOnly` is the store's attention list; `ids` narrows. */
1401
1542
  menuLinks(input: {
1402
1543
  clientId: string;
@@ -1532,4 +1673,4 @@ interface MarketplaceEngine {
1532
1673
  */
1533
1674
  declare function createMarketplaceEngine(config: MarketplaceEngineConfig): MarketplaceEngine;
1534
1675
 
1535
- export { type MarketplaceEngineConfig as $, type AcceptanceDecision as A, type BulkProblem as B, type CancellationFailureReason as C, type DecideManyResult as D, type DeliveryOutcome as E, type ExpirySweepResult as F, type FetchOrderJobPayload as G, type FetchOrderOutcome as H, FetchOrderRetryError as I, type InformStatusInput as J, type IngestResult as K, type IngestSettings as L, type IngestionTarget as M, type IntegrationRowInput as N, MARKETPLACE_AVAILABILITY_JOB as O, MARKETPLACE_CATALOGUE_JOB as P, MARKETPLACE_FETCH_ORDER_JOB as Q, MARKETPLACE_OUTBOUND_JOB as R, type MarketplaceAdmission as S, type MarketplaceAdmissionRequest as T, type MarketplaceAdmissionResult as U, type MarketplaceAuditEntry as V, type MarketplaceAuditPort as W, type MarketplaceCataloguePort as X, type MarketplaceClockPort as Y, type MarketplaceDb as Z, type MarketplaceEngine as _, type AcceptanceStatus as a, type MarketplaceEnqueuePort as a0, type MarketplaceIntegrationView as a1, type MarketplaceLifecycleAnswer as a2, type MarketplaceLifecycleFacts as a3, type MarketplaceLogger as a4, type MarketplaceMenuLinkView as a5, type MarketplaceOrderPort as a6, type MarketplaceOrderState as a7, type MarketplaceOrderSummary as a8, type MarketplacePorts as a9, createMarketplaceEngine as aA, outboundDedupeKey as aB, type MarketplaceRefusal as aa, type MarketplaceSecretsPort as ab, type MenuLinkRowInput as ac, OUTBOUND_GIVE_UP_MS as ad, OUTBOUND_STALE_MS as ae, type OutboundAction as af, type OutboundAttempt as ag, type OutboundJobPayload as ah, type OutboundOutcome as ai, OutboundRetryError as aj, type OutboundSweepResult as ak, type PauseOutcome as al, type PauseStoreInput as am, type PauseStoreResult as an, type PendingAcceptance as ao, type PendingInboxEvent as ap, type ResolvedOrderLine as aq, type ResumeOutcome as ar, STORE_PAUSE_LEASE_MS as as, type SaveMarketplaceIntegrationInput as at, type StoreAvailabilityView as au, type StorePauseFailureCode as av, type StorePauseState as aw, type StorePauseWanted as ax, availabilityDedupeKey as ay, catalogueDedupeKey as az, type AvailabilityJobPayload as b, type AvailabilityOutcome as c, AvailabilityRetryError as d, type AvailabilitySweepResult as e, type BulkProblemCode as f, type BulkResult as g, type CancellationStatus as h, type CatalogueAction as i, type CatalogueActionResult as j, type CatalogueDocumentResult as k, type CatalogueFailedAction as l, type CatalogueFailureCode as m, type CatalogueJobPayload as n, type CatalogueOutcome as o, type CataloguePublicationView as p, type CataloguePublishInput as q, type CatalogueRefusalCode as r, CatalogueRetryError as s, type CatalogueStatus as t, type CatalogueTarget as u, type DecidedRow as v, type DecisionInput as w, type DecisionProblem as x, type DecisionProblemCode as y, type DecisionResult as z };
1676
+ export { type MarketplaceAuthMode as $, type AcceptanceDecision as A, type BulkProblem as B, type CancellationFailureReason as C, type DecideManyResult as D, type DeliveryOutcome as E, type ExpirySweepResult as F, type FetchOrderJobPayload as G, type FetchOrderOutcome as H, FetchOrderRetryError as I, type InformStatusInput as J, type IngestResult as K, type IngestSettings as L, type IngestionTarget as M, type IntegrationRowInput as N, type LinkFailure as O, type LinkFinished as P, type LinkPendingView as Q, type LinkRefusalCode as R, MARKETPLACE_AVAILABILITY_JOB as S, MARKETPLACE_CATALOGUE_JOB as T, MARKETPLACE_FETCH_ORDER_JOB as U, MARKETPLACE_OUTBOUND_JOB as V, type MarketplaceAdmission as W, type MarketplaceAdmissionRequest as X, type MarketplaceAdmissionResult as Y, type MarketplaceAuditEntry as Z, type MarketplaceAuditPort as _, type AcceptanceStatus as a, type MarketplaceCataloguePort as a0, type MarketplaceClockPort as a1, type MarketplaceDb as a2, type MarketplaceEngine as a3, type MarketplaceEngineConfig as a4, type MarketplaceEnqueuePort as a5, type MarketplaceIntegrationView as a6, type MarketplaceLifecycleAnswer as a7, type MarketplaceLifecycleFacts as a8, type MarketplaceLogger as a9, type StorePauseFailureCode as aA, type StorePauseState as aB, type StorePauseWanted as aC, availabilityDedupeKey as aD, catalogueDedupeKey as aE, createMarketplaceEngine as aF, outboundDedupeKey as aG, type MarketplaceMenuLinkView as aa, type MarketplaceOrderPort as ab, type MarketplaceOrderState as ac, type MarketplaceOrderSummary as ad, type MarketplacePorts as ae, type MarketplaceRefusal as af, type MarketplaceSecretsPort as ag, type MenuLinkRowInput as ah, OUTBOUND_GIVE_UP_MS as ai, OUTBOUND_STALE_MS as aj, type OutboundAction as ak, type OutboundAttempt as al, type OutboundJobPayload as am, type OutboundOutcome as an, OutboundRetryError as ao, type OutboundSweepResult as ap, type PauseOutcome as aq, type PauseStoreInput as ar, type PauseStoreResult as as, type PendingAcceptance as at, type PendingInboxEvent as au, type ResolvedOrderLine as av, type ResumeOutcome as aw, STORE_PAUSE_LEASE_MS as ax, type SaveMarketplaceIntegrationInput as ay, type StoreAvailabilityView as az, type AvailabilityJobPayload as b, type AvailabilityOutcome as c, AvailabilityRetryError as d, type AvailabilitySweepResult as e, type BulkProblemCode as f, type BulkResult as g, type CancellationStatus as h, type CatalogueAction as i, type CatalogueActionResult as j, type CatalogueDocumentResult as k, type CatalogueFailedAction as l, type CatalogueFailureCode as m, type CatalogueJobPayload as n, type CatalogueOutcome as o, type CataloguePublicationView as p, type CataloguePublishInput as q, type CatalogueRefusalCode as r, CatalogueRetryError as s, type CatalogueStatus as t, type CatalogueTarget as u, type DecidedRow as v, type DecisionInput as w, type DecisionProblem as x, type DecisionProblemCode as y, type DecisionResult as z };
@@ -1,7 +1,7 @@
1
1
  import { Hono, Context } from 'hono';
2
2
  import { ApiMarketplace, MarketplaceApiConfig, MarketplaceActor } from '../server/index.js';
3
- import '../engine-DK3iV_Kk.js';
4
- import '../adapter-CYJzu1c9.js';
3
+ import '../engine-CIy9P7Cq.js';
4
+ import '../adapter-nUyZpLzz.js';
5
5
  import '@12-apps/wiring';
6
6
  import 'zod';
7
7
 
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createApiMarketplace
3
- } from "../chunk-WVZ2IXFH.js";
4
- import "../chunk-ZO4S3LF4.js";
5
- import "../chunk-2BA2EHNF.js";
3
+ } from "../chunk-MIPNQ7X5.js";
4
+ import "../chunk-SGOTN5PX.js";
5
+ import "../chunk-45ZVN5XI.js";
6
6
  import {
7
7
  __name
8
8
  } from "../chunk-7QVYU63E.js";
@@ -1,4 +1,4 @@
1
- import { N as NormalizedEvent, d as PushCatalogue, e as CatalogueItemOut, f as CatalogueReader, M as MarketplaceAvailability, A as AdapterCallContext, S as StorePauseRequest, g as StorePauseResult, h as StorePauseRef, O as OutboundResult, c as MarketplaceAdapter } from '../adapter-CYJzu1c9.js';
1
+ import { N as NormalizedEvent, d as PushCatalogue, e as CatalogueItemOut, f as CatalogueReader, g as MarketplaceLinking, h as MarketplaceCourierApi, i as NormalizedCourierEvent, M as MarketplaceAvailability, A as AdapterCallContext, S as StorePauseRequest, j as StorePauseResult, k as StorePauseRef, O as OutboundResult, c as MarketplaceAdapter } from '../adapter-nUyZpLzz.js';
2
2
 
3
3
  /**
4
4
  * The words the iFood adapter needs from its host, and nothing else.
@@ -53,6 +53,14 @@ declare const IFOOD_CATALOGUE: PushCatalogue;
53
53
  /** iFood's catalogue read. */
54
54
  declare const IFOOD_CATALOGUE_READER: CatalogueReader;
55
55
 
56
+ /** The iFood adapter's linking half. */
57
+ declare const IFOOD_LINKING: MarketplaceLinking;
58
+
59
+ /** The courier step an iFood event names, or null. */
60
+ declare function readIfoodCourierEvent(payload: unknown, eventType: string): NormalizedCourierEvent | null;
61
+ /** iFood's courier calls, for the adapter's `courier`. */
62
+ declare const IFOOD_COURIER: MarketplaceCourierApi;
63
+
56
64
  /**
57
65
  * iFood's catalogue answer mapped into the engine's {@link CatalogueSnapshotItem}
58
66
  * (FUT-951). Pure and offline: `./catalogue-read.ts` makes the calls.
@@ -118,4 +126,4 @@ interface IfoodAdapterConfig {
118
126
  /** Build the iFood adapter. Its reasons are static: a dialog never waits on iFood. */
119
127
  declare function createIfoodAdapter(config: IfoodAdapterConfig): MarketplaceAdapter;
120
128
 
121
- export { IFOOD_AVAILABILITY, IFOOD_CANCELLATION_ANSWER_WINDOW_MS, IFOOD_CATALOGUE, IFOOD_CATALOGUE_READER, IFOOD_IMAGE_BASE_URL, IFOOD_PROVIDER, IFOOD_REASON_CODES, type IfoodAdapterConfig, type IfoodAdapterCopy, type IfoodReasonCode, createIfoodAdapter, ifoodItemBody, ifoodItemId, ifoodLocalTime, ifoodPause, ifoodProductId, ifoodResume, normalizeIfoodEvent, verifyIfoodSignature };
129
+ export { IFOOD_AVAILABILITY, IFOOD_CANCELLATION_ANSWER_WINDOW_MS, IFOOD_CATALOGUE, IFOOD_CATALOGUE_READER, IFOOD_COURIER, IFOOD_IMAGE_BASE_URL, IFOOD_LINKING, IFOOD_PROVIDER, IFOOD_REASON_CODES, type IfoodAdapterConfig, type IfoodAdapterCopy, type IfoodReasonCode, createIfoodAdapter, ifoodItemBody, ifoodItemId, ifoodLocalTime, ifoodPause, ifoodProductId, ifoodResume, normalizeIfoodEvent, readIfoodCourierEvent, verifyIfoodSignature };