@treasuredata/tdx 2026.3.0 β 2026.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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.d.ts +4 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.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/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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x215171=a33_0xbdec;(function(_0x11c5d8,_0x59ec2f){const _0x4cc391=a33_0xbdec,_0x118901=_0x11c5d8();while(!![]){try{const _0x5249bd=parseInt(_0x4cc391(0x1f2))/0x1+parseInt(_0x4cc391(0x1cc))/0x2+parseInt(_0x4cc391(0x1de))/0x3*(parseInt(_0x4cc391(0x1ef))/0x4)+-parseInt(_0x4cc391(0x1be))/0x5*(parseInt(_0x4cc391(0x1f5))/0x6)+-parseInt(_0x4cc391(0x18b))/0x7+parseInt(_0x4cc391(0x1e6))/0x8*(-parseInt(_0x4cc391(0x1d9))/0x9)+parseInt(_0x4cc391(0x19d))/0xa;if(_0x5249bd===_0x59ec2f)break;else _0x118901['push'](_0x118901['shift']());}catch(_0x24c733){_0x118901['push'](_0x118901['shift']());}}}(a33_0x1766,0x7ebbe));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';function a33_0x1766(){const _0x4e1d4d=['create','trim','Updating\x20schedule...','Failed\x20to\x20read\x20file:\x20','list','listQueries','2017012xMuuxy','time_zone','ies','start_at','max','file','has_next_page','schedule:list','padEnd','options','data','substring','\x20\x20Database:\x20','2529603SIGnMH','map','priority','...','schedules','3nEHIbF','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','error','updated_at','\x20(use\x20--limit\x20to\x20see\x20more)','\x20\x20Timezone:\x20','ended_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','16xInxrf','schedule:history','\x20execution','user_name','Create\x20a\x20scheduled\x20query','format','toLocaleDateString','queryUrl','schedule:run','3399664nHKLkp','description','Schedule\x20deleted:\x20','15651bemwVQ','json','utf-8','2355324QKejPO','statusIcon','jsonl','\x20schedules','query','timezone','schedule:update','show','trino','Updating\x20schedule:\x20','next_run_at','validate','engine_version','schedule:create','success','\x20\x20Num:\x20','cyan','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','executing_user_id','Getting\x20schedule\x20history...','cron','Deleting\x20schedule...','\x20\x20Job\x20ID:\x20','execute','scheduled_at','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','length','verbose','Found\x20','just\x20now','green','table','π
\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Listing\x20scheduled\x20queries...','Schedule\x20run\x20submitted:\x20','Run\x20a\x20scheduled\x20query\x20immediately','\x20created','created_at','6153763sTMvSR','name','user','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','soon','queries','result','INVALID_ARGUMENT','d\x20ago','h\x20ago','Show\x20schedule\x20details','retry_limit','nextRun','lastRun','last_job','never','end_at','8713800eKyxWx','delay','\x20scheduled\x20quer','retryLimit','in\x20','round','Query\x20file\x20is\x20empty','args','List\x20scheduled\x20queries','keys','\x20(showing\x20','getTime','engineVersion','\x20job','num','schedule:show','job_id','entries','history','schedule:delete','Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','\x20\x20Type:\x20','pagination','jobs','type','Creating\x20schedule...','Showing\x20first\x20','\x20\x20Time:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','tsv','site','status','10LtZXGH','Schedule\x20created:\x20','output','update','from','count','database','m\x20ago'];a33_0x1766=function(){return _0x4e1d4d;};return a33_0x1766();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a33_0x47186f from'chalk';function formatRelativeTime(_0x8d39f5){const _0x1ce9d9=a33_0xbdec,_0xffc8f4=new Date(_0x8d39f5),_0x41da9e=new Date(),_0xeace95=_0xffc8f4[_0x1ce9d9(0x1a8)]()-_0x41da9e['getTime'](),_0x4389bf=Math['abs'](_0xeace95)/0x3e8,_0x41e519=_0xeace95<0x0;if(_0x4389bf<0x3c)return _0x41e519?_0x1ce9d9(0x181):_0x1ce9d9(0x190);else{if(_0x4389bf<0xe10){const _0x388165=Math[_0x1ce9d9(0x1a2)](_0x4389bf/0x3c);return _0x41e519?_0x388165+_0x1ce9d9(0x1c5):'in\x20'+_0x388165+'m';}else{if(_0x4389bf<0x15180){const _0x4abfdc=Math[_0x1ce9d9(0x1a2)](_0x4389bf/0xe10);return _0x41e519?_0x4abfdc+_0x1ce9d9(0x195):_0x1ce9d9(0x1a1)+_0x4abfdc+'h';}else{if(_0x4389bf<0x93a80){const _0x18bcc0=Math[_0x1ce9d9(0x1a2)](_0x4389bf/0x15180);return _0x41e519?_0x18bcc0+_0x1ce9d9(0x194):_0x1ce9d9(0x1a1)+_0x18bcc0+'d';}else return _0xffc8f4[_0x1ce9d9(0x1ec)]();}}}}export class ScheduleListCommand extends BaseCommand{[a33_0x215171(0x18c)]=a33_0x215171(0x1d3);[a33_0x215171(0x1f0)]=a33_0x215171(0x1a5);async['execute'](_0x411655){const _0x530a13=a33_0x215171,{options:_0x4e5122,args:_0x4036ab,tdx:_0x3a5aa5}=_0x411655,_0x2e88f1=resolveLimit(_0x4e5122['limit'],DEFAULT_DISPLAY_LIMIT),_0x359de1=_0x4036ab[0x0],_0x5b35e3=_0x359de1?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x359de1+'\x22...':_0x530a13(0x186),_0x51ebff=await withSpinner(_0x5b35e3,()=>_0x3a5aa5[_0x530a13(0x1dd)][_0x530a13(0x1cb)]({'limit':_0x2e88f1,'scheduled':!![],'pattern':_0x359de1}),{'verbose':_0x4e5122[_0x530a13(0x17f)]}),_0x2382eb=_0x51ebff[_0x530a13(0x1d6)][_0x530a13(0x191)],_0x351304=_0x51ebff[_0x530a13(0x1d6)][_0x530a13(0x1b4)][_0x530a13(0x1d2)],_0x505025=_0x359de1?'\x20matching\x20\x22'+_0x359de1+'\x22':'';_0x351304?console[_0x530a13(0x1e0)](_0x530a13(0x1b8)+_0x2382eb[_0x530a13(0x17e)]+_0x530a13(0x1f8)+_0x505025+_0x530a13(0x1e2)):console[_0x530a13(0x1e0)](_0x530a13(0x180)+_0x2382eb[_0x530a13(0x17e)]+_0x530a13(0x19f)+(_0x2382eb['length']!==0x1?_0x530a13(0x1ce):'y')+_0x505025);if(_0x4e5122[_0x530a13(0x1eb)]===_0x530a13(0x1f3)||_0x4e5122[_0x530a13(0x1eb)]===_0x530a13(0x1f7)||_0x4e5122[_0x530a13(0x1eb)]===_0x530a13(0x183)||_0x4e5122[_0x530a13(0x1eb)]===_0x530a13(0x1bb)){const _0xebc93c=_0x2382eb[_0x530a13(0x1da)](_0x1df395=>({'id':_0x1df395['id'],'name':_0x1df395[_0x530a13(0x18c)],'cron':_0x1df395['cron'],'database':_0x1df395['database']?.[_0x530a13(0x18c)],'type':_0x1df395['type'],'timezone':_0x1df395[_0x530a13(0x1cd)],'user_name':_0x1df395[_0x530a13(0x18d)]?.[_0x530a13(0x18c)],'updated_at':_0x1df395[_0x530a13(0x1e1)],'next_run_at':_0x1df395['next_run_at'],'last_job_status':_0x1df395[_0x530a13(0x19a)]?.[_0x530a13(0x1bd)]}));await handleSDKOutput(_0xebc93c,_0x4e5122);}else{if(_0x2382eb[_0x530a13(0x17e)]===0x0)console['log']('No\x20scheduled\x20queries\x20found');else{const _0x13ae8d=_0x4e5122[_0x530a13(0x1bc)],_0x127e84=_0x2382eb['map'](_0x446060=>{const _0x13e125=_0x530a13,_0x3b2ce3=_0x446060['last_job']?.[_0x13e125(0x1bd)]?_0x446060['last_job'][_0x13e125(0x1bd)]===_0x13e125(0x203)?'β':'β':'-',_0x444555=_0x446060[_0x13e125(0x19a)]?.[_0x13e125(0x1e4)]?formatRelativeTime(_0x446060[_0x13e125(0x19a)][_0x13e125(0x1e4)]):_0x13e125(0x19b),_0x396f1e=_0x446060['next_run_at']?formatRelativeTime(_0x446060[_0x13e125(0x1ff)]):'-',_0x5214c3=_0x446060[_0x13e125(0x178)]||'',_0x175762=_0x446060['name']||'(unnamed)',_0xbc4eea=getConsoleUrl(_0x13ae8d,'/app/queries/editor?queryId='+_0x446060['id']);return{'statusIcon':_0x3b2ce3,'lastRun':_0x444555,'nextRun':_0x396f1e,'cron':_0x5214c3,'name':_0x175762,'queryUrl':_0xbc4eea,'status':_0x446060['last_job']?.['status']};}),_0x34d369=Math[_0x530a13(0x1d0)](..._0x127e84['map'](_0x6ce5cb=>_0x6ce5cb[_0x530a13(0x199)][_0x530a13(0x17e)])),_0x283cc1=Math[_0x530a13(0x1d0)](..._0x127e84[_0x530a13(0x1da)](_0x24420c=>_0x24420c[_0x530a13(0x198)][_0x530a13(0x17e)])),_0x4c2bcd=Math['max'](..._0x127e84['map'](_0x19da9e=>_0x19da9e[_0x530a13(0x178)][_0x530a13(0x17e)])),_0x5b6add=_0x127e84[_0x530a13(0x1da)](_0x58667a=>{const _0x1f225b=_0x530a13,_0x191a07=_0x58667a['status']===_0x1f225b(0x203)?a33_0x47186f[_0x1f225b(0x182)](_0x58667a['statusIcon']):_0x58667a[_0x1f225b(0x1bd)]===_0x1f225b(0x1e0)?a33_0x47186f['red'](_0x58667a[_0x1f225b(0x1f6)]):a33_0x47186f['dim'](_0x58667a[_0x1f225b(0x1f6)]),_0x203f4e=_0x58667a[_0x1f225b(0x199)][_0x1f225b(0x1d4)](_0x34d369),_0x361cd0=_0x58667a[_0x1f225b(0x198)][_0x1f225b(0x1d4)](_0x283cc1),_0x123260=_0x58667a[_0x1f225b(0x178)]?a33_0x47186f[_0x1f225b(0x174)](_0x58667a[_0x1f225b(0x178)]['padEnd'](_0x4c2bcd)):'\x20'['repeat'](_0x4c2bcd),_0x30e4b2=hyperlink(_0x58667a[_0x1f225b(0x18c)],_0x58667a[_0x1f225b(0x1ed)]);return _0x1f225b(0x184)+_0x191a07+'\x20'+_0x203f4e+'\x20\x20β\x20'+_0x361cd0+'\x20\x20'+_0x123260+'\x20\x20'+_0x30e4b2;});await writeOutput(_0x5b6add['join']('\x0a'),_0x4e5122[_0x530a13(0x1c0)],_0x530a13(0x1ca));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a33_0x215171(0x18c)]=a33_0x215171(0x1ac);[a33_0x215171(0x1f0)]=a33_0x215171(0x196);[a33_0x215171(0x200)](_0x95c106){const _0x3c4b29=a33_0x215171,_0x3102e0=_0x95c106[_0x3c4b29(0x1a4)][0x0];if(!_0x3102e0)return _0x3c4b29(0x1df);return undefined;}async[a33_0x215171(0x17b)](_0x4166a4){const _0x34e1a4=a33_0x215171,{options:_0x345b8c,args:_0x4c47b0,tdx:_0x65eea7}=_0x4166a4,_0x564a8b=_0x4c47b0[0x0],_0x3aaa0f=await withSpinner('Getting\x20schedule\x20details...',()=>_0x65eea7['schedules'][_0x34e1a4(0x1fc)](_0x564a8b),{'verbose':_0x345b8c[_0x34e1a4(0x17f)]}),_0x4e6e7a=_0x3aaa0f['data'],_0x155677={'name':_0x4e6e7a[_0x34e1a4(0x18c)],'cron':_0x4e6e7a[_0x34e1a4(0x178)],'database':_0x4e6e7a['database'],'type':_0x4e6e7a[_0x34e1a4(0x1b6)],'timezone':_0x4e6e7a['timezone'],'user_name':_0x4e6e7a[_0x34e1a4(0x1e9)],'created_at':_0x4e6e7a[_0x34e1a4(0x18a)],'engine_version':_0x4e6e7a[_0x34e1a4(0x201)],'executing_user_id':_0x4e6e7a[_0x34e1a4(0x176)],'query':_0x4e6e7a[_0x34e1a4(0x1f9)],'delay':_0x4e6e7a['delay'],'priority':_0x4e6e7a[_0x34e1a4(0x1db)],'retry_limit':_0x4e6e7a[_0x34e1a4(0x197)],..._0x4e6e7a[_0x34e1a4(0x192)]&&{'result':_0x4e6e7a[_0x34e1a4(0x192)]}};return await handleSingleObjectOutput(_0x155677,_0x345b8c),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a33_0x215171(0x18c)]=a33_0x215171(0x202);[a33_0x215171(0x1f0)]=a33_0x215171(0x1ea);[a33_0x215171(0x200)](_0x5aa356){const _0x1dba92=a33_0x215171,_0x37e06c=_0x5aa356[_0x1dba92(0x1a4)][0x0];if(!_0x37e06c)return _0x1dba92(0x18f);const _0x26c4e7=_0x5aa356[_0x1dba92(0x1d5)];if(!_0x26c4e7[_0x1dba92(0x1c4)])return _0x1dba92(0x175);return undefined;}async[a33_0x215171(0x17b)](_0x21cf34){const _0x2b376a=a33_0x215171,{options:_0x290c9d,args:_0x3749cf,tdx:_0x5c99c7}=_0x21cf34,_0x2b4cae=_0x3749cf[0x0],_0x1f0835=_0x290c9d,_0x10a762=_0x1f0835['database'],_0xc30101=_0x1f0835['file'],_0x3c9e90=_0x1f0835[_0x2b376a(0x1b6)]||_0x2b376a(0x1fd);let _0x2f1ece;try{_0x2f1ece=readFileSync(_0xc30101,_0x2b376a(0x1f4))['trim']();}catch(_0x631562){throw new SDKError(ErrorCode[_0x2b376a(0x193)],'Failed\x20to\x20read\x20file:\x20'+_0xc30101,_0x631562 instanceof Error?_0x631562:undefined);}if(!_0x2f1ece)throw new SDKError(ErrorCode[_0x2b376a(0x193)],_0x2b376a(0x1a3));const _0x201d73={'database':_0x10a762,'query':_0x2f1ece,'type':_0x3c9e90};if(_0x1f0835[_0x2b376a(0x178)])_0x201d73['cron']=_0x1f0835[_0x2b376a(0x178)];if(_0x1f0835['timezone'])_0x201d73[_0x2b376a(0x1fa)]=_0x1f0835['timezone'];if(_0x1f0835[_0x2b376a(0x19e)]!==undefined)_0x201d73[_0x2b376a(0x19e)]=Number(_0x1f0835[_0x2b376a(0x19e)]);if(_0x1f0835[_0x2b376a(0x1db)]!==undefined)_0x201d73[_0x2b376a(0x1db)]=Number(_0x1f0835['priority']);if(_0x1f0835['retryLimit']!==undefined)_0x201d73[_0x2b376a(0x197)]=Number(_0x1f0835[_0x2b376a(0x1a0)]);if(_0x1f0835[_0x2b376a(0x1a9)])_0x201d73[_0x2b376a(0x201)]=_0x1f0835['engineVersion'];if(_0x1f0835['result'])_0x201d73['result']=_0x1f0835[_0x2b376a(0x192)];if(_0x290c9d[_0x2b376a(0x17f)]){console['error'](_0x2b376a(0x1b2)+_0x2b4cae),console['error'](_0x2b376a(0x1d8)+_0x10a762),console[_0x2b376a(0x1e0)](_0x2b376a(0x1b3)+_0x3c9e90);if(_0x201d73['cron'])console[_0x2b376a(0x1e0)]('\x20\x20Cron:\x20'+_0x201d73[_0x2b376a(0x178)]);if(_0x201d73['timezone'])console[_0x2b376a(0x1e0)](_0x2b376a(0x1e3)+_0x201d73[_0x2b376a(0x1fa)]);}const _0x35f86f=await withSpinner(_0x2b376a(0x1b7),()=>_0x5c99c7[_0x2b376a(0x1dd)][_0x2b376a(0x1c6)](_0x2b4cae,_0x201d73),{'verbose':_0x290c9d[_0x2b376a(0x17f)]});return console['error'](_0x2b376a(0x1bf)+_0x35f86f['data']['name']),await handleSingleObjectOutput(_0x35f86f[_0x2b376a(0x1d6)],_0x290c9d),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a33_0x215171(0x1fb);[a33_0x215171(0x1f0)]=a33_0x215171(0x1b1);['validate'](_0x875072){const _0x8f40f3=a33_0x215171,_0x45aa54=_0x875072[_0x8f40f3(0x1a4)][0x0];if(!_0x45aa54)return _0x8f40f3(0x1e5);return undefined;}async[a33_0x215171(0x17b)](_0xd1ca4b){const _0x3ad7bd=a33_0x215171,{options:_0x5c39e3,args:_0xc946a6,tdx:_0x378d54}=_0xd1ca4b,_0xa1ca72=_0xc946a6[0x0],_0x2029c1=_0x5c39e3,_0x3a6bd3={};if(_0x2029c1['database'])_0x3a6bd3[_0x3ad7bd(0x1c4)]=_0x2029c1[_0x3ad7bd(0x1c4)];if(_0x2029c1[_0x3ad7bd(0x1b6)])_0x3a6bd3[_0x3ad7bd(0x1b6)]=_0x2029c1[_0x3ad7bd(0x1b6)];if(_0x2029c1[_0x3ad7bd(0x178)])_0x3a6bd3[_0x3ad7bd(0x178)]=_0x2029c1['cron'];if(_0x2029c1[_0x3ad7bd(0x1fa)])_0x3a6bd3['timezone']=_0x2029c1[_0x3ad7bd(0x1fa)];if(_0x2029c1[_0x3ad7bd(0x19e)]!==undefined)_0x3a6bd3[_0x3ad7bd(0x19e)]=Number(_0x2029c1[_0x3ad7bd(0x19e)]);if(_0x2029c1[_0x3ad7bd(0x1db)]!==undefined)_0x3a6bd3['priority']=Number(_0x2029c1[_0x3ad7bd(0x1db)]);if(_0x2029c1[_0x3ad7bd(0x1a0)]!==undefined)_0x3a6bd3[_0x3ad7bd(0x197)]=Number(_0x2029c1[_0x3ad7bd(0x1a0)]);if(_0x2029c1[_0x3ad7bd(0x1a9)])_0x3a6bd3[_0x3ad7bd(0x201)]=_0x2029c1[_0x3ad7bd(0x1a9)];if(_0x2029c1[_0x3ad7bd(0x192)])_0x3a6bd3['result']=_0x2029c1['result'];if(_0x2029c1[_0x3ad7bd(0x1d1)])try{_0x3a6bd3[_0x3ad7bd(0x1f9)]=readFileSync(_0x2029c1[_0x3ad7bd(0x1d1)],_0x3ad7bd(0x1f4))[_0x3ad7bd(0x1c7)]();}catch(_0x1a4fea){throw new SDKError(ErrorCode[_0x3ad7bd(0x193)],_0x3ad7bd(0x1c9)+_0x2029c1[_0x3ad7bd(0x1d1)],_0x1a4fea instanceof Error?_0x1a4fea:undefined);}if(Object[_0x3ad7bd(0x1a6)](_0x3a6bd3)[_0x3ad7bd(0x17e)]===0x0)throw new SDKError(ErrorCode[_0x3ad7bd(0x193)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x5c39e3[_0x3ad7bd(0x17f)]){console[_0x3ad7bd(0x1e0)](_0x3ad7bd(0x1fe)+_0xa1ca72);for(const [_0x7d2a05,_0x126c2f]of Object[_0x3ad7bd(0x1ae)](_0x3a6bd3)){_0x7d2a05==='query'?console[_0x3ad7bd(0x1e0)]('\x20\x20'+_0x7d2a05+':\x20'+_0x126c2f[_0x3ad7bd(0x1d7)](0x0,0x32)+_0x3ad7bd(0x1dc)):console['error']('\x20\x20'+_0x7d2a05+':\x20'+_0x126c2f);}}const _0x59628a=await withSpinner(_0x3ad7bd(0x1c8),()=>_0x378d54[_0x3ad7bd(0x1dd)][_0x3ad7bd(0x1c1)](_0xa1ca72,_0x3a6bd3),{'verbose':_0x5c39e3[_0x3ad7bd(0x17f)]});return console[_0x3ad7bd(0x1e0)]('Schedule\x20updated:\x20'+_0x59628a['data'][_0x3ad7bd(0x18c)]),await handleSingleObjectOutput(_0x59628a[_0x3ad7bd(0x1d6)],_0x5c39e3),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a33_0x215171(0x18c)]=a33_0x215171(0x1b0);[a33_0x215171(0x1f0)]='Delete\x20a\x20scheduled\x20query';[a33_0x215171(0x200)](_0x4921eb){const _0x26d657=_0x4921eb['args'][0x0];if(!_0x26d657)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a33_0x215171(0x17b)](_0x3d1209){const _0x171884=a33_0x215171,{options:_0x11c55a,args:_0x40826f,tdx:_0x3baf00}=_0x3d1209,_0x496502=_0x40826f[0x0];if(!_0x11c55a['yes']){const _0x85da0b=await confirm(_0x171884(0x17d)+_0x496502+'\x22?');if(!_0x85da0b)return console[_0x171884(0x1e0)]('Cancelled'),0x0;}const _0x49776b=await withSpinner(_0x171884(0x179),()=>_0x3baf00[_0x171884(0x1dd)]['delete'](_0x496502),{'verbose':_0x11c55a[_0x171884(0x17f)]});return console[_0x171884(0x1e0)](_0x171884(0x1f1)+_0x49776b[_0x171884(0x1d6)]['name']),0x0;}}function a33_0xbdec(_0x507b73,_0x56362b){_0x507b73=_0x507b73-0x173;const _0x176660=a33_0x1766();let _0xbdecc3=_0x176660[_0x507b73];return _0xbdecc3;}export class ScheduleRunCommand extends BaseCommand{[a33_0x215171(0x18c)]=a33_0x215171(0x1ee);[a33_0x215171(0x1f0)]=a33_0x215171(0x188);[a33_0x215171(0x200)](_0x12cf17){const _0x2e8b80=a33_0x215171,_0x357abf=_0x12cf17[_0x2e8b80(0x1a4)][0x0];if(!_0x357abf)return _0x2e8b80(0x185);return undefined;}async['execute'](_0x12d4c9){const _0xa33a1d=a33_0x215171,{options:_0x1a3333,args:_0x59f2be,tdx:_0x55dfbf}=_0x12d4c9,_0x28c99d=_0x59f2be[0x0],_0x2cefb3=_0x1a3333,_0x5692c0=_0x2cefb3['time'],_0x4d11f6=_0x2cefb3['num']!==undefined?Number(_0x2cefb3[_0xa33a1d(0x1ab)]):undefined;if(_0x1a3333[_0xa33a1d(0x17f)]){console[_0xa33a1d(0x1e0)]('Running\x20schedule:\x20'+_0x28c99d);if(_0x5692c0)console['error'](_0xa33a1d(0x1b9)+_0x5692c0);if(_0x4d11f6)console['error'](_0xa33a1d(0x173)+_0x4d11f6);}const _0x5c02d5=await withSpinner('Running\x20schedule...',()=>_0x55dfbf[_0xa33a1d(0x1dd)]['run'](_0x28c99d,{'time':_0x5692c0,'num':_0x4d11f6}),{'verbose':_0x1a3333['verbose']}),_0x5a1368=_0x5c02d5[_0xa33a1d(0x1d6)][_0xa33a1d(0x1b5)];console[_0xa33a1d(0x1e0)](_0xa33a1d(0x187)+_0x5a1368[_0xa33a1d(0x17e)]+_0xa33a1d(0x1aa)+(_0x5a1368[_0xa33a1d(0x17e)]!==0x1?'s':'')+_0xa33a1d(0x189));for(const _0x5b5381 of _0x5a1368){console[_0xa33a1d(0x1e0)](_0xa33a1d(0x17a)+_0x5b5381[_0xa33a1d(0x1ad)]);}return await handleSDKOutput(_0x5a1368,_0x1a3333),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a33_0x215171(0x18c)]=a33_0x215171(0x1e7);[a33_0x215171(0x1f0)]=a33_0x215171(0x18e);['validate'](_0x500378){const _0x4e384b=a33_0x215171,_0x203591=_0x500378[_0x4e384b(0x1a4)][0x0];if(!_0x203591)return _0x4e384b(0x1ba);return undefined;}async[a33_0x215171(0x17b)](_0x451d5c){const _0x507035=a33_0x215171,{options:_0x318930,args:_0x2caac2,tdx:_0x46655b}=_0x451d5c,_0x2e8584=_0x2caac2[0x0],_0x363ece=_0x318930,_0x483589=_0x363ece[_0x507035(0x1c2)]!==undefined?Number(_0x363ece[_0x507035(0x1c2)]):undefined,_0x5e4340=_0x363ece['to']!==undefined?Number(_0x363ece['to']):undefined,_0x1ae2ec=await withSpinner(_0x507035(0x177),()=>_0x46655b[_0x507035(0x1dd)][_0x507035(0x1af)](_0x2e8584,{'from':_0x483589,'to':_0x5e4340}),{'verbose':_0x318930[_0x507035(0x17f)]}),_0x4e1d58=_0x1ae2ec[_0x507035(0x1d6)];console['error']('Found\x20'+_0x4e1d58[_0x507035(0x1c3)]+_0x507035(0x1e8)+(_0x4e1d58[_0x507035(0x1c3)]!==0x1?'s':'')+_0x507035(0x1a7)+_0x4e1d58[_0x507035(0x1c2)]+'-'+_0x4e1d58['to']+')');const _0x4652a5=_0x4e1d58[_0x507035(0x1af)][_0x507035(0x1da)](_0x252b55=>({'job_id':_0x252b55['job_id'],'type':_0x252b55[_0x507035(0x1b6)],'status':_0x252b55[_0x507035(0x1bd)],'scheduled_at':_0x252b55[_0x507035(0x17c)],'created_at':_0x252b55[_0x507035(0x18a)],'start_at':_0x252b55[_0x507035(0x1cf)],'end_at':_0x252b55[_0x507035(0x19c)]}));return await handleSDKOutput(_0x4652a5,_0x318930),0x0;}}
|
|
1
|
+
const a33_0x116e48=a33_0xb5ce;(function(_0x1911da,_0x405d3d){const _0x147d51=a33_0xb5ce,_0x547ea8=_0x1911da();while(!![]){try{const _0x307367=-parseInt(_0x147d51(0x1ea))/0x1*(-parseInt(_0x147d51(0x247))/0x2)+-parseInt(_0x147d51(0x1e7))/0x3*(-parseInt(_0x147d51(0x20b))/0x4)+-parseInt(_0x147d51(0x1d5))/0x5+-parseInt(_0x147d51(0x21c))/0x6+-parseInt(_0x147d51(0x1cc))/0x7+parseInt(_0x147d51(0x246))/0x8*(-parseInt(_0x147d51(0x22a))/0x9)+parseInt(_0x147d51(0x226))/0xa;if(_0x307367===_0x405d3d)break;else _0x547ea8['push'](_0x547ea8['shift']());}catch(_0x46a132){_0x547ea8['push'](_0x547ea8['shift']());}}}(a33_0x4b1b,0x78ef2));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 a33_0x3830fc from'chalk';function formatRelativeTime(_0x207733){const _0x25e7f9=a33_0xb5ce,_0x124990=new Date(_0x207733),_0x1199d0=new Date(),_0x1374a0=_0x124990[_0x25e7f9(0x252)]()-_0x1199d0['getTime'](),_0x3271b8=Math[_0x25e7f9(0x1c5)](_0x1374a0)/0x3e8,_0x5062f3=_0x1374a0<0x0;if(_0x3271b8<0x3c)return _0x5062f3?_0x25e7f9(0x237):'soon';else{if(_0x3271b8<0xe10){const _0x156bfb=Math['round'](_0x3271b8/0x3c);return _0x5062f3?_0x156bfb+_0x25e7f9(0x228):_0x25e7f9(0x20d)+_0x156bfb+'m';}else{if(_0x3271b8<0x15180){const _0x20f7fb=Math['round'](_0x3271b8/0xe10);return _0x5062f3?_0x20f7fb+_0x25e7f9(0x1d3):'in\x20'+_0x20f7fb+'h';}else{if(_0x3271b8<0x93a80){const _0x25a36e=Math[_0x25e7f9(0x24d)](_0x3271b8/0x15180);return _0x5062f3?_0x25a36e+_0x25e7f9(0x1f0):_0x25e7f9(0x20d)+_0x25a36e+'d';}else return _0x124990[_0x25e7f9(0x217)]();}}}}export class ScheduleListCommand extends BaseCommand{[a33_0x116e48(0x1ff)]='schedule:list';[a33_0x116e48(0x200)]=a33_0x116e48(0x21d);async[a33_0x116e48(0x1d9)](_0x315f19){const _0x344716=a33_0x116e48,{options:_0x356f83,args:_0xbf3354,tdx:_0x2816b7}=_0x315f19,_0x50a4ee=resolveLimit(_0x356f83['limit'],DEFAULT_DISPLAY_LIMIT),_0x271224=_0xbf3354[0x0],_0x50b483=_0x271224?_0x344716(0x1e8)+_0x271224+'\x22...':_0x344716(0x1dc),_0x23865b=await withSpinner(_0x50b483,()=>_0x2816b7[_0x344716(0x22d)][_0x344716(0x1f9)]({'limit':_0x50a4ee,'scheduled':!![],'pattern':_0x271224}),{'verbose':_0x356f83[_0x344716(0x1c7)]}),_0x240d7c=_0x23865b[_0x344716(0x1f6)][_0x344716(0x1d7)],_0x1bc134=_0x23865b[_0x344716(0x1f6)][_0x344716(0x23c)][_0x344716(0x1c2)],_0x2e917f=_0x271224?'\x20matching\x20\x22'+_0x271224+'\x22':'';_0x1bc134?console[_0x344716(0x230)](_0x344716(0x213)+_0x240d7c[_0x344716(0x208)]+_0x344716(0x215)+_0x2e917f+_0x344716(0x1dd)):console[_0x344716(0x230)](_0x344716(0x1c4)+_0x240d7c['length']+_0x344716(0x243)+(_0x240d7c[_0x344716(0x208)]!==0x1?_0x344716(0x236):'y')+_0x2e917f);if(_0x356f83[_0x344716(0x1e6)]===_0x344716(0x250)||_0x356f83[_0x344716(0x1e6)]===_0x344716(0x244)||_0x356f83[_0x344716(0x1e6)]==='table'||_0x356f83['format']===_0x344716(0x1ee)){const _0x348b73=_0x240d7c[_0x344716(0x23f)](_0x408ee8=>({'id':_0x408ee8['id'],'name':_0x408ee8['name'],'cron':_0x408ee8['cron'],'database':_0x408ee8[_0x344716(0x210)]?.['name'],'type':_0x408ee8[_0x344716(0x1ce)],'timezone':_0x408ee8[_0x344716(0x220)],'user_name':_0x408ee8['user']?.[_0x344716(0x1ff)],'updated_at':_0x408ee8[_0x344716(0x1e9)],'next_run_at':_0x408ee8['next_run_at'],'last_job_status':_0x408ee8[_0x344716(0x242)]?.[_0x344716(0x1d4)]}));await handleSDKOutput(_0x348b73,_0x356f83);}else{if(_0x240d7c[_0x344716(0x208)]===0x0)console['log']('No\x20scheduled\x20queries\x20found');else{const _0x54e3a4=_0x356f83[_0x344716(0x241)],_0x63407=_0x240d7c[_0x344716(0x23f)](_0x2b9be2=>{const _0x52af6f=_0x344716,_0x2aefda=_0x2b9be2[_0x52af6f(0x242)]?.[_0x52af6f(0x1d4)]?_0x2b9be2['last_job'][_0x52af6f(0x1d4)]==='success'?'β':'β':'-',_0x3707ae=_0x2b9be2[_0x52af6f(0x242)]?.[_0x52af6f(0x1da)]?formatRelativeTime(_0x2b9be2[_0x52af6f(0x242)][_0x52af6f(0x1da)]):_0x52af6f(0x1f2),_0x1ec1a3=_0x2b9be2[_0x52af6f(0x1e3)]?formatRelativeTime(_0x2b9be2[_0x52af6f(0x1e3)]):'-',_0x54ec5c=_0x2b9be2[_0x52af6f(0x1d6)]||'',_0x16ebb2=_0x2b9be2[_0x52af6f(0x1ff)]||_0x52af6f(0x1ed),_0x4fab74=getConsoleUrl(_0x54e3a4,'/app/queries/editor?queryId='+_0x2b9be2['id']);return{'statusIcon':_0x2aefda,'lastRun':_0x3707ae,'nextRun':_0x1ec1a3,'cron':_0x54ec5c,'name':_0x16ebb2,'queryUrl':_0x4fab74,'status':_0x2b9be2[_0x52af6f(0x242)]?.[_0x52af6f(0x1d4)]};}),_0x39398f=Math[_0x344716(0x234)](..._0x63407['map'](_0x17e04c=>_0x17e04c[_0x344716(0x1f5)][_0x344716(0x208)])),_0x30b52c=Math[_0x344716(0x234)](..._0x63407['map'](_0x5a4992=>_0x5a4992[_0x344716(0x24b)]['length'])),_0x24361c=Math[_0x344716(0x234)](..._0x63407[_0x344716(0x23f)](_0x1adf7a=>_0x1adf7a[_0x344716(0x1d6)][_0x344716(0x208)])),_0x4cdfd1=_0x63407[_0x344716(0x23f)](_0x422afa=>{const _0x29614d=_0x344716,_0x1821c7=_0x422afa['status']==='success'?a33_0x3830fc['green'](_0x422afa[_0x29614d(0x1fe)]):_0x422afa[_0x29614d(0x1d4)]===_0x29614d(0x230)?a33_0x3830fc[_0x29614d(0x20f)](_0x422afa[_0x29614d(0x1fe)]):a33_0x3830fc[_0x29614d(0x24e)](_0x422afa[_0x29614d(0x1fe)]),_0x5c8451=_0x422afa[_0x29614d(0x1f5)]['padEnd'](_0x39398f),_0x1e7b39=_0x422afa[_0x29614d(0x24b)][_0x29614d(0x212)](_0x30b52c),_0x54f350=_0x422afa['cron']?a33_0x3830fc[_0x29614d(0x1e5)](_0x422afa[_0x29614d(0x1d6)]['padEnd'](_0x24361c)):'\x20'[_0x29614d(0x232)](_0x24361c),_0xe9546e=hyperlink(_0x422afa['name'],_0x422afa['queryUrl']);return _0x29614d(0x1d2)+_0x1821c7+'\x20'+_0x5c8451+'\x20\x20β\x20'+_0x1e7b39+'\x20\x20'+_0x54f350+'\x20\x20'+_0xe9546e;});await writeOutput(_0x4cdfd1['join']('\x0a'),_0x356f83[_0x344716(0x209)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a33_0x116e48(0x1ff)]='schedule:show';[a33_0x116e48(0x200)]=a33_0x116e48(0x1f4);[a33_0x116e48(0x214)](_0x5605d2){const _0xce659b=a33_0x116e48,_0x316509=_0x5605d2[_0xce659b(0x1eb)][0x0];if(!_0x316509)return _0xce659b(0x1f1);return undefined;}async['execute'](_0x5ca829){const _0x471204=a33_0x116e48,{options:_0x5a4216,args:_0x54be40,tdx:_0x5f0a05}=_0x5ca829,_0x58c726=_0x54be40[0x0],_0xc05e7b=await withSpinner(_0x471204(0x22e),()=>_0x5f0a05['schedules'][_0x471204(0x22f)](_0x58c726),{'verbose':_0x5a4216[_0x471204(0x1c7)]}),_0x29560c=_0xc05e7b['data'],_0x2e0518={'name':_0x29560c['name'],'cron':_0x29560c[_0x471204(0x1d6)],'database':_0x29560c['database'],'type':_0x29560c['type'],'timezone':_0x29560c[_0x471204(0x1df)],'user_name':_0x29560c['user_name'],'created_at':_0x29560c[_0x471204(0x1e0)],'engine_version':_0x29560c[_0x471204(0x1d8)],'executing_user_id':_0x29560c[_0x471204(0x225)],'query':_0x29560c[_0x471204(0x24a)],'delay':_0x29560c[_0x471204(0x1cb)],'priority':_0x29560c['priority'],'retry_limit':_0x29560c['retry_limit'],..._0x29560c[_0x471204(0x21b)]&&{'result':_0x29560c['result']}};return await handleSingleObjectOutput(_0x2e0518,_0x5a4216),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a33_0x116e48(0x1ff)]=a33_0x116e48(0x21a);[a33_0x116e48(0x200)]=a33_0x116e48(0x1fa);['validate'](_0x8bfa86){const _0x18bdcb=a33_0x116e48,_0x215ee1=_0x8bfa86[_0x18bdcb(0x1eb)][0x0];if(!_0x215ee1)return _0x18bdcb(0x1ec);const _0x262da7=_0x8bfa86[_0x18bdcb(0x1f3)];if(!_0x262da7[_0x18bdcb(0x210)])return _0x18bdcb(0x1d1);return undefined;}async[a33_0x116e48(0x1d9)](_0x4fc39b){const _0x4c77a3=a33_0x116e48,{options:_0x476f5f,args:_0x21dd7c,tdx:_0x29c87f}=_0x4fc39b,_0x24e4fe=_0x21dd7c[0x0],_0x43d78a=_0x476f5f,_0x311513=_0x43d78a['database'],_0x10d1b4=_0x43d78a[_0x4c77a3(0x1c6)],_0x17ab6f=_0x43d78a[_0x4c77a3(0x1ce)]||'trino';let _0x34753b;try{_0x34753b=readFileSync(_0x10d1b4,_0x4c77a3(0x221))[_0x4c77a3(0x22c)]();}catch(_0x16ae84){throw new SDKError(ErrorCode[_0x4c77a3(0x1cd)],_0x4c77a3(0x249)+_0x10d1b4,_0x16ae84 instanceof Error?_0x16ae84:undefined);}if(!_0x34753b)throw new SDKError(ErrorCode[_0x4c77a3(0x1cd)],_0x4c77a3(0x20a));const _0x13de72={'database':_0x311513,'query':_0x34753b,'type':_0x17ab6f};if(_0x43d78a[_0x4c77a3(0x1d6)])_0x13de72[_0x4c77a3(0x1d6)]=_0x43d78a[_0x4c77a3(0x1d6)];if(_0x43d78a[_0x4c77a3(0x1df)])_0x13de72[_0x4c77a3(0x1df)]=_0x43d78a[_0x4c77a3(0x1df)];if(_0x43d78a[_0x4c77a3(0x1cb)]!==undefined)_0x13de72[_0x4c77a3(0x1cb)]=Number(_0x43d78a[_0x4c77a3(0x1cb)]);if(_0x43d78a['priority']!==undefined)_0x13de72[_0x4c77a3(0x224)]=Number(_0x43d78a[_0x4c77a3(0x224)]);if(_0x43d78a[_0x4c77a3(0x207)]!==undefined)_0x13de72[_0x4c77a3(0x1d0)]=Number(_0x43d78a['retryLimit']);if(_0x43d78a[_0x4c77a3(0x238)])_0x13de72[_0x4c77a3(0x1d8)]=_0x43d78a[_0x4c77a3(0x238)];if(_0x43d78a[_0x4c77a3(0x21b)])_0x13de72[_0x4c77a3(0x21b)]=_0x43d78a['result'];if(_0x476f5f[_0x4c77a3(0x1c7)]){console[_0x4c77a3(0x230)](_0x4c77a3(0x251)+_0x24e4fe),console[_0x4c77a3(0x230)]('\x20\x20Database:\x20'+_0x311513),console[_0x4c77a3(0x230)](_0x4c77a3(0x1fc)+_0x17ab6f);if(_0x13de72[_0x4c77a3(0x1d6)])console[_0x4c77a3(0x230)](_0x4c77a3(0x24f)+_0x13de72[_0x4c77a3(0x1d6)]);if(_0x13de72[_0x4c77a3(0x1df)])console[_0x4c77a3(0x230)]('\x20\x20Timezone:\x20'+_0x13de72[_0x4c77a3(0x1df)]);}const _0x4b2003=await withSpinner(_0x4c77a3(0x1c9),()=>_0x29c87f['schedules'][_0x4c77a3(0x248)](_0x24e4fe,_0x13de72),{'verbose':_0x476f5f[_0x4c77a3(0x1c7)]});return console[_0x4c77a3(0x230)](_0x4c77a3(0x240)+_0x4b2003['data'][_0x4c77a3(0x1ff)]),await handleSingleObjectOutput(_0x4b2003[_0x4c77a3(0x1f6)],_0x476f5f),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a33_0x116e48(0x1ff)]=a33_0x116e48(0x23b);[a33_0x116e48(0x200)]=a33_0x116e48(0x233);[a33_0x116e48(0x214)](_0x45a9f4){const _0x3736a4=a33_0x116e48,_0x564e9e=_0x45a9f4[_0x3736a4(0x1eb)][0x0];if(!_0x564e9e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async['execute'](_0x46c009){const _0x31d638=a33_0x116e48,{options:_0x39fcb4,args:_0x58dd6b,tdx:_0x223328}=_0x46c009,_0x22344d=_0x58dd6b[0x0],_0x51450f=_0x39fcb4,_0x563704={};if(_0x51450f[_0x31d638(0x210)])_0x563704[_0x31d638(0x210)]=_0x51450f[_0x31d638(0x210)];if(_0x51450f[_0x31d638(0x1ce)])_0x563704[_0x31d638(0x1ce)]=_0x51450f[_0x31d638(0x1ce)];if(_0x51450f[_0x31d638(0x1d6)])_0x563704['cron']=_0x51450f[_0x31d638(0x1d6)];if(_0x51450f['timezone'])_0x563704[_0x31d638(0x1df)]=_0x51450f['timezone'];if(_0x51450f[_0x31d638(0x1cb)]!==undefined)_0x563704[_0x31d638(0x1cb)]=Number(_0x51450f[_0x31d638(0x1cb)]);if(_0x51450f[_0x31d638(0x224)]!==undefined)_0x563704['priority']=Number(_0x51450f[_0x31d638(0x224)]);if(_0x51450f[_0x31d638(0x207)]!==undefined)_0x563704[_0x31d638(0x1d0)]=Number(_0x51450f[_0x31d638(0x207)]);if(_0x51450f[_0x31d638(0x238)])_0x563704[_0x31d638(0x1d8)]=_0x51450f[_0x31d638(0x238)];if(_0x51450f['result'])_0x563704[_0x31d638(0x21b)]=_0x51450f[_0x31d638(0x21b)];if(_0x51450f['file'])try{_0x563704[_0x31d638(0x24a)]=readFileSync(_0x51450f['file'],_0x31d638(0x221))[_0x31d638(0x22c)]();}catch(_0x491d98){throw new SDKError(ErrorCode[_0x31d638(0x1cd)],_0x31d638(0x249)+_0x51450f[_0x31d638(0x1c6)],_0x491d98 instanceof Error?_0x491d98:undefined);}if(Object[_0x31d638(0x20c)](_0x563704)[_0x31d638(0x208)]===0x0)throw new SDKError(ErrorCode[_0x31d638(0x1cd)],_0x31d638(0x231));if(_0x39fcb4['verbose']){console[_0x31d638(0x230)](_0x31d638(0x222)+_0x22344d);for(const [_0x3dad31,_0x31ab72]of Object[_0x31d638(0x1e1)](_0x563704)){_0x3dad31===_0x31d638(0x24a)?console[_0x31d638(0x230)]('\x20\x20'+_0x3dad31+':\x20'+_0x31ab72[_0x31d638(0x218)](0x0,0x32)+_0x31d638(0x1db)):console[_0x31d638(0x230)]('\x20\x20'+_0x3dad31+':\x20'+_0x31ab72);}}const _0x4ef986=await withSpinner(_0x31d638(0x20e),()=>_0x223328[_0x31d638(0x22d)][_0x31d638(0x1de)](_0x22344d,_0x563704),{'verbose':_0x39fcb4[_0x31d638(0x1c7)]});return console[_0x31d638(0x230)](_0x31d638(0x216)+_0x4ef986[_0x31d638(0x1f6)][_0x31d638(0x1ff)]),await handleSingleObjectOutput(_0x4ef986[_0x31d638(0x1f6)],_0x39fcb4),0x0;}}function a33_0xb5ce(_0x4f0734,_0x92d575){_0x4f0734=_0x4f0734-0x1c2;const _0x4b1bf6=a33_0x4b1b();let _0xb5cebc=_0x4b1bf6[_0x4f0734];return _0xb5cebc;}export class ScheduleDeleteCommand extends BaseCommand{['name']=a33_0x116e48(0x211);['description']=a33_0x116e48(0x245);['validate'](_0x40ecc5){const _0x58f4a3=a33_0x116e48,_0x3870c9=_0x40ecc5[_0x58f4a3(0x1eb)][0x0];if(!_0x3870c9)return _0x58f4a3(0x23e);return undefined;}async[a33_0x116e48(0x1d9)](_0x39fce7){const _0x31adb0=a33_0x116e48,{options:_0x412fbb,args:_0x2cd0c4,tdx:_0x3fc181}=_0x39fce7,_0xb5d2da=_0x2cd0c4[0x0];if(!_0x412fbb[_0x31adb0(0x1e4)]){const _0x279ae2=await confirm(_0x31adb0(0x1ca)+_0xb5d2da+'\x22?');if(!_0x279ae2)return console[_0x31adb0(0x230)](_0x31adb0(0x1f8)),0x0;}const _0x311eab=await withSpinner(_0x31adb0(0x219),()=>_0x3fc181[_0x31adb0(0x22d)][_0x31adb0(0x23d)](_0xb5d2da),{'verbose':_0x412fbb[_0x31adb0(0x1c7)]});return console[_0x31adb0(0x230)](_0x31adb0(0x1fd)+_0x311eab[_0x31adb0(0x1f6)][_0x31adb0(0x1ff)]),0x0;}}function a33_0x4b1b(){const _0x507d66=['Searching\x20scheduled\x20queries\x20matching\x20\x22','updated_at','7uEbXzy','args','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','(unnamed)','tsv','count','d\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','never','options','Show\x20schedule\x20details','lastRun','data','jobs','Cancelled','listQueries','Create\x20a\x20scheduled\x20query','end_at','\x20\x20Type:\x20','Schedule\x20deleted:\x20','statusIcon','name','description','\x20\x20Num:\x20','Running\x20schedule:\x20','scheduled_at','Schedule\x20run\x20submitted:\x20','\x20\x20Time:\x20','schedule:run','retryLimit','length','output','Query\x20file\x20is\x20empty','104648xHIPcL','keys','in\x20','Updating\x20schedule...','red','database','schedule:delete','padEnd','Showing\x20first\x20','validate','\x20schedules','Schedule\x20updated:\x20','toLocaleDateString','substring','Deleting\x20schedule...','schedule:create','result','3837438BFRvWB','List\x20scheduled\x20queries','\x20\x20Job\x20ID:\x20','Show\x20schedule\x20execution\x20history','time_zone','utf-8','Updating\x20schedule:\x20','time','priority','executing_user_id','15288790LdItty','job_id','m\x20ago','\x20job','3293793vzGkwG','\x20(showing\x20','trim','schedules','Getting\x20schedule\x20details...','show','error','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','repeat','Update\x20a\x20scheduled\x20query','max','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','ies','just\x20now','engineVersion','num','Getting\x20schedule\x20history...','schedule:update','pagination','delete','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','map','Schedule\x20created:\x20','site','last_job','\x20scheduled\x20quer','jsonl','Delete\x20a\x20scheduled\x20query','8XySDXh','13912nIIIbf','create','Failed\x20to\x20read\x20file:\x20','query','nextRun','\x20execution','round','dim','\x20\x20Cron:\x20','json','Creating\x20schedule:\x20','getTime','has_next_page','\x20created','Found\x20','abs','file','verbose','run','Creating\x20schedule...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','delay','6086311kzGjEd','INVALID_ARGUMENT','type','Run\x20a\x20scheduled\x20query\x20immediately','retry_limit','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','π
\x20','h\x20ago','status','875980PgaHae','cron','queries','engine_version','execute','ended_at','...','Listing\x20scheduled\x20queries...','\x20(use\x20--limit\x20to\x20see\x20more)','update','timezone','created_at','entries','from','next_run_at','yes','cyan','format','111GuXDjo'];a33_0x4b1b=function(){return _0x507d66;};return a33_0x4b1b();}export class ScheduleRunCommand extends BaseCommand{[a33_0x116e48(0x1ff)]=a33_0x116e48(0x206);[a33_0x116e48(0x200)]=a33_0x116e48(0x1cf);['validate'](_0x19d1ad){const _0x2a4071=a33_0x116e48,_0x24e07c=_0x19d1ad[_0x2a4071(0x1eb)][0x0];if(!_0x24e07c)return _0x2a4071(0x235);return undefined;}async['execute'](_0x1b77af){const _0x3b89a8=a33_0x116e48,{options:_0x4bf002,args:_0xb59806,tdx:_0x5c6580}=_0x1b77af,_0x5a752e=_0xb59806[0x0],_0x159195=_0x4bf002,_0x85ab77=_0x159195[_0x3b89a8(0x223)],_0x12f1a7=_0x159195[_0x3b89a8(0x239)]!==undefined?Number(_0x159195['num']):undefined;if(_0x4bf002[_0x3b89a8(0x1c7)]){console[_0x3b89a8(0x230)](_0x3b89a8(0x202)+_0x5a752e);if(_0x85ab77)console[_0x3b89a8(0x230)](_0x3b89a8(0x205)+_0x85ab77);if(_0x12f1a7)console[_0x3b89a8(0x230)](_0x3b89a8(0x201)+_0x12f1a7);}const _0x23dfec=await withSpinner('Running\x20schedule...',()=>_0x5c6580['schedules'][_0x3b89a8(0x1c8)](_0x5a752e,{'time':_0x85ab77,'num':_0x12f1a7}),{'verbose':_0x4bf002[_0x3b89a8(0x1c7)]}),_0x2f97bd=_0x23dfec['data'][_0x3b89a8(0x1f7)];console[_0x3b89a8(0x230)](_0x3b89a8(0x204)+_0x2f97bd[_0x3b89a8(0x208)]+_0x3b89a8(0x229)+(_0x2f97bd[_0x3b89a8(0x208)]!==0x1?'s':'')+_0x3b89a8(0x1c3));for(const _0x50b62c of _0x2f97bd){console[_0x3b89a8(0x230)](_0x3b89a8(0x21e)+_0x50b62c['job_id']);}return await handleSDKOutput(_0x2f97bd,_0x4bf002),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a33_0x116e48(0x1ff)]='schedule:history';['description']=a33_0x116e48(0x21f);['validate'](_0x2bb679){const _0x35feef=_0x2bb679['args'][0x0];if(!_0x35feef)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a33_0x116e48(0x1d9)](_0x4b7842){const _0x285ecd=a33_0x116e48,{options:_0x38fd12,args:_0x7d613f,tdx:_0x48705c}=_0x4b7842,_0x21c812=_0x7d613f[0x0],_0x21f04f=_0x38fd12,_0x280c7d=_0x21f04f['from']!==undefined?Number(_0x21f04f[_0x285ecd(0x1e2)]):undefined,_0x42dc2e=_0x21f04f['to']!==undefined?Number(_0x21f04f['to']):undefined,_0x2fcd85=await withSpinner(_0x285ecd(0x23a),()=>_0x48705c[_0x285ecd(0x22d)]['history'](_0x21c812,{'from':_0x280c7d,'to':_0x42dc2e}),{'verbose':_0x38fd12[_0x285ecd(0x1c7)]}),_0x580538=_0x2fcd85[_0x285ecd(0x1f6)];console[_0x285ecd(0x230)]('Found\x20'+_0x580538[_0x285ecd(0x1ef)]+_0x285ecd(0x24c)+(_0x580538[_0x285ecd(0x1ef)]!==0x1?'s':'')+_0x285ecd(0x22b)+_0x580538[_0x285ecd(0x1e2)]+'-'+_0x580538['to']+')');const _0x79f903=_0x580538['history'][_0x285ecd(0x23f)](_0x11d9c3=>({'job_id':_0x11d9c3[_0x285ecd(0x227)],'type':_0x11d9c3[_0x285ecd(0x1ce)],'status':_0x11d9c3[_0x285ecd(0x1d4)],'scheduled_at':_0x11d9c3[_0x285ecd(0x203)],'created_at':_0x11d9c3[_0x285ecd(0x1e0)],'start_at':_0x11d9c3['start_at'],'end_at':_0x11d9c3[_0x285ecd(0x1fb)]}));return await handleSDKOutput(_0x79f903,_0x38fd12),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x5e2a91=a34_0x119b;(function(_0x54ef6b,_0x44935a){const _0x39e84f=a34_0x119b,_0x15aacb=_0x54ef6b();while(!![]){try{const _0x1ad2a4=parseInt(_0x39e84f(0x201))/0x1+-parseInt(_0x39e84f(0x209))/0x2*(-parseInt(_0x39e84f(0x20f))/0x3)+parseInt(_0x39e84f(0x258))/0x4*(-parseInt(_0x39e84f(0x249))/0x5)+parseInt(_0x39e84f(0x21f))/0x6*(-parseInt(_0x39e84f(0x25a))/0x7)+parseInt(_0x39e84f(0x26a))/0x8+-parseInt(_0x39e84f(0x218))/0x9+-parseInt(_0x39e84f(0x1f0))/0xa*(-parseInt(_0x39e84f(0x257))/0xb);if(_0x1ad2a4===_0x44935a)break;else _0x15aacb['push'](_0x15aacb['shift']());}catch(_0x5de800){_0x15aacb['push'](_0x15aacb['shift']());}}}(a34_0x78c1,0x507b8));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';function a34_0x78c1(){const _0x324b0f=['\x20\x20Parent\x20segment:\x20','setJobId','SEGMENT_FOLDER_NOT_FOUND','558093DTqnPV','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','elapsedTimeMillis','\x20[Job\x20ID:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','7414btMxKA','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','cause','Fetching\x20SQL\x20for\x20segment...','verbose','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','303paAHDV','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','segment:view','Folder\x20ID\x20missing\x20from\x20resolved\x20path','web','Create\x20segment\x20folder\x20for\x20organization','path','Folder\x20ID:\x20','resolvePathToResource','3101499jPnyOP','listFolders','Usage:\x20tdx\x20sg\x20desc\x20<name>','Folder\x20name:\x20','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Fetching\x20segment\x20details...','Use:\x20tdx\x20ps\x20desc','267966VUgLgz','Show\x20child\x20segment\x20schema\x20(column\x20types)','Creating\x20folder\x20\x27','parentId','segment:folder:show','resolveParentId','Resolved\x20YAML\x20file:\x20','red','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Resolving\x20parent\x20folder\x20\x27','message','information_schema','\x20\x20Folder\x20path:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Use:\x20tdx\x20ps\x20show','fullPath','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','β\x20Query\x20failed\x20[','createFolder','\x20folder','parent','Use:\x20tdx\x20ps\x20view','parentFolder','folder','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment:folder:create','Examples:','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','trim','Resolving\x20\x27','jobId','Show\x20segment\x20or\x20folder\x20details','Resolved:\x20','Error:\x20Folder\x20reference\x20is\x20required','segmentId','INVALID_ARGUMENT','parentSegment','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Segment\x20name:\x20','\x27...','stats','Target\x20path:\x20','5cmCdKd','getParent','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','β\x20Created\x20folder\x20\x27','segmentPath','\x20rows\x20','segment:desc','jsonl','Fetching\x20parent\x20segment\x20details...','SEGMENT_NOT_FOUND','Parent\x20ID:\x20','β\x20Query\x20completed:\x20Processed\x20','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Resolved\x20parent\x20ID:\x20','94908cIVoNK','1730944AOIRND','Resolved\x20folder\x20ID:\x20','77mNBcTU','/e/','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Show\x20segment\x20folder\x20details','folderId','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20Full\x20path:\x20','site','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','json','5050096TCZLjE','format','Show\x20folder\x20or\x20child\x20segment\x20details','error','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20folder\x20\x27','Site:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','(root)','Resolving\x20parent\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','getSegmentSQL','resolveFolderId','green','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Fetching\x20folder\x20\x27','Fetching\x20folder\x20details...','toLocaleString','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','segment:describe','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20Cause:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment','Error:\x20Path\x20or\x20name\x20is\x20required','Usage:','segment:folder:list','data','description','Listing\x20folders\x20for\x20parent\x20\x27','length','query','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','name','url','execute','segment:show','folderPath','segmentName','β\x20Found\x20','/app/ps/','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','getSQLFromYamlFile','cyan','40nmRRRs','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Parent\x20name:\x20','getSegment','code','Segment\x20ID:\x20','Resolving\x20path\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','segment:sql','getFolder','Error:\x20','getSQLFromServerSegment','includes'];a34_0x78c1=function(){return _0x324b0f;};return a34_0x78c1();}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a34_0x478205 from'chalk';async function resolveSegmentTarget(_0x773924,_0x3253d2,_0x1e31e5){const _0x44406d=a34_0x119b;if(isYamlFilePath(_0x773924))try{const _0x2702ab=await resolveYamlFilePath(_0x773924);return _0x1e31e5&&(console[_0x44406d(0x26d)](_0x44406d(0x225)+_0x773924),console[_0x44406d(0x26d)](_0x44406d(0x1fe)+_0x2702ab['parentSegment']),console[_0x44406d(0x26d)](_0x44406d(0x245)+_0x2702ab[_0x44406d(0x1e8)]),console['error'](_0x44406d(0x22b)+(_0x2702ab[_0x44406d(0x1e7)]||_0x44406d(0x1c5))),console[_0x44406d(0x26d)](_0x44406d(0x264)+_0x2702ab[_0x44406d(0x22e)])),_0x2702ab['fullPath'];}catch(_0x52b10b){throw new SDKError(ErrorCode[_0x44406d(0x242)],_0x44406d(0x1cb)+_0x52b10b[_0x44406d(0x229)]);}if(!_0x3253d2)throw new SDKError(ErrorCode[_0x44406d(0x242)],_0x44406d(0x1ec));return _0x3253d2+'/'+_0x773924;}export class SegmentDescribeCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x1d1);[a34_0x5e2a91(0x1de)]=a34_0x5e2a91(0x23e);async['execute'](_0x5c440a){const _0x58adc5=a34_0x5e2a91,{options:_0x358f6b,args:_0x46acff,tdx:_0x508905}=_0x5c440a,_0x4a2515=_0x46acff[0x0],_0x189704=!_0x4a2515&&!!_0x358f6b[_0x58adc5(0x243)],_0x3199b6=_0x4a2515||_0x358f6b['parentSegment'];if(!_0x3199b6)return console['error'](_0x58adc5(0x1da)),console[_0x58adc5(0x26d)](_0x58adc5(0x1d3)),console['error']('Examples:'),console[_0x58adc5(0x26d)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x58adc5(0x26d)](_0x58adc5(0x263)),console['error'](_0x58adc5(0x25f)),0x1;try{const _0xaf2056=_0x358f6b[_0x58adc5(0x24d)];let _0x28def0=_0x3199b6;!_0x189704&&_0xaf2056&&!_0x3199b6[_0x58adc5(0x1fd)]('/')&&(_0x28def0=_0xaf2056+'/'+_0x3199b6,_0x358f6b['verbose']&&console[_0x58adc5(0x26d)](_0x58adc5(0x26e)+_0x28def0));const _0x4ea8a9=await withSpinner(_0x58adc5(0x1f7)+_0x28def0+_0x58adc5(0x246),()=>_0x508905[_0x58adc5(0x1d9)][_0x58adc5(0x217)](_0x28def0),{'verbose':_0x358f6b[_0x58adc5(0x20d)]}),_0x4d63f3=_0x4ea8a9['data'];_0x358f6b[_0x58adc5(0x20d)]&&(console[_0x58adc5(0x26d)]('Resolved\x20type:\x20'+_0x4d63f3['type']),console[_0x58adc5(0x26d)](_0x58adc5(0x253)+_0x4d63f3['parentId']),_0x4d63f3['folderId']&&console[_0x58adc5(0x26d)]('Folder\x20ID:\x20'+_0x4d63f3['folderId']),_0x4d63f3[_0x58adc5(0x241)]&&console[_0x58adc5(0x26d)](_0x58adc5(0x1f6)+_0x4d63f3['segmentId']));if(_0x4d63f3[_0x58adc5(0x202)]===_0x58adc5(0x233)){const _0x3b9f90=await withSpinner(_0x58adc5(0x251),()=>_0x508905[_0x58adc5(0x1d9)][_0x58adc5(0x24a)](_0x4d63f3[_0x58adc5(0x222)]),{'verbose':_0x358f6b[_0x58adc5(0x20d)]});await handleSingleObjectOutput(_0x3b9f90['data'],_0x358f6b);}else{if(_0x4d63f3[_0x58adc5(0x202)]===_0x58adc5(0x236)){if(!_0x4d63f3[_0x58adc5(0x261)])throw new SDKError(ErrorCode[_0x58adc5(0x200)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x293bc4=await withSpinner(_0x58adc5(0x1cd),()=>_0x508905[_0x58adc5(0x1d9)][_0x58adc5(0x1fa)](_0x4d63f3[_0x58adc5(0x261)]),{'verbose':_0x358f6b[_0x58adc5(0x20d)]});await handleSingleObjectOutput(_0x293bc4['data'],_0x358f6b);}else{if(_0x4d63f3['type']===_0x58adc5(0x1d9)){if(!_0x4d63f3[_0x58adc5(0x241)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x8b2555=await withSpinner(_0x58adc5(0x21d),()=>_0x508905[_0x58adc5(0x1d9)][_0x58adc5(0x1f4)](_0x4d63f3[_0x58adc5(0x222)],_0x4d63f3[_0x58adc5(0x241)]),{'verbose':_0x358f6b[_0x58adc5(0x20d)]});await handleSingleObjectOutput(_0x8b2555[_0x58adc5(0x1dd)],_0x358f6b);}}}return 0x0;}catch(_0x413bca){if(_0x413bca instanceof SDKError)return console[_0x58adc5(0x26d)](_0x58adc5(0x1fb)+_0x413bca[_0x58adc5(0x229)]),_0x413bca[_0x58adc5(0x20b)]&&console[_0x58adc5(0x26d)](_0x58adc5(0x1d4)+_0x413bca[_0x58adc5(0x20b)]),0x1;throw _0x413bca;}}}export class SegmentShowCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x1e6);['description']=a34_0x5e2a91(0x1d0);async[a34_0x5e2a91(0x1e5)](_0x5cf5ed){const _0x1f9d9b=a34_0x5e2a91,{options:_0x428825,args:_0x3a7e66,tdx:_0x21a98f}=_0x5cf5ed,_0xf04802=_0x3a7e66[0x0];if(!_0xf04802)return console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x237)),console[_0x1f9d9b(0x26d)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x203)),console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x239)),console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x1cf)),console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x1e2)),0x1;try{const _0x3a4cf7=_0x428825[_0x1f9d9b(0x243)],_0x212085=await resolveSegmentTarget(_0xf04802,_0x3a4cf7,_0x428825[_0x1f9d9b(0x20d)]);_0x428825[_0x1f9d9b(0x20d)]&&console[_0x1f9d9b(0x26d)]('Target\x20path:\x20'+_0x212085);const _0x4643ae=await withSpinner('Resolving\x20\x27'+_0xf04802+_0x1f9d9b(0x246),()=>_0x21a98f[_0x1f9d9b(0x1d9)][_0x1f9d9b(0x217)](_0x212085),{'verbose':_0x428825['verbose']}),_0x59fc6b=_0x4643ae[_0x1f9d9b(0x1dd)];_0x428825[_0x1f9d9b(0x20d)]&&(console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x1d7)+_0x59fc6b['type']),console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x253)+_0x59fc6b[_0x1f9d9b(0x222)]));if(_0x59fc6b[_0x1f9d9b(0x202)]==='folder')return console['error'](_0x1f9d9b(0x1f1)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x59fc6b['type']===_0x1f9d9b(0x233))return console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x20a)),console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x22d)),0x1;if(!_0x59fc6b[_0x1f9d9b(0x241)])throw new SDKError(ErrorCode[_0x1f9d9b(0x252)],_0x1f9d9b(0x1c7));const _0x2afbaf=await withSpinner(_0x1f9d9b(0x20c),()=>_0x21a98f[_0x1f9d9b(0x1d9)]['getSegmentSQL'](_0x59fc6b[_0x1f9d9b(0x222)],_0x59fc6b[_0x1f9d9b(0x241)]),{'verbose':_0x428825[_0x1f9d9b(0x20d)]});let _0xd5c4d1=_0x2afbaf['data'];const _0x32b7da=resolveLimit(_0x428825['limit'],DEFAULT_DISPLAY_LIMIT),_0x309778=/\bLIMIT\s+\d+/i['test'](_0xd5c4d1);!_0x309778&&(_0xd5c4d1=_0xd5c4d1[_0x1f9d9b(0x23b)]()['replace'](/;+$/,''),_0xd5c4d1=_0x1f9d9b(0x262)+_0xd5c4d1+_0x1f9d9b(0x1c4)+_0x32b7da);_0x428825['verbose']&&console[_0x1f9d9b(0x26d)]('SQL\x20query:\x0a'+_0xd5c4d1);const _0x289d76=await withProgressSpinner('Executing\x20segment\x20query...',async _0x2116b9=>{const _0x14089f=_0x1f9d9b,_0x1f646a=await _0x21a98f[_0x14089f(0x1e1)]['execute'](_0xd5c4d1,{'catalog':'td','schema':_0x14089f(0x22a),'onJobId':_0x5455c6=>{const _0x5cdcab=_0x14089f;_0x2116b9[_0x5cdcab(0x1ff)](_0x5455c6);}});return _0x1f646a;},{'verbose':_0x428825[_0x1f9d9b(0x20d)]}),_0x36710b=_0x289d76[_0x1f9d9b(0x1dd)],_0x529513=_0x36710b[_0x1f9d9b(0x23d)]?_0x1f9d9b(0x207)+_0x36710b[_0x1f9d9b(0x23d)]+']':'';return console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x254)+_0x36710b[_0x1f9d9b(0x247)]['processedRows'][_0x1f9d9b(0x1ce)]()+_0x1f9d9b(0x24e)+('in\x20'+formatElapsed(_0x36710b[_0x1f9d9b(0x247)][_0x1f9d9b(0x206)])+_0x529513)),await handleQueryOutput(_0x36710b,_0x428825),0x0;}catch(_0x27cca0){if(_0x27cca0 instanceof SDKError)return console[_0x1f9d9b(0x26d)](_0x1f9d9b(0x230)+_0x27cca0[_0x1f9d9b(0x1f5)]+']'),console[_0x1f9d9b(0x26d)]('\x0a'+_0x27cca0['message']),0x1;throw _0x27cca0;}}}export class SegmentFolderListCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x1dc);[a34_0x5e2a91(0x1de)]=a34_0x5e2a91(0x1f2);async[a34_0x5e2a91(0x1e5)](_0x197569){const _0x2b99a5=a34_0x5e2a91,{options:_0x575723,args:_0x57fcc1,tdx:_0x5a1d69}=_0x197569;if(_0x57fcc1['length']===0x0)return console[_0x2b99a5(0x26d)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x2b99a5(0x267)),0x1;const _0x211124=_0x57fcc1[0x0];try{_0x575723[_0x2b99a5(0x20d)]&&(console[_0x2b99a5(0x26d)](_0x2b99a5(0x1c2)+_0x575723['site']),console[_0x2b99a5(0x26d)](_0x2b99a5(0x1f3)+_0x211124));const _0x1b5a24=await withSpinner(_0x2b99a5(0x1c6)+_0x211124+_0x2b99a5(0x246),()=>_0x5a1d69[_0x2b99a5(0x1d9)]['resolveParentId'](_0x211124),{'verbose':_0x575723[_0x2b99a5(0x20d)]}),_0x58171a=_0x1b5a24[_0x2b99a5(0x1dd)];_0x575723[_0x2b99a5(0x20d)]&&console[_0x2b99a5(0x26d)](_0x2b99a5(0x256)+_0x58171a);const _0x395818=await withSpinner(_0x2b99a5(0x1df)+_0x211124+_0x2b99a5(0x246),()=>_0x5a1d69[_0x2b99a5(0x1d9)][_0x2b99a5(0x219)](_0x58171a),{'verbose':_0x575723[_0x2b99a5(0x20d)]}),_0x48fe02=_0x395818[_0x2b99a5(0x1dd)];return console[_0x2b99a5(0x26d)](_0x2b99a5(0x1e9)+_0x48fe02[_0x2b99a5(0x1e0)]+_0x2b99a5(0x232)+(_0x48fe02[_0x2b99a5(0x1e0)]!==0x1?'s':'')),await handleSDKOutput(_0x48fe02,_0x575723),0x0;}catch(_0xe342c5){if(_0xe342c5 instanceof SDKError)return console[_0x2b99a5(0x26d)](_0x2b99a5(0x1fb)+_0xe342c5['message']),_0xe342c5[_0x2b99a5(0x20b)]&&console[_0x2b99a5(0x26d)](_0x2b99a5(0x1d4)+_0xe342c5[_0x2b99a5(0x20b)]),0x1;throw _0xe342c5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x223);[a34_0x5e2a91(0x1de)]=a34_0x5e2a91(0x260);async['execute'](_0xd0fb55){const _0x45d470=a34_0x5e2a91,{options:_0x3310aa,args:_0x326a33,tdx:_0x455b5e}=_0xd0fb55;if(_0x326a33[_0x45d470(0x1e0)]===0x0)return console[_0x45d470(0x26d)](_0x45d470(0x240)),console[_0x45d470(0x26d)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x5e2166,childId:_0x175bb9}=parseSegmentRef(_0x326a33[0x0]);_0x3310aa[_0x45d470(0x20d)]&&(console[_0x45d470(0x26d)](_0x45d470(0x1c2)+_0x3310aa[_0x45d470(0x265)]),console['error'](_0x45d470(0x1f3)+_0x5e2166),_0x175bb9&&console[_0x45d470(0x26d)](_0x45d470(0x21b)+_0x175bb9));if(!_0x175bb9)return console[_0x45d470(0x26d)](_0x45d470(0x227)),0x1;const _0x271c43=await withSpinner(_0x45d470(0x1c6)+_0x5e2166+'\x27...',()=>_0x455b5e[_0x45d470(0x1d9)]['resolveParentId'](_0x5e2166),{'verbose':_0x3310aa['verbose']}),_0xfdbfdb=_0x271c43[_0x45d470(0x1dd)];_0x3310aa[_0x45d470(0x20d)]&&console[_0x45d470(0x26d)](_0x45d470(0x256)+_0xfdbfdb);const _0x38136d=await withSpinner(_0x45d470(0x26f)+_0x175bb9+_0x45d470(0x246),()=>_0x455b5e[_0x45d470(0x1d9)][_0x45d470(0x1c9)](_0xfdbfdb,_0x175bb9),{'verbose':_0x3310aa[_0x45d470(0x20d)]}),_0x119b02=_0x38136d[_0x45d470(0x1dd)];_0x3310aa['verbose']&&console[_0x45d470(0x26d)](_0x45d470(0x259)+_0x119b02);const _0x2a92e3=await withSpinner(_0x45d470(0x1cc)+_0x175bb9+_0x45d470(0x246),()=>_0x455b5e[_0x45d470(0x1d9)][_0x45d470(0x1fa)](_0x119b02),{'verbose':_0x3310aa[_0x45d470(0x20d)]});return await handleSDKOutput([_0x2a92e3[_0x45d470(0x1dd)]],_0x3310aa),0x0;}catch(_0x1d9c00){if(_0x1d9c00 instanceof SDKError)return console[_0x45d470(0x26d)](_0x45d470(0x1fb)+_0x1d9c00[_0x45d470(0x229)]),_0x1d9c00[_0x45d470(0x20b)]&&console['error'](_0x45d470(0x1d4)+_0x1d9c00[_0x45d470(0x20b)]),0x1;throw _0x1d9c00;}}}export class SegmentSQLCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x1f9);[a34_0x5e2a91(0x1de)]=a34_0x5e2a91(0x1d5);async['execute'](_0x4d985d){const _0x16327a=a34_0x5e2a91,{options:_0x52f99f,args:_0x3a6fd3}=_0x4d985d,_0x30b1a2=_0x52f99f,_0xba447a=_0x30b1a2[_0x16327a(0x215)],_0x412544=_0x3a6fd3[0x0];if(!_0x412544&&!_0xba447a)return console[_0x16327a(0x26d)](a34_0x478205[_0x16327a(0x226)](_0x16327a(0x255))),console['error'](_0x16327a(0x1db)),console[_0x16327a(0x26d)](_0x16327a(0x21c)),console[_0x16327a(0x26d)](_0x16327a(0x20e)),console[_0x16327a(0x26d)](_0x16327a(0x239)),console['error'](_0x16327a(0x1d8)),console[_0x16327a(0x26d)](_0x16327a(0x22f)),0x1;if(_0x412544&&_0xba447a)return console[_0x16327a(0x26d)](a34_0x478205['red'](_0x16327a(0x1c3))),0x1;try{let _0x5cdb29;if(_0xba447a)_0x5cdb29=await this[_0x16327a(0x1ee)](_0xba447a,_0x4d985d);else{if(isYamlFilePath(_0x412544))return console[_0x16327a(0x26d)](a34_0x478205['red'](_0x16327a(0x208))),console[_0x16327a(0x26d)](_0x16327a(0x25d)+_0x412544),0x1;else _0x5cdb29=await this[_0x16327a(0x1fc)](_0x412544,_0x4d985d);}return _0x52f99f[_0x16327a(0x26b)]===_0x16327a(0x269)||_0x52f99f[_0x16327a(0x26b)]===_0x16327a(0x250)?await handleSDKOutput([{'sql':_0x5cdb29}],_0x52f99f):console['log'](_0x5cdb29),0x0;}catch(_0x2d5959){if(_0x2d5959 instanceof SDKError)return console[_0x16327a(0x26d)]('Error:\x20'+_0x2d5959[_0x16327a(0x229)]),_0x2d5959[_0x16327a(0x20b)]&&console[_0x16327a(0x26d)](_0x16327a(0x1d4)+_0x2d5959[_0x16327a(0x20b)]),0x1;throw _0x2d5959;}}async[a34_0x5e2a91(0x1ee)](_0x2904a9,_0x4fb0f1){const _0x276024=a34_0x5e2a91,{options:_0x1920db,tdx:_0x5c33f8}=_0x4fb0f1;let _0x4f4bb1;try{_0x4f4bb1=await resolveYamlFilePath(_0x2904a9);}catch(_0x36bae9){throw new SDKError(ErrorCode[_0x276024(0x242)],_0x276024(0x1cb)+_0x36bae9['message']);}_0x1920db['verbose']&&console[_0x276024(0x26d)](_0x276024(0x23f)+_0x4f4bb1[_0x276024(0x243)]+'/'+_0x4f4bb1[_0x276024(0x1e8)]);const _0x40ac16=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x5c33f8[_0x276024(0x1d9)]['getSegmentSQLFromYaml'](_0x4f4bb1['content'],_0x4f4bb1['parentSegment'],_0x4f4bb1[_0x276024(0x1e8)]),{'verbose':_0x1920db[_0x276024(0x20d)]});return _0x40ac16[_0x276024(0x1dd)];}async[a34_0x5e2a91(0x1fc)](_0x5e99b1,_0x36bed0){const _0x1af934=a34_0x5e2a91,{options:_0x1ea028,tdx:_0x6a02eb}=_0x36bed0,_0x26b042=_0x1ea028[_0x1af934(0x243)],_0x1adb8c=await resolveSegmentTarget(_0x5e99b1,_0x26b042,_0x1ea028[_0x1af934(0x20d)]);_0x1ea028[_0x1af934(0x20d)]&&console[_0x1af934(0x26d)](_0x1af934(0x248)+_0x1adb8c);const _0x5f9fd0=await withSpinner(_0x1af934(0x23c)+_0x5e99b1+_0x1af934(0x246),()=>_0x6a02eb['segment'][_0x1af934(0x217)](_0x1adb8c),{'verbose':_0x1ea028['verbose']}),_0x1c27a5=_0x5f9fd0['data'];_0x1ea028[_0x1af934(0x20d)]&&(console['error'](_0x1af934(0x1d7)+_0x1c27a5['type']),console[_0x1af934(0x26d)](_0x1af934(0x253)+_0x1c27a5['parentId']));if(_0x1c27a5[_0x1af934(0x202)]===_0x1af934(0x236))throw new SDKError(ErrorCode[_0x1af934(0x242)],_0x1af934(0x1d6));if(_0x1c27a5[_0x1af934(0x202)]===_0x1af934(0x233))throw new SDKError(ErrorCode[_0x1af934(0x242)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x1c27a5[_0x1af934(0x241)])throw new SDKError(ErrorCode[_0x1af934(0x252)],_0x1af934(0x1c7));const _0x47a691=await withSpinner(_0x1af934(0x20c),()=>_0x6a02eb[_0x1af934(0x1d9)][_0x1af934(0x1c8)](_0x1c27a5[_0x1af934(0x222)],_0x1c27a5['segmentId']),{'verbose':_0x1ea028[_0x1af934(0x20d)]});return _0x47a691[_0x1af934(0x1dd)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x238);[a34_0x5e2a91(0x1de)]=a34_0x5e2a91(0x214);async['execute'](_0x230b4f){const _0x2a143a=a34_0x5e2a91,{options:_0x3d551e,args:_0xb0c699,tdx:_0x5710aa}=_0x230b4f,_0x11e0d4=_0x3d551e;if(_0xb0c699[_0x2a143a(0x1e0)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x2a143a(0x26d)](_0x2a143a(0x205)),0x1;const _0x36a000=_0xb0c699[0x0],_0x296b61=_0xb0c699[0x1];_0x11e0d4[_0x2a143a(0x20d)]&&(console[_0x2a143a(0x26d)](_0x2a143a(0x1c2)+_0x11e0d4[_0x2a143a(0x265)]),console[_0x2a143a(0x26d)](_0x2a143a(0x266)+_0x36a000),console[_0x2a143a(0x26d)](_0x2a143a(0x21b)+_0x296b61));let _0x124432;if(_0x11e0d4[_0x2a143a(0x235)]){const _0x3f0fd1=_0x11e0d4['parentFolder'],_0x56cad9=await withSpinner(_0x2a143a(0x1c6)+_0x36a000+_0x2a143a(0x246),()=>_0x5710aa[_0x2a143a(0x1d9)][_0x2a143a(0x224)](_0x36a000),{'verbose':_0x11e0d4[_0x2a143a(0x20d)]}),_0x13f3b5=_0x56cad9[_0x2a143a(0x1dd)],_0x2a295a=await withSpinner(_0x2a143a(0x228)+_0x3f0fd1+_0x2a143a(0x246),()=>_0x5710aa['segment'][_0x2a143a(0x1c9)](_0x13f3b5,_0x3f0fd1),{'verbose':_0x11e0d4[_0x2a143a(0x20d)]});_0x124432=_0x2a295a[_0x2a143a(0x1dd)],_0x11e0d4['verbose']&&console[_0x2a143a(0x26d)](_0x2a143a(0x1f8)+_0x124432);}const _0x120328={'name':_0x296b61,'description':_0x11e0d4['description'],'parentFolderId':_0x124432},_0x2ddd9a=await withSpinner(_0x2a143a(0x221)+_0x296b61+_0x2a143a(0x246),()=>_0x5710aa[_0x2a143a(0x1d9)][_0x2a143a(0x231)](_0x36a000,_0x120328),{'verbose':_0x11e0d4['verbose']}),_0x121729=_0x2ddd9a[_0x2a143a(0x1dd)];return console['error'](_0x2a143a(0x24c)+_0x121729[_0x2a143a(0x1e3)]+'\x27\x20with\x20ID:\x20'+_0x121729['id']),await handleSDKOutput([_0x121729],_0x11e0d4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x211);[a34_0x5e2a91(0x1de)]=a34_0x5e2a91(0x26c);async[a34_0x5e2a91(0x1e5)](_0xd5951d){const _0x919dc4=a34_0x5e2a91,{options:_0x6b5491,args:_0x51b410,tdx:_0x47fba1}=_0xd5951d,_0xe2673b=_0x51b410[0x0];if(!_0xe2673b)return console[_0x919dc4(0x26d)](_0x919dc4(0x25e)),console[_0x919dc4(0x26d)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x919dc4(0x26d)](_0x919dc4(0x1eb)),console[_0x919dc4(0x26d)]('Options:'),console['error'](_0x919dc4(0x22c)),console[_0x919dc4(0x26d)](_0x919dc4(0x239)),console[_0x919dc4(0x26d)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x919dc4(0x26d)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x919dc4(0x26d)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x919dc4(0x26d)](_0x919dc4(0x210)),0x1;try{const _0x3759c6=_0x6b5491[_0x919dc4(0x243)],_0x42d9d3=await resolveSegmentTarget(_0xe2673b,_0x3759c6,_0x6b5491['verbose']);_0x6b5491[_0x919dc4(0x20d)]&&console[_0x919dc4(0x26d)](_0x919dc4(0x248)+_0x42d9d3);const _0x13a61a=await withSpinner(_0x919dc4(0x23c)+_0xe2673b+_0x919dc4(0x246),()=>_0x47fba1[_0x919dc4(0x1d9)][_0x919dc4(0x217)](_0x42d9d3),{'verbose':_0x6b5491['verbose']}),_0x5273b4=_0x13a61a[_0x919dc4(0x1dd)];_0x6b5491[_0x919dc4(0x20d)]&&(console[_0x919dc4(0x26d)](_0x919dc4(0x1d7)+_0x5273b4[_0x919dc4(0x202)]),console[_0x919dc4(0x26d)]('Parent\x20ID:\x20'+_0x5273b4['parentId']),_0x5273b4['folderId']&&console[_0x919dc4(0x26d)](_0x919dc4(0x216)+_0x5273b4[_0x919dc4(0x261)]),_0x5273b4[_0x919dc4(0x241)]&&console[_0x919dc4(0x26d)](_0x919dc4(0x1f6)+_0x5273b4[_0x919dc4(0x241)]));if(_0x6b5491[_0x919dc4(0x213)]){if(_0x5273b4[_0x919dc4(0x202)]===_0x919dc4(0x236))return console[_0x919dc4(0x26d)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x5273b4[_0x919dc4(0x202)]===_0x919dc4(0x233))return console[_0x919dc4(0x26d)](_0x919dc4(0x24b)),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x5273b4[_0x919dc4(0x241)])throw new SDKError(ErrorCode[_0x919dc4(0x252)],_0x919dc4(0x1c7));const _0x599118=getConsoleNextUrl(_0x6b5491[_0x919dc4(0x265)],_0x919dc4(0x1ea)+_0x5273b4['parentId']+_0x919dc4(0x25b)+_0x5273b4[_0x919dc4(0x241)]);return console[_0x919dc4(0x26d)](a34_0x478205[_0x919dc4(0x1ca)]('β')+'\x20Opening\x20'+a34_0x478205[_0x919dc4(0x1ef)](_0x599118)),openBrowser(_0x599118),0x0;}if(_0x5273b4[_0x919dc4(0x202)]==='folder'){if(!_0x5273b4['folderId'])throw new SDKError(ErrorCode[_0x919dc4(0x200)],_0x919dc4(0x212));const _0x3fe31d=await withSpinner(_0x919dc4(0x1cd),()=>_0x47fba1['segment'][_0x919dc4(0x1fa)](_0x5273b4[_0x919dc4(0x261)]),{'verbose':_0x6b5491[_0x919dc4(0x20d)]});await handleSingleObjectOutput(_0x3fe31d['data'],_0x6b5491);}else{if(_0x5273b4[_0x919dc4(0x202)]===_0x919dc4(0x1d9)){if(!_0x5273b4[_0x919dc4(0x241)])throw new SDKError(ErrorCode[_0x919dc4(0x252)],_0x919dc4(0x1c7));const _0x48890e=await withSpinner(_0x919dc4(0x21d),()=>_0x47fba1[_0x919dc4(0x1d9)][_0x919dc4(0x1f4)](_0x5273b4['parentId'],_0x5273b4['segmentId']),{'verbose':_0x6b5491[_0x919dc4(0x20d)]}),_0x4c55a4=getConsoleNextUrl(_0x6b5491[_0x919dc4(0x265)],'/app/ps/'+_0x5273b4[_0x919dc4(0x222)]+_0x919dc4(0x25b)+_0x5273b4[_0x919dc4(0x241)]),_0xd227de=_0x48890e[_0x919dc4(0x1dd)];_0xd227de[_0x919dc4(0x1e4)]=_0x4c55a4,await handleSingleObjectOutput(_0xd227de,_0x6b5491);}else return console[_0x919dc4(0x26d)](_0x919dc4(0x1ed)),console['error'](_0x919dc4(0x234)),0x1;}return 0x0;}catch(_0x106872){if(_0x106872 instanceof SDKError)return console[_0x919dc4(0x26d)]('Error:\x20'+_0x106872[_0x919dc4(0x229)]),_0x106872[_0x919dc4(0x20b)]&&console[_0x919dc4(0x26d)](_0x919dc4(0x1d4)+_0x106872[_0x919dc4(0x20b)]),0x1;throw _0x106872;}}}function a34_0x119b(_0x590162,_0x153965){_0x590162=_0x590162-0x1c2;const _0x78c1=a34_0x78c1();let _0x119bf6=_0x78c1[_0x590162];return _0x119bf6;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a34_0x5e2a91(0x1e3)]=a34_0x5e2a91(0x24f);[a34_0x5e2a91(0x1de)]=a34_0x5e2a91(0x220);async['execute'](_0x46500a){const _0x3729c6=a34_0x5e2a91,{options:_0x2d7957,args:_0x3a2e61,tdx:_0x341ae4}=_0x46500a,_0x49e784=_0x3a2e61[0x0];if(!_0x49e784)return console[_0x3729c6(0x26d)](_0x3729c6(0x237)),console[_0x3729c6(0x26d)](_0x3729c6(0x21a)),console[_0x3729c6(0x26d)](_0x3729c6(0x25c)),console[_0x3729c6(0x26d)]('Examples:'),console['error'](_0x3729c6(0x23a)),console[_0x3729c6(0x26d)](_0x3729c6(0x268)),0x1;try{const _0x578dfe=_0x2d7957['parentSegment'],_0x11a750=await resolveSegmentTarget(_0x49e784,_0x578dfe,_0x2d7957[_0x3729c6(0x20d)]);_0x2d7957['verbose']&&console[_0x3729c6(0x26d)](_0x3729c6(0x248)+_0x11a750);const _0x722db9=await withSpinner('Resolving\x20\x27'+_0x49e784+_0x3729c6(0x246),()=>_0x341ae4['segment'][_0x3729c6(0x217)](_0x11a750),{'verbose':_0x2d7957['verbose']}),_0x24fafd=_0x722db9[_0x3729c6(0x1dd)];_0x2d7957[_0x3729c6(0x20d)]&&(console[_0x3729c6(0x26d)](_0x3729c6(0x1d7)+_0x24fafd[_0x3729c6(0x202)]),console['error'](_0x3729c6(0x253)+_0x24fafd[_0x3729c6(0x222)]));if(_0x24fafd[_0x3729c6(0x202)]===_0x3729c6(0x236))return console['error'](_0x3729c6(0x204)),console[_0x3729c6(0x26d)](_0x3729c6(0x244)),0x1;if(_0x24fafd['type']===_0x3729c6(0x233))return console[_0x3729c6(0x26d)](_0x3729c6(0x1d2)),console['error'](_0x3729c6(0x21e)),0x1;if(!_0x24fafd[_0x3729c6(0x241)])throw new SDKError(ErrorCode[_0x3729c6(0x252)],_0x3729c6(0x1c7));const _0x33240d=await withSpinner(_0x3729c6(0x20c),()=>_0x341ae4[_0x3729c6(0x1d9)]['getSegmentSQL'](_0x24fafd[_0x3729c6(0x222)],_0x24fafd['segmentId']),{'verbose':_0x2d7957[_0x3729c6(0x20d)]}),_0x3fda3b=_0x33240d['data'],_0x1c3c1b=await executeSchemaQuery(_0x3fda3b,_0x341ae4,_0x2d7957);return await handleQueryOutput(_0x1c3c1b,_0x2d7957),0x0;}catch(_0x396d44){if(_0x396d44 instanceof SDKError)return console['error'](_0x3729c6(0x1fb)+_0x396d44[_0x3729c6(0x229)]),_0x396d44[_0x3729c6(0x20b)]&&console[_0x3729c6(0x26d)](_0x3729c6(0x1d4)+_0x396d44[_0x3729c6(0x20b)]),0x1;throw _0x396d44;}}}
|
|
1
|
+
const a34_0x31dc82=a34_0x428b;(function(_0x12a14f,_0x4713e7){const _0x2111b6=a34_0x428b,_0x21a9e7=_0x12a14f();while(!![]){try{const _0x10e45b=parseInt(_0x2111b6(0x22a))/0x1*(-parseInt(_0x2111b6(0x210))/0x2)+parseInt(_0x2111b6(0x1fb))/0x3*(parseInt(_0x2111b6(0x1ce))/0x4)+-parseInt(_0x2111b6(0x21c))/0x5*(-parseInt(_0x2111b6(0x205))/0x6)+parseInt(_0x2111b6(0x20d))/0x7+parseInt(_0x2111b6(0x1f3))/0x8+-parseInt(_0x2111b6(0x213))/0x9*(parseInt(_0x2111b6(0x1c7))/0xa)+-parseInt(_0x2111b6(0x1c3))/0xb;if(_0x10e45b===_0x4713e7)break;else _0x21a9e7['push'](_0x21a9e7['shift']());}catch(_0x5283c1){_0x21a9e7['push'](_0x21a9e7['shift']());}}}(a34_0x16a3,0x9675b));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';function a34_0x16a3(){const _0xfa15b4=['Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Folder\x20reference\x20is\x20required','format','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','content','url','9763744uFPABI','folder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','message','Resolved\x20parent\x20folder\x20ID:\x20','segment','\x20folder','Target\x20path:\x20','250791eAdncj','Get\x20SQL\x20query\x20for\x20child\x20segment','Folder\x20name:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','Use:\x20tdx\x20ps\x20view','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','folderPath','parentId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Examples:','1264542NduMQZ','\x20\x20Folder\x20path:\x20','Resolving\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Show\x20child\x20segment\x20schema\x20(column\x20types)','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','web','segmentName','2771671YNdtxM','in\x20','resolveFolderId','2QUALnC','type','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','806607wuoHfJ','getSQLFromServerSegment','length','Parent\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','β\x20Found\x20','jobId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','information_schema','25ugEYKS','INVALID_ARGUMENT','β\x20Created\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:folder:list','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','parentFolder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','listFolders','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Show\x20segment\x20or\x20folder\x20details','data','processedRows','\x20[Job\x20ID:\x20','1053647flybtc','Folder\x20ID\x20missing\x20from\x20resolved\x20path','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Show\x20segment\x20folder\x20details','Usage:\x20tdx\x20sg\x20show\x20<name>','resolvePathToResource','\x20rows\x20','segment:sql','resolveParentId','Resolving\x20parent\x20segment\x20\x27','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','segmentPath','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','name','includes','segment:show','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Site:\x20','elapsedTimeMillis','\x20Opening\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20ID:\x20','execute','Parent\x20name:\x20','site','Fetching\x20folder\x20details...','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolved\x20folder\x20ID:\x20','/e/','stats','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','test','setJobId','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:create','Error:\x20Path\x20or\x20name\x20is\x20required','getSegmentSQL','Resolved\x20type:\x20','\x27\x20with\x20ID:\x20','log','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20show','β\x20Query\x20completed:\x20Processed\x20','getSegmentSQLFromYaml','json','Segment\x20ID:\x20','(root)','Fetching\x20segment\x20details...','SQL\x20query:\x0a','red','\x20\x20Full\x20path:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','SEGMENT_FOLDER_NOT_FOUND','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','error','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Resolving\x20parent\x20folder\x20\x27','10936750WVmeRo','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','cause','Fetching\x20SQL\x20from\x20rule...','10cfcMFb','Parent\x20segment:\x20','getFolder','code','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','description','getSQLFromYamlFile','4IEbZYK','Resolved:\x20','segmentId','\x20\x20Cause:\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Resolved\x20relative\x20path\x20to:\x20','segment:view','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getSegment','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parent','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','parentSegment','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','SEGMENT_NOT_FOUND','folderId','Usage:','Resolved\x20parent\x20ID:\x20','path','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','verbose','/app/ps/','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Error:\x20','fullPath','Resolving\x20path\x20\x27','Creating\x20folder\x20\x27','Fetching\x20SQL\x20for\x20segment...'];a34_0x16a3=function(){return _0xfa15b4;};return a34_0x16a3();}function a34_0x428b(_0x5ce820,_0x252f66){_0x5ce820=_0x5ce820-0x1bf;const _0x16a305=a34_0x16a3();let _0x428bf7=_0x16a305[_0x5ce820];return _0x428bf7;}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';import{openBrowser}from'../utils/process.js';import a34_0x29a598 from'chalk';async function resolveSegmentTarget(_0x38143c,_0xe862f3,_0x20ff6e){const _0x3e4173=a34_0x428b;if(isYamlFilePath(_0x38143c))try{const _0x37b539=await resolveYamlFilePath(_0x38143c);return _0x20ff6e&&(console[_0x3e4173(0x1bf)](_0x3e4173(0x23a)+_0x38143c),console[_0x3e4173(0x1bf)]('\x20\x20Parent\x20segment:\x20'+_0x37b539[_0x3e4173(0x1dc)]),console[_0x3e4173(0x1bf)]('\x20\x20Segment\x20name:\x20'+_0x37b539[_0x3e4173(0x20c)]),console[_0x3e4173(0x1bf)](_0x3e4173(0x206)+(_0x37b539[_0x3e4173(0x201)]||_0x3e4173(0x25c))),console['error'](_0x3e4173(0x260)+_0x37b539[_0x3e4173(0x1e9)])),_0x37b539[_0x3e4173(0x1e9)];}catch(_0x3d2da1){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3e4173(0x212)+_0x3d2da1[_0x3e4173(0x1f6)]);}if(!_0xe862f3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3e4173(0x22c));return _0xe862f3+'/'+_0x38143c;}export class SegmentDescribeCommand extends BaseCommand{[a34_0x31dc82(0x237)]='segment:describe';['description']=a34_0x31dc82(0x226);async['execute'](_0x10798f){const _0x2d2b61=a34_0x31dc82,{options:_0x5b91e7,args:_0x282bf1,tdx:_0x52217c}=_0x10798f,_0x50616d=_0x282bf1[0x0],_0x4a442c=!_0x50616d&&!!_0x5b91e7[_0x2d2b61(0x1dc)],_0x2aaa95=_0x50616d||_0x5b91e7[_0x2d2b61(0x1dc)];if(!_0x2aaa95)return console[_0x2d2b61(0x1bf)](_0x2d2b61(0x24f)),console[_0x2d2b61(0x1bf)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2d2b61(0x1bf)](_0x2d2b61(0x204)),console[_0x2d2b61(0x1bf)](_0x2d2b61(0x1f5)),console[_0x2d2b61(0x1bf)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x2d2b61(0x1bf)](_0x2d2b61(0x208)),console['error'](_0x2d2b61(0x1d6)),0x1;try{const _0x18c29f=_0x5b91e7[_0x2d2b61(0x235)];let _0x472f33=_0x2aaa95;!_0x4a442c&&_0x18c29f&&!_0x2aaa95[_0x2d2b61(0x238)]('/')&&(_0x472f33=_0x18c29f+'/'+_0x2aaa95,_0x5b91e7[_0x2d2b61(0x1e4)]&&console['error'](_0x2d2b61(0x1d3)+_0x472f33));const _0x29c0db=await withSpinner(_0x2d2b61(0x1ea)+_0x472f33+_0x2d2b61(0x1e6),()=>_0x52217c[_0x2d2b61(0x1f8)][_0x2d2b61(0x22f)](_0x472f33),{'verbose':_0x5b91e7['verbose']}),_0x1d81cd=_0x29c0db['data'];_0x5b91e7[_0x2d2b61(0x1e4)]&&(console[_0x2d2b61(0x1bf)](_0x2d2b61(0x251)+_0x1d81cd[_0x2d2b61(0x211)]),console[_0x2d2b61(0x1bf)](_0x2d2b61(0x216)+_0x1d81cd['parentId']),_0x1d81cd[_0x2d2b61(0x1df)]&&console[_0x2d2b61(0x1bf)](_0x2d2b61(0x241)+_0x1d81cd[_0x2d2b61(0x1df)]),_0x1d81cd[_0x2d2b61(0x1d0)]&&console[_0x2d2b61(0x1bf)](_0x2d2b61(0x25b)+_0x1d81cd[_0x2d2b61(0x1d0)]));if(_0x1d81cd['type']==='parent'){const _0x3f1064=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x52217c[_0x2d2b61(0x1f8)]['getParent'](_0x1d81cd[_0x2d2b61(0x202)]),{'verbose':_0x5b91e7['verbose']});await handleSingleObjectOutput(_0x3f1064['data'],_0x5b91e7);}else{if(_0x1d81cd[_0x2d2b61(0x211)]===_0x2d2b61(0x1f4)){if(!_0x1d81cd['folderId'])throw new SDKError(ErrorCode[_0x2d2b61(0x262)],_0x2d2b61(0x22b));const _0x2d0ac1=await withSpinner(_0x2d2b61(0x245),()=>_0x52217c[_0x2d2b61(0x1f8)][_0x2d2b61(0x1c9)](_0x1d81cd[_0x2d2b61(0x1df)]),{'verbose':_0x5b91e7[_0x2d2b61(0x1e4)]});await handleSingleObjectOutput(_0x2d0ac1[_0x2d2b61(0x227)],_0x5b91e7);}else{if(_0x1d81cd[_0x2d2b61(0x211)]==='segment'){if(!_0x1d81cd[_0x2d2b61(0x1d0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x370300=await withSpinner(_0x2d2b61(0x25d),()=>_0x52217c[_0x2d2b61(0x1f8)][_0x2d2b61(0x1d7)](_0x1d81cd[_0x2d2b61(0x202)],_0x1d81cd[_0x2d2b61(0x1d0)]),{'verbose':_0x5b91e7[_0x2d2b61(0x1e4)]});await handleSingleObjectOutput(_0x370300[_0x2d2b61(0x227)],_0x5b91e7);}}}return 0x0;}catch(_0x50f39f){if(_0x50f39f instanceof SDKError)return console[_0x2d2b61(0x1bf)](_0x2d2b61(0x1e8)+_0x50f39f[_0x2d2b61(0x1f6)]),_0x50f39f[_0x2d2b61(0x1c5)]&&console[_0x2d2b61(0x1bf)]('\x20\x20Cause:\x20'+_0x50f39f['cause']),0x1;throw _0x50f39f;}}}export class SegmentShowCommand extends BaseCommand{[a34_0x31dc82(0x237)]=a34_0x31dc82(0x239);[a34_0x31dc82(0x1cc)]=a34_0x31dc82(0x23c);async[a34_0x31dc82(0x242)](_0x645f13){const _0x1b1d6a=a34_0x31dc82,{options:_0xa00aa2,args:_0x2c1771,tdx:_0x3437af}=_0x645f13,_0x17abf6=_0x2c1771[0x0];if(!_0x17abf6)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x22e)),console['error'](_0x1b1d6a(0x255)),console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x204)),console[_0x1b1d6a(0x1bf)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x1b1d6a(0x1bf)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x32a345=_0xa00aa2['parentSegment'],_0x4d44fb=await resolveSegmentTarget(_0x17abf6,_0x32a345,_0xa00aa2[_0x1b1d6a(0x1e4)]);_0xa00aa2[_0x1b1d6a(0x1e4)]&&console['error']('Target\x20path:\x20'+_0x4d44fb);const _0x392671=await withSpinner('Resolving\x20\x27'+_0x17abf6+_0x1b1d6a(0x1e6),()=>_0x3437af[_0x1b1d6a(0x1f8)][_0x1b1d6a(0x22f)](_0x4d44fb),{'verbose':_0xa00aa2['verbose']}),_0x5a9e95=_0x392671[_0x1b1d6a(0x227)];_0xa00aa2[_0x1b1d6a(0x1e4)]&&(console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x251)+_0x5a9e95[_0x1b1d6a(0x211)]),console[_0x1b1d6a(0x1bf)]('Parent\x20ID:\x20'+_0x5a9e95[_0x1b1d6a(0x202)]));if(_0x5a9e95[_0x1b1d6a(0x211)]===_0x1b1d6a(0x1f4))return console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x1c0)),console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x1c4)),0x1;if(_0x5a9e95[_0x1b1d6a(0x211)]===_0x1b1d6a(0x1da))return console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x256)),console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x257)),0x1;if(!_0x5a9e95['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x530f2e=await withSpinner(_0x1b1d6a(0x1ec),()=>_0x3437af[_0x1b1d6a(0x1f8)][_0x1b1d6a(0x250)](_0x5a9e95[_0x1b1d6a(0x202)],_0x5a9e95['segmentId']),{'verbose':_0xa00aa2[_0x1b1d6a(0x1e4)]});let _0x23ef92=_0x530f2e[_0x1b1d6a(0x227)];const _0x3b9e21=resolveLimit(_0xa00aa2['limit'],DEFAULT_DISPLAY_LIMIT),_0x14a2ae=/\bLIMIT\s+\d+/i[_0x1b1d6a(0x24b)](_0x23ef92);!_0x14a2ae&&(_0x23ef92=_0x23ef92['trim']()['replace'](/;+$/,''),_0x23ef92='SELECT\x20*\x20FROM\x20(\x0a'+_0x23ef92+_0x1b1d6a(0x1d9)+_0x3b9e21);_0xa00aa2['verbose']&&console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x25e)+_0x23ef92);const _0x32f6e6=await withProgressSpinner('Executing\x20segment\x20query...',async _0x18587d=>{const _0x2d43c4=_0x1b1d6a,_0x1f508c=await _0x3437af['query'][_0x2d43c4(0x242)](_0x23ef92,{'catalog':'td','schema':_0x2d43c4(0x21b),'onJobId':_0x4bbf79=>{const _0x32f96f=_0x2d43c4;_0x18587d[_0x32f96f(0x24c)](_0x4bbf79);}});return _0x1f508c;},{'verbose':_0xa00aa2['verbose']}),_0x190433=_0x32f6e6[_0x1b1d6a(0x227)],_0x396b9d=_0x190433[_0x1b1d6a(0x219)]?_0x1b1d6a(0x229)+_0x190433['jobId']+']':'';return console[_0x1b1d6a(0x1bf)](_0x1b1d6a(0x258)+_0x190433['stats'][_0x1b1d6a(0x228)]['toLocaleString']()+_0x1b1d6a(0x230)+(_0x1b1d6a(0x20e)+formatElapsed(_0x190433[_0x1b1d6a(0x249)][_0x1b1d6a(0x23e)])+_0x396b9d)),await handleQueryOutput(_0x190433,_0xa00aa2),0x0;}catch(_0x5e8c1f){if(_0x5e8c1f instanceof SDKError)return console[_0x1b1d6a(0x1bf)]('β\x20Query\x20failed\x20['+_0x5e8c1f[_0x1b1d6a(0x1ca)]+']'),console['error']('\x0a'+_0x5e8c1f[_0x1b1d6a(0x1f6)]),0x1;throw _0x5e8c1f;}}}export class SegmentFolderListCommand extends BaseCommand{[a34_0x31dc82(0x237)]=a34_0x31dc82(0x220);[a34_0x31dc82(0x1cc)]=a34_0x31dc82(0x24a);async[a34_0x31dc82(0x242)](_0x263ac2){const _0x2f498f=a34_0x31dc82,{options:_0x4d92d5,args:_0x427f6c,tdx:_0x1c628e}=_0x263ac2;if(_0x427f6c['length']===0x0)return console[_0x2f498f(0x1bf)](_0x2f498f(0x21f)),console[_0x2f498f(0x1bf)](_0x2f498f(0x261)),0x1;const _0xe0951c=_0x427f6c[0x0];try{_0x4d92d5[_0x2f498f(0x1e4)]&&(console[_0x2f498f(0x1bf)](_0x2f498f(0x23d)+_0x4d92d5['site']),console['error'](_0x2f498f(0x243)+_0xe0951c));const _0x58053b=await withSpinner(_0x2f498f(0x233)+_0xe0951c+_0x2f498f(0x1e6),()=>_0x1c628e[_0x2f498f(0x1f8)]['resolveParentId'](_0xe0951c),{'verbose':_0x4d92d5[_0x2f498f(0x1e4)]}),_0x27d507=_0x58053b['data'];_0x4d92d5[_0x2f498f(0x1e4)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x27d507);const _0xa9cfd5=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0xe0951c+_0x2f498f(0x1e6),()=>_0x1c628e[_0x2f498f(0x1f8)][_0x2f498f(0x224)](_0x27d507),{'verbose':_0x4d92d5[_0x2f498f(0x1e4)]}),_0x61c65d=_0xa9cfd5['data'];return console[_0x2f498f(0x1bf)](_0x2f498f(0x218)+_0x61c65d[_0x2f498f(0x215)]+_0x2f498f(0x1f9)+(_0x61c65d[_0x2f498f(0x215)]!==0x1?'s':'')),await handleSDKOutput(_0x61c65d,_0x4d92d5),0x0;}catch(_0x2008eb){if(_0x2008eb instanceof SDKError)return console[_0x2f498f(0x1bf)](_0x2f498f(0x1e8)+_0x2008eb[_0x2f498f(0x1f6)]),_0x2008eb[_0x2f498f(0x1c5)]&&console[_0x2f498f(0x1bf)](_0x2f498f(0x1d1)+_0x2008eb['cause']),0x1;throw _0x2008eb;}}}export class SegmentFolderShowCommand extends BaseCommand{[a34_0x31dc82(0x237)]='segment:folder:show';['description']=a34_0x31dc82(0x22d);async[a34_0x31dc82(0x242)](_0x5a776c){const _0x499cc1=a34_0x31dc82,{options:_0x1c0609,args:_0x494db2,tdx:_0x24a3f1}=_0x5a776c;if(_0x494db2['length']===0x0)return console[_0x499cc1(0x1bf)](_0x499cc1(0x1ee)),console['error'](_0x499cc1(0x20a)),0x1;try{const {parentId:_0x138110,childId:_0x5e4b4a}=parseSegmentRef(_0x494db2[0x0]);_0x1c0609['verbose']&&(console['error'](_0x499cc1(0x23d)+_0x1c0609[_0x499cc1(0x244)]),console[_0x499cc1(0x1bf)]('Parent\x20name:\x20'+_0x138110),_0x5e4b4a&&console[_0x499cc1(0x1bf)](_0x499cc1(0x1fd)+_0x5e4b4a));if(!_0x5e4b4a)return console[_0x499cc1(0x1bf)](_0x499cc1(0x24d)),0x1;const _0x2f739a=await withSpinner(_0x499cc1(0x233)+_0x138110+'\x27...',()=>_0x24a3f1[_0x499cc1(0x1f8)]['resolveParentId'](_0x138110),{'verbose':_0x1c0609[_0x499cc1(0x1e4)]}),_0x4de0c6=_0x2f739a['data'];_0x1c0609[_0x499cc1(0x1e4)]&&console[_0x499cc1(0x1bf)](_0x499cc1(0x1e1)+_0x4de0c6);const _0x317ee8=await withSpinner('Resolving\x20folder\x20\x27'+_0x5e4b4a+'\x27...',()=>_0x24a3f1[_0x499cc1(0x1f8)][_0x499cc1(0x20f)](_0x4de0c6,_0x5e4b4a),{'verbose':_0x1c0609[_0x499cc1(0x1e4)]}),_0x1112d7=_0x317ee8['data'];_0x1c0609[_0x499cc1(0x1e4)]&&console[_0x499cc1(0x1bf)](_0x499cc1(0x247)+_0x1112d7);const _0x1e5277=await withSpinner('Fetching\x20folder\x20\x27'+_0x5e4b4a+_0x499cc1(0x1e6),()=>_0x24a3f1['segment'][_0x499cc1(0x1c9)](_0x1112d7),{'verbose':_0x1c0609[_0x499cc1(0x1e4)]});return await handleSDKOutput([_0x1e5277[_0x499cc1(0x227)]],_0x1c0609),0x0;}catch(_0x3216d9){if(_0x3216d9 instanceof SDKError)return console['error'](_0x499cc1(0x1e8)+_0x3216d9[_0x499cc1(0x1f6)]),_0x3216d9[_0x499cc1(0x1c5)]&&console[_0x499cc1(0x1bf)](_0x499cc1(0x1d1)+_0x3216d9[_0x499cc1(0x1c5)]),0x1;throw _0x3216d9;}}}export class SegmentSQLCommand extends BaseCommand{[a34_0x31dc82(0x237)]=a34_0x31dc82(0x231);[a34_0x31dc82(0x1cc)]=a34_0x31dc82(0x1fc);async['execute'](_0xc39215){const _0x41c9df=a34_0x31dc82,{options:_0x14b200,args:_0x1dfa81}=_0xc39215,_0xe5c904=_0x14b200,_0x32c78d=_0xe5c904[_0x41c9df(0x1e2)],_0x16c2a7=_0x1dfa81[0x0];if(!_0x16c2a7&&!_0x32c78d)return console[_0x41c9df(0x1bf)](a34_0x29a598['red'](_0x41c9df(0x1e3))),console[_0x41c9df(0x1bf)](_0x41c9df(0x1e0)),console[_0x41c9df(0x1bf)](_0x41c9df(0x236)),console['error'](_0x41c9df(0x1dd)),console['error'](_0x41c9df(0x204)),console[_0x41c9df(0x1bf)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x41c9df(0x1bf)](_0x41c9df(0x23b)),0x1;if(_0x16c2a7&&_0x32c78d)return console[_0x41c9df(0x1bf)](a34_0x29a598[_0x41c9df(0x25f)](_0x41c9df(0x1d8))),0x1;try{let _0x13a82f;if(_0x32c78d)_0x13a82f=await this[_0x41c9df(0x1cd)](_0x32c78d,_0xc39215);else{if(isYamlFilePath(_0x16c2a7))return console[_0x41c9df(0x1bf)](a34_0x29a598[_0x41c9df(0x25f)](_0x41c9df(0x1c1))),console['error'](_0x41c9df(0x225)+_0x16c2a7),0x1;else _0x13a82f=await this[_0x41c9df(0x214)](_0x16c2a7,_0xc39215);}return _0x14b200['format']===_0x41c9df(0x25a)||_0x14b200[_0x41c9df(0x1ef)]==='jsonl'?await handleSDKOutput([{'sql':_0x13a82f}],_0x14b200):console[_0x41c9df(0x253)](_0x13a82f),0x0;}catch(_0x56e687){if(_0x56e687 instanceof SDKError)return console[_0x41c9df(0x1bf)](_0x41c9df(0x1e8)+_0x56e687[_0x41c9df(0x1f6)]),_0x56e687['cause']&&console[_0x41c9df(0x1bf)](_0x41c9df(0x1d1)+_0x56e687[_0x41c9df(0x1c5)]),0x1;throw _0x56e687;}}async[a34_0x31dc82(0x1cd)](_0xcba019,_0x1bdd6b){const _0x5af065=a34_0x31dc82,{options:_0x53211c,tdx:_0x45a12f}=_0x1bdd6b;let _0x1ae52c;try{_0x1ae52c=await resolveYamlFilePath(_0xcba019);}catch(_0x282cf6){throw new SDKError(ErrorCode[_0x5af065(0x21d)],_0x5af065(0x212)+_0x282cf6[_0x5af065(0x1f6)]);}_0x53211c['verbose']&&console[_0x5af065(0x1bf)](_0x5af065(0x1cf)+_0x1ae52c[_0x5af065(0x1dc)]+'/'+_0x1ae52c[_0x5af065(0x20c)]);const _0x334ad7=await withSpinner(_0x5af065(0x1c6),()=>_0x45a12f[_0x5af065(0x1f8)][_0x5af065(0x259)](_0x1ae52c[_0x5af065(0x1f1)],_0x1ae52c[_0x5af065(0x1dc)],_0x1ae52c[_0x5af065(0x20c)]),{'verbose':_0x53211c[_0x5af065(0x1e4)]});return _0x334ad7[_0x5af065(0x227)];}async[a34_0x31dc82(0x214)](_0x486cb3,_0x2f32d8){const _0x382e0a=a34_0x31dc82,{options:_0x25c2e7,tdx:_0x318e9d}=_0x2f32d8,_0x10de19=_0x25c2e7[_0x382e0a(0x1dc)],_0x4da5ff=await resolveSegmentTarget(_0x486cb3,_0x10de19,_0x25c2e7[_0x382e0a(0x1e4)]);_0x25c2e7[_0x382e0a(0x1e4)]&&console['error'](_0x382e0a(0x1fa)+_0x4da5ff);const _0x4865ba=await withSpinner(_0x382e0a(0x207)+_0x486cb3+_0x382e0a(0x1e6),()=>_0x318e9d[_0x382e0a(0x1f8)][_0x382e0a(0x22f)](_0x4da5ff),{'verbose':_0x25c2e7[_0x382e0a(0x1e4)]}),_0x2fdcb7=_0x4865ba[_0x382e0a(0x227)];_0x25c2e7[_0x382e0a(0x1e4)]&&(console[_0x382e0a(0x1bf)](_0x382e0a(0x251)+_0x2fdcb7[_0x382e0a(0x211)]),console[_0x382e0a(0x1bf)](_0x382e0a(0x216)+_0x2fdcb7[_0x382e0a(0x202)]));if(_0x2fdcb7[_0x382e0a(0x211)]===_0x382e0a(0x1f4))throw new SDKError(ErrorCode[_0x382e0a(0x21d)],_0x382e0a(0x1d2));if(_0x2fdcb7[_0x382e0a(0x211)]===_0x382e0a(0x1da))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x382e0a(0x234));if(!_0x2fdcb7[_0x382e0a(0x1d0)])throw new SDKError(ErrorCode[_0x382e0a(0x1de)],_0x382e0a(0x1d5));const _0x244cfe=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x318e9d['segment'][_0x382e0a(0x250)](_0x2fdcb7[_0x382e0a(0x202)],_0x2fdcb7[_0x382e0a(0x1d0)]),{'verbose':_0x25c2e7[_0x382e0a(0x1e4)]});return _0x244cfe[_0x382e0a(0x227)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a34_0x31dc82(0x237)]=a34_0x31dc82(0x24e);[a34_0x31dc82(0x1cc)]='Create\x20segment\x20folder\x20for\x20organization';async[a34_0x31dc82(0x242)](_0x1e8a22){const _0x3508fd=a34_0x31dc82,{options:_0x249235,args:_0x580a6a,tdx:_0xa604cb}=_0x1e8a22,_0x23b305=_0x249235;if(_0x580a6a['length']<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x3508fd(0x1bf)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x4bf76a=_0x580a6a[0x0],_0x157546=_0x580a6a[0x1];_0x23b305[_0x3508fd(0x1e4)]&&(console['error']('Site:\x20'+_0x23b305[_0x3508fd(0x244)]),console[_0x3508fd(0x1bf)](_0x3508fd(0x1c8)+_0x4bf76a),console[_0x3508fd(0x1bf)](_0x3508fd(0x1fd)+_0x157546));let _0x34b849;if(_0x23b305[_0x3508fd(0x222)]){const _0x1169c7=_0x23b305[_0x3508fd(0x222)],_0x10a312=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4bf76a+'\x27...',()=>_0xa604cb[_0x3508fd(0x1f8)][_0x3508fd(0x232)](_0x4bf76a),{'verbose':_0x23b305['verbose']}),_0x5ebf72=_0x10a312[_0x3508fd(0x227)],_0x129aeb=await withSpinner(_0x3508fd(0x1c2)+_0x1169c7+_0x3508fd(0x1e6),()=>_0xa604cb[_0x3508fd(0x1f8)][_0x3508fd(0x20f)](_0x5ebf72,_0x1169c7),{'verbose':_0x23b305[_0x3508fd(0x1e4)]});_0x34b849=_0x129aeb[_0x3508fd(0x227)],_0x23b305[_0x3508fd(0x1e4)]&&console[_0x3508fd(0x1bf)](_0x3508fd(0x1f7)+_0x34b849);}const _0x3b97df={'name':_0x157546,'description':_0x23b305[_0x3508fd(0x1cc)],'parentFolderId':_0x34b849},_0x41b0ff=await withSpinner(_0x3508fd(0x1eb)+_0x157546+_0x3508fd(0x1e6),()=>_0xa604cb[_0x3508fd(0x1f8)]['createFolder'](_0x4bf76a,_0x3b97df),{'verbose':_0x23b305[_0x3508fd(0x1e4)]}),_0x4c5260=_0x41b0ff[_0x3508fd(0x227)];return console['error'](_0x3508fd(0x21e)+_0x4c5260[_0x3508fd(0x237)]+_0x3508fd(0x252)+_0x4c5260['id']),await handleSDKOutput([_0x4c5260],_0x23b305),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a34_0x31dc82(0x1d4);[a34_0x31dc82(0x1cc)]=a34_0x31dc82(0x1fe);async[a34_0x31dc82(0x242)](_0x15a58b){const _0x5e8044=a34_0x31dc82,{options:_0x410800,args:_0x170ccb,tdx:_0x388653}=_0x15a58b,_0x434929=_0x170ccb[0x0];if(!_0x434929)return console[_0x5e8044(0x1bf)](_0x5e8044(0x203)),console[_0x5e8044(0x1bf)](_0x5e8044(0x246)),console[_0x5e8044(0x1bf)](_0x5e8044(0x1e7)),console[_0x5e8044(0x1bf)]('Options:'),console[_0x5e8044(0x1bf)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x5e8044(0x204)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x5e8044(0x1bf)](_0x5e8044(0x263)),console['error'](_0x5e8044(0x21a)),console[_0x5e8044(0x1bf)](_0x5e8044(0x1db)),0x1;try{const _0xacd31b=_0x410800[_0x5e8044(0x1dc)],_0x363667=await resolveSegmentTarget(_0x434929,_0xacd31b,_0x410800[_0x5e8044(0x1e4)]);_0x410800[_0x5e8044(0x1e4)]&&console[_0x5e8044(0x1bf)](_0x5e8044(0x1fa)+_0x363667);const _0x21fb7e=await withSpinner('Resolving\x20\x27'+_0x434929+'\x27...',()=>_0x388653[_0x5e8044(0x1f8)][_0x5e8044(0x22f)](_0x363667),{'verbose':_0x410800[_0x5e8044(0x1e4)]}),_0x472097=_0x21fb7e[_0x5e8044(0x227)];_0x410800[_0x5e8044(0x1e4)]&&(console[_0x5e8044(0x1bf)](_0x5e8044(0x251)+_0x472097[_0x5e8044(0x211)]),console[_0x5e8044(0x1bf)](_0x5e8044(0x216)+_0x472097[_0x5e8044(0x202)]),_0x472097[_0x5e8044(0x1df)]&&console['error'](_0x5e8044(0x241)+_0x472097['folderId']),_0x472097[_0x5e8044(0x1d0)]&&console[_0x5e8044(0x1bf)](_0x5e8044(0x25b)+_0x472097[_0x5e8044(0x1d0)]));if(_0x410800[_0x5e8044(0x20b)]){if(_0x472097['type']==='folder')return console['error'](_0x5e8044(0x1f0)),0x1;if(_0x472097['type']==='parent')return console[_0x5e8044(0x1bf)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5e8044(0x1bf)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x472097['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x7d2789=getConsoleNextUrl(_0x410800[_0x5e8044(0x244)],_0x5e8044(0x1e5)+_0x472097[_0x5e8044(0x202)]+_0x5e8044(0x248)+_0x472097[_0x5e8044(0x1d0)]);return console[_0x5e8044(0x1bf)](a34_0x29a598[_0x5e8044(0x254)]('β')+_0x5e8044(0x23f)+a34_0x29a598['cyan'](_0x7d2789)),openBrowser(_0x7d2789),0x0;}if(_0x472097['type']===_0x5e8044(0x1f4)){if(!_0x472097['folderId'])throw new SDKError(ErrorCode[_0x5e8044(0x262)],_0x5e8044(0x22b));const _0x496d6c=await withSpinner(_0x5e8044(0x245),()=>_0x388653[_0x5e8044(0x1f8)][_0x5e8044(0x1c9)](_0x472097['folderId']),{'verbose':_0x410800['verbose']});await handleSingleObjectOutput(_0x496d6c['data'],_0x410800);}else{if(_0x472097['type']==='segment'){if(!_0x472097[_0x5e8044(0x1d0)])throw new SDKError(ErrorCode[_0x5e8044(0x1de)],_0x5e8044(0x1d5));const _0x3275a6=await withSpinner(_0x5e8044(0x25d),()=>_0x388653[_0x5e8044(0x1f8)][_0x5e8044(0x1d7)](_0x472097[_0x5e8044(0x202)],_0x472097[_0x5e8044(0x1d0)]),{'verbose':_0x410800[_0x5e8044(0x1e4)]}),_0x4cc02a=getConsoleNextUrl(_0x410800[_0x5e8044(0x244)],_0x5e8044(0x1e5)+_0x472097['parentId']+_0x5e8044(0x248)+_0x472097[_0x5e8044(0x1d0)]),_0x595ce0=_0x3275a6[_0x5e8044(0x227)];_0x595ce0[_0x5e8044(0x1f2)]=_0x4cc02a,await handleSingleObjectOutput(_0x595ce0,_0x410800);}else return console[_0x5e8044(0x1bf)](_0x5e8044(0x240)),console[_0x5e8044(0x1bf)](_0x5e8044(0x1ff)),0x1;}return 0x0;}catch(_0x351aad){if(_0x351aad instanceof SDKError)return console['error'](_0x5e8044(0x1e8)+_0x351aad['message']),_0x351aad['cause']&&console[_0x5e8044(0x1bf)](_0x5e8044(0x1d1)+_0x351aad[_0x5e8044(0x1c5)]),0x1;throw _0x351aad;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a34_0x31dc82(0x237)]='segment:desc';[a34_0x31dc82(0x1cc)]=a34_0x31dc82(0x209);async['execute'](_0x1a94b1){const _0x3c8ada=a34_0x31dc82,{options:_0x3772bb,args:_0x11ec85,tdx:_0x44852}=_0x1a94b1,_0x14319e=_0x11ec85[0x0];if(!_0x14319e)return console[_0x3c8ada(0x1bf)](_0x3c8ada(0x200)),console[_0x3c8ada(0x1bf)](_0x3c8ada(0x217)),console[_0x3c8ada(0x1bf)](_0x3c8ada(0x221)),console[_0x3c8ada(0x1bf)](_0x3c8ada(0x204)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x3c8ada(0x1bf)](_0x3c8ada(0x223)),0x1;try{const _0x9ffd38=_0x3772bb[_0x3c8ada(0x1dc)],_0x43947d=await resolveSegmentTarget(_0x14319e,_0x9ffd38,_0x3772bb[_0x3c8ada(0x1e4)]);_0x3772bb[_0x3c8ada(0x1e4)]&&console[_0x3c8ada(0x1bf)](_0x3c8ada(0x1fa)+_0x43947d);const _0x4516ff=await withSpinner(_0x3c8ada(0x207)+_0x14319e+_0x3c8ada(0x1e6),()=>_0x44852[_0x3c8ada(0x1f8)][_0x3c8ada(0x22f)](_0x43947d),{'verbose':_0x3772bb[_0x3c8ada(0x1e4)]}),_0x45806d=_0x4516ff[_0x3c8ada(0x227)];_0x3772bb[_0x3c8ada(0x1e4)]&&(console[_0x3c8ada(0x1bf)]('Resolved\x20type:\x20'+_0x45806d[_0x3c8ada(0x211)]),console[_0x3c8ada(0x1bf)](_0x3c8ada(0x216)+_0x45806d['parentId']));if(_0x45806d[_0x3c8ada(0x211)]===_0x3c8ada(0x1f4))return console[_0x3c8ada(0x1bf)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x3c8ada(0x1bf)](_0x3c8ada(0x1ed)),0x1;if(_0x45806d[_0x3c8ada(0x211)]==='parent')return console[_0x3c8ada(0x1bf)](_0x3c8ada(0x1cb)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x45806d[_0x3c8ada(0x1d0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5d7835=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x44852[_0x3c8ada(0x1f8)][_0x3c8ada(0x250)](_0x45806d['parentId'],_0x45806d['segmentId']),{'verbose':_0x3772bb['verbose']}),_0x5b9b85=_0x5d7835[_0x3c8ada(0x227)],_0x4b3ff7=await executeSchemaQuery(_0x5b9b85,_0x44852,_0x3772bb);return await handleQueryOutput(_0x4b3ff7,_0x3772bb),0x0;}catch(_0x1b16db){if(_0x1b16db instanceof SDKError)return console[_0x3c8ada(0x1bf)](_0x3c8ada(0x1e8)+_0x1b16db[_0x3c8ada(0x1f6)]),_0x1b16db[_0x3c8ada(0x1c5)]&&console[_0x3c8ada(0x1bf)](_0x3c8ada(0x1d1)+_0x1b16db['cause']),0x1;throw _0x1b16db;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x5e58(_0x51ea04,_0x127ed6){_0x51ea04=_0x51ea04-0x1cc;const _0x27420b=a35_0x2742();let _0x5e58bb=_0x27420b[_0x51ea04];return _0x5e58bb;}const a35_0x292d5d=a35_0x5e58;(function(_0x43c716,_0x3356bd){const _0x1053a9=a35_0x5e58,_0x24b0a5=_0x43c716();while(!![]){try{const _0x3cd127=parseInt(_0x1053a9(0x1e0))/0x1*(-parseInt(_0x1053a9(0x1eb))/0x2)+parseInt(_0x1053a9(0x1d7))/0x3*(-parseInt(_0x1053a9(0x1f0))/0x4)+-parseInt(_0x1053a9(0x1f2))/0x5+-parseInt(_0x1053a9(0x1f1))/0x6+-parseInt(_0x1053a9(0x1fc))/0x7+-parseInt(_0x1053a9(0x1dc))/0x8+-parseInt(_0x1053a9(0x1db))/0x9*(-parseInt(_0x1053a9(0x1ee))/0xa);if(_0x3cd127===_0x3356bd)break;else _0x24b0a5['push'](_0x24b0a5['shift']());}catch(_0x500b64){_0x24b0a5['push'](_0x24b0a5['shift']());}}}(a35_0x2742,0xe5db0));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';import a35_0x842d61 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a35_0x292d5d(0x1e4)]=a35_0x292d5d(0x1ce);[a35_0x292d5d(0x1f4)]=a35_0x292d5d(0x1f8);async[a35_0x292d5d(0x1e8)](_0x172446){const _0x4ba574=a35_0x292d5d;console[_0x4ba574(0x1f9)](a35_0x842d61[_0x4ba574(0x1de)]('β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a35_0x842d61[_0x4ba574(0x1de)](_0x4ba574(0x1e1)));const {options:_0x365a01,args:_0x35d533,tdx:_0x18353a}=_0x172446,_0x3cf102=_0x365a01;if(_0x35d533[_0x4ba574(0x1da)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x4ba574(0x1f9)](_0x4ba574(0x1ea)),console[_0x4ba574(0x1f9)](_0x4ba574(0x1d3)),console[_0x4ba574(0x1f9)](_0x4ba574(0x1fb)),console[_0x4ba574(0x1f9)](_0x4ba574(0x1e9)),console[_0x4ba574(0x1f9)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4c0cd1=_0x35d533[0x0],_0x10fc6f=_0x365a01[_0x4ba574(0x1cd)];let _0x1447f1=_0x4c0cd1;_0x10fc6f&&!_0x4c0cd1[_0x4ba574(0x1cf)]('/')&&(_0x1447f1=_0x10fc6f+'/'+_0x4c0cd1,_0x3cf102[_0x4ba574(0x1e7)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x1447f1));const _0x1f785b=parsePath(_0x1447f1);if(_0x1f785b[_0x4ba574(0x1df)][_0x4ba574(0x1da)]<0x2)return console[_0x4ba574(0x1f9)](_0x4ba574(0x1f3)),console[_0x4ba574(0x1f9)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x5a232c=_0x1f785b['segments'][0x0],_0x2944d4=getBaseName(_0x1447f1),_0x1b6cbf=getParentPath(_0x1447f1);_0x3cf102[_0x4ba574(0x1e7)]&&(console[_0x4ba574(0x1f9)](_0x4ba574(0x1e3)+_0x3cf102[_0x4ba574(0x1d8)]),console[_0x4ba574(0x1f9)](_0x4ba574(0x1fd)+_0x1447f1),console[_0x4ba574(0x1f9)]('Parent:\x20'+_0x5a232c),console[_0x4ba574(0x1f9)](_0x4ba574(0x1e5)+_0x2944d4),console[_0x4ba574(0x1f9)](_0x4ba574(0x1ef)+_0x1b6cbf));const _0x1a89de=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5a232c+'\x27...',()=>_0x18353a[_0x4ba574(0x1fe)][_0x4ba574(0x1d0)](_0x5a232c),{'verbose':_0x3cf102['verbose']}),_0x23839=_0x1a89de[_0x4ba574(0x1e2)];let _0x36ada9;if(_0x1f785b[_0x4ba574(0x1df)][_0x4ba574(0x1da)]>0x2){const _0x4c4b64=await withSpinner(_0x4ba574(0x1d6)+_0x1b6cbf+_0x4ba574(0x1d5),()=>_0x18353a['segment']['resolvePathToResource'](_0x1b6cbf),{'verbose':_0x3cf102[_0x4ba574(0x1e7)]}),_0x4b73d6=_0x4c4b64['data'];if(_0x4b73d6[_0x4ba574(0x1ed)]!=='folder'&&_0x4b73d6[_0x4ba574(0x1ed)]!=='parent')return console[_0x4ba574(0x1f9)](_0x4ba574(0x1dd)),0x1;_0x36ada9=_0x4b73d6[_0x4ba574(0x1d4)];}else{if(_0x3cf102[_0x4ba574(0x1f7)]){const _0x21afb7=await withSpinner('Resolving\x20folder\x20\x27'+_0x3cf102[_0x4ba574(0x1f7)]+_0x4ba574(0x1d5),()=>_0x18353a[_0x4ba574(0x1fe)][_0x4ba574(0x1d2)](_0x23839,_0x3cf102[_0x4ba574(0x1f7)]),{'verbose':_0x3cf102[_0x4ba574(0x1e7)]});_0x36ada9=_0x21afb7[_0x4ba574(0x1e2)];}}_0x3cf102[_0x4ba574(0x1e7)]&&_0x36ada9&&console[_0x4ba574(0x1f9)](_0x4ba574(0x1f5)+_0x36ada9);const _0xe52769=await loadJSONFromOptions(_0x3cf102['rule'],_0x3cf102['ruleFile']),_0x303a4b={'name':_0x2944d4,'description':_0x3cf102[_0x4ba574(0x1f4)],'rule':_0xe52769,'kind':_0x3cf102[_0x4ba574(0x1d1)]!==undefined?parseInt(_0x3cf102[_0x4ba574(0x1d1)],0xa):undefined,'isVisible':_0x3cf102[_0x4ba574(0x1cc)]?![]:undefined,'segmentFolderId':_0x36ada9,'countPopulation':_0x3cf102[_0x4ba574(0x1ec)]?![]:undefined},_0x27d223=await withSpinner(_0x4ba574(0x1ff)+_0x2944d4+_0x4ba574(0x1d5),()=>_0x18353a['segment'][_0x4ba574(0x1e6)](_0x23839,_0x303a4b),{'verbose':_0x3cf102[_0x4ba574(0x1e7)]}),_0x159f56=_0x27d223[_0x4ba574(0x1e2)];return console[_0x4ba574(0x1f9)](_0x4ba574(0x1d9)+_0x159f56['name']+_0x4ba574(0x1f6)+_0x159f56['id']),_0x1447f1!==_0x4c0cd1&&console[_0x4ba574(0x1f9)](_0x4ba574(0x1fa)+_0x1447f1),await handleSDKOutput([_0x159f56],_0x3cf102),0x0;}}function a35_0x2742(){const _0x4a34c7=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','3977638DDoYvk','Target\x20path:\x20','segment','Creating\x20segment\x20\x27','invisible','segmentPath','segment:create','includes','resolveParentId','kind','resolveFolderId','Examples:','folderId','\x27...','Resolving\x20folder\x20path\x20\x27','33171xUJTaH','site','β\x20Created\x20segment\x20\x27','length','37152063SscaVL','1171464AwASDJ','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','yellow','segments','9343XwrdMj','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','data','Site:\x20','name','Segment\x20name:\x20','createSegment','verbose','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','232PLrQHb','noCountPopulation','type','10QgTqgG','Parent\x20path:\x20','148hdPRso','3396360LBJRVB','2064475eGHPYw','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','description','Resolved\x20folder\x20ID:\x20','\x27\x20with\x20ID:\x20','folder','Create\x20child\x20segment\x20with\x20filtering\x20rules','error','\x20\x20\x20Path:\x20'];a35_0x2742=function(){return _0x4a34c7;};return a35_0x2742();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x4cc498=a36_0x1621;(function(_0x2397a4,_0x108e58){const _0x100dc6=a36_0x1621,_0x3c7cea=_0x2397a4();while(!![]){try{const _0x152465=-parseInt(_0x100dc6(0xaa))/0x1+parseInt(_0x100dc6(0x9f))/0x2+-parseInt(_0x100dc6(0xba))/0x3+-parseInt(_0x100dc6(0xab))/0x4*(-parseInt(_0x100dc6(0xbb))/0x5)+parseInt(_0x100dc6(0xa3))/0x6*(-parseInt(_0x100dc6(0xb9))/0x7)+-parseInt(_0x100dc6(0xa5))/0x8+parseInt(_0x100dc6(0xb2))/0x9*(parseInt(_0x100dc6(0xb6))/0xa);if(_0x152465===_0x108e58)break;else _0x3c7cea['push'](_0x3c7cea['shift']());}catch(_0x3ccc5d){_0x3c7cea['push'](_0x3c7cea['shift']());}}}(a36_0x76ac,0x8dc88));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x1621(_0x87f3a7,_0x221b88){_0x87f3a7=_0x87f3a7-0x9f;const _0x76acda=a36_0x76ac();let _0x162111=_0x76acda[_0x87f3a7];return _0x162111;}function a36_0x76ac(){const _0x1fcaab=['1198924HEuNLL','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:fields','\x20field','length','error','name','24894153jyuxgr','segment','json','verbose','10rxIXkt','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','execute','239785ZPofNq','3360291SkrpGw','10YicsDL','Listing\x20fields\x20for\x20\x27','368548syPnDy','Parent\x20segment:\x20','jsonl','\x27...','6BDhHxa','description','8994496LwMOMW','site','data','parentSegment','Error:\x20Parent\x20segment\x20name\x20is\x20required','690345OhrBMx'];a36_0x76ac=function(){return _0x1fcaab;};return a36_0x76ac();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a36_0x4cc498(0xb1)]=a36_0x4cc498(0xad);[a36_0x4cc498(0xa4)]='List\x20available\x20fields\x20for\x20segmentation';async[a36_0x4cc498(0xb8)](_0x13139c){const _0x5d34b3=a36_0x4cc498,{options:_0x44642b,args:_0x22e433,tdx:_0xadbaf9}=_0x13139c,_0x568629=_0x22e433[0x0]||_0x44642b[_0x5d34b3(0xa8)];if(!_0x568629)return console[_0x5d34b3(0xb0)](_0x5d34b3(0xa9)),console[_0x5d34b3(0xb0)](_0x5d34b3(0xb7)),console[_0x5d34b3(0xb0)](_0x5d34b3(0xac)),0x1;_0x44642b['verbose']&&(console[_0x5d34b3(0xb0)]('Site:\x20'+_0x44642b[_0x5d34b3(0xa6)]),console[_0x5d34b3(0xb0)](_0x5d34b3(0xa0)+_0x568629));const _0x2af58e=await withSpinner(_0x5d34b3(0xbc)+_0x568629+_0x5d34b3(0xa2),()=>_0xadbaf9[_0x5d34b3(0xb3)]['listFields'](_0x568629),{'verbose':_0x44642b[_0x5d34b3(0xb5)]}),_0x8d4a31=_0x2af58e[_0x5d34b3(0xa7)];console[_0x5d34b3(0xb0)]('β\x20Found\x20'+_0x8d4a31[_0x5d34b3(0xaf)]+_0x5d34b3(0xae)+(_0x8d4a31[_0x5d34b3(0xaf)]!==0x1?'s':''));if(_0x44642b[_0x5d34b3(0xb4)]||_0x44642b[_0x5d34b3(0xa1)])return await handleSDKOutput(_0x8d4a31,_0x44642b),0x0;return displayFieldsHumanReadable(_0x8d4a31,_0x568629),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x27f74c=a37_0x1223;(function(_0xc77cf8,_0x353337){const _0x44933d=a37_0x1223,_0x341cf1=_0xc77cf8();while(!![]){try{const _0x395412=-parseInt(_0x44933d(0x21b))/0x1+-parseInt(_0x44933d(0x230))/0x2*(parseInt(_0x44933d(0x210))/0x3)+-parseInt(_0x44933d(0x244))/0x4*(parseInt(_0x44933d(0x226))/0x5)+-parseInt(_0x44933d(0x20a))/0x6+parseInt(_0x44933d(0x21a))/0x7*(parseInt(_0x44933d(0x22d))/0x8)+parseInt(_0x44933d(0x227))/0x9*(-parseInt(_0x44933d(0x21f))/0xa)+-parseInt(_0x44933d(0x243))/0xb*(-parseInt(_0x44933d(0x221))/0xc);if(_0x395412===_0x353337)break;else _0x341cf1['push'](_0x341cf1['shift']());}catch(_0x52f482){_0x341cf1['push'](_0x341cf1['shift']());}}}(a37_0x2e71,0x54f58));import{BaseCommand}from'./command.js';function a37_0x1223(_0x2927ab,_0x57bb31){_0x2927ab=_0x2927ab-0x1f2;const _0x2e7126=a37_0x2e71();let _0x1223fd=_0x2e7126[_0x2927ab];return _0x1223fd;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a37_0x40bb03 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a37_0x3fd385 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a37_0x27f74c(0x1fc)]=a37_0x27f74c(0x23f);[a37_0x27f74c(0x231)]=a37_0x27f74c(0x21d);async['execute'](_0x346e04){const _0x9bce40=a37_0x27f74c,{options:_0x3b2c1e,args:_0x12fbe4,tdx:_0x39f512}=_0x346e04,_0xbe787b=_0x3b2c1e,_0x4c4558=await resolveTarget({'arg':_0x12fbe4[0x0],'contextParent':_0x3b2c1e[_0x9bce40(0x224)],'cwd':process[_0x9bce40(0x235)]()});if(!isSuccessfulResolution(_0x4c4558))return _0x4c4558[_0x9bce40(0x204)]===_0x9bce40(0x222)?(console[_0x9bce40(0x207)](a37_0x40bb03[_0x9bce40(0x225)](_0x9bce40(0x20b))),console['error']('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)'),console[_0x9bce40(0x207)](_0x9bce40(0x214)),console['error'](_0x9bce40(0x215))):(console['error'](a37_0x40bb03[_0x9bce40(0x212)]('Error:\x20'+_0x4c4558['message']+'\x0a')),_0x4c4558[_0x9bce40(0x22b)]&&console[_0x9bce40(0x207)](a37_0x40bb03[_0x9bce40(0x1f9)](_0x4c4558[_0x9bce40(0x22b)]))),0x1;const _0x260f6d=_0x4c4558['parentName'],_0x3a9e8c=_0x4c4558[_0x9bce40(0x202)],_0x360d2d=_0x4c4558['type']===_0x9bce40(0x213)?_0x4c4558[_0x9bce40(0x238)]:undefined;_0xbe787b[_0x9bce40(0x23c)]&&(console['error'](_0x9bce40(0x23a)+_0xbe787b[_0x9bce40(0x1fe)]),console[_0x9bce40(0x207)](_0x9bce40(0x216)+_0x260f6d),_0x360d2d&&console[_0x9bce40(0x207)](_0x9bce40(0x1f2)+_0x360d2d));const _0x1f8d07=await withProgressSpinner(_0x9bce40(0x206)+_0x260f6d+_0x9bce40(0x1f4),_0x17bb1d=>_0x39f512['segment'][_0x9bce40(0x23e)](_0x260f6d,{'targetDir':_0x3a9e8c,'targetResourceName':_0x360d2d,'verbose':_0xbe787b[_0x9bce40(0x23c)],'progress':{'update':_0x3ccaa6=>{const _0x17bed7=_0x9bce40;_0x17bb1d[_0x17bed7(0x20f)](_0x3ccaa6),_0xbe787b[_0x17bed7(0x23c)]&&console[_0x17bed7(0x207)]('\x20\x20'+_0x3ccaa6);}}}),{'verbose':_0xbe787b[_0x9bce40(0x23c)]}),_0x5b8822=_0x1f8d07[_0x9bce40(0x23d)];if(_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x217)]===0x0&&_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x205)]===0x0)return console[_0x9bce40(0x207)](a37_0x40bb03[_0x9bce40(0x225)](_0x9bce40(0x219)+_0x5b8822[_0x9bce40(0x20d)]+'\x27')),0x0;const _0x1b7d84=_0x5b8822[_0x9bce40(0x223)]['filter'](_0x7d90d7=>_0x7d90d7[_0x9bce40(0x203)]),_0x500f8d=_0x5b8822['files'][_0x9bce40(0x240)](_0x1ee0e3=>!_0x1ee0e3[_0x9bce40(0x203)]&&_0x1ee0e3[_0x9bce40(0x239)]),_0x374845=_0x5b8822[_0x9bce40(0x223)][_0x9bce40(0x240)](_0x14f8f1=>!_0x14f8f1['isNew']&&!_0x14f8f1['hasChanges']);console['error'](_0x9bce40(0x23b)+_0x5b8822[_0x9bce40(0x20d)]+'\x27:'),console['error'](_0x9bce40(0x22e)+a37_0x40bb03[_0x9bce40(0x1f9)](_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x217)]+'\x20segments')+_0x9bce40(0x1fb)+a37_0x40bb03[_0x9bce40(0x1f9)](_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x22a)]+_0x9bce40(0x233)));if(_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x205)]>0x0){const _0x811ce8=_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x1fd)]>_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x205)]?'\x20('+_0x5b8822[_0x9bce40(0x242)][_0x9bce40(0x1fd)]+_0x9bce40(0x1ff):'';console[_0x9bce40(0x207)](_0x9bce40(0x234)+a37_0x40bb03[_0x9bce40(0x1f9)](_0x5b8822['counts']['journeys']+_0x9bce40(0x20c))+a37_0x40bb03[_0x9bce40(0x21c)](_0x811ce8));}console[_0x9bce40(0x207)]('\x20\x20'+a37_0x40bb03[_0x9bce40(0x1fa)]('+\x20'+_0x1b7d84['length']+'\x20new\x20files')),console['error']('\x20\x20'+a37_0x40bb03['yellow']('~\x20'+_0x500f8d['length']+_0x9bce40(0x232))),console['error']('\x20\x20'+a37_0x40bb03[_0x9bce40(0x21c)]('=\x20'+_0x374845[_0x9bce40(0x21e)]+_0x9bce40(0x20e))),console[_0x9bce40(0x207)](_0x9bce40(0x228)+a37_0x40bb03[_0x9bce40(0x1f9)](_0x5b8822['targetDir'])+'\x0a');if(_0x500f8d[_0x9bce40(0x21e)]>0x0)for(const _0x4f10e9 of _0x500f8d){console[_0x9bce40(0x207)](_0x9bce40(0x229)+_0x4f10e9['relativePath']+'\x27:'),console['error']('β'[_0x9bce40(0x1f7)](0x3c)),console[_0x9bce40(0x207)](_0x4f10e9[_0x9bce40(0x218)]),console[_0x9bce40(0x207)]('β'['repeat'](0x3c));}if(_0xbe787b[_0x9bce40(0x1f3)])return console[_0x9bce40(0x207)](a37_0x40bb03[_0x9bce40(0x225)](_0x9bce40(0x201))),0x0;if(_0x1b7d84[_0x9bce40(0x21e)]===0x0&&_0x500f8d[_0x9bce40(0x21e)]===0x0)return console[_0x9bce40(0x207)](a37_0x40bb03['green'](_0x9bce40(0x237))),saveSessionContext({'parent_segment':_0x5b8822[_0x9bce40(0x20d)]},_0xbe787b['session']),console[_0x9bce40(0x207)](a37_0x40bb03[_0x9bce40(0x1fa)](_0x9bce40(0x220)+a37_0x40bb03[_0x9bce40(0x21c)]('parent_segment')+_0x9bce40(0x208)+a37_0x40bb03[_0x9bce40(0x1f9)](_0x5b8822[_0x9bce40(0x20d)]))),0x0;if(!_0xbe787b['yes']){if(!isInteractive())return console['error'](a37_0x40bb03[_0x9bce40(0x212)](_0x9bce40(0x1f5)),_0x9bce40(0x200)),console[_0x9bce40(0x207)](a37_0x40bb03[_0x9bce40(0x21c)](_0x9bce40(0x236))),0x1;const _0x46ac4c=await confirmKey('Write\x20'+(_0x1b7d84['length']+_0x500f8d[_0x9bce40(0x21e)])+_0x9bce40(0x1f6));if(!_0x46ac4c)return console[_0x9bce40(0x207)](a37_0x40bb03[_0x9bce40(0x225)](_0x9bce40(0x22f)),_0x9bce40(0x209)),0x1;}for(const _0x5e607f of _0x5b8822[_0x9bce40(0x223)]){if(_0x5e607f[_0x9bce40(0x203)]||_0x5e607f[_0x9bce40(0x239)]){const _0x14d04e=a37_0x3fd385['dirname'](_0x5e607f[_0x9bce40(0x22c)]);!existsSync(_0x14d04e)&&mkdirSync(_0x14d04e,{'recursive':!![]}),writeFileSync(_0x5e607f[_0x9bce40(0x22c)],_0x5e607f['content'],'utf-8');}}return console[_0x9bce40(0x207)](a37_0x40bb03['green'](_0x9bce40(0x241)+(_0x1b7d84[_0x9bce40(0x21e)]+_0x500f8d[_0x9bce40(0x21e)])+'\x20files\x20to\x20'+_0x5b8822['targetDir'])),saveSessionContext({'parent_segment':_0x5b8822['parentName']},_0xbe787b[_0x9bce40(0x211)]),console['error'](a37_0x40bb03[_0x9bce40(0x1fa)](_0x9bce40(0x220)+a37_0x40bb03[_0x9bce40(0x21c)](_0x9bce40(0x1f8))+'\x20=\x20'+a37_0x40bb03['cyan'](_0x5b8822[_0x9bce40(0x20d)]))),0x0;}}function a37_0x2e71(){const _0x1747b9=['dim','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','length','93430XxJPvI','β\x20Context\x20set:\x20','24348mJBamJ','no_parent','files','parentSegment','yellow','5IxOdIm','9iJRtjQ','\x20\x20Target:\x20','\x0aChanges\x20to\x20\x27','activations','helpText','absolutePath','2640152KSZMSI','\x20\x20π―\x20','Aborted.','10QjLkkG','description','\x20changed\x20files','\x20activations','\x20\x20πΊοΈ\x20\x20','cwd','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','β\x20All\x20files\x20are\x20up\x20to\x20date','resourceName','hasChanges','Site:\x20','\x0aPull\x20summary\x20for\x20\x27','verbose','data','pullSegments','segment:pull','filter','β\x20Pulled\x20','counts','6182IjBjCh','2267372WDpgzC','Target\x20resource:\x20','dryRun','\x27...','\x0aError:','\x20files?','repeat','parent_segment','cyan','green','\x20with\x20','name','journeyVersions','site','\x20versions)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','targetDir','isNew','errorCode','journeys','Pulling\x20segments\x20from\x20\x27','error','\x20=\x20','-\x20no\x20files\x20written','1989630mSEuEe','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20journeys','parentName','\x20unchanged\x20files','setPhase','4254PMwfaI','session','red','file','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Parent\x20segment:\x20','segments','diff','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','7HIIoKP','207444csyDit'];a37_0x2e71=function(){return _0x1747b9;};return a37_0x2e71();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a38_0x5ab5(_0x28c2e2,_0x1f2dfe){_0x28c2e2=_0x28c2e2-0x1d4;const _0x4c2826=a38_0x4c28();let _0x5ab572=_0x4c2826[_0x28c2e2];return _0x5ab572;}const a38_0x44a3c6=a38_0x5ab5;(function(_0x5ca87c,_0x5b0a06){const _0x173f80=a38_0x5ab5,_0x1f311a=_0x5ca87c();while(!![]){try{const _0x193937=parseInt(_0x173f80(0x218))/0x1+parseInt(_0x173f80(0x1e2))/0x2*(-parseInt(_0x173f80(0x1dc))/0x3)+-parseInt(_0x173f80(0x25a))/0x4+-parseInt(_0x173f80(0x230))/0x5*(parseInt(_0x173f80(0x217))/0x6)+parseInt(_0x173f80(0x1d5))/0x7*(parseInt(_0x173f80(0x1f6))/0x8)+-parseInt(_0x173f80(0x1dd))/0x9*(-parseInt(_0x173f80(0x1e6))/0xa)+parseInt(_0x173f80(0x252))/0xb*(-parseInt(_0x173f80(0x24a))/0xc);if(_0x193937===_0x5b0a06)break;else _0x1f311a['push'](_0x1f311a['shift']());}catch(_0x3e0c6a){_0x1f311a['push'](_0x1f311a['shift']());}}}(a38_0x4c28,0xe6975));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a38_0x4c28(){const _0x4d3825=['type','description','Fetching\x20connections\x20for\x20name\x20resolution...','green','cyan','deleted','message','453186aqBcyG','1747629dXaBhd','\x0aPush\x20summary\x20for\x20\x27','journeysOnly','\x20created','listActivations','add','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Source\x20directory:\x20','scopedFolderPath','New\x20journey:','file','versionNumber','created','existingJourney','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/sb/da/esr','repeat','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','targetDir','setPhase','/e/','Error:\x20Directory\x20not\x20found:\x20','journeyId','10rGdsKJ','\x0aError:','existingSegment','parentSegment','blue','idToName','helpText','Site:\x20','changed','listSegments','\x20unchanged','activations','get','filter','yamlConfig','\x20activations]','createdAt','\x20to\x20update','\x20to\x20create','then','\x20to\x20delete','isNew','Fetching\x20existing\x20activations...','segment\x20or\x20journey','list','\x20\x20Activations:\x20','12bsPmSZ','yes','parentFolder','updated','\x20changes?','\x20updated','getJourney','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','6680839jqOJhV','dim','data','Error\x20parsing\x20YAML:\x20','\x20\x20Segments:\x20','β\x20All\x20journeys\x20are\x20up\x20to\x20date','map','\x20\x20Journeys:\x20','2027156jlPeNm','buildUserMaps','Push\x20','verbose','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','toString','state','join','Changes\x20to:','results','folderPath','Aborted.','/j/da/je','all','π\x20','segments','\x20\x20πΊοΈ\x20\x20Journeys:','journey','set','red','getParent','updatedAt','\x20YAML\x20files\x20found','no_parent','Fetching\x20existing\x20data...','\x20\x20Source:\x20','createdSegmentIds','5789qjfKMs','push','connection','segment','delete','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Parent\x20segment:\x20','78bzszNy','477JLKxpe','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','diff','112076SYpElz','resolveParentId','journeyBundleName','nameToType','176870WZvfhv','isScoped','execute','attributes','error','audienceId','journeys','folders','New\x20segment:','\x20\x20\x20\x20','length','cwd','.yml','site','toDelete','\x0aβ\x20Push\x20complete','9496umRLrO','/app/ps/','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment:push','user','\x20new','folderId','\x27...','nameToId','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)','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Scoped\x20to\x20folder:\x20','toCreate','Error:\x20','journeyBundleId','yellow','.yaml','\x0aValidation\x20failed:','\x20deleted','new','\x20changed','segmentFolderId','parent_name','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20π\x20Segments:','name'];a38_0x4c28=function(){return _0x4d3825;};return a38_0x4c28();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a38_0x5d1a86 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{[a38_0x44a3c6(0x20f)]=a38_0x44a3c6(0x1f9);[a38_0x44a3c6(0x211)]=a38_0x44a3c6(0x200);async[a38_0x44a3c6(0x1e8)](_0x43d52c){const _0x2377fc=a38_0x44a3c6,{options:_0xa5d011,args:_0x5a7a18,tdx:_0x2a69a8}=_0x43d52c,_0x5e7523=_0xa5d011,_0x20a3d2=await resolveTarget({'arg':_0x5a7a18[0x0],'contextParent':_0xa5d011[_0x2377fc(0x233)],'cwd':process[_0x2377fc(0x1f1)]()});if(!isSuccessfulResolution(_0x20a3d2))return _0x20a3d2['errorCode']===_0x2377fc(0x271)?(console['error'](a38_0x5d1a86[_0x2377fc(0x205)](_0x2377fc(0x1e0))),console[_0x2377fc(0x1ea)](_0x2377fc(0x1ff)),console[_0x2377fc(0x1ea)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x2377fc(0x1ea)](_0x2377fc(0x251))):(console['error'](a38_0x5d1a86[_0x2377fc(0x26d)](_0x2377fc(0x203)+_0x20a3d2[_0x2377fc(0x216)]+'\x0a')),_0x20a3d2['helpText']&&console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x214)](_0x20a3d2[_0x2377fc(0x236)]))),0x1;if(_0x20a3d2[_0x2377fc(0x210)]===_0x2377fc(0x20c))return console['error'](a38_0x5d1a86[_0x2377fc(0x26d)](_0x2377fc(0x22e)+_0x20a3d2['targetDir']+'\x0a')),console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x214)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x40eb28=_0x20a3d2['parentName'],_0xe38d66=_0x20a3d2[_0x2377fc(0x22b)],_0x35d6df=_0x20a3d2[_0x2377fc(0x210)]===_0x2377fc(0x223)?_0x20a3d2['filePath']:undefined,_0x4a1216=getScopedDetails(_0x20a3d2),_0x555b0a=_0x4a1216?.[_0x2377fc(0x1e7)]??![],_0x5e3036=_0x4a1216?.[_0x2377fc(0x221)]??'';if(!existsSync(_0xe38d66))return console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x26d)](_0x2377fc(0x22e)+_0xe38d66+'\x0a')),console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x214)](_0x2377fc(0x1f8))),0x1;_0x5e7523[_0x2377fc(0x25d)]&&(console[_0x2377fc(0x1ea)](_0x2377fc(0x237)+_0x5e7523[_0x2377fc(0x1f3)]),console[_0x2377fc(0x1ea)](_0x2377fc(0x1db)+_0x40eb28),console['error'](_0x2377fc(0x220)+_0xe38d66),_0x555b0a&&console[_0x2377fc(0x1ea)](_0x2377fc(0x201)+_0x5e3036));const _0x396f76=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x40eb28+_0x2377fc(0x1fd),()=>_0x2a69a8['segment'][_0x2377fc(0x1e3)](_0x40eb28),{'verbose':_0x5e7523['verbose']}),_0x27ae0b=_0x396f76[_0x2377fc(0x254)],{parentSegmentResult:_0x1fc4a8,segmentsResult:_0x5a944f,foldersResult:_0x1c8fc5,journeysWithDetailsResult:_0x193d02,userMaps:_0x9ae2a2}=await withSpinner(_0x2377fc(0x272),async()=>{const _0x1b8996=_0x2377fc,[_0x264a39,_0x25626a,_0x10e097,_0x250be3,_0x17553e]=await Promise[_0x1b8996(0x267)]([_0x2a69a8[_0x1b8996(0x1d8)][_0x1b8996(0x26e)](_0x27ae0b),_0x2a69a8[_0x1b8996(0x1d8)][_0x1b8996(0x239)](_0x27ae0b),_0x2a69a8[_0x1b8996(0x1d8)]['listFolders'](_0x27ae0b),_0x2a69a8[_0x1b8996(0x26b)]['listJourneysWithDetailsFromParentSegment'](_0x27ae0b,{'includeAllVersions':!![]}),_0x2a69a8['user'][_0x1b8996(0x25b)]()]);return{'parentSegmentResult':_0x264a39,'segmentsResult':_0x25626a,'foldersResult':_0x10e097,'journeysWithDetailsResult':_0x250be3,'userMaps':_0x17553e};},{'verbose':_0x5e7523[_0x2377fc(0x25d)]})[_0x2377fc(0x243)](_0x55e76c=>_0x55e76c[_0x2377fc(0x254)]),_0x1125b7=_0x1fc4a8,_0xe7e106=extractRootFolderId(_0x1125b7),_0x4f13df=_0x5a944f,_0x1f69a9=_0x1c8fc5,{journeys:_0x53c3f3,activationStepsById:_0x248daf}=_0x193d02,_0x248335=new Map(_0x53c3f3['map'](_0x4e4990=>[_0x4e4990['id'],_0x4e4990])),_0x51c7a9=_0x53c3f3[_0x2377fc(0x258)](_0x106a82=>({'id':_0x106a82['id'],'name':_0x106a82[_0x2377fc(0x1e9)]['name'],'journeyBundleName':_0x106a82[_0x2377fc(0x1e9)][_0x2377fc(0x1e4)]||'','journeyBundleId':_0x106a82[_0x2377fc(0x1e9)][_0x2377fc(0x204)]||'','versionNumber':_0x106a82[_0x2377fc(0x1e9)][_0x2377fc(0x224)],'description':_0x106a82[_0x2377fc(0x1e9)][_0x2377fc(0x211)],'state':_0x106a82[_0x2377fc(0x1e9)][_0x2377fc(0x260)],'paused':_0x106a82[_0x2377fc(0x1e9)]['paused'],'audienceId':_0x106a82[_0x2377fc(0x1e9)][_0x2377fc(0x1eb)],'folderId':_0x106a82['relationships']?.[_0x2377fc(0x24c)]?.['data']?.['id'],'createdAt':_0x106a82['attributes'][_0x2377fc(0x240)],'updatedAt':_0x106a82[_0x2377fc(0x1e9)][_0x2377fc(0x26f)]})),{emailToId:_0xe4e54e,idToEmail:_0x3e6584}=_0x9ae2a2,_0x3ef172=await withSpinner(_0x2377fc(0x212),async()=>{const _0x34463c=_0x2377fc,_0xffb2a9=await _0x2a69a8[_0x34463c(0x1d7)][_0x34463c(0x248)]();return buildConnectionMaps(_0xffb2a9);},{'verbose':_0x5e7523[_0x2377fc(0x25d)]})[_0x2377fc(0x243)](_0x96fad7=>_0x96fad7[_0x2377fc(0x254)]),_0x272558=_0x3ef172['nameToId'],_0x1a9cfe=_0x3ef172[_0x2377fc(0x235)],_0x5ca407=_0x3ef172[_0x2377fc(0x1e5)],_0x490fde={'emailToIdMap':_0xe4e54e,'connectionNameToIdMap':_0x272558,'connectionNameToTypeMap':_0x5ca407,'getSchema':_0x52497e=>_0x2a69a8['connection']['getOutputSchemaWithCache'](_0x52497e)};let {pathToId:_0x201ec0,idToPath:_0x153e1a}=buildFolderMaps(_0x1f69a9);const _0x10a26c=buildSegmentLookupMap(_0x4f13df,_0x153e1a),_0x309d6=buildSegmentNameToIdMap(_0x4f13df),_0x426b61=buildJourneyBundleLookupMap(_0x51c7a9,_0x153e1a);let _0xf10f0;if(_0x35d6df){if(!_0x35d6df['endsWith'](_0x2377fc(0x1f2))&&!_0x35d6df['endsWith'](_0x2377fc(0x206)))return console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x26d)](_0x2377fc(0x22a)+_0x35d6df+'\x0a')),0x1;_0xf10f0=[_0x35d6df];}else _0xf10f0=findYamlFiles(_0xe38d66);if(_0xf10f0[_0x2377fc(0x1f0)]===0x0)return console[_0x2377fc(0x1ea)](a38_0x5d1a86['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0xe38d66+'\x0a')),console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x214)](_0x2377fc(0x21f))),0x1;let _0x5e2e49,_0x223a02;try{const _0x4d2df1=parseAndClassifyYamlFiles(_0xf10f0,_0xe38d66,{'skipSegments':_0x5e7523[_0x2377fc(0x21a)]});_0x5e2e49=_0x4d2df1[_0x2377fc(0x269)],_0x223a02=_0x4d2df1['journeys'];const _0x5bbe5e=validateParsedFiles(_0x4d2df1,_0xe38d66);if(_0x5bbe5e[_0x2377fc(0x1f0)]>0x0)return console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x26d)](_0x2377fc(0x207))),console[_0x2377fc(0x1ea)](formatValidationErrors(_0x5bbe5e)),console[_0x2377fc(0x1ea)](a38_0x5d1a86['yellow'](_0x2377fc(0x20d))),0x1;}catch(_0x100fb0){return console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x26d)](_0x2377fc(0x255)+(_0x100fb0 instanceof Error?_0x100fb0[_0x2377fc(0x216)]:_0x100fb0))),0x1;}if(_0x5e2e49['length']===0x0&&_0x223a02['length']===0x0){const _0x3f07bf=_0x5e7523['journeysOnly']?'journey':_0x2377fc(0x247);return console['error'](a38_0x5d1a86[_0x2377fc(0x205)]('No\x20'+_0x3f07bf+_0x2377fc(0x270))),0x0;}const _0x304f56=new Map();_0x4f13df['length']>0x0&&!_0x5e7523['journeysOnly']&&await withSpinner(_0x2377fc(0x246),async()=>{await batchAsync(_0x4f13df,async _0x4e4aa=>{const _0x43026a=a38_0x5ab5,_0x3cf091=await _0x2a69a8[_0x43026a(0x1d8)][_0x43026a(0x21c)](_0x27ae0b,_0x4e4aa['id']);_0x304f56[_0x43026a(0x26c)](_0x4e4aa['id'],_0x3cf091);});},{'verbose':_0x5e7523['verbose']});const {segmentFiles:_0x1c0980,foldersToCreate:_0x481014}=await prepareSegmentFiles(_0x5e2e49,{'segmentByFolderAndName':_0x10a26c,'activationsBySegmentId':_0x304f56,'folderPathToId':_0x201ec0,'idToEmailMap':_0x3e6584,'connectionIdToNameMap':_0x1a9cfe},_0x490fde,_0x555b0a,_0x5e3036),_0x4949ff=_0x35d6df?[]:findSegmentsToDelete(_0x4f13df,_0x5e2e49[_0x2377fc(0x258)](({yamlConfig:_0x28e0fa,folderPath:_0x5736a8})=>({'yamlConfig':_0x28e0fa,'folderPath':resolveTDFolderPath(_0x5736a8,_0x555b0a,_0x5e3036)})),_0x153e1a,_0x5e3036,_0x555b0a),{journeyFiles:_0x8c59df,foldersToCreate:_0xd31b16}=await withProgressSpinner('Preparing\x20journeys...',async _0x355a6c=>prepareJourneyFiles(_0x223a02,{'fetchJourney':async _0xbcf51d=>_0x2a69a8['journey'][_0x2377fc(0x250)](_0xbcf51d[_0x2377fc(0x22f)]),'journeyBundlesByFolderAndName':_0x426b61,'folderPathToId':_0x201ec0,'idToEmailMap':_0x3e6584,'connectionIdToNameMap':_0x1a9cfe,'existingSegments':_0x4f13df,'parentId':_0x27ae0b,'deps':_0x2a69a8,'progress':{'update':_0x14f19a=>{const _0x3274b4=_0x2377fc;_0x355a6c[_0x3274b4(0x22c)](_0x14f19a),_0x5e7523['verbose']&&console[_0x3274b4(0x1ea)]('\x20\x20'+_0x14f19a);}},'journeyById':_0x248335,'activationStepsById':_0x248daf},_0x555b0a,_0x5e3036),{'verbose':_0x5e7523[_0x2377fc(0x25d)]})[_0x2377fc(0x243)](_0x2624a6=>_0x2624a6[_0x2377fc(0x254)]);for(const _0xac4682 of _0xd31b16){_0x481014[_0x2377fc(0x21d)](_0xac4682);}const _0x59d08a=_0x35d6df?[]:findJourneysToDelete(_0x51c7a9,_0x223a02['map'](({yamlConfig:_0x2a8c15,folderPath:_0x250799})=>({'yamlConfig':_0x2a8c15,'folderPath':resolveTDFolderPath(_0x250799,_0x555b0a,_0x5e3036)})),_0x153e1a,_0x5e3036,_0x555b0a),_0x402bb9=calculatePushStats(_0x1c0980,_0x8c59df,_0x481014,_0x4949ff,_0x59d08a,!!_0x5e7523[_0x2377fc(0x1d9)],!!_0x5e7523[_0x2377fc(0x21a)]),_0x3cf2b7=_0x402bb9[_0x2377fc(0x269)]['new'],_0x199237=_0x402bb9[_0x2377fc(0x269)][_0x2377fc(0x238)],_0x25c477=_0x402bb9[_0x2377fc(0x269)][_0x2377fc(0x1df)],_0x157950=_0x402bb9[_0x2377fc(0x269)]['toDelete'],_0x42b10a=_0x402bb9[_0x2377fc(0x1ed)]['toCreate'],_0x5bf589=_0x402bb9[_0x2377fc(0x1ec)][_0x2377fc(0x209)],_0x198a88=_0x402bb9[_0x2377fc(0x1ec)][_0x2377fc(0x238)],_0x2532e8=_0x402bb9['journeys'][_0x2377fc(0x1df)],_0x3a9c43=_0x402bb9['journeys'][_0x2377fc(0x1f4)],_0xfe7f10=_0x402bb9[_0x2377fc(0x23b)][_0x2377fc(0x267)],_0x1db6da=_0x402bb9['activations'][_0x2377fc(0x202)],_0x5658c7=_0x402bb9['activations']['toUpdate'],_0x3abeca=_0x402bb9['activations'][_0x2377fc(0x1f4)];console[_0x2377fc(0x1ea)](_0x2377fc(0x219)+_0x40eb28+'\x27:');_0x42b10a[_0x2377fc(0x1f0)]>0x0&&console['error']('\x20\x20'+a38_0x5d1a86[_0x2377fc(0x234)](_0x2377fc(0x268)+_0x42b10a['length']+'\x20folders\x20to\x20create'));if(!_0x5e7523[_0x2377fc(0x21a)]){console[_0x2377fc(0x1ea)](_0x2377fc(0x20e)),console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x213)]('+\x20'+_0x3cf2b7[_0x2377fc(0x1f0)]+_0x2377fc(0x1fb))),console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x205)]('~\x20'+_0x199237[_0x2377fc(0x1f0)]+_0x2377fc(0x20a)));if(_0x157950[_0x2377fc(0x1f0)]>0x0)console[_0x2377fc(0x1ea)]('\x20\x20\x20\x20'+a38_0x5d1a86['red']('-\x20'+_0x157950[_0x2377fc(0x1f0)]+'\x20to\x20delete'));else _0x4949ff[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523[_0x2377fc(0x1d9)]&&console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x253)](_0x4949ff[_0x2377fc(0x1f0)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86['dim']('=\x20'+_0x25c477[_0x2377fc(0x1f0)]+_0x2377fc(0x23a)));}if(_0x8c59df[_0x2377fc(0x1f0)]>0x0||_0x59d08a['length']>0x0){console[_0x2377fc(0x1ea)](_0x2377fc(0x26a)),console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x213)]('+\x20'+_0x5bf589[_0x2377fc(0x1f0)]+_0x2377fc(0x1fb))),console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x205)]('~\x20'+_0x198a88[_0x2377fc(0x1f0)]+_0x2377fc(0x20a)));if(_0x3a9c43[_0x2377fc(0x1f0)]>0x0)console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x26d)]('-\x20'+_0x3a9c43[_0x2377fc(0x1f0)]+_0x2377fc(0x244)));else _0x59d08a[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523['delete']&&console['error']('\x20\x20\x20\x20'+a38_0x5d1a86[_0x2377fc(0x253)](_0x59d08a[_0x2377fc(0x1f0)]+_0x2377fc(0x1de)));console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x253)]('=\x20'+_0x2532e8[_0x2377fc(0x1f0)]+_0x2377fc(0x23a)));}_0xfe7f10[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523[_0x2377fc(0x21a)]&&(console['error'](''),console[_0x2377fc(0x1ea)]('\x20\x20Activations:'),_0x1db6da[_0x2377fc(0x1f0)]>0x0&&console[_0x2377fc(0x1ea)](_0x2377fc(0x1ef)+a38_0x5d1a86[_0x2377fc(0x213)]('+\x20'+_0x1db6da[_0x2377fc(0x1f0)]+_0x2377fc(0x242))),_0x5658c7[_0x2377fc(0x1f0)]>0x0&&console[_0x2377fc(0x1ea)]('\x20\x20\x20\x20'+a38_0x5d1a86['yellow']('~\x20'+_0x5658c7['length']+_0x2377fc(0x241))),_0x3abeca[_0x2377fc(0x1f0)]>0x0&&console['error']('\x20\x20\x20\x20'+a38_0x5d1a86[_0x2377fc(0x26d)]('-\x20'+_0x3abeca['length']+'\x20to\x20delete')));console[_0x2377fc(0x1ea)](_0x2377fc(0x273)+a38_0x5d1a86[_0x2377fc(0x214)](_0xe38d66)+'\x0a');if(_0x42b10a[_0x2377fc(0x1f0)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x29e044 of _0x42b10a){console[_0x2377fc(0x1ea)]('\x20\x20'+a38_0x5d1a86['blue']('+')+'\x20'+_0x29e044);}console['error']('');}if(_0x3cf2b7[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523[_0x2377fc(0x21a)])for(const _0x3a2950 of _0x3cf2b7){const _0x1d7aa2=_0x3a2950[_0x2377fc(0x264)]?_0x3a2950['folderPath']+'/'+_0x3a2950['yamlConfig'][_0x2377fc(0x20f)]:_0x3a2950[_0x2377fc(0x23e)][_0x2377fc(0x20f)],_0x5b5d0c=_0x3a2950[_0x2377fc(0x23e)][_0x2377fc(0x23b)]?.[_0x2377fc(0x1f0)]||0x0,_0x3a6dfb=_0x5b5d0c>0x0?a38_0x5d1a86[_0x2377fc(0x253)]('\x20['+_0x5b5d0c+'\x20activations]'):'';console[_0x2377fc(0x1ea)]('\x0a'+a38_0x5d1a86[_0x2377fc(0x213)](_0x2377fc(0x1ee))+'\x20'+_0x1d7aa2+_0x3a6dfb),console[_0x2377fc(0x1ea)]('β'[_0x2377fc(0x229)](0x3c)),_0x3a2950['diff']&&console[_0x2377fc(0x1ea)](_0x3a2950['diff']),console[_0x2377fc(0x1ea)]('β'['repeat'](0x3c));}if(_0x157950[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523[_0x2377fc(0x21a)])for(const _0x1b552e of _0x157950){const _0x1058eb=_0x1b552e['segmentFolderId']?_0x153e1a['get'](_0x1b552e[_0x2377fc(0x20b)][_0x2377fc(0x25f)]())||'':'',_0x1eb920=_0x1058eb?_0x1058eb+'/'+_0x1b552e['name']:_0x1b552e[_0x2377fc(0x20f)],_0xa768c1=_0x304f56[_0x2377fc(0x23c)](_0x1b552e['id'])||[],_0x9d9d0f=_0xa768c1[_0x2377fc(0x1f0)]>0x0?a38_0x5d1a86[_0x2377fc(0x253)]('\x20['+_0xa768c1[_0x2377fc(0x1f0)]+_0x2377fc(0x23f)):'';console[_0x2377fc(0x1ea)]('\x0a'+a38_0x5d1a86['red']('Delete\x20segment:')+'\x20'+_0x1eb920+_0x9d9d0f),console[_0x2377fc(0x1ea)]('β'[_0x2377fc(0x229)](0x3c));const _0x179378=segmentWithActivationsToYaml(_0x1b552e,_0xa768c1,undefined,_0x3e6584,_0x1a9cfe),_0x514273=segmentToYamlString(_0x179378),_0x5780d5=generateDiff(_0x514273,'');console[_0x2377fc(0x1ea)](formatDiffWithColors(_0x5780d5)),console[_0x2377fc(0x1ea)]('β'[_0x2377fc(0x229)](0x3c));}const _0x536c45=_0x1c0980[_0x2377fc(0x23d)](_0x4d015c=>!_0x4d015c[_0x2377fc(0x245)]&&_0x4d015c[_0x2377fc(0x1e1)]);if(_0x536c45[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523['journeysOnly'])for(const _0x497c6b of _0x536c45){const _0x4c5fd3=_0x497c6b[_0x2377fc(0x264)]?_0x497c6b['folderPath']+'/'+_0x497c6b['yamlConfig'][_0x2377fc(0x20f)]:_0x497c6b['yamlConfig'][_0x2377fc(0x20f)];console[_0x2377fc(0x1ea)]('\x0a'+a38_0x5d1a86[_0x2377fc(0x205)](_0x2377fc(0x262))+'\x20'+_0x4c5fd3),console['error']('β'[_0x2377fc(0x229)](0x3c)),console[_0x2377fc(0x1ea)](_0x497c6b[_0x2377fc(0x1e1)]),console[_0x2377fc(0x1ea)]('β'[_0x2377fc(0x229)](0x3c));}if(_0x5bf589[_0x2377fc(0x1f0)]>0x0)for(const _0x5b40e5 of _0x5bf589){const _0x471088=_0x5b40e5[_0x2377fc(0x264)]?_0x5b40e5[_0x2377fc(0x264)]+'/'+_0x5b40e5[_0x2377fc(0x23e)][_0x2377fc(0x20f)]:_0x5b40e5['yamlConfig'][_0x2377fc(0x20f)];console[_0x2377fc(0x1ea)]('\x0a'+a38_0x5d1a86[_0x2377fc(0x213)](_0x2377fc(0x222))+'\x20'+_0x471088),console[_0x2377fc(0x1ea)]('β'[_0x2377fc(0x229)](0x3c)),_0x5b40e5[_0x2377fc(0x1e1)]&&console[_0x2377fc(0x1ea)](_0x5b40e5[_0x2377fc(0x1e1)]),console[_0x2377fc(0x1ea)]('β'['repeat'](0x3c));}const _0x24ef1e=_0x8c59df[_0x2377fc(0x23d)](_0x5455d0=>!_0x5455d0[_0x2377fc(0x245)]&&_0x5455d0['diff']);if(_0x24ef1e[_0x2377fc(0x1f0)]>0x0)for(const _0x1cf2b2 of _0x24ef1e){const _0x3f1680=_0x1cf2b2[_0x2377fc(0x264)]?_0x1cf2b2[_0x2377fc(0x264)]+'/'+_0x1cf2b2[_0x2377fc(0x23e)][_0x2377fc(0x20f)]:_0x1cf2b2['yamlConfig'][_0x2377fc(0x20f)];console['error']('\x0a'+a38_0x5d1a86[_0x2377fc(0x205)]('Changes\x20to\x20journey:')+'\x20'+_0x3f1680),console[_0x2377fc(0x1ea)]('β'[_0x2377fc(0x229)](0x3c)),console[_0x2377fc(0x1ea)](_0x1cf2b2[_0x2377fc(0x1e1)]),console[_0x2377fc(0x1ea)]('β'[_0x2377fc(0x229)](0x3c));}if(_0x3a9c43[_0x2377fc(0x1f0)]>0x0)for(const _0x127ccb of _0x3a9c43){const _0x1dd82e=_0x127ccb[_0x2377fc(0x1fc)]?_0x153e1a[_0x2377fc(0x23c)](_0x127ccb[_0x2377fc(0x1fc)])||'':'',_0x84c9dc=_0x1dd82e?_0x1dd82e+'/'+_0x127ccb[_0x2377fc(0x1e4)]:_0x127ccb[_0x2377fc(0x1e4)];console[_0x2377fc(0x1ea)]('\x0a'+a38_0x5d1a86['red']('Delete\x20journey:')+'\x20'+_0x84c9dc),console[_0x2377fc(0x1ea)]('β'['repeat'](0x3c)),console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x26d)]('(Journey\x20will\x20be\x20deleted)')),console['error']('β'[_0x2377fc(0x229)](0x3c));}if(_0x5e7523['dryRun'])return console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x205)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4678be=_0x5e7523['journeysOnly']?![]:_0x3cf2b7[_0x2377fc(0x1f0)]>0x0||_0x199237[_0x2377fc(0x1f0)]>0x0||_0x157950['length']>0x0,_0x58b323=_0x5bf589[_0x2377fc(0x1f0)]>0x0||_0x198a88[_0x2377fc(0x1f0)]>0x0||_0x3a9c43[_0x2377fc(0x1f0)]>0x0,_0x410839=_0x5e7523[_0x2377fc(0x21a)]?![]:_0xfe7f10[_0x2377fc(0x1f0)]>0x0,_0x561ea7=_0x42b10a[_0x2377fc(0x1f0)]>0x0;if(!_0x4678be&&!_0x58b323&&!_0x410839&&!_0x561ea7){const _0x1355cc=_0x5e7523[_0x2377fc(0x21a)]?_0x2377fc(0x257):_0x2377fc(0x227);console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x213)](_0x1355cc));if(_0x35d6df&&_0x25c477['length']===0x1){const _0x35fdb1=_0x25c477[0x0];if(_0x35fdb1[_0x2377fc(0x232)]?.['id']){const _0x419d9b=getConsoleNextUrl(_0x5e7523['site'],_0x2377fc(0x1f7)+_0x27ae0b+_0x2377fc(0x22d)+_0x35fdb1[_0x2377fc(0x232)]['id']+_0x2377fc(0x228));console[_0x2377fc(0x1ea)](_0x2377fc(0x21e)+a38_0x5d1a86[_0x2377fc(0x214)](_0x419d9b));}}if(_0x35d6df&&_0x2532e8[_0x2377fc(0x1f0)]===0x1){const _0x30bfcf=_0x2532e8[0x0];if(_0x30bfcf[_0x2377fc(0x226)]?.['id']){const _0x57d674=getConsoleNextUrl(_0x5e7523[_0x2377fc(0x1f3)],_0x2377fc(0x1f7)+_0x27ae0b+_0x2377fc(0x22d)+_0x30bfcf['existingJourney']['id']+_0x2377fc(0x266));console[_0x2377fc(0x1ea)]('\x20\x20'+a38_0x5d1a86[_0x2377fc(0x214)](_0x57d674));}}return 0x0;}const _0x1e2f4d=_0x5e7523['journeysOnly']?_0x5bf589[_0x2377fc(0x1f0)]+_0x198a88['length']+_0x3a9c43['length']+_0x42b10a[_0x2377fc(0x1f0)]:_0x3cf2b7[_0x2377fc(0x1f0)]+_0x199237['length']+_0x157950[_0x2377fc(0x1f0)]+_0x5bf589[_0x2377fc(0x1f0)]+_0x198a88[_0x2377fc(0x1f0)]+_0x3a9c43[_0x2377fc(0x1f0)]+_0x42b10a[_0x2377fc(0x1f0)]+_0xfe7f10[_0x2377fc(0x1f0)];if(!_0x5e7523[_0x2377fc(0x24b)]&&_0x1e2f4d>0x0){if(!isInteractive())return console['error'](a38_0x5d1a86[_0x2377fc(0x26d)](_0x2377fc(0x231)),_0x2377fc(0x1da)),console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x253)](_0x2377fc(0x25e))),0x1;const _0x4c53bd=await confirmKey(_0x2377fc(0x25c)+_0x1e2f4d+_0x2377fc(0x24e));if(!_0x4c53bd)return console[_0x2377fc(0x1ea)](a38_0x5d1a86['yellow'](_0x2377fc(0x265))),0x1;}const _0x26f882={'withProgress':async(_0x2600ba,_0x22dbc2)=>{const _0x462986=_0x2377fc,_0x2d8b4d=await withSpinner(_0x2600ba,_0x22dbc2,{'verbose':_0x5e7523[_0x462986(0x25d)]});return{'data':_0x2d8b4d[_0x462986(0x254)]};},'logInfo':_0x35cec6=>console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x234)]('β\x20'+_0x35cec6)),'logSuccess':_0x36f941=>console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x213)]('β\x20'+_0x36f941)),'logWarning':_0x1131d1=>console[_0x2377fc(0x1ea)](a38_0x5d1a86['yellow']('β \x20'+_0x1131d1)),'logDeleted':_0xa3b0bd=>console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x26d)]('β\x20'+_0xa3b0bd))},_0x1a7803={'segment':_0x2a69a8['segment'],'journey':_0x2a69a8[_0x2377fc(0x26b)],'user':_0x2a69a8[_0x2377fc(0x1fa)],'connection':_0x2a69a8[_0x2377fc(0x1d7)]};_0x42b10a['length']>0x0&&(_0x201ec0=await executePushFolders(_0x1a7803,_0x42b10a,_0x201ec0,{'parentId':_0x27ae0b},_0x26f882));const _0x4248ab={'rootFolderId':_0xe7e106,'folderPathToId':_0x201ec0,'folderIdToPath':_0x153e1a,'segmentNameToId':_0x309d6,'activationsBySegmentId':_0x304f56,'emailToIdMap':_0xe4e54e,'idToEmailMap':_0x3e6584,'connectionNameToIdMap':_0x3ef172[_0x2377fc(0x1fe)],'connectionIdToNameMap':_0x3ef172[_0x2377fc(0x235)],'connectionNameToTypeMap':_0x5ca407},_0x39394d=await executePushSegments(_0x1a7803,_0x5e7523[_0x2377fc(0x21a)]?[]:_0x1c0980,_0x4248ab,{'parentId':_0x27ae0b},_0x26f882),_0x8170c5=_0x39394d[_0x2377fc(0x225)],_0x408e68=_0x39394d[_0x2377fc(0x24d)],_0x5de902=_0x39394d[_0x2377fc(0x23b)][_0x2377fc(0x225)],_0x2fc92f=_0x39394d[_0x2377fc(0x23b)][_0x2377fc(0x24d)],_0x5e7e60=_0x39394d['activations'][_0x2377fc(0x215)];let _0x3bbc1f;if(_0x35d6df&&_0x1c0980[_0x2377fc(0x1f0)]===0x1){const _0x175d0c=_0x1c0980[0x0];_0x3bbc1f=_0x175d0c[_0x2377fc(0x232)]?.['id']??_0x39394d['createdSegmentIds'][_0x2377fc(0x23c)](_0x175d0c[_0x2377fc(0x23e)][_0x2377fc(0x20f)]);}const _0x2cd263=await executePushSegmentDeletions(_0x1a7803,_0x5e7523[_0x2377fc(0x21a)]?[]:_0x157950,_0x26f882);let _0x2067fd=0x0,_0xa710eb=0x0,_0xe5b68f=0x0;const _0x3da347=new Map(_0x309d6);for(const [_0x532eed,_0x26c0b6]of _0x39394d[_0x2377fc(0x1d4)]){_0x3da347[_0x2377fc(0x26c)](_0x532eed,_0x26c0b6);}if(_0x8c59df['length']>0x0){const _0x3394be={..._0x4248ab,'segmentNameToId':_0x3da347,'existingSegments':_0x4f13df,'activationContext':_0x490fde},_0x3a37cc=await executePushJourneys(_0x1a7803,_0x8c59df,_0x3394be,{'parentId':_0x27ae0b,'rootFolderId':_0xe7e106,'verbose':_0x5e7523['verbose']},_0x26f882);_0x2067fd=_0x3a37cc[_0x2377fc(0x225)],_0xa710eb=_0x3a37cc[_0x2377fc(0x24d)];if(_0x35d6df&&_0x3a37cc['results'][_0x2377fc(0x1f0)]===0x1){const _0x4bbcb9=_0x3a37cc[_0x2377fc(0x263)][0x0];if(_0x4bbcb9['journeyId']){const _0x4eee35=getConsoleNextUrl(_0x5e7523[_0x2377fc(0x1f3)],_0x2377fc(0x1f7)+_0x27ae0b+_0x2377fc(0x22d)+_0x4bbcb9[_0x2377fc(0x22f)]+_0x2377fc(0x266));console[_0x2377fc(0x1ea)]('\x20\x20'+a38_0x5d1a86[_0x2377fc(0x214)](_0x4eee35));}}}for(const _0x35c8d9 of _0x3a9c43){console[_0x2377fc(0x1ea)](a38_0x5d1a86[_0x2377fc(0x205)]('β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x35c8d9[_0x2377fc(0x1e4)])),_0xe5b68f++;}const _0x4aae40=[];if(_0x8170c5>0x0)_0x4aae40['push'](_0x8170c5+_0x2377fc(0x21b));if(_0x408e68>0x0)_0x4aae40['push'](_0x408e68+_0x2377fc(0x24f));if(_0x2cd263>0x0)_0x4aae40['push'](_0x2cd263+'\x20deleted');const _0x5d7b0f=[];if(_0x2067fd>0x0)_0x5d7b0f[_0x2377fc(0x1d6)](_0x2067fd+_0x2377fc(0x21b));if(_0xa710eb>0x0)_0x5d7b0f['push'](_0xa710eb+_0x2377fc(0x24f));if(_0xe5b68f>0x0)_0x5d7b0f[_0x2377fc(0x1d6)](_0xe5b68f+_0x2377fc(0x208));const _0x2c5172=[];if(_0x5de902>0x0)_0x2c5172[_0x2377fc(0x1d6)](_0x5de902+'\x20created');if(_0x2fc92f>0x0)_0x2c5172[_0x2377fc(0x1d6)](_0x2fc92f+_0x2377fc(0x24f));if(_0x5e7e60>0x0)_0x2c5172[_0x2377fc(0x1d6)](_0x5e7e60+_0x2377fc(0x208));console[_0x2377fc(0x1ea)](a38_0x5d1a86['green'](_0x2377fc(0x1f5)));_0x4aae40[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523[_0x2377fc(0x21a)]&&console[_0x2377fc(0x1ea)](_0x2377fc(0x256)+_0x4aae40[_0x2377fc(0x261)](',\x20'));_0x5d7b0f[_0x2377fc(0x1f0)]>0x0&&console['error'](_0x2377fc(0x259)+_0x5d7b0f[_0x2377fc(0x261)](',\x20'));_0x2c5172[_0x2377fc(0x1f0)]>0x0&&!_0x5e7523[_0x2377fc(0x21a)]&&console[_0x2377fc(0x1ea)](_0x2377fc(0x249)+_0x2c5172[_0x2377fc(0x261)](',\x20'));if(_0x3bbc1f){const _0x2a24d3=getConsoleNextUrl(_0x5e7523[_0x2377fc(0x1f3)],_0x2377fc(0x1f7)+_0x27ae0b+'/e/'+_0x3bbc1f+_0x2377fc(0x228));console['error'](_0x2377fc(0x21e)+a38_0x5d1a86[_0x2377fc(0x214)](_0x2a24d3));}return 0x0;}}
|
|
1
|
+
const a38_0x41082f=a38_0x1f9f;(function(_0x480609,_0x199846){const _0xcbd4f0=a38_0x1f9f,_0x450879=_0x480609();while(!![]){try{const _0x5bcba5=parseInt(_0xcbd4f0(0x1ca))/0x1+parseInt(_0xcbd4f0(0x19c))/0x2*(parseInt(_0xcbd4f0(0x1c9))/0x3)+parseInt(_0xcbd4f0(0x1b6))/0x4*(parseInt(_0xcbd4f0(0x1b2))/0x5)+parseInt(_0xcbd4f0(0x15a))/0x6*(-parseInt(_0xcbd4f0(0x160))/0x7)+parseInt(_0xcbd4f0(0x199))/0x8*(parseInt(_0xcbd4f0(0x19a))/0x9)+parseInt(_0xcbd4f0(0x142))/0xa*(parseInt(_0xcbd4f0(0x147))/0xb)+parseInt(_0xcbd4f0(0x1c1))/0xc*(-parseInt(_0xcbd4f0(0x1b3))/0xd);if(_0x5bcba5===_0x199846)break;else _0x450879['push'](_0x450879['shift']());}catch(_0x30f983){_0x450879['push'](_0x450879['shift']());}}}(a38_0xc51d,0x69511));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a38_0xc51d(){const _0x1bce36=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x27...','Delete\x20segment:','activations','Scoped\x20to\x20folder:\x20','listActivations','cyan','all','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','set','listFolders','20NGMYOb','green','\x0aError:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','existingJourney','1469149VlJKzn','idToName','isScoped','segment','diff','\x20to\x20update','Error:\x20','red','push','\x20changed','segment:push','name','/e/','(Journey\x20will\x20be\x20deleted)','.yaml','created','results','\x0aβ\x20Push\x20complete','Changes\x20to:','297144VkphbU','filter','existingSegment','\x20\x20\x20\x20','cwd','/sb/da/esr','28FLnPHp','Fetching\x20connections\x20for\x20name\x20resolution...','journeyBundleName','getParent','isNew','data','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','folderId','journey','/app/ps/','parentName','journeys','description','New\x20segment:','buildUserMaps','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','list','filePath','Error:\x20Directory\x20not\x20found:\x20','.yml','repeat','targetDir','changed','No\x20','Parent\x20segment:\x20','\x20\x20Source:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20changes?','folders','scopedFolderPath','β\x20All\x20journeys\x20are\x20up\x20to\x20date','message','join','updatedAt','\x0aValidation\x20failed:','yamlConfig','getOutputSchemaWithCache','add','blue','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yellow','helpText','Source\x20directory:\x20','parent_name','\x20folders\x20to\x20create','map','Preparing\x20journeys...','nameToId','updated','\x20created','attributes','toString','folderPath','\x20to\x20create','Aborted.','length','16fmfbOf','2181663DTUYLo','\x20updated','983852FTlpLt','listJourneysWithDetailsFromParentSegment','dryRun','/j/da/je','state','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','endsWith','\x20to\x20delete','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)','listSegments','Fetching\x20existing\x20activations...','journeysOnly','\x20\x20π\x20Segments:','paused','journeyBundleId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Fetching\x20existing\x20data...','dim','toUpdate','unchanged','user','5iBtRmN','8340839vkdeIp','then','Folders\x20to\x20create:','2008164wFQPLJ','segments','site','execute','\x20unchanged','getJourney','\x20YAML\x20files\x20found','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Resolving\x20parent\x20segment\x20\x27','versionNumber','toDelete','36bKztRW','error','Delete\x20journey:','π\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20Activations:\x20','\x20\x20πΊοΈ\x20\x20Journeys:','\x20new','3Juytqc','808383WzobkK','connection','verbose','nameToType','\x20deleted','createdSegmentIds','delete','Site:\x20','setPhase','get','\x20activations]','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','new'];a38_0xc51d=function(){return _0x1bce36;};return a38_0xc51d();}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 a38_0xfb3ffc from'chalk';import{existsSync}from'fs';function a38_0x1f9f(_0x309ca0,_0x4b6320){_0x309ca0=_0x309ca0-0x133;const _0xc51dad=a38_0xc51d();let _0x1f9f3b=_0xc51dad[_0x309ca0];return _0x1f9f3b;}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{[a38_0x41082f(0x152)]=a38_0x41082f(0x151);[a38_0x41082f(0x16c)]=a38_0x41082f(0x1bd);async[a38_0x41082f(0x1b9)](_0x157814){const _0x1a2c0e=a38_0x41082f,{options:_0x21059a,args:_0x423c4a,tdx:_0x523549}=_0x157814,_0x27233d=_0x21059a,_0x2bc9f2=await resolveTarget({'arg':_0x423c4a[0x0],'contextParent':_0x21059a['parentSegment'],'cwd':process[_0x1a2c0e(0x15e)]()});if(!isSuccessfulResolution(_0x2bc9f2))return _0x2bc9f2['errorCode']==='no_parent'?(console['error'](a38_0xfb3ffc[_0x1a2c0e(0x189)](_0x1a2c0e(0x145))),console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x1a5)),console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x1c5)),console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x137))):(console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc['red'](_0x1a2c0e(0x14d)+_0x2bc9f2['message']+'\x0a')),_0x2bc9f2[_0x1a2c0e(0x18a)]&&console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0x2bc9f2['helpText']))),0x1;if(_0x2bc9f2['type']===_0x1a2c0e(0x18c))return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x14e)](_0x1a2c0e(0x173)+_0x2bc9f2['targetDir']+'\x0a')),console['error'](a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0x1a2c0e(0x1ac))),0x1;const _0x4e34b7=_0x2bc9f2[_0x1a2c0e(0x16a)],_0x33a158=_0x2bc9f2[_0x1a2c0e(0x176)],_0x330054=_0x2bc9f2['type']==='file'?_0x2bc9f2[_0x1a2c0e(0x172)]:undefined,_0x38785e=getScopedDetails(_0x2bc9f2),_0x4271cd=_0x38785e?.[_0x1a2c0e(0x149)]??![],_0xdc3871=_0x38785e?.[_0x1a2c0e(0x17e)]??'';if(!existsSync(_0x33a158))return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc['red'](_0x1a2c0e(0x173)+_0x33a158+'\x0a')),console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x13d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x27233d[_0x1a2c0e(0x1cc)]&&(console['error'](_0x1a2c0e(0x1d1)+_0x27233d[_0x1a2c0e(0x1b8)]),console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x179)+_0x4e34b7),console['error'](_0x1a2c0e(0x18b)+_0x33a158),_0x4271cd&&console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x13b)+_0xdc3871));const _0x27c885=await withSpinner(_0x1a2c0e(0x1be)+_0x4e34b7+_0x1a2c0e(0x138),()=>_0x523549[_0x1a2c0e(0x14a)]['resolveParentId'](_0x4e34b7),{'verbose':_0x27233d[_0x1a2c0e(0x1cc)]}),_0x56c18a=_0x27c885[_0x1a2c0e(0x165)],{parentSegmentResult:_0x2628e2,segmentsResult:_0x409157,foldersResult:_0x78ee26,journeysWithDetailsResult:_0x172568,userMaps:_0x3ea9e1}=await withSpinner(_0x1a2c0e(0x1ad),async()=>{const _0x28676c=_0x1a2c0e,[_0x4053f8,_0x28e1ed,_0x5434ab,_0xed9c8a,_0x1e740b]=await Promise[_0x28676c(0x13e)]([_0x523549[_0x28676c(0x14a)][_0x28676c(0x163)](_0x56c18a),_0x523549[_0x28676c(0x14a)][_0x28676c(0x1a6)](_0x56c18a),_0x523549[_0x28676c(0x14a)][_0x28676c(0x141)](_0x56c18a),_0x523549[_0x28676c(0x168)][_0x28676c(0x19d)](_0x56c18a,{'includeAllVersions':!![]}),_0x523549[_0x28676c(0x1b1)][_0x28676c(0x16e)]()]);return{'parentSegmentResult':_0x4053f8,'segmentsResult':_0x28e1ed,'foldersResult':_0x5434ab,'journeysWithDetailsResult':_0xed9c8a,'userMaps':_0x1e740b};},{'verbose':_0x27233d[_0x1a2c0e(0x1cc)]})[_0x1a2c0e(0x1b4)](_0x4009c0=>_0x4009c0[_0x1a2c0e(0x165)]),_0x5df17c=_0x2628e2,_0x33676b=extractRootFolderId(_0x5df17c),_0x4bfd79=_0x409157,_0x1a496a=_0x78ee26,{journeys:_0x4ad14f,activationStepsById:_0x1145e6}=_0x172568,_0x29ddf8=new Map(_0x4ad14f[_0x1a2c0e(0x18e)](_0x23a9b3=>[_0x23a9b3['id'],_0x23a9b3])),_0x43ca2a=_0x4ad14f['map'](_0x3bcf4b=>({'id':_0x3bcf4b['id'],'name':_0x3bcf4b[_0x1a2c0e(0x193)][_0x1a2c0e(0x152)],'journeyBundleName':_0x3bcf4b[_0x1a2c0e(0x193)]['journeyBundleName']||'','journeyBundleId':_0x3bcf4b[_0x1a2c0e(0x193)][_0x1a2c0e(0x1ab)]||'','versionNumber':_0x3bcf4b[_0x1a2c0e(0x193)][_0x1a2c0e(0x1bf)],'description':_0x3bcf4b[_0x1a2c0e(0x193)][_0x1a2c0e(0x16c)],'state':_0x3bcf4b[_0x1a2c0e(0x193)][_0x1a2c0e(0x1a0)],'paused':_0x3bcf4b[_0x1a2c0e(0x193)][_0x1a2c0e(0x1aa)],'audienceId':_0x3bcf4b[_0x1a2c0e(0x193)]['audienceId'],'folderId':_0x3bcf4b['relationships']?.['parentFolder']?.[_0x1a2c0e(0x165)]?.['id'],'createdAt':_0x3bcf4b[_0x1a2c0e(0x193)]['createdAt'],'updatedAt':_0x3bcf4b['attributes'][_0x1a2c0e(0x182)]})),{emailToId:_0x430686,idToEmail:_0x3213e7}=_0x3ea9e1,_0x41132a=await withSpinner(_0x1a2c0e(0x161),async()=>{const _0x19cd0e=_0x1a2c0e,_0x5bae8b=await _0x523549['connection'][_0x19cd0e(0x171)]();return buildConnectionMaps(_0x5bae8b);},{'verbose':_0x27233d[_0x1a2c0e(0x1cc)]})[_0x1a2c0e(0x1b4)](_0x27b12a=>_0x27b12a[_0x1a2c0e(0x165)]),_0x33e656=_0x41132a['nameToId'],_0x84fbbd=_0x41132a[_0x1a2c0e(0x148)],_0x28dac4=_0x41132a[_0x1a2c0e(0x1cd)],_0x3dd35a={'emailToIdMap':_0x430686,'connectionNameToIdMap':_0x33e656,'connectionNameToTypeMap':_0x28dac4,'getSchema':_0x5e41fe=>_0x523549[_0x1a2c0e(0x1cb)][_0x1a2c0e(0x185)](_0x5e41fe)};let {pathToId:_0x36cd43,idToPath:_0x92c6c1}=buildFolderMaps(_0x1a496a);const _0x47aca5=buildSegmentLookupMap(_0x4bfd79,_0x92c6c1),_0x5c200c=buildSegmentNameToIdMap(_0x4bfd79),_0x28c386=buildJourneyBundleLookupMap(_0x43ca2a,_0x92c6c1);let _0x285829;if(_0x330054){if(!_0x330054[_0x1a2c0e(0x1a3)](_0x1a2c0e(0x174))&&!_0x330054[_0x1a2c0e(0x1a3)](_0x1a2c0e(0x155)))return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x14e)](_0x1a2c0e(0x188)+_0x330054+'\x0a')),0x1;_0x285829=[_0x330054];}else _0x285829=findYamlFiles(_0x33a158);if(_0x285829['length']===0x0)return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x14e)](_0x1a2c0e(0x1a1)+_0x33a158+'\x0a')),console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0x1a2c0e(0x13f))),0x1;let _0x1c9087,_0x26c8f5;try{const _0x557863=parseAndClassifyYamlFiles(_0x285829,_0x33a158,{'skipSegments':_0x27233d[_0x1a2c0e(0x1a8)]});_0x1c9087=_0x557863['segments'],_0x26c8f5=_0x557863[_0x1a2c0e(0x16b)];const _0x210df2=validateParsedFiles(_0x557863,_0x33a158);if(_0x210df2[_0x1a2c0e(0x198)]>0x0)return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x14e)](_0x1a2c0e(0x183))),console[_0x1a2c0e(0x1c2)](formatValidationErrors(_0x210df2)),console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x189)](_0x1a2c0e(0x17b))),0x1;}catch(_0x34ba11){return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x14e)]('Error\x20parsing\x20YAML:\x20'+(_0x34ba11 instanceof Error?_0x34ba11[_0x1a2c0e(0x180)]:_0x34ba11))),0x1;}if(_0x1c9087[_0x1a2c0e(0x198)]===0x0&&_0x26c8f5[_0x1a2c0e(0x198)]===0x0){const _0x532e5e=_0x27233d['journeysOnly']?_0x1a2c0e(0x168):'segment\x20or\x20journey';return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc['yellow'](_0x1a2c0e(0x178)+_0x532e5e+_0x1a2c0e(0x1bc))),0x0;}const _0x115850=new Map();_0x4bfd79[_0x1a2c0e(0x198)]>0x0&&!_0x27233d[_0x1a2c0e(0x1a8)]&&await withSpinner(_0x1a2c0e(0x1a7),async()=>{await batchAsync(_0x4bfd79,async _0x3d88bb=>{const _0x13a5c8=a38_0x1f9f,_0x235ff0=await _0x523549[_0x13a5c8(0x14a)][_0x13a5c8(0x13c)](_0x56c18a,_0x3d88bb['id']);_0x115850[_0x13a5c8(0x140)](_0x3d88bb['id'],_0x235ff0);});},{'verbose':_0x27233d[_0x1a2c0e(0x1cc)]});const {segmentFiles:_0xda830d,foldersToCreate:_0x1b3492}=await prepareSegmentFiles(_0x1c9087,{'segmentByFolderAndName':_0x47aca5,'activationsBySegmentId':_0x115850,'folderPathToId':_0x36cd43,'idToEmailMap':_0x3213e7,'connectionIdToNameMap':_0x84fbbd},_0x3dd35a,_0x4271cd,_0xdc3871),_0x3ca435=_0x330054?[]:findSegmentsToDelete(_0x4bfd79,_0x1c9087[_0x1a2c0e(0x18e)](({yamlConfig:_0x12334c,folderPath:_0x2c3c07})=>({'yamlConfig':_0x12334c,'folderPath':resolveTDFolderPath(_0x2c3c07,_0x4271cd,_0xdc3871)})),_0x92c6c1,_0xdc3871,_0x4271cd),{journeyFiles:_0x5a6a7d,foldersToCreate:_0x398f16}=await withProgressSpinner(_0x1a2c0e(0x18f),async _0x2cc79e=>prepareJourneyFiles(_0x26c8f5,{'fetchJourney':async _0x551864=>_0x523549[_0x1a2c0e(0x168)][_0x1a2c0e(0x1bb)](_0x551864['journeyId']),'journeyBundlesByFolderAndName':_0x28c386,'folderPathToId':_0x36cd43,'idToEmailMap':_0x3213e7,'connectionIdToNameMap':_0x84fbbd,'existingSegments':_0x4bfd79,'parentId':_0x56c18a,'deps':_0x523549,'progress':{'update':_0x37a5ac=>{const _0x172856=_0x1a2c0e;_0x2cc79e[_0x172856(0x1d2)](_0x37a5ac),_0x27233d[_0x172856(0x1cc)]&&console[_0x172856(0x1c2)]('\x20\x20'+_0x37a5ac);}},'journeyById':_0x29ddf8,'activationStepsById':_0x1145e6},_0x4271cd,_0xdc3871),{'verbose':_0x27233d[_0x1a2c0e(0x1cc)]})[_0x1a2c0e(0x1b4)](_0x2ce7bf=>_0x2ce7bf[_0x1a2c0e(0x165)]);for(const _0x42a6c7 of _0x398f16){_0x1b3492[_0x1a2c0e(0x186)](_0x42a6c7);}const _0x14bb77=_0x330054?[]:findJourneysToDelete(_0x43ca2a,_0x26c8f5['map'](({yamlConfig:_0x447d2b,folderPath:_0x3b5c24})=>({'yamlConfig':_0x447d2b,'folderPath':resolveTDFolderPath(_0x3b5c24,_0x4271cd,_0xdc3871)})),_0x92c6c1,_0xdc3871,_0x4271cd),_0x586e17=calculatePushStats(_0xda830d,_0x5a6a7d,_0x1b3492,_0x3ca435,_0x14bb77,!!_0x27233d[_0x1a2c0e(0x1d0)],!!_0x27233d['journeysOnly']),_0xed2b5a=_0x586e17[_0x1a2c0e(0x1b7)][_0x1a2c0e(0x136)],_0x5249dd=_0x586e17[_0x1a2c0e(0x1b7)][_0x1a2c0e(0x177)],_0x10e8d3=_0x586e17['segments'][_0x1a2c0e(0x1b0)],_0x907368=_0x586e17['segments'][_0x1a2c0e(0x1c0)],_0x2523e3=_0x586e17[_0x1a2c0e(0x17d)]['toCreate'],_0x329d4c=_0x586e17[_0x1a2c0e(0x16b)][_0x1a2c0e(0x136)],_0x1918d5=_0x586e17['journeys']['changed'],_0x26acf7=_0x586e17['journeys'][_0x1a2c0e(0x1b0)],_0xa03310=_0x586e17[_0x1a2c0e(0x16b)][_0x1a2c0e(0x1c0)],_0x5ecff0=_0x586e17[_0x1a2c0e(0x13a)][_0x1a2c0e(0x13e)],_0x1e8697=_0x586e17['activations']['toCreate'],_0xeaceca=_0x586e17[_0x1a2c0e(0x13a)][_0x1a2c0e(0x1af)],_0x20d31b=_0x586e17[_0x1a2c0e(0x13a)][_0x1a2c0e(0x1c0)];console[_0x1a2c0e(0x1c2)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4e34b7+'\x27:');_0x2523e3[_0x1a2c0e(0x198)]>0x0&&console[_0x1a2c0e(0x1c2)]('\x20\x20'+a38_0xfb3ffc[_0x1a2c0e(0x187)](_0x1a2c0e(0x1c4)+_0x2523e3[_0x1a2c0e(0x198)]+_0x1a2c0e(0x18d)));if(!_0x27233d[_0x1a2c0e(0x1a8)]){console['error'](_0x1a2c0e(0x1a9)),console[_0x1a2c0e(0x1c2)]('\x20\x20\x20\x20'+a38_0xfb3ffc['green']('+\x20'+_0xed2b5a['length']+_0x1a2c0e(0x1c8))),console['error']('\x20\x20\x20\x20'+a38_0xfb3ffc[_0x1a2c0e(0x189)]('~\x20'+_0x5249dd[_0x1a2c0e(0x198)]+'\x20changed'));if(_0x907368['length']>0x0)console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x15d)+a38_0xfb3ffc['red']('-\x20'+_0x907368[_0x1a2c0e(0x198)]+'\x20to\x20delete'));else _0x3ca435[_0x1a2c0e(0x198)]>0x0&&!_0x27233d[_0x1a2c0e(0x1d0)]&&console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x1ae)](_0x3ca435[_0x1a2c0e(0x198)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x1ae)]('=\x20'+_0x10e8d3[_0x1a2c0e(0x198)]+_0x1a2c0e(0x1ba)));}if(_0x5a6a7d[_0x1a2c0e(0x198)]>0x0||_0x14bb77[_0x1a2c0e(0x198)]>0x0){console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x1c7)),console['error'](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x143)]('+\x20'+_0x329d4c[_0x1a2c0e(0x198)]+_0x1a2c0e(0x1c8))),console[_0x1a2c0e(0x1c2)]('\x20\x20\x20\x20'+a38_0xfb3ffc[_0x1a2c0e(0x189)]('~\x20'+_0x1918d5[_0x1a2c0e(0x198)]+_0x1a2c0e(0x150)));if(_0xa03310[_0x1a2c0e(0x198)]>0x0)console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x14e)]('-\x20'+_0xa03310[_0x1a2c0e(0x198)]+_0x1a2c0e(0x1a4)));else _0x14bb77['length']>0x0&&!_0x27233d[_0x1a2c0e(0x1d0)]&&console['error'](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x1ae)](_0x14bb77['length']+_0x1a2c0e(0x134)));console['error'](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x1ae)]('=\x20'+_0x26acf7[_0x1a2c0e(0x198)]+_0x1a2c0e(0x1ba)));}_0x5ecff0[_0x1a2c0e(0x198)]>0x0&&!_0x27233d[_0x1a2c0e(0x1a8)]&&(console[_0x1a2c0e(0x1c2)](''),console[_0x1a2c0e(0x1c2)]('\x20\x20Activations:'),_0x1e8697['length']>0x0&&console['error'](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x143)]('+\x20'+_0x1e8697[_0x1a2c0e(0x198)]+_0x1a2c0e(0x196))),_0xeaceca[_0x1a2c0e(0x198)]>0x0&&console['error'](_0x1a2c0e(0x15d)+a38_0xfb3ffc['yellow']('~\x20'+_0xeaceca['length']+_0x1a2c0e(0x14c))),_0x20d31b[_0x1a2c0e(0x198)]>0x0&&console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x15d)+a38_0xfb3ffc[_0x1a2c0e(0x14e)]('-\x20'+_0x20d31b['length']+'\x20to\x20delete')));console[_0x1a2c0e(0x1c2)](_0x1a2c0e(0x17a)+a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0x33a158)+'\x0a');if(_0x2523e3[_0x1a2c0e(0x198)]>0x0){console['error'](_0x1a2c0e(0x1b5));for(const _0x4ad4be of _0x2523e3){console[_0x1a2c0e(0x1c2)]('\x20\x20'+a38_0xfb3ffc['blue']('+')+'\x20'+_0x4ad4be);}console[_0x1a2c0e(0x1c2)]('');}if(_0xed2b5a[_0x1a2c0e(0x198)]>0x0&&!_0x27233d[_0x1a2c0e(0x1a8)])for(const _0xb78fed of _0xed2b5a){const _0x3999b1=_0xb78fed[_0x1a2c0e(0x195)]?_0xb78fed[_0x1a2c0e(0x195)]+'/'+_0xb78fed['yamlConfig'][_0x1a2c0e(0x152)]:_0xb78fed[_0x1a2c0e(0x184)][_0x1a2c0e(0x152)],_0x431aa4=_0xb78fed[_0x1a2c0e(0x184)]['activations']?.['length']||0x0,_0x2391d7=_0x431aa4>0x0?a38_0xfb3ffc[_0x1a2c0e(0x1ae)]('\x20['+_0x431aa4+_0x1a2c0e(0x133)):'';console[_0x1a2c0e(0x1c2)]('\x0a'+a38_0xfb3ffc[_0x1a2c0e(0x143)](_0x1a2c0e(0x16d))+'\x20'+_0x3999b1+_0x2391d7),console['error']('β'[_0x1a2c0e(0x175)](0x3c)),_0xb78fed[_0x1a2c0e(0x14b)]&&console[_0x1a2c0e(0x1c2)](_0xb78fed[_0x1a2c0e(0x14b)]),console[_0x1a2c0e(0x1c2)]('β'[_0x1a2c0e(0x175)](0x3c));}if(_0x907368[_0x1a2c0e(0x198)]>0x0&&!_0x27233d[_0x1a2c0e(0x1a8)])for(const _0x383be3 of _0x907368){const _0xe1d473=_0x383be3['segmentFolderId']?_0x92c6c1[_0x1a2c0e(0x1d3)](_0x383be3['segmentFolderId'][_0x1a2c0e(0x194)]())||'':'',_0x2475ad=_0xe1d473?_0xe1d473+'/'+_0x383be3[_0x1a2c0e(0x152)]:_0x383be3[_0x1a2c0e(0x152)],_0x2b17ff=_0x115850[_0x1a2c0e(0x1d3)](_0x383be3['id'])||[],_0x16882f=_0x2b17ff[_0x1a2c0e(0x198)]>0x0?a38_0xfb3ffc['dim']('\x20['+_0x2b17ff[_0x1a2c0e(0x198)]+_0x1a2c0e(0x133)):'';console[_0x1a2c0e(0x1c2)]('\x0a'+a38_0xfb3ffc['red'](_0x1a2c0e(0x139))+'\x20'+_0x2475ad+_0x16882f),console[_0x1a2c0e(0x1c2)]('β'['repeat'](0x3c));const _0x6d364a=segmentWithActivationsToYaml(_0x383be3,_0x2b17ff,undefined,_0x3213e7,_0x84fbbd),_0x3e947d=segmentToYamlString(_0x6d364a),_0x57d45c=generateDiff(_0x3e947d,'');console[_0x1a2c0e(0x1c2)](formatDiffWithColors(_0x57d45c)),console['error']('β'[_0x1a2c0e(0x175)](0x3c));}const _0x2b43f1=_0xda830d[_0x1a2c0e(0x15b)](_0x350168=>!_0x350168[_0x1a2c0e(0x164)]&&_0x350168[_0x1a2c0e(0x14b)]);if(_0x2b43f1[_0x1a2c0e(0x198)]>0x0&&!_0x27233d[_0x1a2c0e(0x1a8)])for(const _0x5d75cd of _0x2b43f1){const _0x268021=_0x5d75cd[_0x1a2c0e(0x195)]?_0x5d75cd[_0x1a2c0e(0x195)]+'/'+_0x5d75cd[_0x1a2c0e(0x184)][_0x1a2c0e(0x152)]:_0x5d75cd[_0x1a2c0e(0x184)][_0x1a2c0e(0x152)];console[_0x1a2c0e(0x1c2)]('\x0a'+a38_0xfb3ffc[_0x1a2c0e(0x189)](_0x1a2c0e(0x159))+'\x20'+_0x268021),console[_0x1a2c0e(0x1c2)]('β'['repeat'](0x3c)),console['error'](_0x5d75cd[_0x1a2c0e(0x14b)]),console[_0x1a2c0e(0x1c2)]('β'['repeat'](0x3c));}if(_0x329d4c[_0x1a2c0e(0x198)]>0x0)for(const _0x1e5a85 of _0x329d4c){const _0x45945d=_0x1e5a85[_0x1a2c0e(0x195)]?_0x1e5a85[_0x1a2c0e(0x195)]+'/'+_0x1e5a85[_0x1a2c0e(0x184)][_0x1a2c0e(0x152)]:_0x1e5a85[_0x1a2c0e(0x184)]['name'];console['error']('\x0a'+a38_0xfb3ffc['green']('New\x20journey:')+'\x20'+_0x45945d),console[_0x1a2c0e(0x1c2)]('β'[_0x1a2c0e(0x175)](0x3c)),_0x1e5a85[_0x1a2c0e(0x14b)]&&console['error'](_0x1e5a85[_0x1a2c0e(0x14b)]),console[_0x1a2c0e(0x1c2)]('β'[_0x1a2c0e(0x175)](0x3c));}const _0x644d60=_0x5a6a7d[_0x1a2c0e(0x15b)](_0x14099b=>!_0x14099b[_0x1a2c0e(0x164)]&&_0x14099b[_0x1a2c0e(0x14b)]);if(_0x644d60[_0x1a2c0e(0x198)]>0x0)for(const _0x2e236e of _0x644d60){const _0x22242c=_0x2e236e['folderPath']?_0x2e236e[_0x1a2c0e(0x195)]+'/'+_0x2e236e[_0x1a2c0e(0x184)][_0x1a2c0e(0x152)]:_0x2e236e['yamlConfig'][_0x1a2c0e(0x152)];console[_0x1a2c0e(0x1c2)]('\x0a'+a38_0xfb3ffc[_0x1a2c0e(0x189)]('Changes\x20to\x20journey:')+'\x20'+_0x22242c),console[_0x1a2c0e(0x1c2)]('β'[_0x1a2c0e(0x175)](0x3c)),console[_0x1a2c0e(0x1c2)](_0x2e236e[_0x1a2c0e(0x14b)]),console[_0x1a2c0e(0x1c2)]('β'[_0x1a2c0e(0x175)](0x3c));}if(_0xa03310[_0x1a2c0e(0x198)]>0x0)for(const _0x5317a6 of _0xa03310){const _0x220328=_0x5317a6[_0x1a2c0e(0x167)]?_0x92c6c1['get'](_0x5317a6[_0x1a2c0e(0x167)])||'':'',_0x300608=_0x220328?_0x220328+'/'+_0x5317a6[_0x1a2c0e(0x162)]:_0x5317a6[_0x1a2c0e(0x162)];console[_0x1a2c0e(0x1c2)]('\x0a'+a38_0xfb3ffc[_0x1a2c0e(0x14e)](_0x1a2c0e(0x1c3))+'\x20'+_0x300608),console[_0x1a2c0e(0x1c2)]('β'[_0x1a2c0e(0x175)](0x3c)),console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x14e)](_0x1a2c0e(0x154))),console['error']('β'[_0x1a2c0e(0x175)](0x3c));}if(_0x27233d[_0x1a2c0e(0x19e)])return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc['yellow'](_0x1a2c0e(0x16f))),0x0;const _0x51ae06=_0x27233d[_0x1a2c0e(0x1a8)]?![]:_0xed2b5a[_0x1a2c0e(0x198)]>0x0||_0x5249dd[_0x1a2c0e(0x198)]>0x0||_0x907368[_0x1a2c0e(0x198)]>0x0,_0x529c02=_0x329d4c[_0x1a2c0e(0x198)]>0x0||_0x1918d5[_0x1a2c0e(0x198)]>0x0||_0xa03310['length']>0x0,_0x112ac3=_0x27233d[_0x1a2c0e(0x1a8)]?![]:_0x5ecff0['length']>0x0,_0x2869ed=_0x2523e3[_0x1a2c0e(0x198)]>0x0;if(!_0x51ae06&&!_0x529c02&&!_0x112ac3&&!_0x2869ed){const _0x19d490=_0x27233d[_0x1a2c0e(0x1a8)]?_0x1a2c0e(0x17f):_0x1a2c0e(0x135);console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x143)](_0x19d490));if(_0x330054&&_0x10e8d3[_0x1a2c0e(0x198)]===0x1){const _0x265c5c=_0x10e8d3[0x0];if(_0x265c5c[_0x1a2c0e(0x15c)]?.['id']){const _0x38fac3=getConsoleNextUrl(_0x27233d[_0x1a2c0e(0x1b8)],_0x1a2c0e(0x169)+_0x56c18a+_0x1a2c0e(0x153)+_0x265c5c[_0x1a2c0e(0x15c)]['id']+'/sb/da/esr');console[_0x1a2c0e(0x1c2)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0x38fac3));}}if(_0x330054&&_0x26acf7['length']===0x1){const _0x44e960=_0x26acf7[0x0];if(_0x44e960[_0x1a2c0e(0x146)]?.['id']){const _0x51705f=getConsoleNextUrl(_0x27233d['site'],'/app/ps/'+_0x56c18a+'/e/'+_0x44e960[_0x1a2c0e(0x146)]['id']+_0x1a2c0e(0x19f));console[_0x1a2c0e(0x1c2)]('\x20\x20'+a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0x51705f));}}return 0x0;}const _0x5c9b36=_0x27233d[_0x1a2c0e(0x1a8)]?_0x329d4c['length']+_0x1918d5[_0x1a2c0e(0x198)]+_0xa03310['length']+_0x2523e3[_0x1a2c0e(0x198)]:_0xed2b5a[_0x1a2c0e(0x198)]+_0x5249dd[_0x1a2c0e(0x198)]+_0x907368[_0x1a2c0e(0x198)]+_0x329d4c[_0x1a2c0e(0x198)]+_0x1918d5['length']+_0xa03310[_0x1a2c0e(0x198)]+_0x2523e3['length']+_0x5ecff0[_0x1a2c0e(0x198)];if(!_0x27233d['yes']&&_0x5c9b36>0x0){if(!isInteractive())return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x14e)](_0x1a2c0e(0x144)),_0x1a2c0e(0x166)),console['error'](a38_0xfb3ffc['dim'](_0x1a2c0e(0x170))),0x1;const _0x724e32=await confirmKey('Push\x20'+_0x5c9b36+_0x1a2c0e(0x17c));if(!_0x724e32)return console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc['yellow'](_0x1a2c0e(0x197))),0x1;}const _0x52b3b4={'withProgress':async(_0x4c7090,_0x39442c)=>{const _0x4a2d51=_0x1a2c0e,_0x4a1976=await withSpinner(_0x4c7090,_0x39442c,{'verbose':_0x27233d[_0x4a2d51(0x1cc)]});return{'data':_0x4a1976[_0x4a2d51(0x165)]};},'logInfo':_0x3e880a=>console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x187)]('β\x20'+_0x3e880a)),'logSuccess':_0x4b1299=>console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x143)]('β\x20'+_0x4b1299)),'logWarning':_0x4fe600=>console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc['yellow']('β \x20'+_0x4fe600)),'logDeleted':_0x5786bb=>console['error'](a38_0xfb3ffc[_0x1a2c0e(0x14e)]('β\x20'+_0x5786bb))},_0x283121={'segment':_0x523549['segment'],'journey':_0x523549[_0x1a2c0e(0x168)],'user':_0x523549[_0x1a2c0e(0x1b1)],'connection':_0x523549['connection']};_0x2523e3[_0x1a2c0e(0x198)]>0x0&&(_0x36cd43=await executePushFolders(_0x283121,_0x2523e3,_0x36cd43,{'parentId':_0x56c18a},_0x52b3b4));const _0x277654={'rootFolderId':_0x33676b,'folderPathToId':_0x36cd43,'folderIdToPath':_0x92c6c1,'segmentNameToId':_0x5c200c,'activationsBySegmentId':_0x115850,'emailToIdMap':_0x430686,'idToEmailMap':_0x3213e7,'connectionNameToIdMap':_0x41132a[_0x1a2c0e(0x190)],'connectionIdToNameMap':_0x41132a[_0x1a2c0e(0x148)],'connectionNameToTypeMap':_0x28dac4},_0x500758=await executePushSegments(_0x283121,_0x27233d[_0x1a2c0e(0x1a8)]?[]:_0xda830d,_0x277654,{'parentId':_0x56c18a},_0x52b3b4),_0x8d16bf=_0x500758[_0x1a2c0e(0x156)],_0x22decd=_0x500758[_0x1a2c0e(0x191)],_0x5d5736=_0x500758[_0x1a2c0e(0x13a)][_0x1a2c0e(0x156)],_0x3a86ed=_0x500758[_0x1a2c0e(0x13a)]['updated'],_0x35dbe4=_0x500758[_0x1a2c0e(0x13a)]['deleted'];let _0x941156;if(_0x330054&&_0xda830d[_0x1a2c0e(0x198)]===0x1){const _0x5223ef=_0xda830d[0x0];_0x941156=_0x5223ef[_0x1a2c0e(0x15c)]?.['id']??_0x500758[_0x1a2c0e(0x1cf)][_0x1a2c0e(0x1d3)](_0x5223ef[_0x1a2c0e(0x184)]['name']);}const _0x3d5d52=await executePushSegmentDeletions(_0x283121,_0x27233d[_0x1a2c0e(0x1a8)]?[]:_0x907368,_0x52b3b4);let _0xcb913e=0x0,_0x42b054=0x0,_0x5b00d8=0x0;const _0x755ba2=new Map(_0x5c200c);for(const [_0x2de4ff,_0x19c915]of _0x500758[_0x1a2c0e(0x1cf)]){_0x755ba2[_0x1a2c0e(0x140)](_0x2de4ff,_0x19c915);}if(_0x5a6a7d[_0x1a2c0e(0x198)]>0x0){const _0x56ef3a={..._0x277654,'segmentNameToId':_0x755ba2,'existingSegments':_0x4bfd79,'activationContext':_0x3dd35a},_0x52f27e=await executePushJourneys(_0x283121,_0x5a6a7d,_0x56ef3a,{'parentId':_0x56c18a,'rootFolderId':_0x33676b,'verbose':_0x27233d[_0x1a2c0e(0x1cc)]},_0x52b3b4);_0xcb913e=_0x52f27e[_0x1a2c0e(0x156)],_0x42b054=_0x52f27e[_0x1a2c0e(0x191)];if(_0x330054&&_0x52f27e[_0x1a2c0e(0x157)][_0x1a2c0e(0x198)]===0x1){const _0x2ef5c4=_0x52f27e[_0x1a2c0e(0x157)][0x0];if(_0x2ef5c4['journeyId']){const _0xa117c7=getConsoleNextUrl(_0x27233d[_0x1a2c0e(0x1b8)],_0x1a2c0e(0x169)+_0x56c18a+_0x1a2c0e(0x153)+_0x2ef5c4['journeyId']+_0x1a2c0e(0x19f));console[_0x1a2c0e(0x1c2)]('\x20\x20'+a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0xa117c7));}}}for(const _0x230bb5 of _0xa03310){console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc['yellow'](_0x1a2c0e(0x1a2)+_0x230bb5[_0x1a2c0e(0x162)])),_0x5b00d8++;}const _0x3fbc1c=[];if(_0x8d16bf>0x0)_0x3fbc1c[_0x1a2c0e(0x14f)](_0x8d16bf+'\x20created');if(_0x22decd>0x0)_0x3fbc1c['push'](_0x22decd+_0x1a2c0e(0x19b));if(_0x3d5d52>0x0)_0x3fbc1c[_0x1a2c0e(0x14f)](_0x3d5d52+'\x20deleted');const _0x10451d=[];if(_0xcb913e>0x0)_0x10451d[_0x1a2c0e(0x14f)](_0xcb913e+_0x1a2c0e(0x192));if(_0x42b054>0x0)_0x10451d[_0x1a2c0e(0x14f)](_0x42b054+'\x20updated');if(_0x5b00d8>0x0)_0x10451d[_0x1a2c0e(0x14f)](_0x5b00d8+_0x1a2c0e(0x1ce));const _0x2e2cfc=[];if(_0x5d5736>0x0)_0x2e2cfc[_0x1a2c0e(0x14f)](_0x5d5736+_0x1a2c0e(0x192));if(_0x3a86ed>0x0)_0x2e2cfc['push'](_0x3a86ed+_0x1a2c0e(0x19b));if(_0x35dbe4>0x0)_0x2e2cfc['push'](_0x35dbe4+_0x1a2c0e(0x1ce));console[_0x1a2c0e(0x1c2)](a38_0xfb3ffc[_0x1a2c0e(0x143)](_0x1a2c0e(0x158)));_0x3fbc1c[_0x1a2c0e(0x198)]>0x0&&!_0x27233d[_0x1a2c0e(0x1a8)]&&console[_0x1a2c0e(0x1c2)]('\x20\x20Segments:\x20'+_0x3fbc1c[_0x1a2c0e(0x181)](',\x20'));_0x10451d[_0x1a2c0e(0x198)]>0x0&&console[_0x1a2c0e(0x1c2)]('\x20\x20Journeys:\x20'+_0x10451d[_0x1a2c0e(0x181)](',\x20'));_0x2e2cfc['length']>0x0&&!_0x27233d[_0x1a2c0e(0x1a8)]&&console['error'](_0x1a2c0e(0x1c6)+_0x2e2cfc[_0x1a2c0e(0x181)](',\x20'));if(_0x941156){const _0x4deaa1=getConsoleNextUrl(_0x27233d[_0x1a2c0e(0x1b8)],_0x1a2c0e(0x169)+_0x56c18a+_0x1a2c0e(0x153)+_0x941156+_0x1a2c0e(0x15f));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a38_0xfb3ffc[_0x1a2c0e(0x13d)](_0x4deaa1));}return 0x0;}}
|