@krak-stack/auth 0.1.22 → 0.1.24
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 +324 -0
- package/dist/client.js +12 -0
- package/dist/components/organization-switcher.js +58 -52
- package/dist/components/user-button.js +11 -11
- package/dist/server/api.d.ts +120 -1
- package/dist/server/api.js +56 -1
- package/dist/server/schema.d.ts +40 -0
- package/dist/server/schema.js +78 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -7,6 +7,87 @@ export type AuthClientLayerOptions = Partial<ClientConfig> & {
|
|
|
7
7
|
};
|
|
8
8
|
declare const AuthApiClients_base: Context.ServiceClass<AuthApiClients, "@krak-stack/auth/AuthApiClients", {
|
|
9
9
|
server: {
|
|
10
|
+
domains: {
|
|
11
|
+
create: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
12
|
+
readonly payload: {
|
|
13
|
+
readonly hostname: string;
|
|
14
|
+
readonly rootHostname: string;
|
|
15
|
+
readonly projectId?: string | null | undefined;
|
|
16
|
+
readonly organizationId?: string | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
readonly responseMode?: Mode;
|
|
19
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly hostname: string;
|
|
22
|
+
readonly rootHostname: string;
|
|
23
|
+
readonly projectId: string | null;
|
|
24
|
+
readonly organizationId: string | null;
|
|
25
|
+
readonly hostnameId: string;
|
|
26
|
+
readonly active: boolean;
|
|
27
|
+
readonly createdAt: Date;
|
|
28
|
+
readonly updatedAt: Date;
|
|
29
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
30
|
+
get: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
31
|
+
readonly params: {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
};
|
|
34
|
+
readonly responseMode?: Mode;
|
|
35
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly hostname: string;
|
|
38
|
+
readonly rootHostname: string;
|
|
39
|
+
readonly projectId: string | null;
|
|
40
|
+
readonly organizationId: string | null;
|
|
41
|
+
readonly hostnameId: string;
|
|
42
|
+
readonly active: boolean;
|
|
43
|
+
readonly createdAt: Date;
|
|
44
|
+
readonly updatedAt: Date;
|
|
45
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
46
|
+
getByHost: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
47
|
+
readonly params: {
|
|
48
|
+
readonly hostname: string;
|
|
49
|
+
};
|
|
50
|
+
readonly responseMode?: Mode;
|
|
51
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly hostname: string;
|
|
54
|
+
readonly rootHostname: string;
|
|
55
|
+
readonly projectId: string | null;
|
|
56
|
+
readonly organizationId: string | null;
|
|
57
|
+
readonly hostnameId: string;
|
|
58
|
+
readonly active: boolean;
|
|
59
|
+
readonly createdAt: Date;
|
|
60
|
+
readonly updatedAt: Date;
|
|
61
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
62
|
+
records: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
63
|
+
readonly params: {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
};
|
|
66
|
+
readonly responseMode?: Mode;
|
|
67
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<readonly {
|
|
68
|
+
readonly required: boolean;
|
|
69
|
+
readonly status: string;
|
|
70
|
+
readonly type: string;
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly value: string;
|
|
73
|
+
}[], Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
74
|
+
delete: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
75
|
+
readonly params: {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
};
|
|
78
|
+
readonly responseMode?: Mode;
|
|
79
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly hostname: string;
|
|
82
|
+
readonly rootHostname: string;
|
|
83
|
+
readonly projectId: string | null;
|
|
84
|
+
readonly organizationId: string | null;
|
|
85
|
+
readonly hostnameId: string;
|
|
86
|
+
readonly active: boolean;
|
|
87
|
+
readonly createdAt: Date;
|
|
88
|
+
readonly updatedAt: Date;
|
|
89
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
90
|
+
};
|
|
10
91
|
listOrganizations: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
11
92
|
readonly query: {
|
|
12
93
|
readonly ids?: string | undefined;
|
|
@@ -260,6 +341,87 @@ declare const AuthApiClients_base: Context.ServiceClass<AuthApiClients, "@krak-s
|
|
|
260
341
|
}> & {
|
|
261
342
|
readonly make: Effect.Effect<{
|
|
262
343
|
server: {
|
|
344
|
+
domains: {
|
|
345
|
+
create: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
346
|
+
readonly payload: {
|
|
347
|
+
readonly hostname: string;
|
|
348
|
+
readonly rootHostname: string;
|
|
349
|
+
readonly projectId?: string | null | undefined;
|
|
350
|
+
readonly organizationId?: string | null | undefined;
|
|
351
|
+
};
|
|
352
|
+
readonly responseMode?: Mode;
|
|
353
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
354
|
+
readonly id: string;
|
|
355
|
+
readonly hostname: string;
|
|
356
|
+
readonly rootHostname: string;
|
|
357
|
+
readonly projectId: string | null;
|
|
358
|
+
readonly organizationId: string | null;
|
|
359
|
+
readonly hostnameId: string;
|
|
360
|
+
readonly active: boolean;
|
|
361
|
+
readonly createdAt: Date;
|
|
362
|
+
readonly updatedAt: Date;
|
|
363
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
364
|
+
get: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
365
|
+
readonly params: {
|
|
366
|
+
readonly id: string;
|
|
367
|
+
};
|
|
368
|
+
readonly responseMode?: Mode;
|
|
369
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
370
|
+
readonly id: string;
|
|
371
|
+
readonly hostname: string;
|
|
372
|
+
readonly rootHostname: string;
|
|
373
|
+
readonly projectId: string | null;
|
|
374
|
+
readonly organizationId: string | null;
|
|
375
|
+
readonly hostnameId: string;
|
|
376
|
+
readonly active: boolean;
|
|
377
|
+
readonly createdAt: Date;
|
|
378
|
+
readonly updatedAt: Date;
|
|
379
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
380
|
+
getByHost: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
381
|
+
readonly params: {
|
|
382
|
+
readonly hostname: string;
|
|
383
|
+
};
|
|
384
|
+
readonly responseMode?: Mode;
|
|
385
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
386
|
+
readonly id: string;
|
|
387
|
+
readonly hostname: string;
|
|
388
|
+
readonly rootHostname: string;
|
|
389
|
+
readonly projectId: string | null;
|
|
390
|
+
readonly organizationId: string | null;
|
|
391
|
+
readonly hostnameId: string;
|
|
392
|
+
readonly active: boolean;
|
|
393
|
+
readonly createdAt: Date;
|
|
394
|
+
readonly updatedAt: Date;
|
|
395
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
396
|
+
records: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
397
|
+
readonly params: {
|
|
398
|
+
readonly id: string;
|
|
399
|
+
};
|
|
400
|
+
readonly responseMode?: Mode;
|
|
401
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<readonly {
|
|
402
|
+
readonly required: boolean;
|
|
403
|
+
readonly status: string;
|
|
404
|
+
readonly type: string;
|
|
405
|
+
readonly name: string;
|
|
406
|
+
readonly value: string;
|
|
407
|
+
}[], Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
408
|
+
delete: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
409
|
+
readonly params: {
|
|
410
|
+
readonly id: string;
|
|
411
|
+
};
|
|
412
|
+
readonly responseMode?: Mode;
|
|
413
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
414
|
+
readonly id: string;
|
|
415
|
+
readonly hostname: string;
|
|
416
|
+
readonly rootHostname: string;
|
|
417
|
+
readonly projectId: string | null;
|
|
418
|
+
readonly organizationId: string | null;
|
|
419
|
+
readonly hostnameId: string;
|
|
420
|
+
readonly active: boolean;
|
|
421
|
+
readonly createdAt: Date;
|
|
422
|
+
readonly updatedAt: Date;
|
|
423
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
424
|
+
};
|
|
263
425
|
listOrganizations: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
264
426
|
readonly query: {
|
|
265
427
|
readonly ids?: string | undefined;
|
|
@@ -542,6 +704,87 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
542
704
|
};
|
|
543
705
|
} | null, unknown, never>;
|
|
544
706
|
server: {
|
|
707
|
+
domains: {
|
|
708
|
+
create: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
709
|
+
readonly payload: {
|
|
710
|
+
readonly hostname: string;
|
|
711
|
+
readonly rootHostname: string;
|
|
712
|
+
readonly projectId?: string | null | undefined;
|
|
713
|
+
readonly organizationId?: string | null | undefined;
|
|
714
|
+
};
|
|
715
|
+
readonly responseMode?: Mode;
|
|
716
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
717
|
+
readonly id: string;
|
|
718
|
+
readonly hostname: string;
|
|
719
|
+
readonly rootHostname: string;
|
|
720
|
+
readonly projectId: string | null;
|
|
721
|
+
readonly organizationId: string | null;
|
|
722
|
+
readonly hostnameId: string;
|
|
723
|
+
readonly active: boolean;
|
|
724
|
+
readonly createdAt: Date;
|
|
725
|
+
readonly updatedAt: Date;
|
|
726
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
727
|
+
get: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
728
|
+
readonly params: {
|
|
729
|
+
readonly id: string;
|
|
730
|
+
};
|
|
731
|
+
readonly responseMode?: Mode;
|
|
732
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
733
|
+
readonly id: string;
|
|
734
|
+
readonly hostname: string;
|
|
735
|
+
readonly rootHostname: string;
|
|
736
|
+
readonly projectId: string | null;
|
|
737
|
+
readonly organizationId: string | null;
|
|
738
|
+
readonly hostnameId: string;
|
|
739
|
+
readonly active: boolean;
|
|
740
|
+
readonly createdAt: Date;
|
|
741
|
+
readonly updatedAt: Date;
|
|
742
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
743
|
+
getByHost: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
744
|
+
readonly params: {
|
|
745
|
+
readonly hostname: string;
|
|
746
|
+
};
|
|
747
|
+
readonly responseMode?: Mode;
|
|
748
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
749
|
+
readonly id: string;
|
|
750
|
+
readonly hostname: string;
|
|
751
|
+
readonly rootHostname: string;
|
|
752
|
+
readonly projectId: string | null;
|
|
753
|
+
readonly organizationId: string | null;
|
|
754
|
+
readonly hostnameId: string;
|
|
755
|
+
readonly active: boolean;
|
|
756
|
+
readonly createdAt: Date;
|
|
757
|
+
readonly updatedAt: Date;
|
|
758
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
759
|
+
records: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
760
|
+
readonly params: {
|
|
761
|
+
readonly id: string;
|
|
762
|
+
};
|
|
763
|
+
readonly responseMode?: Mode;
|
|
764
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<readonly {
|
|
765
|
+
readonly required: boolean;
|
|
766
|
+
readonly status: string;
|
|
767
|
+
readonly type: string;
|
|
768
|
+
readonly name: string;
|
|
769
|
+
readonly value: string;
|
|
770
|
+
}[], Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
771
|
+
delete: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
772
|
+
readonly params: {
|
|
773
|
+
readonly id: string;
|
|
774
|
+
};
|
|
775
|
+
readonly responseMode?: Mode;
|
|
776
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
777
|
+
readonly id: string;
|
|
778
|
+
readonly hostname: string;
|
|
779
|
+
readonly rootHostname: string;
|
|
780
|
+
readonly projectId: string | null;
|
|
781
|
+
readonly organizationId: string | null;
|
|
782
|
+
readonly hostnameId: string;
|
|
783
|
+
readonly active: boolean;
|
|
784
|
+
readonly createdAt: Date;
|
|
785
|
+
readonly updatedAt: Date;
|
|
786
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
787
|
+
};
|
|
545
788
|
listOrganizations: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
546
789
|
readonly query: {
|
|
547
790
|
readonly ids?: string | undefined;
|
|
@@ -793,6 +1036,87 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
793
1036
|
};
|
|
794
1037
|
} | null, unknown, never>;
|
|
795
1038
|
server: {
|
|
1039
|
+
domains: {
|
|
1040
|
+
create: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
1041
|
+
readonly payload: {
|
|
1042
|
+
readonly hostname: string;
|
|
1043
|
+
readonly rootHostname: string;
|
|
1044
|
+
readonly projectId?: string | null | undefined;
|
|
1045
|
+
readonly organizationId?: string | null | undefined;
|
|
1046
|
+
};
|
|
1047
|
+
readonly responseMode?: Mode;
|
|
1048
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
1049
|
+
readonly id: string;
|
|
1050
|
+
readonly hostname: string;
|
|
1051
|
+
readonly rootHostname: string;
|
|
1052
|
+
readonly projectId: string | null;
|
|
1053
|
+
readonly organizationId: string | null;
|
|
1054
|
+
readonly hostnameId: string;
|
|
1055
|
+
readonly active: boolean;
|
|
1056
|
+
readonly createdAt: Date;
|
|
1057
|
+
readonly updatedAt: Date;
|
|
1058
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
1059
|
+
get: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
1060
|
+
readonly params: {
|
|
1061
|
+
readonly id: string;
|
|
1062
|
+
};
|
|
1063
|
+
readonly responseMode?: Mode;
|
|
1064
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
1065
|
+
readonly id: string;
|
|
1066
|
+
readonly hostname: string;
|
|
1067
|
+
readonly rootHostname: string;
|
|
1068
|
+
readonly projectId: string | null;
|
|
1069
|
+
readonly organizationId: string | null;
|
|
1070
|
+
readonly hostnameId: string;
|
|
1071
|
+
readonly active: boolean;
|
|
1072
|
+
readonly createdAt: Date;
|
|
1073
|
+
readonly updatedAt: Date;
|
|
1074
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
1075
|
+
getByHost: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
1076
|
+
readonly params: {
|
|
1077
|
+
readonly hostname: string;
|
|
1078
|
+
};
|
|
1079
|
+
readonly responseMode?: Mode;
|
|
1080
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
1081
|
+
readonly id: string;
|
|
1082
|
+
readonly hostname: string;
|
|
1083
|
+
readonly rootHostname: string;
|
|
1084
|
+
readonly projectId: string | null;
|
|
1085
|
+
readonly organizationId: string | null;
|
|
1086
|
+
readonly hostnameId: string;
|
|
1087
|
+
readonly active: boolean;
|
|
1088
|
+
readonly createdAt: Date;
|
|
1089
|
+
readonly updatedAt: Date;
|
|
1090
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
1091
|
+
records: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
1092
|
+
readonly params: {
|
|
1093
|
+
readonly id: string;
|
|
1094
|
+
};
|
|
1095
|
+
readonly responseMode?: Mode;
|
|
1096
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<readonly {
|
|
1097
|
+
readonly required: boolean;
|
|
1098
|
+
readonly status: string;
|
|
1099
|
+
readonly type: string;
|
|
1100
|
+
readonly name: string;
|
|
1101
|
+
readonly value: string;
|
|
1102
|
+
}[], Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
1103
|
+
delete: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
1104
|
+
readonly params: {
|
|
1105
|
+
readonly id: string;
|
|
1106
|
+
};
|
|
1107
|
+
readonly responseMode?: Mode;
|
|
1108
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
1109
|
+
readonly id: string;
|
|
1110
|
+
readonly hostname: string;
|
|
1111
|
+
readonly rootHostname: string;
|
|
1112
|
+
readonly projectId: string | null;
|
|
1113
|
+
readonly organizationId: string | null;
|
|
1114
|
+
readonly hostnameId: string;
|
|
1115
|
+
readonly active: boolean;
|
|
1116
|
+
readonly createdAt: Date;
|
|
1117
|
+
readonly updatedAt: Date;
|
|
1118
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
1119
|
+
};
|
|
796
1120
|
listOrganizations: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
797
1121
|
readonly query: {
|
|
798
1122
|
readonly ids?: string | undefined;
|
package/dist/client.js
CHANGED
|
@@ -43,6 +43,11 @@ export class AuthApiClients extends Context.Service()("@krak-stack/auth/AuthApiC
|
|
|
43
43
|
baseUrl: config.baseUrl,
|
|
44
44
|
httpClient,
|
|
45
45
|
});
|
|
46
|
+
const serverDomains = yield* HttpApiClient.group(ServerApi, {
|
|
47
|
+
group: "serverDomains",
|
|
48
|
+
baseUrl: config.baseUrl,
|
|
49
|
+
httpClient,
|
|
50
|
+
});
|
|
46
51
|
const extra = yield* HttpApiClient.group(ExtraApi, {
|
|
47
52
|
group: "extra",
|
|
48
53
|
baseUrl: config.baseUrl,
|
|
@@ -58,6 +63,13 @@ export class AuthApiClients extends Context.Service()("@krak-stack/auth/AuthApiC
|
|
|
58
63
|
server: {
|
|
59
64
|
...serverUsers,
|
|
60
65
|
...serverOrganizations,
|
|
66
|
+
domains: {
|
|
67
|
+
create: serverDomains.createDomain,
|
|
68
|
+
get: serverDomains.getDomain,
|
|
69
|
+
getByHost: serverDomains.getDomainByHost,
|
|
70
|
+
records: serverDomains.getDomainRecords,
|
|
71
|
+
delete: serverDomains.deleteDomain,
|
|
72
|
+
},
|
|
61
73
|
},
|
|
62
74
|
extra,
|
|
63
75
|
};
|
|
@@ -4,7 +4,7 @@ import {} from "@tanstack/react-table";
|
|
|
4
4
|
import { Schema } from "effect";
|
|
5
5
|
import { Building2, Check, ChevronsUpDown, KeyRound, Mail, PencilIcon, Plus, Trash2, UserPlus, Users, X, } from "lucide-react";
|
|
6
6
|
import { createContext, useContext, useEffect, useEffectEvent, useState, } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { DataTable } from "@/components/ui/data-table";
|
|
8
8
|
import { EditingLocaleSwitcher } from "@/components/ui/editing-locale-switcher";
|
|
9
9
|
import { AppBrand } from "@/components/ui/app-brand";
|
|
10
10
|
import { useAppForm } from "@/components/ui/form";
|
|
@@ -486,12 +486,14 @@ function UserInvitationsManager({ authClient, invitations, loading, error, activ
|
|
|
486
486
|
};
|
|
487
487
|
return (_jsxs("section", { className: "flex flex-col gap-4", children: [error ? _jsx("p", { className: "text-destructive text-sm", children: error }) : null, actionError ? (_jsx("p", { className: "text-destructive text-sm", children: actionError })) : null, _jsx(DataTable, { columns: userInvitationColumns({
|
|
488
488
|
m,
|
|
489
|
+
}), data: invitations, emptyLabel: loading ? m.user_loading() : m.organization_user_invitations_empty(), exportFileName: "organization-invitations.csv", features: { gallery: false }, rowActions: userInvitationRowActions({
|
|
490
|
+
m,
|
|
489
491
|
actingInvitationId,
|
|
490
492
|
onAccept: acceptInvitation,
|
|
491
493
|
onReject: rejectInvitation,
|
|
492
|
-
})
|
|
494
|
+
}) })] }));
|
|
493
495
|
}
|
|
494
|
-
const userInvitationColumns = ({ m,
|
|
496
|
+
const userInvitationColumns = ({ m, }) => [
|
|
495
497
|
{
|
|
496
498
|
accessorKey: "organizationName",
|
|
497
499
|
header: m.organization_invitation_organization(),
|
|
@@ -512,21 +514,21 @@ const userInvitationColumns = ({ m, actingInvitationId, onAccept, onReject, }) =
|
|
|
512
514
|
header: m.organization_invitation_expires(),
|
|
513
515
|
cell: ({ row }) => (_jsx("span", { className: "text-muted-foreground text-sm", children: formatOrganizationDate(row.original.expiresAt) })),
|
|
514
516
|
},
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
517
|
+
];
|
|
518
|
+
const userInvitationRowActions = ({ m, actingInvitationId, onAccept, onReject, }) => [
|
|
519
|
+
{
|
|
520
|
+
name: m.organization_invitation_accept(),
|
|
521
|
+
icon: _jsx(Check, {}),
|
|
522
|
+
visible: (invitation) => actingInvitationId !== invitation.id,
|
|
523
|
+
onClick: onAccept,
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
name: m.organization_invitation_reject(),
|
|
527
|
+
icon: _jsx(X, {}),
|
|
528
|
+
variant: "destructive",
|
|
529
|
+
visible: (invitation) => actingInvitationId !== invitation.id,
|
|
530
|
+
onClick: onReject,
|
|
531
|
+
},
|
|
530
532
|
];
|
|
531
533
|
function EditOrganizationSection({ authClient, baseUrl, organization, onUpdated, }) {
|
|
532
534
|
const m = useOrganizationMessages();
|
|
@@ -801,17 +803,21 @@ function OrganizationMembersManager({ authClient, organization, currentUserId, }
|
|
|
801
803
|
value: role,
|
|
802
804
|
})) })) }), _jsx("div", { className: "self-end", children: _jsx(inviteForm.SubmitButton, {}) }), _jsx(inviteForm.FormError, {})] }) }), error ? _jsx("p", { className: "text-destructive text-sm", children: error }) : null, _jsxs("section", { className: "flex flex-col gap-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-medium", children: m.organization_members_heading() }), _jsx("p", { className: "text-muted-foreground text-sm", children: m.organization_members_description() })] }), _jsx(DataTable, { columns: memberColumns({
|
|
803
805
|
m,
|
|
804
|
-
currentUserId,
|
|
805
806
|
updatingMemberId,
|
|
806
|
-
onRemove: removeMember,
|
|
807
807
|
onRoleChange: updateRole,
|
|
808
|
-
}), data: members, emptyLabel: loading ? m.user_loading() : m.organization_members_empty(), exportFileName: `${organization.slug}-members.csv`, features: { gallery: false }
|
|
808
|
+
}), data: members, emptyLabel: loading ? m.user_loading() : m.organization_members_empty(), exportFileName: `${organization.slug}-members.csv`, features: { gallery: false }, rowActions: memberRowActions({
|
|
809
|
+
m,
|
|
810
|
+
currentUserId,
|
|
811
|
+
onRemove: removeMember,
|
|
812
|
+
}) })] }), _jsxs("section", { className: "flex flex-col gap-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-medium", children: m.organization_invitations_heading() }), _jsx("p", { className: "text-muted-foreground text-sm", children: m.organization_invitations_description() })] }), _jsx(DataTable, { columns: invitationColumns({
|
|
813
|
+
m,
|
|
814
|
+
}), data: invitations, emptyLabel: loading ? m.user_loading() : m.organization_invitations_empty(), exportFileName: `${organization.slug}-invitations.csv`, features: { gallery: false }, rowActions: invitationRowActions({
|
|
809
815
|
m,
|
|
810
816
|
cancellingInvitationId,
|
|
811
817
|
onCancel: cancelInvitation,
|
|
812
|
-
})
|
|
818
|
+
}) })] })] }));
|
|
813
819
|
}
|
|
814
|
-
const memberColumns = ({ m,
|
|
820
|
+
const memberColumns = ({ m, updatingMemberId, onRoleChange, }) => [
|
|
815
821
|
{
|
|
816
822
|
id: "user",
|
|
817
823
|
header: m.organization_member_user(),
|
|
@@ -838,17 +844,17 @@ const memberColumns = ({ m, currentUserId, updatingMemberId, onRemove, onRoleCha
|
|
|
838
844
|
header: m.organization_member_joined(),
|
|
839
845
|
cell: ({ row }) => (_jsx("span", { className: "text-muted-foreground text-sm", children: formatOrganizationDate(row.original.createdAt) })),
|
|
840
846
|
},
|
|
841
|
-
createDataTableActionsColumn([
|
|
842
|
-
{
|
|
843
|
-
name: m.organization_member_remove(),
|
|
844
|
-
icon: _jsx(Trash2, {}),
|
|
845
|
-
variant: "destructive",
|
|
846
|
-
visible: (member) => member.userId !== currentUserId,
|
|
847
|
-
onClick: onRemove,
|
|
848
|
-
},
|
|
849
|
-
]),
|
|
850
847
|
];
|
|
851
|
-
const
|
|
848
|
+
const memberRowActions = ({ m, currentUserId, onRemove, }) => [
|
|
849
|
+
{
|
|
850
|
+
name: m.organization_member_remove(),
|
|
851
|
+
icon: _jsx(Trash2, {}),
|
|
852
|
+
variant: "destructive",
|
|
853
|
+
visible: (member) => member.userId !== currentUserId,
|
|
854
|
+
onClick: onRemove,
|
|
855
|
+
},
|
|
856
|
+
];
|
|
857
|
+
const invitationColumns = ({ m, }) => [
|
|
852
858
|
{
|
|
853
859
|
accessorKey: "email",
|
|
854
860
|
header: m.organization_member_email(),
|
|
@@ -869,15 +875,15 @@ const invitationColumns = ({ m, cancellingInvitationId, onCancel, }) => [
|
|
|
869
875
|
header: m.organization_invitation_expires(),
|
|
870
876
|
cell: ({ row }) => (_jsx("span", { className: "text-muted-foreground text-sm", children: formatOrganizationDate(row.original.expiresAt) })),
|
|
871
877
|
},
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
878
|
+
];
|
|
879
|
+
const invitationRowActions = ({ m, cancellingInvitationId, onCancel, }) => [
|
|
880
|
+
{
|
|
881
|
+
name: m.organization_invitation_cancel(),
|
|
882
|
+
icon: _jsx(Trash2, {}),
|
|
883
|
+
variant: "destructive",
|
|
884
|
+
visible: (invitation) => cancellingInvitationId !== invitation.id,
|
|
885
|
+
onClick: onCancel,
|
|
886
|
+
},
|
|
881
887
|
];
|
|
882
888
|
function OrganizationApiKeyManager({ authClient, organization, }) {
|
|
883
889
|
const m = useOrganizationMessages();
|
|
@@ -941,9 +947,9 @@ function OrganizationApiKeyManager({ authClient, organization, }) {
|
|
|
941
947
|
event.preventDefault();
|
|
942
948
|
event.stopPropagation();
|
|
943
949
|
createForm.handleSubmit();
|
|
944
|
-
}, children: [_jsx("p", { className: "text-muted-foreground text-sm", children: m.api_key_rate_limit_notice() }), _jsx(createForm.AppField, { name: "name", children: (field) => (_jsx(field.TextField, { label: m.user_api_key_name(), required: true })) }), _jsx(createForm.FormError, {}), _jsx(createForm.SubmitButton, {})] }) }), createdKey ? (_jsxs("div", { className: "flex flex-col gap-2 rounded-lg border p-4", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium", children: [_jsx(KeyRound, {}), m.user_api_key_created_title()] }), _jsx("p", { className: "text-muted-foreground text-sm", children: m.user_api_key_created_description() }), _jsx("code", { className: "bg-muted overflow-x-auto rounded-md p-3 text-sm", children: createdKey })] })) : null, error ? _jsx("p", { className: "text-destructive text-sm", children: error }) : null, _jsx(Separator, {}), _jsx(DataTable, { columns: apiKeyColumns({ m
|
|
950
|
+
}, children: [_jsx("p", { className: "text-muted-foreground text-sm", children: m.api_key_rate_limit_notice() }), _jsx(createForm.AppField, { name: "name", children: (field) => (_jsx(field.TextField, { label: m.user_api_key_name(), required: true })) }), _jsx(createForm.FormError, {}), _jsx(createForm.SubmitButton, {})] }) }), createdKey ? (_jsxs("div", { className: "flex flex-col gap-2 rounded-lg border p-4", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium", children: [_jsx(KeyRound, {}), m.user_api_key_created_title()] }), _jsx("p", { className: "text-muted-foreground text-sm", children: m.user_api_key_created_description() }), _jsx("code", { className: "bg-muted overflow-x-auto rounded-md p-3 text-sm", children: createdKey })] })) : null, error ? _jsx("p", { className: "text-destructive text-sm", children: error }) : null, _jsx(Separator, {}), _jsx(DataTable, { columns: apiKeyColumns({ m }), data: keys, emptyLabel: loading ? m.user_loading() : m.table_empty(), exportFileName: `${organization.slug}-api-keys.csv`, features: { gallery: false }, rowActions: apiKeyRowActions({ m, onDelete: deleteKey }) })] }));
|
|
945
951
|
}
|
|
946
|
-
const apiKeyColumns = ({ m,
|
|
952
|
+
const apiKeyColumns = ({ m, }) => [
|
|
947
953
|
{
|
|
948
954
|
accessorKey: "name",
|
|
949
955
|
header: m.user_api_key_name(),
|
|
@@ -958,12 +964,12 @@ const apiKeyColumns = ({ m, onDelete, }) => [
|
|
|
958
964
|
? m.user_api_key_enabled()
|
|
959
965
|
: m.user_api_key_disabled() })),
|
|
960
966
|
},
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
967
|
+
];
|
|
968
|
+
const apiKeyRowActions = ({ m, onDelete, }) => [
|
|
969
|
+
{
|
|
970
|
+
name: m.user_delete(),
|
|
971
|
+
icon: _jsx(Trash2, {}),
|
|
972
|
+
variant: "destructive",
|
|
973
|
+
onClick: onDelete,
|
|
974
|
+
},
|
|
969
975
|
];
|
|
@@ -4,7 +4,7 @@ import { useNavigate, useRouterState, } from "@tanstack/react-router";
|
|
|
4
4
|
import { Check, Copy, KeyRound, LogOutIcon, ShieldCheck, Trash2, UserCircleIcon, UserIcon, } from "lucide-react";
|
|
5
5
|
import { QRCode } from "react-qr-code";
|
|
6
6
|
import { createContext, useContext, useEffect, useEffectEvent, useState, } from "react";
|
|
7
|
-
import {
|
|
7
|
+
import { DataTable } from "@/components/ui/data-table";
|
|
8
8
|
import { AppBrand } from "@/components/ui/app-brand";
|
|
9
9
|
import { useAppForm } from "@/components/ui/form";
|
|
10
10
|
import { Badge } from "@/components/ui/badge";
|
|
@@ -700,9 +700,9 @@ function ApiKeyManager({ authClient, permissions = {}, }) {
|
|
|
700
700
|
event.preventDefault();
|
|
701
701
|
event.stopPropagation();
|
|
702
702
|
createForm.handleSubmit();
|
|
703
|
-
}, children: [_jsx("p", { className: "text-muted-foreground text-sm", children: m.api_key_rate_limit_notice() }), _jsx(createForm.AppField, { name: "name", children: (field) => (_jsx(field.TextField, { label: m.user_api_key_name(), required: true })) }), permissionOptions.length > 0 ? (_jsxs(FieldSet, { children: [_jsx(FieldLegend, { children: m.user_api_key_permissions() }), _jsx(FieldDescription, { children: m.user_api_key_permissions_description() }), _jsx(FieldGroup, { "data-slot": "checkbox-group", className: "gap-3", children: permissionOptions.map((permission) => (_jsxs(Field, { orientation: "horizontal", children: [_jsx(Checkbox, { id: permission.id, checked: selectedPermissions[permission.id] ?? false, onCheckedChange: (checked) => togglePermission(permission.id, checked) }), _jsx(FieldContent, { children: _jsx(FieldLabel, { htmlFor: permission.id, children: permission.id }) })] }, permission.id))) })] })) : null, _jsx(createForm.FormError, {}), _jsx(createForm.SubmitButton, {})] }) }), createdKey ? (_jsxs("div", { className: "flex flex-col gap-2 rounded-lg border p-4", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium", children: [_jsx(KeyRound, {}), m.user_api_key_created_title()] }), _jsx("p", { className: "text-muted-foreground text-sm", children: m.user_api_key_created_description() }), _jsxs("div", { className: "grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center", children: [_jsx("code", { className: "bg-muted block max-w-full overflow-x-auto rounded-md p-3 text-sm whitespace-nowrap", children: createdKey }), _jsxs(Button, { type: "button", variant: "outline", onClick: copyCreatedKey, className: "self-start sm:self-auto", children: [copiedKey ? _jsx(Check, {}) : _jsx(Copy, {}), copiedKey ? m.user_api_key_copied() : m.user_api_key_copy()] })] })] })) : null, error ? _jsx("p", { className: "text-destructive text-sm", children: error }) : null, _jsx(Separator, {}), _jsx(DataTable, { columns: apiKeyColumns({ m
|
|
703
|
+
}, children: [_jsx("p", { className: "text-muted-foreground text-sm", children: m.api_key_rate_limit_notice() }), _jsx(createForm.AppField, { name: "name", children: (field) => (_jsx(field.TextField, { label: m.user_api_key_name(), required: true })) }), permissionOptions.length > 0 ? (_jsxs(FieldSet, { children: [_jsx(FieldLegend, { children: m.user_api_key_permissions() }), _jsx(FieldDescription, { children: m.user_api_key_permissions_description() }), _jsx(FieldGroup, { "data-slot": "checkbox-group", className: "gap-3", children: permissionOptions.map((permission) => (_jsxs(Field, { orientation: "horizontal", children: [_jsx(Checkbox, { id: permission.id, checked: selectedPermissions[permission.id] ?? false, onCheckedChange: (checked) => togglePermission(permission.id, checked) }), _jsx(FieldContent, { children: _jsx(FieldLabel, { htmlFor: permission.id, children: permission.id }) })] }, permission.id))) })] })) : null, _jsx(createForm.FormError, {}), _jsx(createForm.SubmitButton, {})] }) }), createdKey ? (_jsxs("div", { className: "flex flex-col gap-2 rounded-lg border p-4", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium", children: [_jsx(KeyRound, {}), m.user_api_key_created_title()] }), _jsx("p", { className: "text-muted-foreground text-sm", children: m.user_api_key_created_description() }), _jsxs("div", { className: "grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center", children: [_jsx("code", { className: "bg-muted block max-w-full overflow-x-auto rounded-md p-3 text-sm whitespace-nowrap", children: createdKey }), _jsxs(Button, { type: "button", variant: "outline", onClick: copyCreatedKey, className: "self-start sm:self-auto", children: [copiedKey ? _jsx(Check, {}) : _jsx(Copy, {}), copiedKey ? m.user_api_key_copied() : m.user_api_key_copy()] })] })] })) : null, error ? _jsx("p", { className: "text-destructive text-sm", children: error }) : null, _jsx(Separator, {}), _jsx(DataTable, { columns: apiKeyColumns({ m }), data: keys, emptyLabel: loading ? m.user_loading() : m.table_empty(), exportFileName: m.user_api_keys_export_file_name(), features: { gallery: false }, rowActions: apiKeyRowActions({ m, onDelete: deleteKey }) })] }));
|
|
704
704
|
}
|
|
705
|
-
const apiKeyColumns = ({ m,
|
|
705
|
+
const apiKeyColumns = ({ m, }) => [
|
|
706
706
|
{
|
|
707
707
|
accessorKey: "name",
|
|
708
708
|
header: m.user_api_key_name(),
|
|
@@ -726,14 +726,14 @@ const apiKeyColumns = ({ m, onDelete, }) => [
|
|
|
726
726
|
return (_jsx("div", { className: "flex max-w-sm flex-wrap gap-1.5", children: permissions.map((permission) => (_jsx(Badge, { variant: "secondary", children: permission }, permission))) }));
|
|
727
727
|
},
|
|
728
728
|
},
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
729
|
+
];
|
|
730
|
+
const apiKeyRowActions = ({ m, onDelete, }) => [
|
|
731
|
+
{
|
|
732
|
+
name: m.user_delete(),
|
|
733
|
+
icon: _jsx(Trash2, {}),
|
|
734
|
+
variant: "destructive",
|
|
735
|
+
onClick: onDelete,
|
|
736
|
+
},
|
|
737
737
|
];
|
|
738
738
|
const getPermissionId = (resource, action) => `${resource}:${action}`;
|
|
739
739
|
const isPermissionRecord = (permissions) => typeof permissions === "object" &&
|
package/dist/server/api.d.ts
CHANGED
|
@@ -112,6 +112,66 @@ export declare const ServerOrganizationsApiGroup: HttpApiGroup.HttpApiGroup<"ser
|
|
|
112
112
|
readonly updatedAt: import("effect/Schema").Date;
|
|
113
113
|
}>;
|
|
114
114
|
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
115
|
+
export declare const ServerDomainsApiGroup: HttpApiGroup.HttpApiGroup<"serverDomains", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
116
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
117
|
+
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
118
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
119
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
120
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
121
|
+
readonly id: import("effect/Schema").String;
|
|
122
|
+
readonly hostname: import("effect/Schema").String;
|
|
123
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
124
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
125
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
126
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
127
|
+
readonly active: import("effect/Schema").Boolean;
|
|
128
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
129
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
130
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomain", "GET", "/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
131
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
132
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
133
|
+
readonly id: import("effect/Schema").String;
|
|
134
|
+
readonly hostname: import("effect/Schema").String;
|
|
135
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
136
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
137
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
138
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
139
|
+
readonly active: import("effect/Schema").Boolean;
|
|
140
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
141
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
142
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainByHost", "GET", "/domains/by-host/:hostname", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
143
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
144
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
145
|
+
readonly id: import("effect/Schema").String;
|
|
146
|
+
readonly hostname: import("effect/Schema").String;
|
|
147
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
148
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
149
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
150
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
151
|
+
readonly active: import("effect/Schema").Boolean;
|
|
152
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
153
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
154
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/domains/:id/records", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
155
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
156
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
157
|
+
readonly required: import("effect/Schema").Boolean;
|
|
158
|
+
readonly status: import("effect/Schema").String;
|
|
159
|
+
readonly type: import("effect/Schema").String;
|
|
160
|
+
readonly name: import("effect/Schema").String;
|
|
161
|
+
readonly value: import("effect/Schema").String;
|
|
162
|
+
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
163
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
164
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
165
|
+
readonly id: import("effect/Schema").String;
|
|
166
|
+
readonly hostname: import("effect/Schema").String;
|
|
167
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
168
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
169
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
170
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
171
|
+
readonly active: import("effect/Schema").Boolean;
|
|
172
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
173
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
174
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
115
175
|
export declare const ServerApi: HttpApi.HttpApi<"ServerApi", HttpApiGroup.HttpApiGroup<"serverUsers", HttpApiEndpoint.HttpApiEndpoint<"listUsersByIds", "GET", "/api/users", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
116
176
|
readonly ids: import("effect/Schema").NonEmptyString;
|
|
117
177
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
@@ -222,4 +282,63 @@ export declare const ServerApi: HttpApi.HttpApi<"ServerApi", HttpApiGroup.HttpAp
|
|
|
222
282
|
readonly createdAt: import("effect/Schema").Date;
|
|
223
283
|
readonly updatedAt: import("effect/Schema").Date;
|
|
224
284
|
}>;
|
|
225
|
-
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false
|
|
285
|
+
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never>, false> | HttpApiGroup.HttpApiGroup<"serverDomains", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/api/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
286
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
287
|
+
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
288
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
289
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
290
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
291
|
+
readonly id: import("effect/Schema").String;
|
|
292
|
+
readonly hostname: import("effect/Schema").String;
|
|
293
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
294
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
295
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
296
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
297
|
+
readonly active: import("effect/Schema").Boolean;
|
|
298
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
299
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
300
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomain", "GET", "/api/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
301
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
302
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
303
|
+
readonly id: import("effect/Schema").String;
|
|
304
|
+
readonly hostname: import("effect/Schema").String;
|
|
305
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
306
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
307
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
308
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
309
|
+
readonly active: import("effect/Schema").Boolean;
|
|
310
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
311
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
312
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainByHost", "GET", "/api/domains/by-host/:hostname", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
313
|
+
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
314
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
315
|
+
readonly id: import("effect/Schema").String;
|
|
316
|
+
readonly hostname: import("effect/Schema").String;
|
|
317
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
318
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
319
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
320
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
321
|
+
readonly active: import("effect/Schema").Boolean;
|
|
322
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
323
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
324
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/api/domains/:id/records", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
325
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
326
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
327
|
+
readonly required: import("effect/Schema").Boolean;
|
|
328
|
+
readonly status: import("effect/Schema").String;
|
|
329
|
+
readonly type: import("effect/Schema").String;
|
|
330
|
+
readonly name: import("effect/Schema").String;
|
|
331
|
+
readonly value: import("effect/Schema").String;
|
|
332
|
+
}>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/api/domains/:id", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
333
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
334
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
335
|
+
readonly id: import("effect/Schema").String;
|
|
336
|
+
readonly hostname: import("effect/Schema").String;
|
|
337
|
+
readonly rootHostname: import("effect/Schema").String;
|
|
338
|
+
readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
339
|
+
readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
340
|
+
readonly hostnameId: import("effect/Schema").String;
|
|
341
|
+
readonly active: import("effect/Schema").Boolean;
|
|
342
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
343
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
344
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>>;
|
package/dist/server/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpApi, OpenApi } from "effect/unstable/httpapi";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
|
|
3
3
|
import { Member, Organization, User } from "../schema";
|
|
4
|
-
import { ServerActiveOrganization, ServerIdParams, ServerIdsQuery, ServerMemberParams, ServerMembersResponse, ServerOrganizationIdParams, ServerOrganizationsQuery, ServerOrganizationsResponse, ServerUserIdParams, ServerUsersResponse, } from "./schema";
|
|
4
|
+
import { ServerActiveOrganization, ServerCreateDomainPayload, ServerDomain, ServerDomainHostParams, ServerDomainIdParams, ServerDomainRecordsResponse, ServerIdParams, ServerIdsQuery, ServerMemberParams, ServerMembersResponse, ServerOrganizationIdParams, ServerOrganizationsQuery, ServerOrganizationsResponse, ServerUserIdParams, ServerUsersResponse, } from "./schema";
|
|
5
5
|
export const ServerUsersApiGroup = HttpApiGroup.make("serverUsers")
|
|
6
6
|
.add(HttpApiEndpoint.get("listUsersByIds", "/users", {
|
|
7
7
|
query: ServerIdsQuery,
|
|
@@ -91,7 +91,62 @@ export const ServerOrganizationsApiGroup = HttpApiGroup.make("serverOrganization
|
|
|
91
91
|
title: "Organizations (Server)",
|
|
92
92
|
description: "Server-to-server organization and membership endpoints for trusted services.",
|
|
93
93
|
}));
|
|
94
|
+
export const ServerDomainsApiGroup = HttpApiGroup.make("serverDomains")
|
|
95
|
+
.add(HttpApiEndpoint.post("createDomain", "/domains", {
|
|
96
|
+
payload: ServerCreateDomainPayload,
|
|
97
|
+
success: ServerDomain,
|
|
98
|
+
error: [
|
|
99
|
+
HttpApiError.BadRequest,
|
|
100
|
+
HttpApiError.Unauthorized,
|
|
101
|
+
HttpApiError.InternalServerError,
|
|
102
|
+
],
|
|
103
|
+
}).annotateMerge(OpenApi.annotations({
|
|
104
|
+
title: "Create server domain",
|
|
105
|
+
summary: "Create an auth-owned custom hostname",
|
|
106
|
+
description: "Registers an auth custom hostname for a trusted service. Requires a service API key.",
|
|
107
|
+
})))
|
|
108
|
+
.add(HttpApiEndpoint.get("getDomain", "/domains/:id", {
|
|
109
|
+
params: ServerDomainIdParams,
|
|
110
|
+
success: ServerDomain,
|
|
111
|
+
error: [
|
|
112
|
+
HttpApiError.Unauthorized,
|
|
113
|
+
HttpApiError.NotFound,
|
|
114
|
+
HttpApiError.InternalServerError,
|
|
115
|
+
],
|
|
116
|
+
}))
|
|
117
|
+
.add(HttpApiEndpoint.get("getDomainByHost", "/domains/by-host/:hostname", {
|
|
118
|
+
params: ServerDomainHostParams,
|
|
119
|
+
success: ServerDomain,
|
|
120
|
+
error: [
|
|
121
|
+
HttpApiError.Unauthorized,
|
|
122
|
+
HttpApiError.NotFound,
|
|
123
|
+
HttpApiError.InternalServerError,
|
|
124
|
+
],
|
|
125
|
+
}))
|
|
126
|
+
.add(HttpApiEndpoint.get("getDomainRecords", "/domains/:id/records", {
|
|
127
|
+
params: ServerDomainIdParams,
|
|
128
|
+
success: ServerDomainRecordsResponse,
|
|
129
|
+
error: [
|
|
130
|
+
HttpApiError.Unauthorized,
|
|
131
|
+
HttpApiError.NotFound,
|
|
132
|
+
HttpApiError.InternalServerError,
|
|
133
|
+
],
|
|
134
|
+
}))
|
|
135
|
+
.add(HttpApiEndpoint.delete("deleteDomain", "/domains/:id", {
|
|
136
|
+
params: ServerDomainIdParams,
|
|
137
|
+
success: ServerDomain,
|
|
138
|
+
error: [
|
|
139
|
+
HttpApiError.Unauthorized,
|
|
140
|
+
HttpApiError.NotFound,
|
|
141
|
+
HttpApiError.InternalServerError,
|
|
142
|
+
],
|
|
143
|
+
}))
|
|
144
|
+
.annotateMerge(OpenApi.annotations({
|
|
145
|
+
title: "Domains (Server)",
|
|
146
|
+
description: "Server-to-server auth custom hostname endpoints.",
|
|
147
|
+
}));
|
|
94
148
|
export const ServerApi = HttpApi.make("ServerApi")
|
|
95
149
|
.add(ServerUsersApiGroup)
|
|
96
150
|
.add(ServerOrganizationsApiGroup)
|
|
151
|
+
.add(ServerDomainsApiGroup)
|
|
97
152
|
.prefix("/api");
|
package/dist/server/schema.d.ts
CHANGED
|
@@ -74,7 +74,47 @@ export declare const ServerMembersResponse: Schema.$Array<Schema.Struct<{
|
|
|
74
74
|
readonly updatedAt: Schema.Date;
|
|
75
75
|
}>;
|
|
76
76
|
}>>;
|
|
77
|
+
export declare const ServerDomain: Schema.Struct<{
|
|
78
|
+
readonly id: Schema.String;
|
|
79
|
+
readonly hostname: Schema.String;
|
|
80
|
+
readonly rootHostname: Schema.String;
|
|
81
|
+
readonly projectId: Schema.NullOr<Schema.String>;
|
|
82
|
+
readonly organizationId: Schema.NullOr<Schema.String>;
|
|
83
|
+
readonly hostnameId: Schema.String;
|
|
84
|
+
readonly active: Schema.Boolean;
|
|
85
|
+
readonly createdAt: Schema.Date;
|
|
86
|
+
readonly updatedAt: Schema.Date;
|
|
87
|
+
}>;
|
|
88
|
+
export declare const ServerCreateDomainPayload: Schema.Struct<{
|
|
89
|
+
readonly hostname: Schema.NonEmptyString;
|
|
90
|
+
readonly rootHostname: Schema.NonEmptyString;
|
|
91
|
+
readonly projectId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
92
|
+
readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const ServerDomainIdParams: Schema.Struct<{
|
|
95
|
+
readonly id: Schema.NonEmptyString;
|
|
96
|
+
}>;
|
|
97
|
+
export declare const ServerDomainHostParams: Schema.Struct<{
|
|
98
|
+
readonly hostname: Schema.NonEmptyString;
|
|
99
|
+
}>;
|
|
100
|
+
export declare const ServerDomainRecord: Schema.Struct<{
|
|
101
|
+
readonly required: Schema.Boolean;
|
|
102
|
+
readonly status: Schema.String;
|
|
103
|
+
readonly type: Schema.String;
|
|
104
|
+
readonly name: Schema.String;
|
|
105
|
+
readonly value: Schema.String;
|
|
106
|
+
}>;
|
|
107
|
+
export declare const ServerDomainRecordsResponse: Schema.$Array<Schema.Struct<{
|
|
108
|
+
readonly required: Schema.Boolean;
|
|
109
|
+
readonly status: Schema.String;
|
|
110
|
+
readonly type: Schema.String;
|
|
111
|
+
readonly name: Schema.String;
|
|
112
|
+
readonly value: Schema.String;
|
|
113
|
+
}>>;
|
|
77
114
|
export type ServerUsersResponse = typeof ServerUsersResponse.Type;
|
|
78
115
|
export type ServerOrganizationsResponse = typeof ServerOrganizationsResponse.Type;
|
|
79
116
|
export type ServerMembersResponse = typeof ServerMembersResponse.Type;
|
|
80
117
|
export type ServerActiveOrganization = typeof ServerActiveOrganization.Type;
|
|
118
|
+
export type ServerDomain = typeof ServerDomain.Type;
|
|
119
|
+
export type ServerCreateDomainPayload = typeof ServerCreateDomainPayload.Type;
|
|
120
|
+
export type ServerDomainRecordsResponse = typeof ServerDomainRecordsResponse.Type;
|
package/dist/server/schema.js
CHANGED
|
@@ -79,3 +79,81 @@ export const ServerMembersResponse = Schema.Array(Member).annotate({
|
|
|
79
79
|
title: "Server members response",
|
|
80
80
|
description: "Organization members with user contact details.",
|
|
81
81
|
});
|
|
82
|
+
export const ServerDomain = Schema.Struct({
|
|
83
|
+
id: Schema.String,
|
|
84
|
+
hostname: Schema.String,
|
|
85
|
+
rootHostname: Schema.String,
|
|
86
|
+
projectId: Schema.NullOr(Schema.String),
|
|
87
|
+
organizationId: Schema.NullOr(Schema.String),
|
|
88
|
+
hostnameId: Schema.String,
|
|
89
|
+
active: Schema.Boolean,
|
|
90
|
+
createdAt: Schema.Date,
|
|
91
|
+
updatedAt: Schema.Date,
|
|
92
|
+
}).annotate({
|
|
93
|
+
identifier: "ServerDomain",
|
|
94
|
+
title: "Server domain",
|
|
95
|
+
description: "An auth-owned custom hostname mapped to a project and optionally an organization.",
|
|
96
|
+
examples: [
|
|
97
|
+
{
|
|
98
|
+
id: "domain_1",
|
|
99
|
+
hostname: "auth.institute.example.com",
|
|
100
|
+
rootHostname: "institute.example.com",
|
|
101
|
+
projectId: "kokobi",
|
|
102
|
+
organizationId: "org_1",
|
|
103
|
+
hostnameId: "cloudflare-hostname-id",
|
|
104
|
+
active: false,
|
|
105
|
+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
106
|
+
updatedAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
export const ServerCreateDomainPayload = Schema.Struct({
|
|
111
|
+
hostname: Schema.NonEmptyString,
|
|
112
|
+
rootHostname: Schema.NonEmptyString,
|
|
113
|
+
projectId: Schema.optional(Schema.NullOr(Schema.String)),
|
|
114
|
+
organizationId: Schema.optional(Schema.NullOr(Schema.String)),
|
|
115
|
+
}).annotate({
|
|
116
|
+
identifier: "ServerCreateDomainPayload",
|
|
117
|
+
title: "Create server domain payload",
|
|
118
|
+
description: "Payload used by trusted services to register an auth-owned custom hostname.",
|
|
119
|
+
examples: [
|
|
120
|
+
{
|
|
121
|
+
hostname: "auth.institute.example.com",
|
|
122
|
+
rootHostname: "institute.example.com",
|
|
123
|
+
projectId: "kokobi",
|
|
124
|
+
organizationId: "org_1",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
});
|
|
128
|
+
export const ServerDomainIdParams = Schema.Struct({
|
|
129
|
+
id: Schema.NonEmptyString,
|
|
130
|
+
}).annotate({
|
|
131
|
+
identifier: "ServerDomainIdParams",
|
|
132
|
+
title: "Server domain ID params",
|
|
133
|
+
description: "Domain ID used to return or delete a server domain.",
|
|
134
|
+
examples: [{ id: "domain_1" }],
|
|
135
|
+
});
|
|
136
|
+
export const ServerDomainHostParams = Schema.Struct({
|
|
137
|
+
hostname: Schema.NonEmptyString,
|
|
138
|
+
}).annotate({
|
|
139
|
+
identifier: "ServerDomainHostParams",
|
|
140
|
+
title: "Server domain host params",
|
|
141
|
+
description: "Hostname used to return a server domain.",
|
|
142
|
+
examples: [{ hostname: "auth.institute.example.com" }],
|
|
143
|
+
});
|
|
144
|
+
export const ServerDomainRecord = Schema.Struct({
|
|
145
|
+
required: Schema.Boolean,
|
|
146
|
+
status: Schema.String,
|
|
147
|
+
type: Schema.String,
|
|
148
|
+
name: Schema.String,
|
|
149
|
+
value: Schema.String,
|
|
150
|
+
}).annotate({
|
|
151
|
+
identifier: "ServerDomainRecord",
|
|
152
|
+
title: "Server domain DNS record",
|
|
153
|
+
description: "A DNS record required for an auth-owned custom hostname.",
|
|
154
|
+
});
|
|
155
|
+
export const ServerDomainRecordsResponse = Schema.Array(ServerDomainRecord).annotate({
|
|
156
|
+
identifier: "ServerDomainRecordsResponse",
|
|
157
|
+
title: "Server domain records response",
|
|
158
|
+
description: "DNS records required for an auth-owned custom hostname.",
|
|
159
|
+
});
|