@geek-fun/serverlessinsight 0.5.3 → 0.5.5
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 +1 -1
- package/dist/src/commands/deploy.js +1 -0
- package/dist/src/common/aliyunClient/apigwOperations.js +153 -82
- package/dist/src/common/aliyunClient/ecsOperations.js +64 -13
- package/dist/src/common/aliyunClient/fc3Operations.js +15 -12
- package/dist/src/common/aliyunClient/index.js +3 -0
- package/dist/src/common/aliyunClient/ossOperations.js +4 -0
- package/dist/src/common/aliyunClient/ramOperations.js +45 -17
- package/dist/src/common/constants.js +14 -1
- package/dist/src/common/index.js +1 -0
- package/dist/src/common/lockManager.js +29 -1
- package/dist/src/common/sidUtils.js +24 -0
- package/dist/src/common/stateBackend/cosStateBackend.js +31 -0
- package/dist/src/common/stateBackend/ossStateBackend.js +32 -0
- package/dist/src/common/stateManager.js +2 -2
- package/dist/src/lang/en.js +13 -5
- package/dist/src/lang/zh-CN.js +38 -5
- package/dist/src/stack/aliyunStack/apigwPlanner.js +1 -1
- package/dist/src/stack/aliyunStack/apigwResource.js +18 -17
- package/dist/src/stack/aliyunStack/apigwTypes.js +4 -4
- package/dist/src/stack/aliyunStack/databaseResource.js +37 -21
- package/dist/src/stack/aliyunStack/fc3Executor.js +15 -5
- package/dist/src/stack/aliyunStack/fc3Planner.js +1 -1
- package/dist/src/stack/aliyunStack/fc3Resource.js +257 -132
- package/dist/src/stack/aliyunStack/ossResource.js +19 -8
- package/dist/src/stack/aliyunStack/tablestoreResource.js +19 -7
- package/dist/src/stack/scfStack/cosResource.js +21 -7
- package/dist/src/stack/scfStack/esServerlessResource.js +20 -7
- package/dist/src/stack/scfStack/scfResource.js +20 -7
- package/dist/src/stack/scfStack/tdsqlcResource.js +24 -7
- package/dist/src/types/domains/state.js +11 -2
- package/dist/src/validator/functionSchema.js +9 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,10 +4,11 @@ exports.deleteTableResource = exports.updateTableResource = exports.readTableRes
|
|
|
4
4
|
const aliyunClient_1 = require("../../common/aliyunClient");
|
|
5
5
|
const common_1 = require("../../common");
|
|
6
6
|
const tablestoreTypes_1 = require("./tablestoreTypes");
|
|
7
|
-
const
|
|
7
|
+
const logger_1 = require("../../common/logger");
|
|
8
|
+
const buildTableStoreInstanceFromProvider = (info, sid, instanceName, clusterType) => {
|
|
8
9
|
return {
|
|
9
10
|
type: 'ALIYUN_TABLESTORE_TABLE',
|
|
10
|
-
|
|
11
|
+
sid,
|
|
11
12
|
id: `${instanceName}/${info.tableName}`,
|
|
12
13
|
instanceName,
|
|
13
14
|
tableName: info.tableName,
|
|
@@ -57,13 +58,13 @@ const createTableResource = async (context, table, state) => {
|
|
|
57
58
|
throw new Error(`Failed to refresh state for table: ${config.tableName}`);
|
|
58
59
|
}
|
|
59
60
|
const definition = (0, tablestoreTypes_1.extractTableStoreDefinition)(config);
|
|
60
|
-
const
|
|
61
|
+
const sid = (0, common_1.buildSid)('aliyun', 'ots', context.stage, `${config.instanceName}/${config.tableName}`);
|
|
61
62
|
const resourceState = {
|
|
62
63
|
mode: 'managed',
|
|
63
64
|
region: context.region,
|
|
64
65
|
definition,
|
|
65
66
|
instances: [
|
|
66
|
-
buildTableStoreInstanceFromProvider(tableInfo,
|
|
67
|
+
buildTableStoreInstanceFromProvider(tableInfo, sid, config.instanceName, config.clusterType),
|
|
67
68
|
],
|
|
68
69
|
lastUpdated: new Date().toISOString(),
|
|
69
70
|
};
|
|
@@ -97,13 +98,13 @@ const updateTableResource = async (context, table, state) => {
|
|
|
97
98
|
throw new Error(`Failed to refresh state for table: ${config.tableName}`);
|
|
98
99
|
}
|
|
99
100
|
const definition = (0, tablestoreTypes_1.extractTableStoreDefinition)(config);
|
|
100
|
-
const
|
|
101
|
+
const sid = (0, common_1.buildSid)('aliyun', 'ots', context.stage, `${config.instanceName}/${config.tableName}`);
|
|
101
102
|
const resourceState = {
|
|
102
103
|
mode: 'managed',
|
|
103
104
|
region: context.region,
|
|
104
105
|
definition,
|
|
105
106
|
instances: [
|
|
106
|
-
buildTableStoreInstanceFromProvider(tableInfo,
|
|
107
|
+
buildTableStoreInstanceFromProvider(tableInfo, sid, config.instanceName, config.clusterType),
|
|
107
108
|
],
|
|
108
109
|
lastUpdated: new Date().toISOString(),
|
|
109
110
|
};
|
|
@@ -114,7 +115,18 @@ exports.updateTableResource = updateTableResource;
|
|
|
114
115
|
const deleteTableResource = async (context, instanceName, tableName, logicalId, state) => {
|
|
115
116
|
const client = (0, aliyunClient_1.createAliyunClient)(context);
|
|
116
117
|
const tablestoreClient = client.tablestore(instanceName);
|
|
117
|
-
|
|
118
|
+
try {
|
|
119
|
+
await tablestoreClient.deleteTable(tableName);
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
const errorMessage = err?.message ?? '';
|
|
123
|
+
if (errorMessage.includes('OTSObjectNotExist') || errorMessage.includes('does not exist')) {
|
|
124
|
+
logger_1.logger.warn(`Table ${tableName} in instance ${instanceName} not found in provider, skipping deletion`);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
throw err;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
118
130
|
return (0, common_1.removeResource)(state, logicalId);
|
|
119
131
|
};
|
|
120
132
|
exports.deleteTableResource = deleteTableResource;
|
|
@@ -4,9 +4,11 @@ exports.deleteBucketResource = exports.updateBucketResource = exports.readBucket
|
|
|
4
4
|
const tencentClient_1 = require("../../common/tencentClient");
|
|
5
5
|
const cosTypes_1 = require("./cosTypes");
|
|
6
6
|
const stateManager_1 = require("../../common/stateManager");
|
|
7
|
-
const
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
const logger_1 = require("../../common/logger");
|
|
9
|
+
const buildCosInstanceFromProvider = (info, sid) => {
|
|
8
10
|
return {
|
|
9
|
-
|
|
11
|
+
sid,
|
|
10
12
|
id: info.Name,
|
|
11
13
|
bucket: info.Name,
|
|
12
14
|
location: info.Location,
|
|
@@ -72,12 +74,12 @@ const createBucketResource = async (context, bucket, state) => {
|
|
|
72
74
|
throw new Error(`Failed to refresh state for bucket: ${bucket.name}`);
|
|
73
75
|
}
|
|
74
76
|
const definition = (0, cosTypes_1.extractCosBucketDefinition)(config);
|
|
75
|
-
const
|
|
77
|
+
const sid = (0, common_1.buildSid)('tencent', 'cos', context.stage, bucket.name);
|
|
76
78
|
const resourceState = {
|
|
77
79
|
mode: 'managed',
|
|
78
80
|
region: context.region,
|
|
79
81
|
definition,
|
|
80
|
-
instances: [buildCosInstanceFromProvider(bucketInfo,
|
|
82
|
+
instances: [buildCosInstanceFromProvider(bucketInfo, sid)],
|
|
81
83
|
lastUpdated: new Date().toISOString(),
|
|
82
84
|
};
|
|
83
85
|
const logicalId = `buckets.${bucket.key}`;
|
|
@@ -106,12 +108,12 @@ const updateBucketResource = async (context, bucket, state) => {
|
|
|
106
108
|
throw new Error(`Failed to refresh state for bucket: ${bucket.name}`);
|
|
107
109
|
}
|
|
108
110
|
const definition = (0, cosTypes_1.extractCosBucketDefinition)(config);
|
|
109
|
-
const
|
|
111
|
+
const sid = (0, common_1.buildSid)('tencent', 'cos', context.stage, bucket.name);
|
|
110
112
|
const resourceState = {
|
|
111
113
|
mode: 'managed',
|
|
112
114
|
region: context.region,
|
|
113
115
|
definition,
|
|
114
|
-
instances: [buildCosInstanceFromProvider(bucketInfo,
|
|
116
|
+
instances: [buildCosInstanceFromProvider(bucketInfo, sid)],
|
|
115
117
|
lastUpdated: new Date().toISOString(),
|
|
116
118
|
};
|
|
117
119
|
const logicalId = `buckets.${bucket.key}`;
|
|
@@ -120,7 +122,19 @@ const updateBucketResource = async (context, bucket, state) => {
|
|
|
120
122
|
exports.updateBucketResource = updateBucketResource;
|
|
121
123
|
const deleteBucketResource = async (context, bucketName, region, logicalId, state) => {
|
|
122
124
|
const client = (0, tencentClient_1.createTencentClient)(context);
|
|
123
|
-
|
|
125
|
+
try {
|
|
126
|
+
await client.cos.deleteBucket(bucketName, region);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
const errorCode = err?.code;
|
|
130
|
+
const statusCode = err?.statusCode;
|
|
131
|
+
if (errorCode === 'NoSuchBucket' || statusCode === 404) {
|
|
132
|
+
logger_1.logger.warn(`Bucket ${bucketName} not found in provider, skipping deletion`);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
124
138
|
return (0, stateManager_1.removeResource)(state, logicalId);
|
|
125
139
|
};
|
|
126
140
|
exports.deleteBucketResource = deleteBucketResource;
|
|
@@ -4,9 +4,11 @@ exports.deleteEsResource = exports.updateEsResource = exports.readEsResource = e
|
|
|
4
4
|
const tencentClient_1 = require("../../common/tencentClient");
|
|
5
5
|
const esServerlessTypes_1 = require("./esServerlessTypes");
|
|
6
6
|
const stateManager_1 = require("../../common/stateManager");
|
|
7
|
-
const
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
const logger_1 = require("../../common/logger");
|
|
9
|
+
const buildEsSpaceFromProvider = (info, sid) => {
|
|
8
10
|
return {
|
|
9
|
-
|
|
11
|
+
sid,
|
|
10
12
|
id: info.SpaceId,
|
|
11
13
|
spaceId: info.SpaceId,
|
|
12
14
|
spaceName: info.SpaceName,
|
|
@@ -34,12 +36,12 @@ const createEsResource = async (context, database, state) => {
|
|
|
34
36
|
throw new Error(`Failed to refresh state for ES space: ${spaceId}`);
|
|
35
37
|
}
|
|
36
38
|
const definition = (0, esServerlessTypes_1.extractTencentEsDefinition)(config);
|
|
37
|
-
const
|
|
39
|
+
const sid = (0, common_1.buildSid)('tencent', 'es', context.stage, spaceId);
|
|
38
40
|
const resourceState = {
|
|
39
41
|
mode: 'managed',
|
|
40
42
|
region: context.region,
|
|
41
43
|
definition,
|
|
42
|
-
instances: [buildEsSpaceFromProvider(spaceInfo,
|
|
44
|
+
instances: [buildEsSpaceFromProvider(spaceInfo, sid)],
|
|
43
45
|
lastUpdated: new Date().toISOString(),
|
|
44
46
|
metadata: {
|
|
45
47
|
spaceName: database.name,
|
|
@@ -69,12 +71,12 @@ const updateEsResource = async (context, database, spaceId, state) => {
|
|
|
69
71
|
throw new Error(`Failed to refresh state for ES space: ${spaceId}`);
|
|
70
72
|
}
|
|
71
73
|
const definition = (0, esServerlessTypes_1.extractTencentEsDefinition)(config);
|
|
72
|
-
const
|
|
74
|
+
const sid = (0, common_1.buildSid)('tencent', 'es', context.stage, spaceId);
|
|
73
75
|
const resourceState = {
|
|
74
76
|
mode: 'managed',
|
|
75
77
|
region: context.region,
|
|
76
78
|
definition,
|
|
77
|
-
instances: [buildEsSpaceFromProvider(spaceInfo,
|
|
79
|
+
instances: [buildEsSpaceFromProvider(spaceInfo, sid)],
|
|
78
80
|
lastUpdated: new Date().toISOString(),
|
|
79
81
|
metadata: {
|
|
80
82
|
spaceName: database.name,
|
|
@@ -88,7 +90,18 @@ const updateEsResource = async (context, database, spaceId, state) => {
|
|
|
88
90
|
exports.updateEsResource = updateEsResource;
|
|
89
91
|
const deleteEsResource = async (context, spaceId, logicalId, state) => {
|
|
90
92
|
const client = (0, tencentClient_1.createTencentClient)(context);
|
|
91
|
-
|
|
93
|
+
try {
|
|
94
|
+
await client.es.deleteSpace(spaceId);
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
const errorCode = err?.code;
|
|
98
|
+
if (errorCode === 'ResourceNotFound' || errorCode === 'InvalidParameterValue') {
|
|
99
|
+
logger_1.logger.warn(`ES space ${spaceId} not found in provider, skipping deletion`);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
throw err;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
92
105
|
return (0, stateManager_1.removeResource)(state, logicalId);
|
|
93
106
|
};
|
|
94
107
|
exports.deleteEsResource = deleteEsResource;
|
|
@@ -5,8 +5,10 @@ const tencentClient_1 = require("../../common/tencentClient");
|
|
|
5
5
|
const fileUtils_1 = require("../../common/fileUtils");
|
|
6
6
|
const scfTypes_1 = require("./scfTypes");
|
|
7
7
|
const stateManager_1 = require("../../common/stateManager");
|
|
8
|
+
const common_1 = require("../../common");
|
|
8
9
|
const hashUtils_1 = require("../../common/hashUtils");
|
|
9
|
-
const
|
|
10
|
+
const logger_1 = require("../../common/logger");
|
|
11
|
+
const buildScfInstanceFromProvider = (info, sid) => {
|
|
10
12
|
const envMap = info.Environment?.Variables?.reduce((acc, v) => ({ ...acc, [v.Key]: v.Value }), {}) ?? {};
|
|
11
13
|
const triggersArray = info.Triggers?.map((t) => ({
|
|
12
14
|
modTime: t.ModTime,
|
|
@@ -33,7 +35,7 @@ const buildScfInstanceFromProvider = (info, arn) => {
|
|
|
33
35
|
compatibleRuntimes: l.CompatibleRuntimes ?? [],
|
|
34
36
|
}));
|
|
35
37
|
return {
|
|
36
|
-
|
|
38
|
+
sid,
|
|
37
39
|
id: info.FunctionName,
|
|
38
40
|
functionName: info.FunctionName,
|
|
39
41
|
runtime: info.Runtime,
|
|
@@ -163,12 +165,12 @@ const createResource = async (context, fn, state) => {
|
|
|
163
165
|
}
|
|
164
166
|
const codeHash = (0, hashUtils_1.computeFileHash)(codePath);
|
|
165
167
|
const definition = (0, scfTypes_1.extractScfDefinition)(config, codeHash);
|
|
166
|
-
const
|
|
168
|
+
const sid = (0, common_1.buildSid)('tencent', 'scf', context.stage, fn.name);
|
|
167
169
|
const resourceState = {
|
|
168
170
|
mode: 'managed',
|
|
169
171
|
region: context.region,
|
|
170
172
|
definition,
|
|
171
|
-
instances: [buildScfInstanceFromProvider(functionInfo,
|
|
173
|
+
instances: [buildScfInstanceFromProvider(functionInfo, sid)],
|
|
172
174
|
lastUpdated: new Date().toISOString(),
|
|
173
175
|
};
|
|
174
176
|
const logicalId = `functions.${fn.key}`;
|
|
@@ -196,12 +198,12 @@ const updateResource = async (context, fn, state) => {
|
|
|
196
198
|
}
|
|
197
199
|
const codeHash = (0, hashUtils_1.computeFileHash)(codePath);
|
|
198
200
|
const definition = (0, scfTypes_1.extractScfDefinition)(config, codeHash);
|
|
199
|
-
const
|
|
201
|
+
const sid = (0, common_1.buildSid)('tencent', 'scf', context.stage, fn.name);
|
|
200
202
|
const resourceState = {
|
|
201
203
|
mode: 'managed',
|
|
202
204
|
region: context.region,
|
|
203
205
|
definition,
|
|
204
|
-
instances: [buildScfInstanceFromProvider(functionInfo,
|
|
206
|
+
instances: [buildScfInstanceFromProvider(functionInfo, sid)],
|
|
205
207
|
lastUpdated: new Date().toISOString(),
|
|
206
208
|
};
|
|
207
209
|
const logicalId = `functions.${fn.key}`;
|
|
@@ -210,7 +212,18 @@ const updateResource = async (context, fn, state) => {
|
|
|
210
212
|
exports.updateResource = updateResource;
|
|
211
213
|
const deleteResource = async (context, functionName, logicalId, state) => {
|
|
212
214
|
const client = (0, tencentClient_1.createTencentClient)(context);
|
|
213
|
-
|
|
215
|
+
try {
|
|
216
|
+
await client.scf.deleteFunction(functionName);
|
|
217
|
+
}
|
|
218
|
+
catch (err) {
|
|
219
|
+
const errorCode = err?.code;
|
|
220
|
+
if (errorCode === 'ResourceNotFound.FunctionName') {
|
|
221
|
+
logger_1.logger.warn(`Function ${functionName} not found in provider, skipping deletion`);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
throw err;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
214
227
|
return (0, stateManager_1.removeResource)(state, logicalId);
|
|
215
228
|
};
|
|
216
229
|
exports.deleteResource = deleteResource;
|
|
@@ -4,9 +4,11 @@ exports.deleteDatabaseResource = exports.updateDatabaseResource = exports.readDa
|
|
|
4
4
|
const tencentClient_1 = require("../../common/tencentClient");
|
|
5
5
|
const tdsqlcTypes_1 = require("./tdsqlcTypes");
|
|
6
6
|
const stateManager_1 = require("../../common/stateManager");
|
|
7
|
-
const
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
const logger_1 = require("../../common/logger");
|
|
9
|
+
const buildTdsqlcInstanceFromProvider = (info, sid) => {
|
|
8
10
|
return {
|
|
9
|
-
|
|
11
|
+
sid,
|
|
10
12
|
id: info.ClusterId,
|
|
11
13
|
clusterId: info.ClusterId,
|
|
12
14
|
clusterName: info.ClusterName,
|
|
@@ -89,12 +91,12 @@ const createDatabaseResource = async (context, database, state) => {
|
|
|
89
91
|
throw new Error(`Failed to refresh state for cluster: ${clusterId}`);
|
|
90
92
|
}
|
|
91
93
|
const definition = (0, tdsqlcTypes_1.extractTdsqlcDefinition)(config);
|
|
92
|
-
const
|
|
94
|
+
const sid = (0, common_1.buildSid)('tencent', 'cynosdb', context.stage, clusterId);
|
|
93
95
|
const resourceState = {
|
|
94
96
|
mode: 'managed',
|
|
95
97
|
region: context.region,
|
|
96
98
|
definition,
|
|
97
|
-
instances: [buildTdsqlcInstanceFromProvider(clusterInfo,
|
|
99
|
+
instances: [buildTdsqlcInstanceFromProvider(clusterInfo, sid)],
|
|
98
100
|
lastUpdated: new Date().toISOString(),
|
|
99
101
|
metadata: {
|
|
100
102
|
clusterName: database.name,
|
|
@@ -121,12 +123,12 @@ const updateDatabaseResource = async (context, database, clusterId, state) => {
|
|
|
121
123
|
throw new Error(`Failed to refresh state for cluster: ${clusterId}`);
|
|
122
124
|
}
|
|
123
125
|
const definition = (0, tdsqlcTypes_1.extractTdsqlcDefinition)(config);
|
|
124
|
-
const
|
|
126
|
+
const sid = (0, common_1.buildSid)('tencent', 'cynosdb', context.stage, clusterId);
|
|
125
127
|
const resourceState = {
|
|
126
128
|
mode: 'managed',
|
|
127
129
|
region: context.region,
|
|
128
130
|
definition,
|
|
129
|
-
instances: [buildTdsqlcInstanceFromProvider(clusterInfo,
|
|
131
|
+
instances: [buildTdsqlcInstanceFromProvider(clusterInfo, sid)],
|
|
130
132
|
lastUpdated: new Date().toISOString(),
|
|
131
133
|
metadata: {
|
|
132
134
|
clusterName: database.name,
|
|
@@ -140,7 +142,22 @@ const updateDatabaseResource = async (context, database, clusterId, state) => {
|
|
|
140
142
|
exports.updateDatabaseResource = updateDatabaseResource;
|
|
141
143
|
const deleteDatabaseResource = async (context, clusterId, logicalId, state) => {
|
|
142
144
|
const client = (0, tencentClient_1.createTencentClient)(context);
|
|
143
|
-
|
|
145
|
+
try {
|
|
146
|
+
await client.tdsqlc.deleteCluster(clusterId);
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
const errorCode = err?.code;
|
|
150
|
+
const errorMessage = err?.message ?? '';
|
|
151
|
+
if (errorCode === 'ResourceNotFound.ClusterNotFound' ||
|
|
152
|
+
errorCode === 'ResourceNotFound' ||
|
|
153
|
+
errorMessage.includes('not found') ||
|
|
154
|
+
errorMessage.includes('NotFound')) {
|
|
155
|
+
logger_1.logger.warn(`TDSQL-C cluster ${clusterId} not found in provider, skipping deletion`);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
throw err;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
144
161
|
return (0, stateManager_1.removeResource)(state, logicalId);
|
|
145
162
|
};
|
|
146
163
|
exports.deleteDatabaseResource = deleteDatabaseResource;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CURRENT_STATE_VERSION = exports.ResourceTypeEnum = void 0;
|
|
3
|
+
exports.PartialResourceError = exports.CURRENT_STATE_VERSION = exports.ResourceTypeEnum = void 0;
|
|
4
4
|
var ResourceTypeEnum;
|
|
5
5
|
(function (ResourceTypeEnum) {
|
|
6
6
|
ResourceTypeEnum["SCF_FUNCTION"] = "SCF_FUNCTION";
|
|
@@ -16,4 +16,13 @@ var ResourceTypeEnum;
|
|
|
16
16
|
ResourceTypeEnum["ALIYUN_ES_SERVERLESS"] = "ALIYUN_ES_SERVERLESS";
|
|
17
17
|
ResourceTypeEnum["ALIYUN_TABLESTORE_TABLE"] = "ALIYUN_TABLESTORE_TABLE";
|
|
18
18
|
})(ResourceTypeEnum || (exports.ResourceTypeEnum = ResourceTypeEnum = {}));
|
|
19
|
-
exports.CURRENT_STATE_VERSION = '
|
|
19
|
+
exports.CURRENT_STATE_VERSION = '3.0';
|
|
20
|
+
class PartialResourceError extends Error {
|
|
21
|
+
constructor(updatedState, cause) {
|
|
22
|
+
super(`Partial resource creation failed: ${cause.message}`);
|
|
23
|
+
this.name = 'PartialResourceError';
|
|
24
|
+
this.updatedState = updatedState;
|
|
25
|
+
this.cause = cause;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.PartialResourceError = PartialResourceError;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.functionSchema = void 0;
|
|
4
4
|
const templateRefSchema_1 = require("./templateRefSchema");
|
|
5
|
+
const securityGroupRulePattern = '^[A-Za-z]+:\\d{1,3}(?:\\.\\d{1,3}){3}\\/\\d{1,2}:(?:ALL|\\d{1,5}(?:\\/\\d{1,5})?)$';
|
|
5
6
|
exports.functionSchema = {
|
|
6
7
|
$id: 'https://serverlessinsight.geekfun.club/schemas/functionschema.json',
|
|
7
8
|
type: 'object',
|
|
@@ -87,8 +88,14 @@ exports.functionSchema = {
|
|
|
87
88
|
type: 'object',
|
|
88
89
|
properties: {
|
|
89
90
|
name: { type: 'string' },
|
|
90
|
-
ingress: {
|
|
91
|
-
|
|
91
|
+
ingress: {
|
|
92
|
+
type: 'array',
|
|
93
|
+
items: { type: 'string', pattern: securityGroupRulePattern },
|
|
94
|
+
},
|
|
95
|
+
egress: {
|
|
96
|
+
type: 'array',
|
|
97
|
+
items: { type: 'string', pattern: securityGroupRulePattern },
|
|
98
|
+
},
|
|
92
99
|
},
|
|
93
100
|
required: ['name', 'ingress'],
|
|
94
101
|
additionalProperties: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/forceUnlock.ts","../src/commands/index.ts","../src/commands/local.ts","../src/commands/plan.ts","../src/commands/template.ts","../src/commands/validate.ts","../src/common/base64.ts","../src/common/constants.ts","../src/common/context.ts","../src/common/credentials.ts","../src/common/fileUtils.ts","../src/common/getVersion.ts","../src/common/hashUtils.ts","../src/common/iacHelper.ts","../src/common/imsClient.ts","../src/common/index.ts","../src/common/lockManager.ts","../src/common/logger.ts","../src/common/providerEnum.ts","../src/common/requestHelper.ts","../src/common/runtimeMapper.ts","../src/common/scfClient.ts","../src/common/stateManager.ts","../src/common/aliyunClient/apigwOperations.ts","../src/common/aliyunClient/dnsOperations.ts","../src/common/aliyunClient/ecsOperations.ts","../src/common/aliyunClient/esOperations.ts","../src/common/aliyunClient/fc3Operations.ts","../src/common/aliyunClient/index.ts","../src/common/aliyunClient/nasOperations.ts","../src/common/aliyunClient/ossOperations.ts","../src/common/aliyunClient/ramOperations.ts","../src/common/aliyunClient/rdsOperations.ts","../src/common/aliyunClient/slsOperations.ts","../src/common/aliyunClient/tablestoreOperations.ts","../src/common/aliyunClient/types.ts","../src/common/dependencyGraph/graph.ts","../src/common/dependencyGraph/index.ts","../src/common/dependencyGraph/types.ts","../src/common/stateBackend/cosStateBackend.ts","../src/common/stateBackend/index.ts","../src/common/stateBackend/localStateBackend.ts","../src/common/stateBackend/ossStateBackend.ts","../src/common/stateBackend/types.ts","../src/common/tencentClient/cosOperations.ts","../src/common/tencentClient/esOperations.ts","../src/common/tencentClient/index.ts","../src/common/tencentClient/scfOperations.ts","../src/common/tencentClient/tdsqlcOperations.ts","../src/common/tencentClient/types.ts","../src/lang/en.ts","../src/lang/index.ts","../src/lang/zh-CN.ts","../src/parser/bucketParser.ts","../src/parser/databaseParser.ts","../src/parser/eventParser.ts","../src/parser/functionParser.ts","../src/parser/index.ts","../src/parser/parseUtils.ts","../src/parser/tableParser.ts","../src/parser/tagParser.ts","../src/stack/bucketTypes.ts","../src/stack/deploy.ts","../src/stack/index.ts","../src/stack/aliyunStack/apigwExecutor.ts","../src/stack/aliyunStack/apigwPlanner.ts","../src/stack/aliyunStack/apigwResource.ts","../src/stack/aliyunStack/apigwTypes.ts","../src/stack/aliyunStack/databaseExecutor.ts","../src/stack/aliyunStack/databasePlanner.ts","../src/stack/aliyunStack/databaseResource.ts","../src/stack/aliyunStack/deployer.ts","../src/stack/aliyunStack/destroyer.ts","../src/stack/aliyunStack/esServerlessTypes.ts","../src/stack/aliyunStack/fc3Executor.ts","../src/stack/aliyunStack/fc3Planner.ts","../src/stack/aliyunStack/fc3Resource.ts","../src/stack/aliyunStack/fc3Types.ts","../src/stack/aliyunStack/index.ts","../src/stack/aliyunStack/ossExecutor.ts","../src/stack/aliyunStack/ossPlanner.ts","../src/stack/aliyunStack/ossResource.ts","../src/stack/aliyunStack/ossTypes.ts","../src/stack/aliyunStack/planner.ts","../src/stack/aliyunStack/rdsTypes.ts","../src/stack/aliyunStack/tablestoreExecutor.ts","../src/stack/aliyunStack/tablestorePlanner.ts","../src/stack/aliyunStack/tablestoreResource.ts","../src/stack/aliyunStack/tablestoreTypes.ts","../src/stack/localStack/aliyunFc.ts","../src/stack/localStack/bucket.ts","../src/stack/localStack/event.ts","../src/stack/localStack/function.ts","../src/stack/localStack/functionRunner.ts","../src/stack/localStack/index.ts","../src/stack/localStack/localServer.ts","../src/stack/localStack/utils.ts","../src/stack/rfsStack/function.ts","../src/stack/rfsStack/index.ts","../src/stack/scfStack/cosExecutor.ts","../src/stack/scfStack/cosPlanner.ts","../src/stack/scfStack/cosResource.ts","../src/stack/scfStack/cosTypes.ts","../src/stack/scfStack/deployer.ts","../src/stack/scfStack/destroyer.ts","../src/stack/scfStack/esServerlessExecutor.ts","../src/stack/scfStack/esServerlessPlanner.ts","../src/stack/scfStack/esServerlessResource.ts","../src/stack/scfStack/esServerlessTypes.ts","../src/stack/scfStack/index.ts","../src/stack/scfStack/planner.ts","../src/stack/scfStack/scfExecutor.ts","../src/stack/scfStack/scfPlanner.ts","../src/stack/scfStack/scfResource.ts","../src/stack/scfStack/scfTypes.ts","../src/stack/scfStack/tdsqlcExecutor.ts","../src/stack/scfStack/tdsqlcPlanner.ts","../src/stack/scfStack/tdsqlcResource.ts","../src/stack/scfStack/tdsqlcTypes.ts","../src/types/assets.ts","../src/types/index.ts","../src/types/tablestore.d.ts","../src/types/domains/backend.ts","../src/types/domains/bucket.ts","../src/types/domains/context.ts","../src/types/domains/database.ts","../src/types/domains/event.ts","../src/types/domains/function.ts","../src/types/domains/lock.ts","../src/types/domains/provider.ts","../src/types/domains/resolvable.ts","../src/types/domains/state.ts","../src/types/domains/table.ts","../src/types/domains/tag.ts","../src/types/domains/vars.ts","../src/types/localStack/index.ts","../src/validator/bucketSchema.ts","../src/validator/databaseSchema.ts","../src/validator/eventSchema.ts","../src/validator/functionSchema.ts","../src/validator/iacSchema.ts","../src/validator/index.ts","../src/validator/rootSchema.ts","../src/validator/tableschema.ts","../src/validator/templateRefSchema.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/forceUnlock.ts","../src/commands/index.ts","../src/commands/local.ts","../src/commands/plan.ts","../src/commands/template.ts","../src/commands/validate.ts","../src/common/base64.ts","../src/common/constants.ts","../src/common/context.ts","../src/common/credentials.ts","../src/common/fileUtils.ts","../src/common/getVersion.ts","../src/common/hashUtils.ts","../src/common/iacHelper.ts","../src/common/imsClient.ts","../src/common/index.ts","../src/common/lockManager.ts","../src/common/logger.ts","../src/common/providerEnum.ts","../src/common/requestHelper.ts","../src/common/runtimeMapper.ts","../src/common/scfClient.ts","../src/common/sidUtils.ts","../src/common/stateManager.ts","../src/common/aliyunClient/apigwOperations.ts","../src/common/aliyunClient/dnsOperations.ts","../src/common/aliyunClient/ecsOperations.ts","../src/common/aliyunClient/esOperations.ts","../src/common/aliyunClient/fc3Operations.ts","../src/common/aliyunClient/index.ts","../src/common/aliyunClient/nasOperations.ts","../src/common/aliyunClient/ossOperations.ts","../src/common/aliyunClient/ramOperations.ts","../src/common/aliyunClient/rdsOperations.ts","../src/common/aliyunClient/slsOperations.ts","../src/common/aliyunClient/tablestoreOperations.ts","../src/common/aliyunClient/types.ts","../src/common/dependencyGraph/graph.ts","../src/common/dependencyGraph/index.ts","../src/common/dependencyGraph/types.ts","../src/common/stateBackend/cosStateBackend.ts","../src/common/stateBackend/index.ts","../src/common/stateBackend/localStateBackend.ts","../src/common/stateBackend/ossStateBackend.ts","../src/common/stateBackend/types.ts","../src/common/tencentClient/cosOperations.ts","../src/common/tencentClient/esOperations.ts","../src/common/tencentClient/index.ts","../src/common/tencentClient/scfOperations.ts","../src/common/tencentClient/tdsqlcOperations.ts","../src/common/tencentClient/types.ts","../src/lang/en.ts","../src/lang/index.ts","../src/lang/zh-CN.ts","../src/parser/bucketParser.ts","../src/parser/databaseParser.ts","../src/parser/eventParser.ts","../src/parser/functionParser.ts","../src/parser/index.ts","../src/parser/parseUtils.ts","../src/parser/tableParser.ts","../src/parser/tagParser.ts","../src/stack/bucketTypes.ts","../src/stack/deploy.ts","../src/stack/index.ts","../src/stack/aliyunStack/apigwExecutor.ts","../src/stack/aliyunStack/apigwPlanner.ts","../src/stack/aliyunStack/apigwResource.ts","../src/stack/aliyunStack/apigwTypes.ts","../src/stack/aliyunStack/databaseExecutor.ts","../src/stack/aliyunStack/databasePlanner.ts","../src/stack/aliyunStack/databaseResource.ts","../src/stack/aliyunStack/deployer.ts","../src/stack/aliyunStack/destroyer.ts","../src/stack/aliyunStack/esServerlessTypes.ts","../src/stack/aliyunStack/fc3Executor.ts","../src/stack/aliyunStack/fc3Planner.ts","../src/stack/aliyunStack/fc3Resource.ts","../src/stack/aliyunStack/fc3Types.ts","../src/stack/aliyunStack/index.ts","../src/stack/aliyunStack/ossExecutor.ts","../src/stack/aliyunStack/ossPlanner.ts","../src/stack/aliyunStack/ossResource.ts","../src/stack/aliyunStack/ossTypes.ts","../src/stack/aliyunStack/planner.ts","../src/stack/aliyunStack/rdsTypes.ts","../src/stack/aliyunStack/tablestoreExecutor.ts","../src/stack/aliyunStack/tablestorePlanner.ts","../src/stack/aliyunStack/tablestoreResource.ts","../src/stack/aliyunStack/tablestoreTypes.ts","../src/stack/localStack/aliyunFc.ts","../src/stack/localStack/bucket.ts","../src/stack/localStack/event.ts","../src/stack/localStack/function.ts","../src/stack/localStack/functionRunner.ts","../src/stack/localStack/index.ts","../src/stack/localStack/localServer.ts","../src/stack/localStack/utils.ts","../src/stack/rfsStack/function.ts","../src/stack/rfsStack/index.ts","../src/stack/scfStack/cosExecutor.ts","../src/stack/scfStack/cosPlanner.ts","../src/stack/scfStack/cosResource.ts","../src/stack/scfStack/cosTypes.ts","../src/stack/scfStack/deployer.ts","../src/stack/scfStack/destroyer.ts","../src/stack/scfStack/esServerlessExecutor.ts","../src/stack/scfStack/esServerlessPlanner.ts","../src/stack/scfStack/esServerlessResource.ts","../src/stack/scfStack/esServerlessTypes.ts","../src/stack/scfStack/index.ts","../src/stack/scfStack/planner.ts","../src/stack/scfStack/scfExecutor.ts","../src/stack/scfStack/scfPlanner.ts","../src/stack/scfStack/scfResource.ts","../src/stack/scfStack/scfTypes.ts","../src/stack/scfStack/tdsqlcExecutor.ts","../src/stack/scfStack/tdsqlcPlanner.ts","../src/stack/scfStack/tdsqlcResource.ts","../src/stack/scfStack/tdsqlcTypes.ts","../src/types/assets.ts","../src/types/index.ts","../src/types/tablestore.d.ts","../src/types/domains/backend.ts","../src/types/domains/bucket.ts","../src/types/domains/context.ts","../src/types/domains/database.ts","../src/types/domains/event.ts","../src/types/domains/function.ts","../src/types/domains/lock.ts","../src/types/domains/provider.ts","../src/types/domains/resolvable.ts","../src/types/domains/state.ts","../src/types/domains/table.ts","../src/types/domains/tag.ts","../src/types/domains/vars.ts","../src/types/localStack/index.ts","../src/validator/bucketSchema.ts","../src/validator/databaseSchema.ts","../src/validator/eventSchema.ts","../src/validator/functionSchema.ts","../src/validator/iacSchema.ts","../src/validator/index.ts","../src/validator/rootSchema.ts","../src/validator/tableschema.ts","../src/validator/templateRefSchema.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
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",
|