@treasuredata/tdx 2026.7.5 → 2026.8.0
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/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.d.ts.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.d.ts +8 -0
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/command.js.map +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-always-on-campaign-pull-command.d.ts +16 -0
- package/dist/commands/engage-always-on-campaign-pull-command.d.ts.map +1 -0
- package/dist/commands/engage-always-on-campaign-pull-command.js +1 -0
- package/dist/commands/engage-always-on-campaign-pull-command.js.map +1 -0
- package/dist/commands/engage-always-on-campaign-push-command.d.ts +16 -0
- package/dist/commands/engage-always-on-campaign-push-command.d.ts.map +1 -0
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -0
- package/dist/commands/engage-always-on-campaign-push-command.js.map +1 -0
- package/dist/commands/engage-always-on-campaign-validate-command.d.ts +16 -0
- package/dist/commands/engage-always-on-campaign-validate-command.d.ts.map +1 -0
- package/dist/commands/engage-always-on-campaign-validate-command.js +1 -0
- package/dist/commands/engage-always-on-campaign-validate-command.js.map +1 -0
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/status-command.js.map +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +35 -1
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.d.ts +68 -0
- package/dist/core/site-mismatch.d.ts.map +1 -0
- package/dist/core/site-mismatch.js +1 -0
- package/dist/core/site-mismatch.js.map +1 -0
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +6 -6
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +1 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.d.ts +7 -4
- package/dist/sdk/connection-validator.d.ts.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection-validator.js.map +1 -1
- package/dist/sdk/connection.d.ts +15 -0
- package/dist/sdk/connection.d.ts.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/connection.js.map +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.d.ts +66 -0
- package/dist/sdk/engage/always-on-campaign-pull.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -0
- package/dist/sdk/engage/always-on-campaign-pull.js.map +1 -0
- package/dist/sdk/engage/always-on-campaign-push.d.ts +93 -0
- package/dist/sdk/engage/always-on-campaign-push.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-push.js +1 -0
- package/dist/sdk/engage/always-on-campaign-push.js.map +1 -0
- package/dist/sdk/engage/always-on-campaign-validator.d.ts +18 -0
- package/dist/sdk/engage/always-on-campaign-validator.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -0
- package/dist/sdk/engage/always-on-campaign-validator.js.map +1 -0
- package/dist/sdk/engage/always-on-campaign-yaml.d.ts +62 -0
- package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -0
- package/dist/sdk/engage/always-on-campaign-yaml.js +1 -0
- package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -0
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +125 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.js.map +1 -0
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +8 -8
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +20 -0
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.d.ts +13 -2
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +12 -10
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.d.ts +66 -7
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js.map +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +110 -1
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js.map +1 -1
- package/dist/sdk/segment/validate-files.d.ts +6 -1
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +7 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/engage.d.ts +31 -5
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.d.ts +6 -0
- package/dist/test-utils/factories.d.ts.map +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/factories.js.map +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.d.ts +1 -1
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a203_0x39b2(_0x1e7861,_0x3e24ca){_0x1e7861=_0x1e7861-0x9b;var _0x499596=a203_0x4995();var _0x39b2af=_0x499596[_0x1e7861];return _0x39b2af;}(function(_0x18e61f,_0x423308){var _0x216bcc=a203_0x39b2,_0x209ad1=_0x18e61f();while(!![]){try{var _0x2583d0=-parseInt(_0x216bcc(0xa4))/0x1*(-parseInt(_0x216bcc(0x9c))/0x2)+-parseInt(_0x216bcc(0xa2))/0x3+parseInt(_0x216bcc(0x9f))/0x4*(-parseInt(_0x216bcc(0xa6))/0x5)+parseInt(_0x216bcc(0xa5))/0x6*(parseInt(_0x216bcc(0x9b))/0x7)+parseInt(_0x216bcc(0xa3))/0x8*(parseInt(_0x216bcc(0x9e))/0x9)+parseInt(_0x216bcc(0xa0))/0xa*(parseInt(_0x216bcc(0x9d))/0xb)+parseInt(_0x216bcc(0xa1))/0xc*(parseInt(_0x216bcc(0xa7))/0xd);if(_0x2583d0===_0x423308)break;else _0x209ad1['push'](_0x209ad1['shift']());}catch(_0x483211){_0x209ad1['push'](_0x209ad1['shift']());}}}(a203_0x4995,0x1f467));export*from'./formatters.js';export*from'./format-detector.js';export*from'./tree-formatter.js';export*from'./paginate.js';function a203_0x4995(){var _0x3063ed=['7076ZdfFqk','10820nuccHh','779388gqyVDw','643260ZdikYn','66152Iubxmt','40283Ondhto','6kcXTiU','125ftTewA','13JkWEIR','421813etoXiA','2QDINiN','484cfmFgR','189DVvsDQ'];a203_0x4995=function(){return _0x3063ed;};return a203_0x4995();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x52003e,_0x490e8c){const _0x58811d=a204_0x3e92,_0x257201=_0x52003e();while(!![]){try{const _0x33a90a=-parseInt(_0x58811d(0xd6))/0x1+parseInt(_0x58811d(0xcf))/0x2+-parseInt(_0x58811d(0xcd))/0x3*(parseInt(_0x58811d(0xcc))/0x4)+parseInt(_0x58811d(0xd7))/0x5+-parseInt(_0x58811d(0xd2))/0x6*(-parseInt(_0x58811d(0xce))/0x7)+parseInt(_0x58811d(0xd9))/0x8+parseInt(_0x58811d(0xd5))/0x9*(-parseInt(_0x58811d(0xdb))/0xa);if(_0x33a90a===_0x490e8c)break;else _0x257201['push'](_0x257201['shift']());}catch(_0x1f7d23){_0x257201['push'](_0x257201['shift']());}}}(a204_0x3406,0xf25c9));function a204_0x3406(){const _0x2652f4=['3711788KgoBXk','isArray','data','8966352BBgKHk','push','length','9QkVbcF','1781219eSfSxo','3654465VaQPZg','min','8054856asFYAu','slice','13572410ucuEUs','3827452qwfWwS','3JNEOgm','7DqtGKd'];a204_0x3406=function(){return _0x2652f4;};return a204_0x3406();}function a204_0x3e92(_0x3cbf57,_0x5c964e){_0x3cbf57=_0x3cbf57-0xcc;const _0x3406fa=a204_0x3406();let _0x3e92cc=_0x3406fa[_0x3cbf57];return _0x3e92cc;}export const PAGE_SIZE=0x64;export const MAX_PAGINATION_LIMIT=0x2710;export async function paginate(_0xf2cd14,_0x24d885=MAX_PAGINATION_LIMIT,_0x2ab098=0x0){const _0x1d38a0=a204_0x3e92,_0x170a9b=Math[_0x1d38a0(0xd8)](_0x24d885,MAX_PAGINATION_LIMIT),_0x3ce1ef=[];let _0x4a2a54=_0x2ab098;while(_0x3ce1ef[_0x1d38a0(0xd4)]<_0x170a9b){const _0x4191e5=Math[_0x1d38a0(0xd8)](PAGE_SIZE,_0x170a9b-_0x3ce1ef['length']),_0x6fd139=await _0xf2cd14(_0x4191e5,_0x4a2a54),_0x147975=Array[_0x1d38a0(0xd0)](_0x6fd139[_0x1d38a0(0xd1)])?_0x6fd139['data']:[_0x6fd139[_0x1d38a0(0xd1)]];_0x3ce1ef[_0x1d38a0(0xd3)](..._0x147975);if(_0x147975[_0x1d38a0(0xd4)]<_0x4191e5)break;_0x4a2a54+=_0x4191e5;}return _0x3ce1ef[_0x1d38a0(0xd4)]>_0x170a9b?_0x3ce1ef[_0x1d38a0(0xda)](0x0,_0x170a9b):_0x3ce1ef;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xaaa04d,_0x4355f3){const _0x36651d=a205_0x3391,_0x2031d2=_0xaaa04d();while(!![]){try{const _0x3d0b66=parseInt(_0x36651d(0x1e2))/0x1+-parseInt(_0x36651d(0x20c))/0x2+-parseInt(_0x36651d(0x1fc))/0x3*(parseInt(_0x36651d(0x1db))/0x4)+-parseInt(_0x36651d(0x1ea))/0x5*(-parseInt(_0x36651d(0x203))/0x6)+parseInt(_0x36651d(0x1f6))/0x7*(parseInt(_0x36651d(0x202))/0x8)+-parseInt(_0x36651d(0x20a))/0x9*(-parseInt(_0x36651d(0x208))/0xa)+parseInt(_0x36651d(0x205))/0xb*(-parseInt(_0x36651d(0x1f2))/0xc);if(_0x3d0b66===_0x4355f3)break;else _0x2031d2['push'](_0x2031d2['shift']());}catch(_0x17df52){_0x2031d2['push'](_0x2031d2['shift']());}}}(a205_0x2147,0x6fed3));import{formatRows,hyperlink}from'./formatters.js';import a205_0x17601d from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};function a205_0x3391(_0x46f7bd,_0x3e669e){_0x46f7bd=_0x46f7bd-0x1db;const _0x21470b=a205_0x2147();let _0x33915a=_0x21470b[_0x46f7bd];return _0x33915a;}export function formatTree(_0x5af02f,_0xb024ef={},_0x1ebb65=0x0,_0x62466b=''){const _0x337a0=a205_0x3391,_0x5beb25={...DEFAULT_OPTIONS,..._0xb024ef},_0x33b2f3=[],_0x4cb6a6=[..._0x5af02f][_0x337a0(0x1e6)]((_0x5988b3,_0x3bab73)=>_0x5988b3[_0x337a0(0x1e7)][_0x337a0(0x1fa)](_0x3bab73[_0x337a0(0x1e7)],undefined,{'sensitivity':'base'}));for(let _0xf314c5=0x0;_0xf314c5<_0x4cb6a6[_0x337a0(0x1e9)];_0xf314c5++){const _0x3fc1af=_0x4cb6a6[_0xf314c5],_0x53d028=_0xf314c5===_0x4cb6a6[_0x337a0(0x1e9)]-0x1;let _0x24ce3b='';_0x1ebb65>0x0&&(_0x24ce3b+=_0x62466b);_0x5beb25['showTreeLines']&&_0x1ebb65>0x0&&(_0x24ce3b+=a205_0x17601d['dim'](_0x53d028?'└──\x20':'├──\x20'));if(_0x5beb25[_0x337a0(0x1fb)]){if(_0x3fc1af[_0x337a0(0x1f5)]==='folder')_0x24ce3b+='📁\x20';else _0x3fc1af[_0x337a0(0x1f5)]===_0x337a0(0x1f7)?_0x24ce3b+='🗺️\x20':_0x24ce3b+=_0x337a0(0x1e5);}if(_0x5beb25[_0x337a0(0x1f8)]&&_0x3fc1af[_0x337a0(0x1f5)]===_0x337a0(0x1eb))_0x24ce3b+=hyperlink(_0x3fc1af[_0x337a0(0x1e7)],_0x5beb25[_0x337a0(0x1f8)](_0x3fc1af['id']));else _0x5beb25[_0x337a0(0x209)]&&_0x3fc1af[_0x337a0(0x1f5)]===_0x337a0(0x1f7)?_0x24ce3b+=hyperlink(_0x3fc1af[_0x337a0(0x1e7)],_0x5beb25['getJourneyUrl'](_0x3fc1af['id'])):_0x24ce3b+=_0x3fc1af[_0x337a0(0x1e7)];if(_0x5beb25[_0x337a0(0x1de)]){if(_0x3fc1af[_0x337a0(0x1f5)]===_0x337a0(0x1ed)){const _0x1d48c6=[];_0x3fc1af[_0x337a0(0x1ff)][_0x337a0(0x20b)]&&_0x1d48c6[_0x337a0(0x1dd)](_0x3fc1af[_0x337a0(0x1ff)][_0x337a0(0x20b)]+'\x20segment'+(_0x3fc1af[_0x337a0(0x1ff)][_0x337a0(0x20b)]!==0x1?'s':'')),_0x3fc1af[_0x337a0(0x1ff)]['folderCount']&&_0x1d48c6['push'](_0x3fc1af[_0x337a0(0x1ff)][_0x337a0(0x1f3)]+'\x20folder'+(_0x3fc1af[_0x337a0(0x1ff)]['folderCount']!==0x1?'s':'')),_0x3fc1af[_0x337a0(0x1ff)][_0x337a0(0x1e1)]&&_0x1d48c6[_0x337a0(0x1dd)](_0x3fc1af[_0x337a0(0x1ff)]['journeyCount']+_0x337a0(0x1e0)+(_0x3fc1af[_0x337a0(0x1ff)][_0x337a0(0x1e1)]!==0x1?'s':'')),_0x1d48c6[_0x337a0(0x1e9)]>0x0&&(_0x24ce3b+=a205_0x17601d[_0x337a0(0x1ee)]('\x20('+_0x1d48c6[_0x337a0(0x201)](',\x20')+')'));}else{if(_0x3fc1af[_0x337a0(0x1f5)]==='segment'&&_0x3fc1af['population']!==undefined)_0x24ce3b+=a205_0x17601d[_0x337a0(0x1ee)]('\x20('+formatRows(_0x3fc1af[_0x337a0(0x1dc)])+')');else _0x3fc1af['type']===_0x337a0(0x1f7)&&_0x3fc1af[_0x337a0(0x204)]&&(_0x24ce3b+=a205_0x17601d[_0x337a0(0x1ee)]('\x20'+getJourneyStateIndicator(_0x3fc1af['state'])));}}_0x33b2f3[_0x337a0(0x1dd)](_0x24ce3b);if(_0x3fc1af['children']&&_0x3fc1af[_0x337a0(0x1ec)][_0x337a0(0x1e9)]>0x0){let _0xb1376;if(_0x1ebb65===0x0)_0xb1376='';else _0x5beb25[_0x337a0(0x200)]?_0xb1376=_0x62466b+(_0x53d028?_0x337a0(0x1df):a205_0x17601d[_0x337a0(0x1ee)]('│')+'\x20\x20\x20'):_0xb1376=_0x62466b+_0x5beb25[_0x337a0(0x1f4)];const _0x521c37=formatTree(_0x3fc1af[_0x337a0(0x1ec)],_0x5beb25,_0x1ebb65+0x1,_0xb1376);_0x33b2f3[_0x337a0(0x1dd)](_0x521c37);}}return _0x33b2f3[_0x337a0(0x201)]('\x0a');}export function formatFlatList(_0x7b0ecf,_0x34d410,_0x44301f={},_0xfb85f7=[]){const _0x438987=a205_0x3391,_0x191d5b={...DEFAULT_OPTIONS,..._0x44301f},_0x10750c=[];for(const _0x2887e3 of _0x7b0ecf){_0x10750c[_0x438987(0x1dd)]({'sortKey':_0x2887e3[_0x438987(0x1e7)],'displayName':_0x2887e3[_0x438987(0x1e7)],'icon':_0x191d5b[_0x438987(0x1fb)]?'📁':'','metadata':undefined});}for(const _0x2e8a76 of _0x34d410){const _0x5d1a38=_0x191d5b[_0x438987(0x1de)]&&_0x2e8a76[_0x438987(0x1dc)]!==undefined?a205_0x17601d[_0x438987(0x1ee)]('\x20('+formatRows(_0x2e8a76[_0x438987(0x1dc)])+')'):'',_0x1ffed1=_0x191d5b[_0x438987(0x1f8)]?hyperlink(_0x2e8a76[_0x438987(0x1e7)],_0x191d5b[_0x438987(0x1f8)](_0x2e8a76['id'])):_0x2e8a76[_0x438987(0x1e7)];_0x10750c['push']({'sortKey':_0x2e8a76[_0x438987(0x1e7)],'displayName':_0x1ffed1,'icon':_0x191d5b['showIcons']?'🎯':'','metadata':_0x5d1a38});}for(const _0x191d6c of _0xfb85f7){const _0x16e0ad=getJourneyStateIndicator(_0x191d6c[_0x438987(0x204)]),_0x6bb73e=_0x191d5b[_0x438987(0x1de)]?a205_0x17601d['dim']('\x20'+_0x16e0ad):'',_0x5b5c73=_0x191d5b[_0x438987(0x209)]?hyperlink(_0x191d6c[_0x438987(0x1fe)],_0x191d5b[_0x438987(0x209)](_0x191d6c['id'])):_0x191d6c[_0x438987(0x1fe)];_0x10750c['push']({'sortKey':_0x191d6c['journeyBundleName'],'displayName':_0x5b5c73,'icon':_0x191d5b[_0x438987(0x1fb)]?_0x438987(0x1e8):'','metadata':_0x6bb73e});}_0x10750c['sort']((_0x571489,_0x34f889)=>_0x571489[_0x438987(0x1f9)][_0x438987(0x1fa)](_0x34f889['sortKey'],undefined,{'sensitivity':'base'}));if(_0x10750c[_0x438987(0x1e9)]===0x0)return'(empty)';const _0x1e2497=_0x10750c[_0x438987(0x1fd)](_0x37b825=>{const _0x42d84a=_0x438987,_0x2fbc03=_0x37b825[_0x42d84a(0x20d)]?_0x37b825['icon']+'\x20':'',_0x5c28a3=_0x37b825[_0x42d84a(0x1ff)]||'';return''+_0x2fbc03+_0x37b825[_0x42d84a(0x207)]+_0x5c28a3;});return _0x1e2497[_0x438987(0x201)]('\x0a');}function getJourneyStateIndicator(_0x28d2eb){const _0x3de119=a205_0x3391;switch(_0x28d2eb){case'draft':return _0x3de119(0x1e3);case _0x3de119(0x1e4):return'(running)';case _0x3de119(0x1f0):return _0x3de119(0x206);case _0x3de119(0x1f1):return _0x3de119(0x1ef);default:return'('+_0x28d2eb+')';}}function a205_0x2147(){const _0x467458=['join','8thefQn','3792042ZYIavo','state','22EqwBmq','(paused)','displayName','22870oNkoEf','getJourneyUrl','3222DQkFhZ','segmentCount','272762ukzcZp','icon','37896QPAQbB','population','push','showMetadata','\x20\x20\x20\x20','\x20journey','journeyCount','62343lktpSL','(draft)','launched','🎯\x20','sort','name','🗺️','length','5eTRTkH','segment','children','folder','dim','(completed)','paused','completed','4930356zRSyMV','folderCount','indent','type','4828628dYeAQE','journey','getSegmentUrl','sortKey','localeCompare','showIcons','249QNuYQK','map','journeyBundleName','metadata','showTreeLines'];a205_0x2147=function(){return _0x467458;};return a205_0x2147();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13d426,_0x48eabb){const _0x3effd7=a206_0xcc61,_0x1e39ad=_0x13d426();while(!![]){try{const _0x263712=parseInt(_0x3effd7(0x1bc))/0x1*(parseInt(_0x3effd7(0x1be))/0x2)+-parseInt(_0x3effd7(0x1b7))/0x3+parseInt(_0x3effd7(0x1ba))/0x4*(parseInt(_0x3effd7(0x1c3))/0x5)+-parseInt(_0x3effd7(0x1b4))/0x6*(parseInt(_0x3effd7(0x1bf))/0x7)+-parseInt(_0x3effd7(0x1c2))/0x8+parseInt(_0x3effd7(0x1b5))/0x9+parseInt(_0x3effd7(0x1bb))/0xa;if(_0x263712===_0x48eabb)break;else _0x1e39ad['push'](_0x1e39ad['shift']());}catch(_0x5afc46){_0x1e39ad['push'](_0x1e39ad['shift']());}}}(a206_0xb8e8,0xb2d0e));function a206_0xcc61(_0x1505e0,_0x362c3c){_0x1505e0=_0x1505e0-0x1b4;const _0xb8e852=a206_0xb8e8();let _0xcc612a=_0xb8e852[_0x1505e0];return _0xcc612a;}function a206_0xb8e8(){const _0xae647=['name','join','4268HTJexO','1178780KYMYnc','2stoCAQ','replace','696022KlbfVx','51149SFhfMH','type','children','9371216hJanPJ','2905nqVIGQ','318dxIwsI','12319227sgafYG','length','1534581fmbvaW'];a206_0xb8e8=function(){return _0xae647;};return a206_0xb8e8();}export function globToMatcher(_0x553b49){const _0xa3ce2f=a206_0xcc61,_0x585948=_0x553b49['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0xa3ce2f(0x1bd)](/\*/g,'.*')[_0xa3ce2f(0x1bd)](/\?/g,'.'),_0x4d106e=new RegExp(_0x585948,'i');return _0x5ef672=>_0x4d106e['test'](_0x5ef672);}export function searchTreeByName(_0xb8889,_0x428858){const _0x2afc46=globToMatcher(_0x428858),_0x11d54f=[],_0x2644c8=(_0x430d8b,_0x4904cc)=>{const _0x4e3cc5=a206_0xcc61;for(const _0x35882b of _0x430d8b){const _0x4f8bed=[..._0x4904cc,_0x35882b[_0x4e3cc5(0x1b8)]][_0x4e3cc5(0x1b9)]('/');_0x2afc46(_0x35882b[_0x4e3cc5(0x1b8)])&&_0x11d54f['push']({'type':_0x35882b[_0x4e3cc5(0x1c0)],'id':_0x35882b['id'],'name':_0x35882b[_0x4e3cc5(0x1b8)],'path':_0x4f8bed}),_0x35882b[_0x4e3cc5(0x1c1)]?.[_0x4e3cc5(0x1b6)]&&_0x2644c8(_0x35882b[_0x4e3cc5(0x1c1)],[..._0x4904cc,_0x35882b['name']]);}};return _0x2644c8(_0xb8889,[]),_0x11d54f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a207_0x2551da=a207_0x5993;(function(_0x3ef61f,_0x118788){const _0x551fa8=a207_0x5993,_0x39e6e3=_0x3ef61f();while(!![]){try{const _0x18c5d0=-parseInt(_0x551fa8(0x1b9))/0x1*(-parseInt(_0x551fa8(0x1b6))/0x2)+parseInt(_0x551fa8(0x1ae))/0x3+-parseInt(_0x551fa8(0x1b1))/0x4*(parseInt(_0x551fa8(0x1a8))/0x5)+-parseInt(_0x551fa8(0x1a9))/0x6+-parseInt(_0x551fa8(0x1af))/0x7*(-parseInt(_0x551fa8(0x1a6))/0x8)+-parseInt(_0x551fa8(0x1ab))/0x9+parseInt(_0x551fa8(0x1a2))/0xa;if(_0x18c5d0===_0x118788)break;else _0x39e6e3['push'](_0x39e6e3['shift']());}catch(_0x1388b2){_0x39e6e3['push'](_0x39e6e3['shift']());}}}(a207_0x5bb7,0x3bb96));function a207_0x5bb7(){const _0x5f5939=['1518584ipSYlw','charCodeAt','5ejtlFZ','2865420pLKzUN','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','3911265siXJxv','helpText','trim','1064607zwdOzp','7jmPqpr','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','189172iuHUjv','length','from','error','(empty\x20response)','242446HzFbdw','message','equals','4QqjLrv','split','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','1744940JMNXCl','WORKFLOW_ARCHIVE_CORRUPTED','\x20Server\x20response\x20preview:\x20','subarray'];a207_0x5bb7=function(){return _0x5f5939;};return a207_0x5bb7();}import{SDKError,ErrorCode}from'../errors.js';function a207_0x5993(_0x6e6279,_0x3f9d7d){_0x6e6279=_0x6e6279-0x1a0;const _0x5bb7bb=a207_0x5bb7();let _0x59930d=_0x5bb7bb[_0x6e6279];return _0x59930d;}const GZIP_MAGIC=Buffer[a207_0x2551da(0x1b3)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x1651e0){const _0x2a2a13=a207_0x2551da;if(_0x1651e0['length']<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x1651e0['length'],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0x1651e0[_0x2a2a13(0x1b2)]+_0x2a2a13(0x1aa),'preview':getContentPreview(_0x1651e0),'helpText':_0x2a2a13(0x1b0)}};if(!_0x1651e0[_0x2a2a13(0x1a5)](0x0,0x2)[_0x2a2a13(0x1b8)](GZIP_MAGIC)){const _0x568a3e=getContentPreview(_0x1651e0),_0x5e7667=_0x568a3e?_0x2a2a13(0x1a4)+_0x568a3e:'';return{'isValid':![],'size':_0x1651e0[_0x2a2a13(0x1b2)],'error':{'message':'Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.'+_0x5e7667,'preview':_0x568a3e,'helpText':_0x2a2a13(0x1a1)}};}return{'isValid':!![],'size':_0x1651e0[_0x2a2a13(0x1b2)]};}function getContentPreview(_0x110da0){const _0x575ae0=a207_0x2551da;if(_0x110da0[_0x575ae0(0x1b2)]===0x0)return _0x575ae0(0x1b5);const _0x1acc0a=_0x110da0[_0x575ae0(0x1a5)](0x0,0xc8)['toString']('utf-8'),_0x24c450=_0x1acc0a[_0x575ae0(0x1a0)]('')['filter'](_0x5400f2=>{const _0x3d5cf8=_0x575ae0,_0xeb14fb=_0x5400f2[_0x3d5cf8(0x1a7)](0x0);return _0xeb14fb>=0x20&&_0xeb14fb<0x7f||_0xeb14fb===0xa||_0xeb14fb===0xd||_0xeb14fb===0x9;})[_0x575ae0(0x1b2)],_0x46b752=_0x24c450/_0x1acc0a[_0x575ae0(0x1b2)];if(_0x46b752>0.8){const _0x4d7a7a=_0x1acc0a['slice'](0x0,0x64)[_0x575ae0(0x1ad)]();return _0x4d7a7a['length']<_0x1acc0a['trim']()[_0x575ae0(0x1b2)]?_0x4d7a7a+'...':_0x4d7a7a;}return undefined;}export function throwArchiveValidationError(_0x22c974){const _0x53fe16=a207_0x2551da;if(!_0x22c974['error'])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],'Archive\x20validation\x20failed\x20with\x20unknown\x20error');throw new SDKError(ErrorCode[_0x53fe16(0x1a3)],_0x22c974[_0x53fe16(0x1b4)][_0x53fe16(0x1b7)],undefined,{'helpText':_0x22c974['error'][_0x53fe16(0x1ac)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1eb8da,_0x28af9b){const _0x19a038=a208_0x5206,_0x5b9a0b=_0x1eb8da();while(!![]){try{const _0x53bbad=-parseInt(_0x19a038(0x10c))/0x1*(parseInt(_0x19a038(0x11b))/0x2)+-parseInt(_0x19a038(0x11d))/0x3+-parseInt(_0x19a038(0x113))/0x4*(-parseInt(_0x19a038(0x114))/0x5)+parseInt(_0x19a038(0x11e))/0x6*(-parseInt(_0x19a038(0x121))/0x7)+parseInt(_0x19a038(0x107))/0x8*(parseInt(_0x19a038(0x11f))/0x9)+parseInt(_0x19a038(0x101))/0xa+parseInt(_0x19a038(0x112))/0xb;if(_0x53bbad===_0x28af9b)break;else _0x5b9a0b['push'](_0x5b9a0b['shift']());}catch(_0x412229){_0x5b9a0b['push'](_0x5b9a0b['shift']());}}}(a208_0x2c6a,0xde9ff));import{promises as a208_0x3886a6}from'fs';import a208_0xb2762b from'path';import a208_0x587371 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x46c1e8,_0x3730e6,_0x480bae,_0x5f013d={}){const _0x5075d7=a208_0x5206,{client:_0x35fb86}=_0x46c1e8,_0xa33785=a208_0xb2762b[_0x5075d7(0x119)](_0x3730e6);try{await a208_0x3886a6[_0x5075d7(0x115)](_0xa33785);}catch{throw new Error(_0x5075d7(0x110)+_0x3730e6);}const _0x2b7a31=tryFindWorkflowTdxConfig(_0xa33785),_0x18059e=_0x2b7a31?.['config']['workflow_project'],_0x40908d=_0x5f013d['revision']||new Date()['toISOString']()[_0x5075d7(0x10f)](/[:.]/g,'-');if(!_0x5f013d[_0x5075d7(0x10e)]){const _0x497c69=await a208_0x3886a6[_0x5075d7(0x116)](_0xa33785),_0x3f4720=_0x497c69[_0x5075d7(0x11c)](_0x3b123c=>_0x3b123c[_0x5075d7(0x103)](WORKFLOW_FILE_EXTENSION));if(_0x3f4720[_0x5075d7(0x108)]===0x0)throw new Error(_0x5075d7(0x11a)+WORKFLOW_FILE_EXTENSION+_0x5075d7(0x120)+_0xa33785);}const _0xae02eb=await getProjectFiles(_0xa33785);let _0x3f3050=![],_0x3d021d;try{const _0x3e108b=await _0x35fb86[_0x5075d7(0x102)]({'name_pattern':_0x480bae}),_0xcb5d6d=_0x3e108b[_0x5075d7(0x10a)][_0x5075d7(0x109)](_0x28bd1d=>_0x28bd1d[_0x5075d7(0x117)]===_0x480bae);_0xcb5d6d&&(_0x3f3050=!![],_0x3d021d=_0xcb5d6d['id']);}catch{}return{'sourceDir':_0xa33785,'sourceProjectName':_0x18059e,'newProjectName':_0x480bae,'revision':_0x40908d,'fileCount':_0xae02eb[_0x5075d7(0x108)],'files':_0xae02eb,'targetExists':_0x3f3050,'existingProjectId':_0x3d021d};}export async function executeCloneWorkflow(_0x360dac,_0x1c9398){const _0x2f8c82=a208_0x5206,_0x53b815=await import(_0x2f8c82(0x105)),{client:_0x54fabc}=_0x360dac,_0x1a54c2=await getProjectFiles(_0x1c9398[_0x2f8c82(0x10d)]),_0x18aa69=await a208_0x3886a6['mkdtemp'](a208_0xb2762b[_0x2f8c82(0x122)](a208_0x587371[_0x2f8c82(0x104)](),'tdx-wf-clone-')),_0x5f2e92=a208_0xb2762b['join'](_0x18aa69,_0x2f8c82(0x106));try{await _0x53b815['create']({'file':_0x5f2e92,'gzip':!![],'cwd':_0x1c9398[_0x2f8c82(0x10d)],'portable':!![]},_0x1a54c2);const _0x1dd55b=await _0x54fabc['uploadProjectArchive'](_0x1c9398[_0x2f8c82(0x111)],_0x1c9398[_0x2f8c82(0x100)],_0x5f2e92);return{'sourceDir':_0x1c9398['sourceDir'],'sourceProjectName':_0x1c9398['sourceProjectName'],'newProjectName':_0x1dd55b[_0x2f8c82(0x117)],'newProjectId':_0x1dd55b['id'],'revision':_0x1dd55b[_0x2f8c82(0x100)],'fileCount':_0x1a54c2[_0x2f8c82(0x108)],'files':_0x1a54c2};}finally{await a208_0x3886a6['rm'](_0x18aa69,{'recursive':!![],'force':!![]});}}function a208_0x5206(_0x307aa4,_0x452f61){_0x307aa4=_0x307aa4-0x100;const _0x2c6a63=a208_0x2c6a();let _0x52062d=_0x2c6a63[_0x307aa4];return _0x52062d;}function a208_0x2c6a(){const _0x254ea5=['readdir','name','isDirectory','resolve','No\x20','2ezrmAG','filter','1900005uDPGty','3000258deNYri','9iphAPX','\x20workflow\x20files\x20found\x20in\x20','21dcZaXq','join','revision','7141720OXgWnY','listProjects','endsWith','tmpdir','tar','archive.tar.gz','8715688SXWvZJ','length','find','data','push','843910QZLjGE','sourceDir','skipValidation','replace','Source\x20directory\x20not\x20found:\x20','newProjectName','8165388ZQzNCU','7776SuqiAD','3455lQaxdB','access'];a208_0x2c6a=function(){return _0x254ea5;};return a208_0x2c6a();}async function getProjectFiles(_0xb8c398,_0xb8ad05=''){const _0x47d951=a208_0x5206,_0x3c80be=[],_0x5b7413=await a208_0x3886a6[_0x47d951(0x116)](_0xb8c398,{'withFileTypes':!![]});for(const _0x2faa56 of _0x5b7413){const _0x21799f=_0xb8ad05?a208_0xb2762b[_0x47d951(0x122)](_0xb8ad05,_0x2faa56[_0x47d951(0x117)]):_0x2faa56['name'];if(_0x2faa56[_0x47d951(0x117)]==='tdx.json')continue;if(!shouldIncludeInArchive(_0x2faa56[_0x47d951(0x117)]))continue;if(_0x2faa56[_0x47d951(0x118)]()){const _0x15553b=await getProjectFiles(a208_0xb2762b['join'](_0xb8c398,_0x2faa56['name']),_0x21799f);_0x3c80be[_0x47d951(0x10b)](..._0x15553b);}else _0x3c80be[_0x47d951(0x10b)](_0x21799f);}return _0x3c80be;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a200_0x4abbad=a200_0x39e9;(function(_0x1dc711,_0x2efcc4){const _0x512d0e=a200_0x39e9,_0x1de844=_0x1dc711();while(!![]){try{const _0x18112e=-parseInt(_0x512d0e(0xf3))/0x1*(parseInt(_0x512d0e(0x14e))/0x2)+parseInt(_0x512d0e(0xdb))/0x3+parseInt(_0x512d0e(0x122))/0x4+-parseInt(_0x512d0e(0x107))/0x5+parseInt(_0x512d0e(0x10b))/0x6+parseInt(_0x512d0e(0x115))/0x7*(parseInt(_0x512d0e(0x105))/0x8)+parseInt(_0x512d0e(0xdd))/0x9*(parseInt(_0x512d0e(0x126))/0xa);if(_0x18112e===_0x2efcc4)break;else _0x1de844['push'](_0x1de844['shift']());}catch(_0x14807a){_0x1de844['push'](_0x1de844['shift']());}}}(a200_0x3597,0xd12b7));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x5097e9,_0x5ebe25,_0x327c57=0x64){const _0xca47c7=a200_0x39e9,_0x215892=Math[_0xca47c7(0x118)](_0x5ebe25,MAX_PAGINATION_LIMIT),_0x4c5c89=[];let _0x295fa5;while(_0x4c5c89[_0xca47c7(0xd1)]<_0x215892){const _0x3c180d=await _0x5097e9(_0x327c57,_0x295fa5),_0x3c33d8=_0x3c180d[_0xca47c7(0xf5)]??_0x3c180d['data']['length'];if(_0x3c33d8===0x0)break;_0x4c5c89['push'](..._0x3c180d[_0xca47c7(0x101)]);if(!_0x3c180d['lastId']||_0x3c33d8<_0x327c57)break;_0x295fa5=_0x3c180d[_0xca47c7(0x12d)];}return _0x4c5c89[_0xca47c7(0xd8)](0x0,_0x215892);}function a200_0x39e9(_0x5c3e6,_0x2a1344){_0x5c3e6=_0x5c3e6-0xce;const _0x35971d=a200_0x3597();let _0x39e9eb=_0x35971d[_0x5c3e6];return _0x39e9eb;}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';function a200_0x3597(){const _0x138631=['\x20workflow\x20files\x20found\x20in\x20project\x20directory','slice','kill','retryAttempt','2349282sZFcAR','substring','153momLnf','executeCloneProject','deleteProject','enableSchedule','Project\x20not\x20found:\x20','readdir','listSecrets','parseWorkflowId','Project\x20directory\x20not\x20found:\x20','WORKFLOW_PROJECT_NOT_FOUND','filter','finishedAt','now','map','resolveProjectId','includeRetried','executePushProject','pullProject','setSecret','keys','logs','updatedAt','1147ClmCGU','sessionId','rawCount','workflow','state','INVALID_ARGUMENT','workflowName','rejected','indexOf','NUMERIC_ID_PATTERN','workflows','listSchedules','isDirectory','error','data','fromTask','listProjects','getAttemptTasks','140744pIccpb','toISOString','7095220LlNfMS','startedAt','tasks','downloadProjectArchive','462768NnTvyd','cancelRequested','tar','storeParams','from','endsWith','zlib','replace','.\x20Expected\x20\x22project.workflow\x22','stateParams','133iyXSuM','arrayBuffer','config','min','latest','create','push','retryAttemptName','projectName','revision','startAttempt','isFile','deleteSecret','5836244EkpcSh','status','Invalid\x20workflow\x20format:\x20','toTime','456550FOEFLt','toString','killAttempt','gunzip','getAttempt','extract','listProjectSchedules','lastId','disableSchedule','.tar.gz','getProject','Kill\x20request\x20accepted','isGroup','force','limit','uploadProjectArchive','util','skipValidation','projects','params','parentId','retryParams','sessions','join','run','attempt','listWorkflows','tmpdir','download','find','index','getWorkflow','listAttempts','fullName','success','WORKFLOW_SECRET_SET_FAILED','name','client','project','delete','2012lvrSOp','listLogFiles','sessionUuid','prepareCloneProject','Failed\x20to\x20download\x20log\x20file:\x20','getSchedule','tdx-workflow-push-','getProjectWorkflow','tdx-workflow-','retrySession','retryAt','createdAt','last_id','bind','scheduleFrom','sessionTime','clearScheduleAll','message','Failed\x20to\x20set\x20secret','length','access','mkdir','unlink','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format:\x20','path'];a200_0x3597=function(){return _0x138631;};return a200_0x3597();}import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a200_0x4abbad(0xfc)]=/^\d+$/;[a200_0x4abbad(0x14b)];constructor(_0xb6a9b9){this['client']=new WorkflowApiClient(_0xb6a9b9);}async[a200_0x4abbad(0xeb)](_0x2f2e00){const _0xa30ae=a200_0x4abbad;if(WorkflowSDK['NUMERIC_ID_PATTERN']['test'](_0x2f2e00)){const _0xd9c5b9=await this['client'][_0xa30ae(0x130)](_0x2f2e00);return{'id':_0xd9c5b9['id'],'name':_0xd9c5b9[_0xa30ae(0x14a)]};}const _0x1f1b88=await this[_0xa30ae(0x14b)][_0xa30ae(0x103)]({'name_pattern':_0x2f2e00}),_0x31a375=_0x1f1b88[_0xa30ae(0x101)]['find'](_0x1eddea=>_0x1eddea['name']===_0x2f2e00);if(!_0x31a375)throw new SDKError(ErrorCode[_0xa30ae(0xe6)],_0xa30ae(0xe1)+_0x2f2e00);return{'id':_0x31a375['id'],'name':_0x31a375[_0xa30ae(0x14a)]};}async[a200_0x4abbad(0x138)](_0x5ae456,_0x541080){const _0x50818b=a200_0x4abbad,_0x264abc=_0x541080?.[_0x50818b(0x134)]||MAX_PAGINATION_LIMIT,_0x30e930=await paginateResults((_0x1deced,_0x379859)=>this['client'][_0x50818b(0x103)]({'name_pattern':_0x5ae456,'limit':_0x1deced,'last_id':_0x379859??_0x541080?.[_0x50818b(0x15a)]}),_0x264abc);return _0x30e930[_0x50818b(0xea)](_0x35fe2e=>({..._0x35fe2e,'project_id':_0x35fe2e['id'],'project_name':_0x35fe2e[_0x50818b(0x14a)]}));}async[a200_0x4abbad(0xfd)](_0xfaca32,_0x51a0e1){const _0x751e99=a200_0x4abbad,_0xaba366=_0x51a0e1?.['limit']||MAX_PAGINATION_LIMIT,_0xeb9f09=await paginateResults((_0x48475e,_0x2d1f24)=>this[_0x751e99(0x14b)][_0x751e99(0x140)]({'project_name':_0xfaca32,'limit':_0x48475e,'last_id':_0x2d1f24??_0x51a0e1?.[_0x751e99(0x15a)]}),_0xaba366);return _0xeb9f09[_0x751e99(0xea)](_0x4906af=>({'project_id':_0x4906af[_0x751e99(0x14c)]?.['id'],'project_name':_0x4906af[_0x751e99(0x14c)]?.[_0x751e99(0x14a)],'workflow_id':_0x4906af['id'],'workflow_name':_0x4906af[_0x751e99(0x14a)],'revision':_0x4906af[_0x751e99(0x11e)],'timezone':_0x4906af['timezone'],'config':_0x4906af[_0x751e99(0x117)],'id':_0x4906af['id'],'name':_0x4906af[_0x751e99(0x14a)],'project':_0x4906af[_0x751e99(0x14c)]}));}async[a200_0x4abbad(0x13c)](_0x56b005){const _0x27b41d=a200_0x4abbad;let _0x3e331c;if(_0x56b005?.[_0x27b41d(0x11d)]){let _0x3dab7e,_0x112045=![];while(!_0x112045){const _0xff5958=await this[_0x27b41d(0x14b)][_0x27b41d(0x103)]({'limit':0x64,'last_id':_0x3dab7e}),_0x193677=_0xff5958[_0x27b41d(0x101)][_0x27b41d(0x143)](_0x4d6ab2=>_0x4d6ab2['name']===_0x56b005[_0x27b41d(0x11d)]);if(_0x193677){_0x3e331c=_0x193677['id'],_0x112045=!![];break;}if(!_0xff5958['lastId']||_0xff5958['data'][_0x27b41d(0xd1)]===0x0)break;_0x3dab7e=_0xff5958[_0x27b41d(0x12d)];}if(!_0x3e331c)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],'Project\x20not\x20found:\x20'+_0x56b005[_0x27b41d(0x11d)]);}const _0x118a49=_0x56b005?.[_0x27b41d(0x134)]||0x64,_0x4d67b6=await paginateResults((_0x529e0a,_0x4ef808)=>this['client']['listSessions']({'project_id':_0x3e331c,'project_name':_0x56b005?.['projectName'],'workflow_name':_0x56b005?.[_0x27b41d(0xf9)],'status':_0x56b005?.[_0x27b41d(0x123)],'from_time':_0x56b005?.['fromTime'],'to_time':_0x56b005?.[_0x27b41d(0x125)],'limit':_0x529e0a,'last_id':_0x4ef808??_0x56b005?.['last_id']}),_0x118a49);return _0x4d67b6[_0x27b41d(0xea)](_0x151283=>({'project_id':_0x151283[_0x27b41d(0x14c)]?.['id'],'project_name':_0x151283[_0x27b41d(0x14c)]?.[_0x27b41d(0x14a)],'workflow_id':_0x151283['workflow']?.['id'],'workflow_name':_0x151283['workflow']?.[_0x27b41d(0x14a)],'session_id':_0x151283['id'],'sessionUuid':_0x151283[_0x27b41d(0x150)],'sessionTime':_0x151283[_0x27b41d(0x15d)],'lastAttempt':_0x151283['lastAttempt'],'id':_0x151283['id'],'project':_0x151283['project'],'workflow':_0x151283[_0x27b41d(0xf6)]}));}async['attempts'](_0x1daf04){const _0x503afa=a200_0x4abbad,_0x430e74=_0x1daf04?.[_0x503afa(0x134)]||0x64,_0x42c067=await paginateResults((_0x36a49b,_0x5834b1)=>this['client'][_0x503afa(0x146)]({'project_name':_0x1daf04?.['projectName'],'workflow_name':_0x1daf04?.['workflowName'],'include_retried':_0x1daf04?.[_0x503afa(0xec)],'limit':_0x36a49b,'last_id':_0x5834b1??_0x1daf04?.[_0x503afa(0x15a)]}),_0x430e74);return _0x42c067[_0x503afa(0xea)](_0x344846=>({'project_id':_0x344846[_0x503afa(0x14c)]?.['id'],'project_name':_0x344846[_0x503afa(0x14c)]?.[_0x503afa(0x14a)],'workflow_id':_0x344846[_0x503afa(0xf6)]?.['id'],'workflow_name':_0x344846[_0x503afa(0xf6)]?.[_0x503afa(0x14a)],'session_id':_0x344846[_0x503afa(0xf4)],'sessionUuid':_0x344846['sessionUuid'],'sessionTime':_0x344846[_0x503afa(0x15d)],'attempt_id':_0x344846['id'],'attempt_index':_0x344846[_0x503afa(0x144)],'retryAttemptName':_0x344846[_0x503afa(0x11c)],'done':_0x344846['done'],'success':_0x344846[_0x503afa(0x148)],'cancelRequested':_0x344846[_0x503afa(0x10c)],'params':_0x344846[_0x503afa(0x139)],'createdAt':_0x344846[_0x503afa(0x159)],'finishedAt':_0x344846[_0x503afa(0xe8)],'id':_0x344846['id'],'index':_0x344846[_0x503afa(0x144)],'project':_0x344846[_0x503afa(0x14c)],'workflow':_0x344846['workflow']}));}async[a200_0x4abbad(0x13f)](_0x6011f3){const _0x22f04a=a200_0x4abbad,_0x116920=await this[_0x22f04a(0x14b)][_0x22f04a(0x12a)](_0x6011f3);return _0x116920;}async[a200_0x4abbad(0x109)](_0x31e95c,_0xb08dcb=![]){const _0x70fe52=a200_0x4abbad,_0x2f3962=await this['client'][_0x70fe52(0x104)](_0x31e95c,_0xb08dcb);return _0x2f3962[_0x70fe52(0xea)](_0x52cd6a=>({'task_id':_0x52cd6a['id'],'task_name':_0x52cd6a[_0x70fe52(0x147)],'parentId':_0x52cd6a[_0x70fe52(0x13a)],'config':_0x52cd6a['config'],'upstreams':_0x52cd6a['upstreams'],'state':_0x52cd6a[_0x70fe52(0xf7)],'exportParams':_0x52cd6a['exportParams'],'storeParams':_0x52cd6a[_0x70fe52(0x10e)],'stateParams':_0x52cd6a[_0x70fe52(0x114)],'updatedAt':_0x52cd6a[_0x70fe52(0xf2)],'retryAt':_0x52cd6a[_0x70fe52(0x158)],'startedAt':_0x52cd6a[_0x70fe52(0x108)],'error':_0x52cd6a[_0x70fe52(0x100)],'isGroup':_0x52cd6a[_0x70fe52(0x132)],'id':_0x52cd6a['id'],'fullName':_0x52cd6a[_0x70fe52(0x147)]}));}async['logFiles'](_0x44d3ad,_0xbcbc33){const _0x30cc20=a200_0x4abbad;return await this[_0x30cc20(0x14b)][_0x30cc20(0x14f)](_0x44d3ad,_0xbcbc33);}async[a200_0x4abbad(0xf1)](_0x2358f1,_0x5c7b98){const _0x2e9421=a200_0x4abbad,_0x3c17e1=await import(_0x2e9421(0x111)),{promisify:_0x15e14b}=await import(_0x2e9421(0x136)),_0x1e6092=_0x15e14b(_0x3c17e1[_0x2e9421(0x129)]),_0x58cdf7=await this[_0x2e9421(0x14b)][_0x2e9421(0x14f)](_0x2358f1,_0x5c7b98);if(_0x58cdf7[_0x2e9421(0xd1)]===0x0)return'';const _0x15e6d6=[];for(const _0x395afa of _0x58cdf7){if(!_0x395afa['direct'])continue;const _0x196560=await fetch(_0x395afa['direct']);if(!_0x196560['ok'])throw new Error(_0x2e9421(0x152)+_0x196560[_0x2e9421(0x123)]);const _0x3f1777=Buffer[_0x2e9421(0x10f)](await _0x196560[_0x2e9421(0x116)]()),_0x439986=await _0x1e6092(_0x3f1777);_0x15e6d6[_0x2e9421(0x11b)](_0x439986[_0x2e9421(0x127)]('utf-8'));}return _0x15e6d6[_0x2e9421(0x13d)]('\x0a');}async[a200_0x4abbad(0xd9)](_0x464cfd,_0x212706){const _0x2b20c2=a200_0x4abbad,_0x13db2a=await this[_0x2b20c2(0x14b)][_0x2b20c2(0x128)](_0x464cfd,_0x212706);return _0x13db2a?.[_0x2b20c2(0xcf)]??_0x2b20c2(0x131);}async[a200_0x4abbad(0x157)](_0x3e4939,_0x1c25d5){const _0x36062f=a200_0x4abbad,_0x27a91f=await this[_0x36062f(0x14b)]['retrySession'](_0x3e4939,{'from_task':_0x1c25d5?.[_0x36062f(0x102)],'retry_params':_0x1c25d5?.[_0x36062f(0x13b)]});return{'attemptId':_0x27a91f['id'],'sessionId':_0x27a91f[_0x36062f(0xf4)]};}async[a200_0x4abbad(0xda)](_0x436a44,_0x358971){const _0x33ea0d=a200_0x4abbad,_0x2b8112=await this[_0x33ea0d(0x14b)][_0x33ea0d(0xda)](_0x436a44,{'resume_from':_0x358971?.['resumeFrom'],'retry_params':_0x358971?.[_0x33ea0d(0x13b)],'force':_0x358971?.[_0x33ea0d(0x133)]});return{'attemptId':_0x2b8112['id'],'sessionId':_0x2b8112[_0x33ea0d(0xf4)]};}[a200_0x4abbad(0xe4)](_0x262e32){const _0x14c960=a200_0x4abbad,_0x3709f2=_0x262e32[_0x14c960(0xfb)]('.');if(_0x3709f2===-0x1)throw new SDKError(ErrorCode[_0x14c960(0xf8)],_0x14c960(0xd5)+_0x262e32);const _0x47166e=_0x262e32[_0x14c960(0xdc)](0x0,_0x3709f2),_0x17629d=_0x262e32[_0x14c960(0xdc)](_0x3709f2+0x1);if(!_0x47166e||!_0x17629d)throw new SDKError(ErrorCode[_0x14c960(0xf8)],_0x14c960(0x124)+_0x262e32+_0x14c960(0x113));return{'projectName':_0x47166e,'workflowName':_0x17629d};}async[a200_0x4abbad(0x13e)](_0x60e955,_0x46d257={},_0xaec4b8){const _0x34fc76=a200_0x4abbad,{projectName:_0x14ab81,workflowName:_0x85f6e1}=this[_0x34fc76(0xe4)](_0x60e955),_0x4d8dea=_0xaec4b8?.['sessionTime']||new Date()['toISOString']();return await this[_0x34fc76(0x14b)][_0x34fc76(0x11f)]({'projectName':_0x14ab81,'workflowName':_0x85f6e1,'sessionTime':_0x4d8dea,'params':_0x46d257});}async[a200_0x4abbad(0x145)](_0x505197){const _0x558019=a200_0x4abbad,{projectName:_0x56a586,workflowName:_0x2007d4}=this[_0x558019(0xe4)](_0x505197),{id:_0x3fddfd}=await this[_0x558019(0xeb)](_0x56a586);return await this['client'][_0x558019(0x155)](_0x3fddfd,_0x2007d4);}async[a200_0x4abbad(0x142)](_0x590675,_0x122ec8,_0x150772){const _0x69aefa=a200_0x4abbad,{promises:_0x253367}=await import('fs'),_0x59629c=await import('path'),_0x3e63ea=await import('os'),_0x151413=await import(_0x69aefa(0x10d)),{id:_0x8a0b6a,name:_0x2b05b7}=await this['resolveProjectId'](_0x590675),_0x1a6867=_0x3e63ea['tmpdir'](),_0x3c0124=_0x59629c[_0x69aefa(0x13d)](_0x1a6867,_0x69aefa(0x156)+_0x8a0b6a+'-'+Date['now']()+_0x69aefa(0x12f));try{await this['client'][_0x69aefa(0x10a)](_0x8a0b6a,_0x3c0124,_0x150772?.['revision']);const _0x18c600=_0x59629c[_0x69aefa(0x13d)](_0x122ec8,_0x2b05b7);await _0x253367[_0x69aefa(0xd3)](_0x18c600,{'recursive':!![]}),await _0x151413[_0x69aefa(0x12b)]({'file':_0x3c0124,'cwd':_0x18c600,'gzip':!![]});const _0x13d944=async _0x4b1e35=>{const _0x252c7c=_0x69aefa;let _0x35f98c=0x0;const _0x5e282f=await _0x253367[_0x252c7c(0xe2)](_0x4b1e35,{'withFileTypes':!![]});for(const _0x266a55 of _0x5e282f){const _0x254d65=_0x59629c[_0x252c7c(0x13d)](_0x4b1e35,_0x266a55[_0x252c7c(0x14a)]);if(_0x266a55[_0x252c7c(0x120)]())_0x35f98c++;else _0x266a55[_0x252c7c(0xff)]()&&(_0x35f98c+=await _0x13d944(_0x254d65));}return _0x35f98c;},_0x2697cf=await _0x13d944(_0x18c600);return{'projectName':_0x2b05b7,'revision':_0x150772?.[_0x69aefa(0x11e)]||_0x69aefa(0x119),'filesExtracted':_0x2697cf};}finally{try{await _0x253367[_0x69aefa(0xd4)](_0x3c0124);}catch{}}}async[a200_0x4abbad(0x11b)](_0x13012b,_0x25a465){const _0x280a5a=a200_0x4abbad,{promises:_0xc46cc6}=await import('fs'),_0x32af88=await import(_0x280a5a(0xd6)),_0x8654c=await import(_0x280a5a(0x10d)),_0x1f8b5e=_0x25a465?.['projectName']||_0x32af88['basename'](_0x13012b),_0x59c378=_0x25a465?.[_0x280a5a(0x11e)]||new Date()[_0x280a5a(0x106)]()[_0x280a5a(0x112)](/[:.]/g,'-');try{await _0xc46cc6[_0x280a5a(0xd2)](_0x13012b);}catch{throw new Error(_0x280a5a(0xe5)+_0x13012b);}if(!_0x25a465?.[_0x280a5a(0x137)]){const _0x1f49b9=await _0xc46cc6[_0x280a5a(0xe2)](_0x13012b),_0x171541=_0x1f49b9['filter'](_0x46d216=>_0x46d216[_0x280a5a(0x110)](WORKFLOW_FILE_EXTENSION));if(_0x171541[_0x280a5a(0xd1)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x280a5a(0xd7));for(const _0x21be40 of _0x171541){const _0x1fb4ad=_0x32af88['join'](_0x13012b,_0x21be40);try{await _0xc46cc6[_0x280a5a(0xd2)](_0x1fb4ad);}catch{throw new Error('Cannot\x20read\x20workflow\x20file:\x20'+_0x21be40);}}}const _0x3166c0=async(_0x4f892d,_0x560a43='')=>{const _0x2ac01c=_0x280a5a,_0x175468=await _0xc46cc6[_0x2ac01c(0xe2)](_0x4f892d,{'withFileTypes':!![]}),_0x2af996=[];for(const _0x3cde2c of _0x175468){const _0xb4e491=_0x32af88[_0x2ac01c(0x13d)](_0x560a43,_0x3cde2c[_0x2ac01c(0x14a)]),_0x55fb13=_0x32af88[_0x2ac01c(0x13d)](_0x4f892d,_0x3cde2c[_0x2ac01c(0x14a)]);if(!shouldIncludeInArchive(_0x3cde2c[_0x2ac01c(0x14a)]))continue;_0x3cde2c[_0x2ac01c(0xff)]()?_0x2af996[_0x2ac01c(0x11b)](...await _0x3166c0(_0x55fb13,_0xb4e491)):_0x2af996[_0x2ac01c(0x11b)](_0xb4e491);}return _0x2af996;},_0x4417ed=await _0x3166c0(_0x13012b),_0x49db8e=await import('os'),_0x184c3c=_0x49db8e[_0x280a5a(0x141)](),_0x53b9dd=_0x32af88[_0x280a5a(0x13d)](_0x184c3c,_0x280a5a(0x154)+Date[_0x280a5a(0xe9)]()+'.tar.gz');try{await _0x8654c[_0x280a5a(0x11a)]({'file':_0x53b9dd,'gzip':!![],'cwd':_0x13012b,'portable':!![]},_0x4417ed);const _0x30b936=await this['client'][_0x280a5a(0x135)](_0x1f8b5e,_0x59c378,_0x53b9dd,{'scheduleFrom':_0x25a465?.[_0x280a5a(0x15c)],'clearSchedule':_0x25a465?.['clearSchedule'],'clearScheduleAll':_0x25a465?.[_0x280a5a(0xce)]});return{'projectId':_0x30b936['id'],'projectName':_0x30b936[_0x280a5a(0x14a)],'revision':_0x30b936[_0x280a5a(0x11e)]};}finally{try{await _0xc46cc6[_0x280a5a(0xd4)](_0x53b9dd);}catch{}}}async[a200_0x4abbad(0x14d)](_0x5698d7){const _0x12b241=a200_0x4abbad,{id:_0x3b82fa}=await this[_0x12b241(0xeb)](_0x5698d7),_0x1d73ab=await this['client'][_0x12b241(0xdf)](_0x3b82fa);return{'projectId':_0x1d73ab['id'],'projectName':_0x1d73ab[_0x12b241(0x14a)]};}async[a200_0x4abbad(0xe3)](_0x4841ce){const _0x58ecb0=a200_0x4abbad,{id:_0x30717d,name:_0x40c924}=await this[_0x58ecb0(0xeb)](_0x4841ce),_0x15657e=await this[_0x58ecb0(0x14b)][_0x58ecb0(0xe3)](_0x30717d);return{'projectName':_0x40c924,'secrets':_0x15657e};}async[a200_0x4abbad(0xef)](_0x2047ee,_0x2a5bda,_0x9272eb){const _0x58e764=a200_0x4abbad,{id:_0x7dd1e0,name:_0xef1d9d}=await this['resolveProjectId'](_0x2047ee);return await this[_0x58e764(0x14b)]['setSecret'](_0x7dd1e0,_0x2a5bda,_0x9272eb),{'projectName':_0xef1d9d,'key':_0x2a5bda};}async['setSecrets'](_0x4db435,_0x2f288e){const _0x27dd1e=a200_0x4abbad,{id:_0x3a7fff,name:_0x4de6e2}=await this[_0x27dd1e(0xeb)](_0x4db435),_0xe063be=Object[_0x27dd1e(0xf0)](_0x2f288e),_0x2e4338=await Promise['allSettled'](_0xe063be[_0x27dd1e(0xea)](_0x49e3d5=>this[_0x27dd1e(0x14b)][_0x27dd1e(0xef)](_0x3a7fff,_0x49e3d5,_0x2f288e[_0x49e3d5]))),_0x469d22=_0x2e4338[_0x27dd1e(0xea)]((_0x20c1ab,_0x294b1c)=>_0x20c1ab['status']===_0x27dd1e(0xfa)?_0xe063be[_0x294b1c]:null)[_0x27dd1e(0xe7)](_0x69c11c=>_0x69c11c!==null);if(_0x469d22[_0x27dd1e(0xd1)]>0x0)throw new SDKError(ErrorCode[_0x27dd1e(0x149)],_0x27dd1e(0xd0)+(_0x469d22[_0x27dd1e(0xd1)]>0x1?'s':'')+':\x20'+_0x469d22[_0x27dd1e(0x13d)](',\x20'));return{'projectName':_0x4de6e2,'keys':_0xe063be};}async[a200_0x4abbad(0x121)](_0x5548ad,_0x484287){const _0x545092=a200_0x4abbad,{id:_0x3dab86,name:_0x1aa7a7}=await this[_0x545092(0xeb)](_0x5548ad);return await this[_0x545092(0x14b)][_0x545092(0x121)](_0x3dab86,_0x484287),{'projectName':_0x1aa7a7,'key':_0x484287};}async[a200_0x4abbad(0xee)](_0x5b21e4,_0x52cc97){const _0x3e51ce=a200_0x4abbad;return pullWorkflow({'client':this[_0x3e51ce(0x14b)],'resolveProjectId':this[_0x3e51ce(0xeb)][_0x3e51ce(0x15b)](this)},_0x5b21e4,_0x52cc97);}async['applyPullProject'](_0x20480c,_0x4f4195){const _0x37f7d1=a200_0x4abbad;return applyPullResult({'client':this['client'],'resolveProjectId':this[_0x37f7d1(0xeb)][_0x37f7d1(0x15b)](this)},_0x20480c,_0x4f4195);}async['preparePushProject'](_0x40a4ef){const _0x4fab0c=a200_0x4abbad;return preparePushWorkflow({'client':this['client'],'resolveProjectId':this[_0x4fab0c(0xeb)][_0x4fab0c(0x15b)](this)},_0x40a4ef);}async[a200_0x4abbad(0xed)](_0x4e9982){const _0x1022f1=a200_0x4abbad;return executePushWorkflow({'client':this[_0x1022f1(0x14b)],'resolveProjectId':this[_0x1022f1(0xeb)][_0x1022f1(0x15b)](this)},_0x4e9982);}async[a200_0x4abbad(0x151)](_0x43ce1c,_0x5747e5,_0xfdf0fb){return prepareCloneWorkflow({'client':this['client']},_0x43ce1c,_0x5747e5,_0xfdf0fb);}async[a200_0x4abbad(0xde)](_0x294e4a){const _0x1eca3d=a200_0x4abbad;return executeCloneWorkflow({'client':this[_0x1eca3d(0x14b)]},_0x294e4a);}async[a200_0x4abbad(0xfe)](_0x1a792f){const _0x562cea=a200_0x4abbad,_0x3b3c18=Math[_0x562cea(0x118)](Number(_0x1a792f?.['limit'])||MAX_PAGINATION_LIMIT,MAX_PAGINATION_LIMIT);return await this[_0x562cea(0x14b)][_0x562cea(0xfe)]({'limit':_0x3b3c18});}async[a200_0x4abbad(0x12c)](_0xad1ef6,_0x1f4f03){const _0xa4823d=a200_0x4abbad,{id:_0x5a7f17}=await this[_0xa4823d(0xeb)](_0xad1ef6),_0x5de837=Math[_0xa4823d(0x118)](Number(_0x1f4f03?.['limit'])||MAX_PAGINATION_LIMIT,MAX_PAGINATION_LIMIT);return await this[_0xa4823d(0x14b)][_0xa4823d(0x12c)](_0x5a7f17,{'workflow':_0x1f4f03?.['workflow'],'limit':_0x5de837});}async[a200_0x4abbad(0x153)](_0x4543e1){const _0x55d4eb=a200_0x4abbad;return await this[_0x55d4eb(0x14b)][_0x55d4eb(0x153)](_0x4543e1);}async[a200_0x4abbad(0xe0)](_0x5173a1,_0x1bafb1){const _0x25f292=a200_0x4abbad;return await this[_0x25f292(0x14b)][_0x25f292(0xe0)](_0x5173a1,_0x1bafb1);}async[a200_0x4abbad(0x12e)](_0x184dcf){const _0x4367dd=a200_0x4abbad;return await this[_0x4367dd(0x14b)][_0x4367dd(0x12e)](_0x184dcf);}}
|
|
1
|
+
const a209_0x5160b2=a209_0x4431;(function(_0x41fe2e,_0x5421cf){const _0x39982f=a209_0x4431,_0x3d5e0f=_0x41fe2e();while(!![]){try{const _0x363057=parseInt(_0x39982f(0xe3))/0x1+parseInt(_0x39982f(0x137))/0x2*(-parseInt(_0x39982f(0xec))/0x3)+-parseInt(_0x39982f(0x115))/0x4*(-parseInt(_0x39982f(0xb6))/0x5)+-parseInt(_0x39982f(0xea))/0x6+parseInt(_0x39982f(0x130))/0x7+parseInt(_0x39982f(0xc2))/0x8*(-parseInt(_0x39982f(0xfd))/0x9)+parseInt(_0x39982f(0xb7))/0xa*(-parseInt(_0x39982f(0x136))/0xb);if(_0x363057===_0x5421cf)break;else _0x3d5e0f['push'](_0x3d5e0f['shift']());}catch(_0x3013c4){_0x3d5e0f['push'](_0x3d5e0f['shift']());}}}(a209_0x5a31,0xbde4a));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';function a209_0x4431(_0x2dd011,_0x117c07){_0x2dd011=_0x2dd011-0xb0;const _0x5a31c7=a209_0x5a31();let _0x44317d=_0x5a31c7[_0x2dd011];return _0x44317d;}import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x339904,_0x1d6bb1,_0x59c139=0x64){const _0x199f14=a209_0x4431,_0x53f5fb=Math[_0x199f14(0x11c)](_0x1d6bb1,MAX_PAGINATION_LIMIT),_0x37823e=[];let _0x4b56eb;while(_0x37823e[_0x199f14(0xda)]<_0x53f5fb){const _0x261588=await _0x339904(_0x59c139,_0x4b56eb),_0x5db92e=_0x261588[_0x199f14(0xd1)]??_0x261588[_0x199f14(0x11d)][_0x199f14(0xda)];if(_0x5db92e===0x0)break;_0x37823e[_0x199f14(0xde)](..._0x261588[_0x199f14(0x11d)]);if(!_0x261588[_0x199f14(0x119)]||_0x5db92e<_0x59c139)break;_0x4b56eb=_0x261588['lastId'];}return _0x37823e[_0x199f14(0xe5)](0x0,_0x53f5fb);}function a209_0x5a31(){const _0x2ebb80=['force','sessionUuid','retryParams','executeCloneProject','toISOString','resumeFrom','projects','listSchedules','attempts','limit','success','Invalid\x20workflow\x20format:\x20','mkdir','enableSchedule','skipValidation','from','sessionTime','9458211ZwAXNJ','getAttemptTasks','NUMERIC_ID_PATTERN','name','getWorkflow','timezone','231033VeYAMu','984068sSuLlX','util','updatedAt','replace','keys','No\x20','tasks','retryAt','client','3939340PXcmOQ','280sOjAdA','find','now','startAttempt','config','sessionId','attempt','tmpdir','Failed\x20to\x20download\x20log\x20file:\x20','tdx-workflow-push-','project','24fFCRbb','last_id','prepareCloneProject','resolveProjectId','Failed\x20to\x20set\x20secret','done','cancelRequested','map','setSecrets','endsWith','setSecret','latest','error','gunzip','sessions','rawCount','logs','killAttempt','fromTime','zlib','utf-8','deleteSecret','extract','finishedAt','length','exportParams','path','listSecrets','push','.\x20Expected\x20\x22project.workflow\x22','revision','isDirectory','projectName','38169gUryJw','Project\x20directory\x20not\x20found:\x20','slice','listAttempts','disableSchedule','uploadProjectArchive','join','316440yusiqQ','access','3AfVWtD','test','Kill\x20request\x20accepted','readdir','.tar.gz','logFiles','parentId','listSessions','bind','lastAttempt','pullProject','substring','listProjects','getAttempt','isGroup','getProjectWorkflow','unlink','799650OUvvZD','\x20workflow\x20files\x20found\x20in\x20project\x20directory','allSettled','clearSchedule','retryAttemptName','filter','direct','createdAt','scheduleFrom','tdx-workflow-','includeRetried','workflow','applyPullProject','INVALID_ARGUMENT','create','executePushProject','status','fullName','params','listLogFiles','WORKFLOW_PROJECT_NOT_FOUND','parseWorkflowId','getSchedule','stateParams','4URSpts','workflowName','retrySession','Project\x20not\x20found:\x20','lastId','indexOf','run','min','data','listProjectSchedules'];a209_0x5a31=function(){return _0x2ebb80;};return a209_0x5a31();}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a209_0x5160b2(0x132)]=/^\d+$/;[a209_0x5160b2(0xb5)];constructor(_0x483f32){this['client']=new WorkflowApiClient(_0x483f32);}async[a209_0x5160b2(0xc5)](_0x421230){const _0x4dc29d=a209_0x5160b2;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x4dc29d(0xed)](_0x421230)){const _0x950a49=await this[_0x4dc29d(0xb5)]['getProject'](_0x421230);return{'id':_0x950a49['id'],'name':_0x950a49[_0x4dc29d(0x133)]};}const _0x3cf5a4=await this[_0x4dc29d(0xb5)]['listProjects']({'name_pattern':_0x421230}),_0x1e8c2b=_0x3cf5a4[_0x4dc29d(0x11d)][_0x4dc29d(0xb8)](_0x2d9afb=>_0x2d9afb[_0x4dc29d(0x133)]===_0x421230);if(!_0x1e8c2b)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x4dc29d(0x118)+_0x421230);return{'id':_0x1e8c2b['id'],'name':_0x1e8c2b[_0x4dc29d(0x133)]};}async[a209_0x5160b2(0x125)](_0x11142d,_0x1fac48){const _0x654b31=a209_0x5160b2,_0x9f557b=_0x1fac48?.[_0x654b31(0x128)]||MAX_PAGINATION_LIMIT,_0x446129=await paginateResults((_0x284426,_0x3846a4)=>this[_0x654b31(0xb5)][_0x654b31(0xf8)]({'name_pattern':_0x11142d,'limit':_0x284426,'last_id':_0x3846a4??_0x1fac48?.[_0x654b31(0xc3)]}),_0x9f557b);return _0x446129[_0x654b31(0xc9)](_0x54f2df=>({..._0x54f2df,'project_id':_0x54f2df['id'],'project_name':_0x54f2df['name']}));}async['workflows'](_0x3b00f8,_0x32ed05){const _0x58ad8a=a209_0x5160b2,_0x57bcb0=_0x32ed05?.[_0x58ad8a(0x128)]||MAX_PAGINATION_LIMIT,_0x44d019=await paginateResults((_0x6a4d0,_0x2fb4f0)=>this[_0x58ad8a(0xb5)]['listWorkflows']({'project_name':_0x3b00f8,'limit':_0x6a4d0,'last_id':_0x2fb4f0??_0x32ed05?.[_0x58ad8a(0xc3)]}),_0x57bcb0);return _0x44d019[_0x58ad8a(0xc9)](_0x1a1619=>({'project_id':_0x1a1619[_0x58ad8a(0xc1)]?.['id'],'project_name':_0x1a1619[_0x58ad8a(0xc1)]?.[_0x58ad8a(0x133)],'workflow_id':_0x1a1619['id'],'workflow_name':_0x1a1619['name'],'revision':_0x1a1619[_0x58ad8a(0xe0)],'timezone':_0x1a1619[_0x58ad8a(0x135)],'config':_0x1a1619[_0x58ad8a(0xbb)],'id':_0x1a1619['id'],'name':_0x1a1619['name'],'project':_0x1a1619[_0x58ad8a(0xc1)]}));}async[a209_0x5160b2(0xd0)](_0x50a812){const _0x47eb59=a209_0x5160b2;let _0x548be7;if(_0x50a812?.['projectName']){let _0x449599,_0x3a07ba=![];while(!_0x3a07ba){const _0x2b0dee=await this['client'][_0x47eb59(0xf8)]({'limit':0x64,'last_id':_0x449599}),_0x4c3892=_0x2b0dee[_0x47eb59(0x11d)][_0x47eb59(0xb8)](_0xba2275=>_0xba2275['name']===_0x50a812[_0x47eb59(0xe2)]);if(_0x4c3892){_0x548be7=_0x4c3892['id'],_0x3a07ba=!![];break;}if(!_0x2b0dee[_0x47eb59(0x119)]||_0x2b0dee[_0x47eb59(0x11d)][_0x47eb59(0xda)]===0x0)break;_0x449599=_0x2b0dee[_0x47eb59(0x119)];}if(!_0x548be7)throw new SDKError(ErrorCode[_0x47eb59(0x111)],_0x47eb59(0x118)+_0x50a812[_0x47eb59(0xe2)]);}const _0x1d94fc=_0x50a812?.[_0x47eb59(0x128)]||0x64,_0x5f30e6=await paginateResults((_0x429501,_0x2d64bc)=>this['client'][_0x47eb59(0xf3)]({'project_id':_0x548be7,'project_name':_0x50a812?.[_0x47eb59(0xe2)],'workflow_name':_0x50a812?.[_0x47eb59(0x116)],'status':_0x50a812?.['status'],'from_time':_0x50a812?.[_0x47eb59(0xd4)],'to_time':_0x50a812?.['toTime'],'limit':_0x429501,'last_id':_0x2d64bc??_0x50a812?.[_0x47eb59(0xc3)]}),_0x1d94fc);return _0x5f30e6[_0x47eb59(0xc9)](_0x147fbd=>({'project_id':_0x147fbd['project']?.['id'],'project_name':_0x147fbd[_0x47eb59(0xc1)]?.[_0x47eb59(0x133)],'workflow_id':_0x147fbd[_0x47eb59(0x108)]?.['id'],'workflow_name':_0x147fbd[_0x47eb59(0x108)]?.['name'],'session_id':_0x147fbd['id'],'sessionUuid':_0x147fbd['sessionUuid'],'sessionTime':_0x147fbd[_0x47eb59(0x12f)],'lastAttempt':_0x147fbd[_0x47eb59(0xf5)],'id':_0x147fbd['id'],'project':_0x147fbd[_0x47eb59(0xc1)],'workflow':_0x147fbd['workflow']}));}async[a209_0x5160b2(0x127)](_0x5d8cac){const _0x15b52e=a209_0x5160b2,_0x3667dc=_0x5d8cac?.[_0x15b52e(0x128)]||0x64,_0x2c4eda=await paginateResults((_0x1f6335,_0x5dcb8a)=>this[_0x15b52e(0xb5)][_0x15b52e(0xe6)]({'project_name':_0x5d8cac?.['projectName'],'workflow_name':_0x5d8cac?.[_0x15b52e(0x116)],'include_retried':_0x5d8cac?.[_0x15b52e(0x107)],'limit':_0x1f6335,'last_id':_0x5dcb8a??_0x5d8cac?.[_0x15b52e(0xc3)]}),_0x3667dc);return _0x2c4eda[_0x15b52e(0xc9)](_0x5c5f04=>({'project_id':_0x5c5f04[_0x15b52e(0xc1)]?.['id'],'project_name':_0x5c5f04[_0x15b52e(0xc1)]?.[_0x15b52e(0x133)],'workflow_id':_0x5c5f04[_0x15b52e(0x108)]?.['id'],'workflow_name':_0x5c5f04[_0x15b52e(0x108)]?.['name'],'session_id':_0x5c5f04[_0x15b52e(0xbc)],'sessionUuid':_0x5c5f04[_0x15b52e(0x120)],'sessionTime':_0x5c5f04[_0x15b52e(0x12f)],'attempt_id':_0x5c5f04['id'],'attempt_index':_0x5c5f04['index'],'retryAttemptName':_0x5c5f04[_0x15b52e(0x101)],'done':_0x5c5f04[_0x15b52e(0xc7)],'success':_0x5c5f04[_0x15b52e(0x129)],'cancelRequested':_0x5c5f04[_0x15b52e(0xc8)],'params':_0x5c5f04[_0x15b52e(0x10f)],'createdAt':_0x5c5f04[_0x15b52e(0x104)],'finishedAt':_0x5c5f04[_0x15b52e(0xd9)],'id':_0x5c5f04['id'],'index':_0x5c5f04['index'],'project':_0x5c5f04[_0x15b52e(0xc1)],'workflow':_0x5c5f04[_0x15b52e(0x108)]}));}async[a209_0x5160b2(0xbd)](_0xb85df8){const _0xff1353=a209_0x5160b2,_0x2fe98e=await this[_0xff1353(0xb5)][_0xff1353(0xf9)](_0xb85df8);return _0x2fe98e;}async[a209_0x5160b2(0xb3)](_0x723f01,_0x45d1ca=![]){const _0x284e17=a209_0x5160b2,_0x3f8401=await this[_0x284e17(0xb5)][_0x284e17(0x131)](_0x723f01,_0x45d1ca);return _0x3f8401['map'](_0x13f4d1=>({'task_id':_0x13f4d1['id'],'task_name':_0x13f4d1['fullName'],'parentId':_0x13f4d1[_0x284e17(0xf2)],'config':_0x13f4d1[_0x284e17(0xbb)],'upstreams':_0x13f4d1['upstreams'],'state':_0x13f4d1['state'],'exportParams':_0x13f4d1[_0x284e17(0xdb)],'storeParams':_0x13f4d1['storeParams'],'stateParams':_0x13f4d1[_0x284e17(0x114)],'updatedAt':_0x13f4d1[_0x284e17(0x139)],'retryAt':_0x13f4d1[_0x284e17(0xb4)],'startedAt':_0x13f4d1['startedAt'],'error':_0x13f4d1[_0x284e17(0xce)],'isGroup':_0x13f4d1[_0x284e17(0xfa)],'id':_0x13f4d1['id'],'fullName':_0x13f4d1[_0x284e17(0x10e)]}));}async[a209_0x5160b2(0xf1)](_0x274b86,_0x61ce68){const _0x223765=a209_0x5160b2;return await this[_0x223765(0xb5)]['listLogFiles'](_0x274b86,_0x61ce68);}async[a209_0x5160b2(0xd2)](_0x597728,_0x5dd534){const _0xd7ecc=a209_0x5160b2,_0x454b9a=await import(_0xd7ecc(0xd5)),{promisify:_0x8e5a4f}=await import(_0xd7ecc(0x138)),_0x15200b=_0x8e5a4f(_0x454b9a[_0xd7ecc(0xcf)]),_0x44764e=await this[_0xd7ecc(0xb5)][_0xd7ecc(0x110)](_0x597728,_0x5dd534);if(_0x44764e[_0xd7ecc(0xda)]===0x0)return'';const _0x213341=[];for(const _0xc4166f of _0x44764e){if(!_0xc4166f[_0xd7ecc(0x103)])continue;const _0x147709=await fetch(_0xc4166f[_0xd7ecc(0x103)]);if(!_0x147709['ok'])throw new Error(_0xd7ecc(0xbf)+_0x147709[_0xd7ecc(0x10d)]);const _0x5b8357=Buffer[_0xd7ecc(0x12e)](await _0x147709['arrayBuffer']()),_0x2d48f2=await _0x15200b(_0x5b8357);_0x213341['push'](_0x2d48f2['toString'](_0xd7ecc(0xd6)));}return _0x213341[_0xd7ecc(0xe9)]('\x0a');}async['kill'](_0x85a31,_0x479727){const _0x12ebde=a209_0x5160b2,_0x44ddab=await this[_0x12ebde(0xb5)][_0x12ebde(0xd3)](_0x85a31,_0x479727);return _0x44ddab?.['message']??_0x12ebde(0xee);}async['retrySession'](_0xabffc5,_0x45ac90){const _0x178939=a209_0x5160b2,_0x2ba6df=await this['client'][_0x178939(0x117)](_0xabffc5,{'from_task':_0x45ac90?.['fromTask'],'retry_params':_0x45ac90?.['retryParams']});return{'attemptId':_0x2ba6df['id'],'sessionId':_0x2ba6df[_0x178939(0xbc)]};}async['retryAttempt'](_0x7b48ad,_0x519bf4){const _0x401d32=a209_0x5160b2,_0x1732ef=await this[_0x401d32(0xb5)]['retryAttempt'](_0x7b48ad,{'resume_from':_0x519bf4?.[_0x401d32(0x124)],'retry_params':_0x519bf4?.[_0x401d32(0x121)],'force':_0x519bf4?.[_0x401d32(0x11f)]});return{'attemptId':_0x1732ef['id'],'sessionId':_0x1732ef['sessionId']};}[a209_0x5160b2(0x112)](_0x38003b){const _0x485fa4=a209_0x5160b2,_0x4f1124=_0x38003b[_0x485fa4(0x11a)]('.');if(_0x4f1124===-0x1)throw new SDKError(ErrorCode[_0x485fa4(0x10a)],'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format:\x20'+_0x38003b);const _0x324a37=_0x38003b[_0x485fa4(0xf7)](0x0,_0x4f1124),_0x10a229=_0x38003b[_0x485fa4(0xf7)](_0x4f1124+0x1);if(!_0x324a37||!_0x10a229)throw new SDKError(ErrorCode[_0x485fa4(0x10a)],_0x485fa4(0x12a)+_0x38003b+_0x485fa4(0xdf));return{'projectName':_0x324a37,'workflowName':_0x10a229};}async[a209_0x5160b2(0x11b)](_0x2bd964,_0x2667a2={},_0x5657df){const _0x350df5=a209_0x5160b2,{projectName:_0x4d17c9,workflowName:_0x4d1b98}=this['parseWorkflowId'](_0x2bd964),_0x5573a8=_0x5657df?.[_0x350df5(0x12f)]||new Date()['toISOString']();return await this[_0x350df5(0xb5)][_0x350df5(0xba)]({'projectName':_0x4d17c9,'workflowName':_0x4d1b98,'sessionTime':_0x5573a8,'params':_0x2667a2});}async[a209_0x5160b2(0x134)](_0x23f80b){const _0x57b7db=a209_0x5160b2,{projectName:_0x4d082e,workflowName:_0x5d86f4}=this[_0x57b7db(0x112)](_0x23f80b),{id:_0x45997d}=await this[_0x57b7db(0xc5)](_0x4d082e);return await this[_0x57b7db(0xb5)][_0x57b7db(0xfb)](_0x45997d,_0x5d86f4);}async['download'](_0x47d544,_0x4a071c,_0x3e3c55){const _0x12a1b1=a209_0x5160b2,{promises:_0x4c18e6}=await import('fs'),_0x2096c9=await import('path'),_0x374164=await import('os'),_0x41d10b=await import('tar'),{id:_0x10e1a3,name:_0x2b94eb}=await this['resolveProjectId'](_0x47d544),_0x5c3fd3=_0x374164['tmpdir'](),_0x3d909e=_0x2096c9[_0x12a1b1(0xe9)](_0x5c3fd3,_0x12a1b1(0x106)+_0x10e1a3+'-'+Date[_0x12a1b1(0xb9)]()+_0x12a1b1(0xf0));try{await this[_0x12a1b1(0xb5)]['downloadProjectArchive'](_0x10e1a3,_0x3d909e,_0x3e3c55?.[_0x12a1b1(0xe0)]);const _0x199e4e=_0x2096c9[_0x12a1b1(0xe9)](_0x4a071c,_0x2b94eb);await _0x4c18e6[_0x12a1b1(0x12b)](_0x199e4e,{'recursive':!![]}),await _0x41d10b[_0x12a1b1(0xd8)]({'file':_0x3d909e,'cwd':_0x199e4e,'gzip':!![]});const _0x428b6d=async _0xf011e0=>{const _0x3b4053=_0x12a1b1;let _0x3f94fb=0x0;const _0x215f25=await _0x4c18e6[_0x3b4053(0xef)](_0xf011e0,{'withFileTypes':!![]});for(const _0x1b79be of _0x215f25){const _0x48fe36=_0x2096c9[_0x3b4053(0xe9)](_0xf011e0,_0x1b79be[_0x3b4053(0x133)]);if(_0x1b79be['isFile']())_0x3f94fb++;else _0x1b79be[_0x3b4053(0xe1)]()&&(_0x3f94fb+=await _0x428b6d(_0x48fe36));}return _0x3f94fb;},_0x3166e7=await _0x428b6d(_0x199e4e);return{'projectName':_0x2b94eb,'revision':_0x3e3c55?.[_0x12a1b1(0xe0)]||_0x12a1b1(0xcd),'filesExtracted':_0x3166e7};}finally{try{await _0x4c18e6[_0x12a1b1(0xfc)](_0x3d909e);}catch{}}}async[a209_0x5160b2(0xde)](_0x2c2626,_0x36f450){const _0x141eb5=a209_0x5160b2,{promises:_0x2b55ed}=await import('fs'),_0x98e56e=await import(_0x141eb5(0xdc)),_0x12eca4=await import('tar'),_0x4c0ea1=_0x36f450?.[_0x141eb5(0xe2)]||_0x98e56e['basename'](_0x2c2626),_0x5c59b2=_0x36f450?.[_0x141eb5(0xe0)]||new Date()[_0x141eb5(0x123)]()[_0x141eb5(0xb0)](/[:.]/g,'-');try{await _0x2b55ed['access'](_0x2c2626);}catch{throw new Error(_0x141eb5(0xe4)+_0x2c2626);}if(!_0x36f450?.[_0x141eb5(0x12d)]){const _0x55e8c1=await _0x2b55ed[_0x141eb5(0xef)](_0x2c2626),_0x1900a4=_0x55e8c1['filter'](_0x16e3db=>_0x16e3db[_0x141eb5(0xcb)](WORKFLOW_FILE_EXTENSION));if(_0x1900a4[_0x141eb5(0xda)]===0x0)throw new Error(_0x141eb5(0xb2)+WORKFLOW_FILE_EXTENSION+_0x141eb5(0xfe));for(const _0x32058e of _0x1900a4){const _0x5953eb=_0x98e56e[_0x141eb5(0xe9)](_0x2c2626,_0x32058e);try{await _0x2b55ed[_0x141eb5(0xeb)](_0x5953eb);}catch{throw new Error('Cannot\x20read\x20workflow\x20file:\x20'+_0x32058e);}}}const _0x3473b8=async(_0x3051f2,_0x128d33='')=>{const _0x49d195=_0x141eb5,_0xa9a5e2=await _0x2b55ed[_0x49d195(0xef)](_0x3051f2,{'withFileTypes':!![]}),_0x5a2a8c=[];for(const _0x1d650d of _0xa9a5e2){const _0x426015=_0x98e56e[_0x49d195(0xe9)](_0x128d33,_0x1d650d['name']),_0x267443=_0x98e56e[_0x49d195(0xe9)](_0x3051f2,_0x1d650d[_0x49d195(0x133)]);if(!shouldIncludeInArchive(_0x1d650d[_0x49d195(0x133)]))continue;_0x1d650d[_0x49d195(0xe1)]()?_0x5a2a8c['push'](...await _0x3473b8(_0x267443,_0x426015)):_0x5a2a8c[_0x49d195(0xde)](_0x426015);}return _0x5a2a8c;},_0x3ab9a5=await _0x3473b8(_0x2c2626),_0x178ab9=await import('os'),_0x26bb4e=_0x178ab9[_0x141eb5(0xbe)](),_0x8448ae=_0x98e56e[_0x141eb5(0xe9)](_0x26bb4e,_0x141eb5(0xc0)+Date[_0x141eb5(0xb9)]()+_0x141eb5(0xf0));try{await _0x12eca4[_0x141eb5(0x10b)]({'file':_0x8448ae,'gzip':!![],'cwd':_0x2c2626,'portable':!![]},_0x3ab9a5);const _0x33568b=await this[_0x141eb5(0xb5)][_0x141eb5(0xe8)](_0x4c0ea1,_0x5c59b2,_0x8448ae,{'scheduleFrom':_0x36f450?.[_0x141eb5(0x105)],'clearSchedule':_0x36f450?.[_0x141eb5(0x100)],'clearScheduleAll':_0x36f450?.['clearScheduleAll']});return{'projectId':_0x33568b['id'],'projectName':_0x33568b['name'],'revision':_0x33568b[_0x141eb5(0xe0)]};}finally{try{await _0x2b55ed[_0x141eb5(0xfc)](_0x8448ae);}catch{}}}async['delete'](_0x363ed8){const _0x52fe6e=a209_0x5160b2,{id:_0x29a4a1}=await this[_0x52fe6e(0xc5)](_0x363ed8),_0x316e6d=await this[_0x52fe6e(0xb5)]['deleteProject'](_0x29a4a1);return{'projectId':_0x316e6d['id'],'projectName':_0x316e6d['name']};}async['listSecrets'](_0x53bc25){const _0xb2796a=a209_0x5160b2,{id:_0x30d509,name:_0xb16eb1}=await this[_0xb2796a(0xc5)](_0x53bc25),_0x319dec=await this[_0xb2796a(0xb5)][_0xb2796a(0xdd)](_0x30d509);return{'projectName':_0xb16eb1,'secrets':_0x319dec};}async[a209_0x5160b2(0xcc)](_0x1fbaf8,_0x3b0799,_0x3344ee){const _0x2a376b=a209_0x5160b2,{id:_0x6f72c,name:_0x36df27}=await this[_0x2a376b(0xc5)](_0x1fbaf8);return await this['client'][_0x2a376b(0xcc)](_0x6f72c,_0x3b0799,_0x3344ee),{'projectName':_0x36df27,'key':_0x3b0799};}async[a209_0x5160b2(0xca)](_0x27dcbc,_0x1c7adc){const _0x4b852c=a209_0x5160b2,{id:_0x4cf584,name:_0x5f0106}=await this[_0x4b852c(0xc5)](_0x27dcbc),_0xcf55bf=Object[_0x4b852c(0xb1)](_0x1c7adc),_0x1cf4d6=await Promise[_0x4b852c(0xff)](_0xcf55bf[_0x4b852c(0xc9)](_0x158602=>this[_0x4b852c(0xb5)][_0x4b852c(0xcc)](_0x4cf584,_0x158602,_0x1c7adc[_0x158602]))),_0x36697c=_0x1cf4d6[_0x4b852c(0xc9)]((_0x587c3a,_0x5c5812)=>_0x587c3a['status']==='rejected'?_0xcf55bf[_0x5c5812]:null)[_0x4b852c(0x102)](_0x178fd9=>_0x178fd9!==null);if(_0x36697c[_0x4b852c(0xda)]>0x0)throw new SDKError(ErrorCode['WORKFLOW_SECRET_SET_FAILED'],_0x4b852c(0xc6)+(_0x36697c[_0x4b852c(0xda)]>0x1?'s':'')+':\x20'+_0x36697c[_0x4b852c(0xe9)](',\x20'));return{'projectName':_0x5f0106,'keys':_0xcf55bf};}async['deleteSecret'](_0x53829b,_0x1f4557){const _0x54b77d=a209_0x5160b2,{id:_0x42ac5f,name:_0x5d40b3}=await this[_0x54b77d(0xc5)](_0x53829b);return await this['client'][_0x54b77d(0xd7)](_0x42ac5f,_0x1f4557),{'projectName':_0x5d40b3,'key':_0x1f4557};}async[a209_0x5160b2(0xf6)](_0x2ccc15,_0x34ff8a){const _0x28ccf5=a209_0x5160b2;return pullWorkflow({'client':this[_0x28ccf5(0xb5)],'resolveProjectId':this[_0x28ccf5(0xc5)][_0x28ccf5(0xf4)](this)},_0x2ccc15,_0x34ff8a);}async[a209_0x5160b2(0x109)](_0x2ba46d,_0x5629f){const _0x238bd3=a209_0x5160b2;return applyPullResult({'client':this[_0x238bd3(0xb5)],'resolveProjectId':this['resolveProjectId'][_0x238bd3(0xf4)](this)},_0x2ba46d,_0x5629f);}async['preparePushProject'](_0x507de5){const _0x3d039b=a209_0x5160b2;return preparePushWorkflow({'client':this[_0x3d039b(0xb5)],'resolveProjectId':this[_0x3d039b(0xc5)][_0x3d039b(0xf4)](this)},_0x507de5);}async[a209_0x5160b2(0x10c)](_0x30c917){const _0xbe93ef=a209_0x5160b2;return executePushWorkflow({'client':this['client'],'resolveProjectId':this[_0xbe93ef(0xc5)][_0xbe93ef(0xf4)](this)},_0x30c917);}async[a209_0x5160b2(0xc4)](_0x347236,_0x4642f6,_0x1d3489){const _0x555edb=a209_0x5160b2;return prepareCloneWorkflow({'client':this[_0x555edb(0xb5)]},_0x347236,_0x4642f6,_0x1d3489);}async[a209_0x5160b2(0x122)](_0x5997c1){const _0x318f35=a209_0x5160b2;return executeCloneWorkflow({'client':this[_0x318f35(0xb5)]},_0x5997c1);}async['listSchedules'](_0x380bc5){const _0x3bee94=a209_0x5160b2,_0x3fea00=Math[_0x3bee94(0x11c)](Number(_0x380bc5?.[_0x3bee94(0x128)])||MAX_PAGINATION_LIMIT,MAX_PAGINATION_LIMIT);return await this[_0x3bee94(0xb5)][_0x3bee94(0x126)]({'limit':_0x3fea00});}async[a209_0x5160b2(0x11e)](_0x5912a4,_0x251383){const _0x526b77=a209_0x5160b2,{id:_0x1cd1c8}=await this['resolveProjectId'](_0x5912a4),_0x37eaec=Math[_0x526b77(0x11c)](Number(_0x251383?.['limit'])||MAX_PAGINATION_LIMIT,MAX_PAGINATION_LIMIT);return await this[_0x526b77(0xb5)][_0x526b77(0x11e)](_0x1cd1c8,{'workflow':_0x251383?.[_0x526b77(0x108)],'limit':_0x37eaec});}async[a209_0x5160b2(0x113)](_0x5a309c){const _0x82f110=a209_0x5160b2;return await this[_0x82f110(0xb5)][_0x82f110(0x113)](_0x5a309c);}async[a209_0x5160b2(0x12c)](_0x5a3a60,_0x1fe6f8){const _0x4a0b0d=a209_0x5160b2;return await this[_0x4a0b0d(0xb5)][_0x4a0b0d(0x12c)](_0x5a3a60,_0x1fe6f8);}async['disableSchedule'](_0x1cc4dd){const _0x2c8ac0=a209_0x5160b2;return await this['client'][_0x2c8ac0(0xe7)](_0x1cc4dd);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a210_0x279a(_0x104092,_0x24f744){_0x104092=_0x104092-0x96;const _0x198c8d=a210_0x198c();let _0x279aa3=_0x198c8d[_0x104092];return _0x279aa3;}(function(_0x387662,_0x511f28){const _0x44758a=a210_0x279a,_0x500060=_0x387662();while(!![]){try{const _0x195a5f=-parseInt(_0x44758a(0xc6))/0x1+parseInt(_0x44758a(0xcd))/0x2+-parseInt(_0x44758a(0xaf))/0x3+-parseInt(_0x44758a(0xce))/0x4*(-parseInt(_0x44758a(0xb0))/0x5)+-parseInt(_0x44758a(0x99))/0x6+-parseInt(_0x44758a(0x9d))/0x7*(-parseInt(_0x44758a(0xac))/0x8)+parseInt(_0x44758a(0xab))/0x9*(parseInt(_0x44758a(0xbf))/0xa);if(_0x195a5f===_0x511f28)break;else _0x500060['push'](_0x500060['shift']());}catch(_0x1af9cb){_0x500060['push'](_0x500060['shift']());}}}(a210_0x198c,0x1cd72));import{existsSync,promises as a210_0x5b02c0}from'fs';import a210_0x4be5fd from'path';import a210_0x447cae from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';function a210_0x198c(){const _0x3435a7=['utf-8','length','1283514bUDHNN','name','WORKFLOW_ARCHIVE_CORRUPTED','isNewProject','133KRygZu','filter','message','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','changes','tar','writeFile','join','path','modified','archive.tar.gz','add','latest','downloadProjectArchive','2169FUxsUh','9320AzPvLq','targetDir','deleted','386841fbDQqm','265YRprKP','projectId','readdir','mkdtemp','\x20(archive\x20size:\x20','toISOString','new','Failed\x20to\x20extract\x20project\x20archive','stat','localeCompare','unlink','\x20bytes)','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','baseDir','extract','15230yQNXBj','getProject','zlib','mkdir','revision','projectName','TAR_BAD_ARCHIVE','175727AYxfIT','tdx.json','includes','tdx-wf-pull-','size','push','catch','450146mmMAcK','1696XXZJlL','isDirectory','type','tmpdir','readFile','unchanged'];a210_0x198c=function(){return _0x3435a7;};return a210_0x198c();}export async function pullWorkflow(_0x17063a,_0x18875b,_0x256e0a={}){const _0x149d58=a210_0x279a,_0x526b6f=await import(_0x149d58(0xa2)),{client:_0x330b2f,resolveProjectId:_0x1a8618}=_0x17063a,{id:_0x8ee15d,name:_0x220cc9}=await _0x1a8618(_0x18875b),_0x5a2536=_0x256e0a[_0x149d58(0xbd)]||process['cwd'](),_0x568aa8=_0x256e0a[_0x149d58(0xad)]||getWorkflowProjectDir(_0x220cc9,_0x5a2536),_0x3d7f11=a210_0x4be5fd[_0x149d58(0xa4)](_0x568aa8,'tdx.json'),_0x154eb7=!existsSync(_0x3d7f11),_0x13cd15=await a210_0x5b02c0[_0x149d58(0xb3)](a210_0x4be5fd[_0x149d58(0xa4)](a210_0x447cae[_0x149d58(0xd1)](),_0x149d58(0xc9))),_0xdcc081=a210_0x4be5fd['join'](_0x13cd15,_0x149d58(0xa7)),_0x562eb6=a210_0x4be5fd[_0x149d58(0xa4)](_0x13cd15,'extracted');try{await _0x330b2f[_0x149d58(0xaa)](_0x8ee15d,_0xdcc081,_0x256e0a[_0x149d58(0xc3)]),await a210_0x5b02c0[_0x149d58(0xc2)](_0x562eb6,{'recursive':!![]});try{await _0x526b6f[_0x149d58(0xbe)]({'file':_0xdcc081,'cwd':_0x562eb6,'gzip':!![]});}catch(_0x5471ab){const _0x2ffc9f=_0x5471ab instanceof Error?_0x5471ab[_0x149d58(0x9f)]:String(_0x5471ab);if(_0x2ffc9f[_0x149d58(0xc8)](_0x149d58(0xc5))||_0x2ffc9f[_0x149d58(0xc8)]('zlib')){const _0x345086=await a210_0x5b02c0[_0x149d58(0xb8)](_0xdcc081)[_0x149d58(0xcc)](()=>null),_0x4dac60=_0x345086?_0x149d58(0xb4)+_0x345086['size']+_0x149d58(0xbb):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x149d58(0xb7)+_0x4dac60+':\x20'+_0x2ffc9f,_0x5471ab,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+_0x149d58(0xa0)});}throw _0x5471ab;}const _0x3dbd2d=await _0x330b2f[_0x149d58(0xc0)](_0x8ee15d),_0x5e8343=_0x256e0a[_0x149d58(0xc3)]||_0x3dbd2d[_0x149d58(0xc3)]||_0x149d58(0xa9),_0x43e8a3=await calculateChanges(_0x568aa8,_0x562eb6,_0x154eb7),_0x46d97b={'new':_0x43e8a3['filter'](_0xbbf7b8=>_0xbbf7b8[_0x149d58(0xd0)]===_0x149d58(0xb6))[_0x149d58(0x98)],'modified':_0x43e8a3['filter'](_0x356940=>_0x356940[_0x149d58(0xd0)]===_0x149d58(0xa6))[_0x149d58(0x98)],'deleted':_0x43e8a3[_0x149d58(0x9e)](_0x1d1bc5=>_0x1d1bc5['type']===_0x149d58(0xae))[_0x149d58(0x98)],'unchanged':_0x43e8a3[_0x149d58(0x9e)](_0x3e8bc5=>_0x3e8bc5[_0x149d58(0xd0)]===_0x149d58(0x96))['length']};return{'projectName':_0x220cc9,'projectId':_0x8ee15d,'revision':_0x5e8343,'targetDir':_0x568aa8,'changes':_0x43e8a3,'summary':_0x46d97b,'hasChanges':_0x46d97b['new']>0x0||_0x46d97b[_0x149d58(0xa6)]>0x0||_0x46d97b[_0x149d58(0xae)]>0x0,'isNewProject':_0x154eb7};}finally{await a210_0x5b02c0['rm'](_0x13cd15,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x5c6a40,_0x533ab8,_0x1fc118={}){const _0x1f4611=a210_0x279a,_0x45607c=await import(_0x1f4611(0xa2)),{client:_0x20bda7}=_0x5c6a40,_0x56a95f=await a210_0x5b02c0[_0x1f4611(0xb3)](a210_0x4be5fd[_0x1f4611(0xa4)](a210_0x447cae[_0x1f4611(0xd1)](),'tdx-wf-apply-')),_0x3ea552=a210_0x4be5fd[_0x1f4611(0xa4)](_0x56a95f,'archive.tar.gz');try{await _0x20bda7[_0x1f4611(0xaa)](_0x533ab8['projectId'],_0x3ea552,_0x1fc118[_0x1f4611(0xc3)]),await a210_0x5b02c0[_0x1f4611(0xc2)](_0x533ab8[_0x1f4611(0xad)],{'recursive':!![]});for(const _0x9aad40 of _0x533ab8[_0x1f4611(0xa1)]){if(_0x9aad40['type']==='deleted'){const _0x4d73e6=a210_0x4be5fd[_0x1f4611(0xa4)](_0x533ab8[_0x1f4611(0xad)],_0x9aad40[_0x1f4611(0xa5)]);await a210_0x5b02c0[_0x1f4611(0xba)](_0x4d73e6)[_0x1f4611(0xcc)](()=>{});}}try{await _0x45607c[_0x1f4611(0xbe)]({'file':_0x3ea552,'cwd':_0x533ab8['targetDir'],'gzip':!![]});}catch(_0x5dbc3c){const _0x5cdbf0=_0x5dbc3c instanceof Error?_0x5dbc3c[_0x1f4611(0x9f)]:String(_0x5dbc3c);if(_0x5cdbf0[_0x1f4611(0xc8)]('TAR_BAD_ARCHIVE')||_0x5cdbf0[_0x1f4611(0xc8)](_0x1f4611(0xc1))){const _0x2d5bb1=await a210_0x5b02c0[_0x1f4611(0xb8)](_0x3ea552)[_0x1f4611(0xcc)](()=>null),_0x26e373=_0x2d5bb1?_0x1f4611(0xb4)+_0x2d5bb1[_0x1f4611(0xca)]+_0x1f4611(0xbb):'';throw new SDKError(ErrorCode[_0x1f4611(0x9b)],'Failed\x20to\x20extract\x20project\x20archive'+_0x26e373+':\x20'+_0x5cdbf0,_0x5dbc3c,{'helpText':_0x1f4611(0xbc)+_0x1f4611(0xa0)});}throw _0x5dbc3c;}const _0x450fff=a210_0x4be5fd[_0x1f4611(0xa4)](_0x533ab8['targetDir'],_0x1f4611(0xc7));if(_0x533ab8[_0x1f4611(0x9c)]){const _0x24a15f=createWorkflowTdxConfigContent(_0x533ab8[_0x1f4611(0xc4)],_0x533ab8[_0x1f4611(0xb1)],_0x533ab8['revision']);await a210_0x5b02c0[_0x1f4611(0xa3)](_0x450fff,_0x24a15f,'utf-8');}else updateWorkflowTdxConfig(_0x450fff,{'last_pulled_revision':_0x533ab8[_0x1f4611(0xc3)],'last_pulled_at':new Date()[_0x1f4611(0xb5)]()});}finally{await a210_0x5b02c0['rm'](_0x56a95f,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x1ffd93,_0x43108b,_0x3a360c){const _0x32d480=a210_0x279a,_0x25f00a=[],_0x38d8f3=await getAllFiles(_0x43108b),_0x8dc9b9=existsSync(_0x1ffd93)?await getAllFiles(_0x1ffd93):new Set();for(const _0x850396 of _0x38d8f3){const _0x5e1aa5=a210_0x4be5fd[_0x32d480(0xa4)](_0x1ffd93,_0x850396),_0xea3081=a210_0x4be5fd[_0x32d480(0xa4)](_0x43108b,_0x850396);if(_0x850396===_0x32d480(0xc7))continue;const _0x2920aa=await a210_0x5b02c0[_0x32d480(0xd2)](_0xea3081,'utf-8')['catch'](()=>null);if(_0x2920aa===null)continue;if(!existsSync(_0x5e1aa5)||_0x3a360c)_0x25f00a['push']({'path':_0x850396,'type':_0x32d480(0xb6),'newContent':_0x2920aa});else{const _0x3b41c5=await a210_0x5b02c0[_0x32d480(0xd2)](_0x5e1aa5,_0x32d480(0x97))[_0x32d480(0xcc)](()=>null);if(_0x3b41c5===null)_0x25f00a['push']({'path':_0x850396,'type':'modified','newContent':_0x2920aa});else{if(_0x3b41c5!==_0x2920aa){const _0x3d284d=generateDiff(_0x3b41c5,_0x2920aa),_0x43f956=hasChanges(_0x3d284d)?formatDiffWithColors(_0x3d284d):undefined;_0x25f00a['push']({'path':_0x850396,'type':_0x32d480(0xa6),'oldContent':_0x3b41c5,'newContent':_0x2920aa,'diff':_0x43f956});}else _0x25f00a[_0x32d480(0xcb)]({'path':_0x850396,'type':_0x32d480(0x96)});}}}if(!_0x3a360c)for(const _0x14632d of _0x8dc9b9){if(_0x14632d===_0x32d480(0xc7))continue;if(!_0x38d8f3['has'](_0x14632d)){const _0x58ae8a=a210_0x4be5fd[_0x32d480(0xa4)](_0x1ffd93,_0x14632d),_0x332d00=await a210_0x5b02c0[_0x32d480(0xd2)](_0x58ae8a,_0x32d480(0x97))[_0x32d480(0xcc)](()=>undefined);_0x25f00a[_0x32d480(0xcb)]({'path':_0x14632d,'type':'deleted','oldContent':_0x332d00});}}return _0x25f00a['sort']((_0x6fe075,_0x1b3333)=>_0x6fe075[_0x32d480(0xa5)][_0x32d480(0xb9)](_0x1b3333[_0x32d480(0xa5)])),_0x25f00a;}async function getAllFiles(_0x156b76,_0x397649=''){const _0x4c3451=a210_0x279a,_0x173569=new Set();if(!existsSync(_0x156b76))return _0x173569;const _0x34afbb=await a210_0x5b02c0[_0x4c3451(0xb2)](_0x156b76,{'withFileTypes':!![]});for(const _0x271be0 of _0x34afbb){const _0x3247d9=_0x397649?a210_0x4be5fd[_0x4c3451(0xa4)](_0x397649,_0x271be0[_0x4c3451(0x9a)]):_0x271be0[_0x4c3451(0x9a)];if(_0x271be0[_0x4c3451(0xcf)]()){const _0x15b289=await getAllFiles(a210_0x4be5fd[_0x4c3451(0xa4)](_0x156b76,_0x271be0[_0x4c3451(0x9a)]),_0x3247d9);for(const _0xa9babb of _0x15b289){_0x173569['add'](_0xa9babb);}}else _0x173569[_0x4c3451(0xa8)](_0x3247d9);}return _0x173569;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a211_0x360f(_0x354421,_0x4d8c66){_0x354421=_0x354421-0x1b8;const _0x156d6e=a211_0x156d();let _0x360fe3=_0x156d6e[_0x354421];return _0x360fe3;}(function(_0x2330ae,_0x46e42e){const _0x43ac98=a211_0x360f,_0x478b2c=_0x2330ae();while(!![]){try{const _0x58cc48=parseInt(_0x43ac98(0x1f7))/0x1+-parseInt(_0x43ac98(0x1ea))/0x2*(parseInt(_0x43ac98(0x1cf))/0x3)+parseInt(_0x43ac98(0x1f3))/0x4*(-parseInt(_0x43ac98(0x1df))/0x5)+-parseInt(_0x43ac98(0x1d8))/0x6*(parseInt(_0x43ac98(0x1c5))/0x7)+parseInt(_0x43ac98(0x1c8))/0x8+-parseInt(_0x43ac98(0x1e7))/0x9+parseInt(_0x43ac98(0x1ca))/0xa;if(_0x58cc48===_0x46e42e)break;else _0x478b2c['push'](_0x478b2c['shift']());}catch(_0x59fbed){_0x478b2c['push'](_0x478b2c['shift']());}}}(a211_0x156d,0x4bb2a));import{promises as a211_0x1c74ec}from'fs';import a211_0x5b6e1c from'path';import a211_0x1efc52 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x5340c3,_0x201324={}){const _0xd84174=a211_0x360f,_0x345b55=await import(_0xd84174(0x1c4)),{client:_0x2215e3,resolveProjectId:_0x19b9fe}=_0x5340c3,_0x1e450b=_0x201324[_0xd84174(0x1d6)]||process['cwd'](),_0x2abe47=findWorkflowTdxConfig(_0x1e450b),{config:_0x4c7d4e,configDir:_0x335361}=_0x2abe47;let _0x5efed9,_0x222a96=_0x4c7d4e[_0xd84174(0x1ed)];try{const _0x4b2fe4=await _0x19b9fe(_0x4c7d4e[_0xd84174(0x1ed)]);_0x5efed9=_0x4b2fe4['id'],_0x222a96=_0x4b2fe4[_0xd84174(0x1bc)];}catch{_0x5efed9='';}const _0x521363=_0x201324[_0xd84174(0x1dd)]||new Date()[_0xd84174(0x1c6)]()['replace'](/[:.]/g,'-');if(!_0x201324[_0xd84174(0x1c0)]){const _0x5375a8=await a211_0x1c74ec['readdir'](_0x335361),_0x15df6c=_0x5375a8['filter'](_0x2b2fde=>_0x2b2fde['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x15df6c[_0xd84174(0x1d1)]===0x0)throw new Error(_0xd84174(0x1d3)+WORKFLOW_FILE_EXTENSION+_0xd84174(0x1cc)+_0x335361);}const _0x543cb8=await getProjectFiles(_0x335361);let _0x18c785;if(_0x5efed9){const _0x557765=await a211_0x1c74ec[_0xd84174(0x1ce)](a211_0x5b6e1c[_0xd84174(0x1cb)](a211_0x1efc52[_0xd84174(0x1bd)](),'tdx-wf-push-')),_0x8457b6=a211_0x5b6e1c['join'](_0x557765,'archive.tar.gz'),_0xdb2750=a211_0x5b6e1c[_0xd84174(0x1cb)](_0x557765,_0xd84174(0x1e3));try{await _0x2215e3[_0xd84174(0x1de)](_0x5efed9,_0x8457b6),await a211_0x1c74ec[_0xd84174(0x1ec)](_0xdb2750,{'recursive':!![]});try{await _0x345b55[_0xd84174(0x1c7)]({'file':_0x8457b6,'cwd':_0xdb2750,'gzip':!![]});}catch(_0x5c13ee){const _0x3af045=_0x5c13ee instanceof Error?_0x5c13ee[_0xd84174(0x1bb)]:String(_0x5c13ee);if(_0x3af045['includes'](_0xd84174(0x1db))||_0x3af045['includes'](_0xd84174(0x1c3))){const _0x3e7c57=await a211_0x1c74ec[_0xd84174(0x1d9)](_0x8457b6)[_0xd84174(0x1f1)](()=>null),_0x238839=_0x3e7c57?_0xd84174(0x1f2)+_0x3e7c57[_0xd84174(0x1e6)]+_0xd84174(0x1e4):'';throw new SDKError(ErrorCode[_0xd84174(0x1e5)],_0xd84174(0x1ee)+_0x238839+':\x20'+_0x3af045,_0x5c13ee,{'helpText':'Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.'});}throw _0x5c13ee;}_0x18c785=await calculatePushChanges(_0x335361,_0xdb2750,_0x543cb8);}finally{await a211_0x1c74ec['rm'](_0x557765,{'recursive':!![],'force':!![]});}}else{_0x18c785=[];for(const _0x2d556b of _0x543cb8){const _0x3afd38=a211_0x5b6e1c['join'](_0x335361,_0x2d556b),_0xf46dff=await a211_0x1c74ec[_0xd84174(0x1e0)](_0x3afd38,_0xd84174(0x1e8))[_0xd84174(0x1f1)](()=>null);_0x18c785[_0xd84174(0x1ef)]({'path':_0x2d556b,'type':'new','newContent':_0xf46dff||undefined});}}const _0x9c2ce5={'new':_0x18c785[_0xd84174(0x1d5)](_0x5e7c0b=>_0x5e7c0b[_0xd84174(0x1d4)]===_0xd84174(0x1ba))[_0xd84174(0x1d1)],'modified':_0x18c785[_0xd84174(0x1d5)](_0x3145c5=>_0x3145c5[_0xd84174(0x1d4)]==='modified')[_0xd84174(0x1d1)],'deleted':_0x18c785[_0xd84174(0x1d5)](_0x563daa=>_0x563daa['type']==='deleted')[_0xd84174(0x1d1)],'unchanged':_0x18c785['filter'](_0x4201fd=>_0x4201fd['type']===_0xd84174(0x1c1))[_0xd84174(0x1d1)]};return{'projectName':_0x222a96,'projectId':_0x5efed9,'revision':_0x521363,'sourceDir':_0x335361,'changes':_0x18c785,'summary':_0x9c2ce5,'hasChanges':_0x9c2ce5[_0xd84174(0x1ba)]>0x0||_0x9c2ce5[_0xd84174(0x1f4)]>0x0||_0x9c2ce5[_0xd84174(0x1eb)]>0x0,'configResult':_0x2abe47,'skipSchedule':_0x201324[_0xd84174(0x1da)]};}export async function executePushWorkflow(_0x29f304,_0x20312c){const _0xac5f71=a211_0x360f,_0x2b1dc7=await import(_0xac5f71(0x1c4)),{client:_0x469b01}=_0x29f304,_0x25f88c=await getProjectFiles(_0x20312c[_0xac5f71(0x1d6)]),_0x3c687a=await a211_0x1c74ec[_0xac5f71(0x1ce)](a211_0x5b6e1c[_0xac5f71(0x1cb)](a211_0x1efc52[_0xac5f71(0x1bd)](),_0xac5f71(0x1be))),_0x58c283=a211_0x5b6e1c['join'](_0x3c687a,_0xac5f71(0x1f0));try{await _0x2b1dc7[_0xac5f71(0x1c9)]({'file':_0x58c283,'gzip':!![],'cwd':_0x20312c[_0xac5f71(0x1d6)],'portable':!![]},_0x25f88c);const _0x60ac10=await _0x469b01[_0xac5f71(0x1f5)](_0x20312c[_0xac5f71(0x1cd)],_0x20312c['revision'],_0x58c283,{'skipSchedule':_0x20312c[_0xac5f71(0x1da)]});return updateWorkflowTdxConfig(_0x20312c[_0xac5f71(0x1c2)]['configPath'],{'workflow_project_id':_0x60ac10['id'],'last_pushed_revision':_0x60ac10[_0xac5f71(0x1dd)],'last_pushed_at':new Date()[_0xac5f71(0x1c6)]()}),{'projectId':_0x60ac10['id'],'projectName':_0x60ac10[_0xac5f71(0x1bc)],'revision':_0x60ac10[_0xac5f71(0x1dd)]};}finally{await a211_0x1c74ec['rm'](_0x3c687a,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x2b70eb,_0x361f90=_0x2b70eb,_0x2ad647='',_0x8735ea=null){const _0x48aa59=a211_0x360f,_0x9d03c4=[];if(_0x8735ea===null){_0x8735ea=createIgnoreInstance();const _0x5b8197=await loadDigdagignore(_0x2b70eb);_0x5b8197&&_0x8735ea[_0x48aa59(0x1e1)](_0x5b8197);}if(_0x2ad647!==''){const _0xb50fb5=await loadDigdagignore(_0x361f90);_0xb50fb5&&addScopedPatterns(_0x8735ea,_0xb50fb5,_0x2ad647);}const _0x47e8ff=await a211_0x1c74ec[_0x48aa59(0x1f6)](_0x361f90,{'withFileTypes':!![]});for(const _0x3dbb53 of _0x47e8ff){const _0x49f9b6=_0x2ad647?a211_0x5b6e1c[_0x48aa59(0x1e2)][_0x48aa59(0x1cb)](_0x2ad647,_0x3dbb53[_0x48aa59(0x1bc)]):_0x3dbb53[_0x48aa59(0x1bc)];if(_0x3dbb53[_0x48aa59(0x1bc)]===_0x48aa59(0x1d2))continue;if(_0x3dbb53['name']===_0x48aa59(0x1d0))continue;if(!shouldIncludeInArchive(_0x3dbb53[_0x48aa59(0x1bc)]))continue;if(shouldIgnoreWithInstance(_0x8735ea,_0x49f9b6,_0x3dbb53[_0x48aa59(0x1dc)]()))continue;if(_0x3dbb53[_0x48aa59(0x1dc)]()){const _0x5d208a=await getProjectFiles(_0x2b70eb,a211_0x5b6e1c[_0x48aa59(0x1cb)](_0x361f90,_0x3dbb53['name']),_0x49f9b6,_0x8735ea);_0x9d03c4[_0x48aa59(0x1ef)](..._0x5d208a);}else _0x9d03c4[_0x48aa59(0x1ef)](_0x49f9b6);}return _0x9d03c4;}function a211_0x156d(){const _0x4954e3=['extracted','\x20bytes)','WORKFLOW_ARCHIVE_CORRUPTED','size','296514UGVRBj','utf-8','has','22502CLYXvO','deleted','mkdir','workflow_project','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','push','archive.tar.gz','catch','\x20(archive\x20size:\x20','5416jxEtyg','modified','uploadProjectArchive','readdir','511556uCnSpx','includes','sort','new','message','name','tmpdir','tdx-wf-push-archive-','localeCompare','skipValidation','unchanged','configResult','zlib','tar','7bIbhHw','toISOString','extract','2593264nmILSH','create','10398760DheqqP','join','\x20workflow\x20files\x20found\x20in\x20','projectName','mkdtemp','159PyTBdP','.digdagignore','length','tdx.json','No\x20','type','filter','sourceDir','path','3050514DFfhLE','stat','skipSchedule','TAR_BAD_ARCHIVE','isDirectory','revision','downloadProjectArchive','1580GcIEvU','readFile','add','posix'];a211_0x156d=function(){return _0x4954e3;};return a211_0x156d();}async function calculatePushChanges(_0x3f91e4,_0x17180d,_0x528f85){const _0xee1c6c=a211_0x360f,_0x3c6e4d=[],_0x53335f=new Set(await getProjectFiles(_0x17180d));for(const _0x22ead3 of _0x528f85){const _0x4b2282=a211_0x5b6e1c[_0xee1c6c(0x1cb)](_0x3f91e4,_0x22ead3),_0x44c1c9=a211_0x5b6e1c[_0xee1c6c(0x1cb)](_0x17180d,_0x22ead3),_0x5aac1b=await a211_0x1c74ec[_0xee1c6c(0x1e0)](_0x4b2282,'utf-8')[_0xee1c6c(0x1f1)](()=>null);if(_0x5aac1b===null)continue;if(!_0x53335f[_0xee1c6c(0x1e9)](_0x22ead3))_0x3c6e4d[_0xee1c6c(0x1ef)]({'path':_0x22ead3,'type':_0xee1c6c(0x1ba),'newContent':_0x5aac1b});else{const _0x51e44f=await a211_0x1c74ec[_0xee1c6c(0x1e0)](_0x44c1c9,_0xee1c6c(0x1e8))[_0xee1c6c(0x1f1)](()=>null);if(_0x51e44f===null)_0x3c6e4d[_0xee1c6c(0x1ef)]({'path':_0x22ead3,'type':_0xee1c6c(0x1f4),'newContent':_0x5aac1b});else{if(_0x51e44f!==_0x5aac1b){const _0x49694a=generateDiff(_0x51e44f,_0x5aac1b),_0x1a6a66=hasChanges(_0x49694a)?formatDiffWithColors(_0x49694a):undefined;_0x3c6e4d['push']({'path':_0x22ead3,'type':'modified','oldContent':_0x51e44f,'newContent':_0x5aac1b,'diff':_0x1a6a66});}else _0x3c6e4d[_0xee1c6c(0x1ef)]({'path':_0x22ead3,'type':'unchanged'});}}}for(const _0x59d1f7 of _0x53335f){if(!_0x528f85[_0xee1c6c(0x1b8)](_0x59d1f7)){const _0x3e7191=a211_0x5b6e1c[_0xee1c6c(0x1cb)](_0x17180d,_0x59d1f7),_0x1947d5=await a211_0x1c74ec['readFile'](_0x3e7191,_0xee1c6c(0x1e8))[_0xee1c6c(0x1f1)](()=>undefined);_0x3c6e4d[_0xee1c6c(0x1ef)]({'path':_0x59d1f7,'type':'deleted','oldContent':_0x1947d5});}}return _0x3c6e4d[_0xee1c6c(0x1b9)]((_0x446034,_0x4f6950)=>_0x446034['path'][_0xee1c6c(0x1bf)](_0x4f6950[_0xee1c6c(0x1d7)])),_0x3c6e4d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a212_0xcfc070=a212_0xf6ef;(function(_0xf6e2e3,_0x5515ab){const _0x585b2f=a212_0xf6ef,_0x43736f=_0xf6e2e3();while(!![]){try{const _0x385111=parseInt(_0x585b2f(0x1ca))/0x1+-parseInt(_0x585b2f(0x1e5))/0x2*(parseInt(_0x585b2f(0x1db))/0x3)+parseInt(_0x585b2f(0x1ee))/0x4+-parseInt(_0x585b2f(0x1f1))/0x5+-parseInt(_0x585b2f(0x1d5))/0x6*(parseInt(_0x585b2f(0x1f2))/0x7)+-parseInt(_0x585b2f(0x1e4))/0x8+parseInt(_0x585b2f(0x1df))/0x9*(parseInt(_0x585b2f(0x1f0))/0xa);if(_0x385111===_0x5515ab)break;else _0x43736f['push'](_0x43736f['shift']());}catch(_0x1ad2a6){_0x43736f['push'](_0x43736f['shift']());}}}(a212_0x20d3,0xb089c));function a212_0x20d3(){const _0x4658ca=['slice','1293210rvGBxo','3174575UnXwkx','7Gyjthk','data\x20exports','length','⚠️\x20\x20ACTIVATION','warning','warningDetail','http','38206TTzbJI','⚠️\x20\x20DATA\x20EXPORT','command','string','activations','⚠️\x20\x20Email\x20send','children','email\x20sends','stringify','name','startsWith','4384608ccftlM','td>','HTTP\x20calls','join',',\x20and\x20','operator','432483PBiZhd','label','baseIndent','keys','153RqOMwT','export','\x20\x20\x20←\x20','result_url','activation','3188032fzezIQ','6rgLGVI','entries','endsWith','⚠️\x20\x20This\x20workflow\x20contains\x20','object','repeat','push','⚠️\x20\x20HTTP\x20call','\x20→\x20','2732428xzTRQb'];a212_0x20d3=function(){return _0x4658ca;};return a212_0x20d3();}const OPERATOR_WARNINGS={'td_run>':a212_0xcfc070(0x1e3),'http>':a212_0xcfc070(0x1f8),'http_call>':'http','mail>':'mail'},WARNING_META={'activation':{'label':a212_0xcfc070(0x1f5),'singular':a212_0xcfc070(0x1e3),'plural':a212_0xcfc070(0x1ce)},'http':{'label':a212_0xcfc070(0x1ec),'singular':'HTTP\x20call','plural':a212_0xcfc070(0x1d7)},'mail':{'label':a212_0xcfc070(0x1cf),'singular':'email\x20send','plural':a212_0xcfc070(0x1d1)},'export':{'label':a212_0xcfc070(0x1cb),'singular':'data\x20export','plural':a212_0xcfc070(0x1f3)}};function emptySummary(){return{'activation':0x0,'http':0x0,'mail':0x0,'export':0x0};}function collectTasks(_0x44d1fc){const _0x13b0ce=a212_0xcfc070;if(!_0x44d1fc||typeof _0x44d1fc!==_0x13b0ce(0x1e9))return[];if(Array['isArray'](_0x44d1fc))return _0x44d1fc['flatMap'](collectTasks);const _0xe548cb=_0x44d1fc,_0x4bd401=[];for(const [_0x4cc3fe,_0x2235fd]of Object[_0x13b0ce(0x1e6)](_0xe548cb)){if(_0x4cc3fe[_0x13b0ce(0x1e7)]('>'))continue;_0x4cc3fe[_0x13b0ce(0x1d4)]('+')?_0x4bd401[_0x13b0ce(0x1eb)](buildTaskNode(_0x4cc3fe,_0x2235fd)):_0x4bd401[_0x13b0ce(0x1eb)](...collectTasks(_0x2235fd));}return _0x4bd401;}function pickResultTarget(_0x4c9a50){const _0x4e01b9=a212_0xcfc070,_0x22d70a=_0x4c9a50['result_connection'];if(typeof _0x22d70a===_0x4e01b9(0x1cd)&&_0x22d70a[_0x4e01b9(0x1f4)]>0x0)return _0x22d70a;const _0x40d607=_0x4c9a50[_0x4e01b9(0x1e2)];if(typeof _0x40d607==='string'&&_0x40d607['length']>0x0)return _0x40d607;return undefined;}function buildTaskNode(_0x359251,_0x46df7e){const _0x4da6b0=a212_0xcfc070,_0x24695d={'name':_0x359251,'children':[]};if(!_0x46df7e||typeof _0x46df7e!=='object')return _0x24695d;const _0x120c25=_0x46df7e;for(const [_0x5c097a,_0x6b1a56]of Object[_0x4da6b0(0x1e6)](_0x120c25)){if(!_0x5c097a[_0x4da6b0(0x1e7)]('>'))continue;_0x24695d[_0x4da6b0(0x1da)]=_0x5c097a,_0x24695d['command']=typeof _0x6b1a56===_0x4da6b0(0x1cd)?_0x6b1a56:JSON[_0x4da6b0(0x1d2)](_0x6b1a56),_0x24695d['warning']=OPERATOR_WARNINGS[_0x5c097a];break;}if(_0x24695d['operator']===_0x4da6b0(0x1d6)||_0x24695d[_0x4da6b0(0x1da)]==='td_for_each>'){const _0x603982=pickResultTarget(_0x120c25);_0x603982&&(_0x24695d[_0x4da6b0(0x1f6)]=_0x4da6b0(0x1e0),_0x24695d['warningDetail']=_0x603982);}return _0x24695d['children']=collectTasks(_0x120c25),_0x24695d;}export function parseTaskGraph(_0x94d503){return collectTasks(_0x94d503);}function a212_0xf6ef(_0xd499a7,_0x4a0346){_0xd499a7=_0xd499a7-0x1ca;const _0x20d36d=a212_0x20d3();let _0xf6ef08=_0x20d36d[_0xd499a7];return _0xf6ef08;}export function summarizeTaskGraph(_0x14c59f){const _0x1ed113=emptySummary(),_0x1b8246=_0x271a16=>{const _0x4d9341=a212_0xf6ef;for(const _0x2ab594 of _0x271a16){if(_0x2ab594['warning'])_0x1ed113[_0x2ab594['warning']]++;_0x1b8246(_0x2ab594[_0x4d9341(0x1d0)]);}};return _0x1b8246(_0x14c59f),_0x1ed113;}const MAX_COMMAND_LENGTH=0x50;function truncate(_0x4eb6e2,_0x41743e){const _0x1164f4=a212_0xcfc070;if(_0x4eb6e2[_0x1164f4(0x1f4)]<=_0x41743e)return _0x4eb6e2;return _0x4eb6e2[_0x1164f4(0x1ef)](0x0,Math['max'](0x0,_0x41743e-0x1))+'…';}export function formatTaskGraph(_0x10f90a,_0x590de6={}){const _0x478438=a212_0xcfc070,_0x2689d8=_0x590de6[_0x478438(0x1dd)]??0x1,_0x22b8ef=[],_0x433b66=(_0x5c0d85,_0x4bcd64)=>{const _0x4c0aae=_0x478438;for(const _0x4e9a7b of _0x5c0d85){const _0x1d33ee='\x20\x20'[_0x4c0aae(0x1ea)](_0x2689d8+_0x4bcd64);_0x22b8ef[_0x4c0aae(0x1eb)](''+_0x1d33ee+_0x4e9a7b[_0x4c0aae(0x1d3)]);if(_0x4e9a7b[_0x4c0aae(0x1da)]){const _0x51268a='\x20\x20'[_0x4c0aae(0x1ea)](_0x2689d8+_0x4bcd64+0x1),_0x43193d=_0x4e9a7b[_0x4c0aae(0x1cc)]?'\x20'+truncate(_0x4e9a7b[_0x4c0aae(0x1cc)],MAX_COMMAND_LENGTH):'',_0x4e4e89=_0x4e9a7b[_0x4c0aae(0x1f6)]?_0x4c0aae(0x1e1)+WARNING_META[_0x4e9a7b[_0x4c0aae(0x1f6)]][_0x4c0aae(0x1dc)]+(_0x4e9a7b[_0x4c0aae(0x1f7)]?_0x4c0aae(0x1ed)+_0x4e9a7b[_0x4c0aae(0x1f7)]:''):'';_0x22b8ef['push'](''+_0x51268a+_0x4e9a7b[_0x4c0aae(0x1da)]+_0x43193d+_0x4e4e89);}_0x433b66(_0x4e9a7b[_0x4c0aae(0x1d0)],_0x4bcd64+0x1);}};return _0x433b66(_0x10f90a,0x0),_0x22b8ef;}export function formatWarningSummary(_0x18adbc){const _0x54c8f7=a212_0xcfc070,_0x135432=[];for(const _0x2e9251 of Object[_0x54c8f7(0x1de)](WARNING_META)){const _0x44cb86=_0x18adbc[_0x2e9251];if(_0x44cb86>0x0){const {singular:_0x438bb2,plural:_0x1b8b1f}=WARNING_META[_0x2e9251];_0x135432[_0x54c8f7(0x1eb)](_0x44cb86+'\x20'+(_0x44cb86===0x1?_0x438bb2:_0x1b8b1f));}}if(_0x135432['length']===0x0)return null;if(_0x135432['length']===0x1)return _0x54c8f7(0x1e8)+_0x135432[0x0]+'.';if(_0x135432[_0x54c8f7(0x1f4)]===0x2)return _0x54c8f7(0x1e8)+_0x135432[0x0]+'\x20and\x20'+_0x135432[0x1]+'.';const _0x53145d=_0x135432[_0x135432['length']-0x1];return _0x54c8f7(0x1e8)+_0x135432['slice'](0x0,-0x1)[_0x54c8f7(0x1d8)](',\x20')+_0x54c8f7(0x1d9)+_0x53145d+'.';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a213_0x4e613e=a213_0x3c4a;(function(_0x517b8a,_0x4249ca){const _0x3beea7=a213_0x3c4a,_0x32d8aa=_0x517b8a();while(!![]){try{const _0x3210e3=parseInt(_0x3beea7(0x104))/0x1+-parseInt(_0x3beea7(0x112))/0x2*(-parseInt(_0x3beea7(0x10f))/0x3)+parseInt(_0x3beea7(0x100))/0x4*(parseInt(_0x3beea7(0x116))/0x5)+-parseInt(_0x3beea7(0x109))/0x6+-parseInt(_0x3beea7(0xfc))/0x7*(parseInt(_0x3beea7(0x10c))/0x8)+-parseInt(_0x3beea7(0x118))/0x9*(-parseInt(_0x3beea7(0x110))/0xa)+-parseInt(_0x3beea7(0xfe))/0xb*(parseInt(_0x3beea7(0x113))/0xc);if(_0x3210e3===_0x4249ca)break;else _0x32d8aa['push'](_0x32d8aa['shift']());}catch(_0x217c69){_0x32d8aa['push'](_0x32d8aa['shift']());}}}(a213_0x26d6,0xc9444));import{existsSync,readFileSync,writeFileSync}from'fs';function a213_0x26d6(){const _0x5a9dec=['toISOString','workflows','4678980PdCjOZ','last_pushed_revision','root','360GHocrR','parse','tdx.json','642uLtLcN','310gYHiNm','dirname','9936SHFiTy','600972NNjlBK','object','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','20lWLvkf','last_pulled_revision','455526YSOSUV','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','string','39193qyCruT','utf-8','385iKxtgK','workflow_project_id','774252fwXgZq','last_pushed_at','resolve','join','202570cbkOrK','workflow_project','cwd'];a213_0x26d6=function(){return _0x5a9dec;};return a213_0x26d6();}import a213_0x4b2e29 from'path';const TDX_CONFIG_FILE=a213_0x4e613e(0x10e),WORKFLOWS_DIR=a213_0x4e613e(0x108);export function findWorkflowTdxConfigPath(_0x854b20=process[a213_0x4e613e(0x106)]()){const _0x182fdf=a213_0x4e613e;let _0x3156d2=a213_0x4b2e29[_0x182fdf(0x102)](_0x854b20);const _0x165e9c=a213_0x4b2e29[_0x182fdf(0x10d)](_0x3156d2)[_0x182fdf(0x10b)];while(_0x3156d2!==_0x165e9c){const _0x9f3dd5=a213_0x4b2e29[_0x182fdf(0x103)](_0x3156d2,TDX_CONFIG_FILE);if(existsSync(_0x9f3dd5))try{const _0x2fa932=readFileSync(_0x9f3dd5,_0x182fdf(0xfd)),_0x32bb0d=JSON[_0x182fdf(0x10d)](_0x2fa932);if(_0x32bb0d&&typeof _0x32bb0d===_0x182fdf(0x114)&&_0x182fdf(0x105)in _0x32bb0d)return _0x9f3dd5;}catch{}_0x3156d2=a213_0x4b2e29[_0x182fdf(0x111)](_0x3156d2);}return null;}export function loadWorkflowTdxConfig(_0x2616d2){const _0x30426b=a213_0x4e613e,_0x144b22=readFileSync(_0x2616d2,_0x30426b(0xfd));let _0x167168;try{_0x167168=JSON[_0x30426b(0x10d)](_0x144b22);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x2616d2);}if(!_0x167168||typeof _0x167168!==_0x30426b(0x114))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x265977=_0x167168;if(!_0x265977[_0x30426b(0x105)]||typeof _0x265977[_0x30426b(0x105)]!==_0x30426b(0xfb))throw new Error(_0x30426b(0x115));return{'workflow_project':_0x265977[_0x30426b(0x105)],'workflow_project_id':typeof _0x265977['workflow_project_id']==='string'?_0x265977[_0x30426b(0xff)]:undefined,'last_pulled_revision':typeof _0x265977[_0x30426b(0x117)]===_0x30426b(0xfb)?_0x265977[_0x30426b(0x117)]:undefined,'last_pulled_at':typeof _0x265977['last_pulled_at']===_0x30426b(0xfb)?_0x265977['last_pulled_at']:undefined,'last_pushed_revision':typeof _0x265977['last_pushed_revision']===_0x30426b(0xfb)?_0x265977[_0x30426b(0x10a)]:undefined,'last_pushed_at':typeof _0x265977[_0x30426b(0x101)]===_0x30426b(0xfb)?_0x265977[_0x30426b(0x101)]:undefined};}export function findWorkflowTdxConfig(_0x21695d=process['cwd']()){const _0x2e7c9=a213_0x4e613e,_0x3f4940=findWorkflowTdxConfigPath(_0x21695d);if(!_0x3f4940)throw new Error(_0x2e7c9(0xfa));const _0x163214=loadWorkflowTdxConfig(_0x3f4940),_0x4afb11=a213_0x4b2e29[_0x2e7c9(0x111)](_0x3f4940);return{'config':_0x163214,'configPath':_0x3f4940,'configDir':_0x4afb11};}export function tryFindWorkflowTdxConfig(_0x173931){try{return findWorkflowTdxConfig(_0x173931);}catch{return null;}}export function getWorkflowProjectDir(_0x4f1b81,_0x5952e3=process['cwd']()){return a213_0x4b2e29['join'](_0x5952e3,WORKFLOWS_DIR,_0x4f1b81);}export function getWorkflowTdxConfigPath(_0x2662df,_0x1e95c7=process[a213_0x4e613e(0x106)]()){const _0xdbe830=a213_0x4e613e;return a213_0x4b2e29[_0xdbe830(0x103)](getWorkflowProjectDir(_0x2662df,_0x1e95c7),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x3749c8,_0x255fe5,_0x388efa){const _0x20989b=a213_0x4e613e,_0x294545={'workflow_project':_0x3749c8,..._0x255fe5&&{'workflow_project_id':_0x255fe5},..._0x388efa&&{'last_pulled_revision':_0x388efa},'last_pulled_at':new Date()[_0x20989b(0x107)]()};return JSON['stringify'](_0x294545,null,0x2)+'\x0a';}function a213_0x3c4a(_0xcec2aa,_0x569be6){_0xcec2aa=_0xcec2aa-0xfa;const _0x26d67c=a213_0x26d6();let _0x3c4afe=_0x26d67c[_0xcec2aa];return _0x3c4afe;}export function saveWorkflowTdxConfig(_0xfe5678,_0xf85814){const _0x2a751d=a213_0x4e613e,_0x34b0e9=JSON['stringify'](_0xf85814,null,0x2)+'\x0a';writeFileSync(_0xfe5678,_0x34b0e9,_0x2a751d(0xfd));}export function updateWorkflowTdxConfig(_0x150c66,_0x293947){const _0x621083=loadWorkflowTdxConfig(_0x150c66),_0xc30b14={..._0x621083,..._0x293947};saveWorkflowTdxConfig(_0x150c66,_0xc30b14);}
|