bryns-extension-api
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -11,3 +11,3 @@ import { ExtensionHostApi, ExtensionHostApiConfiguration, ExtensionNotification } from './types'; | ||
invokeCoreSdkByName(apiMethodName: string, body?: any, params?: any): Promise<any>; | ||
invokeCoreSdkByPath(httpMethod: string, path: string, body?: any, params?: any, options?: any): Promise<any>; | ||
invokeCoreSdkByPath(httpMethod: string, path: string, params?: any, body?: any, authenticator?: any, options?: any): Promise<any>; | ||
updateTitle(title: string): void; | ||
@@ -14,0 +14,0 @@ updateLocation(url: string, state?: any): void; |
@@ -110,3 +110,3 @@ "use strict"; | ||
}; | ||
ExtensionHostApiImpl.prototype.invokeCoreSdkByPath = function (httpMethod, path, body, params, options) { | ||
ExtensionHostApiImpl.prototype.invokeCoreSdkByPath = function (httpMethod, path, params, body, authenticator, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -117,4 +117,5 @@ return __generator(this, function (_a) { | ||
path: path, | ||
params: params, | ||
body: body, | ||
params: params, | ||
authenticator: authenticator, | ||
options: options | ||
@@ -121,0 +122,0 @@ })]; |
@@ -74,3 +74,3 @@ import { ChattyHostConnection } from '@looker/chatty'; | ||
invokeCoreSdkByName(methodName: string, body?: any, params?: any, options?: any): Promise<any>; | ||
invokeCoreSdkByPath(httpMethod: string, path: string, body?: any, params?: any, options?: any): Promise<any>; | ||
invokeCoreSdkByPath(httpMethod: string, path: string, body?: any, params?: any, authenticator?: any, options?: any): Promise<any>; | ||
updateTitle(title: string): void; | ||
@@ -77,0 +77,0 @@ updateLocation(url: string, state?: any): void; |
@@ -7,3 +7,4 @@ import { HttpMethod, ITransport, ITransportSettings, SDKResponse } from '@looker/sdk/dist/rtl/transport'; | ||
constructor(options: ITransportSettings, hostConnection: ExtensionHostApi); | ||
request<TSuccess, TError>(method: HttpMethod, path: string, queryParams?: any, body?: any): Promise<SDKResponse<TSuccess, TError>>; | ||
request<TSuccess, TError>(method: HttpMethod, path: string, queryParams?: any, body?: any, authenticator?: any, options?: Partial<ITransportSettings>): Promise<SDKResponse<TSuccess, TError>>; | ||
stream<TSuccess>(callback: (readable: any) => Promise<TSuccess>, method: HttpMethod, path: string, queryParams?: any, body?: any, authenticator?: any, options?: Partial<ITransportSettings>): Promise<TSuccess>; | ||
} |
@@ -71,11 +71,27 @@ "use strict"; | ||
} | ||
ExtensionTransport.prototype.request = function (method, path, queryParams, body) { | ||
ExtensionTransport.prototype.request = function (method, path, queryParams, body, authenticator, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var params; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.hostConnection.invokeCoreSdkByPath(method, path, body, queryParams)]; | ||
if (queryParams) { | ||
params = {}; | ||
Object.keys(queryParams).forEach(function (key) { | ||
if (queryParams[key]) { | ||
params[key] = queryParams[key]; | ||
} | ||
}); | ||
} | ||
return [2 /*return*/, this.hostConnection.invokeCoreSdkByPath(method, path, params, body, undefined, options)]; | ||
}); | ||
}); | ||
}; | ||
ExtensionTransport.prototype.stream = function (callback, method, path, queryParams, body, authenticator, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
throw new Error('stream not supported'); | ||
}); | ||
}); | ||
}; | ||
return ExtensionTransport; | ||
}()); | ||
exports.ExtensionTransport = ExtensionTransport; |
{ | ||
"name": "bryns-extension-api", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Bryns Extension Client API", | ||
@@ -20,2 +20,3 @@ "main": "lib/index.js", | ||
"@types/jest": "^24.0.19", | ||
"@types/readable-stream": "^2.3.5", | ||
"jest": "24.9", | ||
@@ -22,0 +23,0 @@ "ts-jest": "^24.1.0", |
@@ -160,4 +160,5 @@ /* | ||
'/looker/all_connections', | ||
{ params: true }, | ||
{ body: true }, | ||
{ params: true }, | ||
undefined, | ||
{ options: true } | ||
@@ -164,0 +165,0 @@ ) |
@@ -98,4 +98,5 @@ /* | ||
path: string, | ||
params?: any, | ||
body?: any, | ||
params?: any, | ||
authenticator?: any, | ||
options?: any | ||
@@ -106,4 +107,5 @@ ): Promise<any> { | ||
path, | ||
params, | ||
body, | ||
params, | ||
authenticator, | ||
options | ||
@@ -110,0 +112,0 @@ }) |
@@ -115,2 +115,3 @@ /* | ||
params?: any, | ||
authenticator?: any, | ||
options?: any | ||
@@ -117,0 +118,0 @@ ): Promise<any> |
@@ -83,4 +83,5 @@ /* | ||
options: undefined, | ||
params: { fields: '' }, | ||
path: '/connections' | ||
params: {}, | ||
path: '/connections', | ||
authenticator: undefined | ||
}, | ||
@@ -87,0 +88,0 @@ type: 'INVOKE_CORE_SDK' |
@@ -47,11 +47,37 @@ /* | ||
queryParams?: any, | ||
body?: any | ||
body?: any, | ||
authenticator?: any, | ||
options?: Partial<ITransportSettings> | ||
): Promise<SDKResponse<TSuccess, TError>> { | ||
let params: any | ||
if (queryParams) { | ||
params = {} | ||
Object.keys(queryParams).forEach((key) => { | ||
if (queryParams[key]) { | ||
params[key] = queryParams[key] | ||
} | ||
}) | ||
} | ||
return this.hostConnection.invokeCoreSdkByPath( | ||
method, | ||
path, | ||
params, | ||
body, | ||
queryParams | ||
undefined, | ||
options | ||
) | ||
} | ||
async stream<TSuccess> ( | ||
callback: (readable: any) => Promise<TSuccess>, | ||
method: HttpMethod, | ||
path: string, | ||
queryParams?: any, | ||
body?: any, | ||
authenticator?: any, | ||
options?: Partial<ITransportSettings> | ||
): Promise<TSuccess> { | ||
throw new Error('stream not supported') | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104691
2462
12