@alipay/faas-server-sdk
Advanced tools
Comparing version 0.0.25 to 0.0.26
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Cloud=exports.initRuntimeEnv=void 0;const callFunction_1=require("./callFunction"),Database_1=require("./Database"),MySQL_1=require("./MySQL"),utils_1=require("./utils"),runtimeEnv={RUNTIME_ACCESS_KEY:"",RUNTIME_SECRET_KEY:"",RUNTIME_ENV_ID:"",RUNTIME_FUNCTION_NAME:"",RUNTIME_FUNCTION_GATEWAY_VIP:"",RUNTIME_FUNCTION_INSTANCE_ID:"",RUNTIME_MONGO_CLUSTER_ENDPOINT:"",RUNTIME_MONGO_DATABASE_NAME:""};function initRuntimeEnv(E){Object.assign(runtimeEnv,E)}exports.initRuntimeEnv=initRuntimeEnv;class Cloud{#t;#E;#N;constructor(){this.refreshConfig()}refreshConfig(){this.#t?(runtimeEnv.RUNTIME_ACCESS_KEY&&(this.#t.secretId=runtimeEnv.RUNTIME_ACCESS_KEY),runtimeEnv.RUNTIME_SECRET_KEY&&(this.#t.secretKey=runtimeEnv.RUNTIME_SECRET_KEY),runtimeEnv.RUNTIME_ENV_ID&&(this.#t.fromEnvId=runtimeEnv.RUNTIME_ENV_ID,this.#t.toEnvId||(this.#t.toEnvId=runtimeEnv.RUNTIME_ENV_ID)),runtimeEnv.RUNTIME_FUNCTION_NAME&&(this.#t.functionName=runtimeEnv.RUNTIME_FUNCTION_NAME),runtimeEnv.RUNTIME_FUNCTION_GATEWAY_VIP&&(this.#t.functionGatewayVip=runtimeEnv.RUNTIME_FUNCTION_GATEWAY_VIP),runtimeEnv.RUNTIME_FUNCTION_INSTANCE_ID&&(this.#t.functionInstanceId=runtimeEnv.RUNTIME_FUNCTION_INSTANCE_ID),runtimeEnv.RUNTIME_MONGO_CLUSTER_ENDPOINT&&(this.#t.functionDatabaseEndpoint=runtimeEnv.RUNTIME_MONGO_CLUSTER_ENDPOINT),runtimeEnv.RUNTIME_MONGO_DATABASE_NAME&&(this.#t.functionDatabaseName=runtimeEnv.RUNTIME_MONGO_DATABASE_NAME)):this.#t={secretId:runtimeEnv.RUNTIME_ACCESS_KEY,secretKey:runtimeEnv.RUNTIME_SECRET_KEY,fromEnvId:runtimeEnv.RUNTIME_ENV_ID,toEnvId:runtimeEnv.RUNTIME_ENV_ID,functionName:runtimeEnv.RUNTIME_FUNCTION_NAME,functionGatewayVip:runtimeEnv.RUNTIME_FUNCTION_GATEWAY_VIP,functionInstanceId:runtimeEnv.RUNTIME_FUNCTION_INSTANCE_ID,functionDatabaseEndpoint:runtimeEnv.RUNTIME_MONGO_CLUSTER_ENDPOINT,functionDatabaseName:runtimeEnv.RUNTIME_MONGO_DATABASE_NAME}}init(t){t?.env&&typeof t?.env=="string"&&(this.#t.toEnvId=t.env),t?.envId&&(this.#t.toEnvId=t.envId)}getAlipayContext(){return(0,utils_1.getAlipayContext)()}async callFunction(t){return await(0,callFunction_1.callFunction)(this.#t,t)}database(){return this.#E||(this.#E=new Database_1.Database(this.#t)),this.#E}mysql(){return this.#N||(this.#N=new MySQL_1.MySQL(this.#t)),this.#N}}exports.Cloud=Cloud; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Cloud=exports.initRuntimeEnv=void 0;const callFunction_1=require("./callFunction"),Database_1=require("./Database"),MySQL_1=require("./MySQL"),utils_1=require("./utils"),runtimeEnv={RUNTIME_ACCESS_KEY:process.env.RUNTIME_ACCESS_KEY||"",RUNTIME_SECRET_KEY:process.env.RUNTIME_SECRET_KEY||"",RUNTIME_ENV_ID:process.env.RUNTIME_ENV_ID||"",RUNTIME_FUNCTION_NAME:process.env.RUNTIME_FUNCTION_NAME||"",RUNTIME_FUNCTION_GATEWAY_VIP:process.env.RUNTIME_FUNCTION_GATEWAY_VIP||"",RUNTIME_FUNCTION_INSTANCE_ID:process.env.RUNTIME_FUNCTION_INSTANCE_ID||"",RUNTIME_MONGO_CLUSTER_ENDPOINT:process.env.RUNTIME_MONGO_CLUSTER_ENDPOINT||"",RUNTIME_MONGO_DATABASE_NAME:process.env.RUNTIME_MONGO_DATABASE_NAME||""};function initRuntimeEnv(E){Object.assign(runtimeEnv,E)}exports.initRuntimeEnv=initRuntimeEnv;class Cloud{#N;#E;#_;constructor(){this.refreshConfig()}refreshConfig(){this.#N?(runtimeEnv.RUNTIME_ACCESS_KEY&&(this.#N.secretId=runtimeEnv.RUNTIME_ACCESS_KEY),runtimeEnv.RUNTIME_SECRET_KEY&&(this.#N.secretKey=runtimeEnv.RUNTIME_SECRET_KEY),runtimeEnv.RUNTIME_ENV_ID&&(this.#N.fromEnvId=runtimeEnv.RUNTIME_ENV_ID,this.#N.toEnvId||(this.#N.toEnvId=runtimeEnv.RUNTIME_ENV_ID)),runtimeEnv.RUNTIME_FUNCTION_NAME&&(this.#N.functionName=runtimeEnv.RUNTIME_FUNCTION_NAME),runtimeEnv.RUNTIME_FUNCTION_GATEWAY_VIP&&(this.#N.functionGatewayVip=runtimeEnv.RUNTIME_FUNCTION_GATEWAY_VIP),runtimeEnv.RUNTIME_FUNCTION_INSTANCE_ID&&(this.#N.functionInstanceId=runtimeEnv.RUNTIME_FUNCTION_INSTANCE_ID),runtimeEnv.RUNTIME_MONGO_CLUSTER_ENDPOINT&&(this.#N.functionDatabaseEndpoint=runtimeEnv.RUNTIME_MONGO_CLUSTER_ENDPOINT),runtimeEnv.RUNTIME_MONGO_DATABASE_NAME&&(this.#N.functionDatabaseName=runtimeEnv.RUNTIME_MONGO_DATABASE_NAME)):this.#N={secretId:runtimeEnv.RUNTIME_ACCESS_KEY,secretKey:runtimeEnv.RUNTIME_SECRET_KEY,fromEnvId:runtimeEnv.RUNTIME_ENV_ID,toEnvId:runtimeEnv.RUNTIME_ENV_ID,functionName:runtimeEnv.RUNTIME_FUNCTION_NAME,functionGatewayVip:runtimeEnv.RUNTIME_FUNCTION_GATEWAY_VIP,functionInstanceId:runtimeEnv.RUNTIME_FUNCTION_INSTANCE_ID,functionDatabaseEndpoint:runtimeEnv.RUNTIME_MONGO_CLUSTER_ENDPOINT,functionDatabaseName:runtimeEnv.RUNTIME_MONGO_DATABASE_NAME}}init(N){N?.env&&typeof N?.env=="string"&&(this.#N.toEnvId=N.env),N?.envId&&(this.#N.toEnvId=N.envId)}getAlipayContext(){return(0,utils_1.getAlipayContext)()}async callFunction(N){return await(0,callFunction_1.callFunction)(this.#N,N)}database(){return this.#E||(this.#E=new Database_1.Database(this.#N)),this.#E}mysql(){return this.#_||(this.#_=new MySQL_1.MySQL(this.#N)),this.#_}}exports.Cloud=Cloud; |
{ | ||
"name": "@alipay/faas-server-sdk", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "云函数服务 SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 8 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54257
27