@treasuredata/tdx 2026.3.28 → 2026.3.30
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/auth-login-command.js +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-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/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-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/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/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/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/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/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/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/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/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/personalization.js +1 -1
- package/dist/sdk/policy.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.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/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/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/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.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/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/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x334ee0=a39_0x3891;(function(_0x18b918,_0x394685){const _0x4d00bc=a39_0x3891,_0x2f8c3a=_0x18b918();while(!![]){try{const _0x3870ae=-parseInt(_0x4d00bc(0x12e))/0x1+parseInt(_0x4d00bc(0x131))/0x2*(-parseInt(_0x4d00bc(0x15c))/0x3)+-parseInt(_0x4d00bc(0x141))/0x4*(parseInt(_0x4d00bc(0x153))/0x5)+parseInt(_0x4d00bc(0x146))/0x6*(parseInt(_0x4d00bc(0x13d))/0x7)+parseInt(_0x4d00bc(0x148))/0x8*(parseInt(_0x4d00bc(0x11f))/0x9)+-parseInt(_0x4d00bc(0x140))/0xa*(-parseInt(_0x4d00bc(0x13f))/0xb)+-parseInt(_0x4d00bc(0x14f))/0xc*(-parseInt(_0x4d00bc(0x112))/0xd);if(_0x3870ae===_0x394685)break;else _0x2f8c3a['push'](_0x2f8c3a['shift']());}catch(_0x184a40){_0x2f8c3a['push'](_0x2f8c3a['shift']());}}}(a39_0x4557,0x1e29f));function a39_0x4557(){const _0x44cbb7=['13445UXswZv','errorCode','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','journeys','pullSegments','resourceName','helpText','\x20with\x20','3NGSMaq','session','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)','execute','\x0aChanges\x20to\x20\x27','segment:pull','error','dirname','setPhase','cwd','13TSZAPX','\x20\x20🎯\x20','-\x20no\x20files\x20written','file','parentSegment','✔\x20All\x20files\x20are\x20up\x20to\x20date','name','segments','verbose','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20unchanged\x20files','\x20=\x20','dim','9NfSGYu','Parent\x20segment:\x20','\x20files?','\x20activations','data','journeyVersions','activations','hasChanges','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','red','files','parent_segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Target:\x20','dryRun','73291YgHMPd','filter','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','168326ACQidS','cyan','green','\x20\x20🗺️\x20\x20','absolutePath','\x0aError:','site','Pulling\x20segments\x20from\x20\x27','message','isNew','utf-8','relativePath','301882RKpluf','\x20new\x20files','1881QBqFUD','2990rwfFvW','168COksbM','Error:\x20','yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20segments','6TpCyqp','description','1635416BSKNzu','targetDir','Target\x20resource:\x20','type','yellow','counts','\x0aPull\x20summary\x20for\x20\x27','1143132zoMjnu','segment','repeat','length'];a39_0x4557=function(){return _0x44cbb7;};return a39_0x4557();}function a39_0x3891(_0x277103,_0xd0dea9){_0x277103=_0x277103-0x111;const _0x455798=a39_0x4557();let _0x3891c1=_0x455798[_0x277103];return _0x3891c1;}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 a39_0x1bb356 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a39_0x5462f5 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a39_0x334ee0(0x118)]=a39_0x334ee0(0x161);[a39_0x334ee0(0x147)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a39_0x334ee0(0x15f)](_0x330ddf){const _0x3d4508=a39_0x334ee0,{options:_0x436fb5,args:_0x3e1063,tdx:_0x34df4a}=_0x330ddf,_0xe5be=_0x436fb5,_0x953599=await resolveTarget({'arg':_0x3e1063[0x0],'contextParent':_0x436fb5[_0x3d4508(0x116)],'cwd':process[_0x3d4508(0x111)]()});if(!isSuccessfulResolution(_0x953599))return _0x953599[_0x3d4508(0x154)]==='no_parent'?(console[_0x3d4508(0x162)](a39_0x1bb356['yellow'](_0x3d4508(0x127))),console['error'](_0x3d4508(0x15e)),console[_0x3d4508(0x162)](_0x3d4508(0x144)),console['error'](_0x3d4508(0x156))):(console['error'](a39_0x1bb356[_0x3d4508(0x128)](_0x3d4508(0x142)+_0x953599[_0x3d4508(0x139)]+'\x0a')),_0x953599[_0x3d4508(0x15a)]&&console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x132)](_0x953599[_0x3d4508(0x15a)]))),0x1;const _0x379e10=_0x953599[_0x3d4508(0x155)],_0x12ccaf=_0x953599[_0x3d4508(0x149)],_0x308426=_0x953599[_0x3d4508(0x14b)]===_0x3d4508(0x115)?_0x953599[_0x3d4508(0x159)]:undefined;_0xe5be[_0x3d4508(0x11a)]&&(console[_0x3d4508(0x162)]('Site:\x20'+_0xe5be[_0x3d4508(0x137)]),console['error'](_0x3d4508(0x120)+_0x379e10),_0x308426&&console[_0x3d4508(0x162)](_0x3d4508(0x14a)+_0x308426));const _0x1567d1=await withProgressSpinner(_0x3d4508(0x138)+_0x379e10+'\x27...',_0x396c85=>_0x34df4a[_0x3d4508(0x150)][_0x3d4508(0x158)](_0x379e10,{'targetDir':_0x12ccaf,'targetResourceName':_0x308426,'verbose':_0xe5be[_0x3d4508(0x11a)],'progress':{'update':_0x903cb9=>{const _0x2ccb60=_0x3d4508;_0x396c85[_0x2ccb60(0x164)](_0x903cb9),_0xe5be[_0x2ccb60(0x11a)]&&console[_0x2ccb60(0x162)]('\x20\x20'+_0x903cb9);}}}),{'verbose':_0xe5be[_0x3d4508(0x11a)]}),_0x5bd5a8=_0x1567d1[_0x3d4508(0x123)];if(_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x119)]===0x0&&_0x5bd5a8[_0x3d4508(0x14d)]['journeys']===0x0)return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x14c)](_0x3d4508(0x11b)+_0x5bd5a8['parentName']+'\x27')),0x0;const _0x217ac3=_0x5bd5a8[_0x3d4508(0x129)][_0x3d4508(0x12f)](_0x5e5280=>_0x5e5280[_0x3d4508(0x13a)]),_0x2400d6=_0x5bd5a8[_0x3d4508(0x129)][_0x3d4508(0x12f)](_0x43e25f=>!_0x43e25f[_0x3d4508(0x13a)]&&_0x43e25f['hasChanges']),_0x14b305=_0x5bd5a8[_0x3d4508(0x129)][_0x3d4508(0x12f)](_0x3d5db8=>!_0x3d5db8[_0x3d4508(0x13a)]&&!_0x3d5db8[_0x3d4508(0x126)]);console[_0x3d4508(0x162)](_0x3d4508(0x14e)+_0x5bd5a8[_0x3d4508(0x155)]+'\x27:'),console[_0x3d4508(0x162)](_0x3d4508(0x113)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x119)]+_0x3d4508(0x145))+_0x3d4508(0x15b)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x125)]+_0x3d4508(0x122)));if(_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x157)]>0x0){const _0x39ab8c=_0x5bd5a8['counts']['journeyVersions']>_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x157)]?'\x20('+_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x124)]+'\x20versions)':'';console[_0x3d4508(0x162)](_0x3d4508(0x134)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x157)]+'\x20journeys')+a39_0x1bb356['dim'](_0x39ab8c));}console['error']('\x20\x20'+a39_0x1bb356['green']('+\x20'+_0x217ac3[_0x3d4508(0x152)]+_0x3d4508(0x13e))),console[_0x3d4508(0x162)]('\x20\x20'+a39_0x1bb356[_0x3d4508(0x14c)]('~\x20'+_0x2400d6[_0x3d4508(0x152)]+'\x20changed\x20files')),console[_0x3d4508(0x162)]('\x20\x20'+a39_0x1bb356[_0x3d4508(0x11e)]('=\x20'+_0x14b305[_0x3d4508(0x152)]+_0x3d4508(0x11c))),console[_0x3d4508(0x162)](_0x3d4508(0x12c)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x149)])+'\x0a');if(_0x2400d6[_0x3d4508(0x152)]>0x0)for(const _0x4b8513 of _0x2400d6){console[_0x3d4508(0x162)](_0x3d4508(0x160)+_0x4b8513[_0x3d4508(0x13c)]+'\x27:'),console[_0x3d4508(0x162)]('─'[_0x3d4508(0x151)](0x3c)),console['error'](_0x4b8513['diff']),console[_0x3d4508(0x162)]('─'['repeat'](0x3c));}if(_0xe5be[_0x3d4508(0x12d)])return console[_0x3d4508(0x162)](a39_0x1bb356['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x217ac3[_0x3d4508(0x152)]===0x0&&_0x2400d6[_0x3d4508(0x152)]===0x0)return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x133)](_0x3d4508(0x117))),saveSessionContext({'parent_segment':_0x5bd5a8['parentName']},_0xe5be[_0x3d4508(0x15d)]),console['error'](a39_0x1bb356[_0x3d4508(0x133)]('✔\x20Context\x20set:\x20'+a39_0x1bb356[_0x3d4508(0x11e)]('parent_segment')+_0x3d4508(0x11d)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8['parentName']))),0x0;if(!_0xe5be[_0x3d4508(0x143)]){if(!isInteractive())return console['error'](a39_0x1bb356['red'](_0x3d4508(0x136)),_0x3d4508(0x130)),console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x11e)](_0x3d4508(0x12b))),0x1;const _0x5680e0=await confirmKey('Write\x20'+(_0x217ac3[_0x3d4508(0x152)]+_0x2400d6[_0x3d4508(0x152)])+_0x3d4508(0x121));if(!_0x5680e0)return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x14c)]('Aborted.'),_0x3d4508(0x114)),0x1;}for(const _0x7bfb88 of _0x5bd5a8[_0x3d4508(0x129)]){if(_0x7bfb88[_0x3d4508(0x13a)]||_0x7bfb88[_0x3d4508(0x126)]){const _0x417541=a39_0x5462f5[_0x3d4508(0x163)](_0x7bfb88[_0x3d4508(0x135)]);!existsSync(_0x417541)&&mkdirSync(_0x417541,{'recursive':!![]}),writeFileSync(_0x7bfb88['absolutePath'],_0x7bfb88['content'],_0x3d4508(0x13b));}}return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x133)]('✔\x20Pulled\x20'+(_0x217ac3[_0x3d4508(0x152)]+_0x2400d6[_0x3d4508(0x152)])+'\x20files\x20to\x20'+_0x5bd5a8[_0x3d4508(0x149)])),saveSessionContext({'parent_segment':_0x5bd5a8[_0x3d4508(0x155)]},_0xe5be['session']),console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x133)]('✔\x20Context\x20set:\x20'+a39_0x1bb356[_0x3d4508(0x11e)](_0x3d4508(0x12a))+_0x3d4508(0x11d)+a39_0x1bb356['cyan'](_0x5bd5a8[_0x3d4508(0x155)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x39d805=a40_0x13d1;(function(_0x1e63e3,_0x59250d){const _0x33933a=a40_0x13d1,_0x218dbb=_0x1e63e3();while(!![]){try{const _0x28078a=-parseInt(_0x33933a(0x1d0))/0x1*(parseInt(_0x33933a(0x201))/0x2)+-parseInt(_0x33933a(0x1ad))/0x3*(-parseInt(_0x33933a(0x21c))/0x4)+-parseInt(_0x33933a(0x18c))/0x5+-parseInt(_0x33933a(0x213))/0x6+-parseInt(_0x33933a(0x1de))/0x7*(parseInt(_0x33933a(0x1a4))/0x8)+parseInt(_0x33933a(0x1b0))/0x9*(parseInt(_0x33933a(0x210))/0xa)+-parseInt(_0x33933a(0x1b3))/0xb*(-parseInt(_0x33933a(0x206))/0xc);if(_0x28078a===_0x59250d)break;else _0x218dbb['push'](_0x218dbb['shift']());}catch(_0x480aa6){_0x218dbb['push'](_0x218dbb['shift']());}}}(a40_0x2abd,0x65233));function a40_0x13d1(_0x4327dc,_0xae7e89){_0x4327dc=_0x4327dc-0x189;const _0x2abd7d=a40_0x2abd();let _0x13d1a1=_0x2abd7d[_0x4327dc];return _0x13d1a1;}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 a40_0x4837c3 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';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';function a40_0x2abd(){const _0x48716f=['\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','281270fUmaYd','\x0a✔\x20Push\x20complete','filter','176490FSmvWd','isNew','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20updated','\x0aError:','helpText','Push\x20','filePath','parentFolder','20yyLCer','listJourneysWithDetailsFromParentSegment','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','changed','created','idToName','no_parent','segments','476955FDesIy','\x20unchanged','audienceId','/sb/da/esr','createdSegmentIds','Aborted.','results','journeys','\x0aPush\x20summary\x20for\x20\x27','\x20\x20📊\x20Segments:','journeyBundleName','\x20changed','endsWith','folderId','map','type','Delete\x20segment:','\x20new','\x20\x20Journeys:\x20','updated','verbose','Parent\x20segment:\x20','getParent','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','848vcZtvO','green','repeat','nameToId','user','data','Error\x20parsing\x20YAML:\x20','segmentFolderId','description','464451QoIVcm','resolveParentId','journeyId','45yQccsF','journeysOnly','attributes','66iBAmVD','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','length','yellow','blue','versionNumber','\x20to\x20delete','existingSegment','yamlConfig','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20','delete','Folders\x20to\x20create:','Source\x20directory:\x20','push','updatedAt','cyan','deleted','setPhase','/app/ps/','Resolving\x20parent\x20segment\x20\x27','message','\x20\x20\x20\x20','journey','dim','\x20activations]','site','New\x20journey:','\x20\x20🗺️\x20\x20Journeys:','1sKboOu','listSegments','parent_name','Site:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','paused','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','all','join','Scoped\x20to\x20folder:\x20','\x20deleted','folderPath','segment:push','Error:\x20Directory\x20not\x20found:\x20','20237MHICmy','existingJourney','listActivations','\x20to\x20create','/e/','Fetching\x20existing\x20data...','toDelete','toCreate','folders','\x20\x20Activations:','error','\x0aValidation\x20failed:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','buildUserMaps','segment\x20or\x20journey','new','listFolders','New\x20segment:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Changes\x20to:','\x27...','name','No\x20','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)','journeyBundleId','set','📁\x20','\x20folders\x20to\x20create','red','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','createdAt','scopedFolderPath','737434CRYGDV','execute','unchanged','\x20changes?','activations','599016TQxGfS','then','segment','nameToType','diff','\x20created','.yml','get','Preparing\x20journeys...'];a40_0x2abd=function(){return _0x48716f;};return a40_0x2abd();}export class SegmentPushCommand extends BaseCommand{[a40_0x39d805(0x1f6)]=a40_0x39d805(0x1dc);[a40_0x39d805(0x1ac)]=a40_0x39d805(0x1b4);async[a40_0x39d805(0x202)](_0x32fb42){const _0x1bcdc1=a40_0x39d805,{options:_0x30611c,args:_0x5e3b2d,tdx:_0x42cfdb}=_0x32fb42,_0x31bcea=_0x30611c,_0x52e1bb=await resolveTarget({'arg':_0x5e3b2d[0x0],'contextParent':_0x30611c['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x52e1bb))return _0x52e1bb['errorCode']===_0x1bcdc1(0x18a)?(console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1d4))),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1f8)),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1ea)),console[_0x1bcdc1(0x1e8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a40_0x4837c3['red'](_0x1bcdc1(0x1bd)+_0x52e1bb[_0x1bcdc1(0x1c8)]+'\x0a')),_0x52e1bb[_0x1bcdc1(0x218)]&&console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x52e1bb[_0x1bcdc1(0x218)]))),0x1;if(_0x52e1bb[_0x1bcdc1(0x19b)]===_0x1bcdc1(0x1d2))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1dd)+_0x52e1bb['targetDir']+'\x0a')),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1c3)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xcc4312=_0x52e1bb['parentName'],_0x19284e=_0x52e1bb['targetDir'],_0x47bc84=_0x52e1bb[_0x1bcdc1(0x19b)]==='file'?_0x52e1bb[_0x1bcdc1(0x21a)]:undefined,_0x5c905b=getScopedDetails(_0x52e1bb),_0x124606=_0x5c905b?.['isScoped']??![],_0x37bd7c=_0x5c905b?.[_0x1bcdc1(0x200)]??'';if(!existsSync(_0x19284e))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1dd)+_0x19284e+'\x0a')),console[_0x1bcdc1(0x1e8)](a40_0x4837c3['cyan'](_0x1bcdc1(0x1a3))),0x1;_0x31bcea[_0x1bcdc1(0x1a0)]&&(console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1d3)+_0x31bcea[_0x1bcdc1(0x1cd)]),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1a1)+_0xcc4312),console['error'](_0x1bcdc1(0x1c0)+_0x19284e),_0x124606&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1d9)+_0x37bd7c));const _0x546640=await withSpinner(_0x1bcdc1(0x1c7)+_0xcc4312+_0x1bcdc1(0x1f5),()=>_0x42cfdb[_0x1bcdc1(0x208)][_0x1bcdc1(0x1ae)](_0xcc4312),{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]}),_0x3238ce=_0x546640[_0x1bcdc1(0x1a9)],{parentSegmentResult:_0x2c7464,segmentsResult:_0x372d83,foldersResult:_0x1917b6,journeysWithDetailsResult:_0x1f9c40,userMaps:_0x31b8ed}=await withSpinner(_0x1bcdc1(0x1e3),async()=>{const _0x22f16d=_0x1bcdc1,[_0x230827,_0x255dc3,_0x43c163,_0x46a11a,_0x49a25f]=await Promise[_0x22f16d(0x1d7)]([_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1a2)](_0x3238ce),_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1d1)](_0x3238ce),_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1f1)](_0x3238ce),_0x42cfdb[_0x22f16d(0x1ca)][_0x22f16d(0x21d)](_0x3238ce,{'includeAllVersions':!![]}),_0x42cfdb[_0x22f16d(0x1a8)][_0x22f16d(0x1ee)]()]);return{'parentSegmentResult':_0x230827,'segmentsResult':_0x255dc3,'foldersResult':_0x43c163,'journeysWithDetailsResult':_0x46a11a,'userMaps':_0x49a25f};},{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]})['then'](_0x4ec8aa=>_0x4ec8aa[_0x1bcdc1(0x1a9)]),_0x26fd00=_0x2c7464,_0x108e70=extractRootFolderId(_0x26fd00),_0x45ffa8=_0x372d83,_0x22b156=_0x1917b6,{journeys:_0x4d1f95,activationStepsById:_0x572606}=_0x1f9c40,_0x53e8c3=new Map(_0x4d1f95[_0x1bcdc1(0x19a)](_0x34b3e9=>[_0x34b3e9['id'],_0x34b3e9])),_0x2dc2bb=_0x4d1f95[_0x1bcdc1(0x19a)](_0x297e3b=>({'id':_0x297e3b['id'],'name':_0x297e3b['attributes'][_0x1bcdc1(0x1f6)],'journeyBundleName':_0x297e3b['attributes'][_0x1bcdc1(0x196)]||'','journeyBundleId':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1f9)]||'','versionNumber':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1b8)],'description':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1ac)],'state':_0x297e3b['attributes']['state'],'paused':_0x297e3b['attributes'][_0x1bcdc1(0x1d5)],'audienceId':_0x297e3b['attributes'][_0x1bcdc1(0x18e)],'folderId':_0x297e3b['relationships']?.[_0x1bcdc1(0x21b)]?.[_0x1bcdc1(0x1a9)]?.['id'],'createdAt':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1ff)],'updatedAt':_0x297e3b['attributes'][_0x1bcdc1(0x1c2)]})),{emailToId:_0x185af7,idToEmail:_0x206cde}=_0x31b8ed,_0x1e11c3=await withSpinner(_0x1bcdc1(0x1ec),async()=>{const _0x3e3ba2=await _0x42cfdb['connection']['list']();return buildConnectionMaps(_0x3e3ba2);},{'verbose':_0x31bcea['verbose']})[_0x1bcdc1(0x207)](_0x4121fa=>_0x4121fa['data']),_0x2f9d3f=_0x1e11c3[_0x1bcdc1(0x1a7)],_0x51d8ce=_0x1e11c3[_0x1bcdc1(0x189)],_0x1e02e8=_0x1e11c3[_0x1bcdc1(0x209)],_0x4b6f2b={'emailToIdMap':_0x185af7,'connectionNameToIdMap':_0x2f9d3f,'connectionNameToTypeMap':_0x1e02e8,'getSchema':_0x3aefad=>_0x42cfdb['connection']['getOutputSchemaWithCache'](_0x3aefad)};let {pathToId:_0xf45865,idToPath:_0x4a8924}=buildFolderMaps(_0x22b156);const _0x174575=buildSegmentLookupMap(_0x45ffa8,_0x4a8924),_0x12a00b=buildSegmentNameToIdMap(_0x45ffa8),_0x23cb83=buildJourneyBundleLookupMap(_0x2dc2bb,_0x4a8924);let _0x3a58d4;if(_0x47bc84){if(!_0x47bc84[_0x1bcdc1(0x198)](_0x1bcdc1(0x20c))&&!_0x47bc84[_0x1bcdc1(0x198)]('.yaml'))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x21e)+_0x47bc84+'\x0a')),0x1;_0x3a58d4=[_0x47bc84];}else _0x3a58d4=findYamlFiles(_0x19284e);if(_0x3a58d4[_0x1bcdc1(0x1b5)]===0x0)return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1eb)+_0x19284e+'\x0a')),console['error'](a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1bcdc1(0x1ed))),0x1;let _0x32fdda,_0x1406b9;try{const _0x30e730=parseAndClassifyYamlFiles(_0x3a58d4,_0x19284e,{'skipSegments':_0x31bcea['journeysOnly']});_0x32fdda=_0x30e730[_0x1bcdc1(0x18b)],_0x1406b9=_0x30e730[_0x1bcdc1(0x193)];const _0x527a03=validateParsedFiles(_0x30e730,_0x19284e);if(_0x527a03[_0x1bcdc1(0x1b5)]>0x0)return console['error'](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1e9))),console['error'](formatValidationErrors(_0x527a03)),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x123f56){return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1aa)+(_0x123f56 instanceof Error?_0x123f56['message']:_0x123f56))),0x1;}if(_0x32fdda['length']===0x0&&_0x1406b9[_0x1bcdc1(0x1b5)]===0x0){const _0x1322c5=_0x31bcea['journeysOnly']?_0x1bcdc1(0x1ca):_0x1bcdc1(0x1ef);return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1f7)+_0x1322c5+'\x20YAML\x20files\x20found')),0x0;}const _0x2fa760=new Map();_0x45ffa8[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x45ffa8,async _0x5e1bb4=>{const _0x3c8d9d=a40_0x13d1,_0x380ca0=await _0x42cfdb[_0x3c8d9d(0x208)][_0x3c8d9d(0x1e0)](_0x3238ce,_0x5e1bb4['id']);_0x2fa760[_0x3c8d9d(0x1fa)](_0x5e1bb4['id'],_0x380ca0);});},{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]});const {segmentFiles:_0x3e2e0b,foldersToCreate:_0x4fb853}=await prepareSegmentFiles(_0x32fdda,{'segmentByFolderAndName':_0x174575,'activationsBySegmentId':_0x2fa760,'folderPathToId':_0xf45865,'idToEmailMap':_0x206cde,'connectionIdToNameMap':_0x51d8ce},_0x4b6f2b,_0x124606,_0x37bd7c),_0x5b7dba=_0x47bc84?[]:findSegmentsToDelete(_0x45ffa8,_0x32fdda['map'](({yamlConfig:_0xb99739,folderPath:_0x400005})=>({'yamlConfig':_0xb99739,'folderPath':resolveTDFolderPath(_0x400005,_0x124606,_0x37bd7c)})),_0x4a8924,_0x37bd7c,_0x124606),{journeyFiles:_0x24e58a,foldersToCreate:_0x2d024a}=await withProgressSpinner(_0x1bcdc1(0x20e),async _0x64ea93=>prepareJourneyFiles(_0x1406b9,{'fetchJourney':async _0x3cfade=>_0x42cfdb[_0x1bcdc1(0x1ca)]['getJourney'](_0x3cfade[_0x1bcdc1(0x1af)]),'journeyBundlesByFolderAndName':_0x23cb83,'folderPathToId':_0xf45865,'idToEmailMap':_0x206cde,'connectionIdToNameMap':_0x51d8ce,'existingSegments':_0x45ffa8,'parentId':_0x3238ce,'deps':_0x42cfdb,'progress':{'update':_0x2b399c=>{const _0x384b2c=_0x1bcdc1;_0x64ea93[_0x384b2c(0x1c5)](_0x2b399c),_0x31bcea[_0x384b2c(0x1a0)]&&console[_0x384b2c(0x1e8)]('\x20\x20'+_0x2b399c);}},'journeyById':_0x53e8c3,'activationStepsById':_0x572606},_0x124606,_0x37bd7c),{'verbose':_0x31bcea['verbose']})[_0x1bcdc1(0x207)](_0x4a0a91=>_0x4a0a91[_0x1bcdc1(0x1a9)]);for(const _0x37ba19 of _0x2d024a){_0x4fb853['add'](_0x37ba19);}const _0x38b090=_0x47bc84?[]:findJourneysToDelete(_0x2dc2bb,_0x1406b9[_0x1bcdc1(0x19a)](({yamlConfig:_0x3b9c24,folderPath:_0x30d8f8})=>({'yamlConfig':_0x3b9c24,'folderPath':resolveTDFolderPath(_0x30d8f8,_0x124606,_0x37bd7c)})),_0x4a8924,_0x37bd7c,_0x124606),_0x3bfc94=calculatePushStats(_0x3e2e0b,_0x24e58a,_0x4fb853,_0x5b7dba,_0x38b090,!!_0x31bcea[_0x1bcdc1(0x1be)],!!_0x31bcea[_0x1bcdc1(0x1b1)]),_0x13c798=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x1f0)],_0x82e2ca=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x21f)],_0x4d1006=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x203)],_0xf76b87=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x1e4)],_0x1490d9=_0x3bfc94[_0x1bcdc1(0x1e6)][_0x1bcdc1(0x1e5)],_0x5e97c3=_0x3bfc94[_0x1bcdc1(0x193)][_0x1bcdc1(0x1f0)],_0x264b3b=_0x3bfc94[_0x1bcdc1(0x193)]['changed'],_0x4acd5b=_0x3bfc94[_0x1bcdc1(0x193)]['unchanged'],_0x3fb1be=_0x3bfc94['journeys']['toDelete'],_0x187096=_0x3bfc94[_0x1bcdc1(0x205)][_0x1bcdc1(0x1d7)],_0x8d97ac=_0x3bfc94['activations'][_0x1bcdc1(0x1e5)],_0x3a3b99=_0x3bfc94[_0x1bcdc1(0x205)]['toUpdate'],_0x49eeeb=_0x3bfc94['activations']['toDelete'];console['error'](_0x1bcdc1(0x194)+_0xcc4312+'\x27:');_0x1490d9[_0x1bcdc1(0x1b5)]>0x0&&console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1b7)](_0x1bcdc1(0x1fb)+_0x1490d9[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1fc)));if(!_0x31bcea[_0x1bcdc1(0x1b1)]){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x195)),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['green']('+\x20'+_0x13c798['length']+_0x1bcdc1(0x19d))),console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x82e2ca['length']+_0x1bcdc1(0x197)));if(_0xf76b87['length']>0x0)console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['red']('-\x20'+_0xf76b87[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9)));else _0x5b7dba[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea['delete']&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)](_0x5b7dba[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x20f)));console[_0x1bcdc1(0x1e8)]('\x20\x20\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1cb)]('=\x20'+_0x4d1006[_0x1bcdc1(0x1b5)]+'\x20unchanged'));}if(_0x24e58a[_0x1bcdc1(0x1b5)]>0x0||_0x38b090[_0x1bcdc1(0x1b5)]>0x0){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1cf)),console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1a5)]('+\x20'+_0x5e97c3[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x19d))),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x264b3b[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x197)));if(_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0)console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['red']('-\x20'+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9)));else _0x38b090[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1be)]&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)](_0x38b090[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x20f)));console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)]('=\x20'+_0x4acd5b['length']+_0x1bcdc1(0x18d)));}_0x187096[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&(console[_0x1bcdc1(0x1e8)](''),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1e7)),_0x8d97ac[_0x1bcdc1(0x1b5)]>0x0&&console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1a5)]('+\x20'+_0x8d97ac[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1e1))),_0x3a3b99['length']>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x3a3b99['length']+'\x20to\x20update')),_0x49eeeb['length']>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1fd)]('-\x20'+_0x49eeeb[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9))));console[_0x1bcdc1(0x1e8)]('\x20\x20Source:\x20'+a40_0x4837c3['cyan'](_0x19284e)+'\x0a');if(_0x1490d9[_0x1bcdc1(0x1b5)]>0x0){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1bf));for(const _0x31740b of _0x1490d9){console['error']('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1b7)]('+')+'\x20'+_0x31740b);}console[_0x1bcdc1(0x1e8)]('');}if(_0x13c798['length']>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x205286 of _0x13c798){const _0x389f96=_0x205286[_0x1bcdc1(0x1db)]?_0x205286['folderPath']+'/'+_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]:_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)],_0x161b7f=_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x205)]?.['length']||0x0,_0x2c9e9d=_0x161b7f>0x0?a40_0x4837c3['dim']('\x20['+_0x161b7f+_0x1bcdc1(0x1cc)):'';console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x1f2))+'\x20'+_0x389f96+_0x2c9e9d),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c)),_0x205286[_0x1bcdc1(0x20a)]&&console[_0x1bcdc1(0x1e8)](_0x205286['diff']),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c));}if(_0xf76b87[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x5570bc of _0xf76b87){const _0x4c73de=_0x5570bc['segmentFolderId']?_0x4a8924[_0x1bcdc1(0x20d)](_0x5570bc[_0x1bcdc1(0x1ab)]['toString']())||'':'',_0xfc70c8=_0x4c73de?_0x4c73de+'/'+_0x5570bc[_0x1bcdc1(0x1f6)]:_0x5570bc[_0x1bcdc1(0x1f6)],_0x4dcbdf=_0x2fa760[_0x1bcdc1(0x20d)](_0x5570bc['id'])||[],_0x43cc01=_0x4dcbdf[_0x1bcdc1(0x1b5)]>0x0?a40_0x4837c3['dim']('\x20['+_0x4dcbdf['length']+_0x1bcdc1(0x1cc)):'';console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3['red'](_0x1bcdc1(0x19c))+'\x20'+_0xfc70c8+_0x43cc01),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c));const _0x37e9b3=segmentWithActivationsToYaml(_0x5570bc,_0x4dcbdf,undefined,_0x206cde,_0x51d8ce),_0x473231=segmentToYamlString(_0x37e9b3),_0x1f8546=generateDiff(_0x473231,'');console[_0x1bcdc1(0x1e8)](formatDiffWithColors(_0x1f8546)),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c));}const _0x505e8e=_0x3e2e0b[_0x1bcdc1(0x212)](_0x1c58eb=>!_0x1c58eb['isNew']&&_0x1c58eb[_0x1bcdc1(0x20a)]);if(_0x505e8e[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x45a68a of _0x505e8e){const _0x31985c=_0x45a68a[_0x1bcdc1(0x1db)]?_0x45a68a[_0x1bcdc1(0x1db)]+'/'+_0x45a68a['yamlConfig'][_0x1bcdc1(0x1f6)]:_0x45a68a['yamlConfig'][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1f4))+'\x20'+_0x31985c),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](_0x45a68a[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c));}if(_0x5e97c3[_0x1bcdc1(0x1b5)]>0x0)for(const _0xd69c25 of _0x5e97c3){const _0x35e55a=_0xd69c25[_0x1bcdc1(0x1db)]?_0xd69c25[_0x1bcdc1(0x1db)]+'/'+_0xd69c25[_0x1bcdc1(0x1bb)]['name']:_0xd69c25[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x1ce))+'\x20'+_0x35e55a),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),_0xd69c25[_0x1bcdc1(0x20a)]&&console['error'](_0xd69c25[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c));}const _0x5b2e89=_0x24e58a[_0x1bcdc1(0x212)](_0x465074=>!_0x465074[_0x1bcdc1(0x214)]&&_0x465074[_0x1bcdc1(0x20a)]);if(_0x5b2e89[_0x1bcdc1(0x1b5)]>0x0)for(const _0x2127df of _0x5b2e89){const _0x18f78b=_0x2127df[_0x1bcdc1(0x1db)]?_0x2127df[_0x1bcdc1(0x1db)]+'/'+_0x2127df[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]:_0x2127df[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1b6)]('Changes\x20to\x20journey:')+'\x20'+_0x18f78b),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](_0x2127df[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c));}if(_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0)for(const _0x454b0e of _0x3fb1be){const _0x376453=_0x454b0e['folderId']?_0x4a8924[_0x1bcdc1(0x20d)](_0x454b0e[_0x1bcdc1(0x199)])||'':'',_0x246c99=_0x376453?_0x376453+'/'+_0x454b0e[_0x1bcdc1(0x196)]:_0x454b0e['journeyBundleName'];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1fd)]('Delete\x20journey:')+'\x20'+_0x246c99),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x1bcdc1(0x1a6)](0x3c));}if(_0x31bcea['dryRun'])return console['error'](a40_0x4837c3[_0x1bcdc1(0x1b6)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x9ce6f4=_0x31bcea[_0x1bcdc1(0x1b1)]?![]:_0x13c798[_0x1bcdc1(0x1b5)]>0x0||_0x82e2ca[_0x1bcdc1(0x1b5)]>0x0||_0xf76b87['length']>0x0,_0xfa84e=_0x5e97c3[_0x1bcdc1(0x1b5)]>0x0||_0x264b3b[_0x1bcdc1(0x1b5)]>0x0||_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0,_0x153e12=_0x31bcea[_0x1bcdc1(0x1b1)]?![]:_0x187096['length']>0x0,_0x177f5c=_0x1490d9[_0x1bcdc1(0x1b5)]>0x0;if(!_0x9ce6f4&&!_0xfa84e&&!_0x153e12&&!_0x177f5c){const _0x38f166=_0x31bcea[_0x1bcdc1(0x1b1)]?_0x1bcdc1(0x215):_0x1bcdc1(0x1fe);console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x38f166));if(_0x47bc84&&_0x4d1006[_0x1bcdc1(0x1b5)]===0x1){const _0x469a29=_0x4d1006[0x0];if(_0x469a29['existingSegment']?.['id']){const _0x25f2d9=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],_0x1bcdc1(0x1c6)+_0x3238ce+'/e/'+_0x469a29[_0x1bcdc1(0x1ba)]['id']+'/sb/da/esr');console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1f3)+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x25f2d9));}}if(_0x47bc84&&_0x4acd5b[_0x1bcdc1(0x1b5)]===0x1){const _0x248e34=_0x4acd5b[0x0];if(_0x248e34['existingJourney']?.['id']){const _0x5c1d8c=getConsoleNextUrl(_0x31bcea['site'],_0x1bcdc1(0x1c6)+_0x3238ce+'/e/'+_0x248e34[_0x1bcdc1(0x1df)]['id']+'/j/da/je');console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x5c1d8c));}}return 0x0;}const _0x5b5f0a=_0x31bcea[_0x1bcdc1(0x1b1)]?_0x5e97c3['length']+_0x264b3b[_0x1bcdc1(0x1b5)]+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1490d9[_0x1bcdc1(0x1b5)]:_0x13c798[_0x1bcdc1(0x1b5)]+_0x82e2ca[_0x1bcdc1(0x1b5)]+_0xf76b87[_0x1bcdc1(0x1b5)]+_0x5e97c3[_0x1bcdc1(0x1b5)]+_0x264b3b['length']+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1490d9[_0x1bcdc1(0x1b5)]+_0x187096[_0x1bcdc1(0x1b5)];if(!_0x31bcea['yes']&&_0x5b5f0a>0x0){if(!isInteractive())return console['error'](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x217)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1bcdc1(0x1e8)](a40_0x4837c3['dim'](_0x1bcdc1(0x1bc))),0x1;const _0x3b8d66=await confirmKey(_0x1bcdc1(0x219)+_0x5b5f0a+_0x1bcdc1(0x204));if(!_0x3b8d66)return console[_0x1bcdc1(0x1e8)](a40_0x4837c3['yellow'](_0x1bcdc1(0x191))),0x1;}const _0x22224f={'withProgress':async(_0x46a6c6,_0x4bc09b)=>{const _0x564547=_0x1bcdc1,_0x1d0d88=await withSpinner(_0x46a6c6,_0x4bc09b,{'verbose':_0x31bcea[_0x564547(0x1a0)]});return{'data':_0x1d0d88[_0x564547(0x1a9)]};},'logInfo':_0x5332c1=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3['blue']('✔\x20'+_0x5332c1)),'logSuccess':_0x2fe6f3=>console['error'](a40_0x4837c3[_0x1bcdc1(0x1a5)]('✔\x20'+_0x2fe6f3)),'logWarning':_0x4fda3e=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)]('⚠\x20'+_0x4fda3e)),'logDeleted':_0x5f5cbb=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)]('✔\x20'+_0x5f5cbb))},_0x23a61a={'segment':_0x42cfdb[_0x1bcdc1(0x208)],'journey':_0x42cfdb[_0x1bcdc1(0x1ca)],'user':_0x42cfdb[_0x1bcdc1(0x1a8)],'connection':_0x42cfdb['connection']};_0x1490d9['length']>0x0&&(_0xf45865=await executePushFolders(_0x23a61a,_0x1490d9,_0xf45865,{'parentId':_0x3238ce},_0x22224f));const _0x321cff={'rootFolderId':_0x108e70,'folderPathToId':_0xf45865,'folderIdToPath':_0x4a8924,'segmentNameToId':_0x12a00b,'activationsBySegmentId':_0x2fa760,'emailToIdMap':_0x185af7,'idToEmailMap':_0x206cde,'connectionNameToIdMap':_0x1e11c3['nameToId'],'connectionIdToNameMap':_0x1e11c3[_0x1bcdc1(0x189)],'connectionNameToTypeMap':_0x1e02e8},_0x30aed2=await executePushSegments(_0x23a61a,_0x31bcea[_0x1bcdc1(0x1b1)]?[]:_0x3e2e0b,_0x321cff,{'parentId':_0x3238ce},_0x22224f),_0x26da45=_0x30aed2['created'],_0x23ea77=_0x30aed2[_0x1bcdc1(0x19f)],_0x870350=_0x30aed2[_0x1bcdc1(0x205)]['created'],_0x9b57cf=_0x30aed2[_0x1bcdc1(0x205)]['updated'],_0x2e1f64=_0x30aed2['activations'][_0x1bcdc1(0x1c4)];let _0x1b9846;if(_0x47bc84&&_0x3e2e0b[_0x1bcdc1(0x1b5)]===0x1){const _0x1a0b48=_0x3e2e0b[0x0];_0x1b9846=_0x1a0b48['existingSegment']?.['id']??_0x30aed2[_0x1bcdc1(0x190)][_0x1bcdc1(0x20d)](_0x1a0b48[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]);}const _0x3ae8de=await executePushSegmentDeletions(_0x23a61a,_0x31bcea['journeysOnly']?[]:_0xf76b87,_0x22224f);let _0x35e863=0x0,_0x2b18e4=0x0,_0x32c02e=0x0;const _0x33ab66=new Map(_0x12a00b);for(const [_0x7cbd83,_0x20ff54]of _0x30aed2['createdSegmentIds']){_0x33ab66[_0x1bcdc1(0x1fa)](_0x7cbd83,_0x20ff54);}if(_0x24e58a[_0x1bcdc1(0x1b5)]>0x0){const _0x180a07={..._0x321cff,'segmentNameToId':_0x33ab66,'existingSegments':_0x45ffa8,'activationContext':_0x4b6f2b},_0x38871f=await executePushJourneys(_0x23a61a,_0x24e58a,_0x180a07,{'parentId':_0x3238ce,'rootFolderId':_0x108e70,'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]},_0x22224f);_0x35e863=_0x38871f[_0x1bcdc1(0x220)],_0x2b18e4=_0x38871f['updated'];if(_0x47bc84&&_0x38871f[_0x1bcdc1(0x192)][_0x1bcdc1(0x1b5)]===0x1){const _0x290c77=_0x38871f[_0x1bcdc1(0x192)][0x0];if(_0x290c77[_0x1bcdc1(0x1af)]){const _0x1ecb2e=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],'/app/ps/'+_0x3238ce+_0x1bcdc1(0x1e2)+_0x290c77['journeyId']+'/j/da/je');console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1ecb2e));}}}for(const _0x468889 of _0x3fb1be){console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1d6)+_0x468889[_0x1bcdc1(0x196)])),_0x32c02e++;}const _0x4ccaae=[];if(_0x26da45>0x0)_0x4ccaae[_0x1bcdc1(0x1c1)](_0x26da45+_0x1bcdc1(0x20b));if(_0x23ea77>0x0)_0x4ccaae['push'](_0x23ea77+_0x1bcdc1(0x216));if(_0x3ae8de>0x0)_0x4ccaae[_0x1bcdc1(0x1c1)](_0x3ae8de+_0x1bcdc1(0x1da));const _0x444ae0=[];if(_0x35e863>0x0)_0x444ae0[_0x1bcdc1(0x1c1)](_0x35e863+_0x1bcdc1(0x20b));if(_0x2b18e4>0x0)_0x444ae0[_0x1bcdc1(0x1c1)](_0x2b18e4+_0x1bcdc1(0x216));if(_0x32c02e>0x0)_0x444ae0['push'](_0x32c02e+'\x20deleted');const _0x1992c8=[];if(_0x870350>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x870350+_0x1bcdc1(0x20b));if(_0x9b57cf>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x9b57cf+'\x20updated');if(_0x2e1f64>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x2e1f64+_0x1bcdc1(0x1da));console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x211)));_0x4ccaae[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&console[_0x1bcdc1(0x1e8)]('\x20\x20Segments:\x20'+_0x4ccaae['join'](',\x20'));_0x444ae0[_0x1bcdc1(0x1b5)]>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x19e)+_0x444ae0[_0x1bcdc1(0x1d8)](',\x20'));_0x1992c8['length']>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&console[_0x1bcdc1(0x1e8)]('\x20\x20Activations:\x20'+_0x1992c8[_0x1bcdc1(0x1d8)](',\x20'));if(_0x1b9846){const _0x1bdc08=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],'/app/ps/'+_0x3238ce+_0x1bcdc1(0x1e2)+_0x1b9846+_0x1bcdc1(0x18f));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1bdc08));}return 0x0;}}
|
|
1
|
+
const a40_0x2857f2=a40_0xfbd0;(function(_0x5dc286,_0x35d7cd){const _0x22f038=a40_0xfbd0,_0x454609=_0x5dc286();while(!![]){try{const _0x48e34a=parseInt(_0x22f038(0x12a))/0x1*(-parseInt(_0x22f038(0x127))/0x2)+-parseInt(_0x22f038(0xdc))/0x3*(-parseInt(_0x22f038(0x125))/0x4)+parseInt(_0x22f038(0x102))/0x5+-parseInt(_0x22f038(0xd7))/0x6+-parseInt(_0x22f038(0x150))/0x7+-parseInt(_0x22f038(0x10b))/0x8*(-parseInt(_0x22f038(0xef))/0x9)+parseInt(_0x22f038(0xd5))/0xa;if(_0x48e34a===_0x35d7cd)break;else _0x454609['push'](_0x454609['shift']());}catch(_0x4b87b7){_0x454609['push'](_0x454609['shift']());}}}(a40_0x4334,0xd38fb));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a40_0xfbd0(_0x197405,_0xc17ae2){_0x197405=_0x197405-0xb1;const _0x433479=a40_0x4334();let _0xfbd0bf=_0x433479[_0x197405];return _0xfbd0bf;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x496244 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 a40_0x4334(){const _0x3960ed=['\x20new','\x0aValidation\x20failed:','Fetching\x20existing\x20activations...','\x20\x20Segments:\x20','listJourneysWithDetailsFromParentSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/e/','Delete\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','endsWith','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','setPhase','isScoped','\x20unchanged','Changes\x20to\x20journey:','\x20\x20Activations:\x20','segments','\x20\x20Source:\x20','Site:\x20','2199480LMoOji','updated','3942360NmVPfU','results','data','filter','listFolders','1509xemStO','\x20to\x20update','Changes\x20to:','helpText','folderId','cwd','getOutputSchemaWithCache','connection','.yml','paused','dim','add','\x20activations]','Scoped\x20to\x20folder:\x20','No\x20','listActivations','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','audienceId','diff','675vZpjqy','folderPath','updatedAt','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeyId','get','Error\x20parsing\x20YAML:\x20','segmentFolderId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','existingSegment','journeysOnly','toString','journey','Error:\x20Directory\x20not\x20found:\x20','join','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)','\x0a✔\x20Push\x20complete','createdSegmentIds','Preparing\x20journeys...','1766305UFMKXa','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','description','push','blue','targetDir','nameToType','createdAt','153272cZndZQ','map','journeyBundleName','type','\x20\x20Journeys:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','new','Fetching\x20connections\x20for\x20name\x20resolution...','all','list','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/j/da/je','listSegments','\x0aPush\x20summary\x20for\x20\x27','resolveParentId','Error:\x20','getParent','nameToId','toCreate','Aborted.','Resolving\x20parent\x20segment\x20\x27','relationships','\x20created','site','journeyBundleId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','11404EBcWFL','state','4ZsuTQq','error','filePath','705571wAZvqO','created','set','journeys','Parent\x20segment:\x20','toDelete','idToName','then','name','isNew','deleted','folders','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','cyan','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','changed','segment\x20or\x20journey','attributes','/app/ps/','\x20deleted','\x27...','activations','message','red','New\x20segment:','parent_name','parentName','yamlConfig','delete','Fetching\x20existing\x20data...','segment','📁\x20','Delete\x20segment:','no_parent','\x20to\x20delete','/sb/da/esr','user','parentSegment','3566010zoChqh','\x20changed','(Journey\x20will\x20be\x20deleted)','\x20updated','green','.yaml','\x20\x20📊\x20Segments:','execute','Source\x20directory:\x20','yellow','\x20\x20\x20\x20','yes','file','segment:push','\x20to\x20create','length','verbose','repeat'];a40_0x4334=function(){return _0x3960ed;};return a40_0x4334();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a40_0x2857f2(0xbd);[a40_0x2857f2(0x105)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a40_0x2857f2(0xb7)](_0x527b11){const _0x24317d=a40_0x2857f2,{options:_0x46841b,args:_0x46849f,tdx:_0x16c5fa}=_0x527b11,_0x424bf4=_0x46841b,_0x556fa1=await resolveTarget({'arg':_0x46849f[0x0],'contextParent':_0x46841b[_0x24317d(0x14f)],'cwd':process[_0x24317d(0xe1)]()});if(!isSuccessfulResolution(_0x556fa1))return _0x556fa1['errorCode']===_0x24317d(0x14b)?(console[_0x24317d(0x128)](a40_0x496244['yellow'](_0x24317d(0xc7))),console[_0x24317d(0x128)](_0x24317d(0xfe)),console[_0x24317d(0x128)](_0x24317d(0x115)),console[_0x24317d(0x128)](_0x24317d(0xca))):(console['error'](a40_0x496244[_0x24317d(0x141)](_0x24317d(0x11a)+_0x556fa1[_0x24317d(0x140)]+'\x0a')),_0x556fa1['helpText']&&console[_0x24317d(0x128)](a40_0x496244['cyan'](_0x556fa1[_0x24317d(0xdf)]))),0x1;if(_0x556fa1['type']===_0x24317d(0x143))return console['error'](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xfc)+_0x556fa1[_0x24317d(0x108)]+'\x0a')),console[_0x24317d(0x128)](a40_0x496244['cyan'](_0x24317d(0xec))),0x1;const _0x31e9f5=_0x556fa1[_0x24317d(0x144)],_0x5851a1=_0x556fa1[_0x24317d(0x108)],_0xfc151e=_0x556fa1[_0x24317d(0x10e)]===_0x24317d(0xbc)?_0x556fa1[_0x24317d(0x129)]:undefined,_0x4e5021=getScopedDetails(_0x556fa1),_0x28bf70=_0x4e5021?.[_0x24317d(0xce)]??![],_0x2d4ab9=_0x4e5021?.['scopedFolderPath']??'';if(!existsSync(_0x5851a1))return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5851a1+'\x0a')),console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x137)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x424bf4[_0x24317d(0xc0)]&&(console[_0x24317d(0x128)](_0x24317d(0xd4)+_0x424bf4['site']),console[_0x24317d(0x128)](_0x24317d(0x12e)+_0x31e9f5),console[_0x24317d(0x128)](_0x24317d(0xb8)+_0x5851a1),_0x28bf70&&console['error'](_0x24317d(0xe9)+_0x2d4ab9));const _0xb3f228=await withSpinner(_0x24317d(0x11f)+_0x31e9f5+_0x24317d(0x13e),()=>_0x16c5fa[_0x24317d(0x148)][_0x24317d(0x119)](_0x31e9f5),{'verbose':_0x424bf4[_0x24317d(0xc0)]}),_0x374140=_0xb3f228[_0x24317d(0xd9)],{parentSegmentResult:_0x14661c,segmentsResult:_0x12319c,foldersResult:_0x20de62,journeysWithDetailsResult:_0x4f9c23,userMaps:_0x44703a}=await withSpinner(_0x24317d(0x147),async()=>{const _0xa1b7b4=_0x24317d,[_0x5370ae,_0x32019a,_0x24f896,_0x4f1301,_0x4b0700]=await Promise[_0xa1b7b4(0x113)]([_0x16c5fa['segment'][_0xa1b7b4(0x11b)](_0x374140),_0x16c5fa[_0xa1b7b4(0x148)][_0xa1b7b4(0x117)](_0x374140),_0x16c5fa['segment'][_0xa1b7b4(0xdb)](_0x374140),_0x16c5fa['journey'][_0xa1b7b4(0xc6)](_0x374140,{'includeAllVersions':!![]}),_0x16c5fa[_0xa1b7b4(0x14e)]['buildUserMaps']()]);return{'parentSegmentResult':_0x5370ae,'segmentsResult':_0x32019a,'foldersResult':_0x24f896,'journeysWithDetailsResult':_0x4f1301,'userMaps':_0x4b0700};},{'verbose':_0x424bf4[_0x24317d(0xc0)]})[_0x24317d(0x131)](_0x346b55=>_0x346b55[_0x24317d(0xd9)]),_0x3682e3=_0x14661c,_0x17d807=extractRootFolderId(_0x3682e3),_0x136dcb=_0x12319c,_0x11af83=_0x20de62,{journeys:_0x379a2e,activationStepsById:_0xbae728}=_0x4f9c23,_0xce8e74=new Map(_0x379a2e[_0x24317d(0x10c)](_0x5887e7=>[_0x5887e7['id'],_0x5887e7])),_0x49c908=_0x379a2e[_0x24317d(0x10c)](_0x107ac5=>({'id':_0x107ac5['id'],'name':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0x132)],'journeyBundleName':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0x10d)]||'','journeyBundleId':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0x123)]||'','versionNumber':_0x107ac5[_0x24317d(0x13b)]['versionNumber'],'description':_0x107ac5[_0x24317d(0x13b)]['description'],'state':_0x107ac5['attributes'][_0x24317d(0x126)],'paused':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0xe5)],'audienceId':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0xed)],'folderId':_0x107ac5[_0x24317d(0x120)]?.['parentFolder']?.[_0x24317d(0xd9)]?.['id'],'createdAt':_0x107ac5['attributes'][_0x24317d(0x10a)],'updatedAt':_0x107ac5['attributes'][_0x24317d(0xf1)]})),{emailToId:_0x1abb49,idToEmail:_0x35243e}=_0x44703a,_0x3d9fc7=await withSpinner(_0x24317d(0x112),async()=>{const _0x11d5d3=_0x24317d,_0x5cdf39=await _0x16c5fa[_0x11d5d3(0xe3)][_0x11d5d3(0x114)]();return buildConnectionMaps(_0x5cdf39);},{'verbose':_0x424bf4[_0x24317d(0xc0)]})[_0x24317d(0x131)](_0xb07d0f=>_0xb07d0f[_0x24317d(0xd9)]),_0x446844=_0x3d9fc7[_0x24317d(0x11c)],_0x190c96=_0x3d9fc7[_0x24317d(0x130)],_0x2e18cb=_0x3d9fc7[_0x24317d(0x109)],_0x5f3324={'emailToIdMap':_0x1abb49,'connectionNameToIdMap':_0x446844,'connectionNameToTypeMap':_0x2e18cb,'getSchema':_0x11a0d4=>_0x16c5fa[_0x24317d(0xe3)][_0x24317d(0xe2)](_0x11a0d4)};let {pathToId:_0xc80322,idToPath:_0x56a9f3}=buildFolderMaps(_0x11af83);const _0x18933b=buildSegmentLookupMap(_0x136dcb,_0x56a9f3),_0x2b2d2e=buildSegmentNameToIdMap(_0x136dcb),_0x3e57da=buildJourneyBundleLookupMap(_0x49c908,_0x56a9f3);let _0x29ba03;if(_0xfc151e){if(!_0xfc151e[_0x24317d(0xcb)](_0x24317d(0xe4))&&!_0xfc151e[_0x24317d(0xcb)](_0x24317d(0xb5)))return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)](_0x24317d(0x103)+_0xfc151e+'\x0a')),0x1;_0x29ba03=[_0xfc151e];}else _0x29ba03=findYamlFiles(_0x5851a1);if(_0x29ba03['length']===0x0)return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5851a1+'\x0a')),console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x137)](_0x24317d(0x136))),0x1;let _0x2e1036,_0x2e8576;try{const _0x142899=parseAndClassifyYamlFiles(_0x29ba03,_0x5851a1,{'skipSegments':_0x424bf4[_0x24317d(0xf9)]});_0x2e1036=_0x142899[_0x24317d(0xd2)],_0x2e8576=_0x142899[_0x24317d(0x12d)];const _0x1a8063=validateParsedFiles(_0x142899,_0x5851a1);if(_0x1a8063[_0x24317d(0xbf)]>0x0)return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xc3))),console[_0x24317d(0x128)](formatValidationErrors(_0x1a8063)),console['error'](a40_0x496244['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x4973ea){return console['error'](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xf5)+(_0x4973ea instanceof Error?_0x4973ea[_0x24317d(0x140)]:_0x4973ea))),0x1;}if(_0x2e1036[_0x24317d(0xbf)]===0x0&&_0x2e8576[_0x24317d(0xbf)]===0x0){const _0x45da8c=_0x424bf4['journeysOnly']?_0x24317d(0xfb):_0x24317d(0x13a);return console['error'](a40_0x496244['yellow'](_0x24317d(0xea)+_0x45da8c+'\x20YAML\x20files\x20found')),0x0;}const _0x162c3f=new Map();_0x136dcb[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&await withSpinner(_0x24317d(0xc4),async()=>{await batchAsync(_0x136dcb,async _0x42eb26=>{const _0x43647b=a40_0xfbd0,_0x32b70f=await _0x16c5fa['segment'][_0x43647b(0xeb)](_0x374140,_0x42eb26['id']);_0x162c3f[_0x43647b(0x12c)](_0x42eb26['id'],_0x32b70f);});},{'verbose':_0x424bf4['verbose']});const {segmentFiles:_0x3fca31,foldersToCreate:_0x489752}=await prepareSegmentFiles(_0x2e1036,{'segmentByFolderAndName':_0x18933b,'activationsBySegmentId':_0x162c3f,'folderPathToId':_0xc80322,'idToEmailMap':_0x35243e,'connectionIdToNameMap':_0x190c96},_0x5f3324,_0x28bf70,_0x2d4ab9),_0x1df83b=_0xfc151e?[]:findSegmentsToDelete(_0x136dcb,_0x2e1036[_0x24317d(0x10c)](({yamlConfig:_0x24eb5f,folderPath:_0x99ed7d})=>({'yamlConfig':_0x24eb5f,'folderPath':resolveTDFolderPath(_0x99ed7d,_0x28bf70,_0x2d4ab9)})),_0x56a9f3,_0x2d4ab9,_0x28bf70),{journeyFiles:_0x24eca1,foldersToCreate:_0x2954fa}=await withProgressSpinner(_0x24317d(0x101),async _0x271085=>prepareJourneyFiles(_0x2e8576,{'fetchJourney':async _0x1fbec7=>_0x16c5fa['journey']['getJourney'](_0x1fbec7[_0x24317d(0xf3)]),'journeyBundlesByFolderAndName':_0x3e57da,'folderPathToId':_0xc80322,'idToEmailMap':_0x35243e,'connectionIdToNameMap':_0x190c96,'existingSegments':_0x136dcb,'parentId':_0x374140,'deps':_0x16c5fa,'progress':{'update':_0x28e51e=>{const _0x31f147=_0x24317d;_0x271085[_0x31f147(0xcd)](_0x28e51e),_0x424bf4[_0x31f147(0xc0)]&&console[_0x31f147(0x128)]('\x20\x20'+_0x28e51e);}},'journeyById':_0xce8e74,'activationStepsById':_0xbae728},_0x28bf70,_0x2d4ab9),{'verbose':_0x424bf4['verbose']})[_0x24317d(0x131)](_0x24628b=>_0x24628b[_0x24317d(0xd9)]);for(const _0x3e456c of _0x2954fa){_0x489752[_0x24317d(0xe7)](_0x3e456c);}const _0x5bc3fc=_0xfc151e?[]:findJourneysToDelete(_0x49c908,_0x2e8576['map'](({yamlConfig:_0x511454,folderPath:_0x3d83c2})=>({'yamlConfig':_0x511454,'folderPath':resolveTDFolderPath(_0x3d83c2,_0x28bf70,_0x2d4ab9)})),_0x56a9f3,_0x2d4ab9,_0x28bf70),_0x4124c4=calculatePushStats(_0x3fca31,_0x24eca1,_0x489752,_0x1df83b,_0x5bc3fc,!!_0x424bf4[_0x24317d(0x146)],!!_0x424bf4['journeysOnly']),_0x28f3d2=_0x4124c4[_0x24317d(0xd2)][_0x24317d(0x111)],_0x1d2c4b=_0x4124c4['segments'][_0x24317d(0x139)],_0x1cca2d=_0x4124c4['segments']['unchanged'],_0x55478f=_0x4124c4[_0x24317d(0xd2)][_0x24317d(0x12f)],_0x43f626=_0x4124c4[_0x24317d(0x135)][_0x24317d(0x11d)],_0x21dc6e=_0x4124c4['journeys']['new'],_0x218031=_0x4124c4[_0x24317d(0x12d)]['changed'],_0x96751d=_0x4124c4[_0x24317d(0x12d)]['unchanged'],_0x262e49=_0x4124c4[_0x24317d(0x12d)][_0x24317d(0x12f)],_0x222761=_0x4124c4[_0x24317d(0x13f)][_0x24317d(0x113)],_0x53c526=_0x4124c4[_0x24317d(0x13f)][_0x24317d(0x11d)],_0x3c5a3a=_0x4124c4[_0x24317d(0x13f)]['toUpdate'],_0x9af05=_0x4124c4[_0x24317d(0x13f)][_0x24317d(0x12f)];console[_0x24317d(0x128)](_0x24317d(0x118)+_0x31e9f5+'\x27:');_0x43f626['length']>0x0&&console[_0x24317d(0x128)]('\x20\x20'+a40_0x496244[_0x24317d(0x107)](_0x24317d(0x149)+_0x43f626[_0x24317d(0xbf)]+'\x20folders\x20to\x20create'));if(!_0x424bf4[_0x24317d(0xf9)]){console['error'](_0x24317d(0xb6)),console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244['green']('+\x20'+_0x28f3d2[_0x24317d(0xbf)]+_0x24317d(0xc2))),console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xb9)]('~\x20'+_0x1d2c4b[_0x24317d(0xbf)]+_0x24317d(0xb1)));if(_0x55478f['length']>0x0)console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0x141)]('-\x20'+_0x55478f[_0x24317d(0xbf)]+_0x24317d(0x14c)));else _0x1df83b[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0x146)]&&console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xe6)](_0x1df83b[_0x24317d(0xbf)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xe6)]('=\x20'+_0x1cca2d['length']+_0x24317d(0xcf)));}if(_0x24eca1[_0x24317d(0xbf)]>0x0||_0x5bc3fc[_0x24317d(0xbf)]>0x0){console[_0x24317d(0x128)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xb4)]('+\x20'+_0x21dc6e[_0x24317d(0xbf)]+_0x24317d(0xc2))),console[_0x24317d(0x128)]('\x20\x20\x20\x20'+a40_0x496244['yellow']('~\x20'+_0x218031[_0x24317d(0xbf)]+_0x24317d(0xb1)));if(_0x262e49[_0x24317d(0xbf)]>0x0)console[_0x24317d(0x128)]('\x20\x20\x20\x20'+a40_0x496244[_0x24317d(0x141)]('-\x20'+_0x262e49[_0x24317d(0xbf)]+_0x24317d(0x14c)));else _0x5bc3fc['length']>0x0&&!_0x424bf4[_0x24317d(0x146)]&&console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244['dim'](_0x5bc3fc['length']+_0x24317d(0x124)));console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xe6)]('=\x20'+_0x96751d[_0x24317d(0xbf)]+_0x24317d(0xcf)));}_0x222761[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&(console['error'](''),console[_0x24317d(0x128)]('\x20\x20Activations:'),_0x53c526[_0x24317d(0xbf)]>0x0&&console['error'](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xb4)]('+\x20'+_0x53c526[_0x24317d(0xbf)]+_0x24317d(0xbe))),_0x3c5a3a[_0x24317d(0xbf)]>0x0&&console['error'](_0x24317d(0xba)+a40_0x496244['yellow']('~\x20'+_0x3c5a3a[_0x24317d(0xbf)]+_0x24317d(0xdd))),_0x9af05['length']>0x0&&console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0x141)]('-\x20'+_0x9af05[_0x24317d(0xbf)]+_0x24317d(0x14c))));console['error'](_0x24317d(0xd3)+a40_0x496244[_0x24317d(0x137)](_0x5851a1)+'\x0a');if(_0x43f626[_0x24317d(0xbf)]>0x0){console[_0x24317d(0x128)]('Folders\x20to\x20create:');for(const _0x56674a of _0x43f626){console['error']('\x20\x20'+a40_0x496244['blue']('+')+'\x20'+_0x56674a);}console[_0x24317d(0x128)]('');}if(_0x28f3d2[_0x24317d(0xbf)]>0x0&&!_0x424bf4['journeysOnly'])for(const _0x3e0c31 of _0x28f3d2){const _0x4e9572=_0x3e0c31[_0x24317d(0xf0)]?_0x3e0c31[_0x24317d(0xf0)]+'/'+_0x3e0c31[_0x24317d(0x145)][_0x24317d(0x132)]:_0x3e0c31['yamlConfig'][_0x24317d(0x132)],_0x4c66f4=_0x3e0c31[_0x24317d(0x145)][_0x24317d(0x13f)]?.[_0x24317d(0xbf)]||0x0,_0x4e77ea=_0x4c66f4>0x0?a40_0x496244[_0x24317d(0xe6)]('\x20['+_0x4c66f4+'\x20activations]'):'';console[_0x24317d(0x128)]('\x0a'+a40_0x496244[_0x24317d(0xb4)](_0x24317d(0x142))+'\x20'+_0x4e9572+_0x4e77ea),console[_0x24317d(0x128)]('─'['repeat'](0x3c)),_0x3e0c31['diff']&&console[_0x24317d(0x128)](_0x3e0c31[_0x24317d(0xee)]),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c));}if(_0x55478f[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)])for(const _0x2ac60b of _0x55478f){const _0x4165a=_0x2ac60b['segmentFolderId']?_0x56a9f3[_0x24317d(0xf4)](_0x2ac60b[_0x24317d(0xf6)][_0x24317d(0xfa)]())||'':'',_0x295eea=_0x4165a?_0x4165a+'/'+_0x2ac60b[_0x24317d(0x132)]:_0x2ac60b[_0x24317d(0x132)],_0x118c39=_0x162c3f[_0x24317d(0xf4)](_0x2ac60b['id'])||[],_0x247de2=_0x118c39[_0x24317d(0xbf)]>0x0?a40_0x496244['dim']('\x20['+_0x118c39[_0x24317d(0xbf)]+_0x24317d(0xe8)):'';console[_0x24317d(0x128)]('\x0a'+a40_0x496244['red'](_0x24317d(0x14a))+'\x20'+_0x295eea+_0x247de2),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c));const _0x276081=segmentWithActivationsToYaml(_0x2ac60b,_0x118c39,undefined,_0x35243e,_0x190c96),_0x5baad5=segmentToYamlString(_0x276081),_0x5362ba=generateDiff(_0x5baad5,'');console[_0x24317d(0x128)](formatDiffWithColors(_0x5362ba)),console['error']('─'[_0x24317d(0xc1)](0x3c));}const _0x1c490f=_0x3fca31[_0x24317d(0xda)](_0x3c3709=>!_0x3c3709[_0x24317d(0x133)]&&_0x3c3709[_0x24317d(0xee)]);if(_0x1c490f[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)])for(const _0x489a56 of _0x1c490f){const _0x4b7ee6=_0x489a56[_0x24317d(0xf0)]?_0x489a56[_0x24317d(0xf0)]+'/'+_0x489a56[_0x24317d(0x145)][_0x24317d(0x132)]:_0x489a56[_0x24317d(0x145)][_0x24317d(0x132)];console[_0x24317d(0x128)]('\x0a'+a40_0x496244['yellow'](_0x24317d(0xde))+'\x20'+_0x4b7ee6),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c)),console[_0x24317d(0x128)](_0x489a56[_0x24317d(0xee)]),console['error']('─'[_0x24317d(0xc1)](0x3c));}if(_0x21dc6e[_0x24317d(0xbf)]>0x0)for(const _0xe2c71 of _0x21dc6e){const _0x2d11dd=_0xe2c71[_0x24317d(0xf0)]?_0xe2c71[_0x24317d(0xf0)]+'/'+_0xe2c71[_0x24317d(0x145)][_0x24317d(0x132)]:_0xe2c71[_0x24317d(0x145)][_0x24317d(0x132)];console['error']('\x0a'+a40_0x496244[_0x24317d(0xb4)]('New\x20journey:')+'\x20'+_0x2d11dd),console[_0x24317d(0x128)]('─'['repeat'](0x3c)),_0xe2c71[_0x24317d(0xee)]&&console[_0x24317d(0x128)](_0xe2c71[_0x24317d(0xee)]),console[_0x24317d(0x128)]('─'['repeat'](0x3c));}const _0x458140=_0x24eca1[_0x24317d(0xda)](_0x4b9b2d=>!_0x4b9b2d['isNew']&&_0x4b9b2d[_0x24317d(0xee)]);if(_0x458140[_0x24317d(0xbf)]>0x0)for(const _0x28e296 of _0x458140){const _0x1d1c11=_0x28e296[_0x24317d(0xf0)]?_0x28e296[_0x24317d(0xf0)]+'/'+_0x28e296[_0x24317d(0x145)][_0x24317d(0x132)]:_0x28e296[_0x24317d(0x145)][_0x24317d(0x132)];console[_0x24317d(0x128)]('\x0a'+a40_0x496244[_0x24317d(0xb9)](_0x24317d(0xd0))+'\x20'+_0x1d1c11),console[_0x24317d(0x128)]('─'['repeat'](0x3c)),console['error'](_0x28e296[_0x24317d(0xee)]),console['error']('─'['repeat'](0x3c));}if(_0x262e49[_0x24317d(0xbf)]>0x0)for(const _0x2c31ec of _0x262e49){const _0x1a1c14=_0x2c31ec['folderId']?_0x56a9f3[_0x24317d(0xf4)](_0x2c31ec[_0x24317d(0xe0)])||'':'',_0x445819=_0x1a1c14?_0x1a1c14+'/'+_0x2c31ec[_0x24317d(0x10d)]:_0x2c31ec[_0x24317d(0x10d)];console['error']('\x0a'+a40_0x496244[_0x24317d(0x141)](_0x24317d(0xc9))+'\x20'+_0x445819),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c)),console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xb2))),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c));}if(_0x424bf4['dryRun'])return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb9)](_0x24317d(0x110))),0x0;const _0x5a776e=_0x424bf4['journeysOnly']?![]:_0x28f3d2[_0x24317d(0xbf)]>0x0||_0x1d2c4b[_0x24317d(0xbf)]>0x0||_0x55478f[_0x24317d(0xbf)]>0x0,_0x581038=_0x21dc6e[_0x24317d(0xbf)]>0x0||_0x218031['length']>0x0||_0x262e49[_0x24317d(0xbf)]>0x0,_0x39e873=_0x424bf4[_0x24317d(0xf9)]?![]:_0x222761[_0x24317d(0xbf)]>0x0,_0x380e6d=_0x43f626[_0x24317d(0xbf)]>0x0;if(!_0x5a776e&&!_0x581038&&!_0x39e873&&!_0x380e6d){const _0x2e8d74=_0x424bf4['journeysOnly']?_0x24317d(0x138):_0x24317d(0x104);console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb4)](_0x2e8d74));if(_0xfc151e&&_0x1cca2d['length']===0x1){const _0x222164=_0x1cca2d[0x0];if(_0x222164[_0x24317d(0xf8)]?.['id']){const _0x75bc61=getConsoleNextUrl(_0x424bf4[_0x24317d(0x122)],_0x24317d(0x13c)+_0x374140+_0x24317d(0xc8)+_0x222164[_0x24317d(0xf8)]['id']+_0x24317d(0x14d));console[_0x24317d(0x128)](_0x24317d(0xcc)+a40_0x496244[_0x24317d(0x137)](_0x75bc61));}}if(_0xfc151e&&_0x96751d[_0x24317d(0xbf)]===0x1){const _0x33b2f6=_0x96751d[0x0];if(_0x33b2f6['existingJourney']?.['id']){const _0x358f19=getConsoleNextUrl(_0x424bf4[_0x24317d(0x122)],_0x24317d(0x13c)+_0x374140+'/e/'+_0x33b2f6['existingJourney']['id']+_0x24317d(0x116));console['error']('\x20\x20'+a40_0x496244['cyan'](_0x358f19));}}return 0x0;}const _0x5adb2f=_0x424bf4['journeysOnly']?_0x21dc6e[_0x24317d(0xbf)]+_0x218031[_0x24317d(0xbf)]+_0x262e49[_0x24317d(0xbf)]+_0x43f626[_0x24317d(0xbf)]:_0x28f3d2[_0x24317d(0xbf)]+_0x1d2c4b[_0x24317d(0xbf)]+_0x55478f[_0x24317d(0xbf)]+_0x21dc6e[_0x24317d(0xbf)]+_0x218031['length']+_0x262e49['length']+_0x43f626[_0x24317d(0xbf)]+_0x222761[_0x24317d(0xbf)];if(!_0x424bf4[_0x24317d(0xbb)]&&_0x5adb2f>0x0){if(!isInteractive())return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('\x0aError:'),_0x24317d(0xf7)),console[_0x24317d(0x128)](a40_0x496244['dim'](_0x24317d(0xf2))),0x1;const _0x37a1e2=await confirmKey('Push\x20'+_0x5adb2f+'\x20changes?');if(!_0x37a1e2)return console['error'](a40_0x496244[_0x24317d(0xb9)](_0x24317d(0x11e))),0x1;}const _0x1fd5d2={'withProgress':async(_0x21ef18,_0x97480e)=>{const _0x17e5d4=_0x24317d,_0x55f9a6=await withSpinner(_0x21ef18,_0x97480e,{'verbose':_0x424bf4['verbose']});return{'data':_0x55f9a6[_0x17e5d4(0xd9)]};},'logInfo':_0x27ee44=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x107)]('✔\x20'+_0x27ee44)),'logSuccess':_0x422dd0=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb4)]('✔\x20'+_0x422dd0)),'logWarning':_0x310cc3=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb9)]('⚠\x20'+_0x310cc3)),'logDeleted':_0x2c81a9=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('✔\x20'+_0x2c81a9))},_0x5ebca0={'segment':_0x16c5fa['segment'],'journey':_0x16c5fa['journey'],'user':_0x16c5fa['user'],'connection':_0x16c5fa[_0x24317d(0xe3)]};_0x43f626[_0x24317d(0xbf)]>0x0&&(_0xc80322=await executePushFolders(_0x5ebca0,_0x43f626,_0xc80322,{'parentId':_0x374140},_0x1fd5d2));const _0x38d0e7={'rootFolderId':_0x17d807,'folderPathToId':_0xc80322,'folderIdToPath':_0x56a9f3,'segmentNameToId':_0x2b2d2e,'activationsBySegmentId':_0x162c3f,'emailToIdMap':_0x1abb49,'idToEmailMap':_0x35243e,'connectionNameToIdMap':_0x3d9fc7[_0x24317d(0x11c)],'connectionIdToNameMap':_0x3d9fc7['idToName'],'connectionNameToTypeMap':_0x2e18cb},_0x5bdd9d=await executePushSegments(_0x5ebca0,_0x424bf4[_0x24317d(0xf9)]?[]:_0x3fca31,_0x38d0e7,{'parentId':_0x374140},_0x1fd5d2),_0x1de30a=_0x5bdd9d[_0x24317d(0x12b)],_0x21bafb=_0x5bdd9d[_0x24317d(0xd6)],_0x465ab6=_0x5bdd9d[_0x24317d(0x13f)][_0x24317d(0x12b)],_0x2cb3da=_0x5bdd9d[_0x24317d(0x13f)][_0x24317d(0xd6)],_0x3b143c=_0x5bdd9d[_0x24317d(0x13f)][_0x24317d(0x134)];let _0x5bb822;if(_0xfc151e&&_0x3fca31[_0x24317d(0xbf)]===0x1){const _0x3b611b=_0x3fca31[0x0];_0x5bb822=_0x3b611b['existingSegment']?.['id']??_0x5bdd9d[_0x24317d(0x100)][_0x24317d(0xf4)](_0x3b611b['yamlConfig'][_0x24317d(0x132)]);}const _0x18bbf2=await executePushSegmentDeletions(_0x5ebca0,_0x424bf4[_0x24317d(0xf9)]?[]:_0x55478f,_0x1fd5d2);let _0x109ebe=0x0,_0x467067=0x0,_0x5db0cc=0x0;const _0x47118e=new Map(_0x2b2d2e);for(const [_0x3ca3d3,_0x23e160]of _0x5bdd9d[_0x24317d(0x100)]){_0x47118e[_0x24317d(0x12c)](_0x3ca3d3,_0x23e160);}if(_0x24eca1[_0x24317d(0xbf)]>0x0){const _0xaf0d91={..._0x38d0e7,'segmentNameToId':_0x47118e,'existingSegments':_0x136dcb,'activationContext':_0x5f3324},_0x4d968b=await executePushJourneys(_0x5ebca0,_0x24eca1,_0xaf0d91,{'parentId':_0x374140,'rootFolderId':_0x17d807,'verbose':_0x424bf4[_0x24317d(0xc0)]},_0x1fd5d2);_0x109ebe=_0x4d968b[_0x24317d(0x12b)],_0x467067=_0x4d968b['updated'];if(_0xfc151e&&_0x4d968b[_0x24317d(0xd8)][_0x24317d(0xbf)]===0x1){const _0x5609f6=_0x4d968b[_0x24317d(0xd8)][0x0];if(_0x5609f6[_0x24317d(0xf3)]){const _0x14fff4=getConsoleNextUrl(_0x424bf4['site'],'/app/ps/'+_0x374140+'/e/'+_0x5609f6['journeyId']+'/j/da/je');console[_0x24317d(0x128)]('\x20\x20'+a40_0x496244[_0x24317d(0x137)](_0x14fff4));}}}for(const _0x31f6d6 of _0x262e49){console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb9)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x31f6d6[_0x24317d(0x10d)])),_0x5db0cc++;}const _0x23188f=[];if(_0x1de30a>0x0)_0x23188f[_0x24317d(0x106)](_0x1de30a+_0x24317d(0x121));if(_0x21bafb>0x0)_0x23188f[_0x24317d(0x106)](_0x21bafb+_0x24317d(0xb3));if(_0x18bbf2>0x0)_0x23188f['push'](_0x18bbf2+_0x24317d(0x13d));const _0x1679f5=[];if(_0x109ebe>0x0)_0x1679f5[_0x24317d(0x106)](_0x109ebe+_0x24317d(0x121));if(_0x467067>0x0)_0x1679f5[_0x24317d(0x106)](_0x467067+_0x24317d(0xb3));if(_0x5db0cc>0x0)_0x1679f5['push'](_0x5db0cc+_0x24317d(0x13d));const _0x53f0f6=[];if(_0x465ab6>0x0)_0x53f0f6[_0x24317d(0x106)](_0x465ab6+_0x24317d(0x121));if(_0x2cb3da>0x0)_0x53f0f6[_0x24317d(0x106)](_0x2cb3da+_0x24317d(0xb3));if(_0x3b143c>0x0)_0x53f0f6[_0x24317d(0x106)](_0x3b143c+_0x24317d(0x13d));console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb4)](_0x24317d(0xff)));_0x23188f[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&console[_0x24317d(0x128)](_0x24317d(0xc5)+_0x23188f[_0x24317d(0xfd)](',\x20'));_0x1679f5[_0x24317d(0xbf)]>0x0&&console['error'](_0x24317d(0x10f)+_0x1679f5[_0x24317d(0xfd)](',\x20'));_0x53f0f6[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&console[_0x24317d(0x128)](_0x24317d(0xd1)+_0x53f0f6[_0x24317d(0xfd)](',\x20'));if(_0x5bb822){const _0x564d21=getConsoleNextUrl(_0x424bf4['site'],_0x24317d(0x13c)+_0x374140+_0x24317d(0xc8)+_0x5bb822+_0x24317d(0x14d));console[_0x24317d(0x128)](_0x24317d(0xcc)+a40_0x496244[_0x24317d(0x137)](_0x564d21));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x309198=a41_0x49bc;(function(_0x138032,_0xb839c9){const _0x204a36=a41_0x49bc,_0x5ff6b7=_0x138032();while(!![]){try{const _0x46dc71=parseInt(_0x204a36(0x18a))/0x1+-parseInt(_0x204a36(0x190))/0x2*(parseInt(_0x204a36(0x19a))/0x3)+-parseInt(_0x204a36(0x19d))/0x4*(parseInt(_0x204a36(0x194))/0x5)+parseInt(_0x204a36(0x1a4))/0x6+parseInt(_0x204a36(0x1b0))/0x7+-parseInt(_0x204a36(0x197))/0x8+parseInt(_0x204a36(0x1b1))/0x9*(parseInt(_0x204a36(0x1a0))/0xa);if(_0x46dc71===_0xb839c9)break;else _0x5ff6b7['push'](_0x5ff6b7['shift']());}catch(_0x49158f){_0x5ff6b7['push'](_0x5ff6b7['shift']());}}}(a41_0x30f9,0xbf08d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a41_0x49bc(_0x31a115,_0x363457){_0x31a115=_0x31a115-0x188;const _0x30f91d=a41_0x30f9();let _0x49bc2d=_0x30f91d[_0x31a115];return _0x49bc2d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a41_0x30f9(){const _0x3072c9=['\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20relative\x20path\x20to:\x20','Examples:','error','data','9541602aKAKoj','1906299xluaKl','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentName','name','Resolving\x20path\x20\x27','segmentId','updateSegmentById','verbose','\x27...','segment','\x20\x20\x20Path:\x20','1011519rTvilx','description','folder','kind','parentId','Resolved\x20folder\x20ID:\x20','792QwIVDt','INTERNAL','type','length','49195fnOTft','Segment\x20ID:\x20','execute','5534912VdMnRY','Resolving\x20folder\x20\x27','resolvePathToResource','8961tpafOD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Updating\x20segment\x20\x27','612rKWfZX','Update\x20existing\x20child\x20segment','✔\x20Updated\x20segment\x20\x27','20XDaXyi','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentPath','8185998XQJXod','Parent\x20ID:\x20','yellow','Segment\x20ID\x20missing\x20from\x20resolved\x20path','ruleFile','resolveFolderId'];a41_0x30f9=function(){return _0x3072c9;};return a41_0x30f9();}import a41_0x5cfa58 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x309198(0x1b4)]='segment:update';[a41_0x309198(0x18b)]=a41_0x309198(0x19e);async[a41_0x309198(0x196)](_0x20951a){const _0x11067d=a41_0x309198;console[_0x11067d(0x1ae)](a41_0x5cfa58[_0x11067d(0x1a6)](_0x11067d(0x1a1))),console[_0x11067d(0x1ae)](a41_0x5cfa58[_0x11067d(0x1a6)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x183118,args:_0x4b4b3d,tdx:_0x470039}=_0x20951a,_0x5f10b0=_0x183118;if(_0x4b4b3d[_0x11067d(0x193)]===0x0)return console[_0x11067d(0x1ae)](_0x11067d(0x19b)),console[_0x11067d(0x1ae)](_0x11067d(0x1a2)),console[_0x11067d(0x1ae)](_0x11067d(0x1ad)),console[_0x11067d(0x1ae)](_0x11067d(0x1aa)),console[_0x11067d(0x1ae)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x29d7d9=_0x4b4b3d[0x0],_0x47cc1d=_0x183118[_0x11067d(0x1a3)];let _0x4848cc=_0x29d7d9;_0x47cc1d&&!_0x29d7d9['includes']('/')&&(_0x4848cc=_0x47cc1d+'/'+_0x29d7d9,_0x5f10b0[_0x11067d(0x1b8)]&&console['error'](_0x11067d(0x1ac)+_0x4848cc));const _0x36af2f=await withSpinner(_0x11067d(0x1b5)+_0x4848cc+'\x27...',()=>_0x470039['segment'][_0x11067d(0x199)](_0x4848cc),{'verbose':_0x5f10b0[_0x11067d(0x1b8)]}),_0x281796=_0x36af2f[_0x11067d(0x1af)];_0x5f10b0[_0x11067d(0x1b8)]&&console['error']('Resolved\x20type:\x20'+_0x281796[_0x11067d(0x192)]);if(_0x281796[_0x11067d(0x192)]!==_0x11067d(0x188))return console[_0x11067d(0x1ae)]('Error:\x20Cannot\x20update\x20'+_0x281796['type']+_0x11067d(0x1ab)),console[_0x11067d(0x1ae)](_0x11067d(0x1b2)),0x1;if(!_0x281796[_0x11067d(0x1b6)])throw new SDKError(ErrorCode[_0x11067d(0x191)],_0x11067d(0x1a7));const _0x2d0ec5=_0x281796[_0x11067d(0x18e)],_0x29ec70=_0x281796[_0x11067d(0x1b6)];_0x5f10b0['verbose']&&(console[_0x11067d(0x1ae)](_0x11067d(0x1a5)+_0x2d0ec5),console[_0x11067d(0x1ae)](_0x11067d(0x195)+_0x29ec70));let _0x29e1fb;if(_0x5f10b0[_0x11067d(0x18c)]){const _0x4776a2=_0x5f10b0[_0x11067d(0x18c)],_0x3eb88b=await withSpinner(_0x11067d(0x198)+_0x4776a2+'\x27...',()=>_0x470039['segment'][_0x11067d(0x1a9)](_0x2d0ec5,_0x4776a2),{'verbose':_0x5f10b0['verbose']});_0x29e1fb=parseInt(_0x3eb88b['data'],0xa),_0x5f10b0[_0x11067d(0x1b8)]&&console['error'](_0x11067d(0x18f)+_0x29e1fb);}const _0x3eb38a=await loadJSONFromOptions(_0x5f10b0['rule'],_0x5f10b0[_0x11067d(0x1a8)]),_0x4dcc7b={'name':_0x5f10b0[_0x11067d(0x1b4)],'description':_0x5f10b0[_0x11067d(0x18b)],'rule':_0x3eb38a,'kind':_0x5f10b0[_0x11067d(0x18d)]!==undefined?parseInt(_0x5f10b0['kind'],0xa):undefined,'segmentFolderId':_0x29e1fb},_0x17249b=await withSpinner(_0x11067d(0x19c)+_0x281796[_0x11067d(0x1b3)]+_0x11067d(0x1b9),()=>_0x470039['segment'][_0x11067d(0x1b7)](_0x2d0ec5,_0x29ec70,_0x4dcc7b),{'verbose':_0x5f10b0[_0x11067d(0x1b8)]}),_0x51005b=_0x17249b[_0x11067d(0x1af)];return console[_0x11067d(0x1ae)](_0x11067d(0x19f)+_0x51005b[_0x11067d(0x1b4)]+'\x27'),_0x4848cc!==_0x29d7d9&&console[_0x11067d(0x1ae)](_0x11067d(0x189)+_0x4848cc),await handleSDKOutput([_0x51005b],_0x5f10b0),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a42_0x2d0708=a42_0x64eb;(function(_0x220979,_0x543c8f){const _0x196aad=a42_0x64eb,_0x2a3dd4=_0x220979();while(!![]){try{const _0x5649ba=parseInt(_0x196aad(0x1ea))/0x1*(parseInt(_0x196aad(0x1f0))/0x2)+-parseInt(_0x196aad(0x202))/0x3*(parseInt(_0x196aad(0x1d2))/0x4)+parseInt(_0x196aad(0x1e8))/0x5+parseInt(_0x196aad(0x1e0))/0x6+-parseInt(_0x196aad(0x1e4))/0x7*(-parseInt(_0x196aad(0x1e6))/0x8)+-parseInt(_0x196aad(0x1f2))/0x9*(-parseInt(_0x196aad(0x1f8))/0xa)+parseInt(_0x196aad(0x1c9))/0xb*(-parseInt(_0x196aad(0x1dc))/0xc);if(_0x5649ba===_0x543c8f)break;else _0x2a3dd4['push'](_0x2a3dd4['shift']());}catch(_0x47bffb){_0x2a3dd4['push'](_0x2a3dd4['shift']());}}}(a42_0x4adf,0xd8ad9));function a42_0x4adf(){const _0x393c49=['error','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','green','3336kffZKp','red','isAbsolute','Error:\x20Path\x20is\x20required\x0a','826038ovmftM','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','parentId','2027753TVNUNY','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','24pXocBv','Use:\x20tdx\x20segment\x20use\x20','373835SCDJAr','parentName','77GFgvqo','dim','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segmentPath','execute','44618SKYEFR','parent_segment','242685NiwFpb','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','log','type','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Examples:','10OjHWDH','Site:\x20','folderPath','segment','data','verbose','length','Resolved\x20relative\x20path\x20to:\x20','folderId','name','6762qdVgZL','isDirectory','fullPath','segments','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','68596WFWJnb','split','join','description','site','config','cyan','segment:use','✔\x20Context\x20set\x20to:\x20','364EEUshO','Resolving\x20path\x20\x27','Target\x20path:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'];a42_0x4adf=function(){return _0x393c49;};return a42_0x4adf();}function a42_0x64eb(_0x1262f5,_0x177eb7){_0x1262f5=_0x1262f5-0x1c7;const _0x4adf4e=a42_0x4adf();let _0x64eb13=_0x4adf4e[_0x1262f5];return _0x64eb13;}import{existsSync,statSync}from'fs';import a42_0x1bcb5f from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a42_0x2d0708(0x201)]=a42_0x2d0708(0x1d0);[a42_0x2d0708(0x1cc)]=a42_0x2d0708(0x1d5);async[a42_0x2d0708(0x1ef)](_0x4106e7){const _0x53d5f1=a42_0x2d0708,{options:_0x5b8279,args:_0x4f7bac,tdx:_0x16e8d1}=_0x4106e7;if(_0x4f7bac['length']===0x0)return console['error'](a42_0x1bcb5f['red'](_0x53d5f1(0x1df))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1f7)),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1f6)),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1ed)),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1d7)),console['error'](_0x53d5f1(0x1e1)),0x1;const _0x2a7514=_0x4f7bac[0x0],_0x91d2e3=_0x5b8279['session'];try{if(_0x2a7514==='/')return saveSessionContext({'segment_path':undefined},_0x91d2e3),console['log'](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d9))),0x0;if(existsSync(_0x2a7514)&&statSync(_0x2a7514)[_0x53d5f1(0x203)]()){let _0x3579f6;try{_0x3579f6=findTdxConfig(_0x2a7514);}catch{return console[_0x53d5f1(0x1d8)](a42_0x1bcb5f['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x2a7514)),console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1cf)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x20fe13=_0x3579f6[_0x53d5f1(0x1ce)][_0x53d5f1(0x1f1)];return saveSessionContext({'segment_path':_0x20fe13,'parent_segment':_0x20fe13},_0x91d2e3),console[_0x53d5f1(0x1f4)](a42_0x1bcb5f['green'](_0x53d5f1(0x1d1)+a42_0x1bcb5f[_0x53d5f1(0x1cf)](_0x20fe13))),0x0;}const _0x252615=_0x5b8279[_0x53d5f1(0x1ee)];let _0x326f88=_0x2a7514;const _0x1ef31e=parsePath(_0x2a7514);if(!_0x1ef31e[_0x53d5f1(0x1de)]){if(!_0x252615)return console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1dd)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x53d5f1(0x1d8)](a42_0x1bcb5f['cyan'](_0x53d5f1(0x1e5))),0x1;if(_0x2a7514==='..'){const _0x219b4b=_0x252615[_0x53d5f1(0x1ca)]('/')['slice'](0x0,-0x1)[_0x53d5f1(0x1cb)]('/');_0x326f88=_0x219b4b||'/';}else _0x2a7514==='.'?_0x326f88=_0x252615:_0x326f88=_0x252615+'/'+_0x2a7514;_0x5b8279[_0x53d5f1(0x1fd)]&&console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1ff)+_0x326f88);}if(_0x326f88==='/'||_0x326f88==='')return saveSessionContext({'segment_path':undefined},_0x91d2e3),console[_0x53d5f1(0x1f4)](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d9))),0x0;_0x326f88=normalizePath(_0x326f88);const _0x273439=parsePath(_0x326f88)[_0x53d5f1(0x1c7)];if(_0x273439[_0x53d5f1(0x1fe)]===0x0)return saveSessionContext({'segment_path':undefined},_0x91d2e3),console['log'](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d9))),0x0;_0x5b8279[_0x53d5f1(0x1fd)]&&(console['error'](_0x53d5f1(0x1f9)+_0x5b8279[_0x53d5f1(0x1cd)]),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1d4)+_0x326f88));const _0x319e55=await withSpinner(_0x53d5f1(0x1d3)+_0x326f88+'\x27...',()=>_0x16e8d1[_0x53d5f1(0x1fb)]['resolvePathToResource'](_0x326f88),{'verbose':_0x5b8279[_0x53d5f1(0x1fd)]}),_0x2234eb=_0x319e55[_0x53d5f1(0x1fc)];_0x5b8279[_0x53d5f1(0x1fd)]&&(console[_0x53d5f1(0x1d8)]('Resolved\x20path\x20type:\x20'+_0x2234eb[_0x53d5f1(0x1f5)]),console['error'](_0x53d5f1(0x1d6)+_0x2234eb[_0x53d5f1(0x1e3)]),_0x2234eb[_0x53d5f1(0x200)]&&console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1ec)+_0x2234eb[_0x53d5f1(0x200)]));if(_0x2234eb[_0x53d5f1(0x1f5)]==='segment')return console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1dd)](_0x53d5f1(0x1da))),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1e2)),console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1cf)](_0x53d5f1(0x1e7)+_0x2234eb[_0x53d5f1(0x1e9)]+(_0x2234eb[_0x53d5f1(0x1fa)]?'/'+_0x2234eb[_0x53d5f1(0x1fa)][_0x53d5f1(0x1cb)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2234eb[_0x53d5f1(0x204)],'parent_segment':_0x2234eb[_0x53d5f1(0x1e9)]},_0x91d2e3),console[_0x53d5f1(0x1f4)](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d1)+a42_0x1bcb5f['cyan'](_0x2234eb[_0x53d5f1(0x204)]))),_0x5b8279[_0x53d5f1(0x1fd)]&&(console['error'](a42_0x1bcb5f[_0x53d5f1(0x1eb)](_0x53d5f1(0x1f3))),console['error'](a42_0x1bcb5f[_0x53d5f1(0x1eb)](_0x53d5f1(0x1c8)))),0x0;}catch(_0x23f93a){throw _0x23f93a;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x4f2733=a43_0x2d4b;(function(_0x252a5c,_0x81b677){const _0x448ec3=a43_0x2d4b,_0xefee54=_0x252a5c();while(!![]){try{const _0x5e0175=-parseInt(_0x448ec3(0xd2))/0x1*(parseInt(_0x448ec3(0xd4))/0x2)+parseInt(_0x448ec3(0xeb))/0x3*(parseInt(_0x448ec3(0xe6))/0x4)+parseInt(_0x448ec3(0xd6))/0x5*(parseInt(_0x448ec3(0xf0))/0x6)+parseInt(_0x448ec3(0x103))/0x7*(parseInt(_0x448ec3(0xdf))/0x8)+-parseInt(_0x448ec3(0xf1))/0x9+parseInt(_0x448ec3(0x100))/0xa+-parseInt(_0x448ec3(0xe7))/0xb;if(_0x5e0175===_0x81b677)break;else _0xefee54['push'](_0xefee54['shift']());}catch(_0x3d2e63){_0xefee54['push'](_0xefee54['shift']());}}}(a43_0xa698,0x69204));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a43_0x5f2b92 from'chalk';function a43_0xa698(){const _0x1f5fe6=['validCount','yellow','warnings','✔\x20All\x20','16AYXtZL','4367044oApTDy','file','.yml','name','432213ztiGON','error','\x20error(s)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','21858aHzucw','1650870STrfdC','endsWith','Error:\x20Directory\x20not\x20found:\x20','warningCount','valid','type','\x20valid','targetDir','Error:\x20','dim','):\x20','\x20warning(s)','red','log','length','2148990mLVfJe','\x20file(s)\x20with\x20errors,\x20','no_parent','7THAvTh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','.yaml','errors','segment:validate','\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','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','cwd','434831UqJMQb','cyan','2gYkapc','\x20warning(s)\x20found','785YpSviO','hasErrors','execute','description','errorCode','verbose','invalidCount','filePath','helpText','661816okiXmh','Validation\x20failed:\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files'];a43_0xa698=function(){return _0x1f5fe6;};return a43_0xa698();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a43_0x2d4b(_0x49235f,_0x249cf1){_0x49235f=_0x49235f-0xd1;const _0xa69816=a43_0xa698();let _0x2d4b23=_0xa69816[_0x49235f];return _0x2d4b23;}export class SegmentValidateCommand extends BaseCommand{[a43_0x4f2733(0xea)]=a43_0x4f2733(0x107);[a43_0x4f2733(0xd9)]=a43_0x4f2733(0xe1);async[a43_0x4f2733(0xd8)](_0x14b0f8){const _0x30c45c=a43_0x4f2733,{options:_0x1670b9,args:_0x19ddbb}=_0x14b0f8,_0x141a48=_0x1670b9,_0x5052af=await resolveTarget({'arg':_0x19ddbb[0x0],'contextParent':_0x1670b9['parentSegment'],'cwd':process[_0x30c45c(0xd1)]()});if(!isSuccessfulResolution(_0x5052af))return _0x5052af[_0x30c45c(0xda)]===_0x30c45c(0x102)?(console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xe3)](_0x30c45c(0xee))),console[_0x30c45c(0xec)](_0x30c45c(0xef)),console[_0x30c45c(0xec)](_0x30c45c(0x108)),console['error'](_0x30c45c(0x104))):(console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xfd)](_0x30c45c(0xf9)+_0x5052af['message']+'\x0a')),_0x5052af['helpText']&&console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xd3)](_0x5052af[_0x30c45c(0xde)]))),0x1;const _0x6c8889=_0x5052af[_0x30c45c(0xf8)],_0x31649c=_0x5052af[_0x30c45c(0xf6)]===_0x30c45c(0xe8)?_0x5052af[_0x30c45c(0xdd)]:undefined;if(!_0x31649c&&!existsSync(_0x6c8889))return console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xfd)](_0x30c45c(0xf3)+_0x6c8889+'\x0a')),0x1;let _0x1b9187;if(_0x31649c){if(!_0x31649c[_0x30c45c(0xf2)](_0x30c45c(0xe9))&&!_0x31649c[_0x30c45c(0xf2)](_0x30c45c(0x105)))return console['error'](a43_0x5f2b92['red'](_0x30c45c(0x109)+_0x31649c+'\x0a')),0x1;_0x1b9187=[_0x31649c];}else _0x1b9187=findYamlFiles(_0x6c8889);if(_0x1b9187[_0x30c45c(0xff)]===0x0)return console['error'](a43_0x5f2b92[_0x30c45c(0xfd)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x6c8889+'\x0a')),0x1;const _0x15a5f1=validateYamlFiles(_0x1b9187,_0x6c8889),_0x303dfd=calculateSummary(_0x15a5f1);for(const _0x4ee456 of _0x15a5f1){if(!isValidationResult(_0x4ee456))continue;const {relativePath:_0x1bdfe5,source:_0xc33190,result:_0x1e9af7,fileType:_0x48b7bb}=_0x4ee456,_0x2f97e9=_0x48b7bb;if(_0x1e9af7[_0x30c45c(0xf5)]&&_0x1e9af7[_0x30c45c(0xe4)][_0x30c45c(0xff)]===0x0)_0x141a48[_0x30c45c(0xdb)]&&console[_0x30c45c(0xfe)](a43_0x5f2b92['green']('✔\x20'+_0x1bdfe5)+a43_0x5f2b92[_0x30c45c(0xfa)]('\x20('+_0x2f97e9+')'));else _0x1e9af7[_0x30c45c(0xf5)]?(console['log'](a43_0x5f2b92[_0x30c45c(0xe3)]('⚠\x20'+_0x1bdfe5)+a43_0x5f2b92[_0x30c45c(0xfa)]('\x20('+_0x2f97e9+_0x30c45c(0xfb)+_0x1e9af7[_0x30c45c(0xe4)][_0x30c45c(0xff)]+_0x30c45c(0xfc))),console['log'](formatValidationResult(_0x1e9af7,_0xc33190,_0x1bdfe5))):(console[_0x30c45c(0xfe)](a43_0x5f2b92['red']('✖\x20'+_0x1bdfe5)+a43_0x5f2b92['dim']('\x20('+_0x2f97e9+'):\x20'+_0x1e9af7[_0x30c45c(0x106)]['length']+_0x30c45c(0xed))),console[_0x30c45c(0xfe)](formatValidationResult(_0x1e9af7,_0xc33190,_0x1bdfe5)));}return console[_0x30c45c(0xfe)](''),_0x303dfd[_0x30c45c(0xd7)]?(console[_0x30c45c(0xfe)](a43_0x5f2b92[_0x30c45c(0xfd)](_0x30c45c(0xe0)+_0x303dfd[_0x30c45c(0xdc)]+_0x30c45c(0x101)+_0x303dfd[_0x30c45c(0xe2)]+_0x30c45c(0xf7))),_0x303dfd[_0x30c45c(0xf4)]>0x0&&console['log'](a43_0x5f2b92['yellow'](_0x303dfd[_0x30c45c(0xf4)]+_0x30c45c(0xd5))),0x1):(console[_0x30c45c(0xfe)](a43_0x5f2b92['green'](_0x30c45c(0xe5)+_0x303dfd['validCount']+'\x20file(s)\x20valid')),_0x303dfd[_0x30c45c(0xf4)]>0x0&&console[_0x30c45c(0xfe)](a43_0x5f2b92[_0x30c45c(0xe3)](_0x303dfd['warningCount']+_0x30c45c(0xd5))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a44_0x1356(_0x183d7f,_0x12b8c5){_0x183d7f=_0x183d7f-0x1e3;const _0x44eb8f=a44_0x44eb();let _0x13569a=_0x44eb8f[_0x183d7f];return _0x13569a;}const a44_0x1ccd4b=a44_0x1356;(function(_0x52e740,_0x3244f0){const _0x24d412=a44_0x1356,_0xcaa0=_0x52e740();while(!![]){try{const _0x53b92c=parseInt(_0x24d412(0x1fb))/0x1+-parseInt(_0x24d412(0x1f8))/0x2*(-parseInt(_0x24d412(0x1f3))/0x3)+-parseInt(_0x24d412(0x202))/0x4+-parseInt(_0x24d412(0x1f7))/0x5*(-parseInt(_0x24d412(0x1e6))/0x6)+-parseInt(_0x24d412(0x208))/0x7*(parseInt(_0x24d412(0x213))/0x8)+parseInt(_0x24d412(0x1ee))/0x9*(parseInt(_0x24d412(0x1ec))/0xa)+-parseInt(_0x24d412(0x214))/0xb;if(_0x53b92c===_0x3244f0)break;else _0xcaa0['push'](_0xcaa0['shift']());}catch(_0x252439){_0xcaa0['push'](_0xcaa0['shift']());}}}(a44_0x44eb,0x71c17));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x44eb(){const _0x5a4e04=['json','replace','10pjkbxi','\x27...','7344333hjtQjO','localeCompare','\x20journey','site','parentSegment','297yhhQVA','jsonl','error','recursive','734265MYpAVd','7240mUCkKI','List\x20folders\x20and\x20child\x20segments','Set\x20a\x20parent\x20segment\x20context\x20first:','597940wOduEF','children','Listing\x20folders,\x20segments,\x20and\x20journeys...','folderId','log','folder','sort','2658804qKoMLs','segment','map','segments','name','/app/ps/','35aDvtaX','listRecursive','type','listUnifiedWithJourneys','Folder\x20ID:\x20','listUnified','Parent\x20ID:\x20','folders','maxDepth','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','verbose','284960XzgSJh','9945892REEUib','message','(not\x20set)','includes','length','\x20matching\x20\x27','filter','/j/da','\x20\x20Cause:\x20','(empty)','\x20segment','dim','listWithPattern','\x20folder','test','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','resolvePathToResource','journeyBundleName','journeys','data','Resolving\x20path\x20\x27','\x5c$&','✔\x20Built\x20tree\x20with\x20',',\x20and\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','description','cause','parentId','18niqOpD','/e/','format','journey'];a44_0x44eb=function(){return _0x5a4e04;};return a44_0x44eb();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x48b3df from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x1ccd4b(0x206)]='segments';[a44_0x1ccd4b(0x1e3)]=a44_0x1ccd4b(0x1f9);async['execute'](_0x5a5fb9){const _0x346365=a44_0x1ccd4b,{options:_0xd19430,args:_0x4840b2}=_0x5a5fb9,_0x2154ca=_0xd19430[_0x346365(0x1f6)],_0x4641c4=_0x4840b2[0x0];try{const _0x53291c=_0xd19430[_0x346365(0x1f2)];_0xd19430[_0x346365(0x212)]&&(console[_0x346365(0x1f5)]('Site:\x20'+_0xd19430[_0x346365(0x1f1)]),console[_0x346365(0x1f5)]('Parent\x20segment\x20context:\x20'+(_0x53291c||_0x346365(0x216))),_0x4641c4&&console[_0x346365(0x1f5)]('Folder/pattern\x20arg:\x20'+_0x4641c4),_0x2154ca&&console[_0x346365(0x1f5)]('Recursive\x20mode:\x20enabled'));if(!_0x53291c)return console[_0x346365(0x1f5)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console['error'](_0x346365(0x1fa)),console[_0x346365(0x1f5)](_0x346365(0x211)),console[_0x346365(0x1f5)](_0x346365(0x22c)),console[_0x346365(0x1f5)](''),console[_0x346365(0x1f5)](_0x346365(0x223)),0x1;const _0x3100c7=_0x4641c4&&(_0x4641c4[_0x346365(0x217)]('*')||_0x4641c4[_0x346365(0x217)]('?'));if(_0x3100c7)return await this[_0x346365(0x220)](_0x5a5fb9,_0x53291c,_0x4641c4);const _0x8a2b54=_0x4641c4?_0x53291c+'/'+_0x4641c4:_0x53291c;return _0x2154ca?await this['listRecursive'](_0x5a5fb9,_0x8a2b54):await this[_0x346365(0x20d)](_0x5a5fb9,_0x8a2b54);}catch(_0x18038b){if(_0x18038b instanceof SDKError)return console['error']('Error:\x20'+_0x18038b[_0x346365(0x215)]),_0x18038b[_0x346365(0x1e4)]&&console[_0x346365(0x1f5)](_0x346365(0x21c)+_0x18038b['cause']),0x1;throw _0x18038b;}}async['listWithPattern'](_0x447ab2,_0x12b7c0,_0x55358a){const _0x3e4ed5=a44_0x1ccd4b,{options:_0xfb70cf,tdx:_0x4bd1fe}=_0x447ab2,_0x3f46f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x12b7c0+_0x3e4ed5(0x1ed),()=>_0x4bd1fe['segment'][_0x3e4ed5(0x224)](_0x12b7c0),{'verbose':_0xfb70cf[_0x3e4ed5(0x212)]}),_0x15fa6d=_0x3f46f1[_0x3e4ed5(0x227)],_0x2483af=await withSpinner(_0x3e4ed5(0x1fd),()=>_0x4bd1fe['segment'][_0x3e4ed5(0x20b)](_0x15fa6d[_0x3e4ed5(0x1e5)],_0x15fa6d[_0x3e4ed5(0x1fe)]),{'verbose':_0xfb70cf['verbose']}),{folders:_0x52092b,segments:_0x38e706,journeys:_0x3d30c2}=_0x2483af['data'],_0x122fa2=_0x55358a[_0x3e4ed5(0x1eb)](/[.+^${}()|[\]\\]/g,_0x3e4ed5(0x229))[_0x3e4ed5(0x1eb)](/\*/g,'.*')[_0x3e4ed5(0x1eb)](/\?/g,'.'),_0x480b8b=new RegExp('^'+_0x122fa2+'$','i'),_0x13ef53=_0x52092b[_0x3e4ed5(0x21a)](_0x4b338a=>_0x480b8b[_0x3e4ed5(0x222)](_0x4b338a[_0x3e4ed5(0x206)])),_0x58dd72=_0x38e706[_0x3e4ed5(0x21a)](_0x580fd2=>_0x480b8b[_0x3e4ed5(0x222)](_0x580fd2[_0x3e4ed5(0x206)])),_0x800c21=_0x3d30c2[_0x3e4ed5(0x21a)](_0x3b9a18=>_0x480b8b[_0x3e4ed5(0x222)](_0x3b9a18['journeyBundleName'])),_0x35b9fa=_0x13ef53[_0x3e4ed5(0x218)]+_0x58dd72[_0x3e4ed5(0x218)]+_0x800c21[_0x3e4ed5(0x218)];console['error']('✔\x20Found\x20'+_0x13ef53[_0x3e4ed5(0x218)]+'\x20folder'+(_0x13ef53[_0x3e4ed5(0x218)]!==0x1?'s':'')+',\x20'+_0x58dd72[_0x3e4ed5(0x218)]+_0x3e4ed5(0x21e)+(_0x58dd72['length']!==0x1?'s':'')+_0x3e4ed5(0x22b)+_0x800c21['length']+'\x20journey'+(_0x800c21[_0x3e4ed5(0x218)]!==0x1?'s':'')+_0x3e4ed5(0x219)+_0x55358a+'\x27');const _0x242bbd=_0x2d1c2f=>{const _0x5413d2=_0x3e4ed5;return getConsoleNextUrl(_0xfb70cf['site'],'/app/ps/'+_0x15fa6d['parentId']+_0x5413d2(0x1e7)+_0x2d1c2f);},_0x125cce=_0xfb70cf['format']===_0x3e4ed5(0x1ea)||_0xfb70cf[_0x3e4ed5(0x1e8)]===_0x3e4ed5(0x1f4);if(_0x125cce){const _0x1a2124=[..._0x13ef53[_0x3e4ed5(0x204)](_0x5a98ec=>({..._0x5a98ec,'type':'folder'})),..._0x58dd72[_0x3e4ed5(0x204)](_0x5a3a92=>({..._0x5a3a92,'type':_0x3e4ed5(0x203),'url':_0x242bbd(_0x5a3a92['id'])})),..._0x800c21[_0x3e4ed5(0x204)](_0x41e752=>({..._0x41e752,'name':_0x41e752[_0x3e4ed5(0x225)],'type':_0x3e4ed5(0x1e9)}))][_0x3e4ed5(0x201)]((_0x3eea47,_0x5d4f42)=>_0x3eea47[_0x3e4ed5(0x206)][_0x3e4ed5(0x1ef)](_0x5d4f42[_0x3e4ed5(0x206)]));await handleSDKOutput(_0x1a2124,_0xfb70cf);}else{if(_0x35b9fa===0x0)console[_0x3e4ed5(0x1ff)]('No\x20items\x20match\x20pattern:\x20'+_0x55358a);else{console[_0x3e4ed5(0x1ff)](a44_0x48b3df[_0x3e4ed5(0x21f)]('['+_0x12b7c0+']\x20matching\x20\x27'+_0x55358a+'\x27'));const _0x16410d=formatFlatList(_0x13ef53,_0x58dd72,{'showMetadata':!![],'getSegmentUrl':_0x242bbd},_0x800c21);console[_0x3e4ed5(0x1ff)](_0x16410d);}}return 0x0;}async['listUnified'](_0x20c8b1,_0x124eb2){const _0x42a511=a44_0x1ccd4b,{options:_0x35356f,tdx:_0x3bc796}=_0x20c8b1,_0x487aa1=await withSpinner(_0x42a511(0x228)+_0x124eb2+_0x42a511(0x1ed),()=>_0x3bc796[_0x42a511(0x203)]['resolvePathToResource'](_0x124eb2),{'verbose':_0x35356f[_0x42a511(0x212)]}),_0x35d167=_0x487aa1[_0x42a511(0x227)];_0x35356f[_0x42a511(0x212)]&&(console['error'](_0x42a511(0x20e)+_0x35d167[_0x42a511(0x1e5)]),_0x35d167[_0x42a511(0x1fe)]&&console['error'](_0x42a511(0x20c)+_0x35d167[_0x42a511(0x1fe)]));const _0x30e426=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x3bc796[_0x42a511(0x203)][_0x42a511(0x20b)](_0x35d167[_0x42a511(0x1e5)],_0x35d167[_0x42a511(0x1fe)]),{'verbose':_0x35356f[_0x42a511(0x212)]}),{folders:_0x2da561,segments:_0x57ccc1,journeys:_0x16d69f}=_0x30e426[_0x42a511(0x227)],_0x44716e=_0x2da561[_0x42a511(0x218)]+_0x57ccc1[_0x42a511(0x218)]+_0x16d69f[_0x42a511(0x218)];console[_0x42a511(0x1f5)]('✔\x20Found\x20'+_0x2da561['length']+_0x42a511(0x221)+(_0x2da561[_0x42a511(0x218)]!==0x1?'s':'')+',\x20'+_0x57ccc1[_0x42a511(0x218)]+_0x42a511(0x21e)+(_0x57ccc1[_0x42a511(0x218)]!==0x1?'s':'')+_0x42a511(0x22b)+_0x16d69f[_0x42a511(0x218)]+_0x42a511(0x1f0)+(_0x16d69f[_0x42a511(0x218)]!==0x1?'s':''));const _0x5a3510=_0x3ec565=>{const _0x10731a=_0x42a511;return getConsoleNextUrl(_0x35356f[_0x10731a(0x1f1)],_0x10731a(0x207)+_0x35d167[_0x10731a(0x1e5)]+_0x10731a(0x1e7)+_0x3ec565);},_0x14d09f=_0xe93006=>{const _0x5473c8=_0x42a511;return getConsoleNextUrl(_0x35356f[_0x5473c8(0x1f1)],_0x5473c8(0x207)+_0x35d167[_0x5473c8(0x1e5)]+_0x5473c8(0x1e7)+_0xe93006+_0x5473c8(0x21b));},_0x391e20=_0x35356f[_0x42a511(0x1e8)]===_0x42a511(0x1ea)||_0x35356f[_0x42a511(0x1e8)]===_0x42a511(0x1f4);if(_0x391e20){const _0x425f6b=[..._0x2da561[_0x42a511(0x204)](_0x22fbd5=>({..._0x22fbd5,'type':_0x42a511(0x200)})),..._0x57ccc1[_0x42a511(0x204)](_0x3aef95=>({..._0x3aef95,'type':_0x42a511(0x203),'url':_0x5a3510(_0x3aef95['id'])})),..._0x16d69f[_0x42a511(0x204)](_0x3c64c1=>({..._0x3c64c1,'name':_0x3c64c1[_0x42a511(0x225)],'type':'journey','url':_0x14d09f(_0x3c64c1['id'])}))][_0x42a511(0x201)]((_0x9b9bfa,_0xdf44f2)=>_0x9b9bfa['name']['localeCompare'](_0xdf44f2[_0x42a511(0x206)]));await handleSDKOutput(_0x425f6b,_0x35356f);}else{if(_0x44716e===0x0)console[_0x42a511(0x1ff)](a44_0x48b3df[_0x42a511(0x21f)]('['+_0x124eb2+']')),console['log'](_0x42a511(0x21d));else{console['log'](a44_0x48b3df[_0x42a511(0x21f)]('['+_0x124eb2+']'));const _0x4992af=formatFlatList(_0x2da561,_0x57ccc1,{'showMetadata':!![],'getSegmentUrl':_0x5a3510,'getJourneyUrl':_0x14d09f},_0x16d69f);console['log'](_0x4992af);}}return 0x0;}async[a44_0x1ccd4b(0x209)](_0x2b2851,_0x13a1db){const _0x53e6a6=a44_0x1ccd4b,{options:_0x302084,tdx:_0x3a6c48}=_0x2b2851,_0x3dc829=await withSpinner(_0x53e6a6(0x228)+_0x13a1db+_0x53e6a6(0x1ed),()=>_0x3a6c48['segment'][_0x53e6a6(0x224)](_0x13a1db),{'verbose':_0x302084[_0x53e6a6(0x212)]}),_0x3682d9=_0x3dc829[_0x53e6a6(0x227)];_0x302084[_0x53e6a6(0x212)]&&(console['error'](_0x53e6a6(0x20e)+_0x3682d9[_0x53e6a6(0x1e5)]),_0x3682d9[_0x53e6a6(0x1fe)]&&console[_0x53e6a6(0x1f5)](_0x53e6a6(0x20c)+_0x3682d9[_0x53e6a6(0x1fe)]));const _0x11c68e=_0x302084[_0x53e6a6(0x210)]||0xa,_0x27d0b0=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x3a6c48[_0x53e6a6(0x203)][_0x53e6a6(0x209)](_0x3682d9[_0x53e6a6(0x1e5)],_0x3682d9[_0x53e6a6(0x1fe)],0x0,_0x11c68e),{'verbose':_0x302084['verbose']}),_0x40b089=_0x27d0b0[_0x53e6a6(0x227)],_0x157c92=_0x1f7b1a=>{const _0x21d180=_0x53e6a6;let _0x333e86=0x0,_0x481014=0x0,_0x427592=0x0;for(const _0x4be122 of _0x1f7b1a){if(_0x4be122[_0x21d180(0x20a)]===_0x21d180(0x200))_0x333e86++;else{if(_0x4be122[_0x21d180(0x20a)]===_0x21d180(0x203))_0x481014++;else{if(_0x4be122[_0x21d180(0x20a)]==='journey')_0x427592++;}}if(_0x4be122[_0x21d180(0x1fc)]){const _0x11371c=_0x157c92(_0x4be122[_0x21d180(0x1fc)]);_0x333e86+=_0x11371c[_0x21d180(0x20f)],_0x481014+=_0x11371c[_0x21d180(0x205)],_0x427592+=_0x11371c[_0x21d180(0x226)];}}return{'folders':_0x333e86,'segments':_0x481014,'journeys':_0x427592};},_0x32638b=_0x157c92(_0x40b089);console[_0x53e6a6(0x1f5)](_0x53e6a6(0x22a)+_0x32638b[_0x53e6a6(0x20f)]+_0x53e6a6(0x221)+(_0x32638b[_0x53e6a6(0x20f)]!==0x1?'s':'')+',\x20'+_0x32638b[_0x53e6a6(0x205)]+_0x53e6a6(0x21e)+(_0x32638b[_0x53e6a6(0x205)]!==0x1?'s':'')+_0x53e6a6(0x22b)+_0x32638b[_0x53e6a6(0x226)]+_0x53e6a6(0x1f0)+(_0x32638b[_0x53e6a6(0x226)]!==0x1?'s':''));const _0x1479f4=_0x4de72e=>{const _0x570556=_0x53e6a6;return getConsoleNextUrl(_0x302084['site'],'/app/ps/'+_0x3682d9[_0x570556(0x1e5)]+_0x570556(0x1e7)+_0x4de72e);},_0x118ac2=_0x567fca=>{const _0xe482c3=_0x53e6a6;return getConsoleNextUrl(_0x302084[_0xe482c3(0x1f1)],_0xe482c3(0x207)+_0x3682d9[_0xe482c3(0x1e5)]+'/e/'+_0x567fca+_0xe482c3(0x21b));};if(_0x302084['format']===_0x53e6a6(0x1ea)||_0x302084[_0x53e6a6(0x1e8)]===_0x53e6a6(0x1f4))await handleSDKOutput(_0x40b089,_0x302084);else{console[_0x53e6a6(0x1ff)](a44_0x48b3df[_0x53e6a6(0x21f)]('['+_0x13a1db+']'));const _0xfab0ce=formatTree(_0x40b089,{'showMetadata':!![],'getSegmentUrl':_0x1479f4,'getJourneyUrl':_0x118ac2});console[_0x53e6a6(0x1ff)](_0xfab0ce);}return 0x0;}}
|
|
1
|
+
const a44_0x4ca68f=a44_0x303a;(function(_0x4c3632,_0x191dc9){const _0xcb9b08=a44_0x303a,_0x4c7b99=_0x4c3632();while(!![]){try{const _0x4fbd33=-parseInt(_0xcb9b08(0x17f))/0x1+parseInt(_0xcb9b08(0x199))/0x2*(-parseInt(_0xcb9b08(0x196))/0x3)+-parseInt(_0xcb9b08(0x19c))/0x4+-parseInt(_0xcb9b08(0x1b1))/0x5+parseInt(_0xcb9b08(0x177))/0x6+parseInt(_0xcb9b08(0x1a2))/0x7*(parseInt(_0xcb9b08(0x19d))/0x8)+parseInt(_0xcb9b08(0x189))/0x9;if(_0x4fbd33===_0x191dc9)break;else _0x4c7b99['push'](_0x4c7b99['shift']());}catch(_0x3295ee){_0x4c7b99['push'](_0x4c7b99['shift']());}}}(a44_0x4dea,0x38f20));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a44_0x4dea(){const _0xdea195=['verbose','Listing\x20folders,\x20segments,\x20and\x20journeys...','json','filter','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x27...','replace','dim',',\x20and\x20','maxDepth','includes','1079424QlsXHE','length','map','site','Resolving\x20path\x20\x27','segments','type','✔\x20Built\x20tree\x20with\x20','107004RWIDyP','(not\x20set)','recursive','Recursive\x20mode:\x20enabled','Resolving\x20parent\x20segment\x20\x27','cause','/e/','Set\x20a\x20parent\x20segment\x20context\x20first:','listUnifiedWithJourneys','List\x20folders\x20and\x20child\x20segments','7653735gQInLr','test','execute','✔\x20Found\x20','/j/da','sort','Building\x20hierarchy\x20tree...','data','\x20matching\x20\x27','journeyBundleName','\x20segment','error','description','7590cFeNyy','Site:\x20','folderId','122nmXRpB','Error:\x20No\x20parent\x20segment\x20context\x20set.','listUnified','1539324wQdwcn','23144yIHLXS','/app/ps/','segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20\x20Cause:\x20','497IfEqYB','journeys','name','\x5c$&','Folder\x20ID:\x20','\x20folder','No\x20items\x20match\x20pattern:\x20','message','Folder/pattern\x20arg:\x20','parentId','\x20journey','journey','localeCompare','Parent\x20segment\x20context:\x20','jsonl','1781545xpFstl','Parent\x20ID:\x20','listRecursive','resolvePathToResource','log','folders','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','listWithPattern','folder','format'];a44_0x4dea=function(){return _0xdea195;};return a44_0x4dea();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x53e548 from'chalk';function a44_0x303a(_0x5a7b63,_0x5deec1){_0x5a7b63=_0x5a7b63-0x175;const _0x4dea53=a44_0x4dea();let _0x303abb=_0x4dea53[_0x5a7b63];return _0x303abb;}export class SegmentsCommand extends BaseCommand{[a44_0x4ca68f(0x1a4)]=a44_0x4ca68f(0x17c);[a44_0x4ca68f(0x195)]=a44_0x4ca68f(0x188);async[a44_0x4ca68f(0x18b)](_0x17d09c){const _0x263739=a44_0x4ca68f,{options:_0x4e3aae,args:_0x939730}=_0x17d09c,_0x484927=_0x4e3aae[_0x263739(0x181)],_0x49f84a=_0x939730[0x0];try{const _0x4f7d83=_0x4e3aae['parentSegment'];_0x4e3aae[_0x263739(0x1bb)]&&(console[_0x263739(0x194)](_0x263739(0x197)+_0x4e3aae[_0x263739(0x17a)]),console[_0x263739(0x194)](_0x263739(0x1af)+(_0x4f7d83||_0x263739(0x180))),_0x49f84a&&console[_0x263739(0x194)](_0x263739(0x1aa)+_0x49f84a),_0x484927&&console[_0x263739(0x194)](_0x263739(0x182)));if(!_0x4f7d83)return console[_0x263739(0x194)](_0x263739(0x19a)),console[_0x263739(0x194)](''),console[_0x263739(0x194)](_0x263739(0x186)),console[_0x263739(0x194)](_0x263739(0x1a0)),console['error'](_0x263739(0x1bf)),console[_0x263739(0x194)](''),console['error'](_0x263739(0x1b7)),0x1;const _0x2cce91=_0x49f84a&&(_0x49f84a[_0x263739(0x176)]('*')||_0x49f84a[_0x263739(0x176)]('?'));if(_0x2cce91)return await this[_0x263739(0x1b8)](_0x17d09c,_0x4f7d83,_0x49f84a);const _0x31320e=_0x49f84a?_0x4f7d83+'/'+_0x49f84a:_0x4f7d83;return _0x484927?await this[_0x263739(0x1b3)](_0x17d09c,_0x31320e):await this[_0x263739(0x19b)](_0x17d09c,_0x31320e);}catch(_0x16924f){if(_0x16924f instanceof SDKError)return console['error']('Error:\x20'+_0x16924f[_0x263739(0x1a9)]),_0x16924f['cause']&&console[_0x263739(0x194)](_0x263739(0x1a1)+_0x16924f[_0x263739(0x184)]),0x1;throw _0x16924f;}}async[a44_0x4ca68f(0x1b8)](_0x167b85,_0x3ca064,_0x4beff8){const _0x369c7b=a44_0x4ca68f,{options:_0x4b3993,tdx:_0x3a27b0}=_0x167b85,_0x24de57=await withSpinner(_0x369c7b(0x183)+_0x3ca064+_0x369c7b(0x1c0),()=>_0x3a27b0[_0x369c7b(0x19f)][_0x369c7b(0x1b4)](_0x3ca064),{'verbose':_0x4b3993[_0x369c7b(0x1bb)]}),_0x122287=_0x24de57['data'],_0x4b4518=await withSpinner(_0x369c7b(0x1bc),()=>_0x3a27b0['segment']['listUnifiedWithJourneys'](_0x122287[_0x369c7b(0x1ab)],_0x122287['folderId']),{'verbose':_0x4b3993[_0x369c7b(0x1bb)]}),{folders:_0x25024b,segments:_0x35878d,journeys:_0x24461a}=_0x4b4518[_0x369c7b(0x190)],_0x226acb=_0x4beff8[_0x369c7b(0x1c1)](/[.+^${}()|[\]\\]/g,_0x369c7b(0x1a5))[_0x369c7b(0x1c1)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3c69fc=new RegExp('^'+_0x226acb+'$','i'),_0x599664=_0x25024b[_0x369c7b(0x1be)](_0x42e378=>_0x3c69fc['test'](_0x42e378[_0x369c7b(0x1a4)])),_0x43c8e4=_0x35878d[_0x369c7b(0x1be)](_0x5499d6=>_0x3c69fc[_0x369c7b(0x18a)](_0x5499d6[_0x369c7b(0x1a4)])),_0x150e85=_0x24461a['filter'](_0x34ee05=>_0x3c69fc['test'](_0x34ee05[_0x369c7b(0x192)])),_0x42752f=_0x599664[_0x369c7b(0x178)]+_0x43c8e4[_0x369c7b(0x178)]+_0x150e85['length'];console[_0x369c7b(0x194)](_0x369c7b(0x18c)+_0x599664[_0x369c7b(0x178)]+_0x369c7b(0x1a7)+(_0x599664[_0x369c7b(0x178)]!==0x1?'s':'')+',\x20'+_0x43c8e4[_0x369c7b(0x178)]+_0x369c7b(0x193)+(_0x43c8e4[_0x369c7b(0x178)]!==0x1?'s':'')+',\x20and\x20'+_0x150e85['length']+_0x369c7b(0x1ac)+(_0x150e85[_0x369c7b(0x178)]!==0x1?'s':'')+_0x369c7b(0x191)+_0x4beff8+'\x27');const _0x13f4ca=_0x5e0a25=>{const _0x5dc61f=_0x369c7b;return getConsoleNextUrl(_0x4b3993['site'],_0x5dc61f(0x19e)+_0x122287[_0x5dc61f(0x1ab)]+_0x5dc61f(0x185)+_0x5e0a25);},_0x25c8c2=_0x4b3993[_0x369c7b(0x1ba)]==='json'||_0x4b3993['format']===_0x369c7b(0x1b0);if(_0x25c8c2){const _0xa35fe8=[..._0x599664['map'](_0x276193=>({..._0x276193,'type':'folder'})),..._0x43c8e4[_0x369c7b(0x179)](_0x5dcd3d=>({..._0x5dcd3d,'type':_0x369c7b(0x19f),'url':_0x13f4ca(_0x5dcd3d['id'])})),..._0x150e85[_0x369c7b(0x179)](_0xab2c46=>({..._0xab2c46,'name':_0xab2c46['journeyBundleName'],'type':_0x369c7b(0x1ad)}))][_0x369c7b(0x18e)]((_0x118e41,_0x495f8a)=>_0x118e41['name'][_0x369c7b(0x1ae)](_0x495f8a[_0x369c7b(0x1a4)]));await handleSDKOutput(_0xa35fe8,_0x4b3993);}else{if(_0x42752f===0x0)console['log'](_0x369c7b(0x1a8)+_0x4beff8);else{console[_0x369c7b(0x1b5)](a44_0x53e548[_0x369c7b(0x1c2)]('['+_0x3ca064+']\x20matching\x20\x27'+_0x4beff8+'\x27'));const _0xb84aa9=formatFlatList(_0x599664,_0x43c8e4,{'showMetadata':!![],'getSegmentUrl':_0x13f4ca},_0x150e85);console[_0x369c7b(0x1b5)](_0xb84aa9);}}return 0x0;}async[a44_0x4ca68f(0x19b)](_0x2430e1,_0x1939a8){const _0x3c39b5=a44_0x4ca68f,{options:_0x258f21,tdx:_0x2da954}=_0x2430e1,_0x3c3bb2=await withSpinner(_0x3c39b5(0x17b)+_0x1939a8+_0x3c39b5(0x1c0),()=>_0x2da954[_0x3c39b5(0x19f)]['resolvePathToResource'](_0x1939a8),{'verbose':_0x258f21[_0x3c39b5(0x1bb)]}),_0x40cfd3=_0x3c3bb2[_0x3c39b5(0x190)];_0x258f21[_0x3c39b5(0x1bb)]&&(console[_0x3c39b5(0x194)]('Parent\x20ID:\x20'+_0x40cfd3['parentId']),_0x40cfd3[_0x3c39b5(0x198)]&&console['error']('Folder\x20ID:\x20'+_0x40cfd3[_0x3c39b5(0x198)]));const _0x41a7a7=await withSpinner(_0x3c39b5(0x1bc),()=>_0x2da954['segment'][_0x3c39b5(0x187)](_0x40cfd3[_0x3c39b5(0x1ab)],_0x40cfd3[_0x3c39b5(0x198)]),{'verbose':_0x258f21[_0x3c39b5(0x1bb)]}),{folders:_0x564525,segments:_0x379bfb,journeys:_0x24d6ee}=_0x41a7a7[_0x3c39b5(0x190)],_0xb0b300=_0x564525[_0x3c39b5(0x178)]+_0x379bfb[_0x3c39b5(0x178)]+_0x24d6ee[_0x3c39b5(0x178)];console[_0x3c39b5(0x194)](_0x3c39b5(0x18c)+_0x564525[_0x3c39b5(0x178)]+_0x3c39b5(0x1a7)+(_0x564525[_0x3c39b5(0x178)]!==0x1?'s':'')+',\x20'+_0x379bfb['length']+_0x3c39b5(0x193)+(_0x379bfb[_0x3c39b5(0x178)]!==0x1?'s':'')+_0x3c39b5(0x1c3)+_0x24d6ee[_0x3c39b5(0x178)]+'\x20journey'+(_0x24d6ee[_0x3c39b5(0x178)]!==0x1?'s':''));const _0x1b9145=_0x23a028=>{const _0x7b6960=_0x3c39b5;return getConsoleNextUrl(_0x258f21[_0x7b6960(0x17a)],_0x7b6960(0x19e)+_0x40cfd3[_0x7b6960(0x1ab)]+_0x7b6960(0x185)+_0x23a028);},_0x29229e=_0x125b85=>{const _0x4fcc51=_0x3c39b5;return getConsoleNextUrl(_0x258f21[_0x4fcc51(0x17a)],_0x4fcc51(0x19e)+_0x40cfd3[_0x4fcc51(0x1ab)]+'/e/'+_0x125b85+_0x4fcc51(0x18d));},_0x4b4738=_0x258f21['format']===_0x3c39b5(0x1bd)||_0x258f21[_0x3c39b5(0x1ba)]===_0x3c39b5(0x1b0);if(_0x4b4738){const _0x250730=[..._0x564525['map'](_0x3da927=>({..._0x3da927,'type':_0x3c39b5(0x1b9)})),..._0x379bfb['map'](_0x556ee0=>({..._0x556ee0,'type':_0x3c39b5(0x19f),'url':_0x1b9145(_0x556ee0['id'])})),..._0x24d6ee[_0x3c39b5(0x179)](_0x2c5496=>({..._0x2c5496,'name':_0x2c5496['journeyBundleName'],'type':_0x3c39b5(0x1ad),'url':_0x29229e(_0x2c5496['id'])}))][_0x3c39b5(0x18e)]((_0x82a4ca,_0x5819c9)=>_0x82a4ca[_0x3c39b5(0x1a4)][_0x3c39b5(0x1ae)](_0x5819c9[_0x3c39b5(0x1a4)]));await handleSDKOutput(_0x250730,_0x258f21);}else{if(_0xb0b300===0x0)console[_0x3c39b5(0x1b5)](a44_0x53e548[_0x3c39b5(0x1c2)]('['+_0x1939a8+']')),console[_0x3c39b5(0x1b5)]('(empty)');else{console[_0x3c39b5(0x1b5)](a44_0x53e548[_0x3c39b5(0x1c2)]('['+_0x1939a8+']'));const _0x35a89a=formatFlatList(_0x564525,_0x379bfb,{'showMetadata':!![],'getSegmentUrl':_0x1b9145,'getJourneyUrl':_0x29229e},_0x24d6ee);console[_0x3c39b5(0x1b5)](_0x35a89a);}}return 0x0;}async[a44_0x4ca68f(0x1b3)](_0x5edd3d,_0xe90775){const _0x378f2a=a44_0x4ca68f,{options:_0x158c67,tdx:_0x4b557c}=_0x5edd3d,_0xb3d517=await withSpinner(_0x378f2a(0x17b)+_0xe90775+_0x378f2a(0x1c0),()=>_0x4b557c[_0x378f2a(0x19f)][_0x378f2a(0x1b4)](_0xe90775),{'verbose':_0x158c67['verbose']}),_0x58ae15=_0xb3d517[_0x378f2a(0x190)];_0x158c67[_0x378f2a(0x1bb)]&&(console['error'](_0x378f2a(0x1b2)+_0x58ae15['parentId']),_0x58ae15[_0x378f2a(0x198)]&&console[_0x378f2a(0x194)](_0x378f2a(0x1a6)+_0x58ae15[_0x378f2a(0x198)]));const _0x19565f=_0x158c67[_0x378f2a(0x175)]||0xa,_0x516af6=await withSpinner(_0x378f2a(0x18f),()=>_0x4b557c['segment']['listRecursive'](_0x58ae15[_0x378f2a(0x1ab)],_0x58ae15[_0x378f2a(0x198)],0x0,_0x19565f),{'verbose':_0x158c67[_0x378f2a(0x1bb)]}),_0x17bb71=_0x516af6[_0x378f2a(0x190)],_0x1f0d29=_0x142270=>{const _0x285214=_0x378f2a;let _0x384801=0x0,_0x2e08b2=0x0,_0x57690c=0x0;for(const _0x389912 of _0x142270){if(_0x389912[_0x285214(0x17d)]===_0x285214(0x1b9))_0x384801++;else{if(_0x389912[_0x285214(0x17d)]===_0x285214(0x19f))_0x2e08b2++;else{if(_0x389912['type']===_0x285214(0x1ad))_0x57690c++;}}if(_0x389912['children']){const _0x4c0f88=_0x1f0d29(_0x389912['children']);_0x384801+=_0x4c0f88[_0x285214(0x1b6)],_0x2e08b2+=_0x4c0f88['segments'],_0x57690c+=_0x4c0f88[_0x285214(0x1a3)];}}return{'folders':_0x384801,'segments':_0x2e08b2,'journeys':_0x57690c};},_0x4df655=_0x1f0d29(_0x17bb71);console['error'](_0x378f2a(0x17e)+_0x4df655[_0x378f2a(0x1b6)]+_0x378f2a(0x1a7)+(_0x4df655['folders']!==0x1?'s':'')+',\x20'+_0x4df655[_0x378f2a(0x17c)]+_0x378f2a(0x193)+(_0x4df655['segments']!==0x1?'s':'')+_0x378f2a(0x1c3)+_0x4df655[_0x378f2a(0x1a3)]+'\x20journey'+(_0x4df655[_0x378f2a(0x1a3)]!==0x1?'s':''));const _0x4cdccf=_0x10a51c=>{const _0x5a99ae=_0x378f2a;return getConsoleNextUrl(_0x158c67['site'],'/app/ps/'+_0x58ae15['parentId']+_0x5a99ae(0x185)+_0x10a51c);},_0x4a72d9=_0x4d5f81=>{const _0x32cb40=_0x378f2a;return getConsoleNextUrl(_0x158c67[_0x32cb40(0x17a)],'/app/ps/'+_0x58ae15[_0x32cb40(0x1ab)]+_0x32cb40(0x185)+_0x4d5f81+_0x32cb40(0x18d));};if(_0x158c67[_0x378f2a(0x1ba)]==='json'||_0x158c67[_0x378f2a(0x1ba)]==='jsonl')await handleSDKOutput(_0x17bb71,_0x158c67);else{console[_0x378f2a(0x1b5)](a44_0x53e548[_0x378f2a(0x1c2)]('['+_0xe90775+']'));const _0x5e46fe=formatTree(_0x17bb71,{'showMetadata':!![],'getSegmentUrl':_0x4cdccf,'getJourneyUrl':_0x4a72d9});console[_0x378f2a(0x1b5)](_0x5e46fe);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x1a17c4=a45_0x23c8;(function(_0x5dcaab,_0x2abfb6){const _0x568341=a45_0x23c8,_0x2ab8f4=_0x5dcaab();while(!![]){try{const _0x2063f7=parseInt(_0x568341(0xb0))/0x1+-parseInt(_0x568341(0xbe))/0x2+-parseInt(_0x568341(0xcb))/0x3+-parseInt(_0x568341(0xc2))/0x4+-parseInt(_0x568341(0xce))/0x5+-parseInt(_0x568341(0xbb))/0x6*(parseInt(_0x568341(0xb3))/0x7)+parseInt(_0x568341(0xb9))/0x8;if(_0x2063f7===_0x2abfb6)break;else _0x2ab8f4['push'](_0x2ab8f4['shift']());}catch(_0xf41ab6){_0x2ab8f4['push'](_0x2ab8f4['shift']());}}}(a45_0x5791,0x3a2eb));import{BaseCommand}from'./command.js';function a45_0x23c8(_0xa39d10,_0x3ff66e){_0xa39d10=_0xa39d10-0xab;const _0x579185=a45_0x5791();let _0x23c8ad=_0x579185[_0xa39d10];return _0x23c8ad;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a45_0x5791(){const _0xccf6d=['length','344558TJHUZo','Error:\x20','Table:\x20','\x20row','1504532WkgYdP','args','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','...','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','query','cause','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','807765AuSgEq','database','showTable','529845CcqGqq','error','execute','site','data','✔\x20Retrieved\x20','verbose','limit','54787WkuyJk','Catalog:\x20','Usage:\x20tdx\x20show\x20<database.table>','28DiILCD','Querying\x20','validate','Site:\x20','\x20\x20Cause:\x20','\x20from\x20','9032640Febtzw','message','32874tUEjRd','show'];a45_0x5791=function(){return _0xccf6d;};return a45_0x5791();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a45_0x1a17c4(0xbc);['description']='Show\x20table\x20contents';async[a45_0x1a17c4(0xd0)](_0x289b97){const _0x585bd0=a45_0x1a17c4;return this[_0x585bd0(0xcd)](_0x289b97);}async[a45_0x1a17c4(0xcd)](_0x16d0e7){const _0xdce21c=a45_0x1a17c4,{options:_0x27ae94,args:_0x10211b,tdx:_0x118791}=_0x16d0e7;let _0x2a6b58;try{_0x2a6b58=parseTableReference(_0x10211b[0x0]);const _0x5c6093=_0x27ae94['database'];!_0x2a6b58[_0xdce21c(0xcc)]&&_0x5c6093&&(_0x2a6b58[_0xdce21c(0xcc)]=_0x5c6093);const _0x34449f=validateTableDescribeReference(_0x2a6b58);if(_0x34449f)return console[_0xdce21c(0xcf)](_0xdce21c(0xbf)+_0x34449f),console[_0xdce21c(0xcf)](_0xdce21c(0xb2)),console[_0xdce21c(0xcf)](_0xdce21c(0xca)),console[_0xdce21c(0xcf)](_0xdce21c(0xc4)),0x1;}catch(_0x6f6890){return console['error'](_0xdce21c(0xbf)+_0x6f6890[_0xdce21c(0xba)]),console[_0xdce21c(0xcf)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xdce21c(0xcf)](_0xdce21c(0xca)),console['error'](_0xdce21c(0xc4)),0x1;}const _0x1d21e4=_0x2a6b58['catalog'],_0x412780=_0x2a6b58[_0xdce21c(0xcc)],_0x3344d7=_0x2a6b58['table'],_0x4dbdea=resolveLimit(_0x27ae94[_0xdce21c(0xaf)],DEFAULT_DISPLAY_LIMIT);try{_0x27ae94['verbose']&&(console[_0xdce21c(0xcf)](_0xdce21c(0xb6)+_0x27ae94[_0xdce21c(0xab)]),_0x1d21e4&&console[_0xdce21c(0xcf)](_0xdce21c(0xb1)+_0x1d21e4),console[_0xdce21c(0xcf)]('Database:\x20'+_0x412780),console['error'](_0xdce21c(0xc0)+_0x3344d7),console[_0xdce21c(0xcf)]('Limit:\x20'+_0x4dbdea));const _0x16da4b=_0x1d21e4?_0x1d21e4+'.'+_0x412780+'.'+_0x3344d7:_0x412780+'.'+_0x3344d7,_0x4d5b23=await withSpinner(_0xdce21c(0xb4)+_0x16da4b+_0xdce21c(0xc5),()=>_0x118791[_0xdce21c(0xc8)]['showTable'](_0x412780,_0x3344d7,_0x4dbdea,_0x1d21e4),{'verbose':_0x27ae94[_0xdce21c(0xae)]}),_0x1f09e4=_0x4d5b23[_0xdce21c(0xac)],_0x1a4b7d=_0x1f09e4['data'];return _0x1a4b7d[_0xdce21c(0xbd)]===0x0?console[_0xdce21c(0xcf)](_0xdce21c(0xc6)):console[_0xdce21c(0xcf)](_0xdce21c(0xad)+_0x1a4b7d[_0xdce21c(0xbd)]+_0xdce21c(0xc1)+(_0x1a4b7d[_0xdce21c(0xbd)]!==0x1?'s':'')+_0xdce21c(0xb8)+_0x16da4b),await handleSDKOutput(_0x1a4b7d,_0x27ae94),0x0;}catch(_0x4a30c7){if(_0x4a30c7 instanceof SDKError)return console[_0xdce21c(0xcf)]('Error:\x20'+_0x4a30c7[_0xdce21c(0xba)]),_0x4a30c7[_0xdce21c(0xc9)]&&console[_0xdce21c(0xcf)](_0xdce21c(0xb7)+_0x4a30c7[_0xdce21c(0xc9)]),0x1;throw _0x4a30c7;}}[a45_0x1a17c4(0xb5)](_0xa59c40){const _0x3dcee1=a45_0x1a17c4;if(_0xa59c40[_0x3dcee1(0xc3)][_0x3dcee1(0xbd)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0xa59c40['args']['length']>0x1)return _0x3dcee1(0xc7);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x51d634=a46_0x506c;(function(_0x1cc451,_0x1f096e){const _0x21be20=a46_0x506c,_0x10f0e8=_0x1cc451();while(!![]){try{const _0x31ac77=parseInt(_0x21be20(0xd3))/0x1*(-parseInt(_0x21be20(0xf3))/0x2)+-parseInt(_0x21be20(0xd7))/0x3*(parseInt(_0x21be20(0xe2))/0x4)+-parseInt(_0x21be20(0xe6))/0x5*(parseInt(_0x21be20(0xcd))/0x6)+parseInt(_0x21be20(0xe5))/0x7+parseInt(_0x21be20(0xef))/0x8+-parseInt(_0x21be20(0xd4))/0x9+parseInt(_0x21be20(0xe9))/0xa;if(_0x31ac77===_0x1f096e)break;else _0x10f0e8['push'](_0x10f0e8['shift']());}catch(_0x2c5479){_0x10f0e8['push'](_0x10f0e8['shift']());}}}(a46_0x47aa,0x65da1));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a46_0x47aa(){const _0x23c741=['No\x20credential\x20found','949224XhbWHw','red','Read\x20credential\x20from\x20','error','1143472WEFAvU','displayWithSources','site:\x20','getUserInfo','name','site','email','yellow','25854TBzXCp','config','env','log','User:','N/A','1cmTGgn','2896236TLEvsg','filter','cli','6JraYKW','CLI\x20flag','jobs','dim','description','bold','session','TDX_PROFILE\x20env','first_name','cyan','✓\x20Authentication\x20successful\x0a','739104inhoUu','account_id','(from\x20','4601401EiGmmv','515PfHcPm','message','execute','13481080bxOVzb','status','join','OAuth','\x20profile:\x20'];a46_0x47aa=function(){return _0x23c741;};return a46_0x47aa();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a46_0x506c(_0x279bdc,_0x18e1b0){_0x279bdc=_0x279bdc-0xcd;const _0x47aa19=a46_0x47aa();let _0x506c10=_0x47aa19[_0x279bdc];return _0x506c10;}import{GlobalContext}from'../core/global-context.js';import a46_0x2a76f0 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x51d634(0xf7)]=a46_0x51d634(0xea);[a46_0x51d634(0xdb)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a46_0x51d634(0xe8)](_0xd2fec0){const _0x337200=a46_0x51d634,{options:_0x148d61,tdx:_0x740b4a}=_0xd2fec0,_0x188b7e=_0x148d61[_0x337200(0xf8)],_0xb0fe80=new GlobalContext(_0x148d61),_0x592065=_0xb0fe80['profile'],_0x48e483=_0xb0fe80['profileSource'],_0x4bc06f=_0x48e483===_0x337200(0xd6)?_0x337200(0xd8):_0x48e483===_0x337200(0xdd)?_0x337200(0xdd):_0x48e483===_0x337200(0xcf)?_0x337200(0xde):_0x48e483===_0x337200(0xce)?_0x337200(0xce):null,_0x59f02f=_0x592065?a46_0x2a76f0[_0x337200(0xe0)](_0x592065):a46_0x2a76f0[_0x337200(0xda)](_0x337200(0xd2)),_0x2107a3=_0x4bc06f?'\x20'+a46_0x2a76f0[_0x337200(0xda)](_0x337200(0xe4)+_0x4bc06f+')'):'';console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xdc)]('tdx')+_0x337200(0xed)+_0x59f02f+_0x2107a3+'\x20'+a46_0x2a76f0[_0x337200(0xda)]('(')+_0x337200(0xf5)+a46_0x2a76f0['cyan'](_0x188b7e)+a46_0x2a76f0[_0x337200(0xda)](')'));const _0x16cb83=await getOAuthTokens(_0x592065);if(_0x16cb83)console[_0x337200(0xd0)]('Credential\x20type:\x20'+a46_0x2a76f0[_0x337200(0xe0)](_0x337200(0xec)));else{const _0x3f3a05=await resolveAPIKeyAsync(_0x188b7e,_0x592065);if(_0x3f3a05){const {source:_0x3c4b9b,isDeprecated:_0x1faeeb}=_0x3f3a05,_0xdad065=_0x337200(0xf1)+a46_0x2a76f0[_0x337200(0xe0)](_0x3c4b9b);console[_0x337200(0xd0)](_0x1faeeb?a46_0x2a76f0[_0x337200(0xfa)](_0xdad065):_0xdad065);}else console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xfa)](_0x337200(0xee)));}let _0x2a0e82=![];try{const _0x214c79=await _0x740b4a[_0x337200(0xd9)][_0x337200(0xf6)]();console['log'](a46_0x2a76f0['green'](_0x337200(0xe1))),console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xdc)](_0x337200(0xd1))+'\x20'+a46_0x2a76f0[_0x337200(0xe0)](_0x214c79[_0x337200(0xf9)]));if(_0x214c79[_0x337200(0xdf)]||_0x214c79['last_name']){const _0x144c25=[_0x214c79['first_name'],_0x214c79['last_name']][_0x337200(0xd5)](Boolean)[_0x337200(0xeb)]('\x20');console['log'](a46_0x2a76f0[_0x337200(0xdc)]('Name:')+'\x20'+_0x144c25);}_0x214c79[_0x337200(0xe3)]&&console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xdc)]('Account\x20ID:')+'\x20'+a46_0x2a76f0['yellow'](_0x214c79[_0x337200(0xe3)])),_0x2a0e82=!![];}catch(_0x3f5feb){_0x3f5feb instanceof HTTPClientError&&_0x3f5feb['status']===0x191?printAuthError(_0x3f5feb,!![],_0x592065):console[_0x337200(0xf2)](a46_0x2a76f0[_0x337200(0xf0)]('✗\x20Validation\x20failed:\x20'+(_0x3f5feb instanceof Error?_0x3f5feb[_0x337200(0xe7)]:String(_0x3f5feb))));}return console[_0x337200(0xd0)](),_0xb0fe80[_0x337200(0xf4)](),_0x2a0e82?0x0:0x1;}}
|