@looker/sdk-codegen 21.7.3 → 21.8.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/codeGen.d.ts +1 -1
  3. package/lib/codeGen.js +28 -154
  4. package/lib/codeGen.js.map +1 -1
  5. package/lib/codeGenerators.js +0 -16
  6. package/lib/codeGenerators.js.map +1 -1
  7. package/lib/csharp.gen.js +3 -71
  8. package/lib/csharp.gen.js.map +1 -1
  9. package/lib/declarationInfo.js +0 -7
  10. package/lib/declarationInfo.js.map +1 -1
  11. package/lib/esm/codeGen.js +48 -157
  12. package/lib/esm/codeGen.js.map +1 -1
  13. package/lib/esm/codeGenerators.js +28 -20
  14. package/lib/esm/codeGenerators.js.map +1 -1
  15. package/lib/esm/csharp.gen.js +19 -75
  16. package/lib/esm/csharp.gen.js.map +1 -1
  17. package/lib/esm/declarationInfo.js +10 -7
  18. package/lib/esm/declarationInfo.js.map +1 -1
  19. package/lib/esm/exampleInfo.js +24 -23
  20. package/lib/esm/exampleInfo.js.map +1 -1
  21. package/lib/esm/go.gen.js +18 -92
  22. package/lib/esm/go.gen.js.map +1 -1
  23. package/lib/esm/index.js +148 -13
  24. package/lib/esm/index.js.map +1 -1
  25. package/lib/esm/kotlin.gen.js +23 -118
  26. package/lib/esm/kotlin.gen.js.map +1 -1
  27. package/lib/esm/pseudo.gen.js +14 -24
  28. package/lib/esm/pseudo.gen.js.map +1 -1
  29. package/lib/esm/python.gen.js +19 -138
  30. package/lib/esm/python.gen.js.map +1 -1
  31. package/lib/esm/sdkModels.js +100 -432
  32. package/lib/esm/sdkModels.js.map +1 -1
  33. package/lib/esm/specConverter.js +58 -88
  34. package/lib/esm/specConverter.js.map +1 -1
  35. package/lib/esm/specDiff.js +36 -51
  36. package/lib/esm/specDiff.js.map +1 -1
  37. package/lib/esm/swift.gen.js +25 -137
  38. package/lib/esm/swift.gen.js.map +1 -1
  39. package/lib/esm/testUtils/index.js +17 -0
  40. package/lib/esm/testUtils/index.js.map +1 -0
  41. package/lib/esm/testUtils/testUtils.js +66 -0
  42. package/lib/esm/testUtils/testUtils.js.map +1 -0
  43. package/lib/esm/typescript.gen.js +24 -125
  44. package/lib/esm/typescript.gen.js.map +1 -1
  45. package/lib/exampleInfo.js +1 -31
  46. package/lib/exampleInfo.js.map +1 -1
  47. package/lib/go.gen.js +3 -87
  48. package/lib/go.gen.js.map +1 -1
  49. package/lib/index.js +0 -26
  50. package/lib/index.js.map +1 -1
  51. package/lib/kotlin.gen.js +7 -113
  52. package/lib/kotlin.gen.js.map +1 -1
  53. package/lib/pseudo.gen.js +3 -24
  54. package/lib/pseudo.gen.js.map +1 -1
  55. package/lib/python.gen.js +3 -133
  56. package/lib/python.gen.js.map +1 -1
  57. package/lib/sdkModels.js +8 -438
  58. package/lib/sdkModels.js.map +1 -1
  59. package/lib/specConverter.js +6 -106
  60. package/lib/specConverter.js.map +1 -1
  61. package/lib/specDiff.js +1 -56
  62. package/lib/specDiff.js.map +1 -1
  63. package/lib/swift.gen.js +3 -128
  64. package/lib/swift.gen.js.map +1 -1
  65. package/lib/testUtils/index.js +0 -2
  66. package/lib/testUtils/index.js.map +1 -1
  67. package/lib/testUtils/testUtils.js +1 -17
  68. package/lib/testUtils/testUtils.js.map +1 -1
  69. package/lib/typescript.gen.js +5 -117
  70. package/lib/typescript.gen.js.map +1 -1
  71. package/package.json +3 -3
@@ -1,8 +1,15 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
- import { DelimArray } from '@looker/sdk-rtl';
4
- import { ArrayType, EnumType, HashType, mayQuote, strBody, Type } from './sdkModels';
5
- export var commentBlock = function commentBlock(text) {
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.trimInputs = exports.commentBlock = exports.CodeGen = void 0;
7
+ var _sdkRtl = require("@looker/sdk-rtl");
8
+ var _sdkModels = require("./sdkModels");
9
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
+ var commentBlock = function commentBlock(text) {
6
13
  var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
7
14
  var commentStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '// ';
8
15
  if (!text || !text.trim()) return '';
@@ -10,129 +17,89 @@ export var commentBlock = function commentBlock(text) {
10
17
  var lines = text.split('\n').map(x => "".concat(indentation).concat(x).trimRight());
11
18
  return lines.join('\n');
12
19
  };
13
- export var trimInputs = function trimInputs(inputs) {
14
- var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
15
-
20
+ exports.commentBlock = commentBlock;
21
+ var trimInputs = function trimInputs(inputs) {
22
+ var keepBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
23
+ var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
16
24
  function isEmpty(value, depth) {
17
25
  if (Array.isArray(value)) return value.length === 0;
18
26
  if (value === undefined) return true;
19
27
  if (value === null) return true;
20
28
  if (value === '') return true;
21
-
22
29
  if (value instanceof Object) {
23
30
  if (depth === 1) {
24
31
  return false;
25
32
  }
26
-
27
33
  return Object.keys(value).length === 0;
28
34
  }
29
-
30
35
  return false;
31
36
  }
32
-
33
37
  var result;
34
- if (inputs instanceof DelimArray) return inputs;
35
-
38
+ if (inputs instanceof _sdkRtl.DelimArray) return inputs;
36
39
  if (Array.isArray(inputs)) {
37
40
  result = [];
38
- Object.values(inputs).forEach(v => result.push(trimInputs(v, depth + 1)));
41
+ Object.values(inputs).forEach(v => result.push(trimInputs(v, keepBody, depth + 1)));
39
42
  } else if (inputs instanceof Object) {
40
- result = {};
41
- Object.entries(inputs).forEach(_ref => {
42
- var [key, value] = _ref;
43
- var trimmed = trimInputs(value, depth + 1);
44
-
45
- if (!isEmpty(trimmed, depth + 1)) {
46
- result[key] = trimmed;
47
- }
48
- });
43
+ if (keepBody && depth > 0) {
44
+ result = inputs;
45
+ } else {
46
+ result = {};
47
+ Object.entries(inputs).forEach(_ref => {
48
+ var [key, value] = _ref;
49
+ var trimmed = trimInputs(value, keepBody, depth + 1);
50
+ if (!isEmpty(trimmed, depth + 1)) {
51
+ result[key] = trimmed;
52
+ }
53
+ });
54
+ }
49
55
  } else {
50
56
  result = inputs;
51
57
  }
52
-
53
58
  return result;
54
59
  };
55
- export class CodeGen {
60
+ exports.trimInputs = trimInputs;
61
+ class CodeGen {
56
62
  constructor(api, versions) {
57
63
  this.api = api;
58
64
  this.versions = versions;
59
-
60
65
  _defineProperty(this, "willItStream", false);
61
-
62
66
  _defineProperty(this, "anyString", false);
63
-
64
67
  _defineProperty(this, "codePath", './');
65
-
66
68
  _defineProperty(this, "packagePath", 'looker');
67
-
68
69
  _defineProperty(this, "sdkPath", 'sdk');
69
-
70
70
  _defineProperty(this, "packageName", 'LookerSDK');
71
-
72
71
  _defineProperty(this, "environmentPrefix", this.packageName.toUpperCase());
73
-
74
72
  _defineProperty(this, "itself", '');
75
-
76
73
  _defineProperty(this, "fileExtension", '.code');
77
-
78
74
  _defineProperty(this, "argDelimiter", ', ');
79
-
80
75
  _defineProperty(this, "paramDelimiter", ',\n');
81
-
82
76
  _defineProperty(this, "propDelimiter", '\n');
83
-
84
77
  _defineProperty(this, "enumDelimiter", ',\n');
85
-
86
78
  _defineProperty(this, "codeQuote", "'");
87
-
88
79
  _defineProperty(this, "useNamedParameters", true);
89
-
90
80
  _defineProperty(this, "useNamedArguments", true);
91
-
92
81
  _defineProperty(this, "useFunctions", false);
93
-
94
82
  _defineProperty(this, "useInterfaces", false);
95
-
96
83
  _defineProperty(this, "argSetSep", ': ');
97
-
98
84
  _defineProperty(this, "hashSetSep", ': ');
99
-
100
85
  _defineProperty(this, "arrayOpen", '[');
101
-
102
86
  _defineProperty(this, "arrayClose", ']');
103
-
104
87
  _defineProperty(this, "hashOpen", '{');
105
-
106
88
  _defineProperty(this, "hashClose", '}');
107
-
108
89
  _defineProperty(this, "hashKeyQuote", '');
109
-
110
90
  _defineProperty(this, "typeOpen", '{');
111
-
112
91
  _defineProperty(this, "typeClose", '}');
113
-
114
92
  _defineProperty(this, "useModelClassForTypes", false);
115
-
116
93
  _defineProperty(this, "indentStr", ' ');
117
-
118
94
  _defineProperty(this, "commentStr", '// ');
119
-
120
95
  _defineProperty(this, "noComment", false);
121
-
122
96
  _defineProperty(this, "nullStr", 'null');
123
-
124
97
  _defineProperty(this, "endTypeStr", '');
125
-
126
98
  _defineProperty(this, "transport", 'rtl');
127
-
128
99
  _defineProperty(this, "apiVersion", '');
129
-
130
100
  _defineProperty(this, "apiRef", '');
131
-
132
101
  _defineProperty(this, "apiPath", '');
133
-
134
102
  _defineProperty(this, "defaultAsVal", (_, v) => v.toString());
135
-
136
103
  if (versions && versions.spec) {
137
104
  this.apiVersion = versions.spec.version;
138
105
  this.apiPath = "/".concat(versions.spec.key);
@@ -141,110 +108,87 @@ export class CodeGen {
141
108
  this.packagePath += this.apiPath;
142
109
  }
143
110
  }
144
-
145
111
  reset() {}
146
-
147
112
  supportsMultiApi() {
148
113
  return true;
149
114
  }
150
-
151
115
  functionsPrologue(_indent) {
152
116
  return '';
153
117
  }
154
-
155
118
  functionsEpilogue(_indent) {
156
119
  return '';
157
120
  }
158
-
159
121
  interfacesPrologue(_indent) {
160
122
  return '';
161
123
  }
162
-
163
124
  reserve(name) {
164
125
  return name;
165
126
  }
166
-
167
127
  streamsPrologue(_indent) {
168
128
  return '';
169
129
  }
170
-
171
130
  quote(value) {
172
131
  return "".concat(this.codeQuote).concat(value).concat(this.codeQuote);
173
132
  }
174
-
175
133
  declareEnumValue(indent, value) {
176
134
  var quote = typeof value === 'string' ? this.codeQuote : '';
177
- return "".concat(indent).concat(mayQuote(value), " = ").concat(quote).concat(value).concat(quote);
135
+ return "".concat(indent).concat((0, _sdkModels.mayQuote)(value), " = ").concat(quote).concat(value).concat(quote);
178
136
  }
179
-
180
137
  functionSignature(_indent, _method) {
181
138
  return '';
182
139
  }
183
-
184
140
  declareFunction(_indent, _method) {
185
141
  return '';
186
142
  }
187
-
188
143
  declareInterface(_indent, _method) {
189
144
  return '';
190
145
  }
191
-
192
146
  argIndent(indent, args, opener, closer) {
193
147
  var bump = this.bumper(indent);
194
148
  var open = opener;
195
149
  var close = closer;
196
150
  var delim = this.argDelimiter;
197
-
198
151
  if (args.length > 1) {
199
152
  open = "".concat(opener, "\n").concat(bump);
200
153
  close = "\n".concat(indent).concat(closer);
201
154
  delim = "".concat(this.argDelimiter.trim(), "\n").concat(bump);
202
155
  }
203
-
204
156
  return "".concat(open).concat(args.join(delim)).concat(close);
205
157
  }
206
-
207
158
  argValue(indent, arg, inputs) {
208
159
  if (!(arg.name in inputs)) return '';
209
160
  var val = inputs[arg.name];
210
161
  var argType = this.writeableType(arg.type) || arg.type;
211
162
  var mt = this.typeMap(argType);
212
163
  var argVal;
213
-
214
164
  if (mt.asVal) {
215
165
  argVal = mt.asVal(indent, val);
216
- } else if (argType instanceof ArrayType) {
166
+ } else if (argType instanceof _sdkModels.ArrayType) {
217
167
  argVal = this.arrayValue(indent, argType, val);
218
- } else if (argType instanceof HashType) {
168
+ } else if (argType instanceof _sdkModels.HashType) {
219
169
  argVal = this.hashValue(indent, val);
220
170
  } else if (!argType.intrinsic) {
221
171
  argVal = this.assignType(indent, argType, val);
222
172
  } else {
223
173
  argVal = this.defaultAsVal(indent, val);
224
174
  }
225
-
226
175
  return argVal;
227
176
  }
228
-
229
177
  assignParams(method, inputs) {
230
178
  var args = [];
231
179
  var hasComplexArg = false;
232
-
233
180
  if (Object.keys(inputs).length > 0) {
234
181
  var requestType;
235
-
236
182
  if (!this.useNamedArguments && (requestType = this.api.getRequestType(method))) {
237
183
  args.push(this.assignType(this.indentStr, requestType, inputs));
238
184
  hasComplexArg = true;
239
185
  } else {
240
- method.allParams.forEach(p => {
186
+ var params = method.allParams;
187
+ params.forEach(p => {
241
188
  var v = this.argValue(this.indentStr, p, inputs);
242
-
243
189
  if (v !== '') {
244
190
  var _arg = this.useNamedArguments ? "".concat(p.name, "=").concat(v) : v;
245
-
246
191
  args.push(_arg);
247
-
248
192
  if (!p.type.intrinsic) {
249
193
  hasComplexArg = true;
250
194
  }
@@ -252,34 +196,32 @@ export class CodeGen {
252
196
  });
253
197
  }
254
198
  }
255
-
256
199
  var open = '';
257
-
258
200
  if (args.length > 1 || hasComplexArg) {
259
201
  open = "\n".concat(this.indentStr);
260
202
  }
261
-
262
203
  return args.length > 0 ? "".concat(open).concat(args.join(this.argDelimiter)) : '';
263
204
  }
264
-
265
205
  argSet(name, sep, exp) {
266
206
  return "".concat(name).concat(sep).concat(exp);
267
207
  }
268
-
269
208
  assignType(indent, type, inputs) {
270
209
  var mt = this.typeMap(type);
271
210
  var args = [];
272
211
  var bump = this.bumper(indent);
273
- Object.values(type.properties).forEach(p => {
212
+ var props = Object.values(type.properties);
213
+ props.forEach(p => {
274
214
  var v = this.argValue(bump, p, inputs);
275
215
  if (v) args.push(this.argSet(p.name, this.argSetSep, v));
276
216
  });
277
- if (args.length === 0) return '';
278
217
  var open = this.useModelClassForTypes ? "".concat(mt.name).concat(this.typeOpen) : this.typeOpen;
279
218
  var nl = ",\n".concat(bump);
280
- return "".concat(open, "\n").concat(bump).concat(args.join(nl), "\n").concat(indent).concat(this.typeClose);
219
+ var joined = "\n".concat(bump).concat(args.join(nl), "\n").concat(indent);
220
+ if (joined.trim().length === 0) {
221
+ joined = '';
222
+ }
223
+ return "".concat(open).concat(joined).concat(this.typeClose);
281
224
  }
282
-
283
225
  arrayValue(indent, type, val) {
284
226
  var ra = type;
285
227
  var et = ra.elementType;
@@ -287,47 +229,36 @@ export class CodeGen {
287
229
  var open = this.arrayOpen;
288
230
  var close = this.arrayClose;
289
231
  var arrayValDelimiter = this.argDelimiter;
290
-
291
232
  if (val.length > 1 || !et.intrinsic) {
292
233
  open = "".concat(open, "\n").concat(bump);
293
234
  close = "\n".concat(indent).concat(close);
294
235
  arrayValDelimiter = "".concat(arrayValDelimiter.trim(), "\n").concat(bump);
295
236
  }
296
-
297
237
  var args = [];
298
238
  var asVal = this.defaultAsVal;
299
239
  var mt = this.typeMap(et);
300
-
301
240
  if (et.intrinsic) {
302
241
  asVal = mt.asVal || asVal;
303
242
  } else {
304
243
  asVal = (i, v) => this.assignType(i, et, v);
305
244
  }
306
-
307
245
  val.forEach(v => args.push(asVal(bump, v)));
308
246
  return open + args.join(arrayValDelimiter) + close;
309
247
  }
310
-
311
248
  anyValue(indent, val) {
312
- if (val instanceof Type) return this.assignType(indent, val, val);
313
-
249
+ if (val instanceof _sdkModels.Type) return this.assignType(indent, val, val);
314
250
  switch (typeof val) {
315
251
  case 'bigint':
316
252
  case 'number':
317
253
  return val.toString();
318
-
319
254
  case 'boolean':
320
255
  return val ? 'true' : 'false';
321
-
322
256
  case 'string':
323
257
  return this.quote(val);
324
-
325
258
  case 'undefined':
326
259
  return '';
327
-
328
260
  case 'function':
329
261
  return '';
330
-
331
262
  case 'object':
332
263
  {
333
264
  if (Array.isArray(val)) {
@@ -340,14 +271,11 @@ export class CodeGen {
340
271
  return this.hashValue(indent, val);
341
272
  }
342
273
  }
343
-
344
274
  case 'symbol':
345
275
  return val.toString();
346
276
  }
347
-
348
277
  return val.toString();
349
278
  }
350
-
351
279
  hashValue(indent, val) {
352
280
  var args = [];
353
281
  var bump = this.bumper(indent);
@@ -359,96 +287,75 @@ export class CodeGen {
359
287
  });
360
288
  return this.argIndent(indent, args, this.hashOpen, this.hashClose);
361
289
  }
362
-
363
290
  paramMappedType(param, method) {
364
- var type = param.location === strBody ? this.writeableType(param.type, method) || param.type : param.type;
291
+ var type = param.location === _sdkModels.strBody ? this.writeableType(param.type, method) || param.type : param.type;
365
292
  return this.typeMap(type);
366
293
  }
367
-
368
294
  makeTheCall(_method, _inputs) {
369
295
  return this.commentHeader('', "Not yet available");
370
296
  }
371
-
372
297
  beginRegion(indent, description) {
373
298
  return "".concat(indent, "#region ").concat(description);
374
299
  }
375
-
376
300
  endRegion(indent, description) {
377
301
  return "".concat(indent, "#endregion ").concat(description);
378
302
  }
379
-
380
303
  warnEditing() {
381
304
  return 'NOTE: Do not edit this file generated by Looker SDK Codegen' + (this.apiVersion ? " for API ".concat(this.apiVersion) : '');
382
305
  }
383
-
384
306
  streamerSignature(_indent, _method) {
385
307
  return '';
386
308
  }
387
-
388
309
  declareStreamer(_indent, _method) {
389
310
  return '';
390
311
  }
391
-
392
312
  initArg(_indent, _property) {
393
313
  return '';
394
314
  }
395
-
396
315
  construct(_indent, _type) {
397
316
  return '';
398
317
  }
399
-
400
318
  bumper(indent) {
401
319
  return indent + this.indentStr;
402
320
  }
403
-
404
321
  describeProperty(property) {
405
322
  return "".concat(property.description).concat(property.readOnly ? ' (read-only)' : '');
406
323
  }
407
-
408
324
  sdkFileName(baseFileName) {
409
325
  return this.fileName("".concat(this.sdkPath, "/").concat(this.apiVersion, "/").concat(baseFileName));
410
326
  }
411
-
412
327
  fileName(base) {
413
328
  return "".concat(this.codePath).concat(this.packagePath, "/").concat(base).concat(this.fileExtension);
414
329
  }
415
-
416
330
  comment(indent, description) {
417
331
  if (this.noComment) return '';
418
332
  return commentBlock(description, indent, this.commentStr);
419
333
  }
420
-
421
334
  commentHeader(indent, text, _commentStr) {
422
335
  if (this.noComment) return '';
423
336
  return text ? "".concat(this.comment(indent, text), "\n") : '';
424
337
  }
425
-
426
338
  declareParameters(indent, method) {
427
339
  var params = method.allParams;
428
340
  var items = [];
429
341
  if (params) params.forEach(p => items.push(this.declareParameter(indent, method, p)));
430
342
  return items.join(this.paramDelimiter);
431
343
  }
432
-
433
344
  declareConstructorArg(indent, property) {
434
345
  return "".concat(indent).concat(property.name).concat(property.nullable ? ' = ' + this.nullStr : '');
435
346
  }
436
-
437
347
  it(value) {
438
348
  return this.itself ? "".concat(this.itself, ".").concat(value) : value;
439
349
  }
440
-
441
350
  typeProperties(type) {
442
351
  return Object.values(type.properties);
443
352
  }
444
-
445
353
  declareType(indent, type) {
446
354
  var bump = this.bumper(indent);
447
355
  var props = [];
448
356
  var propertyValues = '';
449
-
450
357
  try {
451
- if (type instanceof EnumType) {
358
+ if (type instanceof _sdkModels.EnumType) {
452
359
  var num = type;
453
360
  num.values.forEach(value => props.push(this.declareEnumValue(bump, value)));
454
361
  propertyValues = props.join(this.enumDelimiter);
@@ -459,32 +366,25 @@ export class CodeGen {
459
366
  } catch (_unused) {
460
367
  throw new Error(JSON.stringify(type, null, 2));
461
368
  }
462
-
463
369
  return this.typeSignature(indent, type) + propertyValues + this.construct(indent, type) + "".concat(this.endTypeStr ? indent : '').concat(this.endTypeStr);
464
370
  }
465
-
466
371
  argGroup(indent, args, prefix) {
467
372
  prefix = prefix || '';
468
373
  return args && args.length !== 0 ? "".concat(indent, "[").concat(prefix).concat(args.join(this.argDelimiter + prefix), "]") : this.nullStr;
469
374
  }
470
-
471
375
  argList(indent, args, prefix) {
472
376
  prefix = prefix || '';
473
377
  return args && args.length !== 0 ? "".concat(indent).concat(prefix).concat(args.join(this.argDelimiter + prefix)) : this.nullStr;
474
378
  }
475
-
476
379
  argFill(current, args) {
477
380
  if (!current && args.trim() === this.nullStr) {
478
381
  return '';
479
382
  }
480
-
481
383
  return "".concat(args).concat(current ? this.argDelimiter : '').concat(current);
482
384
  }
483
-
484
385
  httpPath(path, _prefix) {
485
386
  return path;
486
387
  }
487
-
488
388
  httpArgs(indent, method) {
489
389
  var result = this.argFill('', this.argGroup(indent, method.cookieArgs));
490
390
  result = this.argFill(result, this.argGroup(indent, method.headerArgs));
@@ -492,28 +392,23 @@ export class CodeGen {
492
392
  result = this.argFill(result, this.argGroup(indent, method.queryArgs));
493
393
  return result;
494
394
  }
495
-
496
395
  errorResponses(_indent, method) {
497
396
  var results = method.errorResponses.map(r => "".concat(r.type.name));
498
397
  return results.join(', ');
499
398
  }
500
-
501
399
  httpCall(indent, method) {
502
400
  var bump = indent + this.indentStr;
503
401
  var args = this.httpArgs(bump, method);
504
402
  var errors = "(".concat(this.errorResponses(indent, method), ")");
505
403
  return "".concat(indent, "return ").concat(this.it(this.transport), ".").concat(method.httpMethod.toLowerCase(), "(").concat(errors, ", \"").concat(method.endpoint, "\"").concat(args ? ', ' + args : '', ")");
506
404
  }
507
-
508
405
  streamCall(_indent, _method) {
509
406
  return '';
510
407
  }
511
-
512
408
  useRequest(method) {
513
409
  if (this.useNamedParameters) return false;
514
410
  return method.eligibleForRequestType();
515
411
  }
516
-
517
412
  requestTypeName(method) {
518
413
  if (!this.useRequest(method)) return '';
519
414
  var request = this.api.getRequestType(method);
@@ -522,7 +417,6 @@ export class CodeGen {
522
417
  method.addType(this.api, request);
523
418
  return request.name;
524
419
  }
525
-
526
420
  writeableType(type, method) {
527
421
  if (!type) return undefined;
528
422
  var writer = this.api.mayGetWriteableType(type);
@@ -531,16 +425,13 @@ export class CodeGen {
531
425
  if (method) method.addType(this.api, writer);
532
426
  return writer;
533
427
  }
534
-
535
428
  typeNames() {
536
429
  var _countError = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
537
-
538
430
  var items = [];
539
431
  if (!this.api) return items;
540
432
  Object.values(this.api.types).filter(type => type.refCount > 0 && !type.intrinsic).forEach(type => items.push(type.name));
541
433
  return items;
542
434
  }
543
-
544
435
  typeMap(type) {
545
436
  type.refCount++;
546
437
  return {
@@ -548,6 +439,6 @@ export class CodeGen {
548
439
  name: type.name || ''
549
440
  };
550
441
  }
551
-
552
442
  }
443
+ exports.CodeGen = CodeGen;
553
444
  //# sourceMappingURL=codeGen.js.map