@voyant-travel/auth 0.139.0 → 0.140.0
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/dist/storefront-admin-contracts.d.ts +218 -0
- package/dist/storefront-admin-contracts.js +111 -0
- package/dist/storefront-admin-contracts.js.map +1 -0
- package/dist/storefront-graph-runtime.d.ts +20 -0
- package/dist/storefront-graph-runtime.js +17 -0
- package/dist/storefront-graph-runtime.js.map +1 -0
- package/dist/storefront-routes.d.ts +18 -0
- package/dist/storefront-routes.js +282 -0
- package/dist/storefront-routes.js.map +1 -0
- package/dist/tsconfig.typecheck.tsbuildinfo +1 -0
- package/dist/voyant.js +78 -2
- package/dist/voyant.js.map +1 -1
- package/openapi/admin/storefronts.json +133 -0
- package/package.json +12 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storefront admin API contracts (provider-neutral, pure zod).
|
|
3
|
+
*
|
|
4
|
+
* These mirror the DTOs on {@link storefrontRuntimePort} without importing the
|
|
5
|
+
* DB schema, so the admin React client can validate responses and request
|
|
6
|
+
* bodies without pulling server-only modules into the browser bundle. The
|
|
7
|
+
* literal unions are kept in lockstep with the persisted schema; the runtime
|
|
8
|
+
* adapter re-normalizes every write, so these are the transport contract only.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
export declare const storefrontHostingKindSchema: z.ZodEnum<{
|
|
12
|
+
external: "external";
|
|
13
|
+
cloud_site: "cloud_site";
|
|
14
|
+
}>;
|
|
15
|
+
export declare const storefrontApiKeyKindSchema: z.ZodEnum<{
|
|
16
|
+
secret: "secret";
|
|
17
|
+
publishable: "publishable";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const storefrontSocialProviderSchema: z.ZodEnum<{
|
|
20
|
+
apple: "apple";
|
|
21
|
+
facebook: "facebook";
|
|
22
|
+
google: "google";
|
|
23
|
+
}>;
|
|
24
|
+
export declare const storefrontCustomerAuthMethodsSchema: z.ZodObject<{
|
|
25
|
+
emailCode: z.ZodBoolean;
|
|
26
|
+
emailPassword: z.ZodBoolean;
|
|
27
|
+
google: z.ZodBoolean;
|
|
28
|
+
facebook: z.ZodBoolean;
|
|
29
|
+
apple: z.ZodBoolean;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export declare const storefrontCustomerAccountPolicySchema: z.ZodObject<{
|
|
32
|
+
allowedKinds: z.ZodArray<z.ZodEnum<{
|
|
33
|
+
personal: "personal";
|
|
34
|
+
business: "business";
|
|
35
|
+
}>>;
|
|
36
|
+
personalSignup: z.ZodEnum<{
|
|
37
|
+
open: "open";
|
|
38
|
+
disabled: "disabled";
|
|
39
|
+
}>;
|
|
40
|
+
businessOnboarding: z.ZodEnum<{
|
|
41
|
+
open: "open";
|
|
42
|
+
disabled: "disabled";
|
|
43
|
+
request: "request";
|
|
44
|
+
"invite-only": "invite-only";
|
|
45
|
+
}>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export declare const storefrontSchema: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
organizationId: z.ZodString;
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
slug: z.ZodString;
|
|
52
|
+
hostingKind: z.ZodEnum<{
|
|
53
|
+
external: "external";
|
|
54
|
+
cloud_site: "cloud_site";
|
|
55
|
+
}>;
|
|
56
|
+
siteId: z.ZodNullable<z.ZodString>;
|
|
57
|
+
allowedOrigins: z.ZodArray<z.ZodString>;
|
|
58
|
+
methods: z.ZodObject<{
|
|
59
|
+
emailCode: z.ZodBoolean;
|
|
60
|
+
emailPassword: z.ZodBoolean;
|
|
61
|
+
google: z.ZodBoolean;
|
|
62
|
+
facebook: z.ZodBoolean;
|
|
63
|
+
apple: z.ZodBoolean;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
accountPolicy: z.ZodObject<{
|
|
66
|
+
allowedKinds: z.ZodArray<z.ZodEnum<{
|
|
67
|
+
personal: "personal";
|
|
68
|
+
business: "business";
|
|
69
|
+
}>>;
|
|
70
|
+
personalSignup: z.ZodEnum<{
|
|
71
|
+
open: "open";
|
|
72
|
+
disabled: "disabled";
|
|
73
|
+
}>;
|
|
74
|
+
businessOnboarding: z.ZodEnum<{
|
|
75
|
+
open: "open";
|
|
76
|
+
disabled: "disabled";
|
|
77
|
+
request: "request";
|
|
78
|
+
"invite-only": "invite-only";
|
|
79
|
+
}>;
|
|
80
|
+
}, z.core.$strict>;
|
|
81
|
+
hostOnlyCookies: z.ZodBoolean;
|
|
82
|
+
createdAt: z.ZodString;
|
|
83
|
+
updatedAt: z.ZodString;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
export declare const storefrontApiKeySchema: z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
storefrontId: z.ZodString;
|
|
88
|
+
kind: z.ZodEnum<{
|
|
89
|
+
secret: "secret";
|
|
90
|
+
publishable: "publishable";
|
|
91
|
+
}>;
|
|
92
|
+
tokenPreview: z.ZodString;
|
|
93
|
+
name: z.ZodNullable<z.ZodString>;
|
|
94
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
95
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
96
|
+
createdAt: z.ZodString;
|
|
97
|
+
}, z.core.$strict>;
|
|
98
|
+
/** Issuance/rotation payload: the plaintext token is present exactly once. */
|
|
99
|
+
export declare const issuedStorefrontApiKeySchema: z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
storefrontId: z.ZodString;
|
|
102
|
+
kind: z.ZodEnum<{
|
|
103
|
+
secret: "secret";
|
|
104
|
+
publishable: "publishable";
|
|
105
|
+
}>;
|
|
106
|
+
tokenPreview: z.ZodString;
|
|
107
|
+
name: z.ZodNullable<z.ZodString>;
|
|
108
|
+
lastUsedAt: z.ZodNullable<z.ZodString>;
|
|
109
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
110
|
+
createdAt: z.ZodString;
|
|
111
|
+
token: z.ZodString;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
export declare const storefrontProviderCredentialStatusSchema: z.ZodObject<{
|
|
114
|
+
provider: z.ZodEnum<{
|
|
115
|
+
apple: "apple";
|
|
116
|
+
facebook: "facebook";
|
|
117
|
+
google: "google";
|
|
118
|
+
}>;
|
|
119
|
+
configured: z.ZodBoolean;
|
|
120
|
+
updatedAt: z.ZodNullable<z.ZodString>;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
/**
|
|
123
|
+
* Operator-facing capability signal. `businessAccounts` reflects whether the
|
|
124
|
+
* deployment wires the customer business-account onboarding runtime; the
|
|
125
|
+
* business buyer-account controls are disabled when it is false.
|
|
126
|
+
*/
|
|
127
|
+
export declare const storefrontAdminCapabilitiesSchema: z.ZodObject<{
|
|
128
|
+
businessAccounts: z.ZodBoolean;
|
|
129
|
+
manageProviders: z.ZodBoolean;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
export declare const createStorefrontInputSchema: z.ZodObject<{
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
slug: z.ZodString;
|
|
134
|
+
hostingKind: z.ZodEnum<{
|
|
135
|
+
external: "external";
|
|
136
|
+
cloud_site: "cloud_site";
|
|
137
|
+
}>;
|
|
138
|
+
siteId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
140
|
+
methods: z.ZodObject<{
|
|
141
|
+
emailCode: z.ZodBoolean;
|
|
142
|
+
emailPassword: z.ZodBoolean;
|
|
143
|
+
google: z.ZodBoolean;
|
|
144
|
+
facebook: z.ZodBoolean;
|
|
145
|
+
apple: z.ZodBoolean;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
accountPolicy: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
allowedKinds: z.ZodArray<z.ZodEnum<{
|
|
149
|
+
personal: "personal";
|
|
150
|
+
business: "business";
|
|
151
|
+
}>>;
|
|
152
|
+
personalSignup: z.ZodEnum<{
|
|
153
|
+
open: "open";
|
|
154
|
+
disabled: "disabled";
|
|
155
|
+
}>;
|
|
156
|
+
businessOnboarding: z.ZodEnum<{
|
|
157
|
+
open: "open";
|
|
158
|
+
disabled: "disabled";
|
|
159
|
+
request: "request";
|
|
160
|
+
"invite-only": "invite-only";
|
|
161
|
+
}>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
export declare const updateStorefrontInputSchema: z.ZodObject<{
|
|
165
|
+
name: z.ZodString;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
export declare const setStorefrontAllowedOriginsInputSchema: z.ZodObject<{
|
|
168
|
+
origins: z.ZodArray<z.ZodString>;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
export declare const issueStorefrontApiKeyInputSchema: z.ZodObject<{
|
|
171
|
+
kind: z.ZodEnum<{
|
|
172
|
+
secret: "secret";
|
|
173
|
+
publishable: "publishable";
|
|
174
|
+
}>;
|
|
175
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
export declare const updateStorefrontAccountPolicyInputSchema: z.ZodObject<{
|
|
178
|
+
allowedKinds: z.ZodArray<z.ZodEnum<{
|
|
179
|
+
personal: "personal";
|
|
180
|
+
business: "business";
|
|
181
|
+
}>>;
|
|
182
|
+
personalSignup: z.ZodEnum<{
|
|
183
|
+
open: "open";
|
|
184
|
+
disabled: "disabled";
|
|
185
|
+
}>;
|
|
186
|
+
businessOnboarding: z.ZodEnum<{
|
|
187
|
+
open: "open";
|
|
188
|
+
disabled: "disabled";
|
|
189
|
+
request: "request";
|
|
190
|
+
"invite-only": "invite-only";
|
|
191
|
+
}>;
|
|
192
|
+
}, z.core.$strict>;
|
|
193
|
+
export declare const updateStorefrontMethodsInputSchema: z.ZodObject<{
|
|
194
|
+
emailCode: z.ZodBoolean;
|
|
195
|
+
emailPassword: z.ZodBoolean;
|
|
196
|
+
google: z.ZodBoolean;
|
|
197
|
+
facebook: z.ZodBoolean;
|
|
198
|
+
apple: z.ZodBoolean;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
export declare const putStorefrontProviderCredentialInputSchema: z.ZodObject<{
|
|
201
|
+
clientId: z.ZodString;
|
|
202
|
+
clientSecret: z.ZodString;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
export type StorefrontHostingKind = z.infer<typeof storefrontHostingKindSchema>;
|
|
205
|
+
export type StorefrontApiKeyKind = z.infer<typeof storefrontApiKeyKindSchema>;
|
|
206
|
+
export type StorefrontSocialProvider = z.infer<typeof storefrontSocialProviderSchema>;
|
|
207
|
+
export type StorefrontCustomerAuthMethods = z.infer<typeof storefrontCustomerAuthMethodsSchema>;
|
|
208
|
+
export type StorefrontCustomerAccountPolicy = z.infer<typeof storefrontCustomerAccountPolicySchema>;
|
|
209
|
+
export type StorefrontDto = z.infer<typeof storefrontSchema>;
|
|
210
|
+
export type StorefrontApiKeyDto = z.infer<typeof storefrontApiKeySchema>;
|
|
211
|
+
export type IssuedStorefrontApiKeyDto = z.infer<typeof issuedStorefrontApiKeySchema>;
|
|
212
|
+
export type StorefrontProviderCredentialStatusDto = z.infer<typeof storefrontProviderCredentialStatusSchema>;
|
|
213
|
+
export type StorefrontAdminCapabilitiesDto = z.infer<typeof storefrontAdminCapabilitiesSchema>;
|
|
214
|
+
export type CreateStorefrontInput = z.infer<typeof createStorefrontInputSchema>;
|
|
215
|
+
export type UpdateStorefrontInput = z.infer<typeof updateStorefrontInputSchema>;
|
|
216
|
+
export type SetStorefrontAllowedOriginsInput = z.infer<typeof setStorefrontAllowedOriginsInputSchema>;
|
|
217
|
+
export type IssueStorefrontApiKeyInput = z.infer<typeof issueStorefrontApiKeyInputSchema>;
|
|
218
|
+
export type PutStorefrontProviderCredentialInput = z.infer<typeof putStorefrontProviderCredentialInputSchema>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storefront admin API contracts (provider-neutral, pure zod).
|
|
3
|
+
*
|
|
4
|
+
* These mirror the DTOs on {@link storefrontRuntimePort} without importing the
|
|
5
|
+
* DB schema, so the admin React client can validate responses and request
|
|
6
|
+
* bodies without pulling server-only modules into the browser bundle. The
|
|
7
|
+
* literal unions are kept in lockstep with the persisted schema; the runtime
|
|
8
|
+
* adapter re-normalizes every write, so these are the transport contract only.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
export const storefrontHostingKindSchema = z.enum(["cloud_site", "external"]);
|
|
12
|
+
export const storefrontApiKeyKindSchema = z.enum(["publishable", "secret"]);
|
|
13
|
+
export const storefrontSocialProviderSchema = z.enum(["google", "facebook", "apple"]);
|
|
14
|
+
export const storefrontCustomerAuthMethodsSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
emailCode: z.boolean(),
|
|
17
|
+
emailPassword: z.boolean(),
|
|
18
|
+
google: z.boolean(),
|
|
19
|
+
facebook: z.boolean(),
|
|
20
|
+
apple: z.boolean(),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
export const storefrontCustomerAccountPolicySchema = z
|
|
24
|
+
.object({
|
|
25
|
+
allowedKinds: z.array(z.enum(["personal", "business"])).min(1),
|
|
26
|
+
personalSignup: z.enum(["open", "disabled"]),
|
|
27
|
+
businessOnboarding: z.enum(["disabled", "open", "request", "invite-only"]),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
export const storefrontSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
id: z.string(),
|
|
33
|
+
organizationId: z.string(),
|
|
34
|
+
name: z.string(),
|
|
35
|
+
slug: z.string(),
|
|
36
|
+
hostingKind: storefrontHostingKindSchema,
|
|
37
|
+
siteId: z.string().nullable(),
|
|
38
|
+
allowedOrigins: z.array(z.string()),
|
|
39
|
+
methods: storefrontCustomerAuthMethodsSchema,
|
|
40
|
+
accountPolicy: storefrontCustomerAccountPolicySchema,
|
|
41
|
+
hostOnlyCookies: z.boolean(),
|
|
42
|
+
createdAt: z.string(),
|
|
43
|
+
updatedAt: z.string(),
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
export const storefrontApiKeySchema = z
|
|
47
|
+
.object({
|
|
48
|
+
id: z.string(),
|
|
49
|
+
storefrontId: z.string(),
|
|
50
|
+
kind: storefrontApiKeyKindSchema,
|
|
51
|
+
tokenPreview: z.string(),
|
|
52
|
+
name: z.string().nullable(),
|
|
53
|
+
lastUsedAt: z.string().nullable(),
|
|
54
|
+
revokedAt: z.string().nullable(),
|
|
55
|
+
createdAt: z.string(),
|
|
56
|
+
})
|
|
57
|
+
.strict();
|
|
58
|
+
/** Issuance/rotation payload: the plaintext token is present exactly once. */
|
|
59
|
+
export const issuedStorefrontApiKeySchema = storefrontApiKeySchema
|
|
60
|
+
.extend({ token: z.string() })
|
|
61
|
+
.strict();
|
|
62
|
+
export const storefrontProviderCredentialStatusSchema = z
|
|
63
|
+
.object({
|
|
64
|
+
provider: storefrontSocialProviderSchema,
|
|
65
|
+
configured: z.boolean(),
|
|
66
|
+
updatedAt: z.string().nullable(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
/**
|
|
70
|
+
* Operator-facing capability signal. `businessAccounts` reflects whether the
|
|
71
|
+
* deployment wires the customer business-account onboarding runtime; the
|
|
72
|
+
* business buyer-account controls are disabled when it is false.
|
|
73
|
+
*/
|
|
74
|
+
export const storefrontAdminCapabilitiesSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
businessAccounts: z.boolean(),
|
|
77
|
+
manageProviders: z.boolean(),
|
|
78
|
+
})
|
|
79
|
+
.strict();
|
|
80
|
+
export const createStorefrontInputSchema = z
|
|
81
|
+
.object({
|
|
82
|
+
name: z.string().trim().min(1).max(200),
|
|
83
|
+
slug: z.string().trim().min(1).max(120),
|
|
84
|
+
hostingKind: storefrontHostingKindSchema,
|
|
85
|
+
siteId: z.string().trim().min(1).nullable().optional(),
|
|
86
|
+
allowedOrigins: z.array(z.string().trim().min(1)).default([]),
|
|
87
|
+
methods: storefrontCustomerAuthMethodsSchema,
|
|
88
|
+
accountPolicy: storefrontCustomerAccountPolicySchema.optional(),
|
|
89
|
+
})
|
|
90
|
+
.strict();
|
|
91
|
+
export const updateStorefrontInputSchema = z
|
|
92
|
+
.object({ name: z.string().trim().min(1).max(200) })
|
|
93
|
+
.strict();
|
|
94
|
+
export const setStorefrontAllowedOriginsInputSchema = z
|
|
95
|
+
.object({ origins: z.array(z.string().trim().min(1)) })
|
|
96
|
+
.strict();
|
|
97
|
+
export const issueStorefrontApiKeyInputSchema = z
|
|
98
|
+
.object({
|
|
99
|
+
kind: storefrontApiKeyKindSchema,
|
|
100
|
+
name: z.string().trim().min(1).max(200).nullable().optional(),
|
|
101
|
+
})
|
|
102
|
+
.strict();
|
|
103
|
+
export const updateStorefrontAccountPolicyInputSchema = storefrontCustomerAccountPolicySchema;
|
|
104
|
+
export const updateStorefrontMethodsInputSchema = storefrontCustomerAuthMethodsSchema;
|
|
105
|
+
export const putStorefrontProviderCredentialInputSchema = z
|
|
106
|
+
.object({
|
|
107
|
+
clientId: z.string().trim().min(1).max(16_384),
|
|
108
|
+
clientSecret: z.string().trim().min(1).max(16_384),
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
//# sourceMappingURL=storefront-admin-contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefront-admin-contracts.js","sourceRoot":"","sources":["../src/storefront-admin-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAA;AAC7E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,Q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CAAA;AAEX,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC9D,CAAC;KACD,MAAM,EAAE,CAAA;AAEX,MAAM,CAAC,MAAM,wCAAwC,GAAG,qCAAqC,CAAA;AAC7F,MAAM,CAAC,MAAM,kCAAkC,GAAG,mCAAmC,CAAA;AAErF,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC;KACxD,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;IAC9C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;CACnD,CAAC;KACD,MAAM,EAAE,CAAA","sourcesContent":["/**\n * Storefront admin API contracts (provider-neutral, pure zod).\n *\n * These mirror the DTOs on {@link storefrontRuntimePort} without importing the\n * DB schema, so the admin React client can validate responses and request\n * bodies without pulling server-only modules into the browser bundle. The\n * literal unions are kept in lockstep with the persisted schema; the runtime\n * adapter re-normalizes every write, so these are the transport contract only.\n */\nimport { z } from \"zod\"\n\nexport const storefrontHostingKindSchema = z.enum([\"cloud_site\", \"external\"])\nexport const storefrontApiKeyKindSchema = z.enum([\"publishable\", \"secret\"])\nexport const storefrontSocialProviderSchema = z.enum([\"google\", \"facebook\", \"apple\"])\n\nexport const storefrontCustomerAuthMethodsSchema = z\n .object({\n emailCode: z.boolean(),\n emailPassword: z.boolean(),\n google: z.boolean(),\n facebook: z.boolean(),\n apple: z.boolean(),\n })\n .strict()\n\nexport const storefrontCustomerAccountPolicySchema = z\n .object({\n allowedKinds: z.array(z.enum([\"personal\", \"business\"])).min(1),\n personalSignup: z.enum([\"open\", \"disabled\"]),\n businessOnboarding: z.enum([\"disabled\", \"open\", \"request\", \"invite-only\"]),\n })\n .strict()\n\nexport const storefrontSchema = z\n .object({\n id: z.string(),\n organizationId: z.string(),\n name: z.string(),\n slug: z.string(),\n hostingKind: storefrontHostingKindSchema,\n siteId: z.string().nullable(),\n allowedOrigins: z.array(z.string()),\n methods: storefrontCustomerAuthMethodsSchema,\n accountPolicy: storefrontCustomerAccountPolicySchema,\n hostOnlyCookies: z.boolean(),\n createdAt: z.string(),\n updatedAt: z.string(),\n })\n .strict()\n\nexport const storefrontApiKeySchema = z\n .object({\n id: z.string(),\n storefrontId: z.string(),\n kind: storefrontApiKeyKindSchema,\n tokenPreview: z.string(),\n name: z.string().nullable(),\n lastUsedAt: z.string().nullable(),\n revokedAt: z.string().nullable(),\n createdAt: z.string(),\n })\n .strict()\n\n/** Issuance/rotation payload: the plaintext token is present exactly once. */\nexport const issuedStorefrontApiKeySchema = storefrontApiKeySchema\n .extend({ token: z.string() })\n .strict()\n\nexport const storefrontProviderCredentialStatusSchema = z\n .object({\n provider: storefrontSocialProviderSchema,\n configured: z.boolean(),\n updatedAt: z.string().nullable(),\n })\n .strict()\n\n/**\n * Operator-facing capability signal. `businessAccounts` reflects whether the\n * deployment wires the customer business-account onboarding runtime; the\n * business buyer-account controls are disabled when it is false.\n */\nexport const storefrontAdminCapabilitiesSchema = z\n .object({\n businessAccounts: z.boolean(),\n manageProviders: z.boolean(),\n })\n .strict()\n\nexport const createStorefrontInputSchema = z\n .object({\n name: z.string().trim().min(1).max(200),\n slug: z.string().trim().min(1).max(120),\n hostingKind: storefrontHostingKindSchema,\n siteId: z.string().trim().min(1).nullable().optional(),\n allowedOrigins: z.array(z.string().trim().min(1)).default([]),\n methods: storefrontCustomerAuthMethodsSchema,\n accountPolicy: storefrontCustomerAccountPolicySchema.optional(),\n })\n .strict()\n\nexport const updateStorefrontInputSchema = z\n .object({ name: z.string().trim().min(1).max(200) })\n .strict()\n\nexport const setStorefrontAllowedOriginsInputSchema = z\n .object({ origins: z.array(z.string().trim().min(1)) })\n .strict()\n\nexport const issueStorefrontApiKeyInputSchema = z\n .object({\n kind: storefrontApiKeyKindSchema,\n name: z.string().trim().min(1).max(200).nullable().optional(),\n })\n .strict()\n\nexport const updateStorefrontAccountPolicyInputSchema = storefrontCustomerAccountPolicySchema\nexport const updateStorefrontMethodsInputSchema = storefrontCustomerAuthMethodsSchema\n\nexport const putStorefrontProviderCredentialInputSchema = z\n .object({\n clientId: z.string().trim().min(1).max(16_384),\n clientSecret: z.string().trim().min(1).max(16_384),\n })\n .strict()\n\nexport type StorefrontHostingKind = z.infer<typeof storefrontHostingKindSchema>\nexport type StorefrontApiKeyKind = z.infer<typeof storefrontApiKeyKindSchema>\nexport type StorefrontSocialProvider = z.infer<typeof storefrontSocialProviderSchema>\nexport type StorefrontCustomerAuthMethods = z.infer<typeof storefrontCustomerAuthMethodsSchema>\nexport type StorefrontCustomerAccountPolicy = z.infer<typeof storefrontCustomerAccountPolicySchema>\nexport type StorefrontDto = z.infer<typeof storefrontSchema>\nexport type StorefrontApiKeyDto = z.infer<typeof storefrontApiKeySchema>\nexport type IssuedStorefrontApiKeyDto = z.infer<typeof issuedStorefrontApiKeySchema>\nexport type StorefrontProviderCredentialStatusDto = z.infer<\n typeof storefrontProviderCredentialStatusSchema\n>\nexport type StorefrontAdminCapabilitiesDto = z.infer<typeof storefrontAdminCapabilitiesSchema>\nexport type CreateStorefrontInput = z.infer<typeof createStorefrontInputSchema>\nexport type UpdateStorefrontInput = z.infer<typeof updateStorefrontInputSchema>\nexport type SetStorefrontAllowedOriginsInput = z.infer<\n typeof setStorefrontAllowedOriginsInputSchema\n>\nexport type IssueStorefrontApiKeyInput = z.infer<typeof issueStorefrontApiKeyInputSchema>\nexport type PutStorefrontProviderCredentialInput = z.infer<\n typeof putStorefrontProviderCredentialInputSchema\n>\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selected-graph runtime for the storefront admin surface. The business
|
|
3
|
+
* buyer-account capability is derived from whether the deployment also wires
|
|
4
|
+
* the customer business-account onboarding runtime, so the admin UI can gate
|
|
5
|
+
* the org-account controls on a real runtime signal rather than a static flag.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createStorefrontVoyantRuntime: import("@voyant-travel/core/project").VoyantGraphRuntimeFactory<{
|
|
8
|
+
module: {
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
adminRoutes: import("@hono/zod-openapi").OpenAPIHono<{
|
|
12
|
+
Bindings: Record<string, unknown>;
|
|
13
|
+
Variables: {
|
|
14
|
+
userId?: string;
|
|
15
|
+
organizationId?: string | null;
|
|
16
|
+
scopes?: string[] | null;
|
|
17
|
+
db: import("@voyant-travel/hono").VoyantDb;
|
|
18
|
+
};
|
|
19
|
+
}, {}, "/">;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineGraphRuntimeFactory } from "@voyant-travel/core/project";
|
|
2
|
+
import { customerBusinessAccountOnboardingRuntimePort } from "./customer-business-onboarding-runtime-port.js";
|
|
3
|
+
import { createStorefrontAdminRoutes } from "./storefront-routes.js";
|
|
4
|
+
import { storefrontRuntimePort } from "./storefront-runtime-port.js";
|
|
5
|
+
/**
|
|
6
|
+
* Selected-graph runtime for the storefront admin surface. The business
|
|
7
|
+
* buyer-account capability is derived from whether the deployment also wires
|
|
8
|
+
* the customer business-account onboarding runtime, so the admin UI can gate
|
|
9
|
+
* the org-account controls on a real runtime signal rather than a static flag.
|
|
10
|
+
*/
|
|
11
|
+
export const createStorefrontVoyantRuntime = defineGraphRuntimeFactory(async ({ getPort, hasPort }) => ({
|
|
12
|
+
module: { name: "storefronts" },
|
|
13
|
+
adminRoutes: createStorefrontAdminRoutes(await getPort(storefrontRuntimePort), {
|
|
14
|
+
businessAccounts: hasPort(customerBusinessAccountOnboardingRuntimePort),
|
|
15
|
+
}),
|
|
16
|
+
}));
|
|
17
|
+
//# sourceMappingURL=storefront-graph-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefront-graph-runtime.js","sourceRoot":"","sources":["../src/storefront-graph-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAE,4CAA4C,EAAE,MAAM,gDAAgD,CAAA;AAC7G,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CACpE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/B,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;IAC/B,WAAW,EAAE,2BAA2B,CAAC,MAAM,OAAO,CAAC,qBAAqB,CAAC,EAAE;QAC7E,gBAAgB,EAAE,OAAO,CAAC,4CAA4C,CAAC;KACxE,CAAC;CACH,CAAC,CACH,CAAA","sourcesContent":["import { defineGraphRuntimeFactory } from \"@voyant-travel/core/project\"\n\nimport { customerBusinessAccountOnboardingRuntimePort } from \"./customer-business-onboarding-runtime-port.js\"\nimport { createStorefrontAdminRoutes } from \"./storefront-routes.js\"\nimport { storefrontRuntimePort } from \"./storefront-runtime-port.js\"\n\n/**\n * Selected-graph runtime for the storefront admin surface. The business\n * buyer-account capability is derived from whether the deployment also wires\n * the customer business-account onboarding runtime, so the admin UI can gate\n * the org-account controls on a real runtime signal rather than a static flag.\n */\nexport const createStorefrontVoyantRuntime = defineGraphRuntimeFactory(\n async ({ getPort, hasPort }) => ({\n module: { name: \"storefronts\" },\n adminRoutes: createStorefrontAdminRoutes(await getPort(storefrontRuntimePort), {\n businessAccounts: hasPort(customerBusinessAccountOnboardingRuntimePort),\n }),\n }),\n)\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { type VoyantDb } from "@voyant-travel/hono";
|
|
3
|
+
import type { StorefrontRuntimeProvider } from "./storefront-runtime-port.js";
|
|
4
|
+
type StorefrontEnv = {
|
|
5
|
+
Bindings: Record<string, unknown>;
|
|
6
|
+
Variables: {
|
|
7
|
+
userId?: string;
|
|
8
|
+
organizationId?: string | null;
|
|
9
|
+
scopes?: string[] | null;
|
|
10
|
+
db: VoyantDb;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export interface StorefrontAdminRouteOptions {
|
|
14
|
+
/** Whether the deployment supports business (organization) buyer accounts. */
|
|
15
|
+
businessAccounts: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function createStorefrontAdminRoutes(runtime: StorefrontRuntimeProvider, options: StorefrontAdminRouteOptions): OpenAPIHono<StorefrontEnv, {}, "/">;
|
|
18
|
+
export {};
|