@constructive-io/react 1.21.47 → 1.21.49

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 (109) hide show
  1. package/admin/schema-types.d.ts +4 -0
  2. package/agent/schema-types.d.ts +4 -0
  3. package/api/orm/input-types.d.ts +663 -69
  4. package/api/orm/input-types.js +22 -0
  5. package/api/schema-types.d.ts +199 -44
  6. package/auth/schema-types.d.ts +4 -0
  7. package/compute/schema-types.d.ts +4 -0
  8. package/config/schema-types.d.ts +4 -0
  9. package/esm/admin/schema-types.d.ts +4 -0
  10. package/esm/agent/schema-types.d.ts +4 -0
  11. package/esm/api/orm/input-types.d.ts +663 -69
  12. package/esm/api/orm/input-types.js +22 -0
  13. package/esm/api/schema-types.d.ts +199 -44
  14. package/esm/auth/schema-types.d.ts +4 -0
  15. package/esm/compute/schema-types.d.ts +4 -0
  16. package/esm/config/schema-types.d.ts +4 -0
  17. package/esm/infra/schema-types.d.ts +4 -0
  18. package/esm/modules/hooks/index.d.ts +1 -1
  19. package/esm/modules/hooks/index.js +1 -1
  20. package/esm/modules/hooks/invalidation.d.ts +6 -0
  21. package/esm/modules/hooks/invalidation.js +17 -1
  22. package/esm/modules/hooks/mutation-keys.d.ts +12 -0
  23. package/esm/modules/hooks/mutation-keys.js +7 -0
  24. package/esm/modules/hooks/mutations/index.d.ts +3 -0
  25. package/esm/modules/hooks/mutations/index.js +3 -0
  26. package/esm/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.d.ts +2 -2
  27. package/esm/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.js +1 -1
  28. package/esm/modules/hooks/mutations/useCreatePrincipalsModuleMutation.d.ts +34 -0
  29. package/esm/modules/hooks/mutations/useCreatePrincipalsModuleMutation.js +31 -0
  30. package/esm/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.d.ts +2 -2
  31. package/esm/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.js +1 -1
  32. package/esm/modules/hooks/mutations/useDeletePrincipalsModuleMutation.d.ts +38 -0
  33. package/esm/modules/hooks/mutations/useDeletePrincipalsModuleMutation.js +36 -0
  34. package/esm/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.d.ts +2 -2
  35. package/esm/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.js +1 -1
  36. package/esm/modules/hooks/mutations/useUpdatePrincipalsModuleMutation.d.ts +40 -0
  37. package/esm/modules/hooks/mutations/useUpdatePrincipalsModuleMutation.js +37 -0
  38. package/esm/modules/hooks/queries/index.d.ts +2 -0
  39. package/esm/modules/hooks/queries/index.js +2 -0
  40. package/esm/modules/hooks/queries/usePrincipalAuthModuleQuery.d.ts +4 -4
  41. package/esm/modules/hooks/queries/usePrincipalAuthModuleQuery.js +1 -1
  42. package/esm/modules/hooks/queries/usePrincipalAuthModulesQuery.d.ts +4 -4
  43. package/esm/modules/hooks/queries/usePrincipalAuthModulesQuery.js +1 -1
  44. package/esm/modules/hooks/queries/usePrincipalsModuleQuery.d.ts +65 -0
  45. package/esm/modules/hooks/queries/usePrincipalsModuleQuery.js +47 -0
  46. package/esm/modules/hooks/queries/usePrincipalsModulesQuery.d.ts +69 -0
  47. package/esm/modules/hooks/queries/usePrincipalsModulesQuery.js +32 -0
  48. package/esm/modules/hooks/query-keys.d.ts +14 -0
  49. package/esm/modules/hooks/query-keys.js +8 -0
  50. package/esm/modules/orm/index.d.ts +2 -0
  51. package/esm/modules/orm/index.js +2 -0
  52. package/esm/modules/orm/input-types.d.ts +190 -1
  53. package/esm/modules/orm/models/index.d.ts +1 -0
  54. package/esm/modules/orm/models/index.js +1 -0
  55. package/esm/modules/orm/models/principalsModule.d.ts +54 -0
  56. package/esm/modules/orm/models/principalsModule.js +100 -0
  57. package/esm/modules/schema-types.d.ts +124 -1
  58. package/esm/modules/types.d.ts +16 -0
  59. package/esm/objects/schema-types.d.ts +4 -0
  60. package/esm/remote/schema-types.d.ts +4 -0
  61. package/esm/storage/schema-types.d.ts +4 -0
  62. package/esm/usage/schema-types.d.ts +4 -0
  63. package/infra/schema-types.d.ts +4 -0
  64. package/modules/hooks/index.d.ts +1 -1
  65. package/modules/hooks/index.js +1 -1
  66. package/modules/hooks/invalidation.d.ts +6 -0
  67. package/modules/hooks/invalidation.js +16 -0
  68. package/modules/hooks/mutation-keys.d.ts +12 -0
  69. package/modules/hooks/mutation-keys.js +8 -1
  70. package/modules/hooks/mutations/index.d.ts +3 -0
  71. package/modules/hooks/mutations/index.js +3 -0
  72. package/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.d.ts +2 -2
  73. package/modules/hooks/mutations/useCreatePrincipalAuthModuleMutation.js +1 -1
  74. package/modules/hooks/mutations/useCreatePrincipalsModuleMutation.d.ts +34 -0
  75. package/modules/hooks/mutations/useCreatePrincipalsModuleMutation.js +34 -0
  76. package/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.d.ts +2 -2
  77. package/modules/hooks/mutations/useDeletePrincipalAuthModuleMutation.js +1 -1
  78. package/modules/hooks/mutations/useDeletePrincipalsModuleMutation.d.ts +38 -0
  79. package/modules/hooks/mutations/useDeletePrincipalsModuleMutation.js +39 -0
  80. package/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.d.ts +2 -2
  81. package/modules/hooks/mutations/useUpdatePrincipalAuthModuleMutation.js +1 -1
  82. package/modules/hooks/mutations/useUpdatePrincipalsModuleMutation.d.ts +40 -0
  83. package/modules/hooks/mutations/useUpdatePrincipalsModuleMutation.js +40 -0
  84. package/modules/hooks/queries/index.d.ts +2 -0
  85. package/modules/hooks/queries/index.js +2 -0
  86. package/modules/hooks/queries/usePrincipalAuthModuleQuery.d.ts +4 -4
  87. package/modules/hooks/queries/usePrincipalAuthModuleQuery.js +1 -1
  88. package/modules/hooks/queries/usePrincipalAuthModulesQuery.d.ts +4 -4
  89. package/modules/hooks/queries/usePrincipalAuthModulesQuery.js +1 -1
  90. package/modules/hooks/queries/usePrincipalsModuleQuery.d.ts +65 -0
  91. package/modules/hooks/queries/usePrincipalsModuleQuery.js +53 -0
  92. package/modules/hooks/queries/usePrincipalsModulesQuery.d.ts +69 -0
  93. package/modules/hooks/queries/usePrincipalsModulesQuery.js +38 -0
  94. package/modules/hooks/query-keys.d.ts +14 -0
  95. package/modules/hooks/query-keys.js +9 -1
  96. package/modules/orm/index.d.ts +2 -0
  97. package/modules/orm/index.js +2 -0
  98. package/modules/orm/input-types.d.ts +190 -1
  99. package/modules/orm/models/index.d.ts +1 -0
  100. package/modules/orm/models/index.js +3 -1
  101. package/modules/orm/models/principalsModule.d.ts +54 -0
  102. package/modules/orm/models/principalsModule.js +104 -0
  103. package/modules/schema-types.d.ts +124 -1
  104. package/modules/types.d.ts +16 -0
  105. package/objects/schema-types.d.ts +4 -0
  106. package/package.json +5 -5
  107. package/remote/schema-types.d.ts +4 -0
  108. package/storage/schema-types.d.ts +4 -0
  109. package/usage/schema-types.d.ts +4 -0
@@ -369,6 +369,12 @@ export declare const principalAuthModuleMutationKeys: {
369
369
  /** Update principalAuthModule mutation key */ readonly update: (id: string | number) => readonly ["mutation", "principalauthmodule", "update", string | number];
370
370
  /** Delete principalAuthModule mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "principalauthmodule", "delete", string | number];
371
371
  };
372
+ export declare const principalsModuleMutationKeys: {
373
+ /** All principalsModule mutation keys */ readonly all: readonly ["mutation", "principalsmodule"];
374
+ /** Create principalsModule mutation key */ readonly create: () => readonly ["mutation", "principalsmodule", "create"];
375
+ /** Update principalsModule mutation key */ readonly update: (id: string | number) => readonly ["mutation", "principalsmodule", "update", string | number];
376
+ /** Delete principalsModule mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "principalsmodule", "delete", string | number];
377
+ };
372
378
  export declare const profilesModuleMutationKeys: {
373
379
  /** All profilesModule mutation keys */ readonly all: readonly ["mutation", "profilesmodule"];
374
380
  /** Create profilesModule mutation key */ readonly create: () => readonly ["mutation", "profilesmodule", "create"];
@@ -925,6 +931,12 @@ export declare const mutationKeys: {
925
931
  /** Update principalAuthModule mutation key */ readonly update: (id: string | number) => readonly ["mutation", "principalauthmodule", "update", string | number];
926
932
  /** Delete principalAuthModule mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "principalauthmodule", "delete", string | number];
927
933
  };
934
+ readonly principalsModule: {
935
+ /** All principalsModule mutation keys */ readonly all: readonly ["mutation", "principalsmodule"];
936
+ /** Create principalsModule mutation key */ readonly create: () => readonly ["mutation", "principalsmodule", "create"];
937
+ /** Update principalsModule mutation key */ readonly update: (id: string | number) => readonly ["mutation", "principalsmodule", "update", string | number];
938
+ /** Delete principalsModule mutation key */ readonly delete: (id: string | number) => readonly ["mutation", "principalsmodule", "delete", string | number];
939
+ };
928
940
  readonly profilesModule: {
929
941
  /** All profilesModule mutation keys */ readonly all: readonly ["mutation", "profilesmodule"];
930
942
  /** Create profilesModule mutation key */ readonly create: () => readonly ["mutation", "profilesmodule", "create"];
@@ -423,6 +423,12 @@ export const principalAuthModuleMutationKeys = {
423
423
  /** Update principalAuthModule mutation key */ update: (id) => ['mutation', 'principalauthmodule', 'update', id],
424
424
  /** Delete principalAuthModule mutation key */ delete: (id) => ['mutation', 'principalauthmodule', 'delete', id],
425
425
  };
426
+ export const principalsModuleMutationKeys = {
427
+ /** All principalsModule mutation keys */ all: ['mutation', 'principalsmodule'],
428
+ /** Create principalsModule mutation key */ create: () => ['mutation', 'principalsmodule', 'create'],
429
+ /** Update principalsModule mutation key */ update: (id) => ['mutation', 'principalsmodule', 'update', id],
430
+ /** Delete principalsModule mutation key */ delete: (id) => ['mutation', 'principalsmodule', 'delete', id],
431
+ };
426
432
  export const profilesModuleMutationKeys = {
427
433
  /** All profilesModule mutation keys */ all: ['mutation', 'profilesmodule'],
428
434
  /** Create profilesModule mutation key */ create: () => ['mutation', 'profilesmodule', 'create'],
@@ -695,6 +701,7 @@ export const mutationKeys = {
695
701
  phoneNumbersModule: phoneNumbersModuleMutationKeys,
696
702
  plansModule: plansModuleMutationKeys,
697
703
  principalAuthModule: principalAuthModuleMutationKeys,
704
+ principalsModule: principalsModuleMutationKeys,
698
705
  profilesModule: profilesModuleMutationKeys,
699
706
  rateLimitMetersModule: rateLimitMetersModuleMutationKeys,
700
707
  rateLimitsModule: rateLimitsModuleMutationKeys,
@@ -186,6 +186,9 @@ export * from './useDeletePlansModuleMutation';
186
186
  export * from './useCreatePrincipalAuthModuleMutation';
187
187
  export * from './useUpdatePrincipalAuthModuleMutation';
188
188
  export * from './useDeletePrincipalAuthModuleMutation';
189
+ export * from './useCreatePrincipalsModuleMutation';
190
+ export * from './useUpdatePrincipalsModuleMutation';
191
+ export * from './useDeletePrincipalsModuleMutation';
189
192
  export * from './useCreateProfilesModuleMutation';
190
193
  export * from './useUpdateProfilesModuleMutation';
191
194
  export * from './useDeleteProfilesModuleMutation';
@@ -186,6 +186,9 @@ export * from './useDeletePlansModuleMutation';
186
186
  export * from './useCreatePrincipalAuthModuleMutation';
187
187
  export * from './useUpdatePrincipalAuthModuleMutation';
188
188
  export * from './useDeletePrincipalAuthModuleMutation';
189
+ export * from './useCreatePrincipalsModuleMutation';
190
+ export * from './useUpdatePrincipalsModuleMutation';
191
+ export * from './useDeletePrincipalsModuleMutation';
189
192
  export * from './useCreateProfilesModuleMutation';
190
193
  export * from './useUpdateProfilesModuleMutation';
191
194
  export * from './useDeleteProfilesModuleMutation';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -8,7 +8,7 @@ import type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations, Creat
8
8
  import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
9
  export type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations, CreatePrincipalAuthModuleInput, } from '../../orm/input-types';
10
10
  /**
11
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
11
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
12
12
  *
13
13
  * @example
14
14
  * ```tsx
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
7
+ import type { PrincipalsModuleSelect, PrincipalsModuleWithRelations, CreatePrincipalsModuleInput } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { PrincipalsModuleSelect, PrincipalsModuleWithRelations, CreatePrincipalsModuleInput, } from '../../orm/input-types';
10
+ /**
11
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { mutate, isPending } = useCreatePrincipalsModuleMutation({
16
+ * selection: { fields: { id: true, name: true } },
17
+ * });
18
+ *
19
+ * mutate({ name: 'New item' });
20
+ * ```
21
+ */
22
+ export declare function useCreatePrincipalsModuleMutation<S extends PrincipalsModuleSelect>(params: {
23
+ selection: {
24
+ fields: S & PrincipalsModuleSelect;
25
+ } & HookStrictSelect<NoInfer<S>, PrincipalsModuleSelect>;
26
+ } & Omit<UseMutationOptions<{
27
+ createPrincipalsModule: {
28
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S>;
29
+ };
30
+ }, Error, CreatePrincipalsModuleInput['principalsModule']>, 'mutationFn'>): UseMutationResult<{
31
+ createPrincipalsModule: {
32
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S>;
33
+ };
34
+ }, Error, CreatePrincipalsModuleInput['principalsModule']>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildSelectionArgs } from '../selection';
9
+ import { principalsModuleKeys } from '../query-keys';
10
+ import { principalsModuleMutationKeys } from '../mutation-keys';
11
+ export function useCreatePrincipalsModuleMutation(params) {
12
+ const args = buildSelectionArgs(params.selection);
13
+ const { selection: _selection, ...mutationOptions } = params ?? {};
14
+ void _selection;
15
+ const queryClient = useQueryClient();
16
+ return useMutation({
17
+ mutationKey: principalsModuleMutationKeys.create(),
18
+ mutationFn: (data) => getClient()
19
+ .principalsModule.create({
20
+ data,
21
+ select: args.select,
22
+ })
23
+ .unwrap(),
24
+ onSuccess: () => {
25
+ queryClient.invalidateQueries({
26
+ queryKey: principalsModuleKeys.lists(),
27
+ });
28
+ },
29
+ ...mutationOptions,
30
+ });
31
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -8,7 +8,7 @@ import type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations } from
8
8
  import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
9
  export type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations, } from '../../orm/input-types';
10
10
  /**
11
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
11
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
12
12
  *
13
13
  * @example
14
14
  * ```tsx
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
7
+ import type { PrincipalsModuleSelect, PrincipalsModuleWithRelations } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { PrincipalsModuleSelect, PrincipalsModuleWithRelations } from '../../orm/input-types';
10
+ /**
11
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { mutate, isPending } = useDeletePrincipalsModuleMutation({
16
+ * selection: { fields: { id: true } },
17
+ * });
18
+ *
19
+ * mutate({ id: 'value-to-delete' });
20
+ * ```
21
+ */
22
+ export declare function useDeletePrincipalsModuleMutation<S extends PrincipalsModuleSelect>(params: {
23
+ selection: {
24
+ fields: S & PrincipalsModuleSelect;
25
+ } & HookStrictSelect<NoInfer<S>, PrincipalsModuleSelect>;
26
+ } & Omit<UseMutationOptions<{
27
+ deletePrincipalsModule: {
28
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S>;
29
+ };
30
+ }, Error, {
31
+ id: string;
32
+ }>, 'mutationFn'>): UseMutationResult<{
33
+ deletePrincipalsModule: {
34
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S>;
35
+ };
36
+ }, Error, {
37
+ id: string;
38
+ }>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildSelectionArgs } from '../selection';
9
+ import { principalsModuleKeys } from '../query-keys';
10
+ import { principalsModuleMutationKeys } from '../mutation-keys';
11
+ export function useDeletePrincipalsModuleMutation(params) {
12
+ const args = buildSelectionArgs(params.selection);
13
+ const { selection: _selection, ...mutationOptions } = params ?? {};
14
+ void _selection;
15
+ const queryClient = useQueryClient();
16
+ return useMutation({
17
+ mutationKey: principalsModuleMutationKeys.all,
18
+ mutationFn: ({ id }) => getClient()
19
+ .principalsModule.delete({
20
+ where: {
21
+ id,
22
+ },
23
+ select: args.select,
24
+ })
25
+ .unwrap(),
26
+ onSuccess: (_, variables) => {
27
+ queryClient.removeQueries({
28
+ queryKey: principalsModuleKeys.detail(variables.id),
29
+ });
30
+ queryClient.invalidateQueries({
31
+ queryKey: principalsModuleKeys.lists(),
32
+ });
33
+ },
34
+ ...mutationOptions,
35
+ });
36
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -8,7 +8,7 @@ import type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations, Princ
8
8
  import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
9
  export type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations, PrincipalAuthModulePatch, } from '../../orm/input-types';
10
10
  /**
11
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
11
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
12
12
  *
13
13
  * @example
14
14
  * ```tsx
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
7
+ import type { PrincipalsModuleSelect, PrincipalsModuleWithRelations, PrincipalsModulePatch } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { PrincipalsModuleSelect, PrincipalsModuleWithRelations, PrincipalsModulePatch, } from '../../orm/input-types';
10
+ /**
11
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { mutate, isPending } = useUpdatePrincipalsModuleMutation({
16
+ * selection: { fields: { id: true, name: true } },
17
+ * });
18
+ *
19
+ * mutate({ id: 'value-here', principalsModulePatch: { name: 'Updated' } });
20
+ * ```
21
+ */
22
+ export declare function useUpdatePrincipalsModuleMutation<S extends PrincipalsModuleSelect>(params: {
23
+ selection: {
24
+ fields: S & PrincipalsModuleSelect;
25
+ } & HookStrictSelect<NoInfer<S>, PrincipalsModuleSelect>;
26
+ } & Omit<UseMutationOptions<{
27
+ updatePrincipalsModule: {
28
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S>;
29
+ };
30
+ }, Error, {
31
+ id: string;
32
+ principalsModulePatch: PrincipalsModulePatch;
33
+ }>, 'mutationFn'>): UseMutationResult<{
34
+ updatePrincipalsModule: {
35
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S>;
36
+ };
37
+ }, Error, {
38
+ id: string;
39
+ principalsModulePatch: PrincipalsModulePatch;
40
+ }>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
7
+ import { getClient } from '../client';
8
+ import { buildSelectionArgs } from '../selection';
9
+ import { principalsModuleKeys } from '../query-keys';
10
+ import { principalsModuleMutationKeys } from '../mutation-keys';
11
+ export function useUpdatePrincipalsModuleMutation(params) {
12
+ const args = buildSelectionArgs(params.selection);
13
+ const { selection: _selection, ...mutationOptions } = params ?? {};
14
+ void _selection;
15
+ const queryClient = useQueryClient();
16
+ return useMutation({
17
+ mutationKey: principalsModuleMutationKeys.all,
18
+ mutationFn: ({ id, principalsModulePatch, }) => getClient()
19
+ .principalsModule.update({
20
+ where: {
21
+ id,
22
+ },
23
+ data: principalsModulePatch,
24
+ select: args.select,
25
+ })
26
+ .unwrap(),
27
+ onSuccess: (_, variables) => {
28
+ queryClient.invalidateQueries({
29
+ queryKey: principalsModuleKeys.detail(variables.id),
30
+ });
31
+ queryClient.invalidateQueries({
32
+ queryKey: principalsModuleKeys.lists(),
33
+ });
34
+ },
35
+ ...mutationOptions,
36
+ });
37
+ }
@@ -125,6 +125,8 @@ export * from './usePlansModulesQuery';
125
125
  export * from './usePlansModuleQuery';
126
126
  export * from './usePrincipalAuthModulesQuery';
127
127
  export * from './usePrincipalAuthModuleQuery';
128
+ export * from './usePrincipalsModulesQuery';
129
+ export * from './usePrincipalsModuleQuery';
128
130
  export * from './useProfilesModulesQuery';
129
131
  export * from './useProfilesModuleQuery';
130
132
  export * from './useRateLimitMetersModulesQuery';
@@ -125,6 +125,8 @@ export * from './usePlansModulesQuery';
125
125
  export * from './usePlansModuleQuery';
126
126
  export * from './usePrincipalAuthModulesQuery';
127
127
  export * from './usePrincipalAuthModuleQuery';
128
+ export * from './usePrincipalsModulesQuery';
129
+ export * from './usePrincipalsModuleQuery';
128
130
  export * from './useProfilesModulesQuery';
129
131
  export * from './useProfilesModuleQuery';
130
132
  export * from './useRateLimitMetersModulesQuery';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -10,7 +10,7 @@ export type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations, } fro
10
10
  /** Query key factory - re-exported from query-keys.ts */
11
11
  export declare const principalAuthModuleQueryKey: (id: string | number) => readonly ["principalauthmodule", "detail", string | number];
12
12
  /**
13
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
13
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
14
14
  *
15
15
  * @example
16
16
  * ```tsx
@@ -31,7 +31,7 @@ export declare function usePrincipalAuthModuleQuery<S extends PrincipalAuthModul
31
31
  principalAuthModule: InferSelectResult<PrincipalAuthModuleWithRelations, S> | null;
32
32
  }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
33
33
  /**
34
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
34
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
35
35
  *
36
36
  * @example
37
37
  * ```ts
@@ -50,7 +50,7 @@ export declare function fetchPrincipalAuthModuleQuery<S extends PrincipalAuthMod
50
50
  principalAuthModule: InferSelectResult<PrincipalAuthModuleWithRelations, S> | null;
51
51
  }>;
52
52
  /**
53
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
53
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
54
54
  *
55
55
  * @example
56
56
  * ```ts
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -11,7 +11,7 @@ export type { PrincipalAuthModuleSelect, PrincipalAuthModuleWithRelations, Princ
11
11
  /** Query key factory - re-exported from query-keys.ts */
12
12
  export declare const principalAuthModulesQueryKey: (variables?: object) => readonly ["principalauthmodule", "list", object];
13
13
  /**
14
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
14
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
15
15
  *
16
16
  * @example
17
17
  * ```tsx
@@ -35,7 +35,7 @@ export declare function usePrincipalAuthModulesQuery<S extends PrincipalAuthModu
35
35
  principalAuthModules: ConnectionResult<InferSelectResult<PrincipalAuthModuleWithRelations, S>>;
36
36
  }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
37
37
  /**
38
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
38
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
39
39
  *
40
40
  * @example
41
41
  * ```ts
@@ -55,7 +55,7 @@ export declare function fetchPrincipalAuthModulesQuery<S extends PrincipalAuthMo
55
55
  principalAuthModules: ConnectionResult<InferSelectResult<PrincipalAuthModuleWithRelations, S>>;
56
56
  }>;
57
57
  /**
58
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
58
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
59
59
  *
60
60
  * @example
61
61
  * ```ts
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.
2
+ * Provisions credentials for principals on top of principals_module: API keys, child sessions, delegation and token exchange, and org API key management. Requires the built-in auth stack (sessions_module, user_auth_module); installing it provisions principals_module first when the database does not have it. Org API key functions are only generated when an org-scoped memberships_module exists for the database.
3
3
  * @generated by @constructive-io/graphql-codegen
4
4
  * DO NOT EDIT - changes will be overwritten
5
5
  */
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
3
+ * @generated by @constructive-io/graphql-codegen
4
+ * DO NOT EDIT - changes will be overwritten
5
+ */
6
+ import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
7
+ import type { PrincipalsModuleSelect, PrincipalsModuleWithRelations } from '../../orm/input-types';
8
+ import type { InferSelectResult, HookStrictSelect } from '../../orm/select-types';
9
+ export type { PrincipalsModuleSelect, PrincipalsModuleWithRelations } from '../../orm/input-types';
10
+ /** Query key factory - re-exported from query-keys.ts */
11
+ export declare const principalsModuleQueryKey: (id: string | number) => readonly ["principalsmodule", "detail", string | number];
12
+ /**
13
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * const { data, isLoading } = usePrincipalsModuleQuery({
18
+ * id: 'some-id',
19
+ * selection: { fields: { id: true, name: true } },
20
+ * });
21
+ * ```
22
+ */
23
+ export declare function usePrincipalsModuleQuery<S extends PrincipalsModuleSelect, TData = {
24
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S> | null;
25
+ }>(params: {
26
+ id: string;
27
+ selection: {
28
+ fields: S;
29
+ } & HookStrictSelect<NoInfer<S>, PrincipalsModuleSelect>;
30
+ } & Omit<UseQueryOptions<{
31
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S> | null;
32
+ }, Error, TData>, 'queryKey' | 'queryFn'>): UseQueryResult<TData>;
33
+ /**
34
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const data = await fetchPrincipalsModuleQuery({
39
+ * id: 'some-id',
40
+ * selection: { fields: { id: true } },
41
+ * });
42
+ * ```
43
+ */
44
+ export declare function fetchPrincipalsModuleQuery<S extends PrincipalsModuleSelect>(params: {
45
+ id: string;
46
+ selection: {
47
+ fields: S;
48
+ } & HookStrictSelect<NoInfer<S>, PrincipalsModuleSelect>;
49
+ }): Promise<{
50
+ principalsModule: InferSelectResult<PrincipalsModuleWithRelations, S> | null;
51
+ }>;
52
+ /**
53
+ * Provisions principals as authorization data, with no dependency on sessions or sign-in: the principals, principal_entities and principal_scope_overrides tables, the create/update/delete and scope mutations, the SPRT derivation that keeps a principal's capabilities in step with its owner, and the expiry sweep. The caller that opens the transaction sets jwt.claims.principal_id to a principal's user_id. Credentials for principals (API keys, child sessions, token exchange) are principal_auth_module, which builds on this one.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * await prefetchPrincipalsModuleQuery(queryClient, { id: 'some-id', selection: { fields: { id: true } } });
58
+ * ```
59
+ */
60
+ export declare function prefetchPrincipalsModuleQuery<S extends PrincipalsModuleSelect>(queryClient: QueryClient, params: {
61
+ id: string;
62
+ selection: {
63
+ fields: S;
64
+ } & HookStrictSelect<NoInfer<S>, PrincipalsModuleSelect>;
65
+ }): Promise<void>;