datagrok-tools 4.14.39 → 4.14.41

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.39",
3
+ "version": "4.14.41",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {
@@ -13,6 +13,8 @@ const {
13
13
  dgAnnotationTypes,
14
14
  } = require('../bin/utils/func-generation');
15
15
 
16
+ const {api} = require('../bin/commands/api');
17
+
16
18
  const baseImport = 'import * as DG from \'datagrok-api/dg\';\n';
17
19
  // eslint-disable-next-line max-len
18
20
  const annotationForGeneratedFile = `/**\nThis file is auto-generated by the webpack command.\nIf you notice any changes, please push them to the repository.\nDo not edit this file manually.\n*/\n`;
@@ -85,6 +87,7 @@ class FuncGeneratorPlugin {
85
87
  // Uncommment to add obvious import/export
86
88
  // this._writeToPackageFile(packageFilePath, genImports, genExports);
87
89
  });
90
+ api({_: ['api']});
88
91
  }
89
92
 
90
93
  _addNodeData(
@@ -351,8 +354,10 @@ class FuncGeneratorPlugin {
351
354
  let isArray = false;
352
355
  if (nodeAnnotation?.type === 'TSUnionType' &&
353
356
  nodeAnnotation?.types?.length === 2 &&
354
- nodeAnnotation?.types?.some((e)=> e?.type === 'TSNullKeyword' || e?.type === 'TSVoidKeyword'))
355
- nodeAnnotation = nodeAnnotation.types.filter((e)=> e.type !== 'TSNullKeyword' || e?.type === 'TSVoidKeyword')[0];
357
+ nodeAnnotation?.types?.some((e)=> e?.type === 'TSNullKeyword' || e?.type === 'TSVoidKeyword'|| e?.type === 'TSUndefinedKeyword')) {
358
+ nodeAnnotation =
359
+ nodeAnnotation.types.filter((e)=> e.type !== 'TSNullKeyword' || e?.type === 'TSVoidKeyword' || e?.type === 'TSUndefinedKeyword')[0];
360
+ }
356
361
 
357
362
 
358
363
  if (
@@ -422,6 +427,8 @@ class FuncGeneratorPlugin {
422
427
  return typeNode.typeName.name;
423
428
  else if (typeNode.type === 'TSVoidKeyword')
424
429
  return 'void';
430
+ else if (typeNode.type === 'TSUndefinedKeyword ')
431
+ return 'undefined';
425
432
  else if (typeNode.type === 'TSNumberKeyword')
426
433
  return 'number';
427
434
  else if (typeNode.type === 'TSStringKeyword')