@treasuredata/tdx 2026.3.16 → 2026.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x5505b1=a34_0x151c;(function(_0x4f80b6,_0x3ea665){const _0x4584d2=a34_0x151c,_0x4effc9=_0x4f80b6();while(!![]){try{const _0xab611a=-parseInt(_0x4584d2(0xde))/0x1+parseInt(_0x4584d2(0x13f))/0x2*(parseInt(_0x4584d2(0x101))/0x3)+parseInt(_0x4584d2(0x13a))/0x4+-parseInt(_0x4584d2(0x118))/0x5*(-parseInt(_0x4584d2(0x11f))/0x6)+parseInt(_0x4584d2(0xda))/0x7+parseInt(_0x4584d2(0xfd))/0x8*(-parseInt(_0x4584d2(0xcb))/0x9)+parseInt(_0x4584d2(0xc9))/0xa;if(_0xab611a===_0x3ea665)break;else _0x4effc9['push'](_0x4effc9['shift']());}catch(_0xefb307){_0x4effc9['push'](_0x4effc9['shift']());}}}(a34_0x23c9,0x94248));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x151c(_0xf07bad,_0x2e5bd6){_0xf07bad=_0xf07bad-0xb9;const _0x23c9bd=a34_0x23c9();let _0x151c0a=_0x23c9bd[_0xf07bad];return _0x151c0a;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a34_0x23c9(){const _0x14d230=['utf-8','user','2kEzZKx','format','schedule:create','length','abs','repeat','trino','Schedule\x20deleted:\x20','file','Running\x20schedule...','h\x20ago','show','schedule:show','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','log','start_at','d\x20ago','entries','jsonl','\x20scheduled\x20quer','tsv','5505320nLDILv','execute','1684494ttMvbY','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','List\x20scheduled\x20queries','Update\x20a\x20scheduled\x20query','padEnd','schedule:update','ended_at','\x20(use\x20--limit\x20to\x20see\x20more)','args','Searching\x20scheduled\x20queries\x20matching\x20\x22','No\x20scheduled\x20queries\x20found','round','trim','\x22...','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','2573032wrDTHP','\x20\x20Timezone:\x20','cron','Showing\x20first\x20','258091sdcDdA','yes','verbose','next_run_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Cancelled','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','priority','cyan','Create\x20a\x20scheduled\x20query','scheduled_at','map','statusIcon','last_job','limit','m\x20ago','\x20\x20Cron:\x20','updated_at','create','\x20\x20→\x20','history','nextRun','time','count','delay','retryLimit','(unnamed)','schedule:delete','toLocaleDateString','\x20\x20Time:\x20','24VFNaZa','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','executing_user_id','query','732873xzxpVc','Failed\x20to\x20read\x20file:\x20','retry_limit','schedules','ies','\x20\x20Type:\x20','delete','run','\x20job','Schedule\x20run\x20submitted:\x20','in\x20','Updating\x20schedule:\x20','user_name','\x20\x20Num:\x20','lastRun','...','getTime','num','json','error','created_at','data','pagination','123635vBkunN','queries','Schedule\x20created:\x20','jobs','from','success','engine_version','42KfqBHB','\x20matching\x20\x22','Found\x20','job_id','keys','site','result','validate','Getting\x20schedule\x20history...','status','description','name','queryUrl','Creating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Deleting\x20schedule...','database','/app/queries/editor?queryId=','Schedule\x20updated:\x20','soon','Listing\x20scheduled\x20queries...','Creating\x20schedule:\x20','Show\x20schedule\x20details','timezone','Delete\x20a\x20scheduled\x20query','type','Running\x20schedule:\x20','363572mmPtSa','engineVersion','max'];a34_0x23c9=function(){return _0x14d230;};return a34_0x23c9();}import a34_0x233df7 from'chalk';function formatRelativeTime(_0xa4c81f){const _0x396c4a=a34_0x151c,_0x29422c=new Date(_0xa4c81f),_0x2cadff=new Date(),_0x3a85dc=_0x29422c[_0x396c4a(0x111)]()-_0x2cadff['getTime'](),_0x205792=Math[_0x396c4a(0x143)](_0x3a85dc)/0x3e8,_0x5cdd61=_0x3a85dc<0x0;if(_0x205792<0x3c)return _0x5cdd61?'just\x20now':_0x396c4a(0x132);else{if(_0x205792<0xe10){const _0xb973a3=Math[_0x396c4a(0xd6)](_0x205792/0x3c);return _0x5cdd61?_0xb973a3+_0x396c4a(0xee):_0x396c4a(0x10b)+_0xb973a3+'m';}else{if(_0x205792<0x15180){const _0x4423ec=Math[_0x396c4a(0xd6)](_0x205792/0xe10);return _0x5cdd61?_0x4423ec+_0x396c4a(0xbe):_0x396c4a(0x10b)+_0x4423ec+'h';}else{if(_0x205792<0x93a80){const _0x13502e=Math['round'](_0x205792/0x15180);return _0x5cdd61?_0x13502e+_0x396c4a(0xc4):'in\x20'+_0x13502e+'d';}else return _0x29422c[_0x396c4a(0xfb)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']='schedule:list';['description']=a34_0x5505b1(0xcd);async[a34_0x5505b1(0xca)](_0x56011d){const _0x2ec66b=a34_0x5505b1,{options:_0x3149c4,args:_0x2795ec,tdx:_0x12f35a}=_0x56011d,_0x2c9def=resolveLimit(_0x3149c4[_0x2ec66b(0xed)],DEFAULT_DISPLAY_LIMIT),_0x232b3a=_0x2795ec[0x0],_0x4d921b=_0x232b3a?_0x2ec66b(0xd4)+_0x232b3a+_0x2ec66b(0xd8):_0x2ec66b(0x133),_0x37375e=await withSpinner(_0x4d921b,()=>_0x12f35a[_0x2ec66b(0x104)]['listQueries']({'limit':_0x2c9def,'scheduled':!![],'pattern':_0x232b3a}),{'verbose':_0x3149c4[_0x2ec66b(0xe0)]}),_0x137ec6=_0x37375e['data'][_0x2ec66b(0x119)],_0x5b37a7=_0x37375e[_0x2ec66b(0x116)][_0x2ec66b(0x117)]['has_next_page'],_0x180a33=_0x232b3a?_0x2ec66b(0x120)+_0x232b3a+'\x22':'';_0x5b37a7?console['error'](_0x2ec66b(0xdd)+_0x137ec6[_0x2ec66b(0x142)]+'\x20schedules'+_0x180a33+_0x2ec66b(0xd2)):console[_0x2ec66b(0x114)](_0x2ec66b(0x121)+_0x137ec6[_0x2ec66b(0x142)]+_0x2ec66b(0xc7)+(_0x137ec6[_0x2ec66b(0x142)]!==0x1?_0x2ec66b(0x105):'y')+_0x180a33);if(_0x3149c4['format']===_0x2ec66b(0x113)||_0x3149c4[_0x2ec66b(0x140)]===_0x2ec66b(0xc6)||_0x3149c4[_0x2ec66b(0x140)]==='table'||_0x3149c4['format']===_0x2ec66b(0xc8)){const _0x45b7ec=_0x137ec6['map'](_0x2349eb=>({'id':_0x2349eb['id'],'name':_0x2349eb[_0x2ec66b(0x12a)],'cron':_0x2349eb[_0x2ec66b(0xdc)],'database':_0x2349eb[_0x2ec66b(0x12f)]?.[_0x2ec66b(0x12a)],'type':_0x2349eb[_0x2ec66b(0x138)],'timezone':_0x2349eb['time_zone'],'user_name':_0x2349eb[_0x2ec66b(0x13e)]?.[_0x2ec66b(0x12a)],'updated_at':_0x2349eb[_0x2ec66b(0xf0)],'next_run_at':_0x2349eb[_0x2ec66b(0xe1)],'last_job_status':_0x2349eb[_0x2ec66b(0xec)]?.['status']}));await handleSDKOutput(_0x45b7ec,_0x3149c4);}else{if(_0x137ec6[_0x2ec66b(0x142)]===0x0)console[_0x2ec66b(0xc2)](_0x2ec66b(0xd5));else{const _0x200a71=_0x3149c4[_0x2ec66b(0x124)],_0x18a947=_0x137ec6[_0x2ec66b(0xea)](_0x561b59=>{const _0x514865=_0x2ec66b,_0x37d69f=_0x561b59[_0x514865(0xec)]?.[_0x514865(0x128)]?_0x561b59[_0x514865(0xec)][_0x514865(0x128)]===_0x514865(0x11d)?'✓':'✗':'-',_0x15d247=_0x561b59[_0x514865(0xec)]?.[_0x514865(0xd1)]?formatRelativeTime(_0x561b59[_0x514865(0xec)][_0x514865(0xd1)]):'never',_0xb8b1ff=_0x561b59[_0x514865(0xe1)]?formatRelativeTime(_0x561b59[_0x514865(0xe1)]):'-',_0xe8dd07=_0x561b59[_0x514865(0xdc)]||'',_0x32c084=_0x561b59[_0x514865(0x12a)]||_0x514865(0xf9),_0x5a378e=getConsoleUrl(_0x200a71,_0x514865(0x130)+_0x561b59['id']);return{'statusIcon':_0x37d69f,'lastRun':_0x15d247,'nextRun':_0xb8b1ff,'cron':_0xe8dd07,'name':_0x32c084,'queryUrl':_0x5a378e,'status':_0x561b59[_0x514865(0xec)]?.['status']};}),_0x18691b=Math[_0x2ec66b(0x13c)](..._0x18a947['map'](_0xece04c=>_0xece04c[_0x2ec66b(0x10f)][_0x2ec66b(0x142)])),_0xe38337=Math[_0x2ec66b(0x13c)](..._0x18a947[_0x2ec66b(0xea)](_0x8035c3=>_0x8035c3[_0x2ec66b(0xf4)]['length'])),_0x12ce44=Math[_0x2ec66b(0x13c)](..._0x18a947[_0x2ec66b(0xea)](_0x4e6a55=>_0x4e6a55[_0x2ec66b(0xdc)][_0x2ec66b(0x142)])),_0x2ed1b1=_0x18a947[_0x2ec66b(0xea)](_0x44a138=>{const _0x507a0b=_0x2ec66b,_0x40897a=_0x44a138[_0x507a0b(0x128)]===_0x507a0b(0x11d)?a34_0x233df7['green'](_0x44a138[_0x507a0b(0xeb)]):_0x44a138['status']==='error'?a34_0x233df7['red'](_0x44a138[_0x507a0b(0xeb)]):a34_0x233df7['dim'](_0x44a138[_0x507a0b(0xeb)]),_0x8824a7=_0x44a138[_0x507a0b(0x10f)][_0x507a0b(0xcf)](_0x18691b),_0x3d0bc6=_0x44a138[_0x507a0b(0xf4)][_0x507a0b(0xcf)](_0xe38337),_0x477c68=_0x44a138[_0x507a0b(0xdc)]?a34_0x233df7[_0x507a0b(0xe7)](_0x44a138['cron'][_0x507a0b(0xcf)](_0x12ce44)):'\x20'[_0x507a0b(0xb9)](_0x12ce44),_0x72ac97=hyperlink(_0x44a138[_0x507a0b(0x12a)],_0x44a138[_0x507a0b(0x12b)]);return'📅\x20'+_0x40897a+'\x20'+_0x8824a7+_0x507a0b(0xf2)+_0x3d0bc6+'\x20\x20'+_0x477c68+'\x20\x20'+_0x72ac97;});await writeOutput(_0x2ed1b1['join']('\x0a'),_0x3149c4['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0xc0);[a34_0x5505b1(0x129)]=a34_0x5505b1(0x135);[a34_0x5505b1(0x126)](_0x1ee35b){const _0x686a39=a34_0x5505b1,_0x32eaf1=_0x1ee35b[_0x686a39(0xd3)][0x0];if(!_0x32eaf1)return _0x686a39(0xfe);return undefined;}async['execute'](_0x268a80){const _0x25e79e=a34_0x5505b1,{options:_0x293e35,args:_0x43a13f,tdx:_0x591420}=_0x268a80,_0x2fc837=_0x43a13f[0x0],_0x5878fb=await withSpinner('Getting\x20schedule\x20details...',()=>_0x591420[_0x25e79e(0x104)][_0x25e79e(0xbf)](_0x2fc837),{'verbose':_0x293e35['verbose']}),_0x4d6942=_0x5878fb['data'],_0xddee88={'name':_0x4d6942['name'],'cron':_0x4d6942['cron'],'database':_0x4d6942['database'],'type':_0x4d6942[_0x25e79e(0x138)],'timezone':_0x4d6942[_0x25e79e(0x136)],'user_name':_0x4d6942[_0x25e79e(0x10d)],'created_at':_0x4d6942[_0x25e79e(0x115)],'engine_version':_0x4d6942[_0x25e79e(0x11e)],'executing_user_id':_0x4d6942[_0x25e79e(0xff)],'query':_0x4d6942['query'],'delay':_0x4d6942[_0x25e79e(0xf7)],'priority':_0x4d6942[_0x25e79e(0xe6)],'retry_limit':_0x4d6942[_0x25e79e(0x103)],..._0x4d6942[_0x25e79e(0x125)]&&{'result':_0x4d6942[_0x25e79e(0x125)]}};return await handleSingleObjectOutput(_0xddee88,_0x293e35),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0x141);[a34_0x5505b1(0x129)]=a34_0x5505b1(0xe8);[a34_0x5505b1(0x126)](_0x287911){const _0x589fc6=a34_0x5505b1,_0x4d438b=_0x287911[_0x589fc6(0xd3)][0x0];if(!_0x4d438b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x32bc64=_0x287911['options'];if(!_0x32bc64[_0x589fc6(0x12f)])return _0x589fc6(0xd9);return undefined;}async[a34_0x5505b1(0xca)](_0x101438){const _0x558f5b=a34_0x5505b1,{options:_0x369452,args:_0x40b5ec,tdx:_0x31b431}=_0x101438,_0x1b8825=_0x40b5ec[0x0],_0x1729d4=_0x369452,_0x255a33=_0x1729d4[_0x558f5b(0x12f)],_0x3a4610=_0x1729d4['file'],_0x28da45=_0x1729d4[_0x558f5b(0x138)]||_0x558f5b(0xba);let _0x217c41;try{_0x217c41=readFileSync(_0x3a4610,_0x558f5b(0x13d))['trim']();}catch(_0x10c3fb){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x558f5b(0x102)+_0x3a4610,_0x10c3fb instanceof Error?_0x10c3fb:undefined);}if(!_0x217c41)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20file\x20is\x20empty');const _0x3f4550={'database':_0x255a33,'query':_0x217c41,'type':_0x28da45};if(_0x1729d4[_0x558f5b(0xdc)])_0x3f4550[_0x558f5b(0xdc)]=_0x1729d4['cron'];if(_0x1729d4[_0x558f5b(0x136)])_0x3f4550[_0x558f5b(0x136)]=_0x1729d4[_0x558f5b(0x136)];if(_0x1729d4[_0x558f5b(0xf7)]!==undefined)_0x3f4550[_0x558f5b(0xf7)]=Number(_0x1729d4['delay']);if(_0x1729d4[_0x558f5b(0xe6)]!==undefined)_0x3f4550[_0x558f5b(0xe6)]=Number(_0x1729d4[_0x558f5b(0xe6)]);if(_0x1729d4[_0x558f5b(0xf8)]!==undefined)_0x3f4550['retry_limit']=Number(_0x1729d4[_0x558f5b(0xf8)]);if(_0x1729d4['engineVersion'])_0x3f4550['engine_version']=_0x1729d4[_0x558f5b(0x13b)];if(_0x1729d4[_0x558f5b(0x125)])_0x3f4550['result']=_0x1729d4[_0x558f5b(0x125)];if(_0x369452['verbose']){console['error'](_0x558f5b(0x134)+_0x1b8825),console[_0x558f5b(0x114)]('\x20\x20Database:\x20'+_0x255a33),console[_0x558f5b(0x114)](_0x558f5b(0x106)+_0x28da45);if(_0x3f4550[_0x558f5b(0xdc)])console[_0x558f5b(0x114)](_0x558f5b(0xef)+_0x3f4550[_0x558f5b(0xdc)]);if(_0x3f4550[_0x558f5b(0x136)])console['error'](_0x558f5b(0xdb)+_0x3f4550[_0x558f5b(0x136)]);}const _0x439df9=await withSpinner(_0x558f5b(0x12c),()=>_0x31b431['schedules'][_0x558f5b(0xf1)](_0x1b8825,_0x3f4550),{'verbose':_0x369452[_0x558f5b(0xe0)]});return console['error'](_0x558f5b(0x11a)+_0x439df9['data'][_0x558f5b(0x12a)]),await handleSingleObjectOutput(_0x439df9[_0x558f5b(0x116)],_0x369452),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0xd0);[a34_0x5505b1(0x129)]=a34_0x5505b1(0xce);['validate'](_0x155236){const _0x1ea93c=a34_0x5505b1,_0x46a40d=_0x155236[_0x1ea93c(0xd3)][0x0];if(!_0x46a40d)return _0x1ea93c(0xc1);return undefined;}async[a34_0x5505b1(0xca)](_0x221cdd){const _0x301beb=a34_0x5505b1,{options:_0x52ac62,args:_0x56a93d,tdx:_0x3e8aca}=_0x221cdd,_0x2d2616=_0x56a93d[0x0],_0x2fb703=_0x52ac62,_0x18d4df={};if(_0x2fb703[_0x301beb(0x12f)])_0x18d4df[_0x301beb(0x12f)]=_0x2fb703['database'];if(_0x2fb703[_0x301beb(0x138)])_0x18d4df[_0x301beb(0x138)]=_0x2fb703[_0x301beb(0x138)];if(_0x2fb703[_0x301beb(0xdc)])_0x18d4df['cron']=_0x2fb703[_0x301beb(0xdc)];if(_0x2fb703['timezone'])_0x18d4df[_0x301beb(0x136)]=_0x2fb703[_0x301beb(0x136)];if(_0x2fb703[_0x301beb(0xf7)]!==undefined)_0x18d4df['delay']=Number(_0x2fb703[_0x301beb(0xf7)]);if(_0x2fb703[_0x301beb(0xe6)]!==undefined)_0x18d4df[_0x301beb(0xe6)]=Number(_0x2fb703['priority']);if(_0x2fb703[_0x301beb(0xf8)]!==undefined)_0x18d4df[_0x301beb(0x103)]=Number(_0x2fb703['retryLimit']);if(_0x2fb703[_0x301beb(0x13b)])_0x18d4df[_0x301beb(0x11e)]=_0x2fb703[_0x301beb(0x13b)];if(_0x2fb703[_0x301beb(0x125)])_0x18d4df['result']=_0x2fb703['result'];if(_0x2fb703[_0x301beb(0xbc)])try{_0x18d4df['query']=readFileSync(_0x2fb703[_0x301beb(0xbc)],_0x301beb(0x13d))[_0x301beb(0xd7)]();}catch(_0x1acc92){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x301beb(0x102)+_0x2fb703[_0x301beb(0xbc)],_0x1acc92 instanceof Error?_0x1acc92:undefined);}if(Object[_0x301beb(0x123)](_0x18d4df)['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x52ac62[_0x301beb(0xe0)]){console[_0x301beb(0x114)](_0x301beb(0x10c)+_0x2d2616);for(const [_0x1b375b,_0x380f91]of Object[_0x301beb(0xc5)](_0x18d4df)){_0x1b375b===_0x301beb(0x100)?console[_0x301beb(0x114)]('\x20\x20'+_0x1b375b+':\x20'+_0x380f91['substring'](0x0,0x32)+_0x301beb(0x110)):console[_0x301beb(0x114)]('\x20\x20'+_0x1b375b+':\x20'+_0x380f91);}}const _0x636e3=await withSpinner('Updating\x20schedule...',()=>_0x3e8aca['schedules']['update'](_0x2d2616,_0x18d4df),{'verbose':_0x52ac62[_0x301beb(0xe0)]});return console['error'](_0x301beb(0x131)+_0x636e3[_0x301beb(0x116)][_0x301beb(0x12a)]),await handleSingleObjectOutput(_0x636e3[_0x301beb(0x116)],_0x52ac62),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x5505b1(0xfa);[a34_0x5505b1(0x129)]=a34_0x5505b1(0x137);['validate'](_0xe62f72){const _0xacb3c1=a34_0x5505b1,_0x5123a7=_0xe62f72[_0xacb3c1(0xd3)][0x0];if(!_0x5123a7)return _0xacb3c1(0x12d);return undefined;}async[a34_0x5505b1(0xca)](_0x50fdd7){const _0x25fd41=a34_0x5505b1,{options:_0x5269e8,args:_0x208d73,tdx:_0x57bba5}=_0x50fdd7,_0x485551=_0x208d73[0x0];if(!_0x5269e8[_0x25fd41(0xdf)]){const _0x4ac666=await confirm(_0x25fd41(0xcc)+_0x485551+'\x22?');if(!_0x4ac666)return console[_0x25fd41(0x114)](_0x25fd41(0xe3)),0x0;}const _0x1643ea=await withSpinner(_0x25fd41(0x12e),()=>_0x57bba5[_0x25fd41(0x104)][_0x25fd41(0x107)](_0x485551),{'verbose':_0x5269e8[_0x25fd41(0xe0)]});return console[_0x25fd41(0x114)](_0x25fd41(0xbb)+_0x1643ea['data']['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x5505b1(0x12a)]='schedule:run';['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a34_0x5505b1(0x126)](_0x18b7a7){const _0x917dc0=a34_0x5505b1,_0x2271c9=_0x18b7a7['args'][0x0];if(!_0x2271c9)return _0x917dc0(0xe5);return undefined;}async['execute'](_0x2750f5){const _0xa9a562=a34_0x5505b1,{options:_0x5877a0,args:_0xc436d5,tdx:_0x2feba2}=_0x2750f5,_0x48f9dc=_0xc436d5[0x0],_0x398cfe=_0x5877a0,_0x483879=_0x398cfe[_0xa9a562(0xf5)],_0x21d4bc=_0x398cfe[_0xa9a562(0x112)]!==undefined?Number(_0x398cfe[_0xa9a562(0x112)]):undefined;if(_0x5877a0[_0xa9a562(0xe0)]){console[_0xa9a562(0x114)](_0xa9a562(0x139)+_0x48f9dc);if(_0x483879)console[_0xa9a562(0x114)](_0xa9a562(0xfc)+_0x483879);if(_0x21d4bc)console[_0xa9a562(0x114)](_0xa9a562(0x10e)+_0x21d4bc);}const _0x7a427c=await withSpinner(_0xa9a562(0xbd),()=>_0x2feba2[_0xa9a562(0x104)][_0xa9a562(0x108)](_0x48f9dc,{'time':_0x483879,'num':_0x21d4bc}),{'verbose':_0x5877a0[_0xa9a562(0xe0)]}),_0x573184=_0x7a427c[_0xa9a562(0x116)][_0xa9a562(0x11b)];console[_0xa9a562(0x114)](_0xa9a562(0x10a)+_0x573184['length']+_0xa9a562(0x109)+(_0x573184[_0xa9a562(0x142)]!==0x1?'s':'')+'\x20created');for(const _0x18deaf of _0x573184){console[_0xa9a562(0x114)]('\x20\x20Job\x20ID:\x20'+_0x18deaf[_0xa9a562(0x122)]);}return await handleSDKOutput(_0x573184,_0x5877a0),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a34_0x5505b1(0x129)]=a34_0x5505b1(0xe4);[a34_0x5505b1(0x126)](_0x1668d4){const _0x1b9660=a34_0x5505b1,_0x484801=_0x1668d4['args'][0x0];if(!_0x484801)return _0x1b9660(0xe2);return undefined;}async[a34_0x5505b1(0xca)](_0x416ba1){const _0x2dac8e=a34_0x5505b1,{options:_0x2b5bf6,args:_0x5aa402,tdx:_0x40af44}=_0x416ba1,_0x259a4d=_0x5aa402[0x0],_0x399463=_0x2b5bf6,_0x1ab79b=_0x399463['from']!==undefined?Number(_0x399463[_0x2dac8e(0x11c)]):undefined,_0xd7636d=_0x399463['to']!==undefined?Number(_0x399463['to']):undefined,_0x3b86b4=await withSpinner(_0x2dac8e(0x127),()=>_0x40af44[_0x2dac8e(0x104)]['history'](_0x259a4d,{'from':_0x1ab79b,'to':_0xd7636d}),{'verbose':_0x2b5bf6[_0x2dac8e(0xe0)]}),_0x31701d=_0x3b86b4['data'];console[_0x2dac8e(0x114)](_0x2dac8e(0x121)+_0x31701d[_0x2dac8e(0xf6)]+'\x20execution'+(_0x31701d[_0x2dac8e(0xf6)]!==0x1?'s':'')+'\x20(showing\x20'+_0x31701d[_0x2dac8e(0x11c)]+'-'+_0x31701d['to']+')');const _0x3d24b6=_0x31701d[_0x2dac8e(0xf3)]['map'](_0x1e1290=>({'job_id':_0x1e1290[_0x2dac8e(0x122)],'type':_0x1e1290['type'],'status':_0x1e1290[_0x2dac8e(0x128)],'scheduled_at':_0x1e1290[_0x2dac8e(0xe9)],'created_at':_0x1e1290[_0x2dac8e(0x115)],'start_at':_0x1e1290[_0x2dac8e(0xc3)],'end_at':_0x1e1290['end_at']}));return await handleSDKOutput(_0x3d24b6,_0x2b5bf6),0x0;}}
|
|
1
|
+
const a34_0x25e1d1=a34_0x1b84;(function(_0x2dc335,_0xcfa7e7){const _0x39a728=a34_0x1b84,_0x2d4918=_0x2dc335();while(!![]){try{const _0x1e723f=parseInt(_0x39a728(0x193))/0x1+parseInt(_0x39a728(0x122))/0x2*(parseInt(_0x39a728(0x14b))/0x3)+parseInt(_0x39a728(0x192))/0x4*(parseInt(_0x39a728(0x164))/0x5)+parseInt(_0x39a728(0x17d))/0x6+-parseInt(_0x39a728(0x120))/0x7+-parseInt(_0x39a728(0x10f))/0x8*(parseInt(_0x39a728(0x169))/0x9)+-parseInt(_0x39a728(0x13f))/0xa;if(_0x1e723f===_0xcfa7e7)break;else _0x2d4918['push'](_0x2d4918['shift']());}catch(_0x40351c){_0x2d4918['push'](_0x2d4918['shift']());}}}(a34_0x273d,0x70cef));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x1b84(_0xc17d5,_0x3b039d){_0xc17d5=_0xc17d5-0x10d;const _0x273dde=a34_0x273d();let _0x1b8495=_0x273dde[_0xc17d5];return _0x1b8495;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x3bc83c from'chalk';function formatRelativeTime(_0x4046b0){const _0x63bc34=a34_0x1b84,_0x10f5c9=new Date(_0x4046b0),_0x220d95=new Date(),_0x4e664c=_0x10f5c9[_0x63bc34(0x16f)]()-_0x220d95['getTime'](),_0x4fde44=Math[_0x63bc34(0x12e)](_0x4e664c)/0x3e8,_0x16ab2e=_0x4e664c<0x0;if(_0x4fde44<0x3c)return _0x16ab2e?_0x63bc34(0x162):'soon';else{if(_0x4fde44<0xe10){const _0x472502=Math[_0x63bc34(0x12c)](_0x4fde44/0x3c);return _0x16ab2e?_0x472502+_0x63bc34(0x176):_0x63bc34(0x121)+_0x472502+'m';}else{if(_0x4fde44<0x15180){const _0x58af5c=Math['round'](_0x4fde44/0xe10);return _0x16ab2e?_0x58af5c+_0x63bc34(0x14f):'in\x20'+_0x58af5c+'h';}else{if(_0x4fde44<0x93a80){const _0x439cfb=Math[_0x63bc34(0x12c)](_0x4fde44/0x15180);return _0x16ab2e?_0x439cfb+_0x63bc34(0x115):'in\x20'+_0x439cfb+'d';}else return _0x10f5c9[_0x63bc34(0x117)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x19d);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x15e);async[a34_0x25e1d1(0x16d)](_0x1e039b){const _0x159f83=a34_0x25e1d1,{options:_0x30b8a7,args:_0x3995ed,tdx:_0x12bd1e}=_0x1e039b,_0x985f08=resolveLimit(_0x30b8a7['limit'],DEFAULT_DISPLAY_LIMIT),_0x117b4b=_0x3995ed[0x0],_0x53303c=_0x117b4b?_0x159f83(0x174)+_0x117b4b+_0x159f83(0x158):_0x159f83(0x11a),_0x42b5af=await withSpinner(_0x53303c,()=>_0x12bd1e['schedules'][_0x159f83(0x18e)]({'limit':_0x985f08,'scheduled':!![],'pattern':_0x117b4b}),{'verbose':_0x30b8a7[_0x159f83(0x154)]}),_0x55058d=_0x42b5af['data'][_0x159f83(0x134)],_0x2f1919=_0x42b5af['data'][_0x159f83(0x179)][_0x159f83(0x199)],_0x332063=_0x117b4b?_0x159f83(0x14c)+_0x117b4b+'\x22':'';_0x2f1919?console[_0x159f83(0x171)](_0x159f83(0x127)+_0x55058d[_0x159f83(0x182)]+'\x20schedules'+_0x332063+_0x159f83(0x16c)):console[_0x159f83(0x171)](_0x159f83(0x118)+_0x55058d[_0x159f83(0x182)]+_0x159f83(0x15d)+(_0x55058d[_0x159f83(0x182)]!==0x1?_0x159f83(0x144):'y')+_0x332063);if(_0x30b8a7['format']===_0x159f83(0x123)||_0x30b8a7[_0x159f83(0x12f)]===_0x159f83(0x18c)||_0x30b8a7['format']===_0x159f83(0x183)||_0x30b8a7[_0x159f83(0x12f)]==='tsv'){const _0x537e52=_0x55058d[_0x159f83(0x16b)](_0x52abed=>({'id':_0x52abed['id'],'name':_0x52abed['name'],'cron':_0x52abed[_0x159f83(0x11e)],'database':_0x52abed['database']?.[_0x159f83(0x15c)],'type':_0x52abed[_0x159f83(0x19c)],'timezone':_0x52abed[_0x159f83(0x17a)],'user_name':_0x52abed[_0x159f83(0x17b)]?.['name'],'updated_at':_0x52abed['updated_at'],'next_run_at':_0x52abed[_0x159f83(0x18a)],'last_job_status':_0x52abed[_0x159f83(0x116)]?.[_0x159f83(0x124)]}));await handleSDKOutput(_0x537e52,_0x30b8a7);}else{if(_0x55058d['length']===0x0)console[_0x159f83(0x140)](_0x159f83(0x14a));else{const _0x2124d4=_0x30b8a7['site'],_0x593e9f=_0x55058d['map'](_0x30fd74=>{const _0x49a543=_0x159f83,_0x969e61=_0x30fd74[_0x49a543(0x116)]?.['status']?_0x30fd74['last_job']['status']==='success'?'✓':'✗':'-',_0x4fe268=_0x30fd74['last_job']?.[_0x49a543(0x148)]?formatRelativeTime(_0x30fd74['last_job'][_0x49a543(0x148)]):'never',_0x2b4c7b=_0x30fd74[_0x49a543(0x18a)]?formatRelativeTime(_0x30fd74[_0x49a543(0x18a)]):'-',_0x2d9204=_0x30fd74['cron']||'',_0x36a562=_0x30fd74[_0x49a543(0x15c)]||_0x49a543(0x198),_0x40f941=getConsoleUrl(_0x2124d4,_0x49a543(0x110)+_0x30fd74['id']);return{'statusIcon':_0x969e61,'lastRun':_0x4fe268,'nextRun':_0x2b4c7b,'cron':_0x2d9204,'name':_0x36a562,'queryUrl':_0x40f941,'status':_0x30fd74[_0x49a543(0x116)]?.[_0x49a543(0x124)]};}),_0xfdc602=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x52d6b9=>_0x52d6b9['lastRun']['length'])),_0x3cd33c=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x2af7ac=>_0x2af7ac['nextRun'][_0x159f83(0x182)])),_0x1e8bba=Math[_0x159f83(0x130)](..._0x593e9f['map'](_0x559f0b=>_0x559f0b[_0x159f83(0x11e)]['length'])),_0x2e300f=_0x593e9f[_0x159f83(0x16b)](_0x364cf5=>{const _0x2c79c8=_0x159f83,_0x53f663=_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x15b)?a34_0x3bc83c[_0x2c79c8(0x114)](_0x364cf5['statusIcon']):_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x171)?a34_0x3bc83c[_0x2c79c8(0x194)](_0x364cf5[_0x2c79c8(0x155)]):a34_0x3bc83c[_0x2c79c8(0x135)](_0x364cf5[_0x2c79c8(0x155)]),_0x53ae25=_0x364cf5['lastRun']['padEnd'](_0xfdc602),_0x901ef7=_0x364cf5[_0x2c79c8(0x137)][_0x2c79c8(0x186)](_0x3cd33c),_0x59247e=_0x364cf5[_0x2c79c8(0x11e)]?a34_0x3bc83c[_0x2c79c8(0x18b)](_0x364cf5[_0x2c79c8(0x11e)][_0x2c79c8(0x186)](_0x1e8bba)):'\x20'['repeat'](_0x1e8bba),_0xd697c3=hyperlink(_0x364cf5[_0x2c79c8(0x15c)],_0x364cf5[_0x2c79c8(0x147)]);return'📅\x20'+_0x53f663+'\x20'+_0x53ae25+'\x20\x20→\x20'+_0x901ef7+'\x20\x20'+_0x59247e+'\x20\x20'+_0xd697c3;});await writeOutput(_0x2e300f[_0x159f83(0x161)]('\x0a'),_0x30b8a7[_0x159f83(0x12a)],_0x159f83(0x172));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x25e1d1(0x159);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x143);[a34_0x25e1d1(0x19f)](_0xf551e1){const _0x345e5a=a34_0x25e1d1,_0x97b142=_0xf551e1[_0x345e5a(0x14d)][0x0];if(!_0x97b142)return _0x345e5a(0x17e);return undefined;}async['execute'](_0x1edeee){const _0x3097f9=a34_0x25e1d1,{options:_0x362f96,args:_0x225fbd,tdx:_0x12152f}=_0x1edeee,_0x3ed755=_0x225fbd[0x0],_0x441d8a=await withSpinner('Getting\x20schedule\x20details...',()=>_0x12152f[_0x3097f9(0x10d)][_0x3097f9(0x13b)](_0x3ed755),{'verbose':_0x362f96['verbose']}),_0x3062e1=_0x441d8a[_0x3097f9(0x185)],_0x2605fc={'name':_0x3062e1['name'],'cron':_0x3062e1['cron'],'database':_0x3062e1[_0x3097f9(0x160)],'type':_0x3062e1[_0x3097f9(0x19c)],'timezone':_0x3062e1[_0x3097f9(0x19b)],'user_name':_0x3062e1['user_name'],'created_at':_0x3062e1['created_at'],'engine_version':_0x3062e1[_0x3097f9(0x11f)],'executing_user_id':_0x3062e1['executing_user_id'],'query':_0x3062e1[_0x3097f9(0x157)],'delay':_0x3062e1[_0x3097f9(0x142)],'priority':_0x3062e1['priority'],'retry_limit':_0x3062e1['retry_limit'],..._0x3062e1[_0x3097f9(0x190)]&&{'result':_0x3062e1['result']}};return await handleSingleObjectOutput(_0x2605fc,_0x362f96),0x0;}}function a34_0x273d(){const _0x4b4c28=['green','d\x20ago','last_job','toLocaleDateString','Found\x20','...','Listing\x20scheduled\x20queries...','Creating\x20schedule...','run','Create\x20a\x20scheduled\x20query','cron','engine_version','1529787evGMXH','in\x20','130362yNxwVz','json','status','Schedule\x20deleted:\x20','Failed\x20to\x20read\x20file:\x20','Showing\x20first\x20','entries','utf-8','output','delete','round','\x20created','abs','format','max','INVALID_ARGUMENT','trino','priority','queries','dim','\x20\x20Cron:\x20','nextRun','schedule:update','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','options','show','schedule:run','time','Updating\x20schedule:\x20','466930kQiwGs','log','keys','delay','Show\x20schedule\x20details','ies','create','\x20\x20Timezone:\x20','queryUrl','ended_at','Cancelled','No\x20scheduled\x20queries\x20found','15aYbAVL','\x20matching\x20\x22','args','schedule:create','h\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','num','retry_limit','\x20\x20Database:\x20','verbose','statusIcon','Deleting\x20schedule...','query','\x22...','schedule:show','\x20\x20Job\x20ID:\x20','success','name','\x20scheduled\x20quer','List\x20scheduled\x20queries','from','database','join','just\x20now','\x20\x20Type:\x20','428015xyuJdn','Delete\x20a\x20scheduled\x20query','Updating\x20schedule...','start_at','engineVersion','82449UaniDp','description','map','\x20(use\x20--limit\x20to\x20see\x20more)','execute','\x20job','getTime','Getting\x20schedule\x20history...','error','list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Searching\x20scheduled\x20queries\x20matching\x20\x22','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','m\x20ago','retryLimit','history','pagination','time_zone','user','\x20\x20Num:\x20','846162hURoum','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Schedule\x20created:\x20','Creating\x20schedule:\x20','length','table','job_id','data','padEnd','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Update\x20a\x20scheduled\x20query','Schedule\x20updated:\x20','next_run_at','cyan','jsonl','update','listQueries','count','result','Run\x20a\x20scheduled\x20query\x20immediately','24hDUxze','58221iUIlgn','red','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','file','\x20(showing\x20','(unnamed)','has_next_page','end_at','timezone','type','schedule:list','trim','validate','schedules','schedule:history','272durldU','/app/queries/editor?queryId=','jobs','Schedule\x20run\x20submitted:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]'];a34_0x273d=function(){return _0x4b4c28;};return a34_0x273d();}export class ScheduleCreateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x14e);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x11d);['validate'](_0x287cdb){const _0x173c13=a34_0x25e1d1,_0x520954=_0x287cdb['args'][0x0];if(!_0x520954)return _0x173c13(0x113);const _0x26568f=_0x287cdb[_0x173c13(0x13a)];if(!_0x26568f['database'])return _0x173c13(0x187);return undefined;}async['execute'](_0x587f62){const _0x338004=a34_0x25e1d1,{options:_0x5cf415,args:_0xf24e99,tdx:_0x48c1fa}=_0x587f62,_0x2012a1=_0xf24e99[0x0],_0x1913f7=_0x5cf415,_0x17d505=_0x1913f7[_0x338004(0x160)],_0x1249d9=_0x1913f7[_0x338004(0x196)],_0x40d503=_0x1913f7['type']||_0x338004(0x132);let _0x4127c7;try{_0x4127c7=readFileSync(_0x1249d9,_0x338004(0x129))[_0x338004(0x19e)]();}catch(_0x327e04){throw new SDKError(ErrorCode[_0x338004(0x131)],_0x338004(0x126)+_0x1249d9,_0x327e04 instanceof Error?_0x327e04:undefined);}if(!_0x4127c7)throw new SDKError(ErrorCode[_0x338004(0x131)],'Query\x20file\x20is\x20empty');const _0x4b3a70={'database':_0x17d505,'query':_0x4127c7,'type':_0x40d503};if(_0x1913f7[_0x338004(0x11e)])_0x4b3a70[_0x338004(0x11e)]=_0x1913f7[_0x338004(0x11e)];if(_0x1913f7[_0x338004(0x19b)])_0x4b3a70[_0x338004(0x19b)]=_0x1913f7['timezone'];if(_0x1913f7['delay']!==undefined)_0x4b3a70[_0x338004(0x142)]=Number(_0x1913f7['delay']);if(_0x1913f7[_0x338004(0x133)]!==undefined)_0x4b3a70[_0x338004(0x133)]=Number(_0x1913f7['priority']);if(_0x1913f7[_0x338004(0x177)]!==undefined)_0x4b3a70[_0x338004(0x152)]=Number(_0x1913f7[_0x338004(0x177)]);if(_0x1913f7[_0x338004(0x168)])_0x4b3a70[_0x338004(0x11f)]=_0x1913f7[_0x338004(0x168)];if(_0x1913f7['result'])_0x4b3a70[_0x338004(0x190)]=_0x1913f7['result'];if(_0x5cf415['verbose']){console['error'](_0x338004(0x181)+_0x2012a1),console[_0x338004(0x171)](_0x338004(0x153)+_0x17d505),console['error'](_0x338004(0x163)+_0x40d503);if(_0x4b3a70['cron'])console['error'](_0x338004(0x136)+_0x4b3a70[_0x338004(0x11e)]);if(_0x4b3a70[_0x338004(0x19b)])console[_0x338004(0x171)](_0x338004(0x146)+_0x4b3a70['timezone']);}const _0x3171bf=await withSpinner(_0x338004(0x11b),()=>_0x48c1fa[_0x338004(0x10d)][_0x338004(0x145)](_0x2012a1,_0x4b3a70),{'verbose':_0x5cf415[_0x338004(0x154)]});return console[_0x338004(0x171)](_0x338004(0x180)+_0x3171bf[_0x338004(0x185)][_0x338004(0x15c)]),await handleSingleObjectOutput(_0x3171bf[_0x338004(0x185)],_0x5cf415),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x138);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x188);['validate'](_0x48c0e4){const _0x3d8fe6=a34_0x25e1d1,_0x126cf2=_0x48c0e4[_0x3d8fe6(0x14d)][0x0];if(!_0x126cf2)return _0x3d8fe6(0x17f);return undefined;}async[a34_0x25e1d1(0x16d)](_0x2acbae){const _0x62d120=a34_0x25e1d1,{options:_0x181255,args:_0xbe3c80,tdx:_0x1a3deb}=_0x2acbae,_0x4c26b3=_0xbe3c80[0x0],_0x397a16=_0x181255,_0x1372a2={};if(_0x397a16['database'])_0x1372a2['database']=_0x397a16[_0x62d120(0x160)];if(_0x397a16['type'])_0x1372a2[_0x62d120(0x19c)]=_0x397a16[_0x62d120(0x19c)];if(_0x397a16[_0x62d120(0x11e)])_0x1372a2[_0x62d120(0x11e)]=_0x397a16[_0x62d120(0x11e)];if(_0x397a16[_0x62d120(0x19b)])_0x1372a2[_0x62d120(0x19b)]=_0x397a16[_0x62d120(0x19b)];if(_0x397a16[_0x62d120(0x142)]!==undefined)_0x1372a2[_0x62d120(0x142)]=Number(_0x397a16[_0x62d120(0x142)]);if(_0x397a16[_0x62d120(0x133)]!==undefined)_0x1372a2['priority']=Number(_0x397a16[_0x62d120(0x133)]);if(_0x397a16['retryLimit']!==undefined)_0x1372a2[_0x62d120(0x152)]=Number(_0x397a16['retryLimit']);if(_0x397a16[_0x62d120(0x168)])_0x1372a2[_0x62d120(0x11f)]=_0x397a16[_0x62d120(0x168)];if(_0x397a16[_0x62d120(0x190)])_0x1372a2['result']=_0x397a16[_0x62d120(0x190)];if(_0x397a16[_0x62d120(0x196)])try{_0x1372a2[_0x62d120(0x157)]=readFileSync(_0x397a16[_0x62d120(0x196)],_0x62d120(0x129))['trim']();}catch(_0x2f6094){throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x126)+_0x397a16[_0x62d120(0x196)],_0x2f6094 instanceof Error?_0x2f6094:undefined);}if(Object[_0x62d120(0x141)](_0x1372a2)[_0x62d120(0x182)]===0x0)throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x175));if(_0x181255['verbose']){console[_0x62d120(0x171)](_0x62d120(0x13e)+_0x4c26b3);for(const [_0x38f8ca,_0x4c0f80]of Object[_0x62d120(0x128)](_0x1372a2)){_0x38f8ca===_0x62d120(0x157)?console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80['substring'](0x0,0x32)+_0x62d120(0x119)):console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80);}}const _0x1d71bd=await withSpinner(_0x62d120(0x166),()=>_0x1a3deb[_0x62d120(0x10d)][_0x62d120(0x18d)](_0x4c26b3,_0x1372a2),{'verbose':_0x181255[_0x62d120(0x154)]});return console[_0x62d120(0x171)](_0x62d120(0x189)+_0x1d71bd[_0x62d120(0x185)][_0x62d120(0x15c)]),await handleSingleObjectOutput(_0x1d71bd[_0x62d120(0x185)],_0x181255),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]='schedule:delete';[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x165);['validate'](_0x1be25b){const _0x255b0a=a34_0x25e1d1,_0x57a308=_0x1be25b[_0x255b0a(0x14d)][0x0];if(!_0x57a308)return _0x255b0a(0x173);return undefined;}async['execute'](_0x134855){const _0x211f17=a34_0x25e1d1,{options:_0x45fd2b,args:_0x469ced,tdx:_0x38e63f}=_0x134855,_0x2e23b2=_0x469ced[0x0];if(!_0x45fd2b['yes']){const _0x157c71=await confirm(_0x211f17(0x139)+_0x2e23b2+'\x22?');if(!_0x157c71)return console[_0x211f17(0x171)](_0x211f17(0x149)),0x0;}const _0x5670e0=await withSpinner(_0x211f17(0x156),()=>_0x38e63f[_0x211f17(0x10d)][_0x211f17(0x12b)](_0x2e23b2),{'verbose':_0x45fd2b[_0x211f17(0x154)]});return console[_0x211f17(0x171)](_0x211f17(0x125)+_0x5670e0[_0x211f17(0x185)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x13c);['description']=a34_0x25e1d1(0x191);[a34_0x25e1d1(0x19f)](_0x4055e1){const _0x2803e9=a34_0x25e1d1,_0x502d13=_0x4055e1[_0x2803e9(0x14d)][0x0];if(!_0x502d13)return _0x2803e9(0x150);return undefined;}async[a34_0x25e1d1(0x16d)](_0x5b420e){const _0xd9f054=a34_0x25e1d1,{options:_0x307897,args:_0x2a15c2,tdx:_0xcc737}=_0x5b420e,_0x3b9ab0=_0x2a15c2[0x0],_0x128e8c=_0x307897,_0x3a3ff3=_0x128e8c[_0xd9f054(0x13d)],_0x1f3b03=_0x128e8c['num']!==undefined?Number(_0x128e8c[_0xd9f054(0x151)]):undefined;if(_0x307897['verbose']){console[_0xd9f054(0x171)]('Running\x20schedule:\x20'+_0x3b9ab0);if(_0x3a3ff3)console['error']('\x20\x20Time:\x20'+_0x3a3ff3);if(_0x1f3b03)console[_0xd9f054(0x171)](_0xd9f054(0x17c)+_0x1f3b03);}const _0x491cb9=await withSpinner('Running\x20schedule...',()=>_0xcc737[_0xd9f054(0x10d)][_0xd9f054(0x11c)](_0x3b9ab0,{'time':_0x3a3ff3,'num':_0x1f3b03}),{'verbose':_0x307897[_0xd9f054(0x154)]}),_0x4a1635=_0x491cb9['data'][_0xd9f054(0x111)];console['error'](_0xd9f054(0x112)+_0x4a1635[_0xd9f054(0x182)]+_0xd9f054(0x16e)+(_0x4a1635[_0xd9f054(0x182)]!==0x1?'s':'')+_0xd9f054(0x12d));for(const _0x5417ae of _0x4a1635){console[_0xd9f054(0x171)](_0xd9f054(0x15a)+_0x5417ae[_0xd9f054(0x184)]);}return await handleSDKOutput(_0x4a1635,_0x307897),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x10e);[a34_0x25e1d1(0x16a)]='Show\x20schedule\x20execution\x20history';[a34_0x25e1d1(0x19f)](_0x18b4b9){const _0x3d6ab8=a34_0x25e1d1,_0x131698=_0x18b4b9[_0x3d6ab8(0x14d)][0x0];if(!_0x131698)return _0x3d6ab8(0x195);return undefined;}async[a34_0x25e1d1(0x16d)](_0xfd1fe8){const _0x593008=a34_0x25e1d1,{options:_0x4913aa,args:_0x502639,tdx:_0x47a0b0}=_0xfd1fe8,_0x484158=_0x502639[0x0],_0x53d000=_0x4913aa,_0x142c21=_0x53d000[_0x593008(0x15f)]!==undefined?Number(_0x53d000[_0x593008(0x15f)]):undefined,_0x58e717=_0x53d000['to']!==undefined?Number(_0x53d000['to']):undefined,_0x22d0be=await withSpinner(_0x593008(0x170),()=>_0x47a0b0[_0x593008(0x10d)][_0x593008(0x178)](_0x484158,{'from':_0x142c21,'to':_0x58e717}),{'verbose':_0x4913aa[_0x593008(0x154)]}),_0x412eaa=_0x22d0be[_0x593008(0x185)];console[_0x593008(0x171)]('Found\x20'+_0x412eaa[_0x593008(0x18f)]+'\x20execution'+(_0x412eaa[_0x593008(0x18f)]!==0x1?'s':'')+_0x593008(0x197)+_0x412eaa[_0x593008(0x15f)]+'-'+_0x412eaa['to']+')');const _0x16bd74=_0x412eaa['history'][_0x593008(0x16b)](_0x262f92=>({'job_id':_0x262f92[_0x593008(0x184)],'type':_0x262f92[_0x593008(0x19c)],'status':_0x262f92[_0x593008(0x124)],'scheduled_at':_0x262f92['scheduled_at'],'created_at':_0x262f92['created_at'],'start_at':_0x262f92[_0x593008(0x167)],'end_at':_0x262f92[_0x593008(0x19a)]}));return await handleSDKOutput(_0x16bd74,_0x4913aa),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x596d4b=a35_0x5922;(function(_0x4e77e7,_0xf58398){const _0x5c3704=a35_0x5922,_0x60ec57=_0x4e77e7();while(!![]){try{const _0x4340bb=-parseInt(_0x5c3704(0x141))/0x1+parseInt(_0x5c3704(0xd8))/0x2*(-parseInt(_0x5c3704(0xe2))/0x3)+parseInt(_0x5c3704(0x115))/0x4+-parseInt(_0x5c3704(0xe9))/0x5*(parseInt(_0x5c3704(0x14c))/0x6)+parseInt(_0x5c3704(0x171))/0x7+parseInt(_0x5c3704(0xfb))/0x8+parseInt(_0x5c3704(0x15d))/0x9;if(_0x4340bb===_0xf58398)break;else _0x60ec57['push'](_0x60ec57['shift']());}catch(_0x4f34a2){_0x60ec57['push'](_0x60ec57['shift']());}}}(a35_0x1df4,0x6e045));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';function a35_0x1df4(){const _0x47d1a8=['Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:folder:list','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','listFolders','trim','5374sSVDCf','limit','web','Segment\x20ID:\x20','stats','parentSegment','segment:sql','getSQLFromServerSegment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','177KUjgby','Fetching\x20folder\x20\x27','Examples:','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Executing\x20segment\x20query...','/app/ps/','segmentName','10PTVohn','SELECT\x20*\x20FROM\x20(\x0a','getFolder','segment','Use:\x20tdx\x20ps\x20view','Folder\x20ID:\x20','Creating\x20folder\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','green','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:show','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentId','segment:folder:show','Resolving\x20folder\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','5944728etmUFY','Fetching\x20SQL\x20from\x20rule...','resolvePathToResource','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','segment:desc','processedRows','Resolved:\x20','parent','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','jsonl','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','getSegment','\x27\x20with\x20ID:\x20','folderPath','includes','Resolving\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','segment:view','getSQLFromYamlFile','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Fetching\x20parent\x20segment\x20details...','log','Resolving\x20parent\x20folder\x20\x27','411180AeZCHF','content','(root)','✔\x20Found\x20','cyan','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','red','\x20\x20Cause:\x20','parentFolder','\x20\x20Segment\x20name:\x20','setJobId','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolving\x20path\x20\x27','site','Get\x20SQL\x20query\x20for\x20child\x20segment','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20sql\x20--path\x20','execute','getParent','INVALID_ARGUMENT','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','description','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','query','Resolved\x20parent\x20ID:\x20','Use:\x20tdx\x20ps\x20view\x20-w','segmentId','type','Resolved\x20type:\x20','replace','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Folder\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','message','\x20\x20Full\x20path:\x20','folder','SQL\x20query:\x0a','folderId','Parent\x20name:\x20','\x20Opening\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Site:\x20','786736LgPgKj','error','Resolving\x20parent\x20segment\x20\x27','resolveParentId','Show\x20segment\x20or\x20folder\x20details','/e/','✔\x20Query\x20completed:\x20Processed\x20','Parent\x20ID:\x20','url','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','jobId','2251218ERhIbx','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Target\x20path:\x20','length','SEGMENT_NOT_FOUND','Show\x20segment\x20folder\x20details','Options:','Usage:','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegmentSQL','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','cause','verbose','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','3864168IQvKDT','\x20\x20Folder\x20path:\x20','Fetching\x20segment\x20details...','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20folder','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','code','Error:\x20','Resolved\x20relative\x20path\x20to:\x20','createFolder','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','data','SEGMENT_FOLDER_NOT_FOUND','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x27...','Usage:\x20tdx\x20sg\x20show\x20<name>','format','\x20\x20Parent\x20segment:\x20','6097462aZAfBv','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20ps\x20show','fullPath','name','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','✖\x20Query\x20failed\x20[','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Fetching\x20folder\x20details...','Listing\x20folders\x20for\x20parent\x20\x27','resolveFolderId'];a35_0x1df4=function(){return _0x47d1a8;};return a35_0x1df4();}import{openBrowser}from'../utils/process.js';function a35_0x5922(_0x111510,_0x499be6){_0x111510=_0x111510-0xd3;const _0x1df4ff=a35_0x1df4();let _0x5922e0=_0x1df4ff[_0x111510];return _0x5922e0;}import a35_0x1088f7 from'chalk';async function resolveSegmentTarget(_0x4cebed,_0x35bda5,_0x2bde79){const _0x495759=a35_0x5922;if(isYamlFilePath(_0x4cebed))try{const _0xe3b2ab=await resolveYamlFilePath(_0x4cebed);return _0x2bde79&&(console[_0x495759(0x142)](_0x495759(0x174)+_0x4cebed),console[_0x495759(0x142)](_0x495759(0x170)+_0xe3b2ab['parentSegment']),console[_0x495759(0x142)](_0x495759(0x11e)+_0xe3b2ab[_0x495759(0xe8)]),console['error'](_0x495759(0x15e)+(_0xe3b2ab[_0x495759(0x109)]||_0x495759(0x117))),console[_0x495759(0x142)](_0x495759(0x139)+_0xe3b2ab[_0x495759(0x176)])),_0xe3b2ab[_0x495759(0x176)];}catch(_0x2b4b0a){throw new SDKError(ErrorCode[_0x495759(0x129)],_0x495759(0xd5)+_0x2b4b0a['message']);}if(!_0x35bda5)throw new SDKError(ErrorCode[_0x495759(0x129)],_0x495759(0x17a));return _0x35bda5+'/'+_0x4cebed;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x596d4b(0x177)]='segment:describe';[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x145);async[a35_0x596d4b(0x127)](_0x2cd1a2){const _0x5836ef=a35_0x596d4b,{options:_0x64df9c,args:_0x4a04b3,tdx:_0x4d3b1b}=_0x2cd1a2,_0x69361c=_0x4a04b3[0x0],_0x4fc6f9=!_0x69361c&&!!_0x64df9c['parentSegment'],_0x49acc8=_0x69361c||_0x64df9c[_0x5836ef(0xdd)];if(!_0x49acc8)return console[_0x5836ef(0x142)](_0x5836ef(0x172)),console[_0x5836ef(0x142)](_0x5836ef(0xf6)),console[_0x5836ef(0x142)](_0x5836ef(0xe4)),console['error'](_0x5836ef(0x164)),console[_0x5836ef(0x142)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x5836ef(0x142)](_0x5836ef(0x10c)),console[_0x5836ef(0x142)](_0x5836ef(0x121)),0x1;try{const _0x1d09c7=_0x64df9c['segmentPath'];let _0x5e7772=_0x49acc8;!_0x4fc6f9&&_0x1d09c7&&!_0x49acc8[_0x5836ef(0x10a)]('/')&&(_0x5e7772=_0x1d09c7+'/'+_0x49acc8,_0x64df9c[_0x5836ef(0x159)]&&console[_0x5836ef(0x142)](_0x5836ef(0x167)+_0x5e7772));const _0x2d50f1=await withSpinner(_0x5836ef(0x122)+_0x5e7772+_0x5836ef(0x16d),()=>_0x4d3b1b[_0x5836ef(0xec)]['resolvePathToResource'](_0x5e7772),{'verbose':_0x64df9c[_0x5836ef(0x159)]}),_0x4bdda8=_0x2d50f1['data'];_0x64df9c[_0x5836ef(0x159)]&&(console[_0x5836ef(0x142)](_0x5836ef(0x133)+_0x4bdda8[_0x5836ef(0x132)]),console[_0x5836ef(0x142)](_0x5836ef(0x148)+_0x4bdda8[_0x5836ef(0xf7)]),_0x4bdda8[_0x5836ef(0x13c)]&&console[_0x5836ef(0x142)](_0x5836ef(0xee)+_0x4bdda8[_0x5836ef(0x13c)]),_0x4bdda8[_0x5836ef(0x131)]&&console[_0x5836ef(0x142)](_0x5836ef(0xdb)+_0x4bdda8['segmentId']));if(_0x4bdda8['type']===_0x5836ef(0x102)){const _0x2dd5e9=await withSpinner(_0x5836ef(0x112),()=>_0x4d3b1b['segment'][_0x5836ef(0x128)](_0x4bdda8[_0x5836ef(0xf7)]),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x2dd5e9[_0x5836ef(0x16a)],_0x64df9c);}else{if(_0x4bdda8[_0x5836ef(0x132)]==='folder'){if(!_0x4bdda8[_0x5836ef(0x13c)])throw new SDKError(ErrorCode[_0x5836ef(0x16b)],_0x5836ef(0xf5));const _0x47d443=await withSpinner(_0x5836ef(0x17c),()=>_0x4d3b1b[_0x5836ef(0xec)][_0x5836ef(0xeb)](_0x4bdda8['folderId']),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x47d443[_0x5836ef(0x16a)],_0x64df9c);}else{if(_0x4bdda8[_0x5836ef(0x132)]==='segment'){if(!_0x4bdda8[_0x5836ef(0x131)])throw new SDKError(ErrorCode[_0x5836ef(0x150)],_0x5836ef(0xe0));const _0x316dd5=await withSpinner(_0x5836ef(0x15f),()=>_0x4d3b1b[_0x5836ef(0xec)][_0x5836ef(0x107)](_0x4bdda8['parentId'],_0x4bdda8[_0x5836ef(0x131)]),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x316dd5['data'],_0x64df9c);}}}return 0x0;}catch(_0x343173){if(_0x343173 instanceof SDKError)return console[_0x5836ef(0x142)](_0x5836ef(0x166)+_0x343173[_0x5836ef(0x138)]),_0x343173[_0x5836ef(0x158)]&&console[_0x5836ef(0x142)]('\x20\x20Cause:\x20'+_0x343173['cause']),0x1;throw _0x343173;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xf4);[a35_0x596d4b(0x12c)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x116943){const _0x12b326=a35_0x596d4b,{options:_0x29c2e5,args:_0x39df77,tdx:_0x31e57c}=_0x116943,_0x4c935c=_0x39df77[0x0];if(!_0x4c935c)return console[_0x12b326(0x142)](_0x12b326(0xf2)),console[_0x12b326(0x142)](_0x12b326(0x16e)),console['error'](_0x12b326(0xf3)),console[_0x12b326(0x142)](_0x12b326(0xe4)),console[_0x12b326(0x142)](_0x12b326(0x169)),console[_0x12b326(0x142)](_0x12b326(0x16c)),0x1;try{const _0x4f9d83=_0x29c2e5[_0x12b326(0xdd)],_0x4c1885=await resolveSegmentTarget(_0x4c935c,_0x4f9d83,_0x29c2e5[_0x12b326(0x159)]);_0x29c2e5[_0x12b326(0x159)]&&console['error'](_0x12b326(0x14e)+_0x4c1885);const _0x4d8e6d=await withSpinner('Resolving\x20\x27'+_0x4c935c+_0x12b326(0x16d),()=>_0x31e57c[_0x12b326(0xec)][_0x12b326(0xfd)](_0x4c1885),{'verbose':_0x29c2e5[_0x12b326(0x159)]}),_0xc27eb2=_0x4d8e6d['data'];_0x29c2e5['verbose']&&(console[_0x12b326(0x142)]('Resolved\x20type:\x20'+_0xc27eb2[_0x12b326(0x132)]),console[_0x12b326(0x142)]('Parent\x20ID:\x20'+_0xc27eb2['parentId']));if(_0xc27eb2[_0x12b326(0x132)]===_0x12b326(0x13a))return console[_0x12b326(0x142)](_0x12b326(0x11a)),console['error'](_0x12b326(0xd4)),0x1;if(_0xc27eb2['type']==='parent')return console['error'](_0x12b326(0x157)),console[_0x12b326(0x142)](_0x12b326(0x175)),0x1;if(!_0xc27eb2[_0x12b326(0x131)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x12b326(0xe0));const _0x2b6163=await withSpinner(_0x12b326(0x125),()=>_0x31e57c['segment'][_0x12b326(0x156)](_0xc27eb2[_0x12b326(0xf7)],_0xc27eb2[_0x12b326(0x131)]),{'verbose':_0x29c2e5[_0x12b326(0x159)]});let _0x582814=_0x2b6163[_0x12b326(0x16a)];const _0xd327b1=resolveLimit(_0x29c2e5[_0x12b326(0xd9)],DEFAULT_DISPLAY_LIMIT),_0x2a5b33=/\bLIMIT\s+\d+/i['test'](_0x582814);!_0x2a5b33&&(_0x582814=_0x582814[_0x12b326(0xd7)]()[_0x12b326(0x134)](/;+$/,''),_0x582814=_0x12b326(0xea)+_0x582814+_0x12b326(0xfa)+_0xd327b1);_0x29c2e5['verbose']&&console[_0x12b326(0x142)](_0x12b326(0x13b)+_0x582814);const _0x393291=await withProgressSpinner(_0x12b326(0xe6),async _0x4ebd30=>{const _0x1a8713=_0x12b326,_0xcdc3cb=await _0x31e57c[_0x1a8713(0x12e)]['execute'](_0x582814,{'catalog':'td','schema':'information_schema','onJobId':_0x57cbaf=>{const _0x8c94a5=_0x1a8713;_0x4ebd30[_0x8c94a5(0x11f)](_0x57cbaf);}});return _0xcdc3cb;},{'verbose':_0x29c2e5[_0x12b326(0x159)]}),_0x4a1b8d=_0x393291['data'],_0x20c452=_0x4a1b8d[_0x12b326(0x14b)]?'\x20[Job\x20ID:\x20'+_0x4a1b8d['jobId']+']':'';return console[_0x12b326(0x142)](_0x12b326(0x147)+_0x4a1b8d['stats'][_0x12b326(0x100)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x4a1b8d[_0x12b326(0xdc)]['elapsedTimeMillis'])+_0x20c452)),await handleQueryOutput(_0x4a1b8d,_0x29c2e5),0x0;}catch(_0x44bf5c){if(_0x44bf5c instanceof SDKError)return console['error'](_0x12b326(0x179)+_0x44bf5c[_0x12b326(0x165)]+']'),console[_0x12b326(0x142)]('\x0a'+_0x44bf5c['message']),0x1;throw _0x44bf5c;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xd3);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x10e);async[a35_0x596d4b(0x127)](_0x430ad5){const _0x48dfdc=a35_0x596d4b,{options:_0x3ece85,args:_0x1468a2,tdx:_0x5224c0}=_0x430ad5;if(_0x1468a2[_0x48dfdc(0x14f)]===0x0)return console[_0x48dfdc(0x142)](_0x48dfdc(0x155)),console[_0x48dfdc(0x142)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x3f76fd=_0x1468a2[0x0];try{_0x3ece85[_0x48dfdc(0x159)]&&(console[_0x48dfdc(0x142)]('Site:\x20'+_0x3ece85[_0x48dfdc(0x123)]),console[_0x48dfdc(0x142)](_0x48dfdc(0x13d)+_0x3f76fd));const _0x1b2137=await withSpinner(_0x48dfdc(0x143)+_0x3f76fd+_0x48dfdc(0x16d),()=>_0x5224c0[_0x48dfdc(0xec)][_0x48dfdc(0x144)](_0x3f76fd),{'verbose':_0x3ece85[_0x48dfdc(0x159)]}),_0x38bf7d=_0x1b2137[_0x48dfdc(0x16a)];_0x3ece85[_0x48dfdc(0x159)]&&console['error'](_0x48dfdc(0x12f)+_0x38bf7d);const _0x517738=await withSpinner(_0x48dfdc(0x17d)+_0x3f76fd+_0x48dfdc(0x16d),()=>_0x5224c0[_0x48dfdc(0xec)][_0x48dfdc(0xd6)](_0x38bf7d),{'verbose':_0x3ece85[_0x48dfdc(0x159)]}),_0x140812=_0x517738[_0x48dfdc(0x16a)];return console[_0x48dfdc(0x142)](_0x48dfdc(0x118)+_0x140812[_0x48dfdc(0x14f)]+_0x48dfdc(0x162)+(_0x140812['length']!==0x1?'s':'')),await handleSDKOutput(_0x140812,_0x3ece85),0x0;}catch(_0x537a9c){if(_0x537a9c instanceof SDKError)return console[_0x48dfdc(0x142)](_0x48dfdc(0x166)+_0x537a9c['message']),_0x537a9c[_0x48dfdc(0x158)]&&console['error'](_0x48dfdc(0x11c)+_0x537a9c[_0x48dfdc(0x158)]),0x1;throw _0x537a9c;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x596d4b(0xf8);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x151);async[a35_0x596d4b(0x127)](_0x22ae9f){const _0x5f34b2=a35_0x596d4b,{options:_0x54fcfc,args:_0x1082b9,tdx:_0x53268b}=_0x22ae9f;if(_0x1082b9[_0x5f34b2(0x14f)]===0x0)return console[_0x5f34b2(0x142)](_0x5f34b2(0x173)),console[_0x5f34b2(0x142)](_0x5f34b2(0x15c)),0x1;try{const {parentId:_0x3f4c1d,childId:_0x18eb7f}=parseSegmentRef(_0x1082b9[0x0]);_0x54fcfc[_0x5f34b2(0x159)]&&(console['error'](_0x5f34b2(0x140)+_0x54fcfc['site']),console[_0x5f34b2(0x142)](_0x5f34b2(0x13d)+_0x3f4c1d),_0x18eb7f&&console[_0x5f34b2(0x142)]('Folder\x20name:\x20'+_0x18eb7f));if(!_0x18eb7f)return console[_0x5f34b2(0x142)](_0x5f34b2(0x12d)),0x1;const _0x3269e2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f4c1d+_0x5f34b2(0x16d),()=>_0x53268b['segment']['resolveParentId'](_0x3f4c1d),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]}),_0x33ae96=_0x3269e2['data'];_0x54fcfc['verbose']&&console[_0x5f34b2(0x142)](_0x5f34b2(0x12f)+_0x33ae96);const _0x4f21a0=await withSpinner(_0x5f34b2(0xf9)+_0x18eb7f+'\x27...',()=>_0x53268b[_0x5f34b2(0xec)][_0x5f34b2(0x17e)](_0x33ae96,_0x18eb7f),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]}),_0x4c245a=_0x4f21a0[_0x5f34b2(0x16a)];_0x54fcfc[_0x5f34b2(0x159)]&&console[_0x5f34b2(0x142)](_0x5f34b2(0x15a)+_0x4c245a);const _0x26001d=await withSpinner(_0x5f34b2(0xe3)+_0x18eb7f+'\x27...',()=>_0x53268b[_0x5f34b2(0xec)]['getFolder'](_0x4c245a),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]});return await handleSDKOutput([_0x26001d['data']],_0x54fcfc),0x0;}catch(_0x2fa596){if(_0x2fa596 instanceof SDKError)return console[_0x5f34b2(0x142)]('Error:\x20'+_0x2fa596[_0x5f34b2(0x138)]),_0x2fa596[_0x5f34b2(0x158)]&&console[_0x5f34b2(0x142)](_0x5f34b2(0x11c)+_0x2fa596[_0x5f34b2(0x158)]),0x1;throw _0x2fa596;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xde);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x124);async[a35_0x596d4b(0x127)](_0x544b81){const _0x14f4ff=a35_0x596d4b,{options:_0x47922a,args:_0x24850c}=_0x544b81,_0x44c847=_0x47922a,_0x3dab91=_0x44c847['path'],_0x399fb1=_0x24850c[0x0];if(!_0x399fb1&&!_0x3dab91)return console['error'](a35_0x1088f7[_0x14f4ff(0x11b)](_0x14f4ff(0x163))),console[_0x14f4ff(0x142)](_0x14f4ff(0x153)),console['error']('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x14f4ff(0x142)](_0x14f4ff(0xfe)),console[_0x14f4ff(0x142)](_0x14f4ff(0xe4)),console[_0x14f4ff(0x142)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x14f4ff(0x142)](_0x14f4ff(0x12b)),0x1;if(_0x399fb1&&_0x3dab91)return console[_0x14f4ff(0x142)](a35_0x1088f7[_0x14f4ff(0x11b)](_0x14f4ff(0x120))),0x1;try{let _0x143244;if(_0x3dab91)_0x143244=await this[_0x14f4ff(0x110)](_0x3dab91,_0x544b81);else{if(isYamlFilePath(_0x399fb1))return console[_0x14f4ff(0x142)](a35_0x1088f7[_0x14f4ff(0x11b)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x14f4ff(0x142)](_0x14f4ff(0x126)+_0x399fb1),0x1;else _0x143244=await this[_0x14f4ff(0xdf)](_0x399fb1,_0x544b81);}return _0x47922a[_0x14f4ff(0x16f)]==='json'||_0x47922a[_0x14f4ff(0x16f)]===_0x14f4ff(0x105)?await handleSDKOutput([{'sql':_0x143244}],_0x47922a):console[_0x14f4ff(0x113)](_0x143244),0x0;}catch(_0x55c7c7){if(_0x55c7c7 instanceof SDKError)return console[_0x14f4ff(0x142)]('Error:\x20'+_0x55c7c7[_0x14f4ff(0x138)]),_0x55c7c7[_0x14f4ff(0x158)]&&console['error']('\x20\x20Cause:\x20'+_0x55c7c7[_0x14f4ff(0x158)]),0x1;throw _0x55c7c7;}}async[a35_0x596d4b(0x110)](_0x537e0e,_0x325e92){const _0x2d82b9=a35_0x596d4b,{options:_0x54831b,tdx:_0x34348d}=_0x325e92;let _0xac3e0f;try{_0xac3e0f=await resolveYamlFilePath(_0x537e0e);}catch(_0x1aa81b){throw new SDKError(ErrorCode[_0x2d82b9(0x129)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1aa81b[_0x2d82b9(0x138)]);}_0x54831b['verbose']&&console[_0x2d82b9(0x142)](_0x2d82b9(0x101)+_0xac3e0f['parentSegment']+'/'+_0xac3e0f[_0x2d82b9(0xe8)]);const _0x3f92f3=await withSpinner(_0x2d82b9(0xfc),()=>_0x34348d[_0x2d82b9(0xec)]['getSegmentSQLFromYaml'](_0xac3e0f[_0x2d82b9(0x116)],_0xac3e0f[_0x2d82b9(0xdd)],_0xac3e0f[_0x2d82b9(0xe8)]),{'verbose':_0x54831b[_0x2d82b9(0x159)]});return _0x3f92f3[_0x2d82b9(0x16a)];}async[a35_0x596d4b(0xdf)](_0x22ff2e,_0x20a8a6){const _0x4e4199=a35_0x596d4b,{options:_0x355f73,tdx:_0x48a845}=_0x20a8a6,_0x254ae8=_0x355f73[_0x4e4199(0xdd)],_0x10b045=await resolveSegmentTarget(_0x22ff2e,_0x254ae8,_0x355f73[_0x4e4199(0x159)]);_0x355f73[_0x4e4199(0x159)]&&console[_0x4e4199(0x142)](_0x4e4199(0x14e)+_0x10b045);const _0x12ec56=await withSpinner(_0x4e4199(0x10b)+_0x22ff2e+_0x4e4199(0x16d),()=>_0x48a845[_0x4e4199(0xec)][_0x4e4199(0xfd)](_0x10b045),{'verbose':_0x355f73[_0x4e4199(0x159)]}),_0x52df33=_0x12ec56['data'];_0x355f73['verbose']&&(console[_0x4e4199(0x142)](_0x4e4199(0x133)+_0x52df33[_0x4e4199(0x132)]),console[_0x4e4199(0x142)](_0x4e4199(0x148)+_0x52df33[_0x4e4199(0xf7)]));if(_0x52df33[_0x4e4199(0x132)]==='folder')throw new SDKError(ErrorCode[_0x4e4199(0x129)],_0x4e4199(0x103));if(_0x52df33['type']===_0x4e4199(0x102))throw new SDKError(ErrorCode[_0x4e4199(0x129)],_0x4e4199(0x13f));if(!_0x52df33['segmentId'])throw new SDKError(ErrorCode[_0x4e4199(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3fa62a=await withSpinner(_0x4e4199(0x125),()=>_0x48a845[_0x4e4199(0xec)][_0x4e4199(0x156)](_0x52df33[_0x4e4199(0xf7)],_0x52df33[_0x4e4199(0x131)]),{'verbose':_0x355f73[_0x4e4199(0x159)]});return _0x3fa62a[_0x4e4199(0x16a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x596d4b(0x177)]='segment:folder:create';[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x154);async[a35_0x596d4b(0x127)](_0x6ee48a){const _0x428892=a35_0x596d4b,{options:_0x43f9e8,args:_0x5b6668,tdx:_0x161b60}=_0x6ee48a,_0x4cb4a0=_0x43f9e8;if(_0x5b6668['length']<0x2)return console['error'](_0x428892(0x106)),console[_0x428892(0x142)](_0x428892(0x15b)),0x1;const _0xdd587=_0x5b6668[0x0],_0x27265c=_0x5b6668[0x1];_0x4cb4a0[_0x428892(0x159)]&&(console[_0x428892(0x142)]('Site:\x20'+_0x4cb4a0[_0x428892(0x123)]),console[_0x428892(0x142)]('Parent\x20segment:\x20'+_0xdd587),console[_0x428892(0x142)](_0x428892(0x136)+_0x27265c));let _0x15f4d9;if(_0x4cb4a0[_0x428892(0x11d)]){const _0xb99b1d=_0x4cb4a0[_0x428892(0x11d)],_0x5e7761=await withSpinner(_0x428892(0x143)+_0xdd587+_0x428892(0x16d),()=>_0x161b60[_0x428892(0xec)][_0x428892(0x144)](_0xdd587),{'verbose':_0x4cb4a0[_0x428892(0x159)]}),_0x59eb93=_0x5e7761['data'],_0x24a667=await withSpinner(_0x428892(0x114)+_0xb99b1d+'\x27...',()=>_0x161b60[_0x428892(0xec)]['resolveFolderId'](_0x59eb93,_0xb99b1d),{'verbose':_0x4cb4a0[_0x428892(0x159)]});_0x15f4d9=_0x24a667[_0x428892(0x16a)],_0x4cb4a0[_0x428892(0x159)]&&console['error'](_0x428892(0xf0)+_0x15f4d9);}const _0x22ee17={'name':_0x27265c,'description':_0x4cb4a0['description'],'parentFolderId':_0x15f4d9},_0x327efe=await withSpinner(_0x428892(0xef)+_0x27265c+_0x428892(0x16d),()=>_0x161b60[_0x428892(0xec)][_0x428892(0x168)](_0xdd587,_0x22ee17),{'verbose':_0x4cb4a0[_0x428892(0x159)]}),_0x5c6de5=_0x327efe[_0x428892(0x16a)];return console[_0x428892(0x142)]('✔\x20Created\x20folder\x20\x27'+_0x5c6de5[_0x428892(0x177)]+_0x428892(0x108)+_0x5c6de5['id']),await handleSDKOutput([_0x5c6de5],_0x4cb4a0),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0x10f);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x12a);async[a35_0x596d4b(0x127)](_0x97e79c){const _0x31bf32=a35_0x596d4b,{options:_0x567ce0,args:_0x152d2a,tdx:_0x27bed1}=_0x97e79c,_0x254a78=_0x152d2a[0x0];if(!_0x254a78)return console[_0x31bf32(0x142)](_0x31bf32(0x10d)),console['error'](_0x31bf32(0x17f)),console['error'](_0x31bf32(0x135)),console['error'](_0x31bf32(0x152)),console[_0x31bf32(0x142)](_0x31bf32(0x14d)),console['error'](_0x31bf32(0xe4)),console['error'](_0x31bf32(0x14a)),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x220825=_0x567ce0[_0x31bf32(0xdd)],_0x27634b=await resolveSegmentTarget(_0x254a78,_0x220825,_0x567ce0[_0x31bf32(0x159)]);_0x567ce0['verbose']&&console[_0x31bf32(0x142)](_0x31bf32(0x14e)+_0x27634b);const _0x4c9d1f=await withSpinner('Resolving\x20\x27'+_0x254a78+_0x31bf32(0x16d),()=>_0x27bed1[_0x31bf32(0xec)][_0x31bf32(0xfd)](_0x27634b),{'verbose':_0x567ce0[_0x31bf32(0x159)]}),_0x43ff99=_0x4c9d1f['data'];_0x567ce0['verbose']&&(console[_0x31bf32(0x142)](_0x31bf32(0x133)+_0x43ff99['type']),console[_0x31bf32(0x142)](_0x31bf32(0x148)+_0x43ff99[_0x31bf32(0xf7)]),_0x43ff99[_0x31bf32(0x13c)]&&console['error'](_0x31bf32(0xee)+_0x43ff99['folderId']),_0x43ff99[_0x31bf32(0x131)]&&console[_0x31bf32(0x142)](_0x31bf32(0xdb)+_0x43ff99[_0x31bf32(0x131)]));if(_0x567ce0[_0x31bf32(0xda)]){if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0x13a))return console[_0x31bf32(0x142)](_0x31bf32(0x111)),0x1;if(_0x43ff99['type']===_0x31bf32(0x102))return console['error'](_0x31bf32(0x178)),console[_0x31bf32(0x142)](_0x31bf32(0x130)),0x1;if(!_0x43ff99[_0x31bf32(0x131)])throw new SDKError(ErrorCode[_0x31bf32(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4da9d7=getConsoleNextUrl(_0x567ce0['site'],_0x31bf32(0xe7)+_0x43ff99[_0x31bf32(0xf7)]+_0x31bf32(0x146)+_0x43ff99[_0x31bf32(0x131)]);return console[_0x31bf32(0x142)](a35_0x1088f7[_0x31bf32(0xf1)]('✔')+_0x31bf32(0x13e)+a35_0x1088f7[_0x31bf32(0x119)](_0x4da9d7)),openBrowser(_0x4da9d7),0x0;}if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0x13a)){if(!_0x43ff99[_0x31bf32(0x13c)])throw new SDKError(ErrorCode[_0x31bf32(0x16b)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x416751=await withSpinner('Fetching\x20folder\x20details...',()=>_0x27bed1['segment'][_0x31bf32(0xeb)](_0x43ff99['folderId']),{'verbose':_0x567ce0[_0x31bf32(0x159)]});await handleSingleObjectOutput(_0x416751['data'],_0x567ce0);}else{if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0xec)){if(!_0x43ff99['segmentId'])throw new SDKError(ErrorCode[_0x31bf32(0x150)],_0x31bf32(0xe0));const _0x3418c9=await withSpinner(_0x31bf32(0x15f),()=>_0x27bed1[_0x31bf32(0xec)]['getSegment'](_0x43ff99['parentId'],_0x43ff99[_0x31bf32(0x131)]),{'verbose':_0x567ce0[_0x31bf32(0x159)]}),_0x5509e9=getConsoleNextUrl(_0x567ce0[_0x31bf32(0x123)],'/app/ps/'+_0x43ff99[_0x31bf32(0xf7)]+_0x31bf32(0x146)+_0x43ff99[_0x31bf32(0x131)]),_0x9e644f=_0x3418c9[_0x31bf32(0x16a)];_0x9e644f[_0x31bf32(0x149)]=_0x5509e9,await handleSingleObjectOutput(_0x9e644f,_0x567ce0);}else return console[_0x31bf32(0x142)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x31bf32(0x142)](_0x31bf32(0xed)),0x1;}return 0x0;}catch(_0x4004f4){if(_0x4004f4 instanceof SDKError)return console[_0x31bf32(0x142)](_0x31bf32(0x166)+_0x4004f4['message']),_0x4004f4[_0x31bf32(0x158)]&&console[_0x31bf32(0x142)]('\x20\x20Cause:\x20'+_0x4004f4[_0x31bf32(0x158)]),0x1;throw _0x4004f4;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xff);['description']=a35_0x596d4b(0x160);async[a35_0x596d4b(0x127)](_0x1ae029){const _0xfd4bc6=a35_0x596d4b,{options:_0x3fb2ab,args:_0x247753,tdx:_0x4f554b}=_0x1ae029,_0x38f61c=_0x247753[0x0];if(!_0x38f61c)return console['error'](_0xfd4bc6(0xf2)),console['error'](_0xfd4bc6(0x17b)),console['error'](_0xfd4bc6(0x137)),console['error'](_0xfd4bc6(0xe4)),console['error'](_0xfd4bc6(0x104)),console[_0xfd4bc6(0x142)](_0xfd4bc6(0x161)),0x1;try{const _0x2a1014=_0x3fb2ab[_0xfd4bc6(0xdd)],_0x3f3bb4=await resolveSegmentTarget(_0x38f61c,_0x2a1014,_0x3fb2ab['verbose']);_0x3fb2ab[_0xfd4bc6(0x159)]&&console['error'](_0xfd4bc6(0x14e)+_0x3f3bb4);const _0x3ef2f6=await withSpinner('Resolving\x20\x27'+_0x38f61c+_0xfd4bc6(0x16d),()=>_0x4f554b[_0xfd4bc6(0xec)][_0xfd4bc6(0xfd)](_0x3f3bb4),{'verbose':_0x3fb2ab[_0xfd4bc6(0x159)]}),_0x513be9=_0x3ef2f6[_0xfd4bc6(0x16a)];_0x3fb2ab[_0xfd4bc6(0x159)]&&(console[_0xfd4bc6(0x142)](_0xfd4bc6(0x133)+_0x513be9[_0xfd4bc6(0x132)]),console[_0xfd4bc6(0x142)](_0xfd4bc6(0x148)+_0x513be9['parentId']));if(_0x513be9[_0xfd4bc6(0x132)]==='folder')return console[_0xfd4bc6(0x142)](_0xfd4bc6(0xe1)),console[_0xfd4bc6(0x142)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x513be9[_0xfd4bc6(0x132)]==='parent')return console[_0xfd4bc6(0x142)](_0xfd4bc6(0xe5)),console[_0xfd4bc6(0x142)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x513be9['segmentId'])throw new SDKError(ErrorCode[_0xfd4bc6(0x150)],_0xfd4bc6(0xe0));const _0x339478=await withSpinner(_0xfd4bc6(0x125),()=>_0x4f554b[_0xfd4bc6(0xec)]['getSegmentSQL'](_0x513be9['parentId'],_0x513be9[_0xfd4bc6(0x131)]),{'verbose':_0x3fb2ab[_0xfd4bc6(0x159)]}),_0x34fccd=_0x339478[_0xfd4bc6(0x16a)],_0x58fe36=await executeSchemaQuery(_0x34fccd,_0x4f554b,_0x3fb2ab);return await handleQueryOutput(_0x58fe36,_0x3fb2ab),0x0;}catch(_0x598ff0){if(_0x598ff0 instanceof SDKError)return console[_0xfd4bc6(0x142)](_0xfd4bc6(0x166)+_0x598ff0['message']),_0x598ff0[_0xfd4bc6(0x158)]&&console[_0xfd4bc6(0x142)](_0xfd4bc6(0x11c)+_0x598ff0[_0xfd4bc6(0x158)]),0x1;throw _0x598ff0;}}}
|
|
1
|
+
const a35_0x2f6a02=a35_0x45c6;(function(_0x17695e,_0x5aea9c){const _0x1501f9=a35_0x45c6,_0x5261cd=_0x17695e();while(!![]){try{const _0x31f993=parseInt(_0x1501f9(0x15b))/0x1+-parseInt(_0x1501f9(0x179))/0x2+parseInt(_0x1501f9(0x149))/0x3+parseInt(_0x1501f9(0x1d1))/0x4*(-parseInt(_0x1501f9(0x167))/0x5)+parseInt(_0x1501f9(0x156))/0x6+-parseInt(_0x1501f9(0x1d4))/0x7+parseInt(_0x1501f9(0x16c))/0x8;if(_0x31f993===_0x5aea9c)break;else _0x5261cd['push'](_0x5261cd['shift']());}catch(_0x17fcd1){_0x5261cd['push'](_0x5261cd['shift']());}}}(a35_0x2046,0x78bfa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x10ce32 from'chalk';async function resolveSegmentTarget(_0x3eea24,_0x350a51,_0x47ffda){const _0x2c026c=a35_0x45c6;if(isYamlFilePath(_0x3eea24))try{const _0x4eb535=await resolveYamlFilePath(_0x3eea24);return _0x47ffda&&(console[_0x2c026c(0x1c9)](_0x2c026c(0x1c4)+_0x3eea24),console[_0x2c026c(0x1c9)]('\x20\x20Parent\x20segment:\x20'+_0x4eb535['parentSegment']),console[_0x2c026c(0x1c9)](_0x2c026c(0x1bc)+_0x4eb535[_0x2c026c(0x150)]),console['error'](_0x2c026c(0x192)+(_0x4eb535[_0x2c026c(0x178)]||'(root)')),console[_0x2c026c(0x1c9)]('\x20\x20Full\x20path:\x20'+_0x4eb535[_0x2c026c(0x19f)])),_0x4eb535[_0x2c026c(0x19f)];}catch(_0x44e665){throw new SDKError(ErrorCode[_0x2c026c(0x17f)],_0x2c026c(0x1cb)+_0x44e665[_0x2c026c(0x171)]);}if(!_0x350a51)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x350a51+'/'+_0x3eea24;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x145);[a35_0x2f6a02(0x1a0)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0x2f6a02(0x155)](_0x4cd340){const _0x34abc4=a35_0x2f6a02,{options:_0x2a8b14,args:_0xe72236,tdx:_0x4bf29d}=_0x4cd340,_0xa30dff=_0xe72236[0x0],_0x511f26=!_0xa30dff&&!!_0x2a8b14[_0x34abc4(0x1c6)],_0x314ee2=_0xa30dff||_0x2a8b14[_0x34abc4(0x1c6)];if(!_0x314ee2)return console[_0x34abc4(0x1c9)](_0x34abc4(0x16b)),console[_0x34abc4(0x1c9)](_0x34abc4(0x1ad)),console[_0x34abc4(0x1c9)]('Examples:'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x34abc4(0x1c9)](_0x34abc4(0x15d)),console[_0x34abc4(0x1c9)](_0x34abc4(0x18c)),0x1;try{const _0x1e8234=_0x2a8b14[_0x34abc4(0x14d)];let _0x321bbd=_0x314ee2;!_0x511f26&&_0x1e8234&&!_0x314ee2[_0x34abc4(0x161)]('/')&&(_0x321bbd=_0x1e8234+'/'+_0x314ee2,_0x2a8b14[_0x34abc4(0x1c8)]&&console[_0x34abc4(0x1c9)]('Resolved\x20relative\x20path\x20to:\x20'+_0x321bbd));const _0x9cf25b=await withSpinner(_0x34abc4(0x14a)+_0x321bbd+'\x27...',()=>_0x4bf29d['segment'][_0x34abc4(0x1b6)](_0x321bbd),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]}),_0x111d20=_0x9cf25b['data'];_0x2a8b14[_0x34abc4(0x1c8)]&&(console[_0x34abc4(0x1c9)](_0x34abc4(0x18a)+_0x111d20[_0x34abc4(0x19a)]),console[_0x34abc4(0x1c9)](_0x34abc4(0x196)+_0x111d20['parentId']),_0x111d20[_0x34abc4(0x16e)]&&console['error'](_0x34abc4(0x173)+_0x111d20[_0x34abc4(0x16e)]),_0x111d20['segmentId']&&console['error']('Segment\x20ID:\x20'+_0x111d20[_0x34abc4(0x19d)]));if(_0x111d20['type']==='parent'){const _0xd2feef=await withSpinner(_0x34abc4(0x19e),()=>_0x4bf29d[_0x34abc4(0x158)]['getParent'](_0x111d20[_0x34abc4(0x18d)]),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd2feef[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]==='folder'){if(!_0x111d20[_0x34abc4(0x16e)])throw new SDKError(ErrorCode[_0x34abc4(0x187)],_0x34abc4(0x159));const _0x24b348=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x151)](_0x111d20[_0x34abc4(0x16e)]),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]});await handleSingleObjectOutput(_0x24b348[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]===_0x34abc4(0x158)){if(!_0x111d20[_0x34abc4(0x19d)])throw new SDKError(ErrorCode[_0x34abc4(0x188)],_0x34abc4(0x1b8));const _0xd0b109=await withSpinner(_0x34abc4(0x1ba),()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x1b4)](_0x111d20['parentId'],_0x111d20['segmentId']),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd0b109[_0x34abc4(0x1be)],_0x2a8b14);}}}return 0x0;}catch(_0x2643c4){if(_0x2643c4 instanceof SDKError)return console['error'](_0x34abc4(0x18b)+_0x2643c4[_0x34abc4(0x171)]),_0x2643c4[_0x34abc4(0x19c)]&&console[_0x34abc4(0x1c9)]('\x20\x20Cause:\x20'+_0x2643c4[_0x34abc4(0x19c)]),0x1;throw _0x2643c4;}}}function a35_0x45c6(_0x6a9f68,_0x1b0d83){_0x6a9f68=_0x6a9f68-0x145;const _0x2046b0=a35_0x2046();let _0x45c6a9=_0x2046b0[_0x6a9f68];return _0x45c6a9;}export class SegmentShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:show';[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1ce);async['execute'](_0x592b29){const _0x3e314d=a35_0x2f6a02,{options:_0x2d8ece,args:_0x2173e6,tdx:_0xceb6fc}=_0x592b29,_0x1e4e49=_0x2173e6[0x0];if(!_0x1e4e49)return console[_0x3e314d(0x1c9)](_0x3e314d(0x1ac)),console[_0x3e314d(0x1c9)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3e314d(0x1c9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x3e314d(0x1c9)](_0x3e314d(0x15c)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a6)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1cc)),0x1;try{const _0x3d9fa0=_0x2d8ece[_0x3e314d(0x1c6)],_0x2721c9=await resolveSegmentTarget(_0x1e4e49,_0x3d9fa0,_0x2d8ece['verbose']);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x146)+_0x2721c9);const _0x5b0f32=await withSpinner(_0x3e314d(0x1b9)+_0x1e4e49+'\x27...',()=>_0xceb6fc[_0x3e314d(0x158)][_0x3e314d(0x1b6)](_0x2721c9),{'verbose':_0x2d8ece['verbose']}),_0x32c5e1=_0x5b0f32[_0x3e314d(0x1be)];_0x2d8ece[_0x3e314d(0x1c8)]&&(console[_0x3e314d(0x1c9)](_0x3e314d(0x18a)+_0x32c5e1['type']),console[_0x3e314d(0x1c9)](_0x3e314d(0x196)+_0x32c5e1[_0x3e314d(0x18d)]));if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x191))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x174)),0x1;if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x169))return console[_0x3e314d(0x1c9)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a7)),0x1;if(!_0x32c5e1['segmentId'])throw new SDKError(ErrorCode[_0x3e314d(0x188)],_0x3e314d(0x1b8));const _0x57d816=await withSpinner(_0x3e314d(0x198),()=>_0xceb6fc[_0x3e314d(0x158)]['getSegmentSQL'](_0x32c5e1[_0x3e314d(0x18d)],_0x32c5e1[_0x3e314d(0x19d)]),{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]});let _0x1de571=_0x57d816[_0x3e314d(0x1be)];const _0x800972=resolveLimit(_0x2d8ece['limit'],DEFAULT_DISPLAY_LIMIT),_0x38ed8d=/\bLIMIT\s+\d+/i['test'](_0x1de571);!_0x38ed8d&&(_0x1de571=_0x1de571[_0x3e314d(0x18e)]()[_0x3e314d(0x157)](/;+$/,''),_0x1de571=_0x3e314d(0x175)+_0x1de571+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x800972);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x1af)+_0x1de571);const _0x48c65e=await withProgressSpinner('Executing\x20segment\x20query...',async _0x518956=>{const _0xfde832=_0x3e314d,_0x27da0b=await _0xceb6fc[_0xfde832(0x1d6)][_0xfde832(0x155)](_0x1de571,{'catalog':'td','schema':_0xfde832(0x14b),'onJobId':_0x48c10c=>{const _0x307603=_0xfde832;_0x518956[_0x307603(0x17d)](_0x48c10c);}});return _0x27da0b;},{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]}),_0x25cb05=_0x48c65e[_0x3e314d(0x1be)],_0x2c072e=_0x25cb05[_0x3e314d(0x1a3)]?_0x3e314d(0x1b0)+_0x25cb05[_0x3e314d(0x1a3)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x25cb05[_0x3e314d(0x195)][_0x3e314d(0x1c5)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x25cb05['stats'][_0x3e314d(0x1c2)])+_0x2c072e)),await handleQueryOutput(_0x25cb05,_0x2d8ece),0x0;}catch(_0x22c877){if(_0x22c877 instanceof SDKError)return console['error']('✖\x20Query\x20failed\x20['+_0x22c877[_0x3e314d(0x17c)]+']'),console['error']('\x0a'+_0x22c877[_0x3e314d(0x171)]),0x1;throw _0x22c877;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x14c);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x172);async['execute'](_0x4ba497){const _0x1a16a2=a35_0x2f6a02,{options:_0x1ab39e,args:_0x3bb269,tdx:_0x66d1c0}=_0x4ba497;if(_0x3bb269['length']===0x0)return console[_0x1a16a2(0x1c9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1a16a2(0x1c9)](_0x1a16a2(0x180)),0x1;const _0x565a49=_0x3bb269[0x0];try{_0x1ab39e[_0x1a16a2(0x1c8)]&&(console[_0x1a16a2(0x1c9)](_0x1a16a2(0x153)+_0x1ab39e['site']),console[_0x1a16a2(0x1c9)]('Parent\x20name:\x20'+_0x565a49));const _0x4f1618=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)]['resolveParentId'](_0x565a49),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2199ec=_0x4f1618['data'];_0x1ab39e[_0x1a16a2(0x1c8)]&&console['error'](_0x1a16a2(0x17a)+_0x2199ec);const _0x23200b=await withSpinner(_0x1a16a2(0x181)+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)][_0x1a16a2(0x1cd)](_0x2199ec),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2b3c7e=_0x23200b[_0x1a16a2(0x1be)];return console[_0x1a16a2(0x1c9)]('✔\x20Found\x20'+_0x2b3c7e[_0x1a16a2(0x170)]+_0x1a16a2(0x1b1)+(_0x2b3c7e[_0x1a16a2(0x170)]!==0x1?'s':'')),await handleSDKOutput(_0x2b3c7e,_0x1ab39e),0x0;}catch(_0x13b366){if(_0x13b366 instanceof SDKError)return console[_0x1a16a2(0x1c9)]('Error:\x20'+_0x13b366[_0x1a16a2(0x171)]),_0x13b366['cause']&&console[_0x1a16a2(0x1c9)]('\x20\x20Cause:\x20'+_0x13b366[_0x1a16a2(0x19c)]),0x1;throw _0x13b366;}}}function a35_0x2046(){const _0x2222a1=['List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Folder\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','SELECT\x20*\x20FROM\x20(\x0a','\x27\x20with\x20ID:\x20','Segment\x20ID:\x20','folderPath','1388562VFwrSS','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','code','setJobId','Show\x20segment\x20folder\x20details','INVALID_ARGUMENT','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Listing\x20folders\x20for\x20parent\x20\x27','/e/','\x27...','log','✔\x20Created\x20folder\x20\x27','getSQLFromServerSegment','SEGMENT_FOLDER_NOT_FOUND','SEGMENT_NOT_FOUND','url','Resolved\x20type:\x20','Error:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentId','trim','Fetching\x20SQL\x20from\x20rule...','segment:folder:show','folder','\x20\x20Folder\x20path:\x20','/app/ps/','Parent\x20segment:\x20','stats','Parent\x20ID:\x20','resolveFolderId','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20sg\x20desc\x20<name>','type','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','cause','segmentId','Fetching\x20parent\x20segment\x20details...','fullPath','description','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','jobId','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20show','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Options:','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20describe\x20<path>','site','SQL\x20query:\x0a','\x20[Job\x20ID:\x20','\x20folder','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Cause:\x20','getSegment','segment:sql','resolvePathToResource','parentFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20\x27','Fetching\x20segment\x20details...','name','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','data','getSQLFromYamlFile','segment:folder:create','segment:desc','elapsedTimeMillis','Resolving\x20parent\x20segment\x20\x27','Resolved\x20YAML\x20file:\x20','processedRows','parentSegment','\x20\x20tdx\x20sg\x20sql\x20--path\x20','verbose','error','cyan','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','listFolders','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20folder\x20\x27','web','256DjKrrO','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','3693088FSXAjI','path','query','segment:describe','Target\x20path:\x20','Folder\x20name:\x20','\x20Opening\x20','1587408CTPMnq','Resolving\x20path\x20\x27','information_schema','segment:folder:list','segmentPath','getSegmentSQL','createFolder','segmentName','getFolder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Site:\x20','getSegmentSQLFromYaml','execute','423918lGYArp','replace','segment','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','866562rJHufm','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','green','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','includes','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','red','resolveParentId','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Create\x20segment\x20folder\x20for\x20organization','4820Zwndex','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','parent','format','Error:\x20Path\x20or\x20name\x20is\x20required','2494368iMdoia','Use:\x20tdx\x20ps\x20view','folderId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','length','message'];a35_0x2046=function(){return _0x2222a1;};return a35_0x2046();}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x190);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x17e);async[a35_0x2f6a02(0x155)](_0x595cd1){const _0x52a1fa=a35_0x2f6a02,{options:_0x5e363f,args:_0x59af0d,tdx:_0x277965}=_0x595cd1;if(_0x59af0d['length']===0x0)return console[_0x52a1fa(0x1c9)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error'](_0x52a1fa(0x15f)),0x1;try{const {parentId:_0x5e2b1c,childId:_0x365f76}=parseSegmentRef(_0x59af0d[0x0]);_0x5e363f[_0x52a1fa(0x1c8)]&&(console[_0x52a1fa(0x1c9)](_0x52a1fa(0x153)+_0x5e363f[_0x52a1fa(0x1ae)]),console[_0x52a1fa(0x1c9)]('Parent\x20name:\x20'+_0x5e2b1c),_0x365f76&&console[_0x52a1fa(0x1c9)]('Folder\x20name:\x20'+_0x365f76));if(!_0x365f76)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1d3)),0x1;const _0x1943f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5e2b1c+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)]['resolveParentId'](_0x5e2b1c),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x85a500=_0x1943f1[_0x52a1fa(0x1be)];_0x5e363f[_0x52a1fa(0x1c8)]&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x17a)+_0x85a500);const _0x26b656=await withSpinner('Resolving\x20folder\x20\x27'+_0x365f76+'\x27...',()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x197)](_0x85a500,_0x365f76),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x2ba5b4=_0x26b656[_0x52a1fa(0x1be)];_0x5e363f['verbose']&&console[_0x52a1fa(0x1c9)]('Resolved\x20folder\x20ID:\x20'+_0x2ba5b4);const _0x122ab6=await withSpinner('Fetching\x20folder\x20\x27'+_0x365f76+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x151)](_0x2ba5b4),{'verbose':_0x5e363f['verbose']});return await handleSDKOutput([_0x122ab6[_0x52a1fa(0x1be)]],_0x5e363f),0x0;}catch(_0x299e83){if(_0x299e83 instanceof SDKError)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x18b)+_0x299e83[_0x52a1fa(0x171)]),_0x299e83['cause']&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1b3)+_0x299e83[_0x52a1fa(0x19c)]),0x1;throw _0x299e83;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a35_0x2f6a02(0x1b5);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x7d5f0){const _0x38077e=a35_0x2f6a02,{options:_0x525512,args:_0x1554b5}=_0x7d5f0,_0x2e80f3=_0x525512,_0x3047b2=_0x2e80f3[_0x38077e(0x1d5)],_0x3c2a39=_0x1554b5[0x0];if(!_0x3c2a39&&!_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x19b))),console[_0x38077e(0x1c9)]('Usage:'),console[_0x38077e(0x1c9)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x38077e(0x1c9)](_0x38077e(0x1b2)),console['error'](_0x38077e(0x15c)),console[_0x38077e(0x1c9)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x38077e(0x1c9)](_0x38077e(0x1bd)),0x1;if(_0x3c2a39&&_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x6242e0;if(_0x3047b2)_0x6242e0=await this[_0x38077e(0x1bf)](_0x3047b2,_0x7d5f0);else{if(isYamlFilePath(_0x3c2a39))return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x162))),console[_0x38077e(0x1c9)](_0x38077e(0x1c7)+_0x3c2a39),0x1;else _0x6242e0=await this['getSQLFromServerSegment'](_0x3c2a39,_0x7d5f0);}return _0x525512['format']==='json'||_0x525512[_0x38077e(0x16a)]==='jsonl'?await handleSDKOutput([{'sql':_0x6242e0}],_0x525512):console[_0x38077e(0x184)](_0x6242e0),0x0;}catch(_0x2903da){if(_0x2903da instanceof SDKError)return console['error'](_0x38077e(0x18b)+_0x2903da[_0x38077e(0x171)]),_0x2903da[_0x38077e(0x19c)]&&console['error'](_0x38077e(0x1b3)+_0x2903da['cause']),0x1;throw _0x2903da;}}async['getSQLFromYamlFile'](_0x198844,_0x5c3141){const _0x53ba69=a35_0x2f6a02,{options:_0x4ab629,tdx:_0x4f5696}=_0x5c3141;let _0x526f47;try{_0x526f47=await resolveYamlFilePath(_0x198844);}catch(_0x5d1ab8){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53ba69(0x1cb)+_0x5d1ab8[_0x53ba69(0x171)]);}_0x4ab629[_0x53ba69(0x1c8)]&&console[_0x53ba69(0x1c9)]('Resolved:\x20'+_0x526f47['parentSegment']+'/'+_0x526f47['segmentName']);const _0x5d5555=await withSpinner(_0x53ba69(0x18f),()=>_0x4f5696[_0x53ba69(0x158)][_0x53ba69(0x154)](_0x526f47[_0x53ba69(0x1a4)],_0x526f47['parentSegment'],_0x526f47[_0x53ba69(0x150)]),{'verbose':_0x4ab629[_0x53ba69(0x1c8)]});return _0x5d5555[_0x53ba69(0x1be)];}async[a35_0x2f6a02(0x186)](_0xafddba,_0x5193d7){const _0x51e393=a35_0x2f6a02,{options:_0x149ee0,tdx:_0x333010}=_0x5193d7,_0x1d606c=_0x149ee0[_0x51e393(0x1c6)],_0x4415ac=await resolveSegmentTarget(_0xafddba,_0x1d606c,_0x149ee0[_0x51e393(0x1c8)]);_0x149ee0['verbose']&&console[_0x51e393(0x1c9)](_0x51e393(0x146)+_0x4415ac);const _0x54e350=await withSpinner(_0x51e393(0x1b9)+_0xafddba+'\x27...',()=>_0x333010[_0x51e393(0x158)]['resolvePathToResource'](_0x4415ac),{'verbose':_0x149ee0[_0x51e393(0x1c8)]}),_0x45ae5a=_0x54e350[_0x51e393(0x1be)];_0x149ee0[_0x51e393(0x1c8)]&&(console[_0x51e393(0x1c9)]('Resolved\x20type:\x20'+_0x45ae5a[_0x51e393(0x19a)]),console[_0x51e393(0x1c9)](_0x51e393(0x196)+_0x45ae5a['parentId']));if(_0x45ae5a[_0x51e393(0x19a)]===_0x51e393(0x191))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x45ae5a['type']===_0x51e393(0x169))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x45ae5a[_0x51e393(0x19d)])throw new SDKError(ErrorCode[_0x51e393(0x188)],_0x51e393(0x1b8));const _0x28c83b=await withSpinner(_0x51e393(0x198),()=>_0x333010[_0x51e393(0x158)][_0x51e393(0x14e)](_0x45ae5a['parentId'],_0x45ae5a[_0x51e393(0x19d)]),{'verbose':_0x149ee0[_0x51e393(0x1c8)]});return _0x28c83b[_0x51e393(0x1be)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c0);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x166);async[a35_0x2f6a02(0x155)](_0x2f0635){const _0x5c9ba1=a35_0x2f6a02,{options:_0x18d363,args:_0x51de1a,tdx:_0x479601}=_0x2f0635,_0x494df4=_0x18d363;if(_0x51de1a['length']<0x2)return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x1a9)),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x168)),0x1;const _0x26dd30=_0x51de1a[0x0],_0x34f1df=_0x51de1a[0x1];_0x494df4[_0x5c9ba1(0x1c8)]&&(console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x153)+_0x494df4[_0x5c9ba1(0x1ae)]),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x194)+_0x26dd30),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x147)+_0x34f1df));let _0x53074e;if(_0x494df4[_0x5c9ba1(0x1b7)]){const _0x446bf1=_0x494df4[_0x5c9ba1(0x1b7)],_0xf4fff5=await withSpinner(_0x5c9ba1(0x1c3)+_0x26dd30+'\x27...',()=>_0x479601['segment'][_0x5c9ba1(0x164)](_0x26dd30),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]}),_0x225654=_0xf4fff5[_0x5c9ba1(0x1be)],_0x2a1c13=await withSpinner(_0x5c9ba1(0x1cf)+_0x446bf1+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x197)](_0x225654,_0x446bf1),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]});_0x53074e=_0x2a1c13[_0x5c9ba1(0x1be)],_0x494df4[_0x5c9ba1(0x1c8)]&&console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x17b)+_0x53074e);}const _0x3389b1={'name':_0x34f1df,'description':_0x494df4[_0x5c9ba1(0x1a0)],'parentFolderId':_0x53074e},_0x407399=await withSpinner('Creating\x20folder\x20\x27'+_0x34f1df+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x14f)](_0x26dd30,_0x3389b1),{'verbose':_0x494df4['verbose']}),_0x34b3cd=_0x407399[_0x5c9ba1(0x1be)];return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x185)+_0x34b3cd[_0x5c9ba1(0x1bb)]+_0x5c9ba1(0x176)+_0x34b3cd['id']),await handleSDKOutput([_0x34b3cd],_0x494df4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:view';[a35_0x2f6a02(0x1a0)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x2f6a02(0x155)](_0x2685e6){const _0x1bb54f=a35_0x2f6a02,{options:_0x2e9f8b,args:_0x1a6335,tdx:_0x24c124}=_0x2685e6,_0x453213=_0x1a6335[0x0];if(!_0x453213)return console['error'](_0x1bb54f(0x16f)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x165)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a5)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1aa)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a2)),console[_0x1bb54f(0x1c9)]('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1bb54f(0x1c9)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1ab)),0x1;try{const _0x16dcd3=_0x2e9f8b[_0x1bb54f(0x1c6)],_0x29df10=await resolveSegmentTarget(_0x453213,_0x16dcd3,_0x2e9f8b[_0x1bb54f(0x1c8)]);_0x2e9f8b[_0x1bb54f(0x1c8)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x146)+_0x29df10);const _0x222c9d=await withSpinner(_0x1bb54f(0x1b9)+_0x453213+'\x27...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x1b6)](_0x29df10),{'verbose':_0x2e9f8b['verbose']}),_0x3cd70a=_0x222c9d[_0x1bb54f(0x1be)];_0x2e9f8b[_0x1bb54f(0x1c8)]&&(console[_0x1bb54f(0x1c9)]('Resolved\x20type:\x20'+_0x3cd70a[_0x1bb54f(0x19a)]),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x196)+_0x3cd70a['parentId']),_0x3cd70a[_0x1bb54f(0x16e)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x173)+_0x3cd70a[_0x1bb54f(0x16e)]),_0x3cd70a[_0x1bb54f(0x19d)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x177)+_0x3cd70a[_0x1bb54f(0x19d)]));if(_0x2e9f8b[_0x1bb54f(0x1d0)]){if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x191))return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x160)),0x1;if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x169))return console[_0x1bb54f(0x1c9)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1bb54f(0x1c9)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2d6362=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],'/app/ps/'+_0x3cd70a[_0x1bb54f(0x18d)]+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]);return console[_0x1bb54f(0x1c9)](a35_0x10ce32[_0x1bb54f(0x15e)]('✔')+_0x1bb54f(0x148)+a35_0x10ce32[_0x1bb54f(0x1ca)](_0x2d6362)),openBrowser(_0x2d6362),0x0;}if(_0x3cd70a[_0x1bb54f(0x19a)]==='folder'){if(!_0x3cd70a[_0x1bb54f(0x16e)])throw new SDKError(ErrorCode[_0x1bb54f(0x187)],_0x1bb54f(0x159));const _0x3e7fd6=await withSpinner('Fetching\x20folder\x20details...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x151)](_0x3cd70a[_0x1bb54f(0x16e)]),{'verbose':_0x2e9f8b['verbose']});await handleSingleObjectOutput(_0x3e7fd6[_0x1bb54f(0x1be)],_0x2e9f8b);}else{if(_0x3cd70a[_0x1bb54f(0x19a)]==='segment'){if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2105be=await withSpinner(_0x1bb54f(0x1ba),()=>_0x24c124[_0x1bb54f(0x158)]['getSegment'](_0x3cd70a[_0x1bb54f(0x18d)],_0x3cd70a[_0x1bb54f(0x19d)]),{'verbose':_0x2e9f8b[_0x1bb54f(0x1c8)]}),_0x574529=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],_0x1bb54f(0x193)+_0x3cd70a['parentId']+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]),_0x2d2ef1=_0x2105be[_0x1bb54f(0x1be)];_0x2d2ef1[_0x1bb54f(0x189)]=_0x574529,await handleSingleObjectOutput(_0x2d2ef1,_0x2e9f8b);}else return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a1)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x16d)),0x1;}return 0x0;}catch(_0x2c21cf){if(_0x2c21cf instanceof SDKError)return console[_0x1bb54f(0x1c9)]('Error:\x20'+_0x2c21cf[_0x1bb54f(0x171)]),_0x2c21cf[_0x1bb54f(0x19c)]&&console[_0x1bb54f(0x1c9)]('\x20\x20Cause:\x20'+_0x2c21cf[_0x1bb54f(0x19c)]),0x1;throw _0x2c21cf;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c1);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1d2);async[a35_0x2f6a02(0x155)](_0x52c4bf){const _0x21fe95=a35_0x2f6a02,{options:_0x5f15da,args:_0x252703,tdx:_0x23dc62}=_0x52c4bf,_0x1d8c55=_0x252703[0x0];if(!_0x1d8c55)return console[_0x21fe95(0x1c9)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x21fe95(0x1c9)](_0x21fe95(0x199)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15a)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15c)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x21fe95(0x152)),0x1;try{const _0x2b0354=_0x5f15da['parentSegment'],_0x1d4da3=await resolveSegmentTarget(_0x1d8c55,_0x2b0354,_0x5f15da[_0x21fe95(0x1c8)]);_0x5f15da[_0x21fe95(0x1c8)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x146)+_0x1d4da3);const _0x2b8ac3=await withSpinner('Resolving\x20\x27'+_0x1d8c55+'\x27...',()=>_0x23dc62['segment']['resolvePathToResource'](_0x1d4da3),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x3e7a3e=_0x2b8ac3[_0x21fe95(0x1be)];_0x5f15da[_0x21fe95(0x1c8)]&&(console[_0x21fe95(0x1c9)]('Resolved\x20type:\x20'+_0x3e7a3e[_0x21fe95(0x19a)]),console['error'](_0x21fe95(0x196)+_0x3e7a3e['parentId']));if(_0x3e7a3e[_0x21fe95(0x19a)]==='folder')return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x21fe95(0x1c9)](_0x21fe95(0x1a8)),0x1;if(_0x3e7a3e[_0x21fe95(0x19a)]==='parent')return console[_0x21fe95(0x1c9)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x21fe95(0x1c9)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x3e7a3e[_0x21fe95(0x19d)])throw new SDKError(ErrorCode[_0x21fe95(0x188)],_0x21fe95(0x1b8));const _0x5e6e79=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x23dc62[_0x21fe95(0x158)][_0x21fe95(0x14e)](_0x3e7a3e[_0x21fe95(0x18d)],_0x3e7a3e[_0x21fe95(0x19d)]),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x8354d2=_0x5e6e79['data'],_0x2cb370=await executeSchemaQuery(_0x8354d2,_0x23dc62,_0x5f15da);return await handleQueryOutput(_0x2cb370,_0x5f15da),0x0;}catch(_0x300018){if(_0x300018 instanceof SDKError)return console[_0x21fe95(0x1c9)](_0x21fe95(0x18b)+_0x300018['message']),_0x300018[_0x21fe95(0x19c)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x1b3)+_0x300018[_0x21fe95(0x19c)]),0x1;throw _0x300018;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a36_0x2dfe(){const _0x57267d=['Parent\x20path:\x20','createSegment','Examples:','\x20\x20\x20Path:\x20','invisible','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','ruleFile','\x27\x20with\x20ID:\x20','24666inPven','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','noCountPopulation','folder','525bdleLe','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Segment\x20name:\x20','5840124BBQaMg','12786dLfKIv','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Resolved\x20relative\x20path\x20to:\x20','121bZBHbL','13tCYxVA','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','Resolving\x20folder\x20\x27','Resolved\x20folder\x20ID:\x20','length','Parent:\x20','12WbkGJd','336123sUsOyH','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','206020WyrmJw','error','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','8WtTHkn','description','Target\x20path:\x20','parent','name','site','Site:\x20','88ikUuXh','115011kDnBJb','verbose','rule','401385qtephI','execute','folderId','Resolving\x20folder\x20path\x20\x27','type','resolvePathToResource','segmentPath','\x27...','yellow'];a36_0x2dfe=function(){return _0x57267d;};return a36_0x2dfe();}const a36_0x2e5a9d=a36_0x5d8b;function a36_0x5d8b(_0x2da479,_0x4fa4b0){_0x2da479=_0x2da479-0x14d;const _0x2dfe02=a36_0x2dfe();let _0x5d8bc0=_0x2dfe02[_0x2da479];return _0x5d8bc0;}(function(_0x4e5786,_0x1e5790){const _0x4d2942=a36_0x5d8b,_0x14d9bd=_0x4e5786();while(!![]){try{const _0x4a1d77=parseInt(_0x4d2942(0x181))/0x1+parseInt(_0x4d2942(0x175))/0x2*(-parseInt(_0x4d2942(0x180))/0x3)+parseInt(_0x4d2942(0x14d))/0x4*(parseInt(_0x4d2942(0x158))/0x5)+-parseInt(_0x4d2942(0x16a))/0x6*(-parseInt(_0x4d2942(0x171))/0x7)+parseInt(_0x4d2942(0x154))/0x8*(parseInt(_0x4d2942(0x155))/0x9)+-parseInt(_0x4d2942(0x184))/0xa*(parseInt(_0x4d2942(0x178))/0xb)+-parseInt(_0x4d2942(0x174))/0xc*(parseInt(_0x4d2942(0x179))/0xd);if(_0x4a1d77===_0x1e5790)break;else _0x14d9bd['push'](_0x14d9bd['shift']());}catch(_0x950f8d){_0x14d9bd['push'](_0x14d9bd['shift']());}}}(a36_0x2dfe,0x3276c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x367ac7 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x2e5a9d(0x151)]='segment:create';[a36_0x2e5a9d(0x14e)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a36_0x2e5a9d(0x159)](_0x12d6e3){const _0x5840ee=a36_0x2e5a9d;console[_0x5840ee(0x185)](a36_0x367ac7['yellow'](_0x5840ee(0x176))),console[_0x5840ee(0x185)](a36_0x367ac7[_0x5840ee(0x160)](_0x5840ee(0x172)));const {options:_0x1c8526,args:_0x44273f,tdx:_0x507c05}=_0x12d6e3,_0x1d84bb=_0x1c8526;if(_0x44273f[_0x5840ee(0x17e)]===0x0)return console['error'](_0x5840ee(0x16b)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0x5840ee(0x163)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x5840ee(0x185)](_0x5840ee(0x17a)),console['error'](_0x5840ee(0x182)),0x1;const _0x409d07=_0x44273f[0x0],_0x53b482=_0x1c8526[_0x5840ee(0x15e)];let _0x140724=_0x409d07;_0x53b482&&!_0x409d07['includes']('/')&&(_0x140724=_0x53b482+'/'+_0x409d07,_0x1d84bb[_0x5840ee(0x156)]&&console[_0x5840ee(0x185)](_0x5840ee(0x177)+_0x140724));const _0x29aae9=parsePath(_0x140724);if(_0x29aae9['segments'][_0x5840ee(0x17e)]<0x2)return console[_0x5840ee(0x185)](_0x5840ee(0x186)),console[_0x5840ee(0x185)](_0x5840ee(0x16d)),0x1;const _0x285b11=_0x29aae9['segments'][0x0],_0x275a20=getBaseName(_0x140724),_0xa8e262=getParentPath(_0x140724);_0x1d84bb[_0x5840ee(0x156)]&&(console[_0x5840ee(0x185)](_0x5840ee(0x153)+_0x1d84bb[_0x5840ee(0x152)]),console['error'](_0x5840ee(0x14f)+_0x140724),console[_0x5840ee(0x185)](_0x5840ee(0x17f)+_0x285b11),console[_0x5840ee(0x185)](_0x5840ee(0x173)+_0x275a20),console[_0x5840ee(0x185)](_0x5840ee(0x161)+_0xa8e262));const _0x108bc7=await withSpinner(_0x5840ee(0x166)+_0x285b11+'\x27...',()=>_0x507c05[_0x5840ee(0x16c)]['resolveParentId'](_0x285b11),{'verbose':_0x1d84bb[_0x5840ee(0x156)]}),_0x3281ed=_0x108bc7[_0x5840ee(0x16e)];let _0x43b87e;if(_0x29aae9[_0x5840ee(0x17b)][_0x5840ee(0x17e)]>0x2){const _0x1bfd7c=await withSpinner(_0x5840ee(0x15b)+_0xa8e262+_0x5840ee(0x15f),()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x15d)](_0xa8e262),{'verbose':_0x1d84bb['verbose']}),_0x579a6b=_0x1bfd7c[_0x5840ee(0x16e)];if(_0x579a6b[_0x5840ee(0x15c)]!=='folder'&&_0x579a6b[_0x5840ee(0x15c)]!==_0x5840ee(0x150))return console[_0x5840ee(0x185)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x43b87e=_0x579a6b[_0x5840ee(0x15a)];}else{if(_0x1d84bb[_0x5840ee(0x170)]){const _0x546d13=await withSpinner(_0x5840ee(0x17c)+_0x1d84bb[_0x5840ee(0x170)]+'\x27...',()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x167)](_0x3281ed,_0x1d84bb[_0x5840ee(0x170)]),{'verbose':_0x1d84bb[_0x5840ee(0x156)]});_0x43b87e=_0x546d13['data'];}}_0x1d84bb[_0x5840ee(0x156)]&&_0x43b87e&&console[_0x5840ee(0x185)](_0x5840ee(0x17d)+_0x43b87e);const _0x403d5e=await loadJSONFromOptions(_0x1d84bb[_0x5840ee(0x157)],_0x1d84bb[_0x5840ee(0x168)]),_0xccaf35={'name':_0x275a20,'description':_0x1d84bb[_0x5840ee(0x14e)],'rule':_0x403d5e,'kind':_0x1d84bb[_0x5840ee(0x183)]!==undefined?parseInt(_0x1d84bb[_0x5840ee(0x183)],0xa):undefined,'isVisible':_0x1d84bb[_0x5840ee(0x165)]?![]:undefined,'segmentFolderId':_0x43b87e,'countPopulation':_0x1d84bb[_0x5840ee(0x16f)]?![]:undefined},_0x2bbbed=await withSpinner('Creating\x20segment\x20\x27'+_0x275a20+_0x5840ee(0x15f),()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x162)](_0x3281ed,_0xccaf35),{'verbose':_0x1d84bb[_0x5840ee(0x156)]}),_0x784dde=_0x2bbbed[_0x5840ee(0x16e)];return console[_0x5840ee(0x185)]('✔\x20Created\x20segment\x20\x27'+_0x784dde[_0x5840ee(0x151)]+_0x5840ee(0x169)+_0x784dde['id']),_0x140724!==_0x409d07&&console['error'](_0x5840ee(0x164)+_0x140724),await handleSDKOutput([_0x784dde],_0x1d84bb),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x1ec996=a37_0x36c5;(function(_0x5b3c48,_0xeb7a40){const _0x48ea14=a37_0x36c5,_0x1e6527=_0x5b3c48();while(!![]){try{const _0x4909d2=parseInt(_0x48ea14(0xe3))/0x1*(parseInt(_0x48ea14(0xfc))/0x2)+-parseInt(_0x48ea14(0xf9))/0x3+parseInt(_0x48ea14(0xf1))/0x4*(parseInt(_0x48ea14(0xea))/0x5)+-parseInt(_0x48ea14(0xf3))/0x6+parseInt(_0x48ea14(0xfd))/0x7*(-parseInt(_0x48ea14(0xf0))/0x8)+parseInt(_0x48ea14(0xee))/0x9+-parseInt(_0x48ea14(0xfa))/0xa*(-parseInt(_0x48ea14(0xfb))/0xb);if(_0x4909d2===_0xeb7a40)break;else _0x1e6527['push'](_0x1e6527['shift']());}catch(_0x2a3191){_0x1e6527['push'](_0x1e6527['shift']());}}}(a37_0x1b54,0x778fd));function a37_0x1b54(){const _0x3c83d1=['parentSegment','List\x20available\x20fields\x20for\x20segmentation','2220129AgxyiT','segment','10712USFUpP','3193880KIgaim','✔\x20Found\x20','4710180AvSnyG','\x27...','jsonl','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','data','Parent\x20segment:\x20','859185rJwKtM','4070nFfHAO','23485DFAGJL','315478uHICvh','4319QJyGny','length','execute','name','3rkzqGc','site','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','error','json','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','5HtYkCE','description'];a37_0x1b54=function(){return _0x3c83d1;};return a37_0x1b54();}import{BaseCommand}from'./command.js';function a37_0x36c5(_0x4e8d67,_0x3e25a7){_0x4e8d67=_0x4e8d67-0xe0;const _0x1b54ca=a37_0x1b54();let _0x36c541=_0x1b54ca[_0x4e8d67];return _0x36c541;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x1ec996(0xe2)]='segment:fields';[a37_0x1ec996(0xeb)]=a37_0x1ec996(0xed);async[a37_0x1ec996(0xe1)](_0x3ab018){const _0x17826d=a37_0x1ec996,{options:_0x53e2e0,args:_0x34d31e,tdx:_0x332bd4}=_0x3ab018,_0x443d43=_0x34d31e[0x0]||_0x53e2e0[_0x17826d(0xec)];if(!_0x443d43)return console[_0x17826d(0xe7)](_0x17826d(0xe5)),console[_0x17826d(0xe7)](_0x17826d(0xf6)),console[_0x17826d(0xe7)](_0x17826d(0xe9)),0x1;_0x53e2e0[_0x17826d(0xe6)]&&(console[_0x17826d(0xe7)]('Site:\x20'+_0x53e2e0[_0x17826d(0xe4)]),console[_0x17826d(0xe7)](_0x17826d(0xf8)+_0x443d43));const _0xbdca83=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x443d43+_0x17826d(0xf4),()=>_0x332bd4[_0x17826d(0xef)]['listFields'](_0x443d43),{'verbose':_0x53e2e0['verbose']}),_0x3283e4=_0xbdca83[_0x17826d(0xf7)];console[_0x17826d(0xe7)](_0x17826d(0xf2)+_0x3283e4[_0x17826d(0xe0)]+'\x20field'+(_0x3283e4[_0x17826d(0xe0)]!==0x1?'s':''));if(_0x53e2e0[_0x17826d(0xe8)]||_0x53e2e0[_0x17826d(0xf5)])return await handleSDKOutput(_0x3283e4,_0x53e2e0),0x0;return displayFieldsHumanReadable(_0x3283e4,_0x443d43),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x411cac=a38_0x1899;(function(_0x179761,_0x2e724b){const _0x2803ff=a38_0x1899,_0x1194f6=_0x179761();while(!![]){try{const _0x973476=parseInt(_0x2803ff(0xed))/0x1*(-parseInt(_0x2803ff(0x126))/0x2)+-parseInt(_0x2803ff(0x113))/0x3+-parseInt(_0x2803ff(0x129))/0x4+parseInt(_0x2803ff(0x10a))/0x5*(parseInt(_0x2803ff(0xfb))/0x6)+-parseInt(_0x2803ff(0xf5))/0x7+-parseInt(_0x2803ff(0xfc))/0x8+-parseInt(_0x2803ff(0xf6))/0x9*(-parseInt(_0x2803ff(0xeb))/0xa);if(_0x973476===_0x2e724b)break;else _0x1194f6['push'](_0x1194f6['shift']());}catch(_0x3d4d80){_0x1194f6['push'](_0x1194f6['shift']());}}}(a38_0xf549,0x8dcd7));function a38_0x1899(_0x16d4a0,_0x45d102){_0x16d4a0=_0x16d4a0-0xe9;const _0xf5495b=a38_0xf549();let _0x189960=_0xf5495b[_0x16d4a0];return _0x189960;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0xf549(){const _0x4bbec9=['Error:\x20','93430CbZJfG','file','isNew','dim','diff','length','session','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','2889207wAeMTr','resourceName','\x20\x20Target:\x20','parent_segment','execute','✔\x20Context\x20set:\x20','Target\x20resource:\x20','segments','dryRun','message','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','activations','Pulling\x20segments\x20from\x20\x27','dirname','\x0aChanges\x20to\x20\x27','\x20files\x20to\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','6452qbngSL','Write\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','1449280uvFSfu','filter','cyan','type','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','errorCode','counts','setPhase','content','✔\x20Pulled\x20','Parent\x20segment:\x20','\x20\x20🎯\x20','targetDir','20893910qdbgad','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','54cXUEGK','utf-8','\x20unchanged\x20files','Aborted.','\x20changed\x20files','parentName','files','hasChanges','278019yatevv','9FnynVU','journeys','helpText','absolutePath','Site:\x20','114rrfFbM','2594336DGhtmX','relativePath','\x20journeys','yellow','journeyVersions','green','-\x20no\x20files\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','repeat','pullSegments','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','segment','verbose'];a38_0xf549=function(){return _0x4bbec9;};return a38_0xf549();}import{saveSessionContext}from'../core/session.js';import a38_0x351079 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x3bab0b from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';['description']=a38_0x411cac(0x103);async[a38_0x411cac(0x117)](_0x4c5071){const _0x1d50ee=a38_0x411cac,{options:_0x517908,args:_0x529982,tdx:_0x4bc378}=_0x4c5071,_0x23017f=_0x517908,_0x26a68e=await resolveTarget({'arg':_0x529982[0x0],'contextParent':_0x517908['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x26a68e))return _0x26a68e[_0x1d50ee(0x12f)]==='no_parent'?(console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x11d))),console[_0x1d50ee(0x11e)](_0x1d50ee(0x11f)),console['error'](_0x1d50ee(0x106)),console[_0x1d50ee(0x11e)](_0x1d50ee(0x112))):(console[_0x1d50ee(0x11e)](a38_0x351079['red'](_0x1d50ee(0x109)+_0x26a68e[_0x1d50ee(0x11c)]+'\x0a')),_0x26a68e[_0x1d50ee(0xf8)]&&console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x12b)](_0x26a68e[_0x1d50ee(0xf8)]))),0x1;const _0x32fcee=_0x26a68e['parentName'],_0x2c8d7e=_0x26a68e['targetDir'],_0x234ef2=_0x26a68e[_0x1d50ee(0x12c)]===_0x1d50ee(0x10b)?_0x26a68e[_0x1d50ee(0x114)]:undefined;_0x23017f[_0x1d50ee(0x108)]&&(console[_0x1d50ee(0x11e)](_0x1d50ee(0xfa)+_0x23017f['site']),console['error'](_0x1d50ee(0x134)+_0x32fcee),_0x234ef2&&console[_0x1d50ee(0x11e)](_0x1d50ee(0x119)+_0x234ef2));const _0x481da5=await withProgressSpinner(_0x1d50ee(0x121)+_0x32fcee+'\x27...',_0x39d837=>_0x4bc378[_0x1d50ee(0x107)][_0x1d50ee(0x105)](_0x32fcee,{'targetDir':_0x2c8d7e,'targetResourceName':_0x234ef2,'verbose':_0x23017f[_0x1d50ee(0x108)],'progress':{'update':_0x1a077e=>{const _0x12606a=_0x1d50ee;_0x39d837[_0x12606a(0x131)](_0x1a077e),_0x23017f['verbose']&&console['error']('\x20\x20'+_0x1a077e);}}}),{'verbose':_0x23017f['verbose']}),_0x346e37=_0x481da5[_0x1d50ee(0x111)];if(_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x11a)]===0x0&&_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0xf7)]===0x0)return console['error'](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x125)+_0x346e37[_0x1d50ee(0xf2)]+'\x27')),0x0;const _0x45621f=_0x346e37[_0x1d50ee(0xf3)]['filter'](_0x244937=>_0x244937[_0x1d50ee(0x10c)]),_0xa0f544=_0x346e37[_0x1d50ee(0xf3)][_0x1d50ee(0x12a)](_0x26afb4=>!_0x26afb4[_0x1d50ee(0x10c)]&&_0x26afb4[_0x1d50ee(0xf4)]),_0x1275cc=_0x346e37[_0x1d50ee(0xf3)][_0x1d50ee(0x12a)](_0x5289c2=>!_0x5289c2[_0x1d50ee(0x10c)]&&!_0x5289c2[_0x1d50ee(0xf4)]);console[_0x1d50ee(0x11e)]('\x0aPull\x20summary\x20for\x20\x27'+_0x346e37[_0x1d50ee(0xf2)]+'\x27:'),console[_0x1d50ee(0x11e)](_0x1d50ee(0xe9)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x11a)]+'\x20segments')+'\x20with\x20'+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x120)]+'\x20activations'));if(_0x346e37['counts'][_0x1d50ee(0xf7)]>0x0){const _0x4e339b=_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x100)]>_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0xf7)]?'\x20('+_0x346e37[_0x1d50ee(0x130)]['journeyVersions']+'\x20versions)':'';console[_0x1d50ee(0x11e)]('\x20\x20🗺️\x20\x20'+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37['counts']['journeys']+_0x1d50ee(0xfe))+a38_0x351079[_0x1d50ee(0x10d)](_0x4e339b));}console[_0x1d50ee(0x11e)]('\x20\x20'+a38_0x351079[_0x1d50ee(0x101)]('+\x20'+_0x45621f['length']+'\x20new\x20files')),console['error']('\x20\x20'+a38_0x351079[_0x1d50ee(0xff)]('~\x20'+_0xa0f544[_0x1d50ee(0x10f)]+_0x1d50ee(0xf1))),console['error']('\x20\x20'+a38_0x351079[_0x1d50ee(0x10d)]('=\x20'+_0x1275cc[_0x1d50ee(0x10f)]+_0x1d50ee(0xef))),console[_0x1d50ee(0x11e)](_0x1d50ee(0x115)+a38_0x351079['cyan'](_0x346e37['targetDir'])+'\x0a');if(_0xa0f544['length']>0x0)for(const _0x59aad8 of _0xa0f544){console['error'](_0x1d50ee(0x123)+_0x59aad8[_0x1d50ee(0xfd)]+'\x27:'),console[_0x1d50ee(0x11e)]('─'[_0x1d50ee(0x104)](0x3c)),console['error'](_0x59aad8[_0x1d50ee(0x10e)]),console[_0x1d50ee(0x11e)]('─'[_0x1d50ee(0x104)](0x3c));}if(_0x23017f[_0x1d50ee(0x11b)])return console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x12d))),0x0;if(_0x45621f[_0x1d50ee(0x10f)]===0x0&&_0xa0f544[_0x1d50ee(0x10f)]===0x0)return console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x346e37['parentName']},_0x23017f[_0x1d50ee(0x110)]),console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)](_0x1d50ee(0x118)+a38_0x351079[_0x1d50ee(0x10d)]('parent_segment')+_0x1d50ee(0x12e)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0xf2)]))),0x0;if(!_0x23017f['yes']){if(!isInteractive())return console[_0x1d50ee(0x11e)](a38_0x351079['red']('\x0aError:'),_0x1d50ee(0x128)),console['error'](a38_0x351079['dim'](_0x1d50ee(0xec))),0x1;const _0x26ce86=await confirmKey(_0x1d50ee(0x127)+(_0x45621f['length']+_0xa0f544[_0x1d50ee(0x10f)])+'\x20files?');if(!_0x26ce86)return console[_0x1d50ee(0x11e)](a38_0x351079['yellow'](_0x1d50ee(0xf0)),_0x1d50ee(0x102)),0x1;}for(const _0x2c3d7d of _0x346e37['files']){if(_0x2c3d7d['isNew']||_0x2c3d7d['hasChanges']){const _0x22bcbf=a38_0x3bab0b[_0x1d50ee(0x122)](_0x2c3d7d[_0x1d50ee(0xf9)]);!existsSync(_0x22bcbf)&&mkdirSync(_0x22bcbf,{'recursive':!![]}),writeFileSync(_0x2c3d7d[_0x1d50ee(0xf9)],_0x2c3d7d[_0x1d50ee(0x132)],_0x1d50ee(0xee));}}return console[_0x1d50ee(0x11e)](a38_0x351079['green'](_0x1d50ee(0x133)+(_0x45621f[_0x1d50ee(0x10f)]+_0xa0f544[_0x1d50ee(0x10f)])+_0x1d50ee(0x124)+_0x346e37[_0x1d50ee(0xea)])),saveSessionContext({'parent_segment':_0x346e37[_0x1d50ee(0xf2)]},_0x23017f[_0x1d50ee(0x110)]),console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)](_0x1d50ee(0x118)+a38_0x351079['dim'](_0x1d50ee(0x116))+_0x1d50ee(0x12e)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x48a134=a39_0x1732;function a39_0x27e5(){const _0x2a3cfe=['folderPath','\x20changed','\x20\x20Journeys:\x20','set','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','helpText','\x20\x20📊\x20Segments:','Delete\x20segment:','New\x20journey:','diff','Parent\x20segment:\x20','green','getParent','segment\x20or\x20journey','activations','errorCode','\x20new','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/j/da/je','(Journey\x20will\x20be\x20deleted)','parentSegment','\x20activations]','dryRun','name','toDelete','user','yes','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Changes\x20to\x20journey:','/e/','523676DckxWm','red','created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','folders','617008XtzmlG','buildUserMaps','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error\x20parsing\x20YAML:\x20','segment:push','versionNumber','new','Fetching\x20existing\x20data...','toString','join','\x20unchanged','\x0aPush\x20summary\x20for\x20\x27','push','isNew','journeysOnly','data','\x20changes?','listFolders','76621yUsTYR','description','\x20\x20\x20\x20','getOutputSchemaWithCache','state','\x20\x20🗺️\x20\x20Journeys:','\x20deleted','\x20to\x20delete','No\x20','existingJourney','deleted','updatedAt','list','length','message','verbose','targetDir','\x20folders\x20to\x20create','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','cwd','parentName','174610UEqbzM','Error:\x20Directory\x20not\x20found:\x20','/sb/da/esr','journeyId','517310JYcyTE','paused','results','audienceId','parentFolder','connection','\x27...','unchanged','segmentFolderId','\x20\x20Source:\x20','scopedFolderPath','9093717YIlQMi','Aborted.','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0aValidation\x20failed:','10nJyDyU','endsWith','filter','\x20updated','Delete\x20journey:','Changes\x20to:','72eWKRTD','yamlConfig','Folders\x20to\x20create:','segments','changed','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','cyan','\x20to\x20create','updated','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','all','yellow','blue','/app/ps/','.yml','existingSegment','resolveParentId','\x20created','error','site','get','createdAt','\x0aError:','3NTpgwU','file','type','Resolving\x20parent\x20segment\x20\x27','isScoped','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','dim','repeat','Fetching\x20existing\x20activations...','journeyBundleName','segment','folderId','📁\x20','\x20\x20Activations:','idToName','relationships','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','delete','nameToId','Error:\x20','New\x20segment:','\x20to\x20update','toCreate','\x20\x20Segments:\x20','journey','add','getJourney','\x20\x20Activations:\x20','Preparing\x20journeys...','attributes','no_parent','then','2905945JqURlu','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','map','nameToType','setPhase','listActivations'];a39_0x27e5=function(){return _0x2a3cfe;};return a39_0x27e5();}(function(_0x23f866,_0x26cfc7){const _0x3c5a6a=a39_0x1732,_0x1beb4a=_0x23f866();while(!![]){try{const _0x510bf1=parseInt(_0x3c5a6a(0x1e6))/0x1+parseInt(_0x3c5a6a(0x1ff))/0x2+parseInt(_0x3c5a6a(0x188))/0x3*(parseInt(_0x3c5a6a(0x1cf))/0x4)+parseInt(_0x3c5a6a(0x1fb))/0x5*(parseInt(_0x3c5a6a(0x171))/0x6)+parseInt(_0x3c5a6a(0x1a8))/0x7+-parseInt(_0x3c5a6a(0x1d4))/0x8+-parseInt(_0x3c5a6a(0x20a))/0x9*(parseInt(_0x3c5a6a(0x20e))/0xa);if(_0x510bf1===_0x26cfc7)break;else _0x1beb4a['push'](_0x1beb4a['shift']());}catch(_0xc83d3d){_0x1beb4a['push'](_0x1beb4a['shift']());}}}(a39_0x27e5,0x33f77));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x7b193f from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a39_0x1732(_0x473cce,_0x1a6b9b){_0x473cce=_0x473cce-0x16f;const _0x27e55f=a39_0x27e5();let _0x1732a3=_0x27e55f[_0x473cce];return _0x1732a3;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a39_0x48a134(0x1d8);[a39_0x48a134(0x1e7)]=a39_0x48a134(0x1ca);async['execute'](_0x241a6f){const _0x141702=a39_0x48a134,{options:_0xc6df7a,args:_0x759b24,tdx:_0x11304b}=_0x241a6f,_0x11005c=_0xc6df7a,_0xb456fb=await resolveTarget({'arg':_0x759b24[0x0],'contextParent':_0xc6df7a[_0x141702(0x1c3)],'cwd':process[_0x141702(0x1f9)]()});if(!isSuccessfulResolution(_0xb456fb))return _0xb456fb[_0x141702(0x1be)]===_0x141702(0x1a6)?(console['error'](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x198))),console[_0x141702(0x183)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x141702(0x183)](_0x141702(0x1d6)),console[_0x141702(0x183)]('\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[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x19b)+_0xb456fb['message']+'\x0a')),_0xb456fb['helpText']&&console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0xb456fb[_0x141702(0x1b4)]))),0x1;if(_0xb456fb[_0x141702(0x18a)]==='parent_name')return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1fc)+_0xb456fb[_0x141702(0x1f6)]+'\x0a')),console['error'](a39_0x7b193f[_0x141702(0x177)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x39eb52=_0xb456fb[_0x141702(0x1fa)],_0x4311bb=_0xb456fb['targetDir'],_0x3ec5ac=_0xb456fb[_0x141702(0x18a)]===_0x141702(0x189)?_0xb456fb['filePath']:undefined,_0x4b1998=getScopedDetails(_0xb456fb),_0x4ff7bc=_0x4b1998?.[_0x141702(0x18c)]??![],_0x1fb24e=_0x4b1998?.[_0x141702(0x209)]??'';if(!existsSync(_0x4311bb))return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1fc)+_0x4311bb+'\x0a')),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0x141702(0x1a9))),0x1;_0x11005c['verbose']&&(console[_0x141702(0x183)]('Site:\x20'+_0x11005c[_0x141702(0x184)]),console['error'](_0x141702(0x1b9)+_0x39eb52),console[_0x141702(0x183)]('Source\x20directory:\x20'+_0x4311bb),_0x4ff7bc&&console[_0x141702(0x183)]('Scoped\x20to\x20folder:\x20'+_0x1fb24e));const _0x240485=await withSpinner(_0x141702(0x18b)+_0x39eb52+_0x141702(0x205),()=>_0x11304b[_0x141702(0x192)][_0x141702(0x181)](_0x39eb52),{'verbose':_0x11005c['verbose']}),_0x3b9487=_0x240485[_0x141702(0x1e3)],{parentSegmentResult:_0xf2a669,segmentsResult:_0x3143ad,foldersResult:_0x1387f4,journeysWithDetailsResult:_0x2a3e94,userMaps:_0x296886}=await withSpinner(_0x141702(0x1db),async()=>{const _0x130afa=_0x141702,[_0xcf702e,_0x35998e,_0x2dad61,_0x1dae1c,_0x5ccf47]=await Promise['all']([_0x11304b['segment'][_0x130afa(0x1bb)](_0x3b9487),_0x11304b['segment']['listSegments'](_0x3b9487),_0x11304b[_0x130afa(0x192)][_0x130afa(0x1e5)](_0x3b9487),_0x11304b[_0x130afa(0x1a0)]['listJourneysWithDetailsFromParentSegment'](_0x3b9487,{'includeAllVersions':!![]}),_0x11304b['user'][_0x130afa(0x1d5)]()]);return{'parentSegmentResult':_0xcf702e,'segmentsResult':_0x35998e,'foldersResult':_0x2dad61,'journeysWithDetailsResult':_0x1dae1c,'userMaps':_0x5ccf47};},{'verbose':_0x11005c['verbose']})['then'](_0x14f6d8=>_0x14f6d8[_0x141702(0x1e3)]),_0x16ef15=_0xf2a669,_0x48c5a9=extractRootFolderId(_0x16ef15),_0x1846ee=_0x3143ad,_0x3abc12=_0x1387f4,{journeys:_0xb3616,activationStepsById:_0x1aafd3}=_0x2a3e94,_0x3e70c0=new Map(_0xb3616[_0x141702(0x1aa)](_0x597a25=>[_0x597a25['id'],_0x597a25])),_0x59adc3=_0xb3616[_0x141702(0x1aa)](_0x3d05b0=>({'id':_0x3d05b0['id'],'name':_0x3d05b0[_0x141702(0x1a5)]['name'],'journeyBundleName':_0x3d05b0['attributes']['journeyBundleName']||'','journeyBundleId':_0x3d05b0[_0x141702(0x1a5)]['journeyBundleId']||'','versionNumber':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1d9)],'description':_0x3d05b0[_0x141702(0x1a5)]['description'],'state':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1ea)],'paused':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x200)],'audienceId':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x202)],'folderId':_0x3d05b0[_0x141702(0x197)]?.[_0x141702(0x203)]?.['data']?.['id'],'createdAt':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x186)],'updatedAt':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1f1)]})),{emailToId:_0x399a1e,idToEmail:_0x458e57}=_0x296886,_0x1902b3=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xe9500f=_0x141702,_0x2cc224=await _0x11304b[_0xe9500f(0x204)][_0xe9500f(0x1f2)]();return buildConnectionMaps(_0x2cc224);},{'verbose':_0x11005c[_0x141702(0x1f5)]})[_0x141702(0x1a7)](_0x324a2a=>_0x324a2a[_0x141702(0x1e3)]),_0x185e97=_0x1902b3[_0x141702(0x19a)],_0x149e9d=_0x1902b3[_0x141702(0x196)],_0x65ece6=_0x1902b3[_0x141702(0x1ab)],_0x512463={'emailToIdMap':_0x399a1e,'connectionNameToIdMap':_0x185e97,'connectionNameToTypeMap':_0x65ece6,'getSchema':_0x2b7cca=>_0x11304b['connection'][_0x141702(0x1e9)](_0x2b7cca)};let {pathToId:_0x596dc7,idToPath:_0x5f42a1}=buildFolderMaps(_0x3abc12);const _0x3003fd=buildSegmentLookupMap(_0x1846ee,_0x5f42a1),_0x1b57aa=buildSegmentNameToIdMap(_0x1846ee),_0x4d7ff9=buildJourneyBundleLookupMap(_0x59adc3,_0x5f42a1);let _0x1de463;if(_0x3ec5ac){if(!_0x3ec5ac[_0x141702(0x20f)](_0x141702(0x17f))&&!_0x3ec5ac[_0x141702(0x20f)]('.yaml'))return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1d2)+_0x3ec5ac+'\x0a')),0x1;_0x1de463=[_0x3ec5ac];}else _0x1de463=findYamlFiles(_0x4311bb);if(_0x1de463[_0x141702(0x1f3)]===0x0)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x20c)+_0x4311bb+'\x0a')),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0x141702(0x1c0))),0x1;let _0x330228,_0x2ce2ef;try{const _0x15fd64=parseAndClassifyYamlFiles(_0x1de463,_0x4311bb,{'skipSegments':_0x11005c[_0x141702(0x1e2)]});_0x330228=_0x15fd64[_0x141702(0x174)],_0x2ce2ef=_0x15fd64[_0x141702(0x1b2)];const _0xa3f971=validateParsedFiles(_0x15fd64,_0x4311bb);if(_0xa3f971[_0x141702(0x1f3)]>0x0)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x20d))),console[_0x141702(0x183)](formatValidationErrors(_0xa3f971)),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x176))),0x1;}catch(_0x27acef){return console['error'](a39_0x7b193f['red'](_0x141702(0x1d7)+(_0x27acef instanceof Error?_0x27acef[_0x141702(0x1f4)]:_0x27acef))),0x1;}if(_0x330228[_0x141702(0x1f3)]===0x0&&_0x2ce2ef[_0x141702(0x1f3)]===0x0){const _0x574d6a=_0x11005c[_0x141702(0x1e2)]?'journey':_0x141702(0x1bc);return console[_0x141702(0x183)](a39_0x7b193f['yellow'](_0x141702(0x1ee)+_0x574d6a+'\x20YAML\x20files\x20found')),0x0;}const _0x3ae103=new Map();_0x1846ee[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)]&&await withSpinner(_0x141702(0x190),async()=>{await batchAsync(_0x1846ee,async _0x2e8f3e=>{const _0x3697bc=a39_0x1732,_0x7572f3=await _0x11304b[_0x3697bc(0x192)][_0x3697bc(0x1ad)](_0x3b9487,_0x2e8f3e['id']);_0x3ae103[_0x3697bc(0x1b1)](_0x2e8f3e['id'],_0x7572f3);});},{'verbose':_0x11005c[_0x141702(0x1f5)]});const {segmentFiles:_0xec3b07,foldersToCreate:_0x56de1f}=await prepareSegmentFiles(_0x330228,{'segmentByFolderAndName':_0x3003fd,'activationsBySegmentId':_0x3ae103,'folderPathToId':_0x596dc7,'idToEmailMap':_0x458e57,'connectionIdToNameMap':_0x149e9d},_0x512463,_0x4ff7bc,_0x1fb24e),_0x3e0fab=_0x3ec5ac?[]:findSegmentsToDelete(_0x1846ee,_0x330228[_0x141702(0x1aa)](({yamlConfig:_0x15afaf,folderPath:_0x17d2e0})=>({'yamlConfig':_0x15afaf,'folderPath':resolveTDFolderPath(_0x17d2e0,_0x4ff7bc,_0x1fb24e)})),_0x5f42a1,_0x1fb24e,_0x4ff7bc),{journeyFiles:_0x51cb98,foldersToCreate:_0x1fd2d9}=await withProgressSpinner(_0x141702(0x1a4),async _0x22db05=>prepareJourneyFiles(_0x2ce2ef,{'fetchJourney':async _0x30e9a4=>_0x11304b[_0x141702(0x1a0)][_0x141702(0x1a2)](_0x30e9a4[_0x141702(0x1fe)]),'journeyBundlesByFolderAndName':_0x4d7ff9,'folderPathToId':_0x596dc7,'idToEmailMap':_0x458e57,'connectionIdToNameMap':_0x149e9d,'existingSegments':_0x1846ee,'parentId':_0x3b9487,'deps':_0x11304b,'progress':{'update':_0x260c03=>{const _0x10d972=_0x141702;_0x22db05[_0x10d972(0x1ac)](_0x260c03),_0x11005c[_0x10d972(0x1f5)]&&console[_0x10d972(0x183)]('\x20\x20'+_0x260c03);}},'journeyById':_0x3e70c0,'activationStepsById':_0x1aafd3},_0x4ff7bc,_0x1fb24e),{'verbose':_0x11005c[_0x141702(0x1f5)]})[_0x141702(0x1a7)](_0x56fb55=>_0x56fb55[_0x141702(0x1e3)]);for(const _0x532cab of _0x1fd2d9){_0x56de1f[_0x141702(0x1a1)](_0x532cab);}const _0x2657d7=_0x3ec5ac?[]:findJourneysToDelete(_0x59adc3,_0x2ce2ef[_0x141702(0x1aa)](({yamlConfig:_0x5c572a,folderPath:_0x52120d})=>({'yamlConfig':_0x5c572a,'folderPath':resolveTDFolderPath(_0x52120d,_0x4ff7bc,_0x1fb24e)})),_0x5f42a1,_0x1fb24e,_0x4ff7bc),_0x2ddf0f=calculatePushStats(_0xec3b07,_0x51cb98,_0x56de1f,_0x3e0fab,_0x2657d7,!!_0x11005c[_0x141702(0x199)],!!_0x11005c[_0x141702(0x1e2)]),_0xbd9d0f=_0x2ddf0f[_0x141702(0x174)][_0x141702(0x1da)],_0xdbfaca=_0x2ddf0f[_0x141702(0x174)][_0x141702(0x175)],_0x5c2fd0=_0x2ddf0f['segments'][_0x141702(0x206)],_0x499938=_0x2ddf0f['segments'][_0x141702(0x1c7)],_0x3dc342=_0x2ddf0f[_0x141702(0x1d3)][_0x141702(0x19e)],_0x41d506=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x1da)],_0x4938bf=_0x2ddf0f['journeys'][_0x141702(0x175)],_0x105240=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x206)],_0x411aa7=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x1c7)],_0x1249eb=_0x2ddf0f[_0x141702(0x1bd)][_0x141702(0x17b)],_0x4986ec=_0x2ddf0f[_0x141702(0x1bd)]['toCreate'],_0x464e8b=_0x2ddf0f[_0x141702(0x1bd)]['toUpdate'],_0xa124d9=_0x2ddf0f[_0x141702(0x1bd)][_0x141702(0x1c7)];console['error'](_0x141702(0x1df)+_0x39eb52+'\x27:');_0x3dc342[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f[_0x141702(0x17d)](_0x141702(0x194)+_0x3dc342['length']+_0x141702(0x1f7)));if(!_0x11005c[_0x141702(0x1e2)]){console[_0x141702(0x183)](_0x141702(0x1b5)),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x1ba)]('+\x20'+_0xbd9d0f[_0x141702(0x1f3)]+_0x141702(0x1bf))),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x17c)]('~\x20'+_0xdbfaca[_0x141702(0x1f3)]+'\x20changed'));if(_0x499938[_0x141702(0x1f3)]>0x0)console['error']('\x20\x20\x20\x20'+a39_0x7b193f['red']('-\x20'+_0x499938[_0x141702(0x1f3)]+'\x20to\x20delete'));else _0x3e0fab[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x199)]&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x18e)](_0x3e0fab[_0x141702(0x1f3)]+_0x141702(0x1cb)));console[_0x141702(0x183)]('\x20\x20\x20\x20'+a39_0x7b193f[_0x141702(0x18e)]('=\x20'+_0x5c2fd0[_0x141702(0x1f3)]+'\x20unchanged'));}if(_0x51cb98[_0x141702(0x1f3)]>0x0||_0x2657d7['length']>0x0){console[_0x141702(0x183)](_0x141702(0x1eb)),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f['green']('+\x20'+_0x41d506[_0x141702(0x1f3)]+_0x141702(0x1bf))),console['error'](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x17c)]('~\x20'+_0x4938bf['length']+_0x141702(0x1af)));if(_0x411aa7[_0x141702(0x1f3)]>0x0)console[_0x141702(0x183)]('\x20\x20\x20\x20'+a39_0x7b193f['red']('-\x20'+_0x411aa7['length']+_0x141702(0x1ed)));else _0x2657d7[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x199)]&&console['error']('\x20\x20\x20\x20'+a39_0x7b193f[_0x141702(0x18e)](_0x2657d7[_0x141702(0x1f3)]+_0x141702(0x1cb)));console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x18e)]('=\x20'+_0x105240[_0x141702(0x1f3)]+_0x141702(0x1de)));}_0x1249eb[_0x141702(0x1f3)]>0x0&&!_0x11005c['journeysOnly']&&(console['error'](''),console['error'](_0x141702(0x195)),_0x4986ec[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f['green']('+\x20'+_0x4986ec[_0x141702(0x1f3)]+_0x141702(0x178))),_0x464e8b[_0x141702(0x1f3)]>0x0&&console['error'](_0x141702(0x1e8)+a39_0x7b193f['yellow']('~\x20'+_0x464e8b[_0x141702(0x1f3)]+_0x141702(0x19d))),_0xa124d9['length']>0x0&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x1d0)]('-\x20'+_0xa124d9[_0x141702(0x1f3)]+_0x141702(0x1ed))));console[_0x141702(0x183)](_0x141702(0x208)+a39_0x7b193f[_0x141702(0x177)](_0x4311bb)+'\x0a');if(_0x3dc342[_0x141702(0x1f3)]>0x0){console[_0x141702(0x183)](_0x141702(0x173));for(const _0x2cb54d of _0x3dc342){console['error']('\x20\x20'+a39_0x7b193f[_0x141702(0x17d)]('+')+'\x20'+_0x2cb54d);}console['error']('');}if(_0xbd9d0f[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0x265c9f of _0xbd9d0f){const _0x34239b=_0x265c9f[_0x141702(0x1ae)]?_0x265c9f[_0x141702(0x1ae)]+'/'+_0x265c9f[_0x141702(0x172)][_0x141702(0x1c6)]:_0x265c9f[_0x141702(0x172)][_0x141702(0x1c6)],_0x422f56=_0x265c9f[_0x141702(0x172)][_0x141702(0x1bd)]?.[_0x141702(0x1f3)]||0x0,_0xcd3dcc=_0x422f56>0x0?a39_0x7b193f[_0x141702(0x18e)]('\x20['+_0x422f56+'\x20activations]'):'';console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1ba)](_0x141702(0x19c))+'\x20'+_0x34239b+_0xcd3dcc),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c)),_0x265c9f[_0x141702(0x1b8)]&&console['error'](_0x265c9f[_0x141702(0x1b8)]),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}if(_0x499938[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0x4f2767 of _0x499938){const _0x161b29=_0x4f2767['segmentFolderId']?_0x5f42a1[_0x141702(0x185)](_0x4f2767[_0x141702(0x207)][_0x141702(0x1dc)]())||'':'',_0x57bc3c=_0x161b29?_0x161b29+'/'+_0x4f2767[_0x141702(0x1c6)]:_0x4f2767[_0x141702(0x1c6)],_0x1b9a04=_0x3ae103['get'](_0x4f2767['id'])||[],_0x2a856f=_0x1b9a04[_0x141702(0x1f3)]>0x0?a39_0x7b193f[_0x141702(0x18e)]('\x20['+_0x1b9a04[_0x141702(0x1f3)]+_0x141702(0x1c4)):'';console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1b6))+'\x20'+_0x57bc3c+_0x2a856f),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));const _0x51831e=segmentWithActivationsToYaml(_0x4f2767,_0x1b9a04,undefined,_0x458e57,_0x149e9d),_0x2ffcdd=segmentToYamlString(_0x51831e),_0x47f444=generateDiff(_0x2ffcdd,'');console[_0x141702(0x183)](formatDiffWithColors(_0x47f444)),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}const _0x3131b6=_0xec3b07[_0x141702(0x210)](_0x34efd0=>!_0x34efd0['isNew']&&_0x34efd0[_0x141702(0x1b8)]);if(_0x3131b6[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0xacbfa8 of _0x3131b6){const _0x10aa6c=_0xacbfa8['folderPath']?_0xacbfa8[_0x141702(0x1ae)]+'/'+_0xacbfa8[_0x141702(0x172)]['name']:_0xacbfa8[_0x141702(0x172)][_0x141702(0x1c6)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x170))+'\x20'+_0x10aa6c),console[_0x141702(0x183)]('─'['repeat'](0x3c)),console[_0x141702(0x183)](_0xacbfa8[_0x141702(0x1b8)]),console['error']('─'[_0x141702(0x18f)](0x3c));}if(_0x41d506[_0x141702(0x1f3)]>0x0)for(const _0x503dc6 of _0x41d506){const _0x55de19=_0x503dc6[_0x141702(0x1ae)]?_0x503dc6[_0x141702(0x1ae)]+'/'+_0x503dc6['yamlConfig'][_0x141702(0x1c6)]:_0x503dc6[_0x141702(0x172)]['name'];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1ba)](_0x141702(0x1b7))+'\x20'+_0x55de19),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c)),_0x503dc6['diff']&&console[_0x141702(0x183)](_0x503dc6['diff']),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}const _0x2c6ae4=_0x51cb98[_0x141702(0x210)](_0x29b21f=>!_0x29b21f[_0x141702(0x1e1)]&&_0x29b21f[_0x141702(0x1b8)]);if(_0x2c6ae4[_0x141702(0x1f3)]>0x0)for(const _0x5973ea of _0x2c6ae4){const _0xe0de39=_0x5973ea['folderPath']?_0x5973ea[_0x141702(0x1ae)]+'/'+_0x5973ea['yamlConfig'][_0x141702(0x1c6)]:_0x5973ea['yamlConfig'][_0x141702(0x1c6)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x1cd))+'\x20'+_0xe0de39),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c)),console[_0x141702(0x183)](_0x5973ea[_0x141702(0x1b8)]),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}if(_0x411aa7[_0x141702(0x1f3)]>0x0)for(const _0x3b6951 of _0x411aa7){const _0x566a27=_0x3b6951[_0x141702(0x193)]?_0x5f42a1[_0x141702(0x185)](_0x3b6951[_0x141702(0x193)])||'':'',_0x19ef98=_0x566a27?_0x566a27+'/'+_0x3b6951[_0x141702(0x191)]:_0x3b6951[_0x141702(0x191)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x16f))+'\x20'+_0x19ef98),console[_0x141702(0x183)]('─'['repeat'](0x3c)),console[_0x141702(0x183)](a39_0x7b193f['red'](_0x141702(0x1c2))),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}if(_0x11005c[_0x141702(0x1c5)])return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x560691=_0x11005c[_0x141702(0x1e2)]?![]:_0xbd9d0f[_0x141702(0x1f3)]>0x0||_0xdbfaca[_0x141702(0x1f3)]>0x0||_0x499938['length']>0x0,_0x28527a=_0x41d506[_0x141702(0x1f3)]>0x0||_0x4938bf[_0x141702(0x1f3)]>0x0||_0x411aa7[_0x141702(0x1f3)]>0x0,_0x4129b9=_0x11005c[_0x141702(0x1e2)]?![]:_0x1249eb[_0x141702(0x1f3)]>0x0,_0x476b06=_0x3dc342[_0x141702(0x1f3)]>0x0;if(!_0x560691&&!_0x28527a&&!_0x4129b9&&!_0x476b06){const _0x3aa040=_0x11005c[_0x141702(0x1e2)]?_0x141702(0x1cc):_0x141702(0x1f8);console['error'](a39_0x7b193f[_0x141702(0x1ba)](_0x3aa040));if(_0x3ec5ac&&_0x5c2fd0[_0x141702(0x1f3)]===0x1){const _0x28943a=_0x5c2fd0[0x0];if(_0x28943a['existingSegment']?.['id']){const _0x2e3dd4=getConsoleNextUrl(_0x11005c[_0x141702(0x184)],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x28943a[_0x141702(0x180)]['id']+_0x141702(0x1fd));console[_0x141702(0x183)](_0x141702(0x17a)+a39_0x7b193f['cyan'](_0x2e3dd4));}}if(_0x3ec5ac&&_0x105240[_0x141702(0x1f3)]===0x1){const _0x5b94a4=_0x105240[0x0];if(_0x5b94a4['existingJourney']?.['id']){const _0x52f537=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x5b94a4[_0x141702(0x1ef)]['id']+_0x141702(0x1c1));console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f['cyan'](_0x52f537));}}return 0x0;}const _0x4470e9=_0x11005c['journeysOnly']?_0x41d506[_0x141702(0x1f3)]+_0x4938bf[_0x141702(0x1f3)]+_0x411aa7[_0x141702(0x1f3)]+_0x3dc342[_0x141702(0x1f3)]:_0xbd9d0f[_0x141702(0x1f3)]+_0xdbfaca['length']+_0x499938[_0x141702(0x1f3)]+_0x41d506[_0x141702(0x1f3)]+_0x4938bf[_0x141702(0x1f3)]+_0x411aa7['length']+_0x3dc342[_0x141702(0x1f3)]+_0x1249eb['length'];if(!_0x11005c[_0x141702(0x1c9)]&&_0x4470e9>0x0){if(!isInteractive())return console[_0x141702(0x183)](a39_0x7b193f['red'](_0x141702(0x187)),_0x141702(0x1b3)),console[_0x141702(0x183)](a39_0x7b193f['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x248a27=await confirmKey('Push\x20'+_0x4470e9+_0x141702(0x1e4));if(!_0x248a27)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x20b))),0x1;}const _0x5d3544={'withProgress':async(_0x42c275,_0x377482)=>{const _0x1104e=await withSpinner(_0x42c275,_0x377482,{'verbose':_0x11005c['verbose']});return{'data':_0x1104e['data']};},'logInfo':_0x5dbfc6=>console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17d)]('✔\x20'+_0x5dbfc6)),'logSuccess':_0x43e305=>console[_0x141702(0x183)](a39_0x7b193f['green']('✔\x20'+_0x43e305)),'logWarning':_0x3cede9=>console[_0x141702(0x183)](a39_0x7b193f['yellow']('⚠\x20'+_0x3cede9)),'logDeleted':_0x117573=>console['error'](a39_0x7b193f[_0x141702(0x1d0)]('✔\x20'+_0x117573))},_0x590bf3={'segment':_0x11304b[_0x141702(0x192)],'journey':_0x11304b[_0x141702(0x1a0)],'user':_0x11304b[_0x141702(0x1c8)],'connection':_0x11304b[_0x141702(0x204)]};_0x3dc342['length']>0x0&&(_0x596dc7=await executePushFolders(_0x590bf3,_0x3dc342,_0x596dc7,{'parentId':_0x3b9487},_0x5d3544));const _0x47fd68={'rootFolderId':_0x48c5a9,'folderPathToId':_0x596dc7,'folderIdToPath':_0x5f42a1,'segmentNameToId':_0x1b57aa,'activationsBySegmentId':_0x3ae103,'emailToIdMap':_0x399a1e,'idToEmailMap':_0x458e57,'connectionNameToIdMap':_0x1902b3[_0x141702(0x19a)],'connectionIdToNameMap':_0x1902b3['idToName'],'connectionNameToTypeMap':_0x65ece6},_0x5ee5a1=await executePushSegments(_0x590bf3,_0x11005c[_0x141702(0x1e2)]?[]:_0xec3b07,_0x47fd68,{'parentId':_0x3b9487},_0x5d3544),_0x46144d=_0x5ee5a1['created'],_0x58ce0c=_0x5ee5a1[_0x141702(0x179)],_0x5ef0e7=_0x5ee5a1[_0x141702(0x1bd)][_0x141702(0x1d1)],_0x4d8322=_0x5ee5a1['activations'][_0x141702(0x179)],_0x2596b8=_0x5ee5a1['activations'][_0x141702(0x1f0)];let _0x160875;if(_0x3ec5ac&&_0xec3b07[_0x141702(0x1f3)]===0x1){const _0x33ec64=_0xec3b07[0x0];_0x160875=_0x33ec64['existingSegment']?.['id']??_0x5ee5a1['createdSegmentIds'][_0x141702(0x185)](_0x33ec64[_0x141702(0x172)][_0x141702(0x1c6)]);}const _0x2b90cb=await executePushSegmentDeletions(_0x590bf3,_0x11005c['journeysOnly']?[]:_0x499938,_0x5d3544);let _0x1f378a=0x0,_0x20d867=0x0,_0x1f493f=0x0;const _0x516056=new Map(_0x1b57aa);for(const [_0x29d084,_0x4fa14d]of _0x5ee5a1['createdSegmentIds']){_0x516056['set'](_0x29d084,_0x4fa14d);}if(_0x51cb98['length']>0x0){const _0x1951f4={..._0x47fd68,'segmentNameToId':_0x516056,'existingSegments':_0x1846ee,'activationContext':_0x512463},_0x150aa6=await executePushJourneys(_0x590bf3,_0x51cb98,_0x1951f4,{'parentId':_0x3b9487,'rootFolderId':_0x48c5a9,'verbose':_0x11005c[_0x141702(0x1f5)]},_0x5d3544);_0x1f378a=_0x150aa6[_0x141702(0x1d1)],_0x20d867=_0x150aa6[_0x141702(0x179)];if(_0x3ec5ac&&_0x150aa6[_0x141702(0x201)][_0x141702(0x1f3)]===0x1){const _0x106206=_0x150aa6[_0x141702(0x201)][0x0];if(_0x106206['journeyId']){const _0x2f46be=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x106206[_0x141702(0x1fe)]+_0x141702(0x1c1));console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f[_0x141702(0x177)](_0x2f46be));}}}for(const _0x2dfe6e of _0x411aa7){console['error'](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x18d)+_0x2dfe6e[_0x141702(0x191)])),_0x1f493f++;}const _0xc31c2=[];if(_0x46144d>0x0)_0xc31c2['push'](_0x46144d+_0x141702(0x182));if(_0x58ce0c>0x0)_0xc31c2['push'](_0x58ce0c+_0x141702(0x211));if(_0x2b90cb>0x0)_0xc31c2['push'](_0x2b90cb+_0x141702(0x1ec));const _0x2905da=[];if(_0x1f378a>0x0)_0x2905da[_0x141702(0x1e0)](_0x1f378a+_0x141702(0x182));if(_0x20d867>0x0)_0x2905da[_0x141702(0x1e0)](_0x20d867+'\x20updated');if(_0x1f493f>0x0)_0x2905da[_0x141702(0x1e0)](_0x1f493f+'\x20deleted');const _0x1a721a=[];if(_0x5ef0e7>0x0)_0x1a721a['push'](_0x5ef0e7+'\x20created');if(_0x4d8322>0x0)_0x1a721a[_0x141702(0x1e0)](_0x4d8322+'\x20updated');if(_0x2596b8>0x0)_0x1a721a[_0x141702(0x1e0)](_0x2596b8+_0x141702(0x1ec));console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1ba)]('\x0a✔\x20Push\x20complete'));_0xc31c2[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)]&&console[_0x141702(0x183)](_0x141702(0x19f)+_0xc31c2[_0x141702(0x1dd)](',\x20'));_0x2905da[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)](_0x141702(0x1b0)+_0x2905da[_0x141702(0x1dd)](',\x20'));_0x1a721a[_0x141702(0x1f3)]>0x0&&!_0x11005c['journeysOnly']&&console[_0x141702(0x183)](_0x141702(0x1a3)+_0x1a721a[_0x141702(0x1dd)](',\x20'));if(_0x160875){const _0x568e0f=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x160875+_0x141702(0x1fd));console[_0x141702(0x183)](_0x141702(0x17a)+a39_0x7b193f['cyan'](_0x568e0f));}return 0x0;}}
|
|
1
|
+
const a39_0x3c6822=a39_0x1a44;(function(_0x5937e4,_0x58641a){const _0x4f91c7=a39_0x1a44,_0x417994=_0x5937e4();while(!![]){try{const _0x5617d0=parseInt(_0x4f91c7(0x195))/0x1*(parseInt(_0x4f91c7(0x20a))/0x2)+parseInt(_0x4f91c7(0x1d3))/0x3*(-parseInt(_0x4f91c7(0x1e0))/0x4)+-parseInt(_0x4f91c7(0x194))/0x5*(-parseInt(_0x4f91c7(0x1ba))/0x6)+parseInt(_0x4f91c7(0x198))/0x7+parseInt(_0x4f91c7(0x1cd))/0x8*(parseInt(_0x4f91c7(0x1a0))/0x9)+-parseInt(_0x4f91c7(0x18e))/0xa*(-parseInt(_0x4f91c7(0x181))/0xb)+parseInt(_0x4f91c7(0x185))/0xc*(-parseInt(_0x4f91c7(0x20d))/0xd);if(_0x5617d0===_0x58641a)break;else _0x417994['push'](_0x417994['shift']());}catch(_0x490f9b){_0x417994['push'](_0x417994['shift']());}}}(a39_0x10f9,0x64ca2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x10f9(){const _0x4084c3=['638463tPzUDA','resolveParentId','\x20\x20Activations:\x20','idToName','targetDir','segmentFolderId','\x20\x20\x20\x20','journeys','267048XQFlBA','file','buildUserMaps','no_parent','helpText','endsWith','journeysOnly','created','error','name','Error:\x20','folders','get','/e/','listActivations','Fetching\x20connections\x20for\x20name\x20resolution...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','New\x20journey:','\x0aError:','type','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeyBundleId','setPhase','getOutputSchemaWithCache','listJourneysWithDetailsFromParentSegment','updatedAt','12AQAyNo','Changes\x20to:','segment','cyan','verbose','.yaml','createdAt','\x20updated','filePath','\x20folders\x20to\x20create','parent_name','Site:\x20','set','push','.yml','\x20to\x20create','blue','listFolders','Changes\x20to\x20journey:','56DbOdgD','cwd','\x20unchanged','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Preparing\x20journeys...','/j/da/je','13938OMBQgK','existingJourney','\x20to\x20update','\x20\x20Activations:','Fetching\x20existing\x20data...','getJourney','red','\x0aValidation\x20failed:','errorCode','connection','execute','\x20YAML\x20files\x20found','yellow','20LfnJBK','parentFolder','Folders\x20to\x20create:','state','parentName','createdSegmentIds','dim','attributes','Resolving\x20parent\x20segment\x20\x27','\x27...','yamlConfig','then','\x20new','Error:\x20Directory\x20not\x20found:\x20','Source\x20directory:\x20','changed','segment:push','isScoped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','toString','\x0a✔\x20Push\x20complete','repeat','Fetching\x20existing\x20activations...','folderId','\x20to\x20delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20created','new','updated','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','message','user','📁\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activations','existingSegment','\x20\x20Source:\x20','folderPath','audienceId','toCreate','toDelete','deleted','589714UgmmMF','segments','green','597701iwOzCL','map','isNew','nameToId','Delete\x20segment:','\x20deleted','Parent\x20segment:\x20','parentSegment','Aborted.','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','data','Push\x20','list','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','journeyId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Scoped\x20to\x20folder:\x20','\x20activations]','\x20\x20Segments:\x20','55099eXhbIY','\x20changed','all','\x20\x20📊\x20Segments:','468DESKWb','journeyBundleName','join','journey','delete','add','/sb/da/esr','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','unchanged','1260eSqAsU','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','results','description','diff','relationships','1773515uaoXmw','2LqdQSS','/app/ps/','length'];a39_0x10f9=function(){return _0x4084c3;};return a39_0x10f9();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x30ea8b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a39_0x1a44(_0x114171,_0x5e159f){_0x114171=_0x114171-0x174;const _0x10f9da=a39_0x10f9();let _0x1a4434=_0x10f9da[_0x114171];return _0x1a4434;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a39_0x3c6822(0x1a9)]=a39_0x3c6822(0x1f0);['description']=a39_0x3c6822(0x176);async[a39_0x3c6822(0x1dd)](_0x36466b){const _0x3c4aa7=a39_0x3c6822,{options:_0x2853cc,args:_0x338141,tdx:_0xf398e}=_0x36466b,_0x179d89=_0x2853cc,_0x464c7f=await resolveTarget({'arg':_0x338141[0x0],'contextParent':_0x2853cc[_0x3c4aa7(0x174)],'cwd':process[_0x3c4aa7(0x1ce)]()});if(!isSuccessfulResolution(_0x464c7f))return _0x464c7f[_0x3c4aa7(0x1db)]===_0x3c4aa7(0x1a3)?(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x201))),console[_0x3c4aa7(0x1a8)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1f9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1aa)+_0x464c7f[_0x3c4aa7(0x1fe)]+'\x0a')),_0x464c7f[_0x3c4aa7(0x1a4)]&&console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan'](_0x464c7f['helpText']))),0x1;if(_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1c4))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x464c7f[_0x3c4aa7(0x19c)]+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x3c4aa7(0x17a))),0x1;const _0x5e8349=_0x464c7f[_0x3c4aa7(0x1e4)],_0x4469a6=_0x464c7f[_0x3c4aa7(0x19c)],_0x454d92=_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1a1)?_0x464c7f[_0x3c4aa7(0x1c2)]:undefined,_0x5b647d=getScopedDetails(_0x464c7f),_0x5dce64=_0x5b647d?.[_0x3c4aa7(0x1f1)]??![],_0x2d5f09=_0x5b647d?.['scopedFolderPath']??'';if(!existsSync(_0x4469a6))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x4469a6+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x179d89[_0x3c4aa7(0x1be)]&&(console['error'](_0x3c4aa7(0x1c5)+_0x179d89['site']),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x213)+_0x5e8349),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1ee)+_0x4469a6),_0x5dce64&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x17e)+_0x2d5f09));const _0x4d1c8a=await withSpinner(_0x3c4aa7(0x1e8)+_0x5e8349+_0x3c4aa7(0x1e9),()=>_0xf398e[_0x3c4aa7(0x1bc)][_0x3c4aa7(0x199)](_0x5e8349),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]}),_0x27c4c2=_0x4d1c8a[_0x3c4aa7(0x177)],{parentSegmentResult:_0x479604,segmentsResult:_0x120128,foldersResult:_0x231ac7,journeysWithDetailsResult:_0x5e4cb2,userMaps:_0x273183}=await withSpinner(_0x3c4aa7(0x1d7),async()=>{const _0x106810=_0x3c4aa7,[_0x4f476b,_0x5c6e47,_0x9559b7,_0x1dbb01,_0x2c296c]=await Promise[_0x106810(0x183)]([_0xf398e['segment']['getParent'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)]['listSegments'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)][_0x106810(0x1cb)](_0x27c4c2),_0xf398e[_0x106810(0x188)][_0x106810(0x1b8)](_0x27c4c2,{'includeAllVersions':!![]}),_0xf398e['user'][_0x106810(0x1a2)]()]);return{'parentSegmentResult':_0x4f476b,'segmentsResult':_0x5c6e47,'foldersResult':_0x9559b7,'journeysWithDetailsResult':_0x1dbb01,'userMaps':_0x2c296c};},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x2b9c3f=>_0x2b9c3f[_0x3c4aa7(0x177)]),_0x5855f7=_0x479604,_0x5aca44=extractRootFolderId(_0x5855f7),_0x4c50b7=_0x120128,_0x14b404=_0x231ac7,{journeys:_0x4eabf7,activationStepsById:_0x27bad3}=_0x5e4cb2,_0x3e9f46=new Map(_0x4eabf7[_0x3c4aa7(0x20e)](_0x3bbbe7=>[_0x3bbbe7['id'],_0x3bbbe7])),_0x9a09dd=_0x4eabf7[_0x3c4aa7(0x20e)](_0x4ef5fa=>({'id':_0x4ef5fa['id'],'name':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1a9)],'journeyBundleName':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x186)]||'','journeyBundleId':_0x4ef5fa['attributes'][_0x3c4aa7(0x1b5)]||'','versionNumber':_0x4ef5fa[_0x3c4aa7(0x1e7)]['versionNumber'],'description':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x191)],'state':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1e3)],'paused':_0x4ef5fa['attributes']['paused'],'audienceId':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x206)],'folderId':_0x4ef5fa[_0x3c4aa7(0x193)]?.[_0x3c4aa7(0x1e1)]?.[_0x3c4aa7(0x177)]?.['id'],'createdAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1c0)],'updatedAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1b9)]})),{emailToId:_0x1261a0,idToEmail:_0x12e592}=_0x273183,_0x753f53=await withSpinner(_0x3c4aa7(0x1af),async()=>{const _0x42cce1=_0x3c4aa7,_0x1167ae=await _0xf398e[_0x42cce1(0x1dc)][_0x42cce1(0x179)]();return buildConnectionMaps(_0x1167ae);},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x22b705=>_0x22b705[_0x3c4aa7(0x177)]),_0x30d14a=_0x753f53[_0x3c4aa7(0x210)],_0x2eb4a7=_0x753f53[_0x3c4aa7(0x19b)],_0x5c3fbe=_0x753f53['nameToType'],_0x369f1c={'emailToIdMap':_0x1261a0,'connectionNameToIdMap':_0x30d14a,'connectionNameToTypeMap':_0x5c3fbe,'getSchema':_0x3a6f15=>_0xf398e[_0x3c4aa7(0x1dc)][_0x3c4aa7(0x1b7)](_0x3a6f15)};let {pathToId:_0x54cf4a,idToPath:_0x6b7ab2}=buildFolderMaps(_0x14b404);const _0x47f6c8=buildSegmentLookupMap(_0x4c50b7,_0x6b7ab2),_0x3cc844=buildSegmentNameToIdMap(_0x4c50b7),_0x3a2291=buildJourneyBundleLookupMap(_0x9a09dd,_0x6b7ab2);let _0x32aa0d;if(_0x454d92){if(!_0x454d92[_0x3c4aa7(0x1a5)](_0x3c4aa7(0x1c8))&&!_0x454d92['endsWith'](_0x3c4aa7(0x1bf)))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1f2)+_0x454d92+'\x0a')),0x1;_0x32aa0d=[_0x454d92];}else _0x32aa0d=findYamlFiles(_0x4469a6);if(_0x32aa0d['length']===0x0)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x17d)+_0x4469a6+'\x0a')),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1bd)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x25f969,_0x2185ae;try{const _0x29ef6f=parseAndClassifyYamlFiles(_0x32aa0d,_0x4469a6,{'skipSegments':_0x179d89[_0x3c4aa7(0x1a6)]});_0x25f969=_0x29ef6f[_0x3c4aa7(0x20b)],_0x2185ae=_0x29ef6f[_0x3c4aa7(0x19f)];const _0x493b34=validateParsedFiles(_0x29ef6f,_0x4469a6);if(_0x493b34[_0x3c4aa7(0x197)]>0x0)return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1da))),console[_0x3c4aa7(0x1a8)](formatValidationErrors(_0x493b34)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xd0fce6){return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red']('Error\x20parsing\x20YAML:\x20'+(_0xd0fce6 instanceof Error?_0xd0fce6[_0x3c4aa7(0x1fe)]:_0xd0fce6))),0x1;}if(_0x25f969[_0x3c4aa7(0x197)]===0x0&&_0x2185ae[_0x3c4aa7(0x197)]===0x0){const _0x47907a=_0x179d89['journeysOnly']?_0x3c4aa7(0x188):'segment\x20or\x20journey';return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('No\x20'+_0x47907a+_0x3c4aa7(0x1de))),0x0;}const _0x38e917=new Map();_0x4c50b7['length']>0x0&&!_0x179d89['journeysOnly']&&await withSpinner(_0x3c4aa7(0x1f6),async()=>{await batchAsync(_0x4c50b7,async _0x576479=>{const _0x53ebad=a39_0x1a44,_0x571327=await _0xf398e['segment'][_0x53ebad(0x1ae)](_0x27c4c2,_0x576479['id']);_0x38e917[_0x53ebad(0x1c6)](_0x576479['id'],_0x571327);});},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]});const {segmentFiles:_0x5048ac,foldersToCreate:_0xb93ae0}=await prepareSegmentFiles(_0x25f969,{'segmentByFolderAndName':_0x47f6c8,'activationsBySegmentId':_0x38e917,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7},_0x369f1c,_0x5dce64,_0x2d5f09),_0x23a66c=_0x454d92?[]:findSegmentsToDelete(_0x4c50b7,_0x25f969[_0x3c4aa7(0x20e)](({yamlConfig:_0x48815a,folderPath:_0x100306})=>({'yamlConfig':_0x48815a,'folderPath':resolveTDFolderPath(_0x100306,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),{journeyFiles:_0x26dfdc,foldersToCreate:_0xa528b0}=await withProgressSpinner(_0x3c4aa7(0x1d1),async _0x23e92b=>prepareJourneyFiles(_0x2185ae,{'fetchJourney':async _0x5fa5e2=>_0xf398e[_0x3c4aa7(0x188)][_0x3c4aa7(0x1d8)](_0x5fa5e2[_0x3c4aa7(0x17c)]),'journeyBundlesByFolderAndName':_0x3a2291,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7,'existingSegments':_0x4c50b7,'parentId':_0x27c4c2,'deps':_0xf398e,'progress':{'update':_0x35f932=>{const _0x13f785=_0x3c4aa7;_0x23e92b[_0x13f785(0x1b6)](_0x35f932),_0x179d89[_0x13f785(0x1be)]&&console[_0x13f785(0x1a8)]('\x20\x20'+_0x35f932);}},'journeyById':_0x3e9f46,'activationStepsById':_0x27bad3},_0x5dce64,_0x2d5f09),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0xa07a6c=>_0xa07a6c[_0x3c4aa7(0x177)]);for(const _0x45e717 of _0xa528b0){_0xb93ae0[_0x3c4aa7(0x18a)](_0x45e717);}const _0x2be252=_0x454d92?[]:findJourneysToDelete(_0x9a09dd,_0x2185ae[_0x3c4aa7(0x20e)](({yamlConfig:_0x23d3a8,folderPath:_0x513c5a})=>({'yamlConfig':_0x23d3a8,'folderPath':resolveTDFolderPath(_0x513c5a,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),_0x492beb=calculatePushStats(_0x5048ac,_0x26dfdc,_0xb93ae0,_0x23a66c,_0x2be252,!!_0x179d89['delete'],!!_0x179d89[_0x3c4aa7(0x1a6)]),_0x4db57f=_0x492beb[_0x3c4aa7(0x20b)]['new'],_0x290ab9=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x1ef)],_0x3dd41f=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x18d)],_0x41f115=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x208)],_0x465414=_0x492beb[_0x3c4aa7(0x1ab)][_0x3c4aa7(0x207)],_0x59a7d4=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x1fb)],_0x4a9f7f=_0x492beb['journeys'][_0x3c4aa7(0x1ef)],_0x13e9a8=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x18d)],_0x3beed2=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x208)],_0x478817=_0x492beb[_0x3c4aa7(0x202)]['all'],_0x3a079c=_0x492beb['activations'][_0x3c4aa7(0x207)],_0x2161a4=_0x492beb['activations']['toUpdate'],_0x151d9f=_0x492beb[_0x3c4aa7(0x202)][_0x3c4aa7(0x208)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x5e8349+'\x27:');_0x465414[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1ca)](_0x3c4aa7(0x200)+_0x465414[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c3)));if(!_0x179d89[_0x3c4aa7(0x1a6)]){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x184)),console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x4db57f['length']+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x290ab9[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x41f115[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x41f115[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x23a66c[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x23a66c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1fd)));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x3dd41f['length']+_0x3c4aa7(0x1cf)));}if(_0x26dfdc['length']>0x0||_0x2be252[_0x3c4aa7(0x197)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x59a7d4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x3beed2[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b['red']('-\x20'+_0x3beed2[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x2be252['length']>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x2be252['length']+_0x3c4aa7(0x1fd)));console['error']('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x13e9a8[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1cf)));}_0x478817[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&(console['error'](''),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1d6)),_0x3a079c[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x3a079c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c9))),_0x2161a4[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x2161a4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1d5))),_0x151d9f[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x151d9f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8))));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x204)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x4469a6)+'\x0a');if(_0x465414[_0x3c4aa7(0x197)]>0x0){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1e2));for(const _0x530495 of _0x465414){console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['blue']('+')+'\x20'+_0x530495);}console['error']('');}if(_0x4db57f[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x459d8a of _0x4db57f){const _0x486aeb=_0x459d8a[_0x3c4aa7(0x205)]?_0x459d8a[_0x3c4aa7(0x205)]+'/'+_0x459d8a['yamlConfig'][_0x3c4aa7(0x1a9)]:_0x459d8a[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)],_0xefa5a6=_0x459d8a[_0x3c4aa7(0x1ea)]['activations']?.[_0x3c4aa7(0x197)]||0x0,_0x1e7f61=_0xefa5a6>0x0?a39_0x30ea8b[_0x3c4aa7(0x1e6)]('\x20['+_0xefa5a6+_0x3c4aa7(0x17f)):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('New\x20segment:')+'\x20'+_0x486aeb+_0x1e7f61),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c)),_0x459d8a[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x459d8a['diff']),console[_0x3c4aa7(0x1a8)]('─'['repeat'](0x3c));}if(_0x41f115[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x37f245 of _0x41f115){const _0x342106=_0x37f245[_0x3c4aa7(0x19d)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x37f245[_0x3c4aa7(0x19d)][_0x3c4aa7(0x1f3)]())||'':'',_0x53db03=_0x342106?_0x342106+'/'+_0x37f245[_0x3c4aa7(0x1a9)]:_0x37f245['name'],_0x4e10ed=_0x38e917['get'](_0x37f245['id'])||[],_0x59de94=_0x4e10ed['length']>0x0?a39_0x30ea8b['dim']('\x20['+_0x4e10ed[_0x3c4aa7(0x197)]+'\x20activations]'):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red'](_0x3c4aa7(0x211))+'\x20'+_0x53db03+_0x59de94),console['error']('─'['repeat'](0x3c));const _0x157d59=segmentWithActivationsToYaml(_0x37f245,_0x4e10ed,undefined,_0x12e592,_0x2eb4a7),_0x1a8611=segmentToYamlString(_0x157d59),_0xf20e40=generateDiff(_0x1a8611,'');console[_0x3c4aa7(0x1a8)](formatDiffWithColors(_0xf20e40)),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3f4ff6=_0x5048ac['filter'](_0x55b131=>!_0x55b131['isNew']&&_0x55b131[_0x3c4aa7(0x192)]);if(_0x3f4ff6[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x59fccd of _0x3f4ff6){const _0x26de66=_0x59fccd['folderPath']?_0x59fccd[_0x3c4aa7(0x205)]+'/'+_0x59fccd[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x59fccd[_0x3c4aa7(0x1ea)]['name'];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1bb))+'\x20'+_0x26de66),console[_0x3c4aa7(0x1a8)]('─'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x59fccd[_0x3c4aa7(0x192)]),console['error']('─'[_0x3c4aa7(0x1f5)](0x3c));}if(_0x59a7d4[_0x3c4aa7(0x197)]>0x0)for(const _0x5d0cfb of _0x59a7d4){const _0x3d03bf=_0x5d0cfb[_0x3c4aa7(0x205)]?_0x5d0cfb[_0x3c4aa7(0x205)]+'/'+_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x3c4aa7(0x1b1))+'\x20'+_0x3d03bf),console['error']('─'['repeat'](0x3c)),_0x5d0cfb[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x5d0cfb[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3d646d=_0x26dfdc['filter'](_0x40ccfa=>!_0x40ccfa[_0x3c4aa7(0x20f)]&&_0x40ccfa[_0x3c4aa7(0x192)]);if(_0x3d646d['length']>0x0)for(const _0x5582e0 of _0x3d646d){const _0x3f1f83=_0x5582e0[_0x3c4aa7(0x205)]?_0x5582e0[_0x3c4aa7(0x205)]+'/'+_0x5582e0[_0x3c4aa7(0x1ea)]['name']:_0x5582e0[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1cc))+'\x20'+_0x3f1f83),console['error']('─'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x5582e0[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('─'['repeat'](0x3c));}if(_0x3beed2['length']>0x0)for(const _0x4f01d4 of _0x3beed2){const _0x55390f=_0x4f01d4[_0x3c4aa7(0x1f7)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x4f01d4['folderId'])||'':'',_0x124cbe=_0x55390f?_0x55390f+'/'+_0x4f01d4['journeyBundleName']:_0x4f01d4[_0x3c4aa7(0x186)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red']('Delete\x20journey:')+'\x20'+_0x124cbe),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'['repeat'](0x3c));}if(_0x179d89['dryRun'])return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x596dfa=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x4db57f[_0x3c4aa7(0x197)]>0x0||_0x290ab9['length']>0x0||_0x41f115[_0x3c4aa7(0x197)]>0x0,_0x3fbf21=_0x59a7d4[_0x3c4aa7(0x197)]>0x0||_0x4a9f7f[_0x3c4aa7(0x197)]>0x0||_0x3beed2['length']>0x0,_0xde3d5d=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x478817[_0x3c4aa7(0x197)]>0x0,_0x33ef64=_0x465414['length']>0x0;if(!_0x596dfa&&!_0x3fbf21&&!_0xde3d5d&&!_0x33ef64){const _0x4f6182=_0x179d89[_0x3c4aa7(0x1a6)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x3c4aa7(0x1b4);console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x4f6182));if(_0x454d92&&_0x3dd41f[_0x3c4aa7(0x197)]===0x1){const _0x272ed8=_0x3dd41f[0x0];if(_0x272ed8[_0x3c4aa7(0x203)]?.['id']){const _0x376c52=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x272ed8[_0x3c4aa7(0x203)]['id']+_0x3c4aa7(0x18b));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x18c)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x376c52));}}if(_0x454d92&&_0x13e9a8['length']===0x1){const _0x3600ca=_0x13e9a8[0x0];if(_0x3600ca[_0x3c4aa7(0x1d4)]?.['id']){const _0x36a041=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],'/app/ps/'+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x3600ca['existingJourney']['id']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x36a041));}}return 0x0;}const _0x274e38=_0x179d89[_0x3c4aa7(0x1a6)]?_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3beed2[_0x3c4aa7(0x197)]+_0x465414[_0x3c4aa7(0x197)]:_0x4db57f[_0x3c4aa7(0x197)]+_0x290ab9[_0x3c4aa7(0x197)]+_0x41f115[_0x3c4aa7(0x197)]+_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f['length']+_0x3beed2['length']+_0x465414[_0x3c4aa7(0x197)]+_0x478817[_0x3c4aa7(0x197)];if(!_0x179d89['yes']&&_0x274e38>0x0){if(!isInteractive())return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red'](_0x3c4aa7(0x1b2)),_0x3c4aa7(0x18f)),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x3c4aa7(0x1d0))),0x1;const _0x4dbcf1=await confirmKey(_0x3c4aa7(0x178)+_0x274e38+'\x20changes?');if(!_0x4dbcf1)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x175))),0x1;}const _0x566d57={'withProgress':async(_0x2af465,_0x3a4d73)=>{const _0xa2ee3=_0x3c4aa7,_0x463693=await withSpinner(_0x2af465,_0x3a4d73,{'verbose':_0x179d89[_0xa2ee3(0x1be)]});return{'data':_0x463693[_0xa2ee3(0x177)]};},'logInfo':_0x138d6b=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1ca)]('✔\x20'+_0x138d6b)),'logSuccess':_0xf4cf46=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green']('✔\x20'+_0xf4cf46)),'logWarning':_0x378e24=>console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('⚠\x20'+_0x378e24)),'logDeleted':_0x189591=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('✔\x20'+_0x189591))},_0x188bb5={'segment':_0xf398e[_0x3c4aa7(0x1bc)],'journey':_0xf398e['journey'],'user':_0xf398e[_0x3c4aa7(0x1ff)],'connection':_0xf398e[_0x3c4aa7(0x1dc)]};_0x465414[_0x3c4aa7(0x197)]>0x0&&(_0x54cf4a=await executePushFolders(_0x188bb5,_0x465414,_0x54cf4a,{'parentId':_0x27c4c2},_0x566d57));const _0x127846={'rootFolderId':_0x5aca44,'folderPathToId':_0x54cf4a,'folderIdToPath':_0x6b7ab2,'segmentNameToId':_0x3cc844,'activationsBySegmentId':_0x38e917,'emailToIdMap':_0x1261a0,'idToEmailMap':_0x12e592,'connectionNameToIdMap':_0x753f53[_0x3c4aa7(0x210)],'connectionIdToNameMap':_0x753f53['idToName'],'connectionNameToTypeMap':_0x5c3fbe},_0x299271=await executePushSegments(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x5048ac,_0x127846,{'parentId':_0x27c4c2},_0x566d57),_0x34ecdc=_0x299271[_0x3c4aa7(0x1a7)],_0x227240=_0x299271[_0x3c4aa7(0x1fc)],_0x30c76a=_0x299271[_0x3c4aa7(0x202)]['created'],_0x25ac52=_0x299271[_0x3c4aa7(0x202)][_0x3c4aa7(0x1fc)],_0x336ae2=_0x299271['activations'][_0x3c4aa7(0x209)];let _0x142598;if(_0x454d92&&_0x5048ac['length']===0x1){const _0x108c69=_0x5048ac[0x0];_0x142598=_0x108c69[_0x3c4aa7(0x203)]?.['id']??_0x299271[_0x3c4aa7(0x1e5)][_0x3c4aa7(0x1ac)](_0x108c69[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]);}const _0x3c32db=await executePushSegmentDeletions(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x41f115,_0x566d57);let _0x3b56eb=0x0,_0x2fb9fa=0x0,_0x5b59bb=0x0;const _0x1e9df6=new Map(_0x3cc844);for(const [_0x596406,_0x4c9901]of _0x299271[_0x3c4aa7(0x1e5)]){_0x1e9df6[_0x3c4aa7(0x1c6)](_0x596406,_0x4c9901);}if(_0x26dfdc[_0x3c4aa7(0x197)]>0x0){const _0x405402={..._0x127846,'segmentNameToId':_0x1e9df6,'existingSegments':_0x4c50b7,'activationContext':_0x369f1c},_0x5a442c=await executePushJourneys(_0x188bb5,_0x26dfdc,_0x405402,{'parentId':_0x27c4c2,'rootFolderId':_0x5aca44,'verbose':_0x179d89[_0x3c4aa7(0x1be)]},_0x566d57);_0x3b56eb=_0x5a442c[_0x3c4aa7(0x1a7)],_0x2fb9fa=_0x5a442c[_0x3c4aa7(0x1fc)];if(_0x454d92&&_0x5a442c[_0x3c4aa7(0x190)][_0x3c4aa7(0x197)]===0x1){const _0x58b955=_0x5a442c[_0x3c4aa7(0x190)][0x0];if(_0x58b955[_0x3c4aa7(0x17c)]){const _0x3b339b=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x58b955['journeyId']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['cyan'](_0x3b339b));}}}for(const _0x5501d7 of _0x3beed2){console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1b0)+_0x5501d7[_0x3c4aa7(0x186)])),_0x5b59bb++;}const _0x32d2c5=[];if(_0x34ecdc>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x34ecdc+_0x3c4aa7(0x1fa));if(_0x227240>0x0)_0x32d2c5['push'](_0x227240+_0x3c4aa7(0x1c1));if(_0x3c32db>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x3c32db+_0x3c4aa7(0x212));const _0x17af64=[];if(_0x3b56eb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x3b56eb+_0x3c4aa7(0x1fa));if(_0x2fb9fa>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x2fb9fa+_0x3c4aa7(0x1c1));if(_0x5b59bb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x5b59bb+_0x3c4aa7(0x212));const _0x1073de=[];if(_0x30c76a>0x0)_0x1073de['push'](_0x30c76a+_0x3c4aa7(0x1fa));if(_0x25ac52>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x25ac52+_0x3c4aa7(0x1c1));if(_0x336ae2>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x336ae2+_0x3c4aa7(0x212));console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green'](_0x3c4aa7(0x1f4)));_0x32d2c5[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x180)+_0x32d2c5[_0x3c4aa7(0x187)](',\x20'));_0x17af64[_0x3c4aa7(0x197)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x17af64[_0x3c4aa7(0x187)](',\x20'));_0x1073de[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19a)+_0x1073de[_0x3c4aa7(0x187)](',\x20'));if(_0x142598){const _0x34b8d2=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x142598+_0x3c4aa7(0x18b));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x34b8d2));}return 0x0;}}
|