@treasuredata/tdx 2026.9.2 → 2026.9.3
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/ai-usage-command-base.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-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +11 -0
- 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/codex-command.js +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.js +1 -1
- package/dist/commands/opencode-usage-command.js +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.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.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.js +1 -1
- 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.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.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.js +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 +1 -0
- 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.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +2 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/proxy/sse-usage-parser.js.map +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/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/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +5 -3
- 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/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/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x1e1424=a52_0x254e;(function(_0xfcbb0,_0x6bed7a){const _0x36d5cc=a52_0x254e,_0x4cc64c=_0xfcbb0();while(!![]){try{const _0x2a4a18=-parseInt(_0x36d5cc(0xb7))/0x1+-parseInt(_0x36d5cc(0x86))/0x2+-parseInt(_0x36d5cc(0xc3))/0x3*(-parseInt(_0x36d5cc(0x8d))/0x4)+parseInt(_0x36d5cc(0xbc))/0x5*(parseInt(_0x36d5cc(0x88))/0x6)+parseInt(_0x36d5cc(0x9b))/0x7*(parseInt(_0x36d5cc(0x81))/0x8)+-parseInt(_0x36d5cc(0x8b))/0x9*(-parseInt(_0x36d5cc(0xc8))/0xa)+parseInt(_0x36d5cc(0xb4))/0xb*(-parseInt(_0x36d5cc(0xc5))/0xc);if(_0x2a4a18===_0x6bed7a)break;else _0x4cc64c['push'](_0x4cc64c['shift']());}catch(_0x311437){_0x4cc64c['push'](_0x4cc64c['shift']());}}}(a52_0x340b,0xc8078));function a52_0x254e(_0x410b54,_0x117bf0){_0x410b54=_0x410b54-0x7a;const _0x340b52=a52_0x340b();let _0x254e1c=_0x340b52[_0x410b54];return _0x254e1c;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a52_0x340b(){const _0xf86e3a=['Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','type','✔\x20Moved\x20segment\x20\x27','map','5GNHXlk','Checking','explainAmbiguousName','\x20\x20(id\x20','error','parentId','\x27,\x20\x27','213zNEyOL','segment','24VuMMsV','\x20condition','toLowerCase','12420580WDiyrM','verbose','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','code','some','Error:\x20\x27','filter','\x20\x20•\x20','\x20segment(s)\x20would\x20be\x20moved.','test','21848Elnkep','Searching\x20the\x20tree...','dryRun','data','cyan','904122yFGGxe','\x27\x20matches\x20','5516358xOSJTu','SEGMENT_NOT_FOUND','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','9FnRrnD','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','53500DjUyoH','Duplicate\x20segments\x20removed\x20(','\x27...','\x20folder\x20\x27','Target\x20folder:\x20','resolveEntitiesInParent','slot','push','[dry-run]\x20No\x20changes\x20made.\x20','execute','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','preserved:','for\x20move\x20to','forEach','1337LMurLb','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','Searching\x20folders\x20for\x20\x27','green','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','Examples:','path','\x27\x20—\x20','folderId','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','Segments:\x20','join','ruleConditionCount','folder','length','rule\x20','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','red','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','get','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','name','description','\x27\x20to\x20folder\x20\x27','8991763XIMkXx','set','Moving','726450nuMduS'];a52_0x340b=function(){return _0xf86e3a;};return a52_0x340b();}import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a52_0x4e9609 from'chalk';export class SegmentMoveCommand extends BaseCommand{[a52_0x1e1424(0xb1)]='segment:move';[a52_0x1e1424(0xb2)]=a52_0x1e1424(0xae);async[a52_0x1e1424(0x96)](_0xc4c70b){const _0x19b689=a52_0x1e1424,{options:_0x14df9e,args:_0x3a9070,tdx:_0x23175e}=_0xc4c70b,_0x3fad66=_0x3a9070,_0x5e83ac=_0x14df9e[_0x19b689(0xa8)];if(_0x3fad66[_0x19b689(0xa9)]===0x0||!_0x5e83ac)return console['error'](a52_0x4e9609[_0x19b689(0xad)](_0x19b689(0x97))),console['error'](_0x19b689(0x8a)),console['error'](_0x19b689(0xa0)),console[_0x19b689(0xc0)](_0x19b689(0x9c)),console['error'](_0x19b689(0xa4)),console['error']('\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)'),console[_0x19b689(0xc0)]('\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.'),0x1;_0x14df9e[_0x19b689(0xc9)]&&(console[_0x19b689(0xc0)](_0x19b689(0xa5)+_0x3fad66[_0x19b689(0xa6)](',\x20')),console['error'](_0x19b689(0x91)+_0x5e83ac));const _0x46ff2b=[...new Set(_0x3fad66)];_0x46ff2b['length']<_0x3fad66[_0x19b689(0xa9)]&&console['error'](a52_0x4e9609['yellow'](_0x19b689(0x8e)+_0x3fad66['length']+'\x20→\x20'+_0x46ff2b[_0x19b689(0xa9)]+').'));const _0x3507df=/^\d+$/,_0x3c09dc=_0x14df9e['parentSegment'],_0x15cae3=[..._0x46ff2b,_0x5e83ac][_0x19b689(0x7b)](_0x3d2e4a=>!_0x3507df['test'](_0x3d2e4a));if(_0x15cae3&&!_0x3c09dc)return console[_0x19b689(0xc0)](a52_0x4e9609['red']('Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a')),console[_0x19b689(0xc0)](_0x19b689(0xb8)),console[_0x19b689(0xc0)](_0x19b689(0xb0)),console[_0x19b689(0xc0)](_0x19b689(0x8c)),0x1;const _0x1091a5=_0x46ff2b['length'],_0x249361=_0x14df9e[_0x19b689(0x83)]===!![];let _0x3cc6ab;try{const _0x296fa1=await withSpinner((_0x249361?_0x19b689(0xbd):_0x19b689(0xb6))+'\x20'+_0x1091a5+'\x20segment'+(_0x1091a5===0x1?'':'s')+'\x20'+((_0x249361?_0x19b689(0x99):'to')+_0x19b689(0x90)+_0x5e83ac+_0x19b689(0x8f)),async()=>{const _0x178177=_0x19b689,_0x41a532=[];_0x46ff2b[_0x178177(0x9a)]((_0x5df17a,_0x2df30e)=>{const _0x554d2b=_0x178177;if(!_0x3507df['test'](_0x5df17a))_0x41a532['push']({'name':_0x5df17a,'expectType':_0x554d2b(0xc4),'slot':_0x2df30e});});if(!_0x3507df[_0x178177(0x80)](_0x5e83ac))_0x41a532[_0x178177(0x94)]({'name':_0x5e83ac,'expectType':_0x178177(0xa8),'slot':-0x1});const _0x234c0d=new Map();if(_0x41a532[_0x178177(0xa9)]>0x0){const _0x548542=await _0x23175e[_0x178177(0xc4)][_0x178177(0x92)](_0x3c09dc,_0x41a532['map'](({name:_0x13f460,expectType:_0xea6d2c})=>({'name':_0x13f460,'expectType':_0xea6d2c})));_0x548542[_0x178177(0x9a)]((_0x4cbeab,_0x57217e)=>_0x234c0d[_0x178177(0xb5)](_0x41a532[_0x57217e][_0x178177(0x93)],_0x4cbeab['id']));}const _0x1493d7=_0x46ff2b[_0x178177(0xbb)]((_0x272dbe,_0x1be24b)=>_0x3507df['test'](_0x272dbe)?_0x272dbe:_0x234c0d['get'](_0x1be24b)),_0x5e90b7=_0x3507df[_0x178177(0x80)](_0x5e83ac)?_0x5e83ac:_0x234c0d[_0x178177(0xaf)](-0x1);return _0x23175e[_0x178177(0xc4)]['moveSegments'](_0x1493d7,_0x5e90b7,_0x249361);},{'verbose':_0x14df9e['verbose']});_0x3cc6ab=_0x296fa1[_0x19b689(0x84)];}catch(_0x40f39b){if(_0x40f39b instanceof SDKError&&_0x40f39b[_0x19b689(0x7a)]===ErrorCode[_0x19b689(0x89)]&&_0x3c09dc)try{if(await this[_0x19b689(0xbe)](_0x23175e,_0x3c09dc,_0x46ff2b,_0x14df9e))return 0x1;}catch{}throw _0x40f39b;}for(const _0x2b9cfe of _0x3cc6ab){const _0x127662=_0x2b9cfe[_0x19b689(0xa7)],_0x3a72c6=_0x19b689(0xaa)+(_0x249361?'has':_0x19b689(0x98))+'\x20'+_0x127662+_0x19b689(0xc6)+(_0x127662===0x1?'':'s');console[_0x19b689(0xc0)](_0x249361?a52_0x4e9609['cyan'](_0x19b689(0xab)+_0x2b9cfe['id']+_0x19b689(0xb3)+_0x2b9cfe['segmentFolderId']+'\x27\x20—\x20'+_0x3a72c6):a52_0x4e9609[_0x19b689(0x9e)](_0x19b689(0xba)+_0x2b9cfe['id']+_0x19b689(0xb3)+_0x2b9cfe['segmentFolderId']+_0x19b689(0xa2)+_0x3a72c6+'\x20(verified\x20by\x20re-read)'));}if(_0x249361)console[_0x19b689(0xc0)](a52_0x4e9609[_0x19b689(0x85)](_0x19b689(0x95)+_0x1091a5+_0x19b689(0x7f)));else _0x3cc6ab[_0x19b689(0xa9)]>0x1&&console[_0x19b689(0xc0)](a52_0x4e9609[_0x19b689(0x9e)]('✔\x20'+_0x3cc6ab[_0x19b689(0xa9)]+_0x19b689(0x9f)));return await handleSDKOutput(_0x3cc6ab,_0x14df9e),0x0;}async['explainAmbiguousName'](_0x262e69,_0x52b692,_0x3b08dd,_0x1f2e96){const _0x3f5987=a52_0x1e1424,_0x210740=_0x3b08dd[_0x3f5987(0x7d)](_0xd38bb8=>!/^\d+$/[_0x3f5987(0x80)](_0xd38bb8)&&!_0xd38bb8['includes']('/'));if(_0x210740[_0x3f5987(0xa9)]===0x0)return![];const _0xc0fe8=await withSpinner(_0x3f5987(0x9d)+_0x210740['join'](_0x3f5987(0xc2))+_0x3f5987(0x8f),()=>_0x262e69[_0x3f5987(0xc4)]['resolvePathToResource'](_0x52b692),{'verbose':_0x1f2e96[_0x3f5987(0xc9)]}),_0x1a8be9=(await withSpinner(_0x3f5987(0x82),()=>_0x262e69['segment']['listRecursive'](_0xc0fe8[_0x3f5987(0x84)][_0x3f5987(0xc1)],_0xc0fe8['data'][_0x3f5987(0xa3)],0x0,0xa),{'verbose':_0x1f2e96[_0x3f5987(0xc9)]}))[_0x3f5987(0x84)];let _0x42e37b=![];for(const _0xc828aa of _0x210740){const _0x44b3e0=searchTreeByName(_0x1a8be9,_0xc828aa)['filter'](_0x5a839b=>_0x5a839b[_0x3f5987(0xb9)]===_0x3f5987(0xc4)&&_0x5a839b[_0x3f5987(0xb1)][_0x3f5987(0xc7)]()===_0xc828aa[_0x3f5987(0xc7)]());if(_0x44b3e0[_0x3f5987(0xa9)]>0x1){_0x42e37b=!![],console['error'](a52_0x4e9609[_0x3f5987(0xad)](_0x3f5987(0x7c)+_0xc828aa+_0x3f5987(0x87)+_0x44b3e0[_0x3f5987(0xa9)]+_0x3f5987(0xca)));for(const _0x169ea0 of _0x44b3e0)console['error'](_0x3f5987(0x7e)+_0x169ea0['path']+'\x20\x20(id\x20'+_0x169ea0['id']+')');}else _0x44b3e0[_0x3f5987(0xa9)]===0x1&&(_0x42e37b=!![],console[_0x3f5987(0xc0)](a52_0x4e9609['red'](_0x3f5987(0x7c)+_0xc828aa+_0x3f5987(0xac))),console['error']('\x20\x20'+_0x44b3e0[0x0][_0x3f5987(0xa1)]+_0x3f5987(0xbf)+_0x44b3e0[0x0]['id']+')'),console[_0x3f5987(0xc0)]('Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).'));}return _0x42e37b;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a53_0x3e8a99=a53_0x221c;function a53_0x5a5f(){const _0x2fcafd=['error','dirname','8JNtBap','3430360ZMzLQb','targetDir','parent_segment','\x20files?','✔\x20Pulled\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','653008cjdDSF','\x27...','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','6216273ksAMHR','length','segment','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','content','\x20activations','\x20versions)','cyan','files','setPhase','Parent\x20segment:\x20','utf-8','site','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','data','708141TFaHri','hasChanges','diff','\x20=\x20','activations','yellow','Pulling\x20segments\x20from\x20\x27','Write\x20','filter','segments','pullSegments','Aborted.','description','isNew','dim','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4530507FKpyGG','journeys','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','✔\x20Context\x20set:\x20','green','\x0aPull\x20summary\x20for\x20\x27','3362250wjMMWr','parentName','-\x20no\x20files\x20written','\x20new\x20files','\x20journeys','parentSegment','resourceName','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','yes','name','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20segments','\x20\x20Target:\x20','855VeHvXY','repeat','no_parent','session','relativePath','\x20files\x20to\x20','3752090JVrjko','counts','red','Target\x20resource:\x20','\x0aChanges\x20to\x20\x27','helpText','\x20unchanged\x20files','absolutePath'];a53_0x5a5f=function(){return _0x2fcafd;};return a53_0x5a5f();}function a53_0x221c(_0xca6786,_0x1bae30){_0xca6786=_0xca6786-0x1d7;const _0x5a5ffc=a53_0x5a5f();let _0x221c1b=_0x5a5ffc[_0xca6786];return _0x221c1b;}(function(_0xcdcf04,_0x274aca){const _0x8b6b78=a53_0x221c,_0x43d1df=_0xcdcf04();while(!![]){try{const _0x2a0eca=-parseInt(_0x8b6b78(0x21c))/0x1+-parseInt(_0x8b6b78(0x201))/0x2+-parseInt(_0x8b6b78(0x1dd))/0x3+parseInt(_0x8b6b78(0x200))/0x4*(-parseInt(_0x8b6b78(0x1f6))/0x5)+-parseInt(_0x8b6b78(0x1e3))/0x6+-parseInt(_0x8b6b78(0x20b))/0x7+parseInt(_0x8b6b78(0x207))/0x8*(parseInt(_0x8b6b78(0x1f0))/0x9);if(_0x2a0eca===_0x274aca)break;else _0x43d1df['push'](_0x43d1df['shift']());}catch(_0x4acb35){_0x43d1df['push'](_0x43d1df['shift']());}}}(a53_0x5a5f,0xd4d32));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a53_0x197e3d from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a53_0x2fa6d5 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a53_0x3e8a99(0x1ec)]='segment:pull';[a53_0x3e8a99(0x1d9)]=a53_0x3e8a99(0x1df);async[a53_0x3e8a99(0x209)](_0x116543){const _0x4b99cc=a53_0x3e8a99,{options:_0x3eeefb,args:_0x58e73b,tdx:_0x5768ff}=_0x116543,_0x4873e6=_0x3eeefb,_0x251d02=await resolveTarget({'arg':_0x58e73b[0x0],'contextParent':_0x3eeefb[_0x4b99cc(0x1e8)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x251d02))return _0x251d02[_0x4b99cc(0x20e)]===_0x4b99cc(0x1f2)?(console['error'](a53_0x197e3d[_0x4b99cc(0x221)](_0x4b99cc(0x206))),console[_0x4b99cc(0x1fe)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x4b99cc(0x20f)),console[_0x4b99cc(0x1fe)](_0x4b99cc(0x21a))):(console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x1f8)]('Error:\x20'+_0x251d02[_0x4b99cc(0x219)]+'\x0a')),_0x251d02[_0x4b99cc(0x1fb)]&&console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x213)](_0x251d02[_0x4b99cc(0x1fb)]))),0x1;const _0x44019a=_0x251d02['parentName'],_0xc823a8=_0x251d02[_0x4b99cc(0x202)],_0x147829=_0x251d02['type']==='file'?_0x251d02[_0x4b99cc(0x1e9)]:undefined;_0x4873e6['verbose']&&(console['error']('Site:\x20'+_0x4873e6[_0x4b99cc(0x218)]),console['error'](_0x4b99cc(0x216)+_0x44019a),_0x147829&&console[_0x4b99cc(0x1fe)](_0x4b99cc(0x1f9)+_0x147829));const _0x499c03=await withProgressSpinner(_0x4b99cc(0x222)+_0x44019a+_0x4b99cc(0x208),_0x4922a1=>_0x5768ff[_0x4b99cc(0x20d)][_0x4b99cc(0x1d7)](_0x44019a,{'targetDir':_0xc823a8,'targetResourceName':_0x147829,'verbose':_0x4873e6['verbose'],'progress':{'update':_0x8bfd5=>{const _0x337952=_0x4b99cc;_0x4922a1[_0x337952(0x215)](_0x8bfd5),_0x4873e6['verbose']&&console[_0x337952(0x1fe)]('\x20\x20'+_0x8bfd5);}}}),{'verbose':_0x4873e6['verbose']}),_0x28e124=_0x499c03[_0x4b99cc(0x21b)];if(_0x28e124[_0x4b99cc(0x1f7)][_0x4b99cc(0x225)]===0x0&&_0x28e124[_0x4b99cc(0x1f7)]['journeys']===0x0)return console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x221)](_0x4b99cc(0x1ea)+_0x28e124[_0x4b99cc(0x1e4)]+'\x27')),0x0;const _0x344fd2=_0x28e124[_0x4b99cc(0x214)][_0x4b99cc(0x224)](_0x3f41c0=>_0x3f41c0[_0x4b99cc(0x1da)]),_0x5aefcf=_0x28e124[_0x4b99cc(0x214)][_0x4b99cc(0x224)](_0x5334a8=>!_0x5334a8[_0x4b99cc(0x1da)]&&_0x5334a8[_0x4b99cc(0x21d)]),_0x8f29ed=_0x28e124[_0x4b99cc(0x214)][_0x4b99cc(0x224)](_0x2ed579=>!_0x2ed579[_0x4b99cc(0x1da)]&&!_0x2ed579[_0x4b99cc(0x21d)]);console[_0x4b99cc(0x1fe)](_0x4b99cc(0x1e2)+_0x28e124['parentName']+'\x27:'),console[_0x4b99cc(0x1fe)]('\x20\x20🎯\x20'+a53_0x197e3d[_0x4b99cc(0x213)](_0x28e124[_0x4b99cc(0x1f7)][_0x4b99cc(0x225)]+_0x4b99cc(0x1ee))+'\x20with\x20'+a53_0x197e3d[_0x4b99cc(0x213)](_0x28e124['counts'][_0x4b99cc(0x220)]+_0x4b99cc(0x211)));if(_0x28e124['counts'][_0x4b99cc(0x1de)]>0x0){const _0x38c00c=_0x28e124[_0x4b99cc(0x1f7)]['journeyVersions']>_0x28e124['counts'][_0x4b99cc(0x1de)]?'\x20('+_0x28e124[_0x4b99cc(0x1f7)]['journeyVersions']+_0x4b99cc(0x212):'';console['error']('\x20\x20🗺️\x20\x20'+a53_0x197e3d[_0x4b99cc(0x213)](_0x28e124[_0x4b99cc(0x1f7)]['journeys']+_0x4b99cc(0x1e7))+a53_0x197e3d[_0x4b99cc(0x1db)](_0x38c00c));}console[_0x4b99cc(0x1fe)]('\x20\x20'+a53_0x197e3d[_0x4b99cc(0x1e1)]('+\x20'+_0x344fd2[_0x4b99cc(0x20c)]+_0x4b99cc(0x1e6))),console[_0x4b99cc(0x1fe)]('\x20\x20'+a53_0x197e3d[_0x4b99cc(0x221)]('~\x20'+_0x5aefcf[_0x4b99cc(0x20c)]+'\x20changed\x20files')),console[_0x4b99cc(0x1fe)]('\x20\x20'+a53_0x197e3d[_0x4b99cc(0x1db)]('=\x20'+_0x8f29ed[_0x4b99cc(0x20c)]+_0x4b99cc(0x1fc))),console[_0x4b99cc(0x1fe)](_0x4b99cc(0x1ef)+a53_0x197e3d[_0x4b99cc(0x213)](_0x28e124[_0x4b99cc(0x202)])+'\x0a');if(_0x5aefcf[_0x4b99cc(0x20c)]>0x0)for(const _0x3031f1 of _0x5aefcf){console[_0x4b99cc(0x1fe)](_0x4b99cc(0x1fa)+_0x3031f1[_0x4b99cc(0x1f4)]+'\x27:'),console[_0x4b99cc(0x1fe)]('─'[_0x4b99cc(0x1f1)](0x3c)),console[_0x4b99cc(0x1fe)](_0x3031f1[_0x4b99cc(0x21e)]),console['error']('─'[_0x4b99cc(0x1f1)](0x3c));}if(_0x4873e6['dryRun'])return console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x221)](_0x4b99cc(0x20a))),0x0;if(_0x344fd2['length']===0x0&&_0x5aefcf[_0x4b99cc(0x20c)]===0x0)return console['error'](a53_0x197e3d[_0x4b99cc(0x1e1)](_0x4b99cc(0x1ed))),saveSessionContext({'parent_segment':_0x28e124[_0x4b99cc(0x1e4)]},_0x4873e6['session']),console['error'](a53_0x197e3d[_0x4b99cc(0x1e1)](_0x4b99cc(0x1e0)+a53_0x197e3d[_0x4b99cc(0x1db)]('parent_segment')+_0x4b99cc(0x21f)+a53_0x197e3d[_0x4b99cc(0x213)](_0x28e124[_0x4b99cc(0x1e4)]))),0x0;if(!_0x4873e6[_0x4b99cc(0x1eb)]){if(!isInteractive())return console[_0x4b99cc(0x1fe)](a53_0x197e3d['red']('\x0aError:'),_0x4b99cc(0x1dc)),console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x1db)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x53c0ed=await confirmKey(_0x4b99cc(0x223)+(_0x344fd2[_0x4b99cc(0x20c)]+_0x5aefcf[_0x4b99cc(0x20c)])+_0x4b99cc(0x204));if(!_0x53c0ed)return console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x221)](_0x4b99cc(0x1d8)),_0x4b99cc(0x1e5)),0x1;}for(const _0x49cf74 of _0x28e124['files']){if(_0x49cf74[_0x4b99cc(0x1da)]||_0x49cf74[_0x4b99cc(0x21d)]){const _0x541779=a53_0x2fa6d5[_0x4b99cc(0x1ff)](_0x49cf74[_0x4b99cc(0x1fd)]);!existsSync(_0x541779)&&mkdirSync(_0x541779,{'recursive':!![]}),writeFileSync(_0x49cf74[_0x4b99cc(0x1fd)],_0x49cf74[_0x4b99cc(0x210)],_0x4b99cc(0x217));}}return console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x1e1)](_0x4b99cc(0x205)+(_0x344fd2[_0x4b99cc(0x20c)]+_0x5aefcf['length'])+_0x4b99cc(0x1f5)+_0x28e124['targetDir'])),saveSessionContext({'parent_segment':_0x28e124[_0x4b99cc(0x1e4)]},_0x4873e6[_0x4b99cc(0x1f3)]),console[_0x4b99cc(0x1fe)](a53_0x197e3d[_0x4b99cc(0x1e1)](_0x4b99cc(0x1e0)+a53_0x197e3d['dim'](_0x4b99cc(0x203))+'\x20=\x20'+a53_0x197e3d['cyan'](_0x28e124[_0x4b99cc(0x1e4)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x176b0d=a54_0x2f30;(function(_0x386f1c,_0x25095e){const _0x224aeb=a54_0x2f30,_0xeaaeee=_0x386f1c();while(!![]){try{const _0x3de886=parseInt(_0x224aeb(0x11d))/0x1+parseInt(_0x224aeb(0x1af))/0x2*(-parseInt(_0x224aeb(0x146))/0x3)+parseInt(_0x224aeb(0x18f))/0x4+-parseInt(_0x224aeb(0x125))/0x5*(parseInt(_0x224aeb(0x1a0))/0x6)+-parseInt(_0x224aeb(0x136))/0x7+parseInt(_0x224aeb(0x15a))/0x8+parseInt(_0x224aeb(0x135))/0x9;if(_0x3de886===_0x25095e)break;else _0xeaaeee['push'](_0xeaaeee['shift']());}catch(_0x232c2d){_0xeaaeee['push'](_0xeaaeee['shift']());}}}(a54_0x4e73,0x27b48));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a54_0x259b91 from'chalk';function a54_0x2f30(_0x454c6e,_0x58e117){_0x454c6e=_0x454c6e-0x119;const _0x4e732d=a54_0x4e73();let _0x2f3049=_0x4e732d[_0x454c6e];return _0x2f3049;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a54_0x4e73(){const _0x5367c8=['\x20unchanged','Fetching\x20connections\x20for\x20name\x20resolution...','dryRun','join','No\x20','journeys','184522XbYFBX','\x20\x20Journeys:\x20','journeyBundleId','unchanged','dim','\x0aPush\x20summary\x20for\x20\x27','map','/j/da/je','10785PkaWpN','\x20YAML\x20files\x20found','add','no_parent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parentFolder','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20to\x20delete','changed','message','listFolders','existingSegment','createdSegmentIds','toString','getMetadataWithCache','\x20new','281340XydjER','1009764VuBPsm','parentSegment','\x20\x20\x20\x20','\x20\x20📊\x20Segments:','folderPath','delete','\x20to\x20update','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20deleted','length','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','description','get','yamlConfig','parent_name','attributes','12VmnzNW','error','setPhase','segment\x20or\x20journey','Scoped\x20to\x20folder:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','toDelete','idToName','type','\x0aValidation\x20failed:','\x20updated','journeyBundleName','(Journey\x20will\x20be\x20deleted)','journeyId','green','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Aborted.','site','Delete\x20journey:','Site:\x20','2305928UyyXRA','segmentFolderId','diff','all','toCreate','targetDir','Resolving\x20parent\x20segment\x20\x27','getJourney','execute','cyan','Delete\x20segment:','created','updatedAt','Parent\x20segment:\x20','listSegments','\x20\x20Activations:\x20','deleted','\x20changes?','isNew','then','resolveParentId','audienceId','Preparing\x20journeys...','Source\x20directory:\x20','connection','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','/e/','getParent','buildUserMaps','.yml','\x0a✔\x20Push\x20complete','updated','journey','/app/ps/','New\x20segment:','Fetching\x20existing\x20data...','Push\x20','data','activations','\x0aError:','push','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','new','\x20to\x20create','filePath','yellow','journeysOnly','Error:\x20','\x20folders\x20to\x20create','Folders\x20to\x20create:','folderId','1223396AyeHAX','\x20created','red','relationships','\x20changed','\x20activations]','Error:\x20Directory\x20not\x20found:\x20','file','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','results','errorCode','segment','filter','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','verbose','792rsihOj','segments','\x20\x20Segments:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','existingJourney','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','folders','/sb/da/esr','repeat','nameToId','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','user','blue','name','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','109132CqMApB','Error\x20parsing\x20YAML:\x20'];a54_0x4e73=function(){return _0x5367c8;};return a54_0x4e73();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a54_0x176b0d(0x1ad)]='segment:push';['description']=a54_0x176b0d(0x1aa);async[a54_0x176b0d(0x162)](_0x33d862){const _0x14523c=a54_0x176b0d,{options:_0x3424cb,args:_0x559594,tdx:_0x58bf16}=_0x33d862,_0x5cb7c0=_0x3424cb,_0x20b21c=await resolveTarget({'arg':_0x559594[0x0],'contextParent':_0x3424cb[_0x14523c(0x137)],'cwd':process[_0x14523c(0x19d)]()});if(!isSuccessfulResolution(_0x20b21c))return _0x20b21c[_0x14523c(0x19a)]===_0x14523c(0x128)?(console[_0x14523c(0x147)](a54_0x259b91['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x14523c(0x147)](_0x14523c(0x13d)),console['error'](_0x14523c(0x19e)),console['error'](_0x14523c(0x198))):(console['error'](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x18b)+_0x20b21c['message']+'\x0a')),_0x20b21c['helpText']&&console['error'](a54_0x259b91[_0x14523c(0x163)](_0x20b21c['helpText']))),0x1;if(_0x20b21c[_0x14523c(0x14e)]===_0x14523c(0x144))return console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x195)+_0x20b21c['targetDir']+'\x0a')),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x1a5))),0x1;const _0xaff5ff=_0x20b21c['parentName'],_0x10735a=_0x20b21c[_0x14523c(0x15f)],_0x5b081b=_0x20b21c[_0x14523c(0x14e)]===_0x14523c(0x196)?_0x20b21c[_0x14523c(0x188)]:undefined,_0x5eb224=getScopedDetails(_0x20b21c),_0x37087c=_0x5eb224?.[_0x14523c(0x173)]??![],_0x2dd484=_0x5eb224?.['scopedFolderPath']??'';if(!existsSync(_0x10735a))return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)]('Error:\x20Directory\x20not\x20found:\x20'+_0x10735a+'\x0a')),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x1a5))),0x1;_0x5cb7c0['verbose']&&(console[_0x14523c(0x147)](_0x14523c(0x159)+_0x5cb7c0['site']),console[_0x14523c(0x147)](_0x14523c(0x167)+_0xaff5ff),console[_0x14523c(0x147)](_0x14523c(0x171)+_0x10735a),_0x37087c&&console[_0x14523c(0x147)](_0x14523c(0x14a)+_0x2dd484));const _0x225942=await withSpinner(_0x14523c(0x160)+_0xaff5ff+'\x27...',()=>_0x58bf16['segment'][_0x14523c(0x16e)](_0xaff5ff),{'verbose':_0x5cb7c0['verbose']}),_0x400fee=_0x225942['data'],{parentSegmentResult:_0x30ed1b,segmentsResult:_0x102cdb,foldersResult:_0x5f077f,journeysWithDetailsResult:_0x37782b,userMaps:_0x2e50c4}=await withSpinner(_0x14523c(0x17f),async()=>{const _0x5cd979=_0x14523c,[_0x54e68e,_0x5c374e,_0x19b7f2,_0x2be1d3,_0x5bf84f]=await Promise[_0x5cd979(0x15d)]([_0x58bf16['segment'][_0x5cd979(0x177)](_0x400fee),_0x58bf16[_0x5cd979(0x19b)][_0x5cd979(0x168)](_0x400fee),_0x58bf16[_0x5cd979(0x19b)][_0x5cd979(0x12f)](_0x400fee),_0x58bf16[_0x5cd979(0x17c)]['listJourneysWithDetailsFromParentSegment'](_0x400fee,{'includeAllVersions':!![]}),_0x58bf16[_0x5cd979(0x1ab)][_0x5cd979(0x178)]()]);return{'parentSegmentResult':_0x54e68e,'segmentsResult':_0x5c374e,'foldersResult':_0x19b7f2,'journeysWithDetailsResult':_0x2be1d3,'userMaps':_0x5bf84f};},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})[_0x14523c(0x16d)](_0x734c25=>_0x734c25[_0x14523c(0x181)]),_0x4e85ee=_0x30ed1b,_0x480462=extractRootFolderId(_0x4e85ee),_0x1ce3fb=_0x102cdb,_0x144d4c=_0x5f077f,{journeys:_0x3244ec,activationStepsById:_0x1a2b82}=_0x37782b,_0x14cc0b=new Map(_0x3244ec[_0x14523c(0x123)](_0x32ca1e=>[_0x32ca1e['id'],_0x32ca1e])),_0x1ced94=_0x3244ec[_0x14523c(0x123)](_0x4b4fbe=>({'id':_0x4b4fbe['id'],'name':_0x4b4fbe['attributes'][_0x14523c(0x1ad)],'journeyBundleName':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x151)]||'','journeyBundleId':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x11f)]||'','versionNumber':_0x4b4fbe[_0x14523c(0x145)]['versionNumber'],'description':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x141)],'state':_0x4b4fbe[_0x14523c(0x145)]['state'],'paused':_0x4b4fbe['attributes']['paused'],'audienceId':_0x4b4fbe['attributes'][_0x14523c(0x16f)],'folderId':_0x4b4fbe[_0x14523c(0x192)]?.[_0x14523c(0x12a)]?.[_0x14523c(0x181)]?.['id'],'createdAt':_0x4b4fbe[_0x14523c(0x145)]['createdAt'],'updatedAt':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x166)]})),{emailToId:_0x180459,idToEmail:_0x559a97}=_0x2e50c4,_0x237bed=await withSpinner(_0x14523c(0x1b2),async()=>{const _0x3a19a9=await _0x58bf16['connection']['list']();return buildConnectionMaps(_0x3a19a9);},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})[_0x14523c(0x16d)](_0xab439d=>_0xab439d[_0x14523c(0x181)]),_0x26cc27=_0x237bed[_0x14523c(0x1a9)],_0x1e07cb=_0x237bed[_0x14523c(0x14d)],_0x8f189f=_0x237bed['nameToType'],_0x5c3de8={'emailToIdMap':_0x180459,'connectionNameToIdMap':_0x26cc27,'connectionNameToTypeMap':_0x8f189f,'getSchema':_0x2c9add=>_0x58bf16[_0x14523c(0x172)]['getOutputSchemaWithCache'](_0x2c9add),'getMetadata':_0x37d9bf=>_0x58bf16[_0x14523c(0x172)][_0x14523c(0x133)](_0x37d9bf)};let {pathToId:_0x17bfe8,idToPath:_0x11aa74}=buildFolderMaps(_0x144d4c);const _0x174115=buildSegmentLookupMap(_0x1ce3fb,_0x11aa74),_0x4c2cd3=buildSegmentNameToIdMap(_0x1ce3fb),_0xfbdfdb=buildJourneyBundleLookupMap(_0x1ced94,_0x11aa74);let _0x4836f3;if(_0x5b081b){if(!_0x5b081b[_0x14523c(0x197)](_0x14523c(0x179))&&!_0x5b081b['endsWith']('.yaml'))return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x175)+_0x5b081b+'\x0a')),0x1;_0x4836f3=[_0x5b081b];}else _0x4836f3=findYamlFiles(_0x10735a);if(_0x4836f3[_0x14523c(0x13f)]===0x0)return console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x1ae)+_0x10735a+'\x0a')),console['error'](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x14b))),0x1;let _0x5b82fc,_0x4032b5;try{const _0x45a3fa=parseAndClassifyYamlFiles(_0x4836f3,_0x10735a,{'skipSegments':_0x5cb7c0[_0x14523c(0x18a)]});_0x5b82fc=_0x45a3fa[_0x14523c(0x1a1)],_0x4032b5=_0x45a3fa['journeys'];const _0x36f93e=validateParsedFiles(_0x45a3fa,_0x10735a);if(_0x36f93e[_0x14523c(0x13f)]>0x0)return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x14f))),console['error'](formatValidationErrors(_0x36f93e)),console['error'](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x185))),0x1;}catch(_0x42c368){return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x1b0)+(_0x42c368 instanceof Error?_0x42c368[_0x14523c(0x12e)]:_0x42c368))),0x1;}if(_0x5b82fc[_0x14523c(0x13f)]===0x0&&_0x4032b5[_0x14523c(0x13f)]===0x0){const _0x46a4dd=_0x5cb7c0[_0x14523c(0x18a)]?_0x14523c(0x17c):_0x14523c(0x149);return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x11b)+_0x46a4dd+_0x14523c(0x126))),0x0;}const _0x4473a4=new Map();_0x1ce3fb[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x1ce3fb,async _0x408d65=>{const _0x153cad=a54_0x2f30,_0x289a2e=await _0x58bf16[_0x153cad(0x19b)]['listActivations'](_0x400fee,_0x408d65['id']);_0x4473a4['set'](_0x408d65['id'],_0x289a2e);});},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]});const {segmentFiles:_0x1acc32,foldersToCreate:_0x46a36e}=await prepareSegmentFiles(_0x5b82fc,{'segmentByFolderAndName':_0x174115,'activationsBySegmentId':_0x4473a4,'folderPathToId':_0x17bfe8,'idToEmailMap':_0x559a97,'connectionIdToNameMap':_0x1e07cb},_0x5c3de8,_0x37087c,_0x2dd484),_0x2ed6e7=_0x5b081b?[]:findSegmentsToDelete(_0x1ce3fb,_0x5b82fc[_0x14523c(0x123)](({yamlConfig:_0x285fb3,folderPath:_0x19c2c6})=>({'yamlConfig':_0x285fb3,'folderPath':resolveTDFolderPath(_0x19c2c6,_0x37087c,_0x2dd484)})),_0x11aa74,_0x2dd484,_0x37087c),{journeyFiles:_0x516161,foldersToCreate:_0x22f2cc}=await withProgressSpinner(_0x14523c(0x170),async _0x5dde6e=>prepareJourneyFiles(_0x4032b5,{'fetchJourney':async _0xd7f77b=>_0x58bf16['journey'][_0x14523c(0x161)](_0xd7f77b[_0x14523c(0x153)]),'journeyBundlesByFolderAndName':_0xfbdfdb,'folderPathToId':_0x17bfe8,'idToEmailMap':_0x559a97,'connectionIdToNameMap':_0x1e07cb,'existingSegments':_0x1ce3fb,'parentId':_0x400fee,'deps':_0x58bf16,'progress':{'update':_0x52a27b=>{const _0x3556db=_0x14523c;_0x5dde6e[_0x3556db(0x148)](_0x52a27b),_0x5cb7c0[_0x3556db(0x19f)]&&console[_0x3556db(0x147)]('\x20\x20'+_0x52a27b);}},'journeyById':_0x14cc0b,'activationStepsById':_0x1a2b82},_0x37087c,_0x2dd484),{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})['then'](_0x213ae3=>_0x213ae3[_0x14523c(0x181)]);for(const _0x390567 of _0x22f2cc){_0x46a36e[_0x14523c(0x127)](_0x390567);}const _0x4d06c5=_0x5b081b?[]:findJourneysToDelete(_0x1ced94,_0x4032b5['map'](({yamlConfig:_0x3e6966,folderPath:_0x2a2457})=>({'yamlConfig':_0x3e6966,'folderPath':resolveTDFolderPath(_0x2a2457,_0x37087c,_0x2dd484)})),_0x11aa74,_0x2dd484,_0x37087c),_0x32a1e8=calculatePushStats(_0x1acc32,_0x516161,_0x46a36e,_0x2ed6e7,_0x4d06c5,!!_0x5cb7c0['delete'],!!_0x5cb7c0[_0x14523c(0x18a)]),_0x2d353c=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x186)],_0x54f7eb=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x12d)],_0x3cedbf=_0x32a1e8['segments'][_0x14523c(0x120)],_0x387ecd=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x14c)],_0xf94e11=_0x32a1e8[_0x14523c(0x1a6)][_0x14523c(0x15e)],_0x4859e8=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x186)],_0x58aefc=_0x32a1e8['journeys'][_0x14523c(0x12d)],_0x2c5765=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x120)],_0x575920=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x14c)],_0x1ba904=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x15d)],_0x5690fe=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x15e)],_0x57a9d1=_0x32a1e8['activations']['toUpdate'],_0x12977=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x14c)];console[_0x14523c(0x147)](_0x14523c(0x122)+_0xaff5ff+'\x27:');_0xf94e11['length']>0x0&&console['error']('\x20\x20'+a54_0x259b91['blue']('📁\x20'+_0xf94e11['length']+_0x14523c(0x18c)));if(!_0x5cb7c0[_0x14523c(0x18a)]){console[_0x14523c(0x147)](_0x14523c(0x139)),console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91['green']('+\x20'+_0x2d353c[_0x14523c(0x13f)]+_0x14523c(0x134))),console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x54f7eb[_0x14523c(0x13f)]+_0x14523c(0x193)));if(_0x387ecd[_0x14523c(0x13f)]>0x0)console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x191)]('-\x20'+_0x387ecd[_0x14523c(0x13f)]+_0x14523c(0x12c)));else _0x2ed6e7[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x13b)]&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x121)](_0x2ed6e7[_0x14523c(0x13f)]+_0x14523c(0x174)));console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x121)]('=\x20'+_0x3cedbf['length']+_0x14523c(0x1b1)));}if(_0x516161[_0x14523c(0x13f)]>0x0||_0x4d06c5[_0x14523c(0x13f)]>0x0){console[_0x14523c(0x147)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91['green']('+\x20'+_0x4859e8[_0x14523c(0x13f)]+_0x14523c(0x134))),console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x58aefc[_0x14523c(0x13f)]+'\x20changed'));if(_0x575920['length']>0x0)console['error']('\x20\x20\x20\x20'+a54_0x259b91['red']('-\x20'+_0x575920['length']+_0x14523c(0x12c)));else _0x4d06c5[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x13b)]&&console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x121)](_0x4d06c5['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x121)]('=\x20'+_0x2c5765[_0x14523c(0x13f)]+_0x14523c(0x1b1)));}_0x1ba904['length']>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&(console[_0x14523c(0x147)](''),console['error']('\x20\x20Activations:'),_0x5690fe[_0x14523c(0x13f)]>0x0&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91['green']('+\x20'+_0x5690fe[_0x14523c(0x13f)]+_0x14523c(0x187))),_0x57a9d1['length']>0x0&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x57a9d1[_0x14523c(0x13f)]+_0x14523c(0x13c))),_0x12977[_0x14523c(0x13f)]>0x0&&console['error'](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x191)]('-\x20'+_0x12977[_0x14523c(0x13f)]+_0x14523c(0x12c))));console[_0x14523c(0x147)]('\x20\x20Source:\x20'+a54_0x259b91[_0x14523c(0x163)](_0x10735a)+'\x0a');if(_0xf94e11[_0x14523c(0x13f)]>0x0){console[_0x14523c(0x147)](_0x14523c(0x18d));for(const _0x4e6165 of _0xf94e11){console[_0x14523c(0x147)]('\x20\x20'+a54_0x259b91['blue']('+')+'\x20'+_0x4e6165);}console['error']('');}if(_0x2d353c['length']>0x0&&!_0x5cb7c0['journeysOnly'])for(const _0x808dd6 of _0x2d353c){const _0x1fd7f2=_0x808dd6['folderPath']?_0x808dd6[_0x14523c(0x13a)]+'/'+_0x808dd6[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x808dd6['yamlConfig'][_0x14523c(0x1ad)],_0x5edf97=_0x808dd6['yamlConfig']['activations']?.[_0x14523c(0x13f)]||0x0,_0x163bcc=_0x5edf97>0x0?a54_0x259b91[_0x14523c(0x121)]('\x20['+_0x5edf97+'\x20activations]'):'';console['error']('\x0a'+a54_0x259b91[_0x14523c(0x154)](_0x14523c(0x17e))+'\x20'+_0x1fd7f2+_0x163bcc),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),_0x808dd6['diff']&&console[_0x14523c(0x147)](_0x808dd6[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x387ecd[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)])for(const _0x74bb7 of _0x387ecd){const _0x116574=_0x74bb7[_0x14523c(0x15b)]?_0x11aa74[_0x14523c(0x142)](_0x74bb7['segmentFolderId'][_0x14523c(0x132)]())||'':'',_0x5501eb=_0x116574?_0x116574+'/'+_0x74bb7[_0x14523c(0x1ad)]:_0x74bb7['name'],_0x38daf4=_0x4473a4[_0x14523c(0x142)](_0x74bb7['id'])||[],_0x2c7a02=_0x38daf4[_0x14523c(0x13f)]>0x0?a54_0x259b91['dim']('\x20['+_0x38daf4['length']+_0x14523c(0x194)):'';console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x164))+'\x20'+_0x5501eb+_0x2c7a02),console['error']('─'[_0x14523c(0x1a8)](0x3c));const _0x2f0c7c=segmentWithActivationsToYaml(_0x74bb7,_0x38daf4,undefined,_0x559a97,_0x1e07cb),_0x26392=segmentToYamlString(_0x2f0c7c),_0x3204da=generateDiff(_0x26392,'');console['error'](formatDiffWithColors(_0x3204da)),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}const _0x1d9d58=_0x1acc32[_0x14523c(0x19c)](_0x362cc6=>!_0x362cc6[_0x14523c(0x16c)]&&_0x362cc6[_0x14523c(0x15c)]);if(_0x1d9d58[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0['journeysOnly'])for(const _0x2eb2c2 of _0x1d9d58){const _0x4c58da=_0x2eb2c2[_0x14523c(0x13a)]?_0x2eb2c2[_0x14523c(0x13a)]+'/'+_0x2eb2c2[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x2eb2c2['yamlConfig'][_0x14523c(0x1ad)];console['error']('\x0a'+a54_0x259b91[_0x14523c(0x189)]('Changes\x20to:')+'\x20'+_0x4c58da),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),console[_0x14523c(0x147)](_0x2eb2c2[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x4859e8[_0x14523c(0x13f)]>0x0)for(const _0x5acc8e of _0x4859e8){const _0x2a184a=_0x5acc8e[_0x14523c(0x13a)]?_0x5acc8e[_0x14523c(0x13a)]+'/'+_0x5acc8e[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x5acc8e['yamlConfig']['name'];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x154)]('New\x20journey:')+'\x20'+_0x2a184a),console[_0x14523c(0x147)]('─'['repeat'](0x3c)),_0x5acc8e[_0x14523c(0x15c)]&&console[_0x14523c(0x147)](_0x5acc8e[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}const _0x43767f=_0x516161[_0x14523c(0x19c)](_0x647519=>!_0x647519[_0x14523c(0x16c)]&&_0x647519[_0x14523c(0x15c)]);if(_0x43767f[_0x14523c(0x13f)]>0x0)for(const _0x1fba90 of _0x43767f){const _0x488a2e=_0x1fba90[_0x14523c(0x13a)]?_0x1fba90[_0x14523c(0x13a)]+'/'+_0x1fba90[_0x14523c(0x143)]['name']:_0x1fba90[_0x14523c(0x143)][_0x14523c(0x1ad)];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x189)]('Changes\x20to\x20journey:')+'\x20'+_0x488a2e),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),console[_0x14523c(0x147)](_0x1fba90[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x575920[_0x14523c(0x13f)]>0x0)for(const _0x40c304 of _0x575920){const _0x45a842=_0x40c304[_0x14523c(0x18e)]?_0x11aa74['get'](_0x40c304[_0x14523c(0x18e)])||'':'',_0x250d9b=_0x45a842?_0x45a842+'/'+_0x40c304['journeyBundleName']:_0x40c304[_0x14523c(0x151)];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x158))+'\x20'+_0x250d9b),console[_0x14523c(0x147)]('─'['repeat'](0x3c)),console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x152))),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x5cb7c0[_0x14523c(0x119)])return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x480d51=_0x5cb7c0[_0x14523c(0x18a)]?![]:_0x2d353c[_0x14523c(0x13f)]>0x0||_0x54f7eb[_0x14523c(0x13f)]>0x0||_0x387ecd[_0x14523c(0x13f)]>0x0,_0x57f2b3=_0x4859e8['length']>0x0||_0x58aefc['length']>0x0||_0x575920[_0x14523c(0x13f)]>0x0,_0x5a73ac=_0x5cb7c0[_0x14523c(0x18a)]?![]:_0x1ba904[_0x14523c(0x13f)]>0x0,_0x4205c4=_0xf94e11['length']>0x0;if(!_0x480d51&&!_0x57f2b3&&!_0x5a73ac&&!_0x4205c4){const _0x34cc40=_0x5cb7c0[_0x14523c(0x18a)]?_0x14523c(0x1a3):_0x14523c(0x12b);console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x154)](_0x34cc40));if(_0x5b081b&&_0x3cedbf[_0x14523c(0x13f)]===0x1){const _0x2f1181=_0x3cedbf[0x0];if(_0x2f1181['existingSegment']?.['id']){const _0x4c67e8=getConsoleNextUrl(_0x5cb7c0[_0x14523c(0x157)],_0x14523c(0x17d)+_0x400fee+_0x14523c(0x176)+_0x2f1181[_0x14523c(0x130)]['id']+'/sb/da/esr');console[_0x14523c(0x147)](_0x14523c(0x155)+a54_0x259b91[_0x14523c(0x163)](_0x4c67e8));}}if(_0x5b081b&&_0x2c5765[_0x14523c(0x13f)]===0x1){const _0x3b999d=_0x2c5765[0x0];if(_0x3b999d[_0x14523c(0x1a4)]?.['id']){const _0xfda6e1=getConsoleNextUrl(_0x5cb7c0['site'],_0x14523c(0x17d)+_0x400fee+'/e/'+_0x3b999d[_0x14523c(0x1a4)]['id']+_0x14523c(0x124));console[_0x14523c(0x147)]('\x20\x20'+a54_0x259b91[_0x14523c(0x163)](_0xfda6e1));}}return 0x0;}const _0x37b5a3=_0x5cb7c0[_0x14523c(0x18a)]?_0x4859e8[_0x14523c(0x13f)]+_0x58aefc['length']+_0x575920[_0x14523c(0x13f)]+_0xf94e11[_0x14523c(0x13f)]:_0x2d353c[_0x14523c(0x13f)]+_0x54f7eb[_0x14523c(0x13f)]+_0x387ecd[_0x14523c(0x13f)]+_0x4859e8[_0x14523c(0x13f)]+_0x58aefc[_0x14523c(0x13f)]+_0x575920[_0x14523c(0x13f)]+_0xf94e11[_0x14523c(0x13f)]+_0x1ba904[_0x14523c(0x13f)];if(!_0x5cb7c0['yes']&&_0x37b5a3>0x0){if(!isInteractive())return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x183)),_0x14523c(0x129)),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x121)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x396bcd=await confirmKey(_0x14523c(0x180)+_0x37b5a3+_0x14523c(0x16b));if(!_0x396bcd)return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x156))),0x1;}const _0x35e982={'withProgress':async(_0xa17b0,_0x489651)=>{const _0x245d7a=_0x14523c,_0x596f57=await withSpinner(_0xa17b0,_0x489651,{'verbose':_0x5cb7c0[_0x245d7a(0x19f)]});return{'data':_0x596f57[_0x245d7a(0x181)]};},'logInfo':_0x32acd2=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x1ac)]('✔\x20'+_0x32acd2)),'logSuccess':_0x23a75e=>console['error'](a54_0x259b91[_0x14523c(0x154)]('✔\x20'+_0x23a75e)),'logWarning':_0x1ac495=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)]('⚠\x20'+_0x1ac495)),'logDeleted':_0x5962b1=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)]('✔\x20'+_0x5962b1))},_0x5d9d48={'segment':_0x58bf16[_0x14523c(0x19b)],'journey':_0x58bf16['journey'],'user':_0x58bf16[_0x14523c(0x1ab)],'connection':_0x58bf16[_0x14523c(0x172)]};_0xf94e11[_0x14523c(0x13f)]>0x0&&(_0x17bfe8=await executePushFolders(_0x5d9d48,_0xf94e11,_0x17bfe8,{'parentId':_0x400fee},_0x35e982));const _0x30168c={'rootFolderId':_0x480462,'folderPathToId':_0x17bfe8,'folderIdToPath':_0x11aa74,'segmentNameToId':_0x4c2cd3,'activationsBySegmentId':_0x4473a4,'emailToIdMap':_0x180459,'idToEmailMap':_0x559a97,'connectionNameToIdMap':_0x237bed[_0x14523c(0x1a9)],'connectionIdToNameMap':_0x237bed[_0x14523c(0x14d)],'connectionNameToTypeMap':_0x8f189f},_0x371605=await executePushSegments(_0x5d9d48,_0x5cb7c0[_0x14523c(0x18a)]?[]:_0x1acc32,_0x30168c,{'parentId':_0x400fee},_0x35e982),_0x295067=_0x371605[_0x14523c(0x165)],_0x17584c=_0x371605[_0x14523c(0x17b)],_0x745f6a=_0x371605[_0x14523c(0x182)][_0x14523c(0x165)],_0x272b31=_0x371605[_0x14523c(0x182)][_0x14523c(0x17b)],_0x373beb=_0x371605[_0x14523c(0x182)][_0x14523c(0x16a)];let _0x33fdb3;if(_0x5b081b&&_0x1acc32[_0x14523c(0x13f)]===0x1){const _0x407c5d=_0x1acc32[0x0];_0x33fdb3=_0x407c5d[_0x14523c(0x130)]?.['id']??_0x371605['createdSegmentIds']['get'](_0x407c5d['yamlConfig'][_0x14523c(0x1ad)]);}const _0x2458ef=await executePushSegmentDeletions(_0x5d9d48,_0x5cb7c0[_0x14523c(0x18a)]?[]:_0x387ecd,_0x35e982);let _0x59f520=0x0,_0x1b3439=0x0,_0x209754=0x0;const _0x1a6082=new Map(_0x4c2cd3);for(const [_0x254dc2,_0x24c1ed]of _0x371605[_0x14523c(0x131)]){_0x1a6082['set'](_0x254dc2,_0x24c1ed);}if(_0x516161[_0x14523c(0x13f)]>0x0){const _0x25f8ac={..._0x30168c,'segmentNameToId':_0x1a6082,'existingSegments':_0x1ce3fb,'activationContext':_0x5c3de8},_0x3f66dd=await executePushJourneys(_0x5d9d48,_0x516161,_0x25f8ac,{'parentId':_0x400fee,'rootFolderId':_0x480462,'verbose':_0x5cb7c0['verbose']},_0x35e982);_0x59f520=_0x3f66dd[_0x14523c(0x165)],_0x1b3439=_0x3f66dd[_0x14523c(0x17b)];if(_0x5b081b&&_0x3f66dd[_0x14523c(0x199)][_0x14523c(0x13f)]===0x1){const _0x2f8bd7=_0x3f66dd['results'][0x0];if(_0x2f8bd7[_0x14523c(0x153)]){const _0x1ee98e=getConsoleNextUrl(_0x5cb7c0['site'],_0x14523c(0x17d)+_0x400fee+'/e/'+_0x2f8bd7[_0x14523c(0x153)]+_0x14523c(0x124));console['error']('\x20\x20'+a54_0x259b91[_0x14523c(0x163)](_0x1ee98e));}}}for(const _0x7c5311 of _0x575920){console[_0x14523c(0x147)](a54_0x259b91['yellow'](_0x14523c(0x140)+_0x7c5311[_0x14523c(0x151)])),_0x209754++;}const _0x1c08c5=[];if(_0x295067>0x0)_0x1c08c5[_0x14523c(0x184)](_0x295067+_0x14523c(0x190));if(_0x17584c>0x0)_0x1c08c5['push'](_0x17584c+_0x14523c(0x150));if(_0x2458ef>0x0)_0x1c08c5['push'](_0x2458ef+_0x14523c(0x13e));const _0x2ce719=[];if(_0x59f520>0x0)_0x2ce719[_0x14523c(0x184)](_0x59f520+_0x14523c(0x190));if(_0x1b3439>0x0)_0x2ce719[_0x14523c(0x184)](_0x1b3439+_0x14523c(0x150));if(_0x209754>0x0)_0x2ce719[_0x14523c(0x184)](_0x209754+'\x20deleted');const _0x281a76=[];if(_0x745f6a>0x0)_0x281a76['push'](_0x745f6a+_0x14523c(0x190));if(_0x272b31>0x0)_0x281a76[_0x14523c(0x184)](_0x272b31+_0x14523c(0x150));if(_0x373beb>0x0)_0x281a76[_0x14523c(0x184)](_0x373beb+_0x14523c(0x13e));console['error'](a54_0x259b91[_0x14523c(0x154)](_0x14523c(0x17a)));_0x1c08c5[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&console[_0x14523c(0x147)](_0x14523c(0x1a2)+_0x1c08c5[_0x14523c(0x11a)](',\x20'));_0x2ce719[_0x14523c(0x13f)]>0x0&&console[_0x14523c(0x147)](_0x14523c(0x11e)+_0x2ce719[_0x14523c(0x11a)](',\x20'));_0x281a76['length']>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&console[_0x14523c(0x147)](_0x14523c(0x169)+_0x281a76[_0x14523c(0x11a)](',\x20'));if(_0x33fdb3){const _0x3e0056=getConsoleNextUrl(_0x5cb7c0[_0x14523c(0x157)],_0x14523c(0x17d)+_0x400fee+_0x14523c(0x176)+_0x33fdb3+_0x14523c(0x1a7));console[_0x14523c(0x147)](_0x14523c(0x155)+a54_0x259b91[_0x14523c(0x163)](_0x3e0056));}return 0x0;}}
|
|
1
|
+
const a54_0x3a74f0=a54_0x32a0;(function(_0x15f8f6,_0x510e53){const _0x224fe4=a54_0x32a0,_0x2f3ddf=_0x15f8f6();while(!![]){try{const _0x3986f2=-parseInt(_0x224fe4(0x23a))/0x1*(-parseInt(_0x224fe4(0x1de))/0x2)+-parseInt(_0x224fe4(0x224))/0x3*(-parseInt(_0x224fe4(0x1cd))/0x4)+parseInt(_0x224fe4(0x220))/0x5*(-parseInt(_0x224fe4(0x24e))/0x6)+parseInt(_0x224fe4(0x212))/0x7*(-parseInt(_0x224fe4(0x1e3))/0x8)+-parseInt(_0x224fe4(0x24d))/0x9+parseInt(_0x224fe4(0x21f))/0xa+-parseInt(_0x224fe4(0x202))/0xb*(-parseInt(_0x224fe4(0x22c))/0xc);if(_0x3986f2===_0x510e53)break;else _0x2f3ddf['push'](_0x2f3ddf['shift']());}catch(_0x55e80e){_0x2f3ddf['push'](_0x2f3ddf['shift']());}}}(a54_0x59cf,0x48708));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a54_0x5bbac5 from'chalk';import{existsSync}from'fs';function a54_0x32a0(_0x1c9f82,_0x2b5bd2){_0x1c9f82=_0x1c9f82-0x1b6;const _0x59cf95=a54_0x59cf();let _0x32a0fc=_0x59cf95[_0x1c9f82];return _0x32a0fc;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a54_0x3a74f0(0x241);[a54_0x3a74f0(0x1c9)]=a54_0x3a74f0(0x21d);async[a54_0x3a74f0(0x1ed)](_0x15de5b){const _0x1cf13b=a54_0x3a74f0,{options:_0x44e2d2,args:_0x4d01d1,tdx:_0x37311e}=_0x15de5b,_0x8d9a33=_0x44e2d2,_0x42649b=await resolveTarget({'arg':_0x4d01d1[0x0],'contextParent':_0x44e2d2[_0x1cf13b(0x207)],'cwd':process[_0x1cf13b(0x222)]()});if(!isSuccessfulResolution(_0x42649b))return _0x42649b[_0x1cf13b(0x240)]===_0x1cf13b(0x1e0)?(console['error'](a54_0x5bbac5[_0x1cf13b(0x21b)](_0x1cf13b(0x216))),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x1cf13b(0x1ec)](_0x1cf13b(0x20d)),console['error'](_0x1cf13b(0x236))):(console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x205)+_0x42649b[_0x1cf13b(0x21c)]+'\x0a')),_0x42649b[_0x1cf13b(0x1d7)]&&console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x1dc)](_0x42649b[_0x1cf13b(0x1d7)]))),0x1;if(_0x42649b['type']==='parent_name')return console['error'](a54_0x5bbac5['red'](_0x1cf13b(0x1c8)+_0x42649b[_0x1cf13b(0x1c5)]+'\x0a')),console['error'](a54_0x5bbac5[_0x1cf13b(0x1dc)](_0x1cf13b(0x1f6))),0x1;const _0xb7bc26=_0x42649b[_0x1cf13b(0x1d2)],_0x29073d=_0x42649b[_0x1cf13b(0x1c5)],_0x55fbdb=_0x42649b[_0x1cf13b(0x1f1)]==='file'?_0x42649b[_0x1cf13b(0x228)]:undefined,_0x46c8cd=getScopedDetails(_0x42649b),_0x38d555=_0x46c8cd?.[_0x1cf13b(0x245)]??![],_0x4977c1=_0x46c8cd?.['scopedFolderPath']??'';if(!existsSync(_0x29073d))return console[_0x1cf13b(0x1ec)](a54_0x5bbac5['red'](_0x1cf13b(0x1c8)+_0x29073d+'\x0a')),console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x1dc)](_0x1cf13b(0x1f6))),0x1;_0x8d9a33[_0x1cf13b(0x1cb)]&&(console[_0x1cf13b(0x1ec)]('Site:\x20'+_0x8d9a33['site']),console[_0x1cf13b(0x1ec)](_0x1cf13b(0x23f)+_0xb7bc26),console['error']('Source\x20directory:\x20'+_0x29073d),_0x38d555&&console['error'](_0x1cf13b(0x1ba)+_0x4977c1));const _0x5e885f=await withSpinner(_0x1cf13b(0x247)+_0xb7bc26+_0x1cf13b(0x1c0),()=>_0x37311e[_0x1cf13b(0x248)][_0x1cf13b(0x1ea)](_0xb7bc26),{'verbose':_0x8d9a33[_0x1cf13b(0x1cb)]}),_0x5e35d1=_0x5e885f[_0x1cf13b(0x209)],{parentSegmentResult:_0x24e947,segmentsResult:_0x3deb07,foldersResult:_0x249822,journeysWithDetailsResult:_0x11a7da,userMaps:_0x3a5282}=await withSpinner(_0x1cf13b(0x255),async()=>{const _0x294ed1=_0x1cf13b,[_0x312e40,_0xb0e139,_0x460718,_0xc86334,_0x59b498]=await Promise[_0x294ed1(0x1cc)]([_0x37311e[_0x294ed1(0x248)][_0x294ed1(0x206)](_0x5e35d1),_0x37311e[_0x294ed1(0x248)][_0x294ed1(0x1e4)](_0x5e35d1),_0x37311e['segment'][_0x294ed1(0x22e)](_0x5e35d1),_0x37311e[_0x294ed1(0x210)][_0x294ed1(0x1c2)](_0x5e35d1,{'includeAllVersions':!![]}),_0x37311e['user'][_0x294ed1(0x22d)]()]);return{'parentSegmentResult':_0x312e40,'segmentsResult':_0xb0e139,'foldersResult':_0x460718,'journeysWithDetailsResult':_0xc86334,'userMaps':_0x59b498};},{'verbose':_0x8d9a33[_0x1cf13b(0x1cb)]})[_0x1cf13b(0x237)](_0x5a6574=>_0x5a6574[_0x1cf13b(0x209)]),_0x248549=_0x24e947,_0x4f8e8a=extractRootFolderId(_0x248549),_0x2c1d52=_0x3deb07,_0x548ac0=_0x249822,{journeys:_0x46c5b3,activationStepsById:_0xb64c22}=_0x11a7da,_0x3bcd87=new Map(_0x46c5b3['map'](_0x579fa9=>[_0x579fa9['id'],_0x579fa9])),_0x50804a=_0x46c5b3[_0x1cf13b(0x230)](_0x241ea8=>({'id':_0x241ea8['id'],'name':_0x241ea8[_0x1cf13b(0x246)][_0x1cf13b(0x218)],'journeyBundleName':_0x241ea8[_0x1cf13b(0x246)]['journeyBundleName']||'','journeyBundleId':_0x241ea8['attributes']['journeyBundleId']||'','versionNumber':_0x241ea8[_0x1cf13b(0x246)][_0x1cf13b(0x22a)],'description':_0x241ea8[_0x1cf13b(0x246)][_0x1cf13b(0x1c9)],'state':_0x241ea8[_0x1cf13b(0x246)][_0x1cf13b(0x250)],'paused':_0x241ea8['attributes'][_0x1cf13b(0x1ef)],'audienceId':_0x241ea8[_0x1cf13b(0x246)]['audienceId'],'folderId':_0x241ea8[_0x1cf13b(0x1e5)]?.['parentFolder']?.[_0x1cf13b(0x209)]?.['id'],'createdAt':_0x241ea8[_0x1cf13b(0x246)]['createdAt'],'updatedAt':_0x241ea8[_0x1cf13b(0x246)]['updatedAt']})),{emailToId:_0x4b3e12,idToEmail:_0x2fedf9}=_0x3a5282,_0x2b1d14=await withSpinner(_0x1cf13b(0x239),async()=>{const _0x347cc9=_0x1cf13b,_0x23fb39=await _0x37311e[_0x347cc9(0x253)][_0x347cc9(0x1b8)]();return buildConnectionMaps(_0x23fb39);},{'verbose':_0x8d9a33['verbose']})[_0x1cf13b(0x237)](_0x4fc834=>_0x4fc834['data']),_0x477a20=_0x2b1d14[_0x1cf13b(0x1b9)],_0x1262b0=_0x2b1d14[_0x1cf13b(0x1eb)],_0x569314=_0x2b1d14[_0x1cf13b(0x1d6)],_0xfecf05={'emailToIdMap':_0x4b3e12,'connectionNameToIdMap':_0x477a20,'connectionNameToTypeMap':_0x569314,'getSchema':_0x3439c3=>_0x37311e['connection'][_0x1cf13b(0x213)](_0x3439c3),'getMetadata':_0x2390c7=>_0x37311e['connection'][_0x1cf13b(0x254)](_0x2390c7)};let {pathToId:_0xd36bbc,idToPath:_0x2ee517}=buildFolderMaps(_0x548ac0);const _0x4dcf22=buildSegmentLookupMap(_0x2c1d52,_0x2ee517),_0x1e203b=buildSegmentNameToIdMap(_0x2c1d52),_0x40a75a=buildJourneyBundleLookupMap(_0x50804a,_0x2ee517);let _0x5e81b3;if(_0x55fbdb){if(!_0x55fbdb[_0x1cf13b(0x21a)](_0x1cf13b(0x1bc))&&!_0x55fbdb['endsWith']('.yaml'))return console['error'](a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x242)+_0x55fbdb+'\x0a')),0x1;_0x5e81b3=[_0x55fbdb];}else _0x5e81b3=findYamlFiles(_0x29073d);if(_0x5e81b3[_0x1cf13b(0x23c)]===0x0)return console['error'](a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x1b6)+_0x29073d+'\x0a')),console[_0x1cf13b(0x1ec)](a54_0x5bbac5['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x14d20a,_0x324c4f;try{const _0x58363b=parseAndClassifyYamlFiles(_0x5e81b3,_0x29073d,{'skipSegments':_0x8d9a33[_0x1cf13b(0x203)]});_0x14d20a=_0x58363b[_0x1cf13b(0x229)],_0x324c4f=_0x58363b[_0x1cf13b(0x235)];const _0x45ab5c=validateParsedFiles(_0x58363b,_0x29073d);if(_0x45ab5c[_0x1cf13b(0x23c)]>0x0)return console['error'](a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x219))),console[_0x1cf13b(0x1ec)](formatValidationErrors(_0x45ab5c)),console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x21b)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x26faa3){return console['error'](a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x1f4)+(_0x26faa3 instanceof Error?_0x26faa3[_0x1cf13b(0x21c)]:_0x26faa3))),0x1;}if(_0x14d20a[_0x1cf13b(0x23c)]===0x0&&_0x324c4f[_0x1cf13b(0x23c)]===0x0){const _0xe1f3f7=_0x8d9a33['journeysOnly']?_0x1cf13b(0x210):_0x1cf13b(0x20b);return console['error'](a54_0x5bbac5[_0x1cf13b(0x21b)](_0x1cf13b(0x1e8)+_0xe1f3f7+_0x1cf13b(0x1f7))),0x0;}const _0x2dc2d2=new Map();_0x2c1d52[_0x1cf13b(0x23c)]>0x0&&!_0x8d9a33[_0x1cf13b(0x203)]&&await withSpinner(_0x1cf13b(0x211),async()=>{await batchAsync(_0x2c1d52,async _0x157c44=>{const _0x53ba27=a54_0x32a0,_0x45260a=await _0x37311e[_0x53ba27(0x248)][_0x53ba27(0x20f)](_0x5e35d1,_0x157c44['id']);_0x2dc2d2['set'](_0x157c44['id'],_0x45260a);});},{'verbose':_0x8d9a33[_0x1cf13b(0x1cb)]});const {segmentFiles:_0x2c9611,foldersToCreate:_0x1bf5e8}=await prepareSegmentFiles(_0x14d20a,{'segmentByFolderAndName':_0x4dcf22,'activationsBySegmentId':_0x2dc2d2,'folderPathToId':_0xd36bbc,'idToEmailMap':_0x2fedf9,'connectionIdToNameMap':_0x1262b0},_0xfecf05,_0x38d555,_0x4977c1),_0x5df300=_0x55fbdb?[]:findSegmentsToDelete(_0x2c1d52,_0x14d20a['map'](({yamlConfig:_0x1f86a8,folderPath:_0x4aa178})=>({'yamlConfig':_0x1f86a8,'folderPath':resolveTDFolderPath(_0x4aa178,_0x38d555,_0x4977c1)})),_0x2ee517,_0x4977c1,_0x38d555),{journeyFiles:_0x4e9b85,foldersToCreate:_0x19fcd9}=await withProgressSpinner('Preparing\x20journeys...',async _0x52fc57=>prepareJourneyFiles(_0x324c4f,{'fetchJourney':async _0x947341=>_0x37311e['journey'][_0x1cf13b(0x1e6)](_0x947341['journeyId']),'journeyBundlesByFolderAndName':_0x40a75a,'folderPathToId':_0xd36bbc,'idToEmailMap':_0x2fedf9,'connectionIdToNameMap':_0x1262b0,'existingSegments':_0x2c1d52,'parentId':_0x5e35d1,'deps':_0x37311e,'progress':{'update':_0x5e388d=>{const _0x47b432=_0x1cf13b;_0x52fc57[_0x47b432(0x1c7)](_0x5e388d),_0x8d9a33[_0x47b432(0x1cb)]&&console[_0x47b432(0x1ec)]('\x20\x20'+_0x5e388d);}},'journeyById':_0x3bcd87,'activationStepsById':_0xb64c22},_0x38d555,_0x4977c1),{'verbose':_0x8d9a33[_0x1cf13b(0x1cb)]})[_0x1cf13b(0x237)](_0x14822f=>_0x14822f[_0x1cf13b(0x209)]);for(const _0x479520 of _0x19fcd9){_0x1bf5e8[_0x1cf13b(0x1f3)](_0x479520);}const _0x56bb4f=_0x55fbdb?[]:findJourneysToDelete(_0x50804a,_0x324c4f['map'](({yamlConfig:_0x4b7d84,folderPath:_0x6cddac})=>({'yamlConfig':_0x4b7d84,'folderPath':resolveTDFolderPath(_0x6cddac,_0x38d555,_0x4977c1)})),_0x2ee517,_0x4977c1,_0x38d555),_0x51d376=calculatePushStats(_0x2c9611,_0x4e9b85,_0x1bf5e8,_0x5df300,_0x56bb4f,!!_0x8d9a33['delete'],!!_0x8d9a33[_0x1cf13b(0x203)]),_0x3d5b2d=_0x51d376[_0x1cf13b(0x229)][_0x1cf13b(0x223)],_0x25a06e=_0x51d376[_0x1cf13b(0x229)][_0x1cf13b(0x1df)],_0x163812=_0x51d376[_0x1cf13b(0x229)]['unchanged'],_0x4ec406=_0x51d376['segments'][_0x1cf13b(0x1d4)],_0x741f8=_0x51d376[_0x1cf13b(0x215)][_0x1cf13b(0x1fa)],_0xcf99fd=_0x51d376[_0x1cf13b(0x235)][_0x1cf13b(0x223)],_0x420d88=_0x51d376[_0x1cf13b(0x235)][_0x1cf13b(0x1df)],_0x529afa=_0x51d376[_0x1cf13b(0x235)][_0x1cf13b(0x238)],_0x10c67b=_0x51d376['journeys'][_0x1cf13b(0x1d4)],_0x34a9ce=_0x51d376[_0x1cf13b(0x1f5)][_0x1cf13b(0x1cc)],_0x1c908c=_0x51d376[_0x1cf13b(0x1f5)]['toCreate'],_0x3046f8=_0x51d376['activations']['toUpdate'],_0x33374d=_0x51d376[_0x1cf13b(0x1f5)]['toDelete'];console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1e9)+_0xb7bc26+'\x27:');_0x741f8[_0x1cf13b(0x23c)]>0x0&&console['error']('\x20\x20'+a54_0x5bbac5['blue'](_0x1cf13b(0x23d)+_0x741f8[_0x1cf13b(0x23c)]+_0x1cf13b(0x1fe)));if(!_0x8d9a33[_0x1cf13b(0x203)]){console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d5)),console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d9)+a54_0x5bbac5[_0x1cf13b(0x20e)]('+\x20'+_0x3d5b2d[_0x1cf13b(0x23c)]+'\x20new')),console[_0x1cf13b(0x1ec)]('\x20\x20\x20\x20'+a54_0x5bbac5[_0x1cf13b(0x21b)]('~\x20'+_0x25a06e[_0x1cf13b(0x23c)]+_0x1cf13b(0x22f)));if(_0x4ec406['length']>0x0)console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d9)+a54_0x5bbac5[_0x1cf13b(0x1d0)]('-\x20'+_0x4ec406[_0x1cf13b(0x23c)]+_0x1cf13b(0x20a)));else _0x5df300['length']>0x0&&!_0x8d9a33[_0x1cf13b(0x200)]&&console['error'](_0x1cf13b(0x1d9)+a54_0x5bbac5['dim'](_0x5df300[_0x1cf13b(0x23c)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x1cf13b(0x1ec)]('\x20\x20\x20\x20'+a54_0x5bbac5[_0x1cf13b(0x24a)]('=\x20'+_0x163812[_0x1cf13b(0x23c)]+'\x20unchanged'));}if(_0x4e9b85[_0x1cf13b(0x23c)]>0x0||_0x56bb4f[_0x1cf13b(0x23c)]>0x0){console[_0x1cf13b(0x1ec)](_0x1cf13b(0x24f)),console['error'](_0x1cf13b(0x1d9)+a54_0x5bbac5[_0x1cf13b(0x20e)]('+\x20'+_0xcf99fd[_0x1cf13b(0x23c)]+_0x1cf13b(0x1fd))),console['error']('\x20\x20\x20\x20'+a54_0x5bbac5[_0x1cf13b(0x21b)]('~\x20'+_0x420d88['length']+'\x20changed'));if(_0x10c67b[_0x1cf13b(0x23c)]>0x0)console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d9)+a54_0x5bbac5['red']('-\x20'+_0x10c67b[_0x1cf13b(0x23c)]+_0x1cf13b(0x20a)));else _0x56bb4f[_0x1cf13b(0x23c)]>0x0&&!_0x8d9a33['delete']&&console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d9)+a54_0x5bbac5['dim'](_0x56bb4f[_0x1cf13b(0x23c)]+_0x1cf13b(0x1dd)));console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d9)+a54_0x5bbac5[_0x1cf13b(0x24a)]('=\x20'+_0x529afa[_0x1cf13b(0x23c)]+_0x1cf13b(0x243)));}_0x34a9ce[_0x1cf13b(0x23c)]>0x0&&!_0x8d9a33[_0x1cf13b(0x203)]&&(console[_0x1cf13b(0x1ec)](''),console['error'](_0x1cf13b(0x226)),_0x1c908c['length']>0x0&&console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d9)+a54_0x5bbac5[_0x1cf13b(0x20e)]('+\x20'+_0x1c908c[_0x1cf13b(0x23c)]+_0x1cf13b(0x1e7))),_0x3046f8[_0x1cf13b(0x23c)]>0x0&&console['error'](_0x1cf13b(0x1d9)+a54_0x5bbac5[_0x1cf13b(0x21b)]('~\x20'+_0x3046f8[_0x1cf13b(0x23c)]+_0x1cf13b(0x1f0))),_0x33374d['length']>0x0&&console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1d9)+a54_0x5bbac5[_0x1cf13b(0x1d0)]('-\x20'+_0x33374d[_0x1cf13b(0x23c)]+_0x1cf13b(0x20a))));console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1e1)+a54_0x5bbac5[_0x1cf13b(0x1dc)](_0x29073d)+'\x0a');if(_0x741f8[_0x1cf13b(0x23c)]>0x0){console[_0x1cf13b(0x1ec)]('Folders\x20to\x20create:');for(const _0x56092c of _0x741f8){console['error']('\x20\x20'+a54_0x5bbac5['blue']('+')+'\x20'+_0x56092c);}console[_0x1cf13b(0x1ec)]('');}if(_0x3d5b2d['length']>0x0&&!_0x8d9a33[_0x1cf13b(0x203)])for(const _0x2c7f1e of _0x3d5b2d){const _0x296395=_0x2c7f1e[_0x1cf13b(0x24b)]?_0x2c7f1e[_0x1cf13b(0x24b)]+'/'+_0x2c7f1e[_0x1cf13b(0x1ff)][_0x1cf13b(0x218)]:_0x2c7f1e[_0x1cf13b(0x1ff)][_0x1cf13b(0x218)],_0x73bc33=_0x2c7f1e['yamlConfig'][_0x1cf13b(0x1f5)]?.[_0x1cf13b(0x23c)]||0x0,_0x3a941d=_0x73bc33>0x0?a54_0x5bbac5['dim']('\x20['+_0x73bc33+_0x1cf13b(0x1c4)):'';console['error']('\x0a'+a54_0x5bbac5[_0x1cf13b(0x20e)](_0x1cf13b(0x23b))+'\x20'+_0x296395+_0x3a941d),console['error']('─'[_0x1cf13b(0x1cf)](0x3c)),_0x2c7f1e[_0x1cf13b(0x251)]&&console[_0x1cf13b(0x1ec)](_0x2c7f1e[_0x1cf13b(0x251)]),console[_0x1cf13b(0x1ec)]('─'[_0x1cf13b(0x1cf)](0x3c));}if(_0x4ec406[_0x1cf13b(0x23c)]>0x0&&!_0x8d9a33[_0x1cf13b(0x203)])for(const _0x1613b9 of _0x4ec406){const _0x335298=_0x1613b9['segmentFolderId']?_0x2ee517[_0x1cf13b(0x24c)](_0x1613b9[_0x1cf13b(0x201)]['toString']())||'':'',_0x47f933=_0x335298?_0x335298+'/'+_0x1613b9[_0x1cf13b(0x218)]:_0x1613b9[_0x1cf13b(0x218)],_0x16b512=_0x2dc2d2[_0x1cf13b(0x24c)](_0x1613b9['id'])||[],_0x41b932=_0x16b512[_0x1cf13b(0x23c)]>0x0?a54_0x5bbac5[_0x1cf13b(0x24a)]('\x20['+_0x16b512[_0x1cf13b(0x23c)]+'\x20activations]'):'';console[_0x1cf13b(0x1ec)]('\x0a'+a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x233))+'\x20'+_0x47f933+_0x41b932),console['error']('─'[_0x1cf13b(0x1cf)](0x3c));const _0x3f682a=segmentWithActivationsToYaml(_0x1613b9,_0x16b512,undefined,_0x2fedf9,_0x1262b0),_0x55d184=segmentToYamlString(_0x3f682a),_0xae7119=generateDiff(_0x55d184,'');console[_0x1cf13b(0x1ec)](formatDiffWithColors(_0xae7119)),console[_0x1cf13b(0x1ec)]('─'[_0x1cf13b(0x1cf)](0x3c));}const _0x4d1875=_0x2c9611[_0x1cf13b(0x21e)](_0x5c2455=>!_0x5c2455[_0x1cf13b(0x20c)]&&_0x5c2455[_0x1cf13b(0x251)]);if(_0x4d1875[_0x1cf13b(0x23c)]>0x0&&!_0x8d9a33[_0x1cf13b(0x203)])for(const _0x1c40d8 of _0x4d1875){const _0xe92eb9=_0x1c40d8[_0x1cf13b(0x24b)]?_0x1c40d8[_0x1cf13b(0x24b)]+'/'+_0x1c40d8[_0x1cf13b(0x1ff)][_0x1cf13b(0x218)]:_0x1c40d8[_0x1cf13b(0x1ff)][_0x1cf13b(0x218)];console['error']('\x0a'+a54_0x5bbac5[_0x1cf13b(0x21b)](_0x1cf13b(0x1bd))+'\x20'+_0xe92eb9),console[_0x1cf13b(0x1ec)]('─'[_0x1cf13b(0x1cf)](0x3c)),console[_0x1cf13b(0x1ec)](_0x1c40d8[_0x1cf13b(0x251)]),console[_0x1cf13b(0x1ec)]('─'['repeat'](0x3c));}if(_0xcf99fd[_0x1cf13b(0x23c)]>0x0)for(const _0x177278 of _0xcf99fd){const _0x1d02da=_0x177278['folderPath']?_0x177278[_0x1cf13b(0x24b)]+'/'+_0x177278[_0x1cf13b(0x1ff)][_0x1cf13b(0x218)]:_0x177278['yamlConfig'][_0x1cf13b(0x218)];console[_0x1cf13b(0x1ec)]('\x0a'+a54_0x5bbac5[_0x1cf13b(0x20e)](_0x1cf13b(0x214))+'\x20'+_0x1d02da),console[_0x1cf13b(0x1ec)]('─'[_0x1cf13b(0x1cf)](0x3c)),_0x177278[_0x1cf13b(0x251)]&&console[_0x1cf13b(0x1ec)](_0x177278[_0x1cf13b(0x251)]),console[_0x1cf13b(0x1ec)]('─'[_0x1cf13b(0x1cf)](0x3c));}const _0x2ec032=_0x4e9b85[_0x1cf13b(0x21e)](_0x1c1816=>!_0x1c1816[_0x1cf13b(0x20c)]&&_0x1c1816[_0x1cf13b(0x251)]);if(_0x2ec032[_0x1cf13b(0x23c)]>0x0)for(const _0x4c9a0c of _0x2ec032){const _0x54f81d=_0x4c9a0c[_0x1cf13b(0x24b)]?_0x4c9a0c[_0x1cf13b(0x24b)]+'/'+_0x4c9a0c[_0x1cf13b(0x1ff)][_0x1cf13b(0x218)]:_0x4c9a0c['yamlConfig'][_0x1cf13b(0x218)];console[_0x1cf13b(0x1ec)]('\x0a'+a54_0x5bbac5[_0x1cf13b(0x21b)](_0x1cf13b(0x1ee))+'\x20'+_0x54f81d),console[_0x1cf13b(0x1ec)]('─'['repeat'](0x3c)),console[_0x1cf13b(0x1ec)](_0x4c9a0c[_0x1cf13b(0x251)]),console[_0x1cf13b(0x1ec)]('─'['repeat'](0x3c));}if(_0x10c67b[_0x1cf13b(0x23c)]>0x0)for(const _0x3cb879 of _0x10c67b){const _0x2c8bef=_0x3cb879['folderId']?_0x2ee517[_0x1cf13b(0x24c)](_0x3cb879[_0x1cf13b(0x1d8)])||'':'',_0x23c3e0=_0x2c8bef?_0x2c8bef+'/'+_0x3cb879[_0x1cf13b(0x232)]:_0x3cb879['journeyBundleName'];console[_0x1cf13b(0x1ec)]('\x0a'+a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x1f9))+'\x20'+_0x23c3e0),console[_0x1cf13b(0x1ec)]('─'[_0x1cf13b(0x1cf)](0x3c)),console['error'](a54_0x5bbac5[_0x1cf13b(0x1d0)](_0x1cf13b(0x257))),console[_0x1cf13b(0x1ec)]('─'[_0x1cf13b(0x1cf)](0x3c));}if(_0x8d9a33[_0x1cf13b(0x1d3)])return console['error'](a54_0x5bbac5[_0x1cf13b(0x21b)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0xfea4f0=_0x8d9a33[_0x1cf13b(0x203)]?![]:_0x3d5b2d[_0x1cf13b(0x23c)]>0x0||_0x25a06e[_0x1cf13b(0x23c)]>0x0||_0x4ec406[_0x1cf13b(0x23c)]>0x0,_0x36fa94=_0xcf99fd[_0x1cf13b(0x23c)]>0x0||_0x420d88[_0x1cf13b(0x23c)]>0x0||_0x10c67b[_0x1cf13b(0x23c)]>0x0,_0x55e4cf=_0x8d9a33[_0x1cf13b(0x203)]?![]:_0x34a9ce[_0x1cf13b(0x23c)]>0x0,_0x33387c=_0x741f8[_0x1cf13b(0x23c)]>0x0;if(!_0xfea4f0&&!_0x36fa94&&!_0x55e4cf&&!_0x33387c){const _0x241f97=_0x8d9a33[_0x1cf13b(0x203)]?_0x1cf13b(0x1b7):_0x1cf13b(0x23e);console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x20e)](_0x241f97));if(_0x55fbdb&&_0x163812[_0x1cf13b(0x23c)]===0x1){const _0x51ec82=_0x163812[0x0];if(_0x51ec82[_0x1cf13b(0x1c6)]?.['id']){const _0x4bac84=getConsoleNextUrl(_0x8d9a33[_0x1cf13b(0x1c1)],'/app/ps/'+_0x5e35d1+_0x1cf13b(0x204)+_0x51ec82['existingSegment']['id']+'/sb/da/esr');console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1ca)+a54_0x5bbac5['cyan'](_0x4bac84));}}if(_0x55fbdb&&_0x529afa[_0x1cf13b(0x23c)]===0x1){const _0x2ead2a=_0x529afa[0x0];if(_0x2ead2a[_0x1cf13b(0x1e2)]?.['id']){const _0x1a9f99=getConsoleNextUrl(_0x8d9a33[_0x1cf13b(0x1c1)],_0x1cf13b(0x22b)+_0x5e35d1+_0x1cf13b(0x204)+_0x2ead2a[_0x1cf13b(0x1e2)]['id']+'/j/da/je');console['error']('\x20\x20'+a54_0x5bbac5[_0x1cf13b(0x1dc)](_0x1a9f99));}}return 0x0;}const _0x5f1cc4=_0x8d9a33[_0x1cf13b(0x203)]?_0xcf99fd[_0x1cf13b(0x23c)]+_0x420d88[_0x1cf13b(0x23c)]+_0x10c67b['length']+_0x741f8['length']:_0x3d5b2d[_0x1cf13b(0x23c)]+_0x25a06e['length']+_0x4ec406[_0x1cf13b(0x23c)]+_0xcf99fd[_0x1cf13b(0x23c)]+_0x420d88['length']+_0x10c67b[_0x1cf13b(0x23c)]+_0x741f8[_0x1cf13b(0x23c)]+_0x34a9ce[_0x1cf13b(0x23c)];if(!_0x8d9a33[_0x1cf13b(0x1fb)]&&_0x5f1cc4>0x0){if(!isInteractive())return console['error'](a54_0x5bbac5[_0x1cf13b(0x1d0)]('\x0aError:'),_0x1cf13b(0x1bb)),console['error'](a54_0x5bbac5[_0x1cf13b(0x24a)](_0x1cf13b(0x225))),0x1;const _0x4f541d=await confirmKey(_0x1cf13b(0x217)+_0x5f1cc4+_0x1cf13b(0x1be));if(!_0x4f541d)return console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x21b)]('Aborted.')),0x1;}const _0x45d0ef={'withProgress':async(_0xe129af,_0x29fe52)=>{const _0x4e1cae=_0x1cf13b,_0x2a4ee0=await withSpinner(_0xe129af,_0x29fe52,{'verbose':_0x8d9a33[_0x4e1cae(0x1cb)]});return{'data':_0x2a4ee0['data']};},'logInfo':_0x59f0a1=>console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x221)]('✔\x20'+_0x59f0a1)),'logSuccess':_0x1355f3=>console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x20e)]('✔\x20'+_0x1355f3)),'logWarning':_0x1f8fe9=>console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x21b)]('⚠\x20'+_0x1f8fe9)),'logDeleted':_0xe5addb=>console[_0x1cf13b(0x1ec)](a54_0x5bbac5['red']('✔\x20'+_0xe5addb))},_0x2e93e1={'segment':_0x37311e[_0x1cf13b(0x248)],'journey':_0x37311e[_0x1cf13b(0x210)],'user':_0x37311e[_0x1cf13b(0x256)],'connection':_0x37311e[_0x1cf13b(0x253)]};_0x741f8[_0x1cf13b(0x23c)]>0x0&&(_0xd36bbc=await executePushFolders(_0x2e93e1,_0x741f8,_0xd36bbc,{'parentId':_0x5e35d1},_0x45d0ef));const _0x3bcefa={'rootFolderId':_0x4f8e8a,'folderPathToId':_0xd36bbc,'folderIdToPath':_0x2ee517,'segmentNameToId':_0x1e203b,'activationsBySegmentId':_0x2dc2d2,'emailToIdMap':_0x4b3e12,'idToEmailMap':_0x2fedf9,'connectionNameToIdMap':_0x2b1d14[_0x1cf13b(0x1b9)],'connectionIdToNameMap':_0x2b1d14[_0x1cf13b(0x1eb)],'connectionNameToTypeMap':_0x569314},_0xd755e=await executePushSegments(_0x2e93e1,_0x8d9a33[_0x1cf13b(0x203)]?[]:_0x2c9611,_0x3bcefa,{'parentId':_0x5e35d1},_0x45d0ef),_0x227bcb=_0xd755e[_0x1cf13b(0x1c3)],_0x2d0314=_0xd755e['updated'],_0x5bd0d7=_0xd755e['activations'][_0x1cf13b(0x1c3)],_0x359343=_0xd755e[_0x1cf13b(0x1f5)][_0x1cf13b(0x244)],_0x21b4b2=_0xd755e[_0x1cf13b(0x1f5)][_0x1cf13b(0x1f8)];let _0x54d1ca;if(_0x55fbdb&&_0x2c9611[_0x1cf13b(0x23c)]===0x1){const _0x2bddca=_0x2c9611[0x0];_0x54d1ca=_0x2bddca[_0x1cf13b(0x1c6)]?.['id']??_0xd755e['createdSegmentIds'][_0x1cf13b(0x24c)](_0x2bddca[_0x1cf13b(0x1ff)][_0x1cf13b(0x218)]);}const _0x33021c=await executePushSegmentDeletions(_0x2e93e1,_0x8d9a33[_0x1cf13b(0x203)]?[]:_0x4ec406,_0x45d0ef);let _0x17d846=0x0,_0x8eecb3=0x0,_0x26d1e3=0x0;const _0x1c8fbe=new Map(_0x1e203b);for(const [_0x550566,_0x1ccc8c]of _0xd755e[_0x1cf13b(0x1d1)]){_0x1c8fbe[_0x1cf13b(0x1f2)](_0x550566,_0x1ccc8c);}if(_0x4e9b85[_0x1cf13b(0x23c)]>0x0){const _0x30b547={..._0x3bcefa,'segmentNameToId':_0x1c8fbe,'existingSegments':_0x2c1d52,'activationContext':_0xfecf05},_0x596515=await executePushJourneys(_0x2e93e1,_0x4e9b85,_0x30b547,{'parentId':_0x5e35d1,'rootFolderId':_0x4f8e8a,'verbose':_0x8d9a33['verbose']},_0x45d0ef);_0x17d846=_0x596515[_0x1cf13b(0x1c3)],_0x8eecb3=_0x596515['updated'];if(_0x55fbdb&&_0x596515[_0x1cf13b(0x1fc)][_0x1cf13b(0x23c)]===0x1){const _0x1a68e7=_0x596515[_0x1cf13b(0x1fc)][0x0];if(_0x1a68e7['journeyId']){const _0x542f32=getConsoleNextUrl(_0x8d9a33[_0x1cf13b(0x1c1)],'/app/ps/'+_0x5e35d1+'/e/'+_0x1a68e7['journeyId']+_0x1cf13b(0x1db));console['error']('\x20\x20'+a54_0x5bbac5['cyan'](_0x542f32));}}}for(const _0x4fbb7e of _0x10c67b){console[_0x1cf13b(0x1ec)](a54_0x5bbac5[_0x1cf13b(0x21b)](_0x1cf13b(0x208)+_0x4fbb7e[_0x1cf13b(0x232)])),_0x26d1e3++;}const _0x4dc736=[];if(_0x227bcb>0x0)_0x4dc736[_0x1cf13b(0x252)](_0x227bcb+_0x1cf13b(0x231));if(_0x2d0314>0x0)_0x4dc736['push'](_0x2d0314+_0x1cf13b(0x234));if(_0x33021c>0x0)_0x4dc736['push'](_0x33021c+_0x1cf13b(0x1da));const _0x21782f=[];if(_0x17d846>0x0)_0x21782f[_0x1cf13b(0x252)](_0x17d846+_0x1cf13b(0x231));if(_0x8eecb3>0x0)_0x21782f[_0x1cf13b(0x252)](_0x8eecb3+_0x1cf13b(0x234));if(_0x26d1e3>0x0)_0x21782f[_0x1cf13b(0x252)](_0x26d1e3+_0x1cf13b(0x1da));const _0x348f29=[];if(_0x5bd0d7>0x0)_0x348f29[_0x1cf13b(0x252)](_0x5bd0d7+'\x20created');if(_0x359343>0x0)_0x348f29[_0x1cf13b(0x252)](_0x359343+_0x1cf13b(0x234));if(_0x21b4b2>0x0)_0x348f29[_0x1cf13b(0x252)](_0x21b4b2+_0x1cf13b(0x1da));console['error'](a54_0x5bbac5['green']('\x0a✔\x20Push\x20complete'));_0x4dc736[_0x1cf13b(0x23c)]>0x0&&!_0x8d9a33[_0x1cf13b(0x203)]&&console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1bf)+_0x4dc736[_0x1cf13b(0x227)](',\x20'));_0x21782f[_0x1cf13b(0x23c)]>0x0&&console[_0x1cf13b(0x1ec)]('\x20\x20Journeys:\x20'+_0x21782f['join'](',\x20'));_0x348f29[_0x1cf13b(0x23c)]>0x0&&!_0x8d9a33['journeysOnly']&&console['error'](_0x1cf13b(0x1ce)+_0x348f29['join'](',\x20'));if(_0x54d1ca){const _0x476470=getConsoleNextUrl(_0x8d9a33[_0x1cf13b(0x1c1)],_0x1cf13b(0x22b)+_0x5e35d1+'/e/'+_0x54d1ca+_0x1cf13b(0x249));console[_0x1cf13b(0x1ec)](_0x1cf13b(0x1ca)+a54_0x5bbac5[_0x1cf13b(0x1dc)](_0x476470));}return 0x0;}}function a54_0x59cf(){const _0x34d3a8=['map','\x20created','journeyBundleName','Delete\x20segment:','\x20updated','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','then','unchanged','Fetching\x20connections\x20for\x20name\x20resolution...','157rvDUWB','New\x20segment:','length','📁\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Parent\x20segment:\x20','errorCode','segment:push','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20unchanged','updated','isScoped','attributes','Resolving\x20parent\x20segment\x20\x27','segment','/sb/da/esr','dim','folderPath','get','870057LoDPwu','2592TDJUlx','\x20\x20🗺️\x20\x20Journeys:','state','diff','push','connection','getMetadataWithCache','Fetching\x20existing\x20data...','user','(Journey\x20will\x20be\x20deleted)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','list','nameToId','Scoped\x20to\x20folder:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','.yml','Changes\x20to:','\x20changes?','\x20\x20Segments:\x20','\x27...','site','listJourneysWithDetailsFromParentSegment','created','\x20activations]','targetDir','existingSegment','setPhase','Error:\x20Directory\x20not\x20found:\x20','description','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','verbose','all','152UrCAJc','\x20\x20Activations:\x20','repeat','red','createdSegmentIds','parentName','dryRun','toDelete','\x20\x20📊\x20Segments:','nameToType','helpText','folderId','\x20\x20\x20\x20','\x20deleted','/j/da/je','cyan','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','2786YaxKrp','changed','no_parent','\x20\x20Source:\x20','existingJourney','1818888oFIubZ','listSegments','relationships','getJourney','\x20to\x20create','No\x20','\x0aPush\x20summary\x20for\x20\x27','resolveParentId','idToName','error','execute','Changes\x20to\x20journey:','paused','\x20to\x20update','type','set','add','Error\x20parsing\x20YAML:\x20','activations','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20YAML\x20files\x20found','deleted','Delete\x20journey:','toCreate','yes','results','\x20new','\x20folders\x20to\x20create','yamlConfig','delete','segmentFolderId','22ALjVHN','journeysOnly','/e/','Error:\x20','getParent','parentSegment','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','data','\x20to\x20delete','segment\x20or\x20journey','isNew','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','green','listActivations','journey','Fetching\x20existing\x20activations...','7mtTmzk','getOutputSchemaWithCache','New\x20journey:','folders','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Push\x20','name','\x0aValidation\x20failed:','endsWith','yellow','message','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','filter','2421850MgXagf','1260RwVUZF','blue','cwd','new','19191bORrZp','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Activations:','join','filePath','segments','versionNumber','/app/ps/','153828vanjEU','buildUserMaps','listFolders','\x20changed'];a54_0x59cf=function(){return _0x34d3a8;};return a54_0x59cf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x440560=a55_0x169e;(function(_0x5b6eea,_0xbdbb69){const _0x57ef4a=a55_0x169e,_0x4e9f22=_0x5b6eea();while(!![]){try{const _0x5f5015=parseInt(_0x57ef4a(0x170))/0x1+parseInt(_0x57ef4a(0x190))/0x2*(-parseInt(_0x57ef4a(0x191))/0x3)+parseInt(_0x57ef4a(0x173))/0x4+-parseInt(_0x57ef4a(0x18b))/0x5+-parseInt(_0x57ef4a(0x16a))/0x6*(-parseInt(_0x57ef4a(0x18e))/0x7)+parseInt(_0x57ef4a(0x169))/0x8*(-parseInt(_0x57ef4a(0x16b))/0x9)+parseInt(_0x57ef4a(0x175))/0xa;if(_0x5f5015===_0xbdbb69)break;else _0x4e9f22['push'](_0x4e9f22['shift']());}catch(_0x49c3cb){_0x4e9f22['push'](_0x4e9f22['shift']());}}}(a55_0x783e,0xb8334));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a55_0x169e(_0x1c9c33,_0x5f0188){_0x1c9c33=_0x1c9c33-0x169;const _0x783e3=a55_0x783e();let _0x169ee2=_0x783e3[_0x1c9c33];return _0x169ee2;}import a55_0xc27533 from'chalk';function a55_0x783e(){const _0x22e1c3=['18kHcXuD','description','name','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment','Update\x20existing\x20child\x20segment','132976vfLtVA','12iqhwLs','792aWKySl','error','✔\x20Updated\x20segment\x20\x27','Parent\x20ID:\x20','segment:update','109095IiFZny','execute','yellow','5981656uOvKal','parentId','22924580bQLryT','segmentId','Resolved\x20type:\x20','data','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','includes','rule','verbose','length','updateSegmentById','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','segmentPath','Updating\x20segment\x20\x27','Error:\x20Cannot\x20update\x20','folder','Resolving\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x27...','3368915QcxKkM','type','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','456799TtxQbn','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','378826XhFzTO'];a55_0x783e=function(){return _0x22e1c3;};return a55_0x783e();}export class SegmentUpdateCommand extends BaseCommand{[a55_0x440560(0x193)]=a55_0x440560(0x16f);['description']=a55_0x440560(0x196);async[a55_0x440560(0x171)](_0x54bae5){const _0x4f1051=a55_0x440560;console['error'](a55_0xc27533[_0x4f1051(0x172)](_0x4f1051(0x189))),console[_0x4f1051(0x16c)](a55_0xc27533[_0x4f1051(0x172)](_0x4f1051(0x179)));const {options:_0x12a825,args:_0x4b22af,tdx:_0x4fad56}=_0x54bae5,_0x5ac6fc=_0x12a825;if(_0x4b22af[_0x4f1051(0x17e)]===0x0)return console[_0x4f1051(0x16c)](_0x4f1051(0x180)),console[_0x4f1051(0x16c)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x4f1051(0x16c)]('Examples:'),console[_0x4f1051(0x16c)](_0x4f1051(0x17a)),console[_0x4f1051(0x16c)](_0x4f1051(0x18f)),0x1;const _0x392987=_0x4b22af[0x0],_0x350a72=_0x12a825[_0x4f1051(0x182)];let _0x347ea1=_0x392987;_0x350a72&&!_0x392987[_0x4f1051(0x17b)]('/')&&(_0x347ea1=_0x350a72+'/'+_0x392987,_0x5ac6fc[_0x4f1051(0x17d)]&&console[_0x4f1051(0x16c)](_0x4f1051(0x187)+_0x347ea1));const _0x1038b4=await withSpinner('Resolving\x20path\x20\x27'+_0x347ea1+'\x27...',()=>_0x4fad56[_0x4f1051(0x195)]['resolvePathToResource'](_0x347ea1),{'verbose':_0x5ac6fc[_0x4f1051(0x17d)]}),_0x495d99=_0x1038b4[_0x4f1051(0x178)];_0x5ac6fc[_0x4f1051(0x17d)]&&console['error'](_0x4f1051(0x177)+_0x495d99[_0x4f1051(0x18c)]);if(_0x495d99[_0x4f1051(0x18c)]!==_0x4f1051(0x195))return console['error'](_0x4f1051(0x184)+_0x495d99[_0x4f1051(0x18c)]+_0x4f1051(0x18d)),console[_0x4f1051(0x16c)](_0x4f1051(0x188)),0x1;if(!_0x495d99['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x4f1051(0x194));const _0x239a38=_0x495d99[_0x4f1051(0x174)],_0x129357=_0x495d99[_0x4f1051(0x176)];_0x5ac6fc['verbose']&&(console['error'](_0x4f1051(0x16e)+_0x239a38),console[_0x4f1051(0x16c)]('Segment\x20ID:\x20'+_0x129357));let _0x9ff1b7;if(_0x5ac6fc[_0x4f1051(0x185)]){const _0x2db71a=_0x5ac6fc[_0x4f1051(0x185)],_0x534545=await withSpinner(_0x4f1051(0x186)+_0x2db71a+_0x4f1051(0x18a),()=>_0x4fad56[_0x4f1051(0x195)]['resolveFolderId'](_0x239a38,_0x2db71a),{'verbose':_0x5ac6fc[_0x4f1051(0x17d)]});_0x9ff1b7=parseInt(_0x534545[_0x4f1051(0x178)],0xa),_0x5ac6fc['verbose']&&console[_0x4f1051(0x16c)](_0x4f1051(0x181)+_0x9ff1b7);}const _0x1a6c86=await loadJSONFromOptions(_0x5ac6fc[_0x4f1051(0x17c)],_0x5ac6fc['ruleFile']),_0x54a22c={'name':_0x5ac6fc['name'],'description':_0x5ac6fc[_0x4f1051(0x192)],'rule':_0x1a6c86,'kind':_0x5ac6fc['kind']!==undefined?parseInt(_0x5ac6fc['kind'],0xa):undefined,'segmentFolderId':_0x9ff1b7},_0x300806=await withSpinner(_0x4f1051(0x183)+_0x495d99['segmentName']+'\x27...',()=>_0x4fad56[_0x4f1051(0x195)][_0x4f1051(0x17f)](_0x239a38,_0x129357,_0x54a22c),{'verbose':_0x5ac6fc[_0x4f1051(0x17d)]}),_0x3dd4b5=_0x300806['data'];return console[_0x4f1051(0x16c)](_0x4f1051(0x16d)+_0x3dd4b5[_0x4f1051(0x193)]+'\x27'),_0x347ea1!==_0x392987&&console[_0x4f1051(0x16c)]('\x20\x20\x20Path:\x20'+_0x347ea1),await handleSDKOutput([_0x3dd4b5],_0x5ac6fc),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0xfc8696=a56_0x2128;(function(_0x3eaa60,_0x2a0723){const _0x998723=a56_0x2128,_0x2ba327=_0x3eaa60();while(!![]){try{const _0x326f00=parseInt(_0x998723(0xbc))/0x1*(-parseInt(_0x998723(0xc3))/0x2)+parseInt(_0x998723(0xbf))/0x3*(parseInt(_0x998723(0xb5))/0x4)+parseInt(_0x998723(0xd1))/0x5+parseInt(_0x998723(0xbe))/0x6*(parseInt(_0x998723(0xd7))/0x7)+-parseInt(_0x998723(0xb8))/0x8+parseInt(_0x998723(0xb1))/0x9*(-parseInt(_0x998723(0xc4))/0xa)+parseInt(_0x998723(0xa8))/0xb;if(_0x326f00===_0x2a0723)break;else _0x2ba327['push'](_0x2ba327['shift']());}catch(_0x2d89a7){_0x2ba327['push'](_0x2ba327['shift']());}}}(a56_0x4d5e,0xbca07));import{existsSync,statSync}from'fs';import a56_0x4f303e from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a56_0x4d5e(){const _0x4245af=['segmentPath','6793611dvRBIv','segments','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Usage:\x20tdx\x20segment\x20use\x20<path>','folderPath','execute','length','Folder\x20ID:\x20','slice','24237PWpecV','cyan','red','isDirectory','4RgqOic','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','3693664YDOqRl','verbose','parentName','isAbsolute','31377UESbUb','data','21846ngUtpy','4325826EWYIjb','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','parentId','error','82YEKPrn','10RznAki','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','resolvePathToResource','session','fullPath','log','type','green','Resolved\x20relative\x20path\x20to:\x20','site','1518630BAigeC','dim','Examples:','Error:\x20Path\x20is\x20required\x0a','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','folderId','308HNqqet','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Site:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','parent_segment','segment:use','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','✔\x20Context\x20set\x20to:\x20','description'];a56_0x4d5e=function(){return _0x4245af;};return a56_0x4d5e();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a56_0x2128(_0x1e1196,_0x351681){_0x1e1196=_0x1e1196-0x9e;const _0x4d5ea4=a56_0x4d5e();let _0x212827=_0x4d5ea4[_0x1e1196];return _0x212827;}export class SegmentUseCommand extends BaseCommand{['name']=a56_0xfc8696(0xa2);[a56_0xfc8696(0xa6)]=a56_0xfc8696(0xb7);async[a56_0xfc8696(0xad)](_0xbee1b2){const _0x46163c=a56_0xfc8696,{options:_0x12c6a4,args:_0x2c6f69,tdx:_0x189e57}=_0xbee1b2;if(_0x2c6f69['length']===0x0)return console['error'](a56_0x4f303e[_0x46163c(0xb3)](_0x46163c(0xd4))),console[_0x46163c(0xc2)](_0x46163c(0xab)),console['error'](_0x46163c(0xd3)),console[_0x46163c(0xc2)](_0x46163c(0xc0)),console[_0x46163c(0xc2)](_0x46163c(0x9e)),console[_0x46163c(0xc2)](_0x46163c(0xa3)),console['error'](_0x46163c(0xd5)),0x1;const _0x57e76f=_0x2c6f69[0x0],_0x6ba9a0=_0x12c6a4[_0x46163c(0xca)];try{if(_0x57e76f==='/')return saveSessionContext({'segment_path':undefined},_0x6ba9a0),console[_0x46163c(0xcc)](a56_0x4f303e[_0x46163c(0xce)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x57e76f)&&statSync(_0x57e76f)[_0x46163c(0xb4)]()){let _0x1dd3c7;try{_0x1dd3c7=findTdxConfig(_0x57e76f);}catch{return console[_0x46163c(0xc2)](a56_0x4f303e['red'](_0x46163c(0xc7)+_0x57e76f)),console[_0x46163c(0xc2)](a56_0x4f303e['cyan'](_0x46163c(0xb6))),0x1;}const _0x47ea70=_0x1dd3c7['config'][_0x46163c(0xa1)];return saveSessionContext({'segment_path':_0x47ea70,'parent_segment':_0x47ea70},_0x6ba9a0),console[_0x46163c(0xcc)](a56_0x4f303e[_0x46163c(0xce)](_0x46163c(0xa5)+a56_0x4f303e[_0x46163c(0xb2)](_0x47ea70))),0x0;}const _0x46f896=_0x12c6a4[_0x46163c(0xa7)];let _0x181fcd=_0x57e76f;const _0x3351cc=parsePath(_0x57e76f);if(!_0x3351cc[_0x46163c(0xbb)]){if(!_0x46f896)return console[_0x46163c(0xc2)](a56_0x4f303e[_0x46163c(0xb3)](_0x46163c(0xa4))),console[_0x46163c(0xc2)](a56_0x4f303e[_0x46163c(0xb2)](_0x46163c(0xc8))),0x1;if(_0x57e76f==='..'){const _0x2ac8de=_0x46f896['split']('/')[_0x46163c(0xb0)](0x0,-0x1)['join']('/');_0x181fcd=_0x2ac8de||'/';}else _0x57e76f==='.'?_0x181fcd=_0x46f896:_0x181fcd=_0x46f896+'/'+_0x57e76f;_0x12c6a4[_0x46163c(0xb9)]&&console['error'](_0x46163c(0xcf)+_0x181fcd);}if(_0x181fcd==='/'||_0x181fcd==='')return saveSessionContext({'segment_path':undefined},_0x6ba9a0),console['log'](a56_0x4f303e['green'](_0x46163c(0xaa))),0x0;_0x181fcd=normalizePath(_0x181fcd);const _0x3af1d0=parsePath(_0x181fcd)[_0x46163c(0xa9)];if(_0x3af1d0[_0x46163c(0xae)]===0x0)return saveSessionContext({'segment_path':undefined},_0x6ba9a0),console['log'](a56_0x4f303e[_0x46163c(0xce)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x12c6a4[_0x46163c(0xb9)]&&(console[_0x46163c(0xc2)](_0x46163c(0x9f)+_0x12c6a4[_0x46163c(0xd0)]),console[_0x46163c(0xc2)]('Target\x20path:\x20'+_0x181fcd));const _0x5c3d7=await withSpinner(_0x46163c(0xc6)+_0x181fcd+'\x27...',()=>_0x189e57['segment'][_0x46163c(0xc9)](_0x181fcd),{'verbose':_0x12c6a4[_0x46163c(0xb9)]}),_0x291cd0=_0x5c3d7[_0x46163c(0xbd)];_0x12c6a4[_0x46163c(0xb9)]&&(console[_0x46163c(0xc2)](_0x46163c(0xc5)+_0x291cd0[_0x46163c(0xcd)]),console[_0x46163c(0xc2)]('Parent\x20ID:\x20'+_0x291cd0[_0x46163c(0xc1)]),_0x291cd0[_0x46163c(0xd6)]&&console[_0x46163c(0xc2)](_0x46163c(0xaf)+_0x291cd0[_0x46163c(0xd6)]));if(_0x291cd0['type']==='segment')return console[_0x46163c(0xc2)](a56_0x4f303e['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x46163c(0xc2)](a56_0x4f303e[_0x46163c(0xb2)]('Use:\x20tdx\x20segment\x20use\x20'+_0x291cd0[_0x46163c(0xba)]+(_0x291cd0[_0x46163c(0xac)]?'/'+_0x291cd0[_0x46163c(0xac)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x291cd0['fullPath'],'parent_segment':_0x291cd0[_0x46163c(0xba)]},_0x6ba9a0),console[_0x46163c(0xcc)](a56_0x4f303e['green'](_0x46163c(0xa5)+a56_0x4f303e[_0x46163c(0xb2)](_0x291cd0[_0x46163c(0xcb)]))),_0x12c6a4[_0x46163c(0xb9)]&&(console['error'](a56_0x4f303e[_0x46163c(0xd2)](_0x46163c(0xd8))),console['error'](a56_0x4f303e['dim'](_0x46163c(0xa0)))),0x0;}catch(_0x440cd2){throw _0x440cd2;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a57_0x5e0d62=a57_0x57f3;function a57_0x57f3(_0x33220f,_0x30416f){_0x33220f=_0x33220f-0x16c;const _0x398f1d=a57_0x398f();let _0x57f3fe=_0x398f1d[_0x33220f];return _0x57f3fe;}function a57_0x398f(){const _0x5eaa45=['7383680PlEZZs','11536704tCwmhT','filePath','errors','hasErrors','valid','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','endsWith','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','574752XJFxrd','verbose','.yml','4509540junOJu','\x20warning(s)\x20found','.yaml','type','Validate\x20segment\x20and\x20journey\x20YAML\x20files','length','segment:validate','warnings','\x20warning(s)','Validation\x20failed:\x20','errorCode','36tRatcT','77772pTcrSg','yellow','no_parent','964369izCmXZ','warningCount','description','green','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentSegment','error','execute','30gXvXvj','\x20file(s)\x20valid','1769888tcYPsj','targetDir','validCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','helpText','\x20file(s)\x20with\x20errors,\x20','red','\x20valid','\x20error(s)','name','file','Error:\x20Directory\x20not\x20found:\x20','log','dim','):\x20','cyan'];a57_0x398f=function(){return _0x5eaa45;};return a57_0x398f();}(function(_0x20780e,_0x204d99){const _0x5a60d8=a57_0x57f3,_0x492a45=_0x20780e();while(!![]){try{const _0x56c751=parseInt(_0x5a60d8(0x182))/0x1+parseInt(_0x5a60d8(0x17e))/0x2*(-parseInt(_0x5a60d8(0x17f))/0x3)+parseInt(_0x5a60d8(0x18c))/0x4+-parseInt(_0x5a60d8(0x18a))/0x5*(-parseInt(_0x5a60d8(0x170))/0x6)+-parseInt(_0x5a60d8(0x173))/0x7+parseInt(_0x5a60d8(0x19c))/0x8+-parseInt(_0x5a60d8(0x19d))/0x9;if(_0x56c751===_0x204d99)break;else _0x492a45['push'](_0x492a45['shift']());}catch(_0x57ed28){_0x492a45['push'](_0x492a45['shift']());}}}(a57_0x398f,0x7cf65));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a57_0x40a29b from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a57_0x5e0d62(0x195)]=a57_0x5e0d62(0x179);[a57_0x5e0d62(0x184)]=a57_0x5e0d62(0x177);async[a57_0x5e0d62(0x189)](_0x575c51){const _0xb91c5f=a57_0x5e0d62,{options:_0x2039a3,args:_0x2b4445}=_0x575c51,_0x3a4096=_0x2039a3,_0x9ba725=await resolveTarget({'arg':_0x2b4445[0x0],'contextParent':_0x2039a3[_0xb91c5f(0x187)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x9ba725))return _0x9ba725[_0xb91c5f(0x17d)]===_0xb91c5f(0x181)?(console['error'](a57_0x40a29b['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0xb91c5f(0x188)](_0xb91c5f(0x16d)),console[_0xb91c5f(0x188)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error'](_0xb91c5f(0x18f))):(console[_0xb91c5f(0x188)](a57_0x40a29b[_0xb91c5f(0x192)]('Error:\x20'+_0x9ba725['message']+'\x0a')),_0x9ba725['helpText']&&console[_0xb91c5f(0x188)](a57_0x40a29b[_0xb91c5f(0x19b)](_0x9ba725[_0xb91c5f(0x190)]))),0x1;const _0x5ee96e=_0x9ba725[_0xb91c5f(0x18d)],_0x1eb861=_0x9ba725[_0xb91c5f(0x176)]===_0xb91c5f(0x196)?_0x9ba725[_0xb91c5f(0x19e)]:undefined;if(!_0x1eb861&&!existsSync(_0x5ee96e))return console[_0xb91c5f(0x188)](a57_0x40a29b[_0xb91c5f(0x192)](_0xb91c5f(0x197)+_0x5ee96e+'\x0a')),0x1;let _0x58dac8;if(_0x1eb861){if(!_0x1eb861[_0xb91c5f(0x16e)](_0xb91c5f(0x172))&&!_0x1eb861[_0xb91c5f(0x16e)](_0xb91c5f(0x175)))return console[_0xb91c5f(0x188)](a57_0x40a29b[_0xb91c5f(0x192)](_0xb91c5f(0x186)+_0x1eb861+'\x0a')),0x1;_0x58dac8=[_0x1eb861];}else _0x58dac8=findYamlFiles(_0x5ee96e);if(_0x58dac8[_0xb91c5f(0x178)]===0x0)return console[_0xb91c5f(0x188)](a57_0x40a29b['red'](_0xb91c5f(0x16f)+_0x5ee96e+'\x0a')),0x1;const _0xef53d5=validateYamlFiles(_0x58dac8,_0x5ee96e),_0x46b6e8=calculateSummary(_0xef53d5);for(const _0x51d21c of _0xef53d5){if(!isValidationResult(_0x51d21c))continue;const {relativePath:_0x4fbdbc,source:_0x88280,result:_0x33e5f1,fileType:_0x1a2bb4}=_0x51d21c,_0xc24089=_0x1a2bb4;if(_0x33e5f1[_0xb91c5f(0x16c)]&&_0x33e5f1[_0xb91c5f(0x17a)][_0xb91c5f(0x178)]===0x0)_0x3a4096[_0xb91c5f(0x171)]&&console['log'](a57_0x40a29b[_0xb91c5f(0x185)]('✔\x20'+_0x4fbdbc)+a57_0x40a29b['dim']('\x20('+_0xc24089+')'));else _0x33e5f1[_0xb91c5f(0x16c)]?(console[_0xb91c5f(0x198)](a57_0x40a29b[_0xb91c5f(0x180)]('⚠\x20'+_0x4fbdbc)+a57_0x40a29b[_0xb91c5f(0x199)]('\x20('+_0xc24089+_0xb91c5f(0x19a)+_0x33e5f1['warnings'][_0xb91c5f(0x178)]+_0xb91c5f(0x17b))),console['log'](formatValidationResult(_0x33e5f1,_0x88280,_0x4fbdbc))):(console[_0xb91c5f(0x198)](a57_0x40a29b['red']('✖\x20'+_0x4fbdbc)+a57_0x40a29b['dim']('\x20('+_0xc24089+_0xb91c5f(0x19a)+_0x33e5f1[_0xb91c5f(0x19f)][_0xb91c5f(0x178)]+_0xb91c5f(0x194))),console[_0xb91c5f(0x198)](formatValidationResult(_0x33e5f1,_0x88280,_0x4fbdbc)));}return console[_0xb91c5f(0x198)](''),_0x46b6e8[_0xb91c5f(0x1a0)]?(console[_0xb91c5f(0x198)](a57_0x40a29b[_0xb91c5f(0x192)](_0xb91c5f(0x17c)+_0x46b6e8['invalidCount']+_0xb91c5f(0x191)+_0x46b6e8[_0xb91c5f(0x18e)]+_0xb91c5f(0x193))),_0x46b6e8[_0xb91c5f(0x183)]>0x0&&console[_0xb91c5f(0x198)](a57_0x40a29b['yellow'](_0x46b6e8[_0xb91c5f(0x183)]+_0xb91c5f(0x174))),0x1):(console[_0xb91c5f(0x198)](a57_0x40a29b[_0xb91c5f(0x185)]('✔\x20All\x20'+_0x46b6e8[_0xb91c5f(0x18e)]+_0xb91c5f(0x18b))),_0x46b6e8[_0xb91c5f(0x183)]>0x0&&console[_0xb91c5f(0x198)](a57_0x40a29b[_0xb91c5f(0x180)](_0x46b6e8[_0xb91c5f(0x183)]+'\x20warning(s)\x20found')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a58_0x1582a6=a58_0x1682;(function(_0x5337d5,_0x102525){const _0x26ea23=a58_0x1682,_0xa00ec4=_0x5337d5();while(!![]){try{const _0x6fc65e=-parseInt(_0x26ea23(0xca))/0x1+parseInt(_0x26ea23(0xfc))/0x2*(-parseInt(_0x26ea23(0xee))/0x3)+parseInt(_0x26ea23(0xc2))/0x4*(parseInt(_0x26ea23(0xda))/0x5)+-parseInt(_0x26ea23(0xd8))/0x6*(-parseInt(_0x26ea23(0xcb))/0x7)+-parseInt(_0x26ea23(0xe1))/0x8*(-parseInt(_0x26ea23(0xf7))/0x9)+parseInt(_0x26ea23(0x116))/0xa+parseInt(_0x26ea23(0xf5))/0xb*(parseInt(_0x26ea23(0x10c))/0xc);if(_0x6fc65e===_0x102525)break;else _0xa00ec4['push'](_0xa00ec4['shift']());}catch(_0x525e90){_0xa00ec4['push'](_0xa00ec4['shift']());}}}(a58_0x1248,0x75c8d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a58_0x1248(){const _0x5e8bbd=['name','listRecursive','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','listWithPattern','padEnd','Parent\x20segment\x20context:\x20','1226230uTmsuI','toLowerCase','/app/ps/','journey','/e/','error','maxDepth','Resolving\x20path\x20\x27','4eKoMpc','Error:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Built\x20tree\x20with\x20','format','map','path','\x27...','546851MusYpi','7rdCacX','parentId','Site:\x20','length','verbose','Parent\x20ID:\x20','parentSegment','dim','searchByName','Resolving\x20parent\x20segment\x20\x27',']\x20matching\x20\x27','description','\x20match','565350FyOwAm','Recursive\x20mode:\x20enabled','3515905XyhjBT','Listing\x20folders,\x20segments,\x20and\x20journeys...','Folder/pattern\x20arg:\x20','data','localeCompare','folder','sort','904yxFSYd','folders','(id\x20','filter','segment','No\x20folders\x20or\x20segments\x20match\x20','message','\x20journey','journeyBundleName','(empty)','type','Building\x20hierarchy\x20tree...','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','1419LqMBMI','Set\x20a\x20parent\x20segment\x20context\x20first:','List\x20folders\x20and\x20child\x20segments','listUnifiedWithJourneys','journeys','resolvePathToResource','Folder\x20ID:\x20','54846oWEwoU','\x20\x20Cause:\x20','53127GEtLsS','✔\x20Found\x20','\x20segment','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','3012jxKKcH','...','\x20folder',',\x20and\x20','test','children','log','jsonl','folderId','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','recursive','No\x20items\x20match\x20pattern:\x20','site','segments','\x20matching\x20\x27','json','372esLqRr','listUnified','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','Found\x20'];a58_0x1248=function(){return _0x5e8bbd;};return a58_0x1248();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a58_0x1682(_0x2d0036,_0x163298){_0x2d0036=_0x2d0036-0xbf;const _0x12480a=a58_0x1248();let _0x168287=_0x12480a[_0x2d0036];return _0x168287;}import a58_0x568502 from'chalk';export class SegmentsCommand extends BaseCommand{[a58_0x1582a6(0x110)]=a58_0x1582a6(0x109);[a58_0x1582a6(0xd6)]=a58_0x1582a6(0xf0);async['execute'](_0x4a7647){const _0x5b8b2d=a58_0x1582a6,{options:_0x5ee588,args:_0x5222be}=_0x4a7647,_0x26d581=_0x5ee588[_0x5b8b2d(0x106)],_0x360a6c=_0x5222be[0x0];try{const _0x41e737=_0x5ee588[_0x5b8b2d(0xd1)];_0x5ee588[_0x5b8b2d(0xcf)]&&(console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xcd)+_0x5ee588[_0x5b8b2d(0x108)]),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0x115)+(_0x41e737||'(not\x20set)')),_0x360a6c&&console['error'](_0x5b8b2d(0xdc)+_0x360a6c),_0x26d581&&console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xd9)));if(!_0x41e737)return console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xfa)),console['error'](''),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xef)),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xc4)),console['error'](_0x5b8b2d(0x105)),console[_0x5b8b2d(0xbf)](''),console['error'](_0x5b8b2d(0x112)),0x1;if(_0x360a6c&&_0x26d581)return await this[_0x5b8b2d(0xd3)](_0x4a7647,_0x41e737,_0x360a6c);const _0x3be4cf=_0x360a6c&&(_0x360a6c['includes']('*')||_0x360a6c['includes']('?'));if(_0x3be4cf)return await this[_0x5b8b2d(0x113)](_0x4a7647,_0x41e737,_0x360a6c);const _0x587009=_0x360a6c?_0x41e737+'/'+_0x360a6c:_0x41e737;return _0x26d581?await this[_0x5b8b2d(0x111)](_0x4a7647,_0x587009):await this[_0x5b8b2d(0x10d)](_0x4a7647,_0x587009);}catch(_0x596dea){if(_0x596dea instanceof SDKError)return console['error'](_0x5b8b2d(0xc3)+_0x596dea[_0x5b8b2d(0xe7)]),_0x596dea['cause']&&console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xf6)+_0x596dea['cause']),0x1;throw _0x596dea;}}async[a58_0x1582a6(0xd3)](_0x1ebd23,_0x31e893,_0x37e303){const _0xf8c8c4=a58_0x1582a6,{options:_0x36e804,tdx:_0x5584e9}=_0x1ebd23,_0x5dfa4f='\x22'+_0x37e303+'\x22',_0x169830=await withSpinner(_0xf8c8c4(0xc1)+_0x31e893+_0xf8c8c4(0xc9),()=>_0x5584e9[_0xf8c8c4(0xe5)]['resolvePathToResource'](_0x31e893),{'verbose':_0x36e804[_0xf8c8c4(0xcf)]}),_0x5aca56=_0x169830[_0xf8c8c4(0xdd)],_0x587a06=_0x36e804['maxDepth']||0xa,_0xa03f53=await withSpinner(_0xf8c8c4(0x10e)+_0x5dfa4f+_0xf8c8c4(0xfd),()=>_0x5584e9['segment']['listRecursive'](_0x5aca56[_0xf8c8c4(0xcc)],_0x5aca56[_0xf8c8c4(0x104)],0x0,_0x587a06),{'verbose':_0x36e804[_0xf8c8c4(0xcf)]}),_0x2a836a=searchTreeByName(_0xa03f53[_0xf8c8c4(0xdd)],_0x37e303),_0x1f541c=_0x6d1274=>getConsoleNextUrl(_0x36e804[_0xf8c8c4(0x108)],_0xf8c8c4(0x118)+_0x5aca56[_0xf8c8c4(0xcc)]+'/e/'+_0x6d1274),_0x39cfbd=[..._0x2a836a][_0xf8c8c4(0xe0)]((_0x544120,_0x5ec1ec)=>_0x544120[_0xf8c8c4(0xc8)][_0xf8c8c4(0xde)](_0x5ec1ec[_0xf8c8c4(0xc8)])),_0xa106a2=0x32,_0x42f7d4=_0xf8c8c4(0x10f)+_0x2a836a[_0xf8c8c4(0xce)]+_0xf8c8c4(0xd7)+(_0x2a836a['length']!==0x1?'es':'');console[_0xf8c8c4(0xbf)](_0x2a836a[_0xf8c8c4(0xce)]>_0xa106a2?'✔\x20'+_0x42f7d4+'\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.':'✔\x20'+_0x42f7d4);if(_0x36e804[_0xf8c8c4(0xc6)]===_0xf8c8c4(0x10b)||_0x36e804[_0xf8c8c4(0xc6)]===_0xf8c8c4(0x103)){const _0x26f8e8=_0x39cfbd[_0xf8c8c4(0xc7)](_0x412182=>({..._0x412182,..._0x412182[_0xf8c8c4(0xeb)]===_0xf8c8c4(0xe5)?{'url':_0x1f541c(_0x412182['id'])}:{}}));return await handleSDKOutput(_0x26f8e8,_0x36e804),0x0;}if(_0x2a836a['length']===0x0)return console[_0xf8c8c4(0x102)](_0xf8c8c4(0xe6)+_0x5dfa4f),0x0;for(const _0x5dfd5a of _0x39cfbd){console['log'](_0x5dfd5a['type'][_0xf8c8c4(0x114)](0x8)+'\x20'+_0x5dfd5a[_0xf8c8c4(0xc8)]+'\x20\x20'+a58_0x568502[_0xf8c8c4(0xd2)](_0xf8c8c4(0xe3)+_0x5dfd5a['id']+')'));}const _0x4f02d4=_0x2a836a['filter'](_0x4e4d1f=>_0x4e4d1f[_0xf8c8c4(0xeb)]===_0xf8c8c4(0xe5)),_0x11f9a9=new Set(_0x4f02d4[_0xf8c8c4(0xc7)](_0x59df5e=>_0x59df5e[_0xf8c8c4(0x110)][_0xf8c8c4(0x117)]()))['size']===0x1;return _0x4f02d4[_0xf8c8c4(0xce)]>0x1&&_0x11f9a9&&console[_0xf8c8c4(0x102)](a58_0x568502['dim']('\x0a'+_0x4f02d4[_0xf8c8c4(0xce)]+_0xf8c8c4(0xed))),0x0;}async['listWithPattern'](_0x359ca4,_0x121fa9,_0x400ac9){const _0x46d477=a58_0x1582a6,{options:_0x22b50d,tdx:_0x38a428}=_0x359ca4,_0x45a4e6=await withSpinner(_0x46d477(0xd4)+_0x121fa9+_0x46d477(0xc9),()=>_0x38a428[_0x46d477(0xe5)][_0x46d477(0xf3)](_0x121fa9),{'verbose':_0x22b50d['verbose']}),_0x1b7aa3=_0x45a4e6['data'],_0x55b2ea=await withSpinner(_0x46d477(0xdb),()=>_0x38a428['segment'][_0x46d477(0xf1)](_0x1b7aa3['parentId'],_0x1b7aa3[_0x46d477(0x104)]),{'verbose':_0x22b50d[_0x46d477(0xcf)]}),{folders:_0x4ac0c9,segments:_0x53a7eb,journeys:_0x2926a0}=_0x55b2ea[_0x46d477(0xdd)],_0x32d6fe=_0x400ac9['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x49ac53=new RegExp('^'+_0x32d6fe+'$','i'),_0x3f9294=_0x4ac0c9[_0x46d477(0xe4)](_0x2dd289=>_0x49ac53[_0x46d477(0x100)](_0x2dd289[_0x46d477(0x110)])),_0x1dfede=_0x53a7eb['filter'](_0x5e4ae8=>_0x49ac53[_0x46d477(0x100)](_0x5e4ae8[_0x46d477(0x110)])),_0xae7370=_0x2926a0[_0x46d477(0xe4)](_0x4e851e=>_0x49ac53[_0x46d477(0x100)](_0x4e851e[_0x46d477(0xe9)])),_0x368053=_0x3f9294[_0x46d477(0xce)]+_0x1dfede[_0x46d477(0xce)]+_0xae7370[_0x46d477(0xce)];console['error'](_0x46d477(0xf8)+_0x3f9294[_0x46d477(0xce)]+_0x46d477(0xfe)+(_0x3f9294[_0x46d477(0xce)]!==0x1?'s':'')+',\x20'+_0x1dfede['length']+_0x46d477(0xf9)+(_0x1dfede[_0x46d477(0xce)]!==0x1?'s':'')+_0x46d477(0xff)+_0xae7370[_0x46d477(0xce)]+_0x46d477(0xe8)+(_0xae7370['length']!==0x1?'s':'')+_0x46d477(0x10a)+_0x400ac9+'\x27');const _0x4eda19=_0xea7cfd=>{return getConsoleNextUrl(_0x22b50d['site'],'/app/ps/'+_0x1b7aa3['parentId']+'/e/'+_0xea7cfd);},_0x138bb2=_0x22b50d[_0x46d477(0xc6)]==='json'||_0x22b50d[_0x46d477(0xc6)]===_0x46d477(0x103);if(_0x138bb2){const _0x11a05b=[..._0x3f9294['map'](_0x7ff07e=>({..._0x7ff07e,'type':_0x46d477(0xdf)})),..._0x1dfede[_0x46d477(0xc7)](_0x1dfd25=>({..._0x1dfd25,'type':_0x46d477(0xe5),'url':_0x4eda19(_0x1dfd25['id'])})),..._0xae7370[_0x46d477(0xc7)](_0xb1bc8=>({..._0xb1bc8,'name':_0xb1bc8[_0x46d477(0xe9)],'type':_0x46d477(0x119)}))]['sort']((_0x15e186,_0x2fe8d2)=>_0x15e186[_0x46d477(0x110)]['localeCompare'](_0x2fe8d2[_0x46d477(0x110)]));await handleSDKOutput(_0x11a05b,_0x22b50d);}else{if(_0x368053===0x0)console[_0x46d477(0x102)](_0x46d477(0x107)+_0x400ac9);else{console[_0x46d477(0x102)](a58_0x568502[_0x46d477(0xd2)]('['+_0x121fa9+_0x46d477(0xd5)+_0x400ac9+'\x27'));const _0x596872=formatFlatList(_0x3f9294,_0x1dfede,{'showMetadata':!![],'getSegmentUrl':_0x4eda19},_0xae7370);console[_0x46d477(0x102)](_0x596872);}}return 0x0;}async[a58_0x1582a6(0x10d)](_0x40a195,_0x2e2d30){const _0xfdf88a=a58_0x1582a6,{options:_0x45efe5,tdx:_0x2bad67}=_0x40a195,_0x25f026=await withSpinner(_0xfdf88a(0xc1)+_0x2e2d30+_0xfdf88a(0xc9),()=>_0x2bad67[_0xfdf88a(0xe5)][_0xfdf88a(0xf3)](_0x2e2d30),{'verbose':_0x45efe5[_0xfdf88a(0xcf)]}),_0x2a5fdd=_0x25f026[_0xfdf88a(0xdd)];_0x45efe5['verbose']&&(console['error'](_0xfdf88a(0xd0)+_0x2a5fdd[_0xfdf88a(0xcc)]),_0x2a5fdd[_0xfdf88a(0x104)]&&console[_0xfdf88a(0xbf)](_0xfdf88a(0xf4)+_0x2a5fdd[_0xfdf88a(0x104)]));const _0x49996e=await withSpinner(_0xfdf88a(0xdb),()=>_0x2bad67['segment'][_0xfdf88a(0xf1)](_0x2a5fdd[_0xfdf88a(0xcc)],_0x2a5fdd[_0xfdf88a(0x104)]),{'verbose':_0x45efe5['verbose']}),{folders:_0x17dd0c,segments:_0x300652,journeys:_0x118d50}=_0x49996e[_0xfdf88a(0xdd)],_0x413aaf=_0x17dd0c[_0xfdf88a(0xce)]+_0x300652[_0xfdf88a(0xce)]+_0x118d50[_0xfdf88a(0xce)];console[_0xfdf88a(0xbf)]('✔\x20Found\x20'+_0x17dd0c['length']+_0xfdf88a(0xfe)+(_0x17dd0c[_0xfdf88a(0xce)]!==0x1?'s':'')+',\x20'+_0x300652[_0xfdf88a(0xce)]+'\x20segment'+(_0x300652[_0xfdf88a(0xce)]!==0x1?'s':'')+_0xfdf88a(0xff)+_0x118d50[_0xfdf88a(0xce)]+_0xfdf88a(0xe8)+(_0x118d50[_0xfdf88a(0xce)]!==0x1?'s':''));const _0x52dc5c=_0x438272=>{const _0x4671dc=_0xfdf88a;return getConsoleNextUrl(_0x45efe5[_0x4671dc(0x108)],_0x4671dc(0x118)+_0x2a5fdd[_0x4671dc(0xcc)]+'/e/'+_0x438272);},_0x437896=_0x54f1e3=>{const _0x3aaa2e=_0xfdf88a;return getConsoleNextUrl(_0x45efe5['site'],'/app/ps/'+_0x2a5fdd[_0x3aaa2e(0xcc)]+_0x3aaa2e(0x11a)+_0x54f1e3+_0x3aaa2e(0xfb));},_0x1b3c81=_0x45efe5[_0xfdf88a(0xc6)]===_0xfdf88a(0x10b)||_0x45efe5[_0xfdf88a(0xc6)]===_0xfdf88a(0x103);if(_0x1b3c81){const _0x4f7fce=[..._0x17dd0c['map'](_0x209575=>({..._0x209575,'type':_0xfdf88a(0xdf)})),..._0x300652[_0xfdf88a(0xc7)](_0x496411=>({..._0x496411,'type':_0xfdf88a(0xe5),'url':_0x52dc5c(_0x496411['id'])})),..._0x118d50[_0xfdf88a(0xc7)](_0x4bfce8=>({..._0x4bfce8,'name':_0x4bfce8['journeyBundleName'],'type':'journey','url':_0x437896(_0x4bfce8['id'])}))][_0xfdf88a(0xe0)]((_0x3a28e7,_0xecd19d)=>_0x3a28e7[_0xfdf88a(0x110)][_0xfdf88a(0xde)](_0xecd19d[_0xfdf88a(0x110)]));await handleSDKOutput(_0x4f7fce,_0x45efe5);}else{if(_0x413aaf===0x0)console[_0xfdf88a(0x102)](a58_0x568502[_0xfdf88a(0xd2)]('['+_0x2e2d30+']')),console[_0xfdf88a(0x102)](_0xfdf88a(0xea));else{console['log'](a58_0x568502['dim']('['+_0x2e2d30+']'));const _0x5699be=formatFlatList(_0x17dd0c,_0x300652,{'showMetadata':!![],'getSegmentUrl':_0x52dc5c,'getJourneyUrl':_0x437896},_0x118d50);console['log'](_0x5699be);}}return 0x0;}async['listRecursive'](_0x8f9578,_0x1f50a5){const _0x440499=a58_0x1582a6,{options:_0x437c38,tdx:_0x55c442}=_0x8f9578,_0x429afa=await withSpinner('Resolving\x20path\x20\x27'+_0x1f50a5+_0x440499(0xc9),()=>_0x55c442[_0x440499(0xe5)][_0x440499(0xf3)](_0x1f50a5),{'verbose':_0x437c38[_0x440499(0xcf)]}),_0x44e5f6=_0x429afa[_0x440499(0xdd)];_0x437c38['verbose']&&(console[_0x440499(0xbf)](_0x440499(0xd0)+_0x44e5f6[_0x440499(0xcc)]),_0x44e5f6[_0x440499(0x104)]&&console[_0x440499(0xbf)](_0x440499(0xf4)+_0x44e5f6['folderId']));const _0x9e46e8=_0x437c38[_0x440499(0xc0)]||0xa,_0x6be93=await withSpinner(_0x440499(0xec),()=>_0x55c442[_0x440499(0xe5)][_0x440499(0x111)](_0x44e5f6['parentId'],_0x44e5f6[_0x440499(0x104)],0x0,_0x9e46e8),{'verbose':_0x437c38[_0x440499(0xcf)]}),_0x4af064=_0x6be93[_0x440499(0xdd)],_0x147f2c=_0x17773d=>{const _0x59d651=_0x440499;let _0x30e1aa=0x0,_0x4cc678=0x0,_0x1e9f4d=0x0;for(const _0x4a4fb4 of _0x17773d){if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0xdf))_0x30e1aa++;else{if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0xe5))_0x4cc678++;else{if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0x119))_0x1e9f4d++;}}if(_0x4a4fb4['children']){const _0x3fe137=_0x147f2c(_0x4a4fb4[_0x59d651(0x101)]);_0x30e1aa+=_0x3fe137['folders'],_0x4cc678+=_0x3fe137[_0x59d651(0x109)],_0x1e9f4d+=_0x3fe137[_0x59d651(0xf2)];}}return{'folders':_0x30e1aa,'segments':_0x4cc678,'journeys':_0x1e9f4d};},_0x2602e9=_0x147f2c(_0x4af064);console['error'](_0x440499(0xc5)+_0x2602e9[_0x440499(0xe2)]+'\x20folder'+(_0x2602e9[_0x440499(0xe2)]!==0x1?'s':'')+',\x20'+_0x2602e9[_0x440499(0x109)]+_0x440499(0xf9)+(_0x2602e9[_0x440499(0x109)]!==0x1?'s':'')+_0x440499(0xff)+_0x2602e9[_0x440499(0xf2)]+'\x20journey'+(_0x2602e9[_0x440499(0xf2)]!==0x1?'s':''));const _0x597d32=_0x4b682f=>{const _0x2a7cf0=_0x440499;return getConsoleNextUrl(_0x437c38[_0x2a7cf0(0x108)],_0x2a7cf0(0x118)+_0x44e5f6[_0x2a7cf0(0xcc)]+'/e/'+_0x4b682f);},_0x54b164=_0x151898=>{const _0x36204f=_0x440499;return getConsoleNextUrl(_0x437c38[_0x36204f(0x108)],_0x36204f(0x118)+_0x44e5f6[_0x36204f(0xcc)]+_0x36204f(0x11a)+_0x151898+'/j/da');};if(_0x437c38['format']===_0x440499(0x10b)||_0x437c38[_0x440499(0xc6)]===_0x440499(0x103))await handleSDKOutput(_0x4af064,_0x437c38);else{console[_0x440499(0x102)](a58_0x568502[_0x440499(0xd2)]('['+_0x1f50a5+']'));const _0x2173e7=formatTree(_0x4af064,{'showMetadata':!![],'getSegmentUrl':_0x597d32,'getJourneyUrl':_0x54b164});console[_0x440499(0x102)](_0x2173e7);}return 0x0;}}
|
|
1
|
+
const a58_0x36863c=a58_0x1708;(function(_0x39463b,_0x345428){const _0x5e2f25=a58_0x1708,_0x51a30a=_0x39463b();while(!![]){try{const _0x197863=-parseInt(_0x5e2f25(0x106))/0x1+-parseInt(_0x5e2f25(0x134))/0x2+parseInt(_0x5e2f25(0x11d))/0x3+-parseInt(_0x5e2f25(0x121))/0x4+parseInt(_0x5e2f25(0x135))/0x5+parseInt(_0x5e2f25(0x11c))/0x6+-parseInt(_0x5e2f25(0x120))/0x7;if(_0x197863===_0x345428)break;else _0x51a30a['push'](_0x51a30a['shift']());}catch(_0x149099){_0x51a30a['push'](_0x51a30a['shift']());}}}(a58_0x1d96,0x6fdf4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a58_0x1708(_0x11e5f2,_0xa18006){_0x11e5f2=_0x11e5f2-0xf8;const _0x1d9681=a58_0x1d96();let _0x17087b=_0x1d9681[_0x11e5f2];return _0x17087b;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a58_0x40354f from'chalk';function a58_0x1d96(){const _0x50c1c7=['children','Recursive\x20mode:\x20enabled','1639218fTfmCX','118396ckZKag','length','json','name','\x20\x20Cause:\x20','test','listUnifiedWithJourneys','size','journeyBundleName','type','Set\x20a\x20parent\x20segment\x20context\x20first:','✔\x20Found\x20','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','...','data','filter','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','sort','\x20match','943558RGmetp','3099935LmNElJ','Building\x20hierarchy\x20tree...','Folder\x20ID:\x20','dim','List\x20folders\x20and\x20child\x20segments','folderId','maxDepth','listUnified','folder','error','toLowerCase','folders','replace','Parent\x20ID:\x20','\x5c$&','padEnd','execute',']\x20matching\x20\x27','recursive','segments','segment','Found\x20','(id\x20','journeys',',\x20and\x20','map','Error:\x20','\x20matching\x20\x27','(empty)','site','description','/app/ps/','parentId','✔\x20Built\x20tree\x20with\x20','localeCompare','Resolving\x20parent\x20segment\x20\x27','resolvePathToResource','jsonl','790643iRQRlG','listRecursive','includes','listWithPattern','cause','\x20folder','\x27...','verbose','/e/','journey','\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.','No\x20items\x20match\x20pattern:\x20','Parent\x20segment\x20context:\x20','path','Resolving\x20path\x20\x27','log','Site:\x20','\x20segment','\x20journey','searchByName','format','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','5096460kcBfYE','1545078UNyeOi'];a58_0x1d96=function(){return _0x50c1c7;};return a58_0x1d96();}export class SegmentsCommand extends BaseCommand{['name']=a58_0x36863c(0x148);[a58_0x36863c(0xfe)]=a58_0x36863c(0x139);async[a58_0x36863c(0x145)](_0x5ee13d){const _0x50ae0d=a58_0x36863c,{options:_0x59ad4e,args:_0x58da26}=_0x5ee13d,_0x58ed9d=_0x59ad4e[_0x50ae0d(0x147)],_0x19bdd5=_0x58da26[0x0];try{const _0x573903=_0x59ad4e['parentSegment'];_0x59ad4e[_0x50ae0d(0x10d)]&&(console[_0x50ae0d(0x13e)](_0x50ae0d(0x116)+_0x59ad4e[_0x50ae0d(0xfd)]),console[_0x50ae0d(0x13e)](_0x50ae0d(0x112)+(_0x573903||'(not\x20set)')),_0x19bdd5&&console[_0x50ae0d(0x13e)]('Folder/pattern\x20arg:\x20'+_0x19bdd5),_0x58ed9d&&console[_0x50ae0d(0x13e)](_0x50ae0d(0x11f)));if(!_0x573903)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x50ae0d(0x13e)](_0x50ae0d(0x12b)),console[_0x50ae0d(0x13e)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x50ae0d(0x13e)](_0x50ae0d(0x11b)),console[_0x50ae0d(0x13e)](''),console[_0x50ae0d(0x13e)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;if(_0x19bdd5&&_0x58ed9d)return await this[_0x50ae0d(0x119)](_0x5ee13d,_0x573903,_0x19bdd5);const _0xe62aaf=_0x19bdd5&&(_0x19bdd5[_0x50ae0d(0x108)]('*')||_0x19bdd5['includes']('?'));if(_0xe62aaf)return await this[_0x50ae0d(0x109)](_0x5ee13d,_0x573903,_0x19bdd5);const _0x3c3841=_0x19bdd5?_0x573903+'/'+_0x19bdd5:_0x573903;return _0x58ed9d?await this[_0x50ae0d(0x107)](_0x5ee13d,_0x3c3841):await this[_0x50ae0d(0x13c)](_0x5ee13d,_0x3c3841);}catch(_0x284537){if(_0x284537 instanceof SDKError)return console[_0x50ae0d(0x13e)](_0x50ae0d(0xfa)+_0x284537['message']),_0x284537[_0x50ae0d(0x10a)]&&console['error'](_0x50ae0d(0x125)+_0x284537[_0x50ae0d(0x10a)]),0x1;throw _0x284537;}}async[a58_0x36863c(0x119)](_0x5192be,_0x3e353e,_0x5e4463){const _0x57c4ef=a58_0x36863c,{options:_0x44e69a,tdx:_0x2fa232}=_0x5192be,_0x20c72c='\x22'+_0x5e4463+'\x22',_0x21a98d=await withSpinner(_0x57c4ef(0x114)+_0x3e353e+_0x57c4ef(0x10c),()=>_0x2fa232[_0x57c4ef(0x149)][_0x57c4ef(0x104)](_0x3e353e),{'verbose':_0x44e69a['verbose']}),_0x1c9844=_0x21a98d['data'],_0x4d4485=_0x44e69a[_0x57c4ef(0x13b)]||0xa,_0x41bebe=await withSpinner(_0x57c4ef(0x12d)+_0x20c72c+_0x57c4ef(0x12e),()=>_0x2fa232[_0x57c4ef(0x149)]['listRecursive'](_0x1c9844['parentId'],_0x1c9844[_0x57c4ef(0x13a)],0x0,_0x4d4485),{'verbose':_0x44e69a['verbose']}),_0x496c18=searchTreeByName(_0x41bebe[_0x57c4ef(0x12f)],_0x5e4463),_0x2fea21=_0x1aeb11=>getConsoleNextUrl(_0x44e69a[_0x57c4ef(0xfd)],'/app/ps/'+_0x1c9844[_0x57c4ef(0x100)]+'/e/'+_0x1aeb11),_0x5c4341=[..._0x496c18][_0x57c4ef(0x132)]((_0x552f48,_0xa2fdac)=>_0x552f48[_0x57c4ef(0x113)][_0x57c4ef(0x102)](_0xa2fdac[_0x57c4ef(0x113)])),_0x1b8dc1=0x32,_0xd2c8ad=_0x57c4ef(0x14a)+_0x496c18[_0x57c4ef(0x122)]+_0x57c4ef(0x133)+(_0x496c18[_0x57c4ef(0x122)]!==0x1?'es':'');console[_0x57c4ef(0x13e)](_0x496c18[_0x57c4ef(0x122)]>_0x1b8dc1?'✔\x20'+_0xd2c8ad+_0x57c4ef(0x110):'✔\x20'+_0xd2c8ad);if(_0x44e69a[_0x57c4ef(0x11a)]===_0x57c4ef(0x123)||_0x44e69a[_0x57c4ef(0x11a)]===_0x57c4ef(0x105)){const _0x42a4b4=_0x5c4341[_0x57c4ef(0xf9)](_0x179942=>({..._0x179942,..._0x179942[_0x57c4ef(0x12a)]==='segment'?{'url':_0x2fea21(_0x179942['id'])}:{}}));return await handleSDKOutput(_0x42a4b4,_0x44e69a),0x0;}if(_0x496c18['length']===0x0)return console[_0x57c4ef(0x115)]('No\x20folders\x20or\x20segments\x20match\x20'+_0x20c72c),0x0;for(const _0x3804b4 of _0x5c4341){console['log'](_0x3804b4['type'][_0x57c4ef(0x144)](0x8)+'\x20'+_0x3804b4[_0x57c4ef(0x113)]+'\x20\x20'+a58_0x40354f[_0x57c4ef(0x138)](_0x57c4ef(0x14b)+_0x3804b4['id']+')'));}const _0x352766=_0x496c18[_0x57c4ef(0x130)](_0x551b24=>_0x551b24[_0x57c4ef(0x12a)]===_0x57c4ef(0x149)),_0x11f7e3=new Set(_0x352766[_0x57c4ef(0xf9)](_0x439d9e=>_0x439d9e['name'][_0x57c4ef(0x13f)]()))[_0x57c4ef(0x128)]===0x1;return _0x352766[_0x57c4ef(0x122)]>0x1&&_0x11f7e3&&console[_0x57c4ef(0x115)](a58_0x40354f[_0x57c4ef(0x138)]('\x0a'+_0x352766[_0x57c4ef(0x122)]+_0x57c4ef(0x131))),0x0;}async[a58_0x36863c(0x109)](_0x374428,_0x563bbd,_0x487bfc){const _0x32814d=a58_0x36863c,{options:_0xd22170,tdx:_0x5d7a67}=_0x374428,_0x1785d3=await withSpinner(_0x32814d(0x103)+_0x563bbd+_0x32814d(0x10c),()=>_0x5d7a67[_0x32814d(0x149)][_0x32814d(0x104)](_0x563bbd),{'verbose':_0xd22170[_0x32814d(0x10d)]}),_0x234729=_0x1785d3['data'],_0x51a5d0=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x5d7a67['segment'][_0x32814d(0x127)](_0x234729[_0x32814d(0x100)],_0x234729[_0x32814d(0x13a)]),{'verbose':_0xd22170['verbose']}),{folders:_0x5f286f,segments:_0x57798a,journeys:_0x18ee17}=_0x51a5d0[_0x32814d(0x12f)],_0x14005b=_0x487bfc[_0x32814d(0x141)](/[.+^${}()|[\]\\]/g,_0x32814d(0x143))['replace'](/\*/g,'.*')[_0x32814d(0x141)](/\?/g,'.'),_0x540ab4=new RegExp('^'+_0x14005b+'$','i'),_0xbc250a=_0x5f286f[_0x32814d(0x130)](_0x487c22=>_0x540ab4['test'](_0x487c22[_0x32814d(0x124)])),_0x592f5d=_0x57798a[_0x32814d(0x130)](_0xcec9af=>_0x540ab4[_0x32814d(0x126)](_0xcec9af[_0x32814d(0x124)])),_0x1b2ed9=_0x18ee17['filter'](_0x214dae=>_0x540ab4[_0x32814d(0x126)](_0x214dae[_0x32814d(0x129)])),_0x257ec7=_0xbc250a[_0x32814d(0x122)]+_0x592f5d['length']+_0x1b2ed9[_0x32814d(0x122)];console['error'](_0x32814d(0x12c)+_0xbc250a['length']+'\x20folder'+(_0xbc250a['length']!==0x1?'s':'')+',\x20'+_0x592f5d[_0x32814d(0x122)]+'\x20segment'+(_0x592f5d[_0x32814d(0x122)]!==0x1?'s':'')+_0x32814d(0xf8)+_0x1b2ed9['length']+_0x32814d(0x118)+(_0x1b2ed9[_0x32814d(0x122)]!==0x1?'s':'')+_0x32814d(0xfb)+_0x487bfc+'\x27');const _0x1c538c=_0x280ead=>{const _0x7fd954=_0x32814d;return getConsoleNextUrl(_0xd22170[_0x7fd954(0xfd)],_0x7fd954(0xff)+_0x234729[_0x7fd954(0x100)]+_0x7fd954(0x10e)+_0x280ead);},_0x37f74d=_0xd22170['format']===_0x32814d(0x123)||_0xd22170[_0x32814d(0x11a)]===_0x32814d(0x105);if(_0x37f74d){const _0x2c26e1=[..._0xbc250a[_0x32814d(0xf9)](_0x425c6f=>({..._0x425c6f,'type':'folder'})),..._0x592f5d[_0x32814d(0xf9)](_0x16d73d=>({..._0x16d73d,'type':'segment','url':_0x1c538c(_0x16d73d['id'])})),..._0x1b2ed9[_0x32814d(0xf9)](_0x217748=>({..._0x217748,'name':_0x217748[_0x32814d(0x129)],'type':_0x32814d(0x10f)}))][_0x32814d(0x132)]((_0x13b4cd,_0x3369b5)=>_0x13b4cd[_0x32814d(0x124)]['localeCompare'](_0x3369b5[_0x32814d(0x124)]));await handleSDKOutput(_0x2c26e1,_0xd22170);}else{if(_0x257ec7===0x0)console[_0x32814d(0x115)](_0x32814d(0x111)+_0x487bfc);else{console[_0x32814d(0x115)](a58_0x40354f[_0x32814d(0x138)]('['+_0x563bbd+_0x32814d(0x146)+_0x487bfc+'\x27'));const _0x44c56d=formatFlatList(_0xbc250a,_0x592f5d,{'showMetadata':!![],'getSegmentUrl':_0x1c538c},_0x1b2ed9);console['log'](_0x44c56d);}}return 0x0;}async[a58_0x36863c(0x13c)](_0x1f9bbc,_0x41ea90){const _0x2f007e=a58_0x36863c,{options:_0xc3e19f,tdx:_0x325545}=_0x1f9bbc,_0x7bc288=await withSpinner(_0x2f007e(0x114)+_0x41ea90+_0x2f007e(0x10c),()=>_0x325545[_0x2f007e(0x149)][_0x2f007e(0x104)](_0x41ea90),{'verbose':_0xc3e19f[_0x2f007e(0x10d)]}),_0x3613e2=_0x7bc288[_0x2f007e(0x12f)];_0xc3e19f[_0x2f007e(0x10d)]&&(console[_0x2f007e(0x13e)]('Parent\x20ID:\x20'+_0x3613e2['parentId']),_0x3613e2['folderId']&&console['error']('Folder\x20ID:\x20'+_0x3613e2[_0x2f007e(0x13a)]));const _0x31162f=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x325545[_0x2f007e(0x149)]['listUnifiedWithJourneys'](_0x3613e2[_0x2f007e(0x100)],_0x3613e2[_0x2f007e(0x13a)]),{'verbose':_0xc3e19f['verbose']}),{folders:_0x33eb4e,segments:_0x3870a3,journeys:_0x91b5b7}=_0x31162f[_0x2f007e(0x12f)],_0x39d986=_0x33eb4e[_0x2f007e(0x122)]+_0x3870a3[_0x2f007e(0x122)]+_0x91b5b7[_0x2f007e(0x122)];console[_0x2f007e(0x13e)](_0x2f007e(0x12c)+_0x33eb4e[_0x2f007e(0x122)]+_0x2f007e(0x10b)+(_0x33eb4e[_0x2f007e(0x122)]!==0x1?'s':'')+',\x20'+_0x3870a3[_0x2f007e(0x122)]+_0x2f007e(0x117)+(_0x3870a3[_0x2f007e(0x122)]!==0x1?'s':'')+',\x20and\x20'+_0x91b5b7['length']+'\x20journey'+(_0x91b5b7[_0x2f007e(0x122)]!==0x1?'s':''));const _0x1decae=_0x56e869=>{const _0x914806=_0x2f007e;return getConsoleNextUrl(_0xc3e19f[_0x914806(0xfd)],_0x914806(0xff)+_0x3613e2[_0x914806(0x100)]+'/e/'+_0x56e869);},_0x558f26=_0x17ce22=>{const _0x38e5e6=_0x2f007e;return getConsoleNextUrl(_0xc3e19f[_0x38e5e6(0xfd)],_0x38e5e6(0xff)+_0x3613e2['parentId']+'/e/'+_0x17ce22+'/j/da');},_0x3ab7f1=_0xc3e19f[_0x2f007e(0x11a)]==='json'||_0xc3e19f[_0x2f007e(0x11a)]===_0x2f007e(0x105);if(_0x3ab7f1){const _0x7ca601=[..._0x33eb4e['map'](_0x288f4e=>({..._0x288f4e,'type':_0x2f007e(0x13d)})),..._0x3870a3[_0x2f007e(0xf9)](_0x11d3aa=>({..._0x11d3aa,'type':_0x2f007e(0x149),'url':_0x1decae(_0x11d3aa['id'])})),..._0x91b5b7[_0x2f007e(0xf9)](_0x3cba65=>({..._0x3cba65,'name':_0x3cba65['journeyBundleName'],'type':_0x2f007e(0x10f),'url':_0x558f26(_0x3cba65['id'])}))][_0x2f007e(0x132)]((_0x2f044d,_0x35f2ff)=>_0x2f044d[_0x2f007e(0x124)][_0x2f007e(0x102)](_0x35f2ff[_0x2f007e(0x124)]));await handleSDKOutput(_0x7ca601,_0xc3e19f);}else{if(_0x39d986===0x0)console[_0x2f007e(0x115)](a58_0x40354f[_0x2f007e(0x138)]('['+_0x41ea90+']')),console[_0x2f007e(0x115)](_0x2f007e(0xfc));else{console[_0x2f007e(0x115)](a58_0x40354f[_0x2f007e(0x138)]('['+_0x41ea90+']'));const _0x9d9081=formatFlatList(_0x33eb4e,_0x3870a3,{'showMetadata':!![],'getSegmentUrl':_0x1decae,'getJourneyUrl':_0x558f26},_0x91b5b7);console[_0x2f007e(0x115)](_0x9d9081);}}return 0x0;}async[a58_0x36863c(0x107)](_0x225641,_0x43950f){const _0x50dba1=a58_0x36863c,{options:_0x6cd5ce,tdx:_0x57bc56}=_0x225641,_0x4dcbe6=await withSpinner(_0x50dba1(0x114)+_0x43950f+_0x50dba1(0x10c),()=>_0x57bc56[_0x50dba1(0x149)][_0x50dba1(0x104)](_0x43950f),{'verbose':_0x6cd5ce[_0x50dba1(0x10d)]}),_0x2b51f3=_0x4dcbe6[_0x50dba1(0x12f)];_0x6cd5ce[_0x50dba1(0x10d)]&&(console['error'](_0x50dba1(0x142)+_0x2b51f3[_0x50dba1(0x100)]),_0x2b51f3[_0x50dba1(0x13a)]&&console[_0x50dba1(0x13e)](_0x50dba1(0x137)+_0x2b51f3[_0x50dba1(0x13a)]));const _0x5cabc3=_0x6cd5ce[_0x50dba1(0x13b)]||0xa,_0x4be82b=await withSpinner(_0x50dba1(0x136),()=>_0x57bc56[_0x50dba1(0x149)]['listRecursive'](_0x2b51f3[_0x50dba1(0x100)],_0x2b51f3['folderId'],0x0,_0x5cabc3),{'verbose':_0x6cd5ce['verbose']}),_0x10fb84=_0x4be82b['data'],_0x517074=_0x5f1845=>{const _0x4aee09=_0x50dba1;let _0x23cd91=0x0,_0x210113=0x0,_0x1eaf42=0x0;for(const _0x62fb43 of _0x5f1845){if(_0x62fb43['type']===_0x4aee09(0x13d))_0x23cd91++;else{if(_0x62fb43[_0x4aee09(0x12a)]===_0x4aee09(0x149))_0x210113++;else{if(_0x62fb43['type']===_0x4aee09(0x10f))_0x1eaf42++;}}if(_0x62fb43[_0x4aee09(0x11e)]){const _0x217830=_0x517074(_0x62fb43[_0x4aee09(0x11e)]);_0x23cd91+=_0x217830[_0x4aee09(0x140)],_0x210113+=_0x217830[_0x4aee09(0x148)],_0x1eaf42+=_0x217830[_0x4aee09(0x14c)];}}return{'folders':_0x23cd91,'segments':_0x210113,'journeys':_0x1eaf42};},_0x5b80f9=_0x517074(_0x10fb84);console[_0x50dba1(0x13e)](_0x50dba1(0x101)+_0x5b80f9[_0x50dba1(0x140)]+_0x50dba1(0x10b)+(_0x5b80f9[_0x50dba1(0x140)]!==0x1?'s':'')+',\x20'+_0x5b80f9['segments']+_0x50dba1(0x117)+(_0x5b80f9[_0x50dba1(0x148)]!==0x1?'s':'')+_0x50dba1(0xf8)+_0x5b80f9[_0x50dba1(0x14c)]+_0x50dba1(0x118)+(_0x5b80f9[_0x50dba1(0x14c)]!==0x1?'s':''));const _0x2bf3c8=_0x546dae=>{const _0x56fe3c=_0x50dba1;return getConsoleNextUrl(_0x6cd5ce['site'],_0x56fe3c(0xff)+_0x2b51f3[_0x56fe3c(0x100)]+_0x56fe3c(0x10e)+_0x546dae);},_0x560501=_0x5d83cd=>{const _0x150fa4=_0x50dba1;return getConsoleNextUrl(_0x6cd5ce[_0x150fa4(0xfd)],'/app/ps/'+_0x2b51f3['parentId']+'/e/'+_0x5d83cd+'/j/da');};if(_0x6cd5ce['format']==='json'||_0x6cd5ce[_0x50dba1(0x11a)]===_0x50dba1(0x105))await handleSDKOutput(_0x10fb84,_0x6cd5ce);else{console[_0x50dba1(0x115)](a58_0x40354f[_0x50dba1(0x138)]('['+_0x43950f+']'));const _0x49f78c=formatTree(_0x10fb84,{'showMetadata':!![],'getSegmentUrl':_0x2bf3c8,'getJourneyUrl':_0x560501});console['log'](_0x49f78c);}return 0x0;}}
|