@zenstackhq/sdk 1.0.0-beta.21 → 1.0.0-beta.23
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/package.json +4 -4
- package/types.d.ts +24 -2
- package/types.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/sdk",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.23",
|
|
4
4
|
"description": "ZenStack plugin development SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@prisma/generator-helper": "^5.0.0",
|
|
15
|
-
"@prisma/internals": "4.
|
|
15
|
+
"@prisma/internals": "^4.16.0",
|
|
16
16
|
"@prisma/internals-v5": "npm:@prisma/internals@^5.0.0",
|
|
17
17
|
"prettier": "^2.8.3",
|
|
18
18
|
"semver": "^7.3.8",
|
|
19
19
|
"ts-morph": "^16.0.0",
|
|
20
20
|
"upper-case-first": "^2.0.2",
|
|
21
|
-
"@zenstackhq/language": "1.0.0-beta.
|
|
22
|
-
"@zenstackhq/runtime": "1.0.0-beta.
|
|
21
|
+
"@zenstackhq/language": "1.0.0-beta.23",
|
|
22
|
+
"@zenstackhq/runtime": "1.0.0-beta.23"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^18.0.0",
|
package/types.d.ts
CHANGED
|
@@ -5,17 +5,39 @@ import { Model } from '@zenstackhq/language/ast';
|
|
|
5
5
|
*/
|
|
6
6
|
export type OptionValue = string | number | boolean;
|
|
7
7
|
/**
|
|
8
|
-
* Plugin configuration
|
|
8
|
+
* Plugin configuration options
|
|
9
9
|
*/
|
|
10
10
|
export type PluginOptions = {
|
|
11
|
+
/***
|
|
12
|
+
* The provider package
|
|
13
|
+
*/
|
|
11
14
|
provider?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The path of the ZModel schema
|
|
17
|
+
*/
|
|
12
18
|
schemaPath: string;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the plugin
|
|
21
|
+
*/
|
|
13
22
|
name: string;
|
|
14
23
|
} & Record<string, OptionValue | OptionValue[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Global options that apply to all plugins
|
|
26
|
+
*/
|
|
27
|
+
export type PluginGlobalOptions = {
|
|
28
|
+
/**
|
|
29
|
+
* Default output directory
|
|
30
|
+
*/
|
|
31
|
+
output?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to compile the generated code
|
|
34
|
+
*/
|
|
35
|
+
compile: boolean;
|
|
36
|
+
};
|
|
15
37
|
/**
|
|
16
38
|
* Plugin entry point function definition
|
|
17
39
|
*/
|
|
18
|
-
export type PluginFunction = (model: Model, options: PluginOptions, dmmf?: DMMF.Document,
|
|
40
|
+
export type PluginFunction = (model: Model, options: PluginOptions, dmmf?: DMMF.Document, globalOptions?: PluginGlobalOptions) => Promise<string[]> | string[] | Promise<void> | void;
|
|
19
41
|
/**
|
|
20
42
|
* Plugin error
|
|
21
43
|
*/
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAqDA;;GAEG;AACH,MAAa,WAAY,SAAQ,KAAK;IAClC,YAAmB,MAAc,EAAE,OAAe;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAC;QADA,WAAM,GAAN,MAAM,CAAQ;IAEjC,CAAC;CACJ;AAJD,kCAIC"}
|