@treasuredata/tdx 2026.3.15 β 2026.3.16
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 +9 -0
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x109a39=a34_0x25ab;(function(_0x18dd64,_0x44e24d){const _0x4665da=a34_0x25ab,_0x4efefb=_0x18dd64();while(!![]){try{const _0x2ff46e=-parseInt(_0x4665da(0x199))/0x1*(parseInt(_0x4665da(0x19f))/0x2)+-parseInt(_0x4665da(0x1bd))/0x3*(parseInt(_0x4665da(0x19b))/0x4)+-parseInt(_0x4665da(0x16b))/0x5+-parseInt(_0x4665da(0x1ad))/0x6+parseInt(_0x4665da(0x1b0))/0x7*(-parseInt(_0x4665da(0x155))/0x8)+-parseInt(_0x4665da(0x1c7))/0x9+parseInt(_0x4665da(0x1d0))/0xa;if(_0x2ff46e===_0x44e24d)break;else _0x4efefb['push'](_0x4efefb['shift']());}catch(_0x2501e1){_0x4efefb['push'](_0x4efefb['shift']());}}}(a34_0x52fc,0xd9468));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x4ea172 from'chalk';function formatRelativeTime(_0x5897b4){const _0x377847=a34_0x25ab,_0x491d98=new Date(_0x5897b4),_0x2bbf8f=new Date(),_0x3e50a8=_0x491d98['getTime']()-_0x2bbf8f[_0x377847(0x16c)](),_0x22b29b=Math[_0x377847(0x194)](_0x3e50a8)/0x3e8,_0x567645=_0x3e50a8<0x0;if(_0x22b29b<0x3c)return _0x567645?_0x377847(0x163):_0x377847(0x179);else{if(_0x22b29b<0xe10){const _0x18d0ca=Math[_0x377847(0x1b4)](_0x22b29b/0x3c);return _0x567645?_0x18d0ca+_0x377847(0x191):_0x377847(0x1bf)+_0x18d0ca+'m';}else{if(_0x22b29b<0x15180){const _0x21c62c=Math[_0x377847(0x1b4)](_0x22b29b/0xe10);return _0x567645?_0x21c62c+'h\x20ago':_0x377847(0x1bf)+_0x21c62c+'h';}else{if(_0x22b29b<0x93a80){const _0x582d89=Math[_0x377847(0x1b4)](_0x22b29b/0x15180);return _0x567645?_0x582d89+'d\x20ago':_0x377847(0x1bf)+_0x582d89+'d';}else return _0x491d98[_0x377847(0x1a9)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a34_0x109a39(0x1c6);[a34_0x109a39(0x180)]=a34_0x109a39(0x1a4);async['execute'](_0x3ae7f3){const _0x5ee10=a34_0x109a39,{options:_0x52fd33,args:_0x422e9d,tdx:_0x1b80f5}=_0x3ae7f3,_0x535c6f=resolveLimit(_0x52fd33[_0x5ee10(0x15d)],DEFAULT_DISPLAY_LIMIT),_0x2b1fca=_0x422e9d[0x0],_0x14907b=_0x2b1fca?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x2b1fca+_0x5ee10(0x1c1):_0x5ee10(0x18b),_0xfdaa0a=await withSpinner(_0x14907b,()=>_0x1b80f5[_0x5ee10(0x183)][_0x5ee10(0x1a6)]({'limit':_0x535c6f,'scheduled':!![],'pattern':_0x2b1fca}),{'verbose':_0x52fd33['verbose']}),_0xabd94f=_0xfdaa0a[_0x5ee10(0x189)][_0x5ee10(0x1d5)],_0x2aa0ff=_0xfdaa0a[_0x5ee10(0x189)][_0x5ee10(0x1a3)][_0x5ee10(0x18d)],_0x27799c=_0x2b1fca?_0x5ee10(0x165)+_0x2b1fca+'\x22':'';_0x2aa0ff?console[_0x5ee10(0x1ae)](_0x5ee10(0x1d2)+_0xabd94f[_0x5ee10(0x1c9)]+_0x5ee10(0x15b)+_0x27799c+_0x5ee10(0x193)):console['error']('Found\x20'+_0xabd94f[_0x5ee10(0x1c9)]+_0x5ee10(0x1ba)+(_0xabd94f[_0x5ee10(0x1c9)]!==0x1?_0x5ee10(0x17d):'y')+_0x27799c);if(_0x52fd33[_0x5ee10(0x1bc)]==='json'||_0x52fd33['format']===_0x5ee10(0x164)||_0x52fd33[_0x5ee10(0x1bc)]===_0x5ee10(0x152)||_0x52fd33[_0x5ee10(0x1bc)]==='tsv'){const _0x92f1ae=_0xabd94f['map'](_0x30bbc0=>({'id':_0x30bbc0['id'],'name':_0x30bbc0[_0x5ee10(0x161)],'cron':_0x30bbc0[_0x5ee10(0x1c8)],'database':_0x30bbc0[_0x5ee10(0x166)]?.[_0x5ee10(0x161)],'type':_0x30bbc0[_0x5ee10(0x1d4)],'timezone':_0x30bbc0[_0x5ee10(0x160)],'user_name':_0x30bbc0['user']?.[_0x5ee10(0x161)],'updated_at':_0x30bbc0[_0x5ee10(0x1d7)],'next_run_at':_0x30bbc0[_0x5ee10(0x1b8)],'last_job_status':_0x30bbc0[_0x5ee10(0x1c2)]?.[_0x5ee10(0x1bb)]}));await handleSDKOutput(_0x92f1ae,_0x52fd33);}else{if(_0xabd94f[_0x5ee10(0x1c9)]===0x0)console[_0x5ee10(0x14f)](_0x5ee10(0x170));else{const _0x10b7b2=_0x52fd33[_0x5ee10(0x14b)],_0x1501a7=_0xabd94f['map'](_0x4dce0a=>{const _0x4fc7aa=_0x5ee10,_0x195af9=_0x4dce0a[_0x4fc7aa(0x1c2)]?.['status']?_0x4dce0a['last_job'][_0x4fc7aa(0x1bb)]===_0x4fc7aa(0x1c3)?'β':'β':'-',_0x26fa79=_0x4dce0a[_0x4fc7aa(0x1c2)]?.[_0x4fc7aa(0x192)]?formatRelativeTime(_0x4dce0a[_0x4fc7aa(0x1c2)]['ended_at']):_0x4fc7aa(0x1b6),_0xf3f86e=_0x4dce0a['next_run_at']?formatRelativeTime(_0x4dce0a['next_run_at']):'-',_0x1ef5ab=_0x4dce0a['cron']||'',_0x40f5bf=_0x4dce0a[_0x4fc7aa(0x161)]||_0x4fc7aa(0x1b3),_0x52ba56=getConsoleUrl(_0x10b7b2,'/app/queries/editor?queryId='+_0x4dce0a['id']);return{'statusIcon':_0x195af9,'lastRun':_0x26fa79,'nextRun':_0xf3f86e,'cron':_0x1ef5ab,'name':_0x40f5bf,'queryUrl':_0x52ba56,'status':_0x4dce0a[_0x4fc7aa(0x1c2)]?.[_0x4fc7aa(0x1bb)]};}),_0xabdb06=Math[_0x5ee10(0x195)](..._0x1501a7[_0x5ee10(0x158)](_0x3aacfa=>_0x3aacfa[_0x5ee10(0x1a8)][_0x5ee10(0x1c9)])),_0x3e4155=Math[_0x5ee10(0x195)](..._0x1501a7['map'](_0x48a2c0=>_0x48a2c0[_0x5ee10(0x177)]['length'])),_0x500d17=Math[_0x5ee10(0x195)](..._0x1501a7['map'](_0x4751da=>_0x4751da[_0x5ee10(0x1c8)]['length'])),_0x1ac31b=_0x1501a7[_0x5ee10(0x158)](_0x5327d6=>{const _0x56d96e=_0x5ee10,_0x420e8e=_0x5327d6[_0x56d96e(0x1bb)]==='success'?a34_0x4ea172['green'](_0x5327d6['statusIcon']):_0x5327d6['status']==='error'?a34_0x4ea172['red'](_0x5327d6['statusIcon']):a34_0x4ea172[_0x56d96e(0x15c)](_0x5327d6[_0x56d96e(0x168)]),_0x4d3610=_0x5327d6[_0x56d96e(0x1a8)]['padEnd'](_0xabdb06),_0x581fd0=_0x5327d6[_0x56d96e(0x177)][_0x56d96e(0x157)](_0x3e4155),_0x3f6f54=_0x5327d6[_0x56d96e(0x1c8)]?a34_0x4ea172['cyan'](_0x5327d6['cron']['padEnd'](_0x500d17)):'\x20'['repeat'](_0x500d17),_0x243745=hyperlink(_0x5327d6['name'],_0x5327d6[_0x56d96e(0x162)]);return _0x56d96e(0x16d)+_0x420e8e+'\x20'+_0x4d3610+_0x56d96e(0x17f)+_0x581fd0+'\x20\x20'+_0x3f6f54+'\x20\x20'+_0x243745;});await writeOutput(_0x1ac31b[_0x5ee10(0x171)]('\x0a'),_0x52fd33[_0x5ee10(0x16f)],_0x5ee10(0x1b2));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x109a39(0x16a);['description']=a34_0x109a39(0x15a);['validate'](_0x17ebbe){const _0x52d959=a34_0x109a39,_0x555dcd=_0x17ebbe[_0x52d959(0x1ce)][0x0];if(!_0x555dcd)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x2628bd){const _0x29b8c3=a34_0x109a39,{options:_0x3ed2f3,args:_0x3fcd7b,tdx:_0x359356}=_0x2628bd,_0x8014c2=_0x3fcd7b[0x0],_0x4ba6e3=await withSpinner(_0x29b8c3(0x174),()=>_0x359356[_0x29b8c3(0x183)][_0x29b8c3(0x14a)](_0x8014c2),{'verbose':_0x3ed2f3[_0x29b8c3(0x197)]}),_0x18ab59=_0x4ba6e3[_0x29b8c3(0x189)],_0x11f174={'name':_0x18ab59[_0x29b8c3(0x161)],'cron':_0x18ab59[_0x29b8c3(0x1c8)],'database':_0x18ab59['database'],'type':_0x18ab59[_0x29b8c3(0x1d4)],'timezone':_0x18ab59[_0x29b8c3(0x1d3)],'user_name':_0x18ab59[_0x29b8c3(0x1be)],'created_at':_0x18ab59['created_at'],'engine_version':_0x18ab59[_0x29b8c3(0x17e)],'executing_user_id':_0x18ab59[_0x29b8c3(0x1a2)],'query':_0x18ab59[_0x29b8c3(0x1b5)],'delay':_0x18ab59[_0x29b8c3(0x154)],'priority':_0x18ab59['priority'],'retry_limit':_0x18ab59[_0x29b8c3(0x175)],..._0x18ab59[_0x29b8c3(0x19a)]&&{'result':_0x18ab59[_0x29b8c3(0x19a)]}};return await handleSingleObjectOutput(_0x11f174,_0x3ed2f3),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x109a39(0x161)]='schedule:create';['description']=a34_0x109a39(0x19c);['validate'](_0x37c5be){const _0x51df6c=a34_0x109a39,_0x2e032f=_0x37c5be[_0x51df6c(0x1ce)][0x0];if(!_0x2e032f)return _0x51df6c(0x181);const _0x2fc73c=_0x37c5be['options'];if(!_0x2fc73c[_0x51df6c(0x166)])return _0x51df6c(0x188);return undefined;}async[a34_0x109a39(0x19e)](_0x5a31ab){const _0x5bddad=a34_0x109a39,{options:_0x502fe3,args:_0x3b8b7f,tdx:_0x2bbc6e}=_0x5a31ab,_0x1cd316=_0x3b8b7f[0x0],_0x432042=_0x502fe3,_0xb8725c=_0x432042['database'],_0x181c2f=_0x432042[_0x5bddad(0x198)],_0xbea690=_0x432042[_0x5bddad(0x1d4)]||_0x5bddad(0x1c5);let _0x49639c;try{_0x49639c=readFileSync(_0x181c2f,'utf-8')[_0x5bddad(0x15f)]();}catch(_0x348950){throw new SDKError(ErrorCode[_0x5bddad(0x18a)],_0x5bddad(0x151)+_0x181c2f,_0x348950 instanceof Error?_0x348950:undefined);}if(!_0x49639c)throw new SDKError(ErrorCode[_0x5bddad(0x18a)],'Query\x20file\x20is\x20empty');const _0x5bb1c1={'database':_0xb8725c,'query':_0x49639c,'type':_0xbea690};if(_0x432042['cron'])_0x5bb1c1[_0x5bddad(0x1c8)]=_0x432042[_0x5bddad(0x1c8)];if(_0x432042[_0x5bddad(0x1d3)])_0x5bb1c1['timezone']=_0x432042[_0x5bddad(0x1d3)];if(_0x432042[_0x5bddad(0x154)]!==undefined)_0x5bb1c1[_0x5bddad(0x154)]=Number(_0x432042[_0x5bddad(0x154)]);if(_0x432042[_0x5bddad(0x1aa)]!==undefined)_0x5bb1c1[_0x5bddad(0x1aa)]=Number(_0x432042[_0x5bddad(0x1aa)]);if(_0x432042[_0x5bddad(0x156)]!==undefined)_0x5bb1c1[_0x5bddad(0x175)]=Number(_0x432042['retryLimit']);if(_0x432042[_0x5bddad(0x1cf)])_0x5bb1c1['engine_version']=_0x432042[_0x5bddad(0x1cf)];if(_0x432042['result'])_0x5bb1c1['result']=_0x432042[_0x5bddad(0x19a)];if(_0x502fe3[_0x5bddad(0x197)]){console[_0x5bddad(0x1ae)](_0x5bddad(0x14e)+_0x1cd316),console['error'](_0x5bddad(0x1af)+_0xb8725c),console['error'](_0x5bddad(0x17c)+_0xbea690);if(_0x5bb1c1[_0x5bddad(0x1c8)])console[_0x5bddad(0x1ae)](_0x5bddad(0x15e)+_0x5bb1c1[_0x5bddad(0x1c8)]);if(_0x5bb1c1['timezone'])console[_0x5bddad(0x1ae)](_0x5bddad(0x1a5)+_0x5bb1c1[_0x5bddad(0x1d3)]);}const _0x610a3c=await withSpinner(_0x5bddad(0x18f),()=>_0x2bbc6e['schedules'][_0x5bddad(0x1b7)](_0x1cd316,_0x5bb1c1),{'verbose':_0x502fe3[_0x5bddad(0x197)]});return console[_0x5bddad(0x1ae)]('Schedule\x20created:\x20'+_0x610a3c[_0x5bddad(0x189)]['name']),await handleSingleObjectOutput(_0x610a3c[_0x5bddad(0x189)],_0x502fe3),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a34_0x109a39(0x17a);[a34_0x109a39(0x180)]=a34_0x109a39(0x178);[a34_0x109a39(0x1b9)](_0x3cff97){const _0x5ee614=a34_0x109a39,_0x4d25d7=_0x3cff97[_0x5ee614(0x1ce)][0x0];if(!_0x4d25d7)return _0x5ee614(0x1a7);return undefined;}async[a34_0x109a39(0x19e)](_0x49e958){const _0x45e112=a34_0x109a39,{options:_0x2f53a4,args:_0x197a5f,tdx:_0x1ceb7f}=_0x49e958,_0xd1e0f0=_0x197a5f[0x0],_0x5ac2e5=_0x2f53a4,_0x54b76f={};if(_0x5ac2e5[_0x45e112(0x166)])_0x54b76f[_0x45e112(0x166)]=_0x5ac2e5[_0x45e112(0x166)];if(_0x5ac2e5[_0x45e112(0x1d4)])_0x54b76f[_0x45e112(0x1d4)]=_0x5ac2e5['type'];if(_0x5ac2e5[_0x45e112(0x1c8)])_0x54b76f[_0x45e112(0x1c8)]=_0x5ac2e5[_0x45e112(0x1c8)];if(_0x5ac2e5[_0x45e112(0x1d3)])_0x54b76f[_0x45e112(0x1d3)]=_0x5ac2e5[_0x45e112(0x1d3)];if(_0x5ac2e5[_0x45e112(0x154)]!==undefined)_0x54b76f[_0x45e112(0x154)]=Number(_0x5ac2e5[_0x45e112(0x154)]);if(_0x5ac2e5[_0x45e112(0x1aa)]!==undefined)_0x54b76f[_0x45e112(0x1aa)]=Number(_0x5ac2e5[_0x45e112(0x1aa)]);if(_0x5ac2e5[_0x45e112(0x156)]!==undefined)_0x54b76f[_0x45e112(0x175)]=Number(_0x5ac2e5['retryLimit']);if(_0x5ac2e5['engineVersion'])_0x54b76f['engine_version']=_0x5ac2e5[_0x45e112(0x1cf)];if(_0x5ac2e5[_0x45e112(0x19a)])_0x54b76f[_0x45e112(0x19a)]=_0x5ac2e5[_0x45e112(0x19a)];if(_0x5ac2e5[_0x45e112(0x198)])try{_0x54b76f['query']=readFileSync(_0x5ac2e5[_0x45e112(0x198)],_0x45e112(0x1cd))[_0x45e112(0x15f)]();}catch(_0x15be07){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x45e112(0x151)+_0x5ac2e5[_0x45e112(0x198)],_0x15be07 instanceof Error?_0x15be07:undefined);}if(Object['keys'](_0x54b76f)['length']===0x0)throw new SDKError(ErrorCode[_0x45e112(0x18a)],_0x45e112(0x14c));if(_0x2f53a4[_0x45e112(0x197)]){console[_0x45e112(0x1ae)](_0x45e112(0x186)+_0xd1e0f0);for(const [_0x3a5c15,_0x35a527]of Object[_0x45e112(0x1a0)](_0x54b76f)){_0x3a5c15==='query'?console[_0x45e112(0x1ae)]('\x20\x20'+_0x3a5c15+':\x20'+_0x35a527['substring'](0x0,0x32)+_0x45e112(0x182)):console[_0x45e112(0x1ae)]('\x20\x20'+_0x3a5c15+':\x20'+_0x35a527);}}const _0x441e65=await withSpinner('Updating\x20schedule...',()=>_0x1ceb7f['schedules'][_0x45e112(0x1b1)](_0xd1e0f0,_0x54b76f),{'verbose':_0x2f53a4[_0x45e112(0x197)]});return console['error'](_0x45e112(0x16e)+_0x441e65[_0x45e112(0x189)]['name']),await handleSingleObjectOutput(_0x441e65[_0x45e112(0x189)],_0x2f53a4),0x0;}}function a34_0x25ab(_0x1eb502,_0x48a5be){_0x1eb502=_0x1eb502-0x14a;const _0x52fc4b=a34_0x52fc();let _0x25ab4e=_0x52fc4b[_0x1eb502];return _0x25ab4e;}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x109a39(0x161)]=a34_0x109a39(0x196);[a34_0x109a39(0x180)]=a34_0x109a39(0x1c4);[a34_0x109a39(0x1b9)](_0x80576d){const _0x4306db=a34_0x109a39,_0x360aeb=_0x80576d[_0x4306db(0x1ce)][0x0];if(!_0x360aeb)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x109a39(0x19e)](_0x149837){const _0x324b66=a34_0x109a39,{options:_0x52fd2e,args:_0x37ab3e,tdx:_0x22b048}=_0x149837,_0x5262b7=_0x37ab3e[0x0];if(!_0x52fd2e['yes']){const _0x53d2f8=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x5262b7+'\x22?');if(!_0x53d2f8)return console[_0x324b66(0x1ae)](_0x324b66(0x184)),0x0;}const _0x198f26=await withSpinner(_0x324b66(0x1d6),()=>_0x22b048['schedules'][_0x324b66(0x173)](_0x5262b7),{'verbose':_0x52fd2e['verbose']});return console[_0x324b66(0x1ae)]('Schedule\x20deleted:\x20'+_0x198f26[_0x324b66(0x189)][_0x324b66(0x161)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x109a39(0x161)]=a34_0x109a39(0x18e);[a34_0x109a39(0x180)]=a34_0x109a39(0x1c0);['validate'](_0x461176){const _0x2b3aef=a34_0x109a39,_0x273b50=_0x461176[_0x2b3aef(0x1ce)][0x0];if(!_0x273b50)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x26193a){const _0xa4d22b=a34_0x109a39,{options:_0x2d4d5f,args:_0xf3a733,tdx:_0x16768d}=_0x26193a,_0x40a4d6=_0xf3a733[0x0],_0x2ce0ac=_0x2d4d5f,_0x4c00e9=_0x2ce0ac[_0xa4d22b(0x190)],_0x25fb80=_0x2ce0ac[_0xa4d22b(0x19d)]!==undefined?Number(_0x2ce0ac[_0xa4d22b(0x19d)]):undefined;if(_0x2d4d5f[_0xa4d22b(0x197)]){console[_0xa4d22b(0x1ae)](_0xa4d22b(0x1ac)+_0x40a4d6);if(_0x4c00e9)console['error']('\x20\x20Time:\x20'+_0x4c00e9);if(_0x25fb80)console[_0xa4d22b(0x1ae)](_0xa4d22b(0x176)+_0x25fb80);}const _0xc55549=await withSpinner(_0xa4d22b(0x159),()=>_0x16768d['schedules'][_0xa4d22b(0x18c)](_0x40a4d6,{'time':_0x4c00e9,'num':_0x25fb80}),{'verbose':_0x2d4d5f[_0xa4d22b(0x197)]}),_0x4a2ed9=_0xc55549['data'][_0xa4d22b(0x153)];console[_0xa4d22b(0x1ae)]('Schedule\x20run\x20submitted:\x20'+_0x4a2ed9[_0xa4d22b(0x1c9)]+_0xa4d22b(0x17b)+(_0x4a2ed9[_0xa4d22b(0x1c9)]!==0x1?'s':'')+_0xa4d22b(0x14d));for(const _0x154ea5 of _0x4a2ed9){console[_0xa4d22b(0x1ae)](_0xa4d22b(0x169)+_0x154ea5[_0xa4d22b(0x1cb)]);}return await handleSDKOutput(_0x4a2ed9,_0x2d4d5f),0x0;}}function a34_0x52fc(){const _0x1259cf=['3956UjZmcr','Create\x20a\x20scheduled\x20query','num','execute','2501502KllWQE','entries','count','executing_user_id','pagination','List\x20scheduled\x20queries','\x20\x20Timezone:\x20','listQueries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','lastRun','toLocaleDateString','priority','Found\x20','Running\x20schedule:\x20','838410PvkKAL','error','\x20\x20Database:\x20','4270567KfRVju','update','list','(unnamed)','round','query','never','create','next_run_at','validate','\x20scheduled\x20quer','status','format','4173Fdtpns','user_name','in\x20','Run\x20a\x20scheduled\x20query\x20immediately','\x22...','last_job','success','Delete\x20a\x20scheduled\x20query','trino','schedule:list','12826800evSRhS','cron','length','schedule:history','job_id','history','utf-8','args','engineVersion','67700700LFAhRd','from','Showing\x20first\x20','timezone','type','queries','Deleting\x20schedule...','updated_at','show','site','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20created','Creating\x20schedule:\x20','log','\x20(showing\x20','Failed\x20to\x20read\x20file:\x20','table','jobs','delay','8XyMLbh','retryLimit','padEnd','map','Running\x20schedule...','Show\x20schedule\x20details','\x20schedules','dim','limit','\x20\x20Cron:\x20','trim','time_zone','name','queryUrl','just\x20now','jsonl','\x20matching\x20\x22','database','Getting\x20schedule\x20history...','statusIcon','\x20\x20Job\x20ID:\x20','schedule:show','5393220dZxJMW','getTime','π
\x20','Schedule\x20updated:\x20','output','No\x20scheduled\x20queries\x20found','join','end_at','delete','Getting\x20schedule\x20details...','retry_limit','\x20\x20Num:\x20','nextRun','Update\x20a\x20scheduled\x20query','soon','schedule:update','\x20job','\x20\x20Type:\x20','ies','engine_version','\x20\x20β\x20','description','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','...','schedules','Cancelled','start_at','Updating\x20schedule:\x20','created_at','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','data','INVALID_ARGUMENT','Listing\x20scheduled\x20queries...','run','has_next_page','schedule:run','Creating\x20schedule...','time','m\x20ago','ended_at','\x20(use\x20--limit\x20to\x20see\x20more)','abs','max','schedule:delete','verbose','file','1znTbUc','result'];a34_0x52fc=function(){return _0x1259cf;};return a34_0x52fc();}export class ScheduleHistoryCommand extends BaseCommand{['name']=a34_0x109a39(0x1ca);[a34_0x109a39(0x180)]='Show\x20schedule\x20execution\x20history';[a34_0x109a39(0x1b9)](_0xfda32d){const _0x1b07d3=a34_0x109a39,_0x94339e=_0xfda32d[_0x1b07d3(0x1ce)][0x0];if(!_0x94339e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x51532f){const _0x13c07d=a34_0x109a39,{options:_0x344327,args:_0x5919fb,tdx:_0x138d74}=_0x51532f,_0x58eaa3=_0x5919fb[0x0],_0x3e784d=_0x344327,_0x41da93=_0x3e784d[_0x13c07d(0x1d1)]!==undefined?Number(_0x3e784d[_0x13c07d(0x1d1)]):undefined,_0x50a7cb=_0x3e784d['to']!==undefined?Number(_0x3e784d['to']):undefined,_0x343474=await withSpinner(_0x13c07d(0x167),()=>_0x138d74[_0x13c07d(0x183)][_0x13c07d(0x1cc)](_0x58eaa3,{'from':_0x41da93,'to':_0x50a7cb}),{'verbose':_0x344327[_0x13c07d(0x197)]}),_0x38e1fb=_0x343474[_0x13c07d(0x189)];console[_0x13c07d(0x1ae)](_0x13c07d(0x1ab)+_0x38e1fb['count']+'\x20execution'+(_0x38e1fb[_0x13c07d(0x1a1)]!==0x1?'s':'')+_0x13c07d(0x150)+_0x38e1fb[_0x13c07d(0x1d1)]+'-'+_0x38e1fb['to']+')');const _0xf3d8b3=_0x38e1fb['history'][_0x13c07d(0x158)](_0x2c864f=>({'job_id':_0x2c864f[_0x13c07d(0x1cb)],'type':_0x2c864f[_0x13c07d(0x1d4)],'status':_0x2c864f['status'],'scheduled_at':_0x2c864f['scheduled_at'],'created_at':_0x2c864f[_0x13c07d(0x187)],'start_at':_0x2c864f[_0x13c07d(0x185)],'end_at':_0x2c864f[_0x13c07d(0x172)]}));return await handleSDKOutput(_0xf3d8b3,_0x344327),0x0;}}
|
|
1
|
+
const a34_0x5505b1=a34_0x151c;(function(_0x4f80b6,_0x3ea665){const _0x4584d2=a34_0x151c,_0x4effc9=_0x4f80b6();while(!![]){try{const _0xab611a=-parseInt(_0x4584d2(0xde))/0x1+parseInt(_0x4584d2(0x13f))/0x2*(parseInt(_0x4584d2(0x101))/0x3)+parseInt(_0x4584d2(0x13a))/0x4+-parseInt(_0x4584d2(0x118))/0x5*(-parseInt(_0x4584d2(0x11f))/0x6)+parseInt(_0x4584d2(0xda))/0x7+parseInt(_0x4584d2(0xfd))/0x8*(-parseInt(_0x4584d2(0xcb))/0x9)+parseInt(_0x4584d2(0xc9))/0xa;if(_0xab611a===_0x3ea665)break;else _0x4effc9['push'](_0x4effc9['shift']());}catch(_0xefb307){_0x4effc9['push'](_0x4effc9['shift']());}}}(a34_0x23c9,0x94248));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x151c(_0xf07bad,_0x2e5bd6){_0xf07bad=_0xf07bad-0xb9;const _0x23c9bd=a34_0x23c9();let _0x151c0a=_0x23c9bd[_0xf07bad];return _0x151c0a;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a34_0x23c9(){const _0x14d230=['utf-8','user','2kEzZKx','format','schedule:create','length','abs','repeat','trino','Schedule\x20deleted:\x20','file','Running\x20schedule...','h\x20ago','show','schedule:show','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','log','start_at','d\x20ago','entries','jsonl','\x20scheduled\x20quer','tsv','5505320nLDILv','execute','1684494ttMvbY','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','List\x20scheduled\x20queries','Update\x20a\x20scheduled\x20query','padEnd','schedule:update','ended_at','\x20(use\x20--limit\x20to\x20see\x20more)','args','Searching\x20scheduled\x20queries\x20matching\x20\x22','No\x20scheduled\x20queries\x20found','round','trim','\x22...','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','2573032wrDTHP','\x20\x20Timezone:\x20','cron','Showing\x20first\x20','258091sdcDdA','yes','verbose','next_run_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Cancelled','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','priority','cyan','Create\x20a\x20scheduled\x20query','scheduled_at','map','statusIcon','last_job','limit','m\x20ago','\x20\x20Cron:\x20','updated_at','create','\x20\x20β\x20','history','nextRun','time','count','delay','retryLimit','(unnamed)','schedule:delete','toLocaleDateString','\x20\x20Time:\x20','24VFNaZa','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','executing_user_id','query','732873xzxpVc','Failed\x20to\x20read\x20file:\x20','retry_limit','schedules','ies','\x20\x20Type:\x20','delete','run','\x20job','Schedule\x20run\x20submitted:\x20','in\x20','Updating\x20schedule:\x20','user_name','\x20\x20Num:\x20','lastRun','...','getTime','num','json','error','created_at','data','pagination','123635vBkunN','queries','Schedule\x20created:\x20','jobs','from','success','engine_version','42KfqBHB','\x20matching\x20\x22','Found\x20','job_id','keys','site','result','validate','Getting\x20schedule\x20history...','status','description','name','queryUrl','Creating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Deleting\x20schedule...','database','/app/queries/editor?queryId=','Schedule\x20updated:\x20','soon','Listing\x20scheduled\x20queries...','Creating\x20schedule:\x20','Show\x20schedule\x20details','timezone','Delete\x20a\x20scheduled\x20query','type','Running\x20schedule:\x20','363572mmPtSa','engineVersion','max'];a34_0x23c9=function(){return _0x14d230;};return a34_0x23c9();}import a34_0x233df7 from'chalk';function formatRelativeTime(_0xa4c81f){const _0x396c4a=a34_0x151c,_0x29422c=new Date(_0xa4c81f),_0x2cadff=new Date(),_0x3a85dc=_0x29422c[_0x396c4a(0x111)]()-_0x2cadff['getTime'](),_0x205792=Math[_0x396c4a(0x143)](_0x3a85dc)/0x3e8,_0x5cdd61=_0x3a85dc<0x0;if(_0x205792<0x3c)return _0x5cdd61?'just\x20now':_0x396c4a(0x132);else{if(_0x205792<0xe10){const _0xb973a3=Math[_0x396c4a(0xd6)](_0x205792/0x3c);return _0x5cdd61?_0xb973a3+_0x396c4a(0xee):_0x396c4a(0x10b)+_0xb973a3+'m';}else{if(_0x205792<0x15180){const _0x4423ec=Math[_0x396c4a(0xd6)](_0x205792/0xe10);return _0x5cdd61?_0x4423ec+_0x396c4a(0xbe):_0x396c4a(0x10b)+_0x4423ec+'h';}else{if(_0x205792<0x93a80){const _0x13502e=Math['round'](_0x205792/0x15180);return _0x5cdd61?_0x13502e+_0x396c4a(0xc4):'in\x20'+_0x13502e+'d';}else return _0x29422c[_0x396c4a(0xfb)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']='schedule:list';['description']=a34_0x5505b1(0xcd);async[a34_0x5505b1(0xca)](_0x56011d){const _0x2ec66b=a34_0x5505b1,{options:_0x3149c4,args:_0x2795ec,tdx:_0x12f35a}=_0x56011d,_0x2c9def=resolveLimit(_0x3149c4[_0x2ec66b(0xed)],DEFAULT_DISPLAY_LIMIT),_0x232b3a=_0x2795ec[0x0],_0x4d921b=_0x232b3a?_0x2ec66b(0xd4)+_0x232b3a+_0x2ec66b(0xd8):_0x2ec66b(0x133),_0x37375e=await withSpinner(_0x4d921b,()=>_0x12f35a[_0x2ec66b(0x104)]['listQueries']({'limit':_0x2c9def,'scheduled':!![],'pattern':_0x232b3a}),{'verbose':_0x3149c4[_0x2ec66b(0xe0)]}),_0x137ec6=_0x37375e['data'][_0x2ec66b(0x119)],_0x5b37a7=_0x37375e[_0x2ec66b(0x116)][_0x2ec66b(0x117)]['has_next_page'],_0x180a33=_0x232b3a?_0x2ec66b(0x120)+_0x232b3a+'\x22':'';_0x5b37a7?console['error'](_0x2ec66b(0xdd)+_0x137ec6[_0x2ec66b(0x142)]+'\x20schedules'+_0x180a33+_0x2ec66b(0xd2)):console[_0x2ec66b(0x114)](_0x2ec66b(0x121)+_0x137ec6[_0x2ec66b(0x142)]+_0x2ec66b(0xc7)+(_0x137ec6[_0x2ec66b(0x142)]!==0x1?_0x2ec66b(0x105):'y')+_0x180a33);if(_0x3149c4['format']===_0x2ec66b(0x113)||_0x3149c4[_0x2ec66b(0x140)]===_0x2ec66b(0xc6)||_0x3149c4[_0x2ec66b(0x140)]==='table'||_0x3149c4['format']===_0x2ec66b(0xc8)){const _0x45b7ec=_0x137ec6['map'](_0x2349eb=>({'id':_0x2349eb['id'],'name':_0x2349eb[_0x2ec66b(0x12a)],'cron':_0x2349eb[_0x2ec66b(0xdc)],'database':_0x2349eb[_0x2ec66b(0x12f)]?.[_0x2ec66b(0x12a)],'type':_0x2349eb[_0x2ec66b(0x138)],'timezone':_0x2349eb['time_zone'],'user_name':_0x2349eb[_0x2ec66b(0x13e)]?.[_0x2ec66b(0x12a)],'updated_at':_0x2349eb[_0x2ec66b(0xf0)],'next_run_at':_0x2349eb[_0x2ec66b(0xe1)],'last_job_status':_0x2349eb[_0x2ec66b(0xec)]?.['status']}));await handleSDKOutput(_0x45b7ec,_0x3149c4);}else{if(_0x137ec6[_0x2ec66b(0x142)]===0x0)console[_0x2ec66b(0xc2)](_0x2ec66b(0xd5));else{const _0x200a71=_0x3149c4[_0x2ec66b(0x124)],_0x18a947=_0x137ec6[_0x2ec66b(0xea)](_0x561b59=>{const _0x514865=_0x2ec66b,_0x37d69f=_0x561b59[_0x514865(0xec)]?.[_0x514865(0x128)]?_0x561b59[_0x514865(0xec)][_0x514865(0x128)]===_0x514865(0x11d)?'β':'β':'-',_0x15d247=_0x561b59[_0x514865(0xec)]?.[_0x514865(0xd1)]?formatRelativeTime(_0x561b59[_0x514865(0xec)][_0x514865(0xd1)]):'never',_0xb8b1ff=_0x561b59[_0x514865(0xe1)]?formatRelativeTime(_0x561b59[_0x514865(0xe1)]):'-',_0xe8dd07=_0x561b59[_0x514865(0xdc)]||'',_0x32c084=_0x561b59[_0x514865(0x12a)]||_0x514865(0xf9),_0x5a378e=getConsoleUrl(_0x200a71,_0x514865(0x130)+_0x561b59['id']);return{'statusIcon':_0x37d69f,'lastRun':_0x15d247,'nextRun':_0xb8b1ff,'cron':_0xe8dd07,'name':_0x32c084,'queryUrl':_0x5a378e,'status':_0x561b59[_0x514865(0xec)]?.['status']};}),_0x18691b=Math[_0x2ec66b(0x13c)](..._0x18a947['map'](_0xece04c=>_0xece04c[_0x2ec66b(0x10f)][_0x2ec66b(0x142)])),_0xe38337=Math[_0x2ec66b(0x13c)](..._0x18a947[_0x2ec66b(0xea)](_0x8035c3=>_0x8035c3[_0x2ec66b(0xf4)]['length'])),_0x12ce44=Math[_0x2ec66b(0x13c)](..._0x18a947[_0x2ec66b(0xea)](_0x4e6a55=>_0x4e6a55[_0x2ec66b(0xdc)][_0x2ec66b(0x142)])),_0x2ed1b1=_0x18a947[_0x2ec66b(0xea)](_0x44a138=>{const _0x507a0b=_0x2ec66b,_0x40897a=_0x44a138[_0x507a0b(0x128)]===_0x507a0b(0x11d)?a34_0x233df7['green'](_0x44a138[_0x507a0b(0xeb)]):_0x44a138['status']==='error'?a34_0x233df7['red'](_0x44a138[_0x507a0b(0xeb)]):a34_0x233df7['dim'](_0x44a138[_0x507a0b(0xeb)]),_0x8824a7=_0x44a138[_0x507a0b(0x10f)][_0x507a0b(0xcf)](_0x18691b),_0x3d0bc6=_0x44a138[_0x507a0b(0xf4)][_0x507a0b(0xcf)](_0xe38337),_0x477c68=_0x44a138[_0x507a0b(0xdc)]?a34_0x233df7[_0x507a0b(0xe7)](_0x44a138['cron'][_0x507a0b(0xcf)](_0x12ce44)):'\x20'[_0x507a0b(0xb9)](_0x12ce44),_0x72ac97=hyperlink(_0x44a138[_0x507a0b(0x12a)],_0x44a138[_0x507a0b(0x12b)]);return'π
\x20'+_0x40897a+'\x20'+_0x8824a7+_0x507a0b(0xf2)+_0x3d0bc6+'\x20\x20'+_0x477c68+'\x20\x20'+_0x72ac97;});await writeOutput(_0x2ed1b1['join']('\x0a'),_0x3149c4['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0xc0);[a34_0x5505b1(0x129)]=a34_0x5505b1(0x135);[a34_0x5505b1(0x126)](_0x1ee35b){const _0x686a39=a34_0x5505b1,_0x32eaf1=_0x1ee35b[_0x686a39(0xd3)][0x0];if(!_0x32eaf1)return _0x686a39(0xfe);return undefined;}async['execute'](_0x268a80){const _0x25e79e=a34_0x5505b1,{options:_0x293e35,args:_0x43a13f,tdx:_0x591420}=_0x268a80,_0x2fc837=_0x43a13f[0x0],_0x5878fb=await withSpinner('Getting\x20schedule\x20details...',()=>_0x591420[_0x25e79e(0x104)][_0x25e79e(0xbf)](_0x2fc837),{'verbose':_0x293e35['verbose']}),_0x4d6942=_0x5878fb['data'],_0xddee88={'name':_0x4d6942['name'],'cron':_0x4d6942['cron'],'database':_0x4d6942['database'],'type':_0x4d6942[_0x25e79e(0x138)],'timezone':_0x4d6942[_0x25e79e(0x136)],'user_name':_0x4d6942[_0x25e79e(0x10d)],'created_at':_0x4d6942[_0x25e79e(0x115)],'engine_version':_0x4d6942[_0x25e79e(0x11e)],'executing_user_id':_0x4d6942[_0x25e79e(0xff)],'query':_0x4d6942['query'],'delay':_0x4d6942[_0x25e79e(0xf7)],'priority':_0x4d6942[_0x25e79e(0xe6)],'retry_limit':_0x4d6942[_0x25e79e(0x103)],..._0x4d6942[_0x25e79e(0x125)]&&{'result':_0x4d6942[_0x25e79e(0x125)]}};return await handleSingleObjectOutput(_0xddee88,_0x293e35),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0x141);[a34_0x5505b1(0x129)]=a34_0x5505b1(0xe8);[a34_0x5505b1(0x126)](_0x287911){const _0x589fc6=a34_0x5505b1,_0x4d438b=_0x287911[_0x589fc6(0xd3)][0x0];if(!_0x4d438b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x32bc64=_0x287911['options'];if(!_0x32bc64[_0x589fc6(0x12f)])return _0x589fc6(0xd9);return undefined;}async[a34_0x5505b1(0xca)](_0x101438){const _0x558f5b=a34_0x5505b1,{options:_0x369452,args:_0x40b5ec,tdx:_0x31b431}=_0x101438,_0x1b8825=_0x40b5ec[0x0],_0x1729d4=_0x369452,_0x255a33=_0x1729d4[_0x558f5b(0x12f)],_0x3a4610=_0x1729d4['file'],_0x28da45=_0x1729d4[_0x558f5b(0x138)]||_0x558f5b(0xba);let _0x217c41;try{_0x217c41=readFileSync(_0x3a4610,_0x558f5b(0x13d))['trim']();}catch(_0x10c3fb){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x558f5b(0x102)+_0x3a4610,_0x10c3fb instanceof Error?_0x10c3fb:undefined);}if(!_0x217c41)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20file\x20is\x20empty');const _0x3f4550={'database':_0x255a33,'query':_0x217c41,'type':_0x28da45};if(_0x1729d4[_0x558f5b(0xdc)])_0x3f4550[_0x558f5b(0xdc)]=_0x1729d4['cron'];if(_0x1729d4[_0x558f5b(0x136)])_0x3f4550[_0x558f5b(0x136)]=_0x1729d4[_0x558f5b(0x136)];if(_0x1729d4[_0x558f5b(0xf7)]!==undefined)_0x3f4550[_0x558f5b(0xf7)]=Number(_0x1729d4['delay']);if(_0x1729d4[_0x558f5b(0xe6)]!==undefined)_0x3f4550[_0x558f5b(0xe6)]=Number(_0x1729d4[_0x558f5b(0xe6)]);if(_0x1729d4[_0x558f5b(0xf8)]!==undefined)_0x3f4550['retry_limit']=Number(_0x1729d4[_0x558f5b(0xf8)]);if(_0x1729d4['engineVersion'])_0x3f4550['engine_version']=_0x1729d4[_0x558f5b(0x13b)];if(_0x1729d4[_0x558f5b(0x125)])_0x3f4550['result']=_0x1729d4[_0x558f5b(0x125)];if(_0x369452['verbose']){console['error'](_0x558f5b(0x134)+_0x1b8825),console[_0x558f5b(0x114)]('\x20\x20Database:\x20'+_0x255a33),console[_0x558f5b(0x114)](_0x558f5b(0x106)+_0x28da45);if(_0x3f4550[_0x558f5b(0xdc)])console[_0x558f5b(0x114)](_0x558f5b(0xef)+_0x3f4550[_0x558f5b(0xdc)]);if(_0x3f4550[_0x558f5b(0x136)])console['error'](_0x558f5b(0xdb)+_0x3f4550[_0x558f5b(0x136)]);}const _0x439df9=await withSpinner(_0x558f5b(0x12c),()=>_0x31b431['schedules'][_0x558f5b(0xf1)](_0x1b8825,_0x3f4550),{'verbose':_0x369452[_0x558f5b(0xe0)]});return console['error'](_0x558f5b(0x11a)+_0x439df9['data'][_0x558f5b(0x12a)]),await handleSingleObjectOutput(_0x439df9[_0x558f5b(0x116)],_0x369452),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0xd0);[a34_0x5505b1(0x129)]=a34_0x5505b1(0xce);['validate'](_0x155236){const _0x1ea93c=a34_0x5505b1,_0x46a40d=_0x155236[_0x1ea93c(0xd3)][0x0];if(!_0x46a40d)return _0x1ea93c(0xc1);return undefined;}async[a34_0x5505b1(0xca)](_0x221cdd){const _0x301beb=a34_0x5505b1,{options:_0x52ac62,args:_0x56a93d,tdx:_0x3e8aca}=_0x221cdd,_0x2d2616=_0x56a93d[0x0],_0x2fb703=_0x52ac62,_0x18d4df={};if(_0x2fb703[_0x301beb(0x12f)])_0x18d4df[_0x301beb(0x12f)]=_0x2fb703['database'];if(_0x2fb703[_0x301beb(0x138)])_0x18d4df[_0x301beb(0x138)]=_0x2fb703[_0x301beb(0x138)];if(_0x2fb703[_0x301beb(0xdc)])_0x18d4df['cron']=_0x2fb703[_0x301beb(0xdc)];if(_0x2fb703['timezone'])_0x18d4df[_0x301beb(0x136)]=_0x2fb703[_0x301beb(0x136)];if(_0x2fb703[_0x301beb(0xf7)]!==undefined)_0x18d4df['delay']=Number(_0x2fb703[_0x301beb(0xf7)]);if(_0x2fb703[_0x301beb(0xe6)]!==undefined)_0x18d4df[_0x301beb(0xe6)]=Number(_0x2fb703['priority']);if(_0x2fb703[_0x301beb(0xf8)]!==undefined)_0x18d4df[_0x301beb(0x103)]=Number(_0x2fb703['retryLimit']);if(_0x2fb703[_0x301beb(0x13b)])_0x18d4df[_0x301beb(0x11e)]=_0x2fb703[_0x301beb(0x13b)];if(_0x2fb703[_0x301beb(0x125)])_0x18d4df['result']=_0x2fb703['result'];if(_0x2fb703[_0x301beb(0xbc)])try{_0x18d4df['query']=readFileSync(_0x2fb703[_0x301beb(0xbc)],_0x301beb(0x13d))[_0x301beb(0xd7)]();}catch(_0x1acc92){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x301beb(0x102)+_0x2fb703[_0x301beb(0xbc)],_0x1acc92 instanceof Error?_0x1acc92:undefined);}if(Object[_0x301beb(0x123)](_0x18d4df)['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x52ac62[_0x301beb(0xe0)]){console[_0x301beb(0x114)](_0x301beb(0x10c)+_0x2d2616);for(const [_0x1b375b,_0x380f91]of Object[_0x301beb(0xc5)](_0x18d4df)){_0x1b375b===_0x301beb(0x100)?console[_0x301beb(0x114)]('\x20\x20'+_0x1b375b+':\x20'+_0x380f91['substring'](0x0,0x32)+_0x301beb(0x110)):console[_0x301beb(0x114)]('\x20\x20'+_0x1b375b+':\x20'+_0x380f91);}}const _0x636e3=await withSpinner('Updating\x20schedule...',()=>_0x3e8aca['schedules']['update'](_0x2d2616,_0x18d4df),{'verbose':_0x52ac62[_0x301beb(0xe0)]});return console['error'](_0x301beb(0x131)+_0x636e3[_0x301beb(0x116)][_0x301beb(0x12a)]),await handleSingleObjectOutput(_0x636e3[_0x301beb(0x116)],_0x52ac62),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x5505b1(0xfa);[a34_0x5505b1(0x129)]=a34_0x5505b1(0x137);['validate'](_0xe62f72){const _0xacb3c1=a34_0x5505b1,_0x5123a7=_0xe62f72[_0xacb3c1(0xd3)][0x0];if(!_0x5123a7)return _0xacb3c1(0x12d);return undefined;}async[a34_0x5505b1(0xca)](_0x50fdd7){const _0x25fd41=a34_0x5505b1,{options:_0x5269e8,args:_0x208d73,tdx:_0x57bba5}=_0x50fdd7,_0x485551=_0x208d73[0x0];if(!_0x5269e8[_0x25fd41(0xdf)]){const _0x4ac666=await confirm(_0x25fd41(0xcc)+_0x485551+'\x22?');if(!_0x4ac666)return console[_0x25fd41(0x114)](_0x25fd41(0xe3)),0x0;}const _0x1643ea=await withSpinner(_0x25fd41(0x12e),()=>_0x57bba5[_0x25fd41(0x104)][_0x25fd41(0x107)](_0x485551),{'verbose':_0x5269e8[_0x25fd41(0xe0)]});return console[_0x25fd41(0x114)](_0x25fd41(0xbb)+_0x1643ea['data']['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x5505b1(0x12a)]='schedule:run';['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a34_0x5505b1(0x126)](_0x18b7a7){const _0x917dc0=a34_0x5505b1,_0x2271c9=_0x18b7a7['args'][0x0];if(!_0x2271c9)return _0x917dc0(0xe5);return undefined;}async['execute'](_0x2750f5){const _0xa9a562=a34_0x5505b1,{options:_0x5877a0,args:_0xc436d5,tdx:_0x2feba2}=_0x2750f5,_0x48f9dc=_0xc436d5[0x0],_0x398cfe=_0x5877a0,_0x483879=_0x398cfe[_0xa9a562(0xf5)],_0x21d4bc=_0x398cfe[_0xa9a562(0x112)]!==undefined?Number(_0x398cfe[_0xa9a562(0x112)]):undefined;if(_0x5877a0[_0xa9a562(0xe0)]){console[_0xa9a562(0x114)](_0xa9a562(0x139)+_0x48f9dc);if(_0x483879)console[_0xa9a562(0x114)](_0xa9a562(0xfc)+_0x483879);if(_0x21d4bc)console[_0xa9a562(0x114)](_0xa9a562(0x10e)+_0x21d4bc);}const _0x7a427c=await withSpinner(_0xa9a562(0xbd),()=>_0x2feba2[_0xa9a562(0x104)][_0xa9a562(0x108)](_0x48f9dc,{'time':_0x483879,'num':_0x21d4bc}),{'verbose':_0x5877a0[_0xa9a562(0xe0)]}),_0x573184=_0x7a427c[_0xa9a562(0x116)][_0xa9a562(0x11b)];console[_0xa9a562(0x114)](_0xa9a562(0x10a)+_0x573184['length']+_0xa9a562(0x109)+(_0x573184[_0xa9a562(0x142)]!==0x1?'s':'')+'\x20created');for(const _0x18deaf of _0x573184){console[_0xa9a562(0x114)]('\x20\x20Job\x20ID:\x20'+_0x18deaf[_0xa9a562(0x122)]);}return await handleSDKOutput(_0x573184,_0x5877a0),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a34_0x5505b1(0x129)]=a34_0x5505b1(0xe4);[a34_0x5505b1(0x126)](_0x1668d4){const _0x1b9660=a34_0x5505b1,_0x484801=_0x1668d4['args'][0x0];if(!_0x484801)return _0x1b9660(0xe2);return undefined;}async[a34_0x5505b1(0xca)](_0x416ba1){const _0x2dac8e=a34_0x5505b1,{options:_0x2b5bf6,args:_0x5aa402,tdx:_0x40af44}=_0x416ba1,_0x259a4d=_0x5aa402[0x0],_0x399463=_0x2b5bf6,_0x1ab79b=_0x399463['from']!==undefined?Number(_0x399463[_0x2dac8e(0x11c)]):undefined,_0xd7636d=_0x399463['to']!==undefined?Number(_0x399463['to']):undefined,_0x3b86b4=await withSpinner(_0x2dac8e(0x127),()=>_0x40af44[_0x2dac8e(0x104)]['history'](_0x259a4d,{'from':_0x1ab79b,'to':_0xd7636d}),{'verbose':_0x2b5bf6[_0x2dac8e(0xe0)]}),_0x31701d=_0x3b86b4['data'];console[_0x2dac8e(0x114)](_0x2dac8e(0x121)+_0x31701d[_0x2dac8e(0xf6)]+'\x20execution'+(_0x31701d[_0x2dac8e(0xf6)]!==0x1?'s':'')+'\x20(showing\x20'+_0x31701d[_0x2dac8e(0x11c)]+'-'+_0x31701d['to']+')');const _0x3d24b6=_0x31701d[_0x2dac8e(0xf3)]['map'](_0x1e1290=>({'job_id':_0x1e1290[_0x2dac8e(0x122)],'type':_0x1e1290['type'],'status':_0x1e1290[_0x2dac8e(0x128)],'scheduled_at':_0x1e1290[_0x2dac8e(0xe9)],'created_at':_0x1e1290[_0x2dac8e(0x115)],'start_at':_0x1e1290[_0x2dac8e(0xc3)],'end_at':_0x1e1290['end_at']}));return await handleSDKOutput(_0x3d24b6,_0x2b5bf6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0xcd4784=a35_0x23e7;(function(_0x1ed834,_0x14137d){const _0x2f8f92=a35_0x23e7,_0xbef112=_0x1ed834();while(!![]){try{const _0x1ffa67=-parseInt(_0x2f8f92(0x27f))/0x1+parseInt(_0x2f8f92(0x209))/0x2*(-parseInt(_0x2f8f92(0x264))/0x3)+-parseInt(_0x2f8f92(0x228))/0x4*(parseInt(_0x2f8f92(0x26d))/0x5)+-parseInt(_0x2f8f92(0x1ff))/0x6+parseInt(_0x2f8f92(0x1eb))/0x7*(-parseInt(_0x2f8f92(0x272))/0x8)+parseInt(_0x2f8f92(0x21f))/0x9+parseInt(_0x2f8f92(0x219))/0xa;if(_0x1ffa67===_0x14137d)break;else _0xbef112['push'](_0xbef112['shift']());}catch(_0x522ba7){_0xbef112['push'](_0xbef112['shift']());}}}(a35_0xbb56,0xbf60a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a35_0x23e7(_0x4632fc,_0x1e7f41){_0x4632fc=_0x4632fc-0x1da;const _0xbb5671=a35_0xbb56();let _0x23e7ab=_0xbb5671[_0x4632fc];return _0x23e7ab;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a35_0xbb56(){const _0x5dc2d1=['Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','log','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','segment:folder:list','segment','Resolved\x20YAML\x20file:\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','json','996737mFYmUA','folder','Segment\x20ID:\x20','resolvePathToResource','Use:\x20tdx\x20ps\x20desc','toLocaleString','Fetching\x20SQL\x20for\x20segment...','getSQLFromServerSegment','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','length','content','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','red','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','limit','Error:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','6674070WyJYoJ','Use:\x20tdx\x20ps\x20show','Fetching\x20folder\x20details...','Fetching\x20segment\x20details...','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','segmentPath','parentId','Resolved\x20folder\x20ID:\x20','\x20\x20Cause:\x20','path','190qEQVjr','data','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','SQL\x20query:\x0a','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','listFolders','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20ID:\x20','green','parent','Use:\x20tdx\x20ps\x20view','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getSQLFromYamlFile','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','42308000kKrxry','β\x20Query\x20failed\x20[','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','web','getSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','13776624mWudSx','cause','verbose','segment:view','segment:show','getSegmentSQLFromYaml','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','jsonl','site','5457044YGbUSI','in\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Folder\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20parent\x20segment\x20details...','folderId','Examples:','Site:\x20','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','β\x20Query\x20completed:\x20Processed\x20','\x20rows\x20','Folder\x20name:\x20','/e/','processedRows','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20from\x20rule...','segmentName','createFolder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','execute','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','jobId','Resolving\x20\x27','\x27...','Creating\x20folder\x20\x27','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Segment\x20ID\x20missing\x20from\x20resolved\x20path','message','Executing\x20segment\x20query...','segment:sql','getParent','resolveParentId','resolveFolderId','Target\x20path:\x20','(root)','\x20\x20Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:describe','parentSegment','segment:folder:create','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','/app/ps/','parentFolder','fullPath','information_schema','\x20\x20tdx\x20sg\x20sql\x20--path\x20','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','stats','query','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','25143NxvuUv','folderPath','Fetching\x20folder\x20\x27','\x20folder','SEGMENT_NOT_FOUND','INVALID_ARGUMENT','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x27\x20with\x20ID:\x20','Usage:','5zViHgE','Parent\x20name:\x20','Resolving\x20path\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','β\x20Created\x20folder\x20\x27','40pqxRsN','description','trim','Resolved\x20parent\x20folder\x20ID:\x20','segmentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','name','Resolved\x20type:\x20','code','Options:','setJobId','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20Parent\x20segment:\x20','992898VCwgOz','error','segment:folder:show','\x20\x20Segment\x20name:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20[Job\x20ID:\x20','format','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view\x20-w','Resolved:\x20','Resolving\x20parent\x20folder\x20\x27'];a35_0xbb56=function(){return _0x5dc2d1;};return a35_0xbb56();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x46420a from'chalk';async function resolveSegmentTarget(_0x11ead4,_0x4b4479,_0x1dde3a){const _0x4a32da=a35_0x23e7;if(isYamlFilePath(_0x11ead4))try{const _0x5b47d8=await resolveYamlFilePath(_0x11ead4);return _0x1dde3a&&(console[_0x4a32da(0x280)](_0x4a32da(0x1e8)+_0x11ead4),console['error'](_0x4a32da(0x27e)+_0x5b47d8[_0x4a32da(0x254)]),console[_0x4a32da(0x280)](_0x4a32da(0x1da)+_0x5b47d8[_0x4a32da(0x23c)]),console[_0x4a32da(0x280)](_0x4a32da(0x251)+(_0x5b47d8[_0x4a32da(0x265)]||_0x4a32da(0x250))),console[_0x4a32da(0x280)](_0x4a32da(0x25e)+_0x5b47d8['fullPath'])),_0x5b47d8[_0x4a32da(0x25b)];}catch(_0x385a7d){throw new SDKError(ErrorCode[_0x4a32da(0x269)],_0x4a32da(0x218)+_0x385a7d['message']);}if(!_0x4b4479)throw new SDKError(ErrorCode[_0x4a32da(0x269)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4b4479+'/'+_0x11ead4;}export class SegmentDescribeCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x253);[a35_0xcd4784(0x273)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0xcd4784(0x23f)](_0x35addb){const _0x16ac65=a35_0xcd4784,{options:_0x33f47c,args:_0x405506,tdx:_0x12bd05}=_0x35addb,_0x184314=_0x405506[0x0],_0x26caed=!_0x184314&&!!_0x33f47c[_0x16ac65(0x254)],_0x338f47=_0x184314||_0x33f47c[_0x16ac65(0x254)];if(!_0x338f47)return console[_0x16ac65(0x280)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x16ac65(0x280)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x16ac65(0x280)](_0x16ac65(0x22f)),console[_0x16ac65(0x280)](_0x16ac65(0x240)),console['error'](_0x16ac65(0x234)),console[_0x16ac65(0x280)](_0x16ac65(0x1f3)),console[_0x16ac65(0x280)](_0x16ac65(0x225)),0x1;try{const _0x415d85=_0x33f47c[_0x16ac65(0x204)];let _0x4d6a9b=_0x338f47;!_0x26caed&&_0x415d85&&!_0x338f47['includes']('/')&&(_0x4d6a9b=_0x415d85+'/'+_0x338f47,_0x33f47c[_0x16ac65(0x221)]&&console[_0x16ac65(0x280)](_0x16ac65(0x257)+_0x4d6a9b));const _0x3dba7e=await withSpinner(_0x16ac65(0x26f)+_0x4d6a9b+_0x16ac65(0x243),()=>_0x12bd05['segment']['resolvePathToResource'](_0x4d6a9b),{'verbose':_0x33f47c['verbose']}),_0xd894e0=_0x3dba7e[_0x16ac65(0x20a)];_0x33f47c['verbose']&&(console[_0x16ac65(0x280)](_0x16ac65(0x279)+_0xd894e0[_0x16ac65(0x233)]),console[_0x16ac65(0x280)]('Parent\x20ID:\x20'+_0xd894e0[_0x16ac65(0x205)]),_0xd894e0[_0x16ac65(0x22e)]&&console[_0x16ac65(0x280)](_0x16ac65(0x22b)+_0xd894e0[_0x16ac65(0x22e)]),_0xd894e0[_0x16ac65(0x276)]&&console[_0x16ac65(0x280)](_0x16ac65(0x1ed)+_0xd894e0['segmentId']));if(_0xd894e0[_0x16ac65(0x233)]===_0x16ac65(0x214)){const _0x3398c1=await withSpinner(_0x16ac65(0x22d),()=>_0x12bd05[_0x16ac65(0x1e7)][_0x16ac65(0x24c)](_0xd894e0[_0x16ac65(0x205)]),{'verbose':_0x33f47c['verbose']});await handleSingleObjectOutput(_0x3398c1[_0x16ac65(0x20a)],_0x33f47c);}else{if(_0xd894e0[_0x16ac65(0x233)]===_0x16ac65(0x1ec)){if(!_0xd894e0[_0x16ac65(0x22e)])throw new SDKError(ErrorCode[_0x16ac65(0x1fb)],_0x16ac65(0x1f7));const _0x201fad=await withSpinner('Fetching\x20folder\x20details...',()=>_0x12bd05[_0x16ac65(0x1e7)]['getFolder'](_0xd894e0[_0x16ac65(0x22e)]),{'verbose':_0x33f47c[_0x16ac65(0x221)]});await handleSingleObjectOutput(_0x201fad[_0x16ac65(0x20a)],_0x33f47c);}else{if(_0xd894e0['type']===_0x16ac65(0x1e7)){if(!_0xd894e0['segmentId'])throw new SDKError(ErrorCode[_0x16ac65(0x268)],_0x16ac65(0x248));const _0x38d2ba=await withSpinner(_0x16ac65(0x202),()=>_0x12bd05[_0x16ac65(0x1e7)][_0x16ac65(0x21d)](_0xd894e0[_0x16ac65(0x205)],_0xd894e0[_0x16ac65(0x276)]),{'verbose':_0x33f47c[_0x16ac65(0x221)]});await handleSingleObjectOutput(_0x38d2ba[_0x16ac65(0x20a)],_0x33f47c);}}}return 0x0;}catch(_0x642490){if(_0x642490 instanceof SDKError)return console[_0x16ac65(0x280)](_0x16ac65(0x1fd)+_0x642490[_0x16ac65(0x249)]),_0x642490[_0x16ac65(0x220)]&&console['error'](_0x16ac65(0x207)+_0x642490[_0x16ac65(0x220)]),0x1;throw _0x642490;}}}export class SegmentShowCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x223);[a35_0xcd4784(0x273)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a35_0xcd4784(0x23f)](_0x4d940c){const _0xf5c438=a35_0xcd4784,{options:_0x4f8651,args:_0x551f9c,tdx:_0xbb435e}=_0x4d940c,_0x124a19=_0x551f9c[0x0];if(!_0x124a19)return console[_0xf5c438(0x280)](_0xf5c438(0x1db)),console[_0xf5c438(0x280)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0xf5c438(0x280)](_0xf5c438(0x252)),console[_0xf5c438(0x280)](_0xf5c438(0x22f)),console[_0xf5c438(0x280)](_0xf5c438(0x21e)),console['error'](_0xf5c438(0x247)),0x1;try{const _0x2c012a=_0x4f8651['parentSegment'],_0x53faf9=await resolveSegmentTarget(_0x124a19,_0x2c012a,_0x4f8651['verbose']);_0x4f8651[_0xf5c438(0x221)]&&console[_0xf5c438(0x280)](_0xf5c438(0x24f)+_0x53faf9);const _0x15ad44=await withSpinner(_0xf5c438(0x242)+_0x124a19+_0xf5c438(0x243),()=>_0xbb435e['segment'][_0xf5c438(0x1ee)](_0x53faf9),{'verbose':_0x4f8651[_0xf5c438(0x221)]}),_0x2bc697=_0x15ad44[_0xf5c438(0x20a)];_0x4f8651[_0xf5c438(0x221)]&&(console[_0xf5c438(0x280)]('Resolved\x20type:\x20'+_0x2bc697[_0xf5c438(0x233)]),console[_0xf5c438(0x280)](_0xf5c438(0x212)+_0x2bc697['parentId']));if(_0x2bc697[_0xf5c438(0x233)]===_0xf5c438(0x1ec))return console[_0xf5c438(0x280)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0xf5c438(0x280)](_0xf5c438(0x20f)),0x1;if(_0x2bc697[_0xf5c438(0x233)]===_0xf5c438(0x214))return console['error'](_0xf5c438(0x1e3)),console[_0xf5c438(0x280)](_0xf5c438(0x200)),0x1;if(!_0x2bc697[_0xf5c438(0x276)])throw new SDKError(ErrorCode[_0xf5c438(0x268)],_0xf5c438(0x248));const _0x276cdb=await withSpinner(_0xf5c438(0x1f1),()=>_0xbb435e['segment']['getSegmentSQL'](_0x2bc697[_0xf5c438(0x205)],_0x2bc697[_0xf5c438(0x276)]),{'verbose':_0x4f8651[_0xf5c438(0x221)]});let _0xb5b519=_0x276cdb['data'];const _0x22d0ce=resolveLimit(_0x4f8651[_0xf5c438(0x1fc)],DEFAULT_DISPLAY_LIMIT),_0x4c35d9=/\bLIMIT\s+\d+/i['test'](_0xb5b519);!_0x4c35d9&&(_0xb5b519=_0xb5b519[_0xf5c438(0x274)]()['replace'](/;+$/,''),_0xb5b519=_0xf5c438(0x231)+_0xb5b519+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x22d0ce);_0x4f8651['verbose']&&console[_0xf5c438(0x280)](_0xf5c438(0x20c)+_0xb5b519);const _0x2637ef=await withProgressSpinner(_0xf5c438(0x24a),async _0x44a2fd=>{const _0x4bfa29=_0xf5c438,_0x5bb04d=await _0xbb435e[_0x4bfa29(0x261)][_0x4bfa29(0x23f)](_0xb5b519,{'catalog':'td','schema':_0x4bfa29(0x25c),'onJobId':_0x337e7c=>{const _0x5bfbc3=_0x4bfa29;_0x44a2fd[_0x5bfbc3(0x27c)](_0x337e7c);}});return _0x5bb04d;},{'verbose':_0x4f8651[_0xf5c438(0x221)]}),_0x42af68=_0x2637ef[_0xf5c438(0x20a)],_0x3c4065=_0x42af68[_0xf5c438(0x241)]?_0xf5c438(0x1dc)+_0x42af68[_0xf5c438(0x241)]+']':'';return console['error'](_0xf5c438(0x235)+_0x42af68[_0xf5c438(0x260)][_0xf5c438(0x239)][_0xf5c438(0x1f0)]()+_0xf5c438(0x236)+(_0xf5c438(0x229)+formatElapsed(_0x42af68[_0xf5c438(0x260)]['elapsedTimeMillis'])+_0x3c4065)),await handleQueryOutput(_0x42af68,_0x4f8651),0x0;}catch(_0x3dfdaa){if(_0x3dfdaa instanceof SDKError)return console[_0xf5c438(0x280)](_0xf5c438(0x21a)+_0x3dfdaa[_0xf5c438(0x27a)]+']'),console[_0xf5c438(0x280)]('\x0a'+_0x3dfdaa[_0xf5c438(0x249)]),0x1;throw _0x3dfdaa;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x1e6);[a35_0xcd4784(0x273)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x2a986c){const _0x4e8f8d=a35_0xcd4784,{options:_0x5a62f8,args:_0x30806e,tdx:_0x4491f6}=_0x2a986c;if(_0x30806e['length']===0x0)return console[_0x4e8f8d(0x280)](_0x4e8f8d(0x270)),console[_0x4e8f8d(0x280)](_0x4e8f8d(0x20b)),0x1;const _0xdbbfe6=_0x30806e[0x0];try{_0x5a62f8[_0x4e8f8d(0x221)]&&(console['error'](_0x4e8f8d(0x230)+_0x5a62f8['site']),console[_0x4e8f8d(0x280)](_0x4e8f8d(0x26e)+_0xdbbfe6));const _0x3ee60b=await withSpinner(_0x4e8f8d(0x262)+_0xdbbfe6+'\x27...',()=>_0x4491f6['segment'][_0x4e8f8d(0x24d)](_0xdbbfe6),{'verbose':_0x5a62f8[_0x4e8f8d(0x221)]}),_0x280325=_0x3ee60b['data'];_0x5a62f8[_0x4e8f8d(0x221)]&&console[_0x4e8f8d(0x280)](_0x4e8f8d(0x1f8)+_0x280325);const _0x2df397=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0xdbbfe6+_0x4e8f8d(0x243),()=>_0x4491f6[_0x4e8f8d(0x1e7)][_0x4e8f8d(0x20e)](_0x280325),{'verbose':_0x5a62f8[_0x4e8f8d(0x221)]}),_0x231237=_0x2df397['data'];return console[_0x4e8f8d(0x280)]('β\x20Found\x20'+_0x231237['length']+_0x4e8f8d(0x267)+(_0x231237[_0x4e8f8d(0x1f4)]!==0x1?'s':'')),await handleSDKOutput(_0x231237,_0x5a62f8),0x0;}catch(_0x4d5b9c){if(_0x4d5b9c instanceof SDKError)return console[_0x4e8f8d(0x280)]('Error:\x20'+_0x4d5b9c[_0x4e8f8d(0x249)]),_0x4d5b9c[_0x4e8f8d(0x220)]&&console[_0x4e8f8d(0x280)]('\x20\x20Cause:\x20'+_0x4d5b9c[_0x4e8f8d(0x220)]),0x1;throw _0x4d5b9c;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0xcd4784(0x281);[a35_0xcd4784(0x273)]='Show\x20segment\x20folder\x20details';async[a35_0xcd4784(0x23f)](_0x4798d7){const _0x3b6477=a35_0xcd4784,{options:_0x223a13,args:_0x36d9d9,tdx:_0x421944}=_0x4798d7;if(_0x36d9d9[_0x3b6477(0x1f4)]===0x0)return console[_0x3b6477(0x280)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x3b6477(0x280)](_0x3b6477(0x22a)),0x1;try{const {parentId:_0x164906,childId:_0xdac675}=parseSegmentRef(_0x36d9d9[0x0]);_0x223a13['verbose']&&(console['error'](_0x3b6477(0x230)+_0x223a13[_0x3b6477(0x227)]),console[_0x3b6477(0x280)](_0x3b6477(0x26e)+_0x164906),_0xdac675&&console[_0x3b6477(0x280)]('Folder\x20name:\x20'+_0xdac675));if(!_0xdac675)return console[_0x3b6477(0x280)](_0x3b6477(0x21b)),0x1;const _0x4ef387=await withSpinner(_0x3b6477(0x262)+_0x164906+_0x3b6477(0x243),()=>_0x421944['segment'][_0x3b6477(0x24d)](_0x164906),{'verbose':_0x223a13['verbose']}),_0x959b6b=_0x4ef387[_0x3b6477(0x20a)];_0x223a13['verbose']&&console[_0x3b6477(0x280)](_0x3b6477(0x1f8)+_0x959b6b);const _0x3a350e=await withSpinner('Resolving\x20folder\x20\x27'+_0xdac675+_0x3b6477(0x243),()=>_0x421944[_0x3b6477(0x1e7)]['resolveFolderId'](_0x959b6b,_0xdac675),{'verbose':_0x223a13['verbose']}),_0x327dca=_0x3a350e[_0x3b6477(0x20a)];_0x223a13['verbose']&&console[_0x3b6477(0x280)](_0x3b6477(0x206)+_0x327dca);const _0xcdce65=await withSpinner(_0x3b6477(0x266)+_0xdac675+'\x27...',()=>_0x421944[_0x3b6477(0x1e7)]['getFolder'](_0x327dca),{'verbose':_0x223a13[_0x3b6477(0x221)]});return await handleSDKOutput([_0xcdce65[_0x3b6477(0x20a)]],_0x223a13),0x0;}catch(_0xc97d05){if(_0xc97d05 instanceof SDKError)return console[_0x3b6477(0x280)]('Error:\x20'+_0xc97d05[_0x3b6477(0x249)]),_0xc97d05['cause']&&console[_0x3b6477(0x280)]('\x20\x20Cause:\x20'+_0xc97d05[_0x3b6477(0x220)]),0x1;throw _0xc97d05;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x24b);['description']=a35_0xcd4784(0x210);async[a35_0xcd4784(0x23f)](_0x52587a){const _0xe8dda8=a35_0xcd4784,{options:_0x41a95c,args:_0x41f5bf}=_0x52587a,_0x20cf25=_0x41a95c,_0x2520c8=_0x20cf25[_0xe8dda8(0x208)],_0x2de303=_0x41f5bf[0x0];if(!_0x2de303&&!_0x2520c8)return console[_0xe8dda8(0x280)](a35_0x46420a[_0xe8dda8(0x1f9)](_0xe8dda8(0x258))),console[_0xe8dda8(0x280)](_0xe8dda8(0x26c)),console[_0xe8dda8(0x280)](_0xe8dda8(0x211)),console[_0xe8dda8(0x280)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0xe8dda8(0x280)](_0xe8dda8(0x22f)),console['error'](_0xe8dda8(0x1fa)),console[_0xe8dda8(0x280)](_0xe8dda8(0x23a)),0x1;if(_0x2de303&&_0x2520c8)return console[_0xe8dda8(0x280)](a35_0x46420a['red'](_0xe8dda8(0x20d))),0x1;try{let _0x2e9a35;if(_0x2520c8)_0x2e9a35=await this[_0xe8dda8(0x217)](_0x2520c8,_0x52587a);else{if(isYamlFilePath(_0x2de303))return console[_0xe8dda8(0x280)](a35_0x46420a[_0xe8dda8(0x1f9)](_0xe8dda8(0x232))),console[_0xe8dda8(0x280)](_0xe8dda8(0x25d)+_0x2de303),0x1;else _0x2e9a35=await this[_0xe8dda8(0x1f2)](_0x2de303,_0x52587a);}return _0x41a95c[_0xe8dda8(0x1dd)]===_0xe8dda8(0x1ea)||_0x41a95c[_0xe8dda8(0x1dd)]===_0xe8dda8(0x226)?await handleSDKOutput([{'sql':_0x2e9a35}],_0x41a95c):console[_0xe8dda8(0x1e4)](_0x2e9a35),0x0;}catch(_0x130fbd){if(_0x130fbd instanceof SDKError)return console[_0xe8dda8(0x280)](_0xe8dda8(0x1fd)+_0x130fbd[_0xe8dda8(0x249)]),_0x130fbd['cause']&&console['error'](_0xe8dda8(0x207)+_0x130fbd['cause']),0x1;throw _0x130fbd;}}async[a35_0xcd4784(0x217)](_0x1451d8,_0x3a8c5c){const _0x3afb8c=a35_0xcd4784,{options:_0x2bafc8,tdx:_0xc24019}=_0x3a8c5c;let _0x32cd74;try{_0x32cd74=await resolveYamlFilePath(_0x1451d8);}catch(_0x4a0ad5){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3afb8c(0x218)+_0x4a0ad5['message']);}_0x2bafc8[_0x3afb8c(0x221)]&&console['error'](_0x3afb8c(0x1e1)+_0x32cd74[_0x3afb8c(0x254)]+'/'+_0x32cd74[_0x3afb8c(0x23c)]);const _0x1af17b=await withSpinner(_0x3afb8c(0x23b),()=>_0xc24019[_0x3afb8c(0x1e7)][_0x3afb8c(0x224)](_0x32cd74[_0x3afb8c(0x1f5)],_0x32cd74['parentSegment'],_0x32cd74[_0x3afb8c(0x23c)]),{'verbose':_0x2bafc8[_0x3afb8c(0x221)]});return _0x1af17b[_0x3afb8c(0x20a)];}async[a35_0xcd4784(0x1f2)](_0x3b2f04,_0x537c53){const _0x125ea0=a35_0xcd4784,{options:_0x2b6c26,tdx:_0x53876b}=_0x537c53,_0x194a74=_0x2b6c26[_0x125ea0(0x254)],_0x5d3f45=await resolveSegmentTarget(_0x3b2f04,_0x194a74,_0x2b6c26[_0x125ea0(0x221)]);_0x2b6c26[_0x125ea0(0x221)]&&console[_0x125ea0(0x280)](_0x125ea0(0x24f)+_0x5d3f45);const _0x467daf=await withSpinner('Resolving\x20\x27'+_0x3b2f04+_0x125ea0(0x243),()=>_0x53876b[_0x125ea0(0x1e7)][_0x125ea0(0x1ee)](_0x5d3f45),{'verbose':_0x2b6c26[_0x125ea0(0x221)]}),_0x36ddc9=_0x467daf[_0x125ea0(0x20a)];_0x2b6c26[_0x125ea0(0x221)]&&(console['error'](_0x125ea0(0x279)+_0x36ddc9[_0x125ea0(0x233)]),console['error'](_0x125ea0(0x212)+_0x36ddc9[_0x125ea0(0x205)]));if(_0x36ddc9[_0x125ea0(0x233)]==='folder')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x125ea0(0x1e9));if(_0x36ddc9[_0x125ea0(0x233)]==='parent')throw new SDKError(ErrorCode[_0x125ea0(0x269)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x36ddc9[_0x125ea0(0x276)])throw new SDKError(ErrorCode[_0x125ea0(0x268)],_0x125ea0(0x248));const _0x2dd59c=await withSpinner(_0x125ea0(0x1f1),()=>_0x53876b[_0x125ea0(0x1e7)]['getSegmentSQL'](_0x36ddc9[_0x125ea0(0x205)],_0x36ddc9['segmentId']),{'verbose':_0x2b6c26[_0x125ea0(0x221)]});return _0x2dd59c[_0x125ea0(0x20a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x255);[a35_0xcd4784(0x273)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0xcd4784(0x23f)](_0x1ca0ca){const _0x2d11f7=a35_0xcd4784,{options:_0x10eaf7,args:_0x5f424c,tdx:_0x199bd8}=_0x1ca0ca,_0x40d2b2=_0x10eaf7;if(_0x5f424c[_0x2d11f7(0x1f4)]<0x2)return console['error'](_0x2d11f7(0x22c)),console[_0x2d11f7(0x280)](_0x2d11f7(0x256)),0x1;const _0x479cbf=_0x5f424c[0x0],_0x4afa34=_0x5f424c[0x1];_0x40d2b2['verbose']&&(console[_0x2d11f7(0x280)](_0x2d11f7(0x230)+_0x40d2b2[_0x2d11f7(0x227)]),console[_0x2d11f7(0x280)]('Parent\x20segment:\x20'+_0x479cbf),console[_0x2d11f7(0x280)](_0x2d11f7(0x237)+_0x4afa34));let _0x59d0b8;if(_0x40d2b2[_0x2d11f7(0x25a)]){const _0x3d5ead=_0x40d2b2[_0x2d11f7(0x25a)],_0x375ad3=await withSpinner(_0x2d11f7(0x262)+_0x479cbf+'\x27...',()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x24d)](_0x479cbf),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]}),_0x50df42=_0x375ad3[_0x2d11f7(0x20a)],_0x448603=await withSpinner(_0x2d11f7(0x1e2)+_0x3d5ead+_0x2d11f7(0x243),()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x24e)](_0x50df42,_0x3d5ead),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]});_0x59d0b8=_0x448603[_0x2d11f7(0x20a)],_0x40d2b2[_0x2d11f7(0x221)]&&console[_0x2d11f7(0x280)](_0x2d11f7(0x275)+_0x59d0b8);}const _0x1a376e={'name':_0x4afa34,'description':_0x40d2b2[_0x2d11f7(0x273)],'parentFolderId':_0x59d0b8},_0x36705c=await withSpinner(_0x2d11f7(0x244)+_0x4afa34+_0x2d11f7(0x243),()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x23d)](_0x479cbf,_0x1a376e),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]}),_0x19d915=_0x36705c[_0x2d11f7(0x20a)];return console[_0x2d11f7(0x280)](_0x2d11f7(0x271)+_0x19d915[_0x2d11f7(0x278)]+_0x2d11f7(0x26b)+_0x19d915['id']),await handleSDKOutput([_0x19d915],_0x40d2b2),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x222);[a35_0xcd4784(0x273)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0xcd4784(0x23f)](_0x5d4fb9){const _0x4e6826=a35_0xcd4784,{options:_0x5c13aa,args:_0x174e32,tdx:_0x2bb082}=_0x5d4fb9,_0x954132=_0x174e32[0x0];if(!_0x954132)return console[_0x4e6826(0x280)](_0x4e6826(0x1f6)),console[_0x4e6826(0x280)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x4e6826(0x280)](_0x4e6826(0x246)),console['error'](_0x4e6826(0x27b)),console['error'](_0x4e6826(0x1fe)),console['error'](_0x4e6826(0x22f)),console[_0x4e6826(0x280)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4e6826(0x280)](_0x4e6826(0x25f)),console['error'](_0x4e6826(0x23e)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xe5e62d=_0x5c13aa[_0x4e6826(0x254)],_0x4d7dfe=await resolveSegmentTarget(_0x954132,_0xe5e62d,_0x5c13aa[_0x4e6826(0x221)]);_0x5c13aa[_0x4e6826(0x221)]&&console[_0x4e6826(0x280)]('Target\x20path:\x20'+_0x4d7dfe);const _0x57d320=await withSpinner('Resolving\x20\x27'+_0x954132+_0x4e6826(0x243),()=>_0x2bb082[_0x4e6826(0x1e7)]['resolvePathToResource'](_0x4d7dfe),{'verbose':_0x5c13aa[_0x4e6826(0x221)]}),_0x527c3d=_0x57d320[_0x4e6826(0x20a)];_0x5c13aa[_0x4e6826(0x221)]&&(console[_0x4e6826(0x280)](_0x4e6826(0x279)+_0x527c3d[_0x4e6826(0x233)]),console['error'](_0x4e6826(0x212)+_0x527c3d[_0x4e6826(0x205)]),_0x527c3d[_0x4e6826(0x22e)]&&console[_0x4e6826(0x280)](_0x4e6826(0x22b)+_0x527c3d[_0x4e6826(0x22e)]),_0x527c3d['segmentId']&&console[_0x4e6826(0x280)](_0x4e6826(0x1ed)+_0x527c3d[_0x4e6826(0x276)]));if(_0x5c13aa[_0x4e6826(0x21c)]){if(_0x527c3d['type']===_0x4e6826(0x1ec))return console['error'](_0x4e6826(0x203)),0x1;if(_0x527c3d['type']===_0x4e6826(0x214))return console[_0x4e6826(0x280)](_0x4e6826(0x263)),console[_0x4e6826(0x280)](_0x4e6826(0x1e0)),0x1;if(!_0x527c3d['segmentId'])throw new SDKError(ErrorCode[_0x4e6826(0x268)],_0x4e6826(0x248));const _0xa2e03a=getConsoleNextUrl(_0x5c13aa[_0x4e6826(0x227)],_0x4e6826(0x259)+_0x527c3d[_0x4e6826(0x205)]+_0x4e6826(0x238)+_0x527c3d[_0x4e6826(0x276)]);return console[_0x4e6826(0x280)](a35_0x46420a[_0x4e6826(0x213)]('β')+'\x20Opening\x20'+a35_0x46420a['cyan'](_0xa2e03a)),openBrowser(_0xa2e03a),0x0;}if(_0x527c3d[_0x4e6826(0x233)]===_0x4e6826(0x1ec)){if(!_0x527c3d[_0x4e6826(0x22e)])throw new SDKError(ErrorCode[_0x4e6826(0x1fb)],_0x4e6826(0x1f7));const _0x53a047=await withSpinner(_0x4e6826(0x201),()=>_0x2bb082[_0x4e6826(0x1e7)][_0x4e6826(0x245)](_0x527c3d[_0x4e6826(0x22e)]),{'verbose':_0x5c13aa['verbose']});await handleSingleObjectOutput(_0x53a047[_0x4e6826(0x20a)],_0x5c13aa);}else{if(_0x527c3d['type']===_0x4e6826(0x1e7)){if(!_0x527c3d['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4e6826(0x248));const _0x2d95aa=await withSpinner(_0x4e6826(0x202),()=>_0x2bb082[_0x4e6826(0x1e7)][_0x4e6826(0x21d)](_0x527c3d[_0x4e6826(0x205)],_0x527c3d[_0x4e6826(0x276)]),{'verbose':_0x5c13aa['verbose']}),_0x3b6e04=getConsoleNextUrl(_0x5c13aa[_0x4e6826(0x227)],_0x4e6826(0x259)+_0x527c3d['parentId']+'/e/'+_0x527c3d[_0x4e6826(0x276)]),_0x4e2d42=_0x2d95aa['data'];_0x4e2d42['url']=_0x3b6e04,await handleSingleObjectOutput(_0x4e2d42,_0x5c13aa);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4e6826(0x280)](_0x4e6826(0x215)),0x1;}return 0x0;}catch(_0x6c2eb){if(_0x6c2eb instanceof SDKError)return console['error']('Error:\x20'+_0x6c2eb['message']),_0x6c2eb[_0x4e6826(0x220)]&&console['error']('\x20\x20Cause:\x20'+_0x6c2eb['cause']),0x1;throw _0x6c2eb;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a35_0xcd4784(0x273)]=a35_0xcd4784(0x27d);async[a35_0xcd4784(0x23f)](_0x4d1807){const _0x4b8c7a=a35_0xcd4784,{options:_0x5be202,args:_0xa6e79a,tdx:_0x2c3e3a}=_0x4d1807,_0x4e63aa=_0xa6e79a[0x0];if(!_0x4e63aa)return console['error'](_0x4b8c7a(0x1db)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x26a)),console['error'](_0x4b8c7a(0x1df)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x22f)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x4b8c7a(0x1de)),0x1;try{const _0x10b7a3=_0x5be202[_0x4b8c7a(0x254)],_0xfbea62=await resolveSegmentTarget(_0x4e63aa,_0x10b7a3,_0x5be202[_0x4b8c7a(0x221)]);_0x5be202[_0x4b8c7a(0x221)]&&console[_0x4b8c7a(0x280)]('Target\x20path:\x20'+_0xfbea62);const _0x1a1a53=await withSpinner(_0x4b8c7a(0x242)+_0x4e63aa+_0x4b8c7a(0x243),()=>_0x2c3e3a[_0x4b8c7a(0x1e7)][_0x4b8c7a(0x1ee)](_0xfbea62),{'verbose':_0x5be202['verbose']}),_0x37e3ca=_0x1a1a53[_0x4b8c7a(0x20a)];_0x5be202['verbose']&&(console['error'](_0x4b8c7a(0x279)+_0x37e3ca[_0x4b8c7a(0x233)]),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x212)+_0x37e3ca[_0x4b8c7a(0x205)]));if(_0x37e3ca[_0x4b8c7a(0x233)]==='folder')return console['error'](_0x4b8c7a(0x1e5)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x216)),0x1;if(_0x37e3ca[_0x4b8c7a(0x233)]===_0x4b8c7a(0x214))return console[_0x4b8c7a(0x280)](_0x4b8c7a(0x277)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x1ef)),0x1;if(!_0x37e3ca[_0x4b8c7a(0x276)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4b8c7a(0x248));const _0x25621c=await withSpinner(_0x4b8c7a(0x1f1),()=>_0x2c3e3a[_0x4b8c7a(0x1e7)]['getSegmentSQL'](_0x37e3ca[_0x4b8c7a(0x205)],_0x37e3ca[_0x4b8c7a(0x276)]),{'verbose':_0x5be202[_0x4b8c7a(0x221)]}),_0x3087cc=_0x25621c[_0x4b8c7a(0x20a)],_0xa14d1a=await executeSchemaQuery(_0x3087cc,_0x2c3e3a,_0x5be202);return await handleQueryOutput(_0xa14d1a,_0x5be202),0x0;}catch(_0x247347){if(_0x247347 instanceof SDKError)return console['error'](_0x4b8c7a(0x1fd)+_0x247347[_0x4b8c7a(0x249)]),_0x247347[_0x4b8c7a(0x220)]&&console[_0x4b8c7a(0x280)](_0x4b8c7a(0x207)+_0x247347[_0x4b8c7a(0x220)]),0x1;throw _0x247347;}}}
|
|
1
|
+
const a35_0x596d4b=a35_0x5922;(function(_0x4e77e7,_0xf58398){const _0x5c3704=a35_0x5922,_0x60ec57=_0x4e77e7();while(!![]){try{const _0x4340bb=-parseInt(_0x5c3704(0x141))/0x1+parseInt(_0x5c3704(0xd8))/0x2*(-parseInt(_0x5c3704(0xe2))/0x3)+parseInt(_0x5c3704(0x115))/0x4+-parseInt(_0x5c3704(0xe9))/0x5*(parseInt(_0x5c3704(0x14c))/0x6)+parseInt(_0x5c3704(0x171))/0x7+parseInt(_0x5c3704(0xfb))/0x8+parseInt(_0x5c3704(0x15d))/0x9;if(_0x4340bb===_0xf58398)break;else _0x60ec57['push'](_0x60ec57['shift']());}catch(_0x4f34a2){_0x60ec57['push'](_0x60ec57['shift']());}}}(a35_0x1df4,0x6e045));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a35_0x1df4(){const _0x47d1a8=['Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:folder:list','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','listFolders','trim','5374sSVDCf','limit','web','Segment\x20ID:\x20','stats','parentSegment','segment:sql','getSQLFromServerSegment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','177KUjgby','Fetching\x20folder\x20\x27','Examples:','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Executing\x20segment\x20query...','/app/ps/','segmentName','10PTVohn','SELECT\x20*\x20FROM\x20(\x0a','getFolder','segment','Use:\x20tdx\x20ps\x20view','Folder\x20ID:\x20','Creating\x20folder\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','green','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:show','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentId','segment:folder:show','Resolving\x20folder\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','5944728etmUFY','Fetching\x20SQL\x20from\x20rule...','resolvePathToResource','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','segment:desc','processedRows','Resolved:\x20','parent','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','jsonl','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','getSegment','\x27\x20with\x20ID:\x20','folderPath','includes','Resolving\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','segment:view','getSQLFromYamlFile','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Fetching\x20parent\x20segment\x20details...','log','Resolving\x20parent\x20folder\x20\x27','411180AeZCHF','content','(root)','β\x20Found\x20','cyan','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','red','\x20\x20Cause:\x20','parentFolder','\x20\x20Segment\x20name:\x20','setJobId','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolving\x20path\x20\x27','site','Get\x20SQL\x20query\x20for\x20child\x20segment','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20sql\x20--path\x20','execute','getParent','INVALID_ARGUMENT','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','description','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','query','Resolved\x20parent\x20ID:\x20','Use:\x20tdx\x20ps\x20view\x20-w','segmentId','type','Resolved\x20type:\x20','replace','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Folder\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','message','\x20\x20Full\x20path:\x20','folder','SQL\x20query:\x0a','folderId','Parent\x20name:\x20','\x20Opening\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Site:\x20','786736LgPgKj','error','Resolving\x20parent\x20segment\x20\x27','resolveParentId','Show\x20segment\x20or\x20folder\x20details','/e/','β\x20Query\x20completed:\x20Processed\x20','Parent\x20ID:\x20','url','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','jobId','2251218ERhIbx','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Target\x20path:\x20','length','SEGMENT_NOT_FOUND','Show\x20segment\x20folder\x20details','Options:','Usage:','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegmentSQL','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','cause','verbose','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','3864168IQvKDT','\x20\x20Folder\x20path:\x20','Fetching\x20segment\x20details...','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20folder','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','code','Error:\x20','Resolved\x20relative\x20path\x20to:\x20','createFolder','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','data','SEGMENT_FOLDER_NOT_FOUND','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x27...','Usage:\x20tdx\x20sg\x20show\x20<name>','format','\x20\x20Parent\x20segment:\x20','6097462aZAfBv','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20ps\x20show','fullPath','name','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','β\x20Query\x20failed\x20[','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Fetching\x20folder\x20details...','Listing\x20folders\x20for\x20parent\x20\x27','resolveFolderId'];a35_0x1df4=function(){return _0x47d1a8;};return a35_0x1df4();}import{openBrowser}from'../utils/process.js';function a35_0x5922(_0x111510,_0x499be6){_0x111510=_0x111510-0xd3;const _0x1df4ff=a35_0x1df4();let _0x5922e0=_0x1df4ff[_0x111510];return _0x5922e0;}import a35_0x1088f7 from'chalk';async function resolveSegmentTarget(_0x4cebed,_0x35bda5,_0x2bde79){const _0x495759=a35_0x5922;if(isYamlFilePath(_0x4cebed))try{const _0xe3b2ab=await resolveYamlFilePath(_0x4cebed);return _0x2bde79&&(console[_0x495759(0x142)](_0x495759(0x174)+_0x4cebed),console[_0x495759(0x142)](_0x495759(0x170)+_0xe3b2ab['parentSegment']),console[_0x495759(0x142)](_0x495759(0x11e)+_0xe3b2ab[_0x495759(0xe8)]),console['error'](_0x495759(0x15e)+(_0xe3b2ab[_0x495759(0x109)]||_0x495759(0x117))),console[_0x495759(0x142)](_0x495759(0x139)+_0xe3b2ab[_0x495759(0x176)])),_0xe3b2ab[_0x495759(0x176)];}catch(_0x2b4b0a){throw new SDKError(ErrorCode[_0x495759(0x129)],_0x495759(0xd5)+_0x2b4b0a['message']);}if(!_0x35bda5)throw new SDKError(ErrorCode[_0x495759(0x129)],_0x495759(0x17a));return _0x35bda5+'/'+_0x4cebed;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x596d4b(0x177)]='segment:describe';[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x145);async[a35_0x596d4b(0x127)](_0x2cd1a2){const _0x5836ef=a35_0x596d4b,{options:_0x64df9c,args:_0x4a04b3,tdx:_0x4d3b1b}=_0x2cd1a2,_0x69361c=_0x4a04b3[0x0],_0x4fc6f9=!_0x69361c&&!!_0x64df9c['parentSegment'],_0x49acc8=_0x69361c||_0x64df9c[_0x5836ef(0xdd)];if(!_0x49acc8)return console[_0x5836ef(0x142)](_0x5836ef(0x172)),console[_0x5836ef(0x142)](_0x5836ef(0xf6)),console[_0x5836ef(0x142)](_0x5836ef(0xe4)),console['error'](_0x5836ef(0x164)),console[_0x5836ef(0x142)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x5836ef(0x142)](_0x5836ef(0x10c)),console[_0x5836ef(0x142)](_0x5836ef(0x121)),0x1;try{const _0x1d09c7=_0x64df9c['segmentPath'];let _0x5e7772=_0x49acc8;!_0x4fc6f9&&_0x1d09c7&&!_0x49acc8[_0x5836ef(0x10a)]('/')&&(_0x5e7772=_0x1d09c7+'/'+_0x49acc8,_0x64df9c[_0x5836ef(0x159)]&&console[_0x5836ef(0x142)](_0x5836ef(0x167)+_0x5e7772));const _0x2d50f1=await withSpinner(_0x5836ef(0x122)+_0x5e7772+_0x5836ef(0x16d),()=>_0x4d3b1b[_0x5836ef(0xec)]['resolvePathToResource'](_0x5e7772),{'verbose':_0x64df9c[_0x5836ef(0x159)]}),_0x4bdda8=_0x2d50f1['data'];_0x64df9c[_0x5836ef(0x159)]&&(console[_0x5836ef(0x142)](_0x5836ef(0x133)+_0x4bdda8[_0x5836ef(0x132)]),console[_0x5836ef(0x142)](_0x5836ef(0x148)+_0x4bdda8[_0x5836ef(0xf7)]),_0x4bdda8[_0x5836ef(0x13c)]&&console[_0x5836ef(0x142)](_0x5836ef(0xee)+_0x4bdda8[_0x5836ef(0x13c)]),_0x4bdda8[_0x5836ef(0x131)]&&console[_0x5836ef(0x142)](_0x5836ef(0xdb)+_0x4bdda8['segmentId']));if(_0x4bdda8['type']===_0x5836ef(0x102)){const _0x2dd5e9=await withSpinner(_0x5836ef(0x112),()=>_0x4d3b1b['segment'][_0x5836ef(0x128)](_0x4bdda8[_0x5836ef(0xf7)]),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x2dd5e9[_0x5836ef(0x16a)],_0x64df9c);}else{if(_0x4bdda8[_0x5836ef(0x132)]==='folder'){if(!_0x4bdda8[_0x5836ef(0x13c)])throw new SDKError(ErrorCode[_0x5836ef(0x16b)],_0x5836ef(0xf5));const _0x47d443=await withSpinner(_0x5836ef(0x17c),()=>_0x4d3b1b[_0x5836ef(0xec)][_0x5836ef(0xeb)](_0x4bdda8['folderId']),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x47d443[_0x5836ef(0x16a)],_0x64df9c);}else{if(_0x4bdda8[_0x5836ef(0x132)]==='segment'){if(!_0x4bdda8[_0x5836ef(0x131)])throw new SDKError(ErrorCode[_0x5836ef(0x150)],_0x5836ef(0xe0));const _0x316dd5=await withSpinner(_0x5836ef(0x15f),()=>_0x4d3b1b[_0x5836ef(0xec)][_0x5836ef(0x107)](_0x4bdda8['parentId'],_0x4bdda8[_0x5836ef(0x131)]),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x316dd5['data'],_0x64df9c);}}}return 0x0;}catch(_0x343173){if(_0x343173 instanceof SDKError)return console[_0x5836ef(0x142)](_0x5836ef(0x166)+_0x343173[_0x5836ef(0x138)]),_0x343173[_0x5836ef(0x158)]&&console[_0x5836ef(0x142)]('\x20\x20Cause:\x20'+_0x343173['cause']),0x1;throw _0x343173;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xf4);[a35_0x596d4b(0x12c)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x116943){const _0x12b326=a35_0x596d4b,{options:_0x29c2e5,args:_0x39df77,tdx:_0x31e57c}=_0x116943,_0x4c935c=_0x39df77[0x0];if(!_0x4c935c)return console[_0x12b326(0x142)](_0x12b326(0xf2)),console[_0x12b326(0x142)](_0x12b326(0x16e)),console['error'](_0x12b326(0xf3)),console[_0x12b326(0x142)](_0x12b326(0xe4)),console[_0x12b326(0x142)](_0x12b326(0x169)),console[_0x12b326(0x142)](_0x12b326(0x16c)),0x1;try{const _0x4f9d83=_0x29c2e5[_0x12b326(0xdd)],_0x4c1885=await resolveSegmentTarget(_0x4c935c,_0x4f9d83,_0x29c2e5[_0x12b326(0x159)]);_0x29c2e5[_0x12b326(0x159)]&&console['error'](_0x12b326(0x14e)+_0x4c1885);const _0x4d8e6d=await withSpinner('Resolving\x20\x27'+_0x4c935c+_0x12b326(0x16d),()=>_0x31e57c[_0x12b326(0xec)][_0x12b326(0xfd)](_0x4c1885),{'verbose':_0x29c2e5[_0x12b326(0x159)]}),_0xc27eb2=_0x4d8e6d['data'];_0x29c2e5['verbose']&&(console[_0x12b326(0x142)]('Resolved\x20type:\x20'+_0xc27eb2[_0x12b326(0x132)]),console[_0x12b326(0x142)]('Parent\x20ID:\x20'+_0xc27eb2['parentId']));if(_0xc27eb2[_0x12b326(0x132)]===_0x12b326(0x13a))return console[_0x12b326(0x142)](_0x12b326(0x11a)),console['error'](_0x12b326(0xd4)),0x1;if(_0xc27eb2['type']==='parent')return console['error'](_0x12b326(0x157)),console[_0x12b326(0x142)](_0x12b326(0x175)),0x1;if(!_0xc27eb2[_0x12b326(0x131)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x12b326(0xe0));const _0x2b6163=await withSpinner(_0x12b326(0x125),()=>_0x31e57c['segment'][_0x12b326(0x156)](_0xc27eb2[_0x12b326(0xf7)],_0xc27eb2[_0x12b326(0x131)]),{'verbose':_0x29c2e5[_0x12b326(0x159)]});let _0x582814=_0x2b6163[_0x12b326(0x16a)];const _0xd327b1=resolveLimit(_0x29c2e5[_0x12b326(0xd9)],DEFAULT_DISPLAY_LIMIT),_0x2a5b33=/\bLIMIT\s+\d+/i['test'](_0x582814);!_0x2a5b33&&(_0x582814=_0x582814[_0x12b326(0xd7)]()[_0x12b326(0x134)](/;+$/,''),_0x582814=_0x12b326(0xea)+_0x582814+_0x12b326(0xfa)+_0xd327b1);_0x29c2e5['verbose']&&console[_0x12b326(0x142)](_0x12b326(0x13b)+_0x582814);const _0x393291=await withProgressSpinner(_0x12b326(0xe6),async _0x4ebd30=>{const _0x1a8713=_0x12b326,_0xcdc3cb=await _0x31e57c[_0x1a8713(0x12e)]['execute'](_0x582814,{'catalog':'td','schema':'information_schema','onJobId':_0x57cbaf=>{const _0x8c94a5=_0x1a8713;_0x4ebd30[_0x8c94a5(0x11f)](_0x57cbaf);}});return _0xcdc3cb;},{'verbose':_0x29c2e5[_0x12b326(0x159)]}),_0x4a1b8d=_0x393291['data'],_0x20c452=_0x4a1b8d[_0x12b326(0x14b)]?'\x20[Job\x20ID:\x20'+_0x4a1b8d['jobId']+']':'';return console[_0x12b326(0x142)](_0x12b326(0x147)+_0x4a1b8d['stats'][_0x12b326(0x100)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x4a1b8d[_0x12b326(0xdc)]['elapsedTimeMillis'])+_0x20c452)),await handleQueryOutput(_0x4a1b8d,_0x29c2e5),0x0;}catch(_0x44bf5c){if(_0x44bf5c instanceof SDKError)return console['error'](_0x12b326(0x179)+_0x44bf5c[_0x12b326(0x165)]+']'),console[_0x12b326(0x142)]('\x0a'+_0x44bf5c['message']),0x1;throw _0x44bf5c;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xd3);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x10e);async[a35_0x596d4b(0x127)](_0x430ad5){const _0x48dfdc=a35_0x596d4b,{options:_0x3ece85,args:_0x1468a2,tdx:_0x5224c0}=_0x430ad5;if(_0x1468a2[_0x48dfdc(0x14f)]===0x0)return console[_0x48dfdc(0x142)](_0x48dfdc(0x155)),console[_0x48dfdc(0x142)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x3f76fd=_0x1468a2[0x0];try{_0x3ece85[_0x48dfdc(0x159)]&&(console[_0x48dfdc(0x142)]('Site:\x20'+_0x3ece85[_0x48dfdc(0x123)]),console[_0x48dfdc(0x142)](_0x48dfdc(0x13d)+_0x3f76fd));const _0x1b2137=await withSpinner(_0x48dfdc(0x143)+_0x3f76fd+_0x48dfdc(0x16d),()=>_0x5224c0[_0x48dfdc(0xec)][_0x48dfdc(0x144)](_0x3f76fd),{'verbose':_0x3ece85[_0x48dfdc(0x159)]}),_0x38bf7d=_0x1b2137[_0x48dfdc(0x16a)];_0x3ece85[_0x48dfdc(0x159)]&&console['error'](_0x48dfdc(0x12f)+_0x38bf7d);const _0x517738=await withSpinner(_0x48dfdc(0x17d)+_0x3f76fd+_0x48dfdc(0x16d),()=>_0x5224c0[_0x48dfdc(0xec)][_0x48dfdc(0xd6)](_0x38bf7d),{'verbose':_0x3ece85[_0x48dfdc(0x159)]}),_0x140812=_0x517738[_0x48dfdc(0x16a)];return console[_0x48dfdc(0x142)](_0x48dfdc(0x118)+_0x140812[_0x48dfdc(0x14f)]+_0x48dfdc(0x162)+(_0x140812['length']!==0x1?'s':'')),await handleSDKOutput(_0x140812,_0x3ece85),0x0;}catch(_0x537a9c){if(_0x537a9c instanceof SDKError)return console[_0x48dfdc(0x142)](_0x48dfdc(0x166)+_0x537a9c['message']),_0x537a9c[_0x48dfdc(0x158)]&&console['error'](_0x48dfdc(0x11c)+_0x537a9c[_0x48dfdc(0x158)]),0x1;throw _0x537a9c;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x596d4b(0xf8);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x151);async[a35_0x596d4b(0x127)](_0x22ae9f){const _0x5f34b2=a35_0x596d4b,{options:_0x54fcfc,args:_0x1082b9,tdx:_0x53268b}=_0x22ae9f;if(_0x1082b9[_0x5f34b2(0x14f)]===0x0)return console[_0x5f34b2(0x142)](_0x5f34b2(0x173)),console[_0x5f34b2(0x142)](_0x5f34b2(0x15c)),0x1;try{const {parentId:_0x3f4c1d,childId:_0x18eb7f}=parseSegmentRef(_0x1082b9[0x0]);_0x54fcfc[_0x5f34b2(0x159)]&&(console['error'](_0x5f34b2(0x140)+_0x54fcfc['site']),console[_0x5f34b2(0x142)](_0x5f34b2(0x13d)+_0x3f4c1d),_0x18eb7f&&console[_0x5f34b2(0x142)]('Folder\x20name:\x20'+_0x18eb7f));if(!_0x18eb7f)return console[_0x5f34b2(0x142)](_0x5f34b2(0x12d)),0x1;const _0x3269e2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f4c1d+_0x5f34b2(0x16d),()=>_0x53268b['segment']['resolveParentId'](_0x3f4c1d),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]}),_0x33ae96=_0x3269e2['data'];_0x54fcfc['verbose']&&console[_0x5f34b2(0x142)](_0x5f34b2(0x12f)+_0x33ae96);const _0x4f21a0=await withSpinner(_0x5f34b2(0xf9)+_0x18eb7f+'\x27...',()=>_0x53268b[_0x5f34b2(0xec)][_0x5f34b2(0x17e)](_0x33ae96,_0x18eb7f),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]}),_0x4c245a=_0x4f21a0[_0x5f34b2(0x16a)];_0x54fcfc[_0x5f34b2(0x159)]&&console[_0x5f34b2(0x142)](_0x5f34b2(0x15a)+_0x4c245a);const _0x26001d=await withSpinner(_0x5f34b2(0xe3)+_0x18eb7f+'\x27...',()=>_0x53268b[_0x5f34b2(0xec)]['getFolder'](_0x4c245a),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]});return await handleSDKOutput([_0x26001d['data']],_0x54fcfc),0x0;}catch(_0x2fa596){if(_0x2fa596 instanceof SDKError)return console[_0x5f34b2(0x142)]('Error:\x20'+_0x2fa596[_0x5f34b2(0x138)]),_0x2fa596[_0x5f34b2(0x158)]&&console[_0x5f34b2(0x142)](_0x5f34b2(0x11c)+_0x2fa596[_0x5f34b2(0x158)]),0x1;throw _0x2fa596;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xde);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x124);async[a35_0x596d4b(0x127)](_0x544b81){const _0x14f4ff=a35_0x596d4b,{options:_0x47922a,args:_0x24850c}=_0x544b81,_0x44c847=_0x47922a,_0x3dab91=_0x44c847['path'],_0x399fb1=_0x24850c[0x0];if(!_0x399fb1&&!_0x3dab91)return console['error'](a35_0x1088f7[_0x14f4ff(0x11b)](_0x14f4ff(0x163))),console[_0x14f4ff(0x142)](_0x14f4ff(0x153)),console['error']('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x14f4ff(0x142)](_0x14f4ff(0xfe)),console[_0x14f4ff(0x142)](_0x14f4ff(0xe4)),console[_0x14f4ff(0x142)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x14f4ff(0x142)](_0x14f4ff(0x12b)),0x1;if(_0x399fb1&&_0x3dab91)return console[_0x14f4ff(0x142)](a35_0x1088f7[_0x14f4ff(0x11b)](_0x14f4ff(0x120))),0x1;try{let _0x143244;if(_0x3dab91)_0x143244=await this[_0x14f4ff(0x110)](_0x3dab91,_0x544b81);else{if(isYamlFilePath(_0x399fb1))return console[_0x14f4ff(0x142)](a35_0x1088f7[_0x14f4ff(0x11b)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x14f4ff(0x142)](_0x14f4ff(0x126)+_0x399fb1),0x1;else _0x143244=await this[_0x14f4ff(0xdf)](_0x399fb1,_0x544b81);}return _0x47922a[_0x14f4ff(0x16f)]==='json'||_0x47922a[_0x14f4ff(0x16f)]===_0x14f4ff(0x105)?await handleSDKOutput([{'sql':_0x143244}],_0x47922a):console[_0x14f4ff(0x113)](_0x143244),0x0;}catch(_0x55c7c7){if(_0x55c7c7 instanceof SDKError)return console[_0x14f4ff(0x142)]('Error:\x20'+_0x55c7c7[_0x14f4ff(0x138)]),_0x55c7c7[_0x14f4ff(0x158)]&&console['error']('\x20\x20Cause:\x20'+_0x55c7c7[_0x14f4ff(0x158)]),0x1;throw _0x55c7c7;}}async[a35_0x596d4b(0x110)](_0x537e0e,_0x325e92){const _0x2d82b9=a35_0x596d4b,{options:_0x54831b,tdx:_0x34348d}=_0x325e92;let _0xac3e0f;try{_0xac3e0f=await resolveYamlFilePath(_0x537e0e);}catch(_0x1aa81b){throw new SDKError(ErrorCode[_0x2d82b9(0x129)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1aa81b[_0x2d82b9(0x138)]);}_0x54831b['verbose']&&console[_0x2d82b9(0x142)](_0x2d82b9(0x101)+_0xac3e0f['parentSegment']+'/'+_0xac3e0f[_0x2d82b9(0xe8)]);const _0x3f92f3=await withSpinner(_0x2d82b9(0xfc),()=>_0x34348d[_0x2d82b9(0xec)]['getSegmentSQLFromYaml'](_0xac3e0f[_0x2d82b9(0x116)],_0xac3e0f[_0x2d82b9(0xdd)],_0xac3e0f[_0x2d82b9(0xe8)]),{'verbose':_0x54831b[_0x2d82b9(0x159)]});return _0x3f92f3[_0x2d82b9(0x16a)];}async[a35_0x596d4b(0xdf)](_0x22ff2e,_0x20a8a6){const _0x4e4199=a35_0x596d4b,{options:_0x355f73,tdx:_0x48a845}=_0x20a8a6,_0x254ae8=_0x355f73[_0x4e4199(0xdd)],_0x10b045=await resolveSegmentTarget(_0x22ff2e,_0x254ae8,_0x355f73[_0x4e4199(0x159)]);_0x355f73[_0x4e4199(0x159)]&&console[_0x4e4199(0x142)](_0x4e4199(0x14e)+_0x10b045);const _0x12ec56=await withSpinner(_0x4e4199(0x10b)+_0x22ff2e+_0x4e4199(0x16d),()=>_0x48a845[_0x4e4199(0xec)][_0x4e4199(0xfd)](_0x10b045),{'verbose':_0x355f73[_0x4e4199(0x159)]}),_0x52df33=_0x12ec56['data'];_0x355f73['verbose']&&(console[_0x4e4199(0x142)](_0x4e4199(0x133)+_0x52df33[_0x4e4199(0x132)]),console[_0x4e4199(0x142)](_0x4e4199(0x148)+_0x52df33[_0x4e4199(0xf7)]));if(_0x52df33[_0x4e4199(0x132)]==='folder')throw new SDKError(ErrorCode[_0x4e4199(0x129)],_0x4e4199(0x103));if(_0x52df33['type']===_0x4e4199(0x102))throw new SDKError(ErrorCode[_0x4e4199(0x129)],_0x4e4199(0x13f));if(!_0x52df33['segmentId'])throw new SDKError(ErrorCode[_0x4e4199(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3fa62a=await withSpinner(_0x4e4199(0x125),()=>_0x48a845[_0x4e4199(0xec)][_0x4e4199(0x156)](_0x52df33[_0x4e4199(0xf7)],_0x52df33[_0x4e4199(0x131)]),{'verbose':_0x355f73[_0x4e4199(0x159)]});return _0x3fa62a[_0x4e4199(0x16a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x596d4b(0x177)]='segment:folder:create';[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x154);async[a35_0x596d4b(0x127)](_0x6ee48a){const _0x428892=a35_0x596d4b,{options:_0x43f9e8,args:_0x5b6668,tdx:_0x161b60}=_0x6ee48a,_0x4cb4a0=_0x43f9e8;if(_0x5b6668['length']<0x2)return console['error'](_0x428892(0x106)),console[_0x428892(0x142)](_0x428892(0x15b)),0x1;const _0xdd587=_0x5b6668[0x0],_0x27265c=_0x5b6668[0x1];_0x4cb4a0[_0x428892(0x159)]&&(console[_0x428892(0x142)]('Site:\x20'+_0x4cb4a0[_0x428892(0x123)]),console[_0x428892(0x142)]('Parent\x20segment:\x20'+_0xdd587),console[_0x428892(0x142)](_0x428892(0x136)+_0x27265c));let _0x15f4d9;if(_0x4cb4a0[_0x428892(0x11d)]){const _0xb99b1d=_0x4cb4a0[_0x428892(0x11d)],_0x5e7761=await withSpinner(_0x428892(0x143)+_0xdd587+_0x428892(0x16d),()=>_0x161b60[_0x428892(0xec)][_0x428892(0x144)](_0xdd587),{'verbose':_0x4cb4a0[_0x428892(0x159)]}),_0x59eb93=_0x5e7761['data'],_0x24a667=await withSpinner(_0x428892(0x114)+_0xb99b1d+'\x27...',()=>_0x161b60[_0x428892(0xec)]['resolveFolderId'](_0x59eb93,_0xb99b1d),{'verbose':_0x4cb4a0[_0x428892(0x159)]});_0x15f4d9=_0x24a667[_0x428892(0x16a)],_0x4cb4a0[_0x428892(0x159)]&&console['error'](_0x428892(0xf0)+_0x15f4d9);}const _0x22ee17={'name':_0x27265c,'description':_0x4cb4a0['description'],'parentFolderId':_0x15f4d9},_0x327efe=await withSpinner(_0x428892(0xef)+_0x27265c+_0x428892(0x16d),()=>_0x161b60[_0x428892(0xec)][_0x428892(0x168)](_0xdd587,_0x22ee17),{'verbose':_0x4cb4a0[_0x428892(0x159)]}),_0x5c6de5=_0x327efe[_0x428892(0x16a)];return console[_0x428892(0x142)]('β\x20Created\x20folder\x20\x27'+_0x5c6de5[_0x428892(0x177)]+_0x428892(0x108)+_0x5c6de5['id']),await handleSDKOutput([_0x5c6de5],_0x4cb4a0),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0x10f);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x12a);async[a35_0x596d4b(0x127)](_0x97e79c){const _0x31bf32=a35_0x596d4b,{options:_0x567ce0,args:_0x152d2a,tdx:_0x27bed1}=_0x97e79c,_0x254a78=_0x152d2a[0x0];if(!_0x254a78)return console[_0x31bf32(0x142)](_0x31bf32(0x10d)),console['error'](_0x31bf32(0x17f)),console['error'](_0x31bf32(0x135)),console['error'](_0x31bf32(0x152)),console[_0x31bf32(0x142)](_0x31bf32(0x14d)),console['error'](_0x31bf32(0xe4)),console['error'](_0x31bf32(0x14a)),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x220825=_0x567ce0[_0x31bf32(0xdd)],_0x27634b=await resolveSegmentTarget(_0x254a78,_0x220825,_0x567ce0[_0x31bf32(0x159)]);_0x567ce0['verbose']&&console[_0x31bf32(0x142)](_0x31bf32(0x14e)+_0x27634b);const _0x4c9d1f=await withSpinner('Resolving\x20\x27'+_0x254a78+_0x31bf32(0x16d),()=>_0x27bed1[_0x31bf32(0xec)][_0x31bf32(0xfd)](_0x27634b),{'verbose':_0x567ce0[_0x31bf32(0x159)]}),_0x43ff99=_0x4c9d1f['data'];_0x567ce0['verbose']&&(console[_0x31bf32(0x142)](_0x31bf32(0x133)+_0x43ff99['type']),console[_0x31bf32(0x142)](_0x31bf32(0x148)+_0x43ff99[_0x31bf32(0xf7)]),_0x43ff99[_0x31bf32(0x13c)]&&console['error'](_0x31bf32(0xee)+_0x43ff99['folderId']),_0x43ff99[_0x31bf32(0x131)]&&console[_0x31bf32(0x142)](_0x31bf32(0xdb)+_0x43ff99[_0x31bf32(0x131)]));if(_0x567ce0[_0x31bf32(0xda)]){if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0x13a))return console[_0x31bf32(0x142)](_0x31bf32(0x111)),0x1;if(_0x43ff99['type']===_0x31bf32(0x102))return console['error'](_0x31bf32(0x178)),console[_0x31bf32(0x142)](_0x31bf32(0x130)),0x1;if(!_0x43ff99[_0x31bf32(0x131)])throw new SDKError(ErrorCode[_0x31bf32(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4da9d7=getConsoleNextUrl(_0x567ce0['site'],_0x31bf32(0xe7)+_0x43ff99[_0x31bf32(0xf7)]+_0x31bf32(0x146)+_0x43ff99[_0x31bf32(0x131)]);return console[_0x31bf32(0x142)](a35_0x1088f7[_0x31bf32(0xf1)]('β')+_0x31bf32(0x13e)+a35_0x1088f7[_0x31bf32(0x119)](_0x4da9d7)),openBrowser(_0x4da9d7),0x0;}if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0x13a)){if(!_0x43ff99[_0x31bf32(0x13c)])throw new SDKError(ErrorCode[_0x31bf32(0x16b)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x416751=await withSpinner('Fetching\x20folder\x20details...',()=>_0x27bed1['segment'][_0x31bf32(0xeb)](_0x43ff99['folderId']),{'verbose':_0x567ce0[_0x31bf32(0x159)]});await handleSingleObjectOutput(_0x416751['data'],_0x567ce0);}else{if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0xec)){if(!_0x43ff99['segmentId'])throw new SDKError(ErrorCode[_0x31bf32(0x150)],_0x31bf32(0xe0));const _0x3418c9=await withSpinner(_0x31bf32(0x15f),()=>_0x27bed1[_0x31bf32(0xec)]['getSegment'](_0x43ff99['parentId'],_0x43ff99[_0x31bf32(0x131)]),{'verbose':_0x567ce0[_0x31bf32(0x159)]}),_0x5509e9=getConsoleNextUrl(_0x567ce0[_0x31bf32(0x123)],'/app/ps/'+_0x43ff99[_0x31bf32(0xf7)]+_0x31bf32(0x146)+_0x43ff99[_0x31bf32(0x131)]),_0x9e644f=_0x3418c9[_0x31bf32(0x16a)];_0x9e644f[_0x31bf32(0x149)]=_0x5509e9,await handleSingleObjectOutput(_0x9e644f,_0x567ce0);}else return console[_0x31bf32(0x142)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x31bf32(0x142)](_0x31bf32(0xed)),0x1;}return 0x0;}catch(_0x4004f4){if(_0x4004f4 instanceof SDKError)return console[_0x31bf32(0x142)](_0x31bf32(0x166)+_0x4004f4['message']),_0x4004f4[_0x31bf32(0x158)]&&console[_0x31bf32(0x142)]('\x20\x20Cause:\x20'+_0x4004f4[_0x31bf32(0x158)]),0x1;throw _0x4004f4;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xff);['description']=a35_0x596d4b(0x160);async[a35_0x596d4b(0x127)](_0x1ae029){const _0xfd4bc6=a35_0x596d4b,{options:_0x3fb2ab,args:_0x247753,tdx:_0x4f554b}=_0x1ae029,_0x38f61c=_0x247753[0x0];if(!_0x38f61c)return console['error'](_0xfd4bc6(0xf2)),console['error'](_0xfd4bc6(0x17b)),console['error'](_0xfd4bc6(0x137)),console['error'](_0xfd4bc6(0xe4)),console['error'](_0xfd4bc6(0x104)),console[_0xfd4bc6(0x142)](_0xfd4bc6(0x161)),0x1;try{const _0x2a1014=_0x3fb2ab[_0xfd4bc6(0xdd)],_0x3f3bb4=await resolveSegmentTarget(_0x38f61c,_0x2a1014,_0x3fb2ab['verbose']);_0x3fb2ab[_0xfd4bc6(0x159)]&&console['error'](_0xfd4bc6(0x14e)+_0x3f3bb4);const _0x3ef2f6=await withSpinner('Resolving\x20\x27'+_0x38f61c+_0xfd4bc6(0x16d),()=>_0x4f554b[_0xfd4bc6(0xec)][_0xfd4bc6(0xfd)](_0x3f3bb4),{'verbose':_0x3fb2ab[_0xfd4bc6(0x159)]}),_0x513be9=_0x3ef2f6[_0xfd4bc6(0x16a)];_0x3fb2ab[_0xfd4bc6(0x159)]&&(console[_0xfd4bc6(0x142)](_0xfd4bc6(0x133)+_0x513be9[_0xfd4bc6(0x132)]),console[_0xfd4bc6(0x142)](_0xfd4bc6(0x148)+_0x513be9['parentId']));if(_0x513be9[_0xfd4bc6(0x132)]==='folder')return console[_0xfd4bc6(0x142)](_0xfd4bc6(0xe1)),console[_0xfd4bc6(0x142)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x513be9[_0xfd4bc6(0x132)]==='parent')return console[_0xfd4bc6(0x142)](_0xfd4bc6(0xe5)),console[_0xfd4bc6(0x142)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x513be9['segmentId'])throw new SDKError(ErrorCode[_0xfd4bc6(0x150)],_0xfd4bc6(0xe0));const _0x339478=await withSpinner(_0xfd4bc6(0x125),()=>_0x4f554b[_0xfd4bc6(0xec)]['getSegmentSQL'](_0x513be9['parentId'],_0x513be9[_0xfd4bc6(0x131)]),{'verbose':_0x3fb2ab[_0xfd4bc6(0x159)]}),_0x34fccd=_0x339478[_0xfd4bc6(0x16a)],_0x58fe36=await executeSchemaQuery(_0x34fccd,_0x4f554b,_0x3fb2ab);return await handleQueryOutput(_0x58fe36,_0x3fb2ab),0x0;}catch(_0x598ff0){if(_0x598ff0 instanceof SDKError)return console[_0xfd4bc6(0x142)](_0xfd4bc6(0x166)+_0x598ff0['message']),_0x598ff0[_0xfd4bc6(0x158)]&&console[_0xfd4bc6(0x142)](_0xfd4bc6(0x11c)+_0x598ff0[_0xfd4bc6(0x158)]),0x1;throw _0x598ff0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x451c35=a36_0x57fa;(function(_0x35fa4d,_0x4590d){const _0x471c94=a36_0x57fa,_0x3932c=_0x35fa4d();while(!![]){try{const _0x5097ab=-parseInt(_0x471c94(0x122))/0x1*(-parseInt(_0x471c94(0x100))/0x2)+parseInt(_0x471c94(0x10e))/0x3*(parseInt(_0x471c94(0xfe))/0x4)+-parseInt(_0x471c94(0x12a))/0x5*(-parseInt(_0x471c94(0x12e))/0x6)+parseInt(_0x471c94(0x130))/0x7+-parseInt(_0x471c94(0x11a))/0x8+parseInt(_0x471c94(0x121))/0x9+-parseInt(_0x471c94(0x12b))/0xa;if(_0x5097ab===_0x4590d)break;else _0x3932c['push'](_0x3932c['shift']());}catch(_0x250eee){_0x3932c['push'](_0x3932c['shift']());}}}(a36_0x1c34,0x3c267));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a36_0x57fa(_0x5797eb,_0x5ded3a){_0x5797eb=_0x5797eb-0xfe;const _0x1c3421=a36_0x1c34();let _0x57fa36=_0x1c3421[_0x5797eb];return _0x57fa36;}import a36_0x3dcd44 from'chalk';function a36_0x1c34(){const _0x15a12d=['description','data','folderId','yellow','Segment\x20name:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','Parent:\x20','parent','includes','error','21AayyEB','name','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','segment:create','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20folder\x20path\x20\x27','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','verbose','Creating\x20segment\x20\x27','length','2402304vPwFIW','Resolved\x20relative\x20path\x20to:\x20','kind','β\x20Created\x20segment\x20\x27','createSegment','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','noCountPopulation','4352553cAoEgT','58EOooDY','invisible','Resolving\x20parent\x20segment\x20\x27','execute','\x27...','type','segment','segmentPath','169625zFkVdp','8368980UjNwXJ','Site:\x20','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','18YtKlal','Resolving\x20folder\x20\x27','2666237VNsYBj','5152PTvRBn','\x27\x20with\x20ID:\x20','14078muXSCs','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'];a36_0x1c34=function(){return _0x15a12d;};return a36_0x1c34();}export class SegmentCreateCommand extends BaseCommand{['name']=a36_0x451c35(0x112);['description']=a36_0x451c35(0x116);async[a36_0x451c35(0x125)](_0x4d49bf){const _0x287bfa=a36_0x451c35;console['error'](a36_0x3dcd44[_0x287bfa(0x105)](_0x287bfa(0x12d))),console[_0x287bfa(0x10d)](a36_0x3dcd44['yellow'](_0x287bfa(0x113)));const {options:_0x102a3d,args:_0x46f1e2,tdx:_0xd83f3e}=_0x4d49bf,_0x411114=_0x102a3d;if(_0x46f1e2[_0x287bfa(0x119)]===0x0)return console[_0x287bfa(0x10d)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x287bfa(0x10d)](_0x287bfa(0x101)),console[_0x287bfa(0x10d)]('Examples:'),console[_0x287bfa(0x10d)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x287bfa(0x110)),console[_0x287bfa(0x10d)](_0x287bfa(0x107)),0x1;const _0x539eb2=_0x46f1e2[0x0],_0x157d46=_0x102a3d[_0x287bfa(0x129)];let _0x175cd5=_0x539eb2;_0x157d46&&!_0x539eb2[_0x287bfa(0x10c)]('/')&&(_0x175cd5=_0x157d46+'/'+_0x539eb2,_0x411114['verbose']&&console[_0x287bfa(0x10d)](_0x287bfa(0x11b)+_0x175cd5));const _0x3a0c39=parsePath(_0x175cd5);if(_0x3a0c39[_0x287bfa(0x111)][_0x287bfa(0x119)]<0x2)return console[_0x287bfa(0x10d)](_0x287bfa(0x11f)),console[_0x287bfa(0x10d)](_0x287bfa(0x108)),0x1;const _0x31aeef=_0x3a0c39['segments'][0x0],_0x4cf0f3=getBaseName(_0x175cd5),_0x2631c9=getParentPath(_0x175cd5);_0x411114[_0x287bfa(0x117)]&&(console[_0x287bfa(0x10d)](_0x287bfa(0x12c)+_0x411114['site']),console[_0x287bfa(0x10d)](_0x287bfa(0x115)+_0x175cd5),console['error'](_0x287bfa(0x10a)+_0x31aeef),console[_0x287bfa(0x10d)](_0x287bfa(0x106)+_0x4cf0f3),console['error']('Parent\x20path:\x20'+_0x2631c9));const _0x231295=await withSpinner(_0x287bfa(0x124)+_0x31aeef+_0x287bfa(0x126),()=>_0xd83f3e[_0x287bfa(0x128)]['resolveParentId'](_0x31aeef),{'verbose':_0x411114[_0x287bfa(0x117)]}),_0x12ddf3=_0x231295[_0x287bfa(0x103)];let _0x294535;if(_0x3a0c39[_0x287bfa(0x111)]['length']>0x2){const _0x50b7b3=await withSpinner(_0x287bfa(0x114)+_0x2631c9+'\x27...',()=>_0xd83f3e[_0x287bfa(0x128)]['resolvePathToResource'](_0x2631c9),{'verbose':_0x411114['verbose']}),_0x2359ce=_0x50b7b3[_0x287bfa(0x103)];if(_0x2359ce[_0x287bfa(0x127)]!=='folder'&&_0x2359ce['type']!==_0x287bfa(0x10b))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x294535=_0x2359ce[_0x287bfa(0x104)];}else{if(_0x411114[_0x287bfa(0x109)]){const _0x55341d=await withSpinner(_0x287bfa(0x12f)+_0x411114[_0x287bfa(0x109)]+_0x287bfa(0x126),()=>_0xd83f3e[_0x287bfa(0x128)]['resolveFolderId'](_0x12ddf3,_0x411114['folder']),{'verbose':_0x411114[_0x287bfa(0x117)]});_0x294535=_0x55341d['data'];}}_0x411114[_0x287bfa(0x117)]&&_0x294535&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x294535);const _0x3f9fb3=await loadJSONFromOptions(_0x411114['rule'],_0x411114['ruleFile']),_0x591c05={'name':_0x4cf0f3,'description':_0x411114[_0x287bfa(0x102)],'rule':_0x3f9fb3,'kind':_0x411114[_0x287bfa(0x11c)]!==undefined?parseInt(_0x411114['kind'],0xa):undefined,'isVisible':_0x411114[_0x287bfa(0x123)]?![]:undefined,'segmentFolderId':_0x294535,'countPopulation':_0x411114[_0x287bfa(0x120)]?![]:undefined},_0x54cc1b=await withSpinner(_0x287bfa(0x118)+_0x4cf0f3+_0x287bfa(0x126),()=>_0xd83f3e[_0x287bfa(0x128)][_0x287bfa(0x11e)](_0x12ddf3,_0x591c05),{'verbose':_0x411114[_0x287bfa(0x117)]}),_0x27f187=_0x54cc1b[_0x287bfa(0x103)];return console['error'](_0x287bfa(0x11d)+_0x27f187[_0x287bfa(0x10f)]+_0x287bfa(0xff)+_0x27f187['id']),_0x175cd5!==_0x539eb2&&console[_0x287bfa(0x10d)]('\x20\x20\x20Path:\x20'+_0x175cd5),await handleSDKOutput([_0x27f187],_0x411114),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x288e03=a37_0x3cb0;(function(_0x1201fa,_0x5b5dab){const _0x3c2d8f=a37_0x3cb0,_0x2214e8=_0x1201fa();while(!![]){try{const _0x2c2a6d=parseInt(_0x3c2d8f(0xd6))/0x1*(parseInt(_0x3c2d8f(0xce))/0x2)+parseInt(_0x3c2d8f(0xc5))/0x3+parseInt(_0x3c2d8f(0xbf))/0x4+-parseInt(_0x3c2d8f(0xc9))/0x5*(parseInt(_0x3c2d8f(0xbc))/0x6)+parseInt(_0x3c2d8f(0xd4))/0x7+-parseInt(_0x3c2d8f(0xcb))/0x8+-parseInt(_0x3c2d8f(0xcf))/0x9*(parseInt(_0x3c2d8f(0xd1))/0xa);if(_0x2c2a6d===_0x5b5dab)break;else _0x2214e8['push'](_0x2214e8['shift']());}catch(_0x559a99){_0x2214e8['push'](_0x2214e8['shift']());}}}(a37_0x2b22,0x8291d));function a37_0x3cb0(_0x27bfae,_0x524ccb){_0x27bfae=_0x27bfae-0xbc;const _0x2b2282=a37_0x2b22();let _0x3cb096=_0x2b2282[_0x27bfae];return _0x3cb096;}import{BaseCommand}from'./command.js';function a37_0x2b22(){const _0x436a28=['data','244064BeJROt','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','length','1719524PfdRHV','18kLzTCI','parentSegment','7990960tKtnjs','List\x20available\x20fields\x20for\x20segmentation','site','6310836czxvvd','β\x20Found\x20','1lLCneJ','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1032JbaxfW','listFields','segment:fields','1483948KoDult','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','\x20field','jsonl','2512656AUyLJg','execute','Parent\x20segment:\x20','error','23440QafxCI'];a37_0x2b22=function(){return _0x436a28;};return a37_0x2b22();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a37_0x288e03(0xbe);['description']=a37_0x288e03(0xd2);async[a37_0x288e03(0xc6)](_0x5c767f){const _0x1c24aa=a37_0x288e03,{options:_0x2f7451,args:_0x7f1c64,tdx:_0xffb24a}=_0x5c767f,_0x122d9c=_0x7f1c64[0x0]||_0x2f7451[_0x1c24aa(0xd0)];if(!_0x122d9c)return console[_0x1c24aa(0xc8)](_0x1c24aa(0xc1)),console[_0x1c24aa(0xc8)](_0x1c24aa(0xcc)),console[_0x1c24aa(0xc8)](_0x1c24aa(0xd7)),0x1;_0x2f7451['verbose']&&(console['error'](_0x1c24aa(0xc0)+_0x2f7451[_0x1c24aa(0xd3)]),console[_0x1c24aa(0xc8)](_0x1c24aa(0xc7)+_0x122d9c));const _0x56bb1c=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x122d9c+_0x1c24aa(0xc2),()=>_0xffb24a['segment'][_0x1c24aa(0xbd)](_0x122d9c),{'verbose':_0x2f7451['verbose']}),_0x1c388e=_0x56bb1c[_0x1c24aa(0xca)];console['error'](_0x1c24aa(0xd5)+_0x1c388e[_0x1c24aa(0xcd)]+_0x1c24aa(0xc3)+(_0x1c388e['length']!==0x1?'s':''));if(_0x2f7451['json']||_0x2f7451[_0x1c24aa(0xc4)])return await handleSDKOutput(_0x1c388e,_0x2f7451),0x0;return displayFieldsHumanReadable(_0x1c388e,_0x122d9c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x4ad4ab=a38_0x341a;(function(_0x2a9696,_0x213842){const _0x515c90=a38_0x341a,_0x212150=_0x2a9696();while(!![]){try{const _0x1a46a6=-parseInt(_0x515c90(0x165))/0x1+-parseInt(_0x515c90(0x161))/0x2+parseInt(_0x515c90(0x18d))/0x3+parseInt(_0x515c90(0x163))/0x4*(-parseInt(_0x515c90(0x17a))/0x5)+parseInt(_0x515c90(0x179))/0x6*(parseInt(_0x515c90(0x16e))/0x7)+parseInt(_0x515c90(0x15a))/0x8+-parseInt(_0x515c90(0x157))/0x9*(-parseInt(_0x515c90(0x17f))/0xa);if(_0x1a46a6===_0x213842)break;else _0x212150['push'](_0x212150['shift']());}catch(_0x22a53a){_0x212150['push'](_0x212150['shift']());}}}(a38_0xc888,0x4ceb0));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 a38_0x18f086 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x2e14c6 from'path';function a38_0x341a(_0x46c824,_0x40719b){_0x46c824=_0x46c824-0x145;const _0xc888d9=a38_0xc888();let _0x341a08=_0xc888d9[_0x46c824];return _0x341a08;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0x4ad4ab(0x18a)]=a38_0x4ad4ab(0x146);[a38_0x4ad4ab(0x173)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0x4ad4ab(0x174)](_0x4b2b0f){const _0x2f3ef9=a38_0x4ad4ab,{options:_0x4cf5f4,args:_0x14d080,tdx:_0x5877d1}=_0x4b2b0f,_0x18b649=_0x4cf5f4,_0x234ec2=await resolveTarget({'arg':_0x14d080[0x0],'contextParent':_0x4cf5f4[_0x2f3ef9(0x17d)],'cwd':process[_0x2f3ef9(0x156)]()});if(!isSuccessfulResolution(_0x234ec2))return _0x234ec2[_0x2f3ef9(0x16c)]===_0x2f3ef9(0x16b)?(console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18c)](_0x2f3ef9(0x14e))),console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x169)),console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x150)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x154)]('Error:\x20'+_0x234ec2['message']+'\x0a')),_0x234ec2['helpText']&&console['error'](a38_0x18f086[_0x2f3ef9(0x175)](_0x234ec2[_0x2f3ef9(0x182)]))),0x1;const _0x32cb31=_0x234ec2[_0x2f3ef9(0x18e)],_0x3d5e70=_0x234ec2[_0x2f3ef9(0x168)],_0x7c6f57=_0x234ec2['type']==='file'?_0x234ec2['resourceName']:undefined;_0x18b649[_0x2f3ef9(0x148)]&&(console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x178)+_0x18b649['site']),console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x159)+_0x32cb31),_0x7c6f57&&console[_0x2f3ef9(0x15d)]('Target\x20resource:\x20'+_0x7c6f57));const _0x3753ff=await withProgressSpinner(_0x2f3ef9(0x17b)+_0x32cb31+_0x2f3ef9(0x158),_0x504a52=>_0x5877d1[_0x2f3ef9(0x15c)][_0x2f3ef9(0x191)](_0x32cb31,{'targetDir':_0x3d5e70,'targetResourceName':_0x7c6f57,'verbose':_0x18b649[_0x2f3ef9(0x148)],'progress':{'update':_0x4d5595=>{const _0x4d3985=_0x2f3ef9;_0x504a52[_0x4d3985(0x189)](_0x4d5595),_0x18b649[_0x4d3985(0x148)]&&console[_0x4d3985(0x15d)]('\x20\x20'+_0x4d5595);}}}),{'verbose':_0x18b649[_0x2f3ef9(0x148)]}),_0x5f25ed=_0x3753ff[_0x2f3ef9(0x16f)];if(_0x5f25ed['counts'][_0x2f3ef9(0x180)]===0x0&&_0x5f25ed['counts'][_0x2f3ef9(0x155)]===0x0)return console['error'](a38_0x18f086['yellow'](_0x2f3ef9(0x162)+_0x5f25ed['parentName']+'\x27')),0x0;const _0x5252f2=_0x5f25ed[_0x2f3ef9(0x145)]['filter'](_0x1fe113=>_0x1fe113[_0x2f3ef9(0x15f)]),_0x4f916f=_0x5f25ed[_0x2f3ef9(0x145)][_0x2f3ef9(0x15e)](_0x4023a7=>!_0x4023a7[_0x2f3ef9(0x15f)]&&_0x4023a7['hasChanges']),_0x48cde1=_0x5f25ed[_0x2f3ef9(0x145)][_0x2f3ef9(0x15e)](_0x585d09=>!_0x585d09[_0x2f3ef9(0x15f)]&&!_0x585d09[_0x2f3ef9(0x17e)]);console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x14b)+_0x5f25ed[_0x2f3ef9(0x18e)]+'\x27:'),console[_0x2f3ef9(0x15d)]('\x20\x20π―\x20'+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x180)]+'\x20segments')+'\x20with\x20'+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x14d)]+_0x2f3ef9(0x171)));if(_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x155)]>0x0){const _0x45546d=_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x190)]>_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x155)]?'\x20('+_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x190)]+'\x20versions)':'';console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x166)+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x155)]+'\x20journeys')+a38_0x18f086[_0x2f3ef9(0x187)](_0x45546d));}console[_0x2f3ef9(0x15d)]('\x20\x20'+a38_0x18f086[_0x2f3ef9(0x18f)]('+\x20'+_0x5252f2[_0x2f3ef9(0x183)]+'\x20new\x20files')),console[_0x2f3ef9(0x15d)]('\x20\x20'+a38_0x18f086[_0x2f3ef9(0x18c)]('~\x20'+_0x4f916f['length']+_0x2f3ef9(0x192))),console[_0x2f3ef9(0x15d)]('\x20\x20'+a38_0x18f086[_0x2f3ef9(0x187)]('=\x20'+_0x48cde1['length']+_0x2f3ef9(0x16d))),console['error'](_0x2f3ef9(0x170)+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed['targetDir'])+'\x0a');if(_0x4f916f['length']>0x0)for(const _0x48b479 of _0x4f916f){console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x14c)+_0x48b479[_0x2f3ef9(0x176)]+'\x27:'),console[_0x2f3ef9(0x15d)]('β'['repeat'](0x3c)),console[_0x2f3ef9(0x15d)](_0x48b479['diff']),console[_0x2f3ef9(0x15d)]('β'[_0x2f3ef9(0x149)](0x3c));}if(_0x18b649[_0x2f3ef9(0x153)])return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18c)](_0x2f3ef9(0x172))),0x0;if(_0x5252f2[_0x2f3ef9(0x183)]===0x0&&_0x4f916f[_0x2f3ef9(0x183)]===0x0)return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)](_0x2f3ef9(0x185))),saveSessionContext({'parent_segment':_0x5f25ed['parentName']},_0x18b649[_0x2f3ef9(0x167)]),console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)](_0x2f3ef9(0x184)+a38_0x18f086[_0x2f3ef9(0x187)](_0x2f3ef9(0x147))+_0x2f3ef9(0x16a)+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x18e)]))),0x0;if(!_0x18b649[_0x2f3ef9(0x177)]){if(!isInteractive())return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x154)](_0x2f3ef9(0x181)),_0x2f3ef9(0x14f)),console['error'](a38_0x18f086[_0x2f3ef9(0x187)](_0x2f3ef9(0x18b))),0x1;const _0x5609f9=await confirmKey(_0x2f3ef9(0x188)+(_0x5252f2[_0x2f3ef9(0x183)]+_0x4f916f[_0x2f3ef9(0x183)])+'\x20files?');if(!_0x5609f9)return console['error'](a38_0x18f086[_0x2f3ef9(0x18c)](_0x2f3ef9(0x186)),_0x2f3ef9(0x151)),0x1;}for(const _0x4d4316 of _0x5f25ed[_0x2f3ef9(0x145)]){if(_0x4d4316[_0x2f3ef9(0x15f)]||_0x4d4316[_0x2f3ef9(0x17e)]){const _0x4aa39e=a38_0x2e14c6[_0x2f3ef9(0x15b)](_0x4d4316[_0x2f3ef9(0x17c)]);!existsSync(_0x4aa39e)&&mkdirSync(_0x4aa39e,{'recursive':!![]}),writeFileSync(_0x4d4316['absolutePath'],_0x4d4316[_0x2f3ef9(0x152)],_0x2f3ef9(0x164));}}return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)]('β\x20Pulled\x20'+(_0x5252f2[_0x2f3ef9(0x183)]+_0x4f916f[_0x2f3ef9(0x183)])+_0x2f3ef9(0x14a)+_0x5f25ed[_0x2f3ef9(0x168)])),saveSessionContext({'parent_segment':_0x5f25ed[_0x2f3ef9(0x18e)]},_0x18b649[_0x2f3ef9(0x167)]),console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)](_0x2f3ef9(0x184)+a38_0x18f086[_0x2f3ef9(0x187)](_0x2f3ef9(0x147))+'\x20=\x20'+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x18e)]))),0x0;}}function a38_0xc888(){const _0x187cec=['yes','Site:\x20','54urDWhM','23060SPBqmy','Pulling\x20segments\x20from\x20\x27','absolutePath','parentSegment','hasChanges','10TygPtL','segments','\x0aError:','helpText','length','β\x20Context\x20set:\x20','β\x20All\x20files\x20are\x20up\x20to\x20date','Aborted.','dim','Write\x20','setPhase','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','yellow','116643wXCJEt','parentName','green','journeyVersions','pullSegments','\x20changed\x20files','files','segment:pull','parent_segment','verbose','repeat','\x20files\x20to\x20','\x0aPull\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20\x27','activations','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','-\x20no\x20files\x20written','content','dryRun','red','journeys','cwd','6517539lgXySC','\x27...','Parent\x20segment:\x20','3870688kIRVfL','dirname','segment','error','filter','isNew','counts','336848iIzUhF','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','388cfpkrm','utf-8','330138FijDCq','\x20\x20πΊοΈ\x20\x20','session','targetDir','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)','\x20=\x20','no_parent','errorCode','\x20unchanged\x20files','10962fqPbPK','data','\x20\x20Target:\x20','\x20activations','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','description','execute','cyan','relativePath'];a38_0xc888=function(){return _0x187cec;};return a38_0xc888();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x53e847=a39_0x20a9;function a39_0x5322(){const _0x2f6bda=['Changes\x20to:','4589760rifIZA','journeyId','listSegments','New\x20journey:','journeyBundleName','\x20updated','createdAt','journey','message','Scoped\x20to\x20folder:\x20','set','yellow','parentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Delete\x20segment:','dim','parent_name','Delete\x20journey:','\x27...','\x20unchanged','\x0aβ\x20Push\x20complete','dryRun','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','relationships','execute','Preparing\x20journeys...','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20delete','yamlConfig','filter','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Error:\x20','state','red','journeys','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getOutputSchemaWithCache','type','existingJourney','folderPath','nameToType','repeat','toCreate','folders','file','deleted','updatedAt','journeysOnly','results','\x0aError:','\x20YAML\x20files\x20found','yes','7497152ErNKVR','verbose','Site:\x20','resolveParentId','site','cwd','\x0aPush\x20summary\x20for\x20\x27','listFolders','filePath','segment\x20or\x20journey','errorCode','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment:push','Fetching\x20existing\x20activations...','existingSegment','error','delete','\x20new','get','parentFolder','\x20\x20\x20\x20','blue','\x20folders\x20to\x20create','name','endsWith','(Journey\x20will\x20be\x20deleted)','paused','changed','Resolving\x20parent\x20segment\x20\x27','green','isScoped','segment','segments','/e/','New\x20segment:','nameToId','\x20\x20Journeys:\x20','updated','scopedFolderPath','getJourney','list','buildUserMaps','idToName','Fetching\x20connections\x20for\x20name\x20resolution...','folderId','created','data','Changes\x20to\x20journey:','description','\x20\x20π\x20Segments:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','cyan','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)','add','diff','\x0aValidation\x20failed:','toUpdate','map','439538qZwKpB','\x20\x20Source:\x20','isNew','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','14dowAmu','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','listJourneysWithDetailsFromParentSegment','listActivations','\x20\x20Activations:','/app/ps/','.yaml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20deleted','segmentFolderId','push','no_parent','\x20changed','versionNumber','β\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','all','1328344TOZGek','connection','journeyBundleId','unchanged','1029048YcZPvZ','join','activations','createdSegmentIds','3253761XOqapC','length','new','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','464428icQAmO','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','targetDir','Fetching\x20existing\x20data...','\x20created','helpText','setPhase','Aborted.','then','toDelete','\x20activations]','/sb/da/esr','getParent'];a39_0x5322=function(){return _0x2f6bda;};return a39_0x5322();}(function(_0x24f2c0,_0xb5a7bf){const _0x1d2c40=a39_0x20a9,_0x559bb9=_0x24f2c0();while(!![]){try{const _0x598e97=-parseInt(_0x1d2c40(0x17b))/0x1+-parseInt(_0x1d2c40(0x191))/0x2+-parseInt(_0x1d2c40(0x199))/0x3+parseInt(_0x1d2c40(0x19d))/0x4+parseInt(_0x1d2c40(0x1ab))/0x5+-parseInt(_0x1d2c40(0x195))/0x6+parseInt(_0x1d2c40(0x180))/0x7*(parseInt(_0x1d2c40(0x141))/0x8);if(_0x598e97===_0xb5a7bf)break;else _0x559bb9['push'](_0x559bb9['shift']());}catch(_0x1d268e){_0x559bb9['push'](_0x559bb9['shift']());}}}(a39_0x5322,0x85ebe));import{BaseCommand}from'./command.js';function a39_0x20a9(_0x647cbf,_0x4d89c8){_0x647cbf=_0x647cbf-0x11b;const _0x5322f9=a39_0x5322();let _0x20a912=_0x5322f9[_0x647cbf];return _0x20a912;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x335156 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{[a39_0x53e847(0x158)]=a39_0x53e847(0x14d);['description']=a39_0x53e847(0x122);async[a39_0x53e847(0x124)](_0x3f48fb){const _0x5945bc=a39_0x53e847,{options:_0x5c7fea,args:_0x4a34d7,tdx:_0x1a0847}=_0x3f48fb,_0x51827d=_0x5c7fea,_0x52d3b9=await resolveTarget({'arg':_0x4a34d7[0x0],'contextParent':_0x5c7fea[_0x5945bc(0x1b7)],'cwd':process[_0x5945bc(0x146)]()});if(!isSuccessfulResolution(_0x52d3b9))return _0x52d3b9[_0x5945bc(0x14b)]===_0x5945bc(0x18b)?(console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x187))),console[_0x5945bc(0x150)](_0x5945bc(0x175)),console[_0x5945bc(0x150)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error'](_0x5945bc(0x17f))):(console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x12c)+_0x52d3b9[_0x5945bc(0x1b3)]+'\x0a')),_0x52d3b9[_0x5945bc(0x1a2)]&&console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x174)](_0x52d3b9[_0x5945bc(0x1a2)]))),0x1;if(_0x52d3b9[_0x5945bc(0x132)]===_0x5945bc(0x11c))return console['error'](a39_0x335156[_0x5945bc(0x12e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x52d3b9[_0x5945bc(0x19f)]+'\x0a')),console['error'](a39_0x335156[_0x5945bc(0x174)](_0x5945bc(0x181))),0x1;const _0x3c9d7e=_0x52d3b9['parentName'],_0x31a92b=_0x52d3b9[_0x5945bc(0x19f)],_0x247c47=_0x52d3b9['type']===_0x5945bc(0x139)?_0x52d3b9[_0x5945bc(0x149)]:undefined,_0x2f112b=getScopedDetails(_0x52d3b9),_0x158e7c=_0x2f112b?.[_0x5945bc(0x15f)]??![],_0x30a00c=_0x2f112b?.[_0x5945bc(0x167)]??'';if(!existsSync(_0x31a92b))return console['error'](a39_0x335156[_0x5945bc(0x12e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x31a92b+'\x0a')),console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x174)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x51827d['verbose']&&(console['error'](_0x5945bc(0x143)+_0x51827d[_0x5945bc(0x145)]),console[_0x5945bc(0x150)]('Parent\x20segment:\x20'+_0x3c9d7e),console[_0x5945bc(0x150)]('Source\x20directory:\x20'+_0x31a92b),_0x158e7c&&console['error'](_0x5945bc(0x1b4)+_0x30a00c));const _0x86aad5=await withSpinner(_0x5945bc(0x15d)+_0x3c9d7e+_0x5945bc(0x11e),()=>_0x1a0847[_0x5945bc(0x160)][_0x5945bc(0x144)](_0x3c9d7e),{'verbose':_0x51827d[_0x5945bc(0x142)]}),_0x2d80ec=_0x86aad5['data'],{parentSegmentResult:_0x2e6f25,segmentsResult:_0x326297,foldersResult:_0x53d5f2,journeysWithDetailsResult:_0x32660f,userMaps:_0x2b2590}=await withSpinner(_0x5945bc(0x1a0),async()=>{const _0x4042df=_0x5945bc,[_0x1930d0,_0x552522,_0x3095b6,_0x119223,_0x26d67b]=await Promise['all']([_0x1a0847[_0x4042df(0x160)][_0x4042df(0x1a9)](_0x2d80ec),_0x1a0847[_0x4042df(0x160)][_0x4042df(0x1ad)](_0x2d80ec),_0x1a0847['segment'][_0x4042df(0x148)](_0x2d80ec),_0x1a0847[_0x4042df(0x1b2)][_0x4042df(0x182)](_0x2d80ec,{'includeAllVersions':!![]}),_0x1a0847['user'][_0x4042df(0x16a)]()]);return{'parentSegmentResult':_0x1930d0,'segmentsResult':_0x552522,'foldersResult':_0x3095b6,'journeysWithDetailsResult':_0x119223,'userMaps':_0x26d67b};},{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x226958=>_0x226958[_0x5945bc(0x16f)]),_0x449a6e=_0x2e6f25,_0x4930fa=extractRootFolderId(_0x449a6e),_0x3b0a44=_0x326297,_0xac1f0a=_0x53d5f2,{journeys:_0x597488,activationStepsById:_0x5da580}=_0x32660f,_0x584b3d=new Map(_0x597488[_0x5945bc(0x17a)](_0x2aa6c1=>[_0x2aa6c1['id'],_0x2aa6c1])),_0x2e8b03=_0x597488[_0x5945bc(0x17a)](_0x21d721=>({'id':_0x21d721['id'],'name':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x158)],'journeyBundleName':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x1af)]||'','journeyBundleId':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x193)]||'','versionNumber':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x18d)],'description':_0x21d721['attributes'][_0x5945bc(0x171)],'state':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x12d)],'paused':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x15b)],'audienceId':_0x21d721[_0x5945bc(0x17e)]['audienceId'],'folderId':_0x21d721[_0x5945bc(0x123)]?.[_0x5945bc(0x154)]?.['data']?.['id'],'createdAt':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x1b1)],'updatedAt':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x13b)]})),{emailToId:_0x149a4b,idToEmail:_0x208b1e}=_0x2b2590,_0x1e41fa=await withSpinner(_0x5945bc(0x16c),async()=>{const _0x36b014=_0x5945bc,_0x511178=await _0x1a0847['connection'][_0x36b014(0x169)]();return buildConnectionMaps(_0x511178);},{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x3c7bd6=>_0x3c7bd6[_0x5945bc(0x16f)]),_0x46e7e9=_0x1e41fa[_0x5945bc(0x164)],_0x37ad9d=_0x1e41fa[_0x5945bc(0x16b)],_0x22d826=_0x1e41fa[_0x5945bc(0x135)],_0x284e46={'emailToIdMap':_0x149a4b,'connectionNameToIdMap':_0x46e7e9,'connectionNameToTypeMap':_0x22d826,'getSchema':_0x8c1937=>_0x1a0847[_0x5945bc(0x192)][_0x5945bc(0x131)](_0x8c1937)};let {pathToId:_0x2b4e3e,idToPath:_0x1e7128}=buildFolderMaps(_0xac1f0a);const _0xd2449=buildSegmentLookupMap(_0x3b0a44,_0x1e7128),_0x18830e=buildSegmentNameToIdMap(_0x3b0a44),_0x42fb4c=buildJourneyBundleLookupMap(_0x2e8b03,_0x1e7128);let _0x25a692;if(_0x247c47){if(!_0x247c47[_0x5945bc(0x159)]('.yml')&&!_0x247c47['endsWith'](_0x5945bc(0x186)))return console[_0x5945bc(0x150)](a39_0x335156['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x247c47+'\x0a')),0x1;_0x25a692=[_0x247c47];}else _0x25a692=findYamlFiles(_0x31a92b);if(_0x25a692[_0x5945bc(0x19a)]===0x0)return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x1b8)+_0x31a92b+'\x0a')),console[_0x5945bc(0x150)](a39_0x335156['cyan'](_0x5945bc(0x127))),0x1;let _0x1bfe36,_0x5b8aec;try{const _0x535149=parseAndClassifyYamlFiles(_0x25a692,_0x31a92b,{'skipSegments':_0x51827d[_0x5945bc(0x13c)]});_0x1bfe36=_0x535149[_0x5945bc(0x161)],_0x5b8aec=_0x535149[_0x5945bc(0x12f)];const _0x12ee3f=validateParsedFiles(_0x535149,_0x31a92b);if(_0x12ee3f[_0x5945bc(0x19a)]>0x0)return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x178))),console['error'](formatValidationErrors(_0x12ee3f)),console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x18f))),0x1;}catch(_0x404c18){return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)]('Error\x20parsing\x20YAML:\x20'+(_0x404c18 instanceof Error?_0x404c18[_0x5945bc(0x1b3)]:_0x404c18))),0x1;}if(_0x1bfe36[_0x5945bc(0x19a)]===0x0&&_0x5b8aec[_0x5945bc(0x19a)]===0x0){const _0x4a4cff=_0x51827d[_0x5945bc(0x13c)]?'journey':_0x5945bc(0x14a);return console[_0x5945bc(0x150)](a39_0x335156['yellow']('No\x20'+_0x4a4cff+_0x5945bc(0x13f))),0x0;}const _0x365879=new Map();_0x3b0a44[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&await withSpinner(_0x5945bc(0x14e),async()=>{await batchAsync(_0x3b0a44,async _0x522532=>{const _0x5537ab=a39_0x20a9,_0x33ba30=await _0x1a0847[_0x5537ab(0x160)][_0x5537ab(0x183)](_0x2d80ec,_0x522532['id']);_0x365879[_0x5537ab(0x1b5)](_0x522532['id'],_0x33ba30);});},{'verbose':_0x51827d[_0x5945bc(0x142)]});const {segmentFiles:_0x3a1965,foldersToCreate:_0x101586}=await prepareSegmentFiles(_0x1bfe36,{'segmentByFolderAndName':_0xd2449,'activationsBySegmentId':_0x365879,'folderPathToId':_0x2b4e3e,'idToEmailMap':_0x208b1e,'connectionIdToNameMap':_0x37ad9d},_0x284e46,_0x158e7c,_0x30a00c),_0x328b25=_0x247c47?[]:findSegmentsToDelete(_0x3b0a44,_0x1bfe36[_0x5945bc(0x17a)](({yamlConfig:_0x5aa020,folderPath:_0x6a0962})=>({'yamlConfig':_0x5aa020,'folderPath':resolveTDFolderPath(_0x6a0962,_0x158e7c,_0x30a00c)})),_0x1e7128,_0x30a00c,_0x158e7c),{journeyFiles:_0x5f279c,foldersToCreate:_0x360b98}=await withProgressSpinner(_0x5945bc(0x125),async _0x31403d=>prepareJourneyFiles(_0x5b8aec,{'fetchJourney':async _0x90d7e7=>_0x1a0847[_0x5945bc(0x1b2)][_0x5945bc(0x168)](_0x90d7e7['journeyId']),'journeyBundlesByFolderAndName':_0x42fb4c,'folderPathToId':_0x2b4e3e,'idToEmailMap':_0x208b1e,'connectionIdToNameMap':_0x37ad9d,'existingSegments':_0x3b0a44,'parentId':_0x2d80ec,'deps':_0x1a0847,'progress':{'update':_0x1fffac=>{const _0xc86316=_0x5945bc;_0x31403d[_0xc86316(0x1a3)](_0x1fffac),_0x51827d[_0xc86316(0x142)]&&console[_0xc86316(0x150)]('\x20\x20'+_0x1fffac);}},'journeyById':_0x584b3d,'activationStepsById':_0x5da580},_0x158e7c,_0x30a00c),{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x2602d3=>_0x2602d3[_0x5945bc(0x16f)]);for(const _0x530f78 of _0x360b98){_0x101586[_0x5945bc(0x176)](_0x530f78);}const _0xe901f2=_0x247c47?[]:findJourneysToDelete(_0x2e8b03,_0x5b8aec['map'](({yamlConfig:_0x311d17,folderPath:_0x10ae5c})=>({'yamlConfig':_0x311d17,'folderPath':resolveTDFolderPath(_0x10ae5c,_0x158e7c,_0x30a00c)})),_0x1e7128,_0x30a00c,_0x158e7c),_0x4a46c7=calculatePushStats(_0x3a1965,_0x5f279c,_0x101586,_0x328b25,_0xe901f2,!!_0x51827d[_0x5945bc(0x151)],!!_0x51827d['journeysOnly']),_0x370fab=_0x4a46c7[_0x5945bc(0x161)]['new'],_0x55f1d2=_0x4a46c7[_0x5945bc(0x161)][_0x5945bc(0x15c)],_0xd0b07c=_0x4a46c7[_0x5945bc(0x161)][_0x5945bc(0x194)],_0x4d94a2=_0x4a46c7['segments'][_0x5945bc(0x1a6)],_0x35cf50=_0x4a46c7[_0x5945bc(0x138)][_0x5945bc(0x137)],_0x22565d=_0x4a46c7[_0x5945bc(0x12f)][_0x5945bc(0x19b)],_0x154aef=_0x4a46c7[_0x5945bc(0x12f)][_0x5945bc(0x15c)],_0x233a2e=_0x4a46c7['journeys'][_0x5945bc(0x194)],_0x2d5aca=_0x4a46c7[_0x5945bc(0x12f)]['toDelete'],_0x5e4dc7=_0x4a46c7[_0x5945bc(0x197)][_0x5945bc(0x190)],_0x500459=_0x4a46c7['activations'][_0x5945bc(0x137)],_0x20c828=_0x4a46c7[_0x5945bc(0x197)][_0x5945bc(0x179)],_0x3e8b0f=_0x4a46c7[_0x5945bc(0x197)]['toDelete'];console[_0x5945bc(0x150)](_0x5945bc(0x147)+_0x3c9d7e+'\x27:');_0x35cf50[_0x5945bc(0x19a)]>0x0&&console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156['blue']('π\x20'+_0x35cf50[_0x5945bc(0x19a)]+_0x5945bc(0x157)));if(!_0x51827d[_0x5945bc(0x13c)]){console[_0x5945bc(0x150)](_0x5945bc(0x172)),console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x370fab[_0x5945bc(0x19a)]+_0x5945bc(0x152))),console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x55f1d2[_0x5945bc(0x19a)]+_0x5945bc(0x18c)));if(_0x4d94a2[_0x5945bc(0x19a)]>0x0)console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x12e)]('-\x20'+_0x4d94a2[_0x5945bc(0x19a)]+_0x5945bc(0x128)));else _0x328b25[_0x5945bc(0x19a)]>0x0&&!_0x51827d['delete']&&console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x11b)](_0x328b25[_0x5945bc(0x19a)]+_0x5945bc(0x14c)));console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x11b)]('=\x20'+_0xd0b07c[_0x5945bc(0x19a)]+_0x5945bc(0x11f)));}if(_0x5f279c['length']>0x0||_0xe901f2[_0x5945bc(0x19a)]>0x0){console[_0x5945bc(0x150)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x22565d[_0x5945bc(0x19a)]+_0x5945bc(0x152))),console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x154aef[_0x5945bc(0x19a)]+_0x5945bc(0x18c)));if(_0x2d5aca['length']>0x0)console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x12e)]('-\x20'+_0x2d5aca[_0x5945bc(0x19a)]+'\x20to\x20delete'));else _0xe901f2[_0x5945bc(0x19a)]>0x0&&!_0x51827d['delete']&&console[_0x5945bc(0x150)]('\x20\x20\x20\x20'+a39_0x335156[_0x5945bc(0x11b)](_0xe901f2[_0x5945bc(0x19a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156['dim']('=\x20'+_0x233a2e[_0x5945bc(0x19a)]+_0x5945bc(0x11f)));}_0x5e4dc7['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&(console['error'](''),console['error'](_0x5945bc(0x184)),_0x500459[_0x5945bc(0x19a)]>0x0&&console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x500459[_0x5945bc(0x19a)]+'\x20to\x20create')),_0x20c828[_0x5945bc(0x19a)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x20c828['length']+'\x20to\x20update')),_0x3e8b0f[_0x5945bc(0x19a)]>0x0&&console['error'](_0x5945bc(0x155)+a39_0x335156['red']('-\x20'+_0x3e8b0f[_0x5945bc(0x19a)]+_0x5945bc(0x128))));console['error'](_0x5945bc(0x17c)+a39_0x335156[_0x5945bc(0x174)](_0x31a92b)+'\x0a');if(_0x35cf50[_0x5945bc(0x19a)]>0x0){console[_0x5945bc(0x150)]('Folders\x20to\x20create:');for(const _0x1bfc29 of _0x35cf50){console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x156)]('+')+'\x20'+_0x1bfc29);}console[_0x5945bc(0x150)]('');}if(_0x370fab[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x3c6c2a of _0x370fab){const _0x178126=_0x3c6c2a['folderPath']?_0x3c6c2a['folderPath']+'/'+_0x3c6c2a[_0x5945bc(0x129)]['name']:_0x3c6c2a[_0x5945bc(0x129)][_0x5945bc(0x158)],_0x39db2c=_0x3c6c2a[_0x5945bc(0x129)][_0x5945bc(0x197)]?.['length']||0x0,_0xdcdfa6=_0x39db2c>0x0?a39_0x335156[_0x5945bc(0x11b)]('\x20['+_0x39db2c+'\x20activations]'):'';console['error']('\x0a'+a39_0x335156[_0x5945bc(0x15e)](_0x5945bc(0x163))+'\x20'+_0x178126+_0xdcdfa6),console[_0x5945bc(0x150)]('β'[_0x5945bc(0x136)](0x3c)),_0x3c6c2a[_0x5945bc(0x177)]&&console[_0x5945bc(0x150)](_0x3c6c2a[_0x5945bc(0x177)]),console[_0x5945bc(0x150)]('β'['repeat'](0x3c));}if(_0x4d94a2[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x18d3c2 of _0x4d94a2){const _0x113f50=_0x18d3c2[_0x5945bc(0x189)]?_0x1e7128[_0x5945bc(0x153)](_0x18d3c2[_0x5945bc(0x189)]['toString']())||'':'',_0x373db3=_0x113f50?_0x113f50+'/'+_0x18d3c2[_0x5945bc(0x158)]:_0x18d3c2[_0x5945bc(0x158)],_0x2ea4ed=_0x365879['get'](_0x18d3c2['id'])||[],_0x234bd2=_0x2ea4ed[_0x5945bc(0x19a)]>0x0?a39_0x335156['dim']('\x20['+_0x2ea4ed[_0x5945bc(0x19a)]+_0x5945bc(0x1a7)):'';console['error']('\x0a'+a39_0x335156['red'](_0x5945bc(0x1b9))+'\x20'+_0x373db3+_0x234bd2),console[_0x5945bc(0x150)]('β'['repeat'](0x3c));const _0x1af375=segmentWithActivationsToYaml(_0x18d3c2,_0x2ea4ed,undefined,_0x208b1e,_0x37ad9d),_0x3634d6=segmentToYamlString(_0x1af375),_0x132f9c=generateDiff(_0x3634d6,'');console['error'](formatDiffWithColors(_0x132f9c)),console[_0x5945bc(0x150)]('β'[_0x5945bc(0x136)](0x3c));}const _0x51433e=_0x3a1965[_0x5945bc(0x12a)](_0x4aeb35=>!_0x4aeb35['isNew']&&_0x4aeb35[_0x5945bc(0x177)]);if(_0x51433e[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x28eef5 of _0x51433e){const _0x115a38=_0x28eef5[_0x5945bc(0x134)]?_0x28eef5['folderPath']+'/'+_0x28eef5[_0x5945bc(0x129)]['name']:_0x28eef5['yamlConfig'][_0x5945bc(0x158)];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x1aa))+'\x20'+_0x115a38),console['error']('β'[_0x5945bc(0x136)](0x3c)),console[_0x5945bc(0x150)](_0x28eef5[_0x5945bc(0x177)]),console['error']('β'['repeat'](0x3c));}if(_0x22565d[_0x5945bc(0x19a)]>0x0)for(const _0x5cf674 of _0x22565d){const _0x3fdd9e=_0x5cf674['folderPath']?_0x5cf674['folderPath']+'/'+_0x5cf674[_0x5945bc(0x129)]['name']:_0x5cf674[_0x5945bc(0x129)]['name'];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156['green'](_0x5945bc(0x1ae))+'\x20'+_0x3fdd9e),console[_0x5945bc(0x150)]('β'['repeat'](0x3c)),_0x5cf674[_0x5945bc(0x177)]&&console[_0x5945bc(0x150)](_0x5cf674[_0x5945bc(0x177)]),console[_0x5945bc(0x150)]('β'[_0x5945bc(0x136)](0x3c));}const _0x367aee=_0x5f279c['filter'](_0x5284c6=>!_0x5284c6[_0x5945bc(0x17d)]&&_0x5284c6[_0x5945bc(0x177)]);if(_0x367aee[_0x5945bc(0x19a)]>0x0)for(const _0x532d00 of _0x367aee){const _0x1a9aea=_0x532d00[_0x5945bc(0x134)]?_0x532d00[_0x5945bc(0x134)]+'/'+_0x532d00['yamlConfig']['name']:_0x532d00[_0x5945bc(0x129)][_0x5945bc(0x158)];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x170))+'\x20'+_0x1a9aea),console[_0x5945bc(0x150)]('β'['repeat'](0x3c)),console[_0x5945bc(0x150)](_0x532d00[_0x5945bc(0x177)]),console['error']('β'[_0x5945bc(0x136)](0x3c));}if(_0x2d5aca[_0x5945bc(0x19a)]>0x0)for(const _0x285129 of _0x2d5aca){const _0x2b511e=_0x285129[_0x5945bc(0x16d)]?_0x1e7128[_0x5945bc(0x153)](_0x285129[_0x5945bc(0x16d)])||'':'',_0x55fbb5=_0x2b511e?_0x2b511e+'/'+_0x285129[_0x5945bc(0x1af)]:_0x285129['journeyBundleName'];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156['red'](_0x5945bc(0x11d))+'\x20'+_0x55fbb5),console[_0x5945bc(0x150)]('β'[_0x5945bc(0x136)](0x3c)),console[_0x5945bc(0x150)](a39_0x335156['red'](_0x5945bc(0x15a))),console[_0x5945bc(0x150)]('β'[_0x5945bc(0x136)](0x3c));}if(_0x51827d[_0x5945bc(0x121)])return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x173))),0x0;const _0x18e4cb=_0x51827d[_0x5945bc(0x13c)]?![]:_0x370fab[_0x5945bc(0x19a)]>0x0||_0x55f1d2[_0x5945bc(0x19a)]>0x0||_0x4d94a2[_0x5945bc(0x19a)]>0x0,_0x22c08e=_0x22565d[_0x5945bc(0x19a)]>0x0||_0x154aef['length']>0x0||_0x2d5aca['length']>0x0,_0x329c50=_0x51827d[_0x5945bc(0x13c)]?![]:_0x5e4dc7[_0x5945bc(0x19a)]>0x0,_0x5acbc0=_0x35cf50[_0x5945bc(0x19a)]>0x0;if(!_0x18e4cb&&!_0x22c08e&&!_0x329c50&&!_0x5acbc0){const _0x5b5b81=_0x51827d[_0x5945bc(0x13c)]?_0x5945bc(0x18e):_0x5945bc(0x12b);console['error'](a39_0x335156['green'](_0x5b5b81));if(_0x247c47&&_0xd0b07c[_0x5945bc(0x19a)]===0x1){const _0x38f537=_0xd0b07c[0x0];if(_0x38f537[_0x5945bc(0x14f)]?.['id']){const _0x118bc8=getConsoleNextUrl(_0x51827d['site'],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x38f537[_0x5945bc(0x14f)]['id']+_0x5945bc(0x1a8));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x335156[_0x5945bc(0x174)](_0x118bc8));}}if(_0x247c47&&_0x233a2e['length']===0x1){const _0x1dfb00=_0x233a2e[0x0];if(_0x1dfb00[_0x5945bc(0x133)]?.['id']){const _0x827504=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x1dfb00['existingJourney']['id']+'/j/da/je');console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x174)](_0x827504));}}return 0x0;}const _0x994772=_0x51827d[_0x5945bc(0x13c)]?_0x22565d[_0x5945bc(0x19a)]+_0x154aef[_0x5945bc(0x19a)]+_0x2d5aca['length']+_0x35cf50[_0x5945bc(0x19a)]:_0x370fab[_0x5945bc(0x19a)]+_0x55f1d2[_0x5945bc(0x19a)]+_0x4d94a2[_0x5945bc(0x19a)]+_0x22565d[_0x5945bc(0x19a)]+_0x154aef[_0x5945bc(0x19a)]+_0x2d5aca['length']+_0x35cf50[_0x5945bc(0x19a)]+_0x5e4dc7['length'];if(!_0x51827d[_0x5945bc(0x140)]&&_0x994772>0x0){if(!isInteractive())return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x13e)),_0x5945bc(0x19e)),console[_0x5945bc(0x150)](a39_0x335156['dim'](_0x5945bc(0x19c))),0x1;const _0x294255=await confirmKey('Push\x20'+_0x994772+'\x20changes?');if(!_0x294255)return console['error'](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x1a4))),0x1;}const _0x46a02c={'withProgress':async(_0xee15c1,_0x4589b9)=>{const _0x212afc=_0x5945bc,_0x57dd7f=await withSpinner(_0xee15c1,_0x4589b9,{'verbose':_0x51827d[_0x212afc(0x142)]});return{'data':_0x57dd7f[_0x212afc(0x16f)]};},'logInfo':_0x411636=>console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x156)]('β\x20'+_0x411636)),'logSuccess':_0x481381=>console['error'](a39_0x335156[_0x5945bc(0x15e)]('β\x20'+_0x481381)),'logWarning':_0x2e10bc=>console[_0x5945bc(0x150)](a39_0x335156['yellow']('β \x20'+_0x2e10bc)),'logDeleted':_0x2eea49=>console['error'](a39_0x335156['red']('β\x20'+_0x2eea49))},_0x3df71a={'segment':_0x1a0847[_0x5945bc(0x160)],'journey':_0x1a0847['journey'],'user':_0x1a0847['user'],'connection':_0x1a0847[_0x5945bc(0x192)]};_0x35cf50[_0x5945bc(0x19a)]>0x0&&(_0x2b4e3e=await executePushFolders(_0x3df71a,_0x35cf50,_0x2b4e3e,{'parentId':_0x2d80ec},_0x46a02c));const _0x30916a={'rootFolderId':_0x4930fa,'folderPathToId':_0x2b4e3e,'folderIdToPath':_0x1e7128,'segmentNameToId':_0x18830e,'activationsBySegmentId':_0x365879,'emailToIdMap':_0x149a4b,'idToEmailMap':_0x208b1e,'connectionNameToIdMap':_0x1e41fa['nameToId'],'connectionIdToNameMap':_0x1e41fa[_0x5945bc(0x16b)],'connectionNameToTypeMap':_0x22d826},_0x1d8bef=await executePushSegments(_0x3df71a,_0x51827d['journeysOnly']?[]:_0x3a1965,_0x30916a,{'parentId':_0x2d80ec},_0x46a02c),_0x347fc4=_0x1d8bef['created'],_0x4545a1=_0x1d8bef[_0x5945bc(0x166)],_0x52a694=_0x1d8bef['activations'][_0x5945bc(0x16e)],_0x4c80cc=_0x1d8bef[_0x5945bc(0x197)][_0x5945bc(0x166)],_0x2cc842=_0x1d8bef[_0x5945bc(0x197)][_0x5945bc(0x13a)];let _0x373a82;if(_0x247c47&&_0x3a1965['length']===0x1){const _0x117f54=_0x3a1965[0x0];_0x373a82=_0x117f54[_0x5945bc(0x14f)]?.['id']??_0x1d8bef[_0x5945bc(0x198)][_0x5945bc(0x153)](_0x117f54['yamlConfig'][_0x5945bc(0x158)]);}const _0x1d6ac6=await executePushSegmentDeletions(_0x3df71a,_0x51827d['journeysOnly']?[]:_0x4d94a2,_0x46a02c);let _0x580fc0=0x0,_0x2fff22=0x0,_0x13e899=0x0;const _0x26d007=new Map(_0x18830e);for(const [_0x7101fc,_0x31a5d3]of _0x1d8bef['createdSegmentIds']){_0x26d007['set'](_0x7101fc,_0x31a5d3);}if(_0x5f279c['length']>0x0){const _0x19a7ae={..._0x30916a,'segmentNameToId':_0x26d007,'existingSegments':_0x3b0a44,'activationContext':_0x284e46},_0x283824=await executePushJourneys(_0x3df71a,_0x5f279c,_0x19a7ae,{'parentId':_0x2d80ec,'rootFolderId':_0x4930fa,'verbose':_0x51827d[_0x5945bc(0x142)]},_0x46a02c);_0x580fc0=_0x283824['created'],_0x2fff22=_0x283824['updated'];if(_0x247c47&&_0x283824[_0x5945bc(0x13d)]['length']===0x1){const _0x2479d4=_0x283824[_0x5945bc(0x13d)][0x0];if(_0x2479d4[_0x5945bc(0x1ac)]){const _0x4c7f8d=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+'/e/'+_0x2479d4[_0x5945bc(0x1ac)]+'/j/da/je');console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x174)](_0x4c7f8d));}}}for(const _0x41fc4b of _0x2d5aca){console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)]('β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x41fc4b[_0x5945bc(0x1af)])),_0x13e899++;}const _0x169afa=[];if(_0x347fc4>0x0)_0x169afa[_0x5945bc(0x18a)](_0x347fc4+_0x5945bc(0x1a1));if(_0x4545a1>0x0)_0x169afa[_0x5945bc(0x18a)](_0x4545a1+'\x20updated');if(_0x1d6ac6>0x0)_0x169afa[_0x5945bc(0x18a)](_0x1d6ac6+'\x20deleted');const _0xbdb05d=[];if(_0x580fc0>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x580fc0+_0x5945bc(0x1a1));if(_0x2fff22>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x2fff22+'\x20updated');if(_0x13e899>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x13e899+_0x5945bc(0x188));const _0x582629=[];if(_0x52a694>0x0)_0x582629[_0x5945bc(0x18a)](_0x52a694+'\x20created');if(_0x4c80cc>0x0)_0x582629[_0x5945bc(0x18a)](_0x4c80cc+_0x5945bc(0x1b0));if(_0x2cc842>0x0)_0x582629[_0x5945bc(0x18a)](_0x2cc842+_0x5945bc(0x188));console['error'](a39_0x335156['green'](_0x5945bc(0x120)));_0x169afa['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&console[_0x5945bc(0x150)]('\x20\x20Segments:\x20'+_0x169afa[_0x5945bc(0x196)](',\x20'));_0xbdb05d['length']>0x0&&console['error'](_0x5945bc(0x165)+_0xbdb05d[_0x5945bc(0x196)](',\x20'));_0x582629['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&console[_0x5945bc(0x150)](_0x5945bc(0x126)+_0x582629[_0x5945bc(0x196)](',\x20'));if(_0x373a82){const _0x5b1f00=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x373a82+_0x5945bc(0x1a8));console['error'](_0x5945bc(0x130)+a39_0x335156[_0x5945bc(0x174)](_0x5b1f00));}return 0x0;}}
|
|
1
|
+
const a39_0x48a134=a39_0x1732;function a39_0x27e5(){const _0x2a3cfe=['folderPath','\x20changed','\x20\x20Journeys:\x20','set','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','helpText','\x20\x20π\x20Segments:','Delete\x20segment:','New\x20journey:','diff','Parent\x20segment:\x20','green','getParent','segment\x20or\x20journey','activations','errorCode','\x20new','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/j/da/je','(Journey\x20will\x20be\x20deleted)','parentSegment','\x20activations]','dryRun','name','toDelete','user','yes','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','β\x20All\x20journeys\x20are\x20up\x20to\x20date','Changes\x20to\x20journey:','/e/','523676DckxWm','red','created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','folders','617008XtzmlG','buildUserMaps','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error\x20parsing\x20YAML:\x20','segment:push','versionNumber','new','Fetching\x20existing\x20data...','toString','join','\x20unchanged','\x0aPush\x20summary\x20for\x20\x27','push','isNew','journeysOnly','data','\x20changes?','listFolders','76621yUsTYR','description','\x20\x20\x20\x20','getOutputSchemaWithCache','state','\x20\x20πΊοΈ\x20\x20Journeys:','\x20deleted','\x20to\x20delete','No\x20','existingJourney','deleted','updatedAt','list','length','message','verbose','targetDir','\x20folders\x20to\x20create','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','cwd','parentName','174610UEqbzM','Error:\x20Directory\x20not\x20found:\x20','/sb/da/esr','journeyId','517310JYcyTE','paused','results','audienceId','parentFolder','connection','\x27...','unchanged','segmentFolderId','\x20\x20Source:\x20','scopedFolderPath','9093717YIlQMi','Aborted.','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0aValidation\x20failed:','10nJyDyU','endsWith','filter','\x20updated','Delete\x20journey:','Changes\x20to:','72eWKRTD','yamlConfig','Folders\x20to\x20create:','segments','changed','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','cyan','\x20to\x20create','updated','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','all','yellow','blue','/app/ps/','.yml','existingSegment','resolveParentId','\x20created','error','site','get','createdAt','\x0aError:','3NTpgwU','file','type','Resolving\x20parent\x20segment\x20\x27','isScoped','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','dim','repeat','Fetching\x20existing\x20activations...','journeyBundleName','segment','folderId','π\x20','\x20\x20Activations:','idToName','relationships','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','delete','nameToId','Error:\x20','New\x20segment:','\x20to\x20update','toCreate','\x20\x20Segments:\x20','journey','add','getJourney','\x20\x20Activations:\x20','Preparing\x20journeys...','attributes','no_parent','then','2905945JqURlu','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','map','nameToType','setPhase','listActivations'];a39_0x27e5=function(){return _0x2a3cfe;};return a39_0x27e5();}(function(_0x23f866,_0x26cfc7){const _0x3c5a6a=a39_0x1732,_0x1beb4a=_0x23f866();while(!![]){try{const _0x510bf1=parseInt(_0x3c5a6a(0x1e6))/0x1+parseInt(_0x3c5a6a(0x1ff))/0x2+parseInt(_0x3c5a6a(0x188))/0x3*(parseInt(_0x3c5a6a(0x1cf))/0x4)+parseInt(_0x3c5a6a(0x1fb))/0x5*(parseInt(_0x3c5a6a(0x171))/0x6)+parseInt(_0x3c5a6a(0x1a8))/0x7+-parseInt(_0x3c5a6a(0x1d4))/0x8+-parseInt(_0x3c5a6a(0x20a))/0x9*(parseInt(_0x3c5a6a(0x20e))/0xa);if(_0x510bf1===_0x26cfc7)break;else _0x1beb4a['push'](_0x1beb4a['shift']());}catch(_0xc83d3d){_0x1beb4a['push'](_0x1beb4a['shift']());}}}(a39_0x27e5,0x33f77));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x7b193f from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a39_0x1732(_0x473cce,_0x1a6b9b){_0x473cce=_0x473cce-0x16f;const _0x27e55f=a39_0x27e5();let _0x1732a3=_0x27e55f[_0x473cce];return _0x1732a3;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a39_0x48a134(0x1d8);[a39_0x48a134(0x1e7)]=a39_0x48a134(0x1ca);async['execute'](_0x241a6f){const _0x141702=a39_0x48a134,{options:_0xc6df7a,args:_0x759b24,tdx:_0x11304b}=_0x241a6f,_0x11005c=_0xc6df7a,_0xb456fb=await resolveTarget({'arg':_0x759b24[0x0],'contextParent':_0xc6df7a[_0x141702(0x1c3)],'cwd':process[_0x141702(0x1f9)]()});if(!isSuccessfulResolution(_0xb456fb))return _0xb456fb[_0x141702(0x1be)]===_0x141702(0x1a6)?(console['error'](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x198))),console[_0x141702(0x183)]('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[_0x141702(0x183)](_0x141702(0x1d6)),console[_0x141702(0x183)]('\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[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x19b)+_0xb456fb['message']+'\x0a')),_0xb456fb['helpText']&&console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0xb456fb[_0x141702(0x1b4)]))),0x1;if(_0xb456fb[_0x141702(0x18a)]==='parent_name')return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1fc)+_0xb456fb[_0x141702(0x1f6)]+'\x0a')),console['error'](a39_0x7b193f[_0x141702(0x177)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x39eb52=_0xb456fb[_0x141702(0x1fa)],_0x4311bb=_0xb456fb['targetDir'],_0x3ec5ac=_0xb456fb[_0x141702(0x18a)]===_0x141702(0x189)?_0xb456fb['filePath']:undefined,_0x4b1998=getScopedDetails(_0xb456fb),_0x4ff7bc=_0x4b1998?.[_0x141702(0x18c)]??![],_0x1fb24e=_0x4b1998?.[_0x141702(0x209)]??'';if(!existsSync(_0x4311bb))return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1fc)+_0x4311bb+'\x0a')),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0x141702(0x1a9))),0x1;_0x11005c['verbose']&&(console[_0x141702(0x183)]('Site:\x20'+_0x11005c[_0x141702(0x184)]),console['error'](_0x141702(0x1b9)+_0x39eb52),console[_0x141702(0x183)]('Source\x20directory:\x20'+_0x4311bb),_0x4ff7bc&&console[_0x141702(0x183)]('Scoped\x20to\x20folder:\x20'+_0x1fb24e));const _0x240485=await withSpinner(_0x141702(0x18b)+_0x39eb52+_0x141702(0x205),()=>_0x11304b[_0x141702(0x192)][_0x141702(0x181)](_0x39eb52),{'verbose':_0x11005c['verbose']}),_0x3b9487=_0x240485[_0x141702(0x1e3)],{parentSegmentResult:_0xf2a669,segmentsResult:_0x3143ad,foldersResult:_0x1387f4,journeysWithDetailsResult:_0x2a3e94,userMaps:_0x296886}=await withSpinner(_0x141702(0x1db),async()=>{const _0x130afa=_0x141702,[_0xcf702e,_0x35998e,_0x2dad61,_0x1dae1c,_0x5ccf47]=await Promise['all']([_0x11304b['segment'][_0x130afa(0x1bb)](_0x3b9487),_0x11304b['segment']['listSegments'](_0x3b9487),_0x11304b[_0x130afa(0x192)][_0x130afa(0x1e5)](_0x3b9487),_0x11304b[_0x130afa(0x1a0)]['listJourneysWithDetailsFromParentSegment'](_0x3b9487,{'includeAllVersions':!![]}),_0x11304b['user'][_0x130afa(0x1d5)]()]);return{'parentSegmentResult':_0xcf702e,'segmentsResult':_0x35998e,'foldersResult':_0x2dad61,'journeysWithDetailsResult':_0x1dae1c,'userMaps':_0x5ccf47};},{'verbose':_0x11005c['verbose']})['then'](_0x14f6d8=>_0x14f6d8[_0x141702(0x1e3)]),_0x16ef15=_0xf2a669,_0x48c5a9=extractRootFolderId(_0x16ef15),_0x1846ee=_0x3143ad,_0x3abc12=_0x1387f4,{journeys:_0xb3616,activationStepsById:_0x1aafd3}=_0x2a3e94,_0x3e70c0=new Map(_0xb3616[_0x141702(0x1aa)](_0x597a25=>[_0x597a25['id'],_0x597a25])),_0x59adc3=_0xb3616[_0x141702(0x1aa)](_0x3d05b0=>({'id':_0x3d05b0['id'],'name':_0x3d05b0[_0x141702(0x1a5)]['name'],'journeyBundleName':_0x3d05b0['attributes']['journeyBundleName']||'','journeyBundleId':_0x3d05b0[_0x141702(0x1a5)]['journeyBundleId']||'','versionNumber':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1d9)],'description':_0x3d05b0[_0x141702(0x1a5)]['description'],'state':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1ea)],'paused':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x200)],'audienceId':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x202)],'folderId':_0x3d05b0[_0x141702(0x197)]?.[_0x141702(0x203)]?.['data']?.['id'],'createdAt':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x186)],'updatedAt':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1f1)]})),{emailToId:_0x399a1e,idToEmail:_0x458e57}=_0x296886,_0x1902b3=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xe9500f=_0x141702,_0x2cc224=await _0x11304b[_0xe9500f(0x204)][_0xe9500f(0x1f2)]();return buildConnectionMaps(_0x2cc224);},{'verbose':_0x11005c[_0x141702(0x1f5)]})[_0x141702(0x1a7)](_0x324a2a=>_0x324a2a[_0x141702(0x1e3)]),_0x185e97=_0x1902b3[_0x141702(0x19a)],_0x149e9d=_0x1902b3[_0x141702(0x196)],_0x65ece6=_0x1902b3[_0x141702(0x1ab)],_0x512463={'emailToIdMap':_0x399a1e,'connectionNameToIdMap':_0x185e97,'connectionNameToTypeMap':_0x65ece6,'getSchema':_0x2b7cca=>_0x11304b['connection'][_0x141702(0x1e9)](_0x2b7cca)};let {pathToId:_0x596dc7,idToPath:_0x5f42a1}=buildFolderMaps(_0x3abc12);const _0x3003fd=buildSegmentLookupMap(_0x1846ee,_0x5f42a1),_0x1b57aa=buildSegmentNameToIdMap(_0x1846ee),_0x4d7ff9=buildJourneyBundleLookupMap(_0x59adc3,_0x5f42a1);let _0x1de463;if(_0x3ec5ac){if(!_0x3ec5ac[_0x141702(0x20f)](_0x141702(0x17f))&&!_0x3ec5ac[_0x141702(0x20f)]('.yaml'))return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1d2)+_0x3ec5ac+'\x0a')),0x1;_0x1de463=[_0x3ec5ac];}else _0x1de463=findYamlFiles(_0x4311bb);if(_0x1de463[_0x141702(0x1f3)]===0x0)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x20c)+_0x4311bb+'\x0a')),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0x141702(0x1c0))),0x1;let _0x330228,_0x2ce2ef;try{const _0x15fd64=parseAndClassifyYamlFiles(_0x1de463,_0x4311bb,{'skipSegments':_0x11005c[_0x141702(0x1e2)]});_0x330228=_0x15fd64[_0x141702(0x174)],_0x2ce2ef=_0x15fd64[_0x141702(0x1b2)];const _0xa3f971=validateParsedFiles(_0x15fd64,_0x4311bb);if(_0xa3f971[_0x141702(0x1f3)]>0x0)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x20d))),console[_0x141702(0x183)](formatValidationErrors(_0xa3f971)),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x176))),0x1;}catch(_0x27acef){return console['error'](a39_0x7b193f['red'](_0x141702(0x1d7)+(_0x27acef instanceof Error?_0x27acef[_0x141702(0x1f4)]:_0x27acef))),0x1;}if(_0x330228[_0x141702(0x1f3)]===0x0&&_0x2ce2ef[_0x141702(0x1f3)]===0x0){const _0x574d6a=_0x11005c[_0x141702(0x1e2)]?'journey':_0x141702(0x1bc);return console[_0x141702(0x183)](a39_0x7b193f['yellow'](_0x141702(0x1ee)+_0x574d6a+'\x20YAML\x20files\x20found')),0x0;}const _0x3ae103=new Map();_0x1846ee[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)]&&await withSpinner(_0x141702(0x190),async()=>{await batchAsync(_0x1846ee,async _0x2e8f3e=>{const _0x3697bc=a39_0x1732,_0x7572f3=await _0x11304b[_0x3697bc(0x192)][_0x3697bc(0x1ad)](_0x3b9487,_0x2e8f3e['id']);_0x3ae103[_0x3697bc(0x1b1)](_0x2e8f3e['id'],_0x7572f3);});},{'verbose':_0x11005c[_0x141702(0x1f5)]});const {segmentFiles:_0xec3b07,foldersToCreate:_0x56de1f}=await prepareSegmentFiles(_0x330228,{'segmentByFolderAndName':_0x3003fd,'activationsBySegmentId':_0x3ae103,'folderPathToId':_0x596dc7,'idToEmailMap':_0x458e57,'connectionIdToNameMap':_0x149e9d},_0x512463,_0x4ff7bc,_0x1fb24e),_0x3e0fab=_0x3ec5ac?[]:findSegmentsToDelete(_0x1846ee,_0x330228[_0x141702(0x1aa)](({yamlConfig:_0x15afaf,folderPath:_0x17d2e0})=>({'yamlConfig':_0x15afaf,'folderPath':resolveTDFolderPath(_0x17d2e0,_0x4ff7bc,_0x1fb24e)})),_0x5f42a1,_0x1fb24e,_0x4ff7bc),{journeyFiles:_0x51cb98,foldersToCreate:_0x1fd2d9}=await withProgressSpinner(_0x141702(0x1a4),async _0x22db05=>prepareJourneyFiles(_0x2ce2ef,{'fetchJourney':async _0x30e9a4=>_0x11304b[_0x141702(0x1a0)][_0x141702(0x1a2)](_0x30e9a4[_0x141702(0x1fe)]),'journeyBundlesByFolderAndName':_0x4d7ff9,'folderPathToId':_0x596dc7,'idToEmailMap':_0x458e57,'connectionIdToNameMap':_0x149e9d,'existingSegments':_0x1846ee,'parentId':_0x3b9487,'deps':_0x11304b,'progress':{'update':_0x260c03=>{const _0x10d972=_0x141702;_0x22db05[_0x10d972(0x1ac)](_0x260c03),_0x11005c[_0x10d972(0x1f5)]&&console[_0x10d972(0x183)]('\x20\x20'+_0x260c03);}},'journeyById':_0x3e70c0,'activationStepsById':_0x1aafd3},_0x4ff7bc,_0x1fb24e),{'verbose':_0x11005c[_0x141702(0x1f5)]})[_0x141702(0x1a7)](_0x56fb55=>_0x56fb55[_0x141702(0x1e3)]);for(const _0x532cab of _0x1fd2d9){_0x56de1f[_0x141702(0x1a1)](_0x532cab);}const _0x2657d7=_0x3ec5ac?[]:findJourneysToDelete(_0x59adc3,_0x2ce2ef[_0x141702(0x1aa)](({yamlConfig:_0x5c572a,folderPath:_0x52120d})=>({'yamlConfig':_0x5c572a,'folderPath':resolveTDFolderPath(_0x52120d,_0x4ff7bc,_0x1fb24e)})),_0x5f42a1,_0x1fb24e,_0x4ff7bc),_0x2ddf0f=calculatePushStats(_0xec3b07,_0x51cb98,_0x56de1f,_0x3e0fab,_0x2657d7,!!_0x11005c[_0x141702(0x199)],!!_0x11005c[_0x141702(0x1e2)]),_0xbd9d0f=_0x2ddf0f[_0x141702(0x174)][_0x141702(0x1da)],_0xdbfaca=_0x2ddf0f[_0x141702(0x174)][_0x141702(0x175)],_0x5c2fd0=_0x2ddf0f['segments'][_0x141702(0x206)],_0x499938=_0x2ddf0f['segments'][_0x141702(0x1c7)],_0x3dc342=_0x2ddf0f[_0x141702(0x1d3)][_0x141702(0x19e)],_0x41d506=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x1da)],_0x4938bf=_0x2ddf0f['journeys'][_0x141702(0x175)],_0x105240=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x206)],_0x411aa7=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x1c7)],_0x1249eb=_0x2ddf0f[_0x141702(0x1bd)][_0x141702(0x17b)],_0x4986ec=_0x2ddf0f[_0x141702(0x1bd)]['toCreate'],_0x464e8b=_0x2ddf0f[_0x141702(0x1bd)]['toUpdate'],_0xa124d9=_0x2ddf0f[_0x141702(0x1bd)][_0x141702(0x1c7)];console['error'](_0x141702(0x1df)+_0x39eb52+'\x27:');_0x3dc342[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f[_0x141702(0x17d)](_0x141702(0x194)+_0x3dc342['length']+_0x141702(0x1f7)));if(!_0x11005c[_0x141702(0x1e2)]){console[_0x141702(0x183)](_0x141702(0x1b5)),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x1ba)]('+\x20'+_0xbd9d0f[_0x141702(0x1f3)]+_0x141702(0x1bf))),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x17c)]('~\x20'+_0xdbfaca[_0x141702(0x1f3)]+'\x20changed'));if(_0x499938[_0x141702(0x1f3)]>0x0)console['error']('\x20\x20\x20\x20'+a39_0x7b193f['red']('-\x20'+_0x499938[_0x141702(0x1f3)]+'\x20to\x20delete'));else _0x3e0fab[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x199)]&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x18e)](_0x3e0fab[_0x141702(0x1f3)]+_0x141702(0x1cb)));console[_0x141702(0x183)]('\x20\x20\x20\x20'+a39_0x7b193f[_0x141702(0x18e)]('=\x20'+_0x5c2fd0[_0x141702(0x1f3)]+'\x20unchanged'));}if(_0x51cb98[_0x141702(0x1f3)]>0x0||_0x2657d7['length']>0x0){console[_0x141702(0x183)](_0x141702(0x1eb)),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f['green']('+\x20'+_0x41d506[_0x141702(0x1f3)]+_0x141702(0x1bf))),console['error'](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x17c)]('~\x20'+_0x4938bf['length']+_0x141702(0x1af)));if(_0x411aa7[_0x141702(0x1f3)]>0x0)console[_0x141702(0x183)]('\x20\x20\x20\x20'+a39_0x7b193f['red']('-\x20'+_0x411aa7['length']+_0x141702(0x1ed)));else _0x2657d7[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x199)]&&console['error']('\x20\x20\x20\x20'+a39_0x7b193f[_0x141702(0x18e)](_0x2657d7[_0x141702(0x1f3)]+_0x141702(0x1cb)));console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x18e)]('=\x20'+_0x105240[_0x141702(0x1f3)]+_0x141702(0x1de)));}_0x1249eb[_0x141702(0x1f3)]>0x0&&!_0x11005c['journeysOnly']&&(console['error'](''),console['error'](_0x141702(0x195)),_0x4986ec[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f['green']('+\x20'+_0x4986ec[_0x141702(0x1f3)]+_0x141702(0x178))),_0x464e8b[_0x141702(0x1f3)]>0x0&&console['error'](_0x141702(0x1e8)+a39_0x7b193f['yellow']('~\x20'+_0x464e8b[_0x141702(0x1f3)]+_0x141702(0x19d))),_0xa124d9['length']>0x0&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x1d0)]('-\x20'+_0xa124d9[_0x141702(0x1f3)]+_0x141702(0x1ed))));console[_0x141702(0x183)](_0x141702(0x208)+a39_0x7b193f[_0x141702(0x177)](_0x4311bb)+'\x0a');if(_0x3dc342[_0x141702(0x1f3)]>0x0){console[_0x141702(0x183)](_0x141702(0x173));for(const _0x2cb54d of _0x3dc342){console['error']('\x20\x20'+a39_0x7b193f[_0x141702(0x17d)]('+')+'\x20'+_0x2cb54d);}console['error']('');}if(_0xbd9d0f[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0x265c9f of _0xbd9d0f){const _0x34239b=_0x265c9f[_0x141702(0x1ae)]?_0x265c9f[_0x141702(0x1ae)]+'/'+_0x265c9f[_0x141702(0x172)][_0x141702(0x1c6)]:_0x265c9f[_0x141702(0x172)][_0x141702(0x1c6)],_0x422f56=_0x265c9f[_0x141702(0x172)][_0x141702(0x1bd)]?.[_0x141702(0x1f3)]||0x0,_0xcd3dcc=_0x422f56>0x0?a39_0x7b193f[_0x141702(0x18e)]('\x20['+_0x422f56+'\x20activations]'):'';console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1ba)](_0x141702(0x19c))+'\x20'+_0x34239b+_0xcd3dcc),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c)),_0x265c9f[_0x141702(0x1b8)]&&console['error'](_0x265c9f[_0x141702(0x1b8)]),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c));}if(_0x499938[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0x4f2767 of _0x499938){const _0x161b29=_0x4f2767['segmentFolderId']?_0x5f42a1[_0x141702(0x185)](_0x4f2767[_0x141702(0x207)][_0x141702(0x1dc)]())||'':'',_0x57bc3c=_0x161b29?_0x161b29+'/'+_0x4f2767[_0x141702(0x1c6)]:_0x4f2767[_0x141702(0x1c6)],_0x1b9a04=_0x3ae103['get'](_0x4f2767['id'])||[],_0x2a856f=_0x1b9a04[_0x141702(0x1f3)]>0x0?a39_0x7b193f[_0x141702(0x18e)]('\x20['+_0x1b9a04[_0x141702(0x1f3)]+_0x141702(0x1c4)):'';console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1b6))+'\x20'+_0x57bc3c+_0x2a856f),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c));const _0x51831e=segmentWithActivationsToYaml(_0x4f2767,_0x1b9a04,undefined,_0x458e57,_0x149e9d),_0x2ffcdd=segmentToYamlString(_0x51831e),_0x47f444=generateDiff(_0x2ffcdd,'');console[_0x141702(0x183)](formatDiffWithColors(_0x47f444)),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c));}const _0x3131b6=_0xec3b07[_0x141702(0x210)](_0x34efd0=>!_0x34efd0['isNew']&&_0x34efd0[_0x141702(0x1b8)]);if(_0x3131b6[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0xacbfa8 of _0x3131b6){const _0x10aa6c=_0xacbfa8['folderPath']?_0xacbfa8[_0x141702(0x1ae)]+'/'+_0xacbfa8[_0x141702(0x172)]['name']:_0xacbfa8[_0x141702(0x172)][_0x141702(0x1c6)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x170))+'\x20'+_0x10aa6c),console[_0x141702(0x183)]('β'['repeat'](0x3c)),console[_0x141702(0x183)](_0xacbfa8[_0x141702(0x1b8)]),console['error']('β'[_0x141702(0x18f)](0x3c));}if(_0x41d506[_0x141702(0x1f3)]>0x0)for(const _0x503dc6 of _0x41d506){const _0x55de19=_0x503dc6[_0x141702(0x1ae)]?_0x503dc6[_0x141702(0x1ae)]+'/'+_0x503dc6['yamlConfig'][_0x141702(0x1c6)]:_0x503dc6[_0x141702(0x172)]['name'];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1ba)](_0x141702(0x1b7))+'\x20'+_0x55de19),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c)),_0x503dc6['diff']&&console[_0x141702(0x183)](_0x503dc6['diff']),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c));}const _0x2c6ae4=_0x51cb98[_0x141702(0x210)](_0x29b21f=>!_0x29b21f[_0x141702(0x1e1)]&&_0x29b21f[_0x141702(0x1b8)]);if(_0x2c6ae4[_0x141702(0x1f3)]>0x0)for(const _0x5973ea of _0x2c6ae4){const _0xe0de39=_0x5973ea['folderPath']?_0x5973ea[_0x141702(0x1ae)]+'/'+_0x5973ea['yamlConfig'][_0x141702(0x1c6)]:_0x5973ea['yamlConfig'][_0x141702(0x1c6)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x1cd))+'\x20'+_0xe0de39),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c)),console[_0x141702(0x183)](_0x5973ea[_0x141702(0x1b8)]),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c));}if(_0x411aa7[_0x141702(0x1f3)]>0x0)for(const _0x3b6951 of _0x411aa7){const _0x566a27=_0x3b6951[_0x141702(0x193)]?_0x5f42a1[_0x141702(0x185)](_0x3b6951[_0x141702(0x193)])||'':'',_0x19ef98=_0x566a27?_0x566a27+'/'+_0x3b6951[_0x141702(0x191)]:_0x3b6951[_0x141702(0x191)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x16f))+'\x20'+_0x19ef98),console[_0x141702(0x183)]('β'['repeat'](0x3c)),console[_0x141702(0x183)](a39_0x7b193f['red'](_0x141702(0x1c2))),console[_0x141702(0x183)]('β'[_0x141702(0x18f)](0x3c));}if(_0x11005c[_0x141702(0x1c5)])return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x560691=_0x11005c[_0x141702(0x1e2)]?![]:_0xbd9d0f[_0x141702(0x1f3)]>0x0||_0xdbfaca[_0x141702(0x1f3)]>0x0||_0x499938['length']>0x0,_0x28527a=_0x41d506[_0x141702(0x1f3)]>0x0||_0x4938bf[_0x141702(0x1f3)]>0x0||_0x411aa7[_0x141702(0x1f3)]>0x0,_0x4129b9=_0x11005c[_0x141702(0x1e2)]?![]:_0x1249eb[_0x141702(0x1f3)]>0x0,_0x476b06=_0x3dc342[_0x141702(0x1f3)]>0x0;if(!_0x560691&&!_0x28527a&&!_0x4129b9&&!_0x476b06){const _0x3aa040=_0x11005c[_0x141702(0x1e2)]?_0x141702(0x1cc):_0x141702(0x1f8);console['error'](a39_0x7b193f[_0x141702(0x1ba)](_0x3aa040));if(_0x3ec5ac&&_0x5c2fd0[_0x141702(0x1f3)]===0x1){const _0x28943a=_0x5c2fd0[0x0];if(_0x28943a['existingSegment']?.['id']){const _0x2e3dd4=getConsoleNextUrl(_0x11005c[_0x141702(0x184)],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x28943a[_0x141702(0x180)]['id']+_0x141702(0x1fd));console[_0x141702(0x183)](_0x141702(0x17a)+a39_0x7b193f['cyan'](_0x2e3dd4));}}if(_0x3ec5ac&&_0x105240[_0x141702(0x1f3)]===0x1){const _0x5b94a4=_0x105240[0x0];if(_0x5b94a4['existingJourney']?.['id']){const _0x52f537=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x5b94a4[_0x141702(0x1ef)]['id']+_0x141702(0x1c1));console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f['cyan'](_0x52f537));}}return 0x0;}const _0x4470e9=_0x11005c['journeysOnly']?_0x41d506[_0x141702(0x1f3)]+_0x4938bf[_0x141702(0x1f3)]+_0x411aa7[_0x141702(0x1f3)]+_0x3dc342[_0x141702(0x1f3)]:_0xbd9d0f[_0x141702(0x1f3)]+_0xdbfaca['length']+_0x499938[_0x141702(0x1f3)]+_0x41d506[_0x141702(0x1f3)]+_0x4938bf[_0x141702(0x1f3)]+_0x411aa7['length']+_0x3dc342[_0x141702(0x1f3)]+_0x1249eb['length'];if(!_0x11005c[_0x141702(0x1c9)]&&_0x4470e9>0x0){if(!isInteractive())return console[_0x141702(0x183)](a39_0x7b193f['red'](_0x141702(0x187)),_0x141702(0x1b3)),console[_0x141702(0x183)](a39_0x7b193f['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x248a27=await confirmKey('Push\x20'+_0x4470e9+_0x141702(0x1e4));if(!_0x248a27)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x20b))),0x1;}const _0x5d3544={'withProgress':async(_0x42c275,_0x377482)=>{const _0x1104e=await withSpinner(_0x42c275,_0x377482,{'verbose':_0x11005c['verbose']});return{'data':_0x1104e['data']};},'logInfo':_0x5dbfc6=>console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17d)]('β\x20'+_0x5dbfc6)),'logSuccess':_0x43e305=>console[_0x141702(0x183)](a39_0x7b193f['green']('β\x20'+_0x43e305)),'logWarning':_0x3cede9=>console[_0x141702(0x183)](a39_0x7b193f['yellow']('β \x20'+_0x3cede9)),'logDeleted':_0x117573=>console['error'](a39_0x7b193f[_0x141702(0x1d0)]('β\x20'+_0x117573))},_0x590bf3={'segment':_0x11304b[_0x141702(0x192)],'journey':_0x11304b[_0x141702(0x1a0)],'user':_0x11304b[_0x141702(0x1c8)],'connection':_0x11304b[_0x141702(0x204)]};_0x3dc342['length']>0x0&&(_0x596dc7=await executePushFolders(_0x590bf3,_0x3dc342,_0x596dc7,{'parentId':_0x3b9487},_0x5d3544));const _0x47fd68={'rootFolderId':_0x48c5a9,'folderPathToId':_0x596dc7,'folderIdToPath':_0x5f42a1,'segmentNameToId':_0x1b57aa,'activationsBySegmentId':_0x3ae103,'emailToIdMap':_0x399a1e,'idToEmailMap':_0x458e57,'connectionNameToIdMap':_0x1902b3[_0x141702(0x19a)],'connectionIdToNameMap':_0x1902b3['idToName'],'connectionNameToTypeMap':_0x65ece6},_0x5ee5a1=await executePushSegments(_0x590bf3,_0x11005c[_0x141702(0x1e2)]?[]:_0xec3b07,_0x47fd68,{'parentId':_0x3b9487},_0x5d3544),_0x46144d=_0x5ee5a1['created'],_0x58ce0c=_0x5ee5a1[_0x141702(0x179)],_0x5ef0e7=_0x5ee5a1[_0x141702(0x1bd)][_0x141702(0x1d1)],_0x4d8322=_0x5ee5a1['activations'][_0x141702(0x179)],_0x2596b8=_0x5ee5a1['activations'][_0x141702(0x1f0)];let _0x160875;if(_0x3ec5ac&&_0xec3b07[_0x141702(0x1f3)]===0x1){const _0x33ec64=_0xec3b07[0x0];_0x160875=_0x33ec64['existingSegment']?.['id']??_0x5ee5a1['createdSegmentIds'][_0x141702(0x185)](_0x33ec64[_0x141702(0x172)][_0x141702(0x1c6)]);}const _0x2b90cb=await executePushSegmentDeletions(_0x590bf3,_0x11005c['journeysOnly']?[]:_0x499938,_0x5d3544);let _0x1f378a=0x0,_0x20d867=0x0,_0x1f493f=0x0;const _0x516056=new Map(_0x1b57aa);for(const [_0x29d084,_0x4fa14d]of _0x5ee5a1['createdSegmentIds']){_0x516056['set'](_0x29d084,_0x4fa14d);}if(_0x51cb98['length']>0x0){const _0x1951f4={..._0x47fd68,'segmentNameToId':_0x516056,'existingSegments':_0x1846ee,'activationContext':_0x512463},_0x150aa6=await executePushJourneys(_0x590bf3,_0x51cb98,_0x1951f4,{'parentId':_0x3b9487,'rootFolderId':_0x48c5a9,'verbose':_0x11005c[_0x141702(0x1f5)]},_0x5d3544);_0x1f378a=_0x150aa6[_0x141702(0x1d1)],_0x20d867=_0x150aa6[_0x141702(0x179)];if(_0x3ec5ac&&_0x150aa6[_0x141702(0x201)][_0x141702(0x1f3)]===0x1){const _0x106206=_0x150aa6[_0x141702(0x201)][0x0];if(_0x106206['journeyId']){const _0x2f46be=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x106206[_0x141702(0x1fe)]+_0x141702(0x1c1));console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f[_0x141702(0x177)](_0x2f46be));}}}for(const _0x2dfe6e of _0x411aa7){console['error'](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x18d)+_0x2dfe6e[_0x141702(0x191)])),_0x1f493f++;}const _0xc31c2=[];if(_0x46144d>0x0)_0xc31c2['push'](_0x46144d+_0x141702(0x182));if(_0x58ce0c>0x0)_0xc31c2['push'](_0x58ce0c+_0x141702(0x211));if(_0x2b90cb>0x0)_0xc31c2['push'](_0x2b90cb+_0x141702(0x1ec));const _0x2905da=[];if(_0x1f378a>0x0)_0x2905da[_0x141702(0x1e0)](_0x1f378a+_0x141702(0x182));if(_0x20d867>0x0)_0x2905da[_0x141702(0x1e0)](_0x20d867+'\x20updated');if(_0x1f493f>0x0)_0x2905da[_0x141702(0x1e0)](_0x1f493f+'\x20deleted');const _0x1a721a=[];if(_0x5ef0e7>0x0)_0x1a721a['push'](_0x5ef0e7+'\x20created');if(_0x4d8322>0x0)_0x1a721a[_0x141702(0x1e0)](_0x4d8322+'\x20updated');if(_0x2596b8>0x0)_0x1a721a[_0x141702(0x1e0)](_0x2596b8+_0x141702(0x1ec));console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1ba)]('\x0aβ\x20Push\x20complete'));_0xc31c2[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)]&&console[_0x141702(0x183)](_0x141702(0x19f)+_0xc31c2[_0x141702(0x1dd)](',\x20'));_0x2905da[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)](_0x141702(0x1b0)+_0x2905da[_0x141702(0x1dd)](',\x20'));_0x1a721a[_0x141702(0x1f3)]>0x0&&!_0x11005c['journeysOnly']&&console[_0x141702(0x183)](_0x141702(0x1a3)+_0x1a721a[_0x141702(0x1dd)](',\x20'));if(_0x160875){const _0x568e0f=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x160875+_0x141702(0x1fd));console[_0x141702(0x183)](_0x141702(0x17a)+a39_0x7b193f['cyan'](_0x568e0f));}return 0x0;}}
|