New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@cloudbase/cloud-api

Package Overview
Dependencies
Maintainers
14
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudbase/cloud-api - npm Package Compare versions

Comparing version
0.5.3
to
0.5.4
+8
-3
lib/cloud-api-service.js

@@ -60,2 +60,6 @@ "use strict";

};
const USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT";
const intranetUrlMap = Object.keys(ServiceVersionMap).map((service) => ({
[service]: `https://${service}.internal.tencentcloudapi.com`,
})).reduce((acc, cur) => (Object.assign(Object.assign({}, acc), cur)), {});
exports.fetch = request_1.fetch;

@@ -105,7 +109,8 @@ exports.fetchStream = request_1.fetchStream;

const urlMap = {
tcb: 'https://tcb.tencentcloudapi.com',
tcb: process.env.CLOUDBASE_TCB_CLOUDAPI_URL || 'https://tcb.tencentcloudapi.com',
flexdb: 'https://flexdb.tencentcloudapi.com',
};
if (this.service === 'tcb' && process.env.CLOUDBASE_TCB_CLOUDAPI_URL) {
return process.env.CLOUDBASE_TCB_CLOUDAPI_URL;
// 云梯账号走内网域名
if (USE_INTERNAL_ENDPOINT in process.env) {
return intranetUrlMap[this.service];
}

@@ -112,0 +117,0 @@ if (urlMap[this.service]) {

{
"name": "@cloudbase/cloud-api",
"version": "0.5.3",
"version": "0.5.4",
"description": "The cloud api request package.",

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

@@ -63,2 +63,8 @@ import crypto from 'crypto';

const USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT";
const intranetUrlMap = Object.keys(ServiceVersionMap).map((service) => ({
[service]: `https://${service}.internal.tencentcloudapi.com`,
})).reduce((acc, cur) => ({ ...acc, ...cur }), {});
export interface ServiceOptions {

@@ -169,10 +175,15 @@ service: string;

const urlMap = {
tcb: 'https://tcb.tencentcloudapi.com',
tcb: process.env.CLOUDBASE_TCB_CLOUDAPI_URL || 'https://tcb.tencentcloudapi.com',
flexdb: 'https://flexdb.tencentcloudapi.com',
};
if (this.service === 'tcb' && process.env.CLOUDBASE_TCB_CLOUDAPI_URL) {
return process.env.CLOUDBASE_TCB_CLOUDAPI_URL;
// 云梯账号走内网域名
if(USE_INTERNAL_ENDPOINT in process.env) {
return intranetUrlMap[this.service];
}
if(this.service === 'lowcode' && process.env.CLOUDBASE_LOWCODE_CLOUDAPI_URL) {
return process.env.CLOUDBASE_LOWCODE_CLOUDAPI_URL;
}
if (urlMap[this.service]) {

@@ -341,3 +352,3 @@ return urlMap[this.service];

const querystring = urlObj.search.slice(1);

@@ -344,0 +355,0 @@