@12-apps/marketplace 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADOPTING.md +29 -4
- package/README.md +92 -3
- package/dist/99food/index.d.ts +48 -2
- package/dist/99food/index.js +84 -1
- package/dist/99food/index.js.map +1 -1
- package/dist/{adapter-_iuSxvVD.d.ts → adapter-0l_EmuJA.d.ts} +172 -2
- package/dist/{chunk-CRYFYDQ2.js → chunk-AYYBRQJV.js} +28 -4
- package/dist/chunk-AYYBRQJV.js.map +1 -0
- package/dist/chunk-M2V4RFMA.js +23 -0
- package/dist/chunk-M2V4RFMA.js.map +1 -0
- package/dist/{chunk-24RQZPSV.js → chunk-RVBTARIY.js} +1 -1
- package/dist/chunk-RVBTARIY.js.map +1 -0
- package/dist/{chunk-D2X7TOR6.js → chunk-XUAFXNOH.js} +449 -85
- package/dist/chunk-XUAFXNOH.js.map +1 -0
- package/dist/{engine-D-a4mttc.d.ts → engine-CZsP8KWd.d.ts} +222 -2
- package/dist/hono/index.d.ts +2 -2
- package/dist/hono/index.js +2 -2
- package/dist/ifood/index.d.ts +10 -2
- package/dist/ifood/index.js +246 -69
- package/dist/ifood/index.js.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/index.js +148 -9
- package/dist/index.js.map +1 -1
- package/dist/manifest/server.d.ts +3 -2
- package/dist/manifest/server.js +2 -2
- package/dist/rappi/index.d.ts +1 -1
- package/dist/rappi/index.js +7 -1
- package/dist/rappi/index.js.map +1 -1
- package/dist/server/index.d.ts +12 -8
- package/dist/server/index.js +2 -2
- package/package.json +1 -1
- package/prisma/marketplace.prisma +92 -1
- package/prisma/migrations/20261113120000_marketplace_catalogue/migration.sql +97 -0
- package/src/99food/catalogue.ts +117 -0
- package/src/99food/index.ts +4 -0
- package/src/99food/outbound.ts +3 -3
- package/src/core/adapter.ts +10 -1
- package/src/core/catalogue-category.ts +119 -0
- package/src/core/catalogue-ids.ts +23 -0
- package/src/core/catalogue-job.ts +332 -0
- package/src/core/catalogue-port.ts +173 -0
- package/src/core/catalogue-store.ts +172 -0
- package/src/core/catalogue-sweep.ts +43 -0
- package/src/core/catalogue.ts +226 -0
- package/src/core/engine.ts +46 -0
- package/src/core/outbound-sweep.ts +7 -2
- package/src/core/ports.ts +36 -0
- package/src/ifood/catalogue.ts +273 -0
- package/src/ifood/index.ts +4 -0
- package/src/ifood/outbound.ts +9 -6
- package/src/index.ts +40 -0
- package/src/rappi/index.ts +6 -0
- package/src/server/jobs.ts +39 -9
- package/dist/chunk-24RQZPSV.js.map +0 -1
- package/dist/chunk-CRYFYDQ2.js.map +0 -1
- package/dist/chunk-D2X7TOR6.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NormalizedMarketplaceOrder,
|
|
1
|
+
import { m as CatalogueItem, l as CatalogueImage, a as NormalizedMarketplaceOrder, v as MarketplaceHttp, M as MarketplaceAdapter, e as MarketplaceProvider, t as MarketplaceCredentials, q as CatalogueWarningCode, f as CancellationReason, O as OutboundOrderRef, N as NormalizedEvent, b as CatalogueMenuOptions } from './adapter-0l_EmuJA.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* What the engine needs FROM its host, and nothing more.
|
|
@@ -55,6 +55,27 @@ interface MarketplaceDb {
|
|
|
55
55
|
count: number;
|
|
56
56
|
}>;
|
|
57
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* OPTIONAL in the type, so a host on 1.x that has not yet composed the
|
|
60
|
+
* catalogue model still compiles; the catalogue calls refuse without it
|
|
61
|
+
* (FUT-4768, migration `20261113120000_marketplace_catalogue`).
|
|
62
|
+
*/
|
|
63
|
+
marketplaceCataloguePublication?: {
|
|
64
|
+
findFirst(args: unknown): Promise<unknown>;
|
|
65
|
+
findMany(args: unknown): Promise<unknown[]>;
|
|
66
|
+
upsert(args: unknown): Promise<unknown>;
|
|
67
|
+
updateMany(args: unknown): Promise<{
|
|
68
|
+
count: number;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
/** OPTIONAL, as above: the marketplace's category ids, found or created once per name. */
|
|
72
|
+
marketplaceCatalogueCategory?: {
|
|
73
|
+
findFirst(args: unknown): Promise<unknown>;
|
|
74
|
+
create(args: unknown): Promise<unknown>;
|
|
75
|
+
updateMany(args: unknown): Promise<{
|
|
76
|
+
count: number;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
58
79
|
}
|
|
59
80
|
/**
|
|
60
81
|
* One order line after the engine has matched it against the SKU map.
|
|
@@ -220,6 +241,18 @@ interface MarketplaceLogger {
|
|
|
220
241
|
warn(message: string, ...meta: unknown[]): void;
|
|
221
242
|
error(message: string, ...meta: unknown[]): void;
|
|
222
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* The host's catalogue, as the catalogue publishing reads it (FUT-4768). The
|
|
246
|
+
* engine never reads a host table: the host maps its product into the item
|
|
247
|
+
* shape, at the moment the job sends it, so what goes out is the product as it
|
|
248
|
+
* is now rather than as it was when the switch was turned on.
|
|
249
|
+
*/
|
|
250
|
+
interface MarketplaceCataloguePort {
|
|
251
|
+
/** These products as they go out, keyed by product id. Missing ids are products that no longer exist. */
|
|
252
|
+
items(clientId: string, productIds: readonly string[]): Promise<Map<string, CatalogueItem>>;
|
|
253
|
+
/** The bytes behind an item's photo, for a marketplace that takes an upload; null when they cannot be read. */
|
|
254
|
+
image(url: string): Promise<CatalogueImage | null>;
|
|
255
|
+
}
|
|
223
256
|
/** Everything the host plugs in. */
|
|
224
257
|
interface MarketplacePorts {
|
|
225
258
|
db: () => Promise<MarketplaceDb>;
|
|
@@ -251,6 +284,11 @@ interface MarketplacePorts {
|
|
|
251
284
|
* only given up on after `OUTBOUND_GIVE_UP_MS`.
|
|
252
285
|
*/
|
|
253
286
|
cancellationWindowMs?: number;
|
|
287
|
+
/**
|
|
288
|
+
* OPTIONAL. The host's catalogue, for publishing products to a marketplace's
|
|
289
|
+
* catalogue. Absent: every catalogue call answers `UNSUPPORTED`.
|
|
290
|
+
*/
|
|
291
|
+
catalogue?: MarketplaceCataloguePort;
|
|
254
292
|
/** The acceptance window a connection gets when it does not state its own. */
|
|
255
293
|
defaultAckSlaSeconds: number;
|
|
256
294
|
/** How many stored deliveries one reconciliation pass re-runs. */
|
|
@@ -528,6 +566,162 @@ type DecisionResult = ({
|
|
|
528
566
|
details?: unknown;
|
|
529
567
|
};
|
|
530
568
|
|
|
569
|
+
/**
|
|
570
|
+
* The catalogue publication's rows and the reads every catalogue path shares
|
|
571
|
+
* (FUT-4768). The table is `marketplace_catalogue_publications`; its states
|
|
572
|
+
* are the mechanism's vocabulary, never a language.
|
|
573
|
+
*/
|
|
574
|
+
/** Where one product stands in one marketplace's catalogue. */
|
|
575
|
+
type CatalogueStatus = "PUBLISHING" | "PUBLISHED" | "WITHDRAWING" | "WITHDRAWN" | "FAILED";
|
|
576
|
+
/** Which action a FAILED row failed at. */
|
|
577
|
+
type CatalogueFailedAction = "PUBLISH" | "WITHDRAW";
|
|
578
|
+
/**
|
|
579
|
+
* Why a row FAILED, as a code the host turns into its own words. Vocabulary,
|
|
580
|
+
* not copy: the engine writes no sentence a person reads.
|
|
581
|
+
*
|
|
582
|
+
* - `REFUSED` — the marketplace said no; its own words are in `failureReason`.
|
|
583
|
+
* - `UNAVAILABLE` — no usable answer on any attempt (5xx, 429, timeouts).
|
|
584
|
+
* - `TIMEOUT` — still on its way a day later (the sweep gave up).
|
|
585
|
+
* - `NOT_CONNECTED` — no live connection with a merchant id (archived, removed).
|
|
586
|
+
* - `CREDENTIALS` — no credentials on file, or they would not open.
|
|
587
|
+
* - `PRODUCT_GONE` — the host's catalogue no longer has the product.
|
|
588
|
+
* - `UNSUPPORTED` — the marketplace has no catalogue capability any more.
|
|
589
|
+
* - `INTERNAL` — the engine or the adapter threw (logged, never shown).
|
|
590
|
+
*/
|
|
591
|
+
type CatalogueFailureCode = "REFUSED" | "UNAVAILABLE" | "TIMEOUT" | "NOT_CONNECTED" | "CREDENTIALS" | "PRODUCT_GONE" | "UNSUPPORTED" | "INTERNAL";
|
|
592
|
+
/** One publication as a host reads it. */
|
|
593
|
+
interface CataloguePublicationView {
|
|
594
|
+
provider: MarketplaceProvider;
|
|
595
|
+
productId: string;
|
|
596
|
+
status: CatalogueStatus;
|
|
597
|
+
/** The store's price for this marketplace; null is "the store's own price". */
|
|
598
|
+
priceCents: number | null;
|
|
599
|
+
/** The price the last successful publish sent. */
|
|
600
|
+
sentPriceCents: number | null;
|
|
601
|
+
/** The marketplace's id for the item, from the last successful publish. */
|
|
602
|
+
externalId: string | null;
|
|
603
|
+
/** What the last successful publish could not do (the photo); null when it did everything. */
|
|
604
|
+
warningCode: CatalogueWarningCode | null;
|
|
605
|
+
failedAction: CatalogueFailedAction | null;
|
|
606
|
+
/** Why it FAILED; null unless FAILED. The host's copy is keyed by it. */
|
|
607
|
+
failureCode: CatalogueFailureCode | null;
|
|
608
|
+
/**
|
|
609
|
+
* The marketplace's OWN words for a `REFUSED` (its answer's body, truncated);
|
|
610
|
+
* null for every other code. Never an engine or internal message.
|
|
611
|
+
*/
|
|
612
|
+
failureReason: string | null;
|
|
613
|
+
requestedAt: Date;
|
|
614
|
+
publishedAt: Date | null;
|
|
615
|
+
withdrawnAt: Date | null;
|
|
616
|
+
failedAt: Date | null;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Catalogue publishing, as a host calls it (FUT-4768): from a product's page,
|
|
621
|
+
* the store turns the product ON (`publish`) or OFF (`withdraw`) per connected
|
|
622
|
+
* marketplace, with an optional price for that marketplace, and reads where
|
|
623
|
+
* each stands (`catalogueState`, one read for a whole page).
|
|
624
|
+
*
|
|
625
|
+
* Nothing here calls a marketplace: a publish or withdraw stamps the row and
|
|
626
|
+
* queues `marketplace.catalogue`, whose job makes the call. The host's product
|
|
627
|
+
* is read through its `catalogue` port, never from a host table, and only the
|
|
628
|
+
* job reads it for sending, so what goes out is the product as it is then.
|
|
629
|
+
*/
|
|
630
|
+
/** Why a catalogue call was refused before anything was stamped. Vocabulary, not copy. */
|
|
631
|
+
type CatalogueRefusalCode =
|
|
632
|
+
/** The marketplace has no catalogue capability, or the host bound no catalogue port or table. */
|
|
633
|
+
"UNSUPPORTED"
|
|
634
|
+
/** No live connection with credentials and a merchant id. */
|
|
635
|
+
| "NOT_CONNECTED"
|
|
636
|
+
/** The host's catalogue does not have this product. */
|
|
637
|
+
| "UNKNOWN_PRODUCT"
|
|
638
|
+
/** The price for the marketplace is not a positive integer of the smallest unit. */
|
|
639
|
+
| "INVALID_PRICE";
|
|
640
|
+
/** What `publish` and `withdraw` answer. */
|
|
641
|
+
type CatalogueActionResult =
|
|
642
|
+
/** Stamped and queued (or already on its way: a double tap is this, with nothing new queued). */
|
|
643
|
+
{
|
|
644
|
+
kind: "queued";
|
|
645
|
+
publication: CataloguePublicationView;
|
|
646
|
+
}
|
|
647
|
+
/** Nothing to do: the product is not in that marketplace's catalogue, or was never there. */
|
|
648
|
+
| {
|
|
649
|
+
kind: "unchanged";
|
|
650
|
+
publication: CataloguePublicationView | null;
|
|
651
|
+
} | {
|
|
652
|
+
kind: "refused";
|
|
653
|
+
code: CatalogueRefusalCode;
|
|
654
|
+
};
|
|
655
|
+
/** What a pull marketplace's menu document read answers. */
|
|
656
|
+
type CatalogueDocumentResult = {
|
|
657
|
+
kind: "document";
|
|
658
|
+
document: unknown;
|
|
659
|
+
} | {
|
|
660
|
+
kind: "refused";
|
|
661
|
+
code: Exclude<CatalogueRefusalCode, "UNKNOWN_PRODUCT" | "INVALID_PRICE">;
|
|
662
|
+
};
|
|
663
|
+
/** One product on one marketplace. */
|
|
664
|
+
interface CatalogueTarget {
|
|
665
|
+
clientId: string;
|
|
666
|
+
provider: MarketplaceProvider;
|
|
667
|
+
productId: string;
|
|
668
|
+
}
|
|
669
|
+
/** A publish: the target, and the price for this marketplace — absent keeps the stored one, null is the store's. */
|
|
670
|
+
interface CataloguePublishInput extends CatalogueTarget {
|
|
671
|
+
priceCents?: number | null;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* The catalogue job (`marketplace.catalogue`): one publish or withdraw of one
|
|
676
|
+
* product on one marketplace, start to finish (FUT-4768).
|
|
677
|
+
*
|
|
678
|
+
* The same rules as the outbound job, for the same reasons:
|
|
679
|
+
*
|
|
680
|
+
* - **idempotent by the ROW** — a run acts only while the row still asks for
|
|
681
|
+
* its action (PUBLISHING for a publish, WITHDRAWING for a withdraw) at the
|
|
682
|
+
* instant it was asked (`requested_at`), so a duplicate or stale job calls
|
|
683
|
+
* nobody, and a stamp never overwrites a newer ask;
|
|
684
|
+
* - **2xx done, a final 4xx FAILED with the marketplace's reason, anything
|
|
685
|
+
* else retried** until the last attempt, which ends FAILED;
|
|
686
|
+
* - **queued, never called inline** — `publish` and `withdraw` only stamp and
|
|
687
|
+
* enqueue; the sweep re-queues a row still owed.
|
|
688
|
+
*
|
|
689
|
+
* Push or pull is the adapter's `catalogue.mode`, never a provider check: a
|
|
690
|
+
* push marketplace gets the item written or withdrawn; a pull marketplace is
|
|
691
|
+
* told its menu changed (the host serves the document, which already reflects
|
|
692
|
+
* the row).
|
|
693
|
+
*/
|
|
694
|
+
/** The wire name, `<namespace>.<blueprint>` as the jobs contribution binds it. */
|
|
695
|
+
declare const MARKETPLACE_CATALOGUE_JOB = "marketplace.catalogue";
|
|
696
|
+
/** What one run does to its row. */
|
|
697
|
+
type CatalogueAction = "publish" | "withdraw";
|
|
698
|
+
/** The job's payload. Identifiers only: what to send lives on the row and in the host's catalogue. */
|
|
699
|
+
interface CatalogueJobPayload {
|
|
700
|
+
clientId: string;
|
|
701
|
+
publicationId: string;
|
|
702
|
+
action: CatalogueAction;
|
|
703
|
+
}
|
|
704
|
+
/** What one run did. */
|
|
705
|
+
type CatalogueOutcome = {
|
|
706
|
+
kind: "skipped";
|
|
707
|
+
reason: string;
|
|
708
|
+
} | {
|
|
709
|
+
kind: "done";
|
|
710
|
+
action: CatalogueAction;
|
|
711
|
+
}
|
|
712
|
+
/** `reason` is the row's failure code; the detail went to the log. */
|
|
713
|
+
| {
|
|
714
|
+
kind: "failed";
|
|
715
|
+
action: CatalogueAction;
|
|
716
|
+
reason: string;
|
|
717
|
+
};
|
|
718
|
+
/** Thrown so the queue retries. Its message is what the job log reads. */
|
|
719
|
+
declare class CatalogueRetryError extends Error {
|
|
720
|
+
constructor(message: string);
|
|
721
|
+
}
|
|
722
|
+
/** The dedupe key: one queued run per (row, ask). A re-ask carries a new instant, so it is never swallowed. */
|
|
723
|
+
declare function catalogueDedupeKey(payload: CatalogueJobPayload, requestedAt: Date): string;
|
|
724
|
+
|
|
531
725
|
/**
|
|
532
726
|
* Fetching an order the event only announced — the engine's half of a
|
|
533
727
|
* marketplace whose events carry no order body (Open Delivery's `CREATED`).
|
|
@@ -623,6 +817,8 @@ interface OutboundSweepResult {
|
|
|
623
817
|
givenUp: number;
|
|
624
818
|
/** Requests failed as TIMEOUT past their marketplace's answer window. */
|
|
625
819
|
timedOut: number;
|
|
820
|
+
/** Catalogue publishes and withdraws still owed, re-queued (FUT-4768). */
|
|
821
|
+
catalogueRequeued: number;
|
|
626
822
|
}
|
|
627
823
|
|
|
628
824
|
/** One stored delivery, as the retry sweep re-reads it. */
|
|
@@ -892,6 +1088,30 @@ interface MarketplaceEngine {
|
|
|
892
1088
|
runOutbound(payload: OutboundJobPayload, attempt: OutboundAttempt): Promise<OutboundOutcome>;
|
|
893
1089
|
/** Fetch and ingest one announced order (the `marketplace.fetch-order` job's body). */
|
|
894
1090
|
runFetchOrder(payload: FetchOrderJobPayload, attempt: OutboundAttempt): Promise<FetchOrderOutcome>;
|
|
1091
|
+
/**
|
|
1092
|
+
* How this marketplace's catalogue is published (`push`, `pull`), or null
|
|
1093
|
+
* when it cannot be: the adapter states no catalogue, or the host bound no
|
|
1094
|
+
* catalogue port (FUT-4768).
|
|
1095
|
+
*/
|
|
1096
|
+
catalogueMode(provider: string): "push" | "pull" | null;
|
|
1097
|
+
/** Put a product in a marketplace's catalogue (or send it again), with an optional price for it. Queued. */
|
|
1098
|
+
publish(input: CataloguePublishInput): Promise<CatalogueActionResult>;
|
|
1099
|
+
/** Take a product out of a marketplace's catalogue. Queued. */
|
|
1100
|
+
withdraw(input: CatalogueTarget): Promise<CatalogueActionResult>;
|
|
1101
|
+
/** Where these products stand on these marketplaces, in one read. */
|
|
1102
|
+
catalogueState(input: {
|
|
1103
|
+
clientId: string;
|
|
1104
|
+
productIds: readonly string[];
|
|
1105
|
+
providers?: readonly string[];
|
|
1106
|
+
}): Promise<CataloguePublicationView[]>;
|
|
1107
|
+
/** The menu part of the document a PULL marketplace reads, for the host to serve. */
|
|
1108
|
+
catalogueDocument(input: {
|
|
1109
|
+
clientId: string;
|
|
1110
|
+
provider: MarketplaceProvider;
|
|
1111
|
+
options: CatalogueMenuOptions;
|
|
1112
|
+
}): Promise<CatalogueDocumentResult>;
|
|
1113
|
+
/** Run one queued publish or withdraw (the `marketplace.catalogue` job's body). */
|
|
1114
|
+
runCatalogue(payload: CatalogueJobPayload, attempt: OutboundAttempt): Promise<CatalogueOutcome>;
|
|
895
1115
|
}
|
|
896
1116
|
/**
|
|
897
1117
|
* Mount the engine onto a host.
|
|
@@ -903,4 +1123,4 @@ interface MarketplaceEngine {
|
|
|
903
1123
|
*/
|
|
904
1124
|
declare function createMarketplaceEngine(config: MarketplaceEngineConfig): MarketplaceEngine;
|
|
905
1125
|
|
|
906
|
-
export { type
|
|
1126
|
+
export { type MarketplaceOrderState as $, type AcceptanceDecision as A, type BulkProblem as B, type CancellationFailureReason as C, type DecideManyResult as D, type ExpirySweepResult as E, type FetchOrderJobPayload as F, type IngestionTarget as G, type IntegrationRowInput as H, type IngestResult as I, MARKETPLACE_FETCH_ORDER_JOB as J, MARKETPLACE_OUTBOUND_JOB as K, type MarketplaceAdmission as L, MARKETPLACE_CATALOGUE_JOB as M, type MarketplaceAdmissionRequest as N, type MarketplaceAdmissionResult as O, type MarketplaceAuditEntry as P, type MarketplaceAuditPort as Q, type MarketplaceCataloguePort as R, type MarketplaceClockPort as S, type MarketplaceDb as T, type MarketplaceEngine as U, type MarketplaceEngineConfig as V, type MarketplaceEnqueuePort as W, type MarketplaceIntegrationView as X, type MarketplaceLogger as Y, type MarketplaceMenuLinkView as Z, type MarketplaceOrderPort as _, type AcceptanceStatus as a, type MarketplaceOrderSummary as a0, type MarketplacePorts as a1, type MarketplaceRefusal as a2, type MarketplaceSecretsPort as a3, type MenuLinkRowInput as a4, OUTBOUND_GIVE_UP_MS as a5, OUTBOUND_STALE_MS as a6, type OutboundAction as a7, type OutboundAttempt as a8, type OutboundJobPayload as a9, type OutboundOutcome as aa, OutboundRetryError as ab, type OutboundSweepResult as ac, type PendingAcceptance as ad, type PendingInboxEvent as ae, type ResolvedOrderLine as af, type SaveMarketplaceIntegrationInput as ag, catalogueDedupeKey as ah, createMarketplaceEngine as ai, outboundDedupeKey as aj, type BulkProblemCode as b, type BulkResult as c, type CancellationStatus as d, type CatalogueAction as e, type CatalogueActionResult as f, type CatalogueDocumentResult as g, type CatalogueFailedAction as h, type CatalogueFailureCode as i, type CatalogueJobPayload as j, type CatalogueOutcome as k, type CataloguePublicationView as l, type CataloguePublishInput as m, type CatalogueRefusalCode as n, CatalogueRetryError as o, type CatalogueStatus as p, type CatalogueTarget as q, type DecidedRow as r, type DecisionInput as s, type DecisionProblem as t, type DecisionProblemCode as u, type DecisionResult as v, type DeliveryOutcome as w, type FetchOrderOutcome as x, FetchOrderRetryError as y, type IngestSettings as z };
|
package/dist/hono/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono, Context } from 'hono';
|
|
2
2
|
import { ApiMarketplace, MarketplaceApiConfig, MarketplaceActor } from '../server/index.js';
|
|
3
|
-
import '../engine-
|
|
4
|
-
import '../adapter-
|
|
3
|
+
import '../engine-CZsP8KWd.js';
|
|
4
|
+
import '../adapter-0l_EmuJA.js';
|
|
5
5
|
import '@12-apps/wiring';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
package/dist/hono/index.js
CHANGED
package/dist/ifood/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NormalizedEvent, M as MarketplaceAdapter } from '../adapter-
|
|
1
|
+
import { N as NormalizedEvent, c as PushCatalogue, d as CatalogueItemOut, M as MarketplaceAdapter } from '../adapter-0l_EmuJA.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The words the iFood adapter needs from its host, and nothing else.
|
|
@@ -42,6 +42,14 @@ declare function normalizeIfoodEvent(payload: unknown, options: {
|
|
|
42
42
|
missingStreetNumber: string;
|
|
43
43
|
}): NormalizedEvent | null;
|
|
44
44
|
|
|
45
|
+
/** The item's and its product's ids, stable per publication. */
|
|
46
|
+
declare const ifoodItemId: (ref: string) => string;
|
|
47
|
+
declare const ifoodProductId: (ref: string) => string;
|
|
48
|
+
/** The `PUT /items` body for one simple item with no add-ons. */
|
|
49
|
+
declare function ifoodItemBody(item: CatalogueItemOut, category: string, image: string | null): unknown;
|
|
50
|
+
/** iFood's catalogue capability. */
|
|
51
|
+
declare const IFOOD_CATALOGUE: PushCatalogue;
|
|
52
|
+
|
|
45
53
|
/**
|
|
46
54
|
* `@12-apps/marketplace/ifood` — iFood, as one adapter on the engine.
|
|
47
55
|
*
|
|
@@ -68,4 +76,4 @@ interface IfoodAdapterConfig {
|
|
|
68
76
|
/** Build the iFood adapter. Its reasons are static: a dialog never waits on iFood. */
|
|
69
77
|
declare function createIfoodAdapter(config: IfoodAdapterConfig): MarketplaceAdapter;
|
|
70
78
|
|
|
71
|
-
export { IFOOD_CANCELLATION_ANSWER_WINDOW_MS, IFOOD_PROVIDER, IFOOD_REASON_CODES, type IfoodAdapterConfig, type IfoodAdapterCopy, type IfoodReasonCode, createIfoodAdapter, normalizeIfoodEvent, verifyIfoodSignature };
|
|
79
|
+
export { IFOOD_CANCELLATION_ANSWER_WINDOW_MS, IFOOD_CATALOGUE, IFOOD_PROVIDER, IFOOD_REASON_CODES, type IfoodAdapterConfig, type IfoodAdapterCopy, type IfoodReasonCode, createIfoodAdapter, ifoodItemBody, ifoodItemId, ifoodProductId, normalizeIfoodEvent, verifyIfoodSignature };
|