@zenstackhq/runtime 3.0.0-beta.8 → 3.0.0-beta.9
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/auth-CzM6GLw6.d.cts +524 -0
- package/dist/auth-CzM6GLw6.d.ts +524 -0
- package/dist/index.cjs +1158 -2508
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1185 -6
- package/dist/index.d.ts +1185 -6
- package/dist/index.js +1112 -2469
- package/dist/index.js.map +1 -1
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.d.cts +2 -0
- package/dist/schema.d.ts +2 -0
- package/package.json +8 -14
- package/dist/errors-DVYyRUGp.d.cts +0 -1545
- package/dist/errors-DVYyRUGp.d.ts +0 -1545
- package/dist/plugins/policy/index.cjs +0 -3478
- package/dist/plugins/policy/index.cjs.map +0 -1
- package/dist/plugins/policy/index.d.cts +0 -42
- package/dist/plugins/policy/index.d.ts +0 -42
- package/dist/plugins/policy/index.js +0 -3441
- package/dist/plugins/policy/index.js.map +0 -1
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { R as ZenStackError, $ as RuntimePlugin, a0 as ZModelFunction, a1 as OnKyselyQueryArgs } from '../../errors-DVYyRUGp.cjs';
|
|
2
|
-
import * as kysely from 'kysely';
|
|
3
|
-
import { SchemaDef } from '@zenstackhq/sdk/schema';
|
|
4
|
-
import 'decimal.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Reason code for policy rejection.
|
|
8
|
-
*/
|
|
9
|
-
declare enum RejectedByPolicyReason {
|
|
10
|
-
/**
|
|
11
|
-
* Rejected because the operation is not allowed by policy.
|
|
12
|
-
*/
|
|
13
|
-
NO_ACCESS = "no-access",
|
|
14
|
-
/**
|
|
15
|
-
* Rejected because the result cannot be read back after mutation due to policy.
|
|
16
|
-
*/
|
|
17
|
-
CANNOT_READ_BACK = "cannot-read-back",
|
|
18
|
-
/**
|
|
19
|
-
* Other reasons.
|
|
20
|
-
*/
|
|
21
|
-
OTHER = "other"
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Error thrown when an operation is rejected by access policy.
|
|
25
|
-
*/
|
|
26
|
-
declare class RejectedByPolicyError extends ZenStackError {
|
|
27
|
-
readonly model: string | undefined;
|
|
28
|
-
readonly reason: RejectedByPolicyReason;
|
|
29
|
-
constructor(model: string | undefined, reason?: RejectedByPolicyReason, message?: string);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare class PolicyPlugin<Schema extends SchemaDef> implements RuntimePlugin<Schema> {
|
|
33
|
-
get id(): string;
|
|
34
|
-
get name(): string;
|
|
35
|
-
get description(): string;
|
|
36
|
-
get functions(): {
|
|
37
|
-
check: ZModelFunction<any>;
|
|
38
|
-
};
|
|
39
|
-
onKyselyQuery({ query, client, proceed }: OnKyselyQueryArgs<Schema>): Promise<kysely.QueryResult<any>>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { PolicyPlugin, RejectedByPolicyError, RejectedByPolicyReason };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { R as ZenStackError, $ as RuntimePlugin, a0 as ZModelFunction, a1 as OnKyselyQueryArgs } from '../../errors-DVYyRUGp.js';
|
|
2
|
-
import * as kysely from 'kysely';
|
|
3
|
-
import { SchemaDef } from '@zenstackhq/sdk/schema';
|
|
4
|
-
import 'decimal.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Reason code for policy rejection.
|
|
8
|
-
*/
|
|
9
|
-
declare enum RejectedByPolicyReason {
|
|
10
|
-
/**
|
|
11
|
-
* Rejected because the operation is not allowed by policy.
|
|
12
|
-
*/
|
|
13
|
-
NO_ACCESS = "no-access",
|
|
14
|
-
/**
|
|
15
|
-
* Rejected because the result cannot be read back after mutation due to policy.
|
|
16
|
-
*/
|
|
17
|
-
CANNOT_READ_BACK = "cannot-read-back",
|
|
18
|
-
/**
|
|
19
|
-
* Other reasons.
|
|
20
|
-
*/
|
|
21
|
-
OTHER = "other"
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Error thrown when an operation is rejected by access policy.
|
|
25
|
-
*/
|
|
26
|
-
declare class RejectedByPolicyError extends ZenStackError {
|
|
27
|
-
readonly model: string | undefined;
|
|
28
|
-
readonly reason: RejectedByPolicyReason;
|
|
29
|
-
constructor(model: string | undefined, reason?: RejectedByPolicyReason, message?: string);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare class PolicyPlugin<Schema extends SchemaDef> implements RuntimePlugin<Schema> {
|
|
33
|
-
get id(): string;
|
|
34
|
-
get name(): string;
|
|
35
|
-
get description(): string;
|
|
36
|
-
get functions(): {
|
|
37
|
-
check: ZModelFunction<any>;
|
|
38
|
-
};
|
|
39
|
-
onKyselyQuery({ query, client, proceed }: OnKyselyQueryArgs<Schema>): Promise<kysely.QueryResult<any>>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { PolicyPlugin, RejectedByPolicyError, RejectedByPolicyReason };
|