@geek-fun/serverlessinsight 0.9.0 → 0.9.2
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/.serverlessinsight/state-cdn-flow-app-cdn-flow-service.json.backup +1 -1
- package/.serverlessinsight/state-iam-test-app-iam-test-service.json.backup +2 -2
- package/.serverlessinsight/state-insight-poc-app-insight-poc-tencent.json.backup +2 -2
- package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +3 -3
- package/.serverlessinsight/state-insight-poc-deploy-app-insight-poc-deploy.json.backup +4 -4
- package/.serverlessinsight/state-insight-poc-destroy-app-insight-poc-destroy.json.backup +1 -1
- package/.serverlessinsight/state-insight-poc-timer-app-insight-poc-timer.json.backup +109 -0
- package/.serverlessinsight/state-insight-volc-app-insight-volc.json.backup +2 -2
- package/.serverlessinsight/state-insight-volc-nested-app-insight-volc-nested.json.backup +3 -3
- package/.serverlessinsight/state-nested-drift-app-nested-drift-service.json.backup +2 -2
- package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +3 -3
- package/CHANGELOG.md +17 -0
- package/README.md +78 -2
- package/README.zh-CN.md +69 -2
- package/codecov +0 -0
- package/codecov.SHA256SUM +1 -0
- package/codecov.SHA256SUM.sig +16 -0
- package/dist/package.json +2 -2
- package/dist/src/commands/deploy.js +9 -3
- package/dist/src/commands/destroy.js +8 -2
- package/dist/src/commands/forceUnlock.js +5 -5
- package/dist/src/commands/index.js +173 -85
- package/dist/src/commands/login.js +12 -1
- package/dist/src/commands/migrate.js +287 -0
- package/dist/src/commands/plan.js +28 -2
- package/dist/src/commands/schema.js +24 -0
- package/dist/src/commands/show.js +99 -33
- package/dist/src/commands/validate.js +34 -2
- package/dist/src/common/aliyunClient/apigwOperations.js +4 -4
- package/dist/src/common/aliyunClient/ecsOperations.js +22 -13
- package/dist/src/common/aliyunClient/fc3Operations.js +39 -4
- package/dist/src/common/aliyunClient/nasOperations.js +4 -3
- package/dist/src/common/aliyunClient/ossOperations.js +52 -8
- package/dist/src/common/aliyunClient/slsOperations.js +3 -2
- package/dist/src/common/aliyunClient/tablestoreOperations.js +22 -11
- package/dist/src/common/apiClient.js +22 -5
- package/dist/src/common/constants.js +7 -1
- package/dist/src/common/context.js +5 -4
- package/dist/src/common/jsonOutput.js +77 -0
- package/dist/src/common/lockManager.js +1 -1
- package/dist/src/common/logger.js +6 -3
- package/dist/src/common/migrationMarker.js +34 -0
- package/dist/src/common/noColor.js +9 -0
- package/dist/src/common/planFormatter.js +12 -6
- package/dist/src/common/runtimeMapper.js +7 -3
- package/dist/src/common/siCron.js +415 -0
- package/dist/src/common/stateBackend/cosStateBackend.js +1 -1
- package/dist/src/common/stateBackend/index.js +5 -2
- package/dist/src/common/stateBackend/localStateBackend.js +8 -2
- package/dist/src/common/stateBackend/ossStateBackend.js +1 -1
- package/dist/src/common/stateBackend/remoteStateBackend.js +19 -2
- package/dist/src/common/stateBackend/saasStateBackend.js +88 -9
- package/dist/src/common/stateManager.js +56 -5
- package/dist/src/common/tencentClient/cosOperations.js +1 -1
- package/dist/src/common/tencentClient/scfOperations.js +4 -1
- package/dist/src/common/volcengineClient/apigwOperations.js +2 -2
- package/dist/src/common/volcengineClient/index.js +6 -2
- package/dist/src/common/volcengineClient/vefaasOperations.js +48 -3
- package/dist/src/lang/en.js +254 -1
- package/dist/src/lang/index.js +36 -1
- package/dist/src/lang/zh-CN.js +253 -1
- package/dist/src/parser/functionParser.js +47 -1
- package/dist/src/parser/index.js +1 -1
- package/dist/src/stack/aliyunStack/apigwExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/apigwResource.js +22 -10
- package/dist/src/stack/aliyunStack/databaseExecutor.js +5 -5
- package/dist/src/stack/aliyunStack/databasePlanner.js +2 -2
- package/dist/src/stack/aliyunStack/databaseResource.js +18 -10
- package/dist/src/stack/aliyunStack/esServerlessTypes.js +2 -1
- package/dist/src/stack/aliyunStack/fc3Executor.js +2 -2
- package/dist/src/stack/aliyunStack/fc3Planner.js +26 -0
- package/dist/src/stack/aliyunStack/fc3Resource.js +190 -13
- package/dist/src/stack/aliyunStack/ossExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/ossResource.js +5 -1
- package/dist/src/stack/aliyunStack/rdsTypes.js +5 -1
- package/dist/src/stack/aliyunStack/tablestoreExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/tablestoreResource.js +3 -3
- package/dist/src/stack/aliyunStack/tablestoreTypes.js +3 -2
- package/dist/src/stack/deploy.js +2 -3
- package/dist/src/stack/localStack/event.js +2 -13
- package/dist/src/stack/localStack/function.js +2 -13
- package/dist/src/stack/localStack/functionRunner.js +5 -4
- package/dist/src/stack/localStack/index.js +8 -1
- package/dist/src/stack/localStack/timer.js +162 -0
- package/dist/src/stack/localStack/utils.js +19 -1
- package/dist/src/stack/scfStack/cosExecutor.js +2 -2
- package/dist/src/stack/scfStack/cosResource.js +2 -2
- package/dist/src/stack/scfStack/esServerlessExecutor.js +5 -5
- package/dist/src/stack/scfStack/esServerlessResource.js +7 -3
- package/dist/src/stack/scfStack/esServerlessTypes.js +2 -1
- package/dist/src/stack/scfStack/scfExecutor.js +2 -2
- package/dist/src/stack/scfStack/scfPlanner.js +52 -18
- package/dist/src/stack/scfStack/scfResource.js +202 -12
- package/dist/src/stack/scfStack/tdsqlcExecutor.js +5 -5
- package/dist/src/stack/scfStack/tdsqlcResource.js +7 -3
- package/dist/src/stack/volcengineStack/apigwExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/apigwResource.js +7 -4
- package/dist/src/stack/volcengineStack/tosExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/tosResource.js +1 -1
- package/dist/src/stack/volcengineStack/vefaasExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/vefaasPlanner.js +49 -0
- package/dist/src/stack/volcengineStack/vefaasResource.js +221 -4
- package/dist/src/validator/functionSchema.js +25 -2
- package/dist/src/validator/iacSchema.js +2 -1
- package/dist/src/validator/index.js +4 -1
- package/dist/src/validator/rootSchema.js +77 -19
- package/dist/src/validator/schemaExport.js +60 -0
- package/dist/src/validator/semanticValidation.js +79 -0
- package/dist/src/validator/templateRefSchema.js +9 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/samples/aliyun-poc-timer.yml +39 -0
package/dist/src/lang/en.js
CHANGED
|
@@ -49,6 +49,10 @@ exports.en = {
|
|
|
49
49
|
LOCAL_GATEWAY_ERROR: 'Local gateway error',
|
|
50
50
|
ERROR_STOPPING_LOCAL_SERVER: 'Error stopping localServer',
|
|
51
51
|
RUN_LOCAL_STARTING: 'run-local starting: stage={{stage}} debug={{debug}} watch={{watch}}',
|
|
52
|
+
LOCAL_TIMER_SCHEDULED: "Local timer '{{triggerName}}' scheduled for function '{{functionName}}' (cron: {{cron}}, UTC)",
|
|
53
|
+
LOCAL_TIMER_FIRED: "Local timer '{{triggerName}}' firing function '{{functionName}}'...",
|
|
54
|
+
LOCAL_TIMER_DISABLED: "Local timer '{{triggerName}}' is disabled (enable: false), skipping schedule",
|
|
55
|
+
LOCAL_TIMER_INVALID_CRON: "Local timer '{{triggerName}}' has invalid cron '{{cron}}', skipping schedule",
|
|
52
56
|
// Function execution
|
|
53
57
|
FUNCTION_REQUEST_RECEIVED: 'Function request received by local server -> {{method}} {{identifier}} ',
|
|
54
58
|
INVOKING_WORKER_WITH_EVENT_TYPE: 'Invoking worker with event type: {{eventType}} and context',
|
|
@@ -326,7 +330,10 @@ exports.en = {
|
|
|
326
330
|
'After DNS CNAME is configured, register {{domain}} in OSS console: ' +
|
|
327
331
|
'https://oss.console.aliyun.com/bucket/oss-{{region}}/{{bucket}}/domain/cname',
|
|
328
332
|
OSS_BUCKET_CNAME_BOUND: 'Bound custom domain to bucket: {{domain}}',
|
|
329
|
-
OSS_BUCKET_CNAME_EXISTS: 'Custom domain already bound to bucket: {{domain}}',
|
|
333
|
+
OSS_BUCKET_CNAME_EXISTS: 'Custom domain already bound to bucket (verified via ListCname): {{domain}}',
|
|
334
|
+
OSS_BUCKET_CNAME_CONFLICT: 'Failed to bind custom domain {{domain}} to bucket {{bucketName}}: the domain is already ' +
|
|
335
|
+
'bound to another bucket or used as an image-processing domain ({{error}}). ' +
|
|
336
|
+
'Remove the conflicting binding before retrying.',
|
|
330
337
|
OSS_BUCKET_CNAME_UNBOUND: 'Unbound custom domain from bucket: {{domain}}',
|
|
331
338
|
OSS_BUCKET_CNAME_BIND_FAILED: 'Failed to bind bucket CNAME: {{error}}',
|
|
332
339
|
OSS_BUCKET_CNAME_UNBIND_FAILED: 'Failed to unbind bucket CNAME: {{error}}',
|
|
@@ -807,12 +814,55 @@ exports.en = {
|
|
|
807
814
|
SAAS_BACKEND_LOCK_CHECK: 'Checking deployment lock status...',
|
|
808
815
|
SAAS_BACKEND_NO_CREDENTIALS: 'SaaS state requires Console login.\nRun `si login`, or:\n- Set SI_API_KEY environment variable\n- Use --si-api-key flag\n- Configure a local or bucket backend in serverlessinsight.yml',
|
|
809
816
|
SAAS_BACKEND_CONSOLE_UNREACHABLE: 'Unable to reach Console. Deploy requires Console connectivity.',
|
|
817
|
+
SAAS_ORG_MISMATCH: 'The org "{{declared}}" declared in your YAML does not match the org "{{actual}}" of the current API key.\nVerify your credentials (run `si login` again) or fix the org declaration in the YAML. Nothing was written.',
|
|
818
|
+
SAAS_ORG_FROM_CREDENTIALS: 'Target org: {{orgName}} (from credentials; declare a top-level `org` in the YAML to pin it explicitly)',
|
|
819
|
+
SAAS_STATE_ORG_MISMATCH: 'The org recorded in state ({{stateOrgId}}) does not match the org of the current credentials ({{keyOrgId}}) — either the wrong API key is in use, or the organization was deleted and recreated under the same name.\nVerify your credentials (`si login`) or the organization state before retrying; nothing was written.',
|
|
810
820
|
// API error messages
|
|
811
821
|
API_ERROR_401: 'API key is invalid or expired. Run `si login` to update.',
|
|
812
822
|
API_ERROR_403: 'Access forbidden. Contact your administrator.',
|
|
823
|
+
API_ERROR_404: 'Not found. If you expected existing state, check the app/service/stage names.',
|
|
813
824
|
API_ERROR_409: 'State conflict: {{message}}',
|
|
814
825
|
API_ERROR_NETWORK: 'Network error: {{message}}. Check your connection.',
|
|
815
826
|
API_ERROR_UNKNOWN: 'API error ({{status}}): {{message}}',
|
|
827
|
+
// ===== `si migrate` — legacy state → Console (docs/state-migration-saas.md) =====
|
|
828
|
+
CMD_MIGRATE_DESC: 'Migrate a local/bucket state to the Console (one-time; run AFTER upgrading every writer CLI)',
|
|
829
|
+
OPT_FORCE: 'Import as a new version even when the target stage already has Console state',
|
|
830
|
+
OPT_NO_MARKER: 'Skip writing the migration marker into the legacy state (NOT recommended: the legacy path stays writable until cutover)',
|
|
831
|
+
OPT_DRY_RUN: 'Show the migration mapping and impact without writing anything',
|
|
832
|
+
OPT_ROLLBACK: 'Clear the migration marker from the legacy state (explicit undo)',
|
|
833
|
+
MIGRATE_NO_BACKEND_SOURCE: 'No legacy state to migrate: this stack has no backend.state_manager block (it already uses the Console by default), or it is explicitly SAAS.',
|
|
834
|
+
MIGRATE_NEED_CREDENTIALS: 'Console credentials required. Run `si login` first, or pass --si-api-key.',
|
|
835
|
+
MIGRATE_PREFLIGHT_OK: 'Console identity OK: org {{orgName}} ({{orgId}})',
|
|
836
|
+
MIGRATE_WRITER_CONFIRMATION: 'Have ALL writers already upgraded to this CLI version (every CI image and teammate machine)? The marker is invisible to older CLIs. Confirm to continue (y/N)',
|
|
837
|
+
MIGRATE_CONFIRMATION: 'Proceed with the migration above? (y/N)',
|
|
838
|
+
MIGRATE_DRY_RUN_NOTICE: 'Dry run — nothing was written (no Console upload, no marker).',
|
|
839
|
+
MIGRATE_TARGETS_HEADER: 'Migration targets (org: {{orgName}}) — existing targets are mapped by name, the rest will be auto-created:',
|
|
840
|
+
MIGRATE_TARGET_APP_EXISTS: ' app "{{app}}" → exists, mapped by name ({{appId}})',
|
|
841
|
+
MIGRATE_TARGET_APP_CREATE: ' app "{{app}}" → will be auto-created',
|
|
842
|
+
MIGRATE_TARGET_SERVICE_EXISTS: ' service "{{service}}" → exists, mapped by name ({{serviceId}}, provider {{provider}})',
|
|
843
|
+
MIGRATE_TARGET_SERVICE_CREATE: ' service "{{service}}" → will be auto-created (provider {{provider}})',
|
|
844
|
+
MIGRATE_TARGET_STAGE_NEW: ' stage {{stage}}: {{count}} resource(s) → stage will be registered, import as v1',
|
|
845
|
+
MIGRATE_TARGET_STAGE_EMPTY: ' stage {{stage}}: {{count}} resource(s) → import as v1',
|
|
846
|
+
MIGRATE_TARGET_STAGE_EXISTS: ' stage {{stage}}: {{count}} resource(s) → Console already has v{{version}}; --force imports as a new version, otherwise this stage fails',
|
|
847
|
+
MIGRATE_TARGETS_HINT: 'Targets are matched by name. To control the destination (members, naming, …), pre-create the app/service in the Console first — si migrate maps onto them instead of creating new ones.',
|
|
848
|
+
MIGRATE_PROVIDER_MISMATCH_TARGET: 'Service "{{service}}" already exists with provider "{{existingProvider}}", but the YAML declares "{{ymlProvider}}" — importing {{ymlProvider}} state into it is not supported.',
|
|
849
|
+
MIGRATE_NOTHING_TO_MIGRATE: 'The legacy state has no deployed resources to migrate.',
|
|
850
|
+
MIGRATE_STAGE_NOT_FOUND: 'Stage "{{stage}}" does not exist in the legacy state.',
|
|
851
|
+
MIGRATE_PROVIDER_MISMATCH: 'Provider mismatch: state says "{{stateProvider}}" but YAML says "{{ymlProvider}}".',
|
|
852
|
+
MIGRATE_ALREADY_MARKED: 'Legacy state already carries the migration marker — continuing (re-upload is idempotent).',
|
|
853
|
+
MIGRATE_UPLOADING: 'Uploading stage {{stage}} to Console...',
|
|
854
|
+
MIGRATE_UPLOADED: ' ✓ stage {{stage}} → version {{version}}{{deduped}} (app {{appId}}, service {{serviceId}})',
|
|
855
|
+
MIGRATE_UPLOADED_DEDUPLICATED: ' (unchanged, deduplicated)',
|
|
856
|
+
MIGRATE_VERIFY_FAILED: 'Read-back verification FAILED for stage {{stage}} — the migration marker was NOT written. Compare the Console state version with your legacy state, then re-run `si migrate`.',
|
|
857
|
+
MIGRATE_CONFLICT: 'The target stage already has Console state. Re-run with --force to adopt it as a new imported version (history is kept).',
|
|
858
|
+
MIGRATE_MARKER_WRITTEN: 'Migration marker written: the legacy state is now read-only (managedBy=saas).',
|
|
859
|
+
MIGRATE_MARKER_SKIPPED: 'WARNING: --no-marker was set. The legacy backend stays writable until cutover — complete the YAML cutover immediately.',
|
|
860
|
+
MIGRATE_ROLLBACK_NO_MARKER: 'No migration marker found on the legacy state — nothing to roll back.',
|
|
861
|
+
MIGRATE_ROLLBACK_DONE: 'Migration marker cleared. The legacy backend is writable again.',
|
|
862
|
+
MIGRATE_ROLLBACK_DONE_HINT: 'If you already removed the backend.state_manager block from your YAML, restore it before deploying via the legacy backend.',
|
|
863
|
+
MIGRATE_CUTOVER_STEPS: 'Cutover checklist:\n 1. Remove the backend.state_manager block from serverlessinsight.yml, add a top-level org declaration (org: <slug> — see your org settings in Console), and merge\n 2. Run `si plan` — it MUST report no changes (that is the proof of a lossless migration)\n 3. Resume deploys; the Console now owns the deployment timeline',
|
|
864
|
+
MIGRATION_MARKER_REFUSED: 'This state has been migrated to the ServerlessInsight Console (managedBy=saas) and the legacy backend is closed for changes.\n • To continue with the Console: remove the backend.state_manager block from your YAML, declare a top-level org: <slug>, then deploy again.\n • To deliberately use the legacy backend: run `si migrate --rollback` to clear the marker.',
|
|
865
|
+
MIGRATION_MARKER_WARN: 'This state has been migrated to the Console (managedBy=saas) — the copy shown here is read-only and may be stale. Do not deploy from this backend.',
|
|
816
866
|
// HTTP trigger messages
|
|
817
867
|
HTTP_TRIGGER_AUTH_TYPE_REQUIRED: "HTTP trigger '{{functionName}}' requires 'auth_type' (public or iam)",
|
|
818
868
|
CREATING_HTTP_TRIGGER: "Creating HTTP trigger '{{triggerName}}' for function '{{functionName}}'...",
|
|
@@ -830,4 +880,207 @@ exports.en = {
|
|
|
830
880
|
EVENT_FLUSH_FAILED: 'Failed to flush deployment events for {{deploymentId}} ({{count}} events): {{error}}',
|
|
831
881
|
EVENT_REPLAY_FAILED: 'Failed to replay event queue file {{file}}: {{error}}',
|
|
832
882
|
INVALID_HTTP_TRIGGER_AUTH_TYPE: "Invalid HTTP trigger auth_type '{{authType}}'; must be 'public' or 'iam'",
|
|
883
|
+
// Timer trigger messages (issue #258)
|
|
884
|
+
TIMER_TRIGGER_NAME_REQUIRED: "Timer trigger on function '{{functionName}}' requires 'name'",
|
|
885
|
+
TIMER_TRIGGER_CRON_REQUIRED: "Timer trigger '{{name}}' requires 'cron'",
|
|
886
|
+
TIMER_TRIGGER_DUPLICATE_NAME: "Duplicate timer trigger name '{{name}}' on function '{{functionName}}'",
|
|
887
|
+
TIMER_TRIGGER_LIMIT_EXCEEDED: "Function '{{functionName}}' has {{count}} timer triggers; provider {{provider}} allows at most {{max}}",
|
|
888
|
+
SEMANTIC_TIMER_CRON_INVALID: "Timer trigger '{{name}}' on function '{{functionName}}' has invalid cron '{{cron}}': {{reason}}",
|
|
889
|
+
TIMER_TRIGGER_NOT_SUPPORTED_PROVIDER: "Timer triggers are not supported for provider '{{provider}}'",
|
|
890
|
+
TIMER_TRIGGER_PAYLOAD_NOT_SUPPORTED: "Timer trigger '{{name}}' on provider {{provider}} does not support 'payload'",
|
|
891
|
+
CREATING_TIMER_TRIGGER: "Creating timer trigger '{{triggerName}}' for function '{{functionName}}'...",
|
|
892
|
+
TIMER_TRIGGER_CREATED: "Timer trigger '{{triggerName}}' created for function '{{functionName}}'",
|
|
893
|
+
UPDATING_TIMER_TRIGGER: "Recreating timer trigger '{{triggerName}}' for function '{{functionName}}'...",
|
|
894
|
+
DELETING_TIMER_TRIGGER: "Deleting timer trigger '{{triggerName}}' for function '{{functionName}}'...",
|
|
895
|
+
TIMER_TRIGGER_DELETED: "Timer trigger '{{triggerName}}' deleted",
|
|
896
|
+
TIMER_TRIGGER_NOT_FOUND: "Timer trigger '{{triggerName}}' not found in provider, skipping delete",
|
|
897
|
+
TIMER_TRIGGER_ALREADY_ATTACHED: "Timer trigger '{{triggerName}}' is already attached to function '{{functionName}}', skipping create",
|
|
898
|
+
PLAN_DRIFT_TIMER_TRIGGER: 'Timer triggers changed in the cloud',
|
|
899
|
+
PLAN_TIMER_TRIGGER_PROBE_FAILED: "Failed to probe timer triggers for function '{{functionName}}': {{error}}",
|
|
900
|
+
// si-cron messages (issue #258)
|
|
901
|
+
SI_CRON_EMPTY: 'si-cron expression is empty',
|
|
902
|
+
SI_CRON_WRONG_FIELD_COUNT: 'expects 5 fields (minute hour day month weekday), 6 fields with a seconds prefix, or @every <duration>; got {{count}}',
|
|
903
|
+
SI_CRON_FIELD_INVALID: "field '{{field}}' has invalid value '{{value}}'",
|
|
904
|
+
SI_CRON_FIELD_EMPTY: "field '{{field}}' is empty",
|
|
905
|
+
SI_CRON_FIELD_RANGE: "field '{{field}}' value '{{value}}' out of range {{min}}-{{max}}",
|
|
906
|
+
SI_CRON_STEP_INVALID: "field '{{field}}' has invalid step '{{step}}'",
|
|
907
|
+
SI_CRON_RANGE_DESCENDING: "field '{{field}}' has descending range '{{range}}'",
|
|
908
|
+
SI_CRON_EVERY_INVALID: "'@every {{duration}}' is not a valid duration; use forms like '30s', '5m', '1h', '1d'",
|
|
909
|
+
SI_CRON_EVERY_NOT_EXPRESSIBLE: 'this @every interval cannot be expressed as a {{dialect}} cron; use durations that divide evenly (15s, 30s, 1m, 5m, 15m, 30m, 1h, 2h, 6h, 12h, 1d)',
|
|
910
|
+
SI_CRON_SHIFT_UNSUPPORTED: "cron '{{cron}}' cannot be shifted to UTC+8 without changing which dates fire; avoid day-of-month/day-of-week schedules with UTC hours >= 16 that cross a month boundary",
|
|
911
|
+
SI_CRON_SECONDS_UNSUPPORTED: "cron '{{cron}}' has non-zero seconds which a 5-field crontab provider does not support",
|
|
912
|
+
// Nested live-repair failures (issue #234 executor reconciles)
|
|
913
|
+
NESTED_REPAIR_FAILED: "Failed to repair nested resource '{{resource}}': {{error}}",
|
|
914
|
+
// ===== Issue #251: previously hardcoded messages (now i18n) =====
|
|
915
|
+
UNSUPPORTED_PROVIDER: 'Unsupported provider: {{provider}}',
|
|
916
|
+
FORCE_UNLOCK_NO_LOCATION_MODE: 'Not supported in no-location mode',
|
|
917
|
+
SHOW_LOADING_STATE: 'Loading state for app: {{app}}, service: {{service}}, stage: {{stage}}...',
|
|
918
|
+
SHOW_SAAS_BACKEND_FALLBACK: 'SaaS backend unavailable: {{error}}. Using local state.',
|
|
919
|
+
SHOW_REMOTE_BACKEND_FALLBACK: 'Failed to load state from remote backend: {{error}}. Using local state.',
|
|
920
|
+
SHOW_NO_RESOURCES: 'No resources found in state.',
|
|
921
|
+
SHOW_STATE_LOCATION: 'State location: {{stateLocation}}',
|
|
922
|
+
SHOW_BACKEND_REMOTE: 'Backend: Remote',
|
|
923
|
+
SHOW_BACKEND_SAAS: 'Console (SaaS state)',
|
|
924
|
+
SHOW_DEPLOY_HINT: 'To deploy resources, run: si deploy',
|
|
925
|
+
SHOW_HEADER_DEPLOYED: 'DEPLOYED RESOURCES',
|
|
926
|
+
SHOW_CATEGORY_HEADER: '📦 {{label}}',
|
|
927
|
+
SHOW_HEADER_SUMMARY: 'SUMMARY',
|
|
928
|
+
SHOW_SUMMARY_PROVIDER: ' Provider: {{value}}',
|
|
929
|
+
SHOW_SUMMARY_APP: ' App: {{value}}',
|
|
930
|
+
SHOW_SUMMARY_SERVICE: ' Service: {{value}}',
|
|
931
|
+
SHOW_SUMMARY_STAGE: ' Stage: {{value}}',
|
|
932
|
+
SHOW_SUMMARY_RESOURCES: ' Resources: {{value}}',
|
|
933
|
+
SHOW_SUMMARY_LAST_UPDATED: ' Last Updated: {{value}}',
|
|
934
|
+
SHOW_LOCKED_BY: 'Lock Status: LOCKED by {{user}}',
|
|
935
|
+
SHOW_UNLOCKED: 'Lock Status: UNLOCKED',
|
|
936
|
+
APIGW_CHECKING_DNS_STATUS: 'Checking DNS record status...',
|
|
937
|
+
APIGW_GROUP_CREATE_NO_ID: 'Failed to create API Gateway group: no groupId returned',
|
|
938
|
+
APIGW_API_CREATE_NO_ID: 'Failed to create API: no apiId returned',
|
|
939
|
+
APIGW_GROUP_NO_SUBDOMAIN: 'API group {{groupName}} has no subDomain — cannot configure domain binding',
|
|
940
|
+
SG_INVALID_RULE_FORMAT: 'Invalid security group rule format: {{rule}}',
|
|
941
|
+
SG_CREATE_FAILED: 'Failed to create security group',
|
|
942
|
+
SG_SKIP_INVALID_INGRESS: 'Skipping invalid ingress rule: {{rule}}. {{error}}',
|
|
943
|
+
SG_INGRESS_ALREADY_EXISTS: 'Ingress rule already exists, skipping: {{rule}}',
|
|
944
|
+
SG_ADD_INGRESS_FAILED: 'Failed to add ingress rule: {{rule}}. {{error}}',
|
|
945
|
+
SG_SKIP_INVALID_EGRESS: 'Skipping invalid egress rule: {{rule}}. {{error}}',
|
|
946
|
+
SG_EGRESS_ALREADY_EXISTS: 'Egress rule already exists, skipping: {{rule}}',
|
|
947
|
+
SG_ADD_EGRESS_FAILED: 'Failed to add egress rule: {{rule}}. {{error}}',
|
|
948
|
+
SG_AUTHORIZE_RULE_FAILED: 'Failed to authorize {{ruleType}} rule for {{target}}: {{error}}',
|
|
949
|
+
SG_REVOKE_RULE_FAILED: 'Failed to revoke {{ruleType}} rule for {{target}}: {{error}}',
|
|
950
|
+
SG_GET_INGRESS_FAILED: 'Failed to get ingress rules: {{error}}',
|
|
951
|
+
SG_GET_EGRESS_FAILED: 'Failed to get egress rules: {{error}}',
|
|
952
|
+
FC3_FUNCTION_FAILED_STATE: 'FC3 function {{functionName}} is in Failed state (reason: {{reason}})',
|
|
953
|
+
FC3_TIMEOUT_ACTIVE: 'Timed out waiting for FC3 function {{functionName}} to become Active',
|
|
954
|
+
FC3_TIMEOUT_DELETED: 'Timed out waiting for FC3 function {{functionName}} to be deleted',
|
|
955
|
+
NAS_CREATE_FS_FAILED: 'Failed to create NAS file system',
|
|
956
|
+
NAS_CREATE_MOUNT_TARGET_FAILED: 'Failed to create NAS mount target',
|
|
957
|
+
NAS_LIST_MOUNT_TARGETS_FAILED: 'Failed to list mount targets: {{error}}',
|
|
958
|
+
DNS_OPERATION_ERROR: 'DNS error: {{error}}',
|
|
959
|
+
SLS_WAITING_PROJECT: 'Waiting for SLS project {{projectName}} to be ready (current status: {{status}})',
|
|
960
|
+
SLS_WAITING_LOGSTORE: 'Waiting for SLS logstore {{projectName}}/{{logstoreName}} to be ready...',
|
|
961
|
+
OTS_WAITING_TABLE: 'Waiting for table {{tableName}} to be ready... (attempt {{attempt}}/{{maxAttempts}})',
|
|
962
|
+
OTS_TABLE_READY: 'Table {{tableName}} is ready',
|
|
963
|
+
OTS_TABLE_TIMEOUT: 'Timeout waiting for table {{tableName}} to be ready',
|
|
964
|
+
OTS_CREATE_TABLE_FAILED: 'Failed to create table {{tableName}}: {{error}}',
|
|
965
|
+
OTS_TABLE_CREATED: 'Successfully created table {{tableName}}',
|
|
966
|
+
OTS_DESCRIBE_TABLE_FAILED: 'Failed to describe table {{tableName}}: {{error}}',
|
|
967
|
+
OTS_UPDATE_TABLE_FAILED: 'Failed to update table {{tableName}}: {{error}}',
|
|
968
|
+
OTS_TABLE_UPDATED: 'Successfully updated table {{tableName}}',
|
|
969
|
+
OTS_TABLE_ALREADY_DELETED: 'Table {{tableName}} already deleted or does not exist',
|
|
970
|
+
OTS_DELETE_TABLE_FAILED: 'Failed to delete table {{tableName}}: {{error}}',
|
|
971
|
+
OTS_TABLE_DELETED: 'Successfully deleted table {{tableName}}',
|
|
972
|
+
CONTEXT_NO_IAC_FILE: 'No IaC file found. Tried: {{attemptedList}}',
|
|
973
|
+
CONTEXT_NOT_FOUND: 'No context found',
|
|
974
|
+
CONTEXT_IAC_REQUIRES_CONTEXT: 'Context must be set before setting IAC',
|
|
975
|
+
RUNTIME_UNSUPPORTED_STANDARD: 'Unsupported standard runtime: {{standardRuntime}}',
|
|
976
|
+
SAAS_BACKEND_SET_STAGE_FIRST: 'SaaS state backend: call loadState() first to set stage',
|
|
977
|
+
SAAS_BACKEND_NO_DEPLOYMENT: 'SaaS state backend: no deployment available, call loadState() first',
|
|
978
|
+
SCF_RESOLVE_UIN_FAILED: 'Failed to resolve Tencent Cloud account Uin for resource tagging',
|
|
979
|
+
VOLC_APIGW_CREATE_FAILED: 'API Gateway {{gatewayId}} creation failed{{reason}}',
|
|
980
|
+
VOLC_APIGW_DISAPPEARED: 'API Gateway {{gatewayId}} disappeared while waiting for Running',
|
|
981
|
+
VEFAAS_RELEASE_FAILED: 'veFaaS function {{functionId}} release failed',
|
|
982
|
+
VEFAAS_TIMEOUT_DELETED: 'Timed out waiting for veFaaS function {{functionId}} to be deleted',
|
|
983
|
+
VEFAAS_CREATE_NO_ID: 'CreateFunction did not return a function Id for {{functionName}}',
|
|
984
|
+
IAC_FILE_NOT_FOUND: 'File does not exist at path: {{path}}',
|
|
985
|
+
RESOURCE_EVENT_NOT_FOUND: 'Event not found for logical ID: {{logicalId}}',
|
|
986
|
+
APIGW_GROUP_OWNED_REUSE: 'API group {{groupName}} found and owned by this stack, reusing',
|
|
987
|
+
APIGW_GROUP_ADOPT_REFUSED: 'API group {{groupName}} already exists but is not owned by this stack (missing {{tag}} tag). Refusing to adopt — resolve manually.',
|
|
988
|
+
APIGW_GROUP_CONFLICT_ADOPT: 'API group {{groupName}} exists after create conflict and carries ownership tag ({{tag}}), adopting idempotently',
|
|
989
|
+
APIGW_GROUP_INFO_AFTER_CREATE_FAILED: 'Failed to get API group info after creation: {{error}}',
|
|
990
|
+
APIGW_GROUP_NO_SUBDOMAIN_CDN: 'API Gateway group {{groupName}} has no subDomain for CDN origin',
|
|
991
|
+
APIGW_GROUP_INFO_AFTER_UPDATE_FAILED: 'Failed to get API group info after update: {{error}}',
|
|
992
|
+
APIGW_DOMAIN_UNCHANGED_SKIP: 'Domain configuration unchanged and previously bound, skipping DNS verification',
|
|
993
|
+
RESOURCE_DATABASE_NOT_FOUND: 'Database not found for logical ID: {{logicalId}}',
|
|
994
|
+
EXECUTOR_STATE_NOT_FOUND: 'State not found for {{logicalId}}',
|
|
995
|
+
RESOURCE_INSTANCE_ID_NOT_FOUND: 'Instance ID not found in state for {{logicalId}}',
|
|
996
|
+
DATABASE_TYPE_UNSUPPORTED: 'Unsupported database type: {{type}}',
|
|
997
|
+
RESOURCE_OWNERSHIP_TAG_ADOPT: '{{resourceType}}ES app {{name}} exists and carries ownership tag ({{tag}}), adopting idempotently',
|
|
998
|
+
REFRESH_STATE_ES_APP: 'Failed to refresh state for ES app: {{appId}}',
|
|
999
|
+
REFRESH_STATE_RDS_INSTANCE: 'Failed to refresh state for RDS instance: {{instanceId}}',
|
|
1000
|
+
RESOURCE_TYPE_UNSUPPORTED: 'Unsupported resource type: {{type}}',
|
|
1001
|
+
ES_DB_TYPE_VERSION_UNSUPPORTED: 'Unsupported ES database type/version: {{type}}-{{version}}',
|
|
1002
|
+
RESOURCE_FUNCTION_NOT_FOUND: 'Function not found for logical ID: {{logicalId}}',
|
|
1003
|
+
FC3_UPLOADING_CODE: 'Code package {{zipPath}} is {{size}}MB, uploading to OSS bucket {{bucketName}}',
|
|
1004
|
+
FC3_HTTP_TRIGGER_DEPENDENT_CLEANUP: "HTTP trigger '{{triggerName}}' should be deleted before reaching dependent resource cleanup",
|
|
1005
|
+
FC3_CREATE_RECOVERABLE_RECONCILE: 'Create function returned recoverable error for {{functionName}}, reconciling with provider state: {{error}}',
|
|
1006
|
+
FC3_FAILED_AFTER_CREATE: 'FC3 function {{functionName}} is in Failed state after create (reason: {{reason}})',
|
|
1007
|
+
FC3_FOUND_AFTER_CREATE_RECONCILE: 'Function {{functionName}} found after create error reconciliation, continuing deployment flow',
|
|
1008
|
+
FC3_FOUND_AFTER_DELAYED_RECONCILE: 'Function {{functionName}} found after delayed reconciliation, continuing deployment flow',
|
|
1009
|
+
REFRESH_STATE_FUNCTION: 'Failed to refresh state for function: {{name}}',
|
|
1010
|
+
RESOURCE_BUCKET_NOT_FOUND: 'Bucket not found for logical ID: {{logicalId}}',
|
|
1011
|
+
RDS_DB_TYPE_VERSION_UNSUPPORTED: 'Unsupported RDS database type/version: {{type}}-{{version}}',
|
|
1012
|
+
RESOURCE_TABLE_NOT_FOUND: 'Table not found for logical ID: {{logicalId}}',
|
|
1013
|
+
REFRESH_STATE_TABLE: 'Failed to refresh state for table: {{tableName}}',
|
|
1014
|
+
OTS_TABLE_MISSING_SKIP_DELETE: 'Table {{tableName}} in instance {{instanceId}} not found in provider, skipping deletion',
|
|
1015
|
+
OTS_TABLE_TYPE_UNSUPPORTED: 'Unsupported table type: {{type}}',
|
|
1016
|
+
OTS_ATTRIBUTE_NOT_FOUND: 'Attribute not found for key: {{key}}',
|
|
1017
|
+
LOCAL_HANDLER_NOT_FOUND: 'Handler "{{handlerMethod}}" not found or is not a function in {{handlerPath}}',
|
|
1018
|
+
LOCAL_EXECUTION_TIMEOUT: 'Function execution timed out after {{timeoutMs}}ms',
|
|
1019
|
+
LOCAL_PORT_CLOSED: 'Port closed before receiving response',
|
|
1020
|
+
LOCAL_WORKER_EXITED: 'Worker stopped with exit code {{code}}',
|
|
1021
|
+
REFRESH_STATE_BUCKET: 'Failed to refresh state for bucket: {{name}}',
|
|
1022
|
+
RESOURCE_SPACE_ID_NOT_FOUND: 'Space ID not found in state for {{logicalId}}',
|
|
1023
|
+
REFRESH_STATE_ES_SPACE: 'Failed to refresh state for ES space: {{spaceId}}',
|
|
1024
|
+
SCF_HTTP_TRIGGER_ALREADY_ATTACHED: 'HTTP trigger {{triggerName}} already attached to {{functionName}}, skipping creation',
|
|
1025
|
+
SCF_HTTP_TRIGGER_ALREADY_EXISTS: 'HTTP trigger {{triggerName}} already exists on {{functionName}}, continuing: {{error}}',
|
|
1026
|
+
SCF_HANDLER_IMMUTABLE: 'Handler is immutable in Tencent SCF and cannot be changed on update ({{oldHandler}} -> {{newHandler}}). Delete and recreate the function instead.',
|
|
1027
|
+
SCF_RUNTIME_IMMUTABLE: 'Runtime is immutable in Tencent SCF and cannot be changed on update ({{oldRuntime}} -> {{newRuntime}}). Delete and recreate the function instead.',
|
|
1028
|
+
RESOURCE_CLUSTER_ID_NOT_FOUND: 'Cluster ID not found in state for {{logicalId}}',
|
|
1029
|
+
REFRESH_STATE_CLUSTER: 'Failed to refresh state for cluster: {{clusterId}}',
|
|
1030
|
+
VOLC_BACKEND_FUNCTION_ID_UNRESOLVED: 'Cannot resolve veFaaS function Id for backend {{backend}} (functions.{{functionKey}} has no functionId in state). Deploy the function first.',
|
|
1031
|
+
VOLC_APIGW_NETWORK_REQUIRED: 'events.{{eventKey}}: network (vpc_id + subnet_ids) is required to create the API Gateway instance — add it to the event config',
|
|
1032
|
+
VOLC_APIGW_ADOPT_REFUSED: 'API Gateway {{gatewayName}} already exists but is not owned by this stack (missing {{tag}} tag). Refusing to adopt — resolve manually.',
|
|
1033
|
+
VOLC_APIGW_CREATE_OR_REUSE_FAILED: 'Failed to create or reuse an API Gateway instance',
|
|
1034
|
+
VOLC_EXTERNAL_ROLE_SKIP_DELETE: 'Skipping deletion of external IAM role: {{roleName}} (managed externally)',
|
|
1035
|
+
CONFIRMATION_STDIN_NOT_TTY: 'Interactive confirmation required but stdin is not a TTY. Use --auto-approve (-y) to skip confirmation in non-interactive environments.',
|
|
1036
|
+
RUNTIME_NOT_SUPPORTED_FOR_PROVIDER: 'Runtime {{runtime}} is not supported for provider {{provider}}. Supported providers for this runtime: {{supportedProviders}}',
|
|
1037
|
+
VOLC_API_FAILED: 'Volcengine {{service}} failed: {{code}}: {{message}}',
|
|
1038
|
+
VOLC_API_REQUEST_ID: ' (RequestId: {{requestId}})',
|
|
1039
|
+
HUAWEI_DEPLOY_NOT_IMPLEMENTED: 'Huawei deployment is not yet implemented. The provider currently generates HCL templates but does not deploy them. Please use Aliyun or Tencent providers, or contribute Huawei deployment support.',
|
|
1040
|
+
CONTEXT_REGION_DEPRECATED: 'Warning: ROS_REGION_ID environment variable is deprecated. Please use SI_REGION instead.',
|
|
1041
|
+
SHOW_CAT_FUNCTIONS: 'Functions',
|
|
1042
|
+
SHOW_CAT_API_GATEWAY: 'API Gateway',
|
|
1043
|
+
SHOW_CAT_STORAGE: 'Storage',
|
|
1044
|
+
SHOW_CAT_DATABASES: 'Databases',
|
|
1045
|
+
SHOW_CAT_DNS: 'DNS Records',
|
|
1046
|
+
SHOW_CAT_OTHER: 'Other Resources',
|
|
1047
|
+
SHOW_TIME_JUST_NOW: 'just now',
|
|
1048
|
+
SHOW_TIME_DAYS_AGO: '{{count}} day(s) ago',
|
|
1049
|
+
SHOW_TIME_HOURS_AGO: '{{count}} hour(s) ago',
|
|
1050
|
+
SHOW_TIME_MINUTES_AGO: '{{count}} minute(s) ago',
|
|
1051
|
+
// ===== Issue #251: CLI help text (commander) =====
|
|
1052
|
+
CMD_ROOT_DESC: 'CLI for ServerlessInsight',
|
|
1053
|
+
CMD_LOGIN_DESC: 'authenticate with ServerlessInsight Console',
|
|
1054
|
+
CMD_LOGOUT_DESC: 'revoke API key and clear local credentials',
|
|
1055
|
+
CMD_WHOAMI_DESC: 'show current login status',
|
|
1056
|
+
CMD_SHOW_DESC: 'show deployed resources from state',
|
|
1057
|
+
CMD_VALIDATE_DESC: 'validate serverless Iac yaml',
|
|
1058
|
+
CMD_PLAN_DESC: 'generate and show deployment plan',
|
|
1059
|
+
CMD_DIFF_DESC: 'show changes between your config and the live cloud (alias of plan)',
|
|
1060
|
+
CMD_DEPLOY_DESC: 'deploy serverless Iac yaml',
|
|
1061
|
+
CMD_DESTROY_DESC: 'destroy serverless stack',
|
|
1062
|
+
CMD_LOCAL_DESC: 'run Serverless application locally for debugging',
|
|
1063
|
+
CMD_FORCE_UNLOCK_DESC: 'manually remove a stuck lock (use with caution)',
|
|
1064
|
+
OPT_SI_API_KEY_EXISTING: 'authenticate with an existing API key',
|
|
1065
|
+
OPT_FILE: 'specify the yaml file',
|
|
1066
|
+
OPT_FILE_REMOTE_REQUIRED: 'specify the yaml file (required for remote backends)',
|
|
1067
|
+
OPT_STAGE: 'specify the stage',
|
|
1068
|
+
OPT_REGION: 'specify the region',
|
|
1069
|
+
OPT_PROVIDER: 'specify the provider',
|
|
1070
|
+
OPT_ACCESS_KEY_ID: 'specify the AccessKeyId',
|
|
1071
|
+
OPT_ACCESS_KEY_SECRET: 'specify the AccessKeySecret',
|
|
1072
|
+
OPT_SECURITY_TOKEN: 'specify the SecurityToken',
|
|
1073
|
+
OPT_NO_REFRESH: 'skip live cloud probing; diff config against state only (no drift detection)',
|
|
1074
|
+
OPT_SI_API_KEY: 'ServerlessInsight API key (overrides SI_API_KEY env)',
|
|
1075
|
+
OPT_AUTO_APPROVE: 'skip interactive approval of plan before deploying',
|
|
1076
|
+
OPT_PARAMETER: 'override parameters',
|
|
1077
|
+
OPT_DEBUG: 'enable debug mode',
|
|
1078
|
+
OPT_WATCH: 'enable file watch',
|
|
1079
|
+
// ===== Issue #250: agent-friendly CLI surface =====
|
|
1080
|
+
CMD_SCHEMA_DESC: 'export the IaC JSON Schema used for validation (draft-07, self-contained)',
|
|
1081
|
+
OPT_SCHEMA_OUTPUT: 'write the JSON Schema to a file instead of stdout',
|
|
1082
|
+
OPT_JSON: 'output the result as machine-readable JSON to stdout (logs stay on stderr)',
|
|
1083
|
+
OPT_NO_COLOR: 'disable colored output (also honors the NO_COLOR environment variable)',
|
|
1084
|
+
SCHEMA_WRITTEN_TO: 'JSON Schema written to: {{path}}',
|
|
1085
|
+
ERROR_CODE: 'Error code: {{code}}',
|
|
833
1086
|
};
|
package/dist/src/lang/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lang = void 0;
|
|
3
|
+
exports.lang = exports.lookupErrorCode = exports.hasLangKey = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const i18n_1 = require("i18n");
|
|
6
6
|
const en_1 = require("./en");
|
|
@@ -39,3 +39,38 @@ const lang = new i18n_1.I18n({
|
|
|
39
39
|
objectNotation: true,
|
|
40
40
|
});
|
|
41
41
|
exports.lang = lang;
|
|
42
|
+
let templateIndex = null;
|
|
43
|
+
const buildTemplateIndex = () => [...Object.entries(en_1.en), ...Object.entries(zh_CN_1.zhCN)].flatMap(([key, value]) => typeof value === 'string' ? [{ key, segments: value.split(/{{[^}]*}}/g) }] : []);
|
|
44
|
+
const matchTemplate = (message, segments) => {
|
|
45
|
+
if (segments.length === 1) {
|
|
46
|
+
return message === segments[0];
|
|
47
|
+
}
|
|
48
|
+
let rest = message;
|
|
49
|
+
for (let i = 0; i < segments.length; i++) {
|
|
50
|
+
const segment = segments[i];
|
|
51
|
+
if (i === 0) {
|
|
52
|
+
if (!rest.startsWith(segment))
|
|
53
|
+
return false;
|
|
54
|
+
rest = rest.slice(segment.length);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (i === segments.length - 1) {
|
|
58
|
+
return rest.endsWith(segment);
|
|
59
|
+
}
|
|
60
|
+
const at = rest.indexOf(segment);
|
|
61
|
+
if (at < 0)
|
|
62
|
+
return false;
|
|
63
|
+
rest = rest.slice(at + segment.length);
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
};
|
|
67
|
+
const langKeySet = () => new Set(Object.keys({ ...en_1.en, ...zh_CN_1.zhCN }));
|
|
68
|
+
const hasLangKey = (key) => langKeySet().has(key);
|
|
69
|
+
exports.hasLangKey = hasLangKey;
|
|
70
|
+
const lookupErrorCode = (message) => {
|
|
71
|
+
if (!message)
|
|
72
|
+
return undefined;
|
|
73
|
+
templateIndex = templateIndex ?? buildTemplateIndex();
|
|
74
|
+
return templateIndex.find((template) => matchTemplate(message, template.segments))?.key;
|
|
75
|
+
};
|
|
76
|
+
exports.lookupErrorCode = lookupErrorCode;
|