@treasuredata/tdx 2026.3.6 β 2026.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x4e6734=a34_0x367e;(function(_0x3f1906,_0x4843f3){const _0x18b0bc=a34_0x367e,_0x5ec300=_0x3f1906();while(!![]){try{const _0x28cb7e=-parseInt(_0x18b0bc(0xfa))/0x1*(-parseInt(_0x18b0bc(0x151))/0x2)+parseInt(_0x18b0bc(0x109))/0x3+parseInt(_0x18b0bc(0x104))/0x4+-parseInt(_0x18b0bc(0x14c))/0x5*(parseInt(_0x18b0bc(0x137))/0x6)+parseInt(_0x18b0bc(0x112))/0x7*(-parseInt(_0x18b0bc(0x12c))/0x8)+parseInt(_0x18b0bc(0x16a))/0x9+parseInt(_0x18b0bc(0x138))/0xa*(-parseInt(_0x18b0bc(0x14f))/0xb);if(_0x28cb7e===_0x4843f3)break;else _0x5ec300['push'](_0x5ec300['shift']());}catch(_0x431177){_0x5ec300['push'](_0x5ec300['shift']());}}}(a34_0x4646,0xab023));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a34_0x4646(){const _0x55e162=['substring','6919Lucynf','database','1765070qrxOEt','π
\x20','type','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','toLocaleDateString','\x20\x20Database:\x20','Found\x20','trim','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','end_at','error','run','\x20created','limit','lastRun','\x20(showing\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','never','options','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','abs','priority','(unnamed)','h\x20ago','Delete\x20a\x20scheduled\x20query','6440391cGJxrB','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','last_job','format','schedule:update','getTime','history','queries','execute','/app/queries/editor?queryId=','ended_at','pagination','retry_limit','user','INVALID_ARGUMENT','query','Create\x20a\x20scheduled\x20query','update','statusIcon','schedule:show','\x20job','nextRun','name','Deleting\x20schedule...','\x20\x20Time:\x20','ies','timezone','Running\x20schedule:\x20','utf-8','list','listQueries','count','schedule:create','file','Run\x20a\x20scheduled\x20query\x20immediately','log','Update\x20a\x20scheduled\x20query','1QYZTnM','site','engineVersion','args','result','keys','delete','from','Schedule\x20run\x20submitted:\x20','Schedule\x20updated:\x20','4433404OjyIoX','status','round','green','map','3810735qIImcY','job_id','scheduled_at','verbose','Showing\x20first\x20','delay','show','json','\x20\x20Cron:\x20','201222GebPZc','Show\x20schedule\x20details','...','yes','Creating\x20schedule...','join','Show\x20schedule\x20execution\x20history','num','Running\x20schedule...','queryUrl','Updating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Failed\x20to\x20read\x20file:\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','tsv','d\x20ago','table','List\x20scheduled\x20queries','cron','schedule:delete','m\x20ago','next_run_at','just\x20now','retryLimit','Cancelled','\x20schedules','352qrjUht','schedules','Schedule\x20deleted:\x20','padEnd','cyan','success','entries','executing_user_id','\x20scheduled\x20quer','created_at','length','6FSZeWc','18310HyVDLP','\x20matching\x20\x22','in\x20','Updating\x20schedule:\x20','user_name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','create','schedule:list','Creating\x20schedule:\x20','max','description','schedule:run','\x20\x20Timezone:\x20','red','validate','data','jsonl','No\x20scheduled\x20queries\x20found','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','time_zone','4298780WFTazW','\x20\x20β\x20'];a34_0x4646=function(){return _0x55e162;};return a34_0x4646();}import{hyperlink}from'../sdk/util/formatters.js';import a34_0x37eced from'chalk';function formatRelativeTime(_0x392da1){const _0x8a3e29=a34_0x367e,_0x57a6bb=new Date(_0x392da1),_0x1b23fe=new Date(),_0x5a1148=_0x57a6bb['getTime']()-_0x1b23fe[_0x8a3e29(0x16f)](),_0x3c3967=Math[_0x8a3e29(0x165)](_0x5a1148)/0x3e8,_0x215a6a=_0x5a1148<0x0;if(_0x3c3967<0x3c)return _0x215a6a?_0x8a3e29(0x128):'soon';else{if(_0x3c3967<0xe10){const _0x5c8d5e=Math[_0x8a3e29(0x106)](_0x3c3967/0x3c);return _0x215a6a?_0x5c8d5e+_0x8a3e29(0x126):'in\x20'+_0x5c8d5e+'m';}else{if(_0x3c3967<0x15180){const _0x45243a=Math[_0x8a3e29(0x106)](_0x3c3967/0xe10);return _0x215a6a?_0x45243a+_0x8a3e29(0x168):_0x8a3e29(0x13a)+_0x45243a+'h';}else{if(_0x3c3967<0x93a80){const _0xfcb303=Math[_0x8a3e29(0x106)](_0x3c3967/0x15180);return _0x215a6a?_0xfcb303+_0x8a3e29(0x121):_0x8a3e29(0x13a)+_0xfcb303+'d';}else return _0x57a6bb[_0x8a3e29(0x155)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x13f);['description']=a34_0x4e6734(0x123);async[a34_0x4e6734(0x172)](_0x12647e){const _0x5a886c=a34_0x4e6734,{options:_0x157b30,args:_0x43882e,tdx:_0x6f656a}=_0x12647e,_0x3b2074=resolveLimit(_0x157b30[_0x5a886c(0x15e)],DEFAULT_DISPLAY_LIMIT),_0x273a12=_0x43882e[0x0],_0xc6909f=_0x273a12?_0x5a886c(0x161)+_0x273a12+'\x22...':'Listing\x20scheduled\x20queries...',_0x5b854d=await withSpinner(_0xc6909f,()=>_0x6f656a[_0x5a886c(0x12d)][_0x5a886c(0xf3)]({'limit':_0x3b2074,'scheduled':!![],'pattern':_0x273a12}),{'verbose':_0x157b30[_0x5a886c(0x10c)]}),_0x5753ff=_0x5b854d[_0x5a886c(0x147)][_0x5a886c(0x171)],_0x10d343=_0x5b854d['data'][_0x5a886c(0x175)]['has_next_page'],_0x215158=_0x273a12?_0x5a886c(0x139)+_0x273a12+'\x22':'';_0x10d343?console['error'](_0x5a886c(0x10d)+_0x5753ff[_0x5a886c(0x136)]+_0x5a886c(0x12b)+_0x215158+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x5a886c(0x15b)](_0x5a886c(0x157)+_0x5753ff['length']+_0x5a886c(0x134)+(_0x5753ff[_0x5a886c(0x136)]!==0x1?_0x5a886c(0xee):'y')+_0x215158);if(_0x157b30[_0x5a886c(0x16d)]===_0x5a886c(0x110)||_0x157b30['format']===_0x5a886c(0x148)||_0x157b30['format']===_0x5a886c(0x122)||_0x157b30['format']===_0x5a886c(0x120)){const _0x347912=_0x5753ff['map'](_0x32eb59=>({'id':_0x32eb59['id'],'name':_0x32eb59[_0x5a886c(0xeb)],'cron':_0x32eb59['cron'],'database':_0x32eb59['database']?.[_0x5a886c(0xeb)],'type':_0x32eb59[_0x5a886c(0x153)],'timezone':_0x32eb59[_0x5a886c(0x14b)],'user_name':_0x32eb59[_0x5a886c(0x177)]?.[_0x5a886c(0xeb)],'updated_at':_0x32eb59['updated_at'],'next_run_at':_0x32eb59[_0x5a886c(0x127)],'last_job_status':_0x32eb59[_0x5a886c(0x16c)]?.[_0x5a886c(0x105)]}));await handleSDKOutput(_0x347912,_0x157b30);}else{if(_0x5753ff['length']===0x0)console[_0x5a886c(0xf8)](_0x5a886c(0x149));else{const _0x2d06c7=_0x157b30[_0x5a886c(0xfb)],_0x440053=_0x5753ff['map'](_0x2045db=>{const _0x28506a=_0x5a886c,_0x5d8c4b=_0x2045db['last_job']?.[_0x28506a(0x105)]?_0x2045db['last_job'][_0x28506a(0x105)]===_0x28506a(0x131)?'β':'β':'-',_0x51fcb0=_0x2045db[_0x28506a(0x16c)]?.[_0x28506a(0x174)]?formatRelativeTime(_0x2045db[_0x28506a(0x16c)][_0x28506a(0x174)]):_0x28506a(0x162),_0x1caf19=_0x2045db[_0x28506a(0x127)]?formatRelativeTime(_0x2045db[_0x28506a(0x127)]):'-',_0x4b7764=_0x2045db[_0x28506a(0x124)]||'',_0x15aa74=_0x2045db[_0x28506a(0xeb)]||_0x28506a(0x167),_0x142191=getConsoleUrl(_0x2d06c7,_0x28506a(0x173)+_0x2045db['id']);return{'statusIcon':_0x5d8c4b,'lastRun':_0x51fcb0,'nextRun':_0x1caf19,'cron':_0x4b7764,'name':_0x15aa74,'queryUrl':_0x142191,'status':_0x2045db[_0x28506a(0x16c)]?.[_0x28506a(0x105)]};}),_0x3fe37d=Math[_0x5a886c(0x141)](..._0x440053['map'](_0x46c5ad=>_0x46c5ad['lastRun'][_0x5a886c(0x136)])),_0x27029e=Math[_0x5a886c(0x141)](..._0x440053[_0x5a886c(0x108)](_0x1f9701=>_0x1f9701[_0x5a886c(0xea)][_0x5a886c(0x136)])),_0x2a32dc=Math[_0x5a886c(0x141)](..._0x440053[_0x5a886c(0x108)](_0x57dcd1=>_0x57dcd1[_0x5a886c(0x124)][_0x5a886c(0x136)])),_0x422d55=_0x440053['map'](_0x7bd534=>{const _0x118461=_0x5a886c,_0x49f17b=_0x7bd534[_0x118461(0x105)]==='success'?a34_0x37eced[_0x118461(0x107)](_0x7bd534[_0x118461(0x17c)]):_0x7bd534[_0x118461(0x105)]==='error'?a34_0x37eced[_0x118461(0x145)](_0x7bd534['statusIcon']):a34_0x37eced['dim'](_0x7bd534[_0x118461(0x17c)]),_0x3bc897=_0x7bd534[_0x118461(0x15f)][_0x118461(0x12f)](_0x3fe37d),_0x422603=_0x7bd534[_0x118461(0xea)]['padEnd'](_0x27029e),_0xce7e5d=_0x7bd534[_0x118461(0x124)]?a34_0x37eced[_0x118461(0x130)](_0x7bd534[_0x118461(0x124)][_0x118461(0x12f)](_0x2a32dc)):'\x20'['repeat'](_0x2a32dc),_0x5d7d6a=hyperlink(_0x7bd534[_0x118461(0xeb)],_0x7bd534[_0x118461(0x11b)]);return _0x118461(0x152)+_0x49f17b+'\x20'+_0x3bc897+_0x118461(0x14d)+_0x422603+'\x20\x20'+_0xce7e5d+'\x20\x20'+_0x5d7d6a;});await writeOutput(_0x422d55[_0x5a886c(0x117)]('\x0a'),_0x157b30['output'],_0x5a886c(0xf2));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x17d);[a34_0x4e6734(0x142)]=a34_0x4e6734(0x113);[a34_0x4e6734(0x146)](_0x4d8f1b){const _0x44446d=a34_0x4e6734,_0x4b0996=_0x4d8f1b[_0x44446d(0xfd)][0x0];if(!_0x4b0996)return _0x44446d(0x154);return undefined;}async[a34_0x4e6734(0x172)](_0x113c25){const _0x4d9347=a34_0x4e6734,{options:_0x368a0b,args:_0x236511,tdx:_0x25c274}=_0x113c25,_0x45a08c=_0x236511[0x0],_0x37d3ca=await withSpinner('Getting\x20schedule\x20details...',()=>_0x25c274[_0x4d9347(0x12d)][_0x4d9347(0x10f)](_0x45a08c),{'verbose':_0x368a0b[_0x4d9347(0x10c)]}),_0x5b6b3e=_0x37d3ca[_0x4d9347(0x147)],_0x3436e5={'name':_0x5b6b3e[_0x4d9347(0xeb)],'cron':_0x5b6b3e[_0x4d9347(0x124)],'database':_0x5b6b3e[_0x4d9347(0x150)],'type':_0x5b6b3e[_0x4d9347(0x153)],'timezone':_0x5b6b3e[_0x4d9347(0xef)],'user_name':_0x5b6b3e[_0x4d9347(0x13c)],'created_at':_0x5b6b3e[_0x4d9347(0x135)],'engine_version':_0x5b6b3e['engine_version'],'executing_user_id':_0x5b6b3e[_0x4d9347(0x133)],'query':_0x5b6b3e[_0x4d9347(0x179)],'delay':_0x5b6b3e[_0x4d9347(0x10e)],'priority':_0x5b6b3e[_0x4d9347(0x166)],'retry_limit':_0x5b6b3e[_0x4d9347(0x176)],..._0x5b6b3e['result']&&{'result':_0x5b6b3e[_0x4d9347(0xfe)]}};return await handleSingleObjectOutput(_0x3436e5,_0x368a0b),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0xf5);[a34_0x4e6734(0x142)]=a34_0x4e6734(0x17a);[a34_0x4e6734(0x146)](_0x1ac68d){const _0x3c7943=a34_0x4e6734,_0x1fcfc9=_0x1ac68d[_0x3c7943(0xfd)][0x0];if(!_0x1fcfc9)return _0x3c7943(0x16b);const _0x1a8740=_0x1ac68d[_0x3c7943(0x163)];if(!_0x1a8740[_0x3c7943(0x150)])return _0x3c7943(0x159);return undefined;}async[a34_0x4e6734(0x172)](_0x1258a1){const _0x2fc478=a34_0x4e6734,{options:_0x31017d,args:_0x224f40,tdx:_0xd17c54}=_0x1258a1,_0x3e2a22=_0x224f40[0x0],_0x26ef23=_0x31017d,_0x307155=_0x26ef23[_0x2fc478(0x150)],_0x12eac1=_0x26ef23['file'],_0x55c6da=_0x26ef23[_0x2fc478(0x153)]||'trino';let _0x33d45b;try{_0x33d45b=readFileSync(_0x12eac1,_0x2fc478(0xf1))['trim']();}catch(_0x10b890){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2fc478(0x11e)+_0x12eac1,_0x10b890 instanceof Error?_0x10b890:undefined);}if(!_0x33d45b)throw new SDKError(ErrorCode[_0x2fc478(0x178)],'Query\x20file\x20is\x20empty');const _0x401ccc={'database':_0x307155,'query':_0x33d45b,'type':_0x55c6da};if(_0x26ef23['cron'])_0x401ccc['cron']=_0x26ef23[_0x2fc478(0x124)];if(_0x26ef23[_0x2fc478(0xef)])_0x401ccc[_0x2fc478(0xef)]=_0x26ef23['timezone'];if(_0x26ef23[_0x2fc478(0x10e)]!==undefined)_0x401ccc[_0x2fc478(0x10e)]=Number(_0x26ef23['delay']);if(_0x26ef23['priority']!==undefined)_0x401ccc[_0x2fc478(0x166)]=Number(_0x26ef23[_0x2fc478(0x166)]);if(_0x26ef23['retryLimit']!==undefined)_0x401ccc['retry_limit']=Number(_0x26ef23[_0x2fc478(0x129)]);if(_0x26ef23[_0x2fc478(0xfc)])_0x401ccc['engine_version']=_0x26ef23[_0x2fc478(0xfc)];if(_0x26ef23[_0x2fc478(0xfe)])_0x401ccc[_0x2fc478(0xfe)]=_0x26ef23[_0x2fc478(0xfe)];if(_0x31017d['verbose']){console['error'](_0x2fc478(0x140)+_0x3e2a22),console[_0x2fc478(0x15b)](_0x2fc478(0x156)+_0x307155),console[_0x2fc478(0x15b)]('\x20\x20Type:\x20'+_0x55c6da);if(_0x401ccc[_0x2fc478(0x124)])console['error'](_0x2fc478(0x111)+_0x401ccc[_0x2fc478(0x124)]);if(_0x401ccc['timezone'])console['error'](_0x2fc478(0x144)+_0x401ccc[_0x2fc478(0xef)]);}const _0x54ede1=await withSpinner(_0x2fc478(0x116),()=>_0xd17c54[_0x2fc478(0x12d)][_0x2fc478(0x13e)](_0x3e2a22,_0x401ccc),{'verbose':_0x31017d[_0x2fc478(0x10c)]});return console['error']('Schedule\x20created:\x20'+_0x54ede1['data'][_0x2fc478(0xeb)]),await handleSingleObjectOutput(_0x54ede1[_0x2fc478(0x147)],_0x31017d),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x16e);[a34_0x4e6734(0x142)]=a34_0x4e6734(0xf9);[a34_0x4e6734(0x146)](_0x51eb62){const _0x21a7e8=a34_0x4e6734,_0x5c5c08=_0x51eb62[_0x21a7e8(0xfd)][0x0];if(!_0x5c5c08)return _0x21a7e8(0x11d);return undefined;}async[a34_0x4e6734(0x172)](_0x12c6dd){const _0x347cb0=a34_0x4e6734,{options:_0x2c7651,args:_0x1a14d9,tdx:_0x307d2a}=_0x12c6dd,_0x52f77e=_0x1a14d9[0x0],_0xf3ddba=_0x2c7651,_0x26935d={};if(_0xf3ddba['database'])_0x26935d[_0x347cb0(0x150)]=_0xf3ddba[_0x347cb0(0x150)];if(_0xf3ddba['type'])_0x26935d[_0x347cb0(0x153)]=_0xf3ddba[_0x347cb0(0x153)];if(_0xf3ddba[_0x347cb0(0x124)])_0x26935d[_0x347cb0(0x124)]=_0xf3ddba[_0x347cb0(0x124)];if(_0xf3ddba[_0x347cb0(0xef)])_0x26935d[_0x347cb0(0xef)]=_0xf3ddba[_0x347cb0(0xef)];if(_0xf3ddba[_0x347cb0(0x10e)]!==undefined)_0x26935d[_0x347cb0(0x10e)]=Number(_0xf3ddba[_0x347cb0(0x10e)]);if(_0xf3ddba[_0x347cb0(0x166)]!==undefined)_0x26935d[_0x347cb0(0x166)]=Number(_0xf3ddba[_0x347cb0(0x166)]);if(_0xf3ddba[_0x347cb0(0x129)]!==undefined)_0x26935d[_0x347cb0(0x176)]=Number(_0xf3ddba[_0x347cb0(0x129)]);if(_0xf3ddba['engineVersion'])_0x26935d['engine_version']=_0xf3ddba['engineVersion'];if(_0xf3ddba['result'])_0x26935d[_0x347cb0(0xfe)]=_0xf3ddba[_0x347cb0(0xfe)];if(_0xf3ddba[_0x347cb0(0xf6)])try{_0x26935d[_0x347cb0(0x179)]=readFileSync(_0xf3ddba[_0x347cb0(0xf6)],_0x347cb0(0xf1))[_0x347cb0(0x158)]();}catch(_0x274fc1){throw new SDKError(ErrorCode[_0x347cb0(0x178)],'Failed\x20to\x20read\x20file:\x20'+_0xf3ddba[_0x347cb0(0xf6)],_0x274fc1 instanceof Error?_0x274fc1:undefined);}if(Object[_0x347cb0(0xff)](_0x26935d)['length']===0x0)throw new SDKError(ErrorCode[_0x347cb0(0x178)],_0x347cb0(0x11f));if(_0x2c7651[_0x347cb0(0x10c)]){console[_0x347cb0(0x15b)](_0x347cb0(0x13b)+_0x52f77e);for(const [_0x37eb0b,_0x46c7a4]of Object[_0x347cb0(0x132)](_0x26935d)){_0x37eb0b==='query'?console['error']('\x20\x20'+_0x37eb0b+':\x20'+_0x46c7a4[_0x347cb0(0x14e)](0x0,0x32)+_0x347cb0(0x114)):console[_0x347cb0(0x15b)]('\x20\x20'+_0x37eb0b+':\x20'+_0x46c7a4);}}const _0x19ece9=await withSpinner(_0x347cb0(0x11c),()=>_0x307d2a[_0x347cb0(0x12d)][_0x347cb0(0x17b)](_0x52f77e,_0x26935d),{'verbose':_0x2c7651['verbose']});return console[_0x347cb0(0x15b)](_0x347cb0(0x103)+_0x19ece9['data'][_0x347cb0(0xeb)]),await handleSingleObjectOutput(_0x19ece9['data'],_0x2c7651),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x125);[a34_0x4e6734(0x142)]=a34_0x4e6734(0x169);[a34_0x4e6734(0x146)](_0x28c8e4){const _0x218dd7=a34_0x4e6734,_0x4ddea9=_0x28c8e4[_0x218dd7(0xfd)][0x0];if(!_0x4ddea9)return _0x218dd7(0x14a);return undefined;}async[a34_0x4e6734(0x172)](_0x22a40b){const _0x2db397=a34_0x4e6734,{options:_0x511c49,args:_0x3826c8,tdx:_0x5aefd1}=_0x22a40b,_0x410709=_0x3826c8[0x0];if(!_0x511c49[_0x2db397(0x115)]){const _0x228fb4=await confirm(_0x2db397(0x13d)+_0x410709+'\x22?');if(!_0x228fb4)return console[_0x2db397(0x15b)](_0x2db397(0x12a)),0x0;}const _0x2433db=await withSpinner(_0x2db397(0xec),()=>_0x5aefd1[_0x2db397(0x12d)][_0x2db397(0x100)](_0x410709),{'verbose':_0x511c49[_0x2db397(0x10c)]});return console['error'](_0x2db397(0x12e)+_0x2433db[_0x2db397(0x147)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x143);[a34_0x4e6734(0x142)]=a34_0x4e6734(0xf7);['validate'](_0x503431){const _0x5c6858=a34_0x4e6734,_0x180e67=_0x503431[_0x5c6858(0xfd)][0x0];if(!_0x180e67)return _0x5c6858(0x164);return undefined;}async[a34_0x4e6734(0x172)](_0x35dbe6){const _0x55e986=a34_0x4e6734,{options:_0x2aab31,args:_0x49dbe3,tdx:_0x4975be}=_0x35dbe6,_0x9e57f3=_0x49dbe3[0x0],_0x201b75=_0x2aab31,_0x596d4b=_0x201b75['time'],_0x14c6b5=_0x201b75[_0x55e986(0x119)]!==undefined?Number(_0x201b75[_0x55e986(0x119)]):undefined;if(_0x2aab31['verbose']){console[_0x55e986(0x15b)](_0x55e986(0xf0)+_0x9e57f3);if(_0x596d4b)console[_0x55e986(0x15b)](_0x55e986(0xed)+_0x596d4b);if(_0x14c6b5)console[_0x55e986(0x15b)]('\x20\x20Num:\x20'+_0x14c6b5);}const _0x29f7bf=await withSpinner(_0x55e986(0x11a),()=>_0x4975be['schedules'][_0x55e986(0x15c)](_0x9e57f3,{'time':_0x596d4b,'num':_0x14c6b5}),{'verbose':_0x2aab31[_0x55e986(0x10c)]}),_0x5690f6=_0x29f7bf[_0x55e986(0x147)]['jobs'];console[_0x55e986(0x15b)](_0x55e986(0x102)+_0x5690f6[_0x55e986(0x136)]+_0x55e986(0x17e)+(_0x5690f6['length']!==0x1?'s':'')+_0x55e986(0x15d));for(const _0x3cdacc of _0x5690f6){console[_0x55e986(0x15b)]('\x20\x20Job\x20ID:\x20'+_0x3cdacc[_0x55e986(0x10a)]);}return await handleSDKOutput(_0x5690f6,_0x2aab31),0x0;}}function a34_0x367e(_0x1172fc,_0x11436c){_0x1172fc=_0x1172fc-0xea;const _0x4646e5=a34_0x4646();let _0x367e76=_0x4646e5[_0x1172fc];return _0x367e76;}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x4e6734(0xeb)]='schedule:history';[a34_0x4e6734(0x142)]=a34_0x4e6734(0x118);[a34_0x4e6734(0x146)](_0x271949){const _0xcb2978=a34_0x4e6734,_0x1c5a1e=_0x271949[_0xcb2978(0xfd)][0x0];if(!_0x1c5a1e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a34_0x4e6734(0x172)](_0x4ab10a){const _0x1f2474=a34_0x4e6734,{options:_0x3dd733,args:_0x54ccca,tdx:_0x1104cd}=_0x4ab10a,_0x596585=_0x54ccca[0x0],_0x15af05=_0x3dd733,_0x5b1ebf=_0x15af05[_0x1f2474(0x101)]!==undefined?Number(_0x15af05[_0x1f2474(0x101)]):undefined,_0x59ed1f=_0x15af05['to']!==undefined?Number(_0x15af05['to']):undefined,_0x2d68a5=await withSpinner('Getting\x20schedule\x20history...',()=>_0x1104cd[_0x1f2474(0x12d)][_0x1f2474(0x170)](_0x596585,{'from':_0x5b1ebf,'to':_0x59ed1f}),{'verbose':_0x3dd733[_0x1f2474(0x10c)]}),_0x5be4cd=_0x2d68a5[_0x1f2474(0x147)];console['error']('Found\x20'+_0x5be4cd[_0x1f2474(0xf4)]+'\x20execution'+(_0x5be4cd[_0x1f2474(0xf4)]!==0x1?'s':'')+_0x1f2474(0x160)+_0x5be4cd[_0x1f2474(0x101)]+'-'+_0x5be4cd['to']+')');const _0x7b7245=_0x5be4cd[_0x1f2474(0x170)][_0x1f2474(0x108)](_0x1192d4=>({'job_id':_0x1192d4[_0x1f2474(0x10a)],'type':_0x1192d4['type'],'status':_0x1192d4[_0x1f2474(0x105)],'scheduled_at':_0x1192d4[_0x1f2474(0x10b)],'created_at':_0x1192d4['created_at'],'start_at':_0x1192d4['start_at'],'end_at':_0x1192d4[_0x1f2474(0x15a)]}));return await handleSDKOutput(_0x7b7245,_0x3dd733),0x0;}}
|
|
1
|
+
const a34_0x84acad=a34_0x2fe9;(function(_0x3ea896,_0x1e197b){const _0x353b09=a34_0x2fe9,_0x8a179b=_0x3ea896();while(!![]){try{const _0x58b06c=-parseInt(_0x353b09(0x169))/0x1+parseInt(_0x353b09(0x145))/0x2*(-parseInt(_0x353b09(0x1a5))/0x3)+parseInt(_0x353b09(0x16f))/0x4*(parseInt(_0x353b09(0x15f))/0x5)+parseInt(_0x353b09(0x1b5))/0x6+-parseInt(_0x353b09(0x18a))/0x7*(-parseInt(_0x353b09(0x172))/0x8)+parseInt(_0x353b09(0x17f))/0x9+parseInt(_0x353b09(0x164))/0xa*(parseInt(_0x353b09(0x1a4))/0xb);if(_0x58b06c===_0x1e197b)break;else _0x8a179b['push'](_0x8a179b['shift']());}catch(_0x18b108){_0x8a179b['push'](_0x8a179b['shift']());}}}(a34_0x1460,0x2ea03));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a34_0x1460(){const _0x514eff=['...','log','Getting\x20schedule\x20history...','run','cron','\x20matching\x20\x22','\x20created','ended_at','format','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','file','Cancelled','queries','Show\x20schedule\x20details','never','jobs','\x20\x20Job\x20ID:\x20','entries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','1989042prDJyX','356559gAPIyv','time','length','Updating\x20schedule...','Listing\x20scheduled\x20queries...','validate','schedules','trim','options','padEnd','executing_user_id','Running\x20schedule...','\x20\x20Timezone:\x20','Failed\x20to\x20read\x20file:\x20','π
\x20','site','17310dRvPZo','schedule:delete','schedule:run','status','list','map','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','cyan','update','keys','timezone','Showing\x20first\x20','created_at','ies','Schedule\x20deleted:\x20','user_name','Getting\x20schedule\x20details...','output','Creating\x20schedule:\x20','List\x20scheduled\x20queries','result','type','execute','show','Schedule\x20created:\x20','num','2IRPsJi','priority','d\x20ago','substring','table','updated_at','last_job','schedule:update','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20job','schedule:create','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','h\x20ago','green','success','scheduled_at','lastRun','count','schedule:history','next_run_at','description','yes','\x20\x20Num:\x20','schedule:show','Found\x20','verbose','1735UDMxQY','engine_version','schedule:list','args','round','10pjPrJr','trino','name','query','\x20\x20Type:\x20','358450VsiMTD','abs','end_at','Schedule\x20updated:\x20','history','\x20\x20Cron:\x20','816HKExBO','retry_limit','Update\x20a\x20scheduled\x20query','257720hujuiW','error','limit','\x20\x20Time:\x20','getTime','in\x20','\x20execution','user','(unnamed)','from','Deleting\x20schedule...','join','nextRun','3434148DzcjAx','time_zone','create','\x20\x20Database:\x20','INVALID_ARGUMENT','tsv','red','just\x20now','statusIcon','engineVersion','data','7OLSqjn','dim','database','delay','retryLimit','start_at','max'];a34_0x1460=function(){return _0x514eff;};return a34_0x1460();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x2fe9(_0x4a15e0,_0x18757b){_0x4a15e0=_0x4a15e0-0x134;const _0x14604c=a34_0x1460();let _0x2fe987=_0x14604c[_0x4a15e0];return _0x2fe987;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x19dbc2 from'chalk';function formatRelativeTime(_0x143489){const _0x2bd086=a34_0x2fe9,_0x20a13f=new Date(_0x143489),_0x5db05d=new Date(),_0x4029e3=_0x20a13f[_0x2bd086(0x176)]()-_0x5db05d[_0x2bd086(0x176)](),_0x3f4c3b=Math[_0x2bd086(0x16a)](_0x4029e3)/0x3e8,_0x13fd71=_0x4029e3<0x0;if(_0x3f4c3b<0x3c)return _0x13fd71?_0x2bd086(0x186):'soon';else{if(_0x3f4c3b<0xe10){const _0x2c6be7=Math[_0x2bd086(0x163)](_0x3f4c3b/0x3c);return _0x13fd71?_0x2c6be7+'m\x20ago':'in\x20'+_0x2c6be7+'m';}else{if(_0x3f4c3b<0x15180){const _0x5de006=Math['round'](_0x3f4c3b/0xe10);return _0x13fd71?_0x5de006+_0x2bd086(0x151):_0x2bd086(0x177)+_0x5de006+'h';}else{if(_0x3f4c3b<0x93a80){const _0x2991ba=Math[_0x2bd086(0x163)](_0x3f4c3b/0x15180);return _0x13fd71?_0x2991ba+_0x2bd086(0x147):_0x2bd086(0x177)+_0x2991ba+'d';}else return _0x20a13f['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x161);[a34_0x84acad(0x159)]=a34_0x84acad(0x13e);async[a34_0x84acad(0x141)](_0x1034e6){const _0x130e2b=a34_0x84acad,{options:_0x3bb917,args:_0x324afe,tdx:_0x334a92}=_0x1034e6,_0x1dc603=resolveLimit(_0x3bb917[_0x130e2b(0x174)],DEFAULT_DISPLAY_LIMIT),_0x43cee5=_0x324afe[0x0],_0x530d86=_0x43cee5?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x43cee5+'\x22...':_0x130e2b(0x1a9),_0x5a568c=await withSpinner(_0x530d86,()=>_0x334a92[_0x130e2b(0x1ab)]['listQueries']({'limit':_0x1dc603,'scheduled':!![],'pattern':_0x43cee5}),{'verbose':_0x3bb917[_0x130e2b(0x15e)]}),_0x48c4cb=_0x5a568c[_0x130e2b(0x189)][_0x130e2b(0x19d)],_0x3cbd5b=_0x5a568c[_0x130e2b(0x189)]['pagination']['has_next_page'],_0x1da5ba=_0x43cee5?_0x130e2b(0x196)+_0x43cee5+'\x22':'';_0x3cbd5b?console[_0x130e2b(0x173)](_0x130e2b(0x136)+_0x48c4cb[_0x130e2b(0x1a7)]+'\x20schedules'+_0x1da5ba+'\x20(use\x20--limit\x20to\x20see\x20more)'):console['error'](_0x130e2b(0x15d)+_0x48c4cb[_0x130e2b(0x1a7)]+'\x20scheduled\x20quer'+(_0x48c4cb[_0x130e2b(0x1a7)]!==0x1?_0x130e2b(0x138):'y')+_0x1da5ba);if(_0x3bb917[_0x130e2b(0x199)]==='json'||_0x3bb917[_0x130e2b(0x199)]==='jsonl'||_0x3bb917[_0x130e2b(0x199)]===_0x130e2b(0x149)||_0x3bb917[_0x130e2b(0x199)]===_0x130e2b(0x184)){const _0x5bdc57=_0x48c4cb[_0x130e2b(0x1ba)](_0x55316d=>({'id':_0x55316d['id'],'name':_0x55316d['name'],'cron':_0x55316d['cron'],'database':_0x55316d[_0x130e2b(0x18c)]?.[_0x130e2b(0x166)],'type':_0x55316d[_0x130e2b(0x140)],'timezone':_0x55316d[_0x130e2b(0x180)],'user_name':_0x55316d[_0x130e2b(0x179)]?.[_0x130e2b(0x166)],'updated_at':_0x55316d[_0x130e2b(0x14a)],'next_run_at':_0x55316d['next_run_at'],'last_job_status':_0x55316d[_0x130e2b(0x14b)]?.[_0x130e2b(0x1b8)]}));await handleSDKOutput(_0x5bdc57,_0x3bb917);}else{if(_0x48c4cb['length']===0x0)console[_0x130e2b(0x192)]('No\x20scheduled\x20queries\x20found');else{const _0x27768d=_0x3bb917[_0x130e2b(0x1b4)],_0x51a39c=_0x48c4cb[_0x130e2b(0x1ba)](_0x3c6d23=>{const _0x1ff188=_0x130e2b,_0xe56baf=_0x3c6d23[_0x1ff188(0x14b)]?.[_0x1ff188(0x1b8)]?_0x3c6d23[_0x1ff188(0x14b)][_0x1ff188(0x1b8)]===_0x1ff188(0x153)?'β':'β':'-',_0x278fb5=_0x3c6d23['last_job']?.[_0x1ff188(0x198)]?formatRelativeTime(_0x3c6d23[_0x1ff188(0x14b)][_0x1ff188(0x198)]):_0x1ff188(0x19f),_0x2631fb=_0x3c6d23[_0x1ff188(0x158)]?formatRelativeTime(_0x3c6d23[_0x1ff188(0x158)]):'-',_0x243d16=_0x3c6d23[_0x1ff188(0x195)]||'',_0x527f24=_0x3c6d23[_0x1ff188(0x166)]||_0x1ff188(0x17a),_0x221d72=getConsoleUrl(_0x27768d,'/app/queries/editor?queryId='+_0x3c6d23['id']);return{'statusIcon':_0xe56baf,'lastRun':_0x278fb5,'nextRun':_0x2631fb,'cron':_0x243d16,'name':_0x527f24,'queryUrl':_0x221d72,'status':_0x3c6d23['last_job']?.[_0x1ff188(0x1b8)]};}),_0x491581=Math[_0x130e2b(0x190)](..._0x51a39c['map'](_0x228af9=>_0x228af9['lastRun'][_0x130e2b(0x1a7)])),_0x2f3725=Math[_0x130e2b(0x190)](..._0x51a39c[_0x130e2b(0x1ba)](_0x107249=>_0x107249['nextRun'][_0x130e2b(0x1a7)])),_0x287338=Math[_0x130e2b(0x190)](..._0x51a39c[_0x130e2b(0x1ba)](_0x4fdce6=>_0x4fdce6['cron'][_0x130e2b(0x1a7)])),_0x462882=_0x51a39c[_0x130e2b(0x1ba)](_0x5bbd7c=>{const _0x40d462=_0x130e2b,_0x28c1e2=_0x5bbd7c[_0x40d462(0x1b8)]===_0x40d462(0x153)?a34_0x19dbc2[_0x40d462(0x152)](_0x5bbd7c['statusIcon']):_0x5bbd7c[_0x40d462(0x1b8)]===_0x40d462(0x173)?a34_0x19dbc2[_0x40d462(0x185)](_0x5bbd7c[_0x40d462(0x187)]):a34_0x19dbc2[_0x40d462(0x18b)](_0x5bbd7c[_0x40d462(0x187)]),_0x390ce9=_0x5bbd7c[_0x40d462(0x155)][_0x40d462(0x1ae)](_0x491581),_0x1b949e=_0x5bbd7c[_0x40d462(0x17e)]['padEnd'](_0x2f3725),_0x251812=_0x5bbd7c[_0x40d462(0x195)]?a34_0x19dbc2[_0x40d462(0x1bd)](_0x5bbd7c[_0x40d462(0x195)]['padEnd'](_0x287338)):'\x20'['repeat'](_0x287338),_0x409c51=hyperlink(_0x5bbd7c[_0x40d462(0x166)],_0x5bbd7c['queryUrl']);return _0x40d462(0x1b3)+_0x28c1e2+'\x20'+_0x390ce9+'\x20\x20β\x20'+_0x1b949e+'\x20\x20'+_0x251812+'\x20\x20'+_0x409c51;});await writeOutput(_0x462882[_0x130e2b(0x17d)]('\x0a'),_0x3bb917[_0x130e2b(0x13c)],_0x130e2b(0x1b9));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x84acad(0x15c);[a34_0x84acad(0x159)]=a34_0x84acad(0x19e);['validate'](_0x4c4ec6){const _0x280097=a34_0x84acad,_0x242288=_0x4c4ec6[_0x280097(0x162)][0x0];if(!_0x242288)return _0x280097(0x14d);return undefined;}async[a34_0x84acad(0x141)](_0x205b48){const _0x15bf41=a34_0x84acad,{options:_0x91f922,args:_0x904824,tdx:_0x5c03b8}=_0x205b48,_0x6756cd=_0x904824[0x0],_0x24371b=await withSpinner(_0x15bf41(0x13b),()=>_0x5c03b8[_0x15bf41(0x1ab)][_0x15bf41(0x142)](_0x6756cd),{'verbose':_0x91f922[_0x15bf41(0x15e)]}),_0xab4354=_0x24371b[_0x15bf41(0x189)],_0x519474={'name':_0xab4354[_0x15bf41(0x166)],'cron':_0xab4354[_0x15bf41(0x195)],'database':_0xab4354['database'],'type':_0xab4354[_0x15bf41(0x140)],'timezone':_0xab4354[_0x15bf41(0x135)],'user_name':_0xab4354[_0x15bf41(0x13a)],'created_at':_0xab4354['created_at'],'engine_version':_0xab4354[_0x15bf41(0x160)],'executing_user_id':_0xab4354[_0x15bf41(0x1af)],'query':_0xab4354[_0x15bf41(0x167)],'delay':_0xab4354[_0x15bf41(0x18d)],'priority':_0xab4354[_0x15bf41(0x146)],'retry_limit':_0xab4354[_0x15bf41(0x170)],..._0xab4354['result']&&{'result':_0xab4354[_0x15bf41(0x13f)]}};return await handleSingleObjectOutput(_0x519474,_0x91f922),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x14f);['description']='Create\x20a\x20scheduled\x20query';[a34_0x84acad(0x1aa)](_0x34c4bb){const _0x5b32d4=a34_0x84acad,_0x327a27=_0x34c4bb['args'][0x0];if(!_0x327a27)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x467ad1=_0x34c4bb[_0x5b32d4(0x1ad)];if(!_0x467ad1['database'])return _0x5b32d4(0x19a);return undefined;}async[a34_0x84acad(0x141)](_0xad807){const _0x4e3fde=a34_0x84acad,{options:_0x95373,args:_0x52b86a,tdx:_0x535edd}=_0xad807,_0x5935c4=_0x52b86a[0x0],_0x15bb03=_0x95373,_0x16ddc2=_0x15bb03['database'],_0x134e89=_0x15bb03['file'],_0x5cd7d8=_0x15bb03['type']||_0x4e3fde(0x165);let _0x14ea68;try{_0x14ea68=readFileSync(_0x134e89,'utf-8')[_0x4e3fde(0x1ac)]();}catch(_0x3730f0){throw new SDKError(ErrorCode[_0x4e3fde(0x183)],_0x4e3fde(0x1b2)+_0x134e89,_0x3730f0 instanceof Error?_0x3730f0:undefined);}if(!_0x14ea68)throw new SDKError(ErrorCode[_0x4e3fde(0x183)],'Query\x20file\x20is\x20empty');const _0x2779dc={'database':_0x16ddc2,'query':_0x14ea68,'type':_0x5cd7d8};if(_0x15bb03[_0x4e3fde(0x195)])_0x2779dc[_0x4e3fde(0x195)]=_0x15bb03['cron'];if(_0x15bb03[_0x4e3fde(0x135)])_0x2779dc[_0x4e3fde(0x135)]=_0x15bb03[_0x4e3fde(0x135)];if(_0x15bb03['delay']!==undefined)_0x2779dc[_0x4e3fde(0x18d)]=Number(_0x15bb03[_0x4e3fde(0x18d)]);if(_0x15bb03[_0x4e3fde(0x146)]!==undefined)_0x2779dc[_0x4e3fde(0x146)]=Number(_0x15bb03[_0x4e3fde(0x146)]);if(_0x15bb03[_0x4e3fde(0x18e)]!==undefined)_0x2779dc[_0x4e3fde(0x170)]=Number(_0x15bb03[_0x4e3fde(0x18e)]);if(_0x15bb03[_0x4e3fde(0x188)])_0x2779dc[_0x4e3fde(0x160)]=_0x15bb03[_0x4e3fde(0x188)];if(_0x15bb03[_0x4e3fde(0x13f)])_0x2779dc[_0x4e3fde(0x13f)]=_0x15bb03[_0x4e3fde(0x13f)];if(_0x95373[_0x4e3fde(0x15e)]){console[_0x4e3fde(0x173)](_0x4e3fde(0x13d)+_0x5935c4),console['error'](_0x4e3fde(0x182)+_0x16ddc2),console[_0x4e3fde(0x173)](_0x4e3fde(0x168)+_0x5cd7d8);if(_0x2779dc[_0x4e3fde(0x195)])console[_0x4e3fde(0x173)](_0x4e3fde(0x16e)+_0x2779dc['cron']);if(_0x2779dc['timezone'])console[_0x4e3fde(0x173)](_0x4e3fde(0x1b1)+_0x2779dc[_0x4e3fde(0x135)]);}const _0x32076e=await withSpinner('Creating\x20schedule...',()=>_0x535edd[_0x4e3fde(0x1ab)][_0x4e3fde(0x181)](_0x5935c4,_0x2779dc),{'verbose':_0x95373[_0x4e3fde(0x15e)]});return console[_0x4e3fde(0x173)](_0x4e3fde(0x143)+_0x32076e[_0x4e3fde(0x189)]['name']),await handleSingleObjectOutput(_0x32076e[_0x4e3fde(0x189)],_0x95373),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x14c);[a34_0x84acad(0x159)]=a34_0x84acad(0x171);[a34_0x84acad(0x1aa)](_0x4a1b82){const _0x1e5488=a34_0x84acad,_0x411975=_0x4a1b82['args'][0x0];if(!_0x411975)return _0x1e5488(0x1bc);return undefined;}async[a34_0x84acad(0x141)](_0x5b096d){const _0x378385=a34_0x84acad,{options:_0xf38ff6,args:_0x2ac877,tdx:_0x21b96a}=_0x5b096d,_0x2ab865=_0x2ac877[0x0],_0x1aa1b9=_0xf38ff6,_0x3a2aec={};if(_0x1aa1b9[_0x378385(0x18c)])_0x3a2aec['database']=_0x1aa1b9[_0x378385(0x18c)];if(_0x1aa1b9[_0x378385(0x140)])_0x3a2aec[_0x378385(0x140)]=_0x1aa1b9[_0x378385(0x140)];if(_0x1aa1b9[_0x378385(0x195)])_0x3a2aec['cron']=_0x1aa1b9[_0x378385(0x195)];if(_0x1aa1b9[_0x378385(0x135)])_0x3a2aec[_0x378385(0x135)]=_0x1aa1b9[_0x378385(0x135)];if(_0x1aa1b9[_0x378385(0x18d)]!==undefined)_0x3a2aec[_0x378385(0x18d)]=Number(_0x1aa1b9[_0x378385(0x18d)]);if(_0x1aa1b9[_0x378385(0x146)]!==undefined)_0x3a2aec['priority']=Number(_0x1aa1b9[_0x378385(0x146)]);if(_0x1aa1b9['retryLimit']!==undefined)_0x3a2aec[_0x378385(0x170)]=Number(_0x1aa1b9[_0x378385(0x18e)]);if(_0x1aa1b9[_0x378385(0x188)])_0x3a2aec['engine_version']=_0x1aa1b9['engineVersion'];if(_0x1aa1b9[_0x378385(0x13f)])_0x3a2aec[_0x378385(0x13f)]=_0x1aa1b9['result'];if(_0x1aa1b9[_0x378385(0x19b)])try{_0x3a2aec['query']=readFileSync(_0x1aa1b9[_0x378385(0x19b)],'utf-8')[_0x378385(0x1ac)]();}catch(_0x3ea1d2){throw new SDKError(ErrorCode[_0x378385(0x183)],_0x378385(0x1b2)+_0x1aa1b9[_0x378385(0x19b)],_0x3ea1d2 instanceof Error?_0x3ea1d2:undefined);}if(Object[_0x378385(0x134)](_0x3a2aec)['length']===0x0)throw new SDKError(ErrorCode[_0x378385(0x183)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0xf38ff6[_0x378385(0x15e)]){console['error']('Updating\x20schedule:\x20'+_0x2ab865);for(const [_0x569754,_0x250ab0]of Object[_0x378385(0x1a2)](_0x3a2aec)){_0x569754===_0x378385(0x167)?console[_0x378385(0x173)]('\x20\x20'+_0x569754+':\x20'+_0x250ab0[_0x378385(0x148)](0x0,0x32)+_0x378385(0x191)):console[_0x378385(0x173)]('\x20\x20'+_0x569754+':\x20'+_0x250ab0);}}const _0x3c83d9=await withSpinner(_0x378385(0x1a8),()=>_0x21b96a[_0x378385(0x1ab)][_0x378385(0x1be)](_0x2ab865,_0x3a2aec),{'verbose':_0xf38ff6[_0x378385(0x15e)]});return console[_0x378385(0x173)](_0x378385(0x16c)+_0x3c83d9[_0x378385(0x189)][_0x378385(0x166)]),await handleSingleObjectOutput(_0x3c83d9['data'],_0xf38ff6),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x84acad(0x1b6);['description']='Delete\x20a\x20scheduled\x20query';['validate'](_0x50ca28){const _0x25a4ac=a34_0x84acad,_0x55e7a3=_0x50ca28[_0x25a4ac(0x162)][0x0];if(!_0x55e7a3)return _0x25a4ac(0x1a3);return undefined;}async[a34_0x84acad(0x141)](_0x175d88){const _0x3319c5=a34_0x84acad,{options:_0x266942,args:_0x3ff002,tdx:_0xeabd60}=_0x175d88,_0x1a0da1=_0x3ff002[0x0];if(!_0x266942[_0x3319c5(0x15a)]){const _0x208274=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x1a0da1+'\x22?');if(!_0x208274)return console['error'](_0x3319c5(0x19c)),0x0;}const _0x166a11=await withSpinner(_0x3319c5(0x17c),()=>_0xeabd60[_0x3319c5(0x1ab)]['delete'](_0x1a0da1),{'verbose':_0x266942[_0x3319c5(0x15e)]});return console[_0x3319c5(0x173)](_0x3319c5(0x139)+_0x166a11[_0x3319c5(0x189)][_0x3319c5(0x166)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x1b7);['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a34_0x84acad(0x1aa)](_0x13ff56){const _0x51622d=a34_0x84acad,_0x4017eb=_0x13ff56[_0x51622d(0x162)][0x0];if(!_0x4017eb)return _0x51622d(0x1bb);return undefined;}async[a34_0x84acad(0x141)](_0x2fcd83){const _0x2e54e3=a34_0x84acad,{options:_0x2bbd95,args:_0xd127b6,tdx:_0x4cee44}=_0x2fcd83,_0x3952d1=_0xd127b6[0x0],_0x553cfa=_0x2bbd95,_0x9a8bb=_0x553cfa[_0x2e54e3(0x1a6)],_0x1ecad4=_0x553cfa['num']!==undefined?Number(_0x553cfa[_0x2e54e3(0x144)]):undefined;if(_0x2bbd95[_0x2e54e3(0x15e)]){console[_0x2e54e3(0x173)]('Running\x20schedule:\x20'+_0x3952d1);if(_0x9a8bb)console['error'](_0x2e54e3(0x175)+_0x9a8bb);if(_0x1ecad4)console['error'](_0x2e54e3(0x15b)+_0x1ecad4);}const _0x14bbdb=await withSpinner(_0x2e54e3(0x1b0),()=>_0x4cee44[_0x2e54e3(0x1ab)][_0x2e54e3(0x194)](_0x3952d1,{'time':_0x9a8bb,'num':_0x1ecad4}),{'verbose':_0x2bbd95[_0x2e54e3(0x15e)]}),_0x5aea83=_0x14bbdb[_0x2e54e3(0x189)][_0x2e54e3(0x1a0)];console['error']('Schedule\x20run\x20submitted:\x20'+_0x5aea83[_0x2e54e3(0x1a7)]+_0x2e54e3(0x14e)+(_0x5aea83[_0x2e54e3(0x1a7)]!==0x1?'s':'')+_0x2e54e3(0x197));for(const _0x2e31a9 of _0x5aea83){console[_0x2e54e3(0x173)](_0x2e54e3(0x1a1)+_0x2e31a9['job_id']);}return await handleSDKOutput(_0x5aea83,_0x2bbd95),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x157);[a34_0x84acad(0x159)]='Show\x20schedule\x20execution\x20history';[a34_0x84acad(0x1aa)](_0x52488d){const _0x31b5c6=a34_0x84acad,_0xdc03c1=_0x52488d['args'][0x0];if(!_0xdc03c1)return _0x31b5c6(0x150);return undefined;}async[a34_0x84acad(0x141)](_0x91c0a7){const _0x47facd=a34_0x84acad,{options:_0x3e708e,args:_0x10b891,tdx:_0x1de1c4}=_0x91c0a7,_0x1429d6=_0x10b891[0x0],_0x33a48c=_0x3e708e,_0xbafe6a=_0x33a48c[_0x47facd(0x17b)]!==undefined?Number(_0x33a48c[_0x47facd(0x17b)]):undefined,_0x548ffd=_0x33a48c['to']!==undefined?Number(_0x33a48c['to']):undefined,_0x5729d0=await withSpinner(_0x47facd(0x193),()=>_0x1de1c4[_0x47facd(0x1ab)][_0x47facd(0x16d)](_0x1429d6,{'from':_0xbafe6a,'to':_0x548ffd}),{'verbose':_0x3e708e[_0x47facd(0x15e)]}),_0x274542=_0x5729d0[_0x47facd(0x189)];console['error'](_0x47facd(0x15d)+_0x274542['count']+_0x47facd(0x178)+(_0x274542[_0x47facd(0x156)]!==0x1?'s':'')+'\x20(showing\x20'+_0x274542[_0x47facd(0x17b)]+'-'+_0x274542['to']+')');const _0x4f1d03=_0x274542[_0x47facd(0x16d)][_0x47facd(0x1ba)](_0x5a6341=>({'job_id':_0x5a6341['job_id'],'type':_0x5a6341[_0x47facd(0x140)],'status':_0x5a6341['status'],'scheduled_at':_0x5a6341[_0x47facd(0x154)],'created_at':_0x5a6341[_0x47facd(0x137)],'start_at':_0x5a6341[_0x47facd(0x18f)],'end_at':_0x5a6341[_0x47facd(0x16b)]}));return await handleSDKOutput(_0x4f1d03,_0x3e708e),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x1bd46b=a35_0x25c5;(function(_0x50504c,_0x3eb548){const _0x5620f1=a35_0x25c5,_0x5ea8df=_0x50504c();while(!![]){try{const _0x466fff=-parseInt(_0x5620f1(0x196))/0x1*(-parseInt(_0x5620f1(0x18d))/0x2)+parseInt(_0x5620f1(0x19a))/0x3+parseInt(_0x5620f1(0x1c8))/0x4+-parseInt(_0x5620f1(0x15e))/0x5+-parseInt(_0x5620f1(0x166))/0x6*(-parseInt(_0x5620f1(0x1b3))/0x7)+-parseInt(_0x5620f1(0x177))/0x8+-parseInt(_0x5620f1(0x15c))/0x9;if(_0x466fff===_0x3eb548)break;else _0x5ea8df['push'](_0x5ea8df['shift']());}catch(_0x581c4f){_0x5ea8df['push'](_0x5ea8df['shift']());}}}(a35_0x3a3d,0x93ae7));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';function a35_0x3a3d(){const _0x3e1dbc=['Show\x20child\x20segment\x20schema\x20(column\x20types)','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20folder\x20details...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getSegmentSQLFromYaml','resolveParentId','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20folder','Site:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','4597560HXSHcS','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved:\x20','parentSegment','fullPath','SEGMENT_NOT_FOUND','Segment\x20ID:\x20','Folder\x20name:\x20','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20sql\x20--path\x20','\x20[Job\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','error','Resolving\x20path\x20\x27','Fetching\x20SQL\x20for\x20segment...','β\x20Found\x20','Show\x20segment\x20or\x20folder\x20details','Examples:','message','/e/','Resolved\x20parent\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','description','segment:folder:list','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','execute','Resolved\x20type:\x20','trim','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20parent\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','processedRows','segmentId','cyan','verbose','Error:\x20','cause','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getSQLFromYamlFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','listFolders','Fetching\x20folder\x20\x27','red','replace','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','includes','code','Parent\x20name:\x20','content','17593947rdlONk','segment:folder:show','2304360agJClh','name','segmentName','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Show\x20folder\x20or\x20child\x20segment\x20details','json','getSegment','19254xDyklL','Fetching\x20segment\x20details...','toLocaleString','Use:\x20tdx\x20ps\x20show','query','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','jsonl','Usage:\x20tdx\x20sg\x20show\x20<name>','data','folderId','site','INVALID_ARGUMENT','β\x20Query\x20completed:\x20Processed\x20','\x20\x20Segment\x20name:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','path','6513808hqLQvQ','type','Use:\x20tdx\x20ps\x20desc','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentPath','parentFolder','\x20rows\x20','Target\x20path:\x20','segment:show','\x20Opening\x20','getSegmentSQL','Usage:\x20tdx\x20segment\x20describe\x20<path>','getFolder','Show\x20segment\x20folder\x20details','limit','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','stats','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Resolving\x20parent\x20segment\x20\x27','2XfvJih','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','resolveFolderId','Folder\x20ID:\x20','segment','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Path\x20or\x20name\x20is\x20required','SEGMENT_FOLDER_NOT_FOUND','Resolving\x20\x27','1136503YzTeQX','length','log','jobId','1797381YjZgHS','parent','format','Parent\x20ID:\x20','\x27\x20with\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20folder\x20ID:\x20','β\x20Created\x20folder\x20\x27','Creating\x20folder\x20\x27','resolvePathToResource','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','elapsedTimeMillis','β\x20Query\x20failed\x20[','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Fetching\x20SQL\x20from\x20rule...','parentId','Usage:\x20tdx\x20sg\x20desc\x20<name>','getSQLFromServerSegment','\x27...','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','folderPath','Executing\x20segment\x20query...','Resolved\x20parent\x20folder\x20ID:\x20','2072EreVZu','segment:describe','segment:desc','folder','in\x20','Usage:','Fetching\x20parent\x20segment\x20details...','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'];a35_0x3a3d=function(){return _0x3e1dbc;};return a35_0x3a3d();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x1183da from'chalk';async function resolveSegmentTarget(_0x4c691a,_0x1dbb4b,_0x1d7c03){const _0x33cf0f=a35_0x25c5;if(isYamlFilePath(_0x4c691a))try{const _0x18e8be=await resolveYamlFilePath(_0x4c691a);return _0x1d7c03&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x4c691a),console[_0x33cf0f(0x1d6)]('\x20\x20Parent\x20segment:\x20'+_0x18e8be[_0x33cf0f(0x1cb)]),console[_0x33cf0f(0x1d6)](_0x33cf0f(0x174)+_0x18e8be[_0x33cf0f(0x160)]),console['error'](_0x33cf0f(0x147)+(_0x18e8be[_0x33cf0f(0x1b0)]||'(root)')),console[_0x33cf0f(0x1d6)]('\x20\x20Full\x20path:\x20'+_0x18e8be[_0x33cf0f(0x1cc)])),_0x18e8be[_0x33cf0f(0x1cc)];}catch(_0x58fadd){throw new SDKError(ErrorCode[_0x33cf0f(0x172)],_0x33cf0f(0x161)+_0x58fadd['message']);}if(!_0x1dbb4b)throw new SDKError(ErrorCode[_0x33cf0f(0x172)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x1dbb4b+'/'+_0x4c691a;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x1b4);['description']=a35_0x1bd46b(0x1da);async[a35_0x1bd46b(0x142)](_0x50cc83){const _0x26f6ad=a35_0x1bd46b,{options:_0x296724,args:_0x5116fe,tdx:_0x4f3e69}=_0x50cc83,_0x4156f5=_0x5116fe[0x0],_0x56ebc6=!_0x4156f5&&!!_0x296724['parentSegment'],_0x3d6332=_0x4156f5||_0x296724['parentSegment'];if(!_0x3d6332)return console[_0x26f6ad(0x1d6)](_0x26f6ad(0x193)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x183)),console['error'](_0x26f6ad(0x1db)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1c3)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1a4)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1d4)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1bf)),0x1;try{const _0x1785f5=_0x296724[_0x26f6ad(0x17c)];let _0x2b7dff=_0x3d6332;!_0x56ebc6&&_0x1785f5&&!_0x3d6332[_0x26f6ad(0x158)]('/')&&(_0x2b7dff=_0x1785f5+'/'+_0x3d6332,_0x296724[_0x26f6ad(0x14b)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x2b7dff));const _0x3be67d=await withSpinner(_0x26f6ad(0x1d7)+_0x2b7dff+_0x26f6ad(0x1ad),()=>_0x4f3e69[_0x26f6ad(0x191)]['resolvePathToResource'](_0x2b7dff),{'verbose':_0x296724[_0x26f6ad(0x14b)]}),_0x566176=_0x3be67d['data'];_0x296724[_0x26f6ad(0x14b)]&&(console[_0x26f6ad(0x1d6)]('Resolved\x20type:\x20'+_0x566176[_0x26f6ad(0x178)]),console[_0x26f6ad(0x1d6)]('Parent\x20ID:\x20'+_0x566176[_0x26f6ad(0x1aa)]),_0x566176['folderId']&&console[_0x26f6ad(0x1d6)](_0x26f6ad(0x190)+_0x566176[_0x26f6ad(0x170)]),_0x566176[_0x26f6ad(0x149)]&&console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1ce)+_0x566176['segmentId']));if(_0x566176[_0x26f6ad(0x178)]===_0x26f6ad(0x19b)){const _0x4c2035=await withSpinner(_0x26f6ad(0x1b9),()=>_0x4f3e69[_0x26f6ad(0x191)]['getParent'](_0x566176['parentId']),{'verbose':_0x296724[_0x26f6ad(0x14b)]});await handleSingleObjectOutput(_0x4c2035[_0x26f6ad(0x16f)],_0x296724);}else{if(_0x566176[_0x26f6ad(0x178)]===_0x26f6ad(0x1b6)){if(!_0x566176[_0x26f6ad(0x170)])throw new SDKError(ErrorCode[_0x26f6ad(0x194)],_0x26f6ad(0x1bd));const _0x32b457=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4f3e69[_0x26f6ad(0x191)][_0x26f6ad(0x184)](_0x566176[_0x26f6ad(0x170)]),{'verbose':_0x296724[_0x26f6ad(0x14b)]});await handleSingleObjectOutput(_0x32b457[_0x26f6ad(0x16f)],_0x296724);}else{if(_0x566176[_0x26f6ad(0x178)]===_0x26f6ad(0x191)){if(!_0x566176[_0x26f6ad(0x149)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x26f6ad(0x145));const _0x1b9928=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4f3e69['segment'][_0x26f6ad(0x165)](_0x566176[_0x26f6ad(0x1aa)],_0x566176[_0x26f6ad(0x149)]),{'verbose':_0x296724['verbose']});await handleSingleObjectOutput(_0x1b9928[_0x26f6ad(0x16f)],_0x296724);}}}return 0x0;}catch(_0x392711){if(_0x392711 instanceof SDKError)return console[_0x26f6ad(0x1d6)]('Error:\x20'+_0x392711['message']),_0x392711[_0x26f6ad(0x14d)]&&console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1ae)+_0x392711['cause']),0x1;throw _0x392711;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x180);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x1c9);async[a35_0x1bd46b(0x142)](_0x22adb0){const _0x599e56=a35_0x1bd46b,{options:_0xc6c5b8,args:_0x173080,tdx:_0x5c3949}=_0x22adb0,_0x711a6c=_0x173080[0x0];if(!_0x711a6c)return console[_0x599e56(0x1d6)](_0x599e56(0x1df)),console[_0x599e56(0x1d6)](_0x599e56(0x16e)),console['error'](_0x599e56(0x151)),console['error']('Examples:'),console[_0x599e56(0x1d6)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x599e56(0x1d6)](_0x599e56(0x162)),0x1;try{const _0x1b94f1=_0xc6c5b8[_0x599e56(0x1cb)],_0x5b4a6f=await resolveSegmentTarget(_0x711a6c,_0x1b94f1,_0xc6c5b8[_0x599e56(0x14b)]);_0xc6c5b8[_0x599e56(0x14b)]&&console[_0x599e56(0x1d6)](_0x599e56(0x17f)+_0x5b4a6f);const _0x275c74=await withSpinner(_0x599e56(0x195)+_0x711a6c+_0x599e56(0x1ad),()=>_0x5c3949[_0x599e56(0x191)]['resolvePathToResource'](_0x5b4a6f),{'verbose':_0xc6c5b8['verbose']}),_0x13e956=_0x275c74[_0x599e56(0x16f)];_0xc6c5b8[_0x599e56(0x14b)]&&(console['error'](_0x599e56(0x143)+_0x13e956[_0x599e56(0x178)]),console[_0x599e56(0x1d6)](_0x599e56(0x19d)+_0x13e956[_0x599e56(0x1aa)]));if(_0x13e956[_0x599e56(0x178)]==='folder')return console[_0x599e56(0x1d6)](_0x599e56(0x16b)),console[_0x599e56(0x1d6)](_0x599e56(0x188)),0x1;if(_0x13e956[_0x599e56(0x178)]===_0x599e56(0x19b))return console[_0x599e56(0x1d6)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x599e56(0x1d6)](_0x599e56(0x169)),0x1;if(!_0x13e956[_0x599e56(0x149)])throw new SDKError(ErrorCode[_0x599e56(0x1cd)],_0x599e56(0x145));const _0x5f0200=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5c3949[_0x599e56(0x191)][_0x599e56(0x182)](_0x13e956[_0x599e56(0x1aa)],_0x13e956['segmentId']),{'verbose':_0xc6c5b8[_0x599e56(0x14b)]});let _0x2a9482=_0x5f0200[_0x599e56(0x16f)];const _0x13638a=resolveLimit(_0xc6c5b8[_0x599e56(0x186)],DEFAULT_DISPLAY_LIMIT),_0x1a4e44=/\bLIMIT\s+\d+/i['test'](_0x2a9482);!_0x1a4e44&&(_0x2a9482=_0x2a9482[_0x599e56(0x144)]()[_0x599e56(0x156)](/;+$/,''),_0x2a9482=_0x599e56(0x14e)+_0x2a9482+_0x599e56(0x18a)+_0x13638a);_0xc6c5b8[_0x599e56(0x14b)]&&console[_0x599e56(0x1d6)]('SQL\x20query:\x0a'+_0x2a9482);const _0xbeb421=await withProgressSpinner(_0x599e56(0x1b1),async _0x20f896=>{const _0x5673c6=_0x599e56,_0xc623b1=await _0x5c3949[_0x5673c6(0x16a)]['execute'](_0x2a9482,{'catalog':'td','schema':'information_schema','onJobId':_0x187afd=>{_0x20f896['setJobId'](_0x187afd);}});return _0xc623b1;},{'verbose':_0xc6c5b8[_0x599e56(0x14b)]}),_0x43d7eb=_0xbeb421[_0x599e56(0x16f)],_0xb792f0=_0x43d7eb['jobId']?_0x599e56(0x1d3)+_0x43d7eb[_0x599e56(0x199)]+']':'';return console[_0x599e56(0x1d6)](_0x599e56(0x173)+_0x43d7eb[_0x599e56(0x189)][_0x599e56(0x148)][_0x599e56(0x168)]()+_0x599e56(0x17e)+(_0x599e56(0x1b7)+formatElapsed(_0x43d7eb[_0x599e56(0x189)][_0x599e56(0x1a5)])+_0xb792f0)),await handleQueryOutput(_0x43d7eb,_0xc6c5b8),0x0;}catch(_0x5369d7){if(_0x5369d7 instanceof SDKError)return console[_0x599e56(0x1d6)](_0x599e56(0x1a6)+_0x5369d7[_0x599e56(0x159)]+']'),console[_0x599e56(0x1d6)]('\x0a'+_0x5369d7[_0x599e56(0x1dc)]),0x1;throw _0x5369d7;}}}function a35_0x25c5(_0xcf8aba,_0x2ba5b8){_0xcf8aba=_0xcf8aba-0x140;const _0x3a3df9=a35_0x3a3d();let _0x25c508=_0x3a3df9[_0xcf8aba];return _0x25c508;}export class SegmentFolderListCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x140);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x1d5);async[a35_0x1bd46b(0x142)](_0x1758b0){const _0x552e60=a35_0x1bd46b,{options:_0x3ad68,args:_0x36ed4f,tdx:_0x5cc794}=_0x1758b0;if(_0x36ed4f[_0x552e60(0x197)]===0x0)return console['error'](_0x552e60(0x1a7)),console[_0x552e60(0x1d6)](_0x552e60(0x18b)),0x1;const _0x1d4290=_0x36ed4f[0x0];try{_0x3ad68[_0x552e60(0x14b)]&&(console['error'](_0x552e60(0x1c6)+_0x3ad68[_0x552e60(0x171)]),console[_0x552e60(0x1d6)]('Parent\x20name:\x20'+_0x1d4290));const _0x42aa4f=await withSpinner(_0x552e60(0x18c)+_0x1d4290+_0x552e60(0x1ad),()=>_0x5cc794[_0x552e60(0x191)][_0x552e60(0x1c1)](_0x1d4290),{'verbose':_0x3ad68['verbose']}),_0x24be95=_0x42aa4f[_0x552e60(0x16f)];_0x3ad68[_0x552e60(0x14b)]&&console['error'](_0x552e60(0x1de)+_0x24be95);const _0x461b3d=await withSpinner(_0x552e60(0x1d0)+_0x1d4290+_0x552e60(0x1ad),()=>_0x5cc794[_0x552e60(0x191)][_0x552e60(0x153)](_0x24be95),{'verbose':_0x3ad68[_0x552e60(0x14b)]}),_0x245b32=_0x461b3d['data'];return console['error'](_0x552e60(0x1d9)+_0x245b32[_0x552e60(0x197)]+_0x552e60(0x1c5)+(_0x245b32[_0x552e60(0x197)]!==0x1?'s':'')),await handleSDKOutput(_0x245b32,_0x3ad68),0x0;}catch(_0x4455d2){if(_0x4455d2 instanceof SDKError)return console[_0x552e60(0x1d6)](_0x552e60(0x14c)+_0x4455d2[_0x552e60(0x1dc)]),_0x4455d2['cause']&&console[_0x552e60(0x1d6)]('\x20\x20Cause:\x20'+_0x4455d2['cause']),0x1;throw _0x4455d2;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x1bd46b(0x15d);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x185);async['execute'](_0x2857cd){const _0x38c87e=a35_0x1bd46b,{options:_0x5d55d8,args:_0x353af0,tdx:_0x1cb4b3}=_0x2857cd;if(_0x353af0['length']===0x0)return console['error'](_0x38c87e(0x19f)),console[_0x38c87e(0x1d6)](_0x38c87e(0x1af)),0x1;try{const {parentId:_0x29a5ca,childId:_0x562ea2}=parseSegmentRef(_0x353af0[0x0]);_0x5d55d8[_0x38c87e(0x14b)]&&(console[_0x38c87e(0x1d6)](_0x38c87e(0x1c6)+_0x5d55d8[_0x38c87e(0x171)]),console[_0x38c87e(0x1d6)](_0x38c87e(0x15a)+_0x29a5ca),_0x562ea2&&console[_0x38c87e(0x1d6)]('Folder\x20name:\x20'+_0x562ea2));if(!_0x562ea2)return console[_0x38c87e(0x1d6)](_0x38c87e(0x17a)),0x1;const _0x26391a=await withSpinner(_0x38c87e(0x18c)+_0x29a5ca+_0x38c87e(0x1ad),()=>_0x1cb4b3[_0x38c87e(0x191)][_0x38c87e(0x1c1)](_0x29a5ca),{'verbose':_0x5d55d8['verbose']}),_0x5e4ac2=_0x26391a[_0x38c87e(0x16f)];_0x5d55d8[_0x38c87e(0x14b)]&&console[_0x38c87e(0x1d6)]('Resolved\x20parent\x20ID:\x20'+_0x5e4ac2);const _0x336758=await withSpinner('Resolving\x20folder\x20\x27'+_0x562ea2+_0x38c87e(0x1ad),()=>_0x1cb4b3['segment'][_0x38c87e(0x18f)](_0x5e4ac2,_0x562ea2),{'verbose':_0x5d55d8[_0x38c87e(0x14b)]}),_0x115f29=_0x336758[_0x38c87e(0x16f)];_0x5d55d8[_0x38c87e(0x14b)]&&console[_0x38c87e(0x1d6)](_0x38c87e(0x1a0)+_0x115f29);const _0x5465ac=await withSpinner(_0x38c87e(0x154)+_0x562ea2+_0x38c87e(0x1ad),()=>_0x1cb4b3[_0x38c87e(0x191)][_0x38c87e(0x184)](_0x115f29),{'verbose':_0x5d55d8[_0x38c87e(0x14b)]});return await handleSDKOutput([_0x5465ac[_0x38c87e(0x16f)]],_0x5d55d8),0x0;}catch(_0x2cad47){if(_0x2cad47 instanceof SDKError)return console[_0x38c87e(0x1d6)](_0x38c87e(0x14c)+_0x2cad47[_0x38c87e(0x1dc)]),_0x2cad47[_0x38c87e(0x14d)]&&console['error'](_0x38c87e(0x1ae)+_0x2cad47[_0x38c87e(0x14d)]),0x1;throw _0x2cad47;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]='segment:sql';['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x68193e){const _0x5305aa=a35_0x1bd46b,{options:_0x2fdecf,args:_0x30536b}=_0x68193e,_0x68f04a=_0x2fdecf,_0x2de8ef=_0x68f04a[_0x5305aa(0x176)],_0x4861f9=_0x30536b[0x0];if(!_0x4861f9&&!_0x2de8ef)return console[_0x5305aa(0x1d6)](a35_0x1183da[_0x5305aa(0x155)](_0x5305aa(0x1c4))),console[_0x5305aa(0x1d6)](_0x5305aa(0x1b8)),console['error'](_0x5305aa(0x192)),console[_0x5305aa(0x1d6)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console['error'](_0x5305aa(0x1db)),console[_0x5305aa(0x1d6)](_0x5305aa(0x1c7)),console['error']('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x4861f9&&_0x2de8ef)return console[_0x5305aa(0x1d6)](a35_0x1183da[_0x5305aa(0x155)](_0x5305aa(0x1ba))),0x1;try{let _0x54ce44;if(_0x2de8ef)_0x54ce44=await this[_0x5305aa(0x150)](_0x2de8ef,_0x68193e);else{if(isYamlFilePath(_0x4861f9))return console[_0x5305aa(0x1d6)](a35_0x1183da[_0x5305aa(0x155)](_0x5305aa(0x175))),console[_0x5305aa(0x1d6)](_0x5305aa(0x1d2)+_0x4861f9),0x1;else _0x54ce44=await this[_0x5305aa(0x1ac)](_0x4861f9,_0x68193e);}return _0x2fdecf[_0x5305aa(0x19c)]===_0x5305aa(0x164)||_0x2fdecf[_0x5305aa(0x19c)]===_0x5305aa(0x16d)?await handleSDKOutput([{'sql':_0x54ce44}],_0x2fdecf):console[_0x5305aa(0x198)](_0x54ce44),0x0;}catch(_0x301c9d){if(_0x301c9d instanceof SDKError)return console[_0x5305aa(0x1d6)](_0x5305aa(0x14c)+_0x301c9d[_0x5305aa(0x1dc)]),_0x301c9d['cause']&&console[_0x5305aa(0x1d6)](_0x5305aa(0x1ae)+_0x301c9d[_0x5305aa(0x14d)]),0x1;throw _0x301c9d;}}async[a35_0x1bd46b(0x150)](_0x1558e1,_0x482ab9){const _0x308610=a35_0x1bd46b,{options:_0x59ad2d,tdx:_0x2dbc86}=_0x482ab9;let _0x3eba47;try{_0x3eba47=await resolveYamlFilePath(_0x1558e1);}catch(_0x4f7b1a){throw new SDKError(ErrorCode[_0x308610(0x172)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4f7b1a[_0x308610(0x1dc)]);}_0x59ad2d[_0x308610(0x14b)]&&console['error'](_0x308610(0x1ca)+_0x3eba47['parentSegment']+'/'+_0x3eba47[_0x308610(0x160)]);const _0xda30f4=await withSpinner(_0x308610(0x1a9),()=>_0x2dbc86[_0x308610(0x191)][_0x308610(0x1c0)](_0x3eba47[_0x308610(0x15b)],_0x3eba47[_0x308610(0x1cb)],_0x3eba47[_0x308610(0x160)]),{'verbose':_0x59ad2d['verbose']});return _0xda30f4[_0x308610(0x16f)];}async[a35_0x1bd46b(0x1ac)](_0x5003ea,_0x4f55ec){const _0x537663=a35_0x1bd46b,{options:_0x3a56df,tdx:_0x595a6d}=_0x4f55ec,_0x2946ad=_0x3a56df[_0x537663(0x1cb)],_0x5e41d1=await resolveSegmentTarget(_0x5003ea,_0x2946ad,_0x3a56df[_0x537663(0x14b)]);_0x3a56df[_0x537663(0x14b)]&&console[_0x537663(0x1d6)](_0x537663(0x17f)+_0x5e41d1);const _0x53654c=await withSpinner(_0x537663(0x195)+_0x5003ea+_0x537663(0x1ad),()=>_0x595a6d[_0x537663(0x191)][_0x537663(0x1a3)](_0x5e41d1),{'verbose':_0x3a56df[_0x537663(0x14b)]}),_0x300396=_0x53654c['data'];_0x3a56df[_0x537663(0x14b)]&&(console['error'](_0x537663(0x143)+_0x300396[_0x537663(0x178)]),console[_0x537663(0x1d6)](_0x537663(0x19d)+_0x300396['parentId']));if(_0x300396['type']===_0x537663(0x1b6))throw new SDKError(ErrorCode[_0x537663(0x172)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x300396[_0x537663(0x178)]===_0x537663(0x19b))throw new SDKError(ErrorCode[_0x537663(0x172)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x300396[_0x537663(0x149)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30a74a=await withSpinner(_0x537663(0x1d8),()=>_0x595a6d[_0x537663(0x191)][_0x537663(0x182)](_0x300396[_0x537663(0x1aa)],_0x300396['segmentId']),{'verbose':_0x3a56df[_0x537663(0x14b)]});return _0x30a74a[_0x537663(0x16f)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]='segment:folder:create';['description']='Create\x20segment\x20folder\x20for\x20organization';async[a35_0x1bd46b(0x142)](_0x392688){const _0x1c4ce5=a35_0x1bd46b,{options:_0x2511f4,args:_0x46ecbd,tdx:_0xea132c}=_0x392688,_0xd87fbb=_0x2511f4;if(_0x46ecbd['length']<0x2)return console[_0x1c4ce5(0x1d6)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x17b)),0x1;const _0x30ec04=_0x46ecbd[0x0],_0x40f541=_0x46ecbd[0x1];_0xd87fbb['verbose']&&(console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1c6)+_0xd87fbb[_0x1c4ce5(0x171)]),console[_0x1c4ce5(0x1d6)]('Parent\x20segment:\x20'+_0x30ec04),console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1cf)+_0x40f541));let _0x1f4440;if(_0xd87fbb[_0x1c4ce5(0x17d)]){const _0x268b3e=_0xd87fbb[_0x1c4ce5(0x17d)],_0x526738=await withSpinner(_0x1c4ce5(0x18c)+_0x30ec04+'\x27...',()=>_0xea132c[_0x1c4ce5(0x191)][_0x1c4ce5(0x1c1)](_0x30ec04),{'verbose':_0xd87fbb['verbose']}),_0x1d2ee2=_0x526738[_0x1c4ce5(0x16f)],_0x510db0=await withSpinner(_0x1c4ce5(0x146)+_0x268b3e+'\x27...',()=>_0xea132c[_0x1c4ce5(0x191)][_0x1c4ce5(0x18f)](_0x1d2ee2,_0x268b3e),{'verbose':_0xd87fbb[_0x1c4ce5(0x14b)]});_0x1f4440=_0x510db0['data'],_0xd87fbb[_0x1c4ce5(0x14b)]&&console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1b2)+_0x1f4440);}const _0x260fa6={'name':_0x40f541,'description':_0xd87fbb[_0x1c4ce5(0x1e0)],'parentFolderId':_0x1f4440},_0x572ed9=await withSpinner(_0x1c4ce5(0x1a2)+_0x40f541+_0x1c4ce5(0x1ad),()=>_0xea132c[_0x1c4ce5(0x191)]['createFolder'](_0x30ec04,_0x260fa6),{'verbose':_0xd87fbb['verbose']}),_0x329a6c=_0x572ed9[_0x1c4ce5(0x16f)];return console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1a1)+_0x329a6c[_0x1c4ce5(0x15f)]+_0x1c4ce5(0x19e)+_0x329a6c['id']),await handleSDKOutput([_0x329a6c],_0xd87fbb),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]='segment:view';['description']=a35_0x1bd46b(0x163);async[a35_0x1bd46b(0x142)](_0x287a2e){const _0x524651=a35_0x1bd46b,{options:_0x51722f,args:_0x158f46,tdx:_0x1055eb}=_0x287a2e,_0x3adf97=_0x158f46[0x0];if(!_0x3adf97)return console[_0x524651(0x1d6)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x524651(0x1a8)),console[_0x524651(0x1d6)](_0x524651(0x157)),console[_0x524651(0x1d6)]('Options:'),console[_0x524651(0x1d6)](_0x524651(0x1c2)),console[_0x524651(0x1d6)](_0x524651(0x1db)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x524651(0x1d6)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x524651(0x1d1)),console['error'](_0x524651(0x14f)),0x1;try{const _0x4ea44e=_0x51722f[_0x524651(0x1cb)],_0x25c78c=await resolveSegmentTarget(_0x3adf97,_0x4ea44e,_0x51722f[_0x524651(0x14b)]);_0x51722f[_0x524651(0x14b)]&&console[_0x524651(0x1d6)](_0x524651(0x17f)+_0x25c78c);const _0x1ea919=await withSpinner(_0x524651(0x195)+_0x3adf97+_0x524651(0x1ad),()=>_0x1055eb[_0x524651(0x191)][_0x524651(0x1a3)](_0x25c78c),{'verbose':_0x51722f[_0x524651(0x14b)]}),_0x987aef=_0x1ea919['data'];_0x51722f[_0x524651(0x14b)]&&(console[_0x524651(0x1d6)](_0x524651(0x143)+_0x987aef[_0x524651(0x178)]),console[_0x524651(0x1d6)](_0x524651(0x19d)+_0x987aef['parentId']),_0x987aef[_0x524651(0x170)]&&console[_0x524651(0x1d6)](_0x524651(0x190)+_0x987aef['folderId']),_0x987aef['segmentId']&&console[_0x524651(0x1d6)](_0x524651(0x1ce)+_0x987aef[_0x524651(0x149)]));if(_0x51722f['web']){if(_0x987aef['type']==='folder')return console[_0x524651(0x1d6)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x987aef['type']===_0x524651(0x19b))return console[_0x524651(0x1d6)](_0x524651(0x18e)),console[_0x524651(0x1d6)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x987aef['segmentId'])throw new SDKError(ErrorCode[_0x524651(0x1cd)],_0x524651(0x145));const _0x1944c7=getConsoleNextUrl(_0x51722f[_0x524651(0x171)],'/app/ps/'+_0x987aef[_0x524651(0x1aa)]+'/e/'+_0x987aef[_0x524651(0x149)]);return console[_0x524651(0x1d6)](a35_0x1183da['green']('β')+_0x524651(0x181)+a35_0x1183da[_0x524651(0x14a)](_0x1944c7)),openBrowser(_0x1944c7),0x0;}if(_0x987aef['type']==='folder'){if(!_0x987aef['folderId'])throw new SDKError(ErrorCode[_0x524651(0x194)],_0x524651(0x1bd));const _0x424d1f=await withSpinner(_0x524651(0x1be),()=>_0x1055eb[_0x524651(0x191)][_0x524651(0x184)](_0x987aef[_0x524651(0x170)]),{'verbose':_0x51722f[_0x524651(0x14b)]});await handleSingleObjectOutput(_0x424d1f['data'],_0x51722f);}else{if(_0x987aef[_0x524651(0x178)]==='segment'){if(!_0x987aef[_0x524651(0x149)])throw new SDKError(ErrorCode[_0x524651(0x1cd)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x23b3b9=await withSpinner(_0x524651(0x167),()=>_0x1055eb['segment'][_0x524651(0x165)](_0x987aef['parentId'],_0x987aef[_0x524651(0x149)]),{'verbose':_0x51722f[_0x524651(0x14b)]}),_0x511e7f=getConsoleNextUrl(_0x51722f[_0x524651(0x171)],'/app/ps/'+_0x987aef[_0x524651(0x1aa)]+_0x524651(0x1dd)+_0x987aef[_0x524651(0x149)]),_0x41e031=_0x23b3b9[_0x524651(0x16f)];_0x41e031['url']=_0x511e7f,await handleSingleObjectOutput(_0x41e031,_0x51722f);}else return console[_0x524651(0x1d6)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x524651(0x1d6)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x23712b){if(_0x23712b instanceof SDKError)return console[_0x524651(0x1d6)](_0x524651(0x14c)+_0x23712b[_0x524651(0x1dc)]),_0x23712b[_0x524651(0x14d)]&&console[_0x524651(0x1d6)](_0x524651(0x1ae)+_0x23712b[_0x524651(0x14d)]),0x1;throw _0x23712b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x1b5);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x1bc);async[a35_0x1bd46b(0x142)](_0xa8369d){const _0x36eab7=a35_0x1bd46b,{options:_0x476c30,args:_0x2e8d30,tdx:_0x4fbd7f}=_0xa8369d,_0x1f94ac=_0x2e8d30[0x0];if(!_0x1f94ac)return console[_0x36eab7(0x1d6)](_0x36eab7(0x1df)),console['error'](_0x36eab7(0x1ab)),console[_0x36eab7(0x1d6)](_0x36eab7(0x16c)),console[_0x36eab7(0x1d6)](_0x36eab7(0x1db)),console[_0x36eab7(0x1d6)](_0x36eab7(0x141)),console[_0x36eab7(0x1d6)](_0x36eab7(0x152)),0x1;try{const _0x2ba369=_0x476c30[_0x36eab7(0x1cb)],_0x4f74cb=await resolveSegmentTarget(_0x1f94ac,_0x2ba369,_0x476c30[_0x36eab7(0x14b)]);_0x476c30[_0x36eab7(0x14b)]&&console[_0x36eab7(0x1d6)](_0x36eab7(0x17f)+_0x4f74cb);const _0xaabe7b=await withSpinner(_0x36eab7(0x195)+_0x1f94ac+'\x27...',()=>_0x4fbd7f[_0x36eab7(0x191)]['resolvePathToResource'](_0x4f74cb),{'verbose':_0x476c30[_0x36eab7(0x14b)]}),_0x38bd3e=_0xaabe7b[_0x36eab7(0x16f)];_0x476c30[_0x36eab7(0x14b)]&&(console[_0x36eab7(0x1d6)](_0x36eab7(0x143)+_0x38bd3e[_0x36eab7(0x178)]),console[_0x36eab7(0x1d6)]('Parent\x20ID:\x20'+_0x38bd3e[_0x36eab7(0x1aa)]));if(_0x38bd3e[_0x36eab7(0x178)]===_0x36eab7(0x1b6))return console[_0x36eab7(0x1d6)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x36eab7(0x1bb)),0x1;if(_0x38bd3e['type']===_0x36eab7(0x19b))return console[_0x36eab7(0x1d6)](_0x36eab7(0x187)),console[_0x36eab7(0x1d6)](_0x36eab7(0x179)),0x1;if(!_0x38bd3e['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x36eab7(0x145));const _0x568c74=await withSpinner(_0x36eab7(0x1d8),()=>_0x4fbd7f[_0x36eab7(0x191)][_0x36eab7(0x182)](_0x38bd3e[_0x36eab7(0x1aa)],_0x38bd3e['segmentId']),{'verbose':_0x476c30[_0x36eab7(0x14b)]}),_0x2a58c4=_0x568c74[_0x36eab7(0x16f)],_0x21315c=await executeSchemaQuery(_0x2a58c4,_0x4fbd7f,_0x476c30);return await handleQueryOutput(_0x21315c,_0x476c30),0x0;}catch(_0x357813){if(_0x357813 instanceof SDKError)return console[_0x36eab7(0x1d6)]('Error:\x20'+_0x357813[_0x36eab7(0x1dc)]),_0x357813[_0x36eab7(0x14d)]&&console[_0x36eab7(0x1d6)](_0x36eab7(0x1ae)+_0x357813[_0x36eab7(0x14d)]),0x1;throw _0x357813;}}}
|
|
1
|
+
const a35_0x9ef3f1=a35_0x3485;(function(_0x46049c,_0x646e0c){const _0x16fc67=a35_0x3485,_0x23c9a4=_0x46049c();while(!![]){try{const _0xc9e2b1=parseInt(_0x16fc67(0x11a))/0x1*(-parseInt(_0x16fc67(0x166))/0x2)+parseInt(_0x16fc67(0x134))/0x3*(-parseInt(_0x16fc67(0x158))/0x4)+-parseInt(_0x16fc67(0x18d))/0x5+-parseInt(_0x16fc67(0x122))/0x6+parseInt(_0x16fc67(0x117))/0x7+-parseInt(_0x16fc67(0x12c))/0x8+parseInt(_0x16fc67(0x114))/0x9*(parseInt(_0x16fc67(0x150))/0xa);if(_0xc9e2b1===_0x646e0c)break;else _0x23c9a4['push'](_0x23c9a4['shift']());}catch(_0x28b60b){_0x23c9a4['push'](_0x23c9a4['shift']());}}}(a35_0x300d,0x8726d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a35_0x300d(){const _0x32f6c9=['Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','jsonl','1GlrvYp','Options:','web','Resolving\x20folder\x20\x27','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','getSegmentSQL','\x20\x20Parent\x20segment:\x20','\x20Opening\x20','3270636bZlVKC','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','β\x20Created\x20folder\x20\x27','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','code','name','\x20[Job\x20ID:\x20','resolveParentId','\x20\x20Segment\x20name:\x20','getSQLFromServerSegment','6019080KwIqVl','β\x20Found\x20','format','(root)','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:sql','3vjMTXq','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','SEGMENT_FOLDER_NOT_FOUND','Resolved\x20relative\x20path\x20to:\x20','Examples:','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','segment:describe','Use:\x20tdx\x20ps\x20desc','segment:folder:show','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Parent\x20name:\x20','getSegmentSQLFromYaml','segment:view','information_schema','Fetching\x20SQL\x20from\x20rule...','\x20\x20Cause:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Fetching\x20folder\x20details...','/e/','folder','segment:desc','Error:\x20Path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20parent\x20segment\x20\x27','Create\x20segment\x20folder\x20for\x20organization','execute','10DWNrSB','\x27...','parentFolder','Listing\x20folders\x20for\x20parent\x20\x27','cause','Creating\x20folder\x20\x27','Show\x20segment\x20folder\x20details','stats','2166436hMsLUx','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Resolving\x20path\x20\x27','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Show\x20segment\x20or\x20folder\x20details','verbose','Fetching\x20segment\x20details...','resolvePathToResource','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20sql\x20--path\x20','531680BYVhTp','folderId','error','Usage:','\x27\x20with\x20ID:\x20','type','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20SQL\x20for\x20segment...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','content','parentSegment','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','log','Resolving\x20\x27','in\x20','site','\x20\x20Folder\x20path:\x20','segmentId','Folder\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','elapsedTimeMillis','Folder\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','length','Fetching\x20folder\x20\x27','cyan','test','Resolved\x20YAML\x20file:\x20','Resolved\x20type:\x20','Segment\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','INVALID_ARGUMENT','Resolved\x20parent\x20ID:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20rows\x20','processedRows','SQL\x20query:\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','1998950HirnHQ','limit','parentId','Resolving\x20parent\x20folder\x20\x27','\x20folder','description','message','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','red','segment:show','getFolder','Show\x20child\x20segment\x20schema\x20(column\x20types)','segmentName','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20describe\x20<path>','segmentPath','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','getSQLFromYamlFile','path','Parent\x20ID:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','setJobId','Site:\x20','query','getParent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Target\x20path:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','fullPath','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Folder\x20name:\x20','jobId','segment','SEGMENT_NOT_FOUND','Use:\x20tdx\x20ps\x20view\x20-w','Error:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','json','data','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','trim','20366163maNfNJ','toLocaleString','parent','5567828RQqofA'];a35_0x300d=function(){return _0x32f6c9;};return a35_0x300d();}import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x5e08f4 from'chalk';async function resolveSegmentTarget(_0x5c8f31,_0xcb72c4,_0x30a49c){const _0x44391=a35_0x3485;if(isYamlFilePath(_0x5c8f31))try{const _0x1f0dde=await resolveYamlFilePath(_0x5c8f31);return _0x30a49c&&(console['error'](_0x44391(0x182)+_0x5c8f31),console[_0x44391(0x168)](_0x44391(0x120)+_0x1f0dde[_0x44391(0x170)]),console[_0x44391(0x168)](_0x44391(0x12a)+_0x1f0dde[_0x44391(0x199)]),console['error'](_0x44391(0x177)+(_0x1f0dde['folderPath']||_0x44391(0x12f))),console[_0x44391(0x168)]('\x20\x20Full\x20path:\x20'+_0x1f0dde[_0x44391(0x1ad)])),_0x1f0dde['fullPath'];}catch(_0x38b2d5){throw new SDKError(ErrorCode[_0x44391(0x186)],_0x44391(0x1b9)+_0x38b2d5['message']);}if(!_0xcb72c4)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0xcb72c4+'/'+_0x5c8f31;}export class SegmentDescribeCommand extends BaseCommand{['name']=a35_0x9ef3f1(0x13a);['description']=a35_0x9ef3f1(0x15e);async[a35_0x9ef3f1(0x14f)](_0x5f4bed){const _0xbd67a7=a35_0x9ef3f1,{options:_0x59a538,args:_0x39bc87,tdx:_0x45e440}=_0x5f4bed,_0x4c5c88=_0x39bc87[0x0],_0x391af8=!_0x4c5c88&&!!_0x59a538[_0xbd67a7(0x170)],_0x2712d3=_0x4c5c88||_0x59a538[_0xbd67a7(0x170)];if(!_0x2712d3)return console[_0xbd67a7(0x168)](_0xbd67a7(0x149)),console[_0xbd67a7(0x168)](_0xbd67a7(0x19d)),console[_0xbd67a7(0x168)](_0xbd67a7(0x138)),console[_0xbd67a7(0x168)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0xbd67a7(0x168)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0xbd67a7(0x168)](_0xbd67a7(0x16c)),console[_0xbd67a7(0x168)](_0xbd67a7(0x16e)),0x1;try{const _0x5897a9=_0x59a538[_0xbd67a7(0x19e)];let _0x1e7ef1=_0x2712d3;!_0x391af8&&_0x5897a9&&!_0x2712d3['includes']('/')&&(_0x1e7ef1=_0x5897a9+'/'+_0x2712d3,_0x59a538['verbose']&&console['error'](_0xbd67a7(0x137)+_0x1e7ef1));const _0x1d3129=await withSpinner(_0xbd67a7(0x15b)+_0x1e7ef1+'\x27...',()=>_0x45e440['segment'][_0xbd67a7(0x161)](_0x1e7ef1),{'verbose':_0x59a538[_0xbd67a7(0x15f)]}),_0x54a95c=_0x1d3129['data'];_0x59a538[_0xbd67a7(0x15f)]&&(console[_0xbd67a7(0x168)](_0xbd67a7(0x183)+_0x54a95c[_0xbd67a7(0x16b)]),console[_0xbd67a7(0x168)](_0xbd67a7(0x1a2)+_0x54a95c['parentId']),_0x54a95c[_0xbd67a7(0x167)]&&console[_0xbd67a7(0x168)](_0xbd67a7(0x17c)+_0x54a95c[_0xbd67a7(0x167)]),_0x54a95c['segmentId']&&console[_0xbd67a7(0x168)](_0xbd67a7(0x184)+_0x54a95c[_0xbd67a7(0x178)]));if(_0x54a95c['type']===_0xbd67a7(0x116)){const _0x55cd8e=await withSpinner(_0xbd67a7(0x17d),()=>_0x45e440[_0xbd67a7(0x1b1)][_0xbd67a7(0x1a9)](_0x54a95c[_0xbd67a7(0x18f)]),{'verbose':_0x59a538[_0xbd67a7(0x15f)]});await handleSingleObjectOutput(_0x55cd8e['data'],_0x59a538);}else{if(_0x54a95c['type']===_0xbd67a7(0x147)){if(!_0x54a95c[_0xbd67a7(0x167)])throw new SDKError(ErrorCode[_0xbd67a7(0x136)],_0xbd67a7(0x179));const _0x58ceef=await withSpinner(_0xbd67a7(0x145),()=>_0x45e440[_0xbd67a7(0x1b1)][_0xbd67a7(0x197)](_0x54a95c[_0xbd67a7(0x167)]),{'verbose':_0x59a538[_0xbd67a7(0x15f)]});await handleSingleObjectOutput(_0x58ceef[_0xbd67a7(0x1b8)],_0x59a538);}else{if(_0x54a95c['type']===_0xbd67a7(0x1b1)){if(!_0x54a95c[_0xbd67a7(0x178)])throw new SDKError(ErrorCode[_0xbd67a7(0x1b2)],_0xbd67a7(0x130));const _0x2747f4=await withSpinner(_0xbd67a7(0x160),()=>_0x45e440[_0xbd67a7(0x1b1)]['getSegment'](_0x54a95c[_0xbd67a7(0x18f)],_0x54a95c[_0xbd67a7(0x178)]),{'verbose':_0x59a538[_0xbd67a7(0x15f)]});await handleSingleObjectOutput(_0x2747f4[_0xbd67a7(0x1b8)],_0x59a538);}}}return 0x0;}catch(_0x4a97f9){if(_0x4a97f9 instanceof SDKError)return console[_0xbd67a7(0x168)](_0xbd67a7(0x1b4)+_0x4a97f9[_0xbd67a7(0x193)]),_0x4a97f9[_0xbd67a7(0x154)]&&console[_0xbd67a7(0x168)](_0xbd67a7(0x143)+_0x4a97f9[_0xbd67a7(0x154)]),0x1;throw _0x4a97f9;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]=a35_0x9ef3f1(0x196);[a35_0x9ef3f1(0x192)]=a35_0x9ef3f1(0x188);async[a35_0x9ef3f1(0x14f)](_0x55da6d){const _0x9dfc7b=a35_0x9ef3f1,{options:_0x33e2f3,args:_0x302854,tdx:_0x2e972a}=_0x55da6d,_0xa9b11a=_0x302854[0x0];if(!_0xa9b11a)return console[_0x9dfc7b(0x168)](_0x9dfc7b(0x15d)),console[_0x9dfc7b(0x168)](_0x9dfc7b(0x131)),console[_0x9dfc7b(0x168)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x9dfc7b(0x168)]('Examples:'),console['error'](_0x9dfc7b(0x1b5)),console['error'](_0x9dfc7b(0x164)),0x1;try{const _0x345924=_0x33e2f3['parentSegment'],_0x60876d=await resolveSegmentTarget(_0xa9b11a,_0x345924,_0x33e2f3[_0x9dfc7b(0x15f)]);_0x33e2f3[_0x9dfc7b(0x15f)]&&console[_0x9dfc7b(0x168)]('Target\x20path:\x20'+_0x60876d);const _0x2fc4ef=await withSpinner(_0x9dfc7b(0x174)+_0xa9b11a+_0x9dfc7b(0x151),()=>_0x2e972a[_0x9dfc7b(0x1b1)][_0x9dfc7b(0x161)](_0x60876d),{'verbose':_0x33e2f3[_0x9dfc7b(0x15f)]}),_0x53fdd5=_0x2fc4ef[_0x9dfc7b(0x1b8)];_0x33e2f3[_0x9dfc7b(0x15f)]&&(console[_0x9dfc7b(0x168)]('Resolved\x20type:\x20'+_0x53fdd5[_0x9dfc7b(0x16b)]),console['error'](_0x9dfc7b(0x1a2)+_0x53fdd5['parentId']));if(_0x53fdd5['type']===_0x9dfc7b(0x147))return console[_0x9dfc7b(0x168)](_0x9dfc7b(0x1ac)),console['error'](_0x9dfc7b(0x144)),0x1;if(_0x53fdd5[_0x9dfc7b(0x16b)]==='parent')return console['error'](_0x9dfc7b(0x14c)),console[_0x9dfc7b(0x168)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x53fdd5[_0x9dfc7b(0x178)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x9dfc7b(0x130));const _0x10bd84=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2e972a[_0x9dfc7b(0x1b1)][_0x9dfc7b(0x11f)](_0x53fdd5[_0x9dfc7b(0x18f)],_0x53fdd5[_0x9dfc7b(0x178)]),{'verbose':_0x33e2f3['verbose']});let _0x2ed9a9=_0x10bd84[_0x9dfc7b(0x1b8)];const _0x4dbe4f=resolveLimit(_0x33e2f3[_0x9dfc7b(0x18e)],DEFAULT_DISPLAY_LIMIT),_0x84450f=/\bLIMIT\s+\d+/i[_0x9dfc7b(0x181)](_0x2ed9a9);!_0x84450f&&(_0x2ed9a9=_0x2ed9a9[_0x9dfc7b(0x113)]()['replace'](/;+$/,''),_0x2ed9a9=_0x9dfc7b(0x162)+_0x2ed9a9+_0x9dfc7b(0x18c)+_0x4dbe4f);_0x33e2f3[_0x9dfc7b(0x15f)]&&console[_0x9dfc7b(0x168)](_0x9dfc7b(0x18b)+_0x2ed9a9);const _0x3c4789=await withProgressSpinner('Executing\x20segment\x20query...',async _0x10e25a=>{const _0x48c5a8=_0x9dfc7b,_0x4a108c=await _0x2e972a[_0x48c5a8(0x1a8)][_0x48c5a8(0x14f)](_0x2ed9a9,{'catalog':'td','schema':_0x48c5a8(0x141),'onJobId':_0x1fccd7=>{const _0x48e095=_0x48c5a8;_0x10e25a[_0x48e095(0x1a6)](_0x1fccd7);}});return _0x4a108c;},{'verbose':_0x33e2f3['verbose']}),_0x4ead21=_0x3c4789['data'],_0x1a0584=_0x4ead21[_0x9dfc7b(0x1b0)]?_0x9dfc7b(0x128)+_0x4ead21[_0x9dfc7b(0x1b0)]+']':'';return console[_0x9dfc7b(0x168)]('β\x20Query\x20completed:\x20Processed\x20'+_0x4ead21[_0x9dfc7b(0x157)][_0x9dfc7b(0x18a)][_0x9dfc7b(0x115)]()+_0x9dfc7b(0x189)+(_0x9dfc7b(0x175)+formatElapsed(_0x4ead21[_0x9dfc7b(0x157)][_0x9dfc7b(0x17b)])+_0x1a0584)),await handleQueryOutput(_0x4ead21,_0x33e2f3),0x0;}catch(_0x219f27){if(_0x219f27 instanceof SDKError)return console['error']('β\x20Query\x20failed\x20['+_0x219f27[_0x9dfc7b(0x126)]+']'),console[_0x9dfc7b(0x168)]('\x0a'+_0x219f27[_0x9dfc7b(0x193)]),0x1;throw _0x219f27;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a35_0x9ef3f1(0x192)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a35_0x9ef3f1(0x14f)](_0x425bb4){const _0x2c1035=a35_0x9ef3f1,{options:_0x3c61fb,args:_0x36d9c2,tdx:_0x341ae3}=_0x425bb4;if(_0x36d9c2[_0x2c1035(0x17e)]===0x0)return console[_0x2c1035(0x168)](_0x2c1035(0x19c)),console[_0x2c1035(0x168)](_0x2c1035(0x172)),0x1;const _0x26a24b=_0x36d9c2[0x0];try{_0x3c61fb[_0x2c1035(0x15f)]&&(console[_0x2c1035(0x168)](_0x2c1035(0x1a7)+_0x3c61fb['site']),console[_0x2c1035(0x168)](_0x2c1035(0x13e)+_0x26a24b));const _0x4bcb24=await withSpinner(_0x2c1035(0x14d)+_0x26a24b+'\x27...',()=>_0x341ae3['segment'][_0x2c1035(0x129)](_0x26a24b),{'verbose':_0x3c61fb[_0x2c1035(0x15f)]}),_0x11b391=_0x4bcb24[_0x2c1035(0x1b8)];_0x3c61fb[_0x2c1035(0x15f)]&&console[_0x2c1035(0x168)](_0x2c1035(0x187)+_0x11b391);const _0x6c9e09=await withSpinner(_0x2c1035(0x153)+_0x26a24b+_0x2c1035(0x151),()=>_0x341ae3[_0x2c1035(0x1b1)]['listFolders'](_0x11b391),{'verbose':_0x3c61fb[_0x2c1035(0x15f)]}),_0x277390=_0x6c9e09[_0x2c1035(0x1b8)];return console[_0x2c1035(0x168)](_0x2c1035(0x12d)+_0x277390[_0x2c1035(0x17e)]+_0x2c1035(0x191)+(_0x277390[_0x2c1035(0x17e)]!==0x1?'s':'')),await handleSDKOutput(_0x277390,_0x3c61fb),0x0;}catch(_0x5a80f5){if(_0x5a80f5 instanceof SDKError)return console['error'](_0x2c1035(0x1b4)+_0x5a80f5[_0x2c1035(0x193)]),_0x5a80f5['cause']&&console[_0x2c1035(0x168)](_0x2c1035(0x143)+_0x5a80f5['cause']),0x1;throw _0x5a80f5;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x9ef3f1(0x13c);[a35_0x9ef3f1(0x192)]=a35_0x9ef3f1(0x156);async[a35_0x9ef3f1(0x14f)](_0x129d83){const _0x4f8bb9=a35_0x9ef3f1,{options:_0x27e0d3,args:_0x30ee7b,tdx:_0xb842e5}=_0x129d83;if(_0x30ee7b[_0x4f8bb9(0x17e)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x4f8bb9(0x168)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4466f0,childId:_0x36649d}=parseSegmentRef(_0x30ee7b[0x0]);_0x27e0d3['verbose']&&(console[_0x4f8bb9(0x168)]('Site:\x20'+_0x27e0d3['site']),console['error'](_0x4f8bb9(0x13e)+_0x4466f0),_0x36649d&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x1af)+_0x36649d));if(!_0x36649d)return console[_0x4f8bb9(0x168)](_0x4f8bb9(0x132)),0x1;const _0x72f552=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4466f0+'\x27...',()=>_0xb842e5[_0x4f8bb9(0x1b1)][_0x4f8bb9(0x129)](_0x4466f0),{'verbose':_0x27e0d3[_0x4f8bb9(0x15f)]}),_0x1b4291=_0x72f552[_0x4f8bb9(0x1b8)];_0x27e0d3[_0x4f8bb9(0x15f)]&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x187)+_0x1b4291);const _0x293093=await withSpinner(_0x4f8bb9(0x11d)+_0x36649d+_0x4f8bb9(0x151),()=>_0xb842e5[_0x4f8bb9(0x1b1)][_0x4f8bb9(0x17a)](_0x1b4291,_0x36649d),{'verbose':_0x27e0d3['verbose']}),_0x343133=_0x293093[_0x4f8bb9(0x1b8)];_0x27e0d3[_0x4f8bb9(0x15f)]&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x171)+_0x343133);const _0x22ab32=await withSpinner(_0x4f8bb9(0x17f)+_0x36649d+'\x27...',()=>_0xb842e5[_0x4f8bb9(0x1b1)]['getFolder'](_0x343133),{'verbose':_0x27e0d3[_0x4f8bb9(0x15f)]});return await handleSDKOutput([_0x22ab32[_0x4f8bb9(0x1b8)]],_0x27e0d3),0x0;}catch(_0x9d0d2e){if(_0x9d0d2e instanceof SDKError)return console[_0x4f8bb9(0x168)](_0x4f8bb9(0x1b4)+_0x9d0d2e[_0x4f8bb9(0x193)]),_0x9d0d2e['cause']&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x143)+_0x9d0d2e['cause']),0x1;throw _0x9d0d2e;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]=a35_0x9ef3f1(0x133);[a35_0x9ef3f1(0x192)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a35_0x9ef3f1(0x14f)](_0x1e1c05){const _0x5da925=a35_0x9ef3f1,{options:_0x46f27b,args:_0x1419a}=_0x1e1c05,_0x3331a8=_0x46f27b,_0x21c7e7=_0x3331a8[_0x5da925(0x1a1)],_0x2d6502=_0x1419a[0x0];if(!_0x2d6502&&!_0x21c7e7)return console['error'](a35_0x5e08f4[_0x5da925(0x195)](_0x5da925(0x19a))),console[_0x5da925(0x168)](_0x5da925(0x169)),console[_0x5da925(0x168)](_0x5da925(0x11e)),console[_0x5da925(0x168)](_0x5da925(0x194)),console[_0x5da925(0x168)](_0x5da925(0x138)),console[_0x5da925(0x168)](_0x5da925(0x19b)),console[_0x5da925(0x168)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x2d6502&&_0x21c7e7)return console[_0x5da925(0x168)](a35_0x5e08f4[_0x5da925(0x195)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x16b165;if(_0x21c7e7)_0x16b165=await this[_0x5da925(0x1a0)](_0x21c7e7,_0x1e1c05);else{if(isYamlFilePath(_0x2d6502))return console[_0x5da925(0x168)](a35_0x5e08f4[_0x5da925(0x195)](_0x5da925(0x15c))),console['error'](_0x5da925(0x165)+_0x2d6502),0x1;else _0x16b165=await this[_0x5da925(0x12b)](_0x2d6502,_0x1e1c05);}return _0x46f27b[_0x5da925(0x12e)]===_0x5da925(0x1b7)||_0x46f27b[_0x5da925(0x12e)]===_0x5da925(0x119)?await handleSDKOutput([{'sql':_0x16b165}],_0x46f27b):console[_0x5da925(0x173)](_0x16b165),0x0;}catch(_0x1e1fab){if(_0x1e1fab instanceof SDKError)return console['error'](_0x5da925(0x1b4)+_0x1e1fab[_0x5da925(0x193)]),_0x1e1fab['cause']&&console[_0x5da925(0x168)]('\x20\x20Cause:\x20'+_0x1e1fab[_0x5da925(0x154)]),0x1;throw _0x1e1fab;}}async[a35_0x9ef3f1(0x1a0)](_0x3e70e6,_0x33dd1a){const _0x539418=a35_0x9ef3f1,{options:_0x2dba99,tdx:_0x2b0573}=_0x33dd1a;let _0xf8d91c;try{_0xf8d91c=await resolveYamlFilePath(_0x3e70e6);}catch(_0xeffe95){throw new SDKError(ErrorCode[_0x539418(0x186)],_0x539418(0x1b9)+_0xeffe95['message']);}_0x2dba99[_0x539418(0x15f)]&&console[_0x539418(0x168)]('Resolved:\x20'+_0xf8d91c[_0x539418(0x170)]+'/'+_0xf8d91c[_0x539418(0x199)]);const _0x48f656=await withSpinner(_0x539418(0x142),()=>_0x2b0573[_0x539418(0x1b1)][_0x539418(0x13f)](_0xf8d91c[_0x539418(0x16f)],_0xf8d91c['parentSegment'],_0xf8d91c['segmentName']),{'verbose':_0x2dba99[_0x539418(0x15f)]});return _0x48f656[_0x539418(0x1b8)];}async[a35_0x9ef3f1(0x12b)](_0x4a1ced,_0x561a46){const _0x2c54a5=a35_0x9ef3f1,{options:_0x3a1e9a,tdx:_0x505447}=_0x561a46,_0x169fca=_0x3a1e9a[_0x2c54a5(0x170)],_0x11716c=await resolveSegmentTarget(_0x4a1ced,_0x169fca,_0x3a1e9a[_0x2c54a5(0x15f)]);_0x3a1e9a[_0x2c54a5(0x15f)]&&console[_0x2c54a5(0x168)](_0x2c54a5(0x1ab)+_0x11716c);const _0x153758=await withSpinner(_0x2c54a5(0x174)+_0x4a1ced+_0x2c54a5(0x151),()=>_0x505447[_0x2c54a5(0x1b1)][_0x2c54a5(0x161)](_0x11716c),{'verbose':_0x3a1e9a[_0x2c54a5(0x15f)]}),_0x1ce0ce=_0x153758['data'];_0x3a1e9a[_0x2c54a5(0x15f)]&&(console[_0x2c54a5(0x168)](_0x2c54a5(0x183)+_0x1ce0ce[_0x2c54a5(0x16b)]),console[_0x2c54a5(0x168)](_0x2c54a5(0x1a2)+_0x1ce0ce[_0x2c54a5(0x18f)]));if(_0x1ce0ce[_0x2c54a5(0x16b)]===_0x2c54a5(0x147))throw new SDKError(ErrorCode[_0x2c54a5(0x186)],_0x2c54a5(0x1a4));if(_0x1ce0ce[_0x2c54a5(0x16b)]===_0x2c54a5(0x116))throw new SDKError(ErrorCode[_0x2c54a5(0x186)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x1ce0ce[_0x2c54a5(0x178)])throw new SDKError(ErrorCode[_0x2c54a5(0x1b2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x447aee=await withSpinner(_0x2c54a5(0x16d),()=>_0x505447[_0x2c54a5(0x1b1)]['getSegmentSQL'](_0x1ce0ce[_0x2c54a5(0x18f)],_0x1ce0ce[_0x2c54a5(0x178)]),{'verbose':_0x3a1e9a[_0x2c54a5(0x15f)]});return _0x447aee[_0x2c54a5(0x1b8)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]='segment:folder:create';['description']=a35_0x9ef3f1(0x14e);async[a35_0x9ef3f1(0x14f)](_0x19169a){const _0x5650a9=a35_0x9ef3f1,{options:_0xebd915,args:_0x55691,tdx:_0x2bc399}=_0x19169a,_0x5a846c=_0xebd915;if(_0x55691[_0x5650a9(0x17e)]<0x2)return console[_0x5650a9(0x168)](_0x5650a9(0x159)),console[_0x5650a9(0x168)](_0x5650a9(0x1ae)),0x1;const _0x3809b5=_0x55691[0x0],_0x1d9c21=_0x55691[0x1];_0x5a846c[_0x5650a9(0x15f)]&&(console['error'](_0x5650a9(0x1a7)+_0x5a846c[_0x5650a9(0x176)]),console[_0x5650a9(0x168)]('Parent\x20segment:\x20'+_0x3809b5),console[_0x5650a9(0x168)]('Folder\x20name:\x20'+_0x1d9c21));let _0x57616f;if(_0x5a846c[_0x5650a9(0x152)]){const _0x43b8fe=_0x5a846c[_0x5650a9(0x152)],_0x454951=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3809b5+_0x5650a9(0x151),()=>_0x2bc399['segment'][_0x5650a9(0x129)](_0x3809b5),{'verbose':_0x5a846c[_0x5650a9(0x15f)]}),_0x459733=_0x454951[_0x5650a9(0x1b8)],_0x66fd9=await withSpinner(_0x5650a9(0x190)+_0x43b8fe+'\x27...',()=>_0x2bc399['segment']['resolveFolderId'](_0x459733,_0x43b8fe),{'verbose':_0x5a846c['verbose']});_0x57616f=_0x66fd9[_0x5650a9(0x1b8)],_0x5a846c[_0x5650a9(0x15f)]&&console[_0x5650a9(0x168)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x57616f);}const _0x3302b0={'name':_0x1d9c21,'description':_0x5a846c['description'],'parentFolderId':_0x57616f},_0x2be18f=await withSpinner(_0x5650a9(0x155)+_0x1d9c21+'\x27...',()=>_0x2bc399[_0x5650a9(0x1b1)]['createFolder'](_0x3809b5,_0x3302b0),{'verbose':_0x5a846c[_0x5650a9(0x15f)]}),_0x3ce650=_0x2be18f[_0x5650a9(0x1b8)];return console[_0x5650a9(0x168)](_0x5650a9(0x124)+_0x3ce650[_0x5650a9(0x127)]+_0x5650a9(0x16a)+_0x3ce650['id']),await handleSDKOutput([_0x3ce650],_0x5a846c),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a35_0x9ef3f1(0x140);[a35_0x9ef3f1(0x192)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x9ef3f1(0x14f)](_0x973817){const _0x145092=a35_0x9ef3f1,{options:_0x557c9e,args:_0x4465d1,tdx:_0x5882cb}=_0x973817,_0x50ac01=_0x4465d1[0x0];if(!_0x50ac01)return console[_0x145092(0x168)](_0x145092(0x1a3)),console[_0x145092(0x168)](_0x145092(0x13d)),console[_0x145092(0x168)](_0x145092(0x1aa)),console[_0x145092(0x168)](_0x145092(0x11b)),console[_0x145092(0x168)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x145092(0x138)),console['error'](_0x145092(0x15a)),console[_0x145092(0x168)](_0x145092(0x163)),console[_0x145092(0x168)](_0x145092(0x19f)),console[_0x145092(0x168)](_0x145092(0x125)),0x1;try{const _0x32a968=_0x557c9e[_0x145092(0x170)],_0xc6f7e3=await resolveSegmentTarget(_0x50ac01,_0x32a968,_0x557c9e[_0x145092(0x15f)]);_0x557c9e['verbose']&&console[_0x145092(0x168)](_0x145092(0x1ab)+_0xc6f7e3);const _0x3011d0=await withSpinner(_0x145092(0x174)+_0x50ac01+'\x27...',()=>_0x5882cb[_0x145092(0x1b1)][_0x145092(0x161)](_0xc6f7e3),{'verbose':_0x557c9e[_0x145092(0x15f)]}),_0x446020=_0x3011d0[_0x145092(0x1b8)];_0x557c9e['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x446020[_0x145092(0x16b)]),console['error'](_0x145092(0x1a2)+_0x446020[_0x145092(0x18f)]),_0x446020[_0x145092(0x167)]&&console['error'](_0x145092(0x17c)+_0x446020['folderId']),_0x446020['segmentId']&&console['error'](_0x145092(0x184)+_0x446020[_0x145092(0x178)]));if(_0x557c9e[_0x145092(0x11c)]){if(_0x446020[_0x145092(0x16b)]===_0x145092(0x147))return console[_0x145092(0x168)](_0x145092(0x135)),0x1;if(_0x446020['type']===_0x145092(0x116))return console['error'](_0x145092(0x1b6)),console[_0x145092(0x168)](_0x145092(0x1b3)),0x1;if(!_0x446020[_0x145092(0x178)])throw new SDKError(ErrorCode[_0x145092(0x1b2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x592fa6=getConsoleNextUrl(_0x557c9e['site'],'/app/ps/'+_0x446020[_0x145092(0x18f)]+_0x145092(0x146)+_0x446020[_0x145092(0x178)]);return console['error'](a35_0x5e08f4['green']('β')+_0x145092(0x121)+a35_0x5e08f4[_0x145092(0x180)](_0x592fa6)),openBrowser(_0x592fa6),0x0;}if(_0x446020['type']===_0x145092(0x147)){if(!_0x446020[_0x145092(0x167)])throw new SDKError(ErrorCode[_0x145092(0x136)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x42d942=await withSpinner(_0x145092(0x145),()=>_0x5882cb['segment'][_0x145092(0x197)](_0x446020[_0x145092(0x167)]),{'verbose':_0x557c9e[_0x145092(0x15f)]});await handleSingleObjectOutput(_0x42d942[_0x145092(0x1b8)],_0x557c9e);}else{if(_0x446020[_0x145092(0x16b)]===_0x145092(0x1b1)){if(!_0x446020['segmentId'])throw new SDKError(ErrorCode[_0x145092(0x1b2)],_0x145092(0x130));const _0x4655a3=await withSpinner(_0x145092(0x160),()=>_0x5882cb[_0x145092(0x1b1)]['getSegment'](_0x446020['parentId'],_0x446020['segmentId']),{'verbose':_0x557c9e[_0x145092(0x15f)]}),_0x5bd47d=getConsoleNextUrl(_0x557c9e[_0x145092(0x176)],'/app/ps/'+_0x446020[_0x145092(0x18f)]+_0x145092(0x146)+_0x446020[_0x145092(0x178)]),_0x150ac2=_0x4655a3[_0x145092(0x1b8)];_0x150ac2['url']=_0x5bd47d,await handleSingleObjectOutput(_0x150ac2,_0x557c9e);}else return console[_0x145092(0x168)](_0x145092(0x185)),console[_0x145092(0x168)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x36df34){if(_0x36df34 instanceof SDKError)return console[_0x145092(0x168)](_0x145092(0x1b4)+_0x36df34['message']),_0x36df34[_0x145092(0x154)]&&console['error']('\x20\x20Cause:\x20'+_0x36df34['cause']),0x1;throw _0x36df34;}}}function a35_0x3485(_0x338548,_0x1ef00b){_0x338548=_0x338548-0x113;const _0x300de9=a35_0x300d();let _0x3485ed=_0x300de9[_0x338548];return _0x3485ed;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]=a35_0x9ef3f1(0x148);['description']=a35_0x9ef3f1(0x198);async[a35_0x9ef3f1(0x14f)](_0x7c7b83){const _0x1598c6=a35_0x9ef3f1,{options:_0x11f9e8,args:_0x321ff3,tdx:_0x36b6d6}=_0x7c7b83,_0x25431f=_0x321ff3[0x0];if(!_0x25431f)return console[_0x1598c6(0x168)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1598c6(0x168)](_0x1598c6(0x14a)),console[_0x1598c6(0x168)](_0x1598c6(0x14b)),console[_0x1598c6(0x168)](_0x1598c6(0x138)),console[_0x1598c6(0x168)](_0x1598c6(0x1a5)),console['error'](_0x1598c6(0x139)),0x1;try{const _0x3d9c20=_0x11f9e8[_0x1598c6(0x170)],_0x2cc6b4=await resolveSegmentTarget(_0x25431f,_0x3d9c20,_0x11f9e8[_0x1598c6(0x15f)]);_0x11f9e8['verbose']&&console[_0x1598c6(0x168)]('Target\x20path:\x20'+_0x2cc6b4);const _0x13ada9=await withSpinner(_0x1598c6(0x174)+_0x25431f+'\x27...',()=>_0x36b6d6['segment']['resolvePathToResource'](_0x2cc6b4),{'verbose':_0x11f9e8['verbose']}),_0x3aeb03=_0x13ada9[_0x1598c6(0x1b8)];_0x11f9e8['verbose']&&(console[_0x1598c6(0x168)](_0x1598c6(0x183)+_0x3aeb03[_0x1598c6(0x16b)]),console[_0x1598c6(0x168)]('Parent\x20ID:\x20'+_0x3aeb03[_0x1598c6(0x18f)]));if(_0x3aeb03[_0x1598c6(0x16b)]===_0x1598c6(0x147))return console[_0x1598c6(0x168)](_0x1598c6(0x118)),console[_0x1598c6(0x168)](_0x1598c6(0x123)),0x1;if(_0x3aeb03[_0x1598c6(0x16b)]===_0x1598c6(0x116))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1598c6(0x168)](_0x1598c6(0x13b)),0x1;if(!_0x3aeb03[_0x1598c6(0x178)])throw new SDKError(ErrorCode[_0x1598c6(0x1b2)],_0x1598c6(0x130));const _0x21f2c6=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x36b6d6[_0x1598c6(0x1b1)][_0x1598c6(0x11f)](_0x3aeb03[_0x1598c6(0x18f)],_0x3aeb03[_0x1598c6(0x178)]),{'verbose':_0x11f9e8[_0x1598c6(0x15f)]}),_0x34e270=_0x21f2c6[_0x1598c6(0x1b8)],_0x4cef30=await executeSchemaQuery(_0x34e270,_0x36b6d6,_0x11f9e8);return await handleQueryOutput(_0x4cef30,_0x11f9e8),0x0;}catch(_0x61ed39){if(_0x61ed39 instanceof SDKError)return console[_0x1598c6(0x168)](_0x1598c6(0x1b4)+_0x61ed39[_0x1598c6(0x193)]),_0x61ed39[_0x1598c6(0x154)]&&console[_0x1598c6(0x168)](_0x1598c6(0x143)+_0x61ed39[_0x1598c6(0x154)]),0x1;throw _0x61ed39;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0xbd29e9=a36_0x3fd9;(function(_0x25e3e3,_0x95f80c){const _0x8fd9b0=a36_0x3fd9,_0xe1f6f3=_0x25e3e3();while(!![]){try{const _0xeaab01=parseInt(_0x8fd9b0(0x74))/0x1*(parseInt(_0x8fd9b0(0x94))/0x2)+parseInt(_0x8fd9b0(0x71))/0x3+-parseInt(_0x8fd9b0(0x81))/0x4+-parseInt(_0x8fd9b0(0xa6))/0x5*(-parseInt(_0x8fd9b0(0x82))/0x6)+parseInt(_0x8fd9b0(0x8c))/0x7+-parseInt(_0x8fd9b0(0x90))/0x8+parseInt(_0x8fd9b0(0x77))/0x9;if(_0xeaab01===_0x95f80c)break;else _0xe1f6f3['push'](_0xe1f6f3['shift']());}catch(_0x36737d){_0xe1f6f3['push'](_0xe1f6f3['shift']());}}}(a36_0x4b8a,0xdf27a));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';function a36_0x4b8a(){const _0x123916=['Creating\x20segment\x20\x27','4336655QVoMcM','5200497ozLnWo','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','kind','1fXhYxy','rule','data','2128446Yhkznp','description','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Examples:','resolveParentId','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segment','name','resolveFolderId','4505144wyNNFj','6IlvITF','\x27\x20with\x20ID:\x20','invisible','segmentPath','Resolving\x20folder\x20\x27','folderId','Site:\x20','\x27...','length','folder','402129atVHfM','\x20\x20\x20Path:\x20','Target\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','14138696MuhJly','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Parent:\x20','1825788SeDyDO','Segment\x20name:\x20','execute','site','includes','Create\x20child\x20segment\x20with\x20filtering\x20rules','β\x20Created\x20segment\x20\x27','error','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','verbose','segments','yellow','type','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolvePathToResource','Resolved\x20folder\x20ID:\x20','parent'];a36_0x4b8a=function(){return _0x123916;};return a36_0x4b8a();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0xec7b28 from'chalk';function a36_0x3fd9(_0x32e331,_0x3263d4){_0x32e331=_0x32e331-0x71;const _0x4b8ab8=a36_0x4b8a();let _0x3fd9e1=_0x4b8ab8[_0x32e331];return _0x3fd9e1;}export class SegmentCreateCommand extends BaseCommand{[a36_0xbd29e9(0x7f)]='segment:create';[a36_0xbd29e9(0x78)]=a36_0xbd29e9(0x99);async[a36_0xbd29e9(0x96)](_0x168e8d){const _0x58ef6d=a36_0xbd29e9;console[_0x58ef6d(0x9b)](a36_0xec7b28[_0x58ef6d(0x9f)](_0x58ef6d(0x92))),console['error'](a36_0xec7b28[_0x58ef6d(0x9f)](_0x58ef6d(0x91)));const {options:_0x405029,args:_0x519d27,tdx:_0x46bf7e}=_0x168e8d,_0x20d062=_0x405029;if(_0x519d27[_0x58ef6d(0x8a)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x58ef6d(0x9b)](_0x58ef6d(0x72)),console[_0x58ef6d(0x9b)](_0x58ef6d(0x7b)),console[_0x58ef6d(0x9b)](_0x58ef6d(0x7a)),console['error'](_0x58ef6d(0x79)),console[_0x58ef6d(0x9b)](_0x58ef6d(0xa1)),0x1;const _0x324686=_0x519d27[0x0],_0x179983=_0x405029[_0x58ef6d(0x85)];let _0x16ec8d=_0x324686;_0x179983&&!_0x324686[_0x58ef6d(0x98)]('/')&&(_0x16ec8d=_0x179983+'/'+_0x324686,_0x20d062['verbose']&&console[_0x58ef6d(0x9b)](_0x58ef6d(0x8f)+_0x16ec8d));const _0x6513ed=parsePath(_0x16ec8d);if(_0x6513ed[_0x58ef6d(0x9e)]['length']<0x2)return console[_0x58ef6d(0x9b)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x58ef6d(0x9b)](_0x58ef6d(0x7d)),0x1;const _0x39af21=_0x6513ed[_0x58ef6d(0x9e)][0x0],_0xdef02=getBaseName(_0x16ec8d),_0x28bf4d=getParentPath(_0x16ec8d);_0x20d062[_0x58ef6d(0x9d)]&&(console[_0x58ef6d(0x9b)](_0x58ef6d(0x88)+_0x20d062[_0x58ef6d(0x97)]),console['error'](_0x58ef6d(0x8e)+_0x16ec8d),console[_0x58ef6d(0x9b)](_0x58ef6d(0x93)+_0x39af21),console[_0x58ef6d(0x9b)](_0x58ef6d(0x95)+_0xdef02),console[_0x58ef6d(0x9b)]('Parent\x20path:\x20'+_0x28bf4d));const _0x3efa5b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x39af21+_0x58ef6d(0x89),()=>_0x46bf7e[_0x58ef6d(0x7e)][_0x58ef6d(0x7c)](_0x39af21),{'verbose':_0x20d062['verbose']}),_0x4af83f=_0x3efa5b[_0x58ef6d(0x76)];let _0x94d25c;if(_0x6513ed['segments'][_0x58ef6d(0x8a)]>0x2){const _0x3673f0=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x28bf4d+_0x58ef6d(0x89),()=>_0x46bf7e['segment'][_0x58ef6d(0xa2)](_0x28bf4d),{'verbose':_0x20d062[_0x58ef6d(0x9d)]}),_0x2d40a8=_0x3673f0[_0x58ef6d(0x76)];if(_0x2d40a8[_0x58ef6d(0xa0)]!==_0x58ef6d(0x8b)&&_0x2d40a8[_0x58ef6d(0xa0)]!==_0x58ef6d(0xa4))return console[_0x58ef6d(0x9b)](_0x58ef6d(0x9c)),0x1;_0x94d25c=_0x2d40a8[_0x58ef6d(0x87)];}else{if(_0x20d062['folder']){const _0x201e32=await withSpinner(_0x58ef6d(0x86)+_0x20d062[_0x58ef6d(0x8b)]+'\x27...',()=>_0x46bf7e[_0x58ef6d(0x7e)][_0x58ef6d(0x80)](_0x4af83f,_0x20d062[_0x58ef6d(0x8b)]),{'verbose':_0x20d062['verbose']});_0x94d25c=_0x201e32['data'];}}_0x20d062['verbose']&&_0x94d25c&&console['error'](_0x58ef6d(0xa3)+_0x94d25c);const _0x5c7db2=await loadJSONFromOptions(_0x20d062[_0x58ef6d(0x75)],_0x20d062['ruleFile']),_0x27dbc0={'name':_0xdef02,'description':_0x20d062['description'],'rule':_0x5c7db2,'kind':_0x20d062[_0x58ef6d(0x73)]!==undefined?parseInt(_0x20d062[_0x58ef6d(0x73)],0xa):undefined,'isVisible':_0x20d062[_0x58ef6d(0x84)]?![]:undefined,'segmentFolderId':_0x94d25c,'countPopulation':_0x20d062['noCountPopulation']?![]:undefined},_0x2bd1e6=await withSpinner(_0x58ef6d(0xa5)+_0xdef02+_0x58ef6d(0x89),()=>_0x46bf7e[_0x58ef6d(0x7e)]['createSegment'](_0x4af83f,_0x27dbc0),{'verbose':_0x20d062['verbose']}),_0xbfa7e8=_0x2bd1e6[_0x58ef6d(0x76)];return console['error'](_0x58ef6d(0x9a)+_0xbfa7e8['name']+_0x58ef6d(0x83)+_0xbfa7e8['id']),_0x16ec8d!==_0x324686&&console['error'](_0x58ef6d(0x8d)+_0x16ec8d),await handleSDKOutput([_0xbfa7e8],_0x20d062),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0xdb3c28=a37_0x5255;(function(_0x5b8884,_0x2af795){const _0x40af2c=a37_0x5255,_0x21c735=_0x5b8884();while(!![]){try{const _0x3c9319=-parseInt(_0x40af2c(0x128))/0x1*(-parseInt(_0x40af2c(0x114))/0x2)+parseInt(_0x40af2c(0x117))/0x3*(parseInt(_0x40af2c(0x110))/0x4)+parseInt(_0x40af2c(0x12a))/0x5+-parseInt(_0x40af2c(0x121))/0x6*(-parseInt(_0x40af2c(0x125))/0x7)+-parseInt(_0x40af2c(0x11e))/0x8*(-parseInt(_0x40af2c(0x111))/0x9)+parseInt(_0x40af2c(0x129))/0xa*(parseInt(_0x40af2c(0x11c))/0xb)+-parseInt(_0x40af2c(0x116))/0xc;if(_0x3c9319===_0x2af795)break;else _0x21c735['push'](_0x21c735['shift']());}catch(_0x1e7dfc){_0x21c735['push'](_0x21c735['shift']());}}}(a37_0x41f1,0x58b0e));function a37_0x5255(_0x1f5050,_0x4b7150){_0x1f5050=_0x1f5050-0x110;const _0x41f1d3=a37_0x41f1();let _0x52555c=_0x41f1d3[_0x1f5050];return _0x52555c;}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{[a37_0xdb3c28(0x11a)]='segment:fields';[a37_0xdb3c28(0x120)]=a37_0xdb3c28(0x127);async['execute'](_0x34d4bd){const _0x4f7561=a37_0xdb3c28,{options:_0x8d1030,args:_0x4f15e8,tdx:_0x86823e}=_0x34d4bd,_0x4f4c79=_0x4f15e8[0x0]||_0x8d1030[_0x4f7561(0x122)];if(!_0x4f4c79)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x4f7561(0x115)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x8d1030[_0x4f7561(0x12b)]&&(console['error'](_0x4f7561(0x11d)+_0x8d1030[_0x4f7561(0x12c)]),console[_0x4f7561(0x115)](_0x4f7561(0x112)+_0x4f4c79));const _0x2c17ab=await withSpinner(_0x4f7561(0x126)+_0x4f4c79+_0x4f7561(0x113),()=>_0x86823e[_0x4f7561(0x11b)][_0x4f7561(0x119)](_0x4f4c79),{'verbose':_0x8d1030[_0x4f7561(0x12b)]}),_0x3b44b8=_0x2c17ab['data'];console[_0x4f7561(0x115)](_0x4f7561(0x124)+_0x3b44b8[_0x4f7561(0x11f)]+_0x4f7561(0x123)+(_0x3b44b8[_0x4f7561(0x11f)]!==0x1?'s':''));if(_0x8d1030['json']||_0x8d1030[_0x4f7561(0x118)])return await handleSDKOutput(_0x3b44b8,_0x8d1030),0x0;return displayFieldsHumanReadable(_0x3b44b8,_0x4f4c79),0x0;}}function a37_0x41f1(){const _0x32a0a9=['verbose','site','1410964CoYgPO','18PHfqrK','Parent\x20segment:\x20','\x27...','2nyVAyj','error','24654744UkoTxz','6FLdrCc','jsonl','listFields','name','segment','363SZjkuw','Site:\x20','1019048UGcxiG','length','description','3805884CPLfIG','parentSegment','\x20field','β\x20Found\x20','7oOpzVn','Listing\x20fields\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','676387cQVbfU','25630hdGWaT','311580GXVNHk'];a37_0x41f1=function(){return _0x32a0a9;};return a37_0x41f1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a38_0x40b5(_0x454bad,_0x578d8f){_0x454bad=_0x454bad-0x1f0;const _0x4c276b=a38_0x4c27();let _0x40b58c=_0x4c276b[_0x454bad];return _0x40b58c;}function a38_0x4c27(){const _0x88a23e=['yes','28MZgLUO','170895znkxsP','execute','setPhase','segment:pull','860678mkLUIJ','\x0aPull\x20summary\x20for\x20\x27','-\x20no\x20files\x20written','repeat','\x20segments','Target\x20resource:\x20','Error:\x20','red','\x20changed\x20files','\x20with\x20','parent_segment','pullSegments','\x20files?','journeyVersions','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','message','isNew','\x20journeys','parentSegment','1383327myHAEo','green','resourceName','yellow','content','2061FsYqnv','β\x20All\x20files\x20are\x20up\x20to\x20date','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20=\x20','session','verbose','activations','\x20versions)','filter','Write\x20','β\x20Context\x20set:\x20','helpText','targetDir','length','Aborted.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Target:\x20','segment','error','\x20activations','files','cwd','\x20unchanged\x20files','description','parentName','segments','relativePath','hasChanges','846Tfjvgb','\x27...','\x20\x20π―\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','18SgQDHm','28250zkMwoZ','type','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)','Pulling\x20segments\x20from\x20\x27','\x0aError:','data','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','β\x20Pulled\x20','\x20\x20πΊοΈ\x20\x20','22928xFwgPl','site','2079704uQnJmy','\x0aChanges\x20to\x20\x27','cyan','utf-8','absolutePath','errorCode','Parent\x20segment:\x20','dim','journeys','no_parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','dryRun','counts','\x20new\x20files','364mHTtfS'];a38_0x4c27=function(){return _0x88a23e;};return a38_0x4c27();}const a38_0x15bc89=a38_0x40b5;(function(_0x10650a,_0xb3fa87){const _0x5a833e=a38_0x40b5,_0x1728f3=_0x10650a();while(!![]){try{const _0x3d4037=parseInt(_0x5a833e(0x214))/0x1*(parseInt(_0x5a833e(0x202))/0x2)+parseInt(_0x5a833e(0x231))/0x3*(-parseInt(_0x5a833e(0x212))/0x4)+parseInt(_0x5a833e(0x215))/0x5*(-parseInt(_0x5a833e(0x1f8))/0x6)+-parseInt(_0x5a833e(0x219))/0x7+-parseInt(_0x5a833e(0x204))/0x8+parseInt(_0x5a833e(0x1f4))/0x9*(parseInt(_0x5a833e(0x1f9))/0xa)+parseInt(_0x5a833e(0x22c))/0xb;if(_0x3d4037===_0xb3fa87)break;else _0x1728f3['push'](_0x1728f3['shift']());}catch(_0x467e3c){_0x1728f3['push'](_0x1728f3['shift']());}}}(a38_0x4c27,0x281e8));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a38_0x1f1eac from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x1d5145 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a38_0x15bc89(0x218);[a38_0x15bc89(0x248)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0x15bc89(0x216)](_0x5de587){const _0x4261ba=a38_0x15bc89,{options:_0x16785c,args:_0xb9d91f,tdx:_0x56912c}=_0x5de587,_0xe4dbd7=_0x16785c,_0x5956ca=await resolveTarget({'arg':_0xb9d91f[0x0],'contextParent':_0x16785c[_0x4261ba(0x22b)],'cwd':process[_0x4261ba(0x246)]()});if(!isSuccessfulResolution(_0x5956ca))return _0x5956ca[_0x4261ba(0x209)]===_0x4261ba(0x20d)?(console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x1f7))),console[_0x4261ba(0x243)](_0x4261ba(0x1fb)),console[_0x4261ba(0x243)](_0x4261ba(0x227)),console[_0x4261ba(0x243)](_0x4261ba(0x20e))):(console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x220)](_0x4261ba(0x21f)+_0x5956ca[_0x4261ba(0x228)]+'\x0a')),_0x5956ca[_0x4261ba(0x23c)]&&console['error'](a38_0x1f1eac['cyan'](_0x5956ca[_0x4261ba(0x23c)]))),0x1;const _0x45ac5b=_0x5956ca[_0x4261ba(0x1f0)],_0x5a17ff=_0x5956ca['targetDir'],_0x18bf06=_0x5956ca[_0x4261ba(0x1fa)]==='file'?_0x5956ca[_0x4261ba(0x22e)]:undefined;_0xe4dbd7[_0x4261ba(0x236)]&&(console[_0x4261ba(0x243)]('Site:\x20'+_0xe4dbd7[_0x4261ba(0x203)]),console[_0x4261ba(0x243)](_0x4261ba(0x20a)+_0x45ac5b),_0x18bf06&&console[_0x4261ba(0x243)](_0x4261ba(0x21e)+_0x18bf06));const _0x22838b=await withProgressSpinner(_0x4261ba(0x1fc)+_0x45ac5b+_0x4261ba(0x1f5),_0x4d2ee5=>_0x56912c[_0x4261ba(0x242)][_0x4261ba(0x224)](_0x45ac5b,{'targetDir':_0x5a17ff,'targetResourceName':_0x18bf06,'verbose':_0xe4dbd7['verbose'],'progress':{'update':_0x55cafb=>{const _0x5c3dc3=_0x4261ba;_0x4d2ee5[_0x5c3dc3(0x217)](_0x55cafb),_0xe4dbd7[_0x5c3dc3(0x236)]&&console[_0x5c3dc3(0x243)]('\x20\x20'+_0x55cafb);}}}),{'verbose':_0xe4dbd7[_0x4261ba(0x236)]}),_0x27fd08=_0x22838b[_0x4261ba(0x1fe)];if(_0x27fd08['counts'][_0x4261ba(0x1f1)]===0x0&&_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x20c)]===0x0)return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x233)+_0x27fd08[_0x4261ba(0x1f0)]+'\x27')),0x0;const _0x11a9d8=_0x27fd08[_0x4261ba(0x245)][_0x4261ba(0x239)](_0x4a0ed7=>_0x4a0ed7[_0x4261ba(0x229)]),_0x1f40eb=_0x27fd08['files'][_0x4261ba(0x239)](_0x16fee7=>!_0x16fee7[_0x4261ba(0x229)]&&_0x16fee7[_0x4261ba(0x1f3)]),_0x577d98=_0x27fd08[_0x4261ba(0x245)]['filter'](_0xab4472=>!_0xab4472[_0x4261ba(0x229)]&&!_0xab4472['hasChanges']);console['error'](_0x4261ba(0x21a)+_0x27fd08[_0x4261ba(0x1f0)]+'\x27:'),console[_0x4261ba(0x243)](_0x4261ba(0x1f6)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x1f1)]+_0x4261ba(0x21d))+_0x4261ba(0x222)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x237)]+_0x4261ba(0x244)));if(_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x20c)]>0x0){const _0x3134c5=_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x226)]>_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x20c)]?'\x20('+_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x226)]+_0x4261ba(0x238):'';console[_0x4261ba(0x243)](_0x4261ba(0x201)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x210)]['journeys']+_0x4261ba(0x22a))+a38_0x1f1eac[_0x4261ba(0x20b)](_0x3134c5));}console['error']('\x20\x20'+a38_0x1f1eac[_0x4261ba(0x22d)]('+\x20'+_0x11a9d8[_0x4261ba(0x23e)]+_0x4261ba(0x211))),console[_0x4261ba(0x243)]('\x20\x20'+a38_0x1f1eac[_0x4261ba(0x22f)]('~\x20'+_0x1f40eb[_0x4261ba(0x23e)]+_0x4261ba(0x221))),console[_0x4261ba(0x243)]('\x20\x20'+a38_0x1f1eac[_0x4261ba(0x20b)]('=\x20'+_0x577d98[_0x4261ba(0x23e)]+_0x4261ba(0x247))),console[_0x4261ba(0x243)](_0x4261ba(0x241)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x23d)])+'\x0a');if(_0x1f40eb[_0x4261ba(0x23e)]>0x0)for(const _0x221824 of _0x1f40eb){console[_0x4261ba(0x243)](_0x4261ba(0x205)+_0x221824[_0x4261ba(0x1f2)]+'\x27:'),console[_0x4261ba(0x243)]('β'[_0x4261ba(0x21c)](0x3c)),console['error'](_0x221824['diff']),console[_0x4261ba(0x243)]('β'[_0x4261ba(0x21c)](0x3c));}if(_0xe4dbd7[_0x4261ba(0x20f)])return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x240))),0x0;if(_0x11a9d8[_0x4261ba(0x23e)]===0x0&&_0x1f40eb['length']===0x0)return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22d)](_0x4261ba(0x232))),saveSessionContext({'parent_segment':_0x27fd08[_0x4261ba(0x1f0)]},_0xe4dbd7[_0x4261ba(0x235)]),console['error'](a38_0x1f1eac['green'](_0x4261ba(0x23b)+a38_0x1f1eac[_0x4261ba(0x20b)](_0x4261ba(0x223))+'\x20=\x20'+a38_0x1f1eac['cyan'](_0x27fd08[_0x4261ba(0x1f0)]))),0x0;if(!_0xe4dbd7[_0x4261ba(0x213)]){if(!isInteractive())return console['error'](a38_0x1f1eac[_0x4261ba(0x220)](_0x4261ba(0x1fd)),_0x4261ba(0x1ff)),console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x20b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xad8b40=await confirmKey(_0x4261ba(0x23a)+(_0x11a9d8[_0x4261ba(0x23e)]+_0x1f40eb[_0x4261ba(0x23e)])+_0x4261ba(0x225));if(!_0xad8b40)return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x23f)),_0x4261ba(0x21b)),0x1;}for(const _0x27f7fe of _0x27fd08[_0x4261ba(0x245)]){if(_0x27f7fe['isNew']||_0x27f7fe[_0x4261ba(0x1f3)]){const _0xe4f487=a38_0x1d5145['dirname'](_0x27f7fe[_0x4261ba(0x208)]);!existsSync(_0xe4f487)&&mkdirSync(_0xe4f487,{'recursive':!![]}),writeFileSync(_0x27f7fe[_0x4261ba(0x208)],_0x27f7fe[_0x4261ba(0x230)],_0x4261ba(0x207));}}return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22d)](_0x4261ba(0x200)+(_0x11a9d8[_0x4261ba(0x23e)]+_0x1f40eb[_0x4261ba(0x23e)])+'\x20files\x20to\x20'+_0x27fd08['targetDir'])),saveSessionContext({'parent_segment':_0x27fd08[_0x4261ba(0x1f0)]},_0xe4dbd7[_0x4261ba(0x235)]),console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22d)](_0x4261ba(0x23b)+a38_0x1f1eac[_0x4261ba(0x20b)](_0x4261ba(0x223))+_0x4261ba(0x234)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x1f0)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x56fbcf=a39_0x4106;(function(_0x332ef2,_0x215f88){const _0x23c17f=a39_0x4106,_0x427bbd=_0x332ef2();while(!![]){try{const _0x117715=parseInt(_0x23c17f(0x18c))/0x1*(parseInt(_0x23c17f(0x198))/0x2)+-parseInt(_0x23c17f(0x1b7))/0x3+-parseInt(_0x23c17f(0x1ad))/0x4*(-parseInt(_0x23c17f(0x211))/0x5)+parseInt(_0x23c17f(0x1dd))/0x6+parseInt(_0x23c17f(0x1b9))/0x7+parseInt(_0x23c17f(0x1b3))/0x8*(parseInt(_0x23c17f(0x1a8))/0x9)+-parseInt(_0x23c17f(0x1fa))/0xa;if(_0x117715===_0x215f88)break;else _0x427bbd['push'](_0x427bbd['shift']());}catch(_0x4f2522){_0x427bbd['push'](_0x427bbd['shift']());}}}(a39_0x5374,0xcf02c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a39_0x4106(_0x1f0070,_0x3986d6){_0x1f0070=_0x1f0070-0x17b;const _0x5374c4=a39_0x5374();let _0x410695=_0x5374c4[_0x1f0070];return _0x410695;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a39_0x5374(){const _0x3bec7a=['\x20new','Fetching\x20existing\x20data...','\x20YAML\x20files\x20found','/sb/da/esr','β\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','journeyBundleName','\x20updated','journey','35538540dCnoUA','attributes','\x20changes?','join','data','\x20\x20Activations:','delete','file','listSegments','connection','\x20\x20\x20\x20','segment','filter','paused','filePath','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Preparing\x20journeys...','Folders\x20to\x20create:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','parent_name','resolveParentId','unchanged','1255QMtIRY','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/j/da/je','getJourney','\x20unchanged','Resolving\x20parent\x20segment\x20\x27','deleted','endsWith','listJourneysWithDetailsFromParentSegment','cwd','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','name','journeysOnly','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','isNew','\x20to\x20create','idToName','\x20\x20πΊοΈ\x20\x20Journeys:','138582MHJZnf','Source\x20directory:\x20','\x20\x20Journeys:\x20','diff','\x20\x20Segments:\x20','updatedAt','folderId','isScoped','map','createdAt','\x20created','segments','22sSaoce','dryRun','\x20deleted','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','buildUserMaps','no_parent','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment\x20or\x20journey','helpText','Scoped\x20to\x20folder:\x20','\x20folders\x20to\x20create','Site:\x20','nameToId','\x20activations]','activations','parentName','13377411wroeOR','toString','Delete\x20segment:','toCreate','results','23044BpGNeI','message','yellow','all','yes','journeyId','8MlfpLG','versionNumber','segment:push','error','4893426wObEAh','\x0aError:','8572837GZmjIu','repeat','\x20changed','audienceId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentSegment','changed','user','\x20to\x20delete','description','folderPath','cyan','existingJourney','No\x20','folders','new','journeyBundleId','targetDir','Error:\x20','journeys','push','green','updated','setPhase','yamlConfig','listActivations','dim','site','Fetching\x20existing\x20activations...','verbose','get','state','relationships','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','2108574dVgjWS','blue','createdSegmentIds','execute','created','.yml','New\x20journey:','\x20\x20π\x20Segments:','length','existingSegment','parentFolder','errorCode','Delete\x20journey:','red','/e/','/app/ps/','.yaml','toDelete','toUpdate','set'];a39_0x5374=function(){return _0x3bec7a;};return a39_0x5374();}import a39_0x3f7344 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{[a39_0x56fbcf(0x185)]=a39_0x56fbcf(0x1b5);[a39_0x56fbcf(0x1c2)]=a39_0x56fbcf(0x17b);async[a39_0x56fbcf(0x1e0)](_0x568a12){const _0x1ebfa7=a39_0x56fbcf,{options:_0xdc122f,args:_0x350951,tdx:_0x605cc4}=_0x568a12,_0x2ce474=_0xdc122f,_0x5b5126=await resolveTarget({'arg':_0x350951[0x0],'contextParent':_0xdc122f[_0x1ebfa7(0x1be)],'cwd':process[_0x1ebfa7(0x183)]()});if(!isSuccessfulResolution(_0x5b5126))return _0x5b5126[_0x1ebfa7(0x1e8)]===_0x1ebfa7(0x19d)?(console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)](_0x1ebfa7(0x19b))),console[_0x1ebfa7(0x1b6)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x20a)),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x20d))):(console[_0x1ebfa7(0x1b6)](a39_0x3f7344['red'](_0x1ebfa7(0x1cb)+_0x5b5126['message']+'\x0a')),_0x5b5126['helpText']&&console['error'](a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x5b5126[_0x1ebfa7(0x1a0)]))),0x1;if(_0x5b5126[_0x1ebfa7(0x209)]===_0x1ebfa7(0x20e))return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1da)+_0x5b5126['targetDir']+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3d1910=_0x5b5126[_0x1ebfa7(0x1a7)],_0x4f40bb=_0x5b5126[_0x1ebfa7(0x1ca)],_0x38797e=_0x5b5126[_0x1ebfa7(0x209)]===_0x1ebfa7(0x201)?_0x5b5126[_0x1ebfa7(0x208)]:undefined,_0x5b97b5=getScopedDetails(_0x5b5126),_0x344bfc=_0x5b97b5?.[_0x1ebfa7(0x193)]??![],_0x5a0c2f=_0x5b97b5?.['scopedFolderPath']??'';if(!existsSync(_0x4f40bb))return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1da)+_0x4f40bb+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1c4)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x2ce474[_0x1ebfa7(0x1d6)]&&(console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1a3)+_0x2ce474[_0x1ebfa7(0x1d4)]),console['error']('Parent\x20segment:\x20'+_0x3d1910),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18d)+_0x4f40bb),_0x344bfc&&console['error'](_0x1ebfa7(0x1a1)+_0x5a0c2f));const _0x24acda=await withSpinner(_0x1ebfa7(0x17f)+_0x3d1910+'\x27...',()=>_0x605cc4[_0x1ebfa7(0x205)][_0x1ebfa7(0x20f)](_0x3d1910),{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]}),_0x26b4fc=_0x24acda['data'],{parentSegmentResult:_0x3b830c,segmentsResult:_0x328b5d,foldersResult:_0x194c5e,journeysWithDetailsResult:_0x2098e8,userMaps:_0x321312}=await withSpinner(_0x1ebfa7(0x1f2),async()=>{const _0x280bc5=_0x1ebfa7,[_0x4a7ce1,_0x505768,_0x18784c,_0x5a7631,_0x1c171d]=await Promise[_0x280bc5(0x1b0)]([_0x605cc4[_0x280bc5(0x205)]['getParent'](_0x26b4fc),_0x605cc4[_0x280bc5(0x205)][_0x280bc5(0x202)](_0x26b4fc),_0x605cc4[_0x280bc5(0x205)]['listFolders'](_0x26b4fc),_0x605cc4['journey'][_0x280bc5(0x182)](_0x26b4fc,{'includeAllVersions':!![]}),_0x605cc4[_0x280bc5(0x1c0)][_0x280bc5(0x19c)]()]);return{'parentSegmentResult':_0x4a7ce1,'segmentsResult':_0x505768,'foldersResult':_0x18784c,'journeysWithDetailsResult':_0x5a7631,'userMaps':_0x1c171d};},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x31c162=>_0x31c162[_0x1ebfa7(0x1fe)]),_0x51d9f2=_0x3b830c,_0x5dd792=extractRootFolderId(_0x51d9f2),_0x4437d6=_0x328b5d,_0x346221=_0x194c5e,{journeys:_0x5d8c9c,activationStepsById:_0x109a6f}=_0x2098e8,_0x2335c7=new Map(_0x5d8c9c[_0x1ebfa7(0x194)](_0x4f28a5=>[_0x4f28a5['id'],_0x4f28a5])),_0x1e0d9f=_0x5d8c9c[_0x1ebfa7(0x194)](_0xbcd361=>({'id':_0xbcd361['id'],'name':_0xbcd361[_0x1ebfa7(0x1fb)]['name'],'journeyBundleName':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1f7)]||'','journeyBundleId':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1c9)]||'','versionNumber':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1b4)],'description':_0xbcd361['attributes']['description'],'state':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1d8)],'paused':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x207)],'audienceId':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1bc)],'folderId':_0xbcd361[_0x1ebfa7(0x1d9)]?.[_0x1ebfa7(0x1e7)]?.[_0x1ebfa7(0x1fe)]?.['id'],'createdAt':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x195)],'updatedAt':_0xbcd361['attributes'][_0x1ebfa7(0x191)]})),{emailToId:_0x3e625f,idToEmail:_0x1fa4d3}=_0x321312,_0x6037b1=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2fc798=_0x1ebfa7,_0x1fb452=await _0x605cc4[_0x2fc798(0x203)]['list']();return buildConnectionMaps(_0x1fb452);},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x34813e=>_0x34813e[_0x1ebfa7(0x1fe)]),_0x40ffb4=_0x6037b1[_0x1ebfa7(0x1a4)],_0x42af14=_0x6037b1['idToName'],_0x599adc=_0x6037b1['nameToType'],_0x2b3ce6={'emailToIdMap':_0x3e625f,'connectionNameToIdMap':_0x40ffb4,'connectionNameToTypeMap':_0x599adc,'getSchema':_0x2c9bc3=>_0x605cc4['connection']['getOutputSchemaWithCache'](_0x2c9bc3)};let {pathToId:_0x14e649,idToPath:_0x48b5fc}=buildFolderMaps(_0x346221);const _0x6b8145=buildSegmentLookupMap(_0x4437d6,_0x48b5fc),_0x1f1b04=buildSegmentNameToIdMap(_0x4437d6),_0x31ad98=buildJourneyBundleLookupMap(_0x1e0d9f,_0x48b5fc);let _0x334511;if(_0x38797e){if(!_0x38797e[_0x1ebfa7(0x181)](_0x1ebfa7(0x1e2))&&!_0x38797e[_0x1ebfa7(0x181)](_0x1ebfa7(0x1ed)))return console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x38797e+'\x0a')),0x1;_0x334511=[_0x38797e];}else _0x334511=findYamlFiles(_0x4f40bb);if(_0x334511[_0x1ebfa7(0x1e5)]===0x0)return console[_0x1ebfa7(0x1b6)](a39_0x3f7344['red'](_0x1ebfa7(0x1bd)+_0x4f40bb+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344['cyan'](_0x1ebfa7(0x184))),0x1;let _0x70eb8c,_0x42edb1;try{const _0x2dbdc5=parseAndClassifyYamlFiles(_0x334511,_0x4f40bb,{'skipSegments':_0x2ce474[_0x1ebfa7(0x186)]});_0x70eb8c=_0x2dbdc5[_0x1ebfa7(0x197)],_0x42edb1=_0x2dbdc5[_0x1ebfa7(0x1cc)];const _0x1ae04b=validateParsedFiles(_0x2dbdc5,_0x4f40bb);if(_0x1ae04b[_0x1ebfa7(0x1e5)]>0x0)return console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('\x0aValidation\x20failed:')),console[_0x1ebfa7(0x1b6)](formatValidationErrors(_0x1ae04b)),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1cd486){return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)]('Error\x20parsing\x20YAML:\x20'+(_0x1cd486 instanceof Error?_0x1cd486[_0x1ebfa7(0x1ae)]:_0x1cd486))),0x1;}if(_0x70eb8c[_0x1ebfa7(0x1e5)]===0x0&&_0x42edb1[_0x1ebfa7(0x1e5)]===0x0){const _0x29325e=_0x2ce474[_0x1ebfa7(0x186)]?_0x1ebfa7(0x1f9):_0x1ebfa7(0x19f);return console[_0x1ebfa7(0x1b6)](a39_0x3f7344['yellow'](_0x1ebfa7(0x1c6)+_0x29325e+_0x1ebfa7(0x1f3))),0x0;}const _0x1fbe38=new Map();_0x4437d6[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&await withSpinner(_0x1ebfa7(0x1d5),async()=>{await batchAsync(_0x4437d6,async _0x3f04e6=>{const _0x1bb821=a39_0x4106,_0x4498f4=await _0x605cc4['segment'][_0x1bb821(0x1d2)](_0x26b4fc,_0x3f04e6['id']);_0x1fbe38[_0x1bb821(0x1f0)](_0x3f04e6['id'],_0x4498f4);});},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]});const {segmentFiles:_0x5c50b9,foldersToCreate:_0x474c57}=await prepareSegmentFiles(_0x70eb8c,{'segmentByFolderAndName':_0x6b8145,'activationsBySegmentId':_0x1fbe38,'folderPathToId':_0x14e649,'idToEmailMap':_0x1fa4d3,'connectionIdToNameMap':_0x42af14},_0x2b3ce6,_0x344bfc,_0x5a0c2f),_0x16f572=_0x38797e?[]:findSegmentsToDelete(_0x4437d6,_0x70eb8c[_0x1ebfa7(0x194)](({yamlConfig:_0x47c540,folderPath:_0x695ae4})=>({'yamlConfig':_0x47c540,'folderPath':resolveTDFolderPath(_0x695ae4,_0x344bfc,_0x5a0c2f)})),_0x48b5fc,_0x5a0c2f,_0x344bfc),{journeyFiles:_0x47a552,foldersToCreate:_0x43b327}=await withProgressSpinner(_0x1ebfa7(0x20b),async _0xf84429=>prepareJourneyFiles(_0x42edb1,{'fetchJourney':async _0x571ba8=>_0x605cc4[_0x1ebfa7(0x1f9)][_0x1ebfa7(0x17d)](_0x571ba8[_0x1ebfa7(0x1b2)]),'journeyBundlesByFolderAndName':_0x31ad98,'folderPathToId':_0x14e649,'idToEmailMap':_0x1fa4d3,'connectionIdToNameMap':_0x42af14,'existingSegments':_0x4437d6,'parentId':_0x26b4fc,'deps':_0x605cc4,'progress':{'update':_0x2c93d2=>{const _0x3ba0d5=_0x1ebfa7;_0xf84429[_0x3ba0d5(0x1d0)](_0x2c93d2),_0x2ce474['verbose']&&console[_0x3ba0d5(0x1b6)]('\x20\x20'+_0x2c93d2);}},'journeyById':_0x2335c7,'activationStepsById':_0x109a6f},_0x344bfc,_0x5a0c2f),{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x4cc9e6=>_0x4cc9e6['data']);for(const _0x1e8fa8 of _0x43b327){_0x474c57['add'](_0x1e8fa8);}const _0xc5bc54=_0x38797e?[]:findJourneysToDelete(_0x1e0d9f,_0x42edb1[_0x1ebfa7(0x194)](({yamlConfig:_0xdec5df,folderPath:_0x40f1b8})=>({'yamlConfig':_0xdec5df,'folderPath':resolveTDFolderPath(_0x40f1b8,_0x344bfc,_0x5a0c2f)})),_0x48b5fc,_0x5a0c2f,_0x344bfc),_0x323c14=calculatePushStats(_0x5c50b9,_0x47a552,_0x474c57,_0x16f572,_0xc5bc54,!!_0x2ce474[_0x1ebfa7(0x200)],!!_0x2ce474[_0x1ebfa7(0x186)]),_0x2dcf82=_0x323c14['segments'][_0x1ebfa7(0x1c8)],_0x575ebe=_0x323c14[_0x1ebfa7(0x197)]['changed'],_0x3bf774=_0x323c14[_0x1ebfa7(0x197)][_0x1ebfa7(0x210)],_0x425613=_0x323c14['segments'][_0x1ebfa7(0x1ee)],_0x3411ee=_0x323c14[_0x1ebfa7(0x1c7)]['toCreate'],_0x420e1e=_0x323c14['journeys']['new'],_0x41cc09=_0x323c14['journeys'][_0x1ebfa7(0x1bf)],_0x2cb846=_0x323c14['journeys'][_0x1ebfa7(0x210)],_0x192e92=_0x323c14[_0x1ebfa7(0x1cc)]['toDelete'],_0x418f8a=_0x323c14['activations'][_0x1ebfa7(0x1b0)],_0x3c90f6=_0x323c14[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x1ab)],_0x3ffdfd=_0x323c14['activations'][_0x1ebfa7(0x1ef)],_0x416d81=_0x323c14[_0x1ebfa7(0x1a6)]['toDelete'];console[_0x1ebfa7(0x1b6)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3d1910+'\x27:');_0x3411ee[_0x1ebfa7(0x1e5)]>0x0&&console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1de)]('π\x20'+_0x3411ee[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1a2)));if(!_0x2ce474['journeysOnly']){console['error'](_0x1ebfa7(0x1e4)),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x2dcf82['length']+_0x1ebfa7(0x1f1))),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344['yellow']('~\x20'+_0x575ebe[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1bb)));if(_0x425613['length']>0x0)console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ea)]('-\x20'+_0x425613[_0x1ebfa7(0x1e5)]+'\x20to\x20delete'));else _0x16f572[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x200)]&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)](_0x16f572[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x19e)));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)]('=\x20'+_0x3bf774[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x17e)));}if(_0x47a552[_0x1ebfa7(0x1e5)]>0x0||_0xc5bc54[_0x1ebfa7(0x1e5)]>0x0){console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18b)),console['error']('\x20\x20\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x420e1e[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1f1))),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344['yellow']('~\x20'+_0x41cc09[_0x1ebfa7(0x1e5)]+'\x20changed'));if(_0x192e92[_0x1ebfa7(0x1e5)]>0x0)console[_0x1ebfa7(0x1b6)]('\x20\x20\x20\x20'+a39_0x3f7344['red']('-\x20'+_0x192e92[_0x1ebfa7(0x1e5)]+'\x20to\x20delete'));else _0xc5bc54[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x200)]&&console[_0x1ebfa7(0x1b6)]('\x20\x20\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1d3)](_0xc5bc54[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x19e)));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)]('=\x20'+_0x2cb846[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x17e)));}_0x418f8a[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&(console[_0x1ebfa7(0x1b6)](''),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1ff)),_0x3c90f6[_0x1ebfa7(0x1e5)]>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x3c90f6['length']+_0x1ebfa7(0x189))),_0x3ffdfd[_0x1ebfa7(0x1e5)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x3f7344['yellow']('~\x20'+_0x3ffdfd[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1dc))),_0x416d81['length']>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ea)]('-\x20'+_0x416d81[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1c1))));console['error']('\x20\x20Source:\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x4f40bb)+'\x0a');if(_0x3411ee[_0x1ebfa7(0x1e5)]>0x0){console['error'](_0x1ebfa7(0x20c));for(const _0x47b279 of _0x3411ee){console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1de)]('+')+'\x20'+_0x47b279);}console[_0x1ebfa7(0x1b6)]('');}if(_0x2dcf82['length']>0x0&&!_0x2ce474[_0x1ebfa7(0x186)])for(const _0x52e78c of _0x2dcf82){const _0x5e32ac=_0x52e78c['folderPath']?_0x52e78c[_0x1ebfa7(0x1c3)]+'/'+_0x52e78c['yamlConfig']['name']:_0x52e78c[_0x1ebfa7(0x1d1)]['name'],_0x515901=_0x52e78c[_0x1ebfa7(0x1d1)]['activations']?.[_0x1ebfa7(0x1e5)]||0x0,_0x2f8dbb=_0x515901>0x0?a39_0x3f7344['dim']('\x20['+_0x515901+_0x1ebfa7(0x1a5)):'';console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ce)]('New\x20segment:')+'\x20'+_0x5e32ac+_0x2f8dbb),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c)),_0x52e78c[_0x1ebfa7(0x18f)]&&console[_0x1ebfa7(0x1b6)](_0x52e78c[_0x1ebfa7(0x18f)]),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x425613[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474['journeysOnly'])for(const _0x28a705 of _0x425613){const _0x16c7a2=_0x28a705['segmentFolderId']?_0x48b5fc[_0x1ebfa7(0x1d7)](_0x28a705['segmentFolderId'][_0x1ebfa7(0x1a9)]())||'':'',_0xddd106=_0x16c7a2?_0x16c7a2+'/'+_0x28a705[_0x1ebfa7(0x185)]:_0x28a705['name'],_0x3e0f14=_0x1fbe38[_0x1ebfa7(0x1d7)](_0x28a705['id'])||[],_0x5231c6=_0x3e0f14['length']>0x0?a39_0x3f7344['dim']('\x20['+_0x3e0f14['length']+'\x20activations]'):'';console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344['red'](_0x1ebfa7(0x1aa))+'\x20'+_0xddd106+_0x5231c6),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c));const _0x15dff6=segmentWithActivationsToYaml(_0x28a705,_0x3e0f14,undefined,_0x1fa4d3,_0x42af14),_0x41ee1a=segmentToYamlString(_0x15dff6),_0xcd2b30=generateDiff(_0x41ee1a,'');console[_0x1ebfa7(0x1b6)](formatDiffWithColors(_0xcd2b30)),console['error']('β'['repeat'](0x3c));}const _0x235780=_0x5c50b9[_0x1ebfa7(0x206)](_0x424c56=>!_0x424c56[_0x1ebfa7(0x188)]&&_0x424c56[_0x1ebfa7(0x18f)]);if(_0x235780[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)])for(const _0x2757ad of _0x235780){const _0x13e891=_0x2757ad[_0x1ebfa7(0x1c3)]?_0x2757ad[_0x1ebfa7(0x1c3)]+'/'+_0x2757ad['yamlConfig'][_0x1ebfa7(0x185)]:_0x2757ad[_0x1ebfa7(0x1d1)]['name'];console['error']('\x0a'+a39_0x3f7344['yellow']('Changes\x20to:')+'\x20'+_0x13e891),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](_0x2757ad['diff']),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x420e1e[_0x1ebfa7(0x1e5)]>0x0)for(const _0x3e82ef of _0x420e1e){const _0x3607ac=_0x3e82ef[_0x1ebfa7(0x1c3)]?_0x3e82ef[_0x1ebfa7(0x1c3)]+'/'+_0x3e82ef['yamlConfig'][_0x1ebfa7(0x185)]:_0x3e82ef[_0x1ebfa7(0x1d1)][_0x1ebfa7(0x185)];console['error']('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ce)](_0x1ebfa7(0x1e3))+'\x20'+_0x3607ac),console[_0x1ebfa7(0x1b6)]('β'['repeat'](0x3c)),_0x3e82ef[_0x1ebfa7(0x18f)]&&console['error'](_0x3e82ef[_0x1ebfa7(0x18f)]),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c));}const _0x23c55f=_0x47a552[_0x1ebfa7(0x206)](_0x4524ee=>!_0x4524ee[_0x1ebfa7(0x188)]&&_0x4524ee[_0x1ebfa7(0x18f)]);if(_0x23c55f['length']>0x0)for(const _0x40dc07 of _0x23c55f){const _0x4be684=_0x40dc07[_0x1ebfa7(0x1c3)]?_0x40dc07[_0x1ebfa7(0x1c3)]+'/'+_0x40dc07[_0x1ebfa7(0x1d1)][_0x1ebfa7(0x185)]:_0x40dc07['yamlConfig'][_0x1ebfa7(0x185)];console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x4be684),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](_0x40dc07['diff']),console['error']('β'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x192e92[_0x1ebfa7(0x1e5)]>0x0)for(const _0x434590 of _0x192e92){const _0x3e12df=_0x434590[_0x1ebfa7(0x192)]?_0x48b5fc[_0x1ebfa7(0x1d7)](_0x434590[_0x1ebfa7(0x192)])||'':'',_0x128064=_0x3e12df?_0x3e12df+'/'+_0x434590[_0x1ebfa7(0x1f7)]:_0x434590[_0x1ebfa7(0x1f7)];console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1e9))+'\x20'+_0x128064),console[_0x1ebfa7(0x1b6)]('β'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)]('(Journey\x20will\x20be\x20deleted)')),console[_0x1ebfa7(0x1b6)]('β'['repeat'](0x3c));}if(_0x2ce474[_0x1ebfa7(0x199)])return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)](_0x1ebfa7(0x1f6))),0x0;const _0x9c8d82=_0x2ce474['journeysOnly']?![]:_0x2dcf82[_0x1ebfa7(0x1e5)]>0x0||_0x575ebe[_0x1ebfa7(0x1e5)]>0x0||_0x425613[_0x1ebfa7(0x1e5)]>0x0,_0x562d3c=_0x420e1e[_0x1ebfa7(0x1e5)]>0x0||_0x41cc09['length']>0x0||_0x192e92[_0x1ebfa7(0x1e5)]>0x0,_0x28be3d=_0x2ce474[_0x1ebfa7(0x186)]?![]:_0x418f8a[_0x1ebfa7(0x1e5)]>0x0,_0x3ac517=_0x3411ee[_0x1ebfa7(0x1e5)]>0x0;if(!_0x9c8d82&&!_0x562d3c&&!_0x28be3d&&!_0x3ac517){const _0x486c43=_0x2ce474[_0x1ebfa7(0x186)]?_0x1ebfa7(0x1f5):'β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x1ebfa7(0x1b6)](a39_0x3f7344['green'](_0x486c43));if(_0x38797e&&_0x3bf774['length']===0x1){const _0x373ec0=_0x3bf774[0x0];if(_0x373ec0[_0x1ebfa7(0x1e6)]?.['id']){const _0x226667=getConsoleNextUrl(_0x2ce474['site'],_0x1ebfa7(0x1ec)+_0x26b4fc+'/e/'+_0x373ec0[_0x1ebfa7(0x1e6)]['id']+_0x1ebfa7(0x1f4));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1db)+a39_0x3f7344['cyan'](_0x226667));}}if(_0x38797e&&_0x2cb846[_0x1ebfa7(0x1e5)]===0x1){const _0x1b7642=_0x2cb846[0x0];if(_0x1b7642['existingJourney']?.['id']){const _0x4cde9e=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],_0x1ebfa7(0x1ec)+_0x26b4fc+'/e/'+_0x1b7642[_0x1ebfa7(0x1c5)]['id']+_0x1ebfa7(0x17c));console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x4cde9e));}}return 0x0;}const _0x3a92fb=_0x2ce474['journeysOnly']?_0x420e1e['length']+_0x41cc09[_0x1ebfa7(0x1e5)]+_0x192e92[_0x1ebfa7(0x1e5)]+_0x3411ee[_0x1ebfa7(0x1e5)]:_0x2dcf82[_0x1ebfa7(0x1e5)]+_0x575ebe['length']+_0x425613[_0x1ebfa7(0x1e5)]+_0x420e1e[_0x1ebfa7(0x1e5)]+_0x41cc09[_0x1ebfa7(0x1e5)]+_0x192e92[_0x1ebfa7(0x1e5)]+_0x3411ee[_0x1ebfa7(0x1e5)]+_0x418f8a[_0x1ebfa7(0x1e5)];if(!_0x2ce474[_0x1ebfa7(0x1b1)]&&_0x3a92fb>0x0){if(!isInteractive())return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1b8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1d3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x35989a=await confirmKey('Push\x20'+_0x3a92fb+_0x1ebfa7(0x1fc));if(!_0x35989a)return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)]('Aborted.')),0x1;}const _0x5e26e6={'withProgress':async(_0x22be99,_0x87939f)=>{const _0xd6f7f4=_0x1ebfa7,_0xacb18b=await withSpinner(_0x22be99,_0x87939f,{'verbose':_0x2ce474[_0xd6f7f4(0x1d6)]});return{'data':_0xacb18b[_0xd6f7f4(0x1fe)]};},'logInfo':_0x50a092=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1de)]('β\x20'+_0x50a092)),'logSuccess':_0x4adc27=>console[_0x1ebfa7(0x1b6)](a39_0x3f7344['green']('β\x20'+_0x4adc27)),'logWarning':_0x31f058=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1af)]('β \x20'+_0x31f058)),'logDeleted':_0x5f555b=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('β\x20'+_0x5f555b))},_0x3c97cf={'segment':_0x605cc4[_0x1ebfa7(0x205)],'journey':_0x605cc4['journey'],'user':_0x605cc4[_0x1ebfa7(0x1c0)],'connection':_0x605cc4[_0x1ebfa7(0x203)]};_0x3411ee[_0x1ebfa7(0x1e5)]>0x0&&(_0x14e649=await executePushFolders(_0x3c97cf,_0x3411ee,_0x14e649,{'parentId':_0x26b4fc},_0x5e26e6));const _0x47a9c3={'rootFolderId':_0x5dd792,'folderPathToId':_0x14e649,'folderIdToPath':_0x48b5fc,'segmentNameToId':_0x1f1b04,'activationsBySegmentId':_0x1fbe38,'emailToIdMap':_0x3e625f,'idToEmailMap':_0x1fa4d3,'connectionNameToIdMap':_0x6037b1[_0x1ebfa7(0x1a4)],'connectionIdToNameMap':_0x6037b1[_0x1ebfa7(0x18a)],'connectionNameToTypeMap':_0x599adc},_0x30865c=await executePushSegments(_0x3c97cf,_0x2ce474[_0x1ebfa7(0x186)]?[]:_0x5c50b9,_0x47a9c3,{'parentId':_0x26b4fc},_0x5e26e6),_0x173426=_0x30865c[_0x1ebfa7(0x1e1)],_0x580c3e=_0x30865c[_0x1ebfa7(0x1cf)],_0x3b0eca=_0x30865c[_0x1ebfa7(0x1a6)]['created'],_0x5e3a18=_0x30865c[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x1cf)],_0x1910a3=_0x30865c[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x180)];let _0x9b1c3b;if(_0x38797e&&_0x5c50b9[_0x1ebfa7(0x1e5)]===0x1){const _0x54885d=_0x5c50b9[0x0];_0x9b1c3b=_0x54885d[_0x1ebfa7(0x1e6)]?.['id']??_0x30865c[_0x1ebfa7(0x1df)][_0x1ebfa7(0x1d7)](_0x54885d[_0x1ebfa7(0x1d1)]['name']);}const _0x1ceebf=await executePushSegmentDeletions(_0x3c97cf,_0x2ce474[_0x1ebfa7(0x186)]?[]:_0x425613,_0x5e26e6);let _0x358e50=0x0,_0x55e924=0x0,_0x5b9c92=0x0;const _0x4d263f=new Map(_0x1f1b04);for(const [_0x27cf7d,_0x2f691c]of _0x30865c[_0x1ebfa7(0x1df)]){_0x4d263f['set'](_0x27cf7d,_0x2f691c);}if(_0x47a552[_0x1ebfa7(0x1e5)]>0x0){const _0x51615d={..._0x47a9c3,'segmentNameToId':_0x4d263f,'existingSegments':_0x4437d6,'activationContext':_0x2b3ce6},_0x11dcd2=await executePushJourneys(_0x3c97cf,_0x47a552,_0x51615d,{'parentId':_0x26b4fc,'rootFolderId':_0x5dd792,'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]},_0x5e26e6);_0x358e50=_0x11dcd2[_0x1ebfa7(0x1e1)],_0x55e924=_0x11dcd2[_0x1ebfa7(0x1cf)];if(_0x38797e&&_0x11dcd2[_0x1ebfa7(0x1ac)][_0x1ebfa7(0x1e5)]===0x1){const _0x540c93=_0x11dcd2[_0x1ebfa7(0x1ac)][0x0];if(_0x540c93['journeyId']){const _0x1ad484=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],_0x1ebfa7(0x1ec)+_0x26b4fc+_0x1ebfa7(0x1eb)+_0x540c93['journeyId']+_0x1ebfa7(0x17c));console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x1ad484));}}}for(const _0x583b72 of _0x192e92){console[_0x1ebfa7(0x1b6)](a39_0x3f7344['yellow'](_0x1ebfa7(0x187)+_0x583b72['journeyBundleName'])),_0x5b9c92++;}const _0x257d5c=[];if(_0x173426>0x0)_0x257d5c['push'](_0x173426+_0x1ebfa7(0x196));if(_0x580c3e>0x0)_0x257d5c[_0x1ebfa7(0x1cd)](_0x580c3e+'\x20updated');if(_0x1ceebf>0x0)_0x257d5c['push'](_0x1ceebf+'\x20deleted');const _0x15aebd=[];if(_0x358e50>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x358e50+_0x1ebfa7(0x196));if(_0x55e924>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x55e924+_0x1ebfa7(0x1f8));if(_0x5b9c92>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x5b9c92+_0x1ebfa7(0x19a));const _0x78791c=[];if(_0x3b0eca>0x0)_0x78791c['push'](_0x3b0eca+_0x1ebfa7(0x196));if(_0x5e3a18>0x0)_0x78791c[_0x1ebfa7(0x1cd)](_0x5e3a18+_0x1ebfa7(0x1f8));if(_0x1910a3>0x0)_0x78791c[_0x1ebfa7(0x1cd)](_0x1910a3+_0x1ebfa7(0x19a));console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ce)]('\x0aβ\x20Push\x20complete'));_0x257d5c['length']>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x190)+_0x257d5c[_0x1ebfa7(0x1fd)](',\x20'));_0x15aebd['length']>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18e)+_0x15aebd['join'](',\x20'));_0x78791c[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&console['error']('\x20\x20Activations:\x20'+_0x78791c[_0x1ebfa7(0x1fd)](',\x20'));if(_0x9b1c3b){const _0x3adb8f=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],'/app/ps/'+_0x26b4fc+_0x1ebfa7(0x1eb)+_0x9b1c3b+_0x1ebfa7(0x1f4));console['error'](_0x1ebfa7(0x1db)+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x3adb8f));}return 0x0;}}
|
|
1
|
+
const a39_0xfaa8b4=a39_0x3b14;(function(_0x54a623,_0x1b0f93){const _0x5965f3=a39_0x3b14,_0x16b4ad=_0x54a623();while(!![]){try{const _0x2b618e=parseInt(_0x5965f3(0x181))/0x1+-parseInt(_0x5965f3(0x199))/0x2*(parseInt(_0x5965f3(0x196))/0x3)+parseInt(_0x5965f3(0x10b))/0x4+parseInt(_0x5965f3(0x124))/0x5+parseInt(_0x5965f3(0x138))/0x6+-parseInt(_0x5965f3(0x10a))/0x7*(-parseInt(_0x5965f3(0x140))/0x8)+-parseInt(_0x5965f3(0x146))/0x9;if(_0x2b618e===_0x1b0f93)break;else _0x16b4ad['push'](_0x16b4ad['shift']());}catch(_0x4191ad){_0x16b4ad['push'](_0x16b4ad['shift']());}}}(a39_0x5aae,0x68fe8));import{BaseCommand}from'./command.js';function a39_0x5aae(){const _0x39d8f7=['then','yes','/j/da/je','existingJourney','2012605WBUvKZ','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','connection','site','journeyBundleName','updatedAt','toDelete','setPhase','errorCode','set','get','segment\x20or\x20journey','verbose','delete','cyan','updated','helpText','cwd','description','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','2301192CpENtf','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resolveParentId','green','list','isScoped','\x20new','listActivations','776vnhOuE','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','add','\x20created','parentSegment','\x20\x20Activations:','5978511BBgAqh','Delete\x20segment:','results','type','message','\x20\x20Segments:\x20','\x20unchanged','dryRun','β\x20All\x20journeys\x20are\x20up\x20to\x20date','Error:\x20Directory\x20not\x20found:\x20','\x20YAML\x20files\x20found','/sb/da/esr','segments','audienceId','journeysOnly','paused','map','filePath','length','red','error','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20deleted','No\x20','.yml','\x20\x20\x20\x20','\x20to\x20delete','getParent','join','relationships','\x20\x20Source:\x20','push','Aborted.','\x20\x20π\x20Segments:','Push\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','createdSegmentIds','\x0aError:','activations','listJourneysWithDetailsFromParentSegment','targetDir','isNew','\x20activations]','yamlConfig','\x20folders\x20to\x20create','π\x20','Fetching\x20existing\x20data...','segmentFolderId','existingSegment','versionNumber','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_name','journeyId','all','getJourney','Error:\x20','created','data','Site:\x20','214760XQIjof','Resolving\x20parent\x20segment\x20\x27','attributes','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/app/ps/','.yaml','endsWith','(Journey\x20will\x20be\x20deleted)','idToName','filter','\x20changes?','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','state','New\x20journey:','journey','repeat','\x0aβ\x20Push\x20complete','changed','journeyBundleId','Delete\x20journey:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','47004mHeorC','unchanged','name','98rghAvc','segment','file','dim','blue','deleted','nameToType','\x20updated','yellow','Fetching\x20existing\x20activations...','toUpdate','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','nameToId','19579LaYPDi','2359780OSCOsx','Folders\x20to\x20create:','new','diff','Changes\x20to:','Scoped\x20to\x20folder:\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)','\x20to\x20update','\x0aPush\x20summary\x20for\x20\x27','New\x20segment:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x27...','/e/','Parent\x20segment:\x20','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','journeys','buildUserMaps','\x20to\x20create','folderPath','toString','folderId'];a39_0x5aae=function(){return _0x39d8f7;};return a39_0x5aae();}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x3b14(_0x327ee8,_0x593d74){_0x327ee8=_0x327ee8-0x103;const _0x5aae23=a39_0x5aae();let _0x3b14db=_0x5aae23[_0x327ee8];return _0x3b14db;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x5280e9 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{[a39_0xfaa8b4(0x198)]='segment:push';[a39_0xfaa8b4(0x136)]=a39_0xfaa8b4(0x108);async['execute'](_0x573a94){const _0x5d156e=a39_0xfaa8b4,{options:_0x41ac0f,args:_0x212c45,tdx:_0x183f03}=_0x573a94,_0x2fe048=_0x41ac0f,_0x171d2f=await resolveTarget({'arg':_0x212c45[0x0],'contextParent':_0x41ac0f[_0x5d156e(0x144)],'cwd':process[_0x5d156e(0x135)]()});if(!isSuccessfulResolution(_0x171d2f))return _0x171d2f[_0x5d156e(0x12c)]==='no_parent'?(console[_0x5d156e(0x15a)](a39_0x5280e9['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5d156e(0x15a)](_0x5d156e(0x111)),console[_0x5d156e(0x15a)]('\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'](_0x5d156e(0x169))):(console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x17d)+_0x171d2f[_0x5d156e(0x14a)]+'\x0a')),_0x171d2f[_0x5d156e(0x134)]&&console['error'](a39_0x5280e9[_0x5d156e(0x132)](_0x171d2f[_0x5d156e(0x134)]))),0x1;if(_0x171d2f['type']===_0x5d156e(0x179))return console['error'](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x14f)+_0x171d2f[_0x5d156e(0x16e)]+'\x0a')),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x132)](_0x5d156e(0x139))),0x1;const _0x780f7=_0x171d2f['parentName'],_0x2a9cd8=_0x171d2f['targetDir'],_0x3c5a11=_0x171d2f[_0x5d156e(0x149)]===_0x5d156e(0x19b)?_0x171d2f[_0x5d156e(0x157)]:undefined,_0x1563b1=getScopedDetails(_0x171d2f),_0x25c730=_0x1563b1?.[_0x5d156e(0x13d)]??![],_0x4b9fa6=_0x1563b1?.['scopedFolderPath']??'';if(!existsSync(_0x2a9cd8))return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2a9cd8+'\x0a')),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x132)](_0x5d156e(0x139))),0x1;_0x2fe048['verbose']&&(console['error'](_0x5d156e(0x180)+_0x2fe048[_0x5d156e(0x127)]),console['error'](_0x5d156e(0x118)+_0x780f7),console[_0x5d156e(0x15a)]('Source\x20directory:\x20'+_0x2a9cd8),_0x25c730&&console['error'](_0x5d156e(0x110)+_0x4b9fa6));const _0x4452c7=await withSpinner(_0x5d156e(0x182)+_0x780f7+_0x5d156e(0x116),()=>_0x183f03['segment'][_0x5d156e(0x13a)](_0x780f7),{'verbose':_0x2fe048[_0x5d156e(0x130)]}),_0x5f343e=_0x4452c7[_0x5d156e(0x17f)],{parentSegmentResult:_0x2225cf,segmentsResult:_0x41ace4,foldersResult:_0x5ce1d3,journeysWithDetailsResult:_0x3e7d1b,userMaps:_0x4742d6}=await withSpinner(_0x5d156e(0x174),async()=>{const _0x1e1fce=_0x5d156e,[_0x50ccbb,_0x435741,_0x10254d,_0x5aca6f,_0x158008]=await Promise[_0x1e1fce(0x17b)]([_0x183f03[_0x1e1fce(0x19a)][_0x1e1fce(0x161)](_0x5f343e),_0x183f03[_0x1e1fce(0x19a)]['listSegments'](_0x5f343e),_0x183f03[_0x1e1fce(0x19a)]['listFolders'](_0x5f343e),_0x183f03[_0x1e1fce(0x18f)][_0x1e1fce(0x16d)](_0x5f343e,{'includeAllVersions':!![]}),_0x183f03['user'][_0x1e1fce(0x11b)]()]);return{'parentSegmentResult':_0x50ccbb,'segmentsResult':_0x435741,'foldersResult':_0x10254d,'journeysWithDetailsResult':_0x5aca6f,'userMaps':_0x158008};},{'verbose':_0x2fe048[_0x5d156e(0x130)]})['then'](_0x3e887d=>_0x3e887d[_0x5d156e(0x17f)]),_0x4b1273=_0x2225cf,_0x315045=extractRootFolderId(_0x4b1273),_0x24d029=_0x41ace4,_0x1205f7=_0x5ce1d3,{journeys:_0x26bf6b,activationStepsById:_0x2618a8}=_0x3e7d1b,_0x176255=new Map(_0x26bf6b[_0x5d156e(0x156)](_0x35d05f=>[_0x35d05f['id'],_0x35d05f])),_0x211b3c=_0x26bf6b[_0x5d156e(0x156)](_0xc12a30=>({'id':_0xc12a30['id'],'name':_0xc12a30['attributes'][_0x5d156e(0x198)],'journeyBundleName':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x128)]||'','journeyBundleId':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x193)]||'','versionNumber':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x177)],'description':_0xc12a30['attributes'][_0x5d156e(0x136)],'state':_0xc12a30['attributes'][_0x5d156e(0x18d)],'paused':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x155)],'audienceId':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x153)],'folderId':_0xc12a30[_0x5d156e(0x163)]?.['parentFolder']?.[_0x5d156e(0x17f)]?.['id'],'createdAt':_0xc12a30[_0x5d156e(0x183)]['createdAt'],'updatedAt':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x129)]})),{emailToId:_0x49ac12,idToEmail:_0x2d5b01}=_0x4742d6,_0x1ca6bc=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x54a6d7=_0x5d156e,_0x16e01c=await _0x183f03[_0x54a6d7(0x126)][_0x54a6d7(0x13c)]();return buildConnectionMaps(_0x16e01c);},{'verbose':_0x2fe048[_0x5d156e(0x130)]})[_0x5d156e(0x120)](_0x1b2c73=>_0x1b2c73[_0x5d156e(0x17f)]),_0x1446ec=_0x1ca6bc[_0x5d156e(0x109)],_0xfaaeb4=_0x1ca6bc[_0x5d156e(0x189)],_0x3b243d=_0x1ca6bc[_0x5d156e(0x103)],_0x427afa={'emailToIdMap':_0x49ac12,'connectionNameToIdMap':_0x1446ec,'connectionNameToTypeMap':_0x3b243d,'getSchema':_0x46b89f=>_0x183f03['connection']['getOutputSchemaWithCache'](_0x46b89f)};let {pathToId:_0x2c65e7,idToPath:_0x1a0b98}=buildFolderMaps(_0x1205f7);const _0x555231=buildSegmentLookupMap(_0x24d029,_0x1a0b98),_0x46ca0f=buildSegmentNameToIdMap(_0x24d029),_0x1199f6=buildJourneyBundleLookupMap(_0x211b3c,_0x1a0b98);let _0x2d0d1f;if(_0x3c5a11){if(!_0x3c5a11[_0x5d156e(0x187)](_0x5d156e(0x15e))&&!_0x3c5a11['endsWith'](_0x5d156e(0x186)))return console['error'](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x15b)+_0x3c5a11+'\x0a')),0x1;_0x2d0d1f=[_0x3c5a11];}else _0x2d0d1f=findYamlFiles(_0x2a9cd8);if(_0x2d0d1f[_0x5d156e(0x158)]===0x0)return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x18c)+_0x2a9cd8+'\x0a')),console['error'](a39_0x5280e9[_0x5d156e(0x132)](_0x5d156e(0x184))),0x1;let _0x4a9df4,_0x4122f5;try{const _0x30a8dc=parseAndClassifyYamlFiles(_0x2d0d1f,_0x2a9cd8,{'skipSegments':_0x2fe048['journeysOnly']});_0x4a9df4=_0x30a8dc['segments'],_0x4122f5=_0x30a8dc['journeys'];const _0x4c9294=validateParsedFiles(_0x30a8dc,_0x2a9cd8);if(_0x4c9294[_0x5d156e(0x158)]>0x0)return console['error'](a39_0x5280e9[_0x5d156e(0x159)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x4c9294)),console[_0x5d156e(0x15a)](a39_0x5280e9['yellow'](_0x5d156e(0x195))),0x1;}catch(_0x4383ef){return console['error'](a39_0x5280e9[_0x5d156e(0x159)]('Error\x20parsing\x20YAML:\x20'+(_0x4383ef instanceof Error?_0x4383ef[_0x5d156e(0x14a)]:_0x4383ef))),0x1;}if(_0x4a9df4[_0x5d156e(0x158)]===0x0&&_0x4122f5['length']===0x0){const _0x23ee0f=_0x2fe048[_0x5d156e(0x154)]?_0x5d156e(0x18f):_0x5d156e(0x12f);return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x15d)+_0x23ee0f+_0x5d156e(0x150))),0x0;}const _0x5eaf72=new Map();_0x24d029[_0x5d156e(0x158)]>0x0&&!_0x2fe048['journeysOnly']&&await withSpinner(_0x5d156e(0x106),async()=>{await batchAsync(_0x24d029,async _0x523baa=>{const _0xbb40c7=a39_0x3b14,_0x4520c7=await _0x183f03[_0xbb40c7(0x19a)][_0xbb40c7(0x13f)](_0x5f343e,_0x523baa['id']);_0x5eaf72[_0xbb40c7(0x12d)](_0x523baa['id'],_0x4520c7);});},{'verbose':_0x2fe048[_0x5d156e(0x130)]});const {segmentFiles:_0x5d31fe,foldersToCreate:_0x450643}=await prepareSegmentFiles(_0x4a9df4,{'segmentByFolderAndName':_0x555231,'activationsBySegmentId':_0x5eaf72,'folderPathToId':_0x2c65e7,'idToEmailMap':_0x2d5b01,'connectionIdToNameMap':_0xfaaeb4},_0x427afa,_0x25c730,_0x4b9fa6),_0x59befb=_0x3c5a11?[]:findSegmentsToDelete(_0x24d029,_0x4a9df4[_0x5d156e(0x156)](({yamlConfig:_0x21d69d,folderPath:_0x1d1943})=>({'yamlConfig':_0x21d69d,'folderPath':resolveTDFolderPath(_0x1d1943,_0x25c730,_0x4b9fa6)})),_0x1a0b98,_0x4b9fa6,_0x25c730),{journeyFiles:_0x3028f6,foldersToCreate:_0x40ff29}=await withProgressSpinner('Preparing\x20journeys...',async _0x22b6f2=>prepareJourneyFiles(_0x4122f5,{'fetchJourney':async _0x3dac1a=>_0x183f03[_0x5d156e(0x18f)][_0x5d156e(0x17c)](_0x3dac1a[_0x5d156e(0x17a)]),'journeyBundlesByFolderAndName':_0x1199f6,'folderPathToId':_0x2c65e7,'idToEmailMap':_0x2d5b01,'connectionIdToNameMap':_0xfaaeb4,'existingSegments':_0x24d029,'parentId':_0x5f343e,'deps':_0x183f03,'progress':{'update':_0x55d1c2=>{const _0x449e17=_0x5d156e;_0x22b6f2[_0x449e17(0x12b)](_0x55d1c2),_0x2fe048[_0x449e17(0x130)]&&console[_0x449e17(0x15a)]('\x20\x20'+_0x55d1c2);}},'journeyById':_0x176255,'activationStepsById':_0x2618a8},_0x25c730,_0x4b9fa6),{'verbose':_0x2fe048[_0x5d156e(0x130)]})[_0x5d156e(0x120)](_0x10cf5e=>_0x10cf5e[_0x5d156e(0x17f)]);for(const _0x455a61 of _0x40ff29){_0x450643[_0x5d156e(0x142)](_0x455a61);}const _0x4e7a1d=_0x3c5a11?[]:findJourneysToDelete(_0x211b3c,_0x4122f5[_0x5d156e(0x156)](({yamlConfig:_0x5702e0,folderPath:_0x91e113})=>({'yamlConfig':_0x5702e0,'folderPath':resolveTDFolderPath(_0x91e113,_0x25c730,_0x4b9fa6)})),_0x1a0b98,_0x4b9fa6,_0x25c730),_0x379a2b=calculatePushStats(_0x5d31fe,_0x3028f6,_0x450643,_0x59befb,_0x4e7a1d,!!_0x2fe048[_0x5d156e(0x131)],!!_0x2fe048[_0x5d156e(0x154)]),_0x4b4d9f=_0x379a2b[_0x5d156e(0x152)][_0x5d156e(0x10d)],_0x2cde77=_0x379a2b[_0x5d156e(0x152)][_0x5d156e(0x192)],_0x433333=_0x379a2b[_0x5d156e(0x152)]['unchanged'],_0x3694f8=_0x379a2b['segments'][_0x5d156e(0x12a)],_0x12b7c0=_0x379a2b['folders']['toCreate'],_0x1233ec=_0x379a2b['journeys']['new'],_0x2544a9=_0x379a2b[_0x5d156e(0x11a)][_0x5d156e(0x192)],_0x684ebb=_0x379a2b['journeys'][_0x5d156e(0x197)],_0x83132a=_0x379a2b['journeys'][_0x5d156e(0x12a)],_0x33eda6=_0x379a2b['activations']['all'],_0x46129e=_0x379a2b['activations']['toCreate'],_0x58753f=_0x379a2b['activations'][_0x5d156e(0x107)],_0x26253b=_0x379a2b[_0x5d156e(0x16c)][_0x5d156e(0x12a)];console[_0x5d156e(0x15a)](_0x5d156e(0x113)+_0x780f7+'\x27:');_0x12b7c0[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9['blue'](_0x5d156e(0x173)+_0x12b7c0['length']+_0x5d156e(0x172)));if(!_0x2fe048['journeysOnly']){console[_0x5d156e(0x15a)](_0x5d156e(0x167)),console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x13b)]('+\x20'+_0x4b4d9f['length']+_0x5d156e(0x13e))),console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x105)]('~\x20'+_0x2cde77[_0x5d156e(0x158)]+'\x20changed'));if(_0x3694f8[_0x5d156e(0x158)]>0x0)console['error']('\x20\x20\x20\x20'+a39_0x5280e9[_0x5d156e(0x159)]('-\x20'+_0x3694f8[_0x5d156e(0x158)]+_0x5d156e(0x160)));else _0x59befb[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x131)]&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x19c)](_0x59befb[_0x5d156e(0x158)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x5d156e(0x15f)+a39_0x5280e9['dim']('=\x20'+_0x433333[_0x5d156e(0x158)]+_0x5d156e(0x14c)));}if(_0x3028f6[_0x5d156e(0x158)]>0x0||_0x4e7a1d[_0x5d156e(0x158)]>0x0){console['error']('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x13b)]('+\x20'+_0x1233ec['length']+_0x5d156e(0x13e))),console['error'](_0x5d156e(0x15f)+a39_0x5280e9['yellow']('~\x20'+_0x2544a9[_0x5d156e(0x158)]+'\x20changed'));if(_0x83132a[_0x5d156e(0x158)]>0x0)console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x159)]('-\x20'+_0x83132a['length']+_0x5d156e(0x160)));else _0x4e7a1d['length']>0x0&&!_0x2fe048[_0x5d156e(0x131)]&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x19c)](_0x4e7a1d[_0x5d156e(0x158)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9['dim']('=\x20'+_0x684ebb[_0x5d156e(0x158)]+'\x20unchanged'));}_0x33eda6[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x154)]&&(console[_0x5d156e(0x15a)](''),console[_0x5d156e(0x15a)](_0x5d156e(0x145)),_0x46129e[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x13b)]('+\x20'+_0x46129e['length']+_0x5d156e(0x11c))),_0x58753f[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)]('\x20\x20\x20\x20'+a39_0x5280e9['yellow']('~\x20'+_0x58753f[_0x5d156e(0x158)]+_0x5d156e(0x112))),_0x26253b[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x159)]('-\x20'+_0x26253b[_0x5d156e(0x158)]+_0x5d156e(0x160))));console[_0x5d156e(0x15a)](_0x5d156e(0x164)+a39_0x5280e9[_0x5d156e(0x132)](_0x2a9cd8)+'\x0a');if(_0x12b7c0[_0x5d156e(0x158)]>0x0){console[_0x5d156e(0x15a)](_0x5d156e(0x10c));for(const _0xa55551 of _0x12b7c0){console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9[_0x5d156e(0x19d)]('+')+'\x20'+_0xa55551);}console[_0x5d156e(0x15a)]('');}if(_0x4b4d9f[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x154)])for(const _0x34634e of _0x4b4d9f){const _0x43f40a=_0x34634e[_0x5d156e(0x11d)]?_0x34634e['folderPath']+'/'+_0x34634e[_0x5d156e(0x171)]['name']:_0x34634e['yamlConfig'][_0x5d156e(0x198)],_0x5bec3f=_0x34634e[_0x5d156e(0x171)]['activations']?.[_0x5d156e(0x158)]||0x0,_0x2d7c5f=_0x5bec3f>0x0?a39_0x5280e9[_0x5d156e(0x19c)]('\x20['+_0x5bec3f+'\x20activations]'):'';console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x13b)](_0x5d156e(0x114))+'\x20'+_0x43f40a+_0x2d7c5f),console['error']('β'[_0x5d156e(0x190)](0x3c)),_0x34634e[_0x5d156e(0x10e)]&&console[_0x5d156e(0x15a)](_0x34634e[_0x5d156e(0x10e)]),console['error']('β'[_0x5d156e(0x190)](0x3c));}if(_0x3694f8[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x154)])for(const _0x3a8921 of _0x3694f8){const _0x1f9f86=_0x3a8921[_0x5d156e(0x175)]?_0x1a0b98[_0x5d156e(0x12e)](_0x3a8921[_0x5d156e(0x175)][_0x5d156e(0x11e)]())||'':'',_0x34b697=_0x1f9f86?_0x1f9f86+'/'+_0x3a8921[_0x5d156e(0x198)]:_0x3a8921[_0x5d156e(0x198)],_0x221c3c=_0x5eaf72[_0x5d156e(0x12e)](_0x3a8921['id'])||[],_0x5d0450=_0x221c3c[_0x5d156e(0x158)]>0x0?a39_0x5280e9[_0x5d156e(0x19c)]('\x20['+_0x221c3c[_0x5d156e(0x158)]+_0x5d156e(0x170)):'';console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x147))+'\x20'+_0x34b697+_0x5d0450),console['error']('β'[_0x5d156e(0x190)](0x3c));const _0xcbeb90=segmentWithActivationsToYaml(_0x3a8921,_0x221c3c,undefined,_0x2d5b01,_0xfaaeb4),_0x31bb37=segmentToYamlString(_0xcbeb90),_0x30b405=generateDiff(_0x31bb37,'');console[_0x5d156e(0x15a)](formatDiffWithColors(_0x30b405)),console['error']('β'[_0x5d156e(0x190)](0x3c));}const _0x321ad4=_0x5d31fe[_0x5d156e(0x18a)](_0x74cd59=>!_0x74cd59[_0x5d156e(0x16f)]&&_0x74cd59['diff']);if(_0x321ad4['length']>0x0&&!_0x2fe048[_0x5d156e(0x154)])for(const _0x390dc9 of _0x321ad4){const _0x26387b=_0x390dc9[_0x5d156e(0x11d)]?_0x390dc9[_0x5d156e(0x11d)]+'/'+_0x390dc9[_0x5d156e(0x171)][_0x5d156e(0x198)]:_0x390dc9[_0x5d156e(0x171)][_0x5d156e(0x198)];console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x10f))+'\x20'+_0x26387b),console[_0x5d156e(0x15a)]('β'['repeat'](0x3c)),console['error'](_0x390dc9[_0x5d156e(0x10e)]),console['error']('β'['repeat'](0x3c));}if(_0x1233ec['length']>0x0)for(const _0x259b18 of _0x1233ec){const _0x22feb1=_0x259b18[_0x5d156e(0x11d)]?_0x259b18[_0x5d156e(0x11d)]+'/'+_0x259b18[_0x5d156e(0x171)][_0x5d156e(0x198)]:_0x259b18[_0x5d156e(0x171)][_0x5d156e(0x198)];console['error']('\x0a'+a39_0x5280e9[_0x5d156e(0x13b)](_0x5d156e(0x18e))+'\x20'+_0x22feb1),console[_0x5d156e(0x15a)]('β'[_0x5d156e(0x190)](0x3c)),_0x259b18[_0x5d156e(0x10e)]&&console[_0x5d156e(0x15a)](_0x259b18[_0x5d156e(0x10e)]),console[_0x5d156e(0x15a)]('β'[_0x5d156e(0x190)](0x3c));}const _0x3881e2=_0x3028f6[_0x5d156e(0x18a)](_0x3b7467=>!_0x3b7467[_0x5d156e(0x16f)]&&_0x3b7467[_0x5d156e(0x10e)]);if(_0x3881e2['length']>0x0)for(const _0x38a814 of _0x3881e2){const _0x42d2f0=_0x38a814[_0x5d156e(0x11d)]?_0x38a814[_0x5d156e(0x11d)]+'/'+_0x38a814[_0x5d156e(0x171)][_0x5d156e(0x198)]:_0x38a814[_0x5d156e(0x171)][_0x5d156e(0x198)];console['error']('\x0a'+a39_0x5280e9['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x42d2f0),console[_0x5d156e(0x15a)]('β'[_0x5d156e(0x190)](0x3c)),console[_0x5d156e(0x15a)](_0x38a814['diff']),console[_0x5d156e(0x15a)]('β'['repeat'](0x3c));}if(_0x83132a[_0x5d156e(0x158)]>0x0)for(const _0x4090a0 of _0x83132a){const _0x41f8eb=_0x4090a0[_0x5d156e(0x11f)]?_0x1a0b98['get'](_0x4090a0['folderId'])||'':'',_0xc29d85=_0x41f8eb?_0x41f8eb+'/'+_0x4090a0[_0x5d156e(0x128)]:_0x4090a0[_0x5d156e(0x128)];console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x194))+'\x20'+_0xc29d85),console[_0x5d156e(0x15a)]('β'['repeat'](0x3c)),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x188))),console[_0x5d156e(0x15a)]('β'[_0x5d156e(0x190)](0x3c));}if(_0x2fe048[_0x5d156e(0x14d)])return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x141))),0x0;const _0x41cd55=_0x2fe048[_0x5d156e(0x154)]?![]:_0x4b4d9f[_0x5d156e(0x158)]>0x0||_0x2cde77[_0x5d156e(0x158)]>0x0||_0x3694f8['length']>0x0,_0xbaa789=_0x1233ec[_0x5d156e(0x158)]>0x0||_0x2544a9[_0x5d156e(0x158)]>0x0||_0x83132a['length']>0x0,_0x245cef=_0x2fe048['journeysOnly']?![]:_0x33eda6['length']>0x0,_0x3309f5=_0x12b7c0['length']>0x0;if(!_0x41cd55&&!_0xbaa789&&!_0x245cef&&!_0x3309f5){const _0x3d5a2a=_0x2fe048[_0x5d156e(0x154)]?_0x5d156e(0x14e):_0x5d156e(0x137);console['error'](a39_0x5280e9[_0x5d156e(0x13b)](_0x3d5a2a));if(_0x3c5a11&&_0x433333[_0x5d156e(0x158)]===0x1){const _0x5e4d30=_0x433333[0x0];if(_0x5e4d30['existingSegment']?.['id']){const _0x40da9e=getConsoleNextUrl(_0x2fe048['site'],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x5e4d30[_0x5d156e(0x176)]['id']+_0x5d156e(0x151));console[_0x5d156e(0x15a)](_0x5d156e(0x115)+a39_0x5280e9[_0x5d156e(0x132)](_0x40da9e));}}if(_0x3c5a11&&_0x684ebb['length']===0x1){const _0x4e03ac=_0x684ebb[0x0];if(_0x4e03ac[_0x5d156e(0x123)]?.['id']){const _0x46162e=getConsoleNextUrl(_0x2fe048[_0x5d156e(0x127)],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x4e03ac['existingJourney']['id']+'/j/da/je');console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9[_0x5d156e(0x132)](_0x46162e));}}return 0x0;}const _0x45cc49=_0x2fe048[_0x5d156e(0x154)]?_0x1233ec[_0x5d156e(0x158)]+_0x2544a9[_0x5d156e(0x158)]+_0x83132a[_0x5d156e(0x158)]+_0x12b7c0['length']:_0x4b4d9f[_0x5d156e(0x158)]+_0x2cde77[_0x5d156e(0x158)]+_0x3694f8['length']+_0x1233ec[_0x5d156e(0x158)]+_0x2544a9[_0x5d156e(0x158)]+_0x83132a['length']+_0x12b7c0[_0x5d156e(0x158)]+_0x33eda6[_0x5d156e(0x158)];if(!_0x2fe048[_0x5d156e(0x121)]&&_0x45cc49>0x0){if(!isInteractive())return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x16b)),_0x5d156e(0x178)),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x19c)](_0x5d156e(0x125))),0x1;const _0x355297=await confirmKey(_0x5d156e(0x168)+_0x45cc49+_0x5d156e(0x18b));if(!_0x355297)return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x166))),0x1;}const _0x5527ee={'withProgress':async(_0x5c0061,_0x3c4f52)=>{const _0x56fa3f=_0x5d156e,_0x30e4a4=await withSpinner(_0x5c0061,_0x3c4f52,{'verbose':_0x2fe048[_0x56fa3f(0x130)]});return{'data':_0x30e4a4[_0x56fa3f(0x17f)]};},'logInfo':_0x40e373=>console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x19d)]('β\x20'+_0x40e373)),'logSuccess':_0x5758e4=>console['error'](a39_0x5280e9[_0x5d156e(0x13b)]('β\x20'+_0x5758e4)),'logWarning':_0x458e8c=>console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)]('β \x20'+_0x458e8c)),'logDeleted':_0x3048a8=>console[_0x5d156e(0x15a)](a39_0x5280e9['red']('β\x20'+_0x3048a8))},_0x19bff2={'segment':_0x183f03['segment'],'journey':_0x183f03['journey'],'user':_0x183f03['user'],'connection':_0x183f03[_0x5d156e(0x126)]};_0x12b7c0[_0x5d156e(0x158)]>0x0&&(_0x2c65e7=await executePushFolders(_0x19bff2,_0x12b7c0,_0x2c65e7,{'parentId':_0x5f343e},_0x5527ee));const _0x3f5268={'rootFolderId':_0x315045,'folderPathToId':_0x2c65e7,'folderIdToPath':_0x1a0b98,'segmentNameToId':_0x46ca0f,'activationsBySegmentId':_0x5eaf72,'emailToIdMap':_0x49ac12,'idToEmailMap':_0x2d5b01,'connectionNameToIdMap':_0x1ca6bc[_0x5d156e(0x109)],'connectionIdToNameMap':_0x1ca6bc[_0x5d156e(0x189)],'connectionNameToTypeMap':_0x3b243d},_0x59e9a3=await executePushSegments(_0x19bff2,_0x2fe048[_0x5d156e(0x154)]?[]:_0x5d31fe,_0x3f5268,{'parentId':_0x5f343e},_0x5527ee),_0x2fd3ff=_0x59e9a3[_0x5d156e(0x17e)],_0x337e9f=_0x59e9a3[_0x5d156e(0x133)],_0x4ece8a=_0x59e9a3[_0x5d156e(0x16c)][_0x5d156e(0x17e)],_0x1e61ed=_0x59e9a3[_0x5d156e(0x16c)][_0x5d156e(0x133)],_0x5a33c2=_0x59e9a3[_0x5d156e(0x16c)][_0x5d156e(0x19e)];let _0x546f85;if(_0x3c5a11&&_0x5d31fe[_0x5d156e(0x158)]===0x1){const _0x5939a0=_0x5d31fe[0x0];_0x546f85=_0x5939a0[_0x5d156e(0x176)]?.['id']??_0x59e9a3[_0x5d156e(0x16a)][_0x5d156e(0x12e)](_0x5939a0[_0x5d156e(0x171)][_0x5d156e(0x198)]);}const _0x5f2720=await executePushSegmentDeletions(_0x19bff2,_0x2fe048['journeysOnly']?[]:_0x3694f8,_0x5527ee);let _0x162b5a=0x0,_0x372ee1=0x0,_0x146f77=0x0;const _0x187870=new Map(_0x46ca0f);for(const [_0x53e3b4,_0x5cac8c]of _0x59e9a3['createdSegmentIds']){_0x187870['set'](_0x53e3b4,_0x5cac8c);}if(_0x3028f6[_0x5d156e(0x158)]>0x0){const _0x277804={..._0x3f5268,'segmentNameToId':_0x187870,'existingSegments':_0x24d029,'activationContext':_0x427afa},_0x22a481=await executePushJourneys(_0x19bff2,_0x3028f6,_0x277804,{'parentId':_0x5f343e,'rootFolderId':_0x315045,'verbose':_0x2fe048['verbose']},_0x5527ee);_0x162b5a=_0x22a481[_0x5d156e(0x17e)],_0x372ee1=_0x22a481[_0x5d156e(0x133)];if(_0x3c5a11&&_0x22a481[_0x5d156e(0x148)][_0x5d156e(0x158)]===0x1){const _0x56700d=_0x22a481['results'][0x0];if(_0x56700d['journeyId']){const _0x6fcf51=getConsoleNextUrl(_0x2fe048['site'],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x56700d['journeyId']+_0x5d156e(0x122));console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9[_0x5d156e(0x132)](_0x6fcf51));}}}for(const _0x3c69db of _0x83132a){console['error'](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x119)+_0x3c69db[_0x5d156e(0x128)])),_0x146f77++;}const _0x4ccb41=[];if(_0x2fd3ff>0x0)_0x4ccb41[_0x5d156e(0x165)](_0x2fd3ff+'\x20created');if(_0x337e9f>0x0)_0x4ccb41['push'](_0x337e9f+_0x5d156e(0x104));if(_0x5f2720>0x0)_0x4ccb41[_0x5d156e(0x165)](_0x5f2720+_0x5d156e(0x15c));const _0x4b71cd=[];if(_0x162b5a>0x0)_0x4b71cd[_0x5d156e(0x165)](_0x162b5a+_0x5d156e(0x143));if(_0x372ee1>0x0)_0x4b71cd['push'](_0x372ee1+_0x5d156e(0x104));if(_0x146f77>0x0)_0x4b71cd[_0x5d156e(0x165)](_0x146f77+'\x20deleted');const _0x63474d=[];if(_0x4ece8a>0x0)_0x63474d[_0x5d156e(0x165)](_0x4ece8a+'\x20created');if(_0x1e61ed>0x0)_0x63474d[_0x5d156e(0x165)](_0x1e61ed+_0x5d156e(0x104));if(_0x5a33c2>0x0)_0x63474d[_0x5d156e(0x165)](_0x5a33c2+_0x5d156e(0x15c));console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x13b)](_0x5d156e(0x191)));_0x4ccb41['length']>0x0&&!_0x2fe048['journeysOnly']&&console[_0x5d156e(0x15a)](_0x5d156e(0x14b)+_0x4ccb41['join'](',\x20'));_0x4b71cd[_0x5d156e(0x158)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x4b71cd[_0x5d156e(0x162)](',\x20'));_0x63474d['length']>0x0&&!_0x2fe048[_0x5d156e(0x154)]&&console[_0x5d156e(0x15a)]('\x20\x20Activations:\x20'+_0x63474d[_0x5d156e(0x162)](',\x20'));if(_0x546f85){const _0x326784=getConsoleNextUrl(_0x2fe048[_0x5d156e(0x127)],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x546f85+'/sb/da/esr');console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x5280e9['cyan'](_0x326784));}return 0x0;}}
|