@treasuredata/tdx 2026.3.2 β 2026.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.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/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x3f75d2=a33_0x3618;(function(_0x32ec94,_0x2e9015){const _0xaa834b=a33_0x3618,_0x4ad610=_0x32ec94();while(!![]){try{const _0x319228=-parseInt(_0xaa834b(0x9b))/0x1*(-parseInt(_0xaa834b(0xc3))/0x2)+parseInt(_0xaa834b(0xc6))/0x3+-parseInt(_0xaa834b(0xd3))/0x4*(parseInt(_0xaa834b(0xd0))/0x5)+-parseInt(_0xaa834b(0xd9))/0x6*(parseInt(_0xaa834b(0x8a))/0x7)+parseInt(_0xaa834b(0xad))/0x8+parseInt(_0xaa834b(0xea))/0x9*(-parseInt(_0xaa834b(0x7f))/0xa)+-parseInt(_0xaa834b(0x71))/0xb*(-parseInt(_0xaa834b(0xd1))/0xc);if(_0x319228===_0x2e9015)break;else _0x4ad610['push'](_0x4ad610['shift']());}catch(_0x49acc0){_0x4ad610['push'](_0x4ad610['shift']());}}}(a33_0x31ca,0x63f31));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a33_0x31ca(){const _0xdf4c76=['engine_version','Cancelled','Searching\x20scheduled\x20queries\x20matching\x20\x22','trim','database','created_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','Run\x20a\x20scheduled\x20query\x20immediately','repeat','\x20\x20Type:\x20','/app/queries/editor?queryId=','num','history','timezone','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','queries','in\x20','2UPuzZc','site','Running\x20schedule...','529038woIDVY','m\x20ago','\x20job','Updating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','status','d\x20ago','map','schedule:create','schedule:show','13345lngdwW','3494604VNRbdA','schedules','1108mhfWAJ','query','priority','No\x20scheduled\x20queries\x20found','next_run_at','Getting\x20schedule\x20details...','12foRFKq','max','user','(unnamed)','getTime','\x20\x20Job\x20ID:\x20','h\x20ago','\x20\x20β\x20','delete','scheduled_at','Getting\x20schedule\x20history...','engineVersion','json','Schedule\x20updated:\x20','utf-8','has_next_page','\x20created','9WVxALd','create','lastRun','\x20schedules','queryUrl','format','nextRun','listQueries','verbose','list','tsv','INVALID_ARGUMENT','from','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','retry_limit','user_name','Schedule\x20run\x20submitted:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','run','options','ies','statusIcon','executing_user_id','dim','delay','updated_at','33gxZJQi','show','Query\x20file\x20is\x20empty','last_job','\x20scheduled\x20quer','result','green','Creating\x20schedule:\x20','count','name','\x20\x20Cron:\x20','success','keys','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','1418380rrEgKZ','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x22...','Schedule\x20deleted:\x20','padEnd','error','end_at','ended_at','cron','Creating\x20schedule...','never','594951kEtUmW','log','Found\x20','job_id','schedule:delete','validate','toLocaleDateString','List\x20scheduled\x20queries','schedule:run','yes','π
\x20','\x20\x20Database:\x20','just\x20now','round','limit','Show\x20schedule\x20execution\x20history','Create\x20a\x20scheduled\x20query','151013AccIuT','\x20\x20Num:\x20','\x20matching\x20\x22','Failed\x20to\x20read\x20file:\x20','\x20(use\x20--limit\x20to\x20see\x20more)','Running\x20schedule:\x20','type','data','description','args','retryLimit','execute','Schedule\x20created:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','file','abs','schedule:update','Delete\x20a\x20scheduled\x20query','2076160HEHCpo','update','length','red','cyan'];a33_0x31ca=function(){return _0xdf4c76;};return a33_0x31ca();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a33_0x327c18 from'chalk';function formatRelativeTime(_0x40edd1){const _0x3a7a98=a33_0x3618,_0x45d1fe=new Date(_0x40edd1),_0x4e9f3b=new Date(),_0x1cd456=_0x45d1fe['getTime']()-_0x4e9f3b[_0x3a7a98(0xdd)](),_0x6c4cf1=Math[_0x3a7a98(0xaa)](_0x1cd456)/0x3e8,_0x12645d=_0x1cd456<0x0;if(_0x6c4cf1<0x3c)return _0x12645d?_0x3a7a98(0x96):'soon';else{if(_0x6c4cf1<0xe10){const _0x5cdfca=Math[_0x3a7a98(0x97)](_0x6c4cf1/0x3c);return _0x12645d?_0x5cdfca+_0x3a7a98(0xc7):'in\x20'+_0x5cdfca+'m';}else{if(_0x6c4cf1<0x15180){const _0x4bbbdd=Math[_0x3a7a98(0x97)](_0x6c4cf1/0xe10);return _0x12645d?_0x4bbbdd+_0x3a7a98(0xdf):_0x3a7a98(0xc2)+_0x4bbbdd+'h';}else{if(_0x6c4cf1<0x93a80){const _0x45113c=Math['round'](_0x6c4cf1/0x15180);return _0x12645d?_0x45113c+_0x3a7a98(0xcc):_0x3a7a98(0xc2)+_0x45113c+'d';}else return _0x45d1fe[_0x3a7a98(0x90)]();}}}}export class ScheduleListCommand extends BaseCommand{[a33_0x3f75d2(0x7a)]='schedule:list';['description']=a33_0x3f75d2(0x91);async[a33_0x3f75d2(0xa6)](_0x3b97c6){const _0x1abdde=a33_0x3f75d2,{options:_0x4a783c,args:_0x17b167,tdx:_0x48c42e}=_0x3b97c6,_0x10c8a3=resolveLimit(_0x4a783c[_0x1abdde(0x98)],DEFAULT_DISPLAY_LIMIT),_0x51e95a=_0x17b167[0x0],_0x274567=_0x51e95a?_0x1abdde(0xb4)+_0x51e95a+_0x1abdde(0x81):'Listing\x20scheduled\x20queries...',_0xcb7a9c=await withSpinner(_0x274567,()=>_0x48c42e[_0x1abdde(0xd2)][_0x1abdde(0xf1)]({'limit':_0x10c8a3,'scheduled':!![],'pattern':_0x51e95a}),{'verbose':_0x4a783c[_0x1abdde(0xf2)]}),_0x112579=_0xcb7a9c['data'][_0x1abdde(0xc1)],_0x31da31=_0xcb7a9c[_0x1abdde(0xa2)]['pagination'][_0x1abdde(0xe8)],_0x18285a=_0x51e95a?_0x1abdde(0x9d)+_0x51e95a+'\x22':'';_0x31da31?console[_0x1abdde(0x84)]('Showing\x20first\x20'+_0x112579[_0x1abdde(0xaf)]+_0x1abdde(0xed)+_0x18285a+_0x1abdde(0x9f)):console[_0x1abdde(0x84)](_0x1abdde(0x8c)+_0x112579[_0x1abdde(0xaf)]+_0x1abdde(0x75)+(_0x112579['length']!==0x1?_0x1abdde(0xfe):'y')+_0x18285a);if(_0x4a783c[_0x1abdde(0xef)]===_0x1abdde(0xe5)||_0x4a783c[_0x1abdde(0xef)]==='jsonl'||_0x4a783c[_0x1abdde(0xef)]==='table'||_0x4a783c[_0x1abdde(0xef)]===_0x1abdde(0xf4)){const _0x5e7c81=_0x112579[_0x1abdde(0xcd)](_0xef597e=>({'id':_0xef597e['id'],'name':_0xef597e[_0x1abdde(0x7a)],'cron':_0xef597e[_0x1abdde(0x87)],'database':_0xef597e[_0x1abdde(0xb6)]?.[_0x1abdde(0x7a)],'type':_0xef597e[_0x1abdde(0xa1)],'timezone':_0xef597e['time_zone'],'user_name':_0xef597e[_0x1abdde(0xdb)]?.['name'],'updated_at':_0xef597e[_0x1abdde(0x70)],'next_run_at':_0xef597e[_0x1abdde(0xd7)],'last_job_status':_0xef597e[_0x1abdde(0x74)]?.['status']}));await handleSDKOutput(_0x5e7c81,_0x4a783c);}else{if(_0x112579[_0x1abdde(0xaf)]===0x0)console[_0x1abdde(0x8b)](_0x1abdde(0xd6));else{const _0xd64dc3=_0x4a783c[_0x1abdde(0xc4)],_0x7c03a8=_0x112579[_0x1abdde(0xcd)](_0x51df30=>{const _0x36da69=_0x1abdde,_0x29b49e=_0x51df30[_0x36da69(0x74)]?.[_0x36da69(0xcb)]?_0x51df30['last_job'][_0x36da69(0xcb)]==='success'?'β':'β':'-',_0xb3e3c5=_0x51df30[_0x36da69(0x74)]?.[_0x36da69(0x86)]?formatRelativeTime(_0x51df30[_0x36da69(0x74)][_0x36da69(0x86)]):_0x36da69(0x89),_0x3402dd=_0x51df30[_0x36da69(0xd7)]?formatRelativeTime(_0x51df30[_0x36da69(0xd7)]):'-',_0x175fb1=_0x51df30['cron']||'',_0x322319=_0x51df30['name']||_0x36da69(0xdc),_0xe73210=getConsoleUrl(_0xd64dc3,_0x36da69(0xbc)+_0x51df30['id']);return{'statusIcon':_0x29b49e,'lastRun':_0xb3e3c5,'nextRun':_0x3402dd,'cron':_0x175fb1,'name':_0x322319,'queryUrl':_0xe73210,'status':_0x51df30['last_job']?.[_0x36da69(0xcb)]};}),_0x478421=Math[_0x1abdde(0xda)](..._0x7c03a8['map'](_0x167235=>_0x167235['lastRun'][_0x1abdde(0xaf)])),_0x292645=Math[_0x1abdde(0xda)](..._0x7c03a8[_0x1abdde(0xcd)](_0x390c88=>_0x390c88[_0x1abdde(0xf0)]['length'])),_0x480dfe=Math['max'](..._0x7c03a8[_0x1abdde(0xcd)](_0x4805be=>_0x4805be[_0x1abdde(0x87)]['length'])),_0x399e35=_0x7c03a8['map'](_0x574963=>{const _0x4ff55c=_0x1abdde,_0x52ed36=_0x574963[_0x4ff55c(0xcb)]===_0x4ff55c(0x7c)?a33_0x327c18[_0x4ff55c(0x77)](_0x574963[_0x4ff55c(0xff)]):_0x574963['status']===_0x4ff55c(0x84)?a33_0x327c18[_0x4ff55c(0xb0)](_0x574963[_0x4ff55c(0xff)]):a33_0x327c18[_0x4ff55c(0x101)](_0x574963['statusIcon']),_0x12781b=_0x574963[_0x4ff55c(0xec)][_0x4ff55c(0x83)](_0x478421),_0x52b044=_0x574963[_0x4ff55c(0xf0)]['padEnd'](_0x292645),_0x5e9c89=_0x574963[_0x4ff55c(0x87)]?a33_0x327c18[_0x4ff55c(0xb1)](_0x574963[_0x4ff55c(0x87)]['padEnd'](_0x480dfe)):'\x20'[_0x4ff55c(0xba)](_0x480dfe),_0x17d6ff=hyperlink(_0x574963[_0x4ff55c(0x7a)],_0x574963[_0x4ff55c(0xee)]);return _0x4ff55c(0x94)+_0x52ed36+'\x20'+_0x12781b+_0x4ff55c(0xe0)+_0x52b044+'\x20\x20'+_0x5e9c89+'\x20\x20'+_0x17d6ff;});await writeOutput(_0x399e35['join']('\x0a'),_0x4a783c['output'],_0x1abdde(0xf3));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a33_0x3f75d2(0xcf);[a33_0x3f75d2(0xa3)]='Show\x20schedule\x20details';[a33_0x3f75d2(0x8f)](_0x147a21){const _0x1147a4=a33_0x3f75d2,_0x22c63f=_0x147a21['args'][0x0];if(!_0x22c63f)return _0x1147a4(0xb8);return undefined;}async[a33_0x3f75d2(0xa6)](_0x37971b){const _0x4b4f94=a33_0x3f75d2,{options:_0x417ae2,args:_0x56c955,tdx:_0x38b93f}=_0x37971b,_0x439106=_0x56c955[0x0],_0x203309=await withSpinner(_0x4b4f94(0xd8),()=>_0x38b93f[_0x4b4f94(0xd2)][_0x4b4f94(0x72)](_0x439106),{'verbose':_0x417ae2['verbose']}),_0x2af931=_0x203309[_0x4b4f94(0xa2)],_0x21cab4={'name':_0x2af931[_0x4b4f94(0x7a)],'cron':_0x2af931['cron'],'database':_0x2af931[_0x4b4f94(0xb6)],'type':_0x2af931['type'],'timezone':_0x2af931[_0x4b4f94(0xbf)],'user_name':_0x2af931[_0x4b4f94(0xf9)],'created_at':_0x2af931['created_at'],'engine_version':_0x2af931[_0x4b4f94(0xb2)],'executing_user_id':_0x2af931[_0x4b4f94(0x100)],'query':_0x2af931[_0x4b4f94(0xd4)],'delay':_0x2af931[_0x4b4f94(0x102)],'priority':_0x2af931[_0x4b4f94(0xd5)],'retry_limit':_0x2af931[_0x4b4f94(0xf8)],..._0x2af931[_0x4b4f94(0x76)]&&{'result':_0x2af931[_0x4b4f94(0x76)]}};return await handleSingleObjectOutput(_0x21cab4,_0x417ae2),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a33_0x3f75d2(0x7a)]=a33_0x3f75d2(0xce);['description']=a33_0x3f75d2(0x9a);[a33_0x3f75d2(0x8f)](_0x3b97cd){const _0x3777d7=a33_0x3f75d2,_0x2a36f7=_0x3b97cd[_0x3777d7(0xa4)][0x0];if(!_0x2a36f7)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x118870=_0x3b97cd[_0x3777d7(0xfd)];if(!_0x118870[_0x3777d7(0xb6)])return _0x3777d7(0x7e);return undefined;}async[a33_0x3f75d2(0xa6)](_0x283b98){const _0x482de6=a33_0x3f75d2,{options:_0x2380ad,args:_0x4de291,tdx:_0x37109b}=_0x283b98,_0x4f6a21=_0x4de291[0x0],_0x189678=_0x2380ad,_0x14936f=_0x189678[_0x482de6(0xb6)],_0x8415f4=_0x189678[_0x482de6(0xa9)],_0x1fac9e=_0x189678[_0x482de6(0xa1)]||'trino';let _0x1f91bb;try{_0x1f91bb=readFileSync(_0x8415f4,_0x482de6(0xe7))[_0x482de6(0xb5)]();}catch(_0x4f2f42){throw new SDKError(ErrorCode[_0x482de6(0xf5)],_0x482de6(0x9e)+_0x8415f4,_0x4f2f42 instanceof Error?_0x4f2f42:undefined);}if(!_0x1f91bb)throw new SDKError(ErrorCode[_0x482de6(0xf5)],_0x482de6(0x73));const _0x2c5958={'database':_0x14936f,'query':_0x1f91bb,'type':_0x1fac9e};if(_0x189678[_0x482de6(0x87)])_0x2c5958[_0x482de6(0x87)]=_0x189678[_0x482de6(0x87)];if(_0x189678['timezone'])_0x2c5958[_0x482de6(0xbf)]=_0x189678['timezone'];if(_0x189678[_0x482de6(0x102)]!==undefined)_0x2c5958[_0x482de6(0x102)]=Number(_0x189678[_0x482de6(0x102)]);if(_0x189678[_0x482de6(0xd5)]!==undefined)_0x2c5958['priority']=Number(_0x189678[_0x482de6(0xd5)]);if(_0x189678['retryLimit']!==undefined)_0x2c5958['retry_limit']=Number(_0x189678[_0x482de6(0xa5)]);if(_0x189678[_0x482de6(0xe4)])_0x2c5958['engine_version']=_0x189678[_0x482de6(0xe4)];if(_0x189678[_0x482de6(0x76)])_0x2c5958[_0x482de6(0x76)]=_0x189678[_0x482de6(0x76)];if(_0x2380ad[_0x482de6(0xf2)]){console['error'](_0x482de6(0x78)+_0x4f6a21),console[_0x482de6(0x84)](_0x482de6(0x95)+_0x14936f),console[_0x482de6(0x84)](_0x482de6(0xbb)+_0x1fac9e);if(_0x2c5958[_0x482de6(0x87)])console[_0x482de6(0x84)](_0x482de6(0x7b)+_0x2c5958[_0x482de6(0x87)]);if(_0x2c5958[_0x482de6(0xbf)])console[_0x482de6(0x84)]('\x20\x20Timezone:\x20'+_0x2c5958['timezone']);}const _0x4eaaa1=await withSpinner(_0x482de6(0x88),()=>_0x37109b[_0x482de6(0xd2)][_0x482de6(0xeb)](_0x4f6a21,_0x2c5958),{'verbose':_0x2380ad[_0x482de6(0xf2)]});return console[_0x482de6(0x84)](_0x482de6(0xa7)+_0x4eaaa1[_0x482de6(0xa2)][_0x482de6(0x7a)]),await handleSingleObjectOutput(_0x4eaaa1['data'],_0x2380ad),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a33_0x3f75d2(0xab);[a33_0x3f75d2(0xa3)]='Update\x20a\x20scheduled\x20query';[a33_0x3f75d2(0x8f)](_0x19b8d1){const _0x4027be=a33_0x3f75d2,_0x21bcd6=_0x19b8d1['args'][0x0];if(!_0x21bcd6)return _0x4027be(0xfb);return undefined;}async[a33_0x3f75d2(0xa6)](_0xcec494){const _0x1c7624=a33_0x3f75d2,{options:_0x1a3348,args:_0x3e8ac1,tdx:_0x1e2987}=_0xcec494,_0x30f28c=_0x3e8ac1[0x0],_0xfd4ec7=_0x1a3348,_0x2a45c5={};if(_0xfd4ec7[_0x1c7624(0xb6)])_0x2a45c5['database']=_0xfd4ec7[_0x1c7624(0xb6)];if(_0xfd4ec7[_0x1c7624(0xa1)])_0x2a45c5[_0x1c7624(0xa1)]=_0xfd4ec7[_0x1c7624(0xa1)];if(_0xfd4ec7[_0x1c7624(0x87)])_0x2a45c5[_0x1c7624(0x87)]=_0xfd4ec7[_0x1c7624(0x87)];if(_0xfd4ec7[_0x1c7624(0xbf)])_0x2a45c5['timezone']=_0xfd4ec7[_0x1c7624(0xbf)];if(_0xfd4ec7[_0x1c7624(0x102)]!==undefined)_0x2a45c5[_0x1c7624(0x102)]=Number(_0xfd4ec7['delay']);if(_0xfd4ec7[_0x1c7624(0xd5)]!==undefined)_0x2a45c5[_0x1c7624(0xd5)]=Number(_0xfd4ec7[_0x1c7624(0xd5)]);if(_0xfd4ec7[_0x1c7624(0xa5)]!==undefined)_0x2a45c5[_0x1c7624(0xf8)]=Number(_0xfd4ec7[_0x1c7624(0xa5)]);if(_0xfd4ec7[_0x1c7624(0xe4)])_0x2a45c5[_0x1c7624(0xb2)]=_0xfd4ec7[_0x1c7624(0xe4)];if(_0xfd4ec7[_0x1c7624(0x76)])_0x2a45c5['result']=_0xfd4ec7['result'];if(_0xfd4ec7[_0x1c7624(0xa9)])try{_0x2a45c5[_0x1c7624(0xd4)]=readFileSync(_0xfd4ec7['file'],'utf-8')[_0x1c7624(0xb5)]();}catch(_0x7208a5){throw new SDKError(ErrorCode[_0x1c7624(0xf5)],_0x1c7624(0x9e)+_0xfd4ec7[_0x1c7624(0xa9)],_0x7208a5 instanceof Error?_0x7208a5:undefined);}if(Object[_0x1c7624(0x7d)](_0x2a45c5)[_0x1c7624(0xaf)]===0x0)throw new SDKError(ErrorCode[_0x1c7624(0xf5)],_0x1c7624(0x80));if(_0x1a3348['verbose']){console['error']('Updating\x20schedule:\x20'+_0x30f28c);for(const [_0x643235,_0x5ba0a9]of Object['entries'](_0x2a45c5)){_0x643235==='query'?console[_0x1c7624(0x84)]('\x20\x20'+_0x643235+':\x20'+_0x5ba0a9['substring'](0x0,0x32)+'...'):console[_0x1c7624(0x84)]('\x20\x20'+_0x643235+':\x20'+_0x5ba0a9);}}const _0x39c0d1=await withSpinner(_0x1c7624(0xc9),()=>_0x1e2987['schedules'][_0x1c7624(0xae)](_0x30f28c,_0x2a45c5),{'verbose':_0x1a3348[_0x1c7624(0xf2)]});return console[_0x1c7624(0x84)](_0x1c7624(0xe6)+_0x39c0d1['data']['name']),await handleSingleObjectOutput(_0x39c0d1['data'],_0x1a3348),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a33_0x3f75d2(0x7a)]=a33_0x3f75d2(0x8e);[a33_0x3f75d2(0xa3)]=a33_0x3f75d2(0xac);[a33_0x3f75d2(0x8f)](_0x527dd2){const _0x3fdd14=a33_0x3f75d2,_0x101ef5=_0x527dd2[_0x3fdd14(0xa4)][0x0];if(!_0x101ef5)return _0x3fdd14(0xa8);return undefined;}async[a33_0x3f75d2(0xa6)](_0x1ebc59){const _0xb3acc5=a33_0x3f75d2,{options:_0x9e4b85,args:_0x1d3d1c,tdx:_0x24c84a}=_0x1ebc59,_0x1f34e9=_0x1d3d1c[0x0];if(!_0x9e4b85[_0xb3acc5(0x93)]){const _0x1f498d=await confirm(_0xb3acc5(0xf7)+_0x1f34e9+'\x22?');if(!_0x1f498d)return console[_0xb3acc5(0x84)](_0xb3acc5(0xb3)),0x0;}const _0x57e0b2=await withSpinner('Deleting\x20schedule...',()=>_0x24c84a[_0xb3acc5(0xd2)][_0xb3acc5(0xe1)](_0x1f34e9),{'verbose':_0x9e4b85['verbose']});return console[_0xb3acc5(0x84)](_0xb3acc5(0x82)+_0x57e0b2[_0xb3acc5(0xa2)][_0xb3acc5(0x7a)]),0x0;}}function a33_0x3618(_0xa85dd7,_0x478229){_0xa85dd7=_0xa85dd7-0x70;const _0x31cafa=a33_0x31ca();let _0x361814=_0x31cafa[_0xa85dd7];return _0x361814;}export class ScheduleRunCommand extends BaseCommand{[a33_0x3f75d2(0x7a)]=a33_0x3f75d2(0x92);['description']=a33_0x3f75d2(0xb9);['validate'](_0x5e76f7){const _0x567673=a33_0x3f75d2,_0x1c05c3=_0x5e76f7['args'][0x0];if(!_0x1c05c3)return _0x567673(0xca);return undefined;}async[a33_0x3f75d2(0xa6)](_0x309c6f){const _0x4b519a=a33_0x3f75d2,{options:_0x5b05aa,args:_0x1f5c7b,tdx:_0x441c7c}=_0x309c6f,_0x59c153=_0x1f5c7b[0x0],_0x36828f=_0x5b05aa,_0x1d6ca2=_0x36828f['time'],_0x3bce7e=_0x36828f[_0x4b519a(0xbd)]!==undefined?Number(_0x36828f[_0x4b519a(0xbd)]):undefined;if(_0x5b05aa[_0x4b519a(0xf2)]){console['error'](_0x4b519a(0xa0)+_0x59c153);if(_0x1d6ca2)console['error']('\x20\x20Time:\x20'+_0x1d6ca2);if(_0x3bce7e)console[_0x4b519a(0x84)](_0x4b519a(0x9c)+_0x3bce7e);}const _0xa40492=await withSpinner(_0x4b519a(0xc5),()=>_0x441c7c[_0x4b519a(0xd2)][_0x4b519a(0xfc)](_0x59c153,{'time':_0x1d6ca2,'num':_0x3bce7e}),{'verbose':_0x5b05aa[_0x4b519a(0xf2)]}),_0x1fa145=_0xa40492['data']['jobs'];console[_0x4b519a(0x84)](_0x4b519a(0xfa)+_0x1fa145['length']+_0x4b519a(0xc8)+(_0x1fa145[_0x4b519a(0xaf)]!==0x1?'s':'')+_0x4b519a(0xe9));for(const _0x449d7c of _0x1fa145){console[_0x4b519a(0x84)](_0x4b519a(0xde)+_0x449d7c[_0x4b519a(0x8d)]);}return await handleSDKOutput(_0x1fa145,_0x5b05aa),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a33_0x3f75d2(0x7a)]='schedule:history';[a33_0x3f75d2(0xa3)]=a33_0x3f75d2(0x99);[a33_0x3f75d2(0x8f)](_0x2cf67e){const _0x12fa34=a33_0x3f75d2,_0x353a7f=_0x2cf67e[_0x12fa34(0xa4)][0x0];if(!_0x353a7f)return _0x12fa34(0xc0);return undefined;}async[a33_0x3f75d2(0xa6)](_0x52ff03){const _0x54c678=a33_0x3f75d2,{options:_0x5bb63e,args:_0x4bb6fd,tdx:_0x311047}=_0x52ff03,_0x413f86=_0x4bb6fd[0x0],_0x40af11=_0x5bb63e,_0x33725c=_0x40af11[_0x54c678(0xf6)]!==undefined?Number(_0x40af11[_0x54c678(0xf6)]):undefined,_0x1ffab7=_0x40af11['to']!==undefined?Number(_0x40af11['to']):undefined,_0x5ce7ce=await withSpinner(_0x54c678(0xe3),()=>_0x311047[_0x54c678(0xd2)][_0x54c678(0xbe)](_0x413f86,{'from':_0x33725c,'to':_0x1ffab7}),{'verbose':_0x5bb63e[_0x54c678(0xf2)]}),_0x45e1ac=_0x5ce7ce['data'];console[_0x54c678(0x84)](_0x54c678(0x8c)+_0x45e1ac[_0x54c678(0x79)]+'\x20execution'+(_0x45e1ac[_0x54c678(0x79)]!==0x1?'s':'')+'\x20(showing\x20'+_0x45e1ac[_0x54c678(0xf6)]+'-'+_0x45e1ac['to']+')');const _0x3757b5=_0x45e1ac['history'][_0x54c678(0xcd)](_0x5d40cc=>({'job_id':_0x5d40cc[_0x54c678(0x8d)],'type':_0x5d40cc[_0x54c678(0xa1)],'status':_0x5d40cc['status'],'scheduled_at':_0x5d40cc[_0x54c678(0xe2)],'created_at':_0x5d40cc[_0x54c678(0xb7)],'start_at':_0x5d40cc['start_at'],'end_at':_0x5d40cc[_0x54c678(0x85)]}));return await handleSDKOutput(_0x3757b5,_0x5bb63e),0x0;}}
|
|
1
|
+
const a33_0x1e4fb4=a33_0x2d54;(function(_0x1e7b7a,_0x1b1c79){const _0x47f7ca=a33_0x2d54,_0x54278d=_0x1e7b7a();while(!![]){try{const _0x52647c=parseInt(_0x47f7ca(0x113))/0x1+-parseInt(_0x47f7ca(0xf2))/0x2+-parseInt(_0x47f7ca(0x10a))/0x3*(parseInt(_0x47f7ca(0x92))/0x4)+-parseInt(_0x47f7ca(0x96))/0x5+-parseInt(_0x47f7ca(0xfa))/0x6*(parseInt(_0x47f7ca(0xd1))/0x7)+parseInt(_0x47f7ca(0xd0))/0x8+-parseInt(_0x47f7ca(0x90))/0x9*(-parseInt(_0x47f7ca(0xf8))/0xa);if(_0x52647c===_0x1b1c79)break;else _0x54278d['push'](_0x54278d['shift']());}catch(_0x36d754){_0x54278d['push'](_0x54278d['shift']());}}}(a33_0x1090,0x2bd0c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a33_0x2d54(_0xa747a5,_0x2bddd5){_0xa747a5=_0xa747a5-0x83;const _0x109077=a33_0x1090();let _0x2d543b=_0x109077[_0xa747a5];return _0x2d543b;}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';function a33_0x1090(){const _0x17a79e=['Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','cyan','delete','result','description','query','Show\x20schedule\x20details','time','Updating\x20schedule:\x20','d\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','num','\x20\x20Timezone:\x20','success','153knnEIM','Schedule\x20updated:\x20','268xYbzpT','schedule:show','keys','delay','1335620AhcyKX','Updating\x20schedule...','statusIcon','last_job','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','nextRun','user','next_run_at','schedule:update','substring','INVALID_ARGUMENT','engineVersion','args','schedules','yes','jsonl','red','Run\x20a\x20scheduled\x20query\x20immediately','validate','name','file','tsv','job_id','Schedule\x20run\x20submitted:\x20','schedule:run','\x22...','queries','\x20\x20Cron:\x20','json','cron','lastRun','Delete\x20a\x20scheduled\x20query','retryLimit','Listing\x20scheduled\x20queries...','just\x20now','\x20\x20Job\x20ID:\x20','Schedule\x20deleted:\x20','scheduled_at','No\x20scheduled\x20queries\x20found','format','Query\x20file\x20is\x20empty','Running\x20schedule:\x20','status','List\x20scheduled\x20queries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','map','execute','executing_user_id','options','schedule:list','\x20\x20Type:\x20','m\x20ago','max','create','list','\x20(showing\x20','getTime','table','1329856rTCjaz','359170sOTgUd','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','data','utf-8','/app/queries/editor?queryId=','repeat','Running\x20schedule...','Showing\x20first\x20','type','h\x20ago','trino','error','Failed\x20to\x20read\x20file:\x20','pagination','priority','round','run','schedule:history','verbose','padEnd','\x20matching\x20\x22','time_zone','ies','site','\x20created','database','limit','schedule:delete','retry_limit','Schedule\x20created:\x20','π
\x20','\x20\x20Database:\x20','soon','264494TufwAd','entries','\x20schedules','\x20\x20β\x20','length','\x20\x20Num:\x20','271270xeCQWu','in\x20','6jNyhQy','\x20\x20Time:\x20','trim','timezone','show','from','created_at','queryUrl','join','engine_version','never','\x20scheduled\x20quer','history','...','has_next_page','Getting\x20schedule\x20details...','8727pDwouF','Searching\x20scheduled\x20queries\x20matching\x20\x22','count','start_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20job','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','dim','end_at','197661YWmjcH'];a33_0x1090=function(){return _0x17a79e;};return a33_0x1090();}import{hyperlink}from'../sdk/util/formatters.js';import a33_0x2856af from'chalk';function formatRelativeTime(_0x3f2808){const _0x3fd785=a33_0x2d54,_0x3fbee5=new Date(_0x3f2808),_0x360d0d=new Date(),_0x262d08=_0x3fbee5[_0x3fd785(0xce)]()-_0x360d0d[_0x3fd785(0xce)](),_0x5dd8ec=Math['abs'](_0x262d08)/0x3e8,_0xf9c014=_0x262d08<0x0;if(_0x5dd8ec<0x3c)return _0xf9c014?_0x3fd785(0xb8):_0x3fd785(0xf1);else{if(_0x5dd8ec<0xe10){const _0x163cdc=Math[_0x3fd785(0xe0)](_0x5dd8ec/0x3c);return _0xf9c014?_0x163cdc+_0x3fd785(0xc9):_0x3fd785(0xf9)+_0x163cdc+'m';}else{if(_0x5dd8ec<0x15180){const _0x4b7f11=Math[_0x3fd785(0xe0)](_0x5dd8ec/0xe10);return _0xf9c014?_0x4b7f11+_0x3fd785(0xda):'in\x20'+_0x4b7f11+'h';}else{if(_0x5dd8ec<0x93a80){const _0xcf1a5b=Math[_0x3fd785(0xe0)](_0x5dd8ec/0x15180);return _0xf9c014?_0xcf1a5b+_0x3fd785(0x8b):_0x3fd785(0xf9)+_0xcf1a5b+'d';}else return _0x3fbee5['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0xc7);['description']=a33_0x1e4fb4(0xc1);async['execute'](_0x1489d3){const _0x1c70f0=a33_0x1e4fb4,{options:_0x5a4631,args:_0x32399c,tdx:_0x362678}=_0x1489d3,_0x22707a=resolveLimit(_0x5a4631[_0x1c70f0(0xeb)],DEFAULT_DISPLAY_LIMIT),_0x4e2b56=_0x32399c[0x0],_0x44fd0f=_0x4e2b56?_0x1c70f0(0x10b)+_0x4e2b56+_0x1c70f0(0xaf):_0x1c70f0(0xb7),_0x5309e2=await withSpinner(_0x44fd0f,()=>_0x362678['schedules']['listQueries']({'limit':_0x22707a,'scheduled':!![],'pattern':_0x4e2b56}),{'verbose':_0x5a4631['verbose']}),_0x521247=_0x5309e2[_0x1c70f0(0xd3)][_0x1c70f0(0xb0)],_0x7febe6=_0x5309e2[_0x1c70f0(0xd3)][_0x1c70f0(0xde)][_0x1c70f0(0x108)],_0x2a7500=_0x4e2b56?_0x1c70f0(0xe5)+_0x4e2b56+'\x22':'';_0x7febe6?console[_0x1c70f0(0xdc)](_0x1c70f0(0xd8)+_0x521247[_0x1c70f0(0xf6)]+_0x1c70f0(0xf4)+_0x2a7500+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x1c70f0(0xdc)]('Found\x20'+_0x521247['length']+_0x1c70f0(0x105)+(_0x521247[_0x1c70f0(0xf6)]!==0x1?_0x1c70f0(0xe7):'y')+_0x2a7500);if(_0x5a4631[_0x1c70f0(0xbd)]===_0x1c70f0(0xb2)||_0x5a4631['format']===_0x1c70f0(0xa5)||_0x5a4631[_0x1c70f0(0xbd)]===_0x1c70f0(0xcf)||_0x5a4631[_0x1c70f0(0xbd)]===_0x1c70f0(0xab)){const _0x6d4d=_0x521247['map'](_0x48b2fd=>({'id':_0x48b2fd['id'],'name':_0x48b2fd[_0x1c70f0(0xa9)],'cron':_0x48b2fd[_0x1c70f0(0xb3)],'database':_0x48b2fd[_0x1c70f0(0xea)]?.['name'],'type':_0x48b2fd[_0x1c70f0(0xd9)],'timezone':_0x48b2fd[_0x1c70f0(0xe6)],'user_name':_0x48b2fd[_0x1c70f0(0x9c)]?.[_0x1c70f0(0xa9)],'updated_at':_0x48b2fd['updated_at'],'next_run_at':_0x48b2fd[_0x1c70f0(0x9d)],'last_job_status':_0x48b2fd[_0x1c70f0(0x99)]?.[_0x1c70f0(0xc0)]}));await handleSDKOutput(_0x6d4d,_0x5a4631);}else{if(_0x521247[_0x1c70f0(0xf6)]===0x0)console['log'](_0x1c70f0(0xbc));else{const _0x35f59e=_0x5a4631[_0x1c70f0(0xe8)],_0x18f38d=_0x521247[_0x1c70f0(0xc3)](_0x2b1f5e=>{const _0x3144e3=_0x1c70f0,_0x13f62d=_0x2b1f5e[_0x3144e3(0x99)]?.[_0x3144e3(0xc0)]?_0x2b1f5e[_0x3144e3(0x99)][_0x3144e3(0xc0)]===_0x3144e3(0x8f)?'β':'β':'-',_0xe7c629=_0x2b1f5e[_0x3144e3(0x99)]?.['ended_at']?formatRelativeTime(_0x2b1f5e['last_job']['ended_at']):_0x3144e3(0x104),_0x132342=_0x2b1f5e['next_run_at']?formatRelativeTime(_0x2b1f5e[_0x3144e3(0x9d)]):'-',_0x2821ee=_0x2b1f5e[_0x3144e3(0xb3)]||'',_0x14883a=_0x2b1f5e[_0x3144e3(0xa9)]||'(unnamed)',_0x48bfdb=getConsoleUrl(_0x35f59e,_0x3144e3(0xd5)+_0x2b1f5e['id']);return{'statusIcon':_0x13f62d,'lastRun':_0xe7c629,'nextRun':_0x132342,'cron':_0x2821ee,'name':_0x14883a,'queryUrl':_0x48bfdb,'status':_0x2b1f5e[_0x3144e3(0x99)]?.[_0x3144e3(0xc0)]};}),_0x3d462d=Math[_0x1c70f0(0xca)](..._0x18f38d['map'](_0xffa075=>_0xffa075[_0x1c70f0(0xb4)][_0x1c70f0(0xf6)])),_0x35a39a=Math[_0x1c70f0(0xca)](..._0x18f38d['map'](_0x36b082=>_0x36b082[_0x1c70f0(0x9b)][_0x1c70f0(0xf6)])),_0xd957d7=Math['max'](..._0x18f38d[_0x1c70f0(0xc3)](_0x176fdc=>_0x176fdc[_0x1c70f0(0xb3)][_0x1c70f0(0xf6)])),_0xdff62=_0x18f38d[_0x1c70f0(0xc3)](_0xc06bc5=>{const _0x371f3a=_0x1c70f0,_0x4a1595=_0xc06bc5[_0x371f3a(0xc0)]===_0x371f3a(0x8f)?a33_0x2856af['green'](_0xc06bc5[_0x371f3a(0x98)]):_0xc06bc5[_0x371f3a(0xc0)]===_0x371f3a(0xdc)?a33_0x2856af[_0x371f3a(0xa6)](_0xc06bc5['statusIcon']):a33_0x2856af[_0x371f3a(0x111)](_0xc06bc5[_0x371f3a(0x98)]),_0xda57e2=_0xc06bc5[_0x371f3a(0xb4)][_0x371f3a(0xe4)](_0x3d462d),_0x1a7268=_0xc06bc5['nextRun'][_0x371f3a(0xe4)](_0x35a39a),_0x3ddfeb=_0xc06bc5['cron']?a33_0x2856af[_0x371f3a(0x83)](_0xc06bc5[_0x371f3a(0xb3)][_0x371f3a(0xe4)](_0xd957d7)):'\x20'[_0x371f3a(0xd6)](_0xd957d7),_0x2e41eb=hyperlink(_0xc06bc5[_0x371f3a(0xa9)],_0xc06bc5[_0x371f3a(0x101)]);return _0x371f3a(0xef)+_0x4a1595+'\x20'+_0xda57e2+_0x371f3a(0xf5)+_0x1a7268+'\x20\x20'+_0x3ddfeb+'\x20\x20'+_0x2e41eb;});await writeOutput(_0xdff62[_0x1c70f0(0x102)]('\x0a'),_0x5a4631['output'],_0x1c70f0(0xcc));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0x93);[a33_0x1e4fb4(0x86)]=a33_0x1e4fb4(0x88);['validate'](_0x53491a){const _0x202c93=a33_0x1e4fb4,_0x7b3698=_0x53491a[_0x202c93(0xa2)][0x0];if(!_0x7b3698)return _0x202c93(0x10e);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x31b13c){const _0x27fc3b=a33_0x1e4fb4,{options:_0x5e3b50,args:_0x2eed7c,tdx:_0x4379cf}=_0x31b13c,_0x5b181e=_0x2eed7c[0x0],_0x2b9c6=await withSpinner(_0x27fc3b(0x109),()=>_0x4379cf[_0x27fc3b(0xa3)][_0x27fc3b(0xfe)](_0x5b181e),{'verbose':_0x5e3b50['verbose']}),_0x27acc9=_0x2b9c6['data'],_0x3ce93c={'name':_0x27acc9[_0x27fc3b(0xa9)],'cron':_0x27acc9[_0x27fc3b(0xb3)],'database':_0x27acc9['database'],'type':_0x27acc9[_0x27fc3b(0xd9)],'timezone':_0x27acc9[_0x27fc3b(0xfd)],'user_name':_0x27acc9['user_name'],'created_at':_0x27acc9['created_at'],'engine_version':_0x27acc9['engine_version'],'executing_user_id':_0x27acc9[_0x27fc3b(0xc5)],'query':_0x27acc9[_0x27fc3b(0x87)],'delay':_0x27acc9[_0x27fc3b(0x95)],'priority':_0x27acc9[_0x27fc3b(0xdf)],'retry_limit':_0x27acc9[_0x27fc3b(0xed)],..._0x27acc9['result']&&{'result':_0x27acc9[_0x27fc3b(0x85)]}};return await handleSingleObjectOutput(_0x3ce93c,_0x5e3b50),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]='schedule:create';['description']='Create\x20a\x20scheduled\x20query';[a33_0x1e4fb4(0xa8)](_0x4cec8e){const _0x454cfd=a33_0x1e4fb4,_0x3789b4=_0x4cec8e[_0x454cfd(0xa2)][0x0];if(!_0x3789b4)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x11e8dd=_0x4cec8e[_0x454cfd(0xc6)];if(!_0x11e8dd[_0x454cfd(0xea)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a33_0x1e4fb4(0xc4)](_0x3318da){const _0x117c92=a33_0x1e4fb4,{options:_0x1c8e51,args:_0x4d5d1d,tdx:_0x3d34ed}=_0x3318da,_0x3bafe5=_0x4d5d1d[0x0],_0x5ac4ed=_0x1c8e51,_0x5d1a97=_0x5ac4ed[_0x117c92(0xea)],_0x57e2ef=_0x5ac4ed[_0x117c92(0xaa)],_0x7c17a0=_0x5ac4ed[_0x117c92(0xd9)]||_0x117c92(0xdb);let _0x452901;try{_0x452901=readFileSync(_0x57e2ef,'utf-8')[_0x117c92(0xfc)]();}catch(_0x2800db){throw new SDKError(ErrorCode[_0x117c92(0xa0)],_0x117c92(0xdd)+_0x57e2ef,_0x2800db instanceof Error?_0x2800db:undefined);}if(!_0x452901)throw new SDKError(ErrorCode[_0x117c92(0xa0)],_0x117c92(0xbe));const _0x1bd02b={'database':_0x5d1a97,'query':_0x452901,'type':_0x7c17a0};if(_0x5ac4ed[_0x117c92(0xb3)])_0x1bd02b[_0x117c92(0xb3)]=_0x5ac4ed[_0x117c92(0xb3)];if(_0x5ac4ed['timezone'])_0x1bd02b['timezone']=_0x5ac4ed[_0x117c92(0xfd)];if(_0x5ac4ed[_0x117c92(0x95)]!==undefined)_0x1bd02b[_0x117c92(0x95)]=Number(_0x5ac4ed['delay']);if(_0x5ac4ed[_0x117c92(0xdf)]!==undefined)_0x1bd02b[_0x117c92(0xdf)]=Number(_0x5ac4ed[_0x117c92(0xdf)]);if(_0x5ac4ed[_0x117c92(0xb6)]!==undefined)_0x1bd02b[_0x117c92(0xed)]=Number(_0x5ac4ed[_0x117c92(0xb6)]);if(_0x5ac4ed[_0x117c92(0xa1)])_0x1bd02b[_0x117c92(0x103)]=_0x5ac4ed[_0x117c92(0xa1)];if(_0x5ac4ed[_0x117c92(0x85)])_0x1bd02b[_0x117c92(0x85)]=_0x5ac4ed[_0x117c92(0x85)];if(_0x1c8e51[_0x117c92(0xe3)]){console[_0x117c92(0xdc)](_0x117c92(0x115)+_0x3bafe5),console[_0x117c92(0xdc)](_0x117c92(0xf0)+_0x5d1a97),console[_0x117c92(0xdc)](_0x117c92(0xc8)+_0x7c17a0);if(_0x1bd02b['cron'])console['error'](_0x117c92(0xb1)+_0x1bd02b['cron']);if(_0x1bd02b[_0x117c92(0xfd)])console[_0x117c92(0xdc)](_0x117c92(0x8e)+_0x1bd02b[_0x117c92(0xfd)]);}const _0x3d89cc=await withSpinner('Creating\x20schedule...',()=>_0x3d34ed[_0x117c92(0xa3)][_0x117c92(0xcb)](_0x3bafe5,_0x1bd02b),{'verbose':_0x1c8e51[_0x117c92(0xe3)]});return console['error'](_0x117c92(0xee)+_0x3d89cc[_0x117c92(0xd3)][_0x117c92(0xa9)]),await handleSingleObjectOutput(_0x3d89cc['data'],_0x1c8e51),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0x9e);['description']=a33_0x1e4fb4(0x114);[a33_0x1e4fb4(0xa8)](_0x1a834b){const _0x46127c=a33_0x1e4fb4,_0x4ef4c6=_0x1a834b[_0x46127c(0xa2)][0x0];if(!_0x4ef4c6)return _0x46127c(0x8c);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x3416f3){const _0x8cbb3a=a33_0x1e4fb4,{options:_0x252b1c,args:_0x2054e4,tdx:_0x54cd98}=_0x3416f3,_0x406eb7=_0x2054e4[0x0],_0x5d2dd3=_0x252b1c,_0x54b624={};if(_0x5d2dd3[_0x8cbb3a(0xea)])_0x54b624[_0x8cbb3a(0xea)]=_0x5d2dd3[_0x8cbb3a(0xea)];if(_0x5d2dd3[_0x8cbb3a(0xd9)])_0x54b624[_0x8cbb3a(0xd9)]=_0x5d2dd3[_0x8cbb3a(0xd9)];if(_0x5d2dd3[_0x8cbb3a(0xb3)])_0x54b624[_0x8cbb3a(0xb3)]=_0x5d2dd3[_0x8cbb3a(0xb3)];if(_0x5d2dd3[_0x8cbb3a(0xfd)])_0x54b624['timezone']=_0x5d2dd3[_0x8cbb3a(0xfd)];if(_0x5d2dd3[_0x8cbb3a(0x95)]!==undefined)_0x54b624[_0x8cbb3a(0x95)]=Number(_0x5d2dd3[_0x8cbb3a(0x95)]);if(_0x5d2dd3[_0x8cbb3a(0xdf)]!==undefined)_0x54b624[_0x8cbb3a(0xdf)]=Number(_0x5d2dd3[_0x8cbb3a(0xdf)]);if(_0x5d2dd3[_0x8cbb3a(0xb6)]!==undefined)_0x54b624[_0x8cbb3a(0xed)]=Number(_0x5d2dd3[_0x8cbb3a(0xb6)]);if(_0x5d2dd3[_0x8cbb3a(0xa1)])_0x54b624[_0x8cbb3a(0x103)]=_0x5d2dd3[_0x8cbb3a(0xa1)];if(_0x5d2dd3[_0x8cbb3a(0x85)])_0x54b624[_0x8cbb3a(0x85)]=_0x5d2dd3[_0x8cbb3a(0x85)];if(_0x5d2dd3[_0x8cbb3a(0xaa)])try{_0x54b624[_0x8cbb3a(0x87)]=readFileSync(_0x5d2dd3[_0x8cbb3a(0xaa)],_0x8cbb3a(0xd4))[_0x8cbb3a(0xfc)]();}catch(_0x18acb4){throw new SDKError(ErrorCode[_0x8cbb3a(0xa0)],'Failed\x20to\x20read\x20file:\x20'+_0x5d2dd3[_0x8cbb3a(0xaa)],_0x18acb4 instanceof Error?_0x18acb4:undefined);}if(Object[_0x8cbb3a(0x94)](_0x54b624)[_0x8cbb3a(0xf6)]===0x0)throw new SDKError(ErrorCode[_0x8cbb3a(0xa0)],_0x8cbb3a(0x9a));if(_0x252b1c['verbose']){console[_0x8cbb3a(0xdc)](_0x8cbb3a(0x8a)+_0x406eb7);for(const [_0x3982d6,_0x1a173c]of Object[_0x8cbb3a(0xf3)](_0x54b624)){_0x3982d6===_0x8cbb3a(0x87)?console['error']('\x20\x20'+_0x3982d6+':\x20'+_0x1a173c[_0x8cbb3a(0x9f)](0x0,0x32)+_0x8cbb3a(0x107)):console[_0x8cbb3a(0xdc)]('\x20\x20'+_0x3982d6+':\x20'+_0x1a173c);}}const _0x12065d=await withSpinner(_0x8cbb3a(0x97),()=>_0x54cd98[_0x8cbb3a(0xa3)]['update'](_0x406eb7,_0x54b624),{'verbose':_0x252b1c[_0x8cbb3a(0xe3)]});return console['error'](_0x8cbb3a(0x91)+_0x12065d[_0x8cbb3a(0xd3)][_0x8cbb3a(0xa9)]),await handleSingleObjectOutput(_0x12065d['data'],_0x252b1c),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a33_0x1e4fb4(0xec);[a33_0x1e4fb4(0x86)]=a33_0x1e4fb4(0xb5);[a33_0x1e4fb4(0xa8)](_0x379893){const _0x109de5=a33_0x1e4fb4,_0x8594e5=_0x379893['args'][0x0];if(!_0x8594e5)return _0x109de5(0xc2);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x509ecb){const _0x3cce61=a33_0x1e4fb4,{options:_0x3325a1,args:_0x2e31da,tdx:_0x56520a}=_0x509ecb,_0x1ec184=_0x2e31da[0x0];if(!_0x3325a1[_0x3cce61(0xa4)]){const _0x1e3fa7=await confirm(_0x3cce61(0x110)+_0x1ec184+'\x22?');if(!_0x1e3fa7)return console['error']('Cancelled'),0x0;}const _0x4a1b92=await withSpinner('Deleting\x20schedule...',()=>_0x56520a[_0x3cce61(0xa3)][_0x3cce61(0x84)](_0x1ec184),{'verbose':_0x3325a1[_0x3cce61(0xe3)]});return console[_0x3cce61(0xdc)](_0x3cce61(0xba)+_0x4a1b92[_0x3cce61(0xd3)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0xae);['description']=a33_0x1e4fb4(0xa7);['validate'](_0x49da80){const _0x2c94da=a33_0x1e4fb4,_0x168fb3=_0x49da80[_0x2c94da(0xa2)][0x0];if(!_0x168fb3)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a33_0x1e4fb4(0xc4)](_0xb963a6){const _0x46de11=a33_0x1e4fb4,{options:_0x9a00e9,args:_0x85b48e,tdx:_0x14ed82}=_0xb963a6,_0x503f0c=_0x85b48e[0x0],_0x2e36b5=_0x9a00e9,_0x582485=_0x2e36b5[_0x46de11(0x89)],_0x554d03=_0x2e36b5[_0x46de11(0x8d)]!==undefined?Number(_0x2e36b5[_0x46de11(0x8d)]):undefined;if(_0x9a00e9[_0x46de11(0xe3)]){console[_0x46de11(0xdc)](_0x46de11(0xbf)+_0x503f0c);if(_0x582485)console[_0x46de11(0xdc)](_0x46de11(0xfb)+_0x582485);if(_0x554d03)console[_0x46de11(0xdc)](_0x46de11(0xf7)+_0x554d03);}const _0xf96453=await withSpinner(_0x46de11(0xd7),()=>_0x14ed82[_0x46de11(0xa3)][_0x46de11(0xe1)](_0x503f0c,{'time':_0x582485,'num':_0x554d03}),{'verbose':_0x9a00e9['verbose']}),_0xa59b5d=_0xf96453[_0x46de11(0xd3)]['jobs'];console['error'](_0x46de11(0xad)+_0xa59b5d[_0x46de11(0xf6)]+_0x46de11(0x10f)+(_0xa59b5d[_0x46de11(0xf6)]!==0x1?'s':'')+_0x46de11(0xe9));for(const _0x4b9274 of _0xa59b5d){console[_0x46de11(0xdc)](_0x46de11(0xb9)+_0x4b9274[_0x46de11(0xac)]);}return await handleSDKOutput(_0xa59b5d,_0x9a00e9),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0xe2);[a33_0x1e4fb4(0x86)]='Show\x20schedule\x20execution\x20history';[a33_0x1e4fb4(0xa8)](_0x419cd9){const _0x4af94e=a33_0x1e4fb4,_0xb1806=_0x419cd9['args'][0x0];if(!_0xb1806)return _0x4af94e(0xd2);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x16ea9e){const _0x18b60b=a33_0x1e4fb4,{options:_0x1b568a,args:_0x80cdcd,tdx:_0x3f1b36}=_0x16ea9e,_0x303b0a=_0x80cdcd[0x0],_0x17680e=_0x1b568a,_0x383452=_0x17680e[_0x18b60b(0xff)]!==undefined?Number(_0x17680e[_0x18b60b(0xff)]):undefined,_0x133339=_0x17680e['to']!==undefined?Number(_0x17680e['to']):undefined,_0x592db0=await withSpinner('Getting\x20schedule\x20history...',()=>_0x3f1b36[_0x18b60b(0xa3)]['history'](_0x303b0a,{'from':_0x383452,'to':_0x133339}),{'verbose':_0x1b568a['verbose']}),_0x56be16=_0x592db0['data'];console[_0x18b60b(0xdc)]('Found\x20'+_0x56be16[_0x18b60b(0x10c)]+'\x20execution'+(_0x56be16['count']!==0x1?'s':'')+_0x18b60b(0xcd)+_0x56be16[_0x18b60b(0xff)]+'-'+_0x56be16['to']+')');const _0x536f8a=_0x56be16[_0x18b60b(0x106)][_0x18b60b(0xc3)](_0x469d3c=>({'job_id':_0x469d3c['job_id'],'type':_0x469d3c[_0x18b60b(0xd9)],'status':_0x469d3c[_0x18b60b(0xc0)],'scheduled_at':_0x469d3c[_0x18b60b(0xbb)],'created_at':_0x469d3c[_0x18b60b(0x100)],'start_at':_0x469d3c[_0x18b60b(0x10d)],'end_at':_0x469d3c[_0x18b60b(0x112)]}));return await handleSDKOutput(_0x536f8a,_0x1b568a),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x4ce215=a34_0x5c7a;(function(_0x5b3db5,_0x7c5514){const _0x30a209=a34_0x5c7a,_0x975b54=_0x5b3db5();while(!![]){try{const _0x1979e2=-parseInt(_0x30a209(0x130))/0x1+parseInt(_0x30a209(0x19a))/0x2+parseInt(_0x30a209(0x10a))/0x3*(-parseInt(_0x30a209(0x146))/0x4)+-parseInt(_0x30a209(0x1a1))/0x5+parseInt(_0x30a209(0x110))/0x6*(-parseInt(_0x30a209(0x15f))/0x7)+-parseInt(_0x30a209(0x129))/0x8+parseInt(_0x30a209(0x154))/0x9*(parseInt(_0x30a209(0x124))/0xa);if(_0x1979e2===_0x7c5514)break;else _0x975b54['push'](_0x975b54['shift']());}catch(_0x55497d){_0x975b54['push'](_0x975b54['shift']());}}}(a34_0x2125,0xb1349));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 a34_0x57eab9 from'chalk';async function resolveSegmentTarget(_0x341629,_0x5c7191,_0x4e35f0){const _0x560b0f=a34_0x5c7a;if(isYamlFilePath(_0x341629))try{const _0x31768b=await resolveYamlFilePath(_0x341629);return _0x4e35f0&&(console['error'](_0x560b0f(0x14b)+_0x341629),console[_0x560b0f(0x132)](_0x560b0f(0x1a6)+_0x31768b[_0x560b0f(0x189)]),console[_0x560b0f(0x132)](_0x560b0f(0x194)+_0x31768b['segmentName']),console[_0x560b0f(0x132)](_0x560b0f(0x12a)+(_0x31768b[_0x560b0f(0x19b)]||_0x560b0f(0x1ac))),console[_0x560b0f(0x132)](_0x560b0f(0x18b)+_0x31768b[_0x560b0f(0x13e)])),_0x31768b['fullPath'];}catch(_0xc071e1){throw new SDKError(ErrorCode[_0x560b0f(0x10c)],_0x560b0f(0x164)+_0xc071e1[_0x560b0f(0x161)]);}if(!_0x5c7191)throw new SDKError(ErrorCode[_0x560b0f(0x10c)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x5c7191+'/'+_0x341629;}export class SegmentDescribeCommand extends BaseCommand{[a34_0x4ce215(0x127)]='segment:describe';[a34_0x4ce215(0x11f)]=a34_0x4ce215(0x153);async[a34_0x4ce215(0x151)](_0x5889cf){const _0x3397de=a34_0x4ce215,{options:_0xfb3a47,args:_0x688c96,tdx:_0x5529b8}=_0x5889cf,_0x2dc18b=_0x688c96[0x0],_0x26e1fe=!_0x2dc18b&&!!_0xfb3a47[_0x3397de(0x189)],_0x3d3ba1=_0x2dc18b||_0xfb3a47[_0x3397de(0x189)];if(!_0x3d3ba1)return console['error'](_0x3397de(0x143)),console[_0x3397de(0x132)](_0x3397de(0x158)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x3397de(0x132)](_0x3397de(0x10f)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x3397de(0x132)](_0x3397de(0x17d)),0x1;try{const _0x1fa479=_0xfb3a47[_0x3397de(0x180)];let _0x2ff9e5=_0x3d3ba1;!_0x26e1fe&&_0x1fa479&&!_0x3d3ba1[_0x3397de(0x139)]('/')&&(_0x2ff9e5=_0x1fa479+'/'+_0x3d3ba1,_0xfb3a47[_0x3397de(0x159)]&&console[_0x3397de(0x132)](_0x3397de(0x120)+_0x2ff9e5));const _0x177e2d=await withSpinner(_0x3397de(0x125)+_0x2ff9e5+'\x27...',()=>_0x5529b8[_0x3397de(0x145)][_0x3397de(0x1ab)](_0x2ff9e5),{'verbose':_0xfb3a47[_0x3397de(0x159)]}),_0x595832=_0x177e2d['data'];_0xfb3a47['verbose']&&(console['error'](_0x3397de(0x174)+_0x595832[_0x3397de(0x14d)]),console[_0x3397de(0x132)](_0x3397de(0x18d)+_0x595832[_0x3397de(0x1b0)]),_0x595832[_0x3397de(0x18c)]&&console['error'](_0x3397de(0x118)+_0x595832[_0x3397de(0x18c)]),_0x595832[_0x3397de(0x17c)]&&console[_0x3397de(0x132)](_0x3397de(0x1ad)+_0x595832[_0x3397de(0x17c)]));if(_0x595832[_0x3397de(0x14d)]===_0x3397de(0x12e)){const _0x249e82=await withSpinner(_0x3397de(0x1a8),()=>_0x5529b8['segment']['getParent'](_0x595832[_0x3397de(0x1b0)]),{'verbose':_0xfb3a47[_0x3397de(0x159)]});await handleSingleObjectOutput(_0x249e82[_0x3397de(0x144)],_0xfb3a47);}else{if(_0x595832[_0x3397de(0x14d)]===_0x3397de(0x1b1)){if(!_0x595832['folderId'])throw new SDKError(ErrorCode[_0x3397de(0x140)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5378e7=await withSpinner(_0x3397de(0x16e),()=>_0x5529b8['segment'][_0x3397de(0x16a)](_0x595832['folderId']),{'verbose':_0xfb3a47[_0x3397de(0x159)]});await handleSingleObjectOutput(_0x5378e7[_0x3397de(0x144)],_0xfb3a47);}else{if(_0x595832[_0x3397de(0x14d)]===_0x3397de(0x145)){if(!_0x595832[_0x3397de(0x17c)])throw new SDKError(ErrorCode[_0x3397de(0x167)],_0x3397de(0x1a4));const _0x3f5c0e=await withSpinner(_0x3397de(0x162),()=>_0x5529b8[_0x3397de(0x145)][_0x3397de(0x1a2)](_0x595832['parentId'],_0x595832[_0x3397de(0x17c)]),{'verbose':_0xfb3a47[_0x3397de(0x159)]});await handleSingleObjectOutput(_0x3f5c0e[_0x3397de(0x144)],_0xfb3a47);}}}return 0x0;}catch(_0x452dd1){if(_0x452dd1 instanceof SDKError)return console['error']('Error:\x20'+_0x452dd1[_0x3397de(0x161)]),_0x452dd1[_0x3397de(0x18e)]&&console[_0x3397de(0x132)](_0x3397de(0x178)+_0x452dd1[_0x3397de(0x18e)]),0x1;throw _0x452dd1;}}}function a34_0x5c7a(_0xdd8a30,_0x1aef3e){_0xdd8a30=_0xdd8a30-0x104;const _0x21256c=a34_0x2125();let _0x5c7a29=_0x21256c[_0xdd8a30];return _0x5c7a29;}export class SegmentShowCommand extends BaseCommand{[a34_0x4ce215(0x127)]=a34_0x4ce215(0x150);['description']=a34_0x4ce215(0x10d);async['execute'](_0x2c953d){const _0x4d1a17=a34_0x4ce215,{options:_0x389841,args:_0x1a01e1,tdx:_0x2c11fc}=_0x2c953d,_0x5cc40c=_0x1a01e1[0x0];if(!_0x5cc40c)return console[_0x4d1a17(0x132)](_0x4d1a17(0x104)),console[_0x4d1a17(0x132)](_0x4d1a17(0x11a)),console[_0x4d1a17(0x132)](_0x4d1a17(0x148)),console['error'](_0x4d1a17(0x15d)),console[_0x4d1a17(0x132)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4d1a17(0x132)](_0x4d1a17(0x15c)),0x1;try{const _0x1e3557=_0x389841[_0x4d1a17(0x189)],_0x9c9588=await resolveSegmentTarget(_0x5cc40c,_0x1e3557,_0x389841[_0x4d1a17(0x159)]);_0x389841[_0x4d1a17(0x159)]&&console[_0x4d1a17(0x132)](_0x4d1a17(0x137)+_0x9c9588);const _0x6907fb=await withSpinner(_0x4d1a17(0x12f)+_0x5cc40c+_0x4d1a17(0x18a),()=>_0x2c11fc['segment']['resolvePathToResource'](_0x9c9588),{'verbose':_0x389841[_0x4d1a17(0x159)]}),_0x214b01=_0x6907fb[_0x4d1a17(0x144)];_0x389841['verbose']&&(console[_0x4d1a17(0x132)](_0x4d1a17(0x174)+_0x214b01['type']),console[_0x4d1a17(0x132)](_0x4d1a17(0x18d)+_0x214b01['parentId']));if(_0x214b01[_0x4d1a17(0x14d)]===_0x4d1a17(0x1b1))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x4d1a17(0x132)](_0x4d1a17(0x13a)),0x1;if(_0x214b01[_0x4d1a17(0x14d)]===_0x4d1a17(0x12e))return console[_0x4d1a17(0x132)](_0x4d1a17(0x183)),console['error'](_0x4d1a17(0x142)),0x1;if(!_0x214b01[_0x4d1a17(0x17c)])throw new SDKError(ErrorCode[_0x4d1a17(0x167)],_0x4d1a17(0x1a4));const _0x71544d=await withSpinner(_0x4d1a17(0x190),()=>_0x2c11fc[_0x4d1a17(0x145)][_0x4d1a17(0x168)](_0x214b01[_0x4d1a17(0x1b0)],_0x214b01[_0x4d1a17(0x17c)]),{'verbose':_0x389841[_0x4d1a17(0x159)]});let _0x562969=_0x71544d['data'];const _0x429b9e=resolveLimit(_0x389841[_0x4d1a17(0x177)],DEFAULT_DISPLAY_LIMIT),_0x42d580=/\bLIMIT\s+\d+/i[_0x4d1a17(0x19d)](_0x562969);!_0x42d580&&(_0x562969=_0x562969[_0x4d1a17(0x111)]()[_0x4d1a17(0x197)](/;+$/,''),_0x562969=_0x4d1a17(0x1af)+_0x562969+_0x4d1a17(0x181)+_0x429b9e);_0x389841[_0x4d1a17(0x159)]&&console[_0x4d1a17(0x132)](_0x4d1a17(0x184)+_0x562969);const _0x14b3f5=await withProgressSpinner(_0x4d1a17(0x176),async _0x20553b=>{const _0x14927e=_0x4d1a17,_0x44da02=await _0x2c11fc['query']['execute'](_0x562969,{'catalog':'td','schema':_0x14927e(0x169),'onJobId':_0x52bc1e=>{const _0xd075c9=_0x14927e;_0x20553b[_0xd075c9(0x155)](_0x52bc1e);}});return _0x44da02;},{'verbose':_0x389841[_0x4d1a17(0x159)]}),_0x23ce41=_0x14b3f5[_0x4d1a17(0x144)],_0x2ec505=_0x23ce41[_0x4d1a17(0x106)]?_0x4d1a17(0x105)+_0x23ce41[_0x4d1a17(0x106)]+']':'';return console[_0x4d1a17(0x132)](_0x4d1a17(0x193)+_0x23ce41[_0x4d1a17(0x195)][_0x4d1a17(0x19f)][_0x4d1a17(0x14a)]()+_0x4d1a17(0x123)+('in\x20'+formatElapsed(_0x23ce41['stats']['elapsedTimeMillis'])+_0x2ec505)),await handleQueryOutput(_0x23ce41,_0x389841),0x0;}catch(_0x1d47b6){if(_0x1d47b6 instanceof SDKError)return console[_0x4d1a17(0x132)](_0x4d1a17(0x16b)+_0x1d47b6[_0x4d1a17(0x170)]+']'),console[_0x4d1a17(0x132)]('\x0a'+_0x1d47b6['message']),0x1;throw _0x1d47b6;}}}export class SegmentFolderListCommand extends BaseCommand{[a34_0x4ce215(0x127)]=a34_0x4ce215(0x163);[a34_0x4ce215(0x11f)]=a34_0x4ce215(0x10b);async[a34_0x4ce215(0x151)](_0x3ae86f){const _0x65d3=a34_0x4ce215,{options:_0x2cda07,args:_0x50d453,tdx:_0x42632f}=_0x3ae86f;if(_0x50d453[_0x65d3(0x149)]===0x0)return console[_0x65d3(0x132)](_0x65d3(0x135)),console['error'](_0x65d3(0x136)),0x1;const _0x54bdb6=_0x50d453[0x0];try{_0x2cda07['verbose']&&(console[_0x65d3(0x132)]('Site:\x20'+_0x2cda07[_0x65d3(0x114)]),console['error'](_0x65d3(0x10e)+_0x54bdb6));const _0x4f43c3=await withSpinner(_0x65d3(0x117)+_0x54bdb6+_0x65d3(0x18a),()=>_0x42632f['segment'][_0x65d3(0x175)](_0x54bdb6),{'verbose':_0x2cda07[_0x65d3(0x159)]}),_0x40225f=_0x4f43c3['data'];_0x2cda07[_0x65d3(0x159)]&&console['error'](_0x65d3(0x126)+_0x40225f);const _0x258cb9=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x54bdb6+_0x65d3(0x18a),()=>_0x42632f[_0x65d3(0x145)][_0x65d3(0x165)](_0x40225f),{'verbose':_0x2cda07['verbose']}),_0x42358e=_0x258cb9['data'];return console[_0x65d3(0x132)](_0x65d3(0x182)+_0x42358e[_0x65d3(0x149)]+_0x65d3(0x17a)+(_0x42358e[_0x65d3(0x149)]!==0x1?'s':'')),await handleSDKOutput(_0x42358e,_0x2cda07),0x0;}catch(_0x24953c){if(_0x24953c instanceof SDKError)return console[_0x65d3(0x132)](_0x65d3(0x1a5)+_0x24953c['message']),_0x24953c[_0x65d3(0x18e)]&&console[_0x65d3(0x132)](_0x65d3(0x178)+_0x24953c['cause']),0x1;throw _0x24953c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a34_0x4ce215(0x127)]=a34_0x4ce215(0x15e);['description']=a34_0x4ce215(0x1a7);async[a34_0x4ce215(0x151)](_0x20a742){const _0x4c84f8=a34_0x4ce215,{options:_0x3c7193,args:_0x100e06,tdx:_0x367cc1}=_0x20a742;if(_0x100e06[_0x4c84f8(0x149)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x4c84f8(0x132)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x39e2d3,childId:_0x58ceb5}=parseSegmentRef(_0x100e06[0x0]);_0x3c7193[_0x4c84f8(0x159)]&&(console['error'](_0x4c84f8(0x113)+_0x3c7193[_0x4c84f8(0x114)]),console[_0x4c84f8(0x132)](_0x4c84f8(0x10e)+_0x39e2d3),_0x58ceb5&&console[_0x4c84f8(0x132)](_0x4c84f8(0x1a0)+_0x58ceb5));if(!_0x58ceb5)return console['error'](_0x4c84f8(0x141)),0x1;const _0x56eb84=await withSpinner(_0x4c84f8(0x117)+_0x39e2d3+_0x4c84f8(0x18a),()=>_0x367cc1[_0x4c84f8(0x145)][_0x4c84f8(0x175)](_0x39e2d3),{'verbose':_0x3c7193[_0x4c84f8(0x159)]}),_0x463ffb=_0x56eb84[_0x4c84f8(0x144)];_0x3c7193[_0x4c84f8(0x159)]&&console[_0x4c84f8(0x132)](_0x4c84f8(0x126)+_0x463ffb);const _0x5cb0a7=await withSpinner('Resolving\x20folder\x20\x27'+_0x58ceb5+_0x4c84f8(0x18a),()=>_0x367cc1[_0x4c84f8(0x145)][_0x4c84f8(0x179)](_0x463ffb,_0x58ceb5),{'verbose':_0x3c7193[_0x4c84f8(0x159)]}),_0x3da9a4=_0x5cb0a7[_0x4c84f8(0x144)];_0x3c7193[_0x4c84f8(0x159)]&&console[_0x4c84f8(0x132)](_0x4c84f8(0x11b)+_0x3da9a4);const _0x38ca5e=await withSpinner(_0x4c84f8(0x198)+_0x58ceb5+_0x4c84f8(0x18a),()=>_0x367cc1[_0x4c84f8(0x145)]['getFolder'](_0x3da9a4),{'verbose':_0x3c7193['verbose']});return await handleSDKOutput([_0x38ca5e['data']],_0x3c7193),0x0;}catch(_0x3e3ca2){if(_0x3e3ca2 instanceof SDKError)return console[_0x4c84f8(0x132)]('Error:\x20'+_0x3e3ca2[_0x4c84f8(0x161)]),_0x3e3ca2[_0x4c84f8(0x18e)]&&console[_0x4c84f8(0x132)]('\x20\x20Cause:\x20'+_0x3e3ca2[_0x4c84f8(0x18e)]),0x1;throw _0x3e3ca2;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a34_0x4ce215(0x119);[a34_0x4ce215(0x11f)]=a34_0x4ce215(0x1aa);async[a34_0x4ce215(0x151)](_0x58bd58){const _0x5a663f=a34_0x4ce215,{options:_0x1dab50,args:_0x3d7edd}=_0x58bd58,_0x17e007=_0x1dab50,_0x2621d6=_0x17e007[_0x5a663f(0x16f)],_0x35caf2=_0x3d7edd[0x0];if(!_0x35caf2&&!_0x2621d6)return console[_0x5a663f(0x132)](a34_0x57eab9[_0x5a663f(0x172)]('Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required')),console['error'](_0x5a663f(0x19c)),console[_0x5a663f(0x132)](_0x5a663f(0x188)),console[_0x5a663f(0x132)](_0x5a663f(0x122)),console['error'](_0x5a663f(0x15d)),console[_0x5a663f(0x132)](_0x5a663f(0x18f)),console[_0x5a663f(0x132)](_0x5a663f(0x14e)),0x1;if(_0x35caf2&&_0x2621d6)return console[_0x5a663f(0x132)](a34_0x57eab9[_0x5a663f(0x172)](_0x5a663f(0x187))),0x1;try{let _0x3e4de8;if(_0x2621d6)_0x3e4de8=await this[_0x5a663f(0x12b)](_0x2621d6,_0x58bd58);else{if(isYamlFilePath(_0x35caf2))return console[_0x5a663f(0x132)](a34_0x57eab9['red'](_0x5a663f(0x152))),console[_0x5a663f(0x132)](_0x5a663f(0x134)+_0x35caf2),0x1;else _0x3e4de8=await this[_0x5a663f(0x171)](_0x35caf2,_0x58bd58);}return _0x1dab50[_0x5a663f(0x196)]===_0x5a663f(0x156)||_0x1dab50[_0x5a663f(0x196)]===_0x5a663f(0x17b)?await handleSDKOutput([{'sql':_0x3e4de8}],_0x1dab50):console[_0x5a663f(0x17e)](_0x3e4de8),0x0;}catch(_0x58ec05){if(_0x58ec05 instanceof SDKError)return console['error'](_0x5a663f(0x1a5)+_0x58ec05['message']),_0x58ec05[_0x5a663f(0x18e)]&&console['error'](_0x5a663f(0x178)+_0x58ec05[_0x5a663f(0x18e)]),0x1;throw _0x58ec05;}}async[a34_0x4ce215(0x12b)](_0x1b2e4e,_0x19a5ed){const _0x54627c=a34_0x4ce215,{options:_0x11d57f,tdx:_0x290b1f}=_0x19a5ed;let _0x3d7553;try{_0x3d7553=await resolveYamlFilePath(_0x1b2e4e);}catch(_0x14d644){throw new SDKError(ErrorCode[_0x54627c(0x10c)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x14d644[_0x54627c(0x161)]);}_0x11d57f[_0x54627c(0x159)]&&console['error']('Resolved:\x20'+_0x3d7553[_0x54627c(0x189)]+'/'+_0x3d7553[_0x54627c(0x121)]);const _0x4c5c3b=await withSpinner(_0x54627c(0x12c),()=>_0x290b1f[_0x54627c(0x145)][_0x54627c(0x14f)](_0x3d7553[_0x54627c(0x199)],_0x3d7553[_0x54627c(0x189)],_0x3d7553['segmentName']),{'verbose':_0x11d57f[_0x54627c(0x159)]});return _0x4c5c3b[_0x54627c(0x144)];}async[a34_0x4ce215(0x171)](_0x50e731,_0x515ed0){const _0x557499=a34_0x4ce215,{options:_0x464250,tdx:_0x5bcce3}=_0x515ed0,_0xf002cb=_0x464250[_0x557499(0x189)],_0x500617=await resolveSegmentTarget(_0x50e731,_0xf002cb,_0x464250[_0x557499(0x159)]);_0x464250[_0x557499(0x159)]&&console[_0x557499(0x132)](_0x557499(0x137)+_0x500617);const _0x1fc13b=await withSpinner(_0x557499(0x12f)+_0x50e731+'\x27...',()=>_0x5bcce3[_0x557499(0x145)][_0x557499(0x1ab)](_0x500617),{'verbose':_0x464250[_0x557499(0x159)]}),_0x3ae321=_0x1fc13b['data'];_0x464250[_0x557499(0x159)]&&(console[_0x557499(0x132)](_0x557499(0x174)+_0x3ae321[_0x557499(0x14d)]),console['error'](_0x557499(0x18d)+_0x3ae321[_0x557499(0x1b0)]));if(_0x3ae321[_0x557499(0x14d)]===_0x557499(0x1b1))throw new SDKError(ErrorCode[_0x557499(0x10c)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x3ae321[_0x557499(0x14d)]==='parent')throw new SDKError(ErrorCode[_0x557499(0x10c)],_0x557499(0x133));if(!_0x3ae321[_0x557499(0x17c)])throw new SDKError(ErrorCode[_0x557499(0x167)],_0x557499(0x1a4));const _0x414979=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5bcce3[_0x557499(0x145)][_0x557499(0x168)](_0x3ae321[_0x557499(0x1b0)],_0x3ae321[_0x557499(0x17c)]),{'verbose':_0x464250[_0x557499(0x159)]});return _0x414979[_0x557499(0x144)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a34_0x4ce215(0x127)]=a34_0x4ce215(0x107);[a34_0x4ce215(0x11f)]=a34_0x4ce215(0x11e);async['execute'](_0x308d53){const _0x1c7692=a34_0x4ce215,{options:_0x44bc59,args:_0x7fb9ce,tdx:_0x4a1859}=_0x308d53,_0x46a57b=_0x44bc59;if(_0x7fb9ce[_0x1c7692(0x149)]<0x2)return console[_0x1c7692(0x132)](_0x1c7692(0x17f)),console['error'](_0x1c7692(0x1a3)),0x1;const _0x4a1733=_0x7fb9ce[0x0],_0x2b6a71=_0x7fb9ce[0x1];_0x46a57b['verbose']&&(console[_0x1c7692(0x132)]('Site:\x20'+_0x46a57b[_0x1c7692(0x114)]),console[_0x1c7692(0x132)](_0x1c7692(0x116)+_0x4a1733),console['error'](_0x1c7692(0x1a0)+_0x2b6a71));let _0x3dd2f2;if(_0x46a57b[_0x1c7692(0x13d)]){const _0x1eecaf=_0x46a57b[_0x1c7692(0x13d)],_0x5383fc=await withSpinner(_0x1c7692(0x117)+_0x4a1733+_0x1c7692(0x18a),()=>_0x4a1859['segment'][_0x1c7692(0x175)](_0x4a1733),{'verbose':_0x46a57b[_0x1c7692(0x159)]}),_0x5034a1=_0x5383fc['data'],_0x23c725=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x1eecaf+_0x1c7692(0x18a),()=>_0x4a1859['segment'][_0x1c7692(0x179)](_0x5034a1,_0x1eecaf),{'verbose':_0x46a57b[_0x1c7692(0x159)]});_0x3dd2f2=_0x23c725['data'],_0x46a57b[_0x1c7692(0x159)]&&console['error'](_0x1c7692(0x191)+_0x3dd2f2);}const _0x43a20f={'name':_0x2b6a71,'description':_0x46a57b[_0x1c7692(0x11f)],'parentFolderId':_0x3dd2f2},_0xa536f5=await withSpinner(_0x1c7692(0x131)+_0x2b6a71+_0x1c7692(0x18a),()=>_0x4a1859[_0x1c7692(0x145)][_0x1c7692(0x115)](_0x4a1733,_0x43a20f),{'verbose':_0x46a57b[_0x1c7692(0x159)]}),_0x3bc1d6=_0xa536f5[_0x1c7692(0x144)];return console[_0x1c7692(0x132)]('β\x20Created\x20folder\x20\x27'+_0x3bc1d6[_0x1c7692(0x127)]+_0x1c7692(0x160)+_0x3bc1d6['id']),await handleSDKOutput([_0x3bc1d6],_0x46a57b),0x0;}}export class SegmentViewCommand extends BaseCommand{[a34_0x4ce215(0x127)]=a34_0x4ce215(0x15a);[a34_0x4ce215(0x11f)]=a34_0x4ce215(0x11c);async[a34_0x4ce215(0x151)](_0x47141b){const _0x3233e2=a34_0x4ce215,{options:_0x5eee37,args:_0x5906f4,tdx:_0x6a902a}=_0x47141b,_0x487b35=_0x5906f4[0x0];if(!_0x487b35)return console[_0x3233e2(0x132)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3233e2(0x132)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x3233e2(0x132)](_0x3233e2(0x192)),console[_0x3233e2(0x132)](_0x3233e2(0x11d)),console[_0x3233e2(0x132)](_0x3233e2(0x138)),console[_0x3233e2(0x132)]('Examples:'),console['error'](_0x3233e2(0x1a9)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x3233e2(0x132)](_0x3233e2(0x186)),console['error'](_0x3233e2(0x185)),0x1;try{const _0x1e7905=_0x5eee37['parentSegment'],_0x1923fc=await resolveSegmentTarget(_0x487b35,_0x1e7905,_0x5eee37[_0x3233e2(0x159)]);_0x5eee37[_0x3233e2(0x159)]&&console[_0x3233e2(0x132)](_0x3233e2(0x137)+_0x1923fc);const _0xab22bc=await withSpinner(_0x3233e2(0x12f)+_0x487b35+_0x3233e2(0x18a),()=>_0x6a902a[_0x3233e2(0x145)][_0x3233e2(0x1ab)](_0x1923fc),{'verbose':_0x5eee37['verbose']}),_0x11c721=_0xab22bc['data'];_0x5eee37[_0x3233e2(0x159)]&&(console[_0x3233e2(0x132)]('Resolved\x20type:\x20'+_0x11c721[_0x3233e2(0x14d)]),console['error'](_0x3233e2(0x18d)+_0x11c721[_0x3233e2(0x1b0)]),_0x11c721[_0x3233e2(0x18c)]&&console[_0x3233e2(0x132)](_0x3233e2(0x118)+_0x11c721[_0x3233e2(0x18c)]),_0x11c721['segmentId']&&console[_0x3233e2(0x132)](_0x3233e2(0x1ad)+_0x11c721[_0x3233e2(0x17c)]));if(_0x5eee37['web']){if(_0x11c721[_0x3233e2(0x14d)]===_0x3233e2(0x1b1))return console['error'](_0x3233e2(0x112)),0x1;if(_0x11c721[_0x3233e2(0x14d)]===_0x3233e2(0x12e))return console['error'](_0x3233e2(0x13b)),console['error'](_0x3233e2(0x13f)),0x1;if(!_0x11c721[_0x3233e2(0x17c)])throw new SDKError(ErrorCode[_0x3233e2(0x167)],_0x3233e2(0x1a4));const _0x1e8fda=getConsoleNextUrl(_0x5eee37['site'],'/app/ps/'+_0x11c721[_0x3233e2(0x1b0)]+_0x3233e2(0x109)+_0x11c721[_0x3233e2(0x17c)]);return console[_0x3233e2(0x132)](a34_0x57eab9[_0x3233e2(0x12d)]('β')+'\x20Opening\x20'+a34_0x57eab9[_0x3233e2(0x166)](_0x1e8fda)),openBrowser(_0x1e8fda),0x0;}if(_0x11c721[_0x3233e2(0x14d)]==='folder'){if(!_0x11c721[_0x3233e2(0x18c)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x3233e2(0x157));const _0xf5e4c3=await withSpinner('Fetching\x20folder\x20details...',()=>_0x6a902a[_0x3233e2(0x145)]['getFolder'](_0x11c721[_0x3233e2(0x18c)]),{'verbose':_0x5eee37[_0x3233e2(0x159)]});await handleSingleObjectOutput(_0xf5e4c3[_0x3233e2(0x144)],_0x5eee37);}else{if(_0x11c721[_0x3233e2(0x14d)]===_0x3233e2(0x145)){if(!_0x11c721['segmentId'])throw new SDKError(ErrorCode[_0x3233e2(0x167)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5c990d=await withSpinner(_0x3233e2(0x162),()=>_0x6a902a[_0x3233e2(0x145)]['getSegment'](_0x11c721['parentId'],_0x11c721['segmentId']),{'verbose':_0x5eee37[_0x3233e2(0x159)]}),_0xa53638=getConsoleNextUrl(_0x5eee37[_0x3233e2(0x114)],'/app/ps/'+_0x11c721[_0x3233e2(0x1b0)]+_0x3233e2(0x109)+_0x11c721[_0x3233e2(0x17c)]),_0xd8c585=_0x5c990d['data'];_0xd8c585[_0x3233e2(0x108)]=_0xa53638,await handleSingleObjectOutput(_0xd8c585,_0x5eee37);}else return console['error'](_0x3233e2(0x15b)),console['error'](_0x3233e2(0x128)),0x1;}return 0x0;}catch(_0x149315){if(_0x149315 instanceof SDKError)return console['error'](_0x3233e2(0x1a5)+_0x149315[_0x3233e2(0x161)]),_0x149315[_0x3233e2(0x18e)]&&console[_0x3233e2(0x132)](_0x3233e2(0x178)+_0x149315[_0x3233e2(0x18e)]),0x1;throw _0x149315;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a34_0x4ce215(0x147);['description']=a34_0x4ce215(0x13c);async[a34_0x4ce215(0x151)](_0x5d4290){const _0x567666=a34_0x4ce215,{options:_0x462f6e,args:_0x1fa74c,tdx:_0x44aa82}=_0x5d4290,_0x402fe2=_0x1fa74c[0x0];if(!_0x402fe2)return console[_0x567666(0x132)](_0x567666(0x104)),console[_0x567666(0x132)](_0x567666(0x1ae)),console[_0x567666(0x132)](_0x567666(0x14c)),console[_0x567666(0x132)](_0x567666(0x15d)),console[_0x567666(0x132)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x567666(0x132)](_0x567666(0x16c)),0x1;try{const _0x308679=_0x462f6e[_0x567666(0x189)],_0x5f1700=await resolveSegmentTarget(_0x402fe2,_0x308679,_0x462f6e[_0x567666(0x159)]);_0x462f6e[_0x567666(0x159)]&&console[_0x567666(0x132)]('Target\x20path:\x20'+_0x5f1700);const _0x173d2e=await withSpinner(_0x567666(0x12f)+_0x402fe2+_0x567666(0x18a),()=>_0x44aa82[_0x567666(0x145)][_0x567666(0x1ab)](_0x5f1700),{'verbose':_0x462f6e[_0x567666(0x159)]}),_0x4fa82b=_0x173d2e[_0x567666(0x144)];_0x462f6e[_0x567666(0x159)]&&(console['error']('Resolved\x20type:\x20'+_0x4fa82b['type']),console[_0x567666(0x132)](_0x567666(0x18d)+_0x4fa82b[_0x567666(0x1b0)]));if(_0x4fa82b['type']===_0x567666(0x1b1))return console[_0x567666(0x132)](_0x567666(0x173)),console[_0x567666(0x132)](_0x567666(0x1b2)),0x1;if(_0x4fa82b[_0x567666(0x14d)]==='parent')return console[_0x567666(0x132)](_0x567666(0x16d)),console[_0x567666(0x132)](_0x567666(0x19e)),0x1;if(!_0x4fa82b[_0x567666(0x17c)])throw new SDKError(ErrorCode[_0x567666(0x167)],_0x567666(0x1a4));const _0x2050bc=await withSpinner(_0x567666(0x190),()=>_0x44aa82[_0x567666(0x145)]['getSegmentSQL'](_0x4fa82b[_0x567666(0x1b0)],_0x4fa82b[_0x567666(0x17c)]),{'verbose':_0x462f6e['verbose']}),_0x194113=_0x2050bc['data'],_0x20b89b=await executeSchemaQuery(_0x194113,_0x44aa82,_0x462f6e);return await handleQueryOutput(_0x20b89b,_0x462f6e),0x0;}catch(_0x2eb5b4){if(_0x2eb5b4 instanceof SDKError)return console['error']('Error:\x20'+_0x2eb5b4['message']),_0x2eb5b4[_0x567666(0x18e)]&&console[_0x567666(0x132)](_0x567666(0x178)+_0x2eb5b4[_0x567666(0x18e)]),0x1;throw _0x2eb5b4;}}}function a34_0x2125(){const _0x5638b7=['Target\x20path:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','includes','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Show\x20child\x20segment\x20schema\x20(column\x20types)','parentFolder','fullPath','Use:\x20tdx\x20ps\x20view\x20-w','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Use:\x20tdx\x20ps\x20show','Error:\x20Path\x20or\x20name\x20is\x20required','data','segment','988pkioPq','segment:desc','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','length','toLocaleString','Resolved\x20YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','type','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','getSegmentSQLFromYaml','segment:show','execute','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Show\x20segment\x20or\x20folder\x20details','4132296zrKGZy','setJobId','json','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20describe\x20<path>','verbose','segment:view','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Examples:','segment:folder:show','7xOeeUB','\x27\x20with\x20ID:\x20','message','Fetching\x20segment\x20details...','segment:folder:list','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','listFolders','cyan','SEGMENT_NOT_FOUND','getSegmentSQL','information_schema','getFolder','β\x20Query\x20failed\x20[','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20folder\x20details...','path','code','getSQLFromServerSegment','red','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20type:\x20','resolveParentId','Executing\x20segment\x20query...','limit','\x20\x20Cause:\x20','resolveFolderId','\x20folder','jsonl','segmentId','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','log','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','segmentPath','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','β\x20Found\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','parentSegment','\x27...','\x20\x20Full\x20path:\x20','folderId','Parent\x20ID:\x20','cause','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Fetching\x20SQL\x20for\x20segment...','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','β\x20Query\x20completed:\x20Processed\x20','\x20\x20Segment\x20name:\x20','stats','format','replace','Fetching\x20folder\x20\x27','content','663238lQqCmX','folderPath','Usage:','test','Use:\x20tdx\x20ps\x20desc','processedRows','Folder\x20name:\x20','4049360cKrjZA','getSegment','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20','\x20\x20Parent\x20segment:\x20','Show\x20segment\x20folder\x20details','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','resolvePathToResource','(root)','Segment\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','SELECT\x20*\x20FROM\x20(\x0a','parentId','folder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20[Job\x20ID:\x20','jobId','segment:folder:create','url','/e/','16449PHNxOt','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','INVALID_ARGUMENT','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Parent\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','5470266skncdl','trim','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Site:\x20','site','createFolder','Parent\x20segment:\x20','Resolving\x20parent\x20segment\x20\x27','Folder\x20ID:\x20','segment:sql','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolved\x20folder\x20ID:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','Options:','Create\x20segment\x20folder\x20for\x20organization','description','Resolved\x20relative\x20path\x20to:\x20','segmentName','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20rows\x20','100eVYCAk','Resolving\x20path\x20\x27','Resolved\x20parent\x20ID:\x20','name','Use:\x20tdx\x20ps\x20view','3199088BjijeN','\x20\x20Folder\x20path:\x20','getSQLFromYamlFile','Fetching\x20SQL\x20from\x20rule...','green','parent','Resolving\x20\x27','721456cTLFBL','Creating\x20folder\x20\x27','error','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'];a34_0x2125=function(){return _0x5638b7;};return a34_0x2125();}
|
|
1
|
+
const a34_0xbe1e3b=a34_0x4609;(function(_0xee30f3,_0x2b05d4){const _0x43fc13=a34_0x4609,_0x32689b=_0xee30f3();while(!![]){try{const _0x21ff55=-parseInt(_0x43fc13(0x130))/0x1*(-parseInt(_0x43fc13(0x1a5))/0x2)+-parseInt(_0x43fc13(0x174))/0x3+-parseInt(_0x43fc13(0x1b8))/0x4*(-parseInt(_0x43fc13(0x1c7))/0x5)+parseInt(_0x43fc13(0x12a))/0x6+-parseInt(_0x43fc13(0x120))/0x7+-parseInt(_0x43fc13(0x188))/0x8*(-parseInt(_0x43fc13(0x17e))/0x9)+parseInt(_0x43fc13(0x12f))/0xa*(-parseInt(_0x43fc13(0x15e))/0xb);if(_0x21ff55===_0x2b05d4)break;else _0x32689b['push'](_0x32689b['shift']());}catch(_0x2fc2d9){_0x32689b['push'](_0x32689b['shift']());}}}(a34_0x4208,0x2eace));function a34_0x4609(_0x10c7ca,_0x38cab8){_0x10c7ca=_0x10c7ca-0x120;const _0x420882=a34_0x4208();let _0x4609e4=_0x420882[_0x10c7ca];return _0x4609e4;}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 a34_0x42cb39 from'chalk';async function resolveSegmentTarget(_0x3d7f0f,_0x2f9509,_0x189a72){const _0x4b891f=a34_0x4609;if(isYamlFilePath(_0x3d7f0f))try{const _0x59546a=await resolveYamlFilePath(_0x3d7f0f);return _0x189a72&&(console[_0x4b891f(0x143)](_0x4b891f(0x139)+_0x3d7f0f),console[_0x4b891f(0x143)](_0x4b891f(0x12b)+_0x59546a[_0x4b891f(0x198)]),console[_0x4b891f(0x143)](_0x4b891f(0x1bc)+_0x59546a[_0x4b891f(0x181)]),console[_0x4b891f(0x143)](_0x4b891f(0x1c6)+(_0x59546a['folderPath']||_0x4b891f(0x15a))),console[_0x4b891f(0x143)](_0x4b891f(0x16e)+_0x59546a[_0x4b891f(0x142)])),_0x59546a[_0x4b891f(0x142)];}catch(_0x552e5c){throw new SDKError(ErrorCode[_0x4b891f(0x17a)],_0x4b891f(0x169)+_0x552e5c[_0x4b891f(0x129)]);}if(!_0x2f9509)throw new SDKError(ErrorCode[_0x4b891f(0x17a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x2f9509+'/'+_0x3d7f0f;}export class SegmentDescribeCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]='segment:describe';[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x1be);async[a34_0xbe1e3b(0x164)](_0x4fdada){const _0x2fb724=a34_0xbe1e3b,{options:_0x31e220,args:_0x55148e,tdx:_0x4acb9f}=_0x4fdada,_0x42148a=_0x55148e[0x0],_0x4b8a41=!_0x42148a&&!!_0x31e220[_0x2fb724(0x198)],_0x4ae643=_0x42148a||_0x31e220[_0x2fb724(0x198)];if(!_0x4ae643)return console[_0x2fb724(0x143)](_0x2fb724(0x145)),console[_0x2fb724(0x143)](_0x2fb724(0x123)),console[_0x2fb724(0x143)](_0x2fb724(0x156)),console['error'](_0x2fb724(0x13d)),console[_0x2fb724(0x143)](_0x2fb724(0x1a6)),console[_0x2fb724(0x143)](_0x2fb724(0x14a)),console[_0x2fb724(0x143)](_0x2fb724(0x191)),0x1;try{const _0x35de48=_0x31e220[_0x2fb724(0x146)];let _0x587155=_0x4ae643;!_0x4b8a41&&_0x35de48&&!_0x4ae643[_0x2fb724(0x1ad)]('/')&&(_0x587155=_0x35de48+'/'+_0x4ae643,_0x31e220[_0x2fb724(0x190)]&&console[_0x2fb724(0x143)](_0x2fb724(0x14e)+_0x587155));const _0x2d6d39=await withSpinner(_0x2fb724(0x167)+_0x587155+_0x2fb724(0x137),()=>_0x4acb9f[_0x2fb724(0x1b9)]['resolvePathToResource'](_0x587155),{'verbose':_0x31e220[_0x2fb724(0x190)]}),_0x1b7f13=_0x2d6d39['data'];_0x31e220[_0x2fb724(0x190)]&&(console[_0x2fb724(0x143)](_0x2fb724(0x1ab)+_0x1b7f13[_0x2fb724(0x18d)]),console[_0x2fb724(0x143)]('Parent\x20ID:\x20'+_0x1b7f13[_0x2fb724(0x1bb)]),_0x1b7f13[_0x2fb724(0x17d)]&&console[_0x2fb724(0x143)](_0x2fb724(0x19f)+_0x1b7f13['folderId']),_0x1b7f13[_0x2fb724(0x1b3)]&&console[_0x2fb724(0x143)](_0x2fb724(0x141)+_0x1b7f13[_0x2fb724(0x1b3)]));if(_0x1b7f13['type']===_0x2fb724(0x13a)){const _0x29562d=await withSpinner(_0x2fb724(0x134),()=>_0x4acb9f[_0x2fb724(0x1b9)]['getParent'](_0x1b7f13['parentId']),{'verbose':_0x31e220[_0x2fb724(0x190)]});await handleSingleObjectOutput(_0x29562d[_0x2fb724(0x14b)],_0x31e220);}else{if(_0x1b7f13[_0x2fb724(0x18d)]===_0x2fb724(0x122)){if(!_0x1b7f13[_0x2fb724(0x17d)])throw new SDKError(ErrorCode[_0x2fb724(0x147)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5b56af=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4acb9f[_0x2fb724(0x1b9)][_0x2fb724(0x1c5)](_0x1b7f13[_0x2fb724(0x17d)]),{'verbose':_0x31e220[_0x2fb724(0x190)]});await handleSingleObjectOutput(_0x5b56af[_0x2fb724(0x14b)],_0x31e220);}else{if(_0x1b7f13[_0x2fb724(0x18d)]==='segment'){if(!_0x1b7f13[_0x2fb724(0x1b3)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2fb724(0x183));const _0x2be9b4=await withSpinner(_0x2fb724(0x16c),()=>_0x4acb9f['segment'][_0x2fb724(0x160)](_0x1b7f13[_0x2fb724(0x1bb)],_0x1b7f13[_0x2fb724(0x1b3)]),{'verbose':_0x31e220['verbose']});await handleSingleObjectOutput(_0x2be9b4[_0x2fb724(0x14b)],_0x31e220);}}}return 0x0;}catch(_0x570e45){if(_0x570e45 instanceof SDKError)return console[_0x2fb724(0x143)](_0x2fb724(0x182)+_0x570e45[_0x2fb724(0x129)]),_0x570e45[_0x2fb724(0x1a2)]&&console['error']('\x20\x20Cause:\x20'+_0x570e45[_0x2fb724(0x1a2)]),0x1;throw _0x570e45;}}}export class SegmentShowCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x133);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x184);async[a34_0xbe1e3b(0x164)](_0x4956e6){const _0xc05393=a34_0xbe1e3b,{options:_0xf89c74,args:_0x1acd19,tdx:_0x4ffb67}=_0x4956e6,_0x33c59d=_0x1acd19[0x0];if(!_0x33c59d)return console['error'](_0xc05393(0x149)),console[_0xc05393(0x143)](_0xc05393(0x17b)),console[_0xc05393(0x143)](_0xc05393(0x1c2)),console['error'](_0xc05393(0x156)),console[_0xc05393(0x143)](_0xc05393(0x1b4)),console[_0xc05393(0x143)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2b3205=_0xf89c74[_0xc05393(0x198)],_0x25eb13=await resolveSegmentTarget(_0x33c59d,_0x2b3205,_0xf89c74['verbose']);_0xf89c74[_0xc05393(0x190)]&&console[_0xc05393(0x143)](_0xc05393(0x163)+_0x25eb13);const _0xb010e8=await withSpinner('Resolving\x20\x27'+_0x33c59d+_0xc05393(0x137),()=>_0x4ffb67[_0xc05393(0x1b9)][_0xc05393(0x16a)](_0x25eb13),{'verbose':_0xf89c74[_0xc05393(0x190)]}),_0x2c4d14=_0xb010e8['data'];_0xf89c74['verbose']&&(console[_0xc05393(0x143)]('Resolved\x20type:\x20'+_0x2c4d14[_0xc05393(0x18d)]),console['error'](_0xc05393(0x173)+_0x2c4d14[_0xc05393(0x1bb)]));if(_0x2c4d14[_0xc05393(0x18d)]===_0xc05393(0x122))return console[_0xc05393(0x143)](_0xc05393(0x12e)),console[_0xc05393(0x143)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x2c4d14[_0xc05393(0x18d)]==='parent')return console[_0xc05393(0x143)](_0xc05393(0x1af)),console[_0xc05393(0x143)](_0xc05393(0x1bf)),0x1;if(!_0x2c4d14[_0xc05393(0x1b3)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xc05393(0x183));const _0x4d5d84=await withSpinner(_0xc05393(0x192),()=>_0x4ffb67[_0xc05393(0x1b9)][_0xc05393(0x186)](_0x2c4d14[_0xc05393(0x1bb)],_0x2c4d14[_0xc05393(0x1b3)]),{'verbose':_0xf89c74['verbose']});let _0xe092c5=_0x4d5d84['data'];const _0x472972=resolveLimit(_0xf89c74[_0xc05393(0x1b1)],DEFAULT_DISPLAY_LIMIT),_0x34287f=/\bLIMIT\s+\d+/i[_0xc05393(0x1bd)](_0xe092c5);!_0x34287f&&(_0xe092c5=_0xe092c5[_0xc05393(0x1c8)]()[_0xc05393(0x179)](/;+$/,''),_0xe092c5=_0xc05393(0x127)+_0xe092c5+_0xc05393(0x166)+_0x472972);_0xf89c74[_0xc05393(0x190)]&&console[_0xc05393(0x143)](_0xc05393(0x18a)+_0xe092c5);const _0x4f48d7=await withProgressSpinner(_0xc05393(0x1b2),async _0x7ff6de=>{const _0x3a92e2=_0xc05393,_0x134fea=await _0x4ffb67['query']['execute'](_0xe092c5,{'catalog':'td','schema':_0x3a92e2(0x19c),'onJobId':_0x388ef6=>{const _0x532179=_0x3a92e2;_0x7ff6de[_0x532179(0x1a7)](_0x388ef6);}});return _0x134fea;},{'verbose':_0xf89c74[_0xc05393(0x190)]}),_0x72cd07=_0x4f48d7['data'],_0x22856f=_0x72cd07[_0xc05393(0x161)]?_0xc05393(0x13b)+_0x72cd07[_0xc05393(0x161)]+']':'';return console[_0xc05393(0x143)](_0xc05393(0x1ae)+_0x72cd07['stats'][_0xc05393(0x131)][_0xc05393(0x13f)]()+'\x20rows\x20'+(_0xc05393(0x124)+formatElapsed(_0x72cd07[_0xc05393(0x157)][_0xc05393(0x125)])+_0x22856f)),await handleQueryOutput(_0x72cd07,_0xf89c74),0x0;}catch(_0x1fbe04){if(_0x1fbe04 instanceof SDKError)return console[_0xc05393(0x143)](_0xc05393(0x159)+_0x1fbe04['code']+']'),console[_0xc05393(0x143)]('\x0a'+_0x1fbe04[_0xc05393(0x129)]),0x1;throw _0x1fbe04;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a34_0xbe1e3b(0x14c);['description']=a34_0xbe1e3b(0x151);async['execute'](_0x216733){const _0x3cd380=a34_0xbe1e3b,{options:_0x5210b1,args:_0x4a579a,tdx:_0x39aac1}=_0x216733;if(_0x4a579a['length']===0x0)return console[_0x3cd380(0x143)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3cd380(0x143)](_0x3cd380(0x15c)),0x1;const _0x3435c6=_0x4a579a[0x0];try{_0x5210b1[_0x3cd380(0x190)]&&(console[_0x3cd380(0x143)](_0x3cd380(0x1c3)+_0x5210b1[_0x3cd380(0x18b)]),console['error'](_0x3cd380(0x1a3)+_0x3435c6));const _0x1e15b5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3435c6+_0x3cd380(0x137),()=>_0x39aac1[_0x3cd380(0x1b9)][_0x3cd380(0x19a)](_0x3435c6),{'verbose':_0x5210b1[_0x3cd380(0x190)]}),_0x226876=_0x1e15b5[_0x3cd380(0x14b)];_0x5210b1[_0x3cd380(0x190)]&&console[_0x3cd380(0x143)](_0x3cd380(0x196)+_0x226876);const _0x3024bb=await withSpinner(_0x3cd380(0x1a8)+_0x3435c6+_0x3cd380(0x137),()=>_0x39aac1['segment']['listFolders'](_0x226876),{'verbose':_0x5210b1['verbose']}),_0x245c8d=_0x3024bb[_0x3cd380(0x14b)];return console[_0x3cd380(0x143)]('β\x20Found\x20'+_0x245c8d[_0x3cd380(0x180)]+_0x3cd380(0x176)+(_0x245c8d[_0x3cd380(0x180)]!==0x1?'s':'')),await handleSDKOutput(_0x245c8d,_0x5210b1),0x0;}catch(_0x32037c){if(_0x32037c instanceof SDKError)return console[_0x3cd380(0x143)]('Error:\x20'+_0x32037c[_0x3cd380(0x129)]),_0x32037c[_0x3cd380(0x1a2)]&&console[_0x3cd380(0x143)]('\x20\x20Cause:\x20'+_0x32037c[_0x3cd380(0x1a2)]),0x1;throw _0x32037c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x19e);['description']=a34_0xbe1e3b(0x175);async[a34_0xbe1e3b(0x164)](_0x46354b){const _0x1eeb8e=a34_0xbe1e3b,{options:_0x1b4ef3,args:_0x3b44e0,tdx:_0x50c202}=_0x46354b;if(_0x3b44e0[_0x1eeb8e(0x180)]===0x0)return console[_0x1eeb8e(0x143)](_0x1eeb8e(0x121)),console[_0x1eeb8e(0x143)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x38019a,childId:_0x22804e}=parseSegmentRef(_0x3b44e0[0x0]);_0x1b4ef3[_0x1eeb8e(0x190)]&&(console[_0x1eeb8e(0x143)](_0x1eeb8e(0x1c3)+_0x1b4ef3[_0x1eeb8e(0x18b)]),console[_0x1eeb8e(0x143)](_0x1eeb8e(0x1a3)+_0x38019a),_0x22804e&&console['error'](_0x1eeb8e(0x1c0)+_0x22804e));if(!_0x22804e)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x30df91=await withSpinner(_0x1eeb8e(0x1c9)+_0x38019a+_0x1eeb8e(0x137),()=>_0x50c202[_0x1eeb8e(0x1b9)]['resolveParentId'](_0x38019a),{'verbose':_0x1b4ef3['verbose']}),_0x56abb3=_0x30df91[_0x1eeb8e(0x14b)];_0x1b4ef3[_0x1eeb8e(0x190)]&&console[_0x1eeb8e(0x143)](_0x1eeb8e(0x196)+_0x56abb3);const _0x43c14c=await withSpinner(_0x1eeb8e(0x15f)+_0x22804e+_0x1eeb8e(0x137),()=>_0x50c202['segment']['resolveFolderId'](_0x56abb3,_0x22804e),{'verbose':_0x1b4ef3[_0x1eeb8e(0x190)]}),_0x5d3c8e=_0x43c14c[_0x1eeb8e(0x14b)];_0x1b4ef3[_0x1eeb8e(0x190)]&&console[_0x1eeb8e(0x143)](_0x1eeb8e(0x135)+_0x5d3c8e);const _0x455f83=await withSpinner(_0x1eeb8e(0x16f)+_0x22804e+_0x1eeb8e(0x137),()=>_0x50c202[_0x1eeb8e(0x1b9)]['getFolder'](_0x5d3c8e),{'verbose':_0x1b4ef3[_0x1eeb8e(0x190)]});return await handleSDKOutput([_0x455f83['data']],_0x1b4ef3),0x0;}catch(_0x545aeb){if(_0x545aeb instanceof SDKError)return console['error'](_0x1eeb8e(0x182)+_0x545aeb['message']),_0x545aeb['cause']&&console[_0x1eeb8e(0x143)]('\x20\x20Cause:\x20'+_0x545aeb[_0x1eeb8e(0x1a2)]),0x1;throw _0x545aeb;}}}export class SegmentSQLCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x14d);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x18f);async[a34_0xbe1e3b(0x164)](_0x3988b){const _0x2af5c6=a34_0xbe1e3b,{options:_0x542695,args:_0x154ed0}=_0x3988b,_0x3c1ebf=_0x542695,_0x12494f=_0x3c1ebf[_0x2af5c6(0x1a4)],_0x43857e=_0x154ed0[0x0];if(!_0x43857e&&!_0x12494f)return console[_0x2af5c6(0x143)](a34_0x42cb39['red']('Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required')),console[_0x2af5c6(0x143)](_0x2af5c6(0x154)),console[_0x2af5c6(0x143)](_0x2af5c6(0x1aa)),console[_0x2af5c6(0x143)](_0x2af5c6(0x1a9)),console[_0x2af5c6(0x143)](_0x2af5c6(0x156)),console['error'](_0x2af5c6(0x136)),console[_0x2af5c6(0x143)](_0x2af5c6(0x1b7)),0x1;if(_0x43857e&&_0x12494f)return console[_0x2af5c6(0x143)](a34_0x42cb39[_0x2af5c6(0x18c)](_0x2af5c6(0x197))),0x1;try{let _0x315afc;if(_0x12494f)_0x315afc=await this['getSQLFromYamlFile'](_0x12494f,_0x3988b);else{if(isYamlFilePath(_0x43857e))return console[_0x2af5c6(0x143)](a34_0x42cb39[_0x2af5c6(0x18c)](_0x2af5c6(0x15d))),console[_0x2af5c6(0x143)](_0x2af5c6(0x19d)+_0x43857e),0x1;else _0x315afc=await this[_0x2af5c6(0x171)](_0x43857e,_0x3988b);}return _0x542695['format']===_0x2af5c6(0x1a1)||_0x542695[_0x2af5c6(0x13c)]===_0x2af5c6(0x185)?await handleSDKOutput([{'sql':_0x315afc}],_0x542695):console[_0x2af5c6(0x199)](_0x315afc),0x0;}catch(_0xac9f05){if(_0xac9f05 instanceof SDKError)return console['error'](_0x2af5c6(0x182)+_0xac9f05[_0x2af5c6(0x129)]),_0xac9f05[_0x2af5c6(0x1a2)]&&console[_0x2af5c6(0x143)](_0x2af5c6(0x128)+_0xac9f05[_0x2af5c6(0x1a2)]),0x1;throw _0xac9f05;}}async['getSQLFromYamlFile'](_0x36f457,_0x202af7){const _0x510ac1=a34_0xbe1e3b,{options:_0xff8bb4,tdx:_0x2ef656}=_0x202af7;let _0x24ef6;try{_0x24ef6=await resolveYamlFilePath(_0x36f457);}catch(_0x2d366c){throw new SDKError(ErrorCode[_0x510ac1(0x17a)],_0x510ac1(0x169)+_0x2d366c[_0x510ac1(0x129)]);}_0xff8bb4['verbose']&&console['error'](_0x510ac1(0x140)+_0x24ef6[_0x510ac1(0x198)]+'/'+_0x24ef6[_0x510ac1(0x181)]);const _0x1899fd=await withSpinner(_0x510ac1(0x194),()=>_0x2ef656[_0x510ac1(0x1b9)]['getSegmentSQLFromYaml'](_0x24ef6['content'],_0x24ef6['parentSegment'],_0x24ef6[_0x510ac1(0x181)]),{'verbose':_0xff8bb4[_0x510ac1(0x190)]});return _0x1899fd['data'];}async[a34_0xbe1e3b(0x171)](_0xb00ab4,_0x15e8c0){const _0x427626=a34_0xbe1e3b,{options:_0x4ee9e2,tdx:_0x41d3cc}=_0x15e8c0,_0x572d64=_0x4ee9e2[_0x427626(0x198)],_0x1d10e4=await resolveSegmentTarget(_0xb00ab4,_0x572d64,_0x4ee9e2['verbose']);_0x4ee9e2['verbose']&&console['error'](_0x427626(0x163)+_0x1d10e4);const _0xc39522=await withSpinner('Resolving\x20\x27'+_0xb00ab4+_0x427626(0x137),()=>_0x41d3cc[_0x427626(0x1b9)]['resolvePathToResource'](_0x1d10e4),{'verbose':_0x4ee9e2[_0x427626(0x190)]}),_0x134c70=_0xc39522[_0x427626(0x14b)];_0x4ee9e2[_0x427626(0x190)]&&(console[_0x427626(0x143)](_0x427626(0x1ab)+_0x134c70[_0x427626(0x18d)]),console[_0x427626(0x143)]('Parent\x20ID:\x20'+_0x134c70[_0x427626(0x1bb)]));if(_0x134c70[_0x427626(0x18d)]===_0x427626(0x122))throw new SDKError(ErrorCode[_0x427626(0x17a)],_0x427626(0x193));if(_0x134c70[_0x427626(0x18d)]==='parent')throw new SDKError(ErrorCode[_0x427626(0x17a)],_0x427626(0x189));if(!_0x134c70[_0x427626(0x1b3)])throw new SDKError(ErrorCode[_0x427626(0x1a0)],_0x427626(0x183));const _0x12cefd=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x41d3cc[_0x427626(0x1b9)][_0x427626(0x186)](_0x134c70[_0x427626(0x1bb)],_0x134c70[_0x427626(0x1b3)]),{'verbose':_0x4ee9e2[_0x427626(0x190)]});return _0x12cefd[_0x427626(0x14b)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x177);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x168);async[a34_0xbe1e3b(0x164)](_0x3111ea){const _0xf99b78=a34_0xbe1e3b,{options:_0x23cd39,args:_0x19dbb3,tdx:_0x414246}=_0x3111ea,_0x3461a9=_0x23cd39;if(_0x19dbb3[_0xf99b78(0x180)]<0x2)return console[_0xf99b78(0x143)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0xf99b78(0x1b6)),0x1;const _0x216178=_0x19dbb3[0x0],_0x6ca20a=_0x19dbb3[0x1];_0x3461a9[_0xf99b78(0x190)]&&(console[_0xf99b78(0x143)](_0xf99b78(0x1c3)+_0x3461a9['site']),console[_0xf99b78(0x143)](_0xf99b78(0x1ca)+_0x216178),console[_0xf99b78(0x143)](_0xf99b78(0x1c0)+_0x6ca20a));let _0x4d42a4;if(_0x3461a9[_0xf99b78(0x14f)]){const _0x3c14b2=_0x3461a9['parentFolder'],_0x5bb4ef=await withSpinner(_0xf99b78(0x1c9)+_0x216178+_0xf99b78(0x137),()=>_0x414246[_0xf99b78(0x1b9)][_0xf99b78(0x19a)](_0x216178),{'verbose':_0x3461a9[_0xf99b78(0x190)]}),_0x5c8823=_0x5bb4ef[_0xf99b78(0x14b)],_0x1751b1=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3c14b2+'\x27...',()=>_0x414246['segment'][_0xf99b78(0x1c4)](_0x5c8823,_0x3c14b2),{'verbose':_0x3461a9['verbose']});_0x4d42a4=_0x1751b1[_0xf99b78(0x14b)],_0x3461a9['verbose']&&console[_0xf99b78(0x143)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4d42a4);}const _0x9aec04={'name':_0x6ca20a,'description':_0x3461a9[_0xf99b78(0x1b5)],'parentFolderId':_0x4d42a4},_0x5a256f=await withSpinner(_0xf99b78(0x158)+_0x6ca20a+_0xf99b78(0x137),()=>_0x414246[_0xf99b78(0x1b9)][_0xf99b78(0x172)](_0x216178,_0x9aec04),{'verbose':_0x3461a9['verbose']}),_0x4f9ef6=_0x5a256f['data'];return console['error']('β\x20Created\x20folder\x20\x27'+_0x4f9ef6[_0xf99b78(0x16d)]+_0xf99b78(0x153)+_0x4f9ef6['id']),await handleSDKOutput([_0x4f9ef6],_0x3461a9),0x0;}}export class SegmentViewCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x148);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x165);async[a34_0xbe1e3b(0x164)](_0x17d954){const _0x42311b=a34_0xbe1e3b,{options:_0xad6d8b,args:_0x30ccde,tdx:_0x1ba089}=_0x17d954,_0x3241dc=_0x30ccde[0x0];if(!_0x3241dc)return console[_0x42311b(0x143)](_0x42311b(0x195)),console[_0x42311b(0x143)](_0x42311b(0x155)),console[_0x42311b(0x143)](_0x42311b(0x170)),console['error'](_0x42311b(0x152)),console[_0x42311b(0x143)](_0x42311b(0x1b0)),console[_0x42311b(0x143)]('Examples:'),console[_0x42311b(0x143)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x42311b(0x143)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x42311b(0x143)](_0x42311b(0x16b)),console[_0x42311b(0x143)](_0x42311b(0x132)),0x1;try{const _0x4984f1=_0xad6d8b[_0x42311b(0x198)],_0x17fe96=await resolveSegmentTarget(_0x3241dc,_0x4984f1,_0xad6d8b['verbose']);_0xad6d8b[_0x42311b(0x190)]&&console[_0x42311b(0x143)](_0x42311b(0x163)+_0x17fe96);const _0x189858=await withSpinner(_0x42311b(0x144)+_0x3241dc+_0x42311b(0x137),()=>_0x1ba089[_0x42311b(0x1b9)][_0x42311b(0x16a)](_0x17fe96),{'verbose':_0xad6d8b[_0x42311b(0x190)]}),_0x2ebde7=_0x189858[_0x42311b(0x14b)];_0xad6d8b[_0x42311b(0x190)]&&(console[_0x42311b(0x143)](_0x42311b(0x1ab)+_0x2ebde7[_0x42311b(0x18d)]),console[_0x42311b(0x143)]('Parent\x20ID:\x20'+_0x2ebde7['parentId']),_0x2ebde7['folderId']&&console[_0x42311b(0x143)]('Folder\x20ID:\x20'+_0x2ebde7[_0x42311b(0x17d)]),_0x2ebde7['segmentId']&&console[_0x42311b(0x143)](_0x42311b(0x141)+_0x2ebde7['segmentId']));if(_0xad6d8b[_0x42311b(0x13e)]){if(_0x2ebde7[_0x42311b(0x18d)]==='folder')return console[_0x42311b(0x143)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x2ebde7[_0x42311b(0x18d)]===_0x42311b(0x13a))return console['error'](_0x42311b(0x12c)),console[_0x42311b(0x143)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2ebde7['segmentId'])throw new SDKError(ErrorCode[_0x42311b(0x1a0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2a4da3=getConsoleNextUrl(_0xad6d8b[_0x42311b(0x18b)],'/app/ps/'+_0x2ebde7[_0x42311b(0x1bb)]+_0x42311b(0x138)+_0x2ebde7[_0x42311b(0x1b3)]);return console[_0x42311b(0x143)](a34_0x42cb39[_0x42311b(0x18e)]('β')+'\x20Opening\x20'+a34_0x42cb39['cyan'](_0x2a4da3)),openBrowser(_0x2a4da3),0x0;}if(_0x2ebde7['type']===_0x42311b(0x122)){if(!_0x2ebde7[_0x42311b(0x17d)])throw new SDKError(ErrorCode[_0x42311b(0x147)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4716da=await withSpinner(_0x42311b(0x1ac),()=>_0x1ba089[_0x42311b(0x1b9)][_0x42311b(0x1c5)](_0x2ebde7['folderId']),{'verbose':_0xad6d8b[_0x42311b(0x190)]});await handleSingleObjectOutput(_0x4716da['data'],_0xad6d8b);}else{if(_0x2ebde7['type']==='segment'){if(!_0x2ebde7[_0x42311b(0x1b3)])throw new SDKError(ErrorCode[_0x42311b(0x1a0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2894fa=await withSpinner(_0x42311b(0x16c),()=>_0x1ba089['segment']['getSegment'](_0x2ebde7[_0x42311b(0x1bb)],_0x2ebde7[_0x42311b(0x1b3)]),{'verbose':_0xad6d8b['verbose']}),_0x2fb812=getConsoleNextUrl(_0xad6d8b[_0x42311b(0x18b)],_0x42311b(0x126)+_0x2ebde7['parentId']+_0x42311b(0x138)+_0x2ebde7['segmentId']),_0x2ea0ba=_0x2894fa[_0x42311b(0x14b)];_0x2ea0ba['url']=_0x2fb812,await handleSingleObjectOutput(_0x2ea0ba,_0xad6d8b);}else return console['error'](_0x42311b(0x1c1)),console['error'](_0x42311b(0x12d)),0x1;}return 0x0;}catch(_0xcaa15f){if(_0xcaa15f instanceof SDKError)return console['error'](_0x42311b(0x182)+_0xcaa15f['message']),_0xcaa15f[_0x42311b(0x1a2)]&&console[_0x42311b(0x143)](_0x42311b(0x128)+_0xcaa15f[_0x42311b(0x1a2)]),0x1;throw _0xcaa15f;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x150);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x17c);async[a34_0xbe1e3b(0x164)](_0x221bcc){const _0x292ea9=a34_0xbe1e3b,{options:_0x35c888,args:_0xf93324,tdx:_0x2db580}=_0x221bcc,_0x47c77c=_0xf93324[0x0];if(!_0x47c77c)return console[_0x292ea9(0x143)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x292ea9(0x143)](_0x292ea9(0x178)),console[_0x292ea9(0x143)](_0x292ea9(0x1ba)),console['error']('Examples:'),console[_0x292ea9(0x143)](_0x292ea9(0x162)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x49d361=_0x35c888[_0x292ea9(0x198)],_0x3675ec=await resolveSegmentTarget(_0x47c77c,_0x49d361,_0x35c888['verbose']);_0x35c888[_0x292ea9(0x190)]&&console[_0x292ea9(0x143)]('Target\x20path:\x20'+_0x3675ec);const _0xe91174=await withSpinner('Resolving\x20\x27'+_0x47c77c+_0x292ea9(0x137),()=>_0x2db580[_0x292ea9(0x1b9)][_0x292ea9(0x16a)](_0x3675ec),{'verbose':_0x35c888[_0x292ea9(0x190)]}),_0x41f7bc=_0xe91174[_0x292ea9(0x14b)];_0x35c888[_0x292ea9(0x190)]&&(console[_0x292ea9(0x143)](_0x292ea9(0x1ab)+_0x41f7bc[_0x292ea9(0x18d)]),console[_0x292ea9(0x143)]('Parent\x20ID:\x20'+_0x41f7bc['parentId']));if(_0x41f7bc[_0x292ea9(0x18d)]===_0x292ea9(0x122))return console[_0x292ea9(0x143)](_0x292ea9(0x15b)),console[_0x292ea9(0x143)](_0x292ea9(0x187)),0x1;if(_0x41f7bc[_0x292ea9(0x18d)]===_0x292ea9(0x13a))return console[_0x292ea9(0x143)](_0x292ea9(0x19b)),console[_0x292ea9(0x143)](_0x292ea9(0x17f)),0x1;if(!_0x41f7bc[_0x292ea9(0x1b3)])throw new SDKError(ErrorCode[_0x292ea9(0x1a0)],_0x292ea9(0x183));const _0x39f0a4=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2db580['segment'][_0x292ea9(0x186)](_0x41f7bc[_0x292ea9(0x1bb)],_0x41f7bc[_0x292ea9(0x1b3)]),{'verbose':_0x35c888[_0x292ea9(0x190)]}),_0x157df6=_0x39f0a4[_0x292ea9(0x14b)],_0x51153d=await executeSchemaQuery(_0x157df6,_0x2db580,_0x35c888);return await handleQueryOutput(_0x51153d,_0x35c888),0x0;}catch(_0x35a269){if(_0x35a269 instanceof SDKError)return console['error'](_0x292ea9(0x182)+_0x35a269[_0x292ea9(0x129)]),_0x35a269[_0x292ea9(0x1a2)]&&console[_0x292ea9(0x143)](_0x292ea9(0x128)+_0x35a269['cause']),0x1;throw _0x35a269;}}}function a34_0x4208(){const _0x4f567e=['115359njtMqX','Show\x20segment\x20folder\x20details','\x20folder','segment:folder:create','Usage:\x20tdx\x20sg\x20desc\x20<name>','replace','INVALID_ARGUMENT','Usage:\x20tdx\x20sg\x20show\x20<name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','folderId','828081fXdzqh','Use:\x20tdx\x20ps\x20desc','length','segmentName','Error:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','jsonl','getSegmentSQL','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','24CxyNOl','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','SQL\x20query:\x0a','site','red','type','green','Get\x20SQL\x20query\x20for\x20child\x20segment','verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Fetching\x20SQL\x20for\x20segment...','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20SQL\x20from\x20rule...','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Resolved\x20parent\x20ID:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','parentSegment','log','resolveParentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','\x20\x20tdx\x20sg\x20sql\x20--path\x20','segment:folder:show','Folder\x20ID:\x20','SEGMENT_NOT_FOUND','json','cause','Parent\x20name:\x20','path','62ercuAJ','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','setJobId','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Resolved\x20type:\x20','Fetching\x20folder\x20details...','includes','β\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','limit','Executing\x20segment\x20query...','segmentId','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','description','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','4XCwIIn','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','parentId','\x20\x20Segment\x20name:\x20','test','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20show','Folder\x20name:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Site:\x20','resolveFolderId','getFolder','\x20\x20Folder\x20path:\x20','398765zkQjnk','trim','Resolving\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','1964690JgRQgm','Error:\x20Folder\x20reference\x20is\x20required','folder','Usage:\x20tdx\x20segment\x20describe\x20<path>','in\x20','elapsedTimeMillis','/app/ps/','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20Cause:\x20','message','727536PVbmHC','\x20\x20Parent\x20segment:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','140PPjuFi','4673YHmtBf','processedRows','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','segment:show','Fetching\x20parent\x20segment\x20details...','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x27...','/e/','Resolved\x20YAML\x20file:\x20','parent','\x20[Job\x20ID:\x20','format','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','web','toLocaleString','Resolved:\x20','Segment\x20ID:\x20','fullPath','error','Resolving\x20\x27','Error:\x20Path\x20or\x20name\x20is\x20required','segmentPath','SEGMENT_FOLDER_NOT_FOUND','segment:view','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','data','segment:folder:list','segment:sql','Resolved\x20relative\x20path\x20to:\x20','parentFolder','segment:desc','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Options:','\x27\x20with\x20ID:\x20','Usage:','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Examples:','stats','Creating\x20folder\x20\x27','β\x20Query\x20failed\x20[','(root)','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','87681nNysTI','Resolving\x20folder\x20\x27','getSegment','jobId','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Target\x20path:\x20','execute','Show\x20folder\x20or\x20child\x20segment\x20details','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20path\x20\x27','Create\x20segment\x20folder\x20for\x20organization','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','resolvePathToResource','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Fetching\x20segment\x20details...','name','\x20\x20Full\x20path:\x20','Fetching\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','getSQLFromServerSegment','createFolder','Parent\x20ID:\x20'];a34_0x4208=function(){return _0x4f567e;};return a34_0x4208();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a35_0xb737(_0x1b2cf0,_0x251e1a){_0x1b2cf0=_0x1b2cf0-0x105;const _0x117626=a35_0x1176();let _0xb737d1=_0x117626[_0x1b2cf0];return _0xb737d1;}const a35_0x4ead0e=a35_0xb737;(function(_0x27ff3e,_0x2df1f2){const _0x513ebc=a35_0xb737,_0x939920=_0x27ff3e();while(!![]){try{const _0x29d213=-parseInt(_0x513ebc(0x138))/0x1+-parseInt(_0x513ebc(0x135))/0x2*(parseInt(_0x513ebc(0x108))/0x3)+-parseInt(_0x513ebc(0x136))/0x4*(-parseInt(_0x513ebc(0x112))/0x5)+-parseInt(_0x513ebc(0x127))/0x6+-parseInt(_0x513ebc(0x12a))/0x7+parseInt(_0x513ebc(0x10c))/0x8*(parseInt(_0x513ebc(0x11f))/0x9)+parseInt(_0x513ebc(0x139))/0xa*(parseInt(_0x513ebc(0x128))/0xb);if(_0x29d213===_0x2df1f2)break;else _0x939920['push'](_0x939920['shift']());}catch(_0x203081){_0x939920['push'](_0x939920['shift']());}}}(a35_0x1176,0xd2aad));function a35_0x1176(){const _0x412b92=['β\x20Created\x20segment\x20\x27','Creating\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Site:\x20','kind','2015hYqvyZ','Resolved\x20folder\x20ID:\x20','description','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','invisible','Examples:','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','error','Resolving\x20parent\x20segment\x20\x27','includes','type','6165DTYhYN','ruleFile','Target\x20path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','noCountPopulation','execute','folder','resolveFolderId','10070736NboMKm','17478593RVpMbE','Resolved\x20relative\x20path\x20to:\x20','274946xSfivc','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolveParentId','Create\x20child\x20segment\x20with\x20filtering\x20rules','data','Resolving\x20folder\x20\x27','name','createSegment','segment','length','\x27...','127444GQQZGN','6004yvbILu','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','210633otisTV','20AogdKO','yellow','Parent:\x20','resolvePathToResource','66DseCGi','parent','\x27\x20with\x20ID:\x20','segments','4792hBoFIL'];a35_0x1176=function(){return _0x412b92;};return a35_0x1176();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a35_0xeaae53 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a35_0x4ead0e(0x130)]='segment:create';[a35_0x4ead0e(0x114)]=a35_0x4ead0e(0x12d);async[a35_0x4ead0e(0x124)](_0x3f03fe){const _0x21d828=a35_0x4ead0e;console[_0x21d828(0x11b)](a35_0xeaae53[_0x21d828(0x105)]('β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a35_0xeaae53[_0x21d828(0x105)](_0x21d828(0x137)));const {options:_0x1d6752,args:_0xbbb13b,tdx:_0x1024dc}=_0x3f03fe,_0x644c1=_0x1d6752;if(_0xbbb13b['length']===0x0)return console['error'](_0x21d828(0x116)),console['error'](_0x21d828(0x119)),console[_0x21d828(0x11b)](_0x21d828(0x118)),console[_0x21d828(0x11b)](_0x21d828(0x11a)),console['error'](_0x21d828(0x12b)),console[_0x21d828(0x11b)](_0x21d828(0x10f)),0x1;const _0x4ff80a=_0xbbb13b[0x0],_0xd3d63a=_0x1d6752['segmentPath'];let _0x21e781=_0x4ff80a;_0xd3d63a&&!_0x4ff80a[_0x21d828(0x11d)]('/')&&(_0x21e781=_0xd3d63a+'/'+_0x4ff80a,_0x644c1[_0x21d828(0x115)]&&console['error'](_0x21d828(0x129)+_0x21e781));const _0x4458fa=parsePath(_0x21e781);if(_0x4458fa[_0x21d828(0x10b)][_0x21d828(0x133)]<0x2)return console[_0x21d828(0x11b)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x21d828(0x11b)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x22de55=_0x4458fa[_0x21d828(0x10b)][0x0],_0x2818fe=getBaseName(_0x21e781),_0xa00f99=getParentPath(_0x21e781);_0x644c1['verbose']&&(console[_0x21d828(0x11b)](_0x21d828(0x110)+_0x644c1['site']),console[_0x21d828(0x11b)](_0x21d828(0x121)+_0x21e781),console[_0x21d828(0x11b)](_0x21d828(0x106)+_0x22de55),console[_0x21d828(0x11b)]('Segment\x20name:\x20'+_0x2818fe),console[_0x21d828(0x11b)]('Parent\x20path:\x20'+_0xa00f99));const _0x4f9c9b=await withSpinner(_0x21d828(0x11c)+_0x22de55+_0x21d828(0x134),()=>_0x1024dc[_0x21d828(0x132)][_0x21d828(0x12c)](_0x22de55),{'verbose':_0x644c1['verbose']}),_0x5b2343=_0x4f9c9b[_0x21d828(0x12e)];let _0x558209;if(_0x4458fa['segments'][_0x21d828(0x133)]>0x2){const _0x3b5ec4=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0xa00f99+_0x21d828(0x134),()=>_0x1024dc['segment'][_0x21d828(0x107)](_0xa00f99),{'verbose':_0x644c1['verbose']}),_0x2b1622=_0x3b5ec4['data'];if(_0x2b1622['type']!==_0x21d828(0x125)&&_0x2b1622[_0x21d828(0x11e)]!==_0x21d828(0x109))return console[_0x21d828(0x11b)](_0x21d828(0x122)),0x1;_0x558209=_0x2b1622['folderId'];}else{if(_0x644c1['folder']){const _0x245347=await withSpinner(_0x21d828(0x12f)+_0x644c1['folder']+'\x27...',()=>_0x1024dc['segment'][_0x21d828(0x126)](_0x5b2343,_0x644c1['folder']),{'verbose':_0x644c1[_0x21d828(0x115)]});_0x558209=_0x245347['data'];}}_0x644c1[_0x21d828(0x115)]&&_0x558209&&console[_0x21d828(0x11b)](_0x21d828(0x113)+_0x558209);const _0x18d77c=await loadJSONFromOptions(_0x644c1['rule'],_0x644c1[_0x21d828(0x120)]),_0x50e5ba={'name':_0x2818fe,'description':_0x644c1[_0x21d828(0x114)],'rule':_0x18d77c,'kind':_0x644c1['kind']!==undefined?parseInt(_0x644c1[_0x21d828(0x111)],0xa):undefined,'isVisible':_0x644c1[_0x21d828(0x117)]?![]:undefined,'segmentFolderId':_0x558209,'countPopulation':_0x644c1[_0x21d828(0x123)]?![]:undefined},_0x44f2bb=await withSpinner(_0x21d828(0x10e)+_0x2818fe+_0x21d828(0x134),()=>_0x1024dc[_0x21d828(0x132)][_0x21d828(0x131)](_0x5b2343,_0x50e5ba),{'verbose':_0x644c1[_0x21d828(0x115)]}),_0x3ebe25=_0x44f2bb[_0x21d828(0x12e)];return console[_0x21d828(0x11b)](_0x21d828(0x10d)+_0x3ebe25['name']+_0x21d828(0x10a)+_0x3ebe25['id']),_0x21e781!==_0x4ff80a&&console[_0x21d828(0x11b)]('\x20\x20\x20Path:\x20'+_0x21e781),await handleSDKOutput([_0x3ebe25],_0x644c1),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a36_0x57e2(_0x392715,_0x2d4ed3){_0x392715=_0x392715-0x1cb;const _0x3691e6=a36_0x3691();let _0x57e20f=_0x3691e6[_0x392715];return _0x57e20f;}const a36_0x5dfaee=a36_0x57e2;(function(_0x4b5ec1,_0x509e96){const _0x13fdc3=a36_0x57e2,_0x147ae0=_0x4b5ec1();while(!![]){try{const _0x3c5419=-parseInt(_0x13fdc3(0x1dd))/0x1+parseInt(_0x13fdc3(0x1db))/0x2+-parseInt(_0x13fdc3(0x1e4))/0x3*(-parseInt(_0x13fdc3(0x1ce))/0x4)+parseInt(_0x13fdc3(0x1d5))/0x5+-parseInt(_0x13fdc3(0x1dc))/0x6+parseInt(_0x13fdc3(0x1d8))/0x7*(parseInt(_0x13fdc3(0x1e2))/0x8)+parseInt(_0x13fdc3(0x1da))/0x9;if(_0x3c5419===_0x509e96)break;else _0x147ae0['push'](_0x147ae0['shift']());}catch(_0x1c395c){_0x147ae0['push'](_0x147ae0['shift']());}}}(a36_0x3691,0xa41ba));function a36_0x3691(){const _0x55a1b1=['site','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','jsonl','46848zsRDov','\x27...','name','Parent\x20segment:\x20','description','length','data','6637975cAGXwi','β\x20Found\x20','Site:\x20','7XvvIPE','verbose','2026620eDIVLo','1341550WRYRmC','3638316szInPN','1235229XiYjbi','error','parentSegment','listFields','execute','822872ZuRJoW','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','48axLmlb','json','\x20field'];a36_0x3691=function(){return _0x55a1b1;};return a36_0x3691();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a36_0x5dfaee(0x1d0)]='segment:fields';[a36_0x5dfaee(0x1d2)]='List\x20available\x20fields\x20for\x20segmentation';async[a36_0x5dfaee(0x1e1)](_0x1dd9de){const _0x3423a6=a36_0x5dfaee,{options:_0x1d989a,args:_0x19b503,tdx:_0xd043ca}=_0x1dd9de,_0xe58bf8=_0x19b503[0x0]||_0x1d989a[_0x3423a6(0x1df)];if(!_0xe58bf8)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3423a6(0x1de)](_0x3423a6(0x1cc)),console[_0x3423a6(0x1de)](_0x3423a6(0x1e3)),0x1;_0x1d989a[_0x3423a6(0x1d9)]&&(console[_0x3423a6(0x1de)](_0x3423a6(0x1d7)+_0x1d989a[_0x3423a6(0x1cb)]),console[_0x3423a6(0x1de)](_0x3423a6(0x1d1)+_0xe58bf8));const _0x3e0066=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0xe58bf8+_0x3423a6(0x1cf),()=>_0xd043ca['segment'][_0x3423a6(0x1e0)](_0xe58bf8),{'verbose':_0x1d989a[_0x3423a6(0x1d9)]}),_0x283b4d=_0x3e0066[_0x3423a6(0x1d4)];console[_0x3423a6(0x1de)](_0x3423a6(0x1d6)+_0x283b4d[_0x3423a6(0x1d3)]+_0x3423a6(0x1e6)+(_0x283b4d[_0x3423a6(0x1d3)]!==0x1?'s':''));if(_0x1d989a[_0x3423a6(0x1e5)]||_0x1d989a[_0x3423a6(0x1cd)])return await handleSDKOutput(_0x283b4d,_0x1d989a),0x0;return displayFieldsHumanReadable(_0x283b4d,_0xe58bf8),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x381668=a37_0x42f4;function a37_0x42f4(_0x13e886,_0x40e102){_0x13e886=_0x13e886-0xe9;const _0x1000a9=a37_0x1000();let _0x42f4f8=_0x1000a9[_0x13e886];return _0x42f4f8;}(function(_0x1aed49,_0x216434){const _0x20da25=a37_0x42f4,_0x54fc0f=_0x1aed49();while(!![]){try{const _0x245e1=-parseInt(_0x20da25(0x133))/0x1+-parseInt(_0x20da25(0xf8))/0x2*(-parseInt(_0x20da25(0x113))/0x3)+parseInt(_0x20da25(0x10d))/0x4*(parseInt(_0x20da25(0xf4))/0x5)+parseInt(_0x20da25(0x126))/0x6*(parseInt(_0x20da25(0x130))/0x7)+parseInt(_0x20da25(0x11c))/0x8+parseInt(_0x20da25(0xf0))/0x9+-parseInt(_0x20da25(0x12e))/0xa;if(_0x245e1===_0x216434)break;else _0x54fc0f['push'](_0x54fc0f['shift']());}catch(_0x1aa086){_0x54fc0f['push'](_0x54fc0f['shift']());}}}(a37_0x1000,0x40592));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a37_0x16d262 from'chalk';function a37_0x1000(){const _0x1663d7=['name','filter','resourceName','β\x20All\x20files\x20are\x20up\x20to\x20date','journeys','targetDir','repeat','dim','isNew','description','-\x20no\x20files\x20written','\x20\x20Target:\x20','type','segment','Write\x20','segment:pull','message','session','152QNKJcK','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)','Parent\x20segment:\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20changed\x20files','parentName','892959MgnEqd','no_parent','counts','data','file','\x20=\x20','Target\x20resource:\x20','execute','\x20journeys','1822776fAdVYS','parent_segment','\x0aPull\x20summary\x20for\x20\x27','dryRun','\x20files?','\x0aError:','\x27...','parentSegment','\x20activations','\x20new\x20files','6jJiSJm','\x20files\x20to\x20','setPhase','cwd','dirname','helpText','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20versions)','12231530PzYhbB','yellow','3145646hiSTee','error','\x20\x20πΊοΈ\x20\x20','130684SNPlhq','Aborted.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','length','journeyVersions','Pulling\x20segments\x20from\x20\x27','green','red','pullSegments','verbose','cyan','β\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','utf-8','content','hasChanges','Site:\x20','errorCode','\x20segments','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2586087UKHrLk','\x20with\x20','files','absolutePath','46735rAlCuD','yes','diff','\x20\x20π―\x20','2DuQVVt','segments','\x0aChanges\x20to\x20\x27'];a37_0x1000=function(){return _0x1663d7;};return a37_0x1000();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a37_0x886f5a from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a37_0x381668(0xfb)]=a37_0x381668(0x10a);[a37_0x381668(0x104)]=a37_0x381668(0x12c);async[a37_0x381668(0x11a)](_0x14ae26){const _0x33cf82=a37_0x381668,{options:_0x449c43,args:_0x5ec407,tdx:_0x32f0f4}=_0x14ae26,_0x214a9e=_0x449c43,_0x3a451b=await resolveTarget({'arg':_0x5ec407[0x0],'contextParent':_0x449c43[_0x33cf82(0x123)],'cwd':process[_0x33cf82(0x129)]()});if(!isSuccessfulResolution(_0x3a451b))return _0x3a451b[_0x33cf82(0xed)]===_0x33cf82(0x114)?(console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x12f)](_0x33cf82(0x135))),console[_0x33cf82(0x131)](_0x33cf82(0x10e)),console[_0x33cf82(0x131)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x33cf82(0x131)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x13a)]('Error:\x20'+_0x3a451b[_0x33cf82(0x10b)]+'\x0a')),_0x3a451b[_0x33cf82(0x12b)]&&console[_0x33cf82(0x131)](a37_0x16d262['cyan'](_0x3a451b[_0x33cf82(0x12b)]))),0x1;const _0x49f6bc=_0x3a451b[_0x33cf82(0x112)],_0x2eb4dd=_0x3a451b[_0x33cf82(0x100)],_0x1fcc36=_0x3a451b[_0x33cf82(0x107)]===_0x33cf82(0x117)?_0x3a451b[_0x33cf82(0xfd)]:undefined;_0x214a9e[_0x33cf82(0x13c)]&&(console[_0x33cf82(0x131)](_0x33cf82(0xec)+_0x214a9e['site']),console[_0x33cf82(0x131)](_0x33cf82(0x10f)+_0x49f6bc),_0x1fcc36&&console[_0x33cf82(0x131)](_0x33cf82(0x119)+_0x1fcc36));const _0x291c48=await withProgressSpinner(_0x33cf82(0x138)+_0x49f6bc+_0x33cf82(0x122),_0x5fb037=>_0x32f0f4[_0x33cf82(0x108)][_0x33cf82(0x13b)](_0x49f6bc,{'targetDir':_0x2eb4dd,'targetResourceName':_0x1fcc36,'verbose':_0x214a9e[_0x33cf82(0x13c)],'progress':{'update':_0x391b98=>{const _0x177aa6=_0x33cf82;_0x5fb037[_0x177aa6(0x128)](_0x391b98),_0x214a9e[_0x177aa6(0x13c)]&&console['error']('\x20\x20'+_0x391b98);}}}),{'verbose':_0x214a9e[_0x33cf82(0x13c)]}),_0x473221=_0x291c48[_0x33cf82(0x116)];if(_0x473221[_0x33cf82(0x115)]['segments']===0x0&&_0x473221[_0x33cf82(0x115)][_0x33cf82(0xff)]===0x0)return console['error'](a37_0x16d262['yellow'](_0x33cf82(0x110)+_0x473221[_0x33cf82(0x112)]+'\x27')),0x0;const _0xdf21cd=_0x473221[_0x33cf82(0xf2)][_0x33cf82(0xfc)](_0x434c0c=>_0x434c0c[_0x33cf82(0x103)]),_0x5e1657=_0x473221[_0x33cf82(0xf2)][_0x33cf82(0xfc)](_0x40ea92=>!_0x40ea92[_0x33cf82(0x103)]&&_0x40ea92['hasChanges']),_0x54c15e=_0x473221[_0x33cf82(0xf2)][_0x33cf82(0xfc)](_0x49003f=>!_0x49003f['isNew']&&!_0x49003f[_0x33cf82(0xeb)]);console[_0x33cf82(0x131)](_0x33cf82(0x11e)+_0x473221['parentName']+'\x27:'),console[_0x33cf82(0x131)](_0x33cf82(0xf7)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221[_0x33cf82(0x115)][_0x33cf82(0xf9)]+_0x33cf82(0xee))+_0x33cf82(0xf1)+a37_0x16d262['cyan'](_0x473221['counts']['activations']+_0x33cf82(0x124)));if(_0x473221[_0x33cf82(0x115)][_0x33cf82(0xff)]>0x0){const _0x38c961=_0x473221[_0x33cf82(0x115)]['journeyVersions']>_0x473221[_0x33cf82(0x115)]['journeys']?'\x20('+_0x473221[_0x33cf82(0x115)][_0x33cf82(0x137)]+_0x33cf82(0x12d):'';console[_0x33cf82(0x131)](_0x33cf82(0x132)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221['counts'][_0x33cf82(0xff)]+_0x33cf82(0x11b))+a37_0x16d262[_0x33cf82(0x102)](_0x38c961));}console[_0x33cf82(0x131)]('\x20\x20'+a37_0x16d262['green']('+\x20'+_0xdf21cd['length']+_0x33cf82(0x125))),console[_0x33cf82(0x131)]('\x20\x20'+a37_0x16d262[_0x33cf82(0x12f)]('~\x20'+_0x5e1657[_0x33cf82(0x136)]+_0x33cf82(0x111))),console[_0x33cf82(0x131)]('\x20\x20'+a37_0x16d262[_0x33cf82(0x102)]('=\x20'+_0x54c15e[_0x33cf82(0x136)]+'\x20unchanged\x20files')),console[_0x33cf82(0x131)](_0x33cf82(0x106)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221['targetDir'])+'\x0a');if(_0x5e1657[_0x33cf82(0x136)]>0x0)for(const _0x15d2d4 of _0x5e1657){console['error'](_0x33cf82(0xfa)+_0x15d2d4['relativePath']+'\x27:'),console['error']('β'[_0x33cf82(0x101)](0x3c)),console[_0x33cf82(0x131)](_0x15d2d4[_0x33cf82(0xf6)]),console[_0x33cf82(0x131)]('β'[_0x33cf82(0x101)](0x3c));}if(_0x214a9e[_0x33cf82(0x11f)])return console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x12f)](_0x33cf82(0x13f))),0x0;if(_0xdf21cd[_0x33cf82(0x136)]===0x0&&_0x5e1657[_0x33cf82(0x136)]===0x0)return console[_0x33cf82(0x131)](a37_0x16d262['green'](_0x33cf82(0xfe))),saveSessionContext({'parent_segment':_0x473221[_0x33cf82(0x112)]},_0x214a9e[_0x33cf82(0x10c)]),console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x139)]('β\x20Context\x20set:\x20'+a37_0x16d262['dim'](_0x33cf82(0x11d))+_0x33cf82(0x118)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221[_0x33cf82(0x112)]))),0x0;if(!_0x214a9e[_0x33cf82(0xf5)]){if(!isInteractive())return console[_0x33cf82(0x131)](a37_0x16d262['red'](_0x33cf82(0x121)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x102)](_0x33cf82(0xef))),0x1;const _0x44c9f4=await confirmKey(_0x33cf82(0x109)+(_0xdf21cd[_0x33cf82(0x136)]+_0x5e1657[_0x33cf82(0x136)])+_0x33cf82(0x120));if(!_0x44c9f4)return console['error'](a37_0x16d262['yellow'](_0x33cf82(0x134)),_0x33cf82(0x105)),0x1;}for(const _0x518cb2 of _0x473221[_0x33cf82(0xf2)]){if(_0x518cb2[_0x33cf82(0x103)]||_0x518cb2[_0x33cf82(0xeb)]){const _0x5080b1=a37_0x886f5a[_0x33cf82(0x12a)](_0x518cb2[_0x33cf82(0xf3)]);!existsSync(_0x5080b1)&&mkdirSync(_0x5080b1,{'recursive':!![]}),writeFileSync(_0x518cb2[_0x33cf82(0xf3)],_0x518cb2[_0x33cf82(0xea)],_0x33cf82(0xe9));}}return console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x139)]('β\x20Pulled\x20'+(_0xdf21cd[_0x33cf82(0x136)]+_0x5e1657['length'])+_0x33cf82(0x127)+_0x473221['targetDir'])),saveSessionContext({'parent_segment':_0x473221[_0x33cf82(0x112)]},_0x214a9e[_0x33cf82(0x10c)]),console['error'](a37_0x16d262[_0x33cf82(0x139)](_0x33cf82(0x13e)+a37_0x16d262[_0x33cf82(0x102)](_0x33cf82(0x11d))+_0x33cf82(0x118)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221[_0x33cf82(0x112)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a38_0x1452fd=a38_0x8f67;(function(_0x47384e,_0xbf1e3f){const _0x2d5d28=a38_0x8f67,_0x455565=_0x47384e();while(!![]){try{const _0x5ee7b4=-parseInt(_0x2d5d28(0x1e7))/0x1*(-parseInt(_0x2d5d28(0x1d2))/0x2)+parseInt(_0x2d5d28(0x19b))/0x3+-parseInt(_0x2d5d28(0x180))/0x4+-parseInt(_0x2d5d28(0x1bc))/0x5*(parseInt(_0x2d5d28(0x16b))/0x6)+parseInt(_0x2d5d28(0x1bb))/0x7+parseInt(_0x2d5d28(0x16e))/0x8*(parseInt(_0x2d5d28(0x1bf))/0x9)+-parseInt(_0x2d5d28(0x1a4))/0xa;if(_0x5ee7b4===_0xbf1e3f)break;else _0x455565['push'](_0x455565['shift']());}catch(_0x3875d7){_0x455565['push'](_0x455565['shift']());}}}(a38_0x2d35,0x47b87));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a38_0x8f67(_0x5ccb73,_0x367000){_0x5ccb73=_0x5ccb73-0x158;const _0x2d3577=a38_0x2d35();let _0x8f6789=_0x2d3577[_0x5ccb73];return _0x8f6789;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a38_0x5bf6ca from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a38_0x1452fd(0x175)]=a38_0x1452fd(0x1a8);[a38_0x1452fd(0x1a0)]=a38_0x1452fd(0x1ac);async[a38_0x1452fd(0x1b5)](_0x24af74){const _0x3d3df1=a38_0x1452fd,{options:_0x25ef83,args:_0x39364f,tdx:_0x39a40b}=_0x24af74,_0x31a075=_0x25ef83,_0x392499=await resolveTarget({'arg':_0x39364f[0x0],'contextParent':_0x25ef83[_0x3d3df1(0x1e1)],'cwd':process[_0x3d3df1(0x16f)]()});if(!isSuccessfulResolution(_0x392499))return _0x392499['errorCode']===_0x3d3df1(0x169)?(console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1a7)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3d3df1(0x1be)](_0x3d3df1(0x1a6)),console[_0x3d3df1(0x1be)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error'](_0x3d3df1(0x18b))):(console[_0x3d3df1(0x1be)](a38_0x5bf6ca['red']('Error:\x20'+_0x392499['message']+'\x0a')),_0x392499[_0x3d3df1(0x1d1)]&&console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x185)](_0x392499[_0x3d3df1(0x1d1)]))),0x1;if(_0x392499['type']===_0x3d3df1(0x1e8))return console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1c6)](_0x3d3df1(0x173)+_0x392499[_0x3d3df1(0x1c5)]+'\x0a')),console[_0x3d3df1(0x1be)](a38_0x5bf6ca['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x10b9ab=_0x392499[_0x3d3df1(0x1ca)],_0x544be9=_0x392499[_0x3d3df1(0x1c5)],_0x23edb2=_0x392499[_0x3d3df1(0x164)]===_0x3d3df1(0x17a)?_0x392499['filePath']:undefined,_0x4f3c3b=getScopedDetails(_0x392499),_0x4a0cb2=_0x4f3c3b?.[_0x3d3df1(0x1cc)]??![],_0x29984a=_0x4f3c3b?.[_0x3d3df1(0x1a5)]??'';if(!existsSync(_0x544be9))return console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1c6)](_0x3d3df1(0x173)+_0x544be9+'\x0a')),console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x185)](_0x3d3df1(0x1b9))),0x1;_0x31a075['verbose']&&(console[_0x3d3df1(0x1be)]('Site:\x20'+_0x31a075[_0x3d3df1(0x1bd)]),console['error'](_0x3d3df1(0x1b6)+_0x10b9ab),console[_0x3d3df1(0x1be)](_0x3d3df1(0x1b0)+_0x544be9),_0x4a0cb2&&console[_0x3d3df1(0x1be)](_0x3d3df1(0x167)+_0x29984a));const _0x4d50f1=await withSpinner(_0x3d3df1(0x183)+_0x10b9ab+_0x3d3df1(0x1a1),()=>_0x39a40b[_0x3d3df1(0x17b)][_0x3d3df1(0x15d)](_0x10b9ab),{'verbose':_0x31a075[_0x3d3df1(0x190)]}),_0x37165e=_0x4d50f1[_0x3d3df1(0x18e)],{parentSegmentResult:_0x23659f,segmentsResult:_0x1f4867,foldersResult:_0xa8b8db,journeysWithDetailsResult:_0x556a68,userMaps:_0x2b6aab}=await withSpinner(_0x3d3df1(0x1d0),async()=>{const _0x19e5ef=_0x3d3df1,[_0x3d887f,_0x1266fd,_0x2fb0e9,_0x3a28d2,_0x1e05c1]=await Promise['all']([_0x39a40b['segment']['getParent'](_0x37165e),_0x39a40b[_0x19e5ef(0x17b)][_0x19e5ef(0x15e)](_0x37165e),_0x39a40b[_0x19e5ef(0x17b)]['listFolders'](_0x37165e),_0x39a40b[_0x19e5ef(0x181)]['listJourneysWithDetailsFromParentSegment'](_0x37165e,{'includeAllVersions':!![]}),_0x39a40b[_0x19e5ef(0x177)][_0x19e5ef(0x15c)]()]);return{'parentSegmentResult':_0x3d887f,'segmentsResult':_0x1266fd,'foldersResult':_0x2fb0e9,'journeysWithDetailsResult':_0x3a28d2,'userMaps':_0x1e05c1};},{'verbose':_0x31a075[_0x3d3df1(0x190)]})[_0x3d3df1(0x1ae)](_0x19dc2e=>_0x19dc2e[_0x3d3df1(0x18e)]),_0xaedc0d=_0x23659f,_0x427915=extractRootFolderId(_0xaedc0d),_0x189d6d=_0x1f4867,_0xca0b96=_0xa8b8db,{journeys:_0x16e0a6,activationStepsById:_0x55b9f0}=_0x556a68,_0x1599b7=new Map(_0x16e0a6[_0x3d3df1(0x16a)](_0x2ccb5c=>[_0x2ccb5c['id'],_0x2ccb5c])),_0x12a6c3=_0x16e0a6[_0x3d3df1(0x16a)](_0x2728f7=>({'id':_0x2728f7['id'],'name':_0x2728f7[_0x3d3df1(0x163)][_0x3d3df1(0x175)],'journeyBundleName':_0x2728f7[_0x3d3df1(0x163)]['journeyBundleName']||'','journeyBundleId':_0x2728f7[_0x3d3df1(0x163)][_0x3d3df1(0x159)]||'','versionNumber':_0x2728f7['attributes'][_0x3d3df1(0x1ea)],'description':_0x2728f7[_0x3d3df1(0x163)]['description'],'state':_0x2728f7[_0x3d3df1(0x163)][_0x3d3df1(0x1da)],'paused':_0x2728f7['attributes']['paused'],'audienceId':_0x2728f7[_0x3d3df1(0x163)][_0x3d3df1(0x1c7)],'folderId':_0x2728f7['relationships']?.['parentFolder']?.[_0x3d3df1(0x18e)]?.['id'],'createdAt':_0x2728f7[_0x3d3df1(0x163)][_0x3d3df1(0x186)],'updatedAt':_0x2728f7['attributes'][_0x3d3df1(0x162)]})),{emailToId:_0x3ca20a,idToEmail:_0x56988a}=_0x2b6aab,_0x983694=await withSpinner(_0x3d3df1(0x1a3),async()=>{const _0x4c5b95=_0x3d3df1,_0x598cf2=await _0x39a40b[_0x4c5b95(0x16c)][_0x4c5b95(0x158)]();return buildConnectionMaps(_0x598cf2);},{'verbose':_0x31a075[_0x3d3df1(0x190)]})[_0x3d3df1(0x1ae)](_0x2982a8=>_0x2982a8[_0x3d3df1(0x18e)]),_0x20d28e=_0x983694[_0x3d3df1(0x1cd)],_0x207fd7=_0x983694['idToName'],_0xbb5a5b=_0x983694[_0x3d3df1(0x1cb)],_0x214e7f={'emailToIdMap':_0x3ca20a,'connectionNameToIdMap':_0x20d28e,'connectionNameToTypeMap':_0xbb5a5b,'getSchema':_0x2b023d=>_0x39a40b['connection'][_0x3d3df1(0x195)](_0x2b023d)};let {pathToId:_0x5b9be4,idToPath:_0x17a39a}=buildFolderMaps(_0xca0b96);const _0x371e3e=buildSegmentLookupMap(_0x189d6d,_0x17a39a),_0xe03fbe=buildSegmentNameToIdMap(_0x189d6d),_0x47556c=buildJourneyBundleLookupMap(_0x12a6c3,_0x17a39a);let _0x150f55;if(_0x23edb2){if(!_0x23edb2[_0x3d3df1(0x1c9)](_0x3d3df1(0x1b4))&&!_0x23edb2[_0x3d3df1(0x1c9)](_0x3d3df1(0x1c1)))return console[_0x3d3df1(0x1be)](a38_0x5bf6ca['red'](_0x3d3df1(0x189)+_0x23edb2+'\x0a')),0x1;_0x150f55=[_0x23edb2];}else _0x150f55=findYamlFiles(_0x544be9);if(_0x150f55[_0x3d3df1(0x199)]===0x0)return console['error'](a38_0x5bf6ca[_0x3d3df1(0x1c6)](_0x3d3df1(0x1c2)+_0x544be9+'\x0a')),console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x185)](_0x3d3df1(0x1ce))),0x1;let _0x314f53,_0x29c900;try{const _0x49bcca=parseAndClassifyYamlFiles(_0x150f55,_0x544be9,{'skipSegments':_0x31a075[_0x3d3df1(0x19e)]});_0x314f53=_0x49bcca[_0x3d3df1(0x172)],_0x29c900=_0x49bcca['journeys'];const _0x71ad3f=validateParsedFiles(_0x49bcca,_0x544be9);if(_0x71ad3f[_0x3d3df1(0x199)]>0x0)return console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1c6)](_0x3d3df1(0x1a9))),console[_0x3d3df1(0x1be)](formatValidationErrors(_0x71ad3f)),console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1a7)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x527cb1){return console['error'](a38_0x5bf6ca['red']('Error\x20parsing\x20YAML:\x20'+(_0x527cb1 instanceof Error?_0x527cb1[_0x3d3df1(0x1ba)]:_0x527cb1))),0x1;}if(_0x314f53[_0x3d3df1(0x199)]===0x0&&_0x29c900[_0x3d3df1(0x199)]===0x0){const _0x4e2fc4=_0x31a075['journeysOnly']?'journey':_0x3d3df1(0x1c4);return console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1a7)](_0x3d3df1(0x1d7)+_0x4e2fc4+_0x3d3df1(0x19c))),0x0;}const _0x50d00f=new Map();_0x189d6d[_0x3d3df1(0x199)]>0x0&&!_0x31a075['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x189d6d,async _0x2173a2=>{const _0x426a2b=a38_0x8f67,_0x32eb0f=await _0x39a40b[_0x426a2b(0x17b)][_0x426a2b(0x17d)](_0x37165e,_0x2173a2['id']);_0x50d00f[_0x426a2b(0x18f)](_0x2173a2['id'],_0x32eb0f);});},{'verbose':_0x31a075[_0x3d3df1(0x190)]});const {segmentFiles:_0x527a6a,foldersToCreate:_0x1fbeef}=await prepareSegmentFiles(_0x314f53,{'segmentByFolderAndName':_0x371e3e,'activationsBySegmentId':_0x50d00f,'folderPathToId':_0x5b9be4,'idToEmailMap':_0x56988a,'connectionIdToNameMap':_0x207fd7},_0x214e7f,_0x4a0cb2,_0x29984a),_0x321e6b=_0x23edb2?[]:findSegmentsToDelete(_0x189d6d,_0x314f53[_0x3d3df1(0x16a)](({yamlConfig:_0x3bbce7,folderPath:_0x5b1b2b})=>({'yamlConfig':_0x3bbce7,'folderPath':resolveTDFolderPath(_0x5b1b2b,_0x4a0cb2,_0x29984a)})),_0x17a39a,_0x29984a,_0x4a0cb2),{journeyFiles:_0x2a157a,foldersToCreate:_0x2d7c52}=await withProgressSpinner(_0x3d3df1(0x161),async _0x5c5083=>prepareJourneyFiles(_0x29c900,{'fetchJourney':async _0x38aabc=>_0x39a40b[_0x3d3df1(0x181)][_0x3d3df1(0x191)](_0x38aabc[_0x3d3df1(0x1aa)]),'journeyBundlesByFolderAndName':_0x47556c,'folderPathToId':_0x5b9be4,'idToEmailMap':_0x56988a,'connectionIdToNameMap':_0x207fd7,'existingSegments':_0x189d6d,'parentId':_0x37165e,'deps':_0x39a40b,'progress':{'update':_0x571250=>{const _0x4a6add=_0x3d3df1;_0x5c5083[_0x4a6add(0x1ec)](_0x571250),_0x31a075[_0x4a6add(0x190)]&&console[_0x4a6add(0x1be)]('\x20\x20'+_0x571250);}},'journeyById':_0x1599b7,'activationStepsById':_0x55b9f0},_0x4a0cb2,_0x29984a),{'verbose':_0x31a075['verbose']})['then'](_0x39d1b6=>_0x39d1b6[_0x3d3df1(0x18e)]);for(const _0x2cfd3c of _0x2d7c52){_0x1fbeef[_0x3d3df1(0x1d6)](_0x2cfd3c);}const _0x5ae085=_0x23edb2?[]:findJourneysToDelete(_0x12a6c3,_0x29c900[_0x3d3df1(0x16a)](({yamlConfig:_0xd77ca,folderPath:_0x107082})=>({'yamlConfig':_0xd77ca,'folderPath':resolveTDFolderPath(_0x107082,_0x4a0cb2,_0x29984a)})),_0x17a39a,_0x29984a,_0x4a0cb2),_0x3da3bc=calculatePushStats(_0x527a6a,_0x2a157a,_0x1fbeef,_0x321e6b,_0x5ae085,!!_0x31a075[_0x3d3df1(0x171)],!!_0x31a075[_0x3d3df1(0x19e)]),_0x2f7146=_0x3da3bc['segments'][_0x3d3df1(0x1e9)],_0x3dd325=_0x3da3bc[_0x3d3df1(0x172)]['changed'],_0x511fe6=_0x3da3bc[_0x3d3df1(0x172)]['unchanged'],_0x41c23b=_0x3da3bc[_0x3d3df1(0x172)][_0x3d3df1(0x17e)],_0x4fcc99=_0x3da3bc[_0x3d3df1(0x1b3)][_0x3d3df1(0x1d9)],_0x2a7857=_0x3da3bc['journeys'][_0x3d3df1(0x1e9)],_0x15a700=_0x3da3bc[_0x3d3df1(0x192)][_0x3d3df1(0x15a)],_0xe01ee7=_0x3da3bc[_0x3d3df1(0x192)][_0x3d3df1(0x16d)],_0x1e5ee5=_0x3da3bc[_0x3d3df1(0x192)][_0x3d3df1(0x17e)],_0x2e6eeb=_0x3da3bc[_0x3d3df1(0x19f)][_0x3d3df1(0x1dd)],_0x567996=_0x3da3bc[_0x3d3df1(0x19f)][_0x3d3df1(0x1d9)],_0x539664=_0x3da3bc[_0x3d3df1(0x19f)]['toUpdate'],_0x5dce77=_0x3da3bc[_0x3d3df1(0x19f)]['toDelete'];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x10b9ab+'\x27:');_0x4fcc99[_0x3d3df1(0x199)]>0x0&&console[_0x3d3df1(0x1be)]('\x20\x20'+a38_0x5bf6ca[_0x3d3df1(0x1df)](_0x3d3df1(0x168)+_0x4fcc99[_0x3d3df1(0x199)]+_0x3d3df1(0x176)));if(!_0x31a075[_0x3d3df1(0x19e)]){console[_0x3d3df1(0x1be)](_0x3d3df1(0x1e2)),console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca['green']('+\x20'+_0x2f7146[_0x3d3df1(0x199)]+_0x3d3df1(0x1af))),console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca[_0x3d3df1(0x1a7)]('~\x20'+_0x3dd325[_0x3d3df1(0x199)]+'\x20changed'));if(_0x41c23b[_0x3d3df1(0x199)]>0x0)console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca['red']('-\x20'+_0x41c23b[_0x3d3df1(0x199)]+_0x3d3df1(0x18d)));else _0x321e6b['length']>0x0&&!_0x31a075['delete']&&console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca['dim'](_0x321e6b[_0x3d3df1(0x199)]+_0x3d3df1(0x1de)));console[_0x3d3df1(0x1be)]('\x20\x20\x20\x20'+a38_0x5bf6ca[_0x3d3df1(0x1eb)]('=\x20'+_0x511fe6['length']+'\x20unchanged'));}if(_0x2a157a['length']>0x0||_0x5ae085['length']>0x0){console[_0x3d3df1(0x1be)]('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca[_0x3d3df1(0x174)]('+\x20'+_0x2a7857[_0x3d3df1(0x199)]+_0x3d3df1(0x1af))),console[_0x3d3df1(0x1be)]('\x20\x20\x20\x20'+a38_0x5bf6ca['yellow']('~\x20'+_0x15a700[_0x3d3df1(0x199)]+'\x20changed'));if(_0x1e5ee5['length']>0x0)console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca[_0x3d3df1(0x1c6)]('-\x20'+_0x1e5ee5[_0x3d3df1(0x199)]+_0x3d3df1(0x18d)));else _0x5ae085[_0x3d3df1(0x199)]>0x0&&!_0x31a075[_0x3d3df1(0x171)]&&console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca[_0x3d3df1(0x1eb)](_0x5ae085[_0x3d3df1(0x199)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca[_0x3d3df1(0x1eb)]('=\x20'+_0xe01ee7[_0x3d3df1(0x199)]+'\x20unchanged'));}_0x2e6eeb[_0x3d3df1(0x199)]>0x0&&!_0x31a075[_0x3d3df1(0x19e)]&&(console[_0x3d3df1(0x1be)](''),console[_0x3d3df1(0x1be)]('\x20\x20Activations:'),_0x567996['length']>0x0&&console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca[_0x3d3df1(0x174)]('+\x20'+_0x567996[_0x3d3df1(0x199)]+'\x20to\x20create')),_0x539664[_0x3d3df1(0x199)]>0x0&&console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca[_0x3d3df1(0x1a7)]('~\x20'+_0x539664[_0x3d3df1(0x199)]+_0x3d3df1(0x1e5))),_0x5dce77[_0x3d3df1(0x199)]>0x0&&console[_0x3d3df1(0x1be)](_0x3d3df1(0x170)+a38_0x5bf6ca['red']('-\x20'+_0x5dce77[_0x3d3df1(0x199)]+'\x20to\x20delete')));console[_0x3d3df1(0x1be)]('\x20\x20Source:\x20'+a38_0x5bf6ca[_0x3d3df1(0x185)](_0x544be9)+'\x0a');if(_0x4fcc99[_0x3d3df1(0x199)]>0x0){console['error'](_0x3d3df1(0x165));for(const _0x145aec of _0x4fcc99){console[_0x3d3df1(0x1be)]('\x20\x20'+a38_0x5bf6ca[_0x3d3df1(0x1df)]('+')+'\x20'+_0x145aec);}console[_0x3d3df1(0x1be)]('');}if(_0x2f7146[_0x3d3df1(0x199)]>0x0&&!_0x31a075[_0x3d3df1(0x19e)])for(const _0x508f92 of _0x2f7146){const _0x1a0a5c=_0x508f92[_0x3d3df1(0x1cf)]?_0x508f92[_0x3d3df1(0x1cf)]+'/'+_0x508f92[_0x3d3df1(0x19d)]['name']:_0x508f92['yamlConfig'][_0x3d3df1(0x175)],_0x5f3a97=_0x508f92['yamlConfig'][_0x3d3df1(0x19f)]?.[_0x3d3df1(0x199)]||0x0,_0x21d581=_0x5f3a97>0x0?a38_0x5bf6ca[_0x3d3df1(0x1eb)]('\x20['+_0x5f3a97+'\x20activations]'):'';console[_0x3d3df1(0x1be)]('\x0a'+a38_0x5bf6ca[_0x3d3df1(0x174)](_0x3d3df1(0x1d8))+'\x20'+_0x1a0a5c+_0x21d581),console[_0x3d3df1(0x1be)]('β'[_0x3d3df1(0x1c3)](0x3c)),_0x508f92[_0x3d3df1(0x18c)]&&console[_0x3d3df1(0x1be)](_0x508f92[_0x3d3df1(0x18c)]),console['error']('β'['repeat'](0x3c));}if(_0x41c23b[_0x3d3df1(0x199)]>0x0&&!_0x31a075[_0x3d3df1(0x19e)])for(const _0xccd888 of _0x41c23b){const _0x5a0444=_0xccd888[_0x3d3df1(0x160)]?_0x17a39a[_0x3d3df1(0x1b1)](_0xccd888['segmentFolderId'][_0x3d3df1(0x197)]())||'':'',_0x43603d=_0x5a0444?_0x5a0444+'/'+_0xccd888[_0x3d3df1(0x175)]:_0xccd888[_0x3d3df1(0x175)],_0x5bbfc9=_0x50d00f[_0x3d3df1(0x1b1)](_0xccd888['id'])||[],_0x502985=_0x5bbfc9['length']>0x0?a38_0x5bf6ca[_0x3d3df1(0x1eb)]('\x20['+_0x5bbfc9[_0x3d3df1(0x199)]+_0x3d3df1(0x182)):'';console[_0x3d3df1(0x1be)]('\x0a'+a38_0x5bf6ca[_0x3d3df1(0x1c6)](_0x3d3df1(0x198))+'\x20'+_0x43603d+_0x502985),console['error']('β'[_0x3d3df1(0x1c3)](0x3c));const _0x389330=segmentWithActivationsToYaml(_0xccd888,_0x5bbfc9,undefined,_0x56988a,_0x207fd7),_0x186b7e=segmentToYamlString(_0x389330),_0x839ef0=generateDiff(_0x186b7e,'');console[_0x3d3df1(0x1be)](formatDiffWithColors(_0x839ef0)),console['error']('β'['repeat'](0x3c));}const _0x4798d1=_0x527a6a[_0x3d3df1(0x18a)](_0x409159=>!_0x409159[_0x3d3df1(0x1a2)]&&_0x409159[_0x3d3df1(0x18c)]);if(_0x4798d1[_0x3d3df1(0x199)]>0x0&&!_0x31a075[_0x3d3df1(0x19e)])for(const _0x46e21c of _0x4798d1){const _0x13fdc6=_0x46e21c[_0x3d3df1(0x1cf)]?_0x46e21c['folderPath']+'/'+_0x46e21c[_0x3d3df1(0x19d)][_0x3d3df1(0x175)]:_0x46e21c[_0x3d3df1(0x19d)][_0x3d3df1(0x175)];console[_0x3d3df1(0x1be)]('\x0a'+a38_0x5bf6ca[_0x3d3df1(0x1a7)](_0x3d3df1(0x1d4))+'\x20'+_0x13fdc6),console[_0x3d3df1(0x1be)]('β'[_0x3d3df1(0x1c3)](0x3c)),console[_0x3d3df1(0x1be)](_0x46e21c[_0x3d3df1(0x18c)]),console[_0x3d3df1(0x1be)]('β'['repeat'](0x3c));}if(_0x2a7857[_0x3d3df1(0x199)]>0x0)for(const _0x5db696 of _0x2a7857){const _0x12b320=_0x5db696[_0x3d3df1(0x1cf)]?_0x5db696[_0x3d3df1(0x1cf)]+'/'+_0x5db696[_0x3d3df1(0x19d)][_0x3d3df1(0x175)]:_0x5db696['yamlConfig'][_0x3d3df1(0x175)];console['error']('\x0a'+a38_0x5bf6ca[_0x3d3df1(0x174)](_0x3d3df1(0x1dc))+'\x20'+_0x12b320),console[_0x3d3df1(0x1be)]('β'['repeat'](0x3c)),_0x5db696['diff']&&console['error'](_0x5db696['diff']),console[_0x3d3df1(0x1be)]('β'[_0x3d3df1(0x1c3)](0x3c));}const _0x21c90c=_0x2a157a[_0x3d3df1(0x18a)](_0x152efe=>!_0x152efe[_0x3d3df1(0x1a2)]&&_0x152efe[_0x3d3df1(0x18c)]);if(_0x21c90c[_0x3d3df1(0x199)]>0x0)for(const _0x288a12 of _0x21c90c){const _0x58d2f5=_0x288a12[_0x3d3df1(0x1cf)]?_0x288a12[_0x3d3df1(0x1cf)]+'/'+_0x288a12['yamlConfig'][_0x3d3df1(0x175)]:_0x288a12['yamlConfig'][_0x3d3df1(0x175)];console[_0x3d3df1(0x1be)]('\x0a'+a38_0x5bf6ca['yellow'](_0x3d3df1(0x187))+'\x20'+_0x58d2f5),console[_0x3d3df1(0x1be)]('β'[_0x3d3df1(0x1c3)](0x3c)),console['error'](_0x288a12[_0x3d3df1(0x18c)]),console['error']('β'[_0x3d3df1(0x1c3)](0x3c));}if(_0x1e5ee5['length']>0x0)for(const _0x16e2ee of _0x1e5ee5){const _0x1798c1=_0x16e2ee[_0x3d3df1(0x15b)]?_0x17a39a[_0x3d3df1(0x1b1)](_0x16e2ee[_0x3d3df1(0x15b)])||'':'',_0x5d8b37=_0x1798c1?_0x1798c1+'/'+_0x16e2ee[_0x3d3df1(0x179)]:_0x16e2ee['journeyBundleName'];console[_0x3d3df1(0x1be)]('\x0a'+a38_0x5bf6ca[_0x3d3df1(0x1c6)]('Delete\x20journey:')+'\x20'+_0x5d8b37),console[_0x3d3df1(0x1be)]('β'['repeat'](0x3c)),console['error'](a38_0x5bf6ca[_0x3d3df1(0x1c6)](_0x3d3df1(0x1e6))),console[_0x3d3df1(0x1be)]('β'['repeat'](0x3c));}if(_0x31a075[_0x3d3df1(0x15f)])return console['error'](a38_0x5bf6ca[_0x3d3df1(0x1a7)](_0x3d3df1(0x193))),0x0;const _0x5c2c8c=_0x31a075['journeysOnly']?![]:_0x2f7146[_0x3d3df1(0x199)]>0x0||_0x3dd325[_0x3d3df1(0x199)]>0x0||_0x41c23b[_0x3d3df1(0x199)]>0x0,_0x21e584=_0x2a7857[_0x3d3df1(0x199)]>0x0||_0x15a700['length']>0x0||_0x1e5ee5[_0x3d3df1(0x199)]>0x0,_0x5bb406=_0x31a075[_0x3d3df1(0x19e)]?![]:_0x2e6eeb[_0x3d3df1(0x199)]>0x0,_0x20f094=_0x4fcc99[_0x3d3df1(0x199)]>0x0;if(!_0x5c2c8c&&!_0x21e584&&!_0x5bb406&&!_0x20f094){const _0x41a325=_0x31a075[_0x3d3df1(0x19e)]?'β\x20All\x20journeys\x20are\x20up\x20to\x20date':'β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x174)](_0x41a325));if(_0x23edb2&&_0x511fe6[_0x3d3df1(0x199)]===0x1){const _0x41b539=_0x511fe6[0x0];if(_0x41b539[_0x3d3df1(0x166)]?.['id']){const _0x442b03=getConsoleNextUrl(_0x31a075[_0x3d3df1(0x1bd)],'/app/ps/'+_0x37165e+_0x3d3df1(0x1ab)+_0x41b539[_0x3d3df1(0x166)]['id']+_0x3d3df1(0x1c0));console[_0x3d3df1(0x1be)](_0x3d3df1(0x194)+a38_0x5bf6ca[_0x3d3df1(0x185)](_0x442b03));}}if(_0x23edb2&&_0xe01ee7[_0x3d3df1(0x199)]===0x1){const _0x1ffe3b=_0xe01ee7[0x0];if(_0x1ffe3b['existingJourney']?.['id']){const _0x42a233=getConsoleNextUrl(_0x31a075[_0x3d3df1(0x1bd)],_0x3d3df1(0x1ad)+_0x37165e+_0x3d3df1(0x1ab)+_0x1ffe3b['existingJourney']['id']+'/j/da/je');console[_0x3d3df1(0x1be)]('\x20\x20'+a38_0x5bf6ca[_0x3d3df1(0x185)](_0x42a233));}}return 0x0;}const _0x2e3bd6=_0x31a075['journeysOnly']?_0x2a7857['length']+_0x15a700[_0x3d3df1(0x199)]+_0x1e5ee5[_0x3d3df1(0x199)]+_0x4fcc99['length']:_0x2f7146[_0x3d3df1(0x199)]+_0x3dd325['length']+_0x41c23b[_0x3d3df1(0x199)]+_0x2a7857[_0x3d3df1(0x199)]+_0x15a700[_0x3d3df1(0x199)]+_0x1e5ee5[_0x3d3df1(0x199)]+_0x4fcc99[_0x3d3df1(0x199)]+_0x2e6eeb['length'];if(!_0x31a075[_0x3d3df1(0x1d3)]&&_0x2e3bd6>0x0){if(!isInteractive())return console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1c6)]('\x0aError:'),_0x3d3df1(0x188)),console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1eb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x32d7cf=await confirmKey('Push\x20'+_0x2e3bd6+_0x3d3df1(0x1d5));if(!_0x32d7cf)return console[_0x3d3df1(0x1be)](a38_0x5bf6ca['yellow']('Aborted.')),0x1;}const _0x56f961={'withProgress':async(_0x2c9b1c,_0x2e65ae)=>{const _0x3e4dfc=_0x3d3df1,_0x26aac2=await withSpinner(_0x2c9b1c,_0x2e65ae,{'verbose':_0x31a075[_0x3e4dfc(0x190)]});return{'data':_0x26aac2[_0x3e4dfc(0x18e)]};},'logInfo':_0x1f797e=>console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1df)]('β\x20'+_0x1f797e)),'logSuccess':_0x5c7f05=>console[_0x3d3df1(0x1be)](a38_0x5bf6ca['green']('β\x20'+_0x5c7f05)),'logWarning':_0x3fb6f2=>console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x1a7)]('β \x20'+_0x3fb6f2)),'logDeleted':_0x5ef71c=>console[_0x3d3df1(0x1be)](a38_0x5bf6ca['red']('β\x20'+_0x5ef71c))},_0xfbcdc={'segment':_0x39a40b[_0x3d3df1(0x17b)],'journey':_0x39a40b[_0x3d3df1(0x181)],'user':_0x39a40b[_0x3d3df1(0x177)],'connection':_0x39a40b[_0x3d3df1(0x16c)]};_0x4fcc99[_0x3d3df1(0x199)]>0x0&&(_0x5b9be4=await executePushFolders(_0xfbcdc,_0x4fcc99,_0x5b9be4,{'parentId':_0x37165e},_0x56f961));const _0x7b31f0={'rootFolderId':_0x427915,'folderPathToId':_0x5b9be4,'folderIdToPath':_0x17a39a,'segmentNameToId':_0xe03fbe,'activationsBySegmentId':_0x50d00f,'emailToIdMap':_0x3ca20a,'idToEmailMap':_0x56988a,'connectionNameToIdMap':_0x983694[_0x3d3df1(0x1cd)],'connectionIdToNameMap':_0x983694[_0x3d3df1(0x1c8)],'connectionNameToTypeMap':_0xbb5a5b},_0x32d967=await executePushSegments(_0xfbcdc,_0x31a075['journeysOnly']?[]:_0x527a6a,_0x7b31f0,{'parentId':_0x37165e},_0x56f961),_0x340571=_0x32d967[_0x3d3df1(0x1e0)],_0x3966fe=_0x32d967[_0x3d3df1(0x184)],_0x32b23e=_0x32d967[_0x3d3df1(0x19f)][_0x3d3df1(0x1e0)],_0x21084f=_0x32d967[_0x3d3df1(0x19f)][_0x3d3df1(0x184)],_0x2df666=_0x32d967[_0x3d3df1(0x19f)]['deleted'];let _0x3326e1;if(_0x23edb2&&_0x527a6a[_0x3d3df1(0x199)]===0x1){const _0x1bc53f=_0x527a6a[0x0];_0x3326e1=_0x1bc53f['existingSegment']?.['id']??_0x32d967[_0x3d3df1(0x17c)][_0x3d3df1(0x1b1)](_0x1bc53f[_0x3d3df1(0x19d)][_0x3d3df1(0x175)]);}const _0x5633e4=await executePushSegmentDeletions(_0xfbcdc,_0x31a075['journeysOnly']?[]:_0x41c23b,_0x56f961);let _0xd53e61=0x0,_0x96ede=0x0,_0x588c74=0x0;const _0x4e73ab=new Map(_0xe03fbe);for(const [_0x1df4c5,_0xef4b53]of _0x32d967['createdSegmentIds']){_0x4e73ab[_0x3d3df1(0x18f)](_0x1df4c5,_0xef4b53);}if(_0x2a157a[_0x3d3df1(0x199)]>0x0){const _0x51dc1d={..._0x7b31f0,'segmentNameToId':_0x4e73ab,'existingSegments':_0x189d6d,'activationContext':_0x214e7f},_0x38974b=await executePushJourneys(_0xfbcdc,_0x2a157a,_0x51dc1d,{'parentId':_0x37165e,'rootFolderId':_0x427915,'verbose':_0x31a075[_0x3d3df1(0x190)]},_0x56f961);_0xd53e61=_0x38974b['created'],_0x96ede=_0x38974b[_0x3d3df1(0x184)];if(_0x23edb2&&_0x38974b[_0x3d3df1(0x1b2)][_0x3d3df1(0x199)]===0x1){const _0x47ecfa=_0x38974b[_0x3d3df1(0x1b2)][0x0];if(_0x47ecfa[_0x3d3df1(0x1aa)]){const _0x4ff57a=getConsoleNextUrl(_0x31a075[_0x3d3df1(0x1bd)],'/app/ps/'+_0x37165e+_0x3d3df1(0x1ab)+_0x47ecfa[_0x3d3df1(0x1aa)]+_0x3d3df1(0x1e4));console['error']('\x20\x20'+a38_0x5bf6ca[_0x3d3df1(0x185)](_0x4ff57a));}}}for(const _0x453dc5 of _0x1e5ee5){console['error'](a38_0x5bf6ca['yellow']('β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x453dc5[_0x3d3df1(0x179)])),_0x588c74++;}const _0x5d864f=[];if(_0x340571>0x0)_0x5d864f[_0x3d3df1(0x178)](_0x340571+_0x3d3df1(0x19a));if(_0x3966fe>0x0)_0x5d864f[_0x3d3df1(0x178)](_0x3966fe+'\x20updated');if(_0x5633e4>0x0)_0x5d864f[_0x3d3df1(0x178)](_0x5633e4+_0x3d3df1(0x1b7));const _0x4fb38e=[];if(_0xd53e61>0x0)_0x4fb38e[_0x3d3df1(0x178)](_0xd53e61+_0x3d3df1(0x19a));if(_0x96ede>0x0)_0x4fb38e['push'](_0x96ede+_0x3d3df1(0x1b8));if(_0x588c74>0x0)_0x4fb38e[_0x3d3df1(0x178)](_0x588c74+_0x3d3df1(0x1b7));const _0x3ac3f8=[];if(_0x32b23e>0x0)_0x3ac3f8[_0x3d3df1(0x178)](_0x32b23e+_0x3d3df1(0x19a));if(_0x21084f>0x0)_0x3ac3f8['push'](_0x21084f+_0x3d3df1(0x1b8));if(_0x2df666>0x0)_0x3ac3f8['push'](_0x2df666+_0x3d3df1(0x1b7));console[_0x3d3df1(0x1be)](a38_0x5bf6ca[_0x3d3df1(0x174)](_0x3d3df1(0x1db)));_0x5d864f[_0x3d3df1(0x199)]>0x0&&!_0x31a075['journeysOnly']&&console[_0x3d3df1(0x1be)]('\x20\x20Segments:\x20'+_0x5d864f[_0x3d3df1(0x17f)](',\x20'));_0x4fb38e[_0x3d3df1(0x199)]>0x0&&console['error'](_0x3d3df1(0x1e3)+_0x4fb38e[_0x3d3df1(0x17f)](',\x20'));_0x3ac3f8[_0x3d3df1(0x199)]>0x0&&!_0x31a075['journeysOnly']&&console[_0x3d3df1(0x1be)](_0x3d3df1(0x196)+_0x3ac3f8['join'](',\x20'));if(_0x3326e1){const _0x5cae0b=getConsoleNextUrl(_0x31a075[_0x3d3df1(0x1bd)],_0x3d3df1(0x1ad)+_0x37165e+_0x3d3df1(0x1ab)+_0x3326e1+_0x3d3df1(0x1c0));console[_0x3d3df1(0x1be)](_0x3d3df1(0x194)+a38_0x5bf6ca['cyan'](_0x5cae0b));}return 0x0;}}function a38_0x2d35(){const _0x25ec3c=['Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','filter','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','diff','\x20to\x20delete','data','set','verbose','getJourney','journeys','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getOutputSchemaWithCache','\x20\x20Activations:\x20','toString','Delete\x20segment:','length','\x20created','1605555YvILZs','\x20YAML\x20files\x20found','yamlConfig','journeysOnly','activations','description','\x27...','isNew','Fetching\x20connections\x20for\x20name\x20resolution...','8130850YefkiI','scopedFolderPath','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)','yellow','segment:push','\x0aValidation\x20failed:','journeyId','/e/','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/app/ps/','then','\x20new','Source\x20directory:\x20','get','results','folders','.yml','execute','Parent\x20segment:\x20','\x20deleted','\x20updated','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','message','3788512RLgbfz','730130VixHfB','site','error','204201NoCOnJ','/sb/da/esr','.yaml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','repeat','segment\x20or\x20journey','targetDir','red','audienceId','idToName','endsWith','parentName','nameToType','isScoped','nameToId','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','folderPath','Fetching\x20existing\x20data...','helpText','844638YGfNCR','yes','Changes\x20to:','\x20changes?','add','No\x20','New\x20segment:','toCreate','state','\x0aβ\x20Push\x20complete','New\x20journey:','all','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','blue','created','parentSegment','\x20\x20π\x20Segments:','\x20\x20Journeys:\x20','/j/da/je','\x20to\x20update','(Journey\x20will\x20be\x20deleted)','1XfFFCJ','parent_name','new','versionNumber','dim','setPhase','list','journeyBundleId','changed','folderId','buildUserMaps','resolveParentId','listSegments','dryRun','segmentFolderId','Preparing\x20journeys...','updatedAt','attributes','type','Folders\x20to\x20create:','existingSegment','Scoped\x20to\x20folder:\x20','π\x20','no_parent','map','6mxiwua','connection','unchanged','104AmzALj','cwd','\x20\x20\x20\x20','delete','segments','Error:\x20Directory\x20not\x20found:\x20','green','name','\x20folders\x20to\x20create','user','push','journeyBundleName','file','segment','createdSegmentIds','listActivations','toDelete','join','2163196FjrvrS','journey','\x20activations]','Resolving\x20parent\x20segment\x20\x27','updated','cyan','createdAt','Changes\x20to\x20journey:'];a38_0x2d35=function(){return _0x25ec3c;};return a38_0x2d35();}
|
|
1
|
+
const a38_0x2be8f4=a38_0x4920;(function(_0x5a9dfe,_0x1f03e9){const _0x50fa6d=a38_0x4920,_0x43d44d=_0x5a9dfe();while(!![]){try{const _0x3e93d2=-parseInt(_0x50fa6d(0xb4))/0x1*(parseInt(_0x50fa6d(0x11e))/0x2)+parseInt(_0x50fa6d(0x11d))/0x3*(-parseInt(_0x50fa6d(0xbb))/0x4)+parseInt(_0x50fa6d(0xb7))/0x5*(parseInt(_0x50fa6d(0x11f))/0x6)+parseInt(_0x50fa6d(0x13e))/0x7*(-parseInt(_0x50fa6d(0xee))/0x8)+parseInt(_0x50fa6d(0x12f))/0x9*(parseInt(_0x50fa6d(0x114))/0xa)+-parseInt(_0x50fa6d(0xd3))/0xb+parseInt(_0x50fa6d(0xbe))/0xc*(parseInt(_0x50fa6d(0x12a))/0xd);if(_0x3e93d2===_0x1f03e9)break;else _0x43d44d['push'](_0x43d44d['shift']());}catch(_0xcb4bd3){_0x43d44d['push'](_0x43d44d['shift']());}}}(a38_0x5d16,0xeea06));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0x5d16(){const _0x339d73=['journeyId','user','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','555165pszHiU','isNew','results','changed','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','created','\x20\x20πΊοΈ\x20\x20Journeys:','existingSegment','state','createdAt','\x20changes?','targetDir','\x20unchanged','β\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:','7uNFeDq','filePath','Delete\x20journey:','nameToId','dim','cwd','connection','attributes','length','activations','versionNumber','yamlConfig','listFolders','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','getJourney','Folders\x20to\x20create:','(Journey\x20will\x20be\x20deleted)','segments','Push\x20','/e/','Delete\x20segment:','\x20\x20Activations:','387503vItVQE','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journey','6025GwTKXA','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','folderPath','segment','387736xQpLWJ','journeyBundleName','\x20folders\x20to\x20create','5823828vPehSl','.yml','map','data','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20activations]','Error\x20parsing\x20YAML:\x20','blue','parentFolder','\x27...','error','Preparing\x20journeys...','toString','folders','red','Site:\x20','segmentFolderId','listJourneysWithDetailsFromParentSegment','toCreate','set','Changes\x20to:','200046raiYLM','\x20deleted','\x20changed','all','helpText','type','nameToType','updated','updatedAt','\x20\x20Journeys:\x20','idToName','verbose','name','toDelete','/sb/da/esr','delete','\x20YAML\x20files\x20found','.yaml','Fetching\x20existing\x20activations...','π\x20','\x20\x20\x20\x20','createdSegmentIds','yellow','existingJourney','add','isScoped','execute','14400264ZFXgyl','\x20to\x20delete','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toUpdate','folderId','repeat','join','segment:push','journeyBundleId','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','listActivations','/j/da/je','/app/ps/','\x20\x20Source:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','new','paused','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','dryRun','getOutputSchemaWithCache','message','\x20\x20π\x20Segments:','No\x20','getParent','Error:\x20Directory\x20not\x20found:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','setPhase','site','green','journeys','unchanged','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','relationships','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeysOnly','130dAIhUX','New\x20journey:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','then','no_parent','\x20updated','file','\x20created','get','9pXvTru','10TLXkAr','8940WhaOHt','\x20to\x20update','yes','\x20new','buildUserMaps','filter','endsWith','\x20\x20Segments:\x20','parentSegment','push','Changes\x20to\x20journey:','65JUucIT','parent_name'];a38_0x5d16=function(){return _0x339d73;};return a38_0x5d16();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a38_0x4e5aba from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a38_0x4920(_0x2677ef,_0x3cd941){_0x2677ef=_0x2677ef-0xa9;const _0x5d1606=a38_0x5d16();let _0x4920c9=_0x5d1606[_0x2677ef];return _0x4920c9;}export class SegmentPushCommand extends BaseCommand{[a38_0x2be8f4(0xdf)]=a38_0x2be8f4(0xf6);['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a38_0x2be8f4(0xed)](_0x9441d){const _0x3c5a7b=a38_0x2be8f4,{options:_0x19a27f,args:_0x213280,tdx:_0x116ea1}=_0x9441d,_0x52f448=_0x19a27f,_0x1d0c3f=await resolveTarget({'arg':_0x213280[0x0],'contextParent':_0x19a27f[_0x3c5a7b(0x127)],'cwd':process[_0x3c5a7b(0x143)]()});if(!isSuccessfulResolution(_0x1d0c3f))return _0x1d0c3f['errorCode']===_0x3c5a7b(0x118)?(console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3c5a7b(0x109)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xf9)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb5))):(console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)]('Error:\x20'+_0x1d0c3f[_0x3c5a7b(0x104)]+'\x0a')),_0x1d0c3f[_0x3c5a7b(0xd7)]&&console['error'](a38_0x4e5aba['cyan'](_0x1d0c3f[_0x3c5a7b(0xd7)]))),0x1;if(_0x1d0c3f[_0x3c5a7b(0xd8)]===_0x3c5a7b(0x12b))return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x108)+_0x1d0c3f[_0x3c5a7b(0x13a)]+'\x0a')),console[_0x3c5a7b(0xc8)](a38_0x4e5aba['cyan'](_0x3c5a7b(0xf1))),0x1;const _0x4dcf5f=_0x1d0c3f[_0x3c5a7b(0xf8)],_0x534f92=_0x1d0c3f['targetDir'],_0x476586=_0x1d0c3f[_0x3c5a7b(0xd8)]===_0x3c5a7b(0x11a)?_0x1d0c3f[_0x3c5a7b(0x13f)]:undefined,_0x353675=getScopedDetails(_0x1d0c3f),_0x1e1e98=_0x353675?.[_0x3c5a7b(0xec)]??![],_0x30f1e9=_0x353675?.['scopedFolderPath']??'';if(!existsSync(_0x534f92))return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x108)+_0x534f92+'\x0a')),console['error'](a38_0x4e5aba['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x52f448['verbose']&&(console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xcd)+_0x52f448[_0x3c5a7b(0x10b)]),console[_0x3c5a7b(0xc8)]('Parent\x20segment:\x20'+_0x4dcf5f),console[_0x3c5a7b(0xc8)]('Source\x20directory:\x20'+_0x534f92),_0x1e1e98&&console['error']('Scoped\x20to\x20folder:\x20'+_0x30f1e9));const _0x1e06ae=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4dcf5f+_0x3c5a7b(0xc7),()=>_0x116ea1[_0x3c5a7b(0xba)]['resolveParentId'](_0x4dcf5f),{'verbose':_0x52f448[_0x3c5a7b(0xde)]}),_0x491c87=_0x1e06ae[_0x3c5a7b(0xc1)],{parentSegmentResult:_0x2fb39d,segmentsResult:_0x5a7474,foldersResult:_0x171c4a,journeysWithDetailsResult:_0x23bed8,userMaps:_0xd2c566}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x394f70=_0x3c5a7b,[_0x4d56a2,_0x24560c,_0x39c14e,_0x53072e,_0x2f8660]=await Promise[_0x394f70(0xd6)]([_0x116ea1['segment'][_0x394f70(0x107)](_0x491c87),_0x116ea1[_0x394f70(0xba)]['listSegments'](_0x491c87),_0x116ea1[_0x394f70(0xba)][_0x394f70(0xaa)](_0x491c87),_0x116ea1[_0x394f70(0xb6)][_0x394f70(0xcf)](_0x491c87,{'includeAllVersions':!![]}),_0x116ea1[_0x394f70(0x12d)][_0x394f70(0x123)]()]);return{'parentSegmentResult':_0x4d56a2,'segmentsResult':_0x24560c,'foldersResult':_0x39c14e,'journeysWithDetailsResult':_0x53072e,'userMaps':_0x2f8660};},{'verbose':_0x52f448['verbose']})[_0x3c5a7b(0x117)](_0xbe0954=>_0xbe0954['data']),_0x32fc09=_0x2fb39d,_0x5b8603=extractRootFolderId(_0x32fc09),_0xf51a17=_0x5a7474,_0x60eae5=_0x171c4a,{journeys:_0xf05fcb,activationStepsById:_0x186201}=_0x23bed8,_0x54cb8f=new Map(_0xf05fcb[_0x3c5a7b(0xc0)](_0x1fb409=>[_0x1fb409['id'],_0x1fb409])),_0x15086f=_0xf05fcb[_0x3c5a7b(0xc0)](_0x1926ea=>({'id':_0x1926ea['id'],'name':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xdf)],'journeyBundleName':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xbc)]||'','journeyBundleId':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xf7)]||'','versionNumber':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x148)],'description':_0x1926ea['attributes']['description'],'state':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x137)],'paused':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x100)],'audienceId':_0x1926ea['attributes']['audienceId'],'folderId':_0x1926ea[_0x3c5a7b(0x110)]?.[_0x3c5a7b(0xc6)]?.[_0x3c5a7b(0xc1)]?.['id'],'createdAt':_0x1926ea['attributes'][_0x3c5a7b(0x138)],'updatedAt':_0x1926ea['attributes'][_0x3c5a7b(0xdb)]})),{emailToId:_0x13a137,idToEmail:_0x116f92}=_0xd2c566,_0x5c42ee=await withSpinner(_0x3c5a7b(0xfe),async()=>{const _0x4cbf47=await _0x116ea1['connection']['list']();return buildConnectionMaps(_0x4cbf47);},{'verbose':_0x52f448[_0x3c5a7b(0xde)]})[_0x3c5a7b(0x117)](_0x22d454=>_0x22d454[_0x3c5a7b(0xc1)]),_0x17fb2a=_0x5c42ee[_0x3c5a7b(0x141)],_0x5f0336=_0x5c42ee['idToName'],_0x9d4b3b=_0x5c42ee[_0x3c5a7b(0xd9)],_0x47459f={'emailToIdMap':_0x13a137,'connectionNameToIdMap':_0x17fb2a,'connectionNameToTypeMap':_0x9d4b3b,'getSchema':_0x13d778=>_0x116ea1['connection'][_0x3c5a7b(0x103)](_0x13d778)};let {pathToId:_0x5b7fdd,idToPath:_0x1ffb9d}=buildFolderMaps(_0x60eae5);const _0x213935=buildSegmentLookupMap(_0xf51a17,_0x1ffb9d),_0x3fd0ca=buildSegmentNameToIdMap(_0xf51a17),_0x340cc4=buildJourneyBundleLookupMap(_0x15086f,_0x1ffb9d);let _0x3c0a11;if(_0x476586){if(!_0x476586[_0x3c5a7b(0x125)](_0x3c5a7b(0xbf))&&!_0x476586[_0x3c5a7b(0x125)](_0x3c5a7b(0xe4)))return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x12e)+_0x476586+'\x0a')),0x1;_0x3c0a11=[_0x476586];}else _0x3c0a11=findYamlFiles(_0x534f92);if(_0x3c0a11[_0x3c5a7b(0x146)]===0x0)return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x534f92+'\x0a')),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xf0)](_0x3c5a7b(0x116))),0x1;let _0x14788b,_0x3e35ad;try{const _0x4dd8eb=parseAndClassifyYamlFiles(_0x3c0a11,_0x534f92,{'skipSegments':_0x52f448['journeysOnly']});_0x14788b=_0x4dd8eb[_0x3c5a7b(0xaf)],_0x3e35ad=_0x4dd8eb[_0x3c5a7b(0x10d)];const _0x2e6afe=validateParsedFiles(_0x4dd8eb,_0x534f92);if(_0x2e6afe['length']>0x0)return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x13d))),console[_0x3c5a7b(0xc8)](formatValidationErrors(_0x2e6afe)),console['error'](a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x10f))),0x1;}catch(_0x5a97f6){return console[_0x3c5a7b(0xc8)](a38_0x4e5aba['red'](_0x3c5a7b(0xc4)+(_0x5a97f6 instanceof Error?_0x5a97f6[_0x3c5a7b(0x104)]:_0x5a97f6))),0x1;}if(_0x14788b[_0x3c5a7b(0x146)]===0x0&&_0x3e35ad[_0x3c5a7b(0x146)]===0x0){const _0x4af2ed=_0x52f448[_0x3c5a7b(0x113)]?_0x3c5a7b(0xb6):'segment\x20or\x20journey';return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x106)+_0x4af2ed+_0x3c5a7b(0xe3))),0x0;}const _0x264316=new Map();_0xf51a17['length']>0x0&&!_0x52f448['journeysOnly']&&await withSpinner(_0x3c5a7b(0xe5),async()=>{await batchAsync(_0xf51a17,async _0x57388d=>{const _0x1f979e=a38_0x4920,_0x4f5672=await _0x116ea1[_0x1f979e(0xba)][_0x1f979e(0xfa)](_0x491c87,_0x57388d['id']);_0x264316[_0x1f979e(0xd1)](_0x57388d['id'],_0x4f5672);});},{'verbose':_0x52f448[_0x3c5a7b(0xde)]});const {segmentFiles:_0x5dbe71,foldersToCreate:_0x530d03}=await prepareSegmentFiles(_0x14788b,{'segmentByFolderAndName':_0x213935,'activationsBySegmentId':_0x264316,'folderPathToId':_0x5b7fdd,'idToEmailMap':_0x116f92,'connectionIdToNameMap':_0x5f0336},_0x47459f,_0x1e1e98,_0x30f1e9),_0x41f07d=_0x476586?[]:findSegmentsToDelete(_0xf51a17,_0x14788b[_0x3c5a7b(0xc0)](({yamlConfig:_0x128f1e,folderPath:_0x209a49})=>({'yamlConfig':_0x128f1e,'folderPath':resolveTDFolderPath(_0x209a49,_0x1e1e98,_0x30f1e9)})),_0x1ffb9d,_0x30f1e9,_0x1e1e98),{journeyFiles:_0x4e6ea6,foldersToCreate:_0x3bd5c9}=await withProgressSpinner(_0x3c5a7b(0xc9),async _0x3dd72a=>prepareJourneyFiles(_0x3e35ad,{'fetchJourney':async _0x4189b2=>_0x116ea1[_0x3c5a7b(0xb6)][_0x3c5a7b(0xac)](_0x4189b2['journeyId']),'journeyBundlesByFolderAndName':_0x340cc4,'folderPathToId':_0x5b7fdd,'idToEmailMap':_0x116f92,'connectionIdToNameMap':_0x5f0336,'existingSegments':_0xf51a17,'parentId':_0x491c87,'deps':_0x116ea1,'progress':{'update':_0x5bd4a6=>{const _0x5c2d1=_0x3c5a7b;_0x3dd72a[_0x5c2d1(0x10a)](_0x5bd4a6),_0x52f448['verbose']&&console[_0x5c2d1(0xc8)]('\x20\x20'+_0x5bd4a6);}},'journeyById':_0x54cb8f,'activationStepsById':_0x186201},_0x1e1e98,_0x30f1e9),{'verbose':_0x52f448['verbose']})['then'](_0x5975a8=>_0x5975a8[_0x3c5a7b(0xc1)]);for(const _0x40d044 of _0x3bd5c9){_0x530d03[_0x3c5a7b(0xeb)](_0x40d044);}const _0x4ade10=_0x476586?[]:findJourneysToDelete(_0x15086f,_0x3e35ad[_0x3c5a7b(0xc0)](({yamlConfig:_0x265337,folderPath:_0x2efd51})=>({'yamlConfig':_0x265337,'folderPath':resolveTDFolderPath(_0x2efd51,_0x1e1e98,_0x30f1e9)})),_0x1ffb9d,_0x30f1e9,_0x1e1e98),_0x143377=calculatePushStats(_0x5dbe71,_0x4e6ea6,_0x530d03,_0x41f07d,_0x4ade10,!!_0x52f448[_0x3c5a7b(0xe2)],!!_0x52f448['journeysOnly']),_0x548329=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0xff)],_0x42fc49=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0x132)],_0x12fc4d=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0x10e)],_0x5ce1cb=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0xe0)],_0x3e4467=_0x143377[_0x3c5a7b(0xcb)][_0x3c5a7b(0xd0)],_0x30a19a=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0xff)],_0x3ac9af=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0x132)],_0x49669e=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0x10e)],_0x41325b=_0x143377[_0x3c5a7b(0x10d)]['toDelete'],_0x48ad7d=_0x143377[_0x3c5a7b(0x147)][_0x3c5a7b(0xd6)],_0x83a9c=_0x143377['activations']['toCreate'],_0x8f8b2f=_0x143377[_0x3c5a7b(0x147)][_0x3c5a7b(0xf2)],_0x2a75ae=_0x143377[_0x3c5a7b(0x147)]['toDelete'];console[_0x3c5a7b(0xc8)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4dcf5f+'\x27:');_0x3e4467[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba[_0x3c5a7b(0xc5)](_0x3c5a7b(0xe6)+_0x3e4467[_0x3c5a7b(0x146)]+_0x3c5a7b(0xbd)));if(!_0x52f448[_0x3c5a7b(0x113)]){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0x105)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x10c)]('+\x20'+_0x548329[_0x3c5a7b(0x146)]+_0x3c5a7b(0x122))),console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x42fc49[_0x3c5a7b(0x146)]+_0x3c5a7b(0xd5)));if(_0x5ce1cb[_0x3c5a7b(0x146)]>0x0)console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xcc)]('-\x20'+_0x5ce1cb[_0x3c5a7b(0x146)]+'\x20to\x20delete'));else _0x41f07d['length']>0x0&&!_0x52f448[_0x3c5a7b(0xe2)]&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)](_0x41f07d['length']+_0x3c5a7b(0xc2)));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)]('=\x20'+_0x12fc4d['length']+'\x20unchanged'));}if(_0x4e6ea6[_0x3c5a7b(0x146)]>0x0||_0x4ade10[_0x3c5a7b(0x146)]>0x0){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0x135)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x10c)]('+\x20'+_0x30a19a[_0x3c5a7b(0x146)]+_0x3c5a7b(0x122))),console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x3ac9af[_0x3c5a7b(0x146)]+_0x3c5a7b(0xd5)));if(_0x41325b['length']>0x0)console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xcc)]('-\x20'+_0x41325b['length']+_0x3c5a7b(0xef)));else _0x4ade10[_0x3c5a7b(0x146)]>0x0&&!_0x52f448['delete']&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)](_0x4ade10[_0x3c5a7b(0x146)]+_0x3c5a7b(0xc2)));console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba['dim']('=\x20'+_0x49669e[_0x3c5a7b(0x146)]+_0x3c5a7b(0x13b)));}_0x48ad7d[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&(console[_0x3c5a7b(0xc8)](''),console['error'](_0x3c5a7b(0xb3)),_0x83a9c[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba['green']('+\x20'+_0x83a9c[_0x3c5a7b(0x146)]+'\x20to\x20create')),_0x8f8b2f[_0x3c5a7b(0x146)]>0x0&&console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x8f8b2f['length']+_0x3c5a7b(0x120))),_0x2a75ae[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba['red']('-\x20'+_0x2a75ae[_0x3c5a7b(0x146)]+_0x3c5a7b(0xef))));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xfd)+a38_0x4e5aba['cyan'](_0x534f92)+'\x0a');if(_0x3e4467[_0x3c5a7b(0x146)]>0x0){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xad));for(const _0x1ae734 of _0x3e4467){console['error']('\x20\x20'+a38_0x4e5aba['blue']('+')+'\x20'+_0x1ae734);}console[_0x3c5a7b(0xc8)]('');}if(_0x548329[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)])for(const _0x57d1ef of _0x548329){const _0x55d33c=_0x57d1ef[_0x3c5a7b(0xb9)]?_0x57d1ef['folderPath']+'/'+_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)]:_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)],_0x760d1e=_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0x147)]?.[_0x3c5a7b(0x146)]||0x0,_0x35b8cc=_0x760d1e>0x0?a38_0x4e5aba[_0x3c5a7b(0x142)]('\x20['+_0x760d1e+'\x20activations]'):'';console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0x10c)]('New\x20segment:')+'\x20'+_0x55d33c+_0x35b8cc),console[_0x3c5a7b(0xc8)]('β'['repeat'](0x3c)),_0x57d1ef[_0x3c5a7b(0x111)]&&console['error'](_0x57d1ef['diff']),console['error']('β'['repeat'](0x3c));}if(_0x5ce1cb[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)])for(const _0x5cb1f0 of _0x5ce1cb){const _0xa3674e=_0x5cb1f0[_0x3c5a7b(0xce)]?_0x1ffb9d[_0x3c5a7b(0x11c)](_0x5cb1f0[_0x3c5a7b(0xce)][_0x3c5a7b(0xca)]())||'':'',_0x3d9327=_0xa3674e?_0xa3674e+'/'+_0x5cb1f0[_0x3c5a7b(0xdf)]:_0x5cb1f0['name'],_0x2711d2=_0x264316[_0x3c5a7b(0x11c)](_0x5cb1f0['id'])||[],_0x1c7f21=_0x2711d2['length']>0x0?a38_0x4e5aba[_0x3c5a7b(0x142)]('\x20['+_0x2711d2['length']+_0x3c5a7b(0xc3)):'';console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0xb2))+'\x20'+_0x3d9327+_0x1c7f21),console[_0x3c5a7b(0xc8)]('β'[_0x3c5a7b(0xf4)](0x3c));const _0x231636=segmentWithActivationsToYaml(_0x5cb1f0,_0x2711d2,undefined,_0x116f92,_0x5f0336),_0x218ba2=segmentToYamlString(_0x231636),_0x2b49ed=generateDiff(_0x218ba2,'');console['error'](formatDiffWithColors(_0x2b49ed)),console[_0x3c5a7b(0xc8)]('β'[_0x3c5a7b(0xf4)](0x3c));}const _0x26b026=_0x5dbe71[_0x3c5a7b(0x124)](_0x27ca46=>!_0x27ca46['isNew']&&_0x27ca46[_0x3c5a7b(0x111)]);if(_0x26b026[_0x3c5a7b(0x146)]>0x0&&!_0x52f448['journeysOnly'])for(const _0x1e8484 of _0x26b026){const _0xce8a7a=_0x1e8484[_0x3c5a7b(0xb9)]?_0x1e8484[_0x3c5a7b(0xb9)]+'/'+_0x1e8484['yamlConfig'][_0x3c5a7b(0xdf)]:_0x1e8484['yamlConfig']['name'];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0xd2))+'\x20'+_0xce8a7a),console['error']('β'['repeat'](0x3c)),console[_0x3c5a7b(0xc8)](_0x1e8484[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('β'['repeat'](0x3c));}if(_0x30a19a[_0x3c5a7b(0x146)]>0x0)for(const _0x41b44d of _0x30a19a){const _0x49a774=_0x41b44d[_0x3c5a7b(0xb9)]?_0x41b44d[_0x3c5a7b(0xb9)]+'/'+_0x41b44d[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)]:_0x41b44d[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)];console['error']('\x0a'+a38_0x4e5aba[_0x3c5a7b(0x10c)](_0x3c5a7b(0x115))+'\x20'+_0x49a774),console[_0x3c5a7b(0xc8)]('β'[_0x3c5a7b(0xf4)](0x3c)),_0x41b44d[_0x3c5a7b(0x111)]&&console[_0x3c5a7b(0xc8)](_0x41b44d[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('β'['repeat'](0x3c));}const _0x42ce37=_0x4e6ea6[_0x3c5a7b(0x124)](_0x21557a=>!_0x21557a[_0x3c5a7b(0x130)]&&_0x21557a[_0x3c5a7b(0x111)]);if(_0x42ce37[_0x3c5a7b(0x146)]>0x0)for(const _0x181be5 of _0x42ce37){const _0x43aed7=_0x181be5[_0x3c5a7b(0xb9)]?_0x181be5['folderPath']+'/'+_0x181be5[_0x3c5a7b(0xa9)]['name']:_0x181be5[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x129))+'\x20'+_0x43aed7),console[_0x3c5a7b(0xc8)]('β'[_0x3c5a7b(0xf4)](0x3c)),console[_0x3c5a7b(0xc8)](_0x181be5[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('β'[_0x3c5a7b(0xf4)](0x3c));}if(_0x41325b['length']>0x0)for(const _0x429c8a of _0x41325b){const _0x5002ec=_0x429c8a[_0x3c5a7b(0xf3)]?_0x1ffb9d[_0x3c5a7b(0x11c)](_0x429c8a[_0x3c5a7b(0xf3)])||'':'',_0x109662=_0x5002ec?_0x5002ec+'/'+_0x429c8a['journeyBundleName']:_0x429c8a[_0x3c5a7b(0xbc)];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x140))+'\x20'+_0x109662),console['error']('β'[_0x3c5a7b(0xf4)](0x3c)),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0xae))),console[_0x3c5a7b(0xc8)]('β'['repeat'](0x3c));}if(_0x52f448[_0x3c5a7b(0x102)])return console['error'](a38_0x4e5aba[_0x3c5a7b(0xe9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4c8329=_0x52f448[_0x3c5a7b(0x113)]?![]:_0x548329['length']>0x0||_0x42fc49[_0x3c5a7b(0x146)]>0x0||_0x5ce1cb[_0x3c5a7b(0x146)]>0x0,_0x283edb=_0x30a19a[_0x3c5a7b(0x146)]>0x0||_0x3ac9af[_0x3c5a7b(0x146)]>0x0||_0x41325b[_0x3c5a7b(0x146)]>0x0,_0x59b218=_0x52f448[_0x3c5a7b(0x113)]?![]:_0x48ad7d['length']>0x0,_0x1fe1b7=_0x3e4467['length']>0x0;if(!_0x4c8329&&!_0x283edb&&!_0x59b218&&!_0x1fe1b7){const _0x6bce9e=_0x52f448['journeysOnly']?_0x3c5a7b(0x13c):_0x3c5a7b(0x101);console['error'](a38_0x4e5aba[_0x3c5a7b(0x10c)](_0x6bce9e));if(_0x476586&&_0x12fc4d[_0x3c5a7b(0x146)]===0x1){const _0x15857a=_0x12fc4d[0x0];if(_0x15857a[_0x3c5a7b(0x136)]?.['id']){const _0x12f8f7=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x15857a[_0x3c5a7b(0x136)]['id']+_0x3c5a7b(0xe1));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb8)+a38_0x4e5aba['cyan'](_0x12f8f7));}}if(_0x476586&&_0x49669e['length']===0x1){const _0x471786=_0x49669e[0x0];if(_0x471786[_0x3c5a7b(0xea)]?.['id']){const _0x39faf7=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x471786['existingJourney']['id']+_0x3c5a7b(0xfb));console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba['cyan'](_0x39faf7));}}return 0x0;}const _0x166522=_0x52f448[_0x3c5a7b(0x113)]?_0x30a19a[_0x3c5a7b(0x146)]+_0x3ac9af[_0x3c5a7b(0x146)]+_0x41325b[_0x3c5a7b(0x146)]+_0x3e4467['length']:_0x548329['length']+_0x42fc49[_0x3c5a7b(0x146)]+_0x5ce1cb[_0x3c5a7b(0x146)]+_0x30a19a['length']+_0x3ac9af[_0x3c5a7b(0x146)]+_0x41325b['length']+_0x3e4467[_0x3c5a7b(0x146)]+_0x48ad7d[_0x3c5a7b(0x146)];if(!_0x52f448[_0x3c5a7b(0x121)]&&_0x166522>0x0){if(!isInteractive())return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)]('\x0aError:'),_0x3c5a7b(0x112)),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x142)](_0x3c5a7b(0x133))),0x1;const _0x454ccf=await confirmKey(_0x3c5a7b(0xb0)+_0x166522+_0x3c5a7b(0x139));if(!_0x454ccf)return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('Aborted.')),0x1;}const _0x26d29d={'withProgress':async(_0x40a06c,_0x37bd72)=>{const _0xbd7340=_0x3c5a7b,_0x8fe8da=await withSpinner(_0x40a06c,_0x37bd72,{'verbose':_0x52f448[_0xbd7340(0xde)]});return{'data':_0x8fe8da[_0xbd7340(0xc1)]};},'logInfo':_0x1271e4=>console['error'](a38_0x4e5aba[_0x3c5a7b(0xc5)]('β\x20'+_0x1271e4)),'logSuccess':_0x558eb1=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x10c)]('β\x20'+_0x558eb1)),'logWarning':_0x356c69=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('β \x20'+_0x356c69)),'logDeleted':_0x57bc82=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)]('β\x20'+_0x57bc82))},_0x4fe8d7={'segment':_0x116ea1[_0x3c5a7b(0xba)],'journey':_0x116ea1['journey'],'user':_0x116ea1[_0x3c5a7b(0x12d)],'connection':_0x116ea1[_0x3c5a7b(0x144)]};_0x3e4467[_0x3c5a7b(0x146)]>0x0&&(_0x5b7fdd=await executePushFolders(_0x4fe8d7,_0x3e4467,_0x5b7fdd,{'parentId':_0x491c87},_0x26d29d));const _0x15b2ee={'rootFolderId':_0x5b8603,'folderPathToId':_0x5b7fdd,'folderIdToPath':_0x1ffb9d,'segmentNameToId':_0x3fd0ca,'activationsBySegmentId':_0x264316,'emailToIdMap':_0x13a137,'idToEmailMap':_0x116f92,'connectionNameToIdMap':_0x5c42ee['nameToId'],'connectionIdToNameMap':_0x5c42ee[_0x3c5a7b(0xdd)],'connectionNameToTypeMap':_0x9d4b3b},_0x2f6748=await executePushSegments(_0x4fe8d7,_0x52f448[_0x3c5a7b(0x113)]?[]:_0x5dbe71,_0x15b2ee,{'parentId':_0x491c87},_0x26d29d),_0x79f4f1=_0x2f6748[_0x3c5a7b(0x134)],_0x6948f6=_0x2f6748['updated'],_0x172d92=_0x2f6748[_0x3c5a7b(0x147)]['created'],_0x347570=_0x2f6748[_0x3c5a7b(0x147)][_0x3c5a7b(0xda)],_0x4ac78b=_0x2f6748[_0x3c5a7b(0x147)]['deleted'];let _0x49055f;if(_0x476586&&_0x5dbe71[_0x3c5a7b(0x146)]===0x1){const _0xf62acc=_0x5dbe71[0x0];_0x49055f=_0xf62acc[_0x3c5a7b(0x136)]?.['id']??_0x2f6748[_0x3c5a7b(0xe8)][_0x3c5a7b(0x11c)](_0xf62acc['yamlConfig']['name']);}const _0x5959e8=await executePushSegmentDeletions(_0x4fe8d7,_0x52f448['journeysOnly']?[]:_0x5ce1cb,_0x26d29d);let _0x4437a8=0x0,_0x47af50=0x0,_0x59c7e0=0x0;const _0x3cf6e5=new Map(_0x3fd0ca);for(const [_0x33e3b7,_0x4577ec]of _0x2f6748[_0x3c5a7b(0xe8)]){_0x3cf6e5[_0x3c5a7b(0xd1)](_0x33e3b7,_0x4577ec);}if(_0x4e6ea6[_0x3c5a7b(0x146)]>0x0){const _0x560d2d={..._0x15b2ee,'segmentNameToId':_0x3cf6e5,'existingSegments':_0xf51a17,'activationContext':_0x47459f},_0x43c816=await executePushJourneys(_0x4fe8d7,_0x4e6ea6,_0x560d2d,{'parentId':_0x491c87,'rootFolderId':_0x5b8603,'verbose':_0x52f448[_0x3c5a7b(0xde)]},_0x26d29d);_0x4437a8=_0x43c816['created'],_0x47af50=_0x43c816['updated'];if(_0x476586&&_0x43c816[_0x3c5a7b(0x131)]['length']===0x1){const _0x277fe4=_0x43c816[_0x3c5a7b(0x131)][0x0];if(_0x277fe4[_0x3c5a7b(0x12c)]){const _0x93fb2b=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x277fe4[_0x3c5a7b(0x12c)]+_0x3c5a7b(0xfb));console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba[_0x3c5a7b(0xf0)](_0x93fb2b));}}}for(const _0x14fc59 of _0x41325b){console[_0x3c5a7b(0xc8)](a38_0x4e5aba['yellow'](_0x3c5a7b(0xab)+_0x14fc59['journeyBundleName'])),_0x59c7e0++;}const _0x14bc9f=[];if(_0x79f4f1>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x79f4f1+_0x3c5a7b(0x11b));if(_0x6948f6>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x6948f6+_0x3c5a7b(0x119));if(_0x5959e8>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x5959e8+_0x3c5a7b(0xd4));const _0x4ca3df=[];if(_0x4437a8>0x0)_0x4ca3df[_0x3c5a7b(0x128)](_0x4437a8+_0x3c5a7b(0x11b));if(_0x47af50>0x0)_0x4ca3df[_0x3c5a7b(0x128)](_0x47af50+_0x3c5a7b(0x119));if(_0x59c7e0>0x0)_0x4ca3df['push'](_0x59c7e0+_0x3c5a7b(0xd4));const _0x375941=[];if(_0x172d92>0x0)_0x375941[_0x3c5a7b(0x128)](_0x172d92+_0x3c5a7b(0x11b));if(_0x347570>0x0)_0x375941[_0x3c5a7b(0x128)](_0x347570+_0x3c5a7b(0x119));if(_0x4ac78b>0x0)_0x375941[_0x3c5a7b(0x128)](_0x4ac78b+_0x3c5a7b(0xd4));console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x10c)]('\x0aβ\x20Push\x20complete'));_0x14bc9f[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&console['error'](_0x3c5a7b(0x126)+_0x14bc9f[_0x3c5a7b(0xf5)](',\x20'));_0x4ca3df['length']>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xdc)+_0x4ca3df[_0x3c5a7b(0xf5)](',\x20'));_0x375941[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&console[_0x3c5a7b(0xc8)]('\x20\x20Activations:\x20'+_0x375941[_0x3c5a7b(0xf5)](',\x20'));if(_0x49055f){const _0x4a212e=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+'/e/'+_0x49055f+_0x3c5a7b(0xe1));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb8)+a38_0x4e5aba['cyan'](_0x4a212e));}return 0x0;}}
|