@treasuredata/tdx 2026.3.17 β 2026.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function a34_0x2ebe(){const _0x3cd337=['query','list','delete','has_next_page','(unnamed)','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Running\x20schedule...','retryLimit','ies','ended_at','schedule:history','priority','schedule:run','Getting\x20schedule\x20details...','\x20\x20Time:\x20','statusIcon','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','last_job','Deleting\x20schedule...','lastRun','\x20matching\x20\x22','Schedule\x20updated:\x20','157128JqQKRe','Updating\x20schedule...','data','just\x20now','round','1058616LBPAak','success','soon','site','schedule:show','verbose','No\x20scheduled\x20queries\x20found','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20\x20Num:\x20','abs','options','pagination','schedule:update','utf-8','engineVersion','Create\x20a\x20scheduled\x20query','max','Showing\x20first\x20','table','in\x20','history','args','listQueries','\x20\x20β\x20','type','Updating\x20schedule:\x20','tsv','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','output','error','executing_user_id','\x20scheduled\x20quer','name','\x20(use\x20--limit\x20to\x20see\x20more)','Creating\x20schedule:\x20','schedule:create','m\x20ago','user_name','next_run_at','status','file','nextRun','\x20\x20Cron:\x20','validate','timezone','description','\x20\x20Database:\x20','never','show','π
\x20','user','scheduled_at','Found\x20','8754888OhboRB','565698DntlOi','\x20job','\x20\x20Timezone:\x20','queryUrl','54kULSaJ','4gaRYwF','getTime','end_at','execute','Schedule\x20created:\x20','...','retry_limit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20(showing\x20','repeat','update','Run\x20a\x20scheduled\x20query\x20immediately','updated_at','job_id','format','Creating\x20schedule...','trim','cron','create','INVALID_ARGUMENT','queries','1668djOhZS','engine_version','padEnd','result','red','map','time','Query\x20file\x20is\x20empty','database','Cancelled','substring','\x20schedules','time_zone','Delete\x20a\x20scheduled\x20query','3179BEigtf','\x20execution','cyan','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','84627xlyIti','/app/queries/editor?queryId=','1054420WBjsJp','\x20\x20Job\x20ID:\x20','d\x20ago','created_at','dim','keys','1640saZTNL','\x20created','length','green','Searching\x20scheduled\x20queries\x20matching\x20\x22','schedules','schedule:delete','7NluvTG','Schedule\x20deleted:\x20','Failed\x20to\x20read\x20file:\x20','h\x20ago','schedule:list','delay','entries','from','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x22...','num','Update\x20a\x20scheduled\x20query','count','limit'];a34_0x2ebe=function(){return _0x3cd337;};return a34_0x2ebe();}const a34_0x9bfb35=a34_0xcb4f;(function(_0x32a133,_0x2c96da){const _0x591cf7=a34_0xcb4f,_0x308cc8=_0x32a133();while(!![]){try{const _0x3e436f=parseInt(_0x591cf7(0x156))/0x1*(-parseInt(_0x591cf7(0x15b))/0x2)+-parseInt(_0x591cf7(0x182))/0x3+parseInt(_0x591cf7(0x170))/0x4*(-parseInt(_0x591cf7(0x18a))/0x5)+-parseInt(_0x591cf7(0x120))/0x6*(parseInt(_0x591cf7(0x191))/0x7)+-parseInt(_0x591cf7(0x155))/0x8+parseInt(_0x591cf7(0x15a))/0x9*(-parseInt(_0x591cf7(0x184))/0xa)+-parseInt(_0x591cf7(0x17e))/0xb*(-parseInt(_0x591cf7(0x11b))/0xc);if(_0x3e436f===_0x2c96da)break;else _0x308cc8['push'](_0x308cc8['shift']());}catch(_0x5a5b2e){_0x308cc8['push'](_0x308cc8['shift']());}}}(a34_0x2ebe,0x8ea90));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x2e487a from'chalk';function formatRelativeTime(_0x20e5c5){const _0x30cb38=a34_0xcb4f,_0xb3fa08=new Date(_0x20e5c5),_0x51fa64=new Date(),_0x667b51=_0xb3fa08[_0x30cb38(0x15c)]()-_0x51fa64[_0x30cb38(0x15c)](),_0x47d643=Math[_0x30cb38(0x129)](_0x667b51)/0x3e8,_0x5e1ff2=_0x667b51<0x0;if(_0x47d643<0x3c)return _0x5e1ff2?_0x30cb38(0x11e):_0x30cb38(0x122);else{if(_0x47d643<0xe10){const _0x5dcf40=Math['round'](_0x47d643/0x3c);return _0x5e1ff2?_0x5dcf40+_0x30cb38(0x144):_0x30cb38(0x133)+_0x5dcf40+'m';}else{if(_0x47d643<0x15180){const _0x40d9d2=Math[_0x30cb38(0x11f)](_0x47d643/0xe10);return _0x5e1ff2?_0x40d9d2+_0x30cb38(0x194):'in\x20'+_0x40d9d2+'h';}else{if(_0x47d643<0x93a80){const _0x523484=Math['round'](_0x47d643/0x15180);return _0x5e1ff2?_0x523484+_0x30cb38(0x186):_0x30cb38(0x133)+_0x523484+'d';}else return _0xb3fa08['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a34_0x9bfb35(0x195);[a34_0x9bfb35(0x14d)]='List\x20scheduled\x20queries';async['execute'](_0x5310d0){const _0x1c67c8=a34_0x9bfb35,{options:_0x5240c7,args:_0x3ee1fb,tdx:_0x167e81}=_0x5310d0,_0xaa81fe=resolveLimit(_0x5240c7[_0x1c67c8(0x19f)],DEFAULT_DISPLAY_LIMIT),_0x305850=_0x3ee1fb[0x0],_0x4090d0=_0x305850?_0x1c67c8(0x18e)+_0x305850+_0x1c67c8(0x19b):'Listing\x20scheduled\x20queries...',_0x23ba0e=await withSpinner(_0x4090d0,()=>_0x167e81[_0x1c67c8(0x18f)][_0x1c67c8(0x136)]({'limit':_0xaa81fe,'scheduled':!![],'pattern':_0x305850}),{'verbose':_0x5240c7[_0x1c67c8(0x125)]}),_0x2a5505=_0x23ba0e[_0x1c67c8(0x11d)][_0x1c67c8(0x16f)],_0x41fd55=_0x23ba0e[_0x1c67c8(0x11d)][_0x1c67c8(0x12b)][_0x1c67c8(0x108)],_0x140eed=_0x305850?_0x1c67c8(0x119)+_0x305850+'\x22':'';_0x41fd55?console[_0x1c67c8(0x13d)](_0x1c67c8(0x131)+_0x2a5505[_0x1c67c8(0x18c)]+_0x1c67c8(0x17b)+_0x140eed+_0x1c67c8(0x141)):console['error']('Found\x20'+_0x2a5505[_0x1c67c8(0x18c)]+_0x1c67c8(0x13f)+(_0x2a5505[_0x1c67c8(0x18c)]!==0x1?_0x1c67c8(0x10d):'y')+_0x140eed);if(_0x5240c7['format']==='json'||_0x5240c7[_0x1c67c8(0x169)]==='jsonl'||_0x5240c7[_0x1c67c8(0x169)]===_0x1c67c8(0x132)||_0x5240c7['format']===_0x1c67c8(0x13a)){const _0xe22866=_0x2a5505['map'](_0x3f593b=>({'id':_0x3f593b['id'],'name':_0x3f593b['name'],'cron':_0x3f593b[_0x1c67c8(0x16c)],'database':_0x3f593b[_0x1c67c8(0x178)]?.['name'],'type':_0x3f593b[_0x1c67c8(0x138)],'timezone':_0x3f593b[_0x1c67c8(0x17c)],'user_name':_0x3f593b[_0x1c67c8(0x152)]?.[_0x1c67c8(0x140)],'updated_at':_0x3f593b[_0x1c67c8(0x167)],'next_run_at':_0x3f593b[_0x1c67c8(0x146)],'last_job_status':_0x3f593b[_0x1c67c8(0x116)]?.[_0x1c67c8(0x147)]}));await handleSDKOutput(_0xe22866,_0x5240c7);}else{if(_0x2a5505['length']===0x0)console['log'](_0x1c67c8(0x126));else{const _0x41d489=_0x5240c7[_0x1c67c8(0x123)],_0x14d969=_0x2a5505[_0x1c67c8(0x175)](_0x51673d=>{const _0x3f068d=_0x1c67c8,_0x4f84ed=_0x51673d[_0x3f068d(0x116)]?.[_0x3f068d(0x147)]?_0x51673d[_0x3f068d(0x116)]['status']===_0x3f068d(0x121)?'β':'β':'-',_0x765aa5=_0x51673d[_0x3f068d(0x116)]?.['ended_at']?formatRelativeTime(_0x51673d[_0x3f068d(0x116)][_0x3f068d(0x10e)]):_0x3f068d(0x14f),_0x3406f8=_0x51673d['next_run_at']?formatRelativeTime(_0x51673d['next_run_at']):'-',_0x1f353b=_0x51673d['cron']||'',_0x5036d9=_0x51673d['name']||_0x3f068d(0x109),_0x170073=getConsoleUrl(_0x41d489,_0x3f068d(0x183)+_0x51673d['id']);return{'statusIcon':_0x4f84ed,'lastRun':_0x765aa5,'nextRun':_0x3406f8,'cron':_0x1f353b,'name':_0x5036d9,'queryUrl':_0x170073,'status':_0x51673d[_0x3f068d(0x116)]?.[_0x3f068d(0x147)]};}),_0x51970c=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0xb3dff=>_0xb3dff[_0x1c67c8(0x118)][_0x1c67c8(0x18c)])),_0x106dde=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0x11c782=>_0x11c782[_0x1c67c8(0x149)][_0x1c67c8(0x18c)])),_0xd6fadc=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0x1d4bb3=>_0x1d4bb3['cron'][_0x1c67c8(0x18c)])),_0x5e4c73=_0x14d969[_0x1c67c8(0x175)](_0xef3bff=>{const _0x339e8a=_0x1c67c8,_0x3aa5b2=_0xef3bff[_0x339e8a(0x147)]===_0x339e8a(0x121)?a34_0x2e487a[_0x339e8a(0x18d)](_0xef3bff[_0x339e8a(0x114)]):_0xef3bff[_0x339e8a(0x147)]===_0x339e8a(0x13d)?a34_0x2e487a[_0x339e8a(0x174)](_0xef3bff[_0x339e8a(0x114)]):a34_0x2e487a[_0x339e8a(0x188)](_0xef3bff[_0x339e8a(0x114)]),_0x65c2=_0xef3bff['lastRun']['padEnd'](_0x51970c),_0x4695f4=_0xef3bff[_0x339e8a(0x149)][_0x339e8a(0x172)](_0x106dde),_0x310776=_0xef3bff[_0x339e8a(0x16c)]?a34_0x2e487a[_0x339e8a(0x180)](_0xef3bff[_0x339e8a(0x16c)][_0x339e8a(0x172)](_0xd6fadc)):'\x20'[_0x339e8a(0x164)](_0xd6fadc),_0x27c76d=hyperlink(_0xef3bff[_0x339e8a(0x140)],_0xef3bff[_0x339e8a(0x159)]);return _0x339e8a(0x151)+_0x3aa5b2+'\x20'+_0x65c2+_0x339e8a(0x137)+_0x4695f4+'\x20\x20'+_0x310776+'\x20\x20'+_0x27c76d;});await writeOutput(_0x5e4c73['join']('\x0a'),_0x5240c7[_0x1c67c8(0x13c)],_0x1c67c8(0x1a1));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x9bfb35(0x124);['description']='Show\x20schedule\x20details';['validate'](_0x15e571){const _0x5240a0=a34_0x9bfb35,_0x2afca0=_0x15e571[_0x5240a0(0x135)][0x0];if(!_0x2afca0)return _0x5240a0(0x13b);return undefined;}async[a34_0x9bfb35(0x15e)](_0x1f0807){const _0x256f48=a34_0x9bfb35,{options:_0x121ffe,args:_0x293e8a,tdx:_0x44d0af}=_0x1f0807,_0x35dc70=_0x293e8a[0x0],_0x57149a=await withSpinner(_0x256f48(0x112),()=>_0x44d0af['schedules'][_0x256f48(0x150)](_0x35dc70),{'verbose':_0x121ffe[_0x256f48(0x125)]}),_0x535214=_0x57149a[_0x256f48(0x11d)],_0xbd3e0c={'name':_0x535214['name'],'cron':_0x535214[_0x256f48(0x16c)],'database':_0x535214[_0x256f48(0x178)],'type':_0x535214['type'],'timezone':_0x535214[_0x256f48(0x14c)],'user_name':_0x535214[_0x256f48(0x145)],'created_at':_0x535214[_0x256f48(0x187)],'engine_version':_0x535214['engine_version'],'executing_user_id':_0x535214[_0x256f48(0x13e)],'query':_0x535214['query'],'delay':_0x535214['delay'],'priority':_0x535214['priority'],'retry_limit':_0x535214[_0x256f48(0x161)],..._0x535214[_0x256f48(0x173)]&&{'result':_0x535214[_0x256f48(0x173)]}};return await handleSingleObjectOutput(_0xbd3e0c,_0x121ffe),0x0;}}function a34_0xcb4f(_0x24dd3d,_0x39d8a3){_0x24dd3d=_0x24dd3d-0x107;const _0x2ebe3e=a34_0x2ebe();let _0xcb4f6a=_0x2ebe3e[_0x24dd3d];return _0xcb4f6a;}export class ScheduleCreateCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x143);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x12f);[a34_0x9bfb35(0x14b)](_0x24d00c){const _0x3ac86f=a34_0x9bfb35,_0x45146e=_0x24d00c[_0x3ac86f(0x135)][0x0];if(!_0x45146e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0xf6dcff=_0x24d00c[_0x3ac86f(0x12a)];if(!_0xf6dcff[_0x3ac86f(0x178)])return _0x3ac86f(0x115);return undefined;}async[a34_0x9bfb35(0x15e)](_0x543d9c){const _0x421ba8=a34_0x9bfb35,{options:_0x21618c,args:_0x32aba0,tdx:_0x5290e8}=_0x543d9c,_0x1ae80b=_0x32aba0[0x0],_0x32e6dc=_0x21618c,_0x3ae393=_0x32e6dc[_0x421ba8(0x178)],_0x37b4fa=_0x32e6dc['file'],_0x56b2fb=_0x32e6dc[_0x421ba8(0x138)]||'trino';let _0x325683;try{_0x325683=readFileSync(_0x37b4fa,'utf-8')[_0x421ba8(0x16b)]();}catch(_0x2370a9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x37b4fa,_0x2370a9 instanceof Error?_0x2370a9:undefined);}if(!_0x325683)throw new SDKError(ErrorCode[_0x421ba8(0x16e)],_0x421ba8(0x177));const _0x668d4f={'database':_0x3ae393,'query':_0x325683,'type':_0x56b2fb};if(_0x32e6dc['cron'])_0x668d4f[_0x421ba8(0x16c)]=_0x32e6dc['cron'];if(_0x32e6dc[_0x421ba8(0x14c)])_0x668d4f[_0x421ba8(0x14c)]=_0x32e6dc['timezone'];if(_0x32e6dc[_0x421ba8(0x196)]!==undefined)_0x668d4f[_0x421ba8(0x196)]=Number(_0x32e6dc[_0x421ba8(0x196)]);if(_0x32e6dc[_0x421ba8(0x110)]!==undefined)_0x668d4f[_0x421ba8(0x110)]=Number(_0x32e6dc[_0x421ba8(0x110)]);if(_0x32e6dc[_0x421ba8(0x10c)]!==undefined)_0x668d4f[_0x421ba8(0x161)]=Number(_0x32e6dc['retryLimit']);if(_0x32e6dc[_0x421ba8(0x12e)])_0x668d4f[_0x421ba8(0x171)]=_0x32e6dc[_0x421ba8(0x12e)];if(_0x32e6dc[_0x421ba8(0x173)])_0x668d4f[_0x421ba8(0x173)]=_0x32e6dc[_0x421ba8(0x173)];if(_0x21618c[_0x421ba8(0x125)]){console[_0x421ba8(0x13d)](_0x421ba8(0x142)+_0x1ae80b),console[_0x421ba8(0x13d)](_0x421ba8(0x14e)+_0x3ae393),console[_0x421ba8(0x13d)]('\x20\x20Type:\x20'+_0x56b2fb);if(_0x668d4f[_0x421ba8(0x16c)])console[_0x421ba8(0x13d)](_0x421ba8(0x14a)+_0x668d4f[_0x421ba8(0x16c)]);if(_0x668d4f[_0x421ba8(0x14c)])console[_0x421ba8(0x13d)](_0x421ba8(0x158)+_0x668d4f['timezone']);}const _0x4b06cd=await withSpinner(_0x421ba8(0x16a),()=>_0x5290e8[_0x421ba8(0x18f)][_0x421ba8(0x16d)](_0x1ae80b,_0x668d4f),{'verbose':_0x21618c[_0x421ba8(0x125)]});return console['error'](_0x421ba8(0x15f)+_0x4b06cd['data']['name']),await handleSingleObjectOutput(_0x4b06cd[_0x421ba8(0x11d)],_0x21618c),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a34_0x9bfb35(0x12c);['description']=a34_0x9bfb35(0x19d);[a34_0x9bfb35(0x14b)](_0x3e0660){const _0x362048=a34_0x9bfb35,_0x394b33=_0x3e0660[_0x362048(0x135)][0x0];if(!_0x394b33)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a34_0x9bfb35(0x15e)](_0x693fde){const _0x12c391=a34_0x9bfb35,{options:_0xb1548e,args:_0x826e7b,tdx:_0x3bcae3}=_0x693fde,_0x530b24=_0x826e7b[0x0],_0x2e68f9=_0xb1548e,_0x375993={};if(_0x2e68f9[_0x12c391(0x178)])_0x375993[_0x12c391(0x178)]=_0x2e68f9['database'];if(_0x2e68f9['type'])_0x375993[_0x12c391(0x138)]=_0x2e68f9['type'];if(_0x2e68f9[_0x12c391(0x16c)])_0x375993['cron']=_0x2e68f9[_0x12c391(0x16c)];if(_0x2e68f9[_0x12c391(0x14c)])_0x375993[_0x12c391(0x14c)]=_0x2e68f9[_0x12c391(0x14c)];if(_0x2e68f9['delay']!==undefined)_0x375993['delay']=Number(_0x2e68f9[_0x12c391(0x196)]);if(_0x2e68f9['priority']!==undefined)_0x375993[_0x12c391(0x110)]=Number(_0x2e68f9['priority']);if(_0x2e68f9[_0x12c391(0x10c)]!==undefined)_0x375993[_0x12c391(0x161)]=Number(_0x2e68f9['retryLimit']);if(_0x2e68f9['engineVersion'])_0x375993[_0x12c391(0x171)]=_0x2e68f9[_0x12c391(0x12e)];if(_0x2e68f9[_0x12c391(0x173)])_0x375993[_0x12c391(0x173)]=_0x2e68f9['result'];if(_0x2e68f9['file'])try{_0x375993[_0x12c391(0x1a0)]=readFileSync(_0x2e68f9[_0x12c391(0x148)],_0x12c391(0x12d))[_0x12c391(0x16b)]();}catch(_0x511af1){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12c391(0x193)+_0x2e68f9[_0x12c391(0x148)],_0x511af1 instanceof Error?_0x511af1:undefined);}if(Object[_0x12c391(0x189)](_0x375993)[_0x12c391(0x18c)]===0x0)throw new SDKError(ErrorCode[_0x12c391(0x16e)],_0x12c391(0x127));if(_0xb1548e['verbose']){console['error'](_0x12c391(0x139)+_0x530b24);for(const [_0x16e2d0,_0x7b0fca]of Object[_0x12c391(0x197)](_0x375993)){_0x16e2d0===_0x12c391(0x1a0)?console['error']('\x20\x20'+_0x16e2d0+':\x20'+_0x7b0fca[_0x12c391(0x17a)](0x0,0x32)+_0x12c391(0x160)):console[_0x12c391(0x13d)]('\x20\x20'+_0x16e2d0+':\x20'+_0x7b0fca);}}const _0x2611f3=await withSpinner(_0x12c391(0x11c),()=>_0x3bcae3[_0x12c391(0x18f)][_0x12c391(0x165)](_0x530b24,_0x375993),{'verbose':_0xb1548e['verbose']});return console[_0x12c391(0x13d)](_0x12c391(0x11a)+_0x2611f3['data'][_0x12c391(0x140)]),await handleSingleObjectOutput(_0x2611f3[_0x12c391(0x11d)],_0xb1548e),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x190);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x17d);['validate'](_0xce91b){const _0x1fc1ed=a34_0x9bfb35,_0x335979=_0xce91b[_0x1fc1ed(0x135)][0x0];if(!_0x335979)return _0x1fc1ed(0x162);return undefined;}async[a34_0x9bfb35(0x15e)](_0x1684f0){const _0x13cd89=a34_0x9bfb35,{options:_0x5476fe,args:_0x378243,tdx:_0x15d0cf}=_0x1684f0,_0x5ae915=_0x378243[0x0];if(!_0x5476fe['yes']){const _0x5b0c89=await confirm(_0x13cd89(0x181)+_0x5ae915+'\x22?');if(!_0x5b0c89)return console[_0x13cd89(0x13d)](_0x13cd89(0x179)),0x0;}const _0xfda51f=await withSpinner(_0x13cd89(0x117),()=>_0x15d0cf[_0x13cd89(0x18f)][_0x13cd89(0x107)](_0x5ae915),{'verbose':_0x5476fe[_0x13cd89(0x125)]});return console[_0x13cd89(0x13d)](_0x13cd89(0x192)+_0xfda51f[_0x13cd89(0x11d)][_0x13cd89(0x140)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x111);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x166);['validate'](_0x573f17){const _0x571df2=a34_0x9bfb35,_0x57ce8d=_0x573f17[_0x571df2(0x135)][0x0];if(!_0x57ce8d)return _0x571df2(0x19a);return undefined;}async[a34_0x9bfb35(0x15e)](_0x161429){const _0xe58d9c=a34_0x9bfb35,{options:_0x6efc28,args:_0x4241cd,tdx:_0x5670b1}=_0x161429,_0x616b53=_0x4241cd[0x0],_0x18234e=_0x6efc28,_0x1d0658=_0x18234e[_0xe58d9c(0x176)],_0x5caa55=_0x18234e[_0xe58d9c(0x19c)]!==undefined?Number(_0x18234e[_0xe58d9c(0x19c)]):undefined;if(_0x6efc28[_0xe58d9c(0x125)]){console[_0xe58d9c(0x13d)]('Running\x20schedule:\x20'+_0x616b53);if(_0x1d0658)console[_0xe58d9c(0x13d)](_0xe58d9c(0x113)+_0x1d0658);if(_0x5caa55)console[_0xe58d9c(0x13d)](_0xe58d9c(0x128)+_0x5caa55);}const _0xdfc6f8=await withSpinner(_0xe58d9c(0x10b),()=>_0x5670b1[_0xe58d9c(0x18f)]['run'](_0x616b53,{'time':_0x1d0658,'num':_0x5caa55}),{'verbose':_0x6efc28[_0xe58d9c(0x125)]}),_0x1a581f=_0xdfc6f8[_0xe58d9c(0x11d)]['jobs'];console[_0xe58d9c(0x13d)]('Schedule\x20run\x20submitted:\x20'+_0x1a581f['length']+_0xe58d9c(0x157)+(_0x1a581f['length']!==0x1?'s':'')+_0xe58d9c(0x18b));for(const _0x47b8e1 of _0x1a581f){console['error'](_0xe58d9c(0x185)+_0x47b8e1[_0xe58d9c(0x168)]);}return await handleSDKOutput(_0x1a581f,_0x6efc28),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x10f);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x199);['validate'](_0x4edf08){const _0x313bf7=a34_0x9bfb35,_0x26bd68=_0x4edf08[_0x313bf7(0x135)][0x0];if(!_0x26bd68)return _0x313bf7(0x10a);return undefined;}async['execute'](_0x3c74f5){const _0x4ebc09=a34_0x9bfb35,{options:_0x3d7d4b,args:_0x340d98,tdx:_0x47167f}=_0x3c74f5,_0x368ca9=_0x340d98[0x0],_0x2d5b01=_0x3d7d4b,_0x57b7c6=_0x2d5b01[_0x4ebc09(0x198)]!==undefined?Number(_0x2d5b01[_0x4ebc09(0x198)]):undefined,_0x4823c9=_0x2d5b01['to']!==undefined?Number(_0x2d5b01['to']):undefined,_0x1da94a=await withSpinner('Getting\x20schedule\x20history...',()=>_0x47167f['schedules'][_0x4ebc09(0x134)](_0x368ca9,{'from':_0x57b7c6,'to':_0x4823c9}),{'verbose':_0x3d7d4b[_0x4ebc09(0x125)]}),_0xef89ec=_0x1da94a[_0x4ebc09(0x11d)];console[_0x4ebc09(0x13d)](_0x4ebc09(0x154)+_0xef89ec[_0x4ebc09(0x19e)]+_0x4ebc09(0x17f)+(_0xef89ec[_0x4ebc09(0x19e)]!==0x1?'s':'')+_0x4ebc09(0x163)+_0xef89ec[_0x4ebc09(0x198)]+'-'+_0xef89ec['to']+')');const _0x222059=_0xef89ec[_0x4ebc09(0x134)][_0x4ebc09(0x175)](_0x91d754=>({'job_id':_0x91d754['job_id'],'type':_0x91d754[_0x4ebc09(0x138)],'status':_0x91d754[_0x4ebc09(0x147)],'scheduled_at':_0x91d754[_0x4ebc09(0x153)],'created_at':_0x91d754[_0x4ebc09(0x187)],'start_at':_0x91d754['start_at'],'end_at':_0x91d754[_0x4ebc09(0x15d)]}));return await handleSDKOutput(_0x222059,_0x3d7d4b),0x0;}}
|
|
1
|
+
const a34_0x25e1d1=a34_0x1b84;(function(_0x2dc335,_0xcfa7e7){const _0x39a728=a34_0x1b84,_0x2d4918=_0x2dc335();while(!![]){try{const _0x1e723f=parseInt(_0x39a728(0x193))/0x1+parseInt(_0x39a728(0x122))/0x2*(parseInt(_0x39a728(0x14b))/0x3)+parseInt(_0x39a728(0x192))/0x4*(parseInt(_0x39a728(0x164))/0x5)+parseInt(_0x39a728(0x17d))/0x6+-parseInt(_0x39a728(0x120))/0x7+-parseInt(_0x39a728(0x10f))/0x8*(parseInt(_0x39a728(0x169))/0x9)+-parseInt(_0x39a728(0x13f))/0xa;if(_0x1e723f===_0xcfa7e7)break;else _0x2d4918['push'](_0x2d4918['shift']());}catch(_0x40351c){_0x2d4918['push'](_0x2d4918['shift']());}}}(a34_0x273d,0x70cef));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x1b84(_0xc17d5,_0x3b039d){_0xc17d5=_0xc17d5-0x10d;const _0x273dde=a34_0x273d();let _0x1b8495=_0x273dde[_0xc17d5];return _0x1b8495;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x3bc83c from'chalk';function formatRelativeTime(_0x4046b0){const _0x63bc34=a34_0x1b84,_0x10f5c9=new Date(_0x4046b0),_0x220d95=new Date(),_0x4e664c=_0x10f5c9[_0x63bc34(0x16f)]()-_0x220d95['getTime'](),_0x4fde44=Math[_0x63bc34(0x12e)](_0x4e664c)/0x3e8,_0x16ab2e=_0x4e664c<0x0;if(_0x4fde44<0x3c)return _0x16ab2e?_0x63bc34(0x162):'soon';else{if(_0x4fde44<0xe10){const _0x472502=Math[_0x63bc34(0x12c)](_0x4fde44/0x3c);return _0x16ab2e?_0x472502+_0x63bc34(0x176):_0x63bc34(0x121)+_0x472502+'m';}else{if(_0x4fde44<0x15180){const _0x58af5c=Math['round'](_0x4fde44/0xe10);return _0x16ab2e?_0x58af5c+_0x63bc34(0x14f):'in\x20'+_0x58af5c+'h';}else{if(_0x4fde44<0x93a80){const _0x439cfb=Math[_0x63bc34(0x12c)](_0x4fde44/0x15180);return _0x16ab2e?_0x439cfb+_0x63bc34(0x115):'in\x20'+_0x439cfb+'d';}else return _0x10f5c9[_0x63bc34(0x117)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x19d);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x15e);async[a34_0x25e1d1(0x16d)](_0x1e039b){const _0x159f83=a34_0x25e1d1,{options:_0x30b8a7,args:_0x3995ed,tdx:_0x12bd1e}=_0x1e039b,_0x985f08=resolveLimit(_0x30b8a7['limit'],DEFAULT_DISPLAY_LIMIT),_0x117b4b=_0x3995ed[0x0],_0x53303c=_0x117b4b?_0x159f83(0x174)+_0x117b4b+_0x159f83(0x158):_0x159f83(0x11a),_0x42b5af=await withSpinner(_0x53303c,()=>_0x12bd1e['schedules'][_0x159f83(0x18e)]({'limit':_0x985f08,'scheduled':!![],'pattern':_0x117b4b}),{'verbose':_0x30b8a7[_0x159f83(0x154)]}),_0x55058d=_0x42b5af['data'][_0x159f83(0x134)],_0x2f1919=_0x42b5af['data'][_0x159f83(0x179)][_0x159f83(0x199)],_0x332063=_0x117b4b?_0x159f83(0x14c)+_0x117b4b+'\x22':'';_0x2f1919?console[_0x159f83(0x171)](_0x159f83(0x127)+_0x55058d[_0x159f83(0x182)]+'\x20schedules'+_0x332063+_0x159f83(0x16c)):console[_0x159f83(0x171)](_0x159f83(0x118)+_0x55058d[_0x159f83(0x182)]+_0x159f83(0x15d)+(_0x55058d[_0x159f83(0x182)]!==0x1?_0x159f83(0x144):'y')+_0x332063);if(_0x30b8a7['format']===_0x159f83(0x123)||_0x30b8a7[_0x159f83(0x12f)]===_0x159f83(0x18c)||_0x30b8a7['format']===_0x159f83(0x183)||_0x30b8a7[_0x159f83(0x12f)]==='tsv'){const _0x537e52=_0x55058d[_0x159f83(0x16b)](_0x52abed=>({'id':_0x52abed['id'],'name':_0x52abed['name'],'cron':_0x52abed[_0x159f83(0x11e)],'database':_0x52abed['database']?.[_0x159f83(0x15c)],'type':_0x52abed[_0x159f83(0x19c)],'timezone':_0x52abed[_0x159f83(0x17a)],'user_name':_0x52abed[_0x159f83(0x17b)]?.['name'],'updated_at':_0x52abed['updated_at'],'next_run_at':_0x52abed[_0x159f83(0x18a)],'last_job_status':_0x52abed[_0x159f83(0x116)]?.[_0x159f83(0x124)]}));await handleSDKOutput(_0x537e52,_0x30b8a7);}else{if(_0x55058d['length']===0x0)console[_0x159f83(0x140)](_0x159f83(0x14a));else{const _0x2124d4=_0x30b8a7['site'],_0x593e9f=_0x55058d['map'](_0x30fd74=>{const _0x49a543=_0x159f83,_0x969e61=_0x30fd74[_0x49a543(0x116)]?.['status']?_0x30fd74['last_job']['status']==='success'?'β':'β':'-',_0x4fe268=_0x30fd74['last_job']?.[_0x49a543(0x148)]?formatRelativeTime(_0x30fd74['last_job'][_0x49a543(0x148)]):'never',_0x2b4c7b=_0x30fd74[_0x49a543(0x18a)]?formatRelativeTime(_0x30fd74[_0x49a543(0x18a)]):'-',_0x2d9204=_0x30fd74['cron']||'',_0x36a562=_0x30fd74[_0x49a543(0x15c)]||_0x49a543(0x198),_0x40f941=getConsoleUrl(_0x2124d4,_0x49a543(0x110)+_0x30fd74['id']);return{'statusIcon':_0x969e61,'lastRun':_0x4fe268,'nextRun':_0x2b4c7b,'cron':_0x2d9204,'name':_0x36a562,'queryUrl':_0x40f941,'status':_0x30fd74[_0x49a543(0x116)]?.[_0x49a543(0x124)]};}),_0xfdc602=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x52d6b9=>_0x52d6b9['lastRun']['length'])),_0x3cd33c=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x2af7ac=>_0x2af7ac['nextRun'][_0x159f83(0x182)])),_0x1e8bba=Math[_0x159f83(0x130)](..._0x593e9f['map'](_0x559f0b=>_0x559f0b[_0x159f83(0x11e)]['length'])),_0x2e300f=_0x593e9f[_0x159f83(0x16b)](_0x364cf5=>{const _0x2c79c8=_0x159f83,_0x53f663=_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x15b)?a34_0x3bc83c[_0x2c79c8(0x114)](_0x364cf5['statusIcon']):_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x171)?a34_0x3bc83c[_0x2c79c8(0x194)](_0x364cf5[_0x2c79c8(0x155)]):a34_0x3bc83c[_0x2c79c8(0x135)](_0x364cf5[_0x2c79c8(0x155)]),_0x53ae25=_0x364cf5['lastRun']['padEnd'](_0xfdc602),_0x901ef7=_0x364cf5[_0x2c79c8(0x137)][_0x2c79c8(0x186)](_0x3cd33c),_0x59247e=_0x364cf5[_0x2c79c8(0x11e)]?a34_0x3bc83c[_0x2c79c8(0x18b)](_0x364cf5[_0x2c79c8(0x11e)][_0x2c79c8(0x186)](_0x1e8bba)):'\x20'['repeat'](_0x1e8bba),_0xd697c3=hyperlink(_0x364cf5[_0x2c79c8(0x15c)],_0x364cf5[_0x2c79c8(0x147)]);return'π
\x20'+_0x53f663+'\x20'+_0x53ae25+'\x20\x20β\x20'+_0x901ef7+'\x20\x20'+_0x59247e+'\x20\x20'+_0xd697c3;});await writeOutput(_0x2e300f[_0x159f83(0x161)]('\x0a'),_0x30b8a7[_0x159f83(0x12a)],_0x159f83(0x172));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x25e1d1(0x159);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x143);[a34_0x25e1d1(0x19f)](_0xf551e1){const _0x345e5a=a34_0x25e1d1,_0x97b142=_0xf551e1[_0x345e5a(0x14d)][0x0];if(!_0x97b142)return _0x345e5a(0x17e);return undefined;}async['execute'](_0x1edeee){const _0x3097f9=a34_0x25e1d1,{options:_0x362f96,args:_0x225fbd,tdx:_0x12152f}=_0x1edeee,_0x3ed755=_0x225fbd[0x0],_0x441d8a=await withSpinner('Getting\x20schedule\x20details...',()=>_0x12152f[_0x3097f9(0x10d)][_0x3097f9(0x13b)](_0x3ed755),{'verbose':_0x362f96['verbose']}),_0x3062e1=_0x441d8a[_0x3097f9(0x185)],_0x2605fc={'name':_0x3062e1['name'],'cron':_0x3062e1['cron'],'database':_0x3062e1[_0x3097f9(0x160)],'type':_0x3062e1[_0x3097f9(0x19c)],'timezone':_0x3062e1[_0x3097f9(0x19b)],'user_name':_0x3062e1['user_name'],'created_at':_0x3062e1['created_at'],'engine_version':_0x3062e1[_0x3097f9(0x11f)],'executing_user_id':_0x3062e1['executing_user_id'],'query':_0x3062e1[_0x3097f9(0x157)],'delay':_0x3062e1[_0x3097f9(0x142)],'priority':_0x3062e1['priority'],'retry_limit':_0x3062e1['retry_limit'],..._0x3062e1[_0x3097f9(0x190)]&&{'result':_0x3062e1['result']}};return await handleSingleObjectOutput(_0x2605fc,_0x362f96),0x0;}}function a34_0x273d(){const _0x4b4c28=['green','d\x20ago','last_job','toLocaleDateString','Found\x20','...','Listing\x20scheduled\x20queries...','Creating\x20schedule...','run','Create\x20a\x20scheduled\x20query','cron','engine_version','1529787evGMXH','in\x20','130362yNxwVz','json','status','Schedule\x20deleted:\x20','Failed\x20to\x20read\x20file:\x20','Showing\x20first\x20','entries','utf-8','output','delete','round','\x20created','abs','format','max','INVALID_ARGUMENT','trino','priority','queries','dim','\x20\x20Cron:\x20','nextRun','schedule:update','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','options','show','schedule:run','time','Updating\x20schedule:\x20','466930kQiwGs','log','keys','delay','Show\x20schedule\x20details','ies','create','\x20\x20Timezone:\x20','queryUrl','ended_at','Cancelled','No\x20scheduled\x20queries\x20found','15aYbAVL','\x20matching\x20\x22','args','schedule:create','h\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','num','retry_limit','\x20\x20Database:\x20','verbose','statusIcon','Deleting\x20schedule...','query','\x22...','schedule:show','\x20\x20Job\x20ID:\x20','success','name','\x20scheduled\x20quer','List\x20scheduled\x20queries','from','database','join','just\x20now','\x20\x20Type:\x20','428015xyuJdn','Delete\x20a\x20scheduled\x20query','Updating\x20schedule...','start_at','engineVersion','82449UaniDp','description','map','\x20(use\x20--limit\x20to\x20see\x20more)','execute','\x20job','getTime','Getting\x20schedule\x20history...','error','list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Searching\x20scheduled\x20queries\x20matching\x20\x22','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','m\x20ago','retryLimit','history','pagination','time_zone','user','\x20\x20Num:\x20','846162hURoum','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Schedule\x20created:\x20','Creating\x20schedule:\x20','length','table','job_id','data','padEnd','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Update\x20a\x20scheduled\x20query','Schedule\x20updated:\x20','next_run_at','cyan','jsonl','update','listQueries','count','result','Run\x20a\x20scheduled\x20query\x20immediately','24hDUxze','58221iUIlgn','red','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','file','\x20(showing\x20','(unnamed)','has_next_page','end_at','timezone','type','schedule:list','trim','validate','schedules','schedule:history','272durldU','/app/queries/editor?queryId=','jobs','Schedule\x20run\x20submitted:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]'];a34_0x273d=function(){return _0x4b4c28;};return a34_0x273d();}export class ScheduleCreateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x14e);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x11d);['validate'](_0x287cdb){const _0x173c13=a34_0x25e1d1,_0x520954=_0x287cdb['args'][0x0];if(!_0x520954)return _0x173c13(0x113);const _0x26568f=_0x287cdb[_0x173c13(0x13a)];if(!_0x26568f['database'])return _0x173c13(0x187);return undefined;}async['execute'](_0x587f62){const _0x338004=a34_0x25e1d1,{options:_0x5cf415,args:_0xf24e99,tdx:_0x48c1fa}=_0x587f62,_0x2012a1=_0xf24e99[0x0],_0x1913f7=_0x5cf415,_0x17d505=_0x1913f7[_0x338004(0x160)],_0x1249d9=_0x1913f7[_0x338004(0x196)],_0x40d503=_0x1913f7['type']||_0x338004(0x132);let _0x4127c7;try{_0x4127c7=readFileSync(_0x1249d9,_0x338004(0x129))[_0x338004(0x19e)]();}catch(_0x327e04){throw new SDKError(ErrorCode[_0x338004(0x131)],_0x338004(0x126)+_0x1249d9,_0x327e04 instanceof Error?_0x327e04:undefined);}if(!_0x4127c7)throw new SDKError(ErrorCode[_0x338004(0x131)],'Query\x20file\x20is\x20empty');const _0x4b3a70={'database':_0x17d505,'query':_0x4127c7,'type':_0x40d503};if(_0x1913f7[_0x338004(0x11e)])_0x4b3a70[_0x338004(0x11e)]=_0x1913f7[_0x338004(0x11e)];if(_0x1913f7[_0x338004(0x19b)])_0x4b3a70[_0x338004(0x19b)]=_0x1913f7['timezone'];if(_0x1913f7['delay']!==undefined)_0x4b3a70[_0x338004(0x142)]=Number(_0x1913f7['delay']);if(_0x1913f7[_0x338004(0x133)]!==undefined)_0x4b3a70[_0x338004(0x133)]=Number(_0x1913f7['priority']);if(_0x1913f7[_0x338004(0x177)]!==undefined)_0x4b3a70[_0x338004(0x152)]=Number(_0x1913f7[_0x338004(0x177)]);if(_0x1913f7[_0x338004(0x168)])_0x4b3a70[_0x338004(0x11f)]=_0x1913f7[_0x338004(0x168)];if(_0x1913f7['result'])_0x4b3a70[_0x338004(0x190)]=_0x1913f7['result'];if(_0x5cf415['verbose']){console['error'](_0x338004(0x181)+_0x2012a1),console[_0x338004(0x171)](_0x338004(0x153)+_0x17d505),console['error'](_0x338004(0x163)+_0x40d503);if(_0x4b3a70['cron'])console['error'](_0x338004(0x136)+_0x4b3a70[_0x338004(0x11e)]);if(_0x4b3a70[_0x338004(0x19b)])console[_0x338004(0x171)](_0x338004(0x146)+_0x4b3a70['timezone']);}const _0x3171bf=await withSpinner(_0x338004(0x11b),()=>_0x48c1fa[_0x338004(0x10d)][_0x338004(0x145)](_0x2012a1,_0x4b3a70),{'verbose':_0x5cf415[_0x338004(0x154)]});return console[_0x338004(0x171)](_0x338004(0x180)+_0x3171bf[_0x338004(0x185)][_0x338004(0x15c)]),await handleSingleObjectOutput(_0x3171bf[_0x338004(0x185)],_0x5cf415),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x138);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x188);['validate'](_0x48c0e4){const _0x3d8fe6=a34_0x25e1d1,_0x126cf2=_0x48c0e4[_0x3d8fe6(0x14d)][0x0];if(!_0x126cf2)return _0x3d8fe6(0x17f);return undefined;}async[a34_0x25e1d1(0x16d)](_0x2acbae){const _0x62d120=a34_0x25e1d1,{options:_0x181255,args:_0xbe3c80,tdx:_0x1a3deb}=_0x2acbae,_0x4c26b3=_0xbe3c80[0x0],_0x397a16=_0x181255,_0x1372a2={};if(_0x397a16['database'])_0x1372a2['database']=_0x397a16[_0x62d120(0x160)];if(_0x397a16['type'])_0x1372a2[_0x62d120(0x19c)]=_0x397a16[_0x62d120(0x19c)];if(_0x397a16[_0x62d120(0x11e)])_0x1372a2[_0x62d120(0x11e)]=_0x397a16[_0x62d120(0x11e)];if(_0x397a16[_0x62d120(0x19b)])_0x1372a2[_0x62d120(0x19b)]=_0x397a16[_0x62d120(0x19b)];if(_0x397a16[_0x62d120(0x142)]!==undefined)_0x1372a2[_0x62d120(0x142)]=Number(_0x397a16[_0x62d120(0x142)]);if(_0x397a16[_0x62d120(0x133)]!==undefined)_0x1372a2['priority']=Number(_0x397a16[_0x62d120(0x133)]);if(_0x397a16['retryLimit']!==undefined)_0x1372a2[_0x62d120(0x152)]=Number(_0x397a16['retryLimit']);if(_0x397a16[_0x62d120(0x168)])_0x1372a2[_0x62d120(0x11f)]=_0x397a16[_0x62d120(0x168)];if(_0x397a16[_0x62d120(0x190)])_0x1372a2['result']=_0x397a16[_0x62d120(0x190)];if(_0x397a16[_0x62d120(0x196)])try{_0x1372a2[_0x62d120(0x157)]=readFileSync(_0x397a16[_0x62d120(0x196)],_0x62d120(0x129))['trim']();}catch(_0x2f6094){throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x126)+_0x397a16[_0x62d120(0x196)],_0x2f6094 instanceof Error?_0x2f6094:undefined);}if(Object[_0x62d120(0x141)](_0x1372a2)[_0x62d120(0x182)]===0x0)throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x175));if(_0x181255['verbose']){console[_0x62d120(0x171)](_0x62d120(0x13e)+_0x4c26b3);for(const [_0x38f8ca,_0x4c0f80]of Object[_0x62d120(0x128)](_0x1372a2)){_0x38f8ca===_0x62d120(0x157)?console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80['substring'](0x0,0x32)+_0x62d120(0x119)):console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80);}}const _0x1d71bd=await withSpinner(_0x62d120(0x166),()=>_0x1a3deb[_0x62d120(0x10d)][_0x62d120(0x18d)](_0x4c26b3,_0x1372a2),{'verbose':_0x181255[_0x62d120(0x154)]});return console[_0x62d120(0x171)](_0x62d120(0x189)+_0x1d71bd[_0x62d120(0x185)][_0x62d120(0x15c)]),await handleSingleObjectOutput(_0x1d71bd[_0x62d120(0x185)],_0x181255),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]='schedule:delete';[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x165);['validate'](_0x1be25b){const _0x255b0a=a34_0x25e1d1,_0x57a308=_0x1be25b[_0x255b0a(0x14d)][0x0];if(!_0x57a308)return _0x255b0a(0x173);return undefined;}async['execute'](_0x134855){const _0x211f17=a34_0x25e1d1,{options:_0x45fd2b,args:_0x469ced,tdx:_0x38e63f}=_0x134855,_0x2e23b2=_0x469ced[0x0];if(!_0x45fd2b['yes']){const _0x157c71=await confirm(_0x211f17(0x139)+_0x2e23b2+'\x22?');if(!_0x157c71)return console[_0x211f17(0x171)](_0x211f17(0x149)),0x0;}const _0x5670e0=await withSpinner(_0x211f17(0x156),()=>_0x38e63f[_0x211f17(0x10d)][_0x211f17(0x12b)](_0x2e23b2),{'verbose':_0x45fd2b[_0x211f17(0x154)]});return console[_0x211f17(0x171)](_0x211f17(0x125)+_0x5670e0[_0x211f17(0x185)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x13c);['description']=a34_0x25e1d1(0x191);[a34_0x25e1d1(0x19f)](_0x4055e1){const _0x2803e9=a34_0x25e1d1,_0x502d13=_0x4055e1[_0x2803e9(0x14d)][0x0];if(!_0x502d13)return _0x2803e9(0x150);return undefined;}async[a34_0x25e1d1(0x16d)](_0x5b420e){const _0xd9f054=a34_0x25e1d1,{options:_0x307897,args:_0x2a15c2,tdx:_0xcc737}=_0x5b420e,_0x3b9ab0=_0x2a15c2[0x0],_0x128e8c=_0x307897,_0x3a3ff3=_0x128e8c[_0xd9f054(0x13d)],_0x1f3b03=_0x128e8c['num']!==undefined?Number(_0x128e8c[_0xd9f054(0x151)]):undefined;if(_0x307897['verbose']){console[_0xd9f054(0x171)]('Running\x20schedule:\x20'+_0x3b9ab0);if(_0x3a3ff3)console['error']('\x20\x20Time:\x20'+_0x3a3ff3);if(_0x1f3b03)console[_0xd9f054(0x171)](_0xd9f054(0x17c)+_0x1f3b03);}const _0x491cb9=await withSpinner('Running\x20schedule...',()=>_0xcc737[_0xd9f054(0x10d)][_0xd9f054(0x11c)](_0x3b9ab0,{'time':_0x3a3ff3,'num':_0x1f3b03}),{'verbose':_0x307897[_0xd9f054(0x154)]}),_0x4a1635=_0x491cb9['data'][_0xd9f054(0x111)];console['error'](_0xd9f054(0x112)+_0x4a1635[_0xd9f054(0x182)]+_0xd9f054(0x16e)+(_0x4a1635[_0xd9f054(0x182)]!==0x1?'s':'')+_0xd9f054(0x12d));for(const _0x5417ae of _0x4a1635){console[_0xd9f054(0x171)](_0xd9f054(0x15a)+_0x5417ae[_0xd9f054(0x184)]);}return await handleSDKOutput(_0x4a1635,_0x307897),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x10e);[a34_0x25e1d1(0x16a)]='Show\x20schedule\x20execution\x20history';[a34_0x25e1d1(0x19f)](_0x18b4b9){const _0x3d6ab8=a34_0x25e1d1,_0x131698=_0x18b4b9[_0x3d6ab8(0x14d)][0x0];if(!_0x131698)return _0x3d6ab8(0x195);return undefined;}async[a34_0x25e1d1(0x16d)](_0xfd1fe8){const _0x593008=a34_0x25e1d1,{options:_0x4913aa,args:_0x502639,tdx:_0x47a0b0}=_0xfd1fe8,_0x484158=_0x502639[0x0],_0x53d000=_0x4913aa,_0x142c21=_0x53d000[_0x593008(0x15f)]!==undefined?Number(_0x53d000[_0x593008(0x15f)]):undefined,_0x58e717=_0x53d000['to']!==undefined?Number(_0x53d000['to']):undefined,_0x22d0be=await withSpinner(_0x593008(0x170),()=>_0x47a0b0[_0x593008(0x10d)][_0x593008(0x178)](_0x484158,{'from':_0x142c21,'to':_0x58e717}),{'verbose':_0x4913aa[_0x593008(0x154)]}),_0x412eaa=_0x22d0be[_0x593008(0x185)];console[_0x593008(0x171)]('Found\x20'+_0x412eaa[_0x593008(0x18f)]+'\x20execution'+(_0x412eaa[_0x593008(0x18f)]!==0x1?'s':'')+_0x593008(0x197)+_0x412eaa[_0x593008(0x15f)]+'-'+_0x412eaa['to']+')');const _0x16bd74=_0x412eaa['history'][_0x593008(0x16b)](_0x262f92=>({'job_id':_0x262f92[_0x593008(0x184)],'type':_0x262f92[_0x593008(0x19c)],'status':_0x262f92[_0x593008(0x124)],'scheduled_at':_0x262f92['scheduled_at'],'created_at':_0x262f92['created_at'],'start_at':_0x262f92[_0x593008(0x167)],'end_at':_0x262f92[_0x593008(0x19a)]}));return await handleSDKOutput(_0x16bd74,_0x4913aa),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x1189b6=a35_0x303a;function a35_0x303a(_0x16c3d1,_0x56f5f6){_0x16c3d1=_0x16c3d1-0xc7;const _0x4f5a91=a35_0x4f5a();let _0x303a47=_0x4f5a91[_0x16c3d1];return _0x303a47;}(function(_0x1e95c5,_0x1c9e20){const _0x36e8db=a35_0x303a,_0x13884a=_0x1e95c5();while(!![]){try{const _0x1dd5d8=-parseInt(_0x36e8db(0xf9))/0x1+parseInt(_0x36e8db(0x148))/0x2+-parseInt(_0x36e8db(0x147))/0x3+-parseInt(_0x36e8db(0xcf))/0x4*(-parseInt(_0x36e8db(0xfa))/0x5)+parseInt(_0x36e8db(0xe5))/0x6*(parseInt(_0x36e8db(0x105))/0x7)+parseInt(_0x36e8db(0xd4))/0x8*(parseInt(_0x36e8db(0xeb))/0x9)+parseInt(_0x36e8db(0x103))/0xa*(parseInt(_0x36e8db(0x13e))/0xb);if(_0x1dd5d8===_0x1c9e20)break;else _0x13884a['push'](_0x13884a['shift']());}catch(_0xd60164){_0x13884a['push'](_0x13884a['shift']());}}}(a35_0x4f5a,0x231fa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a35_0x4f5a(){const _0x14f660=['Fetching\x20SQL\x20from\x20rule...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','174852RHwdTr','56365OXxoGb','Show\x20child\x20segment\x20schema\x20(column\x20types)','jsonl','\x20\x20Cause:\x20','parent','replace','log','/app/ps/','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','30dSSOAf','site','7ayhLVR','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:view','Resolving\x20parent\x20folder\x20\x27','segment:desc','Executing\x20segment\x20query...','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolving\x20\x27','segment','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Fetching\x20folder\x20details...','toLocaleString','Error:\x20Folder\x20reference\x20is\x20required','segment:folder:list','getSQLFromYamlFile','Resolved\x20folder\x20ID:\x20','Parent\x20name:\x20','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','green','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','/e/','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20type:\x20','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20parent\x20ID:\x20','\x20\x20Full\x20path:\x20','resolveFolderId','error','Segment\x20ID:\x20','resolveParentId','Examples:','\x27...','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Fetching\x20folder\x20\x27','message','query','SQL\x20query:\x0a','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20relative\x20path\x20to:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getSegmentSQL','Creating\x20folder\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20Segment\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','Folder\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','elapsedTimeMillis','Resolved:\x20','getSQLFromServerSegment','setJobId','description','Parent\x20segment:\x20','771441FZjYSm','folderPath','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','data','Parent\x20ID:\x20','red','Use:\x20tdx\x20ps\x20show','code','INVALID_ARGUMENT','813585YxomZe','219218IfVOpa','cause','getFolder','segmentId','createFolder','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:create','cyan','test','Error:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentFolder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','trim','web','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','jobId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','fullPath','path','Target\x20path:\x20','Options:','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','stats','\x20rows\x20','Site:\x20','in\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','Usage:\x20tdx\x20sg\x20desc\x20<name>','segment:sql','limit','Fetching\x20SQL\x20for\x20segment...','execute','Resolved\x20parent\x20folder\x20ID:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','includes','Resolving\x20folder\x20\x27','resolvePathToResource','8XkoaNT','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','Use:\x20tdx\x20ps\x20desc','\x20\x20Folder\x20path:\x20','folder','923344vAjTSC','\x20\x20tdx\x20sg\x20sql\x20--path\x20','verbose','parentId','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','SELECT\x20*\x20FROM\x20(\x0a','folderId','Error:\x20Parent\x20segment\x20name\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segment:describe','segmentName','content','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','791682QhwDQB','parentSegment','getSegment','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','β\x20Created\x20folder\x20\x27','9ROMVZL','SEGMENT_NOT_FOUND','getParent','segment:show','β\x20Query\x20completed:\x20Processed\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','url','type','Use:\x20tdx\x20ps\x20view'];a35_0x4f5a=function(){return _0x14f660;};return a35_0x4f5a();}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_0x2f1bdc from'chalk';async function resolveSegmentTarget(_0x4983cc,_0x5d7e4c,_0x531623){const _0x1d898d=a35_0x303a;if(isYamlFilePath(_0x4983cc))try{const _0xbe11c6=await resolveYamlFilePath(_0x4983cc);return _0x531623&&(console[_0x1d898d(0x124)]('Resolved\x20YAML\x20file:\x20'+_0x4983cc),console[_0x1d898d(0x124)]('\x20\x20Parent\x20segment:\x20'+_0xbe11c6[_0x1d898d(0xe6)]),console['error'](_0x1d898d(0x134)+_0xbe11c6[_0x1d898d(0xe0)]),console[_0x1d898d(0x124)](_0x1d898d(0xd2)+(_0xbe11c6[_0x1d898d(0x13f)]||'(root)')),console[_0x1d898d(0x124)](_0x1d898d(0x122)+_0xbe11c6[_0x1d898d(0x15b)])),_0xbe11c6['fullPath'];}catch(_0x160e4e){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d898d(0xde)+_0x160e4e['message']);}if(!_0x5d7e4c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d898d(0x130));return _0x5d7e4c+'/'+_0x4983cc;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0xdf);['description']=a35_0x1189b6(0x10f);async[a35_0x1189b6(0xc9)](_0x24e67a){const _0x37f148=a35_0x1189b6,{options:_0x7c053d,args:_0x56a7a7,tdx:_0x36ed1e}=_0x24e67a,_0x37826b=_0x56a7a7[0x0],_0x7a2d12=!_0x37826b&&!!_0x7c053d[_0x37f148(0xe6)],_0x4ed645=_0x37826b||_0x7c053d[_0x37f148(0xe6)];if(!_0x4ed645)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x37f148(0x124)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x37f148(0x124)]('Examples:'),console[_0x37f148(0x124)](_0x37f148(0xf6)),console[_0x37f148(0x124)](_0x37f148(0x106)),console[_0x37f148(0x124)](_0x37f148(0xf1)),console['error'](_0x37f148(0x155)),0x1;try{const _0x1d032e=_0x7c053d['segmentPath'];let _0x2b35b4=_0x4ed645;!_0x7a2d12&&_0x1d032e&&!_0x4ed645[_0x37f148(0xcc)]('/')&&(_0x2b35b4=_0x1d032e+'/'+_0x4ed645,_0x7c053d['verbose']&&console[_0x37f148(0x124)](_0x37f148(0x12f)+_0x2b35b4));const _0x1bfe2b=await withSpinner('Resolving\x20path\x20\x27'+_0x2b35b4+_0x37f148(0x128),()=>_0x36ed1e[_0x37f148(0x10e)][_0x37f148(0xce)](_0x2b35b4),{'verbose':_0x7c053d[_0x37f148(0xd6)]}),_0x2cae62=_0x1bfe2b[_0x37f148(0x141)];_0x7c053d[_0x37f148(0xd6)]&&(console[_0x37f148(0x124)](_0x37f148(0x11e)+_0x2cae62[_0x37f148(0xf3)]),console[_0x37f148(0x124)](_0x37f148(0x142)+_0x2cae62[_0x37f148(0xd7)]),_0x2cae62['folderId']&&console[_0x37f148(0x124)](_0x37f148(0x136)+_0x2cae62[_0x37f148(0xdc)]),_0x2cae62[_0x37f148(0x14b)]&&console[_0x37f148(0x124)](_0x37f148(0x125)+_0x2cae62[_0x37f148(0x14b)]));if(_0x2cae62['type']==='parent'){const _0x537ae7=await withSpinner(_0x37f148(0x10b),()=>_0x36ed1e['segment'][_0x37f148(0xed)](_0x2cae62['parentId']),{'verbose':_0x7c053d[_0x37f148(0xd6)]});await handleSingleObjectOutput(_0x537ae7[_0x37f148(0x141)],_0x7c053d);}else{if(_0x2cae62[_0x37f148(0xf3)]===_0x37f148(0xd3)){if(!_0x2cae62[_0x37f148(0xdc)])throw new SDKError(ErrorCode[_0x37f148(0xe4)],_0x37f148(0x14e));const _0x16e984=await withSpinner('Fetching\x20folder\x20details...',()=>_0x36ed1e[_0x37f148(0x10e)]['getFolder'](_0x2cae62[_0x37f148(0xdc)]),{'verbose':_0x7c053d[_0x37f148(0xd6)]});await handleSingleObjectOutput(_0x16e984[_0x37f148(0x141)],_0x7c053d);}else{if(_0x2cae62[_0x37f148(0xf3)]==='segment'){if(!_0x2cae62[_0x37f148(0x14b)])throw new SDKError(ErrorCode[_0x37f148(0xec)],_0x37f148(0x137));const _0x3e962b=await withSpinner(_0x37f148(0xe2),()=>_0x36ed1e[_0x37f148(0x10e)][_0x37f148(0xe7)](_0x2cae62[_0x37f148(0xd7)],_0x2cae62['segmentId']),{'verbose':_0x7c053d['verbose']});await handleSingleObjectOutput(_0x3e962b[_0x37f148(0x141)],_0x7c053d);}}}return 0x0;}catch(_0x1f6465){if(_0x1f6465 instanceof SDKError)return console[_0x37f148(0x124)](_0x37f148(0x152)+_0x1f6465[_0x37f148(0x12b)]),_0x1f6465['cause']&&console['error'](_0x37f148(0xfd)+_0x1f6465[_0x37f148(0x149)]),0x1;throw _0x1f6465;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0xee);[a35_0x1189b6(0x13c)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a35_0x1189b6(0xc9)](_0x32db1a){const _0x98ecc3=a35_0x1189b6,{options:_0x1657ec,args:_0x111d2f,tdx:_0x4ac3f1}=_0x32db1a,_0x49750f=_0x111d2f[0x0];if(!_0x49750f)return console[_0x98ecc3(0x124)](_0x98ecc3(0x119)),console['error'](_0x98ecc3(0xd8)),console[_0x98ecc3(0x124)](_0x98ecc3(0x160)),console['error'](_0x98ecc3(0x127)),console['error'](_0x98ecc3(0xe3)),console[_0x98ecc3(0x124)](_0x98ecc3(0x10c)),0x1;try{const _0xa237ff=_0x1657ec[_0x98ecc3(0xe6)],_0x47f0c4=await resolveSegmentTarget(_0x49750f,_0xa237ff,_0x1657ec[_0x98ecc3(0xd6)]);_0x1657ec[_0x98ecc3(0xd6)]&&console[_0x98ecc3(0x124)](_0x98ecc3(0x15d)+_0x47f0c4);const _0x22b5b6=await withSpinner('Resolving\x20\x27'+_0x49750f+_0x98ecc3(0x128),()=>_0x4ac3f1['segment'][_0x98ecc3(0xce)](_0x47f0c4),{'verbose':_0x1657ec[_0x98ecc3(0xd6)]}),_0x3f796b=_0x22b5b6['data'];_0x1657ec[_0x98ecc3(0xd6)]&&(console[_0x98ecc3(0x124)](_0x98ecc3(0x11e)+_0x3f796b[_0x98ecc3(0xf3)]),console['error'](_0x98ecc3(0x142)+_0x3f796b[_0x98ecc3(0xd7)]));if(_0x3f796b[_0x98ecc3(0xf3)]===_0x98ecc3(0xd3))return console[_0x98ecc3(0x124)](_0x98ecc3(0x11d)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x3f796b[_0x98ecc3(0xf3)]===_0x98ecc3(0xfe))return console[_0x98ecc3(0x124)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x98ecc3(0x124)](_0x98ecc3(0x144)),0x1;if(!_0x3f796b[_0x98ecc3(0x14b)])throw new SDKError(ErrorCode[_0x98ecc3(0xec)],_0x98ecc3(0x137));const _0xaa0320=await withSpinner(_0x98ecc3(0xc8),()=>_0x4ac3f1['segment'][_0x98ecc3(0x131)](_0x3f796b['parentId'],_0x3f796b[_0x98ecc3(0x14b)]),{'verbose':_0x1657ec[_0x98ecc3(0xd6)]});let _0x5c64f8=_0xaa0320[_0x98ecc3(0x141)];const _0x5de3f6=resolveLimit(_0x1657ec[_0x98ecc3(0xc7)],DEFAULT_DISPLAY_LIMIT),_0x22b241=/\bLIMIT\s+\d+/i[_0x98ecc3(0x151)](_0x5c64f8);!_0x22b241&&(_0x5c64f8=_0x5c64f8[_0x98ecc3(0x156)]()[_0x98ecc3(0xff)](/;+$/,''),_0x5c64f8=_0x98ecc3(0xdb)+_0x5c64f8+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5de3f6);_0x1657ec['verbose']&&console[_0x98ecc3(0x124)](_0x98ecc3(0x12d)+_0x5c64f8);const _0x3e4ed4=await withProgressSpinner(_0x98ecc3(0x10a),async _0x4c9d9d=>{const _0x1dc1c8=_0x98ecc3,_0x5bdee3=await _0x4ac3f1[_0x1dc1c8(0x12c)][_0x1dc1c8(0xc9)](_0x5c64f8,{'catalog':'td','schema':'information_schema','onJobId':_0x4a66fa=>{const _0x4cbfd0=_0x1dc1c8;_0x4c9d9d[_0x4cbfd0(0x13b)](_0x4a66fa);}});return _0x5bdee3;},{'verbose':_0x1657ec[_0x98ecc3(0xd6)]}),_0xbdd64d=_0x3e4ed4['data'],_0x3f3332=_0xbdd64d[_0x98ecc3(0x159)]?'\x20[Job\x20ID:\x20'+_0xbdd64d[_0x98ecc3(0x159)]+']':'';return console[_0x98ecc3(0x124)](_0x98ecc3(0xef)+_0xbdd64d['stats']['processedRows'][_0x98ecc3(0x112)]()+_0x98ecc3(0x162)+(_0x98ecc3(0x164)+formatElapsed(_0xbdd64d[_0x98ecc3(0x161)][_0x98ecc3(0x138)])+_0x3f3332)),await handleQueryOutput(_0xbdd64d,_0x1657ec),0x0;}catch(_0x934f3f){if(_0x934f3f instanceof SDKError)return console[_0x98ecc3(0x124)]('β\x20Query\x20failed\x20['+_0x934f3f[_0x98ecc3(0x145)]+']'),console[_0x98ecc3(0x124)]('\x0a'+_0x934f3f[_0x98ecc3(0x12b)]),0x1;throw _0x934f3f;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x114);[a35_0x1189b6(0x13c)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a35_0x1189b6(0xc9)](_0x1f459c){const _0x16c157=a35_0x1189b6,{options:_0x31e8cd,args:_0x228481,tdx:_0x3855f3}=_0x1f459c;if(_0x228481['length']===0x0)return console[_0x16c157(0x124)](_0x16c157(0xdd)),console[_0x16c157(0x124)](_0x16c157(0x14d)),0x1;const _0x1752d4=_0x228481[0x0];try{_0x31e8cd[_0x16c157(0xd6)]&&(console['error'](_0x16c157(0x163)+_0x31e8cd[_0x16c157(0x104)]),console[_0x16c157(0x124)](_0x16c157(0x117)+_0x1752d4));const _0x51c652=await withSpinner(_0x16c157(0x135)+_0x1752d4+_0x16c157(0x128),()=>_0x3855f3[_0x16c157(0x10e)][_0x16c157(0x126)](_0x1752d4),{'verbose':_0x31e8cd[_0x16c157(0xd6)]}),_0x16024b=_0x51c652[_0x16c157(0x141)];_0x31e8cd['verbose']&&console[_0x16c157(0x124)](_0x16c157(0x121)+_0x16024b);const _0x278d81=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x1752d4+_0x16c157(0x128),()=>_0x3855f3[_0x16c157(0x10e)]['listFolders'](_0x16024b),{'verbose':_0x31e8cd[_0x16c157(0xd6)]}),_0x41af38=_0x278d81[_0x16c157(0x141)];return console['error']('β\x20Found\x20'+_0x41af38[_0x16c157(0xda)]+'\x20folder'+(_0x41af38[_0x16c157(0xda)]!==0x1?'s':'')),await handleSDKOutput(_0x41af38,_0x31e8cd),0x0;}catch(_0x5af53f){if(_0x5af53f instanceof SDKError)return console[_0x16c157(0x124)](_0x16c157(0x152)+_0x5af53f[_0x16c157(0x12b)]),_0x5af53f[_0x16c157(0x149)]&&console[_0x16c157(0x124)](_0x16c157(0xfd)+_0x5af53f[_0x16c157(0x149)]),0x1;throw _0x5af53f;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a35_0x1189b6(0x13c)]='Show\x20segment\x20folder\x20details';async[a35_0x1189b6(0xc9)](_0x1865cb){const _0x5f3a1d=a35_0x1189b6,{options:_0x318417,args:_0x4eec2b,tdx:_0x4f162d}=_0x1865cb;if(_0x4eec2b['length']===0x0)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0x113)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x44251f,childId:_0x5b69b7}=parseSegmentRef(_0x4eec2b[0x0]);_0x318417[_0x5f3a1d(0xd6)]&&(console['error'](_0x5f3a1d(0x163)+_0x318417[_0x5f3a1d(0x104)]),console[_0x5f3a1d(0x124)](_0x5f3a1d(0x117)+_0x44251f),_0x5b69b7&&console[_0x5f3a1d(0x124)]('Folder\x20name:\x20'+_0x5b69b7));if(!_0x5b69b7)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0xf0)),0x1;const _0x517e92=await withSpinner(_0x5f3a1d(0x135)+_0x44251f+_0x5f3a1d(0x128),()=>_0x4f162d[_0x5f3a1d(0x10e)][_0x5f3a1d(0x126)](_0x44251f),{'verbose':_0x318417[_0x5f3a1d(0xd6)]}),_0x8511e=_0x517e92[_0x5f3a1d(0x141)];_0x318417[_0x5f3a1d(0xd6)]&&console['error'](_0x5f3a1d(0x121)+_0x8511e);const _0x45b62f=await withSpinner(_0x5f3a1d(0xcd)+_0x5b69b7+'\x27...',()=>_0x4f162d[_0x5f3a1d(0x10e)]['resolveFolderId'](_0x8511e,_0x5b69b7),{'verbose':_0x318417[_0x5f3a1d(0xd6)]}),_0x52cc01=_0x45b62f['data'];_0x318417[_0x5f3a1d(0xd6)]&&console[_0x5f3a1d(0x124)](_0x5f3a1d(0x116)+_0x52cc01);const _0xddd838=await withSpinner(_0x5f3a1d(0x12a)+_0x5b69b7+'\x27...',()=>_0x4f162d[_0x5f3a1d(0x10e)][_0x5f3a1d(0x14a)](_0x52cc01),{'verbose':_0x318417[_0x5f3a1d(0xd6)]});return await handleSDKOutput([_0xddd838[_0x5f3a1d(0x141)]],_0x318417),0x0;}catch(_0x5eca75){if(_0x5eca75 instanceof SDKError)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0x152)+_0x5eca75[_0x5f3a1d(0x12b)]),_0x5eca75[_0x5f3a1d(0x149)]&&console[_0x5f3a1d(0x124)](_0x5f3a1d(0xfd)+_0x5eca75[_0x5f3a1d(0x149)]),0x1;throw _0x5eca75;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x167);[a35_0x1189b6(0x13c)]=a35_0x1189b6(0x165);async[a35_0x1189b6(0xc9)](_0x3f532a){const _0x1d97d6=a35_0x1189b6,{options:_0x2e0c05,args:_0x4b4c5c}=_0x3f532a,_0x3c9d72=_0x2e0c05,_0x33322c=_0x3c9d72[_0x1d97d6(0x15c)],_0x371127=_0x4b4c5c[0x0];if(!_0x371127&&!_0x33322c)return console['error'](a35_0x2f1bdc[_0x1d97d6(0x143)](_0x1d97d6(0xf7))),console[_0x1d97d6(0x124)]('Usage:'),console[_0x1d97d6(0x124)](_0x1d97d6(0x118)),console[_0x1d97d6(0x124)](_0x1d97d6(0xd0)),console[_0x1d97d6(0x124)](_0x1d97d6(0x127)),console[_0x1d97d6(0x124)](_0x1d97d6(0x140)),console[_0x1d97d6(0x124)](_0x1d97d6(0x102)),0x1;if(_0x371127&&_0x33322c)return console[_0x1d97d6(0x124)](a35_0x2f1bdc[_0x1d97d6(0x143)](_0x1d97d6(0x11b))),0x1;try{let _0x20260b;if(_0x33322c)_0x20260b=await this[_0x1d97d6(0x115)](_0x33322c,_0x3f532a);else{if(isYamlFilePath(_0x371127))return console[_0x1d97d6(0x124)](a35_0x2f1bdc[_0x1d97d6(0x143)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x1d97d6(0x124)](_0x1d97d6(0xd5)+_0x371127),0x1;else _0x20260b=await this['getSQLFromServerSegment'](_0x371127,_0x3f532a);}return _0x2e0c05['format']==='json'||_0x2e0c05['format']===_0x1d97d6(0xfc)?await handleSDKOutput([{'sql':_0x20260b}],_0x2e0c05):console[_0x1d97d6(0x100)](_0x20260b),0x0;}catch(_0x22801f){if(_0x22801f instanceof SDKError)return console['error'](_0x1d97d6(0x152)+_0x22801f[_0x1d97d6(0x12b)]),_0x22801f['cause']&&console[_0x1d97d6(0x124)]('\x20\x20Cause:\x20'+_0x22801f[_0x1d97d6(0x149)]),0x1;throw _0x22801f;}}async[a35_0x1189b6(0x115)](_0x4c02ca,_0x1a8d57){const _0x8f348f=a35_0x1189b6,{options:_0x12ec42,tdx:_0x52f5cd}=_0x1a8d57;let _0x5d2eca;try{_0x5d2eca=await resolveYamlFilePath(_0x4c02ca);}catch(_0x495d18){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x8f348f(0xde)+_0x495d18[_0x8f348f(0x12b)]);}_0x12ec42[_0x8f348f(0xd6)]&&console[_0x8f348f(0x124)](_0x8f348f(0x139)+_0x5d2eca[_0x8f348f(0xe6)]+'/'+_0x5d2eca[_0x8f348f(0xe0)]);const _0x5eaa7e=await withSpinner(_0x8f348f(0xf5),()=>_0x52f5cd['segment']['getSegmentSQLFromYaml'](_0x5d2eca[_0x8f348f(0xe1)],_0x5d2eca['parentSegment'],_0x5d2eca[_0x8f348f(0xe0)]),{'verbose':_0x12ec42['verbose']});return _0x5eaa7e[_0x8f348f(0x141)];}async[a35_0x1189b6(0x13a)](_0x1e3f8e,_0x226408){const _0x33eb06=a35_0x1189b6,{options:_0x561928,tdx:_0x340d8d}=_0x226408,_0x564b6e=_0x561928[_0x33eb06(0xe6)],_0x18c897=await resolveSegmentTarget(_0x1e3f8e,_0x564b6e,_0x561928[_0x33eb06(0xd6)]);_0x561928[_0x33eb06(0xd6)]&&console[_0x33eb06(0x124)]('Target\x20path:\x20'+_0x18c897);const _0x1fa548=await withSpinner(_0x33eb06(0x10d)+_0x1e3f8e+'\x27...',()=>_0x340d8d['segment']['resolvePathToResource'](_0x18c897),{'verbose':_0x561928[_0x33eb06(0xd6)]}),_0x318571=_0x1fa548[_0x33eb06(0x141)];_0x561928[_0x33eb06(0xd6)]&&(console[_0x33eb06(0x124)](_0x33eb06(0x11e)+_0x318571['type']),console[_0x33eb06(0x124)](_0x33eb06(0x142)+_0x318571[_0x33eb06(0xd7)]));if(_0x318571[_0x33eb06(0xf3)]==='folder')throw new SDKError(ErrorCode[_0x33eb06(0x146)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x318571[_0x33eb06(0xf3)]==='parent')throw new SDKError(ErrorCode[_0x33eb06(0x146)],_0x33eb06(0x158));if(!_0x318571['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x33eb06(0x137));const _0x201628=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x340d8d[_0x33eb06(0x10e)][_0x33eb06(0x131)](_0x318571['parentId'],_0x318571[_0x33eb06(0x14b)]),{'verbose':_0x561928[_0x33eb06(0xd6)]});return _0x201628['data'];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x14f);[a35_0x1189b6(0x13c)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0x1189b6(0xc9)](_0x48dd3a){const _0x194076=a35_0x1189b6,{options:_0x1b10bd,args:_0x3514d3,tdx:_0x53e2dc}=_0x48dd3a,_0x37d263=_0x1b10bd;if(_0x3514d3['length']<0x2)return console[_0x194076(0x124)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x194076(0x124)](_0x194076(0x120)),0x1;const _0x13bcd5=_0x3514d3[0x0],_0x5357af=_0x3514d3[0x1];_0x37d263[_0x194076(0xd6)]&&(console[_0x194076(0x124)](_0x194076(0x163)+_0x37d263[_0x194076(0x104)]),console[_0x194076(0x124)](_0x194076(0x13d)+_0x13bcd5),console[_0x194076(0x124)](_0x194076(0x11f)+_0x5357af));let _0x334727;if(_0x37d263['parentFolder']){const _0x1a96bb=_0x37d263[_0x194076(0x154)],_0x17e4bb=await withSpinner(_0x194076(0x135)+_0x13bcd5+_0x194076(0x128),()=>_0x53e2dc[_0x194076(0x10e)][_0x194076(0x126)](_0x13bcd5),{'verbose':_0x37d263[_0x194076(0xd6)]}),_0x2a1e86=_0x17e4bb[_0x194076(0x141)],_0x2caaa3=await withSpinner(_0x194076(0x108)+_0x1a96bb+_0x194076(0x128),()=>_0x53e2dc['segment'][_0x194076(0x123)](_0x2a1e86,_0x1a96bb),{'verbose':_0x37d263[_0x194076(0xd6)]});_0x334727=_0x2caaa3[_0x194076(0x141)],_0x37d263[_0x194076(0xd6)]&&console[_0x194076(0x124)](_0x194076(0xca)+_0x334727);}const _0x503111={'name':_0x5357af,'description':_0x37d263[_0x194076(0x13c)],'parentFolderId':_0x334727},_0x20c638=await withSpinner(_0x194076(0x132)+_0x5357af+'\x27...',()=>_0x53e2dc[_0x194076(0x10e)][_0x194076(0x14c)](_0x13bcd5,_0x503111),{'verbose':_0x37d263['verbose']}),_0x2b03b4=_0x20c638[_0x194076(0x141)];return console['error'](_0x194076(0xea)+_0x2b03b4[_0x194076(0x15f)]+'\x27\x20with\x20ID:\x20'+_0x2b03b4['id']),await handleSDKOutput([_0x2b03b4],_0x37d263),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x107);[a35_0x1189b6(0x13c)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x1189b6(0xc9)](_0x585169){const _0x3242c4=a35_0x1189b6,{options:_0x5ad2b2,args:_0x1c3b6c,tdx:_0x13593f}=_0x585169,_0x42c46b=_0x1c3b6c[0x0];if(!_0x42c46b)return console[_0x3242c4(0x124)](_0x3242c4(0xe8)),console[_0x3242c4(0x124)](_0x3242c4(0xe9)),console[_0x3242c4(0x124)](_0x3242c4(0x110)),console['error'](_0x3242c4(0x15e)),console[_0x3242c4(0x124)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3242c4(0x124)](_0x3242c4(0x127)),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x3242c4(0x124)](_0x3242c4(0x15a)),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3ab9bf=_0x5ad2b2['parentSegment'],_0x3d670e=await resolveSegmentTarget(_0x42c46b,_0x3ab9bf,_0x5ad2b2[_0x3242c4(0xd6)]);_0x5ad2b2[_0x3242c4(0xd6)]&&console[_0x3242c4(0x124)](_0x3242c4(0x15d)+_0x3d670e);const _0x129c92=await withSpinner(_0x3242c4(0x10d)+_0x42c46b+'\x27...',()=>_0x13593f['segment'][_0x3242c4(0xce)](_0x3d670e),{'verbose':_0x5ad2b2['verbose']}),_0x339b5=_0x129c92[_0x3242c4(0x141)];_0x5ad2b2['verbose']&&(console[_0x3242c4(0x124)](_0x3242c4(0x11e)+_0x339b5[_0x3242c4(0xf3)]),console[_0x3242c4(0x124)]('Parent\x20ID:\x20'+_0x339b5[_0x3242c4(0xd7)]),_0x339b5[_0x3242c4(0xdc)]&&console['error'](_0x3242c4(0x136)+_0x339b5[_0x3242c4(0xdc)]),_0x339b5['segmentId']&&console['error'](_0x3242c4(0x125)+_0x339b5['segmentId']));if(_0x5ad2b2[_0x3242c4(0x157)]){if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0xd3))return console[_0x3242c4(0x124)](_0x3242c4(0xf8)),0x1;if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0xfe))return console[_0x3242c4(0x124)](_0x3242c4(0x12e)),console[_0x3242c4(0x124)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x339b5[_0x3242c4(0x14b)])throw new SDKError(ErrorCode[_0x3242c4(0xec)],_0x3242c4(0x137));const _0xba16d=getConsoleNextUrl(_0x5ad2b2[_0x3242c4(0x104)],'/app/ps/'+_0x339b5[_0x3242c4(0xd7)]+_0x3242c4(0x11c)+_0x339b5[_0x3242c4(0x14b)]);return console['error'](a35_0x2f1bdc[_0x3242c4(0x11a)]('β')+'\x20Opening\x20'+a35_0x2f1bdc[_0x3242c4(0x150)](_0xba16d)),openBrowser(_0xba16d),0x0;}if(_0x339b5[_0x3242c4(0xf3)]==='folder'){if(!_0x339b5[_0x3242c4(0xdc)])throw new SDKError(ErrorCode[_0x3242c4(0xe4)],_0x3242c4(0x14e));const _0x245c01=await withSpinner(_0x3242c4(0x111),()=>_0x13593f[_0x3242c4(0x10e)][_0x3242c4(0x14a)](_0x339b5[_0x3242c4(0xdc)]),{'verbose':_0x5ad2b2[_0x3242c4(0xd6)]});await handleSingleObjectOutput(_0x245c01['data'],_0x5ad2b2);}else{if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0x10e)){if(!_0x339b5[_0x3242c4(0x14b)])throw new SDKError(ErrorCode[_0x3242c4(0xec)],_0x3242c4(0x137));const _0xd695fc=await withSpinner(_0x3242c4(0xe2),()=>_0x13593f[_0x3242c4(0x10e)][_0x3242c4(0xe7)](_0x339b5[_0x3242c4(0xd7)],_0x339b5['segmentId']),{'verbose':_0x5ad2b2[_0x3242c4(0xd6)]}),_0x76ed73=getConsoleNextUrl(_0x5ad2b2[_0x3242c4(0x104)],_0x3242c4(0x101)+_0x339b5[_0x3242c4(0xd7)]+_0x3242c4(0x11c)+_0x339b5[_0x3242c4(0x14b)]),_0x492fba=_0xd695fc['data'];_0x492fba[_0x3242c4(0xf2)]=_0x76ed73,await handleSingleObjectOutput(_0x492fba,_0x5ad2b2);}else return console[_0x3242c4(0x124)](_0x3242c4(0x129)),console[_0x3242c4(0x124)](_0x3242c4(0xf4)),0x1;}return 0x0;}catch(_0x5e3a34){if(_0x5e3a34 instanceof SDKError)return console[_0x3242c4(0x124)](_0x3242c4(0x152)+_0x5e3a34[_0x3242c4(0x12b)]),_0x5e3a34[_0x3242c4(0x149)]&&console[_0x3242c4(0x124)](_0x3242c4(0xfd)+_0x5e3a34[_0x3242c4(0x149)]),0x1;throw _0x5e3a34;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x109);['description']=a35_0x1189b6(0xfb);async['execute'](_0x43fb64){const _0x5d6f4f=a35_0x1189b6,{options:_0x2b7a73,args:_0x2ed826,tdx:_0x43d9c4}=_0x43fb64,_0x4fe4ce=_0x2ed826[0x0];if(!_0x4fe4ce)return console[_0x5d6f4f(0x124)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5d6f4f(0x124)](_0x5d6f4f(0x166)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xd9)),console['error'](_0x5d6f4f(0x127)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x5d6f4f(0x124)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x21ce32=_0x2b7a73[_0x5d6f4f(0xe6)],_0x2c70df=await resolveSegmentTarget(_0x4fe4ce,_0x21ce32,_0x2b7a73[_0x5d6f4f(0xd6)]);_0x2b7a73[_0x5d6f4f(0xd6)]&&console['error']('Target\x20path:\x20'+_0x2c70df);const _0x3ce90d=await withSpinner('Resolving\x20\x27'+_0x4fe4ce+_0x5d6f4f(0x128),()=>_0x43d9c4[_0x5d6f4f(0x10e)]['resolvePathToResource'](_0x2c70df),{'verbose':_0x2b7a73[_0x5d6f4f(0xd6)]}),_0x41e849=_0x3ce90d['data'];_0x2b7a73[_0x5d6f4f(0xd6)]&&(console[_0x5d6f4f(0x124)](_0x5d6f4f(0x11e)+_0x41e849[_0x5d6f4f(0xf3)]),console['error']('Parent\x20ID:\x20'+_0x41e849[_0x5d6f4f(0xd7)]));if(_0x41e849[_0x5d6f4f(0xf3)]==='folder')return console['error'](_0x5d6f4f(0x133)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xcb)),0x1;if(_0x41e849[_0x5d6f4f(0xf3)]==='parent')return console[_0x5d6f4f(0x124)](_0x5d6f4f(0x153)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xd1)),0x1;if(!_0x41e849[_0x5d6f4f(0x14b)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5d6f4f(0x137));const _0x2df12c=await withSpinner(_0x5d6f4f(0xc8),()=>_0x43d9c4[_0x5d6f4f(0x10e)][_0x5d6f4f(0x131)](_0x41e849[_0x5d6f4f(0xd7)],_0x41e849['segmentId']),{'verbose':_0x2b7a73[_0x5d6f4f(0xd6)]}),_0x3c4d25=_0x2df12c[_0x5d6f4f(0x141)],_0x58fc50=await executeSchemaQuery(_0x3c4d25,_0x43d9c4,_0x2b7a73);return await handleQueryOutput(_0x58fc50,_0x2b7a73),0x0;}catch(_0x11dc8c){if(_0x11dc8c instanceof SDKError)return console[_0x5d6f4f(0x124)](_0x5d6f4f(0x152)+_0x11dc8c[_0x5d6f4f(0x12b)]),_0x11dc8c[_0x5d6f4f(0x149)]&&console[_0x5d6f4f(0x124)](_0x5d6f4f(0xfd)+_0x11dc8c[_0x5d6f4f(0x149)]),0x1;throw _0x11dc8c;}}}
|
|
1
|
+
const a35_0x2f6a02=a35_0x45c6;(function(_0x17695e,_0x5aea9c){const _0x1501f9=a35_0x45c6,_0x5261cd=_0x17695e();while(!![]){try{const _0x31f993=parseInt(_0x1501f9(0x15b))/0x1+-parseInt(_0x1501f9(0x179))/0x2+parseInt(_0x1501f9(0x149))/0x3+parseInt(_0x1501f9(0x1d1))/0x4*(-parseInt(_0x1501f9(0x167))/0x5)+parseInt(_0x1501f9(0x156))/0x6+-parseInt(_0x1501f9(0x1d4))/0x7+parseInt(_0x1501f9(0x16c))/0x8;if(_0x31f993===_0x5aea9c)break;else _0x5261cd['push'](_0x5261cd['shift']());}catch(_0x17fcd1){_0x5261cd['push'](_0x5261cd['shift']());}}}(a35_0x2046,0x78bfa));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_0x10ce32 from'chalk';async function resolveSegmentTarget(_0x3eea24,_0x350a51,_0x47ffda){const _0x2c026c=a35_0x45c6;if(isYamlFilePath(_0x3eea24))try{const _0x4eb535=await resolveYamlFilePath(_0x3eea24);return _0x47ffda&&(console[_0x2c026c(0x1c9)](_0x2c026c(0x1c4)+_0x3eea24),console[_0x2c026c(0x1c9)]('\x20\x20Parent\x20segment:\x20'+_0x4eb535['parentSegment']),console[_0x2c026c(0x1c9)](_0x2c026c(0x1bc)+_0x4eb535[_0x2c026c(0x150)]),console['error'](_0x2c026c(0x192)+(_0x4eb535[_0x2c026c(0x178)]||'(root)')),console[_0x2c026c(0x1c9)]('\x20\x20Full\x20path:\x20'+_0x4eb535[_0x2c026c(0x19f)])),_0x4eb535[_0x2c026c(0x19f)];}catch(_0x44e665){throw new SDKError(ErrorCode[_0x2c026c(0x17f)],_0x2c026c(0x1cb)+_0x44e665[_0x2c026c(0x171)]);}if(!_0x350a51)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 _0x350a51+'/'+_0x3eea24;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x145);[a35_0x2f6a02(0x1a0)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0x2f6a02(0x155)](_0x4cd340){const _0x34abc4=a35_0x2f6a02,{options:_0x2a8b14,args:_0xe72236,tdx:_0x4bf29d}=_0x4cd340,_0xa30dff=_0xe72236[0x0],_0x511f26=!_0xa30dff&&!!_0x2a8b14[_0x34abc4(0x1c6)],_0x314ee2=_0xa30dff||_0x2a8b14[_0x34abc4(0x1c6)];if(!_0x314ee2)return console[_0x34abc4(0x1c9)](_0x34abc4(0x16b)),console[_0x34abc4(0x1c9)](_0x34abc4(0x1ad)),console[_0x34abc4(0x1c9)]('Examples:'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x34abc4(0x1c9)](_0x34abc4(0x15d)),console[_0x34abc4(0x1c9)](_0x34abc4(0x18c)),0x1;try{const _0x1e8234=_0x2a8b14[_0x34abc4(0x14d)];let _0x321bbd=_0x314ee2;!_0x511f26&&_0x1e8234&&!_0x314ee2[_0x34abc4(0x161)]('/')&&(_0x321bbd=_0x1e8234+'/'+_0x314ee2,_0x2a8b14[_0x34abc4(0x1c8)]&&console[_0x34abc4(0x1c9)]('Resolved\x20relative\x20path\x20to:\x20'+_0x321bbd));const _0x9cf25b=await withSpinner(_0x34abc4(0x14a)+_0x321bbd+'\x27...',()=>_0x4bf29d['segment'][_0x34abc4(0x1b6)](_0x321bbd),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]}),_0x111d20=_0x9cf25b['data'];_0x2a8b14[_0x34abc4(0x1c8)]&&(console[_0x34abc4(0x1c9)](_0x34abc4(0x18a)+_0x111d20[_0x34abc4(0x19a)]),console[_0x34abc4(0x1c9)](_0x34abc4(0x196)+_0x111d20['parentId']),_0x111d20[_0x34abc4(0x16e)]&&console['error'](_0x34abc4(0x173)+_0x111d20[_0x34abc4(0x16e)]),_0x111d20['segmentId']&&console['error']('Segment\x20ID:\x20'+_0x111d20[_0x34abc4(0x19d)]));if(_0x111d20['type']==='parent'){const _0xd2feef=await withSpinner(_0x34abc4(0x19e),()=>_0x4bf29d[_0x34abc4(0x158)]['getParent'](_0x111d20[_0x34abc4(0x18d)]),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd2feef[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]==='folder'){if(!_0x111d20[_0x34abc4(0x16e)])throw new SDKError(ErrorCode[_0x34abc4(0x187)],_0x34abc4(0x159));const _0x24b348=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x151)](_0x111d20[_0x34abc4(0x16e)]),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]});await handleSingleObjectOutput(_0x24b348[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]===_0x34abc4(0x158)){if(!_0x111d20[_0x34abc4(0x19d)])throw new SDKError(ErrorCode[_0x34abc4(0x188)],_0x34abc4(0x1b8));const _0xd0b109=await withSpinner(_0x34abc4(0x1ba),()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x1b4)](_0x111d20['parentId'],_0x111d20['segmentId']),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd0b109[_0x34abc4(0x1be)],_0x2a8b14);}}}return 0x0;}catch(_0x2643c4){if(_0x2643c4 instanceof SDKError)return console['error'](_0x34abc4(0x18b)+_0x2643c4[_0x34abc4(0x171)]),_0x2643c4[_0x34abc4(0x19c)]&&console[_0x34abc4(0x1c9)]('\x20\x20Cause:\x20'+_0x2643c4[_0x34abc4(0x19c)]),0x1;throw _0x2643c4;}}}function a35_0x45c6(_0x6a9f68,_0x1b0d83){_0x6a9f68=_0x6a9f68-0x145;const _0x2046b0=a35_0x2046();let _0x45c6a9=_0x2046b0[_0x6a9f68];return _0x45c6a9;}export class SegmentShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:show';[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1ce);async['execute'](_0x592b29){const _0x3e314d=a35_0x2f6a02,{options:_0x2d8ece,args:_0x2173e6,tdx:_0xceb6fc}=_0x592b29,_0x1e4e49=_0x2173e6[0x0];if(!_0x1e4e49)return console[_0x3e314d(0x1c9)](_0x3e314d(0x1ac)),console[_0x3e314d(0x1c9)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3e314d(0x1c9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x3e314d(0x1c9)](_0x3e314d(0x15c)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a6)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1cc)),0x1;try{const _0x3d9fa0=_0x2d8ece[_0x3e314d(0x1c6)],_0x2721c9=await resolveSegmentTarget(_0x1e4e49,_0x3d9fa0,_0x2d8ece['verbose']);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x146)+_0x2721c9);const _0x5b0f32=await withSpinner(_0x3e314d(0x1b9)+_0x1e4e49+'\x27...',()=>_0xceb6fc[_0x3e314d(0x158)][_0x3e314d(0x1b6)](_0x2721c9),{'verbose':_0x2d8ece['verbose']}),_0x32c5e1=_0x5b0f32[_0x3e314d(0x1be)];_0x2d8ece[_0x3e314d(0x1c8)]&&(console[_0x3e314d(0x1c9)](_0x3e314d(0x18a)+_0x32c5e1['type']),console[_0x3e314d(0x1c9)](_0x3e314d(0x196)+_0x32c5e1[_0x3e314d(0x18d)]));if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x191))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x174)),0x1;if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x169))return console[_0x3e314d(0x1c9)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a7)),0x1;if(!_0x32c5e1['segmentId'])throw new SDKError(ErrorCode[_0x3e314d(0x188)],_0x3e314d(0x1b8));const _0x57d816=await withSpinner(_0x3e314d(0x198),()=>_0xceb6fc[_0x3e314d(0x158)]['getSegmentSQL'](_0x32c5e1[_0x3e314d(0x18d)],_0x32c5e1[_0x3e314d(0x19d)]),{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]});let _0x1de571=_0x57d816[_0x3e314d(0x1be)];const _0x800972=resolveLimit(_0x2d8ece['limit'],DEFAULT_DISPLAY_LIMIT),_0x38ed8d=/\bLIMIT\s+\d+/i['test'](_0x1de571);!_0x38ed8d&&(_0x1de571=_0x1de571[_0x3e314d(0x18e)]()[_0x3e314d(0x157)](/;+$/,''),_0x1de571=_0x3e314d(0x175)+_0x1de571+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x800972);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x1af)+_0x1de571);const _0x48c65e=await withProgressSpinner('Executing\x20segment\x20query...',async _0x518956=>{const _0xfde832=_0x3e314d,_0x27da0b=await _0xceb6fc[_0xfde832(0x1d6)][_0xfde832(0x155)](_0x1de571,{'catalog':'td','schema':_0xfde832(0x14b),'onJobId':_0x48c10c=>{const _0x307603=_0xfde832;_0x518956[_0x307603(0x17d)](_0x48c10c);}});return _0x27da0b;},{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]}),_0x25cb05=_0x48c65e[_0x3e314d(0x1be)],_0x2c072e=_0x25cb05[_0x3e314d(0x1a3)]?_0x3e314d(0x1b0)+_0x25cb05[_0x3e314d(0x1a3)]+']':'';return console['error']('β\x20Query\x20completed:\x20Processed\x20'+_0x25cb05[_0x3e314d(0x195)][_0x3e314d(0x1c5)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x25cb05['stats'][_0x3e314d(0x1c2)])+_0x2c072e)),await handleQueryOutput(_0x25cb05,_0x2d8ece),0x0;}catch(_0x22c877){if(_0x22c877 instanceof SDKError)return console['error']('β\x20Query\x20failed\x20['+_0x22c877[_0x3e314d(0x17c)]+']'),console['error']('\x0a'+_0x22c877[_0x3e314d(0x171)]),0x1;throw _0x22c877;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x14c);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x172);async['execute'](_0x4ba497){const _0x1a16a2=a35_0x2f6a02,{options:_0x1ab39e,args:_0x3bb269,tdx:_0x66d1c0}=_0x4ba497;if(_0x3bb269['length']===0x0)return console[_0x1a16a2(0x1c9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1a16a2(0x1c9)](_0x1a16a2(0x180)),0x1;const _0x565a49=_0x3bb269[0x0];try{_0x1ab39e[_0x1a16a2(0x1c8)]&&(console[_0x1a16a2(0x1c9)](_0x1a16a2(0x153)+_0x1ab39e['site']),console[_0x1a16a2(0x1c9)]('Parent\x20name:\x20'+_0x565a49));const _0x4f1618=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)]['resolveParentId'](_0x565a49),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2199ec=_0x4f1618['data'];_0x1ab39e[_0x1a16a2(0x1c8)]&&console['error'](_0x1a16a2(0x17a)+_0x2199ec);const _0x23200b=await withSpinner(_0x1a16a2(0x181)+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)][_0x1a16a2(0x1cd)](_0x2199ec),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2b3c7e=_0x23200b[_0x1a16a2(0x1be)];return console[_0x1a16a2(0x1c9)]('β\x20Found\x20'+_0x2b3c7e[_0x1a16a2(0x170)]+_0x1a16a2(0x1b1)+(_0x2b3c7e[_0x1a16a2(0x170)]!==0x1?'s':'')),await handleSDKOutput(_0x2b3c7e,_0x1ab39e),0x0;}catch(_0x13b366){if(_0x13b366 instanceof SDKError)return console[_0x1a16a2(0x1c9)]('Error:\x20'+_0x13b366[_0x1a16a2(0x171)]),_0x13b366['cause']&&console[_0x1a16a2(0x1c9)]('\x20\x20Cause:\x20'+_0x13b366[_0x1a16a2(0x19c)]),0x1;throw _0x13b366;}}}function a35_0x2046(){const _0x2222a1=['List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Folder\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','SELECT\x20*\x20FROM\x20(\x0a','\x27\x20with\x20ID:\x20','Segment\x20ID:\x20','folderPath','1388562VFwrSS','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','code','setJobId','Show\x20segment\x20folder\x20details','INVALID_ARGUMENT','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Listing\x20folders\x20for\x20parent\x20\x27','/e/','\x27...','log','β\x20Created\x20folder\x20\x27','getSQLFromServerSegment','SEGMENT_FOLDER_NOT_FOUND','SEGMENT_NOT_FOUND','url','Resolved\x20type:\x20','Error:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentId','trim','Fetching\x20SQL\x20from\x20rule...','segment:folder:show','folder','\x20\x20Folder\x20path:\x20','/app/ps/','Parent\x20segment:\x20','stats','Parent\x20ID:\x20','resolveFolderId','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20sg\x20desc\x20<name>','type','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','cause','segmentId','Fetching\x20parent\x20segment\x20details...','fullPath','description','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','jobId','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20show','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Options:','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20describe\x20<path>','site','SQL\x20query:\x0a','\x20[Job\x20ID:\x20','\x20folder','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Cause:\x20','getSegment','segment:sql','resolvePathToResource','parentFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20\x27','Fetching\x20segment\x20details...','name','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','data','getSQLFromYamlFile','segment:folder:create','segment:desc','elapsedTimeMillis','Resolving\x20parent\x20segment\x20\x27','Resolved\x20YAML\x20file:\x20','processedRows','parentSegment','\x20\x20tdx\x20sg\x20sql\x20--path\x20','verbose','error','cyan','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','listFolders','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20folder\x20\x27','web','256DjKrrO','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','3693088FSXAjI','path','query','segment:describe','Target\x20path:\x20','Folder\x20name:\x20','\x20Opening\x20','1587408CTPMnq','Resolving\x20path\x20\x27','information_schema','segment:folder:list','segmentPath','getSegmentSQL','createFolder','segmentName','getFolder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Site:\x20','getSegmentSQLFromYaml','execute','423918lGYArp','replace','segment','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','866562rJHufm','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','green','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','includes','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','red','resolveParentId','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Create\x20segment\x20folder\x20for\x20organization','4820Zwndex','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','parent','format','Error:\x20Path\x20or\x20name\x20is\x20required','2494368iMdoia','Use:\x20tdx\x20ps\x20view','folderId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','length','message'];a35_0x2046=function(){return _0x2222a1;};return a35_0x2046();}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x190);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x17e);async[a35_0x2f6a02(0x155)](_0x595cd1){const _0x52a1fa=a35_0x2f6a02,{options:_0x5e363f,args:_0x59af0d,tdx:_0x277965}=_0x595cd1;if(_0x59af0d['length']===0x0)return console[_0x52a1fa(0x1c9)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error'](_0x52a1fa(0x15f)),0x1;try{const {parentId:_0x5e2b1c,childId:_0x365f76}=parseSegmentRef(_0x59af0d[0x0]);_0x5e363f[_0x52a1fa(0x1c8)]&&(console[_0x52a1fa(0x1c9)](_0x52a1fa(0x153)+_0x5e363f[_0x52a1fa(0x1ae)]),console[_0x52a1fa(0x1c9)]('Parent\x20name:\x20'+_0x5e2b1c),_0x365f76&&console[_0x52a1fa(0x1c9)]('Folder\x20name:\x20'+_0x365f76));if(!_0x365f76)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1d3)),0x1;const _0x1943f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5e2b1c+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)]['resolveParentId'](_0x5e2b1c),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x85a500=_0x1943f1[_0x52a1fa(0x1be)];_0x5e363f[_0x52a1fa(0x1c8)]&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x17a)+_0x85a500);const _0x26b656=await withSpinner('Resolving\x20folder\x20\x27'+_0x365f76+'\x27...',()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x197)](_0x85a500,_0x365f76),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x2ba5b4=_0x26b656[_0x52a1fa(0x1be)];_0x5e363f['verbose']&&console[_0x52a1fa(0x1c9)]('Resolved\x20folder\x20ID:\x20'+_0x2ba5b4);const _0x122ab6=await withSpinner('Fetching\x20folder\x20\x27'+_0x365f76+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x151)](_0x2ba5b4),{'verbose':_0x5e363f['verbose']});return await handleSDKOutput([_0x122ab6[_0x52a1fa(0x1be)]],_0x5e363f),0x0;}catch(_0x299e83){if(_0x299e83 instanceof SDKError)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x18b)+_0x299e83[_0x52a1fa(0x171)]),_0x299e83['cause']&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1b3)+_0x299e83[_0x52a1fa(0x19c)]),0x1;throw _0x299e83;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a35_0x2f6a02(0x1b5);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x7d5f0){const _0x38077e=a35_0x2f6a02,{options:_0x525512,args:_0x1554b5}=_0x7d5f0,_0x2e80f3=_0x525512,_0x3047b2=_0x2e80f3[_0x38077e(0x1d5)],_0x3c2a39=_0x1554b5[0x0];if(!_0x3c2a39&&!_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x19b))),console[_0x38077e(0x1c9)]('Usage:'),console[_0x38077e(0x1c9)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x38077e(0x1c9)](_0x38077e(0x1b2)),console['error'](_0x38077e(0x15c)),console[_0x38077e(0x1c9)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x38077e(0x1c9)](_0x38077e(0x1bd)),0x1;if(_0x3c2a39&&_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x6242e0;if(_0x3047b2)_0x6242e0=await this[_0x38077e(0x1bf)](_0x3047b2,_0x7d5f0);else{if(isYamlFilePath(_0x3c2a39))return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x162))),console[_0x38077e(0x1c9)](_0x38077e(0x1c7)+_0x3c2a39),0x1;else _0x6242e0=await this['getSQLFromServerSegment'](_0x3c2a39,_0x7d5f0);}return _0x525512['format']==='json'||_0x525512[_0x38077e(0x16a)]==='jsonl'?await handleSDKOutput([{'sql':_0x6242e0}],_0x525512):console[_0x38077e(0x184)](_0x6242e0),0x0;}catch(_0x2903da){if(_0x2903da instanceof SDKError)return console['error'](_0x38077e(0x18b)+_0x2903da[_0x38077e(0x171)]),_0x2903da[_0x38077e(0x19c)]&&console['error'](_0x38077e(0x1b3)+_0x2903da['cause']),0x1;throw _0x2903da;}}async['getSQLFromYamlFile'](_0x198844,_0x5c3141){const _0x53ba69=a35_0x2f6a02,{options:_0x4ab629,tdx:_0x4f5696}=_0x5c3141;let _0x526f47;try{_0x526f47=await resolveYamlFilePath(_0x198844);}catch(_0x5d1ab8){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53ba69(0x1cb)+_0x5d1ab8[_0x53ba69(0x171)]);}_0x4ab629[_0x53ba69(0x1c8)]&&console[_0x53ba69(0x1c9)]('Resolved:\x20'+_0x526f47['parentSegment']+'/'+_0x526f47['segmentName']);const _0x5d5555=await withSpinner(_0x53ba69(0x18f),()=>_0x4f5696[_0x53ba69(0x158)][_0x53ba69(0x154)](_0x526f47[_0x53ba69(0x1a4)],_0x526f47['parentSegment'],_0x526f47[_0x53ba69(0x150)]),{'verbose':_0x4ab629[_0x53ba69(0x1c8)]});return _0x5d5555[_0x53ba69(0x1be)];}async[a35_0x2f6a02(0x186)](_0xafddba,_0x5193d7){const _0x51e393=a35_0x2f6a02,{options:_0x149ee0,tdx:_0x333010}=_0x5193d7,_0x1d606c=_0x149ee0[_0x51e393(0x1c6)],_0x4415ac=await resolveSegmentTarget(_0xafddba,_0x1d606c,_0x149ee0[_0x51e393(0x1c8)]);_0x149ee0['verbose']&&console[_0x51e393(0x1c9)](_0x51e393(0x146)+_0x4415ac);const _0x54e350=await withSpinner(_0x51e393(0x1b9)+_0xafddba+'\x27...',()=>_0x333010[_0x51e393(0x158)]['resolvePathToResource'](_0x4415ac),{'verbose':_0x149ee0[_0x51e393(0x1c8)]}),_0x45ae5a=_0x54e350[_0x51e393(0x1be)];_0x149ee0[_0x51e393(0x1c8)]&&(console[_0x51e393(0x1c9)]('Resolved\x20type:\x20'+_0x45ae5a[_0x51e393(0x19a)]),console[_0x51e393(0x1c9)](_0x51e393(0x196)+_0x45ae5a['parentId']));if(_0x45ae5a[_0x51e393(0x19a)]===_0x51e393(0x191))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x45ae5a['type']===_0x51e393(0x169))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x45ae5a[_0x51e393(0x19d)])throw new SDKError(ErrorCode[_0x51e393(0x188)],_0x51e393(0x1b8));const _0x28c83b=await withSpinner(_0x51e393(0x198),()=>_0x333010[_0x51e393(0x158)][_0x51e393(0x14e)](_0x45ae5a['parentId'],_0x45ae5a[_0x51e393(0x19d)]),{'verbose':_0x149ee0[_0x51e393(0x1c8)]});return _0x28c83b[_0x51e393(0x1be)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c0);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x166);async[a35_0x2f6a02(0x155)](_0x2f0635){const _0x5c9ba1=a35_0x2f6a02,{options:_0x18d363,args:_0x51de1a,tdx:_0x479601}=_0x2f0635,_0x494df4=_0x18d363;if(_0x51de1a['length']<0x2)return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x1a9)),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x168)),0x1;const _0x26dd30=_0x51de1a[0x0],_0x34f1df=_0x51de1a[0x1];_0x494df4[_0x5c9ba1(0x1c8)]&&(console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x153)+_0x494df4[_0x5c9ba1(0x1ae)]),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x194)+_0x26dd30),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x147)+_0x34f1df));let _0x53074e;if(_0x494df4[_0x5c9ba1(0x1b7)]){const _0x446bf1=_0x494df4[_0x5c9ba1(0x1b7)],_0xf4fff5=await withSpinner(_0x5c9ba1(0x1c3)+_0x26dd30+'\x27...',()=>_0x479601['segment'][_0x5c9ba1(0x164)](_0x26dd30),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]}),_0x225654=_0xf4fff5[_0x5c9ba1(0x1be)],_0x2a1c13=await withSpinner(_0x5c9ba1(0x1cf)+_0x446bf1+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x197)](_0x225654,_0x446bf1),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]});_0x53074e=_0x2a1c13[_0x5c9ba1(0x1be)],_0x494df4[_0x5c9ba1(0x1c8)]&&console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x17b)+_0x53074e);}const _0x3389b1={'name':_0x34f1df,'description':_0x494df4[_0x5c9ba1(0x1a0)],'parentFolderId':_0x53074e},_0x407399=await withSpinner('Creating\x20folder\x20\x27'+_0x34f1df+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x14f)](_0x26dd30,_0x3389b1),{'verbose':_0x494df4['verbose']}),_0x34b3cd=_0x407399[_0x5c9ba1(0x1be)];return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x185)+_0x34b3cd[_0x5c9ba1(0x1bb)]+_0x5c9ba1(0x176)+_0x34b3cd['id']),await handleSDKOutput([_0x34b3cd],_0x494df4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:view';[a35_0x2f6a02(0x1a0)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x2f6a02(0x155)](_0x2685e6){const _0x1bb54f=a35_0x2f6a02,{options:_0x2e9f8b,args:_0x1a6335,tdx:_0x24c124}=_0x2685e6,_0x453213=_0x1a6335[0x0];if(!_0x453213)return console['error'](_0x1bb54f(0x16f)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x165)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a5)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1aa)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a2)),console[_0x1bb54f(0x1c9)]('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1bb54f(0x1c9)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1ab)),0x1;try{const _0x16dcd3=_0x2e9f8b[_0x1bb54f(0x1c6)],_0x29df10=await resolveSegmentTarget(_0x453213,_0x16dcd3,_0x2e9f8b[_0x1bb54f(0x1c8)]);_0x2e9f8b[_0x1bb54f(0x1c8)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x146)+_0x29df10);const _0x222c9d=await withSpinner(_0x1bb54f(0x1b9)+_0x453213+'\x27...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x1b6)](_0x29df10),{'verbose':_0x2e9f8b['verbose']}),_0x3cd70a=_0x222c9d[_0x1bb54f(0x1be)];_0x2e9f8b[_0x1bb54f(0x1c8)]&&(console[_0x1bb54f(0x1c9)]('Resolved\x20type:\x20'+_0x3cd70a[_0x1bb54f(0x19a)]),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x196)+_0x3cd70a['parentId']),_0x3cd70a[_0x1bb54f(0x16e)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x173)+_0x3cd70a[_0x1bb54f(0x16e)]),_0x3cd70a[_0x1bb54f(0x19d)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x177)+_0x3cd70a[_0x1bb54f(0x19d)]));if(_0x2e9f8b[_0x1bb54f(0x1d0)]){if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x191))return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x160)),0x1;if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x169))return console[_0x1bb54f(0x1c9)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1bb54f(0x1c9)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2d6362=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],'/app/ps/'+_0x3cd70a[_0x1bb54f(0x18d)]+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]);return console[_0x1bb54f(0x1c9)](a35_0x10ce32[_0x1bb54f(0x15e)]('β')+_0x1bb54f(0x148)+a35_0x10ce32[_0x1bb54f(0x1ca)](_0x2d6362)),openBrowser(_0x2d6362),0x0;}if(_0x3cd70a[_0x1bb54f(0x19a)]==='folder'){if(!_0x3cd70a[_0x1bb54f(0x16e)])throw new SDKError(ErrorCode[_0x1bb54f(0x187)],_0x1bb54f(0x159));const _0x3e7fd6=await withSpinner('Fetching\x20folder\x20details...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x151)](_0x3cd70a[_0x1bb54f(0x16e)]),{'verbose':_0x2e9f8b['verbose']});await handleSingleObjectOutput(_0x3e7fd6[_0x1bb54f(0x1be)],_0x2e9f8b);}else{if(_0x3cd70a[_0x1bb54f(0x19a)]==='segment'){if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2105be=await withSpinner(_0x1bb54f(0x1ba),()=>_0x24c124[_0x1bb54f(0x158)]['getSegment'](_0x3cd70a[_0x1bb54f(0x18d)],_0x3cd70a[_0x1bb54f(0x19d)]),{'verbose':_0x2e9f8b[_0x1bb54f(0x1c8)]}),_0x574529=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],_0x1bb54f(0x193)+_0x3cd70a['parentId']+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]),_0x2d2ef1=_0x2105be[_0x1bb54f(0x1be)];_0x2d2ef1[_0x1bb54f(0x189)]=_0x574529,await handleSingleObjectOutput(_0x2d2ef1,_0x2e9f8b);}else return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a1)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x16d)),0x1;}return 0x0;}catch(_0x2c21cf){if(_0x2c21cf instanceof SDKError)return console[_0x1bb54f(0x1c9)]('Error:\x20'+_0x2c21cf[_0x1bb54f(0x171)]),_0x2c21cf[_0x1bb54f(0x19c)]&&console[_0x1bb54f(0x1c9)]('\x20\x20Cause:\x20'+_0x2c21cf[_0x1bb54f(0x19c)]),0x1;throw _0x2c21cf;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c1);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1d2);async[a35_0x2f6a02(0x155)](_0x52c4bf){const _0x21fe95=a35_0x2f6a02,{options:_0x5f15da,args:_0x252703,tdx:_0x23dc62}=_0x52c4bf,_0x1d8c55=_0x252703[0x0];if(!_0x1d8c55)return console[_0x21fe95(0x1c9)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x21fe95(0x1c9)](_0x21fe95(0x199)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15a)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15c)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x21fe95(0x152)),0x1;try{const _0x2b0354=_0x5f15da['parentSegment'],_0x1d4da3=await resolveSegmentTarget(_0x1d8c55,_0x2b0354,_0x5f15da[_0x21fe95(0x1c8)]);_0x5f15da[_0x21fe95(0x1c8)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x146)+_0x1d4da3);const _0x2b8ac3=await withSpinner('Resolving\x20\x27'+_0x1d8c55+'\x27...',()=>_0x23dc62['segment']['resolvePathToResource'](_0x1d4da3),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x3e7a3e=_0x2b8ac3[_0x21fe95(0x1be)];_0x5f15da[_0x21fe95(0x1c8)]&&(console[_0x21fe95(0x1c9)]('Resolved\x20type:\x20'+_0x3e7a3e[_0x21fe95(0x19a)]),console['error'](_0x21fe95(0x196)+_0x3e7a3e['parentId']));if(_0x3e7a3e[_0x21fe95(0x19a)]==='folder')return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x21fe95(0x1c9)](_0x21fe95(0x1a8)),0x1;if(_0x3e7a3e[_0x21fe95(0x19a)]==='parent')return console[_0x21fe95(0x1c9)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x21fe95(0x1c9)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x3e7a3e[_0x21fe95(0x19d)])throw new SDKError(ErrorCode[_0x21fe95(0x188)],_0x21fe95(0x1b8));const _0x5e6e79=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x23dc62[_0x21fe95(0x158)][_0x21fe95(0x14e)](_0x3e7a3e[_0x21fe95(0x18d)],_0x3e7a3e[_0x21fe95(0x19d)]),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x8354d2=_0x5e6e79['data'],_0x2cb370=await executeSchemaQuery(_0x8354d2,_0x23dc62,_0x5f15da);return await handleQueryOutput(_0x2cb370,_0x5f15da),0x0;}catch(_0x300018){if(_0x300018 instanceof SDKError)return console[_0x21fe95(0x1c9)](_0x21fe95(0x18b)+_0x300018['message']),_0x300018[_0x21fe95(0x19c)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x1b3)+_0x300018[_0x21fe95(0x19c)]),0x1;throw _0x300018;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a36_0x2dfe(){const _0x57267d=['Parent\x20path:\x20','createSegment','Examples:','\x20\x20\x20Path:\x20','invisible','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','ruleFile','\x27\x20with\x20ID:\x20','24666inPven','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','noCountPopulation','folder','525bdleLe','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Segment\x20name:\x20','5840124BBQaMg','12786dLfKIv','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Resolved\x20relative\x20path\x20to:\x20','121bZBHbL','13tCYxVA','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','Resolving\x20folder\x20\x27','Resolved\x20folder\x20ID:\x20','length','Parent:\x20','12WbkGJd','336123sUsOyH','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','206020WyrmJw','error','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','8WtTHkn','description','Target\x20path:\x20','parent','name','site','Site:\x20','88ikUuXh','115011kDnBJb','verbose','rule','401385qtephI','execute','folderId','Resolving\x20folder\x20path\x20\x27','type','resolvePathToResource','segmentPath','\x27...','yellow'];a36_0x2dfe=function(){return _0x57267d;};return a36_0x2dfe();}const a36_0x2e5a9d=a36_0x5d8b;function a36_0x5d8b(_0x2da479,_0x4fa4b0){_0x2da479=_0x2da479-0x14d;const _0x2dfe02=a36_0x2dfe();let _0x5d8bc0=_0x2dfe02[_0x2da479];return _0x5d8bc0;}(function(_0x4e5786,_0x1e5790){const _0x4d2942=a36_0x5d8b,_0x14d9bd=_0x4e5786();while(!![]){try{const _0x4a1d77=parseInt(_0x4d2942(0x181))/0x1+parseInt(_0x4d2942(0x175))/0x2*(-parseInt(_0x4d2942(0x180))/0x3)+parseInt(_0x4d2942(0x14d))/0x4*(parseInt(_0x4d2942(0x158))/0x5)+-parseInt(_0x4d2942(0x16a))/0x6*(-parseInt(_0x4d2942(0x171))/0x7)+parseInt(_0x4d2942(0x154))/0x8*(parseInt(_0x4d2942(0x155))/0x9)+-parseInt(_0x4d2942(0x184))/0xa*(parseInt(_0x4d2942(0x178))/0xb)+-parseInt(_0x4d2942(0x174))/0xc*(parseInt(_0x4d2942(0x179))/0xd);if(_0x4a1d77===_0x1e5790)break;else _0x14d9bd['push'](_0x14d9bd['shift']());}catch(_0x950f8d){_0x14d9bd['push'](_0x14d9bd['shift']());}}}(a36_0x2dfe,0x3276c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x367ac7 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x2e5a9d(0x151)]='segment:create';[a36_0x2e5a9d(0x14e)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a36_0x2e5a9d(0x159)](_0x12d6e3){const _0x5840ee=a36_0x2e5a9d;console[_0x5840ee(0x185)](a36_0x367ac7['yellow'](_0x5840ee(0x176))),console[_0x5840ee(0x185)](a36_0x367ac7[_0x5840ee(0x160)](_0x5840ee(0x172)));const {options:_0x1c8526,args:_0x44273f,tdx:_0x507c05}=_0x12d6e3,_0x1d84bb=_0x1c8526;if(_0x44273f[_0x5840ee(0x17e)]===0x0)return console['error'](_0x5840ee(0x16b)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0x5840ee(0x163)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x5840ee(0x185)](_0x5840ee(0x17a)),console['error'](_0x5840ee(0x182)),0x1;const _0x409d07=_0x44273f[0x0],_0x53b482=_0x1c8526[_0x5840ee(0x15e)];let _0x140724=_0x409d07;_0x53b482&&!_0x409d07['includes']('/')&&(_0x140724=_0x53b482+'/'+_0x409d07,_0x1d84bb[_0x5840ee(0x156)]&&console[_0x5840ee(0x185)](_0x5840ee(0x177)+_0x140724));const _0x29aae9=parsePath(_0x140724);if(_0x29aae9['segments'][_0x5840ee(0x17e)]<0x2)return console[_0x5840ee(0x185)](_0x5840ee(0x186)),console[_0x5840ee(0x185)](_0x5840ee(0x16d)),0x1;const _0x285b11=_0x29aae9['segments'][0x0],_0x275a20=getBaseName(_0x140724),_0xa8e262=getParentPath(_0x140724);_0x1d84bb[_0x5840ee(0x156)]&&(console[_0x5840ee(0x185)](_0x5840ee(0x153)+_0x1d84bb[_0x5840ee(0x152)]),console['error'](_0x5840ee(0x14f)+_0x140724),console[_0x5840ee(0x185)](_0x5840ee(0x17f)+_0x285b11),console[_0x5840ee(0x185)](_0x5840ee(0x173)+_0x275a20),console[_0x5840ee(0x185)](_0x5840ee(0x161)+_0xa8e262));const _0x108bc7=await withSpinner(_0x5840ee(0x166)+_0x285b11+'\x27...',()=>_0x507c05[_0x5840ee(0x16c)]['resolveParentId'](_0x285b11),{'verbose':_0x1d84bb[_0x5840ee(0x156)]}),_0x3281ed=_0x108bc7[_0x5840ee(0x16e)];let _0x43b87e;if(_0x29aae9[_0x5840ee(0x17b)][_0x5840ee(0x17e)]>0x2){const _0x1bfd7c=await withSpinner(_0x5840ee(0x15b)+_0xa8e262+_0x5840ee(0x15f),()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x15d)](_0xa8e262),{'verbose':_0x1d84bb['verbose']}),_0x579a6b=_0x1bfd7c[_0x5840ee(0x16e)];if(_0x579a6b[_0x5840ee(0x15c)]!=='folder'&&_0x579a6b[_0x5840ee(0x15c)]!==_0x5840ee(0x150))return console[_0x5840ee(0x185)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x43b87e=_0x579a6b[_0x5840ee(0x15a)];}else{if(_0x1d84bb[_0x5840ee(0x170)]){const _0x546d13=await withSpinner(_0x5840ee(0x17c)+_0x1d84bb[_0x5840ee(0x170)]+'\x27...',()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x167)](_0x3281ed,_0x1d84bb[_0x5840ee(0x170)]),{'verbose':_0x1d84bb[_0x5840ee(0x156)]});_0x43b87e=_0x546d13['data'];}}_0x1d84bb[_0x5840ee(0x156)]&&_0x43b87e&&console[_0x5840ee(0x185)](_0x5840ee(0x17d)+_0x43b87e);const _0x403d5e=await loadJSONFromOptions(_0x1d84bb[_0x5840ee(0x157)],_0x1d84bb[_0x5840ee(0x168)]),_0xccaf35={'name':_0x275a20,'description':_0x1d84bb[_0x5840ee(0x14e)],'rule':_0x403d5e,'kind':_0x1d84bb[_0x5840ee(0x183)]!==undefined?parseInt(_0x1d84bb[_0x5840ee(0x183)],0xa):undefined,'isVisible':_0x1d84bb[_0x5840ee(0x165)]?![]:undefined,'segmentFolderId':_0x43b87e,'countPopulation':_0x1d84bb[_0x5840ee(0x16f)]?![]:undefined},_0x2bbbed=await withSpinner('Creating\x20segment\x20\x27'+_0x275a20+_0x5840ee(0x15f),()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x162)](_0x3281ed,_0xccaf35),{'verbose':_0x1d84bb[_0x5840ee(0x156)]}),_0x784dde=_0x2bbbed[_0x5840ee(0x16e)];return console[_0x5840ee(0x185)]('β\x20Created\x20segment\x20\x27'+_0x784dde[_0x5840ee(0x151)]+_0x5840ee(0x169)+_0x784dde['id']),_0x140724!==_0x409d07&&console['error'](_0x5840ee(0x164)+_0x140724),await handleSDKOutput([_0x784dde],_0x1d84bb),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a37_0x1ec996=a37_0x36c5;(function(_0x5b3c48,_0xeb7a40){const _0x48ea14=a37_0x36c5,_0x1e6527=_0x5b3c48();while(!![]){try{const _0x4909d2=parseInt(_0x48ea14(0xe3))/0x1*(parseInt(_0x48ea14(0xfc))/0x2)+-parseInt(_0x48ea14(0xf9))/0x3+parseInt(_0x48ea14(0xf1))/0x4*(parseInt(_0x48ea14(0xea))/0x5)+-parseInt(_0x48ea14(0xf3))/0x6+parseInt(_0x48ea14(0xfd))/0x7*(-parseInt(_0x48ea14(0xf0))/0x8)+parseInt(_0x48ea14(0xee))/0x9+-parseInt(_0x48ea14(0xfa))/0xa*(-parseInt(_0x48ea14(0xfb))/0xb);if(_0x4909d2===_0xeb7a40)break;else _0x1e6527['push'](_0x1e6527['shift']());}catch(_0x2a3191){_0x1e6527['push'](_0x1e6527['shift']());}}}(a37_0x1b54,0x778fd));function a37_0x1b54(){const _0x3c83d1=['parentSegment','List\x20available\x20fields\x20for\x20segmentation','2220129AgxyiT','segment','10712USFUpP','3193880KIgaim','β\x20Found\x20','4710180AvSnyG','\x27...','jsonl','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','data','Parent\x20segment:\x20','859185rJwKtM','4070nFfHAO','23485DFAGJL','315478uHICvh','4319QJyGny','length','execute','name','3rkzqGc','site','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','error','json','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','5HtYkCE','description'];a37_0x1b54=function(){return _0x3c83d1;};return a37_0x1b54();}import{BaseCommand}from'./command.js';function a37_0x36c5(_0x4e8d67,_0x3e25a7){_0x4e8d67=_0x4e8d67-0xe0;const _0x1b54ca=a37_0x1b54();let _0x36c541=_0x1b54ca[_0x4e8d67];return _0x36c541;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x1ec996(0xe2)]='segment:fields';[a37_0x1ec996(0xeb)]=a37_0x1ec996(0xed);async[a37_0x1ec996(0xe1)](_0x3ab018){const _0x17826d=a37_0x1ec996,{options:_0x53e2e0,args:_0x34d31e,tdx:_0x332bd4}=_0x3ab018,_0x443d43=_0x34d31e[0x0]||_0x53e2e0[_0x17826d(0xec)];if(!_0x443d43)return console[_0x17826d(0xe7)](_0x17826d(0xe5)),console[_0x17826d(0xe7)](_0x17826d(0xf6)),console[_0x17826d(0xe7)](_0x17826d(0xe9)),0x1;_0x53e2e0[_0x17826d(0xe6)]&&(console[_0x17826d(0xe7)]('Site:\x20'+_0x53e2e0[_0x17826d(0xe4)]),console[_0x17826d(0xe7)](_0x17826d(0xf8)+_0x443d43));const _0xbdca83=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x443d43+_0x17826d(0xf4),()=>_0x332bd4[_0x17826d(0xef)]['listFields'](_0x443d43),{'verbose':_0x53e2e0['verbose']}),_0x3283e4=_0xbdca83[_0x17826d(0xf7)];console[_0x17826d(0xe7)](_0x17826d(0xf2)+_0x3283e4[_0x17826d(0xe0)]+'\x20field'+(_0x3283e4[_0x17826d(0xe0)]!==0x1?'s':''));if(_0x53e2e0[_0x17826d(0xe8)]||_0x53e2e0[_0x17826d(0xf5)])return await handleSDKOutput(_0x3283e4,_0x53e2e0),0x0;return displayFieldsHumanReadable(_0x3283e4,_0x443d43),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x411cac=a38_0x1899;(function(_0x179761,_0x2e724b){const _0x2803ff=a38_0x1899,_0x1194f6=_0x179761();while(!![]){try{const _0x973476=parseInt(_0x2803ff(0xed))/0x1*(-parseInt(_0x2803ff(0x126))/0x2)+-parseInt(_0x2803ff(0x113))/0x3+-parseInt(_0x2803ff(0x129))/0x4+parseInt(_0x2803ff(0x10a))/0x5*(parseInt(_0x2803ff(0xfb))/0x6)+-parseInt(_0x2803ff(0xf5))/0x7+-parseInt(_0x2803ff(0xfc))/0x8+-parseInt(_0x2803ff(0xf6))/0x9*(-parseInt(_0x2803ff(0xeb))/0xa);if(_0x973476===_0x2e724b)break;else _0x1194f6['push'](_0x1194f6['shift']());}catch(_0x3d4d80){_0x1194f6['push'](_0x1194f6['shift']());}}}(a38_0xf549,0x8dcd7));function a38_0x1899(_0x16d4a0,_0x45d102){_0x16d4a0=_0x16d4a0-0xe9;const _0xf5495b=a38_0xf549();let _0x189960=_0xf5495b[_0x16d4a0];return _0x189960;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0xf549(){const _0x4bbec9=['Error:\x20','93430CbZJfG','file','isNew','dim','diff','length','session','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','2889207wAeMTr','resourceName','\x20\x20Target:\x20','parent_segment','execute','β\x20Context\x20set:\x20','Target\x20resource:\x20','segments','dryRun','message','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','activations','Pulling\x20segments\x20from\x20\x27','dirname','\x0aChanges\x20to\x20\x27','\x20files\x20to\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','6452qbngSL','Write\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','1449280uvFSfu','filter','cyan','type','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','errorCode','counts','setPhase','content','β\x20Pulled\x20','Parent\x20segment:\x20','\x20\x20π―\x20','targetDir','20893910qdbgad','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','54cXUEGK','utf-8','\x20unchanged\x20files','Aborted.','\x20changed\x20files','parentName','files','hasChanges','278019yatevv','9FnynVU','journeys','helpText','absolutePath','Site:\x20','114rrfFbM','2594336DGhtmX','relativePath','\x20journeys','yellow','journeyVersions','green','-\x20no\x20files\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','repeat','pullSegments','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','segment','verbose'];a38_0xf549=function(){return _0x4bbec9;};return a38_0xf549();}import{saveSessionContext}from'../core/session.js';import a38_0x351079 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x3bab0b 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']='segment:pull';['description']=a38_0x411cac(0x103);async[a38_0x411cac(0x117)](_0x4c5071){const _0x1d50ee=a38_0x411cac,{options:_0x517908,args:_0x529982,tdx:_0x4bc378}=_0x4c5071,_0x23017f=_0x517908,_0x26a68e=await resolveTarget({'arg':_0x529982[0x0],'contextParent':_0x517908['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x26a68e))return _0x26a68e[_0x1d50ee(0x12f)]==='no_parent'?(console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x11d))),console[_0x1d50ee(0x11e)](_0x1d50ee(0x11f)),console['error'](_0x1d50ee(0x106)),console[_0x1d50ee(0x11e)](_0x1d50ee(0x112))):(console[_0x1d50ee(0x11e)](a38_0x351079['red'](_0x1d50ee(0x109)+_0x26a68e[_0x1d50ee(0x11c)]+'\x0a')),_0x26a68e[_0x1d50ee(0xf8)]&&console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x12b)](_0x26a68e[_0x1d50ee(0xf8)]))),0x1;const _0x32fcee=_0x26a68e['parentName'],_0x2c8d7e=_0x26a68e['targetDir'],_0x234ef2=_0x26a68e[_0x1d50ee(0x12c)]===_0x1d50ee(0x10b)?_0x26a68e[_0x1d50ee(0x114)]:undefined;_0x23017f[_0x1d50ee(0x108)]&&(console[_0x1d50ee(0x11e)](_0x1d50ee(0xfa)+_0x23017f['site']),console['error'](_0x1d50ee(0x134)+_0x32fcee),_0x234ef2&&console[_0x1d50ee(0x11e)](_0x1d50ee(0x119)+_0x234ef2));const _0x481da5=await withProgressSpinner(_0x1d50ee(0x121)+_0x32fcee+'\x27...',_0x39d837=>_0x4bc378[_0x1d50ee(0x107)][_0x1d50ee(0x105)](_0x32fcee,{'targetDir':_0x2c8d7e,'targetResourceName':_0x234ef2,'verbose':_0x23017f[_0x1d50ee(0x108)],'progress':{'update':_0x1a077e=>{const _0x12606a=_0x1d50ee;_0x39d837[_0x12606a(0x131)](_0x1a077e),_0x23017f['verbose']&&console['error']('\x20\x20'+_0x1a077e);}}}),{'verbose':_0x23017f['verbose']}),_0x346e37=_0x481da5[_0x1d50ee(0x111)];if(_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x11a)]===0x0&&_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0xf7)]===0x0)return console['error'](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x125)+_0x346e37[_0x1d50ee(0xf2)]+'\x27')),0x0;const _0x45621f=_0x346e37[_0x1d50ee(0xf3)]['filter'](_0x244937=>_0x244937[_0x1d50ee(0x10c)]),_0xa0f544=_0x346e37[_0x1d50ee(0xf3)][_0x1d50ee(0x12a)](_0x26afb4=>!_0x26afb4[_0x1d50ee(0x10c)]&&_0x26afb4[_0x1d50ee(0xf4)]),_0x1275cc=_0x346e37[_0x1d50ee(0xf3)][_0x1d50ee(0x12a)](_0x5289c2=>!_0x5289c2[_0x1d50ee(0x10c)]&&!_0x5289c2[_0x1d50ee(0xf4)]);console[_0x1d50ee(0x11e)]('\x0aPull\x20summary\x20for\x20\x27'+_0x346e37[_0x1d50ee(0xf2)]+'\x27:'),console[_0x1d50ee(0x11e)](_0x1d50ee(0xe9)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x11a)]+'\x20segments')+'\x20with\x20'+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x120)]+'\x20activations'));if(_0x346e37['counts'][_0x1d50ee(0xf7)]>0x0){const _0x4e339b=_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x100)]>_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0xf7)]?'\x20('+_0x346e37[_0x1d50ee(0x130)]['journeyVersions']+'\x20versions)':'';console[_0x1d50ee(0x11e)]('\x20\x20πΊοΈ\x20\x20'+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37['counts']['journeys']+_0x1d50ee(0xfe))+a38_0x351079[_0x1d50ee(0x10d)](_0x4e339b));}console[_0x1d50ee(0x11e)]('\x20\x20'+a38_0x351079[_0x1d50ee(0x101)]('+\x20'+_0x45621f['length']+'\x20new\x20files')),console['error']('\x20\x20'+a38_0x351079[_0x1d50ee(0xff)]('~\x20'+_0xa0f544[_0x1d50ee(0x10f)]+_0x1d50ee(0xf1))),console['error']('\x20\x20'+a38_0x351079[_0x1d50ee(0x10d)]('=\x20'+_0x1275cc[_0x1d50ee(0x10f)]+_0x1d50ee(0xef))),console[_0x1d50ee(0x11e)](_0x1d50ee(0x115)+a38_0x351079['cyan'](_0x346e37['targetDir'])+'\x0a');if(_0xa0f544['length']>0x0)for(const _0x59aad8 of _0xa0f544){console['error'](_0x1d50ee(0x123)+_0x59aad8[_0x1d50ee(0xfd)]+'\x27:'),console[_0x1d50ee(0x11e)]('β'[_0x1d50ee(0x104)](0x3c)),console['error'](_0x59aad8[_0x1d50ee(0x10e)]),console[_0x1d50ee(0x11e)]('β'[_0x1d50ee(0x104)](0x3c));}if(_0x23017f[_0x1d50ee(0x11b)])return console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x12d))),0x0;if(_0x45621f[_0x1d50ee(0x10f)]===0x0&&_0xa0f544[_0x1d50ee(0x10f)]===0x0)return console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)]('β\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x346e37['parentName']},_0x23017f[_0x1d50ee(0x110)]),console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)](_0x1d50ee(0x118)+a38_0x351079[_0x1d50ee(0x10d)]('parent_segment')+_0x1d50ee(0x12e)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0xf2)]))),0x0;if(!_0x23017f['yes']){if(!isInteractive())return console[_0x1d50ee(0x11e)](a38_0x351079['red']('\x0aError:'),_0x1d50ee(0x128)),console['error'](a38_0x351079['dim'](_0x1d50ee(0xec))),0x1;const _0x26ce86=await confirmKey(_0x1d50ee(0x127)+(_0x45621f['length']+_0xa0f544[_0x1d50ee(0x10f)])+'\x20files?');if(!_0x26ce86)return console[_0x1d50ee(0x11e)](a38_0x351079['yellow'](_0x1d50ee(0xf0)),_0x1d50ee(0x102)),0x1;}for(const _0x2c3d7d of _0x346e37['files']){if(_0x2c3d7d['isNew']||_0x2c3d7d['hasChanges']){const _0x22bcbf=a38_0x3bab0b[_0x1d50ee(0x122)](_0x2c3d7d[_0x1d50ee(0xf9)]);!existsSync(_0x22bcbf)&&mkdirSync(_0x22bcbf,{'recursive':!![]}),writeFileSync(_0x2c3d7d[_0x1d50ee(0xf9)],_0x2c3d7d[_0x1d50ee(0x132)],_0x1d50ee(0xee));}}return console[_0x1d50ee(0x11e)](a38_0x351079['green'](_0x1d50ee(0x133)+(_0x45621f[_0x1d50ee(0x10f)]+_0xa0f544[_0x1d50ee(0x10f)])+_0x1d50ee(0x124)+_0x346e37[_0x1d50ee(0xea)])),saveSessionContext({'parent_segment':_0x346e37[_0x1d50ee(0xf2)]},_0x23017f[_0x1d50ee(0x110)]),console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)](_0x1d50ee(0x118)+a38_0x351079['dim'](_0x1d50ee(0x116))+_0x1d50ee(0x12e)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x4f0c1e=a39_0x37a0;(function(_0xfd718,_0x5acdcd){const _0x5d1354=a39_0x37a0,_0x3f0d73=_0xfd718();while(!![]){try{const _0x47cba5=parseInt(_0x5d1354(0x12d))/0x1+-parseInt(_0x5d1354(0xb8))/0x2+parseInt(_0x5d1354(0x115))/0x3*(parseInt(_0x5d1354(0xd4))/0x4)+-parseInt(_0x5d1354(0x129))/0x5*(parseInt(_0x5d1354(0x11f))/0x6)+parseInt(_0x5d1354(0xdc))/0x7+parseInt(_0x5d1354(0x103))/0x8*(parseInt(_0x5d1354(0xb1))/0x9)+parseInt(_0x5d1354(0xec))/0xa*(-parseInt(_0x5d1354(0xe9))/0xb);if(_0x47cba5===_0x5acdcd)break;else _0x3f0d73['push'](_0x3f0d73['shift']());}catch(_0x5259e9){_0x3f0d73['push'](_0x3f0d73['shift']());}}}(a39_0xb36b,0xd8cd2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a39_0xb36b(){const _0x12cc31=['\x20changed','2107392NYobnG','unchanged','New\x20journey:','updatedAt','attributes','\x20\x20Segments:\x20','\x20folders\x20to\x20create','deleted','execute','length','blue','message','New\x20segment:','/j/da/je','journeyId','segment\x20or\x20journey','diff','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','set','delete','listFolders','\x20changes?','\x20\x20π\x20Segments:','toCreate','list','listActivations','β\x20All\x20journeys\x20are\x20up\x20to\x20date','verbose','287132HaqAKr','created','\x20\x20\x20\x20','Fetching\x20connections\x20for\x20name\x20resolution...','all','helpText','Error:\x20Directory\x20not\x20found:\x20','getParent','6200537KUHDOz','yes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20activations]','type','\x27...','endsWith','Aborted.','getJourney','journeysOnly','join','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Delete\x20journey:','16083672RTviGm','\x20created','get','10ZsejTn','.yaml','new','state','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segments','Scoped\x20to\x20folder:\x20','\x20\x20Activations:\x20','toString','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','data','changed','parentName','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentFolder','yellow','red','(Journey\x20will\x20be\x20deleted)','error','repeat','folders','11433976HHQKlv','green','\x20updated','\x0aValidation\x20failed:','add','cwd','/app/ps/','Site:\x20','site','scopedFolderPath','push','folderId','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segment','\x20\x20Source:\x20','file','No\x20','69wfOPbE','\x20unchanged','resolveParentId','cyan','journeyBundleName','createdAt','journey','buildUserMaps','createdSegmentIds','Resolving\x20parent\x20segment\x20\x27','276bGHDiK','existingSegment','filePath','Changes\x20to\x20journey:','\x20new','Push\x20','paused','\x20deleted','activations','existingJourney','153470McIXoA','versionNumber','no_parent','\x0aPush\x20summary\x20for\x20\x27','849743EaTgSY','connection','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)','dim','\x0aError:','\x20to\x20delete','journeys','user','segment:push','\x20to\x20create','Fetching\x20existing\x20activations...','map','\x20\x20πΊοΈ\x20\x20Journeys:','parent_name','Preparing\x20journeys...','description','\x20\x20Activations:','/sb/da/esr','Source\x20directory:\x20','filter','folderPath','name','updated','Changes\x20to:','then','idToName','Delete\x20segment:','toDelete','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','nameToId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/e/','9CaHBhT','segmentFolderId','yamlConfig','Error\x20parsing\x20YAML:\x20','targetDir','isNew'];a39_0xb36b=function(){return _0x12cc31;};return a39_0xb36b();}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_0x247d52 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a39_0x37a0(_0x44a6a3,_0x45f9cc){_0x44a6a3=_0x44a6a3-0xaa;const _0xb36be8=a39_0xb36b();let _0x37a012=_0xb36be8[_0x44a6a3];return _0x37a012;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a39_0x4f0c1e(0x135);[a39_0x4f0c1e(0x13c)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a39_0x4f0c1e(0xc0)](_0x28f904){const _0x58e197=a39_0x4f0c1e,{options:_0x3b5e8e,args:_0x3fc4dd,tdx:_0x21989c}=_0x28f904,_0x16c303=_0x3b5e8e,_0x34eb04=await resolveTarget({'arg':_0x3fc4dd[0x0],'contextParent':_0x3b5e8e['parentSegment'],'cwd':process[_0x58e197(0x108)]()});if(!isSuccessfulResolution(_0x34eb04))return _0x34eb04['errorCode']===_0x58e197(0x12b)?(console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xde))),console[_0x58e197(0x100)](_0x58e197(0x12f)),console[_0x58e197(0x100)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x58e197(0x100)](_0x58e197(0x110))):(console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0x10f)+_0x34eb04[_0x58e197(0xc3)]+'\x0a')),_0x34eb04[_0x58e197(0xd9)]&&console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)](_0x34eb04[_0x58e197(0xd9)]))),0x1;if(_0x34eb04[_0x58e197(0xe0)]===_0x58e197(0x13a))return console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0xda)+_0x34eb04['targetDir']+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52['cyan'](_0x58e197(0xaf))),0x1;const _0x212cec=_0x34eb04[_0x58e197(0xf8)],_0x52f893=_0x34eb04[_0x58e197(0xb5)],_0x559818=_0x34eb04['type']===_0x58e197(0x113)?_0x34eb04[_0x58e197(0x121)]:undefined,_0x2ec021=getScopedDetails(_0x34eb04),_0x5972a4=_0x2ec021?.[_0x58e197(0xf9)]??![],_0x5d6f66=_0x2ec021?.[_0x58e197(0x10c)]??'';if(!existsSync(_0x52f893))return console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0xda)+_0x52f893+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x16c303[_0x58e197(0xd3)]&&(console[_0x58e197(0x100)](_0x58e197(0x10a)+_0x16c303[_0x58e197(0x10b)]),console['error']('Parent\x20segment:\x20'+_0x212cec),console[_0x58e197(0x100)](_0x58e197(0x13f)+_0x52f893),_0x5972a4&&console[_0x58e197(0x100)](_0x58e197(0xf2)+_0x5d6f66));const _0x2b4a96=await withSpinner(_0x58e197(0x11e)+_0x212cec+_0x58e197(0xe1),()=>_0x21989c[_0x58e197(0x111)][_0x58e197(0x117)](_0x212cec),{'verbose':_0x16c303['verbose']}),_0x21acdf=_0x2b4a96['data'],{parentSegmentResult:_0x5aa1e6,segmentsResult:_0x138c41,foldersResult:_0x53d638,journeysWithDetailsResult:_0x21f1aa,userMaps:_0xf9a6b3}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x3364bd=_0x58e197,[_0x3546f5,_0x239714,_0x112f8f,_0x262119,_0xfe94ac]=await Promise[_0x3364bd(0xd8)]([_0x21989c[_0x3364bd(0x111)][_0x3364bd(0xdb)](_0x21acdf),_0x21989c['segment']['listSegments'](_0x21acdf),_0x21989c[_0x3364bd(0x111)][_0x3364bd(0xcc)](_0x21acdf),_0x21989c[_0x3364bd(0x11b)]['listJourneysWithDetailsFromParentSegment'](_0x21acdf,{'includeAllVersions':!![]}),_0x21989c[_0x3364bd(0x134)][_0x3364bd(0x11c)]()]);return{'parentSegmentResult':_0x3546f5,'segmentsResult':_0x239714,'foldersResult':_0x112f8f,'journeysWithDetailsResult':_0x262119,'userMaps':_0xfe94ac};},{'verbose':_0x16c303[_0x58e197(0xd3)]})[_0x58e197(0x145)](_0x5a9450=>_0x5a9450[_0x58e197(0xf6)]),_0x561ca4=_0x5aa1e6,_0x24d20a=extractRootFolderId(_0x561ca4),_0x3fb192=_0x138c41,_0x10d75c=_0x53d638,{journeys:_0x5814f1,activationStepsById:_0x40713d}=_0x21f1aa,_0x589efb=new Map(_0x5814f1[_0x58e197(0x138)](_0x4150f2=>[_0x4150f2['id'],_0x4150f2])),_0x2ee3bd=_0x5814f1[_0x58e197(0x138)](_0x3403c5=>({'id':_0x3403c5['id'],'name':_0x3403c5['attributes']['name'],'journeyBundleName':_0x3403c5[_0x58e197(0xbc)]['journeyBundleName']||'','journeyBundleId':_0x3403c5[_0x58e197(0xbc)]['journeyBundleId']||'','versionNumber':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x12a)],'description':_0x3403c5[_0x58e197(0xbc)]['description'],'state':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0xef)],'paused':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x125)],'audienceId':_0x3403c5[_0x58e197(0xbc)]['audienceId'],'folderId':_0x3403c5['relationships']?.[_0x58e197(0xfc)]?.[_0x58e197(0xf6)]?.['id'],'createdAt':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x11a)],'updatedAt':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0xbb)]})),{emailToId:_0x2a8845,idToEmail:_0x248fce}=_0xf9a6b3,_0x5df252=await withSpinner(_0x58e197(0xd7),async()=>{const _0x169513=_0x58e197,_0x38c0bc=await _0x21989c[_0x169513(0x12e)][_0x169513(0xd0)]();return buildConnectionMaps(_0x38c0bc);},{'verbose':_0x16c303[_0x58e197(0xd3)]})[_0x58e197(0x145)](_0x38d7a7=>_0x38d7a7[_0x58e197(0xf6)]),_0x33aa63=_0x5df252[_0x58e197(0xae)],_0xd33dd=_0x5df252['idToName'],_0x4be8cb=_0x5df252['nameToType'],_0x1179cd={'emailToIdMap':_0x2a8845,'connectionNameToIdMap':_0x33aa63,'connectionNameToTypeMap':_0x4be8cb,'getSchema':_0x587bd0=>_0x21989c[_0x58e197(0x12e)]['getOutputSchemaWithCache'](_0x587bd0)};let {pathToId:_0x26b5f7,idToPath:_0x39e11c}=buildFolderMaps(_0x10d75c);const _0x103dce=buildSegmentLookupMap(_0x3fb192,_0x39e11c),_0x463468=buildSegmentNameToIdMap(_0x3fb192),_0x29acf1=buildJourneyBundleLookupMap(_0x2ee3bd,_0x39e11c);let _0x30f288;if(_0x559818){if(!_0x559818[_0x58e197(0xe2)]('.yml')&&!_0x559818[_0x58e197(0xe2)](_0x58e197(0xed)))return console['error'](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xad)+_0x559818+'\x0a')),0x1;_0x30f288=[_0x559818];}else _0x30f288=findYamlFiles(_0x52f893);if(_0x30f288[_0x58e197(0xc1)]===0x0)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x52f893+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)](_0x58e197(0xf5))),0x1;let _0x2053d8,_0x48ccc7;try{const _0x4ab3f6=parseAndClassifyYamlFiles(_0x30f288,_0x52f893,{'skipSegments':_0x16c303['journeysOnly']});_0x2053d8=_0x4ab3f6[_0x58e197(0xf1)],_0x48ccc7=_0x4ab3f6[_0x58e197(0x133)];const _0x8a657f=validateParsedFiles(_0x4ab3f6,_0x52f893);if(_0x8a657f[_0x58e197(0xc1)]>0x0)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0x106))),console['error'](formatValidationErrors(_0x8a657f)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x157cb7){return console['error'](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xb4)+(_0x157cb7 instanceof Error?_0x157cb7[_0x58e197(0xc3)]:_0x157cb7))),0x1;}if(_0x2053d8[_0x58e197(0xc1)]===0x0&&_0x48ccc7['length']===0x0){const _0x3bc39e=_0x16c303[_0x58e197(0xe5)]?_0x58e197(0x11b):_0x58e197(0xc7);return console['error'](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x114)+_0x3bc39e+'\x20YAML\x20files\x20found')),0x0;}const _0x447908=new Map();_0x3fb192[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&await withSpinner(_0x58e197(0x137),async()=>{await batchAsync(_0x3fb192,async _0x51f0e3=>{const _0x16fadf=a39_0x37a0,_0x247fe9=await _0x21989c[_0x16fadf(0x111)][_0x16fadf(0xd1)](_0x21acdf,_0x51f0e3['id']);_0x447908[_0x16fadf(0xca)](_0x51f0e3['id'],_0x247fe9);});},{'verbose':_0x16c303[_0x58e197(0xd3)]});const {segmentFiles:_0x3e4137,foldersToCreate:_0x5db9ac}=await prepareSegmentFiles(_0x2053d8,{'segmentByFolderAndName':_0x103dce,'activationsBySegmentId':_0x447908,'folderPathToId':_0x26b5f7,'idToEmailMap':_0x248fce,'connectionIdToNameMap':_0xd33dd},_0x1179cd,_0x5972a4,_0x5d6f66),_0x2c6205=_0x559818?[]:findSegmentsToDelete(_0x3fb192,_0x2053d8[_0x58e197(0x138)](({yamlConfig:_0x5411b0,folderPath:_0x1b6785})=>({'yamlConfig':_0x5411b0,'folderPath':resolveTDFolderPath(_0x1b6785,_0x5972a4,_0x5d6f66)})),_0x39e11c,_0x5d6f66,_0x5972a4),{journeyFiles:_0x903edc,foldersToCreate:_0x17a69b}=await withProgressSpinner(_0x58e197(0x13b),async _0x4c845c=>prepareJourneyFiles(_0x48ccc7,{'fetchJourney':async _0x490728=>_0x21989c[_0x58e197(0x11b)][_0x58e197(0xe4)](_0x490728[_0x58e197(0xc6)]),'journeyBundlesByFolderAndName':_0x29acf1,'folderPathToId':_0x26b5f7,'idToEmailMap':_0x248fce,'connectionIdToNameMap':_0xd33dd,'existingSegments':_0x3fb192,'parentId':_0x21acdf,'deps':_0x21989c,'progress':{'update':_0xd6b8e6=>{const _0x12e1a3=_0x58e197;_0x4c845c['setPhase'](_0xd6b8e6),_0x16c303[_0x12e1a3(0xd3)]&&console[_0x12e1a3(0x100)]('\x20\x20'+_0xd6b8e6);}},'journeyById':_0x589efb,'activationStepsById':_0x40713d},_0x5972a4,_0x5d6f66),{'verbose':_0x16c303['verbose']})['then'](_0x666bab=>_0x666bab[_0x58e197(0xf6)]);for(const _0x17e892 of _0x17a69b){_0x5db9ac[_0x58e197(0x107)](_0x17e892);}const _0x5461e3=_0x559818?[]:findJourneysToDelete(_0x2ee3bd,_0x48ccc7['map'](({yamlConfig:_0x1f969d,folderPath:_0x22bbd4})=>({'yamlConfig':_0x1f969d,'folderPath':resolveTDFolderPath(_0x22bbd4,_0x5972a4,_0x5d6f66)})),_0x39e11c,_0x5d6f66,_0x5972a4),_0x207c9e=calculatePushStats(_0x3e4137,_0x903edc,_0x5db9ac,_0x2c6205,_0x5461e3,!!_0x16c303[_0x58e197(0xcb)],!!_0x16c303['journeysOnly']),_0x1ba209=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xee)],_0x11132b=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xf7)],_0x9f87f4=_0x207c9e[_0x58e197(0xf1)]['unchanged'],_0x19825a=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xab)],_0x3f956a=_0x207c9e[_0x58e197(0x102)][_0x58e197(0xcf)],_0x765293=_0x207c9e['journeys'][_0x58e197(0xee)],_0x372e88=_0x207c9e[_0x58e197(0x133)][_0x58e197(0xf7)],_0x3c4aa2=_0x207c9e['journeys'][_0x58e197(0xb9)],_0x5d76a0=_0x207c9e[_0x58e197(0x133)][_0x58e197(0xab)],_0x25a3ec=_0x207c9e[_0x58e197(0x127)]['all'],_0x25f0a7=_0x207c9e['activations']['toCreate'],_0x21f78b=_0x207c9e[_0x58e197(0x127)]['toUpdate'],_0x3ff9bb=_0x207c9e['activations']['toDelete'];console[_0x58e197(0x100)](_0x58e197(0x12c)+_0x212cec+'\x27:');_0x3f956a[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0xc2)]('π\x20'+_0x3f956a[_0x58e197(0xc1)]+_0x58e197(0xbe)));if(!_0x16c303[_0x58e197(0xe5)]){console[_0x58e197(0x100)](_0x58e197(0xce)),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x104)]('+\x20'+_0x1ba209[_0x58e197(0xc1)]+_0x58e197(0x123))),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52['yellow']('~\x20'+_0x11132b[_0x58e197(0xc1)]+_0x58e197(0xb7)));if(_0x19825a[_0x58e197(0xc1)]>0x0)console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x19825a['length']+_0x58e197(0x132)));else _0x2c6205[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xcb)]&&console['error'](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)](_0x2c6205['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x58e197(0xd6)+a39_0x247d52['dim']('=\x20'+_0x9f87f4[_0x58e197(0xc1)]+_0x58e197(0x116)));}if(_0x903edc[_0x58e197(0xc1)]>0x0||_0x5461e3[_0x58e197(0xc1)]>0x0){console[_0x58e197(0x100)](_0x58e197(0x139)),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x104)]('+\x20'+_0x765293['length']+_0x58e197(0x123))),console['error'](_0x58e197(0xd6)+a39_0x247d52['yellow']('~\x20'+_0x372e88[_0x58e197(0xc1)]+'\x20changed'));if(_0x5d76a0['length']>0x0)console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x5d76a0[_0x58e197(0xc1)]+_0x58e197(0x132)));else _0x5461e3['length']>0x0&&!_0x16c303[_0x58e197(0xcb)]&&console['error'](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)](_0x5461e3[_0x58e197(0xc1)]+_0x58e197(0xfa)));console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)]('=\x20'+_0x3c4aa2['length']+_0x58e197(0x116)));}_0x25a3ec[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&(console[_0x58e197(0x100)](''),console[_0x58e197(0x100)](_0x58e197(0x13d)),_0x25f0a7[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52['green']('+\x20'+_0x25f0a7[_0x58e197(0xc1)]+_0x58e197(0x136))),_0x21f78b[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20\x20\x20'+a39_0x247d52[_0x58e197(0xfd)]('~\x20'+_0x21f78b[_0x58e197(0xc1)]+'\x20to\x20update')),_0x3ff9bb[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x3ff9bb[_0x58e197(0xc1)]+'\x20to\x20delete')));console['error'](_0x58e197(0x112)+a39_0x247d52['cyan'](_0x52f893)+'\x0a');if(_0x3f956a[_0x58e197(0xc1)]>0x0){console[_0x58e197(0x100)]('Folders\x20to\x20create:');for(const _0x23bc23 of _0x3f956a){console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0xc2)]('+')+'\x20'+_0x23bc23);}console[_0x58e197(0x100)]('');}if(_0x1ba209[_0x58e197(0xc1)]>0x0&&!_0x16c303['journeysOnly'])for(const _0xe4f486 of _0x1ba209){const _0x292978=_0xe4f486[_0x58e197(0x141)]?_0xe4f486[_0x58e197(0x141)]+'/'+_0xe4f486[_0x58e197(0xb3)][_0x58e197(0x142)]:_0xe4f486[_0x58e197(0xb3)][_0x58e197(0x142)],_0x3454d5=_0xe4f486['yamlConfig'][_0x58e197(0x127)]?.[_0x58e197(0xc1)]||0x0,_0x42bed7=_0x3454d5>0x0?a39_0x247d52[_0x58e197(0x130)]('\x20['+_0x3454d5+_0x58e197(0xdf)):'';console['error']('\x0a'+a39_0x247d52[_0x58e197(0x104)](_0x58e197(0xc4))+'\x20'+_0x292978+_0x42bed7),console[_0x58e197(0x100)]('β'['repeat'](0x3c)),_0xe4f486[_0x58e197(0xc8)]&&console['error'](_0xe4f486[_0x58e197(0xc8)]),console['error']('β'['repeat'](0x3c));}if(_0x19825a['length']>0x0&&!_0x16c303['journeysOnly'])for(const _0x5bce32 of _0x19825a){const _0x4cbc3b=_0x5bce32[_0x58e197(0xb2)]?_0x39e11c['get'](_0x5bce32[_0x58e197(0xb2)][_0x58e197(0xf4)]())||'':'',_0x459d2d=_0x4cbc3b?_0x4cbc3b+'/'+_0x5bce32[_0x58e197(0x142)]:_0x5bce32[_0x58e197(0x142)],_0x1729ec=_0x447908[_0x58e197(0xeb)](_0x5bce32['id'])||[],_0x589280=_0x1729ec[_0x58e197(0xc1)]>0x0?a39_0x247d52[_0x58e197(0x130)]('\x20['+_0x1729ec[_0x58e197(0xc1)]+_0x58e197(0xdf)):'';console[_0x58e197(0x100)]('\x0a'+a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xaa))+'\x20'+_0x459d2d+_0x589280),console['error']('β'['repeat'](0x3c));const _0x31b2fb=segmentWithActivationsToYaml(_0x5bce32,_0x1729ec,undefined,_0x248fce,_0xd33dd),_0x573147=segmentToYamlString(_0x31b2fb),_0x57f6a2=generateDiff(_0x573147,'');console[_0x58e197(0x100)](formatDiffWithColors(_0x57f6a2)),console[_0x58e197(0x100)]('β'['repeat'](0x3c));}const _0x5ea346=_0x3e4137[_0x58e197(0x140)](_0x17711a=>!_0x17711a[_0x58e197(0xb6)]&&_0x17711a[_0x58e197(0xc8)]);if(_0x5ea346[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)])for(const _0xbd6c2a of _0x5ea346){const _0x28c3d8=_0xbd6c2a[_0x58e197(0x141)]?_0xbd6c2a['folderPath']+'/'+_0xbd6c2a[_0x58e197(0xb3)][_0x58e197(0x142)]:_0xbd6c2a[_0x58e197(0xb3)][_0x58e197(0x142)];console['error']('\x0a'+a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x144))+'\x20'+_0x28c3d8),console['error']('β'[_0x58e197(0x101)](0x3c)),console[_0x58e197(0x100)](_0xbd6c2a[_0x58e197(0xc8)]),console['error']('β'[_0x58e197(0x101)](0x3c));}if(_0x765293['length']>0x0)for(const _0x96e10f of _0x765293){const _0x1f2f5a=_0x96e10f[_0x58e197(0x141)]?_0x96e10f[_0x58e197(0x141)]+'/'+_0x96e10f['yamlConfig']['name']:_0x96e10f[_0x58e197(0xb3)][_0x58e197(0x142)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52['green'](_0x58e197(0xba))+'\x20'+_0x1f2f5a),console[_0x58e197(0x100)]('β'[_0x58e197(0x101)](0x3c)),_0x96e10f[_0x58e197(0xc8)]&&console['error'](_0x96e10f[_0x58e197(0xc8)]),console[_0x58e197(0x100)]('β'[_0x58e197(0x101)](0x3c));}const _0x221ac5=_0x903edc[_0x58e197(0x140)](_0x334578=>!_0x334578[_0x58e197(0xb6)]&&_0x334578[_0x58e197(0xc8)]);if(_0x221ac5[_0x58e197(0xc1)]>0x0)for(const _0x4f0d03 of _0x221ac5){const _0x4aedb8=_0x4f0d03[_0x58e197(0x141)]?_0x4f0d03['folderPath']+'/'+_0x4f0d03[_0x58e197(0xb3)][_0x58e197(0x142)]:_0x4f0d03[_0x58e197(0xb3)][_0x58e197(0x142)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x122))+'\x20'+_0x4aedb8),console[_0x58e197(0x100)]('β'['repeat'](0x3c)),console[_0x58e197(0x100)](_0x4f0d03[_0x58e197(0xc8)]),console[_0x58e197(0x100)]('β'[_0x58e197(0x101)](0x3c));}if(_0x5d76a0[_0x58e197(0xc1)]>0x0)for(const _0x1c17f4 of _0x5d76a0){const _0x269ffd=_0x1c17f4[_0x58e197(0x10e)]?_0x39e11c['get'](_0x1c17f4[_0x58e197(0x10e)])||'':'',_0x42d106=_0x269ffd?_0x269ffd+'/'+_0x1c17f4[_0x58e197(0x119)]:_0x1c17f4[_0x58e197(0x119)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52['red'](_0x58e197(0xe8))+'\x20'+_0x42d106),console[_0x58e197(0x100)]('β'[_0x58e197(0x101)](0x3c)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xff))),console[_0x58e197(0x100)]('β'[_0x58e197(0x101)](0x3c));}if(_0x16c303['dryRun'])return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xe7))),0x0;const _0x4eb0e2=_0x16c303[_0x58e197(0xe5)]?![]:_0x1ba209['length']>0x0||_0x11132b[_0x58e197(0xc1)]>0x0||_0x19825a[_0x58e197(0xc1)]>0x0,_0x3cc95d=_0x765293[_0x58e197(0xc1)]>0x0||_0x372e88[_0x58e197(0xc1)]>0x0||_0x5d76a0['length']>0x0,_0x3f2958=_0x16c303[_0x58e197(0xe5)]?![]:_0x25a3ec[_0x58e197(0xc1)]>0x0,_0x428c70=_0x3f956a['length']>0x0;if(!_0x4eb0e2&&!_0x3cc95d&&!_0x3f2958&&!_0x428c70){const _0x5903f0=_0x16c303[_0x58e197(0xe5)]?_0x58e197(0xd2):'β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)](_0x5903f0));if(_0x559818&&_0x9f87f4['length']===0x1){const _0x281906=_0x9f87f4[0x0];if(_0x281906[_0x58e197(0x120)]?.['id']){const _0x59b8f0=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],_0x58e197(0x109)+_0x21acdf+_0x58e197(0xb0)+_0x281906[_0x58e197(0x120)]['id']+_0x58e197(0x13e));console[_0x58e197(0x100)](_0x58e197(0xac)+a39_0x247d52['cyan'](_0x59b8f0));}}if(_0x559818&&_0x3c4aa2[_0x58e197(0xc1)]===0x1){const _0x1cf4e4=_0x3c4aa2[0x0];if(_0x1cf4e4['existingJourney']?.['id']){const _0x53569c=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],'/app/ps/'+_0x21acdf+_0x58e197(0xb0)+_0x1cf4e4[_0x58e197(0x128)]['id']+'/j/da/je');console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0x118)](_0x53569c));}}return 0x0;}const _0x4326a8=_0x16c303[_0x58e197(0xe5)]?_0x765293[_0x58e197(0xc1)]+_0x372e88['length']+_0x5d76a0[_0x58e197(0xc1)]+_0x3f956a[_0x58e197(0xc1)]:_0x1ba209[_0x58e197(0xc1)]+_0x11132b[_0x58e197(0xc1)]+_0x19825a[_0x58e197(0xc1)]+_0x765293['length']+_0x372e88[_0x58e197(0xc1)]+_0x5d76a0['length']+_0x3f956a[_0x58e197(0xc1)]+_0x25a3ec[_0x58e197(0xc1)];if(!_0x16c303[_0x58e197(0xdd)]&&_0x4326a8>0x0){if(!isInteractive())return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0x131)),_0x58e197(0xf0)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x130)](_0x58e197(0xfb))),0x1;const _0x5679ce=await confirmKey(_0x58e197(0x124)+_0x4326a8+_0x58e197(0xcd));if(!_0x5679ce)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xe3))),0x1;}const _0x2941d6={'withProgress':async(_0x3e38ae,_0x25dca6)=>{const _0x2af588=_0x58e197,_0x4b2882=await withSpinner(_0x3e38ae,_0x25dca6,{'verbose':_0x16c303['verbose']});return{'data':_0x4b2882[_0x2af588(0xf6)]};},'logInfo':_0x12975a=>console['error'](a39_0x247d52['blue']('β\x20'+_0x12975a)),'logSuccess':_0x419633=>console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)]('β\x20'+_0x419633)),'logWarning':_0x4239e6=>console['error'](a39_0x247d52[_0x58e197(0xfd)]('β \x20'+_0x4239e6)),'logDeleted':_0x22dff6=>console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)]('β\x20'+_0x22dff6))},_0x3a5b61={'segment':_0x21989c['segment'],'journey':_0x21989c[_0x58e197(0x11b)],'user':_0x21989c['user'],'connection':_0x21989c[_0x58e197(0x12e)]};_0x3f956a[_0x58e197(0xc1)]>0x0&&(_0x26b5f7=await executePushFolders(_0x3a5b61,_0x3f956a,_0x26b5f7,{'parentId':_0x21acdf},_0x2941d6));const _0x2e9108={'rootFolderId':_0x24d20a,'folderPathToId':_0x26b5f7,'folderIdToPath':_0x39e11c,'segmentNameToId':_0x463468,'activationsBySegmentId':_0x447908,'emailToIdMap':_0x2a8845,'idToEmailMap':_0x248fce,'connectionNameToIdMap':_0x5df252[_0x58e197(0xae)],'connectionIdToNameMap':_0x5df252[_0x58e197(0x146)],'connectionNameToTypeMap':_0x4be8cb},_0x4a1691=await executePushSegments(_0x3a5b61,_0x16c303['journeysOnly']?[]:_0x3e4137,_0x2e9108,{'parentId':_0x21acdf},_0x2941d6),_0x2d9e62=_0x4a1691[_0x58e197(0xd5)],_0x3b62b9=_0x4a1691[_0x58e197(0x143)],_0x188d03=_0x4a1691['activations'][_0x58e197(0xd5)],_0x2ccc9b=_0x4a1691['activations']['updated'],_0x2f07e6=_0x4a1691[_0x58e197(0x127)][_0x58e197(0xbf)];let _0x324b60;if(_0x559818&&_0x3e4137['length']===0x1){const _0x488c74=_0x3e4137[0x0];_0x324b60=_0x488c74[_0x58e197(0x120)]?.['id']??_0x4a1691[_0x58e197(0x11d)][_0x58e197(0xeb)](_0x488c74[_0x58e197(0xb3)][_0x58e197(0x142)]);}const _0x54e034=await executePushSegmentDeletions(_0x3a5b61,_0x16c303[_0x58e197(0xe5)]?[]:_0x19825a,_0x2941d6);let _0x4b695f=0x0,_0x3996ec=0x0,_0x44b8a2=0x0;const _0x1ccdb6=new Map(_0x463468);for(const [_0x55f561,_0x30f497]of _0x4a1691[_0x58e197(0x11d)]){_0x1ccdb6[_0x58e197(0xca)](_0x55f561,_0x30f497);}if(_0x903edc[_0x58e197(0xc1)]>0x0){const _0x2d8a71={..._0x2e9108,'segmentNameToId':_0x1ccdb6,'existingSegments':_0x3fb192,'activationContext':_0x1179cd},_0x4681d8=await executePushJourneys(_0x3a5b61,_0x903edc,_0x2d8a71,{'parentId':_0x21acdf,'rootFolderId':_0x24d20a,'verbose':_0x16c303[_0x58e197(0xd3)]},_0x2941d6);_0x4b695f=_0x4681d8[_0x58e197(0xd5)],_0x3996ec=_0x4681d8['updated'];if(_0x559818&&_0x4681d8['results'][_0x58e197(0xc1)]===0x1){const _0x196133=_0x4681d8['results'][0x0];if(_0x196133[_0x58e197(0xc6)]){const _0x30c064=getConsoleNextUrl(_0x16c303['site'],'/app/ps/'+_0x21acdf+_0x58e197(0xb0)+_0x196133[_0x58e197(0xc6)]+_0x58e197(0xc5));console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0x118)](_0x30c064));}}}for(const _0x56066b of _0x5d76a0){console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xc9)+_0x56066b['journeyBundleName'])),_0x44b8a2++;}const _0x4609d6=[];if(_0x2d9e62>0x0)_0x4609d6[_0x58e197(0x10d)](_0x2d9e62+_0x58e197(0xea));if(_0x3b62b9>0x0)_0x4609d6[_0x58e197(0x10d)](_0x3b62b9+_0x58e197(0x105));if(_0x54e034>0x0)_0x4609d6[_0x58e197(0x10d)](_0x54e034+_0x58e197(0x126));const _0x1d997c=[];if(_0x4b695f>0x0)_0x1d997c[_0x58e197(0x10d)](_0x4b695f+_0x58e197(0xea));if(_0x3996ec>0x0)_0x1d997c[_0x58e197(0x10d)](_0x3996ec+_0x58e197(0x105));if(_0x44b8a2>0x0)_0x1d997c[_0x58e197(0x10d)](_0x44b8a2+_0x58e197(0x126));const _0x56041e=[];if(_0x188d03>0x0)_0x56041e[_0x58e197(0x10d)](_0x188d03+'\x20created');if(_0x2ccc9b>0x0)_0x56041e['push'](_0x2ccc9b+_0x58e197(0x105));if(_0x2f07e6>0x0)_0x56041e[_0x58e197(0x10d)](_0x2f07e6+_0x58e197(0x126));console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)]('\x0aβ\x20Push\x20complete'));_0x4609d6[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&console[_0x58e197(0x100)](_0x58e197(0xbd)+_0x4609d6[_0x58e197(0xe6)](',\x20'));_0x1d997c[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20Journeys:\x20'+_0x1d997c[_0x58e197(0xe6)](',\x20'));_0x56041e['length']>0x0&&!_0x16c303['journeysOnly']&&console[_0x58e197(0x100)](_0x58e197(0xf3)+_0x56041e[_0x58e197(0xe6)](',\x20'));if(_0x324b60){const _0x334da1=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],_0x58e197(0x109)+_0x21acdf+_0x58e197(0xb0)+_0x324b60+_0x58e197(0x13e));console[_0x58e197(0x100)](_0x58e197(0xac)+a39_0x247d52[_0x58e197(0x118)](_0x334da1));}return 0x0;}}
|
|
1
|
+
const a39_0x3c6822=a39_0x1a44;(function(_0x5937e4,_0x58641a){const _0x4f91c7=a39_0x1a44,_0x417994=_0x5937e4();while(!![]){try{const _0x5617d0=parseInt(_0x4f91c7(0x195))/0x1*(parseInt(_0x4f91c7(0x20a))/0x2)+parseInt(_0x4f91c7(0x1d3))/0x3*(-parseInt(_0x4f91c7(0x1e0))/0x4)+-parseInt(_0x4f91c7(0x194))/0x5*(-parseInt(_0x4f91c7(0x1ba))/0x6)+parseInt(_0x4f91c7(0x198))/0x7+parseInt(_0x4f91c7(0x1cd))/0x8*(parseInt(_0x4f91c7(0x1a0))/0x9)+-parseInt(_0x4f91c7(0x18e))/0xa*(-parseInt(_0x4f91c7(0x181))/0xb)+parseInt(_0x4f91c7(0x185))/0xc*(-parseInt(_0x4f91c7(0x20d))/0xd);if(_0x5617d0===_0x58641a)break;else _0x417994['push'](_0x417994['shift']());}catch(_0x490f9b){_0x417994['push'](_0x417994['shift']());}}}(a39_0x10f9,0x64ca2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x10f9(){const _0x4084c3=['638463tPzUDA','resolveParentId','\x20\x20Activations:\x20','idToName','targetDir','segmentFolderId','\x20\x20\x20\x20','journeys','267048XQFlBA','file','buildUserMaps','no_parent','helpText','endsWith','journeysOnly','created','error','name','Error:\x20','folders','get','/e/','listActivations','Fetching\x20connections\x20for\x20name\x20resolution...','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','New\x20journey:','\x0aError:','type','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeyBundleId','setPhase','getOutputSchemaWithCache','listJourneysWithDetailsFromParentSegment','updatedAt','12AQAyNo','Changes\x20to:','segment','cyan','verbose','.yaml','createdAt','\x20updated','filePath','\x20folders\x20to\x20create','parent_name','Site:\x20','set','push','.yml','\x20to\x20create','blue','listFolders','Changes\x20to\x20journey:','56DbOdgD','cwd','\x20unchanged','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Preparing\x20journeys...','/j/da/je','13938OMBQgK','existingJourney','\x20to\x20update','\x20\x20Activations:','Fetching\x20existing\x20data...','getJourney','red','\x0aValidation\x20failed:','errorCode','connection','execute','\x20YAML\x20files\x20found','yellow','20LfnJBK','parentFolder','Folders\x20to\x20create:','state','parentName','createdSegmentIds','dim','attributes','Resolving\x20parent\x20segment\x20\x27','\x27...','yamlConfig','then','\x20new','Error:\x20Directory\x20not\x20found:\x20','Source\x20directory:\x20','changed','segment:push','isScoped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','toString','\x0aβ\x20Push\x20complete','repeat','Fetching\x20existing\x20activations...','folderId','\x20to\x20delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20created','new','updated','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','message','user','π\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activations','existingSegment','\x20\x20Source:\x20','folderPath','audienceId','toCreate','toDelete','deleted','589714UgmmMF','segments','green','597701iwOzCL','map','isNew','nameToId','Delete\x20segment:','\x20deleted','Parent\x20segment:\x20','parentSegment','Aborted.','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','data','Push\x20','list','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','journeyId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Scoped\x20to\x20folder:\x20','\x20activations]','\x20\x20Segments:\x20','55099eXhbIY','\x20changed','all','\x20\x20π\x20Segments:','468DESKWb','journeyBundleName','join','journey','delete','add','/sb/da/esr','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','unchanged','1260eSqAsU','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','results','description','diff','relationships','1773515uaoXmw','2LqdQSS','/app/ps/','length'];a39_0x10f9=function(){return _0x4084c3;};return a39_0x10f9();}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_0x30ea8b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a39_0x1a44(_0x114171,_0x5e159f){_0x114171=_0x114171-0x174;const _0x10f9da=a39_0x10f9();let _0x1a4434=_0x10f9da[_0x114171];return _0x1a4434;}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_0x3c6822(0x1a9)]=a39_0x3c6822(0x1f0);['description']=a39_0x3c6822(0x176);async[a39_0x3c6822(0x1dd)](_0x36466b){const _0x3c4aa7=a39_0x3c6822,{options:_0x2853cc,args:_0x338141,tdx:_0xf398e}=_0x36466b,_0x179d89=_0x2853cc,_0x464c7f=await resolveTarget({'arg':_0x338141[0x0],'contextParent':_0x2853cc[_0x3c4aa7(0x174)],'cwd':process[_0x3c4aa7(0x1ce)]()});if(!isSuccessfulResolution(_0x464c7f))return _0x464c7f[_0x3c4aa7(0x1db)]===_0x3c4aa7(0x1a3)?(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x201))),console[_0x3c4aa7(0x1a8)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1f9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1aa)+_0x464c7f[_0x3c4aa7(0x1fe)]+'\x0a')),_0x464c7f[_0x3c4aa7(0x1a4)]&&console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan'](_0x464c7f['helpText']))),0x1;if(_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1c4))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x464c7f[_0x3c4aa7(0x19c)]+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x3c4aa7(0x17a))),0x1;const _0x5e8349=_0x464c7f[_0x3c4aa7(0x1e4)],_0x4469a6=_0x464c7f[_0x3c4aa7(0x19c)],_0x454d92=_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1a1)?_0x464c7f[_0x3c4aa7(0x1c2)]:undefined,_0x5b647d=getScopedDetails(_0x464c7f),_0x5dce64=_0x5b647d?.[_0x3c4aa7(0x1f1)]??![],_0x2d5f09=_0x5b647d?.['scopedFolderPath']??'';if(!existsSync(_0x4469a6))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x4469a6+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x179d89[_0x3c4aa7(0x1be)]&&(console['error'](_0x3c4aa7(0x1c5)+_0x179d89['site']),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x213)+_0x5e8349),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1ee)+_0x4469a6),_0x5dce64&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x17e)+_0x2d5f09));const _0x4d1c8a=await withSpinner(_0x3c4aa7(0x1e8)+_0x5e8349+_0x3c4aa7(0x1e9),()=>_0xf398e[_0x3c4aa7(0x1bc)][_0x3c4aa7(0x199)](_0x5e8349),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]}),_0x27c4c2=_0x4d1c8a[_0x3c4aa7(0x177)],{parentSegmentResult:_0x479604,segmentsResult:_0x120128,foldersResult:_0x231ac7,journeysWithDetailsResult:_0x5e4cb2,userMaps:_0x273183}=await withSpinner(_0x3c4aa7(0x1d7),async()=>{const _0x106810=_0x3c4aa7,[_0x4f476b,_0x5c6e47,_0x9559b7,_0x1dbb01,_0x2c296c]=await Promise[_0x106810(0x183)]([_0xf398e['segment']['getParent'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)]['listSegments'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)][_0x106810(0x1cb)](_0x27c4c2),_0xf398e[_0x106810(0x188)][_0x106810(0x1b8)](_0x27c4c2,{'includeAllVersions':!![]}),_0xf398e['user'][_0x106810(0x1a2)]()]);return{'parentSegmentResult':_0x4f476b,'segmentsResult':_0x5c6e47,'foldersResult':_0x9559b7,'journeysWithDetailsResult':_0x1dbb01,'userMaps':_0x2c296c};},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x2b9c3f=>_0x2b9c3f[_0x3c4aa7(0x177)]),_0x5855f7=_0x479604,_0x5aca44=extractRootFolderId(_0x5855f7),_0x4c50b7=_0x120128,_0x14b404=_0x231ac7,{journeys:_0x4eabf7,activationStepsById:_0x27bad3}=_0x5e4cb2,_0x3e9f46=new Map(_0x4eabf7[_0x3c4aa7(0x20e)](_0x3bbbe7=>[_0x3bbbe7['id'],_0x3bbbe7])),_0x9a09dd=_0x4eabf7[_0x3c4aa7(0x20e)](_0x4ef5fa=>({'id':_0x4ef5fa['id'],'name':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1a9)],'journeyBundleName':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x186)]||'','journeyBundleId':_0x4ef5fa['attributes'][_0x3c4aa7(0x1b5)]||'','versionNumber':_0x4ef5fa[_0x3c4aa7(0x1e7)]['versionNumber'],'description':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x191)],'state':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1e3)],'paused':_0x4ef5fa['attributes']['paused'],'audienceId':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x206)],'folderId':_0x4ef5fa[_0x3c4aa7(0x193)]?.[_0x3c4aa7(0x1e1)]?.[_0x3c4aa7(0x177)]?.['id'],'createdAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1c0)],'updatedAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1b9)]})),{emailToId:_0x1261a0,idToEmail:_0x12e592}=_0x273183,_0x753f53=await withSpinner(_0x3c4aa7(0x1af),async()=>{const _0x42cce1=_0x3c4aa7,_0x1167ae=await _0xf398e[_0x42cce1(0x1dc)][_0x42cce1(0x179)]();return buildConnectionMaps(_0x1167ae);},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x22b705=>_0x22b705[_0x3c4aa7(0x177)]),_0x30d14a=_0x753f53[_0x3c4aa7(0x210)],_0x2eb4a7=_0x753f53[_0x3c4aa7(0x19b)],_0x5c3fbe=_0x753f53['nameToType'],_0x369f1c={'emailToIdMap':_0x1261a0,'connectionNameToIdMap':_0x30d14a,'connectionNameToTypeMap':_0x5c3fbe,'getSchema':_0x3a6f15=>_0xf398e[_0x3c4aa7(0x1dc)][_0x3c4aa7(0x1b7)](_0x3a6f15)};let {pathToId:_0x54cf4a,idToPath:_0x6b7ab2}=buildFolderMaps(_0x14b404);const _0x47f6c8=buildSegmentLookupMap(_0x4c50b7,_0x6b7ab2),_0x3cc844=buildSegmentNameToIdMap(_0x4c50b7),_0x3a2291=buildJourneyBundleLookupMap(_0x9a09dd,_0x6b7ab2);let _0x32aa0d;if(_0x454d92){if(!_0x454d92[_0x3c4aa7(0x1a5)](_0x3c4aa7(0x1c8))&&!_0x454d92['endsWith'](_0x3c4aa7(0x1bf)))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1f2)+_0x454d92+'\x0a')),0x1;_0x32aa0d=[_0x454d92];}else _0x32aa0d=findYamlFiles(_0x4469a6);if(_0x32aa0d['length']===0x0)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x17d)+_0x4469a6+'\x0a')),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1bd)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x25f969,_0x2185ae;try{const _0x29ef6f=parseAndClassifyYamlFiles(_0x32aa0d,_0x4469a6,{'skipSegments':_0x179d89[_0x3c4aa7(0x1a6)]});_0x25f969=_0x29ef6f[_0x3c4aa7(0x20b)],_0x2185ae=_0x29ef6f[_0x3c4aa7(0x19f)];const _0x493b34=validateParsedFiles(_0x29ef6f,_0x4469a6);if(_0x493b34[_0x3c4aa7(0x197)]>0x0)return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1da))),console[_0x3c4aa7(0x1a8)](formatValidationErrors(_0x493b34)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xd0fce6){return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red']('Error\x20parsing\x20YAML:\x20'+(_0xd0fce6 instanceof Error?_0xd0fce6[_0x3c4aa7(0x1fe)]:_0xd0fce6))),0x1;}if(_0x25f969[_0x3c4aa7(0x197)]===0x0&&_0x2185ae[_0x3c4aa7(0x197)]===0x0){const _0x47907a=_0x179d89['journeysOnly']?_0x3c4aa7(0x188):'segment\x20or\x20journey';return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('No\x20'+_0x47907a+_0x3c4aa7(0x1de))),0x0;}const _0x38e917=new Map();_0x4c50b7['length']>0x0&&!_0x179d89['journeysOnly']&&await withSpinner(_0x3c4aa7(0x1f6),async()=>{await batchAsync(_0x4c50b7,async _0x576479=>{const _0x53ebad=a39_0x1a44,_0x571327=await _0xf398e['segment'][_0x53ebad(0x1ae)](_0x27c4c2,_0x576479['id']);_0x38e917[_0x53ebad(0x1c6)](_0x576479['id'],_0x571327);});},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]});const {segmentFiles:_0x5048ac,foldersToCreate:_0xb93ae0}=await prepareSegmentFiles(_0x25f969,{'segmentByFolderAndName':_0x47f6c8,'activationsBySegmentId':_0x38e917,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7},_0x369f1c,_0x5dce64,_0x2d5f09),_0x23a66c=_0x454d92?[]:findSegmentsToDelete(_0x4c50b7,_0x25f969[_0x3c4aa7(0x20e)](({yamlConfig:_0x48815a,folderPath:_0x100306})=>({'yamlConfig':_0x48815a,'folderPath':resolveTDFolderPath(_0x100306,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),{journeyFiles:_0x26dfdc,foldersToCreate:_0xa528b0}=await withProgressSpinner(_0x3c4aa7(0x1d1),async _0x23e92b=>prepareJourneyFiles(_0x2185ae,{'fetchJourney':async _0x5fa5e2=>_0xf398e[_0x3c4aa7(0x188)][_0x3c4aa7(0x1d8)](_0x5fa5e2[_0x3c4aa7(0x17c)]),'journeyBundlesByFolderAndName':_0x3a2291,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7,'existingSegments':_0x4c50b7,'parentId':_0x27c4c2,'deps':_0xf398e,'progress':{'update':_0x35f932=>{const _0x13f785=_0x3c4aa7;_0x23e92b[_0x13f785(0x1b6)](_0x35f932),_0x179d89[_0x13f785(0x1be)]&&console[_0x13f785(0x1a8)]('\x20\x20'+_0x35f932);}},'journeyById':_0x3e9f46,'activationStepsById':_0x27bad3},_0x5dce64,_0x2d5f09),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0xa07a6c=>_0xa07a6c[_0x3c4aa7(0x177)]);for(const _0x45e717 of _0xa528b0){_0xb93ae0[_0x3c4aa7(0x18a)](_0x45e717);}const _0x2be252=_0x454d92?[]:findJourneysToDelete(_0x9a09dd,_0x2185ae[_0x3c4aa7(0x20e)](({yamlConfig:_0x23d3a8,folderPath:_0x513c5a})=>({'yamlConfig':_0x23d3a8,'folderPath':resolveTDFolderPath(_0x513c5a,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),_0x492beb=calculatePushStats(_0x5048ac,_0x26dfdc,_0xb93ae0,_0x23a66c,_0x2be252,!!_0x179d89['delete'],!!_0x179d89[_0x3c4aa7(0x1a6)]),_0x4db57f=_0x492beb[_0x3c4aa7(0x20b)]['new'],_0x290ab9=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x1ef)],_0x3dd41f=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x18d)],_0x41f115=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x208)],_0x465414=_0x492beb[_0x3c4aa7(0x1ab)][_0x3c4aa7(0x207)],_0x59a7d4=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x1fb)],_0x4a9f7f=_0x492beb['journeys'][_0x3c4aa7(0x1ef)],_0x13e9a8=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x18d)],_0x3beed2=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x208)],_0x478817=_0x492beb[_0x3c4aa7(0x202)]['all'],_0x3a079c=_0x492beb['activations'][_0x3c4aa7(0x207)],_0x2161a4=_0x492beb['activations']['toUpdate'],_0x151d9f=_0x492beb[_0x3c4aa7(0x202)][_0x3c4aa7(0x208)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x5e8349+'\x27:');_0x465414[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1ca)](_0x3c4aa7(0x200)+_0x465414[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c3)));if(!_0x179d89[_0x3c4aa7(0x1a6)]){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x184)),console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x4db57f['length']+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x290ab9[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x41f115[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x41f115[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x23a66c[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x23a66c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1fd)));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x3dd41f['length']+_0x3c4aa7(0x1cf)));}if(_0x26dfdc['length']>0x0||_0x2be252[_0x3c4aa7(0x197)]>0x0){console['error']('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x59a7d4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x3beed2[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b['red']('-\x20'+_0x3beed2[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x2be252['length']>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x2be252['length']+_0x3c4aa7(0x1fd)));console['error']('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x13e9a8[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1cf)));}_0x478817[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&(console['error'](''),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1d6)),_0x3a079c[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x3a079c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c9))),_0x2161a4[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x2161a4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1d5))),_0x151d9f[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x151d9f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8))));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x204)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x4469a6)+'\x0a');if(_0x465414[_0x3c4aa7(0x197)]>0x0){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1e2));for(const _0x530495 of _0x465414){console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['blue']('+')+'\x20'+_0x530495);}console['error']('');}if(_0x4db57f[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x459d8a of _0x4db57f){const _0x486aeb=_0x459d8a[_0x3c4aa7(0x205)]?_0x459d8a[_0x3c4aa7(0x205)]+'/'+_0x459d8a['yamlConfig'][_0x3c4aa7(0x1a9)]:_0x459d8a[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)],_0xefa5a6=_0x459d8a[_0x3c4aa7(0x1ea)]['activations']?.[_0x3c4aa7(0x197)]||0x0,_0x1e7f61=_0xefa5a6>0x0?a39_0x30ea8b[_0x3c4aa7(0x1e6)]('\x20['+_0xefa5a6+_0x3c4aa7(0x17f)):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('New\x20segment:')+'\x20'+_0x486aeb+_0x1e7f61),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c)),_0x459d8a[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x459d8a['diff']),console[_0x3c4aa7(0x1a8)]('β'['repeat'](0x3c));}if(_0x41f115[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x37f245 of _0x41f115){const _0x342106=_0x37f245[_0x3c4aa7(0x19d)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x37f245[_0x3c4aa7(0x19d)][_0x3c4aa7(0x1f3)]())||'':'',_0x53db03=_0x342106?_0x342106+'/'+_0x37f245[_0x3c4aa7(0x1a9)]:_0x37f245['name'],_0x4e10ed=_0x38e917['get'](_0x37f245['id'])||[],_0x59de94=_0x4e10ed['length']>0x0?a39_0x30ea8b['dim']('\x20['+_0x4e10ed[_0x3c4aa7(0x197)]+'\x20activations]'):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red'](_0x3c4aa7(0x211))+'\x20'+_0x53db03+_0x59de94),console['error']('β'['repeat'](0x3c));const _0x157d59=segmentWithActivationsToYaml(_0x37f245,_0x4e10ed,undefined,_0x12e592,_0x2eb4a7),_0x1a8611=segmentToYamlString(_0x157d59),_0xf20e40=generateDiff(_0x1a8611,'');console[_0x3c4aa7(0x1a8)](formatDiffWithColors(_0xf20e40)),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3f4ff6=_0x5048ac['filter'](_0x55b131=>!_0x55b131['isNew']&&_0x55b131[_0x3c4aa7(0x192)]);if(_0x3f4ff6[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x59fccd of _0x3f4ff6){const _0x26de66=_0x59fccd['folderPath']?_0x59fccd[_0x3c4aa7(0x205)]+'/'+_0x59fccd[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x59fccd[_0x3c4aa7(0x1ea)]['name'];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1bb))+'\x20'+_0x26de66),console[_0x3c4aa7(0x1a8)]('β'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x59fccd[_0x3c4aa7(0x192)]),console['error']('β'[_0x3c4aa7(0x1f5)](0x3c));}if(_0x59a7d4[_0x3c4aa7(0x197)]>0x0)for(const _0x5d0cfb of _0x59a7d4){const _0x3d03bf=_0x5d0cfb[_0x3c4aa7(0x205)]?_0x5d0cfb[_0x3c4aa7(0x205)]+'/'+_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x3c4aa7(0x1b1))+'\x20'+_0x3d03bf),console['error']('β'['repeat'](0x3c)),_0x5d0cfb[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x5d0cfb[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3d646d=_0x26dfdc['filter'](_0x40ccfa=>!_0x40ccfa[_0x3c4aa7(0x20f)]&&_0x40ccfa[_0x3c4aa7(0x192)]);if(_0x3d646d['length']>0x0)for(const _0x5582e0 of _0x3d646d){const _0x3f1f83=_0x5582e0[_0x3c4aa7(0x205)]?_0x5582e0[_0x3c4aa7(0x205)]+'/'+_0x5582e0[_0x3c4aa7(0x1ea)]['name']:_0x5582e0[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1cc))+'\x20'+_0x3f1f83),console['error']('β'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x5582e0[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('β'['repeat'](0x3c));}if(_0x3beed2['length']>0x0)for(const _0x4f01d4 of _0x3beed2){const _0x55390f=_0x4f01d4[_0x3c4aa7(0x1f7)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x4f01d4['folderId'])||'':'',_0x124cbe=_0x55390f?_0x55390f+'/'+_0x4f01d4['journeyBundleName']:_0x4f01d4[_0x3c4aa7(0x186)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red']('Delete\x20journey:')+'\x20'+_0x124cbe),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('(Journey\x20will\x20be\x20deleted)')),console['error']('β'['repeat'](0x3c));}if(_0x179d89['dryRun'])return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x596dfa=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x4db57f[_0x3c4aa7(0x197)]>0x0||_0x290ab9['length']>0x0||_0x41f115[_0x3c4aa7(0x197)]>0x0,_0x3fbf21=_0x59a7d4[_0x3c4aa7(0x197)]>0x0||_0x4a9f7f[_0x3c4aa7(0x197)]>0x0||_0x3beed2['length']>0x0,_0xde3d5d=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x478817[_0x3c4aa7(0x197)]>0x0,_0x33ef64=_0x465414['length']>0x0;if(!_0x596dfa&&!_0x3fbf21&&!_0xde3d5d&&!_0x33ef64){const _0x4f6182=_0x179d89[_0x3c4aa7(0x1a6)]?'β\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x3c4aa7(0x1b4);console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x4f6182));if(_0x454d92&&_0x3dd41f[_0x3c4aa7(0x197)]===0x1){const _0x272ed8=_0x3dd41f[0x0];if(_0x272ed8[_0x3c4aa7(0x203)]?.['id']){const _0x376c52=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x272ed8[_0x3c4aa7(0x203)]['id']+_0x3c4aa7(0x18b));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x18c)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x376c52));}}if(_0x454d92&&_0x13e9a8['length']===0x1){const _0x3600ca=_0x13e9a8[0x0];if(_0x3600ca[_0x3c4aa7(0x1d4)]?.['id']){const _0x36a041=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],'/app/ps/'+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x3600ca['existingJourney']['id']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x36a041));}}return 0x0;}const _0x274e38=_0x179d89[_0x3c4aa7(0x1a6)]?_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3beed2[_0x3c4aa7(0x197)]+_0x465414[_0x3c4aa7(0x197)]:_0x4db57f[_0x3c4aa7(0x197)]+_0x290ab9[_0x3c4aa7(0x197)]+_0x41f115[_0x3c4aa7(0x197)]+_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f['length']+_0x3beed2['length']+_0x465414[_0x3c4aa7(0x197)]+_0x478817[_0x3c4aa7(0x197)];if(!_0x179d89['yes']&&_0x274e38>0x0){if(!isInteractive())return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red'](_0x3c4aa7(0x1b2)),_0x3c4aa7(0x18f)),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x3c4aa7(0x1d0))),0x1;const _0x4dbcf1=await confirmKey(_0x3c4aa7(0x178)+_0x274e38+'\x20changes?');if(!_0x4dbcf1)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x175))),0x1;}const _0x566d57={'withProgress':async(_0x2af465,_0x3a4d73)=>{const _0xa2ee3=_0x3c4aa7,_0x463693=await withSpinner(_0x2af465,_0x3a4d73,{'verbose':_0x179d89[_0xa2ee3(0x1be)]});return{'data':_0x463693[_0xa2ee3(0x177)]};},'logInfo':_0x138d6b=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1ca)]('β\x20'+_0x138d6b)),'logSuccess':_0xf4cf46=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green']('β\x20'+_0xf4cf46)),'logWarning':_0x378e24=>console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('β \x20'+_0x378e24)),'logDeleted':_0x189591=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('β\x20'+_0x189591))},_0x188bb5={'segment':_0xf398e[_0x3c4aa7(0x1bc)],'journey':_0xf398e['journey'],'user':_0xf398e[_0x3c4aa7(0x1ff)],'connection':_0xf398e[_0x3c4aa7(0x1dc)]};_0x465414[_0x3c4aa7(0x197)]>0x0&&(_0x54cf4a=await executePushFolders(_0x188bb5,_0x465414,_0x54cf4a,{'parentId':_0x27c4c2},_0x566d57));const _0x127846={'rootFolderId':_0x5aca44,'folderPathToId':_0x54cf4a,'folderIdToPath':_0x6b7ab2,'segmentNameToId':_0x3cc844,'activationsBySegmentId':_0x38e917,'emailToIdMap':_0x1261a0,'idToEmailMap':_0x12e592,'connectionNameToIdMap':_0x753f53[_0x3c4aa7(0x210)],'connectionIdToNameMap':_0x753f53['idToName'],'connectionNameToTypeMap':_0x5c3fbe},_0x299271=await executePushSegments(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x5048ac,_0x127846,{'parentId':_0x27c4c2},_0x566d57),_0x34ecdc=_0x299271[_0x3c4aa7(0x1a7)],_0x227240=_0x299271[_0x3c4aa7(0x1fc)],_0x30c76a=_0x299271[_0x3c4aa7(0x202)]['created'],_0x25ac52=_0x299271[_0x3c4aa7(0x202)][_0x3c4aa7(0x1fc)],_0x336ae2=_0x299271['activations'][_0x3c4aa7(0x209)];let _0x142598;if(_0x454d92&&_0x5048ac['length']===0x1){const _0x108c69=_0x5048ac[0x0];_0x142598=_0x108c69[_0x3c4aa7(0x203)]?.['id']??_0x299271[_0x3c4aa7(0x1e5)][_0x3c4aa7(0x1ac)](_0x108c69[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]);}const _0x3c32db=await executePushSegmentDeletions(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x41f115,_0x566d57);let _0x3b56eb=0x0,_0x2fb9fa=0x0,_0x5b59bb=0x0;const _0x1e9df6=new Map(_0x3cc844);for(const [_0x596406,_0x4c9901]of _0x299271[_0x3c4aa7(0x1e5)]){_0x1e9df6[_0x3c4aa7(0x1c6)](_0x596406,_0x4c9901);}if(_0x26dfdc[_0x3c4aa7(0x197)]>0x0){const _0x405402={..._0x127846,'segmentNameToId':_0x1e9df6,'existingSegments':_0x4c50b7,'activationContext':_0x369f1c},_0x5a442c=await executePushJourneys(_0x188bb5,_0x26dfdc,_0x405402,{'parentId':_0x27c4c2,'rootFolderId':_0x5aca44,'verbose':_0x179d89[_0x3c4aa7(0x1be)]},_0x566d57);_0x3b56eb=_0x5a442c[_0x3c4aa7(0x1a7)],_0x2fb9fa=_0x5a442c[_0x3c4aa7(0x1fc)];if(_0x454d92&&_0x5a442c[_0x3c4aa7(0x190)][_0x3c4aa7(0x197)]===0x1){const _0x58b955=_0x5a442c[_0x3c4aa7(0x190)][0x0];if(_0x58b955[_0x3c4aa7(0x17c)]){const _0x3b339b=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x58b955['journeyId']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['cyan'](_0x3b339b));}}}for(const _0x5501d7 of _0x3beed2){console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1b0)+_0x5501d7[_0x3c4aa7(0x186)])),_0x5b59bb++;}const _0x32d2c5=[];if(_0x34ecdc>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x34ecdc+_0x3c4aa7(0x1fa));if(_0x227240>0x0)_0x32d2c5['push'](_0x227240+_0x3c4aa7(0x1c1));if(_0x3c32db>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x3c32db+_0x3c4aa7(0x212));const _0x17af64=[];if(_0x3b56eb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x3b56eb+_0x3c4aa7(0x1fa));if(_0x2fb9fa>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x2fb9fa+_0x3c4aa7(0x1c1));if(_0x5b59bb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x5b59bb+_0x3c4aa7(0x212));const _0x1073de=[];if(_0x30c76a>0x0)_0x1073de['push'](_0x30c76a+_0x3c4aa7(0x1fa));if(_0x25ac52>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x25ac52+_0x3c4aa7(0x1c1));if(_0x336ae2>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x336ae2+_0x3c4aa7(0x212));console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green'](_0x3c4aa7(0x1f4)));_0x32d2c5[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x180)+_0x32d2c5[_0x3c4aa7(0x187)](',\x20'));_0x17af64[_0x3c4aa7(0x197)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x17af64[_0x3c4aa7(0x187)](',\x20'));_0x1073de[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19a)+_0x1073de[_0x3c4aa7(0x187)](',\x20'));if(_0x142598){const _0x34b8d2=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x142598+_0x3c4aa7(0x18b));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x34b8d2));}return 0x0;}}
|