@geek-fun/serverlessinsight 0.9.6 → 0.9.8

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.
Files changed (90) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +68 -0
  3. package/README.md +52 -11
  4. package/README.zh-CN.md +44 -10
  5. package/dist/package.json +2 -1
  6. package/dist/src/commands/deploy.js +3 -1
  7. package/dist/src/commands/destroy.js +3 -1
  8. package/dist/src/commands/forceUnlock.js +2 -2
  9. package/dist/src/commands/index.js +28 -8
  10. package/dist/src/commands/local.js +3 -2
  11. package/dist/src/commands/login.js +120 -37
  12. package/dist/src/commands/logout.js +3 -5
  13. package/dist/src/commands/migrate.js +17 -10
  14. package/dist/src/commands/plan.js +5 -1
  15. package/dist/src/commands/show.js +3 -1
  16. package/dist/src/commands/whoami.js +24 -6
  17. package/dist/src/common/aliyunClient/cdnOperations.js +64 -29
  18. package/dist/src/common/aliyunClient/dnsOperations.js +10 -0
  19. package/dist/src/common/aliyunClient/fc3Operations.js +36 -7
  20. package/dist/src/common/apiClient.js +1 -0
  21. package/dist/src/common/bindingReconcile.js +182 -0
  22. package/dist/src/common/cdnCapabilities.js +80 -0
  23. package/dist/src/common/certUtils.js +44 -5
  24. package/dist/src/common/consoleLines.js +126 -0
  25. package/dist/src/common/constants.js +4 -2
  26. package/dist/src/common/credentialStore.js +136 -39
  27. package/dist/src/common/domainUtils.js +23 -4
  28. package/dist/src/common/functionDefinition.js +4 -1
  29. package/dist/src/common/functionDomainCapabilities.js +28 -0
  30. package/dist/src/common/functionDomainReconcile.js +197 -0
  31. package/dist/src/common/lineContext.js +164 -0
  32. package/dist/src/common/planCapabilities.js +14 -27
  33. package/dist/src/common/planCompare.js +8 -7
  34. package/dist/src/common/planFormatter.js +71 -37
  35. package/dist/src/common/stateBackend/cosStateBackend.js +0 -46
  36. package/dist/src/common/stateBackend/index.js +24 -16
  37. package/dist/src/common/stateBackend/ossStateBackend.js +0 -25
  38. package/dist/src/common/stateBackend/remoteStateBackend.js +5 -22
  39. package/dist/src/common/stateBackend/saasStateBackend.js +46 -53
  40. package/dist/src/common/stateBackend/tosStateBackend.js +100 -0
  41. package/dist/src/common/stateBackend/types.js +0 -9
  42. package/dist/src/common/tencentClient/cdnOperations.js +165 -0
  43. package/dist/src/common/tencentClient/cosOperations.js +18 -2
  44. package/dist/src/common/tencentClient/dnspodOperations.js +12 -0
  45. package/dist/src/common/tencentClient/index.js +16 -0
  46. package/dist/src/common/tencentClient/scfOperations.js +23 -1
  47. package/dist/src/common/tencentClient/sslOperations.js +147 -77
  48. package/dist/src/common/volcengineClient/cdnOperations.js +221 -0
  49. package/dist/src/common/volcengineClient/dnsOperations.js +132 -0
  50. package/dist/src/common/volcengineClient/index.js +28 -0
  51. package/dist/src/common/volcengineClient/tosOperations.js +131 -1
  52. package/dist/src/lang/en.js +89 -12
  53. package/dist/src/lang/zh-CN.js +90 -11
  54. package/dist/src/parser/bucketParser.js +22 -79
  55. package/dist/src/parser/functionParser.js +13 -9
  56. package/dist/src/stack/aliyunStack/apigwResource.js +2 -1
  57. package/dist/src/stack/aliyunStack/fc3Planner.js +32 -12
  58. package/dist/src/stack/aliyunStack/fc3Resource.js +169 -121
  59. package/dist/src/stack/aliyunStack/ossPlanner.js +12 -4
  60. package/dist/src/stack/aliyunStack/ossResource.js +484 -501
  61. package/dist/src/stack/aliyunStack/ossTypes.js +21 -67
  62. package/dist/src/stack/localStack/aliyunFc.js +59 -9
  63. package/dist/src/stack/localStack/bucket.js +75 -28
  64. package/dist/src/stack/localStack/event.js +33 -24
  65. package/dist/src/stack/localStack/httpAdapter.js +1 -13
  66. package/dist/src/stack/localStack/index.js +2 -2
  67. package/dist/src/stack/localStack/localServer.js +85 -7
  68. package/dist/src/stack/scfStack/cosPlanner.js +11 -3
  69. package/dist/src/stack/scfStack/cosResource.js +339 -161
  70. package/dist/src/stack/scfStack/cosTypes.js +25 -34
  71. package/dist/src/stack/scfStack/scfPlanner.js +26 -8
  72. package/dist/src/stack/scfStack/scfResource.js +191 -124
  73. package/dist/src/stack/volcengineStack/tosPlanner.js +13 -1
  74. package/dist/src/stack/volcengineStack/tosResource.js +398 -7
  75. package/dist/src/stack/volcengineStack/tosTypes.js +27 -0
  76. package/dist/src/stack/volcengineStack/vefaasTypes.js +1 -1
  77. package/dist/src/types/domains/state.js +6 -0
  78. package/dist/src/validator/bucketSchema.js +35 -113
  79. package/dist/src/validator/cdnSchema.js +30 -0
  80. package/dist/src/validator/eventSchema.js +2 -20
  81. package/dist/src/validator/functionSchema.js +55 -8
  82. package/dist/src/validator/rootSchema.js +3 -3
  83. package/dist/src/validator/semanticValidation.js +504 -1
  84. package/dist/tsconfig.tsbuildinfo +1 -1
  85. package/package.json +2 -1
  86. package/release-notes.md +82 -6
  87. package/samples/aliyun-poc-api-cdn.yml +1 -1
  88. package/samples/aliyun-poc-bucket-cdn.yml +28 -26
  89. package/samples/aliyun-poc-domain.yml +2 -1
  90. package/samples/volcengine-poc-tos-state.yml +36 -0
@@ -32,12 +32,20 @@ const normalizeDefinitionForDisplay = (definition) => {
32
32
  const removedOssDependents = (bucket, currentState, desiredDefinition) => {
33
33
  if (!currentState)
34
34
  return {};
35
- const domainName = bucket.domain?.domain_name || bucket.website?.domain;
36
- const dnsRemoved = !domainName &&
37
- (currentState.instances ?? []).some((i) => i.type === types_1.ResourceTypeEnum.ALIYUN_OSS_DNS_CNAME);
35
+ const bindingsRemoved = !(bucket.domains?.length ?? 0) &&
36
+ (currentState.instances ?? []).some((i) => i.type === types_1.ResourceTypeEnum.ALIYUN_OSS_DNS_CNAME ||
37
+ i.type === types_1.ResourceTypeEnum.ALIYUN_CDN_DISTRIBUTION ||
38
+ i.type === types_1.ResourceTypeEnum.ALIYUN_CDN_DNS_CNAME);
39
+ const legacyDefinition = currentState.definition;
38
40
  return {
39
41
  ...(0, bucketPolicy_1.removedBucketPolicy)(ossTypes_1.OSS_BUCKET_POLICY_INSTANCE_TYPE, currentState, desiredDefinition),
40
- ...(dnsRemoved ? { domain: currentState.definition.domain ?? null } : {}),
42
+ ...(bindingsRemoved
43
+ ? {
44
+ domains: currentState.definition.domains ?? null,
45
+ // Legacy single-domain state records the binding under `domain`.
46
+ ...(legacyDefinition.domain != null ? { domain: legacyDefinition.domain } : {}),
47
+ }
48
+ : {}),
41
49
  };
42
50
  };
43
51
  const generateBucketPlan = async (context, state, buckets) => {