@geek-fun/serverlessinsight 0.5.2 → 0.5.3
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/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -29,10 +29,10 @@ const createStateBackend = (backendConfig, context) => {
|
|
|
29
29
|
return (0, localStateBackend_1.createLocalStateBackend)(context.app, context.service, context.baseDir);
|
|
30
30
|
}
|
|
31
31
|
const bucketConfig = backendConfig;
|
|
32
|
-
const region =
|
|
33
|
-
const accessKeyId =
|
|
34
|
-
const accessKeySecret =
|
|
35
|
-
const securityToken =
|
|
32
|
+
const region = context.region;
|
|
33
|
+
const accessKeyId = context.accessKeyId;
|
|
34
|
+
const accessKeySecret = context.accessKeySecret;
|
|
35
|
+
const securityToken = context.securityToken;
|
|
36
36
|
if (context.provider === providerEnum_1.ProviderEnum.TENCENT) {
|
|
37
37
|
return (0, cosStateBackend_1.createCosStateBackend)({
|
|
38
38
|
bucket: bucketConfig.bucket,
|
package/dist/src/parser/index.js
CHANGED
|
@@ -20,19 +20,18 @@ const validateExistence = (path) => {
|
|
|
20
20
|
const parseBackend = (raw) => {
|
|
21
21
|
if (!raw)
|
|
22
22
|
return undefined;
|
|
23
|
-
const
|
|
23
|
+
const stateManager = raw.state_manager;
|
|
24
|
+
if (!stateManager)
|
|
25
|
+
return undefined;
|
|
26
|
+
const type = stateManager.type?.toUpperCase();
|
|
24
27
|
if (type === types_1.StateBackendType.BUCKET_STORE) {
|
|
25
|
-
if (!
|
|
28
|
+
if (!stateManager.bucket || !stateManager.key) {
|
|
26
29
|
throw new Error('Backend type BUCKET_STORE requires both "bucket" and "key" fields');
|
|
27
30
|
}
|
|
28
31
|
return {
|
|
29
32
|
type: types_1.StateBackendType.BUCKET_STORE,
|
|
30
|
-
bucket:
|
|
31
|
-
key:
|
|
32
|
-
region: raw.region,
|
|
33
|
-
accessKeyId: raw.accessKeyId,
|
|
34
|
-
accessKeySecret: raw.accessKeySecret,
|
|
35
|
-
securityToken: raw.securityToken,
|
|
33
|
+
bucket: stateManager.bucket,
|
|
34
|
+
key: stateManager.key,
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
37
|
return { type: types_1.StateBackendType.LOCAL };
|
|
@@ -99,6 +99,22 @@ exports.rootSchema = {
|
|
|
99
99
|
tables: {
|
|
100
100
|
$ref: 'https://serverlessinsight.geekfun.club/schemas/tableschema.json',
|
|
101
101
|
},
|
|
102
|
+
backend: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
state_manager: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: {
|
|
108
|
+
type: { type: 'string', enum: ['LOCAL', 'BUCKET_STORE'] },
|
|
109
|
+
bucket: { type: 'string' },
|
|
110
|
+
key: { type: 'string' },
|
|
111
|
+
},
|
|
112
|
+
required: ['type'],
|
|
113
|
+
additionalProperties: false,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
additionalProperties: false,
|
|
117
|
+
},
|
|
102
118
|
},
|
|
103
119
|
required: ['version', 'provider', 'app', 'service'],
|
|
104
120
|
additionalProperties: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|