@looker/sdk-codegen 21.11.2 → 21.11.3

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 (52) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/codeGen.js +5 -5
  3. package/lib/codeGen.js.map +1 -1
  4. package/lib/codeGenerators.js.map +1 -1
  5. package/lib/csharp.gen.js +2 -2
  6. package/lib/csharp.gen.js.map +1 -1
  7. package/lib/declarationInfo.js.map +1 -1
  8. package/lib/esm/codeGen.js +6 -5
  9. package/lib/esm/codeGen.js.map +1 -1
  10. package/lib/esm/codeGenerators.js.map +1 -1
  11. package/lib/esm/csharp.gen.js +2 -2
  12. package/lib/esm/csharp.gen.js.map +1 -1
  13. package/lib/esm/declarationInfo.js.map +1 -1
  14. package/lib/esm/exampleInfo.js.map +1 -1
  15. package/lib/esm/go.gen.js +4 -3
  16. package/lib/esm/go.gen.js.map +1 -1
  17. package/lib/esm/index.js.map +1 -1
  18. package/lib/esm/kotlin.gen.js +2 -2
  19. package/lib/esm/kotlin.gen.js.map +1 -1
  20. package/lib/esm/pseudo.gen.js +2 -2
  21. package/lib/esm/pseudo.gen.js.map +1 -1
  22. package/lib/esm/python.gen.js +2 -2
  23. package/lib/esm/python.gen.js.map +1 -1
  24. package/lib/esm/sdkModels.js +37 -36
  25. package/lib/esm/sdkModels.js.map +1 -1
  26. package/lib/esm/specConverter.js +10 -10
  27. package/lib/esm/specConverter.js.map +1 -1
  28. package/lib/esm/specDiff.js.map +1 -1
  29. package/lib/esm/swift.gen.js +2 -2
  30. package/lib/esm/swift.gen.js.map +1 -1
  31. package/lib/esm/typescript.gen.js +2 -2
  32. package/lib/esm/typescript.gen.js.map +1 -1
  33. package/lib/exampleInfo.js.map +1 -1
  34. package/lib/go.gen.js +4 -3
  35. package/lib/go.gen.js.map +1 -1
  36. package/lib/index.js.map +1 -1
  37. package/lib/kotlin.gen.js +2 -2
  38. package/lib/kotlin.gen.js.map +1 -1
  39. package/lib/pseudo.gen.js +2 -2
  40. package/lib/pseudo.gen.js.map +1 -1
  41. package/lib/python.gen.js +2 -2
  42. package/lib/python.gen.js.map +1 -1
  43. package/lib/sdkModels.js +38 -39
  44. package/lib/sdkModels.js.map +1 -1
  45. package/lib/specConverter.js +11 -11
  46. package/lib/specConverter.js.map +1 -1
  47. package/lib/specDiff.js.map +1 -1
  48. package/lib/swift.gen.js +2 -2
  49. package/lib/swift.gen.js.map +1 -1
  50. package/lib/typescript.gen.js +2 -2
  51. package/lib/typescript.gen.js.map +1 -1
  52. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
2
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
- 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; }
4
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  import * as OAS from 'openapi3-ts';
7
7
  import md5 from 'blueimp-md5';
@@ -175,7 +175,7 @@ export var typeRefs = (api, refs) => {
175
175
  });
176
176
  return result;
177
177
  };
178
- export var firstMethodRef = function firstMethodRef(api, type) {
178
+ var _firstMethodRef = function firstMethodRef(api, type) {
179
179
  var stack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
180
180
  stack.add(type.name);
181
181
  var method = methodRefs(api, type.methodRefs)[0];
@@ -183,14 +183,15 @@ export var firstMethodRef = function firstMethodRef(api, type) {
183
183
  var parents = typeRefs(api, type.parentTypes);
184
184
  for (var parent of parents) {
185
185
  if (!stack.has(parent.name)) {
186
- method = firstMethodRef(api, parent, stack);
186
+ method = _firstMethodRef(api, parent, stack);
187
187
  }
188
188
  if (method) break;
189
189
  }
190
190
  }
191
191
  return method;
192
192
  };
193
- var anyWriter = function anyWriter(api, type) {
193
+ export { _firstMethodRef as firstMethodRef };
194
+ var _anyWriter = function anyWriter(api, type) {
194
195
  var stack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();
195
196
  var result;
196
197
  if (stack.has(type.name)) return undefined;
@@ -207,7 +208,7 @@ var anyWriter = function anyWriter(api, type) {
207
208
  allTypes.delete(type.name);
208
209
  var refs = typeRefs(api, allTypes);
209
210
  for (var ref of refs) {
210
- result = anyWriter(api, ref, stack);
211
+ result = _anyWriter(api, ref, stack);
211
212
  if (result) {
212
213
  break;
213
214
  }
@@ -259,7 +260,7 @@ export var tagTypes = (api, types) => {
259
260
  var [name, type] = _ref2;
260
261
  var methods = methodRefs(api, type.methodRefs);
261
262
  if (methods.length === 0) {
262
- var first = firstMethodRef(api, type);
263
+ var first = _firstMethodRef(api, type);
263
264
  if (first) methods = [first];
264
265
  }
265
266
  methods.forEach(method => {
@@ -295,7 +296,7 @@ class MethodResponse {
295
296
  return result;
296
297
  }
297
298
  }
298
- class _Symbol {
299
+ class _Symbol2 {
299
300
  constructor(name, type) {
300
301
  var owner = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
301
302
  this.name = name;
@@ -325,7 +326,7 @@ class _Symbol {
325
326
  return result;
326
327
  }
327
328
  }
328
- class SchemadSymbol extends _Symbol {
329
+ class SchemadSymbol extends _Symbol2 {
329
330
  constructor(name, type, schema) {
330
331
  var owner = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
331
332
  super(name, type, owner);
@@ -1123,16 +1124,16 @@ export class Type {
1123
1124
  var [a] = _ref8;
1124
1125
  var [b] = _ref9;
1125
1126
  return a.localeCompare(b);
1126
- }).forEach(_ref10 => {
1127
- var [, prop] = _ref10;
1127
+ }).forEach(_ref0 => {
1128
+ var [, prop] = _ref0;
1128
1129
  result += prop.asHashString() + ':';
1129
1130
  });
1130
1131
  return result;
1131
1132
  }
1132
1133
  isRecursive() {
1133
1134
  var selfType = this.name;
1134
- return Object.entries(this.properties).some(_ref11 => {
1135
- var [, prop] = _ref11;
1135
+ return Object.entries(this.properties).some(_ref1 => {
1136
+ var [, prop] = _ref1;
1136
1137
  return prop.type.name === selfType;
1137
1138
  });
1138
1139
  }
@@ -1164,8 +1165,8 @@ export class Type {
1164
1165
  if (this.deprecated) result += searchIt('deprecated');
1165
1166
  }
1166
1167
  if (criteria.has(SearchCriterion.property)) {
1167
- Object.entries(this.properties).forEach(_ref12 => {
1168
- var [, prop] = _ref12;
1168
+ Object.entries(this.properties).forEach(_ref10 => {
1169
+ var [, prop] = _ref10;
1169
1170
  if (this.name !== prop.type.name) {
1170
1171
  result += prop.searchString(criteria);
1171
1172
  }
@@ -1350,11 +1351,11 @@ export class WriteType extends Type {
1350
1351
  }
1351
1352
  _defineProperty(WriteType, "readonlyProps", properties => {
1352
1353
  var result = [];
1353
- Object.entries(properties).filter(_ref21 => {
1354
- var [, prop] = _ref21;
1354
+ Object.entries(properties).filter(_ref19 => {
1355
+ var [, prop] = _ref19;
1355
1356
  return prop.readOnly || prop.type.readOnly;
1356
- }).forEach(_ref22 => {
1357
- var [, prop] = _ref22;
1357
+ }).forEach(_ref20 => {
1358
+ var [, prop] = _ref20;
1358
1359
  return result.push(prop);
1359
1360
  });
1360
1361
  return result;
@@ -1434,8 +1435,8 @@ export class ApiModel {
1434
1435
  return result;
1435
1436
  }
1436
1437
  if (ApiModel.isMethodSearch(criteria)) {
1437
- Object.entries(this.methods).forEach(_ref13 => {
1438
- var [, method] = _ref13;
1438
+ Object.entries(this.methods).forEach(_ref11 => {
1439
+ var [, method] = _ref11;
1439
1440
  if (method.search(rx, criteria)) {
1440
1441
  methodCount++;
1441
1442
  ApiModel.addMethodToTags(tags, method);
@@ -1443,8 +1444,8 @@ export class ApiModel {
1443
1444
  });
1444
1445
  }
1445
1446
  if (ApiModel.isTypeSearch(criteria)) {
1446
- Object.entries(this.types).forEach(_ref14 => {
1447
- var [key, type] = _ref14;
1447
+ Object.entries(this.types).forEach(_ref12 => {
1448
+ var [key, type] = _ref12;
1448
1449
  if (!rx) {
1449
1450
  throw Error("".concat(key, " rx undefined"));
1450
1451
  }
@@ -1598,9 +1599,9 @@ export class ApiModel {
1598
1599
  if (type.intrinsic) return undefined;
1599
1600
  if ((_type$elementType = type.elementType) !== null && _type$elementType !== void 0 && _type$elementType.intrinsic) return undefined;
1600
1601
  if (type instanceof WriteType) return type;
1601
- if (!anyWriter(this, type)) return undefined;
1602
- var props = Object.entries(type.properties).map(_ref15 => {
1603
- var [, prop] = _ref15;
1602
+ if (!_anyWriter(this, type)) return undefined;
1603
+ var props = Object.entries(type.properties).map(_ref13 => {
1604
+ var [, prop] = _ref13;
1604
1605
  return prop;
1605
1606
  });
1606
1607
  if (props.length === 0) return undefined;
@@ -1621,8 +1622,8 @@ export class ApiModel {
1621
1622
  return result;
1622
1623
  }
1623
1624
  loadDynamicTypes() {
1624
- Object.entries(this.methods).forEach(_ref16 => {
1625
- var [, method] = _ref16;
1625
+ Object.entries(this.methods).forEach(_ref14 => {
1626
+ var [, method] = _ref14;
1626
1627
  method.makeTypes(this);
1627
1628
  });
1628
1629
  }
@@ -1647,8 +1648,8 @@ export class ApiModel {
1647
1648
  load() {
1648
1649
  var _this$spec3, _this$spec3$component, _this$spec4;
1649
1650
  if ((_this$spec3 = this.spec) !== null && _this$spec3 !== void 0 && (_this$spec3$component = _this$spec3.components) !== null && _this$spec3$component !== void 0 && _this$spec3$component.schemas) {
1650
- Object.entries(this.spec.components.schemas).forEach(_ref17 => {
1651
- var [name, schema] = _ref17;
1651
+ Object.entries(this.spec.components.schemas).forEach(_ref15 => {
1652
+ var [name, schema] = _ref15;
1652
1653
  var t = new Type(schema, name);
1653
1654
  this.types[name] = t;
1654
1655
  this.refs["#/components/schemas/".concat(name)] = t;
@@ -1670,8 +1671,8 @@ export class ApiModel {
1670
1671
  });
1671
1672
  }
1672
1673
  if ((_this$spec4 = this.spec) !== null && _this$spec4 !== void 0 && _this$spec4.paths) {
1673
- Object.entries(this.spec.paths).forEach(_ref18 => {
1674
- var [path, schema] = _ref18;
1674
+ Object.entries(this.spec.paths).forEach(_ref16 => {
1675
+ var [path, schema] = _ref16;
1675
1676
  var methods = this.loadMethods(path, schema);
1676
1677
  methods.forEach(method => {
1677
1678
  this.methods[method.name] = method;
@@ -1703,12 +1704,12 @@ export class ApiModel {
1703
1704
  }
1704
1705
  methodResponses(schema) {
1705
1706
  var responses = [];
1706
- Object.entries(schema.responses).forEach(_ref19 => {
1707
- var [statusCode, contentSchema] = _ref19;
1707
+ Object.entries(schema.responses).forEach(_ref17 => {
1708
+ var [statusCode, contentSchema] = _ref17;
1708
1709
  var desc = contentSchema.description || '';
1709
1710
  if (contentSchema.content) {
1710
- Object.entries(contentSchema.content).forEach(_ref20 => {
1711
- var [mediaType, response] = _ref20;
1711
+ Object.entries(contentSchema.content).forEach(_ref18 => {
1712
+ var [mediaType, response] = _ref18;
1712
1713
  responses.push(new MethodResponse(parseInt(statusCode, 10), mediaType, this.resolveType(response.schema || {}), desc));
1713
1714
  });
1714
1715
  } else if (statusCode === '204') {