@reactionary/core 0.0.51 → 0.0.52
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 +15 -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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseQuerySchema } from "./base.query";
|
|
2
|
-
import { SKUIdentifierSchema } from "../models/identifiers.model";
|
|
1
|
+
import { BaseQuerySchema } from "./base.query.js";
|
|
2
|
+
import { SKUIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
3
|
const PriceQueryBySkuSchema = BaseQuerySchema.extend({
|
|
4
4
|
sku: SKUIdentifierSchema.required()
|
|
5
5
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseQuerySchema } from "./base.query";
|
|
3
|
-
import { SKUIdentifierSchema } from "../models";
|
|
2
|
+
import { BaseQuerySchema } from "./base.query.js";
|
|
3
|
+
import { SKUIdentifierSchema } from "../models/index.js";
|
|
4
4
|
const ProductQueryBySlugSchema = BaseQuerySchema.extend({
|
|
5
5
|
slug: z.string()
|
|
6
6
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseQuerySchema } from "./base.query";
|
|
2
|
-
import { SearchIdentifierSchema } from "../models/identifiers.model";
|
|
1
|
+
import { BaseQuerySchema } from "./base.query.js";
|
|
2
|
+
import { SearchIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
3
|
const SearchQueryByTermSchema = BaseQuerySchema.extend({
|
|
4
4
|
search: SearchIdentifierSchema.required()
|
|
5
5
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { IdentitySchema } from "./models/identity.model";
|
|
3
|
-
import { WebStoreIdentifierSchema } from "./models/identifiers.model";
|
|
4
|
-
import { CurrencySchema } from "./models/currency.model";
|
|
2
|
+
import { IdentitySchema } from "./models/identity.model.js";
|
|
3
|
+
import { WebStoreIdentifierSchema } from "./models/identifiers.model.js";
|
|
4
|
+
import { CurrencySchema } from "./models/currency.model.js";
|
|
5
5
|
const LanguageContextSchema = z.looseObject({
|
|
6
6
|
locale: z.string().default("en-US"),
|
|
7
7
|
currencyCode: CurrencySchema.default(() => CurrencySchema.parse({}))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BaseModel } from '../schemas/models';
|
|
2
|
-
import type { Cache, CacheEntryOptions } from './cache.interface';
|
|
1
|
+
import type { BaseModel } from '../schemas/models/index.js';
|
|
2
|
+
import type { Cache, CacheEntryOptions } from './cache.interface.js';
|
|
3
3
|
import type z from 'zod';
|
|
4
4
|
/**
|
|
5
5
|
* Memory version of the cache. Primarily useful for local development.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Redis } from '@upstash/redis';
|
|
2
|
-
import type { Cache, CacheEntryOptions } from './cache.interface';
|
|
2
|
+
import type { Cache, CacheEntryOptions } from './cache.interface.js';
|
|
3
3
|
import type z from 'zod';
|
|
4
4
|
export declare class RedisCache implements Cache {
|
|
5
5
|
protected redis: Redis;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Cache } from "../cache/cache.interface";
|
|
2
|
-
import type { Client } from "./client";
|
|
1
|
+
import type { Cache } from "../cache/cache.interface.js";
|
|
2
|
+
import type { Client } from "./client.js";
|
|
3
3
|
type CapabilityFactory<T> = (cache: Cache) => T;
|
|
4
4
|
type MergeCapabilities<Acc, New> = Omit<Acc, keyof New> & New;
|
|
5
5
|
export declare class ClientBuilder<TClient = object> {
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { AnalyticsProvider } from "../providers/analytics.provider";
|
|
2
|
-
import type { ProductProvider } from "../providers/product.provider";
|
|
3
|
-
import type { SearchProvider } from "../providers/search.provider";
|
|
4
|
-
import type { IdentityProvider } from '../providers/identity.provider';
|
|
5
|
-
import type { CartProvider } from "../providers/cart.provider";
|
|
6
|
-
import type { PriceProvider } from "../providers/price.provider";
|
|
7
|
-
import type { InventoryProvider } from "../providers/inventory.provider";
|
|
8
|
-
import type { Cache } from "../cache/cache.interface";
|
|
9
|
-
import type { CategoryProvider } from "../providers/category.provider";
|
|
10
|
-
import type { CheckoutProvider } from "../providers";
|
|
1
|
+
import type { AnalyticsProvider } from "../providers/analytics.provider.js";
|
|
2
|
+
import type { ProductProvider } from "../providers/product.provider.js";
|
|
3
|
+
import type { SearchProvider } from "../providers/search.provider.js";
|
|
4
|
+
import type { IdentityProvider } from '../providers/identity.provider.js';
|
|
5
|
+
import type { CartProvider } from "../providers/cart.provider.js";
|
|
6
|
+
import type { PriceProvider } from "../providers/price.provider.js";
|
|
7
|
+
import type { InventoryProvider } from "../providers/inventory.provider.js";
|
|
8
|
+
import type { Cache } from "../cache/cache.interface.js";
|
|
9
|
+
import type { CategoryProvider } from "../providers/category.provider.js";
|
|
10
|
+
import type { CheckoutProvider } from "../providers/index.js";
|
|
11
11
|
export interface Client {
|
|
12
12
|
product: ProductProvider;
|
|
13
13
|
search: SearchProvider;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { BaseProvider } from '../providers';
|
|
1
|
+
import type { BaseProvider } from '../providers/index.js';
|
|
2
|
+
import type { Tracer } from '@opentelemetry/api';
|
|
3
|
+
export declare function getTracer(): Tracer;
|
|
2
4
|
/**
|
|
3
5
|
* The options associated with annotating a provider function and marking
|
|
4
6
|
* it as a reactionary entrypoint to be called
|
package/src/index.d.ts
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/src/initialization.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RequestContext } from "./schemas/session.schema";
|
|
1
|
+
import type { RequestContext } from "./schemas/session.schema.js";
|
|
2
2
|
export declare function createInitialRequestContext(): RequestContext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnalyticsEvent } from '../schemas/models/analytics.model';
|
|
2
|
-
import { BaseProvider } from './base.provider';
|
|
1
|
+
import type { AnalyticsEvent } from '../schemas/models/analytics.model.js';
|
|
2
|
+
import { BaseProvider } from './base.provider.js';
|
|
3
3
|
export declare abstract class AnalyticsProvider<T extends AnalyticsEvent = AnalyticsEvent> extends BaseProvider<T> {
|
|
4
4
|
protected getResourceName(): string;
|
|
5
5
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { BaseModel } from '../schemas/models/base.model';
|
|
3
|
-
import { createPaginatedResponseSchema } from '../schemas/models/base.model';
|
|
4
|
-
import type { Cache } from '../cache/cache.interface';
|
|
5
|
-
import type { RequestContext } from '../schemas/session.schema';
|
|
6
|
-
import type { IdentifierType } from '../schemas/models/identifiers.model';
|
|
2
|
+
import type { BaseModel } from '../schemas/models/base.model.js';
|
|
3
|
+
import { createPaginatedResponseSchema } from '../schemas/models/base.model.js';
|
|
4
|
+
import type { Cache } from '../cache/cache.interface.js';
|
|
5
|
+
import type { RequestContext } from '../schemas/session.schema.js';
|
|
6
|
+
import type { IdentifierType } from '../schemas/models/identifiers.model.js';
|
|
7
7
|
/**
|
|
8
8
|
* Base capability provider, responsible for mutations (changes) and queries (fetches)
|
|
9
9
|
* for a given business object domain.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseProvider } from "./base.provider";
|
|
2
|
-
import type { Cart } from "../schemas/models/cart.model";
|
|
3
|
-
import type { CartQueryById } from "../schemas/queries/cart.query";
|
|
4
|
-
import type { RequestContext } from "../schemas/session.schema";
|
|
5
|
-
import type { CartMutationApplyCoupon, CartMutationChangeCurrency, CartMutationCheckout, CartMutationDeleteCart, CartMutationItemAdd, CartMutationItemQuantityChange, CartMutationItemRemove, CartMutationRemoveCoupon, CartMutationSetBillingAddress, CartMutationSetShippingInfo } from "../schemas/mutations/cart.mutation";
|
|
6
|
-
import type { CartIdentifier, OrderIdentifier } from "../schemas/models/identifiers.model";
|
|
1
|
+
import { BaseProvider } from "./base.provider.js";
|
|
2
|
+
import type { Cart } from "../schemas/models/cart.model.js";
|
|
3
|
+
import type { CartQueryById } from "../schemas/queries/cart.query.js";
|
|
4
|
+
import type { RequestContext } from "../schemas/session.schema.js";
|
|
5
|
+
import type { CartMutationApplyCoupon, CartMutationChangeCurrency, CartMutationCheckout, CartMutationDeleteCart, CartMutationItemAdd, CartMutationItemQuantityChange, CartMutationItemRemove, CartMutationRemoveCoupon, CartMutationSetBillingAddress, CartMutationSetShippingInfo } from "../schemas/mutations/cart.mutation.js";
|
|
6
|
+
import type { CartIdentifier, OrderIdentifier } from "../schemas/models/identifiers.model.js";
|
|
7
7
|
export declare abstract class CartProvider<T extends Cart = Cart> extends BaseProvider<T> {
|
|
8
8
|
/**
|
|
9
9
|
* Get cart by ID.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Category } from "../schemas/models/category.model";
|
|
2
|
-
import type { CategoryQueryById, CategoryQueryBySlug, CategoryQueryForBreadcrumb, CategoryQueryForChildCategories, CategoryQueryForTopCategories } from "../schemas/queries/category.query";
|
|
3
|
-
import type { RequestContext } from "../schemas/session.schema";
|
|
4
|
-
import { BaseProvider } from "./base.provider";
|
|
1
|
+
import type { Category } from "../schemas/models/category.model.js";
|
|
2
|
+
import type { CategoryQueryById, CategoryQueryBySlug, CategoryQueryForBreadcrumb, CategoryQueryForChildCategories, CategoryQueryForTopCategories } from "../schemas/queries/category.query.js";
|
|
3
|
+
import type { RequestContext } from "../schemas/session.schema.js";
|
|
4
|
+
import { BaseProvider } from "./base.provider.js";
|
|
5
5
|
/**
|
|
6
6
|
* CategoryProvider
|
|
7
7
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Checkout, PaymentMethod, ShippingMethod } from "../schemas/models";
|
|
2
|
-
import type { RequestContext } from "../schemas/session.schema";
|
|
3
|
-
import { BaseProvider } from "./base.provider";
|
|
4
|
-
import type { CheckoutMutationFinalizeCheckout, CheckoutMutationInitiateCheckout, CheckoutMutationSetShippingAddress, CheckoutMutationAddPaymentInstruction, CheckoutMutationRemovePaymentInstruction, CheckoutMutationSetShippingInstruction } from "../schemas/mutations/checkout.mutation";
|
|
5
|
-
import type { CheckoutQueryById, CheckoutQueryForAvailablePaymentMethods, CheckoutQueryForAvailableShippingMethods } from "../schemas/queries";
|
|
1
|
+
import type { Checkout, PaymentMethod, ShippingMethod } from "../schemas/models/index.js";
|
|
2
|
+
import type { RequestContext } from "../schemas/session.schema.js";
|
|
3
|
+
import { BaseProvider } from "./base.provider.js";
|
|
4
|
+
import type { CheckoutMutationFinalizeCheckout, CheckoutMutationInitiateCheckout, CheckoutMutationSetShippingAddress, CheckoutMutationAddPaymentInstruction, CheckoutMutationRemovePaymentInstruction, CheckoutMutationSetShippingInstruction } from "../schemas/mutations/checkout.mutation.js";
|
|
5
|
+
import type { CheckoutQueryById, CheckoutQueryForAvailablePaymentMethods, CheckoutQueryForAvailableShippingMethods } from "../schemas/queries/index.js";
|
|
6
6
|
export declare abstract class CheckoutProvider<T extends Checkout = Checkout> extends BaseProvider<T> {
|
|
7
7
|
/**
|
|
8
8
|
* This starts a new checkout session for the given cart. The checkout might duplicate the cart, or just reference it, depending on implementation, but changes to the cart,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Identity } from "../schemas/models/identity.model";
|
|
2
|
-
import type { IdentityMutationLogin, IdentityMutationLogout, IdentityMutationRegister } from "../schemas/mutations/identity.mutation";
|
|
3
|
-
import type { IdentityQuerySelf } from "../schemas/queries/identity.query";
|
|
4
|
-
import type { RequestContext } from "../schemas/session.schema";
|
|
5
|
-
import { BaseProvider } from "./base.provider";
|
|
1
|
+
import type { Identity } from "../schemas/models/identity.model.js";
|
|
2
|
+
import type { IdentityMutationLogin, IdentityMutationLogout, IdentityMutationRegister } from "../schemas/mutations/identity.mutation.js";
|
|
3
|
+
import type { IdentityQuerySelf } from "../schemas/queries/identity.query.js";
|
|
4
|
+
import type { RequestContext } from "../schemas/session.schema.js";
|
|
5
|
+
import { BaseProvider } from "./base.provider.js";
|
|
6
6
|
export declare abstract class IdentityProvider<T extends Identity = Identity> extends BaseProvider<T> {
|
|
7
7
|
abstract getSelf(payload: IdentityQuerySelf, reqCtx: RequestContext): Promise<T>;
|
|
8
8
|
abstract login(payload: IdentityMutationLogin, reqCtx: RequestContext): Promise<T>;
|
package/src/providers/index.d.ts
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
|
-
import type { Inventory } from '../schemas/models/inventory.model';
|
|
2
|
-
import type { InventoryQueryBySKU } from '../schemas/queries/inventory.query';
|
|
3
|
-
import type { RequestContext } from '../schemas/session.schema';
|
|
4
|
-
import { BaseProvider } from './base.provider';
|
|
1
|
+
import type { Inventory } from '../schemas/models/inventory.model.js';
|
|
2
|
+
import type { InventoryQueryBySKU } from '../schemas/queries/inventory.query.js';
|
|
3
|
+
import type { RequestContext } from '../schemas/session.schema.js';
|
|
4
|
+
import { BaseProvider } from './base.provider.js';
|
|
5
5
|
export declare abstract class InventoryProvider<T extends Inventory = Inventory> extends BaseProvider<T> {
|
|
6
6
|
abstract getBySKU(payload: InventoryQueryBySKU, reqCtx: RequestContext): Promise<T>;
|
|
7
7
|
protected getResourceName(): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseProvider } from "./base.provider";
|
|
2
|
-
import type { RequestContext } from "../schemas/session.schema";
|
|
3
|
-
import type { Order } from "../schemas/models";
|
|
4
|
-
import type { OrderQueryById } from "../schemas/queries";
|
|
1
|
+
import { BaseProvider } from "./base.provider.js";
|
|
2
|
+
import type { RequestContext } from "../schemas/session.schema.js";
|
|
3
|
+
import type { Order } from "../schemas/models/index.js";
|
|
4
|
+
import type { OrderQueryById } from "../schemas/queries/index.js";
|
|
5
5
|
export declare abstract class OrderProvider<T extends Order = Order> extends BaseProvider<T> {
|
|
6
6
|
/**
|
|
7
7
|
* Get order by ID.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Currency } from '../schemas/models/currency.model';
|
|
2
|
-
import type { Price } from '../schemas/models/price.model';
|
|
3
|
-
import type { PriceQueryBySku } from '../schemas/queries/price.query';
|
|
4
|
-
import type { RequestContext } from '../schemas/session.schema';
|
|
5
|
-
import { BaseProvider } from './base.provider';
|
|
1
|
+
import type { Currency } from '../schemas/models/currency.model.js';
|
|
2
|
+
import type { Price } from '../schemas/models/price.model.js';
|
|
3
|
+
import type { PriceQueryBySku } from '../schemas/queries/price.query.js';
|
|
4
|
+
import type { RequestContext } from '../schemas/session.schema.js';
|
|
5
|
+
import { BaseProvider } from './base.provider.js';
|
|
6
6
|
export declare abstract class PriceProvider<T extends Price = Price> extends BaseProvider<T> {
|
|
7
7
|
/**
|
|
8
8
|
* Get a price by SKU.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Product } from '../schemas/models/product.model';
|
|
2
|
-
import { BaseProvider } from './base.provider';
|
|
3
|
-
import type { RequestContext } from '../schemas/session.schema';
|
|
4
|
-
import type { ProductQueryById, ProductQueryBySKU, ProductQueryBySlug } from '../schemas/queries/product.query';
|
|
1
|
+
import type { Product } from '../schemas/models/product.model.js';
|
|
2
|
+
import { BaseProvider } from './base.provider.js';
|
|
3
|
+
import type { RequestContext } from '../schemas/session.schema.js';
|
|
4
|
+
import type { ProductQueryById, ProductQueryBySKU, ProductQueryBySlug } from '../schemas/queries/product.query.js';
|
|
5
5
|
export declare abstract class ProductProvider<T extends Product = Product> extends BaseProvider<T> {
|
|
6
6
|
abstract getById(payload: ProductQueryById, reqCtx: RequestContext): Promise<T>;
|
|
7
7
|
abstract getBySlug(payload: ProductQueryBySlug, reqCtx: RequestContext): Promise<T | null>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Profile } from '../schemas/models';
|
|
2
|
-
import type { ProfileMutationUpdate } from '../schemas/mutations';
|
|
3
|
-
import type { ProfileQuerySelf } from '../schemas/queries';
|
|
4
|
-
import type { RequestContext } from '../schemas/session.schema';
|
|
5
|
-
import { BaseProvider } from './base.provider';
|
|
1
|
+
import type { Profile } from '../schemas/models/index.js';
|
|
2
|
+
import type { ProfileMutationUpdate } from '../schemas/mutations/index.js';
|
|
3
|
+
import type { ProfileQuerySelf } from '../schemas/queries/index.js';
|
|
4
|
+
import type { RequestContext } from '../schemas/session.schema.js';
|
|
5
|
+
import { BaseProvider } from './base.provider.js';
|
|
6
6
|
export declare abstract class ProfileProvider<T extends Profile = Profile> extends BaseProvider<T> {
|
|
7
7
|
abstract getSelf(payload: ProfileQuerySelf, reqCtx: RequestContext): Promise<T>;
|
|
8
8
|
abstract update(payload: ProfileMutationUpdate, reqCtx: RequestContext): Promise<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { SearchResult } from '../schemas/models/search.model';
|
|
2
|
-
import type { SearchQueryByTerm } from '../schemas/queries/search.query';
|
|
3
|
-
import type { RequestContext } from '../schemas/session.schema';
|
|
4
|
-
import { BaseProvider } from './base.provider';
|
|
1
|
+
import type { SearchResult } from '../schemas/models/search.model.js';
|
|
2
|
+
import type { SearchQueryByTerm } from '../schemas/queries/search.query.js';
|
|
3
|
+
import type { RequestContext } from '../schemas/session.schema.js';
|
|
4
|
+
import { BaseProvider } from './base.provider.js';
|
|
5
5
|
export declare abstract class SearchProvider<T extends SearchResult = SearchResult> extends BaseProvider<T> {
|
|
6
6
|
abstract queryByTerm(payload: SearchQueryByTerm, reqCtx: RequestContext): Promise<SearchResult>;
|
|
7
7
|
protected getResourceName(): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Store } from '../schemas/models/store.model';
|
|
2
|
-
import type { StoreQueryByProximity } from '../schemas/queries';
|
|
3
|
-
import type { RequestContext } from '../schemas/session.schema';
|
|
4
|
-
import { BaseProvider } from './base.provider';
|
|
1
|
+
import type { Store } from '../schemas/models/store.model.js';
|
|
2
|
+
import type { StoreQueryByProximity } from '../schemas/queries/index.js';
|
|
3
|
+
import type { RequestContext } from '../schemas/session.schema.js';
|
|
4
|
+
import { BaseProvider } from './base.provider.js';
|
|
5
5
|
export declare abstract class StoreProvider<T extends Store = Store> extends BaseProvider<T> {
|
|
6
6
|
abstract queryByProximity(payload: StoreQueryByProximity, reqCtx: RequestContext): Promise<Array<T>>;
|
|
7
7
|
protected getResourceName(): string;
|
|
@@ -185,7 +185,7 @@ export declare const CostBreakDownSchema: z.ZodObject<{
|
|
|
185
185
|
ZMW: "ZMW";
|
|
186
186
|
ZWL: "ZWL";
|
|
187
187
|
}>>;
|
|
188
|
-
}, z.core.$loose>>;
|
|
188
|
+
}, z.z.core.$loose>>;
|
|
189
189
|
totalDiscount: z.ZodDefault<z.ZodObject<{
|
|
190
190
|
value: z.ZodDefault<z.ZodNumber>;
|
|
191
191
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -371,7 +371,7 @@ export declare const CostBreakDownSchema: z.ZodObject<{
|
|
|
371
371
|
ZMW: "ZMW";
|
|
372
372
|
ZWL: "ZWL";
|
|
373
373
|
}>>;
|
|
374
|
-
}, z.core.$loose>>;
|
|
374
|
+
}, z.z.core.$loose>>;
|
|
375
375
|
totalSurcharge: z.ZodDefault<z.ZodObject<{
|
|
376
376
|
value: z.ZodDefault<z.ZodNumber>;
|
|
377
377
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -557,7 +557,7 @@ export declare const CostBreakDownSchema: z.ZodObject<{
|
|
|
557
557
|
ZMW: "ZMW";
|
|
558
558
|
ZWL: "ZWL";
|
|
559
559
|
}>>;
|
|
560
|
-
}, z.core.$loose>>;
|
|
560
|
+
}, z.z.core.$loose>>;
|
|
561
561
|
totalShipping: z.ZodDefault<z.ZodObject<{
|
|
562
562
|
value: z.ZodDefault<z.ZodNumber>;
|
|
563
563
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -743,7 +743,7 @@ export declare const CostBreakDownSchema: z.ZodObject<{
|
|
|
743
743
|
ZMW: "ZMW";
|
|
744
744
|
ZWL: "ZWL";
|
|
745
745
|
}>>;
|
|
746
|
-
}, z.core.$loose>>;
|
|
746
|
+
}, z.z.core.$loose>>;
|
|
747
747
|
totalProductPrice: z.ZodDefault<z.ZodObject<{
|
|
748
748
|
value: z.ZodDefault<z.ZodNumber>;
|
|
749
749
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -929,7 +929,7 @@ export declare const CostBreakDownSchema: z.ZodObject<{
|
|
|
929
929
|
ZMW: "ZMW";
|
|
930
930
|
ZWL: "ZWL";
|
|
931
931
|
}>>;
|
|
932
|
-
}, z.core.$loose>>;
|
|
932
|
+
}, z.z.core.$loose>>;
|
|
933
933
|
grandTotal: z.ZodDefault<z.ZodObject<{
|
|
934
934
|
value: z.ZodDefault<z.ZodNumber>;
|
|
935
935
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1115,8 +1115,8 @@ export declare const CostBreakDownSchema: z.ZodObject<{
|
|
|
1115
1115
|
ZMW: "ZMW";
|
|
1116
1116
|
ZWL: "ZWL";
|
|
1117
1117
|
}>>;
|
|
1118
|
-
}, z.core.$loose>>;
|
|
1119
|
-
}, z.core.$loose>;
|
|
1118
|
+
}, z.z.core.$loose>>;
|
|
1119
|
+
}, z.z.core.$loose>;
|
|
1120
1120
|
export declare const ItemCostBreakdownSchema: z.ZodObject<{
|
|
1121
1121
|
unitPrice: z.ZodDefault<z.ZodObject<{
|
|
1122
1122
|
value: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1303,7 +1303,7 @@ export declare const ItemCostBreakdownSchema: z.ZodObject<{
|
|
|
1303
1303
|
ZMW: "ZMW";
|
|
1304
1304
|
ZWL: "ZWL";
|
|
1305
1305
|
}>>;
|
|
1306
|
-
}, z.core.$loose>>;
|
|
1306
|
+
}, z.z.core.$loose>>;
|
|
1307
1307
|
unitDiscount: z.ZodDefault<z.ZodObject<{
|
|
1308
1308
|
value: z.ZodDefault<z.ZodNumber>;
|
|
1309
1309
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1489,7 +1489,7 @@ export declare const ItemCostBreakdownSchema: z.ZodObject<{
|
|
|
1489
1489
|
ZMW: "ZMW";
|
|
1490
1490
|
ZWL: "ZWL";
|
|
1491
1491
|
}>>;
|
|
1492
|
-
}, z.core.$loose>>;
|
|
1492
|
+
}, z.z.core.$loose>>;
|
|
1493
1493
|
totalPrice: z.ZodDefault<z.ZodObject<{
|
|
1494
1494
|
value: z.ZodDefault<z.ZodNumber>;
|
|
1495
1495
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1675,7 +1675,7 @@ export declare const ItemCostBreakdownSchema: z.ZodObject<{
|
|
|
1675
1675
|
ZMW: "ZMW";
|
|
1676
1676
|
ZWL: "ZWL";
|
|
1677
1677
|
}>>;
|
|
1678
|
-
}, z.core.$loose>>;
|
|
1678
|
+
}, z.z.core.$loose>>;
|
|
1679
1679
|
totalDiscount: z.ZodDefault<z.ZodObject<{
|
|
1680
1680
|
value: z.ZodDefault<z.ZodNumber>;
|
|
1681
1681
|
currency: z.ZodDefault<z.ZodEnum<{
|
|
@@ -1861,7 +1861,7 @@ export declare const ItemCostBreakdownSchema: z.ZodObject<{
|
|
|
1861
1861
|
ZMW: "ZMW";
|
|
1862
1862
|
ZWL: "ZWL";
|
|
1863
1863
|
}>>;
|
|
1864
|
-
}, z.core.$loose>>;
|
|
1865
|
-
}, z.core.$loose>;
|
|
1864
|
+
}, z.z.core.$loose>>;
|
|
1865
|
+
}, z.z.core.$loose>;
|
|
1866
1866
|
export type CostBreakDown = z.infer<typeof CostBreakDownSchema>;
|
|
1867
1867
|
export type ItemCostBreakdown = z.infer<typeof ItemCostBreakdownSchema>;
|
|
@@ -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';
|
|
@@ -4,12 +4,12 @@ export declare const AddressSchema: z.ZodObject<{
|
|
|
4
4
|
cache: z.ZodDefault<z.ZodObject<{
|
|
5
5
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
6
6
|
key: z.ZodDefault<z.ZodString>;
|
|
7
|
-
}, z.core.$loose>>;
|
|
7
|
+
}, z.z.core.$loose>>;
|
|
8
8
|
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
-
}, z.core.$loose>>;
|
|
9
|
+
}, z.z.core.$loose>>;
|
|
10
10
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
11
11
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
12
|
-
}, z.core.$loose>>;
|
|
12
|
+
}, z.z.core.$loose>>;
|
|
13
13
|
firstName: z.ZodDefault<z.ZodString>;
|
|
14
14
|
lastName: z.ZodDefault<z.ZodString>;
|
|
15
15
|
streetAddress: z.ZodDefault<z.ZodString>;
|
|
@@ -18,18 +18,18 @@ export declare const AddressSchema: z.ZodObject<{
|
|
|
18
18
|
region: z.ZodDefault<z.ZodString>;
|
|
19
19
|
postalCode: z.ZodDefault<z.ZodString>;
|
|
20
20
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
21
|
-
}, z.core.$loose>;
|
|
21
|
+
}, z.z.core.$loose>;
|
|
22
22
|
export declare const ProfileSchema: z.ZodObject<{
|
|
23
23
|
meta: z.ZodDefault<z.ZodObject<{
|
|
24
24
|
cache: z.ZodDefault<z.ZodObject<{
|
|
25
25
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
26
26
|
key: z.ZodDefault<z.ZodString>;
|
|
27
|
-
}, z.core.$loose>>;
|
|
27
|
+
}, z.z.core.$loose>>;
|
|
28
28
|
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
-
}, z.core.$loose>>;
|
|
29
|
+
}, z.z.core.$loose>>;
|
|
30
30
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
31
31
|
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
32
|
-
}, z.core.$loose>>;
|
|
32
|
+
}, z.z.core.$loose>>;
|
|
33
33
|
email: z.ZodDefault<z.ZodString>;
|
|
34
34
|
phone: z.ZodDefault<z.ZodString>;
|
|
35
35
|
emailVerified: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -41,12 +41,12 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
41
41
|
cache: z.ZodDefault<z.ZodObject<{
|
|
42
42
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
43
43
|
key: z.ZodDefault<z.ZodString>;
|
|
44
|
-
}, z.core.$loose>>;
|
|
44
|
+
}, z.z.core.$loose>>;
|
|
45
45
|
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
-
}, z.core.$loose>>;
|
|
46
|
+
}, z.z.core.$loose>>;
|
|
47
47
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
48
48
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
49
|
-
}, z.core.$loose>>;
|
|
49
|
+
}, z.z.core.$loose>>;
|
|
50
50
|
firstName: z.ZodDefault<z.ZodString>;
|
|
51
51
|
lastName: z.ZodDefault<z.ZodString>;
|
|
52
52
|
streetAddress: z.ZodDefault<z.ZodString>;
|
|
@@ -55,18 +55,18 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
55
55
|
region: z.ZodDefault<z.ZodString>;
|
|
56
56
|
postalCode: z.ZodDefault<z.ZodString>;
|
|
57
57
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
58
|
-
}, z.core.$loose>>;
|
|
58
|
+
}, z.z.core.$loose>>;
|
|
59
59
|
billingAddress: z.ZodOptional<z.ZodObject<{
|
|
60
60
|
meta: z.ZodDefault<z.ZodObject<{
|
|
61
61
|
cache: z.ZodDefault<z.ZodObject<{
|
|
62
62
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
63
63
|
key: z.ZodDefault<z.ZodString>;
|
|
64
|
-
}, z.core.$loose>>;
|
|
64
|
+
}, z.z.core.$loose>>;
|
|
65
65
|
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
-
}, z.core.$loose>>;
|
|
66
|
+
}, z.z.core.$loose>>;
|
|
67
67
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
68
68
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
69
|
-
}, z.core.$loose>>;
|
|
69
|
+
}, z.z.core.$loose>>;
|
|
70
70
|
firstName: z.ZodDefault<z.ZodString>;
|
|
71
71
|
lastName: z.ZodDefault<z.ZodString>;
|
|
72
72
|
streetAddress: z.ZodDefault<z.ZodString>;
|
|
@@ -75,18 +75,18 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
75
75
|
region: z.ZodDefault<z.ZodString>;
|
|
76
76
|
postalCode: z.ZodDefault<z.ZodString>;
|
|
77
77
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
78
|
-
}, z.core.$loose>>;
|
|
78
|
+
}, z.z.core.$loose>>;
|
|
79
79
|
alternateShippingAddresses: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
80
80
|
meta: z.ZodDefault<z.ZodObject<{
|
|
81
81
|
cache: z.ZodDefault<z.ZodObject<{
|
|
82
82
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
83
83
|
key: z.ZodDefault<z.ZodString>;
|
|
84
|
-
}, z.core.$loose>>;
|
|
84
|
+
}, z.z.core.$loose>>;
|
|
85
85
|
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
-
}, z.core.$loose>>;
|
|
86
|
+
}, z.z.core.$loose>>;
|
|
87
87
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
88
88
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
89
|
-
}, z.core.$loose>>;
|
|
89
|
+
}, z.z.core.$loose>>;
|
|
90
90
|
firstName: z.ZodDefault<z.ZodString>;
|
|
91
91
|
lastName: z.ZodDefault<z.ZodString>;
|
|
92
92
|
streetAddress: z.ZodDefault<z.ZodString>;
|
|
@@ -95,7 +95,7 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
95
95
|
region: z.ZodDefault<z.ZodString>;
|
|
96
96
|
postalCode: z.ZodDefault<z.ZodString>;
|
|
97
97
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
98
|
-
}, z.core.$loose>>>;
|
|
99
|
-
}, z.core.$loose>;
|
|
98
|
+
}, z.z.core.$loose>>>;
|
|
99
|
+
}, z.z.core.$loose>;
|
|
100
100
|
export type Address = z.infer<typeof AddressSchema>;
|
|
101
101
|
export type Profile = z.infer<typeof ProfileSchema>;
|