@iii-dev/helpers 0.22.1 → 0.23.0-rc.2
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.
|
@@ -15,7 +15,17 @@ type AuthInput = {
|
|
|
15
15
|
* middleware.
|
|
16
16
|
*/
|
|
17
17
|
type AuthResult = {
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Grants scoped to one namespace each: `{ orders: ['svc::*'] }`. A value is an
|
|
20
|
+
* exact function ID or a wildcard, in either the bare (`svc::*`) or the
|
|
21
|
+
* `match("svc::*")` spelling.
|
|
22
|
+
*
|
|
23
|
+
* The keys are also the namespaces the session may declare on
|
|
24
|
+
* `engine::workers::register`. Omit to scope nothing: the session declares any
|
|
25
|
+
* namespace, and only `allowed_functions` and `expose_functions` apply.
|
|
26
|
+
*/
|
|
27
|
+
namespaces?: Record<string, string[]>; /** Additional function IDs to allow beyond the `expose_functions` config, in the `default` namespace only. Put per-namespace grants in `namespaces`. Defaults to `[]` if omitted. */
|
|
28
|
+
allowed_functions?: string[]; /** Function IDs to deny even if they match `expose_functions`. Takes precedence over allowed. Defaults to `[]` if omitted. */
|
|
19
29
|
forbidden_functions?: string[]; /** Trigger type IDs the worker may register triggers for. When omitted, all types are allowed. */
|
|
20
30
|
allowed_trigger_types?: string[]; /** Whether the worker may register new trigger types. Defaults to `false` if omitted. */
|
|
21
31
|
allow_trigger_type_registration?: boolean; /** Whether the worker may register new functions. Defaults to `true` if omitted. */
|
|
@@ -54,7 +64,13 @@ type OnTriggerRegistrationInput = {
|
|
|
54
64
|
trigger_type: string; /** ID of the function this trigger is bound to. */
|
|
55
65
|
function_id: string; /** Trigger-specific configuration. */
|
|
56
66
|
config: unknown; /** Arbitrary metadata attached to the trigger. */
|
|
57
|
-
metadata?: Record<string, unknown>;
|
|
67
|
+
metadata?: Record<string, unknown>;
|
|
68
|
+
/**
|
|
69
|
+
* Namespace the trigger's target resolves in (explicit, or `default` when
|
|
70
|
+
* absent). The same function id can exist in several namespaces, so the hook
|
|
71
|
+
* needs this to authorize per target namespace.
|
|
72
|
+
*/
|
|
73
|
+
namespace?: string; /** Auth context from `AuthResult.context` for this session. */
|
|
58
74
|
context: Record<string, unknown>;
|
|
59
75
|
};
|
|
60
76
|
/**
|
|
@@ -77,7 +93,12 @@ type OnTriggerRegistrationResult = {
|
|
|
77
93
|
type OnFunctionRegistrationInput = {
|
|
78
94
|
/** ID of the function being registered. */function_id: string; /** Human-readable description of the function. */
|
|
79
95
|
description?: string; /** Arbitrary metadata attached to the function. */
|
|
80
|
-
metadata?: Record<string, unknown>;
|
|
96
|
+
metadata?: Record<string, unknown>;
|
|
97
|
+
/**
|
|
98
|
+
* Namespace the function registers in. The same id can exist in several
|
|
99
|
+
* namespaces, so the hook needs this to authorize per namespace.
|
|
100
|
+
*/
|
|
101
|
+
namespace?: string; /** Auth context from `AuthResult.context` for this session. */
|
|
81
102
|
context: Record<string, unknown>;
|
|
82
103
|
};
|
|
83
104
|
/**
|
|
@@ -15,7 +15,17 @@ type AuthInput = {
|
|
|
15
15
|
* middleware.
|
|
16
16
|
*/
|
|
17
17
|
type AuthResult = {
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Grants scoped to one namespace each: `{ orders: ['svc::*'] }`. A value is an
|
|
20
|
+
* exact function ID or a wildcard, in either the bare (`svc::*`) or the
|
|
21
|
+
* `match("svc::*")` spelling.
|
|
22
|
+
*
|
|
23
|
+
* The keys are also the namespaces the session may declare on
|
|
24
|
+
* `engine::workers::register`. Omit to scope nothing: the session declares any
|
|
25
|
+
* namespace, and only `allowed_functions` and `expose_functions` apply.
|
|
26
|
+
*/
|
|
27
|
+
namespaces?: Record<string, string[]>; /** Additional function IDs to allow beyond the `expose_functions` config, in the `default` namespace only. Put per-namespace grants in `namespaces`. Defaults to `[]` if omitted. */
|
|
28
|
+
allowed_functions?: string[]; /** Function IDs to deny even if they match `expose_functions`. Takes precedence over allowed. Defaults to `[]` if omitted. */
|
|
19
29
|
forbidden_functions?: string[]; /** Trigger type IDs the worker may register triggers for. When omitted, all types are allowed. */
|
|
20
30
|
allowed_trigger_types?: string[]; /** Whether the worker may register new trigger types. Defaults to `false` if omitted. */
|
|
21
31
|
allow_trigger_type_registration?: boolean; /** Whether the worker may register new functions. Defaults to `true` if omitted. */
|
|
@@ -54,7 +64,13 @@ type OnTriggerRegistrationInput = {
|
|
|
54
64
|
trigger_type: string; /** ID of the function this trigger is bound to. */
|
|
55
65
|
function_id: string; /** Trigger-specific configuration. */
|
|
56
66
|
config: unknown; /** Arbitrary metadata attached to the trigger. */
|
|
57
|
-
metadata?: Record<string, unknown>;
|
|
67
|
+
metadata?: Record<string, unknown>;
|
|
68
|
+
/**
|
|
69
|
+
* Namespace the trigger's target resolves in (explicit, or `default` when
|
|
70
|
+
* absent). The same function id can exist in several namespaces, so the hook
|
|
71
|
+
* needs this to authorize per target namespace.
|
|
72
|
+
*/
|
|
73
|
+
namespace?: string; /** Auth context from `AuthResult.context` for this session. */
|
|
58
74
|
context: Record<string, unknown>;
|
|
59
75
|
};
|
|
60
76
|
/**
|
|
@@ -77,7 +93,12 @@ type OnTriggerRegistrationResult = {
|
|
|
77
93
|
type OnFunctionRegistrationInput = {
|
|
78
94
|
/** ID of the function being registered. */function_id: string; /** Human-readable description of the function. */
|
|
79
95
|
description?: string; /** Arbitrary metadata attached to the function. */
|
|
80
|
-
metadata?: Record<string, unknown>;
|
|
96
|
+
metadata?: Record<string, unknown>;
|
|
97
|
+
/**
|
|
98
|
+
* Namespace the function registers in. The same id can exist in several
|
|
99
|
+
* namespaces, so the hook needs this to authorize per namespace.
|
|
100
|
+
*/
|
|
101
|
+
namespace?: string; /** Auth context from `AuthResult.context` for this session. */
|
|
81
102
|
context: Record<string, unknown>;
|
|
82
103
|
};
|
|
83
104
|
/**
|