@looker/sdk-rtl 21.3.0 → 21.3.1
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 +7 -0
- package/lib/authSession.d.ts +2 -3
- package/lib/authSession.js.map +1 -1
- package/lib/esm/authSession.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.3.1](https://www.github.com/looker-open-source/sdk-codegen/compare/sdk-rtl-v21.3.0...sdk-rtl-v21.3.1) (2021-12-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* rtl IError type ([#928](https://www.github.com/looker-open-source/sdk-codegen/issues/928)) ([7d8f906](https://www.github.com/looker-open-source/sdk-codegen/commit/7d8f906f4b10b5e915df292fcf30d1eb456c3463))
|
|
14
|
+
|
|
8
15
|
## [21.3.0](https://www.github.com/looker-open-source/sdk-codegen/compare/sdk-rtl-v21.2.0...sdk-rtl-v21.3.0) (2021-12-16)
|
|
9
16
|
|
|
10
17
|
|
package/lib/authSession.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IRequestProps, ITransport, SDKResponse } from './transport';
|
|
2
2
|
import type { IApiSettings } from './apiSettings';
|
|
3
|
-
import type { Url } from './constants';
|
|
4
3
|
export interface IAccessToken {
|
|
5
4
|
access_token?: string;
|
|
6
5
|
token_type?: string;
|
|
@@ -8,8 +7,8 @@ export interface IAccessToken {
|
|
|
8
7
|
refresh_token?: string;
|
|
9
8
|
}
|
|
10
9
|
export interface IError {
|
|
11
|
-
message: string;
|
|
12
|
-
documentation_url:
|
|
10
|
+
message: string | null;
|
|
11
|
+
documentation_url: string | null;
|
|
13
12
|
}
|
|
14
13
|
export interface IAuthSession {
|
|
15
14
|
settings: IApiSettings;
|
package/lib/authSession.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/authSession.ts"],"names":["AuthSession","constructor","settings","transport","login","_sudoId","Promise","reject","TBD","logout","resolve","isSudo","sudoId","isAuthenticated","reset","ok","promise","result","value","Buffer","message","toString"],"mappings":";;;;;;;AA2BA;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/authSession.ts"],"names":["AuthSession","constructor","settings","transport","login","_sudoId","Promise","reject","TBD","logout","resolve","isSudo","sudoId","isAuthenticated","reset","ok","promise","result","value","Buffer","message","toString"],"mappings":";;;;;;;AA2BA;;;;;;;;AA4GO,MAAeA,WAAf,CAAmD;AAM9CC,EAAAA,WAAW,CAACC,QAAD,EAAyBC,SAAzB,EAAgD;AAAA;;AAAA,oCAH5D,EAG4D;;AAAA;;AACnE,SAAKD,QAAL,GAAgBA,QAAhB;AACA,SAAKC,SAAL,GAAiBA,SAAjB;AACD;;AA0BDC,EAAAA,KAAK,CAACC,OAAD,EAA0C;AAC7C,WAAOC,OAAO,CAACC,MAAR,CAAeP,WAAW,CAACQ,GAA3B,CAAP;AACD;;AAODC,EAAAA,MAAM,GAAqB;AACzB,WAAOH,OAAO,CAACI,OAAR,CAAgB,KAAhB,CAAP;AACD;;AAKDC,EAAAA,MAAM,GAAY;AAChB,WAAO,KAAKC,MAAL,KAAgB,EAAhB,IAAsB,KAAKC,eAAL,EAA7B;AACD;;AAKDC,EAAAA,KAAK,GAAS;AACZ,SAAKF,MAAL,GAAc,EAAd;AACD;;AAEeG,EAAAA,EAAE,CAChBC,OADgB,EAEhB;AAAA;AACA,UAAMC,MAAM,SAASD,OAArB;;AACA,UAAIC,MAAM,CAACF,EAAX,EAAe;AACb,eAAOE,MAAM,CAACC,KAAd;AACD,OAFD,MAEO;AACL,YAAID,MAAM,YAAYE,MAAtB,EAA8B;AAC5B,gBAAM,yBAAS;AAAEC,YAAAA,OAAO,EAAEH,MAAM,CAACI,QAAP,CAAgB,MAAhB;AAAX,WAAT,CAAN;AACD,SAFD,MAEO;AACL,gBAAM,yBAASJ,MAAT,CAAN;AACD;AACF;AAVD;AAWD;;AA3EuD;;;;gBAApCjB,W,SACP,uC","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 { IRequestProps, ITransport, SDKResponse } from './transport'\nimport { sdkError } from './transport'\nimport type { IApiSettings } from './apiSettings'\n\n/**\n * Same as the Looker API access token object\n * Re-declared here to be independent of model generation\n */\nexport interface IAccessToken {\n /**\n * Access Token used for API calls (read-only)\n */\n access_token?: string\n /**\n * Type of Token (read-only)\n */\n token_type?: string\n /**\n * Number of seconds before the token expires (read-only)\n */\n expires_in?: number\n /**\n * Refresh token which can be used to obtain a new access token (read-only)\n */\n refresh_token?: string\n}\n\n/**\n * Same as the Looker API error object\n * Re-declared here to be independent of model generation\n */\nexport interface IError {\n /**\n * Error details (read-only)\n */\n message: string | null\n /**\n * Documentation link (read-only)\n */\n documentation_url: string | null\n}\n\n/**\n * Basic authorization session interface for most API authentication scenarios\n */\nexport interface IAuthSession {\n settings: IApiSettings\n transport: ITransport\n /**\n * ID of sudo user\n */\n sudoId: string\n\n /**\n * is the current session authenticated?\n */\n isAuthenticated(): boolean\n\n /**\n * Decorate the request with authentication information\n * @param props Properties of request to use or update in callback\n * @returns the request properties with authentication information added\n */\n authenticate(props: IRequestProps): Promise<IRequestProps>\n\n /**\n * Log out the current user\n *\n * - if the current user is a sudo user, the API user becomes the active user\n * - if the current user is the API user, the API session is logged out\n * - any subsequent SDK method calls will automatically log the API user back in for this scenario\n * @returns {Promise<boolean>} `true` if a logout happened, `false` otherwise\n */\n logout(): Promise<boolean>\n\n /**\n * Typically returns an `IAccessToken` but could be any data used for auth.\n *\n * This method is not used in all session patterns, so it's not abstract in the base AuthSession\n *\n * @returns {Promise<any>} authentication information\n */\n getToken(): Promise<any>\n\n /**\n *\n * @returns `true` if the auth session is in sudo mode\n */\n isSudo(): boolean\n\n /**\n * Login to the auth session, optionally as a sudo user\n * @param {string | number} sudoId\n * @returns {Promise<any>} authentication data\n */\n login(sudoId?: string | number): Promise<any>\n\n /**\n * Clears all authentication tracking. Does **not** log the API user out in default implementations.\n */\n reset(): void\n}\n\n/**\n * Base implementation of automatically authenticated sessions for calling API endpoints\n *\n * All \"auth session\" components can descend from this class\n *\n */\nexport abstract class AuthSession implements IAuthSession {\n static TBD = 'Method not implemented in AuthSession'\n settings: IApiSettings\n sudoId = ''\n transport: ITransport\n\n protected constructor(settings: IApiSettings, transport: ITransport) {\n this.settings = settings\n this.transport = transport\n }\n\n /**\n * Decorate request properties with the required authentication information\n *\n * Properties could be additional headers, cookies, or some other request property\n *\n * @param props Request properties to use and/or modify in authentication method\n */\n abstract authenticate(props: IRequestProps): Promise<IRequestProps>\n\n /**\n * Does the session have active authentication information?\n */\n abstract isAuthenticated(): boolean\n\n /**\n * Override this method to implement a authentication retrieval from the server\n */\n abstract getToken(): Promise<any>\n\n /**\n * Override this method to implement API session login\n *\n * @param sudoId ID of sudo user. A missing sudoId means the API credentials are used to login\n */\n login(_sudoId?: string | number): Promise<any> {\n return Promise.reject(AuthSession.TBD)\n }\n\n /**\n * Override this method to implement logout\n *\n * The base implementation just returns a false promise.\n */\n logout(): Promise<boolean> {\n return Promise.resolve(false)\n }\n\n /**\n * Is a sudo user active for this session?\n */\n isSudo(): boolean {\n return this.sudoId !== '' && this.isAuthenticated()\n }\n\n /**\n * Resets all authentication status, but standard implementations do NOT log out an API session\n */\n reset(): void {\n this.sudoId = ''\n }\n\n protected async ok<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 if (result instanceof Buffer) {\n throw sdkError({ message: result.toString('utf8') })\n } else {\n throw sdkError(result)\n }\n }\n }\n}\n"],"file":"authSession.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/authSession.ts"],"names":["sdkError","AuthSession","constructor","settings","transport","login","_sudoId","Promise","reject","TBD","logout","resolve","isSudo","sudoId","isAuthenticated","reset","ok","promise","result","value","Buffer","message","toString"],"mappings":";;;;;;AA2BA,SAASA,QAAT,QAAyB,aAAzB;
|
|
1
|
+
{"version":3,"sources":["../../src/authSession.ts"],"names":["sdkError","AuthSession","constructor","settings","transport","login","_sudoId","Promise","reject","TBD","logout","resolve","isSudo","sudoId","isAuthenticated","reset","ok","promise","result","value","Buffer","message","toString"],"mappings":";;;;;;AA2BA,SAASA,QAAT,QAAyB,aAAzB;AA4GA,OAAO,MAAeC,WAAf,CAAmD;AAM9CC,EAAAA,WAAW,CAACC,QAAD,EAAyBC,SAAzB,EAAgD;AAAA;;AAAA,oCAH5D,EAG4D;;AAAA;;AACnE,SAAKD,QAAL,GAAgBA,QAAhB;AACA,SAAKC,SAAL,GAAiBA,SAAjB;AACD;;AA0BDC,EAAAA,KAAK,CAACC,OAAD,EAA0C;AAC7C,WAAOC,OAAO,CAACC,MAAR,CAAeP,WAAW,CAACQ,GAA3B,CAAP;AACD;;AAODC,EAAAA,MAAM,GAAqB;AACzB,WAAOH,OAAO,CAACI,OAAR,CAAgB,KAAhB,CAAP;AACD;;AAKDC,EAAAA,MAAM,GAAY;AAChB,WAAO,KAAKC,MAAL,KAAgB,EAAhB,IAAsB,KAAKC,eAAL,EAA7B;AACD;;AAKDC,EAAAA,KAAK,GAAS;AACZ,SAAKF,MAAL,GAAc,EAAd;AACD;;AAEeG,EAAAA,EAAE,CAChBC,OADgB,EAEhB;AAAA;AACA,UAAMC,MAAM,SAASD,OAArB;;AACA,UAAIC,MAAM,CAACF,EAAX,EAAe;AACb,eAAOE,MAAM,CAACC,KAAd;AACD,OAFD,MAEO;AACL,YAAID,MAAM,YAAYE,MAAtB,EAA8B;AAC5B,gBAAMpB,QAAQ,CAAC;AAAEqB,YAAAA,OAAO,EAAEH,MAAM,CAACI,QAAP,CAAgB,MAAhB;AAAX,WAAD,CAAd;AACD,SAFD,MAEO;AACL,gBAAMtB,QAAQ,CAACkB,MAAD,CAAd;AACD;AACF;AAVD;AAWD;;AA3EuD;;gBAApCjB,W,SACP,uC","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 { IRequestProps, ITransport, SDKResponse } from './transport'\nimport { sdkError } from './transport'\nimport type { IApiSettings } from './apiSettings'\n\n/**\n * Same as the Looker API access token object\n * Re-declared here to be independent of model generation\n */\nexport interface IAccessToken {\n /**\n * Access Token used for API calls (read-only)\n */\n access_token?: string\n /**\n * Type of Token (read-only)\n */\n token_type?: string\n /**\n * Number of seconds before the token expires (read-only)\n */\n expires_in?: number\n /**\n * Refresh token which can be used to obtain a new access token (read-only)\n */\n refresh_token?: string\n}\n\n/**\n * Same as the Looker API error object\n * Re-declared here to be independent of model generation\n */\nexport interface IError {\n /**\n * Error details (read-only)\n */\n message: string | null\n /**\n * Documentation link (read-only)\n */\n documentation_url: string | null\n}\n\n/**\n * Basic authorization session interface for most API authentication scenarios\n */\nexport interface IAuthSession {\n settings: IApiSettings\n transport: ITransport\n /**\n * ID of sudo user\n */\n sudoId: string\n\n /**\n * is the current session authenticated?\n */\n isAuthenticated(): boolean\n\n /**\n * Decorate the request with authentication information\n * @param props Properties of request to use or update in callback\n * @returns the request properties with authentication information added\n */\n authenticate(props: IRequestProps): Promise<IRequestProps>\n\n /**\n * Log out the current user\n *\n * - if the current user is a sudo user, the API user becomes the active user\n * - if the current user is the API user, the API session is logged out\n * - any subsequent SDK method calls will automatically log the API user back in for this scenario\n * @returns {Promise<boolean>} `true` if a logout happened, `false` otherwise\n */\n logout(): Promise<boolean>\n\n /**\n * Typically returns an `IAccessToken` but could be any data used for auth.\n *\n * This method is not used in all session patterns, so it's not abstract in the base AuthSession\n *\n * @returns {Promise<any>} authentication information\n */\n getToken(): Promise<any>\n\n /**\n *\n * @returns `true` if the auth session is in sudo mode\n */\n isSudo(): boolean\n\n /**\n * Login to the auth session, optionally as a sudo user\n * @param {string | number} sudoId\n * @returns {Promise<any>} authentication data\n */\n login(sudoId?: string | number): Promise<any>\n\n /**\n * Clears all authentication tracking. Does **not** log the API user out in default implementations.\n */\n reset(): void\n}\n\n/**\n * Base implementation of automatically authenticated sessions for calling API endpoints\n *\n * All \"auth session\" components can descend from this class\n *\n */\nexport abstract class AuthSession implements IAuthSession {\n static TBD = 'Method not implemented in AuthSession'\n settings: IApiSettings\n sudoId = ''\n transport: ITransport\n\n protected constructor(settings: IApiSettings, transport: ITransport) {\n this.settings = settings\n this.transport = transport\n }\n\n /**\n * Decorate request properties with the required authentication information\n *\n * Properties could be additional headers, cookies, or some other request property\n *\n * @param props Request properties to use and/or modify in authentication method\n */\n abstract authenticate(props: IRequestProps): Promise<IRequestProps>\n\n /**\n * Does the session have active authentication information?\n */\n abstract isAuthenticated(): boolean\n\n /**\n * Override this method to implement a authentication retrieval from the server\n */\n abstract getToken(): Promise<any>\n\n /**\n * Override this method to implement API session login\n *\n * @param sudoId ID of sudo user. A missing sudoId means the API credentials are used to login\n */\n login(_sudoId?: string | number): Promise<any> {\n return Promise.reject(AuthSession.TBD)\n }\n\n /**\n * Override this method to implement logout\n *\n * The base implementation just returns a false promise.\n */\n logout(): Promise<boolean> {\n return Promise.resolve(false)\n }\n\n /**\n * Is a sudo user active for this session?\n */\n isSudo(): boolean {\n return this.sudoId !== '' && this.isAuthenticated()\n }\n\n /**\n * Resets all authentication status, but standard implementations do NOT log out an API session\n */\n reset(): void {\n this.sudoId = ''\n }\n\n protected async ok<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 if (result instanceof Buffer) {\n throw sdkError({ message: result.toString('utf8') })\n } else {\n throw sdkError(result)\n }\n }\n }\n}\n"],"file":"authSession.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@looker/sdk-rtl",
|
|
3
|
-
"version": "21.3.
|
|
3
|
+
"version": "21.3.1",
|
|
4
4
|
"description": "Looker SDK Runtime Library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"SDK",
|
|
52
52
|
"RTL"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "933163198d7e1ab482c8c5aedc43c35eb9923d86"
|
|
55
55
|
}
|