@looker/sdk-rtl 21.4.0 → 21.6.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 (101) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/CSRFSession.js +3 -17
  3. package/lib/CSRFSession.js.map +1 -1
  4. package/lib/apiMethods.js +6 -47
  5. package/lib/apiMethods.js.map +1 -1
  6. package/lib/apiSettings.js +4 -24
  7. package/lib/apiSettings.js.map +1 -1
  8. package/lib/authSession.js +3 -18
  9. package/lib/authSession.js.map +1 -1
  10. package/lib/authToken.js +3 -18
  11. package/lib/authToken.js.map +1 -1
  12. package/lib/baseTransport.js +3 -12
  13. package/lib/baseTransport.js.map +1 -1
  14. package/lib/browser.js +0 -34
  15. package/lib/browser.js.map +1 -1
  16. package/lib/browserServices.js +3 -11
  17. package/lib/browserServices.js.map +1 -1
  18. package/lib/browserSession.js +6 -21
  19. package/lib/browserSession.js.map +1 -1
  20. package/lib/browserTransport.js +10 -64
  21. package/lib/browserTransport.js.map +1 -1
  22. package/lib/constants.js +1 -11
  23. package/lib/constants.js.map +1 -1
  24. package/lib/cryptoHash.js +1 -1
  25. package/lib/cryptoHash.js.map +1 -1
  26. package/lib/delimArray.js +3 -8
  27. package/lib/delimArray.js.map +1 -1
  28. package/lib/errorDoc.js +9 -50
  29. package/lib/errorDoc.js.map +1 -1
  30. package/lib/esm/CSRFSession.js +14 -17
  31. package/lib/esm/CSRFSession.js.map +1 -1
  32. package/lib/esm/apiMethods.js +18 -46
  33. package/lib/esm/apiMethods.js.map +1 -1
  34. package/lib/esm/apiSettings.js +32 -28
  35. package/lib/esm/apiSettings.js.map +1 -1
  36. package/lib/esm/authSession.js +14 -19
  37. package/lib/esm/authSession.js.map +1 -1
  38. package/lib/esm/authToken.js +11 -17
  39. package/lib/esm/authToken.js.map +1 -1
  40. package/lib/esm/baseTransport.js +14 -13
  41. package/lib/esm/baseTransport.js.map +1 -1
  42. package/lib/esm/browser.js +192 -17
  43. package/lib/esm/browser.js.map +1 -1
  44. package/lib/esm/browserServices.js +15 -12
  45. package/lib/esm/browserServices.js.map +1 -1
  46. package/lib/esm/browserSession.js +21 -23
  47. package/lib/esm/browserSession.js.map +1 -1
  48. package/lib/esm/browserTransport.js +29 -69
  49. package/lib/esm/browserTransport.js.map +1 -1
  50. package/lib/esm/constants.js +22 -10
  51. package/lib/esm/constants.js.map +1 -1
  52. package/lib/esm/cryptoHash.js.map +1 -1
  53. package/lib/esm/delimArray.js +10 -6
  54. package/lib/esm/delimArray.js.map +1 -1
  55. package/lib/esm/errorDoc.js +24 -52
  56. package/lib/esm/errorDoc.js.map +1 -1
  57. package/lib/esm/extensionSession.js +11 -16
  58. package/lib/esm/extensionSession.js.map +1 -1
  59. package/lib/esm/extensionTransport.js +13 -19
  60. package/lib/esm/extensionTransport.js.map +1 -1
  61. package/lib/esm/index.js +236 -21
  62. package/lib/esm/index.js.map +1 -1
  63. package/lib/esm/lookerSDKError.js +13 -12
  64. package/lib/esm/lookerSDKError.js.map +1 -1
  65. package/lib/esm/oauthSession.js +23 -66
  66. package/lib/esm/oauthSession.js.map +1 -1
  67. package/lib/esm/paging.js +24 -71
  68. package/lib/esm/paging.js.map +1 -1
  69. package/lib/esm/platformServices.js.map +1 -1
  70. package/lib/esm/proxySession.js +13 -13
  71. package/lib/esm/proxySession.js.map +1 -1
  72. package/lib/esm/testUtils/index.js +17 -0
  73. package/lib/esm/testUtils/index.js.map +1 -0
  74. package/lib/esm/testUtils/testUtils.js +46 -0
  75. package/lib/esm/testUtils/testUtils.js.map +1 -0
  76. package/lib/esm/transport.js +57 -62
  77. package/lib/esm/transport.js.map +1 -1
  78. package/lib/extensionSession.js +3 -17
  79. package/lib/extensionSession.js.map +1 -1
  80. package/lib/extensionTransport.js +5 -20
  81. package/lib/extensionTransport.js.map +1 -1
  82. package/lib/index.js +0 -42
  83. package/lib/index.js.map +1 -1
  84. package/lib/lookerSDKError.js +5 -13
  85. package/lib/lookerSDKError.js.map +1 -1
  86. package/lib/oauthSession.js +8 -63
  87. package/lib/oauthSession.js.map +1 -1
  88. package/lib/paging.js +5 -70
  89. package/lib/paging.js.map +1 -1
  90. package/lib/platformServices.js +1 -1
  91. package/lib/platformServices.js.map +1 -1
  92. package/lib/proxySession.js +0 -12
  93. package/lib/proxySession.js.map +1 -1
  94. package/lib/testUtils/index.js +0 -2
  95. package/lib/testUtils/index.js.map +1 -1
  96. package/lib/testUtils/testUtils.js +1 -16
  97. package/lib/testUtils/testUtils.js.map +1 -1
  98. package/lib/transport.d.ts +2 -0
  99. package/lib/transport.js +8 -50
  100. package/lib/transport.js.map +1 -1
  101. package/package.json +3 -3
package/lib/transport.js CHANGED
@@ -3,38 +3,31 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.trace = trace;
7
- exports.responseMode = responseMode;
8
- exports.isUtf8 = isUtf8;
6
+ exports.StatusCode = exports.ResponseMode = exports.LookerAppId = void 0;
7
+ exports.addQueryParams = addQueryParams;
8
+ exports.defaultTimeout = exports.contentPatternString = exports.contentPatternBinary = exports.charsetUtf8Pattern = exports.agentPrefix = void 0;
9
9
  exports.encodeParam = encodeParam;
10
10
  exports.encodeParams = encodeParams;
11
- exports.addQueryParams = addQueryParams;
11
+ exports.isErrorLike = isErrorLike;
12
+ exports.isUtf8 = isUtf8;
13
+ exports.responseMode = responseMode;
14
+ exports.safeBase64 = safeBase64;
12
15
  exports.sdkError = sdkError;
13
16
  exports.sdkOk = sdkOk;
14
- exports.safeBase64 = safeBase64;
15
- exports.isErrorLike = isErrorLike;
16
- exports.StatusCode = exports.defaultTimeout = exports.charsetUtf8Pattern = exports.contentPatternBinary = exports.contentPatternString = exports.ResponseMode = exports.LookerAppId = exports.agentPrefix = void 0;
17
-
17
+ exports.trace = trace;
18
18
  var _constants = require("./constants");
19
-
20
19
  var _delimArray = require("./delimArray");
21
-
22
20
  var _lookerSDKError = require("./lookerSDKError");
23
-
24
21
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
25
-
26
22
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
27
-
28
23
  var agentPrefix = 'TS-SDK';
29
24
  exports.agentPrefix = agentPrefix;
30
25
  var LookerAppId = 'x-looker-appid';
31
26
  exports.LookerAppId = LookerAppId;
32
27
  var tracing = false;
33
-
34
28
  function trace(message, info) {
35
29
  if (tracing) {
36
30
  console.debug(message);
37
-
38
31
  if (info) {
39
32
  console.debug({
40
33
  info
@@ -42,16 +35,13 @@ function trace(message, info) {
42
35
  }
43
36
  }
44
37
  }
45
-
46
38
  var ResponseMode;
47
39
  exports.ResponseMode = ResponseMode;
48
-
49
40
  (function (ResponseMode) {
50
41
  ResponseMode[ResponseMode["binary"] = 0] = "binary";
51
42
  ResponseMode[ResponseMode["string"] = 1] = "string";
52
43
  ResponseMode[ResponseMode["unknown"] = 2] = "unknown";
53
44
  })(ResponseMode || (exports.ResponseMode = ResponseMode = {}));
54
-
55
45
  var contentPatternString = new RegExp(_constants.matchModeString, 'i');
56
46
  exports.contentPatternString = contentPatternString;
57
47
  var contentPatternBinary = new RegExp(_constants.matchModeBinary, 'i');
@@ -62,7 +52,6 @@ var defaultTimeout = 120;
62
52
  exports.defaultTimeout = defaultTimeout;
63
53
  var StatusCode;
64
54
  exports.StatusCode = StatusCode;
65
-
66
55
  (function (StatusCode) {
67
56
  StatusCode[StatusCode["OK"] = 200] = "OK";
68
57
  StatusCode[StatusCode["Created"] = 201] = "Created";
@@ -124,35 +113,27 @@ exports.StatusCode = StatusCode;
124
113
  StatusCode[StatusCode["NotExtended"] = 510] = "NotExtended";
125
114
  StatusCode[StatusCode["NetworkAuthRequired"] = 511] = "NetworkAuthRequired";
126
115
  })(StatusCode || (exports.StatusCode = StatusCode = {}));
127
-
128
116
  function responseMode(contentType) {
129
117
  if (contentType.match(contentPatternString)) {
130
118
  return ResponseMode.string;
131
119
  }
132
-
133
120
  if (contentType.match(contentPatternBinary)) {
134
121
  return ResponseMode.binary;
135
122
  }
136
-
137
123
  return ResponseMode.unknown;
138
124
  }
139
-
140
125
  function isUtf8(contentType) {
141
126
  return contentType.match(/;.*\bcharset\b=\butf-8\b/i);
142
127
  }
143
-
144
128
  function encodeParam(value) {
145
129
  if (value instanceof Date) {
146
130
  value = value.toISOString();
147
131
  } else if (value instanceof _delimArray.DelimArray) {
148
132
  value = value.toString();
149
133
  }
150
-
151
134
  var encoded = typeof value === 'object' ? JSON.stringify(value) : value.toString();
152
-
153
135
  try {
154
136
  var decoded = decodeURIComponent(value);
155
-
156
137
  if (value === decoded) {
157
138
  encoded = encodeURIComponent(value);
158
139
  }
@@ -163,30 +144,23 @@ function encodeParam(value) {
163
144
  throw e;
164
145
  }
165
146
  }
166
-
167
147
  return encoded;
168
148
  }
169
-
170
149
  function encodeParams(values) {
171
150
  if (!values) return '';
172
151
  var keys = Object.keys(values);
173
152
  return keys.filter(k => values[k] !== undefined).map(k => k + '=' + encodeParam(values[k])).join('&');
174
153
  }
175
-
176
154
  function addQueryParams(path, obj) {
177
155
  if (!obj) {
178
156
  return path;
179
157
  }
180
-
181
158
  var qp = encodeParams(obj);
182
159
  return "".concat(path).concat(qp ? '?' + qp : '');
183
160
  }
184
-
185
161
  var utf8 = 'utf-8';
186
-
187
162
  function bufferString(val) {
188
163
  var result = 'Unknown error';
189
-
190
164
  try {
191
165
  var decoder = new TextDecoder(utf8);
192
166
  result = decoder.decode(val);
@@ -201,59 +175,45 @@ function bufferString(val) {
201
175
  result = JSON.stringify(val);
202
176
  }
203
177
  }
204
-
205
178
  return result;
206
179
  }
207
-
208
180
  function sdkError(response) {
209
181
  if (typeof response === 'string') {
210
182
  return new _lookerSDKError.LookerSDKError(response);
211
183
  }
212
-
213
184
  if ('error' in response) {
214
185
  var _error = response.error;
215
-
216
186
  if (typeof _error === 'string') {
217
187
  return new _lookerSDKError.LookerSDKError(_error);
218
188
  }
219
-
220
189
  if ('error' in _error) {
221
190
  var _result = bufferString(_error.error);
222
-
223
191
  return new _lookerSDKError.LookerSDKError(_result);
224
192
  }
225
-
226
193
  if ('message' in _error) {
227
194
  return new _lookerSDKError.LookerSDKError(response.error.message.toString(), {
228
195
  errors: _error.errors,
229
196
  documentation_url: _error.documentation_url
230
197
  });
231
198
  }
232
-
233
199
  if ('statusMessage' in _error) {
234
200
  return new _lookerSDKError.LookerSDKError(_error.statusMessage);
235
201
  }
236
-
237
202
  var result = bufferString(_error);
238
203
  return new _lookerSDKError.LookerSDKError(result);
239
204
  }
240
-
241
205
  if ('message' in response) {
242
206
  return new _lookerSDKError.LookerSDKError(response.message);
243
207
  }
244
-
245
208
  var error = JSON.stringify(response);
246
209
  return new _lookerSDKError.LookerSDKError("Unknown error with SDK method ".concat(error));
247
210
  }
248
-
249
211
  function sdkOk(_x) {
250
212
  return _sdkOk.apply(this, arguments);
251
213
  }
252
-
253
214
  function _sdkOk() {
254
215
  _sdkOk = _asyncToGenerator(function* (promise) {
255
216
  var result = yield promise;
256
-
257
217
  if (result.ok) {
258
218
  return result.value;
259
219
  } else {
@@ -262,12 +222,10 @@ function _sdkOk() {
262
222
  });
263
223
  return _sdkOk.apply(this, arguments);
264
224
  }
265
-
266
225
  function safeBase64(u8) {
267
226
  var rawBase64 = btoa(String.fromCharCode(...u8));
268
227
  return rawBase64.replace(/\+/g, '-').replace(/\//g, '_');
269
228
  }
270
-
271
229
  function isErrorLike(error) {
272
230
  if (typeof error !== 'object') return false;
273
231
  if (!error) return false;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/transport.ts"],"names":["agentPrefix","LookerAppId","tracing","trace","message","info","console","debug","ResponseMode","contentPatternString","RegExp","matchModeString","contentPatternBinary","matchModeBinary","charsetUtf8Pattern","matchCharsetUtf8","defaultTimeout","StatusCode","responseMode","contentType","match","string","binary","unknown","isUtf8","encodeParam","value","Date","toISOString","DelimArray","toString","encoded","JSON","stringify","decoded","decodeURIComponent","encodeURIComponent","e","URIError","encodeParams","values","keys","Object","filter","k","undefined","map","join","addQueryParams","path","obj","qp","utf8","bufferString","val","result","decoder","TextDecoder","decode","Buffer","from","err","sdkError","response","LookerSDKError","error","errors","documentation_url","statusMessage","sdkOk","promise","ok","safeBase64","u8","rawBase64","btoa","String","fromCharCode","replace","isErrorLike","prototype","hasOwnProperty","call"],"mappings":";;;;;;;;;;;;;;;;;AA6BA;;AACA;;AACA;;;;;;AAEO,IAAMA,WAAW,GAAG,QAApB;;AACA,IAAMC,WAAW,GAAG,gBAApB;;AAGP,IAAMC,OAAO,GAAG,KAAhB;;AAOO,SAASC,KAAT,CAAeC,OAAf,EAAgCC,IAAhC,EAA4C;AACjD,MAAIH,OAAJ,EAAa;AAEXI,IAAAA,OAAO,CAACC,KAAR,CAAcH,OAAd;;AACA,QAAIC,IAAJ,EAAU;AAERC,MAAAA,OAAO,CAACC,KAAR,CAAc;AAAEF,QAAAA;AAAF,OAAd;AACD;AACF;AACF;;IAGWG,Y;;;WAAAA,Y;AAAAA,EAAAA,Y,CAAAA,Y;AAAAA,EAAAA,Y,CAAAA,Y;AAAAA,EAAAA,Y,CAAAA,Y;GAAAA,Y,4BAAAA,Y;;AAUL,IAAMC,oBAAoB,GAAG,IAAIC,MAAJ,CAAWC,0BAAX,EAA4B,GAA5B,CAA7B;;AAMA,IAAMC,oBAAoB,GAAG,IAAIF,MAAJ,CAAWG,0BAAX,EAA4B,GAA5B,CAA7B;;AAMA,IAAMC,kBAAkB,GAAG,IAAIJ,MAAJ,CAAWK,2BAAX,EAA6B,GAA7B,CAA3B;;AAMA,IAAMC,cAAc,GAAG,GAAvB;;IAiBKC,U;;;WAAAA,U;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,EAA2B;AACzB,WAAO,IAAIC,8BAAJ,CAAmBD,QAAQ,CAAC3D,OAA5B,CAAP;AACD;;AACD,MAAM6D,KAAK,GAAGjC,IAAI,CAACC,SAAL,CAAe8B,QAAf,CAAd;AACA,SAAO,IAAIC,8BAAJ,yCAAoDC,KAApD,EAAP;AACD;;SAyBqBI,K;;;;;6BAAf,WACLC,OADK,EAEL;AACA,QAAMf,MAAM,SAASe,OAArB;;AACA,QAAIf,MAAM,CAACgB,EAAX,EAAe;AACb,aAAOhB,MAAM,CAAC7B,KAAd;AACD,KAFD,MAEO;AACL,YAAMoC,QAAQ,CAACP,MAAD,CAAd;AACD;AACF,G;;;;AAMM,SAASiB,UAAT,CAAoBC,EAApB,EAAoC;AACzC,MAAMC,SAAS,GAAGC,IAAI,CAACC,MAAM,CAACC,YAAP,CAAoB,GAAGJ,EAAvB,CAAD,CAAtB;AACA,SAAOC,SAAS,CAACI,OAAV,CAAkB,KAAlB,EAAyB,GAAzB,EAA8BA,OAA9B,CAAsC,KAAtC,EAA6C,GAA7C,CAAP;AACD;;AAOM,SAASC,WAAT,CACLd,KADK,EAE6B;AAClC,MAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B,OAAO,KAAP;AAC/B,MAAI,CAACA,KAAL,EAAY,OAAO,KAAP;AACZ,MAAI,CAACvB,MAAM,CAACsC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCjB,KAArC,EAA4C,SAA5C,CAAL,EAA6D,OAAO,KAAP;AAC7D,MAAI,OAAQA,KAAD,CAAgC7D,OAAvC,KAAmD,QAAvD,EAAiE,OAAO,KAAP;AACjE,SAAO,IAAP;AACD","sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { Agent } from 'https'\nimport type { Headers } from 'request'\nimport type { Readable } from 'readable-stream'\nimport { matchCharsetUtf8, matchModeBinary, matchModeString } from './constants'\nimport { DelimArray } from './delimArray'\nimport { LookerSDKError } from './lookerSDKError'\n\nexport const agentPrefix = 'TS-SDK'\nexport const LookerAppId = 'x-looker-appid'\n\n/** Set to `true` to follow streaming process */\nconst tracing = false\n\n/**\n * trivial tracing function that should be replaced with a log plugin\n * @param message description for trace\n * @param info any additional information to produce for output\n */\nexport function trace(message: string, info?: any) {\n if (tracing) {\n // eslint-disable-next-line no-console\n console.debug(message)\n if (info) {\n // eslint-disable-next-line no-console\n console.debug({ info })\n }\n }\n}\n\n/** ResponseMode for an HTTP request */\nexport enum ResponseMode {\n 'binary', // this is a binary response\n 'string', // this is a \"string\" response\n 'unknown', // unrecognized response type\n}\n\n/**\n * MIME patterns for string content types\n * @type {RegExp}\n */\nexport const contentPatternString = new RegExp(matchModeString, 'i')\n\n/**\n * MIME patterns for \"binary\" content types\n * @type {RegExp}\n */\nexport const contentPatternBinary = new RegExp(matchModeBinary, 'i')\n\n/**\n * MIME pattern for UTF8 charset attribute\n * @type {RegExp}\n */\nexport const charsetUtf8Pattern = new RegExp(matchCharsetUtf8, 'i')\n\n/**\n * Default request timeout\n * @type {number} default request timeout is 120 seconds, or two minutes\n */\nexport const defaultTimeout = 120\n\n/** Recognized HTTP methods */\nexport type HttpMethod =\n | 'GET'\n | 'POST'\n | 'PUT'\n | 'DELETE'\n | 'PATCH'\n | 'TRACE'\n | 'HEAD'\n\n/**\n * HTTP status codes\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Status for reference\n * TODO is there a platform-agnostic list of these that can be used instead of this static declaration?\n */\nexport enum StatusCode {\n OK = 200,\n Created,\n Accepted,\n NonAuthoritative,\n NoContent,\n ResetContent,\n PartialContent,\n MultiStatus,\n MultiStatusDav,\n IMUsed = 226,\n MultipleChoice = 300,\n MovedPermanently,\n Found,\n SeeOther,\n NotModified,\n UseProxy,\n UnusedRedirect,\n TemporaryRedirect,\n PermanentRedirect,\n BadRequest = 400,\n Unauthorized,\n PaymentRequired,\n Forbidden,\n NotFound,\n MethodNotAllowed,\n NotAcceptable,\n ProxyAuthRequired,\n RequestTimeout,\n Conflict,\n Gone,\n LengthRequired,\n PreconditionFailed,\n PayloadTooLarge,\n UriTooLong,\n UnsupportedMediaType,\n RequestedRangeNotSatisfiable,\n ExpectationFailed,\n ImATeapot,\n MisdirectedRequest = 421,\n UnprocessableEntity,\n Locked,\n FailedDependency,\n TooEarly,\n UpgradeRequired,\n PreconditionRequired = 428,\n TooManyRequests,\n RequestHeaderFieldsTooLarge = 431,\n UnavailableForLegalReasons = 451,\n InternalServerError = 500,\n NotImplemented,\n BadGateway,\n ServiceUnavailable,\n GatewayTimeout,\n HttpVersionNotSupported,\n VariantAlsoNegotiates,\n InsufficientStorage,\n LoopDetected,\n NotExtended = 510,\n NetworkAuthRequired,\n}\n\n/** Untyped basic HTTP response type for \"raw\" HTTP requests */\nexport interface IRawResponse {\n /** Http method of the request */\n method: HttpMethod\n /** ok is `true` if the response is successful, `false` otherwise */\n ok: boolean\n /** HTTP request url */\n url: string\n /** HTTP response code */\n statusCode: number\n /** HTTP response status message text */\n statusMessage: string\n /** MIME type of the response from the HTTP response header */\n contentType: string\n /** The body of the HTTP response, without any additional processing */\n body: any\n /** Optional performance tracking starting mark name */\n startMark?: string\n /** Response headers */\n headers: IRequestHeaders\n}\n\n/** IRawResponse observer function type */\nexport type RawObserver = (raw: IRawResponse) => IRawResponse\n\n/** Transport plug-in interface */\nexport interface ITransport {\n /** Observer lambda to process raw responses */\n observer: RawObserver | undefined\n\n /**\n * HTTP request function for atomic, fully downloaded raw HTTP responses\n *\n * Note: This method returns the result of the HTTP request without any error handling\n *\n * @param method of HTTP request\n * @param path request path, either relative or fully specified\n * @param queryParams name/value pairs to pass as part of the URL\n * @param body data for the body of the request\n * @param authenticator authenticator callback, typically from `IAuthSession` implementation\n * @param options overrides of default transport settings\n * @returns typed response of `TSuccess`, or `TError` result\n */\n rawRequest(\n method: HttpMethod,\n path: string,\n queryParams?: Values,\n body?: any,\n authenticator?: Authenticator,\n options?: Partial<ITransportSettings>\n ): Promise<IRawResponse>\n\n /**\n * HTTP request function for atomic, fully downloaded responses\n * @param method of HTTP request\n * @param path request path, either relative or fully specified\n * @param queryParams name/value pairs to pass as part of the URL\n * @param body data for the body of the request\n * @param authenticator authenticator callback, typically from `IAuthSession` implementation\n * @param options overrides of default transport settings\n * @returns typed response of `TSuccess`, or `TError` result\n */\n request<TSuccess, TError>(\n method: HttpMethod,\n path: string,\n queryParams?: Values,\n body?: any,\n authenticator?: Authenticator,\n options?: Partial<ITransportSettings>\n ): Promise<SDKResponse<TSuccess, TError>>\n\n /**\n * Processes the raw response, converting it into an SDKResponse\n * @param raw response result\n */\n parseResponse<TSuccess, TError>(\n raw: IRawResponse\n ): Promise<SDKResponse<TSuccess, TError>>\n\n /**\n * HTTP request function for a streamable response\n * @param callback that receives the stream response and pipes it somewhere\n * @param method of HTTP request\n * @param path request path, either relative or fully specified\n * @param queryParams name/value pairs to pass as part of the URL\n * @param body data for the body of the request\n * @param authenticator authenticator callback, typically from `IAuthSession` implementation\n * @param options overrides of default transport settings\n * @returns `T` upon success\n * @throws `ISDKErrorResponse` on failure\n */\n stream<T>(\n callback: (readable: Readable) => Promise<T>,\n method: HttpMethod,\n path: string,\n queryParams?: Values,\n body?: any,\n authenticator?: Authenticator,\n options?: Partial<ITransportSettings>\n ): Promise<T>\n}\n\n/** A successful SDK call. */\nexport interface ISDKSuccessResponse<T> {\n /** Whether the SDK call was successful. */\n ok: true\n /** The object returned by the SDK call. */\n value: T\n}\n\n/** An errant SDK call. */\nexport interface ISDKErrorResponse<T> {\n /** Whether the SDK call was successful. */\n ok: false\n /** The error object returned by the SDK call. */\n error: T\n}\n\n/** An error representing an issue in the SDK, like a network or parsing error. */\nexport interface ISDKError {\n type: 'sdk_error'\n message: string\n}\n\nexport type SDKResponse<TSuccess, TError> =\n | ISDKSuccessResponse<TSuccess>\n | ISDKErrorResponse<TError | ISDKError>\n\n/** Generic collection */\nexport interface IRequestHeaders {\n [key: string]: string\n}\n\n/**\n * Generic http request property collection\n * TODO: Trim this down to what is required\n */\nexport interface IRequestProps {\n [key: string]: any\n /** full url for request, including any query params */\n url: string\n\n /** body of request. optional */\n body?: any\n /** headers for request. optional */\n headers: IRequestHeaders\n /** Http method for request. required. */\n method: HttpMethod\n /** Redirect processing for request. optional */\n redirect?: any\n /** Credentials to use */\n credentials?: 'include' | 'omit' | 'same-origin' | undefined\n\n /** http.Agent instance, allows custom proxy, certificate etc. */\n agent?: Agent\n /** support gzip/deflate content encoding. false to disable */\n compress?: boolean\n /** maximum redirect count. 0 to not follow redirect */\n follow?: number\n /** maximum response body size in bytes */\n size?: number\n /** req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies) */\n timeout?: number\n}\n\n/** General purpose authentication callback */\nexport type Authenticator = (props: any) => any\n\n/** Interface for API transport values */\nexport interface ITransportSettings {\n [key: string]: any\n /** base URL of API REST web service */\n base_url: string\n /** standard headers to provide in all transport requests */\n headers?: Headers\n /** whether to verify ssl certs or not. Defaults to true */\n verify_ssl: boolean\n /** request timeout in seconds. Default to 30 */\n timeout: number\n /** encoding override */\n encoding?: string | null\n /** agent tag to use for the SDK requests */\n agentTag: string\n}\n\n/**\n * Is the content type binary or \"string\"?\n * @param {string} contentType\n * @returns {ResponseMode.binary | ResponseMode.string}\n */\nexport function responseMode(contentType: string) {\n if (contentType.match(contentPatternString)) {\n return ResponseMode.string\n }\n if (contentType.match(contentPatternBinary)) {\n return ResponseMode.binary\n }\n return ResponseMode.unknown\n}\n\n/**\n * Does this content type have a UTF-8 charset?\n * @param contentType\n * @returns match if it exists\n */\nexport function isUtf8(contentType: string) {\n return contentType.match(/;.*\\bcharset\\b=\\butf-8\\b/i)\n}\n\n/** Used for name/value pair collections like for QueryParams */\nexport type Values = { [key: string]: any } | null | undefined\n\n/**\n * Encode parameter if not already encoded\n *\n * Note: this includes recognition of Date, DelimArray, and default objects for special handling\n *\n * @param value value of parameter\n * @returns URI encoded value\n */\nexport function encodeParam(value: any) {\n if (value instanceof Date) {\n value = value.toISOString()\n } else if (value instanceof DelimArray) {\n value = value.toString()\n }\n // check for object type to prevent \"[object Object]\" as the value.toString()\n let encoded =\n typeof value === 'object' ? JSON.stringify(value) : value.toString()\n\n // decodeURIComponent throws URIError if there is a % character\n // without it being part of an encoded\n try {\n const decoded = decodeURIComponent(value)\n if (value === decoded) {\n encoded = encodeURIComponent(value)\n }\n } catch (e) {\n if (e instanceof URIError) {\n encoded = encodeURIComponent(value)\n } else {\n throw e\n }\n }\n return encoded\n}\n\n/**\n * Converts `Values` to query string parameter format\n * @param values Name/value collection to encode\n * @returns {string} query string parameter formatted values. Both `false` and `null` are included. Only `undefined` are omitted.\n */\nexport function encodeParams(values?: Values) {\n if (!values) return ''\n\n const keys = Object.keys(values)\n return keys\n .filter((k) => values[k] !== undefined) // `null` and `false` will both be passed\n .map((k) => k + '=' + encodeParam(values[k]))\n .join('&')\n}\n\n/**\n * constructs the path argument including any optional query parameters\n * @param path the base path of the request\n * @param obj optional collection of query parameters to encode and append to the path\n */\nexport function addQueryParams(path: string, obj?: Values) {\n if (!obj) {\n return path\n }\n const qp = encodeParams(obj)\n return `${path}${qp ? '?' + qp : ''}`\n}\n\nconst utf8 = 'utf-8'\n\n/**\n * Convert this value to a string representation however we can do it\n * @param val\n */\nfunction bufferString(val: any) {\n let result = 'Unknown error'\n try {\n const decoder = new TextDecoder(utf8)\n result = decoder.decode(val)\n } catch (e: any) {\n // Supremely ugly hack. If we get here, we must be in Node (or IE 11, but who cares about that?)\n // Node requires an import from `util` for TextDecoder to be found BUT it \"just has\" Buffer unless WebPack messes us up\n try {\n if (val instanceof Buffer) {\n result = Buffer.from(val).toString(utf8)\n } else {\n result = JSON.stringify(val)\n }\n } catch (err: any) {\n // The fallback logic here will at least give us some information about the error being thrown\n result = JSON.stringify(val)\n }\n }\n return result\n}\n\n/**\n * SDK error handler\n * @param response any kind of error\n * @returns a new `Error` object with the failure message\n */\nexport function sdkError(response: any) {\n if (typeof response === 'string') {\n return new LookerSDKError(response)\n }\n if ('error' in response) {\n const error = response.error\n if (typeof error === 'string') {\n return new LookerSDKError(error)\n }\n // Try to get most specific error first\n if ('error' in error) {\n const result = bufferString(error.error)\n return new LookerSDKError(result)\n }\n if ('message' in error) {\n return new LookerSDKError(response.error.message.toString(), {\n errors: error.errors,\n documentation_url: error.documentation_url,\n })\n }\n if ('statusMessage' in error) {\n return new LookerSDKError(error.statusMessage)\n }\n const result = bufferString(error)\n return new LookerSDKError(result)\n }\n if ('message' in response) {\n return new LookerSDKError(response.message)\n }\n const error = JSON.stringify(response)\n return new LookerSDKError(`Unknown error with SDK method ${error}`)\n}\n\n/** A helper method for simplifying error handling of SDK responses.\n *\n * Pass in a promise returned by any SDK method, and it will return a promise\n * that rejects if the `SDKResponse` is not `ok`. This will swallow the type\n * information in the error case, but allows you to route all the error cases\n * into a single promise rejection.\n *\n * The promise will have an `Error` rejection reason with a string `message`.\n * If the server error contains a `message` field, it will be provided, otherwise a\n * generic message will occur.\n *\n * ```ts\n * const sdk = LookerSDK({...})\n * let look\n * try {\n * look = await sdkOk(sdk.create_look({...}))\n * // do something with look\n * }\n * catch(e) {\n * // handle error case\n * }\n * ```\n */\nexport async function sdkOk<TSuccess, TError>(\n promise: Promise<SDKResponse<TSuccess, TError>>\n) {\n const result = await promise\n if (result.ok) {\n return result.value\n } else {\n throw sdkError(result)\n }\n}\n\n/**\n * Converts a byte array to a \"URL safe\" base64 string\n * @param u8 byte array to convert\n */\nexport function safeBase64(u8: Uint8Array) {\n const rawBase64 = btoa(String.fromCharCode(...u8))\n return rawBase64.replace(/\\+/g, '-').replace(/\\//g, '_')\n}\n\n/**\n * Type predicate. Asserts that a given object is error-like.\n * @param error a value of unknown type\n * @return boolean true if the error has a `message` key of type string.\n */\nexport function isErrorLike<T extends unknown>(\n error: T\n): error is T & { message: string } {\n if (typeof error !== 'object') return false\n if (!error) return false\n if (!Object.prototype.hasOwnProperty.call(error, 'message')) return false\n if (typeof (error as { message: unknown }).message !== 'string') return false\n return true\n}\n"],"file":"transport.js"}
1
+ {"version":3,"file":"transport.js","names":["agentPrefix","LookerAppId","tracing","trace","message","info","console","debug","ResponseMode","contentPatternString","RegExp","matchModeString","contentPatternBinary","matchModeBinary","charsetUtf8Pattern","matchCharsetUtf8","defaultTimeout","StatusCode","responseMode","contentType","match","string","binary","unknown","isUtf8","encodeParam","value","Date","toISOString","DelimArray","toString","encoded","JSON","stringify","decoded","decodeURIComponent","encodeURIComponent","e","URIError","encodeParams","values","keys","Object","filter","k","undefined","map","join","addQueryParams","path","obj","qp","utf8","bufferString","val","result","decoder","TextDecoder","decode","Buffer","from","err","sdkError","response","LookerSDKError","error","errors","documentation_url","statusMessage","sdkOk","promise","ok","safeBase64","u8","rawBase64","btoa","String","fromCharCode","replace","isErrorLike","prototype","hasOwnProperty","call"],"sources":["../src/transport.ts"],"sourcesContent":["/*\n\n MIT License\n\n Copyright (c) 2021 Looker Data Sciences, Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n\n */\n\nimport type { Agent } from 'https'\nimport type { Headers } from 'request'\nimport type { Readable } from 'readable-stream'\nimport { matchCharsetUtf8, matchModeBinary, matchModeString } from './constants'\nimport { DelimArray } from './delimArray'\nimport { LookerSDKError } from './lookerSDKError'\n\nexport const agentPrefix = 'TS-SDK'\nexport const LookerAppId = 'x-looker-appid'\n\n/** Set to `true` to follow streaming process */\nconst tracing = false\n\n/**\n * trivial tracing function that should be replaced with a log plugin\n * @param message description for trace\n * @param info any additional information to produce for output\n */\nexport function trace(message: string, info?: any) {\n if (tracing) {\n // eslint-disable-next-line no-console\n console.debug(message)\n if (info) {\n // eslint-disable-next-line no-console\n console.debug({ info })\n }\n }\n}\n\n/** ResponseMode for an HTTP request */\nexport enum ResponseMode {\n 'binary', // this is a binary response\n 'string', // this is a \"string\" response\n 'unknown', // unrecognized response type\n}\n\n/**\n * MIME patterns for string content types\n * @type {RegExp}\n */\nexport const contentPatternString = new RegExp(matchModeString, 'i')\n\n/**\n * MIME patterns for \"binary\" content types\n * @type {RegExp}\n */\nexport const contentPatternBinary = new RegExp(matchModeBinary, 'i')\n\n/**\n * MIME pattern for UTF8 charset attribute\n * @type {RegExp}\n */\nexport const charsetUtf8Pattern = new RegExp(matchCharsetUtf8, 'i')\n\n/**\n * Default request timeout\n * @type {number} default request timeout is 120 seconds, or two minutes\n */\nexport const defaultTimeout = 120\n\n/** Recognized HTTP methods */\nexport type HttpMethod =\n | 'GET'\n | 'POST'\n | 'PUT'\n | 'DELETE'\n | 'PATCH'\n | 'TRACE'\n | 'HEAD'\n\n/**\n * HTTP status codes\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Status for reference\n * TODO is there a platform-agnostic list of these that can be used instead of this static declaration?\n */\nexport enum StatusCode {\n OK = 200,\n Created,\n Accepted,\n NonAuthoritative,\n NoContent,\n ResetContent,\n PartialContent,\n MultiStatus,\n MultiStatusDav,\n IMUsed = 226,\n MultipleChoice = 300,\n MovedPermanently,\n Found,\n SeeOther,\n NotModified,\n UseProxy,\n UnusedRedirect,\n TemporaryRedirect,\n PermanentRedirect,\n BadRequest = 400,\n Unauthorized,\n PaymentRequired,\n Forbidden,\n NotFound,\n MethodNotAllowed,\n NotAcceptable,\n ProxyAuthRequired,\n RequestTimeout,\n Conflict,\n Gone,\n LengthRequired,\n PreconditionFailed,\n PayloadTooLarge,\n UriTooLong,\n UnsupportedMediaType,\n RequestedRangeNotSatisfiable,\n ExpectationFailed,\n ImATeapot,\n MisdirectedRequest = 421,\n UnprocessableEntity,\n Locked,\n FailedDependency,\n TooEarly,\n UpgradeRequired,\n PreconditionRequired = 428,\n TooManyRequests,\n RequestHeaderFieldsTooLarge = 431,\n UnavailableForLegalReasons = 451,\n InternalServerError = 500,\n NotImplemented,\n BadGateway,\n ServiceUnavailable,\n GatewayTimeout,\n HttpVersionNotSupported,\n VariantAlsoNegotiates,\n InsufficientStorage,\n LoopDetected,\n NotExtended = 510,\n NetworkAuthRequired,\n}\n\n/** Untyped basic HTTP response type for \"raw\" HTTP requests */\nexport interface IRawResponse {\n /** Http method of the request */\n method: HttpMethod\n /** ok is `true` if the response is successful, `false` otherwise */\n ok: boolean\n /** HTTP request url */\n url: string\n /** HTTP response code */\n statusCode: number\n /** HTTP response status message text */\n statusMessage: string\n /** MIME type of the response from the HTTP response header */\n contentType: string\n /** The body of the HTTP response, without any additional processing */\n body: any\n /** Optional performance tracking starting mark name */\n startMark?: string\n /** Response headers */\n headers: IRequestHeaders\n /** Request start time */\n requestStarted: number\n /** Completion time for request */\n responseCompleted: number\n}\n\n/** IRawResponse observer function type */\nexport type RawObserver = (raw: IRawResponse) => IRawResponse\n\n/** Transport plug-in interface */\nexport interface ITransport {\n /** Observer lambda to process raw responses */\n observer: RawObserver | undefined\n\n /**\n * HTTP request function for atomic, fully downloaded raw HTTP responses\n *\n * Note: This method returns the result of the HTTP request without any error handling\n *\n * @param method of HTTP request\n * @param path request path, either relative or fully specified\n * @param queryParams name/value pairs to pass as part of the URL\n * @param body data for the body of the request\n * @param authenticator authenticator callback, typically from `IAuthSession` implementation\n * @param options overrides of default transport settings\n * @returns typed response of `TSuccess`, or `TError` result\n */\n rawRequest(\n method: HttpMethod,\n path: string,\n queryParams?: Values,\n body?: any,\n authenticator?: Authenticator,\n options?: Partial<ITransportSettings>\n ): Promise<IRawResponse>\n\n /**\n * HTTP request function for atomic, fully downloaded responses\n * @param method of HTTP request\n * @param path request path, either relative or fully specified\n * @param queryParams name/value pairs to pass as part of the URL\n * @param body data for the body of the request\n * @param authenticator authenticator callback, typically from `IAuthSession` implementation\n * @param options overrides of default transport settings\n * @returns typed response of `TSuccess`, or `TError` result\n */\n request<TSuccess, TError>(\n method: HttpMethod,\n path: string,\n queryParams?: Values,\n body?: any,\n authenticator?: Authenticator,\n options?: Partial<ITransportSettings>\n ): Promise<SDKResponse<TSuccess, TError>>\n\n /**\n * Processes the raw response, converting it into an SDKResponse\n * @param raw response result\n */\n parseResponse<TSuccess, TError>(\n raw: IRawResponse\n ): Promise<SDKResponse<TSuccess, TError>>\n\n /**\n * HTTP request function for a streamable response\n * @param callback that receives the stream response and pipes it somewhere\n * @param method of HTTP request\n * @param path request path, either relative or fully specified\n * @param queryParams name/value pairs to pass as part of the URL\n * @param body data for the body of the request\n * @param authenticator authenticator callback, typically from `IAuthSession` implementation\n * @param options overrides of default transport settings\n * @returns `T` upon success\n * @throws `ISDKErrorResponse` on failure\n */\n stream<T>(\n callback: (readable: Readable) => Promise<T>,\n method: HttpMethod,\n path: string,\n queryParams?: Values,\n body?: any,\n authenticator?: Authenticator,\n options?: Partial<ITransportSettings>\n ): Promise<T>\n}\n\n/** A successful SDK call. */\nexport interface ISDKSuccessResponse<T> {\n /** Whether the SDK call was successful. */\n ok: true\n /** The object returned by the SDK call. */\n value: T\n}\n\n/** An errant SDK call. */\nexport interface ISDKErrorResponse<T> {\n /** Whether the SDK call was successful. */\n ok: false\n /** The error object returned by the SDK call. */\n error: T\n}\n\n/** An error representing an issue in the SDK, like a network or parsing error. */\nexport interface ISDKError {\n type: 'sdk_error'\n message: string\n}\n\nexport type SDKResponse<TSuccess, TError> =\n | ISDKSuccessResponse<TSuccess>\n | ISDKErrorResponse<TError | ISDKError>\n\n/** Generic collection */\nexport interface IRequestHeaders {\n [key: string]: string\n}\n\n/**\n * Generic http request property collection\n * TODO: Trim this down to what is required\n */\nexport interface IRequestProps {\n [key: string]: any\n /** full url for request, including any query params */\n url: string\n\n /** body of request. optional */\n body?: any\n /** headers for request. optional */\n headers: IRequestHeaders\n /** Http method for request. required. */\n method: HttpMethod\n /** Redirect processing for request. optional */\n redirect?: any\n /** Credentials to use */\n credentials?: 'include' | 'omit' | 'same-origin' | undefined\n\n /** http.Agent instance, allows custom proxy, certificate etc. */\n agent?: Agent\n /** support gzip/deflate content encoding. false to disable */\n compress?: boolean\n /** maximum redirect count. 0 to not follow redirect */\n follow?: number\n /** maximum response body size in bytes */\n size?: number\n /** req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies) */\n timeout?: number\n}\n\n/** General purpose authentication callback */\nexport type Authenticator = (props: any) => any\n\n/** Interface for API transport values */\nexport interface ITransportSettings {\n [key: string]: any\n /** base URL of API REST web service */\n base_url: string\n /** standard headers to provide in all transport requests */\n headers?: Headers\n /** whether to verify ssl certs or not. Defaults to true */\n verify_ssl: boolean\n /** request timeout in seconds. Default to 30 */\n timeout: number\n /** encoding override */\n encoding?: string | null\n /** agent tag to use for the SDK requests */\n agentTag: string\n}\n\n/**\n * Is the content type binary or \"string\"?\n * @param {string} contentType\n * @returns {ResponseMode.binary | ResponseMode.string}\n */\nexport function responseMode(contentType: string) {\n if (contentType.match(contentPatternString)) {\n return ResponseMode.string\n }\n if (contentType.match(contentPatternBinary)) {\n return ResponseMode.binary\n }\n return ResponseMode.unknown\n}\n\n/**\n * Does this content type have a UTF-8 charset?\n * @param contentType\n * @returns match if it exists\n */\nexport function isUtf8(contentType: string) {\n return contentType.match(/;.*\\bcharset\\b=\\butf-8\\b/i)\n}\n\n/** Used for name/value pair collections like for QueryParams */\nexport type Values = { [key: string]: any } | null | undefined\n\n/**\n * Encode parameter if not already encoded\n *\n * Note: this includes recognition of Date, DelimArray, and default objects for special handling\n *\n * @param value value of parameter\n * @returns URI encoded value\n */\nexport function encodeParam(value: any) {\n if (value instanceof Date) {\n value = value.toISOString()\n } else if (value instanceof DelimArray) {\n value = value.toString()\n }\n // check for object type to prevent \"[object Object]\" as the value.toString()\n let encoded =\n typeof value === 'object' ? JSON.stringify(value) : value.toString()\n\n // decodeURIComponent throws URIError if there is a % character\n // without it being part of an encoded\n try {\n const decoded = decodeURIComponent(value)\n if (value === decoded) {\n encoded = encodeURIComponent(value)\n }\n } catch (e) {\n if (e instanceof URIError) {\n encoded = encodeURIComponent(value)\n } else {\n throw e\n }\n }\n return encoded\n}\n\n/**\n * Converts `Values` to query string parameter format\n * @param values Name/value collection to encode\n * @returns {string} query string parameter formatted values. Both `false` and `null` are included. Only `undefined` are omitted.\n */\nexport function encodeParams(values?: Values) {\n if (!values) return ''\n\n const keys = Object.keys(values)\n return keys\n .filter((k) => values[k] !== undefined) // `null` and `false` will both be passed\n .map((k) => k + '=' + encodeParam(values[k]))\n .join('&')\n}\n\n/**\n * constructs the path argument including any optional query parameters\n * @param path the base path of the request\n * @param obj optional collection of query parameters to encode and append to the path\n */\nexport function addQueryParams(path: string, obj?: Values) {\n if (!obj) {\n return path\n }\n const qp = encodeParams(obj)\n return `${path}${qp ? '?' + qp : ''}`\n}\n\nconst utf8 = 'utf-8'\n\n/**\n * Convert this value to a string representation however we can do it\n * @param val\n */\nfunction bufferString(val: any) {\n let result = 'Unknown error'\n try {\n const decoder = new TextDecoder(utf8)\n result = decoder.decode(val)\n } catch (e: any) {\n // Supremely ugly hack. If we get here, we must be in Node (or IE 11, but who cares about that?)\n // Node requires an import from `util` for TextDecoder to be found BUT it \"just has\" Buffer unless WebPack messes us up\n try {\n if (val instanceof Buffer) {\n result = Buffer.from(val).toString(utf8)\n } else {\n result = JSON.stringify(val)\n }\n } catch (err: any) {\n // The fallback logic here will at least give us some information about the error being thrown\n result = JSON.stringify(val)\n }\n }\n return result\n}\n\n/**\n * SDK error handler\n * @param response any kind of error\n * @returns a new `Error` object with the failure message\n */\nexport function sdkError(response: any) {\n if (typeof response === 'string') {\n return new LookerSDKError(response)\n }\n if ('error' in response) {\n const error = response.error\n if (typeof error === 'string') {\n return new LookerSDKError(error)\n }\n // Try to get most specific error first\n if ('error' in error) {\n const result = bufferString(error.error)\n return new LookerSDKError(result)\n }\n if ('message' in error) {\n return new LookerSDKError(response.error.message.toString(), {\n errors: error.errors,\n documentation_url: error.documentation_url,\n })\n }\n if ('statusMessage' in error) {\n return new LookerSDKError(error.statusMessage)\n }\n const result = bufferString(error)\n return new LookerSDKError(result)\n }\n if ('message' in response) {\n return new LookerSDKError(response.message)\n }\n const error = JSON.stringify(response)\n return new LookerSDKError(`Unknown error with SDK method ${error}`)\n}\n\n/** A helper method for simplifying error handling of SDK responses.\n *\n * Pass in a promise returned by any SDK method, and it will return a promise\n * that rejects if the `SDKResponse` is not `ok`. This will swallow the type\n * information in the error case, but allows you to route all the error cases\n * into a single promise rejection.\n *\n * The promise will have an `Error` rejection reason with a string `message`.\n * If the server error contains a `message` field, it will be provided, otherwise a\n * generic message will occur.\n *\n * ```ts\n * const sdk = LookerSDK({...})\n * let look\n * try {\n * look = await sdkOk(sdk.create_look({...}))\n * // do something with look\n * }\n * catch(e) {\n * // handle error case\n * }\n * ```\n */\nexport async function sdkOk<TSuccess, TError>(\n promise: Promise<SDKResponse<TSuccess, TError>>\n) {\n const result = await promise\n if (result.ok) {\n return result.value\n } else {\n throw sdkError(result)\n }\n}\n\n/**\n * Converts a byte array to a \"URL safe\" base64 string\n * @param u8 byte array to convert\n */\nexport function safeBase64(u8: Uint8Array) {\n const rawBase64 = btoa(String.fromCharCode(...u8))\n return rawBase64.replace(/\\+/g, '-').replace(/\\//g, '_')\n}\n\n/**\n * Type predicate. Asserts that a given object is error-like.\n * @param error a value of unknown type\n * @return boolean true if the error has a `message` key of type string.\n */\nexport function isErrorLike<T extends unknown>(\n error: T\n): error is T & { message: string } {\n if (typeof error !== 'object') return false\n if (!error) return false\n if (!Object.prototype.hasOwnProperty.call(error, 'message')) return false\n if (typeof (error as unknown as { message: unknown }).message !== 'string')\n return false\n return true\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA6BA;AACA;AACA;AAAiD;AAAA;AAE1C,IAAMA,WAAW,GAAG,QAAQ;AAAA;AAC5B,IAAMC,WAAW,GAAG,gBAAgB;AAAA;AAG3C,IAAMC,OAAO,GAAG,KAAK;AAOd,SAASC,KAAK,CAACC,OAAe,EAAEC,IAAU,EAAE;EACjD,IAAIH,OAAO,EAAE;IAEXI,OAAO,CAACC,KAAK,CAACH,OAAO,CAAC;IACtB,IAAIC,IAAI,EAAE;MAERC,OAAO,CAACC,KAAK,CAAC;QAAEF;MAAK,CAAC,CAAC;IACzB;EACF;AACF;AAAC,IAGWG,YAAY;AAAA;AAAA,WAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YA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AQA,KAAK,CAAqC7D,OAAO,KAAK,QAAQ,EACxE,OAAO,KAAK;EACd,OAAO,IAAI;AACb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@looker/sdk-rtl",
3
- "version": "21.4.0",
3
+ "version": "21.6.0",
4
4
  "description": "Looker SDK Runtime Library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -35,7 +35,7 @@
35
35
  "homepage": "https://github.com/looker-open-source/sdk-codegen/tree/master/packages/sdk-rtl",
36
36
  "devDependencies": {
37
37
  "@types/ini": "^1.3.30",
38
- "@types/node": "^12.12.6",
38
+ "@types/node": "^14.18.36",
39
39
  "@types/request": "^2.48.3",
40
40
  "@types/request-promise-native": "^1.0.17",
41
41
  "dotenv": "^8.2.0"
@@ -51,5 +51,5 @@
51
51
  "SDK",
52
52
  "RTL"
53
53
  ],
54
- "gitHead": "028fb6cd1f84c23fd10d42041f3d572f4f724195"
54
+ "gitHead": "23e7b80cab16e5be47b14fff1f9ddca98f539369"
55
55
  }