@reactionary/core 0.0.51 → 0.0.53
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/client/client-builder.js +1 -1
- package/client/client.js +1 -1
- package/decorators/reactionary.decorator.js +21 -2
- package/index.js +14 -14
- package/package.json +5 -4
- package/providers/analytics.provider.js +1 -1
- package/providers/base.provider.js +1 -1
- package/providers/cart.provider.js +1 -1
- package/providers/category.provider.js +1 -1
- package/providers/checkout.provider.js +1 -1
- package/providers/identity.provider.js +1 -1
- package/providers/index.js +13 -13
- package/providers/inventory.provider.js +1 -1
- package/providers/order.provider.js +1 -1
- package/providers/price.provider.js +1 -1
- package/providers/product.provider.js +1 -1
- package/providers/profile.provider.js +1 -1
- package/providers/search.provider.js +1 -1
- package/providers/store.provider.js +1 -1
- package/schemas/models/analytics.model.js +1 -1
- package/schemas/models/cart.model.js +3 -3
- package/schemas/models/category.model.js +2 -2
- package/schemas/models/checkout.model.js +6 -6
- package/schemas/models/cost.model.js +1 -1
- package/schemas/models/identity.model.js +2 -2
- package/schemas/models/index.js +19 -19
- package/schemas/models/inventory.model.js +2 -2
- package/schemas/models/order.model.js +6 -6
- package/schemas/models/payment.model.js +3 -3
- package/schemas/models/price.model.js +3 -3
- package/schemas/models/product.model.js +2 -2
- package/schemas/models/profile.model.js +2 -2
- package/schemas/models/search.model.js +2 -2
- package/schemas/models/shipping-method.model.js +4 -4
- package/schemas/models/store.model.js +2 -2
- package/schemas/mutations/analytics.mutation.js +2 -2
- package/schemas/mutations/cart.mutation.js +5 -5
- package/schemas/mutations/checkout.mutation.js +2 -2
- package/schemas/mutations/identity.mutation.js +1 -1
- package/schemas/mutations/index.js +10 -10
- package/schemas/mutations/inventory.mutation.js +1 -0
- package/schemas/mutations/price.mutation.js +1 -0
- package/schemas/mutations/product.mutation.js +1 -0
- package/schemas/mutations/profile.mutation.js +1 -1
- package/schemas/mutations/search.mutation.js +1 -0
- package/schemas/queries/analytics.query.js +1 -0
- package/schemas/queries/cart.query.js +2 -2
- package/schemas/queries/category.query.js +3 -3
- package/schemas/queries/checkout.query.js +2 -2
- package/schemas/queries/identity.query.js +1 -1
- package/schemas/queries/index.js +13 -13
- package/schemas/queries/inventory.query.js +2 -2
- package/schemas/queries/order.query.js +2 -2
- package/schemas/queries/price.query.js +2 -2
- package/schemas/queries/product.query.js +2 -2
- package/schemas/queries/profile.query.js +1 -1
- package/schemas/queries/search.query.js +2 -2
- package/schemas/queries/store.query.js +1 -1
- package/schemas/session.schema.js +3 -3
- package/src/cache/cache.interface.d.ts +1 -1
- package/src/cache/memory-cache.d.ts +2 -2
- package/src/cache/noop-cache.d.ts +1 -1
- package/src/cache/redis-cache.d.ts +1 -1
- package/src/client/client-builder.d.ts +2 -2
- package/src/client/client.d.ts +10 -10
- package/src/decorators/reactionary.decorator.d.ts +3 -1
- package/src/index.d.ts +14 -14
- package/src/initialization.d.ts +1 -1
- package/src/providers/analytics.provider.d.ts +2 -2
- package/src/providers/base.provider.d.ts +5 -5
- package/src/providers/cart.provider.d.ts +6 -6
- package/src/providers/category.provider.d.ts +4 -4
- package/src/providers/checkout.provider.d.ts +5 -5
- package/src/providers/identity.provider.d.ts +5 -5
- package/src/providers/index.d.ts +13 -13
- package/src/providers/inventory.provider.d.ts +4 -4
- package/src/providers/order.provider.d.ts +4 -4
- package/src/providers/price.provider.d.ts +5 -5
- package/src/providers/product.provider.d.ts +4 -4
- package/src/providers/profile.provider.d.ts +5 -5
- package/src/providers/search.provider.d.ts +4 -4
- package/src/providers/store.provider.d.ts +4 -4
- package/src/schemas/models/cost.model.d.ts +12 -12
- package/src/schemas/models/index.d.ts +19 -19
- package/src/schemas/models/profile.model.d.ts +20 -20
- package/src/schemas/models/shipping-method.model.d.ts +14 -14
- package/src/schemas/mutations/checkout.mutation.d.ts +25 -25
- package/src/schemas/mutations/index.d.ts +10 -10
- package/src/schemas/queries/category.query.d.ts +10 -10
- package/src/schemas/queries/index.d.ts +13 -13
package/client/client-builder.js
CHANGED
package/client/client.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
trace,
|
|
3
|
+
SpanKind
|
|
4
|
+
} from "@opentelemetry/api";
|
|
5
|
+
const TRACER_NAME = "@reactionary";
|
|
6
|
+
const TRACER_VERSION = "0.0.1";
|
|
7
|
+
let globalTracer = null;
|
|
8
|
+
function getTracer() {
|
|
9
|
+
if (!globalTracer) {
|
|
10
|
+
globalTracer = trace.getTracer(TRACER_NAME, TRACER_VERSION);
|
|
11
|
+
}
|
|
12
|
+
return globalTracer;
|
|
13
|
+
}
|
|
2
14
|
class ReactionaryDecoratorOptions {
|
|
3
15
|
constructor() {
|
|
4
16
|
/**
|
|
@@ -53,6 +65,12 @@ function Reactionary(options) {
|
|
|
53
65
|
});
|
|
54
66
|
}
|
|
55
67
|
span.end();
|
|
68
|
+
if (!result) {
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
if (result instanceof Array) {
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
56
74
|
return this.assert(result);
|
|
57
75
|
}
|
|
58
76
|
);
|
|
@@ -62,5 +80,6 @@ function Reactionary(options) {
|
|
|
62
80
|
}
|
|
63
81
|
export {
|
|
64
82
|
Reactionary,
|
|
65
|
-
ReactionaryDecoratorOptions
|
|
83
|
+
ReactionaryDecoratorOptions,
|
|
84
|
+
getTracer
|
|
66
85
|
};
|
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from "./cache/cache.interface";
|
|
2
|
-
export * from "./cache/redis-cache";
|
|
3
|
-
export * from "./cache/memory-cache";
|
|
4
|
-
export * from "./cache/noop-cache";
|
|
5
|
-
export * from "./client/client";
|
|
6
|
-
export * from "./client/client-builder";
|
|
7
|
-
export * from "./decorators/reactionary.decorator";
|
|
8
|
-
export * from "./providers/";
|
|
9
|
-
export * from "./schemas/capabilities.schema";
|
|
10
|
-
export * from "./schemas/session.schema";
|
|
11
|
-
export * from "./schemas/models/";
|
|
12
|
-
export * from "./schemas/mutations/";
|
|
13
|
-
export * from "./schemas/queries";
|
|
14
|
-
export * from "./initialization";
|
|
1
|
+
export * from "./cache/cache.interface.js";
|
|
2
|
+
export * from "./cache/redis-cache.js";
|
|
3
|
+
export * from "./cache/memory-cache.js";
|
|
4
|
+
export * from "./cache/noop-cache.js";
|
|
5
|
+
export * from "./client/client.js";
|
|
6
|
+
export * from "./client/client-builder.js";
|
|
7
|
+
export * from "./decorators/reactionary.decorator.js";
|
|
8
|
+
export * from "./providers/index.js";
|
|
9
|
+
export * from "./schemas/capabilities.schema.js";
|
|
10
|
+
export * from "./schemas/session.schema.js";
|
|
11
|
+
export * from "./schemas/models/index.js";
|
|
12
|
+
export * from "./schemas/mutations/index.js";
|
|
13
|
+
export * from "./schemas/queries/index.js";
|
|
14
|
+
export * from "./initialization.js";
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"zod": "4.1.9",
|
|
8
8
|
"@upstash/redis": "^1.34.9",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
}
|
|
9
|
+
"node-object-hash": "^3.1.1",
|
|
10
|
+
"@opentelemetry/api": "^1.9.0"
|
|
11
|
+
},
|
|
12
|
+
"type": "module"
|
|
12
13
|
}
|
package/providers/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from "./analytics.provider";
|
|
2
|
-
export * from "./base.provider";
|
|
3
|
-
export * from "./cart.provider";
|
|
4
|
-
export * from "./category.provider";
|
|
5
|
-
export * from "./checkout.provider";
|
|
6
|
-
export * from "./identity.provider";
|
|
7
|
-
export * from "./inventory.provider";
|
|
8
|
-
export * from "./price.provider";
|
|
9
|
-
export * from "./product.provider";
|
|
10
|
-
export * from "./profile.provider";
|
|
11
|
-
export * from "./search.provider";
|
|
12
|
-
export * from "./store.provider";
|
|
13
|
-
export * from "./order.provider";
|
|
1
|
+
export * from "./analytics.provider.js";
|
|
2
|
+
export * from "./base.provider.js";
|
|
3
|
+
export * from "./cart.provider.js";
|
|
4
|
+
export * from "./category.provider.js";
|
|
5
|
+
export * from "./checkout.provider.js";
|
|
6
|
+
export * from "./identity.provider.js";
|
|
7
|
+
export * from "./inventory.provider.js";
|
|
8
|
+
export * from "./price.provider.js";
|
|
9
|
+
export * from "./product.provider.js";
|
|
10
|
+
export * from "./profile.provider.js";
|
|
11
|
+
export * from "./search.provider.js";
|
|
12
|
+
export * from "./store.provider.js";
|
|
13
|
+
export * from "./order.provider.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { CartIdentifierSchema, CartItemIdentifierSchema, IdentityIdentifierSchema, ProductIdentifierSchema, SKUIdentifierSchema } from "../models/identifiers.model";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { CartIdentifierSchema, CartItemIdentifierSchema, IdentityIdentifierSchema, ProductIdentifierSchema, SKUIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
|
+
import { CostBreakDownSchema, ItemCostBreakdownSchema } from "./cost.model.js";
|
|
4
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
5
5
|
const CartItemSchema = z.looseObject({
|
|
6
6
|
identifier: CartItemIdentifierSchema.default(() => CartItemIdentifierSchema.parse({})),
|
|
7
7
|
product: ProductIdentifierSchema.default(() => ProductIdentifierSchema.parse({})),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseModelSchema, createPaginatedResponseSchema, ImageSchema } from "./base.model";
|
|
3
|
-
import { CategoryIdentifierSchema } from "./identifiers.model";
|
|
2
|
+
import { BaseModelSchema, createPaginatedResponseSchema, ImageSchema } from "./base.model.js";
|
|
3
|
+
import { CategoryIdentifierSchema } from "./identifiers.model.js";
|
|
4
4
|
const CategorySchema = BaseModelSchema.extend({
|
|
5
5
|
identifier: CategoryIdentifierSchema.default(() => CategoryIdentifierSchema.parse({})),
|
|
6
6
|
name: z.string().default(""),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseModelSchema } from "./base.model";
|
|
3
|
-
import { CartIdentifierSchema, CheckoutIdentifierSchema, CheckoutItemIdentifierSchema, OrderIdentifierSchema, SKUIdentifierSchema } from "./identifiers.model";
|
|
4
|
-
import { CostBreakDownSchema, ItemCostBreakdownSchema } from "./cost.model";
|
|
5
|
-
import { AddressSchema } from "./profile.model";
|
|
6
|
-
import { ShippingInstructionSchema } from "./shipping-method.model";
|
|
7
|
-
import { PaymentInstructionSchema } from "./payment.model";
|
|
2
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
3
|
+
import { CartIdentifierSchema, CheckoutIdentifierSchema, CheckoutItemIdentifierSchema, OrderIdentifierSchema, SKUIdentifierSchema } from "./identifiers.model.js";
|
|
4
|
+
import { CostBreakDownSchema, ItemCostBreakdownSchema } from "./cost.model.js";
|
|
5
|
+
import { AddressSchema } from "./profile.model.js";
|
|
6
|
+
import { ShippingInstructionSchema } from "./shipping-method.model.js";
|
|
7
|
+
import { PaymentInstructionSchema } from "./payment.model.js";
|
|
8
8
|
const CheckoutItemSchema = z.looseObject({
|
|
9
9
|
identifier: CheckoutItemIdentifierSchema.default(() => CheckoutItemIdentifierSchema.parse({})),
|
|
10
10
|
sku: SKUIdentifierSchema.default(() => SKUIdentifierSchema.parse({})),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { MonetaryAmountSchema } from "./price.model";
|
|
2
|
+
import { MonetaryAmountSchema } from "./price.model.js";
|
|
3
3
|
const CostBreakDownSchema = z.looseObject({
|
|
4
4
|
totalTax: MonetaryAmountSchema.default(() => MonetaryAmountSchema.parse({})).describe("The amount of tax paid on the cart. This may include VAT, GST, sales tax, etc."),
|
|
5
5
|
totalDiscount: MonetaryAmountSchema.default(() => MonetaryAmountSchema.parse({})).describe("The amount of discount applied to the cart."),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseModelSchema } from "./base.model";
|
|
3
|
-
import { IdentityIdentifierSchema } from "./identifiers.model";
|
|
2
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
3
|
+
import { IdentityIdentifierSchema } from "./identifiers.model.js";
|
|
4
4
|
const AnonymousIdentitySchema = BaseModelSchema.extend({
|
|
5
5
|
type: z.literal("Anonymous").default("Anonymous"),
|
|
6
6
|
token: z.string().optional(),
|
package/schemas/models/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export * from "./analytics.model";
|
|
2
|
-
export * from "./base.model";
|
|
3
|
-
export * from "./cart.model";
|
|
4
|
-
export * from "./category.model";
|
|
5
|
-
export * from "./currency.model";
|
|
6
|
-
export * from "./identifiers.model";
|
|
7
|
-
export * from "./identity.model";
|
|
8
|
-
export * from "./inventory.model";
|
|
9
|
-
export * from "./payment.model";
|
|
10
|
-
export * from "./price.model";
|
|
11
|
-
export * from "./product.model";
|
|
12
|
-
export * from "./profile.model";
|
|
13
|
-
export * from "./search.model";
|
|
14
|
-
export * from "./shipping-method.model";
|
|
15
|
-
export * from "./store.model";
|
|
16
|
-
export * from "./order.model";
|
|
17
|
-
export * from "./cost.model";
|
|
18
|
-
export * from "./checkout.model";
|
|
19
|
-
export * from "./payment.model";
|
|
1
|
+
export * from "./analytics.model.js";
|
|
2
|
+
export * from "./base.model.js";
|
|
3
|
+
export * from "./cart.model.js";
|
|
4
|
+
export * from "./category.model.js";
|
|
5
|
+
export * from "./currency.model.js";
|
|
6
|
+
export * from "./identifiers.model.js";
|
|
7
|
+
export * from "./identity.model.js";
|
|
8
|
+
export * from "./inventory.model.js";
|
|
9
|
+
export * from "./payment.model.js";
|
|
10
|
+
export * from "./price.model.js";
|
|
11
|
+
export * from "./product.model.js";
|
|
12
|
+
export * from "./profile.model.js";
|
|
13
|
+
export * from "./search.model.js";
|
|
14
|
+
export * from "./shipping-method.model.js";
|
|
15
|
+
export * from "./store.model.js";
|
|
16
|
+
export * from "./order.model.js";
|
|
17
|
+
export * from "./cost.model.js";
|
|
18
|
+
export * from "./checkout.model.js";
|
|
19
|
+
export * from "./payment.model.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseModelSchema } from "./base.model";
|
|
3
|
-
import { InventoryIdentifierSchema } from "./identifiers.model";
|
|
2
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
3
|
+
import { InventoryIdentifierSchema } from "./identifiers.model.js";
|
|
4
4
|
const InventorySchema = BaseModelSchema.extend({
|
|
5
5
|
identifier: InventoryIdentifierSchema.default(() => InventoryIdentifierSchema.parse({})),
|
|
6
6
|
sku: z.string().default(""),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { CartIdentifierSchema, CartItemIdentifierSchema, IdentityIdentifierSchema, SKUIdentifierSchema } from "../models/identifiers.model";
|
|
3
|
-
import { BaseModelSchema } from "./base.model";
|
|
4
|
-
import { AddressSchema } from "./profile.model";
|
|
5
|
-
import { ShippingMethodSchema } from "./shipping-method.model";
|
|
6
|
-
import { CostBreakDownSchema, ItemCostBreakdownSchema } from "./cost.model";
|
|
7
|
-
import { PaymentInstructionSchema } from "./payment.model";
|
|
2
|
+
import { CartIdentifierSchema, CartItemIdentifierSchema, IdentityIdentifierSchema, SKUIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
4
|
+
import { AddressSchema } from "./profile.model.js";
|
|
5
|
+
import { ShippingMethodSchema } from "./shipping-method.model.js";
|
|
6
|
+
import { CostBreakDownSchema, ItemCostBreakdownSchema } from "./cost.model.js";
|
|
7
|
+
import { PaymentInstructionSchema } from "./payment.model.js";
|
|
8
8
|
const OrderStatusSchema = z.enum(["AwaitingPayment", "ReleasedToFulfillment", "Shipped", "Cancelled"]).default("AwaitingPayment").describe("The current status of the order.");
|
|
9
9
|
const OrderInventoryStatusSchema = z.enum(["NotAllocated", "Allocated", "Backordered", "Preordered"]).default("Allocated").describe("The inventory release status of the order.");
|
|
10
10
|
const OrderItemSchema = z.looseObject({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseModelSchema, ImageSchema } from "./base.model";
|
|
3
|
-
import { PaymentInstructionIdentifierSchema, PaymentMethodIdentifierSchema } from "./identifiers.model";
|
|
4
|
-
import { MonetaryAmountSchema } from "./price.model";
|
|
2
|
+
import { BaseModelSchema, ImageSchema } from "./base.model.js";
|
|
3
|
+
import { PaymentInstructionIdentifierSchema, PaymentMethodIdentifierSchema } from "./identifiers.model.js";
|
|
4
|
+
import { MonetaryAmountSchema } from "./price.model.js";
|
|
5
5
|
const PaymentStatusSchema = z.enum(["pending", "authorized", "canceled", "capture", "partial_capture", "refunded", "partial_refund"]);
|
|
6
6
|
const PaymentProtocolDataSchema = z.looseObject({
|
|
7
7
|
key: z.string().default(""),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseModelSchema } from "./base.model";
|
|
3
|
-
import { PriceIdentifierSchema } from "./identifiers.model";
|
|
4
|
-
import { CurrencySchema } from "./currency.model";
|
|
2
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
3
|
+
import { PriceIdentifierSchema } from "./identifiers.model.js";
|
|
4
|
+
import { CurrencySchema } from "./currency.model.js";
|
|
5
5
|
const MonetaryAmountSchema = z.looseObject({
|
|
6
6
|
value: z.number().default(0).describe("The monetary amount in decimal-precision."),
|
|
7
7
|
currency: CurrencySchema.default("XXX").describe("The currency associated with the amount, as a ISO 4217 standardized code.")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ProductIdentifierSchema, SKUIdentifierSchema } from "./identifiers.model";
|
|
3
|
-
import { BaseModelSchema } from "./base.model";
|
|
2
|
+
import { ProductIdentifierSchema, SKUIdentifierSchema } from "./identifiers.model.js";
|
|
3
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
4
4
|
const SKUSchema = z.looseObject({
|
|
5
5
|
identifier: SKUIdentifierSchema.default(() => SKUIdentifierSchema.parse({}))
|
|
6
6
|
/* name: z.string().default(''),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { AddressIdentifierSchema, IdentityIdentifierSchema } from "./identifiers.model";
|
|
3
|
-
import { BaseModelSchema } from "./base.model";
|
|
2
|
+
import { AddressIdentifierSchema, IdentityIdentifierSchema } from "./identifiers.model.js";
|
|
3
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
4
4
|
const AddressSchema = BaseModelSchema.extend({
|
|
5
5
|
identifier: AddressIdentifierSchema.default(() => AddressIdentifierSchema.parse({})),
|
|
6
6
|
firstName: z.string().default(""),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ProductIdentifierSchema, FacetValueIdentifierSchema, FacetIdentifierSchema, SearchIdentifierSchema } from "./identifiers.model";
|
|
3
|
-
import { BaseModelSchema } from "./base.model";
|
|
2
|
+
import { ProductIdentifierSchema, FacetValueIdentifierSchema, FacetIdentifierSchema, SearchIdentifierSchema } from "./identifiers.model.js";
|
|
3
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
4
4
|
const SearchResultProductSchema = z.looseObject({
|
|
5
5
|
identifier: ProductIdentifierSchema.default(ProductIdentifierSchema.parse({})),
|
|
6
6
|
name: z.string().default(""),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { ShippingMethodIdentifierSchema } from "./identifiers.model";
|
|
3
|
-
import { MonetaryAmountSchema } from "./price.model";
|
|
4
|
-
import { BaseModelSchema, ImageSchema } from "./base.model";
|
|
5
|
-
import { AddressSchema } from "./profile.model";
|
|
2
|
+
import { ShippingMethodIdentifierSchema } from "./identifiers.model.js";
|
|
3
|
+
import { MonetaryAmountSchema } from "./price.model.js";
|
|
4
|
+
import { BaseModelSchema, ImageSchema } from "./base.model.js";
|
|
5
|
+
import { AddressSchema } from "./profile.model.js";
|
|
6
6
|
const PickupPointSchema = z.looseObject({
|
|
7
7
|
identifier: z.object({
|
|
8
8
|
key: z.string().default("").nonoptional()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseModelSchema } from "./base.model";
|
|
3
|
-
import { FulfillmentCenterIdentifierSchema, StoreIdentifierSchema } from "./identifiers.model";
|
|
2
|
+
import { BaseModelSchema } from "./base.model.js";
|
|
3
|
+
import { FulfillmentCenterIdentifierSchema, StoreIdentifierSchema } from "./identifiers.model.js";
|
|
4
4
|
const StoreSchema = BaseModelSchema.extend({
|
|
5
5
|
identifier: StoreIdentifierSchema.default(() => StoreIdentifierSchema.parse({})),
|
|
6
6
|
name: z.string().default(""),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseMutationSchema } from "./base.mutation";
|
|
3
|
-
import { ProductIdentifierSchema, SearchIdentifierSchema } from "../models/identifiers.model";
|
|
2
|
+
import { BaseMutationSchema } from "./base.mutation.js";
|
|
3
|
+
import { ProductIdentifierSchema, SearchIdentifierSchema } from "../models/identifiers.model.js";
|
|
4
4
|
const AnalyticsMutationSearchEventSchema = BaseMutationSchema.extend({
|
|
5
5
|
mutation: z.literal("search"),
|
|
6
6
|
search: SearchIdentifierSchema.required(),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseMutationSchema } from "./base.mutation";
|
|
3
|
-
import { CartIdentifierSchema, CartItemIdentifierSchema, PaymentMethodIdentifierSchema, ShippingMethodIdentifierSchema, SKUIdentifierSchema } from "../models/identifiers.model";
|
|
4
|
-
import { AddressSchema } from "../models/profile.model";
|
|
5
|
-
import { CurrencySchema } from "../models/currency.model";
|
|
6
|
-
import { MonetaryAmountSchema } from "../models/price.model";
|
|
2
|
+
import { BaseMutationSchema } from "./base.mutation.js";
|
|
3
|
+
import { CartIdentifierSchema, CartItemIdentifierSchema, PaymentMethodIdentifierSchema, ShippingMethodIdentifierSchema, SKUIdentifierSchema } from "../models/identifiers.model.js";
|
|
4
|
+
import { AddressSchema } from "../models/profile.model.js";
|
|
5
|
+
import { CurrencySchema } from "../models/currency.model.js";
|
|
6
|
+
import { MonetaryAmountSchema } from "../models/price.model.js";
|
|
7
7
|
const CartMutationItemAddSchema = BaseMutationSchema.extend({
|
|
8
8
|
cart: CartIdentifierSchema.nonoptional(),
|
|
9
9
|
sku: SKUIdentifierSchema.nonoptional(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { CartIdentifierSchema, AddressSchema, PaymentInstructionIdentifierSchema, PaymentInstructionSchema, ShippingInstructionSchema } from "../models";
|
|
3
|
-
import { BaseMutationSchema } from "./base.mutation";
|
|
2
|
+
import { CartIdentifierSchema, AddressSchema, PaymentInstructionIdentifierSchema, PaymentInstructionSchema, ShippingInstructionSchema } from "../models/index.js";
|
|
3
|
+
import { BaseMutationSchema } from "./base.mutation.js";
|
|
4
4
|
const CheckoutMutationInitiateCheckoutSchema = BaseMutationSchema.extend({
|
|
5
5
|
cart: CartIdentifierSchema.required(),
|
|
6
6
|
billingAddress: AddressSchema.omit({ identifier: true }).optional(),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./analytics.mutation";
|
|
2
|
-
export * from "./base.mutation";
|
|
3
|
-
export * from "./cart.mutation";
|
|
4
|
-
export * from "./identity.mutation";
|
|
5
|
-
export * from "./inventory.mutation";
|
|
6
|
-
export * from "./price.mutation";
|
|
7
|
-
export * from "./product.mutation";
|
|
8
|
-
export * from "./profile.mutation";
|
|
9
|
-
export * from "./search.mutation";
|
|
10
|
-
export * from "./checkout.mutation";
|
|
1
|
+
export * from "./analytics.mutation.js";
|
|
2
|
+
export * from "./base.mutation.js";
|
|
3
|
+
export * from "./cart.mutation.js";
|
|
4
|
+
export * from "./identity.mutation.js";
|
|
5
|
+
export * from "./inventory.mutation.js";
|
|
6
|
+
export * from "./price.mutation.js";
|
|
7
|
+
export * from "./product.mutation.js";
|
|
8
|
+
export * from "./profile.mutation.js";
|
|
9
|
+
export * from "./search.mutation.js";
|
|
10
|
+
export * from "./checkout.mutation.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseMutationSchema } from "./base.mutation";
|
|
2
|
+
import { BaseMutationSchema } from "./base.mutation.js";
|
|
3
3
|
const ProfileMutationUpdateSchema = BaseMutationSchema.extend({
|
|
4
4
|
email: z.email().default("base@example.com"),
|
|
5
5
|
phone: z.string().default("")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseQuerySchema } from "./base.query";
|
|
2
|
-
import { CartIdentifierSchema } from "../models/identifiers.model";
|
|
1
|
+
import { BaseQuerySchema } from "./base.query.js";
|
|
2
|
+
import { CartIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
3
|
const CartQueryByIdSchema = BaseQuerySchema.extend({
|
|
4
4
|
cart: CartIdentifierSchema.required()
|
|
5
5
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { CategoryIdentifierSchema } from "../models/identifiers.model";
|
|
3
|
-
import { BaseQuerySchema } from "./base.query";
|
|
4
|
-
import { PaginationOptionsSchema } from "../models/base.model";
|
|
2
|
+
import { CategoryIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
|
+
import { BaseQuerySchema } from "./base.query.js";
|
|
4
|
+
import { PaginationOptionsSchema } from "../models/base.model.js";
|
|
5
5
|
const CategoryQueryById = BaseQuerySchema.extend({
|
|
6
6
|
id: CategoryIdentifierSchema.default(() => CategoryIdentifierSchema.parse({}))
|
|
7
7
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseQuerySchema } from "./base.query";
|
|
2
|
-
import { CheckoutIdentifierSchema } from "../models/identifiers.model";
|
|
1
|
+
import { BaseQuerySchema } from "./base.query.js";
|
|
2
|
+
import { CheckoutIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
3
|
const CheckoutQueryByIdSchema = BaseQuerySchema.extend({
|
|
4
4
|
identifier: CheckoutIdentifierSchema.required()
|
|
5
5
|
});
|
package/schemas/queries/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from "./analytics.query";
|
|
2
|
-
export * from "./base.query";
|
|
3
|
-
export * from "./cart.query";
|
|
4
|
-
export * from "./category.query";
|
|
5
|
-
export * from "./identity.query";
|
|
6
|
-
export * from "./inventory.query";
|
|
7
|
-
export * from "./price.query";
|
|
8
|
-
export * from "./product.query";
|
|
9
|
-
export * from "./profile.query";
|
|
10
|
-
export * from "./search.query";
|
|
11
|
-
export * from "./store.query";
|
|
12
|
-
export * from "./order.query";
|
|
13
|
-
export * from "./checkout.query";
|
|
1
|
+
export * from "./analytics.query.js";
|
|
2
|
+
export * from "./base.query.js";
|
|
3
|
+
export * from "./cart.query.js";
|
|
4
|
+
export * from "./category.query.js";
|
|
5
|
+
export * from "./identity.query.js";
|
|
6
|
+
export * from "./inventory.query.js";
|
|
7
|
+
export * from "./price.query.js";
|
|
8
|
+
export * from "./product.query.js";
|
|
9
|
+
export * from "./profile.query.js";
|
|
10
|
+
export * from "./search.query.js";
|
|
11
|
+
export * from "./store.query.js";
|
|
12
|
+
export * from "./order.query.js";
|
|
13
|
+
export * from "./checkout.query.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseQuerySchema } from "./base.query";
|
|
2
|
-
import { FulfillmentCenterIdentifierSchema, ProductIdentifierSchema } from "../models/identifiers.model";
|
|
1
|
+
import { BaseQuerySchema } from "./base.query.js";
|
|
2
|
+
import { FulfillmentCenterIdentifierSchema, ProductIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
3
|
const InventoryQueryBySKUSchema = BaseQuerySchema.extend({
|
|
4
4
|
sku: ProductIdentifierSchema.default(() => ProductIdentifierSchema.parse({})).nonoptional(),
|
|
5
5
|
fulfilmentCenter: FulfillmentCenterIdentifierSchema.default(() => FulfillmentCenterIdentifierSchema.parse({})).nonoptional()
|