diff --git a/doc/assets/js/search.js b/doc/assets/js/search.js
index c98933d..7d455e4 100644
--- a/doc/assets/js/search.js
+++ b/doc/assets/js/search.js
@@ -1 +1 @@
-window.searchData = {"kinds":{"128":"Class","512":"Constructor","1024":"Property","2048":"Method"},"rows":[{"id":0,"kind":128,"name":"default","url":"classes/default.html","classes":"tsd-kind-class"},{"id":1,"kind":512,"name":"constructor","url":"classes/default.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite","parent":"default"},{"id":2,"kind":2048,"name":"report","url":"classes/default.html#report","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"},{"id":3,"kind":2048,"name":"startExpress","url":"classes/default.html#startexpress","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"},{"id":4,"kind":2048,"name":"handlerInputs","url":"classes/default.html#handlerinputs","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"},{"id":5,"kind":2048,"name":"start","url":"classes/default.html#start","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"},{"id":6,"kind":2048,"name":"invoke","url":"classes/default.html#invoke","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"},{"id":7,"kind":1024,"name":"client","url":"classes/default.html#client","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected","parent":"default"},{"id":8,"kind":1024,"name":"inputs","url":"classes/default.html#inputs","classes":"tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected","parent":"default"},{"id":9,"kind":2048,"name":"__getBasePath","url":"classes/default.html#__getbasepath","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"default"},{"id":10,"kind":2048,"name":"__doc","url":"classes/default.html#__doc","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"default"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,0.426]],["parent/0",[]],["name/1",[1,20.794]],["parent/1",[0,0.041]],["name/2",[2,20.794]],["parent/2",[0,0.041]],["name/3",[3,20.794]],["parent/3",[0,0.041]],["name/4",[4,20.794]],["parent/4",[0,0.041]],["name/5",[5,20.794]],["parent/5",[0,0.041]],["name/6",[6,20.794]],["parent/6",[0,0.041]],["name/7",[7,20.794]],["parent/7",[0,0.041]],["name/8",[8,20.794]],["parent/8",[0,0.041]],["name/9",[9,20.794]],["parent/9",[0,0.041]],["name/10",[10,20.794]],["parent/10",[0,0.041]]],"invertedIndex":[["__doc",{"_index":10,"name":{"10":{}},"parent":{}}],["__getbasepath",{"_index":9,"name":{"9":{}},"parent":{}}],["client",{"_index":7,"name":{"7":{}},"parent":{}}],["constructor",{"_index":1,"name":{"1":{}},"parent":{}}],["default",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{},"3":{},"4":{},"5":{},"6":{},"7":{},"8":{},"9":{},"10":{}}}],["handlerinputs",{"_index":4,"name":{"4":{}},"parent":{}}],["inputs",{"_index":8,"name":{"8":{}},"parent":{}}],["invoke",{"_index":6,"name":{"6":{}},"parent":{}}],["report",{"_index":2,"name":{"2":{}},"parent":{}}],["start",{"_index":5,"name":{"5":{}},"parent":{}}],["startexpress",{"_index":3,"name":{"3":{}},"parent":{}}]],"pipeline":[]}}
\ No newline at end of file
+window.searchData = {"kinds":{"128":"Class","512":"Constructor","2048":"Method"},"rows":[{"id":0,"kind":128,"name":"default","url":"classes/default.html","classes":"tsd-kind-class"},{"id":1,"kind":512,"name":"constructor","url":"classes/default.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"default"},{"id":2,"kind":2048,"name":"report","url":"classes/default.html#report","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"},{"id":3,"kind":2048,"name":"handlerInputs","url":"classes/default.html#handlerinputs","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"},{"id":4,"kind":2048,"name":"invoke","url":"classes/default.html#invoke","classes":"tsd-kind-method tsd-parent-kind-class","parent":"default"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,0.87]],["parent/0",[]],["name/1",[1,13.863]],["parent/1",[0,0.079]],["name/2",[2,13.863]],["parent/2",[0,0.079]],["name/3",[3,13.863]],["parent/3",[0,0.079]],["name/4",[4,13.863]],["parent/4",[0,0.079]]],"invertedIndex":[["constructor",{"_index":1,"name":{"1":{}},"parent":{}}],["default",{"_index":0,"name":{"0":{}},"parent":{"1":{},"2":{},"3":{},"4":{}}}],["handlerinputs",{"_index":3,"name":{"3":{}},"parent":{}}],["invoke",{"_index":4,"name":{"4":{}},"parent":{}}],["report",{"_index":2,"name":{"2":{}},"parent":{}}]],"pipeline":[]}}
\ No newline at end of file
diff --git a/doc/classes/default.html b/doc/classes/default.html
index f934637..c6d2758 100644
--- a/doc/classes/default.html
+++ b/doc/classes/default.html
@@ -3,8 +3,8 @@
- default | fc-local-invoke
-
+ default | fc-remote-invoke
+
@@ -23,7 +23,7 @@
Preparing search index...
The search index is not available
- fc-local-invoke
+ fc-remote-invoke
@@ -52,7 +52,7 @@
@@ -112,97 +96,23 @@
Constructors
-
+
constructor
-
- - new default(props: any): default
+
-
- Properties
-
-
- Protected client
- client: any
-
-
-
-
- Protected inputs
- inputs: any
-
-
-
Methods
-
-
- __doc
-
- - __doc(projectName?: string): string
-
-
- -
-
-
Parameters
-
- -
-
Optional projectName: string
-
-
- Returns string
-
-
-
-
-
- __getBasePath
-
- - __getBasePath(): string
-
-
-
handlerInputs
@@ -213,7 +123,7 @@
Parameters
@@ -236,7 +146,7 @@
diff --git a/doc/doc.json b/doc/doc.json
index ec5e792..eabd181 100644
--- a/doc/doc.json
+++ b/doc/doc.json
@@ -1,6 +1,6 @@
{
"id": 0,
- "name": "fc-local-invoke",
+ "name": "fc-remote-invoke",
"kind": 0,
"kindString": "Project",
"flags": {},
@@ -26,163 +26,16 @@
"kind": 16384,
"kindString": "Constructor signature",
"flags": {},
- "parameters": [
- {
- "id": 4,
- "name": "props",
- "kind": 32768,
- "kindString": "Parameter",
- "flags": {},
- "type": {
- "type": "intrinsic",
- "name": "any"
- }
- }
- ],
"type": {
"type": "reference",
"id": 1,
"name": "default"
- },
- "overwrites": {
- "type": "reference",
- "name": "BaseComponent.constructor"
}
}
- ],
- "overwrites": {
- "type": "reference",
- "name": "BaseComponent.constructor"
- }
+ ]
},
{
- "id": 23,
- "name": "client",
- "kind": 1024,
- "kindString": "Property",
- "flags": {
- "isProtected": true
- },
- "sources": [
- {
- "fileName": "common/base.ts",
- "line": 9,
- "character": 20
- }
- ],
- "type": {
- "type": "intrinsic",
- "name": "any"
- },
- "inheritedFrom": {
- "type": "reference",
- "name": "BaseComponent.client"
- }
- },
- {
- "id": 24,
- "name": "inputs",
- "kind": 1024,
- "kindString": "Property",
- "flags": {
- "isProtected": true
- },
- "type": {
- "type": "intrinsic",
- "name": "any"
- },
- "inheritedFrom": {
- "type": "reference",
- "name": "BaseComponent.inputs"
- }
- },
- {
- "id": 27,
- "name": "__doc",
- "kind": 2048,
- "kindString": "Method",
- "flags": {},
- "sources": [
- {
- "fileName": "common/base.ts",
- "line": 34,
- "character": 9
- }
- ],
- "signatures": [
- {
- "id": 28,
- "name": "__doc",
- "kind": 4096,
- "kindString": "Call signature",
- "flags": {},
- "parameters": [
- {
- "id": 29,
- "name": "projectName",
- "kind": 32768,
- "kindString": "Parameter",
- "flags": {
- "isOptional": true
- },
- "type": {
- "type": "intrinsic",
- "name": "string"
- }
- }
- ],
- "type": {
- "type": "intrinsic",
- "name": "string"
- },
- "inheritedFrom": {
- "type": "reference",
- "name": "BaseComponent.__doc"
- }
- }
- ],
- "inheritedFrom": {
- "type": "reference",
- "name": "BaseComponent.__doc"
- }
- },
- {
- "id": 25,
- "name": "__getBasePath",
- "kind": 2048,
- "kindString": "Method",
- "flags": {},
- "sources": [
- {
- "fileName": "common/base.ts",
- "line": 21,
- "character": 17
- }
- ],
- "signatures": [
- {
- "id": 26,
- "name": "__getBasePath",
- "kind": 4096,
- "kindString": "Call signature",
- "flags": {},
- "type": {
- "type": "intrinsic",
- "name": "string"
- },
- "inheritedFrom": {
- "type": "reference",
- "name": "BaseComponent.__getBasePath"
- }
- }
- ],
- "inheritedFrom": {
- "type": "reference",
- "name": "BaseComponent.__getBasePath"
- }
- },
- {
- "id": 14,
+ "id": 9,
"name": "handlerInputs",
"kind": 2048,
"kindString": "Method",
@@ -190,20 +43,20 @@
"sources": [
{
"fileName": "index.ts",
- "line": 56,
+ "line": 16,
"character": 21
}
],
"signatures": [
{
- "id": 15,
+ "id": 10,
"name": "handlerInputs",
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"parameters": [
{
- "id": 16,
+ "id": 11,
"name": "inputs",
"kind": 32768,
"kindString": "Parameter",
@@ -228,7 +81,7 @@
]
},
{
- "id": 20,
+ "id": 12,
"name": "invoke",
"kind": 2048,
"kindString": "Method",
@@ -238,13 +91,13 @@
"sources": [
{
"fileName": "index.ts",
- "line": 197,
+ "line": 98,
"character": 21
}
],
"signatures": [
{
- "id": 21,
+ "id": 13,
"name": "invoke",
"kind": 4096,
"kindString": "Call signature",
@@ -255,7 +108,7 @@
},
"parameters": [
{
- "id": 22,
+ "id": 14,
"name": "inputs",
"kind": 32768,
"kindString": "Parameter",
@@ -281,7 +134,7 @@
]
},
{
- "id": 5,
+ "id": 4,
"name": "report",
"kind": 2048,
"kindString": "Method",
@@ -289,20 +142,20 @@
"sources": [
{
"fileName": "index.ts",
- "line": 33,
+ "line": 9,
"character": 14
}
],
"signatures": [
{
- "id": 6,
+ "id": 5,
"name": "report",
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"parameters": [
{
- "id": 7,
+ "id": 6,
"name": "componentName",
"kind": 32768,
"kindString": "Parameter",
@@ -313,7 +166,7 @@
}
},
{
- "id": 8,
+ "id": 7,
"name": "command",
"kind": 32768,
"kindString": "Parameter",
@@ -324,26 +177,11 @@
}
},
{
- "id": 9,
+ "id": 8,
"name": "accountID",
"kind": 32768,
"kindString": "Parameter",
- "flags": {
- "isOptional": true
- },
- "type": {
- "type": "intrinsic",
- "name": "string"
- }
- },
- {
- "id": 10,
- "name": "access",
- "kind": 32768,
- "kindString": "Parameter",
- "flags": {
- "isOptional": true
- },
+ "flags": {},
"type": {
"type": "intrinsic",
"name": "string"
@@ -362,99 +200,6 @@
}
}
]
- },
- {
- "id": 17,
- "name": "start",
- "kind": 2048,
- "kindString": "Method",
- "flags": {
- "isPublic": true
- },
- "sources": [
- {
- "fileName": "index.ts",
- "line": 109,
- "character": 20
- }
- ],
- "signatures": [
- {
- "id": 18,
- "name": "start",
- "kind": 4096,
- "kindString": "Call signature",
- "flags": {},
- "comment": {
- "shortText": "http 函数本地调试",
- "returns": "\n"
- },
- "parameters": [
- {
- "id": 19,
- "name": "inputs",
- "kind": 32768,
- "kindString": "Parameter",
- "flags": {},
- "comment": {},
- "type": {
- "type": "reference",
- "name": "InputProps"
- }
- }
- ],
- "type": {
- "type": "reference",
- "typeArguments": [
- {
- "type": "intrinsic",
- "name": "any"
- }
- ],
- "name": "Promise"
- }
- }
- ]
- },
- {
- "id": 11,
- "name": "startExpress",
- "kind": 2048,
- "kindString": "Method",
- "flags": {},
- "sources": [
- {
- "fileName": "index.ts",
- "line": 46,
- "character": 14
- }
- ],
- "signatures": [
- {
- "id": 12,
- "name": "startExpress",
- "kind": 4096,
- "kindString": "Call signature",
- "flags": {},
- "parameters": [
- {
- "id": 13,
- "name": "app",
- "kind": 32768,
- "kindString": "Parameter",
- "flags": {},
- "type": {
- "type": "intrinsic",
- "name": "any"
- }
- }
- ],
- "type": {
- "type": "intrinsic",
- "name": "void"
- }
- }
- ]
}
],
"groups": [
@@ -465,39 +210,21 @@
2
]
},
- {
- "title": "Properties",
- "kind": 1024,
- "children": [
- 23,
- 24
- ]
- },
{
"title": "Methods",
"kind": 2048,
"children": [
- 27,
- 25,
- 14,
- 20,
- 5,
- 17,
- 11
+ 9,
+ 12,
+ 4
]
}
],
"sources": [
{
"fileName": "index.ts",
- "line": 28,
- "character": 43
- }
- ],
- "extendedTypes": [
- {
- "type": "reference",
- "name": "BaseComponent"
+ "line": 8,
+ "character": 35
}
]
}
diff --git a/doc/index.html b/doc/index.html
index 706a7fe..fd8e489 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -3,8 +3,8 @@
-
fc-local-invoke
-
+
fc-remote-invoke
+
@@ -23,7 +23,7 @@
Preparing search index...
The search index is not available
-
fc-local-invoke
+
fc-remote-invoke
diff --git a/doc/modules.html b/doc/modules.html
index 45f53f1..6431883 100644
--- a/doc/modules.html
+++ b/doc/modules.html
@@ -3,8 +3,8 @@
- fc-local-invoke
-
+ fc-remote-invoke
+
@@ -23,7 +23,7 @@
Preparing search index...
The search index is not available
- fc-local-invoke
+ fc-remote-invoke
diff --git a/example/debug-for-java/code/pom.xml b/example/debug-for-java/code/pom.xml
deleted file mode 100644
index 438ad7b..0000000
--- a/example/debug-for-java/code/pom.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
- 4.0.0
- example
- event-java
- jar
- 1.0-SNAPSHOT
- event-java
-
-
-
- junit
- junit
- 3.8.1
- test
-
-
- com.aliyun.fc.runtime
- fc-java-core
- 1.3.0
-
-
-
-
- 1.8
- 1.8
- true
-
-
diff --git a/example/debug-for-java/code/src/main/java/example/App.java b/example/debug-for-java/code/src/main/java/example/App.java
deleted file mode 100644
index 5df5bca..0000000
--- a/example/debug-for-java/code/src/main/java/example/App.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package example;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import com.aliyun.fc.runtime.Context;
-import com.aliyun.fc.runtime.StreamRequestHandler;
-import com.aliyun.fc.runtime.FunctionInitializer;
-
-/**
- * Hello world!
- *
- */
-public class App implements StreamRequestHandler, FunctionInitializer {
-
- public void initialize(Context context) throws IOException {
- //TODO
- }
-
- @Override
- public void handleRequest(
- InputStream inputStream, OutputStream outputStream, Context context) throws IOException {
- outputStream.write(new String("hello world\n").getBytes());
- }
-}
diff --git a/example/debug-for-java/s.yaml b/example/debug-for-java/s.yaml
deleted file mode 100644
index 4846349..0000000
--- a/example/debug-for-java/s.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
-name: fcDeployApp # 项目名称
-access: default # 秘钥别名
-
-services:
- fc-deploy-test: # 服务名称
- component: ${path(../..)}
- props: # 组件的属性值
- region: cn-shanghai
- service:
- name: demo
- description: demo for fc-deploy component
- internetAccess: true
- function:
- name: test-function
- description: this is a test
- runtime: java11
- codeUri: ./code
- handler: example.App::handleRequest
- memorySize: 128
- timeout: 60
- instanceConcurrency: 1
- instanceType: e1
- environmentVariables:
- testEnv: true
\ No newline at end of file
diff --git a/example/event-function/code/index.js b/example/event-function/code/index.js
deleted file mode 100644
index de15262..0000000
--- a/example/event-function/code/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports.handler = function(event, context, callback) {
- console.log(event.toString());
- // console.dir(context);
- console.log('hello world11111');
- callback(null, 'hello world');
-};
diff --git a/example/event-function/eventfile b/example/event-function/eventfile
deleted file mode 100644
index 3b5cb98..0000000
--- a/example/event-function/eventfile
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "key": 123,
- "mm": "gg"
-}
\ No newline at end of file
diff --git a/example/event-function/s.yaml b/example/event-function/s.yaml
deleted file mode 100644
index 300581c..0000000
--- a/example/event-function/s.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
-name: fcDeployApp # 项目名称
-access: default # 秘钥别名
-
-services:
- fc-deploy-test: # 服务名称
- component: ${path(../..)}
- props: # 组件的属性值
- region: cn-shanghai
- service:
- name: demo
- description: demo for fc-deploy component
- internetAccess: true
- function:
- name: test-function
- description: this is a test
- runtime: nodejs10
- codeUri: ./code
- handler: index.handler
- memorySize: 128
- timeout: 60
- instanceConcurrency: 1
- instanceType: e1
- environmentVariables:
- testEnv: true
\ No newline at end of file
diff --git a/example/http-function/code/index.js b/example/http-function/code/index.js
deleted file mode 100644
index f5b94bc..0000000
--- a/example/http-function/code/index.js
+++ /dev/null
@@ -1,34 +0,0 @@
-const getRawBody = require('raw-body');
-
-module.exports.handler = function (request, response, context) {
- // get requset header
- const reqHeader = request.headers;
- let headerStr = ' ';
- for (const key in reqHeader) {
- headerStr += `${key }:${ reqHeader[key] } `;
- }
-
- // get request info
- const { url } = request;
- const { path } = request;
- const { queries } = request;
- let queryStr = '';
- for (const param in queries) {
- queryStr += `${param }=${ queries[param] } `;
- }
- const { method } = request;
- const { clientIP } = request;
-
- // get request body
- getRawBody(request, (err, data) => {
- const body = data;
- // you can deal with your own logic here
-
- // set response
- const respBody = new Buffer(`requestHeader:${ headerStr }\n` + `url: ${ url }\n` + `path: ${ path }\n` + `queries: ${ queryStr }\n` + `method: ${ method }\n` + `clientIP: ${ clientIP }\n` + `body: ${ body }\n`);
- response.setStatusCode(200);
- response.setHeader('content-type', 'application/json');
- response.send(respBody);
- });
-};
-
diff --git a/example/http-function/s.yaml b/example/http-function/s.yaml
deleted file mode 100644
index 413be21..0000000
--- a/example/http-function/s.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
-name: fcDeployApp # 项目名称
-access: default # 秘钥别名
-
-services:
- fc-deploy-test: # 服务名称
- component: ${path(../..)}
- props: # 组件的属性值
- region: cn-shanghai
- service:
- name: qianfeng-fc-deploy-service
- description: demo for fc-deploy component
- internetAccess: true
- function:
- name: test-function
- description: this is a test
- runtime: nodejs10
- codeUri: ./code
- handler: index.handler
- memorySize: 128
- timeout: 60
- instanceConcurrency: 1
- instanceType: e1
- environmentVariables:
- testEnv: true
- triggers:
- - name: httpTrigger
- type: http
- config:
- authType: anonymous
- methods:
- - GET
- - POST
- customDomains:
- - domainName: auto
- protocol: HTTP # HTTP 或 HTTP,HTTPS
- routeConfigs:
- - path: /*
- serviceName: qianfeng-fc-deploy-service
- functionName: test-function
- methods:
- - GET
- - POST
- # certConfig:
- # certName: xxx
- # certificate: xxx
- # privateKey: xxx
diff --git a/example/http.json b/example/http.json
new file mode 100644
index 0000000..b13fda6
--- /dev/null
+++ b/example/http.json
@@ -0,0 +1,11 @@
+{
+ "body": 123,
+ "method": "POST",
+ "headers": {
+ "key": "value"
+ },
+ "queries": {
+ "key": "value"
+ },
+ "path": "string"
+}
\ No newline at end of file
diff --git a/example/main.ts b/example/main.ts
deleted file mode 100644
index c0a8673..0000000
--- a/example/main.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-const a = [
- {a: 1, b:2},
- {a: 2, b:3},
- {a: 1, b:111},
-]
-
-const b = a.filter((aa) => aa.a === 1);
-console.log(b);
\ No newline at end of file
diff --git a/example/s.yaml b/example/s.yaml
index 242e16d..b8eed9b 100644
--- a/example/s.yaml
+++ b/example/s.yaml
@@ -1,13 +1,11 @@
edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: compoent-test # 项目名称
-vars: # [全局变量,提供给各个服务使用]
- logo: https://image.aliyun.com/xxxx.png
- domain: xxxx.yyy.com
+
services:
component-test: # 服务名称
component: ${path(..)} # 这里引入的是相对路径,正式配置替换成你自己的component名称即可
props:
- name: ${component-test2.props.name}
- otherInput: ${component-test2.output.hello}
- envshow: ${env(USER)}
-
+ region: cn-shenzhen
+ serviceName: guide
+ # functionName: guide-hello_world-nodejs12
+ functionName: hhh
diff --git a/lib/common/help.d.ts b/lib/common/help.d.ts
new file mode 100644
index 0000000..90e2969
--- /dev/null
+++ b/lib/common/help.d.ts
@@ -0,0 +1,29 @@
+declare const _default: ({
+ header: string;
+ content: string;
+ optionList?: undefined;
+} | {
+ header: string;
+ optionList: ({
+ name: string;
+ description: string;
+ alias: string;
+ type: StringConstructor;
+ } | {
+ name: string;
+ description: string;
+ alias: string;
+ type: BooleanConstructor;
+ } | {
+ name: string;
+ description: string;
+ type: StringConstructor;
+ alias?: undefined;
+ })[];
+ content?: undefined;
+} | {
+ header: string;
+ content: string[];
+ optionList?: undefined;
+})[];
+export default _default;
diff --git a/lib/common/help.js b/lib/common/help.js
new file mode 100644
index 0000000..d8eedb0
--- /dev/null
+++ b/lib/common/help.js
@@ -0,0 +1,80 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = [
+ {
+ header: 'Description',
+ content: 'Remote Invoke',
+ },
+ {
+ header: 'Usage',
+ content: '$ fc-remote-invoke invoke ',
+ },
+ {
+ header: 'Options',
+ optionList: [
+ {
+ name: 'invocation-type',
+ description: 'Invocation type: optional value "async"|"sync", default value "sync" (default: "sync")',
+ alias: '-t',
+ type: String,
+ },
+ {
+ name: 'event',
+ description: 'Event data (strings) passed to the function during invocation (default: "")',
+ alias: '-e',
+ type: String,
+ },
+ {
+ name: 'event-file',
+ description: 'A file containing event data passed to the function during invoke.',
+ alias: '-f',
+ type: String,
+ },
+ {
+ name: 'event-stdin',
+ description: 'Read from standard input, to support script pipeline.',
+ alias: '-s',
+ type: Boolean,
+ },
+ {
+ name: 'region',
+ description: 'Pass in region in cli mode',
+ type: String,
+ },
+ {
+ name: 'service-name',
+ description: 'Pass in service name in cli mode',
+ type: String,
+ },
+ {
+ name: 'function-name',
+ description: 'Pass in function name in cli mode',
+ type: String,
+ },
+ ],
+ },
+ {
+ header: 'Global Options',
+ optionList: [
+ {
+ name: 'help',
+ description: 'fc-remote-invoke help for command',
+ alias: 'h',
+ type: Boolean,
+ },
+ ],
+ },
+ {
+ header: 'Examples with Yaml',
+ content: [
+ '$ s exec -- invoke ',
+ ],
+ },
+ {
+ header: 'Examples with Cli',
+ content: [
+ '$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * ',
+ ],
+ },
+];
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vaGVscC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGtCQU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BQU07YUFDYjtTQUNGO0tBQ0Y7SUFDRDtRQUNFLE1BQU0sRUFBRSxnQkFBZ0I7UUFDeEIsVUFBVSxFQUFFO1lBQ1Y7Z0JBQ0UsSUFBSSxFQUFFLE1BQU07Z0JBQ1osV0FBVyxFQUFFLG1DQUFtQztnQkFDaEQsS0FBSyxFQUFFLEdBQUc7Z0JBQ1YsSUFBSSxFQUFFLE9BQU87YUFDZDtTQUNGO0tBQ0Y7SUFDRDtRQUNFLE1BQU0sRUFBRSxvQkFBb0I7UUFDNUIsT0FBTyxFQUFFO1lBQ1AsOEJBQThCO1NBQy9CO0tBQ0Y7SUFDRDtRQUNFLE1BQU0sRUFBRSxtQkFBbUI7UUFDM0IsT0FBTyxFQUFFO1lBQ1AseUZBQXlGO1NBQzFGO0tBQ0Y7Q0FDRixDQUFBIn0=
\ No newline at end of file
diff --git a/lib/common/i18n.d.ts b/lib/common/i18n.d.ts
new file mode 100644
index 0000000..515e9f9
--- /dev/null
+++ b/lib/common/i18n.d.ts
@@ -0,0 +1,5 @@
+export declare function getConfig(key: string): any;
+export declare function getProfileFile(): {};
+export declare function getDefaultProfilePath(): string;
+declare const i18n: any;
+export default i18n;
diff --git a/lib/common/i18n.js b/lib/common/i18n.js
new file mode 100644
index 0000000..8dcfbd6
--- /dev/null
+++ b/lib/common/i18n.js
@@ -0,0 +1,45 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getDefaultProfilePath = exports.getProfileFile = exports.getConfig = void 0;
+const os_1 = __importDefault(require("os"));
+const fs_1 = __importDefault(require("fs"));
+const path_1 = __importDefault(require("path"));
+const js_yaml_1 = __importDefault(require("js-yaml"));
+const i18n_1 = require("i18n");
+function getConfig(key) {
+ const profile = getProfileFile();
+ return profile[key];
+}
+exports.getConfig = getConfig;
+function getProfileFile() {
+ let profileResult = {};
+ try {
+ const profileFilePath = getDefaultProfilePath();
+ profileResult = js_yaml_1.default.load(fs_1.default.readFileSync(profileFilePath, 'utf8')) || {};
+ }
+ catch (e) {
+ console.log(e);
+ }
+ return profileResult;
+}
+exports.getProfileFile = getProfileFile;
+function getDefaultProfilePath() {
+ return path_1.default.join(os_1.default.homedir(), '.s', 'set-config.yml');
+}
+exports.getDefaultProfilePath = getDefaultProfilePath;
+const i18n = new i18n_1.I18n({
+ locales: ['en', 'zh'],
+ directory: path_1.default.join(__dirname, '..', '..', 'locales'),
+});
+const locale = getConfig('locale');
+if (locale) {
+ i18n.setLocale(locale);
+}
+else {
+ i18n.setLocale('en');
+}
+exports.default = i18n;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaTE4bi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vaTE4bi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSw0Q0FBb0I7QUFDcEIsNENBQW9CO0FBQ3BCLGdEQUF3QjtBQUN4QixzREFBMkI7QUFDM0IsK0JBQTRCO0FBRTVCLFNBQWdCLFNBQVMsQ0FBQyxHQUFXO0lBQ2pDLE1BQU0sT0FBTyxHQUFHLGNBQWMsRUFBRSxDQUFDO0lBQ2pDLE9BQU8sT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQ3hCLENBQUM7QUFIRCw4QkFHQztBQUdELFNBQWdCLGNBQWM7SUFDMUIsSUFBSSxhQUFhLEdBQUcsRUFBRSxDQUFBO0lBQ3RCLElBQUk7UUFDQSxNQUFNLGVBQWUsR0FBRyxxQkFBcUIsRUFBRSxDQUFDO1FBQ2hELGFBQWEsR0FBRyxpQkFBSSxDQUFDLElBQUksQ0FBQyxZQUFFLENBQUMsWUFBWSxDQUFDLGVBQWUsRUFBRSxNQUFNLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztLQUM3RTtJQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ1IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztLQUNsQjtJQUVELE9BQU8sYUFBYSxDQUFDO0FBQ3pCLENBQUM7QUFWRCx3Q0FVQztBQUdELFNBQWdCLHFCQUFxQjtJQUNqQyxPQUFPLGNBQUksQ0FBQyxJQUFJLENBQUMsWUFBRSxDQUFDLE9BQU8sRUFBRSxFQUFFLElBQUksRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDO0FBQzNELENBQUM7QUFGRCxzREFFQztBQUVELE1BQU0sSUFBSSxHQUFHLElBQUksV0FBSSxDQUFDO0lBQ2xCLE9BQU8sRUFBRSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUM7SUFDckIsU0FBUyxFQUFFLGNBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsU0FBUyxDQUFDO0NBQ3pELENBQUMsQ0FBQztBQUdILE1BQU0sTUFBTSxHQUFHLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUNuQyxJQUFJLE1BQU0sRUFBRTtJQUNSLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLENBQUM7Q0FDMUI7S0FBTTtJQUNILElBQUksQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLENBQUM7Q0FDeEI7QUFFRCxrQkFBZSxJQUFJLENBQUMifQ==
\ No newline at end of file
diff --git a/lib/common/logger.d.ts b/lib/common/logger.d.ts
new file mode 100644
index 0000000..bc1962b
--- /dev/null
+++ b/lib/common/logger.d.ts
@@ -0,0 +1,10 @@
+export default class ComponentLogger {
+ static CONTENT: string;
+ static setContent(content: any): void;
+ static log(m: any, color?: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'whiteBright' | 'gray'): void;
+ static info(m: any): void;
+ static debug(m: any): void;
+ static error(m: any): void;
+ static warning(m: any): void;
+ static success(m: any): void;
+}
diff --git a/lib/common/logger.js b/lib/common/logger.js
new file mode 100644
index 0000000..d98bd1d
--- /dev/null
+++ b/lib/common/logger.js
@@ -0,0 +1,33 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const i18n_1 = __importDefault(require("./i18n"));
+const core_1 = require("@serverless-devs/core");
+class ComponentLogger {
+ static setContent(content) {
+ ComponentLogger.CONTENT = content;
+ }
+ static log(m, color) {
+ core_1.Logger.log(i18n_1.default.__(m) || m, color);
+ }
+ static info(m) {
+ core_1.Logger.info(ComponentLogger.CONTENT, i18n_1.default.__(m) || m);
+ }
+ static debug(m) {
+ core_1.Logger.debug(ComponentLogger.CONTENT, i18n_1.default.__(m) || m);
+ }
+ static error(m) {
+ core_1.Logger.error(ComponentLogger.CONTENT, i18n_1.default.__(m) || m);
+ }
+ static warning(m) {
+ core_1.Logger.warn(ComponentLogger.CONTENT, i18n_1.default.__(m) || m);
+ }
+ static success(m) {
+ core_1.Logger.log(i18n_1.default.__(m) || m, 'green');
+ }
+}
+exports.default = ComponentLogger;
+ComponentLogger.CONTENT = 'FC-REMOTE-INVOKE';
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbW1vbi9sb2dnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFDQSxrREFBMEI7QUFDMUIsZ0RBQStDO0FBRS9DLE1BQXFCLGVBQWU7SUFFbEMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxPQUFPO1FBQ3ZCLGVBQWUsQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDO0lBQ3BDLENBQUM7SUFDRCxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRS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rQ0EyQkM7QUExQlEsdUJBQU8sR0FBRyxrQkFBa0IsQ0FBQyJ9
\ No newline at end of file
diff --git a/lib/index.d.ts b/lib/index.d.ts
new file mode 100644
index 0000000..f855e81
--- /dev/null
+++ b/lib/index.d.ts
@@ -0,0 +1,11 @@
+import { InputProps } from './interface/entity';
+export default class FcRemoteInvoke {
+ report(componentName: string, command: string, accountID: string): Promise;
+ handlerInputs(inputs: InputProps): Promise;
+ /**
+ * event 函数本地调试
+ * @param inputs
+ * @returns
+ */
+ invoke(inputs: InputProps): Promise;
+}
diff --git a/lib/index.js b/lib/index.js
new file mode 100644
index 0000000..b8794e8
--- /dev/null
+++ b/lib/index.js
@@ -0,0 +1,131 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const lodash_1 = __importDefault(require("lodash"));
+const core = __importStar(require("@serverless-devs/core"));
+const logger_1 = __importDefault(require("./common/logger"));
+const help_1 = __importDefault(require("./common/help"));
+const entity_1 = require("./interface/entity");
+const remote_invoke_1 = __importDefault(require("./lib/remote-invoke"));
+class FcRemoteInvoke {
+ report(componentName, command, accountID) {
+ return __awaiter(this, void 0, void 0, function* () {
+ core.reportComponent(componentName, {
+ command,
+ uid: accountID,
+ });
+ });
+ }
+ handlerInputs(inputs) {
+ var _a, _b;
+ return __awaiter(this, void 0, void 0, function* () {
+ const credentials = yield core.getCredential((_a = inputs === null || inputs === void 0 ? void 0 : inputs.project) === null || _a === void 0 ? void 0 : _a.access);
+ // 去除 args 的行首以及行尾的空格
+ const args = ((inputs === null || inputs === void 0 ? void 0 : inputs.args) || '').replace(/(^\s*)|(\s*$)/g, '');
+ logger_1.default.debug(`input args: ${args}`);
+ const parsedArgs = core.commandParse({ args }, {
+ boolean: ['help', 'event-stdin'],
+ string: ['invocation-type', 'event', 'event-file', 'region', 'service-name', 'function-name', 'qualifier'],
+ alias: {
+ 'help': 'h',
+ 'event': 'e',
+ 'invocation-type': 't',
+ 'event-file': 'f',
+ 'event-stdin': 's',
+ }
+ });
+ const argsData = (parsedArgs === null || parsedArgs === void 0 ? void 0 : parsedArgs.data) || {};
+ logger_1.default.debug(`command parse: ${JSON.stringify(argsData)}`);
+ if (argsData.help) {
+ return {
+ credentials,
+ isHelp: true,
+ };
+ }
+ const { e: event, f: eventFile, s: eventStdin, t: invocationType = 'sync', } = argsData;
+ const eventPayload = { event, eventFile, eventStdin };
+ // @ts-ignore: 判断三个值有几个真
+ const eventFlag = !!event + !!eventFile + !!eventStdin;
+ if (eventFlag > 1) {
+ throw new Error('event | event-file | event-stdin must choose one.');
+ }
+ else if (eventFlag === 0) {
+ eventPayload.event = '';
+ }
+ if (!['sync', 'async'].includes(invocationType)) {
+ throw new Error('invocation-type enum value sync, async.');
+ }
+ logger_1.default.debug(`input props: ${JSON.stringify(inputs.props)}`);
+ let props = {
+ region: argsData.region,
+ serviceName: argsData['service-name'],
+ functionName: argsData['function-name'],
+ };
+ logger_1.default.debug(`input args props: ${JSON.stringify(props)}`);
+ if (!entity_1.isProperties(props)) {
+ props = inputs.props;
+ }
+ logger_1.default.debug(`props: ${JSON.stringify(props)}`);
+ if (!entity_1.isProperties(props)) {
+ throw new Error('region/serviceName(service-name)/functionName(function-name) can not be empty.');
+ }
+ props.qualifier = argsData.qualifier || ((_b = inputs.props) === null || _b === void 0 ? void 0 : _b.qualifier);
+ return {
+ props,
+ credentials,
+ eventPayload,
+ isHelp: false,
+ invocationType: lodash_1.default.upperFirst(invocationType),
+ };
+ });
+ }
+ /**
+ * event 函数本地调试
+ * @param inputs
+ * @returns
+ */
+ invoke(inputs) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { props, eventPayload, credentials, isHelp, invocationType, } = yield this.handlerInputs(inputs);
+ // await this.report('fc-remote-invoke', 'invoke', credentials?.AccountID);
+ if (isHelp) {
+ core.help(help_1.default);
+ return;
+ }
+ const remoteInvoke = new remote_invoke_1.default(props.region, credentials);
+ yield remoteInvoke.invoke(props, eventPayload, { invocationType });
+ });
+ }
+}
+exports.default = FcRemoteInvoke;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsb0RBQXVCO0FBQ3ZCLDREQUE4QztBQUM5Qyw2REFBcUM7QUFDckMseURBQWlDO0FBQ2pDLCtDQUF5RjtBQUN6Rix3RUFBK0M7QUFFL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s7Z0JBQ2IsY0FBYyxFQUFFLGdCQUFDLENBQUMsVUFBVSxDQUFDLGNBQWMsQ0FBQzthQUM3QyxDQUFDOztLQUNIO0lBRUQ7Ozs7T0FJRztJQUNVLE1BQU0sQ0FBQyxNQUFrQjs7WUFDcEMsTUFBTSxFQUNKLEtBQUssRUFDTCxZQUFZLEVBQ1osV0FBVyxFQUNYLE1BQU0sRUFDTixjQUFjLEdBQ2YsR0FBRyxNQUFNLElBQUksQ0FBQyxhQUFhLENBQUMsTUFBTSxDQUFDLENBQUM7WUFDckMsMkVBQTJFO1lBRTNFLElBQUksTUFBTSxFQUFFO2dCQUNWLElBQUksQ0FBQyxJQUFJLENBQUMsY0FBSSxDQUFDLENBQUE7Z0JBQ2YsT0FBTzthQUNSO1lBRUQsTUFBTSxZQUFZLEdBQUcsSUFBSSx1QkFBWSxDQUFDLEtBQUssQ0FBQyxNQUFNLEVBQUUsV0FBVyxDQUFDLENBQUM7WUFDakUsTUFBTSxZQUFZLENBQUMsTUFBTSxDQUFDLEtBQUssRUFBRSxZQUFZLEVBQUUsRUFBRSxjQUFjLEVBQUUsQ0FBQyxDQUFDO1FBQ3JFLENBQUM7S0FBQTtDQUNGO0FBNUdELGlDQTRHQyJ9
\ No newline at end of file
diff --git a/lib/interface/entity.d.ts b/lib/interface/entity.d.ts
new file mode 100644
index 0000000..76599c0
--- /dev/null
+++ b/lib/interface/entity.d.ts
@@ -0,0 +1,33 @@
+export interface ICredentials {
+ AccountID?: string;
+ AccessKeyID?: string;
+ AccessKeySecret?: string;
+ SecurityToken?: string;
+}
+export interface InputProps {
+ props?: IProperties;
+ credentials: ICredentials;
+ appName: string;
+ project: {
+ component: string;
+ access: string;
+ projectName: string;
+ };
+ command: string;
+ args: string;
+ path: {
+ configPath: string;
+ };
+}
+export interface IProperties {
+ region: string;
+ serviceName: string;
+ functionName: string;
+ qualifier?: string;
+}
+export declare function isProperties(args: any): args is IProperties;
+export interface IEventPayload {
+ event?: string;
+ eventFile?: string;
+ eventStdin?: boolean;
+}
diff --git a/lib/interface/entity.js b/lib/interface/entity.js
new file mode 100644
index 0000000..1796d88
--- /dev/null
+++ b/lib/interface/entity.js
@@ -0,0 +1,8 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isProperties = void 0;
+function isProperties(args) {
+ return args && args.region && args.serviceName && args.functionName;
+}
+exports.isProperties = isProperties;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ludGVyZmFjZS9lbnRpdHkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBNkJBLFNBQWdCLFlBQVksQ0FBQyxJQUFTO0lBQ3BDLE9BQU8sSUFBSSxJQUFJLElBQUksQ0FBQyxNQUFNLElBQUksSUFBSSxDQUFDLFdBQVcsSUFBSSxJQUFJLENBQUMsWUFBWSxDQUFDO0FBQ3RFLENBQUM7QUFGRCxvQ0FFQyJ9
\ No newline at end of file
diff --git a/lib/interface/event.d.ts b/lib/interface/event.d.ts
new file mode 100644
index 0000000..e69de29
diff --git a/lib/interface/event.js b/lib/interface/event.js
new file mode 100644
index 0000000..bde349d
--- /dev/null
+++ b/lib/interface/event.js
@@ -0,0 +1 @@
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW50ZXJmYWNlL2V2ZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
\ No newline at end of file
diff --git a/lib/interface/file.d.ts b/lib/interface/file.d.ts
new file mode 100644
index 0000000..26aa5f3
--- /dev/null
+++ b/lib/interface/file.d.ts
@@ -0,0 +1,4 @@
+export default class File {
+ static getEvent(eventFile: any): Promise;
+ static eventPriority(eventPriority: any): Promise;
+}
diff --git a/lib/interface/file.js b/lib/interface/file.js
new file mode 100644
index 0000000..4b522e6
--- /dev/null
+++ b/lib/interface/file.js
@@ -0,0 +1,68 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const path_1 = __importDefault(require("path"));
+const get_stdin_1 = __importDefault(require("get-stdin"));
+const fs_extra_1 = __importDefault(require("fs-extra"));
+const readline_1 = __importDefault(require("readline"));
+const logger_1 = __importDefault(require("../common/logger"));
+class File {
+ static getEvent(eventFile) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let event = yield get_stdin_1.default(); // read from pipes
+ if (!eventFile)
+ return event;
+ return yield new Promise((resolve, reject) => {
+ let input;
+ if (eventFile === '-') { // read from stdin
+ logger_1.default.log(`Reading event data from stdin, which can be ended with Enter then Ctrl+D
+ (you can also pass it from file with -e)`);
+ input = process.stdin;
+ }
+ else {
+ input = fs_extra_1.default.createReadStream(eventFile, {
+ encoding: 'utf-8'
+ });
+ }
+ const rl = readline_1.default.createInterface({
+ input,
+ output: process.stdout
+ });
+ event = '';
+ rl.on('line', (line) => {
+ event += line;
+ });
+ rl.on('close', () => resolve(event));
+ rl.on('SIGINT', () => reject(new Error('^C')));
+ });
+ });
+ }
+ static eventPriority(eventPriority) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let eventFile;
+ if (eventPriority.event) {
+ return eventPriority.event;
+ }
+ else if (eventPriority.eventStdin) {
+ eventFile = '-';
+ }
+ else if (eventPriority.eventFile) {
+ eventFile = path_1.default.resolve(process.cwd(), eventPriority.eventFile);
+ }
+ return yield this.getEvent(eventFile);
+ });
+ }
+}
+exports.default = File;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbnRlcmZhY2UvZmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUFBLGdEQUF3QjtBQUN4QiwwREFBaUM7QUFDakMsd0RBQTBCO0FBQzFCLHdEQUFnQztBQUNoQyw4REFBc0M7QUFFdEMsTUFBcUIsSUFBSTtJQUV2QixNQUFNLENBQU8sUUFBUSxDQUFDLFNBQVM7O1lBQzdCLElBQUksS0FBSyxHQUFHLE1BQU0sbUJBQVEsRUFBRSxDQUFDLENBQUMsa0JBQWtCO1lBRWhELElBQUksQ0FBQyxTQUFTO2dCQUFFLE9BQU8sS0FBSyxDQUFDO1lBRTdCLE9BQU8sTUFBTSxJQUFJLE9BQU8sQ0FBQyxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsRUFBRTtnQkFDM0MsSUFBSSxLQUFLLENBQUM7Z0JBRVYsSUFBSSxTQUFTLEtBQUssR0FBRyxFQUFFLEVBQUUsa0JBQWtCO29CQUN6QyxnQkFBTSxDQUFDLEdBQUcsQ0FBQzs2Q0FDMEIsQ0FBQyxDQUFBO29CQUN0QyxLQUFLLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQztpQkFDdkI7cUJBQU07b0JBQ0wsS0FBSyxHQUFHLGtCQUFFLENBQUMsZ0JBQWdCLENBQUMsU0FBUyxFQUFFO3dCQUNyQyxRQUFRLEVBQUUsT0FBTztxQkFDbEIsQ0FBQyxDQUFBO2lCQUNIO2dCQUNELE1BQU0sRUFBR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yxTQUFTLENBQUMsQ0FBQTtRQUN2QyxDQUFDO0tBQUE7Q0FDRjtBQS9DRCx1QkErQ0MifQ==
\ No newline at end of file
diff --git a/lib/interface/inputs.d.ts b/lib/interface/inputs.d.ts
new file mode 100644
index 0000000..e69de29
diff --git a/lib/interface/inputs.js b/lib/interface/inputs.js
new file mode 100644
index 0000000..f0adf48
--- /dev/null
+++ b/lib/interface/inputs.js
@@ -0,0 +1 @@
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ludGVyZmFjZS9pbnB1dHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
\ No newline at end of file
diff --git a/lib/lib/client.d.ts b/lib/lib/client.d.ts
new file mode 100644
index 0000000..fbdb5dc
--- /dev/null
+++ b/lib/lib/client.d.ts
@@ -0,0 +1,4 @@
+import { ICredentials } from '../interface/entity';
+export default class Client {
+ static buildFcClient(region: string, credentials: ICredentials): any;
+}
diff --git a/lib/lib/client.js b/lib/lib/client.js
new file mode 100644
index 0000000..3b6c21e
--- /dev/null
+++ b/lib/lib/client.js
@@ -0,0 +1,19 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const fc2_1 = __importDefault(require("@alicloud/fc2"));
+class Client {
+ static buildFcClient(region, credentials) {
+ return new fc2_1.default(credentials.AccountID, {
+ accessKeyID: credentials.AccessKeyID,
+ accessKeySecret: credentials.AccessKeySecret,
+ securityToken: credentials.SecurityToken,
+ region,
+ timeout: 6000000,
+ });
+ }
+}
+exports.default = Client;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi9jbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSx3REFBK0I7QUFHL0IsTUFBcUIsTUFBTTtJQUN6QixNQUFNLENBQUMsYUFBYSxDQUFDLE1BQWMsRUFBRSxXQUF5QjtRQUM1RCxPQUFPLElBQUksYUFBRSxDQUFDLFdBQVcsQ0FBQyxTQUFTLEVBQUU7WUFDbkMsV0FBVyxFQUFFLFdBQVcsQ0FBQyxXQUFXO1lBQ3BDLGVBQWUsRUFBRSxXQUFXLENBQUMsZUFBZTtZQUM1QyxhQUFhLEVBQUUsV0FBVyxDQUFDLGFBQWE7WUFDeEMsTUFBTTtZQUNOLE9BQU8sRUFBRSxPQUFPO1NBQ2pCLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FDRjtBQVZELHlCQVVDIn0=
\ No newline at end of file
diff --git a/lib/lib/event.d.ts b/lib/lib/event.d.ts
new file mode 100644
index 0000000..26aa5f3
--- /dev/null
+++ b/lib/lib/event.d.ts
@@ -0,0 +1,4 @@
+export default class File {
+ static getEvent(eventFile: any): Promise;
+ static eventPriority(eventPriority: any): Promise;
+}
diff --git a/lib/lib/event.js b/lib/lib/event.js
new file mode 100644
index 0000000..bc5e0f3
--- /dev/null
+++ b/lib/lib/event.js
@@ -0,0 +1,68 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const path_1 = __importDefault(require("path"));
+const fs_extra_1 = __importDefault(require("fs-extra"));
+const lodash_1 = require("lodash");
+const readline_1 = __importDefault(require("readline"));
+const logger_1 = __importDefault(require("../common/logger"));
+const stdin_1 = require("./stdin");
+class File {
+ static getEvent(eventFile) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let event = yield stdin_1.getStdin(); // read from pipes
+ if (!eventFile)
+ return event;
+ return yield new Promise((resolve, reject) => {
+ let input;
+ if (eventFile === '-') { // read from stdin
+ logger_1.default.log('Reading event data from stdin, which can be ended with Enter then Ctrl+D');
+ input = process.stdin;
+ }
+ else {
+ input = fs_extra_1.default.createReadStream(eventFile, {
+ encoding: 'utf-8'
+ });
+ }
+ const rl = readline_1.default.createInterface({
+ input,
+ output: process.stdout
+ });
+ event = '';
+ rl.on('line', (line) => {
+ event += line;
+ });
+ rl.on('close', () => resolve(event));
+ rl.on('SIGINT', () => reject(new Error('^C')));
+ });
+ });
+ }
+ static eventPriority(eventPriority) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let eventFile;
+ if (lodash_1.isString(eventPriority.event)) {
+ return eventPriority.event;
+ }
+ else if (eventPriority.eventStdin) {
+ eventFile = '-';
+ }
+ else if (eventPriority.eventFile) {
+ eventFile = path_1.default.resolve(process.cwd(), eventPriority.eventFile);
+ }
+ return yield this.getEvent(eventFile);
+ });
+ }
+}
+exports.default = File;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbGliL2V2ZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7O0FBQUEsZ0RBQXdCO0FBQ3hCLHdEQUEwQjtBQUMxQixtQ0FBa0M7QUFDbEMsd0RBQWdDO0FBQ2hDLDhEQUFzQztBQUN0QyxtQ0FBbUM7QUFFbkMs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UFDLEVBQUUsQ0FBQyxRQUFRLEVBQUUsR0FBRyxFQUFFLENBQUMsTUFBTSxDQUFDLElBQUksS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQTtZQUNoRCxDQUFDLENBQUMsQ0FBQTtRQUNKLENBQUM7S0FBQTtJQUVELE1BQU0sQ0FBTyxhQUFhLENBQUMsYUFBYTs7WUFDdEMsSUFBSSxTQUFpQixDQUFDO1lBRXRCLElBQUksaUJBQVEsQ0FBQyxhQUFhLENBQUMsS0FBSyxDQUFDLEVBQUU7Z0JBQ2pDLE9BQU8sYUFBYSxDQUFDLEtBQUssQ0FBQzthQUM1QjtpQkFBTSxJQUFJLGFBQWEsQ0FBQyxVQUFVLEVBQUU7Z0JBQ25DLFNBQVMsR0FBRyxHQUFHLENBQUM7YUFDakI7aUJBQU0sSUFBSSxhQUFhLENBQUMsU0FBUyxFQUFFO2dCQUNsQyxTQUFTLEdBQUcsY0FBSSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsYUFBYSxDQUFDLFNBQVMsQ0FBQyxDQUFDO2FBQ2xFO1lBRUQsT0FBTyxNQUFNLElBQUksQ0FBQyxRQUFRLENBQUMsU0FBUyxDQUFDLENBQUE7UUFDdkMsQ0FBQztLQUFBO0NBQ0Y7QUE5Q0QsdUJBOENDIn0=
\ No newline at end of file
diff --git a/lib/lib/file.d.ts b/lib/lib/file.d.ts
new file mode 100644
index 0000000..26aa5f3
--- /dev/null
+++ b/lib/lib/file.d.ts
@@ -0,0 +1,4 @@
+export default class File {
+ static getEvent(eventFile: any): Promise;
+ static eventPriority(eventPriority: any): Promise;
+}
diff --git a/lib/lib/file.js b/lib/lib/file.js
new file mode 100644
index 0000000..288ce67
--- /dev/null
+++ b/lib/lib/file.js
@@ -0,0 +1,68 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const path_1 = __importDefault(require("path"));
+const get_stdin_1 = __importDefault(require("get-stdin"));
+const fs_extra_1 = __importDefault(require("fs-extra"));
+const readline_1 = __importDefault(require("readline"));
+const logger_1 = __importDefault(require("../common/logger"));
+class File {
+ static getEvent(eventFile) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let event = yield get_stdin_1.default(); // read from pipes
+ if (!eventFile)
+ return event;
+ return yield new Promise((resolve, reject) => {
+ let input;
+ if (eventFile === '-') { // read from stdin
+ logger_1.default.log(`Reading event data from stdin, which can be ended with Enter then Ctrl+D
+ (you can also pass it from file with -e)`);
+ input = process.stdin;
+ }
+ else {
+ input = fs_extra_1.default.createReadStream(eventFile, {
+ encoding: 'utf-8'
+ });
+ }
+ const rl = readline_1.default.createInterface({
+ input,
+ output: process.stdout
+ });
+ event = '';
+ rl.on('line', (line) => {
+ event += line;
+ });
+ rl.on('close', () => resolve(event));
+ rl.on('SIGINT', () => reject(new Error('^C')));
+ });
+ });
+ }
+ static eventPriority(eventPriority) {
+ return __awaiter(this, void 0, void 0, function* () {
+ let eventFile;
+ if (eventPriority.event) {
+ return eventPriority.event;
+ }
+ else if (eventPriority.eventStdin) {
+ eventFile = '-';
+ }
+ else if (eventPriority.eventFile) {
+ eventFile = path_1.default.resolve(process.cwd(), eventPriority.eventFile);
+ }
+ return yield this.getEvent(eventFile);
+ });
+ }
+}
+exports.default = File;
+//# sourceMappingURL=data:application/json;base64,eyJ2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invoke.d.ts
@@ -0,0 +1,36 @@
+import { IProperties, IEventPayload } from '../interface/entity';
+export default class RemoteInvoke {
+ fcClient: any;
+ accountId: string;
+ constructor(region: string, credentials: any);
+ invoke(props: IProperties, eventPayload: IEventPayload, { invocationType }: {
+ invocationType: any;
+ }): Promise;
+ getHttpTrigger(serviceName: any, functionName: any): Promise;
+ eventInvoke({ serviceName, functionName, event, qualifier, invocationType }: {
+ serviceName: any;
+ functionName: any;
+ event: any;
+ qualifier?: string;
+ invocationType: any;
+ }): Promise;
+ httpInvoke({ region, serviceName, functionName, event, qualifier }: {
+ region: any;
+ serviceName: any;
+ functionName: any;
+ event: any;
+ qualifier: any;
+ }): Promise;
+ /**
+ * @param event: { body, headers, method, queries, path }
+ * path 组装后的路径 /proxy/serviceName/functionName/path ,
+ */
+ request(event: any): Promise;
+ handlerHttpParmase(event: any): {
+ headers: any;
+ queries: any;
+ method: any;
+ path: any;
+ body: any;
+ };
+}
diff --git a/lib/lib/remote-invoke.js b/lib/lib/remote-invoke.js
new file mode 100644
index 0000000..721a683
--- /dev/null
+++ b/lib/lib/remote-invoke.js
@@ -0,0 +1,188 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const lodash_1 = __importDefault(require("lodash"));
+const client_1 = __importDefault(require("./client"));
+const event_1 = __importDefault(require("./event"));
+const logger_1 = __importDefault(require("../common/logger"));
+class RemoteInvoke {
+ constructor(region, credentials) {
+ this.accountId = credentials.AccountID;
+ this.fcClient = client_1.default.buildFcClient(region, credentials);
+ }
+ invoke(props, eventPayload, { invocationType }) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const event = yield event_1.default.eventPriority(eventPayload);
+ logger_1.default.debug(`event: ${event}`);
+ const { region, serviceName, functionName, qualifier, } = props;
+ const httpTriggers = yield this.getHttpTrigger(serviceName, functionName);
+ const payload = { event, serviceName, functionName, qualifier };
+ if (lodash_1.default.isEmpty(httpTriggers)) {
+ payload.invocationType = invocationType;
+ payload.event = event;
+ yield this.eventInvoke(payload);
+ }
+ else {
+ payload.region = region;
+ try {
+ payload.event = event ? JSON.parse(event) : {};
+ }
+ catch (ex) {
+ logger_1.default.debug(ex);
+ throw new Error('handler event error. Example: https://github.com/devsapp/fc-remote-invoke/blob/master/example/http.json');
+ }
+ yield this.httpInvoke(payload);
+ }
+ });
+ }
+ getHttpTrigger(serviceName, functionName) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { data } = yield this.fcClient.listTriggers(serviceName, functionName);
+ logger_1.default.debug(`get listTriggers: ${JSON.stringify(data)}`);
+ if (lodash_1.default.isEmpty(data.triggers)) {
+ return [];
+ }
+ const httpTrigger = data.triggers.filter(t => t.triggerType === 'http' || t.triggerType === 'https');
+ if (lodash_1.default.isEmpty(httpTrigger)) {
+ return [];
+ }
+ return httpTrigger;
+ });
+ }
+ eventInvoke({ serviceName, functionName, event, qualifier = 'LATEST', invocationType }) {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (invocationType === 'Sync') {
+ const rs = yield this.fcClient.invokeFunction(serviceName, functionName, event, {
+ 'X-Fc-Log-Type': 'Tail',
+ 'X-Fc-Invocation-Type': invocationType
+ }, qualifier);
+ const log = rs.headers['x-fc-log-result'];
+ if (log) {
+ logger_1.default.log('========= FC invoke Logs begin =========', 'yellow');
+ const decodedLog = Buffer.from(log, 'base64');
+ logger_1.default.log(decodedLog.toString());
+ logger_1.default.log('========= FC invoke Logs end =========', 'yellow');
+ logger_1.default.log('\nFC Invoke Result:', 'green');
+ console.log(rs.data);
+ console.log('\n');
+ }
+ }
+ else {
+ yield this.fcClient.invokeFunction(serviceName, functionName, event, {
+ 'X-Fc-Invocation-Type': invocationType
+ }, qualifier);
+ logger_1.default.log('`${serviceName}/${functionName} async invoke success.\n`', 'green');
+ }
+ });
+ }
+ httpInvoke({ region, serviceName, functionName, event, qualifier }) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const q = qualifier ? `.${qualifier}` : '';
+ event.path = `/proxy/${serviceName}${q}/${functionName}/${event.path || ''}`;
+ logger_1.default.log(`https://${this.accountId}.${region}.fc.aliyuncs.com/2016-08-15/proxy/${serviceName}${q}/${functionName}/`);
+ yield this.request(event);
+ });
+ }
+ /**
+ * @param event: { body, headers, method, queries, path }
+ * path 组装后的路径 /proxy/serviceName/functionName/path ,
+ */
+ request(event) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const { headers, queries, method, path: p, body } = this.handlerHttpParmase(event);
+ let resp;
+ try {
+ const mt = method.toLocaleUpperCase();
+ logger_1.default.debug(`method is ${mt}.`);
+ logger_1.default.debug(`start invoke.`);
+ if (mt === 'GET') {
+ resp = yield this.fcClient.get(p, queries, headers);
+ }
+ else if (mt === 'POST') {
+ resp = yield this.fcClient.post(p, body, headers, queries);
+ }
+ else if (mt === 'PUT') {
+ resp = yield this.fcClient.put(p, body, headers);
+ }
+ else if (mt === 'DELETE') {
+ resp = yield this.fcClient.request('DELETE', p, queries, null, headers);
+ /* else if (method.toLocaleUpperCase() === 'PATCH') {
+ resp = await this.fcClient.request('PATCH', p, queries, body, headers);
+ } else if (method.toLocaleUpperCase() === 'HEAD') {
+ resp = await this.fcClient.request('HEAD', p, queries, body, headers);
+ } */
+ }
+ else {
+ logger_1.default.log(`Does not support ${method} requests temporarily.`);
+ }
+ }
+ catch (e) {
+ logger_1.default.debug(e);
+ if (e.message === 'Unexpected token r in JSON at position 0' && e.stack.includes('/fc2/lib/client.js') && e.stack.includes('at Client.request')) {
+ throw new Error('The body in http responss is not in json format, but the content-type in response header is application/json. We recommend that you make the format of the response body be consistent with the content-type in response header.');
+ }
+ throw e;
+ }
+ logger_1.default.debug(`end invoke.`);
+ if (resp) {
+ const log = resp.headers['x-fc-log-result'];
+ if (log) {
+ logger_1.default.log('\n========= FC invoke Logs begin =========', 'yellow');
+ const decodedLog = Buffer.from(log, 'base64');
+ logger_1.default.log(decodedLog.toString());
+ logger_1.default.log('========= FC invoke Logs end =========', 'yellow');
+ }
+ logger_1.default.log('\nFC Invoke Result:', 'green');
+ console.log(resp.data);
+ console.log('\n');
+ }
+ });
+ }
+ handlerHttpParmase(event) {
+ const { body = '', headers = {}, method = 'GET', queries = '', path: p = '' } = event;
+ let postBody;
+ if (body) {
+ let buff = null;
+ if (Buffer.isBuffer(body)) {
+ buff = body;
+ headers['content-type'] = 'application/octet-stream';
+ }
+ else if (typeof body === 'string') {
+ buff = Buffer.from(body, 'utf8');
+ headers['content-type'] = 'application/octet-stream';
+ }
+ else if (typeof body.pipe === 'function') {
+ buff = body;
+ headers['content-type'] = 'application/octet-stream';
+ }
+ else {
+ buff = Buffer.from(JSON.stringify(body), 'utf8');
+ headers['content-type'] = 'application/json';
+ }
+ postBody = buff;
+ }
+ if (!headers['X-Fc-Log-Type']) {
+ headers['X-Fc-Log-Type'] = 'Tail';
+ }
+ return {
+ headers,
+ queries,
+ method,
+ path: p,
+ body: postBody
+ };
+ }
+}
+exports.default = RemoteInvoke;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVtb3RlLWludm9rZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvcmVtb3RlLWludm9rZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUFBLG9EQUF1QjtBQUN2QixzREFBOEI7QUFFOU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EVBQUUsTUFBTSxDQUFDLENBQUM7Z0JBQ2pELE9BQU8sQ0FBQyxjQUFjLENBQUMsR0FBRyxrQkFBa0IsQ0FBQzthQUM5QztZQUNELFFBQVEsR0FBRyxJQUFJLENBQUM7U0FDakI7UUFFRCxJQUFJLENBQUMsT0FBTyxDQUFDLGVBQWUsQ0FBQyxFQUFFO1lBQzdCLE9BQU8sQ0FBQyxlQUFlLENBQUMsR0FBRyxNQUFNLENBQUM7U0FDbkM7UUFFRCxPQUFPO1lBQ0wsT0FBTztZQUNQLE9BQU87WUFDUCxNQUFNO1lBQ04sSUFBSSxFQUFFLENBQUM7WUFDUCxJQUFJLEVBQUUsUUFBUTtTQUNmLENBQUE7SUFDSCxDQUFDO0NBQ0Y7QUFuTEQsK0JBbUxDIn0=
\ No newline at end of file
diff --git a/lib/lib/stdin.d.ts b/lib/lib/stdin.d.ts
new file mode 100644
index 0000000..ed45d22
--- /dev/null
+++ b/lib/lib/stdin.d.ts
@@ -0,0 +1,5 @@
+///
+export declare function getStdin(): Promise;
+export declare namespace getStdin {
+ var buffer: () => Promise;
+}
diff --git a/lib/lib/stdin.js b/lib/lib/stdin.js
new file mode 100644
index 0000000..4abf7bc
--- /dev/null
+++ b/lib/lib/stdin.js
@@ -0,0 +1,69 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __asyncValues = (this && this.__asyncValues) || function (o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator], i;
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getStdin = void 0;
+const { stdin } = process;
+function getStdin() {
+ var e_1, _a;
+ return __awaiter(this, void 0, void 0, function* () {
+ let result = '';
+ if (stdin.isTTY) {
+ return result;
+ }
+ stdin.setEncoding('utf8');
+ try {
+ for (var stdin_1 = __asyncValues(stdin), stdin_1_1; stdin_1_1 = yield stdin_1.next(), !stdin_1_1.done;) {
+ const chunk = stdin_1_1.value;
+ result += chunk;
+ }
+ }
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
+ finally {
+ try {
+ if (stdin_1_1 && !stdin_1_1.done && (_a = stdin_1.return)) yield _a.call(stdin_1);
+ }
+ finally { if (e_1) throw e_1.error; }
+ }
+ return result;
+ });
+}
+exports.getStdin = getStdin;
+getStdin.buffer = () => __awaiter(void 0, void 0, void 0, function* () {
+ var e_2, _a;
+ const result = [];
+ let length = 0;
+ if (stdin.isTTY) {
+ return Buffer.concat([]);
+ }
+ try {
+ for (var stdin_2 = __asyncValues(stdin), stdin_2_1; stdin_2_1 = yield stdin_2.next(), !stdin_2_1.done;) {
+ const chunk = stdin_2_1.value;
+ result.push(chunk);
+ length += chunk.length;
+ }
+ }
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
+ finally {
+ try {
+ if (stdin_2_1 && !stdin_2_1.done && (_a = stdin_2.return)) yield _a.call(stdin_2);
+ }
+ finally { if (e_2) throw e_2.error; }
+ }
+ return Buffer.concat(result, length);
+});
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlI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BRUQsT0FBTyxNQUFNLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRSxNQUFNLENBQUMsQ0FBQztBQUN0QyxDQUFDLENBQUEsQ0FBQyJ9
\ No newline at end of file
diff --git a/locales/en.json b/locales/en.json
index 346c941..5c001de 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -1,3 +1,3 @@
{
- "deploy test": "deploy test"
+ "deploy test": "部署测试"
}
\ No newline at end of file
diff --git a/package.json b/package.json
index 866f5d5..180190a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "fc-remote-invoke",
- "version": "0.0.6",
+ "version": "0.0.7",
"description": "This is a component demo for Serverless Devs Tool ",
"keywords": [
"Serverless",
@@ -23,9 +23,9 @@
},
"scripts": {
"start": "npm run watch",
- "watch": "npm run doc && tsc -w",
+ "watch": "tsc -w",
"publish": "npm run build && s cli platform publish",
- "build": "tsc",
+ "build": "npm run doc && tsc",
"postbuild": "npm run doc",
"doc": "npx typedoc src/index.ts --json doc/doc.json --out doc"
},
diff --git a/publish.yaml b/publish.yaml
index 8c8b7d6..4a850c5 100644
--- a/publish.yaml
+++ b/publish.yaml
@@ -2,7 +2,7 @@ Type: Component
Name: fc-remote-invoke
Provider:
- 其它
-Version: 0.0.6
+Version: 0.0.7
Description: 初始化component模板
HomePage: https://www.serverless-devs.com
Tags: #标签详情
report
-- report(componentName: string, command: string, accountID?: string, access?: string): Promise<void>
+ - report(componentName: string, command: string, accountID: string): Promise<void>
Parameters
@@ -276,67 +186,13 @@command: string
Optional accountID: string
-Optional access: string
+accountID: string
Returns Promise<void>
-start
--- start(inputs: InputProps): Promise<any>
-
---
-
-
-
-
-
-
-
-http 函数本地调试
-Parameters
---
-
-
-inputs: InputProps
-Returns Promise<any>
-startExpress
--- start
Express(app: any): void
-
---
-
-
-
-Parameters
---
-
-
-app: any
-Returns void
-