@kinotic-ai/core 5.0.0-beta.21 → 5.0.0-beta.22
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.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1321,7 +1321,7 @@ var import_api2 = __toESM(require("@opentelemetry/api"));
|
|
|
1321
1321
|
// packages/core/package.json
|
|
1322
1322
|
var package_default = {
|
|
1323
1323
|
name: "@kinotic-ai/core",
|
|
1324
|
-
version: "5.0.0-beta.
|
|
1324
|
+
version: "5.0.0-beta.22",
|
|
1325
1325
|
type: "module",
|
|
1326
1326
|
files: [
|
|
1327
1327
|
"dist"
|
|
@@ -1390,7 +1390,7 @@ var package_default = {
|
|
|
1390
1390
|
vitest: "^4.1.4"
|
|
1391
1391
|
},
|
|
1392
1392
|
dependencies: {
|
|
1393
|
-
"@kinotic-ai/idl": "workspace
|
|
1393
|
+
"@kinotic-ai/idl": "workspace:^",
|
|
1394
1394
|
"@opentelemetry/api": "^1.9.1",
|
|
1395
1395
|
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
1396
1396
|
"@stomp/rx-stomp": "^2.4.0",
|
package/dist/index.d.cts
CHANGED
|
@@ -804,22 +804,22 @@ interface AuthzRoleDeclaration {
|
|
|
804
804
|
interface AuthzResourceDeclaration {
|
|
805
805
|
/**
|
|
806
806
|
* The resource type, a single lowercase identifier such as `report`: it names the type in the model, prefixes
|
|
807
|
-
* the type's permissions (`report_can_view`) and roles (`report.editor`), and is the type of the
|
|
807
|
+
* the type's permissions (`report_can_view`) and roles (`report.editor`), and is the type of the resource every
|
|
808
808
|
* function is checked on unless the function names another with {@link AuthzCheck}.
|
|
809
809
|
*/
|
|
810
810
|
value: string;
|
|
811
811
|
/**
|
|
812
|
-
* The type that contains this one, such as `tenant` for `report`: a grant made on
|
|
813
|
-
* inherits to every
|
|
812
|
+
* The type that contains this one, such as `tenant` for `report`: a grant made on a resource of the parent type
|
|
813
|
+
* inherits to every resource of this type inside it, and a function naming no resource of its own, such as a
|
|
814
814
|
* listing or a create, is checked on the parent. Absent for a root type.
|
|
815
815
|
*/
|
|
816
816
|
parent?: string | null;
|
|
817
817
|
/**
|
|
818
|
-
* The
|
|
819
|
-
* request does not name: a template over the caller's scope, `{@applicationId}` or `{@tenantId}`, or a literal
|
|
820
|
-
* id. A function naming its own
|
|
818
|
+
* The resource every function of the service is checked on, for a service whose functions act on one resource
|
|
819
|
+
* the request does not name: a template over the caller's scope, `{@applicationId}` or `{@tenantId}`, or a literal
|
|
820
|
+
* id. A function naming its own resource with {@link AuthzCheck} is unaffected.
|
|
821
821
|
*/
|
|
822
|
-
|
|
822
|
+
resourceId?: string | null;
|
|
823
823
|
/**
|
|
824
824
|
* The permission every function of the service needs, as a short name such as `can_manage`, for a service whose
|
|
825
825
|
* functions all need the one permission whatever their names. A function declaring a permission of its own with
|
|
@@ -840,16 +840,16 @@ interface AuthzCheckDeclaration {
|
|
|
840
840
|
*/
|
|
841
841
|
permission?: string | null;
|
|
842
842
|
/**
|
|
843
|
-
* The type of the
|
|
843
|
+
* The type of the resource the check is made on, when it is not the service's own type: the parent for a
|
|
844
844
|
* create, or a template such as `{definitionId}` for a function whose type is an argument.
|
|
845
845
|
*/
|
|
846
846
|
resource?: string | null;
|
|
847
847
|
/**
|
|
848
|
-
* The id of the
|
|
848
|
+
* The id of the resource the check is made on, as a template over the function's parameters and the caller's
|
|
849
849
|
* scope: `{reportId}` is a parameter's value, `{registration.id}` a property of an object parameter, and
|
|
850
850
|
* `{@applicationId}` or `{@tenantId}` the matching id of the caller's scope.
|
|
851
851
|
*/
|
|
852
|
-
|
|
852
|
+
resourceId?: string | null;
|
|
853
853
|
/**
|
|
854
854
|
* Short names of permissions on the same type that this permission also grants, so a role bundling
|
|
855
855
|
* `can_generate` declared with `implies: ['can_view']` views what it generates.
|
|
@@ -919,14 +919,14 @@ declare function receivesContext(serviceInstance: object, methodName: string): b
|
|
|
919
919
|
* and the permissions its functions need become part of the application's authorization model, where roles
|
|
920
920
|
* bundle permissions and grants bind roles to callers.
|
|
921
921
|
*
|
|
922
|
-
* A function's check has three parts: the permission it needs, the type of the
|
|
923
|
-
* the id of that
|
|
922
|
+
* A function's check has three parts: the permission it needs, the type of the resource it is checked on, and
|
|
923
|
+
* the id of that resource. Each part is derived from the function's name and parameters where it can be;
|
|
924
924
|
* {@link AuthzCheck} states a part derivation gets wrong or cannot know, and {@link AuthzUnchecked} marks a
|
|
925
925
|
* function served with no check. A function left with no check and no marker fails the service's registration.
|
|
926
926
|
*
|
|
927
927
|
* The permission is derived from the first word of the function's name: `find`, `get`, `count`, `search` and
|
|
928
928
|
* `list` need `can_view`; `save`, `update` and `set` need `can_edit`; `delete` and `remove` need `can_delete`;
|
|
929
|
-
* `create` needs `can_edit` of this type on the parent. The
|
|
929
|
+
* `create` needs `can_edit` of this type on the parent. The resource's id is the parameter named `id` or
|
|
930
930
|
* `<type>Id` (`reportId` for the type `report`), else the `id` of the first object parameter; a function with
|
|
931
931
|
* neither is checked on the parent, whose id is found the same way with the parent's name, else on the caller's
|
|
932
932
|
* own scope.
|
|
@@ -935,16 +935,16 @@ declare function receivesContext(serviceInstance: object, methodName: string): b
|
|
|
935
935
|
* `report_can_view` on the report `id` names, `save(report: Report)` for `report_can_edit` on the report
|
|
936
936
|
* `report.id` names, and `findReports()` for `report_can_view` on the caller's tenant, with nothing declared on
|
|
937
937
|
* them. A runtime holding no definition for a service declaring a resource refuses to serve it.
|
|
938
|
-
* @param declaration the resource type, or the type with its parent,
|
|
938
|
+
* @param declaration the resource type, or the type with its parent, resource id, permission and roles
|
|
939
939
|
*/
|
|
940
940
|
declare function AuthzResource(declaration: AuthzResourceDeclaration | string): (value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
941
941
|
/**
|
|
942
942
|
* States a part of one function's check that derivation gets wrong or cannot know, which `kinotic sync` reads
|
|
943
|
-
* into the service's definition: the permission, the type of the
|
|
943
|
+
* into the service's definition: the permission, the type of the resource, or its id. Every part left out keeps
|
|
944
944
|
* the derived value, or the one the service declares with {@link AuthzResource}, so a function states only the
|
|
945
945
|
* part derivation misses. A function served with no check is marked {@link AuthzUnchecked} instead.
|
|
946
946
|
*
|
|
947
|
-
* Example: `@AuthzCheck({permission: 'can_report',
|
|
947
|
+
* Example: `@AuthzCheck({permission: 'can_report', resourceId: '{registration.id}'})` on
|
|
948
948
|
* `heartbeat(registration: Registration)`, whose name derives no permission and whose id is inside the body.
|
|
949
949
|
* @param declaration the parts of the check derivation cannot read from the function's name and parameters
|
|
950
950
|
*/
|
|
@@ -953,7 +953,7 @@ declare function AuthzCheck(declaration: AuthzCheckDeclaration): (_value: Functi
|
|
|
953
953
|
* Marks a function of an {@link AuthzResource} service that is served with no authorization check, which
|
|
954
954
|
* `kinotic sync` reads into the service's definition: any caller the service's zone admits may call it, and the
|
|
955
955
|
* service itself is responsible for answering only what the caller may see or do. It is for a function that has
|
|
956
|
-
* no
|
|
956
|
+
* no resource to check, such as a listing of the caller's own grants. A function carrying this and
|
|
957
957
|
* {@link AuthzCheck} fails the service's registration.
|
|
958
958
|
*/
|
|
959
959
|
declare function AuthzUnchecked(_value: Function, _context: ClassMethodDecoratorContext): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -804,22 +804,22 @@ interface AuthzRoleDeclaration {
|
|
|
804
804
|
interface AuthzResourceDeclaration {
|
|
805
805
|
/**
|
|
806
806
|
* The resource type, a single lowercase identifier such as `report`: it names the type in the model, prefixes
|
|
807
|
-
* the type's permissions (`report_can_view`) and roles (`report.editor`), and is the type of the
|
|
807
|
+
* the type's permissions (`report_can_view`) and roles (`report.editor`), and is the type of the resource every
|
|
808
808
|
* function is checked on unless the function names another with {@link AuthzCheck}.
|
|
809
809
|
*/
|
|
810
810
|
value: string;
|
|
811
811
|
/**
|
|
812
|
-
* The type that contains this one, such as `tenant` for `report`: a grant made on
|
|
813
|
-
* inherits to every
|
|
812
|
+
* The type that contains this one, such as `tenant` for `report`: a grant made on a resource of the parent type
|
|
813
|
+
* inherits to every resource of this type inside it, and a function naming no resource of its own, such as a
|
|
814
814
|
* listing or a create, is checked on the parent. Absent for a root type.
|
|
815
815
|
*/
|
|
816
816
|
parent?: string | null;
|
|
817
817
|
/**
|
|
818
|
-
* The
|
|
819
|
-
* request does not name: a template over the caller's scope, `{@applicationId}` or `{@tenantId}`, or a literal
|
|
820
|
-
* id. A function naming its own
|
|
818
|
+
* The resource every function of the service is checked on, for a service whose functions act on one resource
|
|
819
|
+
* the request does not name: a template over the caller's scope, `{@applicationId}` or `{@tenantId}`, or a literal
|
|
820
|
+
* id. A function naming its own resource with {@link AuthzCheck} is unaffected.
|
|
821
821
|
*/
|
|
822
|
-
|
|
822
|
+
resourceId?: string | null;
|
|
823
823
|
/**
|
|
824
824
|
* The permission every function of the service needs, as a short name such as `can_manage`, for a service whose
|
|
825
825
|
* functions all need the one permission whatever their names. A function declaring a permission of its own with
|
|
@@ -840,16 +840,16 @@ interface AuthzCheckDeclaration {
|
|
|
840
840
|
*/
|
|
841
841
|
permission?: string | null;
|
|
842
842
|
/**
|
|
843
|
-
* The type of the
|
|
843
|
+
* The type of the resource the check is made on, when it is not the service's own type: the parent for a
|
|
844
844
|
* create, or a template such as `{definitionId}` for a function whose type is an argument.
|
|
845
845
|
*/
|
|
846
846
|
resource?: string | null;
|
|
847
847
|
/**
|
|
848
|
-
* The id of the
|
|
848
|
+
* The id of the resource the check is made on, as a template over the function's parameters and the caller's
|
|
849
849
|
* scope: `{reportId}` is a parameter's value, `{registration.id}` a property of an object parameter, and
|
|
850
850
|
* `{@applicationId}` or `{@tenantId}` the matching id of the caller's scope.
|
|
851
851
|
*/
|
|
852
|
-
|
|
852
|
+
resourceId?: string | null;
|
|
853
853
|
/**
|
|
854
854
|
* Short names of permissions on the same type that this permission also grants, so a role bundling
|
|
855
855
|
* `can_generate` declared with `implies: ['can_view']` views what it generates.
|
|
@@ -919,14 +919,14 @@ declare function receivesContext(serviceInstance: object, methodName: string): b
|
|
|
919
919
|
* and the permissions its functions need become part of the application's authorization model, where roles
|
|
920
920
|
* bundle permissions and grants bind roles to callers.
|
|
921
921
|
*
|
|
922
|
-
* A function's check has three parts: the permission it needs, the type of the
|
|
923
|
-
* the id of that
|
|
922
|
+
* A function's check has three parts: the permission it needs, the type of the resource it is checked on, and
|
|
923
|
+
* the id of that resource. Each part is derived from the function's name and parameters where it can be;
|
|
924
924
|
* {@link AuthzCheck} states a part derivation gets wrong or cannot know, and {@link AuthzUnchecked} marks a
|
|
925
925
|
* function served with no check. A function left with no check and no marker fails the service's registration.
|
|
926
926
|
*
|
|
927
927
|
* The permission is derived from the first word of the function's name: `find`, `get`, `count`, `search` and
|
|
928
928
|
* `list` need `can_view`; `save`, `update` and `set` need `can_edit`; `delete` and `remove` need `can_delete`;
|
|
929
|
-
* `create` needs `can_edit` of this type on the parent. The
|
|
929
|
+
* `create` needs `can_edit` of this type on the parent. The resource's id is the parameter named `id` or
|
|
930
930
|
* `<type>Id` (`reportId` for the type `report`), else the `id` of the first object parameter; a function with
|
|
931
931
|
* neither is checked on the parent, whose id is found the same way with the parent's name, else on the caller's
|
|
932
932
|
* own scope.
|
|
@@ -935,16 +935,16 @@ declare function receivesContext(serviceInstance: object, methodName: string): b
|
|
|
935
935
|
* `report_can_view` on the report `id` names, `save(report: Report)` for `report_can_edit` on the report
|
|
936
936
|
* `report.id` names, and `findReports()` for `report_can_view` on the caller's tenant, with nothing declared on
|
|
937
937
|
* them. A runtime holding no definition for a service declaring a resource refuses to serve it.
|
|
938
|
-
* @param declaration the resource type, or the type with its parent,
|
|
938
|
+
* @param declaration the resource type, or the type with its parent, resource id, permission and roles
|
|
939
939
|
*/
|
|
940
940
|
declare function AuthzResource(declaration: AuthzResourceDeclaration | string): (value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
941
941
|
/**
|
|
942
942
|
* States a part of one function's check that derivation gets wrong or cannot know, which `kinotic sync` reads
|
|
943
|
-
* into the service's definition: the permission, the type of the
|
|
943
|
+
* into the service's definition: the permission, the type of the resource, or its id. Every part left out keeps
|
|
944
944
|
* the derived value, or the one the service declares with {@link AuthzResource}, so a function states only the
|
|
945
945
|
* part derivation misses. A function served with no check is marked {@link AuthzUnchecked} instead.
|
|
946
946
|
*
|
|
947
|
-
* Example: `@AuthzCheck({permission: 'can_report',
|
|
947
|
+
* Example: `@AuthzCheck({permission: 'can_report', resourceId: '{registration.id}'})` on
|
|
948
948
|
* `heartbeat(registration: Registration)`, whose name derives no permission and whose id is inside the body.
|
|
949
949
|
* @param declaration the parts of the check derivation cannot read from the function's name and parameters
|
|
950
950
|
*/
|
|
@@ -953,7 +953,7 @@ declare function AuthzCheck(declaration: AuthzCheckDeclaration): (_value: Functi
|
|
|
953
953
|
* Marks a function of an {@link AuthzResource} service that is served with no authorization check, which
|
|
954
954
|
* `kinotic sync` reads into the service's definition: any caller the service's zone admits may call it, and the
|
|
955
955
|
* service itself is responsible for answering only what the caller may see or do. It is for a function that has
|
|
956
|
-
* no
|
|
956
|
+
* no resource to check, such as a listing of the caller's own grants. A function carrying this and
|
|
957
957
|
* {@link AuthzCheck} fails the service's registration.
|
|
958
958
|
*/
|
|
959
959
|
declare function AuthzUnchecked(_value: Function, _context: ClassMethodDecoratorContext): void;
|
package/dist/index.js
CHANGED
|
@@ -1200,7 +1200,7 @@ import opentelemetry, { context as context2, propagation as propagation2, trace,
|
|
|
1200
1200
|
// packages/core/package.json
|
|
1201
1201
|
var package_default = {
|
|
1202
1202
|
name: "@kinotic-ai/core",
|
|
1203
|
-
version: "5.0.0-beta.
|
|
1203
|
+
version: "5.0.0-beta.22",
|
|
1204
1204
|
type: "module",
|
|
1205
1205
|
files: [
|
|
1206
1206
|
"dist"
|
|
@@ -1269,7 +1269,7 @@ var package_default = {
|
|
|
1269
1269
|
vitest: "^4.1.4"
|
|
1270
1270
|
},
|
|
1271
1271
|
dependencies: {
|
|
1272
|
-
"@kinotic-ai/idl": "workspace
|
|
1272
|
+
"@kinotic-ai/idl": "workspace:^",
|
|
1273
1273
|
"@opentelemetry/api": "^1.9.1",
|
|
1274
1274
|
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
1275
1275
|
"@stomp/rx-stomp": "^2.4.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"vitest": "^4.1.4"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@kinotic-ai/idl": "5.0.0-beta.
|
|
72
|
+
"@kinotic-ai/idl": "^5.0.0-beta.4",
|
|
73
73
|
"@opentelemetry/api": "^1.9.1",
|
|
74
74
|
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
75
75
|
"@stomp/rx-stomp": "^2.4.0",
|