@databricks/appkit-ui 0.95.0 → 0.97.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 (61) hide show
  1. package/CLAUDE.md +16 -7
  2. package/dist/cli/commands/generate-types.js +36 -7
  3. package/dist/cli/commands/generate-types.js.map +1 -1
  4. package/dist/cli/commands/spawn-lock.js +18 -5
  5. package/dist/cli/commands/spawn-lock.js.map +1 -1
  6. package/dist/js/database/client.d.ts +2 -2
  7. package/dist/js/database/client.js +1 -1
  8. package/dist/js/database/client.js.map +1 -1
  9. package/dist/react/beta.d.ts +2 -2
  10. package/dist/react/beta.js +1 -2
  11. package/dist/react/hooks/use-database-list.d.ts +4 -4
  12. package/dist/react/hooks/use-database-list.d.ts.map +1 -1
  13. package/dist/react/hooks/use-database-list.js +1 -2
  14. package/dist/react/hooks/use-database-list.js.map +1 -1
  15. package/dist/react/hooks/use-database-read.d.ts +4 -41
  16. package/dist/react/hooks/use-database-read.d.ts.map +1 -1
  17. package/dist/react/hooks/use-database-read.js +7 -68
  18. package/dist/react/hooks/use-database-read.js.map +1 -1
  19. package/dist/react/hooks/use-database-record.d.ts +3 -3
  20. package/dist/react/hooks/use-database-record.d.ts.map +1 -1
  21. package/dist/react/hooks/use-database-record.js +2 -3
  22. package/dist/react/hooks/use-database-record.js.map +1 -1
  23. package/dist/react/hooks/use-database-write.d.ts +3 -3
  24. package/dist/react/hooks/use-database-write.js.map +1 -1
  25. package/dist/react/ui/button.d.ts +1 -1
  26. package/dist/shared/src/database/api-types.d.ts +1 -4
  27. package/dist/shared/src/database/api-types.d.ts.map +1 -1
  28. package/dist/shared/src/database/index.d.ts +3 -0
  29. package/dist/shared/src/database/operations.d.ts +11 -0
  30. package/dist/shared/src/database/operations.d.ts.map +1 -0
  31. package/dist/shared/src/index.d.ts +1 -0
  32. package/docs/api/appkit/Class.DatabaseValidationError.md +1 -1
  33. package/docs/api/appkit/Function.defineOperation.md +61 -0
  34. package/docs/api/appkit/Function.definePolicy.md +52 -0
  35. package/docs/api/appkit/Function.defineSchema.md +1 -1
  36. package/docs/api/appkit/Interface.Actor.md +21 -0
  37. package/docs/api/appkit/Interface.DatabaseOperationContract.md +30 -0
  38. package/docs/api/appkit/Interface.DatabaseRoutes.md +30 -0
  39. package/docs/api/appkit/Interface.OperationContext.md +75 -0
  40. package/docs/api/appkit/Interface.OperationDefinition.md +77 -0
  41. package/docs/api/appkit/Interface.PolicyContext.md +49 -0
  42. package/docs/api/appkit/Interface.PolicyDenial.md +21 -0
  43. package/docs/api/appkit/TypeAlias.DatabricksAppKitDatabaseOperations.md +8 -0
  44. package/docs/api/appkit/TypeAlias.IDatabaseConfig.md +0 -10
  45. package/docs/api/appkit/TypeAlias.OperationMethod.md +8 -0
  46. package/docs/api/appkit/TypeAlias.OperationWireInput.md +14 -0
  47. package/docs/api/appkit/TypeAlias.OperationWireOutput.md +14 -0
  48. package/docs/api/appkit/TypeAlias.Policy.md +15 -0
  49. package/docs/api/appkit/TypeAlias.PolicyDecision.md +8 -0
  50. package/docs/api/appkit.md +60 -51
  51. package/docs/development/type-generation.md +20 -1
  52. package/docs/plugins/database.md +17 -70
  53. package/llms.txt +16 -7
  54. package/package.json +1 -1
  55. package/sbom.cdx.json +1 -1
  56. package/docs/api/appkit/Interface.EntityMutationHooks.md +0 -173
  57. package/docs/api/appkit/Interface.HookApp.md +0 -12
  58. package/docs/api/appkit/Interface.HookContext.md +0 -21
  59. package/docs/api/appkit/Interface.ReadSerializerContext.md +0 -21
  60. package/docs/api/appkit/TypeAlias.EntityHooks.md +0 -25
  61. package/docs/api/appkit/TypeAlias.ReadSerializer.md +0 -19
@@ -0,0 +1,30 @@
1
+ # Interface: DatabaseRoutes
2
+
3
+ The generated route entry. `schema` and each module stay lazy, so importing the registry evaluates neither the schema nor an operation.
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### modules[​](#modules "Direct link to modules")
8
+
9
+ ```ts
10
+ readonly modules: readonly {
11
+ file: string;
12
+ load: () => Promise<Record<string, unknown>>;
13
+ }[];
14
+
15
+ ```
16
+
17
+ ***
18
+
19
+ ### schema()[​](#schema "Direct link to schema()")
20
+
21
+ ```ts
22
+ readonly schema: () => Promise<{
23
+ schema: Schema;
24
+ }>;
25
+
26
+ ```
27
+
28
+ #### Returns[​](#returns "Direct link to Returns")
29
+
30
+ `Promise`<{ `schema`: [`Schema`](./docs/api/appkit/Interface.Schema.md); }>
@@ -0,0 +1,75 @@
1
+ # Interface: OperationContext\<In, R>
2
+
3
+ What `allow` and `execute` receive: the policy context and the loaded resource.
4
+
5
+ ## Extends[​](#extends "Direct link to Extends")
6
+
7
+ * [`PolicyContext`](./docs/api/appkit/Interface.PolicyContext.md)<`In`>
8
+
9
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
10
+
11
+ | Type Parameter | Default type |
12
+ | -------------- | ------------ |
13
+ | `In` | `unknown` |
14
+ | `R` | `undefined` |
15
+
16
+ ## Properties[​](#properties "Direct link to Properties")
17
+
18
+ ### actor[​](#actor "Direct link to actor")
19
+
20
+ ```ts
21
+ readonly actor: Actor;
22
+
23
+ ```
24
+
25
+ #### Inherited from[​](#inherited-from "Direct link to Inherited from")
26
+
27
+ [`PolicyContext`](./docs/api/appkit/Interface.PolicyContext.md).[`actor`](./docs/api/appkit/Interface.PolicyContext.md#actor)
28
+
29
+ ***
30
+
31
+ ### appkit[​](#appkit "Direct link to appkit")
32
+
33
+ ```ts
34
+ readonly appkit: OperationAppKit;
35
+
36
+ ```
37
+
38
+ #### Inherited from[​](#inherited-from-1 "Direct link to Inherited from")
39
+
40
+ [`PolicyContext`](./docs/api/appkit/Interface.PolicyContext.md).[`appkit`](./docs/api/appkit/Interface.PolicyContext.md#appkit)
41
+
42
+ ***
43
+
44
+ ### db[​](#db "Direct link to db")
45
+
46
+ ```ts
47
+ readonly db: DatabaseExports;
48
+
49
+ ```
50
+
51
+ #### Inherited from[​](#inherited-from-2 "Direct link to Inherited from")
52
+
53
+ [`PolicyContext`](./docs/api/appkit/Interface.PolicyContext.md).[`db`](./docs/api/appkit/Interface.PolicyContext.md#db)
54
+
55
+ ***
56
+
57
+ ### input[​](#input "Direct link to input")
58
+
59
+ ```ts
60
+ readonly input: In;
61
+
62
+ ```
63
+
64
+ #### Inherited from[​](#inherited-from-3 "Direct link to Inherited from")
65
+
66
+ [`PolicyContext`](./docs/api/appkit/Interface.PolicyContext.md).[`input`](./docs/api/appkit/Interface.PolicyContext.md#input)
67
+
68
+ ***
69
+
70
+ ### resource[​](#resource "Direct link to resource")
71
+
72
+ ```ts
73
+ readonly resource: R;
74
+
75
+ ```
@@ -0,0 +1,77 @@
1
+ # Interface: OperationDefinition\<M, I, O, R, Name>
2
+
3
+ One immutable operation descriptor. Nothing in it runs until a request does.
4
+
5
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
6
+
7
+ | Type Parameter |
8
+ | --------------------------------------------------------------------------------------- |
9
+ | `M` *extends* [`OperationMethod`](./docs/api/appkit/TypeAlias.OperationMethod.md) |
10
+ | `I` *extends* `SchemaSlot` |
11
+ | `O` *extends* `SchemaSlot` |
12
+ | `R` |
13
+ | `Name` *extends* `string` |
14
+
15
+ ## Properties[​](#properties "Direct link to Properties")
16
+
17
+ ### authorize[​](#authorize "Direct link to authorize")
18
+
19
+ ```ts
20
+ readonly authorize: Authorize<ParsedInput<I>, R>;
21
+
22
+ ```
23
+
24
+ ***
25
+
26
+ ### execute()[​](#execute "Direct link to execute()")
27
+
28
+ ```ts
29
+ readonly execute: (context: OperationContext<ParsedInput<I>, [R] extends [undefined] ? undefined : NonNullable<Awaited<R>>>) => Awaitable<ExecuteResult<M, O>>;
30
+
31
+ ```
32
+
33
+ #### Parameters[​](#parameters "Direct link to Parameters")
34
+
35
+ | Parameter | Type |
36
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
37
+ | `context` | [`OperationContext`](./docs/api/appkit/Interface.OperationContext.md)<`ParsedInput`<`I`>, \[`R`] *extends* \[`undefined`] ? `undefined` : `NonNullable`<`Awaited`<`R`>>> |
38
+
39
+ #### Returns[​](#returns "Direct link to Returns")
40
+
41
+ `Awaitable`<`ExecuteResult`<`M`, `O`>>
42
+
43
+ ***
44
+
45
+ ### input[​](#input "Direct link to input")
46
+
47
+ ```ts
48
+ readonly input: I;
49
+
50
+ ```
51
+
52
+ ***
53
+
54
+ ### method[​](#method "Direct link to method")
55
+
56
+ ```ts
57
+ readonly method: M;
58
+
59
+ ```
60
+
61
+ ***
62
+
63
+ ### name[​](#name "Direct link to name")
64
+
65
+ ```ts
66
+ readonly name: Name;
67
+
68
+ ```
69
+
70
+ ***
71
+
72
+ ### output[​](#output "Direct link to output")
73
+
74
+ ```ts
75
+ readonly output: O;
76
+
77
+ ```
@@ -0,0 +1,49 @@
1
+ # Interface: PolicyContext\<In>
2
+
3
+ What every authorization callback receives, the `resource` lookup included. `actor` is the verified caller, so a lookup can scope its query to them.
4
+
5
+ ## Extended by[​](#extended-by "Direct link to Extended by")
6
+
7
+ * [`OperationContext`](./docs/api/appkit/Interface.OperationContext.md)
8
+
9
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
10
+
11
+ | Type Parameter | Default type |
12
+ | -------------- | ------------ |
13
+ | `In` | `unknown` |
14
+
15
+ ## Properties[​](#properties "Direct link to Properties")
16
+
17
+ ### actor[​](#actor "Direct link to actor")
18
+
19
+ ```ts
20
+ readonly actor: Actor;
21
+
22
+ ```
23
+
24
+ ***
25
+
26
+ ### appkit[​](#appkit "Direct link to appkit")
27
+
28
+ ```ts
29
+ readonly appkit: OperationAppKit;
30
+
31
+ ```
32
+
33
+ ***
34
+
35
+ ### db[​](#db "Direct link to db")
36
+
37
+ ```ts
38
+ readonly db: DatabaseExports;
39
+
40
+ ```
41
+
42
+ ***
43
+
44
+ ### input[​](#input "Direct link to input")
45
+
46
+ ```ts
47
+ readonly input: In;
48
+
49
+ ```
@@ -0,0 +1,21 @@
1
+ # Interface: PolicyDenial
2
+
3
+ An explicit refusal. `reason` stays on the server; HTTP and logs do not receive it.
4
+
5
+ ## Properties[​](#properties "Direct link to Properties")
6
+
7
+ ### deny[​](#deny "Direct link to deny")
8
+
9
+ ```ts
10
+ readonly deny: "forbidden" | "not-found";
11
+
12
+ ```
13
+
14
+ ***
15
+
16
+ ### reason?[​](#reason "Direct link to reason?")
17
+
18
+ ```ts
19
+ readonly optional reason: string;
20
+
21
+ ```
@@ -0,0 +1,8 @@
1
+ # Type Alias: DatabricksAppKitDatabaseOperations
2
+
3
+ ```ts
4
+ type DatabricksAppKitDatabaseOperations = globalThis.DatabricksAppKitDatabaseOperations;
5
+
6
+ ```
7
+
8
+ The same global registry, available as a module type for package exports.
@@ -3,7 +3,6 @@
3
3
  ```ts
4
4
  type IDatabaseConfig<TSchema> = {
5
5
  api?: DatabaseApiConfig<TSchema>;
6
- hooks?: { readonly [TTable in SchemaTableName<TSchema>]?: EntityHooks<TTable> };
7
6
  pool?: DatabasePoolConfig;
8
7
  schema?: TSchema;
9
8
  };
@@ -40,15 +39,6 @@ true
40
39
 
41
40
  ***
42
41
 
43
- ### hooks?[​](#hooks "Direct link to hooks?")
44
-
45
- ```ts
46
- readonly optional hooks: { readonly [TTable in SchemaTableName<TSchema>]?: EntityHooks<TTable> };
47
-
48
- ```
49
-
50
- ***
51
-
52
42
  ### pool?[​](#pool "Direct link to pool?")
53
43
 
54
44
  ```ts
@@ -0,0 +1,8 @@
1
+ # Type Alias: OperationMethod
2
+
3
+ ```ts
4
+ type OperationMethod = DatabaseOperationMethod;
5
+
6
+ ```
7
+
8
+ HTTP methods an operation can answer; the browser client reads the same union.
@@ -0,0 +1,14 @@
1
+ # Type Alias: OperationWireInput\<Operation>
2
+
3
+ ```ts
4
+ type OperationWireInput<Operation> = Operation extends OperationDefinition<infer _M, infer I, infer _O, infer _R, infer _Name> ? WireInputOf<I> : never;
5
+
6
+ ```
7
+
8
+ The JSON a caller sends to an operation; a bigint travels as a string or safe integer.
9
+
10
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
11
+
12
+ | Type Parameter |
13
+ | -------------- |
14
+ | `Operation` |
@@ -0,0 +1,14 @@
1
+ # Type Alias: OperationWireOutput\<Operation>
2
+
3
+ ```ts
4
+ type OperationWireOutput<Operation> = Operation extends OperationDefinition<infer M, infer _I, infer O, infer _R, infer _Name> ? WireOutputOf<M, O> : never;
5
+
6
+ ```
7
+
8
+ The JSON a successful call answers with; without an output schema there is none.
9
+
10
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
11
+
12
+ | Type Parameter |
13
+ | -------------- |
14
+ | `Operation` |
@@ -0,0 +1,15 @@
1
+ # Type Alias: Policy\<In, R>
2
+
3
+ ```ts
4
+ type Policy<In, R> = AllowPolicy<In> | ResourcePolicy<In, R>;
5
+
6
+ ```
7
+
8
+ A reusable authorization rule, with or without a resource lookup.
9
+
10
+ ## Type Parameters[​](#type-parameters "Direct link to Type Parameters")
11
+
12
+ | Type Parameter | Default type |
13
+ | -------------- | ------------ |
14
+ | `In` | `unknown` |
15
+ | `R` | `undefined` |
@@ -0,0 +1,8 @@
1
+ # Type Alias: PolicyDecision
2
+
3
+ ```ts
4
+ type PolicyDecision = true | false | PolicyDenial;
5
+
6
+ ```
7
+
8
+ Only literal `true` admits. False and an explicit denial refuse.