@treasuredata/tdx 2026.10.0 → 2026.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +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.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-journey-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.d.ts.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-statusline-command.js.map +1 -1
- package/dist/commands/codex-command.d.ts.map +1 -1
- package/dist/commands/codex-command.js +1 -1
- package/dist/commands/codex-command.js.map +1 -1
- package/dist/commands/command.js +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.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
- 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-readiness-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-in-browser-message-command.js +1 -1
- package/dist/commands/engage-landing-page-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/engage-workspace-assignment-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/opencode-command.d.ts +10 -3
- package/dist/commands/opencode-command.d.ts.map +1 -1
- package/dist/commands/opencode-command.js +1 -1
- package/dist/commands/opencode-command.js.map +1 -1
- package/dist/commands/p13n-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/profiles-command.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +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.js +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.js +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.d.ts +8 -0
- package/dist/commands/upgrade-command.d.ts.map +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/upgrade-command.js.map +1 -1
- package/dist/commands/usage-command.d.ts +10 -0
- package/dist/commands/usage-command.d.ts.map +1 -0
- package/dist/commands/usage-command.js +1 -0
- package/dist/commands/usage-command.js.map +1 -0
- package/dist/commands/use-command.js +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.d.ts +2 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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.js +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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.js +1 -1
- 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.d.ts +5 -4
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +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/auth-token.js +1 -1
- package/dist/sdk/cas/audience-context.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-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.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.js +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.js +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/p13n-studio-api-client.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.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-readiness-workflow.js +1 -1
- package/dist/sdk/engage/campaign-readiness.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/in-browser-message-pull.js +1 -1
- package/dist/sdk/engage/in-browser-message-push.js +1 -1
- package/dist/sdk/engage/in-browser-message-validator.js +1 -1
- package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
- package/dist/sdk/engage/landing-page-init.js +1 -1
- package/dist/sdk/engage/landing-page-public-asset.js +1 -1
- package/dist/sdk/engage/landing-page-pull.js +1 -1
- package/dist/sdk/engage/landing-page-push.js +1 -1
- package/dist/sdk/engage/landing-page-static-site.js +1 -1
- package/dist/sdk/engage/landing-page-validator.js +1 -1
- package/dist/sdk/engage/landing-page-workspace.js +1 -1
- package/dist/sdk/engage/landing-page-yaml.js +1 -1
- package/dist/sdk/engage/list-campaign-schema.js +1 -1
- package/dist/sdk/engage/list-campaign-yaml.js +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.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/in-browser-message-schema.js +1 -1
- package/dist/sdk/engage/types/landing-page-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/workspace-assignments.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +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/codex-usage.d.ts +13 -0
- package/dist/sdk/llm/codex-usage.d.ts.map +1 -0
- package/dist/sdk/llm/codex-usage.js +1 -0
- package/dist/sdk/llm/codex-usage.js.map +1 -0
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/llm/work-models.d.ts +52 -0
- package/dist/sdk/llm/work-models.d.ts.map +1 -0
- package/dist/sdk/llm/work-models.js +1 -0
- package/dist/sdk/llm/work-models.js.map +1 -0
- package/dist/sdk/p13n-studio-errors.js +1 -1
- package/dist/sdk/p13n-studio.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/audience-context.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +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.js +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.js +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.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +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.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +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/td-user.d.ts +3 -0
- package/dist/utils/td-user.d.ts.map +1 -0
- package/dist/utils/td-user.js +1 -0
- package/dist/utils/td-user.js.map +1 -0
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
- package/dist/commands/ai-usage-command-base.d.ts +0 -26
- package/dist/commands/ai-usage-command-base.d.ts.map +0 -1
- package/dist/commands/ai-usage-command-base.js +0 -1
- package/dist/commands/ai-usage-command-base.js.map +0 -1
- package/dist/commands/claude-usage-command.d.ts +0 -19
- package/dist/commands/claude-usage-command.d.ts.map +0 -1
- package/dist/commands/claude-usage-command.js +0 -1
- package/dist/commands/claude-usage-command.js.map +0 -1
- package/dist/commands/opencode-usage-command.d.ts +0 -19
- package/dist/commands/opencode-usage-command.d.ts.map +0 -1
- package/dist/commands/opencode-usage-command.js +0 -1
- package/dist/commands/opencode-usage-command.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x21b082=a30_0x5744;(function(_0x3cdf87,_0x5f238e){const _0x1f03f2=a30_0x5744,_0x5898b4=_0x3cdf87();while(!![]){try{const _0x2cb2fc=parseInt(_0x1f03f2(0xc2))/0x1*(-parseInt(_0x1f03f2(0xec))/0x2)+-parseInt(_0x1f03f2(0xf6))/0x3*(-parseInt(_0x1f03f2(0xd4))/0x4)+-parseInt(_0x1f03f2(0xf0))/0x5+parseInt(_0x1f03f2(0xe8))/0x6*(-parseInt(_0x1f03f2(0xc5))/0x7)+parseInt(_0x1f03f2(0xed))/0x8*(parseInt(_0x1f03f2(0xe9))/0x9)+parseInt(_0x1f03f2(0xde))/0xa*(-parseInt(_0x1f03f2(0xd3))/0xb)+-parseInt(_0x1f03f2(0xd9))/0xc*(-parseInt(_0x1f03f2(0xea))/0xd);if(_0x2cb2fc===_0x5f238e)break;else _0x5898b4['push'](_0x5898b4['shift']());}catch(_0x1ef558){_0x5898b4['push'](_0x5898b4['shift']());}}}(a30_0x2f09,0x6d38d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a30_0x2f09(){const _0x47ebc2=['verbose','\x20=\x20','workspace','cyan','\x20unchanged\x20files','absolutePath','\x20files\x20to\x20','Pulling\x20templates\x20from\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20All\x20files\x20are\x20up\x20to\x20date','name','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>','169TxATXa','description','session','77AzrYfI','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','templates','\x0aChanges\x20to\x20\x27','config','targetDir','hasChanges','execute','No\x20templates\x20found\x20in\x20workspace\x20\x27','\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','workspaceName','utf-8','dim','59389lNWutg','18340OQfZrB','Workspace\x20is\x20required.','filter','length','Aborted.','22300284wFxMxY','counts','-\x20no\x20files\x20written','\x20files?','\x27...','1420GnNzhz','yellow','dryRun','dirname','yes','\x0aError:','green','relativePath','\x20new\x20files','engage_workspace','285234xmeyVa','18frsIku','13aXRFQX','diff','9364VqjyHo','1101840gWelPq','Write\x20','isNew','1764770qPxgYE','files','\x0aPull\x20summary\x20for\x20workspace\x20\x27','cwd','setPhase','data','489NsRiVt','repeat','✔\x20Context\x20set:\x20'];a30_0x2f09=function(){return _0x47ebc2;};return a30_0x2f09();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a30_0x5744(_0x1899ec,_0x3c5ee4){_0x1899ec=_0x1899ec-0xb8;const _0x2f0900=a30_0x2f09();let _0x57447f=_0x2f0900[_0x1899ec];return _0x57447f;}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a30_0x461156 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x1ea5cb from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';export class EngageTemplatePullCommand extends BaseCommand{['name']='engage:template:pull';[a30_0x21b082(0xc3)]='Pull\x20templates\x20to\x20YAML\x20files';async[a30_0x21b082(0xcc)](_0x3a0ac6){const _0x429f6d=a30_0x21b082,{options:_0x4b5b34,args:_0x475f0a,tdx:_0x22bf70}=_0x3a0ac6,_0x47e4e2=_0x4b5b34,_0x3caa19=await resolveWorkspaceName(_0x475f0a[0x0],_0x47e4e2);if(!_0x3caa19)return console['error'](a30_0x461156[_0x429f6d(0xdf)](_0x429f6d(0xd5))),console[_0x429f6d(0xc0)](_0x429f6d(0xce)),console[_0x429f6d(0xc0)](_0x429f6d(0xc1)),console['error']('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;const _0x407b6b=await withProgressSpinner(_0x429f6d(0xbc)+_0x3caa19+_0x429f6d(0xdd),_0x1cb3ee=>pullTemplates({'engage':_0x22bf70['engage']},_0x3caa19,{'templateName':_0x47e4e2[_0x429f6d(0xbf)],'progress':{'update':_0x53b666=>{const _0x145266=_0x429f6d;_0x1cb3ee[_0x145266(0xf4)](_0x53b666);}}}),{'verbose':_0x47e4e2[_0x429f6d(0xf9)]}),_0x27d0b3=_0x407b6b[_0x429f6d(0xf5)];if(_0x27d0b3[_0x429f6d(0xda)][_0x429f6d(0xc7)]===0x0)return console[_0x429f6d(0xc0)](a30_0x461156['yellow'](_0x429f6d(0xcd)+_0x27d0b3[_0x429f6d(0xd0)]+'\x27')),0x0;const _0x59bfc9=_0x27d0b3[_0x429f6d(0xf1)][_0x429f6d(0xd6)](_0x16cda3=>_0x16cda3['isNew']),_0x3dbcfb=_0x27d0b3[_0x429f6d(0xf1)][_0x429f6d(0xd6)](_0x41e6df=>!_0x41e6df[_0x429f6d(0xef)]&&_0x41e6df[_0x429f6d(0xcb)]),_0x3d67e5=_0x27d0b3[_0x429f6d(0xf1)][_0x429f6d(0xd6)](_0x3033f1=>!_0x3033f1[_0x429f6d(0xef)]&&!_0x3033f1[_0x429f6d(0xcb)]);console[_0x429f6d(0xc0)](_0x429f6d(0xf2)+_0x27d0b3['workspaceName']+'\x27:'),console[_0x429f6d(0xc0)]('\x20\x20'+a30_0x461156[_0x429f6d(0xb8)](_0x27d0b3['counts']['templates']+'\x20templates')),console[_0x429f6d(0xc0)]('\x20\x20'+a30_0x461156[_0x429f6d(0xe4)]('+\x20'+_0x59bfc9['length']+_0x429f6d(0xe6))),console[_0x429f6d(0xc0)]('\x20\x20'+a30_0x461156[_0x429f6d(0xdf)]('~\x20'+_0x3dbcfb['length']+'\x20changed\x20files')),console['error']('\x20\x20'+a30_0x461156[_0x429f6d(0xd2)]('=\x20'+_0x3d67e5[_0x429f6d(0xd7)]+_0x429f6d(0xb9))),console['error']('\x20\x20Target:\x20'+a30_0x461156[_0x429f6d(0xb8)](_0x27d0b3[_0x429f6d(0xca)])+'\x0a');if(_0x3dbcfb['length']>0x0)for(const _0x12c6e7 of _0x3dbcfb){console[_0x429f6d(0xc0)](_0x429f6d(0xc8)+_0x12c6e7[_0x429f6d(0xe5)]+'\x27:'),console[_0x429f6d(0xc0)]('\u2500'[_0x429f6d(0xf7)](0x3c)),console[_0x429f6d(0xc0)](_0x12c6e7[_0x429f6d(0xeb)]),console[_0x429f6d(0xc0)]('\u2500'['repeat'](0x3c));}if(_0x47e4e2[_0x429f6d(0xe0)])return console[_0x429f6d(0xc0)](a30_0x461156[_0x429f6d(0xdf)](_0x429f6d(0xcf))),0x0;if(_0x59bfc9[_0x429f6d(0xd7)]===0x0&&_0x3dbcfb[_0x429f6d(0xd7)]===0x0)return console[_0x429f6d(0xc0)](a30_0x461156['green'](_0x429f6d(0xbe))),saveSessionContext({'engage_workspace':_0x27d0b3[_0x429f6d(0xd0)]},_0x47e4e2[_0x429f6d(0xc4)]),0x0;if(!_0x47e4e2[_0x429f6d(0xe2)]){if(!isInteractive())return console[_0x429f6d(0xc0)](a30_0x461156['red'](_0x429f6d(0xe3)),_0x429f6d(0xc6)),console[_0x429f6d(0xc0)](a30_0x461156[_0x429f6d(0xd2)](_0x429f6d(0xbd))),0x1;const _0x1ff219=await confirmKey(_0x429f6d(0xee)+(_0x59bfc9[_0x429f6d(0xd7)]+_0x3dbcfb[_0x429f6d(0xd7)])+_0x429f6d(0xdc));if(!_0x1ff219)return console[_0x429f6d(0xc0)](a30_0x461156['yellow'](_0x429f6d(0xd8)),_0x429f6d(0xdb)),0x1;}for(const _0x5ca6b4 of _0x27d0b3[_0x429f6d(0xf1)]){if(_0x5ca6b4['isNew']||_0x5ca6b4['hasChanges']){const _0x3bcaa4=a30_0x1ea5cb[_0x429f6d(0xe1)](_0x5ca6b4[_0x429f6d(0xba)]);!existsSync(_0x3bcaa4)&&mkdirSync(_0x3bcaa4,{'recursive':!![]}),writeFileSync(_0x5ca6b4[_0x429f6d(0xba)],_0x5ca6b4['content'],_0x429f6d(0xd1));}}return console['error'](a30_0x461156[_0x429f6d(0xe4)]('✔\x20Pulled\x20'+(_0x59bfc9[_0x429f6d(0xd7)]+_0x3dbcfb[_0x429f6d(0xd7)])+_0x429f6d(0xbb)+_0x27d0b3[_0x429f6d(0xca)])),saveSessionContext({'engage_workspace':_0x27d0b3['workspaceName']},_0x47e4e2[_0x429f6d(0xc4)]),console[_0x429f6d(0xc0)](a30_0x461156['green'](_0x429f6d(0xf8)+a30_0x461156[_0x429f6d(0xd2)](_0x429f6d(0xe7))+_0x429f6d(0xfa)+a30_0x461156[_0x429f6d(0xb8)](_0x27d0b3['workspaceName']))),0x0;}}async function resolveWorkspaceName(_0x4aaab0,_0x3b4d3d){const _0x5b23b9=a30_0x21b082;if(_0x4aaab0)return _0x4aaab0;if(_0x3b4d3d[_0x5b23b9(0xfb)])return _0x3b4d3d[_0x5b23b9(0xfb)];const _0x3482b3=tryFindTdxConfig(process[_0x5b23b9(0xf3)]());if(_0x3482b3?.[_0x5b23b9(0xc9)][_0x5b23b9(0xe7)])return _0x3482b3[_0x5b23b9(0xc9)][_0x5b23b9(0xe7)];const _0x3d4771=loadSessionContext(_0x3b4d3d[_0x5b23b9(0xc4)]);if(_0x3d4771?.['engage_workspace'])return _0x3d4771['engage_workspace'];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a33_0x28c5(_0x371888,_0x14e087){_0x371888=_0x371888-0xe4;const _0xdc001a=a33_0xdc00();let _0x28c558=_0xdc001a[_0x371888];return _0x28c558;}const a33_0x1e9db0=a33_0x28c5;(function(_0x4e66e8,_0x3337bc){const _0x5a46c9=a33_0x28c5,_0x43a7bb=_0x4e66e8();while(!![]){try{const _0x5e1f53=parseInt(_0x5a46c9(0xfc))/0x1*(parseInt(_0x5a46c9(0x114))/0x2)+parseInt(_0x5a46c9(0xfd))/0x3+-parseInt(_0x5a46c9(0x105))/0x4+-parseInt(_0x5a46c9(0x108))/0x5+-parseInt(_0x5a46c9(0x120))/0x6+parseInt(_0x5a46c9(0xff))/0x7+parseInt(_0x5a46c9(0xee))/0x8;if(_0x5e1f53===_0x3337bc)break;else _0x43a7bb['push'](_0x43a7bb['shift']());}catch(_0xf4fcf0){_0x43a7bb['push'](_0x43a7bb['shift']());}}}(a33_0xdc00,0xa54b1));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a33_0xdc00(){const _0x2555fa=['\x20templates\x20to\x20update:','Aborted.','templateId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errors','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','Push\x20','resolveWorkspaceId','engage','description','relativePath','53844bgTXvl','data','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','dim','red','cyan','✔\x20Updated\x20','updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','Workspace\x20is\x20required.','path','dryRun','7033968QFmtAU','length','setPhase','action','\x0aPush\x20summary\x20for\x20workspace\x20\x27','✔\x20All\x20templates\x20are\x20up\x20to\x20date','\x27...','\x20\x20\x20\x20','resolve','def','verbose','\x20templates?','1\x20template\x20file:\x20','results','✔\x20Created\x20','site','message','\x0aValidation\x20errors\x20in\x20','error','filter','dirname','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','created','13814368NdDeNP','configDir','Preparing\x20push\x20to\x20workspace\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','execute','config','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','engage:template:push','green','engage_workspace','cwd','31mVkMeu','902040mGLRDe','yellow','4894883kuHkVL','\x20templates','update','workspace','name','yes','3009412xugMGC','session','Resolving\x20references...','4798025HIYxbB'];a33_0xdc00=function(){return _0x2555fa;};return a33_0xdc00();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a33_0x540473 from'chalk';import a33_0x54822c from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a33_0x1e9db0(0xf8);[a33_0x1e9db0(0x112)]=a33_0x1e9db0(0x116);async[a33_0x1e9db0(0xf5)](_0x265854){const _0x5d0314=a33_0x1e9db0,{options:_0xb88789,args:_0xe44a0b,tdx:_0x16d5d5}=_0x265854,_0x15145c=_0xb88789,_0x47d53a=_0xe44a0b[0x0],_0x5d185a=_0x47d53a?a33_0x54822c[_0x5d0314(0x128)](_0x47d53a):undefined,_0x2f8ab9=_0x5d185a?isYamlFile(_0x5d185a):![];let _0x46826f;if(_0x2f8ab9&&_0x5d185a)_0x46826f=a33_0x54822c[_0x5d0314(0xeb)](_0x5d185a);else _0x5d185a?_0x46826f=_0x5d185a:_0x46826f=process[_0x5d0314(0xfb)]();let _0x2be955;const _0x44d563=tryFindTdxConfig(_0x46826f);_0x44d563?.[_0x5d0314(0xf6)][_0x5d0314(0xfa)]&&(_0x2be955=_0x44d563['config']['engage_workspace'],!_0x2f8ab9&&(_0x46826f=_0x44d563[_0x5d0314(0xef)]));_0x15145c[_0x5d0314(0x102)]&&(_0x2be955=_0x15145c[_0x5d0314(0x102)]);if(!_0x2be955){const _0x6dc08c=loadSessionContext(_0x15145c[_0x5d0314(0x106)]);_0x6dc08c?.[_0x5d0314(0xfa)]&&(_0x2be955=_0x6dc08c[_0x5d0314(0xfa)]);}if(!_0x2be955)return console[_0x5d0314(0xe9)](a33_0x540473[_0x5d0314(0xfe)](_0x5d0314(0x11d))),console[_0x5d0314(0xe9)](_0x5d0314(0xf4)),console[_0x5d0314(0xe9)](_0x5d0314(0x11c)),console[_0x5d0314(0xe9)](_0x5d0314(0xec)),console[_0x5d0314(0xe9)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x5081d7;_0x2f8ab9&&_0x5d185a?_0x5081d7=[parseTemplateFile(_0x5d185a,a33_0x54822c[_0x5d0314(0xeb)](_0x5d185a))]:_0x5081d7=discoverAndParseTemplateFiles(_0x46826f);if(_0x5081d7[_0x5d0314(0x121)]===0x0)return console['error'](a33_0x540473[_0x5d0314(0xfe)](_0x5d0314(0xf3)+_0x46826f)),console['error'](a33_0x540473['dim'](_0x5d0314(0x10e))),0x1;const _0x1c3d56=_0x5081d7['length']===0x1?_0x5d0314(0x12c)+_0x5081d7[0x0][_0x5d0314(0x129)][_0x5d0314(0x103)]:_0x5081d7[_0x5d0314(0x121)]+'\x20template\x20files';console['error']('Found\x20'+a33_0x540473[_0x5d0314(0x119)](_0x1c3d56));let _0x15bed4=![];for(const _0x5dcc10 of _0x5081d7){const _0x2d2d77=validateTemplateDef(_0x5dcc10[_0x5d0314(0x129)]);if(!_0x2d2d77['valid']){_0x15bed4=!![],console['error'](a33_0x540473[_0x5d0314(0x118)](_0x5d0314(0xe8)+_0x5dcc10[_0x5d0314(0x113)]+':'));for(const _0x4b6f0a of _0x2d2d77[_0x5d0314(0x10d)]){console['error']('\x20\x20'+a33_0x540473[_0x5d0314(0x118)]('✗')+'\x20'+_0x4b6f0a[_0x5d0314(0x11e)]+':\x20'+_0x4b6f0a[_0x5d0314(0xe7)]);}}for(const _0x44eed9 of _0x2d2d77['warnings']){console['error']('\x20\x20'+a33_0x540473[_0x5d0314(0xfe)]('⚠')+'\x20'+_0x44eed9[_0x5d0314(0x11e)]+':\x20'+_0x44eed9[_0x5d0314(0xe7)]);}}if(_0x15bed4)return console[_0x5d0314(0xe9)](a33_0x540473[_0x5d0314(0x118)](_0x5d0314(0xf7))),0x1;const _0x1c576b=await _0x16d5d5[_0x5d0314(0x111)][_0x5d0314(0x110)](_0x2be955),_0x58b8b9=await withProgressSpinner(_0x5d0314(0xf0)+_0x2be955+_0x5d0314(0x126),_0x4c79ee=>preparePush({'engage':_0x16d5d5[_0x5d0314(0x111)]},_0x5081d7,_0x1c576b,{'progress':{'update':_0x11ab34=>_0x4c79ee[_0x5d0314(0x122)](_0x11ab34)}}),{'verbose':_0x15145c[_0x5d0314(0x12a)]}),_0x499ff6=_0x58b8b9[_0x5d0314(0x115)];await withProgressSpinner(_0x5d0314(0x107),_0x574930=>resolveAndBuildInputs({'engage':_0x16d5d5[_0x5d0314(0x111)]},_0x499ff6,_0x1c576b,{'progress':{'update':_0x3359df=>_0x574930[_0x5d0314(0x122)](_0x3359df)}}),{'verbose':_0x15145c[_0x5d0314(0x12a)]});const _0x2367de=_0x499ff6[_0x5d0314(0xea)](_0x19c851=>_0x19c851['action']==='create'),_0x475606=_0x499ff6[_0x5d0314(0xea)](_0x46a4ff=>_0x46a4ff[_0x5d0314(0x123)]===_0x5d0314(0x101));console[_0x5d0314(0xe9)](_0x5d0314(0x124)+_0x2be955+'\x27:');if(_0x2367de[_0x5d0314(0x121)]>0x0){console['error']('\x20\x20'+a33_0x540473['green']('+\x20'+_0x2367de[_0x5d0314(0x121)]+'\x20new\x20templates:'));for(const _0x32f79d of _0x2367de){console[_0x5d0314(0xe9)]('\x20\x20\x20\x20'+a33_0x540473['green']('+')+'\x20'+_0x32f79d['def']['name']);}}if(_0x475606[_0x5d0314(0x121)]>0x0){console[_0x5d0314(0xe9)]('\x20\x20'+a33_0x540473['yellow']('~\x20'+_0x475606[_0x5d0314(0x121)]+_0x5d0314(0x109)));for(const _0x585a98 of _0x475606){console[_0x5d0314(0xe9)](_0x5d0314(0x127)+a33_0x540473[_0x5d0314(0xfe)]('~')+'\x20'+_0x585a98[_0x5d0314(0x129)][_0x5d0314(0x103)]);}}if(_0x2367de['length']===0x0&&_0x475606[_0x5d0314(0x121)]===0x0)return console[_0x5d0314(0xe9)](a33_0x540473[_0x5d0314(0xf9)](_0x5d0314(0x125))),0x0;if(_0x15145c[_0x5d0314(0x11f)])return console[_0x5d0314(0xe9)](a33_0x540473[_0x5d0314(0xfe)](_0x5d0314(0xf1))),0x0;if(!_0x15145c[_0x5d0314(0x104)]){if(!isInteractive())return console[_0x5d0314(0xe9)](a33_0x540473[_0x5d0314(0x118)]('\x0aError:'),_0x5d0314(0xf2)),console[_0x5d0314(0xe9)](a33_0x540473[_0x5d0314(0x117)](_0x5d0314(0x10c))),0x1;const _0x46d9bf=await confirmKey(_0x5d0314(0x10f)+(_0x2367de[_0x5d0314(0x121)]+_0x475606[_0x5d0314(0x121)])+_0x5d0314(0x12b));if(!_0x46d9bf)return console[_0x5d0314(0xe9)](a33_0x540473['yellow'](_0x5d0314(0x10a)),'-\x20no\x20changes\x20applied'),0x1;}const _0x251f11=await withProgressSpinner('Pushing\x20templates...',_0x50b87f=>executePush({'engage':_0x16d5d5['engage']},_0x499ff6,{'progress':{'update':_0x1304bc=>_0x50b87f[_0x5d0314(0x122)](_0x1304bc)}}),{'verbose':_0x15145c[_0x5d0314(0x12a)]}),_0x3b5374=_0x251f11[_0x5d0314(0x115)];for(const _0xc4aca9 of _0x3b5374[_0x5d0314(0xe4)]){if(_0xc4aca9[_0x5d0314(0x10b)]&&(_0xc4aca9[_0x5d0314(0x123)]===_0x5d0314(0xed)||_0xc4aca9['action']===_0x5d0314(0x11b))){const _0x5682bf=getTemplateUrl(_0x15145c[_0x5d0314(0xe6)],_0x1c576b,_0xc4aca9[_0x5d0314(0x10b)]),_0x3e13db=_0xc4aca9[_0x5d0314(0x123)]===_0x5d0314(0xed)?'+':'~',_0x1384a3=_0xc4aca9[_0x5d0314(0x123)]===_0x5d0314(0xed)?a33_0x540473[_0x5d0314(0xf9)](_0x3e13db):a33_0x540473[_0x5d0314(0xfe)](_0x3e13db);console[_0x5d0314(0xe9)]('\x20\x20'+_0x1384a3+'\x20'+hyperlink(_0xc4aca9['name'],_0x5682bf)+'\x20'+a33_0x540473[_0x5d0314(0x117)](_0x5682bf));}}_0x3b5374['created']>0x0&&console['error'](a33_0x540473[_0x5d0314(0xf9)](_0x5d0314(0xe5)+_0x3b5374[_0x5d0314(0xed)]+'\x20templates'));_0x3b5374[_0x5d0314(0x11b)]>0x0&&console[_0x5d0314(0xe9)](a33_0x540473['green'](_0x5d0314(0x11a)+_0x3b5374[_0x5d0314(0x11b)]+_0x5d0314(0x100)));if(_0x3b5374[_0x5d0314(0x10d)][_0x5d0314(0x121)]>0x0){console[_0x5d0314(0xe9)](a33_0x540473[_0x5d0314(0x118)]('✘\x20'+_0x3b5374[_0x5d0314(0x10d)][_0x5d0314(0x121)]+'\x20errors:'));for(const _0x35ce56 of _0x3b5374[_0x5d0314(0x10d)]){console['error']('\x20\x20'+a33_0x540473[_0x5d0314(0x118)](_0x35ce56[_0x5d0314(0x103)])+':\x20'+_0x35ce56['error']);}}return saveSessionContext({'engage_workspace':_0x2be955},_0x15145c['session']),_0x3b5374[_0x5d0314(0x10d)][_0x5d0314(0x121)]>0x0?0x1:0x0;}}
|
|
1
|
+
function a31_0x21cd(_0x48e304,_0x2e103d){_0x48e304=_0x48e304-0x94;const _0x181f06=a31_0x181f();let _0x21cdf1=_0x181f06[_0x48e304];return _0x21cdf1;}const a31_0x2f053e=a31_0x21cd;(function(_0x2715a3,_0x17bf50){const _0x1e3119=a31_0x21cd,_0x45c778=_0x2715a3();while(!![]){try{const _0x50bc6c=parseInt(_0x1e3119(0xaf))/0x1+parseInt(_0x1e3119(0x96))/0x2*(parseInt(_0x1e3119(0x95))/0x3)+parseInt(_0x1e3119(0xb4))/0x4+parseInt(_0x1e3119(0xaa))/0x5+-parseInt(_0x1e3119(0xc0))/0x6*(-parseInt(_0x1e3119(0x98))/0x7)+parseInt(_0x1e3119(0xd9))/0x8+-parseInt(_0x1e3119(0xac))/0x9*(parseInt(_0x1e3119(0xb8))/0xa);if(_0x50bc6c===_0x17bf50)break;else _0x45c778['push'](_0x45c778['shift']());}catch(_0x34f5a7){_0x45c778['push'](_0x45c778['shift']());}}}(a31_0x181f,0x4ca7b));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';function a31_0x181f(){const _0x3cf083=['✔\x20Updated\x20','dirname','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','486810mIOXKC','description','resolve','length','create','site','\x20template\x20files','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','engage:template:push','filter','\x27...','path','\x20templates\x20to\x20update:','execute','\x0aPush\x20summary\x20for\x20workspace\x20\x27','cwd','def','session','\x20templates','configDir','Pushing\x20templates...','Preparing\x20push\x20to\x20workspace\x20\x27','message','4266776gHJXlf','data','-\x20no\x20changes\x20applied','Push\x20','green','195rocMoP','230BRLBRw','engage_workspace','42GIHNdi','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','templateId','action','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','name','cyan','error','red','errors','\x20new\x20templates:','engage','yellow','created','setPhase','1\x20template\x20file:\x20','dim','warnings','2813780MFKgtD','verbose','8181Ssleik','relativePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','92284hjGGAW','\x20\x20\x20\x20','✔\x20Created\x20','Found\x20','dryRun','695520vddUuN','valid','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','workspace','16970oTcjTX','resolveWorkspaceId','updated','✔\x20All\x20templates\x20are\x20up\x20to\x20date','results'];a31_0x181f=function(){return _0x3cf083;};return a31_0x181f();}import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a31_0x2adbd9 from'chalk';import a31_0x3240ef from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a31_0x2f053e(0x9d)]=a31_0x2f053e(0xca);[a31_0x2f053e(0xc1)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a31_0x2f053e(0xcf)](_0x46e452){const _0x78eecd=a31_0x2f053e,{options:_0x492d92,args:_0x44947f,tdx:_0x17f208}=_0x46e452,_0x3f8f4f=_0x492d92,_0x3ffcc8=_0x44947f[0x0],_0x551190=_0x3ffcc8?a31_0x3240ef[_0x78eecd(0xc2)](_0x3ffcc8):undefined,_0x478e76=_0x551190?isYamlFile(_0x551190):![];let _0xacc61;if(_0x478e76&&_0x551190)_0xacc61=a31_0x3240ef[_0x78eecd(0xbe)](_0x551190);else _0x551190?_0xacc61=_0x551190:_0xacc61=process[_0x78eecd(0xd1)]();let _0x5155d8;const _0x3817a7=tryFindTdxConfig(_0xacc61);_0x3817a7?.['config']['engage_workspace']&&(_0x5155d8=_0x3817a7['config'][_0x78eecd(0x97)],!_0x478e76&&(_0xacc61=_0x3817a7[_0x78eecd(0xd5)]));_0x3f8f4f[_0x78eecd(0xb7)]&&(_0x5155d8=_0x3f8f4f['workspace']);if(!_0x5155d8){const _0x5a7384=loadSessionContext(_0x3f8f4f[_0x78eecd(0xd3)]);_0x5a7384?.[_0x78eecd(0x97)]&&(_0x5155d8=_0x5a7384[_0x78eecd(0x97)]);}if(!_0x5155d8)return console['error'](a31_0x2adbd9['yellow']('Workspace\x20is\x20required.')),console[_0x78eecd(0x9f)]('\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file'),console[_0x78eecd(0x9f)](_0x78eecd(0xae)),console[_0x78eecd(0x9f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console[_0x78eecd(0x9f)](_0x78eecd(0xc9)),0x1;let _0x52c0cf;_0x478e76&&_0x551190?_0x52c0cf=[parseTemplateFile(_0x551190,a31_0x3240ef[_0x78eecd(0xbe)](_0x551190))]:_0x52c0cf=discoverAndParseTemplateFiles(_0xacc61);if(_0x52c0cf[_0x78eecd(0xc3)]===0x0)return console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0xa4)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0xacc61)),console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0xa8)](_0x78eecd(0x9c))),0x1;const _0x135e3e=_0x52c0cf[_0x78eecd(0xc3)]===0x1?_0x78eecd(0xa7)+_0x52c0cf[0x0]['def'][_0x78eecd(0x9d)]:_0x52c0cf[_0x78eecd(0xc3)]+_0x78eecd(0xc6);console[_0x78eecd(0x9f)](_0x78eecd(0xb2)+a31_0x2adbd9[_0x78eecd(0x9e)](_0x135e3e));let _0x311cd=![];for(const _0x45243e of _0x52c0cf){const _0x5a41ca=validateTemplateDef(_0x45243e['def']);if(!_0x5a41ca[_0x78eecd(0xb5)]){_0x311cd=!![],console[_0x78eecd(0x9f)](a31_0x2adbd9['red']('\x0aValidation\x20errors\x20in\x20'+_0x45243e[_0x78eecd(0xad)]+':'));for(const _0x58936b of _0x5a41ca['errors']){console[_0x78eecd(0x9f)]('\x20\x20'+a31_0x2adbd9[_0x78eecd(0xa0)]('✗')+'\x20'+_0x58936b[_0x78eecd(0xcd)]+':\x20'+_0x58936b['message']);}}for(const _0x1354a8 of _0x5a41ca[_0x78eecd(0xa9)]){console[_0x78eecd(0x9f)]('\x20\x20'+a31_0x2adbd9[_0x78eecd(0xa4)]('⚠')+'\x20'+_0x1354a8[_0x78eecd(0xcd)]+':\x20'+_0x1354a8[_0x78eecd(0xd8)]);}}if(_0x311cd)return console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0xa0)](_0x78eecd(0xbf))),0x1;const _0x2c321e=await _0x17f208[_0x78eecd(0xa3)][_0x78eecd(0xb9)](_0x5155d8),_0x1256d8=await withProgressSpinner(_0x78eecd(0xd7)+_0x5155d8+_0x78eecd(0xcc),_0x542a1e=>preparePush({'engage':_0x17f208[_0x78eecd(0xa3)]},_0x52c0cf,_0x2c321e,{'progress':{'update':_0x55b792=>_0x542a1e['setPhase'](_0x55b792)}}),{'verbose':_0x3f8f4f[_0x78eecd(0xab)]}),_0x569b4b=_0x1256d8['data'];await withProgressSpinner('Resolving\x20references...',_0x1f2d33=>resolveAndBuildInputs({'engage':_0x17f208[_0x78eecd(0xa3)]},_0x569b4b,_0x2c321e,{'progress':{'update':_0x149239=>_0x1f2d33[_0x78eecd(0xa6)](_0x149239)}}),{'verbose':_0x3f8f4f[_0x78eecd(0xab)]});const _0x210de0=_0x569b4b[_0x78eecd(0xcb)](_0x137447=>_0x137447[_0x78eecd(0x9b)]===_0x78eecd(0xc4)),_0x41d88f=_0x569b4b[_0x78eecd(0xcb)](_0x339f50=>_0x339f50[_0x78eecd(0x9b)]==='update');console[_0x78eecd(0x9f)](_0x78eecd(0xd0)+_0x5155d8+'\x27:');if(_0x210de0[_0x78eecd(0xc3)]>0x0){console[_0x78eecd(0x9f)]('\x20\x20'+a31_0x2adbd9[_0x78eecd(0x94)]('+\x20'+_0x210de0[_0x78eecd(0xc3)]+_0x78eecd(0xa2)));for(const _0x558935 of _0x210de0){console[_0x78eecd(0x9f)]('\x20\x20\x20\x20'+a31_0x2adbd9['green']('+')+'\x20'+_0x558935[_0x78eecd(0xd2)][_0x78eecd(0x9d)]);}}if(_0x41d88f[_0x78eecd(0xc3)]>0x0){console[_0x78eecd(0x9f)]('\x20\x20'+a31_0x2adbd9[_0x78eecd(0xa4)]('~\x20'+_0x41d88f['length']+_0x78eecd(0xce)));for(const _0x3a003e of _0x41d88f){console[_0x78eecd(0x9f)](_0x78eecd(0xb0)+a31_0x2adbd9['yellow']('~')+'\x20'+_0x3a003e['def']['name']);}}if(_0x210de0[_0x78eecd(0xc3)]===0x0&&_0x41d88f[_0x78eecd(0xc3)]===0x0)return console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0x94)](_0x78eecd(0xbb))),0x0;if(_0x3f8f4f[_0x78eecd(0xb3)])return console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0xa4)](_0x78eecd(0xb6))),0x0;if(!_0x3f8f4f['yes']){if(!isInteractive())return console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0xa0)](_0x78eecd(0xc7)),_0x78eecd(0xc8)),console['error'](a31_0x2adbd9[_0x78eecd(0xa8)](_0x78eecd(0x99))),0x1;const _0x1c2ca1=await confirmKey(_0x78eecd(0xdc)+(_0x210de0[_0x78eecd(0xc3)]+_0x41d88f[_0x78eecd(0xc3)])+'\x20templates?');if(!_0x1c2ca1)return console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0xa4)]('Aborted.'),_0x78eecd(0xdb)),0x1;}const _0x3fd061=await withProgressSpinner(_0x78eecd(0xd6),_0xb1a49b=>executePush({'engage':_0x17f208[_0x78eecd(0xa3)]},_0x569b4b,{'progress':{'update':_0x3b4ebb=>_0xb1a49b[_0x78eecd(0xa6)](_0x3b4ebb)}}),{'verbose':_0x3f8f4f[_0x78eecd(0xab)]}),_0x313cf4=_0x3fd061[_0x78eecd(0xda)];for(const _0x998421 of _0x313cf4[_0x78eecd(0xbc)]){if(_0x998421[_0x78eecd(0x9a)]&&(_0x998421[_0x78eecd(0x9b)]===_0x78eecd(0xa5)||_0x998421['action']===_0x78eecd(0xba))){const _0xaae284=getTemplateUrl(_0x3f8f4f[_0x78eecd(0xc5)],_0x2c321e,_0x998421['templateId']),_0x2c2036=_0x998421[_0x78eecd(0x9b)]===_0x78eecd(0xa5)?'+':'~',_0x5bbcfb=_0x998421[_0x78eecd(0x9b)]===_0x78eecd(0xa5)?a31_0x2adbd9['green'](_0x2c2036):a31_0x2adbd9[_0x78eecd(0xa4)](_0x2c2036);console[_0x78eecd(0x9f)]('\x20\x20'+_0x5bbcfb+'\x20'+hyperlink(_0x998421[_0x78eecd(0x9d)],_0xaae284)+'\x20'+a31_0x2adbd9[_0x78eecd(0xa8)](_0xaae284));}}_0x313cf4[_0x78eecd(0xa5)]>0x0&&console['error'](a31_0x2adbd9[_0x78eecd(0x94)](_0x78eecd(0xb1)+_0x313cf4[_0x78eecd(0xa5)]+_0x78eecd(0xd4)));_0x313cf4[_0x78eecd(0xba)]>0x0&&console[_0x78eecd(0x9f)](a31_0x2adbd9[_0x78eecd(0x94)](_0x78eecd(0xbd)+_0x313cf4[_0x78eecd(0xba)]+_0x78eecd(0xd4)));if(_0x313cf4[_0x78eecd(0xa1)]['length']>0x0){console['error'](a31_0x2adbd9[_0x78eecd(0xa0)]('✘\x20'+_0x313cf4[_0x78eecd(0xa1)][_0x78eecd(0xc3)]+'\x20errors:'));for(const _0xd7effc of _0x313cf4['errors']){console['error']('\x20\x20'+a31_0x2adbd9[_0x78eecd(0xa0)](_0xd7effc[_0x78eecd(0x9d)])+':\x20'+_0xd7effc['error']);}}return saveSessionContext({'engage_workspace':_0x5155d8},_0x3f8f4f[_0x78eecd(0xd3)]),_0x313cf4[_0x78eecd(0xa1)][_0x78eecd(0xc3)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0xa8aa70=a32_0x316f;(function(_0x4fe112,_0x2c049b){const _0x43acd5=a32_0x316f,_0x560ddd=_0x4fe112();while(!![]){try{const _0x41c704=-parseInt(_0x43acd5(0x1be))/0x1+parseInt(_0x43acd5(0x18f))/0x2+parseInt(_0x43acd5(0x1bf))/0x3+-parseInt(_0x43acd5(0x1b3))/0x4*(-parseInt(_0x43acd5(0x19d))/0x5)+-parseInt(_0x43acd5(0x1a4))/0x6+-parseInt(_0x43acd5(0x1a1))/0x7*(parseInt(_0x43acd5(0x191))/0x8)+parseInt(_0x43acd5(0x1aa))/0x9;if(_0x41c704===_0x2c049b)break;else _0x560ddd['push'](_0x560ddd['shift']());}catch(_0xe3839b){_0x560ddd['push'](_0x560ddd['shift']());}}}(a32_0x5466,0x554b2));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a32_0x1d305e from'chalk';import a32_0x3e333e from'path';function a32_0x316f(_0x2814bd,_0x2d08f1){_0x2814bd=_0x2814bd-0x18f;const _0x5466cf=a32_0x5466();let _0x316fd1=_0x5466cf[_0x2814bd];return _0x316fd1;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a32_0x5466(){const _0xbd2642=['5mDHjdx','Error:\x20Directory\x20not\x20found:\x20','validCount','Validate\x20template\x20YAML\x20files','77QwNWRE','\x20warning(s)','execute','364950iTgZHW','error','red','\x20warning(s)\x20found','log','Validation\x20failed:\x20','2740518dilQJy','dim','name','template','hasErrors','\x20template(s)\x20with\x20errors,\x20','.yml','\x20valid','\x20(skipped:\x20','1835412iYCkUY','✔\x20All\x20','relativePath','resolve','green','skippedCount','\x20non-template\x20file(s)\x20skipped','endsWith','\x20error(s)','length','cwd','313902IlFPyB','668658NdUayR','\x20template(s)\x20valid','555610lWXWVk','verbose','392696WSBnpT','reason','engage:template:validate','valid','invalidCount','errors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','description','warningCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warnings','yellow'];a32_0x5466=function(){return _0xbd2642;};return a32_0x5466();}export class EngageTemplateValidateCommand extends BaseCommand{[a32_0xa8aa70(0x1ac)]=a32_0xa8aa70(0x193);[a32_0xa8aa70(0x198)]=a32_0xa8aa70(0x1a0);async[a32_0xa8aa70(0x1a3)](_0x1b440b){const _0xd62c1=a32_0xa8aa70,{options:_0xa5742c,args:_0x5b4326}=_0x1b440b,_0x54783f=_0xa5742c,_0x25512f=_0x5b4326[0x0],_0x3381c0=_0x25512f?a32_0x3e333e[_0xd62c1(0x1b6)](_0x25512f):undefined,_0x4e42cf=_0x3381c0?isYamlFile(_0x3381c0):![];let _0x21e428,_0x21dcff;if(_0x4e42cf&&_0x3381c0)_0x21e428=a32_0x3e333e['dirname'](_0x3381c0),_0x21dcff=_0x3381c0;else _0x3381c0?_0x21e428=_0x3381c0:_0x21e428=process[_0xd62c1(0x1bd)]();if(!_0x21dcff&&!existsSync(_0x21e428))return console['error'](a32_0x1d305e['red'](_0xd62c1(0x19e)+_0x21e428+'\x0a')),0x1;let _0x3f0f3f;if(_0x21dcff){if(!_0x21dcff['endsWith'](_0xd62c1(0x1b0))&&!_0x21dcff[_0xd62c1(0x1ba)]('.yaml'))return console['error'](a32_0x1d305e['red'](_0xd62c1(0x19a)+_0x21dcff+'\x0a')),0x1;_0x3f0f3f=[_0x21dcff];}else _0x3f0f3f=findYamlFiles(_0x21e428);if(_0x3f0f3f[_0xd62c1(0x1bc)]===0x0)return console['error'](a32_0x1d305e[_0xd62c1(0x1a6)](_0xd62c1(0x197)+_0x21e428+'\x0a')),0x1;const _0xae87cd=validateYamlFiles(_0x3f0f3f,_0x21e428,{'filterType':_0xd62c1(0x1ad)}),_0x1bef7f=calculateSummary(_0xae87cd),_0x552290=_0xae87cd['filter'](isValidationResult);if(_0x552290[_0xd62c1(0x1bc)]===0x0)return console[_0xd62c1(0x1a5)](a32_0x1d305e[_0xd62c1(0x19c)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x21e428+'\x0a')),_0x1bef7f[_0xd62c1(0x1b8)]>0x0&&console[_0xd62c1(0x1a5)](a32_0x1d305e[_0xd62c1(0x1ab)]('('+_0x1bef7f[_0xd62c1(0x1b8)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x46a1ba of _0xae87cd){if(!isValidationResult(_0x46a1ba)){_0x54783f[_0xd62c1(0x190)]&&console[_0xd62c1(0x1a8)](a32_0x1d305e[_0xd62c1(0x1ab)]('-\x20'+_0x46a1ba[_0xd62c1(0x1b5)]+_0xd62c1(0x1b2)+_0x46a1ba[_0xd62c1(0x192)]+')'));continue;}const {relativePath:_0x410cb9,source:_0x5bbc31,result:_0x368a8c}=_0x46a1ba;if(_0x368a8c[_0xd62c1(0x194)]&&_0x368a8c[_0xd62c1(0x19b)][_0xd62c1(0x1bc)]===0x0)_0x54783f['verbose']&&console[_0xd62c1(0x1a8)](a32_0x1d305e[_0xd62c1(0x1b7)]('✔\x20'+_0x410cb9));else _0x368a8c[_0xd62c1(0x194)]?(console[_0xd62c1(0x1a8)](a32_0x1d305e['yellow']('⚠\x20'+_0x410cb9+':\x20'+_0x368a8c[_0xd62c1(0x19b)][_0xd62c1(0x1bc)]+_0xd62c1(0x1a2))),console[_0xd62c1(0x1a8)](formatValidationResult(_0x368a8c,_0x5bbc31,_0x410cb9))):(console[_0xd62c1(0x1a8)](a32_0x1d305e[_0xd62c1(0x1a6)]('✖\x20'+_0x410cb9+':\x20'+_0x368a8c[_0xd62c1(0x196)][_0xd62c1(0x1bc)]+_0xd62c1(0x1bb))),console[_0xd62c1(0x1a8)](formatValidationResult(_0x368a8c,_0x5bbc31,_0x410cb9)));}return console[_0xd62c1(0x1a8)](''),_0x1bef7f[_0xd62c1(0x1ae)]?(console[_0xd62c1(0x1a8)](a32_0x1d305e[_0xd62c1(0x1a6)](_0xd62c1(0x1a9)+_0x1bef7f[_0xd62c1(0x195)]+_0xd62c1(0x1af)+_0x1bef7f[_0xd62c1(0x19f)]+_0xd62c1(0x1b1))),_0x1bef7f[_0xd62c1(0x199)]>0x0&&console[_0xd62c1(0x1a8)](a32_0x1d305e[_0xd62c1(0x19c)](_0x1bef7f['warningCount']+'\x20warning(s)\x20found')),_0x1bef7f[_0xd62c1(0x1b8)]>0x0&&console['log'](a32_0x1d305e[_0xd62c1(0x1ab)](_0x1bef7f['skippedCount']+_0xd62c1(0x1b9))),0x1):(console[_0xd62c1(0x1a8)](a32_0x1d305e[_0xd62c1(0x1b7)](_0xd62c1(0x1b4)+_0x1bef7f[_0xd62c1(0x19f)]+_0xd62c1(0x1c0))),_0x1bef7f[_0xd62c1(0x199)]>0x0&&console['log'](a32_0x1d305e['yellow'](_0x1bef7f['warningCount']+_0xd62c1(0x1a7))),_0x1bef7f[_0xd62c1(0x1b8)]>0x0&&console[_0xd62c1(0x1a8)](a32_0x1d305e['dim'](_0x1bef7f[_0xd62c1(0x1b8)]+_0xd62c1(0x1b9))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x7a6302=a33_0x952e;(function(_0x55a9a3,_0x5342c4){const _0x181892=a33_0x952e,_0x52be4b=_0x55a9a3();while(!![]){try{const _0x581cd3=-parseInt(_0x181892(0x153))/0x1*(parseInt(_0x181892(0x16f))/0x2)+parseInt(_0x181892(0x152))/0x3*(-parseInt(_0x181892(0x167))/0x4)+parseInt(_0x181892(0x16a))/0x5*(-parseInt(_0x181892(0x159))/0x6)+-parseInt(_0x181892(0x16b))/0x7*(parseInt(_0x181892(0x165))/0x8)+-parseInt(_0x181892(0x15d))/0x9*(parseInt(_0x181892(0x144))/0xa)+-parseInt(_0x181892(0x162))/0xb*(parseInt(_0x181892(0x142))/0xc)+parseInt(_0x181892(0x168))/0xd;if(_0x581cd3===_0x5342c4)break;else _0x52be4b['push'](_0x52be4b['shift']());}catch(_0x1390b0){_0x52be4b['push'](_0x52be4b['shift']());}}}(a33_0xd148,0x67458));import{BaseCommand}from'./command.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';function a33_0xd148(){const _0x4022d6=['Use\x20-y\x20or\x20--yes\x20to\x20apply\x20changes\x20without\x20confirmation','log','814066YQFSsZ','yes','parent-segment\x20attach','56CCNKbJ','data','42292VWMrMs','47245380mYPPhZ','resourceLabel','10SPzkPp','596834AcWhqi','engage:workspace:parent-segment:detach','engage:workspace:parent-segment:attach','Error:\x20Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4krOnLq','workspace','detachWarning','\x27...','Usage:\x20tdx\x20engage\x20workspace\x20','changed','already\x20attached\x20to','execute','email-domain\x20attach','Detach\x20this\x20email\x20send\x20domain\x20from\x20the\x20workspace?\x20Email\x20campaigns\x20using\x20it\x20may\x20no\x20longer\x20be\x20launchable.','84uWytbG','Detaching','110MKCNzE','name','not\x20attached\x20to','Operation\x20cancelled','attach','Detach\x20this\x20Parent\x20Segment\x20from\x20the\x20workspace?\x20Campaigns\x20that\x20target\x20it\x20may\x20no\x20longer\x20be\x20usable.','Parent\x20Segment','Remove\x20an\x20email\x20send\x20domain\x20assignment\x20from\x20a\x20workspace','segment','Error:\x20','commandPath','\x20name\x20or\x20ID\x20is\x20required','email-domain\x20detach','\x20workspace\x20\x27','222drKnUe','164319YkjXLm','updateAssignment','description','Assign\x20a\x20Parent\x20Segment\x20to\x20a\x20workspace','error','Attaching','1892706ZwxzMx','Assign\x20an\x20email\x20send\x20domain\x20to\x20a\x20workspace','engage:workspace:email-domain:detach','Email\x20Domain','289998kguHUO','\x20<name-or-id>\x20--workspace\x20<name>','verbose'];a33_0xd148=function(){return _0x4022d6;};return a33_0xd148();}import{confirm,isInteractive}from'../utils/prompt.js';import{withSpinner}from'../utils/spinner.js';import{updateWorkspaceEmailDomainAssignment,updateWorkspaceParentSegmentAssignment}from'../sdk/engage/workspace-assignments.js';class EngageWorkspaceAssignmentCommand extends BaseCommand{async[a33_0x7a6302(0x176)](_0x181e5f){const _0x46de68=a33_0x7a6302,{options:_0xac19e6,args:_0x58a471,tdx:_0x49c6f9}=_0x181e5f,_0x317668=_0x58a471[0x0];if(!_0x317668)return console[_0x46de68(0x157)](_0x46de68(0x14d)+this[_0x46de68(0x169)]+_0x46de68(0x14f)),console[_0x46de68(0x157)](_0x46de68(0x173)+this[_0x46de68(0x14e)]+_0x46de68(0x15e)),0x1;const _0x31dcd2=await resolveWorkspaceIdFromOptions(_0xac19e6,_0x49c6f9,!![]);if(!this[_0x46de68(0x148)]&&!_0xac19e6[_0x46de68(0x163)]){if(!isInteractive())return console['error'](_0x46de68(0x16e)),console[_0x46de68(0x157)](_0x46de68(0x160)),0x1;const _0x25e78f=await confirm(this[_0x46de68(0x171)]);if(!_0x25e78f)return console['log'](_0x46de68(0x147)),0x0;}const _0x474441=await withSpinner((this[_0x46de68(0x148)]?_0x46de68(0x158):_0x46de68(0x143))+'\x20'+this[_0x46de68(0x169)]+'\x20\x27'+_0x317668+_0x46de68(0x172),()=>this[_0x46de68(0x154)]({'engage':_0x49c6f9['engage'],'segment':_0x49c6f9[_0x46de68(0x14c)],'delivery':_0x49c6f9['delivery']},_0x31dcd2,_0x317668),{'verbose':_0xac19e6[_0x46de68(0x15f)]}),_0x3209b7=this[_0x46de68(0x148)]?'attached\x20to':'detached\x20from',_0x5d2fb0=this[_0x46de68(0x148)]?_0x46de68(0x175):_0x46de68(0x146);return console[_0x46de68(0x161)](_0x474441['data'][_0x46de68(0x174)]?this[_0x46de68(0x169)]+'\x20\x27'+_0x317668+'\x27\x20'+_0x3209b7+_0x46de68(0x151)+_0x474441[_0x46de68(0x166)]['workspace'][_0x46de68(0x145)]+'\x27':this[_0x46de68(0x169)]+'\x20\x27'+_0x317668+'\x27\x20is\x20'+_0x5d2fb0+_0x46de68(0x151)+_0x474441[_0x46de68(0x166)][_0x46de68(0x170)]['name']+'\x27'),0x0;}}export class EngageWorkspaceParentSegmentAttachCommand extends EngageWorkspaceAssignmentCommand{[a33_0x7a6302(0x145)]=a33_0x7a6302(0x16d);[a33_0x7a6302(0x155)]=a33_0x7a6302(0x156);[a33_0x7a6302(0x169)]=a33_0x7a6302(0x14a);[a33_0x7a6302(0x14e)]=a33_0x7a6302(0x164);[a33_0x7a6302(0x148)]=!![];['detachWarning']='';async[a33_0x7a6302(0x154)](_0x485eff,_0x143c65,_0x3d9935){return await updateWorkspaceParentSegmentAssignment(_0x485eff,_0x143c65,_0x3d9935,!![]);}}function a33_0x952e(_0x3df7c5,_0x252ec5){_0x3df7c5=_0x3df7c5-0x142;const _0xd148fb=a33_0xd148();let _0x952e3f=_0xd148fb[_0x3df7c5];return _0x952e3f;}export class EngageWorkspaceParentSegmentDetachCommand extends EngageWorkspaceAssignmentCommand{[a33_0x7a6302(0x145)]=a33_0x7a6302(0x16c);[a33_0x7a6302(0x155)]='Remove\x20a\x20Parent\x20Segment\x20assignment\x20from\x20a\x20workspace';[a33_0x7a6302(0x169)]='Parent\x20Segment';[a33_0x7a6302(0x14e)]='parent-segment\x20detach';[a33_0x7a6302(0x148)]=![];[a33_0x7a6302(0x171)]=a33_0x7a6302(0x149);async['updateAssignment'](_0x3b8a07,_0x935d7b,_0x1c2e0a){return await updateWorkspaceParentSegmentAssignment(_0x3b8a07,_0x935d7b,_0x1c2e0a,![]);}}export class EngageWorkspaceEmailDomainAttachCommand extends EngageWorkspaceAssignmentCommand{[a33_0x7a6302(0x145)]='engage:workspace:email-domain:attach';[a33_0x7a6302(0x155)]=a33_0x7a6302(0x15a);[a33_0x7a6302(0x169)]=a33_0x7a6302(0x15c);[a33_0x7a6302(0x14e)]=a33_0x7a6302(0x177);['attach']=!![];['detachWarning']='';async['updateAssignment'](_0x294d60,_0x30a95c,_0x283ee1){return await updateWorkspaceEmailDomainAssignment(_0x294d60,_0x30a95c,_0x283ee1,!![]);}}export class EngageWorkspaceEmailDomainDetachCommand extends EngageWorkspaceAssignmentCommand{[a33_0x7a6302(0x145)]=a33_0x7a6302(0x15b);[a33_0x7a6302(0x155)]=a33_0x7a6302(0x14b);[a33_0x7a6302(0x169)]=a33_0x7a6302(0x15c);[a33_0x7a6302(0x14e)]=a33_0x7a6302(0x150);[a33_0x7a6302(0x148)]=![];['detachWarning']=a33_0x7a6302(0x178);async[a33_0x7a6302(0x154)](_0x2915e2,_0x4d0d60,_0x74fe10){return await updateWorkspaceEmailDomainAssignment(_0x2915e2,_0x4d0d60,_0x74fe10,![]);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x21d716=a36_0x3022;(function(_0x23a160,_0x8e4e26){const _0x5b1fc8=a36_0x3022,_0x1e0f9a=_0x23a160();while(!![]){try{const _0x4fa07d=parseInt(_0x5b1fc8(0x1ea))/0x1+parseInt(_0x5b1fc8(0x1d6))/0x2*(parseInt(_0x5b1fc8(0x223))/0x3)+parseInt(_0x5b1fc8(0x1fd))/0x4+-parseInt(_0x5b1fc8(0x1e1))/0x5+parseInt(_0x5b1fc8(0x1f4))/0x6+-parseInt(_0x5b1fc8(0x1dc))/0x7*(-parseInt(_0x5b1fc8(0x1df))/0x8)+parseInt(_0x5b1fc8(0x215))/0x9*(-parseInt(_0x5b1fc8(0x1ed))/0xa);if(_0x4fa07d===_0x8e4e26)break;else _0x1e0f9a['push'](_0x1e0f9a['shift']());}catch(_0x2dc95f){_0x1e0f9a['push'](_0x1e0f9a['shift']());}}}(a36_0x1cda,0x644f7));function a36_0x3022(_0x4671d1,_0xf637da){_0x4671d1=_0x4671d1-0x1d6;const _0x1cda65=a36_0x1cda();let _0x302206=_0x1cda65[_0x4671d1];return _0x302206;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';function a36_0x1cda(){const _0x3c779b=['validate','data','start_at','14aarFOo','end_at','...','2547312VvUPRN','trino','843255eZeNjR','job_id','Listing\x20jobs...','length','status','type','Kill\x20a\x20job','args','mo\x20ago','726651hSDxOS','error','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','9502190QoqDZI','show','execute','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','list','h\x20ago','now','4561848UVDbWr','Submitting\x20job...','hive','dim','user_name','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Job\x20type:\x20','success','log','2790700SVexsg','query','name','priority','Cancelled','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Database:\x20','yes','substring','jobType','floor','Get\x20job\x20results','map','join','No\x20SQL\x20statements\x20found\x20in\x20file','Getting\x20job\x20details...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','Submit\x20a\x20job','database','kill','round','\x20jobs','getTime','Getting\x20job\x20results...','27ygCSgl','result','✔\x20Job\x20submitted','job:show','created_at','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','push','site','information_schema','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','\x20job','jobs','debug','Submitting\x20kill\x20request...','573bRKAHN','verbose','\x27\x20to\x20verify\x20the\x20job\x20status','description','INVALID_ARGUMENT','\x20row','m\x20ago','Status\x20filter:\x20','✔\x20Found\x20','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','6374XaOwHI','presto','red'];a36_0x1cda=function(){return _0x3c779b;};return a36_0x1cda();}import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a36_0x2903e1 from'chalk';function formatDuration(_0x46e3df){const _0xcc39bc=a36_0x3022;if(_0x46e3df<0x3c)return _0x46e3df+'s';if(_0x46e3df<0xe10)return Math[_0xcc39bc(0x207)](_0x46e3df/0x3c)+'m\x20'+_0x46e3df%0x3c+'s';const _0x343f38=Math['floor'](_0x46e3df/0xe10),_0x41d3c4=Math[_0xcc39bc(0x207)](_0x46e3df%0xe10/0x3c);return _0x41d3c4>0x0?_0x343f38+'h\x20'+_0x41d3c4+'m':_0x343f38+'h';}function formatRelativeTime(_0x184d26){const _0x21d887=a36_0x3022,_0x49bb4c=Date[_0x21d887(0x1f3)]()-_0x184d26['getTime'](),_0x4138aa=Math[_0x21d887(0x207)](Math['abs'](_0x49bb4c)/0x3e8);if(_0x4138aa<0x3c)return'just\x20now';const _0x129c7f=Math['floor'](_0x4138aa/0x3c);if(_0x129c7f<0x3c)return _0x129c7f+_0x21d887(0x229);const _0xcf4d5f=Math[_0x21d887(0x207)](_0x129c7f/0x3c);if(_0xcf4d5f<0x18)return _0xcf4d5f+_0x21d887(0x1f2);const _0x577cf3=Math[_0x21d887(0x207)](_0xcf4d5f/0x18);if(_0x577cf3<0x1e)return _0x577cf3+'d\x20ago';return Math[_0x21d887(0x207)](_0x577cf3/0x1e)+_0x21d887(0x1e9);}export class JobListCommand extends BaseCommand{[a36_0x21d716(0x1ff)]=a36_0x21d716(0x220);['description']='List\x20jobs';async['execute'](_0x20778d){const _0x295ff2=a36_0x21d716,{options:_0x58415d,tdx:_0x141473}=_0x20778d,_0xee7363=resolveLimit(_0x58415d['limit'],DEFAULT_DISPLAY_LIMIT),_0x5cb45d=_0x58415d['status'];_0x58415d[_0x295ff2(0x224)]&&(console[_0x295ff2(0x1eb)]('Limit:\x20'+_0xee7363+_0x295ff2(0x212)),_0x5cb45d&&console[_0x295ff2(0x1eb)](_0x295ff2(0x22a)+_0x5cb45d));const _0x26a4a1=await withSpinner(_0x295ff2(0x1e3),()=>_0x141473[_0x295ff2(0x220)][_0x295ff2(0x1f1)]({'from':0x0,'to':_0xee7363-0x1,'status':_0x5cb45d}),{'verbose':_0x58415d[_0x295ff2(0x224)]}),_0x3126a4=_0x26a4a1[_0x295ff2(0x1da)];console[_0x295ff2(0x1eb)](_0x295ff2(0x22b)+_0x3126a4[_0x295ff2(0x1e4)]+_0x295ff2(0x21f)+(_0x3126a4['length']!==0x1?'s':''));const _0x448ac2=_0x58415d[_0x295ff2(0x21c)];if(isStructuredFormat(_0x58415d)){const _0x574a57=_0x3126a4[_0x295ff2(0x209)](_0x248675=>{const _0xb1f51=_0x295ff2;let _0x463a38;if(_0x248675[_0xb1f51(0x1db)]&&_0x248675['end_at']){const _0x5bd832=new Date(_0x248675[_0xb1f51(0x1db)])[_0xb1f51(0x213)](),_0x39e6ab=new Date(_0x248675[_0xb1f51(0x1dd)])[_0xb1f51(0x213)]();_0x463a38=Math[_0xb1f51(0x211)]((_0x39e6ab-_0x5bd832)/0x3e8);}return{'job_id':_0x248675[_0xb1f51(0x1e2)],'type':_0x248675[_0xb1f51(0x1e6)]===_0xb1f51(0x1d7)?_0xb1f51(0x1e0):_0x248675[_0xb1f51(0x1e6)],'status':_0x248675[_0xb1f51(0x1e5)],'user_name':_0x248675[_0xb1f51(0x1f8)],'duration_sec':_0x463a38,'created_at':_0x248675[_0xb1f51(0x219)],'started_at':_0x248675[_0xb1f51(0x1db)],'end_at':_0x248675[_0xb1f51(0x1dd)]};});await handleSDKOutput(_0x574a57,_0x58415d);}else for(const _0x25c664 of _0x3126a4){const _0x278925=_0x25c664['status']===_0x295ff2(0x1fb)?a36_0x2903e1['green']:_0x25c664[_0x295ff2(0x1e5)]===_0x295ff2(0x1eb)?a36_0x2903e1[_0x295ff2(0x1d8)]:a36_0x2903e1['dim'],_0x1e6fa8=_0x278925(_0x25c664['status']),_0x1283a3=getJobUrl(_0x448ac2,_0x25c664['job_id']),_0x1fb3d3=hyperlink(_0x25c664[_0x295ff2(0x1e2)],_0x1283a3),_0x596708=a36_0x2903e1[_0x295ff2(0x1f7)](_0x25c664[_0x295ff2(0x1e6)]===_0x295ff2(0x1d7)?'trino':_0x25c664['type']),_0x3a2d07=[];if(_0x25c664['start_at']&&_0x25c664[_0x295ff2(0x1dd)]){const _0x152e17=Math[_0x295ff2(0x211)]((new Date(_0x25c664[_0x295ff2(0x1dd)])['getTime']()-new Date(_0x25c664[_0x295ff2(0x1db)])['getTime']())/0x3e8);_0x3a2d07['push'](formatDuration(_0x152e17));}if(_0x25c664['end_at'])_0x3a2d07[_0x295ff2(0x21b)](formatRelativeTime(new Date(_0x25c664[_0x295ff2(0x1dd)])));else _0x25c664[_0x295ff2(0x1db)]&&_0x3a2d07[_0x295ff2(0x21b)](formatRelativeTime(new Date(_0x25c664[_0x295ff2(0x1db)])));const _0x3f6591=_0x3a2d07[_0x295ff2(0x1e4)]>0x0?a36_0x2903e1['dim']('\x20'+_0x3a2d07[_0x295ff2(0x20a)](',\x20')):'';console[_0x295ff2(0x1fc)]('⚡\x20'+_0x1fb3d3+'\x20'+_0x596708+'\x20'+_0x1e6fa8+_0x3f6591);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a36_0x21d716(0x1ff)]=a36_0x21d716(0x218);[a36_0x21d716(0x226)]='Show\x20job\x20details';[a36_0x21d716(0x1d9)](_0x29ee4d){const _0x41f7c3=a36_0x21d716,_0x4e8b77=_0x29ee4d[_0x41f7c3(0x1e8)][0x0];if(!_0x4e8b77)return _0x41f7c3(0x21e);return undefined;}async[a36_0x21d716(0x1ef)](_0x9a437){const _0x1c1f70=a36_0x21d716,{options:_0x5f057c,args:_0xe64ea5,tdx:_0x4f7e9c}=_0x9a437,_0x2067ef=_0xe64ea5[0x0],_0x6d2a5=await withSpinner(_0x1c1f70(0x20c),()=>_0x4f7e9c[_0x1c1f70(0x220)][_0x1c1f70(0x1ee)](_0x2067ef),{'verbose':_0x5f057c[_0x1c1f70(0x224)]}),_0x555190=_0x6d2a5['data'];let _0x4c4b1;if(_0x555190[_0x1c1f70(0x1db)]&&_0x555190['end_at']){const _0x23a809=new Date(_0x555190['start_at'])[_0x1c1f70(0x213)](),_0x2d3854=new Date(_0x555190[_0x1c1f70(0x1dd)])[_0x1c1f70(0x213)]();_0x4c4b1=Math['round']((_0x2d3854-_0x23a809)/0x3e8);}const _0x13f0f3={'job_id':_0x555190['job_id'],'type':_0x555190[_0x1c1f70(0x1e6)],'status':_0x555190['status'],..._0x555190[_0x1c1f70(0x1f8)]&&{'user_name':_0x555190[_0x1c1f70(0x1f8)]},..._0x4c4b1!==undefined&&{'duration_sec':_0x4c4b1},..._0x555190[_0x1c1f70(0x219)]&&{'created_at':_0x555190['created_at']},..._0x555190[_0x1c1f70(0x1db)]&&{'started_at':_0x555190['start_at']},..._0x555190[_0x1c1f70(0x1dd)]&&{'end_at':_0x555190[_0x1c1f70(0x1dd)]},..._0x555190[_0x1c1f70(0x20f)]&&{'database':_0x555190[_0x1c1f70(0x20f)]},..._0x555190[_0x1c1f70(0x200)]!==undefined&&{'priority':_0x555190[_0x1c1f70(0x200)]},..._0x555190['url']&&{'url':_0x555190['url']},..._0x555190[_0x1c1f70(0x1fe)]&&{'query':_0x555190[_0x1c1f70(0x1fe)]},..._0x555190[_0x1c1f70(0x221)]&&{'debug':_0x555190[_0x1c1f70(0x221)]}};return await handleSingleObjectOutput(_0x13f0f3,_0x5f057c),0x0;}}export class JobKillCommand extends BaseCommand{[a36_0x21d716(0x1ff)]='job:kill';[a36_0x21d716(0x226)]=a36_0x21d716(0x1e7);[a36_0x21d716(0x1d9)](_0x49d142){const _0x4a9d68=a36_0x21d716,_0x293433=_0x49d142[_0x4a9d68(0x1e8)][0x0];if(!_0x293433)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a36_0x21d716(0x1ef)](_0x54b8d9){const _0x15d82f=a36_0x21d716,{options:_0x3f040f,args:_0x2e5a11,tdx:_0x26f1eb}=_0x54b8d9,_0x4b3a2f=_0x2e5a11[0x0];if(!_0x3f040f[_0x15d82f(0x204)]){const _0x149f66=await confirm(_0x15d82f(0x202)+_0x4b3a2f+'?');if(!_0x149f66)return console[_0x15d82f(0x1eb)](_0x15d82f(0x201)),0x0;}return await withSpinner(_0x15d82f(0x222),()=>_0x26f1eb['jobs'][_0x15d82f(0x210)](_0x4b3a2f),{'verbose':_0x3f040f[_0x15d82f(0x224)]}),console[_0x15d82f(0x1eb)](_0x15d82f(0x1ec)+_0x4b3a2f),console[_0x15d82f(0x1eb)](_0x15d82f(0x1f0)+_0x4b3a2f+_0x15d82f(0x225)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a36_0x21d716(0x1ff)]='job:submit';['description']=a36_0x21d716(0x20e);async[a36_0x21d716(0x1ef)](_0x431a9a){const _0x298bdd=a36_0x21d716,{options:_0x3dc983,args:_0x47f77c,tdx:_0x241662}=_0x431a9a,_0x8005ea=_0x3dc983[_0x298bdd(0x206)]||_0x298bdd(0x1e0),_0x565657=_0x3dc983['file'],_0x2f6787=_0x3dc983['database']||_0x298bdd(0x21d),_0x10696d=_0x3dc983[_0x298bdd(0x216)];if(_0x8005ea!=='trino'&&_0x8005ea!==_0x298bdd(0x1f6))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x298bdd(0x21a));let _0x1bffb7;if(_0x565657){if(_0x47f77c[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x298bdd(0x1f9));const _0x5d7594=readSqlStatementsFromFile(_0x565657);if(_0x5d7594[_0x298bdd(0x1e4)]===0x0)throw new SDKError(ErrorCode[_0x298bdd(0x227)],_0x298bdd(0x20b));if(_0x5d7594[_0x298bdd(0x1e4)]>0x1)throw new SDKError(ErrorCode[_0x298bdd(0x227)],_0x298bdd(0x22c));_0x1bffb7=_0x5d7594[0x0];}else{if(!_0x47f77c[0x0])throw new SDKError(ErrorCode[_0x298bdd(0x227)],_0x298bdd(0x20d));_0x1bffb7=_0x47f77c[0x0];}_0x3dc983[_0x298bdd(0x224)]&&(console[_0x298bdd(0x1eb)](_0x298bdd(0x1fa)+_0x8005ea),console[_0x298bdd(0x1eb)](_0x298bdd(0x203)+_0x2f6787),console[_0x298bdd(0x1eb)]('Query:\x20'+_0x1bffb7[_0x298bdd(0x205)](0x0,0x64)+(_0x1bffb7[_0x298bdd(0x1e4)]>0x64?_0x298bdd(0x1de):'')));const _0x158d97=await withSpinner(_0x298bdd(0x1f5),()=>_0x241662['jobs']['submit'](_0x2f6787,_0x1bffb7,_0x8005ea,_0x10696d),{'verbose':_0x3dc983[_0x298bdd(0x224)]}),_0x1ad997=_0x158d97[_0x298bdd(0x1da)];return console[_0x298bdd(0x1eb)](_0x298bdd(0x217)),console['error']('\x20\x20Job\x20ID:\x20'+_0x1ad997['job_id']),await handleSDKOutput([_0x1ad997],_0x3dc983),0x0;}}export class JobResultCommand extends BaseCommand{[a36_0x21d716(0x1ff)]='job:result';['description']=a36_0x21d716(0x208);[a36_0x21d716(0x1d9)](_0x505015){const _0x4c5612=a36_0x21d716,_0x526d68=_0x505015[_0x4c5612(0x1e8)][0x0];if(!_0x526d68)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a36_0x21d716(0x1ef)](_0x575c27){const _0x51d55e=a36_0x21d716,{options:_0x5575ce,args:_0x5d6cfa,tdx:_0x3a81ed}=_0x575c27,_0x59fd35=_0x5d6cfa[0x0],_0xf587f7=await withSpinner(_0x51d55e(0x214),()=>_0x3a81ed['jobs'][_0x51d55e(0x216)](_0x59fd35),{'verbose':_0x5575ce['verbose']}),_0x1a4935=_0xf587f7['data'];return console[_0x51d55e(0x1eb)]('✔\x20Retrieved\x20'+_0x1a4935['length']+_0x51d55e(0x228)+(_0x1a4935['length']!==0x1?'s':'')),await handleSDKOutput(_0x1a4935,_0x5575ce),0x0;}}
|
|
1
|
+
const a34_0x464182=a34_0x5116;function a34_0x316a(){const _0x25014c=['3045ficatz','execute','14066380tXmkQq','debug','args','just\x20now','Database:\x20','d\x20ago','h\x20ago','site','m\x20ago','success','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','priority','\x20job','join','created_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','information_schema','Submitting\x20job...','316jEpElz','9966vUHtFQ','dim','4275090KGYora','job_id','database','presto','error','length','INVALID_ARGUMENT','No\x20SQL\x20statements\x20found\x20in\x20file','Getting\x20job\x20details...','push','map','name','Get\x20job\x20results','jobs','type','trino','✔\x20Found\x20','\x20jobs','status','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Listing\x20jobs...','Show\x20job\x20details','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','hive','Limit:\x20','Cancelled','validate','yes','query','Submit\x20a\x20job','job:show','Getting\x20job\x20results...','9411axZFBK','end_at','round','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','jobType','file','getTime','show','1696CcpYeI','job:result','✔\x20Retrieved\x20','job:submit','result','...','user_name','log','42228KCUOJT','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','data','now','Status\x20filter:\x20','floor','start_at','substring','Job\x20type:\x20','340994SeMWAO','verbose','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','850296WlfThn','abs','description','\x20\x20Job\x20ID:\x20','Query:\x20'];a34_0x316a=function(){return _0x25014c;};return a34_0x316a();}(function(_0x405c60,_0x3dca8a){const _0x40e9c5=a34_0x5116,_0xf28d7e=_0x405c60();while(!![]){try{const _0x5c8817=parseInt(_0x40e9c5(0x169))/0x1+-parseInt(_0x40e9c5(0x166))/0x2+parseInt(_0x40e9c5(0x1a5))/0x3*(parseInt(_0x40e9c5(0x182))/0x4)+parseInt(_0x40e9c5(0x185))/0x5+parseInt(_0x40e9c5(0x183))/0x6*(-parseInt(_0x40e9c5(0x16e))/0x7)+-parseInt(_0x40e9c5(0x155))/0x8*(-parseInt(_0x40e9c5(0x15d))/0x9)+-parseInt(_0x40e9c5(0x170))/0xa;if(_0x5c8817===_0x3dca8a)break;else _0xf28d7e['push'](_0xf28d7e['shift']());}catch(_0x560881){_0xf28d7e['push'](_0xf28d7e['shift']());}}}(a34_0x316a,0x9e3eb));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0xab2a69 from'chalk';function formatDuration(_0x22df94){const _0x1c772d=a34_0x5116;if(_0x22df94<0x3c)return _0x22df94+'s';if(_0x22df94<0xe10)return Math['floor'](_0x22df94/0x3c)+'m\x20'+_0x22df94%0x3c+'s';const _0x6e6ca=Math['floor'](_0x22df94/0xe10),_0x5e30ac=Math[_0x1c772d(0x162)](_0x22df94%0xe10/0x3c);return _0x5e30ac>0x0?_0x6e6ca+'h\x20'+_0x5e30ac+'m':_0x6e6ca+'h';}function formatRelativeTime(_0x3186ec){const _0x34f745=a34_0x5116,_0x551ae6=Date[_0x34f745(0x160)]()-_0x3186ec[_0x34f745(0x153)](),_0x36b118=Math[_0x34f745(0x162)](Math[_0x34f745(0x16a)](_0x551ae6)/0x3e8);if(_0x36b118<0x3c)return _0x34f745(0x173);const _0x3894e3=Math[_0x34f745(0x162)](_0x36b118/0x3c);if(_0x3894e3<0x3c)return _0x3894e3+_0x34f745(0x178);const _0x389105=Math[_0x34f745(0x162)](_0x3894e3/0x3c);if(_0x389105<0x18)return _0x389105+_0x34f745(0x176);const _0x41308d=Math[_0x34f745(0x162)](_0x389105/0x18);if(_0x41308d<0x1e)return _0x41308d+_0x34f745(0x175);return Math[_0x34f745(0x162)](_0x41308d/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a34_0x464182(0x190)]=a34_0x464182(0x192);[a34_0x464182(0x16b)]='List\x20jobs';async[a34_0x464182(0x16f)](_0x146763){const _0x4f2a80=a34_0x464182,{options:_0x1f24bc,tdx:_0x51e46c}=_0x146763,_0x21b728=resolveLimit(_0x1f24bc['limit'],DEFAULT_DISPLAY_LIMIT),_0x595c4f=_0x1f24bc['status'];_0x1f24bc['verbose']&&(console[_0x4f2a80(0x189)](_0x4f2a80(0x19d)+_0x21b728+_0x4f2a80(0x196)),_0x595c4f&&console[_0x4f2a80(0x189)](_0x4f2a80(0x161)+_0x595c4f));const _0x23ec05=await withSpinner(_0x4f2a80(0x199),()=>_0x51e46c[_0x4f2a80(0x192)]['list']({'from':0x0,'to':_0x21b728-0x1,'status':_0x595c4f}),{'verbose':_0x1f24bc[_0x4f2a80(0x167)]}),_0x352281=_0x23ec05[_0x4f2a80(0x15f)];console[_0x4f2a80(0x189)](_0x4f2a80(0x195)+_0x352281[_0x4f2a80(0x18a)]+_0x4f2a80(0x17c)+(_0x352281[_0x4f2a80(0x18a)]!==0x1?'s':''));const _0x4e89b4=_0x1f24bc[_0x4f2a80(0x177)];if(isStructuredFormat(_0x1f24bc)){const _0x11a5ad=_0x352281[_0x4f2a80(0x18f)](_0x1e99bb=>{const _0x59673d=_0x4f2a80;let _0x4e68ca;if(_0x1e99bb[_0x59673d(0x163)]&&_0x1e99bb[_0x59673d(0x1a6)]){const _0x1196f9=new Date(_0x1e99bb[_0x59673d(0x163)])['getTime'](),_0x57856f=new Date(_0x1e99bb[_0x59673d(0x1a6)])[_0x59673d(0x153)]();_0x4e68ca=Math[_0x59673d(0x1a7)]((_0x57856f-_0x1196f9)/0x3e8);}return{'job_id':_0x1e99bb['job_id'],'type':_0x1e99bb[_0x59673d(0x193)]===_0x59673d(0x188)?'trino':_0x1e99bb[_0x59673d(0x193)],'status':_0x1e99bb[_0x59673d(0x197)],'user_name':_0x1e99bb[_0x59673d(0x15b)],'duration_sec':_0x4e68ca,'created_at':_0x1e99bb[_0x59673d(0x17e)],'started_at':_0x1e99bb[_0x59673d(0x163)],'end_at':_0x1e99bb[_0x59673d(0x1a6)]};});await handleSDKOutput(_0x11a5ad,_0x1f24bc);}else for(const _0x46038a of _0x352281){const _0x5422e2=_0x46038a[_0x4f2a80(0x197)]===_0x4f2a80(0x179)?a34_0xab2a69['green']:_0x46038a[_0x4f2a80(0x197)]===_0x4f2a80(0x189)?a34_0xab2a69['red']:a34_0xab2a69[_0x4f2a80(0x184)],_0x5021d9=_0x5422e2(_0x46038a['status']),_0x268192=getJobUrl(_0x4e89b4,_0x46038a[_0x4f2a80(0x186)]),_0x770a86=hyperlink(_0x46038a[_0x4f2a80(0x186)],_0x268192),_0xd4a851=a34_0xab2a69[_0x4f2a80(0x184)](_0x46038a[_0x4f2a80(0x193)]===_0x4f2a80(0x188)?_0x4f2a80(0x194):_0x46038a[_0x4f2a80(0x193)]),_0x442ff2=[];if(_0x46038a['start_at']&&_0x46038a['end_at']){const _0xcd828f=Math['round']((new Date(_0x46038a[_0x4f2a80(0x1a6)])[_0x4f2a80(0x153)]()-new Date(_0x46038a[_0x4f2a80(0x163)])[_0x4f2a80(0x153)]())/0x3e8);_0x442ff2['push'](formatDuration(_0xcd828f));}if(_0x46038a[_0x4f2a80(0x1a6)])_0x442ff2[_0x4f2a80(0x18e)](formatRelativeTime(new Date(_0x46038a[_0x4f2a80(0x1a6)])));else _0x46038a[_0x4f2a80(0x163)]&&_0x442ff2[_0x4f2a80(0x18e)](formatRelativeTime(new Date(_0x46038a[_0x4f2a80(0x163)])));const _0x14b8ce=_0x442ff2[_0x4f2a80(0x18a)]>0x0?a34_0xab2a69[_0x4f2a80(0x184)]('\x20'+_0x442ff2[_0x4f2a80(0x17d)](',\x20')):'';console[_0x4f2a80(0x15c)]('⚡\x20'+_0x770a86+'\x20'+_0xd4a851+'\x20'+_0x5021d9+_0x14b8ce);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a34_0x464182(0x1a3);[a34_0x464182(0x16b)]=a34_0x464182(0x19a);[a34_0x464182(0x19f)](_0x31a031){const _0x501213=a34_0x464182,_0xa39b63=_0x31a031[_0x501213(0x172)][0x0];if(!_0xa39b63)return _0x501213(0x17f);return undefined;}async[a34_0x464182(0x16f)](_0x248366){const _0x3e2103=a34_0x464182,{options:_0x2bd927,args:_0x1e8aa0,tdx:_0x189940}=_0x248366,_0x2cd7ac=_0x1e8aa0[0x0],_0x78458f=await withSpinner(_0x3e2103(0x18d),()=>_0x189940[_0x3e2103(0x192)][_0x3e2103(0x154)](_0x2cd7ac),{'verbose':_0x2bd927[_0x3e2103(0x167)]}),_0xc39616=_0x78458f['data'];let _0x4c77b2;if(_0xc39616['start_at']&&_0xc39616[_0x3e2103(0x1a6)]){const _0x24cdb4=new Date(_0xc39616[_0x3e2103(0x163)])['getTime'](),_0x25af64=new Date(_0xc39616[_0x3e2103(0x1a6)])[_0x3e2103(0x153)]();_0x4c77b2=Math[_0x3e2103(0x1a7)]((_0x25af64-_0x24cdb4)/0x3e8);}const _0x99c806={'job_id':_0xc39616[_0x3e2103(0x186)],'type':_0xc39616[_0x3e2103(0x193)],'status':_0xc39616[_0x3e2103(0x197)],..._0xc39616['user_name']&&{'user_name':_0xc39616[_0x3e2103(0x15b)]},..._0x4c77b2!==undefined&&{'duration_sec':_0x4c77b2},..._0xc39616[_0x3e2103(0x17e)]&&{'created_at':_0xc39616[_0x3e2103(0x17e)]},..._0xc39616['start_at']&&{'started_at':_0xc39616[_0x3e2103(0x163)]},..._0xc39616[_0x3e2103(0x1a6)]&&{'end_at':_0xc39616[_0x3e2103(0x1a6)]},..._0xc39616[_0x3e2103(0x187)]&&{'database':_0xc39616[_0x3e2103(0x187)]},..._0xc39616[_0x3e2103(0x17b)]!==undefined&&{'priority':_0xc39616[_0x3e2103(0x17b)]},..._0xc39616['url']&&{'url':_0xc39616['url']},..._0xc39616['query']&&{'query':_0xc39616[_0x3e2103(0x1a1)]},..._0xc39616['debug']&&{'debug':_0xc39616[_0x3e2103(0x171)]}};return await handleSingleObjectOutput(_0x99c806,_0x2bd927),0x0;}}function a34_0x5116(_0x157b53,_0x4d1f1c){_0x157b53=_0x157b53-0x150;const _0x316a41=a34_0x316a();let _0x51161d=_0x316a41[_0x157b53];return _0x51161d;}export class JobKillCommand extends BaseCommand{[a34_0x464182(0x190)]='job:kill';['description']='Kill\x20a\x20job';[a34_0x464182(0x19f)](_0x4eb9a6){const _0x672cac=a34_0x464182,_0x34249f=_0x4eb9a6[_0x672cac(0x172)][0x0];if(!_0x34249f)return _0x672cac(0x17a);return undefined;}async['execute'](_0x3bb273){const _0x4a3c0a=a34_0x464182,{options:_0x318c97,args:_0x4ccd21,tdx:_0x542291}=_0x3bb273,_0x7eafc8=_0x4ccd21[0x0];if(!_0x318c97[_0x4a3c0a(0x1a0)]){const _0x119648=await confirm(_0x4a3c0a(0x150)+_0x7eafc8+'?');if(!_0x119648)return console[_0x4a3c0a(0x189)](_0x4a3c0a(0x19e)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x542291[_0x4a3c0a(0x192)]['kill'](_0x7eafc8),{'verbose':_0x318c97[_0x4a3c0a(0x167)]}),console[_0x4a3c0a(0x189)](_0x4a3c0a(0x15e)+_0x7eafc8),console[_0x4a3c0a(0x189)](_0x4a3c0a(0x19b)+_0x7eafc8+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a34_0x464182(0x158);[a34_0x464182(0x16b)]=a34_0x464182(0x1a2);async[a34_0x464182(0x16f)](_0x381947){const _0x272b86=a34_0x464182,{options:_0x6e79cd,args:_0x3420ca,tdx:_0x1381c6}=_0x381947,_0x41d882=_0x6e79cd[_0x272b86(0x151)]||_0x272b86(0x194),_0x1669fe=_0x6e79cd[_0x272b86(0x152)],_0x2304d6=_0x6e79cd[_0x272b86(0x187)]||_0x272b86(0x180),_0x3aab10=_0x6e79cd['result'];if(_0x41d882!==_0x272b86(0x194)&&_0x41d882!==_0x272b86(0x19c))throw new SDKError(ErrorCode[_0x272b86(0x18b)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x3a810e;if(_0x1669fe){if(_0x3420ca[0x0])throw new SDKError(ErrorCode[_0x272b86(0x18b)],_0x272b86(0x198));const _0x470147=readSqlStatementsFromFile(_0x1669fe);if(_0x470147[_0x272b86(0x18a)]===0x0)throw new SDKError(ErrorCode[_0x272b86(0x18b)],_0x272b86(0x18c));if(_0x470147[_0x272b86(0x18a)]>0x1)throw new SDKError(ErrorCode[_0x272b86(0x18b)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x3a810e=_0x470147[0x0];}else{if(!_0x3420ca[0x0])throw new SDKError(ErrorCode[_0x272b86(0x18b)],_0x272b86(0x168));_0x3a810e=_0x3420ca[0x0];}_0x6e79cd[_0x272b86(0x167)]&&(console[_0x272b86(0x189)](_0x272b86(0x165)+_0x41d882),console[_0x272b86(0x189)](_0x272b86(0x174)+_0x2304d6),console['error'](_0x272b86(0x16d)+_0x3a810e[_0x272b86(0x164)](0x0,0x64)+(_0x3a810e[_0x272b86(0x18a)]>0x64?_0x272b86(0x15a):'')));const _0x1f5e8c=await withSpinner(_0x272b86(0x181),()=>_0x1381c6[_0x272b86(0x192)]['submit'](_0x2304d6,_0x3a810e,_0x41d882,_0x3aab10),{'verbose':_0x6e79cd[_0x272b86(0x167)]}),_0x15dd8b=_0x1f5e8c['data'];return console[_0x272b86(0x189)]('✔\x20Job\x20submitted'),console[_0x272b86(0x189)](_0x272b86(0x16c)+_0x15dd8b[_0x272b86(0x186)]),await handleSDKOutput([_0x15dd8b],_0x6e79cd),0x0;}}export class JobResultCommand extends BaseCommand{[a34_0x464182(0x190)]=a34_0x464182(0x156);[a34_0x464182(0x16b)]=a34_0x464182(0x191);[a34_0x464182(0x19f)](_0xfe426b){const _0x4f5119=_0xfe426b['args'][0x0];if(!_0x4f5119)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async['execute'](_0x1a16d6){const _0x2da8ae=a34_0x464182,{options:_0x33f4d3,args:_0xa24442,tdx:_0x49f590}=_0x1a16d6,_0x34b6c2=_0xa24442[0x0],_0x2edd9e=await withSpinner(_0x2da8ae(0x1a4),()=>_0x49f590[_0x2da8ae(0x192)][_0x2da8ae(0x159)](_0x34b6c2),{'verbose':_0x33f4d3['verbose']}),_0x30ed82=_0x2edd9e[_0x2da8ae(0x15f)];return console[_0x2da8ae(0x189)](_0x2da8ae(0x157)+_0x30ed82['length']+'\x20row'+(_0x30ed82[_0x2da8ae(0x18a)]!==0x1?'s':'')),await handleSDKOutput(_0x30ed82,_0x33f4d3),0x0;}}
|