Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@postman/postman-sdk

Package Overview
Dependencies
Maintainers
341
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@postman/postman-sdk - npm Package Compare versions

Comparing version 0.0.24 to 0.0.25

.eslintignore

8

build/postman/base-sdk.d.ts
import { BaseConfig } from './interfaces/base-config';
import { ConfigSource } from './postman-types/base-types';
export declare class PostmanBaseSDK {
configFilePath?: string;
yamlConfigData?: any;
protected configFilePath?: string;
protected yamlConfigData?: {
[index: string]: any;
};
/**

@@ -11,3 +13,3 @@ *

initialize(config?: BaseConfig): void;
initConfig(config?: BaseConfig): BaseConfig | undefined;
initConfig(config?: BaseConfig): BaseConfig;
loadYamlConfig(): void;

@@ -14,0 +16,0 @@ getConfigKeyValue(key: string, configSources: ConfigSource[]): any;

@@ -6,5 +6,6 @@ "use strict";

const yaml = require("js-yaml");
const tracing_1 = require("./tracing");
// open-telemetry imports
const api_1 = require("@opentelemetry/api");
const base_types_1 = require("./postman-types/base-types");
// postman importsØ
const tracing_1 = require("./postman-otel/tracing");
// Base Postman SDK class

@@ -30,14 +31,19 @@ class PostmanBaseSDK {

if (!config) {
return;
config = {};
}
if ('configFilePath' in config) {
this.configFilePath = config.configFilePath;
}
else if (process.env.configFilePath) {
this.configFilePath = process.env.configFilePath;
}
if (this.configFilePath) {
this.loadYamlConfig();
}
const keysOfProps = ["collectionId", "apiToken", "collectorEndpoint", "testCollectorEndpoint", "samplingRatio", "enable", "debug", "dataTruncation", "environment", "configFilePath"];
const keysOfProps = ["collectionId", "apiToken", "collectorEndpoint", "testCollectorEndpoint", "samplingRatio", "enable", "debug", "dataTruncation", "environment", "configFilePath", "dataRedactions"];
for (let key of keysOfProps) {
if (!(key in config)) {
let configValue = this.getConfigKeyValue(key, [
base_types_1.ConfigSource.YAML,
base_types_1.ConfigSource.ENV
"YAML" /* ConfigSource.YAML */,
"ENV" /* ConfigSource.ENV */
]);

@@ -71,14 +77,14 @@ if (configValue) {

getConfigKeyValue(key, configSources) {
if (base_types_1.ConfigSource.YAML in configSources) {
if (key in this.yamlConfigData) {
for (let sourceType of configSources) {
if (sourceType === "YAML" /* ConfigSource.YAML */ && this.yamlConfigData) {
return this.yamlConfigData[key];
}
else if (sourceType === "ENV" /* ConfigSource.ENV */ && process.env[key]) {
return process.env[key];
}
}
else if (base_types_1.ConfigSource.ENV in configSources && process.env[key]) {
return process.env[key];
}
return null;
}
setDebug() {
console.log('Enabling Debugger');
api_1.diag.debug('Enabling Debugger');
api_1.diag.setLogger(new api_1.DiagConsoleLogger(), api_1.DiagLogLevel.DEBUG);

@@ -85,0 +91,0 @@ }

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

import { DataRedactionRules } from './data-redaction-rules';
/**

@@ -23,2 +24,4 @@ * BaseConfig, defines Instrumentation configurations.

configFilePath?: string;
dataRedactions?: DataRedactionRules;
}
export type RuleMap = Map<string, boolean>;
"use strict";
// Defining config structure.
Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,4 +0,15 @@

export declare enum ConfigSource {
export declare const enum ConfigSource {
YAML = "YAML",
ENV = "ENV"
}
export declare enum RequestMethod {
GET = "GET",
POST = "POST",
PUT = "PUT",
DELETE = "DELETE",
PATCH = "PATCH",
HEAD = "HEAD"
}
export declare const DEFAULT_COLLECTOR_END_POINT = "https://trace-service-receiver.postman-beta.tech/traces";
export declare const BASE_REDACTION_REPLACEMENT_STRING = "**********";
export declare const POSTMAN_DATA_REDACTION_SPAN_ATTRIBUTE = "postman.dataRedaction";
"use strict";
/* eslint-disable operator-linebreak */
/* eslint-disable no-unused-vars */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigSource = void 0;
/* eslint-disable no-unused-vars */
var ConfigSource;
(function (ConfigSource) {
ConfigSource["YAML"] = "YAML";
ConfigSource["ENV"] = "ENV";
})(ConfigSource = exports.ConfigSource || (exports.ConfigSource = {}));
exports.POSTMAN_DATA_REDACTION_SPAN_ATTRIBUTE = exports.BASE_REDACTION_REPLACEMENT_STRING = exports.DEFAULT_COLLECTOR_END_POINT = exports.RequestMethod = void 0;
var RequestMethod;
(function (RequestMethod) {
RequestMethod["GET"] = "GET";
RequestMethod["POST"] = "POST";
RequestMethod["PUT"] = "PUT";
RequestMethod["DELETE"] = "DELETE";
RequestMethod["PATCH"] = "PATCH";
RequestMethod["HEAD"] = "HEAD";
})(RequestMethod = exports.RequestMethod || (exports.RequestMethod = {}));
exports.DEFAULT_COLLECTOR_END_POINT = 'https://trace-service-receiver.postman-beta.tech/traces';
exports.BASE_REDACTION_REPLACEMENT_STRING = '**********';
exports.POSTMAN_DATA_REDACTION_SPAN_ATTRIBUTE = 'postman.dataRedaction';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = "0.0.24";
exports.VERSION = '0.0.24';
{
"name": "@postman/postman-sdk",
"version": "0.0.24",
"version": "0.0.25",
"description": "",

@@ -8,3 +8,4 @@ "main": "build/index.js",

"test": "echo \"Error: no test specified\" && exit 1",
"prebuild": "rm -rf build && node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
"prebuild": "rm -rf build && node -p \"'export const VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts && eslint src/version.ts --fix",
"build": "ttsc",

@@ -15,3 +16,4 @@ "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write",

"pre-commit": "npm run prettier-format && npm run lint",
"prepare": "husky install"
"prepare": "husky install",
"pack": "rm -rf build && npm run build && rm -v postman*.tgz && npm pack"
},

@@ -18,0 +20,0 @@ "types": "./build",

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