New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@looker/sdk

Package Overview
Dependencies
Maintainers
0
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@looker/sdk - npm Package Compare versions

Comparing version 24.14.0 to 24.16.1

33

CHANGELOG.md

@@ -8,2 +8,35 @@ # Changelog

## [24.16.1](https://github.com/looker-open-source/sdk-codegen/compare/sdk-v24.16.0...sdk-v24.16.1) (2024-09-14)
### Bug Fixes
* fix release 24.16.2 ([#1505](https://github.com/looker-open-source/sdk-codegen/issues/1505)) ([1cd1806](https://github.com/looker-open-source/sdk-codegen/commit/1cd180615901d2daf1fb112b41f2a72d2caacf61))
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @looker/sdk-rtl bumped from 21.6.2 to 21.6.3
## [24.16.0](https://github.com/looker-open-source/sdk-codegen/compare/sdk-v24.14.0...sdk-v24.16.0) (2024-09-11)
### Features
* generate SDKs for Looker 24.16 ([#1499](https://github.com/looker-open-source/sdk-codegen/issues/1499)) ([109839d](https://github.com/looker-open-source/sdk-codegen/commit/109839d2d4fae10e7aeab088378bba5e2b368019))
### Bug Fixes
* Remove the requests package from the TypeScript SDK ([#1491](https://github.com/looker-open-source/sdk-codegen/issues/1491)) ([670377c](https://github.com/looker-open-source/sdk-codegen/commit/670377c46a546bbd8dcc6679b8aeb041da1b4670)), closes [#1439](https://github.com/looker-open-source/sdk-codegen/issues/1439)
### Dependencies
* The following workspace dependencies were updated
* dependencies
* @looker/sdk-rtl bumped from 21.6.1 to 21.6.2
## [24.14.0](https://github.com/looker-open-source/sdk-codegen/compare/sdk-v24.12.1...sdk-v24.14.0) (2024-08-12)

@@ -10,0 +43,0 @@

2

lib/constants.d.ts

@@ -1,2 +0,2 @@

export declare const sdkVersion = "24.14";
export declare const sdkVersion = "24.16";
export declare const environmentPrefix = "LOOKERSDK";

@@ -7,4 +7,4 @@ "use strict";

exports.sdkVersion = exports.environmentPrefix = void 0;
var sdkVersion = exports.sdkVersion = '24.14';
var sdkVersion = exports.sdkVersion = '24.16';
var environmentPrefix = exports.environmentPrefix = 'LOOKERSDK';
//# sourceMappingURL=constants.js.map

@@ -1,3 +0,3 @@

export var sdkVersion = '24.14';
export var sdkVersion = '24.16';
export var environmentPrefix = 'LOOKERSDK';
//# sourceMappingURL=constants.js.map
import { DefaultSettings, ExtensionSession, ExtensionTransport } from '@looker/sdk-rtl';
import { Looker40SDK } from './4.0/methods';
export class LookerExtensionSDK {
static createClient(hostConnection, type, settings) {
settings = settings || DefaultSettings();
static createClient(hostConnection, _type) {
var settings = DefaultSettings();
var transport = new ExtensionTransport(settings, hostConnection);
var session = new ExtensionSession(settings, transport);
return new type(session);
return new Looker40SDK(session);
}
}
//# sourceMappingURL=extensionSdk.js.map

@@ -1,4 +0,5 @@

import type { APIMethods, IApiSettings, IAuthSession, IHostConnection } from '@looker/sdk-rtl';
import type { IAuthSession, IHostConnection } from '@looker/sdk-rtl';
import { Looker40SDK } from './4.0/methods';
export declare class LookerExtensionSDK {
static createClient<T extends APIMethods>(hostConnection: IHostConnection, type: new (authSession: IAuthSession) => T, settings?: IApiSettings): T;
static createClient(hostConnection: IHostConnection, _type?: new (authSession: IAuthSession) => Looker40SDK): Looker40SDK;
}

@@ -8,8 +8,9 @@ "use strict";

var _sdkRtl = require("@looker/sdk-rtl");
var _methods = require("./4.0/methods");
class LookerExtensionSDK {
static createClient(hostConnection, type, settings) {
settings = settings || (0, _sdkRtl.DefaultSettings)();
static createClient(hostConnection, _type) {
var settings = (0, _sdkRtl.DefaultSettings)();
var transport = new _sdkRtl.ExtensionTransport(settings, hostConnection);
var session = new _sdkRtl.ExtensionSession(settings, transport);
return new type(session);
return new _methods.Looker40SDK(session);
}

@@ -16,0 +17,0 @@ }

{
"name": "@looker/sdk",
"version": "24.14.0",
"version": "24.16.1",
"description": "Looker SDK",

@@ -39,12 +39,4 @@ "main": "lib/index.js",

"homepage": "https://github.com/looker-open-source/sdk-codegen/tree/main/packages/sdk",
"devDependencies": {
"@types/request": "2.48.12",
"@types/request-promise-native": "1.0.21"
},
"dependencies": {
"@looker/sdk-rtl": "21.6.1",
"ini": "^1.3.8",
"readable-stream": "^3.4.0",
"request": "^2.88.0",
"request-promise-native": "^1.0.8"
"@looker/sdk-rtl": "21.6.3"
},

@@ -55,3 +47,3 @@ "keywords": [

],
"gitHead": "0c6b5c02305ad67f559213a281667ba5cbb3b3c3"
"gitHead": "f95fdcebe3e11b4cf1c7d07e26a6b8a153bd074f"
}

@@ -7,3 +7,3 @@ # Looker SDK

The SDK uses a plug-in architecture (also known as dependency injection) for initializing and supports run-time specific transports (like `NodeTransport` and `BrowserTransport`) and different approaches for managing API authentication (like `NodeSession`, `BrowserSession`, `ProxySession`, and `CorsSession`).
The SDK uses a plug-in architecture for initializing and supports run-time specific transports (like `NodeTransport` and `BrowserTransport`) and different approaches for managing API authentication (like `NodeSession`, `BrowserSession`, `ProxySession`, and `CorsSession`).

@@ -33,9 +33,4 @@ Please [report any issues](https://github.com/looker-open-source/sdk-codegen/issues) encountered, and indicate the SDK language in the report.

```
Some other dependencies may be required for your project to build and run correctly.
```bash
yarn install @types/readable-stream @types/request @types/request-promise-native -D
```
### TypeScript SDK packages

@@ -46,4 +41,4 @@

1. `@looker/sdk-rtl` - contains a run time library needed to invoke the Looker API methods. Referencing the `@looker/sdk` as a dependency should automatically pull this package in.
2. `@looker/sdk` - contains the Looker API methods.
3. `@looker/sdk-node` - contains the dependencies needed to run the Looker SDK in a node environment. Do NOT include this package if you are using the Looker SDK in a browser. You MUST include this package if you are using `node` or `ts-node`.
1. `@looker/sdk` - contains the Looker API methods.
1. `@looker/sdk-node` - contains the dependencies needed to run the Looker SDK in a node environment. Do NOT include this package if you are using the Looker SDK in a browser. This SDK is for use with `node` or `ts-node`.

@@ -72,6 +67,63 @@ ### Authenticate your API calls

Please use API 4.0. API 3.1 is deprecated and has been removed in Looker v23.18+.
Only API 4.0 is currently available. API 3.1 has been removed in Looker v23.18+.
`LookerBrowserSDK.init40()` and `Looker40SDK()` initialize the API 4.1 implementation of the SDK.
`LookerBrowserSDK.init40()` and `Looker40SDK()` initialize the API 4.0 implementation of the SDK.
## Customizing HTTP request handling
With the complete removal of the [deprecated request package](https://www.npmjs.com/package/request) the HTTP transport layer has been refactored to have feature parity between Node and the Browser SDK.
The following properties can be specified as part of the `options` parameter, which is the last parameter of every SDK method:
- `timeout` to set a per-request timeout (in seconds)
- `signal` to cancel cancelling requests by passing an `AbortSignal` or `AbortController` signal to an SDK request
- automatically retryable HTTP requests
- enable with `maxTries` > 1
- optionally define a `Waitable` callback for custom retry wait period handling
## Streaming with the SDK
The [deprecated NodeJS `request` package](https://www.npmjs.com/package/request) dependency has been removed from all Looker TypeScript packages. This removal prompted a **BREAKING** interface change for the streaming SDK.
The streaming method callback signature changed from `(readable: Readable) => Promise<x>` to `(response: Response) => Promise<x>`. Using `Response` as the parameter to the callback greatly
increases the flexibility of streaming implementations and provides other valuable information like `Content-Type` and other headers to the streaming callback.
For the Browser SDK (`@looker/sdk`), the standard `fetch` function is still used. For the Node SDK (`@looker/sdk-node`), the global [`fetch`](https://nodejs.org/api/globals.html#fetch) function from NodeJS v22 is used.
This means the Looker Node SDK now uses NodeJS v22.
The streaming version of the SDK methods should be initialized using the same `AuthSession` as the main SDK to reduce authentication thrashing.
Construction of the streaming SDK can use code similar to the following, which is taken from the [downloadTile.ts example](/examples/typescript/downloadTile.ts#L129:L157):
```ts
/**
* Use the streaming SDK to download a tile's query
* @param sdk to use
* @param tile to download
* @param format to download
* @returns name of downloaded file (undefined on failure)
*/
const downloadTileAs = async (
sdk: LookerSDK,
tile: IDashboardElement,
format: string
) => {
const fileName = `${tile.title}.${format}`;
const writer = createWritableStream(fs.createWriteStream(fileName));
const request: IRequestRunQuery = {
result_format: format,
query_id: tile.query_id!,
// apply_formatting: true,
// apply_vis: true
};
const sdkStream = new Looker40SDKStream(sdk.authSession);
await sdkStream.run_query(async (response: Response) => {
await response.body.pipeTo(writer);
return 'streamed';
}, request);
return fileName;
};
```
## Using a Proxy for authentication

@@ -93,6 +145,3 @@

export class EmbedSession extends ProxySession {
constructor(
public settings: IApiSettings,
transport?: ITransport
) {
constructor(public settings: IApiSettings, transport?: ITransport) {
super(settings, transport);

@@ -130,5 +179,5 @@ }

### More examples
## More examples
Looker's open source repository of [SDK Examples](https://github.com/looker-open-source/sdk-examples/tree/master/typescript) has more example scripts and applications that show how to use the Looker SDK.
Looker's open source repository of [SDK Examples](https://github.com/looker-open-source/sdk-codegen/tree/main/examples/typescript) has more example scripts and applications that show how to use the various Looker language SDKs.

@@ -135,0 +184,0 @@ ## A note about security

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc