@krak-stack/auth 0.1.15 → 0.1.17
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/client.d.ts +32 -32
- package/dist/components/organization-switcher.js +70 -47
- package/dist/components/user-button.js +11 -20
- package/dist/schema.d.ts +12 -12
- package/dist/schema.js +4 -4
- package/dist/server/api.d.ts +16 -16
- package/dist/server/schema.d.ts +4 -4
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -23,10 +23,10 @@ declare const AuthApiClients_base: Context.ServiceClass<AuthApiClients, "@krak-s
|
|
|
23
23
|
readonly translations: readonly {
|
|
24
24
|
readonly locale: "en" | "fr";
|
|
25
25
|
readonly name: string;
|
|
26
|
-
readonly logo
|
|
27
|
-
readonly icon
|
|
28
|
-
readonly contactEmail
|
|
29
|
-
readonly location
|
|
26
|
+
readonly logo?: string | null | undefined;
|
|
27
|
+
readonly icon?: string | null | undefined;
|
|
28
|
+
readonly contactEmail?: string | null | undefined;
|
|
29
|
+
readonly location?: string | null | undefined;
|
|
30
30
|
}[];
|
|
31
31
|
} | null;
|
|
32
32
|
readonly createdAt: Date;
|
|
@@ -47,10 +47,10 @@ declare const AuthApiClients_base: Context.ServiceClass<AuthApiClients, "@krak-s
|
|
|
47
47
|
readonly translations: readonly {
|
|
48
48
|
readonly locale: "en" | "fr";
|
|
49
49
|
readonly name: string;
|
|
50
|
-
readonly logo
|
|
51
|
-
readonly icon
|
|
52
|
-
readonly contactEmail
|
|
53
|
-
readonly location
|
|
50
|
+
readonly logo?: string | null | undefined;
|
|
51
|
+
readonly icon?: string | null | undefined;
|
|
52
|
+
readonly contactEmail?: string | null | undefined;
|
|
53
|
+
readonly location?: string | null | undefined;
|
|
54
54
|
}[];
|
|
55
55
|
} | null;
|
|
56
56
|
readonly createdAt: Date;
|
|
@@ -276,10 +276,10 @@ declare const AuthApiClients_base: Context.ServiceClass<AuthApiClients, "@krak-s
|
|
|
276
276
|
readonly translations: readonly {
|
|
277
277
|
readonly locale: "en" | "fr";
|
|
278
278
|
readonly name: string;
|
|
279
|
-
readonly logo
|
|
280
|
-
readonly icon
|
|
281
|
-
readonly contactEmail
|
|
282
|
-
readonly location
|
|
279
|
+
readonly logo?: string | null | undefined;
|
|
280
|
+
readonly icon?: string | null | undefined;
|
|
281
|
+
readonly contactEmail?: string | null | undefined;
|
|
282
|
+
readonly location?: string | null | undefined;
|
|
283
283
|
}[];
|
|
284
284
|
} | null;
|
|
285
285
|
readonly createdAt: Date;
|
|
@@ -300,10 +300,10 @@ declare const AuthApiClients_base: Context.ServiceClass<AuthApiClients, "@krak-s
|
|
|
300
300
|
readonly translations: readonly {
|
|
301
301
|
readonly locale: "en" | "fr";
|
|
302
302
|
readonly name: string;
|
|
303
|
-
readonly logo
|
|
304
|
-
readonly icon
|
|
305
|
-
readonly contactEmail
|
|
306
|
-
readonly location
|
|
303
|
+
readonly logo?: string | null | undefined;
|
|
304
|
+
readonly icon?: string | null | undefined;
|
|
305
|
+
readonly contactEmail?: string | null | undefined;
|
|
306
|
+
readonly location?: string | null | undefined;
|
|
307
307
|
}[];
|
|
308
308
|
} | null;
|
|
309
309
|
readonly createdAt: Date;
|
|
@@ -558,10 +558,10 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
558
558
|
readonly translations: readonly {
|
|
559
559
|
readonly locale: "en" | "fr";
|
|
560
560
|
readonly name: string;
|
|
561
|
-
readonly logo
|
|
562
|
-
readonly icon
|
|
563
|
-
readonly contactEmail
|
|
564
|
-
readonly location
|
|
561
|
+
readonly logo?: string | null | undefined;
|
|
562
|
+
readonly icon?: string | null | undefined;
|
|
563
|
+
readonly contactEmail?: string | null | undefined;
|
|
564
|
+
readonly location?: string | null | undefined;
|
|
565
565
|
}[];
|
|
566
566
|
} | null;
|
|
567
567
|
readonly createdAt: Date;
|
|
@@ -582,10 +582,10 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
582
582
|
readonly translations: readonly {
|
|
583
583
|
readonly locale: "en" | "fr";
|
|
584
584
|
readonly name: string;
|
|
585
|
-
readonly logo
|
|
586
|
-
readonly icon
|
|
587
|
-
readonly contactEmail
|
|
588
|
-
readonly location
|
|
585
|
+
readonly logo?: string | null | undefined;
|
|
586
|
+
readonly icon?: string | null | undefined;
|
|
587
|
+
readonly contactEmail?: string | null | undefined;
|
|
588
|
+
readonly location?: string | null | undefined;
|
|
589
589
|
}[];
|
|
590
590
|
} | null;
|
|
591
591
|
readonly createdAt: Date;
|
|
@@ -809,10 +809,10 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
809
809
|
readonly translations: readonly {
|
|
810
810
|
readonly locale: "en" | "fr";
|
|
811
811
|
readonly name: string;
|
|
812
|
-
readonly logo
|
|
813
|
-
readonly icon
|
|
814
|
-
readonly contactEmail
|
|
815
|
-
readonly location
|
|
812
|
+
readonly logo?: string | null | undefined;
|
|
813
|
+
readonly icon?: string | null | undefined;
|
|
814
|
+
readonly contactEmail?: string | null | undefined;
|
|
815
|
+
readonly location?: string | null | undefined;
|
|
816
816
|
}[];
|
|
817
817
|
} | null;
|
|
818
818
|
readonly createdAt: Date;
|
|
@@ -833,10 +833,10 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
833
833
|
readonly translations: readonly {
|
|
834
834
|
readonly locale: "en" | "fr";
|
|
835
835
|
readonly name: string;
|
|
836
|
-
readonly logo
|
|
837
|
-
readonly icon
|
|
838
|
-
readonly contactEmail
|
|
839
|
-
readonly location
|
|
836
|
+
readonly logo?: string | null | undefined;
|
|
837
|
+
readonly icon?: string | null | undefined;
|
|
838
|
+
readonly contactEmail?: string | null | undefined;
|
|
839
|
+
readonly location?: string | null | undefined;
|
|
840
840
|
}[];
|
|
841
841
|
} | null;
|
|
842
842
|
readonly createdAt: Date;
|
|
@@ -209,7 +209,6 @@ const isOrganizationSlugConflict = (error) => {
|
|
|
209
209
|
});
|
|
210
210
|
};
|
|
211
211
|
const nullableString = (value) => typeof value === "string" && value.trim() ? value.trim() : null;
|
|
212
|
-
const centralAuthUrl = (path) => new URL(path, import.meta.env.VITE_KRAKSTACK_AUTH_URL).toString();
|
|
213
212
|
const parsePresignedUpload = (value, m) => {
|
|
214
213
|
if (!isRecord(value) ||
|
|
215
214
|
typeof value.uploadUrl !== "string" ||
|
|
@@ -219,18 +218,16 @@ const parsePresignedUpload = (value, m) => {
|
|
|
219
218
|
return { uploadUrl: value.uploadUrl, url: value.url };
|
|
220
219
|
};
|
|
221
220
|
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
222
|
-
const uploadOrganizationLogo = async (file, m) => {
|
|
221
|
+
const uploadOrganizationLogo = async (authClient, file, m) => {
|
|
223
222
|
const contentType = file.type || "image/png";
|
|
224
|
-
const
|
|
223
|
+
const presignResult = await authClient.$fetch("../organizations/logo/presign", {
|
|
225
224
|
method: "POST",
|
|
226
|
-
|
|
227
|
-
headers: { "Content-Type": "application/json" },
|
|
228
|
-
body: JSON.stringify({ fileName: file.name, contentType }),
|
|
225
|
+
body: { fileName: file.name, contentType },
|
|
229
226
|
});
|
|
230
|
-
if (
|
|
227
|
+
if (presignResult.error) {
|
|
231
228
|
throw new Error(m.organization_logo_upload_error());
|
|
232
229
|
}
|
|
233
|
-
const presigned = parsePresignedUpload(
|
|
230
|
+
const presigned = parsePresignedUpload(presignResult.data, m);
|
|
234
231
|
const uploadResponse = await fetch(presigned.uploadUrl, {
|
|
235
232
|
method: "PUT",
|
|
236
233
|
headers: { "Content-Type": contentType },
|
|
@@ -239,7 +236,7 @@ const uploadOrganizationLogo = async (file, m) => {
|
|
|
239
236
|
if (!uploadResponse.ok) {
|
|
240
237
|
throw new Error(m.organization_logo_upload_error());
|
|
241
238
|
}
|
|
242
|
-
return
|
|
239
|
+
return presigned.url;
|
|
243
240
|
};
|
|
244
241
|
const currentOrganizationLocale = () => getLocale() === "fr" ? "fr" : "en";
|
|
245
242
|
const parseOrganizationMetadata = (metadata) => {
|
|
@@ -291,7 +288,9 @@ const organizationFormDefaults = (organization) => {
|
|
|
291
288
|
frLocation: fr?.location ?? "",
|
|
292
289
|
};
|
|
293
290
|
};
|
|
294
|
-
const organizationLogoFromForm = async (file, fallback, m) =>
|
|
291
|
+
const organizationLogoFromForm = async (authClient, file, fallback, m) => file
|
|
292
|
+
? await uploadOrganizationLogo(authClient, file, m)
|
|
293
|
+
: nullableString(fallback);
|
|
295
294
|
const organizationRoles = ["owner", "admin", "member"];
|
|
296
295
|
const normalizeOrganizationRole = (role) => role === "owner" || role === "admin" || role === "member" ? role : "member";
|
|
297
296
|
const organizationRoleLabel = (role, m) => {
|
|
@@ -312,14 +311,14 @@ const initialsFromName = (name) => name
|
|
|
312
311
|
.map((part) => part[0])
|
|
313
312
|
.join("")
|
|
314
313
|
.toUpperCase() || "?";
|
|
315
|
-
const organizationMetadataFromForm = async (value, m) => {
|
|
314
|
+
const organizationMetadataFromForm = async (authClient, value, m) => {
|
|
316
315
|
const translations = [];
|
|
317
316
|
const enName = value.enName.trim() || value.name.trim();
|
|
318
317
|
const frName = value.frName.trim();
|
|
319
|
-
const enLogo = await organizationLogoFromForm(value.enLogo, value.enLogoUrl, m);
|
|
320
|
-
const enIcon = await organizationLogoFromForm(value.enIcon, value.enIconUrl, m);
|
|
321
|
-
const frLogo = await organizationLogoFromForm(value.frLogo, value.frLogoUrl, m);
|
|
322
|
-
const frIcon = await organizationLogoFromForm(value.frIcon, value.frIconUrl, m);
|
|
318
|
+
const enLogo = await organizationLogoFromForm(authClient, value.enLogo, value.enLogoUrl, m);
|
|
319
|
+
const enIcon = await organizationLogoFromForm(authClient, value.enIcon, value.enIconUrl, m);
|
|
320
|
+
const frLogo = await organizationLogoFromForm(authClient, value.frLogo, value.frLogoUrl, m);
|
|
321
|
+
const frIcon = await organizationLogoFromForm(authClient, value.frIcon, value.frIconUrl, m);
|
|
323
322
|
if (enName) {
|
|
324
323
|
translations.push({
|
|
325
324
|
locale: "en",
|
|
@@ -525,23 +524,35 @@ function EditOrganizationSection({ authClient, organization, onUpdated, }) {
|
|
|
525
524
|
defaultValues,
|
|
526
525
|
onSubmit: async ({ value, formApi }) => {
|
|
527
526
|
formApi.setErrorMap({ onSubmit: undefined });
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
527
|
+
try {
|
|
528
|
+
const name = value.name.trim();
|
|
529
|
+
const slug = value.slug.trim().toLowerCase();
|
|
530
|
+
const metadata = await organizationMetadataFromForm(authClient, value, m);
|
|
531
|
+
const result = await authClient.organization.update({
|
|
532
|
+
organizationId: organization.id,
|
|
533
|
+
data: { name, slug, metadata },
|
|
534
|
+
});
|
|
535
|
+
if (result.error) {
|
|
536
|
+
formApi.setErrorMap({
|
|
537
|
+
onSubmit: {
|
|
538
|
+
form: result.error.message ?? m.organization_update_error(),
|
|
539
|
+
fields: {},
|
|
540
|
+
},
|
|
541
|
+
});
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
await onUpdated();
|
|
545
|
+
}
|
|
546
|
+
catch (cause) {
|
|
536
547
|
formApi.setErrorMap({
|
|
537
548
|
onSubmit: {
|
|
538
|
-
form:
|
|
549
|
+
form: cause instanceof Error
|
|
550
|
+
? cause.message
|
|
551
|
+
: m.organization_update_error(),
|
|
539
552
|
fields: {},
|
|
540
553
|
},
|
|
541
554
|
});
|
|
542
|
-
return;
|
|
543
555
|
}
|
|
544
|
-
await onUpdated();
|
|
545
556
|
},
|
|
546
557
|
});
|
|
547
558
|
return (_jsx("section", { className: "flex flex-col gap-4", children: _jsx(form.AppForm, { children: _jsxs("form", { className: "flex max-w-xl flex-col gap-4", onSubmit: (event) => {
|
|
@@ -588,39 +599,51 @@ function CreateOrganizationSection({ authClient, onCreated, }) {
|
|
|
588
599
|
defaultValues,
|
|
589
600
|
onSubmit: async ({ value, formApi }) => {
|
|
590
601
|
formApi.setErrorMap({ onSubmit: undefined });
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
if (
|
|
602
|
+
try {
|
|
603
|
+
const name = value.name.trim();
|
|
604
|
+
const slug = (value.slug.trim() || slugify(name)).toLowerCase();
|
|
605
|
+
const metadata = await organizationMetadataFromForm(authClient, {
|
|
606
|
+
...value,
|
|
607
|
+
name,
|
|
608
|
+
slug,
|
|
609
|
+
}, m);
|
|
610
|
+
const result = await authClient.organization.create({
|
|
611
|
+
name,
|
|
612
|
+
slug,
|
|
613
|
+
metadata,
|
|
614
|
+
});
|
|
615
|
+
if (result.error) {
|
|
616
|
+
if (isOrganizationSlugConflict(result.error)) {
|
|
617
|
+
formApi.setErrorMap({
|
|
618
|
+
onSubmit: {
|
|
619
|
+
fields: {
|
|
620
|
+
slug: { message: m.organization_create_slug_conflict() },
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
});
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
605
626
|
formApi.setErrorMap({
|
|
606
627
|
onSubmit: {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
},
|
|
628
|
+
form: result.error.message ?? m.organization_create_error(),
|
|
629
|
+
fields: {},
|
|
610
630
|
},
|
|
611
631
|
});
|
|
612
632
|
return;
|
|
613
633
|
}
|
|
634
|
+
form.reset();
|
|
635
|
+
await onCreated(result.data);
|
|
636
|
+
}
|
|
637
|
+
catch (cause) {
|
|
614
638
|
formApi.setErrorMap({
|
|
615
639
|
onSubmit: {
|
|
616
|
-
form:
|
|
640
|
+
form: cause instanceof Error
|
|
641
|
+
? cause.message
|
|
642
|
+
: m.organization_create_error(),
|
|
617
643
|
fields: {},
|
|
618
644
|
},
|
|
619
645
|
});
|
|
620
|
-
return;
|
|
621
646
|
}
|
|
622
|
-
form.reset();
|
|
623
|
-
await onCreated(result.data);
|
|
624
647
|
},
|
|
625
648
|
});
|
|
626
649
|
return (_jsx("section", { className: "flex flex-col gap-4", children: _jsx(form.AppForm, { children: _jsxs("form", { className: "flex max-w-xl flex-col gap-4", onSubmit: (event) => {
|
|
@@ -201,25 +201,18 @@ const userButtonMessageFns = (labels) => {
|
|
|
201
201
|
const UserButtonMessagesContext = createContext(userButtonMessageFns(userButtonMessages()));
|
|
202
202
|
const useUserButtonMessages = () => useContext(UserButtonMessagesContext);
|
|
203
203
|
const isFile = (value) => value instanceof File;
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
"
|
|
207
|
-
const
|
|
208
|
-
const response = await fetch(authUrl("/api/auth/image/presign"), {
|
|
204
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
205
|
+
const presignUserImageUpload = async (authClient, file, m) => {
|
|
206
|
+
const contentType = file.type || "image/png";
|
|
207
|
+
const result = await authClient.$fetch("/image/presign", {
|
|
209
208
|
method: "POST",
|
|
210
|
-
|
|
211
|
-
headers: { "Content-Type": "application/json" },
|
|
212
|
-
body: JSON.stringify({ fileName: file.name, contentType: file.type }),
|
|
209
|
+
body: { fileName: file.name, contentType },
|
|
213
210
|
});
|
|
214
|
-
if (!
|
|
211
|
+
if (result.error || !isRecord(result.data)) {
|
|
215
212
|
throw new Error(m.user_profile_image_upload_error());
|
|
216
213
|
}
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
throw new Error(m.user_profile_image_upload_error());
|
|
220
|
-
}
|
|
221
|
-
const uploadUrl = Reflect.get(body, "uploadUrl");
|
|
222
|
-
const url = Reflect.get(body, "url");
|
|
214
|
+
const uploadUrl = Reflect.get(result.data, "uploadUrl");
|
|
215
|
+
const url = Reflect.get(result.data, "url");
|
|
223
216
|
if (typeof uploadUrl !== "string" || typeof url !== "string") {
|
|
224
217
|
throw new Error(m.user_profile_image_upload_error());
|
|
225
218
|
}
|
|
@@ -240,9 +233,7 @@ export const UserButton = ({ authClient, signOutRedirect = "/", side = "bottom",
|
|
|
240
233
|
}
|
|
241
234
|
const displayName = session.user.name.trim();
|
|
242
235
|
const displayEmail = session.user.email.trim();
|
|
243
|
-
const displayImage = session.user.image?.trim()
|
|
244
|
-
? authUrl(session.user.image.trim())
|
|
245
|
-
: "";
|
|
236
|
+
const displayImage = session.user.image?.trim() ?? "";
|
|
246
237
|
const signOut = async () => {
|
|
247
238
|
const redirectUrl = signOutRedirect.startsWith("http")
|
|
248
239
|
? signOutRedirect
|
|
@@ -255,10 +246,10 @@ export const UserButton = ({ authClient, signOutRedirect = "/", side = "bottom",
|
|
|
255
246
|
const imageFile = isFile(values.image) ? values.image : null;
|
|
256
247
|
const image = imageFile
|
|
257
248
|
? await (async () => {
|
|
258
|
-
const presigned = await presignUserImageUpload(imageFile, m);
|
|
249
|
+
const presigned = await presignUserImageUpload(authClient, imageFile, m);
|
|
259
250
|
const uploadResponse = await fetch(presigned.uploadUrl, {
|
|
260
251
|
method: "PUT",
|
|
261
|
-
headers: { "Content-Type": imageFile.type },
|
|
252
|
+
headers: { "Content-Type": imageFile.type || "image/png" },
|
|
262
253
|
body: imageFile,
|
|
263
254
|
});
|
|
264
255
|
if (!uploadResponse.ok) {
|
package/dist/schema.d.ts
CHANGED
|
@@ -26,19 +26,19 @@ export declare const OrganizationLocale: Schema.Union<readonly [Schema.Literal<"
|
|
|
26
26
|
export declare const OrganizationTranslation: Schema.Struct<{
|
|
27
27
|
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
28
28
|
readonly name: Schema.String;
|
|
29
|
-
readonly logo: Schema.NullOr<Schema.String
|
|
30
|
-
readonly icon: Schema.NullOr<Schema.String
|
|
31
|
-
readonly contactEmail: Schema.NullOr<Schema.String
|
|
32
|
-
readonly location: Schema.NullOr<Schema.String
|
|
29
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
30
|
+
readonly icon: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
31
|
+
readonly contactEmail: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
32
|
+
readonly location: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
33
33
|
}>;
|
|
34
34
|
export declare const OrganizationMetadata: Schema.Struct<{
|
|
35
35
|
readonly translations: Schema.$Array<Schema.Struct<{
|
|
36
36
|
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
37
37
|
readonly name: Schema.String;
|
|
38
|
-
readonly logo: Schema.NullOr<Schema.String
|
|
39
|
-
readonly icon: Schema.NullOr<Schema.String
|
|
40
|
-
readonly contactEmail: Schema.NullOr<Schema.String
|
|
41
|
-
readonly location: Schema.NullOr<Schema.String
|
|
38
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
39
|
+
readonly icon: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
40
|
+
readonly contactEmail: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
41
|
+
readonly location: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
42
42
|
}>>;
|
|
43
43
|
}>;
|
|
44
44
|
export declare const Organization: Schema.Struct<{
|
|
@@ -50,10 +50,10 @@ export declare const Organization: Schema.Struct<{
|
|
|
50
50
|
readonly translations: Schema.$Array<Schema.Struct<{
|
|
51
51
|
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
52
52
|
readonly name: Schema.String;
|
|
53
|
-
readonly logo: Schema.NullOr<Schema.String
|
|
54
|
-
readonly icon: Schema.NullOr<Schema.String
|
|
55
|
-
readonly contactEmail: Schema.NullOr<Schema.String
|
|
56
|
-
readonly location: Schema.NullOr<Schema.String
|
|
53
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
54
|
+
readonly icon: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
55
|
+
readonly contactEmail: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
56
|
+
readonly location: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
57
57
|
}>>;
|
|
58
58
|
}>>;
|
|
59
59
|
readonly createdAt: Schema.Date;
|
package/dist/schema.js
CHANGED
|
@@ -69,10 +69,10 @@ export const OrganizationLocale = Schema.Union([
|
|
|
69
69
|
export const OrganizationTranslation = Schema.Struct({
|
|
70
70
|
locale: OrganizationLocale,
|
|
71
71
|
name: Schema.String,
|
|
72
|
-
logo: Schema.NullOr(Schema.String),
|
|
73
|
-
icon: Schema.NullOr(Schema.String),
|
|
74
|
-
contactEmail: Schema.NullOr(Schema.String),
|
|
75
|
-
location: Schema.NullOr(Schema.String),
|
|
72
|
+
logo: Schema.optional(Schema.NullOr(Schema.String)),
|
|
73
|
+
icon: Schema.optional(Schema.NullOr(Schema.String)),
|
|
74
|
+
contactEmail: Schema.optional(Schema.NullOr(Schema.String)),
|
|
75
|
+
location: Schema.optional(Schema.NullOr(Schema.String)),
|
|
76
76
|
}).annotate({
|
|
77
77
|
identifier: "OrganizationTranslation",
|
|
78
78
|
title: "Organization translation",
|
package/dist/server/api.d.ts
CHANGED
|
@@ -45,10 +45,10 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"ser
|
|
|
45
45
|
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
46
46
|
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
47
47
|
readonly name: import("effect/Schema").String;
|
|
48
|
-
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
49
|
-
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
50
|
-
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
51
|
-
readonly location: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
48
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
49
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
50
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
51
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
52
52
|
}>>;
|
|
53
53
|
}>>;
|
|
54
54
|
readonly createdAt: import("effect/Schema").Date;
|
|
@@ -65,10 +65,10 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"ser
|
|
|
65
65
|
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
66
66
|
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
67
67
|
readonly name: import("effect/Schema").String;
|
|
68
|
-
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
69
|
-
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
70
|
-
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
71
|
-
readonly location: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
68
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
69
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
70
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
71
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
72
72
|
}>>;
|
|
73
73
|
}>>;
|
|
74
74
|
readonly createdAt: import("effect/Schema").Date;
|
|
@@ -156,10 +156,10 @@ export declare const ServerApi: HttpApi.HttpApi<"ServerApi", HttpApiGroup.HttpAp
|
|
|
156
156
|
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
157
157
|
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
158
158
|
readonly name: import("effect/Schema").String;
|
|
159
|
-
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
160
|
-
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
161
|
-
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
162
|
-
readonly location: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
159
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
160
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
161
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
162
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
163
163
|
}>>;
|
|
164
164
|
}>>;
|
|
165
165
|
readonly createdAt: import("effect/Schema").Date;
|
|
@@ -176,10 +176,10 @@ export declare const ServerApi: HttpApi.HttpApi<"ServerApi", HttpApiGroup.HttpAp
|
|
|
176
176
|
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
177
177
|
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
178
178
|
readonly name: import("effect/Schema").String;
|
|
179
|
-
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
180
|
-
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
181
|
-
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
182
|
-
readonly location: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
179
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
180
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
181
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
182
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
183
183
|
}>>;
|
|
184
184
|
}>>;
|
|
185
185
|
readonly createdAt: import("effect/Schema").Date;
|
package/dist/server/schema.d.ts
CHANGED
|
@@ -46,10 +46,10 @@ export declare const ServerOrganizationsResponse: Schema.Struct<{
|
|
|
46
46
|
readonly translations: Schema.$Array<Schema.Struct<{
|
|
47
47
|
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
48
48
|
readonly name: Schema.String;
|
|
49
|
-
readonly logo: Schema.NullOr<Schema.String
|
|
50
|
-
readonly icon: Schema.NullOr<Schema.String
|
|
51
|
-
readonly contactEmail: Schema.NullOr<Schema.String
|
|
52
|
-
readonly location: Schema.NullOr<Schema.String
|
|
49
|
+
readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
50
|
+
readonly icon: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
51
|
+
readonly contactEmail: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
52
|
+
readonly location: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
53
53
|
}>>;
|
|
54
54
|
}>>;
|
|
55
55
|
readonly createdAt: Schema.Date;
|