@12-apps/marketplace 1.9.0 → 1.11.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 (75) hide show
  1. package/ADOPTING.md +63 -1
  2. package/README.md +64 -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-CD0SfdVS.d.ts} +124 -1
  6. package/dist/{chunk-PYHNM47K.js → chunk-DCWOQ5PN.js} +2 -2
  7. package/dist/{chunk-6N2HEV3U.js → chunk-OS4TSIFU.js} +190 -12
  8. package/dist/chunk-OS4TSIFU.js.map +1 -0
  9. package/dist/chunk-SGOTN5PX.js +345 -0
  10. package/dist/chunk-SGOTN5PX.js.map +1 -0
  11. package/dist/{chunk-HEXLCTOG.js → chunk-TVZU4HNT.js} +1 -1
  12. package/dist/chunk-TVZU4HNT.js.map +1 -0
  13. package/dist/{chunk-BMCERPQX.js → chunk-YWMEIMO3.js} +221 -27
  14. package/dist/chunk-YWMEIMO3.js.map +1 -0
  15. package/dist/{client-B4EQCRD_.d.ts → client-11sncog4.d.ts} +1 -1
  16. package/dist/{engine-wmW-VuBL.d.ts → engine-C_3RK8wC.d.ts} +207 -64
  17. package/dist/hono/index.d.ts +2 -2
  18. package/dist/hono/index.js +3 -3
  19. package/dist/ifood/index.d.ts +5 -2
  20. package/dist/ifood/index.js +125 -7
  21. package/dist/ifood/index.js.map +1 -1
  22. package/dist/index.d.ts +23 -4
  23. package/dist/index.js +280 -26
  24. package/dist/index.js.map +1 -1
  25. package/dist/keeta/index.d.ts +2 -2
  26. package/dist/keeta/index.js +2 -2
  27. package/dist/manifest/index.d.ts +223 -2
  28. package/dist/manifest/index.js +1 -1
  29. package/dist/manifest/server.d.ts +2 -2
  30. package/dist/manifest/server.js +3 -3
  31. package/dist/rappi/index.d.ts +1 -1
  32. package/dist/rappi/index.js +1 -1
  33. package/dist/server/en-US.d.ts +13 -0
  34. package/dist/server/en-US.js +13 -0
  35. package/dist/server/en-US.js.map +1 -1
  36. package/dist/server/index.d.ts +246 -8
  37. package/dist/server/index.js +3 -3
  38. package/dist/server/pt-BR.d.ts +13 -0
  39. package/dist/server/pt-BR.js +13 -0
  40. package/dist/server/pt-BR.js.map +1 -1
  41. package/package.json +1 -1
  42. package/prisma/marketplace.prisma +47 -0
  43. package/prisma/migrations/20261126230000_marketplace_menu_link_variation/migration.sql +11 -0
  44. package/prisma/migrations/20261127090000_marketplace_app_link/migration.sql +81 -0
  45. package/src/core/adapter.ts +21 -0
  46. package/src/core/bulk.ts +77 -15
  47. package/src/core/engine.ts +59 -3
  48. package/src/core/ingest.ts +2 -1
  49. package/src/core/integration.ts +60 -32
  50. package/src/core/link-store.ts +170 -0
  51. package/src/core/linking-port.ts +100 -0
  52. package/src/core/linking.ts +363 -0
  53. package/src/core/menu-links.ts +36 -6
  54. package/src/core/merchant-claim.ts +106 -0
  55. package/src/core/order-types.ts +74 -0
  56. package/src/core/ports.ts +26 -65
  57. package/src/ifood/index.ts +4 -0
  58. package/src/ifood/linking.ts +170 -0
  59. package/src/ifood/outbound.ts +10 -3
  60. package/src/index.ts +14 -0
  61. package/src/server/copy.ts +20 -2
  62. package/src/server/en-US.ts +13 -0
  63. package/src/server/index.ts +1 -1
  64. package/src/server/link-routes.ts +140 -0
  65. package/src/server/mcp-link.ts +103 -0
  66. package/src/server/mcp.ts +13 -4
  67. package/src/server/pt-BR.ts +13 -0
  68. package/src/server/routes.ts +5 -2
  69. package/src/server/webhook.ts +86 -0
  70. package/dist/chunk-6N2HEV3U.js.map +0 -1
  71. package/dist/chunk-BMCERPQX.js.map +0 -1
  72. package/dist/chunk-HEXLCTOG.js.map +0 -1
  73. package/dist/chunk-NP4EYKPO.js +0 -252
  74. package/dist/chunk-NP4EYKPO.js.map +0 -1
  75. /package/dist/{chunk-PYHNM47K.js.map → chunk-DCWOQ5PN.js.map} +0 -0
@@ -1,10 +1,14 @@
1
- import { y as DecisionProblemCode, f as BulkProblemCode, _ as MarketplaceEngine, a4 as MarketplaceLogger, ah as OutboundJobPayload, G as FetchOrderJobPayload, n as CatalogueJobPayload, b as AvailabilityJobPayload } from '../engine-wmW-VuBL.js';
1
+ import { y as DecisionProblemCode, f as BulkProblemCode, R as LinkRefusalCode, a3 as MarketplaceEngine, a9 as MarketplaceLogger, am as OutboundJobPayload, G as FetchOrderJobPayload, n as CatalogueJobPayload, b as AvailabilityJobPayload } from '../engine-C_3RK8wC.js';
2
2
  import { WireRoute, WireJobBlueprint } from '@12-apps/wiring';
3
3
  import { z } from 'zod';
4
- import '../adapter-CYJzu1c9.js';
4
+ import '../adapter-CD0SfdVS.js';
5
5
 
6
- /** Every problem code a route can answer, decisions and bulk writes alike. */
7
- type MarketplaceProblemCode = DecisionProblemCode | BulkProblemCode;
6
+ /**
7
+ * Every problem code a route words from `problems`, decisions and bulk writes
8
+ * alike. MERCHANT_TAKEN is worded by `link.problems` instead (FUT-5613), so a
9
+ * host's own pack written against 1.x still compiles.
10
+ */
11
+ type MarketplaceProblemCode = DecisionProblemCode | Exclude<BulkProblemCode, "MERCHANT_TAKEN">;
8
12
  /**
9
13
  * Every sentence the marketplace routes answer with. Required, no defaults
10
14
  * (the copy-port doctrine): two packs sit beside it (`./pt-BR`, `./en-US`),
@@ -23,6 +27,18 @@ interface MarketplaceServerCopy {
23
27
  orderNoLongerPending: string;
24
28
  /** One sentence per problem code, for each `problems[].message`. */
25
29
  problems: Readonly<Record<MarketplaceProblemCode, string>>;
30
+ /**
31
+ * OPTIONAL in the type, so a host's own pack written against 1.x still
32
+ * compiles: the sentences of the linking routes (FUT-5613). Absent, those
33
+ * routes answer the machine code as `error`. Both shipped packs carry it.
34
+ */
35
+ link?: MarketplaceLinkCopy;
36
+ }
37
+ /** What the linking routes say: one sentence per refusal, and one for "try again". */
38
+ interface MarketplaceLinkCopy {
39
+ problems: Readonly<Record<LinkRefusalCode, string>>;
40
+ /** The marketplace did not answer (a timeout, a 5xx, a rate limit). */
41
+ tryAgain: string;
26
42
  }
27
43
 
28
44
  /**
@@ -225,6 +241,7 @@ declare const upsertMarketplaceMenuLinksBody: z.ZodObject<{
225
241
  externalSku: z.ZodString;
226
242
  externalName: z.ZodOptional<z.ZodString>;
227
243
  menuItemId: z.ZodNullable<z.ZodString>;
244
+ variationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
228
245
  }, z.core.$strict>>;
229
246
  }, z.core.$strict>;
230
247
  /** Which queued orders to read. */
@@ -248,7 +265,7 @@ declare const decideMarketplaceOrdersBody: z.ZodObject<{
248
265
  offendingSkus: z.ZodOptional<z.ZodArray<z.ZodString>>;
249
266
  }, z.core.$strict>], "decision">>;
250
267
  }, z.core.$strict>;
251
- /** The six marketplace tools: a read and a bulk write per entity. */
268
+ /** The marketplace tools: a read and a bulk write per entity, and the five linking tools (FUT-5613). */
252
269
  declare const MARKETPLACE_MCP_TOOLS: readonly [{
253
270
  readonly operationId: "listMarketplaceIntegrations";
254
271
  readonly method: "GET";
@@ -286,6 +303,10 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
286
303
  lastEventAt: z.ZodNullable<z.ZodString>;
287
304
  lastVerifiedAt: z.ZodNullable<z.ZodString>;
288
305
  archivedAt: z.ZodNullable<z.ZodString>;
306
+ authMode: z.ZodEnum<{
307
+ CREDENTIALS: "CREDENTIALS";
308
+ LINKED: "LINKED";
309
+ }>;
289
310
  capabilities: z.ZodNullable<z.ZodObject<{
290
311
  apiConfirm: z.ZodBoolean;
291
312
  apiCancel: z.ZodBoolean;
@@ -309,7 +330,7 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
309
330
  readonly operationId: "upsertMarketplaceIntegrations";
310
331
  readonly method: "PUT";
311
332
  readonly path: "/admin/{tenantSlug}/marketplace";
312
- readonly summary: "Create, update, archive or unarchive one or many marketplace connections in one all-or-nothing call. A row is keyed by `provider`; `operation` is `upsert` (default: any subset of the settings; omitting `credentials` keeps the stored secrets, sending them resets the status to UNVERIFIED), `archive` or `unarchive` (reversible, audited, with an optional `reason`). Any problem writes nothing and every problem comes back with its path. `validateOnly: true` checks without writing.";
333
+ readonly summary: "Create, update, archive or unarchive one or many marketplace connections in one all-or-nothing call. A row is keyed by `provider`; `operation` is `upsert` (default: any subset of the settings; omitting `credentials` keeps the stored secrets, sending them resets the status to UNVERIFIED), `archive` or `unarchive` (reversible, audited, with an optional `reason`). An `externalMerchantId` another store's live connection holds is refused `MERCHANT_TAKEN` at that field (an unarchive reviving one, at `provider`). Any problem writes nothing and every problem comes back with its path. `validateOnly: true` checks without writing.";
313
334
  readonly tags: readonly ["marketplace"];
314
335
  readonly params: z.ZodObject<{
315
336
  tenantSlug: z.ZodString;
@@ -365,6 +386,10 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
365
386
  lastEventAt: z.ZodNullable<z.ZodString>;
366
387
  lastVerifiedAt: z.ZodNullable<z.ZodString>;
367
388
  archivedAt: z.ZodNullable<z.ZodString>;
389
+ authMode: z.ZodEnum<{
390
+ CREDENTIALS: "CREDENTIALS";
391
+ LINKED: "LINKED";
392
+ }>;
368
393
  capabilities: z.ZodNullable<z.ZodObject<{
369
394
  apiConfirm: z.ZodBoolean;
370
395
  apiCancel: z.ZodBoolean;
@@ -410,6 +435,7 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
410
435
  externalSku: z.ZodString;
411
436
  externalName: z.ZodString;
412
437
  menuItemId: z.ZodNullable<z.ZodString>;
438
+ variationId: z.ZodNullable<z.ZodString>;
413
439
  lastSeenAt: z.ZodString;
414
440
  }, z.core.$strip>>;
415
441
  }, z.core.$strip>;
@@ -420,7 +446,7 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
420
446
  readonly operationId: "upsertMarketplaceMenuLinks";
421
447
  readonly method: "PUT";
422
448
  readonly path: "/admin/{tenantSlug}/marketplace/menu-links";
423
- readonly summary: "Map one or many external marketplace SKUs to the store's catalog ids, or unmap them with `menuItemId: null`, in one all-or-nothing call keyed by (`provider`, `externalSku`). A SKU never seen is created, so a store can map ahead of the first order. Applies to orders ingested from now on. Any problem (a catalog id that is not the store's, a repeated SKU) writes nothing; `validateOnly: true` checks without writing.";
449
+ readonly summary: "Map one or many external marketplace SKUs to the store's catalog ids, or unmap them with `menuItemId: null`; `variationId` maps a SKU to one variation of its catalog id instead of the item alone, in one all-or-nothing call keyed by (`provider`, `externalSku`). A SKU never seen is created, so a store can map ahead of the first order. Applies to orders ingested from now on. Any problem (a catalog id that is not the store's, a variation that is not one of its catalog id's, a repeated SKU) writes nothing; `validateOnly: true` checks without writing.";
424
450
  readonly tags: readonly ["marketplace"];
425
451
  readonly params: z.ZodObject<{
426
452
  tenantSlug: z.ZodString;
@@ -432,6 +458,7 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
432
458
  externalSku: z.ZodString;
433
459
  externalName: z.ZodOptional<z.ZodString>;
434
460
  menuItemId: z.ZodNullable<z.ZodString>;
461
+ variationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
435
462
  }, z.core.$strict>>;
436
463
  }, z.core.$strict>;
437
464
  readonly response: z.ZodObject<{
@@ -443,6 +470,7 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
443
470
  externalSku: z.ZodString;
444
471
  externalName: z.ZodString;
445
472
  menuItemId: z.ZodNullable<z.ZodString>;
473
+ variationId: z.ZodNullable<z.ZodString>;
446
474
  lastSeenAt: z.ZodString;
447
475
  }, z.core.$strip>>;
448
476
  }, z.core.$strip>;
@@ -532,6 +560,216 @@ declare const MARKETPLACE_MCP_TOOLS: readonly [{
532
560
  readonly destructive: true;
533
561
  readonly openWorld: true;
534
562
  };
563
+ }, {
564
+ readonly operationId: "getMarketplaceLink";
565
+ readonly method: "GET";
566
+ readonly path: "/admin/{tenantSlug}/marketplace/link";
567
+ readonly summary: "Read in one call whether a store can connect a marketplace through the software's own app (no credentials typed), and the portal code still in progress, if any: `userCode`, the portal link that already carries it, and when it expires.";
568
+ readonly tags: readonly ["marketplace"];
569
+ readonly params: z.ZodObject<{
570
+ tenantSlug: z.ZodString;
571
+ }, z.core.$strict>;
572
+ readonly query: z.ZodObject<{
573
+ provider: z.ZodString;
574
+ environment: z.ZodOptional<z.ZodEnum<{
575
+ SANDBOX: "SANDBOX";
576
+ PRODUCTION: "PRODUCTION";
577
+ }>>;
578
+ }, z.core.$strict>;
579
+ readonly response: z.ZodObject<{
580
+ data: z.ZodObject<{
581
+ available: z.ZodBoolean;
582
+ pending: z.ZodNullable<z.ZodObject<{
583
+ userCode: z.ZodString;
584
+ verificationUrl: z.ZodString;
585
+ verificationUrlComplete: z.ZodString;
586
+ expiresAt: z.ZodString;
587
+ }, z.core.$strip>>;
588
+ }, z.core.$strip>;
589
+ }, z.core.$strip>;
590
+ readonly annotations: {
591
+ readonly readOnly: true;
592
+ };
593
+ }, {
594
+ readonly operationId: "listMarketplaceLinkMerchants";
595
+ readonly method: "GET";
596
+ readonly path: "/admin/{tenantSlug}/marketplace/link/merchants";
597
+ readonly summary: "List the marketplace stores a linked connection's authorization covers, to choose which one this store is.";
598
+ readonly tags: readonly ["marketplace"];
599
+ readonly params: z.ZodObject<{
600
+ tenantSlug: z.ZodString;
601
+ }, z.core.$strict>;
602
+ readonly query: z.ZodObject<{
603
+ provider: z.ZodString;
604
+ }, z.core.$strict>;
605
+ readonly response: z.ZodObject<{
606
+ data: z.ZodArray<z.ZodObject<{
607
+ id: z.ZodString;
608
+ name: z.ZodNullable<z.ZodString>;
609
+ corporateName: z.ZodNullable<z.ZodString>;
610
+ }, z.core.$strip>>;
611
+ }, z.core.$strip>;
612
+ readonly annotations: {
613
+ readonly readOnly: true;
614
+ readonly openWorld: true;
615
+ };
616
+ }, {
617
+ readonly operationId: "startMarketplaceLink";
618
+ readonly method: "POST";
619
+ readonly path: "/admin/{tenantSlug}/marketplace/link/start";
620
+ readonly summary: "Start connecting a marketplace through the software's own app in one call: answers the code the person types on the marketplace's portal and the portal link that already carries it (valid ten minutes on iFood). Replaces a code in progress. 409 UNAVAILABLE when the software has no app on that marketplace.";
621
+ readonly tags: readonly ["marketplace"];
622
+ readonly params: z.ZodObject<{
623
+ tenantSlug: z.ZodString;
624
+ }, z.core.$strict>;
625
+ readonly body: z.ZodObject<{
626
+ provider: z.ZodString;
627
+ environment: z.ZodOptional<z.ZodEnum<{
628
+ SANDBOX: "SANDBOX";
629
+ PRODUCTION: "PRODUCTION";
630
+ }>>;
631
+ }, z.core.$strict>;
632
+ readonly response: z.ZodObject<{
633
+ data: z.ZodObject<{
634
+ userCode: z.ZodString;
635
+ verificationUrl: z.ZodString;
636
+ verificationUrlComplete: z.ZodString;
637
+ expiresAt: z.ZodString;
638
+ }, z.core.$strip>;
639
+ }, z.core.$strip>;
640
+ readonly annotations: {
641
+ readonly readOnly: false;
642
+ readonly destructive: false;
643
+ readonly openWorld: true;
644
+ };
645
+ }, {
646
+ readonly operationId: "finishMarketplaceLink";
647
+ readonly method: "POST";
648
+ readonly path: "/admin/{tenantSlug}/marketplace/link/finish";
649
+ readonly summary: "Finish connecting, in one call, with the authorization code the marketplace's portal showed the person. Stores the connection as LINKED and selects the marketplace store when the authorization covers only one; `merchants` lists them (null when they could not be listed). 422 CODE_REFUSED for a wrong code (the code in progress stays, paste again); 409 LINK_EXPIRED past its ten minutes.";
650
+ readonly tags: readonly ["marketplace"];
651
+ readonly params: z.ZodObject<{
652
+ tenantSlug: z.ZodString;
653
+ }, z.core.$strict>;
654
+ readonly body: z.ZodObject<{
655
+ provider: z.ZodString;
656
+ authorizationCode: z.ZodString;
657
+ enabled: z.ZodOptional<z.ZodBoolean>;
658
+ }, z.core.$strict>;
659
+ readonly response: z.ZodObject<{
660
+ data: z.ZodObject<{
661
+ integration: z.ZodObject<{
662
+ provider: z.ZodString;
663
+ enabled: z.ZodBoolean;
664
+ environment: z.ZodEnum<{
665
+ SANDBOX: "SANDBOX";
666
+ PRODUCTION: "PRODUCTION";
667
+ }>;
668
+ status: z.ZodEnum<{
669
+ FAILED: "FAILED";
670
+ UNVERIFIED: "UNVERIFIED";
671
+ VERIFIED: "VERIFIED";
672
+ }>;
673
+ externalMerchantId: z.ZodNullable<z.ZodString>;
674
+ autoAccept: z.ZodBoolean;
675
+ followStatus: z.ZodBoolean;
676
+ ackSlaSeconds: z.ZodNumber;
677
+ connected: z.ZodBoolean;
678
+ lastEventAt: z.ZodNullable<z.ZodString>;
679
+ lastVerifiedAt: z.ZodNullable<z.ZodString>;
680
+ archivedAt: z.ZodNullable<z.ZodString>;
681
+ authMode: z.ZodEnum<{
682
+ CREDENTIALS: "CREDENTIALS";
683
+ LINKED: "LINKED";
684
+ }>;
685
+ capabilities: z.ZodNullable<z.ZodObject<{
686
+ apiConfirm: z.ZodBoolean;
687
+ apiCancel: z.ZodBoolean;
688
+ cancelAfterAccept: z.ZodBoolean;
689
+ asyncCancellationOutcome: z.ZodBoolean;
690
+ perOrderAppLink: z.ZodBoolean;
691
+ confirmTakesPreparationTime: z.ZodBoolean;
692
+ }, z.core.$strip>>;
693
+ reasons: z.ZodArray<z.ZodObject<{
694
+ code: z.ZodString;
695
+ label: z.ZodString;
696
+ itemUnavailable: z.ZodBoolean;
697
+ needsItems: z.ZodBoolean;
698
+ }, z.core.$strip>>;
699
+ }, z.core.$strip>;
700
+ merchants: z.ZodNullable<z.ZodArray<z.ZodObject<{
701
+ id: z.ZodString;
702
+ name: z.ZodNullable<z.ZodString>;
703
+ corporateName: z.ZodNullable<z.ZodString>;
704
+ }, z.core.$strip>>>;
705
+ }, z.core.$strip>;
706
+ }, z.core.$strip>;
707
+ readonly annotations: {
708
+ readonly readOnly: false;
709
+ readonly destructive: false;
710
+ readonly openWorld: true;
711
+ };
712
+ }, {
713
+ readonly operationId: "selectMarketplaceLinkMerchant";
714
+ readonly method: "PUT";
715
+ readonly path: "/admin/{tenantSlug}/marketplace/link/merchant";
716
+ readonly summary: "Choose in one call which marketplace store a linked connection is, among those its authorization covers. 422 UNKNOWN_MERCHANT for one it does not cover; 409 MERCHANT_TAKEN when another store's connection holds it.";
717
+ readonly tags: readonly ["marketplace"];
718
+ readonly params: z.ZodObject<{
719
+ tenantSlug: z.ZodString;
720
+ }, z.core.$strict>;
721
+ readonly body: z.ZodObject<{
722
+ provider: z.ZodString;
723
+ merchantId: z.ZodString;
724
+ }, z.core.$strict>;
725
+ readonly response: z.ZodObject<{
726
+ data: z.ZodObject<{
727
+ integration: z.ZodObject<{
728
+ provider: z.ZodString;
729
+ enabled: z.ZodBoolean;
730
+ environment: z.ZodEnum<{
731
+ SANDBOX: "SANDBOX";
732
+ PRODUCTION: "PRODUCTION";
733
+ }>;
734
+ status: z.ZodEnum<{
735
+ FAILED: "FAILED";
736
+ UNVERIFIED: "UNVERIFIED";
737
+ VERIFIED: "VERIFIED";
738
+ }>;
739
+ externalMerchantId: z.ZodNullable<z.ZodString>;
740
+ autoAccept: z.ZodBoolean;
741
+ followStatus: z.ZodBoolean;
742
+ ackSlaSeconds: z.ZodNumber;
743
+ connected: z.ZodBoolean;
744
+ lastEventAt: z.ZodNullable<z.ZodString>;
745
+ lastVerifiedAt: z.ZodNullable<z.ZodString>;
746
+ archivedAt: z.ZodNullable<z.ZodString>;
747
+ authMode: z.ZodEnum<{
748
+ CREDENTIALS: "CREDENTIALS";
749
+ LINKED: "LINKED";
750
+ }>;
751
+ capabilities: z.ZodNullable<z.ZodObject<{
752
+ apiConfirm: z.ZodBoolean;
753
+ apiCancel: z.ZodBoolean;
754
+ cancelAfterAccept: z.ZodBoolean;
755
+ asyncCancellationOutcome: z.ZodBoolean;
756
+ perOrderAppLink: z.ZodBoolean;
757
+ confirmTakesPreparationTime: z.ZodBoolean;
758
+ }, z.core.$strip>>;
759
+ reasons: z.ZodArray<z.ZodObject<{
760
+ code: z.ZodString;
761
+ label: z.ZodString;
762
+ itemUnavailable: z.ZodBoolean;
763
+ needsItems: z.ZodBoolean;
764
+ }, z.core.$strip>>;
765
+ }, z.core.$strip>;
766
+ }, z.core.$strip>;
767
+ }, z.core.$strip>;
768
+ readonly annotations: {
769
+ readonly readOnly: false;
770
+ readonly destructive: false;
771
+ readonly openWorld: true;
772
+ };
535
773
  }];
536
774
 
537
775
  /**
@@ -552,4 +790,4 @@ interface ApiMarketplace {
552
790
  /** Build the route table over a mounted engine. */
553
791
  declare function createApiMarketplace(config: MarketplaceApiConfig): ApiMarketplace;
554
792
 
555
- export { type ApiMarketplace, MARKETPLACE_AVAILABILITY_ATTEMPTS, MARKETPLACE_DECIDE, MARKETPLACE_FETCH_ORDER_ATTEMPTS, MARKETPLACE_JOBS, MARKETPLACE_MANAGE, MARKETPLACE_MCP_TOOLS, MARKETPLACE_OUTBOUND_ATTEMPTS, MARKETPLACE_PERMISSIONS, MARKETPLACE_SWEEP_QUEUE, type MarketplaceActor, type MarketplaceApiConfig, type MarketplaceJobDeps, type MarketplaceProblemCode, type MarketplaceRoute, type MarketplaceServerCopy, ORDER_NOT_PENDING_CODE, createApiMarketplace, decideMarketplaceOrdersBody, listMarketplaceAcceptancesQuery, listMarketplaceIntegrationsQuery, listMarketplaceMenuLinksQuery, marketplaceParams, upsertMarketplaceIntegrationsBody, upsertMarketplaceMenuLinksBody };
793
+ export { type ApiMarketplace, MARKETPLACE_AVAILABILITY_ATTEMPTS, MARKETPLACE_DECIDE, MARKETPLACE_FETCH_ORDER_ATTEMPTS, MARKETPLACE_JOBS, MARKETPLACE_MANAGE, MARKETPLACE_MCP_TOOLS, MARKETPLACE_OUTBOUND_ATTEMPTS, MARKETPLACE_PERMISSIONS, MARKETPLACE_SWEEP_QUEUE, type MarketplaceActor, type MarketplaceApiConfig, type MarketplaceJobDeps, type MarketplaceLinkCopy, type MarketplaceProblemCode, type MarketplaceRoute, type MarketplaceServerCopy, ORDER_NOT_PENDING_CODE, createApiMarketplace, decideMarketplaceOrdersBody, listMarketplaceAcceptancesQuery, listMarketplaceIntegrationsQuery, listMarketplaceMenuLinksQuery, marketplaceParams, upsertMarketplaceIntegrationsBody, upsertMarketplaceMenuLinksBody };
@@ -6,7 +6,7 @@ import {
6
6
  MARKETPLACE_SWEEP_QUEUE,
7
7
  ORDER_NOT_PENDING_CODE,
8
8
  createApiMarketplace
9
- } from "../chunk-6N2HEV3U.js";
9
+ } from "../chunk-OS4TSIFU.js";
10
10
  import {
11
11
  MARKETPLACE_DECIDE,
12
12
  MARKETPLACE_MANAGE,
@@ -19,8 +19,8 @@ import {
19
19
  marketplaceParams,
20
20
  upsertMarketplaceIntegrationsBody,
21
21
  upsertMarketplaceMenuLinksBody
22
- } from "../chunk-NP4EYKPO.js";
23
- import "../chunk-BMCERPQX.js";
22
+ } from "../chunk-SGOTN5PX.js";
23
+ import "../chunk-YWMEIMO3.js";
24
24
  import "../chunk-7QVYU63E.js";
25
25
  export {
26
26
  MARKETPLACE_AVAILABILITY_ATTEMPTS,
@@ -17,6 +17,19 @@ declare const MARKETPLACE_SERVER_COPY_PT_BR: {
17
17
  readonly NOTHING_TO_UPDATE: "Nada para atualizar.";
18
18
  readonly CATALOG_ITEM_NOT_FOUND: "Produto não encontrado.";
19
19
  };
20
+ readonly link: {
21
+ readonly problems: {
22
+ readonly UNAVAILABLE: "A conexão pelo aplicativo não está disponível para este marketplace.";
23
+ readonly NO_LINK_IN_PROGRESS: "Nenhuma conexão em andamento. Comece de novo pelo primeiro passo.";
24
+ readonly LINK_EXPIRED: "O código expirou. Gere um código novo e repita os passos.";
25
+ readonly CODE_REFUSED: "O marketplace recusou o código de autorização. Confira o código e cole de novo.";
26
+ readonly MARKETPLACE_REFUSED: "O marketplace recusou o pedido de conexão.";
27
+ readonly NOT_LINKED: "Esta loja não está conectada pelo aplicativo. Conecte de novo.";
28
+ readonly UNKNOWN_MERCHANT: "Esta loja não está entre as autorizadas no marketplace.";
29
+ readonly MERCHANT_TAKEN: "Esta loja do marketplace já está conectada a outra conta.";
30
+ };
31
+ readonly tryAgain: "O marketplace não respondeu. Tente de novo em instantes.";
32
+ };
20
33
  };
21
34
 
22
35
  export { MARKETPLACE_SERVER_COPY_PT_BR };
@@ -18,6 +18,19 @@ var MARKETPLACE_SERVER_COPY_PT_BR = {
18
18
  UNKNOWN_PROVIDER: "Marketplace desconhecido.",
19
19
  NOTHING_TO_UPDATE: "Nada para atualizar.",
20
20
  CATALOG_ITEM_NOT_FOUND: "Produto n\xE3o encontrado."
21
+ },
22
+ link: {
23
+ problems: {
24
+ UNAVAILABLE: "A conex\xE3o pelo aplicativo n\xE3o est\xE1 dispon\xEDvel para este marketplace.",
25
+ NO_LINK_IN_PROGRESS: "Nenhuma conex\xE3o em andamento. Comece de novo pelo primeiro passo.",
26
+ LINK_EXPIRED: "O c\xF3digo expirou. Gere um c\xF3digo novo e repita os passos.",
27
+ CODE_REFUSED: "O marketplace recusou o c\xF3digo de autoriza\xE7\xE3o. Confira o c\xF3digo e cole de novo.",
28
+ MARKETPLACE_REFUSED: "O marketplace recusou o pedido de conex\xE3o.",
29
+ NOT_LINKED: "Esta loja n\xE3o est\xE1 conectada pelo aplicativo. Conecte de novo.",
30
+ UNKNOWN_MERCHANT: "Esta loja n\xE3o est\xE1 entre as autorizadas no marketplace.",
31
+ MERCHANT_TAKEN: "Esta loja do marketplace j\xE1 est\xE1 conectada a outra conta."
32
+ },
33
+ tryAgain: "O marketplace n\xE3o respondeu. Tente de novo em instantes."
21
34
  }
22
35
  };
23
36
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/server/pt-BR.ts"],"sourcesContent":["import type { MarketplaceServerCopy } from \"./copy\";\n\n/** The marketplace routes' pt-BR pack. */\nexport const MARKETPLACE_SERVER_COPY_PT_BR = {\n invalidInput: \"Dados inválidos.\",\n nothingSaved: \"Nada foi salvo. Corrija os problemas listados e envie tudo de novo.\",\n orderNoLongerPending: \"Este pedido já foi decidido ou expirou. Atualize a tela.\",\n problems: {\n DUPLICATE: \"Esta linha repete outra da mesma chamada.\",\n NOT_FOUND: \"Não encontrado.\",\n ALREADY_DECIDED: \"Este pedido já foi decidido.\",\n EXPIRED: \"O prazo para aceitar este pedido passou.\",\n CONFLICT: \"Outra pessoa decidiu este pedido agora há pouco.\",\n INVALID_REASON: \"Motivo inválido para este marketplace.\",\n ITEMS_REQUIRED: \"Este motivo precisa dos itens a que se refere.\",\n UNKNOWN_ITEM: \"Este item não está no pedido.\",\n HOST_REFUSED: \"A loja recusou esta decisão.\",\n UNKNOWN_PROVIDER: \"Marketplace desconhecido.\",\n NOTHING_TO_UPDATE: \"Nada para atualizar.\",\n CATALOG_ITEM_NOT_FOUND: \"Produto não encontrado.\",\n },\n} as const satisfies MarketplaceServerCopy;\n"],"mappings":";;;AAGO,IAAM,gCAAgC;AAAA,EAC3C,cAAc;AAAA,EACd,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,UAAU;AAAA,IACR,WAAW;AAAA,IACX,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,IACnB,wBAAwB;AAAA,EAC1B;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/server/pt-BR.ts"],"sourcesContent":["import type { MarketplaceServerCopy } from \"./copy\";\n\n/** The marketplace routes' pt-BR pack. */\nexport const MARKETPLACE_SERVER_COPY_PT_BR = {\n invalidInput: \"Dados inválidos.\",\n nothingSaved: \"Nada foi salvo. Corrija os problemas listados e envie tudo de novo.\",\n orderNoLongerPending: \"Este pedido já foi decidido ou expirou. Atualize a tela.\",\n problems: {\n DUPLICATE: \"Esta linha repete outra da mesma chamada.\",\n NOT_FOUND: \"Não encontrado.\",\n ALREADY_DECIDED: \"Este pedido já foi decidido.\",\n EXPIRED: \"O prazo para aceitar este pedido passou.\",\n CONFLICT: \"Outra pessoa decidiu este pedido agora há pouco.\",\n INVALID_REASON: \"Motivo inválido para este marketplace.\",\n ITEMS_REQUIRED: \"Este motivo precisa dos itens a que se refere.\",\n UNKNOWN_ITEM: \"Este item não está no pedido.\",\n HOST_REFUSED: \"A loja recusou esta decisão.\",\n UNKNOWN_PROVIDER: \"Marketplace desconhecido.\",\n NOTHING_TO_UPDATE: \"Nada para atualizar.\",\n CATALOG_ITEM_NOT_FOUND: \"Produto não encontrado.\",\n },\n link: {\n problems: {\n UNAVAILABLE: \"A conexão pelo aplicativo não está disponível para este marketplace.\",\n NO_LINK_IN_PROGRESS: \"Nenhuma conexão em andamento. Comece de novo pelo primeiro passo.\",\n LINK_EXPIRED: \"O código expirou. Gere um código novo e repita os passos.\",\n CODE_REFUSED: \"O marketplace recusou o código de autorização. Confira o código e cole de novo.\",\n MARKETPLACE_REFUSED: \"O marketplace recusou o pedido de conexão.\",\n NOT_LINKED: \"Esta loja não está conectada pelo aplicativo. Conecte de novo.\",\n UNKNOWN_MERCHANT: \"Esta loja não está entre as autorizadas no marketplace.\",\n MERCHANT_TAKEN: \"Esta loja do marketplace já está conectada a outra conta.\",\n },\n tryAgain: \"O marketplace não respondeu. Tente de novo em instantes.\",\n },\n} as const satisfies MarketplaceServerCopy;\n"],"mappings":";;;AAGO,IAAM,gCAAgC;AAAA,EAC3C,cAAc;AAAA,EACd,cAAc;AAAA,EACd,sBAAsB;AAAA,EACtB,UAAU;AAAA,IACR,WAAW;AAAA,IACX,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,IACnB,wBAAwB;AAAA,EAC1B;AAAA,EACA,MAAM;AAAA,IACJ,UAAU;AAAA,MACR,aAAa;AAAA,MACb,qBAAqB;AAAA,MACrB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,qBAAqB;AAAA,MACrB,YAAY;AAAA,MACZ,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,IAClB;AAAA,IACA,UAAU;AAAA,EACZ;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@12-apps/marketplace",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "One marketplace integration engine for every marketplace: the durable inbox, the ingest pipeline, the acceptance clock and its sweep, the SKU map, the integration settings with sealed credentials, and the outbound engine (confirm, cancellation request, retries), behind an adapter port. Each marketplace is an adapter at its own subpath (./ifood, ./99food and ./keeta on Open Delivery, ./rappi). Framework-neutral wiring route descriptors (./server) with a Hono adapter (./hono), dep-free job blueprints, MCP tools and the package-owned Prisma partial + migrations.",
@@ -67,6 +67,12 @@ model MarketplaceIntegration {
67
67
  /// and carrying VERIFIED across a rotation asserts a probe that never ran.
68
68
  status String @default("UNVERIFIED")
69
69
 
70
+ /// CREDENTIALS | LINKED (CHECK). CREDENTIALS: the store's own app, its
71
+ /// client id and secret in `credentials`. LINKED: the store authorized the
72
+ /// software's own app (FUT-5613); `credentials` holds only its refresh token,
73
+ /// and the app's credentials are the host's configuration.
74
+ authMode String @default("CREDENTIALS") @map("auth_mode")
75
+
70
76
  lastEventAt DateTime? @map("last_event_at")
71
77
  lastVerifiedAt DateTime? @map("last_verified_at")
72
78
 
@@ -80,6 +86,9 @@ model MarketplaceIntegration {
80
86
 
81
87
  @@unique([clientId, provider])
82
88
  @@index([provider, externalMerchantId])
89
+ // One LIVE connection per (provider, externalMerchantId) is a partial unique index
90
+ // (WHERE archived_at IS NULL), which Prisma cannot express, as
91
+ // marketplace_integrations_live_merchant_key (migration 20261127090000, FUT-5613).
83
92
  @@map("marketplace_integrations")
84
93
  }
85
94
 
@@ -93,6 +102,9 @@ model MarketplaceIntegration {
93
102
  ///
94
103
  /// `lastSeenAt` is what the list sorts by, so a store fixing five mappings
95
104
  /// fixes the five costing them money rather than the five added first.
105
+ ///
106
+ /// `variationId` narrows the mapping to one variation of the item: the host
107
+ /// asks its own catalog whether it belongs (`order.catalogHasVariation`).
96
108
  model MarketplaceMenuLink {
97
109
  id String @id @default(uuid())
98
110
  clientId String @map("client_id")
@@ -105,6 +117,9 @@ model MarketplaceMenuLink {
105
117
 
106
118
  /// The host catalog row this SKU means, or NULL while nothing does.
107
119
  menuItemId String? @map("menu_item_id")
120
+ /// The variation of `menuItemId` this SKU names, or NULL for the parent
121
+ /// item alone. Never set without `menuItemId` (FUT-4927).
122
+ variationId String? @map("variation_id")
108
123
 
109
124
  lastSeenAt DateTime @default(now()) @map("last_seen_at")
110
125
 
@@ -451,3 +466,35 @@ model MarketplaceStatusUpdate {
451
466
  // 'SENDING'), which Prisma cannot express, as marketplace_acceptances_cancellation_waiting_idx.
452
467
  @@map("marketplace_status_updates")
453
468
  }
469
+
470
+ /// One store's linking in progress through the software's own app (FUT-5613):
471
+ /// the code it types on the marketplace's portal, and the VERIFIER the exchange
472
+ /// needs, sealed by the host's secrets port and never sent to a browser.
473
+ ///
474
+ /// At most one per (store, marketplace): starting again replaces it. The row
475
+ /// is short-lived by nature (the marketplace's code lives ten minutes) and is
476
+ /// removed by the exchange that uses it; it is not a connection and never
477
+ /// reads as one.
478
+ model MarketplaceLinkAttempt {
479
+ id String @id @default(uuid())
480
+ clientId String @map("client_id")
481
+ provider String
482
+
483
+ /// SANDBOX | PRODUCTION (CHECK): the app the code was asked of.
484
+ environment String @default("PRODUCTION")
485
+
486
+ /// The verifier, sealed. Opened only by the exchange.
487
+ verifier String
488
+
489
+ /// What the screen shows again after a reload: the code and the portal links.
490
+ userCode String @map("user_code")
491
+ verificationUrl String @map("verification_url")
492
+ verificationUrlComplete String @map("verification_url_complete")
493
+ expiresAt DateTime @map("expires_at")
494
+
495
+ createdAt DateTime @default(now()) @map("created_at")
496
+ updatedAt DateTime @updatedAt @map("updated_at")
497
+
498
+ @@unique([clientId, provider])
499
+ @@map("marketplace_link_attempts")
500
+ }
@@ -0,0 +1,11 @@
1
+ -- @domains: marketplace
2
+ -- @12-apps/marketplace: a SKU may map to one variation of a catalog item (FUT-4927).
3
+ -- Additive and replay-safe, like the engine's earlier migrations: one nullable
4
+ -- column. No foreign key into a host table, and nothing the previous release
5
+ -- reads is changed: every existing link keeps `variation_id` NULL, which is
6
+ -- the parent-only mapping it already was.
7
+ --
8
+ -- `variation_id` is the host's id of the variation the SKU names, beside the
9
+ -- `menu_item_id` it belongs to. NULL maps the SKU to the parent item alone.
10
+
11
+ ALTER TABLE "marketplace_menu_links" ADD COLUMN IF NOT EXISTS "variation_id" TEXT;
@@ -0,0 +1,81 @@
1
+ -- @domains: marketplace
2
+ -- @12-apps/marketplace: linking a store through the software's own app (FUT-5613).
3
+ -- Additive and replay-safe, like the engine's earlier migrations: one new
4
+ -- column with a default, one new table with its CHECKs and its unique, and one
5
+ -- partial unique index. No foreign key into a host table, and nothing the
6
+ -- previous release reads is changed.
7
+ --
8
+ -- `auth_mode` says how a connection authenticates: CREDENTIALS (the store's
9
+ -- own app, every existing row) or LINKED (the store authorized the software's
10
+ -- app; the sealed `credentials` blob holds its refresh token).
11
+ --
12
+ -- `marketplace_link_attempts` holds one linking in progress per (store,
13
+ -- marketplace): the portal code shown to the person and the sealed verifier
14
+ -- the exchange needs, removed by the exchange that uses it.
15
+
16
+ ALTER TABLE "marketplace_integrations" ADD COLUMN IF NOT EXISTS "auth_mode" TEXT NOT NULL DEFAULT 'CREDENTIALS';
17
+
18
+ DO $$ BEGIN
19
+ ALTER TABLE "marketplace_integrations" ADD CONSTRAINT "marketplace_integrations_auth_mode_check"
20
+ CHECK ("auth_mode" IN ('CREDENTIALS', 'LINKED'));
21
+ EXCEPTION WHEN duplicate_object THEN NULL; END $$;
22
+
23
+ CREATE TABLE IF NOT EXISTS "marketplace_link_attempts" (
24
+ "id" TEXT NOT NULL,
25
+ "client_id" TEXT NOT NULL,
26
+ "provider" TEXT NOT NULL,
27
+ "environment" TEXT NOT NULL DEFAULT 'PRODUCTION',
28
+ "verifier" TEXT NOT NULL,
29
+ "user_code" TEXT NOT NULL,
30
+ "verification_url" TEXT NOT NULL,
31
+ "verification_url_complete" TEXT NOT NULL,
32
+ "expires_at" TIMESTAMP(3) NOT NULL,
33
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
34
+ "updated_at" TIMESTAMP(3) NOT NULL,
35
+
36
+ CONSTRAINT "marketplace_link_attempts_pkey" PRIMARY KEY ("id")
37
+ );
38
+
39
+ DO $$ BEGIN
40
+ ALTER TABLE "marketplace_link_attempts" ADD CONSTRAINT "marketplace_link_attempts_provider_shape"
41
+ CHECK ("provider" ~ '^[A-Z][A-Z0-9_]*$');
42
+ EXCEPTION WHEN duplicate_object THEN NULL; END $$;
43
+
44
+ DO $$ BEGIN
45
+ ALTER TABLE "marketplace_link_attempts" ADD CONSTRAINT "marketplace_link_attempts_environment_check"
46
+ CHECK ("environment" IN ('SANDBOX', 'PRODUCTION'));
47
+ EXCEPTION WHEN duplicate_object THEN NULL; END $$;
48
+
49
+ -- One linking in progress per store and marketplace: starting again replaces it.
50
+ CREATE UNIQUE INDEX IF NOT EXISTS "marketplace_link_attempts_client_id_provider_key"
51
+ ON "marketplace_link_attempts"("client_id", "provider");
52
+
53
+ -- One live connection per marketplace store: the app's single webhook address
54
+ -- routes a delivery by the merchant id it names, so two live rows holding one
55
+ -- merchant would hand one store's orders to another. Archived rows and rows
56
+ -- with no merchant yet are outside the index.
57
+ --
58
+ -- Until this release nothing refused a merchant id another store held, so a
59
+ -- host may already have such pairs. The index is then NOT created, and no row
60
+ -- is rewritten or archived: which store a marketplace store really is, is the
61
+ -- host's call. The engine still refuses every new duplicate and attributes an
62
+ -- ambiguous merchant to nobody; a later migration adds the index once the host
63
+ -- has resolved them (the WARNING names how many).
64
+ DO $$
65
+ DECLARE
66
+ duplicates integer;
67
+ BEGIN
68
+ SELECT count(*) INTO duplicates FROM (
69
+ SELECT 1 FROM "marketplace_integrations"
70
+ WHERE "archived_at" IS NULL AND "external_merchant_id" IS NOT NULL
71
+ GROUP BY "provider", "external_merchant_id"
72
+ HAVING count(*) > 1
73
+ ) AS held_twice;
74
+ IF duplicates > 0 THEN
75
+ RAISE WARNING 'marketplace_integrations_live_merchant_key not created: % merchant id(s) are held by more than one live connection', duplicates;
76
+ ELSE
77
+ CREATE UNIQUE INDEX IF NOT EXISTS "marketplace_integrations_live_merchant_key"
78
+ ON "marketplace_integrations"("provider", "external_merchant_id")
79
+ WHERE "archived_at" IS NULL AND "external_merchant_id" IS NOT NULL;
80
+ END IF;
81
+ END $$;
@@ -1,5 +1,6 @@
1
1
  import type { MarketplaceCatalogue } from "./catalogue-port";
2
2
  import type { CatalogueReader } from "./catalogue-read-port";
3
+ import type { MarketplaceLinking } from "./linking-port";
3
4
  import type { MarketplaceAvailability } from "./pause-port";
4
5
  import type {
5
6
  MarketplaceDeliveredBy,
@@ -132,14 +133,29 @@ export interface OutboundOrderRef {
132
133
  /** A per-engine token cache an adapter reads and fills. Never persisted. */
133
134
  export type AdapterTokenCache = Map<string, { token: string; expiresAt: number }>;
134
135
 
136
+ /**
137
+ * A connection LINKED through the software's own app (FUT-5613): the store's
138
+ * access token comes from its refresh token, not from a client-credentials
139
+ * grant. `key` is where the token sits in {@link AdapterTokenCache} (delete it
140
+ * to forget a token the marketplace refused); `accessToken` answers the cached
141
+ * one or refreshes, once per connection however many calls ask at once.
142
+ */
143
+ export interface AdapterGrant {
144
+ key: string;
145
+ accessToken(): Promise<{ token: string } | OutboundResult>;
146
+ }
147
+
135
148
  /** What one outbound call is handed. */
136
149
  export interface AdapterCallContext {
137
150
  http: MarketplaceHttp;
151
+ /** The store's own credentials, or, for a linked connection, the software's app. */
138
152
  credentials: MarketplaceCredentials;
139
153
  environment: "SANDBOX" | "PRODUCTION";
140
154
  /** Written to no row, log or audit entry: memory only, per process. */
141
155
  tokens: AdapterTokenCache;
142
156
  now: Date;
157
+ /** Present for a linked connection: the token comes from here, never from a client-credentials grant. */
158
+ grant?: AdapterGrant;
143
159
  }
144
160
 
145
161
  /** One outbound call's answer, in the three shapes the engine acts on. */
@@ -242,6 +258,11 @@ export interface MarketplaceAdapter {
242
258
  * API, and the host says so.
243
259
  */
244
260
  readonly availability?: MarketplaceAvailability;
261
+ /**
262
+ * OPTIONAL. Linking a store through the software's own app on this
263
+ * marketplace (FUT-5613). Absent: a store connects with its own credentials only.
264
+ */
265
+ readonly linking?: MarketplaceLinking;
245
266
  /** Where "open it on the marketplace" goes: the order when `perOrderAppLink`, else the portal. Always https. */
246
267
  appLink(order: Pick<OutboundOrderRef, "externalOrderId" | "externalDisplayId">): string;
247
268
  }