usf-cli 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -78,6 +78,7 @@ Usage:
78
78
  -r --f=<function-name> --e=<event-dir> run function <function-name> with specified event data
79
79
  -a --id=<app-id> --secret=<service-secret> set app id and service secret for this project (used for generating auth token)
80
80
  -d upload current stateless functions to UOS platform with UOS auth and deploy automatically
81
+ -d --installDependency upload current stateless functions to UOS platform with UOS auth and deploy automatically (auto install dependency)
81
82
 
82
83
  Supported template code:
83
84
  crud_mongo template function code for uos crud(mongo db version)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usf-cli",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "usf-cli helps uos stateless function developers with local running, boosting their development efficiency.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -6,6 +6,8 @@ import JSZip from "jszip";
6
6
  import axios from "axios";
7
7
  import COS from "cos-nodejs-sdk-v5";
8
8
 
9
+ const UOS_FUNCTION_DOMAIN = "https://func.unity.cn";
10
+
9
11
  const igonreList = [
10
12
  ".DS_Store",
11
13
  ".idea",
@@ -109,7 +111,7 @@ const creatZip = async function (dir) {
109
111
 
110
112
  const getToken = async function (auth) {
111
113
  const res = await axios.get(
112
- "https://func.unity.cn/v1/func-stateless/functions/" +
114
+ `${UOS_FUNCTION_DOMAIN}/v1/func-stateless/functions/` +
113
115
  auth.id +
114
116
  "/get-transfer-token",
115
117
  {
@@ -173,7 +175,7 @@ const createScf = async function (auth, entries) {
173
175
  }
174
176
 
175
177
  await axios.post(
176
- "https://func.unity.cn/v1/func-stateless/functions/" + auth.id + "/scf",
178
+ `${UOS_FUNCTION_DOMAIN}/v1/func-stateless/functions/` + auth.id + "/scf",
177
179
  payLoad,
178
180
  {
179
181
  headers: {
@@ -200,7 +202,7 @@ const checkFunctionStatus = function (auth) {
200
202
  const getFunctionInfo = async () => {
201
203
  try {
202
204
  const res = await axios.get(
203
- "https://func.unity.cn/v1/func-stateless/functions/" + auth.id,
205
+ `${UOS_FUNCTION_DOMAIN}/v1/func-stateless/functions/` + auth.id,
204
206
  {
205
207
  headers: {
206
208
  Authorization: "Basic " + btoa(auth.id + ":" + auth.secret),
@@ -233,7 +235,7 @@ const updateInstallDependency = async function (install = false, auth) {
233
235
  };
234
236
 
235
237
  await axios.put(
236
- "https://func.unity.cn/v1/func-stateless/functions/" + auth.id,
238
+ `${UOS_FUNCTION_DOMAIN}/v1/func-stateless/functions/` + auth.id,
237
239
  payload,
238
240
  {
239
241
  headers: {
@@ -263,7 +265,7 @@ const listFunctions = async function (version, auth) {
263
265
  version: version,
264
266
  };
265
267
  const res = await axios.get(
266
- `https://func.unity.cn/v1/func-stateless/functions/${auth.id}/scf`,
268
+ `${UOS_FUNCTION_DOMAIN}/v1/func-stateless/functions/${auth.id}/scf`,
267
269
  {
268
270
  params: params,
269
271
  headers: {