@treasuredata/tdx 2026.3.9 → 2026.3.11
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
|
+
const a34_0x554f9a=a34_0x3cff;(function(_0x1e96cf,_0x1af5ff){const _0x1869fe=a34_0x3cff,_0xa8845f=_0x1e96cf();while(!![]){try{const _0x457d0a=-parseInt(_0x1869fe(0x10b))/0x1*(parseInt(_0x1869fe(0xc0))/0x2)+-parseInt(_0x1869fe(0xbb))/0x3*(parseInt(_0x1869fe(0xd7))/0x4)+-parseInt(_0x1869fe(0x130))/0x5+parseInt(_0x1869fe(0x116))/0x6+parseInt(_0x1869fe(0xd0))/0x7+parseInt(_0x1869fe(0xb1))/0x8+-parseInt(_0x1869fe(0xd9))/0x9*(parseInt(_0x1869fe(0xdc))/0xa);if(_0x457d0a===_0x1af5ff)break;else _0xa8845f['push'](_0xa8845f['shift']());}catch(_0x46b1e0){_0xa8845f['push'](_0xa8845f['shift']());}}}(a34_0x4b72,0x5f923));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';function a34_0x3cff(_0x41c8fe,_0x589799){_0x41c8fe=_0x41c8fe-0xae;const _0x4b7201=a34_0x4b72();let _0x3cff34=_0x4b7201[_0x41c8fe];return _0x3cff34;}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_0x4b19e1 from'chalk';function formatRelativeTime(_0xe6597d){const _0x2fe353=a34_0x3cff,_0xef3ae2=new Date(_0xe6597d),_0x221dad=new Date(),_0x7f209b=_0xef3ae2['getTime']()-_0x221dad['getTime'](),_0x3efbb0=Math[_0x2fe353(0xca)](_0x7f209b)/0x3e8,_0x575fce=_0x7f209b<0x0;if(_0x3efbb0<0x3c)return _0x575fce?_0x2fe353(0xfe):_0x2fe353(0xde);else{if(_0x3efbb0<0xe10){const _0x4398ba=Math['round'](_0x3efbb0/0x3c);return _0x575fce?_0x4398ba+'m\x20ago':_0x2fe353(0xef)+_0x4398ba+'m';}else{if(_0x3efbb0<0x15180){const _0x168ee8=Math[_0x2fe353(0xd4)](_0x3efbb0/0xe10);return _0x575fce?_0x168ee8+_0x2fe353(0xf4):_0x2fe353(0xef)+_0x168ee8+'h';}else{if(_0x3efbb0<0x93a80){const _0x51dabe=Math[_0x2fe353(0xd4)](_0x3efbb0/0x15180);return _0x575fce?_0x51dabe+_0x2fe353(0x11d):_0x2fe353(0xef)+_0x51dabe+'d';}else return _0xef3ae2[_0x2fe353(0x13a)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0xf6);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x138);async[a34_0x554f9a(0xd2)](_0x28dc37){const _0x4028cb=a34_0x554f9a,{options:_0x15cb5f,args:_0x4e4e01,tdx:_0x1f1b07}=_0x28dc37,_0x50c8b7=resolveLimit(_0x15cb5f[_0x4028cb(0x131)],DEFAULT_DISPLAY_LIMIT),_0x125383=_0x4e4e01[0x0],_0x4c7a90=_0x125383?_0x4028cb(0x133)+_0x125383+'\x22...':_0x4028cb(0x121),_0x5f4ccd=await withSpinner(_0x4c7a90,()=>_0x1f1b07['schedules'][_0x4028cb(0x104)]({'limit':_0x50c8b7,'scheduled':!![],'pattern':_0x125383}),{'verbose':_0x15cb5f[_0x4028cb(0x129)]}),_0x36d5fd=_0x5f4ccd[_0x4028cb(0xeb)]['queries'],_0x315659=_0x5f4ccd['data'][_0x4028cb(0xb3)]['has_next_page'],_0x1b8d3e=_0x125383?_0x4028cb(0xce)+_0x125383+'\x22':'';_0x315659?console[_0x4028cb(0x125)]('Showing\x20first\x20'+_0x36d5fd[_0x4028cb(0x12d)]+_0x4028cb(0xd1)+_0x1b8d3e+_0x4028cb(0x12f)):console[_0x4028cb(0x125)](_0x4028cb(0xf1)+_0x36d5fd[_0x4028cb(0x12d)]+_0x4028cb(0xdb)+(_0x36d5fd['length']!==0x1?_0x4028cb(0x105):'y')+_0x1b8d3e);if(_0x15cb5f[_0x4028cb(0x115)]===_0x4028cb(0x12b)||_0x15cb5f[_0x4028cb(0x115)]===_0x4028cb(0x10d)||_0x15cb5f['format']===_0x4028cb(0xd3)||_0x15cb5f[_0x4028cb(0x115)]===_0x4028cb(0xd6)){const _0x1849fe=_0x36d5fd[_0x4028cb(0xe6)](_0x40e708=>({'id':_0x40e708['id'],'name':_0x40e708['name'],'cron':_0x40e708[_0x4028cb(0xe7)],'database':_0x40e708['database']?.['name'],'type':_0x40e708[_0x4028cb(0x132)],'timezone':_0x40e708[_0x4028cb(0xff)],'user_name':_0x40e708['user']?.['name'],'updated_at':_0x40e708[_0x4028cb(0xb0)],'next_run_at':_0x40e708[_0x4028cb(0x111)],'last_job_status':_0x40e708[_0x4028cb(0xd8)]?.[_0x4028cb(0x112)]}));await handleSDKOutput(_0x1849fe,_0x15cb5f);}else{if(_0x36d5fd[_0x4028cb(0x12d)]===0x0)console[_0x4028cb(0x128)](_0x4028cb(0x108));else{const _0xee6e91=_0x15cb5f[_0x4028cb(0x120)],_0x37be95=_0x36d5fd[_0x4028cb(0xe6)](_0x522545=>{const _0x3b85dc=_0x4028cb,_0x22effb=_0x522545[_0x3b85dc(0xd8)]?.['status']?_0x522545[_0x3b85dc(0xd8)][_0x3b85dc(0x112)]===_0x3b85dc(0xe9)?'✓':'✗':'-',_0x3c570c=_0x522545[_0x3b85dc(0xd8)]?.['ended_at']?formatRelativeTime(_0x522545[_0x3b85dc(0xd8)]['ended_at']):'never',_0x5e14f7=_0x522545[_0x3b85dc(0x111)]?formatRelativeTime(_0x522545[_0x3b85dc(0x111)]):'-',_0x5a07f4=_0x522545['cron']||'',_0x5166eb=_0x522545['name']||_0x3b85dc(0x11e),_0x502793=getConsoleUrl(_0xee6e91,_0x3b85dc(0x135)+_0x522545['id']);return{'statusIcon':_0x22effb,'lastRun':_0x3c570c,'nextRun':_0x5e14f7,'cron':_0x5a07f4,'name':_0x5166eb,'queryUrl':_0x502793,'status':_0x522545[_0x3b85dc(0xd8)]?.[_0x3b85dc(0x112)]};}),_0x43c666=Math[_0x4028cb(0x127)](..._0x37be95['map'](_0x395809=>_0x395809[_0x4028cb(0xb5)][_0x4028cb(0x12d)])),_0x3148bd=Math[_0x4028cb(0x127)](..._0x37be95[_0x4028cb(0xe6)](_0x32c3df=>_0x32c3df[_0x4028cb(0xf2)][_0x4028cb(0x12d)])),_0x193217=Math['max'](..._0x37be95[_0x4028cb(0xe6)](_0x416126=>_0x416126['cron'][_0x4028cb(0x12d)])),_0x2f8848=_0x37be95['map'](_0xf941f5=>{const _0x19e4fb=_0x4028cb,_0x5f8b01=_0xf941f5['status']===_0x19e4fb(0xe9)?a34_0x4b19e1[_0x19e4fb(0xd5)](_0xf941f5[_0x19e4fb(0x10e)]):_0xf941f5['status']===_0x19e4fb(0x125)?a34_0x4b19e1['red'](_0xf941f5[_0x19e4fb(0x10e)]):a34_0x4b19e1[_0x19e4fb(0xcb)](_0xf941f5[_0x19e4fb(0x10e)]),_0x389bc1=_0xf941f5[_0x19e4fb(0xb5)][_0x19e4fb(0x10c)](_0x43c666),_0x29242d=_0xf941f5[_0x19e4fb(0xf2)]['padEnd'](_0x3148bd),_0x4bb2b4=_0xf941f5['cron']?a34_0x4b19e1['cyan'](_0xf941f5[_0x19e4fb(0xe7)]['padEnd'](_0x193217)):'\x20'['repeat'](_0x193217),_0x55185c=hyperlink(_0xf941f5['name'],_0xf941f5[_0x19e4fb(0xbe)]);return _0x19e4fb(0x12c)+_0x5f8b01+'\x20'+_0x389bc1+_0x19e4fb(0xbd)+_0x29242d+'\x20\x20'+_0x4bb2b4+'\x20\x20'+_0x55185c;});await writeOutput(_0x2f8848[_0x4028cb(0x107)]('\x0a'),_0x15cb5f[_0x4028cb(0xc6)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x126);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x11f);[a34_0x554f9a(0xea)](_0x3e4c61){const _0x52072a=a34_0x554f9a,_0x3e7f83=_0x3e4c61[_0x52072a(0xb8)][0x0];if(!_0x3e7f83)return _0x52072a(0xf7);return undefined;}async[a34_0x554f9a(0xd2)](_0x376322){const _0x2a7c1e=a34_0x554f9a,{options:_0x352ac6,args:_0x468906,tdx:_0x5d88ab}=_0x376322,_0x5ec24a=_0x468906[0x0],_0x5276a1=await withSpinner('Getting\x20schedule\x20details...',()=>_0x5d88ab[_0x2a7c1e(0xcc)][_0x2a7c1e(0x119)](_0x5ec24a),{'verbose':_0x352ac6[_0x2a7c1e(0x129)]}),_0x25c3c5=_0x5276a1[_0x2a7c1e(0xeb)],_0x34d5fb={'name':_0x25c3c5[_0x2a7c1e(0xf0)],'cron':_0x25c3c5[_0x2a7c1e(0xe7)],'database':_0x25c3c5[_0x2a7c1e(0xc8)],'type':_0x25c3c5[_0x2a7c1e(0x132)],'timezone':_0x25c3c5[_0x2a7c1e(0xcf)],'user_name':_0x25c3c5[_0x2a7c1e(0xcd)],'created_at':_0x25c3c5[_0x2a7c1e(0xda)],'engine_version':_0x25c3c5[_0x2a7c1e(0xc7)],'executing_user_id':_0x25c3c5[_0x2a7c1e(0xc1)],'query':_0x25c3c5[_0x2a7c1e(0x11c)],'delay':_0x25c3c5['delay'],'priority':_0x25c3c5[_0x2a7c1e(0xe0)],'retry_limit':_0x25c3c5[_0x2a7c1e(0xe8)],..._0x25c3c5[_0x2a7c1e(0xc2)]&&{'result':_0x25c3c5[_0x2a7c1e(0xc2)]}};return await handleSingleObjectOutput(_0x34d5fb,_0x352ac6),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x137);['description']='Create\x20a\x20scheduled\x20query';[a34_0x554f9a(0xea)](_0x45b6fb){const _0x23ae9e=a34_0x554f9a,_0x55b81e=_0x45b6fb[_0x23ae9e(0xb8)][0x0];if(!_0x55b81e)return _0x23ae9e(0xc4);const _0x4474bd=_0x45b6fb[_0x23ae9e(0xba)];if(!_0x4474bd[_0x23ae9e(0xc8)])return _0x23ae9e(0xc9);return undefined;}async[a34_0x554f9a(0xd2)](_0x35179f){const _0x581d24=a34_0x554f9a,{options:_0x3c8079,args:_0x360474,tdx:_0x279ec3}=_0x35179f,_0x1b704d=_0x360474[0x0],_0x70a0e4=_0x3c8079,_0x4c1d40=_0x70a0e4['database'],_0x8813a4=_0x70a0e4[_0x581d24(0xb4)],_0x4d404c=_0x70a0e4[_0x581d24(0x132)]||_0x581d24(0x101);let _0x1a64f4;try{_0x1a64f4=readFileSync(_0x8813a4,_0x581d24(0xe2))[_0x581d24(0x122)]();}catch(_0x44f89f){throw new SDKError(ErrorCode[_0x581d24(0xfb)],_0x581d24(0x123)+_0x8813a4,_0x44f89f instanceof Error?_0x44f89f:undefined);}if(!_0x1a64f4)throw new SDKError(ErrorCode[_0x581d24(0xfb)],_0x581d24(0xe4));const _0x3c3370={'database':_0x4c1d40,'query':_0x1a64f4,'type':_0x4d404c};if(_0x70a0e4['cron'])_0x3c3370['cron']=_0x70a0e4['cron'];if(_0x70a0e4[_0x581d24(0xcf)])_0x3c3370['timezone']=_0x70a0e4['timezone'];if(_0x70a0e4[_0x581d24(0x10a)]!==undefined)_0x3c3370[_0x581d24(0x10a)]=Number(_0x70a0e4[_0x581d24(0x10a)]);if(_0x70a0e4[_0x581d24(0xe0)]!==undefined)_0x3c3370[_0x581d24(0xe0)]=Number(_0x70a0e4[_0x581d24(0xe0)]);if(_0x70a0e4[_0x581d24(0xe1)]!==undefined)_0x3c3370[_0x581d24(0xe8)]=Number(_0x70a0e4[_0x581d24(0xe1)]);if(_0x70a0e4[_0x581d24(0x102)])_0x3c3370[_0x581d24(0xc7)]=_0x70a0e4[_0x581d24(0x102)];if(_0x70a0e4['result'])_0x3c3370[_0x581d24(0xc2)]=_0x70a0e4[_0x581d24(0xc2)];if(_0x3c8079[_0x581d24(0x129)]){console['error'](_0x581d24(0x136)+_0x1b704d),console[_0x581d24(0x125)]('\x20\x20Database:\x20'+_0x4c1d40),console[_0x581d24(0x125)]('\x20\x20Type:\x20'+_0x4d404c);if(_0x3c3370[_0x581d24(0xe7)])console[_0x581d24(0x125)](_0x581d24(0xc5)+_0x3c3370[_0x581d24(0xe7)]);if(_0x3c3370['timezone'])console[_0x581d24(0x125)](_0x581d24(0xf8)+_0x3c3370[_0x581d24(0xcf)]);}const _0x2e060c=await withSpinner(_0x581d24(0xf9),()=>_0x279ec3[_0x581d24(0xcc)][_0x581d24(0xfa)](_0x1b704d,_0x3c3370),{'verbose':_0x3c8079[_0x581d24(0x129)]});return console[_0x581d24(0x125)](_0x581d24(0xee)+_0x2e060c[_0x581d24(0xeb)][_0x581d24(0xf0)]),await handleSingleObjectOutput(_0x2e060c[_0x581d24(0xeb)],_0x3c8079),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x100);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x114);[a34_0x554f9a(0xea)](_0x20ab64){const _0x5bb860=a34_0x554f9a,_0x23bb93=_0x20ab64[_0x5bb860(0xb8)][0x0];if(!_0x23bb93)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async['execute'](_0x27fa5d){const _0x19ddea=a34_0x554f9a,{options:_0x4da896,args:_0x263787,tdx:_0x5ca884}=_0x27fa5d,_0x421d2d=_0x263787[0x0],_0xb35646=_0x4da896,_0x91427={};if(_0xb35646['database'])_0x91427[_0x19ddea(0xc8)]=_0xb35646[_0x19ddea(0xc8)];if(_0xb35646[_0x19ddea(0x132)])_0x91427['type']=_0xb35646[_0x19ddea(0x132)];if(_0xb35646['cron'])_0x91427[_0x19ddea(0xe7)]=_0xb35646[_0x19ddea(0xe7)];if(_0xb35646['timezone'])_0x91427[_0x19ddea(0xcf)]=_0xb35646[_0x19ddea(0xcf)];if(_0xb35646[_0x19ddea(0x10a)]!==undefined)_0x91427[_0x19ddea(0x10a)]=Number(_0xb35646['delay']);if(_0xb35646[_0x19ddea(0xe0)]!==undefined)_0x91427[_0x19ddea(0xe0)]=Number(_0xb35646[_0x19ddea(0xe0)]);if(_0xb35646[_0x19ddea(0xe1)]!==undefined)_0x91427['retry_limit']=Number(_0xb35646[_0x19ddea(0xe1)]);if(_0xb35646[_0x19ddea(0x102)])_0x91427[_0x19ddea(0xc7)]=_0xb35646[_0x19ddea(0x102)];if(_0xb35646['result'])_0x91427['result']=_0xb35646['result'];if(_0xb35646[_0x19ddea(0xb4)])try{_0x91427['query']=readFileSync(_0xb35646[_0x19ddea(0xb4)],_0x19ddea(0xe2))[_0x19ddea(0x122)]();}catch(_0xe1ddd2){throw new SDKError(ErrorCode[_0x19ddea(0xfb)],_0x19ddea(0x123)+_0xb35646[_0x19ddea(0xb4)],_0xe1ddd2 instanceof Error?_0xe1ddd2:undefined);}if(Object[_0x19ddea(0x103)](_0x91427)['length']===0x0)throw new SDKError(ErrorCode[_0x19ddea(0xfb)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x4da896[_0x19ddea(0x129)]){console[_0x19ddea(0x125)](_0x19ddea(0x117)+_0x421d2d);for(const [_0x4121ce,_0x9131f1]of Object[_0x19ddea(0x124)](_0x91427)){_0x4121ce===_0x19ddea(0x11c)?console[_0x19ddea(0x125)]('\x20\x20'+_0x4121ce+':\x20'+_0x9131f1[_0x19ddea(0xae)](0x0,0x32)+_0x19ddea(0x139)):console[_0x19ddea(0x125)]('\x20\x20'+_0x4121ce+':\x20'+_0x9131f1);}}const _0x321c99=await withSpinner(_0x19ddea(0x10f),()=>_0x5ca884[_0x19ddea(0xcc)][_0x19ddea(0x11a)](_0x421d2d,_0x91427),{'verbose':_0x4da896[_0x19ddea(0x129)]});return console['error'](_0x19ddea(0x118)+_0x321c99[_0x19ddea(0xeb)][_0x19ddea(0xf0)]),await handleSingleObjectOutput(_0x321c99['data'],_0x4da896),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0xaf);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x13c);[a34_0x554f9a(0xea)](_0x5f0e34){const _0x36cc6d=a34_0x554f9a,_0x2d9f2b=_0x5f0e34[_0x36cc6d(0xb8)][0x0];if(!_0x2d9f2b)return _0x36cc6d(0xb9);return undefined;}async[a34_0x554f9a(0xd2)](_0x415173){const _0x506e38=a34_0x554f9a,{options:_0x247a2a,args:_0x2eb40a,tdx:_0x1448aa}=_0x415173,_0x198fbc=_0x2eb40a[0x0];if(!_0x247a2a[_0x506e38(0x113)]){const _0x231b22=await confirm(_0x506e38(0x12e)+_0x198fbc+'\x22?');if(!_0x231b22)return console['error'](_0x506e38(0xc3)),0x0;}const _0x983c5b=await withSpinner('Deleting\x20schedule...',()=>_0x1448aa['schedules'][_0x506e38(0x106)](_0x198fbc),{'verbose':_0x247a2a[_0x506e38(0x129)]});return console[_0x506e38(0x125)]('Schedule\x20deleted:\x20'+_0x983c5b[_0x506e38(0xeb)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a34_0x554f9a(0x110);[a34_0x554f9a(0x134)]='Run\x20a\x20scheduled\x20query\x20immediately';['validate'](_0x3b8f18){const _0x38aacd=a34_0x554f9a,_0x3c4a56=_0x3b8f18[_0x38aacd(0xb8)][0x0];if(!_0x3c4a56)return _0x38aacd(0xe5);return undefined;}async['execute'](_0x2b8c10){const _0x2781be=a34_0x554f9a,{options:_0x281261,args:_0x45c14a,tdx:_0x480a4e}=_0x2b8c10,_0x54c9e8=_0x45c14a[0x0],_0x2e65bf=_0x281261,_0x36f8b3=_0x2e65bf[_0x2781be(0xfc)],_0x23cc70=_0x2e65bf['num']!==undefined?Number(_0x2e65bf[_0x2781be(0xfd)]):undefined;if(_0x281261[_0x2781be(0x129)]){console['error'](_0x2781be(0x12a)+_0x54c9e8);if(_0x36f8b3)console[_0x2781be(0x125)]('\x20\x20Time:\x20'+_0x36f8b3);if(_0x23cc70)console[_0x2781be(0x125)](_0x2781be(0x109)+_0x23cc70);}const _0x4a90c2=await withSpinner(_0x2781be(0x13b),()=>_0x480a4e[_0x2781be(0xcc)][_0x2781be(0xb2)](_0x54c9e8,{'time':_0x36f8b3,'num':_0x23cc70}),{'verbose':_0x281261[_0x2781be(0x129)]}),_0x1ac1e4=_0x4a90c2[_0x2781be(0xeb)][_0x2781be(0xb6)];console[_0x2781be(0x125)]('Schedule\x20run\x20submitted:\x20'+_0x1ac1e4[_0x2781be(0x12d)]+_0x2781be(0xdd)+(_0x1ac1e4['length']!==0x1?'s':'')+'\x20created');for(const _0x44ffad of _0x1ac1e4){console['error'](_0x2781be(0xbf)+_0x44ffad[_0x2781be(0xbc)]);}return await handleSDKOutput(_0x1ac1e4,_0x281261),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x11b);['description']='Show\x20schedule\x20execution\x20history';[a34_0x554f9a(0xea)](_0x424a7b){const _0x2d4b49=_0x424a7b['args'][0x0];if(!_0x2d4b49)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a34_0x554f9a(0xd2)](_0x45c565){const _0x4d6f4f=a34_0x554f9a,{options:_0x5c48bd,args:_0x44f3c8,tdx:_0x1606ab}=_0x45c565,_0x122f90=_0x44f3c8[0x0],_0x3588c2=_0x5c48bd,_0x4080e0=_0x3588c2['from']!==undefined?Number(_0x3588c2[_0x4d6f4f(0xf5)]):undefined,_0x38c4b7=_0x3588c2['to']!==undefined?Number(_0x3588c2['to']):undefined,_0x555943=await withSpinner('Getting\x20schedule\x20history...',()=>_0x1606ab[_0x4d6f4f(0xcc)]['history'](_0x122f90,{'from':_0x4080e0,'to':_0x38c4b7}),{'verbose':_0x5c48bd[_0x4d6f4f(0x129)]}),_0x6b26dc=_0x555943[_0x4d6f4f(0xeb)];console['error'](_0x4d6f4f(0xf1)+_0x6b26dc['count']+_0x4d6f4f(0xb7)+(_0x6b26dc[_0x4d6f4f(0xdf)]!==0x1?'s':'')+_0x4d6f4f(0xed)+_0x6b26dc['from']+'-'+_0x6b26dc['to']+')');const _0x2fb638=_0x6b26dc[_0x4d6f4f(0xf3)]['map'](_0x1b8549=>({'job_id':_0x1b8549[_0x4d6f4f(0xbc)],'type':_0x1b8549['type'],'status':_0x1b8549[_0x4d6f4f(0x112)],'scheduled_at':_0x1b8549['scheduled_at'],'created_at':_0x1b8549[_0x4d6f4f(0xda)],'start_at':_0x1b8549[_0x4d6f4f(0xe3)],'end_at':_0x1b8549[_0x4d6f4f(0xec)]}));return await handleSDKOutput(_0x2fb638,_0x5c48bd),0x0;}}function a34_0x4b72(){const _0x3226ec=['7212HwvSxn','job_id','\x20\x20→\x20','queryUrl','\x20\x20Job\x20ID:\x20','1234UwMuEZ','executing_user_id','result','Cancelled','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','\x20\x20Cron:\x20','output','engine_version','database','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','abs','dim','schedules','user_name','\x20matching\x20\x22','timezone','5151111XVErhv','\x20schedules','execute','table','round','green','tsv','976tiThUl','last_job','134019XrnNAX','created_at','\x20scheduled\x20quer','180CIEjCb','\x20job','soon','count','priority','retryLimit','utf-8','start_at','Query\x20file\x20is\x20empty','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','map','cron','retry_limit','success','validate','data','end_at','\x20(showing\x20','Schedule\x20created:\x20','in\x20','name','Found\x20','nextRun','history','h\x20ago','from','schedule:list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20\x20Timezone:\x20','Creating\x20schedule...','create','INVALID_ARGUMENT','time','num','just\x20now','time_zone','schedule:update','trino','engineVersion','keys','listQueries','ies','delete','join','No\x20scheduled\x20queries\x20found','\x20\x20Num:\x20','delay','507XAxePB','padEnd','jsonl','statusIcon','Updating\x20schedule...','schedule:run','next_run_at','status','yes','Update\x20a\x20scheduled\x20query','format','3600444kKGrqM','Updating\x20schedule:\x20','Schedule\x20updated:\x20','show','update','schedule:history','query','d\x20ago','(unnamed)','Show\x20schedule\x20details','site','Listing\x20scheduled\x20queries...','trim','Failed\x20to\x20read\x20file:\x20','entries','error','schedule:show','max','log','verbose','Running\x20schedule:\x20','json','📅\x20','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','\x20(use\x20--limit\x20to\x20see\x20more)','1476690YzHBql','limit','type','Searching\x20scheduled\x20queries\x20matching\x20\x22','description','/app/queries/editor?queryId=','Creating\x20schedule:\x20','schedule:create','List\x20scheduled\x20queries','...','toLocaleDateString','Running\x20schedule...','Delete\x20a\x20scheduled\x20query','substring','schedule:delete','updated_at','4146264kTPmzC','run','pagination','file','lastRun','jobs','\x20execution','args','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','options'];a34_0x4b72=function(){return _0x3226ec;};return a34_0x4b72();}
|
|
@@ -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_0x3e5dea=a35_0x42a2;(function(_0x2d8c67,_0x2c25e9){const _0x4e18ff=a35_0x42a2,_0x56ba42=_0x2d8c67();while(!![]){try{const _0x456170=parseInt(_0x4e18ff(0x118))/0x1*(-parseInt(_0x4e18ff(0x12a))/0x2)+parseInt(_0x4e18ff(0xc1))/0x3*(parseInt(_0x4e18ff(0x121))/0x4)+-parseInt(_0x4e18ff(0x10e))/0x5+-parseInt(_0x4e18ff(0x96))/0x6+-parseInt(_0x4e18ff(0x111))/0x7*(-parseInt(_0x4e18ff(0xb5))/0x8)+-parseInt(_0x4e18ff(0xe3))/0x9+parseInt(_0x4e18ff(0x11f))/0xa;if(_0x456170===_0x2c25e9)break;else _0x56ba42['push'](_0x56ba42['shift']());}catch(_0x295650){_0x56ba42['push'](_0x56ba42['shift']());}}}(a35_0x49ff,0x719f6));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x135643 from'chalk';async function resolveSegmentTarget(_0x42286c,_0x1c5c68,_0x8e1ef7){const _0x3564f5=a35_0x42a2;if(isYamlFilePath(_0x42286c))try{const _0x197ae0=await resolveYamlFilePath(_0x42286c);return _0x8e1ef7&&(console[_0x3564f5(0x122)](_0x3564f5(0xcd)+_0x42286c),console[_0x3564f5(0x122)]('\x20\x20Parent\x20segment:\x20'+_0x197ae0[_0x3564f5(0xd4)]),console[_0x3564f5(0x122)](_0x3564f5(0x11a)+_0x197ae0[_0x3564f5(0x9e)]),console[_0x3564f5(0x122)](_0x3564f5(0xb7)+(_0x197ae0['folderPath']||_0x3564f5(0xfc))),console[_0x3564f5(0x122)](_0x3564f5(0x95)+_0x197ae0['fullPath'])),_0x197ae0[_0x3564f5(0x124)];}catch(_0x398054){throw new SDKError(ErrorCode[_0x3564f5(0xd7)],_0x3564f5(0x12f)+_0x398054[_0x3564f5(0x8e)]);}if(!_0x1c5c68)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x1c5c68+'/'+_0x42286c;}function a35_0x42a2(_0x1665aa,_0x2d589a){_0x1665aa=_0x1665aa-0x8c;const _0x49ff3e=a35_0x49ff();let _0x42a2ff=_0x49ff3e[_0x1665aa];return _0x42a2ff;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0x100);['description']=a35_0x3e5dea(0x128);async[a35_0x3e5dea(0xe1)](_0x50a47){const _0x4f2149=a35_0x3e5dea,{options:_0x4b6a2f,args:_0x4bf9d2,tdx:_0x50cd5b}=_0x50a47,_0x29943c=_0x4bf9d2[0x0],_0x4b347c=!_0x29943c&&!!_0x4b6a2f[_0x4f2149(0xd4)],_0x18e0d4=_0x29943c||_0x4b6a2f[_0x4f2149(0xd4)];if(!_0x18e0d4)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x4f2149(0x125)),console[_0x4f2149(0x122)](_0x4f2149(0xad)),console['error'](_0x4f2149(0x8f)),console[_0x4f2149(0x122)](_0x4f2149(0xc3)),console[_0x4f2149(0x122)](_0x4f2149(0x104)),console['error'](_0x4f2149(0xd3)),0x1;try{const _0x61862=_0x4b6a2f['segmentPath'];let _0x518b91=_0x18e0d4;!_0x4b347c&&_0x61862&&!_0x18e0d4['includes']('/')&&(_0x518b91=_0x61862+'/'+_0x18e0d4,_0x4b6a2f[_0x4f2149(0xe0)]&&console['error'](_0x4f2149(0xbc)+_0x518b91));const _0x1a8fec=await withSpinner('Resolving\x20path\x20\x27'+_0x518b91+'\x27...',()=>_0x50cd5b[_0x4f2149(0xd9)][_0x4f2149(0x9f)](_0x518b91),{'verbose':_0x4b6a2f['verbose']}),_0x3a7719=_0x1a8fec[_0x4f2149(0xea)];_0x4b6a2f[_0x4f2149(0xe0)]&&(console['error'](_0x4f2149(0x9d)+_0x3a7719[_0x4f2149(0x90)]),console[_0x4f2149(0x122)](_0x4f2149(0xff)+_0x3a7719[_0x4f2149(0xcb)]),_0x3a7719[_0x4f2149(0xf1)]&&console[_0x4f2149(0x122)](_0x4f2149(0x8c)+_0x3a7719[_0x4f2149(0xf1)]),_0x3a7719[_0x4f2149(0x109)]&&console[_0x4f2149(0x122)](_0x4f2149(0x91)+_0x3a7719['segmentId']));if(_0x3a7719[_0x4f2149(0x90)]==='parent'){const _0x33cb94=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x50cd5b[_0x4f2149(0xd9)]['getParent'](_0x3a7719[_0x4f2149(0xcb)]),{'verbose':_0x4b6a2f[_0x4f2149(0xe0)]});await handleSingleObjectOutput(_0x33cb94[_0x4f2149(0xea)],_0x4b6a2f);}else{if(_0x3a7719[_0x4f2149(0x90)]==='folder'){if(!_0x3a7719[_0x4f2149(0xf1)])throw new SDKError(ErrorCode[_0x4f2149(0x9b)],_0x4f2149(0xb2));const _0x1f374f=await withSpinner(_0x4f2149(0xa5),()=>_0x50cd5b[_0x4f2149(0xd9)][_0x4f2149(0x112)](_0x3a7719['folderId']),{'verbose':_0x4b6a2f[_0x4f2149(0xe0)]});await handleSingleObjectOutput(_0x1f374f[_0x4f2149(0xea)],_0x4b6a2f);}else{if(_0x3a7719[_0x4f2149(0x90)]==='segment'){if(!_0x3a7719[_0x4f2149(0x109)])throw new SDKError(ErrorCode[_0x4f2149(0xfd)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3bd4a1=await withSpinner('Fetching\x20segment\x20details...',()=>_0x50cd5b[_0x4f2149(0xd9)]['getSegment'](_0x3a7719[_0x4f2149(0xcb)],_0x3a7719[_0x4f2149(0x109)]),{'verbose':_0x4b6a2f[_0x4f2149(0xe0)]});await handleSingleObjectOutput(_0x3bd4a1[_0x4f2149(0xea)],_0x4b6a2f);}}}return 0x0;}catch(_0xbcf581){if(_0xbcf581 instanceof SDKError)return console[_0x4f2149(0x122)](_0x4f2149(0xd0)+_0xbcf581[_0x4f2149(0x8e)]),_0xbcf581[_0x4f2149(0x107)]&&console[_0x4f2149(0x122)](_0x4f2149(0xce)+_0xbcf581[_0x4f2149(0x107)]),0x1;throw _0xbcf581;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xa9);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0x126);async['execute'](_0x28bf08){const _0x28c164=a35_0x3e5dea,{options:_0x5e360c,args:_0x2c5c6e,tdx:_0x589c78}=_0x28bf08,_0x13d4c6=_0x2c5c6e[0x0];if(!_0x13d4c6)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x28c164(0x122)](_0x28c164(0xdd)),console[_0x28c164(0x122)](_0x28c164(0xf6)),console['error'](_0x28c164(0xad)),console[_0x28c164(0x122)](_0x28c164(0xd5)),console[_0x28c164(0x122)](_0x28c164(0x106)),0x1;try{const _0x23c2b6=_0x5e360c[_0x28c164(0xd4)],_0x17513e=await resolveSegmentTarget(_0x13d4c6,_0x23c2b6,_0x5e360c[_0x28c164(0xe0)]);_0x5e360c['verbose']&&console[_0x28c164(0x122)](_0x28c164(0x123)+_0x17513e);const _0x8f910c=await withSpinner(_0x28c164(0xc8)+_0x13d4c6+'\x27...',()=>_0x589c78[_0x28c164(0xd9)][_0x28c164(0x9f)](_0x17513e),{'verbose':_0x5e360c['verbose']}),_0x55366a=_0x8f910c[_0x28c164(0xea)];_0x5e360c[_0x28c164(0xe0)]&&(console[_0x28c164(0x122)](_0x28c164(0x9d)+_0x55366a[_0x28c164(0x90)]),console[_0x28c164(0x122)](_0x28c164(0xff)+_0x55366a[_0x28c164(0xcb)]));if(_0x55366a[_0x28c164(0x90)]===_0x28c164(0x10a))return console[_0x28c164(0x122)](_0x28c164(0xe5)),console[_0x28c164(0x122)](_0x28c164(0xbe)),0x1;if(_0x55366a[_0x28c164(0x90)]===_0x28c164(0x12e))return console['error'](_0x28c164(0xb0)),console[_0x28c164(0x122)](_0x28c164(0x101)),0x1;if(!_0x55366a[_0x28c164(0x109)])throw new SDKError(ErrorCode[_0x28c164(0xfd)],_0x28c164(0xf0));const _0xd24942=await withSpinner(_0x28c164(0x10f),()=>_0x589c78[_0x28c164(0xd9)]['getSegmentSQL'](_0x55366a['parentId'],_0x55366a[_0x28c164(0x109)]),{'verbose':_0x5e360c[_0x28c164(0xe0)]});let _0x135276=_0xd24942[_0x28c164(0xea)];const _0x312da4=resolveLimit(_0x5e360c[_0x28c164(0x113)],DEFAULT_DISPLAY_LIMIT),_0x10ce16=/\bLIMIT\s+\d+/i[_0x28c164(0xed)](_0x135276);!_0x10ce16&&(_0x135276=_0x135276[_0x28c164(0x119)]()['replace'](/;+$/,''),_0x135276=_0x28c164(0x103)+_0x135276+_0x28c164(0x11e)+_0x312da4);_0x5e360c[_0x28c164(0xe0)]&&console[_0x28c164(0x122)](_0x28c164(0xc9)+_0x135276);const _0x214b63=await withProgressSpinner(_0x28c164(0xfe),async _0x30079e=>{const _0x573661=_0x28c164,_0x472742=await _0x589c78['query'][_0x573661(0xe1)](_0x135276,{'catalog':'td','schema':_0x573661(0x99),'onJobId':_0x2ad46e=>{const _0x3a81fd=_0x573661;_0x30079e[_0x3a81fd(0x10d)](_0x2ad46e);}});return _0x472742;},{'verbose':_0x5e360c[_0x28c164(0xe0)]}),_0x1a3954=_0x214b63[_0x28c164(0xea)],_0x106b4c=_0x1a3954[_0x28c164(0x130)]?_0x28c164(0xe4)+_0x1a3954[_0x28c164(0x130)]+']':'';return console[_0x28c164(0x122)](_0x28c164(0xdb)+_0x1a3954[_0x28c164(0xb8)]['processedRows']['toLocaleString']()+_0x28c164(0xba)+(_0x28c164(0xd6)+formatElapsed(_0x1a3954['stats'][_0x28c164(0x102)])+_0x106b4c)),await handleQueryOutput(_0x1a3954,_0x5e360c),0x0;}catch(_0x1aa3d9){if(_0x1aa3d9 instanceof SDKError)return console[_0x28c164(0x122)]('✖\x20Query\x20failed\x20['+_0x1aa3d9[_0x28c164(0xf3)]+']'),console[_0x28c164(0x122)]('\x0a'+_0x1aa3d9['message']),0x1;throw _0x1aa3d9;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xf9);[a35_0x3e5dea(0x129)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a35_0x3e5dea(0xe1)](_0x7c2525){const _0x291860=a35_0x3e5dea,{options:_0x54f687,args:_0x437c64,tdx:_0x1d17eb}=_0x7c2525;if(_0x437c64['length']===0x0)return console[_0x291860(0x122)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x291860(0x122)](_0x291860(0x10c)),0x1;const _0x3070fb=_0x437c64[0x0];try{_0x54f687[_0x291860(0xe0)]&&(console[_0x291860(0x122)](_0x291860(0xd8)+_0x54f687[_0x291860(0xa1)]),console[_0x291860(0x122)]('Parent\x20name:\x20'+_0x3070fb));const _0x33e5ed=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3070fb+_0x291860(0xe9),()=>_0x1d17eb['segment']['resolveParentId'](_0x3070fb),{'verbose':_0x54f687['verbose']}),_0x197608=_0x33e5ed[_0x291860(0xea)];_0x54f687[_0x291860(0xe0)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x197608);const _0x1955e9=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x3070fb+'\x27...',()=>_0x1d17eb[_0x291860(0xd9)][_0x291860(0xfa)](_0x197608),{'verbose':_0x54f687[_0x291860(0xe0)]}),_0xd6001=_0x1955e9[_0x291860(0xea)];return console[_0x291860(0x122)](_0x291860(0x93)+_0xd6001[_0x291860(0xaf)]+_0x291860(0x116)+(_0xd6001['length']!==0x1?'s':'')),await handleSDKOutput(_0xd6001,_0x54f687),0x0;}catch(_0x45b8dd){if(_0x45b8dd instanceof SDKError)return console['error'](_0x291860(0xd0)+_0x45b8dd['message']),_0x45b8dd[_0x291860(0x107)]&&console['error']('\x20\x20Cause:\x20'+_0x45b8dd['cause']),0x1;throw _0x45b8dd;}}}function a35_0x49ff(){const _0x9aa8b=['listFolders','resolveParentId','(root)','SEGMENT_NOT_FOUND','Executing\x20segment\x20query...','Parent\x20ID:\x20','segment:describe','Use:\x20tdx\x20ps\x20show','elapsedTimeMillis','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','cause','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segmentId','folder','content','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','setJobId','4192940RceeGm','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','14aZnRmC','getFolder','limit','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Resolved\x20parent\x20ID:\x20','\x20folder','createFolder','85413bVtCJA','trim','\x20\x20Segment\x20name:\x20','url','/app/ps/','Parent\x20name:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','21062580NbHcuh','green','438004xvanSh','error','Target\x20path:\x20','fullPath','Usage:\x20tdx\x20segment\x20describe\x20<path>','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20segment\x20\x27','Show\x20segment\x20or\x20folder\x20details','description','2seDgqz','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20sg\x20desc\x20<name>','/e/','parent','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jobId','Folder\x20ID:\x20','resolveFolderId','message','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','type','Segment\x20ID:\x20','Parent\x20segment:\x20','✔\x20Found\x20','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Full\x20path:\x20','5356350nmghEK','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','information_schema','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','SEGMENT_FOLDER_NOT_FOUND','segment:sql','Resolved\x20type:\x20','segmentName','resolvePathToResource','Resolving\x20folder\x20\x27','site','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20segment\x20details...','\x20Opening\x20','Fetching\x20folder\x20details...','name','\x27\x20with\x20ID:\x20','✔\x20Created\x20folder\x20\x27','segment:show','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','format','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Examples:','Use:\x20tdx\x20ps\x20desc','length','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:folder:show','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Create\x20segment\x20folder\x20for\x20organization','segment:desc','1052000wbQImT','getSegment','\x20\x20Folder\x20path:\x20','stats','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20rows\x20','getSQLFromYamlFile','Resolved\x20relative\x20path\x20to:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','getSQLFromServerSegment','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','12kdChtJ','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Options:','Use:\x20tdx\x20ps\x20view\x20-w','red','Resolving\x20\x27','SQL\x20query:\x0a','getSegmentSQL','parentId','segment:view','Resolved\x20YAML\x20file:\x20','\x20\x20Cause:\x20','cyan','Error:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','jsonl','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','in\x20','INVALID_ARGUMENT','Site:\x20','segment','Show\x20child\x20segment\x20schema\x20(column\x20types)','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Resolved:\x20','verbose','execute','Folder\x20name:\x20','4726242dYxstT','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x27...','data','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','test','getSegmentSQLFromYaml','Usage:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folderId','web','code','parentFolder','Resolved\x20folder\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20--path\x20','segment:folder:list'];a35_0x49ff=function(){return _0x9aa8b;};return a35_0x49ff();}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xb1);[a35_0x3e5dea(0x129)]='Show\x20segment\x20folder\x20details';async[a35_0x3e5dea(0xe1)](_0x1f760a){const _0x17224d=a35_0x3e5dea,{options:_0x2eddfa,args:_0x5e51cf,tdx:_0xdca224}=_0x1f760a;if(_0x5e51cf[_0x17224d(0xaf)]===0x0)return console[_0x17224d(0x122)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x17224d(0x122)](_0x17224d(0x108)),0x1;try{const {parentId:_0x3dd6e0,childId:_0x598db0}=parseSegmentRef(_0x5e51cf[0x0]);_0x2eddfa[_0x17224d(0xe0)]&&(console[_0x17224d(0x122)](_0x17224d(0xd8)+_0x2eddfa[_0x17224d(0xa1)]),console[_0x17224d(0x122)](_0x17224d(0x11d)+_0x3dd6e0),_0x598db0&&console[_0x17224d(0x122)](_0x17224d(0xe2)+_0x598db0));if(!_0x598db0)return console[_0x17224d(0x122)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x97bddd=await withSpinner(_0x17224d(0x127)+_0x3dd6e0+_0x17224d(0xe9),()=>_0xdca224[_0x17224d(0xd9)]['resolveParentId'](_0x3dd6e0),{'verbose':_0x2eddfa[_0x17224d(0xe0)]}),_0x4cbe91=_0x97bddd['data'];_0x2eddfa[_0x17224d(0xe0)]&&console['error'](_0x17224d(0x115)+_0x4cbe91);const _0x1e0688=await withSpinner(_0x17224d(0xa0)+_0x598db0+_0x17224d(0xe9),()=>_0xdca224[_0x17224d(0xd9)][_0x17224d(0x8d)](_0x4cbe91,_0x598db0),{'verbose':_0x2eddfa[_0x17224d(0xe0)]}),_0x2b56f0=_0x1e0688[_0x17224d(0xea)];_0x2eddfa['verbose']&&console[_0x17224d(0x122)](_0x17224d(0xf5)+_0x2b56f0);const _0x2ac603=await withSpinner(_0x17224d(0xdc)+_0x598db0+'\x27...',()=>_0xdca224[_0x17224d(0xd9)][_0x17224d(0x112)](_0x2b56f0),{'verbose':_0x2eddfa[_0x17224d(0xe0)]});return await handleSDKOutput([_0x2ac603[_0x17224d(0xea)]],_0x2eddfa),0x0;}catch(_0x5374fa){if(_0x5374fa instanceof SDKError)return console[_0x17224d(0x122)](_0x17224d(0xd0)+_0x5374fa[_0x17224d(0x8e)]),_0x5374fa[_0x17224d(0x107)]&&console[_0x17224d(0x122)](_0x17224d(0xce)+_0x5374fa[_0x17224d(0x107)]),0x1;throw _0x5374fa;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0x9c);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0x105);async['execute'](_0x485c86){const _0x25eb62=a35_0x3e5dea,{options:_0x5d56a5,args:_0x1f11dd}=_0x485c86,_0x2a3ba9=_0x5d56a5,_0xcdee49=_0x2a3ba9['path'],_0x485734=_0x1f11dd[0x0];if(!_0x485734&&!_0xcdee49)return console['error'](a35_0x135643[_0x25eb62(0xc7)](_0x25eb62(0xf7))),console[_0x25eb62(0x122)](_0x25eb62(0xef)),console['error'](_0x25eb62(0xec)),console['error'](_0x25eb62(0x94)),console[_0x25eb62(0x122)](_0x25eb62(0xad)),console[_0x25eb62(0x122)](_0x25eb62(0xde)),console['error'](_0x25eb62(0x114)),0x1;if(_0x485734&&_0xcdee49)return console[_0x25eb62(0x122)](a35_0x135643['red'](_0x25eb62(0xc0))),0x1;try{let _0x14f1fc;if(_0xcdee49)_0x14f1fc=await this[_0x25eb62(0xbb)](_0xcdee49,_0x485c86);else{if(isYamlFilePath(_0x485734))return console[_0x25eb62(0x122)](a35_0x135643['red'](_0x25eb62(0xe7))),console[_0x25eb62(0x122)](_0x25eb62(0xf8)+_0x485734),0x1;else _0x14f1fc=await this[_0x25eb62(0xbf)](_0x485734,_0x485c86);}return _0x5d56a5[_0x25eb62(0xab)]==='json'||_0x5d56a5[_0x25eb62(0xab)]===_0x25eb62(0xd2)?await handleSDKOutput([{'sql':_0x14f1fc}],_0x5d56a5):console['log'](_0x14f1fc),0x0;}catch(_0x5147f7){if(_0x5147f7 instanceof SDKError)return console[_0x25eb62(0x122)]('Error:\x20'+_0x5147f7[_0x25eb62(0x8e)]),_0x5147f7[_0x25eb62(0x107)]&&console['error'](_0x25eb62(0xce)+_0x5147f7['cause']),0x1;throw _0x5147f7;}}async[a35_0x3e5dea(0xbb)](_0x422814,_0x2a1c86){const _0x2baf55=a35_0x3e5dea,{options:_0xd04aca,tdx:_0x377aa2}=_0x2a1c86;let _0x48525c;try{_0x48525c=await resolveYamlFilePath(_0x422814);}catch(_0x4b88ec){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2baf55(0x12f)+_0x4b88ec[_0x2baf55(0x8e)]);}_0xd04aca[_0x2baf55(0xe0)]&&console[_0x2baf55(0x122)](_0x2baf55(0xdf)+_0x48525c['parentSegment']+'/'+_0x48525c['segmentName']);const _0x57fa99=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x377aa2['segment'][_0x2baf55(0xee)](_0x48525c[_0x2baf55(0x10b)],_0x48525c[_0x2baf55(0xd4)],_0x48525c['segmentName']),{'verbose':_0xd04aca['verbose']});return _0x57fa99[_0x2baf55(0xea)];}async['getSQLFromServerSegment'](_0x3892f0,_0x451e2a){const _0x4fc67a=a35_0x3e5dea,{options:_0x5d50a4,tdx:_0x2b9dbc}=_0x451e2a,_0x27fe12=_0x5d50a4[_0x4fc67a(0xd4)],_0x22e9dd=await resolveSegmentTarget(_0x3892f0,_0x27fe12,_0x5d50a4['verbose']);_0x5d50a4[_0x4fc67a(0xe0)]&&console[_0x4fc67a(0x122)](_0x4fc67a(0x123)+_0x22e9dd);const _0x2c61c8=await withSpinner(_0x4fc67a(0xc8)+_0x3892f0+_0x4fc67a(0xe9),()=>_0x2b9dbc[_0x4fc67a(0xd9)][_0x4fc67a(0x9f)](_0x22e9dd),{'verbose':_0x5d50a4['verbose']}),_0x384b48=_0x2c61c8[_0x4fc67a(0xea)];_0x5d50a4['verbose']&&(console['error'](_0x4fc67a(0x9d)+_0x384b48[_0x4fc67a(0x90)]),console['error'](_0x4fc67a(0xff)+_0x384b48[_0x4fc67a(0xcb)]));if(_0x384b48[_0x4fc67a(0x90)]===_0x4fc67a(0x10a))throw new SDKError(ErrorCode[_0x4fc67a(0xd7)],_0x4fc67a(0xa2));if(_0x384b48[_0x4fc67a(0x90)]==='parent')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x384b48[_0x4fc67a(0x109)])throw new SDKError(ErrorCode[_0x4fc67a(0xfd)],_0x4fc67a(0xf0));const _0x357fbc=await withSpinner(_0x4fc67a(0x10f),()=>_0x2b9dbc[_0x4fc67a(0xd9)][_0x4fc67a(0xca)](_0x384b48[_0x4fc67a(0xcb)],_0x384b48[_0x4fc67a(0x109)]),{'verbose':_0x5d50a4['verbose']});return _0x357fbc[_0x4fc67a(0xea)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]='segment:folder:create';[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0xb3);async[a35_0x3e5dea(0xe1)](_0x2c4066){const _0x10c7d5=a35_0x3e5dea,{options:_0x3a3419,args:_0x2a9c6a,tdx:_0x33b8e3}=_0x2c4066,_0x5ba638=_0x3a3419;if(_0x2a9c6a[_0x10c7d5(0xaf)]<0x2)return console['error'](_0x10c7d5(0xac)),console['error'](_0x10c7d5(0x110)),0x1;const _0x23fcb4=_0x2a9c6a[0x0],_0x426b17=_0x2a9c6a[0x1];_0x5ba638[_0x10c7d5(0xe0)]&&(console[_0x10c7d5(0x122)]('Site:\x20'+_0x5ba638[_0x10c7d5(0xa1)]),console[_0x10c7d5(0x122)](_0x10c7d5(0x92)+_0x23fcb4),console[_0x10c7d5(0x122)](_0x10c7d5(0xe2)+_0x426b17));let _0x354fd8;if(_0x5ba638[_0x10c7d5(0xf4)]){const _0x841676=_0x5ba638[_0x10c7d5(0xf4)],_0x46b68d=await withSpinner(_0x10c7d5(0x127)+_0x23fcb4+_0x10c7d5(0xe9),()=>_0x33b8e3[_0x10c7d5(0xd9)][_0x10c7d5(0xfb)](_0x23fcb4),{'verbose':_0x5ba638[_0x10c7d5(0xe0)]}),_0x54a4de=_0x46b68d[_0x10c7d5(0xea)],_0x435991=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x841676+_0x10c7d5(0xe9),()=>_0x33b8e3[_0x10c7d5(0xd9)][_0x10c7d5(0x8d)](_0x54a4de,_0x841676),{'verbose':_0x5ba638[_0x10c7d5(0xe0)]});_0x354fd8=_0x435991[_0x10c7d5(0xea)],_0x5ba638[_0x10c7d5(0xe0)]&&console[_0x10c7d5(0x122)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x354fd8);}const _0x20f1b3={'name':_0x426b17,'description':_0x5ba638[_0x10c7d5(0x129)],'parentFolderId':_0x354fd8},_0x5c2d32=await withSpinner('Creating\x20folder\x20\x27'+_0x426b17+_0x10c7d5(0xe9),()=>_0x33b8e3[_0x10c7d5(0xd9)][_0x10c7d5(0x117)](_0x23fcb4,_0x20f1b3),{'verbose':_0x5ba638[_0x10c7d5(0xe0)]}),_0x26bbb8=_0x5c2d32[_0x10c7d5(0xea)];return console[_0x10c7d5(0x122)](_0x10c7d5(0xa8)+_0x26bbb8[_0x10c7d5(0xa6)]+_0x10c7d5(0xa7)+_0x26bbb8['id']),await handleSDKOutput([_0x26bbb8],_0x5ba638),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xcc);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0xbd);async[a35_0x3e5dea(0xe1)](_0x4ec440){const _0x2cb060=a35_0x3e5dea,{options:_0x47d200,args:_0xc22053,tdx:_0x6601ce}=_0x4ec440,_0x3e2561=_0xc22053[0x0];if(!_0x3e2561)return console[_0x2cb060(0x122)](_0x2cb060(0x98)),console[_0x2cb060(0x122)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x2cb060(0x122)](_0x2cb060(0xc4)),console['error'](_0x2cb060(0xc5)),console[_0x2cb060(0x122)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x2cb060(0x122)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x2cb060(0x12b)),console['error'](_0x2cb060(0xb9)),0x1;try{const _0x2c6536=_0x47d200[_0x2cb060(0xd4)],_0x263a71=await resolveSegmentTarget(_0x3e2561,_0x2c6536,_0x47d200[_0x2cb060(0xe0)]);_0x47d200[_0x2cb060(0xe0)]&&console[_0x2cb060(0x122)](_0x2cb060(0x123)+_0x263a71);const _0x333d7b=await withSpinner(_0x2cb060(0xc8)+_0x3e2561+'\x27...',()=>_0x6601ce[_0x2cb060(0xd9)][_0x2cb060(0x9f)](_0x263a71),{'verbose':_0x47d200[_0x2cb060(0xe0)]}),_0x34e1c0=_0x333d7b[_0x2cb060(0xea)];_0x47d200['verbose']&&(console[_0x2cb060(0x122)](_0x2cb060(0x9d)+_0x34e1c0[_0x2cb060(0x90)]),console[_0x2cb060(0x122)]('Parent\x20ID:\x20'+_0x34e1c0[_0x2cb060(0xcb)]),_0x34e1c0[_0x2cb060(0xf1)]&&console['error']('Folder\x20ID:\x20'+_0x34e1c0[_0x2cb060(0xf1)]),_0x34e1c0[_0x2cb060(0x109)]&&console[_0x2cb060(0x122)](_0x2cb060(0x91)+_0x34e1c0[_0x2cb060(0x109)]));if(_0x47d200[_0x2cb060(0xf2)]){if(_0x34e1c0[_0x2cb060(0x90)]==='folder')return console['error']('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x34e1c0[_0x2cb060(0x90)]==='parent')return console[_0x2cb060(0x122)](_0x2cb060(0xc2)),console[_0x2cb060(0x122)](_0x2cb060(0xc6)),0x1;if(!_0x34e1c0[_0x2cb060(0x109)])throw new SDKError(ErrorCode[_0x2cb060(0xfd)],_0x2cb060(0xf0));const _0x31410f=getConsoleNextUrl(_0x47d200[_0x2cb060(0xa1)],_0x2cb060(0x11c)+_0x34e1c0[_0x2cb060(0xcb)]+'/e/'+_0x34e1c0[_0x2cb060(0x109)]);return console[_0x2cb060(0x122)](a35_0x135643[_0x2cb060(0x120)]('✔')+_0x2cb060(0xa4)+a35_0x135643[_0x2cb060(0xcf)](_0x31410f)),openBrowser(_0x31410f),0x0;}if(_0x34e1c0[_0x2cb060(0x90)]===_0x2cb060(0x10a)){if(!_0x34e1c0['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x2cb060(0xb2));const _0x3bbc57=await withSpinner(_0x2cb060(0xa5),()=>_0x6601ce[_0x2cb060(0xd9)]['getFolder'](_0x34e1c0[_0x2cb060(0xf1)]),{'verbose':_0x47d200[_0x2cb060(0xe0)]});await handleSingleObjectOutput(_0x3bbc57['data'],_0x47d200);}else{if(_0x34e1c0[_0x2cb060(0x90)]===_0x2cb060(0xd9)){if(!_0x34e1c0[_0x2cb060(0x109)])throw new SDKError(ErrorCode[_0x2cb060(0xfd)],_0x2cb060(0xf0));const _0x318892=await withSpinner(_0x2cb060(0xa3),()=>_0x6601ce[_0x2cb060(0xd9)][_0x2cb060(0xb6)](_0x34e1c0[_0x2cb060(0xcb)],_0x34e1c0['segmentId']),{'verbose':_0x47d200['verbose']}),_0x5d6679=getConsoleNextUrl(_0x47d200[_0x2cb060(0xa1)],'/app/ps/'+_0x34e1c0['parentId']+_0x2cb060(0x12d)+_0x34e1c0['segmentId']),_0x30c028=_0x318892[_0x2cb060(0xea)];_0x30c028[_0x2cb060(0x11b)]=_0x5d6679,await handleSingleObjectOutput(_0x30c028,_0x47d200);}else return console[_0x2cb060(0x122)](_0x2cb060(0x97)),console[_0x2cb060(0x122)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0xcaf88e){if(_0xcaf88e instanceof SDKError)return console[_0x2cb060(0x122)]('Error:\x20'+_0xcaf88e[_0x2cb060(0x8e)]),_0xcaf88e[_0x2cb060(0x107)]&&console[_0x2cb060(0x122)](_0x2cb060(0xce)+_0xcaf88e['cause']),0x1;throw _0xcaf88e;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a35_0x3e5dea(0xb4);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0xda);async[a35_0x3e5dea(0xe1)](_0x1df76f){const _0x282e91=a35_0x3e5dea,{options:_0x2a16e2,args:_0x2a446f,tdx:_0x1cfcae}=_0x1df76f,_0x7ec67c=_0x2a446f[0x0];if(!_0x7ec67c)return console[_0x282e91(0x122)](_0x282e91(0xe8)),console[_0x282e91(0x122)](_0x282e91(0x12c)),console[_0x282e91(0x122)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x282e91(0x122)]('Examples:'),console[_0x282e91(0x122)](_0x282e91(0xe6)),console[_0x282e91(0x122)](_0x282e91(0xd1)),0x1;try{const _0x592504=_0x2a16e2['parentSegment'],_0x182385=await resolveSegmentTarget(_0x7ec67c,_0x592504,_0x2a16e2[_0x282e91(0xe0)]);_0x2a16e2[_0x282e91(0xe0)]&&console[_0x282e91(0x122)]('Target\x20path:\x20'+_0x182385);const _0x1a0477=await withSpinner(_0x282e91(0xc8)+_0x7ec67c+_0x282e91(0xe9),()=>_0x1cfcae[_0x282e91(0xd9)]['resolvePathToResource'](_0x182385),{'verbose':_0x2a16e2[_0x282e91(0xe0)]}),_0x359701=_0x1a0477['data'];_0x2a16e2['verbose']&&(console[_0x282e91(0x122)](_0x282e91(0x9d)+_0x359701[_0x282e91(0x90)]),console['error'](_0x282e91(0xff)+_0x359701['parentId']));if(_0x359701[_0x282e91(0x90)]==='folder')return console[_0x282e91(0x122)](_0x282e91(0xaa)),console[_0x282e91(0x122)](_0x282e91(0xeb)),0x1;if(_0x359701[_0x282e91(0x90)]===_0x282e91(0x12e))return console[_0x282e91(0x122)](_0x282e91(0x9a)),console['error'](_0x282e91(0xae)),0x1;if(!_0x359701[_0x282e91(0x109)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x282e91(0xf0));const _0x2aa01b=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1cfcae['segment']['getSegmentSQL'](_0x359701['parentId'],_0x359701[_0x282e91(0x109)]),{'verbose':_0x2a16e2[_0x282e91(0xe0)]}),_0x4f78f8=_0x2aa01b[_0x282e91(0xea)],_0x4e9f5c=await executeSchemaQuery(_0x4f78f8,_0x1cfcae,_0x2a16e2);return await handleQueryOutput(_0x4e9f5c,_0x2a16e2),0x0;}catch(_0x58c423){if(_0x58c423 instanceof SDKError)return console[_0x282e91(0x122)](_0x282e91(0xd0)+_0x58c423[_0x282e91(0x8e)]),_0x58c423[_0x282e91(0x107)]&&console['error'](_0x282e91(0xce)+_0x58c423[_0x282e91(0x107)]),0x1;throw _0x58c423;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x3ecc2b=a36_0x14a0;(function(_0x2d2895,_0x1bde66){const _0x1a7db5=a36_0x14a0,_0x1ceb5e=_0x2d2895();while(!![]){try{const _0x195ffb=-parseInt(_0x1a7db5(0x171))/0x1+-parseInt(_0x1a7db5(0x179))/0x2*(-parseInt(_0x1a7db5(0x16d))/0x3)+parseInt(_0x1a7db5(0x160))/0x4*(parseInt(_0x1a7db5(0x168))/0x5)+-parseInt(_0x1a7db5(0x170))/0x6+-parseInt(_0x1a7db5(0x183))/0x7+parseInt(_0x1a7db5(0x17e))/0x8*(-parseInt(_0x1a7db5(0x16a))/0x9)+parseInt(_0x1a7db5(0x17c))/0xa*(parseInt(_0x1a7db5(0x178))/0xb);if(_0x195ffb===_0x1bde66)break;else _0x1ceb5e['push'](_0x1ceb5e['shift']());}catch(_0x64b362){_0x1ceb5e['push'](_0x1ceb5e['shift']());}}}(a36_0x4226,0xd96ba));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x4226(){const _0x57476d=['Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','4420dxrKkR','description','6664VaeSkj','Site:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','includes','Target\x20path:\x20','2034641mNoeVv','noCountPopulation','parent','ruleFile','Parent:\x20','segments','Segment\x20name:\x20','execute','segment:create','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','createSegment','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segment','Parent\x20path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','error','folder','resolveFolderId','13548fQGIoD','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','verbose','resolvePathToResource','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','data','1210xkciPz','segmentPath','8118mMahjz','length','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','848313PwXLjv','name','kind','9045708JqfApu','154220DiCWWX','\x27...','type','resolveParentId','Resolved\x20folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','site','62018ZAFLkC','2qjADjp','Resolving\x20folder\x20\x27'];a36_0x4226=function(){return _0x57476d;};return a36_0x4226();}import{withSpinner}from'../utils/spinner.js';function a36_0x14a0(_0x3fb05a,_0x2397f3){_0x3fb05a=_0x3fb05a-0x150;const _0x4226bf=a36_0x4226();let _0x14a03b=_0x4226bf[_0x3fb05a];return _0x14a03b;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x41a530 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x3ecc2b(0x16e)]=a36_0x3ecc2b(0x156);[a36_0x3ecc2b(0x17d)]=a36_0x3ecc2b(0x161);async[a36_0x3ecc2b(0x155)](_0x3b0f77){const _0x36cf6a=a36_0x3ecc2b;console[_0x36cf6a(0x15d)](a36_0x41a530['yellow'](_0x36cf6a(0x180))),console[_0x36cf6a(0x15d)](a36_0x41a530['yellow'](_0x36cf6a(0x162)));const {options:_0x1ee8e2,args:_0x55393a,tdx:_0x18085a}=_0x3b0f77,_0x3c6748=_0x1ee8e2;if(_0x55393a['length']===0x0)return console[_0x36cf6a(0x15d)](_0x36cf6a(0x16c)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x166)),console['error']('Examples:'),console['error'](_0x36cf6a(0x165)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x15c)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x159)),0x1;const _0x519ac9=_0x55393a[0x0],_0x398fdf=_0x1ee8e2[_0x36cf6a(0x169)];let _0x394197=_0x519ac9;_0x398fdf&&!_0x519ac9[_0x36cf6a(0x181)]('/')&&(_0x394197=_0x398fdf+'/'+_0x519ac9,_0x3c6748[_0x36cf6a(0x163)]&&console[_0x36cf6a(0x15d)]('Resolved\x20relative\x20path\x20to:\x20'+_0x394197));const _0x3ef8e6=parsePath(_0x394197);if(_0x3ef8e6['segments'][_0x36cf6a(0x16b)]<0x2)return console[_0x36cf6a(0x15d)](_0x36cf6a(0x17b)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x157)),0x1;const _0x4db4bb=_0x3ef8e6[_0x36cf6a(0x153)][0x0],_0x4b4659=getBaseName(_0x394197),_0x47a36a=getParentPath(_0x394197);_0x3c6748[_0x36cf6a(0x163)]&&(console[_0x36cf6a(0x15d)](_0x36cf6a(0x17f)+_0x3c6748[_0x36cf6a(0x177)]),console[_0x36cf6a(0x15d)](_0x36cf6a(0x182)+_0x394197),console['error'](_0x36cf6a(0x152)+_0x4db4bb),console[_0x36cf6a(0x15d)](_0x36cf6a(0x154)+_0x4b4659),console[_0x36cf6a(0x15d)](_0x36cf6a(0x15b)+_0x47a36a));const _0x435fb2=await withSpinner(_0x36cf6a(0x176)+_0x4db4bb+_0x36cf6a(0x172),()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x174)](_0x4db4bb),{'verbose':_0x3c6748[_0x36cf6a(0x163)]}),_0x1e98f2=_0x435fb2[_0x36cf6a(0x167)];let _0x38a293;if(_0x3ef8e6[_0x36cf6a(0x153)]['length']>0x2){const _0x311403=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x47a36a+'\x27...',()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x164)](_0x47a36a),{'verbose':_0x3c6748['verbose']}),_0x23559f=_0x311403[_0x36cf6a(0x167)];if(_0x23559f['type']!==_0x36cf6a(0x15e)&&_0x23559f[_0x36cf6a(0x173)]!==_0x36cf6a(0x150))return console[_0x36cf6a(0x15d)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x38a293=_0x23559f['folderId'];}else{if(_0x3c6748[_0x36cf6a(0x15e)]){const _0x454586=await withSpinner(_0x36cf6a(0x17a)+_0x3c6748[_0x36cf6a(0x15e)]+_0x36cf6a(0x172),()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x15f)](_0x1e98f2,_0x3c6748[_0x36cf6a(0x15e)]),{'verbose':_0x3c6748[_0x36cf6a(0x163)]});_0x38a293=_0x454586[_0x36cf6a(0x167)];}}_0x3c6748['verbose']&&_0x38a293&&console['error'](_0x36cf6a(0x175)+_0x38a293);const _0x3b812a=await loadJSONFromOptions(_0x3c6748['rule'],_0x3c6748[_0x36cf6a(0x151)]),_0x4765fd={'name':_0x4b4659,'description':_0x3c6748[_0x36cf6a(0x17d)],'rule':_0x3b812a,'kind':_0x3c6748[_0x36cf6a(0x16f)]!==undefined?parseInt(_0x3c6748['kind'],0xa):undefined,'isVisible':_0x3c6748['invisible']?![]:undefined,'segmentFolderId':_0x38a293,'countPopulation':_0x3c6748[_0x36cf6a(0x184)]?![]:undefined},_0x2599ac=await withSpinner('Creating\x20segment\x20\x27'+_0x4b4659+_0x36cf6a(0x172),()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x158)](_0x1e98f2,_0x4765fd),{'verbose':_0x3c6748[_0x36cf6a(0x163)]}),_0x243d85=_0x2599ac[_0x36cf6a(0x167)];return console[_0x36cf6a(0x15d)]('✔\x20Created\x20segment\x20\x27'+_0x243d85[_0x36cf6a(0x16e)]+'\x27\x20with\x20ID:\x20'+_0x243d85['id']),_0x394197!==_0x519ac9&&console[_0x36cf6a(0x15d)]('\x20\x20\x20Path:\x20'+_0x394197),await handleSDKOutput([_0x243d85],_0x3c6748),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x4956d8=a37_0x4ef5;function a37_0x5c18(){const _0x41ff94=['1642YpeKuq','length','5952180MeUQLu','json','verbose','Parent\x20segment:\x20','7855299fpeCjX','1208ISBNjX','segment:fields','error','3681412EcPBPB','Site:\x20','✔\x20Found\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','1029963pQpxzs','7669914iIwGRm','listFields','name','jsonl','24QkGMCf','parentSegment','data','execute','description','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment','6473340rjZkOT'];a37_0x5c18=function(){return _0x41ff94;};return a37_0x5c18();}(function(_0x2072e5,_0x23f954){const _0x41b327=a37_0x4ef5,_0x3df2d0=_0x2072e5();while(!![]){try{const _0x15f20d=parseInt(_0x41b327(0x1c7))/0x1*(-parseInt(_0x41b327(0x1ce))/0x2)+-parseInt(_0x41b327(0x1d6))/0x3+parseInt(_0x41b327(0x1c9))/0x4+parseInt(_0x41b327(0x1c6))/0x5+-parseInt(_0x41b327(0x1d7))/0x6+-parseInt(_0x41b327(0x1d1))/0x7*(-parseInt(_0x41b327(0x1bf))/0x8)+-parseInt(_0x41b327(0x1cd))/0x9;if(_0x15f20d===_0x23f954)break;else _0x3df2d0['push'](_0x3df2d0['shift']());}catch(_0x2e3a54){_0x3df2d0['push'](_0x3df2d0['shift']());}}}(a37_0x5c18,0xd5702));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x4ef5(_0x4740c8,_0x5df4de){_0x4740c8=_0x4740c8-0x1bc;const _0x5c1873=a37_0x5c18();let _0x4ef5c4=_0x5c1873[_0x4740c8];return _0x4ef5c4;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x4956d8(0x1bd)]=a37_0x4956d8(0x1cf);[a37_0x4956d8(0x1c3)]='List\x20available\x20fields\x20for\x20segmentation';async[a37_0x4956d8(0x1c2)](_0xe0ce6e){const _0xf7a877=a37_0x4956d8,{options:_0x40d32c,args:_0x2f6944,tdx:_0x14fba6}=_0xe0ce6e,_0x17faae=_0x2f6944[0x0]||_0x40d32c[_0xf7a877(0x1c0)];if(!_0x17faae)return console[_0xf7a877(0x1d0)](_0xf7a877(0x1d4)),console['error'](_0xf7a877(0x1c4)),console[_0xf7a877(0x1d0)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x40d32c[_0xf7a877(0x1cb)]&&(console[_0xf7a877(0x1d0)](_0xf7a877(0x1d2)+_0x40d32c['site']),console[_0xf7a877(0x1d0)](_0xf7a877(0x1cc)+_0x17faae));const _0x572814=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x17faae+_0xf7a877(0x1d5),()=>_0x14fba6[_0xf7a877(0x1c5)][_0xf7a877(0x1bc)](_0x17faae),{'verbose':_0x40d32c[_0xf7a877(0x1cb)]}),_0x2dcd91=_0x572814[_0xf7a877(0x1c1)];console[_0xf7a877(0x1d0)](_0xf7a877(0x1d3)+_0x2dcd91[_0xf7a877(0x1c8)]+'\x20field'+(_0x2dcd91[_0xf7a877(0x1c8)]!==0x1?'s':''));if(_0x40d32c[_0xf7a877(0x1ca)]||_0x40d32c[_0xf7a877(0x1be)])return await handleSDKOutput(_0x2dcd91,_0x40d32c),0x0;return displayFieldsHumanReadable(_0x2dcd91,_0x17faae),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x1f93d7=a38_0x5c25;(function(_0x5c2a62,_0x320bf3){const _0x1f6592=a38_0x5c25,_0xd4a539=_0x5c2a62();while(!![]){try{const _0x3d5a7a=-parseInt(_0x1f6592(0x1bd))/0x1*(parseInt(_0x1f6592(0x18a))/0x2)+-parseInt(_0x1f6592(0x192))/0x3+-parseInt(_0x1f6592(0x1ad))/0x4+-parseInt(_0x1f6592(0x1c9))/0x5+parseInt(_0x1f6592(0x189))/0x6+-parseInt(_0x1f6592(0x195))/0x7*(parseInt(_0x1f6592(0x184))/0x8)+-parseInt(_0x1f6592(0x1a8))/0x9*(-parseInt(_0x1f6592(0x1a0))/0xa);if(_0x3d5a7a===_0x320bf3)break;else _0xd4a539['push'](_0xd4a539['shift']());}catch(_0x240229){_0xd4a539['push'](_0xd4a539['shift']());}}}(a38_0xb15b,0xb57f4));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0x5c25(_0x45122c,_0x4e76fd){_0x45122c=_0x45122c-0x183;const _0xb15b13=a38_0xb15b();let _0x5c256d=_0xb15b13[_0x45122c];return _0x5c256d;}import{saveSessionContext}from'../core/session.js';function a38_0xb15b(){const _0x78233b=['\x20activations','538542DWNisX','113716kAizfQ','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','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)','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x27...','counts','990306CdadNz','length','dim','2621899FIqzsp','dryRun','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','site','-\x20no\x20files\x20written','content','✔\x20Pulled\x20','file','segment:pull','\x20\x20Target:\x20','yellow','10RMEEol','✔\x20Context\x20set:\x20','files','repeat','parentSegment','hasChanges','red','type','37645605MGkbcC','Parent\x20segment:\x20','absolutePath','activations','cwd','2614524lTYLag','filter','targetDir','Site:\x20','session','utf-8','Target\x20resource:\x20','resourceName','journeyVersions','\x20journeys','\x20versions)','\x0aError:','description','✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','cyan','19EfNawB','journeys','diff','relativePath','\x20changed\x20files','verbose','errorCode','\x20with\x20','\x20unchanged\x20files','isNew','data','Write\x20','5452990JlzDvD','Pulling\x20segments\x20from\x20\x27','parentName','parent_segment','segments','\x0aChanges\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','execute','error','Error:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','8oljKrU','message','Aborted.','helpText'];a38_0xb15b=function(){return _0x78233b;};return a38_0xb15b();}import a38_0xed7c91 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x3a6548 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a38_0x1f93d7(0x19d);[a38_0x1f93d7(0x1b9)]=a38_0x1f93d7(0x18f);async[a38_0x1f93d7(0x1d0)](_0x2a1f66){const _0x529504=a38_0x1f93d7,{options:_0x5c488b,args:_0x4d4d50,tdx:_0x19a0d8}=_0x2a1f66,_0x336395=_0x5c488b,_0x1f50a8=await resolveTarget({'arg':_0x4d4d50[0x0],'contextParent':_0x5c488b[_0x529504(0x1a4)],'cwd':process[_0x529504(0x1ac)]()});if(!isSuccessfulResolution(_0x1f50a8))return _0x1f50a8[_0x529504(0x1c3)]==='no_parent'?(console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x19f)](_0x529504(0x197))),console[_0x529504(0x1d1)](_0x529504(0x18e)),console[_0x529504(0x1d1)](_0x529504(0x1cf)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a38_0xed7c91[_0x529504(0x1a6)](_0x529504(0x1d2)+_0x1f50a8[_0x529504(0x185)]+'\x0a')),_0x1f50a8[_0x529504(0x187)]&&console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x1bc)](_0x1f50a8['helpText']))),0x1;const _0x52520b=_0x1f50a8[_0x529504(0x1cb)],_0x3ba42f=_0x1f50a8['targetDir'],_0xce99de=_0x1f50a8[_0x529504(0x1a7)]===_0x529504(0x19c)?_0x1f50a8[_0x529504(0x1b4)]:undefined;_0x336395[_0x529504(0x1c2)]&&(console[_0x529504(0x1d1)](_0x529504(0x1b0)+_0x336395[_0x529504(0x198)]),console[_0x529504(0x1d1)](_0x529504(0x1a9)+_0x52520b),_0xce99de&&console['error'](_0x529504(0x1b3)+_0xce99de));const _0x3383ec=await withProgressSpinner(_0x529504(0x1ca)+_0x52520b+_0x529504(0x190),_0x276211=>_0x19a0d8['segment']['pullSegments'](_0x52520b,{'targetDir':_0x3ba42f,'targetResourceName':_0xce99de,'verbose':_0x336395[_0x529504(0x1c2)],'progress':{'update':_0x3f5c58=>{const _0x168599=_0x529504;_0x276211['setPhase'](_0x3f5c58),_0x336395[_0x168599(0x1c2)]&&console[_0x168599(0x1d1)]('\x20\x20'+_0x3f5c58);}}}),{'verbose':_0x336395[_0x529504(0x1c2)]}),_0x3e9864=_0x3383ec[_0x529504(0x1c7)];if(_0x3e9864['counts']['segments']===0x0&&_0x3e9864['counts'][_0x529504(0x1be)]===0x0)return console[_0x529504(0x1d1)](a38_0xed7c91['yellow'](_0x529504(0x18d)+_0x3e9864[_0x529504(0x1cb)]+'\x27')),0x0;const _0x87343c=_0x3e9864[_0x529504(0x1a2)][_0x529504(0x1ae)](_0x5b7bdd=>_0x5b7bdd[_0x529504(0x1c6)]),_0x5c4b19=_0x3e9864[_0x529504(0x1a2)][_0x529504(0x1ae)](_0x17eb7e=>!_0x17eb7e[_0x529504(0x1c6)]&&_0x17eb7e[_0x529504(0x1a5)]),_0x156578=_0x3e9864[_0x529504(0x1a2)][_0x529504(0x1ae)](_0x36cf01=>!_0x36cf01[_0x529504(0x1c6)]&&!_0x36cf01[_0x529504(0x1a5)]);console[_0x529504(0x1d1)]('\x0aPull\x20summary\x20for\x20\x27'+_0x3e9864[_0x529504(0x1cb)]+'\x27:'),console['error']('\x20\x20🎯\x20'+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x191)][_0x529504(0x1cd)]+'\x20segments')+_0x529504(0x1c4)+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x191)][_0x529504(0x1ab)]+_0x529504(0x188)));if(_0x3e9864[_0x529504(0x191)][_0x529504(0x1be)]>0x0){const _0x32617d=_0x3e9864[_0x529504(0x191)][_0x529504(0x1b5)]>_0x3e9864[_0x529504(0x191)][_0x529504(0x1be)]?'\x20('+_0x3e9864[_0x529504(0x191)][_0x529504(0x1b5)]+_0x529504(0x1b7):'';console[_0x529504(0x1d1)]('\x20\x20🗺️\x20\x20'+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x191)][_0x529504(0x1be)]+_0x529504(0x1b6))+a38_0xed7c91[_0x529504(0x194)](_0x32617d));}console[_0x529504(0x1d1)]('\x20\x20'+a38_0xed7c91[_0x529504(0x18c)]('+\x20'+_0x87343c[_0x529504(0x193)]+'\x20new\x20files')),console[_0x529504(0x1d1)]('\x20\x20'+a38_0xed7c91['yellow']('~\x20'+_0x5c4b19[_0x529504(0x193)]+_0x529504(0x1c1))),console[_0x529504(0x1d1)]('\x20\x20'+a38_0xed7c91['dim']('=\x20'+_0x156578[_0x529504(0x193)]+_0x529504(0x1c5))),console['error'](_0x529504(0x19e)+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x1af)])+'\x0a');if(_0x5c4b19['length']>0x0)for(const _0x2a4075 of _0x5c4b19){console[_0x529504(0x1d1)](_0x529504(0x1ce)+_0x2a4075[_0x529504(0x1c0)]+'\x27:'),console[_0x529504(0x1d1)]('─'[_0x529504(0x1a3)](0x3c)),console[_0x529504(0x1d1)](_0x2a4075[_0x529504(0x1bf)]),console[_0x529504(0x1d1)]('─'[_0x529504(0x1a3)](0x3c));}if(_0x336395[_0x529504(0x196)])return console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x19f)](_0x529504(0x1d3))),0x0;if(_0x87343c['length']===0x0&&_0x5c4b19[_0x529504(0x193)]===0x0)return console['error'](a38_0xed7c91[_0x529504(0x18c)](_0x529504(0x1ba))),saveSessionContext({'parent_segment':_0x3e9864[_0x529504(0x1cb)]},_0x336395[_0x529504(0x1b1)]),console[_0x529504(0x1d1)](a38_0xed7c91['green'](_0x529504(0x1a1)+a38_0xed7c91[_0x529504(0x194)](_0x529504(0x1cc))+_0x529504(0x183)+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x1cb)]))),0x0;if(!_0x336395['yes']){if(!isInteractive())return console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x1a6)](_0x529504(0x1b8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a38_0xed7c91[_0x529504(0x194)](_0x529504(0x18b))),0x1;const _0x4d0e8a=await confirmKey(_0x529504(0x1c8)+(_0x87343c['length']+_0x5c4b19[_0x529504(0x193)])+'\x20files?');if(!_0x4d0e8a)return console['error'](a38_0xed7c91[_0x529504(0x19f)](_0x529504(0x186)),_0x529504(0x199)),0x1;}for(const _0x1da02b of _0x3e9864[_0x529504(0x1a2)]){if(_0x1da02b[_0x529504(0x1c6)]||_0x1da02b[_0x529504(0x1a5)]){const _0x38b568=a38_0x3a6548[_0x529504(0x1bb)](_0x1da02b[_0x529504(0x1aa)]);!existsSync(_0x38b568)&&mkdirSync(_0x38b568,{'recursive':!![]}),writeFileSync(_0x1da02b[_0x529504(0x1aa)],_0x1da02b[_0x529504(0x19a)],_0x529504(0x1b2));}}return console['error'](a38_0xed7c91[_0x529504(0x18c)](_0x529504(0x19b)+(_0x87343c[_0x529504(0x193)]+_0x5c4b19[_0x529504(0x193)])+'\x20files\x20to\x20'+_0x3e9864[_0x529504(0x1af)])),saveSessionContext({'parent_segment':_0x3e9864[_0x529504(0x1cb)]},_0x336395[_0x529504(0x1b1)]),console['error'](a38_0xed7c91[_0x529504(0x18c)](_0x529504(0x1a1)+a38_0xed7c91['dim'](_0x529504(0x1cc))+_0x529504(0x183)+a38_0xed7c91['cyan'](_0x3e9864[_0x529504(0x1cb)]))),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_0x1569de=a39_0x3316;(function(_0x30112c,_0xe5d502){const _0x24458b=a39_0x3316,_0x1ce27c=_0x30112c();while(!![]){try{const _0x39f6cf=parseInt(_0x24458b(0x156))/0x1+parseInt(_0x24458b(0x157))/0x2*(parseInt(_0x24458b(0x14f))/0x3)+parseInt(_0x24458b(0x15a))/0x4+-parseInt(_0x24458b(0x197))/0x5+parseInt(_0x24458b(0x139))/0x6+-parseInt(_0x24458b(0x1b9))/0x7*(parseInt(_0x24458b(0x142))/0x8)+parseInt(_0x24458b(0x184))/0x9;if(_0x39f6cf===_0xe5d502)break;else _0x1ce27c['push'](_0x1ce27c['shift']());}catch(_0x1d001c){_0x1ce27c['push'](_0x1ce27c['shift']());}}}(a39_0x5808,0xa24fe));function a39_0x3316(_0x5b70ca,_0x36e1a1){_0x5b70ca=_0x5b70ca-0x135;const _0x5808b1=a39_0x5808();let _0x33160d=_0x5808b1[_0x5b70ca];return _0x33160d;}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_0x35cc63 from'chalk';import{existsSync}from'fs';function a39_0x5808(){const _0x11a063=['2194656JAPYnm','helpText','segments','getJourney','created','execute','paused','Folders\x20to\x20create:','description','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Aborted.','new','versionNumber','results','nameToId','Resolving\x20parent\x20segment\x20\x27','get','.yml','\x0a✔\x20Push\x20complete','existingJourney','\x20YAML\x20files\x20found','activations','join','\x0aValidation\x20failed:','segmentFolderId','parentFolder','errorCode','error','\x20\x20Activations:\x20','journeyId','parentName','parent_name','yes','createdAt','audienceId','Delete\x20segment:','\x20new','filePath','segment','endsWith','resolveParentId','file','9927198xeiipg','\x0aPush\x20summary\x20for\x20\x27','user','verbose','\x27...','listSegments','setPhase','segment\x20or\x20journey','yellow','repeat','Push\x20','Changes\x20to:','message','\x20to\x20delete','toUpdate','getParent','push','Error:\x20','isNew','6479345xOdsnT','dryRun','green','name','folderId','targetDir','journeyBundleId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Delete\x20journey:','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20\x20Activations:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','map','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','.yaml','changed','/app/ps/','\x20updated','connection','set','delete','/sb/da/esr','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20Segments:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','folderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','state','existingSegment','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','updated','Site:\x20','623ITYDxv','all','(Journey\x20will\x20be\x20deleted)','toCreate','toDelete','site','\x20\x20\x20\x20','journey','then','\x20\x20📊\x20Segments:','data','idToName','\x20changed','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','cyan','journeys','\x20to\x20create','getOutputSchemaWithCache','scopedFolderPath','Changes\x20to\x20journey:','journeysOnly','1648902iltNey','toString','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20deleted','length','diff','Fetching\x20existing\x20data...','yamlConfig','\x20created','44168FXrBCH','attributes','\x20changes?','createdSegmentIds','\x20unchanged','\x20\x20Journeys:\x20','Scoped\x20to\x20folder:\x20','Source\x20directory:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20folders\x20to\x20create','journeyBundleName','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','7308vFOHIs','/e/','No\x20','dim','\x0aError:','\x20\x20Source:\x20','unchanged','418381SspjeS','88zbPmIF','list','buildUserMaps'];a39_0x5808=function(){return _0x11a063;};return a39_0x5808();}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_0x1569de(0x19a)]='segment:push';[a39_0x1569de(0x162)]=a39_0x1569de(0x13b);async[a39_0x1569de(0x15f)](_0x4deded){const _0x58e525=a39_0x1569de,{options:_0x430a5d,args:_0x565b02,tdx:_0x42a1fa}=_0x4deded,_0x88b10a=_0x430a5d,_0x2d5b45=await resolveTarget({'arg':_0x565b02[0x0],'contextParent':_0x430a5d['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d5b45))return _0x2d5b45[_0x58e525(0x174)]==='no_parent'?(console[_0x58e525(0x175)](a39_0x35cc63['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x58e525(0x175)](_0x58e525(0x1a0)),console[_0x58e525(0x175)](_0x58e525(0x1b0)),console[_0x58e525(0x175)](_0x58e525(0x1a4))):(console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x195)+_0x2d5b45['message']+'\x0a')),_0x2d5b45['helpText']&&console['error'](a39_0x35cc63[_0x58e525(0x1c7)](_0x2d5b45[_0x58e525(0x15b)]))),0x1;if(_0x2d5b45['type']===_0x58e525(0x179))return console['error'](a39_0x35cc63[_0x58e525(0x1b3)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2d5b45[_0x58e525(0x19c)]+'\x0a')),console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1c7)](_0x58e525(0x1b2))),0x1;const _0x162a71=_0x2d5b45[_0x58e525(0x178)],_0x5a44f3=_0x2d5b45[_0x58e525(0x19c)],_0x8ee431=_0x2d5b45['type']===_0x58e525(0x183)?_0x2d5b45[_0x58e525(0x17f)]:undefined,_0x5a6925=getScopedDetails(_0x2d5b45),_0x124fa3=_0x5a6925?.['isScoped']??![],_0x435185=_0x5a6925?.[_0x58e525(0x136)]??'';if(!existsSync(_0x5a44f3))return console[_0x58e525(0x175)](a39_0x35cc63['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x5a44f3+'\x0a')),console[_0x58e525(0x175)](a39_0x35cc63['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x88b10a['verbose']&&(console[_0x58e525(0x175)](_0x58e525(0x1b8)+_0x88b10a[_0x58e525(0x1be)]),console['error']('Parent\x20segment:\x20'+_0x162a71),console[_0x58e525(0x175)](_0x58e525(0x149)+_0x5a44f3),_0x124fa3&&console[_0x58e525(0x175)](_0x58e525(0x148)+_0x435185));const _0x2891b1=await withSpinner(_0x58e525(0x169)+_0x162a71+_0x58e525(0x188),()=>_0x42a1fa[_0x58e525(0x180)][_0x58e525(0x182)](_0x162a71),{'verbose':_0x88b10a[_0x58e525(0x187)]}),_0x5ccc52=_0x2891b1[_0x58e525(0x1c3)],{parentSegmentResult:_0x1077cc,segmentsResult:_0x322ac0,foldersResult:_0x8de6fc,journeysWithDetailsResult:_0x4b84cc,userMaps:_0x1e4ec8}=await withSpinner(_0x58e525(0x13f),async()=>{const _0x542f79=_0x58e525,[_0x110e4e,_0x27ea13,_0x1b8d45,_0x25ed5f,_0x2b6a6]=await Promise[_0x542f79(0x1ba)]([_0x42a1fa[_0x542f79(0x180)][_0x542f79(0x193)](_0x5ccc52),_0x42a1fa[_0x542f79(0x180)][_0x542f79(0x189)](_0x5ccc52),_0x42a1fa['segment']['listFolders'](_0x5ccc52),_0x42a1fa[_0x542f79(0x1c0)]['listJourneysWithDetailsFromParentSegment'](_0x5ccc52,{'includeAllVersions':!![]}),_0x42a1fa['user'][_0x542f79(0x159)]()]);return{'parentSegmentResult':_0x110e4e,'segmentsResult':_0x27ea13,'foldersResult':_0x1b8d45,'journeysWithDetailsResult':_0x25ed5f,'userMaps':_0x2b6a6};},{'verbose':_0x88b10a[_0x58e525(0x187)]})[_0x58e525(0x1c1)](_0x4b5f71=>_0x4b5f71[_0x58e525(0x1c3)]),_0x5b0c0d=_0x1077cc,_0x2cfc7c=extractRootFolderId(_0x5b0c0d),_0x21cc44=_0x322ac0,_0x1bd8f3=_0x8de6fc,{journeys:_0x54c119,activationStepsById:_0x176b7a}=_0x4b84cc,_0x111d38=new Map(_0x54c119[_0x58e525(0x1a3)](_0x5e13c7=>[_0x5e13c7['id'],_0x5e13c7])),_0x22a781=_0x54c119[_0x58e525(0x1a3)](_0xaff2a5=>({'id':_0xaff2a5['id'],'name':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x19a)],'journeyBundleName':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x14c)]||'','journeyBundleId':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x19d)]||'','versionNumber':_0xaff2a5['attributes'][_0x58e525(0x166)],'description':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x162)],'state':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x1b4)],'paused':_0xaff2a5['attributes'][_0x58e525(0x160)],'audienceId':_0xaff2a5['attributes'][_0x58e525(0x17c)],'folderId':_0xaff2a5['relationships']?.[_0x58e525(0x173)]?.['data']?.['id'],'createdAt':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x17b)],'updatedAt':_0xaff2a5[_0x58e525(0x143)]['updatedAt']})),{emailToId:_0x3f1b14,idToEmail:_0xfb29f2}=_0x1e4ec8,_0x198991=await withSpinner(_0x58e525(0x1ae),async()=>{const _0x2cadfb=_0x58e525,_0x1dc9c7=await _0x42a1fa[_0x2cadfb(0x1aa)][_0x2cadfb(0x158)]();return buildConnectionMaps(_0x1dc9c7);},{'verbose':_0x88b10a['verbose']})[_0x58e525(0x1c1)](_0x5e5c0c=>_0x5e5c0c[_0x58e525(0x1c3)]),_0x273f88=_0x198991[_0x58e525(0x168)],_0x28b01d=_0x198991[_0x58e525(0x1c4)],_0x2a54f8=_0x198991['nameToType'],_0x524019={'emailToIdMap':_0x3f1b14,'connectionNameToIdMap':_0x273f88,'connectionNameToTypeMap':_0x2a54f8,'getSchema':_0xd5b2de=>_0x42a1fa[_0x58e525(0x1aa)][_0x58e525(0x135)](_0xd5b2de)};let {pathToId:_0xc06337,idToPath:_0x5994af}=buildFolderMaps(_0x1bd8f3);const _0x2767da=buildSegmentLookupMap(_0x21cc44,_0x5994af),_0x1ea51b=buildSegmentNameToIdMap(_0x21cc44),_0x34329c=buildJourneyBundleLookupMap(_0x22a781,_0x5994af);let _0x34c096;if(_0x8ee431){if(!_0x8ee431[_0x58e525(0x181)](_0x58e525(0x16b))&&!_0x8ee431[_0x58e525(0x181)](_0x58e525(0x1a6)))return console['error'](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x1a2)+_0x8ee431+'\x0a')),0x1;_0x34c096=[_0x8ee431];}else _0x34c096=findYamlFiles(_0x5a44f3);if(_0x34c096[_0x58e525(0x13d)]===0x0)return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5a44f3+'\x0a')),console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1c7)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2d4786,_0x4c3e8e;try{const _0x1f21f1=parseAndClassifyYamlFiles(_0x34c096,_0x5a44f3,{'skipSegments':_0x88b10a['journeysOnly']});_0x2d4786=_0x1f21f1[_0x58e525(0x15c)],_0x4c3e8e=_0x1f21f1[_0x58e525(0x1c8)];const _0x56fb4d=validateParsedFiles(_0x1f21f1,_0x5a44f3);if(_0x56fb4d[_0x58e525(0x13d)]>0x0)return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x171))),console[_0x58e525(0x175)](formatValidationErrors(_0x56fb4d)),console[_0x58e525(0x175)](a39_0x35cc63['yellow'](_0x58e525(0x14a))),0x1;}catch(_0x5b1da4){return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)]('Error\x20parsing\x20YAML:\x20'+(_0x5b1da4 instanceof Error?_0x5b1da4[_0x58e525(0x190)]:_0x5b1da4))),0x1;}if(_0x2d4786['length']===0x0&&_0x4c3e8e[_0x58e525(0x13d)]===0x0){const _0x462cae=_0x88b10a['journeysOnly']?'journey':_0x58e525(0x18b);return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x151)+_0x462cae+_0x58e525(0x16e))),0x0;}const _0x4fd4cf=new Map();_0x21cc44['length']>0x0&&!_0x88b10a['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x21cc44,async _0x4781b0=>{const _0xc811fa=a39_0x3316,_0x2fd252=await _0x42a1fa[_0xc811fa(0x180)]['listActivations'](_0x5ccc52,_0x4781b0['id']);_0x4fd4cf['set'](_0x4781b0['id'],_0x2fd252);});},{'verbose':_0x88b10a['verbose']});const {segmentFiles:_0x596bbf,foldersToCreate:_0x1cf1fa}=await prepareSegmentFiles(_0x2d4786,{'segmentByFolderAndName':_0x2767da,'activationsBySegmentId':_0x4fd4cf,'folderPathToId':_0xc06337,'idToEmailMap':_0xfb29f2,'connectionIdToNameMap':_0x28b01d},_0x524019,_0x124fa3,_0x435185),_0x1c04bc=_0x8ee431?[]:findSegmentsToDelete(_0x21cc44,_0x2d4786[_0x58e525(0x1a3)](({yamlConfig:_0x30a95f,folderPath:_0xe44599})=>({'yamlConfig':_0x30a95f,'folderPath':resolveTDFolderPath(_0xe44599,_0x124fa3,_0x435185)})),_0x5994af,_0x435185,_0x124fa3),{journeyFiles:_0x542cbb,foldersToCreate:_0xe6c8f0}=await withProgressSpinner('Preparing\x20journeys...',async _0x2b44ca=>prepareJourneyFiles(_0x4c3e8e,{'fetchJourney':async _0x23e260=>_0x42a1fa[_0x58e525(0x1c0)][_0x58e525(0x15d)](_0x23e260[_0x58e525(0x177)]),'journeyBundlesByFolderAndName':_0x34329c,'folderPathToId':_0xc06337,'idToEmailMap':_0xfb29f2,'connectionIdToNameMap':_0x28b01d,'existingSegments':_0x21cc44,'parentId':_0x5ccc52,'deps':_0x42a1fa,'progress':{'update':_0x259cdd=>{const _0x169131=_0x58e525;_0x2b44ca[_0x169131(0x18a)](_0x259cdd),_0x88b10a['verbose']&&console['error']('\x20\x20'+_0x259cdd);}},'journeyById':_0x111d38,'activationStepsById':_0x176b7a},_0x124fa3,_0x435185),{'verbose':_0x88b10a[_0x58e525(0x187)]})[_0x58e525(0x1c1)](_0x3c7a86=>_0x3c7a86['data']);for(const _0xbaa1e1 of _0xe6c8f0){_0x1cf1fa['add'](_0xbaa1e1);}const _0x16cd53=_0x8ee431?[]:findJourneysToDelete(_0x22a781,_0x4c3e8e[_0x58e525(0x1a3)](({yamlConfig:_0x30a3f8,folderPath:_0x401379})=>({'yamlConfig':_0x30a3f8,'folderPath':resolveTDFolderPath(_0x401379,_0x124fa3,_0x435185)})),_0x5994af,_0x435185,_0x124fa3),_0x58ee3f=calculatePushStats(_0x596bbf,_0x542cbb,_0x1cf1fa,_0x1c04bc,_0x16cd53,!!_0x88b10a['delete'],!!_0x88b10a[_0x58e525(0x138)]),_0x478621=_0x58ee3f['segments'][_0x58e525(0x165)],_0x439c29=_0x58ee3f[_0x58e525(0x15c)][_0x58e525(0x1a7)],_0x4df780=_0x58ee3f[_0x58e525(0x15c)][_0x58e525(0x155)],_0x281ffd=_0x58ee3f[_0x58e525(0x15c)][_0x58e525(0x1bd)],_0x1c663f=_0x58ee3f['folders'][_0x58e525(0x1bc)],_0x1e07cd=_0x58ee3f[_0x58e525(0x1c8)][_0x58e525(0x165)],_0x34666e=_0x58ee3f[_0x58e525(0x1c8)]['changed'],_0x1a11f0=_0x58ee3f[_0x58e525(0x1c8)]['unchanged'],_0x30f65d=_0x58ee3f[_0x58e525(0x1c8)][_0x58e525(0x1bd)],_0x1b6f16=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x1ba)],_0x11b6e6=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x1bc)],_0xb4e5a7=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x192)],_0x5d7d73=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x1bd)];console[_0x58e525(0x175)](_0x58e525(0x185)+_0x162a71+'\x27:');_0x1c663f[_0x58e525(0x13d)]>0x0&&console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63['blue']('📁\x20'+_0x1c663f[_0x58e525(0x13d)]+_0x58e525(0x14b)));if(!_0x88b10a['journeysOnly']){console[_0x58e525(0x175)](_0x58e525(0x1c2)),console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x199)]('+\x20'+_0x478621[_0x58e525(0x13d)]+_0x58e525(0x17e))),console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x18c)]('~\x20'+_0x439c29[_0x58e525(0x13d)]+_0x58e525(0x1c5)));if(_0x281ffd[_0x58e525(0x13d)]>0x0)console['error']('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x1b3)]('-\x20'+_0x281ffd[_0x58e525(0x13d)]+_0x58e525(0x191)));else _0x1c04bc[_0x58e525(0x13d)]>0x0&&!_0x88b10a['delete']&&console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x152)](_0x1c04bc['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x58e525(0x175)]('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x152)]('=\x20'+_0x4df780['length']+_0x58e525(0x146)));}if(_0x542cbb[_0x58e525(0x13d)]>0x0||_0x16cd53[_0x58e525(0x13d)]>0x0){console[_0x58e525(0x175)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x199)]('+\x20'+_0x1e07cd[_0x58e525(0x13d)]+_0x58e525(0x17e))),console['error'](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x18c)]('~\x20'+_0x34666e[_0x58e525(0x13d)]+_0x58e525(0x1c5)));if(_0x30f65d[_0x58e525(0x13d)]>0x0)console['error'](_0x58e525(0x1bf)+a39_0x35cc63['red']('-\x20'+_0x30f65d['length']+'\x20to\x20delete'));else _0x16cd53[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x1ac)]&&console['error']('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x152)](_0x16cd53['length']+_0x58e525(0x19e)));console[_0x58e525(0x175)]('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x152)]('=\x20'+_0x1a11f0[_0x58e525(0x13d)]+_0x58e525(0x146)));}_0x1b6f16[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)]&&(console[_0x58e525(0x175)](''),console['error'](_0x58e525(0x1a1)),_0x11b6e6['length']>0x0&&console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x199)]('+\x20'+_0x11b6e6[_0x58e525(0x13d)]+_0x58e525(0x1c9))),_0xb4e5a7[_0x58e525(0x13d)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x18c)]('~\x20'+_0xb4e5a7[_0x58e525(0x13d)]+'\x20to\x20update')),_0x5d7d73[_0x58e525(0x13d)]>0x0&&console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x1b3)]('-\x20'+_0x5d7d73[_0x58e525(0x13d)]+'\x20to\x20delete')));console[_0x58e525(0x175)](_0x58e525(0x154)+a39_0x35cc63[_0x58e525(0x1c7)](_0x5a44f3)+'\x0a');if(_0x1c663f[_0x58e525(0x13d)]>0x0){console['error'](_0x58e525(0x161));for(const _0x2875e3 of _0x1c663f){console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63['blue']('+')+'\x20'+_0x2875e3);}console[_0x58e525(0x175)]('');}if(_0x478621[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)])for(const _0x377273 of _0x478621){const _0x15affd=_0x377273['folderPath']?_0x377273[_0x58e525(0x1b1)]+'/'+_0x377273[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x377273[_0x58e525(0x140)][_0x58e525(0x19a)],_0x2d6585=_0x377273[_0x58e525(0x140)][_0x58e525(0x16f)]?.[_0x58e525(0x13d)]||0x0,_0x32e853=_0x2d6585>0x0?a39_0x35cc63['dim']('\x20['+_0x2d6585+'\x20activations]'):'';console[_0x58e525(0x175)]('\x0a'+a39_0x35cc63[_0x58e525(0x199)]('New\x20segment:')+'\x20'+_0x15affd+_0x32e853),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c)),_0x377273[_0x58e525(0x13e)]&&console[_0x58e525(0x175)](_0x377273[_0x58e525(0x13e)]),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));}if(_0x281ffd[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)])for(const _0x573216 of _0x281ffd){const _0x500b5f=_0x573216[_0x58e525(0x172)]?_0x5994af['get'](_0x573216['segmentFolderId'][_0x58e525(0x13a)]())||'':'',_0x58eb9f=_0x500b5f?_0x500b5f+'/'+_0x573216[_0x58e525(0x19a)]:_0x573216[_0x58e525(0x19a)],_0x459a09=_0x4fd4cf[_0x58e525(0x16a)](_0x573216['id'])||[],_0x20f43a=_0x459a09[_0x58e525(0x13d)]>0x0?a39_0x35cc63[_0x58e525(0x152)]('\x20['+_0x459a09[_0x58e525(0x13d)]+'\x20activations]'):'';console['error']('\x0a'+a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x17d))+'\x20'+_0x58eb9f+_0x20f43a),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));const _0x523b53=segmentWithActivationsToYaml(_0x573216,_0x459a09,undefined,_0xfb29f2,_0x28b01d),_0x5ed82b=segmentToYamlString(_0x523b53),_0x46c038=generateDiff(_0x5ed82b,'');console[_0x58e525(0x175)](formatDiffWithColors(_0x46c038)),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));}const _0x3f2e20=_0x596bbf['filter'](_0xbec231=>!_0xbec231[_0x58e525(0x196)]&&_0xbec231['diff']);if(_0x3f2e20[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)])for(const _0x5b7bfd of _0x3f2e20){const _0x58a7a6=_0x5b7bfd[_0x58e525(0x1b1)]?_0x5b7bfd[_0x58e525(0x1b1)]+'/'+_0x5b7bfd[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x5b7bfd[_0x58e525(0x140)][_0x58e525(0x19a)];console[_0x58e525(0x175)]('\x0a'+a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x18f))+'\x20'+_0x58a7a6),console[_0x58e525(0x175)]('─'['repeat'](0x3c)),console[_0x58e525(0x175)](_0x5b7bfd[_0x58e525(0x13e)]),console['error']('─'['repeat'](0x3c));}if(_0x1e07cd['length']>0x0)for(const _0x10ba41 of _0x1e07cd){const _0x458a91=_0x10ba41[_0x58e525(0x1b1)]?_0x10ba41[_0x58e525(0x1b1)]+'/'+_0x10ba41[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x10ba41['yamlConfig']['name'];console[_0x58e525(0x175)]('\x0a'+a39_0x35cc63[_0x58e525(0x199)]('New\x20journey:')+'\x20'+_0x458a91),console['error']('─'[_0x58e525(0x18d)](0x3c)),_0x10ba41[_0x58e525(0x13e)]&&console[_0x58e525(0x175)](_0x10ba41[_0x58e525(0x13e)]),console[_0x58e525(0x175)]('─'['repeat'](0x3c));}const _0xbae575=_0x542cbb['filter'](_0x7bdfc8=>!_0x7bdfc8[_0x58e525(0x196)]&&_0x7bdfc8[_0x58e525(0x13e)]);if(_0xbae575[_0x58e525(0x13d)]>0x0)for(const _0x35a0d0 of _0xbae575){const _0x3bd14f=_0x35a0d0[_0x58e525(0x1b1)]?_0x35a0d0[_0x58e525(0x1b1)]+'/'+_0x35a0d0[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x35a0d0[_0x58e525(0x140)]['name'];console['error']('\x0a'+a39_0x35cc63['yellow'](_0x58e525(0x137))+'\x20'+_0x3bd14f),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c)),console[_0x58e525(0x175)](_0x35a0d0[_0x58e525(0x13e)]),console['error']('─'[_0x58e525(0x18d)](0x3c));}if(_0x30f65d['length']>0x0)for(const _0x590ba7 of _0x30f65d){const _0x5b4575=_0x590ba7[_0x58e525(0x19b)]?_0x5994af['get'](_0x590ba7[_0x58e525(0x19b)])||'':'',_0x83101d=_0x5b4575?_0x5b4575+'/'+_0x590ba7['journeyBundleName']:_0x590ba7['journeyBundleName'];console['error']('\x0a'+a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x19f))+'\x20'+_0x83101d),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c)),console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x1bb))),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));}if(_0x88b10a[_0x58e525(0x198)])return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x1c6))),0x0;const _0xb25d93=_0x88b10a[_0x58e525(0x138)]?![]:_0x478621['length']>0x0||_0x439c29['length']>0x0||_0x281ffd[_0x58e525(0x13d)]>0x0,_0x3c1761=_0x1e07cd[_0x58e525(0x13d)]>0x0||_0x34666e['length']>0x0||_0x30f65d[_0x58e525(0x13d)]>0x0,_0x4346f6=_0x88b10a[_0x58e525(0x138)]?![]:_0x1b6f16[_0x58e525(0x13d)]>0x0,_0x320ed4=_0x1c663f['length']>0x0;if(!_0xb25d93&&!_0x3c1761&&!_0x4346f6&&!_0x320ed4){const _0xc9bcc0=_0x88b10a[_0x58e525(0x138)]?_0x58e525(0x14e):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x199)](_0xc9bcc0));if(_0x8ee431&&_0x4df780[_0x58e525(0x13d)]===0x1){const _0x1ecf53=_0x4df780[0x0];if(_0x1ecf53[_0x58e525(0x1b5)]?.['id']){const _0x7f4410=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],'/app/ps/'+_0x5ccc52+'/e/'+_0x1ecf53['existingSegment']['id']+_0x58e525(0x1ad));console[_0x58e525(0x175)](_0x58e525(0x1b6)+a39_0x35cc63[_0x58e525(0x1c7)](_0x7f4410));}}if(_0x8ee431&&_0x1a11f0[_0x58e525(0x13d)]===0x1){const _0xa6cef8=_0x1a11f0[0x0];if(_0xa6cef8[_0x58e525(0x16d)]?.['id']){const _0x3aa35c=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],'/app/ps/'+_0x5ccc52+_0x58e525(0x150)+_0xa6cef8[_0x58e525(0x16d)]['id']+'/j/da/je');console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63[_0x58e525(0x1c7)](_0x3aa35c));}}return 0x0;}const _0x1504bd=_0x88b10a[_0x58e525(0x138)]?_0x1e07cd['length']+_0x34666e['length']+_0x30f65d[_0x58e525(0x13d)]+_0x1c663f[_0x58e525(0x13d)]:_0x478621[_0x58e525(0x13d)]+_0x439c29['length']+_0x281ffd[_0x58e525(0x13d)]+_0x1e07cd[_0x58e525(0x13d)]+_0x34666e['length']+_0x30f65d[_0x58e525(0x13d)]+_0x1c663f[_0x58e525(0x13d)]+_0x1b6f16[_0x58e525(0x13d)];if(!_0x88b10a[_0x58e525(0x17a)]&&_0x1504bd>0x0){if(!isInteractive())return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x153)),_0x58e525(0x163)),console[_0x58e525(0x175)](a39_0x35cc63['dim'](_0x58e525(0x1a5))),0x1;const _0x169809=await confirmKey(_0x58e525(0x18e)+_0x1504bd+_0x58e525(0x144));if(!_0x169809)return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x164))),0x1;}const _0x27e7eb={'withProgress':async(_0x5149f3,_0x1acdde)=>{const _0x3bf180=_0x58e525,_0x1c5786=await withSpinner(_0x5149f3,_0x1acdde,{'verbose':_0x88b10a[_0x3bf180(0x187)]});return{'data':_0x1c5786[_0x3bf180(0x1c3)]};},'logInfo':_0x54b09c=>console[_0x58e525(0x175)](a39_0x35cc63['blue']('✔\x20'+_0x54b09c)),'logSuccess':_0x31eb50=>console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x199)]('✔\x20'+_0x31eb50)),'logWarning':_0x4836e2=>console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)]('⚠\x20'+_0x4836e2)),'logDeleted':_0x3f1c06=>console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)]('✔\x20'+_0x3f1c06))},_0x867f78={'segment':_0x42a1fa['segment'],'journey':_0x42a1fa[_0x58e525(0x1c0)],'user':_0x42a1fa[_0x58e525(0x186)],'connection':_0x42a1fa[_0x58e525(0x1aa)]};_0x1c663f[_0x58e525(0x13d)]>0x0&&(_0xc06337=await executePushFolders(_0x867f78,_0x1c663f,_0xc06337,{'parentId':_0x5ccc52},_0x27e7eb));const _0x7abab9={'rootFolderId':_0x2cfc7c,'folderPathToId':_0xc06337,'folderIdToPath':_0x5994af,'segmentNameToId':_0x1ea51b,'activationsBySegmentId':_0x4fd4cf,'emailToIdMap':_0x3f1b14,'idToEmailMap':_0xfb29f2,'connectionNameToIdMap':_0x198991[_0x58e525(0x168)],'connectionIdToNameMap':_0x198991[_0x58e525(0x1c4)],'connectionNameToTypeMap':_0x2a54f8},_0x125cee=await executePushSegments(_0x867f78,_0x88b10a[_0x58e525(0x138)]?[]:_0x596bbf,_0x7abab9,{'parentId':_0x5ccc52},_0x27e7eb),_0x541a2e=_0x125cee[_0x58e525(0x15e)],_0x7bf1c=_0x125cee[_0x58e525(0x1b7)],_0x38d95f=_0x125cee[_0x58e525(0x16f)][_0x58e525(0x15e)],_0x1491d9=_0x125cee[_0x58e525(0x16f)][_0x58e525(0x1b7)],_0x2b43ea=_0x125cee['activations']['deleted'];let _0x1de317;if(_0x8ee431&&_0x596bbf['length']===0x1){const _0x2b6013=_0x596bbf[0x0];_0x1de317=_0x2b6013[_0x58e525(0x1b5)]?.['id']??_0x125cee[_0x58e525(0x145)][_0x58e525(0x16a)](_0x2b6013[_0x58e525(0x140)]['name']);}const _0x21119f=await executePushSegmentDeletions(_0x867f78,_0x88b10a['journeysOnly']?[]:_0x281ffd,_0x27e7eb);let _0x1cc6d0=0x0,_0x2ba41d=0x0,_0x29d73c=0x0;const _0x18e2f8=new Map(_0x1ea51b);for(const [_0xcd2e69,_0x3152b5]of _0x125cee['createdSegmentIds']){_0x18e2f8[_0x58e525(0x1ab)](_0xcd2e69,_0x3152b5);}if(_0x542cbb['length']>0x0){const _0x4e4384={..._0x7abab9,'segmentNameToId':_0x18e2f8,'existingSegments':_0x21cc44,'activationContext':_0x524019},_0x2d4209=await executePushJourneys(_0x867f78,_0x542cbb,_0x4e4384,{'parentId':_0x5ccc52,'rootFolderId':_0x2cfc7c,'verbose':_0x88b10a[_0x58e525(0x187)]},_0x27e7eb);_0x1cc6d0=_0x2d4209[_0x58e525(0x15e)],_0x2ba41d=_0x2d4209[_0x58e525(0x1b7)];if(_0x8ee431&&_0x2d4209[_0x58e525(0x167)][_0x58e525(0x13d)]===0x1){const _0x4acc65=_0x2d4209[_0x58e525(0x167)][0x0];if(_0x4acc65[_0x58e525(0x177)]){const _0x2b2a72=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],_0x58e525(0x1a8)+_0x5ccc52+_0x58e525(0x150)+_0x4acc65['journeyId']+'/j/da/je');console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63['cyan'](_0x2b2a72));}}}for(const _0x478495 of _0x30f65d){console[_0x58e525(0x175)](a39_0x35cc63['yellow'](_0x58e525(0x14d)+_0x478495['journeyBundleName'])),_0x29d73c++;}const _0x5185cf=[];if(_0x541a2e>0x0)_0x5185cf[_0x58e525(0x194)](_0x541a2e+_0x58e525(0x141));if(_0x7bf1c>0x0)_0x5185cf[_0x58e525(0x194)](_0x7bf1c+'\x20updated');if(_0x21119f>0x0)_0x5185cf[_0x58e525(0x194)](_0x21119f+_0x58e525(0x13c));const _0x15494f=[];if(_0x1cc6d0>0x0)_0x15494f[_0x58e525(0x194)](_0x1cc6d0+'\x20created');if(_0x2ba41d>0x0)_0x15494f[_0x58e525(0x194)](_0x2ba41d+_0x58e525(0x1a9));if(_0x29d73c>0x0)_0x15494f[_0x58e525(0x194)](_0x29d73c+_0x58e525(0x13c));const _0xb294c8=[];if(_0x38d95f>0x0)_0xb294c8[_0x58e525(0x194)](_0x38d95f+'\x20created');if(_0x1491d9>0x0)_0xb294c8[_0x58e525(0x194)](_0x1491d9+_0x58e525(0x1a9));if(_0x2b43ea>0x0)_0xb294c8['push'](_0x2b43ea+_0x58e525(0x13c));console['error'](a39_0x35cc63[_0x58e525(0x199)](_0x58e525(0x16c)));_0x5185cf['length']>0x0&&!_0x88b10a[_0x58e525(0x138)]&&console[_0x58e525(0x175)](_0x58e525(0x1af)+_0x5185cf[_0x58e525(0x170)](',\x20'));_0x15494f[_0x58e525(0x13d)]>0x0&&console[_0x58e525(0x175)](_0x58e525(0x147)+_0x15494f[_0x58e525(0x170)](',\x20'));_0xb294c8[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)]&&console[_0x58e525(0x175)](_0x58e525(0x176)+_0xb294c8[_0x58e525(0x170)](',\x20'));if(_0x1de317){const _0x384ea6=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],_0x58e525(0x1a8)+_0x5ccc52+_0x58e525(0x150)+_0x1de317+_0x58e525(0x1ad));console['error'](_0x58e525(0x1b6)+a39_0x35cc63[_0x58e525(0x1c7)](_0x384ea6));}return 0x0;}}
|