Socket
Socket
Sign inDemoInstall

@sajari/sdk-node

Package Overview
Dependencies
Maintainers
4
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sajari/sdk-node - npm Package Compare versions

Comparing version 2.0.0-beta.6 to 2.0.0-beta.7

dist/ua.d.ts

2

dist/api.d.ts

@@ -31,3 +31,3 @@ /// <reference types="node" />

secret: string;
}, endpoint?: string);
}, endpoint?: string, insecure?: boolean);
call<Request, Response>(path: string, request: Request, encoder: Encoder<Request>, decoder: Decoder<Response>, options?: CallOptions): Promise<Response>;

@@ -34,0 +34,0 @@ /**

@@ -10,2 +10,3 @@ "use strict";

var retryInterceptor_1 = __importDefault(require("./retryInterceptor"));
var ua_1 = require("./ua");
/**

@@ -17,3 +18,4 @@ * Custom formatter for call options.

debug_1.default.formatters.C = function callOptionsFormatter(options) {
if (process.env.DEBUG_SHOW_CREDS) {
if (process.env.DEBUG_SHOW_CREDS &&
process.env.DEBUG_SHOW_CREDS.toLowerCase() === "true") {
return JSON.stringify(options);

@@ -34,7 +36,2 @@ }

/**
* The user agent of the sdk client
* @hidden
*/
var USER_AGENT = "sdk-node-1.0.0";
/**
* The deault grpc authority

@@ -50,9 +47,12 @@ * @hidden

var APIClient = /** @class */ (function () {
function APIClient(project, collection, credentials, endpoint) {
function APIClient(project, collection, credentials, endpoint, insecure) {
if (endpoint === void 0) { endpoint = API_ENDPOINT; }
if (insecure === void 0) { insecure = false; }
this.credentials = credentials;
this.endpoint = endpoint;
this.client = new grpc_1.default.Client(this.endpoint, grpc_1.default.credentials.combineChannelCredentials(grpc_1.default.credentials.createSsl(), createCallCredentials(this.credentials.key, this.credentials.secret)), {
this.client = new grpc_1.default.Client(this.endpoint, insecure
? grpc_1.default.credentials.createInsecure()
: grpc_1.default.credentials.createSsl(), {
"grpc.default_authority": AUTHORITY,
"grpc.primary_user_agent": USER_AGENT
"grpc.primary_user_agent": ua_1.USER_AGENT
});

@@ -75,6 +75,10 @@ this.metadata = new grpc_1.default.Metadata();

debug("request: %j", request);
_this.client.makeUnaryRequest(path, wrapEncoder(encoder), decoder, request, _this.metadata, {
var metadata = _this.metadata.clone();
metadata.set("authorization", "keysecret " + callOptions.credentials.key + " " + callOptions.credentials.secret);
_this.client.makeUnaryRequest(path, wrapEncoder(encoder), decoder, request, metadata, {
deadline: deadline(callOptions.deadline),
// tslint:disable-next-line:no-bitwise
propagate_flags: grpc_1.default.propagate.DEFAULTS & ~grpc_1.default.propagate.DEADLINE,
// NOTE(@bhinchley): credentials is required by the type CallOptions,
// but this appears to do nothing.
credentials: createCallCredentials(callOptions.credentials.key, callOptions.credentials.secret),

@@ -81,0 +85,0 @@ interceptors: [retryInterceptor_1.default(3)]

@@ -11,3 +11,3 @@ import { Interaction } from "./interaction";

secret: string;
}, endpoint?: string);
}, endpoint?: string, insecure?: boolean);
close(): void;

@@ -14,0 +14,0 @@ wait(seconds: number): Promise<void>;

@@ -9,4 +9,5 @@ "use strict";

var Client = /** @class */ (function () {
function Client(project, collection, credentials, endpoint) {
this.client = new api_1.APIClient(project, collection, credentials, endpoint);
function Client(project, collection, credentials, endpoint, insecure) {
if (insecure === void 0) { insecure = false; }
this.client = new api_1.APIClient(project, collection, credentials, endpoint, insecure);
}

@@ -13,0 +14,0 @@ Client.prototype.close = function () {

@@ -63,4 +63,3 @@ "use strict";

if (status.code !== grpc_1.status.OK &&
status.code === grpc_1.status.UNAVAILABLE &&
status.details.startsWith("TCP Read failed")) {
status.code === grpc_1.status.UNAVAILABLE) {
retry(savedSendMessage, savedMetadata);

@@ -67,0 +66,0 @@ }

{
"name": "@sajari/sdk-node",
"version": "2.0.0-beta.6",
"version": "2.0.0-beta.7",
"main": "dist/index.js",

@@ -18,3 +18,3 @@ "types": "dist/index.d.ts",

"scripts": {
"prebuild": "npm-run-all lint test",
"prebuild": "npm-run-all gen:useragent lint test",
"build": "tsc",

@@ -29,2 +29,3 @@ "fmt": "prettier --write --config .prettierrc.js \"{src/**/*,*.config,*.d,.*,package}.{js,ts,json}\"",

"gen:proto": "node scripts/genproto",
"gen:useragent": "node scripts/genuseragent",
"docs": "typedoc ./src/index.ts --mode file --out ./docs --exclude \"**/*+(.test).ts\"",

@@ -35,21 +36,21 @@ "prepublishOnly": "npm-run-all build"

"debug": "^4.1.1",
"deepmerge": "^3.2.0",
"grpc": "1.16.1",
"deepmerge": "^4.0.0",
"grpc": "^1.22.2",
"protobufjs": "^6.8.8"
},
"devDependencies": {
"@types/debug": "^4.1.2",
"@types/jest": "^24.0.11",
"globby": "^9.1.0",
"grpc-tools": "^1.7.1",
"jest": "^24.5.0",
"make-dir": "^2.1.0",
"@types/debug": "^4.1.4",
"@types/jest": "^24.0.15",
"globby": "^10.0.1",
"grpc-tools": "^1.8.0",
"jest": "^24.8.0",
"make-dir": "^3.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.16.4",
"ts-jest": "^24.0.0",
"tslint": "^5.14.0",
"prettier": "^1.18.2",
"ts-jest": "^24.0.2",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.14.2",
"typescript": "^3.3.3333"
"typescript": "^3.5.3"
}
}
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