@reactionary/provider-algolia 0.0.39 → 0.0.41
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/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/provider-algolia",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@reactionary/core": "0.0.
|
|
7
|
+
"@reactionary/core": "0.0.41",
|
|
8
8
|
"algoliasearch": "^5.23.4",
|
|
9
|
-
"zod": "4.
|
|
9
|
+
"zod": "4.1.9"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const AlgoliaCapabilitiesSchema: z.
|
|
2
|
+
export declare const AlgoliaCapabilitiesSchema: z.ZodObject<{
|
|
3
3
|
analytics: z.ZodOptional<z.ZodBoolean>;
|
|
4
4
|
product: z.ZodOptional<z.ZodBoolean>;
|
|
5
5
|
search: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
-
},
|
|
7
|
-
optional: "analytics" | "product" | "search";
|
|
8
|
-
defaulted: never;
|
|
9
|
-
extra: Record<string, unknown>;
|
|
10
|
-
}>;
|
|
6
|
+
}, z.core.$loose>;
|
|
11
7
|
export type AlgoliaCapabilities = z.infer<typeof AlgoliaCapabilitiesSchema>;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const AlgoliaConfigurationSchema: z.
|
|
2
|
+
export declare const AlgoliaConfigurationSchema: z.ZodObject<{
|
|
3
3
|
appId: z.ZodString;
|
|
4
4
|
apiKey: z.ZodString;
|
|
5
5
|
indexName: z.ZodString;
|
|
6
|
-
},
|
|
7
|
-
optional: never;
|
|
8
|
-
defaulted: never;
|
|
9
|
-
extra: Record<string, unknown>;
|
|
10
|
-
}>;
|
|
6
|
+
}, z.core.$loose>;
|
|
11
7
|
export type AlgoliaConfiguration = z.infer<typeof AlgoliaConfigurationSchema>;
|
|
@@ -1,171 +1,64 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const AlgoliaSearchIdentifierSchema: z.
|
|
2
|
+
export declare const AlgoliaSearchIdentifierSchema: z.ZodObject<{
|
|
3
3
|
term: z.ZodDefault<z.ZodString>;
|
|
4
4
|
page: z.ZodDefault<z.ZodNumber>;
|
|
5
5
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
6
|
-
facets: z.ZodDefault<z.ZodArray<z.
|
|
7
|
-
|
|
8
|
-
facet: z.ZodNonOptional<z.ZodDefault<z.ZodInterface<{
|
|
6
|
+
facets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
7
|
+
facet: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
9
8
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
extra: Record<string, unknown>;
|
|
14
|
-
}>>>;
|
|
15
|
-
}, {
|
|
16
|
-
optional: never;
|
|
17
|
-
defaulted: never;
|
|
18
|
-
extra: Record<string, unknown>;
|
|
19
|
-
}>>>;
|
|
20
|
-
}, {
|
|
21
|
-
optional: never;
|
|
22
|
-
defaulted: never;
|
|
23
|
-
extra: Record<string, unknown>;
|
|
24
|
-
}>, z.ZodInterface<{
|
|
9
|
+
}, z.core.$loose>>>;
|
|
10
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
11
|
+
}, z.core.$loose>>>;
|
|
25
12
|
key: z.ZodDefault<z.ZodString>;
|
|
26
13
|
index: z.ZodDefault<z.ZodString>;
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}>>;
|
|
32
|
-
export declare const AlgoliaSearchResultSchema: z.MergeInterfaces<z.MergeInterfaces<z.ZodInterface<{
|
|
33
|
-
meta: z.ZodDefault<z.ZodInterface<{
|
|
34
|
-
cache: z.ZodDefault<z.ZodInterface<{
|
|
14
|
+
}, z.core.$loose>;
|
|
15
|
+
export declare const AlgoliaSearchResultSchema: z.ZodObject<{
|
|
16
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
17
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
35
18
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
36
19
|
key: z.ZodDefault<z.ZodString>;
|
|
37
|
-
},
|
|
38
|
-
optional: never;
|
|
39
|
-
defaulted: never;
|
|
40
|
-
extra: Record<string, unknown>;
|
|
41
|
-
}>>;
|
|
20
|
+
}, z.core.$loose>>;
|
|
42
21
|
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
extra: Record<string, unknown>;
|
|
47
|
-
}>>;
|
|
48
|
-
}, {
|
|
49
|
-
optional: never;
|
|
50
|
-
defaulted: never;
|
|
51
|
-
extra: Record<string, unknown>;
|
|
52
|
-
}>, z.ZodInterface<{
|
|
53
|
-
identifier: z.ZodDefault<z.ZodInterface<{
|
|
54
|
-
term: z.ZodDefault<z.ZodString>;
|
|
55
|
-
page: z.ZodDefault<z.ZodNumber>;
|
|
56
|
-
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
57
|
-
facets: z.ZodDefault<z.ZodArray<z.ZodInterface<{
|
|
58
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
59
|
-
facet: z.ZodNonOptional<z.ZodDefault<z.ZodInterface<{
|
|
60
|
-
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
61
|
-
}, {
|
|
62
|
-
optional: never;
|
|
63
|
-
defaulted: never;
|
|
64
|
-
extra: Record<string, unknown>;
|
|
65
|
-
}>>>;
|
|
66
|
-
}, {
|
|
67
|
-
optional: never;
|
|
68
|
-
defaulted: never;
|
|
69
|
-
extra: Record<string, unknown>;
|
|
70
|
-
}>>>;
|
|
71
|
-
}, {
|
|
72
|
-
optional: never;
|
|
73
|
-
defaulted: never;
|
|
74
|
-
extra: Record<string, unknown>;
|
|
75
|
-
}>>;
|
|
76
|
-
products: z.ZodDefault<z.ZodArray<z.ZodInterface<{
|
|
77
|
-
identifier: z.ZodDefault<z.ZodInterface<{
|
|
22
|
+
}, z.core.$loose>>;
|
|
23
|
+
products: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
24
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
78
25
|
key: z.ZodDefault<z.ZodString>;
|
|
79
|
-
},
|
|
80
|
-
optional: never;
|
|
81
|
-
defaulted: never;
|
|
82
|
-
extra: Record<string, unknown>;
|
|
83
|
-
}>>;
|
|
26
|
+
}, z.core.$loose>>;
|
|
84
27
|
name: z.ZodDefault<z.ZodString>;
|
|
85
28
|
image: z.ZodDefault<z.ZodString>;
|
|
86
29
|
slug: z.ZodDefault<z.ZodString>;
|
|
87
|
-
},
|
|
88
|
-
optional: never;
|
|
89
|
-
defaulted: never;
|
|
90
|
-
extra: Record<string, unknown>;
|
|
91
|
-
}>>>;
|
|
30
|
+
}, z.core.$loose>>>;
|
|
92
31
|
pages: z.ZodDefault<z.ZodNumber>;
|
|
93
|
-
facets: z.ZodDefault<z.ZodArray<z.
|
|
94
|
-
identifier: z.ZodDefault<z.
|
|
32
|
+
facets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
95
34
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
96
|
-
},
|
|
97
|
-
optional: never;
|
|
98
|
-
defaulted: never;
|
|
99
|
-
extra: Record<string, unknown>;
|
|
100
|
-
}>>;
|
|
35
|
+
}, z.core.$loose>>;
|
|
101
36
|
name: z.ZodDefault<z.ZodString>;
|
|
102
|
-
values: z.ZodDefault<z.ZodArray<z.
|
|
103
|
-
identifier: z.ZodDefault<z.
|
|
104
|
-
facet: z.ZodDefault<z.
|
|
37
|
+
values: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
38
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
39
|
+
facet: z.ZodDefault<z.ZodObject<{
|
|
105
40
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
106
|
-
},
|
|
107
|
-
optional: never;
|
|
108
|
-
defaulted: never;
|
|
109
|
-
extra: Record<string, unknown>;
|
|
110
|
-
}>>;
|
|
41
|
+
}, z.core.$loose>>;
|
|
111
42
|
key: z.ZodDefault<z.ZodString>;
|
|
112
|
-
},
|
|
113
|
-
optional: never;
|
|
114
|
-
defaulted: never;
|
|
115
|
-
extra: Record<string, unknown>;
|
|
116
|
-
}>>;
|
|
43
|
+
}, z.core.$loose>>;
|
|
117
44
|
name: z.ZodDefault<z.ZodString>;
|
|
118
45
|
count: z.ZodDefault<z.ZodNumber>;
|
|
119
46
|
active: z.ZodDefault<z.ZodBoolean>;
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
extra: Record<string, unknown>;
|
|
124
|
-
}>>>;
|
|
125
|
-
}, {
|
|
126
|
-
optional: never;
|
|
127
|
-
defaulted: never;
|
|
128
|
-
extra: Record<string, unknown>;
|
|
129
|
-
}>>>;
|
|
130
|
-
}, {
|
|
131
|
-
optional: never;
|
|
132
|
-
defaulted: never;
|
|
133
|
-
extra: {};
|
|
134
|
-
}>>, z.ZodInterface<{
|
|
135
|
-
identifier: z.ZodDefault<z.MergeInterfaces<z.ZodInterface<{
|
|
47
|
+
}, z.core.$loose>>>;
|
|
48
|
+
}, z.core.$loose>>>;
|
|
49
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
136
50
|
term: z.ZodDefault<z.ZodString>;
|
|
137
51
|
page: z.ZodDefault<z.ZodNumber>;
|
|
138
52
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
139
|
-
facets: z.ZodDefault<z.ZodArray<z.
|
|
140
|
-
|
|
141
|
-
facet: z.ZodNonOptional<z.ZodDefault<z.ZodInterface<{
|
|
53
|
+
facets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
54
|
+
facet: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
142
55
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
extra: Record<string, unknown>;
|
|
147
|
-
}>>>;
|
|
148
|
-
}, {
|
|
149
|
-
optional: never;
|
|
150
|
-
defaulted: never;
|
|
151
|
-
extra: Record<string, unknown>;
|
|
152
|
-
}>>>;
|
|
153
|
-
}, {
|
|
154
|
-
optional: never;
|
|
155
|
-
defaulted: never;
|
|
156
|
-
extra: Record<string, unknown>;
|
|
157
|
-
}>, z.ZodInterface<{
|
|
56
|
+
}, z.core.$loose>>>;
|
|
57
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
58
|
+
}, z.core.$loose>>>;
|
|
158
59
|
key: z.ZodDefault<z.ZodString>;
|
|
159
60
|
index: z.ZodDefault<z.ZodString>;
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
defaulted: never;
|
|
163
|
-
extra: {};
|
|
164
|
-
}>>>;
|
|
165
|
-
}, {
|
|
166
|
-
optional: never;
|
|
167
|
-
defaulted: never;
|
|
168
|
-
extra: {};
|
|
169
|
-
}>>;
|
|
61
|
+
}, z.core.$loose>>;
|
|
62
|
+
}, z.core.$loose>;
|
|
170
63
|
export type AlgoliaSearchResult = z.infer<typeof AlgoliaSearchResultSchema>;
|
|
171
64
|
export type AlgoliaSearchIdentifier = z.infer<typeof AlgoliaSearchIdentifierSchema>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function createAnonymousTestSession() {
|
|
2
|
+
return {
|
|
3
|
+
id: "test-session-id",
|
|
4
|
+
identity: {
|
|
5
|
+
type: "Anonymous",
|
|
6
|
+
meta: {
|
|
7
|
+
cache: { hit: false, key: "" },
|
|
8
|
+
placeholder: false
|
|
9
|
+
},
|
|
10
|
+
id: "",
|
|
11
|
+
token: void 0,
|
|
12
|
+
issued: /* @__PURE__ */ new Date(),
|
|
13
|
+
expiry: new Date((/* @__PURE__ */ new Date()).getTime() + 3600 * 1e3)
|
|
14
|
+
// 1 hour from now
|
|
15
|
+
},
|
|
16
|
+
languageContext: {
|
|
17
|
+
locale: "en-US",
|
|
18
|
+
currencyCode: "USD",
|
|
19
|
+
countryCode: "US"
|
|
20
|
+
},
|
|
21
|
+
storeIdentifier: {
|
|
22
|
+
key: "the-good-store"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
createAnonymousTestSession
|
|
28
|
+
};
|