@treasuredata/tdx 2026.3.9 → 2026.3.10
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/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.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.d.ts +12 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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 a34_0x10ae5f=a34_0x3771;(function(_0x5670ed,_0x52cc26){const _0x3efe11=a34_0x3771,_0x1fd5bf=_0x5670ed();while(!![]){try{const _0x190a76=parseInt(_0x3efe11(0x1db))/0x1+parseInt(_0x3efe11(0x230))/0x2+-parseInt(_0x3efe11(0x244))/0x3*(parseInt(_0x3efe11(0x1d3))/0x4)+-parseInt(_0x3efe11(0x245))/0x5*(-parseInt(_0x3efe11(0x1fc))/0x6)+parseInt(_0x3efe11(0x242))/0x7*(-parseInt(_0x3efe11(0x202))/0x8)+parseInt(_0x3efe11(0x241))/0x9+-parseInt(_0x3efe11(0x1e2))/0xa;if(_0x190a76===_0x52cc26)break;else _0x1fd5bf['push'](_0x1fd5bf['shift']());}catch(_0x36b6e8){_0x1fd5bf['push'](_0x1fd5bf['shift']());}}}(a34_0x5735,0x262a7));import{BaseCommand}from'./command.js';function a34_0x5735(){const _0xebb885=['job_id','length','Schedule\x20deleted:\x20','Updating\x20schedule:\x20','ended_at','output','d\x20ago','jobs','scheduled_at','name','statusIcon','user','(unnamed)','max','user_name','\x20\x20Type:\x20','log','status','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','query','schedule:update','293898gZeMiR','\x20scheduled\x20quer','tsv','schedule:delete','schedule:history','limit','Found\x20','type','create','Creating\x20schedule:\x20','cron','Run\x20a\x20scheduled\x20query\x20immediately','dim','No\x20scheduled\x20queries\x20found','created_at','delay','join','2354940GGTkjl','77BOvLRq','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','10539GUlapR','785EXVUQY','green','Query\x20file\x20is\x20empty','Schedule\x20created:\x20','priority','\x20execution','getTime','\x20schedules','jsonl','Running\x20schedule...','schedules','format','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Creating\x20schedule...','file','INVALID_ARGUMENT','\x20matching\x20\x22','...','listQueries','padEnd','schedule:run','substring','json','red','yes','queries','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Create\x20a\x20scheduled\x20query','map','execute','328yYLGSk','start_at','run','never','retry_limit','Deleting\x20schedule...','round','\x22...','213569iaxqmm','options','\x20created','timezone','time','abs','ies','1976230rzwJtn','\x20\x20Time:\x20','trino','Show\x20schedule\x20execution\x20history','\x20\x20Job\x20ID:\x20','Schedule\x20run\x20submitted:\x20','Failed\x20to\x20read\x20file:\x20','in\x20','engineVersion','\x20job','executing_user_id','Updating\x20schedule...','Getting\x20schedule\x20history...','last_job','count','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','has_next_page','engine_version','h\x20ago','result','repeat','table','verbose','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20\x20Num:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','7974ujiAAi','pagination','error','entries','m\x20ago','description','137320JaLsTV','next_run_at','lastRun','num','data','Delete\x20a\x20scheduled\x20query','time_zone','toLocaleDateString','success','site','args','database','just\x20now','validate','nextRun','history','utf-8','schedule:create','from','retryLimit','Running\x20schedule:\x20','List\x20scheduled\x20queries','\x20\x20Database:\x20','schedule:show','soon'];a34_0x5735=function(){return _0xebb885;};return a34_0x5735();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x1de258 from'chalk';function formatRelativeTime(_0x55edf3){const _0x425af0=a34_0x3771,_0x2a3cac=new Date(_0x55edf3),_0x2f0a4a=new Date(),_0x491fbe=_0x2a3cac['getTime']()-_0x2f0a4a[_0x425af0(0x24b)](),_0x56141a=Math[_0x425af0(0x1e0)](_0x491fbe)/0x3e8,_0x2ab113=_0x491fbe<0x0;if(_0x56141a<0x3c)return _0x2ab113?_0x425af0(0x20e):_0x425af0(0x21a);else{if(_0x56141a<0xe10){const _0x5b7c16=Math[_0x425af0(0x1d9)](_0x56141a/0x3c);return _0x2ab113?_0x5b7c16+_0x425af0(0x200):'in\x20'+_0x5b7c16+'m';}else{if(_0x56141a<0x15180){const _0x17bc6d=Math[_0x425af0(0x1d9)](_0x56141a/0xe10);return _0x2ab113?_0x17bc6d+_0x425af0(0x1f4):_0x425af0(0x1e9)+_0x17bc6d+'h';}else{if(_0x56141a<0x93a80){const _0x1cdc44=Math['round'](_0x56141a/0x15180);return _0x2ab113?_0x1cdc44+_0x425af0(0x221):_0x425af0(0x1e9)+_0x1cdc44+'d';}else return _0x2a3cac[_0x425af0(0x209)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x10ae5f(0x224)]='schedule:list';[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x217);async[a34_0x10ae5f(0x1d2)](_0x8b5a15){const _0x557c49=a34_0x10ae5f,{options:_0x5860c5,args:_0x226e6b,tdx:_0x1c5a4c}=_0x8b5a15,_0x493fdb=resolveLimit(_0x5860c5[_0x557c49(0x235)],DEFAULT_DISPLAY_LIMIT),_0xee06b1=_0x226e6b[0x0],_0x5d5b57=_0xee06b1?_0x557c49(0x1f9)+_0xee06b1+_0x557c49(0x1da):'Listing\x20scheduled\x20queries...',_0x2c1c51=await withSpinner(_0x5d5b57,()=>_0x1c5a4c[_0x557c49(0x24f)][_0x557c49(0x1c7)]({'limit':_0x493fdb,'scheduled':!![],'pattern':_0xee06b1}),{'verbose':_0x5860c5['verbose']}),_0x4966bb=_0x2c1c51[_0x557c49(0x206)][_0x557c49(0x1ce)],_0x5cd4b2=_0x2c1c51[_0x557c49(0x206)][_0x557c49(0x1fd)][_0x557c49(0x1f2)],_0x1ae254=_0xee06b1?_0x557c49(0x255)+_0xee06b1+'\x22':'';_0x5cd4b2?console['error']('Showing\x20first\x20'+_0x4966bb[_0x557c49(0x21c)]+_0x557c49(0x24c)+_0x1ae254+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x557c49(0x1fe)](_0x557c49(0x236)+_0x4966bb[_0x557c49(0x21c)]+_0x557c49(0x231)+(_0x4966bb[_0x557c49(0x21c)]!==0x1?_0x557c49(0x1e1):'y')+_0x1ae254);if(_0x5860c5['format']===_0x557c49(0x1cb)||_0x5860c5['format']===_0x557c49(0x24d)||_0x5860c5['format']===_0x557c49(0x1f7)||_0x5860c5[_0x557c49(0x250)]===_0x557c49(0x232)){const _0x5b1ad2=_0x4966bb[_0x557c49(0x1d1)](_0x51ab3c=>({'id':_0x51ab3c['id'],'name':_0x51ab3c[_0x557c49(0x224)],'cron':_0x51ab3c[_0x557c49(0x23a)],'database':_0x51ab3c['database']?.['name'],'type':_0x51ab3c[_0x557c49(0x237)],'timezone':_0x51ab3c[_0x557c49(0x208)],'user_name':_0x51ab3c[_0x557c49(0x226)]?.[_0x557c49(0x224)],'updated_at':_0x51ab3c['updated_at'],'next_run_at':_0x51ab3c['next_run_at'],'last_job_status':_0x51ab3c[_0x557c49(0x1ef)]?.[_0x557c49(0x22c)]}));await handleSDKOutput(_0x5b1ad2,_0x5860c5);}else{if(_0x4966bb[_0x557c49(0x21c)]===0x0)console[_0x557c49(0x22b)](_0x557c49(0x23d));else{const _0x3376d7=_0x5860c5[_0x557c49(0x20b)],_0x23264c=_0x4966bb[_0x557c49(0x1d1)](_0x17e893=>{const _0x17efe2=_0x557c49,_0x3b1a3c=_0x17e893[_0x17efe2(0x1ef)]?.[_0x17efe2(0x22c)]?_0x17e893[_0x17efe2(0x1ef)][_0x17efe2(0x22c)]===_0x17efe2(0x20a)?'✓':'✗':'-',_0x4b56e5=_0x17e893[_0x17efe2(0x1ef)]?.[_0x17efe2(0x21f)]?formatRelativeTime(_0x17e893[_0x17efe2(0x1ef)]['ended_at']):_0x17efe2(0x1d6),_0x53346e=_0x17e893['next_run_at']?formatRelativeTime(_0x17e893[_0x17efe2(0x203)]):'-',_0x240ddd=_0x17e893['cron']||'',_0x57f46b=_0x17e893[_0x17efe2(0x224)]||_0x17efe2(0x227),_0x326b85=getConsoleUrl(_0x3376d7,'/app/queries/editor?queryId='+_0x17e893['id']);return{'statusIcon':_0x3b1a3c,'lastRun':_0x4b56e5,'nextRun':_0x53346e,'cron':_0x240ddd,'name':_0x57f46b,'queryUrl':_0x326b85,'status':_0x17e893[_0x17efe2(0x1ef)]?.[_0x17efe2(0x22c)]};}),_0x633590=Math[_0x557c49(0x228)](..._0x23264c[_0x557c49(0x1d1)](_0x26bb49=>_0x26bb49[_0x557c49(0x204)]['length'])),_0x329948=Math['max'](..._0x23264c[_0x557c49(0x1d1)](_0x2dce57=>_0x2dce57[_0x557c49(0x210)][_0x557c49(0x21c)])),_0x55efeb=Math[_0x557c49(0x228)](..._0x23264c[_0x557c49(0x1d1)](_0x3c4d24=>_0x3c4d24['cron'][_0x557c49(0x21c)])),_0x384a04=_0x23264c[_0x557c49(0x1d1)](_0x24299d=>{const _0x33a00c=_0x557c49,_0x386782=_0x24299d[_0x33a00c(0x22c)]===_0x33a00c(0x20a)?a34_0x1de258[_0x33a00c(0x246)](_0x24299d[_0x33a00c(0x225)]):_0x24299d['status']===_0x33a00c(0x1fe)?a34_0x1de258[_0x33a00c(0x1cc)](_0x24299d[_0x33a00c(0x225)]):a34_0x1de258[_0x33a00c(0x23c)](_0x24299d[_0x33a00c(0x225)]),_0x383c5c=_0x24299d[_0x33a00c(0x204)][_0x33a00c(0x1c8)](_0x633590),_0x1cf4bc=_0x24299d[_0x33a00c(0x210)][_0x33a00c(0x1c8)](_0x329948),_0x4f13fd=_0x24299d['cron']?a34_0x1de258['cyan'](_0x24299d['cron'][_0x33a00c(0x1c8)](_0x55efeb)):'\x20'[_0x33a00c(0x1f6)](_0x55efeb),_0x3f135b=hyperlink(_0x24299d[_0x33a00c(0x224)],_0x24299d['queryUrl']);return'📅\x20'+_0x386782+'\x20'+_0x383c5c+'\x20\x20→\x20'+_0x1cf4bc+'\x20\x20'+_0x4f13fd+'\x20\x20'+_0x3f135b;});await writeOutput(_0x384a04[_0x557c49(0x240)]('\x0a'),_0x5860c5[_0x557c49(0x220)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x219);[a34_0x10ae5f(0x201)]='Show\x20schedule\x20details';[a34_0x10ae5f(0x20f)](_0x1eeb7c){const _0x420b72=a34_0x10ae5f,_0x4d2995=_0x1eeb7c[_0x420b72(0x20c)][0x0];if(!_0x4d2995)return _0x420b72(0x22d);return undefined;}async[a34_0x10ae5f(0x1d2)](_0x4f6caa){const _0x273d66=a34_0x10ae5f,{options:_0x4c9154,args:_0xfc488b,tdx:_0x5a110f}=_0x4f6caa,_0x1154d2=_0xfc488b[0x0],_0x80599d=await withSpinner('Getting\x20schedule\x20details...',()=>_0x5a110f['schedules']['show'](_0x1154d2),{'verbose':_0x4c9154[_0x273d66(0x1f8)]}),_0xd9d124=_0x80599d[_0x273d66(0x206)],_0x1bb391={'name':_0xd9d124[_0x273d66(0x224)],'cron':_0xd9d124[_0x273d66(0x23a)],'database':_0xd9d124['database'],'type':_0xd9d124[_0x273d66(0x237)],'timezone':_0xd9d124[_0x273d66(0x1de)],'user_name':_0xd9d124[_0x273d66(0x229)],'created_at':_0xd9d124[_0x273d66(0x23e)],'engine_version':_0xd9d124[_0x273d66(0x1f3)],'executing_user_id':_0xd9d124[_0x273d66(0x1ec)],'query':_0xd9d124[_0x273d66(0x22e)],'delay':_0xd9d124[_0x273d66(0x23f)],'priority':_0xd9d124[_0x273d66(0x249)],'retry_limit':_0xd9d124[_0x273d66(0x1d7)],..._0xd9d124[_0x273d66(0x1f5)]&&{'result':_0xd9d124[_0x273d66(0x1f5)]}};return await handleSingleObjectOutput(_0x1bb391,_0x4c9154),0x0;}}function a34_0x3771(_0x2b5a00,_0x18267c){_0x2b5a00=_0x2b5a00-0x1c6;const _0x573588=a34_0x5735();let _0x377166=_0x573588[_0x2b5a00];return _0x377166;}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x10ae5f(0x213);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x1d0);['validate'](_0x148518){const _0x1a86a8=a34_0x10ae5f,_0x3d7083=_0x148518['args'][0x0];if(!_0x3d7083)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x12a9db=_0x148518[_0x1a86a8(0x1dc)];if(!_0x12a9db[_0x1a86a8(0x20d)])return _0x1a86a8(0x243);return undefined;}async['execute'](_0xa17e3a){const _0x1c1424=a34_0x10ae5f,{options:_0x18d024,args:_0xf2dc0c,tdx:_0x33f3a1}=_0xa17e3a,_0x4b234c=_0xf2dc0c[0x0],_0x552d39=_0x18d024,_0x36c120=_0x552d39[_0x1c1424(0x20d)],_0x332541=_0x552d39[_0x1c1424(0x253)],_0x1de2fd=_0x552d39[_0x1c1424(0x237)]||_0x1c1424(0x1e4);let _0x3edba2;try{_0x3edba2=readFileSync(_0x332541,'utf-8')['trim']();}catch(_0x5e2ece){throw new SDKError(ErrorCode[_0x1c1424(0x254)],_0x1c1424(0x1e8)+_0x332541,_0x5e2ece instanceof Error?_0x5e2ece:undefined);}if(!_0x3edba2)throw new SDKError(ErrorCode[_0x1c1424(0x254)],_0x1c1424(0x247));const _0x4dbcca={'database':_0x36c120,'query':_0x3edba2,'type':_0x1de2fd};if(_0x552d39[_0x1c1424(0x23a)])_0x4dbcca['cron']=_0x552d39[_0x1c1424(0x23a)];if(_0x552d39['timezone'])_0x4dbcca[_0x1c1424(0x1de)]=_0x552d39[_0x1c1424(0x1de)];if(_0x552d39[_0x1c1424(0x23f)]!==undefined)_0x4dbcca[_0x1c1424(0x23f)]=Number(_0x552d39[_0x1c1424(0x23f)]);if(_0x552d39[_0x1c1424(0x249)]!==undefined)_0x4dbcca['priority']=Number(_0x552d39['priority']);if(_0x552d39['retryLimit']!==undefined)_0x4dbcca[_0x1c1424(0x1d7)]=Number(_0x552d39[_0x1c1424(0x215)]);if(_0x552d39['engineVersion'])_0x4dbcca[_0x1c1424(0x1f3)]=_0x552d39[_0x1c1424(0x1ea)];if(_0x552d39['result'])_0x4dbcca[_0x1c1424(0x1f5)]=_0x552d39[_0x1c1424(0x1f5)];if(_0x18d024['verbose']){console[_0x1c1424(0x1fe)](_0x1c1424(0x239)+_0x4b234c),console[_0x1c1424(0x1fe)](_0x1c1424(0x218)+_0x36c120),console[_0x1c1424(0x1fe)](_0x1c1424(0x22a)+_0x1de2fd);if(_0x4dbcca[_0x1c1424(0x23a)])console[_0x1c1424(0x1fe)]('\x20\x20Cron:\x20'+_0x4dbcca[_0x1c1424(0x23a)]);if(_0x4dbcca['timezone'])console[_0x1c1424(0x1fe)]('\x20\x20Timezone:\x20'+_0x4dbcca[_0x1c1424(0x1de)]);}const _0x4a6731=await withSpinner(_0x1c1424(0x252),()=>_0x33f3a1[_0x1c1424(0x24f)][_0x1c1424(0x238)](_0x4b234c,_0x4dbcca),{'verbose':_0x18d024[_0x1c1424(0x1f8)]});return console['error'](_0x1c1424(0x248)+_0x4a6731[_0x1c1424(0x206)][_0x1c1424(0x224)]),await handleSingleObjectOutput(_0x4a6731[_0x1c1424(0x206)],_0x18d024),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x22f);[a34_0x10ae5f(0x201)]='Update\x20a\x20scheduled\x20query';[a34_0x10ae5f(0x20f)](_0x579ad0){const _0x10a497=a34_0x10ae5f,_0x25bb86=_0x579ad0[_0x10a497(0x20c)][0x0];if(!_0x25bb86)return _0x10a497(0x251);return undefined;}async[a34_0x10ae5f(0x1d2)](_0xea97ca){const _0x8595cf=a34_0x10ae5f,{options:_0x536cbc,args:_0x3d7325,tdx:_0x172b87}=_0xea97ca,_0x54a6c9=_0x3d7325[0x0],_0x4c457e=_0x536cbc,_0x1336ed={};if(_0x4c457e['database'])_0x1336ed[_0x8595cf(0x20d)]=_0x4c457e[_0x8595cf(0x20d)];if(_0x4c457e[_0x8595cf(0x237)])_0x1336ed[_0x8595cf(0x237)]=_0x4c457e[_0x8595cf(0x237)];if(_0x4c457e[_0x8595cf(0x23a)])_0x1336ed[_0x8595cf(0x23a)]=_0x4c457e[_0x8595cf(0x23a)];if(_0x4c457e[_0x8595cf(0x1de)])_0x1336ed[_0x8595cf(0x1de)]=_0x4c457e[_0x8595cf(0x1de)];if(_0x4c457e[_0x8595cf(0x23f)]!==undefined)_0x1336ed[_0x8595cf(0x23f)]=Number(_0x4c457e[_0x8595cf(0x23f)]);if(_0x4c457e[_0x8595cf(0x249)]!==undefined)_0x1336ed[_0x8595cf(0x249)]=Number(_0x4c457e[_0x8595cf(0x249)]);if(_0x4c457e['retryLimit']!==undefined)_0x1336ed[_0x8595cf(0x1d7)]=Number(_0x4c457e['retryLimit']);if(_0x4c457e[_0x8595cf(0x1ea)])_0x1336ed[_0x8595cf(0x1f3)]=_0x4c457e[_0x8595cf(0x1ea)];if(_0x4c457e[_0x8595cf(0x1f5)])_0x1336ed[_0x8595cf(0x1f5)]=_0x4c457e[_0x8595cf(0x1f5)];if(_0x4c457e[_0x8595cf(0x253)])try{_0x1336ed[_0x8595cf(0x22e)]=readFileSync(_0x4c457e[_0x8595cf(0x253)],_0x8595cf(0x212))['trim']();}catch(_0x57c65b){throw new SDKError(ErrorCode[_0x8595cf(0x254)],_0x8595cf(0x1e8)+_0x4c457e[_0x8595cf(0x253)],_0x57c65b instanceof Error?_0x57c65b:undefined);}if(Object['keys'](_0x1336ed)['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x8595cf(0x1cf));if(_0x536cbc[_0x8595cf(0x1f8)]){console[_0x8595cf(0x1fe)](_0x8595cf(0x21e)+_0x54a6c9);for(const [_0x322cdf,_0xec574a]of Object[_0x8595cf(0x1ff)](_0x1336ed)){_0x322cdf===_0x8595cf(0x22e)?console[_0x8595cf(0x1fe)]('\x20\x20'+_0x322cdf+':\x20'+_0xec574a[_0x8595cf(0x1ca)](0x0,0x32)+_0x8595cf(0x1c6)):console[_0x8595cf(0x1fe)]('\x20\x20'+_0x322cdf+':\x20'+_0xec574a);}}const _0x29dd78=await withSpinner(_0x8595cf(0x1ed),()=>_0x172b87[_0x8595cf(0x24f)]['update'](_0x54a6c9,_0x1336ed),{'verbose':_0x536cbc[_0x8595cf(0x1f8)]});return console[_0x8595cf(0x1fe)]('Schedule\x20updated:\x20'+_0x29dd78['data'][_0x8595cf(0x224)]),await handleSingleObjectOutput(_0x29dd78[_0x8595cf(0x206)],_0x536cbc),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x233);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x207);[a34_0x10ae5f(0x20f)](_0x30836e){const _0x412484=a34_0x10ae5f,_0x388400=_0x30836e[_0x412484(0x20c)][0x0];if(!_0x388400)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x10ae5f(0x1d2)](_0x27097f){const _0x1f1bf4=a34_0x10ae5f,{options:_0x3709f5,args:_0x20df6b,tdx:_0xe7e39c}=_0x27097f,_0x310c4b=_0x20df6b[0x0];if(!_0x3709f5[_0x1f1bf4(0x1cd)]){const _0xc0d75e=await confirm(_0x1f1bf4(0x1fb)+_0x310c4b+'\x22?');if(!_0xc0d75e)return console[_0x1f1bf4(0x1fe)]('Cancelled'),0x0;}const _0x104276=await withSpinner(_0x1f1bf4(0x1d8),()=>_0xe7e39c['schedules']['delete'](_0x310c4b),{'verbose':_0x3709f5['verbose']});return console[_0x1f1bf4(0x1fe)](_0x1f1bf4(0x21d)+_0x104276[_0x1f1bf4(0x206)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x1c9);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x23b);['validate'](_0x475f0f){const _0x11ccea=a34_0x10ae5f,_0xde841e=_0x475f0f[_0x11ccea(0x20c)][0x0];if(!_0xde841e)return _0x11ccea(0x1f1);return undefined;}async['execute'](_0x56615b){const _0x33f3d2=a34_0x10ae5f,{options:_0x19349c,args:_0x1c0449,tdx:_0x3c9d99}=_0x56615b,_0x13a0bc=_0x1c0449[0x0],_0x2d6a21=_0x19349c,_0xdc7597=_0x2d6a21[_0x33f3d2(0x1df)],_0x58062f=_0x2d6a21[_0x33f3d2(0x205)]!==undefined?Number(_0x2d6a21[_0x33f3d2(0x205)]):undefined;if(_0x19349c[_0x33f3d2(0x1f8)]){console[_0x33f3d2(0x1fe)](_0x33f3d2(0x216)+_0x13a0bc);if(_0xdc7597)console[_0x33f3d2(0x1fe)](_0x33f3d2(0x1e3)+_0xdc7597);if(_0x58062f)console[_0x33f3d2(0x1fe)](_0x33f3d2(0x1fa)+_0x58062f);}const _0x48d358=await withSpinner(_0x33f3d2(0x24e),()=>_0x3c9d99[_0x33f3d2(0x24f)][_0x33f3d2(0x1d5)](_0x13a0bc,{'time':_0xdc7597,'num':_0x58062f}),{'verbose':_0x19349c[_0x33f3d2(0x1f8)]}),_0x4658ed=_0x48d358[_0x33f3d2(0x206)][_0x33f3d2(0x222)];console['error'](_0x33f3d2(0x1e7)+_0x4658ed[_0x33f3d2(0x21c)]+_0x33f3d2(0x1eb)+(_0x4658ed[_0x33f3d2(0x21c)]!==0x1?'s':'')+_0x33f3d2(0x1dd));for(const _0x80f175 of _0x4658ed){console[_0x33f3d2(0x1fe)](_0x33f3d2(0x1e6)+_0x80f175[_0x33f3d2(0x21b)]);}return await handleSDKOutput(_0x4658ed,_0x19349c),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x234);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x1e5);[a34_0x10ae5f(0x20f)](_0x43749d){const _0x4054bb=a34_0x10ae5f,_0xfe2764=_0x43749d[_0x4054bb(0x20c)][0x0];if(!_0xfe2764)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0xfa8402){const _0x44c5e1=a34_0x10ae5f,{options:_0x5e87fe,args:_0x464a18,tdx:_0x73b14b}=_0xfa8402,_0x5da431=_0x464a18[0x0],_0x4cd7b4=_0x5e87fe,_0x38bca7=_0x4cd7b4['from']!==undefined?Number(_0x4cd7b4[_0x44c5e1(0x214)]):undefined,_0x4e8b98=_0x4cd7b4['to']!==undefined?Number(_0x4cd7b4['to']):undefined,_0x2af562=await withSpinner(_0x44c5e1(0x1ee),()=>_0x73b14b['schedules'][_0x44c5e1(0x211)](_0x5da431,{'from':_0x38bca7,'to':_0x4e8b98}),{'verbose':_0x5e87fe[_0x44c5e1(0x1f8)]}),_0x5cb074=_0x2af562['data'];console[_0x44c5e1(0x1fe)]('Found\x20'+_0x5cb074[_0x44c5e1(0x1f0)]+_0x44c5e1(0x24a)+(_0x5cb074[_0x44c5e1(0x1f0)]!==0x1?'s':'')+'\x20(showing\x20'+_0x5cb074['from']+'-'+_0x5cb074['to']+')');const _0x117c5d=_0x5cb074[_0x44c5e1(0x211)][_0x44c5e1(0x1d1)](_0x50881f=>({'job_id':_0x50881f[_0x44c5e1(0x21b)],'type':_0x50881f['type'],'status':_0x50881f[_0x44c5e1(0x22c)],'scheduled_at':_0x50881f[_0x44c5e1(0x223)],'created_at':_0x50881f[_0x44c5e1(0x23e)],'start_at':_0x50881f[_0x44c5e1(0x1d4)],'end_at':_0x50881f['end_at']}));return await handleSDKOutput(_0x117c5d,_0x5e87fe),0x0;}}
|
|
1
|
+
function a34_0x417a(){const _0x39b041=['Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','name','engineVersion','has_next_page','delete','\x20\x20Database:\x20','27589991GeHbKU','args','start_at','delay','verbose','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','priority','getTime','trim','query','Getting\x20schedule\x20details...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','data','last_job','trino','nextRun','num','toLocaleDateString','status','show','\x20\x20Type:\x20','next_run_at','(unnamed)','update','execute','ies','validate','substring','16433280Lngkrv','Getting\x20schedule\x20history...','\x20execution','user_name','padEnd','output','format','created_at','cyan','schedule:show','\x20(use\x20--limit\x20to\x20see\x20more)','schedules','retry_limit','result','11JIfNTx','round','Updating\x20schedule:\x20','map','retryLimit','statusIcon','\x20\x20Cron:\x20','schedule:list','length','options','time_zone','/app/queries/editor?queryId=','create','keys','success','Found\x20','error','\x20\x20Job\x20ID:\x20','timezone','just\x20now','Running\x20schedule...','886554ohIcKn','type','soon','Showing\x20first\x20','19984toXLxg','2548SUGGAc','Updating\x20schedule...','time','max','Running\x20schedule:\x20','No\x20scheduled\x20queries\x20found','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','7iaattV','join','\x22...','Failed\x20to\x20read\x20file:\x20','utf-8','from','lastRun','never','end_at','h\x20ago','green','in\x20','schedule:history','\x20\x20Timezone:\x20','13310qryXod','repeat','listQueries','user','\x20created','3785358eiBKyi','abs','Cancelled','cron','schedule:delete','List\x20scheduled\x20queries','d\x20ago','jsonl','INVALID_ARGUMENT','updated_at','history','Query\x20file\x20is\x20empty','engine_version','2484jTTSiN','entries','scheduled_at','Show\x20schedule\x20execution\x20history','database','Run\x20a\x20scheduled\x20query\x20immediately','description','file','schedule:create','tsv','red','Searching\x20scheduled\x20queries\x20matching\x20\x22','limit','pagination','job_id','ended_at','317742ggQktB','Schedule\x20updated:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','schedule:run'];a34_0x417a=function(){return _0x39b041;};return a34_0x417a();}const a34_0x1ef183=a34_0x4faa;(function(_0x46276b,_0x35b6c5){const _0x3f2f46=a34_0x4faa,_0x3616c0=_0x46276b();while(!![]){try{const _0x34d54a=parseInt(_0x3f2f46(0x249))/0x1*(-parseInt(_0x3f2f46(0x215))/0x2)+parseInt(_0x3f2f46(0x25e))/0x3+parseInt(_0x3f2f46(0x263))/0x4*(-parseInt(_0x3f2f46(0x1f3))/0x5)+-parseInt(_0x3f2f46(0x1f8))/0x6*(-parseInt(_0x3f2f46(0x26b))/0x7)+-parseInt(_0x3f2f46(0x262))/0x8*(parseInt(_0x3f2f46(0x205))/0x9)+parseInt(_0x3f2f46(0x23b))/0xa+parseInt(_0x3f2f46(0x21f))/0xb;if(_0x34d54a===_0x35b6c5)break;else _0x3616c0['push'](_0x3616c0['shift']());}catch(_0x11c089){_0x3616c0['push'](_0x3616c0['shift']());}}}(a34_0x417a,0xe6c2d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a34_0x4faa(_0xb0d9d8,_0x433229){_0xb0d9d8=_0xb0d9d8-0x1e8;const _0x417aa8=a34_0x417a();let _0x4faac9=_0x417aa8[_0xb0d9d8];return _0x4faac9;}import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0xc4b67b from'chalk';function formatRelativeTime(_0x26f2a6){const _0x2f26b5=a34_0x4faa,_0x426c4b=new Date(_0x26f2a6),_0x510a10=new Date(),_0x2dd5d8=_0x426c4b['getTime']()-_0x510a10[_0x2f26b5(0x226)](),_0x1c0c58=Math[_0x2f26b5(0x1f9)](_0x2dd5d8)/0x3e8,_0x41f00e=_0x2dd5d8<0x0;if(_0x1c0c58<0x3c)return _0x41f00e?_0x2f26b5(0x25c):_0x2f26b5(0x260);else{if(_0x1c0c58<0xe10){const _0x187039=Math[_0x2f26b5(0x24a)](_0x1c0c58/0x3c);return _0x41f00e?_0x187039+'m\x20ago':_0x2f26b5(0x1f0)+_0x187039+'m';}else{if(_0x1c0c58<0x15180){const _0x5b5933=Math[_0x2f26b5(0x24a)](_0x1c0c58/0xe10);return _0x41f00e?_0x5b5933+_0x2f26b5(0x1ee):_0x2f26b5(0x1f0)+_0x5b5933+'h';}else{if(_0x1c0c58<0x93a80){const _0x3922d7=Math[_0x2f26b5(0x24a)](_0x1c0c58/0x15180);return _0x41f00e?_0x3922d7+_0x2f26b5(0x1fe):_0x2f26b5(0x1f0)+_0x3922d7+'d';}else return _0x426c4b[_0x2f26b5(0x230)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x250);['description']=a34_0x1ef183(0x1fd);async['execute'](_0x358875){const _0x32c223=a34_0x1ef183,{options:_0x39320c,args:_0xe033fb,tdx:_0xa795ff}=_0x358875,_0x52e75c=resolveLimit(_0x39320c[_0x32c223(0x211)],DEFAULT_DISPLAY_LIMIT),_0x3bcc96=_0xe033fb[0x0],_0x544237=_0x3bcc96?_0x32c223(0x210)+_0x3bcc96+_0x32c223(0x26d):'Listing\x20scheduled\x20queries...',_0x4d939d=await withSpinner(_0x544237,()=>_0xa795ff[_0x32c223(0x246)][_0x32c223(0x1f5)]({'limit':_0x52e75c,'scheduled':!![],'pattern':_0x3bcc96}),{'verbose':_0x39320c['verbose']}),_0x99cdf=_0x4d939d['data']['queries'],_0x467cb1=_0x4d939d[_0x32c223(0x22b)][_0x32c223(0x212)][_0x32c223(0x21c)],_0x9de846=_0x3bcc96?'\x20matching\x20\x22'+_0x3bcc96+'\x22':'';_0x467cb1?console['error'](_0x32c223(0x261)+_0x99cdf[_0x32c223(0x251)]+'\x20schedules'+_0x9de846+_0x32c223(0x245)):console[_0x32c223(0x259)](_0x32c223(0x258)+_0x99cdf[_0x32c223(0x251)]+'\x20scheduled\x20quer'+(_0x99cdf['length']!==0x1?_0x32c223(0x238):'y')+_0x9de846);if(_0x39320c[_0x32c223(0x241)]==='json'||_0x39320c[_0x32c223(0x241)]===_0x32c223(0x1ff)||_0x39320c[_0x32c223(0x241)]==='table'||_0x39320c[_0x32c223(0x241)]===_0x32c223(0x20e)){const _0x1d9dbe=_0x99cdf['map'](_0x4711a0=>({'id':_0x4711a0['id'],'name':_0x4711a0['name'],'cron':_0x4711a0[_0x32c223(0x1fb)],'database':_0x4711a0[_0x32c223(0x209)]?.[_0x32c223(0x21a)],'type':_0x4711a0[_0x32c223(0x25f)],'timezone':_0x4711a0[_0x32c223(0x253)],'user_name':_0x4711a0[_0x32c223(0x1f6)]?.[_0x32c223(0x21a)],'updated_at':_0x4711a0[_0x32c223(0x201)],'next_run_at':_0x4711a0[_0x32c223(0x234)],'last_job_status':_0x4711a0['last_job']?.[_0x32c223(0x231)]}));await handleSDKOutput(_0x1d9dbe,_0x39320c);}else{if(_0x99cdf[_0x32c223(0x251)]===0x0)console['log'](_0x32c223(0x268));else{const _0x55c97c=_0x39320c['site'],_0x179308=_0x99cdf[_0x32c223(0x24c)](_0x1633df=>{const _0x425d3d=_0x32c223,_0x1e6861=_0x1633df[_0x425d3d(0x22c)]?.[_0x425d3d(0x231)]?_0x1633df['last_job'][_0x425d3d(0x231)]===_0x425d3d(0x257)?'✓':'✗':'-',_0x30a5e8=_0x1633df[_0x425d3d(0x22c)]?.['ended_at']?formatRelativeTime(_0x1633df[_0x425d3d(0x22c)][_0x425d3d(0x214)]):_0x425d3d(0x1ec),_0x2e9bbd=_0x1633df[_0x425d3d(0x234)]?formatRelativeTime(_0x1633df['next_run_at']):'-',_0x2a51ca=_0x1633df[_0x425d3d(0x1fb)]||'',_0x4b5a94=_0x1633df['name']||_0x425d3d(0x235),_0x2a73fe=getConsoleUrl(_0x55c97c,_0x425d3d(0x254)+_0x1633df['id']);return{'statusIcon':_0x1e6861,'lastRun':_0x30a5e8,'nextRun':_0x2e9bbd,'cron':_0x2a51ca,'name':_0x4b5a94,'queryUrl':_0x2a73fe,'status':_0x1633df[_0x425d3d(0x22c)]?.[_0x425d3d(0x231)]};}),_0x2dbd03=Math[_0x32c223(0x266)](..._0x179308[_0x32c223(0x24c)](_0x438400=>_0x438400[_0x32c223(0x1eb)]['length'])),_0x5bb21f=Math[_0x32c223(0x266)](..._0x179308[_0x32c223(0x24c)](_0x31e33b=>_0x31e33b[_0x32c223(0x22e)][_0x32c223(0x251)])),_0x4357bb=Math['max'](..._0x179308[_0x32c223(0x24c)](_0x1db5e8=>_0x1db5e8[_0x32c223(0x1fb)][_0x32c223(0x251)])),_0x310644=_0x179308[_0x32c223(0x24c)](_0x55882b=>{const _0xbbce0d=_0x32c223,_0x1e7b48=_0x55882b[_0xbbce0d(0x231)]==='success'?a34_0xc4b67b[_0xbbce0d(0x1ef)](_0x55882b[_0xbbce0d(0x24e)]):_0x55882b[_0xbbce0d(0x231)]===_0xbbce0d(0x259)?a34_0xc4b67b[_0xbbce0d(0x20f)](_0x55882b[_0xbbce0d(0x24e)]):a34_0xc4b67b['dim'](_0x55882b['statusIcon']),_0x4045a2=_0x55882b[_0xbbce0d(0x1eb)][_0xbbce0d(0x23f)](_0x2dbd03),_0x94dab=_0x55882b[_0xbbce0d(0x22e)][_0xbbce0d(0x23f)](_0x5bb21f),_0x11d627=_0x55882b[_0xbbce0d(0x1fb)]?a34_0xc4b67b[_0xbbce0d(0x243)](_0x55882b[_0xbbce0d(0x1fb)][_0xbbce0d(0x23f)](_0x4357bb)):'\x20'[_0xbbce0d(0x1f4)](_0x4357bb),_0x597ba2=hyperlink(_0x55882b['name'],_0x55882b['queryUrl']);return'📅\x20'+_0x1e7b48+'\x20'+_0x4045a2+'\x20\x20→\x20'+_0x94dab+'\x20\x20'+_0x11d627+'\x20\x20'+_0x597ba2;});await writeOutput(_0x310644[_0x32c223(0x26c)]('\x0a'),_0x39320c[_0x32c223(0x240)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x244);[a34_0x1ef183(0x20b)]='Show\x20schedule\x20details';['validate'](_0x3f6562){const _0x48a723=a34_0x1ef183,_0x405a26=_0x3f6562[_0x48a723(0x220)][0x0];if(!_0x405a26)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a34_0x1ef183(0x237)](_0xd1481e){const _0x2222a3=a34_0x1ef183,{options:_0xee9a3d,args:_0x117698,tdx:_0x2de8b1}=_0xd1481e,_0x48d62e=_0x117698[0x0],_0x3ab39a=await withSpinner(_0x2222a3(0x229),()=>_0x2de8b1['schedules'][_0x2222a3(0x232)](_0x48d62e),{'verbose':_0xee9a3d['verbose']}),_0x225418=_0x3ab39a[_0x2222a3(0x22b)],_0x5a1a22={'name':_0x225418[_0x2222a3(0x21a)],'cron':_0x225418[_0x2222a3(0x1fb)],'database':_0x225418['database'],'type':_0x225418[_0x2222a3(0x25f)],'timezone':_0x225418[_0x2222a3(0x25b)],'user_name':_0x225418[_0x2222a3(0x23e)],'created_at':_0x225418[_0x2222a3(0x242)],'engine_version':_0x225418[_0x2222a3(0x204)],'executing_user_id':_0x225418['executing_user_id'],'query':_0x225418['query'],'delay':_0x225418[_0x2222a3(0x222)],'priority':_0x225418['priority'],'retry_limit':_0x225418[_0x2222a3(0x247)],..._0x225418['result']&&{'result':_0x225418[_0x2222a3(0x248)]}};return await handleSingleObjectOutput(_0x5a1a22,_0xee9a3d),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x1ef183(0x20d);[a34_0x1ef183(0x20b)]='Create\x20a\x20scheduled\x20query';['validate'](_0x256874){const _0x1b06c9=a34_0x1ef183,_0x787fc7=_0x256874[_0x1b06c9(0x220)][0x0];if(!_0x787fc7)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x5c0029=_0x256874[_0x1b06c9(0x252)];if(!_0x5c0029[_0x1b06c9(0x209)])return _0x1b06c9(0x269);return undefined;}async['execute'](_0x16e060){const _0x57f9c3=a34_0x1ef183,{options:_0x547e98,args:_0x3c48a4,tdx:_0x415ee3}=_0x16e060,_0x15454d=_0x3c48a4[0x0],_0x2baaf7=_0x547e98,_0x24e991=_0x2baaf7[_0x57f9c3(0x209)],_0x1e9a66=_0x2baaf7[_0x57f9c3(0x20c)],_0xd6d211=_0x2baaf7[_0x57f9c3(0x25f)]||_0x57f9c3(0x22d);let _0x2710de;try{_0x2710de=readFileSync(_0x1e9a66,_0x57f9c3(0x1e9))[_0x57f9c3(0x227)]();}catch(_0x2acc3e){throw new SDKError(ErrorCode[_0x57f9c3(0x200)],'Failed\x20to\x20read\x20file:\x20'+_0x1e9a66,_0x2acc3e instanceof Error?_0x2acc3e:undefined);}if(!_0x2710de)throw new SDKError(ErrorCode[_0x57f9c3(0x200)],_0x57f9c3(0x203));const _0x238be7={'database':_0x24e991,'query':_0x2710de,'type':_0xd6d211};if(_0x2baaf7[_0x57f9c3(0x1fb)])_0x238be7[_0x57f9c3(0x1fb)]=_0x2baaf7[_0x57f9c3(0x1fb)];if(_0x2baaf7[_0x57f9c3(0x25b)])_0x238be7[_0x57f9c3(0x25b)]=_0x2baaf7[_0x57f9c3(0x25b)];if(_0x2baaf7[_0x57f9c3(0x222)]!==undefined)_0x238be7[_0x57f9c3(0x222)]=Number(_0x2baaf7['delay']);if(_0x2baaf7['priority']!==undefined)_0x238be7[_0x57f9c3(0x225)]=Number(_0x2baaf7['priority']);if(_0x2baaf7[_0x57f9c3(0x24d)]!==undefined)_0x238be7[_0x57f9c3(0x247)]=Number(_0x2baaf7[_0x57f9c3(0x24d)]);if(_0x2baaf7[_0x57f9c3(0x21b)])_0x238be7[_0x57f9c3(0x204)]=_0x2baaf7['engineVersion'];if(_0x2baaf7[_0x57f9c3(0x248)])_0x238be7[_0x57f9c3(0x248)]=_0x2baaf7[_0x57f9c3(0x248)];if(_0x547e98[_0x57f9c3(0x223)]){console['error']('Creating\x20schedule:\x20'+_0x15454d),console[_0x57f9c3(0x259)](_0x57f9c3(0x21e)+_0x24e991),console[_0x57f9c3(0x259)](_0x57f9c3(0x233)+_0xd6d211);if(_0x238be7['cron'])console[_0x57f9c3(0x259)](_0x57f9c3(0x24f)+_0x238be7[_0x57f9c3(0x1fb)]);if(_0x238be7['timezone'])console[_0x57f9c3(0x259)](_0x57f9c3(0x1f2)+_0x238be7[_0x57f9c3(0x25b)]);}const _0x1c81b9=await withSpinner('Creating\x20schedule...',()=>_0x415ee3[_0x57f9c3(0x246)][_0x57f9c3(0x255)](_0x15454d,_0x238be7),{'verbose':_0x547e98[_0x57f9c3(0x223)]});return console['error']('Schedule\x20created:\x20'+_0x1c81b9[_0x57f9c3(0x22b)][_0x57f9c3(0x21a)]),await handleSingleObjectOutput(_0x1c81b9[_0x57f9c3(0x22b)],_0x547e98),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x1ef183(0x21a)]='schedule:update';[a34_0x1ef183(0x20b)]='Update\x20a\x20scheduled\x20query';[a34_0x1ef183(0x239)](_0x4a0cbd){const _0x5f4722=a34_0x1ef183,_0x124d36=_0x4a0cbd[_0x5f4722(0x220)][0x0];if(!_0x124d36)return _0x5f4722(0x219);return undefined;}async[a34_0x1ef183(0x237)](_0x858d78){const _0xee1156=a34_0x1ef183,{options:_0x467d34,args:_0x324623,tdx:_0x3ce21e}=_0x858d78,_0x65f03d=_0x324623[0x0],_0x1b241c=_0x467d34,_0x4c36a9={};if(_0x1b241c[_0xee1156(0x209)])_0x4c36a9[_0xee1156(0x209)]=_0x1b241c['database'];if(_0x1b241c[_0xee1156(0x25f)])_0x4c36a9['type']=_0x1b241c['type'];if(_0x1b241c[_0xee1156(0x1fb)])_0x4c36a9[_0xee1156(0x1fb)]=_0x1b241c[_0xee1156(0x1fb)];if(_0x1b241c[_0xee1156(0x25b)])_0x4c36a9['timezone']=_0x1b241c['timezone'];if(_0x1b241c[_0xee1156(0x222)]!==undefined)_0x4c36a9['delay']=Number(_0x1b241c[_0xee1156(0x222)]);if(_0x1b241c[_0xee1156(0x225)]!==undefined)_0x4c36a9[_0xee1156(0x225)]=Number(_0x1b241c['priority']);if(_0x1b241c['retryLimit']!==undefined)_0x4c36a9[_0xee1156(0x247)]=Number(_0x1b241c['retryLimit']);if(_0x1b241c[_0xee1156(0x21b)])_0x4c36a9[_0xee1156(0x204)]=_0x1b241c[_0xee1156(0x21b)];if(_0x1b241c[_0xee1156(0x248)])_0x4c36a9[_0xee1156(0x248)]=_0x1b241c[_0xee1156(0x248)];if(_0x1b241c[_0xee1156(0x20c)])try{_0x4c36a9[_0xee1156(0x228)]=readFileSync(_0x1b241c['file'],'utf-8')[_0xee1156(0x227)]();}catch(_0x327a4b){throw new SDKError(ErrorCode[_0xee1156(0x200)],_0xee1156(0x1e8)+_0x1b241c['file'],_0x327a4b instanceof Error?_0x327a4b:undefined);}if(Object[_0xee1156(0x256)](_0x4c36a9)[_0xee1156(0x251)]===0x0)throw new SDKError(ErrorCode[_0xee1156(0x200)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x467d34['verbose']){console['error'](_0xee1156(0x24b)+_0x65f03d);for(const [_0x154540,_0x59f664]of Object[_0xee1156(0x206)](_0x4c36a9)){_0x154540===_0xee1156(0x228)?console['error']('\x20\x20'+_0x154540+':\x20'+_0x59f664[_0xee1156(0x23a)](0x0,0x32)+'...'):console['error']('\x20\x20'+_0x154540+':\x20'+_0x59f664);}}const _0x5a83c7=await withSpinner(_0xee1156(0x264),()=>_0x3ce21e['schedules'][_0xee1156(0x236)](_0x65f03d,_0x4c36a9),{'verbose':_0x467d34[_0xee1156(0x223)]});return console[_0xee1156(0x259)](_0xee1156(0x216)+_0x5a83c7[_0xee1156(0x22b)][_0xee1156(0x21a)]),await handleSingleObjectOutput(_0x5a83c7[_0xee1156(0x22b)],_0x467d34),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x1fc);[a34_0x1ef183(0x20b)]='Delete\x20a\x20scheduled\x20query';[a34_0x1ef183(0x239)](_0x280aa5){const _0x1f0495=a34_0x1ef183,_0x4b5fdb=_0x280aa5['args'][0x0];if(!_0x4b5fdb)return _0x1f0495(0x224);return undefined;}async['execute'](_0x582d7a){const _0x1e6910=a34_0x1ef183,{options:_0x2fd486,args:_0x5d1132,tdx:_0x5de99e}=_0x582d7a,_0x31b8ca=_0x5d1132[0x0];if(!_0x2fd486['yes']){const _0x3b483b=await confirm(_0x1e6910(0x26a)+_0x31b8ca+'\x22?');if(!_0x3b483b)return console['error'](_0x1e6910(0x1fa)),0x0;}const _0x48763c=await withSpinner('Deleting\x20schedule...',()=>_0x5de99e[_0x1e6910(0x246)][_0x1e6910(0x21d)](_0x31b8ca),{'verbose':_0x2fd486['verbose']});return console[_0x1e6910(0x259)]('Schedule\x20deleted:\x20'+_0x48763c[_0x1e6910(0x22b)][_0x1e6910(0x21a)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x218);[a34_0x1ef183(0x20b)]=a34_0x1ef183(0x20a);[a34_0x1ef183(0x239)](_0x2890ce){const _0x384e0a=a34_0x1ef183,_0x2e1297=_0x2890ce[_0x384e0a(0x220)][0x0];if(!_0x2e1297)return _0x384e0a(0x217);return undefined;}async[a34_0x1ef183(0x237)](_0x501d0a){const _0x1ec42e=a34_0x1ef183,{options:_0x139a64,args:_0x51cff3,tdx:_0x4f093b}=_0x501d0a,_0x3dcfda=_0x51cff3[0x0],_0x4ce5cc=_0x139a64,_0x5f427c=_0x4ce5cc[_0x1ec42e(0x265)],_0x51bc7a=_0x4ce5cc[_0x1ec42e(0x22f)]!==undefined?Number(_0x4ce5cc[_0x1ec42e(0x22f)]):undefined;if(_0x139a64[_0x1ec42e(0x223)]){console['error'](_0x1ec42e(0x267)+_0x3dcfda);if(_0x5f427c)console[_0x1ec42e(0x259)]('\x20\x20Time:\x20'+_0x5f427c);if(_0x51bc7a)console[_0x1ec42e(0x259)]('\x20\x20Num:\x20'+_0x51bc7a);}const _0x2aeb9c=await withSpinner(_0x1ec42e(0x25d),()=>_0x4f093b[_0x1ec42e(0x246)]['run'](_0x3dcfda,{'time':_0x5f427c,'num':_0x51bc7a}),{'verbose':_0x139a64[_0x1ec42e(0x223)]}),_0x18096c=_0x2aeb9c[_0x1ec42e(0x22b)]['jobs'];console[_0x1ec42e(0x259)]('Schedule\x20run\x20submitted:\x20'+_0x18096c[_0x1ec42e(0x251)]+'\x20job'+(_0x18096c[_0x1ec42e(0x251)]!==0x1?'s':'')+_0x1ec42e(0x1f7));for(const _0x53b27a of _0x18096c){console[_0x1ec42e(0x259)](_0x1ec42e(0x25a)+_0x53b27a[_0x1ec42e(0x213)]);}return await handleSDKOutput(_0x18096c,_0x139a64),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x1f1);[a34_0x1ef183(0x20b)]=a34_0x1ef183(0x208);[a34_0x1ef183(0x239)](_0x4fd38d){const _0x2161a7=a34_0x1ef183,_0x43df09=_0x4fd38d[_0x2161a7(0x220)][0x0];if(!_0x43df09)return _0x2161a7(0x22a);return undefined;}async[a34_0x1ef183(0x237)](_0x10c339){const _0x1c5d72=a34_0x1ef183,{options:_0x13c4fd,args:_0x4a3772,tdx:_0x19f1b4}=_0x10c339,_0x5db886=_0x4a3772[0x0],_0x25dd5a=_0x13c4fd,_0x16ebed=_0x25dd5a[_0x1c5d72(0x1ea)]!==undefined?Number(_0x25dd5a[_0x1c5d72(0x1ea)]):undefined,_0x2db185=_0x25dd5a['to']!==undefined?Number(_0x25dd5a['to']):undefined,_0x58cedc=await withSpinner(_0x1c5d72(0x23c),()=>_0x19f1b4[_0x1c5d72(0x246)]['history'](_0x5db886,{'from':_0x16ebed,'to':_0x2db185}),{'verbose':_0x13c4fd['verbose']}),_0x37bc02=_0x58cedc[_0x1c5d72(0x22b)];console[_0x1c5d72(0x259)](_0x1c5d72(0x258)+_0x37bc02['count']+_0x1c5d72(0x23d)+(_0x37bc02['count']!==0x1?'s':'')+'\x20(showing\x20'+_0x37bc02[_0x1c5d72(0x1ea)]+'-'+_0x37bc02['to']+')');const _0x163cc6=_0x37bc02[_0x1c5d72(0x202)][_0x1c5d72(0x24c)](_0x5d4e6c=>({'job_id':_0x5d4e6c['job_id'],'type':_0x5d4e6c[_0x1c5d72(0x25f)],'status':_0x5d4e6c[_0x1c5d72(0x231)],'scheduled_at':_0x5d4e6c[_0x1c5d72(0x207)],'created_at':_0x5d4e6c[_0x1c5d72(0x242)],'start_at':_0x5d4e6c[_0x1c5d72(0x221)],'end_at':_0x5d4e6c[_0x1c5d72(0x1ed)]}));return await handleSDKOutput(_0x163cc6,_0x13c4fd),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x3b9a9b=a35_0x35ca;(function(_0x1f1612,_0x207b87){const _0x5f0671=a35_0x35ca,_0x253ce8=_0x1f1612();while(!![]){try{const _0x504216=parseInt(_0x5f0671(0x17c))/0x1*(-parseInt(_0x5f0671(0x18d))/0x2)+parseInt(_0x5f0671(0x1b1))/0x3+parseInt(_0x5f0671(0x143))/0x4+parseInt(_0x5f0671(0x116))/0x5+-parseInt(_0x5f0671(0x19f))/0x6+-parseInt(_0x5f0671(0x168))/0x7*(parseInt(_0x5f0671(0x1a6))/0x8)+-parseInt(_0x5f0671(0x130))/0x9*(parseInt(_0x5f0671(0x1a3))/0xa);if(_0x504216===_0x207b87)break;else _0x253ce8['push'](_0x253ce8['shift']());}catch(_0x135a7a){_0x253ce8['push'](_0x253ce8['shift']());}}}(a35_0x5af6,0x641b4));import{BaseCommand}from'./command.js';function a35_0x5af6(){const _0x19b623=['data','message','path','✔\x20Created\x20folder\x20\x27','✖\x20Query\x20failed\x20[','length','9TXRXeT','jsonl','format','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','✔\x20Query\x20completed:\x20Processed\x20','web','getSQLFromYamlFile','fullPath','trim','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','parent','folder','Resolving\x20path\x20\x27','url','name','Use:\x20tdx\x20ps\x20view','cyan','error','901916dgRAsJ','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','json','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Resolving\x20\x27','getSegment','description','Parent\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','execute','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolved\x20type:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','content','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20sg\x20show\x20<name>','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20SQL\x20from\x20rule...','red','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20Folder\x20path:\x20','segment:show','segment:folder:list','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','parentSegment','getParent','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','getSQLFromServerSegment','(root)','cause','segmentPath','parentFolder','121793tKEerH','Parent\x20segment:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','getSegmentSQL','segment','Get\x20SQL\x20query\x20for\x20child\x20segment','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getFolder','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20folder\x20ID:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','getSegmentSQLFromYaml','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','folderPath','Examples:','site','Folder\x20name:\x20','18GIRwug','Parent\x20name:\x20','\x20[Job\x20ID:\x20','SEGMENT_NOT_FOUND','resolveParentId','Show\x20segment\x20or\x20folder\x20details','segment:describe','Target\x20path:\x20','Error:\x20Folder\x20reference\x20is\x20required','\x27...','\x20\x20Cause:\x20','segment:folder:create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Resolving\x20folder\x20\x27','Use:\x20tdx\x20ps\x20desc','Resolved\x20YAML\x20file:\x20','\x20folder','17468nSVIIZ','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segmentName','green','segment:view','/app/ps/','Resolved:\x20','\x20rows\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','segment:sql','Use:\x20tdx\x20ps\x20show','Segment\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','test','log','413874QDIdSe','Fetching\x20segment\x20details...','segmentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','1075430JenARi','Site:\x20','/e/','88rzosZW','stats','type','Error:\x20','createFolder','Options:','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','2020755TfIzAE','parentId','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','resolvePathToResource','toLocaleString','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','✔\x20Found\x20','SEGMENT_FOLDER_NOT_FOUND','Use:\x20tdx\x20ps\x20view\x20-w','Creating\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20describe\x20<path>','verbose','180475JiLGff','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Show\x20folder\x20or\x20child\x20segment\x20details','query','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20Opening\x20','INVALID_ARGUMENT','Resolved\x20parent\x20ID:\x20','setJobId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolving\x20parent\x20segment\x20\x27','folderId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','replace','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','segment:folder:show','limit'];a35_0x5af6=function(){return _0x19b623;};return a35_0x5af6();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a35_0x35ca(_0x227702,_0x368c4f){_0x227702=_0x227702-0x116;const _0x5af638=a35_0x5af6();let _0x35caec=_0x5af638[_0x227702];return _0x35caec;}import a35_0x59fe37 from'chalk';async function resolveSegmentTarget(_0x11032e,_0x3776b4,_0x1b8c1e){const _0x4b8a84=a35_0x35ca;if(isYamlFilePath(_0x11032e))try{const _0x163bcd=await resolveYamlFilePath(_0x11032e);return _0x1b8c1e&&(console[_0x4b8a84(0x142)](_0x4b8a84(0x18b)+_0x11032e),console[_0x4b8a84(0x142)]('\x20\x20Parent\x20segment:\x20'+_0x163bcd['parentSegment']),console[_0x4b8a84(0x142)]('\x20\x20Segment\x20name:\x20'+_0x163bcd[_0x4b8a84(0x18f)]),console[_0x4b8a84(0x142)](_0x4b8a84(0x15c)+(_0x163bcd[_0x4b8a84(0x178)]||_0x4b8a84(0x164))),console['error']('\x20\x20Full\x20path:\x20'+_0x163bcd[_0x4b8a84(0x137)])),_0x163bcd[_0x4b8a84(0x137)];}catch(_0x212f6a){throw new SDKError(ErrorCode[_0x4b8a84(0x11f)],_0x4b8a84(0x174)+_0x212f6a[_0x4b8a84(0x12b)]);}if(!_0x3776b4)throw new SDKError(ErrorCode[_0x4b8a84(0x11f)],_0x4b8a84(0x127));return _0x3776b4+'/'+_0x11032e;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x182);[a35_0x3b9a9b(0x14a)]=a35_0x3b9a9b(0x181);async['execute'](_0x413b12){const _0x417b4d=a35_0x3b9a9b,{options:_0x2aa36b,args:_0x3b8aa7,tdx:_0x299821}=_0x413b12,_0x14e8d6=_0x3b8aa7[0x0],_0x122e81=!_0x14e8d6&&!!_0x2aa36b[_0x417b4d(0x160)],_0x34204e=_0x14e8d6||_0x2aa36b[_0x417b4d(0x160)];if(!_0x34204e)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x417b4d(0x142)](_0x417b4d(0x1bd)),console[_0x417b4d(0x142)]('Examples:'),console[_0x417b4d(0x142)](_0x417b4d(0x11c)),console[_0x417b4d(0x142)](_0x417b4d(0x139)),console[_0x417b4d(0x142)](_0x417b4d(0x172)),console[_0x417b4d(0x142)](_0x417b4d(0x14c)),0x1;try{const _0x46bba0=_0x2aa36b[_0x417b4d(0x166)];let _0x30b37f=_0x34204e;!_0x122e81&&_0x46bba0&&!_0x34204e['includes']('/')&&(_0x30b37f=_0x46bba0+'/'+_0x34204e,_0x2aa36b[_0x417b4d(0x1be)]&&console['error'](_0x417b4d(0x117)+_0x30b37f));const _0x5836c3=await withSpinner(_0x417b4d(0x13d)+_0x30b37f+_0x417b4d(0x185),()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x1b5)](_0x30b37f),{'verbose':_0x2aa36b['verbose']}),_0xb12129=_0x5836c3[_0x417b4d(0x12a)];_0x2aa36b[_0x417b4d(0x1be)]&&(console[_0x417b4d(0x142)]('Resolved\x20type:\x20'+_0xb12129[_0x417b4d(0x1a8)]),console[_0x417b4d(0x142)]('Parent\x20ID:\x20'+_0xb12129[_0x417b4d(0x1b2)]),_0xb12129[_0x417b4d(0x124)]&&console['error']('Folder\x20ID:\x20'+_0xb12129[_0x417b4d(0x124)]),_0xb12129[_0x417b4d(0x1a1)]&&console[_0x417b4d(0x142)](_0x417b4d(0x19a)+_0xb12129[_0x417b4d(0x1a1)]));if(_0xb12129[_0x417b4d(0x1a8)]===_0x417b4d(0x13b)){const _0x4b4fe2=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x161)](_0xb12129[_0x417b4d(0x1b2)]),{'verbose':_0x2aa36b['verbose']});await handleSingleObjectOutput(_0x4b4fe2[_0x417b4d(0x12a)],_0x2aa36b);}else{if(_0xb12129['type']==='folder'){if(!_0xb12129[_0x417b4d(0x124)])throw new SDKError(ErrorCode[_0x417b4d(0x1ba)],_0x417b4d(0x1ae));const _0x291988=await withSpinner(_0x417b4d(0x1ac),()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x170)](_0xb12129['folderId']),{'verbose':_0x2aa36b[_0x417b4d(0x1be)]});await handleSingleObjectOutput(_0x291988[_0x417b4d(0x12a)],_0x2aa36b);}else{if(_0xb12129[_0x417b4d(0x1a8)]===_0x417b4d(0x16d)){if(!_0xb12129[_0x417b4d(0x1a1)])throw new SDKError(ErrorCode[_0x417b4d(0x17f)],_0x417b4d(0x155));const _0x5666df=await withSpinner(_0x417b4d(0x1a0),()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x149)](_0xb12129[_0x417b4d(0x1b2)],_0xb12129[_0x417b4d(0x1a1)]),{'verbose':_0x2aa36b[_0x417b4d(0x1be)]});await handleSingleObjectOutput(_0x5666df[_0x417b4d(0x12a)],_0x2aa36b);}}}return 0x0;}catch(_0x21807e){if(_0x21807e instanceof SDKError)return console[_0x417b4d(0x142)](_0x417b4d(0x1a9)+_0x21807e[_0x417b4d(0x12b)]),_0x21807e[_0x417b4d(0x165)]&&console['error'](_0x417b4d(0x186)+_0x21807e[_0x417b4d(0x165)]),0x1;throw _0x21807e;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x15d);['description']=a35_0x3b9a9b(0x133);async[a35_0x3b9a9b(0x14d)](_0x48f5e9){const _0xade2c1=a35_0x3b9a9b,{options:_0x119cbb,args:_0x38f64b,tdx:_0x3b9674}=_0x48f5e9,_0x7360ce=_0x38f64b[0x0];if(!_0x7360ce)return console[_0xade2c1(0x142)](_0xade2c1(0x153)),console[_0xade2c1(0x142)](_0xade2c1(0x157)),console[_0xade2c1(0x142)](_0xade2c1(0x188)),console[_0xade2c1(0x142)](_0xade2c1(0x179)),console[_0xade2c1(0x142)](_0xade2c1(0x151)),console[_0xade2c1(0x142)](_0xade2c1(0x14e)),0x1;try{const _0x1306d3=_0x119cbb[_0xade2c1(0x160)],_0x3344fa=await resolveSegmentTarget(_0x7360ce,_0x1306d3,_0x119cbb['verbose']);_0x119cbb[_0xade2c1(0x1be)]&&console[_0xade2c1(0x142)](_0xade2c1(0x183)+_0x3344fa);const _0x5f122a=await withSpinner('Resolving\x20\x27'+_0x7360ce+_0xade2c1(0x185),()=>_0x3b9674[_0xade2c1(0x16d)]['resolvePathToResource'](_0x3344fa),{'verbose':_0x119cbb[_0xade2c1(0x1be)]}),_0x3ca914=_0x5f122a[_0xade2c1(0x12a)];_0x119cbb[_0xade2c1(0x1be)]&&(console['error'](_0xade2c1(0x14f)+_0x3ca914['type']),console['error']('Parent\x20ID:\x20'+_0x3ca914[_0xade2c1(0x1b2)]));if(_0x3ca914[_0xade2c1(0x1a8)]===_0xade2c1(0x13c))return console[_0xade2c1(0x142)](_0xade2c1(0x15b)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x3ca914[_0xade2c1(0x1a8)]===_0xade2c1(0x13b))return console[_0xade2c1(0x142)](_0xade2c1(0x1b8)),console[_0xade2c1(0x142)](_0xade2c1(0x199)),0x1;if(!_0x3ca914['segmentId'])throw new SDKError(ErrorCode[_0xade2c1(0x17f)],_0xade2c1(0x155));const _0x362d4f=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3b9674[_0xade2c1(0x16d)]['getSegmentSQL'](_0x3ca914[_0xade2c1(0x1b2)],_0x3ca914[_0xade2c1(0x1a1)]),{'verbose':_0x119cbb[_0xade2c1(0x1be)]});let _0x5816df=_0x362d4f[_0xade2c1(0x12a)];const _0x174afc=resolveLimit(_0x119cbb[_0xade2c1(0x129)],DEFAULT_DISPLAY_LIMIT),_0x56e3b1=/\bLIMIT\s+\d+/i[_0xade2c1(0x19d)](_0x5816df);!_0x56e3b1&&(_0x5816df=_0x5816df[_0xade2c1(0x138)]()[_0xade2c1(0x126)](/;+$/,''),_0x5816df='SELECT\x20*\x20FROM\x20(\x0a'+_0x5816df+_0xade2c1(0x1b3)+_0x174afc);_0x119cbb['verbose']&&console[_0xade2c1(0x142)]('SQL\x20query:\x0a'+_0x5816df);const _0x72119f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x4779cf=>{const _0x27d0c6=_0xade2c1,_0x4f00a1=await _0x3b9674[_0x27d0c6(0x11b)]['execute'](_0x5816df,{'catalog':'td','schema':'information_schema','onJobId':_0x4f5aac=>{const _0x41bcd9=_0x27d0c6;_0x4779cf[_0x41bcd9(0x121)](_0x4f5aac);}});return _0x4f00a1;},{'verbose':_0x119cbb['verbose']}),_0x3139f3=_0x72119f[_0xade2c1(0x12a)],_0x150ff8=_0x3139f3['jobId']?_0xade2c1(0x17e)+_0x3139f3['jobId']+']':'';return console[_0xade2c1(0x142)](_0xade2c1(0x134)+_0x3139f3['stats']['processedRows'][_0xade2c1(0x1b6)]()+_0xade2c1(0x194)+('in\x20'+formatElapsed(_0x3139f3[_0xade2c1(0x1a7)]['elapsedTimeMillis'])+_0x150ff8)),await handleQueryOutput(_0x3139f3,_0x119cbb),0x0;}catch(_0x4cf2fd){if(_0x4cf2fd instanceof SDKError)return console[_0xade2c1(0x142)](_0xade2c1(0x12e)+_0x4cf2fd['code']+']'),console['error']('\x0a'+_0x4cf2fd[_0xade2c1(0x12b)]),0x1;throw _0x4cf2fd;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x15e);[a35_0x3b9a9b(0x14a)]=a35_0x3b9a9b(0x122);async['execute'](_0x57aa40){const _0x470400=a35_0x3b9a9b,{options:_0xded50d,args:_0x536563,tdx:_0x3a9c57}=_0x57aa40;if(_0x536563[_0x470400(0x12f)]===0x0)return console[_0x470400(0x142)](_0x470400(0x1a2)),console[_0x470400(0x142)](_0x470400(0x118)),0x1;const _0x10e412=_0x536563[0x0];try{_0xded50d[_0x470400(0x1be)]&&(console[_0x470400(0x142)](_0x470400(0x1a4)+_0xded50d['site']),console[_0x470400(0x142)]('Parent\x20name:\x20'+_0x10e412));const _0x3fa7a8=await withSpinner(_0x470400(0x123)+_0x10e412+_0x470400(0x185),()=>_0x3a9c57[_0x470400(0x16d)][_0x470400(0x180)](_0x10e412),{'verbose':_0xded50d[_0x470400(0x1be)]}),_0x450c0d=_0x3fa7a8[_0x470400(0x12a)];_0xded50d[_0x470400(0x1be)]&&console[_0x470400(0x142)](_0x470400(0x120)+_0x450c0d);const _0x4c85aa=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x10e412+_0x470400(0x185),()=>_0x3a9c57[_0x470400(0x16d)]['listFolders'](_0x450c0d),{'verbose':_0xded50d['verbose']}),_0x2edda0=_0x4c85aa[_0x470400(0x12a)];return console['error'](_0x470400(0x1b9)+_0x2edda0[_0x470400(0x12f)]+_0x470400(0x18c)+(_0x2edda0[_0x470400(0x12f)]!==0x1?'s':'')),await handleSDKOutput(_0x2edda0,_0xded50d),0x0;}catch(_0x1b64ea){if(_0x1b64ea instanceof SDKError)return console['error']('Error:\x20'+_0x1b64ea['message']),_0x1b64ea['cause']&&console[_0x470400(0x142)](_0x470400(0x186)+_0x1b64ea[_0x470400(0x165)]),0x1;throw _0x1b64ea;}}}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x128);['description']='Show\x20segment\x20folder\x20details';async['execute'](_0xbc159f){const _0x1328ae=a35_0x3b9a9b,{options:_0x2e07dc,args:_0xdc8f2c,tdx:_0xdd993e}=_0xbc159f;if(_0xdc8f2c['length']===0x0)return console[_0x1328ae(0x142)](_0x1328ae(0x184)),console['error'](_0x1328ae(0x18e)),0x1;try{const {parentId:_0x587bc,childId:_0x46ec09}=parseSegmentRef(_0xdc8f2c[0x0]);_0x2e07dc['verbose']&&(console[_0x1328ae(0x142)](_0x1328ae(0x1a4)+_0x2e07dc[_0x1328ae(0x17a)]),console['error'](_0x1328ae(0x17d)+_0x587bc),_0x46ec09&&console[_0x1328ae(0x142)]('Folder\x20name:\x20'+_0x46ec09));if(!_0x46ec09)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x4ea7f0=await withSpinner(_0x1328ae(0x123)+_0x587bc+_0x1328ae(0x185),()=>_0xdd993e[_0x1328ae(0x16d)][_0x1328ae(0x180)](_0x587bc),{'verbose':_0x2e07dc['verbose']}),_0x4c88b3=_0x4ea7f0['data'];_0x2e07dc[_0x1328ae(0x1be)]&&console[_0x1328ae(0x142)]('Resolved\x20parent\x20ID:\x20'+_0x4c88b3);const _0x1b85ac=await withSpinner(_0x1328ae(0x189)+_0x46ec09+_0x1328ae(0x185),()=>_0xdd993e['segment'][_0x1328ae(0x19c)](_0x4c88b3,_0x46ec09),{'verbose':_0x2e07dc[_0x1328ae(0x1be)]}),_0x371112=_0x1b85ac['data'];_0x2e07dc[_0x1328ae(0x1be)]&&console[_0x1328ae(0x142)](_0x1328ae(0x173)+_0x371112);const _0x28aadd=await withSpinner('Fetching\x20folder\x20\x27'+_0x46ec09+_0x1328ae(0x185),()=>_0xdd993e[_0x1328ae(0x16d)][_0x1328ae(0x170)](_0x371112),{'verbose':_0x2e07dc[_0x1328ae(0x1be)]});return await handleSDKOutput([_0x28aadd[_0x1328ae(0x12a)]],_0x2e07dc),0x0;}catch(_0x107310){if(_0x107310 instanceof SDKError)return console[_0x1328ae(0x142)](_0x1328ae(0x1a9)+_0x107310['message']),_0x107310['cause']&&console[_0x1328ae(0x142)]('\x20\x20Cause:\x20'+_0x107310[_0x1328ae(0x165)]),0x1;throw _0x107310;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x198);[a35_0x3b9a9b(0x14a)]=a35_0x3b9a9b(0x16e);async[a35_0x3b9a9b(0x14d)](_0xecc4c0){const _0x30cd51=a35_0x3b9a9b,{options:_0x2b8600,args:_0x18a18f}=_0xecc4c0,_0x5b4965=_0x2b8600,_0x347659=_0x5b4965[_0x30cd51(0x12c)],_0x2336c3=_0x18a18f[0x0];if(!_0x2336c3&&!_0x347659)return console['error'](a35_0x59fe37['red'](_0x30cd51(0x197))),console['error']('Usage:'),console[_0x30cd51(0x142)](_0x30cd51(0x144)),console[_0x30cd51(0x142)](_0x30cd51(0x15f)),console[_0x30cd51(0x142)]('Examples:'),console['error'](_0x30cd51(0x16a)),console[_0x30cd51(0x142)](_0x30cd51(0x147)),0x1;if(_0x2336c3&&_0x347659)return console[_0x30cd51(0x142)](a35_0x59fe37[_0x30cd51(0x15a)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x1777e3;if(_0x347659)_0x1777e3=await this[_0x30cd51(0x136)](_0x347659,_0xecc4c0);else{if(isYamlFilePath(_0x2336c3))return console[_0x30cd51(0x142)](a35_0x59fe37[_0x30cd51(0x15a)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x30cd51(0x142)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0x2336c3),0x1;else _0x1777e3=await this[_0x30cd51(0x163)](_0x2336c3,_0xecc4c0);}return _0x2b8600[_0x30cd51(0x132)]===_0x30cd51(0x145)||_0x2b8600[_0x30cd51(0x132)]===_0x30cd51(0x131)?await handleSDKOutput([{'sql':_0x1777e3}],_0x2b8600):console[_0x30cd51(0x19e)](_0x1777e3),0x0;}catch(_0x216a7d){if(_0x216a7d instanceof SDKError)return console[_0x30cd51(0x142)](_0x30cd51(0x1a9)+_0x216a7d[_0x30cd51(0x12b)]),_0x216a7d[_0x30cd51(0x165)]&&console['error']('\x20\x20Cause:\x20'+_0x216a7d[_0x30cd51(0x165)]),0x1;throw _0x216a7d;}}async[a35_0x3b9a9b(0x136)](_0x1c3c89,_0x80691a){const _0x160a3f=a35_0x3b9a9b,{options:_0x253620,tdx:_0x32cca3}=_0x80691a;let _0x32ed69;try{_0x32ed69=await resolveYamlFilePath(_0x1c3c89);}catch(_0x5ef04f){throw new SDKError(ErrorCode[_0x160a3f(0x11f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x5ef04f['message']);}_0x253620[_0x160a3f(0x1be)]&&console['error'](_0x160a3f(0x193)+_0x32ed69[_0x160a3f(0x160)]+'/'+_0x32ed69['segmentName']);const _0x7400e4=await withSpinner(_0x160a3f(0x159),()=>_0x32cca3[_0x160a3f(0x16d)][_0x160a3f(0x176)](_0x32ed69[_0x160a3f(0x152)],_0x32ed69[_0x160a3f(0x160)],_0x32ed69[_0x160a3f(0x18f)]),{'verbose':_0x253620[_0x160a3f(0x1be)]});return _0x7400e4[_0x160a3f(0x12a)];}async[a35_0x3b9a9b(0x163)](_0x4ac963,_0xb9bbc5){const _0x439967=a35_0x3b9a9b,{options:_0x592bbe,tdx:_0x34a807}=_0xb9bbc5,_0x2fafb6=_0x592bbe[_0x439967(0x160)],_0x542382=await resolveSegmentTarget(_0x4ac963,_0x2fafb6,_0x592bbe[_0x439967(0x1be)]);_0x592bbe[_0x439967(0x1be)]&&console['error']('Target\x20path:\x20'+_0x542382);const _0xc7ab98=await withSpinner(_0x439967(0x148)+_0x4ac963+_0x439967(0x185),()=>_0x34a807[_0x439967(0x16d)]['resolvePathToResource'](_0x542382),{'verbose':_0x592bbe[_0x439967(0x1be)]}),_0x425163=_0xc7ab98[_0x439967(0x12a)];_0x592bbe['verbose']&&(console[_0x439967(0x142)]('Resolved\x20type:\x20'+_0x425163[_0x439967(0x1a8)]),console[_0x439967(0x142)](_0x439967(0x14b)+_0x425163[_0x439967(0x1b2)]));if(_0x425163[_0x439967(0x1a8)]===_0x439967(0x13c))throw new SDKError(ErrorCode[_0x439967(0x11f)],_0x439967(0x158));if(_0x425163[_0x439967(0x1a8)]==='parent')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x439967(0x1b4));if(!_0x425163['segmentId'])throw new SDKError(ErrorCode[_0x439967(0x17f)],_0x439967(0x155));const _0x1cf4be=await withSpinner(_0x439967(0x19b),()=>_0x34a807[_0x439967(0x16d)]['getSegmentSQL'](_0x425163['parentId'],_0x425163[_0x439967(0x1a1)]),{'verbose':_0x592bbe['verbose']});return _0x1cf4be[_0x439967(0x12a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x187);[a35_0x3b9a9b(0x14a)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x452776){const _0xbc3c8b=a35_0x3b9a9b,{options:_0x57427e,args:_0x4094d6,tdx:_0x5e554c}=_0x452776,_0x1ca994=_0x57427e;if(_0x4094d6[_0xbc3c8b(0x12f)]<0x2)return console[_0xbc3c8b(0x142)](_0xbc3c8b(0x177)),console['error'](_0xbc3c8b(0x16b)),0x1;const _0x11483a=_0x4094d6[0x0],_0x92666d=_0x4094d6[0x1];_0x1ca994[_0xbc3c8b(0x1be)]&&(console[_0xbc3c8b(0x142)]('Site:\x20'+_0x1ca994['site']),console[_0xbc3c8b(0x142)](_0xbc3c8b(0x169)+_0x11483a),console[_0xbc3c8b(0x142)](_0xbc3c8b(0x17b)+_0x92666d));let _0x491ce4;if(_0x1ca994['parentFolder']){const _0x36da81=_0x1ca994[_0xbc3c8b(0x167)],_0x358670=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11483a+_0xbc3c8b(0x185),()=>_0x5e554c['segment'][_0xbc3c8b(0x180)](_0x11483a),{'verbose':_0x1ca994['verbose']}),_0x1abd7c=_0x358670['data'],_0x1d5f52=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x36da81+'\x27...',()=>_0x5e554c[_0xbc3c8b(0x16d)][_0xbc3c8b(0x19c)](_0x1abd7c,_0x36da81),{'verbose':_0x1ca994[_0xbc3c8b(0x1be)]});_0x491ce4=_0x1d5f52[_0xbc3c8b(0x12a)],_0x1ca994['verbose']&&console[_0xbc3c8b(0x142)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x491ce4);}const _0x51a2ce={'name':_0x92666d,'description':_0x1ca994[_0xbc3c8b(0x14a)],'parentFolderId':_0x491ce4},_0x2793f7=await withSpinner(_0xbc3c8b(0x1bc)+_0x92666d+_0xbc3c8b(0x185),()=>_0x5e554c[_0xbc3c8b(0x16d)][_0xbc3c8b(0x1aa)](_0x11483a,_0x51a2ce),{'verbose':_0x1ca994[_0xbc3c8b(0x1be)]}),_0x529aec=_0x2793f7['data'];return console[_0xbc3c8b(0x142)](_0xbc3c8b(0x12d)+_0x529aec[_0xbc3c8b(0x13f)]+_0xbc3c8b(0x171)+_0x529aec['id']),await handleSDKOutput([_0x529aec],_0x1ca994),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x191);['description']=a35_0x3b9a9b(0x11a);async[a35_0x3b9a9b(0x14d)](_0x2b77c3){const _0x3842f1=a35_0x3b9a9b,{options:_0x28799b,args:_0x4438f7,tdx:_0x3d2bbe}=_0x2b77c3,_0x329dbd=_0x4438f7[0x0];if(!_0x329dbd)return console[_0x3842f1(0x142)](_0x3842f1(0x162)),console[_0x3842f1(0x142)](_0x3842f1(0x150)),console[_0x3842f1(0x142)](_0x3842f1(0x11d)),console['error'](_0x3842f1(0x1ab)),console[_0x3842f1(0x142)](_0x3842f1(0x1b0)),console[_0x3842f1(0x142)](_0x3842f1(0x179)),console[_0x3842f1(0x142)](_0x3842f1(0x154)),console[_0x3842f1(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x3842f1(0x142)](_0x3842f1(0x1ad)),console[_0x3842f1(0x142)](_0x3842f1(0x156)),0x1;try{const _0x40475f=_0x28799b[_0x3842f1(0x160)],_0x3d32d1=await resolveSegmentTarget(_0x329dbd,_0x40475f,_0x28799b[_0x3842f1(0x1be)]);_0x28799b[_0x3842f1(0x1be)]&&console['error'](_0x3842f1(0x183)+_0x3d32d1);const _0x3b520c=await withSpinner('Resolving\x20\x27'+_0x329dbd+'\x27...',()=>_0x3d2bbe[_0x3842f1(0x16d)][_0x3842f1(0x1b5)](_0x3d32d1),{'verbose':_0x28799b[_0x3842f1(0x1be)]}),_0x29632d=_0x3b520c[_0x3842f1(0x12a)];_0x28799b['verbose']&&(console['error'](_0x3842f1(0x14f)+_0x29632d[_0x3842f1(0x1a8)]),console[_0x3842f1(0x142)](_0x3842f1(0x14b)+_0x29632d[_0x3842f1(0x1b2)]),_0x29632d[_0x3842f1(0x124)]&&console[_0x3842f1(0x142)]('Folder\x20ID:\x20'+_0x29632d['folderId']),_0x29632d[_0x3842f1(0x1a1)]&&console[_0x3842f1(0x142)]('Segment\x20ID:\x20'+_0x29632d[_0x3842f1(0x1a1)]));if(_0x28799b[_0x3842f1(0x135)]){if(_0x29632d['type']===_0x3842f1(0x13c))return console[_0x3842f1(0x142)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x29632d[_0x3842f1(0x1a8)]===_0x3842f1(0x13b))return console[_0x3842f1(0x142)](_0x3842f1(0x175)),console[_0x3842f1(0x142)](_0x3842f1(0x1bb)),0x1;if(!_0x29632d['segmentId'])throw new SDKError(ErrorCode[_0x3842f1(0x17f)],_0x3842f1(0x155));const _0x565b47=getConsoleNextUrl(_0x28799b[_0x3842f1(0x17a)],_0x3842f1(0x192)+_0x29632d[_0x3842f1(0x1b2)]+_0x3842f1(0x1a5)+_0x29632d[_0x3842f1(0x1a1)]);return console[_0x3842f1(0x142)](a35_0x59fe37[_0x3842f1(0x190)]('✔')+_0x3842f1(0x11e)+a35_0x59fe37[_0x3842f1(0x141)](_0x565b47)),openBrowser(_0x565b47),0x0;}if(_0x29632d['type']==='folder'){if(!_0x29632d['folderId'])throw new SDKError(ErrorCode[_0x3842f1(0x1ba)],_0x3842f1(0x1ae));const _0x942173=await withSpinner(_0x3842f1(0x1ac),()=>_0x3d2bbe[_0x3842f1(0x16d)][_0x3842f1(0x170)](_0x29632d[_0x3842f1(0x124)]),{'verbose':_0x28799b['verbose']});await handleSingleObjectOutput(_0x942173['data'],_0x28799b);}else{if(_0x29632d[_0x3842f1(0x1a8)]===_0x3842f1(0x16d)){if(!_0x29632d['segmentId'])throw new SDKError(ErrorCode[_0x3842f1(0x17f)],_0x3842f1(0x155));const _0x44e4c6=await withSpinner(_0x3842f1(0x1a0),()=>_0x3d2bbe[_0x3842f1(0x16d)][_0x3842f1(0x149)](_0x29632d[_0x3842f1(0x1b2)],_0x29632d['segmentId']),{'verbose':_0x28799b['verbose']}),_0x5a0c98=getConsoleNextUrl(_0x28799b[_0x3842f1(0x17a)],_0x3842f1(0x192)+_0x29632d[_0x3842f1(0x1b2)]+_0x3842f1(0x1a5)+_0x29632d[_0x3842f1(0x1a1)]),_0x2d02cc=_0x44e4c6[_0x3842f1(0x12a)];_0x2d02cc[_0x3842f1(0x13e)]=_0x5a0c98,await handleSingleObjectOutput(_0x2d02cc,_0x28799b);}else return console['error'](_0x3842f1(0x195)),console[_0x3842f1(0x142)](_0x3842f1(0x140)),0x1;}return 0x0;}catch(_0x2ee53b){if(_0x2ee53b instanceof SDKError)return console[_0x3842f1(0x142)](_0x3842f1(0x1a9)+_0x2ee53b['message']),_0x2ee53b[_0x3842f1(0x165)]&&console[_0x3842f1(0x142)]('\x20\x20Cause:\x20'+_0x2ee53b[_0x3842f1(0x165)]),0x1;throw _0x2ee53b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';['description']=a35_0x3b9a9b(0x146);async[a35_0x3b9a9b(0x14d)](_0x138d30){const _0x1ceb95=a35_0x3b9a9b,{options:_0x54d0ec,args:_0x5e5046,tdx:_0x39f295}=_0x138d30,_0x5e5f97=_0x5e5046[0x0];if(!_0x5e5f97)return console[_0x1ceb95(0x142)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1ceb95(0x142)](_0x1ceb95(0x196)),console[_0x1ceb95(0x142)](_0x1ceb95(0x13a)),console[_0x1ceb95(0x142)](_0x1ceb95(0x179)),console['error'](_0x1ceb95(0x1af)),console[_0x1ceb95(0x142)](_0x1ceb95(0x1b7)),0x1;try{const _0x2af4b8=_0x54d0ec[_0x1ceb95(0x160)],_0x458f66=await resolveSegmentTarget(_0x5e5f97,_0x2af4b8,_0x54d0ec[_0x1ceb95(0x1be)]);_0x54d0ec[_0x1ceb95(0x1be)]&&console[_0x1ceb95(0x142)]('Target\x20path:\x20'+_0x458f66);const _0x45dd11=await withSpinner(_0x1ceb95(0x148)+_0x5e5f97+_0x1ceb95(0x185),()=>_0x39f295[_0x1ceb95(0x16d)]['resolvePathToResource'](_0x458f66),{'verbose':_0x54d0ec[_0x1ceb95(0x1be)]}),_0xd93ddf=_0x45dd11[_0x1ceb95(0x12a)];_0x54d0ec['verbose']&&(console[_0x1ceb95(0x142)]('Resolved\x20type:\x20'+_0xd93ddf[_0x1ceb95(0x1a8)]),console[_0x1ceb95(0x142)](_0x1ceb95(0x14b)+_0xd93ddf[_0x1ceb95(0x1b2)]));if(_0xd93ddf[_0x1ceb95(0x1a8)]===_0x1ceb95(0x13c))return console[_0x1ceb95(0x142)](_0x1ceb95(0x119)),console[_0x1ceb95(0x142)](_0x1ceb95(0x16f)),0x1;if(_0xd93ddf['type']==='parent')return console[_0x1ceb95(0x142)](_0x1ceb95(0x125)),console[_0x1ceb95(0x142)](_0x1ceb95(0x18a)),0x1;if(!_0xd93ddf[_0x1ceb95(0x1a1)])throw new SDKError(ErrorCode[_0x1ceb95(0x17f)],_0x1ceb95(0x155));const _0x27d861=await withSpinner(_0x1ceb95(0x19b),()=>_0x39f295[_0x1ceb95(0x16d)][_0x1ceb95(0x16c)](_0xd93ddf[_0x1ceb95(0x1b2)],_0xd93ddf[_0x1ceb95(0x1a1)]),{'verbose':_0x54d0ec[_0x1ceb95(0x1be)]}),_0x28bae6=_0x27d861[_0x1ceb95(0x12a)],_0x2f3a48=await executeSchemaQuery(_0x28bae6,_0x39f295,_0x54d0ec);return await handleQueryOutput(_0x2f3a48,_0x54d0ec),0x0;}catch(_0x5aab97){if(_0x5aab97 instanceof SDKError)return console[_0x1ceb95(0x142)](_0x1ceb95(0x1a9)+_0x5aab97[_0x1ceb95(0x12b)]),_0x5aab97[_0x1ceb95(0x165)]&&console[_0x1ceb95(0x142)]('\x20\x20Cause:\x20'+_0x5aab97[_0x1ceb95(0x165)]),0x1;throw _0x5aab97;}}}
|
|
1
|
+
const a35_0x500582=a35_0x5279;(function(_0x5537ac,_0x57c730){const _0x3eb798=a35_0x5279,_0x5f55a7=_0x5537ac();while(!![]){try{const _0x2b7d55=-parseInt(_0x3eb798(0x24f))/0x1+parseInt(_0x3eb798(0x22e))/0x2*(-parseInt(_0x3eb798(0x24e))/0x3)+-parseInt(_0x3eb798(0x235))/0x4*(parseInt(_0x3eb798(0x24a))/0x5)+-parseInt(_0x3eb798(0x22b))/0x6+-parseInt(_0x3eb798(0x208))/0x7+parseInt(_0x3eb798(0x21d))/0x8*(-parseInt(_0x3eb798(0x252))/0x9)+parseInt(_0x3eb798(0x23b))/0xa;if(_0x2b7d55===_0x57c730)break;else _0x5f55a7['push'](_0x5f55a7['shift']());}catch(_0x22202f){_0x5f55a7['push'](_0x5f55a7['shift']());}}}(a35_0x3147,0x25382));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';function a35_0x3147(){const _0xbe9302=['Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20name:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','SEGMENT_NOT_FOUND','segment','Show\x20segment\x20folder\x20details','parent','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Examples:','\x20[Job\x20ID:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','message','stats','resolveFolderId','Executing\x20segment\x20query...','/e/','Fetching\x20SQL\x20from\x20rule...','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','getSQLFromServerSegment','green','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Site:\x20','path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','964467QMgmfb','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Create\x20segment\x20folder\x20for\x20organization','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolved:\x20','Resolved\x20type:\x20','toLocaleString','error','type','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolved\x20parent\x20ID:\x20','limit','SELECT\x20*\x20FROM\x20(\x0a','cyan','json','url','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','createFolder','Parent\x20ID:\x20','site','1672FAMKbd','Target\x20path:\x20','\x20\x20Full\x20path:\x20','segment:describe','resolvePathToResource','Fetching\x20folder\x20\x27','processedRows','log','Resolved\x20relative\x20path\x20to:\x20','Fetching\x20SQL\x20for\x20segment...','folderPath','getSegmentSQLFromYaml','resolveParentId','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','770136DoiHOD','Use:\x20tdx\x20ps\x20view','segment:desc','2PmlbdU','getSegment','Resolved\x20folder\x20ID:\x20','segmentPath','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parentSegment','144djYNDa','jobId','Usage:\x20tdx\x20segment\x20describe\x20<path>','data','Fetching\x20parent\x20segment\x20details...','SEGMENT_FOLDER_NOT_FOUND','12135180FapgOy','code','red','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','execute','Resolving\x20parent\x20folder\x20\x27','trim','cause','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segmentId','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','SQL\x20query:\x0a','\x27\x20with\x20ID:\x20','getFolder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','27460HLbxqx','Resolved\x20YAML\x20file:\x20','getSQLFromYamlFile','Show\x20segment\x20or\x20folder\x20details','757899GVRbuJ','293590KzDiJT','name','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','2196bknzKD','Listing\x20folders\x20for\x20parent\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segment:folder:create','elapsedTimeMillis','Error:\x20Folder\x20reference\x20is\x20required','segment:view','format','replace','✔\x20Found\x20','setJobId','Error:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Parent\x20name:\x20','Options:','parentId','Creating\x20folder\x20\x27','Resolving\x20\x27','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','content','Show\x20folder\x20or\x20child\x20segment\x20details','information_schema','description','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','folder','Get\x20SQL\x20query\x20for\x20child\x20segment','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Resolving\x20path\x20\x27','\x20Opening\x20','✖\x20Query\x20failed\x20[','Segment\x20ID:\x20','getSegmentSQL','in\x20','segmentName','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','\x20\x20Parent\x20segment:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Parent\x20segment:\x20','web','Resolving\x20parent\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','length','verbose','Use:\x20tdx\x20ps\x20show','Resolving\x20folder\x20\x27','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20Cause:\x20','segment:folder:list','/app/ps/','folderId','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Folder\x20path:\x20','\x20rows\x20','\x27...','Usage:\x20tdx\x20sg\x20show\x20<name>','INVALID_ARGUMENT','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22'];a35_0x3147=function(){return _0xbe9302;};return a35_0x3147();}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 a35_0x2c9435 from'chalk';async function resolveSegmentTarget(_0x671a80,_0x195da0,_0x215b03){const _0x1a2191=a35_0x5279;if(isYamlFilePath(_0x671a80))try{const _0x230de4=await resolveYamlFilePath(_0x671a80);return _0x215b03&&(console[_0x1a2191(0x20f)](_0x1a2191(0x24b)+_0x671a80),console[_0x1a2191(0x20f)](_0x1a2191(0x279)+_0x230de4[_0x1a2191(0x234)]),console['error'](_0x1a2191(0x211)+_0x230de4[_0x1a2191(0x277)]),console[_0x1a2191(0x20f)](_0x1a2191(0x1e6)+(_0x230de4[_0x1a2191(0x227)]||'(root)')),console[_0x1a2191(0x20f)](_0x1a2191(0x21f)+_0x230de4['fullPath'])),_0x230de4['fullPath'];}catch(_0x3abc69){throw new SDKError(ErrorCode[_0x1a2191(0x1ea)],_0x1a2191(0x219)+_0x3abc69['message']);}if(!_0x195da0)throw new SDKError(ErrorCode[_0x1a2191(0x1ea)],_0x1a2191(0x1ed));return _0x195da0+'/'+_0x671a80;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x220);[a35_0x500582(0x268)]=a35_0x500582(0x24d);async[a35_0x500582(0x23f)](_0x52c859){const _0xf49753=a35_0x500582,{options:_0x1eccde,args:_0x1ddf27,tdx:_0x31295b}=_0x52c859,_0x5ca0ea=_0x1ddf27[0x0],_0x1cdf78=!_0x5ca0ea&&!!_0x1eccde['parentSegment'],_0x533a9b=_0x5ca0ea||_0x1eccde[_0xf49753(0x234)];if(!_0x533a9b)return console['error'](_0xf49753(0x1f8)),console[_0xf49753(0x20f)](_0xf49753(0x237)),console[_0xf49753(0x20f)](_0xf49753(0x1f6)),console[_0xf49753(0x20f)](_0xf49753(0x26b)),console['error'](_0xf49753(0x207)),console[_0xf49753(0x20f)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0xf49753(0x20f)](_0xf49753(0x23e)),0x1;try{const _0x5b40aa=_0x1eccde[_0xf49753(0x231)];let _0xc83fae=_0x533a9b;!_0x1cdf78&&_0x5b40aa&&!_0x533a9b['includes']('/')&&(_0xc83fae=_0x5b40aa+'/'+_0x533a9b,_0x1eccde[_0xf49753(0x283)]&&console[_0xf49753(0x20f)](_0xf49753(0x225)+_0xc83fae));const _0x45c71e=await withSpinner(_0xf49753(0x271)+_0xc83fae+_0xf49753(0x1e8),()=>_0x31295b[_0xf49753(0x1f2)][_0xf49753(0x221)](_0xc83fae),{'verbose':_0x1eccde[_0xf49753(0x283)]}),_0x484c3c=_0x45c71e[_0xf49753(0x238)];_0x1eccde[_0xf49753(0x283)]&&(console['error'](_0xf49753(0x20d)+_0x484c3c[_0xf49753(0x210)]),console[_0xf49753(0x20f)](_0xf49753(0x21b)+_0x484c3c[_0xf49753(0x261)]),_0x484c3c[_0xf49753(0x1e4)]&&console[_0xf49753(0x20f)]('Folder\x20ID:\x20'+_0x484c3c['folderId']),_0x484c3c[_0xf49753(0x244)]&&console[_0xf49753(0x20f)](_0xf49753(0x274)+_0x484c3c[_0xf49753(0x244)]));if(_0x484c3c[_0xf49753(0x210)]===_0xf49753(0x1f4)){const _0x4784d1=await withSpinner(_0xf49753(0x239),()=>_0x31295b[_0xf49753(0x1f2)]['getParent'](_0x484c3c[_0xf49753(0x261)]),{'verbose':_0x1eccde[_0xf49753(0x283)]});await handleSingleObjectOutput(_0x4784d1[_0xf49753(0x238)],_0x1eccde);}else{if(_0x484c3c[_0xf49753(0x210)]===_0xf49753(0x26c)){if(!_0x484c3c[_0xf49753(0x1e4)])throw new SDKError(ErrorCode[_0xf49753(0x23a)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x266fea=await withSpinner(_0xf49753(0x286),()=>_0x31295b['segment'][_0xf49753(0x248)](_0x484c3c[_0xf49753(0x1e4)]),{'verbose':_0x1eccde[_0xf49753(0x283)]});await handleSingleObjectOutput(_0x266fea[_0xf49753(0x238)],_0x1eccde);}else{if(_0x484c3c[_0xf49753(0x210)]===_0xf49753(0x1f2)){if(!_0x484c3c[_0xf49753(0x244)])throw new SDKError(ErrorCode[_0xf49753(0x1f1)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ccec2=await withSpinner(_0xf49753(0x281),()=>_0x31295b['segment'][_0xf49753(0x22f)](_0x484c3c[_0xf49753(0x261)],_0x484c3c[_0xf49753(0x244)]),{'verbose':_0x1eccde[_0xf49753(0x283)]});await handleSingleObjectOutput(_0x5ccec2[_0xf49753(0x238)],_0x1eccde);}}}return 0x0;}catch(_0x56f1e6){if(_0x56f1e6 instanceof SDKError)return console[_0xf49753(0x20f)](_0xf49753(0x25d)+_0x56f1e6['message']),_0x56f1e6[_0xf49753(0x242)]&&console[_0xf49753(0x20f)](_0xf49753(0x288)+_0x56f1e6['cause']),0x1;throw _0x56f1e6;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';['description']=a35_0x500582(0x26f);async[a35_0x500582(0x23f)](_0x1af566){const _0x4513f4=a35_0x500582,{options:_0x28db20,args:_0x3cb688,tdx:_0x11fc00}=_0x1af566,_0x4f39c9=_0x3cb688[0x0];if(!_0x4f39c9)return console[_0x4513f4(0x20f)](_0x4513f4(0x1ee)),console[_0x4513f4(0x20f)](_0x4513f4(0x1e9)),console[_0x4513f4(0x20f)](_0x4513f4(0x1eb)),console['error']('Examples:'),console[_0x4513f4(0x20f)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4513f4(0x20f)](_0x4513f4(0x287)),0x1;try{const _0x48d063=_0x28db20['parentSegment'],_0xf7bc83=await resolveSegmentTarget(_0x4f39c9,_0x48d063,_0x28db20[_0x4513f4(0x283)]);_0x28db20[_0x4513f4(0x283)]&&console[_0x4513f4(0x20f)](_0x4513f4(0x21e)+_0xf7bc83);const _0x542eab=await withSpinner(_0x4513f4(0x263)+_0x4f39c9+_0x4513f4(0x1e8),()=>_0x11fc00[_0x4513f4(0x1f2)][_0x4513f4(0x221)](_0xf7bc83),{'verbose':_0x28db20[_0x4513f4(0x283)]}),_0x442d28=_0x542eab[_0x4513f4(0x238)];_0x28db20[_0x4513f4(0x283)]&&(console['error'](_0x4513f4(0x20d)+_0x442d28[_0x4513f4(0x210)]),console['error']('Parent\x20ID:\x20'+_0x442d28[_0x4513f4(0x261)]));if(_0x442d28['type']==='folder')return console[_0x4513f4(0x20f)](_0x4513f4(0x26a)),console['error'](_0x4513f4(0x209)),0x1;if(_0x442d28[_0x4513f4(0x210)]==='parent')return console[_0x4513f4(0x20f)](_0x4513f4(0x1f9)),console[_0x4513f4(0x20f)](_0x4513f4(0x284)),0x1;if(!_0x442d28[_0x4513f4(0x244)])throw new SDKError(ErrorCode[_0x4513f4(0x1f1)],_0x4513f4(0x280));const _0x495fa7=await withSpinner(_0x4513f4(0x226),()=>_0x11fc00['segment'][_0x4513f4(0x275)](_0x442d28[_0x4513f4(0x261)],_0x442d28[_0x4513f4(0x244)]),{'verbose':_0x28db20['verbose']});let _0x3e76c6=_0x495fa7[_0x4513f4(0x238)];const _0x3d2113=resolveLimit(_0x28db20[_0x4513f4(0x214)],DEFAULT_DISPLAY_LIMIT),_0x3a4d2c=/\bLIMIT\s+\d+/i['test'](_0x3e76c6);!_0x3a4d2c&&(_0x3e76c6=_0x3e76c6[_0x4513f4(0x241)]()[_0x4513f4(0x25a)](/;+$/,''),_0x3e76c6=_0x4513f4(0x215)+_0x3e76c6+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x3d2113);_0x28db20[_0x4513f4(0x283)]&&console['error'](_0x4513f4(0x246)+_0x3e76c6);const _0x2cb81c=await withProgressSpinner(_0x4513f4(0x1fe),async _0x5d9c69=>{const _0x5af5b1=_0x4513f4,_0xd914c4=await _0x11fc00['query']['execute'](_0x3e76c6,{'catalog':'td','schema':_0x5af5b1(0x267),'onJobId':_0x565699=>{const _0x2700a5=_0x5af5b1;_0x5d9c69[_0x2700a5(0x25c)](_0x565699);}});return _0xd914c4;},{'verbose':_0x28db20[_0x4513f4(0x283)]}),_0x230e60=_0x2cb81c[_0x4513f4(0x238)],_0x16c259=_0x230e60[_0x4513f4(0x236)]?_0x4513f4(0x1f7)+_0x230e60['jobId']+']':'';return console[_0x4513f4(0x20f)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x230e60[_0x4513f4(0x1fc)][_0x4513f4(0x223)][_0x4513f4(0x20e)]()+_0x4513f4(0x1e7)+(_0x4513f4(0x276)+formatElapsed(_0x230e60[_0x4513f4(0x1fc)][_0x4513f4(0x256)])+_0x16c259)),await handleQueryOutput(_0x230e60,_0x28db20),0x0;}catch(_0x4c43b3){if(_0x4c43b3 instanceof SDKError)return console[_0x4513f4(0x20f)](_0x4513f4(0x273)+_0x4c43b3[_0x4513f4(0x23c)]+']'),console[_0x4513f4(0x20f)]('\x0a'+_0x4c43b3[_0x4513f4(0x1fb)]),0x1;throw _0x4c43b3;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x289);[a35_0x500582(0x268)]=a35_0x500582(0x20b);async[a35_0x500582(0x23f)](_0x5e34df){const _0x548757=a35_0x500582,{options:_0x1043f4,args:_0x4df0f3,tdx:_0x516e5e}=_0x5e34df;if(_0x4df0f3['length']===0x0)return console[_0x548757(0x20f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x548757(0x20f)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x43f69e=_0x4df0f3[0x0];try{_0x1043f4[_0x548757(0x283)]&&(console['error'](_0x548757(0x205)+_0x1043f4[_0x548757(0x21c)]),console[_0x548757(0x20f)](_0x548757(0x25f)+_0x43f69e));const _0x56265a=await withSpinner(_0x548757(0x27f)+_0x43f69e+_0x548757(0x1e8),()=>_0x516e5e[_0x548757(0x1f2)][_0x548757(0x229)](_0x43f69e),{'verbose':_0x1043f4[_0x548757(0x283)]}),_0x3a18a5=_0x56265a[_0x548757(0x238)];_0x1043f4[_0x548757(0x283)]&&console['error'](_0x548757(0x213)+_0x3a18a5);const _0x61d116=await withSpinner(_0x548757(0x253)+_0x43f69e+'\x27...',()=>_0x516e5e[_0x548757(0x1f2)]['listFolders'](_0x3a18a5),{'verbose':_0x1043f4[_0x548757(0x283)]}),_0x5b4559=_0x61d116[_0x548757(0x238)];return console[_0x548757(0x20f)](_0x548757(0x25b)+_0x5b4559['length']+'\x20folder'+(_0x5b4559[_0x548757(0x282)]!==0x1?'s':'')),await handleSDKOutput(_0x5b4559,_0x1043f4),0x0;}catch(_0x19ba92){if(_0x19ba92 instanceof SDKError)return console[_0x548757(0x20f)]('Error:\x20'+_0x19ba92['message']),_0x19ba92[_0x548757(0x242)]&&console[_0x548757(0x20f)](_0x548757(0x288)+_0x19ba92[_0x548757(0x242)]),0x1;throw _0x19ba92;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a35_0x500582(0x268)]=a35_0x500582(0x1f3);async[a35_0x500582(0x23f)](_0x459f39){const _0x58b4f6=a35_0x500582,{options:_0x2838a8,args:_0x48d8f9,tdx:_0x4642cd}=_0x459f39;if(_0x48d8f9['length']===0x0)return console[_0x58b4f6(0x20f)](_0x58b4f6(0x257)),console[_0x58b4f6(0x20f)](_0x58b4f6(0x1fa)),0x1;try{const {parentId:_0x3064ab,childId:_0x3338ea}=parseSegmentRef(_0x48d8f9[0x0]);_0x2838a8[_0x58b4f6(0x283)]&&(console[_0x58b4f6(0x20f)]('Site:\x20'+_0x2838a8[_0x58b4f6(0x21c)]),console[_0x58b4f6(0x20f)](_0x58b4f6(0x25f)+_0x3064ab),_0x3338ea&&console[_0x58b4f6(0x20f)](_0x58b4f6(0x1ef)+_0x3338ea));if(!_0x3338ea)return console['error'](_0x58b4f6(0x27a)),0x1;const _0x41bc99=await withSpinner(_0x58b4f6(0x27f)+_0x3064ab+_0x58b4f6(0x1e8),()=>_0x4642cd['segment'][_0x58b4f6(0x229)](_0x3064ab),{'verbose':_0x2838a8[_0x58b4f6(0x283)]}),_0xe6f687=_0x41bc99[_0x58b4f6(0x238)];_0x2838a8[_0x58b4f6(0x283)]&&console[_0x58b4f6(0x20f)]('Resolved\x20parent\x20ID:\x20'+_0xe6f687);const _0xb299eb=await withSpinner(_0x58b4f6(0x285)+_0x3338ea+_0x58b4f6(0x1e8),()=>_0x4642cd[_0x58b4f6(0x1f2)][_0x58b4f6(0x1fd)](_0xe6f687,_0x3338ea),{'verbose':_0x2838a8['verbose']}),_0x1ebaa6=_0xb299eb[_0x58b4f6(0x238)];_0x2838a8[_0x58b4f6(0x283)]&&console['error'](_0x58b4f6(0x230)+_0x1ebaa6);const _0x2c2b14=await withSpinner(_0x58b4f6(0x222)+_0x3338ea+_0x58b4f6(0x1e8),()=>_0x4642cd[_0x58b4f6(0x1f2)]['getFolder'](_0x1ebaa6),{'verbose':_0x2838a8[_0x58b4f6(0x283)]});return await handleSDKOutput([_0x2c2b14[_0x58b4f6(0x238)]],_0x2838a8),0x0;}catch(_0x24824f){if(_0x24824f instanceof SDKError)return console[_0x58b4f6(0x20f)]('Error:\x20'+_0x24824f[_0x58b4f6(0x1fb)]),_0x24824f[_0x58b4f6(0x242)]&&console[_0x58b4f6(0x20f)]('\x20\x20Cause:\x20'+_0x24824f[_0x58b4f6(0x242)]),0x1;throw _0x24824f;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x500582(0x250)]='segment:sql';[a35_0x500582(0x268)]=a35_0x500582(0x26d);async[a35_0x500582(0x23f)](_0x9a28c){const _0x480600=a35_0x500582,{options:_0x469aba,args:_0x46291b}=_0x9a28c,_0x472e69=_0x469aba,_0x6fe391=_0x472e69[_0x480600(0x206)],_0x2870e0=_0x46291b[0x0];if(!_0x2870e0&&!_0x6fe391)return console['error'](a35_0x2c9435[_0x480600(0x23d)](_0x480600(0x26e))),console[_0x480600(0x20f)]('Usage:'),console[_0x480600(0x20f)](_0x480600(0x278)),console[_0x480600(0x20f)](_0x480600(0x1e5)),console['error'](_0x480600(0x1f6)),console[_0x480600(0x20f)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x480600(0x20f)](_0x480600(0x270)),0x1;if(_0x2870e0&&_0x6fe391)return console[_0x480600(0x20f)](a35_0x2c9435[_0x480600(0x23d)](_0x480600(0x22a))),0x1;try{let _0x41b39b;if(_0x6fe391)_0x41b39b=await this[_0x480600(0x24c)](_0x6fe391,_0x9a28c);else{if(isYamlFilePath(_0x2870e0))return console[_0x480600(0x20f)](a35_0x2c9435[_0x480600(0x23d)](_0x480600(0x1f0))),console[_0x480600(0x20f)](_0x480600(0x212)+_0x2870e0),0x1;else _0x41b39b=await this[_0x480600(0x202)](_0x2870e0,_0x9a28c);}return _0x469aba[_0x480600(0x259)]===_0x480600(0x217)||_0x469aba[_0x480600(0x259)]==='jsonl'?await handleSDKOutput([{'sql':_0x41b39b}],_0x469aba):console[_0x480600(0x224)](_0x41b39b),0x0;}catch(_0x2f07db){if(_0x2f07db instanceof SDKError)return console[_0x480600(0x20f)](_0x480600(0x25d)+_0x2f07db['message']),_0x2f07db[_0x480600(0x242)]&&console[_0x480600(0x20f)](_0x480600(0x288)+_0x2f07db[_0x480600(0x242)]),0x1;throw _0x2f07db;}}async['getSQLFromYamlFile'](_0x48d2ff,_0x59fafe){const _0x3aaed4=a35_0x500582,{options:_0xa6945c,tdx:_0x4ee636}=_0x59fafe;let _0x31df44;try{_0x31df44=await resolveYamlFilePath(_0x48d2ff);}catch(_0x3cf2c3){throw new SDKError(ErrorCode[_0x3aaed4(0x1ea)],_0x3aaed4(0x219)+_0x3cf2c3[_0x3aaed4(0x1fb)]);}_0xa6945c[_0x3aaed4(0x283)]&&console[_0x3aaed4(0x20f)](_0x3aaed4(0x20c)+_0x31df44[_0x3aaed4(0x234)]+'/'+_0x31df44[_0x3aaed4(0x277)]);const _0x45e8ed=await withSpinner(_0x3aaed4(0x200),()=>_0x4ee636[_0x3aaed4(0x1f2)][_0x3aaed4(0x228)](_0x31df44[_0x3aaed4(0x265)],_0x31df44[_0x3aaed4(0x234)],_0x31df44[_0x3aaed4(0x277)]),{'verbose':_0xa6945c[_0x3aaed4(0x283)]});return _0x45e8ed['data'];}async[a35_0x500582(0x202)](_0x111df1,_0x57ff77){const _0x3b195b=a35_0x500582,{options:_0x543a5e,tdx:_0x5662fe}=_0x57ff77,_0x55faf5=_0x543a5e['parentSegment'],_0x4af65f=await resolveSegmentTarget(_0x111df1,_0x55faf5,_0x543a5e[_0x3b195b(0x283)]);_0x543a5e[_0x3b195b(0x283)]&&console['error']('Target\x20path:\x20'+_0x4af65f);const _0x465ba8=await withSpinner('Resolving\x20\x27'+_0x111df1+_0x3b195b(0x1e8),()=>_0x5662fe[_0x3b195b(0x1f2)][_0x3b195b(0x221)](_0x4af65f),{'verbose':_0x543a5e['verbose']}),_0x51db23=_0x465ba8[_0x3b195b(0x238)];_0x543a5e[_0x3b195b(0x283)]&&(console['error'](_0x3b195b(0x20d)+_0x51db23['type']),console['error'](_0x3b195b(0x21b)+_0x51db23[_0x3b195b(0x261)]));if(_0x51db23[_0x3b195b(0x210)]==='folder')throw new SDKError(ErrorCode[_0x3b195b(0x1ea)],_0x3b195b(0x243));if(_0x51db23['type']===_0x3b195b(0x1f4))throw new SDKError(ErrorCode[_0x3b195b(0x1ea)],_0x3b195b(0x204));if(!_0x51db23[_0x3b195b(0x244)])throw new SDKError(ErrorCode[_0x3b195b(0x1f1)],_0x3b195b(0x280));const _0x17989a=await withSpinner(_0x3b195b(0x226),()=>_0x5662fe['segment'][_0x3b195b(0x275)](_0x51db23[_0x3b195b(0x261)],_0x51db23[_0x3b195b(0x244)]),{'verbose':_0x543a5e['verbose']});return _0x17989a[_0x3b195b(0x238)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x255);[a35_0x500582(0x268)]=a35_0x500582(0x20a);async[a35_0x500582(0x23f)](_0x58537d){const _0x326166=a35_0x500582,{options:_0x4c250e,args:_0x23af79,tdx:_0x884f1c}=_0x58537d,_0x2b912d=_0x4c250e;if(_0x23af79['length']<0x2)return console[_0x326166(0x20f)](_0x326166(0x269)),console[_0x326166(0x20f)](_0x326166(0x254)),0x1;const _0x1881e2=_0x23af79[0x0],_0x4d2f1d=_0x23af79[0x1];_0x2b912d['verbose']&&(console[_0x326166(0x20f)](_0x326166(0x205)+_0x2b912d[_0x326166(0x21c)]),console[_0x326166(0x20f)](_0x326166(0x27d)+_0x1881e2),console['error'](_0x326166(0x1ef)+_0x4d2f1d));let _0x50c830;if(_0x2b912d['parentFolder']){const _0x493cc8=_0x2b912d['parentFolder'],_0xa79752=await withSpinner(_0x326166(0x27f)+_0x1881e2+'\x27...',()=>_0x884f1c['segment'][_0x326166(0x229)](_0x1881e2),{'verbose':_0x2b912d[_0x326166(0x283)]}),_0x2cbb34=_0xa79752['data'],_0x3265be=await withSpinner(_0x326166(0x240)+_0x493cc8+_0x326166(0x1e8),()=>_0x884f1c[_0x326166(0x1f2)][_0x326166(0x1fd)](_0x2cbb34,_0x493cc8),{'verbose':_0x2b912d[_0x326166(0x283)]});_0x50c830=_0x3265be[_0x326166(0x238)],_0x2b912d['verbose']&&console[_0x326166(0x20f)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x50c830);}const _0x3f3250={'name':_0x4d2f1d,'description':_0x2b912d[_0x326166(0x268)],'parentFolderId':_0x50c830},_0x5d24b3=await withSpinner(_0x326166(0x262)+_0x4d2f1d+_0x326166(0x1e8),()=>_0x884f1c[_0x326166(0x1f2)][_0x326166(0x21a)](_0x1881e2,_0x3f3250),{'verbose':_0x2b912d['verbose']}),_0x4ed740=_0x5d24b3[_0x326166(0x238)];return console[_0x326166(0x20f)]('✔\x20Created\x20folder\x20\x27'+_0x4ed740[_0x326166(0x250)]+_0x326166(0x247)+_0x4ed740['id']),await handleSDKOutput([_0x4ed740],_0x2b912d),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a35_0x500582(0x258);['description']=a35_0x500582(0x266);async[a35_0x500582(0x23f)](_0x1140ce){const _0x199449=a35_0x500582,{options:_0x5c01b2,args:_0x1640cd,tdx:_0xd87fa8}=_0x1140ce,_0x10b694=_0x1640cd[0x0];if(!_0x10b694)return console['error'](_0x199449(0x27c)),console['error'](_0x199449(0x201)),console[_0x199449(0x20f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x199449(0x20f)](_0x199449(0x260)),console[_0x199449(0x20f)](_0x199449(0x1f5)),console[_0x199449(0x20f)](_0x199449(0x1f6)),console[_0x199449(0x20f)](_0x199449(0x232)),console[_0x199449(0x20f)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x199449(0x25e)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x12e05e=_0x5c01b2[_0x199449(0x234)],_0x1e9ad0=await resolveSegmentTarget(_0x10b694,_0x12e05e,_0x5c01b2[_0x199449(0x283)]);_0x5c01b2[_0x199449(0x283)]&&console[_0x199449(0x20f)](_0x199449(0x21e)+_0x1e9ad0);const _0x14315a=await withSpinner(_0x199449(0x263)+_0x10b694+_0x199449(0x1e8),()=>_0xd87fa8['segment'][_0x199449(0x221)](_0x1e9ad0),{'verbose':_0x5c01b2[_0x199449(0x283)]}),_0x14f020=_0x14315a[_0x199449(0x238)];_0x5c01b2[_0x199449(0x283)]&&(console[_0x199449(0x20f)](_0x199449(0x20d)+_0x14f020[_0x199449(0x210)]),console[_0x199449(0x20f)](_0x199449(0x21b)+_0x14f020['parentId']),_0x14f020[_0x199449(0x1e4)]&&console[_0x199449(0x20f)]('Folder\x20ID:\x20'+_0x14f020[_0x199449(0x1e4)]),_0x14f020[_0x199449(0x244)]&&console[_0x199449(0x20f)](_0x199449(0x274)+_0x14f020[_0x199449(0x244)]));if(_0x5c01b2[_0x199449(0x27e)]){if(_0x14f020[_0x199449(0x210)]===_0x199449(0x26c))return console[_0x199449(0x20f)](_0x199449(0x264)),0x1;if(_0x14f020[_0x199449(0x210)]===_0x199449(0x1f4))return console[_0x199449(0x20f)](_0x199449(0x251)),console[_0x199449(0x20f)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x14f020[_0x199449(0x244)])throw new SDKError(ErrorCode[_0x199449(0x1f1)],_0x199449(0x280));const _0x4e08e6=getConsoleNextUrl(_0x5c01b2[_0x199449(0x21c)],_0x199449(0x28a)+_0x14f020[_0x199449(0x261)]+_0x199449(0x1ff)+_0x14f020[_0x199449(0x244)]);return console[_0x199449(0x20f)](a35_0x2c9435[_0x199449(0x203)]('✔')+_0x199449(0x272)+a35_0x2c9435[_0x199449(0x216)](_0x4e08e6)),openBrowser(_0x4e08e6),0x0;}if(_0x14f020[_0x199449(0x210)]===_0x199449(0x26c)){if(!_0x14f020['folderId'])throw new SDKError(ErrorCode[_0x199449(0x23a)],_0x199449(0x233));const _0x129a8a=await withSpinner('Fetching\x20folder\x20details...',()=>_0xd87fa8['segment'][_0x199449(0x248)](_0x14f020['folderId']),{'verbose':_0x5c01b2[_0x199449(0x283)]});await handleSingleObjectOutput(_0x129a8a[_0x199449(0x238)],_0x5c01b2);}else{if(_0x14f020[_0x199449(0x210)]==='segment'){if(!_0x14f020[_0x199449(0x244)])throw new SDKError(ErrorCode[_0x199449(0x1f1)],_0x199449(0x280));const _0x2d1f57=await withSpinner(_0x199449(0x281),()=>_0xd87fa8[_0x199449(0x1f2)][_0x199449(0x22f)](_0x14f020[_0x199449(0x261)],_0x14f020[_0x199449(0x244)]),{'verbose':_0x5c01b2['verbose']}),_0x26075b=getConsoleNextUrl(_0x5c01b2[_0x199449(0x21c)],_0x199449(0x28a)+_0x14f020['parentId']+_0x199449(0x1ff)+_0x14f020[_0x199449(0x244)]),_0x49b6e3=_0x2d1f57[_0x199449(0x238)];_0x49b6e3[_0x199449(0x218)]=_0x26075b,await handleSingleObjectOutput(_0x49b6e3,_0x5c01b2);}else return console['error'](_0x199449(0x245)),console[_0x199449(0x20f)](_0x199449(0x22c)),0x1;}return 0x0;}catch(_0x48c9c9){if(_0x48c9c9 instanceof SDKError)return console[_0x199449(0x20f)](_0x199449(0x25d)+_0x48c9c9[_0x199449(0x1fb)]),_0x48c9c9[_0x199449(0x242)]&&console[_0x199449(0x20f)](_0x199449(0x288)+_0x48c9c9[_0x199449(0x242)]),0x1;throw _0x48c9c9;}}}export const SegmentInfoCommand=SegmentViewCommand;function a35_0x5279(_0x16f262,_0x41fb09){_0x16f262=_0x16f262-0x1e4;const _0x314702=a35_0x3147();let _0x5279f8=_0x314702[_0x16f262];return _0x5279f8;}export class SegmentDescCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x22d);[a35_0x500582(0x268)]=a35_0x500582(0x27b);async[a35_0x500582(0x23f)](_0x3ba57a){const _0x11b17b=a35_0x500582,{options:_0x18cb03,args:_0x9c6330,tdx:_0x2c84a2}=_0x3ba57a,_0x24aee7=_0x9c6330[0x0];if(!_0x24aee7)return console[_0x11b17b(0x20f)](_0x11b17b(0x1ee)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x11b17b(0x20f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x11b17b(0x20f)](_0x11b17b(0x1f6)),console[_0x11b17b(0x20f)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x11b17b(0x20f)](_0x11b17b(0x249)),0x1;try{const _0x2fa767=_0x18cb03[_0x11b17b(0x234)],_0x3166e2=await resolveSegmentTarget(_0x24aee7,_0x2fa767,_0x18cb03[_0x11b17b(0x283)]);_0x18cb03[_0x11b17b(0x283)]&&console['error'](_0x11b17b(0x21e)+_0x3166e2);const _0x46d574=await withSpinner(_0x11b17b(0x263)+_0x24aee7+_0x11b17b(0x1e8),()=>_0x2c84a2[_0x11b17b(0x1f2)]['resolvePathToResource'](_0x3166e2),{'verbose':_0x18cb03[_0x11b17b(0x283)]}),_0x2882c1=_0x46d574[_0x11b17b(0x238)];_0x18cb03[_0x11b17b(0x283)]&&(console['error']('Resolved\x20type:\x20'+_0x2882c1[_0x11b17b(0x210)]),console[_0x11b17b(0x20f)]('Parent\x20ID:\x20'+_0x2882c1[_0x11b17b(0x261)]));if(_0x2882c1['type']===_0x11b17b(0x26c))return console[_0x11b17b(0x20f)](_0x11b17b(0x1ec)),console[_0x11b17b(0x20f)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x2882c1[_0x11b17b(0x210)]===_0x11b17b(0x1f4))return console[_0x11b17b(0x20f)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x11b17b(0x20f)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x2882c1[_0x11b17b(0x244)])throw new SDKError(ErrorCode[_0x11b17b(0x1f1)],_0x11b17b(0x280));const _0x1217ac=await withSpinner(_0x11b17b(0x226),()=>_0x2c84a2[_0x11b17b(0x1f2)][_0x11b17b(0x275)](_0x2882c1['parentId'],_0x2882c1[_0x11b17b(0x244)]),{'verbose':_0x18cb03[_0x11b17b(0x283)]}),_0x26de0b=_0x1217ac['data'],_0x371366=await executeSchemaQuery(_0x26de0b,_0x2c84a2,_0x18cb03);return await handleQueryOutput(_0x371366,_0x18cb03),0x0;}catch(_0x52206d){if(_0x52206d instanceof SDKError)return console[_0x11b17b(0x20f)](_0x11b17b(0x25d)+_0x52206d[_0x11b17b(0x1fb)]),_0x52206d[_0x11b17b(0x242)]&&console[_0x11b17b(0x20f)]('\x20\x20Cause:\x20'+_0x52206d[_0x11b17b(0x242)]),0x1;throw _0x52206d;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x456f9c=a36_0x4ae9;(function(_0x18afbc,_0x1fa796){const _0x49e667=a36_0x4ae9,_0x18d781=_0x18afbc();while(!![]){try{const _0x565868=parseInt(_0x49e667(0x121))/0x1+parseInt(_0x49e667(0x111))/0x2+parseInt(_0x49e667(0x118))/0x3+parseInt(_0x49e667(0x109))/0x4*(-parseInt(_0x49e667(0x122))/0x5)+-parseInt(_0x49e667(0x115))/0x6+-parseInt(_0x49e667(0x11b))/0x7*(-parseInt(_0x49e667(0x124))/0x8)+-parseInt(_0x49e667(0xf3))/0x9;if(_0x565868===_0x1fa796)break;else _0x18d781['push'](_0x18d781['shift']());}catch(_0x570cc0){_0x18d781['push'](_0x18d781['shift']());}}}(a36_0x3e13,0x384fd));function a36_0x3e13(){const _0x3a8b45=['resolvePathToResource','Segment\x20name:\x20','noCountPopulation','1759902zvrKAj','invisible','Target\x20path:\x20','987213iNAnKE','Site:\x20','createSegment','3374IqjReO','Resolved\x20relative\x20path\x20to:\x20','site','segments','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','116588NfSWYy','5JmbYOw','data','3568xNCweZ','segment','Examples:','folderId','Create\x20child\x20segment\x20with\x20filtering\x20rules','✔\x20Created\x20segment\x20\x27','771516SBcivE','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','name','\x27...','description','yellow','Resolving\x20folder\x20path\x20\x27','length','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolving\x20folder\x20\x27','parent','Creating\x20segment\x20\x27','\x27\x20with\x20ID:\x20','kind','verbose','type','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','error','folder','1280412MwcAcT','segment:create','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent\x20path:\x20','segmentPath','Resolved\x20folder\x20ID:\x20','execute','538332icNWYI'];a36_0x3e13=function(){return _0x3a8b45;};return a36_0x3e13();}import{BaseCommand}from'./command.js';function a36_0x4ae9(_0x5233fd,_0x22b172){_0x5233fd=_0x5233fd-0xee;const _0x3e13fc=a36_0x3e13();let _0x4ae9b0=_0x3e13fc[_0x5233fd];return _0x4ae9b0;}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 a36_0xa3fe56 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x456f9c(0xf7)]=a36_0x456f9c(0x10a);['description']=a36_0x456f9c(0xf1);async[a36_0x456f9c(0x110)](_0x508b0a){const _0x2ccdf5=a36_0x456f9c;console['error'](a36_0xa3fe56[_0x2ccdf5(0xfa)](_0x2ccdf5(0x120))),console[_0x2ccdf5(0x107)](a36_0xa3fe56[_0x2ccdf5(0xfa)](_0x2ccdf5(0x10c)));const {options:_0x2a4c06,args:_0x475952,tdx:_0xeea564}=_0x508b0a,_0x346140=_0x2a4c06;if(_0x475952['length']===0x0)return console[_0x2ccdf5(0x107)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x2ccdf5(0xfd)),console['error'](_0x2ccdf5(0xef)),console[_0x2ccdf5(0x107)](_0x2ccdf5(0xf5)),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x11f)),console[_0x2ccdf5(0x107)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1e8242=_0x475952[0x0],_0x427365=_0x2a4c06[_0x2ccdf5(0x10e)];let _0x49dbf8=_0x1e8242;_0x427365&&!_0x1e8242['includes']('/')&&(_0x49dbf8=_0x427365+'/'+_0x1e8242,_0x346140['verbose']&&console[_0x2ccdf5(0x107)](_0x2ccdf5(0x11c)+_0x49dbf8));const _0x50b311=parsePath(_0x49dbf8);if(_0x50b311[_0x2ccdf5(0x11e)]['length']<0x2)return console[_0x2ccdf5(0x107)](_0x2ccdf5(0x10b)),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x106)),0x1;const _0x44abd2=_0x50b311[_0x2ccdf5(0x11e)][0x0],_0x38a2e0=getBaseName(_0x49dbf8),_0x595612=getParentPath(_0x49dbf8);_0x346140['verbose']&&(console[_0x2ccdf5(0x107)](_0x2ccdf5(0x119)+_0x346140[_0x2ccdf5(0x11d)]),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x117)+_0x49dbf8),console[_0x2ccdf5(0x107)]('Parent:\x20'+_0x44abd2),console['error'](_0x2ccdf5(0x113)+_0x38a2e0),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x10d)+_0x595612));const _0x28c31d=await withSpinner(_0x2ccdf5(0xf6)+_0x44abd2+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)]['resolveParentId'](_0x44abd2),{'verbose':_0x346140['verbose']}),_0x3680fe=_0x28c31d[_0x2ccdf5(0x123)];let _0x235f3b;if(_0x50b311[_0x2ccdf5(0x11e)][_0x2ccdf5(0xfc)]>0x2){const _0x3cead1=await withSpinner(_0x2ccdf5(0xfb)+_0x595612+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)][_0x2ccdf5(0x112)](_0x595612),{'verbose':_0x346140[_0x2ccdf5(0x103)]}),_0x5c254d=_0x3cead1[_0x2ccdf5(0x123)];if(_0x5c254d[_0x2ccdf5(0x104)]!==_0x2ccdf5(0x108)&&_0x5c254d['type']!==_0x2ccdf5(0xff))return console[_0x2ccdf5(0x107)](_0x2ccdf5(0x105)),0x1;_0x235f3b=_0x5c254d[_0x2ccdf5(0xf0)];}else{if(_0x346140['folder']){const _0x49d264=await withSpinner(_0x2ccdf5(0xfe)+_0x346140['folder']+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)]['resolveFolderId'](_0x3680fe,_0x346140['folder']),{'verbose':_0x346140['verbose']});_0x235f3b=_0x49d264[_0x2ccdf5(0x123)];}}_0x346140[_0x2ccdf5(0x103)]&&_0x235f3b&&console[_0x2ccdf5(0x107)](_0x2ccdf5(0x10f)+_0x235f3b);const _0x26765f=await loadJSONFromOptions(_0x346140['rule'],_0x346140['ruleFile']),_0x5b0b37={'name':_0x38a2e0,'description':_0x346140[_0x2ccdf5(0xf9)],'rule':_0x26765f,'kind':_0x346140[_0x2ccdf5(0x102)]!==undefined?parseInt(_0x346140[_0x2ccdf5(0x102)],0xa):undefined,'isVisible':_0x346140[_0x2ccdf5(0x116)]?![]:undefined,'segmentFolderId':_0x235f3b,'countPopulation':_0x346140[_0x2ccdf5(0x114)]?![]:undefined},_0x5d83ce=await withSpinner(_0x2ccdf5(0x100)+_0x38a2e0+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)][_0x2ccdf5(0x11a)](_0x3680fe,_0x5b0b37),{'verbose':_0x346140['verbose']}),_0x41995d=_0x5d83ce[_0x2ccdf5(0x123)];return console['error'](_0x2ccdf5(0xf2)+_0x41995d['name']+_0x2ccdf5(0x101)+_0x41995d['id']),_0x49dbf8!==_0x1e8242&&console[_0x2ccdf5(0x107)](_0x2ccdf5(0xf4)+_0x49dbf8),await handleSDKOutput([_0x41995d],_0x346140),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a37_0x49a4(_0x416b0c,_0x467c1e){_0x416b0c=_0x416b0c-0xed;const _0x5849f9=a37_0x5849();let _0x49a478=_0x5849f9[_0x416b0c];return _0x49a478;}const a37_0x5c016e=a37_0x49a4;(function(_0xdeb3b7,_0xd8bfc5){const _0x15c3a1=a37_0x49a4,_0x59a6d7=_0xdeb3b7();while(!![]){try{const _0x209ac3=-parseInt(_0x15c3a1(0xf8))/0x1+-parseInt(_0x15c3a1(0xf4))/0x2*(-parseInt(_0x15c3a1(0xfa))/0x3)+parseInt(_0x15c3a1(0x105))/0x4+-parseInt(_0x15c3a1(0xf1))/0x5*(-parseInt(_0x15c3a1(0x101))/0x6)+-parseInt(_0x15c3a1(0xf9))/0x7*(-parseInt(_0x15c3a1(0xfd))/0x8)+parseInt(_0x15c3a1(0x106))/0x9*(parseInt(_0x15c3a1(0xfe))/0xa)+-parseInt(_0x15c3a1(0xfb))/0xb;if(_0x209ac3===_0xd8bfc5)break;else _0x59a6d7['push'](_0x59a6d7['shift']());}catch(_0x44cc59){_0x59a6d7['push'](_0x59a6d7['shift']());}}}(a37_0x5849,0x2f6f3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a37_0x5849(){const _0x1e802f=['851917vEGqBR','name','7528lmyGHJ','257320ugIfhQ','data','segment:fields','366HOUfxr','\x20field','error','segment','168592aUYilm','27JwTHoP','execute','length','description','json','\x27...','13495gyktXu','jsonl','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','4bLvFSa','Listing\x20fields\x20for\x20\x27','✔\x20Found\x20','parentSegment','184474NYYrDw','1281zJKRoc','39IxUCTb'];a37_0x5849=function(){return _0x1e802f;};return a37_0x5849();}export class SegmentFieldsCommand extends BaseCommand{[a37_0x5c016e(0xfc)]=a37_0x5c016e(0x100);[a37_0x5c016e(0xee)]='List\x20available\x20fields\x20for\x20segmentation';async[a37_0x5c016e(0x107)](_0x2e8e81){const _0x54c66d=a37_0x5c016e,{options:_0x43b580,args:_0x3cc4d1,tdx:_0xbd0ac9}=_0x2e8e81,_0x102a3a=_0x3cc4d1[0x0]||_0x43b580[_0x54c66d(0xf7)];if(!_0x102a3a)return console[_0x54c66d(0x103)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x54c66d(0x103)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console['error'](_0x54c66d(0xf3)),0x1;_0x43b580['verbose']&&(console[_0x54c66d(0x103)]('Site:\x20'+_0x43b580['site']),console[_0x54c66d(0x103)]('Parent\x20segment:\x20'+_0x102a3a));const _0x4630c7=await withSpinner(_0x54c66d(0xf5)+_0x102a3a+_0x54c66d(0xf0),()=>_0xbd0ac9[_0x54c66d(0x104)]['listFields'](_0x102a3a),{'verbose':_0x43b580['verbose']}),_0x4cfd31=_0x4630c7[_0x54c66d(0xff)];console['error'](_0x54c66d(0xf6)+_0x4cfd31[_0x54c66d(0xed)]+_0x54c66d(0x102)+(_0x4cfd31[_0x54c66d(0xed)]!==0x1?'s':''));if(_0x43b580[_0x54c66d(0xef)]||_0x43b580[_0x54c66d(0xf2)])return await handleSDKOutput(_0x4cfd31,_0x43b580),0x0;return displayFieldsHumanReadable(_0x4cfd31,_0x102a3a),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x140efe=a38_0x4df9;(function(_0x363669,_0x262d1c){const _0x55a187=a38_0x4df9,_0x387fb7=_0x363669();while(!![]){try{const _0x9c8c0f=-parseInt(_0x55a187(0x145))/0x1+parseInt(_0x55a187(0x150))/0x2+-parseInt(_0x55a187(0x11a))/0x3*(parseInt(_0x55a187(0x158))/0x4)+parseInt(_0x55a187(0x12f))/0x5*(-parseInt(_0x55a187(0x137))/0x6)+-parseInt(_0x55a187(0x144))/0x7*(parseInt(_0x55a187(0x14d))/0x8)+-parseInt(_0x55a187(0x122))/0x9*(parseInt(_0x55a187(0x111))/0xa)+parseInt(_0x55a187(0x12c))/0xb;if(_0x9c8c0f===_0x262d1c)break;else _0x387fb7['push'](_0x387fb7['shift']());}catch(_0x1426e7){_0x387fb7['push'](_0x387fb7['shift']());}}}(a38_0x1484,0x86888));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a38_0x5d623c from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a38_0x1484(){const _0x5358c0=['journeys','\x20new\x20files','green','absolutePath','repeat','relativePath','\x20activations','Target\x20resource:\x20','targetDir','3399648HwvDoK','87462QdRmIt','\x0aError:','setPhase','\x20\x20🎯\x20','hasChanges','\x0aChanges\x20to\x20\x27','\x0aPull\x20summary\x20for\x20\x27','name','8vyFDwK','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)','parentName','138362fiopSW','activations','Error:\x20','utf-8','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullSegments','segments','Site:\x20','25876VqhnxC','message','parent_segment','execute','\x20segments','Parent\x20segment:\x20','isNew','Aborted.','dryRun','error','5051980BuPWuq','\x20changed\x20files','length','site','\x20=\x20','\x20journeys','yes','filter','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','393ABbLej','red','diff','\x20files?','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','yellow','\x20with\x20','18ovBuJu','dirname','type','counts','\x20unchanged\x20files','Pulling\x20segments\x20from\x20\x27','resourceName','errorCode','verbose','cwd','33854370bpvbbN','\x20\x20Target:\x20','cyan','412105TgBNst','session','✔\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','✔\x20Pulled\x20','files','segment','file','12CBoqWi','helpText','journeyVersions','data'];a38_0x1484=function(){return _0x5358c0;};return a38_0x1484();}import a38_0x53d5ce from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a38_0x4df9(_0x5c38b5,_0x3dc6a9){_0x5c38b5=_0x5c38b5-0x10f;const _0x14843c=a38_0x1484();let _0x4df9da=_0x14843c[_0x5c38b5];return _0x4df9da;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0x140efe(0x14c)]='segment:pull';['description']=a38_0x140efe(0x119);async[a38_0x140efe(0x15b)](_0x2d9c0e){const _0xc04fcc=a38_0x140efe,{options:_0x6ad6e,args:_0x178c6f,tdx:_0x39ed0c}=_0x2d9c0e,_0x54680d=_0x6ad6e,_0x338504=await resolveTarget({'arg':_0x178c6f[0x0],'contextParent':_0x6ad6e['parentSegment'],'cwd':process[_0xc04fcc(0x12b)]()});if(!isSuccessfulResolution(_0x338504))return _0x338504[_0xc04fcc(0x129)]==='no_parent'?(console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x120)](_0xc04fcc(0x11f))),console[_0xc04fcc(0x110)](_0xc04fcc(0x14e)),console[_0xc04fcc(0x110)](_0xc04fcc(0x132)),console[_0xc04fcc(0x110)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x11b)](_0xc04fcc(0x152)+_0x338504[_0xc04fcc(0x159)]+'\x0a')),_0x338504[_0xc04fcc(0x138)]&&console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x12e)](_0x338504[_0xc04fcc(0x138)]))),0x1;const _0x2858c1=_0x338504[_0xc04fcc(0x14f)],_0xbc1820=_0x338504[_0xc04fcc(0x143)],_0xa0de24=_0x338504[_0xc04fcc(0x124)]===_0xc04fcc(0x136)?_0x338504[_0xc04fcc(0x128)]:undefined;_0x54680d[_0xc04fcc(0x12a)]&&(console['error'](_0xc04fcc(0x157)+_0x54680d[_0xc04fcc(0x114)]),console[_0xc04fcc(0x110)](_0xc04fcc(0x15d)+_0x2858c1),_0xa0de24&&console[_0xc04fcc(0x110)](_0xc04fcc(0x142)+_0xa0de24));const _0x4d37e1=await withProgressSpinner(_0xc04fcc(0x127)+_0x2858c1+'\x27...',_0x54b26a=>_0x39ed0c[_0xc04fcc(0x135)][_0xc04fcc(0x155)](_0x2858c1,{'targetDir':_0xbc1820,'targetResourceName':_0xa0de24,'verbose':_0x54680d[_0xc04fcc(0x12a)],'progress':{'update':_0x5d9e67=>{const _0x13a85b=_0xc04fcc;_0x54b26a[_0x13a85b(0x147)](_0x5d9e67),_0x54680d[_0x13a85b(0x12a)]&&console[_0x13a85b(0x110)]('\x20\x20'+_0x5d9e67);}}}),{'verbose':_0x54680d['verbose']}),_0x3923de=_0x4d37e1[_0xc04fcc(0x13a)];if(_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x156)]===0x0&&_0x3923de[_0xc04fcc(0x125)]['journeys']===0x0)return console['error'](a38_0x5d623c['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3923de[_0xc04fcc(0x14f)]+'\x27')),0x0;const _0x48e9f1=_0x3923de[_0xc04fcc(0x134)][_0xc04fcc(0x118)](_0x2913e4=>_0x2913e4['isNew']),_0x52d1f7=_0x3923de[_0xc04fcc(0x134)]['filter'](_0x4fd4f1=>!_0x4fd4f1[_0xc04fcc(0x15e)]&&_0x4fd4f1[_0xc04fcc(0x149)]),_0x18d9ed=_0x3923de['files'][_0xc04fcc(0x118)](_0x7023aa=>!_0x7023aa[_0xc04fcc(0x15e)]&&!_0x7023aa[_0xc04fcc(0x149)]);console[_0xc04fcc(0x110)](_0xc04fcc(0x14b)+_0x3923de['parentName']+'\x27:'),console[_0xc04fcc(0x110)](_0xc04fcc(0x148)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de['counts'][_0xc04fcc(0x156)]+_0xc04fcc(0x15c))+_0xc04fcc(0x121)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x151)]+_0xc04fcc(0x141)));if(_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x13b)]>0x0){const _0x37a9d2=_0x3923de['counts'][_0xc04fcc(0x139)]>_0x3923de['counts'][_0xc04fcc(0x13b)]?'\x20('+_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x139)]+'\x20versions)':'';console[_0xc04fcc(0x110)]('\x20\x20🗺️\x20\x20'+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x13b)]+_0xc04fcc(0x116))+a38_0x5d623c['dim'](_0x37a9d2));}console['error']('\x20\x20'+a38_0x5d623c['green']('+\x20'+_0x48e9f1['length']+_0xc04fcc(0x13c))),console[_0xc04fcc(0x110)]('\x20\x20'+a38_0x5d623c['yellow']('~\x20'+_0x52d1f7[_0xc04fcc(0x113)]+_0xc04fcc(0x112))),console[_0xc04fcc(0x110)]('\x20\x20'+a38_0x5d623c[_0xc04fcc(0x11e)]('=\x20'+_0x18d9ed[_0xc04fcc(0x113)]+_0xc04fcc(0x126))),console[_0xc04fcc(0x110)](_0xc04fcc(0x12d)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de['targetDir'])+'\x0a');if(_0x52d1f7[_0xc04fcc(0x113)]>0x0)for(const _0x4d0727 of _0x52d1f7){console[_0xc04fcc(0x110)](_0xc04fcc(0x14a)+_0x4d0727[_0xc04fcc(0x140)]+'\x27:'),console[_0xc04fcc(0x110)]('─'[_0xc04fcc(0x13f)](0x3c)),console[_0xc04fcc(0x110)](_0x4d0727[_0xc04fcc(0x11c)]),console[_0xc04fcc(0x110)]('─'[_0xc04fcc(0x13f)](0x3c));}if(_0x54680d[_0xc04fcc(0x10f)])return console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x120)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x48e9f1[_0xc04fcc(0x113)]===0x0&&_0x52d1f7['length']===0x0)return console[_0xc04fcc(0x110)](a38_0x5d623c['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x3923de[_0xc04fcc(0x14f)]},_0x54680d[_0xc04fcc(0x130)]),console[_0xc04fcc(0x110)](a38_0x5d623c['green'](_0xc04fcc(0x131)+a38_0x5d623c[_0xc04fcc(0x11e)]('parent_segment')+_0xc04fcc(0x115)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x14f)]))),0x0;if(!_0x54680d[_0xc04fcc(0x117)]){if(!isInteractive())return console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x11b)](_0xc04fcc(0x146)),_0xc04fcc(0x154)),console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x11e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4e1218=await confirmKey('Write\x20'+(_0x48e9f1[_0xc04fcc(0x113)]+_0x52d1f7[_0xc04fcc(0x113)])+_0xc04fcc(0x11d));if(!_0x4e1218)return console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x120)](_0xc04fcc(0x15f)),'-\x20no\x20files\x20written'),0x1;}for(const _0x48afc0 of _0x3923de[_0xc04fcc(0x134)]){if(_0x48afc0[_0xc04fcc(0x15e)]||_0x48afc0['hasChanges']){const _0x353e5f=a38_0x53d5ce[_0xc04fcc(0x123)](_0x48afc0[_0xc04fcc(0x13e)]);!existsSync(_0x353e5f)&&mkdirSync(_0x353e5f,{'recursive':!![]}),writeFileSync(_0x48afc0['absolutePath'],_0x48afc0['content'],_0xc04fcc(0x153));}}return console[_0xc04fcc(0x110)](a38_0x5d623c['green'](_0xc04fcc(0x133)+(_0x48e9f1[_0xc04fcc(0x113)]+_0x52d1f7[_0xc04fcc(0x113)])+'\x20files\x20to\x20'+_0x3923de['targetDir'])),saveSessionContext({'parent_segment':_0x3923de[_0xc04fcc(0x14f)]},_0x54680d[_0xc04fcc(0x130)]),console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x13d)](_0xc04fcc(0x131)+a38_0x5d623c['dim'](_0xc04fcc(0x15a))+'\x20=\x20'+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x14f)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x9e44e=a39_0x35fb;(function(_0x8b56cd,_0x17272e){const _0x19f2e6=a39_0x35fb,_0x935b15=_0x8b56cd();while(!![]){try{const _0x314f9a=parseInt(_0x19f2e6(0xdb))/0x1*(parseInt(_0x19f2e6(0x156))/0x2)+-parseInt(_0x19f2e6(0x145))/0x3+-parseInt(_0x19f2e6(0x110))/0x4*(-parseInt(_0x19f2e6(0xd9))/0x5)+parseInt(_0x19f2e6(0x14e))/0x6+parseInt(_0x19f2e6(0x15b))/0x7*(-parseInt(_0x19f2e6(0x149))/0x8)+-parseInt(_0x19f2e6(0x163))/0x9*(-parseInt(_0x19f2e6(0xe2))/0xa)+parseInt(_0x19f2e6(0xce))/0xb*(-parseInt(_0x19f2e6(0xdc))/0xc);if(_0x314f9a===_0x17272e)break;else _0x935b15['push'](_0x935b15['shift']());}catch(_0x454668){_0x935b15['push'](_0x935b15['shift']());}}}(a39_0x3f42,0xb62a7));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x9de32f from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a39_0x35fb(_0x77ba36,_0x2d3784){_0x77ba36=_0x77ba36-0xcc;const _0x3f42d2=a39_0x3f42();let _0x35fb5c=_0x3f42d2[_0x77ba36];return _0x35fb5c;}function a39_0x3f42(){const _0x2f8bf7=['Folders\x20to\x20create:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','(Journey\x20will\x20be\x20deleted)','audienceId','existingJourney','description','\x20updated','site','\x20\x20Activations:','cwd','get','set','length','deleted','toCreate','createdSegmentIds','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x27...','listJourneysWithDetailsFromParentSegment','/e/','.yaml','type','No\x20','setPhase','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aPush\x20summary\x20for\x20\x27','/j/da/je','Error:\x20Directory\x20not\x20found:\x20','execute','folders','cyan','yellow','listSegments','3325722gdqGkZ','\x20activations]','push','folderPath','80vNrKoi','targetDir','relationships','diff','journeyId','4491918kWGSij','blue','New\x20journey:','📁\x20','Delete\x20segment:','toString','yes','\x20new','8UUuzXU','no_parent','filter','\x20\x20Segments:\x20','journeysOnly','59507cdZPNp','activations','join','delete','parentName','yamlConfig','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Push\x20','28989Utakvz','\x20\x20🗺️\x20\x20Journeys:','getParent','Fetching\x20existing\x20activations...','attributes','parent_name','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','updated','6490319PgqfWy','journeys','green','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20','\x20\x20Journeys:\x20','Aborted.','repeat','nameToType','\x20created','helpText','25985BXDHXP','getOutputSchemaWithCache','315641eQHTOn','48egAXrN','\x20YAML\x20files\x20found','\x20deleted','created','\x0aError:','getJourney','3830oMbpiT','unchanged','toDelete','then','listActivations','all','list','isScoped','\x20to\x20create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toUpdate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','resolveParentId','verbose','red','Error:\x20','buildUserMaps','results','message','\x20\x20Source:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','idToName','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','state','.yml','segments','paused','dim','data','New\x20segment:','segment','\x20changes?','\x20to\x20delete','Delete\x20journey:','Source\x20directory:\x20','segmentFolderId','isNew','new','Changes\x20to:','endsWith','map','folderId','Resolving\x20parent\x20segment\x20\x27','changed','journeyBundleName','Changes\x20to\x20journey:','812ynYvrZ','errorCode','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','existingSegment','connection','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','name','parentSegment','user','journey','\x20folders\x20to\x20create','error','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x0a✔\x20Push\x20complete','nameToId','\x0aValidation\x20failed:','/sb/da/esr','/app/ps/','Fetching\x20connections\x20for\x20name\x20resolution...'];a39_0x3f42=function(){return _0x2f8bf7;};return a39_0x3f42();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a39_0x9e44e(0x129)]=a39_0x9e44e(0x11d);async[a39_0x9e44e(0x140)](_0x440a44){const _0x5b9c5a=a39_0x9e44e,{options:_0x33aa03,args:_0x5198d3,tdx:_0x533d33}=_0x440a44,_0x25ee62=_0x33aa03,_0x382e85=await resolveTarget({'arg':_0x5198d3[0x0],'contextParent':_0x33aa03[_0x5b9c5a(0x118)],'cwd':process[_0x5b9c5a(0x12d)]()});if(!isSuccessfulResolution(_0x382e85))return _0x382e85[_0x5b9c5a(0x111)]===_0x5b9c5a(0x157)?(console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x143)](_0x5b9c5a(0x134))),console['error'](_0x5b9c5a(0xf6)),console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xeb)),console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xed))):(console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0xf1)+_0x382e85[_0x5b9c5a(0xf4)]+'\x0a')),_0x382e85[_0x5b9c5a(0xd8)]&&console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x142)](_0x382e85[_0x5b9c5a(0xd8)]))),0x1;if(_0x382e85[_0x5b9c5a(0x139)]===_0x5b9c5a(0x168))return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)]('Error:\x20Directory\x20not\x20found:\x20'+_0x382e85[_0x5b9c5a(0x14a)]+'\x0a')),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x142)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x5b56b0=_0x382e85[_0x5b9c5a(0x15f)],_0xab3cf3=_0x382e85[_0x5b9c5a(0x14a)],_0x4e0691=_0x382e85[_0x5b9c5a(0x139)]==='file'?_0x382e85['filePath']:undefined,_0x38247b=getScopedDetails(_0x382e85),_0x4daa84=_0x38247b?.[_0x5b9c5a(0xe9)]??![],_0x3932ab=_0x38247b?.['scopedFolderPath']??'';if(!existsSync(_0xab3cf3))return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x13f)+_0xab3cf3+'\x0a')),console['error'](a39_0x9de32f[_0x5b9c5a(0x142)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x25ee62[_0x5b9c5a(0xef)]&&(console[_0x5b9c5a(0x11c)]('Site:\x20'+_0x25ee62[_0x5b9c5a(0x12b)]),console[_0x5b9c5a(0x11c)]('Parent\x20segment:\x20'+_0x5b56b0),console['error'](_0x5b9c5a(0x104)+_0xab3cf3),_0x4daa84&&console['error']('Scoped\x20to\x20folder:\x20'+_0x3932ab));const _0x533265=await withSpinner(_0x5b9c5a(0x10c)+_0x5b56b0+_0x5b9c5a(0x135),()=>_0x533d33[_0x5b9c5a(0x100)][_0x5b9c5a(0xee)](_0x5b56b0),{'verbose':_0x25ee62[_0x5b9c5a(0xef)]}),_0x11510e=_0x533265[_0x5b9c5a(0xfe)],{parentSegmentResult:_0x475837,segmentsResult:_0x3730c1,foldersResult:_0x4366e6,journeysWithDetailsResult:_0x14b36c,userMaps:_0x5bde7f}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x5c8511=_0x5b9c5a,[_0x290d31,_0x10cae3,_0x33f783,_0x36dca1,_0x420e3a]=await Promise[_0x5c8511(0xe7)]([_0x533d33[_0x5c8511(0x100)][_0x5c8511(0x165)](_0x11510e),_0x533d33['segment'][_0x5c8511(0x144)](_0x11510e),_0x533d33[_0x5c8511(0x100)]['listFolders'](_0x11510e),_0x533d33['journey'][_0x5c8511(0x136)](_0x11510e,{'includeAllVersions':!![]}),_0x533d33['user'][_0x5c8511(0xf2)]()]);return{'parentSegmentResult':_0x290d31,'segmentsResult':_0x10cae3,'foldersResult':_0x33f783,'journeysWithDetailsResult':_0x36dca1,'userMaps':_0x420e3a};},{'verbose':_0x25ee62[_0x5b9c5a(0xef)]})[_0x5b9c5a(0xe5)](_0x3057c2=>_0x3057c2[_0x5b9c5a(0xfe)]),_0x1eaf01=_0x475837,_0x17d963=extractRootFolderId(_0x1eaf01),_0x15a5ad=_0x3730c1,_0x2851aa=_0x4366e6,{journeys:_0x2163a7,activationStepsById:_0x4a3e5b}=_0x14b36c,_0x315e93=new Map(_0x2163a7[_0x5b9c5a(0x10a)](_0x4edcd2=>[_0x4edcd2['id'],_0x4edcd2])),_0x2ebd01=_0x2163a7[_0x5b9c5a(0x10a)](_0x3c9919=>({'id':_0x3c9919['id'],'name':_0x3c9919[_0x5b9c5a(0x167)][_0x5b9c5a(0x117)],'journeyBundleName':_0x3c9919['attributes']['journeyBundleName']||'','journeyBundleId':_0x3c9919['attributes']['journeyBundleId']||'','versionNumber':_0x3c9919[_0x5b9c5a(0x167)]['versionNumber'],'description':_0x3c9919['attributes']['description'],'state':_0x3c9919['attributes'][_0x5b9c5a(0xf9)],'paused':_0x3c9919[_0x5b9c5a(0x167)][_0x5b9c5a(0xfc)],'audienceId':_0x3c9919[_0x5b9c5a(0x167)][_0x5b9c5a(0x127)],'folderId':_0x3c9919[_0x5b9c5a(0x14b)]?.['parentFolder']?.[_0x5b9c5a(0xfe)]?.['id'],'createdAt':_0x3c9919[_0x5b9c5a(0x167)]['createdAt'],'updatedAt':_0x3c9919[_0x5b9c5a(0x167)]['updatedAt']})),{emailToId:_0x1bb06f,idToEmail:_0x2310eb}=_0x5bde7f,_0x47f0d5=await withSpinner(_0x5b9c5a(0x123),async()=>{const _0x48a4f2=_0x5b9c5a,_0x4601ce=await _0x533d33[_0x48a4f2(0x115)][_0x48a4f2(0xe8)]();return buildConnectionMaps(_0x4601ce);},{'verbose':_0x25ee62[_0x5b9c5a(0xef)]})['then'](_0x51c676=>_0x51c676[_0x5b9c5a(0xfe)]),_0x2d72ff=_0x47f0d5[_0x5b9c5a(0x11f)],_0x4a7259=_0x47f0d5[_0x5b9c5a(0xf7)],_0x4ac5fe=_0x47f0d5[_0x5b9c5a(0xd6)],_0x1d22e5={'emailToIdMap':_0x1bb06f,'connectionNameToIdMap':_0x2d72ff,'connectionNameToTypeMap':_0x4ac5fe,'getSchema':_0x2db887=>_0x533d33[_0x5b9c5a(0x115)][_0x5b9c5a(0xda)](_0x2db887)};let {pathToId:_0x2432f4,idToPath:_0xe202e5}=buildFolderMaps(_0x2851aa);const _0x21267f=buildSegmentLookupMap(_0x15a5ad,_0xe202e5),_0x1cb9e4=buildSegmentNameToIdMap(_0x15a5ad),_0x22622d=buildJourneyBundleLookupMap(_0x2ebd01,_0xe202e5);let _0x43a3d0;if(_0x4e0691){if(!_0x4e0691[_0x5b9c5a(0x109)](_0x5b9c5a(0xfa))&&!_0x4e0691[_0x5b9c5a(0x109)](_0x5b9c5a(0x138)))return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0xcc)+_0x4e0691+'\x0a')),0x1;_0x43a3d0=[_0x4e0691];}else _0x43a3d0=findYamlFiles(_0xab3cf3);if(_0x43a3d0[_0x5b9c5a(0x130)]===0x0)return console['error'](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x161)+_0xab3cf3+'\x0a')),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x142)](_0x5b9c5a(0x13c))),0x1;let _0x17e17c,_0x594514;try{const _0x288b02=parseAndClassifyYamlFiles(_0x43a3d0,_0xab3cf3,{'skipSegments':_0x25ee62[_0x5b9c5a(0x15a)]});_0x17e17c=_0x288b02[_0x5b9c5a(0xfb)],_0x594514=_0x288b02['journeys'];const _0x501c59=validateParsedFiles(_0x288b02,_0xab3cf3);if(_0x501c59['length']>0x0)return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x120))),console[_0x5b9c5a(0x11c)](formatValidationErrors(_0x501c59)),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x143)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x3fae91){return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)]('Error\x20parsing\x20YAML:\x20'+(_0x3fae91 instanceof Error?_0x3fae91[_0x5b9c5a(0xf4)]:_0x3fae91))),0x1;}if(_0x17e17c['length']===0x0&&_0x594514[_0x5b9c5a(0x130)]===0x0){const _0x3c6b6c=_0x25ee62['journeysOnly']?'journey':'segment\x20or\x20journey';return console[_0x5b9c5a(0x11c)](a39_0x9de32f['yellow'](_0x5b9c5a(0x13a)+_0x3c6b6c+_0x5b9c5a(0xdd))),0x0;}const _0x34be3e=new Map();_0x15a5ad['length']>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)]&&await withSpinner(_0x5b9c5a(0x166),async()=>{await batchAsync(_0x15a5ad,async _0x518dbf=>{const _0x19546f=a39_0x35fb,_0x25bd8f=await _0x533d33[_0x19546f(0x100)][_0x19546f(0xe6)](_0x11510e,_0x518dbf['id']);_0x34be3e[_0x19546f(0x12f)](_0x518dbf['id'],_0x25bd8f);});},{'verbose':_0x25ee62[_0x5b9c5a(0xef)]});const {segmentFiles:_0x1a0088,foldersToCreate:_0x205a82}=await prepareSegmentFiles(_0x17e17c,{'segmentByFolderAndName':_0x21267f,'activationsBySegmentId':_0x34be3e,'folderPathToId':_0x2432f4,'idToEmailMap':_0x2310eb,'connectionIdToNameMap':_0x4a7259},_0x1d22e5,_0x4daa84,_0x3932ab),_0x1af837=_0x4e0691?[]:findSegmentsToDelete(_0x15a5ad,_0x17e17c[_0x5b9c5a(0x10a)](({yamlConfig:_0x1c0c90,folderPath:_0x1a423d})=>({'yamlConfig':_0x1c0c90,'folderPath':resolveTDFolderPath(_0x1a423d,_0x4daa84,_0x3932ab)})),_0xe202e5,_0x3932ab,_0x4daa84),{journeyFiles:_0xf70371,foldersToCreate:_0x2efbd5}=await withProgressSpinner('Preparing\x20journeys...',async _0x59b176=>prepareJourneyFiles(_0x594514,{'fetchJourney':async _0x38328e=>_0x533d33['journey'][_0x5b9c5a(0xe1)](_0x38328e[_0x5b9c5a(0x14d)]),'journeyBundlesByFolderAndName':_0x22622d,'folderPathToId':_0x2432f4,'idToEmailMap':_0x2310eb,'connectionIdToNameMap':_0x4a7259,'existingSegments':_0x15a5ad,'parentId':_0x11510e,'deps':_0x533d33,'progress':{'update':_0x164958=>{const _0x395a45=_0x5b9c5a;_0x59b176[_0x395a45(0x13b)](_0x164958),_0x25ee62[_0x395a45(0xef)]&&console[_0x395a45(0x11c)]('\x20\x20'+_0x164958);}},'journeyById':_0x315e93,'activationStepsById':_0x4a3e5b},_0x4daa84,_0x3932ab),{'verbose':_0x25ee62[_0x5b9c5a(0xef)]})['then'](_0x591579=>_0x591579[_0x5b9c5a(0xfe)]);for(const _0x2647c2 of _0x2efbd5){_0x205a82['add'](_0x2647c2);}const _0x475cc3=_0x4e0691?[]:findJourneysToDelete(_0x2ebd01,_0x594514[_0x5b9c5a(0x10a)](({yamlConfig:_0x56ae0a,folderPath:_0x4b0698})=>({'yamlConfig':_0x56ae0a,'folderPath':resolveTDFolderPath(_0x4b0698,_0x4daa84,_0x3932ab)})),_0xe202e5,_0x3932ab,_0x4daa84),_0x47ad=calculatePushStats(_0x1a0088,_0xf70371,_0x205a82,_0x1af837,_0x475cc3,!!_0x25ee62['delete'],!!_0x25ee62[_0x5b9c5a(0x15a)]),_0x25c8e4=_0x47ad['segments'][_0x5b9c5a(0x107)],_0x5c6977=_0x47ad[_0x5b9c5a(0xfb)][_0x5b9c5a(0x10d)],_0x3a3546=_0x47ad['segments'][_0x5b9c5a(0xe3)],_0x54bb45=_0x47ad[_0x5b9c5a(0xfb)][_0x5b9c5a(0xe4)],_0x21ec91=_0x47ad[_0x5b9c5a(0x141)][_0x5b9c5a(0x132)],_0x1807e2=_0x47ad[_0x5b9c5a(0xcf)][_0x5b9c5a(0x107)],_0x473166=_0x47ad['journeys'][_0x5b9c5a(0x10d)],_0x3ef219=_0x47ad[_0x5b9c5a(0xcf)][_0x5b9c5a(0xe3)],_0x4dc82b=_0x47ad['journeys'][_0x5b9c5a(0xe4)],_0x2ee27f=_0x47ad['activations'][_0x5b9c5a(0xe7)],_0x4ced41=_0x47ad[_0x5b9c5a(0x15c)][_0x5b9c5a(0x132)],_0x433478=_0x47ad[_0x5b9c5a(0x15c)][_0x5b9c5a(0xec)],_0x5b8913=_0x47ad[_0x5b9c5a(0x15c)][_0x5b9c5a(0xe4)];console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x13d)+_0x5b56b0+'\x27:');_0x21ec91[_0x5b9c5a(0x130)]>0x0&&console[_0x5b9c5a(0x11c)]('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x14f)](_0x5b9c5a(0x151)+_0x21ec91[_0x5b9c5a(0x130)]+_0x5b9c5a(0x11b)));if(!_0x25ee62['journeysOnly']){console[_0x5b9c5a(0x11c)]('\x20\x20📊\x20Segments:'),console[_0x5b9c5a(0x11c)]('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xd0)]('+\x20'+_0x25c8e4[_0x5b9c5a(0x130)]+_0x5b9c5a(0x155))),console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0x143)]('~\x20'+_0x5c6977[_0x5b9c5a(0x130)]+'\x20changed'));if(_0x54bb45['length']>0x0)console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd2)+a39_0x9de32f['red']('-\x20'+_0x54bb45[_0x5b9c5a(0x130)]+'\x20to\x20delete'));else _0x1af837[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15e)]&&console['error']('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xfd)](_0x1af837[_0x5b9c5a(0x130)]+_0x5b9c5a(0xd1)));console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f['dim']('=\x20'+_0x3a3546[_0x5b9c5a(0x130)]+'\x20unchanged'));}if(_0xf70371[_0x5b9c5a(0x130)]>0x0||_0x475cc3['length']>0x0){console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x164)),console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0xd0)]('+\x20'+_0x1807e2[_0x5b9c5a(0x130)]+_0x5b9c5a(0x155))),console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0x143)]('~\x20'+_0x473166[_0x5b9c5a(0x130)]+'\x20changed'));if(_0x4dc82b[_0x5b9c5a(0x130)]>0x0)console[_0x5b9c5a(0x11c)]('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xf0)]('-\x20'+_0x4dc82b[_0x5b9c5a(0x130)]+_0x5b9c5a(0x102)));else _0x475cc3[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15e)]&&console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0xfd)](_0x475cc3[_0x5b9c5a(0x130)]+_0x5b9c5a(0xd1)));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd2)+a39_0x9de32f['dim']('=\x20'+_0x3ef219[_0x5b9c5a(0x130)]+'\x20unchanged'));}_0x2ee27f[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62['journeysOnly']&&(console[_0x5b9c5a(0x11c)](''),console['error'](_0x5b9c5a(0x12c)),_0x4ced41[_0x5b9c5a(0x130)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xd0)]('+\x20'+_0x4ced41[_0x5b9c5a(0x130)]+_0x5b9c5a(0xea))),_0x433478['length']>0x0&&console[_0x5b9c5a(0x11c)]('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x143)]('~\x20'+_0x433478[_0x5b9c5a(0x130)]+_0x5b9c5a(0x113))),_0x5b8913['length']>0x0&&console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0xf0)]('-\x20'+_0x5b8913['length']+_0x5b9c5a(0x102))));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xf5)+a39_0x9de32f['cyan'](_0xab3cf3)+'\x0a');if(_0x21ec91[_0x5b9c5a(0x130)]>0x0){console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x124));for(const _0x3ac643 of _0x21ec91){console['error']('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x14f)]('+')+'\x20'+_0x3ac643);}console[_0x5b9c5a(0x11c)]('');}if(_0x25c8e4[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)])for(const _0x42fbc3 of _0x25c8e4){const _0xa3ed44=_0x42fbc3[_0x5b9c5a(0x148)]?_0x42fbc3['folderPath']+'/'+_0x42fbc3[_0x5b9c5a(0x160)][_0x5b9c5a(0x117)]:_0x42fbc3[_0x5b9c5a(0x160)]['name'],_0x4b9668=_0x42fbc3[_0x5b9c5a(0x160)][_0x5b9c5a(0x15c)]?.[_0x5b9c5a(0x130)]||0x0,_0x4499f3=_0x4b9668>0x0?a39_0x9de32f[_0x5b9c5a(0xfd)]('\x20['+_0x4b9668+_0x5b9c5a(0x146)):'';console[_0x5b9c5a(0x11c)]('\x0a'+a39_0x9de32f[_0x5b9c5a(0xd0)](_0x5b9c5a(0xff))+'\x20'+_0xa3ed44+_0x4499f3),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),_0x42fbc3[_0x5b9c5a(0x14c)]&&console['error'](_0x42fbc3[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'['repeat'](0x3c));}if(_0x54bb45['length']>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)])for(const _0x35dbda of _0x54bb45){const _0x55f5f8=_0x35dbda[_0x5b9c5a(0x105)]?_0xe202e5[_0x5b9c5a(0x12e)](_0x35dbda[_0x5b9c5a(0x105)][_0x5b9c5a(0x153)]())||'':'',_0x3f4f6a=_0x55f5f8?_0x55f5f8+'/'+_0x35dbda[_0x5b9c5a(0x117)]:_0x35dbda[_0x5b9c5a(0x117)],_0x28c4a1=_0x34be3e[_0x5b9c5a(0x12e)](_0x35dbda['id'])||[],_0x13fdb6=_0x28c4a1[_0x5b9c5a(0x130)]>0x0?a39_0x9de32f[_0x5b9c5a(0xfd)]('\x20['+_0x28c4a1[_0x5b9c5a(0x130)]+_0x5b9c5a(0x146)):'';console['error']('\x0a'+a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x152))+'\x20'+_0x3f4f6a+_0x13fdb6),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));const _0x360bb8=segmentWithActivationsToYaml(_0x35dbda,_0x28c4a1,undefined,_0x2310eb,_0x4a7259),_0x1dde2f=segmentToYamlString(_0x360bb8),_0x3c4413=generateDiff(_0x1dde2f,'');console[_0x5b9c5a(0x11c)](formatDiffWithColors(_0x3c4413)),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));}const _0x450f9c=_0x1a0088[_0x5b9c5a(0x158)](_0x5dd367=>!_0x5dd367[_0x5b9c5a(0x106)]&&_0x5dd367[_0x5b9c5a(0x14c)]);if(_0x450f9c['length']>0x0&&!_0x25ee62['journeysOnly'])for(const _0x2d3923 of _0x450f9c){const _0x1015cc=_0x2d3923[_0x5b9c5a(0x148)]?_0x2d3923[_0x5b9c5a(0x148)]+'/'+_0x2d3923[_0x5b9c5a(0x160)][_0x5b9c5a(0x117)]:_0x2d3923['yamlConfig'][_0x5b9c5a(0x117)];console['error']('\x0a'+a39_0x9de32f['yellow'](_0x5b9c5a(0x108))+'\x20'+_0x1015cc),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),console[_0x5b9c5a(0x11c)](_0x2d3923[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));}if(_0x1807e2[_0x5b9c5a(0x130)]>0x0)for(const _0x4b3b18 of _0x1807e2){const _0x3c5256=_0x4b3b18['folderPath']?_0x4b3b18[_0x5b9c5a(0x148)]+'/'+_0x4b3b18['yamlConfig'][_0x5b9c5a(0x117)]:_0x4b3b18[_0x5b9c5a(0x160)][_0x5b9c5a(0x117)];console[_0x5b9c5a(0x11c)]('\x0a'+a39_0x9de32f[_0x5b9c5a(0xd0)](_0x5b9c5a(0x150))+'\x20'+_0x3c5256),console['error']('─'['repeat'](0x3c)),_0x4b3b18['diff']&&console[_0x5b9c5a(0x11c)](_0x4b3b18[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));}const _0x55a793=_0xf70371[_0x5b9c5a(0x158)](_0x10f9eb=>!_0x10f9eb[_0x5b9c5a(0x106)]&&_0x10f9eb[_0x5b9c5a(0x14c)]);if(_0x55a793['length']>0x0)for(const _0x372bc9 of _0x55a793){const _0x4fc2e7=_0x372bc9['folderPath']?_0x372bc9[_0x5b9c5a(0x148)]+'/'+_0x372bc9[_0x5b9c5a(0x160)]['name']:_0x372bc9['yamlConfig']['name'];console['error']('\x0a'+a39_0x9de32f[_0x5b9c5a(0x143)](_0x5b9c5a(0x10f))+'\x20'+_0x4fc2e7),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),console[_0x5b9c5a(0x11c)](_0x372bc9[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'['repeat'](0x3c));}if(_0x4dc82b[_0x5b9c5a(0x130)]>0x0)for(const _0x1c335e of _0x4dc82b){const _0x3cb888=_0x1c335e[_0x5b9c5a(0x10b)]?_0xe202e5[_0x5b9c5a(0x12e)](_0x1c335e[_0x5b9c5a(0x10b)])||'':'',_0x2a7f32=_0x3cb888?_0x3cb888+'/'+_0x1c335e[_0x5b9c5a(0x10e)]:_0x1c335e[_0x5b9c5a(0x10e)];console[_0x5b9c5a(0x11c)]('\x0a'+a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x103))+'\x20'+_0x2a7f32),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x126))),console['error']('─'[_0x5b9c5a(0xd5)](0x3c));}if(_0x25ee62['dryRun'])return console[_0x5b9c5a(0x11c)](a39_0x9de32f['yellow'](_0x5b9c5a(0xf8))),0x0;const _0x2166ed=_0x25ee62[_0x5b9c5a(0x15a)]?![]:_0x25c8e4[_0x5b9c5a(0x130)]>0x0||_0x5c6977[_0x5b9c5a(0x130)]>0x0||_0x54bb45[_0x5b9c5a(0x130)]>0x0,_0x3a068b=_0x1807e2[_0x5b9c5a(0x130)]>0x0||_0x473166[_0x5b9c5a(0x130)]>0x0||_0x4dc82b['length']>0x0,_0x5e71e7=_0x25ee62['journeysOnly']?![]:_0x2ee27f[_0x5b9c5a(0x130)]>0x0,_0x10f792=_0x21ec91[_0x5b9c5a(0x130)]>0x0;if(!_0x2166ed&&!_0x3a068b&&!_0x5e71e7&&!_0x10f792){const _0x193969=_0x25ee62['journeysOnly']?_0x5b9c5a(0x116):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xd0)](_0x193969));if(_0x4e0691&&_0x3a3546[_0x5b9c5a(0x130)]===0x1){const _0x1e45e1=_0x3a3546[0x0];if(_0x1e45e1['existingSegment']?.['id']){const _0x37acb0=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],'/app/ps/'+_0x11510e+'/e/'+_0x1e45e1[_0x5b9c5a(0x114)]['id']+_0x5b9c5a(0x121));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x112)+a39_0x9de32f['cyan'](_0x37acb0));}}if(_0x4e0691&&_0x3ef219[_0x5b9c5a(0x130)]===0x1){const _0x17c742=_0x3ef219[0x0];if(_0x17c742[_0x5b9c5a(0x128)]?.['id']){const _0x42f3ca=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],'/app/ps/'+_0x11510e+_0x5b9c5a(0x137)+_0x17c742['existingJourney']['id']+_0x5b9c5a(0x13e));console['error']('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x142)](_0x42f3ca));}}return 0x0;}const _0x404379=_0x25ee62['journeysOnly']?_0x1807e2[_0x5b9c5a(0x130)]+_0x473166[_0x5b9c5a(0x130)]+_0x4dc82b[_0x5b9c5a(0x130)]+_0x21ec91['length']:_0x25c8e4[_0x5b9c5a(0x130)]+_0x5c6977['length']+_0x54bb45[_0x5b9c5a(0x130)]+_0x1807e2['length']+_0x473166[_0x5b9c5a(0x130)]+_0x4dc82b[_0x5b9c5a(0x130)]+_0x21ec91[_0x5b9c5a(0x130)]+_0x2ee27f['length'];if(!_0x25ee62[_0x5b9c5a(0x154)]&&_0x404379>0x0){if(!isInteractive())return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0xe0)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xfd)](_0x5b9c5a(0x125))),0x1;const _0x38fe23=await confirmKey(_0x5b9c5a(0x162)+_0x404379+_0x5b9c5a(0x101));if(!_0x38fe23)return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x143)](_0x5b9c5a(0xd4))),0x1;}const _0x2a1bb0={'withProgress':async(_0x172093,_0x20bbb9)=>{const _0x36a19d=_0x5b9c5a,_0x69a12d=await withSpinner(_0x172093,_0x20bbb9,{'verbose':_0x25ee62['verbose']});return{'data':_0x69a12d[_0x36a19d(0xfe)]};},'logInfo':_0x2550c2=>console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x14f)]('✔\x20'+_0x2550c2)),'logSuccess':_0x8c9dd6=>console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xd0)]('✔\x20'+_0x8c9dd6)),'logWarning':_0x437878=>console[_0x5b9c5a(0x11c)](a39_0x9de32f['yellow']('⚠\x20'+_0x437878)),'logDeleted':_0x5f3e47=>console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)]('✔\x20'+_0x5f3e47))},_0x567d85={'segment':_0x533d33['segment'],'journey':_0x533d33[_0x5b9c5a(0x11a)],'user':_0x533d33[_0x5b9c5a(0x119)],'connection':_0x533d33['connection']};_0x21ec91['length']>0x0&&(_0x2432f4=await executePushFolders(_0x567d85,_0x21ec91,_0x2432f4,{'parentId':_0x11510e},_0x2a1bb0));const _0x184cef={'rootFolderId':_0x17d963,'folderPathToId':_0x2432f4,'folderIdToPath':_0xe202e5,'segmentNameToId':_0x1cb9e4,'activationsBySegmentId':_0x34be3e,'emailToIdMap':_0x1bb06f,'idToEmailMap':_0x2310eb,'connectionNameToIdMap':_0x47f0d5[_0x5b9c5a(0x11f)],'connectionIdToNameMap':_0x47f0d5[_0x5b9c5a(0xf7)],'connectionNameToTypeMap':_0x4ac5fe},_0x254cde=await executePushSegments(_0x567d85,_0x25ee62[_0x5b9c5a(0x15a)]?[]:_0x1a0088,_0x184cef,{'parentId':_0x11510e},_0x2a1bb0),_0x370462=_0x254cde['created'],_0x40612a=_0x254cde[_0x5b9c5a(0xcd)],_0x5045f2=_0x254cde[_0x5b9c5a(0x15c)][_0x5b9c5a(0xdf)],_0x28b298=_0x254cde[_0x5b9c5a(0x15c)][_0x5b9c5a(0xcd)],_0x391e98=_0x254cde[_0x5b9c5a(0x15c)][_0x5b9c5a(0x131)];let _0x20e954;if(_0x4e0691&&_0x1a0088[_0x5b9c5a(0x130)]===0x1){const _0x5fa8b6=_0x1a0088[0x0];_0x20e954=_0x5fa8b6[_0x5b9c5a(0x114)]?.['id']??_0x254cde['createdSegmentIds'][_0x5b9c5a(0x12e)](_0x5fa8b6['yamlConfig'][_0x5b9c5a(0x117)]);}const _0x276b44=await executePushSegmentDeletions(_0x567d85,_0x25ee62['journeysOnly']?[]:_0x54bb45,_0x2a1bb0);let _0x5861a0=0x0,_0x266d38=0x0,_0x3243ab=0x0;const _0x63679b=new Map(_0x1cb9e4);for(const [_0x2bfa55,_0x280dbe]of _0x254cde[_0x5b9c5a(0x133)]){_0x63679b[_0x5b9c5a(0x12f)](_0x2bfa55,_0x280dbe);}if(_0xf70371[_0x5b9c5a(0x130)]>0x0){const _0x4cc974={..._0x184cef,'segmentNameToId':_0x63679b,'existingSegments':_0x15a5ad,'activationContext':_0x1d22e5},_0xef828f=await executePushJourneys(_0x567d85,_0xf70371,_0x4cc974,{'parentId':_0x11510e,'rootFolderId':_0x17d963,'verbose':_0x25ee62['verbose']},_0x2a1bb0);_0x5861a0=_0xef828f['created'],_0x266d38=_0xef828f[_0x5b9c5a(0xcd)];if(_0x4e0691&&_0xef828f[_0x5b9c5a(0xf3)][_0x5b9c5a(0x130)]===0x1){const _0x172cb1=_0xef828f[_0x5b9c5a(0xf3)][0x0];if(_0x172cb1[_0x5b9c5a(0x14d)]){const _0x317d15=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],_0x5b9c5a(0x122)+_0x11510e+_0x5b9c5a(0x137)+_0x172cb1[_0x5b9c5a(0x14d)]+'/j/da/je');console[_0x5b9c5a(0x11c)]('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x142)](_0x317d15));}}}for(const _0x39452b of _0x4dc82b){console['error'](a39_0x9de32f[_0x5b9c5a(0x143)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x39452b['journeyBundleName'])),_0x3243ab++;}const _0xeafc88=[];if(_0x370462>0x0)_0xeafc88['push'](_0x370462+'\x20created');if(_0x40612a>0x0)_0xeafc88['push'](_0x40612a+_0x5b9c5a(0x12a));if(_0x276b44>0x0)_0xeafc88[_0x5b9c5a(0x147)](_0x276b44+_0x5b9c5a(0xde));const _0x3ba2e9=[];if(_0x5861a0>0x0)_0x3ba2e9[_0x5b9c5a(0x147)](_0x5861a0+_0x5b9c5a(0xd7));if(_0x266d38>0x0)_0x3ba2e9['push'](_0x266d38+_0x5b9c5a(0x12a));if(_0x3243ab>0x0)_0x3ba2e9['push'](_0x3243ab+'\x20deleted');const _0x3346e9=[];if(_0x5045f2>0x0)_0x3346e9[_0x5b9c5a(0x147)](_0x5045f2+_0x5b9c5a(0xd7));if(_0x28b298>0x0)_0x3346e9['push'](_0x28b298+'\x20updated');if(_0x391e98>0x0)_0x3346e9[_0x5b9c5a(0x147)](_0x391e98+_0x5b9c5a(0xde));console['error'](a39_0x9de32f[_0x5b9c5a(0xd0)](_0x5b9c5a(0x11e)));_0xeafc88['length']>0x0&&!_0x25ee62['journeysOnly']&&console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x159)+_0xeafc88[_0x5b9c5a(0x15d)](',\x20'));_0x3ba2e9[_0x5b9c5a(0x130)]>0x0&&console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd3)+_0x3ba2e9[_0x5b9c5a(0x15d)](',\x20'));_0x3346e9[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)]&&console[_0x5b9c5a(0x11c)]('\x20\x20Activations:\x20'+_0x3346e9['join'](',\x20'));if(_0x20e954){const _0x3fd7f7=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],_0x5b9c5a(0x122)+_0x11510e+_0x5b9c5a(0x137)+_0x20e954+_0x5b9c5a(0x121));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x112)+a39_0x9de32f[_0x5b9c5a(0x142)](_0x3fd7f7));}return 0x0;}}
|
|
1
|
+
const a39_0x55db05=a39_0x9a59;(function(_0x2e04ba,_0x59c389){const _0x150fa0=a39_0x9a59,_0x4f7ffb=_0x2e04ba();while(!![]){try{const _0x253f4f=-parseInt(_0x150fa0(0x1af))/0x1+-parseInt(_0x150fa0(0x1f5))/0x2+parseInt(_0x150fa0(0x1f0))/0x3*(parseInt(_0x150fa0(0x1da))/0x4)+-parseInt(_0x150fa0(0x20a))/0x5*(-parseInt(_0x150fa0(0x1ca))/0x6)+-parseInt(_0x150fa0(0x181))/0x7*(-parseInt(_0x150fa0(0x1fe))/0x8)+parseInt(_0x150fa0(0x1a9))/0x9+parseInt(_0x150fa0(0x1b0))/0xa*(-parseInt(_0x150fa0(0x1ef))/0xb);if(_0x253f4f===_0x59c389)break;else _0x4f7ffb['push'](_0x4f7ffb['shift']());}catch(_0x3ed213){_0x4f7ffb['push'](_0x4f7ffb['shift']());}}}(a39_0x1a43,0xde6c0));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x23710a from'chalk';import{existsSync}from'fs';function a39_0x9a59(_0x83e5ef,_0xf38dee){_0x83e5ef=_0x83e5ef-0x171;const _0x1a4340=a39_0x1a43();let _0x9a5991=_0x1a4340[_0x83e5ef];return _0x9a5991;}function a39_0x1a43(){const _0x407b16=['all','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Folders\x20to\x20create:','\x20\x20Journeys:\x20','audienceId','Delete\x20journey:','\x20\x20Segments:\x20','length','site','toCreate','isNew','Delete\x20segment:','helpText','listActivations','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','getParent','set','verbose','list','name','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','versionNumber','then','12FimJwV','existingSegment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','created','changed','red','get','New\x20journey:','journey','\x20\x20Activations:','type','Scoped\x20to\x20folder:\x20','delete','unchanged','updated','1667228yflBhh','journeyId','parentName','description','Error:\x20','execute','results','getOutputSchemaWithCache','parentSegment','error','listSegments','/app/ps/','targetDir','\x0a✔\x20Push\x20complete','Preparing\x20journeys...','\x20to\x20create','\x20to\x20delete','yellow','No\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x0aValidation\x20failed:','22HhybuZ','6CPRdPH','\x20YAML\x20files\x20found','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20folders\x20to\x20create','new','219144YmnwFD','nameToType','cyan','Parent\x20segment:\x20','(Journey\x20will\x20be\x20deleted)','Changes\x20to\x20journey:','folderId','createdSegmentIds','Fetching\x20connections\x20for\x20name\x20resolution...','8134344oOnrgw','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','join','updatedAt','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','yes','journeyBundleName','setPhase','nameToId','/j/da/je','segment:push','activations','3466510pmCSbd','push','folderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','user','Fetching\x20existing\x20data...','segment\x20or\x20journey','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','diff','Source\x20directory:\x20','journeysOnly','existingJourney','Push\x20','📁\x20','\x20changes?','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','segmentFolderId','\x20\x20Source:\x20','.yaml','Resolving\x20parent\x20segment\x20\x27','\x20created','7ZHEVSm','toString','map','folders','\x20new','/sb/da/esr','filter','\x20updated','repeat','\x20activations]','\x20to\x20update','.yml','add','\x0aError:','endsWith','\x20\x20Activations:\x20','message','deleted','parentFolder','file','blue','\x20unchanged','connection','\x20deleted','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','data','\x20changed','idToName','\x20\x20📊\x20Segments:','journeys','segment','yamlConfig','toDelete','filePath','segments','attributes','dim','journeyBundleId','green','\x20\x20\x20\x20','9073107MaUMPw','buildUserMaps','Changes\x20to:','state','/e/','Error\x20parsing\x20YAML:\x20','816790FrOOpA','12038660CAAVlN'];a39_0x1a43=function(){return _0x407b16;};return a39_0x1a43();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a39_0x55db05(0x1c6)]=a39_0x55db05(0x208);[a39_0x55db05(0x1dd)]=a39_0x55db05(0x1ff);async[a39_0x55db05(0x1df)](_0x126b7f){const _0x238454=a39_0x55db05,{options:_0x454caf,args:_0x336a8f,tdx:_0x150b9f}=_0x126b7f,_0xe967d5=_0x454caf,_0x1fad65=await resolveTarget({'arg':_0x336a8f[0x0],'contextParent':_0x454caf[_0x238454(0x1e2)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1fad65))return _0x1fad65['errorCode']==='no_parent'?(console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1eb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x238454(0x1e3)](_0x238454(0x1c1)),console['error'](_0x238454(0x1f2))):(console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1de)+_0x1fad65[_0x238454(0x191)]+'\x0a')),_0x1fad65[_0x238454(0x1bd)]&&console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1f7)](_0x1fad65['helpText']))),0x1;if(_0x1fad65['type']==='parent_name')return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1fad65[_0x238454(0x1e6)]+'\x0a')),console['error'](a39_0x23710a[_0x238454(0x1f7)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x196118=_0x1fad65[_0x238454(0x1dc)],_0xbc7751=_0x1fad65[_0x238454(0x1e6)],_0xcb50c6=_0x1fad65[_0x238454(0x1d5)]===_0x238454(0x194)?_0x1fad65[_0x238454(0x1a2)]:undefined,_0xf7f5ee=getScopedDetails(_0x1fad65),_0x2f210d=_0xf7f5ee?.[_0x238454(0x1bf)]??![],_0x4a2f31=_0xf7f5ee?.['scopedFolderPath']??'';if(!existsSync(_0xbc7751))return console['error'](a39_0x23710a['red']('Error:\x20Directory\x20not\x20found:\x20'+_0xbc7751+'\x0a')),console['error'](a39_0x23710a['cyan'](_0x238454(0x173))),0x1;_0xe967d5[_0x238454(0x1c4)]&&(console[_0x238454(0x1e3)]('Site:\x20'+_0xe967d5[_0x238454(0x1b9)]),console['error'](_0x238454(0x1f8)+_0x196118),console[_0x238454(0x1e3)](_0x238454(0x175)+_0xbc7751),_0x2f210d&&console[_0x238454(0x1e3)](_0x238454(0x1d6)+_0x4a2f31));const _0x3b8382=await withSpinner(_0x238454(0x17f)+_0x196118+'\x27...',()=>_0x150b9f[_0x238454(0x19f)]['resolveParentId'](_0x196118),{'verbose':_0xe967d5[_0x238454(0x1c4)]}),_0x2cb142=_0x3b8382[_0x238454(0x19a)],{parentSegmentResult:_0x447cad,segmentsResult:_0x3bbdd3,foldersResult:_0x2cc728,journeysWithDetailsResult:_0x23ad85,userMaps:_0x2febf3}=await withSpinner(_0x238454(0x171),async()=>{const _0x3486af=_0x238454,[_0x35b805,_0x2fefc6,_0x47222b,_0xe2b25c,_0x22904f]=await Promise[_0x3486af(0x1b1)]([_0x150b9f['segment'][_0x3486af(0x1c2)](_0x2cb142),_0x150b9f[_0x3486af(0x19f)][_0x3486af(0x1e4)](_0x2cb142),_0x150b9f[_0x3486af(0x19f)]['listFolders'](_0x2cb142),_0x150b9f['journey']['listJourneysWithDetailsFromParentSegment'](_0x2cb142,{'includeAllVersions':!![]}),_0x150b9f[_0x3486af(0x20e)][_0x3486af(0x1aa)]()]);return{'parentSegmentResult':_0x35b805,'segmentsResult':_0x2fefc6,'foldersResult':_0x47222b,'journeysWithDetailsResult':_0xe2b25c,'userMaps':_0x22904f};},{'verbose':_0xe967d5[_0x238454(0x1c4)]})[_0x238454(0x1c9)](_0x3f8b9d=>_0x3f8b9d[_0x238454(0x19a)]),_0x4d327e=_0x447cad,_0x4e9b35=extractRootFolderId(_0x4d327e),_0x370230=_0x3bbdd3,_0x5ea6e5=_0x2cc728,{journeys:_0x5780bf,activationStepsById:_0x19a97d}=_0x23ad85,_0x5f2cce=new Map(_0x5780bf[_0x238454(0x183)](_0x252630=>[_0x252630['id'],_0x252630])),_0x2da442=_0x5780bf[_0x238454(0x183)](_0x147ff9=>({'id':_0x147ff9['id'],'name':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1c6)],'journeyBundleName':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x204)]||'','journeyBundleId':_0x147ff9['attributes'][_0x238454(0x1a6)]||'','versionNumber':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1c8)],'description':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1dd)],'state':_0x147ff9['attributes'][_0x238454(0x1ac)],'paused':_0x147ff9[_0x238454(0x1a4)]['paused'],'audienceId':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1b5)],'folderId':_0x147ff9['relationships']?.[_0x238454(0x193)]?.[_0x238454(0x19a)]?.['id'],'createdAt':_0x147ff9[_0x238454(0x1a4)]['createdAt'],'updatedAt':_0x147ff9['attributes'][_0x238454(0x201)]})),{emailToId:_0x585d8d,idToEmail:_0x429617}=_0x2febf3,_0x254b90=await withSpinner(_0x238454(0x1fd),async()=>{const _0x220c5b=_0x238454,_0x105087=await _0x150b9f[_0x220c5b(0x197)][_0x220c5b(0x1c5)]();return buildConnectionMaps(_0x105087);},{'verbose':_0xe967d5[_0x238454(0x1c4)]})[_0x238454(0x1c9)](_0x46c05b=>_0x46c05b['data']),_0x4f975b=_0x254b90['nameToId'],_0x9dcac=_0x254b90[_0x238454(0x19c)],_0x3427b7=_0x254b90[_0x238454(0x1f6)],_0x15203b={'emailToIdMap':_0x585d8d,'connectionNameToIdMap':_0x4f975b,'connectionNameToTypeMap':_0x3427b7,'getSchema':_0x14ee65=>_0x150b9f[_0x238454(0x197)][_0x238454(0x1e1)](_0x14ee65)};let {pathToId:_0x58c233,idToPath:_0x28d875}=buildFolderMaps(_0x5ea6e5);const _0x49758a=buildSegmentLookupMap(_0x370230,_0x28d875),_0x4c3ae5=buildSegmentNameToIdMap(_0x370230),_0x297761=buildJourneyBundleLookupMap(_0x2da442,_0x28d875);let _0x4999b6;if(_0xcb50c6){if(!_0xcb50c6[_0x238454(0x18f)](_0x238454(0x18c))&&!_0xcb50c6[_0x238454(0x18f)](_0x238454(0x17e)))return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1c7)+_0xcb50c6+'\x0a')),0x1;_0x4999b6=[_0xcb50c6];}else _0x4999b6=findYamlFiles(_0xbc7751);if(_0x4999b6['length']===0x0)return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x199)+_0xbc7751+'\x0a')),console['error'](a39_0x23710a[_0x238454(0x1f7)](_0x238454(0x20d))),0x1;let _0x386940,_0x5d20be;try{const _0x23eccb=parseAndClassifyYamlFiles(_0x4999b6,_0xbc7751,{'skipSegments':_0xe967d5[_0x238454(0x176)]});_0x386940=_0x23eccb[_0x238454(0x1a3)],_0x5d20be=_0x23eccb[_0x238454(0x19e)];const _0x7de073=validateParsedFiles(_0x23eccb,_0xbc7751);if(_0x7de073[_0x238454(0x1b8)]>0x0)return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1ee))),console['error'](formatValidationErrors(_0x7de073)),console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1eb)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x48eaa2){return console['error'](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1ae)+(_0x48eaa2 instanceof Error?_0x48eaa2[_0x238454(0x191)]:_0x48eaa2))),0x1;}if(_0x386940['length']===0x0&&_0x5d20be[_0x238454(0x1b8)]===0x0){const _0x5d18cf=_0xe967d5[_0x238454(0x176)]?_0x238454(0x1d3):_0x238454(0x172);return console['error'](a39_0x23710a[_0x238454(0x1eb)](_0x238454(0x1ec)+_0x5d18cf+_0x238454(0x1f1))),0x0;}const _0x2a870c=new Map();_0x370230['length']>0x0&&!_0xe967d5[_0x238454(0x176)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x370230,async _0x30afe3=>{const _0x1dce88=a39_0x9a59,_0x2df1b9=await _0x150b9f[_0x1dce88(0x19f)][_0x1dce88(0x1be)](_0x2cb142,_0x30afe3['id']);_0x2a870c[_0x1dce88(0x1c3)](_0x30afe3['id'],_0x2df1b9);});},{'verbose':_0xe967d5[_0x238454(0x1c4)]});const {segmentFiles:_0x27fda2,foldersToCreate:_0x4e3a0a}=await prepareSegmentFiles(_0x386940,{'segmentByFolderAndName':_0x49758a,'activationsBySegmentId':_0x2a870c,'folderPathToId':_0x58c233,'idToEmailMap':_0x429617,'connectionIdToNameMap':_0x9dcac},_0x15203b,_0x2f210d,_0x4a2f31),_0x425cad=_0xcb50c6?[]:findSegmentsToDelete(_0x370230,_0x386940[_0x238454(0x183)](({yamlConfig:_0x1dcc73,folderPath:_0x499b44})=>({'yamlConfig':_0x1dcc73,'folderPath':resolveTDFolderPath(_0x499b44,_0x2f210d,_0x4a2f31)})),_0x28d875,_0x4a2f31,_0x2f210d),{journeyFiles:_0x92c354,foldersToCreate:_0x2eec5f}=await withProgressSpinner(_0x238454(0x1e8),async _0x1e5a4e=>prepareJourneyFiles(_0x5d20be,{'fetchJourney':async _0x167508=>_0x150b9f[_0x238454(0x1d3)]['getJourney'](_0x167508[_0x238454(0x1db)]),'journeyBundlesByFolderAndName':_0x297761,'folderPathToId':_0x58c233,'idToEmailMap':_0x429617,'connectionIdToNameMap':_0x9dcac,'existingSegments':_0x370230,'parentId':_0x2cb142,'deps':_0x150b9f,'progress':{'update':_0x37fcaf=>{const _0x42ae5c=_0x238454;_0x1e5a4e[_0x42ae5c(0x205)](_0x37fcaf),_0xe967d5[_0x42ae5c(0x1c4)]&&console[_0x42ae5c(0x1e3)]('\x20\x20'+_0x37fcaf);}},'journeyById':_0x5f2cce,'activationStepsById':_0x19a97d},_0x2f210d,_0x4a2f31),{'verbose':_0xe967d5['verbose']})[_0x238454(0x1c9)](_0x3117ca=>_0x3117ca[_0x238454(0x19a)]);for(const _0x7dd349 of _0x2eec5f){_0x4e3a0a[_0x238454(0x18d)](_0x7dd349);}const _0x3ecc7a=_0xcb50c6?[]:findJourneysToDelete(_0x2da442,_0x5d20be[_0x238454(0x183)](({yamlConfig:_0x59b6bb,folderPath:_0x26e172})=>({'yamlConfig':_0x59b6bb,'folderPath':resolveTDFolderPath(_0x26e172,_0x2f210d,_0x4a2f31)})),_0x28d875,_0x4a2f31,_0x2f210d),_0x50336a=calculatePushStats(_0x27fda2,_0x92c354,_0x4e3a0a,_0x425cad,_0x3ecc7a,!!_0xe967d5[_0x238454(0x1d7)],!!_0xe967d5[_0x238454(0x176)]),_0x2ff3e1=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1f4)],_0x3f540b=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1cf)],_0x5578f4=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1d8)],_0x500f37=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1a1)],_0x121e37=_0x50336a[_0x238454(0x184)][_0x238454(0x1ba)],_0x2a14f4=_0x50336a[_0x238454(0x19e)]['new'],_0x3124c6=_0x50336a['journeys']['changed'],_0x3c8afc=_0x50336a[_0x238454(0x19e)][_0x238454(0x1d8)],_0xc36bd8=_0x50336a[_0x238454(0x19e)][_0x238454(0x1a1)],_0x4e2c74=_0x50336a['activations'][_0x238454(0x1b1)],_0xbf5d51=_0x50336a[_0x238454(0x209)][_0x238454(0x1ba)],_0x589328=_0x50336a[_0x238454(0x209)]['toUpdate'],_0x2a326a=_0x50336a[_0x238454(0x209)]['toDelete'];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x196118+'\x27:');_0x121e37['length']>0x0&&console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a['blue'](_0x238454(0x179)+_0x121e37[_0x238454(0x1b8)]+_0x238454(0x1f3)));if(!_0xe967d5[_0x238454(0x176)]){console[_0x238454(0x1e3)](_0x238454(0x19d)),console['error'](_0x238454(0x1a8)+a39_0x23710a['green']('+\x20'+_0x2ff3e1[_0x238454(0x1b8)]+_0x238454(0x185))),console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1eb)]('~\x20'+_0x3f540b[_0x238454(0x1b8)]+_0x238454(0x19b)));if(_0x500f37[_0x238454(0x1b8)]>0x0)console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1d0)]('-\x20'+_0x500f37[_0x238454(0x1b8)]+_0x238454(0x1ea)));else _0x425cad[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x1d7)]&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a['dim'](_0x425cad[_0x238454(0x1b8)]+_0x238454(0x1c0)));console['error'](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a5)]('=\x20'+_0x5578f4[_0x238454(0x1b8)]+_0x238454(0x196)));}if(_0x92c354[_0x238454(0x1b8)]>0x0||_0x3ecc7a[_0x238454(0x1b8)]>0x0){console[_0x238454(0x1e3)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a7)]('+\x20'+_0x2a14f4[_0x238454(0x1b8)]+_0x238454(0x185))),console['error']('\x20\x20\x20\x20'+a39_0x23710a['yellow']('~\x20'+_0x3124c6[_0x238454(0x1b8)]+_0x238454(0x19b)));if(_0xc36bd8[_0x238454(0x1b8)]>0x0)console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1d0)]('-\x20'+_0xc36bd8['length']+_0x238454(0x1ea)));else _0x3ecc7a[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x1d7)]&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a5)](_0x3ecc7a['length']+_0x238454(0x1c0)));console['error'](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a5)]('=\x20'+_0x3c8afc['length']+_0x238454(0x196)));}_0x4e2c74[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)]&&(console[_0x238454(0x1e3)](''),console[_0x238454(0x1e3)](_0x238454(0x1d4)),_0xbf5d51[_0x238454(0x1b8)]>0x0&&console['error'](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a7)]('+\x20'+_0xbf5d51['length']+_0x238454(0x1e9))),_0x589328[_0x238454(0x1b8)]>0x0&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1eb)]('~\x20'+_0x589328[_0x238454(0x1b8)]+_0x238454(0x18b))),_0x2a326a[_0x238454(0x1b8)]>0x0&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a['red']('-\x20'+_0x2a326a[_0x238454(0x1b8)]+_0x238454(0x1ea))));console['error'](_0x238454(0x17d)+a39_0x23710a[_0x238454(0x1f7)](_0xbc7751)+'\x0a');if(_0x121e37['length']>0x0){console[_0x238454(0x1e3)](_0x238454(0x1b3));for(const _0xb95523 of _0x121e37){console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a[_0x238454(0x195)]('+')+'\x20'+_0xb95523);}console[_0x238454(0x1e3)]('');}if(_0x2ff3e1[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)])for(const _0x13393b of _0x2ff3e1){const _0xa5c999=_0x13393b[_0x238454(0x20c)]?_0x13393b['folderPath']+'/'+_0x13393b['yamlConfig'][_0x238454(0x1c6)]:_0x13393b['yamlConfig'][_0x238454(0x1c6)],_0x4188bf=_0x13393b[_0x238454(0x1a0)]['activations']?.['length']||0x0,_0x401b7e=_0x4188bf>0x0?a39_0x23710a['dim']('\x20['+_0x4188bf+_0x238454(0x18a)):'';console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a[_0x238454(0x1a7)]('New\x20segment:')+'\x20'+_0xa5c999+_0x401b7e),console['error']('─'[_0x238454(0x189)](0x3c)),_0x13393b[_0x238454(0x174)]&&console[_0x238454(0x1e3)](_0x13393b[_0x238454(0x174)]),console['error']('─'[_0x238454(0x189)](0x3c));}if(_0x500f37[_0x238454(0x1b8)]>0x0&&!_0xe967d5['journeysOnly'])for(const _0x109c37 of _0x500f37){const _0x368a14=_0x109c37[_0x238454(0x17c)]?_0x28d875[_0x238454(0x1d1)](_0x109c37[_0x238454(0x17c)][_0x238454(0x182)]())||'':'',_0x16f05b=_0x368a14?_0x368a14+'/'+_0x109c37[_0x238454(0x1c6)]:_0x109c37[_0x238454(0x1c6)],_0x3d831a=_0x2a870c[_0x238454(0x1d1)](_0x109c37['id'])||[],_0x13ae4=_0x3d831a[_0x238454(0x1b8)]>0x0?a39_0x23710a['dim']('\x20['+_0x3d831a[_0x238454(0x1b8)]+'\x20activations]'):'';console['error']('\x0a'+a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1bc))+'\x20'+_0x16f05b+_0x13ae4),console['error']('─'[_0x238454(0x189)](0x3c));const _0xb08301=segmentWithActivationsToYaml(_0x109c37,_0x3d831a,undefined,_0x429617,_0x9dcac),_0x187029=segmentToYamlString(_0xb08301),_0x422ab2=generateDiff(_0x187029,'');console['error'](formatDiffWithColors(_0x422ab2)),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c));}const _0x528451=_0x27fda2[_0x238454(0x187)](_0x1840d7=>!_0x1840d7[_0x238454(0x1bb)]&&_0x1840d7[_0x238454(0x174)]);if(_0x528451[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)])for(const _0x2c20b6 of _0x528451){const _0x3d9cf0=_0x2c20b6['folderPath']?_0x2c20b6['folderPath']+'/'+_0x2c20b6[_0x238454(0x1a0)][_0x238454(0x1c6)]:_0x2c20b6[_0x238454(0x1a0)][_0x238454(0x1c6)];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a[_0x238454(0x1eb)](_0x238454(0x1ab))+'\x20'+_0x3d9cf0),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c)),console['error'](_0x2c20b6[_0x238454(0x174)]),console[_0x238454(0x1e3)]('─'['repeat'](0x3c));}if(_0x2a14f4[_0x238454(0x1b8)]>0x0)for(const _0x3197ca of _0x2a14f4){const _0x24c267=_0x3197ca[_0x238454(0x20c)]?_0x3197ca['folderPath']+'/'+_0x3197ca[_0x238454(0x1a0)][_0x238454(0x1c6)]:_0x3197ca[_0x238454(0x1a0)][_0x238454(0x1c6)];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a['green'](_0x238454(0x1d2))+'\x20'+_0x24c267),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c)),_0x3197ca[_0x238454(0x174)]&&console[_0x238454(0x1e3)](_0x3197ca[_0x238454(0x174)]),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c));}const _0x58dbac=_0x92c354['filter'](_0x247f03=>!_0x247f03[_0x238454(0x1bb)]&&_0x247f03[_0x238454(0x174)]);if(_0x58dbac[_0x238454(0x1b8)]>0x0)for(const _0x151866 of _0x58dbac){const _0x4d25f6=_0x151866['folderPath']?_0x151866[_0x238454(0x20c)]+'/'+_0x151866[_0x238454(0x1a0)]['name']:_0x151866[_0x238454(0x1a0)][_0x238454(0x1c6)];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a['yellow'](_0x238454(0x1fa))+'\x20'+_0x4d25f6),console['error']('─'['repeat'](0x3c)),console[_0x238454(0x1e3)](_0x151866['diff']),console[_0x238454(0x1e3)]('─'['repeat'](0x3c));}if(_0xc36bd8[_0x238454(0x1b8)]>0x0)for(const _0x390ecc of _0xc36bd8){const _0x31a236=_0x390ecc['folderId']?_0x28d875[_0x238454(0x1d1)](_0x390ecc[_0x238454(0x1fb)])||'':'',_0x440aa3=_0x31a236?_0x31a236+'/'+_0x390ecc[_0x238454(0x204)]:_0x390ecc['journeyBundleName'];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a['red'](_0x238454(0x1b6))+'\x20'+_0x440aa3),console['error']('─'[_0x238454(0x189)](0x3c)),console['error'](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1f9))),console[_0x238454(0x1e3)]('─'['repeat'](0x3c));}if(_0xe967d5[_0x238454(0x1cd)])return console['error'](a39_0x23710a['yellow'](_0x238454(0x202))),0x0;const _0x3606e2=_0xe967d5[_0x238454(0x176)]?![]:_0x2ff3e1[_0x238454(0x1b8)]>0x0||_0x3f540b['length']>0x0||_0x500f37[_0x238454(0x1b8)]>0x0,_0xa2b9f5=_0x2a14f4['length']>0x0||_0x3124c6[_0x238454(0x1b8)]>0x0||_0xc36bd8['length']>0x0,_0x394774=_0xe967d5['journeysOnly']?![]:_0x4e2c74['length']>0x0,_0x479948=_0x121e37[_0x238454(0x1b8)]>0x0;if(!_0x3606e2&&!_0xa2b9f5&&!_0x394774&&!_0x479948){const _0x10bf48=_0xe967d5[_0x238454(0x176)]?_0x238454(0x1b2):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1a7)](_0x10bf48));if(_0xcb50c6&&_0x5578f4[_0x238454(0x1b8)]===0x1){const _0x5c5981=_0x5578f4[0x0];if(_0x5c5981[_0x238454(0x1cb)]?.['id']){const _0x105baa=getConsoleNextUrl(_0xe967d5['site'],_0x238454(0x1e5)+_0x2cb142+_0x238454(0x1ad)+_0x5c5981['existingSegment']['id']+_0x238454(0x186));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x23710a[_0x238454(0x1f7)](_0x105baa));}}if(_0xcb50c6&&_0x3c8afc[_0x238454(0x1b8)]===0x1){const _0x2eae00=_0x3c8afc[0x0];if(_0x2eae00[_0x238454(0x177)]?.['id']){const _0x433dbb=getConsoleNextUrl(_0xe967d5[_0x238454(0x1b9)],'/app/ps/'+_0x2cb142+'/e/'+_0x2eae00[_0x238454(0x177)]['id']+'/j/da/je');console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a[_0x238454(0x1f7)](_0x433dbb));}}return 0x0;}const _0x3bcaec=_0xe967d5['journeysOnly']?_0x2a14f4[_0x238454(0x1b8)]+_0x3124c6['length']+_0xc36bd8['length']+_0x121e37[_0x238454(0x1b8)]:_0x2ff3e1['length']+_0x3f540b[_0x238454(0x1b8)]+_0x500f37['length']+_0x2a14f4[_0x238454(0x1b8)]+_0x3124c6[_0x238454(0x1b8)]+_0xc36bd8[_0x238454(0x1b8)]+_0x121e37[_0x238454(0x1b8)]+_0x4e2c74[_0x238454(0x1b8)];if(!_0xe967d5[_0x238454(0x203)]&&_0x3bcaec>0x0){if(!isInteractive())return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x18e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a39_0x23710a[_0x238454(0x1a5)](_0x238454(0x1cc))),0x1;const _0x158030=await confirmKey(_0x238454(0x178)+_0x3bcaec+_0x238454(0x17a));if(!_0x158030)return console['error'](a39_0x23710a['yellow']('Aborted.')),0x1;}const _0x50c690={'withProgress':async(_0x3ce11d,_0x3815d3)=>{const _0x3ba173=_0x238454,_0x5628dd=await withSpinner(_0x3ce11d,_0x3815d3,{'verbose':_0xe967d5['verbose']});return{'data':_0x5628dd[_0x3ba173(0x19a)]};},'logInfo':_0x46feb8=>console['error'](a39_0x23710a[_0x238454(0x195)]('✔\x20'+_0x46feb8)),'logSuccess':_0x48442c=>console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1a7)]('✔\x20'+_0x48442c)),'logWarning':_0x377fb1=>console['error'](a39_0x23710a['yellow']('⚠\x20'+_0x377fb1)),'logDeleted':_0x410943=>console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)]('✔\x20'+_0x410943))},_0x52046e={'segment':_0x150b9f['segment'],'journey':_0x150b9f[_0x238454(0x1d3)],'user':_0x150b9f[_0x238454(0x20e)],'connection':_0x150b9f[_0x238454(0x197)]};_0x121e37[_0x238454(0x1b8)]>0x0&&(_0x58c233=await executePushFolders(_0x52046e,_0x121e37,_0x58c233,{'parentId':_0x2cb142},_0x50c690));const _0x5e3d19={'rootFolderId':_0x4e9b35,'folderPathToId':_0x58c233,'folderIdToPath':_0x28d875,'segmentNameToId':_0x4c3ae5,'activationsBySegmentId':_0x2a870c,'emailToIdMap':_0x585d8d,'idToEmailMap':_0x429617,'connectionNameToIdMap':_0x254b90[_0x238454(0x206)],'connectionIdToNameMap':_0x254b90[_0x238454(0x19c)],'connectionNameToTypeMap':_0x3427b7},_0x59c1f=await executePushSegments(_0x52046e,_0xe967d5[_0x238454(0x176)]?[]:_0x27fda2,_0x5e3d19,{'parentId':_0x2cb142},_0x50c690),_0x35a507=_0x59c1f[_0x238454(0x1ce)],_0x6ce50c=_0x59c1f[_0x238454(0x1d9)],_0x2dcc0e=_0x59c1f['activations'][_0x238454(0x1ce)],_0x535cfb=_0x59c1f[_0x238454(0x209)][_0x238454(0x1d9)],_0x197e11=_0x59c1f[_0x238454(0x209)][_0x238454(0x192)];let _0xe68a25;if(_0xcb50c6&&_0x27fda2[_0x238454(0x1b8)]===0x1){const _0x95a425=_0x27fda2[0x0];_0xe68a25=_0x95a425['existingSegment']?.['id']??_0x59c1f['createdSegmentIds'][_0x238454(0x1d1)](_0x95a425['yamlConfig'][_0x238454(0x1c6)]);}const _0x1fefa9=await executePushSegmentDeletions(_0x52046e,_0xe967d5['journeysOnly']?[]:_0x500f37,_0x50c690);let _0x4788d9=0x0,_0x33abc7=0x0,_0x6e6ecf=0x0;const _0x5e2b7f=new Map(_0x4c3ae5);for(const [_0x439cfd,_0x21c2c7]of _0x59c1f[_0x238454(0x1fc)]){_0x5e2b7f[_0x238454(0x1c3)](_0x439cfd,_0x21c2c7);}if(_0x92c354[_0x238454(0x1b8)]>0x0){const _0x6d590a={..._0x5e3d19,'segmentNameToId':_0x5e2b7f,'existingSegments':_0x370230,'activationContext':_0x15203b},_0x222874=await executePushJourneys(_0x52046e,_0x92c354,_0x6d590a,{'parentId':_0x2cb142,'rootFolderId':_0x4e9b35,'verbose':_0xe967d5[_0x238454(0x1c4)]},_0x50c690);_0x4788d9=_0x222874[_0x238454(0x1ce)],_0x33abc7=_0x222874['updated'];if(_0xcb50c6&&_0x222874[_0x238454(0x1e0)][_0x238454(0x1b8)]===0x1){const _0xb7844e=_0x222874['results'][0x0];if(_0xb7844e['journeyId']){const _0x437d59=getConsoleNextUrl(_0xe967d5[_0x238454(0x1b9)],'/app/ps/'+_0x2cb142+_0x238454(0x1ad)+_0xb7844e['journeyId']+_0x238454(0x207));console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a['cyan'](_0x437d59));}}}for(const _0x2f2757 of _0xc36bd8){console['error'](a39_0x23710a[_0x238454(0x1eb)](_0x238454(0x17b)+_0x2f2757[_0x238454(0x204)])),_0x6e6ecf++;}const _0x2701f2=[];if(_0x35a507>0x0)_0x2701f2['push'](_0x35a507+_0x238454(0x180));if(_0x6ce50c>0x0)_0x2701f2['push'](_0x6ce50c+_0x238454(0x188));if(_0x1fefa9>0x0)_0x2701f2[_0x238454(0x20b)](_0x1fefa9+_0x238454(0x198));const _0x3807c8=[];if(_0x4788d9>0x0)_0x3807c8[_0x238454(0x20b)](_0x4788d9+'\x20created');if(_0x33abc7>0x0)_0x3807c8[_0x238454(0x20b)](_0x33abc7+_0x238454(0x188));if(_0x6e6ecf>0x0)_0x3807c8['push'](_0x6e6ecf+'\x20deleted');const _0x207cab=[];if(_0x2dcc0e>0x0)_0x207cab[_0x238454(0x20b)](_0x2dcc0e+_0x238454(0x180));if(_0x535cfb>0x0)_0x207cab[_0x238454(0x20b)](_0x535cfb+_0x238454(0x188));if(_0x197e11>0x0)_0x207cab[_0x238454(0x20b)](_0x197e11+_0x238454(0x198));console[_0x238454(0x1e3)](a39_0x23710a['green'](_0x238454(0x1e7)));_0x2701f2[_0x238454(0x1b8)]>0x0&&!_0xe967d5['journeysOnly']&&console[_0x238454(0x1e3)](_0x238454(0x1b7)+_0x2701f2['join'](',\x20'));_0x3807c8['length']>0x0&&console['error'](_0x238454(0x1b4)+_0x3807c8[_0x238454(0x200)](',\x20'));_0x207cab[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)]&&console[_0x238454(0x1e3)](_0x238454(0x190)+_0x207cab[_0x238454(0x200)](',\x20'));if(_0xe68a25){const _0x5e4547=getConsoleNextUrl(_0xe967d5[_0x238454(0x1b9)],'/app/ps/'+_0x2cb142+'/e/'+_0xe68a25+_0x238454(0x186));console[_0x238454(0x1e3)](_0x238454(0x1ed)+a39_0x23710a[_0x238454(0x1f7)](_0x5e4547));}return 0x0;}}
|