@treasuredata/tdx 2026.3.14 → 2026.3.15
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_0x872857=a34_0x1e85;(function(_0x474507,_0x45ea57){const _0x285f4b=a34_0x1e85,_0x3e3156=_0x474507();while(!![]){try{const _0x17bb3a=-parseInt(_0x285f4b(0xdd))/0x1*(parseInt(_0x285f4b(0x122))/0x2)+-parseInt(_0x285f4b(0x11f))/0x3*(-parseInt(_0x285f4b(0xb6))/0x4)+parseInt(_0x285f4b(0x109))/0x5+parseInt(_0x285f4b(0xe3))/0x6+-parseInt(_0x285f4b(0x135))/0x7+-parseInt(_0x285f4b(0xbb))/0x8+-parseInt(_0x285f4b(0x10f))/0x9;if(_0x17bb3a===_0x45ea57)break;else _0x3e3156['push'](_0x3e3156['shift']());}catch(_0x52c9df){_0x3e3156['push'](_0x3e3156['shift']());}}}(a34_0x4801,0xc2856));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a34_0x1e85(_0x1f41c0,_0x298ca6){_0x1f41c0=_0x1f41c0-0xa4;const _0x480163=a34_0x4801();let _0x1e8530=_0x480163[_0x1f41c0];return _0x1e8530;}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x365f45 from'chalk';function formatRelativeTime(_0x232c79){const _0x43c72f=a34_0x1e85,_0x5a3aee=new Date(_0x232c79),_0xc30833=new Date(),_0x1eff70=_0x5a3aee[_0x43c72f(0xa6)]()-_0xc30833[_0x43c72f(0xa6)](),_0x4fb2c3=Math[_0x43c72f(0xcf)](_0x1eff70)/0x3e8,_0x43d5a8=_0x1eff70<0x0;if(_0x4fb2c3<0x3c)return _0x43d5a8?_0x43c72f(0xf8):_0x43c72f(0xfb);else{if(_0x4fb2c3<0xe10){const _0xa4202d=Math[_0x43c72f(0x138)](_0x4fb2c3/0x3c);return _0x43d5a8?_0xa4202d+_0x43c72f(0x124):_0x43c72f(0xcc)+_0xa4202d+'m';}else{if(_0x4fb2c3<0x15180){const _0x5d7736=Math[_0x43c72f(0x138)](_0x4fb2c3/0xe10);return _0x43d5a8?_0x5d7736+_0x43c72f(0x10e):_0x43c72f(0xcc)+_0x5d7736+'h';}else{if(_0x4fb2c3<0x93a80){const _0x8636e=Math['round'](_0x4fb2c3/0x15180);return _0x43d5a8?_0x8636e+_0x43c72f(0xbc):_0x43c72f(0xcc)+_0x8636e+'d';}else return _0x5a3aee['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xd5);['description']=a34_0x872857(0xf5);async[a34_0x872857(0x103)](_0x326342){const _0x2a8d51=a34_0x872857,{options:_0x41b18c,args:_0x1b3867,tdx:_0x5b19e6}=_0x326342,_0x2c1223=resolveLimit(_0x41b18c[_0x2a8d51(0xff)],DEFAULT_DISPLAY_LIMIT),_0x107f60=_0x1b3867[0x0],_0x11248c=_0x107f60?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x107f60+_0x2a8d51(0xd3):_0x2a8d51(0xba),_0x19524f=await withSpinner(_0x11248c,()=>_0x5b19e6['schedules'][_0x2a8d51(0xca)]({'limit':_0x2c1223,'scheduled':!![],'pattern':_0x107f60}),{'verbose':_0x41b18c[_0x2a8d51(0x115)]}),_0x44acef=_0x19524f[_0x2a8d51(0xc5)][_0x2a8d51(0xc1)],_0x18cd68=_0x19524f['data'][_0x2a8d51(0x11e)][_0x2a8d51(0xfd)],_0x4e6634=_0x107f60?_0x2a8d51(0x11a)+_0x107f60+'\x22':'';_0x18cd68?console[_0x2a8d51(0xd7)](_0x2a8d51(0xdf)+_0x44acef[_0x2a8d51(0xc0)]+_0x2a8d51(0xaf)+_0x4e6634+_0x2a8d51(0x121)):console[_0x2a8d51(0xd7)]('Found\x20'+_0x44acef['length']+_0x2a8d51(0xa9)+(_0x44acef[_0x2a8d51(0xc0)]!==0x1?_0x2a8d51(0x125):'y')+_0x4e6634);if(_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0x113)||_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0x10d)||_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0xd8)||_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0x12d)){const _0x55d9bb=_0x44acef[_0x2a8d51(0xe0)](_0x362cd2=>({'id':_0x362cd2['id'],'name':_0x362cd2['name'],'cron':_0x362cd2[_0x2a8d51(0xae)],'database':_0x362cd2[_0x2a8d51(0xf4)]?.[_0x2a8d51(0xe6)],'type':_0x362cd2[_0x2a8d51(0xe9)],'timezone':_0x362cd2[_0x2a8d51(0xa7)],'user_name':_0x362cd2['user']?.[_0x2a8d51(0xe6)],'updated_at':_0x362cd2[_0x2a8d51(0xad)],'next_run_at':_0x362cd2['next_run_at'],'last_job_status':_0x362cd2['last_job']?.['status']}));await handleSDKOutput(_0x55d9bb,_0x41b18c);}else{if(_0x44acef[_0x2a8d51(0xc0)]===0x0)console[_0x2a8d51(0xb8)](_0x2a8d51(0xcb));else{const _0x315cd8=_0x41b18c[_0x2a8d51(0xbe)],_0x151eed=_0x44acef[_0x2a8d51(0xe0)](_0x48b587=>{const _0x2a7068=_0x2a8d51,_0x55df3a=_0x48b587[_0x2a7068(0xa5)]?.[_0x2a7068(0x136)]?_0x48b587['last_job'][_0x2a7068(0x136)]===_0x2a7068(0xfa)?'✓':'✗':'-',_0x579917=_0x48b587['last_job']?.[_0x2a7068(0x12a)]?formatRelativeTime(_0x48b587[_0x2a7068(0xa5)][_0x2a7068(0x12a)]):_0x2a7068(0x132),_0x1a7e29=_0x48b587[_0x2a7068(0x106)]?formatRelativeTime(_0x48b587[_0x2a7068(0x106)]):'-',_0x3dde97=_0x48b587[_0x2a7068(0xae)]||'',_0x2d2e4a=_0x48b587[_0x2a7068(0xe6)]||_0x2a7068(0x10c),_0x5d5f8e=getConsoleUrl(_0x315cd8,_0x2a7068(0x120)+_0x48b587['id']);return{'statusIcon':_0x55df3a,'lastRun':_0x579917,'nextRun':_0x1a7e29,'cron':_0x3dde97,'name':_0x2d2e4a,'queryUrl':_0x5d5f8e,'status':_0x48b587['last_job']?.[_0x2a7068(0x136)]};}),_0x42c03e=Math[_0x2a8d51(0xf7)](..._0x151eed['map'](_0x12db18=>_0x12db18[_0x2a8d51(0x107)][_0x2a8d51(0xc0)])),_0x3611ec=Math[_0x2a8d51(0xf7)](..._0x151eed[_0x2a8d51(0xe0)](_0x34e6c5=>_0x34e6c5[_0x2a8d51(0xc9)][_0x2a8d51(0xc0)])),_0x73d55e=Math[_0x2a8d51(0xf7)](..._0x151eed[_0x2a8d51(0xe0)](_0x10096f=>_0x10096f[_0x2a8d51(0xae)]['length'])),_0x5d71ff=_0x151eed[_0x2a8d51(0xe0)](_0x1c7efa=>{const _0x497c0c=_0x2a8d51,_0x3cfff9=_0x1c7efa[_0x497c0c(0x136)]===_0x497c0c(0xfa)?a34_0x365f45[_0x497c0c(0xac)](_0x1c7efa[_0x497c0c(0xc7)]):_0x1c7efa[_0x497c0c(0x136)]===_0x497c0c(0xd7)?a34_0x365f45[_0x497c0c(0x105)](_0x1c7efa[_0x497c0c(0xc7)]):a34_0x365f45[_0x497c0c(0xb3)](_0x1c7efa[_0x497c0c(0xc7)]),_0x38a1ea=_0x1c7efa[_0x497c0c(0x107)][_0x497c0c(0xeb)](_0x42c03e),_0x22a079=_0x1c7efa[_0x497c0c(0xc9)][_0x497c0c(0xeb)](_0x3611ec),_0x3b261e=_0x1c7efa['cron']?a34_0x365f45[_0x497c0c(0xd1)](_0x1c7efa['cron'][_0x497c0c(0xeb)](_0x73d55e)):'\x20'[_0x497c0c(0xb1)](_0x73d55e),_0x2c7a21=hyperlink(_0x1c7efa[_0x497c0c(0xe6)],_0x1c7efa['queryUrl']);return _0x497c0c(0xcd)+_0x3cfff9+'\x20'+_0x38a1ea+'\x20\x20→\x20'+_0x22a079+'\x20\x20'+_0x3b261e+'\x20\x20'+_0x2c7a21;});await writeOutput(_0x5d71ff[_0x2a8d51(0xf1)]('\x0a'),_0x41b18c[_0x2a8d51(0x112)],_0x2a8d51(0x11b));}}return 0x0;}}function a34_0x4801(){const _0x566354=['delay','priority','entries','data','description','statusIcon','\x20(showing\x20','nextRun','listQueries','No\x20scheduled\x20queries\x20found','in\x20','📅\x20','engineVersion','abs','Failed\x20to\x20read\x20file:\x20','cyan','from','\x22...','trino','schedule:list','schedule:create','error','table','schedules','executing_user_id','args','Found\x20','218807hayxQC','Run\x20a\x20scheduled\x20query\x20immediately','Showing\x20first\x20','map','Schedule\x20run\x20submitted:\x20','query','4379148EivTIH','timezone','engine_version','name','schedule:show','\x20\x20Database:\x20','type','schedule:update','padEnd','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Delete\x20a\x20scheduled\x20query','run','Cancelled','Show\x20schedule\x20details','join','keys','create','database','List\x20scheduled\x20queries','format','max','just\x20now','substring','success','soon','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','has_next_page','num','limit','start_at','\x20job','Running\x20schedule...','execute','Schedule\x20deleted:\x20','red','next_run_at','lastRun','utf-8','4541045WucpTl','user_name','Getting\x20schedule\x20history...','(unnamed)','jsonl','h\x20ago','5035815WnYbil','time','update','output','json','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','verbose','schedule:delete','Updating\x20schedule:\x20','\x20\x20Cron:\x20','jobs','\x20matching\x20\x22','list','INVALID_ARGUMENT','Show\x20schedule\x20execution\x20history','pagination','2663049CmgXar','/app/queries/editor?queryId=','\x20(use\x20--limit\x20to\x20see\x20more)','8NPcULE','result','m\x20ago','ies','count','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','history','...','ended_at','job_id','Create\x20a\x20scheduled\x20query','tsv','options','Creating\x20schedule:\x20','Running\x20schedule:\x20','retryLimit','never','delete','\x20\x20Time:\x20','446481hqyyns','status','file','round','Query\x20file\x20is\x20empty','last_job','getTime','time_zone','\x20\x20Job\x20ID:\x20','\x20scheduled\x20quer','Deleting\x20schedule...','schedule:run','green','updated_at','cron','\x20schedules','Update\x20a\x20scheduled\x20query','repeat','trim','dim','created_at','\x20\x20Timezone:\x20','4VFdOPB','validate','log','end_at','Listing\x20scheduled\x20queries...','1843568WCMymd','d\x20ago','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','site','retry_limit','length','queries'];a34_0x4801=function(){return _0x566354;};return a34_0x4801();}export class ScheduleShowCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xe7);[a34_0x872857(0xc6)]=a34_0x872857(0xf0);[a34_0x872857(0xb7)](_0x2ed77c){const _0x2f38ab=a34_0x872857,_0x586215=_0x2ed77c[_0x2f38ab(0xdb)][0x0];if(!_0x586215)return _0x2f38ab(0xfc);return undefined;}async[a34_0x872857(0x103)](_0x25a1b2){const _0x1f5948=a34_0x872857,{options:_0x50ea09,args:_0x50ab42,tdx:_0xf7b7b6}=_0x25a1b2,_0x95327=_0x50ab42[0x0],_0x4d7df7=await withSpinner('Getting\x20schedule\x20details...',()=>_0xf7b7b6['schedules']['show'](_0x95327),{'verbose':_0x50ea09[_0x1f5948(0x115)]}),_0x2c70fb=_0x4d7df7[_0x1f5948(0xc5)],_0xae7415={'name':_0x2c70fb['name'],'cron':_0x2c70fb[_0x1f5948(0xae)],'database':_0x2c70fb['database'],'type':_0x2c70fb[_0x1f5948(0xe9)],'timezone':_0x2c70fb[_0x1f5948(0xe4)],'user_name':_0x2c70fb[_0x1f5948(0x10a)],'created_at':_0x2c70fb['created_at'],'engine_version':_0x2c70fb[_0x1f5948(0xe5)],'executing_user_id':_0x2c70fb[_0x1f5948(0xda)],'query':_0x2c70fb[_0x1f5948(0xe2)],'delay':_0x2c70fb[_0x1f5948(0xc2)],'priority':_0x2c70fb[_0x1f5948(0xc3)],'retry_limit':_0x2c70fb[_0x1f5948(0xbf)],..._0x2c70fb[_0x1f5948(0x123)]&&{'result':_0x2c70fb[_0x1f5948(0x123)]}};return await handleSingleObjectOutput(_0xae7415,_0x50ea09),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x872857(0xd6);[a34_0x872857(0xc6)]=a34_0x872857(0x12c);[a34_0x872857(0xb7)](_0x33d05c){const _0x484a75=a34_0x872857,_0x29779d=_0x33d05c[_0x484a75(0xdb)][0x0];if(!_0x29779d)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x12429f=_0x33d05c[_0x484a75(0x12e)];if(!_0x12429f[_0x484a75(0xf4)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a34_0x872857(0x103)](_0x3e4207){const _0x3d9d12=a34_0x872857,{options:_0x25fe88,args:_0x19a827,tdx:_0x253d79}=_0x3e4207,_0x125517=_0x19a827[0x0],_0x275c7e=_0x25fe88,_0x3d19f6=_0x275c7e[_0x3d9d12(0xf4)],_0x69ad6e=_0x275c7e['file'],_0xad8414=_0x275c7e[_0x3d9d12(0xe9)]||_0x3d9d12(0xd4);let _0x29b49c;try{_0x29b49c=readFileSync(_0x69ad6e,_0x3d9d12(0x108))['trim']();}catch(_0x4a46fc){throw new SDKError(ErrorCode[_0x3d9d12(0x11c)],_0x3d9d12(0xd0)+_0x69ad6e,_0x4a46fc instanceof Error?_0x4a46fc:undefined);}if(!_0x29b49c)throw new SDKError(ErrorCode[_0x3d9d12(0x11c)],_0x3d9d12(0xa4));const _0x34f15c={'database':_0x3d19f6,'query':_0x29b49c,'type':_0xad8414};if(_0x275c7e[_0x3d9d12(0xae)])_0x34f15c[_0x3d9d12(0xae)]=_0x275c7e[_0x3d9d12(0xae)];if(_0x275c7e[_0x3d9d12(0xe4)])_0x34f15c['timezone']=_0x275c7e['timezone'];if(_0x275c7e[_0x3d9d12(0xc2)]!==undefined)_0x34f15c[_0x3d9d12(0xc2)]=Number(_0x275c7e[_0x3d9d12(0xc2)]);if(_0x275c7e[_0x3d9d12(0xc3)]!==undefined)_0x34f15c['priority']=Number(_0x275c7e[_0x3d9d12(0xc3)]);if(_0x275c7e[_0x3d9d12(0x131)]!==undefined)_0x34f15c[_0x3d9d12(0xbf)]=Number(_0x275c7e['retryLimit']);if(_0x275c7e[_0x3d9d12(0xce)])_0x34f15c[_0x3d9d12(0xe5)]=_0x275c7e[_0x3d9d12(0xce)];if(_0x275c7e[_0x3d9d12(0x123)])_0x34f15c[_0x3d9d12(0x123)]=_0x275c7e[_0x3d9d12(0x123)];if(_0x25fe88[_0x3d9d12(0x115)]){console[_0x3d9d12(0xd7)](_0x3d9d12(0x12f)+_0x125517),console[_0x3d9d12(0xd7)](_0x3d9d12(0xe8)+_0x3d19f6),console['error']('\x20\x20Type:\x20'+_0xad8414);if(_0x34f15c[_0x3d9d12(0xae)])console['error'](_0x3d9d12(0x118)+_0x34f15c[_0x3d9d12(0xae)]);if(_0x34f15c[_0x3d9d12(0xe4)])console[_0x3d9d12(0xd7)](_0x3d9d12(0xb5)+_0x34f15c[_0x3d9d12(0xe4)]);}const _0x28e99a=await withSpinner('Creating\x20schedule...',()=>_0x253d79[_0x3d9d12(0xd9)][_0x3d9d12(0xf3)](_0x125517,_0x34f15c),{'verbose':_0x25fe88[_0x3d9d12(0x115)]});return console[_0x3d9d12(0xd7)]('Schedule\x20created:\x20'+_0x28e99a[_0x3d9d12(0xc5)][_0x3d9d12(0xe6)]),await handleSingleObjectOutput(_0x28e99a['data'],_0x25fe88),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xea);[a34_0x872857(0xc6)]=a34_0x872857(0xb0);[a34_0x872857(0xb7)](_0x3b6c73){const _0x29f104=a34_0x872857,_0xf9d1ff=_0x3b6c73[_0x29f104(0xdb)][0x0];if(!_0xf9d1ff)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a34_0x872857(0x103)](_0x2974ad){const _0x4d4181=a34_0x872857,{options:_0x36f05e,args:_0x13b78c,tdx:_0x4acddf}=_0x2974ad,_0x357825=_0x13b78c[0x0],_0x48117b=_0x36f05e,_0x5124d8={};if(_0x48117b[_0x4d4181(0xf4)])_0x5124d8[_0x4d4181(0xf4)]=_0x48117b[_0x4d4181(0xf4)];if(_0x48117b[_0x4d4181(0xe9)])_0x5124d8[_0x4d4181(0xe9)]=_0x48117b[_0x4d4181(0xe9)];if(_0x48117b[_0x4d4181(0xae)])_0x5124d8[_0x4d4181(0xae)]=_0x48117b[_0x4d4181(0xae)];if(_0x48117b[_0x4d4181(0xe4)])_0x5124d8[_0x4d4181(0xe4)]=_0x48117b['timezone'];if(_0x48117b[_0x4d4181(0xc2)]!==undefined)_0x5124d8['delay']=Number(_0x48117b['delay']);if(_0x48117b[_0x4d4181(0xc3)]!==undefined)_0x5124d8[_0x4d4181(0xc3)]=Number(_0x48117b[_0x4d4181(0xc3)]);if(_0x48117b['retryLimit']!==undefined)_0x5124d8['retry_limit']=Number(_0x48117b[_0x4d4181(0x131)]);if(_0x48117b[_0x4d4181(0xce)])_0x5124d8['engine_version']=_0x48117b[_0x4d4181(0xce)];if(_0x48117b['result'])_0x5124d8['result']=_0x48117b[_0x4d4181(0x123)];if(_0x48117b['file'])try{_0x5124d8[_0x4d4181(0xe2)]=readFileSync(_0x48117b['file'],'utf-8')[_0x4d4181(0xb2)]();}catch(_0x13cd5b){throw new SDKError(ErrorCode[_0x4d4181(0x11c)],_0x4d4181(0xd0)+_0x48117b[_0x4d4181(0x137)],_0x13cd5b instanceof Error?_0x13cd5b:undefined);}if(Object[_0x4d4181(0xf2)](_0x5124d8)[_0x4d4181(0xc0)]===0x0)throw new SDKError(ErrorCode[_0x4d4181(0x11c)],_0x4d4181(0xbd));if(_0x36f05e[_0x4d4181(0x115)]){console[_0x4d4181(0xd7)](_0x4d4181(0x117)+_0x357825);for(const [_0x13ef83,_0x3ba61b]of Object[_0x4d4181(0xc4)](_0x5124d8)){_0x13ef83==='query'?console['error']('\x20\x20'+_0x13ef83+':\x20'+_0x3ba61b[_0x4d4181(0xf9)](0x0,0x32)+_0x4d4181(0x129)):console[_0x4d4181(0xd7)]('\x20\x20'+_0x13ef83+':\x20'+_0x3ba61b);}}const _0x10961c=await withSpinner('Updating\x20schedule...',()=>_0x4acddf[_0x4d4181(0xd9)][_0x4d4181(0x111)](_0x357825,_0x5124d8),{'verbose':_0x36f05e[_0x4d4181(0x115)]});return console[_0x4d4181(0xd7)]('Schedule\x20updated:\x20'+_0x10961c[_0x4d4181(0xc5)]['name']),await handleSingleObjectOutput(_0x10961c[_0x4d4181(0xc5)],_0x36f05e),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x872857(0x116);[a34_0x872857(0xc6)]=a34_0x872857(0xed);[a34_0x872857(0xb7)](_0x104f89){const _0x1b401c=a34_0x872857,_0x34b779=_0x104f89[_0x1b401c(0xdb)][0x0];if(!_0x34b779)return _0x1b401c(0x127);return undefined;}async[a34_0x872857(0x103)](_0x4ee8cd){const _0x490aad=a34_0x872857,{options:_0x17e2a1,args:_0x698c7d,tdx:_0x1071da}=_0x4ee8cd,_0xed1316=_0x698c7d[0x0];if(!_0x17e2a1['yes']){const _0x961890=await confirm(_0x490aad(0x114)+_0xed1316+'\x22?');if(!_0x961890)return console[_0x490aad(0xd7)](_0x490aad(0xef)),0x0;}const _0x4fb0c1=await withSpinner(_0x490aad(0xaa),()=>_0x1071da[_0x490aad(0xd9)][_0x490aad(0x133)](_0xed1316),{'verbose':_0x17e2a1['verbose']});return console[_0x490aad(0xd7)](_0x490aad(0x104)+_0x4fb0c1['data'][_0x490aad(0xe6)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xab);[a34_0x872857(0xc6)]=a34_0x872857(0xde);['validate'](_0x2d8ce3){const _0x3a8907=a34_0x872857,_0x212df4=_0x2d8ce3[_0x3a8907(0xdb)][0x0];if(!_0x212df4)return _0x3a8907(0xec);return undefined;}async[a34_0x872857(0x103)](_0x32db8f){const _0x1fe2f2=a34_0x872857,{options:_0x3f8763,args:_0x43d289,tdx:_0x4ac431}=_0x32db8f,_0x30f05c=_0x43d289[0x0],_0x4c8d6e=_0x3f8763,_0x2b8cf0=_0x4c8d6e[_0x1fe2f2(0x110)],_0x7e7281=_0x4c8d6e[_0x1fe2f2(0xfe)]!==undefined?Number(_0x4c8d6e[_0x1fe2f2(0xfe)]):undefined;if(_0x3f8763['verbose']){console['error'](_0x1fe2f2(0x130)+_0x30f05c);if(_0x2b8cf0)console[_0x1fe2f2(0xd7)](_0x1fe2f2(0x134)+_0x2b8cf0);if(_0x7e7281)console['error']('\x20\x20Num:\x20'+_0x7e7281);}const _0x29ca1f=await withSpinner(_0x1fe2f2(0x102),()=>_0x4ac431[_0x1fe2f2(0xd9)][_0x1fe2f2(0xee)](_0x30f05c,{'time':_0x2b8cf0,'num':_0x7e7281}),{'verbose':_0x3f8763['verbose']}),_0x754ec3=_0x29ca1f[_0x1fe2f2(0xc5)][_0x1fe2f2(0x119)];console[_0x1fe2f2(0xd7)](_0x1fe2f2(0xe1)+_0x754ec3['length']+_0x1fe2f2(0x101)+(_0x754ec3[_0x1fe2f2(0xc0)]!==0x1?'s':'')+'\x20created');for(const _0x3c0ba7 of _0x754ec3){console[_0x1fe2f2(0xd7)](_0x1fe2f2(0xa8)+_0x3c0ba7[_0x1fe2f2(0x12b)]);}return await handleSDKOutput(_0x754ec3,_0x3f8763),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x872857(0xe6)]='schedule:history';[a34_0x872857(0xc6)]=a34_0x872857(0x11d);[a34_0x872857(0xb7)](_0x11a834){const _0x524eb0=a34_0x872857,_0x13c8d6=_0x11a834[_0x524eb0(0xdb)][0x0];if(!_0x13c8d6)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x2f0829){const _0x55a8d9=a34_0x872857,{options:_0x22ce67,args:_0x4c4854,tdx:_0x58fe55}=_0x2f0829,_0x4889a4=_0x4c4854[0x0],_0xba585f=_0x22ce67,_0x587d0c=_0xba585f[_0x55a8d9(0xd2)]!==undefined?Number(_0xba585f['from']):undefined,_0xf8e33d=_0xba585f['to']!==undefined?Number(_0xba585f['to']):undefined,_0x5ce003=await withSpinner(_0x55a8d9(0x10b),()=>_0x58fe55[_0x55a8d9(0xd9)][_0x55a8d9(0x128)](_0x4889a4,{'from':_0x587d0c,'to':_0xf8e33d}),{'verbose':_0x22ce67[_0x55a8d9(0x115)]}),_0x13b382=_0x5ce003['data'];console[_0x55a8d9(0xd7)](_0x55a8d9(0xdc)+_0x13b382[_0x55a8d9(0x126)]+'\x20execution'+(_0x13b382[_0x55a8d9(0x126)]!==0x1?'s':'')+_0x55a8d9(0xc8)+_0x13b382[_0x55a8d9(0xd2)]+'-'+_0x13b382['to']+')');const _0x24c662=_0x13b382[_0x55a8d9(0x128)][_0x55a8d9(0xe0)](_0x54966d=>({'job_id':_0x54966d[_0x55a8d9(0x12b)],'type':_0x54966d[_0x55a8d9(0xe9)],'status':_0x54966d[_0x55a8d9(0x136)],'scheduled_at':_0x54966d['scheduled_at'],'created_at':_0x54966d[_0x55a8d9(0xb4)],'start_at':_0x54966d[_0x55a8d9(0x100)],'end_at':_0x54966d[_0x55a8d9(0xb9)]}));return await handleSDKOutput(_0x24c662,_0x22ce67),0x0;}}
|
|
1
|
+
const a34_0x109a39=a34_0x25ab;(function(_0x18dd64,_0x44e24d){const _0x4665da=a34_0x25ab,_0x4efefb=_0x18dd64();while(!![]){try{const _0x2ff46e=-parseInt(_0x4665da(0x199))/0x1*(parseInt(_0x4665da(0x19f))/0x2)+-parseInt(_0x4665da(0x1bd))/0x3*(parseInt(_0x4665da(0x19b))/0x4)+-parseInt(_0x4665da(0x16b))/0x5+-parseInt(_0x4665da(0x1ad))/0x6+parseInt(_0x4665da(0x1b0))/0x7*(-parseInt(_0x4665da(0x155))/0x8)+-parseInt(_0x4665da(0x1c7))/0x9+parseInt(_0x4665da(0x1d0))/0xa;if(_0x2ff46e===_0x44e24d)break;else _0x4efefb['push'](_0x4efefb['shift']());}catch(_0x2501e1){_0x4efefb['push'](_0x4efefb['shift']());}}}(a34_0x52fc,0xd9468));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x4ea172 from'chalk';function formatRelativeTime(_0x5897b4){const _0x377847=a34_0x25ab,_0x491d98=new Date(_0x5897b4),_0x2bbf8f=new Date(),_0x3e50a8=_0x491d98['getTime']()-_0x2bbf8f[_0x377847(0x16c)](),_0x22b29b=Math[_0x377847(0x194)](_0x3e50a8)/0x3e8,_0x567645=_0x3e50a8<0x0;if(_0x22b29b<0x3c)return _0x567645?_0x377847(0x163):_0x377847(0x179);else{if(_0x22b29b<0xe10){const _0x18d0ca=Math[_0x377847(0x1b4)](_0x22b29b/0x3c);return _0x567645?_0x18d0ca+_0x377847(0x191):_0x377847(0x1bf)+_0x18d0ca+'m';}else{if(_0x22b29b<0x15180){const _0x21c62c=Math[_0x377847(0x1b4)](_0x22b29b/0xe10);return _0x567645?_0x21c62c+'h\x20ago':_0x377847(0x1bf)+_0x21c62c+'h';}else{if(_0x22b29b<0x93a80){const _0x582d89=Math[_0x377847(0x1b4)](_0x22b29b/0x15180);return _0x567645?_0x582d89+'d\x20ago':_0x377847(0x1bf)+_0x582d89+'d';}else return _0x491d98[_0x377847(0x1a9)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a34_0x109a39(0x1c6);[a34_0x109a39(0x180)]=a34_0x109a39(0x1a4);async['execute'](_0x3ae7f3){const _0x5ee10=a34_0x109a39,{options:_0x52fd33,args:_0x422e9d,tdx:_0x1b80f5}=_0x3ae7f3,_0x535c6f=resolveLimit(_0x52fd33[_0x5ee10(0x15d)],DEFAULT_DISPLAY_LIMIT),_0x2b1fca=_0x422e9d[0x0],_0x14907b=_0x2b1fca?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x2b1fca+_0x5ee10(0x1c1):_0x5ee10(0x18b),_0xfdaa0a=await withSpinner(_0x14907b,()=>_0x1b80f5[_0x5ee10(0x183)][_0x5ee10(0x1a6)]({'limit':_0x535c6f,'scheduled':!![],'pattern':_0x2b1fca}),{'verbose':_0x52fd33['verbose']}),_0xabd94f=_0xfdaa0a[_0x5ee10(0x189)][_0x5ee10(0x1d5)],_0x2aa0ff=_0xfdaa0a[_0x5ee10(0x189)][_0x5ee10(0x1a3)][_0x5ee10(0x18d)],_0x27799c=_0x2b1fca?_0x5ee10(0x165)+_0x2b1fca+'\x22':'';_0x2aa0ff?console[_0x5ee10(0x1ae)](_0x5ee10(0x1d2)+_0xabd94f[_0x5ee10(0x1c9)]+_0x5ee10(0x15b)+_0x27799c+_0x5ee10(0x193)):console['error']('Found\x20'+_0xabd94f[_0x5ee10(0x1c9)]+_0x5ee10(0x1ba)+(_0xabd94f[_0x5ee10(0x1c9)]!==0x1?_0x5ee10(0x17d):'y')+_0x27799c);if(_0x52fd33[_0x5ee10(0x1bc)]==='json'||_0x52fd33['format']===_0x5ee10(0x164)||_0x52fd33[_0x5ee10(0x1bc)]===_0x5ee10(0x152)||_0x52fd33[_0x5ee10(0x1bc)]==='tsv'){const _0x92f1ae=_0xabd94f['map'](_0x30bbc0=>({'id':_0x30bbc0['id'],'name':_0x30bbc0[_0x5ee10(0x161)],'cron':_0x30bbc0[_0x5ee10(0x1c8)],'database':_0x30bbc0[_0x5ee10(0x166)]?.[_0x5ee10(0x161)],'type':_0x30bbc0[_0x5ee10(0x1d4)],'timezone':_0x30bbc0[_0x5ee10(0x160)],'user_name':_0x30bbc0['user']?.[_0x5ee10(0x161)],'updated_at':_0x30bbc0[_0x5ee10(0x1d7)],'next_run_at':_0x30bbc0[_0x5ee10(0x1b8)],'last_job_status':_0x30bbc0[_0x5ee10(0x1c2)]?.[_0x5ee10(0x1bb)]}));await handleSDKOutput(_0x92f1ae,_0x52fd33);}else{if(_0xabd94f[_0x5ee10(0x1c9)]===0x0)console[_0x5ee10(0x14f)](_0x5ee10(0x170));else{const _0x10b7b2=_0x52fd33[_0x5ee10(0x14b)],_0x1501a7=_0xabd94f['map'](_0x4dce0a=>{const _0x4fc7aa=_0x5ee10,_0x195af9=_0x4dce0a[_0x4fc7aa(0x1c2)]?.['status']?_0x4dce0a['last_job'][_0x4fc7aa(0x1bb)]===_0x4fc7aa(0x1c3)?'✓':'✗':'-',_0x26fa79=_0x4dce0a[_0x4fc7aa(0x1c2)]?.[_0x4fc7aa(0x192)]?formatRelativeTime(_0x4dce0a[_0x4fc7aa(0x1c2)]['ended_at']):_0x4fc7aa(0x1b6),_0xf3f86e=_0x4dce0a['next_run_at']?formatRelativeTime(_0x4dce0a['next_run_at']):'-',_0x1ef5ab=_0x4dce0a['cron']||'',_0x40f5bf=_0x4dce0a[_0x4fc7aa(0x161)]||_0x4fc7aa(0x1b3),_0x52ba56=getConsoleUrl(_0x10b7b2,'/app/queries/editor?queryId='+_0x4dce0a['id']);return{'statusIcon':_0x195af9,'lastRun':_0x26fa79,'nextRun':_0xf3f86e,'cron':_0x1ef5ab,'name':_0x40f5bf,'queryUrl':_0x52ba56,'status':_0x4dce0a[_0x4fc7aa(0x1c2)]?.[_0x4fc7aa(0x1bb)]};}),_0xabdb06=Math[_0x5ee10(0x195)](..._0x1501a7[_0x5ee10(0x158)](_0x3aacfa=>_0x3aacfa[_0x5ee10(0x1a8)][_0x5ee10(0x1c9)])),_0x3e4155=Math[_0x5ee10(0x195)](..._0x1501a7['map'](_0x48a2c0=>_0x48a2c0[_0x5ee10(0x177)]['length'])),_0x500d17=Math[_0x5ee10(0x195)](..._0x1501a7['map'](_0x4751da=>_0x4751da[_0x5ee10(0x1c8)]['length'])),_0x1ac31b=_0x1501a7[_0x5ee10(0x158)](_0x5327d6=>{const _0x56d96e=_0x5ee10,_0x420e8e=_0x5327d6[_0x56d96e(0x1bb)]==='success'?a34_0x4ea172['green'](_0x5327d6['statusIcon']):_0x5327d6['status']==='error'?a34_0x4ea172['red'](_0x5327d6['statusIcon']):a34_0x4ea172[_0x56d96e(0x15c)](_0x5327d6[_0x56d96e(0x168)]),_0x4d3610=_0x5327d6[_0x56d96e(0x1a8)]['padEnd'](_0xabdb06),_0x581fd0=_0x5327d6[_0x56d96e(0x177)][_0x56d96e(0x157)](_0x3e4155),_0x3f6f54=_0x5327d6[_0x56d96e(0x1c8)]?a34_0x4ea172['cyan'](_0x5327d6['cron']['padEnd'](_0x500d17)):'\x20'['repeat'](_0x500d17),_0x243745=hyperlink(_0x5327d6['name'],_0x5327d6[_0x56d96e(0x162)]);return _0x56d96e(0x16d)+_0x420e8e+'\x20'+_0x4d3610+_0x56d96e(0x17f)+_0x581fd0+'\x20\x20'+_0x3f6f54+'\x20\x20'+_0x243745;});await writeOutput(_0x1ac31b[_0x5ee10(0x171)]('\x0a'),_0x52fd33[_0x5ee10(0x16f)],_0x5ee10(0x1b2));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x109a39(0x16a);['description']=a34_0x109a39(0x15a);['validate'](_0x17ebbe){const _0x52d959=a34_0x109a39,_0x555dcd=_0x17ebbe[_0x52d959(0x1ce)][0x0];if(!_0x555dcd)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x2628bd){const _0x29b8c3=a34_0x109a39,{options:_0x3ed2f3,args:_0x3fcd7b,tdx:_0x359356}=_0x2628bd,_0x8014c2=_0x3fcd7b[0x0],_0x4ba6e3=await withSpinner(_0x29b8c3(0x174),()=>_0x359356[_0x29b8c3(0x183)][_0x29b8c3(0x14a)](_0x8014c2),{'verbose':_0x3ed2f3[_0x29b8c3(0x197)]}),_0x18ab59=_0x4ba6e3[_0x29b8c3(0x189)],_0x11f174={'name':_0x18ab59[_0x29b8c3(0x161)],'cron':_0x18ab59[_0x29b8c3(0x1c8)],'database':_0x18ab59['database'],'type':_0x18ab59[_0x29b8c3(0x1d4)],'timezone':_0x18ab59[_0x29b8c3(0x1d3)],'user_name':_0x18ab59[_0x29b8c3(0x1be)],'created_at':_0x18ab59['created_at'],'engine_version':_0x18ab59[_0x29b8c3(0x17e)],'executing_user_id':_0x18ab59[_0x29b8c3(0x1a2)],'query':_0x18ab59[_0x29b8c3(0x1b5)],'delay':_0x18ab59[_0x29b8c3(0x154)],'priority':_0x18ab59['priority'],'retry_limit':_0x18ab59[_0x29b8c3(0x175)],..._0x18ab59[_0x29b8c3(0x19a)]&&{'result':_0x18ab59[_0x29b8c3(0x19a)]}};return await handleSingleObjectOutput(_0x11f174,_0x3ed2f3),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x109a39(0x161)]='schedule:create';['description']=a34_0x109a39(0x19c);['validate'](_0x37c5be){const _0x51df6c=a34_0x109a39,_0x2e032f=_0x37c5be[_0x51df6c(0x1ce)][0x0];if(!_0x2e032f)return _0x51df6c(0x181);const _0x2fc73c=_0x37c5be['options'];if(!_0x2fc73c[_0x51df6c(0x166)])return _0x51df6c(0x188);return undefined;}async[a34_0x109a39(0x19e)](_0x5a31ab){const _0x5bddad=a34_0x109a39,{options:_0x502fe3,args:_0x3b8b7f,tdx:_0x2bbc6e}=_0x5a31ab,_0x1cd316=_0x3b8b7f[0x0],_0x432042=_0x502fe3,_0xb8725c=_0x432042['database'],_0x181c2f=_0x432042[_0x5bddad(0x198)],_0xbea690=_0x432042[_0x5bddad(0x1d4)]||_0x5bddad(0x1c5);let _0x49639c;try{_0x49639c=readFileSync(_0x181c2f,'utf-8')[_0x5bddad(0x15f)]();}catch(_0x348950){throw new SDKError(ErrorCode[_0x5bddad(0x18a)],_0x5bddad(0x151)+_0x181c2f,_0x348950 instanceof Error?_0x348950:undefined);}if(!_0x49639c)throw new SDKError(ErrorCode[_0x5bddad(0x18a)],'Query\x20file\x20is\x20empty');const _0x5bb1c1={'database':_0xb8725c,'query':_0x49639c,'type':_0xbea690};if(_0x432042['cron'])_0x5bb1c1[_0x5bddad(0x1c8)]=_0x432042[_0x5bddad(0x1c8)];if(_0x432042[_0x5bddad(0x1d3)])_0x5bb1c1['timezone']=_0x432042[_0x5bddad(0x1d3)];if(_0x432042[_0x5bddad(0x154)]!==undefined)_0x5bb1c1[_0x5bddad(0x154)]=Number(_0x432042[_0x5bddad(0x154)]);if(_0x432042[_0x5bddad(0x1aa)]!==undefined)_0x5bb1c1[_0x5bddad(0x1aa)]=Number(_0x432042[_0x5bddad(0x1aa)]);if(_0x432042[_0x5bddad(0x156)]!==undefined)_0x5bb1c1[_0x5bddad(0x175)]=Number(_0x432042['retryLimit']);if(_0x432042[_0x5bddad(0x1cf)])_0x5bb1c1['engine_version']=_0x432042[_0x5bddad(0x1cf)];if(_0x432042['result'])_0x5bb1c1['result']=_0x432042[_0x5bddad(0x19a)];if(_0x502fe3[_0x5bddad(0x197)]){console[_0x5bddad(0x1ae)](_0x5bddad(0x14e)+_0x1cd316),console['error'](_0x5bddad(0x1af)+_0xb8725c),console['error'](_0x5bddad(0x17c)+_0xbea690);if(_0x5bb1c1[_0x5bddad(0x1c8)])console[_0x5bddad(0x1ae)](_0x5bddad(0x15e)+_0x5bb1c1[_0x5bddad(0x1c8)]);if(_0x5bb1c1['timezone'])console[_0x5bddad(0x1ae)](_0x5bddad(0x1a5)+_0x5bb1c1[_0x5bddad(0x1d3)]);}const _0x610a3c=await withSpinner(_0x5bddad(0x18f),()=>_0x2bbc6e['schedules'][_0x5bddad(0x1b7)](_0x1cd316,_0x5bb1c1),{'verbose':_0x502fe3[_0x5bddad(0x197)]});return console[_0x5bddad(0x1ae)]('Schedule\x20created:\x20'+_0x610a3c[_0x5bddad(0x189)]['name']),await handleSingleObjectOutput(_0x610a3c[_0x5bddad(0x189)],_0x502fe3),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a34_0x109a39(0x17a);[a34_0x109a39(0x180)]=a34_0x109a39(0x178);[a34_0x109a39(0x1b9)](_0x3cff97){const _0x5ee614=a34_0x109a39,_0x4d25d7=_0x3cff97[_0x5ee614(0x1ce)][0x0];if(!_0x4d25d7)return _0x5ee614(0x1a7);return undefined;}async[a34_0x109a39(0x19e)](_0x49e958){const _0x45e112=a34_0x109a39,{options:_0x2f53a4,args:_0x197a5f,tdx:_0x1ceb7f}=_0x49e958,_0xd1e0f0=_0x197a5f[0x0],_0x5ac2e5=_0x2f53a4,_0x54b76f={};if(_0x5ac2e5[_0x45e112(0x166)])_0x54b76f[_0x45e112(0x166)]=_0x5ac2e5[_0x45e112(0x166)];if(_0x5ac2e5[_0x45e112(0x1d4)])_0x54b76f[_0x45e112(0x1d4)]=_0x5ac2e5['type'];if(_0x5ac2e5[_0x45e112(0x1c8)])_0x54b76f[_0x45e112(0x1c8)]=_0x5ac2e5[_0x45e112(0x1c8)];if(_0x5ac2e5[_0x45e112(0x1d3)])_0x54b76f[_0x45e112(0x1d3)]=_0x5ac2e5[_0x45e112(0x1d3)];if(_0x5ac2e5[_0x45e112(0x154)]!==undefined)_0x54b76f[_0x45e112(0x154)]=Number(_0x5ac2e5[_0x45e112(0x154)]);if(_0x5ac2e5[_0x45e112(0x1aa)]!==undefined)_0x54b76f[_0x45e112(0x1aa)]=Number(_0x5ac2e5[_0x45e112(0x1aa)]);if(_0x5ac2e5[_0x45e112(0x156)]!==undefined)_0x54b76f[_0x45e112(0x175)]=Number(_0x5ac2e5['retryLimit']);if(_0x5ac2e5['engineVersion'])_0x54b76f['engine_version']=_0x5ac2e5[_0x45e112(0x1cf)];if(_0x5ac2e5[_0x45e112(0x19a)])_0x54b76f[_0x45e112(0x19a)]=_0x5ac2e5[_0x45e112(0x19a)];if(_0x5ac2e5[_0x45e112(0x198)])try{_0x54b76f['query']=readFileSync(_0x5ac2e5[_0x45e112(0x198)],_0x45e112(0x1cd))[_0x45e112(0x15f)]();}catch(_0x15be07){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x45e112(0x151)+_0x5ac2e5[_0x45e112(0x198)],_0x15be07 instanceof Error?_0x15be07:undefined);}if(Object['keys'](_0x54b76f)['length']===0x0)throw new SDKError(ErrorCode[_0x45e112(0x18a)],_0x45e112(0x14c));if(_0x2f53a4[_0x45e112(0x197)]){console[_0x45e112(0x1ae)](_0x45e112(0x186)+_0xd1e0f0);for(const [_0x3a5c15,_0x35a527]of Object[_0x45e112(0x1a0)](_0x54b76f)){_0x3a5c15==='query'?console[_0x45e112(0x1ae)]('\x20\x20'+_0x3a5c15+':\x20'+_0x35a527['substring'](0x0,0x32)+_0x45e112(0x182)):console[_0x45e112(0x1ae)]('\x20\x20'+_0x3a5c15+':\x20'+_0x35a527);}}const _0x441e65=await withSpinner('Updating\x20schedule...',()=>_0x1ceb7f['schedules'][_0x45e112(0x1b1)](_0xd1e0f0,_0x54b76f),{'verbose':_0x2f53a4[_0x45e112(0x197)]});return console['error'](_0x45e112(0x16e)+_0x441e65[_0x45e112(0x189)]['name']),await handleSingleObjectOutput(_0x441e65[_0x45e112(0x189)],_0x2f53a4),0x0;}}function a34_0x25ab(_0x1eb502,_0x48a5be){_0x1eb502=_0x1eb502-0x14a;const _0x52fc4b=a34_0x52fc();let _0x25ab4e=_0x52fc4b[_0x1eb502];return _0x25ab4e;}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x109a39(0x161)]=a34_0x109a39(0x196);[a34_0x109a39(0x180)]=a34_0x109a39(0x1c4);[a34_0x109a39(0x1b9)](_0x80576d){const _0x4306db=a34_0x109a39,_0x360aeb=_0x80576d[_0x4306db(0x1ce)][0x0];if(!_0x360aeb)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x109a39(0x19e)](_0x149837){const _0x324b66=a34_0x109a39,{options:_0x52fd2e,args:_0x37ab3e,tdx:_0x22b048}=_0x149837,_0x5262b7=_0x37ab3e[0x0];if(!_0x52fd2e['yes']){const _0x53d2f8=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x5262b7+'\x22?');if(!_0x53d2f8)return console[_0x324b66(0x1ae)](_0x324b66(0x184)),0x0;}const _0x198f26=await withSpinner(_0x324b66(0x1d6),()=>_0x22b048['schedules'][_0x324b66(0x173)](_0x5262b7),{'verbose':_0x52fd2e['verbose']});return console[_0x324b66(0x1ae)]('Schedule\x20deleted:\x20'+_0x198f26[_0x324b66(0x189)][_0x324b66(0x161)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x109a39(0x161)]=a34_0x109a39(0x18e);[a34_0x109a39(0x180)]=a34_0x109a39(0x1c0);['validate'](_0x461176){const _0x2b3aef=a34_0x109a39,_0x273b50=_0x461176[_0x2b3aef(0x1ce)][0x0];if(!_0x273b50)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x26193a){const _0xa4d22b=a34_0x109a39,{options:_0x2d4d5f,args:_0xf3a733,tdx:_0x16768d}=_0x26193a,_0x40a4d6=_0xf3a733[0x0],_0x2ce0ac=_0x2d4d5f,_0x4c00e9=_0x2ce0ac[_0xa4d22b(0x190)],_0x25fb80=_0x2ce0ac[_0xa4d22b(0x19d)]!==undefined?Number(_0x2ce0ac[_0xa4d22b(0x19d)]):undefined;if(_0x2d4d5f[_0xa4d22b(0x197)]){console[_0xa4d22b(0x1ae)](_0xa4d22b(0x1ac)+_0x40a4d6);if(_0x4c00e9)console['error']('\x20\x20Time:\x20'+_0x4c00e9);if(_0x25fb80)console[_0xa4d22b(0x1ae)](_0xa4d22b(0x176)+_0x25fb80);}const _0xc55549=await withSpinner(_0xa4d22b(0x159),()=>_0x16768d['schedules'][_0xa4d22b(0x18c)](_0x40a4d6,{'time':_0x4c00e9,'num':_0x25fb80}),{'verbose':_0x2d4d5f[_0xa4d22b(0x197)]}),_0x4a2ed9=_0xc55549['data'][_0xa4d22b(0x153)];console[_0xa4d22b(0x1ae)]('Schedule\x20run\x20submitted:\x20'+_0x4a2ed9[_0xa4d22b(0x1c9)]+_0xa4d22b(0x17b)+(_0x4a2ed9[_0xa4d22b(0x1c9)]!==0x1?'s':'')+_0xa4d22b(0x14d));for(const _0x154ea5 of _0x4a2ed9){console[_0xa4d22b(0x1ae)](_0xa4d22b(0x169)+_0x154ea5[_0xa4d22b(0x1cb)]);}return await handleSDKOutput(_0x4a2ed9,_0x2d4d5f),0x0;}}function a34_0x52fc(){const _0x1259cf=['3956UjZmcr','Create\x20a\x20scheduled\x20query','num','execute','2501502KllWQE','entries','count','executing_user_id','pagination','List\x20scheduled\x20queries','\x20\x20Timezone:\x20','listQueries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','lastRun','toLocaleDateString','priority','Found\x20','Running\x20schedule:\x20','838410PvkKAL','error','\x20\x20Database:\x20','4270567KfRVju','update','list','(unnamed)','round','query','never','create','next_run_at','validate','\x20scheduled\x20quer','status','format','4173Fdtpns','user_name','in\x20','Run\x20a\x20scheduled\x20query\x20immediately','\x22...','last_job','success','Delete\x20a\x20scheduled\x20query','trino','schedule:list','12826800evSRhS','cron','length','schedule:history','job_id','history','utf-8','args','engineVersion','67700700LFAhRd','from','Showing\x20first\x20','timezone','type','queries','Deleting\x20schedule...','updated_at','show','site','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20created','Creating\x20schedule:\x20','log','\x20(showing\x20','Failed\x20to\x20read\x20file:\x20','table','jobs','delay','8XyMLbh','retryLimit','padEnd','map','Running\x20schedule...','Show\x20schedule\x20details','\x20schedules','dim','limit','\x20\x20Cron:\x20','trim','time_zone','name','queryUrl','just\x20now','jsonl','\x20matching\x20\x22','database','Getting\x20schedule\x20history...','statusIcon','\x20\x20Job\x20ID:\x20','schedule:show','5393220dZxJMW','getTime','📅\x20','Schedule\x20updated:\x20','output','No\x20scheduled\x20queries\x20found','join','end_at','delete','Getting\x20schedule\x20details...','retry_limit','\x20\x20Num:\x20','nextRun','Update\x20a\x20scheduled\x20query','soon','schedule:update','\x20job','\x20\x20Type:\x20','ies','engine_version','\x20\x20→\x20','description','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','...','schedules','Cancelled','start_at','Updating\x20schedule:\x20','created_at','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','data','INVALID_ARGUMENT','Listing\x20scheduled\x20queries...','run','has_next_page','schedule:run','Creating\x20schedule...','time','m\x20ago','ended_at','\x20(use\x20--limit\x20to\x20see\x20more)','abs','max','schedule:delete','verbose','file','1znTbUc','result'];a34_0x52fc=function(){return _0x1259cf;};return a34_0x52fc();}export class ScheduleHistoryCommand extends BaseCommand{['name']=a34_0x109a39(0x1ca);[a34_0x109a39(0x180)]='Show\x20schedule\x20execution\x20history';[a34_0x109a39(0x1b9)](_0xfda32d){const _0x1b07d3=a34_0x109a39,_0x94339e=_0xfda32d[_0x1b07d3(0x1ce)][0x0];if(!_0x94339e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x51532f){const _0x13c07d=a34_0x109a39,{options:_0x344327,args:_0x5919fb,tdx:_0x138d74}=_0x51532f,_0x58eaa3=_0x5919fb[0x0],_0x3e784d=_0x344327,_0x41da93=_0x3e784d[_0x13c07d(0x1d1)]!==undefined?Number(_0x3e784d[_0x13c07d(0x1d1)]):undefined,_0x50a7cb=_0x3e784d['to']!==undefined?Number(_0x3e784d['to']):undefined,_0x343474=await withSpinner(_0x13c07d(0x167),()=>_0x138d74[_0x13c07d(0x183)][_0x13c07d(0x1cc)](_0x58eaa3,{'from':_0x41da93,'to':_0x50a7cb}),{'verbose':_0x344327[_0x13c07d(0x197)]}),_0x38e1fb=_0x343474[_0x13c07d(0x189)];console[_0x13c07d(0x1ae)](_0x13c07d(0x1ab)+_0x38e1fb['count']+'\x20execution'+(_0x38e1fb[_0x13c07d(0x1a1)]!==0x1?'s':'')+_0x13c07d(0x150)+_0x38e1fb[_0x13c07d(0x1d1)]+'-'+_0x38e1fb['to']+')');const _0xf3d8b3=_0x38e1fb['history'][_0x13c07d(0x158)](_0x2c864f=>({'job_id':_0x2c864f[_0x13c07d(0x1cb)],'type':_0x2c864f[_0x13c07d(0x1d4)],'status':_0x2c864f['status'],'scheduled_at':_0x2c864f['scheduled_at'],'created_at':_0x2c864f[_0x13c07d(0x187)],'start_at':_0x2c864f[_0x13c07d(0x185)],'end_at':_0x2c864f[_0x13c07d(0x172)]}));return await handleSDKOutput(_0xf3d8b3,_0x344327),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0xb2e73=a35_0x2749;function a35_0xd446(){const _0x35aacf=['getSQLFromYamlFile','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','getSQLFromServerSegment','segment:folder:show','7IAHxLI','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Fetching\x20folder\x20details...','Parent\x20ID:\x20','execute','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolving\x20\x27','✖\x20Query\x20failed\x20[','data','Use:\x20tdx\x20ps\x20show','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','url','INVALID_ARGUMENT','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','jobId','Resolving\x20parent\x20folder\x20\x27','1512078GlMkKU','✔\x20Query\x20completed:\x20Processed\x20','\x20[Job\x20ID:\x20','description','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','41880AXAKJq','Show\x20segment\x20folder\x20details','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','log','SEGMENT_NOT_FOUND','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','type','Resolved\x20folder\x20ID:\x20','Folder\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','3975224CSHFTS','folderId','Segment\x20ID:\x20','segment','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','replace','segmentId','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','cause','getParent','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment:folder:list','Resolved\x20type:\x20','folder','Options:','SQL\x20query:\x0a','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20parent\x20ID:\x20','segment:sql','site','\x27...','Use:\x20tdx\x20ps\x20desc','code','Use:\x20tdx\x20ps\x20view','20743hVwxXj','segmentPath','\x27\x20with\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','limit','length','segment:folder:create','resolvePathToResource','891oOsTUy','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','includes','\x20folder','segment:desc','getSegment','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','getSegmentSQLFromYaml','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','trim','Usage:','Target\x20path:\x20','json','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','resolveFolderId','Fetching\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getSegmentSQL','Folder\x20name:\x20','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Folder\x20path:\x20','SEGMENT_FOLDER_NOT_FOUND','content','Examples:','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20','segment:show','message','160085gPHFnD','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolved\x20parent\x20folder\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','name','parentId','folderPath','SELECT\x20*\x20FROM\x20(\x0a','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20rows\x20','error','22csxZPb','Creating\x20folder\x20\x27','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jsonl','Resolving\x20parent\x20segment\x20\x27','getFolder','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','119487iSDFXO','Resolved\x20YAML\x20file:\x20','Parent\x20name:\x20','test','Resolving\x20folder\x20\x27','parentSegment','Get\x20SQL\x20query\x20for\x20child\x20segment','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','information_schema','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Site:\x20','segment:view','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Fetching\x20SQL\x20from\x20rule...','red','\x20\x20Cause:\x20','stats','\x20Opening\x20','\x20\x20Segment\x20name:\x20','Executing\x20segment\x20query...','elapsedTimeMillis','Parent\x20segment:\x20','parent','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','fullPath','verbose','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','setJobId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','/e/','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','274640sjYGsu','32CbEnOi','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','/app/ps/','segmentName','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','segment:describe'];a35_0xd446=function(){return _0x35aacf;};return a35_0xd446();}(function(_0x177e42,_0x513fce){const _0xf3b71c=a35_0x2749,_0x58b0db=_0x177e42();while(!![]){try{const _0x3f584f=parseInt(_0xf3b71c(0x1a2))/0x1*(parseInt(_0xf3b71c(0x1da))/0x2)+parseInt(_0xf3b71c(0x1e1))/0x3*(-parseInt(_0xf3b71c(0x203))/0x4)+parseInt(_0xf3b71c(0x1cc))/0x5+-parseInt(_0xf3b71c(0x178))/0x6*(parseInt(_0xf3b71c(0x167))/0x7)+-parseInt(_0xf3b71c(0x202))/0x8+-parseInt(_0xf3b71c(0x1aa))/0x9*(-parseInt(_0xf3b71c(0x17d))/0xa)+parseInt(_0xf3b71c(0x187))/0xb;if(_0x3f584f===_0x513fce)break;else _0x58b0db['push'](_0x58b0db['shift']());}catch(_0x5b5eb6){_0x58b0db['push'](_0x58b0db['shift']());}}}(a35_0xd446,0x6946b));function a35_0x2749(_0x181e02,_0x9a88a0){_0x181e02=_0x181e02-0x165;const _0xd446c1=a35_0xd446();let _0x274983=_0xd446c1[_0x181e02];return _0x274983;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0xae67ad from'chalk';async function resolveSegmentTarget(_0x5d8cd7,_0x1fc9ae,_0x4ab06c){const _0x20cae1=a35_0x2749;if(isYamlFilePath(_0x5d8cd7))try{const _0x2673ad=await resolveYamlFilePath(_0x5d8cd7);return _0x4ab06c&&(console[_0x20cae1(0x1d9)](_0x20cae1(0x1e2)+_0x5d8cd7),console[_0x20cae1(0x1d9)]('\x20\x20Parent\x20segment:\x20'+_0x2673ad['parentSegment']),console[_0x20cae1(0x1d9)](_0x20cae1(0x1f4)+_0x2673ad[_0x20cae1(0x207)]),console[_0x20cae1(0x1d9)](_0x20cae1(0x1c3)+(_0x2673ad[_0x20cae1(0x1d5)]||'(root)')),console[_0x20cae1(0x1d9)]('\x20\x20Full\x20path:\x20'+_0x2673ad[_0x20cae1(0x1fb)])),_0x2673ad[_0x20cae1(0x1fb)];}catch(_0x13308c){throw new SDKError(ErrorCode[_0x20cae1(0x174)],_0x20cae1(0x1dc)+_0x13308c[_0x20cae1(0x1cb)]);}if(!_0x1fc9ae)throw new SDKError(ErrorCode[_0x20cae1(0x174)],_0x20cae1(0x182));return _0x1fc9ae+'/'+_0x5d8cd7;}export class SegmentDescribeCommand extends BaseCommand{['name']=a35_0xb2e73(0x20a);[a35_0xb2e73(0x17b)]='Show\x20segment\x20or\x20folder\x20details';async['execute'](_0x23077a){const _0x412fa8=a35_0xb2e73,{options:_0x292ff3,args:_0x357276,tdx:_0x1bb076}=_0x23077a,_0xc998ec=_0x357276[0x0],_0x1b09d6=!_0xc998ec&&!!_0x292ff3[_0x412fa8(0x1e6)],_0x2424e7=_0xc998ec||_0x292ff3[_0x412fa8(0x1e6)];if(!_0x2424e7)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x412fa8(0x1d9)](_0x412fa8(0x16d)),console[_0x412fa8(0x1d9)](_0x412fa8(0x1c6)),console[_0x412fa8(0x1d9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x412fa8(0x1d9)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x412fa8(0x1a5)),0x1;try{const _0x35e8f5=_0x292ff3[_0x412fa8(0x1a3)];let _0x205092=_0x2424e7;!_0x1b09d6&&_0x35e8f5&&!_0x2424e7[_0x412fa8(0x1ac)]('/')&&(_0x205092=_0x35e8f5+'/'+_0x2424e7,_0x292ff3[_0x412fa8(0x1fc)]&&console[_0x412fa8(0x1d9)](_0x412fa8(0x18e)+_0x205092));const _0x23d40d=await withSpinner('Resolving\x20path\x20\x27'+_0x205092+'\x27...',()=>_0x1bb076[_0x412fa8(0x18a)]['resolvePathToResource'](_0x205092),{'verbose':_0x292ff3[_0x412fa8(0x1fc)]}),_0x2e2dd4=_0x23d40d[_0x412fa8(0x170)];_0x292ff3[_0x412fa8(0x1fc)]&&(console[_0x412fa8(0x1d9)](_0x412fa8(0x196)+_0x2e2dd4[_0x412fa8(0x183)]),console[_0x412fa8(0x1d9)](_0x412fa8(0x16a)+_0x2e2dd4[_0x412fa8(0x1d4)]),_0x2e2dd4[_0x412fa8(0x188)]&&console[_0x412fa8(0x1d9)]('Folder\x20ID:\x20'+_0x2e2dd4[_0x412fa8(0x188)]),_0x2e2dd4[_0x412fa8(0x18d)]&&console[_0x412fa8(0x1d9)](_0x412fa8(0x189)+_0x2e2dd4[_0x412fa8(0x18d)]));if(_0x2e2dd4[_0x412fa8(0x183)]===_0x412fa8(0x1f8)){const _0x524bf6=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x1bb076[_0x412fa8(0x18a)][_0x412fa8(0x193)](_0x2e2dd4['parentId']),{'verbose':_0x292ff3['verbose']});await handleSingleObjectOutput(_0x524bf6[_0x412fa8(0x170)],_0x292ff3);}else{if(_0x2e2dd4[_0x412fa8(0x183)]===_0x412fa8(0x197)){if(!_0x2e2dd4[_0x412fa8(0x188)])throw new SDKError(ErrorCode[_0x412fa8(0x1c4)],_0x412fa8(0x1d7));const _0x3f8791=await withSpinner(_0x412fa8(0x169),()=>_0x1bb076['segment'][_0x412fa8(0x1df)](_0x2e2dd4['folderId']),{'verbose':_0x292ff3[_0x412fa8(0x1fc)]});await handleSingleObjectOutput(_0x3f8791[_0x412fa8(0x170)],_0x292ff3);}else{if(_0x2e2dd4[_0x412fa8(0x183)]==='segment'){if(!_0x2e2dd4[_0x412fa8(0x18d)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x412fa8(0x1f9));const _0x2715a4=await withSpinner(_0x412fa8(0x1fa),()=>_0x1bb076[_0x412fa8(0x18a)]['getSegment'](_0x2e2dd4['parentId'],_0x2e2dd4[_0x412fa8(0x18d)]),{'verbose':_0x292ff3[_0x412fa8(0x1fc)]});await handleSingleObjectOutput(_0x2715a4[_0x412fa8(0x170)],_0x292ff3);}}}return 0x0;}catch(_0x15ed8a){if(_0x15ed8a instanceof SDKError)return console[_0x412fa8(0x1d9)](_0x412fa8(0x1c9)+_0x15ed8a[_0x412fa8(0x1cb)]),_0x15ed8a[_0x412fa8(0x192)]&&console['error'](_0x412fa8(0x1f1)+_0x15ed8a['cause']),0x1;throw _0x15ed8a;}}}export class SegmentShowCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x1ca);['description']=a35_0xb2e73(0x1e8);async['execute'](_0x927400){const _0x2b50f7=a35_0xb2e73,{options:_0x4cc6cb,args:_0x2b312e,tdx:_0x4d0605}=_0x927400,_0x509e4c=_0x2b312e[0x0];if(!_0x509e4c)return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x186)),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x18f)),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x20d)),console[_0x2b50f7(0x1d9)]('Examples:'),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x1b1)),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x18b)),0x1;try{const _0x4f203e=_0x4cc6cb[_0x2b50f7(0x1e6)],_0x2d9047=await resolveSegmentTarget(_0x509e4c,_0x4f203e,_0x4cc6cb[_0x2b50f7(0x1fc)]);_0x4cc6cb[_0x2b50f7(0x1fc)]&&console[_0x2b50f7(0x1d9)](_0x2b50f7(0x1b9)+_0x2d9047);const _0xc8150e=await withSpinner(_0x2b50f7(0x16e)+_0x509e4c+_0x2b50f7(0x19e),()=>_0x4d0605[_0x2b50f7(0x18a)][_0x2b50f7(0x1a9)](_0x2d9047),{'verbose':_0x4cc6cb[_0x2b50f7(0x1fc)]}),_0x4eea1a=_0xc8150e[_0x2b50f7(0x170)];_0x4cc6cb[_0x2b50f7(0x1fc)]&&(console[_0x2b50f7(0x1d9)](_0x2b50f7(0x196)+_0x4eea1a[_0x2b50f7(0x183)]),console['error'](_0x2b50f7(0x16a)+_0x4eea1a[_0x2b50f7(0x1d4)]));if(_0x4eea1a[_0x2b50f7(0x183)]==='folder')return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x17c)),console[_0x2b50f7(0x1d9)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x4eea1a[_0x2b50f7(0x183)]==='parent')return console['error']('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x171)),0x1;if(!_0x4eea1a[_0x2b50f7(0x18d)])throw new SDKError(ErrorCode[_0x2b50f7(0x181)],_0x2b50f7(0x1f9));const _0x13bf3c=await withSpinner(_0x2b50f7(0x1bb),()=>_0x4d0605[_0x2b50f7(0x18a)][_0x2b50f7(0x1c0)](_0x4eea1a[_0x2b50f7(0x1d4)],_0x4eea1a[_0x2b50f7(0x18d)]),{'verbose':_0x4cc6cb[_0x2b50f7(0x1fc)]});let _0x500736=_0x13bf3c['data'];const _0x28a676=resolveLimit(_0x4cc6cb[_0x2b50f7(0x1a6)],DEFAULT_DISPLAY_LIMIT),_0x56a4a3=/\bLIMIT\s+\d+/i[_0x2b50f7(0x1e4)](_0x500736);!_0x56a4a3&&(_0x500736=_0x500736[_0x2b50f7(0x1b7)]()[_0x2b50f7(0x18c)](/;+$/,''),_0x500736=_0x2b50f7(0x1d6)+_0x500736+_0x2b50f7(0x175)+_0x28a676);_0x4cc6cb[_0x2b50f7(0x1fc)]&&console[_0x2b50f7(0x1d9)](_0x2b50f7(0x199)+_0x500736);const _0x269eb7=await withProgressSpinner(_0x2b50f7(0x1f5),async _0x488c54=>{const _0x4391d8=_0x2b50f7,_0x54013a=await _0x4d0605['query'][_0x4391d8(0x16b)](_0x500736,{'catalog':'td','schema':_0x4391d8(0x1e9),'onJobId':_0x440539=>{const _0x4b086c=_0x4391d8;_0x488c54[_0x4b086c(0x1fe)](_0x440539);}});return _0x54013a;},{'verbose':_0x4cc6cb['verbose']}),_0x4d64a6=_0x269eb7[_0x2b50f7(0x170)],_0x53e0ad=_0x4d64a6[_0x2b50f7(0x176)]?_0x2b50f7(0x17a)+_0x4d64a6[_0x2b50f7(0x176)]+']':'';return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x179)+_0x4d64a6[_0x2b50f7(0x1f2)]['processedRows']['toLocaleString']()+_0x2b50f7(0x1d8)+('in\x20'+formatElapsed(_0x4d64a6['stats'][_0x2b50f7(0x1f6)])+_0x53e0ad)),await handleQueryOutput(_0x4d64a6,_0x4cc6cb),0x0;}catch(_0x48714a){if(_0x48714a instanceof SDKError)return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x16f)+_0x48714a[_0x2b50f7(0x1a0)]+']'),console[_0x2b50f7(0x1d9)]('\x0a'+_0x48714a[_0x2b50f7(0x1cb)]),0x1;throw _0x48714a;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x195);[a35_0xb2e73(0x17b)]=a35_0xb2e73(0x1e0);async[a35_0xb2e73(0x16b)](_0x3395dc){const _0x475a7b=a35_0xb2e73,{options:_0xa40490,args:_0x1700c1,tdx:_0x113754}=_0x3395dc;if(_0x1700c1[_0x475a7b(0x1a7)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x475a7b(0x1ee)),0x1;const _0x32e19b=_0x1700c1[0x0];try{_0xa40490[_0x475a7b(0x1fc)]&&(console['error'](_0x475a7b(0x1ec)+_0xa40490[_0x475a7b(0x19d)]),console['error'](_0x475a7b(0x1e3)+_0x32e19b));const _0x2a30a4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x32e19b+'\x27...',()=>_0x113754[_0x475a7b(0x18a)]['resolveParentId'](_0x32e19b),{'verbose':_0xa40490[_0x475a7b(0x1fc)]}),_0x1c923d=_0x2a30a4[_0x475a7b(0x170)];_0xa40490[_0x475a7b(0x1fc)]&&console['error'](_0x475a7b(0x19b)+_0x1c923d);const _0x1ed629=await withSpinner(_0x475a7b(0x19a)+_0x32e19b+_0x475a7b(0x19e),()=>_0x113754['segment'][_0x475a7b(0x1ea)](_0x1c923d),{'verbose':_0xa40490[_0x475a7b(0x1fc)]}),_0x30d0c6=_0x1ed629[_0x475a7b(0x170)];return console[_0x475a7b(0x1d9)]('✔\x20Found\x20'+_0x30d0c6[_0x475a7b(0x1a7)]+_0x475a7b(0x1ad)+(_0x30d0c6[_0x475a7b(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x30d0c6,_0xa40490),0x0;}catch(_0x4a256a){if(_0x4a256a instanceof SDKError)return console['error'](_0x475a7b(0x1c9)+_0x4a256a[_0x475a7b(0x1cb)]),_0x4a256a[_0x475a7b(0x192)]&&console['error'](_0x475a7b(0x1f1)+_0x4a256a[_0x475a7b(0x192)]),0x1;throw _0x4a256a;}}}export class SegmentFolderShowCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x166);[a35_0xb2e73(0x17b)]=a35_0xb2e73(0x17e);async[a35_0xb2e73(0x16b)](_0x365d95){const _0x1eb486=a35_0xb2e73,{options:_0x5e511d,args:_0x312854,tdx:_0x38474c}=_0x365d95;if(_0x312854[_0x1eb486(0x1a7)]===0x0)return console[_0x1eb486(0x1d9)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x1eb486(0x1d9)](_0x1eb486(0x208)),0x1;try{const {parentId:_0x1b4c0e,childId:_0x156b2a}=parseSegmentRef(_0x312854[0x0]);_0x5e511d[_0x1eb486(0x1fc)]&&(console[_0x1eb486(0x1d9)](_0x1eb486(0x1ec)+_0x5e511d['site']),console['error']('Parent\x20name:\x20'+_0x1b4c0e),_0x156b2a&&console[_0x1eb486(0x1d9)](_0x1eb486(0x1c1)+_0x156b2a));if(!_0x156b2a)return console[_0x1eb486(0x1d9)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x336eb6=await withSpinner(_0x1eb486(0x1de)+_0x1b4c0e+_0x1eb486(0x19e),()=>_0x38474c[_0x1eb486(0x18a)][_0x1eb486(0x205)](_0x1b4c0e),{'verbose':_0x5e511d[_0x1eb486(0x1fc)]}),_0x52e8de=_0x336eb6[_0x1eb486(0x170)];_0x5e511d[_0x1eb486(0x1fc)]&&console[_0x1eb486(0x1d9)]('Resolved\x20parent\x20ID:\x20'+_0x52e8de);const _0x136be0=await withSpinner(_0x1eb486(0x1e5)+_0x156b2a+_0x1eb486(0x19e),()=>_0x38474c[_0x1eb486(0x18a)][_0x1eb486(0x1bd)](_0x52e8de,_0x156b2a),{'verbose':_0x5e511d[_0x1eb486(0x1fc)]}),_0x500c51=_0x136be0[_0x1eb486(0x170)];_0x5e511d['verbose']&&console['error'](_0x1eb486(0x184)+_0x500c51);const _0x25886e=await withSpinner(_0x1eb486(0x1be)+_0x156b2a+_0x1eb486(0x19e),()=>_0x38474c['segment'][_0x1eb486(0x1df)](_0x500c51),{'verbose':_0x5e511d[_0x1eb486(0x1fc)]});return await handleSDKOutput([_0x25886e['data']],_0x5e511d),0x0;}catch(_0x181892){if(_0x181892 instanceof SDKError)return console[_0x1eb486(0x1d9)]('Error:\x20'+_0x181892[_0x1eb486(0x1cb)]),_0x181892[_0x1eb486(0x192)]&&console[_0x1eb486(0x1d9)]('\x20\x20Cause:\x20'+_0x181892[_0x1eb486(0x192)]),0x1;throw _0x181892;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x19c);['description']=a35_0xb2e73(0x1e7);async[a35_0xb2e73(0x16b)](_0x20ade5){const _0x811220=a35_0xb2e73,{options:_0x3c251b,args:_0x4223af}=_0x20ade5,_0x1686fb=_0x3c251b,_0x504d3f=_0x1686fb['path'],_0xbfdf8b=_0x4223af[0x0];if(!_0xbfdf8b&&!_0x504d3f)return console[_0x811220(0x1d9)](a35_0xae67ad[_0x811220(0x1f0)](_0x811220(0x1b6))),console['error'](_0x811220(0x1b8)),console[_0x811220(0x1d9)](_0x811220(0x1cd)),console[_0x811220(0x1d9)](_0x811220(0x1c2)),console[_0x811220(0x1d9)](_0x811220(0x1c6)),console['error'](_0x811220(0x194)),console['error'](_0x811220(0x201)),0x1;if(_0xbfdf8b&&_0x504d3f)return console[_0x811220(0x1d9)](a35_0xae67ad[_0x811220(0x1f0)](_0x811220(0x1c7))),0x1;try{let _0x347acc;if(_0x504d3f)_0x347acc=await this[_0x811220(0x20b)](_0x504d3f,_0x20ade5);else{if(isYamlFilePath(_0xbfdf8b))return console[_0x811220(0x1d9)](a35_0xae67ad[_0x811220(0x1f0)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x811220(0x1d9)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0xbfdf8b),0x1;else _0x347acc=await this['getSQLFromServerSegment'](_0xbfdf8b,_0x20ade5);}return _0x3c251b[_0x811220(0x209)]===_0x811220(0x1ba)||_0x3c251b[_0x811220(0x209)]===_0x811220(0x1dd)?await handleSDKOutput([{'sql':_0x347acc}],_0x3c251b):console[_0x811220(0x180)](_0x347acc),0x0;}catch(_0x8c589d){if(_0x8c589d instanceof SDKError)return console[_0x811220(0x1d9)]('Error:\x20'+_0x8c589d[_0x811220(0x1cb)]),_0x8c589d[_0x811220(0x192)]&&console[_0x811220(0x1d9)](_0x811220(0x1f1)+_0x8c589d[_0x811220(0x192)]),0x1;throw _0x8c589d;}}async[a35_0xb2e73(0x20b)](_0x572699,_0x9e165b){const _0x10536a=a35_0xb2e73,{options:_0x32629d,tdx:_0x305163}=_0x9e165b;let _0x385548;try{_0x385548=await resolveYamlFilePath(_0x572699);}catch(_0x1c8adb){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x10536a(0x1dc)+_0x1c8adb[_0x10536a(0x1cb)]);}_0x32629d[_0x10536a(0x1fc)]&&console['error']('Resolved:\x20'+_0x385548[_0x10536a(0x1e6)]+'/'+_0x385548['segmentName']);const _0x3d690a=await withSpinner(_0x10536a(0x1ef),()=>_0x305163['segment'][_0x10536a(0x1b2)](_0x385548[_0x10536a(0x1c5)],_0x385548['parentSegment'],_0x385548[_0x10536a(0x207)]),{'verbose':_0x32629d[_0x10536a(0x1fc)]});return _0x3d690a[_0x10536a(0x170)];}async[a35_0xb2e73(0x165)](_0x4acecb,_0x10e17f){const _0xd9400a=a35_0xb2e73,{options:_0x15eeed,tdx:_0x9e23e2}=_0x10e17f,_0x1057a1=_0x15eeed[_0xd9400a(0x1e6)],_0x35ba4b=await resolveSegmentTarget(_0x4acecb,_0x1057a1,_0x15eeed[_0xd9400a(0x1fc)]);_0x15eeed['verbose']&&console[_0xd9400a(0x1d9)](_0xd9400a(0x1b9)+_0x35ba4b);const _0x21e6b6=await withSpinner(_0xd9400a(0x16e)+_0x4acecb+_0xd9400a(0x19e),()=>_0x9e23e2['segment'][_0xd9400a(0x1a9)](_0x35ba4b),{'verbose':_0x15eeed[_0xd9400a(0x1fc)]}),_0x58fc32=_0x21e6b6[_0xd9400a(0x170)];_0x15eeed['verbose']&&(console[_0xd9400a(0x1d9)](_0xd9400a(0x196)+_0x58fc32['type']),console['error'](_0xd9400a(0x16a)+_0x58fc32[_0xd9400a(0x1d4)]));if(_0x58fc32[_0xd9400a(0x183)]===_0xd9400a(0x197))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x58fc32[_0xd9400a(0x183)]===_0xd9400a(0x1f8))throw new SDKError(ErrorCode[_0xd9400a(0x174)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x58fc32[_0xd9400a(0x18d)])throw new SDKError(ErrorCode[_0xd9400a(0x181)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x421461=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x9e23e2['segment']['getSegmentSQL'](_0x58fc32[_0xd9400a(0x1d4)],_0x58fc32[_0xd9400a(0x18d)]),{'verbose':_0x15eeed['verbose']});return _0x421461[_0xd9400a(0x170)];}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a35_0xb2e73(0x1a8);[a35_0xb2e73(0x17b)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0xb2e73(0x16b)](_0x3f3882){const _0x56dad0=a35_0xb2e73,{options:_0x5abf42,args:_0x585eb3,tdx:_0x30222b}=_0x3f3882,_0x311c97=_0x5abf42;if(_0x585eb3[_0x56dad0(0x1a7)]<0x2)return console[_0x56dad0(0x1d9)](_0x56dad0(0x172)),console['error'](_0x56dad0(0x1ff)),0x1;const _0xfd98da=_0x585eb3[0x0],_0x58c385=_0x585eb3[0x1];_0x311c97[_0x56dad0(0x1fc)]&&(console[_0x56dad0(0x1d9)]('Site:\x20'+_0x311c97['site']),console[_0x56dad0(0x1d9)](_0x56dad0(0x1f7)+_0xfd98da),console[_0x56dad0(0x1d9)]('Folder\x20name:\x20'+_0x58c385));let _0x35b894;if(_0x311c97['parentFolder']){const _0x1bc8e0=_0x311c97['parentFolder'],_0x147cc5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xfd98da+_0x56dad0(0x19e),()=>_0x30222b['segment'][_0x56dad0(0x205)](_0xfd98da),{'verbose':_0x311c97[_0x56dad0(0x1fc)]}),_0x158f1d=_0x147cc5[_0x56dad0(0x170)],_0x2a8f7b=await withSpinner(_0x56dad0(0x177)+_0x1bc8e0+_0x56dad0(0x19e),()=>_0x30222b[_0x56dad0(0x18a)][_0x56dad0(0x1bd)](_0x158f1d,_0x1bc8e0),{'verbose':_0x311c97[_0x56dad0(0x1fc)]});_0x35b894=_0x2a8f7b[_0x56dad0(0x170)],_0x311c97[_0x56dad0(0x1fc)]&&console[_0x56dad0(0x1d9)](_0x56dad0(0x1d1)+_0x35b894);}const _0x2b6564={'name':_0x58c385,'description':_0x311c97['description'],'parentFolderId':_0x35b894},_0x29c1e9=await withSpinner(_0x56dad0(0x1db)+_0x58c385+_0x56dad0(0x19e),()=>_0x30222b[_0x56dad0(0x18a)]['createFolder'](_0xfd98da,_0x2b6564),{'verbose':_0x311c97[_0x56dad0(0x1fc)]}),_0x23399e=_0x29c1e9[_0x56dad0(0x170)];return console[_0x56dad0(0x1d9)](_0x56dad0(0x1cf)+_0x23399e[_0x56dad0(0x1d3)]+_0x56dad0(0x1a4)+_0x23399e['id']),await handleSDKOutput([_0x23399e],_0x311c97),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x1ed);[a35_0xb2e73(0x17b)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0xb2e73(0x16b)](_0x3738a5){const _0x373600=a35_0xb2e73,{options:_0x5b340a,args:_0x79ada2,tdx:_0x16b9a1}=_0x3738a5,_0x29d797=_0x79ada2[0x0];if(!_0x29d797)return console[_0x373600(0x1d9)](_0x373600(0x204)),console[_0x373600(0x1d9)](_0x373600(0x1d0)),console[_0x373600(0x1d9)](_0x373600(0x1eb)),console[_0x373600(0x1d9)](_0x373600(0x198)),console[_0x373600(0x1d9)](_0x373600(0x1b3)),console['error'](_0x373600(0x1c6)),console[_0x373600(0x1d9)](_0x373600(0x168)),console['error'](_0x373600(0x1ab)),console[_0x373600(0x1d9)](_0x373600(0x190)),console[_0x373600(0x1d9)](_0x373600(0x1fd)),0x1;try{const _0x1ce3f9=_0x5b340a[_0x373600(0x1e6)],_0x215f35=await resolveSegmentTarget(_0x29d797,_0x1ce3f9,_0x5b340a[_0x373600(0x1fc)]);_0x5b340a[_0x373600(0x1fc)]&&console[_0x373600(0x1d9)](_0x373600(0x1b9)+_0x215f35);const _0x568ad1=await withSpinner(_0x373600(0x16e)+_0x29d797+_0x373600(0x19e),()=>_0x16b9a1['segment'][_0x373600(0x1a9)](_0x215f35),{'verbose':_0x5b340a[_0x373600(0x1fc)]}),_0x5111b8=_0x568ad1[_0x373600(0x170)];_0x5b340a[_0x373600(0x1fc)]&&(console[_0x373600(0x1d9)]('Resolved\x20type:\x20'+_0x5111b8['type']),console['error'](_0x373600(0x16a)+_0x5111b8['parentId']),_0x5111b8[_0x373600(0x188)]&&console[_0x373600(0x1d9)](_0x373600(0x185)+_0x5111b8['folderId']),_0x5111b8[_0x373600(0x18d)]&&console[_0x373600(0x1d9)](_0x373600(0x189)+_0x5111b8['segmentId']));if(_0x5b340a['web']){if(_0x5111b8['type']===_0x373600(0x197))return console[_0x373600(0x1d9)](_0x373600(0x1b4)),0x1;if(_0x5111b8[_0x373600(0x183)]===_0x373600(0x1f8))return console['error'](_0x373600(0x16c)),console[_0x373600(0x1d9)](_0x373600(0x1b0)),0x1;if(!_0x5111b8['segmentId'])throw new SDKError(ErrorCode[_0x373600(0x181)],_0x373600(0x1f9));const _0x2deddd=getConsoleNextUrl(_0x5b340a['site'],'/app/ps/'+_0x5111b8[_0x373600(0x1d4)]+_0x373600(0x200)+_0x5111b8['segmentId']);return console['error'](a35_0xae67ad['green']('✔')+_0x373600(0x1f3)+a35_0xae67ad['cyan'](_0x2deddd)),openBrowser(_0x2deddd),0x0;}if(_0x5111b8[_0x373600(0x183)]==='folder'){if(!_0x5111b8[_0x373600(0x188)])throw new SDKError(ErrorCode[_0x373600(0x1c4)],_0x373600(0x1d7));const _0x5159ee=await withSpinner('Fetching\x20folder\x20details...',()=>_0x16b9a1[_0x373600(0x18a)][_0x373600(0x1df)](_0x5111b8[_0x373600(0x188)]),{'verbose':_0x5b340a['verbose']});await handleSingleObjectOutput(_0x5159ee[_0x373600(0x170)],_0x5b340a);}else{if(_0x5111b8[_0x373600(0x183)]==='segment'){if(!_0x5111b8[_0x373600(0x18d)])throw new SDKError(ErrorCode[_0x373600(0x181)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xd3bc44=await withSpinner('Fetching\x20segment\x20details...',()=>_0x16b9a1[_0x373600(0x18a)][_0x373600(0x1af)](_0x5111b8[_0x373600(0x1d4)],_0x5111b8[_0x373600(0x18d)]),{'verbose':_0x5b340a[_0x373600(0x1fc)]}),_0xdd5e19=getConsoleNextUrl(_0x5b340a[_0x373600(0x19d)],_0x373600(0x206)+_0x5111b8['parentId']+_0x373600(0x200)+_0x5111b8[_0x373600(0x18d)]),_0x1dbe9a=_0xd3bc44['data'];_0x1dbe9a[_0x373600(0x173)]=_0xdd5e19,await handleSingleObjectOutput(_0x1dbe9a,_0x5b340a);}else return console[_0x373600(0x1d9)](_0x373600(0x20c)),console[_0x373600(0x1d9)](_0x373600(0x1a1)),0x1;}return 0x0;}catch(_0x3cd488){if(_0x3cd488 instanceof SDKError)return console[_0x373600(0x1d9)]('Error:\x20'+_0x3cd488[_0x373600(0x1cb)]),_0x3cd488[_0x373600(0x192)]&&console[_0x373600(0x1d9)](_0x373600(0x1f1)+_0x3cd488['cause']),0x1;throw _0x3cd488;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x1ae);[a35_0xb2e73(0x17b)]=a35_0xb2e73(0x1d2);async[a35_0xb2e73(0x16b)](_0x59fe8a){const _0x34af9a=a35_0xb2e73,{options:_0x2b816d,args:_0x3d40dc,tdx:_0x2d2709}=_0x59fe8a,_0x2d977=_0x3d40dc[0x0];if(!_0x2d977)return console[_0x34af9a(0x1d9)](_0x34af9a(0x186)),console[_0x34af9a(0x1d9)](_0x34af9a(0x1b5)),console['error'](_0x34af9a(0x1c8)),console[_0x34af9a(0x1d9)]('Examples:'),console[_0x34af9a(0x1d9)](_0x34af9a(0x1bc)),console[_0x34af9a(0x1d9)](_0x34af9a(0x191)),0x1;try{const _0x486c77=_0x2b816d[_0x34af9a(0x1e6)],_0x4311b6=await resolveSegmentTarget(_0x2d977,_0x486c77,_0x2b816d[_0x34af9a(0x1fc)]);_0x2b816d[_0x34af9a(0x1fc)]&&console['error'](_0x34af9a(0x1b9)+_0x4311b6);const _0xe7bc72=await withSpinner(_0x34af9a(0x16e)+_0x2d977+_0x34af9a(0x19e),()=>_0x2d2709[_0x34af9a(0x18a)][_0x34af9a(0x1a9)](_0x4311b6),{'verbose':_0x2b816d['verbose']}),_0x434d52=_0xe7bc72[_0x34af9a(0x170)];_0x2b816d[_0x34af9a(0x1fc)]&&(console[_0x34af9a(0x1d9)](_0x34af9a(0x196)+_0x434d52[_0x34af9a(0x183)]),console[_0x34af9a(0x1d9)]('Parent\x20ID:\x20'+_0x434d52[_0x34af9a(0x1d4)]));if(_0x434d52[_0x34af9a(0x183)]===_0x34af9a(0x197))return console[_0x34af9a(0x1d9)](_0x34af9a(0x17f)),console[_0x34af9a(0x1d9)](_0x34af9a(0x1bf)),0x1;if(_0x434d52['type']==='parent')return console[_0x34af9a(0x1d9)](_0x34af9a(0x1ce)),console['error'](_0x34af9a(0x19f)),0x1;if(!_0x434d52['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x34af9a(0x1f9));const _0x4bfe41=await withSpinner(_0x34af9a(0x1bb),()=>_0x2d2709[_0x34af9a(0x18a)]['getSegmentSQL'](_0x434d52[_0x34af9a(0x1d4)],_0x434d52['segmentId']),{'verbose':_0x2b816d[_0x34af9a(0x1fc)]}),_0x3f0a01=_0x4bfe41[_0x34af9a(0x170)],_0x2338af=await executeSchemaQuery(_0x3f0a01,_0x2d2709,_0x2b816d);return await handleQueryOutput(_0x2338af,_0x2b816d),0x0;}catch(_0x1e70b3){if(_0x1e70b3 instanceof SDKError)return console[_0x34af9a(0x1d9)](_0x34af9a(0x1c9)+_0x1e70b3[_0x34af9a(0x1cb)]),_0x1e70b3[_0x34af9a(0x192)]&&console[_0x34af9a(0x1d9)](_0x34af9a(0x1f1)+_0x1e70b3['cause']),0x1;throw _0x1e70b3;}}}
|
|
1
|
+
const a35_0xcd4784=a35_0x23e7;(function(_0x1ed834,_0x14137d){const _0x2f8f92=a35_0x23e7,_0xbef112=_0x1ed834();while(!![]){try{const _0x1ffa67=-parseInt(_0x2f8f92(0x27f))/0x1+parseInt(_0x2f8f92(0x209))/0x2*(-parseInt(_0x2f8f92(0x264))/0x3)+-parseInt(_0x2f8f92(0x228))/0x4*(parseInt(_0x2f8f92(0x26d))/0x5)+-parseInt(_0x2f8f92(0x1ff))/0x6+parseInt(_0x2f8f92(0x1eb))/0x7*(-parseInt(_0x2f8f92(0x272))/0x8)+parseInt(_0x2f8f92(0x21f))/0x9+parseInt(_0x2f8f92(0x219))/0xa;if(_0x1ffa67===_0x14137d)break;else _0xbef112['push'](_0xbef112['shift']());}catch(_0x522ba7){_0xbef112['push'](_0xbef112['shift']());}}}(a35_0xbb56,0xbf60a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a35_0x23e7(_0x4632fc,_0x1e7f41){_0x4632fc=_0x4632fc-0x1da;const _0xbb5671=a35_0xbb56();let _0x23e7ab=_0xbb5671[_0x4632fc];return _0x23e7ab;}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_0xbb56(){const _0x5dc2d1=['Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','log','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','segment:folder:list','segment','Resolved\x20YAML\x20file:\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','json','996737mFYmUA','folder','Segment\x20ID:\x20','resolvePathToResource','Use:\x20tdx\x20ps\x20desc','toLocaleString','Fetching\x20SQL\x20for\x20segment...','getSQLFromServerSegment','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','length','content','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','red','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','limit','Error:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','6674070WyJYoJ','Use:\x20tdx\x20ps\x20show','Fetching\x20folder\x20details...','Fetching\x20segment\x20details...','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','segmentPath','parentId','Resolved\x20folder\x20ID:\x20','\x20\x20Cause:\x20','path','190qEQVjr','data','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','SQL\x20query:\x0a','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','listFolders','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20ID:\x20','green','parent','Use:\x20tdx\x20ps\x20view','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getSQLFromYamlFile','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','42308000kKrxry','✖\x20Query\x20failed\x20[','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','web','getSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','13776624mWudSx','cause','verbose','segment:view','segment:show','getSegmentSQLFromYaml','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','jsonl','site','5457044YGbUSI','in\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Folder\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20parent\x20segment\x20details...','folderId','Examples:','Site:\x20','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','✔\x20Query\x20completed:\x20Processed\x20','\x20rows\x20','Folder\x20name:\x20','/e/','processedRows','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20from\x20rule...','segmentName','createFolder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','execute','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','jobId','Resolving\x20\x27','\x27...','Creating\x20folder\x20\x27','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Segment\x20ID\x20missing\x20from\x20resolved\x20path','message','Executing\x20segment\x20query...','segment:sql','getParent','resolveParentId','resolveFolderId','Target\x20path:\x20','(root)','\x20\x20Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:describe','parentSegment','segment:folder:create','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','/app/ps/','parentFolder','fullPath','information_schema','\x20\x20tdx\x20sg\x20sql\x20--path\x20','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','stats','query','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','25143NxvuUv','folderPath','Fetching\x20folder\x20\x27','\x20folder','SEGMENT_NOT_FOUND','INVALID_ARGUMENT','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x27\x20with\x20ID:\x20','Usage:','5zViHgE','Parent\x20name:\x20','Resolving\x20path\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Created\x20folder\x20\x27','40pqxRsN','description','trim','Resolved\x20parent\x20folder\x20ID:\x20','segmentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','name','Resolved\x20type:\x20','code','Options:','setJobId','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20Parent\x20segment:\x20','992898VCwgOz','error','segment:folder:show','\x20\x20Segment\x20name:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20[Job\x20ID:\x20','format','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view\x20-w','Resolved:\x20','Resolving\x20parent\x20folder\x20\x27'];a35_0xbb56=function(){return _0x5dc2d1;};return a35_0xbb56();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x46420a from'chalk';async function resolveSegmentTarget(_0x11ead4,_0x4b4479,_0x1dde3a){const _0x4a32da=a35_0x23e7;if(isYamlFilePath(_0x11ead4))try{const _0x5b47d8=await resolveYamlFilePath(_0x11ead4);return _0x1dde3a&&(console[_0x4a32da(0x280)](_0x4a32da(0x1e8)+_0x11ead4),console['error'](_0x4a32da(0x27e)+_0x5b47d8[_0x4a32da(0x254)]),console[_0x4a32da(0x280)](_0x4a32da(0x1da)+_0x5b47d8[_0x4a32da(0x23c)]),console[_0x4a32da(0x280)](_0x4a32da(0x251)+(_0x5b47d8[_0x4a32da(0x265)]||_0x4a32da(0x250))),console[_0x4a32da(0x280)](_0x4a32da(0x25e)+_0x5b47d8['fullPath'])),_0x5b47d8[_0x4a32da(0x25b)];}catch(_0x385a7d){throw new SDKError(ErrorCode[_0x4a32da(0x269)],_0x4a32da(0x218)+_0x385a7d['message']);}if(!_0x4b4479)throw new SDKError(ErrorCode[_0x4a32da(0x269)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4b4479+'/'+_0x11ead4;}export class SegmentDescribeCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x253);[a35_0xcd4784(0x273)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0xcd4784(0x23f)](_0x35addb){const _0x16ac65=a35_0xcd4784,{options:_0x33f47c,args:_0x405506,tdx:_0x12bd05}=_0x35addb,_0x184314=_0x405506[0x0],_0x26caed=!_0x184314&&!!_0x33f47c[_0x16ac65(0x254)],_0x338f47=_0x184314||_0x33f47c[_0x16ac65(0x254)];if(!_0x338f47)return console[_0x16ac65(0x280)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x16ac65(0x280)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x16ac65(0x280)](_0x16ac65(0x22f)),console[_0x16ac65(0x280)](_0x16ac65(0x240)),console['error'](_0x16ac65(0x234)),console[_0x16ac65(0x280)](_0x16ac65(0x1f3)),console[_0x16ac65(0x280)](_0x16ac65(0x225)),0x1;try{const _0x415d85=_0x33f47c[_0x16ac65(0x204)];let _0x4d6a9b=_0x338f47;!_0x26caed&&_0x415d85&&!_0x338f47['includes']('/')&&(_0x4d6a9b=_0x415d85+'/'+_0x338f47,_0x33f47c[_0x16ac65(0x221)]&&console[_0x16ac65(0x280)](_0x16ac65(0x257)+_0x4d6a9b));const _0x3dba7e=await withSpinner(_0x16ac65(0x26f)+_0x4d6a9b+_0x16ac65(0x243),()=>_0x12bd05['segment']['resolvePathToResource'](_0x4d6a9b),{'verbose':_0x33f47c['verbose']}),_0xd894e0=_0x3dba7e[_0x16ac65(0x20a)];_0x33f47c['verbose']&&(console[_0x16ac65(0x280)](_0x16ac65(0x279)+_0xd894e0[_0x16ac65(0x233)]),console[_0x16ac65(0x280)]('Parent\x20ID:\x20'+_0xd894e0[_0x16ac65(0x205)]),_0xd894e0[_0x16ac65(0x22e)]&&console[_0x16ac65(0x280)](_0x16ac65(0x22b)+_0xd894e0[_0x16ac65(0x22e)]),_0xd894e0[_0x16ac65(0x276)]&&console[_0x16ac65(0x280)](_0x16ac65(0x1ed)+_0xd894e0['segmentId']));if(_0xd894e0[_0x16ac65(0x233)]===_0x16ac65(0x214)){const _0x3398c1=await withSpinner(_0x16ac65(0x22d),()=>_0x12bd05[_0x16ac65(0x1e7)][_0x16ac65(0x24c)](_0xd894e0[_0x16ac65(0x205)]),{'verbose':_0x33f47c['verbose']});await handleSingleObjectOutput(_0x3398c1[_0x16ac65(0x20a)],_0x33f47c);}else{if(_0xd894e0[_0x16ac65(0x233)]===_0x16ac65(0x1ec)){if(!_0xd894e0[_0x16ac65(0x22e)])throw new SDKError(ErrorCode[_0x16ac65(0x1fb)],_0x16ac65(0x1f7));const _0x201fad=await withSpinner('Fetching\x20folder\x20details...',()=>_0x12bd05[_0x16ac65(0x1e7)]['getFolder'](_0xd894e0[_0x16ac65(0x22e)]),{'verbose':_0x33f47c[_0x16ac65(0x221)]});await handleSingleObjectOutput(_0x201fad[_0x16ac65(0x20a)],_0x33f47c);}else{if(_0xd894e0['type']===_0x16ac65(0x1e7)){if(!_0xd894e0['segmentId'])throw new SDKError(ErrorCode[_0x16ac65(0x268)],_0x16ac65(0x248));const _0x38d2ba=await withSpinner(_0x16ac65(0x202),()=>_0x12bd05[_0x16ac65(0x1e7)][_0x16ac65(0x21d)](_0xd894e0[_0x16ac65(0x205)],_0xd894e0[_0x16ac65(0x276)]),{'verbose':_0x33f47c[_0x16ac65(0x221)]});await handleSingleObjectOutput(_0x38d2ba[_0x16ac65(0x20a)],_0x33f47c);}}}return 0x0;}catch(_0x642490){if(_0x642490 instanceof SDKError)return console[_0x16ac65(0x280)](_0x16ac65(0x1fd)+_0x642490[_0x16ac65(0x249)]),_0x642490[_0x16ac65(0x220)]&&console['error'](_0x16ac65(0x207)+_0x642490[_0x16ac65(0x220)]),0x1;throw _0x642490;}}}export class SegmentShowCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x223);[a35_0xcd4784(0x273)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a35_0xcd4784(0x23f)](_0x4d940c){const _0xf5c438=a35_0xcd4784,{options:_0x4f8651,args:_0x551f9c,tdx:_0xbb435e}=_0x4d940c,_0x124a19=_0x551f9c[0x0];if(!_0x124a19)return console[_0xf5c438(0x280)](_0xf5c438(0x1db)),console[_0xf5c438(0x280)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0xf5c438(0x280)](_0xf5c438(0x252)),console[_0xf5c438(0x280)](_0xf5c438(0x22f)),console[_0xf5c438(0x280)](_0xf5c438(0x21e)),console['error'](_0xf5c438(0x247)),0x1;try{const _0x2c012a=_0x4f8651['parentSegment'],_0x53faf9=await resolveSegmentTarget(_0x124a19,_0x2c012a,_0x4f8651['verbose']);_0x4f8651[_0xf5c438(0x221)]&&console[_0xf5c438(0x280)](_0xf5c438(0x24f)+_0x53faf9);const _0x15ad44=await withSpinner(_0xf5c438(0x242)+_0x124a19+_0xf5c438(0x243),()=>_0xbb435e['segment'][_0xf5c438(0x1ee)](_0x53faf9),{'verbose':_0x4f8651[_0xf5c438(0x221)]}),_0x2bc697=_0x15ad44[_0xf5c438(0x20a)];_0x4f8651[_0xf5c438(0x221)]&&(console[_0xf5c438(0x280)]('Resolved\x20type:\x20'+_0x2bc697[_0xf5c438(0x233)]),console[_0xf5c438(0x280)](_0xf5c438(0x212)+_0x2bc697['parentId']));if(_0x2bc697[_0xf5c438(0x233)]===_0xf5c438(0x1ec))return console[_0xf5c438(0x280)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0xf5c438(0x280)](_0xf5c438(0x20f)),0x1;if(_0x2bc697[_0xf5c438(0x233)]===_0xf5c438(0x214))return console['error'](_0xf5c438(0x1e3)),console[_0xf5c438(0x280)](_0xf5c438(0x200)),0x1;if(!_0x2bc697[_0xf5c438(0x276)])throw new SDKError(ErrorCode[_0xf5c438(0x268)],_0xf5c438(0x248));const _0x276cdb=await withSpinner(_0xf5c438(0x1f1),()=>_0xbb435e['segment']['getSegmentSQL'](_0x2bc697[_0xf5c438(0x205)],_0x2bc697[_0xf5c438(0x276)]),{'verbose':_0x4f8651[_0xf5c438(0x221)]});let _0xb5b519=_0x276cdb['data'];const _0x22d0ce=resolveLimit(_0x4f8651[_0xf5c438(0x1fc)],DEFAULT_DISPLAY_LIMIT),_0x4c35d9=/\bLIMIT\s+\d+/i['test'](_0xb5b519);!_0x4c35d9&&(_0xb5b519=_0xb5b519[_0xf5c438(0x274)]()['replace'](/;+$/,''),_0xb5b519=_0xf5c438(0x231)+_0xb5b519+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x22d0ce);_0x4f8651['verbose']&&console[_0xf5c438(0x280)](_0xf5c438(0x20c)+_0xb5b519);const _0x2637ef=await withProgressSpinner(_0xf5c438(0x24a),async _0x44a2fd=>{const _0x4bfa29=_0xf5c438,_0x5bb04d=await _0xbb435e[_0x4bfa29(0x261)][_0x4bfa29(0x23f)](_0xb5b519,{'catalog':'td','schema':_0x4bfa29(0x25c),'onJobId':_0x337e7c=>{const _0x5bfbc3=_0x4bfa29;_0x44a2fd[_0x5bfbc3(0x27c)](_0x337e7c);}});return _0x5bb04d;},{'verbose':_0x4f8651[_0xf5c438(0x221)]}),_0x42af68=_0x2637ef[_0xf5c438(0x20a)],_0x3c4065=_0x42af68[_0xf5c438(0x241)]?_0xf5c438(0x1dc)+_0x42af68[_0xf5c438(0x241)]+']':'';return console['error'](_0xf5c438(0x235)+_0x42af68[_0xf5c438(0x260)][_0xf5c438(0x239)][_0xf5c438(0x1f0)]()+_0xf5c438(0x236)+(_0xf5c438(0x229)+formatElapsed(_0x42af68[_0xf5c438(0x260)]['elapsedTimeMillis'])+_0x3c4065)),await handleQueryOutput(_0x42af68,_0x4f8651),0x0;}catch(_0x3dfdaa){if(_0x3dfdaa instanceof SDKError)return console[_0xf5c438(0x280)](_0xf5c438(0x21a)+_0x3dfdaa[_0xf5c438(0x27a)]+']'),console[_0xf5c438(0x280)]('\x0a'+_0x3dfdaa[_0xf5c438(0x249)]),0x1;throw _0x3dfdaa;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x1e6);[a35_0xcd4784(0x273)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x2a986c){const _0x4e8f8d=a35_0xcd4784,{options:_0x5a62f8,args:_0x30806e,tdx:_0x4491f6}=_0x2a986c;if(_0x30806e['length']===0x0)return console[_0x4e8f8d(0x280)](_0x4e8f8d(0x270)),console[_0x4e8f8d(0x280)](_0x4e8f8d(0x20b)),0x1;const _0xdbbfe6=_0x30806e[0x0];try{_0x5a62f8[_0x4e8f8d(0x221)]&&(console['error'](_0x4e8f8d(0x230)+_0x5a62f8['site']),console[_0x4e8f8d(0x280)](_0x4e8f8d(0x26e)+_0xdbbfe6));const _0x3ee60b=await withSpinner(_0x4e8f8d(0x262)+_0xdbbfe6+'\x27...',()=>_0x4491f6['segment'][_0x4e8f8d(0x24d)](_0xdbbfe6),{'verbose':_0x5a62f8[_0x4e8f8d(0x221)]}),_0x280325=_0x3ee60b['data'];_0x5a62f8[_0x4e8f8d(0x221)]&&console[_0x4e8f8d(0x280)](_0x4e8f8d(0x1f8)+_0x280325);const _0x2df397=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0xdbbfe6+_0x4e8f8d(0x243),()=>_0x4491f6[_0x4e8f8d(0x1e7)][_0x4e8f8d(0x20e)](_0x280325),{'verbose':_0x5a62f8[_0x4e8f8d(0x221)]}),_0x231237=_0x2df397['data'];return console[_0x4e8f8d(0x280)]('✔\x20Found\x20'+_0x231237['length']+_0x4e8f8d(0x267)+(_0x231237[_0x4e8f8d(0x1f4)]!==0x1?'s':'')),await handleSDKOutput(_0x231237,_0x5a62f8),0x0;}catch(_0x4d5b9c){if(_0x4d5b9c instanceof SDKError)return console[_0x4e8f8d(0x280)]('Error:\x20'+_0x4d5b9c[_0x4e8f8d(0x249)]),_0x4d5b9c[_0x4e8f8d(0x220)]&&console[_0x4e8f8d(0x280)]('\x20\x20Cause:\x20'+_0x4d5b9c[_0x4e8f8d(0x220)]),0x1;throw _0x4d5b9c;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0xcd4784(0x281);[a35_0xcd4784(0x273)]='Show\x20segment\x20folder\x20details';async[a35_0xcd4784(0x23f)](_0x4798d7){const _0x3b6477=a35_0xcd4784,{options:_0x223a13,args:_0x36d9d9,tdx:_0x421944}=_0x4798d7;if(_0x36d9d9[_0x3b6477(0x1f4)]===0x0)return console[_0x3b6477(0x280)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x3b6477(0x280)](_0x3b6477(0x22a)),0x1;try{const {parentId:_0x164906,childId:_0xdac675}=parseSegmentRef(_0x36d9d9[0x0]);_0x223a13['verbose']&&(console['error'](_0x3b6477(0x230)+_0x223a13[_0x3b6477(0x227)]),console[_0x3b6477(0x280)](_0x3b6477(0x26e)+_0x164906),_0xdac675&&console[_0x3b6477(0x280)]('Folder\x20name:\x20'+_0xdac675));if(!_0xdac675)return console[_0x3b6477(0x280)](_0x3b6477(0x21b)),0x1;const _0x4ef387=await withSpinner(_0x3b6477(0x262)+_0x164906+_0x3b6477(0x243),()=>_0x421944['segment'][_0x3b6477(0x24d)](_0x164906),{'verbose':_0x223a13['verbose']}),_0x959b6b=_0x4ef387[_0x3b6477(0x20a)];_0x223a13['verbose']&&console[_0x3b6477(0x280)](_0x3b6477(0x1f8)+_0x959b6b);const _0x3a350e=await withSpinner('Resolving\x20folder\x20\x27'+_0xdac675+_0x3b6477(0x243),()=>_0x421944[_0x3b6477(0x1e7)]['resolveFolderId'](_0x959b6b,_0xdac675),{'verbose':_0x223a13['verbose']}),_0x327dca=_0x3a350e[_0x3b6477(0x20a)];_0x223a13['verbose']&&console[_0x3b6477(0x280)](_0x3b6477(0x206)+_0x327dca);const _0xcdce65=await withSpinner(_0x3b6477(0x266)+_0xdac675+'\x27...',()=>_0x421944[_0x3b6477(0x1e7)]['getFolder'](_0x327dca),{'verbose':_0x223a13[_0x3b6477(0x221)]});return await handleSDKOutput([_0xcdce65[_0x3b6477(0x20a)]],_0x223a13),0x0;}catch(_0xc97d05){if(_0xc97d05 instanceof SDKError)return console[_0x3b6477(0x280)]('Error:\x20'+_0xc97d05[_0x3b6477(0x249)]),_0xc97d05['cause']&&console[_0x3b6477(0x280)]('\x20\x20Cause:\x20'+_0xc97d05[_0x3b6477(0x220)]),0x1;throw _0xc97d05;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x24b);['description']=a35_0xcd4784(0x210);async[a35_0xcd4784(0x23f)](_0x52587a){const _0xe8dda8=a35_0xcd4784,{options:_0x41a95c,args:_0x41f5bf}=_0x52587a,_0x20cf25=_0x41a95c,_0x2520c8=_0x20cf25[_0xe8dda8(0x208)],_0x2de303=_0x41f5bf[0x0];if(!_0x2de303&&!_0x2520c8)return console[_0xe8dda8(0x280)](a35_0x46420a[_0xe8dda8(0x1f9)](_0xe8dda8(0x258))),console[_0xe8dda8(0x280)](_0xe8dda8(0x26c)),console[_0xe8dda8(0x280)](_0xe8dda8(0x211)),console[_0xe8dda8(0x280)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0xe8dda8(0x280)](_0xe8dda8(0x22f)),console['error'](_0xe8dda8(0x1fa)),console[_0xe8dda8(0x280)](_0xe8dda8(0x23a)),0x1;if(_0x2de303&&_0x2520c8)return console[_0xe8dda8(0x280)](a35_0x46420a['red'](_0xe8dda8(0x20d))),0x1;try{let _0x2e9a35;if(_0x2520c8)_0x2e9a35=await this[_0xe8dda8(0x217)](_0x2520c8,_0x52587a);else{if(isYamlFilePath(_0x2de303))return console[_0xe8dda8(0x280)](a35_0x46420a[_0xe8dda8(0x1f9)](_0xe8dda8(0x232))),console[_0xe8dda8(0x280)](_0xe8dda8(0x25d)+_0x2de303),0x1;else _0x2e9a35=await this[_0xe8dda8(0x1f2)](_0x2de303,_0x52587a);}return _0x41a95c[_0xe8dda8(0x1dd)]===_0xe8dda8(0x1ea)||_0x41a95c[_0xe8dda8(0x1dd)]===_0xe8dda8(0x226)?await handleSDKOutput([{'sql':_0x2e9a35}],_0x41a95c):console[_0xe8dda8(0x1e4)](_0x2e9a35),0x0;}catch(_0x130fbd){if(_0x130fbd instanceof SDKError)return console[_0xe8dda8(0x280)](_0xe8dda8(0x1fd)+_0x130fbd[_0xe8dda8(0x249)]),_0x130fbd['cause']&&console['error'](_0xe8dda8(0x207)+_0x130fbd['cause']),0x1;throw _0x130fbd;}}async[a35_0xcd4784(0x217)](_0x1451d8,_0x3a8c5c){const _0x3afb8c=a35_0xcd4784,{options:_0x2bafc8,tdx:_0xc24019}=_0x3a8c5c;let _0x32cd74;try{_0x32cd74=await resolveYamlFilePath(_0x1451d8);}catch(_0x4a0ad5){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3afb8c(0x218)+_0x4a0ad5['message']);}_0x2bafc8[_0x3afb8c(0x221)]&&console['error'](_0x3afb8c(0x1e1)+_0x32cd74[_0x3afb8c(0x254)]+'/'+_0x32cd74[_0x3afb8c(0x23c)]);const _0x1af17b=await withSpinner(_0x3afb8c(0x23b),()=>_0xc24019[_0x3afb8c(0x1e7)][_0x3afb8c(0x224)](_0x32cd74[_0x3afb8c(0x1f5)],_0x32cd74['parentSegment'],_0x32cd74[_0x3afb8c(0x23c)]),{'verbose':_0x2bafc8[_0x3afb8c(0x221)]});return _0x1af17b[_0x3afb8c(0x20a)];}async[a35_0xcd4784(0x1f2)](_0x3b2f04,_0x537c53){const _0x125ea0=a35_0xcd4784,{options:_0x2b6c26,tdx:_0x53876b}=_0x537c53,_0x194a74=_0x2b6c26[_0x125ea0(0x254)],_0x5d3f45=await resolveSegmentTarget(_0x3b2f04,_0x194a74,_0x2b6c26[_0x125ea0(0x221)]);_0x2b6c26[_0x125ea0(0x221)]&&console[_0x125ea0(0x280)](_0x125ea0(0x24f)+_0x5d3f45);const _0x467daf=await withSpinner('Resolving\x20\x27'+_0x3b2f04+_0x125ea0(0x243),()=>_0x53876b[_0x125ea0(0x1e7)][_0x125ea0(0x1ee)](_0x5d3f45),{'verbose':_0x2b6c26[_0x125ea0(0x221)]}),_0x36ddc9=_0x467daf[_0x125ea0(0x20a)];_0x2b6c26[_0x125ea0(0x221)]&&(console['error'](_0x125ea0(0x279)+_0x36ddc9[_0x125ea0(0x233)]),console['error'](_0x125ea0(0x212)+_0x36ddc9[_0x125ea0(0x205)]));if(_0x36ddc9[_0x125ea0(0x233)]==='folder')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x125ea0(0x1e9));if(_0x36ddc9[_0x125ea0(0x233)]==='parent')throw new SDKError(ErrorCode[_0x125ea0(0x269)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x36ddc9[_0x125ea0(0x276)])throw new SDKError(ErrorCode[_0x125ea0(0x268)],_0x125ea0(0x248));const _0x2dd59c=await withSpinner(_0x125ea0(0x1f1),()=>_0x53876b[_0x125ea0(0x1e7)]['getSegmentSQL'](_0x36ddc9[_0x125ea0(0x205)],_0x36ddc9['segmentId']),{'verbose':_0x2b6c26[_0x125ea0(0x221)]});return _0x2dd59c[_0x125ea0(0x20a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x255);[a35_0xcd4784(0x273)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0xcd4784(0x23f)](_0x1ca0ca){const _0x2d11f7=a35_0xcd4784,{options:_0x10eaf7,args:_0x5f424c,tdx:_0x199bd8}=_0x1ca0ca,_0x40d2b2=_0x10eaf7;if(_0x5f424c[_0x2d11f7(0x1f4)]<0x2)return console['error'](_0x2d11f7(0x22c)),console[_0x2d11f7(0x280)](_0x2d11f7(0x256)),0x1;const _0x479cbf=_0x5f424c[0x0],_0x4afa34=_0x5f424c[0x1];_0x40d2b2['verbose']&&(console[_0x2d11f7(0x280)](_0x2d11f7(0x230)+_0x40d2b2[_0x2d11f7(0x227)]),console[_0x2d11f7(0x280)]('Parent\x20segment:\x20'+_0x479cbf),console[_0x2d11f7(0x280)](_0x2d11f7(0x237)+_0x4afa34));let _0x59d0b8;if(_0x40d2b2[_0x2d11f7(0x25a)]){const _0x3d5ead=_0x40d2b2[_0x2d11f7(0x25a)],_0x375ad3=await withSpinner(_0x2d11f7(0x262)+_0x479cbf+'\x27...',()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x24d)](_0x479cbf),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]}),_0x50df42=_0x375ad3[_0x2d11f7(0x20a)],_0x448603=await withSpinner(_0x2d11f7(0x1e2)+_0x3d5ead+_0x2d11f7(0x243),()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x24e)](_0x50df42,_0x3d5ead),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]});_0x59d0b8=_0x448603[_0x2d11f7(0x20a)],_0x40d2b2[_0x2d11f7(0x221)]&&console[_0x2d11f7(0x280)](_0x2d11f7(0x275)+_0x59d0b8);}const _0x1a376e={'name':_0x4afa34,'description':_0x40d2b2[_0x2d11f7(0x273)],'parentFolderId':_0x59d0b8},_0x36705c=await withSpinner(_0x2d11f7(0x244)+_0x4afa34+_0x2d11f7(0x243),()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x23d)](_0x479cbf,_0x1a376e),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]}),_0x19d915=_0x36705c[_0x2d11f7(0x20a)];return console[_0x2d11f7(0x280)](_0x2d11f7(0x271)+_0x19d915[_0x2d11f7(0x278)]+_0x2d11f7(0x26b)+_0x19d915['id']),await handleSDKOutput([_0x19d915],_0x40d2b2),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x222);[a35_0xcd4784(0x273)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0xcd4784(0x23f)](_0x5d4fb9){const _0x4e6826=a35_0xcd4784,{options:_0x5c13aa,args:_0x174e32,tdx:_0x2bb082}=_0x5d4fb9,_0x954132=_0x174e32[0x0];if(!_0x954132)return console[_0x4e6826(0x280)](_0x4e6826(0x1f6)),console[_0x4e6826(0x280)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x4e6826(0x280)](_0x4e6826(0x246)),console['error'](_0x4e6826(0x27b)),console['error'](_0x4e6826(0x1fe)),console['error'](_0x4e6826(0x22f)),console[_0x4e6826(0x280)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4e6826(0x280)](_0x4e6826(0x25f)),console['error'](_0x4e6826(0x23e)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xe5e62d=_0x5c13aa[_0x4e6826(0x254)],_0x4d7dfe=await resolveSegmentTarget(_0x954132,_0xe5e62d,_0x5c13aa[_0x4e6826(0x221)]);_0x5c13aa[_0x4e6826(0x221)]&&console[_0x4e6826(0x280)]('Target\x20path:\x20'+_0x4d7dfe);const _0x57d320=await withSpinner('Resolving\x20\x27'+_0x954132+_0x4e6826(0x243),()=>_0x2bb082[_0x4e6826(0x1e7)]['resolvePathToResource'](_0x4d7dfe),{'verbose':_0x5c13aa[_0x4e6826(0x221)]}),_0x527c3d=_0x57d320[_0x4e6826(0x20a)];_0x5c13aa[_0x4e6826(0x221)]&&(console[_0x4e6826(0x280)](_0x4e6826(0x279)+_0x527c3d[_0x4e6826(0x233)]),console['error'](_0x4e6826(0x212)+_0x527c3d[_0x4e6826(0x205)]),_0x527c3d[_0x4e6826(0x22e)]&&console[_0x4e6826(0x280)](_0x4e6826(0x22b)+_0x527c3d[_0x4e6826(0x22e)]),_0x527c3d['segmentId']&&console[_0x4e6826(0x280)](_0x4e6826(0x1ed)+_0x527c3d[_0x4e6826(0x276)]));if(_0x5c13aa[_0x4e6826(0x21c)]){if(_0x527c3d['type']===_0x4e6826(0x1ec))return console['error'](_0x4e6826(0x203)),0x1;if(_0x527c3d['type']===_0x4e6826(0x214))return console[_0x4e6826(0x280)](_0x4e6826(0x263)),console[_0x4e6826(0x280)](_0x4e6826(0x1e0)),0x1;if(!_0x527c3d['segmentId'])throw new SDKError(ErrorCode[_0x4e6826(0x268)],_0x4e6826(0x248));const _0xa2e03a=getConsoleNextUrl(_0x5c13aa[_0x4e6826(0x227)],_0x4e6826(0x259)+_0x527c3d[_0x4e6826(0x205)]+_0x4e6826(0x238)+_0x527c3d[_0x4e6826(0x276)]);return console[_0x4e6826(0x280)](a35_0x46420a[_0x4e6826(0x213)]('✔')+'\x20Opening\x20'+a35_0x46420a['cyan'](_0xa2e03a)),openBrowser(_0xa2e03a),0x0;}if(_0x527c3d[_0x4e6826(0x233)]===_0x4e6826(0x1ec)){if(!_0x527c3d[_0x4e6826(0x22e)])throw new SDKError(ErrorCode[_0x4e6826(0x1fb)],_0x4e6826(0x1f7));const _0x53a047=await withSpinner(_0x4e6826(0x201),()=>_0x2bb082[_0x4e6826(0x1e7)][_0x4e6826(0x245)](_0x527c3d[_0x4e6826(0x22e)]),{'verbose':_0x5c13aa['verbose']});await handleSingleObjectOutput(_0x53a047[_0x4e6826(0x20a)],_0x5c13aa);}else{if(_0x527c3d['type']===_0x4e6826(0x1e7)){if(!_0x527c3d['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4e6826(0x248));const _0x2d95aa=await withSpinner(_0x4e6826(0x202),()=>_0x2bb082[_0x4e6826(0x1e7)][_0x4e6826(0x21d)](_0x527c3d[_0x4e6826(0x205)],_0x527c3d[_0x4e6826(0x276)]),{'verbose':_0x5c13aa['verbose']}),_0x3b6e04=getConsoleNextUrl(_0x5c13aa[_0x4e6826(0x227)],_0x4e6826(0x259)+_0x527c3d['parentId']+'/e/'+_0x527c3d[_0x4e6826(0x276)]),_0x4e2d42=_0x2d95aa['data'];_0x4e2d42['url']=_0x3b6e04,await handleSingleObjectOutput(_0x4e2d42,_0x5c13aa);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4e6826(0x280)](_0x4e6826(0x215)),0x1;}return 0x0;}catch(_0x6c2eb){if(_0x6c2eb instanceof SDKError)return console['error']('Error:\x20'+_0x6c2eb['message']),_0x6c2eb[_0x4e6826(0x220)]&&console['error']('\x20\x20Cause:\x20'+_0x6c2eb['cause']),0x1;throw _0x6c2eb;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a35_0xcd4784(0x273)]=a35_0xcd4784(0x27d);async[a35_0xcd4784(0x23f)](_0x4d1807){const _0x4b8c7a=a35_0xcd4784,{options:_0x5be202,args:_0xa6e79a,tdx:_0x2c3e3a}=_0x4d1807,_0x4e63aa=_0xa6e79a[0x0];if(!_0x4e63aa)return console['error'](_0x4b8c7a(0x1db)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x26a)),console['error'](_0x4b8c7a(0x1df)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x22f)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x4b8c7a(0x1de)),0x1;try{const _0x10b7a3=_0x5be202[_0x4b8c7a(0x254)],_0xfbea62=await resolveSegmentTarget(_0x4e63aa,_0x10b7a3,_0x5be202[_0x4b8c7a(0x221)]);_0x5be202[_0x4b8c7a(0x221)]&&console[_0x4b8c7a(0x280)]('Target\x20path:\x20'+_0xfbea62);const _0x1a1a53=await withSpinner(_0x4b8c7a(0x242)+_0x4e63aa+_0x4b8c7a(0x243),()=>_0x2c3e3a[_0x4b8c7a(0x1e7)][_0x4b8c7a(0x1ee)](_0xfbea62),{'verbose':_0x5be202['verbose']}),_0x37e3ca=_0x1a1a53[_0x4b8c7a(0x20a)];_0x5be202['verbose']&&(console['error'](_0x4b8c7a(0x279)+_0x37e3ca[_0x4b8c7a(0x233)]),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x212)+_0x37e3ca[_0x4b8c7a(0x205)]));if(_0x37e3ca[_0x4b8c7a(0x233)]==='folder')return console['error'](_0x4b8c7a(0x1e5)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x216)),0x1;if(_0x37e3ca[_0x4b8c7a(0x233)]===_0x4b8c7a(0x214))return console[_0x4b8c7a(0x280)](_0x4b8c7a(0x277)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x1ef)),0x1;if(!_0x37e3ca[_0x4b8c7a(0x276)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4b8c7a(0x248));const _0x25621c=await withSpinner(_0x4b8c7a(0x1f1),()=>_0x2c3e3a[_0x4b8c7a(0x1e7)]['getSegmentSQL'](_0x37e3ca[_0x4b8c7a(0x205)],_0x37e3ca[_0x4b8c7a(0x276)]),{'verbose':_0x5be202[_0x4b8c7a(0x221)]}),_0x3087cc=_0x25621c[_0x4b8c7a(0x20a)],_0xa14d1a=await executeSchemaQuery(_0x3087cc,_0x2c3e3a,_0x5be202);return await handleQueryOutput(_0xa14d1a,_0x5be202),0x0;}catch(_0x247347){if(_0x247347 instanceof SDKError)return console['error'](_0x4b8c7a(0x1fd)+_0x247347[_0x4b8c7a(0x249)]),_0x247347[_0x4b8c7a(0x220)]&&console[_0x4b8c7a(0x280)](_0x4b8c7a(0x207)+_0x247347[_0x4b8c7a(0x220)]),0x1;throw _0x247347;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x342c18=a36_0x511b;(function(_0x4bd1a5,_0x34cbf9){const _0x2ba994=a36_0x511b,_0x4c1ebe=_0x4bd1a5();while(!![]){try{const _0x32f60b=parseInt(_0x2ba994(0x179))/0x1+parseInt(_0x2ba994(0x182))/0x2*(-parseInt(_0x2ba994(0x18b))/0x3)+-parseInt(_0x2ba994(0x193))/0x4+parseInt(_0x2ba994(0x17e))/0x5+parseInt(_0x2ba994(0x174))/0x6+-parseInt(_0x2ba994(0x16e))/0x7+-parseInt(_0x2ba994(0x18d))/0x8;if(_0x32f60b===_0x34cbf9)break;else _0x4c1ebe['push'](_0x4c1ebe['shift']());}catch(_0x410910){_0x4c1ebe['push'](_0x4c1ebe['shift']());}}}(a36_0x5caa,0x34ba6));function a36_0x5caa(){const _0x41b57e=['folder','1473332wOFmOj','segmentPath','type','Resolved\x20folder\x20ID:\x20','\x27\x20with\x20ID:\x20','✔\x20Created\x20segment\x20\x27','905520iqGXxw','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','invisible','Examples:','ruleFile','60783FipjFt','resolvePathToResource','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x27...','description','2083010EyJpYe','segment','yellow','noCountPopulation','4926TZCjWV','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folderId','name','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20parent\x20segment\x20\x27','rule','Target\x20path:\x20','63ZFbJsC','resolveFolderId','1182064nvpXxl','segments','Segment\x20name:\x20','length','Resolving\x20folder\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','9496xLnnBm','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','data','Parent:\x20','Creating\x20segment\x20\x27','kind','Resolving\x20folder\x20path\x20\x27','error','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','verbose','execute','Parent\x20path:\x20'];a36_0x5caa=function(){return _0x41b57e;};return a36_0x5caa();}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_0x511b(_0x485459,_0x36b714){_0x485459=_0x485459-0x168;const _0x5caa4b=a36_0x5caa();let _0x511b31=_0x5caa4b[_0x485459];return _0x511b31;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x440bbc from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x342c18(0x185)]='segment:create';[a36_0x342c18(0x17d)]=a36_0x342c18(0x17b);async[a36_0x342c18(0x16b)](_0x58d20f){const _0x6ce7ea=a36_0x342c18;console['error'](a36_0x440bbc[_0x6ce7ea(0x180)](_0x6ce7ea(0x192))),console['error'](a36_0x440bbc[_0x6ce7ea(0x180)](_0x6ce7ea(0x194)));const {options:_0x2aaacc,args:_0x797978,tdx:_0x263c1b}=_0x58d20f,_0x132237=_0x2aaacc;if(_0x797978[_0x6ce7ea(0x190)]===0x0)return console[_0x6ce7ea(0x168)](_0x6ce7ea(0x187)),console[_0x6ce7ea(0x168)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x177)),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x169)),console[_0x6ce7ea(0x168)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x6ce7ea(0x175)),0x1;const _0x211ff6=_0x797978[0x0],_0x4ecefa=_0x2aaacc[_0x6ce7ea(0x16f)];let _0x4fa09d=_0x211ff6;_0x4ecefa&&!_0x211ff6['includes']('/')&&(_0x4fa09d=_0x4ecefa+'/'+_0x211ff6,_0x132237[_0x6ce7ea(0x16a)]&&console[_0x6ce7ea(0x168)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4fa09d));const _0xce1964=parsePath(_0x4fa09d);if(_0xce1964[_0x6ce7ea(0x18e)][_0x6ce7ea(0x190)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x183)),0x1;const _0x146456=_0xce1964[_0x6ce7ea(0x18e)][0x0],_0x4954aa=getBaseName(_0x4fa09d),_0x3dfb28=getParentPath(_0x4fa09d);_0x132237['verbose']&&(console[_0x6ce7ea(0x168)]('Site:\x20'+_0x132237['site']),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x18a)+_0x4fa09d),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x196)+_0x146456),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x18f)+_0x4954aa),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x16c)+_0x3dfb28));const _0x1696b5=await withSpinner(_0x6ce7ea(0x188)+_0x146456+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)]['resolveParentId'](_0x146456),{'verbose':_0x132237[_0x6ce7ea(0x16a)]}),_0x280822=_0x1696b5[_0x6ce7ea(0x195)];let _0x444ef3;if(_0xce1964[_0x6ce7ea(0x18e)][_0x6ce7ea(0x190)]>0x2){const _0x37d0c6=await withSpinner(_0x6ce7ea(0x199)+_0x3dfb28+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)][_0x6ce7ea(0x17a)](_0x3dfb28),{'verbose':_0x132237[_0x6ce7ea(0x16a)]}),_0x31e7b6=_0x37d0c6[_0x6ce7ea(0x195)];if(_0x31e7b6['type']!==_0x6ce7ea(0x16d)&&_0x31e7b6[_0x6ce7ea(0x170)]!=='parent')return console[_0x6ce7ea(0x168)](_0x6ce7ea(0x186)),0x1;_0x444ef3=_0x31e7b6[_0x6ce7ea(0x184)];}else{if(_0x132237[_0x6ce7ea(0x16d)]){const _0x9746a7=await withSpinner(_0x6ce7ea(0x191)+_0x132237[_0x6ce7ea(0x16d)]+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)][_0x6ce7ea(0x18c)](_0x280822,_0x132237[_0x6ce7ea(0x16d)]),{'verbose':_0x132237[_0x6ce7ea(0x16a)]});_0x444ef3=_0x9746a7[_0x6ce7ea(0x195)];}}_0x132237['verbose']&&_0x444ef3&&console['error'](_0x6ce7ea(0x171)+_0x444ef3);const _0x501a99=await loadJSONFromOptions(_0x132237[_0x6ce7ea(0x189)],_0x132237[_0x6ce7ea(0x178)]),_0x477a87={'name':_0x4954aa,'description':_0x132237[_0x6ce7ea(0x17d)],'rule':_0x501a99,'kind':_0x132237[_0x6ce7ea(0x198)]!==undefined?parseInt(_0x132237[_0x6ce7ea(0x198)],0xa):undefined,'isVisible':_0x132237[_0x6ce7ea(0x176)]?![]:undefined,'segmentFolderId':_0x444ef3,'countPopulation':_0x132237[_0x6ce7ea(0x181)]?![]:undefined},_0xabc8fc=await withSpinner(_0x6ce7ea(0x197)+_0x4954aa+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)]['createSegment'](_0x280822,_0x477a87),{'verbose':_0x132237['verbose']}),_0x27eec3=_0xabc8fc['data'];return console[_0x6ce7ea(0x168)](_0x6ce7ea(0x173)+_0x27eec3[_0x6ce7ea(0x185)]+_0x6ce7ea(0x172)+_0x27eec3['id']),_0x4fa09d!==_0x211ff6&&console[_0x6ce7ea(0x168)]('\x20\x20\x20Path:\x20'+_0x4fa09d),await handleSDKOutput([_0x27eec3],_0x132237),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a37_0x1acb5b=a37_0x360d;(function(_0x47bc2d,_0x2b79d5){const _0x2fb00a=a37_0x360d,_0x23e215=_0x47bc2d();while(!![]){try{const _0x41fdbd=-parseInt(_0x2fb00a(0x127))/0x1*(parseInt(_0x2fb00a(0x123))/0x2)+parseInt(_0x2fb00a(0x125))/0x3*(-parseInt(_0x2fb00a(0x132))/0x4)+parseInt(_0x2fb00a(0x11d))/0x5+parseInt(_0x2fb00a(0x122))/0x6+-parseInt(_0x2fb00a(0x12a))/0x7+parseInt(_0x2fb00a(0x12c))/0x8*(-parseInt(_0x2fb00a(0x11f))/0x9)+parseInt(_0x2fb00a(0x130))/0xa;if(_0x41fdbd===_0x2b79d5)break;else _0x23e215['push'](_0x23e215['shift']());}catch(_0xc052e6){_0x23e215['push'](_0x23e215['shift']());}}}(a37_0x4ff5,0x33ac7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a37_0x4ff5(){const _0x610276=['Error:\x20Parent\x20segment\x20name\x20is\x20required','6190080CsmRZM','description','20HBVXzY','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','List\x20available\x20fields\x20for\x20segmentation','data','\x20field','Listing\x20fields\x20for\x20\x27','Site:\x20','jsonl','name','768840qcirIy','\x27...','9pBkQwx','verbose','segment','1547730XGoRin','186CRJfzk','parentSegment','59199JrHAcn','✔\x20Found\x20','3985feWezv','error','Parent\x20segment:\x20','1146187hrlFAY','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1488520WDuMut','site','segment:fields'];a37_0x4ff5=function(){return _0x610276;};return a37_0x4ff5();}import{withSpinner}from'../utils/spinner.js';function a37_0x360d(_0x41af99,_0x292415){_0x41af99=_0x41af99-0x115;const _0x4ff532=a37_0x4ff5();let _0x360db7=_0x4ff532[_0x41af99];return _0x360db7;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x1acb5b(0x11c)]=a37_0x1acb5b(0x12e);[a37_0x1acb5b(0x131)]=a37_0x1acb5b(0x116);async['execute'](_0x368ae5){const _0x5f25f4=a37_0x1acb5b,{options:_0x206c4c,args:_0x389582,tdx:_0xd87a57}=_0x368ae5,_0x277c19=_0x389582[0x0]||_0x206c4c[_0x5f25f4(0x124)];if(!_0x277c19)return console['error'](_0x5f25f4(0x12f)),console[_0x5f25f4(0x128)](_0x5f25f4(0x115)),console['error'](_0x5f25f4(0x12b)),0x1;_0x206c4c[_0x5f25f4(0x120)]&&(console['error'](_0x5f25f4(0x11a)+_0x206c4c[_0x5f25f4(0x12d)]),console[_0x5f25f4(0x128)](_0x5f25f4(0x129)+_0x277c19));const _0x3848ef=await withSpinner(_0x5f25f4(0x119)+_0x277c19+_0x5f25f4(0x11e),()=>_0xd87a57[_0x5f25f4(0x121)]['listFields'](_0x277c19),{'verbose':_0x206c4c[_0x5f25f4(0x120)]}),_0x483a2a=_0x3848ef[_0x5f25f4(0x117)];console['error'](_0x5f25f4(0x126)+_0x483a2a['length']+_0x5f25f4(0x118)+(_0x483a2a['length']!==0x1?'s':''));if(_0x206c4c['json']||_0x206c4c[_0x5f25f4(0x11b)])return await handleSDKOutput(_0x483a2a,_0x206c4c),0x0;return displayFieldsHumanReadable(_0x483a2a,_0x277c19),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x44ae17=a38_0x5b90;(function(_0x3d42f7,_0x135855){const _0x4cb576=a38_0x5b90,_0x54943b=_0x3d42f7();while(!![]){try{const _0x1ad0a9=-parseInt(_0x4cb576(0xb7))/0x1+parseInt(_0x4cb576(0xb4))/0x2*(-parseInt(_0x4cb576(0xde))/0x3)+-parseInt(_0x4cb576(0x9f))/0x4+parseInt(_0x4cb576(0xb9))/0x5+parseInt(_0x4cb576(0xaf))/0x6+-parseInt(_0x4cb576(0xbd))/0x7*(parseInt(_0x4cb576(0xa7))/0x8)+-parseInt(_0x4cb576(0xa3))/0x9*(-parseInt(_0x4cb576(0xd7))/0xa);if(_0x1ad0a9===_0x135855)break;else _0x54943b['push'](_0x54943b['shift']());}catch(_0x562b83){_0x54943b['push'](_0x54943b['shift']());}}}(a38_0x1d71,0x31ddf));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a38_0x1d71(){const _0x688228=['helpText','execute','site','\x0aPull\x20summary\x20for\x20\x27','content','no_parent','\x20files\x20to\x20','\x0aChanges\x20to\x20\x27','description','Write\x20','errorCode','activations','dryRun','1437292VBLpBl','parentName','dirname','\x20files?','36Cayzlj','data','\x0aError:','Target\x20resource:\x20','128SJutuQ','yellow','file','\x20\x20🎯\x20','setPhase','relativePath','red','✔\x20Context\x20set:\x20','562920bZIlPN','\x20new\x20files','message','\x20versions)','isNew','2OpyCTo','green','Pulling\x20segments\x20from\x20\x27','338150VqdmdC','parentSegment','740180uSCGWe','targetDir','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','43652IddBZr','\x20with\x20','\x20\x20🗺️\x20\x20','\x20activations','✔\x20Pulled\x20','\x20unchanged\x20files','length','dim','\x20journeys','type','hasChanges','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20segments','parent_segment','segment:pull','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','\x20\x20Target:\x20','files','diff','cyan','\x20changed\x20files','journeyVersions','verbose','session','Aborted.','2783480WRfXpE','\x27...','\x20=\x20','Parent\x20segment:\x20','segment','filter','absolutePath','1061232crXPlg','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','counts','journeys'];a38_0x1d71=function(){return _0x688228;};return a38_0x1d71();}function a38_0x5b90(_0x43c5d3,_0xe8362b){_0x43c5d3=_0x43c5d3-0x9c;const _0x1d7135=a38_0x1d71();let _0x5b9000=_0x1d7135[_0x43c5d3];return _0x5b9000;}import a38_0x3e319a from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x457981 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_0x44ae17(0xcb);[a38_0x44ae17(0xeb)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0x44ae17(0xe4)](_0x592de3){const _0xec711f=a38_0x44ae17,{options:_0x4c8306,args:_0x1995ee,tdx:_0x170aa4}=_0x592de3,_0x35c81c=_0x4c8306,_0x3b38f0=await resolveTarget({'arg':_0x1995ee[0x0],'contextParent':_0x4c8306[_0xec711f(0xb8)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3b38f0))return _0x3b38f0[_0xec711f(0x9c)]===_0xec711f(0xe8)?(console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xa8)](_0xec711f(0xcc))),console[_0xec711f(0xbb)]('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)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0xec711f(0xbb)](_0xec711f(0xbc))):(console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xad)]('Error:\x20'+_0x3b38f0[_0xec711f(0xb1)]+'\x0a')),_0x3b38f0[_0xec711f(0xe3)]&&console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xd1)](_0x3b38f0['helpText']))),0x1;const _0xccb151=_0x3b38f0[_0xec711f(0xa0)],_0x5a6df2=_0x3b38f0[_0xec711f(0xba)],_0x44393b=_0x3b38f0[_0xec711f(0xc6)]===_0xec711f(0xa9)?_0x3b38f0['resourceName']:undefined;_0x35c81c['verbose']&&(console[_0xec711f(0xbb)]('Site:\x20'+_0x35c81c[_0xec711f(0xe5)]),console[_0xec711f(0xbb)](_0xec711f(0xda)+_0xccb151),_0x44393b&&console['error'](_0xec711f(0xa6)+_0x44393b));const _0xf4858=await withProgressSpinner(_0xec711f(0xb6)+_0xccb151+_0xec711f(0xd8),_0x4d7c0c=>_0x170aa4[_0xec711f(0xdb)]['pullSegments'](_0xccb151,{'targetDir':_0x5a6df2,'targetResourceName':_0x44393b,'verbose':_0x35c81c[_0xec711f(0xd4)],'progress':{'update':_0x4cb8bc=>{const _0x20f7e5=_0xec711f;_0x4d7c0c[_0x20f7e5(0xab)](_0x4cb8bc),_0x35c81c[_0x20f7e5(0xd4)]&&console[_0x20f7e5(0xbb)]('\x20\x20'+_0x4cb8bc);}}}),{'verbose':_0x35c81c[_0xec711f(0xd4)]}),_0x6ff04=_0xf4858[_0xec711f(0xa4)];if(_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xcd)]===0x0&&_0x6ff04['counts'][_0xec711f(0xe2)]===0x0)return console['error'](a38_0x3e319a[_0xec711f(0xa8)](_0xec711f(0xc8)+_0x6ff04[_0xec711f(0xa0)]+'\x27')),0x0;const _0x1cfd6b=_0x6ff04['files'][_0xec711f(0xdc)](_0x487876=>_0x487876[_0xec711f(0xb3)]),_0x15093e=_0x6ff04[_0xec711f(0xcf)][_0xec711f(0xdc)](_0x22085b=>!_0x22085b[_0xec711f(0xb3)]&&_0x22085b[_0xec711f(0xc7)]),_0x2243fe=_0x6ff04[_0xec711f(0xcf)][_0xec711f(0xdc)](_0x3945c3=>!_0x3945c3[_0xec711f(0xb3)]&&!_0x3945c3[_0xec711f(0xc7)]);console[_0xec711f(0xbb)](_0xec711f(0xe6)+_0x6ff04[_0xec711f(0xa0)]+'\x27:'),console[_0xec711f(0xbb)](_0xec711f(0xaa)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xcd)]+_0xec711f(0xc9))+_0xec711f(0xbe)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xe1)][_0xec711f(0x9d)]+_0xec711f(0xc0)));if(_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xe2)]>0x0){const _0x1468da=_0x6ff04['counts'][_0xec711f(0xd3)]>_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xe2)]?'\x20('+_0x6ff04[_0xec711f(0xe1)]['journeyVersions']+_0xec711f(0xb2):'';console[_0xec711f(0xbb)](_0xec711f(0xbf)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xe2)]+_0xec711f(0xc5))+a38_0x3e319a[_0xec711f(0xc4)](_0x1468da));}console['error']('\x20\x20'+a38_0x3e319a[_0xec711f(0xb5)]('+\x20'+_0x1cfd6b[_0xec711f(0xc3)]+_0xec711f(0xb0))),console['error']('\x20\x20'+a38_0x3e319a['yellow']('~\x20'+_0x15093e['length']+_0xec711f(0xd2))),console['error']('\x20\x20'+a38_0x3e319a['dim']('=\x20'+_0x2243fe[_0xec711f(0xc3)]+_0xec711f(0xc2))),console[_0xec711f(0xbb)](_0xec711f(0xce)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04['targetDir'])+'\x0a');if(_0x15093e[_0xec711f(0xc3)]>0x0)for(const _0x5d6caf of _0x15093e){console[_0xec711f(0xbb)](_0xec711f(0xea)+_0x5d6caf[_0xec711f(0xac)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0xec711f(0xbb)](_0x5d6caf[_0xec711f(0xd0)]),console[_0xec711f(0xbb)]('─'['repeat'](0x3c));}if(_0x35c81c[_0xec711f(0x9e)])return console['error'](a38_0x3e319a[_0xec711f(0xa8)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1cfd6b[_0xec711f(0xc3)]===0x0&&_0x15093e[_0xec711f(0xc3)]===0x0)return console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xb5)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x6ff04['parentName']},_0x35c81c[_0xec711f(0xd5)]),console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xb5)]('✔\x20Context\x20set:\x20'+a38_0x3e319a[_0xec711f(0xc4)]('parent_segment')+_0xec711f(0xd9)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04['parentName']))),0x0;if(!_0x35c81c[_0xec711f(0xdf)]){if(!isInteractive())return console['error'](a38_0x3e319a[_0xec711f(0xad)](_0xec711f(0xa5)),_0xec711f(0xe0)),console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xc4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xac5d2=await confirmKey(_0xec711f(0xec)+(_0x1cfd6b[_0xec711f(0xc3)]+_0x15093e[_0xec711f(0xc3)])+_0xec711f(0xa2));if(!_0xac5d2)return console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xa8)](_0xec711f(0xd6)),'-\x20no\x20files\x20written'),0x1;}for(const _0x51f1bf of _0x6ff04[_0xec711f(0xcf)]){if(_0x51f1bf[_0xec711f(0xb3)]||_0x51f1bf[_0xec711f(0xc7)]){const _0x35c0a9=a38_0x457981[_0xec711f(0xa1)](_0x51f1bf[_0xec711f(0xdd)]);!existsSync(_0x35c0a9)&&mkdirSync(_0x35c0a9,{'recursive':!![]}),writeFileSync(_0x51f1bf['absolutePath'],_0x51f1bf[_0xec711f(0xe7)],'utf-8');}}return console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xb5)](_0xec711f(0xc1)+(_0x1cfd6b[_0xec711f(0xc3)]+_0x15093e[_0xec711f(0xc3)])+_0xec711f(0xe9)+_0x6ff04[_0xec711f(0xba)])),saveSessionContext({'parent_segment':_0x6ff04[_0xec711f(0xa0)]},_0x35c81c['session']),console[_0xec711f(0xbb)](a38_0x3e319a['green'](_0xec711f(0xae)+a38_0x3e319a['dim'](_0xec711f(0xca))+'\x20=\x20'+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xa0)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x1a49d2=a39_0x1894;(function(_0x25673d,_0x1c528c){const _0x4ccc4c=a39_0x1894,_0x58272c=_0x25673d();while(!![]){try{const _0x150bc2=-parseInt(_0x4ccc4c(0xf4))/0x1*(parseInt(_0x4ccc4c(0xef))/0x2)+-parseInt(_0x4ccc4c(0x16a))/0x3+parseInt(_0x4ccc4c(0x117))/0x4*(-parseInt(_0x4ccc4c(0x129))/0x5)+parseInt(_0x4ccc4c(0x152))/0x6+-parseInt(_0x4ccc4c(0x106))/0x7*(parseInt(_0x4ccc4c(0x13a))/0x8)+-parseInt(_0x4ccc4c(0xfe))/0x9+parseInt(_0x4ccc4c(0xfd))/0xa;if(_0x150bc2===_0x1c528c)break;else _0x58272c['push'](_0x58272c['shift']());}catch(_0x575b1e){_0x58272c['push'](_0x58272c['shift']());}}}(a39_0x5a4c,0x30182));function a39_0x1894(_0x59b59c,_0x289124){_0x59b59c=_0x59b59c-0xd3;const _0x5a4c5d=a39_0x5a4c();let _0x189438=_0x5a4c5d[_0x59b59c];return _0x189438;}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x5a4c(){const _0x2b5492=['Parent\x20segment:\x20','length','\x20\x20Segments:\x20','blue','10335750oaaZIc','3147597HwxYbo','isScoped','\x20\x20🗺️\x20\x20Journeys:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Source:\x20','data','New\x20segment:','attributes','7ZHeNav','Preparing\x20journeys...','\x20changes?','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','unchanged','journey','created','createdAt','endsWith','join','\x20to\x20update','helpText','journeysOnly','updatedAt','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','verbose','48244IegaNV','yes','type','set','/e/','\x20deleted','\x20folders\x20to\x20create','Resolving\x20parent\x20segment\x20\x27','getParent','folderId','\x0aError:','\x0aPush\x20summary\x20for\x20\x27','\x20changed','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20unchanged','parentSegment','\x0a✔\x20Push\x20complete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','70XfYbOO','error','red','segment\x20or\x20journey','push','toCreate','\x27...','idToName','listActivations','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','existingSegment','all','deleted','\x20to\x20create','message','targetDir','changed','2346672UZhuvI','get','state','\x20updated','Fetching\x20existing\x20data...','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)','\x20YAML\x20files\x20found','updated','site','New\x20journey:','listFolders','\x20\x20📊\x20Segments:','Error:\x20Directory\x20not\x20found:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20to\x20delete','\x20activations]','dim','delete','existingJourney','Error\x20parsing\x20YAML:\x20','paused','green','Folders\x20to\x20create:','segments','1964652dYOdng','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','errorCode','\x20\x20Activations:\x20','then','results','segmentFolderId','nameToId','Aborted.','scopedFolderPath','diff','\x20new','getOutputSchemaWithCache','parentFolder','/app/ps/','filePath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Scoped\x20to\x20folder:\x20','📁\x20','journeyBundleName','No\x20','map','(Journey\x20will\x20be\x20deleted)','75987MUIDfg','segment','relationships','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journeys','Delete\x20segment:','yellow','connection','\x20\x20Activations:','\x20\x20\x20\x20','getJourney','/sb/da/esr','toString','\x0aValidation\x20failed:','Fetching\x20existing\x20activations...','folders','.yaml','Delete\x20journey:','activations','.yml','name','parentName','toDelete','no_parent','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','createdSegmentIds','Site:\x20','nameToType','list','new','repeat','2AlFpXE','cyan','journeyId','isNew','folderPath','326773qKhWsL','user','yamlConfig','resolveParentId','\x20created'];a39_0x5a4c=function(){return _0x2b5492;};return a39_0x5a4c();}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_0x2185ed 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_0x1a49d2(0xe4)]='segment:push';[a39_0x1a49d2(0x109)]=a39_0x1a49d2(0x128);async['execute'](_0x40b00a){const _0xe3d454=a39_0x1a49d2,{options:_0x536442,args:_0x51e818,tdx:_0x36dbe7}=_0x40b00a,_0x458cc3=_0x536442,_0x2a8055=await resolveTarget({'arg':_0x51e818[0x0],'contextParent':_0x536442[_0xe3d454(0x126)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2a8055))return _0x2a8055[_0xe3d454(0x155)]===_0xe3d454(0xe7)?(console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0xd3))),console[_0xe3d454(0x12a)](_0xe3d454(0x13f)),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x12b)]('Error:\x20'+_0x2a8055[_0xe3d454(0x137)]+'\x0a')),_0x2a8055['helpText']&&console['error'](a39_0x2185ed[_0xe3d454(0xf0)](_0x2a8055[_0xe3d454(0x112)]))),0x1;if(_0x2a8055['type']==='parent_name')return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x146)+_0x2a8055[_0xe3d454(0x138)]+'\x0a')),console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xf0)](_0xe3d454(0x163))),0x1;const _0x4b9d68=_0x2a8055[_0xe3d454(0xe5)],_0x371891=_0x2a8055[_0xe3d454(0x138)],_0x4769dc=_0x2a8055[_0xe3d454(0x119)]==='file'?_0x2a8055[_0xe3d454(0x162)]:undefined,_0x12e5a6=getScopedDetails(_0x2a8055),_0x3c59cd=_0x12e5a6?.[_0xe3d454(0xff)]??![],_0x5274f7=_0x12e5a6?.[_0xe3d454(0x15c)]??'';if(!existsSync(_0x371891))return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x146)+_0x371891+'\x0a')),console['error'](a39_0x2185ed['cyan'](_0xe3d454(0x163))),0x1;_0x458cc3[_0xe3d454(0x116)]&&(console[_0xe3d454(0x12a)](_0xe3d454(0xea)+_0x458cc3[_0xe3d454(0x142)]),console[_0xe3d454(0x12a)](_0xe3d454(0xf9)+_0x4b9d68),console[_0xe3d454(0x12a)]('Source\x20directory:\x20'+_0x371891),_0x3c59cd&&console[_0xe3d454(0x12a)](_0xe3d454(0x164)+_0x5274f7));const _0x28a48d=await withSpinner(_0xe3d454(0x11e)+_0x4b9d68+_0xe3d454(0x12f),()=>_0x36dbe7[_0xe3d454(0x16b)][_0xe3d454(0xf7)](_0x4b9d68),{'verbose':_0x458cc3['verbose']}),_0x212b14=_0x28a48d[_0xe3d454(0x103)],{parentSegmentResult:_0x7aaa7d,segmentsResult:_0x30c998,foldersResult:_0x128055,journeysWithDetailsResult:_0x163ba8,userMaps:_0x4e8a00}=await withSpinner(_0xe3d454(0x13e),async()=>{const _0x3d87de=_0xe3d454,[_0x79b5,_0x225070,_0x3fd4de,_0x46e751,_0x523f07]=await Promise[_0x3d87de(0x134)]([_0x36dbe7[_0x3d87de(0x16b)][_0x3d87de(0x11f)](_0x212b14),_0x36dbe7[_0x3d87de(0x16b)]['listSegments'](_0x212b14),_0x36dbe7[_0x3d87de(0x16b)][_0x3d87de(0x144)](_0x212b14),_0x36dbe7[_0x3d87de(0x10c)]['listJourneysWithDetailsFromParentSegment'](_0x212b14,{'includeAllVersions':!![]}),_0x36dbe7['user']['buildUserMaps']()]);return{'parentSegmentResult':_0x79b5,'segmentsResult':_0x225070,'foldersResult':_0x3fd4de,'journeysWithDetailsResult':_0x46e751,'userMaps':_0x523f07};},{'verbose':_0x458cc3[_0xe3d454(0x116)]})['then'](_0x1d3c67=>_0x1d3c67['data']),_0x15639c=_0x7aaa7d,_0x44f244=extractRootFolderId(_0x15639c),_0x130922=_0x30c998,_0xe4dc59=_0x128055,{journeys:_0x2e1b13,activationStepsById:_0x399796}=_0x163ba8,_0x35d339=new Map(_0x2e1b13[_0xe3d454(0x168)](_0x50458d=>[_0x50458d['id'],_0x50458d])),_0x58e035=_0x2e1b13['map'](_0xe318f0=>({'id':_0xe318f0['id'],'name':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0xe4)],'journeyBundleName':_0xe318f0['attributes'][_0xe3d454(0x166)]||'','journeyBundleId':_0xe318f0[_0xe3d454(0x105)]['journeyBundleId']||'','versionNumber':_0xe318f0['attributes']['versionNumber'],'description':_0xe318f0[_0xe3d454(0x105)]['description'],'state':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x13c)],'paused':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x14e)],'audienceId':_0xe318f0[_0xe3d454(0x105)]['audienceId'],'folderId':_0xe318f0[_0xe3d454(0x16c)]?.[_0xe3d454(0x160)]?.['data']?.['id'],'createdAt':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x10e)],'updatedAt':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x114)]})),{emailToId:_0x130b41,idToEmail:_0x141957}=_0x4e8a00,_0x59aab1=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x1c3c34=_0xe3d454,_0x50be20=await _0x36dbe7[_0x1c3c34(0xd7)][_0x1c3c34(0xec)]();return buildConnectionMaps(_0x50be20);},{'verbose':_0x458cc3['verbose']})[_0xe3d454(0x157)](_0xdd18bb=>_0xdd18bb['data']),_0x5740a5=_0x59aab1[_0xe3d454(0x15a)],_0x1068ba=_0x59aab1[_0xe3d454(0x130)],_0x49dfca=_0x59aab1[_0xe3d454(0xeb)],_0x2ea0c5={'emailToIdMap':_0x130b41,'connectionNameToIdMap':_0x5740a5,'connectionNameToTypeMap':_0x49dfca,'getSchema':_0x6a1f7a=>_0x36dbe7[_0xe3d454(0xd7)][_0xe3d454(0x15f)](_0x6a1f7a)};let {pathToId:_0x237422,idToPath:_0xd4dfc4}=buildFolderMaps(_0xe4dc59);const _0x267281=buildSegmentLookupMap(_0x130922,_0xd4dfc4),_0xbf7f0=buildSegmentNameToIdMap(_0x130922),_0x48fe50=buildJourneyBundleLookupMap(_0x58e035,_0xd4dfc4);let _0x5b3782;if(_0x4769dc){if(!_0x4769dc[_0xe3d454(0x10f)](_0xe3d454(0xe3))&&!_0x4769dc[_0xe3d454(0x10f)](_0xe3d454(0xe0)))return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x124)+_0x4769dc+'\x0a')),0x1;_0x5b3782=[_0x4769dc];}else _0x5b3782=findYamlFiles(_0x371891);if(_0x5b3782[_0xe3d454(0xfa)]===0x0)return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x10a)+_0x371891+'\x0a')),console[_0xe3d454(0x12a)](a39_0x2185ed['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x28c217,_0x5439d8;try{const _0x1bb0a5=parseAndClassifyYamlFiles(_0x5b3782,_0x371891,{'skipSegments':_0x458cc3[_0xe3d454(0x113)]});_0x28c217=_0x1bb0a5[_0xe3d454(0x151)],_0x5439d8=_0x1bb0a5[_0xe3d454(0xd4)];const _0x4e4d72=validateParsedFiles(_0x1bb0a5,_0x371891);if(_0x4e4d72[_0xe3d454(0xfa)]>0x0)return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0xdd))),console[_0xe3d454(0x12a)](formatValidationErrors(_0x4e4d72)),console[_0xe3d454(0x12a)](a39_0x2185ed['yellow'](_0xe3d454(0x132))),0x1;}catch(_0x5c6480){return console[_0xe3d454(0x12a)](a39_0x2185ed['red'](_0xe3d454(0x14d)+(_0x5c6480 instanceof Error?_0x5c6480[_0xe3d454(0x137)]:_0x5c6480))),0x1;}if(_0x28c217[_0xe3d454(0xfa)]===0x0&&_0x5439d8[_0xe3d454(0xfa)]===0x0){const _0x24538d=_0x458cc3[_0xe3d454(0x113)]?'journey':_0xe3d454(0x12c);return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0x167)+_0x24538d+_0xe3d454(0x140))),0x0;}const _0x3ad5cb=new Map();_0x130922[_0xe3d454(0xfa)]>0x0&&!_0x458cc3['journeysOnly']&&await withSpinner(_0xe3d454(0xde),async()=>{await batchAsync(_0x130922,async _0x3d7d1f=>{const _0xa32093=a39_0x1894,_0x6bfe72=await _0x36dbe7[_0xa32093(0x16b)][_0xa32093(0x131)](_0x212b14,_0x3d7d1f['id']);_0x3ad5cb[_0xa32093(0x11a)](_0x3d7d1f['id'],_0x6bfe72);});},{'verbose':_0x458cc3[_0xe3d454(0x116)]});const {segmentFiles:_0x59bd46,foldersToCreate:_0x52e9b4}=await prepareSegmentFiles(_0x28c217,{'segmentByFolderAndName':_0x267281,'activationsBySegmentId':_0x3ad5cb,'folderPathToId':_0x237422,'idToEmailMap':_0x141957,'connectionIdToNameMap':_0x1068ba},_0x2ea0c5,_0x3c59cd,_0x5274f7),_0x3cfd3f=_0x4769dc?[]:findSegmentsToDelete(_0x130922,_0x28c217[_0xe3d454(0x168)](({yamlConfig:_0x14e442,folderPath:_0xbdad7f})=>({'yamlConfig':_0x14e442,'folderPath':resolveTDFolderPath(_0xbdad7f,_0x3c59cd,_0x5274f7)})),_0xd4dfc4,_0x5274f7,_0x3c59cd),{journeyFiles:_0x5b5905,foldersToCreate:_0xc84631}=await withProgressSpinner(_0xe3d454(0x107),async _0x504d58=>prepareJourneyFiles(_0x5439d8,{'fetchJourney':async _0xdff14c=>_0x36dbe7[_0xe3d454(0x10c)][_0xe3d454(0xda)](_0xdff14c[_0xe3d454(0xf1)]),'journeyBundlesByFolderAndName':_0x48fe50,'folderPathToId':_0x237422,'idToEmailMap':_0x141957,'connectionIdToNameMap':_0x1068ba,'existingSegments':_0x130922,'parentId':_0x212b14,'deps':_0x36dbe7,'progress':{'update':_0xb7b939=>{const _0x1720a4=_0xe3d454;_0x504d58['setPhase'](_0xb7b939),_0x458cc3['verbose']&&console[_0x1720a4(0x12a)]('\x20\x20'+_0xb7b939);}},'journeyById':_0x35d339,'activationStepsById':_0x399796},_0x3c59cd,_0x5274f7),{'verbose':_0x458cc3[_0xe3d454(0x116)]})['then'](_0x113bf9=>_0x113bf9[_0xe3d454(0x103)]);for(const _0x339362 of _0xc84631){_0x52e9b4['add'](_0x339362);}const _0x2e324a=_0x4769dc?[]:findJourneysToDelete(_0x58e035,_0x5439d8['map'](({yamlConfig:_0x337180,folderPath:_0x2fdbd7})=>({'yamlConfig':_0x337180,'folderPath':resolveTDFolderPath(_0x2fdbd7,_0x3c59cd,_0x5274f7)})),_0xd4dfc4,_0x5274f7,_0x3c59cd),_0xa52e8e=calculatePushStats(_0x59bd46,_0x5b5905,_0x52e9b4,_0x3cfd3f,_0x2e324a,!!_0x458cc3[_0xe3d454(0x14b)],!!_0x458cc3[_0xe3d454(0x113)]),_0x1a2aa1=_0xa52e8e[_0xe3d454(0x151)][_0xe3d454(0xed)],_0x3ef934=_0xa52e8e['segments'][_0xe3d454(0x139)],_0x5d58c2=_0xa52e8e[_0xe3d454(0x151)][_0xe3d454(0x10b)],_0x46f89b=_0xa52e8e[_0xe3d454(0x151)][_0xe3d454(0xe6)],_0x27b4b0=_0xa52e8e[_0xe3d454(0xdf)][_0xe3d454(0x12e)],_0xfd615b=_0xa52e8e[_0xe3d454(0xd4)][_0xe3d454(0xed)],_0xdd022f=_0xa52e8e[_0xe3d454(0xd4)][_0xe3d454(0x139)],_0x1f5951=_0xa52e8e['journeys'][_0xe3d454(0x10b)],_0x389169=_0xa52e8e['journeys'][_0xe3d454(0xe6)],_0x159629=_0xa52e8e['activations'][_0xe3d454(0x134)],_0x12efcf=_0xa52e8e[_0xe3d454(0xe2)][_0xe3d454(0x12e)],_0x40d9e4=_0xa52e8e[_0xe3d454(0xe2)]['toUpdate'],_0x3d0ac4=_0xa52e8e[_0xe3d454(0xe2)]['toDelete'];console[_0xe3d454(0x12a)](_0xe3d454(0x122)+_0x4b9d68+'\x27:');_0x27b4b0['length']>0x0&&console['error']('\x20\x20'+a39_0x2185ed[_0xe3d454(0xfc)](_0xe3d454(0x165)+_0x27b4b0[_0xe3d454(0xfa)]+_0xe3d454(0x11d)));if(!_0x458cc3[_0xe3d454(0x113)]){console[_0xe3d454(0x12a)](_0xe3d454(0x145)),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed['green']('+\x20'+_0x1a2aa1[_0xe3d454(0xfa)]+_0xe3d454(0x15e))),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed[_0xe3d454(0xd6)]('~\x20'+_0x3ef934[_0xe3d454(0xfa)]+_0xe3d454(0x123)));if(_0x46f89b[_0xe3d454(0xfa)]>0x0)console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x12b)]('-\x20'+_0x46f89b[_0xe3d454(0xfa)]+_0xe3d454(0x148)));else _0x3cfd3f[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x14b)]&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)](_0x3cfd3f[_0xe3d454(0xfa)]+_0xe3d454(0x154)));console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)]('=\x20'+_0x5d58c2[_0xe3d454(0xfa)]+_0xe3d454(0x125)));}if(_0x5b5905[_0xe3d454(0xfa)]>0x0||_0x2e324a[_0xe3d454(0xfa)]>0x0){console['error'](_0xe3d454(0x100)),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed[_0xe3d454(0x14f)]('+\x20'+_0xfd615b[_0xe3d454(0xfa)]+_0xe3d454(0x15e))),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed['yellow']('~\x20'+_0xdd022f[_0xe3d454(0xfa)]+'\x20changed'));if(_0x389169[_0xe3d454(0xfa)]>0x0)console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x12b)]('-\x20'+_0x389169['length']+_0xe3d454(0x148)));else _0x2e324a[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x14b)]&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)](_0x2e324a[_0xe3d454(0xfa)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)]('=\x20'+_0x1f5951[_0xe3d454(0xfa)]+'\x20unchanged'));}_0x159629['length']>0x0&&!_0x458cc3[_0xe3d454(0x113)]&&(console['error'](''),console[_0xe3d454(0x12a)](_0xe3d454(0xd8)),_0x12efcf[_0xe3d454(0xfa)]>0x0&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14f)]('+\x20'+_0x12efcf['length']+_0xe3d454(0x136))),_0x40d9e4[_0xe3d454(0xfa)]>0x0&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0xd6)]('~\x20'+_0x40d9e4[_0xe3d454(0xfa)]+_0xe3d454(0x111))),_0x3d0ac4['length']>0x0&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x12b)]('-\x20'+_0x3d0ac4[_0xe3d454(0xfa)]+_0xe3d454(0x148))));console[_0xe3d454(0x12a)](_0xe3d454(0x102)+a39_0x2185ed[_0xe3d454(0xf0)](_0x371891)+'\x0a');if(_0x27b4b0[_0xe3d454(0xfa)]>0x0){console['error'](_0xe3d454(0x150));for(const _0x482467 of _0x27b4b0){console[_0xe3d454(0x12a)]('\x20\x20'+a39_0x2185ed[_0xe3d454(0xfc)]('+')+'\x20'+_0x482467);}console[_0xe3d454(0x12a)]('');}if(_0x1a2aa1[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)])for(const _0x21ed7a of _0x1a2aa1){const _0x357e61=_0x21ed7a[_0xe3d454(0xf3)]?_0x21ed7a[_0xe3d454(0xf3)]+'/'+_0x21ed7a['yamlConfig'][_0xe3d454(0xe4)]:_0x21ed7a[_0xe3d454(0xf6)][_0xe3d454(0xe4)],_0x196285=_0x21ed7a[_0xe3d454(0xf6)]['activations']?.[_0xe3d454(0xfa)]||0x0,_0x86aeb8=_0x196285>0x0?a39_0x2185ed['dim']('\x20['+_0x196285+'\x20activations]'):'';console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x14f)](_0xe3d454(0x104))+'\x20'+_0x357e61+_0x86aeb8),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c)),_0x21ed7a[_0xe3d454(0x15d)]&&console['error'](_0x21ed7a[_0xe3d454(0x15d)]),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}if(_0x46f89b[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)])for(const _0x356d51 of _0x46f89b){const _0x255dff=_0x356d51[_0xe3d454(0x159)]?_0xd4dfc4[_0xe3d454(0x13b)](_0x356d51[_0xe3d454(0x159)][_0xe3d454(0xdc)]())||'':'',_0x436b81=_0x255dff?_0x255dff+'/'+_0x356d51[_0xe3d454(0xe4)]:_0x356d51[_0xe3d454(0xe4)],_0x568953=_0x3ad5cb[_0xe3d454(0x13b)](_0x356d51['id'])||[],_0xb766e8=_0x568953[_0xe3d454(0xfa)]>0x0?a39_0x2185ed[_0xe3d454(0x14a)]('\x20['+_0x568953[_0xe3d454(0xfa)]+_0xe3d454(0x149)):'';console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0xd5))+'\x20'+_0x436b81+_0xb766e8),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));const _0x2b301e=segmentWithActivationsToYaml(_0x356d51,_0x568953,undefined,_0x141957,_0x1068ba),_0x55880a=segmentToYamlString(_0x2b301e),_0x32e34b=generateDiff(_0x55880a,'');console[_0xe3d454(0x12a)](formatDiffWithColors(_0x32e34b)),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}const _0x10ff80=_0x59bd46['filter'](_0x363041=>!_0x363041[_0xe3d454(0xf2)]&&_0x363041[_0xe3d454(0x15d)]);if(_0x10ff80[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)])for(const _0x4d64f8 of _0x10ff80){const _0x1d60f2=_0x4d64f8[_0xe3d454(0xf3)]?_0x4d64f8[_0xe3d454(0xf3)]+'/'+_0x4d64f8[_0xe3d454(0xf6)][_0xe3d454(0xe4)]:_0x4d64f8[_0xe3d454(0xf6)][_0xe3d454(0xe4)];console['error']('\x0a'+a39_0x2185ed[_0xe3d454(0xd6)]('Changes\x20to:')+'\x20'+_0x1d60f2),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c)),console['error'](_0x4d64f8[_0xe3d454(0x15d)]),console['error']('─'[_0xe3d454(0xee)](0x3c));}if(_0xfd615b[_0xe3d454(0xfa)]>0x0)for(const _0x59ca33 of _0xfd615b){const _0x44622e=_0x59ca33[_0xe3d454(0xf3)]?_0x59ca33['folderPath']+'/'+_0x59ca33[_0xe3d454(0xf6)]['name']:_0x59ca33['yamlConfig'][_0xe3d454(0xe4)];console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x14f)](_0xe3d454(0x143))+'\x20'+_0x44622e),console[_0xe3d454(0x12a)]('─'['repeat'](0x3c)),_0x59ca33[_0xe3d454(0x15d)]&&console[_0xe3d454(0x12a)](_0x59ca33['diff']),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}const _0xa3ef3=_0x5b5905['filter'](_0x40f58a=>!_0x40f58a[_0xe3d454(0xf2)]&&_0x40f58a[_0xe3d454(0x15d)]);if(_0xa3ef3[_0xe3d454(0xfa)]>0x0)for(const _0x44e707 of _0xa3ef3){const _0x1b8a44=_0x44e707[_0xe3d454(0xf3)]?_0x44e707[_0xe3d454(0xf3)]+'/'+_0x44e707['yamlConfig']['name']:_0x44e707[_0xe3d454(0xf6)][_0xe3d454(0xe4)];console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0xd6)]('Changes\x20to\x20journey:')+'\x20'+_0x1b8a44),console['error']('─'[_0xe3d454(0xee)](0x3c)),console[_0xe3d454(0x12a)](_0x44e707[_0xe3d454(0x15d)]),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}if(_0x389169[_0xe3d454(0xfa)]>0x0)for(const _0x3265c2 of _0x389169){const _0x3d5899=_0x3265c2[_0xe3d454(0x120)]?_0xd4dfc4[_0xe3d454(0x13b)](_0x3265c2[_0xe3d454(0x120)])||'':'',_0x595358=_0x3d5899?_0x3d5899+'/'+_0x3265c2[_0xe3d454(0x166)]:_0x3265c2[_0xe3d454(0x166)];console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0xe1))+'\x20'+_0x595358),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c)),console[_0xe3d454(0x12a)](a39_0x2185ed['red'](_0xe3d454(0x169))),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}if(_0x458cc3['dryRun'])return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0x101))),0x0;const _0x197b07=_0x458cc3[_0xe3d454(0x113)]?![]:_0x1a2aa1['length']>0x0||_0x3ef934['length']>0x0||_0x46f89b[_0xe3d454(0xfa)]>0x0,_0x2c752c=_0xfd615b[_0xe3d454(0xfa)]>0x0||_0xdd022f[_0xe3d454(0xfa)]>0x0||_0x389169['length']>0x0,_0x3fb6d5=_0x458cc3[_0xe3d454(0x113)]?![]:_0x159629['length']>0x0,_0x2999ac=_0x27b4b0[_0xe3d454(0xfa)]>0x0;if(!_0x197b07&&!_0x2c752c&&!_0x3fb6d5&&!_0x2999ac){const _0x126e57=_0x458cc3[_0xe3d454(0x113)]?_0xe3d454(0x115):_0xe3d454(0xe8);console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x14f)](_0x126e57));if(_0x4769dc&&_0x5d58c2[_0xe3d454(0xfa)]===0x1){const _0x49344a=_0x5d58c2[0x0];if(_0x49344a[_0xe3d454(0x133)]?.['id']){const _0x5a8bad=getConsoleNextUrl(_0x458cc3[_0xe3d454(0x142)],_0xe3d454(0x161)+_0x212b14+'/e/'+_0x49344a['existingSegment']['id']+_0xe3d454(0xdb));console[_0xe3d454(0x12a)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x2185ed[_0xe3d454(0xf0)](_0x5a8bad));}}if(_0x4769dc&&_0x1f5951[_0xe3d454(0xfa)]===0x1){const _0xd28561=_0x1f5951[0x0];if(_0xd28561[_0xe3d454(0x14c)]?.['id']){const _0x18e03b=getConsoleNextUrl(_0x458cc3[_0xe3d454(0x142)],_0xe3d454(0x161)+_0x212b14+_0xe3d454(0x11b)+_0xd28561[_0xe3d454(0x14c)]['id']+'/j/da/je');console[_0xe3d454(0x12a)]('\x20\x20'+a39_0x2185ed[_0xe3d454(0xf0)](_0x18e03b));}}return 0x0;}const _0x399ceb=_0x458cc3[_0xe3d454(0x113)]?_0xfd615b[_0xe3d454(0xfa)]+_0xdd022f['length']+_0x389169[_0xe3d454(0xfa)]+_0x27b4b0[_0xe3d454(0xfa)]:_0x1a2aa1[_0xe3d454(0xfa)]+_0x3ef934[_0xe3d454(0xfa)]+_0x46f89b['length']+_0xfd615b[_0xe3d454(0xfa)]+_0xdd022f[_0xe3d454(0xfa)]+_0x389169[_0xe3d454(0xfa)]+_0x27b4b0[_0xe3d454(0xfa)]+_0x159629[_0xe3d454(0xfa)];if(!_0x458cc3[_0xe3d454(0x118)]&&_0x399ceb>0x0){if(!isInteractive())return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x121)),_0xe3d454(0x153)),console['error'](a39_0x2185ed['dim'](_0xe3d454(0x147))),0x1;const _0x3e7c8a=await confirmKey('Push\x20'+_0x399ceb+_0xe3d454(0x108));if(!_0x3e7c8a)return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0x15b))),0x1;}const _0x1cc92f={'withProgress':async(_0x236fde,_0x325538)=>{const _0x339e52=_0xe3d454,_0x44912d=await withSpinner(_0x236fde,_0x325538,{'verbose':_0x458cc3[_0x339e52(0x116)]});return{'data':_0x44912d[_0x339e52(0x103)]};},'logInfo':_0x20efc4=>console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xfc)]('✔\x20'+_0x20efc4)),'logSuccess':_0x52df48=>console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x14f)]('✔\x20'+_0x52df48)),'logWarning':_0x34c6c3=>console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)]('⚠\x20'+_0x34c6c3)),'logDeleted':_0x532bb9=>console['error'](a39_0x2185ed[_0xe3d454(0x12b)]('✔\x20'+_0x532bb9))},_0x2c0ee9={'segment':_0x36dbe7[_0xe3d454(0x16b)],'journey':_0x36dbe7[_0xe3d454(0x10c)],'user':_0x36dbe7[_0xe3d454(0xf5)],'connection':_0x36dbe7[_0xe3d454(0xd7)]};_0x27b4b0[_0xe3d454(0xfa)]>0x0&&(_0x237422=await executePushFolders(_0x2c0ee9,_0x27b4b0,_0x237422,{'parentId':_0x212b14},_0x1cc92f));const _0x4a9d72={'rootFolderId':_0x44f244,'folderPathToId':_0x237422,'folderIdToPath':_0xd4dfc4,'segmentNameToId':_0xbf7f0,'activationsBySegmentId':_0x3ad5cb,'emailToIdMap':_0x130b41,'idToEmailMap':_0x141957,'connectionNameToIdMap':_0x59aab1[_0xe3d454(0x15a)],'connectionIdToNameMap':_0x59aab1[_0xe3d454(0x130)],'connectionNameToTypeMap':_0x49dfca},_0x3fbce0=await executePushSegments(_0x2c0ee9,_0x458cc3['journeysOnly']?[]:_0x59bd46,_0x4a9d72,{'parentId':_0x212b14},_0x1cc92f),_0x1b698d=_0x3fbce0[_0xe3d454(0x10d)],_0x192808=_0x3fbce0['updated'],_0x40ffb3=_0x3fbce0['activations'][_0xe3d454(0x10d)],_0x511bcf=_0x3fbce0['activations'][_0xe3d454(0x141)],_0x58b94d=_0x3fbce0[_0xe3d454(0xe2)][_0xe3d454(0x135)];let _0x4b8fef;if(_0x4769dc&&_0x59bd46[_0xe3d454(0xfa)]===0x1){const _0x1f8871=_0x59bd46[0x0];_0x4b8fef=_0x1f8871['existingSegment']?.['id']??_0x3fbce0[_0xe3d454(0xe9)][_0xe3d454(0x13b)](_0x1f8871[_0xe3d454(0xf6)][_0xe3d454(0xe4)]);}const _0x2c1011=await executePushSegmentDeletions(_0x2c0ee9,_0x458cc3['journeysOnly']?[]:_0x46f89b,_0x1cc92f);let _0x30cc6b=0x0,_0x1b542d=0x0,_0x364503=0x0;const _0x5df265=new Map(_0xbf7f0);for(const [_0x3c298b,_0x12ecc4]of _0x3fbce0[_0xe3d454(0xe9)]){_0x5df265['set'](_0x3c298b,_0x12ecc4);}if(_0x5b5905[_0xe3d454(0xfa)]>0x0){const _0x10fccf={..._0x4a9d72,'segmentNameToId':_0x5df265,'existingSegments':_0x130922,'activationContext':_0x2ea0c5},_0x1849c0=await executePushJourneys(_0x2c0ee9,_0x5b5905,_0x10fccf,{'parentId':_0x212b14,'rootFolderId':_0x44f244,'verbose':_0x458cc3[_0xe3d454(0x116)]},_0x1cc92f);_0x30cc6b=_0x1849c0[_0xe3d454(0x10d)],_0x1b542d=_0x1849c0[_0xe3d454(0x141)];if(_0x4769dc&&_0x1849c0[_0xe3d454(0x158)][_0xe3d454(0xfa)]===0x1){const _0x17549d=_0x1849c0[_0xe3d454(0x158)][0x0];if(_0x17549d[_0xe3d454(0xf1)]){const _0x2b5e6f=getConsoleNextUrl(_0x458cc3[_0xe3d454(0x142)],_0xe3d454(0x161)+_0x212b14+_0xe3d454(0x11b)+_0x17549d[_0xe3d454(0xf1)]+'/j/da/je');console[_0xe3d454(0x12a)]('\x20\x20'+a39_0x2185ed['cyan'](_0x2b5e6f));}}}for(const _0x24b7a7 of _0x389169){console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x24b7a7[_0xe3d454(0x166)])),_0x364503++;}const _0x2c8bca=[];if(_0x1b698d>0x0)_0x2c8bca[_0xe3d454(0x12d)](_0x1b698d+_0xe3d454(0xf8));if(_0x192808>0x0)_0x2c8bca[_0xe3d454(0x12d)](_0x192808+_0xe3d454(0x13d));if(_0x2c1011>0x0)_0x2c8bca[_0xe3d454(0x12d)](_0x2c1011+_0xe3d454(0x11c));const _0x5b7eea=[];if(_0x30cc6b>0x0)_0x5b7eea[_0xe3d454(0x12d)](_0x30cc6b+_0xe3d454(0xf8));if(_0x1b542d>0x0)_0x5b7eea[_0xe3d454(0x12d)](_0x1b542d+_0xe3d454(0x13d));if(_0x364503>0x0)_0x5b7eea[_0xe3d454(0x12d)](_0x364503+_0xe3d454(0x11c));const _0x2615cf=[];if(_0x40ffb3>0x0)_0x2615cf[_0xe3d454(0x12d)](_0x40ffb3+_0xe3d454(0xf8));if(_0x511bcf>0x0)_0x2615cf[_0xe3d454(0x12d)](_0x511bcf+_0xe3d454(0x13d));if(_0x58b94d>0x0)_0x2615cf[_0xe3d454(0x12d)](_0x58b94d+'\x20deleted');console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x14f)](_0xe3d454(0x127)));_0x2c8bca['length']>0x0&&!_0x458cc3[_0xe3d454(0x113)]&&console['error'](_0xe3d454(0xfb)+_0x2c8bca[_0xe3d454(0x110)](',\x20'));_0x5b7eea[_0xe3d454(0xfa)]>0x0&&console[_0xe3d454(0x12a)]('\x20\x20Journeys:\x20'+_0x5b7eea[_0xe3d454(0x110)](',\x20'));_0x2615cf[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)]&&console[_0xe3d454(0x12a)](_0xe3d454(0x156)+_0x2615cf['join'](',\x20'));if(_0x4b8fef){const _0x362586=getConsoleNextUrl(_0x458cc3['site'],_0xe3d454(0x161)+_0x212b14+'/e/'+_0x4b8fef+'/sb/da/esr');console[_0xe3d454(0x12a)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x2185ed[_0xe3d454(0xf0)](_0x362586));}return 0x0;}}
|
|
1
|
+
const a39_0x53e847=a39_0x20a9;function a39_0x5322(){const _0x2f6bda=['Changes\x20to:','4589760rifIZA','journeyId','listSegments','New\x20journey:','journeyBundleName','\x20updated','createdAt','journey','message','Scoped\x20to\x20folder:\x20','set','yellow','parentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Delete\x20segment:','dim','parent_name','Delete\x20journey:','\x27...','\x20unchanged','\x0a✔\x20Push\x20complete','dryRun','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','relationships','execute','Preparing\x20journeys...','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20delete','yamlConfig','filter','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Error:\x20','state','red','journeys','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getOutputSchemaWithCache','type','existingJourney','folderPath','nameToType','repeat','toCreate','folders','file','deleted','updatedAt','journeysOnly','results','\x0aError:','\x20YAML\x20files\x20found','yes','7497152ErNKVR','verbose','Site:\x20','resolveParentId','site','cwd','\x0aPush\x20summary\x20for\x20\x27','listFolders','filePath','segment\x20or\x20journey','errorCode','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment:push','Fetching\x20existing\x20activations...','existingSegment','error','delete','\x20new','get','parentFolder','\x20\x20\x20\x20','blue','\x20folders\x20to\x20create','name','endsWith','(Journey\x20will\x20be\x20deleted)','paused','changed','Resolving\x20parent\x20segment\x20\x27','green','isScoped','segment','segments','/e/','New\x20segment:','nameToId','\x20\x20Journeys:\x20','updated','scopedFolderPath','getJourney','list','buildUserMaps','idToName','Fetching\x20connections\x20for\x20name\x20resolution...','folderId','created','data','Changes\x20to\x20journey:','description','\x20\x20📊\x20Segments:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','cyan','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)','add','diff','\x0aValidation\x20failed:','toUpdate','map','439538qZwKpB','\x20\x20Source:\x20','isNew','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','14dowAmu','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','listJourneysWithDetailsFromParentSegment','listActivations','\x20\x20Activations:','/app/ps/','.yaml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20deleted','segmentFolderId','push','no_parent','\x20changed','versionNumber','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','all','1328344TOZGek','connection','journeyBundleId','unchanged','1029048YcZPvZ','join','activations','createdSegmentIds','3253761XOqapC','length','new','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','464428icQAmO','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','targetDir','Fetching\x20existing\x20data...','\x20created','helpText','setPhase','Aborted.','then','toDelete','\x20activations]','/sb/da/esr','getParent'];a39_0x5322=function(){return _0x2f6bda;};return a39_0x5322();}(function(_0x24f2c0,_0xb5a7bf){const _0x1d2c40=a39_0x20a9,_0x559bb9=_0x24f2c0();while(!![]){try{const _0x598e97=-parseInt(_0x1d2c40(0x17b))/0x1+-parseInt(_0x1d2c40(0x191))/0x2+-parseInt(_0x1d2c40(0x199))/0x3+parseInt(_0x1d2c40(0x19d))/0x4+parseInt(_0x1d2c40(0x1ab))/0x5+-parseInt(_0x1d2c40(0x195))/0x6+parseInt(_0x1d2c40(0x180))/0x7*(parseInt(_0x1d2c40(0x141))/0x8);if(_0x598e97===_0xb5a7bf)break;else _0x559bb9['push'](_0x559bb9['shift']());}catch(_0x1d268e){_0x559bb9['push'](_0x559bb9['shift']());}}}(a39_0x5322,0x85ebe));import{BaseCommand}from'./command.js';function a39_0x20a9(_0x647cbf,_0x4d89c8){_0x647cbf=_0x647cbf-0x11b;const _0x5322f9=a39_0x5322();let _0x20a912=_0x5322f9[_0x647cbf];return _0x20a912;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x335156 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_0x53e847(0x158)]=a39_0x53e847(0x14d);['description']=a39_0x53e847(0x122);async[a39_0x53e847(0x124)](_0x3f48fb){const _0x5945bc=a39_0x53e847,{options:_0x5c7fea,args:_0x4a34d7,tdx:_0x1a0847}=_0x3f48fb,_0x51827d=_0x5c7fea,_0x52d3b9=await resolveTarget({'arg':_0x4a34d7[0x0],'contextParent':_0x5c7fea[_0x5945bc(0x1b7)],'cwd':process[_0x5945bc(0x146)]()});if(!isSuccessfulResolution(_0x52d3b9))return _0x52d3b9[_0x5945bc(0x14b)]===_0x5945bc(0x18b)?(console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x187))),console[_0x5945bc(0x150)](_0x5945bc(0x175)),console[_0x5945bc(0x150)]('\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'](_0x5945bc(0x17f))):(console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x12c)+_0x52d3b9[_0x5945bc(0x1b3)]+'\x0a')),_0x52d3b9[_0x5945bc(0x1a2)]&&console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x174)](_0x52d3b9[_0x5945bc(0x1a2)]))),0x1;if(_0x52d3b9[_0x5945bc(0x132)]===_0x5945bc(0x11c))return console['error'](a39_0x335156[_0x5945bc(0x12e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x52d3b9[_0x5945bc(0x19f)]+'\x0a')),console['error'](a39_0x335156[_0x5945bc(0x174)](_0x5945bc(0x181))),0x1;const _0x3c9d7e=_0x52d3b9['parentName'],_0x31a92b=_0x52d3b9[_0x5945bc(0x19f)],_0x247c47=_0x52d3b9['type']===_0x5945bc(0x139)?_0x52d3b9[_0x5945bc(0x149)]:undefined,_0x2f112b=getScopedDetails(_0x52d3b9),_0x158e7c=_0x2f112b?.[_0x5945bc(0x15f)]??![],_0x30a00c=_0x2f112b?.[_0x5945bc(0x167)]??'';if(!existsSync(_0x31a92b))return console['error'](a39_0x335156[_0x5945bc(0x12e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x31a92b+'\x0a')),console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x174)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x51827d['verbose']&&(console['error'](_0x5945bc(0x143)+_0x51827d[_0x5945bc(0x145)]),console[_0x5945bc(0x150)]('Parent\x20segment:\x20'+_0x3c9d7e),console[_0x5945bc(0x150)]('Source\x20directory:\x20'+_0x31a92b),_0x158e7c&&console['error'](_0x5945bc(0x1b4)+_0x30a00c));const _0x86aad5=await withSpinner(_0x5945bc(0x15d)+_0x3c9d7e+_0x5945bc(0x11e),()=>_0x1a0847[_0x5945bc(0x160)][_0x5945bc(0x144)](_0x3c9d7e),{'verbose':_0x51827d[_0x5945bc(0x142)]}),_0x2d80ec=_0x86aad5['data'],{parentSegmentResult:_0x2e6f25,segmentsResult:_0x326297,foldersResult:_0x53d5f2,journeysWithDetailsResult:_0x32660f,userMaps:_0x2b2590}=await withSpinner(_0x5945bc(0x1a0),async()=>{const _0x4042df=_0x5945bc,[_0x1930d0,_0x552522,_0x3095b6,_0x119223,_0x26d67b]=await Promise['all']([_0x1a0847[_0x4042df(0x160)][_0x4042df(0x1a9)](_0x2d80ec),_0x1a0847[_0x4042df(0x160)][_0x4042df(0x1ad)](_0x2d80ec),_0x1a0847['segment'][_0x4042df(0x148)](_0x2d80ec),_0x1a0847[_0x4042df(0x1b2)][_0x4042df(0x182)](_0x2d80ec,{'includeAllVersions':!![]}),_0x1a0847['user'][_0x4042df(0x16a)]()]);return{'parentSegmentResult':_0x1930d0,'segmentsResult':_0x552522,'foldersResult':_0x3095b6,'journeysWithDetailsResult':_0x119223,'userMaps':_0x26d67b};},{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x226958=>_0x226958[_0x5945bc(0x16f)]),_0x449a6e=_0x2e6f25,_0x4930fa=extractRootFolderId(_0x449a6e),_0x3b0a44=_0x326297,_0xac1f0a=_0x53d5f2,{journeys:_0x597488,activationStepsById:_0x5da580}=_0x32660f,_0x584b3d=new Map(_0x597488[_0x5945bc(0x17a)](_0x2aa6c1=>[_0x2aa6c1['id'],_0x2aa6c1])),_0x2e8b03=_0x597488[_0x5945bc(0x17a)](_0x21d721=>({'id':_0x21d721['id'],'name':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x158)],'journeyBundleName':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x1af)]||'','journeyBundleId':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x193)]||'','versionNumber':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x18d)],'description':_0x21d721['attributes'][_0x5945bc(0x171)],'state':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x12d)],'paused':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x15b)],'audienceId':_0x21d721[_0x5945bc(0x17e)]['audienceId'],'folderId':_0x21d721[_0x5945bc(0x123)]?.[_0x5945bc(0x154)]?.['data']?.['id'],'createdAt':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x1b1)],'updatedAt':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x13b)]})),{emailToId:_0x149a4b,idToEmail:_0x208b1e}=_0x2b2590,_0x1e41fa=await withSpinner(_0x5945bc(0x16c),async()=>{const _0x36b014=_0x5945bc,_0x511178=await _0x1a0847['connection'][_0x36b014(0x169)]();return buildConnectionMaps(_0x511178);},{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x3c7bd6=>_0x3c7bd6[_0x5945bc(0x16f)]),_0x46e7e9=_0x1e41fa[_0x5945bc(0x164)],_0x37ad9d=_0x1e41fa[_0x5945bc(0x16b)],_0x22d826=_0x1e41fa[_0x5945bc(0x135)],_0x284e46={'emailToIdMap':_0x149a4b,'connectionNameToIdMap':_0x46e7e9,'connectionNameToTypeMap':_0x22d826,'getSchema':_0x8c1937=>_0x1a0847[_0x5945bc(0x192)][_0x5945bc(0x131)](_0x8c1937)};let {pathToId:_0x2b4e3e,idToPath:_0x1e7128}=buildFolderMaps(_0xac1f0a);const _0xd2449=buildSegmentLookupMap(_0x3b0a44,_0x1e7128),_0x18830e=buildSegmentNameToIdMap(_0x3b0a44),_0x42fb4c=buildJourneyBundleLookupMap(_0x2e8b03,_0x1e7128);let _0x25a692;if(_0x247c47){if(!_0x247c47[_0x5945bc(0x159)]('.yml')&&!_0x247c47['endsWith'](_0x5945bc(0x186)))return console[_0x5945bc(0x150)](a39_0x335156['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x247c47+'\x0a')),0x1;_0x25a692=[_0x247c47];}else _0x25a692=findYamlFiles(_0x31a92b);if(_0x25a692[_0x5945bc(0x19a)]===0x0)return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x1b8)+_0x31a92b+'\x0a')),console[_0x5945bc(0x150)](a39_0x335156['cyan'](_0x5945bc(0x127))),0x1;let _0x1bfe36,_0x5b8aec;try{const _0x535149=parseAndClassifyYamlFiles(_0x25a692,_0x31a92b,{'skipSegments':_0x51827d[_0x5945bc(0x13c)]});_0x1bfe36=_0x535149[_0x5945bc(0x161)],_0x5b8aec=_0x535149[_0x5945bc(0x12f)];const _0x12ee3f=validateParsedFiles(_0x535149,_0x31a92b);if(_0x12ee3f[_0x5945bc(0x19a)]>0x0)return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x178))),console['error'](formatValidationErrors(_0x12ee3f)),console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x18f))),0x1;}catch(_0x404c18){return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)]('Error\x20parsing\x20YAML:\x20'+(_0x404c18 instanceof Error?_0x404c18[_0x5945bc(0x1b3)]:_0x404c18))),0x1;}if(_0x1bfe36[_0x5945bc(0x19a)]===0x0&&_0x5b8aec[_0x5945bc(0x19a)]===0x0){const _0x4a4cff=_0x51827d[_0x5945bc(0x13c)]?'journey':_0x5945bc(0x14a);return console[_0x5945bc(0x150)](a39_0x335156['yellow']('No\x20'+_0x4a4cff+_0x5945bc(0x13f))),0x0;}const _0x365879=new Map();_0x3b0a44[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&await withSpinner(_0x5945bc(0x14e),async()=>{await batchAsync(_0x3b0a44,async _0x522532=>{const _0x5537ab=a39_0x20a9,_0x33ba30=await _0x1a0847[_0x5537ab(0x160)][_0x5537ab(0x183)](_0x2d80ec,_0x522532['id']);_0x365879[_0x5537ab(0x1b5)](_0x522532['id'],_0x33ba30);});},{'verbose':_0x51827d[_0x5945bc(0x142)]});const {segmentFiles:_0x3a1965,foldersToCreate:_0x101586}=await prepareSegmentFiles(_0x1bfe36,{'segmentByFolderAndName':_0xd2449,'activationsBySegmentId':_0x365879,'folderPathToId':_0x2b4e3e,'idToEmailMap':_0x208b1e,'connectionIdToNameMap':_0x37ad9d},_0x284e46,_0x158e7c,_0x30a00c),_0x328b25=_0x247c47?[]:findSegmentsToDelete(_0x3b0a44,_0x1bfe36[_0x5945bc(0x17a)](({yamlConfig:_0x5aa020,folderPath:_0x6a0962})=>({'yamlConfig':_0x5aa020,'folderPath':resolveTDFolderPath(_0x6a0962,_0x158e7c,_0x30a00c)})),_0x1e7128,_0x30a00c,_0x158e7c),{journeyFiles:_0x5f279c,foldersToCreate:_0x360b98}=await withProgressSpinner(_0x5945bc(0x125),async _0x31403d=>prepareJourneyFiles(_0x5b8aec,{'fetchJourney':async _0x90d7e7=>_0x1a0847[_0x5945bc(0x1b2)][_0x5945bc(0x168)](_0x90d7e7['journeyId']),'journeyBundlesByFolderAndName':_0x42fb4c,'folderPathToId':_0x2b4e3e,'idToEmailMap':_0x208b1e,'connectionIdToNameMap':_0x37ad9d,'existingSegments':_0x3b0a44,'parentId':_0x2d80ec,'deps':_0x1a0847,'progress':{'update':_0x1fffac=>{const _0xc86316=_0x5945bc;_0x31403d[_0xc86316(0x1a3)](_0x1fffac),_0x51827d[_0xc86316(0x142)]&&console[_0xc86316(0x150)]('\x20\x20'+_0x1fffac);}},'journeyById':_0x584b3d,'activationStepsById':_0x5da580},_0x158e7c,_0x30a00c),{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x2602d3=>_0x2602d3[_0x5945bc(0x16f)]);for(const _0x530f78 of _0x360b98){_0x101586[_0x5945bc(0x176)](_0x530f78);}const _0xe901f2=_0x247c47?[]:findJourneysToDelete(_0x2e8b03,_0x5b8aec['map'](({yamlConfig:_0x311d17,folderPath:_0x10ae5c})=>({'yamlConfig':_0x311d17,'folderPath':resolveTDFolderPath(_0x10ae5c,_0x158e7c,_0x30a00c)})),_0x1e7128,_0x30a00c,_0x158e7c),_0x4a46c7=calculatePushStats(_0x3a1965,_0x5f279c,_0x101586,_0x328b25,_0xe901f2,!!_0x51827d[_0x5945bc(0x151)],!!_0x51827d['journeysOnly']),_0x370fab=_0x4a46c7[_0x5945bc(0x161)]['new'],_0x55f1d2=_0x4a46c7[_0x5945bc(0x161)][_0x5945bc(0x15c)],_0xd0b07c=_0x4a46c7[_0x5945bc(0x161)][_0x5945bc(0x194)],_0x4d94a2=_0x4a46c7['segments'][_0x5945bc(0x1a6)],_0x35cf50=_0x4a46c7[_0x5945bc(0x138)][_0x5945bc(0x137)],_0x22565d=_0x4a46c7[_0x5945bc(0x12f)][_0x5945bc(0x19b)],_0x154aef=_0x4a46c7[_0x5945bc(0x12f)][_0x5945bc(0x15c)],_0x233a2e=_0x4a46c7['journeys'][_0x5945bc(0x194)],_0x2d5aca=_0x4a46c7[_0x5945bc(0x12f)]['toDelete'],_0x5e4dc7=_0x4a46c7[_0x5945bc(0x197)][_0x5945bc(0x190)],_0x500459=_0x4a46c7['activations'][_0x5945bc(0x137)],_0x20c828=_0x4a46c7[_0x5945bc(0x197)][_0x5945bc(0x179)],_0x3e8b0f=_0x4a46c7[_0x5945bc(0x197)]['toDelete'];console[_0x5945bc(0x150)](_0x5945bc(0x147)+_0x3c9d7e+'\x27:');_0x35cf50[_0x5945bc(0x19a)]>0x0&&console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156['blue']('📁\x20'+_0x35cf50[_0x5945bc(0x19a)]+_0x5945bc(0x157)));if(!_0x51827d[_0x5945bc(0x13c)]){console[_0x5945bc(0x150)](_0x5945bc(0x172)),console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x370fab[_0x5945bc(0x19a)]+_0x5945bc(0x152))),console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x55f1d2[_0x5945bc(0x19a)]+_0x5945bc(0x18c)));if(_0x4d94a2[_0x5945bc(0x19a)]>0x0)console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x12e)]('-\x20'+_0x4d94a2[_0x5945bc(0x19a)]+_0x5945bc(0x128)));else _0x328b25[_0x5945bc(0x19a)]>0x0&&!_0x51827d['delete']&&console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x11b)](_0x328b25[_0x5945bc(0x19a)]+_0x5945bc(0x14c)));console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x11b)]('=\x20'+_0xd0b07c[_0x5945bc(0x19a)]+_0x5945bc(0x11f)));}if(_0x5f279c['length']>0x0||_0xe901f2[_0x5945bc(0x19a)]>0x0){console[_0x5945bc(0x150)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x22565d[_0x5945bc(0x19a)]+_0x5945bc(0x152))),console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x154aef[_0x5945bc(0x19a)]+_0x5945bc(0x18c)));if(_0x2d5aca['length']>0x0)console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x12e)]('-\x20'+_0x2d5aca[_0x5945bc(0x19a)]+'\x20to\x20delete'));else _0xe901f2[_0x5945bc(0x19a)]>0x0&&!_0x51827d['delete']&&console[_0x5945bc(0x150)]('\x20\x20\x20\x20'+a39_0x335156[_0x5945bc(0x11b)](_0xe901f2[_0x5945bc(0x19a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156['dim']('=\x20'+_0x233a2e[_0x5945bc(0x19a)]+_0x5945bc(0x11f)));}_0x5e4dc7['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&(console['error'](''),console['error'](_0x5945bc(0x184)),_0x500459[_0x5945bc(0x19a)]>0x0&&console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x500459[_0x5945bc(0x19a)]+'\x20to\x20create')),_0x20c828[_0x5945bc(0x19a)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x20c828['length']+'\x20to\x20update')),_0x3e8b0f[_0x5945bc(0x19a)]>0x0&&console['error'](_0x5945bc(0x155)+a39_0x335156['red']('-\x20'+_0x3e8b0f[_0x5945bc(0x19a)]+_0x5945bc(0x128))));console['error'](_0x5945bc(0x17c)+a39_0x335156[_0x5945bc(0x174)](_0x31a92b)+'\x0a');if(_0x35cf50[_0x5945bc(0x19a)]>0x0){console[_0x5945bc(0x150)]('Folders\x20to\x20create:');for(const _0x1bfc29 of _0x35cf50){console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x156)]('+')+'\x20'+_0x1bfc29);}console[_0x5945bc(0x150)]('');}if(_0x370fab[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x3c6c2a of _0x370fab){const _0x178126=_0x3c6c2a['folderPath']?_0x3c6c2a['folderPath']+'/'+_0x3c6c2a[_0x5945bc(0x129)]['name']:_0x3c6c2a[_0x5945bc(0x129)][_0x5945bc(0x158)],_0x39db2c=_0x3c6c2a[_0x5945bc(0x129)][_0x5945bc(0x197)]?.['length']||0x0,_0xdcdfa6=_0x39db2c>0x0?a39_0x335156[_0x5945bc(0x11b)]('\x20['+_0x39db2c+'\x20activations]'):'';console['error']('\x0a'+a39_0x335156[_0x5945bc(0x15e)](_0x5945bc(0x163))+'\x20'+_0x178126+_0xdcdfa6),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c)),_0x3c6c2a[_0x5945bc(0x177)]&&console[_0x5945bc(0x150)](_0x3c6c2a[_0x5945bc(0x177)]),console[_0x5945bc(0x150)]('─'['repeat'](0x3c));}if(_0x4d94a2[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x18d3c2 of _0x4d94a2){const _0x113f50=_0x18d3c2[_0x5945bc(0x189)]?_0x1e7128[_0x5945bc(0x153)](_0x18d3c2[_0x5945bc(0x189)]['toString']())||'':'',_0x373db3=_0x113f50?_0x113f50+'/'+_0x18d3c2[_0x5945bc(0x158)]:_0x18d3c2[_0x5945bc(0x158)],_0x2ea4ed=_0x365879['get'](_0x18d3c2['id'])||[],_0x234bd2=_0x2ea4ed[_0x5945bc(0x19a)]>0x0?a39_0x335156['dim']('\x20['+_0x2ea4ed[_0x5945bc(0x19a)]+_0x5945bc(0x1a7)):'';console['error']('\x0a'+a39_0x335156['red'](_0x5945bc(0x1b9))+'\x20'+_0x373db3+_0x234bd2),console[_0x5945bc(0x150)]('─'['repeat'](0x3c));const _0x1af375=segmentWithActivationsToYaml(_0x18d3c2,_0x2ea4ed,undefined,_0x208b1e,_0x37ad9d),_0x3634d6=segmentToYamlString(_0x1af375),_0x132f9c=generateDiff(_0x3634d6,'');console['error'](formatDiffWithColors(_0x132f9c)),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c));}const _0x51433e=_0x3a1965[_0x5945bc(0x12a)](_0x4aeb35=>!_0x4aeb35['isNew']&&_0x4aeb35[_0x5945bc(0x177)]);if(_0x51433e[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x28eef5 of _0x51433e){const _0x115a38=_0x28eef5[_0x5945bc(0x134)]?_0x28eef5['folderPath']+'/'+_0x28eef5[_0x5945bc(0x129)]['name']:_0x28eef5['yamlConfig'][_0x5945bc(0x158)];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x1aa))+'\x20'+_0x115a38),console['error']('─'[_0x5945bc(0x136)](0x3c)),console[_0x5945bc(0x150)](_0x28eef5[_0x5945bc(0x177)]),console['error']('─'['repeat'](0x3c));}if(_0x22565d[_0x5945bc(0x19a)]>0x0)for(const _0x5cf674 of _0x22565d){const _0x3fdd9e=_0x5cf674['folderPath']?_0x5cf674['folderPath']+'/'+_0x5cf674[_0x5945bc(0x129)]['name']:_0x5cf674[_0x5945bc(0x129)]['name'];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156['green'](_0x5945bc(0x1ae))+'\x20'+_0x3fdd9e),console[_0x5945bc(0x150)]('─'['repeat'](0x3c)),_0x5cf674[_0x5945bc(0x177)]&&console[_0x5945bc(0x150)](_0x5cf674[_0x5945bc(0x177)]),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c));}const _0x367aee=_0x5f279c['filter'](_0x5284c6=>!_0x5284c6[_0x5945bc(0x17d)]&&_0x5284c6[_0x5945bc(0x177)]);if(_0x367aee[_0x5945bc(0x19a)]>0x0)for(const _0x532d00 of _0x367aee){const _0x1a9aea=_0x532d00[_0x5945bc(0x134)]?_0x532d00[_0x5945bc(0x134)]+'/'+_0x532d00['yamlConfig']['name']:_0x532d00[_0x5945bc(0x129)][_0x5945bc(0x158)];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x170))+'\x20'+_0x1a9aea),console[_0x5945bc(0x150)]('─'['repeat'](0x3c)),console[_0x5945bc(0x150)](_0x532d00[_0x5945bc(0x177)]),console['error']('─'[_0x5945bc(0x136)](0x3c));}if(_0x2d5aca[_0x5945bc(0x19a)]>0x0)for(const _0x285129 of _0x2d5aca){const _0x2b511e=_0x285129[_0x5945bc(0x16d)]?_0x1e7128[_0x5945bc(0x153)](_0x285129[_0x5945bc(0x16d)])||'':'',_0x55fbb5=_0x2b511e?_0x2b511e+'/'+_0x285129[_0x5945bc(0x1af)]:_0x285129['journeyBundleName'];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156['red'](_0x5945bc(0x11d))+'\x20'+_0x55fbb5),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c)),console[_0x5945bc(0x150)](a39_0x335156['red'](_0x5945bc(0x15a))),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c));}if(_0x51827d[_0x5945bc(0x121)])return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x173))),0x0;const _0x18e4cb=_0x51827d[_0x5945bc(0x13c)]?![]:_0x370fab[_0x5945bc(0x19a)]>0x0||_0x55f1d2[_0x5945bc(0x19a)]>0x0||_0x4d94a2[_0x5945bc(0x19a)]>0x0,_0x22c08e=_0x22565d[_0x5945bc(0x19a)]>0x0||_0x154aef['length']>0x0||_0x2d5aca['length']>0x0,_0x329c50=_0x51827d[_0x5945bc(0x13c)]?![]:_0x5e4dc7[_0x5945bc(0x19a)]>0x0,_0x5acbc0=_0x35cf50[_0x5945bc(0x19a)]>0x0;if(!_0x18e4cb&&!_0x22c08e&&!_0x329c50&&!_0x5acbc0){const _0x5b5b81=_0x51827d[_0x5945bc(0x13c)]?_0x5945bc(0x18e):_0x5945bc(0x12b);console['error'](a39_0x335156['green'](_0x5b5b81));if(_0x247c47&&_0xd0b07c[_0x5945bc(0x19a)]===0x1){const _0x38f537=_0xd0b07c[0x0];if(_0x38f537[_0x5945bc(0x14f)]?.['id']){const _0x118bc8=getConsoleNextUrl(_0x51827d['site'],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x38f537[_0x5945bc(0x14f)]['id']+_0x5945bc(0x1a8));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x335156[_0x5945bc(0x174)](_0x118bc8));}}if(_0x247c47&&_0x233a2e['length']===0x1){const _0x1dfb00=_0x233a2e[0x0];if(_0x1dfb00[_0x5945bc(0x133)]?.['id']){const _0x827504=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x1dfb00['existingJourney']['id']+'/j/da/je');console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x174)](_0x827504));}}return 0x0;}const _0x994772=_0x51827d[_0x5945bc(0x13c)]?_0x22565d[_0x5945bc(0x19a)]+_0x154aef[_0x5945bc(0x19a)]+_0x2d5aca['length']+_0x35cf50[_0x5945bc(0x19a)]:_0x370fab[_0x5945bc(0x19a)]+_0x55f1d2[_0x5945bc(0x19a)]+_0x4d94a2[_0x5945bc(0x19a)]+_0x22565d[_0x5945bc(0x19a)]+_0x154aef[_0x5945bc(0x19a)]+_0x2d5aca['length']+_0x35cf50[_0x5945bc(0x19a)]+_0x5e4dc7['length'];if(!_0x51827d[_0x5945bc(0x140)]&&_0x994772>0x0){if(!isInteractive())return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x13e)),_0x5945bc(0x19e)),console[_0x5945bc(0x150)](a39_0x335156['dim'](_0x5945bc(0x19c))),0x1;const _0x294255=await confirmKey('Push\x20'+_0x994772+'\x20changes?');if(!_0x294255)return console['error'](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x1a4))),0x1;}const _0x46a02c={'withProgress':async(_0xee15c1,_0x4589b9)=>{const _0x212afc=_0x5945bc,_0x57dd7f=await withSpinner(_0xee15c1,_0x4589b9,{'verbose':_0x51827d[_0x212afc(0x142)]});return{'data':_0x57dd7f[_0x212afc(0x16f)]};},'logInfo':_0x411636=>console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x156)]('✔\x20'+_0x411636)),'logSuccess':_0x481381=>console['error'](a39_0x335156[_0x5945bc(0x15e)]('✔\x20'+_0x481381)),'logWarning':_0x2e10bc=>console[_0x5945bc(0x150)](a39_0x335156['yellow']('⚠\x20'+_0x2e10bc)),'logDeleted':_0x2eea49=>console['error'](a39_0x335156['red']('✔\x20'+_0x2eea49))},_0x3df71a={'segment':_0x1a0847[_0x5945bc(0x160)],'journey':_0x1a0847['journey'],'user':_0x1a0847['user'],'connection':_0x1a0847[_0x5945bc(0x192)]};_0x35cf50[_0x5945bc(0x19a)]>0x0&&(_0x2b4e3e=await executePushFolders(_0x3df71a,_0x35cf50,_0x2b4e3e,{'parentId':_0x2d80ec},_0x46a02c));const _0x30916a={'rootFolderId':_0x4930fa,'folderPathToId':_0x2b4e3e,'folderIdToPath':_0x1e7128,'segmentNameToId':_0x18830e,'activationsBySegmentId':_0x365879,'emailToIdMap':_0x149a4b,'idToEmailMap':_0x208b1e,'connectionNameToIdMap':_0x1e41fa['nameToId'],'connectionIdToNameMap':_0x1e41fa[_0x5945bc(0x16b)],'connectionNameToTypeMap':_0x22d826},_0x1d8bef=await executePushSegments(_0x3df71a,_0x51827d['journeysOnly']?[]:_0x3a1965,_0x30916a,{'parentId':_0x2d80ec},_0x46a02c),_0x347fc4=_0x1d8bef['created'],_0x4545a1=_0x1d8bef[_0x5945bc(0x166)],_0x52a694=_0x1d8bef['activations'][_0x5945bc(0x16e)],_0x4c80cc=_0x1d8bef[_0x5945bc(0x197)][_0x5945bc(0x166)],_0x2cc842=_0x1d8bef[_0x5945bc(0x197)][_0x5945bc(0x13a)];let _0x373a82;if(_0x247c47&&_0x3a1965['length']===0x1){const _0x117f54=_0x3a1965[0x0];_0x373a82=_0x117f54[_0x5945bc(0x14f)]?.['id']??_0x1d8bef[_0x5945bc(0x198)][_0x5945bc(0x153)](_0x117f54['yamlConfig'][_0x5945bc(0x158)]);}const _0x1d6ac6=await executePushSegmentDeletions(_0x3df71a,_0x51827d['journeysOnly']?[]:_0x4d94a2,_0x46a02c);let _0x580fc0=0x0,_0x2fff22=0x0,_0x13e899=0x0;const _0x26d007=new Map(_0x18830e);for(const [_0x7101fc,_0x31a5d3]of _0x1d8bef['createdSegmentIds']){_0x26d007['set'](_0x7101fc,_0x31a5d3);}if(_0x5f279c['length']>0x0){const _0x19a7ae={..._0x30916a,'segmentNameToId':_0x26d007,'existingSegments':_0x3b0a44,'activationContext':_0x284e46},_0x283824=await executePushJourneys(_0x3df71a,_0x5f279c,_0x19a7ae,{'parentId':_0x2d80ec,'rootFolderId':_0x4930fa,'verbose':_0x51827d[_0x5945bc(0x142)]},_0x46a02c);_0x580fc0=_0x283824['created'],_0x2fff22=_0x283824['updated'];if(_0x247c47&&_0x283824[_0x5945bc(0x13d)]['length']===0x1){const _0x2479d4=_0x283824[_0x5945bc(0x13d)][0x0];if(_0x2479d4[_0x5945bc(0x1ac)]){const _0x4c7f8d=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+'/e/'+_0x2479d4[_0x5945bc(0x1ac)]+'/j/da/je');console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x174)](_0x4c7f8d));}}}for(const _0x41fc4b of _0x2d5aca){console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x41fc4b[_0x5945bc(0x1af)])),_0x13e899++;}const _0x169afa=[];if(_0x347fc4>0x0)_0x169afa[_0x5945bc(0x18a)](_0x347fc4+_0x5945bc(0x1a1));if(_0x4545a1>0x0)_0x169afa[_0x5945bc(0x18a)](_0x4545a1+'\x20updated');if(_0x1d6ac6>0x0)_0x169afa[_0x5945bc(0x18a)](_0x1d6ac6+'\x20deleted');const _0xbdb05d=[];if(_0x580fc0>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x580fc0+_0x5945bc(0x1a1));if(_0x2fff22>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x2fff22+'\x20updated');if(_0x13e899>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x13e899+_0x5945bc(0x188));const _0x582629=[];if(_0x52a694>0x0)_0x582629[_0x5945bc(0x18a)](_0x52a694+'\x20created');if(_0x4c80cc>0x0)_0x582629[_0x5945bc(0x18a)](_0x4c80cc+_0x5945bc(0x1b0));if(_0x2cc842>0x0)_0x582629[_0x5945bc(0x18a)](_0x2cc842+_0x5945bc(0x188));console['error'](a39_0x335156['green'](_0x5945bc(0x120)));_0x169afa['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&console[_0x5945bc(0x150)]('\x20\x20Segments:\x20'+_0x169afa[_0x5945bc(0x196)](',\x20'));_0xbdb05d['length']>0x0&&console['error'](_0x5945bc(0x165)+_0xbdb05d[_0x5945bc(0x196)](',\x20'));_0x582629['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&console[_0x5945bc(0x150)](_0x5945bc(0x126)+_0x582629[_0x5945bc(0x196)](',\x20'));if(_0x373a82){const _0x5b1f00=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x373a82+_0x5945bc(0x1a8));console['error'](_0x5945bc(0x130)+a39_0x335156[_0x5945bc(0x174)](_0x5b1f00));}return 0x0;}}
|