@treasuredata/tdx 0.20.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -13
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +0 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +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/unset-command.js.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.d.ts +13 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +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-run.js.map +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.d.ts.map +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/mcp/utils.js.map +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/api.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/api.js.map +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.d.ts +45 -2
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +1 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.d.ts +18 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +4 -4
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/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/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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 +3 -2
- package/dist/commands/llm-proxy.d.ts +0 -25
- package/dist/commands/llm-proxy.d.ts.map +0 -1
- package/dist/commands/llm-proxy.js +0 -1
- package/dist/commands/llm-proxy.js.map +0 -1
- package/dist/proxy/anthropic-adapter.d.ts +0 -125
- package/dist/proxy/anthropic-adapter.d.ts.map +0 -1
- package/dist/proxy/anthropic-adapter.js +0 -1
- package/dist/proxy/anthropic-adapter.js.map +0 -1
- package/dist/proxy/context-signature.d.ts +0 -17
- package/dist/proxy/context-signature.d.ts.map +0 -1
- package/dist/proxy/context-signature.js +0 -1
- package/dist/proxy/context-signature.js.map +0 -1
- package/dist/proxy/conversation-utils.d.ts +0 -48
- package/dist/proxy/conversation-utils.d.ts.map +0 -1
- package/dist/proxy/conversation-utils.js +0 -1
- package/dist/proxy/conversation-utils.js.map +0 -1
- package/dist/proxy/server.d.ts +0 -76
- package/dist/proxy/server.d.ts.map +0 -1
- package/dist/proxy/server.js +0 -1
- package/dist/proxy/server.js.map +0 -1
- package/dist/proxy/session-cache.d.ts +0 -74
- package/dist/proxy/session-cache.d.ts.map +0 -1
- package/dist/proxy/session-cache.js +0 -1
- package/dist/proxy/session-cache.js.map +0 -1
- package/dist/sdk/llm/model-aliases.d.ts +0 -40
- package/dist/sdk/llm/model-aliases.d.ts.map +0 -1
- package/dist/sdk/llm/model-aliases.js +0 -1
- package/dist/sdk/llm/model-aliases.js.map +0 -1
- package/dist/sdk/types/anthropic.d.ts +0 -148
- package/dist/sdk/types/anthropic.d.ts.map +0 -1
- package/dist/sdk/types/anthropic.js +0 -1
- package/dist/sdk/types/anthropic.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0x6736a8=a30_0x28fc;(function(_0x10401d,_0x2ba36e){const _0x2980f6=a30_0x28fc,_0x258af1=_0x10401d();while(!![]){try{const _0x19b3d6=-parseInt(_0x2980f6(0xdb))/0x1+-parseInt(_0x2980f6(0xbd))/0x2*(-parseInt(_0x2980f6(0xd5))/0x3)+-parseInt(_0x2980f6(0xed))/0x4+parseInt(_0x2980f6(0xd7))/0x5*(-parseInt(_0x2980f6(0xe9))/0x6)+parseInt(_0x2980f6(0xce))/0x7+-parseInt(_0x2980f6(0xcb))/0x8+parseInt(_0x2980f6(0xec))/0x9;if(_0x19b3d6===_0x2ba36e)break;else _0x258af1['push'](_0x258af1['shift']());}catch(_0x147003){_0x258af1['push'](_0x258af1['shift']());}}}(a30_0x4df3,0x37034));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 a30_0x159112 from'chalk';function a30_0x28fc(_0x5cf42c,_0x270a85){_0x5cf42c=_0x5cf42c-0xb2;const _0x4df323=a30_0x4df3();let _0x28fc13=_0x4df323[_0x5cf42c];return _0x28fc13;}import{existsSync,mkdirSync,writeFileSync}from'fs';function a30_0x4df3(){const _0x18358a=['1049419jqwxLt','dryRun','yellow','\x20files\x20to\x20','\x20files?','\x20=\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3lvzjhI','isNew','210XFIiJN','no_parent','verbose','data','287844feEHFo','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','pullSegments','Site:\x20','parent_segment','files','diff','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Write\x20','errorCode','activations','dirname','type','hasChanges','14454KhqBHj','helpText','parentName','5553819pfQTnn','1381396PpsXRo','relativePath','counts','dim','green','\x20versions)','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)','session','Pulling\x20segments\x20from\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','yes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20unchanged\x20files','error','utf-8','-\x20no\x20files\x20written','setPhase','\x20changed\x20files','\x0aPull\x20summary\x20for\x20\x27','\x20activations','segment:pull','absolutePath','journeyVersions','\x27...','\x20\x20Target:\x20','Error:\x20','segments','732098NxrSwy','cyan','length','cwd','\x20segments','Parent\x20segment:\x20','red','content','\x20\x20🗺️\x20\x20','targetDir','filter','\x20\x20🎯\x20','Aborted.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1386832wLChzN','\x0aChanges\x20to\x20\x27','journeys'];a30_0x4df3=function(){return _0x18358a;};return a30_0x4df3();}import a30_0xe82c4f from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a30_0x6736a8(0xb6);['description']=a30_0x6736a8(0xdc);async['execute'](_0x1ed4c6){const _0x322e65=a30_0x6736a8,{options:_0x3217ba,args:_0x45d041,tdx:_0x5430f7}=_0x1ed4c6,_0x54464c=_0x3217ba,_0x4e6536=await resolveTarget({'arg':_0x45d041[0x0],'contextParent':_0x3217ba['parentSegment'],'cwd':process[_0x322e65(0xc0)]()});if(!isSuccessfulResolution(_0x4e6536))return _0x4e6536[_0x322e65(0xe4)]===_0x322e65(0xd8)?(console['error'](a30_0x159112[_0x322e65(0xd0)](_0x322e65(0xca))),console[_0x322e65(0xfa)](_0x322e65(0xf3)),console[_0x322e65(0xfa)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console['error'](_0x322e65(0xe2))):(console[_0x322e65(0xfa)](a30_0x159112['red'](_0x322e65(0xbb)+_0x4e6536['message']+'\x0a')),_0x4e6536[_0x322e65(0xea)]&&console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xbe)](_0x4e6536[_0x322e65(0xea)]))),0x1;const _0x3df703=_0x4e6536[_0x322e65(0xeb)],_0x2acefb=_0x4e6536[_0x322e65(0xc6)],_0x545687=_0x4e6536[_0x322e65(0xe7)]==='file'?_0x4e6536['resourceName']:undefined;_0x54464c[_0x322e65(0xd9)]&&(console[_0x322e65(0xfa)](_0x322e65(0xde)+_0x54464c['site']),console[_0x322e65(0xfa)](_0x322e65(0xc2)+_0x3df703),_0x545687&&console[_0x322e65(0xfa)]('Target\x20resource:\x20'+_0x545687));const _0x3f1255=await withProgressSpinner(_0x322e65(0xf5)+_0x3df703+_0x322e65(0xb9),_0x3081f0=>_0x5430f7['segment'][_0x322e65(0xdd)](_0x3df703,{'targetDir':_0x2acefb,'targetResourceName':_0x545687,'verbose':_0x54464c[_0x322e65(0xd9)],'progress':{'update':_0xd10783=>{const _0x62e88b=_0x322e65;_0x3081f0[_0x62e88b(0xb2)](_0xd10783),_0x54464c[_0x62e88b(0xd9)]&&console[_0x62e88b(0xfa)]('\x20\x20'+_0xd10783);}}}),{'verbose':_0x54464c[_0x322e65(0xd9)]}),_0x4a954b=_0x3f1255[_0x322e65(0xda)];if(_0x4a954b['counts'][_0x322e65(0xbc)]===0x0&&_0x4a954b['counts'][_0x322e65(0xcd)]===0x0)return console['error'](a30_0x159112[_0x322e65(0xd0)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x4a954b['parentName']+'\x27')),0x0;const _0x54689e=_0x4a954b['files']['filter'](_0x5ea6ab=>_0x5ea6ab[_0x322e65(0xd6)]),_0x4d79d0=_0x4a954b[_0x322e65(0xe0)][_0x322e65(0xc7)](_0x43d496=>!_0x43d496[_0x322e65(0xd6)]&&_0x43d496['hasChanges']),_0x40a6f5=_0x4a954b[_0x322e65(0xe0)][_0x322e65(0xc7)](_0x57a9f0=>!_0x57a9f0[_0x322e65(0xd6)]&&!_0x57a9f0['hasChanges']);console[_0x322e65(0xfa)](_0x322e65(0xb4)+_0x4a954b[_0x322e65(0xeb)]+'\x27:'),console[_0x322e65(0xfa)](_0x322e65(0xc8)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xef)][_0x322e65(0xbc)]+_0x322e65(0xc1))+'\x20with\x20'+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xef)][_0x322e65(0xe5)]+_0x322e65(0xb5)));if(_0x4a954b['counts']['journeys']>0x0){const _0x51a3e4=_0x4a954b[_0x322e65(0xef)][_0x322e65(0xb8)]>_0x4a954b['counts'][_0x322e65(0xcd)]?'\x20('+_0x4a954b[_0x322e65(0xef)]['journeyVersions']+_0x322e65(0xf2):'';console[_0x322e65(0xfa)](_0x322e65(0xc5)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b['counts'][_0x322e65(0xcd)]+'\x20journeys')+a30_0x159112[_0x322e65(0xf0)](_0x51a3e4));}console['error']('\x20\x20'+a30_0x159112['green']('+\x20'+_0x54689e[_0x322e65(0xbf)]+'\x20new\x20files')),console['error']('\x20\x20'+a30_0x159112[_0x322e65(0xd0)]('~\x20'+_0x4d79d0['length']+_0x322e65(0xb3))),console[_0x322e65(0xfa)]('\x20\x20'+a30_0x159112['dim']('=\x20'+_0x40a6f5['length']+_0x322e65(0xf9))),console[_0x322e65(0xfa)](_0x322e65(0xba)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b['targetDir'])+'\x0a');if(_0x4d79d0['length']>0x0)for(const _0x10553b of _0x4d79d0){console['error'](_0x322e65(0xcc)+_0x10553b[_0x322e65(0xee)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x10553b[_0x322e65(0xe1)]),console['error']('─'['repeat'](0x3c));}if(_0x54464c[_0x322e65(0xcf)])return console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xd0)](_0x322e65(0xd4))),0x0;if(_0x54689e[_0x322e65(0xbf)]===0x0&&_0x4d79d0[_0x322e65(0xbf)]===0x0)return console['error'](a30_0x159112[_0x322e65(0xf1)](_0x322e65(0xf6))),saveSessionContext({'parent_segment':_0x4a954b['parentName']},_0x54464c[_0x322e65(0xf4)]),console['error'](a30_0x159112[_0x322e65(0xf1)]('✔\x20Context\x20set:\x20'+a30_0x159112[_0x322e65(0xf0)](_0x322e65(0xdf))+_0x322e65(0xd3)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xeb)]))),0x0;if(!_0x54464c[_0x322e65(0xf7)]){if(!isInteractive())return console['error'](a30_0x159112[_0x322e65(0xc3)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a30_0x159112['dim'](_0x322e65(0xf8))),0x1;const _0x322ab7=await confirmKey(_0x322e65(0xe3)+(_0x54689e['length']+_0x4d79d0['length'])+_0x322e65(0xd2));if(!_0x322ab7)return console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xd0)](_0x322e65(0xc9)),_0x322e65(0xfc)),0x1;}for(const _0x496143 of _0x4a954b[_0x322e65(0xe0)]){if(_0x496143['isNew']||_0x496143[_0x322e65(0xe8)]){const _0x4f4a14=a30_0xe82c4f[_0x322e65(0xe6)](_0x496143['absolutePath']);!existsSync(_0x4f4a14)&&mkdirSync(_0x4f4a14,{'recursive':!![]}),writeFileSync(_0x496143[_0x322e65(0xb7)],_0x496143[_0x322e65(0xc4)],_0x322e65(0xfb));}}return console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xf1)]('✔\x20Pulled\x20'+(_0x54689e[_0x322e65(0xbf)]+_0x4d79d0[_0x322e65(0xbf)])+_0x322e65(0xd1)+_0x4a954b[_0x322e65(0xc6)])),saveSessionContext({'parent_segment':_0x4a954b[_0x322e65(0xeb)]},_0x54464c[_0x322e65(0xf4)]),console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xf1)]('✔\x20Context\x20set:\x20'+a30_0x159112['dim'](_0x322e65(0xdf))+'\x20=\x20'+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xeb)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x56349f=a32_0x1c5a;(function(_0x119acf,_0x77b171){const _0x2d4f83=a32_0x1c5a,_0x1cdb2d=_0x119acf();while(!![]){try{const _0x56a137=-parseInt(_0x2d4f83(0x198))/0x1+parseInt(_0x2d4f83(0x1cc))/0x2+-parseInt(_0x2d4f83(0x152))/0x3+parseInt(_0x2d4f83(0x1cf))/0x4*(-parseInt(_0x2d4f83(0x1b6))/0x5)+parseInt(_0x2d4f83(0x182))/0x6+parseInt(_0x2d4f83(0x174))/0x7+-parseInt(_0x2d4f83(0x197))/0x8*(-parseInt(_0x2d4f83(0x183))/0x9);if(_0x56a137===_0x77b171)break;else _0x1cdb2d['push'](_0x1cdb2d['shift']());}catch(_0x2904e7){_0x1cdb2d['push'](_0x1cdb2d['shift']());}}}(a32_0x87c3,0xdb887));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';function a32_0x1c5a(_0x541b07,_0x313d26){_0x541b07=_0x541b07-0x13a;const _0x87c32d=a32_0x87c3();let _0x1c5a40=_0x87c32d[_0x541b07];return _0x1c5a40;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a32_0x1f1e63 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a32_0x87c3(){const _0x3af198=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20to\x20delete','activations','folderPath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','5304135xwxeCP','isNew','\x20YAML\x20files\x20found','created','buildUserMaps','updated','getParent','\x20\x20Segments:\x20','new','getJourney','\x0aPush\x20summary\x20for\x20\x27','get','targetDir','folders','cyan','parentSegment','results','length','segment\x20or\x20journey','\x27...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','red','journeyId','type','journeyBundleId','\x0a✔\x20Push\x20complete','\x20\x20Journeys:\x20','file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','all','\x20\x20Activations:\x20','Error\x20parsing\x20YAML:\x20','11306841jkAoXQ','journeysOnly','\x20changes?','name','user','\x20\x20\x20\x20','toString','attributes','join','parentName','endsWith','message','journeys','yellow','6109530YmTPUu','19107StAbYm','changed','resolveParentId','parent_name','\x20\x20Source:\x20','No\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Fetching\x20parent\x20segment\x20details...','\x0aError:','Fetching\x20users\x20for\x20email\x20resolution...','error','helpText','nameToId','\x20folders\x20to\x20create','site','deleted','(Journey\x20will\x20be\x20deleted)','Resolving\x20parent\x20segment\x20\x27','diff','Parent\x20segment:\x20','8976LdYyHn','1261528YBAFqW','Scoped\x20to\x20folder:\x20','connection','Site:\x20','filePath','segmentFolderId','delete','\x0aValidation\x20failed:','Error:\x20Directory\x20not\x20found:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toDelete','Changes\x20to:','listJourneysWithDetailsFromParentSegment','setPhase','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20Activations:','green','map','cwd','createdSegmentIds','Fetching\x20existing\x20segments...','\x20to\x20create','.yaml','\x20to\x20update','errorCode','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20updated','listSegments','toUpdate','Fetching\x20existing\x20folders...','505UCAKNE','Preparing\x20journeys...','\x20activations]','idToName','dryRun','repeat','segment','then','/app/ps/','.yml','unchanged','Aborted.','Source\x20directory:\x20','journeyBundleName','Fetching\x20existing\x20activations...','Delete\x20segment:','folderId','audienceId','listActivations','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20🗺️\x20\x20Journeys:','filter','349694MIosjs','\x20unchanged','push','49964tbpoli','existingJourney','\x20deleted','listFolders','dim','set','paused','blue','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','versionNumber','Folders\x20to\x20create:','yamlConfig','nameToType','data','updatedAt','\x20changed','segments','journey','verbose','📁\x20','isScoped','toCreate','description','/e/','\x20new'];a32_0x87c3=function(){return _0x3af198;};return a32_0x87c3();}export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a32_0x56349f(0x149)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x1d7ef7){const _0x2431a0=a32_0x56349f,{options:_0x5ab2cc,args:_0x56db90,tdx:_0x5226b0}=_0x1d7ef7,_0x2d56b1=_0x5ab2cc,_0x562f4b=await resolveTarget({'arg':_0x56db90[0x0],'contextParent':_0x5ab2cc[_0x2431a0(0x161)],'cwd':process[_0x2431a0(0x1aa)]()});if(!isSuccessfulResolution(_0x562f4b))return _0x562f4b[_0x2431a0(0x1b0)]==='no_parent'?(console['error'](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x1b1))),console[_0x2431a0(0x18d)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x2431a0(0x18d)](_0x2431a0(0x168)),console[_0x2431a0(0x18d)](_0x2431a0(0x14c))):(console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)]('Error:\x20'+_0x562f4b[_0x2431a0(0x17f)]+'\x0a')),_0x562f4b[_0x2431a0(0x18e)]&&console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x160)](_0x562f4b[_0x2431a0(0x18e)]))),0x1;if(_0x562f4b[_0x2431a0(0x16b)]===_0x2431a0(0x186))return console['error'](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x1a0)+_0x562f4b[_0x2431a0(0x15e)]+'\x0a')),console[_0x2431a0(0x18d)](a32_0x1f1e63['cyan'](_0x2431a0(0x1c9))),0x1;const _0x488b0b=_0x562f4b[_0x2431a0(0x17d)],_0x30f4c5=_0x562f4b['targetDir'],_0x2394d0=_0x562f4b['type']===_0x2431a0(0x16f)?_0x562f4b[_0x2431a0(0x19c)]:undefined,_0x4d64c0=getScopedDetails(_0x562f4b),_0x187f70=_0x4d64c0?.[_0x2431a0(0x147)]??![],_0x4c5738=_0x4d64c0?.['scopedFolderPath']??'';if(!existsSync(_0x30f4c5))return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x1a0)+_0x30f4c5+'\x0a')),console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x160)](_0x2431a0(0x1c9))),0x1;_0x2d56b1[_0x2431a0(0x145)]&&(console[_0x2431a0(0x18d)](_0x2431a0(0x19b)+_0x2d56b1[_0x2431a0(0x191)]),console[_0x2431a0(0x18d)](_0x2431a0(0x196)+_0x488b0b),console[_0x2431a0(0x18d)](_0x2431a0(0x1c2)+_0x30f4c5),_0x187f70&&console[_0x2431a0(0x18d)](_0x2431a0(0x199)+_0x4c5738));const _0x2f8b21=await withSpinner(_0x2431a0(0x194)+_0x488b0b+_0x2431a0(0x165),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x185)](_0x488b0b),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),_0x57d7d5=_0x2f8b21[_0x2431a0(0x140)],[_0x4fdbde,_0x9bb0ad,_0x1c435b,_0x434181,_0x3affb6]=await Promise[_0x2431a0(0x171)]([withSpinner(_0x2431a0(0x18a),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x158)](_0x57d7d5),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),withSpinner(_0x2431a0(0x1ac),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x1b3)](_0x57d7d5),{'verbose':_0x2d56b1['verbose']}),withSpinner(_0x2431a0(0x1b5),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x1d2)](_0x57d7d5),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x5226b0['journey'][_0x2431a0(0x1a4)](_0x57d7d5,{'includeAllVersions':!![]}),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),withSpinner(_0x2431a0(0x18c),()=>_0x5226b0[_0x2431a0(0x178)][_0x2431a0(0x156)](),{'verbose':_0x2d56b1[_0x2431a0(0x145)]})[_0x2431a0(0x1bd)](_0x2ba455=>_0x2ba455[_0x2431a0(0x140)])]),_0x424f8b=_0x4fdbde['data'],_0x30a7bd=extractRootFolderId(_0x424f8b),_0x45ba4d=_0x9bb0ad['data'],_0x31e49e=_0x1c435b[_0x2431a0(0x140)],{journeys:_0x105bd7,activationStepsById:_0x2b0190}=_0x434181[_0x2431a0(0x140)],_0x572d69=new Map(_0x105bd7['map'](_0x48ad9a=>[_0x48ad9a['id'],_0x48ad9a])),_0x2e771b=_0x105bd7[_0x2431a0(0x1a9)](_0xf4fb82=>({'id':_0xf4fb82['id'],'name':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x177)],'journeyBundleName':_0xf4fb82[_0x2431a0(0x17b)]['journeyBundleName']||'','journeyBundleId':_0xf4fb82['attributes'][_0x2431a0(0x16c)]||'','versionNumber':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x13c)],'description':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x149)],'state':_0xf4fb82['attributes']['state'],'paused':_0xf4fb82['attributes'][_0x2431a0(0x1d5)],'audienceId':_0xf4fb82['attributes'][_0x2431a0(0x1c7)],'folderId':_0xf4fb82['relationships']?.['parentFolder']?.[_0x2431a0(0x140)]?.['id'],'createdAt':_0xf4fb82['attributes']['createdAt'],'updatedAt':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x141)]})),{emailToId:_0x2baff2,idToEmail:_0x4c2eac}=_0x3affb6,_0x3ac946=await withSpinner(_0x2431a0(0x167),async()=>{const _0x3716ed=await _0x5226b0['connection']['list']();return buildConnectionMaps(_0x3716ed);},{'verbose':_0x2d56b1[_0x2431a0(0x145)]})[_0x2431a0(0x1bd)](_0x58271b=>_0x58271b[_0x2431a0(0x140)]),_0xca8b80=_0x3ac946[_0x2431a0(0x18f)],_0x2f7d7f=_0x3ac946[_0x2431a0(0x1b9)],_0x21064e=_0x3ac946[_0x2431a0(0x13f)],_0x39cfab={'emailToIdMap':_0x2baff2,'connectionNameToIdMap':_0xca8b80,'connectionNameToTypeMap':_0x21064e,'getSchema':_0x441d84=>_0x5226b0[_0x2431a0(0x19a)]['getOutputSchemaWithCache'](_0x441d84)};let {pathToId:_0x390da4,idToPath:_0x215866}=buildFolderMaps(_0x31e49e);const _0x165f07=buildSegmentLookupMap(_0x45ba4d,_0x215866),_0x280715=buildSegmentNameToIdMap(_0x45ba4d),_0x32307d=buildJourneyBundleLookupMap(_0x2e771b,_0x215866);let _0x3d974f;if(_0x2394d0){if(!_0x2394d0[_0x2431a0(0x17e)](_0x2431a0(0x1bf))&&!_0x2394d0[_0x2431a0(0x17e)](_0x2431a0(0x1ae)))return console[_0x2431a0(0x18d)](a32_0x1f1e63['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2394d0+'\x0a')),0x1;_0x3d974f=[_0x2394d0];}else _0x3d974f=findYamlFiles(_0x30f4c5);if(_0x3d974f[_0x2431a0(0x163)]===0x0)return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x30f4c5+'\x0a')),console[_0x2431a0(0x18d)](a32_0x1f1e63['cyan'](_0x2431a0(0x13a))),0x1;let _0xea5038,_0x32e168;try{const _0x599729=parseAndClassifyYamlFiles(_0x3d974f,_0x30f4c5,{'skipSegments':_0x2d56b1[_0x2431a0(0x175)]});_0xea5038=_0x599729['segments'],_0x32e168=_0x599729['journeys'];const _0x392970=validateParsedFiles(_0x599729,_0x30f4c5);if(_0x392970[_0x2431a0(0x163)]>0x0)return console[_0x2431a0(0x18d)](a32_0x1f1e63['red'](_0x2431a0(0x19f))),console[_0x2431a0(0x18d)](formatValidationErrors(_0x392970)),console['error'](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x189))),0x1;}catch(_0x13a94f){return console['error'](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x173)+(_0x13a94f instanceof Error?_0x13a94f[_0x2431a0(0x17f)]:_0x13a94f))),0x1;}if(_0xea5038['length']===0x0&&_0x32e168[_0x2431a0(0x163)]===0x0){const _0xcc37e1=_0x2d56b1['journeysOnly']?'journey':_0x2431a0(0x164);return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x188)+_0xcc37e1+_0x2431a0(0x154))),0x0;}const _0x497159=new Map();_0x45ba4d[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x175)]&&await withSpinner(_0x2431a0(0x1c4),async()=>{await batchAsync(_0x45ba4d,async _0x5bd06b=>{const _0x2c2572=a32_0x1c5a,_0x58b941=await _0x5226b0[_0x2c2572(0x1bc)][_0x2c2572(0x1c8)](_0x57d7d5,_0x5bd06b['id']);_0x497159[_0x2c2572(0x1d4)](_0x5bd06b['id'],_0x58b941);});},{'verbose':_0x2d56b1['verbose']});const {segmentFiles:_0x46de2d,foldersToCreate:_0x2327c1}=await prepareSegmentFiles(_0xea5038,{'segmentByFolderAndName':_0x165f07,'activationsBySegmentId':_0x497159,'folderPathToId':_0x390da4,'idToEmailMap':_0x4c2eac,'connectionIdToNameMap':_0x2f7d7f},_0x39cfab,_0x187f70,_0x4c5738),_0x3eb1bb=_0x2394d0?[]:findSegmentsToDelete(_0x45ba4d,_0xea5038[_0x2431a0(0x1a9)](({yamlConfig:_0x242441,folderPath:_0x4ada5b})=>({'yamlConfig':_0x242441,'folderPath':resolveTDFolderPath(_0x4ada5b,_0x187f70,_0x4c5738)})),_0x215866,_0x4c5738,_0x187f70),{journeyFiles:_0x226d76,foldersToCreate:_0x3644e3}=await withProgressSpinner(_0x2431a0(0x1b7),async _0x503831=>prepareJourneyFiles(_0x32e168,{'fetchJourney':async _0xc2ba15=>_0x5226b0['journey'][_0x2431a0(0x15b)](_0xc2ba15[_0x2431a0(0x16a)]),'journeyBundlesByFolderAndName':_0x32307d,'folderPathToId':_0x390da4,'idToEmailMap':_0x4c2eac,'connectionIdToNameMap':_0x2f7d7f,'existingSegments':_0x45ba4d,'parentId':_0x57d7d5,'deps':_0x5226b0,'progress':{'update':_0x4b8fb7=>{const _0x4f2ae1=_0x2431a0;_0x503831[_0x4f2ae1(0x1a5)](_0x4b8fb7),_0x2d56b1['verbose']&&console[_0x4f2ae1(0x18d)]('\x20\x20'+_0x4b8fb7);}},'journeyById':_0x572d69,'activationStepsById':_0x2b0190},_0x187f70,_0x4c5738),{'verbose':_0x2d56b1[_0x2431a0(0x145)]})[_0x2431a0(0x1bd)](_0x49b418=>_0x49b418[_0x2431a0(0x140)]);for(const _0x56a85c of _0x3644e3){_0x2327c1['add'](_0x56a85c);}const _0x1f7771=_0x2394d0?[]:findJourneysToDelete(_0x2e771b,_0x32e168[_0x2431a0(0x1a9)](({yamlConfig:_0x312273,folderPath:_0x417754})=>({'yamlConfig':_0x312273,'folderPath':resolveTDFolderPath(_0x417754,_0x187f70,_0x4c5738)})),_0x215866,_0x4c5738,_0x187f70),_0x789f31=calculatePushStats(_0x46de2d,_0x226d76,_0x2327c1,_0x3eb1bb,_0x1f7771,!!_0x2d56b1[_0x2431a0(0x19e)],!!_0x2d56b1[_0x2431a0(0x175)]),_0x500edd=_0x789f31[_0x2431a0(0x143)][_0x2431a0(0x15a)],_0x6c2958=_0x789f31['segments'][_0x2431a0(0x184)],_0x402d70=_0x789f31[_0x2431a0(0x143)][_0x2431a0(0x1c0)],_0x349895=_0x789f31[_0x2431a0(0x143)]['toDelete'],_0x52d432=_0x789f31[_0x2431a0(0x15f)][_0x2431a0(0x148)],_0x4445cc=_0x789f31[_0x2431a0(0x180)][_0x2431a0(0x15a)],_0x3d5f09=_0x789f31[_0x2431a0(0x180)][_0x2431a0(0x184)],_0xda4efe=_0x789f31[_0x2431a0(0x180)][_0x2431a0(0x1c0)],_0x51fc0f=_0x789f31['journeys'][_0x2431a0(0x1a2)],_0x28923b=_0x789f31[_0x2431a0(0x14f)][_0x2431a0(0x171)],_0xa55d7a=_0x789f31['activations'][_0x2431a0(0x148)],_0x207819=_0x789f31[_0x2431a0(0x14f)][_0x2431a0(0x1b4)],_0x4e7e7e=_0x789f31[_0x2431a0(0x14f)][_0x2431a0(0x1a2)];console[_0x2431a0(0x18d)](_0x2431a0(0x15c)+_0x488b0b+'\x27:');_0x52d432[_0x2431a0(0x163)]>0x0&&console[_0x2431a0(0x18d)]('\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1d6)](_0x2431a0(0x146)+_0x52d432['length']+_0x2431a0(0x190)));if(!_0x2d56b1[_0x2431a0(0x175)]){console[_0x2431a0(0x18d)]('\x20\x20📊\x20Segments:'),console[_0x2431a0(0x18d)]('\x20\x20\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1a8)]('+\x20'+_0x500edd[_0x2431a0(0x163)]+_0x2431a0(0x14b))),console[_0x2431a0(0x18d)]('\x20\x20\x20\x20'+a32_0x1f1e63[_0x2431a0(0x181)]('~\x20'+_0x6c2958['length']+_0x2431a0(0x142)));if(_0x349895[_0x2431a0(0x163)]>0x0)console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x169)]('-\x20'+_0x349895[_0x2431a0(0x163)]+_0x2431a0(0x14e)));else _0x3eb1bb[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x19e)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1d3)](_0x3eb1bb[_0x2431a0(0x163)]+_0x2431a0(0x1a1)));console[_0x2431a0(0x18d)]('\x20\x20\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1d3)]('=\x20'+_0x402d70[_0x2431a0(0x163)]+_0x2431a0(0x1cd)));}if(_0x226d76[_0x2431a0(0x163)]>0x0||_0x1f7771[_0x2431a0(0x163)]>0x0){console[_0x2431a0(0x18d)](_0x2431a0(0x1ca)),console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63['green']('+\x20'+_0x4445cc[_0x2431a0(0x163)]+'\x20new')),console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x181)]('~\x20'+_0x3d5f09[_0x2431a0(0x163)]+_0x2431a0(0x142)));if(_0x51fc0f[_0x2431a0(0x163)]>0x0)console['error'](_0x2431a0(0x179)+a32_0x1f1e63['red']('-\x20'+_0x51fc0f[_0x2431a0(0x163)]+_0x2431a0(0x14e)));else _0x1f7771[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x19e)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1d3)](_0x1f7771[_0x2431a0(0x163)]+_0x2431a0(0x1a1)));console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1d3)]('=\x20'+_0xda4efe[_0x2431a0(0x163)]+_0x2431a0(0x1cd)));}_0x28923b[_0x2431a0(0x163)]>0x0&&!_0x2d56b1['journeysOnly']&&(console[_0x2431a0(0x18d)](''),console['error'](_0x2431a0(0x1a7)),_0xa55d7a['length']>0x0&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1a8)]('+\x20'+_0xa55d7a[_0x2431a0(0x163)]+_0x2431a0(0x1ad))),_0x207819[_0x2431a0(0x163)]>0x0&&console['error'](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x181)]('~\x20'+_0x207819[_0x2431a0(0x163)]+_0x2431a0(0x1af))),_0x4e7e7e[_0x2431a0(0x163)]>0x0&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63['red']('-\x20'+_0x4e7e7e[_0x2431a0(0x163)]+_0x2431a0(0x14e))));console[_0x2431a0(0x18d)](_0x2431a0(0x187)+a32_0x1f1e63[_0x2431a0(0x160)](_0x30f4c5)+'\x0a');if(_0x52d432['length']>0x0){console['error'](_0x2431a0(0x13d));for(const _0xc4e272 of _0x52d432){console['error']('\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1d6)]('+')+'\x20'+_0xc4e272);}console[_0x2431a0(0x18d)]('');}if(_0x500edd['length']>0x0&&!_0x2d56b1[_0x2431a0(0x175)])for(const _0x3b8540 of _0x500edd){const _0x2b6af8=_0x3b8540[_0x2431a0(0x150)]?_0x3b8540[_0x2431a0(0x150)]+'/'+_0x3b8540[_0x2431a0(0x13e)][_0x2431a0(0x177)]:_0x3b8540[_0x2431a0(0x13e)]['name'],_0x3ff111=_0x3b8540['yamlConfig'][_0x2431a0(0x14f)]?.[_0x2431a0(0x163)]||0x0,_0x503258=_0x3ff111>0x0?a32_0x1f1e63[_0x2431a0(0x1d3)]('\x20['+_0x3ff111+'\x20activations]'):'';console['error']('\x0a'+a32_0x1f1e63[_0x2431a0(0x1a8)]('New\x20segment:')+'\x20'+_0x2b6af8+_0x503258),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c)),_0x3b8540[_0x2431a0(0x195)]&&console[_0x2431a0(0x18d)](_0x3b8540[_0x2431a0(0x195)]),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x349895['length']>0x0&&!_0x2d56b1[_0x2431a0(0x175)])for(const _0x1ff9d2 of _0x349895){const _0x152ed2=_0x1ff9d2['segmentFolderId']?_0x215866[_0x2431a0(0x15d)](_0x1ff9d2[_0x2431a0(0x19d)][_0x2431a0(0x17a)]())||'':'',_0x454f11=_0x152ed2?_0x152ed2+'/'+_0x1ff9d2[_0x2431a0(0x177)]:_0x1ff9d2[_0x2431a0(0x177)],_0x5ad8c8=_0x497159[_0x2431a0(0x15d)](_0x1ff9d2['id'])||[],_0x51fdb7=_0x5ad8c8[_0x2431a0(0x163)]>0x0?a32_0x1f1e63[_0x2431a0(0x1d3)]('\x20['+_0x5ad8c8[_0x2431a0(0x163)]+_0x2431a0(0x1b8)):'';console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x1c5))+'\x20'+_0x454f11+_0x51fdb7),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));const _0x34be3c=segmentWithActivationsToYaml(_0x1ff9d2,_0x5ad8c8,undefined,_0x4c2eac,_0x2f7d7f),_0x284470=segmentToYamlString(_0x34be3c),_0x1a75a7=generateDiff(_0x284470,'');console[_0x2431a0(0x18d)](formatDiffWithColors(_0x1a75a7)),console['error']('─'[_0x2431a0(0x1bb)](0x3c));}const _0x379e88=_0x46de2d['filter'](_0x3643c6=>!_0x3643c6['isNew']&&_0x3643c6[_0x2431a0(0x195)]);if(_0x379e88[_0x2431a0(0x163)]>0x0&&!_0x2d56b1['journeysOnly'])for(const _0x51ff45 of _0x379e88){const _0xf6fe62=_0x51ff45[_0x2431a0(0x150)]?_0x51ff45[_0x2431a0(0x150)]+'/'+_0x51ff45[_0x2431a0(0x13e)][_0x2431a0(0x177)]:_0x51ff45['yamlConfig'][_0x2431a0(0x177)];console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x1a3))+'\x20'+_0xf6fe62),console['error']('─'[_0x2431a0(0x1bb)](0x3c)),console[_0x2431a0(0x18d)](_0x51ff45[_0x2431a0(0x195)]),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x4445cc['length']>0x0)for(const _0x4e2ed1 of _0x4445cc){const _0x5a5268=_0x4e2ed1[_0x2431a0(0x150)]?_0x4e2ed1[_0x2431a0(0x150)]+'/'+_0x4e2ed1['yamlConfig'][_0x2431a0(0x177)]:_0x4e2ed1['yamlConfig'][_0x2431a0(0x177)];console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x1a8)]('New\x20journey:')+'\x20'+_0x5a5268),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c)),_0x4e2ed1[_0x2431a0(0x195)]&&console[_0x2431a0(0x18d)](_0x4e2ed1[_0x2431a0(0x195)]),console['error']('─'[_0x2431a0(0x1bb)](0x3c));}const _0x2084e7=_0x226d76[_0x2431a0(0x1cb)](_0x447348=>!_0x447348[_0x2431a0(0x153)]&&_0x447348['diff']);if(_0x2084e7[_0x2431a0(0x163)]>0x0)for(const _0x5a8359 of _0x2084e7){const _0x26b96e=_0x5a8359[_0x2431a0(0x150)]?_0x5a8359[_0x2431a0(0x150)]+'/'+_0x5a8359['yamlConfig'][_0x2431a0(0x177)]:_0x5a8359[_0x2431a0(0x13e)][_0x2431a0(0x177)];console['error']('\x0a'+a32_0x1f1e63[_0x2431a0(0x181)]('Changes\x20to\x20journey:')+'\x20'+_0x26b96e),console['error']('─'['repeat'](0x3c)),console[_0x2431a0(0x18d)](_0x5a8359['diff']),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x51fc0f[_0x2431a0(0x163)]>0x0)for(const _0x1c8351 of _0x51fc0f){const _0x4cb34f=_0x1c8351[_0x2431a0(0x1c6)]?_0x215866[_0x2431a0(0x15d)](_0x1c8351['folderId'])||'':'',_0x383d6b=_0x4cb34f?_0x4cb34f+'/'+_0x1c8351['journeyBundleName']:_0x1c8351[_0x2431a0(0x1c3)];console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x169)]('Delete\x20journey:')+'\x20'+_0x383d6b),console['error']('─'[_0x2431a0(0x1bb)](0x3c)),console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x193))),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x2d56b1[_0x2431a0(0x1ba)])return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x166))),0x0;const _0x1ddd03=_0x2d56b1['journeysOnly']?![]:_0x500edd['length']>0x0||_0x6c2958[_0x2431a0(0x163)]>0x0||_0x349895[_0x2431a0(0x163)]>0x0,_0x3afb93=_0x4445cc[_0x2431a0(0x163)]>0x0||_0x3d5f09[_0x2431a0(0x163)]>0x0||_0x51fc0f[_0x2431a0(0x163)]>0x0,_0xa29fc1=_0x2d56b1['journeysOnly']?![]:_0x28923b[_0x2431a0(0x163)]>0x0,_0x4ec98d=_0x52d432['length']>0x0;if(!_0x1ddd03&&!_0x3afb93&&!_0xa29fc1&&!_0x4ec98d){const _0x49c18a=_0x2d56b1[_0x2431a0(0x175)]?_0x2431a0(0x1a6):_0x2431a0(0x14d);console['error'](a32_0x1f1e63[_0x2431a0(0x1a8)](_0x49c18a));if(_0x2394d0&&_0xda4efe[_0x2431a0(0x163)]===0x1){const _0x570397=_0xda4efe[0x0];if(_0x570397['existingJourney']?.['id']){const _0x2c46ef=getConsoleNextUrl(_0x2d56b1[_0x2431a0(0x191)],_0x2431a0(0x1be)+_0x57d7d5+_0x2431a0(0x14a)+_0x570397[_0x2431a0(0x1d0)]['id']+'/j/da/je');console['error']('\x20\x20'+a32_0x1f1e63['cyan'](_0x2c46ef));}}return 0x0;}const _0x48972d=_0x2d56b1[_0x2431a0(0x175)]?_0x4445cc[_0x2431a0(0x163)]+_0x3d5f09[_0x2431a0(0x163)]+_0x51fc0f['length']+_0x52d432['length']:_0x500edd[_0x2431a0(0x163)]+_0x6c2958['length']+_0x349895[_0x2431a0(0x163)]+_0x4445cc['length']+_0x3d5f09[_0x2431a0(0x163)]+_0x51fc0f[_0x2431a0(0x163)]+_0x52d432['length']+_0x28923b['length'];if(!_0x2d56b1['yes']&&_0x48972d>0x0){if(!isInteractive())return console['error'](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x18b)),_0x2431a0(0x151)),console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x1d3)](_0x2431a0(0x170))),0x1;const _0x5d2050=await confirmKey('Push\x20'+_0x48972d+_0x2431a0(0x176));if(!_0x5d2050)return console['error'](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x1c1))),0x1;}const _0x4025d0={'withProgress':async(_0x45fd73,_0x16e4f4)=>{const _0x451d6d=_0x2431a0,_0xab075d=await withSpinner(_0x45fd73,_0x16e4f4,{'verbose':_0x2d56b1[_0x451d6d(0x145)]});return{'data':_0xab075d[_0x451d6d(0x140)]};},'logInfo':_0xedac3d=>console['error'](a32_0x1f1e63[_0x2431a0(0x1d6)]('✔\x20'+_0xedac3d)),'logSuccess':_0x494b4d=>console[_0x2431a0(0x18d)](a32_0x1f1e63['green']('✔\x20'+_0x494b4d)),'logWarning':_0x21b2f1=>console['error'](a32_0x1f1e63[_0x2431a0(0x181)]('⚠\x20'+_0x21b2f1)),'logDeleted':_0x2f9f79=>console['error'](a32_0x1f1e63[_0x2431a0(0x169)]('✔\x20'+_0x2f9f79))},_0x3f8739={'segment':_0x5226b0[_0x2431a0(0x1bc)],'journey':_0x5226b0[_0x2431a0(0x144)],'user':_0x5226b0[_0x2431a0(0x178)],'connection':_0x5226b0[_0x2431a0(0x19a)]};_0x52d432[_0x2431a0(0x163)]>0x0&&(_0x390da4=await executePushFolders(_0x3f8739,_0x52d432,_0x390da4,{'parentId':_0x57d7d5},_0x4025d0));const _0x473a03={'rootFolderId':_0x30a7bd,'folderPathToId':_0x390da4,'folderIdToPath':_0x215866,'segmentNameToId':_0x280715,'activationsBySegmentId':_0x497159,'emailToIdMap':_0x2baff2,'idToEmailMap':_0x4c2eac,'connectionNameToIdMap':_0x3ac946['nameToId'],'connectionIdToNameMap':_0x3ac946[_0x2431a0(0x1b9)],'connectionNameToTypeMap':_0x21064e},_0x3ccf22=await executePushSegments(_0x3f8739,_0x2d56b1[_0x2431a0(0x175)]?[]:_0x46de2d,_0x473a03,{'parentId':_0x57d7d5},_0x4025d0),_0x21cf15=_0x3ccf22['created'],_0x35b7f5=_0x3ccf22['updated'],_0x2d6124=_0x3ccf22[_0x2431a0(0x14f)][_0x2431a0(0x155)],_0x4c89e7=_0x3ccf22['activations'][_0x2431a0(0x157)],_0x282091=_0x3ccf22['activations'][_0x2431a0(0x192)],_0x54cbdb=await executePushSegmentDeletions(_0x3f8739,_0x2d56b1['journeysOnly']?[]:_0x349895,_0x4025d0);let _0x5cf457=0x0,_0x68eb54=0x0,_0x24868e=0x0;const _0x55b973=new Map(_0x280715);for(const [_0x7f0790,_0x283539]of _0x3ccf22[_0x2431a0(0x1ab)]){_0x55b973[_0x2431a0(0x1d4)](_0x7f0790,_0x283539);}if(_0x226d76[_0x2431a0(0x163)]>0x0){const _0x183153={..._0x473a03,'segmentNameToId':_0x55b973,'existingSegments':_0x45ba4d,'activationContext':_0x39cfab},_0x5ccdda=await executePushJourneys(_0x3f8739,_0x226d76,_0x183153,{'parentId':_0x57d7d5,'rootFolderId':_0x30a7bd,'verbose':_0x2d56b1[_0x2431a0(0x145)]},_0x4025d0);_0x5cf457=_0x5ccdda[_0x2431a0(0x155)],_0x68eb54=_0x5ccdda[_0x2431a0(0x157)];if(_0x2394d0&&_0x5ccdda[_0x2431a0(0x162)][_0x2431a0(0x163)]===0x1){const _0x224d4f=_0x5ccdda[_0x2431a0(0x162)][0x0];if(_0x224d4f['journeyId']){const _0x1effc6=getConsoleNextUrl(_0x2d56b1[_0x2431a0(0x191)],_0x2431a0(0x1be)+_0x57d7d5+_0x2431a0(0x14a)+_0x224d4f['journeyId']+'/j/da/je');console[_0x2431a0(0x18d)]('\x20\x20'+a32_0x1f1e63['cyan'](_0x1effc6));}}}for(const _0x466a4c of _0x51fc0f){console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x181)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x466a4c['journeyBundleName'])),_0x24868e++;}const _0x142277=[];if(_0x21cf15>0x0)_0x142277[_0x2431a0(0x1ce)](_0x21cf15+_0x2431a0(0x13b));if(_0x35b7f5>0x0)_0x142277[_0x2431a0(0x1ce)](_0x35b7f5+_0x2431a0(0x1b2));if(_0x54cbdb>0x0)_0x142277['push'](_0x54cbdb+_0x2431a0(0x1d1));const _0x3d6ecd=[];if(_0x5cf457>0x0)_0x3d6ecd['push'](_0x5cf457+_0x2431a0(0x13b));if(_0x68eb54>0x0)_0x3d6ecd[_0x2431a0(0x1ce)](_0x68eb54+_0x2431a0(0x1b2));if(_0x24868e>0x0)_0x3d6ecd[_0x2431a0(0x1ce)](_0x24868e+_0x2431a0(0x1d1));const _0x5e8fe0=[];if(_0x2d6124>0x0)_0x5e8fe0[_0x2431a0(0x1ce)](_0x2d6124+'\x20created');if(_0x4c89e7>0x0)_0x5e8fe0[_0x2431a0(0x1ce)](_0x4c89e7+_0x2431a0(0x1b2));if(_0x282091>0x0)_0x5e8fe0[_0x2431a0(0x1ce)](_0x282091+_0x2431a0(0x1d1));return console[_0x2431a0(0x18d)](a32_0x1f1e63['green'](_0x2431a0(0x16d))),_0x142277[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x175)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x159)+_0x142277[_0x2431a0(0x17c)](',\x20')),_0x3d6ecd[_0x2431a0(0x163)]>0x0&&console['error'](_0x2431a0(0x16e)+_0x3d6ecd[_0x2431a0(0x17c)](',\x20')),_0x5e8fe0['length']>0x0&&!_0x2d56b1[_0x2431a0(0x175)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x172)+_0x5e8fe0[_0x2431a0(0x17c)](',\x20')),0x0;}}
|
|
1
|
+
const a31_0x48dd15=a31_0x44b8;function a31_0x368d(){const _0x143c6b=['user','updated','activations','4837rRIiOC','get','existingJourney','.yaml','\x20deleted','Error\x20parsing\x20YAML:\x20','paused','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeyId','cyan','Scoped\x20to\x20folder:\x20','data','length','blue','filter','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','changed','New\x20segment:','attributes','listSegments','Fetching\x20existing\x20segments...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Delete\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','toCreate','diff','toDelete','add','Error:\x20Directory\x20not\x20found:\x20','state','push','verbose','\x0aError:','parentName','set','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','list','\x20unchanged','journeyBundleName','\x20\x20Source:\x20','New\x20journey:','Fetching\x20existing\x20journeys...','toUpdate','listJourneysWithDetailsFromParentSegment','execute','\x20\x20Activations:','/e/','toString','Delete\x20journey:','segment','\x20folders\x20to\x20create','/app/ps/','9rYnVTq','map','\x20\x20\x20\x20','yamlConfig','Aborted.','\x20\x20Segments:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','then','isNew','journeysOnly','error','\x27...','Folders\x20to\x20create:','unchanged','138517sHSyjf','name','\x20to\x20delete','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20📊\x20Segments:','delete','created','\x20updated','\x20changed','site','Fetching\x20connections\x20for\x20name\x20resolution...','63nWEVjo','getJourney','type','description','folderId','connection','getParent','Source\x20directory:\x20','\x20\x20Journeys:\x20','resolveParentId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20activations]','yellow','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','15oQYvKI','29742024diLpFS','dim','Error:\x20','137396OMEsoa','dryRun','versionNumber','setPhase','createdAt','3053140chaMYo','\x20to\x20create','folderPath','segmentFolderId','Fetching\x20parent\x20segment\x20details...','nameToType','journey','Changes\x20to:','\x20\x20Activations:\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','segments','isScoped','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','repeat','helpText','11FYKtiw','\x20new','new','folders','No\x20','Parent\x20segment:\x20','Fetching\x20users\x20for\x20email\x20resolution...','endsWith','/j/da/je','updatedAt','📁\x20','\x20YAML\x20files\x20found','journeys','red','parentSegment','targetDir','Preparing\x20journeys...','1043944xniJcs','1227078uwvGxB','(Journey\x20will\x20be\x20deleted)','Push\x20','Fetching\x20existing\x20activations...','\x20changes?','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)','listFolders','join','\x20created','9752lOPNUo'];a31_0x368d=function(){return _0x143c6b;};return a31_0x368d();}(function(_0x3e770a,_0x505b55){const _0x228788=a31_0x44b8,_0x1f72cf=_0x3e770a();while(!![]){try{const _0xda94a5=-parseInt(_0x228788(0x231))/0x1+-parseInt(_0x228788(0x274))/0x2+parseInt(_0x228788(0x23c))/0x3*(-parseInt(_0x228788(0x24f))/0x4)+-parseInt(_0x228788(0x24b))/0x5*(-parseInt(_0x228788(0x275))/0x6)+-parseInt(_0x228788(0x282))/0x7*(parseInt(_0x228788(0x27e))/0x8)+-parseInt(_0x228788(0x223))/0x9*(parseInt(_0x228788(0x254))/0xa)+-parseInt(_0x228788(0x263))/0xb*(-parseInt(_0x228788(0x24c))/0xc);if(_0xda94a5===_0x505b55)break;else _0x1f72cf['push'](_0x1f72cf['shift']());}catch(_0x40cdfa){_0x1f72cf['push'](_0x1f72cf['shift']());}}}(a31_0x368d,0x89594));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a31_0x44b8(_0x3d6767,_0x4b4883){_0x3d6767=_0x3d6767-0x1f0;const _0x368d39=a31_0x368d();let _0x44b84e=_0x368d39[_0x3d6767];return _0x44b84e;}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 a31_0x230a92 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x48dd15(0x232)]='segment:push';[a31_0x48dd15(0x23f)]=a31_0x48dd15(0x206);async[a31_0x48dd15(0x21b)](_0x2d6c78){const _0x3b74f4=a31_0x48dd15,{options:_0x1a1c0d,args:_0x460e87,tdx:_0xe4524a}=_0x2d6c78,_0x3df165=_0x1a1c0d,_0x45b053=await resolveTarget({'arg':_0x460e87[0x0],'contextParent':_0x1a1c0d[_0x3b74f4(0x271)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x45b053))return _0x45b053['errorCode']==='no_parent'?(console[_0x3b74f4(0x22d)](a31_0x230a92['yellow'](_0x3b74f4(0x246))),console[_0x3b74f4(0x22d)](_0x3b74f4(0x27a)),console[_0x3b74f4(0x22d)](_0x3b74f4(0x260)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x24e)+_0x45b053['message']+'\x0a')),_0x45b053[_0x3b74f4(0x262)]&&console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x1f8)](_0x45b053[_0x3b74f4(0x262)]))),0x1;if(_0x45b053[_0x3b74f4(0x23e)]==='parent_name')return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)]('Error:\x20Directory\x20not\x20found:\x20'+_0x45b053[_0x3b74f4(0x272)]+'\x0a')),console['error'](a31_0x230a92[_0x3b74f4(0x1f8)](_0x3b74f4(0x204))),0x1;const _0x1b00cf=_0x45b053[_0x3b74f4(0x210)],_0x4409db=_0x45b053['targetDir'],_0x330fae=_0x45b053[_0x3b74f4(0x23e)]==='file'?_0x45b053['filePath']:undefined,_0x3f3126=getScopedDetails(_0x45b053),_0x4340d7=_0x3f3126?.[_0x3b74f4(0x25f)]??![],_0x57d4c8=_0x3f3126?.['scopedFolderPath']??'';if(!existsSync(_0x4409db))return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x20b)+_0x4409db+'\x0a')),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x1f8)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3df165[_0x3b74f4(0x20e)]&&(console[_0x3b74f4(0x22d)]('Site:\x20'+_0x3df165[_0x3b74f4(0x23a)]),console['error'](_0x3b74f4(0x268)+_0x1b00cf),console[_0x3b74f4(0x22d)](_0x3b74f4(0x243)+_0x4409db),_0x4340d7&&console['error'](_0x3b74f4(0x1f9)+_0x57d4c8));const _0x5ba1e9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1b00cf+_0x3b74f4(0x22e),()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x245)](_0x1b00cf),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),_0x1c962d=_0x5ba1e9['data'],[_0x11a3aa,_0x19ab05,_0x432ddd,_0x3af402,_0x131c9e]=await Promise['all']([withSpinner(_0x3b74f4(0x258),()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x242)](_0x1c962d),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner(_0x3b74f4(0x203),()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x202)](_0x1c962d),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x27b)](_0x1c962d),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner(_0x3b74f4(0x218),()=>_0xe4524a[_0x3b74f4(0x25a)][_0x3b74f4(0x21a)](_0x1c962d,{'includeAllVersions':!![]}),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner(_0x3b74f4(0x269),()=>_0xe4524a[_0x3b74f4(0x27f)]['buildUserMaps'](),{'verbose':_0x3df165[_0x3b74f4(0x20e)]})[_0x3b74f4(0x22a)](_0x52f134=>_0x52f134[_0x3b74f4(0x1fa)])]),_0x36bd29=_0x11a3aa[_0x3b74f4(0x1fa)],_0x5e248e=extractRootFolderId(_0x36bd29),_0x307374=_0x19ab05[_0x3b74f4(0x1fa)],_0x3558f8=_0x432ddd[_0x3b74f4(0x1fa)],{journeys:_0x1d77f0,activationStepsById:_0x3fc8ae}=_0x3af402[_0x3b74f4(0x1fa)],_0x58c47b=new Map(_0x1d77f0['map'](_0x29722d=>[_0x29722d['id'],_0x29722d])),_0x3e9713=_0x1d77f0['map'](_0x149c4c=>({'id':_0x149c4c['id'],'name':_0x149c4c[_0x3b74f4(0x201)]['name'],'journeyBundleName':_0x149c4c[_0x3b74f4(0x201)]['journeyBundleName']||'','journeyBundleId':_0x149c4c['attributes']['journeyBundleId']||'','versionNumber':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x251)],'description':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x23f)],'state':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x20c)],'paused':_0x149c4c['attributes'][_0x3b74f4(0x1f5)],'audienceId':_0x149c4c['attributes']['audienceId'],'folderId':_0x149c4c['relationships']?.['parentFolder']?.['data']?.['id'],'createdAt':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x253)],'updatedAt':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x26c)]})),{emailToId:_0x390ca2,idToEmail:_0x5c8a1d}=_0x131c9e,_0x2a5fba=await withSpinner(_0x3b74f4(0x23b),async()=>{const _0x144001=_0x3b74f4,_0x404c7c=await _0xe4524a[_0x144001(0x241)][_0x144001(0x213)]();return buildConnectionMaps(_0x404c7c);},{'verbose':_0x3df165['verbose']})['then'](_0xd3c448=>_0xd3c448['data']),_0x3d5766=_0x2a5fba['nameToId'],_0x164cbc=_0x2a5fba['idToName'],_0x444a0d=_0x2a5fba[_0x3b74f4(0x259)],_0x55e04a={'emailToIdMap':_0x390ca2,'connectionNameToIdMap':_0x3d5766,'connectionNameToTypeMap':_0x444a0d,'getSchema':_0x323576=>_0xe4524a[_0x3b74f4(0x241)]['getOutputSchemaWithCache'](_0x323576)};let {pathToId:_0x1b61de,idToPath:_0x5cc522}=buildFolderMaps(_0x3558f8);const _0x28e31b=buildSegmentLookupMap(_0x307374,_0x5cc522),_0x54716f=buildSegmentNameToIdMap(_0x307374),_0x48624a=buildJourneyBundleLookupMap(_0x3e9713,_0x5cc522);let _0x566317;if(_0x330fae){if(!_0x330fae[_0x3b74f4(0x26a)]('.yml')&&!_0x330fae[_0x3b74f4(0x26a)](_0x3b74f4(0x1f2)))return console['error'](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x229)+_0x330fae+'\x0a')),0x1;_0x566317=[_0x330fae];}else _0x566317=findYamlFiles(_0x4409db);if(_0x566317[_0x3b74f4(0x1fb)]===0x0)return console['error'](a31_0x230a92[_0x3b74f4(0x270)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4409db+'\x0a')),console[_0x3b74f4(0x22d)](a31_0x230a92['cyan'](_0x3b74f4(0x1fe))),0x1;let _0x2b0f91,_0x85e874;try{const _0x253837=parseAndClassifyYamlFiles(_0x566317,_0x4409db,{'skipSegments':_0x3df165[_0x3b74f4(0x22c)]});_0x2b0f91=_0x253837[_0x3b74f4(0x25e)],_0x85e874=_0x253837[_0x3b74f4(0x26f)];const _0x4f340c=validateParsedFiles(_0x253837,_0x4409db);if(_0x4f340c[_0x3b74f4(0x1fb)]>0x0)return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)]('\x0aValidation\x20failed:')),console[_0x3b74f4(0x22d)](formatValidationErrors(_0x4f340c)),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x248)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x123d73){return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x1f4)+(_0x123d73 instanceof Error?_0x123d73['message']:_0x123d73))),0x1;}if(_0x2b0f91[_0x3b74f4(0x1fb)]===0x0&&_0x85e874[_0x3b74f4(0x1fb)]===0x0){const _0x37ce37=_0x3df165[_0x3b74f4(0x22c)]?'journey':'segment\x20or\x20journey';return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x248)](_0x3b74f4(0x267)+_0x37ce37+_0x3b74f4(0x26e))),0x0;}const _0x111401=new Map();_0x307374[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&await withSpinner(_0x3b74f4(0x278),async()=>{await batchAsync(_0x307374,async _0x469edf=>{const _0x38a345=a31_0x44b8,_0x46a4bb=await _0xe4524a[_0x38a345(0x220)]['listActivations'](_0x1c962d,_0x469edf['id']);_0x111401[_0x38a345(0x211)](_0x469edf['id'],_0x46a4bb);});},{'verbose':_0x3df165[_0x3b74f4(0x20e)]});const {segmentFiles:_0x4d21d2,foldersToCreate:_0x14c902}=await prepareSegmentFiles(_0x2b0f91,{'segmentByFolderAndName':_0x28e31b,'activationsBySegmentId':_0x111401,'folderPathToId':_0x1b61de,'idToEmailMap':_0x5c8a1d,'connectionIdToNameMap':_0x164cbc},_0x55e04a,_0x4340d7,_0x57d4c8),_0x44c872=_0x330fae?[]:findSegmentsToDelete(_0x307374,_0x2b0f91[_0x3b74f4(0x224)](({yamlConfig:_0x21d437,folderPath:_0x379b0e})=>({'yamlConfig':_0x21d437,'folderPath':resolveTDFolderPath(_0x379b0e,_0x4340d7,_0x57d4c8)})),_0x5cc522,_0x57d4c8,_0x4340d7),{journeyFiles:_0x5ae990,foldersToCreate:_0x3bb84e}=await withProgressSpinner(_0x3b74f4(0x273),async _0x2e778d=>prepareJourneyFiles(_0x85e874,{'fetchJourney':async _0x17a9e2=>_0xe4524a['journey'][_0x3b74f4(0x23d)](_0x17a9e2[_0x3b74f4(0x1f7)]),'journeyBundlesByFolderAndName':_0x48624a,'folderPathToId':_0x1b61de,'idToEmailMap':_0x5c8a1d,'connectionIdToNameMap':_0x164cbc,'existingSegments':_0x307374,'parentId':_0x1c962d,'deps':_0xe4524a,'progress':{'update':_0x5dd061=>{const _0x14aee2=_0x3b74f4;_0x2e778d[_0x14aee2(0x252)](_0x5dd061),_0x3df165['verbose']&&console[_0x14aee2(0x22d)]('\x20\x20'+_0x5dd061);}},'journeyById':_0x58c47b,'activationStepsById':_0x3fc8ae},_0x4340d7,_0x57d4c8),{'verbose':_0x3df165['verbose']})[_0x3b74f4(0x22a)](_0x5b8e5d=>_0x5b8e5d[_0x3b74f4(0x1fa)]);for(const _0x129439 of _0x3bb84e){_0x14c902[_0x3b74f4(0x20a)](_0x129439);}const _0x9bf860=_0x330fae?[]:findJourneysToDelete(_0x3e9713,_0x85e874[_0x3b74f4(0x224)](({yamlConfig:_0x24ecec,folderPath:_0x206afc})=>({'yamlConfig':_0x24ecec,'folderPath':resolveTDFolderPath(_0x206afc,_0x4340d7,_0x57d4c8)})),_0x5cc522,_0x57d4c8,_0x4340d7),_0x59ec61=calculatePushStats(_0x4d21d2,_0x5ae990,_0x14c902,_0x44c872,_0x9bf860,!!_0x3df165['delete'],!!_0x3df165['journeysOnly']),_0x20b07f=_0x59ec61[_0x3b74f4(0x25e)][_0x3b74f4(0x265)],_0xe2a618=_0x59ec61[_0x3b74f4(0x25e)][_0x3b74f4(0x1ff)],_0x15525=_0x59ec61[_0x3b74f4(0x25e)]['unchanged'],_0x41eb6a=_0x59ec61[_0x3b74f4(0x25e)][_0x3b74f4(0x209)],_0x15a4b8=_0x59ec61[_0x3b74f4(0x266)][_0x3b74f4(0x207)],_0x1ba4c3=_0x59ec61[_0x3b74f4(0x26f)][_0x3b74f4(0x265)],_0x446e99=_0x59ec61['journeys'][_0x3b74f4(0x1ff)],_0x342ea0=_0x59ec61['journeys'][_0x3b74f4(0x230)],_0x3ad6ab=_0x59ec61[_0x3b74f4(0x26f)][_0x3b74f4(0x209)],_0x6d6c86=_0x59ec61[_0x3b74f4(0x281)]['all'],_0x37cac7=_0x59ec61[_0x3b74f4(0x281)][_0x3b74f4(0x207)],_0x2af70e=_0x59ec61[_0x3b74f4(0x281)][_0x3b74f4(0x219)],_0x21cf4e=_0x59ec61['activations'][_0x3b74f4(0x209)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x1b00cf+'\x27:');_0x15a4b8['length']>0x0&&console[_0x3b74f4(0x22d)]('\x20\x20'+a31_0x230a92['blue'](_0x3b74f4(0x26d)+_0x15a4b8['length']+_0x3b74f4(0x221)));if(!_0x3df165[_0x3b74f4(0x22c)]){console[_0x3b74f4(0x22d)](_0x3b74f4(0x235)),console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x249)]('+\x20'+_0x20b07f[_0x3b74f4(0x1fb)]+_0x3b74f4(0x264))),console['error'](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x248)]('~\x20'+_0xe2a618['length']+_0x3b74f4(0x239)));if(_0x41eb6a[_0x3b74f4(0x1fb)]>0x0)console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x270)]('-\x20'+_0x41eb6a['length']+'\x20to\x20delete'));else _0x44c872[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x236)]&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x24d)](_0x44c872[_0x3b74f4(0x1fb)]+_0x3b74f4(0x1f6)));console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x24d)]('=\x20'+_0x15525[_0x3b74f4(0x1fb)]+_0x3b74f4(0x214)));}if(_0x5ae990[_0x3b74f4(0x1fb)]>0x0||_0x9bf860['length']>0x0){console[_0x3b74f4(0x22d)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x249)]('+\x20'+_0x1ba4c3[_0x3b74f4(0x1fb)]+_0x3b74f4(0x264))),console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x248)]('~\x20'+_0x446e99[_0x3b74f4(0x1fb)]+_0x3b74f4(0x239)));if(_0x3ad6ab[_0x3b74f4(0x1fb)]>0x0)console['error'](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x270)]('-\x20'+_0x3ad6ab[_0x3b74f4(0x1fb)]+'\x20to\x20delete'));else _0x9bf860[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x236)]&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x24d)](_0x9bf860[_0x3b74f4(0x1fb)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x24d)]('=\x20'+_0x342ea0[_0x3b74f4(0x1fb)]+_0x3b74f4(0x214)));}_0x6d6c86[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&(console[_0x3b74f4(0x22d)](''),console[_0x3b74f4(0x22d)](_0x3b74f4(0x21c)),_0x37cac7[_0x3b74f4(0x1fb)]>0x0&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x249)]('+\x20'+_0x37cac7[_0x3b74f4(0x1fb)]+_0x3b74f4(0x255))),_0x2af70e[_0x3b74f4(0x1fb)]>0x0&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x248)]('~\x20'+_0x2af70e[_0x3b74f4(0x1fb)]+'\x20to\x20update')),_0x21cf4e[_0x3b74f4(0x1fb)]>0x0&&console['error'](_0x3b74f4(0x225)+a31_0x230a92['red']('-\x20'+_0x21cf4e['length']+_0x3b74f4(0x233))));console['error'](_0x3b74f4(0x216)+a31_0x230a92[_0x3b74f4(0x1f8)](_0x4409db)+'\x0a');if(_0x15a4b8['length']>0x0){console[_0x3b74f4(0x22d)](_0x3b74f4(0x22f));for(const _0x328b92 of _0x15a4b8){console[_0x3b74f4(0x22d)]('\x20\x20'+a31_0x230a92[_0x3b74f4(0x1fc)]('+')+'\x20'+_0x328b92);}console['error']('');}if(_0x20b07f[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)])for(const _0x17c9bc of _0x20b07f){const _0x25adac=_0x17c9bc[_0x3b74f4(0x256)]?_0x17c9bc[_0x3b74f4(0x256)]+'/'+_0x17c9bc[_0x3b74f4(0x226)]['name']:_0x17c9bc[_0x3b74f4(0x226)][_0x3b74f4(0x232)],_0x2938d8=_0x17c9bc[_0x3b74f4(0x226)][_0x3b74f4(0x281)]?.[_0x3b74f4(0x1fb)]||0x0,_0x325284=_0x2938d8>0x0?a31_0x230a92[_0x3b74f4(0x24d)]('\x20['+_0x2938d8+_0x3b74f4(0x247)):'';console['error']('\x0a'+a31_0x230a92[_0x3b74f4(0x249)](_0x3b74f4(0x200))+'\x20'+_0x25adac+_0x325284),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c)),_0x17c9bc['diff']&&console[_0x3b74f4(0x22d)](_0x17c9bc[_0x3b74f4(0x208)]),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c));}if(_0x41eb6a[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165['journeysOnly'])for(const _0x26400a of _0x41eb6a){const _0x53140b=_0x26400a[_0x3b74f4(0x257)]?_0x5cc522['get'](_0x26400a['segmentFolderId'][_0x3b74f4(0x21e)]())||'':'',_0x32e802=_0x53140b?_0x53140b+'/'+_0x26400a[_0x3b74f4(0x232)]:_0x26400a['name'],_0x4b2cb7=_0x111401[_0x3b74f4(0x1f0)](_0x26400a['id'])||[],_0x143b89=_0x4b2cb7[_0x3b74f4(0x1fb)]>0x0?a31_0x230a92[_0x3b74f4(0x24d)]('\x20['+_0x4b2cb7[_0x3b74f4(0x1fb)]+_0x3b74f4(0x247)):'';console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92['red'](_0x3b74f4(0x205))+'\x20'+_0x32e802+_0x143b89),console[_0x3b74f4(0x22d)]('─'['repeat'](0x3c));const _0x53463e=segmentWithActivationsToYaml(_0x26400a,_0x4b2cb7,undefined,_0x5c8a1d,_0x164cbc),_0x4c9c01=segmentToYamlString(_0x53463e),_0x4d0df9=generateDiff(_0x4c9c01,'');console[_0x3b74f4(0x22d)](formatDiffWithColors(_0x4d0df9)),console['error']('─'[_0x3b74f4(0x261)](0x3c));}const _0x1460ef=_0x4d21d2[_0x3b74f4(0x1fd)](_0x4b3d1e=>!_0x4b3d1e[_0x3b74f4(0x22b)]&&_0x4b3d1e[_0x3b74f4(0x208)]);if(_0x1460ef['length']>0x0&&!_0x3df165[_0x3b74f4(0x22c)])for(const _0x2c9962 of _0x1460ef){const _0xf5a359=_0x2c9962[_0x3b74f4(0x256)]?_0x2c9962['folderPath']+'/'+_0x2c9962[_0x3b74f4(0x226)][_0x3b74f4(0x232)]:_0x2c9962['yamlConfig']['name'];console['error']('\x0a'+a31_0x230a92['yellow'](_0x3b74f4(0x25b))+'\x20'+_0xf5a359),console['error']('─'['repeat'](0x3c)),console[_0x3b74f4(0x22d)](_0x2c9962['diff']),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c));}if(_0x1ba4c3[_0x3b74f4(0x1fb)]>0x0)for(const _0x3d5493 of _0x1ba4c3){const _0x5c547e=_0x3d5493[_0x3b74f4(0x256)]?_0x3d5493[_0x3b74f4(0x256)]+'/'+_0x3d5493[_0x3b74f4(0x226)][_0x3b74f4(0x232)]:_0x3d5493[_0x3b74f4(0x226)][_0x3b74f4(0x232)];console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92[_0x3b74f4(0x249)](_0x3b74f4(0x217))+'\x20'+_0x5c547e),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c)),_0x3d5493[_0x3b74f4(0x208)]&&console['error'](_0x3d5493[_0x3b74f4(0x208)]),console['error']('─'[_0x3b74f4(0x261)](0x3c));}const _0x23a717=_0x5ae990[_0x3b74f4(0x1fd)](_0x3d7e74=>!_0x3d7e74[_0x3b74f4(0x22b)]&&_0x3d7e74[_0x3b74f4(0x208)]);if(_0x23a717[_0x3b74f4(0x1fb)]>0x0)for(const _0x4a99fb of _0x23a717){const _0x7108fd=_0x4a99fb[_0x3b74f4(0x256)]?_0x4a99fb[_0x3b74f4(0x256)]+'/'+_0x4a99fb['yamlConfig'][_0x3b74f4(0x232)]:_0x4a99fb[_0x3b74f4(0x226)]['name'];console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x7108fd),console[_0x3b74f4(0x22d)]('─'['repeat'](0x3c)),console['error'](_0x4a99fb[_0x3b74f4(0x208)]),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c));}if(_0x3ad6ab['length']>0x0)for(const _0x251853 of _0x3ad6ab){const _0x256122=_0x251853[_0x3b74f4(0x240)]?_0x5cc522[_0x3b74f4(0x1f0)](_0x251853[_0x3b74f4(0x240)])||'':'',_0x1b321e=_0x256122?_0x256122+'/'+_0x251853[_0x3b74f4(0x215)]:_0x251853['journeyBundleName'];console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x21f))+'\x20'+_0x1b321e),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c)),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x276))),console[_0x3b74f4(0x22d)]('─'['repeat'](0x3c));}if(_0x3df165[_0x3b74f4(0x250)])return console['error'](a31_0x230a92[_0x3b74f4(0x248)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x257c22=_0x3df165[_0x3b74f4(0x22c)]?![]:_0x20b07f['length']>0x0||_0xe2a618[_0x3b74f4(0x1fb)]>0x0||_0x41eb6a[_0x3b74f4(0x1fb)]>0x0,_0x34abe4=_0x1ba4c3[_0x3b74f4(0x1fb)]>0x0||_0x446e99[_0x3b74f4(0x1fb)]>0x0||_0x3ad6ab[_0x3b74f4(0x1fb)]>0x0,_0x10f9d3=_0x3df165['journeysOnly']?![]:_0x6d6c86[_0x3b74f4(0x1fb)]>0x0,_0x14cf1e=_0x15a4b8[_0x3b74f4(0x1fb)]>0x0;if(!_0x257c22&&!_0x34abe4&&!_0x10f9d3&&!_0x14cf1e){const _0x1661af=_0x3df165[_0x3b74f4(0x22c)]?_0x3b74f4(0x234):_0x3b74f4(0x212);console['error'](a31_0x230a92['green'](_0x1661af));if(_0x330fae&&_0x342ea0[_0x3b74f4(0x1fb)]===0x1){const _0x356f1c=_0x342ea0[0x0];if(_0x356f1c[_0x3b74f4(0x1f1)]?.['id']){const _0x49120e=getConsoleNextUrl(_0x3df165['site'],_0x3b74f4(0x222)+_0x1c962d+'/e/'+_0x356f1c[_0x3b74f4(0x1f1)]['id']+'/j/da/je');console['error']('\x20\x20'+a31_0x230a92[_0x3b74f4(0x1f8)](_0x49120e));}}return 0x0;}const _0x34e980=_0x3df165['journeysOnly']?_0x1ba4c3[_0x3b74f4(0x1fb)]+_0x446e99['length']+_0x3ad6ab['length']+_0x15a4b8[_0x3b74f4(0x1fb)]:_0x20b07f[_0x3b74f4(0x1fb)]+_0xe2a618[_0x3b74f4(0x1fb)]+_0x41eb6a[_0x3b74f4(0x1fb)]+_0x1ba4c3[_0x3b74f4(0x1fb)]+_0x446e99['length']+_0x3ad6ab[_0x3b74f4(0x1fb)]+_0x15a4b8[_0x3b74f4(0x1fb)]+_0x6d6c86[_0x3b74f4(0x1fb)];if(!_0x3df165['yes']&&_0x34e980>0x0){if(!isInteractive())return console['error'](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x20f)),_0x3b74f4(0x24a)),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x24d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2e9816=await confirmKey(_0x3b74f4(0x277)+_0x34e980+_0x3b74f4(0x279));if(!_0x2e9816)return console[_0x3b74f4(0x22d)](a31_0x230a92['yellow'](_0x3b74f4(0x227))),0x1;}const _0x2f9ea2={'withProgress':async(_0x2a58bb,_0x3b4fa2)=>{const _0x8082b5=_0x3b74f4,_0xf2d17b=await withSpinner(_0x2a58bb,_0x3b4fa2,{'verbose':_0x3df165[_0x8082b5(0x20e)]});return{'data':_0xf2d17b[_0x8082b5(0x1fa)]};},'logInfo':_0x45970d=>console[_0x3b74f4(0x22d)](a31_0x230a92['blue']('✔\x20'+_0x45970d)),'logSuccess':_0x3b12d4=>console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x249)]('✔\x20'+_0x3b12d4)),'logWarning':_0x53df5=>console[_0x3b74f4(0x22d)](a31_0x230a92['yellow']('⚠\x20'+_0x53df5)),'logDeleted':_0xe10cf5=>console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)]('✔\x20'+_0xe10cf5))},_0x132933={'segment':_0xe4524a[_0x3b74f4(0x220)],'journey':_0xe4524a['journey'],'user':_0xe4524a[_0x3b74f4(0x27f)],'connection':_0xe4524a[_0x3b74f4(0x241)]};_0x15a4b8[_0x3b74f4(0x1fb)]>0x0&&(_0x1b61de=await executePushFolders(_0x132933,_0x15a4b8,_0x1b61de,{'parentId':_0x1c962d},_0x2f9ea2));const _0x5b37b1={'rootFolderId':_0x5e248e,'folderPathToId':_0x1b61de,'folderIdToPath':_0x5cc522,'segmentNameToId':_0x54716f,'activationsBySegmentId':_0x111401,'emailToIdMap':_0x390ca2,'idToEmailMap':_0x5c8a1d,'connectionNameToIdMap':_0x2a5fba['nameToId'],'connectionIdToNameMap':_0x2a5fba['idToName'],'connectionNameToTypeMap':_0x444a0d},_0x1bc268=await executePushSegments(_0x132933,_0x3df165[_0x3b74f4(0x22c)]?[]:_0x4d21d2,_0x5b37b1,{'parentId':_0x1c962d},_0x2f9ea2),_0x3b7410=_0x1bc268[_0x3b74f4(0x237)],_0x373da7=_0x1bc268[_0x3b74f4(0x280)],_0x473d97=_0x1bc268['activations'][_0x3b74f4(0x237)],_0x454cd6=_0x1bc268['activations']['updated'],_0x8caace=_0x1bc268[_0x3b74f4(0x281)]['deleted'],_0x194937=await executePushSegmentDeletions(_0x132933,_0x3df165[_0x3b74f4(0x22c)]?[]:_0x41eb6a,_0x2f9ea2);let _0x175534=0x0,_0x31a747=0x0,_0x51c9b2=0x0;const _0x1617d5=new Map(_0x54716f);for(const [_0x52288d,_0x2df6de]of _0x1bc268['createdSegmentIds']){_0x1617d5[_0x3b74f4(0x211)](_0x52288d,_0x2df6de);}if(_0x5ae990['length']>0x0){const _0x3fd428={..._0x5b37b1,'segmentNameToId':_0x1617d5,'existingSegments':_0x307374,'activationContext':_0x55e04a},_0x1eaea4=await executePushJourneys(_0x132933,_0x5ae990,_0x3fd428,{'parentId':_0x1c962d,'rootFolderId':_0x5e248e,'verbose':_0x3df165[_0x3b74f4(0x20e)]},_0x2f9ea2);_0x175534=_0x1eaea4['created'],_0x31a747=_0x1eaea4[_0x3b74f4(0x280)];if(_0x330fae&&_0x1eaea4['results'][_0x3b74f4(0x1fb)]===0x1){const _0x541bbb=_0x1eaea4['results'][0x0];if(_0x541bbb['journeyId']){const _0x9f36be=getConsoleNextUrl(_0x3df165['site'],_0x3b74f4(0x222)+_0x1c962d+_0x3b74f4(0x21d)+_0x541bbb[_0x3b74f4(0x1f7)]+_0x3b74f4(0x26b));console[_0x3b74f4(0x22d)]('\x20\x20'+a31_0x230a92[_0x3b74f4(0x1f8)](_0x9f36be));}}}for(const _0x1a4804 of _0x3ad6ab){console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x248)](_0x3b74f4(0x25d)+_0x1a4804[_0x3b74f4(0x215)])),_0x51c9b2++;}const _0x2fb2e2=[];if(_0x3b7410>0x0)_0x2fb2e2[_0x3b74f4(0x20d)](_0x3b7410+_0x3b74f4(0x27d));if(_0x373da7>0x0)_0x2fb2e2[_0x3b74f4(0x20d)](_0x373da7+_0x3b74f4(0x238));if(_0x194937>0x0)_0x2fb2e2[_0x3b74f4(0x20d)](_0x194937+_0x3b74f4(0x1f3));const _0x313747=[];if(_0x175534>0x0)_0x313747[_0x3b74f4(0x20d)](_0x175534+_0x3b74f4(0x27d));if(_0x31a747>0x0)_0x313747[_0x3b74f4(0x20d)](_0x31a747+_0x3b74f4(0x238));if(_0x51c9b2>0x0)_0x313747[_0x3b74f4(0x20d)](_0x51c9b2+_0x3b74f4(0x1f3));const _0x31c755=[];if(_0x473d97>0x0)_0x31c755[_0x3b74f4(0x20d)](_0x473d97+_0x3b74f4(0x27d));if(_0x454cd6>0x0)_0x31c755[_0x3b74f4(0x20d)](_0x454cd6+_0x3b74f4(0x238));if(_0x8caace>0x0)_0x31c755[_0x3b74f4(0x20d)](_0x8caace+_0x3b74f4(0x1f3));return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x249)]('\x0a✔\x20Push\x20complete')),_0x2fb2e2[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&console['error'](_0x3b74f4(0x228)+_0x2fb2e2[_0x3b74f4(0x27c)](',\x20')),_0x313747[_0x3b74f4(0x1fb)]>0x0&&console['error'](_0x3b74f4(0x244)+_0x313747[_0x3b74f4(0x27c)](',\x20')),_0x31c755[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&console[_0x3b74f4(0x22d)](_0x3b74f4(0x25c)+_0x31c755[_0x3b74f4(0x27c)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x162bfb=a32_0x16f6;(function(_0x21b138,_0x450533){const _0xf0a8ba=a32_0x16f6,_0x426930=_0x21b138();while(!![]){try{const _0x3c6386=-parseInt(_0xf0a8ba(0x1d6))/0x1*(parseInt(_0xf0a8ba(0x1b4))/0x2)+parseInt(_0xf0a8ba(0x1e1))/0x3+-parseInt(_0xf0a8ba(0x1c9))/0x4*(-parseInt(_0xf0a8ba(0x1b7))/0x5)+-parseInt(_0xf0a8ba(0x1ba))/0x6+-parseInt(_0xf0a8ba(0x1c3))/0x7*(-parseInt(_0xf0a8ba(0x1da))/0x8)+parseInt(_0xf0a8ba(0x1b6))/0x9+parseInt(_0xf0a8ba(0x1d0))/0xa*(-parseInt(_0xf0a8ba(0x1cf))/0xb);if(_0x3c6386===_0x450533)break;else _0x426930['push'](_0x426930['shift']());}catch(_0x2e970a){_0x426930['push'](_0x426930['shift']());}}}(a32_0x17f2,0x5aa4e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x17f2(){const _0x35707f=['10RvEthM','segmentName','ruleFile','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','data','segment','1CnYgqq','folder','yellow','parentId','8TxRBQI','Resolving\x20path\x20\x27','\x20\x20\x20Path:\x20','description','kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolved\x20folder\x20ID:\x20','783561coTUht','Resolved\x20relative\x20path\x20to:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','updateSegmentById','length','\x27...','Parent\x20ID:\x20','verbose','error','369506GGMvAG','segmentPath','6434721qJYhNF','40FOBCZJ','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','includes','3006000YNlwWt','segmentId','Error:\x20Cannot\x20update\x20','Update\x20existing\x20child\x20segment','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Examples:','Segment\x20ID:\x20','✔\x20Updated\x20segment\x20\x27','2910334cLdMyY','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','resolveFolderId','type','resolvePathToResource','name','260492TbxQUT','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:update','rule','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20type:\x20','9414581IKEMuc'];a32_0x17f2=function(){return _0x35707f;};return a32_0x17f2();}function a32_0x16f6(_0x5711e9,_0xc5f85c){_0x5711e9=_0x5711e9-0x1b4;const _0x17f2ca=a32_0x17f2();let _0x16f6f5=_0x17f2ca[_0x5711e9];return _0x16f6f5;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x5e5a28 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a32_0x162bfb(0x1c8)]=a32_0x162bfb(0x1cb);[a32_0x162bfb(0x1dd)]=a32_0x162bfb(0x1bd);async['execute'](_0x340825){const _0x5a8202=a32_0x162bfb;console[_0x5a8202(0x1e9)](a32_0x5e5a28[_0x5a8202(0x1d8)](_0x5a8202(0x1d3))),console[_0x5a8202(0x1e9)](a32_0x5e5a28['yellow'](_0x5a8202(0x1b8)));const {options:_0x3e6bc8,args:_0x5d5624,tdx:_0x59340e}=_0x340825,_0x130f1e=_0x3e6bc8;if(_0x5d5624[_0x5a8202(0x1e5)]===0x0)return console[_0x5a8202(0x1e9)](_0x5a8202(0x1ca)),console['error'](_0x5a8202(0x1c4)),console[_0x5a8202(0x1e9)](_0x5a8202(0x1c0)),console[_0x5a8202(0x1e9)](_0x5a8202(0x1df)),console[_0x5a8202(0x1e9)](_0x5a8202(0x1bf)),0x1;const _0x88bbcf=_0x5d5624[0x0],_0x1af1a2=_0x3e6bc8[_0x5a8202(0x1b5)];let _0x17ed11=_0x88bbcf;_0x1af1a2&&!_0x88bbcf[_0x5a8202(0x1b9)]('/')&&(_0x17ed11=_0x1af1a2+'/'+_0x88bbcf,_0x130f1e[_0x5a8202(0x1e8)]&&console['error'](_0x5a8202(0x1e2)+_0x17ed11));const _0x60a468=await withSpinner(_0x5a8202(0x1db)+_0x17ed11+'\x27...',()=>_0x59340e[_0x5a8202(0x1d5)][_0x5a8202(0x1c7)](_0x17ed11),{'verbose':_0x130f1e[_0x5a8202(0x1e8)]}),_0x40b39=_0x60a468['data'];_0x130f1e[_0x5a8202(0x1e8)]&&console[_0x5a8202(0x1e9)](_0x5a8202(0x1ce)+_0x40b39[_0x5a8202(0x1c6)]);if(_0x40b39[_0x5a8202(0x1c6)]!==_0x5a8202(0x1d5))return console[_0x5a8202(0x1e9)](_0x5a8202(0x1bc)+_0x40b39['type']+_0x5a8202(0x1cd)),console[_0x5a8202(0x1e9)](_0x5a8202(0x1e3)),0x1;if(!_0x40b39[_0x5a8202(0x1bb)])throw new SDKError(ErrorCode[_0x5a8202(0x1be)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x57708d=_0x40b39[_0x5a8202(0x1d9)],_0x1642cf=_0x40b39['segmentId'];_0x130f1e['verbose']&&(console[_0x5a8202(0x1e9)](_0x5a8202(0x1e7)+_0x57708d),console[_0x5a8202(0x1e9)](_0x5a8202(0x1c1)+_0x1642cf));let _0x55857d;if(_0x130f1e['folder']){const _0x21ac81=_0x130f1e[_0x5a8202(0x1d7)],_0x1d3f18=await withSpinner('Resolving\x20folder\x20\x27'+_0x21ac81+_0x5a8202(0x1e6),()=>_0x59340e['segment'][_0x5a8202(0x1c5)](_0x57708d,_0x21ac81),{'verbose':_0x130f1e[_0x5a8202(0x1e8)]});_0x55857d=parseInt(_0x1d3f18[_0x5a8202(0x1d4)],0xa),_0x130f1e['verbose']&&console[_0x5a8202(0x1e9)](_0x5a8202(0x1e0)+_0x55857d);}const _0x24734b=await loadJSONFromOptions(_0x130f1e[_0x5a8202(0x1cc)],_0x130f1e[_0x5a8202(0x1d2)]),_0x25ee19={'name':_0x130f1e[_0x5a8202(0x1c8)],'description':_0x130f1e[_0x5a8202(0x1dd)],'rule':_0x24734b,'kind':_0x130f1e[_0x5a8202(0x1de)]!==undefined?parseInt(_0x130f1e[_0x5a8202(0x1de)],0xa):undefined,'segmentFolderId':_0x55857d},_0x1137af=await withSpinner('Updating\x20segment\x20\x27'+_0x40b39[_0x5a8202(0x1d1)]+_0x5a8202(0x1e6),()=>_0x59340e[_0x5a8202(0x1d5)][_0x5a8202(0x1e4)](_0x57708d,_0x1642cf,_0x25ee19),{'verbose':_0x130f1e[_0x5a8202(0x1e8)]}),_0x3038f7=_0x1137af['data'];return console[_0x5a8202(0x1e9)](_0x5a8202(0x1c2)+_0x3038f7[_0x5a8202(0x1c8)]+'\x27'),_0x17ed11!==_0x88bbcf&&console[_0x5a8202(0x1e9)](_0x5a8202(0x1dc)+_0x17ed11),await handleSDKOutput([_0x3038f7],_0x130f1e),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x330d2a=a33_0x5aef;function a33_0x5aef(_0xb285,_0x8f43b3){_0xb285=_0xb285-0x198;const _0x25bbcb=a33_0x25bb();let _0x5aef1e=_0x25bbcb[_0xb285];return _0x5aef1e;}(function(_0xea7ed8,_0x138f5a){const _0x28a8ec=a33_0x5aef,_0x3f3636=_0xea7ed8();while(!![]){try{const _0x2abf3e=-parseInt(_0x28a8ec(0x1ad))/0x1+parseInt(_0x28a8ec(0x1a1))/0x2+-parseInt(_0x28a8ec(0x1c5))/0x3+parseInt(_0x28a8ec(0x1c6))/0x4+-parseInt(_0x28a8ec(0x1c8))/0x5+-parseInt(_0x28a8ec(0x19a))/0x6+parseInt(_0x28a8ec(0x1a5))/0x7;if(_0x2abf3e===_0x138f5a)break;else _0x3f3636['push'](_0x3f3636['shift']());}catch(_0x2a2971){_0x3f3636['push'](_0x3f3636['shift']());}}}(a33_0x25bb,0x6cdad));function a33_0x25bb(){const _0x415eed=['fullPath','segments','parentId','Resolving\x20path\x20\x27','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','dim','Folder\x20ID:\x20','error','segmentPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20Path\x20is\x20required\x0a','Target\x20path:\x20','execute','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','parentName','folderPath','log','2462400hyAfpg','1248208pQKRYH','folderId','1625810ektaAo','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','segment','type','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolved\x20path\x20type:\x20','resolvePathToResource','✔\x20Context\x20set\x20to:\x20','4695702vmggNc','description','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x27...','join','cyan','verbose','988352FqLiRl','isDirectory','Site:\x20','name','12672884cvrHLz','length','split','Resolved\x20relative\x20path\x20to:\x20','Parent\x20ID:\x20','green','parent_segment','slice','242192opHZex','Usage:\x20tdx\x20segment\x20use\x20<path>','isAbsolute','red'];a33_0x25bb=function(){return _0x415eed;};return a33_0x25bb();}import{existsSync,statSync}from'fs';import a33_0x55fdc6 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x330d2a(0x1a4)]='segment:use';[a33_0x330d2a(0x19b)]=a33_0x330d2a(0x1b6);async[a33_0x330d2a(0x1bf)](_0x1b39b1){const _0x28fa37=a33_0x330d2a,{options:_0x5cd50a,args:_0xf4dbfc,tdx:_0x46727a}=_0x1b39b1;if(_0xf4dbfc['length']===0x0)return console['error'](a33_0x55fdc6[_0x28fa37(0x1b0)](_0x28fa37(0x1bd))),console[_0x28fa37(0x1b9)](_0x28fa37(0x1ae)),console[_0x28fa37(0x1b9)]('Examples:'),console[_0x28fa37(0x1b9)](_0x28fa37(0x1c9)),console[_0x28fa37(0x1b9)](_0x28fa37(0x1bb)),console['error'](_0x28fa37(0x1ca)),console[_0x28fa37(0x1b9)](_0x28fa37(0x1c0)),0x1;const _0x55cd29=_0xf4dbfc[0x0],_0x130137=_0x5cd50a['session'];try{if(_0x55cd29==='/')return saveSessionContext({'segment_path':undefined},_0x130137),console[_0x28fa37(0x1c4)](a33_0x55fdc6[_0x28fa37(0x1aa)](_0x28fa37(0x1bc))),0x0;if(existsSync(_0x55cd29)&&statSync(_0x55cd29)[_0x28fa37(0x1a2)]()){let _0x29b3f5;try{_0x29b3f5=findTdxConfig(_0x55cd29);}catch{return console['error'](a33_0x55fdc6[_0x28fa37(0x1b0)](_0x28fa37(0x19c)+_0x55cd29)),console[_0x28fa37(0x1b9)](a33_0x55fdc6[_0x28fa37(0x19f)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x386566=_0x29b3f5['config'][_0x28fa37(0x1ab)];return saveSessionContext({'segment_path':_0x386566,'parent_segment':_0x386566},_0x130137),console[_0x28fa37(0x1c4)](a33_0x55fdc6[_0x28fa37(0x1aa)](_0x28fa37(0x199)+a33_0x55fdc6[_0x28fa37(0x19f)](_0x386566))),0x0;}const _0x3f452c=_0x5cd50a[_0x28fa37(0x1ba)];let _0x2fe030=_0x55cd29;const _0x57ead0=parsePath(_0x55cd29);if(!_0x57ead0[_0x28fa37(0x1af)]){if(!_0x3f452c)return console[_0x28fa37(0x1b9)](a33_0x55fdc6[_0x28fa37(0x1b0)](_0x28fa37(0x1b5))),console[_0x28fa37(0x1b9)](a33_0x55fdc6['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x55cd29==='..'){const _0x29f534=_0x3f452c[_0x28fa37(0x1a7)]('/')[_0x28fa37(0x1ac)](0x0,-0x1)['join']('/');_0x2fe030=_0x29f534||'/';}else _0x55cd29==='.'?_0x2fe030=_0x3f452c:_0x2fe030=_0x3f452c+'/'+_0x55cd29;_0x5cd50a['verbose']&&console[_0x28fa37(0x1b9)](_0x28fa37(0x1a8)+_0x2fe030);}if(_0x2fe030==='/'||_0x2fe030==='')return saveSessionContext({'segment_path':undefined},_0x130137),console[_0x28fa37(0x1c4)](a33_0x55fdc6[_0x28fa37(0x1aa)](_0x28fa37(0x1bc))),0x0;_0x2fe030=normalizePath(_0x2fe030);const _0x1a86ee=parsePath(_0x2fe030)[_0x28fa37(0x1b2)];if(_0x1a86ee[_0x28fa37(0x1a6)]===0x0)return saveSessionContext({'segment_path':undefined},_0x130137),console[_0x28fa37(0x1c4)](a33_0x55fdc6[_0x28fa37(0x1aa)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x5cd50a[_0x28fa37(0x1a0)]&&(console[_0x28fa37(0x1b9)](_0x28fa37(0x1a3)+_0x5cd50a['site']),console[_0x28fa37(0x1b9)](_0x28fa37(0x1be)+_0x2fe030));const _0x1cabb6=await withSpinner(_0x28fa37(0x1b4)+_0x2fe030+_0x28fa37(0x19d),()=>_0x46727a[_0x28fa37(0x1cb)][_0x28fa37(0x198)](_0x2fe030),{'verbose':_0x5cd50a[_0x28fa37(0x1a0)]}),_0x40c624=_0x1cabb6['data'];_0x5cd50a['verbose']&&(console[_0x28fa37(0x1b9)](_0x28fa37(0x1ce)+_0x40c624[_0x28fa37(0x1cc)]),console[_0x28fa37(0x1b9)](_0x28fa37(0x1a9)+_0x40c624[_0x28fa37(0x1b3)]),_0x40c624['folderId']&&console[_0x28fa37(0x1b9)](_0x28fa37(0x1b8)+_0x40c624[_0x28fa37(0x1c7)]));if(_0x40c624[_0x28fa37(0x1cc)]==='segment')return console[_0x28fa37(0x1b9)](a33_0x55fdc6['red'](_0x28fa37(0x1c1))),console[_0x28fa37(0x1b9)](_0x28fa37(0x1cd)),console['error'](a33_0x55fdc6[_0x28fa37(0x19f)]('Use:\x20tdx\x20segment\x20use\x20'+_0x40c624[_0x28fa37(0x1c2)]+(_0x40c624[_0x28fa37(0x1c3)]?'/'+_0x40c624['folderPath'][_0x28fa37(0x19e)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x40c624[_0x28fa37(0x1b1)],'parent_segment':_0x40c624[_0x28fa37(0x1c2)]},_0x130137),console[_0x28fa37(0x1c4)](a33_0x55fdc6['green'](_0x28fa37(0x199)+a33_0x55fdc6[_0x28fa37(0x19f)](_0x40c624[_0x28fa37(0x1b1)]))),_0x5cd50a['verbose']&&(console[_0x28fa37(0x1b9)](a33_0x55fdc6[_0x28fa37(0x1b7)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x28fa37(0x1b9)](a33_0x55fdc6[_0x28fa37(0x1b7)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x3d9c53){throw _0x3d9c53;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x4022(_0x1881ab,_0x715f3e){_0x1881ab=_0x1881ab-0xf3;const _0xa65b63=a34_0xa65b();let _0x4022d1=_0xa65b63[_0x1881ab];return _0x4022d1;}const a34_0x5b933a=a34_0x4022;(function(_0x397356,_0x365dc3){const _0x3e8641=a34_0x4022,_0x32d2ab=_0x397356();while(!![]){try{const _0x14001c=parseInt(_0x3e8641(0x125))/0x1*(parseInt(_0x3e8641(0x106))/0x2)+-parseInt(_0x3e8641(0x11c))/0x3+-parseInt(_0x3e8641(0x104))/0x4*(parseInt(_0x3e8641(0x105))/0x5)+-parseInt(_0x3e8641(0x103))/0x6+-parseInt(_0x3e8641(0x120))/0x7*(-parseInt(_0x3e8641(0x118))/0x8)+-parseInt(_0x3e8641(0x119))/0x9*(parseInt(_0x3e8641(0xf7))/0xa)+parseInt(_0x3e8641(0x11d))/0xb;if(_0x14001c===_0x365dc3)break;else _0x32d2ab['push'](_0x32d2ab['shift']());}catch(_0x310a14){_0x32d2ab['push'](_0x32d2ab['shift']());}}}(a34_0xa65b,0xe16e0));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a34_0x4c1bf0 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a34_0xa65b(){const _0x3b6d51=['1004122QGhdVp','green','valid','log','filePath','10gOxfmw','.yml','endsWith','segment:validate','validCount','7170290JZXKbd','errors','dim','\x20valid','cwd','warnings','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','helpText','Error:\x20','\x20error(s)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','8856396TtKOay','44GTiRGV','192235ehZTLQ','285148doqZrV','file','Validate\x20segment\x20and\x20journey\x20YAML\x20files','invalidCount','Error:\x20Directory\x20not\x20found:\x20','\x20file(s)\x20with\x20errors,\x20','description','warningCount','length','\x20warning(s)\x20found','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','execute','):\x20','cyan','red','parentSegment','targetDir','64knHoKz','9NzyAPc','error','\x20warning(s)','3720960TkHbtl','24270224CCCSlp','message','yellow'];a34_0xa65b=function(){return _0x3b6d51;};return a34_0xa65b();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a34_0x5b933a(0xf5);[a34_0x5b933a(0x10c)]=a34_0x5b933a(0x108);async[a34_0x5b933a(0x112)](_0x4d819f){const _0x160913=a34_0x5b933a,{options:_0xab3a9c,args:_0x5c6896}=_0x4d819f,_0x2c0f8f=_0xab3a9c,_0x5ac776=await resolveTarget({'arg':_0x5c6896[0x0],'contextParent':_0xab3a9c[_0x160913(0x116)],'cwd':process[_0x160913(0xfb)]()});if(!isSuccessfulResolution(_0x5ac776))return _0x5ac776['errorCode']==='no_parent'?(console[_0x160913(0x11a)](a34_0x4c1bf0[_0x160913(0x11f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x160913(0xfd)),console['error'](_0x160913(0x110)),console[_0x160913(0x11a)](_0x160913(0x101))):(console[_0x160913(0x11a)](a34_0x4c1bf0['red'](_0x160913(0xff)+_0x5ac776[_0x160913(0x11e)]+'\x0a')),_0x5ac776[_0x160913(0xfe)]&&console[_0x160913(0x11a)](a34_0x4c1bf0[_0x160913(0x114)](_0x5ac776[_0x160913(0xfe)]))),0x1;const _0x4dd679=_0x5ac776[_0x160913(0x117)],_0x415304=_0x5ac776['type']===_0x160913(0x107)?_0x5ac776[_0x160913(0x124)]:undefined;if(!_0x415304&&!existsSync(_0x4dd679))return console[_0x160913(0x11a)](a34_0x4c1bf0['red'](_0x160913(0x10a)+_0x4dd679+'\x0a')),0x1;let _0x53b196;if(_0x415304){if(!_0x415304['endsWith'](_0x160913(0xf3))&&!_0x415304[_0x160913(0xf4)]('.yaml'))return console[_0x160913(0x11a)](a34_0x4c1bf0[_0x160913(0x115)](_0x160913(0x111)+_0x415304+'\x0a')),0x1;_0x53b196=[_0x415304];}else _0x53b196=findYamlFiles(_0x4dd679);if(_0x53b196[_0x160913(0x10e)]===0x0)return console[_0x160913(0x11a)](a34_0x4c1bf0[_0x160913(0x115)](_0x160913(0x102)+_0x4dd679+'\x0a')),0x1;const _0x3e81eb=validateYamlFiles(_0x53b196,_0x4dd679),_0x406a93=calculateSummary(_0x3e81eb);for(const _0x24229e of _0x3e81eb){if(!isValidationResult(_0x24229e))continue;const {relativePath:_0x5a8b5d,source:_0x5da1c8,result:_0x1a4d73,fileType:_0x2e6b2c}=_0x24229e,_0x11e0a9=_0x2e6b2c;if(_0x1a4d73[_0x160913(0x122)]&&_0x1a4d73[_0x160913(0xfc)][_0x160913(0x10e)]===0x0)_0x2c0f8f['verbose']&&console['log'](a34_0x4c1bf0[_0x160913(0x121)]('✔\x20'+_0x5a8b5d)+a34_0x4c1bf0[_0x160913(0xf9)]('\x20('+_0x11e0a9+')'));else _0x1a4d73['valid']?(console[_0x160913(0x123)](a34_0x4c1bf0[_0x160913(0x11f)]('⚠\x20'+_0x5a8b5d)+a34_0x4c1bf0[_0x160913(0xf9)]('\x20('+_0x11e0a9+_0x160913(0x113)+_0x1a4d73[_0x160913(0xfc)][_0x160913(0x10e)]+_0x160913(0x11b))),console['log'](formatValidationResult(_0x1a4d73,_0x5da1c8,_0x5a8b5d))):(console['log'](a34_0x4c1bf0[_0x160913(0x115)]('✖\x20'+_0x5a8b5d)+a34_0x4c1bf0['dim']('\x20('+_0x11e0a9+_0x160913(0x113)+_0x1a4d73[_0x160913(0xf8)][_0x160913(0x10e)]+_0x160913(0x100))),console[_0x160913(0x123)](formatValidationResult(_0x1a4d73,_0x5da1c8,_0x5a8b5d)));}return console[_0x160913(0x123)](''),_0x406a93['hasErrors']?(console['log'](a34_0x4c1bf0['red']('Validation\x20failed:\x20'+_0x406a93[_0x160913(0x109)]+_0x160913(0x10b)+_0x406a93[_0x160913(0xf6)]+_0x160913(0xfa))),_0x406a93[_0x160913(0x10d)]>0x0&&console[_0x160913(0x123)](a34_0x4c1bf0[_0x160913(0x11f)](_0x406a93[_0x160913(0x10d)]+_0x160913(0x10f))),0x1):(console['log'](a34_0x4c1bf0[_0x160913(0x121)]('✔\x20All\x20'+_0x406a93[_0x160913(0xf6)]+'\x20file(s)\x20valid')),_0x406a93['warningCount']>0x0&&console[_0x160913(0x123)](a34_0x4c1bf0[_0x160913(0x11f)](_0x406a93[_0x160913(0x10d)]+'\x20warning(s)\x20found')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x5252ea=a36_0x4be0;(function(_0x2b3f1a,_0xf00543){const _0x316dad=a36_0x4be0,_0x2f6466=_0x2b3f1a();while(!![]){try{const _0x2ab8f0=parseInt(_0x316dad(0xa8))/0x1*(parseInt(_0x316dad(0x93))/0x2)+parseInt(_0x316dad(0x7d))/0x3*(-parseInt(_0x316dad(0x73))/0x4)+parseInt(_0x316dad(0xa9))/0x5+-parseInt(_0x316dad(0x8e))/0x6*(-parseInt(_0x316dad(0x8c))/0x7)+-parseInt(_0x316dad(0x82))/0x8*(-parseInt(_0x316dad(0x90))/0x9)+parseInt(_0x316dad(0x7a))/0xa+-parseInt(_0x316dad(0x9f))/0xb;if(_0x2ab8f0===_0xf00543)break;else _0x2f6466['push'](_0x2f6466['shift']());}catch(_0x4b4041){_0x2f6466['push'](_0x2f6466['shift']());}}}(a36_0x4a40,0xef084));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 a36_0x4a40(){const _0xa6dc9=['replace','\x20\x20Cause:\x20','\x20folder','journeys','includes','Folder/pattern\x20arg:\x20','segments','type','sort','segment','journeyBundleName','test','folderId','site','maxDepth','execute','recursive','268484QqIMFt','children','Folder\x20ID:\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Parent\x20ID:\x20','journey','json','9658940MAGxOF','listUnified','jsonl','60nXeLRK','name','Listing\x20folders,\x20segments,\x20and\x20journeys...','Error:\x20','Recursive\x20mode:\x20enabled','676376XnVBBx','Resolving\x20parent\x20segment\x20\x27','/app/ps/','Resolving\x20path\x20\x27','Building\x20hierarchy\x20tree...','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20segment','log',',\x20and\x20','verbose','1019753iEUNTY','parentId','66yKHWkA','List\x20folders\x20and\x20child\x20segments','63YNeMjN','Parent\x20segment\x20context:\x20','resolvePathToResource','3160348ymYQIz','localeCompare','/e/','✔\x20Found\x20','error','message','No\x20items\x20match\x20pattern:\x20','data','format','folder','listUnifiedWithJourneys','filter','30437341AqYfJq','folders','length','map','/j/da','\x27...','dim','parentSegment','listRecursive','1DhaRqj','1740805cuthSQ','\x20matching\x20\x27','(not\x20set)','\x20journey'];a36_0x4a40=function(){return _0xa6dc9;};return a36_0x4a40();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a36_0x4be0(_0x27d9c6,_0x197f75){_0x27d9c6=_0x27d9c6-0x6d;const _0x4a4040=a36_0x4a40();let _0x4be0c5=_0x4a4040[_0x27d9c6];return _0x4be0c5;}import a36_0x1b5a13 from'chalk';export class SegmentsCommand extends BaseCommand{[a36_0x5252ea(0x7e)]='segments';['description']=a36_0x5252ea(0x8f);async[a36_0x5252ea(0x71)](_0x11b8bc){const _0x30cb90=a36_0x5252ea,{options:_0x414f2d,args:_0x3b5310}=_0x11b8bc,_0xcd34ec=_0x414f2d[_0x30cb90(0x72)],_0x5ae508=_0x3b5310[0x0];try{const _0xd4ec02=_0x414f2d[_0x30cb90(0xa6)];_0x414f2d['verbose']&&(console[_0x30cb90(0x97)]('Site:\x20'+_0x414f2d[_0x30cb90(0x6f)]),console['error'](_0x30cb90(0x91)+(_0xd4ec02||_0x30cb90(0xab))),_0x5ae508&&console[_0x30cb90(0x97)](_0x30cb90(0xb2)+_0x5ae508),_0xcd34ec&&console[_0x30cb90(0x97)](_0x30cb90(0x81)));if(!_0xd4ec02)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x30cb90(0x97)](''),console[_0x30cb90(0x97)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x30cb90(0x97)](_0x30cb90(0x87)),console[_0x30cb90(0x97)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console['error'](''),console[_0x30cb90(0x97)](_0x30cb90(0x76)),0x1;const _0x104c08=_0x5ae508&&(_0x5ae508[_0x30cb90(0xb1)]('*')||_0x5ae508[_0x30cb90(0xb1)]('?'));if(_0x104c08)return await this['listWithPattern'](_0x11b8bc,_0xd4ec02,_0x5ae508);const _0x1c337c=_0x5ae508?_0xd4ec02+'/'+_0x5ae508:_0xd4ec02;return _0xcd34ec?await this[_0x30cb90(0xa7)](_0x11b8bc,_0x1c337c):await this[_0x30cb90(0x7b)](_0x11b8bc,_0x1c337c);}catch(_0x524c1c){if(_0x524c1c instanceof SDKError)return console[_0x30cb90(0x97)](_0x30cb90(0x80)+_0x524c1c[_0x30cb90(0x98)]),_0x524c1c['cause']&&console['error'](_0x30cb90(0xae)+_0x524c1c['cause']),0x1;throw _0x524c1c;}}async['listWithPattern'](_0x1f63d0,_0x1f41a3,_0x158f02){const _0x57d117=a36_0x5252ea,{options:_0x6391a6,tdx:_0x717085}=_0x1f63d0,_0xedb84e=await withSpinner(_0x57d117(0x83)+_0x1f41a3+_0x57d117(0xa4),()=>_0x717085['segment'][_0x57d117(0x92)](_0x1f41a3),{'verbose':_0x6391a6[_0x57d117(0x8b)]}),_0x5411cb=_0xedb84e[_0x57d117(0x9a)],_0x1b03f3=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x717085[_0x57d117(0xb6)][_0x57d117(0x9d)](_0x5411cb[_0x57d117(0x8d)],_0x5411cb[_0x57d117(0x6e)]),{'verbose':_0x6391a6[_0x57d117(0x8b)]}),{folders:_0x7bf7b7,segments:_0x383ebd,journeys:_0x563cb9}=_0x1b03f3[_0x57d117(0x9a)],_0xefb30=_0x158f02[_0x57d117(0xad)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x57d117(0xad)](/\?/g,'.'),_0x301517=new RegExp('^'+_0xefb30+'$','i'),_0x231e70=_0x7bf7b7[_0x57d117(0x9e)](_0x12a0db=>_0x301517[_0x57d117(0x6d)](_0x12a0db[_0x57d117(0x7e)])),_0x46ef73=_0x383ebd[_0x57d117(0x9e)](_0x29fc96=>_0x301517[_0x57d117(0x6d)](_0x29fc96[_0x57d117(0x7e)])),_0x3f22c2=_0x563cb9[_0x57d117(0x9e)](_0x4dcd64=>_0x301517[_0x57d117(0x6d)](_0x4dcd64[_0x57d117(0xb7)])),_0x122173=_0x231e70[_0x57d117(0xa1)]+_0x46ef73[_0x57d117(0xa1)]+_0x3f22c2[_0x57d117(0xa1)];console[_0x57d117(0x97)](_0x57d117(0x96)+_0x231e70['length']+_0x57d117(0xaf)+(_0x231e70[_0x57d117(0xa1)]!==0x1?'s':'')+',\x20'+_0x46ef73[_0x57d117(0xa1)]+_0x57d117(0x88)+(_0x46ef73[_0x57d117(0xa1)]!==0x1?'s':'')+_0x57d117(0x8a)+_0x3f22c2[_0x57d117(0xa1)]+_0x57d117(0xac)+(_0x3f22c2['length']!==0x1?'s':'')+_0x57d117(0xaa)+_0x158f02+'\x27');const _0xb8be9c=_0x148e84=>{const _0x35de88=_0x57d117;return getConsoleNextUrl(_0x6391a6[_0x35de88(0x6f)],'/app/ps/'+_0x5411cb['parentId']+'/e/'+_0x148e84);},_0x1a95d6=_0x6391a6[_0x57d117(0x9b)]===_0x57d117(0x79)||_0x6391a6[_0x57d117(0x9b)]===_0x57d117(0x7c);if(_0x1a95d6){const _0x5db3a0=[..._0x231e70[_0x57d117(0xa2)](_0x2b2a8d=>({..._0x2b2a8d,'type':_0x57d117(0x9c)})),..._0x46ef73[_0x57d117(0xa2)](_0x575951=>({..._0x575951,'type':_0x57d117(0xb6),'url':_0xb8be9c(_0x575951['id'])})),..._0x3f22c2['map'](_0x5dbe41=>({..._0x5dbe41,'name':_0x5dbe41[_0x57d117(0xb7)],'type':_0x57d117(0x78)}))][_0x57d117(0xb5)]((_0x8f027d,_0x425baf)=>_0x8f027d[_0x57d117(0x7e)][_0x57d117(0x94)](_0x425baf['name']));await handleSDKOutput(_0x5db3a0,_0x6391a6);}else{if(_0x122173===0x0)console['log'](_0x57d117(0x99)+_0x158f02);else{console[_0x57d117(0x89)](a36_0x1b5a13[_0x57d117(0xa5)]('['+_0x1f41a3+']\x20matching\x20\x27'+_0x158f02+'\x27'));const _0x1969d8=formatFlatList(_0x231e70,_0x46ef73,{'showMetadata':!![],'getSegmentUrl':_0xb8be9c},_0x3f22c2);console['log'](_0x1969d8);}}return 0x0;}async[a36_0x5252ea(0x7b)](_0x49e2e6,_0x1cc660){const _0x5d2b6b=a36_0x5252ea,{options:_0x59b113,tdx:_0x699529}=_0x49e2e6,_0x55db01=await withSpinner('Resolving\x20path\x20\x27'+_0x1cc660+_0x5d2b6b(0xa4),()=>_0x699529[_0x5d2b6b(0xb6)]['resolvePathToResource'](_0x1cc660),{'verbose':_0x59b113[_0x5d2b6b(0x8b)]}),_0x562462=_0x55db01[_0x5d2b6b(0x9a)];_0x59b113[_0x5d2b6b(0x8b)]&&(console[_0x5d2b6b(0x97)](_0x5d2b6b(0x77)+_0x562462[_0x5d2b6b(0x8d)]),_0x562462['folderId']&&console[_0x5d2b6b(0x97)](_0x5d2b6b(0x75)+_0x562462[_0x5d2b6b(0x6e)]));const _0x151090=await withSpinner(_0x5d2b6b(0x7f),()=>_0x699529['segment'][_0x5d2b6b(0x9d)](_0x562462[_0x5d2b6b(0x8d)],_0x562462[_0x5d2b6b(0x6e)]),{'verbose':_0x59b113['verbose']}),{folders:_0x330178,segments:_0x2dcd37,journeys:_0xe96d4e}=_0x151090[_0x5d2b6b(0x9a)],_0x26b0b6=_0x330178[_0x5d2b6b(0xa1)]+_0x2dcd37[_0x5d2b6b(0xa1)]+_0xe96d4e[_0x5d2b6b(0xa1)];console[_0x5d2b6b(0x97)](_0x5d2b6b(0x96)+_0x330178[_0x5d2b6b(0xa1)]+_0x5d2b6b(0xaf)+(_0x330178[_0x5d2b6b(0xa1)]!==0x1?'s':'')+',\x20'+_0x2dcd37['length']+_0x5d2b6b(0x88)+(_0x2dcd37[_0x5d2b6b(0xa1)]!==0x1?'s':'')+_0x5d2b6b(0x8a)+_0xe96d4e['length']+_0x5d2b6b(0xac)+(_0xe96d4e[_0x5d2b6b(0xa1)]!==0x1?'s':''));const _0x3ebcee=_0x4ad47c=>{const _0x923d2d=_0x5d2b6b;return getConsoleNextUrl(_0x59b113[_0x923d2d(0x6f)],_0x923d2d(0x84)+_0x562462[_0x923d2d(0x8d)]+'/e/'+_0x4ad47c);},_0x5d88f6=_0x67b2fd=>{const _0x84dc7e=_0x5d2b6b;return getConsoleNextUrl(_0x59b113[_0x84dc7e(0x6f)],'/app/ps/'+_0x562462['parentId']+_0x84dc7e(0x95)+_0x67b2fd+_0x84dc7e(0xa3));},_0x3dc441=_0x59b113['format']===_0x5d2b6b(0x79)||_0x59b113[_0x5d2b6b(0x9b)]===_0x5d2b6b(0x7c);if(_0x3dc441){const _0x1dd8c6=[..._0x330178[_0x5d2b6b(0xa2)](_0x28b48c=>({..._0x28b48c,'type':_0x5d2b6b(0x9c)})),..._0x2dcd37[_0x5d2b6b(0xa2)](_0x536435=>({..._0x536435,'type':_0x5d2b6b(0xb6),'url':_0x3ebcee(_0x536435['id'])})),..._0xe96d4e['map'](_0x42c080=>({..._0x42c080,'name':_0x42c080[_0x5d2b6b(0xb7)],'type':_0x5d2b6b(0x78),'url':_0x5d88f6(_0x42c080['id'])}))][_0x5d2b6b(0xb5)]((_0x49f41d,_0x1926f7)=>_0x49f41d[_0x5d2b6b(0x7e)][_0x5d2b6b(0x94)](_0x1926f7[_0x5d2b6b(0x7e)]));await handleSDKOutput(_0x1dd8c6,_0x59b113);}else{if(_0x26b0b6===0x0)console['log'](a36_0x1b5a13[_0x5d2b6b(0xa5)]('['+_0x1cc660+']')),console[_0x5d2b6b(0x89)]('(empty)');else{console['log'](a36_0x1b5a13[_0x5d2b6b(0xa5)]('['+_0x1cc660+']'));const _0x3cc6b8=formatFlatList(_0x330178,_0x2dcd37,{'showMetadata':!![],'getSegmentUrl':_0x3ebcee,'getJourneyUrl':_0x5d88f6},_0xe96d4e);console['log'](_0x3cc6b8);}}return 0x0;}async[a36_0x5252ea(0xa7)](_0x3036b2,_0x396fcf){const _0x1f6d6e=a36_0x5252ea,{options:_0x19172a,tdx:_0x5541e8}=_0x3036b2,_0x324c66=await withSpinner(_0x1f6d6e(0x85)+_0x396fcf+_0x1f6d6e(0xa4),()=>_0x5541e8[_0x1f6d6e(0xb6)][_0x1f6d6e(0x92)](_0x396fcf),{'verbose':_0x19172a[_0x1f6d6e(0x8b)]}),_0x3c2879=_0x324c66[_0x1f6d6e(0x9a)];_0x19172a['verbose']&&(console[_0x1f6d6e(0x97)](_0x1f6d6e(0x77)+_0x3c2879[_0x1f6d6e(0x8d)]),_0x3c2879[_0x1f6d6e(0x6e)]&&console['error'](_0x1f6d6e(0x75)+_0x3c2879['folderId']));const _0x425924=_0x19172a[_0x1f6d6e(0x70)]||0xa,_0xa4b6ae=await withSpinner(_0x1f6d6e(0x86),()=>_0x5541e8[_0x1f6d6e(0xb6)]['listRecursive'](_0x3c2879[_0x1f6d6e(0x8d)],_0x3c2879[_0x1f6d6e(0x6e)],0x0,_0x425924),{'verbose':_0x19172a[_0x1f6d6e(0x8b)]}),_0x209c51=_0xa4b6ae[_0x1f6d6e(0x9a)],_0x337073=_0x2e08d7=>{const _0x526bb6=_0x1f6d6e;let _0x1ba220=0x0,_0x589314=0x0,_0x2655ad=0x0;for(const _0x30a44d of _0x2e08d7){if(_0x30a44d[_0x526bb6(0xb4)]==='folder')_0x1ba220++;else{if(_0x30a44d[_0x526bb6(0xb4)]===_0x526bb6(0xb6))_0x589314++;else{if(_0x30a44d['type']===_0x526bb6(0x78))_0x2655ad++;}}if(_0x30a44d[_0x526bb6(0x74)]){const _0x4b7256=_0x337073(_0x30a44d[_0x526bb6(0x74)]);_0x1ba220+=_0x4b7256['folders'],_0x589314+=_0x4b7256['segments'],_0x2655ad+=_0x4b7256[_0x526bb6(0xb0)];}}return{'folders':_0x1ba220,'segments':_0x589314,'journeys':_0x2655ad};},_0x54766a=_0x337073(_0x209c51);console[_0x1f6d6e(0x97)]('✔\x20Built\x20tree\x20with\x20'+_0x54766a[_0x1f6d6e(0xa0)]+'\x20folder'+(_0x54766a[_0x1f6d6e(0xa0)]!==0x1?'s':'')+',\x20'+_0x54766a[_0x1f6d6e(0xb3)]+_0x1f6d6e(0x88)+(_0x54766a['segments']!==0x1?'s':'')+_0x1f6d6e(0x8a)+_0x54766a[_0x1f6d6e(0xb0)]+_0x1f6d6e(0xac)+(_0x54766a['journeys']!==0x1?'s':''));const _0x2a75dd=_0x41a5de=>{const _0x45dfa9=_0x1f6d6e;return getConsoleNextUrl(_0x19172a[_0x45dfa9(0x6f)],'/app/ps/'+_0x3c2879[_0x45dfa9(0x8d)]+_0x45dfa9(0x95)+_0x41a5de);},_0x229490=_0x5c5e00=>{const _0x21b1a0=_0x1f6d6e;return getConsoleNextUrl(_0x19172a[_0x21b1a0(0x6f)],_0x21b1a0(0x84)+_0x3c2879[_0x21b1a0(0x8d)]+_0x21b1a0(0x95)+_0x5c5e00+_0x21b1a0(0xa3));};if(_0x19172a[_0x1f6d6e(0x9b)]==='json'||_0x19172a[_0x1f6d6e(0x9b)]===_0x1f6d6e(0x7c))await handleSDKOutput(_0x209c51,_0x19172a);else{console[_0x1f6d6e(0x89)](a36_0x1b5a13[_0x1f6d6e(0xa5)]('['+_0x396fcf+']'));const _0x549dcf=formatTree(_0x209c51,{'showMetadata':!![],'getSegmentUrl':_0x2a75dd,'getJourneyUrl':_0x229490});console[_0x1f6d6e(0x89)](_0x549dcf);}return 0x0;}}
|
|
1
|
+
const a35_0x3cb72f=a35_0x17e6;(function(_0x2f29c9,_0x433284){const _0x3e4890=a35_0x17e6,_0x21f7cd=_0x2f29c9();while(!![]){try{const _0x45537d=-parseInt(_0x3e4890(0xfd))/0x1+parseInt(_0x3e4890(0xc8))/0x2*(parseInt(_0x3e4890(0xc7))/0x3)+-parseInt(_0x3e4890(0xd2))/0x4*(parseInt(_0x3e4890(0xda))/0x5)+-parseInt(_0x3e4890(0xbb))/0x6+parseInt(_0x3e4890(0xe7))/0x7+parseInt(_0x3e4890(0xc5))/0x8+-parseInt(_0x3e4890(0xd7))/0x9;if(_0x45537d===_0x433284)break;else _0x21f7cd['push'](_0x21f7cd['shift']());}catch(_0x2344db){_0x21f7cd['push'](_0x21f7cd['shift']());}}}(a35_0x874a,0xa87c4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a35_0x874a(){const _0x1452c8=['Recursive\x20mode:\x20enabled','resolvePathToResource','Folder\x20ID:\x20','cause','\x27...','\x5c$&','198180MIGYmy','Error:\x20','(empty)','listUnifiedWithJourneys',',\x20and\x20','\x20folder','json','data','journey','Parent\x20ID:\x20','5045826wdbSSH','type','listWithPattern','\x20segment','Site:\x20','jsonl','error','log','recursive','/e/','7974304SEZWIX','/app/ps/','14289OUXTfK','206aYBCiw','Set\x20a\x20parent\x20segment\x20context\x20first:','No\x20items\x20match\x20pattern:\x20','\x20matching\x20\x27','(not\x20set)','Folder/pattern\x20arg:\x20','folder','length','filter',']\x20matching\x20\x27','3988BDRfYE','journeys','listRecursive','sort','execute','5688378yNOFJV','replace','format','245lnXkUn','\x20\x20Cause:\x20','name','Building\x20hierarchy\x20tree...','message','dim','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','/j/da','parentId','localeCompare','includes','test','✔\x20Found\x20','6459495RtxWxz','children','map','parentSegment','List\x20folders\x20and\x20child\x20segments','maxDepth','Error:\x20No\x20parent\x20segment\x20context\x20set.','Listing\x20folders,\x20segments,\x20and\x20journeys...','site','listUnified','verbose','Resolving\x20path\x20\x27','\x20journey','folderId','segment','folders'];a35_0x874a=function(){return _0x1452c8;};return a35_0x874a();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a35_0x17e6(_0x5a5807,_0x1257fd){_0x5a5807=_0x5a5807-0xba;const _0x874a5d=a35_0x874a();let _0x17e637=_0x874a5d[_0x5a5807];return _0x17e637;}import a35_0x43f8de from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x3cb72f(0xdc)]='segments';['description']=a35_0x3cb72f(0xeb);async[a35_0x3cb72f(0xd6)](_0x33f373){const _0x4a01a4=a35_0x3cb72f,{options:_0x2fb5cf,args:_0x5d9bef}=_0x33f373,_0x1f3be7=_0x2fb5cf[_0x4a01a4(0xc3)],_0x4280c7=_0x5d9bef[0x0];try{const _0x425d64=_0x2fb5cf[_0x4a01a4(0xea)];_0x2fb5cf[_0x4a01a4(0xf1)]&&(console[_0x4a01a4(0xc1)](_0x4a01a4(0xbf)+_0x2fb5cf['site']),console[_0x4a01a4(0xc1)]('Parent\x20segment\x20context:\x20'+(_0x425d64||_0x4a01a4(0xcc))),_0x4280c7&&console['error'](_0x4a01a4(0xcd)+_0x4280c7),_0x1f3be7&&console[_0x4a01a4(0xc1)](_0x4a01a4(0xf7)));if(!_0x425d64)return console[_0x4a01a4(0xc1)](_0x4a01a4(0xed)),console[_0x4a01a4(0xc1)](''),console[_0x4a01a4(0xc1)](_0x4a01a4(0xc9)),console[_0x4a01a4(0xc1)](_0x4a01a4(0xe0)),console[_0x4a01a4(0xc1)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x4a01a4(0xc1)](''),console['error']('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x47fb92=_0x4280c7&&(_0x4280c7[_0x4a01a4(0xe4)]('*')||_0x4280c7[_0x4a01a4(0xe4)]('?'));if(_0x47fb92)return await this[_0x4a01a4(0xbd)](_0x33f373,_0x425d64,_0x4280c7);const _0x37d68f=_0x4280c7?_0x425d64+'/'+_0x4280c7:_0x425d64;return _0x1f3be7?await this[_0x4a01a4(0xd4)](_0x33f373,_0x37d68f):await this['listUnified'](_0x33f373,_0x37d68f);}catch(_0x523784){if(_0x523784 instanceof SDKError)return console[_0x4a01a4(0xc1)](_0x4a01a4(0xfe)+_0x523784[_0x4a01a4(0xde)]),_0x523784[_0x4a01a4(0xfa)]&&console['error'](_0x4a01a4(0xdb)+_0x523784[_0x4a01a4(0xfa)]),0x1;throw _0x523784;}}async[a35_0x3cb72f(0xbd)](_0x3cf635,_0x1c2634,_0x2f71fe){const _0x470f5a=a35_0x3cb72f,{options:_0x182fa6,tdx:_0x55527d}=_0x3cf635,_0x985565=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1c2634+_0x470f5a(0xfb),()=>_0x55527d['segment'][_0x470f5a(0xf8)](_0x1c2634),{'verbose':_0x182fa6[_0x470f5a(0xf1)]}),_0x4b87b4=_0x985565['data'],_0x1160ed=await withSpinner(_0x470f5a(0xee),()=>_0x55527d[_0x470f5a(0xf5)][_0x470f5a(0x100)](_0x4b87b4['parentId'],_0x4b87b4[_0x470f5a(0xf4)]),{'verbose':_0x182fa6[_0x470f5a(0xf1)]}),{folders:_0x34c3a1,segments:_0x1fb03b,journeys:_0x2edd5a}=_0x1160ed[_0x470f5a(0x104)],_0x4fecef=_0x2f71fe[_0x470f5a(0xd8)](/[.+^${}()|[\]\\]/g,_0x470f5a(0xfc))[_0x470f5a(0xd8)](/\*/g,'.*')[_0x470f5a(0xd8)](/\?/g,'.'),_0x26e54b=new RegExp('^'+_0x4fecef+'$','i'),_0x1cee6e=_0x34c3a1[_0x470f5a(0xd0)](_0x10195b=>_0x26e54b['test'](_0x10195b[_0x470f5a(0xdc)])),_0x54c7ca=_0x1fb03b[_0x470f5a(0xd0)](_0x28e9ca=>_0x26e54b[_0x470f5a(0xe5)](_0x28e9ca[_0x470f5a(0xdc)])),_0x5b19c3=_0x2edd5a[_0x470f5a(0xd0)](_0x54d4c1=>_0x26e54b[_0x470f5a(0xe5)](_0x54d4c1['journeyBundleName'])),_0x20c3ae=_0x1cee6e[_0x470f5a(0xcf)]+_0x54c7ca[_0x470f5a(0xcf)]+_0x5b19c3['length'];console[_0x470f5a(0xc1)](_0x470f5a(0xe6)+_0x1cee6e[_0x470f5a(0xcf)]+_0x470f5a(0x102)+(_0x1cee6e[_0x470f5a(0xcf)]!==0x1?'s':'')+',\x20'+_0x54c7ca[_0x470f5a(0xcf)]+_0x470f5a(0xbe)+(_0x54c7ca[_0x470f5a(0xcf)]!==0x1?'s':'')+_0x470f5a(0x101)+_0x5b19c3[_0x470f5a(0xcf)]+'\x20journey'+(_0x5b19c3[_0x470f5a(0xcf)]!==0x1?'s':'')+_0x470f5a(0xcb)+_0x2f71fe+'\x27');const _0x5207e1=_0x100dd0=>{const _0x215828=_0x470f5a;return getConsoleNextUrl(_0x182fa6['site'],_0x215828(0xc6)+_0x4b87b4[_0x215828(0xe2)]+_0x215828(0xc4)+_0x100dd0);},_0x2a1b53=_0x182fa6['format']===_0x470f5a(0x103)||_0x182fa6[_0x470f5a(0xd9)]===_0x470f5a(0xc0);if(_0x2a1b53){const _0x4fb829=[..._0x1cee6e[_0x470f5a(0xe9)](_0x2fb2a0=>({..._0x2fb2a0,'type':'folder'})),..._0x54c7ca[_0x470f5a(0xe9)](_0x198f0b=>({..._0x198f0b,'type':_0x470f5a(0xf5),'url':_0x5207e1(_0x198f0b['id'])})),..._0x5b19c3['map'](_0x1febe5=>({..._0x1febe5,'name':_0x1febe5['journeyBundleName'],'type':_0x470f5a(0x105)}))]['sort']((_0x5eb638,_0x1d5ccc)=>_0x5eb638[_0x470f5a(0xdc)][_0x470f5a(0xe3)](_0x1d5ccc[_0x470f5a(0xdc)]));await handleSDKOutput(_0x4fb829,_0x182fa6);}else{if(_0x20c3ae===0x0)console[_0x470f5a(0xc2)](_0x470f5a(0xca)+_0x2f71fe);else{console[_0x470f5a(0xc2)](a35_0x43f8de[_0x470f5a(0xdf)]('['+_0x1c2634+_0x470f5a(0xd1)+_0x2f71fe+'\x27'));const _0x504f39=formatFlatList(_0x1cee6e,_0x54c7ca,{'showMetadata':!![],'getSegmentUrl':_0x5207e1},_0x5b19c3);console[_0x470f5a(0xc2)](_0x504f39);}}return 0x0;}async[a35_0x3cb72f(0xf0)](_0xac0731,_0x24d8ff){const _0x345b2f=a35_0x3cb72f,{options:_0x17f624,tdx:_0x595be4}=_0xac0731,_0x4d66f4=await withSpinner(_0x345b2f(0xf2)+_0x24d8ff+'\x27...',()=>_0x595be4['segment'][_0x345b2f(0xf8)](_0x24d8ff),{'verbose':_0x17f624['verbose']}),_0x13ea43=_0x4d66f4[_0x345b2f(0x104)];_0x17f624[_0x345b2f(0xf1)]&&(console['error'](_0x345b2f(0xba)+_0x13ea43[_0x345b2f(0xe2)]),_0x13ea43[_0x345b2f(0xf4)]&&console[_0x345b2f(0xc1)](_0x345b2f(0xf9)+_0x13ea43[_0x345b2f(0xf4)]));const _0x35d422=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x595be4[_0x345b2f(0xf5)][_0x345b2f(0x100)](_0x13ea43[_0x345b2f(0xe2)],_0x13ea43[_0x345b2f(0xf4)]),{'verbose':_0x17f624[_0x345b2f(0xf1)]}),{folders:_0x30cee9,segments:_0xdcd693,journeys:_0x102a5c}=_0x35d422['data'],_0x2f4bc7=_0x30cee9[_0x345b2f(0xcf)]+_0xdcd693[_0x345b2f(0xcf)]+_0x102a5c[_0x345b2f(0xcf)];console[_0x345b2f(0xc1)]('✔\x20Found\x20'+_0x30cee9[_0x345b2f(0xcf)]+_0x345b2f(0x102)+(_0x30cee9[_0x345b2f(0xcf)]!==0x1?'s':'')+',\x20'+_0xdcd693[_0x345b2f(0xcf)]+_0x345b2f(0xbe)+(_0xdcd693[_0x345b2f(0xcf)]!==0x1?'s':'')+',\x20and\x20'+_0x102a5c['length']+_0x345b2f(0xf3)+(_0x102a5c[_0x345b2f(0xcf)]!==0x1?'s':''));const _0x1cebc4=_0x45b423=>{const _0x1fc5ca=_0x345b2f;return getConsoleNextUrl(_0x17f624[_0x1fc5ca(0xef)],_0x1fc5ca(0xc6)+_0x13ea43['parentId']+'/e/'+_0x45b423);},_0x28ffa5=_0xa7b127=>{const _0x26391e=_0x345b2f;return getConsoleNextUrl(_0x17f624[_0x26391e(0xef)],_0x26391e(0xc6)+_0x13ea43[_0x26391e(0xe2)]+_0x26391e(0xc4)+_0xa7b127+_0x26391e(0xe1));},_0x522e29=_0x17f624[_0x345b2f(0xd9)]===_0x345b2f(0x103)||_0x17f624[_0x345b2f(0xd9)]===_0x345b2f(0xc0);if(_0x522e29){const _0xf5240b=[..._0x30cee9[_0x345b2f(0xe9)](_0x5be6bc=>({..._0x5be6bc,'type':'folder'})),..._0xdcd693['map'](_0xfc8197=>({..._0xfc8197,'type':'segment','url':_0x1cebc4(_0xfc8197['id'])})),..._0x102a5c[_0x345b2f(0xe9)](_0x1ec5e1=>({..._0x1ec5e1,'name':_0x1ec5e1['journeyBundleName'],'type':_0x345b2f(0x105),'url':_0x28ffa5(_0x1ec5e1['id'])}))][_0x345b2f(0xd5)]((_0x7df20f,_0x7454b1)=>_0x7df20f[_0x345b2f(0xdc)][_0x345b2f(0xe3)](_0x7454b1['name']));await handleSDKOutput(_0xf5240b,_0x17f624);}else{if(_0x2f4bc7===0x0)console['log'](a35_0x43f8de['dim']('['+_0x24d8ff+']')),console[_0x345b2f(0xc2)](_0x345b2f(0xff));else{console[_0x345b2f(0xc2)](a35_0x43f8de[_0x345b2f(0xdf)]('['+_0x24d8ff+']'));const _0x4efda9=formatFlatList(_0x30cee9,_0xdcd693,{'showMetadata':!![],'getSegmentUrl':_0x1cebc4,'getJourneyUrl':_0x28ffa5},_0x102a5c);console[_0x345b2f(0xc2)](_0x4efda9);}}return 0x0;}async['listRecursive'](_0x36acd0,_0x1bb235){const _0x67161f=a35_0x3cb72f,{options:_0x319714,tdx:_0x5eb2de}=_0x36acd0,_0x26ee50=await withSpinner(_0x67161f(0xf2)+_0x1bb235+'\x27...',()=>_0x5eb2de[_0x67161f(0xf5)]['resolvePathToResource'](_0x1bb235),{'verbose':_0x319714[_0x67161f(0xf1)]}),_0x5bd0af=_0x26ee50[_0x67161f(0x104)];_0x319714[_0x67161f(0xf1)]&&(console['error'](_0x67161f(0xba)+_0x5bd0af[_0x67161f(0xe2)]),_0x5bd0af[_0x67161f(0xf4)]&&console[_0x67161f(0xc1)]('Folder\x20ID:\x20'+_0x5bd0af['folderId']));const _0x1741ac=_0x319714[_0x67161f(0xec)]||0xa,_0x38c9be=await withSpinner(_0x67161f(0xdd),()=>_0x5eb2de['segment'][_0x67161f(0xd4)](_0x5bd0af[_0x67161f(0xe2)],_0x5bd0af[_0x67161f(0xf4)],0x0,_0x1741ac),{'verbose':_0x319714[_0x67161f(0xf1)]}),_0x4b4d08=_0x38c9be[_0x67161f(0x104)],_0x3454e4=_0x42b963=>{const _0xc1eb8f=_0x67161f;let _0x1aca79=0x0,_0xe7ef1=0x0,_0x427635=0x0;for(const _0x2bf102 of _0x42b963){if(_0x2bf102[_0xc1eb8f(0xbc)]===_0xc1eb8f(0xce))_0x1aca79++;else{if(_0x2bf102[_0xc1eb8f(0xbc)]===_0xc1eb8f(0xf5))_0xe7ef1++;else{if(_0x2bf102['type']==='journey')_0x427635++;}}if(_0x2bf102['children']){const _0x392355=_0x3454e4(_0x2bf102[_0xc1eb8f(0xe8)]);_0x1aca79+=_0x392355[_0xc1eb8f(0xf6)],_0xe7ef1+=_0x392355['segments'],_0x427635+=_0x392355[_0xc1eb8f(0xd3)];}}return{'folders':_0x1aca79,'segments':_0xe7ef1,'journeys':_0x427635};},_0x267da2=_0x3454e4(_0x4b4d08);console[_0x67161f(0xc1)]('✔\x20Built\x20tree\x20with\x20'+_0x267da2['folders']+_0x67161f(0x102)+(_0x267da2[_0x67161f(0xf6)]!==0x1?'s':'')+',\x20'+_0x267da2['segments']+_0x67161f(0xbe)+(_0x267da2['segments']!==0x1?'s':'')+_0x67161f(0x101)+_0x267da2[_0x67161f(0xd3)]+_0x67161f(0xf3)+(_0x267da2[_0x67161f(0xd3)]!==0x1?'s':''));const _0x509b1d=_0x16aea1=>{const _0x7a34e2=_0x67161f;return getConsoleNextUrl(_0x319714[_0x7a34e2(0xef)],_0x7a34e2(0xc6)+_0x5bd0af[_0x7a34e2(0xe2)]+'/e/'+_0x16aea1);},_0x2914af=_0x26a6e7=>{const _0x7f0f82=_0x67161f;return getConsoleNextUrl(_0x319714[_0x7f0f82(0xef)],_0x7f0f82(0xc6)+_0x5bd0af['parentId']+_0x7f0f82(0xc4)+_0x26a6e7+_0x7f0f82(0xe1));};if(_0x319714['format']==='json'||_0x319714['format']===_0x67161f(0xc0))await handleSDKOutput(_0x4b4d08,_0x319714);else{console[_0x67161f(0xc2)](a35_0x43f8de[_0x67161f(0xdf)]('['+_0x1bb235+']'));const _0x11b532=formatTree(_0x4b4d08,{'showMetadata':!![],'getSegmentUrl':_0x509b1d,'getJourneyUrl':_0x2914af});console[_0x67161f(0xc2)](_0x11b532);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a36_0x2da5c0=a36_0x393d;(function(_0x20016a,_0x5343bc){const _0x1c5c9b=a36_0x393d,_0x57a014=_0x20016a();while(!![]){try{const _0x4fe664=parseInt(_0x1c5c9b(0x97))/0x1+parseInt(_0x1c5c9b(0xa0))/0x2*(parseInt(_0x1c5c9b(0x8a))/0x3)+parseInt(_0x1c5c9b(0x89))/0x4*(-parseInt(_0x1c5c9b(0x8b))/0x5)+parseInt(_0x1c5c9b(0xa3))/0x6*(parseInt(_0x1c5c9b(0x8f))/0x7)+parseInt(_0x1c5c9b(0x95))/0x8*(-parseInt(_0x1c5c9b(0x8d))/0x9)+-parseInt(_0x1c5c9b(0x86))/0xa*(-parseInt(_0x1c5c9b(0x90))/0xb)+parseInt(_0x1c5c9b(0xa1))/0xc;if(_0x4fe664===_0x5343bc)break;else _0x57a014['push'](_0x57a014['shift']());}catch(_0x27a30b){_0x57a014['push'](_0x57a014['shift']());}}}(a36_0x4f59,0x79bf9));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 a36_0x393d(_0xfbe1e5,_0x6de96b){_0xfbe1e5=_0xfbe1e5-0x83;const _0x4f5977=a36_0x4f59();let _0x393db9=_0x4f5977[_0xfbe1e5];return _0x393db9;}import{withSpinner}from'../utils/spinner.js';function a36_0x4f59(){const _0x315965=['catalog','87004nevLpy','2046624BPWJRN','...','36HllVhd','description','database','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','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20from\x20','✔\x20Retrieved\x20','cause','Table:\x20','Site:\x20','Usage:\x20tdx\x20show\x20<database.table>','show','error','Querying\x20','query','7681330heQobJ','Database:\x20','\x20row','161688SMcBLb','9jMlGWq','30uYEpgy','execute','4439691GtMyIj','verbose','171563ogIGuX','11nmAFfv','args','Error:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','8fbEvLW','site','18267thAzOE','Catalog:\x20','showTable','\x20\x20Cause:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','table','length','validate'];a36_0x4f59=function(){return _0x315965;};return a36_0x4f59();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a36_0x2da5c0(0xae);[a36_0x2da5c0(0xa4)]='Show\x20table\x20contents';async[a36_0x2da5c0(0x8c)](_0x128006){const _0x44dfcf=a36_0x2da5c0;return this[_0x44dfcf(0x99)](_0x128006);}async[a36_0x2da5c0(0x99)](_0x1f6156){const _0x48dc51=a36_0x2da5c0,{options:_0x1bb8fe,args:_0x2e56fa,tdx:_0x22c763}=_0x1f6156;let _0x1b7ed7;try{_0x1b7ed7=parseTableReference(_0x2e56fa[0x0]);const _0x4bd5b9=_0x1bb8fe[_0x48dc51(0xa5)];!_0x1b7ed7[_0x48dc51(0xa5)]&&_0x4bd5b9&&(_0x1b7ed7[_0x48dc51(0xa5)]=_0x4bd5b9);const _0x2250c2=validateTableDescribeReference(_0x1b7ed7);if(_0x2250c2)return console[_0x48dc51(0x83)](_0x48dc51(0x92)+_0x2250c2),console[_0x48dc51(0x83)](_0x48dc51(0xad)),console[_0x48dc51(0x83)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x48dc51(0x83)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0xa801dd){return console[_0x48dc51(0x83)](_0x48dc51(0x92)+_0xa801dd['message']),console['error'](_0x48dc51(0xad)),console['error'](_0x48dc51(0x9b)),console['error'](_0x48dc51(0x93)),0x1;}const _0x367bc1=_0x1b7ed7[_0x48dc51(0x9f)],_0x42dfdb=_0x1b7ed7[_0x48dc51(0xa5)],_0x4d43b4=_0x1b7ed7[_0x48dc51(0x9c)],_0x506a8b=resolveLimit(_0x1bb8fe['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x1bb8fe[_0x48dc51(0x8e)]&&(console[_0x48dc51(0x83)](_0x48dc51(0xac)+_0x1bb8fe[_0x48dc51(0x96)]),_0x367bc1&&console['error'](_0x48dc51(0x98)+_0x367bc1),console[_0x48dc51(0x83)](_0x48dc51(0x87)+_0x42dfdb),console[_0x48dc51(0x83)](_0x48dc51(0xab)+_0x4d43b4),console[_0x48dc51(0x83)]('Limit:\x20'+_0x506a8b));const _0x4bbf57=_0x367bc1?_0x367bc1+'.'+_0x42dfdb+'.'+_0x4d43b4:_0x42dfdb+'.'+_0x4d43b4,_0x1ebedd=await withSpinner(_0x48dc51(0x84)+_0x4bbf57+_0x48dc51(0xa2),()=>_0x22c763[_0x48dc51(0x85)][_0x48dc51(0x99)](_0x42dfdb,_0x4d43b4,_0x506a8b,_0x367bc1),{'verbose':_0x1bb8fe['verbose']}),_0x4dda2c=_0x1ebedd[_0x48dc51(0x94)],_0x488257=_0x4dda2c['data'];return _0x488257['length']===0x0?console[_0x48dc51(0x83)](_0x48dc51(0xa7)):console['error'](_0x48dc51(0xa9)+_0x488257[_0x48dc51(0x9d)]+_0x48dc51(0x88)+(_0x488257['length']!==0x1?'s':'')+_0x48dc51(0xa8)+_0x4bbf57),await handleSDKOutput(_0x488257,_0x1bb8fe),0x0;}catch(_0x34710e){if(_0x34710e instanceof SDKError)return console[_0x48dc51(0x83)](_0x48dc51(0x92)+_0x34710e['message']),_0x34710e[_0x48dc51(0xaa)]&&console[_0x48dc51(0x83)](_0x48dc51(0x9a)+_0x34710e[_0x48dc51(0xaa)]),0x1;throw _0x34710e;}}[a36_0x2da5c0(0x9e)](_0x34d432){const _0x1d3ad9=a36_0x2da5c0;if(_0x34d432[_0x1d3ad9(0x91)][_0x1d3ad9(0x9d)]===0x0)return _0x1d3ad9(0xa6);if(_0x34d432[_0x1d3ad9(0x91)][_0x1d3ad9(0x9d)]>0x1)return'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';return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0xca91b0=a37_0x116b;function a37_0x544f(){const _0x3a35e3=['cli','getUserInfo','Name:','Read\x20credential\x20from\x20','✓\x20Authentication\x20successful\x0a','session','env','last_name','TDX_PROFILE\x20env','yellow','email','cyan','account_id','4168080NItdhx','User:','first_name','log','profileSource','displayWithSources','12jVcWJB','config','green','Account\x20ID:','site','execute','status','9WmrNTn','3524215ZAYWOB','tdx','bold','\x20profile:\x20','84850DzVDeA','filter','error','dim','✗\x20Validation\x20failed:\x20','description','490792llBIsF','site:\x20','profile','16606546VLfTAL','message','N/A','6iNiqse','9TLUEKU','819MIKBBF','49138IjSyoU','3602024UGoMKD'];a37_0x544f=function(){return _0x3a35e3;};return a37_0x544f();}(function(_0x37e8e1,_0x735494){const _0x557ae0=a37_0x116b,_0x2ccbb1=_0x37e8e1();while(!![]){try{const _0x3bb05b=parseInt(_0x557ae0(0x14b))/0x1*(-parseInt(_0x557ae0(0x15f))/0x2)+-parseInt(_0x557ae0(0x15d))/0x3*(parseInt(_0x557ae0(0x156))/0x4)+parseInt(_0x557ae0(0x14c))/0x5*(parseInt(_0x557ae0(0x15c))/0x6)+parseInt(_0x557ae0(0x16e))/0x7+parseInt(_0x557ae0(0x160))/0x8+parseInt(_0x557ae0(0x15e))/0x9*(parseInt(_0x557ae0(0x150))/0xa)+parseInt(_0x557ae0(0x159))/0xb*(-parseInt(_0x557ae0(0x144))/0xc);if(_0x3bb05b===_0x735494)break;else _0x2ccbb1['push'](_0x2ccbb1['shift']());}catch(_0x426641){_0x2ccbb1['push'](_0x2ccbb1['shift']());}}}(a37_0x544f,0x6775a));import{BaseCommand,printAuthError}from'./command.js';function a37_0x116b(_0x2aee48,_0x34d128){_0x2aee48=_0x2aee48-0x140;const _0x544f25=a37_0x544f();let _0x116baa=_0x544f25[_0x2aee48];return _0x116baa;}import{resolveAPIKeyAsync}from'../core/config.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a37_0x2369d3 from'chalk';export class StatusCommand extends BaseCommand{['name']=a37_0xca91b0(0x14a);[a37_0xca91b0(0x155)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a37_0xca91b0(0x149)](_0x3b3495){const _0x34a599=a37_0xca91b0,{options:_0x38f305,tdx:_0x3174f4}=_0x3b3495,_0x59e104=_0x38f305[_0x34a599(0x148)],_0x44b267=new GlobalContext(_0x38f305),_0x5782c2=_0x44b267[_0x34a599(0x158)],_0x4551e2=_0x44b267[_0x34a599(0x142)],_0x2f76f2=_0x4551e2===_0x34a599(0x161)?'CLI\x20flag':_0x4551e2===_0x34a599(0x166)?'session':_0x4551e2===_0x34a599(0x167)?_0x34a599(0x169):_0x4551e2==='config'?_0x34a599(0x145):null,_0x1aff73=_0x5782c2?a37_0x2369d3['cyan'](_0x5782c2):a37_0x2369d3[_0x34a599(0x153)](_0x34a599(0x15b)),_0x3323d1=_0x2f76f2?'\x20'+a37_0x2369d3[_0x34a599(0x153)]('(from\x20'+_0x2f76f2+')'):'';console[_0x34a599(0x141)](a37_0x2369d3['bold'](_0x34a599(0x14d))+_0x34a599(0x14f)+_0x1aff73+_0x3323d1+'\x20'+a37_0x2369d3['dim']('(')+_0x34a599(0x157)+a37_0x2369d3[_0x34a599(0x16c)](_0x59e104)+a37_0x2369d3['dim'](')'));const _0x2a4190=await resolveAPIKeyAsync(_0x59e104,_0x5782c2);if(_0x2a4190){const {source:_0x3c5613,isDeprecated:_0x43135e}=_0x2a4190,_0x380da2=_0x34a599(0x164)+a37_0x2369d3[_0x34a599(0x16c)](_0x3c5613);console['log'](_0x43135e?a37_0x2369d3['yellow'](_0x380da2):_0x380da2);}else console[_0x34a599(0x141)](a37_0x2369d3[_0x34a599(0x16a)]('No\x20credential\x20found'));let _0x3a4391=![];try{const _0x541189=await _0x3174f4['jobs'][_0x34a599(0x162)]();console[_0x34a599(0x141)](a37_0x2369d3[_0x34a599(0x146)](_0x34a599(0x165))),console[_0x34a599(0x141)](a37_0x2369d3[_0x34a599(0x14e)](_0x34a599(0x16f))+'\x20'+a37_0x2369d3['cyan'](_0x541189[_0x34a599(0x16b)]));if(_0x541189['first_name']||_0x541189[_0x34a599(0x168)]){const _0x538141=[_0x541189[_0x34a599(0x140)],_0x541189[_0x34a599(0x168)]][_0x34a599(0x151)](Boolean)['join']('\x20');console[_0x34a599(0x141)](a37_0x2369d3[_0x34a599(0x14e)](_0x34a599(0x163))+'\x20'+_0x538141);}_0x541189[_0x34a599(0x16d)]&&console[_0x34a599(0x141)](a37_0x2369d3['bold'](_0x34a599(0x147))+'\x20'+a37_0x2369d3[_0x34a599(0x16a)](_0x541189['account_id'])),_0x3a4391=!![];}catch(_0x2f83a4){_0x2f83a4 instanceof HTTPClientError&&_0x2f83a4[_0x34a599(0x14a)]===0x191?printAuthError(_0x2f83a4,!![],_0x5782c2):console[_0x34a599(0x152)](a37_0x2369d3['red'](_0x34a599(0x154)+(_0x2f83a4 instanceof Error?_0x2f83a4[_0x34a599(0x15a)]:String(_0x2f83a4))));}return console[_0x34a599(0x141)](),_0x44b267[_0x34a599(0x143)](),_0x3a4391?0x0:0x1;}}
|