@voyant-travel/auth 0.139.0 → 0.140.1

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.
@@ -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,QAAQ,CAAC,CAAC,CAAA;AAC3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;AAErF,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;IAC1B,MAAM,EAAE,CAAC,CAAC,OAAO,E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,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 {};
@@ -0,0 +1,282 @@
1
+ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
2
+ import { openApiValidationHook, parseJsonBody } from "@voyant-travel/hono";
3
+ import { hasApiKeyPermission, permissionStringsToPermissions } from "@voyant-travel/types/api-keys";
4
+ import { createStorefrontInputSchema, issueStorefrontApiKeyInputSchema, putStorefrontProviderCredentialInputSchema, setStorefrontAllowedOriginsInputSchema, updateStorefrontAccountPolicyInputSchema, updateStorefrontInputSchema, updateStorefrontMethodsInputSchema, } from "./storefront-admin-contracts.js";
5
+ import { StorefrontInputError } from "./storefront-origins.js";
6
+ const storefrontAdminApiId = "@voyant-travel/auth#storefront.api.admin";
7
+ const jsonBody = (schema) => ({
8
+ required: true,
9
+ content: { "application/json": { schema } },
10
+ });
11
+ const responses = (...statuses) => Object.fromEntries(statuses.map((status) => [status, { description: `HTTP ${status}` }]));
12
+ const storefrontRoute = (config) => createRoute({
13
+ method: config.method,
14
+ path: config.path,
15
+ operationId: config.operationId,
16
+ "x-voyant-api-id": storefrontAdminApiId,
17
+ ...(config.request ? { request: config.request } : {}),
18
+ responses: responses(...config.statuses),
19
+ });
20
+ const storefrontIdParams = z.object({ storefrontId: z.string() });
21
+ const keyIdParams = z.object({ storefrontId: z.string(), keyId: z.string() });
22
+ const providerParams = z.object({
23
+ storefrontId: z.string(),
24
+ provider: z.enum(["google", "facebook", "apple"]),
25
+ });
26
+ const capabilitiesRoute = storefrontRoute({
27
+ method: "get",
28
+ path: "/capabilities",
29
+ operationId: "getStorefrontCapabilities",
30
+ statuses: [200, 401, 403],
31
+ });
32
+ const listStorefrontsRoute = storefrontRoute({
33
+ method: "get",
34
+ path: "/storefronts",
35
+ operationId: "listStorefronts",
36
+ statuses: [200, 401, 403],
37
+ });
38
+ const createStorefrontRoute = storefrontRoute({
39
+ method: "post",
40
+ path: "/storefronts",
41
+ operationId: "createStorefront",
42
+ request: { body: jsonBody(createStorefrontInputSchema) },
43
+ statuses: [201, 400, 401, 403],
44
+ });
45
+ const getStorefrontRoute = storefrontRoute({
46
+ method: "get",
47
+ path: "/storefronts/{storefrontId}",
48
+ operationId: "getStorefront",
49
+ request: { params: storefrontIdParams },
50
+ statuses: [200, 401, 403, 404],
51
+ });
52
+ const updateStorefrontRoute = storefrontRoute({
53
+ method: "patch",
54
+ path: "/storefronts/{storefrontId}",
55
+ operationId: "updateStorefront",
56
+ request: { params: storefrontIdParams, body: jsonBody(updateStorefrontInputSchema) },
57
+ statuses: [200, 400, 401, 403, 404],
58
+ });
59
+ const deleteStorefrontRoute = storefrontRoute({
60
+ method: "delete",
61
+ path: "/storefronts/{storefrontId}",
62
+ operationId: "deleteStorefront",
63
+ request: { params: storefrontIdParams },
64
+ statuses: [204, 401, 403, 404],
65
+ });
66
+ const setAllowedOriginsRoute = storefrontRoute({
67
+ method: "put",
68
+ path: "/storefronts/{storefrontId}/allowed-origins",
69
+ operationId: "setStorefrontAllowedOrigins",
70
+ request: { params: storefrontIdParams, body: jsonBody(setStorefrontAllowedOriginsInputSchema) },
71
+ statuses: [200, 400, 401, 403, 404],
72
+ });
73
+ const listApiKeysRoute = storefrontRoute({
74
+ method: "get",
75
+ path: "/storefronts/{storefrontId}/keys",
76
+ operationId: "listStorefrontApiKeys",
77
+ request: { params: storefrontIdParams },
78
+ statuses: [200, 401, 403, 404],
79
+ });
80
+ const issueApiKeyRoute = storefrontRoute({
81
+ method: "post",
82
+ path: "/storefronts/{storefrontId}/keys",
83
+ operationId: "issueStorefrontApiKey",
84
+ request: { params: storefrontIdParams, body: jsonBody(issueStorefrontApiKeyInputSchema) },
85
+ statuses: [201, 400, 401, 403, 404],
86
+ });
87
+ const rotateApiKeyRoute = storefrontRoute({
88
+ method: "post",
89
+ path: "/storefronts/{storefrontId}/keys/{keyId}/rotate",
90
+ operationId: "rotateStorefrontApiKey",
91
+ request: { params: keyIdParams },
92
+ statuses: [201, 400, 401, 403, 404],
93
+ });
94
+ const revokeApiKeyRoute = storefrontRoute({
95
+ method: "delete",
96
+ path: "/storefronts/{storefrontId}/keys/{keyId}",
97
+ operationId: "revokeStorefrontApiKey",
98
+ request: { params: keyIdParams },
99
+ statuses: [204, 401, 403, 404],
100
+ });
101
+ const updateAccountPolicyRoute = storefrontRoute({
102
+ method: "put",
103
+ path: "/storefronts/{storefrontId}/account-policy",
104
+ operationId: "updateStorefrontAccountPolicy",
105
+ request: { params: storefrontIdParams, body: jsonBody(updateStorefrontAccountPolicyInputSchema) },
106
+ statuses: [200, 400, 401, 403, 404],
107
+ });
108
+ const updateMethodsRoute = storefrontRoute({
109
+ method: "put",
110
+ path: "/storefronts/{storefrontId}/methods",
111
+ operationId: "updateStorefrontMethods",
112
+ request: { params: storefrontIdParams, body: jsonBody(updateStorefrontMethodsInputSchema) },
113
+ statuses: [200, 400, 401, 403, 404],
114
+ });
115
+ const listProviderCredentialsRoute = storefrontRoute({
116
+ method: "get",
117
+ path: "/storefronts/{storefrontId}/provider-credentials",
118
+ operationId: "listStorefrontProviderCredentials",
119
+ request: { params: storefrontIdParams },
120
+ statuses: [200, 401, 403, 404],
121
+ });
122
+ const putProviderCredentialRoute = storefrontRoute({
123
+ method: "put",
124
+ path: "/storefronts/{storefrontId}/provider-credentials/{provider}",
125
+ operationId: "putStorefrontProviderCredential",
126
+ request: {
127
+ params: providerParams,
128
+ body: jsonBody(putStorefrontProviderCredentialInputSchema),
129
+ },
130
+ statuses: [204, 400, 401, 403, 404],
131
+ });
132
+ const deleteProviderCredentialRoute = storefrontRoute({
133
+ method: "delete",
134
+ path: "/storefronts/{storefrontId}/provider-credentials/{provider}",
135
+ operationId: "deleteStorefrontProviderCredential",
136
+ request: { params: providerParams },
137
+ statuses: [204, 401, 403, 404],
138
+ });
139
+ /**
140
+ * Resolve the operator-scoped request context. The organization is derived from
141
+ * the admin session — never a client parameter — so every write is bounded to
142
+ * the acting operator's organization.
143
+ */
144
+ function requestContext(c) {
145
+ const userId = c.get("userId");
146
+ if (!userId)
147
+ return c.json({ error: "Unauthorized" }, 401);
148
+ const organizationId = c.get("organizationId");
149
+ if (!organizationId)
150
+ return c.json({ error: "No active operator organization." }, 403);
151
+ return { bindings: c.env, db: c.get("db"), organizationId };
152
+ }
153
+ function canManageStorefronts(c) {
154
+ return hasApiKeyPermission(permissionStringsToPermissions(c.get("scopes") ?? []), "storefronts", "write");
155
+ }
156
+ function requireManage(c) {
157
+ return canManageStorefronts(c) ? null : c.json({ error: "Forbidden" }, 403);
158
+ }
159
+ function handleError(c, error) {
160
+ if (error instanceof StorefrontInputError) {
161
+ return c.json({ error: error.message }, 400);
162
+ }
163
+ if (error instanceof Error &&
164
+ "status" in error &&
165
+ typeof error.status === "number" &&
166
+ error.status >= 400 &&
167
+ error.status <= 599) {
168
+ return c.json({ error: error.message }, error.status);
169
+ }
170
+ throw error;
171
+ }
172
+ export function createStorefrontAdminRoutes(runtime, options) {
173
+ const routes = new OpenAPIHono({ defaultHook: openApiValidationHook });
174
+ const run = async (c, operation, guard = "read") => {
175
+ const context = requestContext(c);
176
+ if (context instanceof Response)
177
+ return context;
178
+ if (guard === "write") {
179
+ const forbidden = requireManage(c);
180
+ if (forbidden)
181
+ return forbidden;
182
+ }
183
+ try {
184
+ return await operation(context);
185
+ }
186
+ catch (error) {
187
+ return handleError(c, error);
188
+ }
189
+ };
190
+ routes.openapi(capabilitiesRoute, (c) => {
191
+ if (!c.get("userId"))
192
+ return c.json({ error: "Unauthorized" }, 401);
193
+ if (!c.get("organizationId"))
194
+ return c.json({ error: "No active operator organization." }, 403);
195
+ const manageProviders = canManageStorefronts(c);
196
+ return c.json({
197
+ data: { businessAccounts: options.businessAccounts, manageProviders },
198
+ });
199
+ });
200
+ routes.openapi(listStorefrontsRoute, async (c) => {
201
+ const result = await run(c, (context) => runtime.listStorefronts(context));
202
+ return result instanceof Response ? result : c.json({ data: result });
203
+ });
204
+ routes.openapi(createStorefrontRoute, async (c) => {
205
+ const input = await parseJsonBody(c, createStorefrontInputSchema);
206
+ const result = await run(c, (context) => runtime.createStorefront(context, input), "write");
207
+ return result instanceof Response ? result : c.json({ data: result }, 201);
208
+ });
209
+ routes.openapi(getStorefrontRoute, async (c) => {
210
+ const { storefrontId } = c.req.param();
211
+ const result = await run(c, (context) => runtime.getStorefront(context, storefrontId));
212
+ return result instanceof Response ? result : c.json({ data: result });
213
+ });
214
+ routes.openapi(updateStorefrontRoute, async (c) => {
215
+ const { storefrontId } = c.req.param();
216
+ const input = await parseJsonBody(c, updateStorefrontInputSchema);
217
+ const result = await run(c, (context) => runtime.updateStorefront(context, storefrontId, input), "write");
218
+ return result instanceof Response ? result : c.json({ data: result });
219
+ });
220
+ routes.openapi(deleteStorefrontRoute, async (c) => {
221
+ const { storefrontId } = c.req.param();
222
+ const result = await run(c, (context) => runtime.deleteStorefront(context, storefrontId), "write");
223
+ return result instanceof Response ? result : c.body(null, 204);
224
+ });
225
+ routes.openapi(setAllowedOriginsRoute, async (c) => {
226
+ const { storefrontId } = c.req.param();
227
+ const input = await parseJsonBody(c, setStorefrontAllowedOriginsInputSchema);
228
+ const result = await run(c, (context) => runtime.setAllowedOrigins(context, storefrontId, input.origins), "write");
229
+ return result instanceof Response ? result : c.json({ data: result });
230
+ });
231
+ routes.openapi(listApiKeysRoute, async (c) => {
232
+ const { storefrontId } = c.req.param();
233
+ const result = await run(c, (context) => runtime.listApiKeys(context, storefrontId));
234
+ return result instanceof Response ? result : c.json({ data: result });
235
+ });
236
+ routes.openapi(issueApiKeyRoute, async (c) => {
237
+ const { storefrontId } = c.req.param();
238
+ const input = await parseJsonBody(c, issueStorefrontApiKeyInputSchema);
239
+ const result = await run(c, (context) => runtime.issueApiKey(context, storefrontId, input.kind, input.name ?? null), "write");
240
+ return result instanceof Response ? result : c.json({ data: result }, 201);
241
+ });
242
+ routes.openapi(rotateApiKeyRoute, async (c) => {
243
+ const { storefrontId, keyId } = c.req.param();
244
+ const result = await run(c, (context) => runtime.rotateApiKey(context, storefrontId, keyId), "write");
245
+ return result instanceof Response ? result : c.json({ data: result }, 201);
246
+ });
247
+ routes.openapi(revokeApiKeyRoute, async (c) => {
248
+ const { storefrontId, keyId } = c.req.param();
249
+ const result = await run(c, (context) => runtime.revokeApiKey(context, storefrontId, keyId), "write");
250
+ return result instanceof Response ? result : c.body(null, 204);
251
+ });
252
+ routes.openapi(updateAccountPolicyRoute, async (c) => {
253
+ const { storefrontId } = c.req.param();
254
+ const input = await parseJsonBody(c, updateStorefrontAccountPolicyInputSchema);
255
+ const result = await run(c, (context) => runtime.updateAccountPolicy(context, storefrontId, input), "write");
256
+ return result instanceof Response ? result : c.json({ data: result });
257
+ });
258
+ routes.openapi(updateMethodsRoute, async (c) => {
259
+ const { storefrontId } = c.req.param();
260
+ const input = await parseJsonBody(c, updateStorefrontMethodsInputSchema);
261
+ const result = await run(c, (context) => runtime.updateMethods(context, storefrontId, input), "write");
262
+ return result instanceof Response ? result : c.json({ data: result });
263
+ });
264
+ routes.openapi(listProviderCredentialsRoute, async (c) => {
265
+ const { storefrontId } = c.req.param();
266
+ const result = await run(c, (context) => runtime.listProviderCredentials(context, storefrontId));
267
+ return result instanceof Response ? result : c.json({ data: result });
268
+ });
269
+ routes.openapi(putProviderCredentialRoute, async (c) => {
270
+ const { storefrontId, provider } = c.req.param();
271
+ const input = await parseJsonBody(c, putStorefrontProviderCredentialInputSchema);
272
+ const result = await run(c, (context) => runtime.putProviderCredential(context, storefrontId, provider, input), "write");
273
+ return result instanceof Response ? result : c.body(null, 204);
274
+ });
275
+ routes.openapi(deleteProviderCredentialRoute, async (c) => {
276
+ const { storefrontId, provider } = c.req.param();
277
+ const result = await run(c, (context) => runtime.deleteProviderCredential(context, storefrontId, provider), "write");
278
+ return result instanceof Response ? result : c.body(null, 204);
279
+ });
280
+ return routes;
281
+ }
282
+ //# sourceMappingURL=storefront-routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storefront-routes.js","sourceRoot":"","sources":["../src/storefront-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAiB,MAAM,qBAAqB,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,CACtB,CAAC,EACD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,EAC9E,OAAO,CACR,CAAA;QACD,OAAO,MAAM,YAAY,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { createRoute, OpenAPIHono, z } from \"@hono/zod-openapi\"\nimport { openApiValidationHook, parseJsonBody, type VoyantDb } from \"@voyant-travel/hono\"\nimport { hasApiKeyPermission, permissionStringsToPermissions } from \"@voyant-travel/types/api-keys\"\nimport type { Context } from \"hono\"\n\nimport {\n createStorefrontInputSchema,\n issueStorefrontApiKeyInputSchema,\n putStorefrontProviderCredentialInputSchema,\n setStorefrontAllowedOriginsInputSchema,\n updateStorefrontAccountPolicyInputSchema,\n updateStorefrontInputSchema,\n updateStorefrontMethodsInputSchema,\n} from \"./storefront-admin-contracts.js\"\nimport { StorefrontInputError } from \"./storefront-origins.js\"\nimport type {\n StorefrontRequestContext,\n StorefrontRuntimeProvider,\n} from \"./storefront-runtime-port.js\"\n\ntype StorefrontEnv = {\n Bindings: Record<string, unknown>\n Variables: {\n userId?: string\n organizationId?: string | null\n scopes?: string[] | null\n db: VoyantDb\n }\n}\ntype StorefrontRouteContext = Context<StorefrontEnv>\n\nconst storefrontAdminApiId = \"@voyant-travel/auth#storefront.api.admin\"\nconst jsonBody = <T extends z.ZodTypeAny>(schema: T) => ({\n required: true,\n content: { \"application/json\": { schema } },\n})\nconst responses = (...statuses: number[]) =>\n Object.fromEntries(statuses.map((status) => [status, { description: `HTTP ${status}` }]))\nconst storefrontRoute = <\n M extends \"get\" | \"post\" | \"put\" | \"patch\" | \"delete\",\n P extends string,\n>(config: {\n method: M\n path: P\n operationId: string\n request?: Record<string, unknown>\n statuses: number[]\n}) =>\n createRoute({\n method: config.method,\n path: config.path,\n operationId: config.operationId,\n \"x-voyant-api-id\": storefrontAdminApiId,\n ...(config.request ? { request: config.request } : {}),\n responses: responses(...config.statuses),\n })\n\nconst storefrontIdParams = z.object({ storefrontId: z.string() })\nconst keyIdParams = z.object({ storefrontId: z.string(), keyId: z.string() })\nconst providerParams = z.object({\n storefrontId: z.string(),\n provider: z.enum([\"google\", \"facebook\", \"apple\"]),\n})\n\nconst capabilitiesRoute = storefrontRoute({\n method: \"get\",\n path: \"/capabilities\",\n operationId: \"getStorefrontCapabilities\",\n statuses: [200, 401, 403],\n})\nconst listStorefrontsRoute = storefrontRoute({\n method: \"get\",\n path: \"/storefronts\",\n operationId: \"listStorefronts\",\n statuses: [200, 401, 403],\n})\nconst createStorefrontRoute = storefrontRoute({\n method: \"post\",\n path: \"/storefronts\",\n operationId: \"createStorefront\",\n request: { body: jsonBody(createStorefrontInputSchema) },\n statuses: [201, 400, 401, 403],\n})\nconst getStorefrontRoute = storefrontRoute({\n method: \"get\",\n path: \"/storefronts/{storefrontId}\",\n operationId: \"getStorefront\",\n request: { params: storefrontIdParams },\n statuses: [200, 401, 403, 404],\n})\nconst updateStorefrontRoute = storefrontRoute({\n method: \"patch\",\n path: \"/storefronts/{storefrontId}\",\n operationId: \"updateStorefront\",\n request: { params: storefrontIdParams, body: jsonBody(updateStorefrontInputSchema) },\n statuses: [200, 400, 401, 403, 404],\n})\nconst deleteStorefrontRoute = storefrontRoute({\n method: \"delete\",\n path: \"/storefronts/{storefrontId}\",\n operationId: \"deleteStorefront\",\n request: { params: storefrontIdParams },\n statuses: [204, 401, 403, 404],\n})\nconst setAllowedOriginsRoute = storefrontRoute({\n method: \"put\",\n path: \"/storefronts/{storefrontId}/allowed-origins\",\n operationId: \"setStorefrontAllowedOrigins\",\n request: { params: storefrontIdParams, body: jsonBody(setStorefrontAllowedOriginsInputSchema) },\n statuses: [200, 400, 401, 403, 404],\n})\nconst listApiKeysRoute = storefrontRoute({\n method: \"get\",\n path: \"/storefronts/{storefrontId}/keys\",\n operationId: \"listStorefrontApiKeys\",\n request: { params: storefrontIdParams },\n statuses: [200, 401, 403, 404],\n})\nconst issueApiKeyRoute = storefrontRoute({\n method: \"post\",\n path: \"/storefronts/{storefrontId}/keys\",\n operationId: \"issueStorefrontApiKey\",\n request: { params: storefrontIdParams, body: jsonBody(issueStorefrontApiKeyInputSchema) },\n statuses: [201, 400, 401, 403, 404],\n})\nconst rotateApiKeyRoute = storefrontRoute({\n method: \"post\",\n path: \"/storefronts/{storefrontId}/keys/{keyId}/rotate\",\n operationId: \"rotateStorefrontApiKey\",\n request: { params: keyIdParams },\n statuses: [201, 400, 401, 403, 404],\n})\nconst revokeApiKeyRoute = storefrontRoute({\n method: \"delete\",\n path: \"/storefronts/{storefrontId}/keys/{keyId}\",\n operationId: \"revokeStorefrontApiKey\",\n request: { params: keyIdParams },\n statuses: [204, 401, 403, 404],\n})\nconst updateAccountPolicyRoute = storefrontRoute({\n method: \"put\",\n path: \"/storefronts/{storefrontId}/account-policy\",\n operationId: \"updateStorefrontAccountPolicy\",\n request: { params: storefrontIdParams, body: jsonBody(updateStorefrontAccountPolicyInputSchema) },\n statuses: [200, 400, 401, 403, 404],\n})\nconst updateMethodsRoute = storefrontRoute({\n method: \"put\",\n path: \"/storefronts/{storefrontId}/methods\",\n operationId: \"updateStorefrontMethods\",\n request: { params: storefrontIdParams, body: jsonBody(updateStorefrontMethodsInputSchema) },\n statuses: [200, 400, 401, 403, 404],\n})\nconst listProviderCredentialsRoute = storefrontRoute({\n method: \"get\",\n path: \"/storefronts/{storefrontId}/provider-credentials\",\n operationId: \"listStorefrontProviderCredentials\",\n request: { params: storefrontIdParams },\n statuses: [200, 401, 403, 404],\n})\nconst putProviderCredentialRoute = storefrontRoute({\n method: \"put\",\n path: \"/storefronts/{storefrontId}/provider-credentials/{provider}\",\n operationId: \"putStorefrontProviderCredential\",\n request: {\n params: providerParams,\n body: jsonBody(putStorefrontProviderCredentialInputSchema),\n },\n statuses: [204, 400, 401, 403, 404],\n})\nconst deleteProviderCredentialRoute = storefrontRoute({\n method: \"delete\",\n path: \"/storefronts/{storefrontId}/provider-credentials/{provider}\",\n operationId: \"deleteStorefrontProviderCredential\",\n request: { params: providerParams },\n statuses: [204, 401, 403, 404],\n})\n\n/**\n * Resolve the operator-scoped request context. The organization is derived from\n * the admin session — never a client parameter — so every write is bounded to\n * the acting operator's organization.\n */\nfunction requestContext(c: StorefrontRouteContext): StorefrontRequestContext | Response {\n const userId = c.get(\"userId\")\n if (!userId) return c.json({ error: \"Unauthorized\" }, 401)\n const organizationId = c.get(\"organizationId\")\n if (!organizationId) return c.json({ error: \"No active operator organization.\" }, 403)\n return { bindings: c.env, db: c.get(\"db\"), organizationId }\n}\n\nfunction canManageStorefronts(c: StorefrontRouteContext): boolean {\n return hasApiKeyPermission(\n permissionStringsToPermissions(c.get(\"scopes\") ?? []),\n \"storefronts\",\n \"write\",\n )\n}\n\nfunction requireManage(c: StorefrontRouteContext): Response | null {\n return canManageStorefronts(c) ? null : c.json({ error: \"Forbidden\" }, 403)\n}\n\nfunction handleError(c: StorefrontRouteContext, error: unknown): Response {\n if (error instanceof StorefrontInputError) {\n return c.json({ error: error.message }, 400)\n }\n if (\n error instanceof Error &&\n \"status\" in error &&\n typeof error.status === \"number\" &&\n error.status >= 400 &&\n error.status <= 599\n ) {\n return c.json({ error: error.message }, error.status as 400)\n }\n throw error\n}\n\nexport interface StorefrontAdminRouteOptions {\n /** Whether the deployment supports business (organization) buyer accounts. */\n businessAccounts: boolean\n}\n\nexport function createStorefrontAdminRoutes(\n runtime: StorefrontRuntimeProvider,\n options: StorefrontAdminRouteOptions,\n) {\n const routes = new OpenAPIHono<StorefrontEnv>({ defaultHook: openApiValidationHook })\n\n const run = async <T>(\n c: StorefrontRouteContext,\n operation: (context: StorefrontRequestContext) => Promise<T>,\n guard: \"read\" | \"write\" = \"read\",\n ): Promise<T | Response> => {\n const context = requestContext(c)\n if (context instanceof Response) return context\n if (guard === \"write\") {\n const forbidden = requireManage(c)\n if (forbidden) return forbidden\n }\n try {\n return await operation(context)\n } catch (error) {\n return handleError(c, error)\n }\n }\n\n routes.openapi(capabilitiesRoute, (c) => {\n if (!c.get(\"userId\")) return c.json({ error: \"Unauthorized\" }, 401)\n if (!c.get(\"organizationId\")) return c.json({ error: \"No active operator organization.\" }, 403)\n const manageProviders = canManageStorefronts(c)\n return c.json({\n data: { businessAccounts: options.businessAccounts, manageProviders },\n })\n })\n\n routes.openapi(listStorefrontsRoute, async (c) => {\n const result = await run(c, (context) => runtime.listStorefronts(context))\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(createStorefrontRoute, async (c) => {\n const input = await parseJsonBody(c, createStorefrontInputSchema)\n const result = await run(c, (context) => runtime.createStorefront(context, input), \"write\")\n return result instanceof Response ? result : c.json({ data: result }, 201)\n })\n\n routes.openapi(getStorefrontRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const result = await run(c, (context) => runtime.getStorefront(context, storefrontId))\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(updateStorefrontRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const input = await parseJsonBody(c, updateStorefrontInputSchema)\n const result = await run(\n c,\n (context) => runtime.updateStorefront(context, storefrontId, input),\n \"write\",\n )\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(deleteStorefrontRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const result = await run(\n c,\n (context) => runtime.deleteStorefront(context, storefrontId),\n \"write\",\n )\n return result instanceof Response ? result : c.body(null, 204)\n })\n\n routes.openapi(setAllowedOriginsRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const input = await parseJsonBody(c, setStorefrontAllowedOriginsInputSchema)\n const result = await run(\n c,\n (context) => runtime.setAllowedOrigins(context, storefrontId, input.origins),\n \"write\",\n )\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(listApiKeysRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const result = await run(c, (context) => runtime.listApiKeys(context, storefrontId))\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(issueApiKeyRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const input = await parseJsonBody(c, issueStorefrontApiKeyInputSchema)\n const result = await run(\n c,\n (context) => runtime.issueApiKey(context, storefrontId, input.kind, input.name ?? null),\n \"write\",\n )\n return result instanceof Response ? result : c.json({ data: result }, 201)\n })\n\n routes.openapi(rotateApiKeyRoute, async (c) => {\n const { storefrontId, keyId } = c.req.param()\n const result = await run(\n c,\n (context) => runtime.rotateApiKey(context, storefrontId, keyId),\n \"write\",\n )\n return result instanceof Response ? result : c.json({ data: result }, 201)\n })\n\n routes.openapi(revokeApiKeyRoute, async (c) => {\n const { storefrontId, keyId } = c.req.param()\n const result = await run(\n c,\n (context) => runtime.revokeApiKey(context, storefrontId, keyId),\n \"write\",\n )\n return result instanceof Response ? result : c.body(null, 204)\n })\n\n routes.openapi(updateAccountPolicyRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const input = await parseJsonBody(c, updateStorefrontAccountPolicyInputSchema)\n const result = await run(\n c,\n (context) => runtime.updateAccountPolicy(context, storefrontId, input),\n \"write\",\n )\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(updateMethodsRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const input = await parseJsonBody(c, updateStorefrontMethodsInputSchema)\n const result = await run(\n c,\n (context) => runtime.updateMethods(context, storefrontId, input),\n \"write\",\n )\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(listProviderCredentialsRoute, async (c) => {\n const { storefrontId } = c.req.param()\n const result = await run(c, (context) => runtime.listProviderCredentials(context, storefrontId))\n return result instanceof Response ? result : c.json({ data: result })\n })\n\n routes.openapi(putProviderCredentialRoute, async (c) => {\n const { storefrontId, provider } = c.req.param() as z.infer<typeof providerParams>\n const input = await parseJsonBody(c, putStorefrontProviderCredentialInputSchema)\n const result = await run(\n c,\n (context) => runtime.putProviderCredential(context, storefrontId, provider, input),\n \"write\",\n )\n return result instanceof Response ? result : c.body(null, 204)\n })\n\n routes.openapi(deleteProviderCredentialRoute, async (c) => {\n const { storefrontId, provider } = c.req.param() as z.infer<typeof providerParams>\n const result = await run(\n c,\n (context) => runtime.deleteProviderCredential(context, storefrontId, provider),\n \"write\",\n )\n return result instanceof Response ? result : c.body(null, 204)\n })\n\n return routes\n}\n"]}
package/dist/voyant.js CHANGED
@@ -434,9 +434,85 @@ export const authStorefrontVoyantModule = defineModule({
434
434
  localId: "auth.storefront",
435
435
  // Self-host storefront access model: keys, operator-declared origins, and
436
436
  // KMS-encrypted provider credentials backing the local customer-auth
437
- // resolver. Admin routes/tools and the managed cloud adapter are follow-ups.
437
+ // resolver, surfaced through the operator "Storefronts" admin surface. The
438
+ // managed cloud storefront adapter is a follow-up.
438
439
  provides: { ports: [providePort(storefrontRuntimePort)] },
439
- runtimePorts: [requirePort(storefrontRuntimePort)],
440
+ runtimePorts: [
441
+ requirePort(storefrontRuntimePort),
442
+ requirePort(customerBusinessAccountOnboardingRuntimePort, { optional: true }),
443
+ ],
444
+ api: [
445
+ {
446
+ id: "@voyant-travel/auth#storefront.api.admin",
447
+ surface: "admin",
448
+ mount: "storefronts",
449
+ resource: "storefronts",
450
+ openapi: { document: "storefronts" },
451
+ transactional: true,
452
+ runtime: {
453
+ entry: "@voyant-travel/auth/storefront-graph-runtime",
454
+ export: "createStorefrontVoyantRuntime",
455
+ },
456
+ },
457
+ ],
458
+ access: {
459
+ resources: [
460
+ {
461
+ id: "@voyant-travel/auth#access.storefronts",
462
+ resource: "storefronts",
463
+ label: "Storefronts",
464
+ description: "Manage storefront access keys, origins, and customer auth.",
465
+ actions: [
466
+ {
467
+ action: "read",
468
+ label: "View storefronts",
469
+ description: "View storefront configuration, keys, and provider status.",
470
+ },
471
+ {
472
+ action: "write",
473
+ label: "Manage storefronts",
474
+ description: "Create storefronts, issue keys, and configure origins, methods, and provider credentials.",
475
+ sensitive: true,
476
+ },
477
+ {
478
+ action: "delete",
479
+ label: "Delete storefronts",
480
+ description: "Delete storefronts and revoke their access keys.",
481
+ sensitive: true,
482
+ },
483
+ ],
484
+ },
485
+ ],
486
+ },
487
+ admin: {
488
+ compositionOrder: 7,
489
+ runtime: {
490
+ entry: "@voyant-travel/auth-react/admin",
491
+ export: "createSelectedStorefrontAdminExtension",
492
+ },
493
+ copy: [
494
+ {
495
+ id: "@voyant-travel/auth#storefront.admin.copy",
496
+ namespace: "auth.admin.storefronts",
497
+ fallbackLocale: "en",
498
+ runtime: {
499
+ entry: "@voyant-travel/auth-react/i18n",
500
+ export: "authUiMessageDefinitions",
501
+ },
502
+ },
503
+ ],
504
+ routes: [
505
+ {
506
+ id: "@voyant-travel/auth#storefront.admin.route",
507
+ path: "/storefronts",
508
+ requiredScopes: ["storefronts:read"],
509
+ runtime: {
510
+ entry: "@voyant-travel/auth-react/admin",
511
+ export: "createSelectedStorefrontAdminExtension",
512
+ },
513
+ },
514
+ ],
515
+ },
440
516
  meta: {
441
517
  ownership: "package",
442
518
  agentTools: {
@@ -1 +1 @@
1
- {"version":3,"file":"voyant.js","sourceRoot":"","sources":["../src/voyant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACpF,OAAO,EAAE,4CAA4C,EAAE,MAAM,gDAAgD,CAAA;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAE7E,MAAM,CAAC,MAAM,wCAAwC,GAAG,YAAY,CAAC;IACnE,EAAE,EAAE,gDAAgD;IACpD,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,iCAAiC;IAC1C,QAAQ,EAAE,EAAE,YAAY,EAAE,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OAAO,EAAE;oBACP,KAAK,EAAE,iCAAiC;oBACxC,MAAM,EAAE,sCAAsC;iBAC/C;aACF;SACF;KACF;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;KACrB;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAY,CAAC;IACrD,EAAE,EAAE,gCAAgC;IACpC,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,iBAAiB;IAC1B,0EAA0E;IAC1E,qEAAqE;IACrE,6EAA6E;IAC7E,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,EAAE;IACzD,YAAY,EAAE,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAClD,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,UAAU,EAAE;YACV,OAAO,EAAE,gBAAgB;YACzB,SAAS,EACP,mHAAmH;SACtH;KACF;CACF,CAAC,CAAA","sourcesContent":["import { defineModule, providePort, requirePort } from \"@voyant-travel/core/project\"\nimport { customerBusinessAccountOnboardingRuntimePort } from \"./customer-business-onboarding-runtime-port.js\"\nimport { identityAccessRuntimePort } from \"./identity-access-runtime-port.js\"\nimport { storefrontRuntimePort } from \"./storefront-runtime-port.js\"\nimport { teamManagementRuntimePort } from \"./team-management-runtime-port.js\"\n\nexport const authCustomerBusinessAccountsVoyantModule = defineModule({\n id: \"@voyant-travel/auth#customer-business-accounts\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.customer-business-accounts\",\n requires: { capabilities: [\"storefront.data-owner\"] },\n runtimePorts: [requirePort(customerBusinessAccountOnboardingRuntimePort)],\n api: [\n {\n id: \"@voyant-travel/auth#customer-business-accounts.api.admin\",\n surface: \"admin\",\n mount: \"customer-business-accounts\",\n resource: \"customer-business-accounts\",\n openapi: { document: \"customer-business-accounts\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/customer-business-onboarding-graph-runtime\",\n export: \"createCustomerBusinessAccountVoyantRuntime\",\n },\n },\n ],\n access: {\n resources: [\n {\n id: \"@voyant-travel/auth#access.customer-business-accounts\",\n resource: \"customer-business-accounts\",\n label: \"Customer business accounts\",\n description: \"Review onboarding requests and provision customer business accounts.\",\n actions: [\n {\n action: \"read\",\n label: \"View customer business accounts\",\n description: \"View customer business-account capabilities and onboarding requests.\",\n },\n {\n action: \"write\",\n label: \"Manage customer business accounts\",\n description: \"Approve, reject, and provision customer business accounts.\",\n sensitive: true,\n },\n ],\n },\n ],\n },\n admin: {\n compositionOrder: 6,\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedCustomerBusinessAccountsAdminExtension\",\n },\n copy: [\n {\n id: \"@voyant-travel/auth#customer-business-accounts.admin.copy\",\n namespace: \"auth.admin.customer-business-accounts\",\n fallbackLocale: \"en\",\n runtime: {\n entry: \"@voyant-travel/auth-react/i18n\",\n export: \"authUiMessageDefinitions\",\n },\n },\n ],\n routes: [\n {\n id: \"@voyant-travel/auth#customer-business-accounts.admin.route\",\n path: \"/business-accounts\",\n requiredScopes: [\"customer-business-accounts:read\"],\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedCustomerBusinessAccountsAdminExtension\",\n },\n },\n ],\n },\n meta: {\n ownership: \"package\",\n agentTools: {\n posture: \"not-applicable\",\n rationale: \"Business-account onboarding is exposed through staff-guarded admin routes.\",\n },\n },\n})\n\nexport const authInvitationsVoyantModule = defineModule({\n id: \"@voyant-travel/auth#invitations\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.invitations\",\n provides: { ports: [providePort(identityAccessRuntimePort)] },\n runtimePorts: [requirePort(identityAccessRuntimePort)],\n api: [\n {\n id: \"@voyant-travel/auth#invitations.api.admin\",\n surface: \"admin\",\n mount: \"invitations\",\n resource: \"team\",\n openapi: { document: \"invitations\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/identity-access-graph-runtime\",\n export: \"createInvitationsVoyantRuntime\",\n },\n },\n {\n id: \"@voyant-travel/auth#invitations.api.public\",\n surface: \"public\",\n mount: \"invitations\",\n anonymous: true,\n openapi: { document: \"invitations\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/identity-access-graph-runtime\",\n export: \"createInvitationsVoyantRuntime\",\n },\n },\n ],\n presentations: [\n {\n id: \"@voyant-travel/auth#presentation.local-auth\",\n runtime: {\n entry: \"@voyant-travel/auth-react/local-auth-routes\",\n export: \"createLocalAuthRouteContribution\",\n },\n },\n ],\n meta: {\n ownership: \"package\",\n agentTools: {\n posture: \"not-applicable\",\n rationale:\n \"This unit owns public invitation acceptance; staff invitation management is exposed by the guarded auth team runtime.\",\n },\n },\n})\n\nexport const authTeamVoyantModule = defineModule({\n id: \"@voyant-travel/auth#team\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.team\",\n provides: { ports: [providePort(teamManagementRuntimePort)] },\n runtimePorts: [requirePort(teamManagementRuntimePort)],\n api: [\n {\n id: \"@voyant-travel/auth#team.api.admin\",\n surface: \"admin\",\n mount: \"team\",\n resource: \"team\",\n openapi: { document: \"team\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/identity-access-graph-runtime\",\n export: \"createTeamVoyantRuntime\",\n },\n },\n ],\n access: {\n resources: [\n {\n id: \"@voyant-travel/auth#access.team\",\n resource: \"team\",\n label: \"Team\",\n description: \"Manage staff team members and their access.\",\n wildcard: \"explicit-resource\",\n actions: [\n {\n action: \"read\",\n label: \"View team\",\n description: \"View staff team members.\",\n },\n {\n action: \"write\",\n label: \"Manage team\",\n description: \"Invite staff and update roles or access.\",\n sensitive: true,\n wildcard: \"explicit\",\n },\n {\n action: \"delete\",\n label: \"Remove team access\",\n description: \"Revoke invitations or deactivate staff team members.\",\n sensitive: true,\n wildcard: \"explicit\",\n },\n ],\n },\n ],\n },\n tools: [\n {\n id: \"@voyant-travel/auth#team.tool.get-capabilities\",\n name: \"get_team_management_capabilities\",\n runtime: {\n entry: \"@voyant-travel/auth/tools\",\n export: \"getTeamManagementCapabilitiesTool\",\n },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"low\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.list-members\",\n name: \"list_team_members\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"listTeamMembersTool\" },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.list-roles\",\n name: \"list_team_roles\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"listTeamRolesTool\" },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"low\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.list-invitations\",\n name: \"list_team_invitations\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"listTeamInvitationsTool\" },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.invite-member\",\n name: \"invite_team_member\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"inviteTeamMemberTool\" },\n requiredScopes: [\"team:write\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.revoke-invitation\",\n name: \"revoke_team_invitation\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"revokeTeamInvitationTool\" },\n requiredScopes: [\"team:delete\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.update-member-role\",\n name: \"update_team_member_role\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"updateTeamMemberRoleTool\" },\n requiredScopes: [\"team:write\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.activate-member\",\n name: \"activate_team_member\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"activateTeamMemberTool\" },\n requiredScopes: [\"team:write\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.deactivate-member\",\n name: \"deactivate_team_member\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"deactivateTeamMemberTool\" },\n requiredScopes: [\"team:delete\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n ],\n actions: [\n {\n id: \"@voyant-travel/auth#team.action.get-capabilities\",\n version: \"v1\",\n kind: \"read\",\n targetType: \"team-capabilities\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"low\",\n ledger: \"optional\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.get-capabilities\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.list-members\",\n version: \"v1\",\n kind: \"sensitive-read\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.list-members\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.list-roles\",\n version: \"v1\",\n kind: \"read\",\n targetType: \"team-role\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"low\",\n ledger: \"optional\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.list-roles\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.list-invitations\",\n version: \"v1\",\n kind: \"sensitive-read\",\n targetType: \"team-invitation\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.list-invitations\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.invite-member\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-invitation\",\n resource: \"team\",\n action: \"write\",\n requiredScopes: [\"team:write\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: false,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.invite-member\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.revoke-invitation\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-invitation\",\n resource: \"team\",\n action: \"delete\",\n requiredScopes: [\"team:delete\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: false,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.revoke-invitation\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.update-member-role\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"write\",\n requiredScopes: [\"team:write\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: true,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.update-member-role\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.activate-member\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"write\",\n requiredScopes: [\"team:write\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: true,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.activate-member\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.deactivate-member\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"delete\",\n requiredScopes: [\"team:delete\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: false,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.deactivate-member\"] },\n },\n ],\n admin: {\n compositionOrder: 5,\n setupSteps: [{ id: \"@voyant-travel/auth#setup.team\", skippable: true }],\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedAuthTeamAdminExtension\",\n },\n copy: [\n {\n id: \"@voyant-travel/auth#team.admin.copy\",\n namespace: \"auth.admin.team\",\n fallbackLocale: \"en\",\n runtime: {\n entry: \"@voyant-travel/auth-react/i18n\",\n export: \"authUiMessageDefinitions\",\n },\n },\n ],\n routes: [\n {\n id: \"@voyant-travel/auth#team.admin.route\",\n path: \"/settings/team\",\n requiredScopes: [\"team:read\"],\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedAuthTeamAdminExtension\",\n },\n },\n ],\n },\n meta: {\n ownership: \"package\",\n },\n})\n\nexport const authStorefrontVoyantModule = defineModule({\n id: \"@voyant-travel/auth#storefront\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.storefront\",\n // Self-host storefront access model: keys, operator-declared origins, and\n // KMS-encrypted provider credentials backing the local customer-auth\n // resolver. Admin routes/tools and the managed cloud adapter are follow-ups.\n provides: { ports: [providePort(storefrontRuntimePort)] },\n runtimePorts: [requirePort(storefrontRuntimePort)],\n meta: {\n ownership: \"package\",\n agentTools: {\n posture: \"not-applicable\",\n rationale:\n \"Storefront access configuration is operator-owned; it is exposed through guarded admin surfaces, not agent tools.\",\n },\n },\n})\n"]}
1
+ {"version":3,"file":"voyant.js","sourceRoot":"","sources":["../src/voyant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACpF,OAAO,EAAE,4CAA4C,EAAE,MAAM,gDAAgD,CAAA;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAE7E,MAAM,CAAC,MAAM,wCAAwC,GAAG,YAAY,CAAC;IACnE,EAAE,EAAE,gDAAgD;IACpD,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,iC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AS,EAAE,IAAI;qBAChB;oBACD;wBACE,MAAM,EAAE,QAAQ;wBAChB,KAAK,EAAE,oBAAoB;wBAC3B,WAAW,EAAE,kDAAkD;wBAC/D,SAAS,EAAE,IAAI;qBAChB;iBACF;aACF;SACF;KACF;IACD,KAAK,EAAE;QACL,gBAAgB,EAAE,CAAC;QACnB,OAAO,EAAE;YACP,KAAK,EAAE,iCAAiC;YACxC,MAAM,EAAE,wCAAwC;SACjD;QACD,IAAI,EAAE;YACJ;gBACE,EAAE,EAAE,2CAA2C;gBAC/C,SAAS,EAAE,wBAAwB;gBACnC,cAAc,EAAE,IAAI;gBACpB,OAAO,EAAE;oBACP,KAAK,EAAE,gCAAgC;oBACvC,MAAM,EAAE,0BAA0B;iBACnC;aACF;SACF;QACD,MAAM,EAAE;YACN;gBACE,EAAE,EAAE,4CAA4C;gBAChD,IAAI,EAAE,cAAc;gBACpB,cAAc,EAAE,CAAC,kBAAkB,CAAC;gBACpC,OAAO,EAAE;oBACP,KAAK,EAAE,iCAAiC;oBACxC,MAAM,EAAE,wCAAwC;iBACjD;aACF;SACF;KACF;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,SAAS;QACpB,UAAU,EAAE;YACV,OAAO,EAAE,gBAAgB;YACzB,SAAS,EACP,mHAAmH;SACtH;KACF;CACF,CAAC,CAAA","sourcesContent":["import { defineModule, providePort, requirePort } from \"@voyant-travel/core/project\"\nimport { customerBusinessAccountOnboardingRuntimePort } from \"./customer-business-onboarding-runtime-port.js\"\nimport { identityAccessRuntimePort } from \"./identity-access-runtime-port.js\"\nimport { storefrontRuntimePort } from \"./storefront-runtime-port.js\"\nimport { teamManagementRuntimePort } from \"./team-management-runtime-port.js\"\n\nexport const authCustomerBusinessAccountsVoyantModule = defineModule({\n id: \"@voyant-travel/auth#customer-business-accounts\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.customer-business-accounts\",\n requires: { capabilities: [\"storefront.data-owner\"] },\n runtimePorts: [requirePort(customerBusinessAccountOnboardingRuntimePort)],\n api: [\n {\n id: \"@voyant-travel/auth#customer-business-accounts.api.admin\",\n surface: \"admin\",\n mount: \"customer-business-accounts\",\n resource: \"customer-business-accounts\",\n openapi: { document: \"customer-business-accounts\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/customer-business-onboarding-graph-runtime\",\n export: \"createCustomerBusinessAccountVoyantRuntime\",\n },\n },\n ],\n access: {\n resources: [\n {\n id: \"@voyant-travel/auth#access.customer-business-accounts\",\n resource: \"customer-business-accounts\",\n label: \"Customer business accounts\",\n description: \"Review onboarding requests and provision customer business accounts.\",\n actions: [\n {\n action: \"read\",\n label: \"View customer business accounts\",\n description: \"View customer business-account capabilities and onboarding requests.\",\n },\n {\n action: \"write\",\n label: \"Manage customer business accounts\",\n description: \"Approve, reject, and provision customer business accounts.\",\n sensitive: true,\n },\n ],\n },\n ],\n },\n admin: {\n compositionOrder: 6,\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedCustomerBusinessAccountsAdminExtension\",\n },\n copy: [\n {\n id: \"@voyant-travel/auth#customer-business-accounts.admin.copy\",\n namespace: \"auth.admin.customer-business-accounts\",\n fallbackLocale: \"en\",\n runtime: {\n entry: \"@voyant-travel/auth-react/i18n\",\n export: \"authUiMessageDefinitions\",\n },\n },\n ],\n routes: [\n {\n id: \"@voyant-travel/auth#customer-business-accounts.admin.route\",\n path: \"/business-accounts\",\n requiredScopes: [\"customer-business-accounts:read\"],\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedCustomerBusinessAccountsAdminExtension\",\n },\n },\n ],\n },\n meta: {\n ownership: \"package\",\n agentTools: {\n posture: \"not-applicable\",\n rationale: \"Business-account onboarding is exposed through staff-guarded admin routes.\",\n },\n },\n})\n\nexport const authInvitationsVoyantModule = defineModule({\n id: \"@voyant-travel/auth#invitations\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.invitations\",\n provides: { ports: [providePort(identityAccessRuntimePort)] },\n runtimePorts: [requirePort(identityAccessRuntimePort)],\n api: [\n {\n id: \"@voyant-travel/auth#invitations.api.admin\",\n surface: \"admin\",\n mount: \"invitations\",\n resource: \"team\",\n openapi: { document: \"invitations\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/identity-access-graph-runtime\",\n export: \"createInvitationsVoyantRuntime\",\n },\n },\n {\n id: \"@voyant-travel/auth#invitations.api.public\",\n surface: \"public\",\n mount: \"invitations\",\n anonymous: true,\n openapi: { document: \"invitations\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/identity-access-graph-runtime\",\n export: \"createInvitationsVoyantRuntime\",\n },\n },\n ],\n presentations: [\n {\n id: \"@voyant-travel/auth#presentation.local-auth\",\n runtime: {\n entry: \"@voyant-travel/auth-react/local-auth-routes\",\n export: \"createLocalAuthRouteContribution\",\n },\n },\n ],\n meta: {\n ownership: \"package\",\n agentTools: {\n posture: \"not-applicable\",\n rationale:\n \"This unit owns public invitation acceptance; staff invitation management is exposed by the guarded auth team runtime.\",\n },\n },\n})\n\nexport const authTeamVoyantModule = defineModule({\n id: \"@voyant-travel/auth#team\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.team\",\n provides: { ports: [providePort(teamManagementRuntimePort)] },\n runtimePorts: [requirePort(teamManagementRuntimePort)],\n api: [\n {\n id: \"@voyant-travel/auth#team.api.admin\",\n surface: \"admin\",\n mount: \"team\",\n resource: \"team\",\n openapi: { document: \"team\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/identity-access-graph-runtime\",\n export: \"createTeamVoyantRuntime\",\n },\n },\n ],\n access: {\n resources: [\n {\n id: \"@voyant-travel/auth#access.team\",\n resource: \"team\",\n label: \"Team\",\n description: \"Manage staff team members and their access.\",\n wildcard: \"explicit-resource\",\n actions: [\n {\n action: \"read\",\n label: \"View team\",\n description: \"View staff team members.\",\n },\n {\n action: \"write\",\n label: \"Manage team\",\n description: \"Invite staff and update roles or access.\",\n sensitive: true,\n wildcard: \"explicit\",\n },\n {\n action: \"delete\",\n label: \"Remove team access\",\n description: \"Revoke invitations or deactivate staff team members.\",\n sensitive: true,\n wildcard: \"explicit\",\n },\n ],\n },\n ],\n },\n tools: [\n {\n id: \"@voyant-travel/auth#team.tool.get-capabilities\",\n name: \"get_team_management_capabilities\",\n runtime: {\n entry: \"@voyant-travel/auth/tools\",\n export: \"getTeamManagementCapabilitiesTool\",\n },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"low\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.list-members\",\n name: \"list_team_members\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"listTeamMembersTool\" },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.list-roles\",\n name: \"list_team_roles\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"listTeamRolesTool\" },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"low\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.list-invitations\",\n name: \"list_team_invitations\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"listTeamInvitationsTool\" },\n requiredScopes: [\"team:read\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.invite-member\",\n name: \"invite_team_member\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"inviteTeamMemberTool\" },\n requiredScopes: [\"team:write\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.revoke-invitation\",\n name: \"revoke_team_invitation\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"revokeTeamInvitationTool\" },\n requiredScopes: [\"team:delete\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.update-member-role\",\n name: \"update_team_member_role\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"updateTeamMemberRoleTool\" },\n requiredScopes: [\"team:write\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.activate-member\",\n name: \"activate_team_member\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"activateTeamMemberTool\" },\n requiredScopes: [\"team:write\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n {\n id: \"@voyant-travel/auth#team.tool.deactivate-member\",\n name: \"deactivate_team_member\",\n runtime: { entry: \"@voyant-travel/auth/tools\", export: \"deactivateTeamMemberTool\" },\n requiredScopes: [\"team:delete\"],\n context: [\"teamManagement\"],\n risk: \"high\",\n },\n ],\n actions: [\n {\n id: \"@voyant-travel/auth#team.action.get-capabilities\",\n version: \"v1\",\n kind: \"read\",\n targetType: \"team-capabilities\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"low\",\n ledger: \"optional\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.get-capabilities\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.list-members\",\n version: \"v1\",\n kind: \"sensitive-read\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.list-members\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.list-roles\",\n version: \"v1\",\n kind: \"read\",\n targetType: \"team-role\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"low\",\n ledger: \"optional\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.list-roles\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.list-invitations\",\n version: \"v1\",\n kind: \"sensitive-read\",\n targetType: \"team-invitation\",\n resource: \"team\",\n action: \"read\",\n requiredScopes: [\"team:read\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"never\",\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.list-invitations\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.invite-member\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-invitation\",\n resource: \"team\",\n action: \"write\",\n requiredScopes: [\"team:write\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: false,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.invite-member\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.revoke-invitation\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-invitation\",\n resource: \"team\",\n action: \"delete\",\n requiredScopes: [\"team:delete\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: false,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.revoke-invitation\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.update-member-role\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"write\",\n requiredScopes: [\"team:write\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: true,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.update-member-role\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.activate-member\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"write\",\n requiredScopes: [\"team:write\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: true,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.activate-member\"] },\n },\n {\n id: \"@voyant-travel/auth#team.action.deactivate-member\",\n version: \"v1\",\n kind: \"execute\",\n targetType: \"team-member\",\n resource: \"team\",\n action: \"delete\",\n requiredScopes: [\"team:delete\"],\n risk: \"high\",\n ledger: \"required\",\n approval: \"required\",\n reversible: false,\n allowedActorTypes: [\"staff\"],\n from: { tools: [\"@voyant-travel/auth#team.tool.deactivate-member\"] },\n },\n ],\n admin: {\n compositionOrder: 5,\n setupSteps: [{ id: \"@voyant-travel/auth#setup.team\", skippable: true }],\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedAuthTeamAdminExtension\",\n },\n copy: [\n {\n id: \"@voyant-travel/auth#team.admin.copy\",\n namespace: \"auth.admin.team\",\n fallbackLocale: \"en\",\n runtime: {\n entry: \"@voyant-travel/auth-react/i18n\",\n export: \"authUiMessageDefinitions\",\n },\n },\n ],\n routes: [\n {\n id: \"@voyant-travel/auth#team.admin.route\",\n path: \"/settings/team\",\n requiredScopes: [\"team:read\"],\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedAuthTeamAdminExtension\",\n },\n },\n ],\n },\n meta: {\n ownership: \"package\",\n },\n})\n\nexport const authStorefrontVoyantModule = defineModule({\n id: \"@voyant-travel/auth#storefront\",\n packageName: \"@voyant-travel/auth\",\n localId: \"auth.storefront\",\n // Self-host storefront access model: keys, operator-declared origins, and\n // KMS-encrypted provider credentials backing the local customer-auth\n // resolver, surfaced through the operator \"Storefronts\" admin surface. The\n // managed cloud storefront adapter is a follow-up.\n provides: { ports: [providePort(storefrontRuntimePort)] },\n runtimePorts: [\n requirePort(storefrontRuntimePort),\n requirePort(customerBusinessAccountOnboardingRuntimePort, { optional: true }),\n ],\n api: [\n {\n id: \"@voyant-travel/auth#storefront.api.admin\",\n surface: \"admin\",\n mount: \"storefronts\",\n resource: \"storefronts\",\n openapi: { document: \"storefronts\" },\n transactional: true,\n runtime: {\n entry: \"@voyant-travel/auth/storefront-graph-runtime\",\n export: \"createStorefrontVoyantRuntime\",\n },\n },\n ],\n access: {\n resources: [\n {\n id: \"@voyant-travel/auth#access.storefronts\",\n resource: \"storefronts\",\n label: \"Storefronts\",\n description: \"Manage storefront access keys, origins, and customer auth.\",\n actions: [\n {\n action: \"read\",\n label: \"View storefronts\",\n description: \"View storefront configuration, keys, and provider status.\",\n },\n {\n action: \"write\",\n label: \"Manage storefronts\",\n description:\n \"Create storefronts, issue keys, and configure origins, methods, and provider credentials.\",\n sensitive: true,\n },\n {\n action: \"delete\",\n label: \"Delete storefronts\",\n description: \"Delete storefronts and revoke their access keys.\",\n sensitive: true,\n },\n ],\n },\n ],\n },\n admin: {\n compositionOrder: 7,\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedStorefrontAdminExtension\",\n },\n copy: [\n {\n id: \"@voyant-travel/auth#storefront.admin.copy\",\n namespace: \"auth.admin.storefronts\",\n fallbackLocale: \"en\",\n runtime: {\n entry: \"@voyant-travel/auth-react/i18n\",\n export: \"authUiMessageDefinitions\",\n },\n },\n ],\n routes: [\n {\n id: \"@voyant-travel/auth#storefront.admin.route\",\n path: \"/storefronts\",\n requiredScopes: [\"storefronts:read\"],\n runtime: {\n entry: \"@voyant-travel/auth-react/admin\",\n export: \"createSelectedStorefrontAdminExtension\",\n },\n },\n ],\n },\n meta: {\n ownership: \"package\",\n agentTools: {\n posture: \"not-applicable\",\n rationale:\n \"Storefront access configuration is operator-owned; it is exposed through guarded admin surfaces, not agent tools.\",\n },\n },\n})\n"]}
@@ -0,0 +1,133 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Voyant Auth Storefronts Admin API",
5
+ "version": "1.0.0"
6
+ },
7
+ "paths": {
8
+ "/v1/admin/storefronts/capabilities": {
9
+ "get": {
10
+ "operationId": "getStorefrontCapabilities",
11
+ "tags": ["Storefronts"],
12
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
13
+ "responses": { "200": { "description": "Storefront admin capabilities." } }
14
+ }
15
+ },
16
+ "/v1/admin/storefronts/storefronts": {
17
+ "get": {
18
+ "operationId": "listStorefronts",
19
+ "tags": ["Storefronts"],
20
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
21
+ "responses": { "200": { "description": "Storefronts for the operator organization." } }
22
+ },
23
+ "post": {
24
+ "operationId": "createStorefront",
25
+ "tags": ["Storefronts"],
26
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
27
+ "responses": { "201": { "description": "Created storefront." } }
28
+ }
29
+ },
30
+ "/v1/admin/storefronts/storefronts/{storefrontId}": {
31
+ "get": {
32
+ "operationId": "getStorefront",
33
+ "tags": ["Storefronts"],
34
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
35
+ "responses": { "200": { "description": "Storefront detail." } }
36
+ },
37
+ "patch": {
38
+ "operationId": "updateStorefront",
39
+ "tags": ["Storefronts"],
40
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
41
+ "responses": { "200": { "description": "Updated storefront." } }
42
+ },
43
+ "delete": {
44
+ "operationId": "deleteStorefront",
45
+ "tags": ["Storefronts"],
46
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
47
+ "responses": { "204": { "description": "Storefront deleted." } }
48
+ }
49
+ },
50
+ "/v1/admin/storefronts/storefronts/{storefrontId}/allowed-origins": {
51
+ "put": {
52
+ "operationId": "setStorefrontAllowedOrigins",
53
+ "tags": ["Storefronts"],
54
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
55
+ "responses": { "200": { "description": "Updated storefront allowed origins." } }
56
+ }
57
+ },
58
+ "/v1/admin/storefronts/storefronts/{storefrontId}/keys": {
59
+ "get": {
60
+ "operationId": "listStorefrontApiKeys",
61
+ "tags": ["Storefronts"],
62
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
63
+ "responses": { "200": { "description": "Storefront access keys." } }
64
+ },
65
+ "post": {
66
+ "operationId": "issueStorefrontApiKey",
67
+ "tags": ["Storefronts"],
68
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
69
+ "responses": {
70
+ "201": { "description": "Issued access key, plaintext token revealed once." }
71
+ }
72
+ }
73
+ },
74
+ "/v1/admin/storefronts/storefronts/{storefrontId}/keys/{keyId}/rotate": {
75
+ "post": {
76
+ "operationId": "rotateStorefrontApiKey",
77
+ "tags": ["Storefronts"],
78
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
79
+ "responses": {
80
+ "201": { "description": "Rotated access key, plaintext token revealed once." }
81
+ }
82
+ }
83
+ },
84
+ "/v1/admin/storefronts/storefronts/{storefrontId}/keys/{keyId}": {
85
+ "delete": {
86
+ "operationId": "revokeStorefrontApiKey",
87
+ "tags": ["Storefronts"],
88
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
89
+ "responses": { "204": { "description": "Access key revoked." } }
90
+ }
91
+ },
92
+ "/v1/admin/storefronts/storefronts/{storefrontId}/account-policy": {
93
+ "put": {
94
+ "operationId": "updateStorefrontAccountPolicy",
95
+ "tags": ["Storefronts"],
96
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
97
+ "responses": { "200": { "description": "Updated buyer-account policy." } }
98
+ }
99
+ },
100
+ "/v1/admin/storefronts/storefronts/{storefrontId}/methods": {
101
+ "put": {
102
+ "operationId": "updateStorefrontMethods",
103
+ "tags": ["Storefronts"],
104
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
105
+ "responses": { "200": { "description": "Updated customer auth methods." } }
106
+ }
107
+ },
108
+ "/v1/admin/storefronts/storefronts/{storefrontId}/provider-credentials": {
109
+ "get": {
110
+ "operationId": "listStorefrontProviderCredentials",
111
+ "tags": ["Storefronts"],
112
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
113
+ "responses": {
114
+ "200": { "description": "Provider credential status (never secret values)." }
115
+ }
116
+ }
117
+ },
118
+ "/v1/admin/storefronts/storefronts/{storefrontId}/provider-credentials/{provider}": {
119
+ "put": {
120
+ "operationId": "putStorefrontProviderCredential",
121
+ "tags": ["Storefronts"],
122
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
123
+ "responses": { "204": { "description": "Provider credential stored." } }
124
+ },
125
+ "delete": {
126
+ "operationId": "deleteStorefrontProviderCredential",
127
+ "tags": ["Storefronts"],
128
+ "x-voyant-api-id": "@voyant-travel/auth#storefront.api.admin",
129
+ "responses": { "204": { "description": "Provider credential cleared." } }
130
+ }
131
+ }
132
+ }
133
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/auth",
3
- "version": "0.139.0",
3
+ "version": "0.140.1",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -102,6 +102,16 @@
102
102
  "import": "./dist/storefront-runtime-port.js",
103
103
  "default": "./dist/storefront-runtime-port.js"
104
104
  },
105
+ "./storefront-admin-contracts": {
106
+ "types": "./dist/storefront-admin-contracts.d.ts",
107
+ "import": "./dist/storefront-admin-contracts.js",
108
+ "default": "./dist/storefront-admin-contracts.js"
109
+ },
110
+ "./storefront-graph-runtime": {
111
+ "types": "./dist/storefront-graph-runtime.d.ts",
112
+ "import": "./dist/storefront-graph-runtime.js",
113
+ "default": "./dist/storefront-graph-runtime.js"
114
+ },
105
115
  "./storefront-local-adapter": {
106
116
  "types": "./dist/storefront-local-adapter.d.ts",
107
117
  "import": "./dist/storefront-local-adapter.js",
@@ -135,6 +145,7 @@
135
145
  "./openapi/admin/invitations": "./openapi/admin/invitations.json",
136
146
  "./openapi/admin/team": "./openapi/admin/team.json",
137
147
  "./openapi/admin/customer-business-accounts": "./openapi/admin/customer-business-accounts.json",
148
+ "./openapi/admin/storefronts": "./openapi/admin/storefronts.json",
138
149
  "./openapi/storefront/invitations": "./openapi/storefront/invitations.json",
139
150
  "./voyant": {
140
151
  "types": "./dist/voyant.d.ts",