@reactionary/source 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/core/package.json +4 -3
- package/core/src/cache/cache.interface.ts +1 -1
- package/core/src/cache/memory-cache.ts +2 -2
- package/core/src/cache/noop-cache.ts +1 -1
- package/core/src/cache/redis-cache.ts +1 -1
- package/core/src/client/client-builder.ts +4 -4
- package/core/src/client/client.ts +11 -11
- package/core/src/decorators/reactionary.decorator.ts +22 -2
- package/core/src/index.ts +14 -14
- package/core/src/initialization.ts +1 -1
- package/core/src/providers/analytics.provider.ts +2 -2
- package/core/src/providers/base.provider.ts +5 -5
- package/core/src/providers/cart.provider.ts +6 -6
- package/core/src/providers/category.provider.ts +4 -9
- package/core/src/providers/checkout.provider.ts +5 -5
- package/core/src/providers/identity.provider.ts +5 -5
- package/core/src/providers/index.ts +13 -13
- package/core/src/providers/inventory.provider.ts +4 -4
- package/core/src/providers/order.provider.ts +4 -4
- package/core/src/providers/price.provider.ts +5 -5
- package/core/src/providers/product.provider.ts +4 -4
- package/core/src/providers/profile.provider.ts +5 -5
- package/core/src/providers/search.provider.ts +4 -4
- package/core/src/providers/store.provider.ts +4 -4
- package/core/src/schemas/models/analytics.model.ts +1 -1
- package/core/src/schemas/models/cart.model.ts +3 -9
- package/core/src/schemas/models/category.model.ts +2 -2
- package/core/src/schemas/models/checkout.model.ts +6 -8
- package/core/src/schemas/models/cost.model.ts +1 -1
- package/core/src/schemas/models/identity.model.ts +2 -2
- package/core/src/schemas/models/index.ts +19 -19
- package/core/src/schemas/models/inventory.model.ts +2 -2
- package/core/src/schemas/models/order.model.ts +6 -7
- package/core/src/schemas/models/payment.model.ts +3 -3
- package/core/src/schemas/models/price.model.ts +3 -3
- package/core/src/schemas/models/product.model.ts +2 -2
- package/core/src/schemas/models/profile.model.ts +2 -2
- package/core/src/schemas/models/search.model.ts +2 -3
- package/core/src/schemas/models/shipping-method.model.ts +4 -4
- package/core/src/schemas/models/store.model.ts +2 -2
- package/core/src/schemas/mutations/analytics.mutation.ts +2 -2
- package/core/src/schemas/mutations/cart.mutation.ts +5 -5
- package/core/src/schemas/mutations/checkout.mutation.ts +2 -2
- package/core/src/schemas/mutations/identity.mutation.ts +1 -1
- package/core/src/schemas/mutations/index.ts +10 -10
- package/core/src/schemas/mutations/profile.mutation.ts +1 -1
- package/core/src/schemas/queries/cart.query.ts +2 -2
- package/core/src/schemas/queries/category.query.ts +3 -3
- package/core/src/schemas/queries/checkout.query.ts +2 -2
- package/core/src/schemas/queries/identity.query.ts +1 -1
- package/core/src/schemas/queries/index.ts +13 -13
- package/core/src/schemas/queries/inventory.query.ts +2 -2
- package/core/src/schemas/queries/order.query.ts +2 -2
- package/core/src/schemas/queries/price.query.ts +2 -2
- package/core/src/schemas/queries/product.query.ts +2 -2
- package/core/src/schemas/queries/profile.query.ts +1 -1
- package/core/src/schemas/queries/search.query.ts +2 -2
- package/core/src/schemas/queries/store.query.ts +1 -1
- package/core/src/schemas/session.schema.ts +3 -3
- package/core/tsconfig.json +3 -2
- package/examples/next/next.config.js +17 -6
- package/examples/next/src/app/page.tsx +1 -2
- package/examples/node/package.json +2 -1
- package/examples/node/src/basic/basic-node-setup.spec.ts +1 -1
- package/examples/node/tsconfig.json +2 -1
- package/examples/node/tsconfig.spec.json +3 -2
- package/package.json +1 -1
- package/providers/algolia/package.json +2 -1
- package/providers/algolia/src/core/initialize.ts +5 -5
- package/providers/algolia/src/index.ts +5 -5
- package/providers/algolia/src/providers/product.provider.ts +1 -1
- package/providers/algolia/src/providers/search.provider.ts +1 -1
- package/providers/algolia/src/test/search.provider.spec.ts +1 -1
- package/providers/algolia/tsconfig.json +2 -1
- package/providers/algolia/tsconfig.spec.json +3 -2
- package/providers/commercetools/{jest.config.ts → jest.config.cjs} +1 -1
- package/providers/commercetools/package.json +2 -2
- package/providers/commercetools/src/core/client.ts +1 -1
- package/providers/commercetools/src/core/initialize.ts +10 -10
- package/providers/commercetools/src/index.ts +10 -10
- package/providers/commercetools/src/providers/cart.provider.ts +4 -18
- package/providers/commercetools/src/providers/category.provider.ts +3 -12
- package/providers/commercetools/src/providers/checkout.provider.ts +5 -5
- package/providers/commercetools/src/providers/identity.provider.ts +2 -2
- package/providers/commercetools/src/providers/index.ts +11 -11
- package/providers/commercetools/src/providers/inventory.provider.ts +2 -4
- package/providers/commercetools/src/providers/order.provider.ts +4 -6
- package/providers/commercetools/src/providers/price.provider.ts +2 -2
- package/providers/commercetools/src/providers/product.provider.ts +2 -7
- package/providers/commercetools/src/providers/profile.provider.ts +2 -2
- package/providers/commercetools/src/providers/search.provider.ts +3 -5
- package/providers/commercetools/src/providers/store.provider.ts +3 -3
- package/providers/commercetools/src/schema/commercetools.schema.ts +1 -1
- package/providers/commercetools/src/test/cart.provider.spec.ts +4 -4
- package/providers/commercetools/src/test/category.provider.spec.ts +3 -3
- package/providers/commercetools/src/test/checkout.provider.spec.ts +4 -4
- package/providers/commercetools/src/test/identity.provider.spec.ts +3 -3
- package/providers/commercetools/src/test/inventory.provider.spec.ts +2 -2
- package/providers/commercetools/src/test/price.provider.spec.ts +3 -3
- package/providers/commercetools/src/test/product.provider.spec.ts +3 -3
- package/providers/commercetools/src/test/profile.provider.spec.ts +3 -3
- package/providers/commercetools/src/test/search.provider.spec.ts +2 -2
- package/providers/commercetools/src/test/store.provider.spec.ts +2 -2
- package/providers/commercetools/tsconfig.json +2 -1
- package/providers/commercetools/tsconfig.spec.json +4 -3
- package/providers/fake/{jest.config.ts → jest.config.cjs} +1 -1
- package/providers/fake/package.json +2 -2
- package/providers/fake/src/core/initialize.ts +6 -6
- package/providers/fake/src/index.ts +4 -4
- package/providers/fake/src/providers/analytics.provider.ts +1 -1
- package/providers/fake/src/providers/cart.provider.ts +2 -2
- package/providers/fake/src/providers/category.provider.ts +2 -2
- package/providers/fake/src/providers/identity.provider.ts +1 -1
- package/providers/fake/src/providers/index.ts +9 -9
- package/providers/fake/src/providers/inventory.provider.ts +1 -1
- package/providers/fake/src/providers/price.provider.ts +1 -1
- package/providers/fake/src/providers/product.provider.ts +1 -1
- package/providers/fake/src/providers/search.provider.ts +2 -5
- package/providers/fake/src/providers/store.provider.ts +2 -3
- package/providers/fake/src/test/cart.provider.spec.ts +3 -3
- package/providers/fake/src/test/category.provider.spec.ts +2 -2
- package/providers/fake/src/test/price.provider.spec.ts +2 -2
- package/providers/fake/src/test/product.provider.spec.ts +3 -3
- package/providers/fake/src/test/test-utils.ts +1 -1
- package/providers/fake/tsconfig.json +2 -1
- package/providers/fake/tsconfig.spec.json +1 -3
- package/providers/posthog/package.json +4 -4
- package/providers/posthog/project.json +2 -2
- package/providers/posthog/src/core/initialize.ts +2 -2
- package/providers/posthog/src/index.ts +3 -3
- package/providers/posthog/tsconfig.json +2 -1
- package/tsconfig.base.json +3 -4
- package/otel/README.md +0 -227
- package/otel/eslint.config.mjs +0 -23
- package/otel/package.json +0 -11
- package/otel/pnpm-lock.yaml +0 -805
- package/otel/project.json +0 -33
- package/otel/src/index.ts +0 -22
- package/otel/src/metrics.ts +0 -76
- package/otel/src/provider-instrumentation.ts +0 -108
- package/otel/src/test/otel.spec.ts +0 -8
- package/otel/src/trace-decorator.ts +0 -226
- package/otel/src/tracer.ts +0 -83
- package/otel/src/trpc-middleware.ts +0 -128
- package/otel/tsconfig.json +0 -23
- package/otel/tsconfig.lib.json +0 -23
- package/otel/tsconfig.spec.json +0 -28
- package/otel/vite.config.ts +0 -24
- package/trpc/README.md +0 -7
- package/trpc/__mocks__/superjson.js +0 -25
- package/trpc/eslint.config.mjs +0 -19
- package/trpc/jest.config.ts +0 -14
- package/trpc/package.json +0 -14
- package/trpc/project.json +0 -31
- package/trpc/src/client.ts +0 -175
- package/trpc/src/index.ts +0 -44
- package/trpc/src/integration.spec.ts +0 -223
- package/trpc/src/server.ts +0 -125
- package/trpc/src/transparent-client.spec.ts +0 -161
- package/trpc/src/types.ts +0 -144
- package/trpc/tsconfig.json +0 -16
- package/trpc/tsconfig.lib.json +0 -10
- package/trpc/tsconfig.spec.json +0 -15
package/core/package.json
CHANGED
|
@@ -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
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Cache } from "../cache/cache.interface";
|
|
2
|
-
import { NoOpCache } from "../cache/noop-cache";
|
|
3
|
-
import type { Client } from "./client";
|
|
4
|
-
import type { AnalyticsProvider } from "../providers/analytics.provider";
|
|
1
|
+
import type { Cache } from "../cache/cache.interface.js";
|
|
2
|
+
import { NoOpCache } from "../cache/noop-cache.js";
|
|
3
|
+
import type { Client } from "./client.js";
|
|
4
|
+
import type { AnalyticsProvider } from "../providers/analytics.provider.js";
|
|
5
5
|
|
|
6
6
|
type CapabilityFactory<T> = (cache: Cache) => T;
|
|
7
7
|
|
|
@@ -1,14 +1,14 @@
|
|
|
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 { RedisCache } from "../cache/redis-cache";
|
|
10
|
-
import type { CategoryProvider } from "../providers/category.provider";
|
|
11
|
-
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 { RedisCache } from "../cache/redis-cache.js";
|
|
10
|
+
import type { CategoryProvider } from "../providers/category.provider.js";
|
|
11
|
+
import type { CheckoutProvider } from "../providers/index.js";
|
|
12
12
|
|
|
13
13
|
export interface Client {
|
|
14
14
|
product: ProductProvider,
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
import type { BaseProvider } from '../providers';
|
|
2
|
-
import {
|
|
1
|
+
import type { BaseProvider } from '../providers/index.js';
|
|
2
|
+
import type {
|
|
3
|
+
Tracer, } from '@opentelemetry/api';
|
|
4
|
+
import {
|
|
5
|
+
trace,
|
|
6
|
+
SpanKind
|
|
7
|
+
} from '@opentelemetry/api';
|
|
8
|
+
|
|
9
|
+
const TRACER_NAME = '@reactionary';
|
|
10
|
+
const TRACER_VERSION = '0.0.1';
|
|
11
|
+
|
|
12
|
+
let globalTracer: Tracer | null = null;
|
|
13
|
+
|
|
14
|
+
export function getTracer(): Tracer {
|
|
15
|
+
if (!globalTracer) {
|
|
16
|
+
// Simply get the tracer from the API
|
|
17
|
+
// If the SDK is not initialized by the host application,
|
|
18
|
+
// this will return a ProxyTracer that produces NonRecordingSpans
|
|
19
|
+
globalTracer = trace.getTracer(TRACER_NAME, TRACER_VERSION);
|
|
20
|
+
}
|
|
21
|
+
return globalTracer;
|
|
22
|
+
}
|
|
3
23
|
|
|
4
24
|
/**
|
|
5
25
|
* The options associated with annotating a provider function and marking
|
package/core/src/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export * from './cache/cache.interface';
|
|
2
|
-
export * from './cache/redis-cache';
|
|
3
|
-
export * from './cache/memory-cache';
|
|
4
|
-
export * from './cache/noop-cache';
|
|
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
5
|
|
|
6
|
-
export * from './client/client';
|
|
7
|
-
export * from './client/client-builder';
|
|
6
|
+
export * from './client/client.js';
|
|
7
|
+
export * from './client/client-builder.js';
|
|
8
8
|
|
|
9
|
-
export * from './decorators/reactionary.decorator';
|
|
9
|
+
export * from './decorators/reactionary.decorator.js';
|
|
10
10
|
|
|
11
|
-
export * from './providers/'
|
|
11
|
+
export * from './providers/index.js'
|
|
12
12
|
|
|
13
|
-
export * from './schemas/capabilities.schema';
|
|
14
|
-
export * from './schemas/session.schema';
|
|
13
|
+
export * from './schemas/capabilities.schema.js';
|
|
14
|
+
export * from './schemas/session.schema.js';
|
|
15
15
|
|
|
16
|
-
export * from './schemas/models/';
|
|
17
|
-
export * from './schemas/mutations/';
|
|
18
|
-
export * from './schemas/queries';
|
|
19
|
-
export * from './initialization';
|
|
16
|
+
export * from './schemas/models/index.js';
|
|
17
|
+
export * from './schemas/mutations/index.js';
|
|
18
|
+
export * from './schemas/queries/index.js';
|
|
19
|
+
export * from './initialization.js';
|
|
@@ -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
|
|
|
4
4
|
export abstract class AnalyticsProvider<
|
|
5
5
|
T extends AnalyticsEvent = AnalyticsEvent
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type {
|
|
3
|
-
BaseModel} from '../schemas/models/base.model';
|
|
3
|
+
BaseModel} from '../schemas/models/base.model.js';
|
|
4
4
|
import {
|
|
5
5
|
createPaginatedResponseSchema,
|
|
6
|
-
} from '../schemas/models/base.model';
|
|
7
|
-
import type { Cache } from '../cache/cache.interface';
|
|
8
|
-
import type { RequestContext, Session } from '../schemas/session.schema';
|
|
9
|
-
import type { IdentifierType } from '../schemas/models/identifiers.model';
|
|
6
|
+
} from '../schemas/models/base.model.js';
|
|
7
|
+
import type { Cache } from '../cache/cache.interface.js';
|
|
8
|
+
import type { RequestContext, Session } from '../schemas/session.schema.js';
|
|
9
|
+
import type { IdentifierType } from '../schemas/models/identifiers.model.js';
|
|
10
10
|
import { hasher } from "node-object-hash";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -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
|
|
|
8
8
|
export abstract class CartProvider<
|
|
9
9
|
T extends Cart = Cart
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { CategoryIdentifier } from "../schemas/models/identifiers.model";
|
|
6
|
-
import type { CategoryQueryById, CategoryQueryBySlug, CategoryQueryForBreadcrumb, CategoryQueryForChildCategories, CategoryQueryForTopCategories } from "../schemas/queries/category.query";
|
|
7
|
-
import type { RequestContext} from "../schemas/session.schema";
|
|
8
|
-
import { Session } from "../schemas/session.schema";
|
|
9
|
-
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";
|
|
10
5
|
|
|
11
6
|
|
|
12
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
|
|
|
7
7
|
export abstract class CheckoutProvider<
|
|
8
8
|
T extends Checkout = Checkout
|
|
@@ -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
|
|
|
7
7
|
export abstract class IdentityProvider<
|
|
8
8
|
T extends Identity = Identity,
|
|
@@ -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
|
|
|
6
6
|
export abstract class InventoryProvider<
|
|
7
7
|
T extends Inventory = Inventory
|
|
@@ -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
|
|
|
6
6
|
export abstract class OrderProvider<
|
|
7
7
|
T extends Order = Order
|
|
@@ -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
|
|
|
7
7
|
export abstract class PriceProvider<
|
|
8
8
|
T extends Price = Price
|
|
@@ -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
|
|
|
6
6
|
export abstract class ProductProvider<
|
|
7
7
|
T extends Product = Product
|
|
@@ -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
|
|
|
7
7
|
export abstract class ProfileProvider<
|
|
8
8
|
T extends Profile = Profile
|
|
@@ -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
|
|
|
6
6
|
export abstract class SearchProvider<
|
|
7
7
|
T extends SearchResult = SearchResult
|
|
@@ -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
|
|
|
6
6
|
export abstract class StoreProvider<
|
|
7
7
|
T extends Store = Store
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CartIdentifierSchema, CartItemIdentifierSchema, IdentityIdentifierSchema, ProductIdentifierSchema, SKUIdentifierSchema } from '../models/identifiers.model';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { AddressSchema } from './profile.model';
|
|
6
|
-
import { ShippingMethodSchema } from './shipping-method.model';
|
|
7
|
-
import { CostBreakDownSchema, ItemCostBreakdownSchema } from './cost.model';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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';
|
|
11
5
|
|
|
12
6
|
export const CartItemSchema = z.looseObject({
|
|
13
7
|
identifier: CartItemIdentifierSchema.default(() => CartItemIdentifierSchema.parse({})),
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { BaseModelSchema, createPaginatedResponseSchema, ImageSchema } from './base.model';
|
|
10
|
-
import { CategoryIdentifierSchema } from './identifiers.model';
|
|
9
|
+
import { BaseModelSchema, createPaginatedResponseSchema, ImageSchema } from './base.model.js';
|
|
10
|
+
import { CategoryIdentifierSchema } from './identifiers.model.js';
|
|
11
11
|
export const CategorySchema = BaseModelSchema.extend({
|
|
12
12
|
identifier: CategoryIdentifierSchema.default(() => CategoryIdentifierSchema.parse({})),
|
|
13
13
|
name: z.string().default(''),
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { BaseModelSchema
|
|
5
|
-
import { CartIdentifierSchema, CheckoutIdentifierSchema, CheckoutItemIdentifierSchema,
|
|
6
|
-
import { CostBreakDownSchema, ItemCostBreakdownSchema } from './cost.model';
|
|
7
|
-
import { AddressSchema } from './profile.model';
|
|
8
|
-
import { ShippingInstructionSchema
|
|
9
|
-
import { PaymentInstructionSchema } from './payment.model';
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { BaseModelSchema } from './base.model.js';
|
|
5
|
+
import { CartIdentifierSchema, CheckoutIdentifierSchema, CheckoutItemIdentifierSchema, OrderIdentifierSchema, SKUIdentifierSchema } from './identifiers.model.js';
|
|
6
|
+
import { CostBreakDownSchema, ItemCostBreakdownSchema } from './cost.model.js';
|
|
7
|
+
import { AddressSchema } from './profile.model.js';
|
|
8
|
+
import { ShippingInstructionSchema } from './shipping-method.model.js';
|
|
9
|
+
import { PaymentInstructionSchema } from './payment.model.js';
|
|
12
10
|
|
|
13
11
|
export const CheckoutItemSchema = z.looseObject({
|
|
14
12
|
identifier: CheckoutItemIdentifierSchema.default(() => CheckoutItemIdentifierSchema.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
|
|
|
4
4
|
export const CostBreakDownSchema = z.looseObject({
|
|
5
5
|
totalTax: MonetaryAmountSchema.default(() => MonetaryAmountSchema.parse({})).describe('The amount of tax paid on the cart. This may include VAT, GST, sales tax, etc.'),
|
|
@@ -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
|
|
|
5
5
|
export const AnonymousIdentitySchema = BaseModelSchema.extend({
|
|
6
6
|
type: z.literal('Anonymous').default('Anonymous'),
|
|
@@ -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
|
|
|
5
5
|
export const InventorySchema = BaseModelSchema.extend({
|
|
6
6
|
identifier: InventoryIdentifierSchema.default(() => InventoryIdentifierSchema.parse({})),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CartIdentifierSchema, CartItemIdentifierSchema, IdentityIdentifierSchema,
|
|
3
|
-
import { BaseModelSchema } from './base.model';
|
|
4
|
-
import { AddressSchema } from './profile.model';
|
|
5
|
-
import { ShippingMethodSchema } from './shipping-method.model';
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
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';
|
|
9
8
|
|
|
10
9
|
export const OrderStatusSchema = z.enum(['AwaitingPayment', 'ReleasedToFulfillment', 'Shipped', 'Cancelled']).default('AwaitingPayment').describe('The current status of the order.');
|
|
11
10
|
export const OrderInventoryStatusSchema = z.enum(['NotAllocated', 'Allocated', 'Backordered', 'Preordered']).default('Allocated').describe('The inventory release status of the order.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { BaseModelSchema, ImageSchema } from './base.model';
|
|
3
|
-
import {
|
|
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
|
|
|
6
6
|
export const PaymentStatusSchema = z.enum(['pending', 'authorized', 'canceled', 'capture', 'partial_capture', 'refunded', 'partial_refund']);
|
|
7
7
|
|
|
@@ -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
|
|
|
6
6
|
export const MonetaryAmountSchema = z.looseObject({
|
|
7
7
|
value: z.number().default(0).describe('The monetary amount in decimal-precision.'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ProductIdentifierSchema, SKUIdentifierSchema } from './identifiers.model';
|
|
3
|
-
import { BaseModelSchema
|
|
2
|
+
import { ProductIdentifierSchema, SKUIdentifierSchema } from './identifiers.model.js';
|
|
3
|
+
import { BaseModelSchema } from './base.model.js';
|
|
4
4
|
|
|
5
5
|
export const SKUSchema = z.looseObject({
|
|
6
6
|
identifier: SKUIdentifierSchema.default(() => SKUIdentifierSchema.parse({})),
|
|
@@ -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
|
|
|
5
5
|
export const AddressSchema = BaseModelSchema.extend({
|
|
6
6
|
identifier: AddressIdentifierSchema.default(() => AddressIdentifierSchema.parse({})),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ProductIdentifierSchema, FacetValueIdentifierSchema, FacetIdentifierSchema, SearchIdentifierSchema } from './identifiers.model';
|
|
3
|
-
import { BaseModelSchema
|
|
4
|
-
import { create } from 'domain';
|
|
2
|
+
import { ProductIdentifierSchema, FacetValueIdentifierSchema, FacetIdentifierSchema, SearchIdentifierSchema } from './identifiers.model.js';
|
|
3
|
+
import { BaseModelSchema } from './base.model.js';
|
|
5
4
|
|
|
6
5
|
export const SearchResultProductSchema = z.looseObject({
|
|
7
6
|
identifier: ProductIdentifierSchema.default(ProductIdentifierSchema.parse({})),
|
|
@@ -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
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -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
|
|
|
5
5
|
export const StoreSchema = BaseModelSchema.extend({
|
|
6
6
|
identifier: StoreIdentifierSchema.default(() => StoreIdentifierSchema.parse({})),
|