@kintone/dts-gen 7.0.4 → 8.0.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.
- package/README.md +1 -0
- package/dist/dts-gen-integration-test.js +227 -269
- package/dist/index.js +0 -0
- package/dist/integration-tests/dts-gen-api-test.js +40 -18
- package/dist/integration-tests/dts-gen-api-test.js.map +1 -1
- package/dist/kintone/clients/axios-utils.js +11 -17
- package/dist/kintone/clients/axios-utils.js.map +1 -1
- package/dist/kintone/clients/axios-utils.test.js +31 -6
- package/dist/kintone/clients/axios-utils.test.js.map +1 -1
- package/package.json +28 -28
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -26,11 +26,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.DTSGenApiTest = void 0;
|
|
27
27
|
const assert = __importStar(require("assert"));
|
|
28
28
|
const assertKintoneBuiltinFunctions = () => {
|
|
29
|
-
|
|
29
|
+
assertFunctionExistInKintoneTopLevel();
|
|
30
|
+
assertFunctionExistInKintonePromise();
|
|
31
|
+
assertFunctionExistInKintoneEvent();
|
|
32
|
+
assertFunctionExistInKintoneAPI();
|
|
33
|
+
assertFunctionExistInKintoneProxy();
|
|
34
|
+
assetFunctionExistInKintoneApp();
|
|
35
|
+
assertFunctionExistInKintoneAppRecord();
|
|
36
|
+
assertFunctionExistInKintoneMobileApp();
|
|
37
|
+
assertFunctionExistInKintoneMobileAppRecord();
|
|
38
|
+
assertPortalAPI();
|
|
39
|
+
assertSpaceAPI();
|
|
40
|
+
};
|
|
41
|
+
const assertFunction = (ref) => {
|
|
42
|
+
assert.ok(ref);
|
|
43
|
+
assert.ok(typeof ref === "function");
|
|
44
|
+
};
|
|
45
|
+
exports.DTSGenApiTest = {
|
|
46
|
+
assertKintoneBuiltinFunctions,
|
|
47
|
+
};
|
|
48
|
+
const assertFunctionExistInKintoneTopLevel = () => {
|
|
30
49
|
assertFunction(kintone.getRequestToken);
|
|
31
50
|
assertFunction(kintone.getLoginUser);
|
|
32
51
|
assertFunction(kintone.getUiVersion);
|
|
33
|
-
|
|
52
|
+
};
|
|
53
|
+
const assertFunctionExistInKintonePromise = () => {
|
|
34
54
|
assertFunction(kintone.Promise);
|
|
35
55
|
assertFunction(kintone.Promise.all);
|
|
36
56
|
assertFunction(kintone.Promise.resolve);
|
|
@@ -70,21 +90,25 @@ const assertKintoneBuiltinFunctions = () => {
|
|
|
70
90
|
assert.ok(resolved[1] === 2);
|
|
71
91
|
assert.ok(resolved[2] === 3);
|
|
72
92
|
});
|
|
73
|
-
|
|
93
|
+
};
|
|
94
|
+
const assertFunctionExistInKintoneEvent = () => {
|
|
74
95
|
const e = kintone.events;
|
|
75
96
|
assertFunction(e.on);
|
|
76
97
|
assertFunction(e.off);
|
|
77
|
-
|
|
98
|
+
};
|
|
99
|
+
const assertFunctionExistInKintoneAPI = () => {
|
|
78
100
|
const a = kintone.api;
|
|
79
101
|
assertFunction(a);
|
|
80
102
|
assertFunction(a.url);
|
|
81
103
|
assertFunction(a.urlForGet);
|
|
82
104
|
assertFunction(a.getConcurrencyLimit);
|
|
83
|
-
|
|
105
|
+
};
|
|
106
|
+
const assertFunctionExistInKintoneProxy = () => {
|
|
84
107
|
const p = kintone.proxy;
|
|
85
108
|
assertFunction(p);
|
|
86
109
|
assertFunction(p.upload);
|
|
87
|
-
|
|
110
|
+
};
|
|
111
|
+
const assetFunctionExistInKintoneApp = () => {
|
|
88
112
|
const app = kintone.app;
|
|
89
113
|
assertFunction(app.getFieldElements);
|
|
90
114
|
assertFunction(app.getHeaderMenuSpaceElement);
|
|
@@ -94,7 +118,8 @@ const assertKintoneBuiltinFunctions = () => {
|
|
|
94
118
|
assertFunction(app.getQuery);
|
|
95
119
|
assertFunction(app.getQueryCondition);
|
|
96
120
|
assertFunction(app.getRelatedRecordsTargetAppId);
|
|
97
|
-
|
|
121
|
+
};
|
|
122
|
+
const assertFunctionExistInKintoneAppRecord = () => {
|
|
98
123
|
const r = kintone.app.record;
|
|
99
124
|
assertFunction(r.get);
|
|
100
125
|
assertFunction(r.getHeaderMenuSpaceElement);
|
|
@@ -104,7 +129,8 @@ const assertKintoneBuiltinFunctions = () => {
|
|
|
104
129
|
assertFunction(r.set);
|
|
105
130
|
assertFunction(r.setFieldShown);
|
|
106
131
|
assertFunction(r.setGroupFieldOpen);
|
|
107
|
-
|
|
132
|
+
};
|
|
133
|
+
const assertFunctionExistInKintoneMobileApp = () => {
|
|
108
134
|
const ma = kintone.mobile.app;
|
|
109
135
|
assertFunction(ma.getFieldElements);
|
|
110
136
|
assertFunction(ma.getHeaderSpaceElement);
|
|
@@ -113,7 +139,8 @@ const assertKintoneBuiltinFunctions = () => {
|
|
|
113
139
|
assertFunction(ma.getQuery);
|
|
114
140
|
assertFunction(ma.getQueryCondition);
|
|
115
141
|
assertFunction(ma.getRelatedRecordsTargetAppId);
|
|
116
|
-
|
|
142
|
+
};
|
|
143
|
+
const assertFunctionExistInKintoneMobileAppRecord = () => {
|
|
117
144
|
const mr = kintone.mobile.app.record;
|
|
118
145
|
assertFunction(mr.get);
|
|
119
146
|
assertFunction(mr.getId);
|
|
@@ -122,18 +149,13 @@ const assertKintoneBuiltinFunctions = () => {
|
|
|
122
149
|
assertFunction(mr.set);
|
|
123
150
|
assertFunction(mr.setFieldShown);
|
|
124
151
|
assertFunction(mr.setGroupFieldOpen);
|
|
125
|
-
|
|
152
|
+
};
|
|
153
|
+
const assertPortalAPI = () => {
|
|
126
154
|
assertFunction(kintone.portal.getContentSpaceElement);
|
|
127
155
|
assertFunction(kintone.mobile.portal.getContentSpaceElement);
|
|
128
|
-
|
|
156
|
+
};
|
|
157
|
+
const assertSpaceAPI = () => {
|
|
129
158
|
assertFunction(kintone.space.portal.getContentSpaceElement);
|
|
130
159
|
assertFunction(kintone.mobile.space.portal.getContentSpaceElement);
|
|
131
160
|
};
|
|
132
|
-
const assertFunction = (ref) => {
|
|
133
|
-
assert.ok(ref);
|
|
134
|
-
assert.ok(typeof ref === "function");
|
|
135
|
-
};
|
|
136
|
-
exports.DTSGenApiTest = {
|
|
137
|
-
assertKintoneBuiltinFunctions,
|
|
138
|
-
};
|
|
139
161
|
//# sourceMappingURL=dts-gen-api-test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dts-gen-api-test.js","sourceRoot":"","sources":["../../src/integration-tests/dts-gen-api-test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IACzC,
|
|
1
|
+
{"version":3,"file":"dts-gen-api-test.js","sourceRoot":"","sources":["../../src/integration-tests/dts-gen-api-test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IACzC,oCAAoC,EAAE,CAAC;IACvC,mCAAmC,EAAE,CAAC;IACtC,iCAAiC,EAAE,CAAC;IACpC,+BAA+B,EAAE,CAAC;IAClC,iCAAiC,EAAE,CAAC;IACpC,8BAA8B,EAAE,CAAC;IACjC,qCAAqC,EAAE,CAAC;IACxC,qCAAqC,EAAE,CAAC;IACxC,2CAA2C,EAAE,CAAC;IAC9C,eAAe,EAAE,CAAC;IAClB,cAAc,EAAE,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,EAAE;IAC7B,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,OAAO,GAAG,KAAK,UAAU,CAAC,CAAC;AACvC,CAAC,CAAC;AAEW,QAAA,aAAa,GAAG;IAC3B,6BAA6B;CAC9B,CAAC;AAEF,MAAM,oCAAoC,GAAG,GAAG,EAAE;IAChD,cAAc,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC,cAAc,CAAC,OAAO,CA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AAC;IACvB,cAAc,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC;IACjC,cAAc,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACtD,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC/D,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAC5D,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;AACrE,CAAC,CAAC"}
|
|
@@ -9,31 +9,25 @@ const newAxiosInstance = (input) => {
|
|
|
9
9
|
let proxy;
|
|
10
10
|
// parse the proxy URL like http://admin:pass@localhost:8000
|
|
11
11
|
if (input.proxy) {
|
|
12
|
-
const
|
|
12
|
+
const { protocol, hostname, port, username, password } = new URL(input.proxy);
|
|
13
13
|
proxy = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
username: proxyUrl.username,
|
|
18
|
-
password: proxyUrl.password,
|
|
19
|
-
},
|
|
14
|
+
protocol,
|
|
15
|
+
host: hostname,
|
|
16
|
+
port: parseInt(port, 10),
|
|
20
17
|
};
|
|
18
|
+
if (username.length > 0 && password.length > 0) {
|
|
19
|
+
proxy.auth = { username, password };
|
|
20
|
+
}
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
const headers = new axios_1.default.AxiosHeaders();
|
|
23
23
|
if (input.username && input.password) {
|
|
24
|
-
headers = {
|
|
25
|
-
"X-Cybozu-Authorization": Buffer.from(`${input.username}:${input.password}`).toString("base64"),
|
|
26
|
-
};
|
|
24
|
+
headers["X-Cybozu-Authorization"] = Buffer.from(`${input.username}:${input.password}`).toString("base64");
|
|
27
25
|
}
|
|
28
26
|
else if (input.apiToken) {
|
|
29
|
-
headers =
|
|
30
|
-
"X-Cybozu-API-Token": input.apiToken,
|
|
31
|
-
};
|
|
27
|
+
headers["X-Cybozu-API-Token"] = input.apiToken;
|
|
32
28
|
}
|
|
33
29
|
else if (input.oAuthToken) {
|
|
34
|
-
headers = {
|
|
35
|
-
Authorization: `Bearer ${input.oAuthToken}`,
|
|
36
|
-
};
|
|
30
|
+
headers.Authorization = `Bearer ${input.oAuthToken}`;
|
|
37
31
|
}
|
|
38
32
|
else {
|
|
39
33
|
throw new Error("cannot get an authentication input");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios-utils.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"axios-utils.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.ts"],"names":[],"mappings":";;;;;;AAOA,kDAA0B;AAa1B,MAAM,gBAAgB,GAAG,CAAC,KAAuB,EAAiB,EAAE;IAClE,IAAI,KAAmC,CAAC;IACxC,4DAA4D;IAC5D,IAAI,KAAK,CAAC,KAAK,EAAE;QACf,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAC9D,KAAK,CAAC,KAAK,CACZ,CAAC;QACF,KAAK,GAAG;YACN,QAAQ;YACR,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;SACzB,CAAC;QAEF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9C,KAAK,CAAC,IAAI,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;SACrC;KACF;IAED,MAAM,OAAO,GAAwB,IAAI,eAAK,CAAC,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|
const axios_utils_1 = require("./axios-utils");
|
|
4
|
+
const axios_1 = require("axios");
|
|
4
5
|
describe("FormsClientImpl#constructor", () => {
|
|
5
6
|
const baseUrl = "https://kintone.com";
|
|
6
7
|
const authToken = Buffer.from("username:password").toString("base64");
|
|
@@ -18,9 +19,9 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
18
19
|
basicAuthPassword: null,
|
|
19
20
|
basicAuthUsername: null,
|
|
20
21
|
};
|
|
21
|
-
const headers = {
|
|
22
|
+
const headers = new axios_1.AxiosHeaders({
|
|
22
23
|
"X-Cybozu-Authorization": authToken,
|
|
23
|
-
};
|
|
24
|
+
});
|
|
24
25
|
const expectedCalledWith = {
|
|
25
26
|
headers,
|
|
26
27
|
baseURL: baseUrl,
|
|
@@ -37,15 +38,16 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
37
38
|
basicAuthPassword: null,
|
|
38
39
|
basicAuthUsername: null,
|
|
39
40
|
};
|
|
40
|
-
const headers = {
|
|
41
|
+
const headers = new axios_1.AxiosHeaders({
|
|
41
42
|
"X-Cybozu-Authorization": authToken,
|
|
42
|
-
};
|
|
43
|
+
});
|
|
43
44
|
const expectedCalledWith = {
|
|
44
45
|
headers,
|
|
45
46
|
baseURL: baseUrl,
|
|
46
47
|
proxy: {
|
|
47
48
|
host: "localhost",
|
|
48
49
|
port: 1234,
|
|
50
|
+
protocol: "http:",
|
|
49
51
|
auth: {
|
|
50
52
|
username: "admin",
|
|
51
53
|
password: "password",
|
|
@@ -54,6 +56,29 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
54
56
|
};
|
|
55
57
|
assertConstructorWithArgs(input, expectedCalledWith);
|
|
56
58
|
});
|
|
59
|
+
test("with proxy option and empty proxy authorization", () => {
|
|
60
|
+
const input = {
|
|
61
|
+
baseUrl,
|
|
62
|
+
username: "username",
|
|
63
|
+
password: "password",
|
|
64
|
+
proxy: "https://localhost:1234",
|
|
65
|
+
basicAuthPassword: null,
|
|
66
|
+
basicAuthUsername: null,
|
|
67
|
+
};
|
|
68
|
+
const headers = new axios_1.AxiosHeaders({
|
|
69
|
+
"X-Cybozu-Authorization": authToken,
|
|
70
|
+
});
|
|
71
|
+
const expectedCalledWith = {
|
|
72
|
+
headers,
|
|
73
|
+
baseURL: baseUrl,
|
|
74
|
+
proxy: {
|
|
75
|
+
protocol: "https:",
|
|
76
|
+
host: "localhost",
|
|
77
|
+
port: 1234,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
assertConstructorWithArgs(input, expectedCalledWith);
|
|
81
|
+
});
|
|
57
82
|
test("with basic auth", () => {
|
|
58
83
|
const input = {
|
|
59
84
|
baseUrl,
|
|
@@ -63,10 +88,10 @@ describe("FormsClientImpl#constructor", () => {
|
|
|
63
88
|
basicAuthPassword: "basicUsername",
|
|
64
89
|
basicAuthUsername: "basicPassword",
|
|
65
90
|
};
|
|
66
|
-
const headers = {
|
|
91
|
+
const headers = new axios_1.AxiosHeaders({
|
|
67
92
|
"X-Cybozu-Authorization": authToken,
|
|
68
93
|
Authorization: "Basic YmFzaWNQYXNzd29yZDpiYXNpY1VzZXJuYW1l",
|
|
69
|
-
};
|
|
94
|
+
});
|
|
70
95
|
const expectedCalledWith = {
|
|
71
96
|
headers,
|
|
72
97
|
baseURL: baseUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios-utils.test.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.test.ts"],"names":[],"mappings":";;AAAA,+CAA8D;
|
|
1
|
+
{"version":3,"file":"axios-utils.test.js","sourceRoot":"","sources":["../../../src/kintone/clients/axios-utils.test.ts"],"names":[],"mappings":";;AAAA,+CAA8D;AAE9D,iCAAqC;AAErC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,MAAM,OAAO,GAAG,qBAAqB,CAAC;IACtC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,C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AAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kintone/dts-gen",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Types for kintone js api and Types generating tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"prebuild": "yarn clean",
|
|
8
|
-
"build": "tsc --build --force",
|
|
9
|
-
"postbuild": "bin/npm-build.sh && yarn build:integration",
|
|
10
|
-
"clean": "rimraf dist",
|
|
11
|
-
"fix:eslint": "yarn lint:eslint --fix",
|
|
12
|
-
"fix:prettier": "prettier --parser typescript --write \"src/**/*.{ts,tsx}\" ./kintone.d.ts",
|
|
13
|
-
"fix": "run-p fix:*",
|
|
14
|
-
"lint:eslint": "eslint 'src/**/*.ts' ",
|
|
15
|
-
"lint:prettier": "prettier --parser typescript --check \"src/**/*.{ts,tsx}\" ./kintone.d.ts",
|
|
16
|
-
"lint": "run-p lint:*",
|
|
17
|
-
"demo": "node dist/index.js --demo --type-name DemoFields -o demo-fields.d.ts",
|
|
18
|
-
"help": "node dist/index.js --help",
|
|
19
|
-
"test": "jest",
|
|
20
|
-
"test:ci": "jest --runInBand",
|
|
21
|
-
"build:integration": "webpack --mode development --config webpack.config.js"
|
|
22
|
-
},
|
|
23
6
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
7
|
+
"node": ">=18"
|
|
25
8
|
},
|
|
26
9
|
"author": {
|
|
27
10
|
"name": "Cybozu, Inc.",
|
|
@@ -30,20 +13,21 @@
|
|
|
30
13
|
"license": "MIT",
|
|
31
14
|
"dependencies": {
|
|
32
15
|
"@cybozu/eslint-config": "^18.0.3",
|
|
33
|
-
"axios": "^
|
|
34
|
-
"commander": "^
|
|
35
|
-
"eslint": "^8.
|
|
16
|
+
"axios": "^1.4.0",
|
|
17
|
+
"commander": "^11.0.0",
|
|
18
|
+
"eslint": "^8.46.0",
|
|
36
19
|
"form-data": "^4.0.0",
|
|
37
20
|
"lodash": "^4.17.21",
|
|
38
21
|
"prettier": "^2.8.8"
|
|
39
22
|
},
|
|
40
23
|
"devDependencies": {
|
|
41
|
-
"@types/eslint": "^8.
|
|
42
|
-
"@types/lodash": "^4.14.
|
|
24
|
+
"@types/eslint": "^8.44.3",
|
|
25
|
+
"@types/lodash": "^4.14.199",
|
|
43
26
|
"@types/prettier": "^2.7.3",
|
|
44
27
|
"ts-loader": "^9.4.4",
|
|
45
|
-
"webpack": "^5.88.
|
|
46
|
-
"webpack-cli": "^5.1.4"
|
|
28
|
+
"webpack": "^5.88.2",
|
|
29
|
+
"webpack-cli": "^5.1.4",
|
|
30
|
+
"assert": "^2.1.0"
|
|
47
31
|
},
|
|
48
32
|
"bin": {
|
|
49
33
|
"kintone-dts-gen": "dist/index.js"
|
|
@@ -64,5 +48,21 @@
|
|
|
64
48
|
"keywords": [
|
|
65
49
|
"kintone"
|
|
66
50
|
],
|
|
67
|
-
"
|
|
68
|
-
|
|
51
|
+
"scripts": {
|
|
52
|
+
"prebuild": "pnpm clean",
|
|
53
|
+
"build": "tsc --build --force",
|
|
54
|
+
"postbuild": "bash bin/npm-build.sh && pnpm build:integration",
|
|
55
|
+
"clean": "rimraf dist",
|
|
56
|
+
"fix:eslint": "pnpm lint:eslint --fix",
|
|
57
|
+
"fix:prettier": "prettier --parser typescript --write \"src/**/*.{ts,tsx}\" ./kintone.d.ts",
|
|
58
|
+
"fix": "run-p fix:*",
|
|
59
|
+
"lint:eslint": "eslint 'src/**/*.ts' --max-warnings 0",
|
|
60
|
+
"lint:prettier": "prettier --parser typescript --check \"src/**/*.{ts,tsx}\" ./kintone.d.ts",
|
|
61
|
+
"lint": "run-p lint:*",
|
|
62
|
+
"demo": "node dist/index.js --demo --type-name DemoFields -o demo-fields.d.ts",
|
|
63
|
+
"help": "node dist/index.js --help",
|
|
64
|
+
"test": "jest",
|
|
65
|
+
"test:ci": "jest --runInBand",
|
|
66
|
+
"build:integration": "webpack --mode development --config webpack.config.js"
|
|
67
|
+
}
|
|
68
|
+
}
|