@reactionary/core 0.0.58 → 0.0.60
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/initialization.js +1 -1
- package/package.json +1 -1
- package/providers/index.js +1 -1
- package/providers/price.provider.js +1 -1
- package/providers/{search.provider.js → product-search.provider.js} +2 -2
- package/providers/product.provider.js +8 -0
- package/schemas/capabilities.schema.js +1 -1
- package/schemas/models/base.model.js +2 -2
- package/schemas/models/cart.model.js +2 -2
- package/schemas/models/checkout.model.js +2 -2
- package/schemas/models/identifiers.model.js +29 -11
- package/schemas/models/index.js +1 -1
- package/schemas/models/order.model.js +2 -2
- package/schemas/models/product-search.model.js +37 -0
- package/schemas/models/product.model.js +51 -19
- package/schemas/mutations/analytics.mutation.js +3 -3
- package/schemas/mutations/cart.mutation.js +2 -2
- package/schemas/queries/index.js +1 -1
- package/schemas/queries/inventory.query.js +2 -2
- package/schemas/queries/price.query.js +2 -2
- package/schemas/queries/product-search.query.js +8 -0
- package/schemas/queries/product.query.js +8 -3
- package/src/client/client.d.ts +2 -2
- package/src/providers/index.d.ts +1 -1
- package/src/providers/product-search.provider.d.ts +35 -0
- package/src/providers/product.provider.d.ts +34 -1
- package/src/schemas/capabilities.schema.d.ts +1 -1
- package/src/schemas/models/cart.model.d.ts +4 -4
- package/src/schemas/models/checkout.model.d.ts +4 -4
- package/src/schemas/models/identifiers.model.d.ts +35 -12
- package/src/schemas/models/index.d.ts +1 -1
- package/src/schemas/models/inventory.model.d.ts +2 -2
- package/src/schemas/models/order.model.d.ts +4 -4
- package/src/schemas/models/price.model.d.ts +2 -2
- package/src/schemas/models/product-search.model.d.ts +184 -0
- package/src/schemas/models/product.model.d.ts +154 -14
- package/src/schemas/mutations/analytics.mutation.d.ts +24 -12
- package/src/schemas/mutations/cart.mutation.d.ts +2 -2
- package/src/schemas/queries/index.d.ts +1 -1
- package/src/schemas/queries/inventory.query.d.ts +3 -3
- package/src/schemas/queries/price.query.d.ts +2 -2
- package/src/schemas/queries/product-search.query.d.ts +18 -0
- package/src/schemas/queries/product.query.d.ts +12 -2
- package/schemas/models/search.model.js +0 -32
- package/schemas/queries/search.query.js +0 -8
- package/src/providers/search.provider.d.ts +0 -8
- package/src/schemas/models/search.model.d.ts +0 -87
- package/src/schemas/queries/search.query.d.ts +0 -15
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
export declare const ProductSearchQueryByTermSchema: z.ZodObject<{
|
|
3
|
+
search: z.ZodObject<{
|
|
4
|
+
term: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
5
|
+
facets: z.ZodNonOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
6
|
+
facet: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
7
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
8
|
+
}, z.core.$loose>>>;
|
|
9
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
10
|
+
}, z.core.$strip>>>>;
|
|
11
|
+
filters: z.ZodNonOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
12
|
+
paginationOptions: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
13
|
+
pageNumber: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
}, z.core.$loose>>>;
|
|
16
|
+
}, z.core.$loose>;
|
|
17
|
+
}, z.core.$loose>;
|
|
18
|
+
export type ProductSearchQueryByTerm = z.infer<typeof ProductSearchQueryByTermSchema>;
|
|
@@ -6,10 +6,20 @@ export declare const ProductQueryByIdSchema: z.ZodObject<{
|
|
|
6
6
|
id: z.ZodString;
|
|
7
7
|
}, z.core.$loose>;
|
|
8
8
|
export declare const ProductQueryBySKUSchema: z.ZodObject<{
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
variant: z.ZodDefault<z.ZodObject<{
|
|
10
|
+
sku: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
11
|
+
}, z.core.$loose>>;
|
|
12
|
+
}, z.core.$loose>;
|
|
13
|
+
export declare const ProductQueryVariantsSchema: z.ZodObject<{
|
|
14
|
+
parentId: z.ZodDefault<z.ZodObject<{
|
|
15
|
+
key: z.ZodDefault<z.ZodString>;
|
|
16
|
+
}, z.core.$loose>>;
|
|
17
|
+
paginationOptions: z.ZodDefault<z.ZodObject<{
|
|
18
|
+
pageNumber: z.ZodDefault<z.ZodNumber>;
|
|
19
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
11
20
|
}, z.core.$loose>>;
|
|
12
21
|
}, z.core.$loose>;
|
|
13
22
|
export type ProductQueryBySlug = z.infer<typeof ProductQueryBySlugSchema>;
|
|
14
23
|
export type ProductQueryById = z.infer<typeof ProductQueryByIdSchema>;
|
|
15
24
|
export type ProductQueryBySKU = z.infer<typeof ProductQueryBySKUSchema>;
|
|
25
|
+
export type ProductQueryVariants = z.infer<typeof ProductQueryVariantsSchema>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ProductIdentifierSchema, FacetValueIdentifierSchema, FacetIdentifierSchema, SearchIdentifierSchema } from "./identifiers.model.js";
|
|
3
|
-
import { BaseModelSchema } from "./base.model.js";
|
|
4
|
-
const SearchResultProductSchema = z.looseObject({
|
|
5
|
-
identifier: ProductIdentifierSchema.default(ProductIdentifierSchema.parse({})),
|
|
6
|
-
name: z.string().default(""),
|
|
7
|
-
image: z.string().url().default("https://placehold.co/400"),
|
|
8
|
-
slug: z.string().default("")
|
|
9
|
-
});
|
|
10
|
-
const SearchResultFacetValueSchema = z.looseObject({
|
|
11
|
-
identifier: FacetValueIdentifierSchema.default(() => FacetValueIdentifierSchema.parse({})),
|
|
12
|
-
name: z.string().default(""),
|
|
13
|
-
count: z.number().default(0),
|
|
14
|
-
active: z.boolean().default(false)
|
|
15
|
-
});
|
|
16
|
-
const SearchResultFacetSchema = z.looseObject({
|
|
17
|
-
identifier: FacetIdentifierSchema.default(() => FacetIdentifierSchema.parse({})),
|
|
18
|
-
name: z.string().default(""),
|
|
19
|
-
values: z.array(SearchResultFacetValueSchema).default(() => [])
|
|
20
|
-
});
|
|
21
|
-
const SearchResultSchema = BaseModelSchema.extend({
|
|
22
|
-
identifier: SearchIdentifierSchema.default(() => SearchIdentifierSchema.parse({})),
|
|
23
|
-
products: z.array(SearchResultProductSchema).default(() => []),
|
|
24
|
-
pages: z.number().default(0),
|
|
25
|
-
facets: z.array(SearchResultFacetSchema).default(() => [])
|
|
26
|
-
});
|
|
27
|
-
export {
|
|
28
|
-
SearchResultFacetSchema,
|
|
29
|
-
SearchResultFacetValueSchema,
|
|
30
|
-
SearchResultProductSchema,
|
|
31
|
-
SearchResultSchema
|
|
32
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseQuerySchema } from "./base.query.js";
|
|
2
|
-
import { SearchIdentifierSchema } from "../models/identifiers.model.js";
|
|
3
|
-
const SearchQueryByTermSchema = BaseQuerySchema.extend({
|
|
4
|
-
search: SearchIdentifierSchema.required()
|
|
5
|
-
});
|
|
6
|
-
export {
|
|
7
|
-
SearchQueryByTermSchema
|
|
8
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
export declare abstract class SearchProvider<T extends SearchResult = SearchResult> extends BaseProvider<T> {
|
|
6
|
-
abstract queryByTerm(payload: SearchQueryByTerm, reqCtx: RequestContext): Promise<SearchResult>;
|
|
7
|
-
protected getResourceName(): string;
|
|
8
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const SearchResultProductSchema: z.ZodObject<{
|
|
3
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
4
|
-
key: z.ZodDefault<z.ZodString>;
|
|
5
|
-
}, z.core.$loose>>;
|
|
6
|
-
name: z.ZodDefault<z.ZodString>;
|
|
7
|
-
image: z.ZodDefault<z.ZodString>;
|
|
8
|
-
slug: z.ZodDefault<z.ZodString>;
|
|
9
|
-
}, z.core.$loose>;
|
|
10
|
-
export declare const SearchResultFacetValueSchema: z.ZodObject<{
|
|
11
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
12
|
-
facet: z.ZodDefault<z.ZodObject<{
|
|
13
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
14
|
-
}, z.core.$loose>>;
|
|
15
|
-
key: z.ZodDefault<z.ZodString>;
|
|
16
|
-
}, z.core.$loose>>;
|
|
17
|
-
name: z.ZodDefault<z.ZodString>;
|
|
18
|
-
count: z.ZodDefault<z.ZodNumber>;
|
|
19
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
-
}, z.core.$loose>;
|
|
21
|
-
export declare const SearchResultFacetSchema: z.ZodObject<{
|
|
22
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
23
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
24
|
-
}, z.core.$loose>>;
|
|
25
|
-
name: z.ZodDefault<z.ZodString>;
|
|
26
|
-
values: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
27
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
28
|
-
facet: z.ZodDefault<z.ZodObject<{
|
|
29
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
30
|
-
}, z.core.$loose>>;
|
|
31
|
-
key: z.ZodDefault<z.ZodString>;
|
|
32
|
-
}, z.core.$loose>>;
|
|
33
|
-
name: z.ZodDefault<z.ZodString>;
|
|
34
|
-
count: z.ZodDefault<z.ZodNumber>;
|
|
35
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
-
}, z.core.$loose>>>;
|
|
37
|
-
}, z.core.$loose>;
|
|
38
|
-
export declare const SearchResultSchema: z.ZodObject<{
|
|
39
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
40
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
41
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
-
key: z.ZodDefault<z.ZodString>;
|
|
43
|
-
}, z.core.$loose>>;
|
|
44
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
-
}, z.core.$loose>>;
|
|
46
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
47
|
-
term: z.ZodDefault<z.ZodString>;
|
|
48
|
-
page: z.ZodDefault<z.ZodNumber>;
|
|
49
|
-
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
50
|
-
facets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
51
|
-
facet: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
52
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
53
|
-
}, z.core.$loose>>>;
|
|
54
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
55
|
-
}, z.core.$loose>>>;
|
|
56
|
-
}, z.core.$loose>>;
|
|
57
|
-
products: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
58
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
59
|
-
key: z.ZodDefault<z.ZodString>;
|
|
60
|
-
}, z.core.$loose>>;
|
|
61
|
-
name: z.ZodDefault<z.ZodString>;
|
|
62
|
-
image: z.ZodDefault<z.ZodString>;
|
|
63
|
-
slug: z.ZodDefault<z.ZodString>;
|
|
64
|
-
}, z.core.$loose>>>;
|
|
65
|
-
pages: z.ZodDefault<z.ZodNumber>;
|
|
66
|
-
facets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
67
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
68
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
69
|
-
}, z.core.$loose>>;
|
|
70
|
-
name: z.ZodDefault<z.ZodString>;
|
|
71
|
-
values: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
72
|
-
identifier: z.ZodDefault<z.ZodObject<{
|
|
73
|
-
facet: z.ZodDefault<z.ZodObject<{
|
|
74
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
75
|
-
}, z.core.$loose>>;
|
|
76
|
-
key: z.ZodDefault<z.ZodString>;
|
|
77
|
-
}, z.core.$loose>>;
|
|
78
|
-
name: z.ZodDefault<z.ZodString>;
|
|
79
|
-
count: z.ZodDefault<z.ZodNumber>;
|
|
80
|
-
active: z.ZodDefault<z.ZodBoolean>;
|
|
81
|
-
}, z.core.$loose>>>;
|
|
82
|
-
}, z.core.$loose>>>;
|
|
83
|
-
}, z.core.$loose>;
|
|
84
|
-
export type SearchResultProduct = z.infer<typeof SearchResultProductSchema>;
|
|
85
|
-
export type SearchResult = z.infer<typeof SearchResultSchema>;
|
|
86
|
-
export type SearchResultFacet = z.infer<typeof SearchResultFacetSchema>;
|
|
87
|
-
export type SearchResultFacetValue = z.infer<typeof SearchResultFacetValueSchema>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
export declare const SearchQueryByTermSchema: z.ZodObject<{
|
|
3
|
-
search: z.ZodObject<{
|
|
4
|
-
term: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
5
|
-
page: z.ZodNonOptional<z.ZodDefault<z.ZodNumber>>;
|
|
6
|
-
pageSize: z.ZodNonOptional<z.ZodDefault<z.ZodNumber>>;
|
|
7
|
-
facets: z.ZodNonOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
8
|
-
facet: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
9
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
10
|
-
}, z.core.$loose>>>;
|
|
11
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
12
|
-
}, z.core.$loose>>>>;
|
|
13
|
-
}, z.core.$loose>;
|
|
14
|
-
}, z.core.$loose>;
|
|
15
|
-
export type SearchQueryByTerm = z.infer<typeof SearchQueryByTermSchema>;
|