@looker/sdk-codegen 21.6.0 → 21.7.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/CHANGELOG.md +8 -1
- package/lib/esm/sdkModels.js +10 -16
- package/lib/esm/sdkModels.js.map +1 -1
- package/lib/sdkModels.d.ts +4 -4
- package/lib/sdkModels.js +10 -16
- package/lib/sdkModels.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [21.7.0](https://www.github.com/looker-open-source/sdk-codegen/compare/sdk-codegen-v21.6.0...sdk-codegen-v21.7.0) (2022-07-29)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* keep SDK request interfaces distinct ([#1125](https://www.github.com/looker-open-source/sdk-codegen/issues/1125)) ([50e925c](https://www.github.com/looker-open-source/sdk-codegen/commit/50e925c90eb3c5ffefc8e8535131471e2f2d0334))
|
|
14
|
+
|
|
8
15
|
## [21.6.0](https://www.github.com/looker-open-source/sdk-codegen/compare/sdk-codegen-v21.5.2...sdk-codegen-v21.6.0) (2022-07-07)
|
|
9
16
|
|
|
10
17
|
|
|
@@ -344,4 +351,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
344
351
|
|
|
345
352
|
### Added
|
|
346
353
|
|
|
347
|
-
- [API spec diff utility](https://github.com/looker-open-source/sdk-codegen/pull/380)
|
|
354
|
+
- [API spec diff utility](https://github.com/looker-open-source/sdk-codegen/pull/380)
|
package/lib/esm/sdkModels.js
CHANGED
|
@@ -1275,8 +1275,6 @@ export class ApiModel {
|
|
|
1275
1275
|
constructor(spec) {
|
|
1276
1276
|
this.spec = spec;
|
|
1277
1277
|
|
|
1278
|
-
_defineProperty(this, "requestTypes", {});
|
|
1279
|
-
|
|
1280
1278
|
_defineProperty(this, "enumTypes", {});
|
|
1281
1279
|
|
|
1282
1280
|
_defineProperty(this, "refs", {});
|
|
@@ -1507,11 +1505,14 @@ export class ApiModel {
|
|
|
1507
1505
|
throw new Error("Schema ".concat(typeof schema === 'string' ? schema : JSON.stringify(schema), " must have a ref or a type"));
|
|
1508
1506
|
}
|
|
1509
1507
|
|
|
1510
|
-
|
|
1511
|
-
|
|
1508
|
+
requestTypeName(method) {
|
|
1509
|
+
return "".concat(strRequest).concat(camelCase('_' + method.name));
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
makeRequestType(method) {
|
|
1513
|
+
var name = this.requestTypeName(method);
|
|
1512
1514
|
var request = new RequestType(this, name, method.allParams, "Dynamically generated request type for ".concat(method.name));
|
|
1513
1515
|
this.types[name] = request;
|
|
1514
|
-
this.requestTypes[hash] = request;
|
|
1515
1516
|
method.addType(this, request);
|
|
1516
1517
|
return request;
|
|
1517
1518
|
}
|
|
@@ -1544,11 +1545,8 @@ export class ApiModel {
|
|
|
1544
1545
|
|
|
1545
1546
|
_getRequestType(method) {
|
|
1546
1547
|
if (method.optionalParams.length <= 1) return undefined;
|
|
1547
|
-
var
|
|
1548
|
-
|
|
1549
|
-
var hash = md5(paramHash);
|
|
1550
|
-
var result = this.requestTypes[hash];
|
|
1551
|
-
if (!result) result = this.makeRequestType(hash, method);
|
|
1548
|
+
var result = this.types[this.requestTypeName(method)];
|
|
1549
|
+
if (!result) result = this.makeRequestType(method);
|
|
1552
1550
|
return result;
|
|
1553
1551
|
}
|
|
1554
1552
|
|
|
@@ -1563,10 +1561,9 @@ export class ApiModel {
|
|
|
1563
1561
|
return this.enumTypes;
|
|
1564
1562
|
}
|
|
1565
1563
|
|
|
1566
|
-
makeWriteableType(
|
|
1564
|
+
makeWriteableType(type) {
|
|
1567
1565
|
var writer = new WriteType(this, type);
|
|
1568
1566
|
this.types[writer.name] = writer;
|
|
1569
|
-
this.requestTypes[hash] = writer;
|
|
1570
1567
|
return writer;
|
|
1571
1568
|
}
|
|
1572
1569
|
|
|
@@ -1596,10 +1593,7 @@ export class ApiModel {
|
|
|
1596
1593
|
}
|
|
1597
1594
|
|
|
1598
1595
|
if (writes.length === props.length && JSON.stringify(writes) === JSON.stringify(props)) return undefined;
|
|
1599
|
-
var
|
|
1600
|
-
var result = this.requestTypes[hash];
|
|
1601
|
-
if (result) return result;
|
|
1602
|
-
result = this.makeWriteableType(hash, type);
|
|
1596
|
+
var result = this.makeWriteableType(type);
|
|
1603
1597
|
type.types.add(result.name);
|
|
1604
1598
|
type.customTypes.add(result.name);
|
|
1605
1599
|
result.parentTypes.add(type.name);
|