@geek-fun/serverlessinsight 0.6.13 → 0.6.14

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.6.13",
3
+ "version": "0.6.14",
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",
@@ -60,7 +60,7 @@ const planFunctionDeletion = (logicalId, definition) => ({
60
60
  logicalId,
61
61
  action: 'delete',
62
62
  resourceType: 'ALIYUN_FC3',
63
- changes: { before: definition },
63
+ changes: { before: normalizeDefinitionForComparison(definition) },
64
64
  });
65
65
  const generateFunctionPlan = async (context, state, functions) => {
66
66
  if (!functions || functions.length === 0) {
@@ -95,18 +95,23 @@ const generateFunctionPlan = async (context, state, functions) => {
95
95
  logicalId,
96
96
  action: 'create',
97
97
  resourceType: 'ALIYUN_FC3',
98
- changes: { before: currentState.definition, after: desiredDefinition },
98
+ changes: {
99
+ before: normalizeDefinitionForComparison(currentState.definition),
100
+ after: normalizeDefinitionForComparison(desiredDefinition),
101
+ },
99
102
  drifted: true,
100
103
  };
101
104
  }
102
105
  const currentDefinition = currentState.definition || {};
103
- const definitionChanged = !(0, common_1.attributesEqual)(normalizeDefinitionForComparison(currentDefinition), normalizeDefinitionForComparison(desiredDefinition));
106
+ const normalizedCurrent = normalizeDefinitionForComparison(currentDefinition);
107
+ const normalizedDesired = normalizeDefinitionForComparison(desiredDefinition);
108
+ const definitionChanged = !(0, common_1.attributesEqual)(normalizedCurrent, normalizedDesired);
104
109
  if (definitionChanged) {
105
110
  return {
106
111
  logicalId,
107
112
  action: 'update',
108
113
  resourceType: 'ALIYUN_FC3',
109
- changes: { before: currentDefinition, after: desiredDefinition },
114
+ changes: { before: normalizedCurrent, after: normalizedDesired },
110
115
  drifted: true,
111
116
  };
112
117
  }
@@ -117,7 +122,10 @@ const generateFunctionPlan = async (context, state, functions) => {
117
122
  logicalId,
118
123
  action: 'create',
119
124
  resourceType: 'ALIYUN_FC3',
120
- changes: { before: currentState.definition, after: desiredDefinition },
125
+ changes: {
126
+ before: normalizeDefinitionForComparison(currentState.definition),
127
+ after: normalizeDefinitionForComparison(desiredDefinition),
128
+ },
121
129
  };
122
130
  }
123
131
  }));
@@ -13,8 +13,12 @@ const planBucketDeletion = (logicalId, definition) => ({
13
13
  logicalId,
14
14
  action: 'delete',
15
15
  resourceType: 'ALIYUN_OSS_BUCKET',
16
- changes: { before: definition },
16
+ changes: { before: normalizeDefinitionForDisplay(definition) },
17
17
  });
18
+ const normalizeDefinitionForDisplay = (definition) => {
19
+ const { domainBound: _domainBound, ...rest } = definition;
20
+ return rest;
21
+ };
18
22
  const generateBucketPlan = async (context, state, buckets) => {
19
23
  if (!buckets || buckets.length === 0) {
20
24
  const allStates = (0, stateManager_1.getAllResources)(state);
@@ -55,20 +59,25 @@ const generateBucketPlan = async (context, state, buckets) => {
55
59
  logicalId,
56
60
  action: 'create',
57
61
  resourceType: 'ALIYUN_OSS_BUCKET',
58
- changes: { before: currentState.definition, after: desiredDefinition },
62
+ changes: {
63
+ before: normalizeDefinitionForDisplay(currentState.definition),
64
+ after: desiredDefinition,
65
+ },
59
66
  drifted: true,
60
67
  };
61
68
  }
62
69
  const currentDefinition = currentState.definition || {};
63
- const { domainBound, ...comparableDefinition } = currentDefinition;
64
- const definitionChanged = !(0, hashUtils_1.attributesEqual)(comparableDefinition, desiredDefinition);
70
+ const normalizedCurrent = normalizeDefinitionForDisplay(currentDefinition);
71
+ const normalizedDesired = normalizeDefinitionForDisplay(desiredDefinition);
72
+ const { domainBound } = currentDefinition;
73
+ const definitionChanged = !(0, hashUtils_1.attributesEqual)(normalizedCurrent, normalizedDesired);
65
74
  const domainBindingPending = domainBound === false;
66
75
  if (definitionChanged || domainBindingPending) {
67
76
  return {
68
77
  logicalId,
69
78
  action: 'update',
70
79
  resourceType: 'ALIYUN_OSS_BUCKET',
71
- changes: { before: currentDefinition, after: desiredDefinition },
80
+ changes: { before: normalizedCurrent, after: normalizedDesired },
72
81
  ...(definitionChanged ? { drifted: true } : {}),
73
82
  };
74
83
  }
@@ -79,7 +88,10 @@ const generateBucketPlan = async (context, state, buckets) => {
79
88
  logicalId,
80
89
  action: 'create',
81
90
  resourceType: 'ALIYUN_OSS_BUCKET',
82
- changes: { before: currentState.definition, after: desiredDefinition },
91
+ changes: {
92
+ before: normalizeDefinitionForDisplay(currentState.definition),
93
+ after: desiredDefinition,
94
+ },
83
95
  };
84
96
  }
85
97
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geek-fun/serverlessinsight",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
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",