@treasuredata/tdx 2026.8.4 → 2026.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +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/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.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/p13n-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.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.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.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/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x54d687=a43_0x1329;(function(_0x39a8aa,_0x4ec00c){const _0x35b26a=a43_0x1329,_0x78e120=_0x39a8aa();while(!![]){try{const _0x548066=parseInt(_0x35b26a(0x1fa))/0x1*(-parseInt(_0x35b26a(0x1f8))/0x2)+-parseInt(_0x35b26a(0x200))/0x3+-parseInt(_0x35b26a(0x1ee))/0x4+parseInt(_0x35b26a(0x1fb))/0x5*(-parseInt(_0x35b26a(0x1eb))/0x6)+-parseInt(_0x35b26a(0x1e6))/0x7*(parseInt(_0x35b26a(0x1ea))/0x8)+parseInt(_0x35b26a(0x201))/0x9+-parseInt(_0x35b26a(0x1f2))/0xa*(-parseInt(_0x35b26a(0x202))/0xb);if(_0x548066===_0x4ec00c)break;else _0x78e120['push'](_0x78e120['shift']());}catch(_0x3de69e){_0x78e120['push'](_0x78e120['shift']());}}}(a43_0x6479,0x7a928));function a43_0x6479(){const _0x37bdac=['18ZLVzqV','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','80294MyUTgm','125YDVkPc','length','json','✔\x20Found\x20','\x20field','61050MzbCUC','5396571IPqWhw','831809GCpEPp','data','parentSegment','2840495GQSOhh','\x27...','site','Parent\x20segment:\x20','16iQTnUN','148110qmzvDz','segment','name','1382720sFqwOH','List\x20available\x20fields\x20for\x20segmentation','error','jsonl','320cTXcHk','description','Listing\x20fields\x20for\x20\x27','verbose','execute','listFields'];a43_0x6479=function(){return _0x37bdac;};return a43_0x6479();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a43_0x1329(_0x102e5a,_0x24eb12){_0x102e5a=_0x102e5a-0x1e5;const _0x6479b7=a43_0x6479();let _0x1329ea=_0x6479b7[_0x102e5a];return _0x1329ea;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a43_0x54d687(0x1ed)]='segment:fields';[a43_0x54d687(0x1f3)]=a43_0x54d687(0x1ef);async[a43_0x54d687(0x1f6)](_0x485ba2){const _0x2d3dc4=a43_0x54d687,{options:_0x137aac,args:_0x371226,tdx:_0x3a963a}=_0x485ba2,_0x1784a7=_0x371226[0x0]||_0x137aac[_0x2d3dc4(0x1e5)];if(!_0x1784a7)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x2d3dc4(0x1f0)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console['error'](_0x2d3dc4(0x1f9)),0x1;_0x137aac[_0x2d3dc4(0x1f5)]&&(console[_0x2d3dc4(0x1f0)]('Site:\x20'+_0x137aac[_0x2d3dc4(0x1e8)]),console[_0x2d3dc4(0x1f0)](_0x2d3dc4(0x1e9)+_0x1784a7));const _0x5707b3=await withSpinner(_0x2d3dc4(0x1f4)+_0x1784a7+_0x2d3dc4(0x1e7),()=>_0x3a963a[_0x2d3dc4(0x1ec)][_0x2d3dc4(0x1f7)](_0x1784a7),{'verbose':_0x137aac['verbose']}),_0x14a5d8=_0x5707b3[_0x2d3dc4(0x203)];console[_0x2d3dc4(0x1f0)](_0x2d3dc4(0x1fe)+_0x14a5d8[_0x2d3dc4(0x1fc)]+_0x2d3dc4(0x1ff)+(_0x14a5d8[_0x2d3dc4(0x1fc)]!==0x1?'s':''));if(_0x137aac[_0x2d3dc4(0x1fd)]||_0x137aac[_0x2d3dc4(0x1f1)])return await handleSDKOutput(_0x14a5d8,_0x137aac),0x0;return displayFieldsHumanReadable(_0x14a5d8,_0x1784a7),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x2f23ad=a44_0xa668;(function(_0x402531,_0x38ffbe){const _0x4b5c02=a44_0xa668,_0x29e8d8=_0x402531();while(!![]){try{const _0x1954be=parseInt(_0x4b5c02(0x11d))/0x1+parseInt(_0x4b5c02(0x13d))/0x2+-parseInt(_0x4b5c02(0x138))/0x3*(-parseInt(_0x4b5c02(0x14d))/0x4)+-parseInt(_0x4b5c02(0x168))/0x5*(parseInt(_0x4b5c02(0x13f))/0x6)+parseInt(_0x4b5c02(0x131))/0x7*(-parseInt(_0x4b5c02(0x14c))/0x8)+parseInt(_0x4b5c02(0x127))/0x9*(-parseInt(_0x4b5c02(0x167))/0xa)+-parseInt(_0x4b5c02(0x121))/0xb;if(_0x1954be===_0x38ffbe)break;else _0x29e8d8['push'](_0x29e8d8['shift']());}catch(_0x12f86c){_0x29e8d8['push'](_0x29e8d8['shift']());}}}(a44_0x57e0,0x87728));import{BaseCommand}from'./command.js';function a44_0x57e0(){const _0x587e20=['push','Segments:\x20','\x20\x20(id\x20','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','507013VNnHCh','Examples:','code','forEach','1688467YuNqwf','resolvePathToResource','name','Moving','moveSegments','dryRun','948177mOSMvm','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','red','\x27\x20matches\x20','error','SEGMENT_NOT_FOUND','Error:\x20\x27','filter','verbose','for\x20move\x20to','4113774CJHHtF','explainAmbiguousName','segment:move','execute','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','preserved:','✔\x20Moved\x20segment\x20\x27','519621FHhdby','type','description','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','\x27,\x20\x27','2146690PxvzPt','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','696HZMTqU','segment','parentSegment','\x27\x20—\x20','Searching\x20the\x20tree...','[dry-run]\x20No\x20changes\x20made.\x20','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','\x20\x20•\x20','Searching\x20folders\x20for\x20\x27','cyan','test','get','join','8aPPmaQ','20CgJIgo','data','\x27...','length','path','\x27\x20to\x20folder\x20\x27','slot','Checking','\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:','toLowerCase','Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','Duplicate\x20segments\x20removed\x20(','map','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','ruleConditionCount','set','listRecursive','yellow','includes','has','Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','\x20folder\x20\x27','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','folder','20YdzzVn','40505JxdBsR','rule\x20'];a44_0x57e0=function(){return _0x587e20;};return a44_0x57e0();}import{handleSDKOutput}from'../core/command-output.js';function a44_0xa668(_0x44daee,_0x41cfd2){_0x44daee=_0x44daee-0x11b;const _0x57e0dc=a44_0x57e0();let _0xa668b1=_0x57e0dc[_0x44daee];return _0xa668b1;}import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a44_0xb23bc7 from'chalk';export class SegmentMoveCommand extends BaseCommand{['name']=a44_0x2f23ad(0x133);[a44_0x2f23ad(0x13a)]=a44_0x2f23ad(0x157);async[a44_0x2f23ad(0x134)](_0x261ac1){const _0x9def15=a44_0x2f23ad,{options:_0x409ad0,args:_0x1002a2,tdx:_0x3e5706}=_0x261ac1,_0x5be704=_0x1002a2,_0x51b905=_0x409ad0[_0x9def15(0x166)];if(_0x5be704[_0x9def15(0x150)]===0x0||!_0x51b905)return console[_0x9def15(0x12b)](a44_0xb23bc7[_0x9def15(0x129)](_0x9def15(0x15b))),console['error'](_0x9def15(0x158)),console['error'](_0x9def15(0x11e)),console[_0x9def15(0x12b)](_0x9def15(0x13b)),console[_0x9def15(0x12b)]('\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501'),console[_0x9def15(0x12b)]('\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)'),console[_0x9def15(0x12b)](_0x9def15(0x128)),0x1;_0x409ad0['verbose']&&(console[_0x9def15(0x12b)](_0x9def15(0x16b)+_0x5be704[_0x9def15(0x14b)](',\x20')),console['error']('Target\x20folder:\x20'+_0x51b905));const _0x22c059=[...new Set(_0x5be704)];_0x22c059[_0x9def15(0x150)]<_0x5be704[_0x9def15(0x150)]&&console[_0x9def15(0x12b)](a44_0xb23bc7[_0x9def15(0x15f)](_0x9def15(0x159)+_0x5be704[_0x9def15(0x150)]+'\x20→\x20'+_0x22c059[_0x9def15(0x150)]+').'));const _0x558bc3=/^\d+$/,_0x34117a=_0x409ad0[_0x9def15(0x141)],_0x2a36b5=[..._0x22c059,_0x51b905]['some'](_0x64a357=>!_0x558bc3[_0x9def15(0x149)](_0x64a357));if(_0x2a36b5&&!_0x34117a)return console['error'](a44_0xb23bc7[_0x9def15(0x129)](_0x9def15(0x162))),console[_0x9def15(0x12b)](_0x9def15(0x165)),console[_0x9def15(0x12b)](_0x9def15(0x163)),console[_0x9def15(0x12b)](_0x9def15(0x145)),0x1;const _0x2126e1=_0x22c059['length'],_0x46410a=_0x409ad0[_0x9def15(0x126)]===!![];let _0x2bc8b3;try{const _0x177f51=await withSpinner((_0x46410a?_0x9def15(0x154):_0x9def15(0x124))+'\x20'+_0x2126e1+'\x20segment'+(_0x2126e1===0x1?'':'s')+'\x20'+((_0x46410a?_0x9def15(0x130):'to')+_0x9def15(0x164)+_0x51b905+_0x9def15(0x14f)),async()=>{const _0x302f10=_0x9def15,_0x296b26=[];_0x22c059['forEach']((_0x1d06a4,_0x24fd3c)=>{const _0x4621c8=a44_0xa668;if(!_0x558bc3[_0x4621c8(0x149)](_0x1d06a4))_0x296b26['push']({'name':_0x1d06a4,'expectType':_0x4621c8(0x140),'slot':_0x24fd3c});});if(!_0x558bc3[_0x302f10(0x149)](_0x51b905))_0x296b26[_0x302f10(0x16a)]({'name':_0x51b905,'expectType':_0x302f10(0x166),'slot':-0x1});const _0x1e4cb4=new Map();if(_0x296b26[_0x302f10(0x150)]>0x0){const _0xf93a08=await _0x3e5706[_0x302f10(0x140)]['resolveEntitiesInParent'](_0x34117a,_0x296b26['map'](({name:_0x4ed256,expectType:_0x174df1})=>({'name':_0x4ed256,'expectType':_0x174df1})));_0xf93a08[_0x302f10(0x120)]((_0x9e0ee0,_0x150651)=>_0x1e4cb4[_0x302f10(0x15d)](_0x296b26[_0x150651][_0x302f10(0x153)],_0x9e0ee0['id']));}const _0x5bac54=_0x22c059[_0x302f10(0x15a)]((_0x26f7e3,_0x2a55b1)=>_0x558bc3[_0x302f10(0x149)](_0x26f7e3)?_0x26f7e3:_0x1e4cb4[_0x302f10(0x14a)](_0x2a55b1)),_0x212bc1=_0x558bc3[_0x302f10(0x149)](_0x51b905)?_0x51b905:_0x1e4cb4['get'](-0x1);return _0x3e5706['segment'][_0x302f10(0x125)](_0x5bac54,_0x212bc1,_0x46410a);},{'verbose':_0x409ad0[_0x9def15(0x12f)]});_0x2bc8b3=_0x177f51[_0x9def15(0x14e)];}catch(_0x3e20ad){if(_0x3e20ad instanceof SDKError&&_0x3e20ad[_0x9def15(0x11f)]===ErrorCode[_0x9def15(0x12c)]&&_0x34117a)try{if(await this[_0x9def15(0x132)](_0x3e5706,_0x34117a,_0x22c059,_0x409ad0))return 0x1;}catch{}throw _0x3e20ad;}for(const _0x24036e of _0x2bc8b3){const _0x1f994b=_0x24036e[_0x9def15(0x15c)],_0x144f78=_0x9def15(0x169)+(_0x46410a?_0x9def15(0x161):_0x9def15(0x136))+'\x20'+_0x1f994b+'\x20condition'+(_0x1f994b===0x1?'':'s');console['error'](_0x46410a?a44_0xb23bc7[_0x9def15(0x148)]('•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27'+_0x24036e['id']+_0x9def15(0x152)+_0x24036e['segmentFolderId']+'\x27\x20—\x20'+_0x144f78):a44_0xb23bc7['green'](_0x9def15(0x137)+_0x24036e['id']+_0x9def15(0x152)+_0x24036e['segmentFolderId']+_0x9def15(0x142)+_0x144f78+'\x20(verified\x20by\x20re-read)'));}if(_0x46410a)console[_0x9def15(0x12b)](a44_0xb23bc7[_0x9def15(0x148)](_0x9def15(0x144)+_0x2126e1+'\x20segment(s)\x20would\x20be\x20moved.'));else _0x2bc8b3[_0x9def15(0x150)]>0x1&&console[_0x9def15(0x12b)](a44_0xb23bc7['green']('✔\x20'+_0x2bc8b3[_0x9def15(0x150)]+_0x9def15(0x11c)));return await handleSDKOutput(_0x2bc8b3,_0x409ad0),0x0;}async[a44_0x2f23ad(0x132)](_0x49fc87,_0x2d72b9,_0x832b48,_0x3205dc){const _0x429874=a44_0x2f23ad,_0x34b0df=_0x832b48[_0x429874(0x12e)](_0x12899c=>!/^\d+$/[_0x429874(0x149)](_0x12899c)&&!_0x12899c[_0x429874(0x160)]('/'));if(_0x34b0df[_0x429874(0x150)]===0x0)return![];const _0x4188a8=await withSpinner(_0x429874(0x147)+_0x34b0df['join'](_0x429874(0x13c))+_0x429874(0x14f),()=>_0x49fc87['segment'][_0x429874(0x122)](_0x2d72b9),{'verbose':_0x3205dc[_0x429874(0x12f)]}),_0x57dedc=(await withSpinner(_0x429874(0x143),()=>_0x49fc87[_0x429874(0x140)][_0x429874(0x15e)](_0x4188a8[_0x429874(0x14e)]['parentId'],_0x4188a8[_0x429874(0x14e)]['folderId'],0x0,0xa),{'verbose':_0x3205dc[_0x429874(0x12f)]}))[_0x429874(0x14e)];let _0x236cde=![];for(const _0x2029e0 of _0x34b0df){const _0x89ac00=searchTreeByName(_0x57dedc,_0x2029e0)['filter'](_0x73a0cb=>_0x73a0cb[_0x429874(0x139)]==='segment'&&_0x73a0cb[_0x429874(0x123)][_0x429874(0x156)]()===_0x2029e0[_0x429874(0x156)]());if(_0x89ac00[_0x429874(0x150)]>0x1){_0x236cde=!![],console[_0x429874(0x12b)](a44_0xb23bc7[_0x429874(0x129)](_0x429874(0x12d)+_0x2029e0+_0x429874(0x12a)+_0x89ac00[_0x429874(0x150)]+_0x429874(0x155)));for(const _0x17d0d6 of _0x89ac00)console['error'](_0x429874(0x146)+_0x17d0d6[_0x429874(0x151)]+_0x429874(0x11b)+_0x17d0d6['id']+')');}else _0x89ac00[_0x429874(0x150)]===0x1&&(_0x236cde=!![],console[_0x429874(0x12b)](a44_0xb23bc7['red'](_0x429874(0x12d)+_0x2029e0+_0x429874(0x13e))),console[_0x429874(0x12b)]('\x20\x20'+_0x89ac00[0x0]['path']+'\x20\x20(id\x20'+_0x89ac00[0x0]['id']+')'),console['error'](_0x429874(0x135)));}return _0x236cde;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a45_0x29d8(){const _0x315d95=['filter','verbose','✔\x20Pulled\x20','\x20segments','journeyVersions','6869046PJgEku','\x0aPull\x20summary\x20for\x20\x27','repeat','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','yes','isNew','yellow','✔\x20All\x20files\x20are\x20up\x20to\x20date','counts','\x20journeys','7ixCLEJ','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','execute','\x20=\x20','type','579681xqtgeh','3094440zhRSqD','session','setPhase','helpText','activations','-\x20no\x20files\x20written','\x20\x20Target:\x20','460ZAKHrG','parent_segment','parentSegment','25595htndSE','content','green','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)','targetDir','489918MPZvDM','segment:pull','Write\x20','cwd','relativePath','Parent\x20segment:\x20','Site:\x20','Pulling\x20segments\x20from\x20\x27','\x20files?','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Aborted.','Error:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeys','\x20versions)','pullSegments','segment','error','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x0aError:','dirname','\x20files\x20to\x20','2877136GphXyJ','\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','✔\x20Context\x20set:\x20','1138943SlqMwt','\x20activations','dim','\x20unchanged\x20files','\x27...','parentName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','no_parent','cyan','utf-8','\x20new\x20files','resourceName','Target\x20resource:\x20','site','files','description','length','red','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','hasChanges'];a45_0x29d8=function(){return _0x315d95;};return a45_0x29d8();}const a45_0x87d82e=a45_0x4e7d;(function(_0x78c051,_0xe5164f){const _0x2cb992=a45_0x4e7d,_0x5b5142=_0x78c051();while(!![]){try{const _0x559851=parseInt(_0x2cb992(0xad))/0x1+parseInt(_0x2cb992(0xe6))/0x2+-parseInt(_0x2cb992(0xd7))/0x3+-parseInt(_0x2cb992(0xde))/0x4*(parseInt(_0x2cb992(0xe1))/0x5)+parseInt(_0x2cb992(0xc6))/0x6+parseInt(_0x2cb992(0xd0))/0x7*(-parseInt(_0x2cb992(0xa8))/0x8)+parseInt(_0x2cb992(0xd6))/0x9;if(_0x559851===_0xe5164f)break;else _0x5b5142['push'](_0x5b5142['shift']());}catch(_0x4db527){_0x5b5142['push'](_0x5b5142['shift']());}}}(a45_0x29d8,0x95be1));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 a45_0x3d20a2 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a45_0x274e14 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a45_0x4e7d(_0x1ddf6b,_0x5ad0c3){_0x1ddf6b=_0x1ddf6b-0xa3;const _0x29d8a4=a45_0x29d8();let _0x4e7d45=_0x29d8a4[_0x1ddf6b];return _0x4e7d45;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a45_0x87d82e(0xe7);[a45_0x87d82e(0xbc)]=a45_0x87d82e(0xef);async[a45_0x87d82e(0xd3)](_0x3e5a7f){const _0x1e2afe=a45_0x87d82e,{options:_0x8c53fe,args:_0x1e71ad,tdx:_0x366a37}=_0x3e5a7f,_0x43deba=_0x8c53fe,_0x1229e7=await resolveTarget({'arg':_0x1e71ad[0x0],'contextParent':_0x8c53fe[_0x1e2afe(0xe0)],'cwd':process[_0x1e2afe(0xe9)]()});if(!isSuccessfulResolution(_0x1229e7))return _0x1229e7['errorCode']===_0x1e2afe(0xb4)?(console['error'](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xb3))),console[_0x1e2afe(0xa3)](_0x1e2afe(0xe4)),console[_0x1e2afe(0xa3)](_0x1e2afe(0xd2)),console['error'](_0x1e2afe(0xa9))):(console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xbe)](_0x1e2afe(0xf1)+_0x1229e7[_0x1e2afe(0xd1)]+'\x0a')),_0x1229e7[_0x1e2afe(0xda)]&&console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xb5)](_0x1229e7[_0x1e2afe(0xda)]))),0x1;const _0x2f86eb=_0x1229e7[_0x1e2afe(0xb2)],_0x51a357=_0x1229e7[_0x1e2afe(0xe5)],_0x1be603=_0x1229e7[_0x1e2afe(0xd5)]==='file'?_0x1229e7[_0x1e2afe(0xb8)]:undefined;_0x43deba[_0x1e2afe(0xc2)]&&(console[_0x1e2afe(0xa3)](_0x1e2afe(0xec)+_0x43deba[_0x1e2afe(0xba)]),console['error'](_0x1e2afe(0xeb)+_0x2f86eb),_0x1be603&&console[_0x1e2afe(0xa3)](_0x1e2afe(0xb9)+_0x1be603));const _0x28d45e=await withProgressSpinner(_0x1e2afe(0xed)+_0x2f86eb+_0x1e2afe(0xb1),_0x21b057=>_0x366a37[_0x1e2afe(0xf6)][_0x1e2afe(0xf5)](_0x2f86eb,{'targetDir':_0x51a357,'targetResourceName':_0x1be603,'verbose':_0x43deba['verbose'],'progress':{'update':_0x54a110=>{const _0x5b0653=_0x1e2afe;_0x21b057[_0x5b0653(0xd9)](_0x54a110),_0x43deba[_0x5b0653(0xc2)]&&console[_0x5b0653(0xa3)]('\x20\x20'+_0x54a110);}}}),{'verbose':_0x43deba[_0x1e2afe(0xc2)]}),_0x3906bb=_0x28d45e[_0x1e2afe(0xab)];if(_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xaa)]===0x0&&_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xf3)]===0x0)return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xa4)+_0x3906bb[_0x1e2afe(0xb2)]+'\x27')),0x0;const _0x450e43=_0x3906bb[_0x1e2afe(0xbb)][_0x1e2afe(0xc1)](_0xaf1dc6=>_0xaf1dc6[_0x1e2afe(0xcb)]),_0x3738a9=_0x3906bb[_0x1e2afe(0xbb)][_0x1e2afe(0xc1)](_0x37a3f6=>!_0x37a3f6[_0x1e2afe(0xcb)]&&_0x37a3f6[_0x1e2afe(0xc0)]),_0x3b606f=_0x3906bb[_0x1e2afe(0xbb)]['filter'](_0x41544a=>!_0x41544a[_0x1e2afe(0xcb)]&&!_0x41544a[_0x1e2afe(0xc0)]);console[_0x1e2afe(0xa3)](_0x1e2afe(0xc7)+_0x3906bb[_0x1e2afe(0xb2)]+'\x27:'),console['error']('\x20\x20🎯\x20'+a45_0x3d20a2[_0x1e2afe(0xb5)](_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xaa)]+_0x1e2afe(0xc4))+'\x20with\x20'+a45_0x3d20a2['cyan'](_0x3906bb[_0x1e2afe(0xce)][_0x1e2afe(0xdb)]+_0x1e2afe(0xae)));if(_0x3906bb[_0x1e2afe(0xce)]['journeys']>0x0){const _0x43a58c=_0x3906bb[_0x1e2afe(0xce)]['journeyVersions']>_0x3906bb[_0x1e2afe(0xce)]['journeys']?'\x20('+_0x3906bb['counts'][_0x1e2afe(0xc5)]+_0x1e2afe(0xf4):'';console[_0x1e2afe(0xa3)]('\x20\x20🗺️\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xb5)](_0x3906bb['counts'][_0x1e2afe(0xf3)]+_0x1e2afe(0xcf))+a45_0x3d20a2[_0x1e2afe(0xaf)](_0x43a58c));}console[_0x1e2afe(0xa3)]('\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xe3)]('+\x20'+_0x450e43[_0x1e2afe(0xbd)]+_0x1e2afe(0xb7))),console[_0x1e2afe(0xa3)]('\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xcc)]('~\x20'+_0x3738a9['length']+'\x20changed\x20files')),console['error']('\x20\x20'+a45_0x3d20a2[_0x1e2afe(0xaf)]('=\x20'+_0x3b606f[_0x1e2afe(0xbd)]+_0x1e2afe(0xb0))),console['error'](_0x1e2afe(0xdd)+a45_0x3d20a2['cyan'](_0x3906bb[_0x1e2afe(0xe5)])+'\x0a');if(_0x3738a9[_0x1e2afe(0xbd)]>0x0)for(const _0x2ac6c8 of _0x3738a9){console['error']('\x0aChanges\x20to\x20\x27'+_0x2ac6c8[_0x1e2afe(0xea)]+'\x27:'),console[_0x1e2afe(0xa3)]('─'[_0x1e2afe(0xc8)](0x3c)),console[_0x1e2afe(0xa3)](_0x2ac6c8['diff']),console['error']('─'[_0x1e2afe(0xc8)](0x3c));}if(_0x43deba['dryRun'])return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xc9))),0x0;if(_0x450e43['length']===0x0&&_0x3738a9[_0x1e2afe(0xbd)]===0x0)return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xe3)](_0x1e2afe(0xcd))),saveSessionContext({'parent_segment':_0x3906bb[_0x1e2afe(0xb2)]},_0x43deba['session']),console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xe3)]('✔\x20Context\x20set:\x20'+a45_0x3d20a2[_0x1e2afe(0xaf)](_0x1e2afe(0xdf))+_0x1e2afe(0xd4)+a45_0x3d20a2['cyan'](_0x3906bb[_0x1e2afe(0xb2)]))),0x0;if(!_0x43deba[_0x1e2afe(0xca)]){if(!isInteractive())return console[_0x1e2afe(0xa3)](a45_0x3d20a2['red'](_0x1e2afe(0xa5)),_0x1e2afe(0xbf)),console[_0x1e2afe(0xa3)](a45_0x3d20a2['dim'](_0x1e2afe(0xf2))),0x1;const _0x534003=await confirmKey(_0x1e2afe(0xe8)+(_0x450e43[_0x1e2afe(0xbd)]+_0x3738a9[_0x1e2afe(0xbd)])+_0x1e2afe(0xee));if(!_0x534003)return console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xcc)](_0x1e2afe(0xf0)),_0x1e2afe(0xdc)),0x1;}for(const _0x3aa0ac of _0x3906bb[_0x1e2afe(0xbb)]){if(_0x3aa0ac['isNew']||_0x3aa0ac[_0x1e2afe(0xc0)]){const _0x1d6d8a=a45_0x274e14[_0x1e2afe(0xa6)](_0x3aa0ac['absolutePath']);!existsSync(_0x1d6d8a)&&mkdirSync(_0x1d6d8a,{'recursive':!![]}),writeFileSync(_0x3aa0ac['absolutePath'],_0x3aa0ac[_0x1e2afe(0xe2)],_0x1e2afe(0xb6));}}return console[_0x1e2afe(0xa3)](a45_0x3d20a2['green'](_0x1e2afe(0xc3)+(_0x450e43[_0x1e2afe(0xbd)]+_0x3738a9[_0x1e2afe(0xbd)])+_0x1e2afe(0xa7)+_0x3906bb[_0x1e2afe(0xe5)])),saveSessionContext({'parent_segment':_0x3906bb['parentName']},_0x43deba[_0x1e2afe(0xd8)]),console[_0x1e2afe(0xa3)](a45_0x3d20a2[_0x1e2afe(0xe3)](_0x1e2afe(0xac)+a45_0x3d20a2['dim'](_0x1e2afe(0xdf))+'\x20=\x20'+a45_0x3d20a2['cyan'](_0x3906bb['parentName']))),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
|
+
function a46_0x29e8(){const _0x23e207=['\x20deleted','/e/','\x0aPush\x20summary\x20for\x20\x27','endsWith','2131003IzRFQF','\x0aValidation\x20failed:','isScoped','9qZGcNM','\x20\x20Journeys:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','data','126358alBZLA','/app/ps/','toUpdate','repeat','set','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','(Journey\x20will\x20be\x20deleted)','2645zxoVBL','paused','\x20\x20Activations:','Push\x20','created','segments','📁\x20','length','\x20\x20🗺️\x20\x20Journeys:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','updatedAt','\x20\x20📊\x20Segments:','listActivations','parent_name','getParent','\x20YAML\x20files\x20found','Parent\x20segment:\x20','then','delete','.yml','\x20changes?','Delete\x20journey:','isNew','map','journeyBundleName','\x20\x20\x20\x20','\x20folders\x20to\x20create','2617948AQlUpY','3083475wVEEag','message','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','helpText','Source\x20directory:\x20','toString','\x20new','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0a✔\x20Push\x20complete','Resolving\x20parent\x20segment\x20\x27','blue','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','New\x20segment:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getJourney','toDelete','Error\x20parsing\x20YAML:\x20','attributes','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','/sb/da/esr','journeysOnly','filter','\x20to\x20create','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','filePath','journeyId','activations','Site:\x20','get','connection','Error:\x20','dim','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)','targetDir','4596jYWrLC','/j/da/je','19851980tfRnQm','buildUserMaps','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','type','\x20updated','diff','\x0aError:','Changes\x20to:','audienceId','execute','parentSegment','\x20to\x20delete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','createdSegmentIds','createdAt','cwd','changed','updated','verbose','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20unchanged','cyan','Error:\x20Directory\x20not\x20found:\x20','new','existingJourney','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segment','nameToId','\x20activations]','folderId','journeyBundleId','yamlConfig','\x20\x20Segments:\x20','push','all','error','description','folderPath','\x20\x20Source:\x20','\x20changed','segment\x20or\x20journey','\x27...','add','8bzhdRE','No\x20','errorCode','name','deleted','listFolders','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','Preparing\x20journeys...','\x20created','Fetching\x20connections\x20for\x20name\x20resolution...','idToName','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Activations:\x20','file','4214624eunFUC','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','folders','user','Delete\x20segment:','unchanged','toCreate','yellow','state','nameToType','join','existingSegment','listSegments','segment:push'];a46_0x29e8=function(){return _0x23e207;};return a46_0x29e8();}const a46_0x14b204=a46_0x4550;(function(_0x1ec031,_0x44ae34){const _0xa615e=a46_0x4550,_0x591a5f=_0x1ec031();while(!![]){try{const _0x3243e4=parseInt(_0xa615e(0x142))/0x1*(-parseInt(_0xa615e(0x1b8))/0x2)+-parseInt(_0xa615e(0x167))/0x3+parseInt(_0xa615e(0x166))/0x4+parseInt(_0xa615e(0x14b))/0x5*(parseInt(_0xa615e(0x189))/0x6)+-parseInt(_0xa615e(0x13a))/0x7+parseInt(_0xa615e(0x128))/0x8*(-parseInt(_0xa615e(0x13d))/0x9)+parseInt(_0xa615e(0x18b))/0xa;if(_0x3243e4===_0x44ae34)break;else _0x591a5f['push'](_0x591a5f['shift']());}catch(_0x1431f3){_0x591a5f['push'](_0x591a5f['shift']());}}}(a46_0x29e8,0xa61c1));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_0x1ac0c9 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 a46_0x4550(_0x197296,_0x40f9e6){_0x197296=_0x197296-0x11f;const _0x29e8e5=a46_0x29e8();let _0x455026=_0x29e8e5[_0x197296];return _0x455026;}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{[a46_0x14b204(0x1bb)]=a46_0x14b204(0x135);[a46_0x14b204(0x1b1)]='Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments';async[a46_0x14b204(0x195)](_0x22f8a){const _0x5a3fb2=a46_0x14b204,{options:_0x5dd04c,args:_0x423322,tdx:_0x41e6f5}=_0x22f8a,_0x362331=_0x5dd04c,_0x4a1dc6=await resolveTarget({'arg':_0x423322[0x0],'contextParent':_0x5dd04c[_0x5a3fb2(0x196)],'cwd':process[_0x5a3fb2(0x19b)]()});if(!isSuccessfulResolution(_0x4a1dc6))return _0x4a1dc6[_0x5a3fb2(0x1ba)]==='no_parent'?(console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x18e))),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x187)),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x1a0)),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x154))):(console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x185)+_0x4a1dc6[_0x5a3fb2(0x168)]+'\x0a')),_0x4a1dc6['helpText']&&console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x4a1dc6[_0x5a3fb2(0x16a)]))),0x1;if(_0x4a1dc6['type']===_0x5a3fb2(0x158))return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x1a3)+_0x4a1dc6[_0x5a3fb2(0x188)]+'\x0a')),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['cyan'](_0x5a3fb2(0x11f))),0x1;const _0x2f94b0=_0x4a1dc6['parentName'],_0x340a60=_0x4a1dc6[_0x5a3fb2(0x188)],_0xabea65=_0x4a1dc6[_0x5a3fb2(0x18f)]===_0x5a3fb2(0x127)?_0x4a1dc6[_0x5a3fb2(0x17f)]:undefined,_0x4081eb=getScopedDetails(_0x4a1dc6),_0x5a7abe=_0x4081eb?.[_0x5a3fb2(0x13c)]??![],_0x3e1f63=_0x4081eb?.['scopedFolderPath']??'';if(!existsSync(_0x340a60))return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x1a3)+_0x340a60+'\x0a')),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x5a3fb2(0x11f))),0x1;_0x362331[_0x5a3fb2(0x19e)]&&(console['error'](_0x5a3fb2(0x182)+_0x362331[_0x5a3fb2(0x120)]),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x15b)+_0x2f94b0),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x16b)+_0x340a60),_0x5a7abe&&console[_0x5a3fb2(0x1b0)]('Scoped\x20to\x20folder:\x20'+_0x3e1f63));const _0x2c3de7=await withSpinner(_0x5a3fb2(0x170)+_0x2f94b0+_0x5a3fb2(0x1b6),()=>_0x41e6f5[_0x5a3fb2(0x1a7)]['resolveParentId'](_0x2f94b0),{'verbose':_0x362331[_0x5a3fb2(0x19e)]}),_0xeb7332=_0x2c3de7[_0x5a3fb2(0x141)],{parentSegmentResult:_0x1cd77c,segmentsResult:_0x4ba467,foldersResult:_0x1f61f0,journeysWithDetailsResult:_0x560516,userMaps:_0x50df22}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x5b2f74=_0x5a3fb2,[_0x278f81,_0x3cfd81,_0x5672b7,_0x2533ab,_0x1a37d0]=await Promise[_0x5b2f74(0x1af)]([_0x41e6f5[_0x5b2f74(0x1a7)][_0x5b2f74(0x159)](_0xeb7332),_0x41e6f5[_0x5b2f74(0x1a7)][_0x5b2f74(0x134)](_0xeb7332),_0x41e6f5['segment'][_0x5b2f74(0x1bd)](_0xeb7332),_0x41e6f5[_0x5b2f74(0x147)]['listJourneysWithDetailsFromParentSegment'](_0xeb7332,{'includeAllVersions':!![]}),_0x41e6f5[_0x5b2f74(0x12b)][_0x5b2f74(0x18c)]()]);return{'parentSegmentResult':_0x278f81,'segmentsResult':_0x3cfd81,'foldersResult':_0x5672b7,'journeysWithDetailsResult':_0x2533ab,'userMaps':_0x1a37d0};},{'verbose':_0x362331[_0x5a3fb2(0x19e)]})[_0x5a3fb2(0x15c)](_0x19e983=>_0x19e983[_0x5a3fb2(0x141)]),_0x435f1f=_0x1cd77c,_0x1a3478=extractRootFolderId(_0x435f1f),_0x22542a=_0x4ba467,_0x5c37d7=_0x1f61f0,{journeys:_0x3863dd,activationStepsById:_0x154e05}=_0x560516,_0x3f74fc=new Map(_0x3863dd['map'](_0x321b3c=>[_0x321b3c['id'],_0x321b3c])),_0x220c8a=_0x3863dd[_0x5a3fb2(0x162)](_0x1d7716=>({'id':_0x1d7716['id'],'name':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x1bb)],'journeyBundleName':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x163)]||'','journeyBundleId':_0x1d7716['attributes'][_0x5a3fb2(0x1ab)]||'','versionNumber':_0x1d7716[_0x5a3fb2(0x178)]['versionNumber'],'description':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x1b1)],'state':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x130)],'paused':_0x1d7716['attributes'][_0x5a3fb2(0x14c)],'audienceId':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x194)],'folderId':_0x1d7716['relationships']?.['parentFolder']?.[_0x5a3fb2(0x141)]?.['id'],'createdAt':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x19a)],'updatedAt':_0x1d7716[_0x5a3fb2(0x178)][_0x5a3fb2(0x155)]})),{emailToId:_0x49998c,idToEmail:_0xce539d}=_0x50df22,_0x4b8126=await withSpinner(_0x5a3fb2(0x123),async()=>{const _0x2f768b=_0x5a3fb2,_0x4b97a1=await _0x41e6f5[_0x2f768b(0x184)]['list']();return buildConnectionMaps(_0x4b97a1);},{'verbose':_0x362331[_0x5a3fb2(0x19e)]})[_0x5a3fb2(0x15c)](_0x51c7aa=>_0x51c7aa[_0x5a3fb2(0x141)]),_0x139638=_0x4b8126[_0x5a3fb2(0x1a8)],_0x45f2f3=_0x4b8126[_0x5a3fb2(0x124)],_0x590122=_0x4b8126[_0x5a3fb2(0x131)],_0x487595={'emailToIdMap':_0x49998c,'connectionNameToIdMap':_0x139638,'connectionNameToTypeMap':_0x590122,'getSchema':_0x5a14e0=>_0x41e6f5[_0x5a3fb2(0x184)]['getOutputSchemaWithCache'](_0x5a14e0),'getMetadata':_0x3b02ea=>_0x41e6f5[_0x5a3fb2(0x184)]['getMetadataWithCache'](_0x3b02ea)};let {pathToId:_0x7bf0e8,idToPath:_0x1e89e3}=buildFolderMaps(_0x5c37d7);const _0x18e3fb=buildSegmentLookupMap(_0x22542a,_0x1e89e3),_0x58e3b8=buildSegmentNameToIdMap(_0x22542a),_0x18ff6e=buildJourneyBundleLookupMap(_0x220c8a,_0x1e89e3);let _0x5d0c8b;if(_0xabea65){if(!_0xabea65[_0x5a3fb2(0x139)](_0x5a3fb2(0x15e))&&!_0xabea65[_0x5a3fb2(0x139)]('.yaml'))return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x198)+_0xabea65+'\x0a')),0x1;_0x5d0c8b=[_0xabea65];}else _0x5d0c8b=findYamlFiles(_0x340a60);if(_0x5d0c8b[_0x5a3fb2(0x152)]===0x0)return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x148)+_0x340a60+'\x0a')),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x5a3fb2(0x16e))),0x1;let _0xc42d49,_0x176059;try{const _0x44debb=parseAndClassifyYamlFiles(_0x5d0c8b,_0x340a60,{'skipSegments':_0x362331[_0x5a3fb2(0x17b)]});_0xc42d49=_0x44debb['segments'],_0x176059=_0x44debb[_0x5a3fb2(0x19f)];const _0x25145b=validateParsedFiles(_0x44debb,_0x340a60);if(_0x25145b[_0x5a3fb2(0x152)]>0x0)return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x13b))),console[_0x5a3fb2(0x1b0)](formatValidationErrors(_0x25145b)),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x172))),0x1;}catch(_0xc592bc){return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x177)+(_0xc592bc instanceof Error?_0xc592bc[_0x5a3fb2(0x168)]:_0xc592bc))),0x1;}if(_0xc42d49[_0x5a3fb2(0x152)]===0x0&&_0x176059[_0x5a3fb2(0x152)]===0x0){const _0x39a2cb=_0x362331[_0x5a3fb2(0x17b)]?'journey':_0x5a3fb2(0x1b5);return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['yellow'](_0x5a3fb2(0x1b9)+_0x39a2cb+_0x5a3fb2(0x15a))),0x0;}const _0x45ac52=new Map();_0x22542a[_0x5a3fb2(0x152)]>0x0&&!_0x362331['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x22542a,async _0x452de8=>{const _0x4750bf=a46_0x4550,_0x8cf56c=await _0x41e6f5[_0x4750bf(0x1a7)][_0x4750bf(0x157)](_0xeb7332,_0x452de8['id']);_0x45ac52[_0x4750bf(0x146)](_0x452de8['id'],_0x8cf56c);});},{'verbose':_0x362331[_0x5a3fb2(0x19e)]});const {segmentFiles:_0x4aa83c,foldersToCreate:_0x1d2ae4}=await prepareSegmentFiles(_0xc42d49,{'segmentByFolderAndName':_0x18e3fb,'activationsBySegmentId':_0x45ac52,'folderPathToId':_0x7bf0e8,'idToEmailMap':_0xce539d,'connectionIdToNameMap':_0x45f2f3},_0x487595,_0x5a7abe,_0x3e1f63),_0x4d3926=_0xabea65?[]:findSegmentsToDelete(_0x22542a,_0xc42d49['map'](({yamlConfig:_0x2314ca,folderPath:_0x143957})=>({'yamlConfig':_0x2314ca,'folderPath':resolveTDFolderPath(_0x143957,_0x5a7abe,_0x3e1f63)})),_0x1e89e3,_0x3e1f63,_0x5a7abe),{journeyFiles:_0x22addb,foldersToCreate:_0x4b2a3e}=await withProgressSpinner(_0x5a3fb2(0x121),async _0x3e1c5b=>prepareJourneyFiles(_0x176059,{'fetchJourney':async _0x452887=>_0x41e6f5[_0x5a3fb2(0x147)][_0x5a3fb2(0x175)](_0x452887[_0x5a3fb2(0x180)]),'journeyBundlesByFolderAndName':_0x18ff6e,'folderPathToId':_0x7bf0e8,'idToEmailMap':_0xce539d,'connectionIdToNameMap':_0x45f2f3,'existingSegments':_0x22542a,'parentId':_0xeb7332,'deps':_0x41e6f5,'progress':{'update':_0x3c053f=>{const _0x1c1ec5=_0x5a3fb2;_0x3e1c5b['setPhase'](_0x3c053f),_0x362331[_0x1c1ec5(0x19e)]&&console[_0x1c1ec5(0x1b0)]('\x20\x20'+_0x3c053f);}},'journeyById':_0x3f74fc,'activationStepsById':_0x154e05},_0x5a7abe,_0x3e1f63),{'verbose':_0x362331[_0x5a3fb2(0x19e)]})[_0x5a3fb2(0x15c)](_0x5d7631=>_0x5d7631[_0x5a3fb2(0x141)]);for(const _0x1d751c of _0x4b2a3e){_0x1d2ae4[_0x5a3fb2(0x1b7)](_0x1d751c);}const _0x5df8da=_0xabea65?[]:findJourneysToDelete(_0x220c8a,_0x176059['map'](({yamlConfig:_0x89154,folderPath:_0x3fadd5})=>({'yamlConfig':_0x89154,'folderPath':resolveTDFolderPath(_0x3fadd5,_0x5a7abe,_0x3e1f63)})),_0x1e89e3,_0x3e1f63,_0x5a7abe),_0x1c8eff=calculatePushStats(_0x4aa83c,_0x22addb,_0x1d2ae4,_0x4d3926,_0x5df8da,!!_0x362331[_0x5a3fb2(0x15d)],!!_0x362331[_0x5a3fb2(0x17b)]),_0x373d8b=_0x1c8eff[_0x5a3fb2(0x150)]['new'],_0x370797=_0x1c8eff[_0x5a3fb2(0x150)][_0x5a3fb2(0x19c)],_0x4edfbb=_0x1c8eff[_0x5a3fb2(0x150)][_0x5a3fb2(0x12d)],_0x3cdb4c=_0x1c8eff[_0x5a3fb2(0x150)][_0x5a3fb2(0x176)],_0x3cef4e=_0x1c8eff[_0x5a3fb2(0x12a)][_0x5a3fb2(0x12e)],_0x313eb4=_0x1c8eff['journeys'][_0x5a3fb2(0x1a4)],_0x11d50c=_0x1c8eff[_0x5a3fb2(0x19f)][_0x5a3fb2(0x19c)],_0x1f64dd=_0x1c8eff[_0x5a3fb2(0x19f)][_0x5a3fb2(0x12d)],_0x521f3a=_0x1c8eff[_0x5a3fb2(0x19f)][_0x5a3fb2(0x176)],_0x208f5a=_0x1c8eff[_0x5a3fb2(0x181)]['all'],_0x763bb5=_0x1c8eff[_0x5a3fb2(0x181)][_0x5a3fb2(0x12e)],_0x17db42=_0x1c8eff[_0x5a3fb2(0x181)][_0x5a3fb2(0x144)],_0xcfc0c5=_0x1c8eff[_0x5a3fb2(0x181)]['toDelete'];console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x138)+_0x2f94b0+'\x27:');_0x3cef4e[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)]('\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x171)](_0x5a3fb2(0x151)+_0x3cef4e['length']+_0x5a3fb2(0x165)));if(!_0x362331['journeysOnly']){console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x156)),console[_0x5a3fb2(0x1b0)]('\x20\x20\x20\x20'+a46_0x1ac0c9['green']('+\x20'+_0x373d8b['length']+_0x5a3fb2(0x16d))),console['error']('\x20\x20\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x12f)]('~\x20'+_0x370797[_0x5a3fb2(0x152)]+_0x5a3fb2(0x1b4)));if(_0x3cdb4c['length']>0x0)console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x149)]('-\x20'+_0x3cdb4c[_0x5a3fb2(0x152)]+_0x5a3fb2(0x197)));else _0x4d3926['length']>0x0&&!_0x362331[_0x5a3fb2(0x15d)]&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x186)](_0x4d3926[_0x5a3fb2(0x152)]+_0x5a3fb2(0x125)));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9['dim']('=\x20'+_0x4edfbb[_0x5a3fb2(0x152)]+'\x20unchanged'));}if(_0x22addb[_0x5a3fb2(0x152)]>0x0||_0x5df8da['length']>0x0){console['error'](_0x5a3fb2(0x153)),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x18d)]('+\x20'+_0x313eb4[_0x5a3fb2(0x152)]+'\x20new')),console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x12f)]('~\x20'+_0x11d50c[_0x5a3fb2(0x152)]+_0x5a3fb2(0x1b4)));if(_0x521f3a[_0x5a3fb2(0x152)]>0x0)console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x149)]('-\x20'+_0x521f3a[_0x5a3fb2(0x152)]+_0x5a3fb2(0x197)));else _0x5df8da[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x15d)]&&console['error'](_0x5a3fb2(0x164)+a46_0x1ac0c9['dim'](_0x5df8da[_0x5a3fb2(0x152)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9['dim']('=\x20'+_0x1f64dd[_0x5a3fb2(0x152)]+_0x5a3fb2(0x1a1)));}_0x208f5a[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x17b)]&&(console['error'](''),console['error'](_0x5a3fb2(0x14d)),_0x763bb5[_0x5a3fb2(0x152)]>0x0&&console['error'](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x18d)]('+\x20'+_0x763bb5['length']+_0x5a3fb2(0x17d))),_0x17db42[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9['yellow']('~\x20'+_0x17db42[_0x5a3fb2(0x152)]+_0x5a3fb2(0x140))),_0xcfc0c5[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x164)+a46_0x1ac0c9[_0x5a3fb2(0x149)]('-\x20'+_0xcfc0c5[_0x5a3fb2(0x152)]+_0x5a3fb2(0x197))));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x1b3)+a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x340a60)+'\x0a');if(_0x3cef4e[_0x5a3fb2(0x152)]>0x0){console[_0x5a3fb2(0x1b0)]('Folders\x20to\x20create:');for(const _0x6591f8 of _0x3cef4e){console[_0x5a3fb2(0x1b0)]('\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x171)]('+')+'\x20'+_0x6591f8);}console[_0x5a3fb2(0x1b0)]('');}if(_0x373d8b['length']>0x0&&!_0x362331[_0x5a3fb2(0x17b)])for(const _0x5a029c of _0x373d8b){const _0x32081a=_0x5a029c[_0x5a3fb2(0x1b2)]?_0x5a029c[_0x5a3fb2(0x1b2)]+'/'+_0x5a029c[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)]:_0x5a029c[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)],_0xdf0ac3=_0x5a029c[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x181)]?.['length']||0x0,_0x51a726=_0xdf0ac3>0x0?a46_0x1ac0c9[_0x5a3fb2(0x186)]('\x20['+_0xdf0ac3+_0x5a3fb2(0x1a9)):'';console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x18d)](_0x5a3fb2(0x173))+'\x20'+_0x32081a+_0x51a726),console['error']('─'[_0x5a3fb2(0x145)](0x3c)),_0x5a029c[_0x5a3fb2(0x191)]&&console[_0x5a3fb2(0x1b0)](_0x5a029c['diff']),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x3cdb4c[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x17b)])for(const _0x3ab3f0 of _0x3cdb4c){const _0x3569ef=_0x3ab3f0['segmentFolderId']?_0x1e89e3[_0x5a3fb2(0x183)](_0x3ab3f0['segmentFolderId'][_0x5a3fb2(0x16c)]())||'':'',_0x1878b6=_0x3569ef?_0x3569ef+'/'+_0x3ab3f0['name']:_0x3ab3f0[_0x5a3fb2(0x1bb)],_0x3b7075=_0x45ac52['get'](_0x3ab3f0['id'])||[],_0x300829=_0x3b7075['length']>0x0?a46_0x1ac0c9[_0x5a3fb2(0x186)]('\x20['+_0x3b7075[_0x5a3fb2(0x152)]+'\x20activations]'):'';console['error']('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x12c))+'\x20'+_0x1878b6+_0x300829),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));const _0x4923a0=segmentWithActivationsToYaml(_0x3ab3f0,_0x3b7075,undefined,_0xce539d,_0x45f2f3),_0x32b3d8=segmentToYamlString(_0x4923a0),_0x41de83=generateDiff(_0x32b3d8,'');console['error'](formatDiffWithColors(_0x41de83)),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}const _0x592b18=_0x4aa83c['filter'](_0x5b7273=>!_0x5b7273[_0x5a3fb2(0x161)]&&_0x5b7273[_0x5a3fb2(0x191)]);if(_0x592b18[_0x5a3fb2(0x152)]>0x0&&!_0x362331['journeysOnly'])for(const _0x36fd20 of _0x592b18){const _0x2033a4=_0x36fd20['folderPath']?_0x36fd20[_0x5a3fb2(0x1b2)]+'/'+_0x36fd20['yamlConfig'][_0x5a3fb2(0x1bb)]:_0x36fd20[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)];console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x193))+'\x20'+_0x2033a4),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c)),console[_0x5a3fb2(0x1b0)](_0x36fd20['diff']),console['error']('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x313eb4[_0x5a3fb2(0x152)]>0x0)for(const _0xe19454 of _0x313eb4){const _0x3511d1=_0xe19454[_0x5a3fb2(0x1b2)]?_0xe19454[_0x5a3fb2(0x1b2)]+'/'+_0xe19454['yamlConfig'][_0x5a3fb2(0x1bb)]:_0xe19454[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)];console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x18d)]('New\x20journey:')+'\x20'+_0x3511d1),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c)),_0xe19454[_0x5a3fb2(0x191)]&&console[_0x5a3fb2(0x1b0)](_0xe19454['diff']),console[_0x5a3fb2(0x1b0)]('─'['repeat'](0x3c));}const _0x499ae0=_0x22addb[_0x5a3fb2(0x17c)](_0x144f45=>!_0x144f45[_0x5a3fb2(0x161)]&&_0x144f45['diff']);if(_0x499ae0['length']>0x0)for(const _0x84efb9 of _0x499ae0){const _0x2549a5=_0x84efb9[_0x5a3fb2(0x1b2)]?_0x84efb9[_0x5a3fb2(0x1b2)]+'/'+_0x84efb9['yamlConfig'][_0x5a3fb2(0x1bb)]:_0x84efb9[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)];console[_0x5a3fb2(0x1b0)]('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x12f)]('Changes\x20to\x20journey:')+'\x20'+_0x2549a5),console['error']('─'[_0x5a3fb2(0x145)](0x3c)),console[_0x5a3fb2(0x1b0)](_0x84efb9[_0x5a3fb2(0x191)]),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x521f3a[_0x5a3fb2(0x152)]>0x0)for(const _0x3d79ab of _0x521f3a){const _0x6b5b7f=_0x3d79ab[_0x5a3fb2(0x1aa)]?_0x1e89e3[_0x5a3fb2(0x183)](_0x3d79ab[_0x5a3fb2(0x1aa)])||'':'',_0x19856d=_0x6b5b7f?_0x6b5b7f+'/'+_0x3d79ab[_0x5a3fb2(0x163)]:_0x3d79ab[_0x5a3fb2(0x163)];console['error']('\x0a'+a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x160))+'\x20'+_0x19856d),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c)),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x14a))),console[_0x5a3fb2(0x1b0)]('─'[_0x5a3fb2(0x145)](0x3c));}if(_0x362331['dryRun'])return console['error'](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x169))),0x0;const _0x5ce8ed=_0x362331[_0x5a3fb2(0x17b)]?![]:_0x373d8b['length']>0x0||_0x370797['length']>0x0||_0x3cdb4c['length']>0x0,_0x377ecf=_0x313eb4[_0x5a3fb2(0x152)]>0x0||_0x11d50c[_0x5a3fb2(0x152)]>0x0||_0x521f3a['length']>0x0,_0x66676f=_0x362331['journeysOnly']?![]:_0x208f5a[_0x5a3fb2(0x152)]>0x0,_0x3218ef=_0x3cef4e[_0x5a3fb2(0x152)]>0x0;if(!_0x5ce8ed&&!_0x377ecf&&!_0x66676f&&!_0x3218ef){const _0x52a599=_0x362331[_0x5a3fb2(0x17b)]?_0x5a3fb2(0x129):_0x5a3fb2(0x1a6);console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x18d)](_0x52a599));if(_0xabea65&&_0x4edfbb[_0x5a3fb2(0x152)]===0x1){const _0x113a57=_0x4edfbb[0x0];if(_0x113a57['existingSegment']?.['id']){const _0x3f4e46=getConsoleNextUrl(_0x362331['site'],'/app/ps/'+_0xeb7332+_0x5a3fb2(0x137)+_0x113a57[_0x5a3fb2(0x133)]['id']+_0x5a3fb2(0x17a));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x13f)+a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x3f4e46));}}if(_0xabea65&&_0x1f64dd[_0x5a3fb2(0x152)]===0x1){const _0x3c1a15=_0x1f64dd[0x0];if(_0x3c1a15['existingJourney']?.['id']){const _0x269bb6=getConsoleNextUrl(_0x362331[_0x5a3fb2(0x120)],'/app/ps/'+_0xeb7332+'/e/'+_0x3c1a15[_0x5a3fb2(0x1a5)]['id']+_0x5a3fb2(0x18a));console['error']('\x20\x20'+a46_0x1ac0c9[_0x5a3fb2(0x1a2)](_0x269bb6));}}return 0x0;}const _0x28eea9=_0x362331[_0x5a3fb2(0x17b)]?_0x313eb4[_0x5a3fb2(0x152)]+_0x11d50c['length']+_0x521f3a[_0x5a3fb2(0x152)]+_0x3cef4e[_0x5a3fb2(0x152)]:_0x373d8b[_0x5a3fb2(0x152)]+_0x370797['length']+_0x3cdb4c['length']+_0x313eb4[_0x5a3fb2(0x152)]+_0x11d50c[_0x5a3fb2(0x152)]+_0x521f3a[_0x5a3fb2(0x152)]+_0x3cef4e[_0x5a3fb2(0x152)]+_0x208f5a[_0x5a3fb2(0x152)];if(!_0x362331['yes']&&_0x28eea9>0x0){if(!isInteractive())return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)](_0x5a3fb2(0x192)),_0x5a3fb2(0x174)),console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['dim'](_0x5a3fb2(0x17e))),0x1;const _0x390bbb=await confirmKey(_0x5a3fb2(0x14e)+_0x28eea9+_0x5a3fb2(0x15f));if(!_0x390bbb)return console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9['yellow']('Aborted.')),0x1;}const _0x54135d={'withProgress':async(_0x47705e,_0x55ea4a)=>{const _0x1ec52c=_0x5a3fb2,_0x3003c1=await withSpinner(_0x47705e,_0x55ea4a,{'verbose':_0x362331[_0x1ec52c(0x19e)]});return{'data':_0x3003c1[_0x1ec52c(0x141)]};},'logInfo':_0x2e0d2f=>console['error'](a46_0x1ac0c9[_0x5a3fb2(0x171)]('✔\x20'+_0x2e0d2f)),'logSuccess':_0x5bbb4a=>console['error'](a46_0x1ac0c9[_0x5a3fb2(0x18d)]('✔\x20'+_0x5bbb4a)),'logWarning':_0xe0a0e7=>console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x12f)]('⚠\x20'+_0xe0a0e7)),'logDeleted':_0x22b929=>console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x149)]('✔\x20'+_0x22b929))},_0x310c80={'segment':_0x41e6f5[_0x5a3fb2(0x1a7)],'journey':_0x41e6f5[_0x5a3fb2(0x147)],'user':_0x41e6f5[_0x5a3fb2(0x12b)],'connection':_0x41e6f5['connection']};_0x3cef4e['length']>0x0&&(_0x7bf0e8=await executePushFolders(_0x310c80,_0x3cef4e,_0x7bf0e8,{'parentId':_0xeb7332},_0x54135d));const _0x52200f={'rootFolderId':_0x1a3478,'folderPathToId':_0x7bf0e8,'folderIdToPath':_0x1e89e3,'segmentNameToId':_0x58e3b8,'activationsBySegmentId':_0x45ac52,'emailToIdMap':_0x49998c,'idToEmailMap':_0xce539d,'connectionNameToIdMap':_0x4b8126[_0x5a3fb2(0x1a8)],'connectionIdToNameMap':_0x4b8126['idToName'],'connectionNameToTypeMap':_0x590122},_0x772897=await executePushSegments(_0x310c80,_0x362331[_0x5a3fb2(0x17b)]?[]:_0x4aa83c,_0x52200f,{'parentId':_0xeb7332},_0x54135d),_0x5330d1=_0x772897[_0x5a3fb2(0x14f)],_0x30b37e=_0x772897[_0x5a3fb2(0x19d)],_0x543d14=_0x772897[_0x5a3fb2(0x181)]['created'],_0x480ead=_0x772897['activations'][_0x5a3fb2(0x19d)],_0x2fe159=_0x772897[_0x5a3fb2(0x181)][_0x5a3fb2(0x1bc)];let _0x216b45;if(_0xabea65&&_0x4aa83c['length']===0x1){const _0x3b7812=_0x4aa83c[0x0];_0x216b45=_0x3b7812['existingSegment']?.['id']??_0x772897[_0x5a3fb2(0x199)][_0x5a3fb2(0x183)](_0x3b7812[_0x5a3fb2(0x1ac)][_0x5a3fb2(0x1bb)]);}const _0x29eb1c=await executePushSegmentDeletions(_0x310c80,_0x362331[_0x5a3fb2(0x17b)]?[]:_0x3cdb4c,_0x54135d);let _0x193b37=0x0,_0x403712=0x0,_0x4de699=0x0;const _0x35b2a8=new Map(_0x58e3b8);for(const [_0x2d7698,_0x631049]of _0x772897[_0x5a3fb2(0x199)]){_0x35b2a8[_0x5a3fb2(0x146)](_0x2d7698,_0x631049);}if(_0x22addb[_0x5a3fb2(0x152)]>0x0){const _0x55ca99={..._0x52200f,'segmentNameToId':_0x35b2a8,'existingSegments':_0x22542a,'activationContext':_0x487595},_0x29a3af=await executePushJourneys(_0x310c80,_0x22addb,_0x55ca99,{'parentId':_0xeb7332,'rootFolderId':_0x1a3478,'verbose':_0x362331['verbose']},_0x54135d);_0x193b37=_0x29a3af[_0x5a3fb2(0x14f)],_0x403712=_0x29a3af['updated'];if(_0xabea65&&_0x29a3af['results'][_0x5a3fb2(0x152)]===0x1){const _0x4e67bc=_0x29a3af['results'][0x0];if(_0x4e67bc[_0x5a3fb2(0x180)]){const _0x187c41=getConsoleNextUrl(_0x362331['site'],'/app/ps/'+_0xeb7332+_0x5a3fb2(0x137)+_0x4e67bc[_0x5a3fb2(0x180)]+_0x5a3fb2(0x18a));console[_0x5a3fb2(0x1b0)]('\x20\x20'+a46_0x1ac0c9['cyan'](_0x187c41));}}}for(const _0x39bf65 of _0x521f3a){console['error'](a46_0x1ac0c9[_0x5a3fb2(0x12f)](_0x5a3fb2(0x179)+_0x39bf65[_0x5a3fb2(0x163)])),_0x4de699++;}const _0x1d2699=[];if(_0x5330d1>0x0)_0x1d2699[_0x5a3fb2(0x1ae)](_0x5330d1+_0x5a3fb2(0x122));if(_0x30b37e>0x0)_0x1d2699[_0x5a3fb2(0x1ae)](_0x30b37e+_0x5a3fb2(0x190));if(_0x29eb1c>0x0)_0x1d2699['push'](_0x29eb1c+_0x5a3fb2(0x136));const _0x34538d=[];if(_0x193b37>0x0)_0x34538d[_0x5a3fb2(0x1ae)](_0x193b37+_0x5a3fb2(0x122));if(_0x403712>0x0)_0x34538d['push'](_0x403712+_0x5a3fb2(0x190));if(_0x4de699>0x0)_0x34538d[_0x5a3fb2(0x1ae)](_0x4de699+_0x5a3fb2(0x136));const _0x39c22c=[];if(_0x543d14>0x0)_0x39c22c[_0x5a3fb2(0x1ae)](_0x543d14+_0x5a3fb2(0x122));if(_0x480ead>0x0)_0x39c22c['push'](_0x480ead+_0x5a3fb2(0x190));if(_0x2fe159>0x0)_0x39c22c[_0x5a3fb2(0x1ae)](_0x2fe159+'\x20deleted');console[_0x5a3fb2(0x1b0)](a46_0x1ac0c9[_0x5a3fb2(0x18d)](_0x5a3fb2(0x16f)));_0x1d2699['length']>0x0&&!_0x362331[_0x5a3fb2(0x17b)]&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x1ad)+_0x1d2699[_0x5a3fb2(0x132)](',\x20'));_0x34538d[_0x5a3fb2(0x152)]>0x0&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x13e)+_0x34538d[_0x5a3fb2(0x132)](',\x20'));_0x39c22c[_0x5a3fb2(0x152)]>0x0&&!_0x362331[_0x5a3fb2(0x17b)]&&console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x126)+_0x39c22c['join'](',\x20'));if(_0x216b45){const _0x1e40f8=getConsoleNextUrl(_0x362331['site'],_0x5a3fb2(0x143)+_0xeb7332+'/e/'+_0x216b45+_0x5a3fb2(0x17a));console[_0x5a3fb2(0x1b0)](_0x5a3fb2(0x13f)+a46_0x1ac0c9['cyan'](_0x1e40f8));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a47_0x2729(){const _0x4cebcd=['resolvePathToResource','type','resolveFolderId','kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','1310nNhFTI','Resolved\x20relative\x20path\x20to:\x20','46644yejbHx','includes','name','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20path\x20\x27','length','Resolved\x20type:\x20','execute','segment','INTERNAL','segment:update','segmentPath','rule','yellow','52213phEyOz','3BulfFd','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','8DinPZa','verbose','Parent\x20ID:\x20','Examples:','Updating\x20segment\x20\x27','3115679LAxCkg','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','726cdKFYH','folder','Resolving\x20folder\x20\x27','\x27...','ruleFile','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20update\x20','3051uUayxN','1173188IzkFVQ','error','✔\x20Updated\x20segment\x20\x27','parentId','1650JYBWUj','3288vZUtLW','3029070xiIUZr','segmentName','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.'];a47_0x2729=function(){return _0x4cebcd;};return a47_0x2729();}function a47_0x4d01(_0x563c24,_0x497da1){_0x563c24=_0x563c24-0xc8;const _0x2729d8=a47_0x2729();let _0x4d014b=_0x2729d8[_0x563c24];return _0x4d014b;}const a47_0x758293=a47_0x4d01;(function(_0x33c734,_0xdb0a5){const _0x1b9beb=a47_0x4d01,_0x6bd807=_0x33c734();while(!![]){try{const _0x5b4089=-parseInt(_0x1b9beb(0xde))/0x1*(parseInt(_0x1b9beb(0xe3))/0x2)+-parseInt(_0x1b9beb(0xdf))/0x3*(-parseInt(_0x1b9beb(0xf2))/0x4)+-parseInt(_0x1b9beb(0xce))/0x5*(parseInt(_0x1b9beb(0xf6))/0x6)+parseInt(_0x1b9beb(0xe8))/0x7+parseInt(_0x1b9beb(0xf7))/0x8*(-parseInt(_0x1b9beb(0xf1))/0x9)+-parseInt(_0x1b9beb(0xf8))/0xa+parseInt(_0x1b9beb(0xea))/0xb*(parseInt(_0x1b9beb(0xd0))/0xc);if(_0x5b4089===_0xdb0a5)break;else _0x6bd807['push'](_0x6bd807['shift']());}catch(_0x2fb29e){_0x6bd807['push'](_0x6bd807['shift']());}}}(a47_0x2729,0x425b6));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 a47_0xaeb643 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a47_0x758293(0xd2)]=a47_0x758293(0xda);['description']='Update\x20existing\x20child\x20segment';async[a47_0x758293(0xd7)](_0x2eec67){const _0x3799d6=a47_0x758293;console['error'](a47_0xaeb643['yellow'](_0x3799d6(0xfb))),console[_0x3799d6(0xf3)](a47_0xaeb643[_0x3799d6(0xdd)](_0x3799d6(0xe9)));const {options:_0x19df14,args:_0x5e489f,tdx:_0x21372a}=_0x2eec67,_0x9ab943=_0x19df14;if(_0x5e489f[_0x3799d6(0xd5)]===0x0)return console[_0x3799d6(0xf3)](_0x3799d6(0xe2)),console[_0x3799d6(0xf3)](_0x3799d6(0xd3)),console['error'](_0x3799d6(0xe6)),console[_0x3799d6(0xf3)](_0x3799d6(0xcc)),console[_0x3799d6(0xf3)](_0x3799d6(0xe0)),0x1;const _0xef2409=_0x5e489f[0x0],_0x21d8f3=_0x19df14[_0x3799d6(0xdb)];let _0x3c8c63=_0xef2409;_0x21d8f3&&!_0xef2409[_0x3799d6(0xd1)]('/')&&(_0x3c8c63=_0x21d8f3+'/'+_0xef2409,_0x9ab943[_0x3799d6(0xe4)]&&console[_0x3799d6(0xf3)](_0x3799d6(0xcf)+_0x3c8c63));const _0x49a103=await withSpinner(_0x3799d6(0xd4)+_0x3c8c63+'\x27...',()=>_0x21372a[_0x3799d6(0xd8)][_0x3799d6(0xc8)](_0x3c8c63),{'verbose':_0x9ab943[_0x3799d6(0xe4)]}),_0x58ed88=_0x49a103['data'];_0x9ab943[_0x3799d6(0xe4)]&&console['error'](_0x3799d6(0xd6)+_0x58ed88[_0x3799d6(0xc9)]);if(_0x58ed88[_0x3799d6(0xc9)]!==_0x3799d6(0xd8))return console['error'](_0x3799d6(0xf0)+_0x58ed88[_0x3799d6(0xc9)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x3799d6(0xf3)](_0x3799d6(0xfa)),0x1;if(!_0x58ed88[_0x3799d6(0xe1)])throw new SDKError(ErrorCode[_0x3799d6(0xd9)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x32b2d1=_0x58ed88[_0x3799d6(0xf5)],_0x26a43c=_0x58ed88['segmentId'];_0x9ab943[_0x3799d6(0xe4)]&&(console[_0x3799d6(0xf3)](_0x3799d6(0xe5)+_0x32b2d1),console[_0x3799d6(0xf3)](_0x3799d6(0xcd)+_0x26a43c));let _0x315754;if(_0x9ab943[_0x3799d6(0xeb)]){const _0x26a71f=_0x9ab943[_0x3799d6(0xeb)],_0x41b459=await withSpinner(_0x3799d6(0xec)+_0x26a71f+_0x3799d6(0xed),()=>_0x21372a[_0x3799d6(0xd8)][_0x3799d6(0xca)](_0x32b2d1,_0x26a71f),{'verbose':_0x9ab943[_0x3799d6(0xe4)]});_0x315754=parseInt(_0x41b459['data'],0xa),_0x9ab943[_0x3799d6(0xe4)]&&console[_0x3799d6(0xf3)](_0x3799d6(0xef)+_0x315754);}const _0x19c22e=await loadJSONFromOptions(_0x9ab943[_0x3799d6(0xdc)],_0x9ab943[_0x3799d6(0xee)]),_0x82f7a5={'name':_0x9ab943[_0x3799d6(0xd2)],'description':_0x9ab943['description'],'rule':_0x19c22e,'kind':_0x9ab943[_0x3799d6(0xcb)]!==undefined?parseInt(_0x9ab943['kind'],0xa):undefined,'segmentFolderId':_0x315754},_0x4ae126=await withSpinner(_0x3799d6(0xe7)+_0x58ed88[_0x3799d6(0xf9)]+_0x3799d6(0xed),()=>_0x21372a[_0x3799d6(0xd8)]['updateSegmentById'](_0x32b2d1,_0x26a43c,_0x82f7a5),{'verbose':_0x9ab943['verbose']}),_0x23c371=_0x4ae126['data'];return console[_0x3799d6(0xf3)](_0x3799d6(0xf4)+_0x23c371['name']+'\x27'),_0x3c8c63!==_0xef2409&&console[_0x3799d6(0xf3)]('\x20\x20\x20Path:\x20'+_0x3c8c63),await handleSDKOutput([_0x23c371],_0x9ab943),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a48_0x165e(_0x13fe07,_0x5ca043){_0x13fe07=_0x13fe07-0x8f;const _0x3a532c=a48_0x3a53();let _0x165ea5=_0x3a532c[_0x13fe07];return _0x165ea5;}const a48_0x12f37=a48_0x165e;(function(_0x1d7ef6,_0x5abd1b){const _0x4d59e7=a48_0x165e,_0x3a1bcd=_0x1d7ef6();while(!![]){try{const _0x387fbd=-parseInt(_0x4d59e7(0xc5))/0x1*(-parseInt(_0x4d59e7(0x9a))/0x2)+parseInt(_0x4d59e7(0xc2))/0x3+-parseInt(_0x4d59e7(0x93))/0x4+parseInt(_0x4d59e7(0x97))/0x5*(-parseInt(_0x4d59e7(0x95))/0x6)+parseInt(_0x4d59e7(0xb1))/0x7*(parseInt(_0x4d59e7(0xbd))/0x8)+parseInt(_0x4d59e7(0x9d))/0x9+-parseInt(_0x4d59e7(0xbc))/0xa;if(_0x387fbd===_0x5abd1b)break;else _0x3a1bcd['push'](_0x3a1bcd['shift']());}catch(_0x2c683b){_0x3a1bcd['push'](_0x3a1bcd['shift']());}}}(a48_0x3a53,0x87cd6));import{existsSync,statSync}from'fs';import a48_0x34420f from'chalk';import{BaseCommand}from'./command.js';function a48_0x3a53(){const _0x523e44=['parentId','segmentPath','2553708boCMpJ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','5899542QUfged','parentName','5qHrdZW','length','description','266kRayFB','session','✔\x20Context\x20set\x20to:\x20','3194631TUuVWE','Site:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','green','Folder\x20ID:\x20','execute','fullPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','data','Resolved\x20relative\x20path\x20to:\x20','folderId','isAbsolute','error','Target\x20path:\x20','Resolving\x20path\x20\x27','segment','resolvePathToResource','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','type','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','1211iPyKzb','segment:use','Parent\x20ID:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderPath','slice','\x27...','cyan','log','Usage:\x20tdx\x20segment\x20use\x20<path>','verbose','535700tYMgWt','50672LBPYQK','Error:\x20Path\x20is\x20required\x0a','Resolved\x20path\x20type:\x20','site','dim','1161636POGmqt','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','config','2959Fzniut','join','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','red','split'];a48_0x3a53=function(){return _0x523e44;};return a48_0x3a53();}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{['name']=a48_0x12f37(0xb2);[a48_0x12f37(0x99)]=a48_0x12f37(0x9f);async[a48_0x12f37(0xa2)](_0x5d2003){const _0x4ade18=a48_0x12f37,{options:_0x23bea2,args:_0x60f941,tdx:_0x240389}=_0x5d2003;if(_0x60f941[_0x4ade18(0x98)]===0x0)return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)](_0x4ade18(0xbe))),console[_0x4ade18(0xa9)](_0x4ade18(0xba)),console[_0x4ade18(0xa9)]('Examples:'),console[_0x4ade18(0xa9)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x4ade18(0xa9)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x4ade18(0xa9)](_0x4ade18(0x94)),console[_0x4ade18(0xa9)](_0x4ade18(0xc3)),0x1;const _0x2300c8=_0x60f941[0x0],_0x1d9e28=_0x23bea2[_0x4ade18(0x9b)];try{if(_0x2300c8==='/')return saveSessionContext({'segment_path':undefined},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x2300c8)&&statSync(_0x2300c8)['isDirectory']()){let _0x1a4638;try{_0x1a4638=findTdxConfig(_0x2300c8);}catch{return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x2300c8)),console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0xb8)](_0x4ade18(0xae))),0x1;}const _0x4e79c5=_0x1a4638[_0x4ade18(0xc4)]['parent_segment'];return saveSessionContext({'segment_path':_0x4e79c5,'parent_segment':_0x4e79c5},_0x1d9e28),console['log'](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0x9c)+a48_0x34420f[_0x4ade18(0xb8)](_0x4e79c5))),0x0;}const _0x2fe4bb=_0x23bea2[_0x4ade18(0x92)];let _0xf1636e=_0x2300c8;const _0x1f2f76=parsePath(_0x2300c8);if(!_0x1f2f76[_0x4ade18(0xa8)]){if(!_0x2fe4bb)return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)](_0x4ade18(0xb4))),console['error'](a48_0x34420f[_0x4ade18(0xb8)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x2300c8==='..'){const _0x5ecaf5=_0x2fe4bb[_0x4ade18(0x90)]('/')[_0x4ade18(0xb6)](0x0,-0x1)[_0x4ade18(0xc6)]('/');_0xf1636e=_0x5ecaf5||'/';}else _0x2300c8==='.'?_0xf1636e=_0x2fe4bb:_0xf1636e=_0x2fe4bb+'/'+_0x2300c8;_0x23bea2['verbose']&&console['error'](_0x4ade18(0xa6)+_0xf1636e);}if(_0xf1636e==='/'||_0xf1636e==='')return saveSessionContext({'segment_path':undefined},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0xa4))),0x0;_0xf1636e=normalizePath(_0xf1636e);const _0x34cb7a=parsePath(_0xf1636e)['segments'];if(_0x34cb7a[_0x4ade18(0x98)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0xa4))),0x0;_0x23bea2[_0x4ade18(0xbb)]&&(console[_0x4ade18(0xa9)](_0x4ade18(0x9e)+_0x23bea2[_0x4ade18(0xc0)]),console[_0x4ade18(0xa9)](_0x4ade18(0xaa)+_0xf1636e));const _0x52440c=await withSpinner(_0x4ade18(0xab)+_0xf1636e+_0x4ade18(0xb7),()=>_0x240389[_0x4ade18(0xac)][_0x4ade18(0xad)](_0xf1636e),{'verbose':_0x23bea2['verbose']}),_0x4712d0=_0x52440c[_0x4ade18(0xa5)];_0x23bea2[_0x4ade18(0xbb)]&&(console[_0x4ade18(0xa9)](_0x4ade18(0xbf)+_0x4712d0['type']),console['error'](_0x4ade18(0xb3)+_0x4712d0[_0x4ade18(0x91)]),_0x4712d0[_0x4ade18(0xa7)]&&console['error'](_0x4ade18(0xa1)+_0x4712d0[_0x4ade18(0xa7)]));if(_0x4712d0[_0x4ade18(0xaf)]===_0x4ade18(0xac))return console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0x8f)](_0x4ade18(0xb0))),console[_0x4ade18(0xa9)](_0x4ade18(0xc7)),console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0xb8)]('Use:\x20tdx\x20segment\x20use\x20'+_0x4712d0[_0x4ade18(0x96)]+(_0x4712d0[_0x4ade18(0xb5)]?'/'+_0x4712d0[_0x4ade18(0xb5)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4712d0[_0x4ade18(0xa3)],'parent_segment':_0x4712d0['parentName']},_0x1d9e28),console[_0x4ade18(0xb9)](a48_0x34420f[_0x4ade18(0xa0)](_0x4ade18(0x9c)+a48_0x34420f[_0x4ade18(0xb8)](_0x4712d0[_0x4ade18(0xa3)]))),_0x23bea2['verbose']&&(console[_0x4ade18(0xa9)](a48_0x34420f[_0x4ade18(0xc1)](_0x4ade18(0xc8))),console['error'](a48_0x34420f[_0x4ade18(0xc1)](_0x4ade18(0xc9)))),0x0;}catch(_0x5d033d){throw _0x5d033d;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x2b0b9f=a49_0xe30a;(function(_0x100a4c,_0x14d929){const _0x34a0c5=a49_0xe30a,_0x3d84cf=_0x100a4c();while(!![]){try{const _0x25747c=-parseInt(_0x34a0c5(0x127))/0x1*(parseInt(_0x34a0c5(0x14a))/0x2)+-parseInt(_0x34a0c5(0x13b))/0x3+parseInt(_0x34a0c5(0x129))/0x4*(-parseInt(_0x34a0c5(0x123))/0x5)+-parseInt(_0x34a0c5(0x140))/0x6*(-parseInt(_0x34a0c5(0x11b))/0x7)+-parseInt(_0x34a0c5(0x119))/0x8+-parseInt(_0x34a0c5(0x128))/0x9*(-parseInt(_0x34a0c5(0x147))/0xa)+parseInt(_0x34a0c5(0x13e))/0xb;if(_0x25747c===_0x14d929)break;else _0x3d84cf['push'](_0x3d84cf['shift']());}catch(_0x3de6e2){_0x3d84cf['push'](_0x3d84cf['shift']());}}}(a49_0x56f7,0x2f299));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a49_0x56f7(){const _0x259ceb=['\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','parentSegment','length','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','targetDir','green','574338lSqPRM','warningCount','cyan','5537565UjoZgW','endsWith','36pkApRB','.yml','Error:\x20','Validation\x20failed:\x20','warnings','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','590vWZwGT','\x20file(s)\x20valid','log','2WcfzXg','6464MIxfge','Validate\x20segment\x20and\x20journey\x20YAML\x20files','8561OugFOS','filePath','\x20warning(s)\x20found','valid','hasErrors','verbose','no_parent','message','11695CexVNX','helpText','red','.yaml','104001NzRhkS','43488xnVTbz','524mcWmxc','✔\x20All\x20','file','validCount','invalidCount','description','dim','name','\x20warning(s)','error','):\x20','yellow'];a49_0x56f7=function(){return _0x259ceb;};return a49_0x56f7();}function a49_0xe30a(_0x282b03,_0x4bb269){_0x282b03=_0x282b03-0x119;const _0x56f765=a49_0x56f7();let _0xe30a65=_0x56f765[_0x282b03];return _0xe30a65;}import a49_0x49ba06 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{[a49_0x2b0b9f(0x130)]='segment:validate';[a49_0x2b0b9f(0x12e)]=a49_0x2b0b9f(0x11a);async['execute'](_0x195401){const _0x203e24=a49_0x2b0b9f,{options:_0x29db19,args:_0x5872a8}=_0x195401,_0x57879b=_0x29db19,_0x2f7c65=await resolveTarget({'arg':_0x5872a8[0x0],'contextParent':_0x29db19[_0x203e24(0x136)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2f7c65))return _0x2f7c65['errorCode']===_0x203e24(0x121)?(console[_0x203e24(0x132)](a49_0x49ba06['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x203e24(0x132)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x203e24(0x132)](_0x203e24(0x135)),console[_0x203e24(0x132)](_0x203e24(0x146))):(console[_0x203e24(0x132)](a49_0x49ba06[_0x203e24(0x125)](_0x203e24(0x142)+_0x2f7c65[_0x203e24(0x122)]+'\x0a')),_0x2f7c65[_0x203e24(0x124)]&&console[_0x203e24(0x132)](a49_0x49ba06[_0x203e24(0x13d)](_0x2f7c65[_0x203e24(0x124)]))),0x1;const _0x518334=_0x2f7c65[_0x203e24(0x139)],_0x33928c=_0x2f7c65['type']===_0x203e24(0x12b)?_0x2f7c65[_0x203e24(0x11c)]:undefined;if(!_0x33928c&&!existsSync(_0x518334))return console[_0x203e24(0x132)](a49_0x49ba06['red'](_0x203e24(0x145)+_0x518334+'\x0a')),0x1;let _0x413668;if(_0x33928c){if(!_0x33928c[_0x203e24(0x13f)](_0x203e24(0x141))&&!_0x33928c[_0x203e24(0x13f)](_0x203e24(0x126)))return console[_0x203e24(0x132)](a49_0x49ba06[_0x203e24(0x125)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x33928c+'\x0a')),0x1;_0x413668=[_0x33928c];}else _0x413668=findYamlFiles(_0x518334);if(_0x413668[_0x203e24(0x137)]===0x0)return console['error'](a49_0x49ba06[_0x203e24(0x125)](_0x203e24(0x138)+_0x518334+'\x0a')),0x1;const _0x50fa22=validateYamlFiles(_0x413668,_0x518334),_0x5f165d=calculateSummary(_0x50fa22);for(const _0x27c87e of _0x50fa22){if(!isValidationResult(_0x27c87e))continue;const {relativePath:_0x50c3d3,source:_0x243c37,result:_0x1cd066,fileType:_0x365065}=_0x27c87e,_0x1264a4=_0x365065;if(_0x1cd066[_0x203e24(0x11e)]&&_0x1cd066[_0x203e24(0x144)][_0x203e24(0x137)]===0x0)_0x57879b[_0x203e24(0x120)]&&console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x13a)]('✔\x20'+_0x50c3d3)+a49_0x49ba06[_0x203e24(0x12f)]('\x20('+_0x1264a4+')'));else _0x1cd066[_0x203e24(0x11e)]?(console['log'](a49_0x49ba06['yellow']('⚠\x20'+_0x50c3d3)+a49_0x49ba06[_0x203e24(0x12f)]('\x20('+_0x1264a4+_0x203e24(0x133)+_0x1cd066[_0x203e24(0x144)][_0x203e24(0x137)]+_0x203e24(0x131))),console['log'](formatValidationResult(_0x1cd066,_0x243c37,_0x50c3d3))):(console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x125)]('✖\x20'+_0x50c3d3)+a49_0x49ba06[_0x203e24(0x12f)]('\x20('+_0x1264a4+_0x203e24(0x133)+_0x1cd066['errors']['length']+'\x20error(s)')),console['log'](formatValidationResult(_0x1cd066,_0x243c37,_0x50c3d3)));}return console[_0x203e24(0x149)](''),_0x5f165d[_0x203e24(0x11f)]?(console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x125)](_0x203e24(0x143)+_0x5f165d[_0x203e24(0x12d)]+'\x20file(s)\x20with\x20errors,\x20'+_0x5f165d[_0x203e24(0x12c)]+'\x20valid')),_0x5f165d[_0x203e24(0x13c)]>0x0&&console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x134)](_0x5f165d['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x13a)](_0x203e24(0x12a)+_0x5f165d[_0x203e24(0x12c)]+_0x203e24(0x148))),_0x5f165d['warningCount']>0x0&&console[_0x203e24(0x149)](a49_0x49ba06[_0x203e24(0x134)](_0x5f165d[_0x203e24(0x13c)]+_0x203e24(0x11d))),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 a50_0x567586=a50_0x2404;(function(_0xf2d933,_0x5c8602){const _0xe0b24d=a50_0x2404,_0xbf8282=_0xf2d933();while(!![]){try{const _0x3bf7f1=parseInt(_0xe0b24d(0x7f))/0x1+parseInt(_0xe0b24d(0xc2))/0x2+-parseInt(_0xe0b24d(0x9a))/0x3*(parseInt(_0xe0b24d(0xb5))/0x4)+parseInt(_0xe0b24d(0xbd))/0x5*(parseInt(_0xe0b24d(0x9e))/0x6)+parseInt(_0xe0b24d(0xc3))/0x7*(parseInt(_0xe0b24d(0x7c))/0x8)+parseInt(_0xe0b24d(0xbe))/0x9+parseInt(_0xe0b24d(0xba))/0xa*(-parseInt(_0xe0b24d(0x76))/0xb);if(_0x3bf7f1===_0x5c8602)break;else _0xbf8282['push'](_0xbf8282['shift']());}catch(_0x48079d){_0xbf8282['push'](_0xbf8282['shift']());}}}(a50_0x2977,0x4de97));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_0xd92f28 from'chalk';function a50_0x2404(_0x51c6cf,_0x4c8c5e){_0x51c6cf=_0x51c6cf-0x6d;const _0x2977a7=a50_0x2977();let _0x2404a1=_0x2977a7[_0x51c6cf];return _0x2404a1;}export class SegmentsCommand extends BaseCommand{['name']=a50_0x567586(0xab);['description']=a50_0x567586(0xac);async[a50_0x567586(0x85)](_0x1d02e8){const _0x83e0a7=a50_0x567586,{options:_0x589630,args:_0x454d00}=_0x1d02e8,_0x4a7ac5=_0x589630[_0x83e0a7(0xa0)],_0x358def=_0x454d00[0x0];try{const _0x406d33=_0x589630[_0x83e0a7(0x8b)];_0x589630[_0x83e0a7(0x7b)]&&(console[_0x83e0a7(0xb8)](_0x83e0a7(0xaa)+_0x589630['site']),console[_0x83e0a7(0xb8)](_0x83e0a7(0x82)+(_0x406d33||'(not\x20set)')),_0x358def&&console[_0x83e0a7(0xb8)](_0x83e0a7(0x71)+_0x358def),_0x4a7ac5&&console[_0x83e0a7(0xb8)](_0x83e0a7(0x84)));if(!_0x406d33)return console[_0x83e0a7(0xb8)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x83e0a7(0xb8)](_0x83e0a7(0xb0)),console[_0x83e0a7(0xb8)](_0x83e0a7(0xc4)),console[_0x83e0a7(0xb8)](_0x83e0a7(0x77)),console[_0x83e0a7(0xb8)](''),console[_0x83e0a7(0xb8)](_0x83e0a7(0x72)),0x1;if(_0x358def&&_0x4a7ac5)return await this['searchByName'](_0x1d02e8,_0x406d33,_0x358def);const _0x3de9c3=_0x358def&&(_0x358def[_0x83e0a7(0xb4)]('*')||_0x358def[_0x83e0a7(0xb4)]('?'));if(_0x3de9c3)return await this['listWithPattern'](_0x1d02e8,_0x406d33,_0x358def);const _0x20b6cc=_0x358def?_0x406d33+'/'+_0x358def:_0x406d33;return _0x4a7ac5?await this['listRecursive'](_0x1d02e8,_0x20b6cc):await this[_0x83e0a7(0xae)](_0x1d02e8,_0x20b6cc);}catch(_0x483158){if(_0x483158 instanceof SDKError)return console[_0x83e0a7(0xb8)](_0x83e0a7(0xa3)+_0x483158[_0x83e0a7(0x75)]),_0x483158[_0x83e0a7(0xb3)]&&console[_0x83e0a7(0xb8)]('\x20\x20Cause:\x20'+_0x483158[_0x83e0a7(0xb3)]),0x1;throw _0x483158;}}async[a50_0x567586(0x8e)](_0x2982fd,_0x20e5b8,_0x853353){const _0x5f5033=a50_0x567586,{options:_0x3533d8,tdx:_0x3e60cc}=_0x2982fd,_0x145dbe='\x22'+_0x853353+'\x22',_0x155f4c=await withSpinner(_0x5f5033(0x78)+_0x20e5b8+_0x5f5033(0x86),()=>_0x3e60cc[_0x5f5033(0x8f)][_0x5f5033(0x97)](_0x20e5b8),{'verbose':_0x3533d8[_0x5f5033(0x7b)]}),_0xe1f154=_0x155f4c[_0x5f5033(0x70)],_0x2a42ec=_0x3533d8['maxDepth']||0xa,_0x41b925=await withSpinner(_0x5f5033(0x79)+_0x145dbe+'...',()=>_0x3e60cc['segment'][_0x5f5033(0xb6)](_0xe1f154['parentId'],_0xe1f154[_0x5f5033(0x94)],0x0,_0x2a42ec),{'verbose':_0x3533d8[_0x5f5033(0x7b)]}),_0x3ba2d3=searchTreeByName(_0x41b925[_0x5f5033(0x70)],_0x853353),_0x456ed1=_0xca5357=>getConsoleNextUrl(_0x3533d8[_0x5f5033(0x93)],_0x5f5033(0x96)+_0xe1f154[_0x5f5033(0x89)]+_0x5f5033(0x95)+_0xca5357),_0x200e70=[..._0x3ba2d3][_0x5f5033(0xc1)]((_0x1b642a,_0x1fa453)=>_0x1b642a['path']['localeCompare'](_0x1fa453[_0x5f5033(0xb2)])),_0x2bed62=0x32,_0x2b0c8b='Found\x20'+_0x3ba2d3[_0x5f5033(0x73)]+_0x5f5033(0x7a)+(_0x3ba2d3['length']!==0x1?'es':'');console[_0x5f5033(0xb8)](_0x3ba2d3[_0x5f5033(0x73)]>_0x2bed62?'✔\x20'+_0x2b0c8b+_0x5f5033(0x9d):'✔\x20'+_0x2b0c8b);if(_0x3533d8['format']===_0x5f5033(0x90)||_0x3533d8['format']==='jsonl'){const _0x2d825c=_0x200e70['map'](_0x8b5c3b=>({..._0x8b5c3b,..._0x8b5c3b[_0x5f5033(0x87)]===_0x5f5033(0x8f)?{'url':_0x456ed1(_0x8b5c3b['id'])}:{}}));return await handleSDKOutput(_0x2d825c,_0x3533d8),0x0;}if(_0x3ba2d3[_0x5f5033(0x73)]===0x0)return console[_0x5f5033(0x6e)](_0x5f5033(0xa9)+_0x145dbe),0x0;for(const _0xd68b7f of _0x200e70){console['log'](_0xd68b7f[_0x5f5033(0x87)][_0x5f5033(0xb7)](0x8)+'\x20'+_0xd68b7f[_0x5f5033(0xb2)]+'\x20\x20'+a50_0xd92f28[_0x5f5033(0x9f)](_0x5f5033(0x6d)+_0xd68b7f['id']+')'));}const _0x204dbb=_0x3ba2d3['filter'](_0x48ea84=>_0x48ea84[_0x5f5033(0x87)]===_0x5f5033(0x8f)),_0x5f35ac=new Set(_0x204dbb[_0x5f5033(0x98)](_0x45b96e=>_0x45b96e['name']['toLowerCase']()))['size']===0x1;return _0x204dbb['length']>0x1&&_0x5f35ac&&console[_0x5f5033(0x6e)](a50_0xd92f28[_0x5f5033(0x9f)]('\x0a'+_0x204dbb[_0x5f5033(0x73)]+'\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.')),0x0;}async[a50_0x567586(0x99)](_0xc1cb9a,_0x539ac7,_0x5d73d0){const _0x2cf253=a50_0x567586,{options:_0x19728a,tdx:_0x4907a4}=_0xc1cb9a,_0x56af77=await withSpinner(_0x2cf253(0x7d)+_0x539ac7+_0x2cf253(0x86),()=>_0x4907a4[_0x2cf253(0x8f)][_0x2cf253(0x97)](_0x539ac7),{'verbose':_0x19728a['verbose']}),_0x1a2863=_0x56af77[_0x2cf253(0x70)],_0x1a8b99=await withSpinner(_0x2cf253(0xaf),()=>_0x4907a4[_0x2cf253(0x8f)]['listUnifiedWithJourneys'](_0x1a2863['parentId'],_0x1a2863[_0x2cf253(0x94)]),{'verbose':_0x19728a[_0x2cf253(0x7b)]}),{folders:_0xd0ca5e,segments:_0x2d88db,journeys:_0x26438c}=_0x1a8b99[_0x2cf253(0x70)],_0x4a02c7=_0x5d73d0[_0x2cf253(0xa2)](/[.+^${}()|[\]\\]/g,_0x2cf253(0x8c))['replace'](/\*/g,'.*')[_0x2cf253(0xa2)](/\?/g,'.'),_0x34b2d9=new RegExp('^'+_0x4a02c7+'$','i'),_0x27b1f6=_0xd0ca5e['filter'](_0x473962=>_0x34b2d9[_0x2cf253(0xc0)](_0x473962[_0x2cf253(0x74)])),_0x4c5fad=_0x2d88db['filter'](_0x29f235=>_0x34b2d9[_0x2cf253(0xc0)](_0x29f235[_0x2cf253(0x74)])),_0x465e62=_0x26438c[_0x2cf253(0x9b)](_0x15d39a=>_0x34b2d9[_0x2cf253(0xc0)](_0x15d39a[_0x2cf253(0x8a)])),_0x5c32d6=_0x27b1f6[_0x2cf253(0x73)]+_0x4c5fad[_0x2cf253(0x73)]+_0x465e62[_0x2cf253(0x73)];console[_0x2cf253(0xb8)]('✔\x20Found\x20'+_0x27b1f6[_0x2cf253(0x73)]+'\x20folder'+(_0x27b1f6[_0x2cf253(0x73)]!==0x1?'s':'')+',\x20'+_0x4c5fad[_0x2cf253(0x73)]+_0x2cf253(0x81)+(_0x4c5fad[_0x2cf253(0x73)]!==0x1?'s':'')+',\x20and\x20'+_0x465e62[_0x2cf253(0x73)]+_0x2cf253(0x6f)+(_0x465e62[_0x2cf253(0x73)]!==0x1?'s':'')+_0x2cf253(0xa1)+_0x5d73d0+'\x27');const _0x4681cc=_0x3b1bfa=>{const _0x3498ad=_0x2cf253;return getConsoleNextUrl(_0x19728a[_0x3498ad(0x93)],_0x3498ad(0x96)+_0x1a2863['parentId']+_0x3498ad(0x95)+_0x3b1bfa);},_0x3b1244=_0x19728a[_0x2cf253(0x9c)]==='json'||_0x19728a[_0x2cf253(0x9c)]===_0x2cf253(0xa8);if(_0x3b1244){const _0x363a25=[..._0x27b1f6['map'](_0x57322c=>({..._0x57322c,'type':_0x2cf253(0x88)})),..._0x4c5fad['map'](_0x332de4=>({..._0x332de4,'type':_0x2cf253(0x8f),'url':_0x4681cc(_0x332de4['id'])})),..._0x465e62[_0x2cf253(0x98)](_0x51e361=>({..._0x51e361,'name':_0x51e361[_0x2cf253(0x8a)],'type':_0x2cf253(0x83)}))]['sort']((_0x2d385c,_0x23a497)=>_0x2d385c[_0x2cf253(0x74)][_0x2cf253(0xa6)](_0x23a497[_0x2cf253(0x74)]));await handleSDKOutput(_0x363a25,_0x19728a);}else{if(_0x5c32d6===0x0)console[_0x2cf253(0x6e)](_0x2cf253(0xa7)+_0x5d73d0);else{console['log'](a50_0xd92f28['dim']('['+_0x539ac7+_0x2cf253(0x80)+_0x5d73d0+'\x27'));const _0x66323=formatFlatList(_0x27b1f6,_0x4c5fad,{'showMetadata':!![],'getSegmentUrl':_0x4681cc},_0x465e62);console[_0x2cf253(0x6e)](_0x66323);}}return 0x0;}async[a50_0x567586(0xae)](_0x496f83,_0x367c6b){const _0x4833e8=a50_0x567586,{options:_0x490969,tdx:_0x1643e7}=_0x496f83,_0x2b1702=await withSpinner(_0x4833e8(0x78)+_0x367c6b+_0x4833e8(0x86),()=>_0x1643e7['segment'][_0x4833e8(0x97)](_0x367c6b),{'verbose':_0x490969[_0x4833e8(0x7b)]}),_0x5a34b1=_0x2b1702[_0x4833e8(0x70)];_0x490969[_0x4833e8(0x7b)]&&(console[_0x4833e8(0xb8)](_0x4833e8(0xa5)+_0x5a34b1[_0x4833e8(0x89)]),_0x5a34b1[_0x4833e8(0x94)]&&console[_0x4833e8(0xb8)](_0x4833e8(0xbc)+_0x5a34b1[_0x4833e8(0x94)]));const _0x28767d=await withSpinner(_0x4833e8(0xaf),()=>_0x1643e7[_0x4833e8(0x8f)][_0x4833e8(0xb1)](_0x5a34b1[_0x4833e8(0x89)],_0x5a34b1[_0x4833e8(0x94)]),{'verbose':_0x490969[_0x4833e8(0x7b)]}),{folders:_0x580830,segments:_0xb83f5f,journeys:_0x22a4f7}=_0x28767d['data'],_0x4f47ab=_0x580830[_0x4833e8(0x73)]+_0xb83f5f['length']+_0x22a4f7[_0x4833e8(0x73)];console[_0x4833e8(0xb8)](_0x4833e8(0xa4)+_0x580830['length']+_0x4833e8(0x91)+(_0x580830['length']!==0x1?'s':'')+',\x20'+_0xb83f5f[_0x4833e8(0x73)]+_0x4833e8(0x81)+(_0xb83f5f[_0x4833e8(0x73)]!==0x1?'s':'')+_0x4833e8(0x7e)+_0x22a4f7['length']+_0x4833e8(0x6f)+(_0x22a4f7[_0x4833e8(0x73)]!==0x1?'s':''));const _0x34d66c=_0x25f59d=>{const _0x2f0173=_0x4833e8;return getConsoleNextUrl(_0x490969[_0x2f0173(0x93)],'/app/ps/'+_0x5a34b1[_0x2f0173(0x89)]+'/e/'+_0x25f59d);},_0x46516c=_0x5013c4=>{const _0xab09f8=_0x4833e8;return getConsoleNextUrl(_0x490969[_0xab09f8(0x93)],_0xab09f8(0x96)+_0x5a34b1[_0xab09f8(0x89)]+_0xab09f8(0x95)+_0x5013c4+_0xab09f8(0x8d));},_0x41ddcf=_0x490969[_0x4833e8(0x9c)]==='json'||_0x490969[_0x4833e8(0x9c)]==='jsonl';if(_0x41ddcf){const _0x3f4059=[..._0x580830[_0x4833e8(0x98)](_0x20d815=>({..._0x20d815,'type':'folder'})),..._0xb83f5f[_0x4833e8(0x98)](_0x35ddb0=>({..._0x35ddb0,'type':_0x4833e8(0x8f),'url':_0x34d66c(_0x35ddb0['id'])})),..._0x22a4f7['map'](_0x419974=>({..._0x419974,'name':_0x419974[_0x4833e8(0x8a)],'type':_0x4833e8(0x83),'url':_0x46516c(_0x419974['id'])}))][_0x4833e8(0xc1)]((_0x36a5f2,_0x446867)=>_0x36a5f2[_0x4833e8(0x74)][_0x4833e8(0xa6)](_0x446867['name']));await handleSDKOutput(_0x3f4059,_0x490969);}else{if(_0x4f47ab===0x0)console[_0x4833e8(0x6e)](a50_0xd92f28[_0x4833e8(0x9f)]('['+_0x367c6b+']')),console[_0x4833e8(0x6e)](_0x4833e8(0xb9));else{console[_0x4833e8(0x6e)](a50_0xd92f28[_0x4833e8(0x9f)]('['+_0x367c6b+']'));const _0x52e276=formatFlatList(_0x580830,_0xb83f5f,{'showMetadata':!![],'getSegmentUrl':_0x34d66c,'getJourneyUrl':_0x46516c},_0x22a4f7);console[_0x4833e8(0x6e)](_0x52e276);}}return 0x0;}async[a50_0x567586(0xb6)](_0x59d368,_0x8148f7){const _0x3426a0=a50_0x567586,{options:_0x4cbaa2,tdx:_0x485221}=_0x59d368,_0x1cc470=await withSpinner(_0x3426a0(0x78)+_0x8148f7+_0x3426a0(0x86),()=>_0x485221[_0x3426a0(0x8f)][_0x3426a0(0x97)](_0x8148f7),{'verbose':_0x4cbaa2['verbose']}),_0x70d2a6=_0x1cc470[_0x3426a0(0x70)];_0x4cbaa2[_0x3426a0(0x7b)]&&(console[_0x3426a0(0xb8)](_0x3426a0(0xa5)+_0x70d2a6[_0x3426a0(0x89)]),_0x70d2a6[_0x3426a0(0x94)]&&console['error'](_0x3426a0(0xbc)+_0x70d2a6[_0x3426a0(0x94)]));const _0x10319a=_0x4cbaa2['maxDepth']||0xa,_0x5d66b6=await withSpinner(_0x3426a0(0xbf),()=>_0x485221[_0x3426a0(0x8f)]['listRecursive'](_0x70d2a6[_0x3426a0(0x89)],_0x70d2a6[_0x3426a0(0x94)],0x0,_0x10319a),{'verbose':_0x4cbaa2[_0x3426a0(0x7b)]}),_0x37bada=_0x5d66b6[_0x3426a0(0x70)],_0x330d37=_0x3e5cc7=>{const _0x244edb=_0x3426a0;let _0x32a433=0x0,_0x63b4be=0x0,_0x11bbd5=0x0;for(const _0x506ee of _0x3e5cc7){if(_0x506ee[_0x244edb(0x87)]===_0x244edb(0x88))_0x32a433++;else{if(_0x506ee[_0x244edb(0x87)]===_0x244edb(0x8f))_0x63b4be++;else{if(_0x506ee['type']===_0x244edb(0x83))_0x11bbd5++;}}if(_0x506ee[_0x244edb(0x92)]){const _0x486e60=_0x330d37(_0x506ee[_0x244edb(0x92)]);_0x32a433+=_0x486e60[_0x244edb(0xad)],_0x63b4be+=_0x486e60['segments'],_0x11bbd5+=_0x486e60[_0x244edb(0xbb)];}}return{'folders':_0x32a433,'segments':_0x63b4be,'journeys':_0x11bbd5};},_0x1ca64d=_0x330d37(_0x37bada);console['error']('✔\x20Built\x20tree\x20with\x20'+_0x1ca64d[_0x3426a0(0xad)]+_0x3426a0(0x91)+(_0x1ca64d[_0x3426a0(0xad)]!==0x1?'s':'')+',\x20'+_0x1ca64d[_0x3426a0(0xab)]+_0x3426a0(0x81)+(_0x1ca64d[_0x3426a0(0xab)]!==0x1?'s':'')+_0x3426a0(0x7e)+_0x1ca64d[_0x3426a0(0xbb)]+_0x3426a0(0x6f)+(_0x1ca64d[_0x3426a0(0xbb)]!==0x1?'s':''));const _0x7b333c=_0x1ff5a4=>{const _0x5a6161=_0x3426a0;return getConsoleNextUrl(_0x4cbaa2[_0x5a6161(0x93)],_0x5a6161(0x96)+_0x70d2a6[_0x5a6161(0x89)]+_0x5a6161(0x95)+_0x1ff5a4);},_0x3508df=_0x4ca236=>{const _0x444f22=_0x3426a0;return getConsoleNextUrl(_0x4cbaa2[_0x444f22(0x93)],_0x444f22(0x96)+_0x70d2a6[_0x444f22(0x89)]+'/e/'+_0x4ca236+_0x444f22(0x8d));};if(_0x4cbaa2[_0x3426a0(0x9c)]===_0x3426a0(0x90)||_0x4cbaa2[_0x3426a0(0x9c)]===_0x3426a0(0xa8))await handleSDKOutput(_0x37bada,_0x4cbaa2);else{console[_0x3426a0(0x6e)](a50_0xd92f28[_0x3426a0(0x9f)]('['+_0x8148f7+']'));const _0x1c7027=formatTree(_0x37bada,{'showMetadata':!![],'getSegmentUrl':_0x7b333c,'getJourneyUrl':_0x3508df});console[_0x3426a0(0x6e)](_0x1c7027);}return 0x0;}}function a50_0x2977(){const _0x2b73e3=['resolvePathToResource','map','listWithPattern','1827ywPmKP','filter','format','\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.','68604zjcTdw','dim','recursive','\x20matching\x20\x27','replace','Error:\x20','✔\x20Found\x20','Parent\x20ID:\x20','localeCompare','No\x20items\x20match\x20pattern:\x20','jsonl','No\x20folders\x20or\x20segments\x20match\x20','Site:\x20','segments','List\x20folders\x20and\x20child\x20segments','folders','listUnified','Listing\x20folders,\x20segments,\x20and\x20journeys...','Set\x20a\x20parent\x20segment\x20context\x20first:','listUnifiedWithJourneys','path','cause','includes','1932XAPmhY','listRecursive','padEnd','error','(empty)','1430HSkqCV','journeys','Folder\x20ID:\x20','245dTyzyb','2750535iwGGeu','Building\x20hierarchy\x20tree...','test','sort','1015144KKpFpC','70gDIQeo','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','(id\x20','log','\x20journey','data','Folder/pattern\x20arg:\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','length','name','message','105512obHKgS','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Resolving\x20path\x20\x27','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','\x20match','verbose','375792QudeOw','Resolving\x20parent\x20segment\x20\x27',',\x20and\x20','141737MxKmNU',']\x20matching\x20\x27','\x20segment','Parent\x20segment\x20context:\x20','journey','Recursive\x20mode:\x20enabled','execute','\x27...','type','folder','parentId','journeyBundleName','parentSegment','\x5c$&','/j/da','searchByName','segment','json','\x20folder','children','site','folderId','/e/','/app/ps/'];a50_0x2977=function(){return _0x2b73e3;};return a50_0x2977();}
|