Socket
Socket
Sign inDemoInstall

ns8-switchboard-interfaces

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ns8-switchboard-interfaces - npm Package Compare versions

Comparing version 1.0.57 to 1.0.58

7

dist/SwitchContext.d.ts

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

/// <reference types="node" />
import { Merchant } from 'ns8-protect-models';
import { URL } from 'url';
export declare class SwitchContext {

@@ -6,3 +8,6 @@ readonly apiBaseUrl: URL;

data: any;
constructor(apiBaseUrl: URL, merchant: Merchant, data: any);
constructor(context: any);
createWebhookUrl(action: string): URL;
createTrackingUrl(): URL;
getIntegrationAccessToken(type: string): string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const url_1 = require("url");
class SwitchContext {
constructor(apiBaseUrl, merchant, data) {
this.apiBaseUrl = apiBaseUrl;
this.merchant = merchant;
this.data = data;
constructor(context) {
this.apiBaseUrl = context.apiBaseUrl;
this.merchant = context.merchant;
this.data = context.data;
}
createWebhookUrl(action) {
const webhook = new url_1.URL(this.data.executorEndpoint, this.apiBaseUrl);
const queryParams = new url_1.URLSearchParams({
action,
authorization: this.merchant.accessTokens[0].id,
});
webhook.search = queryParams.toString();
return webhook;
}
createTrackingUrl() {
const url = new url_1.URL(this.data.trackingEndpoint, this.apiBaseUrl);
const queryParams = new url_1.URLSearchParams({
authorization: this.merchant.accessTokens[0].id,
});
url.search = queryParams.toString();
return url;
}
getIntegrationAccessToken(type) {
return this.merchant.serviceIntegrations
.find((integration) => integration.type === type)
.token;
}
}
exports.SwitchContext = SwitchContext;
//# sourceMappingURL=SwitchContext.js.map

2

package.json
{
"name": "ns8-switchboard-interfaces",
"version": "1.0.57",
"version": "1.0.58",
"description": "Contains switchboard interfaces",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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