@treasuredata/tdx 2026.8.4 → 2026.8.6
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/README.md +1 -0
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.d.ts.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/cas-segment-command.js.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +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.d.ts +51 -0
- package/dist/commands/codex-command.d.ts.map +1 -0
- package/dist/commands/codex-command.js +1 -0
- package/dist/commands/codex-command.js.map +1 -0
- 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-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/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.d.ts +3 -3
- package/dist/core/version.d.ts.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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.d.ts +63 -0
- package/dist/sdk/cas/cas-segment-schema.d.ts.map +1 -0
- package/dist/sdk/cas/cas-segment-schema.js +1 -0
- package/dist/sdk/cas/cas-segment-schema.js.map +1 -0
- package/dist/sdk/cas/cas-segment-validator.d.ts +76 -0
- package/dist/sdk/cas/cas-segment-validator.d.ts.map +1 -0
- package/dist/sdk/cas/cas-segment-validator.js +1 -0
- package/dist/sdk/cas/cas-segment-validator.js.map +1 -0
- 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.d.ts +23 -6
- package/dist/sdk/cas/validate-files.d.ts.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/cas/validate-files.js.map +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.d.ts.map +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.js.map +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-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/template-yaml.js.map +1 -1
- package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +1 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +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.d.ts +2 -0
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.d.ts +1 -0
- package/dist/sdk/engage/types/template-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js.map +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.js +1 -1
- package/dist/sdk/llm/user-settings.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/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.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.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +8 -0
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.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 +2 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x42bbdd=a45_0x26c3;(function(_0x16623d,_0x285316){const _0x4b0b61=a45_0x26c3,_0x5588a5=_0x16623d();while(!![]){try{const _0x2c60c2=-parseInt(_0x4b0b61(0xf5))/0x1*(-parseInt(_0x4b0b61(0xd4))/0x2)+parseInt(_0x4b0b61(0xe1))/0x3+-parseInt(_0x4b0b61(0xe0))/0x4+-parseInt(_0x4b0b61(0x105))/0x5*(parseInt(_0x4b0b61(0xda))/0x6)+parseInt(_0x4b0b61(0xd0))/0x7*(parseInt(_0x4b0b61(0xf8))/0x8)+-parseInt(_0x4b0b61(0x10f))/0x9*(-parseInt(_0x4b0b61(0x112))/0xa)+-parseInt(_0x4b0b61(0x119))/0xb;if(_0x2c60c2===_0x285316)break;else _0x5588a5['push'](_0x5588a5['shift']());}catch(_0x364df1){_0x5588a5['push'](_0x5588a5['shift']());}}}(a45_0x2f10,0x4f7a0));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';function a45_0x26c3(_0x346c7c,_0x2953d6){_0x346c7c=_0x346c7c-0xce;const _0x2f100e=a45_0x2f10();let _0x26c3c4=_0x2f100e[_0x346c7c];return _0x26c3c4;}function a45_0x2f10(){const _0x5722b6=['data','forEach','cyan','join','resolveEntitiesInParent','1715688rpyeQN','231426yRrkJq','dryRun','error','ruleConditionCount','path','segment:move','segment','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','some','segmentFolderId','filter','\x20segment(s)\x20would\x20be\x20moved.','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','preserved:','\x20\x20•\x20','\x20(verified\x20by\x20re-read)','type','folder','\x27\x20to\x20folder\x20\x27','20dxBopG','\x27\x20—\x20','\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','64uGKNup','push','Duplicate\x20segments\x20removed\x20(','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','rule\x20','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','\x27...','folderId','\x20folder\x20\x27','\x20condition','Searching\x20folders\x20for\x20\x27','290WkrRpU','map','description','Segments:\x20','SEGMENT_NOT_FOUND','length','[dry-run]\x20No\x20changes\x20made.\x20','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','slot','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','819zwdcKP','Target\x20folder:\x20','explainAmbiguousName','56600rjgsJn','for\x20move\x20to','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','execute','parentId','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','get','1809170fDvtBK','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','red','moveSegments','includes','verbose','parentSegment','\x20\x20(id\x20','Examples:','listRecursive','set','384587sSegtK','Searching\x20the\x20tree...','resolvePathToResource','✔\x20Moved\x20segment\x20\x27','36622rmfOCK','code','name','test','toLowerCase','\x20→\x20','49554ndLkGs'];a45_0x2f10=function(){return _0x5722b6;};return a45_0x2f10();}import a45_0x4bcd3f from'chalk';export class SegmentMoveCommand extends BaseCommand{[a45_0x42bbdd(0xd6)]=a45_0x42bbdd(0xe6);[a45_0x42bbdd(0x107)]='Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder';async[a45_0x42bbdd(0x115)](_0x4e1528){const _0x2f9b01=a45_0x42bbdd,{options:_0xab77cc,args:_0x5b8040,tdx:_0x38edc0}=_0x4e1528,_0x3a7d3a=_0x5b8040,_0x4e38de=_0xab77cc[_0x2f9b01(0xf3)];if(_0x3a7d3a[_0x2f9b01(0x10a)]===0x0||!_0x4e38de)return console['error'](a45_0x4bcd3f[_0x2f9b01(0x11b)](_0x2f9b01(0x117))),console[_0x2f9b01(0xe3)](_0x2f9b01(0x10c)),console[_0x2f9b01(0xe3)](_0x2f9b01(0x121)),console[_0x2f9b01(0xe3)](_0x2f9b01(0xfe)),console[_0x2f9b01(0xe3)]('\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501'),console[_0x2f9b01(0xe3)](_0x2f9b01(0xf7)),console[_0x2f9b01(0xe3)](_0x2f9b01(0x10e)),0x1;_0xab77cc[_0x2f9b01(0x11e)]&&(console['error'](_0x2f9b01(0x108)+_0x3a7d3a[_0x2f9b01(0xde)](',\x20')),console['error'](_0x2f9b01(0x110)+_0x4e38de));const _0x230778=[...new Set(_0x3a7d3a)];_0x230778[_0x2f9b01(0x10a)]<_0x3a7d3a[_0x2f9b01(0x10a)]&&console['error'](a45_0x4bcd3f['yellow'](_0x2f9b01(0xfa)+_0x3a7d3a['length']+_0x2f9b01(0xd9)+_0x230778[_0x2f9b01(0x10a)]+').'));const _0x50dd7d=/^\d+$/,_0x5ecbd8=_0xab77cc[_0x2f9b01(0x11f)],_0x509758=[..._0x230778,_0x4e38de][_0x2f9b01(0xea)](_0x41def5=>!_0x50dd7d[_0x2f9b01(0xd7)](_0x41def5));if(_0x509758&&!_0x5ecbd8)return console[_0x2f9b01(0xe3)](a45_0x4bcd3f[_0x2f9b01(0x11b)](_0x2f9b01(0xfb))),console[_0x2f9b01(0xe3)](_0x2f9b01(0x11a)),console[_0x2f9b01(0xe3)](_0x2f9b01(0xe9)),console[_0x2f9b01(0xe3)]('Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)'),0x1;const _0x5b5d44=_0x230778[_0x2f9b01(0x10a)],_0x3260ca=_0xab77cc[_0x2f9b01(0xe2)]===!![];let _0x2f0ba3;try{const _0x1002f1=await withSpinner((_0x3260ca?'Checking':'Moving')+'\x20'+_0x5b5d44+'\x20segment'+(_0x5b5d44===0x1?'':'s')+'\x20'+((_0x3260ca?_0x2f9b01(0x113):'to')+_0x2f9b01(0x102)+_0x4e38de+'\x27...'),async()=>{const _0x940a64=_0x2f9b01,_0x2c1a10=[];_0x230778[_0x940a64(0xdc)]((_0x1a694f,_0x3970aa)=>{const _0x202c91=_0x940a64;if(!_0x50dd7d[_0x202c91(0xd7)](_0x1a694f))_0x2c1a10['push']({'name':_0x1a694f,'expectType':_0x202c91(0xe7),'slot':_0x3970aa});});if(!_0x50dd7d['test'](_0x4e38de))_0x2c1a10[_0x940a64(0xf9)]({'name':_0x4e38de,'expectType':_0x940a64(0xf3),'slot':-0x1});const _0x4d0b35=new Map();if(_0x2c1a10[_0x940a64(0x10a)]>0x0){const _0x390f67=await _0x38edc0['segment'][_0x940a64(0xdf)](_0x5ecbd8,_0x2c1a10[_0x940a64(0x106)](({name:_0x3df38a,expectType:_0x51e1b7})=>({'name':_0x3df38a,'expectType':_0x51e1b7})));_0x390f67[_0x940a64(0xdc)]((_0x3b8449,_0x1c12df)=>_0x4d0b35[_0x940a64(0xcf)](_0x2c1a10[_0x1c12df][_0x940a64(0x10d)],_0x3b8449['id']));}const _0x2ebe74=_0x230778[_0x940a64(0x106)]((_0xc3d856,_0x2e2e20)=>_0x50dd7d[_0x940a64(0xd7)](_0xc3d856)?_0xc3d856:_0x4d0b35[_0x940a64(0x118)](_0x2e2e20)),_0x19ee8c=_0x50dd7d[_0x940a64(0xd7)](_0x4e38de)?_0x4e38de:_0x4d0b35['get'](-0x1);return _0x38edc0[_0x940a64(0xe7)][_0x940a64(0x11c)](_0x2ebe74,_0x19ee8c,_0x3260ca);},{'verbose':_0xab77cc[_0x2f9b01(0x11e)]});_0x2f0ba3=_0x1002f1[_0x2f9b01(0xdb)];}catch(_0x6b2dce){if(_0x6b2dce instanceof SDKError&&_0x6b2dce[_0x2f9b01(0xd5)]===ErrorCode[_0x2f9b01(0x109)]&&_0x5ecbd8)try{if(await this[_0x2f9b01(0x111)](_0x38edc0,_0x5ecbd8,_0x230778,_0xab77cc))return 0x1;}catch{}throw _0x6b2dce;}for(const _0x1a97e3 of _0x2f0ba3){const _0x2fc161=_0x1a97e3[_0x2f9b01(0xe4)],_0x5c30ae=_0x2f9b01(0xfd)+(_0x3260ca?'has':_0x2f9b01(0xef))+'\x20'+_0x2fc161+_0x2f9b01(0x103)+(_0x2fc161===0x1?'':'s');console[_0x2f9b01(0xe3)](_0x3260ca?a45_0x4bcd3f[_0x2f9b01(0xdd)](_0x2f9b01(0xfc)+_0x1a97e3['id']+'\x27\x20to\x20folder\x20\x27'+_0x1a97e3[_0x2f9b01(0xeb)]+_0x2f9b01(0xf6)+_0x5c30ae):a45_0x4bcd3f['green'](_0x2f9b01(0xd3)+_0x1a97e3['id']+_0x2f9b01(0xf4)+_0x1a97e3[_0x2f9b01(0xeb)]+_0x2f9b01(0xf6)+_0x5c30ae+_0x2f9b01(0xf1)));}if(_0x3260ca)console[_0x2f9b01(0xe3)](a45_0x4bcd3f[_0x2f9b01(0xdd)](_0x2f9b01(0x10b)+_0x5b5d44+_0x2f9b01(0xed)));else _0x2f0ba3[_0x2f9b01(0x10a)]>0x1&&console[_0x2f9b01(0xe3)](a45_0x4bcd3f['green']('✔\x20'+_0x2f0ba3[_0x2f9b01(0x10a)]+_0x2f9b01(0xff)));return await handleSDKOutput(_0x2f0ba3,_0xab77cc),0x0;}async[a45_0x42bbdd(0x111)](_0x169bd0,_0x5cc8e0,_0x308e71,_0x56ef99){const _0x2cd553=a45_0x42bbdd,_0xa81515=_0x308e71['filter'](_0x1ee104=>!/^\d+$/['test'](_0x1ee104)&&!_0x1ee104[_0x2cd553(0x11d)]('/'));if(_0xa81515['length']===0x0)return![];const _0x4475db=await withSpinner(_0x2cd553(0x104)+_0xa81515[_0x2cd553(0xde)]('\x27,\x20\x27')+_0x2cd553(0x100),()=>_0x169bd0[_0x2cd553(0xe7)][_0x2cd553(0xd2)](_0x5cc8e0),{'verbose':_0x56ef99[_0x2cd553(0x11e)]}),_0xa98f6e=(await withSpinner(_0x2cd553(0xd1),()=>_0x169bd0[_0x2cd553(0xe7)][_0x2cd553(0xce)](_0x4475db[_0x2cd553(0xdb)][_0x2cd553(0x116)],_0x4475db[_0x2cd553(0xdb)][_0x2cd553(0x101)],0x0,0xa),{'verbose':_0x56ef99[_0x2cd553(0x11e)]}))[_0x2cd553(0xdb)];let _0x3c85e8=![];for(const _0x245c06 of _0xa81515){const _0x2431d1=searchTreeByName(_0xa98f6e,_0x245c06)[_0x2cd553(0xec)](_0xea482c=>_0xea482c[_0x2cd553(0xf2)]===_0x2cd553(0xe7)&&_0xea482c[_0x2cd553(0xd6)][_0x2cd553(0xd8)]()===_0x245c06['toLowerCase']());if(_0x2431d1[_0x2cd553(0x10a)]>0x1){_0x3c85e8=!![],console[_0x2cd553(0xe3)](a45_0x4bcd3f[_0x2cd553(0x11b)]('Error:\x20\x27'+_0x245c06+'\x27\x20matches\x20'+_0x2431d1[_0x2cd553(0x10a)]+_0x2cd553(0xee)));for(const _0x442c62 of _0x2431d1)console[_0x2cd553(0xe3)](_0x2cd553(0xf0)+_0x442c62['path']+_0x2cd553(0x120)+_0x442c62['id']+')');}else _0x2431d1[_0x2cd553(0x10a)]===0x1&&(_0x3c85e8=!![],console[_0x2cd553(0xe3)](a45_0x4bcd3f[_0x2cd553(0x11b)]('Error:\x20\x27'+_0x245c06+_0x2cd553(0xe8))),console[_0x2cd553(0xe3)]('\x20\x20'+_0x2431d1[0x0][_0x2cd553(0xe5)]+'\x20\x20(id\x20'+_0x2431d1[0x0]['id']+')'),console[_0x2cd553(0xe3)](_0x2cd553(0x114)));}return _0x3c85e8;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x1fd78f=a46_0x5c9d;(function(_0x24ed2d,_0x15e16a){const _0x235af2=a46_0x5c9d,_0xaedc6c=_0x24ed2d();while(!![]){try{const _0x281505=-parseInt(_0x235af2(0x14f))/0x1*(parseInt(_0x235af2(0x14e))/0x2)+parseInt(_0x235af2(0x11a))/0x3+parseInt(_0x235af2(0x151))/0x4*(-parseInt(_0x235af2(0x146))/0x5)+-parseInt(_0x235af2(0x158))/0x6+-parseInt(_0x235af2(0x115))/0x7+-parseInt(_0x235af2(0x124))/0x8*(parseInt(_0x235af2(0x13d))/0x9)+parseInt(_0x235af2(0x122))/0xa*(parseInt(_0x235af2(0x12b))/0xb);if(_0x281505===_0x15e16a)break;else _0xaedc6c['push'](_0xaedc6c['shift']());}catch(_0x28ffd8){_0xaedc6c['push'](_0xaedc6c['shift']());}}}(a46_0xb9b2,0x1f230));function a46_0x5c9d(_0x13b9aa,_0x1f2571){_0x13b9aa=_0x13b9aa-0x112;const _0xb9b2d8=a46_0xb9b2();let _0x5c9d85=_0xb9b2d8[_0x13b9aa];return _0x5c9d85;}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 a46_0x48c3a0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a46_0x39e974 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a46_0xb9b2(){const _0x13375f=['journeyVersions','parent_segment','name','Aborted.','Error:\x20','message','994LzRdsq','55ydEDFd','helpText','92072vSSUyC','journeys','red','content','parentSegment','description','execute','1487544uWnhyx','length','\x20=\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','-\x20no\x20files\x20written','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','Site:\x20','verbose','dim','✔\x20Context\x20set:\x20','error','\x20unchanged\x20files','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','relativePath','Target\x20resource:\x20','cwd','type','462833KjJAvy','\x20new\x20files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Parent\x20segment:\x20','\x20segments','713277ewXesp','session','segment:pull','hasChanges','file','green','targetDir','yellow','50FSOMKs','Write\x20','744HfNMhy','dirname','diff','\x20\x20🗺️\x20\x20','files','segment','pullSegments','1030997yzoFBD','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aPull\x20summary\x20for\x20\x27','filter','\x20files\x20to\x20','utf-8','cyan','\x20files?','\x20\x20🎯\x20','\x20journeys','repeat','errorCode','absolutePath','activations','isNew','resourceName','\x20activations','counts','2934cODsUT','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','data','site','\x20versions)','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','45WdSljz','parentName'];a46_0xb9b2=function(){return _0x13375f;};return a46_0xb9b2();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a46_0x1fd78f(0x14a)]=a46_0x1fd78f(0x11c);[a46_0x1fd78f(0x156)]=a46_0x1fd78f(0x15b);async[a46_0x1fd78f(0x157)](_0x15cbac){const _0x3ef8af=a46_0x1fd78f,{options:_0x114d3b,args:_0x2c1788,tdx:_0x46bfa9}=_0x15cbac,_0x17ad6c=_0x114d3b,_0x16cfdd=await resolveTarget({'arg':_0x2c1788[0x0],'contextParent':_0x114d3b[_0x3ef8af(0x155)],'cwd':process[_0x3ef8af(0x113)]()});if(!isSuccessfulResolution(_0x16cfdd))return _0x16cfdd[_0x3ef8af(0x136)]===_0x3ef8af(0x144)?(console['error'](a46_0x48c3a0['yellow'](_0x3ef8af(0x145))),console[_0x3ef8af(0x163)]('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'](_0x3ef8af(0x13e)),console[_0x3ef8af(0x163)](_0x3ef8af(0x13f))):(console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x153)](_0x3ef8af(0x14c)+_0x16cfdd[_0x3ef8af(0x14d)]+'\x0a')),_0x16cfdd[_0x3ef8af(0x150)]&&console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x131)](_0x16cfdd[_0x3ef8af(0x150)]))),0x1;const _0x4ace41=_0x16cfdd[_0x3ef8af(0x147)],_0x5179b0=_0x16cfdd['targetDir'],_0x288b42=_0x16cfdd[_0x3ef8af(0x114)]===_0x3ef8af(0x11e)?_0x16cfdd[_0x3ef8af(0x13a)]:undefined;_0x17ad6c[_0x3ef8af(0x160)]&&(console[_0x3ef8af(0x163)](_0x3ef8af(0x15f)+_0x17ad6c[_0x3ef8af(0x142)]),console[_0x3ef8af(0x163)](_0x3ef8af(0x118)+_0x4ace41),_0x288b42&&console[_0x3ef8af(0x163)](_0x3ef8af(0x112)+_0x288b42));const _0x194de0=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4ace41+'\x27...',_0x396c69=>_0x46bfa9[_0x3ef8af(0x129)][_0x3ef8af(0x12a)](_0x4ace41,{'targetDir':_0x5179b0,'targetResourceName':_0x288b42,'verbose':_0x17ad6c['verbose'],'progress':{'update':_0x19784e=>{const _0xf21c87=_0x3ef8af;_0x396c69['setPhase'](_0x19784e),_0x17ad6c['verbose']&&console[_0xf21c87(0x163)]('\x20\x20'+_0x19784e);}}}),{'verbose':_0x17ad6c['verbose']}),_0x3377cd=_0x194de0[_0x3ef8af(0x141)];if(_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x140)]===0x0&&_0x3377cd['counts'][_0x3ef8af(0x152)]===0x0)return console[_0x3ef8af(0x163)](a46_0x48c3a0['yellow'](_0x3ef8af(0x165)+_0x3377cd[_0x3ef8af(0x147)]+'\x27')),0x0;const _0x1ac417=_0x3377cd['files'][_0x3ef8af(0x12e)](_0x2f9577=>_0x2f9577[_0x3ef8af(0x139)]),_0x47bf52=_0x3377cd[_0x3ef8af(0x128)]['filter'](_0x62243=>!_0x62243[_0x3ef8af(0x139)]&&_0x62243[_0x3ef8af(0x11d)]),_0x485f99=_0x3377cd[_0x3ef8af(0x128)][_0x3ef8af(0x12e)](_0x2709ea=>!_0x2709ea['isNew']&&!_0x2709ea[_0x3ef8af(0x11d)]);console[_0x3ef8af(0x163)](_0x3ef8af(0x12d)+_0x3377cd[_0x3ef8af(0x147)]+'\x27:'),console[_0x3ef8af(0x163)](_0x3ef8af(0x133)+a46_0x48c3a0[_0x3ef8af(0x131)](_0x3377cd[_0x3ef8af(0x13c)]['segments']+_0x3ef8af(0x119))+'\x20with\x20'+a46_0x48c3a0['cyan'](_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x138)]+_0x3ef8af(0x13b)));if(_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x152)]>0x0){const _0x4e7df9=_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x148)]>_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x152)]?'\x20('+_0x3377cd[_0x3ef8af(0x13c)]['journeyVersions']+_0x3ef8af(0x143):'';console['error'](_0x3ef8af(0x127)+a46_0x48c3a0[_0x3ef8af(0x131)](_0x3377cd[_0x3ef8af(0x13c)][_0x3ef8af(0x152)]+_0x3ef8af(0x134))+a46_0x48c3a0['dim'](_0x4e7df9));}console['error']('\x20\x20'+a46_0x48c3a0[_0x3ef8af(0x11f)]('+\x20'+_0x1ac417[_0x3ef8af(0x159)]+_0x3ef8af(0x116))),console['error']('\x20\x20'+a46_0x48c3a0[_0x3ef8af(0x121)]('~\x20'+_0x47bf52['length']+'\x20changed\x20files')),console[_0x3ef8af(0x163)]('\x20\x20'+a46_0x48c3a0[_0x3ef8af(0x161)]('=\x20'+_0x485f99['length']+_0x3ef8af(0x164))),console[_0x3ef8af(0x163)]('\x20\x20Target:\x20'+a46_0x48c3a0['cyan'](_0x3377cd['targetDir'])+'\x0a');if(_0x47bf52[_0x3ef8af(0x159)]>0x0)for(const _0x305915 of _0x47bf52){console[_0x3ef8af(0x163)]('\x0aChanges\x20to\x20\x27'+_0x305915[_0x3ef8af(0x167)]+'\x27:'),console['error']('─'[_0x3ef8af(0x135)](0x3c)),console[_0x3ef8af(0x163)](_0x305915[_0x3ef8af(0x126)]),console[_0x3ef8af(0x163)]('─'['repeat'](0x3c));}if(_0x17ad6c[_0x3ef8af(0x15e)])return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x121)](_0x3ef8af(0x117))),0x0;if(_0x1ac417['length']===0x0&&_0x47bf52[_0x3ef8af(0x159)]===0x0)return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x11f)](_0x3ef8af(0x166))),saveSessionContext({'parent_segment':_0x3377cd['parentName']},_0x17ad6c[_0x3ef8af(0x11b)]),console[_0x3ef8af(0x163)](a46_0x48c3a0['green'](_0x3ef8af(0x162)+a46_0x48c3a0[_0x3ef8af(0x161)](_0x3ef8af(0x149))+_0x3ef8af(0x15a)+a46_0x48c3a0['cyan'](_0x3377cd[_0x3ef8af(0x147)]))),0x0;if(!_0x17ad6c['yes']){if(!isInteractive())return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x153)]('\x0aError:'),_0x3ef8af(0x12c)),console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x161)](_0x3ef8af(0x15d))),0x1;const _0x40e3f4=await confirmKey(_0x3ef8af(0x123)+(_0x1ac417['length']+_0x47bf52[_0x3ef8af(0x159)])+_0x3ef8af(0x132));if(!_0x40e3f4)return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x121)](_0x3ef8af(0x14b)),_0x3ef8af(0x15c)),0x1;}for(const _0x506ab4 of _0x3377cd['files']){if(_0x506ab4[_0x3ef8af(0x139)]||_0x506ab4[_0x3ef8af(0x11d)]){const _0x5199a5=a46_0x39e974[_0x3ef8af(0x125)](_0x506ab4[_0x3ef8af(0x137)]);!existsSync(_0x5199a5)&&mkdirSync(_0x5199a5,{'recursive':!![]}),writeFileSync(_0x506ab4[_0x3ef8af(0x137)],_0x506ab4[_0x3ef8af(0x154)],_0x3ef8af(0x130));}}return console[_0x3ef8af(0x163)](a46_0x48c3a0[_0x3ef8af(0x11f)]('✔\x20Pulled\x20'+(_0x1ac417['length']+_0x47bf52[_0x3ef8af(0x159)])+_0x3ef8af(0x12f)+_0x3377cd[_0x3ef8af(0x120)])),saveSessionContext({'parent_segment':_0x3377cd['parentName']},_0x17ad6c[_0x3ef8af(0x11b)]),console[_0x3ef8af(0x163)](a46_0x48c3a0['green'](_0x3ef8af(0x162)+a46_0x48c3a0[_0x3ef8af(0x161)](_0x3ef8af(0x149))+_0x3ef8af(0x15a)+a46_0x48c3a0[_0x3ef8af(0x131)](_0x3377cd[_0x3ef8af(0x147)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a46_0x129918=a46_0x3dc1;(function(_0x48ed7f,_0x29a7a2){const _0xc7e2c4=a46_0x3dc1,_0x50cbba=_0x48ed7f();while(!![]){try{const _0x7ef8b0=-parseInt(_0xc7e2c4(0x215))/0x1*(-parseInt(_0xc7e2c4(0x1c6))/0x2)+parseInt(_0xc7e2c4(0x196))/0x3+parseInt(_0xc7e2c4(0x1ac))/0x4*(-parseInt(_0xc7e2c4(0x191))/0x5)+parseInt(_0xc7e2c4(0x1c3))/0x6*(parseInt(_0xc7e2c4(0x18e))/0x7)+-parseInt(_0xc7e2c4(0x1fb))/0x8+parseInt(_0xc7e2c4(0x216))/0x9*(-parseInt(_0xc7e2c4(0x1c2))/0xa)+parseInt(_0xc7e2c4(0x1c9))/0xb*(parseInt(_0xc7e2c4(0x19b))/0xc);if(_0x7ef8b0===_0x29a7a2)break;else _0x50cbba['push'](_0x50cbba['shift']());}catch(_0x2829be){_0x50cbba['push'](_0x50cbba['shift']());}}}(a46_0xfcc6,0xad5a9));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 a46_0x1a549a from'chalk';import{existsSync}from'fs';function a46_0xfcc6(){const _0x58d0d4=['Fetching\x20existing\x20activations...','toCreate','\x20\x20Activations:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','dim','segment\x20or\x20journey','unchanged','segments','getParent','setPhase','delete','cyan','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Aborted.','error','site','10kNhgkS','192uCxivs','\x20\x20\x20\x20','Changes\x20to:','194CqdaVx','new','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','11HiLWIg','diff','\x20unchanged','created','nameToId','journeys','buildUserMaps','Parent\x20segment:\x20','toDelete','push','\x0a✔\x20Push\x20complete','paused','isScoped','\x20activations]','journey','description','segmentFolderId','file','helpText','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20Source:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','listJourneysWithDetailsFromParentSegment','\x20\x20Segments:\x20','\x20deleted','createdAt','list','\x20\x20📊\x20Segments:','journeyBundleName','yamlConfig','updated','Source\x20directory:\x20','dryRun','New\x20journey:','\x20YAML\x20files\x20found','Resolving\x20parent\x20segment\x20\x27','\x20updated','user','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','targetDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','map','segment:push','isNew','segment','blue','audienceId','filePath','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','8166200VHepCq','activations','Folders\x20to\x20create:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x0aPush\x20summary\x20for\x20\x27','data','attributes','\x20changes?','nameToType','length','folderPath','name','then','repeat','\x20to\x20create','parentSegment','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20','filter','folderId','errorCode','green','execute','/j/da/je','\x0aValidation\x20failed:','/sb/da/esr','12334SrnoxH','715185PgoNNI','state','parentFolder','existingJourney','add','\x20new','existingSegment','createdSegmentIds','/app/ps/','message','Scoped\x20to\x20folder:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','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)','Site:\x20','\x20to\x20delete','.yaml','Push\x20','type','journeyId','set','journeysOnly','300559NPzgTn','results','getMetadataWithCache','4985SrKSSO','red','Error:\x20Directory\x20not\x20found:\x20','scopedFolderPath','relationships','583275nwoQqu','all','verbose','parentName','\x20created','2412156jgHruL','yes','changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','idToName','endsWith','get','\x20\x20🗺️\x20\x20Journeys:','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','versionNumber','\x20\x20Journeys:\x20','\x20changed','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','/e/','New\x20segment:','connection','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','4636iRosRN','Delete\x20segment:','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','cwd','\x27...'];a46_0xfcc6=function(){return _0x58d0d4;};return a46_0xfcc6();}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';function a46_0x3dc1(_0x482c32,_0x173971){_0x482c32=_0x482c32-0x185;const _0xfcc6e5=a46_0xfcc6();let _0x3dc1be=_0xfcc6e5[_0x482c32];return _0x3dc1be;}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']=a46_0x129918(0x1f4);[a46_0x129918(0x1d8)]=a46_0x129918(0x1ef);async[a46_0x129918(0x211)](_0xd2eaf){const _0x1d7cc7=a46_0x129918,{options:_0x530dce,args:_0x18fdfe,tdx:_0x29b008}=_0xd2eaf,_0x43d300=_0x530dce,_0x1e4031=await resolveTarget({'arg':_0x18fdfe[0x0],'contextParent':_0x530dce[_0x1d7cc7(0x20a)],'cwd':process[_0x1d7cc7(0x1b0)]()});if(!isSuccessfulResolution(_0x1e4031))return _0x1e4031[_0x1d7cc7(0x20f)]==='no_parent'?(console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1af)](_0x1d7cc7(0x221))),console['error'](_0x1d7cc7(0x185)),console[_0x1d7cc7(0x1c0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x19e))):(console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x192)](_0x1d7cc7(0x20c)+_0x1e4031[_0x1d7cc7(0x21f)]+'\x0a')),_0x1e4031[_0x1d7cc7(0x1db)]&&console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1bd)](_0x1e4031[_0x1d7cc7(0x1db)]))),0x1;if(_0x1e4031[_0x1d7cc7(0x18a)]==='parent_name')return console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x192)](_0x1d7cc7(0x193)+_0x1e4031[_0x1d7cc7(0x1f0)]+'\x0a')),console['error'](a46_0x1a549a[_0x1d7cc7(0x1bd)](_0x1d7cc7(0x1a3))),0x1;const _0x1a42d0=_0x1e4031[_0x1d7cc7(0x199)],_0x305b39=_0x1e4031[_0x1d7cc7(0x1f0)],_0x17b4ee=_0x1e4031['type']===_0x1d7cc7(0x1da)?_0x1e4031[_0x1d7cc7(0x1f9)]:undefined,_0x58eaf2=getScopedDetails(_0x1e4031),_0x377030=_0x58eaf2?.[_0x1d7cc7(0x1d5)]??![],_0x57cbd5=_0x58eaf2?.[_0x1d7cc7(0x194)]??'';if(!existsSync(_0x305b39))return console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x192)]('Error:\x20Directory\x20not\x20found:\x20'+_0x305b39+'\x0a')),console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1bd)](_0x1d7cc7(0x1a3))),0x1;_0x43d300[_0x1d7cc7(0x198)]&&(console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x186)+_0x43d300['site']),console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1d0)+_0x1a42d0),console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1e8)+_0x305b39),_0x377030&&console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x220)+_0x57cbd5));const _0x1a9df7=await withSpinner(_0x1d7cc7(0x1ec)+_0x1a42d0+_0x1d7cc7(0x1b1),()=>_0x29b008['segment']['resolveParentId'](_0x1a42d0),{'verbose':_0x43d300[_0x1d7cc7(0x198)]}),_0xae3ec2=_0x1a9df7[_0x1d7cc7(0x200)],{parentSegmentResult:_0x4c34ee,segmentsResult:_0x4b0c5e,foldersResult:_0x5bdac6,journeysWithDetailsResult:_0x43629a,userMaps:_0x3ade31}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x5e72db=_0x1d7cc7,[_0x260e71,_0x3815b7,_0x50e8b8,_0x1cecdd,_0x2a03b0]=await Promise[_0x5e72db(0x197)]([_0x29b008[_0x5e72db(0x1f6)][_0x5e72db(0x1ba)](_0xae3ec2),_0x29b008[_0x5e72db(0x1f6)]['listSegments'](_0xae3ec2),_0x29b008[_0x5e72db(0x1f6)]['listFolders'](_0xae3ec2),_0x29b008[_0x5e72db(0x1d7)][_0x5e72db(0x1df)](_0xae3ec2,{'includeAllVersions':!![]}),_0x29b008[_0x5e72db(0x1ee)][_0x5e72db(0x1cf)]()]);return{'parentSegmentResult':_0x260e71,'segmentsResult':_0x3815b7,'foldersResult':_0x50e8b8,'journeysWithDetailsResult':_0x1cecdd,'userMaps':_0x2a03b0};},{'verbose':_0x43d300[_0x1d7cc7(0x198)]})['then'](_0x5a44c9=>_0x5a44c9[_0x1d7cc7(0x200)]),_0x4c75b0=_0x4c34ee,_0x1e50f2=extractRootFolderId(_0x4c75b0),_0x743972=_0x4b0c5e,_0x18fa99=_0x5bdac6,{journeys:_0x52b8db,activationStepsById:_0x1d3357}=_0x43629a,_0x19cc34=new Map(_0x52b8db[_0x1d7cc7(0x1f3)](_0x5a4c89=>[_0x5a4c89['id'],_0x5a4c89])),_0x76a691=_0x52b8db[_0x1d7cc7(0x1f3)](_0x41895d=>({'id':_0x41895d['id'],'name':_0x41895d['attributes'][_0x1d7cc7(0x206)],'journeyBundleName':_0x41895d[_0x1d7cc7(0x201)][_0x1d7cc7(0x1e5)]||'','journeyBundleId':_0x41895d[_0x1d7cc7(0x201)]['journeyBundleId']||'','versionNumber':_0x41895d[_0x1d7cc7(0x201)][_0x1d7cc7(0x1a4)],'description':_0x41895d[_0x1d7cc7(0x201)][_0x1d7cc7(0x1d8)],'state':_0x41895d['attributes'][_0x1d7cc7(0x217)],'paused':_0x41895d['attributes'][_0x1d7cc7(0x1d4)],'audienceId':_0x41895d[_0x1d7cc7(0x201)][_0x1d7cc7(0x1f8)],'folderId':_0x41895d[_0x1d7cc7(0x195)]?.[_0x1d7cc7(0x218)]?.[_0x1d7cc7(0x200)]?.['id'],'createdAt':_0x41895d['attributes'][_0x1d7cc7(0x1e2)],'updatedAt':_0x41895d[_0x1d7cc7(0x201)]['updatedAt']})),{emailToId:_0x4380b1,idToEmail:_0x389279}=_0x3ade31,_0x1ac189=await withSpinner(_0x1d7cc7(0x20b),async()=>{const _0x31afd9=_0x1d7cc7,_0x1b1af2=await _0x29b008[_0x31afd9(0x1aa)][_0x31afd9(0x1e3)]();return buildConnectionMaps(_0x1b1af2);},{'verbose':_0x43d300[_0x1d7cc7(0x198)]})[_0x1d7cc7(0x207)](_0x2dca4d=>_0x2dca4d['data']),_0xad8d20=_0x1ac189[_0x1d7cc7(0x1cd)],_0x95e3b7=_0x1ac189['idToName'],_0x19a473=_0x1ac189[_0x1d7cc7(0x203)],_0x26c187={'emailToIdMap':_0x4380b1,'connectionNameToIdMap':_0xad8d20,'connectionNameToTypeMap':_0x19a473,'getSchema':_0x4f3aa2=>_0x29b008[_0x1d7cc7(0x1aa)]['getOutputSchemaWithCache'](_0x4f3aa2),'getMetadata':_0x35fe3e=>_0x29b008[_0x1d7cc7(0x1aa)][_0x1d7cc7(0x190)](_0x35fe3e)};let {pathToId:_0x552fde,idToPath:_0x122293}=buildFolderMaps(_0x18fa99);const _0x1ccd10=buildSegmentLookupMap(_0x743972,_0x122293),_0x98661c=buildSegmentNameToIdMap(_0x743972),_0x523466=buildJourneyBundleLookupMap(_0x76a691,_0x122293);let _0x76d782;if(_0x17b4ee){if(!_0x17b4ee[_0x1d7cc7(0x1a0)]('.yml')&&!_0x17b4ee['endsWith'](_0x1d7cc7(0x188)))return console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x192)](_0x1d7cc7(0x1fa)+_0x17b4ee+'\x0a')),0x1;_0x76d782=[_0x17b4ee];}else _0x76d782=findYamlFiles(_0x305b39);if(_0x76d782[_0x1d7cc7(0x204)]===0x0)return console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x192)](_0x1d7cc7(0x1ae)+_0x305b39+'\x0a')),console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1bd)](_0x1d7cc7(0x1dc))),0x1;let _0x45ff9b,_0x16c96b;try{const _0x3a3fb0=parseAndClassifyYamlFiles(_0x76d782,_0x305b39,{'skipSegments':_0x43d300[_0x1d7cc7(0x18d)]});_0x45ff9b=_0x3a3fb0[_0x1d7cc7(0x1b9)],_0x16c96b=_0x3a3fb0['journeys'];const _0x12b66d=validateParsedFiles(_0x3a3fb0,_0x305b39);if(_0x12b66d['length']>0x0)return console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x192)](_0x1d7cc7(0x213))),console['error'](formatValidationErrors(_0x12b66d)),console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1af)](_0x1d7cc7(0x1fe))),0x1;}catch(_0x4e909d){return console[_0x1d7cc7(0x1c0)](a46_0x1a549a['red']('Error\x20parsing\x20YAML:\x20'+(_0x4e909d instanceof Error?_0x4e909d['message']:_0x4e909d))),0x1;}if(_0x45ff9b[_0x1d7cc7(0x204)]===0x0&&_0x16c96b[_0x1d7cc7(0x204)]===0x0){const _0x1bd481=_0x43d300[_0x1d7cc7(0x18d)]?_0x1d7cc7(0x1d7):_0x1d7cc7(0x1b7);return console[_0x1d7cc7(0x1c0)](a46_0x1a549a['yellow']('No\x20'+_0x1bd481+_0x1d7cc7(0x1eb))),0x0;}const _0x198b00=new Map();_0x743972[_0x1d7cc7(0x204)]>0x0&&!_0x43d300[_0x1d7cc7(0x18d)]&&await withSpinner(_0x1d7cc7(0x1b2),async()=>{await batchAsync(_0x743972,async _0x34e691=>{const _0x47bb91=a46_0x3dc1,_0x31c19f=await _0x29b008[_0x47bb91(0x1f6)]['listActivations'](_0xae3ec2,_0x34e691['id']);_0x198b00[_0x47bb91(0x18c)](_0x34e691['id'],_0x31c19f);});},{'verbose':_0x43d300['verbose']});const {segmentFiles:_0x2ac7d0,foldersToCreate:_0x47baa8}=await prepareSegmentFiles(_0x45ff9b,{'segmentByFolderAndName':_0x1ccd10,'activationsBySegmentId':_0x198b00,'folderPathToId':_0x552fde,'idToEmailMap':_0x389279,'connectionIdToNameMap':_0x95e3b7},_0x26c187,_0x377030,_0x57cbd5),_0xbb641c=_0x17b4ee?[]:findSegmentsToDelete(_0x743972,_0x45ff9b[_0x1d7cc7(0x1f3)](({yamlConfig:_0x35253f,folderPath:_0x21e7c0})=>({'yamlConfig':_0x35253f,'folderPath':resolveTDFolderPath(_0x21e7c0,_0x377030,_0x57cbd5)})),_0x122293,_0x57cbd5,_0x377030),{journeyFiles:_0x718b30,foldersToCreate:_0x2a71cf}=await withProgressSpinner('Preparing\x20journeys...',async _0x3e701f=>prepareJourneyFiles(_0x16c96b,{'fetchJourney':async _0xe65d5e=>_0x29b008[_0x1d7cc7(0x1d7)]['getJourney'](_0xe65d5e[_0x1d7cc7(0x18b)]),'journeyBundlesByFolderAndName':_0x523466,'folderPathToId':_0x552fde,'idToEmailMap':_0x389279,'connectionIdToNameMap':_0x95e3b7,'existingSegments':_0x743972,'parentId':_0xae3ec2,'deps':_0x29b008,'progress':{'update':_0x4c45c7=>{const _0xfa405f=_0x1d7cc7;_0x3e701f[_0xfa405f(0x1bb)](_0x4c45c7),_0x43d300['verbose']&&console[_0xfa405f(0x1c0)]('\x20\x20'+_0x4c45c7);}},'journeyById':_0x19cc34,'activationStepsById':_0x1d3357},_0x377030,_0x57cbd5),{'verbose':_0x43d300[_0x1d7cc7(0x198)]})[_0x1d7cc7(0x207)](_0x2850f7=>_0x2850f7[_0x1d7cc7(0x200)]);for(const _0x2220bd of _0x2a71cf){_0x47baa8[_0x1d7cc7(0x21a)](_0x2220bd);}const _0x5ad7a2=_0x17b4ee?[]:findJourneysToDelete(_0x76a691,_0x16c96b[_0x1d7cc7(0x1f3)](({yamlConfig:_0x186abd,folderPath:_0x56fcd7})=>({'yamlConfig':_0x186abd,'folderPath':resolveTDFolderPath(_0x56fcd7,_0x377030,_0x57cbd5)})),_0x122293,_0x57cbd5,_0x377030),_0x40a234=calculatePushStats(_0x2ac7d0,_0x718b30,_0x47baa8,_0xbb641c,_0x5ad7a2,!!_0x43d300[_0x1d7cc7(0x1bc)],!!_0x43d300[_0x1d7cc7(0x18d)]),_0x15db8d=_0x40a234[_0x1d7cc7(0x1b9)][_0x1d7cc7(0x1c7)],_0x53bc8b=_0x40a234[_0x1d7cc7(0x1b9)][_0x1d7cc7(0x19d)],_0x2230c8=_0x40a234[_0x1d7cc7(0x1b9)][_0x1d7cc7(0x1b8)],_0x10e6ef=_0x40a234[_0x1d7cc7(0x1b9)][_0x1d7cc7(0x1d1)],_0xaf6978=_0x40a234['folders'][_0x1d7cc7(0x1b3)],_0x515fc9=_0x40a234[_0x1d7cc7(0x1ce)][_0x1d7cc7(0x1c7)],_0x18e829=_0x40a234[_0x1d7cc7(0x1ce)][_0x1d7cc7(0x19d)],_0x5e52f6=_0x40a234['journeys']['unchanged'],_0x17a954=_0x40a234[_0x1d7cc7(0x1ce)][_0x1d7cc7(0x1d1)],_0x2d285b=_0x40a234['activations']['all'],_0x44e517=_0x40a234[_0x1d7cc7(0x1fc)][_0x1d7cc7(0x1b3)],_0xf3749=_0x40a234['activations']['toUpdate'],_0x3bd48c=_0x40a234['activations'][_0x1d7cc7(0x1d1)];console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1ff)+_0x1a42d0+'\x27:');_0xaf6978['length']>0x0&&console['error']('\x20\x20'+a46_0x1a549a[_0x1d7cc7(0x1f7)]('📁\x20'+_0xaf6978['length']+'\x20folders\x20to\x20create'));if(!_0x43d300[_0x1d7cc7(0x18d)]){console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1e4)),console['error']('\x20\x20\x20\x20'+a46_0x1a549a[_0x1d7cc7(0x210)]('+\x20'+_0x15db8d[_0x1d7cc7(0x204)]+'\x20new')),console['error'](_0x1d7cc7(0x1c4)+a46_0x1a549a['yellow']('~\x20'+_0x53bc8b[_0x1d7cc7(0x204)]+_0x1d7cc7(0x1a6)));if(_0x10e6ef[_0x1d7cc7(0x204)]>0x0)console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1c4)+a46_0x1a549a[_0x1d7cc7(0x192)]('-\x20'+_0x10e6ef['length']+_0x1d7cc7(0x187)));else _0xbb641c[_0x1d7cc7(0x204)]>0x0&&!_0x43d300[_0x1d7cc7(0x1bc)]&&console[_0x1d7cc7(0x1c0)]('\x20\x20\x20\x20'+a46_0x1a549a[_0x1d7cc7(0x1b6)](_0xbb641c[_0x1d7cc7(0x204)]+_0x1d7cc7(0x1f2)));console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1c4)+a46_0x1a549a[_0x1d7cc7(0x1b6)]('=\x20'+_0x2230c8[_0x1d7cc7(0x204)]+_0x1d7cc7(0x1cb)));}if(_0x718b30[_0x1d7cc7(0x204)]>0x0||_0x5ad7a2[_0x1d7cc7(0x204)]>0x0){console['error'](_0x1d7cc7(0x1a2)),console[_0x1d7cc7(0x1c0)]('\x20\x20\x20\x20'+a46_0x1a549a[_0x1d7cc7(0x210)]('+\x20'+_0x515fc9[_0x1d7cc7(0x204)]+_0x1d7cc7(0x21b))),console['error'](_0x1d7cc7(0x1c4)+a46_0x1a549a[_0x1d7cc7(0x1af)]('~\x20'+_0x18e829[_0x1d7cc7(0x204)]+_0x1d7cc7(0x1a6)));if(_0x17a954[_0x1d7cc7(0x204)]>0x0)console[_0x1d7cc7(0x1c0)]('\x20\x20\x20\x20'+a46_0x1a549a[_0x1d7cc7(0x192)]('-\x20'+_0x17a954[_0x1d7cc7(0x204)]+_0x1d7cc7(0x187)));else _0x5ad7a2[_0x1d7cc7(0x204)]>0x0&&!_0x43d300['delete']&&console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1c4)+a46_0x1a549a[_0x1d7cc7(0x1b6)](_0x5ad7a2[_0x1d7cc7(0x204)]+_0x1d7cc7(0x1f2)));console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1c4)+a46_0x1a549a[_0x1d7cc7(0x1b6)]('=\x20'+_0x5e52f6['length']+_0x1d7cc7(0x1cb)));}_0x2d285b[_0x1d7cc7(0x204)]>0x0&&!_0x43d300[_0x1d7cc7(0x18d)]&&(console[_0x1d7cc7(0x1c0)](''),console['error'](_0x1d7cc7(0x1b4)),_0x44e517[_0x1d7cc7(0x204)]>0x0&&console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1c4)+a46_0x1a549a['green']('+\x20'+_0x44e517[_0x1d7cc7(0x204)]+_0x1d7cc7(0x209))),_0xf3749[_0x1d7cc7(0x204)]>0x0&&console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1c4)+a46_0x1a549a[_0x1d7cc7(0x1af)]('~\x20'+_0xf3749[_0x1d7cc7(0x204)]+'\x20to\x20update')),_0x3bd48c['length']>0x0&&console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1c4)+a46_0x1a549a[_0x1d7cc7(0x192)]('-\x20'+_0x3bd48c['length']+_0x1d7cc7(0x187))));console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1dd)+a46_0x1a549a[_0x1d7cc7(0x1bd)](_0x305b39)+'\x0a');if(_0xaf6978['length']>0x0){console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1fd));for(const _0x9c0e28 of _0xaf6978){console[_0x1d7cc7(0x1c0)]('\x20\x20'+a46_0x1a549a['blue']('+')+'\x20'+_0x9c0e28);}console['error']('');}if(_0x15db8d[_0x1d7cc7(0x204)]>0x0&&!_0x43d300[_0x1d7cc7(0x18d)])for(const _0x2b20fe of _0x15db8d){const _0x3c0668=_0x2b20fe[_0x1d7cc7(0x205)]?_0x2b20fe[_0x1d7cc7(0x205)]+'/'+_0x2b20fe[_0x1d7cc7(0x1e6)][_0x1d7cc7(0x206)]:_0x2b20fe[_0x1d7cc7(0x1e6)][_0x1d7cc7(0x206)],_0x1c17d9=_0x2b20fe[_0x1d7cc7(0x1e6)][_0x1d7cc7(0x1fc)]?.[_0x1d7cc7(0x204)]||0x0,_0x2eeb07=_0x1c17d9>0x0?a46_0x1a549a[_0x1d7cc7(0x1b6)]('\x20['+_0x1c17d9+'\x20activations]'):'';console[_0x1d7cc7(0x1c0)]('\x0a'+a46_0x1a549a[_0x1d7cc7(0x210)](_0x1d7cc7(0x1a9))+'\x20'+_0x3c0668+_0x2eeb07),console[_0x1d7cc7(0x1c0)]('─'[_0x1d7cc7(0x208)](0x3c)),_0x2b20fe[_0x1d7cc7(0x1ca)]&&console[_0x1d7cc7(0x1c0)](_0x2b20fe[_0x1d7cc7(0x1ca)]),console[_0x1d7cc7(0x1c0)]('─'[_0x1d7cc7(0x208)](0x3c));}if(_0x10e6ef[_0x1d7cc7(0x204)]>0x0&&!_0x43d300['journeysOnly'])for(const _0x5a8fa4 of _0x10e6ef){const _0x30ef2b=_0x5a8fa4['segmentFolderId']?_0x122293[_0x1d7cc7(0x1a1)](_0x5a8fa4[_0x1d7cc7(0x1d9)]['toString']())||'':'',_0x4d26d8=_0x30ef2b?_0x30ef2b+'/'+_0x5a8fa4[_0x1d7cc7(0x206)]:_0x5a8fa4[_0x1d7cc7(0x206)],_0x5444ec=_0x198b00[_0x1d7cc7(0x1a1)](_0x5a8fa4['id'])||[],_0x490724=_0x5444ec[_0x1d7cc7(0x204)]>0x0?a46_0x1a549a[_0x1d7cc7(0x1b6)]('\x20['+_0x5444ec[_0x1d7cc7(0x204)]+_0x1d7cc7(0x1d6)):'';console[_0x1d7cc7(0x1c0)]('\x0a'+a46_0x1a549a[_0x1d7cc7(0x192)](_0x1d7cc7(0x1ad))+'\x20'+_0x4d26d8+_0x490724),console[_0x1d7cc7(0x1c0)]('─'[_0x1d7cc7(0x208)](0x3c));const _0x3beab2=segmentWithActivationsToYaml(_0x5a8fa4,_0x5444ec,undefined,_0x389279,_0x95e3b7),_0x22aff8=segmentToYamlString(_0x3beab2),_0x5386d4=generateDiff(_0x22aff8,'');console[_0x1d7cc7(0x1c0)](formatDiffWithColors(_0x5386d4)),console['error']('─'[_0x1d7cc7(0x208)](0x3c));}const _0x4d76b0=_0x2ac7d0[_0x1d7cc7(0x20d)](_0x8fe0b3=>!_0x8fe0b3[_0x1d7cc7(0x1f5)]&&_0x8fe0b3['diff']);if(_0x4d76b0[_0x1d7cc7(0x204)]>0x0&&!_0x43d300['journeysOnly'])for(const _0x1d7c12 of _0x4d76b0){const _0x2becab=_0x1d7c12[_0x1d7cc7(0x205)]?_0x1d7c12[_0x1d7cc7(0x205)]+'/'+_0x1d7c12[_0x1d7cc7(0x1e6)][_0x1d7cc7(0x206)]:_0x1d7c12[_0x1d7cc7(0x1e6)][_0x1d7cc7(0x206)];console[_0x1d7cc7(0x1c0)]('\x0a'+a46_0x1a549a[_0x1d7cc7(0x1af)](_0x1d7cc7(0x1c5))+'\x20'+_0x2becab),console[_0x1d7cc7(0x1c0)]('─'['repeat'](0x3c)),console[_0x1d7cc7(0x1c0)](_0x1d7c12[_0x1d7cc7(0x1ca)]),console['error']('─'[_0x1d7cc7(0x208)](0x3c));}if(_0x515fc9[_0x1d7cc7(0x204)]>0x0)for(const _0x28c76a of _0x515fc9){const _0x371ab8=_0x28c76a[_0x1d7cc7(0x205)]?_0x28c76a[_0x1d7cc7(0x205)]+'/'+_0x28c76a['yamlConfig']['name']:_0x28c76a[_0x1d7cc7(0x1e6)][_0x1d7cc7(0x206)];console[_0x1d7cc7(0x1c0)]('\x0a'+a46_0x1a549a[_0x1d7cc7(0x210)](_0x1d7cc7(0x1ea))+'\x20'+_0x371ab8),console[_0x1d7cc7(0x1c0)]('─'[_0x1d7cc7(0x208)](0x3c)),_0x28c76a[_0x1d7cc7(0x1ca)]&&console[_0x1d7cc7(0x1c0)](_0x28c76a['diff']),console[_0x1d7cc7(0x1c0)]('─'['repeat'](0x3c));}const _0x3b7450=_0x718b30[_0x1d7cc7(0x20d)](_0x540be1=>!_0x540be1[_0x1d7cc7(0x1f5)]&&_0x540be1[_0x1d7cc7(0x1ca)]);if(_0x3b7450['length']>0x0)for(const _0x44b7ed of _0x3b7450){const _0x2cd68c=_0x44b7ed[_0x1d7cc7(0x205)]?_0x44b7ed[_0x1d7cc7(0x205)]+'/'+_0x44b7ed['yamlConfig'][_0x1d7cc7(0x206)]:_0x44b7ed[_0x1d7cc7(0x1e6)]['name'];console[_0x1d7cc7(0x1c0)]('\x0a'+a46_0x1a549a['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x2cd68c),console[_0x1d7cc7(0x1c0)]('─'[_0x1d7cc7(0x208)](0x3c)),console[_0x1d7cc7(0x1c0)](_0x44b7ed[_0x1d7cc7(0x1ca)]),console[_0x1d7cc7(0x1c0)]('─'[_0x1d7cc7(0x208)](0x3c));}if(_0x17a954[_0x1d7cc7(0x204)]>0x0)for(const _0x830e1e of _0x17a954){const _0x54f52f=_0x830e1e[_0x1d7cc7(0x20e)]?_0x122293['get'](_0x830e1e['folderId'])||'':'',_0x4a2006=_0x54f52f?_0x54f52f+'/'+_0x830e1e[_0x1d7cc7(0x1e5)]:_0x830e1e['journeyBundleName'];console['error']('\x0a'+a46_0x1a549a[_0x1d7cc7(0x192)]('Delete\x20journey:')+'\x20'+_0x4a2006),console[_0x1d7cc7(0x1c0)]('─'['repeat'](0x3c)),console['error'](a46_0x1a549a['red']('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x1d7cc7(0x208)](0x3c));}if(_0x43d300[_0x1d7cc7(0x1e9)])return console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1af)](_0x1d7cc7(0x1b5))),0x0;const _0xe884e4=_0x43d300['journeysOnly']?![]:_0x15db8d[_0x1d7cc7(0x204)]>0x0||_0x53bc8b[_0x1d7cc7(0x204)]>0x0||_0x10e6ef['length']>0x0,_0x8e1ec3=_0x515fc9[_0x1d7cc7(0x204)]>0x0||_0x18e829[_0x1d7cc7(0x204)]>0x0||_0x17a954['length']>0x0,_0xd68c7c=_0x43d300['journeysOnly']?![]:_0x2d285b['length']>0x0,_0x3c1444=_0xaf6978[_0x1d7cc7(0x204)]>0x0;if(!_0xe884e4&&!_0x8e1ec3&&!_0xd68c7c&&!_0x3c1444){const _0x10b865=_0x43d300[_0x1d7cc7(0x18d)]?_0x1d7cc7(0x1be):_0x1d7cc7(0x1de);console['error'](a46_0x1a549a[_0x1d7cc7(0x210)](_0x10b865));if(_0x17b4ee&&_0x2230c8['length']===0x1){const _0x308a9f=_0x2230c8[0x0];if(_0x308a9f[_0x1d7cc7(0x21c)]?.['id']){const _0x40efc3=getConsoleNextUrl(_0x43d300[_0x1d7cc7(0x1c1)],_0x1d7cc7(0x21e)+_0xae3ec2+_0x1d7cc7(0x1a8)+_0x308a9f['existingSegment']['id']+_0x1d7cc7(0x214));console['error'](_0x1d7cc7(0x1a7)+a46_0x1a549a[_0x1d7cc7(0x1bd)](_0x40efc3));}}if(_0x17b4ee&&_0x5e52f6['length']===0x1){const _0x2aa40c=_0x5e52f6[0x0];if(_0x2aa40c[_0x1d7cc7(0x219)]?.['id']){const _0x22cbbe=getConsoleNextUrl(_0x43d300[_0x1d7cc7(0x1c1)],'/app/ps/'+_0xae3ec2+_0x1d7cc7(0x1a8)+_0x2aa40c[_0x1d7cc7(0x219)]['id']+_0x1d7cc7(0x212));console[_0x1d7cc7(0x1c0)]('\x20\x20'+a46_0x1a549a[_0x1d7cc7(0x1bd)](_0x22cbbe));}}return 0x0;}const _0x2d39c4=_0x43d300[_0x1d7cc7(0x18d)]?_0x515fc9[_0x1d7cc7(0x204)]+_0x18e829[_0x1d7cc7(0x204)]+_0x17a954[_0x1d7cc7(0x204)]+_0xaf6978[_0x1d7cc7(0x204)]:_0x15db8d[_0x1d7cc7(0x204)]+_0x53bc8b[_0x1d7cc7(0x204)]+_0x10e6ef['length']+_0x515fc9['length']+_0x18e829[_0x1d7cc7(0x204)]+_0x17a954['length']+_0xaf6978[_0x1d7cc7(0x204)]+_0x2d285b[_0x1d7cc7(0x204)];if(!_0x43d300[_0x1d7cc7(0x19c)]&&_0x2d39c4>0x0){if(!isInteractive())return console['error'](a46_0x1a549a[_0x1d7cc7(0x192)]('\x0aError:'),_0x1d7cc7(0x1f1)),console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1b6)](_0x1d7cc7(0x1ab))),0x1;const _0x3cdad4=await confirmKey(_0x1d7cc7(0x189)+_0x2d39c4+_0x1d7cc7(0x202));if(!_0x3cdad4)return console[_0x1d7cc7(0x1c0)](a46_0x1a549a['yellow'](_0x1d7cc7(0x1bf))),0x1;}const _0x1498fb={'withProgress':async(_0x1037ea,_0x8b0ab6)=>{const _0x53215d=_0x1d7cc7,_0x639237=await withSpinner(_0x1037ea,_0x8b0ab6,{'verbose':_0x43d300[_0x53215d(0x198)]});return{'data':_0x639237[_0x53215d(0x200)]};},'logInfo':_0x43e46d=>console['error'](a46_0x1a549a[_0x1d7cc7(0x1f7)]('✔\x20'+_0x43e46d)),'logSuccess':_0x2a1a51=>console[_0x1d7cc7(0x1c0)](a46_0x1a549a['green']('✔\x20'+_0x2a1a51)),'logWarning':_0x119013=>console[_0x1d7cc7(0x1c0)](a46_0x1a549a['yellow']('⚠\x20'+_0x119013)),'logDeleted':_0x3bf61e=>console['error'](a46_0x1a549a[_0x1d7cc7(0x192)]('✔\x20'+_0x3bf61e))},_0x3416f4={'segment':_0x29b008['segment'],'journey':_0x29b008[_0x1d7cc7(0x1d7)],'user':_0x29b008[_0x1d7cc7(0x1ee)],'connection':_0x29b008[_0x1d7cc7(0x1aa)]};_0xaf6978[_0x1d7cc7(0x204)]>0x0&&(_0x552fde=await executePushFolders(_0x3416f4,_0xaf6978,_0x552fde,{'parentId':_0xae3ec2},_0x1498fb));const _0x39c517={'rootFolderId':_0x1e50f2,'folderPathToId':_0x552fde,'folderIdToPath':_0x122293,'segmentNameToId':_0x98661c,'activationsBySegmentId':_0x198b00,'emailToIdMap':_0x4380b1,'idToEmailMap':_0x389279,'connectionNameToIdMap':_0x1ac189[_0x1d7cc7(0x1cd)],'connectionIdToNameMap':_0x1ac189[_0x1d7cc7(0x19f)],'connectionNameToTypeMap':_0x19a473},_0x80e5ea=await executePushSegments(_0x3416f4,_0x43d300['journeysOnly']?[]:_0x2ac7d0,_0x39c517,{'parentId':_0xae3ec2},_0x1498fb),_0x19a78f=_0x80e5ea[_0x1d7cc7(0x1cc)],_0x50c1be=_0x80e5ea['updated'],_0x2604ff=_0x80e5ea[_0x1d7cc7(0x1fc)][_0x1d7cc7(0x1cc)],_0x352133=_0x80e5ea[_0x1d7cc7(0x1fc)][_0x1d7cc7(0x1e7)],_0x22fb02=_0x80e5ea[_0x1d7cc7(0x1fc)]['deleted'];let _0x9fdf2e;if(_0x17b4ee&&_0x2ac7d0[_0x1d7cc7(0x204)]===0x1){const _0x3333ef=_0x2ac7d0[0x0];_0x9fdf2e=_0x3333ef[_0x1d7cc7(0x21c)]?.['id']??_0x80e5ea[_0x1d7cc7(0x21d)]['get'](_0x3333ef[_0x1d7cc7(0x1e6)][_0x1d7cc7(0x206)]);}const _0x470eae=await executePushSegmentDeletions(_0x3416f4,_0x43d300[_0x1d7cc7(0x18d)]?[]:_0x10e6ef,_0x1498fb);let _0x5e1010=0x0,_0x336378=0x0,_0xacd2d7=0x0;const _0xffec78=new Map(_0x98661c);for(const [_0x4b227f,_0x4f48de]of _0x80e5ea[_0x1d7cc7(0x21d)]){_0xffec78[_0x1d7cc7(0x18c)](_0x4b227f,_0x4f48de);}if(_0x718b30['length']>0x0){const _0x145714={..._0x39c517,'segmentNameToId':_0xffec78,'existingSegments':_0x743972,'activationContext':_0x26c187},_0x3486f2=await executePushJourneys(_0x3416f4,_0x718b30,_0x145714,{'parentId':_0xae3ec2,'rootFolderId':_0x1e50f2,'verbose':_0x43d300[_0x1d7cc7(0x198)]},_0x1498fb);_0x5e1010=_0x3486f2[_0x1d7cc7(0x1cc)],_0x336378=_0x3486f2[_0x1d7cc7(0x1e7)];if(_0x17b4ee&&_0x3486f2[_0x1d7cc7(0x18f)][_0x1d7cc7(0x204)]===0x1){const _0x7ee017=_0x3486f2[_0x1d7cc7(0x18f)][0x0];if(_0x7ee017[_0x1d7cc7(0x18b)]){const _0xe605bc=getConsoleNextUrl(_0x43d300['site'],_0x1d7cc7(0x21e)+_0xae3ec2+_0x1d7cc7(0x1a8)+_0x7ee017[_0x1d7cc7(0x18b)]+_0x1d7cc7(0x212));console[_0x1d7cc7(0x1c0)]('\x20\x20'+a46_0x1a549a[_0x1d7cc7(0x1bd)](_0xe605bc));}}}for(const _0x1b70af of _0x17a954){console[_0x1d7cc7(0x1c0)](a46_0x1a549a[_0x1d7cc7(0x1af)](_0x1d7cc7(0x1c8)+_0x1b70af[_0x1d7cc7(0x1e5)])),_0xacd2d7++;}const _0x3067d6=[];if(_0x19a78f>0x0)_0x3067d6[_0x1d7cc7(0x1d2)](_0x19a78f+_0x1d7cc7(0x19a));if(_0x50c1be>0x0)_0x3067d6[_0x1d7cc7(0x1d2)](_0x50c1be+_0x1d7cc7(0x1ed));if(_0x470eae>0x0)_0x3067d6[_0x1d7cc7(0x1d2)](_0x470eae+_0x1d7cc7(0x1e1));const _0x3515cf=[];if(_0x5e1010>0x0)_0x3515cf[_0x1d7cc7(0x1d2)](_0x5e1010+'\x20created');if(_0x336378>0x0)_0x3515cf[_0x1d7cc7(0x1d2)](_0x336378+_0x1d7cc7(0x1ed));if(_0xacd2d7>0x0)_0x3515cf['push'](_0xacd2d7+_0x1d7cc7(0x1e1));const _0xb5467f=[];if(_0x2604ff>0x0)_0xb5467f['push'](_0x2604ff+_0x1d7cc7(0x19a));if(_0x352133>0x0)_0xb5467f[_0x1d7cc7(0x1d2)](_0x352133+'\x20updated');if(_0x22fb02>0x0)_0xb5467f['push'](_0x22fb02+_0x1d7cc7(0x1e1));console['error'](a46_0x1a549a[_0x1d7cc7(0x210)](_0x1d7cc7(0x1d3)));_0x3067d6[_0x1d7cc7(0x204)]>0x0&&!_0x43d300[_0x1d7cc7(0x18d)]&&console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1e0)+_0x3067d6['join'](',\x20'));_0x3515cf[_0x1d7cc7(0x204)]>0x0&&console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1a5)+_0x3515cf['join'](',\x20'));_0xb5467f['length']>0x0&&!_0x43d300[_0x1d7cc7(0x18d)]&&console[_0x1d7cc7(0x1c0)]('\x20\x20Activations:\x20'+_0xb5467f['join'](',\x20'));if(_0x9fdf2e){const _0x20cfaa=getConsoleNextUrl(_0x43d300['site'],'/app/ps/'+_0xae3ec2+_0x1d7cc7(0x1a8)+_0x9fdf2e+_0x1d7cc7(0x214));console[_0x1d7cc7(0x1c0)](_0x1d7cc7(0x1a7)+a46_0x1a549a['cyan'](_0x20cfaa));}return 0x0;}}
|
|
1
|
+
const a47_0x7226c3=a47_0x2dc0;(function(_0x37a19e,_0x54e9dc){const _0x557d69=a47_0x2dc0,_0x4ca8d2=_0x37a19e();while(!![]){try{const _0x2336b3=parseInt(_0x557d69(0x165))/0x1*(-parseInt(_0x557d69(0x177))/0x2)+parseInt(_0x557d69(0x102))/0x3*(parseInt(_0x557d69(0xfe))/0x4)+parseInt(_0x557d69(0x170))/0x5*(-parseInt(_0x557d69(0x17e))/0x6)+-parseInt(_0x557d69(0x113))/0x7+parseInt(_0x557d69(0x135))/0x8+-parseInt(_0x557d69(0x126))/0x9*(-parseInt(_0x557d69(0x10a))/0xa)+-parseInt(_0x557d69(0xfc))/0xb;if(_0x2336b3===_0x54e9dc)break;else _0x4ca8d2['push'](_0x4ca8d2['shift']());}catch(_0x2fc784){_0x4ca8d2['push'](_0x4ca8d2['shift']());}}}(a47_0x44bb,0xadf0c));function a47_0x44bb(){const _0x1ec6a8=['Fetching\x20existing\x20activations...','listJourneysWithDetailsFromParentSegment','.yaml','journeyBundleName','changed','folderId','Fetching\x20existing\x20data...','description','yamlConfig','diff','scopedFolderPath','segment','toDelete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','attributes','\x20to\x20delete','isNew','add','\x20\x20\x20\x20','\x20activations]','parentName','existingSegment','yellow','8430312LnmQpu','type','12YFtUBe','error','delete','journey','1031598HBZWHI','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','endsWith','\x20YAML\x20files\x20found','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20folders\x20to\x20create','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)','10rKfYfG','verbose','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','/sb/da/esr','New\x20journey:','length','\x20changes?','No\x20','Site:\x20','3450559ChhzuQ','parent_name','Aborted.','Folders\x20to\x20create:','push','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0a✔\x20Push\x20complete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Parent\x20segment:\x20','unchanged','helpText','createdAt','map','listSegments','journeysOnly','then','Error\x20parsing\x20YAML:\x20','connection','file','5983272jyKuxL','parentFolder','\x20\x20📊\x20Segments:','idToName','filter','buildUserMaps','get','\x20\x20Activations:','results','existingJourney','data','no_parent','getJourney','Push\x20','Scoped\x20to\x20folder:\x20','7409280veWqHx','deleted','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','paused','isScoped','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journeyId','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','site','/app/ps/','Changes\x20to\x20journey:','audienceId','yes','activations','versionNumber','\x20\x20Segments:\x20','getMetadataWithCache','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','New\x20segment:','dryRun','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','toCreate','folderPath','new','blue','all','set','journeyBundleId','\x20changed','name','\x20new','folders','nameToType','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aPush\x20summary\x20for\x20\x27','Error:\x20','message','dim','\x20\x20Source:\x20','created','segments','updated','execute','join','\x20created','segment\x20or\x20journey','5eqNUAq','toUpdate','\x0aError:','\x20\x20Journeys:\x20','red','cyan','\x20deleted','user','repeat','journeys','nameToId','120lGODcR','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','state','getParent','createdSegmentIds','list','targetDir','118682GCZezo','parentSegment','\x20\x20🗺️\x20\x20Journeys:','\x20to\x20create','segment:push','listFolders','setPhase','88518gCGoQA','/j/da/je','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:'];a47_0x44bb=function(){return _0x1ec6a8;};return a47_0x44bb();}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 a47_0x3c0bcb from'chalk';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 a47_0x2dc0(_0x2546b8,_0x426645){_0x2546b8=_0x2546b8-0xf2;const _0x44bb69=a47_0x44bb();let _0x2dc020=_0x44bb69[_0x2546b8];return _0x2dc020;}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{[a47_0x7226c3(0x154)]=a47_0x7226c3(0x17b);[a47_0x7226c3(0x189)]='Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments';async[a47_0x7226c3(0x161)](_0x22d5c1){const _0x52f567=a47_0x7226c3,{options:_0x3b6c92,args:_0x365a12,tdx:_0x312c60}=_0x22d5c1,_0x4bbee1=_0x3b6c92,_0x543771=await resolveTarget({'arg':_0x365a12[0x0],'contextParent':_0x3b6c92[_0x52f567(0x178)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x543771))return _0x543771['errorCode']===_0x52f567(0x131)?(console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x52f567(0x109)),console[_0x52f567(0xff)](_0x52f567(0x14a)),console['error'](_0x52f567(0xf2))):(console[_0x52f567(0xff)](a47_0x3c0bcb['red'](_0x52f567(0x15a)+_0x543771[_0x52f567(0x15b)]+'\x0a')),_0x543771[_0x52f567(0x11d)]&&console['error'](a47_0x3c0bcb['cyan'](_0x543771[_0x52f567(0x11d)]))),0x1;if(_0x543771[_0x52f567(0xfd)]===_0x52f567(0x114))return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)]('Error:\x20Directory\x20not\x20found:\x20'+_0x543771[_0x52f567(0x176)]+'\x0a')),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x16a)](_0x52f567(0x13a))),0x1;const _0x1ab207=_0x543771[_0x52f567(0xf9)],_0x457eed=_0x543771['targetDir'],_0x464db7=_0x543771['type']===_0x52f567(0x125)?_0x543771['filePath']:undefined,_0x256ebd=getScopedDetails(_0x543771),_0x2a3033=_0x256ebd?.[_0x52f567(0x139)]??![],_0x299b84=_0x256ebd?.[_0x52f567(0x18c)]??'';if(!existsSync(_0x457eed))return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)]('Error:\x20Directory\x20not\x20found:\x20'+_0x457eed+'\x0a')),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x16a)](_0x52f567(0x13a))),0x1;_0x4bbee1[_0x52f567(0x10b)]&&(console[_0x52f567(0xff)](_0x52f567(0x112)+_0x4bbee1[_0x52f567(0x13d)]),console[_0x52f567(0xff)](_0x52f567(0x11b)+_0x1ab207),console[_0x52f567(0xff)]('Source\x20directory:\x20'+_0x457eed),_0x2a3033&&console['error'](_0x52f567(0x134)+_0x299b84));const _0x4894ca=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ab207+'\x27...',()=>_0x312c60['segment']['resolveParentId'](_0x1ab207),{'verbose':_0x4bbee1[_0x52f567(0x10b)]}),_0x5a9633=_0x4894ca['data'],{parentSegmentResult:_0x347610,segmentsResult:_0x465d2f,foldersResult:_0x2298c1,journeysWithDetailsResult:_0x37be0b,userMaps:_0x25bc3d}=await withSpinner(_0x52f567(0x188),async()=>{const _0x353f08=_0x52f567,[_0x162065,_0x1855d7,_0x20eff9,_0x45e8ad,_0x4e215f]=await Promise[_0x353f08(0x150)]([_0x312c60['segment'][_0x353f08(0x173)](_0x5a9633),_0x312c60[_0x353f08(0x18d)][_0x353f08(0x120)](_0x5a9633),_0x312c60['segment'][_0x353f08(0x17c)](_0x5a9633),_0x312c60[_0x353f08(0x101)][_0x353f08(0x183)](_0x5a9633,{'includeAllVersions':!![]}),_0x312c60[_0x353f08(0x16c)][_0x353f08(0x12b)]()]);return{'parentSegmentResult':_0x162065,'segmentsResult':_0x1855d7,'foldersResult':_0x20eff9,'journeysWithDetailsResult':_0x45e8ad,'userMaps':_0x4e215f};},{'verbose':_0x4bbee1[_0x52f567(0x10b)]})[_0x52f567(0x122)](_0x44a9c8=>_0x44a9c8[_0x52f567(0x130)]),_0x4f7e51=_0x347610,_0x3d3315=extractRootFolderId(_0x4f7e51),_0x3bb2a9=_0x465d2f,_0x468b5a=_0x2298c1,{journeys:_0x341990,activationStepsById:_0xecbd6b}=_0x37be0b,_0x551fc6=new Map(_0x341990[_0x52f567(0x11f)](_0x168dfc=>[_0x168dfc['id'],_0x168dfc])),_0x4c8f74=_0x341990[_0x52f567(0x11f)](_0x3028f0=>({'id':_0x3028f0['id'],'name':_0x3028f0['attributes'][_0x52f567(0x154)],'journeyBundleName':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x185)]||'','journeyBundleId':_0x3028f0['attributes'][_0x52f567(0x152)]||'','versionNumber':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x143)],'description':_0x3028f0[_0x52f567(0xf3)]['description'],'state':_0x3028f0['attributes'][_0x52f567(0x172)],'paused':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x138)],'audienceId':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x140)],'folderId':_0x3028f0['relationships']?.[_0x52f567(0x127)]?.[_0x52f567(0x130)]?.['id'],'createdAt':_0x3028f0[_0x52f567(0xf3)][_0x52f567(0x11e)],'updatedAt':_0x3028f0[_0x52f567(0xf3)]['updatedAt']})),{emailToId:_0x44131d,idToEmail:_0x5c8227}=_0x25bc3d,_0x5c2e5e=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x10f864=_0x52f567,_0xe652a0=await _0x312c60['connection'][_0x10f864(0x175)]();return buildConnectionMaps(_0xe652a0);},{'verbose':_0x4bbee1[_0x52f567(0x10b)]})[_0x52f567(0x122)](_0x40b491=>_0x40b491[_0x52f567(0x130)]),_0x20e730=_0x5c2e5e[_0x52f567(0x16f)],_0x2ac23f=_0x5c2e5e['idToName'],_0xb9eaf0=_0x5c2e5e[_0x52f567(0x157)],_0x5b03b4={'emailToIdMap':_0x44131d,'connectionNameToIdMap':_0x20e730,'connectionNameToTypeMap':_0xb9eaf0,'getSchema':_0x36381a=>_0x312c60[_0x52f567(0x124)]['getOutputSchemaWithCache'](_0x36381a),'getMetadata':_0x1f32ec=>_0x312c60['connection'][_0x52f567(0x145)](_0x1f32ec)};let {pathToId:_0x307917,idToPath:_0x7210d1}=buildFolderMaps(_0x468b5a);const _0x3cecf4=buildSegmentLookupMap(_0x3bb2a9,_0x7210d1),_0x2ad6a4=buildSegmentNameToIdMap(_0x3bb2a9),_0x9678a2=buildJourneyBundleLookupMap(_0x4c8f74,_0x7210d1);let _0x570cf4;if(_0x464db7){if(!_0x464db7[_0x52f567(0x105)]('.yml')&&!_0x464db7['endsWith'](_0x52f567(0x184)))return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x11a)+_0x464db7+'\x0a')),0x1;_0x570cf4=[_0x464db7];}else _0x570cf4=findYamlFiles(_0x457eed);if(_0x570cf4['length']===0x0)return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x118)+_0x457eed+'\x0a')),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x16a)](_0x52f567(0x158))),0x1;let _0x4b2edf,_0x3498a5;try{const _0x1d77f4=parseAndClassifyYamlFiles(_0x570cf4,_0x457eed,{'skipSegments':_0x4bbee1[_0x52f567(0x121)]});_0x4b2edf=_0x1d77f4[_0x52f567(0x15f)],_0x3498a5=_0x1d77f4[_0x52f567(0x16e)];const _0xf647e7=validateParsedFiles(_0x1d77f4,_0x457eed);if(_0xf647e7[_0x52f567(0x10f)]>0x0)return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x181))),console['error'](formatValidationErrors(_0xf647e7)),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x13c))),0x1;}catch(_0x1c78f0){return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x123)+(_0x1c78f0 instanceof Error?_0x1c78f0[_0x52f567(0x15b)]:_0x1c78f0))),0x1;}if(_0x4b2edf[_0x52f567(0x10f)]===0x0&&_0x3498a5[_0x52f567(0x10f)]===0x0){const _0x22041e=_0x4bbee1[_0x52f567(0x121)]?_0x52f567(0x101):_0x52f567(0x164);return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x111)+_0x22041e+_0x52f567(0x106))),0x0;}const _0x4e7eb2=new Map();_0x3bb2a9[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)]&&await withSpinner(_0x52f567(0x182),async()=>{await batchAsync(_0x3bb2a9,async _0x2139b8=>{const _0x15e589=a47_0x2dc0,_0x2d636d=await _0x312c60[_0x15e589(0x18d)]['listActivations'](_0x5a9633,_0x2139b8['id']);_0x4e7eb2[_0x15e589(0x151)](_0x2139b8['id'],_0x2d636d);});},{'verbose':_0x4bbee1[_0x52f567(0x10b)]});const {segmentFiles:_0x4e8f1b,foldersToCreate:_0x3a089d}=await prepareSegmentFiles(_0x4b2edf,{'segmentByFolderAndName':_0x3cecf4,'activationsBySegmentId':_0x4e7eb2,'folderPathToId':_0x307917,'idToEmailMap':_0x5c8227,'connectionIdToNameMap':_0x2ac23f},_0x5b03b4,_0x2a3033,_0x299b84),_0x5433ce=_0x464db7?[]:findSegmentsToDelete(_0x3bb2a9,_0x4b2edf[_0x52f567(0x11f)](({yamlConfig:_0x54415b,folderPath:_0x212f57})=>({'yamlConfig':_0x54415b,'folderPath':resolveTDFolderPath(_0x212f57,_0x2a3033,_0x299b84)})),_0x7210d1,_0x299b84,_0x2a3033),{journeyFiles:_0x4c1997,foldersToCreate:_0x496190}=await withProgressSpinner('Preparing\x20journeys...',async _0x1f3ffa=>prepareJourneyFiles(_0x3498a5,{'fetchJourney':async _0x2be486=>_0x312c60['journey'][_0x52f567(0x132)](_0x2be486[_0x52f567(0x13b)]),'journeyBundlesByFolderAndName':_0x9678a2,'folderPathToId':_0x307917,'idToEmailMap':_0x5c8227,'connectionIdToNameMap':_0x2ac23f,'existingSegments':_0x3bb2a9,'parentId':_0x5a9633,'deps':_0x312c60,'progress':{'update':_0xe152e2=>{const _0x45777d=_0x52f567;_0x1f3ffa[_0x45777d(0x17d)](_0xe152e2),_0x4bbee1[_0x45777d(0x10b)]&&console[_0x45777d(0xff)]('\x20\x20'+_0xe152e2);}},'journeyById':_0x551fc6,'activationStepsById':_0xecbd6b},_0x2a3033,_0x299b84),{'verbose':_0x4bbee1[_0x52f567(0x10b)]})[_0x52f567(0x122)](_0x5e4094=>_0x5e4094['data']);for(const _0x16df62 of _0x496190){_0x3a089d[_0x52f567(0xf6)](_0x16df62);}const _0x38447a=_0x464db7?[]:findJourneysToDelete(_0x4c8f74,_0x3498a5[_0x52f567(0x11f)](({yamlConfig:_0x1e974d,folderPath:_0x4c4f6b})=>({'yamlConfig':_0x1e974d,'folderPath':resolveTDFolderPath(_0x4c4f6b,_0x2a3033,_0x299b84)})),_0x7210d1,_0x299b84,_0x2a3033),_0x163943=calculatePushStats(_0x4e8f1b,_0x4c1997,_0x3a089d,_0x5433ce,_0x38447a,!!_0x4bbee1[_0x52f567(0x100)],!!_0x4bbee1[_0x52f567(0x121)]),_0x3cd1d2=_0x163943[_0x52f567(0x15f)]['new'],_0x316faa=_0x163943['segments'][_0x52f567(0x186)],_0x2b19d1=_0x163943[_0x52f567(0x15f)][_0x52f567(0x11c)],_0x2d23b1=_0x163943[_0x52f567(0x15f)][_0x52f567(0x18e)],_0x234a80=_0x163943[_0x52f567(0x156)][_0x52f567(0x14c)],_0x112aef=_0x163943['journeys'][_0x52f567(0x14e)],_0x105d12=_0x163943[_0x52f567(0x16e)][_0x52f567(0x186)],_0xe0b6a9=_0x163943['journeys'][_0x52f567(0x11c)],_0x155c96=_0x163943[_0x52f567(0x16e)][_0x52f567(0x18e)],_0xaa734b=_0x163943[_0x52f567(0x142)][_0x52f567(0x150)],_0x400d15=_0x163943['activations'][_0x52f567(0x14c)],_0x2e398a=_0x163943[_0x52f567(0x142)][_0x52f567(0x166)],_0x4eaf4a=_0x163943['activations'][_0x52f567(0x18e)];console[_0x52f567(0xff)](_0x52f567(0x159)+_0x1ab207+'\x27:');_0x234a80[_0x52f567(0x10f)]>0x0&&console['error']('\x20\x20'+a47_0x3c0bcb['blue']('📁\x20'+_0x234a80['length']+_0x52f567(0x108)));if(!_0x4bbee1[_0x52f567(0x121)]){console[_0x52f567(0xff)](_0x52f567(0x128)),console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb['green']('+\x20'+_0x3cd1d2['length']+_0x52f567(0x155))),console[_0x52f567(0xff)]('\x20\x20\x20\x20'+a47_0x3c0bcb[_0x52f567(0xfb)]('~\x20'+_0x316faa['length']+_0x52f567(0x153)));if(_0x2d23b1['length']>0x0)console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x169)]('-\x20'+_0x2d23b1[_0x52f567(0x10f)]+'\x20to\x20delete'));else _0x5433ce[_0x52f567(0x10f)]>0x0&&!_0x4bbee1['delete']&&console['error'](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x15c)](_0x5433ce[_0x52f567(0x10f)]+_0x52f567(0x107)));console['error'](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x15c)]('=\x20'+_0x2b19d1[_0x52f567(0x10f)]+'\x20unchanged'));}if(_0x4c1997[_0x52f567(0x10f)]>0x0||_0x38447a[_0x52f567(0x10f)]>0x0){console['error'](_0x52f567(0x179)),console[_0x52f567(0xff)]('\x20\x20\x20\x20'+a47_0x3c0bcb['green']('+\x20'+_0x112aef[_0x52f567(0x10f)]+_0x52f567(0x155))),console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0xfb)]('~\x20'+_0x105d12[_0x52f567(0x10f)]+'\x20changed'));if(_0x155c96[_0x52f567(0x10f)]>0x0)console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x169)]('-\x20'+_0x155c96[_0x52f567(0x10f)]+_0x52f567(0xf4)));else _0x38447a[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x100)]&&console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb['dim'](_0x38447a[_0x52f567(0x10f)]+_0x52f567(0x107)));console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb['dim']('=\x20'+_0xe0b6a9[_0x52f567(0x10f)]+'\x20unchanged'));}_0xaa734b[_0x52f567(0x10f)]>0x0&&!_0x4bbee1['journeysOnly']&&(console[_0x52f567(0xff)](''),console[_0x52f567(0xff)](_0x52f567(0x12d)),_0x400d15[_0x52f567(0x10f)]>0x0&&console[_0x52f567(0xff)](_0x52f567(0xf7)+a47_0x3c0bcb[_0x52f567(0x149)]('+\x20'+_0x400d15[_0x52f567(0x10f)]+_0x52f567(0x17a))),_0x2e398a['length']>0x0&&console[_0x52f567(0xff)]('\x20\x20\x20\x20'+a47_0x3c0bcb['yellow']('~\x20'+_0x2e398a[_0x52f567(0x10f)]+'\x20to\x20update')),_0x4eaf4a[_0x52f567(0x10f)]>0x0&&console['error'](_0x52f567(0xf7)+a47_0x3c0bcb['red']('-\x20'+_0x4eaf4a['length']+_0x52f567(0xf4))));console[_0x52f567(0xff)](_0x52f567(0x15d)+a47_0x3c0bcb['cyan'](_0x457eed)+'\x0a');if(_0x234a80[_0x52f567(0x10f)]>0x0){console[_0x52f567(0xff)](_0x52f567(0x116));for(const _0x1dd29e of _0x234a80){console['error']('\x20\x20'+a47_0x3c0bcb[_0x52f567(0x14f)]('+')+'\x20'+_0x1dd29e);}console[_0x52f567(0xff)]('');}if(_0x3cd1d2[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)])for(const _0x303f3b of _0x3cd1d2){const _0x3c2c90=_0x303f3b[_0x52f567(0x14d)]?_0x303f3b[_0x52f567(0x14d)]+'/'+_0x303f3b['yamlConfig']['name']:_0x303f3b[_0x52f567(0x18a)]['name'],_0x4523c7=_0x303f3b[_0x52f567(0x18a)][_0x52f567(0x142)]?.[_0x52f567(0x10f)]||0x0,_0x150f07=_0x4523c7>0x0?a47_0x3c0bcb[_0x52f567(0x15c)]('\x20['+_0x4523c7+_0x52f567(0xf8)):'';console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb['green'](_0x52f567(0x147))+'\x20'+_0x3c2c90+_0x150f07),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c)),_0x303f3b[_0x52f567(0x18b)]&&console[_0x52f567(0xff)](_0x303f3b[_0x52f567(0x18b)]),console[_0x52f567(0xff)]('─'['repeat'](0x3c));}if(_0x2d23b1['length']>0x0&&!_0x4bbee1[_0x52f567(0x121)])for(const _0x51243b of _0x2d23b1){const _0x410157=_0x51243b['segmentFolderId']?_0x7210d1[_0x52f567(0x12c)](_0x51243b['segmentFolderId']['toString']())||'':'',_0x38fa00=_0x410157?_0x410157+'/'+_0x51243b[_0x52f567(0x154)]:_0x51243b['name'],_0x95c2bd=_0x4e7eb2[_0x52f567(0x12c)](_0x51243b['id'])||[],_0x2d3bca=_0x95c2bd['length']>0x0?a47_0x3c0bcb[_0x52f567(0x15c)]('\x20['+_0x95c2bd[_0x52f567(0x10f)]+_0x52f567(0xf8)):'';console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0x169)]('Delete\x20segment:')+'\x20'+_0x38fa00+_0x2d3bca),console['error']('─'[_0x52f567(0x16d)](0x3c));const _0x85c50=segmentWithActivationsToYaml(_0x51243b,_0x95c2bd,undefined,_0x5c8227,_0x2ac23f),_0x3543a1=segmentToYamlString(_0x85c50),_0x737d81=generateDiff(_0x3543a1,'');console[_0x52f567(0xff)](formatDiffWithColors(_0x737d81)),console['error']('─'[_0x52f567(0x16d)](0x3c));}const _0x4efb53=_0x4e8f1b[_0x52f567(0x12a)](_0x1b023d=>!_0x1b023d['isNew']&&_0x1b023d[_0x52f567(0x18b)]);if(_0x4efb53[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)])for(const _0x504e92 of _0x4efb53){const _0x4febbb=_0x504e92['folderPath']?_0x504e92[_0x52f567(0x14d)]+'/'+_0x504e92[_0x52f567(0x18a)][_0x52f567(0x154)]:_0x504e92[_0x52f567(0x18a)][_0x52f567(0x154)];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0xfb)]('Changes\x20to:')+'\x20'+_0x4febbb),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c)),console[_0x52f567(0xff)](_0x504e92[_0x52f567(0x18b)]),console['error']('─'['repeat'](0x3c));}if(_0x112aef[_0x52f567(0x10f)]>0x0)for(const _0x489115 of _0x112aef){const _0x4fa76f=_0x489115[_0x52f567(0x14d)]?_0x489115[_0x52f567(0x14d)]+'/'+_0x489115['yamlConfig']['name']:_0x489115['yamlConfig'][_0x52f567(0x154)];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb['green'](_0x52f567(0x10e))+'\x20'+_0x4fa76f),console['error']('─'['repeat'](0x3c)),_0x489115[_0x52f567(0x18b)]&&console[_0x52f567(0xff)](_0x489115[_0x52f567(0x18b)]),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c));}const _0x286f52=_0x4c1997[_0x52f567(0x12a)](_0x1876de=>!_0x1876de[_0x52f567(0xf5)]&&_0x1876de['diff']);if(_0x286f52[_0x52f567(0x10f)]>0x0)for(const _0x5d03f6 of _0x286f52){const _0x587d21=_0x5d03f6[_0x52f567(0x14d)]?_0x5d03f6['folderPath']+'/'+_0x5d03f6[_0x52f567(0x18a)][_0x52f567(0x154)]:_0x5d03f6[_0x52f567(0x18a)][_0x52f567(0x154)];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x13f))+'\x20'+_0x587d21),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c)),console[_0x52f567(0xff)](_0x5d03f6[_0x52f567(0x18b)]),console[_0x52f567(0xff)]('─'[_0x52f567(0x16d)](0x3c));}if(_0x155c96[_0x52f567(0x10f)]>0x0)for(const _0x458fda of _0x155c96){const _0x5eccdd=_0x458fda[_0x52f567(0x187)]?_0x7210d1['get'](_0x458fda['folderId'])||'':'',_0x3cd2a5=_0x5eccdd?_0x5eccdd+'/'+_0x458fda['journeyBundleName']:_0x458fda['journeyBundleName'];console[_0x52f567(0xff)]('\x0a'+a47_0x3c0bcb[_0x52f567(0x169)]('Delete\x20journey:')+'\x20'+_0x3cd2a5),console['error']('─'['repeat'](0x3c)),console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)]('(Journey\x20will\x20be\x20deleted)')),console[_0x52f567(0xff)]('─'['repeat'](0x3c));}if(_0x4bbee1[_0x52f567(0x148)])return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x10c))),0x0;const _0x3d6580=_0x4bbee1['journeysOnly']?![]:_0x3cd1d2[_0x52f567(0x10f)]>0x0||_0x316faa['length']>0x0||_0x2d23b1['length']>0x0,_0x33151f=_0x112aef['length']>0x0||_0x105d12['length']>0x0||_0x155c96[_0x52f567(0x10f)]>0x0,_0x2dca23=_0x4bbee1[_0x52f567(0x121)]?![]:_0xaa734b[_0x52f567(0x10f)]>0x0,_0x1b536c=_0x234a80[_0x52f567(0x10f)]>0x0;if(!_0x3d6580&&!_0x33151f&&!_0x2dca23&&!_0x1b536c){const _0x134a2f=_0x4bbee1['journeysOnly']?_0x52f567(0x180):_0x52f567(0x146);console['error'](a47_0x3c0bcb['green'](_0x134a2f));if(_0x464db7&&_0x2b19d1[_0x52f567(0x10f)]===0x1){const _0x4ed5d3=_0x2b19d1[0x0];if(_0x4ed5d3['existingSegment']?.['id']){const _0x512857=getConsoleNextUrl(_0x4bbee1[_0x52f567(0x13d)],_0x52f567(0x13e)+_0x5a9633+_0x52f567(0x104)+_0x4ed5d3[_0x52f567(0xfa)]['id']+'/sb/da/esr');console[_0x52f567(0xff)](_0x52f567(0x137)+a47_0x3c0bcb[_0x52f567(0x16a)](_0x512857));}}if(_0x464db7&&_0xe0b6a9[_0x52f567(0x10f)]===0x1){const _0x340e81=_0xe0b6a9[0x0];if(_0x340e81[_0x52f567(0x12f)]?.['id']){const _0x4af24c=getConsoleNextUrl(_0x4bbee1[_0x52f567(0x13d)],'/app/ps/'+_0x5a9633+_0x52f567(0x104)+_0x340e81[_0x52f567(0x12f)]['id']+_0x52f567(0x17f));console['error']('\x20\x20'+a47_0x3c0bcb[_0x52f567(0x16a)](_0x4af24c));}}return 0x0;}const _0x450d4e=_0x4bbee1[_0x52f567(0x121)]?_0x112aef[_0x52f567(0x10f)]+_0x105d12['length']+_0x155c96[_0x52f567(0x10f)]+_0x234a80[_0x52f567(0x10f)]:_0x3cd1d2[_0x52f567(0x10f)]+_0x316faa['length']+_0x2d23b1[_0x52f567(0x10f)]+_0x112aef['length']+_0x105d12[_0x52f567(0x10f)]+_0x155c96[_0x52f567(0x10f)]+_0x234a80[_0x52f567(0x10f)]+_0xaa734b[_0x52f567(0x10f)];if(!_0x4bbee1[_0x52f567(0x141)]&&_0x450d4e>0x0){if(!isInteractive())return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0x169)](_0x52f567(0x167)),_0x52f567(0x14b)),console['error'](a47_0x3c0bcb[_0x52f567(0x15c)](_0x52f567(0x103))),0x1;const _0x379472=await confirmKey(_0x52f567(0x133)+_0x450d4e+_0x52f567(0x110));if(!_0x379472)return console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x115))),0x1;}const _0x1bf6c9={'withProgress':async(_0x3e2071,_0x463606)=>{const _0x426941=_0x52f567,_0x1ea6ae=await withSpinner(_0x3e2071,_0x463606,{'verbose':_0x4bbee1[_0x426941(0x10b)]});return{'data':_0x1ea6ae[_0x426941(0x130)]};},'logInfo':_0x48cb20=>console[_0x52f567(0xff)](a47_0x3c0bcb['blue']('✔\x20'+_0x48cb20)),'logSuccess':_0x153ba1=>console[_0x52f567(0xff)](a47_0x3c0bcb['green']('✔\x20'+_0x153ba1)),'logWarning':_0xd47a28=>console['error'](a47_0x3c0bcb[_0x52f567(0xfb)]('⚠\x20'+_0xd47a28)),'logDeleted':_0x31ffa4=>console[_0x52f567(0xff)](a47_0x3c0bcb['red']('✔\x20'+_0x31ffa4))},_0x17eb86={'segment':_0x312c60[_0x52f567(0x18d)],'journey':_0x312c60[_0x52f567(0x101)],'user':_0x312c60['user'],'connection':_0x312c60[_0x52f567(0x124)]};_0x234a80[_0x52f567(0x10f)]>0x0&&(_0x307917=await executePushFolders(_0x17eb86,_0x234a80,_0x307917,{'parentId':_0x5a9633},_0x1bf6c9));const _0x3a3e89={'rootFolderId':_0x3d3315,'folderPathToId':_0x307917,'folderIdToPath':_0x7210d1,'segmentNameToId':_0x2ad6a4,'activationsBySegmentId':_0x4e7eb2,'emailToIdMap':_0x44131d,'idToEmailMap':_0x5c8227,'connectionNameToIdMap':_0x5c2e5e['nameToId'],'connectionIdToNameMap':_0x5c2e5e[_0x52f567(0x129)],'connectionNameToTypeMap':_0xb9eaf0},_0x4b1333=await executePushSegments(_0x17eb86,_0x4bbee1[_0x52f567(0x121)]?[]:_0x4e8f1b,_0x3a3e89,{'parentId':_0x5a9633},_0x1bf6c9),_0x20cd59=_0x4b1333['created'],_0x212eda=_0x4b1333[_0x52f567(0x160)],_0xbbf30a=_0x4b1333['activations'][_0x52f567(0x15e)],_0x29e7b3=_0x4b1333['activations'][_0x52f567(0x160)],_0x187a6c=_0x4b1333[_0x52f567(0x142)][_0x52f567(0x136)];let _0xc8e9af;if(_0x464db7&&_0x4e8f1b[_0x52f567(0x10f)]===0x1){const _0x590471=_0x4e8f1b[0x0];_0xc8e9af=_0x590471['existingSegment']?.['id']??_0x4b1333['createdSegmentIds']['get'](_0x590471['yamlConfig'][_0x52f567(0x154)]);}const _0x52f082=await executePushSegmentDeletions(_0x17eb86,_0x4bbee1['journeysOnly']?[]:_0x2d23b1,_0x1bf6c9);let _0x58c7c8=0x0,_0x500e4b=0x0,_0x37fc96=0x0;const _0x52667b=new Map(_0x2ad6a4);for(const [_0x3eabc5,_0x2f5504]of _0x4b1333[_0x52f567(0x174)]){_0x52667b['set'](_0x3eabc5,_0x2f5504);}if(_0x4c1997[_0x52f567(0x10f)]>0x0){const _0x38b2f2={..._0x3a3e89,'segmentNameToId':_0x52667b,'existingSegments':_0x3bb2a9,'activationContext':_0x5b03b4},_0x287e4a=await executePushJourneys(_0x17eb86,_0x4c1997,_0x38b2f2,{'parentId':_0x5a9633,'rootFolderId':_0x3d3315,'verbose':_0x4bbee1[_0x52f567(0x10b)]},_0x1bf6c9);_0x58c7c8=_0x287e4a[_0x52f567(0x15e)],_0x500e4b=_0x287e4a['updated'];if(_0x464db7&&_0x287e4a[_0x52f567(0x12e)][_0x52f567(0x10f)]===0x1){const _0x62866a=_0x287e4a[_0x52f567(0x12e)][0x0];if(_0x62866a[_0x52f567(0x13b)]){const _0x470b59=getConsoleNextUrl(_0x4bbee1['site'],_0x52f567(0x13e)+_0x5a9633+_0x52f567(0x104)+_0x62866a['journeyId']+_0x52f567(0x17f));console[_0x52f567(0xff)]('\x20\x20'+a47_0x3c0bcb[_0x52f567(0x16a)](_0x470b59));}}}for(const _0x561074 of _0x155c96){console[_0x52f567(0xff)](a47_0x3c0bcb[_0x52f567(0xfb)](_0x52f567(0x171)+_0x561074[_0x52f567(0x185)])),_0x37fc96++;}const _0x2ddb3a=[];if(_0x20cd59>0x0)_0x2ddb3a['push'](_0x20cd59+'\x20created');if(_0x212eda>0x0)_0x2ddb3a[_0x52f567(0x117)](_0x212eda+'\x20updated');if(_0x52f082>0x0)_0x2ddb3a[_0x52f567(0x117)](_0x52f082+_0x52f567(0x16b));const _0x5cd980=[];if(_0x58c7c8>0x0)_0x5cd980[_0x52f567(0x117)](_0x58c7c8+_0x52f567(0x163));if(_0x500e4b>0x0)_0x5cd980['push'](_0x500e4b+'\x20updated');if(_0x37fc96>0x0)_0x5cd980[_0x52f567(0x117)](_0x37fc96+_0x52f567(0x16b));const _0x108a46=[];if(_0xbbf30a>0x0)_0x108a46[_0x52f567(0x117)](_0xbbf30a+_0x52f567(0x163));if(_0x29e7b3>0x0)_0x108a46['push'](_0x29e7b3+'\x20updated');if(_0x187a6c>0x0)_0x108a46['push'](_0x187a6c+_0x52f567(0x16b));console['error'](a47_0x3c0bcb['green'](_0x52f567(0x119)));_0x2ddb3a[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)]&&console[_0x52f567(0xff)](_0x52f567(0x144)+_0x2ddb3a[_0x52f567(0x162)](',\x20'));_0x5cd980[_0x52f567(0x10f)]>0x0&&console[_0x52f567(0xff)](_0x52f567(0x168)+_0x5cd980[_0x52f567(0x162)](',\x20'));_0x108a46[_0x52f567(0x10f)]>0x0&&!_0x4bbee1[_0x52f567(0x121)]&&console[_0x52f567(0xff)]('\x20\x20Activations:\x20'+_0x108a46['join'](',\x20'));if(_0xc8e9af){const _0x1115cb=getConsoleNextUrl(_0x4bbee1[_0x52f567(0x13d)],_0x52f567(0x13e)+_0x5a9633+'/e/'+_0xc8e9af+_0x52f567(0x10d));console['error'](_0x52f567(0x137)+a47_0x3c0bcb[_0x52f567(0x16a)](_0x1115cb));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a48_0x4109(){const _0x3ae26f=['segmentName','resolveFolderId','Resolving\x20folder\x20\x27','640DzCBRH','INTERNAL','3pLrJJJ','type','description','segmentId','715oZzZTz','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','1206692MAFRuM','260284bMkeLe','segment','5425632uVcRkE','1808pXknPn','Error:\x20Cannot\x20update\x20','yellow','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','error','name','data','Resolving\x20path\x20\x27','1970qqEwHS','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','kind','folder','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','\x27...','parentId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','43841JUUfPy','segmentPath','Resolved\x20folder\x20ID:\x20','5167845nUwdzA','\x20\x20\x20Path:\x20','285700nAJQyp','Examples:','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','includes','updateSegmentById','Updating\x20segment\x20\x27'];a48_0x4109=function(){return _0x3ae26f;};return a48_0x4109();}function a48_0x50cf(_0x339ae0,_0x297ea7){_0x339ae0=_0x339ae0-0xa4;const _0x410953=a48_0x4109();let _0x50cf4f=_0x410953[_0x339ae0];return _0x50cf4f;}const a48_0x420180=a48_0x50cf;(function(_0x48cf4a,_0x3a8354){const _0x168bfc=a48_0x50cf,_0x59cf19=_0x48cf4a();while(!![]){try{const _0x33f235=parseInt(_0x168bfc(0xa7))/0x1+-parseInt(_0x168bfc(0xa6))/0x2*(parseInt(_0x168bfc(0xce))/0x3)+parseInt(_0x168bfc(0xaa))/0x4*(-parseInt(_0x168bfc(0xb3))/0x5)+-parseInt(_0x168bfc(0xa9))/0x6+-parseInt(_0x168bfc(0xbe))/0x7*(parseInt(_0x168bfc(0xcc))/0x8)+parseInt(_0x168bfc(0xc1))/0x9+-parseInt(_0x168bfc(0xc3))/0xa*(-parseInt(_0x168bfc(0xa4))/0xb);if(_0x33f235===_0x3a8354)break;else _0x59cf19['push'](_0x59cf19['shift']());}catch(_0x3faf23){_0x59cf19['push'](_0x59cf19['shift']());}}}(a48_0x4109,0x7b3d9));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';import a48_0x3183ad from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';[a48_0x420180(0xd0)]='Update\x20existing\x20child\x20segment';async['execute'](_0x3f6f30){const _0x3043c4=a48_0x420180;console[_0x3043c4(0xaf)](a48_0x3183ad[_0x3043c4(0xac)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a48_0x3183ad['yellow'](_0x3043c4(0xbd)));const {options:_0x3cf53e,args:_0x2cc779,tdx:_0x425808}=_0x3f6f30,_0x307093=_0x3cf53e;if(_0x2cc779['length']===0x0)return console[_0x3043c4(0xaf)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x3043c4(0xaf)](_0x3043c4(0xc5)),console[_0x3043c4(0xaf)](_0x3043c4(0xc4)),console[_0x3043c4(0xaf)](_0x3043c4(0xbb)),console['error'](_0x3043c4(0xae)),0x1;const _0x27b0b4=_0x2cc779[0x0],_0x567137=_0x3cf53e[_0x3043c4(0xbf)];let _0x119c5d=_0x27b0b4;_0x567137&&!_0x27b0b4[_0x3043c4(0xc6)]('/')&&(_0x119c5d=_0x567137+'/'+_0x27b0b4,_0x307093[_0x3043c4(0xbc)]&&console[_0x3043c4(0xaf)](_0x3043c4(0xb8)+_0x119c5d));const _0x553981=await withSpinner(_0x3043c4(0xb2)+_0x119c5d+_0x3043c4(0xb9),()=>_0x425808[_0x3043c4(0xa8)][_0x3043c4(0xb7)](_0x119c5d),{'verbose':_0x307093['verbose']}),_0x1c49fe=_0x553981[_0x3043c4(0xb1)];_0x307093[_0x3043c4(0xbc)]&&console[_0x3043c4(0xaf)]('Resolved\x20type:\x20'+_0x1c49fe[_0x3043c4(0xcf)]);if(_0x1c49fe[_0x3043c4(0xcf)]!=='segment')return console[_0x3043c4(0xaf)](_0x3043c4(0xab)+_0x1c49fe[_0x3043c4(0xcf)]+_0x3043c4(0xa5)),console[_0x3043c4(0xaf)](_0x3043c4(0xb4)),0x1;if(!_0x1c49fe[_0x3043c4(0xd1)])throw new SDKError(ErrorCode[_0x3043c4(0xcd)],_0x3043c4(0xad));const _0x2db328=_0x1c49fe[_0x3043c4(0xba)],_0x3ed13d=_0x1c49fe[_0x3043c4(0xd1)];_0x307093[_0x3043c4(0xbc)]&&(console[_0x3043c4(0xaf)]('Parent\x20ID:\x20'+_0x2db328),console[_0x3043c4(0xaf)]('Segment\x20ID:\x20'+_0x3ed13d));let _0x441d34;if(_0x307093[_0x3043c4(0xb6)]){const _0x3efeb1=_0x307093[_0x3043c4(0xb6)],_0x124f98=await withSpinner(_0x3043c4(0xcb)+_0x3efeb1+_0x3043c4(0xb9),()=>_0x425808['segment'][_0x3043c4(0xca)](_0x2db328,_0x3efeb1),{'verbose':_0x307093['verbose']});_0x441d34=parseInt(_0x124f98[_0x3043c4(0xb1)],0xa),_0x307093[_0x3043c4(0xbc)]&&console[_0x3043c4(0xaf)](_0x3043c4(0xc0)+_0x441d34);}const _0x22bd14=await loadJSONFromOptions(_0x307093['rule'],_0x307093['ruleFile']),_0x2f68d4={'name':_0x307093['name'],'description':_0x307093['description'],'rule':_0x22bd14,'kind':_0x307093[_0x3043c4(0xb5)]!==undefined?parseInt(_0x307093[_0x3043c4(0xb5)],0xa):undefined,'segmentFolderId':_0x441d34},_0x23b589=await withSpinner(_0x3043c4(0xc8)+_0x1c49fe[_0x3043c4(0xc9)]+_0x3043c4(0xb9),()=>_0x425808[_0x3043c4(0xa8)][_0x3043c4(0xc7)](_0x2db328,_0x3ed13d,_0x2f68d4),{'verbose':_0x307093[_0x3043c4(0xbc)]}),_0x388cbc=_0x23b589['data'];return console[_0x3043c4(0xaf)]('✔\x20Updated\x20segment\x20\x27'+_0x388cbc[_0x3043c4(0xb0)]+'\x27'),_0x119c5d!==_0x27b0b4&&console[_0x3043c4(0xaf)](_0x3043c4(0xc2)+_0x119c5d),await handleSDKOutput([_0x388cbc],_0x307093),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a49_0x248271=a49_0x219e;(function(_0x25cd1e,_0x1d57d5){const _0x9a3e97=a49_0x219e,_0x445d13=_0x25cd1e();while(!![]){try{const _0xcd87f1=-parseInt(_0x9a3e97(0x13f))/0x1*(parseInt(_0x9a3e97(0x142))/0x2)+-parseInt(_0x9a3e97(0x144))/0x3+-parseInt(_0x9a3e97(0x13c))/0x4*(parseInt(_0x9a3e97(0x123))/0x5)+parseInt(_0x9a3e97(0x134))/0x6+-parseInt(_0x9a3e97(0x124))/0x7*(-parseInt(_0x9a3e97(0x132))/0x8)+parseInt(_0x9a3e97(0x11e))/0x9+parseInt(_0x9a3e97(0x120))/0xa;if(_0xcd87f1===_0x1d57d5)break;else _0x445d13['push'](_0x445d13['shift']());}catch(_0x4e295c){_0x445d13['push'](_0x445d13['shift']());}}}(a49_0x3086,0xcae4a));import{existsSync,statSync}from'fs';import a49_0x410188 from'chalk';function a49_0x219e(_0x266256,_0x326e7d){_0x266256=_0x266256-0x11d;const _0x30864f=a49_0x3086();let _0x219e3d=_0x30864f[_0x266256];return _0x219e3d;}function a49_0x3086(){const _0x38e5a9=['Examples:','length','parentId','dim','green','Folder\x20ID:\x20','Parent\x20ID:\x20','cyan','2368QIeSrs','Error:\x20Path\x20is\x20required\x0a','7855542UVErfg','segments','\x27...','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolved\x20relative\x20path\x20to:\x20','fullPath','12DimOSp','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','segmentPath','18933yMJRaA','session','data','58jqToQF','error','1353315RklfTj','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','segment','Resolving\x20path\x20\x27','Target\x20path:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','type','verbose','Site:\x20','config','Resolved\x20path\x20type:\x20','execute','parentName','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','slice','4319073kbPpjh','✔\x20Context\x20set\x20to:\x20','10450430xSarBy','red','folderId','2092455iQCGgZ','5971xiykfA','name','site','resolvePathToResource','isDirectory','log'];a49_0x3086=function(){return _0x38e5a9;};return a49_0x3086();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a49_0x248271(0x125)]='segment:use';[a49_0x248271(0x147)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a49_0x248271(0x151)](_0x998dd9){const _0x43d29d=a49_0x248271,{options:_0x1b0d03,args:_0x1f6c5b,tdx:_0x4e3718}=_0x998dd9;if(_0x1f6c5b[_0x43d29d(0x12b)]===0x0)return console[_0x43d29d(0x143)](a49_0x410188['red'](_0x43d29d(0x133))),console['error'](_0x43d29d(0x138)),console[_0x43d29d(0x143)](_0x43d29d(0x12a)),console[_0x43d29d(0x143)](_0x43d29d(0x13d)),console[_0x43d29d(0x143)](_0x43d29d(0x145)),console[_0x43d29d(0x143)](_0x43d29d(0x139)),console['error'](_0x43d29d(0x153)),0x1;const _0x5a8e6c=_0x1f6c5b[0x0],_0x49e3ca=_0x1b0d03[_0x43d29d(0x140)];try{if(_0x5a8e6c==='/')return saveSessionContext({'segment_path':undefined},_0x49e3ca),console['log'](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x14b))),0x0;if(existsSync(_0x5a8e6c)&&statSync(_0x5a8e6c)[_0x43d29d(0x128)]()){let _0x45c837;try{_0x45c837=findTdxConfig(_0x5a8e6c);}catch{return console['error'](a49_0x410188['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x5a8e6c)),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x131)](_0x43d29d(0x146))),0x1;}const _0x11c9e5=_0x45c837[_0x43d29d(0x14f)]['parent_segment'];return saveSessionContext({'segment_path':_0x11c9e5,'parent_segment':_0x11c9e5},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x11f)+a49_0x410188[_0x43d29d(0x131)](_0x11c9e5))),0x0;}const _0x41f6f4=_0x1b0d03[_0x43d29d(0x13e)];let _0x100ce7=_0x5a8e6c;const _0x4f63fe=parsePath(_0x5a8e6c);if(!_0x4f63fe['isAbsolute']){if(!_0x41f6f4)return console[_0x43d29d(0x143)](a49_0x410188['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x131)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x5a8e6c==='..'){const _0x5c364f=_0x41f6f4['split']('/')[_0x43d29d(0x11d)](0x0,-0x1)['join']('/');_0x100ce7=_0x5c364f||'/';}else _0x5a8e6c==='.'?_0x100ce7=_0x41f6f4:_0x100ce7=_0x41f6f4+'/'+_0x5a8e6c;_0x1b0d03[_0x43d29d(0x14d)]&&console[_0x43d29d(0x143)](_0x43d29d(0x13a)+_0x100ce7);}if(_0x100ce7==='/'||_0x100ce7==='')return saveSessionContext({'segment_path':undefined},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x14b))),0x0;_0x100ce7=normalizePath(_0x100ce7);const _0x1c5c39=parsePath(_0x100ce7)[_0x43d29d(0x135)];if(_0x1c5c39[_0x43d29d(0x12b)]===0x0)return saveSessionContext({'segment_path':undefined},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x14b))),0x0;_0x1b0d03['verbose']&&(console[_0x43d29d(0x143)](_0x43d29d(0x14e)+_0x1b0d03[_0x43d29d(0x126)]),console[_0x43d29d(0x143)](_0x43d29d(0x14a)+_0x100ce7));const _0x5e66da=await withSpinner(_0x43d29d(0x149)+_0x100ce7+_0x43d29d(0x136),()=>_0x4e3718[_0x43d29d(0x148)][_0x43d29d(0x127)](_0x100ce7),{'verbose':_0x1b0d03[_0x43d29d(0x14d)]}),_0x47fd00=_0x5e66da[_0x43d29d(0x141)];_0x1b0d03[_0x43d29d(0x14d)]&&(console[_0x43d29d(0x143)](_0x43d29d(0x150)+_0x47fd00[_0x43d29d(0x14c)]),console['error'](_0x43d29d(0x130)+_0x47fd00[_0x43d29d(0x12c)]),_0x47fd00[_0x43d29d(0x122)]&&console[_0x43d29d(0x143)](_0x43d29d(0x12f)+_0x47fd00[_0x43d29d(0x122)]));if(_0x47fd00[_0x43d29d(0x14c)]===_0x43d29d(0x148))return console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x121)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x43d29d(0x143)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x131)]('Use:\x20tdx\x20segment\x20use\x20'+_0x47fd00[_0x43d29d(0x152)]+(_0x47fd00['folderPath']?'/'+_0x47fd00['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x47fd00[_0x43d29d(0x13b)],'parent_segment':_0x47fd00['parentName']},_0x49e3ca),console[_0x43d29d(0x129)](a49_0x410188[_0x43d29d(0x12e)](_0x43d29d(0x11f)+a49_0x410188[_0x43d29d(0x131)](_0x47fd00[_0x43d29d(0x13b)]))),_0x1b0d03['verbose']&&(console['error'](a49_0x410188[_0x43d29d(0x12d)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x43d29d(0x143)](a49_0x410188[_0x43d29d(0x12d)](_0x43d29d(0x137)))),0x0;}catch(_0x3d5487){throw _0x3d5487;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a50_0x2d48(_0x1063c2,_0x9ad822){_0x1063c2=_0x1063c2-0x129;const _0xb2f038=a50_0xb2f0();let _0x2d4878=_0xb2f038[_0x1063c2];return _0x2d4878;}const a50_0x6f7779=a50_0x2d48;(function(_0x12c9ea,_0x5b1946){const _0x4dae40=a50_0x2d48,_0x3fc91e=_0x12c9ea();while(!![]){try{const _0x4ff1f0=-parseInt(_0x4dae40(0x134))/0x1+-parseInt(_0x4dae40(0x13d))/0x2+-parseInt(_0x4dae40(0x13f))/0x3+parseInt(_0x4dae40(0x149))/0x4+-parseInt(_0x4dae40(0x139))/0x5+parseInt(_0x4dae40(0x138))/0x6*(-parseInt(_0x4dae40(0x14a))/0x7)+parseInt(_0x4dae40(0x15b))/0x8*(parseInt(_0x4dae40(0x12a))/0x9);if(_0x4ff1f0===_0x5b1946)break;else _0x3fc91e['push'](_0x3fc91e['shift']());}catch(_0x31e7a2){_0x3fc91e['push'](_0x3fc91e['shift']());}}}(a50_0xb2f0,0x810ff));import{BaseCommand}from'./command.js';function a50_0xb2f0(){const _0x1de86e=['invalidCount','hasErrors','verbose','file','\x20file(s)\x20valid','parentSegment','type','yellow','4114248zmRzjS','):\x20','errorCode','\x20error(s)','Validation\x20failed:\x20','36eKOiGi','cwd','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','length','✔\x20All\x20','\x20warning(s)','\x20warning(s)\x20found','red','green','description','358540vEsQry','\x20valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yaml','6ocxdQW','297425tyStnF','message','errors','filePath','1922508izAzKJ','helpText','1556664JQNAup','validCount','warnings','\x20file(s)\x20with\x20errors,\x20','no_parent','valid','dim','Validate\x20segment\x20and\x20journey\x20YAML\x20files','log','.yml','1724384rMgGEn','429898PjfOPQ','targetDir','cyan','segment:validate','Error:\x20Directory\x20not\x20found:\x20','warningCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','name','error'];a50_0xb2f0=function(){return _0x1de86e;};return a50_0xb2f0();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a50_0xdb39db 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{[a50_0x6f7779(0x151)]=a50_0x6f7779(0x14d);[a50_0x6f7779(0x133)]=a50_0x6f7779(0x146);async['execute'](_0x3075af){const _0x6769c=a50_0x6f7779,{options:_0x112f72,args:_0x4583a1}=_0x3075af,_0x5dbb96=_0x112f72,_0x4ebf3b=await resolveTarget({'arg':_0x4583a1[0x0],'contextParent':_0x112f72[_0x6769c(0x158)],'cwd':process[_0x6769c(0x12b)]()});if(!isSuccessfulResolution(_0x4ebf3b))return _0x4ebf3b[_0x6769c(0x15d)]===_0x6769c(0x143)?(console[_0x6769c(0x152)](a50_0xdb39db['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x6769c(0x152)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x6769c(0x152)]('\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[_0x6769c(0x152)](_0x6769c(0x150))):(console['error'](a50_0xdb39db[_0x6769c(0x131)]('Error:\x20'+_0x4ebf3b[_0x6769c(0x13a)]+'\x0a')),_0x4ebf3b[_0x6769c(0x13e)]&&console[_0x6769c(0x152)](a50_0xdb39db[_0x6769c(0x14c)](_0x4ebf3b[_0x6769c(0x13e)]))),0x1;const _0x4af0dd=_0x4ebf3b[_0x6769c(0x14b)],_0x424c30=_0x4ebf3b[_0x6769c(0x159)]===_0x6769c(0x156)?_0x4ebf3b[_0x6769c(0x13c)]:undefined;if(!_0x424c30&&!existsSync(_0x4af0dd))return console['error'](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x14e)+_0x4af0dd+'\x0a')),0x1;let _0x3b4d06;if(_0x424c30){if(!_0x424c30['endsWith'](_0x6769c(0x148))&&!_0x424c30['endsWith'](_0x6769c(0x137)))return console[_0x6769c(0x152)](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x12c)+_0x424c30+'\x0a')),0x1;_0x3b4d06=[_0x424c30];}else _0x3b4d06=findYamlFiles(_0x4af0dd);if(_0x3b4d06['length']===0x0)return console[_0x6769c(0x152)](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x136)+_0x4af0dd+'\x0a')),0x1;const _0x10e9f6=validateYamlFiles(_0x3b4d06,_0x4af0dd),_0x4bb958=calculateSummary(_0x10e9f6);for(const _0x5b174f of _0x10e9f6){if(!isValidationResult(_0x5b174f))continue;const {relativePath:_0x37a79d,source:_0x225bb3,result:_0x10846b,fileType:_0x35c420}=_0x5b174f,_0x1c77fe=_0x35c420;if(_0x10846b['valid']&&_0x10846b[_0x6769c(0x141)][_0x6769c(0x12d)]===0x0)_0x5dbb96[_0x6769c(0x155)]&&console['log'](a50_0xdb39db[_0x6769c(0x132)]('✔\x20'+_0x37a79d)+a50_0xdb39db[_0x6769c(0x145)]('\x20('+_0x1c77fe+')'));else _0x10846b[_0x6769c(0x144)]?(console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x15a)]('⚠\x20'+_0x37a79d)+a50_0xdb39db[_0x6769c(0x145)]('\x20('+_0x1c77fe+_0x6769c(0x15c)+_0x10846b['warnings']['length']+_0x6769c(0x12f))),console[_0x6769c(0x147)](formatValidationResult(_0x10846b,_0x225bb3,_0x37a79d))):(console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x131)]('✖\x20'+_0x37a79d)+a50_0xdb39db[_0x6769c(0x145)]('\x20('+_0x1c77fe+_0x6769c(0x15c)+_0x10846b[_0x6769c(0x13b)]['length']+_0x6769c(0x15e))),console[_0x6769c(0x147)](formatValidationResult(_0x10846b,_0x225bb3,_0x37a79d)));}return console[_0x6769c(0x147)](''),_0x4bb958[_0x6769c(0x154)]?(console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x131)](_0x6769c(0x129)+_0x4bb958[_0x6769c(0x153)]+_0x6769c(0x142)+_0x4bb958[_0x6769c(0x140)]+_0x6769c(0x135))),_0x4bb958[_0x6769c(0x14f)]>0x0&&console['log'](a50_0xdb39db[_0x6769c(0x15a)](_0x4bb958[_0x6769c(0x14f)]+'\x20warning(s)\x20found')),0x1):(console['log'](a50_0xdb39db[_0x6769c(0x132)](_0x6769c(0x12e)+_0x4bb958[_0x6769c(0x140)]+_0x6769c(0x157))),_0x4bb958['warningCount']>0x0&&console[_0x6769c(0x147)](a50_0xdb39db[_0x6769c(0x15a)](_0x4bb958[_0x6769c(0x14f)]+_0x6769c(0x130))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a50_0x4991(_0x3b42a1,_0x45d4ec){_0x3b42a1=_0x3b42a1-0x68;const _0x2fd881=a50_0x2fd8();let _0x499108=_0x2fd881[_0x3b42a1];return _0x499108;}const a50_0x5d2c7f=a50_0x4991;(function(_0x92669a,_0x533f91){const _0x368a68=a50_0x4991,_0x45e081=_0x92669a();while(!![]){try{const _0xf5ec27=-parseInt(_0x368a68(0x6e))/0x1*(parseInt(_0x368a68(0xa3))/0x2)+parseInt(_0x368a68(0xb8))/0x3+parseInt(_0x368a68(0xa7))/0x4*(parseInt(_0x368a68(0xa6))/0x5)+parseInt(_0x368a68(0xbb))/0x6+parseInt(_0x368a68(0x8e))/0x7*(parseInt(_0x368a68(0x6d))/0x8)+parseInt(_0x368a68(0x84))/0x9+parseInt(_0x368a68(0xb5))/0xa*(-parseInt(_0x368a68(0x9c))/0xb);if(_0xf5ec27===_0x533f91)break;else _0x45e081['push'](_0x45e081['shift']());}catch(_0x31e1b0){_0x45e081['push'](_0x45e081['shift']());}}}(a50_0x2fd8,0x5c9de));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';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 a50_0x42b8ec from'chalk';export class SegmentsCommand extends BaseCommand{[a50_0x5d2c7f(0x8a)]=a50_0x5d2c7f(0x92);[a50_0x5d2c7f(0x70)]=a50_0x5d2c7f(0xa1);async[a50_0x5d2c7f(0x81)](_0x339078){const _0x1d280c=a50_0x5d2c7f,{options:_0x17e69a,args:_0x4ee489}=_0x339078,_0x2751f5=_0x17e69a[_0x1d280c(0x76)],_0x577bf7=_0x4ee489[0x0];try{const _0x58abc6=_0x17e69a[_0x1d280c(0x9d)];_0x17e69a[_0x1d280c(0x68)]&&(console['error']('Site:\x20'+_0x17e69a[_0x1d280c(0xb6)]),console['error'](_0x1d280c(0xbd)+(_0x58abc6||_0x1d280c(0x96))),_0x577bf7&&console[_0x1d280c(0xa2)](_0x1d280c(0x9e)+_0x577bf7),_0x2751f5&&console['error'](_0x1d280c(0xac)));if(!_0x58abc6)return console['error'](_0x1d280c(0xb1)),console['error'](''),console[_0x1d280c(0xa2)](_0x1d280c(0x85)),console[_0x1d280c(0xa2)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console['error'](_0x1d280c(0xaf)),console['error'](''),console['error']('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;if(_0x577bf7&&_0x2751f5)return await this['searchByName'](_0x339078,_0x58abc6,_0x577bf7);const _0x28623b=_0x577bf7&&(_0x577bf7['includes']('*')||_0x577bf7[_0x1d280c(0x9b)]('?'));if(_0x28623b)return await this['listWithPattern'](_0x339078,_0x58abc6,_0x577bf7);const _0x4360d1=_0x577bf7?_0x58abc6+'/'+_0x577bf7:_0x58abc6;return _0x2751f5?await this['listRecursive'](_0x339078,_0x4360d1):await this[_0x1d280c(0xb0)](_0x339078,_0x4360d1);}catch(_0xe72a08){if(_0xe72a08 instanceof SDKError)return console[_0x1d280c(0xa2)](_0x1d280c(0x71)+_0xe72a08[_0x1d280c(0x88)]),_0xe72a08[_0x1d280c(0xa5)]&&console[_0x1d280c(0xa2)](_0x1d280c(0xaa)+_0xe72a08[_0x1d280c(0xa5)]),0x1;throw _0xe72a08;}}async[a50_0x5d2c7f(0x7e)](_0x62cd3b,_0x1997bb,_0x5a39fd){const _0x3edc2a=a50_0x5d2c7f,{options:_0x4d8ffe,tdx:_0x49a142}=_0x62cd3b,_0x15625d='\x22'+_0x5a39fd+'\x22',_0x401e74=await withSpinner('Resolving\x20path\x20\x27'+_0x1997bb+_0x3edc2a(0x74),()=>_0x49a142[_0x3edc2a(0x8f)][_0x3edc2a(0xb4)](_0x1997bb),{'verbose':_0x4d8ffe[_0x3edc2a(0x68)]}),_0x40487f=_0x401e74[_0x3edc2a(0x7b)],_0x1d5682=_0x4d8ffe[_0x3edc2a(0x8c)]||0xa,_0xc493a1=await withSpinner('Searching\x20the\x20tree\x20for\x20names\x20matching\x20'+_0x15625d+_0x3edc2a(0x91),()=>_0x49a142['segment'][_0x3edc2a(0xbe)](_0x40487f['parentId'],_0x40487f['folderId'],0x0,_0x1d5682),{'verbose':_0x4d8ffe['verbose']}),_0x298145=searchTreeByName(_0xc493a1[_0x3edc2a(0x7b)],_0x5a39fd),_0x39586f=_0x2a1bc1=>getConsoleNextUrl(_0x4d8ffe[_0x3edc2a(0xb6)],_0x3edc2a(0x77)+_0x40487f[_0x3edc2a(0x8b)]+_0x3edc2a(0xa4)+_0x2a1bc1),_0x388748=[..._0x298145]['sort']((_0x3fcc07,_0xa47d87)=>_0x3fcc07[_0x3edc2a(0x7a)][_0x3edc2a(0x86)](_0xa47d87[_0x3edc2a(0x7a)])),_0x413741=0x32,_0x52c179=_0x3edc2a(0x6b)+_0x298145[_0x3edc2a(0x69)]+'\x20match'+(_0x298145['length']!==0x1?'es':'');console['error'](_0x298145[_0x3edc2a(0x69)]>_0x413741?'✔\x20'+_0x52c179+'\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'+_0x52c179);if(_0x4d8ffe[_0x3edc2a(0x9f)]===_0x3edc2a(0x83)||_0x4d8ffe['format']===_0x3edc2a(0xad)){const _0x17c2cc=_0x388748[_0x3edc2a(0x6c)](_0x343f1b=>({..._0x343f1b,..._0x343f1b[_0x3edc2a(0x97)]===_0x3edc2a(0x8f)?{'url':_0x39586f(_0x343f1b['id'])}:{}}));return await handleSDKOutput(_0x17c2cc,_0x4d8ffe),0x0;}if(_0x298145[_0x3edc2a(0x69)]===0x0)return console['log'](_0x3edc2a(0x78)+_0x15625d),0x0;for(const _0x467096 of _0x388748){console['log'](_0x467096['type'][_0x3edc2a(0xb3)](0x8)+'\x20'+_0x467096[_0x3edc2a(0x7a)]+'\x20\x20'+a50_0x42b8ec[_0x3edc2a(0xab)](_0x3edc2a(0x72)+_0x467096['id']+')'));}const _0x215bcc=_0x298145[_0x3edc2a(0x73)](_0x4dd5fc=>_0x4dd5fc[_0x3edc2a(0x97)]==='segment'),_0x4f4bb1=new Set(_0x215bcc[_0x3edc2a(0x6c)](_0x223e1c=>_0x223e1c[_0x3edc2a(0x8a)][_0x3edc2a(0x6f)]()))['size']===0x1;return _0x215bcc[_0x3edc2a(0x69)]>0x1&&_0x4f4bb1&&console[_0x3edc2a(0x79)](a50_0x42b8ec[_0x3edc2a(0xab)]('\x0a'+_0x215bcc[_0x3edc2a(0x69)]+_0x3edc2a(0x75))),0x0;}async['listWithPattern'](_0x1847b3,_0x4d498a,_0x2279f1){const _0x3c94fb=a50_0x5d2c7f,{options:_0x2bca54,tdx:_0x428f88}=_0x1847b3,_0x26ef45=await withSpinner(_0x3c94fb(0x82)+_0x4d498a+_0x3c94fb(0x74),()=>_0x428f88[_0x3c94fb(0x8f)][_0x3c94fb(0xb4)](_0x4d498a),{'verbose':_0x2bca54[_0x3c94fb(0x68)]}),_0x5670d2=_0x26ef45[_0x3c94fb(0x7b)],_0x2cd421=await withSpinner(_0x3c94fb(0xa0),()=>_0x428f88[_0x3c94fb(0x8f)][_0x3c94fb(0x90)](_0x5670d2[_0x3c94fb(0x8b)],_0x5670d2[_0x3c94fb(0x99)]),{'verbose':_0x2bca54[_0x3c94fb(0x68)]}),{folders:_0x198ce8,segments:_0x24f357,journeys:_0x228e72}=_0x2cd421[_0x3c94fb(0x7b)],_0x31357b=_0x2279f1[_0x3c94fb(0x7f)](/[.+^${}()|[\]\\]/g,_0x3c94fb(0xba))[_0x3c94fb(0x7f)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x414056=new RegExp('^'+_0x31357b+'$','i'),_0x51d8e8=_0x198ce8[_0x3c94fb(0x73)](_0x312a1b=>_0x414056['test'](_0x312a1b[_0x3c94fb(0x8a)])),_0x5afe9c=_0x24f357[_0x3c94fb(0x73)](_0xe9eb4b=>_0x414056[_0x3c94fb(0x8d)](_0xe9eb4b['name'])),_0x3e864d=_0x228e72[_0x3c94fb(0x73)](_0x2af4b9=>_0x414056[_0x3c94fb(0x8d)](_0x2af4b9['journeyBundleName'])),_0x5c97c1=_0x51d8e8['length']+_0x5afe9c['length']+_0x3e864d[_0x3c94fb(0x69)];console[_0x3c94fb(0xa2)]('✔\x20Found\x20'+_0x51d8e8['length']+_0x3c94fb(0xae)+(_0x51d8e8[_0x3c94fb(0x69)]!==0x1?'s':'')+',\x20'+_0x5afe9c[_0x3c94fb(0x69)]+_0x3c94fb(0x94)+(_0x5afe9c[_0x3c94fb(0x69)]!==0x1?'s':'')+_0x3c94fb(0xbc)+_0x3e864d[_0x3c94fb(0x69)]+_0x3c94fb(0xbf)+(_0x3e864d[_0x3c94fb(0x69)]!==0x1?'s':'')+_0x3c94fb(0x95)+_0x2279f1+'\x27');const _0x13eeb4=_0x3e6aaa=>{const _0x42370f=_0x3c94fb;return getConsoleNextUrl(_0x2bca54[_0x42370f(0xb6)],'/app/ps/'+_0x5670d2[_0x42370f(0x8b)]+_0x42370f(0xa4)+_0x3e6aaa);},_0x5ca0d5=_0x2bca54[_0x3c94fb(0x9f)]===_0x3c94fb(0x83)||_0x2bca54[_0x3c94fb(0x9f)]===_0x3c94fb(0xad);if(_0x5ca0d5){const _0x3f875b=[..._0x51d8e8[_0x3c94fb(0x6c)](_0xa3c676=>({..._0xa3c676,'type':_0x3c94fb(0x89)})),..._0x5afe9c[_0x3c94fb(0x6c)](_0x34dbed=>({..._0x34dbed,'type':'segment','url':_0x13eeb4(_0x34dbed['id'])})),..._0x3e864d['map'](_0x1b8510=>({..._0x1b8510,'name':_0x1b8510['journeyBundleName'],'type':_0x3c94fb(0xb7)}))]['sort']((_0x2b0df0,_0x538478)=>_0x2b0df0[_0x3c94fb(0x8a)][_0x3c94fb(0x86)](_0x538478[_0x3c94fb(0x8a)]));await handleSDKOutput(_0x3f875b,_0x2bca54);}else{if(_0x5c97c1===0x0)console[_0x3c94fb(0x79)](_0x3c94fb(0x80)+_0x2279f1);else{console['log'](a50_0x42b8ec['dim']('['+_0x4d498a+_0x3c94fb(0x7d)+_0x2279f1+'\x27'));const _0x3f30cb=formatFlatList(_0x51d8e8,_0x5afe9c,{'showMetadata':!![],'getSegmentUrl':_0x13eeb4},_0x3e864d);console[_0x3c94fb(0x79)](_0x3f30cb);}}return 0x0;}async[a50_0x5d2c7f(0xb0)](_0x5209e5,_0x162236){const _0x48f8a1=a50_0x5d2c7f,{options:_0x4bd1db,tdx:_0x3f1ef6}=_0x5209e5,_0x25e5c8=await withSpinner(_0x48f8a1(0xa9)+_0x162236+_0x48f8a1(0x74),()=>_0x3f1ef6['segment'][_0x48f8a1(0xb4)](_0x162236),{'verbose':_0x4bd1db[_0x48f8a1(0x68)]}),_0x18f8d9=_0x25e5c8[_0x48f8a1(0x7b)];_0x4bd1db[_0x48f8a1(0x68)]&&(console[_0x48f8a1(0xa2)](_0x48f8a1(0x98)+_0x18f8d9[_0x48f8a1(0x8b)]),_0x18f8d9['folderId']&&console[_0x48f8a1(0xa2)]('Folder\x20ID:\x20'+_0x18f8d9[_0x48f8a1(0x99)]));const _0x519936=await withSpinner(_0x48f8a1(0xa0),()=>_0x3f1ef6['segment'][_0x48f8a1(0x90)](_0x18f8d9[_0x48f8a1(0x8b)],_0x18f8d9[_0x48f8a1(0x99)]),{'verbose':_0x4bd1db[_0x48f8a1(0x68)]}),{folders:_0x59cd97,segments:_0x3bda7b,journeys:_0x36ee66}=_0x519936[_0x48f8a1(0x7b)],_0x560aaf=_0x59cd97[_0x48f8a1(0x69)]+_0x3bda7b[_0x48f8a1(0x69)]+_0x36ee66[_0x48f8a1(0x69)];console[_0x48f8a1(0xa2)](_0x48f8a1(0x9a)+_0x59cd97[_0x48f8a1(0x69)]+_0x48f8a1(0xae)+(_0x59cd97[_0x48f8a1(0x69)]!==0x1?'s':'')+',\x20'+_0x3bda7b[_0x48f8a1(0x69)]+_0x48f8a1(0x94)+(_0x3bda7b[_0x48f8a1(0x69)]!==0x1?'s':'')+_0x48f8a1(0xbc)+_0x36ee66['length']+_0x48f8a1(0xbf)+(_0x36ee66[_0x48f8a1(0x69)]!==0x1?'s':''));const _0x128cbf=_0x327d0c=>{const _0x3f14d5=_0x48f8a1;return getConsoleNextUrl(_0x4bd1db[_0x3f14d5(0xb6)],_0x3f14d5(0x77)+_0x18f8d9[_0x3f14d5(0x8b)]+'/e/'+_0x327d0c);},_0xf4a499=_0x1e55a4=>{const _0x1f158e=_0x48f8a1;return getConsoleNextUrl(_0x4bd1db[_0x1f158e(0xb6)],_0x1f158e(0x77)+_0x18f8d9[_0x1f158e(0x8b)]+'/e/'+_0x1e55a4+_0x1f158e(0xb9));},_0x3b87ae=_0x4bd1db[_0x48f8a1(0x9f)]===_0x48f8a1(0x83)||_0x4bd1db[_0x48f8a1(0x9f)]===_0x48f8a1(0xad);if(_0x3b87ae){const _0x84f234=[..._0x59cd97[_0x48f8a1(0x6c)](_0x4a2394=>({..._0x4a2394,'type':_0x48f8a1(0x89)})),..._0x3bda7b['map'](_0xeed100=>({..._0xeed100,'type':_0x48f8a1(0x8f),'url':_0x128cbf(_0xeed100['id'])})),..._0x36ee66[_0x48f8a1(0x6c)](_0x598ca4=>({..._0x598ca4,'name':_0x598ca4[_0x48f8a1(0xb2)],'type':_0x48f8a1(0xb7),'url':_0xf4a499(_0x598ca4['id'])}))]['sort']((_0x3ceb0d,_0x42c1b5)=>_0x3ceb0d[_0x48f8a1(0x8a)][_0x48f8a1(0x86)](_0x42c1b5[_0x48f8a1(0x8a)]));await handleSDKOutput(_0x84f234,_0x4bd1db);}else{if(_0x560aaf===0x0)console['log'](a50_0x42b8ec[_0x48f8a1(0xab)]('['+_0x162236+']')),console[_0x48f8a1(0x79)](_0x48f8a1(0x7c));else{console[_0x48f8a1(0x79)](a50_0x42b8ec['dim']('['+_0x162236+']'));const _0x5ad6dc=formatFlatList(_0x59cd97,_0x3bda7b,{'showMetadata':!![],'getSegmentUrl':_0x128cbf,'getJourneyUrl':_0xf4a499},_0x36ee66);console['log'](_0x5ad6dc);}}return 0x0;}async[a50_0x5d2c7f(0xbe)](_0x529a38,_0x4bf849){const _0x2ca186=a50_0x5d2c7f,{options:_0x5bf1bd,tdx:_0x4f0d74}=_0x529a38,_0x4f2aa3=await withSpinner(_0x2ca186(0xa9)+_0x4bf849+'\x27...',()=>_0x4f0d74[_0x2ca186(0x8f)][_0x2ca186(0xb4)](_0x4bf849),{'verbose':_0x5bf1bd['verbose']}),_0x2ba023=_0x4f2aa3[_0x2ca186(0x7b)];_0x5bf1bd[_0x2ca186(0x68)]&&(console[_0x2ca186(0xa2)](_0x2ca186(0x98)+_0x2ba023['parentId']),_0x2ba023[_0x2ca186(0x99)]&&console['error']('Folder\x20ID:\x20'+_0x2ba023['folderId']));const _0x499c91=_0x5bf1bd[_0x2ca186(0x8c)]||0xa,_0x2796ee=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x4f0d74[_0x2ca186(0x8f)][_0x2ca186(0xbe)](_0x2ba023[_0x2ca186(0x8b)],_0x2ba023['folderId'],0x0,_0x499c91),{'verbose':_0x5bf1bd['verbose']}),_0x190d53=_0x2796ee['data'],_0x3e9801=_0x557012=>{const _0x5ee365=_0x2ca186;let _0x5c4ca7=0x0,_0x49b824=0x0,_0x87ac3c=0x0;for(const _0x48fd80 of _0x557012){if(_0x48fd80[_0x5ee365(0x97)]===_0x5ee365(0x89))_0x5c4ca7++;else{if(_0x48fd80['type']==='segment')_0x49b824++;else{if(_0x48fd80[_0x5ee365(0x97)]===_0x5ee365(0xb7))_0x87ac3c++;}}if(_0x48fd80[_0x5ee365(0x87)]){const _0x3b5d58=_0x3e9801(_0x48fd80[_0x5ee365(0x87)]);_0x5c4ca7+=_0x3b5d58[_0x5ee365(0x93)],_0x49b824+=_0x3b5d58['segments'],_0x87ac3c+=_0x3b5d58['journeys'];}}return{'folders':_0x5c4ca7,'segments':_0x49b824,'journeys':_0x87ac3c};},_0x128c49=_0x3e9801(_0x190d53);console[_0x2ca186(0xa2)](_0x2ca186(0xa8)+_0x128c49['folders']+_0x2ca186(0xae)+(_0x128c49[_0x2ca186(0x93)]!==0x1?'s':'')+',\x20'+_0x128c49[_0x2ca186(0x92)]+'\x20segment'+(_0x128c49[_0x2ca186(0x92)]!==0x1?'s':'')+_0x2ca186(0xbc)+_0x128c49[_0x2ca186(0x6a)]+_0x2ca186(0xbf)+(_0x128c49['journeys']!==0x1?'s':''));const _0x102b9c=_0x3d413f=>{const _0x1218b7=_0x2ca186;return getConsoleNextUrl(_0x5bf1bd[_0x1218b7(0xb6)],_0x1218b7(0x77)+_0x2ba023[_0x1218b7(0x8b)]+'/e/'+_0x3d413f);},_0x44399b=_0x52e072=>{const _0x1b160f=_0x2ca186;return getConsoleNextUrl(_0x5bf1bd[_0x1b160f(0xb6)],_0x1b160f(0x77)+_0x2ba023[_0x1b160f(0x8b)]+_0x1b160f(0xa4)+_0x52e072+'/j/da');};if(_0x5bf1bd[_0x2ca186(0x9f)]===_0x2ca186(0x83)||_0x5bf1bd[_0x2ca186(0x9f)]===_0x2ca186(0xad))await handleSDKOutput(_0x190d53,_0x5bf1bd);else{console[_0x2ca186(0x79)](a50_0x42b8ec[_0x2ca186(0xab)]('['+_0x4bf849+']'));const _0x260bee=formatTree(_0x190d53,{'showMetadata':!![],'getSegmentUrl':_0x102b9c,'getJourneyUrl':_0x44399b});console[_0x2ca186(0x79)](_0x260bee);}return 0x0;}}function a50_0x2fd8(){const _0x80ae1a=['2ZBRtEA','/e/','cause','5YgKWmN','927804HlPjMS','✔\x20Built\x20tree\x20with\x20','Resolving\x20path\x20\x27','\x20\x20Cause:\x20','dim','Recursive\x20mode:\x20enabled','jsonl','\x20folder','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','listUnified','Error:\x20No\x20parent\x20segment\x20context\x20set.','journeyBundleName','padEnd','resolvePathToResource','1340wVAIuI','site','journey','1314465ARyxFb','/j/da','\x5c$&','2700450poQPMH',',\x20and\x20','Parent\x20segment\x20context:\x20','listRecursive','\x20journey','verbose','length','journeys','Found\x20','map','460936zWHjHb','568677BDPbMe','toLowerCase','description','Error:\x20','(id\x20','filter','\x27...','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','recursive','/app/ps/','No\x20folders\x20or\x20segments\x20match\x20','log','path','data','(empty)',']\x20matching\x20\x27','searchByName','replace','No\x20items\x20match\x20pattern:\x20','execute','Resolving\x20parent\x20segment\x20\x27','json','2007207bGoECb','Set\x20a\x20parent\x20segment\x20context\x20first:','localeCompare','children','message','folder','name','parentId','maxDepth','test','7PkjVmh','segment','listUnifiedWithJourneys','...','segments','folders','\x20segment','\x20matching\x20\x27','(not\x20set)','type','Parent\x20ID:\x20','folderId','✔\x20Found\x20','includes','37169QSdzyT','parentSegment','Folder/pattern\x20arg:\x20','format','Listing\x20folders,\x20segments,\x20and\x20journeys...','List\x20folders\x20and\x20child\x20segments','error'];a50_0x2fd8=function(){return _0x80ae1a;};return a50_0x2fd8();}
|
|
1
|
+
const a51_0x59499d=a51_0x12c3;(function(_0x171c06,_0x423e2f){const _0x19d281=a51_0x12c3,_0x9f20e3=_0x171c06();while(!![]){try{const _0x3d7ff1=parseInt(_0x19d281(0x1c7))/0x1+parseInt(_0x19d281(0x1f2))/0x2*(-parseInt(_0x19d281(0x1c9))/0x3)+-parseInt(_0x19d281(0x1eb))/0x4*(-parseInt(_0x19d281(0x1d1))/0x5)+-parseInt(_0x19d281(0x1ba))/0x6*(-parseInt(_0x19d281(0x1bc))/0x7)+-parseInt(_0x19d281(0x1ef))/0x8+-parseInt(_0x19d281(0x1ff))/0x9+parseInt(_0x19d281(0x1bb))/0xa*(parseInt(_0x19d281(0x1c8))/0xb);if(_0x3d7ff1===_0x423e2f)break;else _0x9f20e3['push'](_0x9f20e3['shift']());}catch(_0x2fb4ab){_0x9f20e3['push'](_0x9f20e3['shift']());}}}(a51_0x2416,0xf0b8d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a51_0x12c3(_0x3fc61b,_0x498f46){_0x3fc61b=_0x3fc61b-0x1a9;const _0x241608=a51_0x2416();let _0x12c305=_0x241608[_0x3fc61b];return _0x12c305;}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 a51_0x3f6433 from'chalk';function a51_0x2416(){const _0x291e41=['folderId','Site:\x20','\x20folder','1295079LqHkTu','2343869veSIWb','5090937zzkKrl','dim','localeCompare','map','padEnd','journeyBundleName','Parent\x20ID:\x20','sort','5XLxRym','description',',\x20and\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x27...','path','listUnifiedWithJourneys','error','segments','message','folders','...','format','Set\x20a\x20parent\x20segment\x20context\x20first:','site','size','Found\x20','toLowerCase','searchByName','parentId','verbose','Building\x20hierarchy\x20tree...','Folder\x20ID:\x20','includes','folder','(empty)','1703816vvjCpQ','\x20segment','parentSegment','name','11530848RXKPCm','/e/','maxDepth','2tkpwFL','Error:\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','listWithPattern','cause','No\x20items\x20match\x20pattern:\x20','✔\x20Found\x20','execute','No\x20folders\x20or\x20segments\x20match\x20','Resolving\x20parent\x20segment\x20\x27','\x5c$&','replace','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','17712981GsdxYs','/app/ps/','Parent\x20segment\x20context:\x20','length','test','(id\x20','Resolving\x20path\x20\x27','List\x20folders\x20and\x20child\x20segments','filter','recursive','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','(not\x20set)','resolvePathToResource','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','segment','/j/da','listRecursive','journeys','data','Error:\x20No\x20parent\x20segment\x20context\x20set.','Recursive\x20mode:\x20enabled','1110BcUoUX','170DwUNmS','28343lejfYa','json','journey','log','\x20journey','type','jsonl','✔\x20Built\x20tree\x20with\x20'];a51_0x2416=function(){return _0x291e41;};return a51_0x2416();}export class SegmentsCommand extends BaseCommand{[a51_0x59499d(0x1ee)]='segments';[a51_0x59499d(0x1d2)]=a51_0x59499d(0x1ac);async[a51_0x59499d(0x1f9)](_0x95fb75){const _0x4398b8=a51_0x59499d,{options:_0x5b25cb,args:_0x33f015}=_0x95fb75,_0x2920ed=_0x5b25cb[_0x4398b8(0x1ae)],_0x4b99ef=_0x33f015[0x0];try{const _0x3bd16d=_0x5b25cb[_0x4398b8(0x1ed)];_0x5b25cb[_0x4398b8(0x1e5)]&&(console[_0x4398b8(0x1d8)](_0x4398b8(0x1c5)+_0x5b25cb['site']),console['error'](_0x4398b8(0x201)+(_0x3bd16d||_0x4398b8(0x1b0))),_0x4b99ef&&console[_0x4398b8(0x1d8)]('Folder/pattern\x20arg:\x20'+_0x4b99ef),_0x2920ed&&console[_0x4398b8(0x1d8)](_0x4398b8(0x1b9)));if(!_0x3bd16d)return console[_0x4398b8(0x1d8)](_0x4398b8(0x1b8)),console[_0x4398b8(0x1d8)](''),console['error'](_0x4398b8(0x1de)),console[_0x4398b8(0x1d8)](_0x4398b8(0x1fe)),console[_0x4398b8(0x1d8)](_0x4398b8(0x1f4)),console['error'](''),console['error'](_0x4398b8(0x1af)),0x1;if(_0x4b99ef&&_0x2920ed)return await this[_0x4398b8(0x1e3)](_0x95fb75,_0x3bd16d,_0x4b99ef);const _0x303221=_0x4b99ef&&(_0x4b99ef['includes']('*')||_0x4b99ef[_0x4398b8(0x1e8)]('?'));if(_0x303221)return await this[_0x4398b8(0x1f5)](_0x95fb75,_0x3bd16d,_0x4b99ef);const _0x5226f7=_0x4b99ef?_0x3bd16d+'/'+_0x4b99ef:_0x3bd16d;return _0x2920ed?await this[_0x4398b8(0x1b5)](_0x95fb75,_0x5226f7):await this['listUnified'](_0x95fb75,_0x5226f7);}catch(_0x749070){if(_0x749070 instanceof SDKError)return console[_0x4398b8(0x1d8)](_0x4398b8(0x1f3)+_0x749070[_0x4398b8(0x1da)]),_0x749070[_0x4398b8(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x749070['cause']),0x1;throw _0x749070;}}async[a51_0x59499d(0x1e3)](_0x47679e,_0x293a8c,_0x1c94be){const _0x54e7da=a51_0x59499d,{options:_0x5d371f,tdx:_0xec1188}=_0x47679e,_0x1b3dc4='\x22'+_0x1c94be+'\x22',_0x160f7c=await withSpinner(_0x54e7da(0x1ab)+_0x293a8c+_0x54e7da(0x1d5),()=>_0xec1188[_0x54e7da(0x1b3)][_0x54e7da(0x1b1)](_0x293a8c),{'verbose':_0x5d371f[_0x54e7da(0x1e5)]}),_0x3cee0f=_0x160f7c[_0x54e7da(0x1b7)],_0x50c01c=_0x5d371f[_0x54e7da(0x1f1)]||0xa,_0x16b738=await withSpinner('Searching\x20the\x20tree\x20for\x20names\x20matching\x20'+_0x1b3dc4+_0x54e7da(0x1dc),()=>_0xec1188[_0x54e7da(0x1b3)][_0x54e7da(0x1b5)](_0x3cee0f[_0x54e7da(0x1e4)],_0x3cee0f[_0x54e7da(0x1c4)],0x0,_0x50c01c),{'verbose':_0x5d371f[_0x54e7da(0x1e5)]}),_0x37443c=searchTreeByName(_0x16b738['data'],_0x1c94be),_0x499d73=_0x70fd0d=>getConsoleNextUrl(_0x5d371f[_0x54e7da(0x1df)],_0x54e7da(0x200)+_0x3cee0f[_0x54e7da(0x1e4)]+'/e/'+_0x70fd0d),_0x39df00=[..._0x37443c][_0x54e7da(0x1d0)]((_0x2d16e6,_0xd14bd0)=>_0x2d16e6[_0x54e7da(0x1d6)]['localeCompare'](_0xd14bd0[_0x54e7da(0x1d6)])),_0x4a01ab=0x32,_0x5571bd=_0x54e7da(0x1e1)+_0x37443c[_0x54e7da(0x202)]+'\x20match'+(_0x37443c[_0x54e7da(0x202)]!==0x1?'es':'');console[_0x54e7da(0x1d8)](_0x37443c[_0x54e7da(0x202)]>_0x4a01ab?'✔\x20'+_0x5571bd+'\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'+_0x5571bd);if(_0x5d371f['format']===_0x54e7da(0x1bd)||_0x5d371f[_0x54e7da(0x1dd)]===_0x54e7da(0x1c2)){const _0x31ca90=_0x39df00[_0x54e7da(0x1cc)](_0x157151=>({..._0x157151,..._0x157151[_0x54e7da(0x1c1)]===_0x54e7da(0x1b3)?{'url':_0x499d73(_0x157151['id'])}:{}}));return await handleSDKOutput(_0x31ca90,_0x5d371f),0x0;}if(_0x37443c[_0x54e7da(0x202)]===0x0)return console[_0x54e7da(0x1bf)](_0x54e7da(0x1fa)+_0x1b3dc4),0x0;for(const _0x128144 of _0x39df00){console[_0x54e7da(0x1bf)](_0x128144[_0x54e7da(0x1c1)][_0x54e7da(0x1cd)](0x8)+'\x20'+_0x128144[_0x54e7da(0x1d6)]+'\x20\x20'+a51_0x3f6433[_0x54e7da(0x1ca)](_0x54e7da(0x1aa)+_0x128144['id']+')'));}const _0x562126=_0x37443c[_0x54e7da(0x1ad)](_0x34a684=>_0x34a684[_0x54e7da(0x1c1)]==='segment'),_0x4601c7=new Set(_0x562126['map'](_0x3b126c=>_0x3b126c['name'][_0x54e7da(0x1e2)]()))[_0x54e7da(0x1e0)]===0x1;return _0x562126[_0x54e7da(0x202)]>0x1&&_0x4601c7&&console[_0x54e7da(0x1bf)](a51_0x3f6433[_0x54e7da(0x1ca)]('\x0a'+_0x562126[_0x54e7da(0x202)]+_0x54e7da(0x1b2))),0x0;}async['listWithPattern'](_0x338203,_0x527879,_0x564157){const _0x7d81f2=a51_0x59499d,{options:_0x4587c1,tdx:_0x142601}=_0x338203,_0x5e2920=await withSpinner(_0x7d81f2(0x1fb)+_0x527879+_0x7d81f2(0x1d5),()=>_0x142601['segment'][_0x7d81f2(0x1b1)](_0x527879),{'verbose':_0x4587c1[_0x7d81f2(0x1e5)]}),_0x1150e5=_0x5e2920[_0x7d81f2(0x1b7)],_0x456483=await withSpinner(_0x7d81f2(0x1d4),()=>_0x142601['segment']['listUnifiedWithJourneys'](_0x1150e5[_0x7d81f2(0x1e4)],_0x1150e5[_0x7d81f2(0x1c4)]),{'verbose':_0x4587c1[_0x7d81f2(0x1e5)]}),{folders:_0x2f86d6,segments:_0x2c0833,journeys:_0x1237d4}=_0x456483['data'],_0x49e97a=_0x564157['replace'](/[.+^${}()|[\]\\]/g,_0x7d81f2(0x1fc))[_0x7d81f2(0x1fd)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x282191=new RegExp('^'+_0x49e97a+'$','i'),_0x2598d4=_0x2f86d6[_0x7d81f2(0x1ad)](_0x3592ad=>_0x282191[_0x7d81f2(0x1a9)](_0x3592ad[_0x7d81f2(0x1ee)])),_0x55a7f2=_0x2c0833['filter'](_0x490ee9=>_0x282191[_0x7d81f2(0x1a9)](_0x490ee9[_0x7d81f2(0x1ee)])),_0x5aaac7=_0x1237d4[_0x7d81f2(0x1ad)](_0xe69285=>_0x282191[_0x7d81f2(0x1a9)](_0xe69285['journeyBundleName'])),_0x300bbd=_0x2598d4[_0x7d81f2(0x202)]+_0x55a7f2[_0x7d81f2(0x202)]+_0x5aaac7['length'];console[_0x7d81f2(0x1d8)](_0x7d81f2(0x1f8)+_0x2598d4[_0x7d81f2(0x202)]+_0x7d81f2(0x1c6)+(_0x2598d4[_0x7d81f2(0x202)]!==0x1?'s':'')+',\x20'+_0x55a7f2['length']+_0x7d81f2(0x1ec)+(_0x55a7f2['length']!==0x1?'s':'')+',\x20and\x20'+_0x5aaac7[_0x7d81f2(0x202)]+'\x20journey'+(_0x5aaac7[_0x7d81f2(0x202)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x564157+'\x27');const _0x1f870c=_0x4a2dbd=>{const _0x10727a=_0x7d81f2;return getConsoleNextUrl(_0x4587c1[_0x10727a(0x1df)],_0x10727a(0x200)+_0x1150e5['parentId']+_0x10727a(0x1f0)+_0x4a2dbd);},_0x3c8b39=_0x4587c1[_0x7d81f2(0x1dd)]==='json'||_0x4587c1[_0x7d81f2(0x1dd)]===_0x7d81f2(0x1c2);if(_0x3c8b39){const _0x5c2c89=[..._0x2598d4['map'](_0x2e45d4=>({..._0x2e45d4,'type':_0x7d81f2(0x1e9)})),..._0x55a7f2[_0x7d81f2(0x1cc)](_0x478d06=>({..._0x478d06,'type':_0x7d81f2(0x1b3),'url':_0x1f870c(_0x478d06['id'])})),..._0x5aaac7[_0x7d81f2(0x1cc)](_0x1bf08e=>({..._0x1bf08e,'name':_0x1bf08e[_0x7d81f2(0x1ce)],'type':_0x7d81f2(0x1be)}))][_0x7d81f2(0x1d0)]((_0xb99323,_0x4c8f08)=>_0xb99323['name'][_0x7d81f2(0x1cb)](_0x4c8f08[_0x7d81f2(0x1ee)]));await handleSDKOutput(_0x5c2c89,_0x4587c1);}else{if(_0x300bbd===0x0)console[_0x7d81f2(0x1bf)](_0x7d81f2(0x1f7)+_0x564157);else{console[_0x7d81f2(0x1bf)](a51_0x3f6433['dim']('['+_0x527879+']\x20matching\x20\x27'+_0x564157+'\x27'));const _0x3ee043=formatFlatList(_0x2598d4,_0x55a7f2,{'showMetadata':!![],'getSegmentUrl':_0x1f870c},_0x5aaac7);console[_0x7d81f2(0x1bf)](_0x3ee043);}}return 0x0;}async['listUnified'](_0x16f835,_0x35f80c){const _0x2708b2=a51_0x59499d,{options:_0x3f5b40,tdx:_0x53e578}=_0x16f835,_0x3cb9f1=await withSpinner(_0x2708b2(0x1ab)+_0x35f80c+'\x27...',()=>_0x53e578[_0x2708b2(0x1b3)][_0x2708b2(0x1b1)](_0x35f80c),{'verbose':_0x3f5b40[_0x2708b2(0x1e5)]}),_0x4b8e60=_0x3cb9f1[_0x2708b2(0x1b7)];_0x3f5b40[_0x2708b2(0x1e5)]&&(console[_0x2708b2(0x1d8)](_0x2708b2(0x1cf)+_0x4b8e60[_0x2708b2(0x1e4)]),_0x4b8e60[_0x2708b2(0x1c4)]&&console['error'](_0x2708b2(0x1e7)+_0x4b8e60['folderId']));const _0x3521fe=await withSpinner(_0x2708b2(0x1d4),()=>_0x53e578[_0x2708b2(0x1b3)][_0x2708b2(0x1d7)](_0x4b8e60[_0x2708b2(0x1e4)],_0x4b8e60['folderId']),{'verbose':_0x3f5b40[_0x2708b2(0x1e5)]}),{folders:_0x426393,segments:_0x5a1de9,journeys:_0x4c4cb4}=_0x3521fe[_0x2708b2(0x1b7)],_0x286617=_0x426393[_0x2708b2(0x202)]+_0x5a1de9[_0x2708b2(0x202)]+_0x4c4cb4[_0x2708b2(0x202)];console[_0x2708b2(0x1d8)](_0x2708b2(0x1f8)+_0x426393[_0x2708b2(0x202)]+'\x20folder'+(_0x426393[_0x2708b2(0x202)]!==0x1?'s':'')+',\x20'+_0x5a1de9['length']+_0x2708b2(0x1ec)+(_0x5a1de9[_0x2708b2(0x202)]!==0x1?'s':'')+_0x2708b2(0x1d3)+_0x4c4cb4[_0x2708b2(0x202)]+_0x2708b2(0x1c0)+(_0x4c4cb4['length']!==0x1?'s':''));const _0x44550c=_0x542d2f=>{const _0xe50c20=_0x2708b2;return getConsoleNextUrl(_0x3f5b40[_0xe50c20(0x1df)],_0xe50c20(0x200)+_0x4b8e60[_0xe50c20(0x1e4)]+_0xe50c20(0x1f0)+_0x542d2f);},_0x1a6eef=_0x313e97=>{const _0x30a5e0=_0x2708b2;return getConsoleNextUrl(_0x3f5b40[_0x30a5e0(0x1df)],_0x30a5e0(0x200)+_0x4b8e60[_0x30a5e0(0x1e4)]+'/e/'+_0x313e97+_0x30a5e0(0x1b4));},_0x350d6e=_0x3f5b40[_0x2708b2(0x1dd)]===_0x2708b2(0x1bd)||_0x3f5b40['format']===_0x2708b2(0x1c2);if(_0x350d6e){const _0x19fa65=[..._0x426393[_0x2708b2(0x1cc)](_0xb23dea=>({..._0xb23dea,'type':_0x2708b2(0x1e9)})),..._0x5a1de9[_0x2708b2(0x1cc)](_0x5bbb03=>({..._0x5bbb03,'type':_0x2708b2(0x1b3),'url':_0x44550c(_0x5bbb03['id'])})),..._0x4c4cb4[_0x2708b2(0x1cc)](_0x3f5e73=>({..._0x3f5e73,'name':_0x3f5e73['journeyBundleName'],'type':_0x2708b2(0x1be),'url':_0x1a6eef(_0x3f5e73['id'])}))][_0x2708b2(0x1d0)]((_0x47b3a6,_0x2cf8f9)=>_0x47b3a6['name'][_0x2708b2(0x1cb)](_0x2cf8f9[_0x2708b2(0x1ee)]));await handleSDKOutput(_0x19fa65,_0x3f5b40);}else{if(_0x286617===0x0)console[_0x2708b2(0x1bf)](a51_0x3f6433[_0x2708b2(0x1ca)]('['+_0x35f80c+']')),console[_0x2708b2(0x1bf)](_0x2708b2(0x1ea));else{console[_0x2708b2(0x1bf)](a51_0x3f6433[_0x2708b2(0x1ca)]('['+_0x35f80c+']'));const _0xb9f60c=formatFlatList(_0x426393,_0x5a1de9,{'showMetadata':!![],'getSegmentUrl':_0x44550c,'getJourneyUrl':_0x1a6eef},_0x4c4cb4);console[_0x2708b2(0x1bf)](_0xb9f60c);}}return 0x0;}async[a51_0x59499d(0x1b5)](_0x2d4066,_0x55be95){const _0x5cdcb7=a51_0x59499d,{options:_0x219cb8,tdx:_0x485b88}=_0x2d4066,_0x1dfb9a=await withSpinner(_0x5cdcb7(0x1ab)+_0x55be95+_0x5cdcb7(0x1d5),()=>_0x485b88[_0x5cdcb7(0x1b3)][_0x5cdcb7(0x1b1)](_0x55be95),{'verbose':_0x219cb8[_0x5cdcb7(0x1e5)]}),_0x139c7b=_0x1dfb9a[_0x5cdcb7(0x1b7)];_0x219cb8[_0x5cdcb7(0x1e5)]&&(console[_0x5cdcb7(0x1d8)]('Parent\x20ID:\x20'+_0x139c7b['parentId']),_0x139c7b[_0x5cdcb7(0x1c4)]&&console[_0x5cdcb7(0x1d8)](_0x5cdcb7(0x1e7)+_0x139c7b['folderId']));const _0xe70307=_0x219cb8[_0x5cdcb7(0x1f1)]||0xa,_0x344aee=await withSpinner(_0x5cdcb7(0x1e6),()=>_0x485b88[_0x5cdcb7(0x1b3)]['listRecursive'](_0x139c7b[_0x5cdcb7(0x1e4)],_0x139c7b[_0x5cdcb7(0x1c4)],0x0,_0xe70307),{'verbose':_0x219cb8[_0x5cdcb7(0x1e5)]}),_0x50b547=_0x344aee['data'],_0x593f97=_0x3ab504=>{const _0x2827b4=_0x5cdcb7;let _0x40ff79=0x0,_0x554f2e=0x0,_0x1a94ad=0x0;for(const _0x2ce3da of _0x3ab504){if(_0x2ce3da[_0x2827b4(0x1c1)]===_0x2827b4(0x1e9))_0x40ff79++;else{if(_0x2ce3da[_0x2827b4(0x1c1)]===_0x2827b4(0x1b3))_0x554f2e++;else{if(_0x2ce3da[_0x2827b4(0x1c1)]===_0x2827b4(0x1be))_0x1a94ad++;}}if(_0x2ce3da['children']){const _0x4d70af=_0x593f97(_0x2ce3da['children']);_0x40ff79+=_0x4d70af[_0x2827b4(0x1db)],_0x554f2e+=_0x4d70af[_0x2827b4(0x1d9)],_0x1a94ad+=_0x4d70af[_0x2827b4(0x1b6)];}}return{'folders':_0x40ff79,'segments':_0x554f2e,'journeys':_0x1a94ad};},_0x33c5dc=_0x593f97(_0x50b547);console[_0x5cdcb7(0x1d8)](_0x5cdcb7(0x1c3)+_0x33c5dc[_0x5cdcb7(0x1db)]+_0x5cdcb7(0x1c6)+(_0x33c5dc[_0x5cdcb7(0x1db)]!==0x1?'s':'')+',\x20'+_0x33c5dc[_0x5cdcb7(0x1d9)]+_0x5cdcb7(0x1ec)+(_0x33c5dc[_0x5cdcb7(0x1d9)]!==0x1?'s':'')+_0x5cdcb7(0x1d3)+_0x33c5dc[_0x5cdcb7(0x1b6)]+_0x5cdcb7(0x1c0)+(_0x33c5dc[_0x5cdcb7(0x1b6)]!==0x1?'s':''));const _0x1e208e=_0x1e9e29=>{const _0x39191a=_0x5cdcb7;return getConsoleNextUrl(_0x219cb8['site'],_0x39191a(0x200)+_0x139c7b['parentId']+'/e/'+_0x1e9e29);},_0x1354e5=_0x55193=>{const _0xfa8dd5=_0x5cdcb7;return getConsoleNextUrl(_0x219cb8['site'],_0xfa8dd5(0x200)+_0x139c7b[_0xfa8dd5(0x1e4)]+_0xfa8dd5(0x1f0)+_0x55193+_0xfa8dd5(0x1b4));};if(_0x219cb8[_0x5cdcb7(0x1dd)]===_0x5cdcb7(0x1bd)||_0x219cb8[_0x5cdcb7(0x1dd)]===_0x5cdcb7(0x1c2))await handleSDKOutput(_0x50b547,_0x219cb8);else{console[_0x5cdcb7(0x1bf)](a51_0x3f6433['dim']('['+_0x55be95+']'));const _0x5a7b60=formatTree(_0x50b547,{'showMetadata':!![],'getSegmentUrl':_0x1e208e,'getJourneyUrl':_0x1354e5});console['log'](_0x5a7b60);}return 0x0;}}
|