@authhero/kysely-adapter 10.31.0 → 10.33.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.
@@ -5642,6 +5642,8 @@ declare const resourceServerInsertSchema: z.ZodObject<{
5642
5642
  }>;
5643
5643
  export type ResourceServerInsert = z.input<typeof resourceServerInsertSchema>;
5644
5644
  declare const resourceServerSchema: z.ZodObject<{
5645
+ created_at: z.ZodOptional<z.ZodString>;
5646
+ updated_at: z.ZodOptional<z.ZodString>;
5645
5647
  name: z.ZodString;
5646
5648
  identifier: z.ZodString;
5647
5649
  scopes: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -5735,6 +5737,8 @@ declare const resourceServerSchema: z.ZodObject<{
5735
5737
  bound_access_tokens?: boolean | undefined;
5736
5738
  }>>;
5737
5739
  }, z.ZodTypeAny, "passthrough"> | undefined;
5740
+ created_at?: string | undefined;
5741
+ updated_at?: string | undefined;
5738
5742
  id?: string | undefined;
5739
5743
  scopes?: {
5740
5744
  value: string;
@@ -5768,6 +5772,8 @@ declare const resourceServerSchema: z.ZodObject<{
5768
5772
  bound_access_tokens?: boolean | undefined;
5769
5773
  }>>;
5770
5774
  }, z.ZodTypeAny, "passthrough"> | undefined;
5775
+ created_at?: string | undefined;
5776
+ updated_at?: string | undefined;
5771
5777
  id?: string | undefined;
5772
5778
  scopes?: {
5773
5779
  value: string;
@@ -5800,6 +5806,8 @@ declare const permissionSchema: z.ZodObject<{
5800
5806
  source_name: z.ZodOptional<z.ZodString>;
5801
5807
  source_type: z.ZodOptional<z.ZodString>;
5802
5808
  }, z.ZodTypeAny, "passthrough">>, "many">>;
5809
+ created_at: z.ZodOptional<z.ZodString>;
5810
+ updated_at: z.ZodOptional<z.ZodString>;
5803
5811
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5804
5812
  permission_name: z.ZodString;
5805
5813
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -5818,6 +5826,8 @@ declare const permissionSchema: z.ZodObject<{
5818
5826
  source_name: z.ZodOptional<z.ZodString>;
5819
5827
  source_type: z.ZodOptional<z.ZodString>;
5820
5828
  }, z.ZodTypeAny, "passthrough">>, "many">>;
5829
+ created_at: z.ZodOptional<z.ZodString>;
5830
+ updated_at: z.ZodOptional<z.ZodString>;
5821
5831
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5822
5832
  permission_name: z.ZodString;
5823
5833
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -5836,58 +5846,42 @@ declare const permissionSchema: z.ZodObject<{
5836
5846
  source_name: z.ZodOptional<z.ZodString>;
5837
5847
  source_type: z.ZodOptional<z.ZodString>;
5838
5848
  }, z.ZodTypeAny, "passthrough">>, "many">>;
5849
+ created_at: z.ZodOptional<z.ZodString>;
5850
+ updated_at: z.ZodOptional<z.ZodString>;
5839
5851
  }, z.ZodTypeAny, "passthrough">>;
5840
5852
  export type Permission = z.infer<typeof permissionSchema>;
5841
5853
  export type PermissionInsert = z.input<typeof permissionSchema>;
5842
- declare const ruleInsertSchema: z.ZodObject<{
5854
+ declare const roleInsertSchema: z.ZodObject<{
5843
5855
  name: z.ZodString;
5844
- script: z.ZodString;
5845
- order: z.ZodOptional<z.ZodNumber>;
5846
- enabled: z.ZodOptional<z.ZodBoolean>;
5847
- stage: z.ZodOptional<z.ZodString>;
5856
+ description: z.ZodOptional<z.ZodString>;
5848
5857
  }, "strip", z.ZodTypeAny, {
5849
5858
  name: string;
5850
- script: string;
5851
- enabled?: boolean | undefined;
5852
- order?: number | undefined;
5853
- stage?: string | undefined;
5859
+ description?: string | undefined;
5854
5860
  }, {
5855
5861
  name: string;
5856
- script: string;
5857
- enabled?: boolean | undefined;
5858
- order?: number | undefined;
5859
- stage?: string | undefined;
5862
+ description?: string | undefined;
5860
5863
  }>;
5861
- export type RuleInsert = z.input<typeof ruleInsertSchema>;
5862
- declare const ruleSchema: z.ZodObject<{
5863
- name: z.ZodString;
5864
- script: z.ZodString;
5865
- order: z.ZodOptional<z.ZodNumber>;
5866
- enabled: z.ZodOptional<z.ZodBoolean>;
5867
- stage: z.ZodOptional<z.ZodString>;
5868
- id: z.ZodString;
5864
+ declare const roleSchema: z.ZodObject<{
5869
5865
  created_at: z.ZodOptional<z.ZodString>;
5870
5866
  updated_at: z.ZodOptional<z.ZodString>;
5871
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5872
5867
  name: z.ZodString;
5873
- script: z.ZodString;
5874
- order: z.ZodOptional<z.ZodNumber>;
5875
- enabled: z.ZodOptional<z.ZodBoolean>;
5876
- stage: z.ZodOptional<z.ZodString>;
5877
- id: z.ZodString;
5878
- created_at: z.ZodOptional<z.ZodString>;
5879
- updated_at: z.ZodOptional<z.ZodString>;
5880
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5881
- name: z.ZodString;
5882
- script: z.ZodString;
5883
- order: z.ZodOptional<z.ZodNumber>;
5884
- enabled: z.ZodOptional<z.ZodBoolean>;
5885
- stage: z.ZodOptional<z.ZodString>;
5868
+ description: z.ZodOptional<z.ZodString>;
5886
5869
  id: z.ZodString;
5887
- created_at: z.ZodOptional<z.ZodString>;
5888
- updated_at: z.ZodOptional<z.ZodString>;
5889
- }, z.ZodTypeAny, "passthrough">>;
5890
- export type Rule = z.infer<typeof ruleSchema>;
5870
+ }, "strip", z.ZodTypeAny, {
5871
+ name: string;
5872
+ id: string;
5873
+ description?: string | undefined;
5874
+ created_at?: string | undefined;
5875
+ updated_at?: string | undefined;
5876
+ }, {
5877
+ name: string;
5878
+ id: string;
5879
+ description?: string | undefined;
5880
+ created_at?: string | undefined;
5881
+ updated_at?: string | undefined;
5882
+ }>;
5883
+ export type Role = z.infer<typeof roleSchema>;
5884
+ export type RoleInsert = z.infer<typeof roleInsertSchema>;
5891
5885
  export interface ListCodesResponse extends Totals {
5892
5886
  codes: Code[];
5893
5887
  }
@@ -6050,16 +6044,6 @@ export interface ResourceServersAdapter {
6050
6044
  update(tenant_id: string, id: string, resourceServer: Partial<ResourceServerInsert>): Promise<boolean>;
6051
6045
  remove(tenant_id: string, id: string): Promise<boolean>;
6052
6046
  }
6053
- export interface ListRulesResponse extends Totals {
6054
- rules: Rule[];
6055
- }
6056
- export interface RulesAdapter {
6057
- create(tenant_id: string, rule: RuleInsert): Promise<Rule>;
6058
- get(tenant_id: string, rule_id: string): Promise<Rule | null>;
6059
- list(tenant_id: string, params?: ListParams): Promise<ListRulesResponse>;
6060
- update(tenant_id: string, rule_id: string, rule: Partial<RuleInsert>): Promise<boolean>;
6061
- remove(tenant_id: string, rule_id: string): Promise<boolean>;
6062
- }
6063
6047
  export interface ListPermissionsResponse extends Totals {
6064
6048
  permissions: Permission[];
6065
6049
  }
@@ -6070,6 +6054,20 @@ export interface PermissionsAdapter {
6070
6054
  update(tenant_id: string, permission_id: string, permission: Partial<PermissionInsert>): Promise<boolean>;
6071
6055
  remove(tenant_id: string, permission_id: string): Promise<boolean>;
6072
6056
  }
6057
+ export interface ListRolesResponse {
6058
+ roles: Role[];
6059
+ totals?: Totals;
6060
+ start: number;
6061
+ limit: number;
6062
+ length: number;
6063
+ }
6064
+ export interface RolesAdapter {
6065
+ create(tenantId: string, role: RoleInsert): Promise<Role>;
6066
+ get(tenantId: string, roleId: string): Promise<Role | null>;
6067
+ list(tenantId: string, params?: ListParams): Promise<ListRolesResponse>;
6068
+ update(tenantId: string, roleId: string, updates: Partial<Role>): Promise<boolean>;
6069
+ remove(tenantId: string, roleId: string): Promise<boolean>;
6070
+ }
6073
6071
  export interface DataAdapters {
6074
6072
  applications: ApplicationsAdapter;
6075
6073
  branding: BrandingAdapter;
@@ -6087,8 +6085,8 @@ export interface DataAdapters {
6087
6085
  promptSettings: PromptSettingsAdapter;
6088
6086
  refreshTokens: RefreshTokensAdapter;
6089
6087
  resourceServers: ResourceServersAdapter;
6090
- rules: RulesAdapter;
6091
6088
  permissions: PermissionsAdapter;
6089
+ roles: RolesAdapter;
6092
6090
  sessions: SessionsAdapter;
6093
6091
  tenants: TenantsDataAdapter;
6094
6092
  themes: ThemesAdapter;
@@ -6758,12 +6756,15 @@ declare const sqlFormSchema: z.ZodObject<{
6758
6756
  css?: string | undefined;
6759
6757
  } | undefined;
6760
6758
  }>;
6761
- declare const sqlResourceServerSchema: z.ZodObject<{
6759
+ declare const sqlResourceServerSchema: z.ZodObject<Omit<{
6762
6760
  tenant_id: z.ZodString;
6763
6761
  scopes: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6764
6762
  options: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6765
6763
  skip_consent_for_verifiable_first_party_clients: z.ZodOptional<z.ZodNumber>;
6766
6764
  allow_offline_access: z.ZodOptional<z.ZodNumber>;
6765
+ verification_key: z.ZodOptional<z.ZodString>;
6766
+ created_at: z.ZodString;
6767
+ updated_at: z.ZodString;
6767
6768
  name: z.ZodString;
6768
6769
  identifier: z.ZodString;
6769
6770
  signing_alg: z.ZodOptional<z.ZodString>;
@@ -6772,69 +6773,44 @@ declare const sqlResourceServerSchema: z.ZodObject<{
6772
6773
  token_lifetime_for_web: z.ZodOptional<z.ZodNumber>;
6773
6774
  verificationKey: z.ZodOptional<z.ZodString>;
6774
6775
  id: z.ZodOptional<z.ZodString>;
6775
- }, "strip", z.ZodTypeAny, {
6776
+ }, "verificationKey">, "strip", z.ZodTypeAny, {
6776
6777
  options: string;
6777
6778
  tenant_id: string;
6778
6779
  name: string;
6780
+ created_at: string;
6781
+ updated_at: string;
6779
6782
  scopes: string;
6780
6783
  identifier: string;
6781
6784
  id?: string | undefined;
6782
6785
  skip_consent_for_verifiable_first_party_clients?: number | undefined;
6783
6786
  allow_offline_access?: number | undefined;
6787
+ verification_key?: string | undefined;
6784
6788
  signing_alg?: string | undefined;
6785
6789
  signing_secret?: string | undefined;
6786
6790
  token_lifetime?: number | undefined;
6787
6791
  token_lifetime_for_web?: number | undefined;
6788
- verificationKey?: string | undefined;
6789
6792
  }, {
6790
6793
  tenant_id: string;
6791
6794
  name: string;
6795
+ created_at: string;
6796
+ updated_at: string;
6792
6797
  identifier: string;
6793
6798
  options?: string | undefined;
6794
6799
  id?: string | undefined;
6795
6800
  scopes?: string | undefined;
6796
6801
  skip_consent_for_verifiable_first_party_clients?: number | undefined;
6797
6802
  allow_offline_access?: number | undefined;
6803
+ verification_key?: string | undefined;
6798
6804
  signing_alg?: string | undefined;
6799
6805
  signing_secret?: string | undefined;
6800
6806
  token_lifetime?: number | undefined;
6801
6807
  token_lifetime_for_web?: number | undefined;
6802
- verificationKey?: string | undefined;
6803
- }>;
6804
- declare const sqlRuleSchema: z.ZodObject<{
6805
- tenant_id: z.ZodString;
6806
- enabled: z.ZodOptional<z.ZodNumber>;
6807
- name: z.ZodString;
6808
- script: z.ZodString;
6809
- order: z.ZodOptional<z.ZodNumber>;
6810
- stage: z.ZodOptional<z.ZodString>;
6811
- id: z.ZodString;
6812
- created_at: z.ZodOptional<z.ZodString>;
6813
- updated_at: z.ZodOptional<z.ZodString>;
6814
- }, "strip", z.ZodTypeAny, {
6815
- tenant_id: string;
6816
- id: string;
6817
- name: string;
6818
- script: string;
6819
- enabled?: number | undefined;
6820
- created_at?: string | undefined;
6821
- updated_at?: string | undefined;
6822
- order?: number | undefined;
6823
- stage?: string | undefined;
6824
- }, {
6825
- tenant_id: string;
6826
- id: string;
6827
- name: string;
6828
- script: string;
6829
- enabled?: number | undefined;
6830
- created_at?: string | undefined;
6831
- updated_at?: string | undefined;
6832
- order?: number | undefined;
6833
- stage?: string | undefined;
6834
6808
  }>;
6835
6809
  declare const sqlPermissionSchema: z.ZodObject<{
6836
6810
  tenant_id: z.ZodString;
6837
6811
  sources: z.ZodOptional<z.ZodString>;
6812
+ created_at: z.ZodString;
6813
+ updated_at: z.ZodString;
6838
6814
  permission_name: z.ZodString;
6839
6815
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6840
6816
  resource_server_identifier: z.ZodString;
@@ -6843,6 +6819,8 @@ declare const sqlPermissionSchema: z.ZodObject<{
6843
6819
  }, "strip", z.ZodTypeAny, {
6844
6820
  tenant_id: string;
6845
6821
  id: string;
6822
+ created_at: string;
6823
+ updated_at: string;
6846
6824
  permission_name: string;
6847
6825
  resource_server_identifier: string;
6848
6826
  resource_server_name: string;
@@ -6851,12 +6829,36 @@ declare const sqlPermissionSchema: z.ZodObject<{
6851
6829
  }, {
6852
6830
  tenant_id: string;
6853
6831
  id: string;
6832
+ created_at: string;
6833
+ updated_at: string;
6854
6834
  permission_name: string;
6855
6835
  resource_server_identifier: string;
6856
6836
  resource_server_name: string;
6857
6837
  description?: string | null | undefined;
6858
6838
  sources?: string | undefined;
6859
6839
  }>;
6840
+ declare const sqlRoleSchema: z.ZodObject<{
6841
+ tenant_id: z.ZodString;
6842
+ created_at: z.ZodString;
6843
+ updated_at: z.ZodString;
6844
+ name: z.ZodString;
6845
+ description: z.ZodOptional<z.ZodString>;
6846
+ id: z.ZodString;
6847
+ }, "strip", z.ZodTypeAny, {
6848
+ tenant_id: string;
6849
+ id: string;
6850
+ name: string;
6851
+ created_at: string;
6852
+ updated_at: string;
6853
+ description?: string | undefined;
6854
+ }, {
6855
+ tenant_id: string;
6856
+ id: string;
6857
+ name: string;
6858
+ created_at: string;
6859
+ updated_at: string;
6860
+ description?: string | undefined;
6861
+ }>;
6860
6862
  export interface Database {
6861
6863
  applications: z.infer<typeof sqlApplicationSchema>;
6862
6864
  branding: z.infer<typeof sqlBrandingSchema>;
@@ -6883,8 +6885,8 @@ export interface Database {
6883
6885
  tenants: Tenant;
6884
6886
  themes: z.infer<typeof sqlThemeSchema>;
6885
6887
  resource_servers: z.infer<typeof sqlResourceServerSchema>;
6886
- rules: z.infer<typeof sqlRuleSchema>;
6887
6888
  permissions: z.infer<typeof sqlPermissionSchema>;
6889
+ roles: z.infer<typeof sqlRoleSchema>;
6888
6890
  }
6889
6891
  export declare function migrateToLatest(db: Kysely<Database>, debug?: boolean): Promise<void>;
6890
6892
  export declare function migrateDown(db: Kysely<Database>): Promise<void>;