@treasuredata/tdx 2026.3.44 → 2026.3.46
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.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/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/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.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/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/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/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 a41_0x5a417b=a41_0x154b;(function(_0x4e1dc3,_0x254d79){const _0x666080=a41_0x154b,_0x5dc7db=_0x4e1dc3();while(!![]){try{const _0x4f4c6c=-parseInt(_0x666080(0x1ca))/0x1+parseInt(_0x666080(0x1d2))/0x2+-parseInt(_0x666080(0x1c7))/0x3*(-parseInt(_0x666080(0x1bd))/0x4)+-parseInt(_0x666080(0x1b5))/0x5+parseInt(_0x666080(0x19c))/0x6*(-parseInt(_0x666080(0x1b8))/0x7)+parseInt(_0x666080(0x1ab))/0x8+parseInt(_0x666080(0x1ac))/0x9;if(_0x4f4c6c===_0x254d79)break;else _0x5dc7db['push'](_0x5dc7db['shift']());}catch(_0x1c33c0){_0x5dc7db['push'](_0x5dc7db['shift']());}}}(a41_0x1ddb,0xaee6c));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 a41_0x3921dc from'chalk';function a41_0x1ddb(){const _0x3884bb=['8273754JxapZj','setPhase','message','\x20files\x20to\x20','yes','name','filter','journeyVersions','dirname','3477580cdyawi','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','red','7OdazsK','pullSegments','relativePath','\x20versions)','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','28yJMiHJ','isNew','Pulling\x20segments\x20from\x20\x27','segments','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)','\x20journeys','targetDir','\x20new\x20files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','328470zORstO','✔\x20Context\x20set:\x20','diff','453495tYoNCM','\x0aPull\x20summary\x20for\x20\x27','green','yellow','\x20activations','journeys','utf-8','\x20\x20🎯\x20','1977442mepjus','counts','session','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','no_parent','\x20\x20Target:\x20','cyan','parent_segment','Target\x20resource:\x20','execute','site','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20=\x20','\x20changed\x20files','activations','files','length','5003916qtTjrw','\x27...','\x20segments','verbose','\x0aChanges\x20to\x20\x27','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentName','Aborted.','absolutePath','\x0aError:','dim','Error:\x20','repeat','Site:\x20','199488fnHUYE'];a41_0x1ddb=function(){return _0x3884bb;};return a41_0x1ddb();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0x69502c from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a41_0x154b(_0x58367a,_0x17efc8){_0x58367a=_0x58367a-0x191;const _0x1ddb8b=a41_0x1ddb();let _0x154bb8=_0x1ddb8b[_0x58367a];return _0x154bb8;}export class SegmentPullCommand extends BaseCommand{[a41_0x5a417b(0x1b1)]='segment:pull';['description']=a41_0x5a417b(0x1bc);async[a41_0x5a417b(0x194)](_0x362755){const _0x1ec219=a41_0x5a417b,{options:_0x52b3fe,args:_0x570dc3,tdx:_0x3a4aea}=_0x362755,_0x85bdb7=_0x52b3fe,_0x7bbb0e=await resolveTarget({'arg':_0x570dc3[0x0],'contextParent':_0x52b3fe['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x7bbb0e))return _0x7bbb0e['errorCode']===_0x1ec219(0x1d7)?(console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cd)](_0x1ec219(0x1c5))),console[_0x1ec219(0x1c6)](_0x1ec219(0x1c1)),console[_0x1ec219(0x1c6)](_0x1ec219(0x1b6)),console[_0x1ec219(0x1c6)](_0x1ec219(0x1d6))):(console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1b7)](_0x1ec219(0x1a8)+_0x7bbb0e[_0x1ec219(0x1ae)]+'\x0a')),_0x7bbb0e['helpText']&&console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x191)](_0x7bbb0e['helpText']))),0x1;const _0x38d78b=_0x7bbb0e['parentName'],_0x15d81f=_0x7bbb0e[_0x1ec219(0x1c3)],_0x3ef96b=_0x7bbb0e['type']==='file'?_0x7bbb0e['resourceName']:undefined;_0x85bdb7[_0x1ec219(0x19f)]&&(console[_0x1ec219(0x1c6)](_0x1ec219(0x1aa)+_0x85bdb7[_0x1ec219(0x195)]),console[_0x1ec219(0x1c6)]('Parent\x20segment:\x20'+_0x38d78b),_0x3ef96b&&console[_0x1ec219(0x1c6)](_0x1ec219(0x193)+_0x3ef96b));const _0x5164d3=await withProgressSpinner(_0x1ec219(0x1bf)+_0x38d78b+_0x1ec219(0x19d),_0x2ce23f=>_0x3a4aea['segment'][_0x1ec219(0x1b9)](_0x38d78b,{'targetDir':_0x15d81f,'targetResourceName':_0x3ef96b,'verbose':_0x85bdb7[_0x1ec219(0x19f)],'progress':{'update':_0x15d3e1=>{const _0x326a3e=_0x1ec219;_0x2ce23f[_0x326a3e(0x1ad)](_0x15d3e1),_0x85bdb7[_0x326a3e(0x19f)]&&console[_0x326a3e(0x1c6)]('\x20\x20'+_0x15d3e1);}}}),{'verbose':_0x85bdb7['verbose']}),_0x9df786=_0x5164d3['data'];if(_0x9df786[_0x1ec219(0x1d3)]['segments']===0x0&&_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]===0x0)return console['error'](a41_0x3921dc['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x9df786['parentName']+'\x27')),0x0;const _0x158b4c=_0x9df786['files']['filter'](_0x3541ae=>_0x3541ae[_0x1ec219(0x1be)]),_0x403d36=_0x9df786['files'][_0x1ec219(0x1b2)](_0x2c0ae9=>!_0x2c0ae9[_0x1ec219(0x1be)]&&_0x2c0ae9[_0x1ec219(0x1a1)]),_0x10f9d0=_0x9df786[_0x1ec219(0x19a)][_0x1ec219(0x1b2)](_0x714736=>!_0x714736['isNew']&&!_0x714736[_0x1ec219(0x1a1)]);console[_0x1ec219(0x1c6)](_0x1ec219(0x1cb)+_0x9df786[_0x1ec219(0x1a3)]+'\x27:'),console[_0x1ec219(0x1c6)](_0x1ec219(0x1d1)+a41_0x3921dc[_0x1ec219(0x191)](_0x9df786['counts'][_0x1ec219(0x1c0)]+_0x1ec219(0x19e))+'\x20with\x20'+a41_0x3921dc[_0x1ec219(0x191)](_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x199)]+_0x1ec219(0x1ce)));if(_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]>0x0){const _0x39a148=_0x9df786['counts'][_0x1ec219(0x1b3)]>_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]?'\x20('+_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1b3)]+_0x1ec219(0x1bb):'';console[_0x1ec219(0x1c6)]('\x20\x20🗺️\x20\x20'+a41_0x3921dc[_0x1ec219(0x191)](_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]+_0x1ec219(0x1c2))+a41_0x3921dc['dim'](_0x39a148));}console[_0x1ec219(0x1c6)]('\x20\x20'+a41_0x3921dc[_0x1ec219(0x1cc)]('+\x20'+_0x158b4c[_0x1ec219(0x19b)]+_0x1ec219(0x1c4))),console[_0x1ec219(0x1c6)]('\x20\x20'+a41_0x3921dc[_0x1ec219(0x1cd)]('~\x20'+_0x403d36['length']+_0x1ec219(0x198))),console['error']('\x20\x20'+a41_0x3921dc[_0x1ec219(0x1a7)]('=\x20'+_0x10f9d0[_0x1ec219(0x19b)]+'\x20unchanged\x20files')),console[_0x1ec219(0x1c6)](_0x1ec219(0x1d8)+a41_0x3921dc['cyan'](_0x9df786['targetDir'])+'\x0a');if(_0x403d36['length']>0x0)for(const _0x48a646 of _0x403d36){console[_0x1ec219(0x1c6)](_0x1ec219(0x1a0)+_0x48a646[_0x1ec219(0x1ba)]+'\x27:'),console['error']('─'[_0x1ec219(0x1a9)](0x3c)),console['error'](_0x48a646[_0x1ec219(0x1c9)]),console[_0x1ec219(0x1c6)]('─'[_0x1ec219(0x1a9)](0x3c));}if(_0x85bdb7[_0x1ec219(0x1d5)])return console[_0x1ec219(0x1c6)](a41_0x3921dc['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x158b4c[_0x1ec219(0x19b)]===0x0&&_0x403d36[_0x1ec219(0x19b)]===0x0)return console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cc)](_0x1ec219(0x196))),saveSessionContext({'parent_segment':_0x9df786[_0x1ec219(0x1a3)]},_0x85bdb7[_0x1ec219(0x1d4)]),console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cc)]('✔\x20Context\x20set:\x20'+a41_0x3921dc[_0x1ec219(0x1a7)](_0x1ec219(0x192))+_0x1ec219(0x197)+a41_0x3921dc['cyan'](_0x9df786[_0x1ec219(0x1a3)]))),0x0;if(!_0x85bdb7[_0x1ec219(0x1b0)]){if(!isInteractive())return console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1b7)](_0x1ec219(0x1a6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x3921dc[_0x1ec219(0x1a7)](_0x1ec219(0x1a2))),0x1;const _0x4a7b29=await confirmKey('Write\x20'+(_0x158b4c[_0x1ec219(0x19b)]+_0x403d36['length'])+'\x20files?');if(!_0x4a7b29)return console[_0x1ec219(0x1c6)](a41_0x3921dc['yellow'](_0x1ec219(0x1a4)),'-\x20no\x20files\x20written'),0x1;}for(const _0x315c1b of _0x9df786[_0x1ec219(0x19a)]){if(_0x315c1b[_0x1ec219(0x1be)]||_0x315c1b[_0x1ec219(0x1a1)]){const _0x28c2d1=a41_0x69502c[_0x1ec219(0x1b4)](_0x315c1b['absolutePath']);!existsSync(_0x28c2d1)&&mkdirSync(_0x28c2d1,{'recursive':!![]}),writeFileSync(_0x315c1b[_0x1ec219(0x1a5)],_0x315c1b['content'],_0x1ec219(0x1d0));}}return console[_0x1ec219(0x1c6)](a41_0x3921dc['green']('✔\x20Pulled\x20'+(_0x158b4c['length']+_0x403d36[_0x1ec219(0x19b)])+_0x1ec219(0x1af)+_0x9df786[_0x1ec219(0x1c3)])),saveSessionContext({'parent_segment':_0x9df786[_0x1ec219(0x1a3)]},_0x85bdb7[_0x1ec219(0x1d4)]),console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cc)](_0x1ec219(0x1c8)+a41_0x3921dc['dim']('parent_segment')+_0x1ec219(0x197)+a41_0x3921dc['cyan'](_0x9df786[_0x1ec219(0x1a3)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x482ef9=a42_0x26d8;(function(_0x46ae15,_0x5e639c){const _0x5c3051=a42_0x26d8,_0x3f9a4e=_0x46ae15();while(!![]){try{const _0x34b1ce=parseInt(_0x5c3051(0x20a))/0x1+-parseInt(_0x5c3051(0x1fd))/0x2+-parseInt(_0x5c3051(0x1b2))/0x3*(-parseInt(_0x5c3051(0x223))/0x4)+parseInt(_0x5c3051(0x1da))/0x5+parseInt(_0x5c3051(0x229))/0x6*(parseInt(_0x5c3051(0x22e))/0x7)+-parseInt(_0x5c3051(0x1e8))/0x8*(-parseInt(_0x5c3051(0x227))/0x9)+-parseInt(_0x5c3051(0x1a5))/0xa;if(_0x34b1ce===_0x5e639c)break;else _0x3f9a4e['push'](_0x3f9a4e['shift']());}catch(_0x2e2b50){_0x3f9a4e['push'](_0x3f9a4e['shift']());}}}(a42_0x40e5,0x79948));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 a42_0x12b57d from'chalk';import{existsSync}from'fs';function a42_0x26d8(_0x49aa22,_0x5a17c2){_0x49aa22=_0x49aa22-0x199;const _0x40e52b=a42_0x40e5();let _0x26d801=_0x40e52b[_0x49aa22];return _0x26d801;}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 a42_0x40e5(){const _0x30f92b=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeyBundleName','diff','Preparing\x20journeys...','createdAt','repeat','1276503LpEpSZ','\x20to\x20update','name','\x20deleted','\x20\x20Activations:\x20','cwd','deleted','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Activations:','\x20\x20\x20\x20','\x20updated','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','blue','journeysOnly','description','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aValidation\x20failed:','Fetching\x20existing\x20data...','green','Changes\x20to\x20journey:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','join','updated','Site:\x20','then','yes','\x20new','Delete\x20segment:','connection','yellow','type','existingSegment','folderPath','Scoped\x20to\x20folder:\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)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','.yml','\x20\x20Journeys:\x20','listJourneysWithDetailsFromParentSegment','82130qxZAuf','state','push','\x20changed','Aborted.','file','errorCode','message','(Journey\x20will\x20be\x20deleted)','Resolving\x20parent\x20segment\x20\x27','Delete\x20journey:','\x20created','segment\x20or\x20journey','Changes\x20to:','3561896lLcvQX','length','journey','site','Parent\x20segment:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Folders\x20to\x20create:','\x20unchanged','versionNumber','/j/da/je','getOutputSchemaWithCache','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','error','user','isNew','journeys','Error:\x20','Source\x20directory:\x20','isScoped','nameToId','/app/ps/','165170SRItDP','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','audienceId','listFolders','createdSegmentIds','targetDir','\x20\x20📊\x20Segments:','/sb/da/esr','unchanged','filter','New\x20journey:','dryRun','Fetching\x20existing\x20activations...','127499pKXlEa','set','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','listSegments','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parentFolder','filePath','listActivations','Error:\x20Directory\x20not\x20found:\x20','buildUserMaps','\x20changes?','\x0aError:','dim','results','parent_name','delete','map','helpText','get','attributes','yamlConfig','changed','journeyId','data','updatedAt','4vfDtbR','red','folderId','parentName','9meFLfu','all','2148QeDBGy','resolveParentId','toString','\x20to\x20delete','/e/','9345ZYybVc','created','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x27...','activations','execute','segmentFolderId','setPhase','getParent','endsWith','scopedFolderPath','segment:push','paused','toCreate','segments','\x20\x20🗺️\x20\x20Journeys:','verbose','9120160OtNFui','segment','existingJourney','cyan','\x20activations]','nameToType','new'];a42_0x40e5=function(){return _0x30f92b;};return a42_0x40e5();}export class SegmentPushCommand extends BaseCommand{[a42_0x482ef9(0x1b4)]=a42_0x482ef9(0x19f);[a42_0x482ef9(0x1c1)]=a42_0x482ef9(0x20c);async[a42_0x482ef9(0x199)](_0x401f1c){const _0x252899=a42_0x482ef9,{options:_0x340edf,args:_0xb08b06,tdx:_0x266558}=_0x401f1c,_0x441b6c=_0x340edf,_0x5b4a12=await resolveTarget({'arg':_0xb08b06[0x0],'contextParent':_0x340edf['parentSegment'],'cwd':process[_0x252899(0x1b7)]()});if(!isSuccessfulResolution(_0x5b4a12))return _0x5b4a12[_0x252899(0x1e0)]==='no_parent'?(console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1d0)](_0x252899(0x20e))),console[_0x252899(0x1f4)](_0x252899(0x1d5)),console[_0x252899(0x1f4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x252899(0x1f4)](_0x252899(0x1f3))):(console['error'](a42_0x12b57d[_0x252899(0x224)](_0x252899(0x1f8)+_0x5b4a12[_0x252899(0x1e1)]+'\x0a')),_0x5b4a12[_0x252899(0x21b)]&&console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1a8)](_0x5b4a12['helpText']))),0x1;if(_0x5b4a12[_0x252899(0x1d1)]===_0x252899(0x218))return console['error'](a42_0x12b57d[_0x252899(0x224)](_0x252899(0x212)+_0x5b4a12[_0x252899(0x202)]+'\x0a')),console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1a8)](_0x252899(0x230))),0x1;const _0x21a0cf=_0x5b4a12[_0x252899(0x226)],_0x6dbfaa=_0x5b4a12[_0x252899(0x202)],_0x23495f=_0x5b4a12[_0x252899(0x1d1)]===_0x252899(0x1df)?_0x5b4a12[_0x252899(0x210)]:undefined,_0x49b769=getScopedDetails(_0x5b4a12),_0x284f13=_0x49b769?.[_0x252899(0x1fa)]??![],_0xd6d5fd=_0x49b769?.[_0x252899(0x19e)]??'';if(!existsSync(_0x6dbfaa))return console[_0x252899(0x1f4)](a42_0x12b57d['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x6dbfaa+'\x0a')),console['error'](a42_0x12b57d[_0x252899(0x1a8)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x441b6c['verbose']&&(console[_0x252899(0x1f4)](_0x252899(0x1ca)+_0x441b6c['site']),console[_0x252899(0x1f4)](_0x252899(0x1ec)+_0x21a0cf),console[_0x252899(0x1f4)](_0x252899(0x1f9)+_0x6dbfaa),_0x284f13&&console[_0x252899(0x1f4)](_0x252899(0x1d4)+_0xd6d5fd));const _0x1c870d=await withSpinner(_0x252899(0x1e3)+_0x21a0cf+_0x252899(0x232),()=>_0x266558['segment'][_0x252899(0x22a)](_0x21a0cf),{'verbose':_0x441b6c[_0x252899(0x1a4)]}),_0x4357b8=_0x1c870d[_0x252899(0x221)],{parentSegmentResult:_0xcae946,segmentsResult:_0x3254a5,foldersResult:_0x440b4b,journeysWithDetailsResult:_0x5b176d,userMaps:_0x531228}=await withSpinner(_0x252899(0x1c4),async()=>{const _0x4e1290=_0x252899,[_0x594d20,_0x3c063f,_0x524b1b,_0x1d30a9,_0x33c15b]=await Promise[_0x4e1290(0x228)]([_0x266558['segment'][_0x4e1290(0x19c)](_0x4357b8),_0x266558[_0x4e1290(0x1a6)][_0x4e1290(0x20d)](_0x4357b8),_0x266558[_0x4e1290(0x1a6)][_0x4e1290(0x200)](_0x4357b8),_0x266558[_0x4e1290(0x1ea)][_0x4e1290(0x1d9)](_0x4357b8,{'includeAllVersions':!![]}),_0x266558[_0x4e1290(0x1f5)][_0x4e1290(0x213)]()]);return{'parentSegmentResult':_0x594d20,'segmentsResult':_0x3c063f,'foldersResult':_0x524b1b,'journeysWithDetailsResult':_0x1d30a9,'userMaps':_0x33c15b};},{'verbose':_0x441b6c[_0x252899(0x1a4)]})[_0x252899(0x1cb)](_0x13e1c5=>_0x13e1c5[_0x252899(0x221)]),_0x38471e=_0xcae946,_0x480699=extractRootFolderId(_0x38471e),_0x34cf76=_0x3254a5,_0x2b4af4=_0x440b4b,{journeys:_0x4e5df9,activationStepsById:_0x4ae57b}=_0x5b176d,_0x398d03=new Map(_0x4e5df9[_0x252899(0x21a)](_0x20b523=>[_0x20b523['id'],_0x20b523])),_0x5c056a=_0x4e5df9[_0x252899(0x21a)](_0xf5c60e=>({'id':_0xf5c60e['id'],'name':_0xf5c60e[_0x252899(0x21d)][_0x252899(0x1b4)],'journeyBundleName':_0xf5c60e[_0x252899(0x21d)]['journeyBundleName']||'','journeyBundleId':_0xf5c60e[_0x252899(0x21d)]['journeyBundleId']||'','versionNumber':_0xf5c60e[_0x252899(0x21d)][_0x252899(0x1f0)],'description':_0xf5c60e['attributes']['description'],'state':_0xf5c60e[_0x252899(0x21d)][_0x252899(0x1db)],'paused':_0xf5c60e[_0x252899(0x21d)][_0x252899(0x1a0)],'audienceId':_0xf5c60e[_0x252899(0x21d)][_0x252899(0x1ff)],'folderId':_0xf5c60e['relationships']?.[_0x252899(0x20f)]?.[_0x252899(0x221)]?.['id'],'createdAt':_0xf5c60e[_0x252899(0x21d)][_0x252899(0x1b0)],'updatedAt':_0xf5c60e[_0x252899(0x21d)][_0x252899(0x222)]})),{emailToId:_0x43da63,idToEmail:_0x57fdec}=_0x531228,_0x58bd6b=await withSpinner(_0x252899(0x1c2),async()=>{const _0x3a7015=_0x252899,_0x367aba=await _0x266558[_0x3a7015(0x1cf)]['list']();return buildConnectionMaps(_0x367aba);},{'verbose':_0x441b6c[_0x252899(0x1a4)]})[_0x252899(0x1cb)](_0x13bfa6=>_0x13bfa6['data']),_0x3acb9f=_0x58bd6b['nameToId'],_0x4c8bf7=_0x58bd6b['idToName'],_0x1bb50b=_0x58bd6b[_0x252899(0x1aa)],_0x1948fb={'emailToIdMap':_0x43da63,'connectionNameToIdMap':_0x3acb9f,'connectionNameToTypeMap':_0x1bb50b,'getSchema':_0xbeeb2=>_0x266558['connection'][_0x252899(0x1f2)](_0xbeeb2)};let {pathToId:_0x4ada4a,idToPath:_0x213dca}=buildFolderMaps(_0x2b4af4);const _0x4e3d24=buildSegmentLookupMap(_0x34cf76,_0x213dca),_0x1e6e53=buildSegmentNameToIdMap(_0x34cf76),_0x41f4fb=buildJourneyBundleLookupMap(_0x5c056a,_0x213dca);let _0x296982;if(_0x23495f){if(!_0x23495f[_0x252899(0x19d)](_0x252899(0x1d7))&&!_0x23495f['endsWith']('.yaml'))return console['error'](a42_0x12b57d[_0x252899(0x224)](_0x252899(0x1d6)+_0x23495f+'\x0a')),0x1;_0x296982=[_0x23495f];}else _0x296982=findYamlFiles(_0x6dbfaa);if(_0x296982[_0x252899(0x1e9)]===0x0)return console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x224)](_0x252899(0x1fe)+_0x6dbfaa+'\x0a')),console[_0x252899(0x1f4)](a42_0x12b57d['cyan'](_0x252899(0x1ed))),0x1;let _0x3d3d07,_0x3166e6;try{const _0x5a4bc=parseAndClassifyYamlFiles(_0x296982,_0x6dbfaa,{'skipSegments':_0x441b6c['journeysOnly']});_0x3d3d07=_0x5a4bc['segments'],_0x3166e6=_0x5a4bc[_0x252899(0x1f7)];const _0x10d326=validateParsedFiles(_0x5a4bc,_0x6dbfaa);if(_0x10d326[_0x252899(0x1e9)]>0x0)return console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x224)](_0x252899(0x1c3))),console['error'](formatValidationErrors(_0x10d326)),console['error'](a42_0x12b57d[_0x252899(0x1d0)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1651e6){return console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x224)]('Error\x20parsing\x20YAML:\x20'+(_0x1651e6 instanceof Error?_0x1651e6[_0x252899(0x1e1)]:_0x1651e6))),0x1;}if(_0x3d3d07[_0x252899(0x1e9)]===0x0&&_0x3166e6['length']===0x0){const _0x40474b=_0x441b6c['journeysOnly']?_0x252899(0x1ea):_0x252899(0x1e6);return console[_0x252899(0x1f4)](a42_0x12b57d['yellow']('No\x20'+_0x40474b+'\x20YAML\x20files\x20found')),0x0;}const _0x541fa1=new Map();_0x34cf76[_0x252899(0x1e9)]>0x0&&!_0x441b6c[_0x252899(0x1c0)]&&await withSpinner(_0x252899(0x209),async()=>{await batchAsync(_0x34cf76,async _0x214877=>{const _0x730886=a42_0x26d8,_0x5b2401=await _0x266558[_0x730886(0x1a6)][_0x730886(0x211)](_0x4357b8,_0x214877['id']);_0x541fa1[_0x730886(0x20b)](_0x214877['id'],_0x5b2401);});},{'verbose':_0x441b6c[_0x252899(0x1a4)]});const {segmentFiles:_0x50473b,foldersToCreate:_0x307f3b}=await prepareSegmentFiles(_0x3d3d07,{'segmentByFolderAndName':_0x4e3d24,'activationsBySegmentId':_0x541fa1,'folderPathToId':_0x4ada4a,'idToEmailMap':_0x57fdec,'connectionIdToNameMap':_0x4c8bf7},_0x1948fb,_0x284f13,_0xd6d5fd),_0x12cea8=_0x23495f?[]:findSegmentsToDelete(_0x34cf76,_0x3d3d07[_0x252899(0x21a)](({yamlConfig:_0x7ddfb1,folderPath:_0x7f41ea})=>({'yamlConfig':_0x7ddfb1,'folderPath':resolveTDFolderPath(_0x7f41ea,_0x284f13,_0xd6d5fd)})),_0x213dca,_0xd6d5fd,_0x284f13),{journeyFiles:_0x4daeb6,foldersToCreate:_0x3cd30e}=await withProgressSpinner(_0x252899(0x1af),async _0x4af895=>prepareJourneyFiles(_0x3166e6,{'fetchJourney':async _0xd35290=>_0x266558['journey']['getJourney'](_0xd35290['journeyId']),'journeyBundlesByFolderAndName':_0x41f4fb,'folderPathToId':_0x4ada4a,'idToEmailMap':_0x57fdec,'connectionIdToNameMap':_0x4c8bf7,'existingSegments':_0x34cf76,'parentId':_0x4357b8,'deps':_0x266558,'progress':{'update':_0x2906e8=>{const _0x5a1a7f=_0x252899;_0x4af895[_0x5a1a7f(0x19b)](_0x2906e8),_0x441b6c[_0x5a1a7f(0x1a4)]&&console['error']('\x20\x20'+_0x2906e8);}},'journeyById':_0x398d03,'activationStepsById':_0x4ae57b},_0x284f13,_0xd6d5fd),{'verbose':_0x441b6c[_0x252899(0x1a4)]})['then'](_0x420c44=>_0x420c44[_0x252899(0x221)]);for(const _0xcb8b6e of _0x3cd30e){_0x307f3b['add'](_0xcb8b6e);}const _0x19c0c1=_0x23495f?[]:findJourneysToDelete(_0x5c056a,_0x3166e6['map'](({yamlConfig:_0x2cbcb4,folderPath:_0x1b1f54})=>({'yamlConfig':_0x2cbcb4,'folderPath':resolveTDFolderPath(_0x1b1f54,_0x284f13,_0xd6d5fd)})),_0x213dca,_0xd6d5fd,_0x284f13),_0x2f78fe=calculatePushStats(_0x50473b,_0x4daeb6,_0x307f3b,_0x12cea8,_0x19c0c1,!!_0x441b6c[_0x252899(0x219)],!!_0x441b6c[_0x252899(0x1c0)]),_0x50d4c1=_0x2f78fe['segments'][_0x252899(0x1ab)],_0x48d746=_0x2f78fe[_0x252899(0x1a2)]['changed'],_0x1f8e9b=_0x2f78fe[_0x252899(0x1a2)][_0x252899(0x205)],_0x17cdec=_0x2f78fe[_0x252899(0x1a2)]['toDelete'],_0x57c577=_0x2f78fe['folders'][_0x252899(0x1a1)],_0x4651c5=_0x2f78fe[_0x252899(0x1f7)][_0x252899(0x1ab)],_0x4f91da=_0x2f78fe[_0x252899(0x1f7)][_0x252899(0x21f)],_0x1a4836=_0x2f78fe[_0x252899(0x1f7)][_0x252899(0x205)],_0x1e9717=_0x2f78fe[_0x252899(0x1f7)]['toDelete'],_0x43e78e=_0x2f78fe['activations'][_0x252899(0x228)],_0x523ac1=_0x2f78fe[_0x252899(0x233)]['toCreate'],_0x32e405=_0x2f78fe['activations']['toUpdate'],_0x540b43=_0x2f78fe[_0x252899(0x233)]['toDelete'];console[_0x252899(0x1f4)]('\x0aPush\x20summary\x20for\x20\x27'+_0x21a0cf+'\x27:');_0x57c577[_0x252899(0x1e9)]>0x0&&console['error']('\x20\x20'+a42_0x12b57d[_0x252899(0x1bf)]('📁\x20'+_0x57c577[_0x252899(0x1e9)]+'\x20folders\x20to\x20create'));if(!_0x441b6c[_0x252899(0x1c0)]){console[_0x252899(0x1f4)](_0x252899(0x203)),console[_0x252899(0x1f4)]('\x20\x20\x20\x20'+a42_0x12b57d[_0x252899(0x1c5)]('+\x20'+_0x50d4c1['length']+_0x252899(0x1cd))),console[_0x252899(0x1f4)](_0x252899(0x1bb)+a42_0x12b57d[_0x252899(0x1d0)]('~\x20'+_0x48d746[_0x252899(0x1e9)]+'\x20changed'));if(_0x17cdec[_0x252899(0x1e9)]>0x0)console[_0x252899(0x1f4)](_0x252899(0x1bb)+a42_0x12b57d[_0x252899(0x224)]('-\x20'+_0x17cdec[_0x252899(0x1e9)]+_0x252899(0x22c)));else _0x12cea8[_0x252899(0x1e9)]>0x0&&!_0x441b6c['delete']&&console[_0x252899(0x1f4)]('\x20\x20\x20\x20'+a42_0x12b57d[_0x252899(0x216)](_0x12cea8[_0x252899(0x1e9)]+_0x252899(0x231)));console[_0x252899(0x1f4)]('\x20\x20\x20\x20'+a42_0x12b57d['dim']('=\x20'+_0x1f8e9b['length']+_0x252899(0x1ef)));}if(_0x4daeb6[_0x252899(0x1e9)]>0x0||_0x19c0c1[_0x252899(0x1e9)]>0x0){console[_0x252899(0x1f4)](_0x252899(0x1a3)),console[_0x252899(0x1f4)]('\x20\x20\x20\x20'+a42_0x12b57d[_0x252899(0x1c5)]('+\x20'+_0x4651c5[_0x252899(0x1e9)]+_0x252899(0x1cd))),console[_0x252899(0x1f4)](_0x252899(0x1bb)+a42_0x12b57d[_0x252899(0x1d0)]('~\x20'+_0x4f91da['length']+_0x252899(0x1dd)));if(_0x1e9717[_0x252899(0x1e9)]>0x0)console[_0x252899(0x1f4)](_0x252899(0x1bb)+a42_0x12b57d[_0x252899(0x224)]('-\x20'+_0x1e9717['length']+_0x252899(0x22c)));else _0x19c0c1[_0x252899(0x1e9)]>0x0&&!_0x441b6c[_0x252899(0x219)]&&console[_0x252899(0x1f4)]('\x20\x20\x20\x20'+a42_0x12b57d[_0x252899(0x216)](_0x19c0c1['length']+_0x252899(0x231)));console[_0x252899(0x1f4)]('\x20\x20\x20\x20'+a42_0x12b57d[_0x252899(0x216)]('=\x20'+_0x1a4836[_0x252899(0x1e9)]+'\x20unchanged'));}_0x43e78e[_0x252899(0x1e9)]>0x0&&!_0x441b6c[_0x252899(0x1c0)]&&(console['error'](''),console[_0x252899(0x1f4)](_0x252899(0x1ba)),_0x523ac1[_0x252899(0x1e9)]>0x0&&console['error']('\x20\x20\x20\x20'+a42_0x12b57d[_0x252899(0x1c5)]('+\x20'+_0x523ac1['length']+'\x20to\x20create')),_0x32e405['length']>0x0&&console['error'](_0x252899(0x1bb)+a42_0x12b57d['yellow']('~\x20'+_0x32e405[_0x252899(0x1e9)]+_0x252899(0x1b3))),_0x540b43[_0x252899(0x1e9)]>0x0&&console[_0x252899(0x1f4)](_0x252899(0x1bb)+a42_0x12b57d[_0x252899(0x224)]('-\x20'+_0x540b43[_0x252899(0x1e9)]+_0x252899(0x22c))));console[_0x252899(0x1f4)]('\x20\x20Source:\x20'+a42_0x12b57d[_0x252899(0x1a8)](_0x6dbfaa)+'\x0a');if(_0x57c577['length']>0x0){console[_0x252899(0x1f4)](_0x252899(0x1ee));for(const _0x1c54ea of _0x57c577){console[_0x252899(0x1f4)]('\x20\x20'+a42_0x12b57d[_0x252899(0x1bf)]('+')+'\x20'+_0x1c54ea);}console['error']('');}if(_0x50d4c1[_0x252899(0x1e9)]>0x0&&!_0x441b6c[_0x252899(0x1c0)])for(const _0x1db7e2 of _0x50d4c1){const _0xf40fa8=_0x1db7e2['folderPath']?_0x1db7e2[_0x252899(0x1d3)]+'/'+_0x1db7e2[_0x252899(0x21e)]['name']:_0x1db7e2[_0x252899(0x21e)][_0x252899(0x1b4)],_0x26114d=_0x1db7e2['yamlConfig'][_0x252899(0x233)]?.[_0x252899(0x1e9)]||0x0,_0x428d31=_0x26114d>0x0?a42_0x12b57d[_0x252899(0x216)]('\x20['+_0x26114d+_0x252899(0x1a9)):'';console['error']('\x0a'+a42_0x12b57d[_0x252899(0x1c5)]('New\x20segment:')+'\x20'+_0xf40fa8+_0x428d31),console[_0x252899(0x1f4)]('─'[_0x252899(0x1b1)](0x3c)),_0x1db7e2['diff']&&console[_0x252899(0x1f4)](_0x1db7e2['diff']),console[_0x252899(0x1f4)]('─'[_0x252899(0x1b1)](0x3c));}if(_0x17cdec[_0x252899(0x1e9)]>0x0&&!_0x441b6c[_0x252899(0x1c0)])for(const _0x174f93 of _0x17cdec){const _0x43de90=_0x174f93[_0x252899(0x19a)]?_0x213dca['get'](_0x174f93[_0x252899(0x19a)][_0x252899(0x22b)]())||'':'',_0x1e38b6=_0x43de90?_0x43de90+'/'+_0x174f93['name']:_0x174f93['name'],_0x2fc7a7=_0x541fa1['get'](_0x174f93['id'])||[],_0x10ae15=_0x2fc7a7[_0x252899(0x1e9)]>0x0?a42_0x12b57d[_0x252899(0x216)]('\x20['+_0x2fc7a7['length']+_0x252899(0x1a9)):'';console['error']('\x0a'+a42_0x12b57d['red'](_0x252899(0x1ce))+'\x20'+_0x1e38b6+_0x10ae15),console['error']('─'[_0x252899(0x1b1)](0x3c));const _0x3e3252=segmentWithActivationsToYaml(_0x174f93,_0x2fc7a7,undefined,_0x57fdec,_0x4c8bf7),_0x50419a=segmentToYamlString(_0x3e3252),_0x5e84ae=generateDiff(_0x50419a,'');console[_0x252899(0x1f4)](formatDiffWithColors(_0x5e84ae)),console[_0x252899(0x1f4)]('─'[_0x252899(0x1b1)](0x3c));}const _0x227f4d=_0x50473b[_0x252899(0x206)](_0x79024a=>!_0x79024a['isNew']&&_0x79024a[_0x252899(0x1ae)]);if(_0x227f4d['length']>0x0&&!_0x441b6c[_0x252899(0x1c0)])for(const _0xfb18c3 of _0x227f4d){const _0x4e801f=_0xfb18c3[_0x252899(0x1d3)]?_0xfb18c3['folderPath']+'/'+_0xfb18c3[_0x252899(0x21e)]['name']:_0xfb18c3[_0x252899(0x21e)]['name'];console['error']('\x0a'+a42_0x12b57d['yellow'](_0x252899(0x1e7))+'\x20'+_0x4e801f),console[_0x252899(0x1f4)]('─'[_0x252899(0x1b1)](0x3c)),console[_0x252899(0x1f4)](_0xfb18c3['diff']),console[_0x252899(0x1f4)]('─'[_0x252899(0x1b1)](0x3c));}if(_0x4651c5[_0x252899(0x1e9)]>0x0)for(const _0x3aab07 of _0x4651c5){const _0x3a1fdd=_0x3aab07[_0x252899(0x1d3)]?_0x3aab07[_0x252899(0x1d3)]+'/'+_0x3aab07[_0x252899(0x21e)]['name']:_0x3aab07[_0x252899(0x21e)][_0x252899(0x1b4)];console[_0x252899(0x1f4)]('\x0a'+a42_0x12b57d[_0x252899(0x1c5)](_0x252899(0x207))+'\x20'+_0x3a1fdd),console[_0x252899(0x1f4)]('─'['repeat'](0x3c)),_0x3aab07[_0x252899(0x1ae)]&&console[_0x252899(0x1f4)](_0x3aab07[_0x252899(0x1ae)]),console[_0x252899(0x1f4)]('─'[_0x252899(0x1b1)](0x3c));}const _0xaa0992=_0x4daeb6[_0x252899(0x206)](_0x102fb9=>!_0x102fb9[_0x252899(0x1f6)]&&_0x102fb9[_0x252899(0x1ae)]);if(_0xaa0992[_0x252899(0x1e9)]>0x0)for(const _0xb0255b of _0xaa0992){const _0x5f003c=_0xb0255b[_0x252899(0x1d3)]?_0xb0255b[_0x252899(0x1d3)]+'/'+_0xb0255b[_0x252899(0x21e)][_0x252899(0x1b4)]:_0xb0255b['yamlConfig'][_0x252899(0x1b4)];console[_0x252899(0x1f4)]('\x0a'+a42_0x12b57d[_0x252899(0x1d0)](_0x252899(0x1c6))+'\x20'+_0x5f003c),console[_0x252899(0x1f4)]('─'['repeat'](0x3c)),console[_0x252899(0x1f4)](_0xb0255b[_0x252899(0x1ae)]),console[_0x252899(0x1f4)]('─'[_0x252899(0x1b1)](0x3c));}if(_0x1e9717['length']>0x0)for(const _0x1e8661 of _0x1e9717){const _0x3ad197=_0x1e8661['folderId']?_0x213dca[_0x252899(0x21c)](_0x1e8661[_0x252899(0x225)])||'':'',_0x244d54=_0x3ad197?_0x3ad197+'/'+_0x1e8661['journeyBundleName']:_0x1e8661['journeyBundleName'];console[_0x252899(0x1f4)]('\x0a'+a42_0x12b57d[_0x252899(0x224)](_0x252899(0x1e4))+'\x20'+_0x244d54),console[_0x252899(0x1f4)]('─'['repeat'](0x3c)),console['error'](a42_0x12b57d[_0x252899(0x224)](_0x252899(0x1e2))),console[_0x252899(0x1f4)]('─'['repeat'](0x3c));}if(_0x441b6c[_0x252899(0x208)])return console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1d0)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x5402b6=_0x441b6c[_0x252899(0x1c0)]?![]:_0x50d4c1['length']>0x0||_0x48d746[_0x252899(0x1e9)]>0x0||_0x17cdec[_0x252899(0x1e9)]>0x0,_0x6eed41=_0x4651c5[_0x252899(0x1e9)]>0x0||_0x4f91da[_0x252899(0x1e9)]>0x0||_0x1e9717[_0x252899(0x1e9)]>0x0,_0x2f8dc3=_0x441b6c['journeysOnly']?![]:_0x43e78e[_0x252899(0x1e9)]>0x0,_0x5d87ee=_0x57c577[_0x252899(0x1e9)]>0x0;if(!_0x5402b6&&!_0x6eed41&&!_0x2f8dc3&&!_0x5d87ee){const _0x1ca27c=_0x441b6c[_0x252899(0x1c0)]?_0x252899(0x1be):_0x252899(0x1b9);console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1c5)](_0x1ca27c));if(_0x23495f&&_0x1f8e9b[_0x252899(0x1e9)]===0x1){const _0x773132=_0x1f8e9b[0x0];if(_0x773132[_0x252899(0x1d2)]?.['id']){const _0x564e9c=getConsoleNextUrl(_0x441b6c[_0x252899(0x1eb)],_0x252899(0x1fc)+_0x4357b8+_0x252899(0x22d)+_0x773132[_0x252899(0x1d2)]['id']+'/sb/da/esr');console[_0x252899(0x1f4)](_0x252899(0x1bd)+a42_0x12b57d[_0x252899(0x1a8)](_0x564e9c));}}if(_0x23495f&&_0x1a4836[_0x252899(0x1e9)]===0x1){const _0x2ddd12=_0x1a4836[0x0];if(_0x2ddd12[_0x252899(0x1a7)]?.['id']){const _0xbabbaa=getConsoleNextUrl(_0x441b6c[_0x252899(0x1eb)],_0x252899(0x1fc)+_0x4357b8+_0x252899(0x22d)+_0x2ddd12['existingJourney']['id']+_0x252899(0x1f1));console[_0x252899(0x1f4)]('\x20\x20'+a42_0x12b57d['cyan'](_0xbabbaa));}}return 0x0;}const _0x5e6ee2=_0x441b6c['journeysOnly']?_0x4651c5[_0x252899(0x1e9)]+_0x4f91da['length']+_0x1e9717[_0x252899(0x1e9)]+_0x57c577[_0x252899(0x1e9)]:_0x50d4c1[_0x252899(0x1e9)]+_0x48d746[_0x252899(0x1e9)]+_0x17cdec[_0x252899(0x1e9)]+_0x4651c5['length']+_0x4f91da[_0x252899(0x1e9)]+_0x1e9717[_0x252899(0x1e9)]+_0x57c577[_0x252899(0x1e9)]+_0x43e78e[_0x252899(0x1e9)];if(!_0x441b6c[_0x252899(0x1cc)]&&_0x5e6ee2>0x0){if(!isInteractive())return console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x224)](_0x252899(0x215)),_0x252899(0x1c7)),console['error'](a42_0x12b57d[_0x252899(0x216)](_0x252899(0x1ac))),0x1;const _0x7bf60=await confirmKey('Push\x20'+_0x5e6ee2+_0x252899(0x214));if(!_0x7bf60)return console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1d0)](_0x252899(0x1de))),0x1;}const _0x53828b={'withProgress':async(_0x1b5e05,_0x45b5e6)=>{const _0x3b54c8=_0x252899,_0x4aafb5=await withSpinner(_0x1b5e05,_0x45b5e6,{'verbose':_0x441b6c['verbose']});return{'data':_0x4aafb5[_0x3b54c8(0x221)]};},'logInfo':_0x3345ae=>console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1bf)]('✔\x20'+_0x3345ae)),'logSuccess':_0x48935d=>console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1c5)]('✔\x20'+_0x48935d)),'logWarning':_0x365a18=>console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x1d0)]('⚠\x20'+_0x365a18)),'logDeleted':_0x2b56e4=>console[_0x252899(0x1f4)](a42_0x12b57d[_0x252899(0x224)]('✔\x20'+_0x2b56e4))},_0x46b764={'segment':_0x266558[_0x252899(0x1a6)],'journey':_0x266558[_0x252899(0x1ea)],'user':_0x266558[_0x252899(0x1f5)],'connection':_0x266558['connection']};_0x57c577['length']>0x0&&(_0x4ada4a=await executePushFolders(_0x46b764,_0x57c577,_0x4ada4a,{'parentId':_0x4357b8},_0x53828b));const _0x4d658e={'rootFolderId':_0x480699,'folderPathToId':_0x4ada4a,'folderIdToPath':_0x213dca,'segmentNameToId':_0x1e6e53,'activationsBySegmentId':_0x541fa1,'emailToIdMap':_0x43da63,'idToEmailMap':_0x57fdec,'connectionNameToIdMap':_0x58bd6b[_0x252899(0x1fb)],'connectionIdToNameMap':_0x58bd6b['idToName'],'connectionNameToTypeMap':_0x1bb50b},_0x276ca8=await executePushSegments(_0x46b764,_0x441b6c['journeysOnly']?[]:_0x50473b,_0x4d658e,{'parentId':_0x4357b8},_0x53828b),_0x5f5af6=_0x276ca8[_0x252899(0x22f)],_0x2d06ef=_0x276ca8[_0x252899(0x1c9)],_0x9d022e=_0x276ca8[_0x252899(0x233)][_0x252899(0x22f)],_0x46de7d=_0x276ca8[_0x252899(0x233)][_0x252899(0x1c9)],_0x1dcfef=_0x276ca8['activations'][_0x252899(0x1b8)];let _0x35fdad;if(_0x23495f&&_0x50473b['length']===0x1){const _0x54d594=_0x50473b[0x0];_0x35fdad=_0x54d594[_0x252899(0x1d2)]?.['id']??_0x276ca8[_0x252899(0x201)][_0x252899(0x21c)](_0x54d594[_0x252899(0x21e)]['name']);}const _0x456b1f=await executePushSegmentDeletions(_0x46b764,_0x441b6c[_0x252899(0x1c0)]?[]:_0x17cdec,_0x53828b);let _0x22da56=0x0,_0x135b52=0x0,_0x25bfa7=0x0;const _0x2623c9=new Map(_0x1e6e53);for(const [_0x115f20,_0x4f85f7]of _0x276ca8[_0x252899(0x201)]){_0x2623c9[_0x252899(0x20b)](_0x115f20,_0x4f85f7);}if(_0x4daeb6[_0x252899(0x1e9)]>0x0){const _0xaf97f4={..._0x4d658e,'segmentNameToId':_0x2623c9,'existingSegments':_0x34cf76,'activationContext':_0x1948fb},_0x3df621=await executePushJourneys(_0x46b764,_0x4daeb6,_0xaf97f4,{'parentId':_0x4357b8,'rootFolderId':_0x480699,'verbose':_0x441b6c[_0x252899(0x1a4)]},_0x53828b);_0x22da56=_0x3df621[_0x252899(0x22f)],_0x135b52=_0x3df621[_0x252899(0x1c9)];if(_0x23495f&&_0x3df621[_0x252899(0x217)]['length']===0x1){const _0xa13c4c=_0x3df621[_0x252899(0x217)][0x0];if(_0xa13c4c[_0x252899(0x220)]){const _0x58676b=getConsoleNextUrl(_0x441b6c['site'],_0x252899(0x1fc)+_0x4357b8+_0x252899(0x22d)+_0xa13c4c[_0x252899(0x220)]+'/j/da/je');console[_0x252899(0x1f4)]('\x20\x20'+a42_0x12b57d[_0x252899(0x1a8)](_0x58676b));}}}for(const _0x3c0a31 of _0x1e9717){console[_0x252899(0x1f4)](a42_0x12b57d['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3c0a31[_0x252899(0x1ad)])),_0x25bfa7++;}const _0x54f530=[];if(_0x5f5af6>0x0)_0x54f530[_0x252899(0x1dc)](_0x5f5af6+_0x252899(0x1e5));if(_0x2d06ef>0x0)_0x54f530[_0x252899(0x1dc)](_0x2d06ef+_0x252899(0x1bc));if(_0x456b1f>0x0)_0x54f530[_0x252899(0x1dc)](_0x456b1f+_0x252899(0x1b5));const _0x3fc903=[];if(_0x22da56>0x0)_0x3fc903['push'](_0x22da56+_0x252899(0x1e5));if(_0x135b52>0x0)_0x3fc903['push'](_0x135b52+'\x20updated');if(_0x25bfa7>0x0)_0x3fc903['push'](_0x25bfa7+'\x20deleted');const _0x5ab282=[];if(_0x9d022e>0x0)_0x5ab282['push'](_0x9d022e+_0x252899(0x1e5));if(_0x46de7d>0x0)_0x5ab282[_0x252899(0x1dc)](_0x46de7d+_0x252899(0x1bc));if(_0x1dcfef>0x0)_0x5ab282['push'](_0x1dcfef+'\x20deleted');console['error'](a42_0x12b57d[_0x252899(0x1c5)]('\x0a✔\x20Push\x20complete'));_0x54f530['length']>0x0&&!_0x441b6c[_0x252899(0x1c0)]&&console['error']('\x20\x20Segments:\x20'+_0x54f530[_0x252899(0x1c8)](',\x20'));_0x3fc903['length']>0x0&&console[_0x252899(0x1f4)](_0x252899(0x1d8)+_0x3fc903['join'](',\x20'));_0x5ab282['length']>0x0&&!_0x441b6c['journeysOnly']&&console[_0x252899(0x1f4)](_0x252899(0x1b6)+_0x5ab282[_0x252899(0x1c8)](',\x20'));if(_0x35fdad){const _0x1b62bc=getConsoleNextUrl(_0x441b6c['site'],_0x252899(0x1fc)+_0x4357b8+_0x252899(0x22d)+_0x35fdad+_0x252899(0x204));console[_0x252899(0x1f4)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a42_0x12b57d[_0x252899(0x1a8)](_0x1b62bc));}return 0x0;}}
|
|
1
|
+
function a42_0x446a(_0xc67a0a,_0x13717c){_0xc67a0a=_0xc67a0a-0x1b4;const _0x1ecd92=a42_0x1ecd();let _0x446a11=_0x1ecd92[_0xc67a0a];return _0x446a11;}const a42_0x15f989=a42_0x446a;(function(_0xbc95e5,_0x30d43d){const _0xa97beb=a42_0x446a,_0x33ce39=_0xbc95e5();while(!![]){try{const _0x2da6f4=-parseInt(_0xa97beb(0x1f1))/0x1+-parseInt(_0xa97beb(0x244))/0x2*(parseInt(_0xa97beb(0x246))/0x3)+-parseInt(_0xa97beb(0x21c))/0x4+parseInt(_0xa97beb(0x1dd))/0x5*(-parseInt(_0xa97beb(0x21a))/0x6)+-parseInt(_0xa97beb(0x231))/0x7*(parseInt(_0xa97beb(0x211))/0x8)+parseInt(_0xa97beb(0x241))/0x9+parseInt(_0xa97beb(0x1d6))/0xa;if(_0x2da6f4===_0x30d43d)break;else _0x33ce39['push'](_0x33ce39['shift']());}catch(_0x30eba1){_0x33ce39['push'](_0x33ce39['shift']());}}}(a42_0x1ecd,0xcaca9));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 a42_0x361cc0 from'chalk';import{existsSync}from'fs';function a42_0x1ecd(){const _0x1cf825=['/sb/da/esr','\x20\x20\x20\x20','Scoped\x20to\x20folder:\x20','map','Fetching\x20existing\x20activations...','Push\x20','results','journeysOnly','unchanged','changed','\x20created','\x0a✔\x20Push\x20complete','folderPath','filter','cyan','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segments','endsWith','deleted','add','createdAt','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segmentFolderId','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','site','45784570IKfgTF','error','Changes\x20to\x20journey:','paused','\x20\x20Activations:\x20','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2025xbGyvh','toCreate','createdSegmentIds','isScoped','folders','green','idToName','parent_name','push','\x20changes?','\x27...','existingSegment','type','listSegments','\x20\x20🗺️\x20\x20Journeys:','toDelete','\x20to\x20create','yellow','\x20activations]','existingJourney','998851ADStdx','listActivations','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','yamlConfig','Resolving\x20parent\x20segment\x20\x27','.yml','\x20to\x20delete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','join','execute','attributes','No\x20','/app/ps/','audienceId','\x20updated','red','get','Changes\x20to:','connection','getOutputSchemaWithCache','activations','verbose','Source\x20directory:\x20','journey','data','Fetching\x20existing\x20data...','scopedFolderPath','journeys','targetDir','Site:\x20','35624CdyWiV','Error:\x20Directory\x20not\x20found:\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)','\x20\x20Journeys:\x20','diff','segment:push','description','all','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','3594aDtzGF','file','5576252eRRpLx','blue','name','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','relationships','buildUserMaps','getJourney','\x20changed','parentName','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20📊\x20Segments:','/j/da/je','updated','/e/','user','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','dim','then','\x0aPush\x20summary\x20for\x20\x27','Preparing\x20journeys...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','2135UyXSLs','segment\x20or\x20journey','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20YAML\x20files\x20found','journeyBundleName','nameToType','message','created','\x20new','listJourneysWithDetailsFromParentSegment','getParent','helpText','New\x20segment:','nameToId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','12447108rJzaiy','updatedAt','Aborted.','379054gsWafa','\x20unchanged','18RDRalN','length','folderId','no_parent','yes','parentSegment','\x20\x20Activations:','\x20deleted','Error:\x20','listFolders','delete','journeyId','Error\x20parsing\x20YAML:\x20','New\x20journey:','\x0aValidation\x20failed:','filePath','resolveParentId','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Parent\x20segment:\x20','.yaml','dryRun','versionNumber'];a42_0x1ecd=function(){return _0x1cf825;};return a42_0x1ecd();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a42_0x15f989(0x21e)]=a42_0x15f989(0x216);[a42_0x15f989(0x217)]=a42_0x15f989(0x22b);async[a42_0x15f989(0x1fc)](_0x41f780){const _0x47f837=a42_0x15f989,{options:_0x5872eb,args:_0x150b7a,tdx:_0x2f0a23}=_0x41f780,_0x1d1f1f=_0x5872eb,_0x49ed23=await resolveTarget({'arg':_0x150b7a[0x0],'contextParent':_0x5872eb[_0x47f837(0x24b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x49ed23))return _0x49ed23['errorCode']===_0x47f837(0x249)?(console[_0x47f837(0x1d7)](a42_0x361cc0['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x47f837(0x213)),console[_0x47f837(0x1d7)](_0x47f837(0x234)),console['error'](_0x47f837(0x219))):(console['error'](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x24e)+_0x49ed23[_0x47f837(0x238)]+'\x0a')),_0x49ed23[_0x47f837(0x23d)]&&console['error'](a42_0x361cc0[_0x47f837(0x1cb)](_0x49ed23[_0x47f837(0x23d)]))),0x1;if(_0x49ed23[_0x47f837(0x1e9)]===_0x47f837(0x1e4))return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x212)+_0x49ed23[_0x47f837(0x20f)]+'\x0a')),console['error'](a42_0x361cc0['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xfc58b0=_0x49ed23[_0x47f837(0x224)],_0x5f0f01=_0x49ed23['targetDir'],_0x40bc04=_0x49ed23[_0x47f837(0x1e9)]===_0x47f837(0x21b)?_0x49ed23[_0x47f837(0x1b6)]:undefined,_0x4d3733=getScopedDetails(_0x49ed23),_0x3b93f9=_0x4d3733?.[_0x47f837(0x1e0)]??![],_0x377ce6=_0x4d3733?.[_0x47f837(0x20d)]??'';if(!existsSync(_0x5f0f01))return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x212)+_0x5f0f01+'\x0a')),console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1cb)](_0x47f837(0x1d2))),0x1;_0x1d1f1f[_0x47f837(0x208)]&&(console[_0x47f837(0x1d7)](_0x47f837(0x210)+_0x1d1f1f['site']),console[_0x47f837(0x1d7)](_0x47f837(0x1b9)+_0xfc58b0),console[_0x47f837(0x1d7)](_0x47f837(0x209)+_0x5f0f01),_0x3b93f9&&console[_0x47f837(0x1d7)](_0x47f837(0x1bf)+_0x377ce6));const _0x5d39c1=await withSpinner(_0x47f837(0x1f6)+_0xfc58b0+_0x47f837(0x1e7),()=>_0x2f0a23['segment'][_0x47f837(0x1b7)](_0xfc58b0),{'verbose':_0x1d1f1f[_0x47f837(0x208)]}),_0x316186=_0x5d39c1['data'],{parentSegmentResult:_0x4cc89f,segmentsResult:_0x3379d9,foldersResult:_0x41b777,journeysWithDetailsResult:_0xe5f942,userMaps:_0x49bebc}=await withSpinner(_0x47f837(0x20c),async()=>{const _0x377fc0=_0x47f837,[_0x549ac9,_0x2cb8be,_0x3d793e,_0x2fa397,_0x366b9d]=await Promise['all']([_0x2f0a23[_0x377fc0(0x233)][_0x377fc0(0x23c)](_0x316186),_0x2f0a23['segment'][_0x377fc0(0x1ea)](_0x316186),_0x2f0a23[_0x377fc0(0x233)][_0x377fc0(0x24f)](_0x316186),_0x2f0a23[_0x377fc0(0x20a)][_0x377fc0(0x23b)](_0x316186,{'includeAllVersions':!![]}),_0x2f0a23[_0x377fc0(0x22a)][_0x377fc0(0x221)]()]);return{'parentSegmentResult':_0x549ac9,'segmentsResult':_0x2cb8be,'foldersResult':_0x3d793e,'journeysWithDetailsResult':_0x2fa397,'userMaps':_0x366b9d};},{'verbose':_0x1d1f1f[_0x47f837(0x208)]})[_0x47f837(0x22d)](_0x5782cc=>_0x5782cc[_0x47f837(0x20b)]),_0x20689f=_0x4cc89f,_0x28a3af=extractRootFolderId(_0x20689f),_0x154d8e=_0x3379d9,_0x487728=_0x41b777,{journeys:_0xec766a,activationStepsById:_0x487a90}=_0xe5f942,_0x1b65c4=new Map(_0xec766a['map'](_0x27935d=>[_0x27935d['id'],_0x27935d])),_0x2c15a2=_0xec766a[_0x47f837(0x1c0)](_0x14a192=>({'id':_0x14a192['id'],'name':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x21e)],'journeyBundleName':_0x14a192['attributes']['journeyBundleName']||'','journeyBundleId':_0x14a192[_0x47f837(0x1fd)]['journeyBundleId']||'','versionNumber':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x1bc)],'description':_0x14a192[_0x47f837(0x1fd)]['description'],'state':_0x14a192[_0x47f837(0x1fd)]['state'],'paused':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x1d9)],'audienceId':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x200)],'folderId':_0x14a192[_0x47f837(0x220)]?.['parentFolder']?.[_0x47f837(0x20b)]?.['id'],'createdAt':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x1d1)],'updatedAt':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x242)]})),{emailToId:_0x2a817b,idToEmail:_0x55763f}=_0x49bebc,_0x48041e=await withSpinner(_0x47f837(0x225),async()=>{const _0x2c9d0c=_0x47f837,_0x2f4e43=await _0x2f0a23[_0x2c9d0c(0x205)]['list']();return buildConnectionMaps(_0x2f4e43);},{'verbose':_0x1d1f1f[_0x47f837(0x208)]})[_0x47f837(0x22d)](_0x464a62=>_0x464a62[_0x47f837(0x20b)]),_0x35359d=_0x48041e[_0x47f837(0x23f)],_0x920b7d=_0x48041e[_0x47f837(0x1e3)],_0x15562e=_0x48041e[_0x47f837(0x237)],_0x539d20={'emailToIdMap':_0x2a817b,'connectionNameToIdMap':_0x35359d,'connectionNameToTypeMap':_0x15562e,'getSchema':_0x172cef=>_0x2f0a23[_0x47f837(0x205)][_0x47f837(0x206)](_0x172cef)};let {pathToId:_0x21e939,idToPath:_0x2a99bf}=buildFolderMaps(_0x487728);const _0x2d5bb8=buildSegmentLookupMap(_0x154d8e,_0x2a99bf),_0x182273=buildSegmentNameToIdMap(_0x154d8e),_0x32443a=buildJourneyBundleLookupMap(_0x2c15a2,_0x2a99bf);let _0x398218;if(_0x40bc04){if(!_0x40bc04['endsWith'](_0x47f837(0x1f7))&&!_0x40bc04[_0x47f837(0x1ce)](_0x47f837(0x1ba)))return console['error'](a42_0x361cc0['red'](_0x47f837(0x1f9)+_0x40bc04+'\x0a')),0x1;_0x398218=[_0x40bc04];}else _0x398218=findYamlFiles(_0x5f0f01);if(_0x398218[_0x47f837(0x247)]===0x0)return console[_0x47f837(0x1d7)](a42_0x361cc0['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5f0f01+'\x0a')),console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1cb)](_0x47f837(0x1d4))),0x1;let _0x886180,_0x1d227d;try{const _0x456da5=parseAndClassifyYamlFiles(_0x398218,_0x5f0f01,{'skipSegments':_0x1d1f1f[_0x47f837(0x1c4)]});_0x886180=_0x456da5['segments'],_0x1d227d=_0x456da5[_0x47f837(0x20e)];const _0x44d3d4=validateParsedFiles(_0x456da5,_0x5f0f01);if(_0x44d3d4[_0x47f837(0x247)]>0x0)return console[_0x47f837(0x1d7)](a42_0x361cc0['red'](_0x47f837(0x1b5))),console[_0x47f837(0x1d7)](formatValidationErrors(_0x44d3d4)),console['error'](a42_0x361cc0['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x2566dc){return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x252)+(_0x2566dc instanceof Error?_0x2566dc['message']:_0x2566dc))),0x1;}if(_0x886180['length']===0x0&&_0x1d227d[_0x47f837(0x247)]===0x0){const _0x5cc231=_0x1d1f1f[_0x47f837(0x1c4)]?'journey':_0x47f837(0x232);return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x1fe)+_0x5cc231+_0x47f837(0x235))),0x0;}const _0x5efdac=new Map();_0x154d8e[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&await withSpinner(_0x47f837(0x1c1),async()=>{await batchAsync(_0x154d8e,async _0x45412c=>{const _0x5f1a73=a42_0x446a,_0xc556e0=await _0x2f0a23[_0x5f1a73(0x233)][_0x5f1a73(0x1f2)](_0x316186,_0x45412c['id']);_0x5efdac['set'](_0x45412c['id'],_0xc556e0);});},{'verbose':_0x1d1f1f[_0x47f837(0x208)]});const {segmentFiles:_0x155f81,foldersToCreate:_0x383ed6}=await prepareSegmentFiles(_0x886180,{'segmentByFolderAndName':_0x2d5bb8,'activationsBySegmentId':_0x5efdac,'folderPathToId':_0x21e939,'idToEmailMap':_0x55763f,'connectionIdToNameMap':_0x920b7d},_0x539d20,_0x3b93f9,_0x377ce6),_0x5be760=_0x40bc04?[]:findSegmentsToDelete(_0x154d8e,_0x886180[_0x47f837(0x1c0)](({yamlConfig:_0xe0b082,folderPath:_0x17bb3c})=>({'yamlConfig':_0xe0b082,'folderPath':resolveTDFolderPath(_0x17bb3c,_0x3b93f9,_0x377ce6)})),_0x2a99bf,_0x377ce6,_0x3b93f9),{journeyFiles:_0x1c72a3,foldersToCreate:_0x44d021}=await withProgressSpinner(_0x47f837(0x22f),async _0x156380=>prepareJourneyFiles(_0x1d227d,{'fetchJourney':async _0x1c637b=>_0x2f0a23[_0x47f837(0x20a)][_0x47f837(0x222)](_0x1c637b[_0x47f837(0x251)]),'journeyBundlesByFolderAndName':_0x32443a,'folderPathToId':_0x21e939,'idToEmailMap':_0x55763f,'connectionIdToNameMap':_0x920b7d,'existingSegments':_0x154d8e,'parentId':_0x316186,'deps':_0x2f0a23,'progress':{'update':_0x211c70=>{const _0x1c73d6=_0x47f837;_0x156380['setPhase'](_0x211c70),_0x1d1f1f[_0x1c73d6(0x208)]&&console[_0x1c73d6(0x1d7)]('\x20\x20'+_0x211c70);}},'journeyById':_0x1b65c4,'activationStepsById':_0x487a90},_0x3b93f9,_0x377ce6),{'verbose':_0x1d1f1f['verbose']})[_0x47f837(0x22d)](_0x48a247=>_0x48a247['data']);for(const _0x2f2593 of _0x44d021){_0x383ed6[_0x47f837(0x1d0)](_0x2f2593);}const _0x4d4cf5=_0x40bc04?[]:findJourneysToDelete(_0x2c15a2,_0x1d227d[_0x47f837(0x1c0)](({yamlConfig:_0x287df4,folderPath:_0x2a93bf})=>({'yamlConfig':_0x287df4,'folderPath':resolveTDFolderPath(_0x2a93bf,_0x3b93f9,_0x377ce6)})),_0x2a99bf,_0x377ce6,_0x3b93f9),_0x55a509=calculatePushStats(_0x155f81,_0x1c72a3,_0x383ed6,_0x5be760,_0x4d4cf5,!!_0x1d1f1f[_0x47f837(0x250)],!!_0x1d1f1f['journeysOnly']),_0x58a932=_0x55a509[_0x47f837(0x1cd)]['new'],_0x1fd732=_0x55a509[_0x47f837(0x1cd)]['changed'],_0x49eb65=_0x55a509[_0x47f837(0x1cd)]['unchanged'],_0x108905=_0x55a509[_0x47f837(0x1cd)]['toDelete'],_0x258c5b=_0x55a509[_0x47f837(0x1e1)][_0x47f837(0x1de)],_0x4549d8=_0x55a509[_0x47f837(0x20e)]['new'],_0x3101eb=_0x55a509['journeys'][_0x47f837(0x1c6)],_0x4cfead=_0x55a509[_0x47f837(0x20e)][_0x47f837(0x1c5)],_0x264354=_0x55a509[_0x47f837(0x20e)][_0x47f837(0x1ec)],_0x32ae8d=_0x55a509['activations'][_0x47f837(0x218)],_0x2dd248=_0x55a509['activations'][_0x47f837(0x1de)],_0x11f436=_0x55a509[_0x47f837(0x207)]['toUpdate'],_0x2d06c4=_0x55a509[_0x47f837(0x207)][_0x47f837(0x1ec)];console['error'](_0x47f837(0x22e)+_0xfc58b0+'\x27:');_0x258c5b['length']>0x0&&console['error']('\x20\x20'+a42_0x361cc0[_0x47f837(0x21d)]('📁\x20'+_0x258c5b[_0x47f837(0x247)]+'\x20folders\x20to\x20create'));if(!_0x1d1f1f['journeysOnly']){console[_0x47f837(0x1d7)](_0x47f837(0x226)),console[_0x47f837(0x1d7)](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1e2)]('+\x20'+_0x58a932[_0x47f837(0x247)]+_0x47f837(0x23a))),console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1ee)]('~\x20'+_0x1fd732[_0x47f837(0x247)]+'\x20changed'));if(_0x108905[_0x47f837(0x247)]>0x0)console['error'](_0x47f837(0x1be)+a42_0x361cc0['red']('-\x20'+_0x108905[_0x47f837(0x247)]+_0x47f837(0x1f8)));else _0x5be760[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x250)]&&console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x22c)](_0x5be760[_0x47f837(0x247)]+_0x47f837(0x240)));console['error']('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x22c)]('=\x20'+_0x49eb65[_0x47f837(0x247)]+_0x47f837(0x245)));}if(_0x1c72a3[_0x47f837(0x247)]>0x0||_0x4d4cf5[_0x47f837(0x247)]>0x0){console[_0x47f837(0x1d7)](_0x47f837(0x1eb)),console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1e2)]('+\x20'+_0x4549d8['length']+_0x47f837(0x23a))),console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1ee)]('~\x20'+_0x3101eb['length']+_0x47f837(0x223)));if(_0x264354[_0x47f837(0x247)]>0x0)console[_0x47f837(0x1d7)]('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x202)]('-\x20'+_0x264354[_0x47f837(0x247)]+_0x47f837(0x1f8)));else _0x4d4cf5['length']>0x0&&!_0x1d1f1f[_0x47f837(0x250)]&&console['error']('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x22c)](_0x4d4cf5[_0x47f837(0x247)]+_0x47f837(0x240)));console[_0x47f837(0x1d7)](_0x47f837(0x1be)+a42_0x361cc0['dim']('=\x20'+_0x4cfead['length']+_0x47f837(0x245)));}_0x32ae8d[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&(console[_0x47f837(0x1d7)](''),console[_0x47f837(0x1d7)](_0x47f837(0x24c)),_0x2dd248[_0x47f837(0x247)]>0x0&&console[_0x47f837(0x1d7)](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1e2)]('+\x20'+_0x2dd248[_0x47f837(0x247)]+_0x47f837(0x1ed))),_0x11f436['length']>0x0&&console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1ee)]('~\x20'+_0x11f436[_0x47f837(0x247)]+'\x20to\x20update')),_0x2d06c4[_0x47f837(0x247)]>0x0&&console[_0x47f837(0x1d7)]('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x202)]('-\x20'+_0x2d06c4['length']+'\x20to\x20delete')));console[_0x47f837(0x1d7)]('\x20\x20Source:\x20'+a42_0x361cc0[_0x47f837(0x1cb)](_0x5f0f01)+'\x0a');if(_0x258c5b[_0x47f837(0x247)]>0x0){console[_0x47f837(0x1d7)]('Folders\x20to\x20create:');for(const _0x3cdb78 of _0x258c5b){console['error']('\x20\x20'+a42_0x361cc0[_0x47f837(0x21d)]('+')+'\x20'+_0x3cdb78);}console['error']('');}if(_0x58a932[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)])for(const _0x412a9a of _0x58a932){const _0x1e1f70=_0x412a9a[_0x47f837(0x1c9)]?_0x412a9a[_0x47f837(0x1c9)]+'/'+_0x412a9a[_0x47f837(0x1f5)][_0x47f837(0x21e)]:_0x412a9a[_0x47f837(0x1f5)][_0x47f837(0x21e)],_0x3adc21=_0x412a9a[_0x47f837(0x1f5)][_0x47f837(0x207)]?.['length']||0x0,_0x57540f=_0x3adc21>0x0?a42_0x361cc0[_0x47f837(0x22c)]('\x20['+_0x3adc21+_0x47f837(0x1ef)):'';console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1e2)](_0x47f837(0x23e))+'\x20'+_0x1e1f70+_0x57540f),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c)),_0x412a9a['diff']&&console[_0x47f837(0x1d7)](_0x412a9a[_0x47f837(0x215)]),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}if(_0x108905[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)])for(const _0x5b4384 of _0x108905){const _0x59a242=_0x5b4384['segmentFolderId']?_0x2a99bf[_0x47f837(0x203)](_0x5b4384[_0x47f837(0x1d3)]['toString']())||'':'',_0x52493c=_0x59a242?_0x59a242+'/'+_0x5b4384['name']:_0x5b4384['name'],_0x1cf29c=_0x5efdac[_0x47f837(0x203)](_0x5b4384['id'])||[],_0x1cea8c=_0x1cf29c[_0x47f837(0x247)]>0x0?a42_0x361cc0[_0x47f837(0x22c)]('\x20['+_0x1cf29c[_0x47f837(0x247)]+_0x47f837(0x1ef)):'';console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0['red']('Delete\x20segment:')+'\x20'+_0x52493c+_0x1cea8c),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));const _0x505659=segmentWithActivationsToYaml(_0x5b4384,_0x1cf29c,undefined,_0x55763f,_0x920b7d),_0x52a640=segmentToYamlString(_0x505659),_0x3f0d75=generateDiff(_0x52a640,'');console['error'](formatDiffWithColors(_0x3f0d75)),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}const _0x27b4f6=_0x155f81[_0x47f837(0x1ca)](_0x11c566=>!_0x11c566[_0x47f837(0x1db)]&&_0x11c566[_0x47f837(0x215)]);if(_0x27b4f6[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)])for(const _0x385af6 of _0x27b4f6){const _0x22895d=_0x385af6[_0x47f837(0x1c9)]?_0x385af6[_0x47f837(0x1c9)]+'/'+_0x385af6[_0x47f837(0x1f5)]['name']:_0x385af6[_0x47f837(0x1f5)][_0x47f837(0x21e)];console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x204))+'\x20'+_0x22895d),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c)),console[_0x47f837(0x1d7)](_0x385af6[_0x47f837(0x215)]),console['error']('─'[_0x47f837(0x1f4)](0x3c));}if(_0x4549d8[_0x47f837(0x247)]>0x0)for(const _0x28646d of _0x4549d8){const _0x216273=_0x28646d[_0x47f837(0x1c9)]?_0x28646d[_0x47f837(0x1c9)]+'/'+_0x28646d[_0x47f837(0x1f5)][_0x47f837(0x21e)]:_0x28646d[_0x47f837(0x1f5)][_0x47f837(0x21e)];console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1e2)](_0x47f837(0x1b4))+'\x20'+_0x216273),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c)),_0x28646d[_0x47f837(0x215)]&&console[_0x47f837(0x1d7)](_0x28646d['diff']),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}const _0x1d374d=_0x1c72a3[_0x47f837(0x1ca)](_0x45cd9f=>!_0x45cd9f['isNew']&&_0x45cd9f['diff']);if(_0x1d374d[_0x47f837(0x247)]>0x0)for(const _0x8ef016 of _0x1d374d){const _0x547c90=_0x8ef016['folderPath']?_0x8ef016[_0x47f837(0x1c9)]+'/'+_0x8ef016['yamlConfig'][_0x47f837(0x21e)]:_0x8ef016[_0x47f837(0x1f5)]['name'];console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x1d8))+'\x20'+_0x547c90),console['error']('─'[_0x47f837(0x1f4)](0x3c)),console['error'](_0x8ef016[_0x47f837(0x215)]),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}if(_0x264354[_0x47f837(0x247)]>0x0)for(const _0x2bb2ee of _0x264354){const _0x119498=_0x2bb2ee[_0x47f837(0x248)]?_0x2a99bf[_0x47f837(0x203)](_0x2bb2ee[_0x47f837(0x248)])||'':'',_0x3f127c=_0x119498?_0x119498+'/'+_0x2bb2ee[_0x47f837(0x236)]:_0x2bb2ee[_0x47f837(0x236)];console['error']('\x0a'+a42_0x361cc0[_0x47f837(0x202)]('Delete\x20journey:')+'\x20'+_0x3f127c),console['error']('─'[_0x47f837(0x1f4)](0x3c)),console[_0x47f837(0x1d7)](a42_0x361cc0['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x47f837(0x1d7)]('─'['repeat'](0x3c));}if(_0x1d1f1f[_0x47f837(0x1bb)])return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x1fa))),0x0;const _0x377086=_0x1d1f1f['journeysOnly']?![]:_0x58a932[_0x47f837(0x247)]>0x0||_0x1fd732['length']>0x0||_0x108905['length']>0x0,_0x13e06f=_0x4549d8[_0x47f837(0x247)]>0x0||_0x3101eb[_0x47f837(0x247)]>0x0||_0x264354[_0x47f837(0x247)]>0x0,_0x26ad91=_0x1d1f1f['journeysOnly']?![]:_0x32ae8d[_0x47f837(0x247)]>0x0,_0x42b149=_0x258c5b[_0x47f837(0x247)]>0x0;if(!_0x377086&&!_0x13e06f&&!_0x26ad91&&!_0x42b149){const _0x465560=_0x1d1f1f[_0x47f837(0x1c4)]?_0x47f837(0x21f):_0x47f837(0x1b8);console[_0x47f837(0x1d7)](a42_0x361cc0['green'](_0x465560));if(_0x40bc04&&_0x49eb65[_0x47f837(0x247)]===0x1){const _0x2fab14=_0x49eb65[0x0];if(_0x2fab14[_0x47f837(0x1e8)]?.['id']){const _0xd613ce=getConsoleNextUrl(_0x1d1f1f['site'],'/app/ps/'+_0x316186+_0x47f837(0x229)+_0x2fab14['existingSegment']['id']+_0x47f837(0x1bd));console[_0x47f837(0x1d7)](_0x47f837(0x1f3)+a42_0x361cc0[_0x47f837(0x1cb)](_0xd613ce));}}if(_0x40bc04&&_0x4cfead[_0x47f837(0x247)]===0x1){const _0x4832aa=_0x4cfead[0x0];if(_0x4832aa[_0x47f837(0x1f0)]?.['id']){const _0x17bd2a=getConsoleNextUrl(_0x1d1f1f['site'],_0x47f837(0x1ff)+_0x316186+_0x47f837(0x229)+_0x4832aa[_0x47f837(0x1f0)]['id']+_0x47f837(0x227));console[_0x47f837(0x1d7)]('\x20\x20'+a42_0x361cc0[_0x47f837(0x1cb)](_0x17bd2a));}}return 0x0;}const _0x43afe9=_0x1d1f1f['journeysOnly']?_0x4549d8[_0x47f837(0x247)]+_0x3101eb['length']+_0x264354['length']+_0x258c5b[_0x47f837(0x247)]:_0x58a932[_0x47f837(0x247)]+_0x1fd732[_0x47f837(0x247)]+_0x108905['length']+_0x4549d8[_0x47f837(0x247)]+_0x3101eb[_0x47f837(0x247)]+_0x264354[_0x47f837(0x247)]+_0x258c5b[_0x47f837(0x247)]+_0x32ae8d[_0x47f837(0x247)];if(!_0x1d1f1f[_0x47f837(0x24a)]&&_0x43afe9>0x0){if(!isInteractive())return console['error'](a42_0x361cc0[_0x47f837(0x202)]('\x0aError:'),_0x47f837(0x1cc)),console['error'](a42_0x361cc0['dim'](_0x47f837(0x1dc))),0x1;const _0x3e3467=await confirmKey(_0x47f837(0x1c2)+_0x43afe9+_0x47f837(0x1e6));if(!_0x3e3467)return console['error'](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x243))),0x1;}const _0x4abb6a={'withProgress':async(_0x237613,_0x47757e)=>{const _0x27ce2a=_0x47f837,_0x233548=await withSpinner(_0x237613,_0x47757e,{'verbose':_0x1d1f1f[_0x27ce2a(0x208)]});return{'data':_0x233548[_0x27ce2a(0x20b)]};},'logInfo':_0x185b5a=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x21d)]('✔\x20'+_0x185b5a)),'logSuccess':_0x46d166=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1e2)]('✔\x20'+_0x46d166)),'logWarning':_0x373beb=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)]('⚠\x20'+_0x373beb)),'logDeleted':_0x66e282=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)]('✔\x20'+_0x66e282))},_0x3ba1df={'segment':_0x2f0a23[_0x47f837(0x233)],'journey':_0x2f0a23[_0x47f837(0x20a)],'user':_0x2f0a23['user'],'connection':_0x2f0a23[_0x47f837(0x205)]};_0x258c5b[_0x47f837(0x247)]>0x0&&(_0x21e939=await executePushFolders(_0x3ba1df,_0x258c5b,_0x21e939,{'parentId':_0x316186},_0x4abb6a));const _0x1f6c31={'rootFolderId':_0x28a3af,'folderPathToId':_0x21e939,'folderIdToPath':_0x2a99bf,'segmentNameToId':_0x182273,'activationsBySegmentId':_0x5efdac,'emailToIdMap':_0x2a817b,'idToEmailMap':_0x55763f,'connectionNameToIdMap':_0x48041e[_0x47f837(0x23f)],'connectionIdToNameMap':_0x48041e[_0x47f837(0x1e3)],'connectionNameToTypeMap':_0x15562e},_0x313c56=await executePushSegments(_0x3ba1df,_0x1d1f1f['journeysOnly']?[]:_0x155f81,_0x1f6c31,{'parentId':_0x316186},_0x4abb6a),_0x3da7d0=_0x313c56[_0x47f837(0x239)],_0x3f9a2e=_0x313c56['updated'],_0x18c399=_0x313c56[_0x47f837(0x207)][_0x47f837(0x239)],_0x348514=_0x313c56[_0x47f837(0x207)][_0x47f837(0x228)],_0x4a87f4=_0x313c56[_0x47f837(0x207)][_0x47f837(0x1cf)];let _0x342918;if(_0x40bc04&&_0x155f81[_0x47f837(0x247)]===0x1){const _0x3f6991=_0x155f81[0x0];_0x342918=_0x3f6991[_0x47f837(0x1e8)]?.['id']??_0x313c56[_0x47f837(0x1df)][_0x47f837(0x203)](_0x3f6991[_0x47f837(0x1f5)][_0x47f837(0x21e)]);}const _0x1f174a=await executePushSegmentDeletions(_0x3ba1df,_0x1d1f1f[_0x47f837(0x1c4)]?[]:_0x108905,_0x4abb6a);let _0x448170=0x0,_0x15ba45=0x0,_0x10bd3a=0x0;const _0x18dae5=new Map(_0x182273);for(const [_0x25aa5d,_0x20ff30]of _0x313c56[_0x47f837(0x1df)]){_0x18dae5['set'](_0x25aa5d,_0x20ff30);}if(_0x1c72a3[_0x47f837(0x247)]>0x0){const _0x361536={..._0x1f6c31,'segmentNameToId':_0x18dae5,'existingSegments':_0x154d8e,'activationContext':_0x539d20},_0x5de1f6=await executePushJourneys(_0x3ba1df,_0x1c72a3,_0x361536,{'parentId':_0x316186,'rootFolderId':_0x28a3af,'verbose':_0x1d1f1f[_0x47f837(0x208)]},_0x4abb6a);_0x448170=_0x5de1f6['created'],_0x15ba45=_0x5de1f6['updated'];if(_0x40bc04&&_0x5de1f6[_0x47f837(0x1c3)][_0x47f837(0x247)]===0x1){const _0x29a78b=_0x5de1f6[_0x47f837(0x1c3)][0x0];if(_0x29a78b[_0x47f837(0x251)]){const _0x1dec71=getConsoleNextUrl(_0x1d1f1f[_0x47f837(0x1d5)],_0x47f837(0x1ff)+_0x316186+_0x47f837(0x229)+_0x29a78b[_0x47f837(0x251)]+'/j/da/je');console[_0x47f837(0x1d7)]('\x20\x20'+a42_0x361cc0['cyan'](_0x1dec71));}}}for(const _0x5478b8 of _0x264354){console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x230)+_0x5478b8[_0x47f837(0x236)])),_0x10bd3a++;}const _0x247a78=[];if(_0x3da7d0>0x0)_0x247a78[_0x47f837(0x1e5)](_0x3da7d0+_0x47f837(0x1c7));if(_0x3f9a2e>0x0)_0x247a78[_0x47f837(0x1e5)](_0x3f9a2e+_0x47f837(0x201));if(_0x1f174a>0x0)_0x247a78['push'](_0x1f174a+_0x47f837(0x24d));const _0xc5188a=[];if(_0x448170>0x0)_0xc5188a[_0x47f837(0x1e5)](_0x448170+_0x47f837(0x1c7));if(_0x15ba45>0x0)_0xc5188a[_0x47f837(0x1e5)](_0x15ba45+_0x47f837(0x201));if(_0x10bd3a>0x0)_0xc5188a[_0x47f837(0x1e5)](_0x10bd3a+_0x47f837(0x24d));const _0x924feb=[];if(_0x18c399>0x0)_0x924feb[_0x47f837(0x1e5)](_0x18c399+_0x47f837(0x1c7));if(_0x348514>0x0)_0x924feb[_0x47f837(0x1e5)](_0x348514+_0x47f837(0x201));if(_0x4a87f4>0x0)_0x924feb[_0x47f837(0x1e5)](_0x4a87f4+_0x47f837(0x24d));console['error'](a42_0x361cc0[_0x47f837(0x1e2)](_0x47f837(0x1c8)));_0x247a78[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&console[_0x47f837(0x1d7)]('\x20\x20Segments:\x20'+_0x247a78[_0x47f837(0x1fb)](',\x20'));_0xc5188a[_0x47f837(0x247)]>0x0&&console[_0x47f837(0x1d7)](_0x47f837(0x214)+_0xc5188a[_0x47f837(0x1fb)](',\x20'));_0x924feb[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&console[_0x47f837(0x1d7)](_0x47f837(0x1da)+_0x924feb[_0x47f837(0x1fb)](',\x20'));if(_0x342918){const _0x15f18c=getConsoleNextUrl(_0x1d1f1f[_0x47f837(0x1d5)],'/app/ps/'+_0x316186+_0x47f837(0x229)+_0x342918+_0x47f837(0x1bd));console[_0x47f837(0x1d7)](_0x47f837(0x1f3)+a42_0x361cc0[_0x47f837(0x1cb)](_0x15f18c));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x419d31=a43_0x2c52;function a43_0x2c6c(){const _0x2aaaa3=['name','execute','description','Resolving\x20folder\x20\x27','parentId','Segment\x20ID:\x20','Updating\x20segment\x20\x27','segmentId','verbose','type','152TpPwMW','Resolving\x20path\x20\x27','683724dZOJNz','65OVaewQ','segment:update','11210760HRFZKv','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1478tpXBIc','resolveFolderId','4aqPxFP','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','577377HBZUkp','folder','data','error','Error:\x20Cannot\x20update\x20','162234pCxHFB','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','Resolved\x20type:\x20','Examples:','segment','yellow','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','✔\x20Updated\x20segment\x20\x27','\x20\x20\x20Path:\x20','601573tQfasW','kind','1095425JARtvw','Update\x20existing\x20child\x20segment','updateSegmentById','includes','segmentName'];a43_0x2c6c=function(){return _0x2aaaa3;};return a43_0x2c6c();}(function(_0x17a22e,_0x2bf170){const _0x2a3b64=a43_0x2c52,_0x2907cd=_0x17a22e();while(!![]){try{const _0x391922=parseInt(_0x2a3b64(0x152))/0x1*(parseInt(_0x2a3b64(0x157))/0x2)+-parseInt(_0x2a3b64(0x15b))/0x3+parseInt(_0x2a3b64(0x159))/0x4*(-parseInt(_0x2a3b64(0x16c))/0x5)+-parseInt(_0x2a3b64(0x151))/0x6+-parseInt(_0x2a3b64(0x16a))/0x7+parseInt(_0x2a3b64(0x14f))/0x8*(-parseInt(_0x2a3b64(0x160))/0x9)+parseInt(_0x2a3b64(0x154))/0xa;if(_0x391922===_0x2bf170)break;else _0x2907cd['push'](_0x2907cd['shift']());}catch(_0x1d3966){_0x2907cd['push'](_0x2907cd['shift']());}}}(a43_0x2c6c,0x3488c));function a43_0x2c52(_0x1249d3,_0x51f7aa){_0x1249d3=_0x1249d3-0x143;const _0x2c6cc4=a43_0x2c6c();let _0x2c5238=_0x2c6cc4[_0x1249d3];return _0x2c5238;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x465690 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x419d31(0x145)]=a43_0x419d31(0x153);[a43_0x419d31(0x147)]=a43_0x419d31(0x16d);async[a43_0x419d31(0x146)](_0x17b90b){const _0xb71875=a43_0x419d31;console[_0xb71875(0x15e)](a43_0x465690[_0xb71875(0x166)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0xb71875(0x15e)](a43_0x465690[_0xb71875(0x166)](_0xb71875(0x161)));const {options:_0x1121b3,args:_0x236642,tdx:_0x4614ff}=_0x17b90b,_0x5aa912=_0x1121b3;if(_0x236642['length']===0x0)return console[_0xb71875(0x15e)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0xb71875(0x155)),console[_0xb71875(0x15e)](_0xb71875(0x164)),console['error'](_0xb71875(0x15a)),console[_0xb71875(0x15e)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x40a2de=_0x236642[0x0],_0x20b1ae=_0x1121b3['segmentPath'];let _0x252c93=_0x40a2de;_0x20b1ae&&!_0x40a2de[_0xb71875(0x143)]('/')&&(_0x252c93=_0x20b1ae+'/'+_0x40a2de,_0x5aa912[_0xb71875(0x14d)]&&console[_0xb71875(0x15e)]('Resolved\x20relative\x20path\x20to:\x20'+_0x252c93));const _0x722a13=await withSpinner(_0xb71875(0x150)+_0x252c93+_0xb71875(0x162),()=>_0x4614ff[_0xb71875(0x165)]['resolvePathToResource'](_0x252c93),{'verbose':_0x5aa912[_0xb71875(0x14d)]}),_0x534ee7=_0x722a13[_0xb71875(0x15d)];_0x5aa912['verbose']&&console[_0xb71875(0x15e)](_0xb71875(0x163)+_0x534ee7[_0xb71875(0x14e)]);if(_0x534ee7[_0xb71875(0x14e)]!==_0xb71875(0x165))return console[_0xb71875(0x15e)](_0xb71875(0x15f)+_0x534ee7['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0xb71875(0x167)),0x1;if(!_0x534ee7[_0xb71875(0x14c)])throw new SDKError(ErrorCode['INTERNAL'],_0xb71875(0x156));const _0x5d0741=_0x534ee7[_0xb71875(0x149)],_0x424249=_0x534ee7[_0xb71875(0x14c)];_0x5aa912[_0xb71875(0x14d)]&&(console[_0xb71875(0x15e)]('Parent\x20ID:\x20'+_0x5d0741),console[_0xb71875(0x15e)](_0xb71875(0x14a)+_0x424249));let _0x439b8d;if(_0x5aa912['folder']){const _0x15f833=_0x5aa912[_0xb71875(0x15c)],_0x30a07b=await withSpinner(_0xb71875(0x148)+_0x15f833+_0xb71875(0x162),()=>_0x4614ff[_0xb71875(0x165)][_0xb71875(0x158)](_0x5d0741,_0x15f833),{'verbose':_0x5aa912[_0xb71875(0x14d)]});_0x439b8d=parseInt(_0x30a07b['data'],0xa),_0x5aa912[_0xb71875(0x14d)]&&console[_0xb71875(0x15e)]('Resolved\x20folder\x20ID:\x20'+_0x439b8d);}const _0x5825eb=await loadJSONFromOptions(_0x5aa912['rule'],_0x5aa912['ruleFile']),_0x211a32={'name':_0x5aa912[_0xb71875(0x145)],'description':_0x5aa912[_0xb71875(0x147)],'rule':_0x5825eb,'kind':_0x5aa912['kind']!==undefined?parseInt(_0x5aa912[_0xb71875(0x16b)],0xa):undefined,'segmentFolderId':_0x439b8d},_0x2af681=await withSpinner(_0xb71875(0x14b)+_0x534ee7[_0xb71875(0x144)]+_0xb71875(0x162),()=>_0x4614ff[_0xb71875(0x165)][_0xb71875(0x16e)](_0x5d0741,_0x424249,_0x211a32),{'verbose':_0x5aa912[_0xb71875(0x14d)]}),_0x37200d=_0x2af681[_0xb71875(0x15d)];return console[_0xb71875(0x15e)](_0xb71875(0x168)+_0x37200d[_0xb71875(0x145)]+'\x27'),_0x252c93!==_0x40a2de&&console['error'](_0xb71875(0x169)+_0x252c93),await handleSDKOutput([_0x37200d],_0x5aa912),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x2b370d=a44_0x1691;(function(_0x30ac27,_0x386079){const _0x414e13=a44_0x1691,_0x2f02fc=_0x30ac27();while(!![]){try{const _0x50b64d=parseInt(_0x414e13(0x194))/0x1*(-parseInt(_0x414e13(0x179))/0x2)+parseInt(_0x414e13(0x164))/0x3+parseInt(_0x414e13(0x18e))/0x4*(parseInt(_0x414e13(0x18d))/0x5)+parseInt(_0x414e13(0x18f))/0x6*(parseInt(_0x414e13(0x176))/0x7)+parseInt(_0x414e13(0x18b))/0x8+parseInt(_0x414e13(0x198))/0x9*(-parseInt(_0x414e13(0x178))/0xa)+parseInt(_0x414e13(0x17c))/0xb*(-parseInt(_0x414e13(0x163))/0xc);if(_0x50b64d===_0x386079)break;else _0x2f02fc['push'](_0x2f02fc['shift']());}catch(_0x45b72e){_0x2f02fc['push'](_0x2f02fc['shift']());}}}(a44_0x30b0,0x5bc7c));import{existsSync,statSync}from'fs';function a44_0x1691(_0xb6e61a,_0x43c4de){_0xb6e61a=_0xb6e61a-0x160;const _0x30b04f=a44_0x30b0();let _0x169182=_0x30b04f[_0xb6e61a];return _0x169182;}import a44_0x5b9e61 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a44_0x30b0(){const _0x313451=['red','4591912ogJyzH','✔\x20Context\x20set\x20to:\x20','5hDpkze','1832692okrYjQ','2456088XflJsW','segment:use','cyan','Use:\x20tdx\x20segment\x20use\x20','green','7tJVUsv','name','site','description','146061jEAIHd','isAbsolute','fullPath','\x27...','12KMBEXp','1183437LjKokW','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','folderId','Usage:\x20tdx\x20segment\x20use\x20<path>','parentId','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','error','dim','split','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Folder\x20ID:\x20','folderPath','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segment','type','parentName','7KrrEBR','verbose','90hBSVRY','142370Wenioz','config','Error:\x20Path\x20is\x20required\x0a','8972711OnJvtp','log','data','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','session','parent_segment','execute','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','length','Site:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','join','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segments'];a44_0x30b0=function(){return _0x313451;};return a44_0x30b0();}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{[a44_0x2b370d(0x195)]=a44_0x2b370d(0x190);[a44_0x2b370d(0x197)]=a44_0x2b370d(0x186);async[a44_0x2b370d(0x182)](_0x1ccde7){const _0x2402dd=a44_0x2b370d,{options:_0x5bee22,args:_0x128ea0,tdx:_0x648d63}=_0x1ccde7;if(_0x128ea0[_0x2402dd(0x184)]===0x0)return console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x18a)](_0x2402dd(0x17b))),console[_0x2402dd(0x16b)](_0x2402dd(0x168)),console[_0x2402dd(0x16b)]('Examples:'),console[_0x2402dd(0x16b)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x2402dd(0x16b)](_0x2402dd(0x16e)),console['error'](_0x2402dd(0x166)),console[_0x2402dd(0x16b)](_0x2402dd(0x16a)),0x1;const _0x5feda2=_0x128ea0[0x0],_0x28f32a=_0x5bee22[_0x2402dd(0x180)];try{if(_0x5feda2==='/')return saveSessionContext({'segment_path':undefined},_0x28f32a),console['log'](a44_0x5b9e61[_0x2402dd(0x193)](_0x2402dd(0x165))),0x0;if(existsSync(_0x5feda2)&&statSync(_0x5feda2)['isDirectory']()){let _0x115230;try{_0x115230=findTdxConfig(_0x5feda2);}catch{return console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x18a)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x5feda2)),console['error'](a44_0x5b9e61['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3390e8=_0x115230[_0x2402dd(0x17a)][_0x2402dd(0x181)];return saveSessionContext({'segment_path':_0x3390e8,'parent_segment':_0x3390e8},_0x28f32a),console[_0x2402dd(0x17d)](a44_0x5b9e61[_0x2402dd(0x193)]('✔\x20Context\x20set\x20to:\x20'+a44_0x5b9e61[_0x2402dd(0x191)](_0x3390e8))),0x0;}const _0x7788d4=_0x5bee22['segmentPath'];let _0x9d8e75=_0x5feda2;const _0x5b9be5=parsePath(_0x5feda2);if(!_0x5b9be5[_0x2402dd(0x160)]){if(!_0x7788d4)return console['error'](a44_0x5b9e61[_0x2402dd(0x18a)](_0x2402dd(0x17f))),console[_0x2402dd(0x16b)](a44_0x5b9e61['cyan'](_0x2402dd(0x16f))),0x1;if(_0x5feda2==='..'){const _0x3835bb=_0x7788d4[_0x2402dd(0x16d)]('/')['slice'](0x0,-0x1)['join']('/');_0x9d8e75=_0x3835bb||'/';}else _0x5feda2==='.'?_0x9d8e75=_0x7788d4:_0x9d8e75=_0x7788d4+'/'+_0x5feda2;_0x5bee22[_0x2402dd(0x177)]&&console[_0x2402dd(0x16b)]('Resolved\x20relative\x20path\x20to:\x20'+_0x9d8e75);}if(_0x9d8e75==='/'||_0x9d8e75==='')return saveSessionContext({'segment_path':undefined},_0x28f32a),console[_0x2402dd(0x17d)](a44_0x5b9e61['green'](_0x2402dd(0x165))),0x0;_0x9d8e75=normalizePath(_0x9d8e75);const _0x65b352=parsePath(_0x9d8e75)[_0x2402dd(0x189)];if(_0x65b352[_0x2402dd(0x184)]===0x0)return saveSessionContext({'segment_path':undefined},_0x28f32a),console['log'](a44_0x5b9e61[_0x2402dd(0x193)](_0x2402dd(0x165))),0x0;_0x5bee22[_0x2402dd(0x177)]&&(console[_0x2402dd(0x16b)](_0x2402dd(0x185)+_0x5bee22[_0x2402dd(0x196)]),console[_0x2402dd(0x16b)]('Target\x20path:\x20'+_0x9d8e75));const _0x238956=await withSpinner('Resolving\x20path\x20\x27'+_0x9d8e75+_0x2402dd(0x162),()=>_0x648d63[_0x2402dd(0x173)]['resolvePathToResource'](_0x9d8e75),{'verbose':_0x5bee22[_0x2402dd(0x177)]}),_0x5c83e4=_0x238956[_0x2402dd(0x17e)];_0x5bee22[_0x2402dd(0x177)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x5c83e4[_0x2402dd(0x174)]),console[_0x2402dd(0x16b)]('Parent\x20ID:\x20'+_0x5c83e4[_0x2402dd(0x169)]),_0x5c83e4[_0x2402dd(0x167)]&&console[_0x2402dd(0x16b)](_0x2402dd(0x170)+_0x5c83e4[_0x2402dd(0x167)]));if(_0x5c83e4['type']==='segment')return console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x18a)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x2402dd(0x16b)](_0x2402dd(0x188)),console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x191)](_0x2402dd(0x192)+_0x5c83e4[_0x2402dd(0x175)]+(_0x5c83e4[_0x2402dd(0x171)]?'/'+_0x5c83e4['folderPath'][_0x2402dd(0x187)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5c83e4[_0x2402dd(0x161)],'parent_segment':_0x5c83e4[_0x2402dd(0x175)]},_0x28f32a),console[_0x2402dd(0x17d)](a44_0x5b9e61['green'](_0x2402dd(0x18c)+a44_0x5b9e61['cyan'](_0x5c83e4[_0x2402dd(0x161)]))),_0x5bee22[_0x2402dd(0x177)]&&(console[_0x2402dd(0x16b)](a44_0x5b9e61['dim'](_0x2402dd(0x183))),console['error'](a44_0x5b9e61[_0x2402dd(0x16c)](_0x2402dd(0x172)))),0x0;}catch(_0x520da6){throw _0x520da6;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x17cf04=a45_0x21f1;(function(_0x30b632,_0x5934a8){const _0x57cd27=a45_0x21f1,_0x368cc7=_0x30b632();while(!![]){try{const _0x76b9b2=parseInt(_0x57cd27(0x206))/0x1+parseInt(_0x57cd27(0x1fc))/0x2*(parseInt(_0x57cd27(0x207))/0x3)+-parseInt(_0x57cd27(0x214))/0x4*(parseInt(_0x57cd27(0x20f))/0x5)+parseInt(_0x57cd27(0x1ff))/0x6+-parseInt(_0x57cd27(0x20a))/0x7*(parseInt(_0x57cd27(0x1f1))/0x8)+-parseInt(_0x57cd27(0x20d))/0x9+-parseInt(_0x57cd27(0x1f2))/0xa;if(_0x76b9b2===_0x5934a8)break;else _0x368cc7['push'](_0x368cc7['shift']());}catch(_0x5ca058){_0x368cc7['push'](_0x368cc7['shift']());}}}(a45_0x253c,0x70d41));import{BaseCommand}from'./command.js';function a45_0x253c(){const _0x287e0c=['error','log','Error:\x20','verbose','green','1489032xrGQwV','2823150sLyWwS','name','type','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','):\x20','description','targetDir','Error:\x20Directory\x20not\x20found:\x20','length','validCount','34862pgwbzH','warnings','\x20file(s)\x20with\x20errors,\x20','829704FPIDCZ','yellow','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Validate\x20segment\x20and\x20journey\x20YAML\x20files','cyan','325892fbHLrX','144eySEQZ','\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','.yml','7JXOjXR','red','helpText','2145069EPgRhv','\x20error(s)','10vbHeVH','errorCode','warningCount','message','endsWith','263868aIEESc','\x20warning(s)\x20found','file','errors','.yaml','valid','dim','invalidCount','cwd','parentSegment'];a45_0x253c=function(){return _0x287e0c;};return a45_0x253c();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a45_0x21f1(_0x31ffc6,_0x49cd89){_0x31ffc6=_0x31ffc6-0x1e8;const _0x253cec=a45_0x253c();let _0x21f182=_0x253cec[_0x31ffc6];return _0x21f182;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x300f5c from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a45_0x17cf04(0x1f3)]='segment:validate';[a45_0x17cf04(0x1f7)]=a45_0x17cf04(0x204);async['execute'](_0x1f5603){const _0x2d6d60=a45_0x17cf04,{options:_0x44fd0a,args:_0x326e71}=_0x1f5603,_0x174dec=_0x44fd0a,_0x1071a4=await resolveTarget({'arg':_0x326e71[0x0],'contextParent':_0x44fd0a[_0x2d6d60(0x1eb)],'cwd':process[_0x2d6d60(0x1ea)]()});if(!isSuccessfulResolution(_0x1071a4))return _0x1071a4[_0x2d6d60(0x210)]==='no_parent'?(console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x200)](_0x2d6d60(0x201))),console[_0x2d6d60(0x1ec)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x2d6d60(0x1ec)](_0x2d6d60(0x208)),console['error'](_0x2d6d60(0x203))):(console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x20b)](_0x2d6d60(0x1ee)+_0x1071a4[_0x2d6d60(0x212)]+'\x0a')),_0x1071a4[_0x2d6d60(0x20c)]&&console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x205)](_0x1071a4[_0x2d6d60(0x20c)]))),0x1;const _0x5b9034=_0x1071a4[_0x2d6d60(0x1f8)],_0x398154=_0x1071a4[_0x2d6d60(0x1f4)]===_0x2d6d60(0x216)?_0x1071a4['filePath']:undefined;if(!_0x398154&&!existsSync(_0x5b9034))return console['error'](a45_0x300f5c[_0x2d6d60(0x20b)](_0x2d6d60(0x1f9)+_0x5b9034+'\x0a')),0x1;let _0x2b1685;if(_0x398154){if(!_0x398154[_0x2d6d60(0x213)](_0x2d6d60(0x209))&&!_0x398154[_0x2d6d60(0x213)](_0x2d6d60(0x218)))return console[_0x2d6d60(0x1ec)](a45_0x300f5c['red'](_0x2d6d60(0x202)+_0x398154+'\x0a')),0x1;_0x2b1685=[_0x398154];}else _0x2b1685=findYamlFiles(_0x5b9034);if(_0x2b1685[_0x2d6d60(0x1fa)]===0x0)return console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x20b)](_0x2d6d60(0x1f5)+_0x5b9034+'\x0a')),0x1;const _0x536a96=validateYamlFiles(_0x2b1685,_0x5b9034),_0x4f29d5=calculateSummary(_0x536a96);for(const _0x5d9347 of _0x536a96){if(!isValidationResult(_0x5d9347))continue;const {relativePath:_0x195f52,source:_0x20373c,result:_0x5cb0ea,fileType:_0x2e4364}=_0x5d9347,_0x4e37eb=_0x2e4364;if(_0x5cb0ea[_0x2d6d60(0x219)]&&_0x5cb0ea[_0x2d6d60(0x1fd)][_0x2d6d60(0x1fa)]===0x0)_0x174dec[_0x2d6d60(0x1ef)]&&console[_0x2d6d60(0x1ed)](a45_0x300f5c['green']('✔\x20'+_0x195f52)+a45_0x300f5c[_0x2d6d60(0x1e8)]('\x20('+_0x4e37eb+')'));else _0x5cb0ea[_0x2d6d60(0x219)]?(console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x200)]('⚠\x20'+_0x195f52)+a45_0x300f5c[_0x2d6d60(0x1e8)]('\x20('+_0x4e37eb+_0x2d6d60(0x1f6)+_0x5cb0ea[_0x2d6d60(0x1fd)][_0x2d6d60(0x1fa)]+'\x20warning(s)')),console[_0x2d6d60(0x1ed)](formatValidationResult(_0x5cb0ea,_0x20373c,_0x195f52))):(console[_0x2d6d60(0x1ed)](a45_0x300f5c['red']('✖\x20'+_0x195f52)+a45_0x300f5c[_0x2d6d60(0x1e8)]('\x20('+_0x4e37eb+_0x2d6d60(0x1f6)+_0x5cb0ea[_0x2d6d60(0x217)][_0x2d6d60(0x1fa)]+_0x2d6d60(0x20e))),console[_0x2d6d60(0x1ed)](formatValidationResult(_0x5cb0ea,_0x20373c,_0x195f52)));}return console['log'](''),_0x4f29d5['hasErrors']?(console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x20b)]('Validation\x20failed:\x20'+_0x4f29d5[_0x2d6d60(0x1e9)]+_0x2d6d60(0x1fe)+_0x4f29d5['validCount']+'\x20valid')),_0x4f29d5['warningCount']>0x0&&console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x200)](_0x4f29d5[_0x2d6d60(0x211)]+_0x2d6d60(0x215))),0x1):(console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x1f0)]('✔\x20All\x20'+_0x4f29d5[_0x2d6d60(0x1fb)]+'\x20file(s)\x20valid')),_0x4f29d5[_0x2d6d60(0x211)]>0x0&&console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x200)](_0x4f29d5[_0x2d6d60(0x211)]+_0x2d6d60(0x215))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a46_0x58e6d9=a46_0x44cc;(function(_0x3a03cf,_0x115233){const _0x118076=a46_0x44cc,_0x3b152b=_0x3a03cf();while(!![]){try{const _0x5c6a0b=parseInt(_0x118076(0x194))/0x1*(parseInt(_0x118076(0x17d))/0x2)+-parseInt(_0x118076(0x199))/0x3+parseInt(_0x118076(0x181))/0x4+parseInt(_0x118076(0x16d))/0x5+parseInt(_0x118076(0x164))/0x6+-parseInt(_0x118076(0x189))/0x7*(parseInt(_0x118076(0x17c))/0x8)+parseInt(_0x118076(0x177))/0x9;if(_0x5c6a0b===_0x115233)break;else _0x3b152b['push'](_0x3b152b['shift']());}catch(_0x1da6ab){_0x3b152b['push'](_0x3b152b['shift']());}}}(a46_0x5ebe,0x8562c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a46_0x44cc(_0x4a6daa,_0x196c50){_0x4a6daa=_0x4a6daa-0x160;const _0x5ebe0a=a46_0x5ebe();let _0x44cc35=_0x5ebe0a[_0x4a6daa];return _0x44cc35;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0xfa7857 from'chalk';function a46_0x5ebe(){const _0x5be4a2=['List\x20folders\x20and\x20child\x20segments','replace','\x27...','1469652iQUmlT','map','format','cause','No\x20items\x20match\x20pattern:\x20','json','/e/','\x20segment','20902OvWPkK','folders','data','Error:\x20','recursive','children','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',',\x20and\x20','execute','error','Folder/pattern\x20arg:\x20','9831QYrgEC','Listing\x20folders,\x20segments,\x20and\x20journeys...','name','verbose','test','1816473PXNjnf','/app/ps/','listUnified','segments','journey','Building\x20hierarchy\x20tree...','listWithPattern','filter','listUnifiedWithJourneys','Parent\x20ID:\x20','✔\x20Built\x20tree\x20with\x20','type','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeys','sort','\x5c$&','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20journey','Resolving\x20path\x20\x27','Folder\x20ID:\x20','length','site','Parent\x20segment\x20context:\x20','folder','includes','533520fzTUTg','folderId','log','description','(not\x20set)','jsonl','\x20matching\x20\x27','Site:\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.','1113355ATIGVr','maxDepth','listRecursive','journeyBundleName','localeCompare','(empty)','\x20folder','dim','Resolving\x20parent\x20segment\x20\x27','parentId','8065368QMDRBZ','\x20\x20Cause:\x20','segment','✔\x20Found\x20','resolvePathToResource','2056scugYS','70znzExr'];a46_0x5ebe=function(){return _0x5be4a2;};return a46_0x5ebe();}export class SegmentsCommand extends BaseCommand{[a46_0x58e6d9(0x196)]='segments';[a46_0x58e6d9(0x167)]=a46_0x58e6d9(0x17e);async[a46_0x58e6d9(0x191)](_0x1b6c19){const _0x5ec90f=a46_0x58e6d9,{options:_0x406aad,args:_0x588d39}=_0x1b6c19,_0x3c2748=_0x406aad[_0x5ec90f(0x18d)],_0x33cb6a=_0x588d39[0x0];try{const _0x58333b=_0x406aad['parentSegment'];_0x406aad['verbose']&&(console[_0x5ec90f(0x192)](_0x5ec90f(0x16b)+_0x406aad['site']),console[_0x5ec90f(0x192)](_0x5ec90f(0x161)+(_0x58333b||_0x5ec90f(0x168))),_0x33cb6a&&console[_0x5ec90f(0x192)](_0x5ec90f(0x193)+_0x33cb6a),_0x3c2748&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x58333b)return console[_0x5ec90f(0x192)](_0x5ec90f(0x16c)),console[_0x5ec90f(0x192)](''),console[_0x5ec90f(0x192)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console['error'](_0x5ec90f(0x18f)),console['error'](_0x5ec90f(0x1a9)),console[_0x5ec90f(0x192)](''),console[_0x5ec90f(0x192)](_0x5ec90f(0x1a5)),0x1;const _0x63ba05=_0x33cb6a&&(_0x33cb6a[_0x5ec90f(0x163)]('*')||_0x33cb6a[_0x5ec90f(0x163)]('?'));if(_0x63ba05)return await this[_0x5ec90f(0x19f)](_0x1b6c19,_0x58333b,_0x33cb6a);const _0x18dfce=_0x33cb6a?_0x58333b+'/'+_0x33cb6a:_0x58333b;return _0x3c2748?await this[_0x5ec90f(0x16f)](_0x1b6c19,_0x18dfce):await this['listUnified'](_0x1b6c19,_0x18dfce);}catch(_0x46db58){if(_0x46db58 instanceof SDKError)return console[_0x5ec90f(0x192)](_0x5ec90f(0x18c)+_0x46db58['message']),_0x46db58[_0x5ec90f(0x184)]&&console[_0x5ec90f(0x192)](_0x5ec90f(0x178)+_0x46db58[_0x5ec90f(0x184)]),0x1;throw _0x46db58;}}async[a46_0x58e6d9(0x19f)](_0x4f3d54,_0x4a7b4e,_0x445bd2){const _0x3bd965=a46_0x58e6d9,{options:_0x75ef7c,tdx:_0x48c66b}=_0x4f3d54,_0x347424=await withSpinner(_0x3bd965(0x175)+_0x4a7b4e+'\x27...',()=>_0x48c66b[_0x3bd965(0x179)][_0x3bd965(0x17b)](_0x4a7b4e),{'verbose':_0x75ef7c[_0x3bd965(0x197)]}),_0x8d7db9=_0x347424[_0x3bd965(0x18b)],_0x87e014=await withSpinner(_0x3bd965(0x195),()=>_0x48c66b['segment'][_0x3bd965(0x1a1)](_0x8d7db9[_0x3bd965(0x176)],_0x8d7db9[_0x3bd965(0x165)]),{'verbose':_0x75ef7c[_0x3bd965(0x197)]}),{folders:_0x4e3305,segments:_0x573d2c,journeys:_0x87a375}=_0x87e014[_0x3bd965(0x18b)],_0x590be3=_0x445bd2[_0x3bd965(0x17f)](/[.+^${}()|[\]\\]/g,_0x3bd965(0x1a8))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x37f724=new RegExp('^'+_0x590be3+'$','i'),_0x360538=_0x4e3305['filter'](_0xdd9ab7=>_0x37f724['test'](_0xdd9ab7[_0x3bd965(0x196)])),_0x40cfd3=_0x573d2c[_0x3bd965(0x1a0)](_0x556b46=>_0x37f724[_0x3bd965(0x198)](_0x556b46['name'])),_0x4ca3c6=_0x87a375[_0x3bd965(0x1a0)](_0x10c24d=>_0x37f724[_0x3bd965(0x198)](_0x10c24d[_0x3bd965(0x170)])),_0x46185c=_0x360538[_0x3bd965(0x1ad)]+_0x40cfd3[_0x3bd965(0x1ad)]+_0x4ca3c6[_0x3bd965(0x1ad)];console['error']('✔\x20Found\x20'+_0x360538[_0x3bd965(0x1ad)]+_0x3bd965(0x173)+(_0x360538[_0x3bd965(0x1ad)]!==0x1?'s':'')+',\x20'+_0x40cfd3[_0x3bd965(0x1ad)]+_0x3bd965(0x188)+(_0x40cfd3[_0x3bd965(0x1ad)]!==0x1?'s':'')+_0x3bd965(0x190)+_0x4ca3c6[_0x3bd965(0x1ad)]+_0x3bd965(0x1aa)+(_0x4ca3c6[_0x3bd965(0x1ad)]!==0x1?'s':'')+_0x3bd965(0x16a)+_0x445bd2+'\x27');const _0x1043c3=_0x18b1f1=>{const _0x55f323=_0x3bd965;return getConsoleNextUrl(_0x75ef7c[_0x55f323(0x160)],'/app/ps/'+_0x8d7db9[_0x55f323(0x176)]+_0x55f323(0x187)+_0x18b1f1);},_0x2ec641=_0x75ef7c[_0x3bd965(0x183)]===_0x3bd965(0x186)||_0x75ef7c['format']==='jsonl';if(_0x2ec641){const _0x10bc21=[..._0x360538['map'](_0x38b1a8=>({..._0x38b1a8,'type':'folder'})),..._0x40cfd3[_0x3bd965(0x182)](_0x122104=>({..._0x122104,'type':_0x3bd965(0x179),'url':_0x1043c3(_0x122104['id'])})),..._0x4ca3c6[_0x3bd965(0x182)](_0x643b3f=>({..._0x643b3f,'name':_0x643b3f['journeyBundleName'],'type':'journey'}))][_0x3bd965(0x1a7)]((_0x32f5d2,_0x43cd6e)=>_0x32f5d2[_0x3bd965(0x196)][_0x3bd965(0x171)](_0x43cd6e[_0x3bd965(0x196)]));await handleSDKOutput(_0x10bc21,_0x75ef7c);}else{if(_0x46185c===0x0)console[_0x3bd965(0x166)](_0x3bd965(0x185)+_0x445bd2);else{console[_0x3bd965(0x166)](a46_0xfa7857[_0x3bd965(0x174)]('['+_0x4a7b4e+']\x20matching\x20\x27'+_0x445bd2+'\x27'));const _0x260fc7=formatFlatList(_0x360538,_0x40cfd3,{'showMetadata':!![],'getSegmentUrl':_0x1043c3},_0x4ca3c6);console[_0x3bd965(0x166)](_0x260fc7);}}return 0x0;}async[a46_0x58e6d9(0x19b)](_0x3d976b,_0x4bdd45){const _0x38def7=a46_0x58e6d9,{options:_0x3a78d1,tdx:_0x431033}=_0x3d976b,_0x30907c=await withSpinner(_0x38def7(0x1ab)+_0x4bdd45+'\x27...',()=>_0x431033['segment']['resolvePathToResource'](_0x4bdd45),{'verbose':_0x3a78d1[_0x38def7(0x197)]}),_0x202470=_0x30907c['data'];_0x3a78d1['verbose']&&(console[_0x38def7(0x192)](_0x38def7(0x1a2)+_0x202470['parentId']),_0x202470[_0x38def7(0x165)]&&console[_0x38def7(0x192)]('Folder\x20ID:\x20'+_0x202470[_0x38def7(0x165)]));const _0x4911fb=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x431033[_0x38def7(0x179)][_0x38def7(0x1a1)](_0x202470['parentId'],_0x202470[_0x38def7(0x165)]),{'verbose':_0x3a78d1[_0x38def7(0x197)]}),{folders:_0x530efd,segments:_0x8cd5b8,journeys:_0x33b1c2}=_0x4911fb['data'],_0x1c2845=_0x530efd['length']+_0x8cd5b8[_0x38def7(0x1ad)]+_0x33b1c2[_0x38def7(0x1ad)];console[_0x38def7(0x192)](_0x38def7(0x17a)+_0x530efd[_0x38def7(0x1ad)]+'\x20folder'+(_0x530efd['length']!==0x1?'s':'')+',\x20'+_0x8cd5b8[_0x38def7(0x1ad)]+_0x38def7(0x188)+(_0x8cd5b8[_0x38def7(0x1ad)]!==0x1?'s':'')+_0x38def7(0x190)+_0x33b1c2[_0x38def7(0x1ad)]+_0x38def7(0x1aa)+(_0x33b1c2[_0x38def7(0x1ad)]!==0x1?'s':''));const _0x3e4966=_0x250c24=>{const _0x4e4811=_0x38def7;return getConsoleNextUrl(_0x3a78d1[_0x4e4811(0x160)],'/app/ps/'+_0x202470['parentId']+_0x4e4811(0x187)+_0x250c24);},_0x3aa4c0=_0x1f6227=>{const _0x1231ca=_0x38def7;return getConsoleNextUrl(_0x3a78d1[_0x1231ca(0x160)],'/app/ps/'+_0x202470[_0x1231ca(0x176)]+_0x1231ca(0x187)+_0x1f6227+'/j/da');},_0x5c5067=_0x3a78d1[_0x38def7(0x183)]==='json'||_0x3a78d1[_0x38def7(0x183)]===_0x38def7(0x169);if(_0x5c5067){const _0x3a98fa=[..._0x530efd[_0x38def7(0x182)](_0x15d301=>({..._0x15d301,'type':_0x38def7(0x162)})),..._0x8cd5b8[_0x38def7(0x182)](_0xdc8024=>({..._0xdc8024,'type':_0x38def7(0x179),'url':_0x3e4966(_0xdc8024['id'])})),..._0x33b1c2[_0x38def7(0x182)](_0x3e457a=>({..._0x3e457a,'name':_0x3e457a[_0x38def7(0x170)],'type':_0x38def7(0x19d),'url':_0x3aa4c0(_0x3e457a['id'])}))][_0x38def7(0x1a7)]((_0x127201,_0x404f89)=>_0x127201[_0x38def7(0x196)]['localeCompare'](_0x404f89['name']));await handleSDKOutput(_0x3a98fa,_0x3a78d1);}else{if(_0x1c2845===0x0)console[_0x38def7(0x166)](a46_0xfa7857[_0x38def7(0x174)]('['+_0x4bdd45+']')),console[_0x38def7(0x166)](_0x38def7(0x172));else{console[_0x38def7(0x166)](a46_0xfa7857['dim']('['+_0x4bdd45+']'));const _0x4af071=formatFlatList(_0x530efd,_0x8cd5b8,{'showMetadata':!![],'getSegmentUrl':_0x3e4966,'getJourneyUrl':_0x3aa4c0},_0x33b1c2);console[_0x38def7(0x166)](_0x4af071);}}return 0x0;}async[a46_0x58e6d9(0x16f)](_0x567076,_0x2bd6fb){const _0x11ce76=a46_0x58e6d9,{options:_0x4fe93c,tdx:_0x46db13}=_0x567076,_0x197ba9=await withSpinner('Resolving\x20path\x20\x27'+_0x2bd6fb+_0x11ce76(0x180),()=>_0x46db13['segment'][_0x11ce76(0x17b)](_0x2bd6fb),{'verbose':_0x4fe93c['verbose']}),_0x16029e=_0x197ba9[_0x11ce76(0x18b)];_0x4fe93c[_0x11ce76(0x197)]&&(console[_0x11ce76(0x192)](_0x11ce76(0x1a2)+_0x16029e[_0x11ce76(0x176)]),_0x16029e[_0x11ce76(0x165)]&&console[_0x11ce76(0x192)](_0x11ce76(0x1ac)+_0x16029e[_0x11ce76(0x165)]));const _0x56ddfe=_0x4fe93c[_0x11ce76(0x16e)]||0xa,_0x547db1=await withSpinner(_0x11ce76(0x19e),()=>_0x46db13[_0x11ce76(0x179)][_0x11ce76(0x16f)](_0x16029e[_0x11ce76(0x176)],_0x16029e[_0x11ce76(0x165)],0x0,_0x56ddfe),{'verbose':_0x4fe93c[_0x11ce76(0x197)]}),_0x5d3c0e=_0x547db1['data'],_0x3dc98b=_0x30bb79=>{const _0x4cf4d4=_0x11ce76;let _0x42969b=0x0,_0x19313a=0x0,_0x5f4d87=0x0;for(const _0x76976e of _0x30bb79){if(_0x76976e[_0x4cf4d4(0x1a4)]===_0x4cf4d4(0x162))_0x42969b++;else{if(_0x76976e[_0x4cf4d4(0x1a4)]==='segment')_0x19313a++;else{if(_0x76976e[_0x4cf4d4(0x1a4)]===_0x4cf4d4(0x19d))_0x5f4d87++;}}if(_0x76976e[_0x4cf4d4(0x18e)]){const _0x240af7=_0x3dc98b(_0x76976e['children']);_0x42969b+=_0x240af7[_0x4cf4d4(0x18a)],_0x19313a+=_0x240af7[_0x4cf4d4(0x19c)],_0x5f4d87+=_0x240af7[_0x4cf4d4(0x1a6)];}}return{'folders':_0x42969b,'segments':_0x19313a,'journeys':_0x5f4d87};},_0x3e0b33=_0x3dc98b(_0x5d3c0e);console[_0x11ce76(0x192)](_0x11ce76(0x1a3)+_0x3e0b33['folders']+'\x20folder'+(_0x3e0b33['folders']!==0x1?'s':'')+',\x20'+_0x3e0b33[_0x11ce76(0x19c)]+_0x11ce76(0x188)+(_0x3e0b33['segments']!==0x1?'s':'')+_0x11ce76(0x190)+_0x3e0b33[_0x11ce76(0x1a6)]+_0x11ce76(0x1aa)+(_0x3e0b33[_0x11ce76(0x1a6)]!==0x1?'s':''));const _0x15b8b1=_0x1704fe=>{const _0x5c8133=_0x11ce76;return getConsoleNextUrl(_0x4fe93c[_0x5c8133(0x160)],'/app/ps/'+_0x16029e[_0x5c8133(0x176)]+_0x5c8133(0x187)+_0x1704fe);},_0x5dcebf=_0x360f7c=>{const _0x3f8e87=_0x11ce76;return getConsoleNextUrl(_0x4fe93c[_0x3f8e87(0x160)],_0x3f8e87(0x19a)+_0x16029e[_0x3f8e87(0x176)]+'/e/'+_0x360f7c+'/j/da');};if(_0x4fe93c[_0x11ce76(0x183)]==='json'||_0x4fe93c[_0x11ce76(0x183)]===_0x11ce76(0x169))await handleSDKOutput(_0x5d3c0e,_0x4fe93c);else{console['log'](a46_0xfa7857[_0x11ce76(0x174)]('['+_0x2bd6fb+']'));const _0xc0c7d0=formatTree(_0x5d3c0e,{'showMetadata':!![],'getSegmentUrl':_0x15b8b1,'getJourneyUrl':_0x5dcebf});console['log'](_0xc0c7d0);}return 0x0;}}
|
|
1
|
+
function a46_0x5f11(_0x2dc8dc,_0x18c7c6){_0x2dc8dc=_0x2dc8dc-0x1e8;const _0x4fc5a6=a46_0x4fc5();let _0x5f117c=_0x4fc5a6[_0x2dc8dc];return _0x5f117c;}const a46_0xac0d27=a46_0x5f11;(function(_0x2fbc21,_0x1e7981){const _0x1b23a3=a46_0x5f11,_0x38613a=_0x2fbc21();while(!![]){try{const _0x23a889=parseInt(_0x1b23a3(0x22f))/0x1+parseInt(_0x1b23a3(0x22d))/0x2+-parseInt(_0x1b23a3(0x215))/0x3*(-parseInt(_0x1b23a3(0x1f3))/0x4)+-parseInt(_0x1b23a3(0x1ea))/0x5*(-parseInt(_0x1b23a3(0x1ef))/0x6)+parseInt(_0x1b23a3(0x208))/0x7*(parseInt(_0x1b23a3(0x211))/0x8)+-parseInt(_0x1b23a3(0x214))/0x9*(parseInt(_0x1b23a3(0x21f))/0xa)+parseInt(_0x1b23a3(0x1f2))/0xb*(-parseInt(_0x1b23a3(0x228))/0xc);if(_0x23a889===_0x1e7981)break;else _0x38613a['push'](_0x38613a['shift']());}catch(_0x2778bb){_0x38613a['push'](_0x38613a['shift']());}}}(a46_0x4fc5,0x8302a));function a46_0x4fc5(){const _0x528951=['Folder\x20ID:\x20','/app/ps/','380008dtczrZ','test','jsonl','8078418BqMPqv','183KrQZFG','filter','includes','format','replace','children','cause','folder','folders','description','10BiJDsQ','\x20journey','(not\x20set)','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Parent\x20segment\x20context:\x20','journeyBundleName','segment','List\x20folders\x20and\x20child\x20segments','listWithPattern','6545712doogYl','parentId','Building\x20hierarchy\x20tree...','name','site','775804PZaKua','/e/','457083aSYnmm','journey','parentSegment','\x20segment','\x27...','resolvePathToResource','380500wICgqX','\x20matching\x20\x27','error','journeys','listUnified','60wKtNwt','Listing\x20folders,\x20segments,\x20and\x20journeys...','listUnifiedWithJourneys','11EmonQK','18276SIVDxo','Parent\x20ID:\x20','log',',\x20and\x20','Resolving\x20path\x20\x27','Resolving\x20parent\x20segment\x20\x27','folderId','listRecursive','Site:\x20','Recursive\x20mode:\x20enabled','✔\x20Found\x20','/j/da','verbose','dim','localeCompare','maxDepth','\x20folder','Set\x20a\x20parent\x20segment\x20context\x20first:','sort','json','data','14grkOok','✔\x20Built\x20tree\x20with\x20','recursive','map','length','type','segments'];a46_0x4fc5=function(){return _0x528951;};return a46_0x4fc5();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x16a33d from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0xac0d27(0x22b)]=a46_0xac0d27(0x20e);[a46_0xac0d27(0x21e)]=a46_0xac0d27(0x226);async['execute'](_0x369d7e){const _0x52766e=a46_0xac0d27,{options:_0x42427a,args:_0x55d9d5}=_0x369d7e,_0x40d508=_0x42427a[_0x52766e(0x20a)],_0x5ab38d=_0x55d9d5[0x0];try{const _0x52e539=_0x42427a[_0x52766e(0x231)];_0x42427a[_0x52766e(0x1ff)]&&(console['error'](_0x52766e(0x1fb)+_0x42427a[_0x52766e(0x22c)]),console[_0x52766e(0x1ec)](_0x52766e(0x223)+(_0x52e539||_0x52766e(0x221))),_0x5ab38d&&console[_0x52766e(0x1ec)]('Folder/pattern\x20arg:\x20'+_0x5ab38d),_0x40d508&&console[_0x52766e(0x1ec)](_0x52766e(0x1fc)));if(!_0x52e539)return console[_0x52766e(0x1ec)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x52766e(0x1ec)](''),console[_0x52766e(0x1ec)](_0x52766e(0x204)),console['error']('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x52766e(0x1ec)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x52766e(0x1ec)](''),console[_0x52766e(0x1ec)](_0x52766e(0x222)),0x1;const _0x542ee1=_0x5ab38d&&(_0x5ab38d[_0x52766e(0x217)]('*')||_0x5ab38d[_0x52766e(0x217)]('?'));if(_0x542ee1)return await this[_0x52766e(0x227)](_0x369d7e,_0x52e539,_0x5ab38d);const _0x5a8c06=_0x5ab38d?_0x52e539+'/'+_0x5ab38d:_0x52e539;return _0x40d508?await this[_0x52766e(0x1fa)](_0x369d7e,_0x5a8c06):await this[_0x52766e(0x1ee)](_0x369d7e,_0x5a8c06);}catch(_0x32f40f){if(_0x32f40f instanceof SDKError)return console[_0x52766e(0x1ec)]('Error:\x20'+_0x32f40f['message']),_0x32f40f[_0x52766e(0x21b)]&&console[_0x52766e(0x1ec)]('\x20\x20Cause:\x20'+_0x32f40f[_0x52766e(0x21b)]),0x1;throw _0x32f40f;}}async[a46_0xac0d27(0x227)](_0x49bfc5,_0x3b6c22,_0x6e0318){const _0x8e93e1=a46_0xac0d27,{options:_0x1378c8,tdx:_0x29f500}=_0x49bfc5,_0x174025=await withSpinner(_0x8e93e1(0x1f8)+_0x3b6c22+_0x8e93e1(0x1e8),()=>_0x29f500['segment'][_0x8e93e1(0x1e9)](_0x3b6c22),{'verbose':_0x1378c8[_0x8e93e1(0x1ff)]}),_0x185752=_0x174025['data'],_0x4ebf1f=await withSpinner(_0x8e93e1(0x1f0),()=>_0x29f500[_0x8e93e1(0x225)]['listUnifiedWithJourneys'](_0x185752[_0x8e93e1(0x229)],_0x185752[_0x8e93e1(0x1f9)]),{'verbose':_0x1378c8['verbose']}),{folders:_0x238478,segments:_0x52a1e1,journeys:_0x1911be}=_0x4ebf1f[_0x8e93e1(0x207)],_0x3d3fd8=_0x6e0318[_0x8e93e1(0x219)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x8e93e1(0x219)](/\*/g,'.*')[_0x8e93e1(0x219)](/\?/g,'.'),_0x20e424=new RegExp('^'+_0x3d3fd8+'$','i'),_0x3aee5a=_0x238478[_0x8e93e1(0x216)](_0x13a576=>_0x20e424[_0x8e93e1(0x212)](_0x13a576['name'])),_0x2f99cd=_0x52a1e1[_0x8e93e1(0x216)](_0x5302b2=>_0x20e424[_0x8e93e1(0x212)](_0x5302b2[_0x8e93e1(0x22b)])),_0x13075d=_0x1911be[_0x8e93e1(0x216)](_0x156168=>_0x20e424[_0x8e93e1(0x212)](_0x156168[_0x8e93e1(0x224)])),_0x2d50a9=_0x3aee5a['length']+_0x2f99cd[_0x8e93e1(0x20c)]+_0x13075d['length'];console['error'](_0x8e93e1(0x1fd)+_0x3aee5a[_0x8e93e1(0x20c)]+_0x8e93e1(0x203)+(_0x3aee5a[_0x8e93e1(0x20c)]!==0x1?'s':'')+',\x20'+_0x2f99cd[_0x8e93e1(0x20c)]+_0x8e93e1(0x232)+(_0x2f99cd[_0x8e93e1(0x20c)]!==0x1?'s':'')+_0x8e93e1(0x1f6)+_0x13075d[_0x8e93e1(0x20c)]+_0x8e93e1(0x220)+(_0x13075d[_0x8e93e1(0x20c)]!==0x1?'s':'')+_0x8e93e1(0x1eb)+_0x6e0318+'\x27');const _0xf4eccc=_0x2b247c=>{const _0x197110=_0x8e93e1;return getConsoleNextUrl(_0x1378c8[_0x197110(0x22c)],'/app/ps/'+_0x185752[_0x197110(0x229)]+'/e/'+_0x2b247c);},_0x11fcb4=_0x1378c8[_0x8e93e1(0x218)]==='json'||_0x1378c8[_0x8e93e1(0x218)]===_0x8e93e1(0x213);if(_0x11fcb4){const _0x2a887c=[..._0x3aee5a[_0x8e93e1(0x20b)](_0x5998e2=>({..._0x5998e2,'type':'folder'})),..._0x2f99cd[_0x8e93e1(0x20b)](_0x3848a8=>({..._0x3848a8,'type':_0x8e93e1(0x225),'url':_0xf4eccc(_0x3848a8['id'])})),..._0x13075d[_0x8e93e1(0x20b)](_0x50a854=>({..._0x50a854,'name':_0x50a854[_0x8e93e1(0x224)],'type':_0x8e93e1(0x230)}))][_0x8e93e1(0x205)]((_0x2e9287,_0x4325a5)=>_0x2e9287[_0x8e93e1(0x22b)]['localeCompare'](_0x4325a5['name']));await handleSDKOutput(_0x2a887c,_0x1378c8);}else{if(_0x2d50a9===0x0)console['log']('No\x20items\x20match\x20pattern:\x20'+_0x6e0318);else{console['log'](a46_0x16a33d[_0x8e93e1(0x200)]('['+_0x3b6c22+']\x20matching\x20\x27'+_0x6e0318+'\x27'));const _0x4cb03f=formatFlatList(_0x3aee5a,_0x2f99cd,{'showMetadata':!![],'getSegmentUrl':_0xf4eccc},_0x13075d);console[_0x8e93e1(0x1f5)](_0x4cb03f);}}return 0x0;}async['listUnified'](_0x1efad3,_0x3cd10e){const _0x121a0c=a46_0xac0d27,{options:_0x947cb4,tdx:_0x237279}=_0x1efad3,_0x448f0f=await withSpinner(_0x121a0c(0x1f7)+_0x3cd10e+_0x121a0c(0x1e8),()=>_0x237279['segment'][_0x121a0c(0x1e9)](_0x3cd10e),{'verbose':_0x947cb4[_0x121a0c(0x1ff)]}),_0x383442=_0x448f0f['data'];_0x947cb4['verbose']&&(console['error'](_0x121a0c(0x1f4)+_0x383442[_0x121a0c(0x229)]),_0x383442[_0x121a0c(0x1f9)]&&console[_0x121a0c(0x1ec)](_0x121a0c(0x20f)+_0x383442[_0x121a0c(0x1f9)]));const _0x2b0e86=await withSpinner(_0x121a0c(0x1f0),()=>_0x237279[_0x121a0c(0x225)][_0x121a0c(0x1f1)](_0x383442[_0x121a0c(0x229)],_0x383442['folderId']),{'verbose':_0x947cb4[_0x121a0c(0x1ff)]}),{folders:_0x1280a6,segments:_0x12416c,journeys:_0x23985c}=_0x2b0e86['data'],_0x201449=_0x1280a6[_0x121a0c(0x20c)]+_0x12416c['length']+_0x23985c[_0x121a0c(0x20c)];console[_0x121a0c(0x1ec)](_0x121a0c(0x1fd)+_0x1280a6['length']+_0x121a0c(0x203)+(_0x1280a6['length']!==0x1?'s':'')+',\x20'+_0x12416c['length']+_0x121a0c(0x232)+(_0x12416c[_0x121a0c(0x20c)]!==0x1?'s':'')+_0x121a0c(0x1f6)+_0x23985c[_0x121a0c(0x20c)]+_0x121a0c(0x220)+(_0x23985c['length']!==0x1?'s':''));const _0x49582c=_0x1b4eb0=>{const _0x37d83f=_0x121a0c;return getConsoleNextUrl(_0x947cb4['site'],_0x37d83f(0x210)+_0x383442['parentId']+_0x37d83f(0x22e)+_0x1b4eb0);},_0xf6cca4=_0x5c2a7e=>{const _0x9119ff=_0x121a0c;return getConsoleNextUrl(_0x947cb4[_0x9119ff(0x22c)],_0x9119ff(0x210)+_0x383442[_0x9119ff(0x229)]+'/e/'+_0x5c2a7e+'/j/da');},_0x41d006=_0x947cb4[_0x121a0c(0x218)]===_0x121a0c(0x206)||_0x947cb4[_0x121a0c(0x218)]==='jsonl';if(_0x41d006){const _0x548bf2=[..._0x1280a6['map'](_0x4d9f77=>({..._0x4d9f77,'type':_0x121a0c(0x21c)})),..._0x12416c[_0x121a0c(0x20b)](_0x5da3b5=>({..._0x5da3b5,'type':_0x121a0c(0x225),'url':_0x49582c(_0x5da3b5['id'])})),..._0x23985c[_0x121a0c(0x20b)](_0x1f31e7=>({..._0x1f31e7,'name':_0x1f31e7[_0x121a0c(0x224)],'type':_0x121a0c(0x230),'url':_0xf6cca4(_0x1f31e7['id'])}))][_0x121a0c(0x205)]((_0x1735fe,_0x385c45)=>_0x1735fe[_0x121a0c(0x22b)][_0x121a0c(0x201)](_0x385c45[_0x121a0c(0x22b)]));await handleSDKOutput(_0x548bf2,_0x947cb4);}else{if(_0x201449===0x0)console['log'](a46_0x16a33d[_0x121a0c(0x200)]('['+_0x3cd10e+']')),console[_0x121a0c(0x1f5)]('(empty)');else{console[_0x121a0c(0x1f5)](a46_0x16a33d[_0x121a0c(0x200)]('['+_0x3cd10e+']'));const _0x38a648=formatFlatList(_0x1280a6,_0x12416c,{'showMetadata':!![],'getSegmentUrl':_0x49582c,'getJourneyUrl':_0xf6cca4},_0x23985c);console[_0x121a0c(0x1f5)](_0x38a648);}}return 0x0;}async[a46_0xac0d27(0x1fa)](_0x4e2474,_0x2713b2){const _0x177b7d=a46_0xac0d27,{options:_0x4e4058,tdx:_0x49f9ed}=_0x4e2474,_0x38cd0a=await withSpinner(_0x177b7d(0x1f7)+_0x2713b2+_0x177b7d(0x1e8),()=>_0x49f9ed['segment'][_0x177b7d(0x1e9)](_0x2713b2),{'verbose':_0x4e4058[_0x177b7d(0x1ff)]}),_0x59c002=_0x38cd0a[_0x177b7d(0x207)];_0x4e4058[_0x177b7d(0x1ff)]&&(console[_0x177b7d(0x1ec)](_0x177b7d(0x1f4)+_0x59c002[_0x177b7d(0x229)]),_0x59c002[_0x177b7d(0x1f9)]&&console[_0x177b7d(0x1ec)](_0x177b7d(0x20f)+_0x59c002['folderId']));const _0x5ce242=_0x4e4058[_0x177b7d(0x202)]||0xa,_0x522ded=await withSpinner(_0x177b7d(0x22a),()=>_0x49f9ed[_0x177b7d(0x225)][_0x177b7d(0x1fa)](_0x59c002[_0x177b7d(0x229)],_0x59c002['folderId'],0x0,_0x5ce242),{'verbose':_0x4e4058['verbose']}),_0x5d6c2b=_0x522ded['data'],_0x4b2a9c=_0x880f01=>{const _0x37a6bd=_0x177b7d;let _0x6da368=0x0,_0x1fa1de=0x0,_0x1212d5=0x0;for(const _0x44f1e1 of _0x880f01){if(_0x44f1e1['type']==='folder')_0x6da368++;else{if(_0x44f1e1[_0x37a6bd(0x20d)]===_0x37a6bd(0x225))_0x1fa1de++;else{if(_0x44f1e1[_0x37a6bd(0x20d)]===_0x37a6bd(0x230))_0x1212d5++;}}if(_0x44f1e1['children']){const _0x154fa5=_0x4b2a9c(_0x44f1e1[_0x37a6bd(0x21a)]);_0x6da368+=_0x154fa5[_0x37a6bd(0x21d)],_0x1fa1de+=_0x154fa5[_0x37a6bd(0x20e)],_0x1212d5+=_0x154fa5[_0x37a6bd(0x1ed)];}}return{'folders':_0x6da368,'segments':_0x1fa1de,'journeys':_0x1212d5};},_0x425b36=_0x4b2a9c(_0x5d6c2b);console['error'](_0x177b7d(0x209)+_0x425b36[_0x177b7d(0x21d)]+_0x177b7d(0x203)+(_0x425b36[_0x177b7d(0x21d)]!==0x1?'s':'')+',\x20'+_0x425b36['segments']+_0x177b7d(0x232)+(_0x425b36[_0x177b7d(0x20e)]!==0x1?'s':'')+_0x177b7d(0x1f6)+_0x425b36[_0x177b7d(0x1ed)]+_0x177b7d(0x220)+(_0x425b36['journeys']!==0x1?'s':''));const _0x18425f=_0x321cad=>{const _0x3dff3f=_0x177b7d;return getConsoleNextUrl(_0x4e4058[_0x3dff3f(0x22c)],_0x3dff3f(0x210)+_0x59c002['parentId']+_0x3dff3f(0x22e)+_0x321cad);},_0x1ffe55=_0x460561=>{const _0x8811f9=_0x177b7d;return getConsoleNextUrl(_0x4e4058[_0x8811f9(0x22c)],_0x8811f9(0x210)+_0x59c002['parentId']+_0x8811f9(0x22e)+_0x460561+_0x8811f9(0x1fe));};if(_0x4e4058['format']===_0x177b7d(0x206)||_0x4e4058[_0x177b7d(0x218)]===_0x177b7d(0x213))await handleSDKOutput(_0x5d6c2b,_0x4e4058);else{console[_0x177b7d(0x1f5)](a46_0x16a33d['dim']('['+_0x2713b2+']'));const _0x4d8ac9=formatTree(_0x5d6c2b,{'showMetadata':!![],'getSegmentUrl':_0x18425f,'getJourneyUrl':_0x1ffe55});console[_0x177b7d(0x1f5)](_0x4d8ac9);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x4e9408=a47_0xf397;function a47_0x1406(){const _0x127b11=['7864662UIUfOS','data','Database:\x20','description','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','3314995PVPAqj','Catalog:\x20','Table:\x20','3256974hSElRd','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','table','length','showTable','verbose','Querying\x20','catalog','execute','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','validate','message','Usage:\x20tdx\x20show\x20<database.table>','Show\x20table\x20contents','Limit:\x20','args','\x20\x20Cause:\x20','✔\x20Retrieved\x20','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','11SPyEHE','337155CrwZMi','185034hGqrrf','Error:\x20','28281488cHClgG','show','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','5300276CkWDFN','database','\x20row','query','error','name'];a47_0x1406=function(){return _0x127b11;};return a47_0x1406();}(function(_0x58443e,_0x3b4550){const _0x1644f3=a47_0xf397,_0x4843ad=_0x58443e();while(!![]){try{const _0x486817=-parseInt(_0x1644f3(0x1e0))/0x1*(parseInt(_0x1644f3(0x1e2))/0x2)+-parseInt(_0x1644f3(0x1cd))/0x3+-parseInt(_0x1644f3(0x1e7))/0x4+-parseInt(_0x1644f3(0x1ca))/0x5+parseInt(_0x1644f3(0x1ed))/0x6+parseInt(_0x1644f3(0x1e1))/0x7+parseInt(_0x1644f3(0x1e4))/0x8;if(_0x486817===_0x3b4550)break;else _0x4843ad['push'](_0x4843ad['shift']());}catch(_0x5bbc0f){_0x4843ad['push'](_0x4843ad['shift']());}}}(a47_0x1406,0xc3f9b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a47_0xf397(_0x326b10,_0x22f229){_0x326b10=_0x326b10-0x1c9;const _0x1406bf=a47_0x1406();let _0xf397c8=_0x1406bf[_0x326b10];return _0xf397c8;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a47_0x4e9408(0x1ec)]=a47_0x4e9408(0x1e5);[a47_0x4e9408(0x1f0)]=a47_0x4e9408(0x1da);async[a47_0x4e9408(0x1d5)](_0x3e7249){const _0x486a50=a47_0x4e9408;return this[_0x486a50(0x1d1)](_0x3e7249);}async[a47_0x4e9408(0x1d1)](_0xffbbd8){const _0x5eb6cf=a47_0x4e9408,{options:_0xb4a54e,args:_0x368773,tdx:_0x13cec6}=_0xffbbd8;let _0x35e6ce;try{_0x35e6ce=parseTableReference(_0x368773[0x0]);const _0x503000=_0xb4a54e[_0x5eb6cf(0x1e8)];!_0x35e6ce[_0x5eb6cf(0x1e8)]&&_0x503000&&(_0x35e6ce[_0x5eb6cf(0x1e8)]=_0x503000);const _0xb7205b=validateTableDescribeReference(_0x35e6ce);if(_0xb7205b)return console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1e3)+_0xb7205b),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1d9)),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1e6)),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1ce)),0x1;}catch(_0x5a87e5){return console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1e3)+_0x5a87e5[_0x5eb6cf(0x1d8)]),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1d9)),console[_0x5eb6cf(0x1eb)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1ce)),0x1;}const _0xb19c7f=_0x35e6ce[_0x5eb6cf(0x1d4)],_0x4351fe=_0x35e6ce[_0x5eb6cf(0x1e8)],_0x4bb41=_0x35e6ce[_0x5eb6cf(0x1cf)],_0xc98267=resolveLimit(_0xb4a54e['limit'],DEFAULT_DISPLAY_LIMIT);try{_0xb4a54e[_0x5eb6cf(0x1d2)]&&(console['error']('Site:\x20'+_0xb4a54e['site']),_0xb19c7f&&console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1cb)+_0xb19c7f),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1ef)+_0x4351fe),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1cc)+_0x4bb41),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1db)+_0xc98267));const _0x285019=_0xb19c7f?_0xb19c7f+'.'+_0x4351fe+'.'+_0x4bb41:_0x4351fe+'.'+_0x4bb41,_0x348bb2=await withSpinner(_0x5eb6cf(0x1d3)+_0x285019+'...',()=>_0x13cec6[_0x5eb6cf(0x1ea)]['showTable'](_0x4351fe,_0x4bb41,_0xc98267,_0xb19c7f),{'verbose':_0xb4a54e[_0x5eb6cf(0x1d2)]}),_0xc6212c=_0x348bb2['data'],_0x2f4546=_0xc6212c[_0x5eb6cf(0x1ee)];return _0x2f4546[_0x5eb6cf(0x1d0)]===0x0?console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1c9)):console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1de)+_0x2f4546[_0x5eb6cf(0x1d0)]+_0x5eb6cf(0x1e9)+(_0x2f4546[_0x5eb6cf(0x1d0)]!==0x1?'s':'')+'\x20from\x20'+_0x285019),await handleSDKOutput(_0x2f4546,_0xb4a54e),0x0;}catch(_0x42cbd5){if(_0x42cbd5 instanceof SDKError)return console[_0x5eb6cf(0x1eb)]('Error:\x20'+_0x42cbd5[_0x5eb6cf(0x1d8)]),_0x42cbd5['cause']&&console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1dd)+_0x42cbd5['cause']),0x1;throw _0x42cbd5;}}[a47_0x4e9408(0x1d7)](_0x2eb5be){const _0x46c8a1=a47_0x4e9408;if(_0x2eb5be[_0x46c8a1(0x1dc)][_0x46c8a1(0x1d0)]===0x0)return _0x46c8a1(0x1df);if(_0x2eb5be['args'][_0x46c8a1(0x1d0)]>0x1)return _0x46c8a1(0x1d6);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x4890c9=a48_0x24f1;(function(_0x3e0445,_0x188123){const _0x461ac1=a48_0x24f1,_0x107571=_0x3e0445();while(!![]){try{const _0xd6104a=parseInt(_0x461ac1(0x10d))/0x1*(-parseInt(_0x461ac1(0x12c))/0x2)+-parseInt(_0x461ac1(0x111))/0x3*(-parseInt(_0x461ac1(0x119))/0x4)+-parseInt(_0x461ac1(0x11f))/0x5+-parseInt(_0x461ac1(0x11b))/0x6*(-parseInt(_0x461ac1(0x117))/0x7)+parseInt(_0x461ac1(0x122))/0x8*(-parseInt(_0x461ac1(0x108))/0x9)+parseInt(_0x461ac1(0x126))/0xa*(-parseInt(_0x461ac1(0x115))/0xb)+-parseInt(_0x461ac1(0x125))/0xc;if(_0xd6104a===_0x188123)break;else _0x107571['push'](_0x107571['shift']());}catch(_0x38d30a){_0x107571['push'](_0x107571['shift']());}}}(a48_0x5097,0x801d2));import{BaseCommand,printAuthError}from'./command.js';function a48_0x5097(){const _0x25a006=['filter','join','yellow','3wONmeA','✗\x20Validation\x20failed:\x20','CLI\x20flag','cli','3564orrLqh','red','3215023pxzeIp','bold','3609652AmRCdu','(from\x20','12piFoDs','Name:','cyan','log','877935nImGDA','site','execute','1192qRTwcN','description','profile','9787248HtaZES','50FgwFnS','account_id','dim','User:','name','Credential\x20type:\x20','67174YWnPjN','getUserInfo','displayWithSources','jobs','email','site:\x20','No\x20credential\x20found','Account\x20ID:','error','green','first_name','env','\x20profile:\x20','Show\x20authentication\x20status\x20and\x20current\x20context','status','session','16299Ommalf','TDX_PROFILE\x20env','✓\x20Authentication\x20successful\x0a','last_name','config','1LGikbK'];a48_0x5097=function(){return _0x25a006;};return a48_0x5097();}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a48_0x24f1(_0x1851e1,_0x50be57){_0x1851e1=_0x1851e1-0x103;const _0x5097c3=a48_0x5097();let _0x24f197=_0x5097c3[_0x1851e1];return _0x24f197;}import{GlobalContext}from'../core/global-context.js';import a48_0x1b2b7e from'chalk';export class StatusCommand extends BaseCommand{[a48_0x4890c9(0x12a)]=a48_0x4890c9(0x106);[a48_0x4890c9(0x123)]=a48_0x4890c9(0x105);async[a48_0x4890c9(0x121)](_0x572901){const _0x528238=a48_0x4890c9,{options:_0x36b8d6,tdx:_0x48ac71}=_0x572901,_0x346d01=_0x36b8d6[_0x528238(0x120)],_0x419c16=new GlobalContext(_0x36b8d6),_0xa511c0=_0x419c16[_0x528238(0x124)],_0x30280f=_0x419c16['profileSource'],_0x4ce7f6=_0x30280f===_0x528238(0x114)?_0x528238(0x113):_0x30280f===_0x528238(0x107)?_0x528238(0x107):_0x30280f===_0x528238(0x103)?_0x528238(0x109):_0x30280f===_0x528238(0x10c)?_0x528238(0x10c):null,_0x4fc38d=_0xa511c0?a48_0x1b2b7e[_0x528238(0x11d)](_0xa511c0):a48_0x1b2b7e['dim']('N/A'),_0xe45b06=_0x4ce7f6?'\x20'+a48_0x1b2b7e[_0x528238(0x128)](_0x528238(0x11a)+_0x4ce7f6+')'):'';console['log'](a48_0x1b2b7e[_0x528238(0x118)]('tdx')+_0x528238(0x104)+_0x4fc38d+_0xe45b06+'\x20'+a48_0x1b2b7e[_0x528238(0x128)]('(')+_0x528238(0x131)+a48_0x1b2b7e[_0x528238(0x11d)](_0x346d01)+a48_0x1b2b7e[_0x528238(0x128)](')'));const _0x4defbd=await getOAuthTokens(_0xa511c0);if(_0x4defbd)console[_0x528238(0x11e)](_0x528238(0x12b)+a48_0x1b2b7e[_0x528238(0x11d)]('OAuth'));else{const _0x24faf5=await resolveAPIKeyAsync(_0x346d01,_0xa511c0);if(_0x24faf5){const {source:_0xeea9a9,isDeprecated:_0x1edf4d}=_0x24faf5,_0x5025a1='Read\x20credential\x20from\x20'+a48_0x1b2b7e[_0x528238(0x11d)](_0xeea9a9);console[_0x528238(0x11e)](_0x1edf4d?a48_0x1b2b7e[_0x528238(0x110)](_0x5025a1):_0x5025a1);}else console[_0x528238(0x11e)](a48_0x1b2b7e[_0x528238(0x110)](_0x528238(0x132)));}let _0x4c3d61=![];try{const _0x2e0500=await _0x48ac71[_0x528238(0x12f)][_0x528238(0x12d)]();console['log'](a48_0x1b2b7e[_0x528238(0x135)](_0x528238(0x10a))),console[_0x528238(0x11e)](a48_0x1b2b7e['bold'](_0x528238(0x129))+'\x20'+a48_0x1b2b7e['cyan'](_0x2e0500[_0x528238(0x130)]));if(_0x2e0500[_0x528238(0x136)]||_0x2e0500['last_name']){const _0x5931a2=[_0x2e0500[_0x528238(0x136)],_0x2e0500[_0x528238(0x10b)]][_0x528238(0x10e)](Boolean)[_0x528238(0x10f)]('\x20');console[_0x528238(0x11e)](a48_0x1b2b7e['bold'](_0x528238(0x11c))+'\x20'+_0x5931a2);}_0x2e0500[_0x528238(0x127)]&&console['log'](a48_0x1b2b7e[_0x528238(0x118)](_0x528238(0x133))+'\x20'+a48_0x1b2b7e['yellow'](_0x2e0500['account_id'])),_0x4c3d61=!![];}catch(_0x43d612){_0x43d612 instanceof HTTPClientError&&_0x43d612[_0x528238(0x106)]===0x191?printAuthError(_0x43d612,!![],_0xa511c0):console[_0x528238(0x134)](a48_0x1b2b7e[_0x528238(0x116)](_0x528238(0x112)+(_0x43d612 instanceof Error?_0x43d612['message']:String(_0x43d612))));}return console[_0x528238(0x11e)](),_0x419c16[_0x528238(0x12e)](),_0x4c3d61?0x0:0x1;}}
|