@terrascale/sdk 0.0.2 → 0.0.4

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +193 -56
  3. package/package.json +14 -5
  4. package/sdk-public-v1-route-manifest.json +81 -0
  5. package/sdk-v1-route-manifest.json +8996 -1697
  6. package/src/database-codec.js +21 -26
  7. package/src/database-types.js +11 -11
  8. package/src/database-view.js +6 -6
  9. package/src/http.js +13 -48
  10. package/src/ids.js +22 -0
  11. package/src/index.js +77 -2
  12. package/src/local/better-auth.js +17 -6
  13. package/src/local/environment.js +0 -1
  14. package/src/local/index.js +2 -2
  15. package/src/local/legacy-client.js +5 -5
  16. package/src/local/router.js +12 -12
  17. package/src/local/store.js +29 -28
  18. package/src/local/test-environment.js +3 -2
  19. package/src/postgres.js +5 -4
  20. package/src/react/core.js +2 -2
  21. package/src/ts-auth-ids.js +122 -0
  22. package/src/ts-auth.js +75 -77
  23. package/src/v1/backups.js +111 -0
  24. package/src/v1/catalog.js +210 -0
  25. package/src/v1/changes.js +225 -0
  26. package/src/v1/database-schema.js +45 -0
  27. package/src/v1/decode.js +20 -8
  28. package/src/v1/errors.js +23 -3
  29. package/src/v1/ids.js +9 -59
  30. package/src/v1/imports.js +72 -0
  31. package/src/v1/indexes.js +76 -0
  32. package/src/v1/json.js +4 -3
  33. package/src/v1/management-decode.js +24 -0
  34. package/src/v1/management-routes.js +67 -0
  35. package/src/v1/management-validation.js +25 -0
  36. package/src/v1/routes.js +36 -11
  37. package/src/v1/saved-queries.js +58 -0
  38. package/src/v1/shape-crypto.js +125 -0
  39. package/src/v1/shape-manifest.js +31 -0
  40. package/src/v1/shape-reader.js +212 -0
  41. package/src/v1/shape-subscription.js +208 -0
  42. package/src/v1/shapes.js +15 -10
  43. package/src/v1/sql.js +98 -0
  44. package/src/v1/system.js +80 -0
  45. package/src/v1/terrabase-v1.js +192 -33
  46. package/src/v1/transport.js +80 -34
  47. package/src/v1/usage.js +101 -0
  48. package/types/database-codec.d.ts +1 -6
  49. package/types/database-types.d.ts +11 -11
  50. package/types/http.d.ts +2 -8
  51. package/types/ids.d.ts +10 -0
  52. package/types/index.d.ts +70 -1
  53. package/types/local/environment.d.ts +1 -1
  54. package/types/local/store.d.ts +10 -0
  55. package/types/local/test-environment.d.ts +2 -2
  56. package/types/postgres.d.ts +4 -4
  57. package/types/ts-auth-ids.d.ts +14 -0
  58. package/types/ts-auth.d.ts +99 -101
  59. package/types/v1/backups.d.ts +128 -0
  60. package/types/v1/catalog.d.ts +92 -0
  61. package/types/v1/changes.d.ts +53 -0
  62. package/types/v1/database-schema.d.ts +82 -0
  63. package/types/v1/decode.d.ts +17 -4
  64. package/types/v1/errors.d.ts +16 -1
  65. package/types/v1/ids.d.ts +4 -16
  66. package/types/v1/imports.d.ts +132 -0
  67. package/types/v1/indexes.d.ts +75 -0
  68. package/types/v1/management-decode.d.ts +15 -0
  69. package/types/v1/management-routes.d.ts +3 -0
  70. package/types/v1/management-validation.d.ts +8 -0
  71. package/types/v1/routes.d.ts +5 -2
  72. package/types/v1/saved-queries.d.ts +33 -0
  73. package/types/v1/shape-crypto.d.ts +39 -0
  74. package/types/v1/shape-manifest.d.ts +28 -0
  75. package/types/v1/shape-reader.d.ts +45 -0
  76. package/types/v1/shape-subscription.d.ts +35 -0
  77. package/types/v1/shapes.d.ts +14 -0
  78. package/types/v1/sql.d.ts +47 -0
  79. package/types/v1/system.d.ts +85 -0
  80. package/types/v1/terrabase-v1.d.ts +116 -7
  81. package/types/v1/transport.d.ts +27 -10
  82. package/types/v1/usage.d.ts +171 -0
  83. package/src/ts-auth-discovery.js +0 -207
  84. package/types/ts-auth-discovery.d.ts +0 -19
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Validate the documented endpointId:eventId delivery selector.
3
+ * @param {unknown} value
4
+ * @returns {string}
5
+ */
6
+ export function requireDeadLetterId(value: unknown): string;
7
+ /**
8
+ * Validate identity fields in the hosted-auth DTOs without inspecting customer metadata.
9
+ * @param {unknown} value
10
+ * @param {string} route
11
+ * @param {boolean} [entity]
12
+ * @returns {void}
13
+ */
14
+ export function validateTsAuthIds(value: unknown, route: string, entity?: boolean): void;
@@ -38,7 +38,6 @@ export function verifyTsAuthWebhookWithTolerance(signingSecret: string, timestam
38
38
  * @typedef {Omit<TsAuthRuntimeConfig, "apiBaseUrl"> & {
39
39
  * readonly apiBaseUrl: string; // The ts-auth deployment's public origin; there is no default.
40
40
  * readonly instanceSlug: string; // The instance the `sk_` key belongs to; it prefixes every route.
41
- * readonly useReverseProxy?: boolean; // Route public auth calls through the reverse proxy instead of regional discovery.
42
41
  * }} TsAuthClientConfig
43
42
  */
44
43
  /**
@@ -48,7 +47,7 @@ export function verifyTsAuthWebhookWithTolerance(signingSecret: string, timestam
48
47
  */
49
48
  /**
50
49
  * @typedef {{
51
- * readonly id: string;
50
+ * readonly id: import("./ids.js").EntityId;
52
51
  * readonly email: string | null;
53
52
  * readonly email_verified: boolean;
54
53
  * readonly username: string | null;
@@ -63,7 +62,7 @@ export function verifyTsAuthWebhookWithTolerance(signingSecret: string, timestam
63
62
  */
64
63
  /**
65
64
  * @typedef {{
66
- * readonly id: string;
65
+ * readonly id: import("./ids.js").EntityId;
67
66
  * readonly status: string;
68
67
  * readonly created_at: number; // Unix seconds.
69
68
  * readonly expires_at: number; // Unix seconds.
@@ -74,7 +73,7 @@ export function verifyTsAuthWebhookWithTolerance(signingSecret: string, timestam
74
73
  */
75
74
  /**
76
75
  * @typedef {{
77
- * readonly id: string;
76
+ * readonly id: import("./ids.js").EntityId;
78
77
  * readonly type: string;
79
78
  * readonly confirmed: boolean;
80
79
  * readonly createdAt: number; // Unix seconds.
@@ -82,7 +81,7 @@ export function verifyTsAuthWebhookWithTolerance(signingSecret: string, timestam
82
81
  */
83
82
  /**
84
83
  * @typedef {{
85
- * readonly id: string;
84
+ * readonly id: import("./ids.js").EntityId;
86
85
  * readonly nickname: string | null;
87
86
  * readonly algorithm: string;
88
87
  * readonly createdAt: number; // Unix seconds.
@@ -91,7 +90,7 @@ export function verifyTsAuthWebhookWithTolerance(signingSecret: string, timestam
91
90
  */
92
91
  /**
93
92
  * @typedef {{
94
- * readonly id: string;
93
+ * readonly id: import("./ids.js").EntityId;
95
94
  * readonly name: string;
96
95
  * readonly slug: string;
97
96
  * readonly created_at: number; // Unix seconds.
@@ -99,7 +98,7 @@ export function verifyTsAuthWebhookWithTolerance(signingSecret: string, timestam
99
98
  */
100
99
  /**
101
100
  * @typedef {{
102
- * readonly id: string;
101
+ * readonly id: import("./ids.js").EntityId;
103
102
  * readonly role: string;
104
103
  * readonly created_at: number; // Unix seconds.
105
104
  * readonly organization: TsAuthOrganization | null;
@@ -307,7 +306,7 @@ export class TsAuthSessionsClient {
307
306
  }
308
307
  /**
309
308
  * @typedef {{
310
- * readonly id: string;
309
+ * readonly id: import("./ids.js").EntityId;
311
310
  * readonly name: string;
312
311
  * readonly api_key: string; // One-time full sk_ bearer; only the creating call returns it.
313
312
  * readonly scopes: readonly string[];
@@ -315,7 +314,7 @@ export class TsAuthSessionsClient {
315
314
  */
316
315
  /**
317
316
  * @typedef {{
318
- * readonly id: string;
317
+ * readonly id: import("./ids.js").EntityId;
319
318
  * readonly name: string;
320
319
  * readonly scopes: readonly string[];
321
320
  * readonly created_at: number; // Unix seconds.
@@ -352,9 +351,9 @@ export class TsAuthApiKeysClient {
352
351
  }
353
352
  /**
354
353
  * @typedef {{
355
- * readonly id: string;
356
- * readonly organization_id: string;
357
- * readonly user_id: string;
354
+ * readonly id: import("./ids.js").EntityId;
355
+ * readonly organization_id: import("./ids.js").EntityId;
356
+ * readonly user_id: import("./ids.js").EntityId;
358
357
  * readonly role: string;
359
358
  * readonly created_at: number; // Unix seconds.
360
359
  * }} TsAuthMembership
@@ -362,7 +361,7 @@ export class TsAuthApiKeysClient {
362
361
  /**
363
362
  * @typedef {TsAuthMembership & {
364
363
  * readonly user: {
365
- * readonly id: string;
364
+ * readonly id: import("./ids.js").EntityId;
366
365
  * readonly email: string;
367
366
  * readonly name: string;
368
367
  * } | null;
@@ -370,8 +369,8 @@ export class TsAuthApiKeysClient {
370
369
  */
371
370
  /**
372
371
  * @typedef {{
373
- * readonly id: string;
374
- * readonly organization_id: string;
372
+ * readonly id: import("./ids.js").EntityId;
373
+ * readonly organization_id: import("./ids.js").EntityId;
375
374
  * readonly email: string;
376
375
  * readonly role: string;
377
376
  * readonly status: string;
@@ -381,13 +380,13 @@ export class TsAuthApiKeysClient {
381
380
  */
382
381
  /**
383
382
  * @typedef {{
384
- * readonly id: string;
385
- * readonly organization_id: string;
383
+ * readonly id: import("./ids.js").EntityId;
384
+ * readonly organization_id: import("./ids.js").EntityId;
386
385
  * readonly domain: string;
387
386
  * readonly created_at: number; // Unix seconds.
388
387
  * }} TsAuthOrganizationDomain
389
388
  */
390
- /** @typedef {{ readonly org_id: string }} TsAuthDomainEnrollment */
389
+ /** @typedef {{ readonly org_id: import("./ids.js").EntityId }} TsAuthDomainEnrollment */
391
390
  /**
392
391
  * @typedef {{
393
392
  * readonly name: string;
@@ -401,7 +400,7 @@ export class TsAuthApiKeysClient {
401
400
  */
402
401
  /**
403
402
  * @typedef {{
404
- * readonly user_id: string;
403
+ * readonly user_id: import("./ids.js").EntityId;
405
404
  * readonly role: string;
406
405
  * }} TsAuthCreateMembershipRequest
407
406
  */
@@ -418,7 +417,7 @@ export class TsAuthApiKeysClient {
418
417
  */
419
418
  /**
420
419
  * @typedef {{
421
- * readonly user_id: string;
420
+ * readonly user_id: import("./ids.js").EntityId;
422
421
  * }} TsAuthEnrollRequest
423
422
  */
424
423
  export class TsAuthOrganizationsClient {
@@ -552,8 +551,8 @@ export class TsAuthOrganizationsClient {
552
551
  */
553
552
  /**
554
553
  * @typedef {{
555
- * readonly id: string;
556
- * readonly client_id: string;
554
+ * readonly id: import("./ids.js").EntityId;
555
+ * readonly client_id: import("./ids.js").EntityId;
557
556
  * readonly name: string;
558
557
  * readonly redirect_uris: readonly string[];
559
558
  * readonly post_logout_redirect_uris: readonly string[];
@@ -613,7 +612,7 @@ export class TsAuthOauthClientsClient {
613
612
  /**
614
613
  * @typedef {{
615
614
  * readonly audience: string;
616
- * readonly allowed_client_ids: readonly string[];
615
+ * readonly allowed_client_ids: readonly import("./ids.js").EntityId[];
617
616
  * readonly allowed_grant_types: readonly TsAuthOauthGrantType[];
618
617
  * readonly allowed_scopes: readonly string[];
619
618
  * }} TsAuthCreateOauthResourceRequest
@@ -621,7 +620,7 @@ export class TsAuthOauthClientsClient {
621
620
  /**
622
621
  * @typedef {{
623
622
  * readonly expected_auth_epoch: number;
624
- * readonly allowed_client_ids?: readonly string[] | undefined;
623
+ * readonly allowed_client_ids?: readonly import("./ids.js").EntityId[] | undefined;
625
624
  * readonly allowed_grant_types?: readonly TsAuthOauthGrantType[] | undefined;
626
625
  * readonly allowed_scopes?: readonly string[] | undefined;
627
626
  * readonly enabled?: boolean | undefined;
@@ -630,8 +629,8 @@ export class TsAuthOauthClientsClient {
630
629
  */
631
630
  /**
632
631
  * @typedef {TsAuthCreateOauthResourceRequest & {
633
- * readonly id: string;
634
- * readonly introspection_client_id: string;
632
+ * readonly id: import("./ids.js").EntityId;
633
+ * readonly introspection_client_id: import("./ids.js").EntityId;
635
634
  * readonly token_endpoint_auth_method: "client_secret_basic";
636
635
  * readonly auth_epoch: number;
637
636
  * readonly enabled: boolean;
@@ -679,11 +678,11 @@ export class TsAuthOauthResourcesClient {
679
678
  }
680
679
  /**
681
680
  * @typedef {{
682
- * readonly id: string;
681
+ * readonly id: import("./ids.js").EntityId;
683
682
  * readonly type: "oidc" | "saml";
684
683
  * readonly name: string;
685
684
  * readonly enabled: boolean;
686
- * readonly org_id: string | null;
685
+ * readonly org_id: import("./ids.js").EntityId | null;
687
686
  * readonly issuer_url: string | null;
688
687
  * readonly client_id: string | null;
689
688
  * readonly authorization_endpoint: string | null;
@@ -756,15 +755,15 @@ export class TsAuthConnectionsClient {
756
755
  }
757
756
  /**
758
757
  * @typedef {{
759
- * readonly id: string;
760
- * readonly org_id: string | null;
758
+ * readonly id: import("./ids.js").EntityId;
759
+ * readonly org_id: import("./ids.js").EntityId | null;
761
760
  * readonly token: string; // One-time SCIM bearer; only create and rotate return it.
762
761
  * }} TsAuthDirectoryWithToken
763
762
  */
764
763
  /**
765
764
  * @typedef {{
766
- * readonly id: string;
767
- * readonly org_id: string | null;
765
+ * readonly id: import("./ids.js").EntityId;
766
+ * readonly org_id: import("./ids.js").EntityId | null;
768
767
  * readonly created_at: number; // Unix seconds.
769
768
  * }} TsAuthDirectory
770
769
  */
@@ -825,17 +824,17 @@ export class TsAuthJwtTemplatesClient {
825
824
  delete(name: string): Promise<TerraScaleResult<void>>;
826
825
  /**
827
826
  * @param {string} name
828
- * @param {{ readonly user_id: string }} request
827
+ * @param {{ readonly user_id: import("./ids.js").EntityId }} request
829
828
  * @returns {Promise<TerraScaleResult<TsAuthJwtTokenResponse>>}
830
829
  */
831
830
  issueToken(name: string, request: {
832
- readonly user_id: string;
831
+ readonly user_id: import("./ids.js").EntityId;
833
832
  }): Promise<TerraScaleResult<TsAuthJwtTokenResponse>>;
834
833
  #private;
835
834
  }
836
835
  /**
837
836
  * @typedef {{
838
- * readonly id: string;
837
+ * readonly id: import("./ids.js").EntityId;
839
838
  * readonly url: string;
840
839
  * readonly events: readonly string[];
841
840
  * readonly signing_secret: string; // One-time HMAC key for verifying deliveries; only create returns it.
@@ -843,7 +842,7 @@ export class TsAuthJwtTemplatesClient {
843
842
  */
844
843
  /**
845
844
  * @typedef {{
846
- * readonly id: string;
845
+ * readonly id: import("./ids.js").EntityId;
847
846
  * readonly url: string;
848
847
  * readonly events: readonly string[];
849
848
  * readonly enabled: boolean;
@@ -852,9 +851,9 @@ export class TsAuthJwtTemplatesClient {
852
851
  */
853
852
  /**
854
853
  * @typedef {{
855
- * readonly id: string; // endpointId:eventId
856
- * readonly endpoint_id: string;
857
- * readonly event_id: string;
854
+ * readonly id: `${import("./ids.js").EntityId}:${import("./ids.js").EntityId}`; // endpointId:eventId delivery selector.
855
+ * readonly endpoint_id: import("./ids.js").EntityId;
856
+ * readonly event_id: import("./ids.js").EntityId;
858
857
  * readonly attempts: number;
859
858
  * readonly last_error?: string | undefined;
860
859
  * readonly updated_at: number; // Unix seconds.
@@ -901,10 +900,10 @@ export class TsAuthWebhooksClient {
901
900
  }
902
901
  /**
903
902
  * @typedef {{
904
- * readonly id: string;
905
- * readonly instance_id: string;
903
+ * readonly id: import("./ids.js").EntityId;
904
+ * readonly instance_id: import("./ids.js").EntityId;
906
905
  * readonly type: string;
907
- * readonly actor_id?: string | undefined; // Omitted from the wire when null.
906
+ * readonly actor_id?: import("./ids.js").EntityId | undefined; // Omitted from the wire when null.
908
907
  * readonly data: Record<string, unknown>;
909
908
  * readonly created_at: number; // Unix seconds.
910
909
  * readonly integrity_version: number;
@@ -983,7 +982,7 @@ export class TsAuthBillingClient {
983
982
  }
984
983
  /**
985
984
  * @typedef {{
986
- * readonly id: string;
985
+ * readonly id: import("./ids.js").EntityId;
987
986
  * readonly slug: string;
988
987
  * readonly name: string;
989
988
  * readonly logo_url?: string | null | undefined;
@@ -1052,7 +1051,7 @@ export class TsAuthInstanceClient {
1052
1051
  /** @typedef {{ readonly keys: readonly TsAuthOidcJwk[] }} TsAuthOidcJwks */
1053
1052
  /**
1054
1053
  * @typedef {{
1055
- * readonly client_id: string;
1054
+ * readonly client_id: import("./ids.js").EntityId;
1056
1055
  * readonly redirect_uri: string;
1057
1056
  * readonly response_type: "code";
1058
1057
  * readonly scope?: string | undefined;
@@ -1127,20 +1126,20 @@ export class TsAuthInstanceClient {
1127
1126
  * readonly active: true;
1128
1127
  * readonly token_type: "Bearer";
1129
1128
  * readonly iss: string;
1130
- * readonly sub: string;
1129
+ * readonly sub: import("./ids.js").EntityId;
1131
1130
  * readonly aud: string;
1132
- * readonly client_id: string;
1131
+ * readonly client_id: import("./ids.js").EntityId;
1133
1132
  * readonly scope: string;
1134
1133
  * readonly exp: number;
1135
1134
  * readonly iat: number;
1136
- * readonly sid: string | null;
1135
+ * readonly sid: import("./ids.js").EntityId | null;
1137
1136
  * readonly principal_kind: "user" | "service";
1138
1137
  * }} TsAuthOidcAccessIntrospection
1139
1138
  */
1140
1139
  /**
1141
1140
  * @typedef {Omit<TsAuthOidcAccessIntrospection, "token_type" | "principal_kind"> & {
1142
1141
  * readonly token_type: "refresh_token";
1143
- * readonly family_id: string;
1142
+ * readonly family_id: import("./ids.js").EntityId;
1144
1143
  * }} TsAuthOidcRefreshIntrospection
1145
1144
  */
1146
1145
  /**
@@ -1151,7 +1150,7 @@ export class TsAuthInstanceClient {
1151
1150
  /**
1152
1151
  * @typedef {Omit<TsAuthOidcAccessIntrospection, "sid" | "principal_kind"> &
1153
1152
  * (
1154
- * | { readonly principal_kind: "user"; readonly sid: string }
1153
+ * | { readonly principal_kind: "user"; readonly sid: import("./ids.js").EntityId }
1155
1154
  * | { readonly principal_kind: "service"; readonly sid: null }
1156
1155
  * )} TsAuthOidcResourceAccessIntrospection
1157
1156
  */
@@ -1163,13 +1162,13 @@ export class TsAuthInstanceClient {
1163
1162
  * @typedef {{
1164
1163
  * readonly issuer: string; // Configured canonical provider issuer, independently trusted by the caller.
1165
1164
  * readonly audience: string; // Exact registered resource URI; never derived from the response.
1166
- * readonly introspection_client_id: string;
1165
+ * readonly introspection_client_id: import("./ids.js").EntityId;
1167
1166
  * readonly introspection_secret: string;
1168
1167
  * }} TsAuthOidcResourceCredentials
1169
1168
  */
1170
1169
  /**
1171
1170
  * @typedef {{
1172
- * readonly sub: string;
1171
+ * readonly sub: import("./ids.js").EntityId;
1173
1172
  * readonly email?: string | undefined;
1174
1173
  * readonly email_verified?: boolean | undefined;
1175
1174
  * readonly name?: string | undefined;
@@ -1335,13 +1334,12 @@ export type TsAuthRuntimeConfig = import("./config.js").TsAuthRuntimeConfig;
1335
1334
  export type TsAuthClientConfig = Omit<TsAuthRuntimeConfig, "apiBaseUrl"> & {
1336
1335
  readonly apiBaseUrl: string;
1337
1336
  readonly instanceSlug: string;
1338
- readonly useReverseProxy?: boolean;
1339
1337
  };
1340
1338
  export type TsAuthRequestOptions = {
1341
1339
  readonly signal?: AbortSignal | undefined;
1342
1340
  };
1343
1341
  export type TsAuthUser = {
1344
- readonly id: string;
1342
+ readonly id: import("./ids.js").EntityId;
1345
1343
  readonly email: string | null;
1346
1344
  readonly email_verified: boolean;
1347
1345
  readonly username: string | null;
@@ -1354,7 +1352,7 @@ export type TsAuthUser = {
1354
1352
  readonly private_metadata?: Record<string, unknown> | undefined;
1355
1353
  };
1356
1354
  export type TsAuthSession = {
1357
- readonly id: string;
1355
+ readonly id: import("./ids.js").EntityId;
1358
1356
  readonly status: string;
1359
1357
  readonly created_at: number;
1360
1358
  readonly expires_at: number;
@@ -1363,26 +1361,26 @@ export type TsAuthSession = {
1363
1361
  readonly ip_address?: string | null | undefined;
1364
1362
  };
1365
1363
  export type TsAuthMfaFactor = {
1366
- readonly id: string;
1364
+ readonly id: import("./ids.js").EntityId;
1367
1365
  readonly type: string;
1368
1366
  readonly confirmed: boolean;
1369
1367
  readonly createdAt: number;
1370
1368
  };
1371
1369
  export type TsAuthPasskey = {
1372
- readonly id: string;
1370
+ readonly id: import("./ids.js").EntityId;
1373
1371
  readonly nickname: string | null;
1374
1372
  readonly algorithm: string;
1375
1373
  readonly createdAt: number;
1376
1374
  readonly lastUsedAt: number | null;
1377
1375
  };
1378
1376
  export type TsAuthOrganization = {
1379
- readonly id: string;
1377
+ readonly id: import("./ids.js").EntityId;
1380
1378
  readonly name: string;
1381
1379
  readonly slug: string;
1382
1380
  readonly created_at: number;
1383
1381
  };
1384
1382
  export type TsAuthUserOrganizationMembership = {
1385
- readonly id: string;
1383
+ readonly id: import("./ids.js").EntityId;
1386
1384
  readonly role: string;
1387
1385
  readonly created_at: number;
1388
1386
  readonly organization: TsAuthOrganization | null;
@@ -1420,13 +1418,13 @@ export type TsAuthCreateUserRequest = {
1420
1418
  readonly name?: string | undefined;
1421
1419
  };
1422
1420
  export type TsAuthApiKeyWithSecret = {
1423
- readonly id: string;
1421
+ readonly id: import("./ids.js").EntityId;
1424
1422
  readonly name: string;
1425
1423
  readonly api_key: string;
1426
1424
  readonly scopes: readonly string[];
1427
1425
  };
1428
1426
  export type TsAuthApiKey = {
1429
- readonly id: string;
1427
+ readonly id: import("./ids.js").EntityId;
1430
1428
  readonly name: string;
1431
1429
  readonly scopes: readonly string[];
1432
1430
  readonly created_at: number;
@@ -1441,22 +1439,22 @@ export type TsAuthCreateApiKeyRequest = {
1441
1439
  readonly scopes?: readonly string[] | undefined;
1442
1440
  };
1443
1441
  export type TsAuthMembership = {
1444
- readonly id: string;
1445
- readonly organization_id: string;
1446
- readonly user_id: string;
1442
+ readonly id: import("./ids.js").EntityId;
1443
+ readonly organization_id: import("./ids.js").EntityId;
1444
+ readonly user_id: import("./ids.js").EntityId;
1447
1445
  readonly role: string;
1448
1446
  readonly created_at: number;
1449
1447
  };
1450
1448
  export type TsAuthMembershipWithUser = TsAuthMembership & {
1451
1449
  readonly user: {
1452
- readonly id: string;
1450
+ readonly id: import("./ids.js").EntityId;
1453
1451
  readonly email: string;
1454
1452
  readonly name: string;
1455
1453
  } | null;
1456
1454
  };
1457
1455
  export type TsAuthInvitation = {
1458
- readonly id: string;
1459
- readonly organization_id: string;
1456
+ readonly id: import("./ids.js").EntityId;
1457
+ readonly organization_id: import("./ids.js").EntityId;
1460
1458
  readonly email: string;
1461
1459
  readonly role: string;
1462
1460
  readonly status: string;
@@ -1464,13 +1462,13 @@ export type TsAuthInvitation = {
1464
1462
  readonly created_at: number;
1465
1463
  };
1466
1464
  export type TsAuthOrganizationDomain = {
1467
- readonly id: string;
1468
- readonly organization_id: string;
1465
+ readonly id: import("./ids.js").EntityId;
1466
+ readonly organization_id: import("./ids.js").EntityId;
1469
1467
  readonly domain: string;
1470
1468
  readonly created_at: number;
1471
1469
  };
1472
1470
  export type TsAuthDomainEnrollment = {
1473
- readonly org_id: string;
1471
+ readonly org_id: import("./ids.js").EntityId;
1474
1472
  };
1475
1473
  export type TsAuthCreateOrganizationRequest = {
1476
1474
  readonly name: string;
@@ -1480,7 +1478,7 @@ export type TsAuthUpdateOrganizationRequest = {
1480
1478
  readonly name: string;
1481
1479
  };
1482
1480
  export type TsAuthCreateMembershipRequest = {
1483
- readonly user_id: string;
1481
+ readonly user_id: import("./ids.js").EntityId;
1484
1482
  readonly role: string;
1485
1483
  };
1486
1484
  export type TsAuthCreateInvitationRequest = {
@@ -1491,7 +1489,7 @@ export type TsAuthAddDomainRequest = {
1491
1489
  readonly domain: string;
1492
1490
  };
1493
1491
  export type TsAuthEnrollRequest = {
1494
- readonly user_id: string;
1492
+ readonly user_id: import("./ids.js").EntityId;
1495
1493
  };
1496
1494
  export type TsAuthOauthGrantType = "authorization_code" | "refresh_token" | "client_credentials" | "urn:ietf:params:oauth:grant-type:device_code";
1497
1495
  export type TsAuthOauthClientAuthMethod = "none" | "client_secret_post" | "client_secret_basic";
@@ -1513,8 +1511,8 @@ export type TsAuthUpdateOauthClientRequest = Omit<TsAuthCreateOauthClientRequest
1513
1511
  readonly rotate_secret?: boolean | undefined;
1514
1512
  };
1515
1513
  export type TsAuthOauthClientView = {
1516
- readonly id: string;
1517
- readonly client_id: string;
1514
+ readonly id: import("./ids.js").EntityId;
1515
+ readonly client_id: import("./ids.js").EntityId;
1518
1516
  readonly name: string;
1519
1517
  readonly redirect_uris: readonly string[];
1520
1518
  readonly post_logout_redirect_uris: readonly string[];
@@ -1539,21 +1537,21 @@ export type TsAuthOauthClientList = {
1539
1537
  export type TsAuthOauthClientUpdate = TsAuthOauthClientView | TsAuthOauthClientWithSecret;
1540
1538
  export type TsAuthCreateOauthResourceRequest = {
1541
1539
  readonly audience: string;
1542
- readonly allowed_client_ids: readonly string[];
1540
+ readonly allowed_client_ids: readonly import("./ids.js").EntityId[];
1543
1541
  readonly allowed_grant_types: readonly TsAuthOauthGrantType[];
1544
1542
  readonly allowed_scopes: readonly string[];
1545
1543
  };
1546
1544
  export type TsAuthUpdateOauthResourceRequest = {
1547
1545
  readonly expected_auth_epoch: number;
1548
- readonly allowed_client_ids?: readonly string[] | undefined;
1546
+ readonly allowed_client_ids?: readonly import("./ids.js").EntityId[] | undefined;
1549
1547
  readonly allowed_grant_types?: readonly TsAuthOauthGrantType[] | undefined;
1550
1548
  readonly allowed_scopes?: readonly string[] | undefined;
1551
1549
  readonly enabled?: boolean | undefined;
1552
1550
  readonly rotate_secret?: boolean | undefined;
1553
1551
  };
1554
1552
  export type TsAuthOauthResourceView = TsAuthCreateOauthResourceRequest & {
1555
- readonly id: string;
1556
- readonly introspection_client_id: string;
1553
+ readonly id: import("./ids.js").EntityId;
1554
+ readonly introspection_client_id: import("./ids.js").EntityId;
1557
1555
  readonly token_endpoint_auth_method: "client_secret_basic";
1558
1556
  readonly auth_epoch: number;
1559
1557
  readonly enabled: boolean;
@@ -1568,11 +1566,11 @@ export type TsAuthOauthResourceList = {
1568
1566
  readonly resources: readonly TsAuthOauthResourceView[];
1569
1567
  };
1570
1568
  export type TsAuthConnectionView = {
1571
- readonly id: string;
1569
+ readonly id: import("./ids.js").EntityId;
1572
1570
  readonly type: "oidc" | "saml";
1573
1571
  readonly name: string;
1574
1572
  readonly enabled: boolean;
1575
- readonly org_id: string | null;
1573
+ readonly org_id: import("./ids.js").EntityId | null;
1576
1574
  readonly issuer_url: string | null;
1577
1575
  readonly client_id: string | null;
1578
1576
  readonly authorization_endpoint: string | null;
@@ -1608,17 +1606,17 @@ export type TsAuthConnectionPatch = {
1608
1606
  readonly client_secret?: string | undefined;
1609
1607
  };
1610
1608
  export type TsAuthDirectoryWithToken = {
1611
- readonly id: string;
1612
- readonly org_id: string | null;
1609
+ readonly id: import("./ids.js").EntityId;
1610
+ readonly org_id: import("./ids.js").EntityId | null;
1613
1611
  readonly token: string;
1614
1612
  };
1615
1613
  export type TsAuthDirectory = {
1616
- readonly id: string;
1617
- readonly org_id: string | null;
1614
+ readonly id: import("./ids.js").EntityId;
1615
+ readonly org_id: import("./ids.js").EntityId | null;
1618
1616
  readonly created_at: number;
1619
1617
  };
1620
1618
  export type TsAuthJwtTemplate = {
1621
- readonly id: string;
1619
+ readonly id: import("./ids.js").EntityId;
1622
1620
  readonly name: string;
1623
1621
  readonly claims: Record<string, string>;
1624
1622
  readonly lifetime_seconds: number;
@@ -1638,31 +1636,31 @@ export type TsAuthUpdateJwtTemplateRequest = {
1638
1636
  readonly lifetime_seconds?: number | undefined;
1639
1637
  };
1640
1638
  export type TsAuthWebhookWithSecret = {
1641
- readonly id: string;
1639
+ readonly id: import("./ids.js").EntityId;
1642
1640
  readonly url: string;
1643
1641
  readonly events: readonly string[];
1644
1642
  readonly signing_secret: string;
1645
1643
  };
1646
1644
  export type TsAuthWebhook = {
1647
- readonly id: string;
1645
+ readonly id: import("./ids.js").EntityId;
1648
1646
  readonly url: string;
1649
1647
  readonly events: readonly string[];
1650
1648
  readonly enabled: boolean;
1651
1649
  readonly created_at: number;
1652
1650
  };
1653
1651
  export type TsAuthDeadLetterEntry = {
1654
- readonly id: string;
1655
- readonly endpoint_id: string;
1656
- readonly event_id: string;
1652
+ readonly id: `${import("./ids.js").EntityId}:${import("./ids.js").EntityId}`;
1653
+ readonly endpoint_id: import("./ids.js").EntityId;
1654
+ readonly event_id: import("./ids.js").EntityId;
1657
1655
  readonly attempts: number;
1658
1656
  readonly last_error?: string | undefined;
1659
1657
  readonly updated_at: number;
1660
1658
  };
1661
1659
  export type TsAuthAuditEvent = {
1662
- readonly id: string;
1663
- readonly instance_id: string;
1660
+ readonly id: import("./ids.js").EntityId;
1661
+ readonly instance_id: import("./ids.js").EntityId;
1664
1662
  readonly type: string;
1665
- readonly actor_id?: string | undefined;
1663
+ readonly actor_id?: import("./ids.js").EntityId | undefined;
1666
1664
  readonly data: Record<string, unknown>;
1667
1665
  readonly created_at: number;
1668
1666
  readonly integrity_version: number;
@@ -1680,7 +1678,7 @@ export type TsAuthBillingOverview = {
1680
1678
  readonly quota: number;
1681
1679
  };
1682
1680
  export type TsAuthInstance = {
1683
- readonly id: string;
1681
+ readonly id: import("./ids.js").EntityId;
1684
1682
  readonly slug: string;
1685
1683
  readonly name: string;
1686
1684
  readonly logo_url?: string | null | undefined;
@@ -1730,7 +1728,7 @@ export type TsAuthOidcJwks = {
1730
1728
  readonly keys: readonly TsAuthOidcJwk[];
1731
1729
  };
1732
1730
  export type TsAuthOidcAuthorizationRequest = {
1733
- readonly client_id: string;
1731
+ readonly client_id: import("./ids.js").EntityId;
1734
1732
  readonly redirect_uri: string;
1735
1733
  readonly response_type: "code";
1736
1734
  readonly scope?: string | undefined;
@@ -1788,23 +1786,23 @@ export type TsAuthOidcAccessIntrospection = {
1788
1786
  readonly active: true;
1789
1787
  readonly token_type: "Bearer";
1790
1788
  readonly iss: string;
1791
- readonly sub: string;
1789
+ readonly sub: import("./ids.js").EntityId;
1792
1790
  readonly aud: string;
1793
- readonly client_id: string;
1791
+ readonly client_id: import("./ids.js").EntityId;
1794
1792
  readonly scope: string;
1795
1793
  readonly exp: number;
1796
1794
  readonly iat: number;
1797
- readonly sid: string | null;
1795
+ readonly sid: import("./ids.js").EntityId | null;
1798
1796
  readonly principal_kind: "user" | "service";
1799
1797
  };
1800
1798
  export type TsAuthOidcRefreshIntrospection = Omit<TsAuthOidcAccessIntrospection, "token_type" | "principal_kind"> & {
1801
1799
  readonly token_type: "refresh_token";
1802
- readonly family_id: string;
1800
+ readonly family_id: import("./ids.js").EntityId;
1803
1801
  };
1804
1802
  export type TsAuthOidcIntrospection = TsAuthOidcInactiveIntrospection | TsAuthOidcAccessIntrospection | TsAuthOidcRefreshIntrospection;
1805
1803
  export type TsAuthOidcResourceAccessIntrospection = Omit<TsAuthOidcAccessIntrospection, "sid" | "principal_kind"> & ({
1806
1804
  readonly principal_kind: "user";
1807
- readonly sid: string;
1805
+ readonly sid: import("./ids.js").EntityId;
1808
1806
  } | {
1809
1807
  readonly principal_kind: "service";
1810
1808
  readonly sid: null;
@@ -1813,11 +1811,11 @@ export type TsAuthOidcResourceIntrospection = TsAuthOidcInactiveIntrospection |
1813
1811
  export type TsAuthOidcResourceCredentials = {
1814
1812
  readonly issuer: string;
1815
1813
  readonly audience: string;
1816
- readonly introspection_client_id: string;
1814
+ readonly introspection_client_id: import("./ids.js").EntityId;
1817
1815
  readonly introspection_secret: string;
1818
1816
  };
1819
1817
  export type TsAuthOidcUserInfo = {
1820
- readonly sub: string;
1818
+ readonly sub: import("./ids.js").EntityId;
1821
1819
  readonly email?: string | undefined;
1822
1820
  readonly email_verified?: boolean | undefined;
1823
1821
  readonly name?: string | undefined;