@nuanu-ai/agentify-contracts 0.6.0 → 0.7.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/dist/api.d.ts +57 -215
- package/dist/api.js +74 -30
- package/dist/card.d.ts +124 -72
- package/dist/card.js +147 -52
- package/dist/index.d.ts +45 -184
- package/dist/index.js +12 -9
- package/dist/merchant.d.ts +16 -14
- package/dist/merchant.js +55 -27
- package/dist/primitives.d.ts +13 -0
- package/dist/primitives.js +14 -0
- package/dist/results.d.ts +5 -4
- package/dist/results.js +6 -5
- package/package.json +1 -1
package/dist/card.js
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
* more shape to keep in step for no gain to anybody.
|
|
26
26
|
*/
|
|
27
27
|
import { z } from "zod";
|
|
28
|
-
import { ParamSpecSchema, paramSpecToValidator } from "./param-spec.js";
|
|
28
|
+
import { FieldSpecSchema, ParamNameSchema, ParamSpecSchema, paramSpecToValidator, } from "./param-spec.js";
|
|
29
29
|
import { notPlainTextIn } from "./plain-text.js";
|
|
30
|
-
import { IdentifierSchema, MoneySchema, TimestampSchema } from "./primitives.js";
|
|
30
|
+
import { IdentifierSchema, MoneySchema, OpenWordSchema, TimestampSchema } from "./primitives.js";
|
|
31
31
|
import { SellingStateSchema } from "./selling.js";
|
|
32
32
|
/**
|
|
33
33
|
* When the product reaches the agent, and therefore when the money moves.
|
|
@@ -118,8 +118,86 @@ const listedText = (what) => z
|
|
|
118
118
|
* holds it is the merchants table, so this schema is the rule alone, applied
|
|
119
119
|
* wherever a merchant's listing name is written down.
|
|
120
120
|
*/
|
|
121
|
-
export const ServiceNameSchema = listedText("service name")
|
|
122
|
-
|
|
121
|
+
export const ServiceNameSchema = listedText("service name")
|
|
122
|
+
.superRefine((name, ctx) => {
|
|
123
|
+
// Every agent reads the name on every card and order of the merchant's
|
|
124
|
+
// (ADR-0034), so the door holds it to the card's own plain-text rule
|
|
125
|
+
// (ADR-0017): markup and character references are refused and named,
|
|
126
|
+
// not cleaned into words the merchant never wrote.
|
|
127
|
+
for (const phrase of notPlainTextIn(name, "one line")) {
|
|
128
|
+
ctx.addIssue({
|
|
129
|
+
code: "custom",
|
|
130
|
+
message: `this service name carries ${phrase}, and a service name is plain text, which an agent reads exactly as it is written`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
.meta({
|
|
135
|
+
description: "The name a seller is listed under in a discovery catalog and shown to every agent beside their products. At most 32 characters of printable ASCII, because that is what the catalog carries; a name outside that is refused here rather than truncated there, where nobody would be told. It is plain text: HTML markup and character references such as & are refused, and an ampersand written as text passes.",
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* The name as it is stored and read back: every rule the door holds it to
|
|
139
|
+
* except that it is plain text.
|
|
140
|
+
*
|
|
141
|
+
* That rule belongs to the door and not to the reader, for the reason the
|
|
142
|
+
* card's own words give (ADR-0017): a name stored before the rule may carry
|
|
143
|
+
* markup, every answer is held to its contract on the way out, and one old row
|
|
144
|
+
* would fail every card and order of its merchant's instead of being put right
|
|
145
|
+
* the next time the merchant sets their name.
|
|
146
|
+
*/
|
|
147
|
+
const StoredServiceNameSchema = listedText("service name");
|
|
148
|
+
/** What a seller's site is held to, said once for the refusal and the description. */
|
|
149
|
+
const SITE_FORM = "a seller's site is https:// and the domain name of their shop, with nothing after it — https://shop.example: in lower case, a domain name rather than an IP address or a single word, with no path, query, fragment, port, credentials or trailing slash";
|
|
150
|
+
/**
|
|
151
|
+
* The address of a seller's own shop on the web, where an agent takes what an
|
|
152
|
+
* order cannot answer (ADR-0034).
|
|
153
|
+
*
|
|
154
|
+
* Only an https origin, because anything after the host — a path, a query, a
|
|
155
|
+
* fragment — would be text of the merchant's own reaching every agent that
|
|
156
|
+
* reads the card, which is the free text the decision refuses. The host is the
|
|
157
|
+
* one part the merchant writes, so it is held to a domain name too: labels of
|
|
158
|
+
* letters, digits and hyphens, at most 253 characters, ending in a zone of
|
|
159
|
+
* letters or a punycode one. Anything a URL parser keeps as written would
|
|
160
|
+
* otherwise pass — a sentence of instructions, a quote, a host of any length —
|
|
161
|
+
* and so would a single word or an IP address, which point other people's
|
|
162
|
+
* agents into somebody's own network. What the pattern cannot do is tell a
|
|
163
|
+
* public name from a private one: a name in a zone kept for local networks,
|
|
164
|
+
* or a public one whose address leads into one, passes, and so does a
|
|
165
|
+
* hyphenated sentence of up to 253 characters that is a valid name. That is
|
|
166
|
+
* why an agent is told, beside every site, that nobody checked it.
|
|
167
|
+
*
|
|
168
|
+
* The pattern says all that in a form the JSON Schema export keeps, and it
|
|
169
|
+
* stops the check where it fails, so an address copied with a slash at the end
|
|
170
|
+
* is told once. Asking the URL parser for the origin catches what the pattern
|
|
171
|
+
* leaves, such as a punycode label the parser would write differently.
|
|
172
|
+
*/
|
|
173
|
+
export const SellerSiteSchema = z
|
|
174
|
+
.string()
|
|
175
|
+
.regex(/^https:\/\/(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{1,59})$/, { message: SITE_FORM, abort: true })
|
|
176
|
+
.refine((site) => {
|
|
177
|
+
try {
|
|
178
|
+
return new URL(site).origin === site;
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
}, SITE_FORM)
|
|
184
|
+
.meta({ description: `The https origin of a seller's own shop: ${SITE_FORM}.` });
|
|
185
|
+
/**
|
|
186
|
+
* Who sells, as an agent reads it beside a product and on an order: the name
|
|
187
|
+
* the merchant sells under and the site of their shop (ADR-0034).
|
|
188
|
+
*
|
|
189
|
+
* Both are the merchant's own word and nothing here checked either, which the
|
|
190
|
+
* description says to the reader who acts on it — a name and a site can be
|
|
191
|
+
* anybody's. Null is "none given": a merchant who gave no site has none here,
|
|
192
|
+
* and a name is missing only from an order whose merchant has since lost it.
|
|
193
|
+
*/
|
|
194
|
+
export const SellerSchema = z
|
|
195
|
+
.strictObject({
|
|
196
|
+
name: StoredServiceNameSchema.nullable(),
|
|
197
|
+
site: SellerSiteSchema.nullable(),
|
|
198
|
+
})
|
|
199
|
+
.meta({
|
|
200
|
+
description: "Who sells: the name the merchant sells under and the https address of their shop's own site, both as the merchant gave them. Agentify did not check either, so a name and a site can be anybody's. The site is where to take what an order cannot answer — a parcel that did not arrive, a return, the shop's terms. Either is null where the merchant has given none.",
|
|
123
201
|
});
|
|
124
202
|
/**
|
|
125
203
|
* The words a merchant puts on one product so an agent searching a catalog can
|
|
@@ -220,19 +298,31 @@ const DescriptionSchema = z
|
|
|
220
298
|
* JSON Schema, so the same constraint goes into the metadata as
|
|
221
299
|
* `minProperties`, where a generator can still see it.
|
|
222
300
|
*
|
|
223
|
-
* One
|
|
301
|
+
* One rule, held by the published card and by the projection below, because
|
|
224
302
|
* the promise is the same one: what the agent reads before paying is what the
|
|
225
303
|
* merchant is held to afterwards. Two copies of a refinement would be two
|
|
226
|
-
* promises, and the export would carry whichever was edited last.
|
|
304
|
+
* promises, and the export would carry whichever was edited last. The two
|
|
305
|
+
* declarations it is put on differ only in what else a field may carry: the
|
|
306
|
+
* merchant's is closed, and the agent's takes what is added later
|
|
307
|
+
* (ADR-0006 §5).
|
|
227
308
|
*/
|
|
228
|
-
const
|
|
309
|
+
const declaringAResult = (declaration) => declaration
|
|
310
|
+
.refine(
|
|
229
311
|
// Not merely non-empty: at least one field that actually arrives. A
|
|
230
312
|
// declaration of one field marked `required: false` satisfies "at least
|
|
231
313
|
// one" and promises the agent exactly as much as an empty one does.
|
|
232
|
-
(spec) => Object.values(spec).some((field) => field.required !== false), "a card declares at least one field of what the agent receives, and at least one of them arrives every time")
|
|
314
|
+
(spec) => Object.values(spec).some((field) => field.required !== false), "a card declares at least one field of what the agent receives, and at least one of them arrives every time")
|
|
315
|
+
.meta({
|
|
233
316
|
description: "What the agent receives on delivery. At least one field, and at least one of the fields is not marked required: false — a result that might be entirely absent promises nothing.",
|
|
234
317
|
minProperties: 1,
|
|
235
318
|
});
|
|
319
|
+
const DeclaredResultSchema = declaringAResult(ParamSpecSchema);
|
|
320
|
+
/**
|
|
321
|
+
* A declaration as an agent reads it: the merchant's fields, each open to what
|
|
322
|
+
* is added to a field later (ADR-0006 §5), so a new attribute of one field
|
|
323
|
+
* leaves the card readable to an agent built before it.
|
|
324
|
+
*/
|
|
325
|
+
const ReadDeclarationSchema = z.record(ParamNameSchema, FieldSpecSchema.loose());
|
|
236
326
|
/**
|
|
237
327
|
* The short forms a card may be written in, and the one form they all become.
|
|
238
328
|
*
|
|
@@ -571,11 +661,16 @@ export const deliveryCheckFor = (card) => paramSpecToValidator(card.result, "del
|
|
|
571
661
|
* gateway's, and this document does not claim to know it.
|
|
572
662
|
*
|
|
573
663
|
* Both deadlines stay, because they are the merchant's promise to the agent
|
|
574
|
-
* about how long it may wait, and the agent is told them before it pays.
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
*
|
|
664
|
+
* about how long it may wait, and the agent is told them before it pays. The
|
|
665
|
+
* projection writes each only on a mode that has it, and the document says so
|
|
666
|
+
* in words rather than as structure: it takes fields added later (ADR-0006
|
|
667
|
+
* §5), so a field an agent does not expect is one it ignores, not one it can
|
|
668
|
+
* refuse.
|
|
669
|
+
*
|
|
670
|
+
* The mode is a word whose known values are listed beside it, for the same
|
|
671
|
+
* reason. The storefront has no version, so a mode added later reaches agents
|
|
672
|
+
* that still hold this contract, and to them it has to be a card to pass over
|
|
673
|
+
* rather than a catalog they cannot read.
|
|
579
674
|
*
|
|
580
675
|
* `as_of` is added: the moment the price shown here was published. A price
|
|
581
676
|
* with no moment behind it cannot be judged stale, and this is the only
|
|
@@ -588,27 +683,24 @@ export const deliveryCheckFor = (card) => paramSpecToValidator(card.result, "del
|
|
|
588
683
|
* page — so carrying them here would put a foreign catalog's constraint in
|
|
589
684
|
* front of a reader who has no use for it.
|
|
590
685
|
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
* is deliberately not this. That name exists to satisfy one channel's rules,
|
|
596
|
-
* a merchant may have none, and standing it in for a public identity would
|
|
597
|
-
* answer a question — who "we" are to the buyer, and who the merchant is —
|
|
598
|
-
* that is still open.
|
|
686
|
+
* Who sells is here as the merchant gave it, a name and the site of their
|
|
687
|
+
* shop (ADR-0034), and as nothing more: no profile, no contact of ours, and no
|
|
688
|
+
* claim that either was checked. Who "we" are to the buyer is a question this
|
|
689
|
+
* document still does not answer.
|
|
599
690
|
*/
|
|
600
|
-
const
|
|
691
|
+
export const PublicCardSchema = z
|
|
692
|
+
.looseObject({
|
|
601
693
|
/** Our catalog identifier, the one a purchase, a receipt and a status use. */
|
|
602
694
|
id: IdentifierSchema,
|
|
603
695
|
title: TitleSchema,
|
|
604
696
|
description: DescriptionSchema,
|
|
605
697
|
/** The price in the catalog: what an agent compares when it is choosing. */
|
|
606
|
-
price: MoneySchema,
|
|
698
|
+
price: MoneySchema.loose(),
|
|
607
699
|
/** When the price above was published. */
|
|
608
700
|
as_of: TimestampSchema,
|
|
609
701
|
/** What the agent has to supply to buy. Absent when the purchase needs no input. */
|
|
610
|
-
params:
|
|
611
|
-
result:
|
|
702
|
+
params: ReadDeclarationSchema.optional(),
|
|
703
|
+
result: declaringAResult(ReadDeclarationSchema),
|
|
612
704
|
/**
|
|
613
705
|
* Whether the merchant is asked for this product's price and availability at
|
|
614
706
|
* the moment of purchase, so the sale may go through at a price other than
|
|
@@ -619,30 +711,31 @@ const PublicCardFieldsSchema = z.strictObject({
|
|
|
619
711
|
* about to move, read as true it distrusts a price that never moves.
|
|
620
712
|
*/
|
|
621
713
|
price_checked_at_purchase: z.boolean(),
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
714
|
+
/**
|
|
715
|
+
* Who sells this product, in the merchant's own words and unchecked. It is
|
|
716
|
+
* read with the catalog rather than copied onto the card at publishing, so
|
|
717
|
+
* a merchant who changes their name or gives a site is found by it on every
|
|
718
|
+
* card they already sell.
|
|
719
|
+
*/
|
|
720
|
+
seller: SellerSchema.loose(),
|
|
721
|
+
/**
|
|
722
|
+
* How the product is sold: "sync", "async" or "confirm" today, and a word
|
|
723
|
+
* added later reaches this same document. A reader keeps a default arm,
|
|
724
|
+
* and a card whose mode it does not know is one to pass over.
|
|
725
|
+
*
|
|
726
|
+
* Two branches rather than a bare string, so the known values cross into
|
|
727
|
+
* the exported document as a list a client can switch over, beside the
|
|
728
|
+
* branch that reads any other word (`OpenWordSchema`). A declared field's
|
|
729
|
+
* type, inside params and result, stays a closed list: a card with a type
|
|
730
|
+
* a reader does not know is one it cannot fill in, and it is passed over
|
|
731
|
+
* like a card of an unknown mode.
|
|
732
|
+
*/
|
|
733
|
+
fulfillment: z.union([FulfillmentSchema, OpenWordSchema]),
|
|
734
|
+
/** On "async" and "confirm": how long the merchant has to deliver, in seconds. */
|
|
735
|
+
fulfill_deadline_seconds: z.int().positive().optional(),
|
|
736
|
+
/** On "confirm": how long the merchant has to say yes, in seconds. */
|
|
737
|
+
confirm_deadline_seconds: z.int().positive().optional(),
|
|
738
|
+
})
|
|
646
739
|
.meta({
|
|
647
740
|
// Everything below is written in prose above as well, and it has to be
|
|
648
741
|
// written twice: the reader this matters most to is the one holding the
|
|
@@ -650,7 +743,7 @@ export const PublicCardSchema = z
|
|
|
650
743
|
// money on what this card claims. `as_of` in particular means something
|
|
651
744
|
// narrower here than the same name means elsewhere in this contract, and a
|
|
652
745
|
// reader who assumed otherwise would trust a stale number.
|
|
653
|
-
description: "A product an agent can buy, projected from the card its merchant published. as_of is when the price shown here was published, and nothing more: on a card whose price is checked at purchase it says nothing about how fresh that check will be — elsewhere in this contract the same name means the moment a live answer was true. price_checked_at_purchase says the merchant is asked for a price at the moment of purchase, not that they answer; what happens when they are silent depends on the mode and belongs to the gateway. The number above is what an agent compares when choosing and may not be what the sale goes through at. Two rules hold beyond the shape: a synchronous product names no delivery deadline, because it is delivered inside a response budget that is the same for every product on the platform, and only a product whose merchant is asked to confirm names a confirmation deadline.
|
|
746
|
+
description: "A product an agent can buy, projected from the card its merchant published. as_of is when the price shown here was published, and nothing more: on a card whose price is checked at purchase it says nothing about how fresh that check will be — elsewhere in this contract the same name means the moment a live answer was true. price_checked_at_purchase says the merchant is asked for a price at the moment of purchase, not that they answer; what happens when they are silent depends on the mode and belongs to the gateway. The number above is what an agent compares when choosing and may not be what the sale goes through at. Two rules hold beyond the shape: a synchronous product names no delivery deadline, because it is delivered inside a response budget that is the same for every product on the platform, and only a product whose merchant is asked to confirm names a confirmation deadline. seller is who sells, as the merchant gave it: Agentify did not check the name or the site. fulfillment is a word whose known values are listed beside it, and more may be added: a reader keeps a default arm, and a card whose mode it does not know is one to pass over, not a reason to stop reading the catalog. This document and every part inside it may also gain fields; a reader ignores the ones it does not know. The type of a declared field in params and result is a closed list, and a card with a type a reader does not know is one to pass over too.",
|
|
654
747
|
});
|
|
655
748
|
/**
|
|
656
749
|
* The card as an agent reads it, built from the card the merchant published.
|
|
@@ -662,12 +755,14 @@ export const PublicCardSchema = z
|
|
|
662
755
|
* every agent by default, and the first anybody heard of it would be a
|
|
663
756
|
* merchant's pricing address in a public catalog.
|
|
664
757
|
*
|
|
665
|
-
* The
|
|
666
|
-
* issued when it was published,
|
|
758
|
+
* The three things the card cannot know are passed in: the catalog identifier
|
|
759
|
+
* we issued when it was published, the moment its price was published, and
|
|
760
|
+
* who sells it as their merchant stands now.
|
|
667
761
|
*/
|
|
668
762
|
export const publicCardOf = (card, issued) => {
|
|
669
763
|
const common = {
|
|
670
764
|
id: issued.id,
|
|
765
|
+
seller: issued.seller,
|
|
671
766
|
title: card.title,
|
|
672
767
|
description: card.description,
|
|
673
768
|
price: card.price,
|
package/dist/index.d.ts
CHANGED
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { z } from "zod";
|
|
24
24
|
export type { AgentOrderStatus, AuthMode, CatalogPage, ErrorCode, ErrorEnvelope, HttpMethod, MerchantCardList, OrderAcceptResponse, OrderCallResponse, OrderList, OrderListQuery, OrderWithStatus, PurchaseRequest, QuoteAnswerAck, ReceiptList, RouteDefinition, RouteName, RouteResponse, WorkerPollRequest, WorkerPollResponse, } from "./api.js";
|
|
25
|
-
export { AgentOrderStatusSchema, API_ROUTES, AUTH_MODES, CatalogPageSchema, ERROR_CODES, ErrorEnvelopeSchema, expandPath, HTTP_METHODS, MERCHANT_KEY_HEADER, MerchantCardListSchema, merchantKeyFrom, merchantKeyHeaderValue, mountableRoutes, OrderAcceptResponseSchema, OrderCallResponseSchema, OrderListQuerySchema, OrderListSchema, OrderWithStatusSchema, PurchaseRequestSchema, pathParamsOf, QuoteAnswerAckSchema, ReceiptListSchema, WorkerPollRequestSchema, WorkerPollResponseSchema, } from "./api.js";
|
|
26
|
-
export type { BazaarDeclaration, Card, CardInput, Fulfillment, MerchantCard, PriceCheck, PublicCard, } from "./card.js";
|
|
27
|
-
export { bazaarDeclarationOf, CardSchema, deliveryCheckFor, FulfillmentSchema, MerchantCardSchema, PriceCheckSchema, PublicCardSchema, publicCardOf, purchaseCheckFor, ServiceNameSchema, TagsSchema, } from "./card.js";
|
|
25
|
+
export { AgentOrderStatusSchema, API_ROUTES, AUTH_MODES, CatalogPageSchema, cardsOf, ERROR_CODES, ErrorEnvelopeSchema, expandPath, HTTP_METHODS, MERCHANT_KEY_HEADER, MerchantCardListSchema, merchantKeyFrom, merchantKeyHeaderValue, mountableRoutes, OrderAcceptResponseSchema, OrderCallResponseSchema, OrderListQuerySchema, OrderListSchema, OrderWithStatusSchema, PurchaseRequestSchema, pathParamsOf, QuoteAnswerAckSchema, ReceiptListSchema, WorkerPollRequestSchema, WorkerPollResponseSchema, } from "./api.js";
|
|
26
|
+
export type { BazaarDeclaration, Card, CardInput, Fulfillment, MerchantCard, PriceCheck, ProjectedCard, PublicCard, Seller, } from "./card.js";
|
|
27
|
+
export { bazaarDeclarationOf, CardSchema, deliveryCheckFor, FulfillmentSchema, MerchantCardSchema, PriceCheckSchema, PublicCardSchema, publicCardOf, purchaseCheckFor, SellerSchema, SellerSiteSchema, ServiceNameSchema, TagsSchema, } from "./card.js";
|
|
28
28
|
export type { WorkerEnvelope, WorkerEnvelopeKind } from "./envelope.js";
|
|
29
29
|
export { WORKER_ENVELOPE_KINDS, WORKER_ENVELOPE_PAYLOADS, WorkerEnvelopeSchema, } from "./envelope.js";
|
|
30
30
|
export type { OrderEvent, RefundDueReason } from "./events.js";
|
|
@@ -33,8 +33,8 @@ export type { EvmAddress } from "./evm-address.js";
|
|
|
33
33
|
export { checksummedAddressOf, EvmAddressSchema } from "./evm-address.js";
|
|
34
34
|
export type { Acceptance, Delivery, HandlerAnswer, Refusal, RefusalCode } from "./handler.js";
|
|
35
35
|
export { AcceptanceSchema, DeliverySchema, HandlerAnswerSchema, RECOMMENDED_REFUSAL_CODES, RefusalCodeSchema, RefusalSchema, } from "./handler.js";
|
|
36
|
-
export type {
|
|
37
|
-
export {
|
|
36
|
+
export type { DashboardKey, DisabledKey, ForgottenDashboardKey, IssuedKey, IssueKeyRequest, MerchantKey, MerchantKeyList, PayoutWallet, PayoutWalletRequest, PendingPayoutWallet, RegisteredMerchant, RegistrationRequest, SellerName, SellerNameRequest, } from "./merchant.js";
|
|
37
|
+
export { DashboardKeySchema, DisabledKeySchema, ForgottenDashboardKeySchema, IssuedKeySchema, IssueKeyRequestSchema, MerchantKeyListSchema, MerchantKeySchema, PayoutWalletRequestSchema, PayoutWalletSchema, PendingPayoutWalletSchema, RegisteredMerchantSchema, RegistrationRequestSchema, SellerNameRequestSchema, SellerNameSchema, } from "./merchant.js";
|
|
38
38
|
export type { Order } from "./order.js";
|
|
39
39
|
export { OrderSchema } from "./order.js";
|
|
40
40
|
export type { OrderStatus } from "./order-status.js";
|
|
@@ -44,8 +44,8 @@ export { FieldSpecSchema, ParamNameSchema, ParamSpecSchema, ParamTypeSchema, PRO
|
|
|
44
44
|
export type { TextLines } from "./plain-text.js";
|
|
45
45
|
export { notPlainTextIn } from "./plain-text.js";
|
|
46
46
|
export { PAYABLE_CURRENCIES, PAYABLE_DECIMALS, priceProblemsOf } from "./price-rule.js";
|
|
47
|
-
export type { Amount, CurrencyCode, Identifier, Money, SalePrice, Timestamp, } from "./primitives.js";
|
|
48
|
-
export { AmountSchema, CurrencyCodeSchema, IdentifierSchema, MoneySchema, SalePriceSchema, TimestampSchema, } from "./primitives.js";
|
|
47
|
+
export type { Amount, CurrencyCode, Identifier, Money, OpenWord, SalePrice, Timestamp, } from "./primitives.js";
|
|
48
|
+
export { AmountSchema, CurrencyCodeSchema, IdentifierSchema, MoneySchema, OpenWordSchema, SalePriceSchema, TimestampSchema, } from "./primitives.js";
|
|
49
49
|
export type { QuotePurpose, QuoteRequest, QuoteResponse } from "./quote.js";
|
|
50
50
|
export { QuotePurposeSchema, QuoteRequestSchema, QuoteResponseSchema } from "./quote.js";
|
|
51
51
|
export type { Receipt, ReceiptOutcome } from "./receipt.js";
|
|
@@ -80,7 +80,7 @@ export declare const schemas: Readonly<{
|
|
|
80
80
|
agent_order_status: z.ZodObject<{
|
|
81
81
|
order_id: z.ZodString;
|
|
82
82
|
status_url: z.ZodURL;
|
|
83
|
-
status: z.ZodEnum<{
|
|
83
|
+
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
84
84
|
delivered: "delivered";
|
|
85
85
|
in_progress: "in_progress";
|
|
86
86
|
rejected: "rejected";
|
|
@@ -91,24 +91,25 @@ export declare const schemas: Readonly<{
|
|
|
91
91
|
refund_due: "refund_due";
|
|
92
92
|
refunded: "refunded";
|
|
93
93
|
delivered_unpaid: "delivered_unpaid";
|
|
94
|
-
}>;
|
|
94
|
+
}>, z.ZodString]>;
|
|
95
95
|
price: z.ZodNullable<z.ZodObject<{
|
|
96
96
|
amount: z.ZodString;
|
|
97
97
|
currency: z.ZodString;
|
|
98
98
|
at: z.ZodISODateTime;
|
|
99
99
|
as_of: z.ZodISODateTime;
|
|
100
|
-
}, z.core.$
|
|
100
|
+
}, z.core.$loose>>;
|
|
101
101
|
delivered: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
102
102
|
test: z.ZodBoolean;
|
|
103
103
|
refusal: z.ZodOptional<z.ZodObject<{
|
|
104
104
|
code: z.ZodString;
|
|
105
105
|
message: z.ZodString;
|
|
106
|
-
}, z.core.$
|
|
107
|
-
|
|
106
|
+
}, z.core.$loose>>;
|
|
107
|
+
seller: z.ZodObject<{
|
|
108
|
+
name: z.ZodNullable<z.ZodString>;
|
|
109
|
+
site: z.ZodNullable<z.ZodString>;
|
|
110
|
+
}, z.core.$loose>;
|
|
111
|
+
}, z.core.$loose>;
|
|
108
112
|
amount: z.ZodString;
|
|
109
|
-
cabinet_key: z.ZodObject<{
|
|
110
|
-
secret: z.ZodString;
|
|
111
|
-
}, z.core.$strict>;
|
|
112
113
|
call_error: z.ZodObject<{
|
|
113
114
|
code: z.ZodString;
|
|
114
115
|
message: z.ZodString;
|
|
@@ -160,105 +161,12 @@ export declare const schemas: Readonly<{
|
|
|
160
161
|
fulfill_deadline_seconds: z.ZodOptional<z.ZodInt>;
|
|
161
162
|
}, z.core.$strict>;
|
|
162
163
|
catalog_page: z.ZodObject<{
|
|
163
|
-
items: z.ZodArray<z.
|
|
164
|
-
|
|
165
|
-
title: z.ZodString;
|
|
166
|
-
description: z.ZodString;
|
|
167
|
-
price: z.ZodObject<{
|
|
168
|
-
amount: z.ZodString;
|
|
169
|
-
currency: z.ZodString;
|
|
170
|
-
}, z.core.$strict>;
|
|
171
|
-
as_of: z.ZodISODateTime;
|
|
172
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
173
|
-
type: z.ZodEnum<{
|
|
174
|
-
string: "string";
|
|
175
|
-
number: "number";
|
|
176
|
-
boolean: "boolean";
|
|
177
|
-
integer: "integer";
|
|
178
|
-
}>;
|
|
179
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
-
title: z.ZodOptional<z.ZodString>;
|
|
181
|
-
}, z.core.$strict>>>;
|
|
182
|
-
result: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
183
|
-
type: z.ZodEnum<{
|
|
184
|
-
string: "string";
|
|
185
|
-
number: "number";
|
|
186
|
-
boolean: "boolean";
|
|
187
|
-
integer: "integer";
|
|
188
|
-
}>;
|
|
189
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
-
title: z.ZodOptional<z.ZodString>;
|
|
191
|
-
}, z.core.$strict>>;
|
|
192
|
-
price_checked_at_purchase: z.ZodBoolean;
|
|
193
|
-
fulfillment: z.ZodLiteral<"sync">;
|
|
194
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
195
|
-
id: z.ZodString;
|
|
196
|
-
title: z.ZodString;
|
|
197
|
-
description: z.ZodString;
|
|
198
|
-
price: z.ZodObject<{
|
|
199
|
-
amount: z.ZodString;
|
|
200
|
-
currency: z.ZodString;
|
|
201
|
-
}, z.core.$strict>;
|
|
202
|
-
as_of: z.ZodISODateTime;
|
|
203
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
204
|
-
type: z.ZodEnum<{
|
|
205
|
-
string: "string";
|
|
206
|
-
number: "number";
|
|
207
|
-
boolean: "boolean";
|
|
208
|
-
integer: "integer";
|
|
209
|
-
}>;
|
|
210
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
-
title: z.ZodOptional<z.ZodString>;
|
|
212
|
-
}, z.core.$strict>>>;
|
|
213
|
-
result: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
214
|
-
type: z.ZodEnum<{
|
|
215
|
-
string: "string";
|
|
216
|
-
number: "number";
|
|
217
|
-
boolean: "boolean";
|
|
218
|
-
integer: "integer";
|
|
219
|
-
}>;
|
|
220
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
-
title: z.ZodOptional<z.ZodString>;
|
|
222
|
-
}, z.core.$strict>>;
|
|
223
|
-
price_checked_at_purchase: z.ZodBoolean;
|
|
224
|
-
fulfillment: z.ZodLiteral<"async">;
|
|
225
|
-
fulfill_deadline_seconds: z.ZodOptional<z.ZodInt>;
|
|
226
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
227
|
-
id: z.ZodString;
|
|
228
|
-
title: z.ZodString;
|
|
229
|
-
description: z.ZodString;
|
|
230
|
-
price: z.ZodObject<{
|
|
231
|
-
amount: z.ZodString;
|
|
232
|
-
currency: z.ZodString;
|
|
233
|
-
}, z.core.$strict>;
|
|
234
|
-
as_of: z.ZodISODateTime;
|
|
235
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
236
|
-
type: z.ZodEnum<{
|
|
237
|
-
string: "string";
|
|
238
|
-
number: "number";
|
|
239
|
-
boolean: "boolean";
|
|
240
|
-
integer: "integer";
|
|
241
|
-
}>;
|
|
242
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
243
|
-
title: z.ZodOptional<z.ZodString>;
|
|
244
|
-
}, z.core.$strict>>>;
|
|
245
|
-
result: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
246
|
-
type: z.ZodEnum<{
|
|
247
|
-
string: "string";
|
|
248
|
-
number: "number";
|
|
249
|
-
boolean: "boolean";
|
|
250
|
-
integer: "integer";
|
|
251
|
-
}>;
|
|
252
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
-
title: z.ZodOptional<z.ZodString>;
|
|
254
|
-
}, z.core.$strict>>;
|
|
255
|
-
price_checked_at_purchase: z.ZodBoolean;
|
|
256
|
-
fulfillment: z.ZodLiteral<"confirm">;
|
|
257
|
-
confirm_deadline_seconds: z.ZodOptional<z.ZodInt>;
|
|
258
|
-
fulfill_deadline_seconds: z.ZodOptional<z.ZodInt>;
|
|
259
|
-
}, z.core.$strict>], "fulfillment">>;
|
|
260
|
-
}, z.core.$strict>;
|
|
164
|
+
items: z.ZodArray<z.ZodUnknown>;
|
|
165
|
+
}, z.core.$loose>;
|
|
261
166
|
currency_code: z.ZodString;
|
|
167
|
+
dashboard_key: z.ZodObject<{
|
|
168
|
+
secret: z.ZodString;
|
|
169
|
+
}, z.core.$strict>;
|
|
262
170
|
delivery: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
263
171
|
disabled_key: z.ZodObject<{
|
|
264
172
|
key: z.ZodObject<{
|
|
@@ -287,7 +195,7 @@ export declare const schemas: Readonly<{
|
|
|
287
195
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
288
196
|
title: z.ZodOptional<z.ZodString>;
|
|
289
197
|
}, z.core.$strict>;
|
|
290
|
-
|
|
198
|
+
forgotten_dashboard_key: z.ZodObject<{
|
|
291
199
|
forgotten: z.ZodLiteral<true>;
|
|
292
200
|
}, z.core.$strict>;
|
|
293
201
|
fulfillment: z.ZodEnum<{
|
|
@@ -449,6 +357,7 @@ export declare const schemas: Readonly<{
|
|
|
449
357
|
amount: z.ZodString;
|
|
450
358
|
currency: z.ZodString;
|
|
451
359
|
}, z.core.$strict>;
|
|
360
|
+
open_word: z.ZodString;
|
|
452
361
|
order: z.ZodObject<{
|
|
453
362
|
id: z.ZodString;
|
|
454
363
|
merchant_item_id: z.ZodString;
|
|
@@ -639,45 +548,14 @@ export declare const schemas: Readonly<{
|
|
|
639
548
|
code: z.ZodString;
|
|
640
549
|
message: z.ZodString;
|
|
641
550
|
}, z.core.$strict>;
|
|
642
|
-
public_card: z.
|
|
643
|
-
id: z.ZodString;
|
|
644
|
-
title: z.ZodString;
|
|
645
|
-
description: z.ZodString;
|
|
646
|
-
price: z.ZodObject<{
|
|
647
|
-
amount: z.ZodString;
|
|
648
|
-
currency: z.ZodString;
|
|
649
|
-
}, z.core.$strict>;
|
|
650
|
-
as_of: z.ZodISODateTime;
|
|
651
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
652
|
-
type: z.ZodEnum<{
|
|
653
|
-
string: "string";
|
|
654
|
-
number: "number";
|
|
655
|
-
boolean: "boolean";
|
|
656
|
-
integer: "integer";
|
|
657
|
-
}>;
|
|
658
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
659
|
-
title: z.ZodOptional<z.ZodString>;
|
|
660
|
-
}, z.core.$strict>>>;
|
|
661
|
-
result: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
662
|
-
type: z.ZodEnum<{
|
|
663
|
-
string: "string";
|
|
664
|
-
number: "number";
|
|
665
|
-
boolean: "boolean";
|
|
666
|
-
integer: "integer";
|
|
667
|
-
}>;
|
|
668
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
669
|
-
title: z.ZodOptional<z.ZodString>;
|
|
670
|
-
}, z.core.$strict>>;
|
|
671
|
-
price_checked_at_purchase: z.ZodBoolean;
|
|
672
|
-
fulfillment: z.ZodLiteral<"sync">;
|
|
673
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
551
|
+
public_card: z.ZodObject<{
|
|
674
552
|
id: z.ZodString;
|
|
675
553
|
title: z.ZodString;
|
|
676
554
|
description: z.ZodString;
|
|
677
555
|
price: z.ZodObject<{
|
|
678
556
|
amount: z.ZodString;
|
|
679
557
|
currency: z.ZodString;
|
|
680
|
-
}, z.core.$
|
|
558
|
+
}, z.core.$loose>;
|
|
681
559
|
as_of: z.ZodISODateTime;
|
|
682
560
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
683
561
|
type: z.ZodEnum<{
|
|
@@ -688,7 +566,7 @@ export declare const schemas: Readonly<{
|
|
|
688
566
|
}>;
|
|
689
567
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
690
568
|
title: z.ZodOptional<z.ZodString>;
|
|
691
|
-
}, z.core.$
|
|
569
|
+
}, z.core.$loose>>>;
|
|
692
570
|
result: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
693
571
|
type: z.ZodEnum<{
|
|
694
572
|
string: "string";
|
|
@@ -698,44 +576,20 @@ export declare const schemas: Readonly<{
|
|
|
698
576
|
}>;
|
|
699
577
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
700
578
|
title: z.ZodOptional<z.ZodString>;
|
|
701
|
-
}, z.core.$
|
|
579
|
+
}, z.core.$loose>>;
|
|
702
580
|
price_checked_at_purchase: z.ZodBoolean;
|
|
703
|
-
|
|
581
|
+
seller: z.ZodObject<{
|
|
582
|
+
name: z.ZodNullable<z.ZodString>;
|
|
583
|
+
site: z.ZodNullable<z.ZodString>;
|
|
584
|
+
}, z.core.$loose>;
|
|
585
|
+
fulfillment: z.ZodUnion<readonly [z.ZodEnum<{
|
|
586
|
+
sync: "sync";
|
|
587
|
+
async: "async";
|
|
588
|
+
confirm: "confirm";
|
|
589
|
+
}>, z.ZodString]>;
|
|
704
590
|
fulfill_deadline_seconds: z.ZodOptional<z.ZodInt>;
|
|
705
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
706
|
-
id: z.ZodString;
|
|
707
|
-
title: z.ZodString;
|
|
708
|
-
description: z.ZodString;
|
|
709
|
-
price: z.ZodObject<{
|
|
710
|
-
amount: z.ZodString;
|
|
711
|
-
currency: z.ZodString;
|
|
712
|
-
}, z.core.$strict>;
|
|
713
|
-
as_of: z.ZodISODateTime;
|
|
714
|
-
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
715
|
-
type: z.ZodEnum<{
|
|
716
|
-
string: "string";
|
|
717
|
-
number: "number";
|
|
718
|
-
boolean: "boolean";
|
|
719
|
-
integer: "integer";
|
|
720
|
-
}>;
|
|
721
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
722
|
-
title: z.ZodOptional<z.ZodString>;
|
|
723
|
-
}, z.core.$strict>>>;
|
|
724
|
-
result: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
725
|
-
type: z.ZodEnum<{
|
|
726
|
-
string: "string";
|
|
727
|
-
number: "number";
|
|
728
|
-
boolean: "boolean";
|
|
729
|
-
integer: "integer";
|
|
730
|
-
}>;
|
|
731
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
732
|
-
title: z.ZodOptional<z.ZodString>;
|
|
733
|
-
}, z.core.$strict>>;
|
|
734
|
-
price_checked_at_purchase: z.ZodBoolean;
|
|
735
|
-
fulfillment: z.ZodLiteral<"confirm">;
|
|
736
591
|
confirm_deadline_seconds: z.ZodOptional<z.ZodInt>;
|
|
737
|
-
|
|
738
|
-
}, z.core.$strict>], "fulfillment">;
|
|
592
|
+
}, z.core.$loose>;
|
|
739
593
|
publish_result: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
740
594
|
ok: z.ZodLiteral<true>;
|
|
741
595
|
id: z.ZodString;
|
|
@@ -854,17 +708,24 @@ export declare const schemas: Readonly<{
|
|
|
854
708
|
at: z.ZodISODateTime;
|
|
855
709
|
as_of: z.ZodISODateTime;
|
|
856
710
|
}, z.core.$strict>;
|
|
711
|
+
seller: z.ZodObject<{
|
|
712
|
+
name: z.ZodNullable<z.ZodString>;
|
|
713
|
+
site: z.ZodNullable<z.ZodString>;
|
|
714
|
+
}, z.core.$strict>;
|
|
857
715
|
seller_name: z.ZodObject<{
|
|
858
716
|
seller_name: z.ZodNullable<z.ZodString>;
|
|
717
|
+
seller_site: z.ZodNullable<z.ZodString>;
|
|
859
718
|
}, z.core.$strict>;
|
|
860
719
|
seller_name_request: z.ZodObject<{
|
|
861
|
-
seller_name: z.ZodPipe<z.ZodString, z.ZodString
|
|
720
|
+
seller_name: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodString>>;
|
|
721
|
+
seller_site: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodString>>;
|
|
862
722
|
}, z.core.$strict>;
|
|
863
723
|
selling_state: z.ZodEnum<{
|
|
864
724
|
open: "open";
|
|
865
725
|
paused: "paused";
|
|
866
726
|
departed: "departed";
|
|
867
727
|
}>;
|
|
728
|
+
seller_site: z.ZodString;
|
|
868
729
|
service_name: z.ZodString;
|
|
869
730
|
tags: z.ZodArray<z.ZodString>;
|
|
870
731
|
timestamp: z.ZodISODateTime;
|