@12-apps/marketplace 1.16.0 → 1.18.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 (79) hide show
  1. package/ADOPTING.md +185 -0
  2. package/dist/99food/index.d.ts +2 -2
  3. package/dist/99food/index.js +2 -2
  4. package/dist/{adapter-CjVdMhZ2.d.ts → adapter-ZpAWKoCk.d.ts} +300 -3
  5. package/dist/{chunk-TRUK5ZBE.js → chunk-3B5EULS6.js} +2 -2
  6. package/dist/{chunk-DJIMUEHT.js → chunk-BLHZ3MRB.js} +79 -7
  7. package/dist/chunk-BLHZ3MRB.js.map +1 -0
  8. package/dist/{chunk-SGOTN5PX.js → chunk-LO7OKO6V.js} +45 -4
  9. package/dist/chunk-LO7OKO6V.js.map +1 -0
  10. package/dist/{chunk-TICWLBSA.js → chunk-MDEIRGNL.js} +1372 -823
  11. package/dist/chunk-MDEIRGNL.js.map +1 -0
  12. package/dist/{chunk-H2VQRD3B.js → chunk-Q5RMVNU5.js} +1 -1
  13. package/dist/chunk-Q5RMVNU5.js.map +1 -0
  14. package/dist/{chunk-BTKVZAJI.js → chunk-ZT6TZTLD.js} +1 -1
  15. package/dist/chunk-ZT6TZTLD.js.map +1 -0
  16. package/dist/{client-DgzCkl8u.d.ts → client-DpEq0yXb.d.ts} +1 -1
  17. package/dist/{engine-DSRj7qnC.d.ts → engine-DRRhAjZK.d.ts} +566 -293
  18. package/dist/hono/index.d.ts +2 -2
  19. package/dist/hono/index.js +4 -4
  20. package/dist/ifood/index.d.ts +14 -2
  21. package/dist/ifood/index.js +406 -120
  22. package/dist/ifood/index.js.map +1 -1
  23. package/dist/index.d.ts +21 -4
  24. package/dist/index.js +453 -43
  25. package/dist/index.js.map +1 -1
  26. package/dist/keeta/index.d.ts +2 -2
  27. package/dist/keeta/index.js +2 -2
  28. package/dist/manifest/index.d.ts +78 -0
  29. package/dist/manifest/index.js +1 -1
  30. package/dist/manifest/server.d.ts +6 -2
  31. package/dist/manifest/server.js +4 -4
  32. package/dist/rappi/index.d.ts +1 -1
  33. package/dist/rappi/index.js +1 -1
  34. package/dist/server/index.d.ts +93 -7
  35. package/dist/server/index.js +4 -4
  36. package/package.json +1 -1
  37. package/prisma/marketplace.prisma +70 -2
  38. package/prisma/migrations/20261203180000_marketplace_app_link_check/migration.sql +14 -0
  39. package/prisma/migrations/20261203190000_marketplace_disputes/migration.sql +96 -0
  40. package/prisma/migrations/20261203200000_marketplace_status_logistics_steps/migration.sql +12 -0
  41. package/src/core/adapter.ts +14 -2
  42. package/src/core/app-linking.ts +396 -0
  43. package/src/core/delivery-code.ts +119 -0
  44. package/src/core/dispute-engine.ts +32 -0
  45. package/src/core/dispute-job.ts +142 -0
  46. package/src/core/dispute-port.ts +133 -0
  47. package/src/core/dispute-store.ts +203 -0
  48. package/src/core/disputes.ts +263 -0
  49. package/src/core/engine.ts +12 -55
  50. package/src/core/integration.ts +3 -1
  51. package/src/core/link-engine.ts +176 -0
  52. package/src/core/link-store.ts +15 -0
  53. package/src/core/linking-port.ts +35 -1
  54. package/src/core/linking.ts +8 -0
  55. package/src/core/logistics.ts +388 -0
  56. package/src/core/outbound-queue.ts +6 -1
  57. package/src/core/outbound-sweep.ts +19 -6
  58. package/src/core/outbound.ts +4 -5
  59. package/src/core/pipeline.ts +14 -4
  60. package/src/core/ports.ts +20 -2
  61. package/src/core/status-job.ts +3 -0
  62. package/src/core/status-store.ts +2 -1
  63. package/src/core/types.ts +10 -0
  64. package/src/ifood/app-linking.ts +119 -0
  65. package/src/ifood/disputes.ts +209 -0
  66. package/src/ifood/index.ts +15 -1
  67. package/src/ifood/logistics.ts +38 -0
  68. package/src/ifood/normalize.ts +14 -1
  69. package/src/index.ts +44 -0
  70. package/src/server/jobs.ts +51 -3
  71. package/src/server/link-routes.ts +56 -4
  72. package/src/server/mcp-link.ts +44 -2
  73. package/src/server/mcp.ts +2 -1
  74. package/dist/chunk-BTKVZAJI.js.map +0 -1
  75. package/dist/chunk-DJIMUEHT.js.map +0 -1
  76. package/dist/chunk-H2VQRD3B.js.map +0 -1
  77. package/dist/chunk-SGOTN5PX.js.map +0 -1
  78. package/dist/chunk-TICWLBSA.js.map +0 -1
  79. /package/dist/{chunk-TRUK5ZBE.js.map → chunk-3B5EULS6.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { Hono, Context } from 'hono';
2
2
  import { ApiMarketplace, MarketplaceApiConfig, MarketplaceActor } from '../server/index.js';
3
- import '../engine-DSRj7qnC.js';
4
- import '../adapter-CjVdMhZ2.js';
3
+ import '../engine-DRRhAjZK.js';
4
+ import '../adapter-ZpAWKoCk.js';
5
5
  import '@12-apps/wiring';
6
6
  import 'zod';
7
7
 
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createApiMarketplace
3
- } from "../chunk-DJIMUEHT.js";
4
- import "../chunk-SGOTN5PX.js";
5
- import "../chunk-TICWLBSA.js";
6
- import "../chunk-H2VQRD3B.js";
3
+ } from "../chunk-BLHZ3MRB.js";
4
+ import "../chunk-LO7OKO6V.js";
5
+ import "../chunk-MDEIRGNL.js";
6
+ import "../chunk-Q5RMVNU5.js";
7
7
  import {
8
8
  __name
9
9
  } from "../chunk-7QVYU63E.js";
@@ -1,4 +1,4 @@
1
- import { N as NormalizedEvent, a as NormalizedMarketplaceOrder, A as AdapterCallContext, F as FetchOrderResult, d as PushCatalogue, e as CatalogueItemOut, f as CatalogueReader, g as MarketplaceLinking, h as MarketplaceCourierApi, i as NormalizedCourierEvent, M as MarketplaceAvailability, S as StorePauseRequest, j as StorePauseResult, k as StorePauseRef, O as OutboundResult, c as MarketplaceAdapter } from '../adapter-CjVdMhZ2.js';
1
+ import { N as NormalizedEvent, a as NormalizedMarketplaceOrder, A as AdapterCallContext, F as FetchOrderResult, d as PushCatalogue, e as CatalogueItemOut, f as CatalogueReader, g as MarketplaceLinking, h as MarketplaceAppLinking, i as MarketplaceCourierApi, j as NormalizedCourierEvent, M as MarketplaceAvailability, S as StorePauseRequest, k as StorePauseResult, l as StorePauseRef, O as OutboundResult, m as MarketplaceLogistics, c as MarketplaceAdapter } from '../adapter-ZpAWKoCk.js';
2
2
 
3
3
  /**
4
4
  * The words the iFood adapter needs from its host, and nothing else.
@@ -76,6 +76,13 @@ declare const IFOOD_CATALOGUE_READER: CatalogueReader;
76
76
  /** The iFood adapter's linking half. */
77
77
  declare const IFOOD_LINKING: MarketplaceLinking;
78
78
 
79
+ /** Where a store authorizes the software's app: the Portal do Parceiro's apps page. */
80
+ declare const IFOOD_APPS_PORTAL_URL = "https://portal.ifood.com.br/apps";
81
+ /** "Rua Pernambuco, 1000 · Savassi": the street and number, then the district; null when the detail carries no street. */
82
+ declare function ifoodAddressLine(body: unknown): string | null;
83
+ /** The iFood adapter's centralized linking half. */
84
+ declare const IFOOD_APP_LINKING: MarketplaceAppLinking;
85
+
79
86
  /** The courier step an iFood event names, or null. */
80
87
  declare function readIfoodCourierEvent(payload: unknown, eventType: string): NormalizedCourierEvent | null;
81
88
  /** iFood's courier calls, for the adapter's `courier`. */
@@ -175,6 +182,11 @@ type IfoodDeliveryCodeResult = {
175
182
  * no result carries iFood's answer body, so nothing here puts it in a log.
176
183
  */
177
184
  declare function ifoodLogisticsVerifyDeliveryCode(ctx: AdapterCallContext, externalOrderId: string, code: string): Promise<IfoodDeliveryCodeResult>;
185
+ /**
186
+ * The adapter's Logistics half (FUT-6166): the engine's steps on iFood's
187
+ * wire. An invalid driver is answered as the engine's `invalid`.
188
+ */
189
+ declare const IFOOD_LOGISTICS: MarketplaceLogistics;
178
190
 
179
191
  /**
180
192
  * `@12-apps/marketplace/ifood` — iFood, as one adapter on the engine.
@@ -205,4 +217,4 @@ interface IfoodAdapterConfig {
205
217
  */
206
218
  declare function createIfoodAdapter(config: IfoodAdapterConfig): MarketplaceAdapter;
207
219
 
208
- export { IFOOD_AVAILABILITY, IFOOD_CANCELLATION_ANSWER_WINDOW_MS, IFOOD_CATALOGUE, IFOOD_CATALOGUE_READER, IFOOD_COURIER, IFOOD_IMAGE_BASE_URL, IFOOD_LINKING, IFOOD_LOGISTICS_STEPS, IFOOD_LOGISTICS_VEHICLES, IFOOD_PROVIDER, IFOOD_REASON_CODES, type IfoodAdapterConfig, type IfoodAdapterCopy, type IfoodDeliveryCodeResult, type IfoodLogisticsDriver, type IfoodLogisticsInvalid, type IfoodLogisticsStep, type IfoodLogisticsVehicle, type IfoodReasonCode, createIfoodAdapter, ifoodFetchOrder, ifoodItemBody, ifoodItemId, ifoodLocalTime, ifoodLogisticsAssignDriver, ifoodLogisticsStep, ifoodLogisticsStepsTo, ifoodLogisticsVerifyDeliveryCode, ifoodPause, ifoodProductId, ifoodResume, normalizeIfoodEvent, readIfoodCourierEvent, readIfoodOrder, readIfoodPresence, verifyIfoodSignature };
220
+ export { IFOOD_APPS_PORTAL_URL, IFOOD_APP_LINKING, IFOOD_AVAILABILITY, IFOOD_CANCELLATION_ANSWER_WINDOW_MS, IFOOD_CATALOGUE, IFOOD_CATALOGUE_READER, IFOOD_COURIER, IFOOD_IMAGE_BASE_URL, IFOOD_LINKING, IFOOD_LOGISTICS, IFOOD_LOGISTICS_STEPS, IFOOD_LOGISTICS_VEHICLES, IFOOD_PROVIDER, IFOOD_REASON_CODES, type IfoodAdapterConfig, type IfoodAdapterCopy, type IfoodDeliveryCodeResult, type IfoodLogisticsDriver, type IfoodLogisticsInvalid, type IfoodLogisticsStep, type IfoodLogisticsVehicle, type IfoodReasonCode, createIfoodAdapter, ifoodAddressLine, ifoodFetchOrder, ifoodItemBody, ifoodItemId, ifoodLocalTime, ifoodLogisticsAssignDriver, ifoodLogisticsStep, ifoodLogisticsStepsTo, ifoodLogisticsVerifyDeliveryCode, ifoodPause, ifoodProductId, ifoodResume, normalizeIfoodEvent, readIfoodCourierEvent, readIfoodOrder, readIfoodPresence, verifyIfoodSignature };