@logto/schemas 1.41.0 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/alterations/1.42.0-1783916980-add-domain-verification-files.ts +20 -0
  2. package/alterations/1.42.0-1784619793-add-service-logs-created-at-index.ts +33 -0
  3. package/alterations/1.42.0-1784620000-add-saml-sso-connector-signing-keys-table.ts +38 -0
  4. package/alterations/1.43.0-1785393731-add-oidc-model-instances-account-id-partial-index.ts +33 -0
  5. package/alterations/1.43.0-1785481546-add-tenant-aware-scope-indexes.ts +33 -0
  6. package/alterations/1.43.0-1785488115-add-cimd-permission-ceiling-tables.ts +77 -0
  7. package/alterations/1.43.0-1785722831-add-oidc-session-extensions-account-id-index.ts +27 -0
  8. package/alterations/1.43.0-1785835991-add-cimd-client-identifier-columns.ts +31 -0
  9. package/alterations/1.43.0-1786325989-add-cimd-grant-organizations-table.ts +54 -0
  10. package/alterations/1.43.0-1786333495-add-trusted-devices.ts +57 -0
  11. package/alterations/1.43.0-1786373004-tighten-cimd-grant-organizations-pkey.ts +28 -0
  12. package/alterations/1.43.0-1786414712-add-service-logs-email-indexes.ts +34 -0
  13. package/alterations/1.43.0-1786431364-add-cimd-grant-client-snapshots-table.ts +43 -0
  14. package/alterations/utils/1704934999-tables.ts +22 -1
  15. package/alterations-js/1.42.0-1783916980-add-domain-verification-files.js +16 -0
  16. package/alterations-js/1.42.0-1784619793-add-service-logs-created-at-index.js +29 -0
  17. package/alterations-js/1.42.0-1784620000-add-saml-sso-connector-signing-keys-table.js +33 -0
  18. package/alterations-js/1.43.0-1785393731-add-oidc-model-instances-account-id-partial-index.js +28 -0
  19. package/alterations-js/1.43.0-1785481546-add-tenant-aware-scope-indexes.js +28 -0
  20. package/alterations-js/1.43.0-1785488115-add-cimd-permission-ceiling-tables.js +69 -0
  21. package/alterations-js/1.43.0-1785722831-add-oidc-session-extensions-account-id-index.js +23 -0
  22. package/alterations-js/1.43.0-1785835991-add-cimd-client-identifier-columns.js +27 -0
  23. package/alterations-js/1.43.0-1786325989-add-cimd-grant-organizations-table.js +49 -0
  24. package/alterations-js/1.43.0-1786333495-add-trusted-devices.js +50 -0
  25. package/alterations-js/1.43.0-1786373004-tighten-cimd-grant-organizations-pkey.js +24 -0
  26. package/alterations-js/1.43.0-1786414712-add-service-logs-email-indexes.js +30 -0
  27. package/alterations-js/1.43.0-1786431364-add-cimd-grant-client-snapshots-table.js +38 -0
  28. package/alterations-js/utils/1704934999-tables.js +19 -1
  29. package/lib/consts/experience.d.ts +1 -0
  30. package/lib/consts/experience.js +1 -0
  31. package/lib/consts/index.d.ts +1 -0
  32. package/lib/consts/index.js +1 -0
  33. package/lib/consts/product-event.d.ts +5 -1
  34. package/lib/consts/product-event.js +4 -0
  35. package/lib/consts/social-state.d.ts +12 -0
  36. package/lib/consts/social-state.js +12 -0
  37. package/lib/db-entries/cimd-grant-client-snapshot.d.ts +32 -0
  38. package/lib/db-entries/cimd-grant-client-snapshot.js +45 -0
  39. package/lib/db-entries/cimd-grant-organization.d.ts +30 -0
  40. package/lib/db-entries/cimd-grant-organization.js +37 -0
  41. package/lib/db-entries/cimd-organization-resource-scope.d.ts +20 -0
  42. package/lib/db-entries/cimd-organization-resource-scope.js +25 -0
  43. package/lib/db-entries/cimd-organization-scope.d.ts +20 -0
  44. package/lib/db-entries/cimd-organization-scope.js +25 -0
  45. package/lib/db-entries/cimd-resource-scope.d.ts +20 -0
  46. package/lib/db-entries/cimd-resource-scope.js +25 -0
  47. package/lib/db-entries/cimd-user-scope.d.ts +20 -0
  48. package/lib/db-entries/cimd-user-scope.js +25 -0
  49. package/lib/db-entries/domain.d.ts +4 -2
  50. package/lib/db-entries/domain.js +5 -1
  51. package/lib/db-entries/index.d.ts +8 -0
  52. package/lib/db-entries/index.js +8 -0
  53. package/lib/db-entries/oidc-session-extension.d.ts +3 -1
  54. package/lib/db-entries/oidc-session-extension.js +4 -0
  55. package/lib/db-entries/organization.d.ts +5 -1
  56. package/lib/db-entries/organization.js +4 -0
  57. package/lib/db-entries/saml-sso-connector-signing-key.d.ts +32 -0
  58. package/lib/db-entries/saml-sso-connector-signing-key.js +49 -0
  59. package/lib/db-entries/sign-in-experience.d.ts +4 -2
  60. package/lib/db-entries/sign-in-experience.js +5 -1
  61. package/lib/db-entries/trusted-device.d.ts +36 -0
  62. package/lib/db-entries/trusted-device.js +62 -0
  63. package/lib/db-entries/user.d.ts +3 -1
  64. package/lib/db-entries/user.js +4 -0
  65. package/lib/foundations/jsonb-types/account-centers.d.ts +3 -0
  66. package/lib/foundations/jsonb-types/account-centers.js +1 -0
  67. package/lib/foundations/jsonb-types/account-centers.test.d.ts +1 -0
  68. package/lib/foundations/jsonb-types/account-centers.test.js +13 -0
  69. package/lib/foundations/jsonb-types/custom-domain.d.ts +57 -0
  70. package/lib/foundations/jsonb-types/custom-domain.js +51 -0
  71. package/lib/foundations/jsonb-types/custom-domain.test.d.ts +1 -0
  72. package/lib/foundations/jsonb-types/custom-domain.test.js +38 -0
  73. package/lib/foundations/jsonb-types/hooks.d.ts +9 -5
  74. package/lib/foundations/jsonb-types/hooks.js +8 -0
  75. package/lib/foundations/jsonb-types/logs.d.ts +18 -0
  76. package/lib/foundations/jsonb-types/logs.js +6 -0
  77. package/lib/foundations/jsonb-types/one-time-tokens.d.ts +5 -0
  78. package/lib/foundations/jsonb-types/one-time-tokens.js +2 -0
  79. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +39 -4
  80. package/lib/foundations/jsonb-types/sign-in-experience.js +10 -0
  81. package/lib/foundations/jsonb-types/sign-in-experience.test.js +17 -1
  82. package/lib/types/application.d.ts +131 -1
  83. package/lib/types/application.js +8 -0
  84. package/lib/types/connector.d.ts +8 -0
  85. package/lib/types/consent.d.ts +16 -190
  86. package/lib/types/consent.js +10 -1
  87. package/lib/types/custom-profile-fields.d.ts +2 -1
  88. package/lib/types/domain.d.ts +9 -0
  89. package/lib/types/hook.d.ts +37 -5
  90. package/lib/types/index.d.ts +1 -0
  91. package/lib/types/index.js +1 -0
  92. package/lib/types/interaction-event.d.ts +11 -0
  93. package/lib/types/interaction-event.js +12 -0
  94. package/lib/types/interactions.d.ts +2 -11
  95. package/lib/types/interactions.js +2 -11
  96. package/lib/types/log/action.d.ts +7 -0
  97. package/lib/types/log/action.js +6 -0
  98. package/lib/types/log/index.d.ts +8 -2
  99. package/lib/types/log/index.js +2 -0
  100. package/lib/types/log/trusted-device.d.ts +7 -0
  101. package/lib/types/log/trusted-device.js +6 -0
  102. package/lib/types/logto-config/action.d.ts +963 -0
  103. package/lib/types/logto-config/action.js +77 -0
  104. package/lib/types/logto-config/index.d.ts +68 -26
  105. package/lib/types/logto-config/index.js +20 -7
  106. package/lib/types/logto-config/index.test.js +32 -9
  107. package/lib/types/logto-config/jwt-customizer.d.ts +60 -10
  108. package/lib/types/logto-config/jwt-customizer.js +1 -1
  109. package/lib/types/logto-config/oidc-provider.d.ts +2 -2
  110. package/lib/types/organization.d.ts +136 -1
  111. package/lib/types/organization.js +3 -2
  112. package/lib/types/service-log.d.ts +14 -1
  113. package/lib/types/service-log.js +13 -0
  114. package/lib/types/sign-in-experience.d.ts +18 -10
  115. package/lib/types/sign-in-experience.js +2 -1
  116. package/lib/types/sso-connector.d.ts +58 -0
  117. package/lib/types/sso-connector.js +12 -0
  118. package/lib/types/system.d.ts +2 -2
  119. package/lib/types/trusted-device.d.ts +67 -0
  120. package/lib/types/trusted-device.js +16 -0
  121. package/lib/types/user-sessions.d.ts +117 -238
  122. package/lib/types/user-sessions.js +9 -4
  123. package/lib/types/user.d.ts +10 -3
  124. package/lib/types/user.js +1 -0
  125. package/lib/types/verification-records/one-time-token-verification.d.ts +5 -0
  126. package/lib/utils/cimd.d.ts +14 -0
  127. package/lib/utils/cimd.js +14 -0
  128. package/lib/utils/cimd.test.d.ts +1 -0
  129. package/lib/utils/cimd.test.js +9 -0
  130. package/lib/utils/index.d.ts +1 -0
  131. package/lib/utils/index.js +1 -0
  132. package/package.json +7 -7
  133. package/tables/cimd_grant_client_snapshots.sql +27 -0
  134. package/tables/cimd_grant_organizations.sql +38 -0
  135. package/tables/cimd_organization_resource_scopes.sql +16 -0
  136. package/tables/cimd_organization_scopes.sql +15 -0
  137. package/tables/cimd_resource_scopes.sql +15 -0
  138. package/tables/cimd_user_scopes.sql +13 -0
  139. package/tables/domains.sql +1 -0
  140. package/tables/oidc_model_instances.sql +5 -0
  141. package/tables/oidc_session_extensions.sql +5 -0
  142. package/tables/organization_scopes.sql +4 -0
  143. package/tables/organizations.sql +2 -0
  144. package/tables/saml_sso_connector_signing_keys.sql +21 -0
  145. package/tables/scopes.sql +4 -0
  146. package/tables/service_logs.sql +19 -0
  147. package/tables/sign_in_experiences.sql +1 -0
  148. package/tables/trusted_devices.sql +25 -0
  149. package/tables/users.sql +1 -0
  150. package/lib/types/logto-config/inline-hook.d.ts +0 -76
  151. package/lib/types/logto-config/inline-hook.js +0 -25
@@ -1,15 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { AdditionalIdentifier, MfaFactor, SignInIdentifier } from '../foundations/index.js';
3
+ import { InteractionEvent } from './interaction-event.js';
3
4
  import type { EmailVerificationCodePayload, PhoneVerificationCodePayload } from './verification-code.js';
4
- /**
5
- * User interaction events defined in Logto RFC 0004.
6
- * @see {@link https://github.com/logto-io/rfcs | Logto RFCs} for more information.
7
- */
8
- export declare enum InteractionEvent {
9
- SignIn = "SignIn",
10
- Register = "Register",
11
- ForgotPassword = "ForgotPassword"
12
- }
5
+ export { eventGuard, InteractionEvent } from './interaction-event.js';
13
6
  export type VerificationIdentifier = {
14
7
  type: SignInIdentifier | AdditionalIdentifier;
15
8
  value: string;
@@ -377,7 +370,6 @@ export declare const socialPhonePayloadGuard: z.ZodObject<{
377
370
  connectorId: string;
378
371
  }>;
379
372
  export type SocialPhonePayload = z.infer<typeof socialPhonePayloadGuard>;
380
- export declare const eventGuard: z.ZodNativeEnum<typeof InteractionEvent>;
381
373
  export declare const identifierPayloadGuard: z.ZodUnion<[z.ZodObject<{
382
374
  username: z.ZodString;
383
375
  password: z.ZodString;
@@ -1181,4 +1173,3 @@ export declare const verifyMfaResultGuard: z.ZodObject<{
1181
1173
  id: string;
1182
1174
  }>;
1183
1175
  export type VerifyMfaResult = z.infer<typeof verifyMfaResultGuard>;
1184
- export {};
@@ -2,17 +2,9 @@
2
2
  import { emailRegEx, numberAndAlphabetRegEx, phoneRegEx, usernameRegEx } from '@logto/core-kit';
3
3
  import { z } from 'zod';
4
4
  import { AdditionalIdentifier, MfaFactor, SignInIdentifier, jsonObjectGuard, webAuthnTransportGuard, } from '../foundations/index.js';
5
+ import { InteractionEvent } from './interaction-event.js';
5
6
  import { emailVerificationCodePayloadGuard, phoneVerificationCodePayloadGuard, } from './verification-code.js';
6
- /**
7
- * User interaction events defined in Logto RFC 0004.
8
- * @see {@link https://github.com/logto-io/rfcs | Logto RFCs} for more information.
9
- */
10
- export var InteractionEvent;
11
- (function (InteractionEvent) {
12
- InteractionEvent["SignIn"] = "SignIn";
13
- InteractionEvent["Register"] = "Register";
14
- InteractionEvent["ForgotPassword"] = "ForgotPassword";
15
- })(InteractionEvent || (InteractionEvent = {}));
7
+ export { eventGuard, InteractionEvent } from './interaction-event.js';
16
8
  export const verificationIdentifierGuard = z.object({
17
9
  type: z.union([z.nativeEnum(SignInIdentifier), z.nativeEnum(AdditionalIdentifier)]),
18
10
  value: z.string(),
@@ -131,7 +123,6 @@ export const socialPhonePayloadGuard = z.object({
131
123
  connectorId: z.string(),
132
124
  phone: z.string(),
133
125
  });
134
- export const eventGuard = z.nativeEnum(InteractionEvent);
135
126
  export const identifierPayloadGuard = z.union([
136
127
  usernamePasswordPayloadGuard,
137
128
  emailPasswordPayloadGuard,
@@ -0,0 +1,7 @@
1
+ export type Prefix = 'Action';
2
+ export declare const prefix: Prefix;
3
+ export declare enum Type {
4
+ PostFirstFactorVerification = "PostFirstFactorVerification",
5
+ PostSignIn = "PostSignIn"
6
+ }
7
+ export type LogKey = `${Prefix}.${Type}`;
@@ -0,0 +1,6 @@
1
+ export const prefix = 'Action';
2
+ export var Type;
3
+ (function (Type) {
4
+ Type["PostFirstFactorVerification"] = "PostFirstFactorVerification";
5
+ Type["PostSignIn"] = "PostSignIn";
6
+ })(Type || (Type = {}));
@@ -1,31 +1,37 @@
1
+ import type * as action from './action.js';
1
2
  import type * as hook from './hook.js';
2
3
  import type * as interaction from './interaction.js';
3
4
  import type * as jwtCustomizer from './jwt-customizer.js';
4
5
  import type * as saml from './saml.js';
5
6
  import type * as token from './token.js';
7
+ import type * as trustedDevice from './trusted-device.js';
6
8
  export * as interaction from './interaction.js';
7
9
  export * as token from './token.js';
8
10
  export * as hook from './hook.js';
11
+ export * as action from './action.js';
9
12
  export * as jwtCustomizer from './jwt-customizer.js';
10
13
  export * as saml from './saml.js';
14
+ export * as trustedDevice from './trusted-device.js';
11
15
  /** Fallback for empty or unrecognized log keys. */
12
16
  export declare const LogKeyUnknown = "Unknown";
13
17
  export type InteractionLogKey = interaction.LogKey;
14
18
  export type TokenLogKey = token.LogKey;
15
19
  export type WebhookLogKey = hook.LogKey;
20
+ export type ActionLogKey = action.LogKey;
16
21
  export type JwtCustomizerLogKey = jwtCustomizer.LogKey;
17
22
  export type SamlLogKey = saml.LogKey;
23
+ export type TrustedDeviceLogKey = trustedDevice.LogKey;
18
24
  /**
19
25
  * The union type of all available audit log keys.
20
26
  *
21
27
  * - All user-facing audit log keys should be included here.
22
28
  * - Webhook log keys are excluded.
23
29
  */
24
- export type AuditLogKey = typeof LogKeyUnknown | InteractionLogKey | TokenLogKey | SamlLogKey | JwtCustomizerLogKey;
30
+ export type AuditLogKey = typeof LogKeyUnknown | InteractionLogKey | TokenLogKey | SamlLogKey | ActionLogKey | JwtCustomizerLogKey | TrustedDeviceLogKey;
25
31
  /**
26
32
  * The union type of all available log keys.
27
33
  * Note duplicate keys are allowed but should be avoided.
28
34
  **/
29
35
  export type LogKey = AuditLogKey | WebhookLogKey;
30
- export type AuditLogPrefix = interaction.Prefix | token.Type | saml.Prefix | jwtCustomizer.Prefix | typeof LogKeyUnknown;
36
+ export type AuditLogPrefix = interaction.Prefix | token.Type | saml.Prefix | action.Prefix | jwtCustomizer.Prefix | trustedDevice.Prefix | typeof LogKeyUnknown;
31
37
  export type WebhookLogPrefix = hook.Type;
@@ -1,7 +1,9 @@
1
1
  export * as interaction from './interaction.js';
2
2
  export * as token from './token.js';
3
3
  export * as hook from './hook.js';
4
+ export * as action from './action.js';
4
5
  export * as jwtCustomizer from './jwt-customizer.js';
5
6
  export * as saml from './saml.js';
7
+ export * as trustedDevice from './trusted-device.js';
6
8
  /** Fallback for empty or unrecognized log keys. */
7
9
  export const LogKeyUnknown = 'Unknown';
@@ -0,0 +1,7 @@
1
+ export type Prefix = 'TrustedDevice';
2
+ export declare const prefix: Prefix;
3
+ export declare enum Type {
4
+ Created = "Created",
5
+ Used = "Used"
6
+ }
7
+ export type LogKey = `${Prefix}.${Type}`;
@@ -0,0 +1,6 @@
1
+ export const prefix = 'TrustedDevice';
2
+ export var Type;
3
+ (function (Type) {
4
+ Type["Created"] = "Created";
5
+ Type["Used"] = "Used";
6
+ })(Type || (Type = {}));