@vkontakte/api-schema-typescript-generator 0.14.0 → 0.15.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/.github/CODEOWNERS
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
.yarnrc @VKCOM/vk-sec
|
|
1
|
+
.github/dependabot.yml @VKCOM/vk-sec
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: 'npm'
|
|
4
|
+
directory: '/'
|
|
5
|
+
schedule:
|
|
6
|
+
interval: 'daily'
|
|
7
|
+
allow:
|
|
8
|
+
- dependency-type: 'direct'
|
|
9
|
+
reviewers:
|
|
10
|
+
- 'VKCOM/vk-sec'
|
|
11
|
+
|
|
12
|
+
- package-ecosystem: 'github-actions'
|
|
13
|
+
directory: '/'
|
|
14
|
+
schedule:
|
|
15
|
+
interval: 'daily'
|
|
16
|
+
reviewers:
|
|
17
|
+
- 'VKCOM/vk-sec'
|
|
@@ -11,13 +11,15 @@ jobs:
|
|
|
11
11
|
publish:
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
15
|
with:
|
|
16
16
|
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
|
|
17
17
|
|
|
18
|
-
- uses: actions/setup-node@
|
|
18
|
+
- uses: actions/setup-node@v3
|
|
19
19
|
with:
|
|
20
|
-
node-version:
|
|
20
|
+
node-version: 18
|
|
21
|
+
cache: 'yarn'
|
|
22
|
+
always-auth: true
|
|
21
23
|
registry-url: 'https://registry.npmjs.org'
|
|
22
24
|
|
|
23
25
|
- run: yarn install --frozen-lockfile
|
|
@@ -6,11 +6,12 @@ jobs:
|
|
|
6
6
|
test:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
steps:
|
|
9
|
-
- uses: actions/checkout@
|
|
9
|
+
- uses: actions/checkout@v3
|
|
10
10
|
|
|
11
|
-
- uses: actions/setup-node@
|
|
11
|
+
- uses: actions/setup-node@v3
|
|
12
12
|
with:
|
|
13
|
-
node-version:
|
|
13
|
+
node-version: 18
|
|
14
|
+
cache: 'yarn'
|
|
14
15
|
|
|
15
16
|
- run: yarn install --frozen-lockfile
|
|
16
17
|
|
|
@@ -215,24 +215,26 @@ class APITypingsGenerator {
|
|
|
215
215
|
}
|
|
216
216
|
this.generatedObjects[object.name] = true;
|
|
217
217
|
let result = false;
|
|
218
|
-
if (
|
|
218
|
+
if (object.ref) {
|
|
219
219
|
result = this.getPrimitiveInterfaceCode(object);
|
|
220
220
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
221
|
+
else {
|
|
222
|
+
switch (object.type) {
|
|
223
|
+
case 'object':
|
|
224
|
+
result = this.getObjectInterfaceCode(object);
|
|
225
|
+
break;
|
|
226
|
+
case 'string':
|
|
227
|
+
case 'number':
|
|
228
|
+
case 'integer':
|
|
229
|
+
case 'array':
|
|
230
|
+
case 'boolean':
|
|
231
|
+
result = this.getPrimitiveInterfaceCode(object);
|
|
232
|
+
break;
|
|
233
|
+
default:
|
|
234
|
+
if (!result) {
|
|
235
|
+
log_1.consoleLogErrorAndExit(helpers_1.getInterfaceName(object.name), 'Unknown type of object', object);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
236
238
|
}
|
|
237
239
|
if (!result) {
|
|
238
240
|
log_1.consoleLogErrorAndExit('empty object result', object);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/api-schema-typescript-generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "VK API TypeScript generator",
|
|
6
6
|
"author": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/jest": "^28.1.5",
|
|
49
49
|
"@types/node": "^14.0.13",
|
|
50
50
|
"@typescript-eslint/eslint-plugin": "5.30.6",
|
|
51
|
-
"@typescript-eslint/parser": "5.
|
|
51
|
+
"@typescript-eslint/parser": "5.62.0",
|
|
52
52
|
"@vkontakte/eslint-config": "3.1.0",
|
|
53
53
|
"eslint": "8.19.0",
|
|
54
54
|
"eslint-plugin-react": "7.30.1",
|
|
@@ -297,27 +297,27 @@ export class APITypingsGenerator {
|
|
|
297
297
|
|
|
298
298
|
let result: GeneratorResultInterface | false = false;
|
|
299
299
|
|
|
300
|
-
if (
|
|
300
|
+
if (object.ref) {
|
|
301
301
|
result = this.getPrimitiveInterfaceCode(object);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
302
|
+
} else {
|
|
303
|
+
switch (object.type) {
|
|
304
|
+
case 'object':
|
|
305
|
+
result = this.getObjectInterfaceCode(object);
|
|
306
|
+
break;
|
|
307
|
+
|
|
308
|
+
case 'string':
|
|
309
|
+
case 'number':
|
|
310
|
+
case 'integer':
|
|
311
|
+
case 'array':
|
|
312
|
+
case 'boolean':
|
|
313
|
+
result = this.getPrimitiveInterfaceCode(object);
|
|
314
|
+
break;
|
|
315
|
+
|
|
316
|
+
default:
|
|
317
|
+
if (!result) {
|
|
318
|
+
consoleLogErrorAndExit(getInterfaceName(object.name), 'Unknown type of object', object);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
if (!result) {
|