@treasuredata/tdx 2026.3.26 β 2026.3.28
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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.d.ts +141 -2
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/policy-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.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +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.d.ts +29 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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.d.ts +228 -0
- package/dist/sdk/personalization.d.ts.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/personalization.js.map +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.d.ts +57 -0
- package/dist/sdk/realtime.d.ts.map +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/realtime.js.map +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/cdp.d.ts +76 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x30aeec=a35_0x5eaa;(function(_0x2263bd,_0x37d9b9){const _0x354387=a35_0x5eaa,_0x52abce=_0x2263bd();while(!![]){try{const _0x348883=-parseInt(_0x354387(0x196))/0x1+-parseInt(_0x354387(0x180))/0x2+-parseInt(_0x354387(0x120))/0x3*(-parseInt(_0x354387(0x164))/0x4)+parseInt(_0x354387(0x191))/0x5*(parseInt(_0x354387(0x10c))/0x6)+parseInt(_0x354387(0x112))/0x7*(parseInt(_0x354387(0x17c))/0x8)+parseInt(_0x354387(0x155))/0x9+parseInt(_0x354387(0x126))/0xa;if(_0x348883===_0x37d9b9)break;else _0x52abce['push'](_0x52abce['shift']());}catch(_0x3338d7){_0x52abce['push'](_0x52abce['shift']());}}}(a35_0x4d61,0x69242));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a35_0x4d61(){const _0x5599d2=['execute','result','Running\x20schedule...','Schedule\x20updated:\x20','last_job','7565360wGbYEA','description','nextRun','jsonl','round','format','INVALID_ARGUMENT','\x20\x20Cron:\x20','schedules','schedule:delete','Creating\x20schedule...','No\x20scheduled\x20queries\x20found','Update\x20a\x20scheduled\x20query','padEnd','\x20(showing\x20','Query\x20file\x20is\x20empty','π
\x20','json','Showing\x20first\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','utf-8','trim','update','\x20scheduled\x20quer','schedule:list','substring','from','has_next_page','\x22...','cyan','schedule:update','\x20\x20Job\x20ID:\x20','created_at','limit','Schedule\x20run\x20submitted:\x20','engine_version','\x20\x20β\x20','Updating\x20schedule:\x20','statusIcon','retryLimit','\x20\x20Time:\x20','Run\x20a\x20scheduled\x20query\x20immediately','Schedule\x20created:\x20','error','delay','args','Show\x20schedule\x20details','3808710cczKjC','updated_at','time_zone','abs','just\x20now','Running\x20schedule:\x20','list','soon','repeat','queryUrl','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20(use\x20--limit\x20to\x20see\x20more)','(unnamed)','getTime','job_id','184OfoJQw','max','create','dim','query','priority','run','executing_user_id','Delete\x20a\x20scheduled\x20query','\x20\x20Num:\x20','keys','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','verbose','scheduled_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','never','Schedule\x20deleted:\x20','schedule:create','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','\x20created','entries','options','retry_limit','success','901728aWVUiT','history','count','log','1511734rSRhAB','length','Getting\x20schedule\x20history...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Found\x20','num','map','yes','show','listQueries','Getting\x20schedule\x20details...','timezone','type','status','join','\x20\x20Type:\x20','\x20matching\x20\x22','228390jonzVt','schedule:show','cron','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','pagination','805807wgnHsr','...','ies','Show\x20schedule\x20execution\x20history','queries','in\x20','\x20job','Failed\x20to\x20read\x20file:\x20','jobs','24SVLFib','trino','validate','data','m\x20ago','Updating\x20schedule...','7vLhWaW','Create\x20a\x20scheduled\x20query','toLocaleDateString','file','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','database','end_at','table','lastRun','next_run_at','\x20\x20Timezone:\x20','engineVersion','red','name','33729Jijgto'];a35_0x4d61=function(){return _0x5599d2;};return a35_0x4d61();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';function a35_0x5eaa(_0x34b29a,_0x48ef20){_0x34b29a=_0x34b29a-0x105;const _0x4d61a7=a35_0x4d61();let _0x5eaa74=_0x4d61a7[_0x34b29a];return _0x5eaa74;}import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a35_0x200110 from'chalk';function formatRelativeTime(_0xffe675){const _0x1b5a4a=a35_0x5eaa,_0x1e8ed2=new Date(_0xffe675),_0x5bb912=new Date(),_0x59c5bb=_0x1e8ed2[_0x1b5a4a(0x162)]()-_0x5bb912[_0x1b5a4a(0x162)](),_0x2d783d=Math[_0x1b5a4a(0x158)](_0x59c5bb)/0x3e8,_0x28ecc9=_0x59c5bb<0x0;if(_0x2d783d<0x3c)return _0x28ecc9?_0x1b5a4a(0x159):_0x1b5a4a(0x15c);else{if(_0x2d783d<0xe10){const _0x51e176=Math[_0x1b5a4a(0x12a)](_0x2d783d/0x3c);return _0x28ecc9?_0x51e176+_0x1b5a4a(0x110):_0x1b5a4a(0x108)+_0x51e176+'m';}else{if(_0x2d783d<0x15180){const _0x2444c2=Math[_0x1b5a4a(0x12a)](_0x2d783d/0xe10);return _0x28ecc9?_0x2444c2+'h\x20ago':_0x1b5a4a(0x108)+_0x2444c2+'h';}else{if(_0x2d783d<0x93a80){const _0x1b8332=Math[_0x1b5a4a(0x12a)](_0x2d783d/0x15180);return _0x28ecc9?_0x1b8332+'d\x20ago':_0x1b5a4a(0x108)+_0x1b8332+'d';}else return _0x1e8ed2[_0x1b5a4a(0x114)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a35_0x30aeec(0x13e);[a35_0x30aeec(0x127)]='List\x20scheduled\x20queries';async[a35_0x30aeec(0x121)](_0x4514fc){const _0x47141b=a35_0x30aeec,{options:_0x578c0f,args:_0x12195e,tdx:_0x2352de}=_0x4514fc,_0x3c4d68=resolveLimit(_0x578c0f[_0x47141b(0x147)],DEFAULT_DISPLAY_LIMIT),_0x463996=_0x12195e[0x0],_0x67ace5=_0x463996?_0x47141b(0x15f)+_0x463996+_0x47141b(0x142):'Listing\x20scheduled\x20queries...',_0x90cbf0=await withSpinner(_0x67ace5,()=>_0x2352de['schedules'][_0x47141b(0x189)]({'limit':_0x3c4d68,'scheduled':!![],'pattern':_0x463996}),{'verbose':_0x578c0f[_0x47141b(0x170)]}),_0x2017c1=_0x90cbf0['data'][_0x47141b(0x107)],_0x250169=_0x90cbf0[_0x47141b(0x10f)][_0x47141b(0x195)][_0x47141b(0x141)],_0x136c3f=_0x463996?_0x47141b(0x190)+_0x463996+'\x22':'';_0x250169?console[_0x47141b(0x151)](_0x47141b(0x138)+_0x2017c1['length']+'\x20schedules'+_0x136c3f+_0x47141b(0x160)):console[_0x47141b(0x151)](_0x47141b(0x184)+_0x2017c1[_0x47141b(0x181)]+_0x47141b(0x13d)+(_0x2017c1[_0x47141b(0x181)]!==0x1?_0x47141b(0x105):'y')+_0x136c3f);if(_0x578c0f[_0x47141b(0x12b)]===_0x47141b(0x137)||_0x578c0f['format']===_0x47141b(0x129)||_0x578c0f[_0x47141b(0x12b)]===_0x47141b(0x119)||_0x578c0f[_0x47141b(0x12b)]==='tsv'){const _0x492d69=_0x2017c1['map'](_0x1450fa=>({'id':_0x1450fa['id'],'name':_0x1450fa[_0x47141b(0x11f)],'cron':_0x1450fa[_0x47141b(0x193)],'database':_0x1450fa[_0x47141b(0x117)]?.[_0x47141b(0x11f)],'type':_0x1450fa[_0x47141b(0x18c)],'timezone':_0x1450fa[_0x47141b(0x157)],'user_name':_0x1450fa['user']?.[_0x47141b(0x11f)],'updated_at':_0x1450fa[_0x47141b(0x156)],'next_run_at':_0x1450fa[_0x47141b(0x11b)],'last_job_status':_0x1450fa[_0x47141b(0x125)]?.[_0x47141b(0x18d)]}));await handleSDKOutput(_0x492d69,_0x578c0f);}else{if(_0x2017c1[_0x47141b(0x181)]===0x0)console[_0x47141b(0x17f)](_0x47141b(0x131));else{const _0x4ca1f1=_0x578c0f['site'],_0x5b0e26=_0x2017c1['map'](_0x1665c1=>{const _0x12fb1d=_0x47141b,_0x160328=_0x1665c1[_0x12fb1d(0x125)]?.[_0x12fb1d(0x18d)]?_0x1665c1[_0x12fb1d(0x125)][_0x12fb1d(0x18d)]===_0x12fb1d(0x17b)?'β':'β':'-',_0x4642f2=_0x1665c1[_0x12fb1d(0x125)]?.['ended_at']?formatRelativeTime(_0x1665c1['last_job']['ended_at']):_0x12fb1d(0x173),_0x395979=_0x1665c1[_0x12fb1d(0x11b)]?formatRelativeTime(_0x1665c1[_0x12fb1d(0x11b)]):'-',_0x5001d6=_0x1665c1['cron']||'',_0x5dac74=_0x1665c1[_0x12fb1d(0x11f)]||_0x12fb1d(0x161),_0x2ae79e=getConsoleUrl(_0x4ca1f1,'/app/queries/editor?queryId='+_0x1665c1['id']);return{'statusIcon':_0x160328,'lastRun':_0x4642f2,'nextRun':_0x395979,'cron':_0x5001d6,'name':_0x5dac74,'queryUrl':_0x2ae79e,'status':_0x1665c1[_0x12fb1d(0x125)]?.[_0x12fb1d(0x18d)]};}),_0x4f2e76=Math['max'](..._0x5b0e26[_0x47141b(0x186)](_0x43390e=>_0x43390e['lastRun']['length'])),_0x336f29=Math['max'](..._0x5b0e26['map'](_0x2c858c=>_0x2c858c[_0x47141b(0x128)][_0x47141b(0x181)])),_0x17ff97=Math[_0x47141b(0x165)](..._0x5b0e26['map'](_0x233622=>_0x233622[_0x47141b(0x193)][_0x47141b(0x181)])),_0x59d084=_0x5b0e26[_0x47141b(0x186)](_0x553e82=>{const _0x2d7bc3=_0x47141b,_0x27f1c7=_0x553e82[_0x2d7bc3(0x18d)]==='success'?a35_0x200110['green'](_0x553e82[_0x2d7bc3(0x14c)]):_0x553e82['status']===_0x2d7bc3(0x151)?a35_0x200110[_0x2d7bc3(0x11e)](_0x553e82[_0x2d7bc3(0x14c)]):a35_0x200110[_0x2d7bc3(0x167)](_0x553e82[_0x2d7bc3(0x14c)]),_0x593426=_0x553e82[_0x2d7bc3(0x11a)]['padEnd'](_0x4f2e76),_0x4ada62=_0x553e82[_0x2d7bc3(0x128)][_0x2d7bc3(0x133)](_0x336f29),_0x3fcc2e=_0x553e82[_0x2d7bc3(0x193)]?a35_0x200110[_0x2d7bc3(0x143)](_0x553e82[_0x2d7bc3(0x193)][_0x2d7bc3(0x133)](_0x17ff97)):'\x20'[_0x2d7bc3(0x15d)](_0x17ff97),_0x52d4cb=hyperlink(_0x553e82[_0x2d7bc3(0x11f)],_0x553e82[_0x2d7bc3(0x15e)]);return _0x2d7bc3(0x136)+_0x27f1c7+'\x20'+_0x593426+_0x2d7bc3(0x14a)+_0x4ada62+'\x20\x20'+_0x3fcc2e+'\x20\x20'+_0x52d4cb;});await writeOutput(_0x59d084[_0x47141b(0x18e)]('\x0a'),_0x578c0f['output'],_0x47141b(0x15b));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a35_0x30aeec(0x192);[a35_0x30aeec(0x127)]=a35_0x30aeec(0x154);['validate'](_0x230fb9){const _0x251e6d=a35_0x30aeec,_0x2a7fdb=_0x230fb9['args'][0x0];if(!_0x2a7fdb)return _0x251e6d(0x172);return undefined;}async[a35_0x30aeec(0x121)](_0x2ae2b7){const _0x29a713=a35_0x30aeec,{options:_0x4f2f46,args:_0x2b78d7,tdx:_0x458b1e}=_0x2ae2b7,_0x6d7183=_0x2b78d7[0x0],_0x1b3c2e=await withSpinner(_0x29a713(0x18a),()=>_0x458b1e[_0x29a713(0x12e)][_0x29a713(0x188)](_0x6d7183),{'verbose':_0x4f2f46['verbose']}),_0x185be7=_0x1b3c2e[_0x29a713(0x10f)],_0x1aa379={'name':_0x185be7[_0x29a713(0x11f)],'cron':_0x185be7[_0x29a713(0x193)],'database':_0x185be7['database'],'type':_0x185be7[_0x29a713(0x18c)],'timezone':_0x185be7['timezone'],'user_name':_0x185be7['user_name'],'created_at':_0x185be7['created_at'],'engine_version':_0x185be7[_0x29a713(0x149)],'executing_user_id':_0x185be7[_0x29a713(0x16b)],'query':_0x185be7[_0x29a713(0x168)],'delay':_0x185be7[_0x29a713(0x152)],'priority':_0x185be7['priority'],'retry_limit':_0x185be7['retry_limit'],..._0x185be7[_0x29a713(0x122)]&&{'result':_0x185be7[_0x29a713(0x122)]}};return await handleSingleObjectOutput(_0x1aa379,_0x4f2f46),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a35_0x30aeec(0x175);['description']=a35_0x30aeec(0x113);[a35_0x30aeec(0x10e)](_0x542429){const _0x4ba566=a35_0x30aeec,_0x3013a7=_0x542429[_0x4ba566(0x153)][0x0];if(!_0x3013a7)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x195097=_0x542429[_0x4ba566(0x179)];if(!_0x195097['database'])return _0x4ba566(0x194);return undefined;}async['execute'](_0x13856e){const _0x15f650=a35_0x30aeec,{options:_0x15b3a8,args:_0x16080f,tdx:_0x56a42c}=_0x13856e,_0xa69a30=_0x16080f[0x0],_0x3e4f2a=_0x15b3a8,_0x19dc06=_0x3e4f2a[_0x15f650(0x117)],_0x236267=_0x3e4f2a[_0x15f650(0x115)],_0x326ff2=_0x3e4f2a['type']||_0x15f650(0x10d);let _0x9fb7cf;try{_0x9fb7cf=readFileSync(_0x236267,_0x15f650(0x13a))[_0x15f650(0x13b)]();}catch(_0x558afd){throw new SDKError(ErrorCode[_0x15f650(0x12c)],_0x15f650(0x10a)+_0x236267,_0x558afd instanceof Error?_0x558afd:undefined);}if(!_0x9fb7cf)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x15f650(0x135));const _0x3ee1cd={'database':_0x19dc06,'query':_0x9fb7cf,'type':_0x326ff2};if(_0x3e4f2a['cron'])_0x3ee1cd['cron']=_0x3e4f2a['cron'];if(_0x3e4f2a[_0x15f650(0x18b)])_0x3ee1cd[_0x15f650(0x18b)]=_0x3e4f2a[_0x15f650(0x18b)];if(_0x3e4f2a[_0x15f650(0x152)]!==undefined)_0x3ee1cd[_0x15f650(0x152)]=Number(_0x3e4f2a[_0x15f650(0x152)]);if(_0x3e4f2a[_0x15f650(0x169)]!==undefined)_0x3ee1cd[_0x15f650(0x169)]=Number(_0x3e4f2a[_0x15f650(0x169)]);if(_0x3e4f2a[_0x15f650(0x14d)]!==undefined)_0x3ee1cd[_0x15f650(0x17a)]=Number(_0x3e4f2a[_0x15f650(0x14d)]);if(_0x3e4f2a[_0x15f650(0x11d)])_0x3ee1cd[_0x15f650(0x149)]=_0x3e4f2a['engineVersion'];if(_0x3e4f2a['result'])_0x3ee1cd['result']=_0x3e4f2a[_0x15f650(0x122)];if(_0x15b3a8[_0x15f650(0x170)]){console['error']('Creating\x20schedule:\x20'+_0xa69a30),console[_0x15f650(0x151)]('\x20\x20Database:\x20'+_0x19dc06),console['error'](_0x15f650(0x18f)+_0x326ff2);if(_0x3ee1cd['cron'])console['error'](_0x15f650(0x12d)+_0x3ee1cd[_0x15f650(0x193)]);if(_0x3ee1cd[_0x15f650(0x18b)])console[_0x15f650(0x151)](_0x15f650(0x11c)+_0x3ee1cd[_0x15f650(0x18b)]);}const _0x26bdce=await withSpinner(_0x15f650(0x130),()=>_0x56a42c['schedules'][_0x15f650(0x166)](_0xa69a30,_0x3ee1cd),{'verbose':_0x15b3a8['verbose']});return console['error'](_0x15f650(0x150)+_0x26bdce[_0x15f650(0x10f)][_0x15f650(0x11f)]),await handleSingleObjectOutput(_0x26bdce[_0x15f650(0x10f)],_0x15b3a8),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a35_0x30aeec(0x144);[a35_0x30aeec(0x127)]=a35_0x30aeec(0x132);[a35_0x30aeec(0x10e)](_0x5a4073){const _0x368148=a35_0x30aeec,_0x2d8309=_0x5a4073[_0x368148(0x153)][0x0];if(!_0x2d8309)return _0x368148(0x176);return undefined;}async[a35_0x30aeec(0x121)](_0x3a8530){const _0x2704b3=a35_0x30aeec,{options:_0x356528,args:_0x2470ce,tdx:_0x390851}=_0x3a8530,_0x487229=_0x2470ce[0x0],_0x3b3969=_0x356528,_0x51ee9d={};if(_0x3b3969[_0x2704b3(0x117)])_0x51ee9d['database']=_0x3b3969[_0x2704b3(0x117)];if(_0x3b3969[_0x2704b3(0x18c)])_0x51ee9d[_0x2704b3(0x18c)]=_0x3b3969[_0x2704b3(0x18c)];if(_0x3b3969['cron'])_0x51ee9d['cron']=_0x3b3969[_0x2704b3(0x193)];if(_0x3b3969['timezone'])_0x51ee9d[_0x2704b3(0x18b)]=_0x3b3969['timezone'];if(_0x3b3969['delay']!==undefined)_0x51ee9d[_0x2704b3(0x152)]=Number(_0x3b3969[_0x2704b3(0x152)]);if(_0x3b3969[_0x2704b3(0x169)]!==undefined)_0x51ee9d[_0x2704b3(0x169)]=Number(_0x3b3969[_0x2704b3(0x169)]);if(_0x3b3969['retryLimit']!==undefined)_0x51ee9d[_0x2704b3(0x17a)]=Number(_0x3b3969[_0x2704b3(0x14d)]);if(_0x3b3969[_0x2704b3(0x11d)])_0x51ee9d[_0x2704b3(0x149)]=_0x3b3969[_0x2704b3(0x11d)];if(_0x3b3969[_0x2704b3(0x122)])_0x51ee9d['result']=_0x3b3969[_0x2704b3(0x122)];if(_0x3b3969[_0x2704b3(0x115)])try{_0x51ee9d[_0x2704b3(0x168)]=readFileSync(_0x3b3969[_0x2704b3(0x115)],_0x2704b3(0x13a))[_0x2704b3(0x13b)]();}catch(_0x4c3e48){throw new SDKError(ErrorCode[_0x2704b3(0x12c)],_0x2704b3(0x10a)+_0x3b3969['file'],_0x4c3e48 instanceof Error?_0x4c3e48:undefined);}if(Object[_0x2704b3(0x16e)](_0x51ee9d)[_0x2704b3(0x181)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2704b3(0x116));if(_0x356528[_0x2704b3(0x170)]){console[_0x2704b3(0x151)](_0x2704b3(0x14b)+_0x487229);for(const [_0x4aafb9,_0x4078fc]of Object[_0x2704b3(0x178)](_0x51ee9d)){_0x4aafb9===_0x2704b3(0x168)?console[_0x2704b3(0x151)]('\x20\x20'+_0x4aafb9+':\x20'+_0x4078fc[_0x2704b3(0x13f)](0x0,0x32)+_0x2704b3(0x197)):console[_0x2704b3(0x151)]('\x20\x20'+_0x4aafb9+':\x20'+_0x4078fc);}}const _0x2114d4=await withSpinner(_0x2704b3(0x111),()=>_0x390851[_0x2704b3(0x12e)][_0x2704b3(0x13c)](_0x487229,_0x51ee9d),{'verbose':_0x356528['verbose']});return console[_0x2704b3(0x151)](_0x2704b3(0x124)+_0x2114d4[_0x2704b3(0x10f)]['name']),await handleSingleObjectOutput(_0x2114d4['data'],_0x356528),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a35_0x30aeec(0x11f)]=a35_0x30aeec(0x12f);[a35_0x30aeec(0x127)]=a35_0x30aeec(0x16c);[a35_0x30aeec(0x10e)](_0x4502c8){const _0x3417bc=a35_0x30aeec,_0x27dd2d=_0x4502c8[_0x3417bc(0x153)][0x0];if(!_0x27dd2d)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async['execute'](_0x2e4361){const _0x44c1c2=a35_0x30aeec,{options:_0xbd4483,args:_0x130402,tdx:_0x590956}=_0x2e4361,_0x423c48=_0x130402[0x0];if(!_0xbd4483[_0x44c1c2(0x187)]){const _0x2f1564=await confirm(_0x44c1c2(0x139)+_0x423c48+'\x22?');if(!_0x2f1564)return console[_0x44c1c2(0x151)]('Cancelled'),0x0;}const _0x705587=await withSpinner('Deleting\x20schedule...',()=>_0x590956['schedules']['delete'](_0x423c48),{'verbose':_0xbd4483[_0x44c1c2(0x170)]});return console[_0x44c1c2(0x151)](_0x44c1c2(0x174)+_0x705587[_0x44c1c2(0x10f)][_0x44c1c2(0x11f)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x30aeec(0x11f)]='schedule:run';[a35_0x30aeec(0x127)]=a35_0x30aeec(0x14f);['validate'](_0x3d4917){const _0x4ae1fa=a35_0x30aeec,_0x5e4c60=_0x3d4917[_0x4ae1fa(0x153)][0x0];if(!_0x5e4c60)return _0x4ae1fa(0x183);return undefined;}async[a35_0x30aeec(0x121)](_0x59b3ca){const _0x3d46b3=a35_0x30aeec,{options:_0x2e0938,args:_0xc5452a,tdx:_0x403012}=_0x59b3ca,_0x37d455=_0xc5452a[0x0],_0x106a97=_0x2e0938,_0x58689a=_0x106a97['time'],_0x5c9066=_0x106a97[_0x3d46b3(0x185)]!==undefined?Number(_0x106a97[_0x3d46b3(0x185)]):undefined;if(_0x2e0938[_0x3d46b3(0x170)]){console['error'](_0x3d46b3(0x15a)+_0x37d455);if(_0x58689a)console[_0x3d46b3(0x151)](_0x3d46b3(0x14e)+_0x58689a);if(_0x5c9066)console[_0x3d46b3(0x151)](_0x3d46b3(0x16d)+_0x5c9066);}const _0x2f27a9=await withSpinner(_0x3d46b3(0x123),()=>_0x403012[_0x3d46b3(0x12e)][_0x3d46b3(0x16a)](_0x37d455,{'time':_0x58689a,'num':_0x5c9066}),{'verbose':_0x2e0938[_0x3d46b3(0x170)]}),_0x446ade=_0x2f27a9[_0x3d46b3(0x10f)][_0x3d46b3(0x10b)];console[_0x3d46b3(0x151)](_0x3d46b3(0x148)+_0x446ade[_0x3d46b3(0x181)]+_0x3d46b3(0x109)+(_0x446ade[_0x3d46b3(0x181)]!==0x1?'s':'')+_0x3d46b3(0x177));for(const _0x231012 of _0x446ade){console[_0x3d46b3(0x151)](_0x3d46b3(0x145)+_0x231012[_0x3d46b3(0x163)]);}return await handleSDKOutput(_0x446ade,_0x2e0938),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a35_0x30aeec(0x11f)]='schedule:history';[a35_0x30aeec(0x127)]=a35_0x30aeec(0x106);[a35_0x30aeec(0x10e)](_0x2ffbcc){const _0x5eb012=a35_0x30aeec,_0x54a53e=_0x2ffbcc[_0x5eb012(0x153)][0x0];if(!_0x54a53e)return _0x5eb012(0x16f);return undefined;}async[a35_0x30aeec(0x121)](_0x5065b6){const _0x552aeb=a35_0x30aeec,{options:_0x358de5,args:_0x4bf29f,tdx:_0x32e5f6}=_0x5065b6,_0x406cc7=_0x4bf29f[0x0],_0x25547b=_0x358de5,_0x262918=_0x25547b[_0x552aeb(0x140)]!==undefined?Number(_0x25547b[_0x552aeb(0x140)]):undefined,_0x1712c5=_0x25547b['to']!==undefined?Number(_0x25547b['to']):undefined,_0x2dcaaf=await withSpinner(_0x552aeb(0x182),()=>_0x32e5f6[_0x552aeb(0x12e)][_0x552aeb(0x17d)](_0x406cc7,{'from':_0x262918,'to':_0x1712c5}),{'verbose':_0x358de5[_0x552aeb(0x170)]}),_0x86c1d=_0x2dcaaf[_0x552aeb(0x10f)];console['error'](_0x552aeb(0x184)+_0x86c1d['count']+'\x20execution'+(_0x86c1d[_0x552aeb(0x17e)]!==0x1?'s':'')+_0x552aeb(0x134)+_0x86c1d[_0x552aeb(0x140)]+'-'+_0x86c1d['to']+')');const _0x1bd082=_0x86c1d[_0x552aeb(0x17d)][_0x552aeb(0x186)](_0x25f9dc=>({'job_id':_0x25f9dc[_0x552aeb(0x163)],'type':_0x25f9dc[_0x552aeb(0x18c)],'status':_0x25f9dc[_0x552aeb(0x18d)],'scheduled_at':_0x25f9dc[_0x552aeb(0x171)],'created_at':_0x25f9dc[_0x552aeb(0x146)],'start_at':_0x25f9dc['start_at'],'end_at':_0x25f9dc[_0x552aeb(0x118)]}));return await handleSDKOutput(_0x1bd082,_0x358de5),0x0;}}
|
|
1
|
+
const a35_0x42a9e2=a35_0x53ea;(function(_0x363a0f,_0x2f692d){const _0x587a29=a35_0x53ea,_0x585be2=_0x363a0f();while(!![]){try{const _0x222df8=parseInt(_0x587a29(0x1e2))/0x1*(parseInt(_0x587a29(0x18d))/0x2)+parseInt(_0x587a29(0x206))/0x3+-parseInt(_0x587a29(0x1bf))/0x4+-parseInt(_0x587a29(0x1f6))/0x5+parseInt(_0x587a29(0x1f2))/0x6*(-parseInt(_0x587a29(0x1cb))/0x7)+-parseInt(_0x587a29(0x1cc))/0x8+-parseInt(_0x587a29(0x1ec))/0x9*(-parseInt(_0x587a29(0x1be))/0xa);if(_0x222df8===_0x2f692d)break;else _0x585be2['push'](_0x585be2['shift']());}catch(_0x54e5e1){_0x585be2['push'](_0x585be2['shift']());}}}(a35_0x1a6e,0xd01f7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a35_0x1a6e(){const _0x4e1c73=['\x20matching\x20\x22','show','lastRun','last_job','\x22...','\x20(use\x20--limit\x20to\x20see\x20more)','success','delay','length','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20execution','Searching\x20scheduled\x20queries\x20matching\x20\x22','schedule:history','never','error','user_name','schedule:run','join','Listing\x20scheduled\x20queries...','schedules','No\x20scheduled\x20queries\x20found','nextRun','pagination','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','count','schedule:update','created_at','listQueries','ended_at','queryUrl','padEnd','jobs','Update\x20a\x20scheduled\x20query','engineVersion','List\x20scheduled\x20queries','10OTcotn','2602312CdKxQu','status','keys','args','delete','data','time_zone','Running\x20schedule...','verbose','Schedule\x20updated:\x20','query','getTime','7MdvMuq','246504xrBflr','\x20\x20Num:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','log','Failed\x20to\x20read\x20file:\x20','retry_limit','entries','retryLimit','file','\x20job','repeat','\x20\x20Type:\x20','dim','(unnamed)','name','yes','Creating\x20schedule:\x20','h\x20ago','trino','Show\x20schedule\x20details','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Schedule\x20run\x20submitted:\x20','164899LPlQsQ','job_id','start_at','list','queries','Cancelled','from','substring','user','next_run_at','21041181aAwPFg','\x20scheduled\x20quer','m\x20ago','time','format','\x20\x20Cron:\x20','6448626tPObIr','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','result','timezone','1061540nHwPbD','Delete\x20a\x20scheduled\x20query','INVALID_ARGUMENT','cron','history','tsv','type','Updating\x20schedule...','site','round','d\x20ago','scheduled_at','Creating\x20schedule...','trim','schedule:list','create','954399InSPXv','Found\x20','updated_at','Updating\x20schedule:\x20','num','in\x20','abs','jsonl','\x20\x20Timezone:\x20','Run\x20a\x20scheduled\x20query\x20immediately','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','...','utf-8','table','/app/queries/editor?queryId=','map','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','\x20\x20Time:\x20','statusIcon','Schedule\x20deleted:\x20','schedule:show','executing_user_id','\x20created','database','cyan','validate','Getting\x20schedule\x20details...','2plcUMv','Create\x20a\x20scheduled\x20query','end_at','description','has_next_page','Showing\x20first\x20','priority','engine_version','π
\x20','just\x20now','execute','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','max','Deleting\x20schedule...'];a35_0x1a6e=function(){return _0x4e1c73;};return a35_0x1a6e();}import{hyperlink}from'../sdk/util/formatters.js';import a35_0x168a99 from'chalk';function a35_0x53ea(_0x6f2dd5,_0x3c2346){_0x6f2dd5=_0x6f2dd5-0x17a;const _0x1a6e5d=a35_0x1a6e();let _0x53ea56=_0x1a6e5d[_0x6f2dd5];return _0x53ea56;}function formatRelativeTime(_0x8b3818){const _0x3a6065=a35_0x53ea,_0x424b80=new Date(_0x8b3818),_0x5b5558=new Date(),_0x3c6fbf=_0x424b80['getTime']()-_0x5b5558[_0x3a6065(0x1ca)](),_0x61487f=Math[_0x3a6065(0x20c)](_0x3c6fbf)/0x3e8,_0x5909b3=_0x3c6fbf<0x0;if(_0x61487f<0x3c)return _0x5909b3?_0x3a6065(0x196):'soon';else{if(_0x61487f<0xe10){const _0x31645f=Math[_0x3a6065(0x1ff)](_0x61487f/0x3c);return _0x5909b3?_0x31645f+_0x3a6065(0x1ee):'in\x20'+_0x31645f+'m';}else{if(_0x61487f<0x15180){const _0x3ae283=Math[_0x3a6065(0x1ff)](_0x61487f/0xe10);return _0x5909b3?_0x3ae283+_0x3a6065(0x1dd):'in\x20'+_0x3ae283+'h';}else{if(_0x61487f<0x93a80){const _0x28483e=Math[_0x3a6065(0x1ff)](_0x61487f/0x15180);return _0x5909b3?_0x28483e+_0x3a6065(0x200):_0x3a6065(0x20b)+_0x28483e+'d';}else return _0x424b80['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x204);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1bd);async[a35_0x42a9e2(0x197)](_0x580191){const _0x219cb3=a35_0x42a9e2,{options:_0x371666,args:_0x3c600c,tdx:_0x34f2a2}=_0x580191,_0x389f51=resolveLimit(_0x371666['limit'],DEFAULT_DISPLAY_LIMIT),_0xa7e1d=_0x3c600c[0x0],_0x4a15c6=_0xa7e1d?_0x219cb3(0x1a6)+_0xa7e1d+_0x219cb3(0x19f):_0x219cb3(0x1ad),_0x1b2f31=await withSpinner(_0x4a15c6,()=>_0x34f2a2['schedules'][_0x219cb3(0x1b6)]({'limit':_0x389f51,'scheduled':!![],'pattern':_0xa7e1d}),{'verbose':_0x371666[_0x219cb3(0x1c7)]}),_0x2100c2=_0x1b2f31['data'][_0x219cb3(0x1e6)],_0x573b5a=_0x1b2f31['data'][_0x219cb3(0x1b1)][_0x219cb3(0x191)],_0x3f7d62=_0xa7e1d?_0x219cb3(0x19b)+_0xa7e1d+'\x22':'';_0x573b5a?console[_0x219cb3(0x1a9)](_0x219cb3(0x192)+_0x2100c2[_0x219cb3(0x1a3)]+'\x20schedules'+_0x3f7d62+_0x219cb3(0x1a0)):console['error']('Found\x20'+_0x2100c2[_0x219cb3(0x1a3)]+_0x219cb3(0x1ed)+(_0x2100c2['length']!==0x1?'ies':'y')+_0x3f7d62);if(_0x371666[_0x219cb3(0x1f0)]==='json'||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x20d)||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x17f)||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x1fb)){const _0x2abab0=_0x2100c2[_0x219cb3(0x181)](_0x30f1e6=>({'id':_0x30f1e6['id'],'name':_0x30f1e6['name'],'cron':_0x30f1e6[_0x219cb3(0x1f9)],'database':_0x30f1e6['database']?.[_0x219cb3(0x1da)],'type':_0x30f1e6[_0x219cb3(0x1fc)],'timezone':_0x30f1e6[_0x219cb3(0x1c5)],'user_name':_0x30f1e6[_0x219cb3(0x1ea)]?.[_0x219cb3(0x1da)],'updated_at':_0x30f1e6[_0x219cb3(0x208)],'next_run_at':_0x30f1e6[_0x219cb3(0x1eb)],'last_job_status':_0x30f1e6[_0x219cb3(0x19e)]?.['status']}));await handleSDKOutput(_0x2abab0,_0x371666);}else{if(_0x2100c2['length']===0x0)console[_0x219cb3(0x1cf)](_0x219cb3(0x1af));else{const _0x5a55ce=_0x371666[_0x219cb3(0x1fe)],_0x4c83f8=_0x2100c2[_0x219cb3(0x181)](_0x4353e9=>{const _0x772057=_0x219cb3,_0x71da2b=_0x4353e9['last_job']?.[_0x772057(0x1c0)]?_0x4353e9[_0x772057(0x19e)][_0x772057(0x1c0)]==='success'?'β':'β':'-',_0x109983=_0x4353e9['last_job']?.[_0x772057(0x1b7)]?formatRelativeTime(_0x4353e9['last_job']['ended_at']):_0x772057(0x1a8),_0x1c79db=_0x4353e9[_0x772057(0x1eb)]?formatRelativeTime(_0x4353e9[_0x772057(0x1eb)]):'-',_0x2b28c3=_0x4353e9[_0x772057(0x1f9)]||'',_0x2c3a0d=_0x4353e9[_0x772057(0x1da)]||_0x772057(0x1d9),_0x360231=getConsoleUrl(_0x5a55ce,_0x772057(0x180)+_0x4353e9['id']);return{'statusIcon':_0x71da2b,'lastRun':_0x109983,'nextRun':_0x1c79db,'cron':_0x2b28c3,'name':_0x2c3a0d,'queryUrl':_0x360231,'status':_0x4353e9['last_job']?.[_0x772057(0x1c0)]};}),_0x35b07b=Math[_0x219cb3(0x199)](..._0x4c83f8[_0x219cb3(0x181)](_0x37c5a2=>_0x37c5a2[_0x219cb3(0x19d)][_0x219cb3(0x1a3)])),_0x11960e=Math['max'](..._0x4c83f8['map'](_0x52e05f=>_0x52e05f[_0x219cb3(0x1b0)][_0x219cb3(0x1a3)])),_0x5d4c25=Math[_0x219cb3(0x199)](..._0x4c83f8[_0x219cb3(0x181)](_0x3a5b68=>_0x3a5b68[_0x219cb3(0x1f9)][_0x219cb3(0x1a3)])),_0x43d585=_0x4c83f8[_0x219cb3(0x181)](_0x5afe15=>{const _0xa9f241=_0x219cb3,_0x5c876e=_0x5afe15['status']===_0xa9f241(0x1a1)?a35_0x168a99['green'](_0x5afe15['statusIcon']):_0x5afe15['status']===_0xa9f241(0x1a9)?a35_0x168a99['red'](_0x5afe15[_0xa9f241(0x184)]):a35_0x168a99[_0xa9f241(0x1d8)](_0x5afe15[_0xa9f241(0x184)]),_0x36ff1d=_0x5afe15[_0xa9f241(0x19d)][_0xa9f241(0x1b9)](_0x35b07b),_0x2f300b=_0x5afe15[_0xa9f241(0x1b0)][_0xa9f241(0x1b9)](_0x11960e),_0x333ad6=_0x5afe15[_0xa9f241(0x1f9)]?a35_0x168a99[_0xa9f241(0x18a)](_0x5afe15[_0xa9f241(0x1f9)][_0xa9f241(0x1b9)](_0x5d4c25)):'\x20'[_0xa9f241(0x1d6)](_0x5d4c25),_0x4821a7=hyperlink(_0x5afe15[_0xa9f241(0x1da)],_0x5afe15[_0xa9f241(0x1b8)]);return _0xa9f241(0x195)+_0x5c876e+'\x20'+_0x36ff1d+'\x20\x20β\x20'+_0x2f300b+'\x20\x20'+_0x333ad6+'\x20\x20'+_0x4821a7;});await writeOutput(_0x43d585[_0x219cb3(0x1ac)]('\x0a'),_0x371666['output'],_0x219cb3(0x1e5));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x186);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1df);[a35_0x42a9e2(0x18b)](_0x51cf73){const _0x584023=a35_0x42a9e2,_0x1978fb=_0x51cf73[_0x584023(0x1c2)][0x0];if(!_0x1978fb)return _0x584023(0x1b2);return undefined;}async[a35_0x42a9e2(0x197)](_0x24ba04){const _0x3f2d57=a35_0x42a9e2,{options:_0x5ab8fb,args:_0xfbe77e,tdx:_0x28e1f6}=_0x24ba04,_0x1bef0d=_0xfbe77e[0x0],_0x58e008=await withSpinner(_0x3f2d57(0x18c),()=>_0x28e1f6[_0x3f2d57(0x1ae)][_0x3f2d57(0x19c)](_0x1bef0d),{'verbose':_0x5ab8fb[_0x3f2d57(0x1c7)]}),_0x2f63d2=_0x58e008[_0x3f2d57(0x1c4)],_0x2f735e={'name':_0x2f63d2[_0x3f2d57(0x1da)],'cron':_0x2f63d2['cron'],'database':_0x2f63d2[_0x3f2d57(0x189)],'type':_0x2f63d2[_0x3f2d57(0x1fc)],'timezone':_0x2f63d2[_0x3f2d57(0x1f5)],'user_name':_0x2f63d2[_0x3f2d57(0x1aa)],'created_at':_0x2f63d2[_0x3f2d57(0x1b5)],'engine_version':_0x2f63d2[_0x3f2d57(0x194)],'executing_user_id':_0x2f63d2[_0x3f2d57(0x187)],'query':_0x2f63d2[_0x3f2d57(0x1c9)],'delay':_0x2f63d2[_0x3f2d57(0x1a2)],'priority':_0x2f63d2[_0x3f2d57(0x193)],'retry_limit':_0x2f63d2[_0x3f2d57(0x1d1)],..._0x2f63d2[_0x3f2d57(0x1f4)]&&{'result':_0x2f63d2['result']}};return await handleSingleObjectOutput(_0x2f735e,_0x5ab8fb),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]='schedule:create';[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x18e);[a35_0x42a9e2(0x18b)](_0x153d1f){const _0x39127c=a35_0x42a9e2,_0x10e4bb=_0x153d1f[_0x39127c(0x1c2)][0x0];if(!_0x10e4bb)return _0x39127c(0x182);const _0x1d99b2=_0x153d1f['options'];if(!_0x1d99b2[_0x39127c(0x189)])return _0x39127c(0x1e0);return undefined;}async[a35_0x42a9e2(0x197)](_0x55b6f5){const _0x31c463=a35_0x42a9e2,{options:_0x393296,args:_0x44b3b3,tdx:_0x206d4f}=_0x55b6f5,_0xc521b9=_0x44b3b3[0x0],_0x43dcb6=_0x393296,_0x58873d=_0x43dcb6['database'],_0xc596a7=_0x43dcb6[_0x31c463(0x1d4)],_0x2c56cd=_0x43dcb6['type']||_0x31c463(0x1de);let _0x174d57;try{_0x174d57=readFileSync(_0xc596a7,_0x31c463(0x17e))[_0x31c463(0x203)]();}catch(_0x77ff2d){throw new SDKError(ErrorCode[_0x31c463(0x1f8)],_0x31c463(0x1d0)+_0xc596a7,_0x77ff2d instanceof Error?_0x77ff2d:undefined);}if(!_0x174d57)throw new SDKError(ErrorCode[_0x31c463(0x1f8)],'Query\x20file\x20is\x20empty');const _0x4cb0ef={'database':_0x58873d,'query':_0x174d57,'type':_0x2c56cd};if(_0x43dcb6['cron'])_0x4cb0ef[_0x31c463(0x1f9)]=_0x43dcb6['cron'];if(_0x43dcb6[_0x31c463(0x1f5)])_0x4cb0ef[_0x31c463(0x1f5)]=_0x43dcb6[_0x31c463(0x1f5)];if(_0x43dcb6[_0x31c463(0x1a2)]!==undefined)_0x4cb0ef[_0x31c463(0x1a2)]=Number(_0x43dcb6[_0x31c463(0x1a2)]);if(_0x43dcb6[_0x31c463(0x193)]!==undefined)_0x4cb0ef[_0x31c463(0x193)]=Number(_0x43dcb6[_0x31c463(0x193)]);if(_0x43dcb6[_0x31c463(0x1d3)]!==undefined)_0x4cb0ef[_0x31c463(0x1d1)]=Number(_0x43dcb6['retryLimit']);if(_0x43dcb6[_0x31c463(0x1bc)])_0x4cb0ef[_0x31c463(0x194)]=_0x43dcb6[_0x31c463(0x1bc)];if(_0x43dcb6[_0x31c463(0x1f4)])_0x4cb0ef['result']=_0x43dcb6[_0x31c463(0x1f4)];if(_0x393296[_0x31c463(0x1c7)]){console[_0x31c463(0x1a9)](_0x31c463(0x1dc)+_0xc521b9),console[_0x31c463(0x1a9)]('\x20\x20Database:\x20'+_0x58873d),console[_0x31c463(0x1a9)](_0x31c463(0x1d7)+_0x2c56cd);if(_0x4cb0ef[_0x31c463(0x1f9)])console[_0x31c463(0x1a9)](_0x31c463(0x1f1)+_0x4cb0ef[_0x31c463(0x1f9)]);if(_0x4cb0ef['timezone'])console[_0x31c463(0x1a9)](_0x31c463(0x17a)+_0x4cb0ef[_0x31c463(0x1f5)]);}const _0x23b7f8=await withSpinner(_0x31c463(0x202),()=>_0x206d4f[_0x31c463(0x1ae)][_0x31c463(0x205)](_0xc521b9,_0x4cb0ef),{'verbose':_0x393296[_0x31c463(0x1c7)]});return console[_0x31c463(0x1a9)]('Schedule\x20created:\x20'+_0x23b7f8[_0x31c463(0x1c4)]['name']),await handleSingleObjectOutput(_0x23b7f8[_0x31c463(0x1c4)],_0x393296),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a35_0x42a9e2(0x1b4);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1bb);[a35_0x42a9e2(0x18b)](_0x5cec79){const _0x1f617f=a35_0x42a9e2,_0x4c844b=_0x5cec79[_0x1f617f(0x1c2)][0x0];if(!_0x4c844b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a35_0x42a9e2(0x197)](_0x1a06c7){const _0x31efc3=a35_0x42a9e2,{options:_0x145cba,args:_0x328137,tdx:_0x1933e9}=_0x1a06c7,_0xbfc238=_0x328137[0x0],_0x4e0966=_0x145cba,_0x8156dd={};if(_0x4e0966[_0x31efc3(0x189)])_0x8156dd['database']=_0x4e0966['database'];if(_0x4e0966[_0x31efc3(0x1fc)])_0x8156dd[_0x31efc3(0x1fc)]=_0x4e0966[_0x31efc3(0x1fc)];if(_0x4e0966[_0x31efc3(0x1f9)])_0x8156dd[_0x31efc3(0x1f9)]=_0x4e0966[_0x31efc3(0x1f9)];if(_0x4e0966[_0x31efc3(0x1f5)])_0x8156dd[_0x31efc3(0x1f5)]=_0x4e0966[_0x31efc3(0x1f5)];if(_0x4e0966['delay']!==undefined)_0x8156dd[_0x31efc3(0x1a2)]=Number(_0x4e0966['delay']);if(_0x4e0966[_0x31efc3(0x193)]!==undefined)_0x8156dd['priority']=Number(_0x4e0966[_0x31efc3(0x193)]);if(_0x4e0966['retryLimit']!==undefined)_0x8156dd['retry_limit']=Number(_0x4e0966[_0x31efc3(0x1d3)]);if(_0x4e0966[_0x31efc3(0x1bc)])_0x8156dd[_0x31efc3(0x194)]=_0x4e0966[_0x31efc3(0x1bc)];if(_0x4e0966[_0x31efc3(0x1f4)])_0x8156dd['result']=_0x4e0966['result'];if(_0x4e0966[_0x31efc3(0x1d4)])try{_0x8156dd[_0x31efc3(0x1c9)]=readFileSync(_0x4e0966[_0x31efc3(0x1d4)],'utf-8')[_0x31efc3(0x203)]();}catch(_0x5e5ff4){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x4e0966['file'],_0x5e5ff4 instanceof Error?_0x5e5ff4:undefined);}if(Object[_0x31efc3(0x1c1)](_0x8156dd)['length']===0x0)throw new SDKError(ErrorCode[_0x31efc3(0x1f8)],_0x31efc3(0x198));if(_0x145cba[_0x31efc3(0x1c7)]){console[_0x31efc3(0x1a9)](_0x31efc3(0x209)+_0xbfc238);for(const [_0x4a1a2b,_0x575976]of Object[_0x31efc3(0x1d2)](_0x8156dd)){_0x4a1a2b===_0x31efc3(0x1c9)?console[_0x31efc3(0x1a9)]('\x20\x20'+_0x4a1a2b+':\x20'+_0x575976[_0x31efc3(0x1e9)](0x0,0x32)+_0x31efc3(0x17d)):console[_0x31efc3(0x1a9)]('\x20\x20'+_0x4a1a2b+':\x20'+_0x575976);}}const _0x370ffb=await withSpinner(_0x31efc3(0x1fd),()=>_0x1933e9[_0x31efc3(0x1ae)]['update'](_0xbfc238,_0x8156dd),{'verbose':_0x145cba[_0x31efc3(0x1c7)]});return console[_0x31efc3(0x1a9)](_0x31efc3(0x1c8)+_0x370ffb['data']['name']),await handleSingleObjectOutput(_0x370ffb[_0x31efc3(0x1c4)],_0x145cba),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';['description']=a35_0x42a9e2(0x1f7);['validate'](_0x2e8bb5){const _0x512f9d=a35_0x42a9e2,_0x457007=_0x2e8bb5[_0x512f9d(0x1c2)][0x0];if(!_0x457007)return _0x512f9d(0x1a4);return undefined;}async[a35_0x42a9e2(0x197)](_0x2cb90f){const _0x2cb4c0=a35_0x42a9e2,{options:_0x21af3c,args:_0x2d016e,tdx:_0x39cfc2}=_0x2cb90f,_0x1eb8f1=_0x2d016e[0x0];if(!_0x21af3c[_0x2cb4c0(0x1db)]){const _0x650fc2=await confirm(_0x2cb4c0(0x1ce)+_0x1eb8f1+'\x22?');if(!_0x650fc2)return console[_0x2cb4c0(0x1a9)](_0x2cb4c0(0x1e7)),0x0;}const _0x22c0e4=await withSpinner(_0x2cb4c0(0x19a),()=>_0x39cfc2[_0x2cb4c0(0x1ae)][_0x2cb4c0(0x1c3)](_0x1eb8f1),{'verbose':_0x21af3c[_0x2cb4c0(0x1c7)]});return console[_0x2cb4c0(0x1a9)](_0x2cb4c0(0x185)+_0x22c0e4[_0x2cb4c0(0x1c4)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x1ab);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x17b);[a35_0x42a9e2(0x18b)](_0x4e544c){const _0x4cc60f=a35_0x42a9e2,_0x221665=_0x4e544c[_0x4cc60f(0x1c2)][0x0];if(!_0x221665)return _0x4cc60f(0x1f3);return undefined;}async[a35_0x42a9e2(0x197)](_0x3e540e){const _0x3d9e54=a35_0x42a9e2,{options:_0x163bbf,args:_0x256275,tdx:_0x5cc04b}=_0x3e540e,_0x4a5936=_0x256275[0x0],_0x286477=_0x163bbf,_0x301ebf=_0x286477[_0x3d9e54(0x1ef)],_0x33a459=_0x286477[_0x3d9e54(0x20a)]!==undefined?Number(_0x286477[_0x3d9e54(0x20a)]):undefined;if(_0x163bbf[_0x3d9e54(0x1c7)]){console[_0x3d9e54(0x1a9)]('Running\x20schedule:\x20'+_0x4a5936);if(_0x301ebf)console[_0x3d9e54(0x1a9)](_0x3d9e54(0x183)+_0x301ebf);if(_0x33a459)console['error'](_0x3d9e54(0x1cd)+_0x33a459);}const _0x410b28=await withSpinner(_0x3d9e54(0x1c6),()=>_0x5cc04b[_0x3d9e54(0x1ae)]['run'](_0x4a5936,{'time':_0x301ebf,'num':_0x33a459}),{'verbose':_0x163bbf[_0x3d9e54(0x1c7)]}),_0x5dbb54=_0x410b28[_0x3d9e54(0x1c4)][_0x3d9e54(0x1ba)];console[_0x3d9e54(0x1a9)](_0x3d9e54(0x1e1)+_0x5dbb54[_0x3d9e54(0x1a3)]+_0x3d9e54(0x1d5)+(_0x5dbb54['length']!==0x1?'s':'')+_0x3d9e54(0x188));for(const _0x326d97 of _0x5dbb54){console[_0x3d9e54(0x1a9)]('\x20\x20Job\x20ID:\x20'+_0x326d97[_0x3d9e54(0x1e3)]);}return await handleSDKOutput(_0x5dbb54,_0x163bbf),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a35_0x42a9e2(0x1a7);[a35_0x42a9e2(0x190)]='Show\x20schedule\x20execution\x20history';[a35_0x42a9e2(0x18b)](_0x2de377){const _0x4d8628=a35_0x42a9e2,_0x277fab=_0x2de377[_0x4d8628(0x1c2)][0x0];if(!_0x277fab)return _0x4d8628(0x17c);return undefined;}async[a35_0x42a9e2(0x197)](_0x548329){const _0x42281f=a35_0x42a9e2,{options:_0x20ddca,args:_0x5b15d4,tdx:_0x4757c2}=_0x548329,_0x1496ad=_0x5b15d4[0x0],_0x228584=_0x20ddca,_0x19384f=_0x228584['from']!==undefined?Number(_0x228584['from']):undefined,_0x195064=_0x228584['to']!==undefined?Number(_0x228584['to']):undefined,_0x532856=await withSpinner('Getting\x20schedule\x20history...',()=>_0x4757c2['schedules']['history'](_0x1496ad,{'from':_0x19384f,'to':_0x195064}),{'verbose':_0x20ddca[_0x42281f(0x1c7)]}),_0x36895d=_0x532856['data'];console[_0x42281f(0x1a9)](_0x42281f(0x207)+_0x36895d[_0x42281f(0x1b3)]+_0x42281f(0x1a5)+(_0x36895d['count']!==0x1?'s':'')+'\x20(showing\x20'+_0x36895d[_0x42281f(0x1e8)]+'-'+_0x36895d['to']+')');const _0x2a0320=_0x36895d[_0x42281f(0x1fa)][_0x42281f(0x181)](_0x5b122f=>({'job_id':_0x5b122f[_0x42281f(0x1e3)],'type':_0x5b122f[_0x42281f(0x1fc)],'status':_0x5b122f[_0x42281f(0x1c0)],'scheduled_at':_0x5b122f[_0x42281f(0x201)],'created_at':_0x5b122f[_0x42281f(0x1b5)],'start_at':_0x5b122f[_0x42281f(0x1e4)],'end_at':_0x5b122f[_0x42281f(0x18f)]}));return await handleSDKOutput(_0x2a0320,_0x20ddca),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x46c5de=a36_0x5c2b;(function(_0x2d0b99,_0x201e34){const _0x40bea1=a36_0x5c2b,_0x4c146e=_0x2d0b99();while(!![]){try{const _0x1e7c4a=-parseInt(_0x40bea1(0xec))/0x1*(parseInt(_0x40bea1(0x14a))/0x2)+-parseInt(_0x40bea1(0x17e))/0x3+-parseInt(_0x40bea1(0xf6))/0x4*(-parseInt(_0x40bea1(0x10b))/0x5)+-parseInt(_0x40bea1(0x156))/0x6*(-parseInt(_0x40bea1(0xf7))/0x7)+-parseInt(_0x40bea1(0x135))/0x8+-parseInt(_0x40bea1(0x16f))/0x9*(-parseInt(_0x40bea1(0xf9))/0xa)+parseInt(_0x40bea1(0xf3))/0xb;if(_0x1e7c4a===_0x201e34)break;else _0x4c146e['push'](_0x4c146e['shift']());}catch(_0x5c35ae){_0x4c146e['push'](_0x4c146e['shift']());}}}(a36_0x48e4,0xe03f0));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';function a36_0x5c2b(_0x3b7cd4,_0x4f7d60){_0x3b7cd4=_0x3b7cd4-0xe9;const _0x48e448=a36_0x48e4();let _0x5c2b2e=_0x48e448[_0x3b7cd4];return _0x5c2b2e;}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a36_0x121f52 from'chalk';async function resolveSegmentTarget(_0x4e9bf4,_0x51af56,_0x1d5ebe){const _0x4dfc54=a36_0x5c2b;if(isYamlFilePath(_0x4e9bf4))try{const _0x96a490=await resolveYamlFilePath(_0x4e9bf4);return _0x1d5ebe&&(console[_0x4dfc54(0x15c)](_0x4dfc54(0x150)+_0x4e9bf4),console[_0x4dfc54(0x15c)](_0x4dfc54(0x17f)+_0x96a490[_0x4dfc54(0x13a)]),console['error'](_0x4dfc54(0x10a)+_0x96a490[_0x4dfc54(0x120)]),console['error'](_0x4dfc54(0x182)+(_0x96a490['folderPath']||'(root)')),console['error'](_0x4dfc54(0x127)+_0x96a490['fullPath'])),_0x96a490[_0x4dfc54(0x114)];}catch(_0x233160){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4dfc54(0x15e)+_0x233160['message']);}if(!_0x51af56)throw new SDKError(ErrorCode[_0x4dfc54(0x161)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x51af56+'/'+_0x4e9bf4;}export class SegmentDescribeCommand extends BaseCommand{[a36_0x46c5de(0x106)]=a36_0x46c5de(0x167);[a36_0x46c5de(0x147)]=a36_0x46c5de(0x151);async['execute'](_0x2d3a0e){const _0x370787=a36_0x46c5de,{options:_0x14f33b,args:_0x296079,tdx:_0x3689e4}=_0x2d3a0e,_0x149db1=_0x296079[0x0],_0xb7da31=!_0x149db1&&!!_0x14f33b[_0x370787(0x13a)],_0x18c62b=_0x149db1||_0x14f33b['parentSegment'];if(!_0x18c62b)return console[_0x370787(0x15c)](_0x370787(0x184)),console['error'](_0x370787(0x157)),console[_0x370787(0x15c)](_0x370787(0x10c)),console[_0x370787(0x15c)](_0x370787(0x105)),console[_0x370787(0x15c)](_0x370787(0xf2)),console[_0x370787(0x15c)](_0x370787(0x181)),console['error'](_0x370787(0x102)),0x1;try{const _0x4a6b11=_0x14f33b[_0x370787(0x133)];let _0x4bee54=_0x18c62b;!_0xb7da31&&_0x4a6b11&&!_0x18c62b[_0x370787(0x169)]('/')&&(_0x4bee54=_0x4a6b11+'/'+_0x18c62b,_0x14f33b[_0x370787(0x173)]&&console[_0x370787(0x15c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4bee54));const _0x5b595a=await withSpinner('Resolving\x20path\x20\x27'+_0x4bee54+'\x27...',()=>_0x3689e4[_0x370787(0x168)][_0x370787(0x10e)](_0x4bee54),{'verbose':_0x14f33b[_0x370787(0x173)]}),_0x1f70fb=_0x5b595a[_0x370787(0xfb)];_0x14f33b['verbose']&&(console[_0x370787(0x15c)](_0x370787(0x15d)+_0x1f70fb['type']),console[_0x370787(0x15c)](_0x370787(0x12d)+_0x1f70fb[_0x370787(0x160)]),_0x1f70fb[_0x370787(0x11d)]&&console[_0x370787(0x15c)](_0x370787(0x111)+_0x1f70fb['folderId']),_0x1f70fb[_0x370787(0x15f)]&&console[_0x370787(0x15c)]('Segment\x20ID:\x20'+_0x1f70fb[_0x370787(0x15f)]));if(_0x1f70fb[_0x370787(0x18a)]===_0x370787(0x153)){const _0x17447c=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x3689e4[_0x370787(0x168)]['getParent'](_0x1f70fb['parentId']),{'verbose':_0x14f33b['verbose']});await handleSingleObjectOutput(_0x17447c[_0x370787(0xfb)],_0x14f33b);}else{if(_0x1f70fb[_0x370787(0x18a)]===_0x370787(0x13b)){if(!_0x1f70fb[_0x370787(0x11d)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x370787(0xf8));const _0x3623e1=await withSpinner('Fetching\x20folder\x20details...',()=>_0x3689e4[_0x370787(0x168)][_0x370787(0x121)](_0x1f70fb[_0x370787(0x11d)]),{'verbose':_0x14f33b['verbose']});await handleSingleObjectOutput(_0x3623e1[_0x370787(0xfb)],_0x14f33b);}else{if(_0x1f70fb[_0x370787(0x18a)]===_0x370787(0x168)){if(!_0x1f70fb[_0x370787(0x15f)])throw new SDKError(ErrorCode[_0x370787(0xeb)],_0x370787(0x170));const _0x4651e1=await withSpinner('Fetching\x20segment\x20details...',()=>_0x3689e4[_0x370787(0x168)][_0x370787(0x136)](_0x1f70fb[_0x370787(0x160)],_0x1f70fb[_0x370787(0x15f)]),{'verbose':_0x14f33b['verbose']});await handleSingleObjectOutput(_0x4651e1[_0x370787(0xfb)],_0x14f33b);}}}return 0x0;}catch(_0x1f37d2){if(_0x1f37d2 instanceof SDKError)return console[_0x370787(0x15c)](_0x370787(0x16e)+_0x1f37d2[_0x370787(0x100)]),_0x1f37d2[_0x370787(0x11f)]&&console[_0x370787(0x15c)](_0x370787(0x158)+_0x1f37d2[_0x370787(0x11f)]),0x1;throw _0x1f37d2;}}}export class SegmentShowCommand extends BaseCommand{['name']=a36_0x46c5de(0x17c);['description']=a36_0x46c5de(0x188);async[a36_0x46c5de(0x119)](_0x520915){const _0x460a57=a36_0x46c5de,{options:_0x194183,args:_0x30ff50,tdx:_0x21d85c}=_0x520915,_0xd9eda2=_0x30ff50[0x0];if(!_0xd9eda2)return console[_0x460a57(0x15c)](_0x460a57(0x140)),console[_0x460a57(0x15c)](_0x460a57(0x143)),console[_0x460a57(0x15c)](_0x460a57(0x185)),console[_0x460a57(0x15c)](_0x460a57(0x10c)),console[_0x460a57(0x15c)](_0x460a57(0x162)),console[_0x460a57(0x15c)](_0x460a57(0x12c)),0x1;try{const _0x4df23e=_0x194183[_0x460a57(0x13a)],_0xee6351=await resolveSegmentTarget(_0xd9eda2,_0x4df23e,_0x194183[_0x460a57(0x173)]);_0x194183[_0x460a57(0x173)]&&console['error'](_0x460a57(0x14c)+_0xee6351);const _0x1000c1=await withSpinner('Resolving\x20\x27'+_0xd9eda2+_0x460a57(0xf0),()=>_0x21d85c['segment']['resolvePathToResource'](_0xee6351),{'verbose':_0x194183['verbose']}),_0x4a5413=_0x1000c1[_0x460a57(0xfb)];_0x194183[_0x460a57(0x173)]&&(console['error'](_0x460a57(0x15d)+_0x4a5413['type']),console[_0x460a57(0x15c)]('Parent\x20ID:\x20'+_0x4a5413[_0x460a57(0x160)]));if(_0x4a5413[_0x460a57(0x18a)]===_0x460a57(0x13b))return console[_0x460a57(0x15c)](_0x460a57(0x117)),console[_0x460a57(0x15c)](_0x460a57(0x113)),0x1;if(_0x4a5413[_0x460a57(0x18a)]===_0x460a57(0x153))return console[_0x460a57(0x15c)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x460a57(0x15c)](_0x460a57(0x118)),0x1;if(!_0x4a5413['segmentId'])throw new SDKError(ErrorCode[_0x460a57(0xeb)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2c1e29=await withSpinner(_0x460a57(0x13e),()=>_0x21d85c[_0x460a57(0x168)][_0x460a57(0x166)](_0x4a5413[_0x460a57(0x160)],_0x4a5413['segmentId']),{'verbose':_0x194183['verbose']});let _0x49c068=_0x2c1e29['data'];const _0x40b70a=resolveLimit(_0x194183['limit'],DEFAULT_DISPLAY_LIMIT),_0x1b1634=/\bLIMIT\s+\d+/i[_0x460a57(0x178)](_0x49c068);!_0x1b1634&&(_0x49c068=_0x49c068['trim']()[_0x460a57(0xfd)](/;+$/,''),_0x49c068=_0x460a57(0x12a)+_0x49c068+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x40b70a);_0x194183[_0x460a57(0x173)]&&console[_0x460a57(0x15c)](_0x460a57(0x149)+_0x49c068);const _0x4a37c4=await withProgressSpinner(_0x460a57(0x187),async _0x18fdc1=>{const _0x6f9136=_0x460a57,_0x549e88=await _0x21d85c[_0x6f9136(0x141)]['execute'](_0x49c068,{'catalog':'td','schema':_0x6f9136(0x144),'onJobId':_0x2f4ab1=>{_0x18fdc1['setJobId'](_0x2f4ab1);}});return _0x549e88;},{'verbose':_0x194183[_0x460a57(0x173)]}),_0x3f3ffc=_0x4a37c4[_0x460a57(0xfb)],_0x42d57d=_0x3f3ffc[_0x460a57(0xf1)]?_0x460a57(0x124)+_0x3f3ffc['jobId']+']':'';return console[_0x460a57(0x15c)](_0x460a57(0x18d)+_0x3f3ffc[_0x460a57(0x179)][_0x460a57(0x171)][_0x460a57(0x10d)]()+_0x460a57(0x123)+(_0x460a57(0xff)+formatElapsed(_0x3f3ffc[_0x460a57(0x179)][_0x460a57(0x134)])+_0x42d57d)),await handleQueryOutput(_0x3f3ffc,_0x194183),0x0;}catch(_0x3e4458){if(_0x3e4458 instanceof SDKError)return console[_0x460a57(0x15c)](_0x460a57(0x103)+_0x3e4458[_0x460a57(0x107)]+']'),console[_0x460a57(0x15c)]('\x0a'+_0x3e4458['message']),0x1;throw _0x3e4458;}}}export class SegmentFolderListCommand extends BaseCommand{[a36_0x46c5de(0x106)]=a36_0x46c5de(0x155);[a36_0x46c5de(0x147)]=a36_0x46c5de(0x142);async[a36_0x46c5de(0x119)](_0x568172){const _0x4f01b6=a36_0x46c5de,{options:_0x1e79c6,args:_0x2e414f,tdx:_0x134c4a}=_0x568172;if(_0x2e414f[_0x4f01b6(0xed)]===0x0)return console[_0x4f01b6(0x15c)](_0x4f01b6(0x15b)),console[_0x4f01b6(0x15c)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0xd1a4fd=_0x2e414f[0x0];try{_0x1e79c6[_0x4f01b6(0x173)]&&(console[_0x4f01b6(0x15c)]('Site:\x20'+_0x1e79c6[_0x4f01b6(0xe9)]),console[_0x4f01b6(0x15c)]('Parent\x20name:\x20'+_0xd1a4fd));const _0xbdbdcd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xd1a4fd+_0x4f01b6(0xf0),()=>_0x134c4a[_0x4f01b6(0x168)][_0x4f01b6(0xfe)](_0xd1a4fd),{'verbose':_0x1e79c6['verbose']}),_0x59cfc1=_0xbdbdcd['data'];_0x1e79c6[_0x4f01b6(0x173)]&&console[_0x4f01b6(0x15c)](_0x4f01b6(0x13f)+_0x59cfc1);const _0x5d958f=await withSpinner(_0x4f01b6(0x12f)+_0xd1a4fd+_0x4f01b6(0xf0),()=>_0x134c4a['segment'][_0x4f01b6(0x152)](_0x59cfc1),{'verbose':_0x1e79c6['verbose']}),_0x19fd52=_0x5d958f['data'];return console[_0x4f01b6(0x15c)](_0x4f01b6(0x14e)+_0x19fd52['length']+_0x4f01b6(0x11e)+(_0x19fd52[_0x4f01b6(0xed)]!==0x1?'s':'')),await handleSDKOutput(_0x19fd52,_0x1e79c6),0x0;}catch(_0x52a8c8){if(_0x52a8c8 instanceof SDKError)return console[_0x4f01b6(0x15c)]('Error:\x20'+_0x52a8c8[_0x4f01b6(0x100)]),_0x52a8c8[_0x4f01b6(0x11f)]&&console['error'](_0x4f01b6(0x158)+_0x52a8c8[_0x4f01b6(0x11f)]),0x1;throw _0x52a8c8;}}}function a36_0x48e4(){const _0x103399=['length','red','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x27...','jobId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','18180151FYvUuv','Usage:','resolveFolderId','2157256lAITDx','14rlLbEV','Folder\x20ID\x20missing\x20from\x20resolved\x20path','810lQgrGW','Use:\x20tdx\x20ps\x20desc','data','Error:\x20Folder\x20reference\x20is\x20required','replace','resolveParentId','in\x20','message','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','β\x20Query\x20failed\x20[','parentFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','name','code','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20Segment\x20name:\x20','5LQIgZK','Examples:','toLocaleString','resolvePathToResource','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','json','Folder\x20ID:\x20','getSegmentSQLFromYaml','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','fullPath','jsonl','Get\x20SQL\x20query\x20for\x20child\x20segment','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20show','execute','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Parent\x20segment:\x20','folderId','\x20folder','cause','segmentName','getFolder','cyan','\x20rows\x20','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Full\x20path:\x20','Fetching\x20folder\x20details...','web','SELECT\x20*\x20FROM\x20(\x0a','Folder\x20name:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Parent\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Segment\x20ID:\x20','segmentPath','elapsedTimeMillis','5524120KIkuZq','getSegment','Creating\x20folder\x20\x27','log','Resolving\x20\x27','parentSegment','folder','SEGMENT_FOLDER_NOT_FOUND','Show\x20child\x20segment\x20schema\x20(column\x20types)','Fetching\x20SQL\x20for\x20segment...','Resolved\x20parent\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','query','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Usage:\x20tdx\x20sg\x20show\x20<name>','information_schema','\x20\x20tdx\x20sg\x20sql\x20--path\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','SQL\x20query:\x0a','4TTBmzc','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Target\x20path:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','β\x20Found\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Resolved\x20YAML\x20file:\x20','Show\x20segment\x20or\x20folder\x20details','listFolders','parent','url','segment:folder:list','3354906dZbYyA','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20Cause:\x20','Fetching\x20segment\x20details...','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','Resolved\x20type:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segmentId','parentId','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','segment:folder:show','Resolving\x20parent\x20segment\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','getSegmentSQL','segment:describe','segment','includes','/e/','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20','160767bcdykx','Segment\x20ID\x20missing\x20from\x20resolved\x20path','processedRows','Fetching\x20folder\x20\x27','verbose','Fetching\x20SQL\x20from\x20rule...','getSQLFromServerSegment','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','test','stats','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','format','segment:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','4060101RvcIdv','\x20\x20Parent\x20segment:\x20','/app/ps/','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20Folder\x20path:\x20','Options:','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','green','Executing\x20segment\x20query...','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Create\x20segment\x20folder\x20for\x20organization','type','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','segment:view','β\x20Query\x20completed:\x20Processed\x20','site','content','SEGMENT_NOT_FOUND','897433ggeAGy'];a36_0x48e4=function(){return _0x103399;};return a36_0x48e4();}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x46c5de(0x106)]=a36_0x46c5de(0x163);[a36_0x46c5de(0x147)]='Show\x20segment\x20folder\x20details';async[a36_0x46c5de(0x119)](_0x22dcce){const _0x48e483=a36_0x46c5de,{options:_0x5b8dbd,args:_0x1bdea3,tdx:_0x166c8b}=_0x22dcce;if(_0x1bdea3[_0x48e483(0xed)]===0x0)return console[_0x48e483(0x15c)](_0x48e483(0xfc)),console['error'](_0x48e483(0x125)),0x1;try{const {parentId:_0x4ca25e,childId:_0x2d040d}=parseSegmentRef(_0x1bdea3[0x0]);_0x5b8dbd['verbose']&&(console[_0x48e483(0x15c)]('Site:\x20'+_0x5b8dbd['site']),console[_0x48e483(0x15c)]('Parent\x20name:\x20'+_0x4ca25e),_0x2d040d&&console[_0x48e483(0x15c)]('Folder\x20name:\x20'+_0x2d040d));if(!_0x2d040d)return console[_0x48e483(0x15c)](_0x48e483(0x12e)),0x1;const _0x245bd2=await withSpinner(_0x48e483(0x164)+_0x4ca25e+'\x27...',()=>_0x166c8b[_0x48e483(0x168)][_0x48e483(0xfe)](_0x4ca25e),{'verbose':_0x5b8dbd[_0x48e483(0x173)]}),_0x578e8c=_0x245bd2[_0x48e483(0xfb)];_0x5b8dbd[_0x48e483(0x173)]&&console[_0x48e483(0x15c)](_0x48e483(0x13f)+_0x578e8c);const _0x5cd747=await withSpinner(_0x48e483(0x108)+_0x2d040d+_0x48e483(0xf0),()=>_0x166c8b['segment'][_0x48e483(0xf5)](_0x578e8c,_0x2d040d),{'verbose':_0x5b8dbd[_0x48e483(0x173)]}),_0x243170=_0x5cd747['data'];_0x5b8dbd[_0x48e483(0x173)]&&console['error'](_0x48e483(0x176)+_0x243170);const _0x5d153d=await withSpinner(_0x48e483(0x172)+_0x2d040d+_0x48e483(0xf0),()=>_0x166c8b['segment']['getFolder'](_0x243170),{'verbose':_0x5b8dbd[_0x48e483(0x173)]});return await handleSDKOutput([_0x5d153d[_0x48e483(0xfb)]],_0x5b8dbd),0x0;}catch(_0x206917){if(_0x206917 instanceof SDKError)return console[_0x48e483(0x15c)](_0x48e483(0x16e)+_0x206917[_0x48e483(0x100)]),_0x206917['cause']&&console[_0x48e483(0x15c)](_0x48e483(0x158)+_0x206917[_0x48e483(0x11f)]),0x1;throw _0x206917;}}}export class SegmentSQLCommand extends BaseCommand{[a36_0x46c5de(0x106)]='segment:sql';[a36_0x46c5de(0x147)]=a36_0x46c5de(0x116);async[a36_0x46c5de(0x119)](_0x700a7c){const _0x52821a=a36_0x46c5de,{options:_0x4bafe0,args:_0x53a752}=_0x700a7c,_0x340102=_0x4bafe0,_0x4f8c80=_0x340102['path'],_0x4e667e=_0x53a752[0x0];if(!_0x4e667e&&!_0x4f8c80)return console[_0x52821a(0x15c)](a36_0x121f52[_0x52821a(0xee)](_0x52821a(0x18b))),console[_0x52821a(0x15c)](_0x52821a(0xf4)),console[_0x52821a(0x15c)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console['error']('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0x52821a(0x15c)](_0x52821a(0x10c)),console['error'](_0x52821a(0x10f)),console['error'](_0x52821a(0x177)),0x1;if(_0x4e667e&&_0x4f8c80)return console[_0x52821a(0x15c)](a36_0x121f52[_0x52821a(0xee)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x4f16b5;if(_0x4f8c80)_0x4f16b5=await this['getSQLFromYamlFile'](_0x4f8c80,_0x700a7c);else{if(isYamlFilePath(_0x4e667e))return console[_0x52821a(0x15c)](a36_0x121f52['red']('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x52821a(0x15c)](_0x52821a(0x145)+_0x4e667e),0x1;else _0x4f16b5=await this[_0x52821a(0x175)](_0x4e667e,_0x700a7c);}return _0x4bafe0[_0x52821a(0x17b)]===_0x52821a(0x110)||_0x4bafe0[_0x52821a(0x17b)]===_0x52821a(0x115)?await handleSDKOutput([{'sql':_0x4f16b5}],_0x4bafe0):console[_0x52821a(0x138)](_0x4f16b5),0x0;}catch(_0x5aaf37){if(_0x5aaf37 instanceof SDKError)return console[_0x52821a(0x15c)](_0x52821a(0x16e)+_0x5aaf37[_0x52821a(0x100)]),_0x5aaf37[_0x52821a(0x11f)]&&console[_0x52821a(0x15c)](_0x52821a(0x158)+_0x5aaf37[_0x52821a(0x11f)]),0x1;throw _0x5aaf37;}}async['getSQLFromYamlFile'](_0x3d90eb,_0x588d45){const _0x3981a5=a36_0x46c5de,{options:_0x427bc6,tdx:_0x4dc3a0}=_0x588d45;let _0x2991d7;try{_0x2991d7=await resolveYamlFilePath(_0x3d90eb);}catch(_0x4ec608){throw new SDKError(ErrorCode[_0x3981a5(0x161)],_0x3981a5(0x15e)+_0x4ec608[_0x3981a5(0x100)]);}_0x427bc6[_0x3981a5(0x173)]&&console[_0x3981a5(0x15c)]('Resolved:\x20'+_0x2991d7[_0x3981a5(0x13a)]+'/'+_0x2991d7[_0x3981a5(0x120)]);const _0x423225=await withSpinner(_0x3981a5(0x174),()=>_0x4dc3a0[_0x3981a5(0x168)][_0x3981a5(0x112)](_0x2991d7[_0x3981a5(0xea)],_0x2991d7['parentSegment'],_0x2991d7[_0x3981a5(0x120)]),{'verbose':_0x427bc6[_0x3981a5(0x173)]});return _0x423225[_0x3981a5(0xfb)];}async[a36_0x46c5de(0x175)](_0x3ac0e1,_0x10bb31){const _0x11e4d5=a36_0x46c5de,{options:_0x4f27be,tdx:_0x28b11a}=_0x10bb31,_0x5a0154=_0x4f27be[_0x11e4d5(0x13a)],_0x4b492e=await resolveSegmentTarget(_0x3ac0e1,_0x5a0154,_0x4f27be[_0x11e4d5(0x173)]);_0x4f27be['verbose']&&console[_0x11e4d5(0x15c)]('Target\x20path:\x20'+_0x4b492e);const _0x546f98=await withSpinner('Resolving\x20\x27'+_0x3ac0e1+_0x11e4d5(0xf0),()=>_0x28b11a['segment'][_0x11e4d5(0x10e)](_0x4b492e),{'verbose':_0x4f27be[_0x11e4d5(0x173)]}),_0x4ab017=_0x546f98[_0x11e4d5(0xfb)];_0x4f27be[_0x11e4d5(0x173)]&&(console['error'](_0x11e4d5(0x15d)+_0x4ab017['type']),console[_0x11e4d5(0x15c)](_0x11e4d5(0x12d)+_0x4ab017['parentId']));if(_0x4ab017[_0x11e4d5(0x18a)]==='folder')throw new SDKError(ErrorCode[_0x11e4d5(0x161)],_0x11e4d5(0x126));if(_0x4ab017[_0x11e4d5(0x18a)]===_0x11e4d5(0x153))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x11e4d5(0x15a));if(!_0x4ab017[_0x11e4d5(0x15f)])throw new SDKError(ErrorCode[_0x11e4d5(0xeb)],_0x11e4d5(0x170));const _0xb77d1e=await withSpinner(_0x11e4d5(0x13e),()=>_0x28b11a['segment']['getSegmentSQL'](_0x4ab017[_0x11e4d5(0x160)],_0x4ab017[_0x11e4d5(0x15f)]),{'verbose':_0x4f27be[_0x11e4d5(0x173)]});return _0xb77d1e[_0x11e4d5(0xfb)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a36_0x46c5de(0x106)]='segment:folder:create';['description']=a36_0x46c5de(0x189);async[a36_0x46c5de(0x119)](_0x240806){const _0xc41747=a36_0x46c5de,{options:_0x42ab0f,args:_0x3d6107,tdx:_0x26b562}=_0x240806,_0x589754=_0x42ab0f;if(_0x3d6107[_0xc41747(0xed)]<0x2)return console[_0xc41747(0x15c)](_0xc41747(0x16d)),console[_0xc41747(0x15c)](_0xc41747(0x109)),0x1;const _0x2acd0b=_0x3d6107[0x0],_0x201697=_0x3d6107[0x1];_0x589754[_0xc41747(0x173)]&&(console[_0xc41747(0x15c)]('Site:\x20'+_0x589754[_0xc41747(0xe9)]),console[_0xc41747(0x15c)](_0xc41747(0x11c)+_0x2acd0b),console['error'](_0xc41747(0x12b)+_0x201697));let _0x53c29d;if(_0x589754[_0xc41747(0x104)]){const _0x2e6650=_0x589754['parentFolder'],_0x32bb5b=await withSpinner(_0xc41747(0x164)+_0x2acd0b+_0xc41747(0xf0),()=>_0x26b562[_0xc41747(0x168)][_0xc41747(0xfe)](_0x2acd0b),{'verbose':_0x589754[_0xc41747(0x173)]}),_0x496825=_0x32bb5b[_0xc41747(0xfb)],_0x445bba=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x2e6650+_0xc41747(0xf0),()=>_0x26b562[_0xc41747(0x168)][_0xc41747(0xf5)](_0x496825,_0x2e6650),{'verbose':_0x589754['verbose']});_0x53c29d=_0x445bba[_0xc41747(0xfb)],_0x589754['verbose']&&console[_0xc41747(0x15c)](_0xc41747(0x165)+_0x53c29d);}const _0x231670={'name':_0x201697,'description':_0x589754[_0xc41747(0x147)],'parentFolderId':_0x53c29d},_0x35788d=await withSpinner(_0xc41747(0x137)+_0x201697+'\x27...',()=>_0x26b562[_0xc41747(0x168)]['createFolder'](_0x2acd0b,_0x231670),{'verbose':_0x589754[_0xc41747(0x173)]}),_0x4d6e86=_0x35788d[_0xc41747(0xfb)];return console['error']('β\x20Created\x20folder\x20\x27'+_0x4d6e86[_0xc41747(0x106)]+'\x27\x20with\x20ID:\x20'+_0x4d6e86['id']),await handleSDKOutput([_0x4d6e86],_0x589754),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0x46c5de(0x106)]=a36_0x46c5de(0x18c);[a36_0x46c5de(0x147)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a36_0x46c5de(0x119)](_0x395b86){const _0x11a637=a36_0x46c5de,{options:_0x1131a6,args:_0x3fb3c9,tdx:_0x448024}=_0x395b86,_0x7bad56=_0x3fb3c9[0x0];if(!_0x7bad56)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x11a637(0x15c)](_0x11a637(0x16b)),console[_0x11a637(0x15c)](_0x11a637(0x17d)),console['error'](_0x11a637(0x183)),console['error'](_0x11a637(0x11b)),console['error'](_0x11a637(0x10c)),console[_0x11a637(0x15c)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x11a637(0x15c)](_0x11a637(0x146)),console[_0x11a637(0x15c)](_0x11a637(0x11a)),console[_0x11a637(0x15c)](_0x11a637(0x16c)),0x1;try{const _0x8e2e0c=_0x1131a6[_0x11a637(0x13a)],_0x4d2244=await resolveSegmentTarget(_0x7bad56,_0x8e2e0c,_0x1131a6[_0x11a637(0x173)]);_0x1131a6[_0x11a637(0x173)]&&console[_0x11a637(0x15c)]('Target\x20path:\x20'+_0x4d2244);const _0x35646e=await withSpinner(_0x11a637(0x139)+_0x7bad56+'\x27...',()=>_0x448024['segment'][_0x11a637(0x10e)](_0x4d2244),{'verbose':_0x1131a6[_0x11a637(0x173)]}),_0x2fc155=_0x35646e['data'];_0x1131a6[_0x11a637(0x173)]&&(console[_0x11a637(0x15c)]('Resolved\x20type:\x20'+_0x2fc155[_0x11a637(0x18a)]),console[_0x11a637(0x15c)](_0x11a637(0x12d)+_0x2fc155[_0x11a637(0x160)]),_0x2fc155[_0x11a637(0x11d)]&&console[_0x11a637(0x15c)]('Folder\x20ID:\x20'+_0x2fc155[_0x11a637(0x11d)]),_0x2fc155['segmentId']&&console['error'](_0x11a637(0x132)+_0x2fc155[_0x11a637(0x15f)]));if(_0x1131a6[_0x11a637(0x129)]){if(_0x2fc155[_0x11a637(0x18a)]===_0x11a637(0x13b))return console[_0x11a637(0x15c)](_0x11a637(0x14f)),0x1;if(_0x2fc155['type']===_0x11a637(0x153))return console[_0x11a637(0x15c)](_0x11a637(0xef)),console[_0x11a637(0x15c)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2fc155['segmentId'])throw new SDKError(ErrorCode[_0x11a637(0xeb)],_0x11a637(0x170));const _0x1657ae=getConsoleNextUrl(_0x1131a6[_0x11a637(0xe9)],_0x11a637(0x180)+_0x2fc155['parentId']+_0x11a637(0x16a)+_0x2fc155[_0x11a637(0x15f)]);return console[_0x11a637(0x15c)](a36_0x121f52[_0x11a637(0x186)]('β')+'\x20Opening\x20'+a36_0x121f52[_0x11a637(0x122)](_0x1657ae)),openBrowser(_0x1657ae),0x0;}if(_0x2fc155[_0x11a637(0x18a)]===_0x11a637(0x13b)){if(!_0x2fc155[_0x11a637(0x11d)])throw new SDKError(ErrorCode[_0x11a637(0x13c)],_0x11a637(0xf8));const _0x4d5289=await withSpinner(_0x11a637(0x128),()=>_0x448024[_0x11a637(0x168)][_0x11a637(0x121)](_0x2fc155[_0x11a637(0x11d)]),{'verbose':_0x1131a6['verbose']});await handleSingleObjectOutput(_0x4d5289[_0x11a637(0xfb)],_0x1131a6);}else{if(_0x2fc155[_0x11a637(0x18a)]==='segment'){if(!_0x2fc155['segmentId'])throw new SDKError(ErrorCode[_0x11a637(0xeb)],_0x11a637(0x170));const _0x25d0db=await withSpinner(_0x11a637(0x159),()=>_0x448024[_0x11a637(0x168)][_0x11a637(0x136)](_0x2fc155[_0x11a637(0x160)],_0x2fc155['segmentId']),{'verbose':_0x1131a6[_0x11a637(0x173)]}),_0x207bd3=getConsoleNextUrl(_0x1131a6[_0x11a637(0xe9)],_0x11a637(0x180)+_0x2fc155[_0x11a637(0x160)]+_0x11a637(0x16a)+_0x2fc155['segmentId']),_0x306a9c=_0x25d0db['data'];_0x306a9c[_0x11a637(0x154)]=_0x207bd3,await handleSingleObjectOutput(_0x306a9c,_0x1131a6);}else return console['error'](_0x11a637(0x14d)),console[_0x11a637(0x15c)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x20d79e){if(_0x20d79e instanceof SDKError)return console['error'](_0x11a637(0x16e)+_0x20d79e[_0x11a637(0x100)]),_0x20d79e['cause']&&console['error'](_0x11a637(0x158)+_0x20d79e[_0x11a637(0x11f)]),0x1;throw _0x20d79e;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a36_0x46c5de(0x106)]='segment:desc';[a36_0x46c5de(0x147)]=a36_0x46c5de(0x13d);async['execute'](_0x530f8f){const _0x1a0ebb=a36_0x46c5de,{options:_0x20f56f,args:_0x145f0b,tdx:_0x2253ca}=_0x530f8f,_0x232010=_0x145f0b[0x0];if(!_0x232010)return console[_0x1a0ebb(0x15c)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x1a0ebb(0x148)),console['error'](_0x1a0ebb(0x10c)),console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x130)),console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x131)),0x1;try{const _0x3da6b2=_0x20f56f['parentSegment'],_0x240627=await resolveSegmentTarget(_0x232010,_0x3da6b2,_0x20f56f[_0x1a0ebb(0x173)]);_0x20f56f['verbose']&&console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x14c)+_0x240627);const _0x1a7860=await withSpinner(_0x1a0ebb(0x139)+_0x232010+_0x1a0ebb(0xf0),()=>_0x2253ca[_0x1a0ebb(0x168)][_0x1a0ebb(0x10e)](_0x240627),{'verbose':_0x20f56f[_0x1a0ebb(0x173)]}),_0x24eb86=_0x1a7860[_0x1a0ebb(0xfb)];_0x20f56f[_0x1a0ebb(0x173)]&&(console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x15d)+_0x24eb86[_0x1a0ebb(0x18a)]),console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x12d)+_0x24eb86[_0x1a0ebb(0x160)]));if(_0x24eb86[_0x1a0ebb(0x18a)]==='folder')return console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x101)),console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x17a)),0x1;if(_0x24eb86[_0x1a0ebb(0x18a)]==='parent')return console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x14b)),console[_0x1a0ebb(0x15c)](_0x1a0ebb(0xfa)),0x1;if(!_0x24eb86[_0x1a0ebb(0x15f)])throw new SDKError(ErrorCode[_0x1a0ebb(0xeb)],_0x1a0ebb(0x170));const _0x452ad5=await withSpinner(_0x1a0ebb(0x13e),()=>_0x2253ca[_0x1a0ebb(0x168)][_0x1a0ebb(0x166)](_0x24eb86[_0x1a0ebb(0x160)],_0x24eb86[_0x1a0ebb(0x15f)]),{'verbose':_0x20f56f[_0x1a0ebb(0x173)]}),_0x58759e=_0x452ad5[_0x1a0ebb(0xfb)],_0x321864=await executeSchemaQuery(_0x58759e,_0x2253ca,_0x20f56f);return await handleQueryOutput(_0x321864,_0x20f56f),0x0;}catch(_0x15af1a){if(_0x15af1a instanceof SDKError)return console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x16e)+_0x15af1a[_0x1a0ebb(0x100)]),_0x15af1a[_0x1a0ebb(0x11f)]&&console[_0x1a0ebb(0x15c)](_0x1a0ebb(0x158)+_0x15af1a[_0x1a0ebb(0x11f)]),0x1;throw _0x15af1a;}}}
|
|
1
|
+
const a36_0x2a13a5=a36_0x4310;(function(_0x5cc326,_0x1fe04b){const _0x2fde9c=a36_0x4310,_0x490bc7=_0x5cc326();while(!![]){try{const _0x345d22=-parseInt(_0x2fde9c(0x1df))/0x1+parseInt(_0x2fde9c(0x1b8))/0x2*(parseInt(_0x2fde9c(0x1cc))/0x3)+-parseInt(_0x2fde9c(0x1bb))/0x4*(parseInt(_0x2fde9c(0x1e3))/0x5)+-parseInt(_0x2fde9c(0x205))/0x6*(-parseInt(_0x2fde9c(0x1fd))/0x7)+parseInt(_0x2fde9c(0x230))/0x8+parseInt(_0x2fde9c(0x23a))/0x9*(-parseInt(_0x2fde9c(0x255))/0xa)+-parseInt(_0x2fde9c(0x1b0))/0xb*(-parseInt(_0x2fde9c(0x20f))/0xc);if(_0x345d22===_0x1fe04b)break;else _0x490bc7['push'](_0x490bc7['shift']());}catch(_0x54290b){_0x490bc7['push'](_0x490bc7['shift']());}}}(a36_0xcee7,0x450aa));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';function a36_0xcee7(){const _0x205487=['url','getSegment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Creating\x20folder\x20\x27','cause','Create\x20segment\x20folder\x20for\x20organization','segment:sql','segmentId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','setJobId','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20segment:\x20','folderId','Site:\x20','SEGMENT_FOLDER_NOT_FOUND','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Get\x20SQL\x20query\x20for\x20child\x20segment','INVALID_ARGUMENT','resolveParentId','142856wkSEOR','green','Error:\x20Path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20Folder\x20path:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','parentFolder','66pvgujF','Resolving\x20path\x20\x27','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20SQL\x20from\x20rule...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','listFolders','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','parentId','log','1126392RRsoCW','resolveFolderId','\x27...','getSegmentSQL','Use:\x20tdx\x20ps\x20desc','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','folder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','jsonl','parentSegment','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','json','Use:\x20tdx\x20ps\x20view\x20-w','SEGMENT_NOT_FOUND','resolvePathToResource','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','execute','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','query','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Target\x20path:\x20','description','getSQLFromYamlFile','Parent\x20ID:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment:desc','fullPath','type','in\x20','3325936vjpFBm','jobId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Show\x20folder\x20or\x20child\x20segment\x20details','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20folder\x20\x27','Resolved\x20type:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','5013wyEAzq','/e/','\x20Opening\x20','/app/ps/','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','format','segment:folder:show','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','β\x20Query\x20failed\x20[','path','Error:\x20','Resolved\x20YAML\x20file:\x20','folderPath','parent','Show\x20segment\x20or\x20folder\x20details','test','\x20[Job\x20ID:\x20','Resolving\x20\x27','Folder\x20name:\x20','2390YkYVLR','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Examples:','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','red','replace','11kuOJQN','message','segmentName','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','stats','Folder\x20ID\x20missing\x20from\x20resolved\x20path','getSegmentSQLFromYaml','218ByIUaL','(root)','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','228nuzycj','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20for\x20segment...','getSQLFromServerSegment','Listing\x20folders\x20for\x20parent\x20\x27','getParent','createFolder','Parent\x20name:\x20','limit','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolved\x20parent\x20ID:\x20','segment','Resolved\x20folder\x20ID:\x20','Folder\x20ID:\x20','Fetching\x20folder\x20details...','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','9129phLClA','processedRows','elapsedTimeMillis','Options:','Error:\x20Folder\x20reference\x20is\x20required','web','\x20\x20Parent\x20segment:\x20','segmentPath','error','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20show','length','segment:show','\x20folder','site','data','SQL\x20query:\x0a','208401LXuxiO','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20sg\x20desc\x20<name>','name','38725OJQWPD','β\x20Query\x20completed:\x20Processed\x20','getFolder','Usage:','code'];a36_0xcee7=function(){return _0x205487;};return a36_0xcee7();}import a36_0x234e0a from'chalk';async function resolveSegmentTarget(_0x31e382,_0x259f6d,_0xf4afb6){const _0x102cbe=a36_0x4310;if(isYamlFilePath(_0x31e382))try{const _0x49b478=await resolveYamlFilePath(_0x31e382);return _0xf4afb6&&(console[_0x102cbe(0x1d4)](_0x102cbe(0x24d)+_0x31e382),console[_0x102cbe(0x1d4)](_0x102cbe(0x1d2)+_0x49b478[_0x102cbe(0x218)]),console[_0x102cbe(0x1d4)]('\x20\x20Segment\x20name:\x20'+_0x49b478[_0x102cbe(0x1b2)]),console['error'](_0x102cbe(0x202)+(_0x49b478[_0x102cbe(0x24e)]||_0x102cbe(0x1b9))),console[_0x102cbe(0x1d4)]('\x20\x20Full\x20path:\x20'+_0x49b478[_0x102cbe(0x22d)])),_0x49b478['fullPath'];}catch(_0x2278bc){throw new SDKError(ErrorCode[_0x102cbe(0x1fb)],_0x102cbe(0x21f)+_0x2278bc[_0x102cbe(0x1b1)]);}if(!_0x259f6d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x102cbe(0x236));return _0x259f6d+'/'+_0x31e382;}function a36_0x4310(_0x536513,_0x56d715){_0x536513=_0x536513-0x1a7;const _0xcee7ad=a36_0xcee7();let _0x4310b5=_0xcee7ad[_0x536513];return _0x4310b5;}export class SegmentDescribeCommand extends BaseCommand{['name']='segment:describe';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x250);async[a36_0x2a13a5(0x220)](_0x335595){const _0x11151a=a36_0x2a13a5,{options:_0x11442d,args:_0x2288f2,tdx:_0x5713b6}=_0x335595,_0x1fbb22=_0x2288f2[0x0],_0x3a74d9=!_0x1fbb22&&!!_0x11442d['parentSegment'],_0x5dbe10=_0x1fbb22||_0x11442d[_0x11151a(0x218)];if(!_0x5dbe10)return console[_0x11151a(0x1d4)](_0x11151a(0x1ff)),console[_0x11151a(0x1d4)](_0x11151a(0x1aa)),console['error'](_0x11151a(0x1a9)),console[_0x11151a(0x1d4)](_0x11151a(0x1ab)),console['error'](_0x11151a(0x208)),console[_0x11151a(0x1d4)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x11151a(0x1d4)](_0x11151a(0x1a7)),0x1;try{const _0x5df1cc=_0x11442d[_0x11151a(0x1d3)];let _0x447a94=_0x5dbe10;!_0x3a74d9&&_0x5df1cc&&!_0x5dbe10['includes']('/')&&(_0x447a94=_0x5df1cc+'/'+_0x5dbe10,_0x11442d[_0x11151a(0x1cb)]&&console[_0x11151a(0x1d4)](_0x11151a(0x1f8)+_0x447a94));const _0x90df0f=await withSpinner(_0x11151a(0x206)+_0x447a94+'\x27...',()=>_0x5713b6['segment'][_0x11151a(0x21e)](_0x447a94),{'verbose':_0x11442d[_0x11151a(0x1cb)]}),_0x9fcad4=_0x90df0f[_0x11151a(0x1dd)];_0x11442d[_0x11151a(0x1cb)]&&(console['error']('Resolved\x20type:\x20'+_0x9fcad4['type']),console['error'](_0x11151a(0x228)+_0x9fcad4[_0x11151a(0x20d)]),_0x9fcad4[_0x11151a(0x1f5)]&&console[_0x11151a(0x1d4)](_0x11151a(0x1c8)+_0x9fcad4[_0x11151a(0x1f5)]),_0x9fcad4[_0x11151a(0x1f0)]&&console[_0x11151a(0x1d4)]('Segment\x20ID:\x20'+_0x9fcad4[_0x11151a(0x1f0)]));if(_0x9fcad4['type']==='parent'){const _0x4d3b5b=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x5713b6['segment'][_0x11151a(0x1c0)](_0x9fcad4[_0x11151a(0x20d)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x4d3b5b[_0x11151a(0x1dd)],_0x11442d);}else{if(_0x9fcad4[_0x11151a(0x22e)]===_0x11151a(0x215)){if(!_0x9fcad4[_0x11151a(0x1f5)])throw new SDKError(ErrorCode[_0x11151a(0x1f7)],_0x11151a(0x1b6));const _0x157dea=await withSpinner(_0x11151a(0x1c9),()=>_0x5713b6[_0x11151a(0x1c6)][_0x11151a(0x1e5)](_0x9fcad4[_0x11151a(0x1f5)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x157dea[_0x11151a(0x1dd)],_0x11442d);}else{if(_0x9fcad4['type']===_0x11151a(0x1c6)){if(!_0x9fcad4[_0x11151a(0x1f0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x11151a(0x216));const _0x27de04=await withSpinner(_0x11151a(0x242),()=>_0x5713b6['segment'][_0x11151a(0x1e9)](_0x9fcad4[_0x11151a(0x20d)],_0x9fcad4[_0x11151a(0x1f0)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x27de04[_0x11151a(0x1dd)],_0x11442d);}}}return 0x0;}catch(_0x5847f5){if(_0x5847f5 instanceof SDKError)return console[_0x11151a(0x1d4)]('Error:\x20'+_0x5847f5[_0x11151a(0x1b1)]),_0x5847f5[_0x11151a(0x1ed)]&&console['error'](_0x11151a(0x22a)+_0x5847f5[_0x11151a(0x1ed)]),0x1;throw _0x5847f5;}}}export class SegmentShowCommand extends BaseCommand{['name']=a36_0x2a13a5(0x1da);[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1b3);async[a36_0x2a13a5(0x220)](_0x265dbe){const _0x1f62de=a36_0x2a13a5,{options:_0x544f29,args:_0x38540d,tdx:_0x114974}=_0x265dbe,_0x539a45=_0x38540d[0x0];if(!_0x539a45)return console[_0x1f62de(0x1d4)](_0x1f62de(0x1ac)),console[_0x1f62de(0x1d4)](_0x1f62de(0x203)),console[_0x1f62de(0x1d4)](_0x1f62de(0x246)),console[_0x1f62de(0x1d4)](_0x1f62de(0x1a9)),console['error'](_0x1f62de(0x1ad)),console[_0x1f62de(0x1d4)](_0x1f62de(0x224)),0x1;try{const _0x4cb7e0=_0x544f29['parentSegment'],_0x4c6163=await resolveSegmentTarget(_0x539a45,_0x4cb7e0,_0x544f29['verbose']);_0x544f29[_0x1f62de(0x1cb)]&&console[_0x1f62de(0x1d4)](_0x1f62de(0x225)+_0x4c6163);const _0x57fac2=await withSpinner('Resolving\x20\x27'+_0x539a45+_0x1f62de(0x211),()=>_0x114974['segment'][_0x1f62de(0x21e)](_0x4c6163),{'verbose':_0x544f29[_0x1f62de(0x1cb)]}),_0x32f0a0=_0x57fac2[_0x1f62de(0x1dd)];_0x544f29[_0x1f62de(0x1cb)]&&(console[_0x1f62de(0x1d4)](_0x1f62de(0x238)+_0x32f0a0['type']),console[_0x1f62de(0x1d4)](_0x1f62de(0x228)+_0x32f0a0[_0x1f62de(0x20d)]));if(_0x32f0a0['type']==='folder')return console[_0x1f62de(0x1d4)](_0x1f62de(0x245)),console[_0x1f62de(0x1d4)](_0x1f62de(0x1eb)),0x1;if(_0x32f0a0[_0x1f62de(0x22e)]===_0x1f62de(0x24f))return console[_0x1f62de(0x1d4)](_0x1f62de(0x1ea)),console['error'](_0x1f62de(0x1d8)),0x1;if(!_0x32f0a0[_0x1f62de(0x1f0)])throw new SDKError(ErrorCode[_0x1f62de(0x21d)],_0x1f62de(0x216));const _0x10296e=await withSpinner(_0x1f62de(0x1bd),()=>_0x114974[_0x1f62de(0x1c6)]['getSegmentSQL'](_0x32f0a0[_0x1f62de(0x20d)],_0x32f0a0[_0x1f62de(0x1f0)]),{'verbose':_0x544f29[_0x1f62de(0x1cb)]});let _0x14c116=_0x10296e['data'];const _0x5980c2=resolveLimit(_0x544f29[_0x1f62de(0x1c3)],DEFAULT_DISPLAY_LIMIT),_0x591df5=/\bLIMIT\s+\d+/i[_0x1f62de(0x251)](_0x14c116);!_0x591df5&&(_0x14c116=_0x14c116['trim']()[_0x1f62de(0x1af)](/;+$/,''),_0x14c116=_0x1f62de(0x1e0)+_0x14c116+_0x1f62de(0x1a8)+_0x5980c2);_0x544f29[_0x1f62de(0x1cb)]&&console[_0x1f62de(0x1d4)](_0x1f62de(0x1de)+_0x14c116);const _0x2f2c36=await withProgressSpinner(_0x1f62de(0x207),async _0x5e8c98=>{const _0x479d20=_0x1f62de,_0x4f78cd=await _0x114974[_0x479d20(0x222)][_0x479d20(0x220)](_0x14c116,{'catalog':'td','schema':_0x479d20(0x21a),'onJobId':_0x43d3bb=>{const _0x17c01b=_0x479d20;_0x5e8c98[_0x17c01b(0x1f2)](_0x43d3bb);}});return _0x4f78cd;},{'verbose':_0x544f29[_0x1f62de(0x1cb)]}),_0x133f14=_0x2f2c36[_0x1f62de(0x1dd)],_0x557f97=_0x133f14[_0x1f62de(0x231)]?_0x1f62de(0x252)+_0x133f14[_0x1f62de(0x231)]+']':'';return console[_0x1f62de(0x1d4)](_0x1f62de(0x1e4)+_0x133f14[_0x1f62de(0x1b5)][_0x1f62de(0x1cd)]['toLocaleString']()+'\x20rows\x20'+(_0x1f62de(0x22f)+formatElapsed(_0x133f14['stats'][_0x1f62de(0x1ce)])+_0x557f97)),await handleQueryOutput(_0x133f14,_0x544f29),0x0;}catch(_0x388594){if(_0x388594 instanceof SDKError)return console[_0x1f62de(0x1d4)](_0x1f62de(0x24a)+_0x388594[_0x1f62de(0x1e7)]+']'),console[_0x1f62de(0x1d4)]('\x0a'+_0x388594[_0x1f62de(0x1b1)]),0x1;throw _0x388594;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a36_0x2a13a5(0x226)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a36_0x2a13a5(0x220)](_0x2bb614){const _0x39667a=a36_0x2a13a5,{options:_0x38f6db,args:_0x2a666f,tdx:_0x2a235c}=_0x2bb614;if(_0x2a666f[_0x39667a(0x1d9)]===0x0)return console[_0x39667a(0x1d4)](_0x39667a(0x1ca)),console['error'](_0x39667a(0x221)),0x1;const _0x372c4b=_0x2a666f[0x0];try{_0x38f6db[_0x39667a(0x1cb)]&&(console[_0x39667a(0x1d4)](_0x39667a(0x1f6)+_0x38f6db[_0x39667a(0x1dc)]),console[_0x39667a(0x1d4)](_0x39667a(0x1c2)+_0x372c4b));const _0x1aeeeb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x372c4b+_0x39667a(0x211),()=>_0x2a235c['segment'][_0x39667a(0x1fc)](_0x372c4b),{'verbose':_0x38f6db[_0x39667a(0x1cb)]}),_0x5c5ea8=_0x1aeeeb[_0x39667a(0x1dd)];_0x38f6db[_0x39667a(0x1cb)]&&console[_0x39667a(0x1d4)](_0x39667a(0x1c5)+_0x5c5ea8);const _0xa2a001=await withSpinner(_0x39667a(0x1bf)+_0x372c4b+_0x39667a(0x211),()=>_0x2a235c[_0x39667a(0x1c6)][_0x39667a(0x20b)](_0x5c5ea8),{'verbose':_0x38f6db[_0x39667a(0x1cb)]}),_0x393347=_0xa2a001[_0x39667a(0x1dd)];return console[_0x39667a(0x1d4)]('β\x20Found\x20'+_0x393347[_0x39667a(0x1d9)]+_0x39667a(0x1db)+(_0x393347[_0x39667a(0x1d9)]!==0x1?'s':'')),await handleSDKOutput(_0x393347,_0x38f6db),0x0;}catch(_0x39803f){if(_0x39803f instanceof SDKError)return console[_0x39667a(0x1d4)](_0x39667a(0x24c)+_0x39803f[_0x39667a(0x1b1)]),_0x39803f[_0x39667a(0x1ed)]&&console[_0x39667a(0x1d4)](_0x39667a(0x22a)+_0x39803f[_0x39667a(0x1ed)]),0x1;throw _0x39803f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x2a13a5(0x1e2)]=a36_0x2a13a5(0x248);[a36_0x2a13a5(0x226)]='Show\x20segment\x20folder\x20details';async[a36_0x2a13a5(0x220)](_0x34ae0d){const _0x508bcf=a36_0x2a13a5,{options:_0x9884f3,args:_0x52e413,tdx:_0x4fd324}=_0x34ae0d;if(_0x52e413[_0x508bcf(0x1d9)]===0x0)return console[_0x508bcf(0x1d4)](_0x508bcf(0x1d0)),console['error'](_0x508bcf(0x234)),0x1;try{const {parentId:_0x10f0a4,childId:_0x126e2a}=parseSegmentRef(_0x52e413[0x0]);_0x9884f3[_0x508bcf(0x1cb)]&&(console[_0x508bcf(0x1d4)](_0x508bcf(0x1f6)+_0x9884f3['site']),console[_0x508bcf(0x1d4)](_0x508bcf(0x1c2)+_0x10f0a4),_0x126e2a&&console[_0x508bcf(0x1d4)](_0x508bcf(0x254)+_0x126e2a));if(!_0x126e2a)return console[_0x508bcf(0x1d4)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x37a8c0=await withSpinner(_0x508bcf(0x244)+_0x10f0a4+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x1fc)](_0x10f0a4),{'verbose':_0x9884f3[_0x508bcf(0x1cb)]}),_0x201974=_0x37a8c0[_0x508bcf(0x1dd)];_0x9884f3['verbose']&&console[_0x508bcf(0x1d4)](_0x508bcf(0x1c5)+_0x201974);const _0x48c09d=await withSpinner(_0x508bcf(0x237)+_0x126e2a+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x210)](_0x201974,_0x126e2a),{'verbose':_0x9884f3['verbose']}),_0x382f9a=_0x48c09d[_0x508bcf(0x1dd)];_0x9884f3[_0x508bcf(0x1cb)]&&console[_0x508bcf(0x1d4)](_0x508bcf(0x1c7)+_0x382f9a);const _0x525818=await withSpinner('Fetching\x20folder\x20\x27'+_0x126e2a+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x1e5)](_0x382f9a),{'verbose':_0x9884f3[_0x508bcf(0x1cb)]});return await handleSDKOutput([_0x525818[_0x508bcf(0x1dd)]],_0x9884f3),0x0;}catch(_0x8de2a7){if(_0x8de2a7 instanceof SDKError)return console[_0x508bcf(0x1d4)]('Error:\x20'+_0x8de2a7[_0x508bcf(0x1b1)]),_0x8de2a7[_0x508bcf(0x1ed)]&&console[_0x508bcf(0x1d4)](_0x508bcf(0x22a)+_0x8de2a7[_0x508bcf(0x1ed)]),0x1;throw _0x8de2a7;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a36_0x2a13a5(0x1ef);[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1fa);async['execute'](_0x109ca7){const _0x1a175d=a36_0x2a13a5,{options:_0x3b3f6,args:_0x37a6ae}=_0x109ca7,_0x3a06c5=_0x3b3f6,_0x18755b=_0x3a06c5[_0x1a175d(0x24b)],_0x29b792=_0x37a6ae[0x0];if(!_0x29b792&&!_0x18755b)return console[_0x1a175d(0x1d4)](a36_0x234e0a[_0x1a175d(0x1ae)](_0x1a175d(0x20c))),console[_0x1a175d(0x1d4)](_0x1a175d(0x1e6)),console[_0x1a175d(0x1d4)](_0x1a175d(0x1f3)),console[_0x1a175d(0x1d4)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console['error']('Examples:'),console['error'](_0x1a175d(0x22b)),console[_0x1a175d(0x1d4)](_0x1a175d(0x1bc)),0x1;if(_0x29b792&&_0x18755b)return console[_0x1a175d(0x1d4)](a36_0x234e0a['red'](_0x1a175d(0x229))),0x1;try{let _0x5eaf9;if(_0x18755b)_0x5eaf9=await this[_0x1a175d(0x227)](_0x18755b,_0x109ca7);else{if(isYamlFilePath(_0x29b792))return console[_0x1a175d(0x1d4)](a36_0x234e0a['red'](_0x1a175d(0x239))),console[_0x1a175d(0x1d4)](_0x1a175d(0x1c4)+_0x29b792),0x1;else _0x5eaf9=await this[_0x1a175d(0x1be)](_0x29b792,_0x109ca7);}return _0x3b3f6[_0x1a175d(0x247)]===_0x1a175d(0x21b)||_0x3b3f6['format']===_0x1a175d(0x217)?await handleSDKOutput([{'sql':_0x5eaf9}],_0x3b3f6):console[_0x1a175d(0x20e)](_0x5eaf9),0x0;}catch(_0x10e502){if(_0x10e502 instanceof SDKError)return console[_0x1a175d(0x1d4)](_0x1a175d(0x24c)+_0x10e502['message']),_0x10e502[_0x1a175d(0x1ed)]&&console[_0x1a175d(0x1d4)]('\x20\x20Cause:\x20'+_0x10e502[_0x1a175d(0x1ed)]),0x1;throw _0x10e502;}}async[a36_0x2a13a5(0x227)](_0xfa6f34,_0x5209a1){const _0x1edb5c=a36_0x2a13a5,{options:_0x304975,tdx:_0x1ed468}=_0x5209a1;let _0x5b2398;try{_0x5b2398=await resolveYamlFilePath(_0xfa6f34);}catch(_0x3a9f83){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1edb5c(0x21f)+_0x3a9f83[_0x1edb5c(0x1b1)]);}_0x304975['verbose']&&console[_0x1edb5c(0x1d4)]('Resolved:\x20'+_0x5b2398[_0x1edb5c(0x218)]+'/'+_0x5b2398['segmentName']);const _0x533bb3=await withSpinner(_0x1edb5c(0x209),()=>_0x1ed468[_0x1edb5c(0x1c6)][_0x1edb5c(0x1b7)](_0x5b2398['content'],_0x5b2398[_0x1edb5c(0x218)],_0x5b2398[_0x1edb5c(0x1b2)]),{'verbose':_0x304975[_0x1edb5c(0x1cb)]});return _0x533bb3[_0x1edb5c(0x1dd)];}async[a36_0x2a13a5(0x1be)](_0x5eaceb,_0x36ff44){const _0x6f43f6=a36_0x2a13a5,{options:_0x159934,tdx:_0x14c6b9}=_0x36ff44,_0x37b80e=_0x159934[_0x6f43f6(0x218)],_0x22b4b3=await resolveSegmentTarget(_0x5eaceb,_0x37b80e,_0x159934['verbose']);_0x159934['verbose']&&console[_0x6f43f6(0x1d4)]('Target\x20path:\x20'+_0x22b4b3);const _0x9b4a98=await withSpinner(_0x6f43f6(0x253)+_0x5eaceb+_0x6f43f6(0x211),()=>_0x14c6b9[_0x6f43f6(0x1c6)][_0x6f43f6(0x21e)](_0x22b4b3),{'verbose':_0x159934[_0x6f43f6(0x1cb)]}),_0x16d460=_0x9b4a98['data'];_0x159934[_0x6f43f6(0x1cb)]&&(console[_0x6f43f6(0x1d4)](_0x6f43f6(0x238)+_0x16d460['type']),console[_0x6f43f6(0x1d4)](_0x6f43f6(0x228)+_0x16d460[_0x6f43f6(0x20d)]));if(_0x16d460[_0x6f43f6(0x22e)]==='folder')throw new SDKError(ErrorCode[_0x6f43f6(0x1fb)],_0x6f43f6(0x1ba));if(_0x16d460[_0x6f43f6(0x22e)]===_0x6f43f6(0x24f))throw new SDKError(ErrorCode[_0x6f43f6(0x1fb)],_0x6f43f6(0x249));if(!_0x16d460['segmentId'])throw new SDKError(ErrorCode[_0x6f43f6(0x21d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2be914=await withSpinner(_0x6f43f6(0x1bd),()=>_0x14c6b9[_0x6f43f6(0x1c6)]['getSegmentSQL'](_0x16d460['parentId'],_0x16d460[_0x6f43f6(0x1f0)]),{'verbose':_0x159934['verbose']});return _0x2be914[_0x6f43f6(0x1dd)];}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1ee);async[a36_0x2a13a5(0x220)](_0x2e27a6){const _0x240df1=a36_0x2a13a5,{options:_0x294fee,args:_0x3fd184,tdx:_0x40911f}=_0x2e27a6,_0x11eb45=_0x294fee;if(_0x3fd184['length']<0x2)return console[_0x240df1(0x1d4)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x240df1(0x1d6)),0x1;const _0x35798f=_0x3fd184[0x0],_0x5ce0cd=_0x3fd184[0x1];_0x11eb45[_0x240df1(0x1cb)]&&(console[_0x240df1(0x1d4)](_0x240df1(0x1f6)+_0x11eb45['site']),console[_0x240df1(0x1d4)](_0x240df1(0x1f4)+_0x35798f),console['error'](_0x240df1(0x254)+_0x5ce0cd));let _0x355283;if(_0x11eb45[_0x240df1(0x204)]){const _0xde6c3=_0x11eb45['parentFolder'],_0x105e6f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x35798f+'\x27...',()=>_0x40911f['segment'][_0x240df1(0x1fc)](_0x35798f),{'verbose':_0x11eb45['verbose']}),_0x3935ac=_0x105e6f[_0x240df1(0x1dd)],_0x1bd0ac=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0xde6c3+_0x240df1(0x211),()=>_0x40911f[_0x240df1(0x1c6)]['resolveFolderId'](_0x3935ac,_0xde6c3),{'verbose':_0x11eb45[_0x240df1(0x1cb)]});_0x355283=_0x1bd0ac['data'],_0x11eb45[_0x240df1(0x1cb)]&&console[_0x240df1(0x1d4)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x355283);}const _0x4b5fac={'name':_0x5ce0cd,'description':_0x11eb45[_0x240df1(0x226)],'parentFolderId':_0x355283},_0x153ae5=await withSpinner(_0x240df1(0x1ec)+_0x5ce0cd+_0x240df1(0x211),()=>_0x40911f['segment'][_0x240df1(0x1c1)](_0x35798f,_0x4b5fac),{'verbose':_0x11eb45[_0x240df1(0x1cb)]}),_0x38b7fb=_0x153ae5['data'];return console[_0x240df1(0x1d4)]('β\x20Created\x20folder\x20\x27'+_0x38b7fb[_0x240df1(0x1e2)]+_0x240df1(0x200)+_0x38b7fb['id']),await handleSDKOutput([_0x38b7fb],_0x11eb45),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0x2a13a5(0x1e2)]='segment:view';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x235);async[a36_0x2a13a5(0x220)](_0x12b69e){const _0x2e8ca3=a36_0x2a13a5,{options:_0x4c87b6,args:_0x1406a1,tdx:_0x1fcb54}=_0x12b69e,_0x3d6a9c=_0x1406a1[0x0];if(!_0x3d6a9c)return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x232)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1f9)),console[_0x2e8ca3(0x1d4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1cf)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1b4)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1a9)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x233)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x20a)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x23e)),console['error'](_0x2e8ca3(0x1f1)),0x1;try{const _0x42dcf6=_0x4c87b6[_0x2e8ca3(0x218)],_0x350a82=await resolveSegmentTarget(_0x3d6a9c,_0x42dcf6,_0x4c87b6[_0x2e8ca3(0x1cb)]);_0x4c87b6[_0x2e8ca3(0x1cb)]&&console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x225)+_0x350a82);const _0x498f55=await withSpinner(_0x2e8ca3(0x253)+_0x3d6a9c+_0x2e8ca3(0x211),()=>_0x1fcb54[_0x2e8ca3(0x1c6)][_0x2e8ca3(0x21e)](_0x350a82),{'verbose':_0x4c87b6[_0x2e8ca3(0x1cb)]}),_0x49aaf6=_0x498f55['data'];_0x4c87b6[_0x2e8ca3(0x1cb)]&&(console[_0x2e8ca3(0x1d4)]('Resolved\x20type:\x20'+_0x49aaf6[_0x2e8ca3(0x22e)]),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x228)+_0x49aaf6[_0x2e8ca3(0x20d)]),_0x49aaf6[_0x2e8ca3(0x1f5)]&&console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1c8)+_0x49aaf6['folderId']),_0x49aaf6[_0x2e8ca3(0x1f0)]&&console[_0x2e8ca3(0x1d4)]('Segment\x20ID:\x20'+_0x49aaf6['segmentId']));if(_0x4c87b6[_0x2e8ca3(0x1d1)]){if(_0x49aaf6[_0x2e8ca3(0x22e)]==='folder')return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1d7)),0x1;if(_0x49aaf6['type']===_0x2e8ca3(0x24f))return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1d5)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x21c)),0x1;if(!_0x49aaf6[_0x2e8ca3(0x1f0)])throw new SDKError(ErrorCode[_0x2e8ca3(0x21d)],_0x2e8ca3(0x216));const _0x1aa478=getConsoleNextUrl(_0x4c87b6[_0x2e8ca3(0x1dc)],_0x2e8ca3(0x23d)+_0x49aaf6[_0x2e8ca3(0x20d)]+_0x2e8ca3(0x23b)+_0x49aaf6[_0x2e8ca3(0x1f0)]);return console[_0x2e8ca3(0x1d4)](a36_0x234e0a[_0x2e8ca3(0x1fe)]('β')+_0x2e8ca3(0x23c)+a36_0x234e0a['cyan'](_0x1aa478)),openBrowser(_0x1aa478),0x0;}if(_0x49aaf6[_0x2e8ca3(0x22e)]==='folder'){if(!_0x49aaf6[_0x2e8ca3(0x1f5)])throw new SDKError(ErrorCode[_0x2e8ca3(0x1f7)],_0x2e8ca3(0x1b6));const _0xa56a9e=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1fcb54['segment'][_0x2e8ca3(0x1e5)](_0x49aaf6[_0x2e8ca3(0x1f5)]),{'verbose':_0x4c87b6[_0x2e8ca3(0x1cb)]});await handleSingleObjectOutput(_0xa56a9e[_0x2e8ca3(0x1dd)],_0x4c87b6);}else{if(_0x49aaf6[_0x2e8ca3(0x22e)]===_0x2e8ca3(0x1c6)){if(!_0x49aaf6[_0x2e8ca3(0x1f0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2e8ca3(0x216));const _0x55aa2c=await withSpinner(_0x2e8ca3(0x242),()=>_0x1fcb54[_0x2e8ca3(0x1c6)][_0x2e8ca3(0x1e9)](_0x49aaf6[_0x2e8ca3(0x20d)],_0x49aaf6[_0x2e8ca3(0x1f0)]),{'verbose':_0x4c87b6['verbose']}),_0x3eefee=getConsoleNextUrl(_0x4c87b6['site'],_0x2e8ca3(0x23d)+_0x49aaf6[_0x2e8ca3(0x20d)]+_0x2e8ca3(0x23b)+_0x49aaf6[_0x2e8ca3(0x1f0)]),_0x5973e6=_0x55aa2c[_0x2e8ca3(0x1dd)];_0x5973e6[_0x2e8ca3(0x1e8)]=_0x3eefee,await handleSingleObjectOutput(_0x5973e6,_0x4c87b6);}else return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x201)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x241)),0x1;}return 0x0;}catch(_0x455005){if(_0x455005 instanceof SDKError)return console[_0x2e8ca3(0x1d4)]('Error:\x20'+_0x455005['message']),_0x455005[_0x2e8ca3(0x1ed)]&&console[_0x2e8ca3(0x1d4)]('\x20\x20Cause:\x20'+_0x455005['cause']),0x1;throw _0x455005;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a36_0x2a13a5(0x22c);[a36_0x2a13a5(0x226)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a36_0x2a13a5(0x220)](_0x5005a7){const _0x329867=a36_0x2a13a5,{options:_0x306103,args:_0x5391b9,tdx:_0x5bab0c}=_0x5005a7,_0x3aff3d=_0x5391b9[0x0];if(!_0x3aff3d)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x329867(0x1d4)](_0x329867(0x1e1)),console[_0x329867(0x1d4)](_0x329867(0x240)),console[_0x329867(0x1d4)](_0x329867(0x1a9)),console[_0x329867(0x1d4)](_0x329867(0x214)),console[_0x329867(0x1d4)](_0x329867(0x243)),0x1;try{const _0x29ebb0=_0x306103['parentSegment'],_0x2103d4=await resolveSegmentTarget(_0x3aff3d,_0x29ebb0,_0x306103[_0x329867(0x1cb)]);_0x306103[_0x329867(0x1cb)]&&console[_0x329867(0x1d4)](_0x329867(0x225)+_0x2103d4);const _0x4007d=await withSpinner(_0x329867(0x253)+_0x3aff3d+_0x329867(0x211),()=>_0x5bab0c[_0x329867(0x1c6)][_0x329867(0x21e)](_0x2103d4),{'verbose':_0x306103['verbose']}),_0x1ed104=_0x4007d[_0x329867(0x1dd)];_0x306103[_0x329867(0x1cb)]&&(console[_0x329867(0x1d4)](_0x329867(0x238)+_0x1ed104[_0x329867(0x22e)]),console[_0x329867(0x1d4)](_0x329867(0x228)+_0x1ed104[_0x329867(0x20d)]));if(_0x1ed104['type']===_0x329867(0x215))return console[_0x329867(0x1d4)](_0x329867(0x223)),console[_0x329867(0x1d4)](_0x329867(0x23f)),0x1;if(_0x1ed104[_0x329867(0x22e)]===_0x329867(0x24f))return console['error'](_0x329867(0x219)),console[_0x329867(0x1d4)](_0x329867(0x213)),0x1;if(!_0x1ed104[_0x329867(0x1f0)])throw new SDKError(ErrorCode[_0x329867(0x21d)],_0x329867(0x216));const _0x39528a=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5bab0c[_0x329867(0x1c6)][_0x329867(0x212)](_0x1ed104[_0x329867(0x20d)],_0x1ed104[_0x329867(0x1f0)]),{'verbose':_0x306103[_0x329867(0x1cb)]}),_0x502217=_0x39528a[_0x329867(0x1dd)],_0x550b10=await executeSchemaQuery(_0x502217,_0x5bab0c,_0x306103);return await handleQueryOutput(_0x550b10,_0x306103),0x0;}catch(_0x3157b7){if(_0x3157b7 instanceof SDKError)return console['error']('Error:\x20'+_0x3157b7[_0x329867(0x1b1)]),_0x3157b7['cause']&&console[_0x329867(0x1d4)]('\x20\x20Cause:\x20'+_0x3157b7[_0x329867(0x1ed)]),0x1;throw _0x3157b7;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x4dd119=a37_0x23dd;(function(_0xee01b8,_0x38c2a7){const _0x3c6d42=a37_0x23dd,_0x23203e=_0xee01b8();while(!![]){try{const _0x4d09fe=-parseInt(_0x3c6d42(0x87))/0x1+-parseInt(_0x3c6d42(0x86))/0x2+-parseInt(_0x3c6d42(0x6b))/0x3+parseInt(_0x3c6d42(0x8f))/0x4+parseInt(_0x3c6d42(0x80))/0x5+parseInt(_0x3c6d42(0x8b))/0x6+parseInt(_0x3c6d42(0x8e))/0x7;if(_0x4d09fe===_0x38c2a7)break;else _0x23203e['push'](_0x23203e['shift']());}catch(_0x20632d){_0x23203e['push'](_0x23203e['shift']());}}}(a37_0x29e0,0x5c8db));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a37_0x29e0(){const _0x354e60=['segment','Creating\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','type','segmentPath','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','data','Segment\x20name:\x20','682030lqrjXw','\x27...','Create\x20child\x20segment\x20with\x20filtering\x20rules','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Resolved\x20relative\x20path\x20to:\x20','kind','847238ZGiWpq','604035PiwLjZ','name','Examples:','Resolving\x20parent\x20segment\x20\x27','872076CSrOiu','resolveParentId','verbose','5073635YcmtEv','2574220tailfE','error','invisible','ruleFile','folderId','segments','description','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','folder','includes','Resolving\x20folder\x20path\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','execute','Resolving\x20folder\x20\x27','730077QBdOJc','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','parent','resolveFolderId','Target\x20path:\x20','Parent:\x20','resolvePathToResource','length','β\x20Created\x20segment\x20\x27','noCountPopulation','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20'];a37_0x29e0=function(){return _0x354e60;};return a37_0x29e0();}import{withSpinner}from'../utils/spinner.js';function a37_0x23dd(_0x2f38a5,_0x3dbaca){_0x2f38a5=_0x2f38a5-0x65;const _0x29e0b4=a37_0x29e0();let _0x23dd40=_0x29e0b4[_0x2f38a5];return _0x23dd40;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a37_0xdd990f from'chalk';export class SegmentCreateCommand extends BaseCommand{[a37_0x4dd119(0x88)]='segment:create';['description']=a37_0x4dd119(0x82);async[a37_0x4dd119(0x69)](_0x5f077c){const _0x381516=a37_0x4dd119;console[_0x381516(0x90)](a37_0xdd990f['yellow'](_0x381516(0x83))),console[_0x381516(0x90)](a37_0xdd990f['yellow'](_0x381516(0x6c)));const {options:_0x3aa2ae,args:_0x2ebd58,tdx:_0x1841eb}=_0x5f077c,_0x7f5da7=_0x3aa2ae;if(_0x2ebd58[_0x381516(0x73)]===0x0)return console[_0x381516(0x90)](_0x381516(0x76)),console[_0x381516(0x90)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x381516(0x90)](_0x381516(0x89)),console[_0x381516(0x90)](_0x381516(0x6d)),console[_0x381516(0x90)](_0x381516(0x68)),console[_0x381516(0x90)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0xa9be03=_0x2ebd58[0x0],_0x3ef9f6=_0x3aa2ae[_0x381516(0x7c)];let _0xfdee9c=_0xa9be03;_0x3ef9f6&&!_0xa9be03[_0x381516(0x66)]('/')&&(_0xfdee9c=_0x3ef9f6+'/'+_0xa9be03,_0x7f5da7['verbose']&&console['error'](_0x381516(0x84)+_0xfdee9c));const _0x5b173d=parsePath(_0xfdee9c);if(_0x5b173d[_0x381516(0x94)][_0x381516(0x73)]<0x2)return console[_0x381516(0x90)](_0x381516(0x96)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x48660b=_0x5b173d[_0x381516(0x94)][0x0],_0x19f908=getBaseName(_0xfdee9c),_0x19c786=getParentPath(_0xfdee9c);_0x7f5da7[_0x381516(0x8d)]&&(console[_0x381516(0x90)]('Site:\x20'+_0x7f5da7['site']),console[_0x381516(0x90)](_0x381516(0x70)+_0xfdee9c),console[_0x381516(0x90)](_0x381516(0x71)+_0x48660b),console[_0x381516(0x90)](_0x381516(0x7f)+_0x19f908),console['error']('Parent\x20path:\x20'+_0x19c786));const _0x1641fb=await withSpinner(_0x381516(0x8a)+_0x48660b+_0x381516(0x81),()=>_0x1841eb[_0x381516(0x78)][_0x381516(0x8c)](_0x48660b),{'verbose':_0x7f5da7[_0x381516(0x8d)]}),_0x33730a=_0x1641fb[_0x381516(0x7e)];let _0x278011;if(_0x5b173d[_0x381516(0x94)][_0x381516(0x73)]>0x2){const _0x40d94a=await withSpinner(_0x381516(0x67)+_0x19c786+_0x381516(0x81),()=>_0x1841eb['segment'][_0x381516(0x72)](_0x19c786),{'verbose':_0x7f5da7[_0x381516(0x8d)]}),_0x532f30=_0x40d94a[_0x381516(0x7e)];if(_0x532f30[_0x381516(0x7b)]!=='folder'&&_0x532f30['type']!==_0x381516(0x6e))return console[_0x381516(0x90)](_0x381516(0x7d)),0x1;_0x278011=_0x532f30[_0x381516(0x93)];}else{if(_0x7f5da7[_0x381516(0x65)]){const _0x3e5121=await withSpinner(_0x381516(0x6a)+_0x7f5da7['folder']+_0x381516(0x81),()=>_0x1841eb['segment'][_0x381516(0x6f)](_0x33730a,_0x7f5da7[_0x381516(0x65)]),{'verbose':_0x7f5da7['verbose']});_0x278011=_0x3e5121['data'];}}_0x7f5da7[_0x381516(0x8d)]&&_0x278011&&console[_0x381516(0x90)](_0x381516(0x7a)+_0x278011);const _0x3d275f=await loadJSONFromOptions(_0x7f5da7['rule'],_0x7f5da7[_0x381516(0x92)]),_0x1b6dba={'name':_0x19f908,'description':_0x7f5da7[_0x381516(0x95)],'rule':_0x3d275f,'kind':_0x7f5da7['kind']!==undefined?parseInt(_0x7f5da7[_0x381516(0x85)],0xa):undefined,'isVisible':_0x7f5da7[_0x381516(0x91)]?![]:undefined,'segmentFolderId':_0x278011,'countPopulation':_0x7f5da7[_0x381516(0x75)]?![]:undefined},_0x5dca0b=await withSpinner(_0x381516(0x79)+_0x19f908+_0x381516(0x81),()=>_0x1841eb[_0x381516(0x78)]['createSegment'](_0x33730a,_0x1b6dba),{'verbose':_0x7f5da7[_0x381516(0x8d)]}),_0x58484f=_0x5dca0b[_0x381516(0x7e)];return console[_0x381516(0x90)](_0x381516(0x74)+_0x58484f[_0x381516(0x88)]+_0x381516(0x77)+_0x58484f['id']),_0xfdee9c!==_0xa9be03&&console['error']('\x20\x20\x20Path:\x20'+_0xfdee9c),await handleSDKOutput([_0x58484f],_0x7f5da7),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0xbbbe4b=a38_0x53a8;(function(_0xf8a6c1,_0x1ad2cc){const _0x3206ef=a38_0x53a8,_0x2e62d0=_0xf8a6c1();while(!![]){try{const _0x58a2c7=parseInt(_0x3206ef(0x19c))/0x1+-parseInt(_0x3206ef(0x1a4))/0x2+-parseInt(_0x3206ef(0x198))/0x3*(-parseInt(_0x3206ef(0x193))/0x4)+-parseInt(_0x3206ef(0x18d))/0x5*(-parseInt(_0x3206ef(0x18c))/0x6)+parseInt(_0x3206ef(0x188))/0x7+parseInt(_0x3206ef(0x191))/0x8*(-parseInt(_0x3206ef(0x19f))/0x9)+-parseInt(_0x3206ef(0x1a2))/0xa*(parseInt(_0x3206ef(0x18f))/0xb);if(_0x58a2c7===_0x1ad2cc)break;else _0x2e62d0['push'](_0x2e62d0['shift']());}catch(_0x45dfad){_0x2e62d0['push'](_0x2e62d0['shift']());}}}(a38_0x27c4,0x9e43c));function a38_0x53a8(_0x497f14,_0x131ee5){_0x497f14=_0x497f14-0x188;const _0x27c477=a38_0x27c4();let _0x53a87a=_0x27c477[_0x497f14];return _0x53a87a;}import{BaseCommand}from'./command.js';function a38_0x27c4(){const _0x1b83df=['data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','873rDZwIM','site','error','10sjXhLT','List\x20available\x20fields\x20for\x20segmentation','1151452XFfkPu','324702vpZeuu','verbose','segment:fields','Parent\x20segment:\x20','120984WqDkTH','110ueZogt','Error:\x20Parent\x20segment\x20name\x20is\x20required','594319KvcKrW','length','72176hAatSC','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1594616WocBsC','Site:\x20','Listing\x20fields\x20for\x20\x27','listFields','\x27...','3EgLOke','execute','\x20field','name','1264493yVGrDe'];a38_0x27c4=function(){return _0x1b83df;};return a38_0x27c4();}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{[a38_0xbbbe4b(0x19b)]=a38_0xbbbe4b(0x18a);['description']=a38_0xbbbe4b(0x1a3);async[a38_0xbbbe4b(0x199)](_0x3ccdab){const _0x3f69fd=a38_0xbbbe4b,{options:_0x17e335,args:_0x3b4bb1,tdx:_0x4fa5d4}=_0x3ccdab,_0x5de70e=_0x3b4bb1[0x0]||_0x17e335['parentSegment'];if(!_0x5de70e)return console[_0x3f69fd(0x1a1)](_0x3f69fd(0x18e)),console['error'](_0x3f69fd(0x19e)),console[_0x3f69fd(0x1a1)](_0x3f69fd(0x192)),0x1;_0x17e335[_0x3f69fd(0x189)]&&(console[_0x3f69fd(0x1a1)](_0x3f69fd(0x194)+_0x17e335[_0x3f69fd(0x1a0)]),console[_0x3f69fd(0x1a1)](_0x3f69fd(0x18b)+_0x5de70e));const _0x3df8d5=await withSpinner(_0x3f69fd(0x195)+_0x5de70e+_0x3f69fd(0x197),()=>_0x4fa5d4['segment'][_0x3f69fd(0x196)](_0x5de70e),{'verbose':_0x17e335['verbose']}),_0x1a40fb=_0x3df8d5[_0x3f69fd(0x19d)];console[_0x3f69fd(0x1a1)]('β\x20Found\x20'+_0x1a40fb[_0x3f69fd(0x190)]+_0x3f69fd(0x19a)+(_0x1a40fb['length']!==0x1?'s':''));if(_0x17e335['json']||_0x17e335['jsonl'])return await handleSDKOutput(_0x1a40fb,_0x17e335),0x0;return displayFieldsHumanReadable(_0x1a40fb,_0x5de70e),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a39_0x3075a5=a39_0x2da2;(function(_0x5c49d8,_0xc04cdd){const _0x40543c=a39_0x2da2,_0x580f13=_0x5c49d8();while(!![]){try{const _0x3d46e7=-parseInt(_0x40543c(0xb9))/0x1+-parseInt(_0x40543c(0xad))/0x2+parseInt(_0x40543c(0x8e))/0x3+parseInt(_0x40543c(0x90))/0x4*(parseInt(_0x40543c(0x81))/0x5)+parseInt(_0x40543c(0xa8))/0x6*(-parseInt(_0x40543c(0xac))/0x7)+parseInt(_0x40543c(0xa5))/0x8*(-parseInt(_0x40543c(0xb8))/0x9)+parseInt(_0x40543c(0x8b))/0xa;if(_0x3d46e7===_0xc04cdd)break;else _0x580f13['push'](_0x580f13['shift']());}catch(_0x52dd11){_0x580f13['push'](_0x580f13['shift']());}}}(a39_0x4c36,0xd7f95));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a39_0x4c36(){const _0x1cad41=['segments','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','error','parentName','\x20files\x20to\x20','dim','parent_segment','209140qdvoSc','\x20files?','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','site','dryRun','execute','hasChanges','length','diff','relativePath','35131260NATESz','\x20journeys','Parent\x20segment:\x20','3043761DOQtfB','β\x20All\x20files\x20are\x20up\x20to\x20date','20MOcpqg','\x20\x20π―\x20','message','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','errorCode','dirname','\x27...','journeys','segment:pull','\x20\x20πΊοΈ\x20\x20','\x20segments','\x0aError:','\x20unchanged\x20files','isNew','absolutePath','cyan','targetDir','pullSegments','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20Target:\x20','yes','56024yZEAAI','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','41964krLCtz','no_parent','\x20changed\x20files','type','973tEYfOT','2217040KjDPKW','Aborted.','segment','Error:\x20','files','helpText','green','counts','\x20=\x20','yellow','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)','1413knFEgG','672067iBZbsL','Site:\x20','Target\x20resource:\x20','β\x20Context\x20set:\x20','resourceName','utf-8','red','β\x20Pulled\x20','session','repeat','Pulling\x20segments\x20from\x20\x27','file','filter','journeyVersions','\x20with\x20','\x20new\x20files','cwd','activations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Write\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written'];a39_0x4c36=function(){return _0x1cad41;};return a39_0x4c36();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a39_0x364acc from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a39_0x2da2(_0x44688f,_0x5f819a){_0x44688f=_0x44688f-0x67;const _0x4c3610=a39_0x4c36();let _0x2da27d=_0x4c3610[_0x44688f];return _0x2da27d;}import a39_0x2440ef 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']=a39_0x3075a5(0x98);['description']=a39_0x3075a5(0x93);async[a39_0x3075a5(0x86)](_0x4146fe){const _0x5c05dd=a39_0x3075a5,{options:_0x957702,args:_0x35c6b6,tdx:_0x3e07cf}=_0x4146fe,_0x245017=_0x957702,_0xc0f9e9=await resolveTarget({'arg':_0x35c6b6[0x0],'contextParent':_0x957702['parentSegment'],'cwd':process[_0x5c05dd(0x75)]()});if(!isSuccessfulResolution(_0xc0f9e9))return _0xc0f9e9[_0x5c05dd(0x94)]===_0x5c05dd(0xa9)?(console['error'](a39_0x364acc[_0x5c05dd(0xb6)](_0x5c05dd(0x83))),console['error'](_0x5c05dd(0xb7)),console['error'](_0x5c05dd(0xa7)),console[_0x5c05dd(0x7c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0x6b)](_0x5c05dd(0xb0)+_0xc0f9e9[_0x5c05dd(0x92)]+'\x0a')),_0xc0f9e9[_0x5c05dd(0xb2)]&&console['error'](a39_0x364acc[_0x5c05dd(0x9f)](_0xc0f9e9[_0x5c05dd(0xb2)]))),0x1;const _0x12a742=_0xc0f9e9['parentName'],_0x4d1ae3=_0xc0f9e9[_0x5c05dd(0xa0)],_0x6b42cf=_0xc0f9e9[_0x5c05dd(0xab)]===_0x5c05dd(0x70)?_0xc0f9e9[_0x5c05dd(0x69)]:undefined;_0x245017['verbose']&&(console['error'](_0x5c05dd(0xba)+_0x245017[_0x5c05dd(0x84)]),console[_0x5c05dd(0x7c)](_0x5c05dd(0x8d)+_0x12a742),_0x6b42cf&&console[_0x5c05dd(0x7c)](_0x5c05dd(0x67)+_0x6b42cf));const _0x3ea98d=await withProgressSpinner(_0x5c05dd(0x6f)+_0x12a742+_0x5c05dd(0x96),_0x47a0c6=>_0x3e07cf[_0x5c05dd(0xaf)][_0x5c05dd(0xa1)](_0x12a742,{'targetDir':_0x4d1ae3,'targetResourceName':_0x6b42cf,'verbose':_0x245017['verbose'],'progress':{'update':_0x48eadc=>{_0x47a0c6['setPhase'](_0x48eadc),_0x245017['verbose']&&console['error']('\x20\x20'+_0x48eadc);}}}),{'verbose':_0x245017['verbose']}),_0x4ac206=_0x3ea98d['data'];if(_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x7a)]===0x0&&_0x4ac206['counts'][_0x5c05dd(0x97)]===0x0)return console[_0x5c05dd(0x7c)](a39_0x364acc['yellow'](_0x5c05dd(0xa2)+_0x4ac206[_0x5c05dd(0x7d)]+'\x27')),0x0;const _0x54c771=_0x4ac206[_0x5c05dd(0xb1)][_0x5c05dd(0x71)](_0x13e8ba=>_0x13e8ba[_0x5c05dd(0x9d)]),_0x2abb5b=_0x4ac206[_0x5c05dd(0xb1)][_0x5c05dd(0x71)](_0x811713=>!_0x811713['isNew']&&_0x811713[_0x5c05dd(0x87)]),_0x5ba8c5=_0x4ac206[_0x5c05dd(0xb1)]['filter'](_0x1f976e=>!_0x1f976e[_0x5c05dd(0x9d)]&&!_0x1f976e[_0x5c05dd(0x87)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x4ac206[_0x5c05dd(0x7d)]+'\x27:'),console[_0x5c05dd(0x7c)](_0x5c05dd(0x91)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x7a)]+_0x5c05dd(0x9a))+_0x5c05dd(0x73)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x76)]+'\x20activations'));if(_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x97)]>0x0){const _0x3be419=_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x72)]>_0x4ac206[_0x5c05dd(0xb4)]['journeys']?'\x20('+_0x4ac206[_0x5c05dd(0xb4)]['journeyVersions']+'\x20versions)':'';console[_0x5c05dd(0x7c)](_0x5c05dd(0x99)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x97)]+_0x5c05dd(0x8c))+a39_0x364acc[_0x5c05dd(0x7f)](_0x3be419));}console['error']('\x20\x20'+a39_0x364acc[_0x5c05dd(0xb3)]('+\x20'+_0x54c771['length']+_0x5c05dd(0x74))),console[_0x5c05dd(0x7c)]('\x20\x20'+a39_0x364acc[_0x5c05dd(0xb6)]('~\x20'+_0x2abb5b[_0x5c05dd(0x88)]+_0x5c05dd(0xaa))),console[_0x5c05dd(0x7c)]('\x20\x20'+a39_0x364acc[_0x5c05dd(0x7f)]('=\x20'+_0x5ba8c5[_0x5c05dd(0x88)]+_0x5c05dd(0x9c))),console['error'](_0x5c05dd(0xa3)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xa0)])+'\x0a');if(_0x2abb5b[_0x5c05dd(0x88)]>0x0)for(const _0x4733dc of _0x2abb5b){console[_0x5c05dd(0x7c)]('\x0aChanges\x20to\x20\x27'+_0x4733dc[_0x5c05dd(0x8a)]+'\x27:'),console[_0x5c05dd(0x7c)]('β'[_0x5c05dd(0x6e)](0x3c)),console[_0x5c05dd(0x7c)](_0x4733dc[_0x5c05dd(0x89)]),console[_0x5c05dd(0x7c)]('β'[_0x5c05dd(0x6e)](0x3c));}if(_0x245017[_0x5c05dd(0x85)])return console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb6)](_0x5c05dd(0x79))),0x0;if(_0x54c771[_0x5c05dd(0x88)]===0x0&&_0x2abb5b[_0x5c05dd(0x88)]===0x0)return console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb3)](_0x5c05dd(0x8f))),saveSessionContext({'parent_segment':_0x4ac206[_0x5c05dd(0x7d)]},_0x245017[_0x5c05dd(0x6d)]),console[_0x5c05dd(0x7c)](a39_0x364acc['green'](_0x5c05dd(0x68)+a39_0x364acc[_0x5c05dd(0x7f)]('parent_segment')+'\x20=\x20'+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0x7d)]))),0x0;if(!_0x245017[_0x5c05dd(0xa4)]){if(!isInteractive())return console['error'](a39_0x364acc['red'](_0x5c05dd(0x9b)),_0x5c05dd(0x77)),console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0x7f)](_0x5c05dd(0x7b))),0x1;const _0x4c84a4=await confirmKey(_0x5c05dd(0x78)+(_0x54c771[_0x5c05dd(0x88)]+_0x2abb5b[_0x5c05dd(0x88)])+_0x5c05dd(0x82));if(!_0x4c84a4)return console[_0x5c05dd(0x7c)](a39_0x364acc['yellow'](_0x5c05dd(0xae)),'-\x20no\x20files\x20written'),0x1;}for(const _0x2c77b3 of _0x4ac206[_0x5c05dd(0xb1)]){if(_0x2c77b3[_0x5c05dd(0x9d)]||_0x2c77b3[_0x5c05dd(0x87)]){const _0x5b63d1=a39_0x2440ef[_0x5c05dd(0x95)](_0x2c77b3[_0x5c05dd(0x9e)]);!existsSync(_0x5b63d1)&&mkdirSync(_0x5b63d1,{'recursive':!![]}),writeFileSync(_0x2c77b3[_0x5c05dd(0x9e)],_0x2c77b3[_0x5c05dd(0xa6)],_0x5c05dd(0x6a));}}return console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb3)](_0x5c05dd(0x6c)+(_0x54c771['length']+_0x2abb5b[_0x5c05dd(0x88)])+_0x5c05dd(0x7e)+_0x4ac206[_0x5c05dd(0xa0)])),saveSessionContext({'parent_segment':_0x4ac206[_0x5c05dd(0x7d)]},_0x245017[_0x5c05dd(0x6d)]),console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb3)](_0x5c05dd(0x68)+a39_0x364acc['dim'](_0x5c05dd(0x80))+_0x5c05dd(0xb5)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0x7d)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x4f7c05=a40_0x7662;(function(_0x250ce8,_0x163d11){const _0x39ab40=a40_0x7662,_0x323026=_0x250ce8();while(!![]){try{const _0xb35c31=-parseInt(_0x39ab40(0x1a4))/0x1+parseInt(_0x39ab40(0x16d))/0x2*(-parseInt(_0x39ab40(0x192))/0x3)+-parseInt(_0x39ab40(0x1ac))/0x4*(-parseInt(_0x39ab40(0x128))/0x5)+-parseInt(_0x39ab40(0x16e))/0x6+parseInt(_0x39ab40(0x13d))/0x7*(parseInt(_0x39ab40(0x181))/0x8)+parseInt(_0x39ab40(0x12c))/0x9*(parseInt(_0x39ab40(0x1b6))/0xa)+parseInt(_0x39ab40(0x12d))/0xb;if(_0xb35c31===_0x163d11)break;else _0x323026['push'](_0x323026['shift']());}catch(_0x4d1e45){_0x323026['push'](_0x323026['shift']());}}}(a40_0x7a8d,0xbfb74));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a40_0x7662(_0xdcea7,_0x6e08e8){_0xdcea7=_0xdcea7-0x121;const _0x7a8dcb=a40_0x7a8d();let _0x7662fa=_0x7a8dcb[_0xdcea7];return _0x7662fa;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x48a9eb from'chalk';function a40_0x7a8d(){const _0x299748=['setPhase','segments','Error\x20parsing\x20YAML:\x20','parentName','1345424AluCMK','updatedAt','toCreate','targetDir','filePath','\x20\x20π\x20Segments:','Parent\x20segment:\x20','journeyBundleName','isNew','\x27...','160KWBnda','get','\x0aβ\x20Push\x20complete','Fetching\x20existing\x20activations...','created','β\x20All\x20journeys\x20are\x20up\x20to\x20date','yes','Changes\x20to\x20journey:','toUpdate','results','scopedFolderPath','type','/e/','Folders\x20to\x20create:','parentFolder','error','cyan','\x0aError:','buildUserMaps','Push\x20','5rDyKFn','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','updated','listActivations','587151CAxJRJ','7343347QWjnXc','Delete\x20journey:','\x0aPush\x20summary\x20for\x20\x27','endsWith','yellow','changed','idToName','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20Journeys:\x20','/app/ps/','map','connection','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','44849ucUWkp','Changes\x20to:','Error:\x20','/j/da/je','red','set','yamlConfig','journeys','existingJourney','activations','toDelete','\x20new','getOutputSchemaWithCache','\x20\x20Activations:','listFolders','errorCode','segment','blue','parent_name','join','.yaml','site','Site:\x20','\x20activations]','\x20to\x20update','state','\x20unchanged','createdAt','deleted','diff','nameToId','\x20updated','journey','length','execute','toString','isScoped','getParent','\x20created','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','unchanged','getJourney','Preparing\x20journeys...','message','Scoped\x20to\x20folder:\x20','Aborted.','then','all','43250ZdtBER','4168164DciGYw','green','folderPath','\x20deleted','add','dim','\x20to\x20create','description','journeyBundleId','verbose','journeysOnly','journeyId','Error:\x20Directory\x20not\x20found:\x20','segment:push','New\x20journey:','list','listJourneysWithDetailsFromParentSegment','folderId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','1376FUrfgI','(Journey\x20will\x20be\x20deleted)','\x20to\x20delete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parentSegment','/sb/da/esr','helpText','cwd','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','resolveParentId','filter','\x20YAML\x20files\x20found','Delete\x20segment:','user','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','nameToType','attributes','39bJfCDJ','createdSegmentIds','paused','name','existingSegment','repeat','\x20\x20\x20\x20','New\x20segment:','data','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20Source:\x20','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','folders','No\x20','\x20\x20Segments:\x20','versionNumber','\x20\x20Activations:\x20','push','1388674SohMuE','segmentFolderId','new','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.'];a40_0x7a8d=function(){return _0x299748;};return a40_0x7a8d();}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a40_0x4f7c05(0x195)]=a40_0x4f7c05(0x17b);['description']=a40_0x4f7c05(0x180);async[a40_0x4f7c05(0x15f)](_0x283001){const _0x34858a=a40_0x4f7c05,{options:_0xc7a752,args:_0x27a74e,tdx:_0x2b9977}=_0x283001,_0x25aa52=_0xc7a752,_0x51ed10=await resolveTarget({'arg':_0x27a74e[0x0],'contextParent':_0xc7a752[_0x34858a(0x185)],'cwd':process[_0x34858a(0x188)]()});if(!isSuccessfulResolution(_0x51ed10))return _0x51ed10[_0x34858a(0x14c)]==='no_parent'?(console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x131)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x34858a(0x13b)),console[_0x34858a(0x123)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x34858a(0x123)]('\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[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x13f)+_0x51ed10[_0x34858a(0x168)]+'\x0a')),_0x51ed10[_0x34858a(0x187)]&&console['error'](a40_0x48a9eb[_0x34858a(0x124)](_0x51ed10['helpText']))),0x1;if(_0x51ed10[_0x34858a(0x1c1)]===_0x34858a(0x14f))return console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x141)]('Error:\x20Directory\x20not\x20found:\x20'+_0x51ed10[_0x34858a(0x1af)]+'\x0a')),console[_0x34858a(0x123)](a40_0x48a9eb['cyan'](_0x34858a(0x13c))),0x1;const _0xd61580=_0x51ed10[_0x34858a(0x1ab)],_0x2ce77f=_0x51ed10[_0x34858a(0x1af)],_0xbfe3b6=_0x51ed10[_0x34858a(0x1c1)]==='file'?_0x51ed10[_0x34858a(0x1b0)]:undefined,_0x6cb420=getScopedDetails(_0x51ed10),_0x3175fc=_0x6cb420?.[_0x34858a(0x161)]??![],_0x43da39=_0x6cb420?.[_0x34858a(0x1c0)]??'';if(!existsSync(_0x2ce77f))return console[_0x34858a(0x123)](a40_0x48a9eb['red'](_0x34858a(0x17a)+_0x2ce77f+'\x0a')),console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x124)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x25aa52[_0x34858a(0x177)]&&(console['error'](_0x34858a(0x153)+_0x25aa52['site']),console[_0x34858a(0x123)](_0x34858a(0x1b2)+_0xd61580),console['error']('Source\x20directory:\x20'+_0x2ce77f),_0x3175fc&&console[_0x34858a(0x123)](_0x34858a(0x169)+_0x43da39));const _0x5d7266=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xd61580+_0x34858a(0x1b5),()=>_0x2b9977[_0x34858a(0x14d)][_0x34858a(0x18a)](_0xd61580),{'verbose':_0x25aa52[_0x34858a(0x177)]}),_0xcaf669=_0x5d7266[_0x34858a(0x19a)],{parentSegmentResult:_0x4ff5d4,segmentsResult:_0x2c6939,foldersResult:_0x4fd477,journeysWithDetailsResult:_0xf51e9,userMaps:_0x4415a2}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x1dc934=_0x34858a,[_0xbed3e4,_0x137dd3,_0x30835c,_0x50a955,_0x22e681]=await Promise[_0x1dc934(0x16c)]([_0x2b9977[_0x1dc934(0x14d)][_0x1dc934(0x162)](_0xcaf669),_0x2b9977['segment']['listSegments'](_0xcaf669),_0x2b9977[_0x1dc934(0x14d)][_0x1dc934(0x14b)](_0xcaf669),_0x2b9977[_0x1dc934(0x15d)][_0x1dc934(0x17e)](_0xcaf669,{'includeAllVersions':!![]}),_0x2b9977[_0x1dc934(0x18e)][_0x1dc934(0x126)]()]);return{'parentSegmentResult':_0xbed3e4,'segmentsResult':_0x137dd3,'foldersResult':_0x30835c,'journeysWithDetailsResult':_0x50a955,'userMaps':_0x22e681};},{'verbose':_0x25aa52[_0x34858a(0x177)]})[_0x34858a(0x16b)](_0x4799db=>_0x4799db['data']),_0x7ebbab=_0x4ff5d4,_0x4f66f9=extractRootFolderId(_0x7ebbab),_0x157eca=_0x2c6939,_0x24b31a=_0x4fd477,{journeys:_0x5d9353,activationStepsById:_0x38e7fb}=_0xf51e9,_0x277524=new Map(_0x5d9353['map'](_0x32e431=>[_0x32e431['id'],_0x32e431])),_0x5d3488=_0x5d9353['map'](_0x428e6e=>({'id':_0x428e6e['id'],'name':_0x428e6e['attributes']['name'],'journeyBundleName':_0x428e6e[_0x34858a(0x191)][_0x34858a(0x1b3)]||'','journeyBundleId':_0x428e6e[_0x34858a(0x191)][_0x34858a(0x176)]||'','versionNumber':_0x428e6e[_0x34858a(0x191)][_0x34858a(0x1a1)],'description':_0x428e6e['attributes'][_0x34858a(0x175)],'state':_0x428e6e[_0x34858a(0x191)][_0x34858a(0x156)],'paused':_0x428e6e[_0x34858a(0x191)][_0x34858a(0x194)],'audienceId':_0x428e6e[_0x34858a(0x191)]['audienceId'],'folderId':_0x428e6e['relationships']?.[_0x34858a(0x122)]?.[_0x34858a(0x19a)]?.['id'],'createdAt':_0x428e6e[_0x34858a(0x191)][_0x34858a(0x158)],'updatedAt':_0x428e6e[_0x34858a(0x191)][_0x34858a(0x1ad)]})),{emailToId:_0x1a7d05,idToEmail:_0x15c0cb}=_0x4415a2,_0x3e8964=await withSpinner(_0x34858a(0x19b),async()=>{const _0x22707f=_0x34858a,_0x49a093=await _0x2b9977[_0x22707f(0x13a)][_0x22707f(0x17d)]();return buildConnectionMaps(_0x49a093);},{'verbose':_0x25aa52['verbose']})[_0x34858a(0x16b)](_0xfb4f8=>_0xfb4f8[_0x34858a(0x19a)]),_0x12854d=_0x3e8964[_0x34858a(0x15b)],_0x38f76b=_0x3e8964['idToName'],_0x20e4c2=_0x3e8964[_0x34858a(0x190)],_0x4dca24={'emailToIdMap':_0x1a7d05,'connectionNameToIdMap':_0x12854d,'connectionNameToTypeMap':_0x20e4c2,'getSchema':_0x28d244=>_0x2b9977[_0x34858a(0x13a)][_0x34858a(0x149)](_0x28d244)};let {pathToId:_0x7aad23,idToPath:_0x405716}=buildFolderMaps(_0x24b31a);const _0x5a5788=buildSegmentLookupMap(_0x157eca,_0x405716),_0x4d8db8=buildSegmentNameToIdMap(_0x157eca),_0x125ae4=buildJourneyBundleLookupMap(_0x5d3488,_0x405716);let _0x3a873c;if(_0xbfe3b6){if(!_0xbfe3b6[_0x34858a(0x130)]('.yml')&&!_0xbfe3b6[_0x34858a(0x130)](_0x34858a(0x151)))return console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x136)+_0xbfe3b6+'\x0a')),0x1;_0x3a873c=[_0xbfe3b6];}else _0x3a873c=findYamlFiles(_0x2ce77f);if(_0x3a873c[_0x34858a(0x15e)]===0x0)return console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x134)+_0x2ce77f+'\x0a')),console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x124)](_0x34858a(0x184))),0x1;let _0x3c1164,_0x394de2;try{const _0x3789d9=parseAndClassifyYamlFiles(_0x3a873c,_0x2ce77f,{'skipSegments':_0x25aa52['journeysOnly']});_0x3c1164=_0x3789d9[_0x34858a(0x1a9)],_0x394de2=_0x3789d9['journeys'];const _0x35858a=validateParsedFiles(_0x3789d9,_0x2ce77f);if(_0x35858a['length']>0x0)return console['error'](a40_0x48a9eb[_0x34858a(0x141)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x35858a)),console[_0x34858a(0x123)](a40_0x48a9eb['yellow'](_0x34858a(0x1a7))),0x1;}catch(_0x2da744){return console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x1aa)+(_0x2da744 instanceof Error?_0x2da744['message']:_0x2da744))),0x1;}if(_0x3c1164[_0x34858a(0x15e)]===0x0&&_0x394de2[_0x34858a(0x15e)]===0x0){const _0x1ab481=_0x25aa52[_0x34858a(0x178)]?_0x34858a(0x15d):'segment\x20or\x20journey';return console['error'](a40_0x48a9eb[_0x34858a(0x131)](_0x34858a(0x19f)+_0x1ab481+_0x34858a(0x18c))),0x0;}const _0x118e4f=new Map();_0x157eca[_0x34858a(0x15e)]>0x0&&!_0x25aa52[_0x34858a(0x178)]&&await withSpinner(_0x34858a(0x1b9),async()=>{await batchAsync(_0x157eca,async _0x33cd65=>{const _0x46fc74=a40_0x7662,_0x4b4333=await _0x2b9977[_0x46fc74(0x14d)][_0x46fc74(0x12b)](_0xcaf669,_0x33cd65['id']);_0x118e4f[_0x46fc74(0x142)](_0x33cd65['id'],_0x4b4333);});},{'verbose':_0x25aa52['verbose']});const {segmentFiles:_0x990615,foldersToCreate:_0x513e00}=await prepareSegmentFiles(_0x3c1164,{'segmentByFolderAndName':_0x5a5788,'activationsBySegmentId':_0x118e4f,'folderPathToId':_0x7aad23,'idToEmailMap':_0x15c0cb,'connectionIdToNameMap':_0x38f76b},_0x4dca24,_0x3175fc,_0x43da39),_0x239ca6=_0xbfe3b6?[]:findSegmentsToDelete(_0x157eca,_0x3c1164[_0x34858a(0x139)](({yamlConfig:_0x21bc9c,folderPath:_0x598cfc})=>({'yamlConfig':_0x21bc9c,'folderPath':resolveTDFolderPath(_0x598cfc,_0x3175fc,_0x43da39)})),_0x405716,_0x43da39,_0x3175fc),{journeyFiles:_0x40910f,foldersToCreate:_0x85ef60}=await withProgressSpinner(_0x34858a(0x167),async _0x59755a=>prepareJourneyFiles(_0x394de2,{'fetchJourney':async _0x59c08f=>_0x2b9977[_0x34858a(0x15d)][_0x34858a(0x166)](_0x59c08f[_0x34858a(0x179)]),'journeyBundlesByFolderAndName':_0x125ae4,'folderPathToId':_0x7aad23,'idToEmailMap':_0x15c0cb,'connectionIdToNameMap':_0x38f76b,'existingSegments':_0x157eca,'parentId':_0xcaf669,'deps':_0x2b9977,'progress':{'update':_0x1e826=>{const _0x264f95=_0x34858a;_0x59755a[_0x264f95(0x1a8)](_0x1e826),_0x25aa52[_0x264f95(0x177)]&&console[_0x264f95(0x123)]('\x20\x20'+_0x1e826);}},'journeyById':_0x277524,'activationStepsById':_0x38e7fb},_0x3175fc,_0x43da39),{'verbose':_0x25aa52[_0x34858a(0x177)]})[_0x34858a(0x16b)](_0x5c06ab=>_0x5c06ab[_0x34858a(0x19a)]);for(const _0x174f40 of _0x85ef60){_0x513e00[_0x34858a(0x172)](_0x174f40);}const _0x51bf30=_0xbfe3b6?[]:findJourneysToDelete(_0x5d3488,_0x394de2[_0x34858a(0x139)](({yamlConfig:_0xfb5d30,folderPath:_0x1bb523})=>({'yamlConfig':_0xfb5d30,'folderPath':resolveTDFolderPath(_0x1bb523,_0x3175fc,_0x43da39)})),_0x405716,_0x43da39,_0x3175fc),_0x3fc234=calculatePushStats(_0x990615,_0x40910f,_0x513e00,_0x239ca6,_0x51bf30,!!_0x25aa52['delete'],!!_0x25aa52[_0x34858a(0x178)]),_0x94a6a6=_0x3fc234[_0x34858a(0x1a9)][_0x34858a(0x1a6)],_0x35a552=_0x3fc234[_0x34858a(0x1a9)][_0x34858a(0x132)],_0x5ab0aa=_0x3fc234[_0x34858a(0x1a9)][_0x34858a(0x165)],_0x2ed019=_0x3fc234['segments'][_0x34858a(0x147)],_0x49cfa8=_0x3fc234[_0x34858a(0x19e)][_0x34858a(0x1ae)],_0x287d4d=_0x3fc234[_0x34858a(0x144)][_0x34858a(0x1a6)],_0x4211f9=_0x3fc234[_0x34858a(0x144)][_0x34858a(0x132)],_0x11cbeb=_0x3fc234[_0x34858a(0x144)][_0x34858a(0x165)],_0x3c4f6f=_0x3fc234[_0x34858a(0x144)][_0x34858a(0x147)],_0x587c07=_0x3fc234[_0x34858a(0x146)]['all'],_0xed5134=_0x3fc234[_0x34858a(0x146)]['toCreate'],_0x2ce973=_0x3fc234[_0x34858a(0x146)][_0x34858a(0x1be)],_0x4edf43=_0x3fc234[_0x34858a(0x146)][_0x34858a(0x147)];console[_0x34858a(0x123)](_0x34858a(0x12f)+_0xd61580+'\x27:');_0x49cfa8[_0x34858a(0x15e)]>0x0&&console['error']('\x20\x20'+a40_0x48a9eb[_0x34858a(0x14e)]('π\x20'+_0x49cfa8[_0x34858a(0x15e)]+'\x20folders\x20to\x20create'));if(!_0x25aa52[_0x34858a(0x178)]){console[_0x34858a(0x123)](_0x34858a(0x1b1)),console[_0x34858a(0x123)](_0x34858a(0x198)+a40_0x48a9eb[_0x34858a(0x16f)]('+\x20'+_0x94a6a6['length']+_0x34858a(0x148))),console[_0x34858a(0x123)](_0x34858a(0x198)+a40_0x48a9eb[_0x34858a(0x131)]('~\x20'+_0x35a552['length']+'\x20changed'));if(_0x2ed019[_0x34858a(0x15e)]>0x0)console[_0x34858a(0x123)]('\x20\x20\x20\x20'+a40_0x48a9eb[_0x34858a(0x141)]('-\x20'+_0x2ed019[_0x34858a(0x15e)]+'\x20to\x20delete'));else _0x239ca6[_0x34858a(0x15e)]>0x0&&!_0x25aa52['delete']&&console['error'](_0x34858a(0x198)+a40_0x48a9eb[_0x34858a(0x173)](_0x239ca6[_0x34858a(0x15e)]+_0x34858a(0x18f)));console[_0x34858a(0x123)](_0x34858a(0x198)+a40_0x48a9eb[_0x34858a(0x173)]('=\x20'+_0x5ab0aa['length']+_0x34858a(0x157)));}if(_0x40910f[_0x34858a(0x15e)]>0x0||_0x51bf30[_0x34858a(0x15e)]>0x0){console['error']('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x34858a(0x123)]('\x20\x20\x20\x20'+a40_0x48a9eb['green']('+\x20'+_0x287d4d['length']+_0x34858a(0x148))),console[_0x34858a(0x123)]('\x20\x20\x20\x20'+a40_0x48a9eb[_0x34858a(0x131)]('~\x20'+_0x4211f9[_0x34858a(0x15e)]+'\x20changed'));if(_0x3c4f6f['length']>0x0)console['error'](_0x34858a(0x198)+a40_0x48a9eb['red']('-\x20'+_0x3c4f6f[_0x34858a(0x15e)]+_0x34858a(0x183)));else _0x51bf30[_0x34858a(0x15e)]>0x0&&!_0x25aa52['delete']&&console[_0x34858a(0x123)](_0x34858a(0x198)+a40_0x48a9eb['dim'](_0x51bf30['length']+_0x34858a(0x18f)));console['error'](_0x34858a(0x198)+a40_0x48a9eb[_0x34858a(0x173)]('=\x20'+_0x11cbeb[_0x34858a(0x15e)]+'\x20unchanged'));}_0x587c07['length']>0x0&&!_0x25aa52[_0x34858a(0x178)]&&(console[_0x34858a(0x123)](''),console[_0x34858a(0x123)](_0x34858a(0x14a)),_0xed5134['length']>0x0&&console[_0x34858a(0x123)](_0x34858a(0x198)+a40_0x48a9eb[_0x34858a(0x16f)]('+\x20'+_0xed5134[_0x34858a(0x15e)]+_0x34858a(0x174))),_0x2ce973[_0x34858a(0x15e)]>0x0&&console['error']('\x20\x20\x20\x20'+a40_0x48a9eb[_0x34858a(0x131)]('~\x20'+_0x2ce973[_0x34858a(0x15e)]+_0x34858a(0x155))),_0x4edf43[_0x34858a(0x15e)]>0x0&&console[_0x34858a(0x123)](_0x34858a(0x198)+a40_0x48a9eb['red']('-\x20'+_0x4edf43[_0x34858a(0x15e)]+_0x34858a(0x183))));console[_0x34858a(0x123)](_0x34858a(0x19c)+a40_0x48a9eb[_0x34858a(0x124)](_0x2ce77f)+'\x0a');if(_0x49cfa8[_0x34858a(0x15e)]>0x0){console[_0x34858a(0x123)](_0x34858a(0x121));for(const _0x207752 of _0x49cfa8){console[_0x34858a(0x123)]('\x20\x20'+a40_0x48a9eb[_0x34858a(0x14e)]('+')+'\x20'+_0x207752);}console[_0x34858a(0x123)]('');}if(_0x94a6a6['length']>0x0&&!_0x25aa52[_0x34858a(0x178)])for(const _0x23d97f of _0x94a6a6){const _0x29f1f3=_0x23d97f[_0x34858a(0x170)]?_0x23d97f['folderPath']+'/'+_0x23d97f[_0x34858a(0x143)][_0x34858a(0x195)]:_0x23d97f[_0x34858a(0x143)][_0x34858a(0x195)],_0x282090=_0x23d97f['yamlConfig']['activations']?.[_0x34858a(0x15e)]||0x0,_0x4efaf9=_0x282090>0x0?a40_0x48a9eb[_0x34858a(0x173)]('\x20['+_0x282090+_0x34858a(0x154)):'';console[_0x34858a(0x123)]('\x0a'+a40_0x48a9eb['green'](_0x34858a(0x199))+'\x20'+_0x29f1f3+_0x4efaf9),console['error']('β'[_0x34858a(0x197)](0x3c)),_0x23d97f[_0x34858a(0x15a)]&&console[_0x34858a(0x123)](_0x23d97f[_0x34858a(0x15a)]),console['error']('β'[_0x34858a(0x197)](0x3c));}if(_0x2ed019['length']>0x0&&!_0x25aa52[_0x34858a(0x178)])for(const _0xd129f9 of _0x2ed019){const _0x21a1a3=_0xd129f9[_0x34858a(0x1a5)]?_0x405716[_0x34858a(0x1b7)](_0xd129f9[_0x34858a(0x1a5)][_0x34858a(0x160)]())||'':'',_0x2b70b9=_0x21a1a3?_0x21a1a3+'/'+_0xd129f9[_0x34858a(0x195)]:_0xd129f9['name'],_0x454e66=_0x118e4f[_0x34858a(0x1b7)](_0xd129f9['id'])||[],_0x75353b=_0x454e66[_0x34858a(0x15e)]>0x0?a40_0x48a9eb['dim']('\x20['+_0x454e66[_0x34858a(0x15e)]+_0x34858a(0x154)):'';console[_0x34858a(0x123)]('\x0a'+a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x18d))+'\x20'+_0x2b70b9+_0x75353b),console['error']('β'[_0x34858a(0x197)](0x3c));const _0x1c98fd=segmentWithActivationsToYaml(_0xd129f9,_0x454e66,undefined,_0x15c0cb,_0x38f76b),_0x3aa7c1=segmentToYamlString(_0x1c98fd),_0x55f983=generateDiff(_0x3aa7c1,'');console[_0x34858a(0x123)](formatDiffWithColors(_0x55f983)),console[_0x34858a(0x123)]('β'[_0x34858a(0x197)](0x3c));}const _0x3b90d1=_0x990615['filter'](_0x42d6c5=>!_0x42d6c5[_0x34858a(0x1b4)]&&_0x42d6c5[_0x34858a(0x15a)]);if(_0x3b90d1[_0x34858a(0x15e)]>0x0&&!_0x25aa52['journeysOnly'])for(const _0x4e5bdd of _0x3b90d1){const _0x492399=_0x4e5bdd[_0x34858a(0x170)]?_0x4e5bdd[_0x34858a(0x170)]+'/'+_0x4e5bdd[_0x34858a(0x143)][_0x34858a(0x195)]:_0x4e5bdd[_0x34858a(0x143)][_0x34858a(0x195)];console['error']('\x0a'+a40_0x48a9eb[_0x34858a(0x131)](_0x34858a(0x13e))+'\x20'+_0x492399),console[_0x34858a(0x123)]('β'[_0x34858a(0x197)](0x3c)),console[_0x34858a(0x123)](_0x4e5bdd['diff']),console['error']('β'['repeat'](0x3c));}if(_0x287d4d[_0x34858a(0x15e)]>0x0)for(const _0x48d83c of _0x287d4d){const _0x1b230e=_0x48d83c[_0x34858a(0x170)]?_0x48d83c[_0x34858a(0x170)]+'/'+_0x48d83c[_0x34858a(0x143)]['name']:_0x48d83c[_0x34858a(0x143)][_0x34858a(0x195)];console[_0x34858a(0x123)]('\x0a'+a40_0x48a9eb[_0x34858a(0x16f)](_0x34858a(0x17c))+'\x20'+_0x1b230e),console[_0x34858a(0x123)]('β'[_0x34858a(0x197)](0x3c)),_0x48d83c['diff']&&console[_0x34858a(0x123)](_0x48d83c[_0x34858a(0x15a)]),console[_0x34858a(0x123)]('β'['repeat'](0x3c));}const _0x50a6c7=_0x40910f[_0x34858a(0x18b)](_0x531910=>!_0x531910[_0x34858a(0x1b4)]&&_0x531910['diff']);if(_0x50a6c7[_0x34858a(0x15e)]>0x0)for(const _0xcfb715 of _0x50a6c7){const _0x2563b9=_0xcfb715[_0x34858a(0x170)]?_0xcfb715[_0x34858a(0x170)]+'/'+_0xcfb715['yamlConfig']['name']:_0xcfb715['yamlConfig'][_0x34858a(0x195)];console[_0x34858a(0x123)]('\x0a'+a40_0x48a9eb[_0x34858a(0x131)](_0x34858a(0x1bd))+'\x20'+_0x2563b9),console[_0x34858a(0x123)]('β'[_0x34858a(0x197)](0x3c)),console[_0x34858a(0x123)](_0xcfb715['diff']),console[_0x34858a(0x123)]('β'[_0x34858a(0x197)](0x3c));}if(_0x3c4f6f['length']>0x0)for(const _0x488b78 of _0x3c4f6f){const _0x59d834=_0x488b78['folderId']?_0x405716[_0x34858a(0x1b7)](_0x488b78[_0x34858a(0x17f)])||'':'',_0x48c0e9=_0x59d834?_0x59d834+'/'+_0x488b78['journeyBundleName']:_0x488b78[_0x34858a(0x1b3)];console[_0x34858a(0x123)]('\x0a'+a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x12e))+'\x20'+_0x48c0e9),console[_0x34858a(0x123)]('β'[_0x34858a(0x197)](0x3c)),console['error'](a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x182))),console[_0x34858a(0x123)]('β'[_0x34858a(0x197)](0x3c));}if(_0x25aa52['dryRun'])return console['error'](a40_0x48a9eb[_0x34858a(0x131)](_0x34858a(0x189))),0x0;const _0x15f89e=_0x25aa52[_0x34858a(0x178)]?![]:_0x94a6a6['length']>0x0||_0x35a552[_0x34858a(0x15e)]>0x0||_0x2ed019[_0x34858a(0x15e)]>0x0,_0x200227=_0x287d4d[_0x34858a(0x15e)]>0x0||_0x4211f9[_0x34858a(0x15e)]>0x0||_0x3c4f6f[_0x34858a(0x15e)]>0x0,_0x57923f=_0x25aa52[_0x34858a(0x178)]?![]:_0x587c07[_0x34858a(0x15e)]>0x0,_0x21e873=_0x49cfa8[_0x34858a(0x15e)]>0x0;if(!_0x15f89e&&!_0x200227&&!_0x57923f&&!_0x21e873){const _0x43ae8e=_0x25aa52[_0x34858a(0x178)]?_0x34858a(0x1bb):_0x34858a(0x19d);console['error'](a40_0x48a9eb[_0x34858a(0x16f)](_0x43ae8e));if(_0xbfe3b6&&_0x5ab0aa[_0x34858a(0x15e)]===0x1){const _0x147c58=_0x5ab0aa[0x0];if(_0x147c58[_0x34858a(0x196)]?.['id']){const _0x326446=getConsoleNextUrl(_0x25aa52['site'],'/app/ps/'+_0xcaf669+'/e/'+_0x147c58['existingSegment']['id']+_0x34858a(0x186));console[_0x34858a(0x123)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a40_0x48a9eb['cyan'](_0x326446));}}if(_0xbfe3b6&&_0x11cbeb[_0x34858a(0x15e)]===0x1){const _0x1b1af6=_0x11cbeb[0x0];if(_0x1b1af6[_0x34858a(0x145)]?.['id']){const _0x11f1a1=getConsoleNextUrl(_0x25aa52[_0x34858a(0x152)],_0x34858a(0x138)+_0xcaf669+'/e/'+_0x1b1af6[_0x34858a(0x145)]['id']+_0x34858a(0x140));console[_0x34858a(0x123)]('\x20\x20'+a40_0x48a9eb[_0x34858a(0x124)](_0x11f1a1));}}return 0x0;}const _0x4e8411=_0x25aa52['journeysOnly']?_0x287d4d['length']+_0x4211f9[_0x34858a(0x15e)]+_0x3c4f6f[_0x34858a(0x15e)]+_0x49cfa8['length']:_0x94a6a6['length']+_0x35a552[_0x34858a(0x15e)]+_0x2ed019['length']+_0x287d4d['length']+_0x4211f9[_0x34858a(0x15e)]+_0x3c4f6f[_0x34858a(0x15e)]+_0x49cfa8[_0x34858a(0x15e)]+_0x587c07[_0x34858a(0x15e)];if(!_0x25aa52[_0x34858a(0x1bc)]&&_0x4e8411>0x0){if(!isInteractive())return console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x141)](_0x34858a(0x125)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x173)](_0x34858a(0x164))),0x1;const _0x5ce937=await confirmKey(_0x34858a(0x127)+_0x4e8411+'\x20changes?');if(!_0x5ce937)return console[_0x34858a(0x123)](a40_0x48a9eb['yellow'](_0x34858a(0x16a))),0x1;}const _0x459ff4={'withProgress':async(_0xa7b9c6,_0x36f222)=>{const _0x320d48=_0x34858a,_0x4372b2=await withSpinner(_0xa7b9c6,_0x36f222,{'verbose':_0x25aa52['verbose']});return{'data':_0x4372b2[_0x320d48(0x19a)]};},'logInfo':_0x31fad1=>console['error'](a40_0x48a9eb['blue']('β\x20'+_0x31fad1)),'logSuccess':_0x223fa9=>console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x16f)]('β\x20'+_0x223fa9)),'logWarning':_0x268db4=>console[_0x34858a(0x123)](a40_0x48a9eb['yellow']('β \x20'+_0x268db4)),'logDeleted':_0x357e1a=>console['error'](a40_0x48a9eb[_0x34858a(0x141)]('β\x20'+_0x357e1a))},_0x309b59={'segment':_0x2b9977[_0x34858a(0x14d)],'journey':_0x2b9977['journey'],'user':_0x2b9977[_0x34858a(0x18e)],'connection':_0x2b9977[_0x34858a(0x13a)]};_0x49cfa8[_0x34858a(0x15e)]>0x0&&(_0x7aad23=await executePushFolders(_0x309b59,_0x49cfa8,_0x7aad23,{'parentId':_0xcaf669},_0x459ff4));const _0x2616dc={'rootFolderId':_0x4f66f9,'folderPathToId':_0x7aad23,'folderIdToPath':_0x405716,'segmentNameToId':_0x4d8db8,'activationsBySegmentId':_0x118e4f,'emailToIdMap':_0x1a7d05,'idToEmailMap':_0x15c0cb,'connectionNameToIdMap':_0x3e8964[_0x34858a(0x15b)],'connectionIdToNameMap':_0x3e8964[_0x34858a(0x133)],'connectionNameToTypeMap':_0x20e4c2},_0xabbe11=await executePushSegments(_0x309b59,_0x25aa52[_0x34858a(0x178)]?[]:_0x990615,_0x2616dc,{'parentId':_0xcaf669},_0x459ff4),_0x7fd2fb=_0xabbe11['created'],_0x2f2df6=_0xabbe11['updated'],_0x471d08=_0xabbe11[_0x34858a(0x146)][_0x34858a(0x1ba)],_0x5d80c1=_0xabbe11[_0x34858a(0x146)][_0x34858a(0x12a)],_0x50ef08=_0xabbe11[_0x34858a(0x146)][_0x34858a(0x159)];let _0x447adb;if(_0xbfe3b6&&_0x990615[_0x34858a(0x15e)]===0x1){const _0x1e8bf6=_0x990615[0x0];_0x447adb=_0x1e8bf6[_0x34858a(0x196)]?.['id']??_0xabbe11[_0x34858a(0x193)][_0x34858a(0x1b7)](_0x1e8bf6[_0x34858a(0x143)]['name']);}const _0x1fdfe7=await executePushSegmentDeletions(_0x309b59,_0x25aa52[_0x34858a(0x178)]?[]:_0x2ed019,_0x459ff4);let _0x1a6b16=0x0,_0x2b6aef=0x0,_0x424d44=0x0;const _0x2002bc=new Map(_0x4d8db8);for(const [_0x417bb7,_0x5c34fa]of _0xabbe11[_0x34858a(0x193)]){_0x2002bc[_0x34858a(0x142)](_0x417bb7,_0x5c34fa);}if(_0x40910f['length']>0x0){const _0x567890={..._0x2616dc,'segmentNameToId':_0x2002bc,'existingSegments':_0x157eca,'activationContext':_0x4dca24},_0x33678e=await executePushJourneys(_0x309b59,_0x40910f,_0x567890,{'parentId':_0xcaf669,'rootFolderId':_0x4f66f9,'verbose':_0x25aa52[_0x34858a(0x177)]},_0x459ff4);_0x1a6b16=_0x33678e[_0x34858a(0x1ba)],_0x2b6aef=_0x33678e['updated'];if(_0xbfe3b6&&_0x33678e[_0x34858a(0x1bf)]['length']===0x1){const _0x506042=_0x33678e[_0x34858a(0x1bf)][0x0];if(_0x506042[_0x34858a(0x179)]){const _0x145d07=getConsoleNextUrl(_0x25aa52[_0x34858a(0x152)],_0x34858a(0x138)+_0xcaf669+_0x34858a(0x1c2)+_0x506042[_0x34858a(0x179)]+_0x34858a(0x140));console[_0x34858a(0x123)]('\x20\x20'+a40_0x48a9eb[_0x34858a(0x124)](_0x145d07));}}}for(const _0x618bc2 of _0x3c4f6f){console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x131)](_0x34858a(0x129)+_0x618bc2[_0x34858a(0x1b3)])),_0x424d44++;}const _0x3fa3f0=[];if(_0x7fd2fb>0x0)_0x3fa3f0[_0x34858a(0x1a3)](_0x7fd2fb+'\x20created');if(_0x2f2df6>0x0)_0x3fa3f0['push'](_0x2f2df6+_0x34858a(0x15c));if(_0x1fdfe7>0x0)_0x3fa3f0[_0x34858a(0x1a3)](_0x1fdfe7+_0x34858a(0x171));const _0x4c6b44=[];if(_0x1a6b16>0x0)_0x4c6b44[_0x34858a(0x1a3)](_0x1a6b16+_0x34858a(0x163));if(_0x2b6aef>0x0)_0x4c6b44[_0x34858a(0x1a3)](_0x2b6aef+_0x34858a(0x15c));if(_0x424d44>0x0)_0x4c6b44[_0x34858a(0x1a3)](_0x424d44+_0x34858a(0x171));const _0xcdcf4a=[];if(_0x471d08>0x0)_0xcdcf4a[_0x34858a(0x1a3)](_0x471d08+'\x20created');if(_0x5d80c1>0x0)_0xcdcf4a['push'](_0x5d80c1+_0x34858a(0x15c));if(_0x50ef08>0x0)_0xcdcf4a['push'](_0x50ef08+_0x34858a(0x171));console[_0x34858a(0x123)](a40_0x48a9eb[_0x34858a(0x16f)](_0x34858a(0x1b8)));_0x3fa3f0['length']>0x0&&!_0x25aa52[_0x34858a(0x178)]&&console[_0x34858a(0x123)](_0x34858a(0x1a0)+_0x3fa3f0[_0x34858a(0x150)](',\x20'));_0x4c6b44[_0x34858a(0x15e)]>0x0&&console[_0x34858a(0x123)](_0x34858a(0x137)+_0x4c6b44[_0x34858a(0x150)](',\x20'));_0xcdcf4a['length']>0x0&&!_0x25aa52[_0x34858a(0x178)]&&console[_0x34858a(0x123)](_0x34858a(0x1a2)+_0xcdcf4a[_0x34858a(0x150)](',\x20'));if(_0x447adb){const _0x10fdb5=getConsoleNextUrl(_0x25aa52['site'],_0x34858a(0x138)+_0xcaf669+_0x34858a(0x1c2)+_0x447adb+_0x34858a(0x186));console[_0x34858a(0x123)](_0x34858a(0x135)+a40_0x48a9eb[_0x34858a(0x124)](_0x10fdb5));}return 0x0;}}
|
|
1
|
+
const a40_0x39d805=a40_0x13d1;(function(_0x1e63e3,_0x59250d){const _0x33933a=a40_0x13d1,_0x218dbb=_0x1e63e3();while(!![]){try{const _0x28078a=-parseInt(_0x33933a(0x1d0))/0x1*(parseInt(_0x33933a(0x201))/0x2)+-parseInt(_0x33933a(0x1ad))/0x3*(-parseInt(_0x33933a(0x21c))/0x4)+-parseInt(_0x33933a(0x18c))/0x5+-parseInt(_0x33933a(0x213))/0x6+-parseInt(_0x33933a(0x1de))/0x7*(parseInt(_0x33933a(0x1a4))/0x8)+parseInt(_0x33933a(0x1b0))/0x9*(parseInt(_0x33933a(0x210))/0xa)+-parseInt(_0x33933a(0x1b3))/0xb*(-parseInt(_0x33933a(0x206))/0xc);if(_0x28078a===_0x59250d)break;else _0x218dbb['push'](_0x218dbb['shift']());}catch(_0x480aa6){_0x218dbb['push'](_0x218dbb['shift']());}}}(a40_0x2abd,0x65233));function a40_0x13d1(_0x4327dc,_0xae7e89){_0x4327dc=_0x4327dc-0x189;const _0x2abd7d=a40_0x2abd();let _0x13d1a1=_0x2abd7d[_0x4327dc];return _0x13d1a1;}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 a40_0x4837c3 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a40_0x2abd(){const _0x48716f=['\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','281270fUmaYd','\x0aβ\x20Push\x20complete','filter','176490FSmvWd','isNew','β\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20updated','\x0aError:','helpText','Push\x20','filePath','parentFolder','20yyLCer','listJourneysWithDetailsFromParentSegment','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','changed','created','idToName','no_parent','segments','476955FDesIy','\x20unchanged','audienceId','/sb/da/esr','createdSegmentIds','Aborted.','results','journeys','\x0aPush\x20summary\x20for\x20\x27','\x20\x20π\x20Segments:','journeyBundleName','\x20changed','endsWith','folderId','map','type','Delete\x20segment:','\x20new','\x20\x20Journeys:\x20','updated','verbose','Parent\x20segment:\x20','getParent','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','848vcZtvO','green','repeat','nameToId','user','data','Error\x20parsing\x20YAML:\x20','segmentFolderId','description','464451QoIVcm','resolveParentId','journeyId','45yQccsF','journeysOnly','attributes','66iBAmVD','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','length','yellow','blue','versionNumber','\x20to\x20delete','existingSegment','yamlConfig','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20','delete','Folders\x20to\x20create:','Source\x20directory:\x20','push','updatedAt','cyan','deleted','setPhase','/app/ps/','Resolving\x20parent\x20segment\x20\x27','message','\x20\x20\x20\x20','journey','dim','\x20activations]','site','New\x20journey:','\x20\x20πΊοΈ\x20\x20Journeys:','1sKboOu','listSegments','parent_name','Site:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','paused','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','all','join','Scoped\x20to\x20folder:\x20','\x20deleted','folderPath','segment:push','Error:\x20Directory\x20not\x20found:\x20','20237MHICmy','existingJourney','listActivations','\x20to\x20create','/e/','Fetching\x20existing\x20data...','toDelete','toCreate','folders','\x20\x20Activations:','error','\x0aValidation\x20failed:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','buildUserMaps','segment\x20or\x20journey','new','listFolders','New\x20segment:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Changes\x20to:','\x27...','name','No\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','journeyBundleId','set','π\x20','\x20folders\x20to\x20create','red','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','createdAt','scopedFolderPath','737434CRYGDV','execute','unchanged','\x20changes?','activations','599016TQxGfS','then','segment','nameToType','diff','\x20created','.yml','get','Preparing\x20journeys...'];a40_0x2abd=function(){return _0x48716f;};return a40_0x2abd();}export class SegmentPushCommand extends BaseCommand{[a40_0x39d805(0x1f6)]=a40_0x39d805(0x1dc);[a40_0x39d805(0x1ac)]=a40_0x39d805(0x1b4);async[a40_0x39d805(0x202)](_0x32fb42){const _0x1bcdc1=a40_0x39d805,{options:_0x30611c,args:_0x5e3b2d,tdx:_0x42cfdb}=_0x32fb42,_0x31bcea=_0x30611c,_0x52e1bb=await resolveTarget({'arg':_0x5e3b2d[0x0],'contextParent':_0x30611c['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x52e1bb))return _0x52e1bb['errorCode']===_0x1bcdc1(0x18a)?(console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1d4))),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1f8)),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1ea)),console[_0x1bcdc1(0x1e8)]('\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['error'](a40_0x4837c3['red'](_0x1bcdc1(0x1bd)+_0x52e1bb[_0x1bcdc1(0x1c8)]+'\x0a')),_0x52e1bb[_0x1bcdc1(0x218)]&&console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x52e1bb[_0x1bcdc1(0x218)]))),0x1;if(_0x52e1bb[_0x1bcdc1(0x19b)]===_0x1bcdc1(0x1d2))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1dd)+_0x52e1bb['targetDir']+'\x0a')),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1c3)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xcc4312=_0x52e1bb['parentName'],_0x19284e=_0x52e1bb['targetDir'],_0x47bc84=_0x52e1bb[_0x1bcdc1(0x19b)]==='file'?_0x52e1bb[_0x1bcdc1(0x21a)]:undefined,_0x5c905b=getScopedDetails(_0x52e1bb),_0x124606=_0x5c905b?.['isScoped']??![],_0x37bd7c=_0x5c905b?.[_0x1bcdc1(0x200)]??'';if(!existsSync(_0x19284e))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1dd)+_0x19284e+'\x0a')),console[_0x1bcdc1(0x1e8)](a40_0x4837c3['cyan'](_0x1bcdc1(0x1a3))),0x1;_0x31bcea[_0x1bcdc1(0x1a0)]&&(console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1d3)+_0x31bcea[_0x1bcdc1(0x1cd)]),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1a1)+_0xcc4312),console['error'](_0x1bcdc1(0x1c0)+_0x19284e),_0x124606&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1d9)+_0x37bd7c));const _0x546640=await withSpinner(_0x1bcdc1(0x1c7)+_0xcc4312+_0x1bcdc1(0x1f5),()=>_0x42cfdb[_0x1bcdc1(0x208)][_0x1bcdc1(0x1ae)](_0xcc4312),{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]}),_0x3238ce=_0x546640[_0x1bcdc1(0x1a9)],{parentSegmentResult:_0x2c7464,segmentsResult:_0x372d83,foldersResult:_0x1917b6,journeysWithDetailsResult:_0x1f9c40,userMaps:_0x31b8ed}=await withSpinner(_0x1bcdc1(0x1e3),async()=>{const _0x22f16d=_0x1bcdc1,[_0x230827,_0x255dc3,_0x43c163,_0x46a11a,_0x49a25f]=await Promise[_0x22f16d(0x1d7)]([_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1a2)](_0x3238ce),_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1d1)](_0x3238ce),_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1f1)](_0x3238ce),_0x42cfdb[_0x22f16d(0x1ca)][_0x22f16d(0x21d)](_0x3238ce,{'includeAllVersions':!![]}),_0x42cfdb[_0x22f16d(0x1a8)][_0x22f16d(0x1ee)]()]);return{'parentSegmentResult':_0x230827,'segmentsResult':_0x255dc3,'foldersResult':_0x43c163,'journeysWithDetailsResult':_0x46a11a,'userMaps':_0x49a25f};},{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]})['then'](_0x4ec8aa=>_0x4ec8aa[_0x1bcdc1(0x1a9)]),_0x26fd00=_0x2c7464,_0x108e70=extractRootFolderId(_0x26fd00),_0x45ffa8=_0x372d83,_0x22b156=_0x1917b6,{journeys:_0x4d1f95,activationStepsById:_0x572606}=_0x1f9c40,_0x53e8c3=new Map(_0x4d1f95[_0x1bcdc1(0x19a)](_0x34b3e9=>[_0x34b3e9['id'],_0x34b3e9])),_0x2dc2bb=_0x4d1f95[_0x1bcdc1(0x19a)](_0x297e3b=>({'id':_0x297e3b['id'],'name':_0x297e3b['attributes'][_0x1bcdc1(0x1f6)],'journeyBundleName':_0x297e3b['attributes'][_0x1bcdc1(0x196)]||'','journeyBundleId':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1f9)]||'','versionNumber':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1b8)],'description':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1ac)],'state':_0x297e3b['attributes']['state'],'paused':_0x297e3b['attributes'][_0x1bcdc1(0x1d5)],'audienceId':_0x297e3b['attributes'][_0x1bcdc1(0x18e)],'folderId':_0x297e3b['relationships']?.[_0x1bcdc1(0x21b)]?.[_0x1bcdc1(0x1a9)]?.['id'],'createdAt':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1ff)],'updatedAt':_0x297e3b['attributes'][_0x1bcdc1(0x1c2)]})),{emailToId:_0x185af7,idToEmail:_0x206cde}=_0x31b8ed,_0x1e11c3=await withSpinner(_0x1bcdc1(0x1ec),async()=>{const _0x3e3ba2=await _0x42cfdb['connection']['list']();return buildConnectionMaps(_0x3e3ba2);},{'verbose':_0x31bcea['verbose']})[_0x1bcdc1(0x207)](_0x4121fa=>_0x4121fa['data']),_0x2f9d3f=_0x1e11c3[_0x1bcdc1(0x1a7)],_0x51d8ce=_0x1e11c3[_0x1bcdc1(0x189)],_0x1e02e8=_0x1e11c3[_0x1bcdc1(0x209)],_0x4b6f2b={'emailToIdMap':_0x185af7,'connectionNameToIdMap':_0x2f9d3f,'connectionNameToTypeMap':_0x1e02e8,'getSchema':_0x3aefad=>_0x42cfdb['connection']['getOutputSchemaWithCache'](_0x3aefad)};let {pathToId:_0xf45865,idToPath:_0x4a8924}=buildFolderMaps(_0x22b156);const _0x174575=buildSegmentLookupMap(_0x45ffa8,_0x4a8924),_0x12a00b=buildSegmentNameToIdMap(_0x45ffa8),_0x23cb83=buildJourneyBundleLookupMap(_0x2dc2bb,_0x4a8924);let _0x3a58d4;if(_0x47bc84){if(!_0x47bc84[_0x1bcdc1(0x198)](_0x1bcdc1(0x20c))&&!_0x47bc84[_0x1bcdc1(0x198)]('.yaml'))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x21e)+_0x47bc84+'\x0a')),0x1;_0x3a58d4=[_0x47bc84];}else _0x3a58d4=findYamlFiles(_0x19284e);if(_0x3a58d4[_0x1bcdc1(0x1b5)]===0x0)return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1eb)+_0x19284e+'\x0a')),console['error'](a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1bcdc1(0x1ed))),0x1;let _0x32fdda,_0x1406b9;try{const _0x30e730=parseAndClassifyYamlFiles(_0x3a58d4,_0x19284e,{'skipSegments':_0x31bcea['journeysOnly']});_0x32fdda=_0x30e730[_0x1bcdc1(0x18b)],_0x1406b9=_0x30e730[_0x1bcdc1(0x193)];const _0x527a03=validateParsedFiles(_0x30e730,_0x19284e);if(_0x527a03[_0x1bcdc1(0x1b5)]>0x0)return console['error'](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1e9))),console['error'](formatValidationErrors(_0x527a03)),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x123f56){return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1aa)+(_0x123f56 instanceof Error?_0x123f56['message']:_0x123f56))),0x1;}if(_0x32fdda['length']===0x0&&_0x1406b9[_0x1bcdc1(0x1b5)]===0x0){const _0x1322c5=_0x31bcea['journeysOnly']?_0x1bcdc1(0x1ca):_0x1bcdc1(0x1ef);return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1f7)+_0x1322c5+'\x20YAML\x20files\x20found')),0x0;}const _0x2fa760=new Map();_0x45ffa8[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x45ffa8,async _0x5e1bb4=>{const _0x3c8d9d=a40_0x13d1,_0x380ca0=await _0x42cfdb[_0x3c8d9d(0x208)][_0x3c8d9d(0x1e0)](_0x3238ce,_0x5e1bb4['id']);_0x2fa760[_0x3c8d9d(0x1fa)](_0x5e1bb4['id'],_0x380ca0);});},{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]});const {segmentFiles:_0x3e2e0b,foldersToCreate:_0x4fb853}=await prepareSegmentFiles(_0x32fdda,{'segmentByFolderAndName':_0x174575,'activationsBySegmentId':_0x2fa760,'folderPathToId':_0xf45865,'idToEmailMap':_0x206cde,'connectionIdToNameMap':_0x51d8ce},_0x4b6f2b,_0x124606,_0x37bd7c),_0x5b7dba=_0x47bc84?[]:findSegmentsToDelete(_0x45ffa8,_0x32fdda['map'](({yamlConfig:_0xb99739,folderPath:_0x400005})=>({'yamlConfig':_0xb99739,'folderPath':resolveTDFolderPath(_0x400005,_0x124606,_0x37bd7c)})),_0x4a8924,_0x37bd7c,_0x124606),{journeyFiles:_0x24e58a,foldersToCreate:_0x2d024a}=await withProgressSpinner(_0x1bcdc1(0x20e),async _0x64ea93=>prepareJourneyFiles(_0x1406b9,{'fetchJourney':async _0x3cfade=>_0x42cfdb[_0x1bcdc1(0x1ca)]['getJourney'](_0x3cfade[_0x1bcdc1(0x1af)]),'journeyBundlesByFolderAndName':_0x23cb83,'folderPathToId':_0xf45865,'idToEmailMap':_0x206cde,'connectionIdToNameMap':_0x51d8ce,'existingSegments':_0x45ffa8,'parentId':_0x3238ce,'deps':_0x42cfdb,'progress':{'update':_0x2b399c=>{const _0x384b2c=_0x1bcdc1;_0x64ea93[_0x384b2c(0x1c5)](_0x2b399c),_0x31bcea[_0x384b2c(0x1a0)]&&console[_0x384b2c(0x1e8)]('\x20\x20'+_0x2b399c);}},'journeyById':_0x53e8c3,'activationStepsById':_0x572606},_0x124606,_0x37bd7c),{'verbose':_0x31bcea['verbose']})[_0x1bcdc1(0x207)](_0x4a0a91=>_0x4a0a91[_0x1bcdc1(0x1a9)]);for(const _0x37ba19 of _0x2d024a){_0x4fb853['add'](_0x37ba19);}const _0x38b090=_0x47bc84?[]:findJourneysToDelete(_0x2dc2bb,_0x1406b9[_0x1bcdc1(0x19a)](({yamlConfig:_0x3b9c24,folderPath:_0x30d8f8})=>({'yamlConfig':_0x3b9c24,'folderPath':resolveTDFolderPath(_0x30d8f8,_0x124606,_0x37bd7c)})),_0x4a8924,_0x37bd7c,_0x124606),_0x3bfc94=calculatePushStats(_0x3e2e0b,_0x24e58a,_0x4fb853,_0x5b7dba,_0x38b090,!!_0x31bcea[_0x1bcdc1(0x1be)],!!_0x31bcea[_0x1bcdc1(0x1b1)]),_0x13c798=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x1f0)],_0x82e2ca=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x21f)],_0x4d1006=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x203)],_0xf76b87=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x1e4)],_0x1490d9=_0x3bfc94[_0x1bcdc1(0x1e6)][_0x1bcdc1(0x1e5)],_0x5e97c3=_0x3bfc94[_0x1bcdc1(0x193)][_0x1bcdc1(0x1f0)],_0x264b3b=_0x3bfc94[_0x1bcdc1(0x193)]['changed'],_0x4acd5b=_0x3bfc94[_0x1bcdc1(0x193)]['unchanged'],_0x3fb1be=_0x3bfc94['journeys']['toDelete'],_0x187096=_0x3bfc94[_0x1bcdc1(0x205)][_0x1bcdc1(0x1d7)],_0x8d97ac=_0x3bfc94['activations'][_0x1bcdc1(0x1e5)],_0x3a3b99=_0x3bfc94[_0x1bcdc1(0x205)]['toUpdate'],_0x49eeeb=_0x3bfc94['activations']['toDelete'];console['error'](_0x1bcdc1(0x194)+_0xcc4312+'\x27:');_0x1490d9[_0x1bcdc1(0x1b5)]>0x0&&console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1b7)](_0x1bcdc1(0x1fb)+_0x1490d9[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1fc)));if(!_0x31bcea[_0x1bcdc1(0x1b1)]){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x195)),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['green']('+\x20'+_0x13c798['length']+_0x1bcdc1(0x19d))),console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x82e2ca['length']+_0x1bcdc1(0x197)));if(_0xf76b87['length']>0x0)console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['red']('-\x20'+_0xf76b87[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9)));else _0x5b7dba[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea['delete']&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)](_0x5b7dba[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x20f)));console[_0x1bcdc1(0x1e8)]('\x20\x20\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1cb)]('=\x20'+_0x4d1006[_0x1bcdc1(0x1b5)]+'\x20unchanged'));}if(_0x24e58a[_0x1bcdc1(0x1b5)]>0x0||_0x38b090[_0x1bcdc1(0x1b5)]>0x0){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1cf)),console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1a5)]('+\x20'+_0x5e97c3[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x19d))),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x264b3b[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x197)));if(_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0)console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['red']('-\x20'+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9)));else _0x38b090[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1be)]&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)](_0x38b090[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x20f)));console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)]('=\x20'+_0x4acd5b['length']+_0x1bcdc1(0x18d)));}_0x187096[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&(console[_0x1bcdc1(0x1e8)](''),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1e7)),_0x8d97ac[_0x1bcdc1(0x1b5)]>0x0&&console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1a5)]('+\x20'+_0x8d97ac[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1e1))),_0x3a3b99['length']>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x3a3b99['length']+'\x20to\x20update')),_0x49eeeb['length']>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1fd)]('-\x20'+_0x49eeeb[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9))));console[_0x1bcdc1(0x1e8)]('\x20\x20Source:\x20'+a40_0x4837c3['cyan'](_0x19284e)+'\x0a');if(_0x1490d9[_0x1bcdc1(0x1b5)]>0x0){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1bf));for(const _0x31740b of _0x1490d9){console['error']('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1b7)]('+')+'\x20'+_0x31740b);}console[_0x1bcdc1(0x1e8)]('');}if(_0x13c798['length']>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x205286 of _0x13c798){const _0x389f96=_0x205286[_0x1bcdc1(0x1db)]?_0x205286['folderPath']+'/'+_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]:_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)],_0x161b7f=_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x205)]?.['length']||0x0,_0x2c9e9d=_0x161b7f>0x0?a40_0x4837c3['dim']('\x20['+_0x161b7f+_0x1bcdc1(0x1cc)):'';console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x1f2))+'\x20'+_0x389f96+_0x2c9e9d),console[_0x1bcdc1(0x1e8)]('β'[_0x1bcdc1(0x1a6)](0x3c)),_0x205286[_0x1bcdc1(0x20a)]&&console[_0x1bcdc1(0x1e8)](_0x205286['diff']),console[_0x1bcdc1(0x1e8)]('β'[_0x1bcdc1(0x1a6)](0x3c));}if(_0xf76b87[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x5570bc of _0xf76b87){const _0x4c73de=_0x5570bc['segmentFolderId']?_0x4a8924[_0x1bcdc1(0x20d)](_0x5570bc[_0x1bcdc1(0x1ab)]['toString']())||'':'',_0xfc70c8=_0x4c73de?_0x4c73de+'/'+_0x5570bc[_0x1bcdc1(0x1f6)]:_0x5570bc[_0x1bcdc1(0x1f6)],_0x4dcbdf=_0x2fa760[_0x1bcdc1(0x20d)](_0x5570bc['id'])||[],_0x43cc01=_0x4dcbdf[_0x1bcdc1(0x1b5)]>0x0?a40_0x4837c3['dim']('\x20['+_0x4dcbdf['length']+_0x1bcdc1(0x1cc)):'';console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3['red'](_0x1bcdc1(0x19c))+'\x20'+_0xfc70c8+_0x43cc01),console[_0x1bcdc1(0x1e8)]('β'['repeat'](0x3c));const _0x37e9b3=segmentWithActivationsToYaml(_0x5570bc,_0x4dcbdf,undefined,_0x206cde,_0x51d8ce),_0x473231=segmentToYamlString(_0x37e9b3),_0x1f8546=generateDiff(_0x473231,'');console[_0x1bcdc1(0x1e8)](formatDiffWithColors(_0x1f8546)),console[_0x1bcdc1(0x1e8)]('β'[_0x1bcdc1(0x1a6)](0x3c));}const _0x505e8e=_0x3e2e0b[_0x1bcdc1(0x212)](_0x1c58eb=>!_0x1c58eb['isNew']&&_0x1c58eb[_0x1bcdc1(0x20a)]);if(_0x505e8e[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x45a68a of _0x505e8e){const _0x31985c=_0x45a68a[_0x1bcdc1(0x1db)]?_0x45a68a[_0x1bcdc1(0x1db)]+'/'+_0x45a68a['yamlConfig'][_0x1bcdc1(0x1f6)]:_0x45a68a['yamlConfig'][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1f4))+'\x20'+_0x31985c),console[_0x1bcdc1(0x1e8)]('β'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](_0x45a68a[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('β'['repeat'](0x3c));}if(_0x5e97c3[_0x1bcdc1(0x1b5)]>0x0)for(const _0xd69c25 of _0x5e97c3){const _0x35e55a=_0xd69c25[_0x1bcdc1(0x1db)]?_0xd69c25[_0x1bcdc1(0x1db)]+'/'+_0xd69c25[_0x1bcdc1(0x1bb)]['name']:_0xd69c25[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x1ce))+'\x20'+_0x35e55a),console[_0x1bcdc1(0x1e8)]('β'['repeat'](0x3c)),_0xd69c25[_0x1bcdc1(0x20a)]&&console['error'](_0xd69c25[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('β'['repeat'](0x3c));}const _0x5b2e89=_0x24e58a[_0x1bcdc1(0x212)](_0x465074=>!_0x465074[_0x1bcdc1(0x214)]&&_0x465074[_0x1bcdc1(0x20a)]);if(_0x5b2e89[_0x1bcdc1(0x1b5)]>0x0)for(const _0x2127df of _0x5b2e89){const _0x18f78b=_0x2127df[_0x1bcdc1(0x1db)]?_0x2127df[_0x1bcdc1(0x1db)]+'/'+_0x2127df[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]:_0x2127df[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1b6)]('Changes\x20to\x20journey:')+'\x20'+_0x18f78b),console[_0x1bcdc1(0x1e8)]('β'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](_0x2127df[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('β'[_0x1bcdc1(0x1a6)](0x3c));}if(_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0)for(const _0x454b0e of _0x3fb1be){const _0x376453=_0x454b0e['folderId']?_0x4a8924[_0x1bcdc1(0x20d)](_0x454b0e[_0x1bcdc1(0x199)])||'':'',_0x246c99=_0x376453?_0x376453+'/'+_0x454b0e[_0x1bcdc1(0x196)]:_0x454b0e['journeyBundleName'];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1fd)]('Delete\x20journey:')+'\x20'+_0x246c99),console[_0x1bcdc1(0x1e8)]('β'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)]('(Journey\x20will\x20be\x20deleted)')),console['error']('β'[_0x1bcdc1(0x1a6)](0x3c));}if(_0x31bcea['dryRun'])return console['error'](a40_0x4837c3[_0x1bcdc1(0x1b6)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x9ce6f4=_0x31bcea[_0x1bcdc1(0x1b1)]?![]:_0x13c798[_0x1bcdc1(0x1b5)]>0x0||_0x82e2ca[_0x1bcdc1(0x1b5)]>0x0||_0xf76b87['length']>0x0,_0xfa84e=_0x5e97c3[_0x1bcdc1(0x1b5)]>0x0||_0x264b3b[_0x1bcdc1(0x1b5)]>0x0||_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0,_0x153e12=_0x31bcea[_0x1bcdc1(0x1b1)]?![]:_0x187096['length']>0x0,_0x177f5c=_0x1490d9[_0x1bcdc1(0x1b5)]>0x0;if(!_0x9ce6f4&&!_0xfa84e&&!_0x153e12&&!_0x177f5c){const _0x38f166=_0x31bcea[_0x1bcdc1(0x1b1)]?_0x1bcdc1(0x215):_0x1bcdc1(0x1fe);console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x38f166));if(_0x47bc84&&_0x4d1006[_0x1bcdc1(0x1b5)]===0x1){const _0x469a29=_0x4d1006[0x0];if(_0x469a29['existingSegment']?.['id']){const _0x25f2d9=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],_0x1bcdc1(0x1c6)+_0x3238ce+'/e/'+_0x469a29[_0x1bcdc1(0x1ba)]['id']+'/sb/da/esr');console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1f3)+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x25f2d9));}}if(_0x47bc84&&_0x4acd5b[_0x1bcdc1(0x1b5)]===0x1){const _0x248e34=_0x4acd5b[0x0];if(_0x248e34['existingJourney']?.['id']){const _0x5c1d8c=getConsoleNextUrl(_0x31bcea['site'],_0x1bcdc1(0x1c6)+_0x3238ce+'/e/'+_0x248e34[_0x1bcdc1(0x1df)]['id']+'/j/da/je');console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x5c1d8c));}}return 0x0;}const _0x5b5f0a=_0x31bcea[_0x1bcdc1(0x1b1)]?_0x5e97c3['length']+_0x264b3b[_0x1bcdc1(0x1b5)]+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1490d9[_0x1bcdc1(0x1b5)]:_0x13c798[_0x1bcdc1(0x1b5)]+_0x82e2ca[_0x1bcdc1(0x1b5)]+_0xf76b87[_0x1bcdc1(0x1b5)]+_0x5e97c3[_0x1bcdc1(0x1b5)]+_0x264b3b['length']+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1490d9[_0x1bcdc1(0x1b5)]+_0x187096[_0x1bcdc1(0x1b5)];if(!_0x31bcea['yes']&&_0x5b5f0a>0x0){if(!isInteractive())return console['error'](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x217)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1bcdc1(0x1e8)](a40_0x4837c3['dim'](_0x1bcdc1(0x1bc))),0x1;const _0x3b8d66=await confirmKey(_0x1bcdc1(0x219)+_0x5b5f0a+_0x1bcdc1(0x204));if(!_0x3b8d66)return console[_0x1bcdc1(0x1e8)](a40_0x4837c3['yellow'](_0x1bcdc1(0x191))),0x1;}const _0x22224f={'withProgress':async(_0x46a6c6,_0x4bc09b)=>{const _0x564547=_0x1bcdc1,_0x1d0d88=await withSpinner(_0x46a6c6,_0x4bc09b,{'verbose':_0x31bcea[_0x564547(0x1a0)]});return{'data':_0x1d0d88[_0x564547(0x1a9)]};},'logInfo':_0x5332c1=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3['blue']('β\x20'+_0x5332c1)),'logSuccess':_0x2fe6f3=>console['error'](a40_0x4837c3[_0x1bcdc1(0x1a5)]('β\x20'+_0x2fe6f3)),'logWarning':_0x4fda3e=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)]('β \x20'+_0x4fda3e)),'logDeleted':_0x5f5cbb=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)]('β\x20'+_0x5f5cbb))},_0x23a61a={'segment':_0x42cfdb[_0x1bcdc1(0x208)],'journey':_0x42cfdb[_0x1bcdc1(0x1ca)],'user':_0x42cfdb[_0x1bcdc1(0x1a8)],'connection':_0x42cfdb['connection']};_0x1490d9['length']>0x0&&(_0xf45865=await executePushFolders(_0x23a61a,_0x1490d9,_0xf45865,{'parentId':_0x3238ce},_0x22224f));const _0x321cff={'rootFolderId':_0x108e70,'folderPathToId':_0xf45865,'folderIdToPath':_0x4a8924,'segmentNameToId':_0x12a00b,'activationsBySegmentId':_0x2fa760,'emailToIdMap':_0x185af7,'idToEmailMap':_0x206cde,'connectionNameToIdMap':_0x1e11c3['nameToId'],'connectionIdToNameMap':_0x1e11c3[_0x1bcdc1(0x189)],'connectionNameToTypeMap':_0x1e02e8},_0x30aed2=await executePushSegments(_0x23a61a,_0x31bcea[_0x1bcdc1(0x1b1)]?[]:_0x3e2e0b,_0x321cff,{'parentId':_0x3238ce},_0x22224f),_0x26da45=_0x30aed2['created'],_0x23ea77=_0x30aed2[_0x1bcdc1(0x19f)],_0x870350=_0x30aed2[_0x1bcdc1(0x205)]['created'],_0x9b57cf=_0x30aed2[_0x1bcdc1(0x205)]['updated'],_0x2e1f64=_0x30aed2['activations'][_0x1bcdc1(0x1c4)];let _0x1b9846;if(_0x47bc84&&_0x3e2e0b[_0x1bcdc1(0x1b5)]===0x1){const _0x1a0b48=_0x3e2e0b[0x0];_0x1b9846=_0x1a0b48['existingSegment']?.['id']??_0x30aed2[_0x1bcdc1(0x190)][_0x1bcdc1(0x20d)](_0x1a0b48[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]);}const _0x3ae8de=await executePushSegmentDeletions(_0x23a61a,_0x31bcea['journeysOnly']?[]:_0xf76b87,_0x22224f);let _0x35e863=0x0,_0x2b18e4=0x0,_0x32c02e=0x0;const _0x33ab66=new Map(_0x12a00b);for(const [_0x7cbd83,_0x20ff54]of _0x30aed2['createdSegmentIds']){_0x33ab66[_0x1bcdc1(0x1fa)](_0x7cbd83,_0x20ff54);}if(_0x24e58a[_0x1bcdc1(0x1b5)]>0x0){const _0x180a07={..._0x321cff,'segmentNameToId':_0x33ab66,'existingSegments':_0x45ffa8,'activationContext':_0x4b6f2b},_0x38871f=await executePushJourneys(_0x23a61a,_0x24e58a,_0x180a07,{'parentId':_0x3238ce,'rootFolderId':_0x108e70,'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]},_0x22224f);_0x35e863=_0x38871f[_0x1bcdc1(0x220)],_0x2b18e4=_0x38871f['updated'];if(_0x47bc84&&_0x38871f[_0x1bcdc1(0x192)][_0x1bcdc1(0x1b5)]===0x1){const _0x290c77=_0x38871f[_0x1bcdc1(0x192)][0x0];if(_0x290c77[_0x1bcdc1(0x1af)]){const _0x1ecb2e=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],'/app/ps/'+_0x3238ce+_0x1bcdc1(0x1e2)+_0x290c77['journeyId']+'/j/da/je');console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1ecb2e));}}}for(const _0x468889 of _0x3fb1be){console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1d6)+_0x468889[_0x1bcdc1(0x196)])),_0x32c02e++;}const _0x4ccaae=[];if(_0x26da45>0x0)_0x4ccaae[_0x1bcdc1(0x1c1)](_0x26da45+_0x1bcdc1(0x20b));if(_0x23ea77>0x0)_0x4ccaae['push'](_0x23ea77+_0x1bcdc1(0x216));if(_0x3ae8de>0x0)_0x4ccaae[_0x1bcdc1(0x1c1)](_0x3ae8de+_0x1bcdc1(0x1da));const _0x444ae0=[];if(_0x35e863>0x0)_0x444ae0[_0x1bcdc1(0x1c1)](_0x35e863+_0x1bcdc1(0x20b));if(_0x2b18e4>0x0)_0x444ae0[_0x1bcdc1(0x1c1)](_0x2b18e4+_0x1bcdc1(0x216));if(_0x32c02e>0x0)_0x444ae0['push'](_0x32c02e+'\x20deleted');const _0x1992c8=[];if(_0x870350>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x870350+_0x1bcdc1(0x20b));if(_0x9b57cf>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x9b57cf+'\x20updated');if(_0x2e1f64>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x2e1f64+_0x1bcdc1(0x1da));console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x211)));_0x4ccaae[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&console[_0x1bcdc1(0x1e8)]('\x20\x20Segments:\x20'+_0x4ccaae['join'](',\x20'));_0x444ae0[_0x1bcdc1(0x1b5)]>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x19e)+_0x444ae0[_0x1bcdc1(0x1d8)](',\x20'));_0x1992c8['length']>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&console[_0x1bcdc1(0x1e8)]('\x20\x20Activations:\x20'+_0x1992c8[_0x1bcdc1(0x1d8)](',\x20'));if(_0x1b9846){const _0x1bdc08=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],'/app/ps/'+_0x3238ce+_0x1bcdc1(0x1e2)+_0x1b9846+_0x1bcdc1(0x18f));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1bdc08));}return 0x0;}}
|