@treasuredata/tdx 0.28.0 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-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.d.ts +6 -0
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/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/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 a30_0x272bc8=a30_0x50d9;(function(_0x3cb466,_0x3991fc){const _0x502f1a=a30_0x50d9,_0x2cc3ac=_0x3cb466();while(!![]){try{const _0x50796c=-parseInt(_0x502f1a(0xfe))/0x1+parseInt(_0x502f1a(0x161))/0x2+-parseInt(_0x502f1a(0x15b))/0x3+parseInt(_0x502f1a(0xe7))/0x4*(parseInt(_0x502f1a(0x154))/0x5)+parseInt(_0x502f1a(0x127))/0x6+-parseInt(_0x502f1a(0x101))/0x7*(parseInt(_0x502f1a(0x12f))/0x8)+parseInt(_0x502f1a(0x137))/0x9*(parseInt(_0x502f1a(0xeb))/0xa);if(_0x50796c===_0x3991fc)break;else _0x2cc3ac['push'](_0x2cc3ac['shift']());}catch(_0xfd2c42){_0x2cc3ac['push'](_0x2cc3ac['shift']());}}}(a30_0x1e3d,0xbe7b3));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';function a30_0x50d9(_0x5e5572,_0x3e652e){_0x5e5572=_0x5e5572-0xda;const _0x1e3da7=a30_0x1e3d();let _0x50d91d=_0x1e3da7[_0x5e5572];return _0x50d91d;}import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x211e6f from'chalk';function formatRelativeTime(_0x5dc300){const _0x5a7e52=a30_0x50d9,_0x56861e=new Date(_0x5dc300),_0x9efc54=new Date(),_0x20e47f=_0x56861e[_0x5a7e52(0xfc)]()-_0x9efc54['getTime'](),_0x9a5c4b=Math[_0x5a7e52(0x117)](_0x20e47f)/0x3e8,_0x161a3f=_0x20e47f<0x0;if(_0x9a5c4b<0x3c)return _0x161a3f?_0x5a7e52(0x156):_0x5a7e52(0xdf);else{if(_0x9a5c4b<0xe10){const _0x24a0de=Math['round'](_0x9a5c4b/0x3c);return _0x161a3f?_0x24a0de+_0x5a7e52(0x12e):_0x5a7e52(0x13d)+_0x24a0de+'m';}else{if(_0x9a5c4b<0x15180){const _0x2a2613=Math['round'](_0x9a5c4b/0xe10);return _0x161a3f?_0x2a2613+'h\x20ago':_0x5a7e52(0x13d)+_0x2a2613+'h';}else{if(_0x9a5c4b<0x93a80){const _0x478503=Math[_0x5a7e52(0x14e)](_0x9a5c4b/0x15180);return _0x161a3f?_0x478503+'d\x20ago':_0x5a7e52(0x13d)+_0x478503+'d';}else return _0x56861e[_0x5a7e52(0x150)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x272bc8(0x14b)]='schedule:list';[a30_0x272bc8(0x16a)]=a30_0x272bc8(0x15d);async['execute'](_0x1c6f72){const _0x2ed580=a30_0x272bc8,{options:_0x31ea89,args:_0x1104da,tdx:_0x250c7c}=_0x1c6f72,_0x1756cd=resolveLimit(_0x31ea89['limit'],DEFAULT_DISPLAY_LIMIT),_0xcabf4a=_0x1104da[0x0],_0x5c9de4=_0xcabf4a?_0x2ed580(0x153)+_0xcabf4a+_0x2ed580(0xfa):_0x2ed580(0x108),_0x4b09d6=await withSpinner(_0x5c9de4,()=>_0x250c7c[_0x2ed580(0xf1)][_0x2ed580(0x15e)]({'limit':_0x1756cd,'scheduled':!![],'pattern':_0xcabf4a}),{'verbose':_0x31ea89['verbose']}),_0xc81a11=_0x4b09d6[_0x2ed580(0x11e)]['queries'],_0x561a11=_0x4b09d6['data'][_0x2ed580(0x11c)][_0x2ed580(0x14a)],_0xd42eae=_0xcabf4a?_0x2ed580(0x109)+_0xcabf4a+'\x22':'';_0x561a11?console['error'](_0x2ed580(0x15f)+_0xc81a11[_0x2ed580(0x11f)]+_0x2ed580(0x132)+_0xd42eae+_0x2ed580(0x124)):console[_0x2ed580(0x10d)](_0x2ed580(0xf6)+_0xc81a11[_0x2ed580(0x11f)]+_0x2ed580(0x12c)+(_0xc81a11[_0x2ed580(0x11f)]!==0x1?_0x2ed580(0x12b):'y')+_0xd42eae);if(_0x31ea89['format']===_0x2ed580(0x158)||_0x31ea89[_0x2ed580(0x14f)]===_0x2ed580(0xe1)||_0x31ea89[_0x2ed580(0x14f)]===_0x2ed580(0x163)||_0x31ea89['format']===_0x2ed580(0x103)){const _0xbfc8ac=_0xc81a11[_0x2ed580(0x152)](_0x335834=>({'id':_0x335834['id'],'name':_0x335834[_0x2ed580(0x14b)],'cron':_0x335834[_0x2ed580(0xef)],'database':_0x335834[_0x2ed580(0x11a)]?.[_0x2ed580(0x14b)],'type':_0x335834[_0x2ed580(0x102)],'timezone':_0x335834[_0x2ed580(0x147)],'user_name':_0x335834[_0x2ed580(0x12d)]?.[_0x2ed580(0x14b)],'updated_at':_0x335834[_0x2ed580(0x166)],'next_run_at':_0x335834[_0x2ed580(0x118)],'last_job_status':_0x335834[_0x2ed580(0xe3)]?.['status']}));await handleSDKOutput(_0xbfc8ac,_0x31ea89);}else{if(_0xc81a11[_0x2ed580(0x11f)]===0x0)console[_0x2ed580(0x125)](_0x2ed580(0x144));else{const _0x5be640=_0x31ea89['site'],_0x4b360e=_0xc81a11['map'](_0x487e50=>{const _0x3fba1b=_0x2ed580,_0x5f2ec4=_0x487e50[_0x3fba1b(0xe3)]?.['status']?_0x487e50['last_job'][_0x3fba1b(0x133)]===_0x3fba1b(0x16c)?'✓':'✗':'-',_0x430c83=_0x487e50[_0x3fba1b(0xe3)]?.['ended_at']?formatRelativeTime(_0x487e50['last_job'][_0x3fba1b(0x116)]):_0x3fba1b(0x15a),_0x37a149=_0x487e50[_0x3fba1b(0x118)]?formatRelativeTime(_0x487e50[_0x3fba1b(0x118)]):'-',_0x12918b=_0x487e50[_0x3fba1b(0xef)]||'',_0xfb1dce=_0x487e50[_0x3fba1b(0x14b)]||_0x3fba1b(0x155),_0x32a3f0=getConsoleUrl(_0x5be640,_0x3fba1b(0x13b)+_0x487e50['id']);return{'statusIcon':_0x5f2ec4,'lastRun':_0x430c83,'nextRun':_0x37a149,'cron':_0x12918b,'name':_0xfb1dce,'queryUrl':_0x32a3f0,'status':_0x487e50['last_job']?.[_0x3fba1b(0x133)]};}),_0x3f6192=Math[_0x2ed580(0x136)](..._0x4b360e[_0x2ed580(0x152)](_0x4c7eda=>_0x4c7eda[_0x2ed580(0xdb)][_0x2ed580(0x11f)])),_0x3f24ae=Math[_0x2ed580(0x136)](..._0x4b360e['map'](_0x21ee87=>_0x21ee87[_0x2ed580(0x164)]['length'])),_0x4e28fc=Math[_0x2ed580(0x136)](..._0x4b360e[_0x2ed580(0x152)](_0x411cd5=>_0x411cd5['cron'][_0x2ed580(0x11f)])),_0x2fb13c=_0x4b360e[_0x2ed580(0x152)](_0x1f24c3=>{const _0x52ce08=_0x2ed580,_0x5bdaae=_0x1f24c3['status']===_0x52ce08(0x16c)?a30_0x211e6f[_0x52ce08(0x111)](_0x1f24c3[_0x52ce08(0xe8)]):_0x1f24c3[_0x52ce08(0x133)]===_0x52ce08(0x10d)?a30_0x211e6f[_0x52ce08(0x134)](_0x1f24c3['statusIcon']):a30_0x211e6f['dim'](_0x1f24c3[_0x52ce08(0xe8)]),_0x45bc0d=_0x1f24c3[_0x52ce08(0xdb)][_0x52ce08(0x119)](_0x3f6192),_0x26ecc4=_0x1f24c3[_0x52ce08(0x164)][_0x52ce08(0x119)](_0x3f24ae),_0x5421f2=_0x1f24c3['cron']?a30_0x211e6f[_0x52ce08(0x121)](_0x1f24c3[_0x52ce08(0xef)][_0x52ce08(0x119)](_0x4e28fc)):'\x20'['repeat'](_0x4e28fc),_0x20eca6=hyperlink(_0x1f24c3['name'],_0x1f24c3[_0x52ce08(0x13c)]);return _0x52ce08(0x130)+_0x5bdaae+'\x20'+_0x45bc0d+_0x52ce08(0x14c)+_0x26ecc4+'\x20\x20'+_0x5421f2+'\x20\x20'+_0x20eca6;});await writeOutput(_0x2fb13c['join']('\x0a'),_0x31ea89[_0x2ed580(0x129)],_0x2ed580(0x10c));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x272bc8(0x14b)]=a30_0x272bc8(0xf7);[a30_0x272bc8(0x16a)]='Show\x20schedule\x20details';[a30_0x272bc8(0x143)](_0x4b5dae){const _0x78d2b=a30_0x272bc8,_0x532729=_0x4b5dae[_0x78d2b(0xff)][0x0];if(!_0x532729)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a30_0x272bc8(0x142)](_0x2a1e59){const _0x288e0e=a30_0x272bc8,{options:_0x4d2a5f,args:_0x3f4cbb,tdx:_0x3287e8}=_0x2a1e59,_0x5d97b7=_0x3f4cbb[0x0],_0x973fcb=await withSpinner(_0x288e0e(0xf9),()=>_0x3287e8[_0x288e0e(0xf1)][_0x288e0e(0x113)](_0x5d97b7),{'verbose':_0x4d2a5f[_0x288e0e(0x114)]}),_0x39fdd6=_0x973fcb[_0x288e0e(0x11e)],_0x2c78bd={'name':_0x39fdd6[_0x288e0e(0x14b)],'cron':_0x39fdd6['cron'],'database':_0x39fdd6[_0x288e0e(0x11a)],'type':_0x39fdd6[_0x288e0e(0x102)],'timezone':_0x39fdd6[_0x288e0e(0xec)],'user_name':_0x39fdd6[_0x288e0e(0x11b)],'created_at':_0x39fdd6[_0x288e0e(0x122)],'engine_version':_0x39fdd6[_0x288e0e(0x167)],'executing_user_id':_0x39fdd6['executing_user_id'],'query':_0x39fdd6[_0x288e0e(0xe2)],'delay':_0x39fdd6[_0x288e0e(0x10f)],'priority':_0x39fdd6[_0x288e0e(0x13e)],'retry_limit':_0x39fdd6[_0x288e0e(0xe6)],..._0x39fdd6[_0x288e0e(0x146)]&&{'result':_0x39fdd6['result']}};return await handleSingleObjectOutput(_0x2c78bd,_0x4d2a5f),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x272bc8(0x14b)]='schedule:create';[a30_0x272bc8(0x16a)]=a30_0x272bc8(0x10a);[a30_0x272bc8(0x143)](_0x3f5c20){const _0x5e0819=a30_0x272bc8,_0x199e84=_0x3f5c20['args'][0x0];if(!_0x199e84)return _0x5e0819(0x135);const _0x11f6a0=_0x3f5c20['options'];if(!_0x11f6a0[_0x5e0819(0x11a)])return _0x5e0819(0xee);return undefined;}async['execute'](_0x31ce7c){const _0x3281e4=a30_0x272bc8,{options:_0x586fea,args:_0x4a639d,tdx:_0x31968}=_0x31ce7c,_0x30cdc9=_0x4a639d[0x0],_0x4716f1=_0x586fea,_0x442a5b=_0x4716f1[_0x3281e4(0x11a)],_0x3b721f=_0x4716f1['file'],_0xef91d9=_0x4716f1[_0x3281e4(0x102)]||_0x3281e4(0x12a);let _0x2e75f3;try{_0x2e75f3=readFileSync(_0x3b721f,'utf-8')[_0x3281e4(0x123)]();}catch(_0x2ecf4e){throw new SDKError(ErrorCode[_0x3281e4(0x112)],_0x3281e4(0xe9)+_0x3b721f,_0x2ecf4e instanceof Error?_0x2ecf4e:undefined);}if(!_0x2e75f3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3281e4(0xfb));const _0x46244c={'database':_0x442a5b,'query':_0x2e75f3,'type':_0xef91d9};if(_0x4716f1[_0x3281e4(0xef)])_0x46244c[_0x3281e4(0xef)]=_0x4716f1[_0x3281e4(0xef)];if(_0x4716f1[_0x3281e4(0xec)])_0x46244c[_0x3281e4(0xec)]=_0x4716f1[_0x3281e4(0xec)];if(_0x4716f1[_0x3281e4(0x10f)]!==undefined)_0x46244c[_0x3281e4(0x10f)]=Number(_0x4716f1[_0x3281e4(0x10f)]);if(_0x4716f1[_0x3281e4(0x13e)]!==undefined)_0x46244c[_0x3281e4(0x13e)]=Number(_0x4716f1[_0x3281e4(0x13e)]);if(_0x4716f1['retryLimit']!==undefined)_0x46244c['retry_limit']=Number(_0x4716f1[_0x3281e4(0x115)]);if(_0x4716f1[_0x3281e4(0x11d)])_0x46244c[_0x3281e4(0x167)]=_0x4716f1[_0x3281e4(0x11d)];if(_0x4716f1[_0x3281e4(0x146)])_0x46244c[_0x3281e4(0x146)]=_0x4716f1['result'];if(_0x586fea[_0x3281e4(0x114)]){console['error']('Creating\x20schedule:\x20'+_0x30cdc9),console[_0x3281e4(0x10d)](_0x3281e4(0x148)+_0x442a5b),console[_0x3281e4(0x10d)](_0x3281e4(0x104)+_0xef91d9);if(_0x46244c[_0x3281e4(0xef)])console[_0x3281e4(0x10d)](_0x3281e4(0xf8)+_0x46244c['cron']);if(_0x46244c[_0x3281e4(0xec)])console['error']('\x20\x20Timezone:\x20'+_0x46244c['timezone']);}const _0x49a714=await withSpinner(_0x3281e4(0x106),()=>_0x31968[_0x3281e4(0xf1)][_0x3281e4(0xe4)](_0x30cdc9,_0x46244c),{'verbose':_0x586fea[_0x3281e4(0x114)]});return console[_0x3281e4(0x10d)]('Schedule\x20created:\x20'+_0x49a714['data']['name']),await handleSingleObjectOutput(_0x49a714[_0x3281e4(0x11e)],_0x586fea),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x272bc8(0x14b)]=a30_0x272bc8(0x16b);[a30_0x272bc8(0x16a)]=a30_0x272bc8(0x139);['validate'](_0x404da8){const _0x1e4ff2=a30_0x272bc8,_0x29c9b4=_0x404da8['args'][0x0];if(!_0x29c9b4)return _0x1e4ff2(0xde);return undefined;}async[a30_0x272bc8(0x142)](_0x4151fd){const _0x49db88=a30_0x272bc8,{options:_0xbd2872,args:_0x46ead6,tdx:_0x474fa7}=_0x4151fd,_0x276dc0=_0x46ead6[0x0],_0x6f693=_0xbd2872,_0x1d4eb3={};if(_0x6f693['database'])_0x1d4eb3[_0x49db88(0x11a)]=_0x6f693[_0x49db88(0x11a)];if(_0x6f693[_0x49db88(0x102)])_0x1d4eb3['type']=_0x6f693['type'];if(_0x6f693[_0x49db88(0xef)])_0x1d4eb3[_0x49db88(0xef)]=_0x6f693[_0x49db88(0xef)];if(_0x6f693[_0x49db88(0xec)])_0x1d4eb3['timezone']=_0x6f693['timezone'];if(_0x6f693[_0x49db88(0x10f)]!==undefined)_0x1d4eb3[_0x49db88(0x10f)]=Number(_0x6f693[_0x49db88(0x10f)]);if(_0x6f693[_0x49db88(0x13e)]!==undefined)_0x1d4eb3[_0x49db88(0x13e)]=Number(_0x6f693['priority']);if(_0x6f693[_0x49db88(0x115)]!==undefined)_0x1d4eb3[_0x49db88(0xe6)]=Number(_0x6f693[_0x49db88(0x115)]);if(_0x6f693[_0x49db88(0x11d)])_0x1d4eb3[_0x49db88(0x167)]=_0x6f693[_0x49db88(0x11d)];if(_0x6f693[_0x49db88(0x146)])_0x1d4eb3[_0x49db88(0x146)]=_0x6f693[_0x49db88(0x146)];if(_0x6f693['file'])try{_0x1d4eb3[_0x49db88(0xe2)]=readFileSync(_0x6f693[_0x49db88(0x157)],_0x49db88(0xdd))[_0x49db88(0x123)]();}catch(_0x4f6932){throw new SDKError(ErrorCode[_0x49db88(0x112)],_0x49db88(0xe9)+_0x6f693['file'],_0x4f6932 instanceof Error?_0x4f6932:undefined);}if(Object[_0x49db88(0xf5)](_0x1d4eb3)[_0x49db88(0x11f)]===0x0)throw new SDKError(ErrorCode[_0x49db88(0x112)],_0x49db88(0x165));if(_0xbd2872['verbose']){console[_0x49db88(0x10d)]('Updating\x20schedule:\x20'+_0x276dc0);for(const [_0x1d9b00,_0x35a555]of Object[_0x49db88(0x168)](_0x1d4eb3)){_0x1d9b00===_0x49db88(0xe2)?console[_0x49db88(0x10d)]('\x20\x20'+_0x1d9b00+':\x20'+_0x35a555['substring'](0x0,0x32)+_0x49db88(0x160)):console['error']('\x20\x20'+_0x1d9b00+':\x20'+_0x35a555);}}const _0x4b33aa=await withSpinner('Updating\x20schedule...',()=>_0x474fa7[_0x49db88(0xf1)][_0x49db88(0x14d)](_0x276dc0,_0x1d4eb3),{'verbose':_0xbd2872[_0x49db88(0x114)]});return console[_0x49db88(0x10d)](_0x49db88(0x149)+_0x4b33aa[_0x49db88(0x11e)][_0x49db88(0x14b)]),await handleSingleObjectOutput(_0x4b33aa['data'],_0xbd2872),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x272bc8(0x14b)]=a30_0x272bc8(0xea);[a30_0x272bc8(0x16a)]='Delete\x20a\x20scheduled\x20query';[a30_0x272bc8(0x143)](_0x49eacd){const _0x26a1f4=a30_0x272bc8,_0x58d779=_0x49eacd[_0x26a1f4(0xff)][0x0];if(!_0x58d779)return _0x26a1f4(0x169);return undefined;}async[a30_0x272bc8(0x142)](_0x3c9bea){const _0x49b3bc=a30_0x272bc8,{options:_0x2d4724,args:_0x5e9618,tdx:_0x2df576}=_0x3c9bea,_0x596dea=_0x5e9618[0x0];if(!_0x2d4724[_0x49b3bc(0x13a)]){const _0x5a00fb=await confirm(_0x49b3bc(0x110)+_0x596dea+'\x22?');if(!_0x5a00fb)return console['error'](_0x49b3bc(0x131)),0x0;}const _0x5ed8fe=await withSpinner(_0x49b3bc(0x107),()=>_0x2df576[_0x49b3bc(0xf1)][_0x49b3bc(0x138)](_0x596dea),{'verbose':_0x2d4724[_0x49b3bc(0x114)]});return console[_0x49b3bc(0x10d)](_0x49b3bc(0x10e)+_0x5ed8fe[_0x49b3bc(0x11e)][_0x49b3bc(0x14b)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x272bc8(0x14b)]=a30_0x272bc8(0xed);['description']=a30_0x272bc8(0x145);[a30_0x272bc8(0x143)](_0x151e7b){const _0x506dca=a30_0x272bc8,_0x30609c=_0x151e7b[_0x506dca(0xff)][0x0];if(!_0x30609c)return _0x506dca(0xda);return undefined;}async[a30_0x272bc8(0x142)](_0x18d774){const _0x48caef=a30_0x272bc8,{options:_0x4b83ec,args:_0x4d36ed,tdx:_0x4ccbb8}=_0x18d774,_0x11f77f=_0x4d36ed[0x0],_0x1d9218=_0x4b83ec,_0x1534dd=_0x1d9218['time'],_0x41d025=_0x1d9218[_0x48caef(0x162)]!==undefined?Number(_0x1d9218[_0x48caef(0x162)]):undefined;if(_0x4b83ec['verbose']){console['error'](_0x48caef(0x141)+_0x11f77f);if(_0x1534dd)console['error'](_0x48caef(0x13f)+_0x1534dd);if(_0x41d025)console['error'](_0x48caef(0x120)+_0x41d025);}const _0x20d652=await withSpinner(_0x48caef(0xf2),()=>_0x4ccbb8[_0x48caef(0xf1)][_0x48caef(0xe5)](_0x11f77f,{'time':_0x1534dd,'num':_0x41d025}),{'verbose':_0x4b83ec[_0x48caef(0x114)]}),_0x530d01=_0x20d652[_0x48caef(0x11e)]['jobs'];console[_0x48caef(0x10d)]('Schedule\x20run\x20submitted:\x20'+_0x530d01['length']+_0x48caef(0xf3)+(_0x530d01[_0x48caef(0x11f)]!==0x1?'s':'')+_0x48caef(0xf0));for(const _0x2ed432 of _0x530d01){console[_0x48caef(0x10d)](_0x48caef(0x151)+_0x2ed432[_0x48caef(0x159)]);}return await handleSDKOutput(_0x530d01,_0x4b83ec),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x272bc8(0x14b)]=a30_0x272bc8(0xf4);[a30_0x272bc8(0x16a)]=a30_0x272bc8(0xe0);['validate'](_0x4f3b6f){const _0x402c9a=a30_0x272bc8,_0x275f7c=_0x4f3b6f[_0x402c9a(0xff)][0x0];if(!_0x275f7c)return _0x402c9a(0xdc);return undefined;}async['execute'](_0x29b233){const _0x4616a4=a30_0x272bc8,{options:_0x1905f2,args:_0xc0c487,tdx:_0x59c339}=_0x29b233,_0x1fa67c=_0xc0c487[0x0],_0x19c76e=_0x1905f2,_0x5abec1=_0x19c76e[_0x4616a4(0xfd)]!==undefined?Number(_0x19c76e[_0x4616a4(0xfd)]):undefined,_0x49f000=_0x19c76e['to']!==undefined?Number(_0x19c76e['to']):undefined,_0x5f07bc=await withSpinner(_0x4616a4(0x105),()=>_0x59c339[_0x4616a4(0xf1)][_0x4616a4(0x126)](_0x1fa67c,{'from':_0x5abec1,'to':_0x49f000}),{'verbose':_0x1905f2[_0x4616a4(0x114)]}),_0x2318ed=_0x5f07bc[_0x4616a4(0x11e)];console[_0x4616a4(0x10d)]('Found\x20'+_0x2318ed[_0x4616a4(0x128)]+_0x4616a4(0x10b)+(_0x2318ed[_0x4616a4(0x128)]!==0x1?'s':'')+'\x20(showing\x20'+_0x2318ed[_0x4616a4(0xfd)]+'-'+_0x2318ed['to']+')');const _0x14cec2=_0x2318ed['history'][_0x4616a4(0x152)](_0x511562=>({'job_id':_0x511562[_0x4616a4(0x159)],'type':_0x511562[_0x4616a4(0x102)],'status':_0x511562[_0x4616a4(0x133)],'scheduled_at':_0x511562[_0x4616a4(0x100)],'created_at':_0x511562['created_at'],'start_at':_0x511562[_0x4616a4(0x140)],'end_at':_0x511562[_0x4616a4(0x15c)]}));return await handleSDKOutput(_0x14cec2,_0x1905f2),0x0;}}function a30_0x1e3d(){const _0x4c9e3d=['No\x20scheduled\x20queries\x20found','Run\x20a\x20scheduled\x20query\x20immediately','result','time_zone','\x20\x20Database:\x20','Schedule\x20updated:\x20','has_next_page','name','\x20\x20→\x20','update','round','format','toLocaleDateString','\x20\x20Job\x20ID:\x20','map','Searching\x20scheduled\x20queries\x20matching\x20\x22','323515NJUcVR','(unnamed)','just\x20now','file','json','job_id','never','2939109spWIKE','end_at','List\x20scheduled\x20queries','listQueries','Showing\x20first\x20','...','2093486nbhgzZ','num','table','nextRun','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','updated_at','engine_version','entries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','description','schedule:update','success','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','lastRun','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','utf-8','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','soon','Show\x20schedule\x20execution\x20history','jsonl','query','last_job','create','run','retry_limit','24NDlzSO','statusIcon','Failed\x20to\x20read\x20file:\x20','schedule:delete','6450CfuMoM','timezone','schedule:run','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','cron','\x20created','schedules','Running\x20schedule...','\x20job','schedule:history','keys','Found\x20','schedule:show','\x20\x20Cron:\x20','Getting\x20schedule\x20details...','\x22...','Query\x20file\x20is\x20empty','getTime','from','745011YmIPnQ','args','scheduled_at','7EbiaJr','type','tsv','\x20\x20Type:\x20','Getting\x20schedule\x20history...','Creating\x20schedule...','Deleting\x20schedule...','Listing\x20scheduled\x20queries...','\x20matching\x20\x22','Create\x20a\x20scheduled\x20query','\x20execution','list','error','Schedule\x20deleted:\x20','delay','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','green','INVALID_ARGUMENT','show','verbose','retryLimit','ended_at','abs','next_run_at','padEnd','database','user_name','pagination','engineVersion','data','length','\x20\x20Num:\x20','cyan','created_at','trim','\x20(use\x20--limit\x20to\x20see\x20more)','log','history','1512054cXFWWb','count','output','trino','ies','\x20scheduled\x20quer','user','m\x20ago','5185040APMljs','📅\x20','Cancelled','\x20schedules','status','red','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','max','20457iXqrSH','delete','Update\x20a\x20scheduled\x20query','yes','/app/queries/editor?queryId=','queryUrl','in\x20','priority','\x20\x20Time:\x20','start_at','Running\x20schedule:\x20','execute','validate'];a30_0x1e3d=function(){return _0x4c9e3d;};return a30_0x1e3d();}
|
|
1
|
+
const a30_0x173c50=a30_0x200d;(function(_0x5b9ede,_0xcb5586){const _0x1bfe8b=a30_0x200d,_0x238a29=_0x5b9ede();while(!![]){try{const _0x520a3d=parseInt(_0x1bfe8b(0x14f))/0x1+-parseInt(_0x1bfe8b(0x13e))/0x2*(-parseInt(_0x1bfe8b(0x18f))/0x3)+parseInt(_0x1bfe8b(0x1ab))/0x4*(-parseInt(_0x1bfe8b(0x1b0))/0x5)+parseInt(_0x1bfe8b(0x1a0))/0x6+-parseInt(_0x1bfe8b(0x14c))/0x7+parseInt(_0x1bfe8b(0x122))/0x8*(-parseInt(_0x1bfe8b(0x190))/0x9)+-parseInt(_0x1bfe8b(0x120))/0xa*(-parseInt(_0x1bfe8b(0x199))/0xb);if(_0x520a3d===_0xcb5586)break;else _0x238a29['push'](_0x238a29['shift']());}catch(_0x589ead){_0x238a29['push'](_0x238a29['shift']());}}}(a30_0x4a3f,0x1f2bd));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a30_0x4a3f(){const _0x30af15=['timezone','jobs','\x20\x20Timezone:\x20','INVALID_ARGUMENT','name','11748UHSONp','Deleting\x20schedule...','d\x20ago','\x20schedules','m\x20ago','status','dim','632016bUKskH','update','schedule:run','jsonl','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','engine_version','just\x20now','Query\x20file\x20is\x20empty','never','Creating\x20schedule:\x20','\x20created','6056KHGQfB','Running\x20schedule:\x20','ended_at','history','table','305CnwtPJ','schedule:show','listQueries','1070LNwEna','length','1267256Jzmoto','Update\x20a\x20scheduled\x20query','count','\x20\x20→\x20','description','List\x20scheduled\x20queries','\x20scheduled\x20quer','success','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Showing\x20first\x20','execute','\x20\x20Type:\x20','limit','scheduled_at','h\x20ago','Updating\x20schedule:\x20','time_zone','result','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','create','engineVersion','\x20\x20Cron:\x20','database','Updating\x20schedule...','Create\x20a\x20scheduled\x20query','\x20\x20Job\x20ID:\x20','query','show','2rETUVr','job_id','Failed\x20to\x20read\x20file:\x20','statusIcon','max','Cancelled','priority','padEnd','\x20\x20Time:\x20','validate','Schedule\x20created:\x20','📅\x20','No\x20scheduled\x20queries\x20found','Delete\x20a\x20scheduled\x20query','1549555vnVzNC','delay','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','145925MDYiMm','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','cyan','nextRun','Searching\x20scheduled\x20queries\x20matching\x20\x22','args','(unnamed)','schedule:history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','time','utf-8','abs','\x20\x20Num:\x20','queryUrl','red','log','yes','...','created_at','site','trim','updated_at','round','join','verbose','queries','toLocaleDateString','green','repeat','\x20\x20Database:\x20','from','delete','error','Schedule\x20updated:\x20','json','data','lastRun','map','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','schedules','schedule:update','retry_limit','\x20(showing\x20','format','cron','\x20execution','\x20job','Found\x20','last_job','Running\x20schedule...','type','options','in\x20','Creating\x20schedule...','file','entries','/app/queries/editor?queryId=','Listing\x20scheduled\x20queries...','retryLimit','schedule:create','trino','Run\x20a\x20scheduled\x20query\x20immediately','schedule:delete','user','702798dlgbnR','9eIZYXc','has_next_page','next_run_at','num'];a30_0x4a3f=function(){return _0x30af15;};return a30_0x4a3f();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x4621e1 from'chalk';function a30_0x200d(_0x4dcd7b,_0x572658){_0x4dcd7b=_0x4dcd7b-0x120;const _0x4a3fff=a30_0x4a3f();let _0x200d41=_0x4a3fff[_0x4dcd7b];return _0x200d41;}function formatRelativeTime(_0x1b3ff3){const _0x1b6738=a30_0x200d,_0x5cd646=new Date(_0x1b3ff3),_0x7703ce=new Date(),_0x2cb4b0=_0x5cd646['getTime']()-_0x7703ce['getTime'](),_0x4e7c36=Math[_0x1b6738(0x15a)](_0x2cb4b0)/0x3e8,_0x5d5811=_0x2cb4b0<0x0;if(_0x4e7c36<0x3c)return _0x5d5811?_0x1b6738(0x1a6):'soon';else{if(_0x4e7c36<0xe10){const _0x43291a=Math[_0x1b6738(0x165)](_0x4e7c36/0x3c);return _0x5d5811?_0x43291a+_0x1b6738(0x19d):'in\x20'+_0x43291a+'m';}else{if(_0x4e7c36<0x15180){const _0x407f3a=Math[_0x1b6738(0x165)](_0x4e7c36/0xe10);return _0x5d5811?_0x407f3a+_0x1b6738(0x130):'in\x20'+_0x407f3a+'h';}else{if(_0x4e7c36<0x93a80){const _0x1c5f41=Math[_0x1b6738(0x165)](_0x4e7c36/0x15180);return _0x5d5811?_0x1c5f41+_0x1b6738(0x19b):_0x1b6738(0x183)+_0x1c5f41+'d';}else return _0x5cd646[_0x1b6738(0x169)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x173c50(0x198)]='schedule:list';[a30_0x173c50(0x126)]=a30_0x173c50(0x127);async['execute'](_0x4e23d6){const _0x79a5d1=a30_0x173c50,{options:_0xa03d05,args:_0x561c9a,tdx:_0x595dd0}=_0x4e23d6,_0x2983fa=resolveLimit(_0xa03d05[_0x79a5d1(0x12e)],DEFAULT_DISPLAY_LIMIT),_0x495134=_0x561c9a[0x0],_0xcfbbaa=_0x495134?_0x79a5d1(0x153)+_0x495134+'\x22...':_0x79a5d1(0x188),_0x1130e7=await withSpinner(_0xcfbbaa,()=>_0x595dd0[_0x79a5d1(0x176)][_0x79a5d1(0x1b2)]({'limit':_0x2983fa,'scheduled':!![],'pattern':_0x495134}),{'verbose':_0xa03d05[_0x79a5d1(0x167)]}),_0x59656c=_0x1130e7[_0x79a5d1(0x172)][_0x79a5d1(0x168)],_0x15e84d=_0x1130e7[_0x79a5d1(0x172)]['pagination'][_0x79a5d1(0x191)],_0x411796=_0x495134?'\x20matching\x20\x22'+_0x495134+'\x22':'';_0x15e84d?console[_0x79a5d1(0x16f)](_0x79a5d1(0x12b)+_0x59656c[_0x79a5d1(0x121)]+_0x79a5d1(0x19c)+_0x411796+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x79a5d1(0x16f)](_0x79a5d1(0x17e)+_0x59656c[_0x79a5d1(0x121)]+_0x79a5d1(0x128)+(_0x59656c[_0x79a5d1(0x121)]!==0x1?'ies':'y')+_0x411796);if(_0xa03d05['format']===_0x79a5d1(0x171)||_0xa03d05['format']===_0x79a5d1(0x1a3)||_0xa03d05[_0x79a5d1(0x17a)]===_0x79a5d1(0x1af)||_0xa03d05[_0x79a5d1(0x17a)]==='tsv'){const _0x26de1d=_0x59656c[_0x79a5d1(0x174)](_0x8fadc4=>({'id':_0x8fadc4['id'],'name':_0x8fadc4[_0x79a5d1(0x198)],'cron':_0x8fadc4[_0x79a5d1(0x17b)],'database':_0x8fadc4[_0x79a5d1(0x138)]?.['name'],'type':_0x8fadc4['type'],'timezone':_0x8fadc4[_0x79a5d1(0x132)],'user_name':_0x8fadc4[_0x79a5d1(0x18e)]?.['name'],'updated_at':_0x8fadc4[_0x79a5d1(0x164)],'next_run_at':_0x8fadc4['next_run_at'],'last_job_status':_0x8fadc4[_0x79a5d1(0x17f)]?.[_0x79a5d1(0x19e)]}));await handleSDKOutput(_0x26de1d,_0xa03d05);}else{if(_0x59656c[_0x79a5d1(0x121)]===0x0)console[_0x79a5d1(0x15e)](_0x79a5d1(0x14a));else{const _0x8f0f55=_0xa03d05[_0x79a5d1(0x162)],_0x3a4b61=_0x59656c['map'](_0x25f08f=>{const _0x468375=_0x79a5d1,_0x454b49=_0x25f08f['last_job']?.[_0x468375(0x19e)]?_0x25f08f['last_job'][_0x468375(0x19e)]===_0x468375(0x129)?'✓':'✗':'-',_0xdfd830=_0x25f08f[_0x468375(0x17f)]?.[_0x468375(0x1ad)]?formatRelativeTime(_0x25f08f[_0x468375(0x17f)][_0x468375(0x1ad)]):_0x468375(0x1a8),_0x387078=_0x25f08f['next_run_at']?formatRelativeTime(_0x25f08f[_0x468375(0x192)]):'-',_0x1a97e6=_0x25f08f[_0x468375(0x17b)]||'',_0x3b3e1b=_0x25f08f[_0x468375(0x198)]||_0x468375(0x155),_0x249e84=getConsoleUrl(_0x8f0f55,_0x468375(0x187)+_0x25f08f['id']);return{'statusIcon':_0x454b49,'lastRun':_0xdfd830,'nextRun':_0x387078,'cron':_0x1a97e6,'name':_0x3b3e1b,'queryUrl':_0x249e84,'status':_0x25f08f[_0x468375(0x17f)]?.[_0x468375(0x19e)]};}),_0xb641a4=Math[_0x79a5d1(0x142)](..._0x3a4b61[_0x79a5d1(0x174)](_0x3d3bd5=>_0x3d3bd5[_0x79a5d1(0x173)]['length'])),_0x24e533=Math[_0x79a5d1(0x142)](..._0x3a4b61['map'](_0x2d8655=>_0x2d8655[_0x79a5d1(0x152)][_0x79a5d1(0x121)])),_0x19a875=Math[_0x79a5d1(0x142)](..._0x3a4b61[_0x79a5d1(0x174)](_0x1ccd2e=>_0x1ccd2e[_0x79a5d1(0x17b)][_0x79a5d1(0x121)])),_0x11f34a=_0x3a4b61[_0x79a5d1(0x174)](_0x565166=>{const _0x11b088=_0x79a5d1,_0x190eef=_0x565166['status']===_0x11b088(0x129)?a30_0x4621e1[_0x11b088(0x16a)](_0x565166[_0x11b088(0x141)]):_0x565166['status']===_0x11b088(0x16f)?a30_0x4621e1[_0x11b088(0x15d)](_0x565166[_0x11b088(0x141)]):a30_0x4621e1[_0x11b088(0x19f)](_0x565166[_0x11b088(0x141)]),_0x13e978=_0x565166[_0x11b088(0x173)]['padEnd'](_0xb641a4),_0x420ae5=_0x565166['nextRun'][_0x11b088(0x145)](_0x24e533),_0xdebea=_0x565166['cron']?a30_0x4621e1[_0x11b088(0x151)](_0x565166[_0x11b088(0x17b)]['padEnd'](_0x19a875)):'\x20'[_0x11b088(0x16b)](_0x19a875),_0x480fc5=hyperlink(_0x565166[_0x11b088(0x198)],_0x565166[_0x11b088(0x15c)]);return _0x11b088(0x149)+_0x190eef+'\x20'+_0x13e978+_0x11b088(0x125)+_0x420ae5+'\x20\x20'+_0xdebea+'\x20\x20'+_0x480fc5;});await writeOutput(_0x11f34a[_0x79a5d1(0x166)]('\x0a'),_0xa03d05['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a30_0x173c50(0x1b1);[a30_0x173c50(0x126)]='Show\x20schedule\x20details';[a30_0x173c50(0x147)](_0x14bde4){const _0x25d920=a30_0x173c50,_0x3f3753=_0x14bde4[_0x25d920(0x154)][0x0];if(!_0x3f3753)return _0x25d920(0x14e);return undefined;}async[a30_0x173c50(0x12c)](_0x4a2674){const _0x4033ed=a30_0x173c50,{options:_0x5b96aa,args:_0xe3c68a,tdx:_0x2c4545}=_0x4a2674,_0x372678=_0xe3c68a[0x0],_0xa3be6e=await withSpinner('Getting\x20schedule\x20details...',()=>_0x2c4545[_0x4033ed(0x176)][_0x4033ed(0x13d)](_0x372678),{'verbose':_0x5b96aa[_0x4033ed(0x167)]}),_0x1027ba=_0xa3be6e[_0x4033ed(0x172)],_0x19e02a={'name':_0x1027ba[_0x4033ed(0x198)],'cron':_0x1027ba['cron'],'database':_0x1027ba[_0x4033ed(0x138)],'type':_0x1027ba[_0x4033ed(0x181)],'timezone':_0x1027ba[_0x4033ed(0x194)],'user_name':_0x1027ba['user_name'],'created_at':_0x1027ba[_0x4033ed(0x161)],'engine_version':_0x1027ba[_0x4033ed(0x1a5)],'executing_user_id':_0x1027ba['executing_user_id'],'query':_0x1027ba[_0x4033ed(0x13c)],'delay':_0x1027ba[_0x4033ed(0x14d)],'priority':_0x1027ba[_0x4033ed(0x144)],'retry_limit':_0x1027ba['retry_limit'],..._0x1027ba[_0x4033ed(0x133)]&&{'result':_0x1027ba[_0x4033ed(0x133)]}};return await handleSingleObjectOutput(_0x19e02a,_0x5b96aa),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a30_0x173c50(0x18a);[a30_0x173c50(0x126)]=a30_0x173c50(0x13a);[a30_0x173c50(0x147)](_0x936d91){const _0x440140=a30_0x173c50,_0x471dc5=_0x936d91[_0x440140(0x154)][0x0];if(!_0x471dc5)return _0x440140(0x12a);const _0xc4efa8=_0x936d91[_0x440140(0x182)];if(!_0xc4efa8[_0x440140(0x138)])return _0x440140(0x175);return undefined;}async['execute'](_0x84fcb2){const _0x446933=a30_0x173c50,{options:_0xa2625c,args:_0x3a5618,tdx:_0x29a78d}=_0x84fcb2,_0x4c4019=_0x3a5618[0x0],_0x1a280c=_0xa2625c,_0x1bf0af=_0x1a280c[_0x446933(0x138)],_0x5b8854=_0x1a280c[_0x446933(0x185)],_0x5ac1ef=_0x1a280c['type']||_0x446933(0x18b);let _0x5e5347;try{_0x5e5347=readFileSync(_0x5b8854,_0x446933(0x159))[_0x446933(0x163)]();}catch(_0x17d508){throw new SDKError(ErrorCode[_0x446933(0x197)],_0x446933(0x140)+_0x5b8854,_0x17d508 instanceof Error?_0x17d508:undefined);}if(!_0x5e5347)throw new SDKError(ErrorCode[_0x446933(0x197)],_0x446933(0x1a7));const _0x26dbbf={'database':_0x1bf0af,'query':_0x5e5347,'type':_0x5ac1ef};if(_0x1a280c[_0x446933(0x17b)])_0x26dbbf[_0x446933(0x17b)]=_0x1a280c['cron'];if(_0x1a280c['timezone'])_0x26dbbf[_0x446933(0x194)]=_0x1a280c[_0x446933(0x194)];if(_0x1a280c['delay']!==undefined)_0x26dbbf[_0x446933(0x14d)]=Number(_0x1a280c[_0x446933(0x14d)]);if(_0x1a280c[_0x446933(0x144)]!==undefined)_0x26dbbf[_0x446933(0x144)]=Number(_0x1a280c[_0x446933(0x144)]);if(_0x1a280c[_0x446933(0x189)]!==undefined)_0x26dbbf[_0x446933(0x178)]=Number(_0x1a280c['retryLimit']);if(_0x1a280c[_0x446933(0x136)])_0x26dbbf[_0x446933(0x1a5)]=_0x1a280c['engineVersion'];if(_0x1a280c[_0x446933(0x133)])_0x26dbbf[_0x446933(0x133)]=_0x1a280c[_0x446933(0x133)];if(_0xa2625c[_0x446933(0x167)]){console['error'](_0x446933(0x1a9)+_0x4c4019),console[_0x446933(0x16f)](_0x446933(0x16c)+_0x1bf0af),console[_0x446933(0x16f)](_0x446933(0x12d)+_0x5ac1ef);if(_0x26dbbf[_0x446933(0x17b)])console[_0x446933(0x16f)](_0x446933(0x137)+_0x26dbbf['cron']);if(_0x26dbbf['timezone'])console[_0x446933(0x16f)](_0x446933(0x196)+_0x26dbbf[_0x446933(0x194)]);}const _0xb15e2b=await withSpinner(_0x446933(0x184),()=>_0x29a78d['schedules'][_0x446933(0x135)](_0x4c4019,_0x26dbbf),{'verbose':_0xa2625c[_0x446933(0x167)]});return console[_0x446933(0x16f)](_0x446933(0x148)+_0xb15e2b['data']['name']),await handleSingleObjectOutput(_0xb15e2b[_0x446933(0x172)],_0xa2625c),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x177);[a30_0x173c50(0x126)]=a30_0x173c50(0x123);[a30_0x173c50(0x147)](_0x328ad8){const _0x4a8bfc=a30_0x173c50,_0x5ad504=_0x328ad8[_0x4a8bfc(0x154)][0x0];if(!_0x5ad504)return _0x4a8bfc(0x157);return undefined;}async[a30_0x173c50(0x12c)](_0xd62090){const _0x4b8ed1=a30_0x173c50,{options:_0x3f6ab5,args:_0x16593f,tdx:_0x1830f9}=_0xd62090,_0x2ea310=_0x16593f[0x0],_0x286024=_0x3f6ab5,_0x3b2437={};if(_0x286024[_0x4b8ed1(0x138)])_0x3b2437[_0x4b8ed1(0x138)]=_0x286024[_0x4b8ed1(0x138)];if(_0x286024[_0x4b8ed1(0x181)])_0x3b2437[_0x4b8ed1(0x181)]=_0x286024[_0x4b8ed1(0x181)];if(_0x286024['cron'])_0x3b2437[_0x4b8ed1(0x17b)]=_0x286024[_0x4b8ed1(0x17b)];if(_0x286024[_0x4b8ed1(0x194)])_0x3b2437[_0x4b8ed1(0x194)]=_0x286024['timezone'];if(_0x286024[_0x4b8ed1(0x14d)]!==undefined)_0x3b2437[_0x4b8ed1(0x14d)]=Number(_0x286024[_0x4b8ed1(0x14d)]);if(_0x286024[_0x4b8ed1(0x144)]!==undefined)_0x3b2437[_0x4b8ed1(0x144)]=Number(_0x286024[_0x4b8ed1(0x144)]);if(_0x286024[_0x4b8ed1(0x189)]!==undefined)_0x3b2437[_0x4b8ed1(0x178)]=Number(_0x286024[_0x4b8ed1(0x189)]);if(_0x286024[_0x4b8ed1(0x136)])_0x3b2437[_0x4b8ed1(0x1a5)]=_0x286024[_0x4b8ed1(0x136)];if(_0x286024['result'])_0x3b2437[_0x4b8ed1(0x133)]=_0x286024[_0x4b8ed1(0x133)];if(_0x286024[_0x4b8ed1(0x185)])try{_0x3b2437['query']=readFileSync(_0x286024[_0x4b8ed1(0x185)],_0x4b8ed1(0x159))[_0x4b8ed1(0x163)]();}catch(_0x1ff381){throw new SDKError(ErrorCode[_0x4b8ed1(0x197)],_0x4b8ed1(0x140)+_0x286024[_0x4b8ed1(0x185)],_0x1ff381 instanceof Error?_0x1ff381:undefined);}if(Object['keys'](_0x3b2437)[_0x4b8ed1(0x121)]===0x0)throw new SDKError(ErrorCode[_0x4b8ed1(0x197)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x3f6ab5[_0x4b8ed1(0x167)]){console[_0x4b8ed1(0x16f)](_0x4b8ed1(0x131)+_0x2ea310);for(const [_0x41ae6f,_0x5720ab]of Object[_0x4b8ed1(0x186)](_0x3b2437)){_0x41ae6f==='query'?console[_0x4b8ed1(0x16f)]('\x20\x20'+_0x41ae6f+':\x20'+_0x5720ab['substring'](0x0,0x32)+_0x4b8ed1(0x160)):console['error']('\x20\x20'+_0x41ae6f+':\x20'+_0x5720ab);}}const _0x502c3f=await withSpinner(_0x4b8ed1(0x139),()=>_0x1830f9[_0x4b8ed1(0x176)][_0x4b8ed1(0x1a1)](_0x2ea310,_0x3b2437),{'verbose':_0x3f6ab5[_0x4b8ed1(0x167)]});return console['error'](_0x4b8ed1(0x170)+_0x502c3f[_0x4b8ed1(0x172)][_0x4b8ed1(0x198)]),await handleSingleObjectOutput(_0x502c3f['data'],_0x3f6ab5),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x18d);['description']=a30_0x173c50(0x14b);['validate'](_0x1ee468){const _0x213e0f=a30_0x173c50,_0x4dd7ab=_0x1ee468[_0x213e0f(0x154)][0x0];if(!_0x4dd7ab)return _0x213e0f(0x1a4);return undefined;}async[a30_0x173c50(0x12c)](_0x5dc047){const _0x1f369b=a30_0x173c50,{options:_0x3b5261,args:_0x209396,tdx:_0xfb83a5}=_0x5dc047,_0x3d848a=_0x209396[0x0];if(!_0x3b5261[_0x1f369b(0x15f)]){const _0x45ca7f=await confirm(_0x1f369b(0x134)+_0x3d848a+'\x22?');if(!_0x45ca7f)return console[_0x1f369b(0x16f)](_0x1f369b(0x143)),0x0;}const _0x967532=await withSpinner(_0x1f369b(0x19a),()=>_0xfb83a5[_0x1f369b(0x176)][_0x1f369b(0x16e)](_0x3d848a),{'verbose':_0x3b5261[_0x1f369b(0x167)]});return console[_0x1f369b(0x16f)]('Schedule\x20deleted:\x20'+_0x967532[_0x1f369b(0x172)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a30_0x173c50(0x1a2);['description']=a30_0x173c50(0x18c);[a30_0x173c50(0x147)](_0x1201b7){const _0x1eae41=a30_0x173c50,_0x3b03cc=_0x1201b7[_0x1eae41(0x154)][0x0];if(!_0x3b03cc)return _0x1eae41(0x150);return undefined;}async[a30_0x173c50(0x12c)](_0x56998b){const _0x4a8115=a30_0x173c50,{options:_0x324fbc,args:_0x1c924b,tdx:_0x5aed78}=_0x56998b,_0x8bbf67=_0x1c924b[0x0],_0x3aae90=_0x324fbc,_0x33672a=_0x3aae90[_0x4a8115(0x158)],_0x41801d=_0x3aae90[_0x4a8115(0x193)]!==undefined?Number(_0x3aae90[_0x4a8115(0x193)]):undefined;if(_0x324fbc['verbose']){console['error'](_0x4a8115(0x1ac)+_0x8bbf67);if(_0x33672a)console[_0x4a8115(0x16f)](_0x4a8115(0x146)+_0x33672a);if(_0x41801d)console[_0x4a8115(0x16f)](_0x4a8115(0x15b)+_0x41801d);}const _0x515fbf=await withSpinner(_0x4a8115(0x180),()=>_0x5aed78[_0x4a8115(0x176)]['run'](_0x8bbf67,{'time':_0x33672a,'num':_0x41801d}),{'verbose':_0x324fbc[_0x4a8115(0x167)]}),_0x11ae69=_0x515fbf[_0x4a8115(0x172)][_0x4a8115(0x195)];console[_0x4a8115(0x16f)]('Schedule\x20run\x20submitted:\x20'+_0x11ae69['length']+_0x4a8115(0x17d)+(_0x11ae69[_0x4a8115(0x121)]!==0x1?'s':'')+_0x4a8115(0x1aa));for(const _0x3ed433 of _0x11ae69){console['error'](_0x4a8115(0x13b)+_0x3ed433[_0x4a8115(0x13f)]);}return await handleSDKOutput(_0x11ae69,_0x324fbc),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x156);[a30_0x173c50(0x126)]='Show\x20schedule\x20execution\x20history';[a30_0x173c50(0x147)](_0x489d89){const _0x5845eb=a30_0x173c50,_0x4785c4=_0x489d89[_0x5845eb(0x154)][0x0];if(!_0x4785c4)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x37aeda){const _0x330667=a30_0x173c50,{options:_0x2004cd,args:_0x3ebe8f,tdx:_0x4109b7}=_0x37aeda,_0x181106=_0x3ebe8f[0x0],_0x3c0ad2=_0x2004cd,_0x4cc32c=_0x3c0ad2[_0x330667(0x16d)]!==undefined?Number(_0x3c0ad2[_0x330667(0x16d)]):undefined,_0x54fa04=_0x3c0ad2['to']!==undefined?Number(_0x3c0ad2['to']):undefined,_0x949f18=await withSpinner('Getting\x20schedule\x20history...',()=>_0x4109b7[_0x330667(0x176)][_0x330667(0x1ae)](_0x181106,{'from':_0x4cc32c,'to':_0x54fa04}),{'verbose':_0x2004cd[_0x330667(0x167)]}),_0x12ce8e=_0x949f18[_0x330667(0x172)];console['error'](_0x330667(0x17e)+_0x12ce8e[_0x330667(0x124)]+_0x330667(0x17c)+(_0x12ce8e['count']!==0x1?'s':'')+_0x330667(0x179)+_0x12ce8e[_0x330667(0x16d)]+'-'+_0x12ce8e['to']+')');const _0x2d89b9=_0x12ce8e[_0x330667(0x1ae)][_0x330667(0x174)](_0x49dfe2=>({'job_id':_0x49dfe2['job_id'],'type':_0x49dfe2[_0x330667(0x181)],'status':_0x49dfe2[_0x330667(0x19e)],'scheduled_at':_0x49dfe2[_0x330667(0x12f)],'created_at':_0x49dfe2[_0x330667(0x161)],'start_at':_0x49dfe2['start_at'],'end_at':_0x49dfe2['end_at']}));return await handleSDKOutput(_0x2d89b9,_0x2004cd),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0xb8ac85=a31_0x35d9;(function(_0x852341,_0x2eaa35){const _0x486e29=a31_0x35d9,_0xf3ec35=_0x852341();while(!![]){try{const _0x3bbea7=parseInt(_0x486e29(0x98))/0x1+-parseInt(_0x486e29(0x95))/0x2+parseInt(_0x486e29(0x113))/0x3*(-parseInt(_0x486e29(0xd8))/0x4)+parseInt(_0x486e29(0xce))/0x5*(-parseInt(_0x486e29(0xfe))/0x6)+-parseInt(_0x486e29(0xc6))/0x7*(parseInt(_0x486e29(0xa4))/0x8)+parseInt(_0x486e29(0x104))/0x9+parseInt(_0x486e29(0x82))/0xa*(-parseInt(_0x486e29(0xa0))/0xb);if(_0x3bbea7===_0x2eaa35)break;else _0xf3ec35['push'](_0xf3ec35['shift']());}catch(_0x212af8){_0xf3ec35['push'](_0xf3ec35['shift']());}}}(a31_0x2ecd,0xdd2a7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0x483734 from'chalk';async function resolveSegmentTarget(_0x58e7f4,_0x266d01,_0x5804bd){const _0x17442e=a31_0x35d9;if(isYamlFilePath(_0x58e7f4))try{const _0x10c8ec=await resolveYamlFilePath(_0x58e7f4);return _0x5804bd&&(console[_0x17442e(0x7b)]('Resolved\x20YAML\x20file:\x20'+_0x58e7f4),console[_0x17442e(0x7b)](_0x17442e(0x117)+_0x10c8ec[_0x17442e(0xfd)]),console[_0x17442e(0x7b)](_0x17442e(0xb0)+_0x10c8ec[_0x17442e(0xcb)]),console['error'](_0x17442e(0xfa)+(_0x10c8ec[_0x17442e(0xaf)]||_0x17442e(0xb7))),console[_0x17442e(0x7b)](_0x17442e(0xf0)+_0x10c8ec['fullPath'])),_0x10c8ec['fullPath'];}catch(_0x2270d9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x17442e(0x8b)+_0x2270d9[_0x17442e(0xe2)]);}if(!_0x266d01)throw new SDKError(ErrorCode[_0x17442e(0xae)],_0x17442e(0x94));return _0x266d01+'/'+_0x58e7f4;}export class SegmentDescribeCommand extends BaseCommand{[a31_0xb8ac85(0x78)]=a31_0xb8ac85(0x77);[a31_0xb8ac85(0xb8)]=a31_0xb8ac85(0x7f);async[a31_0xb8ac85(0xab)](_0x273745){const _0x4dd30c=a31_0xb8ac85,{options:_0x40f94e,args:_0x2b848f,tdx:_0x1afa0c}=_0x273745,_0x2133e3=_0x2b848f[0x0],_0x46cf71=!_0x2133e3&&!!_0x40f94e[_0x4dd30c(0xfd)],_0x433f58=_0x2133e3||_0x40f94e[_0x4dd30c(0xfd)];if(!_0x433f58)return console[_0x4dd30c(0x7b)](_0x4dd30c(0xde)),console[_0x4dd30c(0x7b)](_0x4dd30c(0x96)),console[_0x4dd30c(0x7b)](_0x4dd30c(0xa8)),console[_0x4dd30c(0x7b)](_0x4dd30c(0xff)),console[_0x4dd30c(0x7b)](_0x4dd30c(0xf8)),console[_0x4dd30c(0x7b)](_0x4dd30c(0x10b)),console['error'](_0x4dd30c(0xbe)),0x1;try{const _0x4aa7c7=_0x40f94e['segmentPath'];let _0x36acb3=_0x433f58;!_0x46cf71&&_0x4aa7c7&&!_0x433f58[_0x4dd30c(0x97)]('/')&&(_0x36acb3=_0x4aa7c7+'/'+_0x433f58,_0x40f94e[_0x4dd30c(0xe3)]&&console['error'](_0x4dd30c(0xf1)+_0x36acb3));const _0x1e31be=await withSpinner(_0x4dd30c(0xd2)+_0x36acb3+'\x27...',()=>_0x1afa0c['segment'][_0x4dd30c(0x118)](_0x36acb3),{'verbose':_0x40f94e[_0x4dd30c(0xe3)]}),_0x318729=_0x1e31be[_0x4dd30c(0x10c)];_0x40f94e[_0x4dd30c(0xe3)]&&(console['error']('Resolved\x20type:\x20'+_0x318729['type']),console[_0x4dd30c(0x7b)](_0x4dd30c(0xbb)+_0x318729['parentId']),_0x318729[_0x4dd30c(0x9a)]&&console[_0x4dd30c(0x7b)]('Folder\x20ID:\x20'+_0x318729[_0x4dd30c(0x9a)]),_0x318729['segmentId']&&console[_0x4dd30c(0x7b)](_0x4dd30c(0x91)+_0x318729['segmentId']));if(_0x318729['type']===_0x4dd30c(0xc3)){const _0x2f811f=await withSpinner(_0x4dd30c(0xee),()=>_0x1afa0c[_0x4dd30c(0xca)][_0x4dd30c(0x10f)](_0x318729[_0x4dd30c(0xfb)]),{'verbose':_0x40f94e[_0x4dd30c(0xe3)]});await handleSingleObjectOutput(_0x2f811f['data'],_0x40f94e);}else{if(_0x318729[_0x4dd30c(0xeb)]===_0x4dd30c(0x90)){if(!_0x318729[_0x4dd30c(0x9a)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4766d0=await withSpinner(_0x4dd30c(0x10d),()=>_0x1afa0c[_0x4dd30c(0xca)][_0x4dd30c(0xa2)](_0x318729['folderId']),{'verbose':_0x40f94e[_0x4dd30c(0xe3)]});await handleSingleObjectOutput(_0x4766d0[_0x4dd30c(0x10c)],_0x40f94e);}else{if(_0x318729['type']===_0x4dd30c(0xca)){if(!_0x318729[_0x4dd30c(0xbf)])throw new SDKError(ErrorCode[_0x4dd30c(0x76)],_0x4dd30c(0x79));const _0x10010a=await withSpinner(_0x4dd30c(0xe8),()=>_0x1afa0c[_0x4dd30c(0xca)]['getSegment'](_0x318729[_0x4dd30c(0xfb)],_0x318729[_0x4dd30c(0xbf)]),{'verbose':_0x40f94e[_0x4dd30c(0xe3)]});await handleSingleObjectOutput(_0x10010a['data'],_0x40f94e);}}}return 0x0;}catch(_0x371551){if(_0x371551 instanceof SDKError)return console['error'](_0x4dd30c(0x112)+_0x371551['message']),_0x371551['cause']&&console[_0x4dd30c(0x7b)](_0x4dd30c(0xf2)+_0x371551[_0x4dd30c(0x86)]),0x1;throw _0x371551;}}}export class SegmentShowCommand extends BaseCommand{[a31_0xb8ac85(0x78)]=a31_0xb8ac85(0x10e);[a31_0xb8ac85(0xb8)]=a31_0xb8ac85(0xfc);async[a31_0xb8ac85(0xab)](_0x517ece){const _0x28a102=a31_0xb8ac85,{options:_0x72e47,args:_0x40f577,tdx:_0x10a4e2}=_0x517ece,_0x2bf96d=_0x40f577[0x0];if(!_0x2bf96d)return console[_0x28a102(0x7b)](_0x28a102(0xd4)),console[_0x28a102(0x7b)](_0x28a102(0xda)),console[_0x28a102(0x7b)](_0x28a102(0xc4)),console[_0x28a102(0x7b)]('Examples:'),console[_0x28a102(0x7b)](_0x28a102(0x106)),console[_0x28a102(0x7b)](_0x28a102(0xdb)),0x1;try{const _0x4fb28d=_0x72e47[_0x28a102(0xfd)],_0x4b699b=await resolveSegmentTarget(_0x2bf96d,_0x4fb28d,_0x72e47[_0x28a102(0xe3)]);_0x72e47['verbose']&&console[_0x28a102(0x7b)](_0x28a102(0xac)+_0x4b699b);const _0x375a1e=await withSpinner(_0x28a102(0x84)+_0x2bf96d+_0x28a102(0x85),()=>_0x10a4e2[_0x28a102(0xca)][_0x28a102(0x118)](_0x4b699b),{'verbose':_0x72e47[_0x28a102(0xe3)]}),_0x6faef8=_0x375a1e['data'];_0x72e47[_0x28a102(0xe3)]&&(console[_0x28a102(0x7b)]('Resolved\x20type:\x20'+_0x6faef8[_0x28a102(0xeb)]),console['error'](_0x28a102(0xbb)+_0x6faef8[_0x28a102(0xfb)]));if(_0x6faef8['type']===_0x28a102(0x90))return console['error'](_0x28a102(0xa9)),console[_0x28a102(0x7b)](_0x28a102(0x89)),0x1;if(_0x6faef8[_0x28a102(0xeb)]===_0x28a102(0xc3))return console[_0x28a102(0x7b)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x28a102(0x7b)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x6faef8['segmentId'])throw new SDKError(ErrorCode[_0x28a102(0x76)],_0x28a102(0x79));const _0x15b2cb=await withSpinner(_0x28a102(0xec),()=>_0x10a4e2[_0x28a102(0xca)]['getSegmentSQL'](_0x6faef8[_0x28a102(0xfb)],_0x6faef8[_0x28a102(0xbf)]),{'verbose':_0x72e47[_0x28a102(0xe3)]});let _0xe8a838=_0x15b2cb[_0x28a102(0x10c)];const _0x394403=resolveLimit(_0x72e47[_0x28a102(0xa5)],DEFAULT_DISPLAY_LIMIT),_0x1cf343=/\bLIMIT\s+\d+/i[_0x28a102(0xc1)](_0xe8a838);!_0x1cf343&&(_0xe8a838=_0xe8a838['trim']()[_0x28a102(0x100)](/;+$/,''),_0xe8a838='SELECT\x20*\x20FROM\x20(\x0a'+_0xe8a838+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x394403);_0x72e47['verbose']&&console[_0x28a102(0x7b)]('SQL\x20query:\x0a'+_0xe8a838);const _0x13a71f=await withProgressSpinner(_0x28a102(0xe5),async _0x2604be=>{const _0x65ff9c=_0x28a102,_0x1c888b=await _0x10a4e2[_0x65ff9c(0xc2)]['execute'](_0xe8a838,{'catalog':'td','schema':_0x65ff9c(0xe6),'onJobId':_0x1a46fd=>{const _0x28a23f=_0x65ff9c;_0x2604be[_0x28a23f(0x109)](_0x1a46fd);}});return _0x1c888b;},{'verbose':_0x72e47['verbose']}),_0x331626=_0x13a71f[_0x28a102(0x10c)],_0x5ec754=_0x331626[_0x28a102(0xcd)]?_0x28a102(0xf3)+_0x331626[_0x28a102(0xcd)]+']':'';return console[_0x28a102(0x7b)](_0x28a102(0xea)+_0x331626['stats'][_0x28a102(0xa3)][_0x28a102(0xe1)]()+'\x20rows\x20'+(_0x28a102(0xba)+formatElapsed(_0x331626[_0x28a102(0x115)][_0x28a102(0x116)])+_0x5ec754)),await handleQueryOutput(_0x331626,_0x72e47),0x0;}catch(_0xf74571){if(_0xf74571 instanceof SDKError)return console['error'](_0x28a102(0x81)+_0xf74571['code']+']'),console['error']('\x0a'+_0xf74571[_0x28a102(0xe2)]),0x1;throw _0xf74571;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0xb8ac85(0x78)]=a31_0xb8ac85(0xa7);[a31_0xb8ac85(0xb8)]=a31_0xb8ac85(0xd7);async[a31_0xb8ac85(0xab)](_0x3e304c){const _0x2acd06=a31_0xb8ac85,{options:_0x15e459,args:_0x2aaef5,tdx:_0x5c54e9}=_0x3e304c;if(_0x2aaef5['length']===0x0)return console[_0x2acd06(0x7b)](_0x2acd06(0xe9)),console[_0x2acd06(0x7b)](_0x2acd06(0xf9)),0x1;const _0x9c7cd3=_0x2aaef5[0x0];try{_0x15e459[_0x2acd06(0xe3)]&&(console[_0x2acd06(0x7b)]('Site:\x20'+_0x15e459[_0x2acd06(0xb9)]),console['error']('Parent\x20name:\x20'+_0x9c7cd3));const _0xa3682c=await withSpinner(_0x2acd06(0xf7)+_0x9c7cd3+_0x2acd06(0x85),()=>_0x5c54e9[_0x2acd06(0xca)][_0x2acd06(0x99)](_0x9c7cd3),{'verbose':_0x15e459[_0x2acd06(0xe3)]}),_0x1404d2=_0xa3682c['data'];_0x15e459['verbose']&&console[_0x2acd06(0x7b)]('Resolved\x20parent\x20ID:\x20'+_0x1404d2);const _0x513a5c=await withSpinner(_0x2acd06(0x102)+_0x9c7cd3+_0x2acd06(0x85),()=>_0x5c54e9[_0x2acd06(0xca)][_0x2acd06(0xe4)](_0x1404d2),{'verbose':_0x15e459['verbose']}),_0x3b1553=_0x513a5c[_0x2acd06(0x10c)];return console[_0x2acd06(0x7b)](_0x2acd06(0xf4)+_0x3b1553[_0x2acd06(0x107)]+_0x2acd06(0xcc)+(_0x3b1553[_0x2acd06(0x107)]!==0x1?'s':'')),await handleSDKOutput(_0x3b1553,_0x15e459),0x0;}catch(_0x5ccc67){if(_0x5ccc67 instanceof SDKError)return console[_0x2acd06(0x7b)](_0x2acd06(0x112)+_0x5ccc67['message']),_0x5ccc67[_0x2acd06(0x86)]&&console[_0x2acd06(0x7b)](_0x2acd06(0xf2)+_0x5ccc67[_0x2acd06(0x86)]),0x1;throw _0x5ccc67;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a31_0xb8ac85(0x110);['description']='Show\x20segment\x20folder\x20details';async['execute'](_0x307a8f){const _0x56bae3=a31_0xb8ac85,{options:_0x2b6db3,args:_0xd160ab,tdx:_0x42c79f}=_0x307a8f;if(_0xd160ab['length']===0x0)return console[_0x56bae3(0x7b)](_0x56bae3(0x80)),console[_0x56bae3(0x7b)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4329fe,childId:_0x2cb5b6}=parseSegmentRef(_0xd160ab[0x0]);_0x2b6db3[_0x56bae3(0xe3)]&&(console[_0x56bae3(0x7b)](_0x56bae3(0xdd)+_0x2b6db3[_0x56bae3(0xb9)]),console[_0x56bae3(0x7b)](_0x56bae3(0x101)+_0x4329fe),_0x2cb5b6&&console[_0x56bae3(0x7b)](_0x56bae3(0xd3)+_0x2cb5b6));if(!_0x2cb5b6)return console[_0x56bae3(0x7b)](_0x56bae3(0x8f)),0x1;const _0x3caede=await withSpinner(_0x56bae3(0xf7)+_0x4329fe+_0x56bae3(0x85),()=>_0x42c79f[_0x56bae3(0xca)][_0x56bae3(0x99)](_0x4329fe),{'verbose':_0x2b6db3['verbose']}),_0x143e10=_0x3caede[_0x56bae3(0x10c)];_0x2b6db3[_0x56bae3(0xe3)]&&console[_0x56bae3(0x7b)]('Resolved\x20parent\x20ID:\x20'+_0x143e10);const _0x1df594=await withSpinner(_0x56bae3(0xb3)+_0x2cb5b6+_0x56bae3(0x85),()=>_0x42c79f[_0x56bae3(0xca)][_0x56bae3(0x9f)](_0x143e10,_0x2cb5b6),{'verbose':_0x2b6db3[_0x56bae3(0xe3)]}),_0x5b806e=_0x1df594[_0x56bae3(0x10c)];_0x2b6db3[_0x56bae3(0xe3)]&&console[_0x56bae3(0x7b)](_0x56bae3(0x7d)+_0x5b806e);const _0x2b51f0=await withSpinner(_0x56bae3(0x8a)+_0x2cb5b6+_0x56bae3(0x85),()=>_0x42c79f['segment'][_0x56bae3(0xa2)](_0x5b806e),{'verbose':_0x2b6db3[_0x56bae3(0xe3)]});return await handleSDKOutput([_0x2b51f0['data']],_0x2b6db3),0x0;}catch(_0x1713a3){if(_0x1713a3 instanceof SDKError)return console[_0x56bae3(0x7b)]('Error:\x20'+_0x1713a3[_0x56bae3(0xe2)]),_0x1713a3[_0x56bae3(0x86)]&&console[_0x56bae3(0x7b)](_0x56bae3(0xf2)+_0x1713a3[_0x56bae3(0x86)]),0x1;throw _0x1713a3;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0xb8ac85(0x78)]=a31_0xb8ac85(0xb5);[a31_0xb8ac85(0xb8)]=a31_0xb8ac85(0x93);async[a31_0xb8ac85(0xab)](_0x3293a1){const _0x5e22cd=a31_0xb8ac85,{options:_0x3d7f38,args:_0x4f1d33,tdx:_0x483090}=_0x3293a1,_0x23e2c0=_0x4f1d33[0x0];if(!_0x23e2c0)return console['error'](_0x5e22cd(0xd4)),console[_0x5e22cd(0x7b)](_0x5e22cd(0xed)),console['error'](_0x5e22cd(0x114)),console[_0x5e22cd(0x7b)]('Examples:'),console[_0x5e22cd(0x7b)](_0x5e22cd(0xe0)),console['error'](_0x5e22cd(0xef)),0x1;try{const _0x454688=_0x3d7f38['parentSegment'],_0x1805b9=await resolveSegmentTarget(_0x23e2c0,_0x454688,_0x3d7f38[_0x5e22cd(0xe3)]);_0x3d7f38[_0x5e22cd(0xe3)]&&console[_0x5e22cd(0x7b)]('Target\x20path:\x20'+_0x1805b9);const _0xc55e67=await withSpinner(_0x5e22cd(0x84)+_0x23e2c0+_0x5e22cd(0x85),()=>_0x483090[_0x5e22cd(0xca)]['resolvePathToResource'](_0x1805b9),{'verbose':_0x3d7f38[_0x5e22cd(0xe3)]}),_0x923712=_0xc55e67[_0x5e22cd(0x10c)];_0x3d7f38[_0x5e22cd(0xe3)]&&(console['error'](_0x5e22cd(0xaa)+_0x923712['type']),console['error'](_0x5e22cd(0xbb)+_0x923712[_0x5e22cd(0xfb)]));if(_0x923712[_0x5e22cd(0xeb)]==='folder')return console[_0x5e22cd(0x7b)](_0x5e22cd(0xbd)),console[_0x5e22cd(0x7b)](_0x5e22cd(0x92)),0x1;if(_0x923712[_0x5e22cd(0xeb)]===_0x5e22cd(0xc3))return console[_0x5e22cd(0x7b)](_0x5e22cd(0x87)),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x923712[_0x5e22cd(0xbf)])throw new SDKError(ErrorCode[_0x5e22cd(0x76)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x25a2fa=await withSpinner(_0x5e22cd(0xec),()=>_0x483090[_0x5e22cd(0xca)][_0x5e22cd(0xdc)](_0x923712[_0x5e22cd(0xfb)],_0x923712['segmentId']),{'verbose':_0x3d7f38[_0x5e22cd(0xe3)]}),_0x4423a7=_0x25a2fa[_0x5e22cd(0x10c)];return _0x3d7f38[_0x5e22cd(0xc7)]===_0x5e22cd(0xc5)||_0x3d7f38[_0x5e22cd(0xc7)]==='jsonl'?await handleSDKOutput([{'sql':_0x4423a7}],_0x3d7f38):console[_0x5e22cd(0xb4)](_0x4423a7),0x0;}catch(_0x3344a4){if(_0x3344a4 instanceof SDKError)return console[_0x5e22cd(0x7b)](_0x5e22cd(0x112)+_0x3344a4['message']),_0x3344a4['cause']&&console[_0x5e22cd(0x7b)]('\x20\x20Cause:\x20'+_0x3344a4['cause']),0x1;throw _0x3344a4;}}}function a31_0x35d9(_0x4cb2d8,_0x4fec56){_0x4cb2d8=_0x4cb2d8-0x76;const _0x2ecd9b=a31_0x2ecd();let _0x35d947=_0x2ecd9b[_0x4cb2d8];return _0x35d947;}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0xb8ac85(0x78)]='segment:folder:create';[a31_0xb8ac85(0xb8)]=a31_0xb8ac85(0xc0);async[a31_0xb8ac85(0xab)](_0x54457e){const _0x5c9991=a31_0xb8ac85,{options:_0x2807d3,args:_0x278a39,tdx:_0x1d2814}=_0x54457e,_0x3b71a2=_0x2807d3;if(_0x278a39[_0x5c9991(0x107)]<0x2)return console[_0x5c9991(0x7b)](_0x5c9991(0x108)),console[_0x5c9991(0x7b)](_0x5c9991(0xd6)),0x1;const _0x40e231=_0x278a39[0x0],_0xe3b554=_0x278a39[0x1];_0x3b71a2[_0x5c9991(0xe3)]&&(console[_0x5c9991(0x7b)]('Site:\x20'+_0x3b71a2[_0x5c9991(0xb9)]),console[_0x5c9991(0x7b)](_0x5c9991(0xdf)+_0x40e231),console['error'](_0x5c9991(0xd3)+_0xe3b554));let _0x5c1c30;if(_0x3b71a2['parentFolder']){const _0x3b204f=_0x3b71a2[_0x5c9991(0xbc)],_0x429f6c=await withSpinner(_0x5c9991(0xf7)+_0x40e231+_0x5c9991(0x85),()=>_0x1d2814[_0x5c9991(0xca)][_0x5c9991(0x99)](_0x40e231),{'verbose':_0x3b71a2[_0x5c9991(0xe3)]}),_0x5336d6=_0x429f6c[_0x5c9991(0x10c)],_0xd67e65=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3b204f+_0x5c9991(0x85),()=>_0x1d2814['segment'][_0x5c9991(0x9f)](_0x5336d6,_0x3b204f),{'verbose':_0x3b71a2[_0x5c9991(0xe3)]});_0x5c1c30=_0xd67e65['data'],_0x3b71a2[_0x5c9991(0xe3)]&&console[_0x5c9991(0x7b)](_0x5c9991(0xa1)+_0x5c1c30);}const _0x4c7bde={'name':_0xe3b554,'description':_0x3b71a2[_0x5c9991(0xb8)],'parentFolderId':_0x5c1c30},_0x332a4c=await withSpinner(_0x5c9991(0xb6)+_0xe3b554+'\x27...',()=>_0x1d2814[_0x5c9991(0xca)][_0x5c9991(0xd0)](_0x40e231,_0x4c7bde),{'verbose':_0x3b71a2['verbose']}),_0x1e523e=_0x332a4c[_0x5c9991(0x10c)];return console[_0x5c9991(0x7b)]('✔\x20Created\x20folder\x20\x27'+_0x1e523e['name']+_0x5c9991(0xe7)+_0x1e523e['id']),await handleSDKOutput([_0x1e523e],_0x3b71a2),0x0;}}function a31_0x2ecd(){const _0x4ea155=['getParent','segment:folder:show','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20','3jVfcQE','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','stats','elapsedTimeMillis','\x20\x20Parent\x20segment:\x20','resolvePathToResource','SEGMENT_NOT_FOUND','segment:describe','name','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','error','Usage:\x20tdx\x20sg\x20desc\x20<name>','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Show\x20segment\x20or\x20folder\x20details','Error:\x20Folder\x20reference\x20is\x20required','✖\x20Query\x20failed\x20[','1351550QLbbQV','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolving\x20\x27','\x27...','cause','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20view','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Fetching\x20folder\x20\x27','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','/e/','web','segment:view','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','folder','Segment\x20ID:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Get\x20SQL\x20query\x20for\x20child\x20segment','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','1231104GmffaV','Usage:\x20tdx\x20segment\x20describe\x20<path>','includes','1193948PPCktp','resolveParentId','folderId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','/app/ps/','SEGMENT_FOLDER_NOT_FOUND','resolveFolderId','33FYQNhG','Resolved\x20parent\x20folder\x20ID:\x20','getFolder','processedRows','589880DWkAOV','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','segment:folder:list','Examples:','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20type:\x20','execute','Target\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','INVALID_ARGUMENT','folderPath','\x20\x20Segment\x20name:\x20','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Resolving\x20folder\x20\x27','log','segment:sql','Creating\x20folder\x20\x27','(root)','description','site','in\x20','Parent\x20ID:\x20','parentFolder','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segmentId','Create\x20segment\x20folder\x20for\x20organization','test','query','parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','json','7RrmGGx','format','Folder\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment','segmentName','\x20folder','jobId','3031045wkzeLX','Folder\x20ID\x20missing\x20from\x20resolved\x20path','createFolder','green','Resolving\x20path\x20\x27','Folder\x20name:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','416804EEoAzp','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','getSegmentSQL','Site:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Parent\x20segment:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','toLocaleString','message','verbose','listFolders','Executing\x20segment\x20query...','information_schema','\x27\x20with\x20ID:\x20','Fetching\x20segment\x20details...','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Query\x20completed:\x20Processed\x20','type','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20sg\x20sql\x20<name>','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20Full\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20Cause:\x20','\x20[Job\x20ID:\x20','✔\x20Found\x20','segment:desc','getSegment','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20Folder\x20path:\x20','parentId','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','parentSegment','6MMGHkN','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','replace','Parent\x20name:\x20','Listing\x20folders\x20for\x20parent\x20\x27','Show\x20child\x20segment\x20schema\x20(column\x20types)','13653981yQqzqu','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','length','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','setJobId','cyan','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','data','Fetching\x20folder\x20details...','segment:show'];a31_0x2ecd=function(){return _0x4ea155;};return a31_0x2ecd();}export class SegmentViewCommand extends BaseCommand{['name']=a31_0xb8ac85(0x8e);['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x28c363){const _0x58b4da=a31_0xb8ac85,{options:_0x68288d,args:_0x11c4b2,tdx:_0x5071d6}=_0x28c363,_0x1c4245=_0x11c4b2[0x0];if(!_0x1c4245)return console[_0x58b4da(0x7b)](_0x58b4da(0x9b)),console[_0x58b4da(0x7b)](_0x58b4da(0xd9)),console[_0x58b4da(0x7b)](_0x58b4da(0xa6)),console[_0x58b4da(0x7b)]('Options:'),console['error'](_0x58b4da(0x105)),console['error'](_0x58b4da(0xa8)),console[_0x58b4da(0x7b)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error'](_0x58b4da(0x7a)),console[_0x58b4da(0x7b)](_0x58b4da(0xc9)),console[_0x58b4da(0x7b)](_0x58b4da(0x83)),0x1;try{const _0x2a8dfa=_0x68288d[_0x58b4da(0xfd)],_0x246671=await resolveSegmentTarget(_0x1c4245,_0x2a8dfa,_0x68288d[_0x58b4da(0xe3)]);_0x68288d[_0x58b4da(0xe3)]&&console[_0x58b4da(0x7b)](_0x58b4da(0xac)+_0x246671);const _0x4d17d5=await withSpinner(_0x58b4da(0x84)+_0x1c4245+_0x58b4da(0x85),()=>_0x5071d6['segment'][_0x58b4da(0x118)](_0x246671),{'verbose':_0x68288d[_0x58b4da(0xe3)]}),_0x3a0f7d=_0x4d17d5[_0x58b4da(0x10c)];_0x68288d['verbose']&&(console[_0x58b4da(0x7b)](_0x58b4da(0xaa)+_0x3a0f7d[_0x58b4da(0xeb)]),console[_0x58b4da(0x7b)](_0x58b4da(0xbb)+_0x3a0f7d[_0x58b4da(0xfb)]),_0x3a0f7d[_0x58b4da(0x9a)]&&console[_0x58b4da(0x7b)](_0x58b4da(0xc8)+_0x3a0f7d[_0x58b4da(0x9a)]),_0x3a0f7d['segmentId']&&console[_0x58b4da(0x7b)](_0x58b4da(0x91)+_0x3a0f7d[_0x58b4da(0xbf)]));if(_0x68288d[_0x58b4da(0x8d)]){if(_0x3a0f7d['type']===_0x58b4da(0x90))return console[_0x58b4da(0x7b)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x3a0f7d[_0x58b4da(0xeb)]===_0x58b4da(0xc3))return console[_0x58b4da(0x7b)](_0x58b4da(0x9c)),console[_0x58b4da(0x7b)](_0x58b4da(0xb1)),0x1;if(!_0x3a0f7d[_0x58b4da(0xbf)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x33014e=getConsoleNextUrl(_0x68288d[_0x58b4da(0xb9)],_0x58b4da(0x9d)+_0x3a0f7d[_0x58b4da(0xfb)]+_0x58b4da(0x8c)+_0x3a0f7d['segmentId']);return console[_0x58b4da(0x7b)](a31_0x483734[_0x58b4da(0xd1)]('✔')+'\x20Opening\x20'+a31_0x483734[_0x58b4da(0x10a)](_0x33014e)),openBrowser(_0x33014e),0x0;}if(_0x3a0f7d[_0x58b4da(0xeb)]===_0x58b4da(0x90)){if(!_0x3a0f7d[_0x58b4da(0x9a)])throw new SDKError(ErrorCode[_0x58b4da(0x9e)],_0x58b4da(0xcf));const _0x49ad5c=await withSpinner(_0x58b4da(0x10d),()=>_0x5071d6[_0x58b4da(0xca)][_0x58b4da(0xa2)](_0x3a0f7d[_0x58b4da(0x9a)]),{'verbose':_0x68288d[_0x58b4da(0xe3)]});await handleSingleObjectOutput(_0x49ad5c[_0x58b4da(0x10c)],_0x68288d);}else{if(_0x3a0f7d[_0x58b4da(0xeb)]==='segment'){if(!_0x3a0f7d[_0x58b4da(0xbf)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x484c0a=await withSpinner('Fetching\x20segment\x20details...',()=>_0x5071d6[_0x58b4da(0xca)][_0x58b4da(0xf6)](_0x3a0f7d[_0x58b4da(0xfb)],_0x3a0f7d[_0x58b4da(0xbf)]),{'verbose':_0x68288d[_0x58b4da(0xe3)]}),_0x554790=getConsoleNextUrl(_0x68288d[_0x58b4da(0xb9)],'/app/ps/'+_0x3a0f7d[_0x58b4da(0xfb)]+_0x58b4da(0x8c)+_0x3a0f7d[_0x58b4da(0xbf)]),_0x42c4a6=_0x484c0a['data'];_0x42c4a6['url']=_0x554790,await handleSingleObjectOutput(_0x42c4a6,_0x68288d);}else return console[_0x58b4da(0x7b)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x58b4da(0x7b)](_0x58b4da(0x88)),0x1;}return 0x0;}catch(_0x4fa280){if(_0x4fa280 instanceof SDKError)return console[_0x58b4da(0x7b)](_0x58b4da(0x112)+_0x4fa280[_0x58b4da(0xe2)]),_0x4fa280['cause']&&console['error'](_0x58b4da(0xf2)+_0x4fa280[_0x58b4da(0x86)]),0x1;throw _0x4fa280;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0xb8ac85(0x78)]=a31_0xb8ac85(0xf5);[a31_0xb8ac85(0xb8)]=a31_0xb8ac85(0x103);async[a31_0xb8ac85(0xab)](_0x16addf){const _0x29be88=a31_0xb8ac85,{options:_0xb56a75,args:_0x3e93c7,tdx:_0x2e25ec}=_0x16addf,_0x52831c=_0x3e93c7[0x0];if(!_0x52831c)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x29be88(0x7b)](_0x29be88(0x7c)),console[_0x29be88(0x7b)](_0x29be88(0xb2)),console[_0x29be88(0x7b)](_0x29be88(0xa8)),console[_0x29be88(0x7b)](_0x29be88(0x7e)),console[_0x29be88(0x7b)](_0x29be88(0xd5)),0x1;try{const _0x15ceda=_0xb56a75[_0x29be88(0xfd)],_0x16fd49=await resolveSegmentTarget(_0x52831c,_0x15ceda,_0xb56a75[_0x29be88(0xe3)]);_0xb56a75[_0x29be88(0xe3)]&&console['error'](_0x29be88(0xac)+_0x16fd49);const _0x5e24d0=await withSpinner(_0x29be88(0x84)+_0x52831c+'\x27...',()=>_0x2e25ec[_0x29be88(0xca)][_0x29be88(0x118)](_0x16fd49),{'verbose':_0xb56a75['verbose']}),_0x5165a9=_0x5e24d0['data'];_0xb56a75[_0x29be88(0xe3)]&&(console['error']('Resolved\x20type:\x20'+_0x5165a9[_0x29be88(0xeb)]),console['error'](_0x29be88(0xbb)+_0x5165a9[_0x29be88(0xfb)]));if(_0x5165a9[_0x29be88(0xeb)]===_0x29be88(0x90))return console['error'](_0x29be88(0xad)),console[_0x29be88(0x7b)](_0x29be88(0x92)),0x1;if(_0x5165a9[_0x29be88(0xeb)]===_0x29be88(0xc3))return console['error'](_0x29be88(0x111)),console[_0x29be88(0x7b)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x5165a9[_0x29be88(0xbf)])throw new SDKError(ErrorCode[_0x29be88(0x76)],_0x29be88(0x79));const _0x203516=await withSpinner(_0x29be88(0xec),()=>_0x2e25ec[_0x29be88(0xca)][_0x29be88(0xdc)](_0x5165a9[_0x29be88(0xfb)],_0x5165a9[_0x29be88(0xbf)]),{'verbose':_0xb56a75[_0x29be88(0xe3)]}),_0x1063a5=_0x203516[_0x29be88(0x10c)],_0x8372f8=await executeSchemaQuery(_0x1063a5,_0x2e25ec,_0xb56a75);return await handleQueryOutput(_0x8372f8,_0xb56a75),0x0;}catch(_0x79152){if(_0x79152 instanceof SDKError)return console['error'](_0x29be88(0x112)+_0x79152[_0x29be88(0xe2)]),_0x79152[_0x29be88(0x86)]&&console['error']('\x20\x20Cause:\x20'+_0x79152[_0x29be88(0x86)]),0x1;throw _0x79152;}}}
|
|
1
|
+
const a31_0x21cbf2=a31_0x5c0d;(function(_0x183b95,_0x35b01e){const _0x585905=a31_0x5c0d,_0x19246a=_0x183b95();while(!![]){try{const _0x4097ef=-parseInt(_0x585905(0x13b))/0x1*(-parseInt(_0x585905(0x10f))/0x2)+parseInt(_0x585905(0xee))/0x3*(-parseInt(_0x585905(0x11b))/0x4)+-parseInt(_0x585905(0xbc))/0x5+-parseInt(_0x585905(0x139))/0x6*(parseInt(_0x585905(0xf5))/0x7)+-parseInt(_0x585905(0xbf))/0x8+parseInt(_0x585905(0x130))/0x9+parseInt(_0x585905(0xe4))/0xa*(-parseInt(_0x585905(0x11d))/0xb);if(_0x4097ef===_0x35b01e)break;else _0x19246a['push'](_0x19246a['shift']());}catch(_0x409995){_0x19246a['push'](_0x19246a['shift']());}}}(a31_0x1ed4,0x8aa90));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a31_0x5c0d(_0x388cb3,_0x41ed34){_0x388cb3=_0x388cb3-0xab;const _0x1ed4c1=a31_0x1ed4();let _0x5c0d0d=_0x1ed4c1[_0x388cb3];return _0x5c0d0d;}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';function a31_0x1ed4(){const _0x2545df=['27184ixxoQQ','toLocaleString','9295ryEfyr','description','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Use:\x20tdx\x20ps\x20desc','parentFolder','replace','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderPath','folderId','Resolving\x20folder\x20\x27','segment:folder:list','Examples:','in\x20','\x20[Job\x20ID:\x20','Fetching\x20folder\x20details...','Use:\x20tdx\x20ps\x20view','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','9481743xKSngJ','information_schema','\x20\x20Folder\x20path:\x20','jsonl','getFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Options:','Creating\x20folder\x20\x27','\x20rows\x20','6sQDmaI','includes','1XrjUBY','Resolved\x20parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20sql\x20<name>','message','cause','✔\x20Created\x20folder\x20\x27','parentSegment','Resolved\x20YAML\x20file:\x20','error','segmentId','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','setJobId','site','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Use:\x20tdx\x20ps\x20view\x20-w','Parent\x20name:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Resolving\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Fetching\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folder','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','1598100PjGyxc','jobId','getParent','5474264FgVSFQ','length','Resolved\x20folder\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','Segment\x20ID:\x20','Resolving\x20path\x20\x27','type','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Listing\x20folders\x20for\x20parent\x20\x27','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','limit','Show\x20segment\x20or\x20folder\x20details','getSegmentSQL','createFolder','Error:\x20','segment:desc','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Get\x20SQL\x20query\x20for\x20child\x20segment','Executing\x20segment\x20query...','json','segment:show','execute','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Site:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x27...','Parent\x20segment:\x20','840VuzmZY','format','green','SQL\x20query:\x0a','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:describe','verbose','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentName','3ihjNhm','\x27\x20with\x20ID:\x20','\x20\x20Segment\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segment','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','90363UVbDIt','\x20folder','parent','Fetching\x20segment\x20details...','Target\x20path:\x20','Create\x20segment\x20folder\x20for\x20organization','/app/ps/','resolveFolderId','Folder\x20ID:\x20','listFolders','(root)','query','/e/','name','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20type:\x20','SEGMENT_FOLDER_NOT_FOUND','segment:folder:show','code','\x20\x20Cause:\x20','SEGMENT_NOT_FOUND','Show\x20folder\x20or\x20child\x20segment\x20details','trim','parentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','1218026hvcYEQ','stats','✔\x20Found\x20','Resolved\x20relative\x20path\x20to:\x20','data','segment:view','SELECT\x20*\x20FROM\x20(\x0a','getSegment','fullPath','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolved\x20parent\x20folder\x20ID:\x20'];a31_0x1ed4=function(){return _0x2545df;};return a31_0x1ed4();}import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0xe2ca85 from'chalk';async function resolveSegmentTarget(_0x35e45f,_0x5efd87,_0x451060){const _0x10e7cc=a31_0x5c0d;if(isYamlFilePath(_0x35e45f))try{const _0x5b09fa=await resolveYamlFilePath(_0x35e45f);return _0x451060&&(console[_0x10e7cc(0x144)](_0x10e7cc(0x143)+_0x35e45f),console[_0x10e7cc(0x144)]('\x20\x20Parent\x20segment:\x20'+_0x5b09fa[_0x10e7cc(0x142)]),console[_0x10e7cc(0x144)](_0x10e7cc(0xf0)+_0x5b09fa[_0x10e7cc(0xed)]),console['error'](_0x10e7cc(0x132)+(_0x5b09fa[_0x10e7cc(0x125)]||_0x10e7cc(0xff))),console['error']('\x20\x20Full\x20path:\x20'+_0x5b09fa['fullPath'])),_0x5b09fa[_0x10e7cc(0x117)];}catch(_0x2d525c){throw new SDKError(ErrorCode[_0x10e7cc(0xb9)],_0x10e7cc(0xd6)+_0x2d525c[_0x10e7cc(0x13f)]);}if(!_0x5efd87)throw new SDKError(ErrorCode[_0x10e7cc(0xb9)],_0x10e7cc(0xe8));return _0x5efd87+'/'+_0x35e45f;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xea);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xcf);async['execute'](_0x5d6397){const _0x14c2e9=a31_0x21cbf2,{options:_0x1127ce,args:_0x2994a0,tdx:_0xa1ecb0}=_0x5d6397,_0x434041=_0x2994a0[0x0],_0x227fb9=!_0x434041&&!!_0x1127ce[_0x14c2e9(0x142)],_0x98bd3=_0x434041||_0x1127ce[_0x14c2e9(0x142)];if(!_0x98bd3)return console[_0x14c2e9(0x144)](_0x14c2e9(0xb3)),console['error'](_0x14c2e9(0xcb)),console['error'](_0x14c2e9(0x129)),console['error'](_0x14c2e9(0xf4)),console[_0x14c2e9(0x144)](_0x14c2e9(0x124)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x14c2e9(0x144)](_0x14c2e9(0xb7)),0x1;try{const _0x1214bf=_0x1127ce['segmentPath'];let _0x27eccb=_0x98bd3;!_0x227fb9&&_0x1214bf&&!_0x98bd3[_0x14c2e9(0x13a)]('/')&&(_0x27eccb=_0x1214bf+'/'+_0x98bd3,_0x1127ce['verbose']&&console[_0x14c2e9(0x144)](_0x14c2e9(0x112)+_0x27eccb));const _0x31db2c=await withSpinner(_0x14c2e9(0xc5)+_0x27eccb+'\x27...',()=>_0xa1ecb0[_0x14c2e9(0xf2)]['resolvePathToResource'](_0x27eccb),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]}),_0x37ecb7=_0x31db2c[_0x14c2e9(0x113)];_0x1127ce[_0x14c2e9(0xeb)]&&(console[_0x14c2e9(0x144)](_0x14c2e9(0x105)+_0x37ecb7[_0x14c2e9(0xc6)]),console['error']('Parent\x20ID:\x20'+_0x37ecb7[_0x14c2e9(0x10d)]),_0x37ecb7[_0x14c2e9(0x126)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0xfd)+_0x37ecb7[_0x14c2e9(0x126)]),_0x37ecb7[_0x14c2e9(0xab)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0xc4)+_0x37ecb7[_0x14c2e9(0xab)]));if(_0x37ecb7[_0x14c2e9(0xc6)]===_0x14c2e9(0xf7)){const _0x1557de=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0xa1ecb0[_0x14c2e9(0xf2)][_0x14c2e9(0xbe)](_0x37ecb7[_0x14c2e9(0x10d)]),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x1557de[_0x14c2e9(0x113)],_0x1127ce);}else{if(_0x37ecb7['type']===_0x14c2e9(0xb8)){if(!_0x37ecb7[_0x14c2e9(0x126)])throw new SDKError(ErrorCode[_0x14c2e9(0x106)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4a72d6=await withSpinner('Fetching\x20folder\x20details...',()=>_0xa1ecb0[_0x14c2e9(0xf2)][_0x14c2e9(0x134)](_0x37ecb7[_0x14c2e9(0x126)]),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x4a72d6[_0x14c2e9(0x113)],_0x1127ce);}else{if(_0x37ecb7[_0x14c2e9(0xc6)]===_0x14c2e9(0xf2)){if(!_0x37ecb7[_0x14c2e9(0xab)])throw new SDKError(ErrorCode[_0x14c2e9(0x10a)],_0x14c2e9(0xc8));const _0x29d319=await withSpinner(_0x14c2e9(0xf8),()=>_0xa1ecb0[_0x14c2e9(0xf2)]['getSegment'](_0x37ecb7[_0x14c2e9(0x10d)],_0x37ecb7['segmentId']),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x29d319[_0x14c2e9(0x113)],_0x1127ce);}}}return 0x0;}catch(_0x3b27b9){if(_0x3b27b9 instanceof SDKError)return console['error'](_0x14c2e9(0xd2)+_0x3b27b9[_0x14c2e9(0x13f)]),_0x3b27b9[_0x14c2e9(0x140)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0x109)+_0x3b27b9['cause']),0x1;throw _0x3b27b9;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xdc);[a31_0x21cbf2(0x11e)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x21cbf2(0xdd)](_0x92d7dc){const _0x5cc12b=a31_0x21cbf2,{options:_0x329f20,args:_0x216e8a,tdx:_0x4646e9}=_0x92d7dc,_0x194847=_0x216e8a[0x0];if(!_0x194847)return console['error'](_0x5cc12b(0xc2)),console[_0x5cc12b(0x144)](_0x5cc12b(0x119)),console['error'](_0x5cc12b(0x13d)),console['error']('Examples:'),console[_0x5cc12b(0x144)](_0x5cc12b(0xba)),console[_0x5cc12b(0x144)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x417c65=_0x329f20[_0x5cc12b(0x142)],_0x3e519c=await resolveSegmentTarget(_0x194847,_0x417c65,_0x329f20[_0x5cc12b(0xeb)]);_0x329f20[_0x5cc12b(0xeb)]&&console[_0x5cc12b(0x144)](_0x5cc12b(0xf9)+_0x3e519c);const _0x23b42c=await withSpinner(_0x5cc12b(0xb4)+_0x194847+_0x5cc12b(0xe2),()=>_0x4646e9[_0x5cc12b(0xf2)][_0x5cc12b(0x12f)](_0x3e519c),{'verbose':_0x329f20[_0x5cc12b(0xeb)]}),_0x5c5e04=_0x23b42c[_0x5cc12b(0x113)];_0x329f20[_0x5cc12b(0xeb)]&&(console['error'](_0x5cc12b(0x105)+_0x5c5e04[_0x5cc12b(0xc6)]),console[_0x5cc12b(0x144)](_0x5cc12b(0xf3)+_0x5c5e04[_0x5cc12b(0x10d)]));if(_0x5c5e04[_0x5cc12b(0xc6)]===_0x5cc12b(0xb8))return console[_0x5cc12b(0x144)](_0x5cc12b(0xc7)),console[_0x5cc12b(0x144)](_0x5cc12b(0xb0)),0x1;if(_0x5c5e04[_0x5cc12b(0xc6)]===_0x5cc12b(0xf7))return console[_0x5cc12b(0x144)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5cc12b(0x144)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x5c5e04[_0x5cc12b(0xab)])throw new SDKError(ErrorCode[_0x5cc12b(0x10a)],_0x5cc12b(0xc8));const _0x20885b=await withSpinner(_0x5cc12b(0x12e),()=>_0x4646e9[_0x5cc12b(0xf2)][_0x5cc12b(0xd0)](_0x5c5e04[_0x5cc12b(0x10d)],_0x5c5e04[_0x5cc12b(0xab)]),{'verbose':_0x329f20[_0x5cc12b(0xeb)]});let _0x33d8ad=_0x20885b['data'];const _0x1e11d9=resolveLimit(_0x329f20[_0x5cc12b(0xce)],DEFAULT_DISPLAY_LIMIT),_0x206f36=/\bLIMIT\s+\d+/i['test'](_0x33d8ad);!_0x206f36&&(_0x33d8ad=_0x33d8ad[_0x5cc12b(0x10c)]()[_0x5cc12b(0x122)](/;+$/,''),_0x33d8ad=_0x5cc12b(0x115)+_0x33d8ad+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1e11d9);_0x329f20['verbose']&&console[_0x5cc12b(0x144)](_0x5cc12b(0xe7)+_0x33d8ad);const _0x4a3036=await withProgressSpinner(_0x5cc12b(0xda),async _0x420677=>{const _0x371317=_0x5cc12b,_0x470657=await _0x4646e9[_0x371317(0x100)][_0x371317(0xdd)](_0x33d8ad,{'catalog':'td','schema':_0x371317(0x131),'onJobId':_0x2bf59b=>{const _0x292afc=_0x371317;_0x420677[_0x292afc(0xae)](_0x2bf59b);}});return _0x470657;},{'verbose':_0x329f20[_0x5cc12b(0xeb)]}),_0x5dfd4f=_0x4a3036[_0x5cc12b(0x113)],_0x3737d2=_0x5dfd4f[_0x5cc12b(0xbd)]?_0x5cc12b(0x12b)+_0x5dfd4f[_0x5cc12b(0xbd)]+']':'';return console[_0x5cc12b(0x144)](_0x5cc12b(0x123)+_0x5dfd4f[_0x5cc12b(0x110)]['processedRows'][_0x5cc12b(0x11c)]()+_0x5cc12b(0x138)+(_0x5cc12b(0x12a)+formatElapsed(_0x5dfd4f[_0x5cc12b(0x110)]['elapsedTimeMillis'])+_0x3737d2)),await handleQueryOutput(_0x5dfd4f,_0x329f20),0x0;}catch(_0x3198ab){if(_0x3198ab instanceof SDKError)return console[_0x5cc12b(0x144)]('✖\x20Query\x20failed\x20['+_0x3198ab[_0x5cc12b(0x108)]+']'),console[_0x5cc12b(0x144)]('\x0a'+_0x3198ab[_0x5cc12b(0x13f)]),0x1;throw _0x3198ab;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0x128);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0x10e);async[a31_0x21cbf2(0xdd)](_0x50e32f){const _0x3dc20d=a31_0x21cbf2,{options:_0x3874c0,args:_0x2554a3,tdx:_0x2df849}=_0x50e32f;if(_0x2554a3[_0x3dc20d(0xc0)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3dc20d(0x144)](_0x3dc20d(0xe9)),0x1;const _0x28cf8a=_0x2554a3[0x0];try{_0x3874c0[_0x3dc20d(0xeb)]&&(console['error'](_0x3dc20d(0xe0)+_0x3874c0[_0x3dc20d(0xaf)]),console[_0x3dc20d(0x144)](_0x3dc20d(0xb2)+_0x28cf8a));const _0x29cfd0=await withSpinner(_0x3dc20d(0x118)+_0x28cf8a+_0x3dc20d(0xe2),()=>_0x2df849['segment'][_0x3dc20d(0xc3)](_0x28cf8a),{'verbose':_0x3874c0['verbose']}),_0x4bf86c=_0x29cfd0[_0x3dc20d(0x113)];_0x3874c0[_0x3dc20d(0xeb)]&&console[_0x3dc20d(0x144)]('Resolved\x20parent\x20ID:\x20'+_0x4bf86c);const _0x31d929=await withSpinner(_0x3dc20d(0xc9)+_0x28cf8a+_0x3dc20d(0xe2),()=>_0x2df849[_0x3dc20d(0xf2)][_0x3dc20d(0xfe)](_0x4bf86c),{'verbose':_0x3874c0[_0x3dc20d(0xeb)]}),_0x41b0db=_0x31d929['data'];return console['error'](_0x3dc20d(0x111)+_0x41b0db[_0x3dc20d(0xc0)]+_0x3dc20d(0xf6)+(_0x41b0db[_0x3dc20d(0xc0)]!==0x1?'s':'')),await handleSDKOutput(_0x41b0db,_0x3874c0),0x0;}catch(_0x28c1f5){if(_0x28c1f5 instanceof SDKError)return console[_0x3dc20d(0x144)](_0x3dc20d(0xd2)+_0x28c1f5[_0x3dc20d(0x13f)]),_0x28c1f5[_0x3dc20d(0x140)]&&console[_0x3dc20d(0x144)](_0x3dc20d(0x109)+_0x28c1f5[_0x3dc20d(0x140)]),0x1;throw _0x28c1f5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0x107);[a31_0x21cbf2(0x11e)]='Show\x20segment\x20folder\x20details';async[a31_0x21cbf2(0xdd)](_0xe5fc2d){const _0x3137d6=a31_0x21cbf2,{options:_0x207941,args:_0x34b1fc,tdx:_0x631bd0}=_0xe5fc2d;if(_0x34b1fc['length']===0x0)return console['error'](_0x3137d6(0xac)),console[_0x3137d6(0x144)](_0x3137d6(0xb5)),0x1;try{const {parentId:_0x5c508d,childId:_0x7f4ba7}=parseSegmentRef(_0x34b1fc[0x0]);_0x207941['verbose']&&(console[_0x3137d6(0x144)](_0x3137d6(0xe0)+_0x207941[_0x3137d6(0xaf)]),console[_0x3137d6(0x144)]('Parent\x20name:\x20'+_0x5c508d),_0x7f4ba7&&console['error'](_0x3137d6(0xca)+_0x7f4ba7));if(!_0x7f4ba7)return console[_0x3137d6(0x144)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x141a36=await withSpinner(_0x3137d6(0x118)+_0x5c508d+_0x3137d6(0xe2),()=>_0x631bd0[_0x3137d6(0xf2)][_0x3137d6(0xc3)](_0x5c508d),{'verbose':_0x207941[_0x3137d6(0xeb)]}),_0x359bd7=_0x141a36[_0x3137d6(0x113)];_0x207941[_0x3137d6(0xeb)]&&console['error'](_0x3137d6(0x13c)+_0x359bd7);const _0x38a12b=await withSpinner(_0x3137d6(0x127)+_0x7f4ba7+_0x3137d6(0xe2),()=>_0x631bd0[_0x3137d6(0xf2)]['resolveFolderId'](_0x359bd7,_0x7f4ba7),{'verbose':_0x207941[_0x3137d6(0xeb)]}),_0x52e309=_0x38a12b[_0x3137d6(0x113)];_0x207941[_0x3137d6(0xeb)]&&console['error'](_0x3137d6(0xc1)+_0x52e309);const _0x121414=await withSpinner(_0x3137d6(0xb6)+_0x7f4ba7+'\x27...',()=>_0x631bd0['segment'][_0x3137d6(0x134)](_0x52e309),{'verbose':_0x207941[_0x3137d6(0xeb)]});return await handleSDKOutput([_0x121414['data']],_0x207941),0x0;}catch(_0x2b8956){if(_0x2b8956 instanceof SDKError)return console[_0x3137d6(0x144)]('Error:\x20'+_0x2b8956[_0x3137d6(0x13f)]),_0x2b8956[_0x3137d6(0x140)]&&console[_0x3137d6(0x144)](_0x3137d6(0x109)+_0x2b8956[_0x3137d6(0x140)]),0x1;throw _0x2b8956;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xd9);async[a31_0x21cbf2(0xdd)](_0x327522){const _0x3390cd=a31_0x21cbf2,{options:_0x3c4a10,args:_0x513845,tdx:_0x2bd91a}=_0x327522,_0x323838=_0x513845[0x0];if(!_0x323838)return console[_0x3390cd(0x144)](_0x3390cd(0xc2)),console['error'](_0x3390cd(0x13e)),console['error'](_0x3390cd(0xf1)),console[_0x3390cd(0x144)](_0x3390cd(0x129)),console[_0x3390cd(0x144)](_0x3390cd(0x103)),console[_0x3390cd(0x144)](_0x3390cd(0xde)),0x1;try{const _0x3e37e9=_0x3c4a10[_0x3390cd(0x142)],_0x446969=await resolveSegmentTarget(_0x323838,_0x3e37e9,_0x3c4a10[_0x3390cd(0xeb)]);_0x3c4a10[_0x3390cd(0xeb)]&&console[_0x3390cd(0x144)](_0x3390cd(0xf9)+_0x446969);const _0x1c5a56=await withSpinner(_0x3390cd(0xb4)+_0x323838+_0x3390cd(0xe2),()=>_0x2bd91a[_0x3390cd(0xf2)][_0x3390cd(0x12f)](_0x446969),{'verbose':_0x3c4a10[_0x3390cd(0xeb)]}),_0x130a06=_0x1c5a56[_0x3390cd(0x113)];_0x3c4a10[_0x3390cd(0xeb)]&&(console['error']('Resolved\x20type:\x20'+_0x130a06[_0x3390cd(0xc6)]),console['error'](_0x3390cd(0xf3)+_0x130a06[_0x3390cd(0x10d)]));if(_0x130a06['type']===_0x3390cd(0xb8))return console['error'](_0x3390cd(0x104)),console[_0x3390cd(0x144)](_0x3390cd(0x11f)),0x1;if(_0x130a06['type']===_0x3390cd(0xf7))return console[_0x3390cd(0x144)](_0x3390cd(0xcd)),console[_0x3390cd(0x144)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x130a06['segmentId'])throw new SDKError(ErrorCode[_0x3390cd(0x10a)],_0x3390cd(0xc8));const _0x44c5a8=await withSpinner(_0x3390cd(0x12e),()=>_0x2bd91a[_0x3390cd(0xf2)][_0x3390cd(0xd0)](_0x130a06[_0x3390cd(0x10d)],_0x130a06[_0x3390cd(0xab)]),{'verbose':_0x3c4a10[_0x3390cd(0xeb)]}),_0x520931=_0x44c5a8['data'];return _0x3c4a10[_0x3390cd(0xe5)]===_0x3390cd(0xdb)||_0x3c4a10['format']===_0x3390cd(0x133)?await handleSDKOutput([{'sql':_0x520931}],_0x3c4a10):console['log'](_0x520931),0x0;}catch(_0x5c091e){if(_0x5c091e instanceof SDKError)return console[_0x3390cd(0x144)](_0x3390cd(0xd2)+_0x5c091e[_0x3390cd(0x13f)]),_0x5c091e['cause']&&console[_0x3390cd(0x144)]('\x20\x20Cause:\x20'+_0x5c091e['cause']),0x1;throw _0x5c091e;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xfa);async[a31_0x21cbf2(0xdd)](_0x2abee5){const _0x2fd7b5=a31_0x21cbf2,{options:_0x3285d5,args:_0x83cfaf,tdx:_0x5b9dce}=_0x2abee5,_0x546edc=_0x3285d5;if(_0x83cfaf['length']<0x2)return console['error'](_0x2fd7b5(0xdf)),console[_0x2fd7b5(0x144)](_0x2fd7b5(0xec)),0x1;const _0x268317=_0x83cfaf[0x0],_0x45785d=_0x83cfaf[0x1];_0x546edc[_0x2fd7b5(0xeb)]&&(console[_0x2fd7b5(0x144)]('Site:\x20'+_0x546edc[_0x2fd7b5(0xaf)]),console['error'](_0x2fd7b5(0xe3)+_0x268317),console[_0x2fd7b5(0x144)]('Folder\x20name:\x20'+_0x45785d));let _0x581c15;if(_0x546edc['parentFolder']){const _0x37803e=_0x546edc[_0x2fd7b5(0x121)],_0x4d312e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x268317+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xc3)](_0x268317),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]}),_0x1e4302=_0x4d312e[_0x2fd7b5(0x113)],_0x5896bb=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x37803e+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xfc)](_0x1e4302,_0x37803e),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]});_0x581c15=_0x5896bb[_0x2fd7b5(0x113)],_0x546edc['verbose']&&console[_0x2fd7b5(0x144)](_0x2fd7b5(0x11a)+_0x581c15);}const _0x5cc179={'name':_0x45785d,'description':_0x546edc[_0x2fd7b5(0x11e)],'parentFolderId':_0x581c15},_0x3f975f=await withSpinner(_0x2fd7b5(0x137)+_0x45785d+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xd1)](_0x268317,_0x5cc179),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]}),_0x187f2b=_0x3f975f[_0x2fd7b5(0x113)];return console[_0x2fd7b5(0x144)](_0x2fd7b5(0x141)+_0x187f2b[_0x2fd7b5(0x102)]+_0x2fd7b5(0xef)+_0x187f2b['id']),await handleSDKOutput([_0x187f2b],_0x546edc),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a31_0x21cbf2(0x114);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0x10b);async[a31_0x21cbf2(0xdd)](_0x54c2b4){const _0x52a050=a31_0x21cbf2,{options:_0x45a849,args:_0x45ba91,tdx:_0x4d23a2}=_0x54c2b4,_0x56bd1e=_0x45ba91[0x0];if(!_0x56bd1e)return console[_0x52a050(0x144)](_0x52a050(0xd4)),console['error'](_0x52a050(0xd7)),console[_0x52a050(0x144)](_0x52a050(0xcc)),console['error'](_0x52a050(0x136)),console[_0x52a050(0x144)](_0x52a050(0xd8)),console['error']('Examples:'),console[_0x52a050(0x144)](_0x52a050(0xad)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x52a050(0x144)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x52a050(0x144)](_0x52a050(0xd5)),0x1;try{const _0x466fcb=_0x45a849[_0x52a050(0x142)],_0x387554=await resolveSegmentTarget(_0x56bd1e,_0x466fcb,_0x45a849[_0x52a050(0xeb)]);_0x45a849[_0x52a050(0xeb)]&&console[_0x52a050(0x144)](_0x52a050(0xf9)+_0x387554);const _0xd56931=await withSpinner(_0x52a050(0xb4)+_0x56bd1e+_0x52a050(0xe2),()=>_0x4d23a2[_0x52a050(0xf2)][_0x52a050(0x12f)](_0x387554),{'verbose':_0x45a849['verbose']}),_0x1d9aa4=_0xd56931[_0x52a050(0x113)];_0x45a849[_0x52a050(0xeb)]&&(console[_0x52a050(0x144)](_0x52a050(0x105)+_0x1d9aa4[_0x52a050(0xc6)]),console[_0x52a050(0x144)]('Parent\x20ID:\x20'+_0x1d9aa4[_0x52a050(0x10d)]),_0x1d9aa4[_0x52a050(0x126)]&&console[_0x52a050(0x144)](_0x52a050(0xfd)+_0x1d9aa4[_0x52a050(0x126)]),_0x1d9aa4[_0x52a050(0xab)]&&console[_0x52a050(0x144)](_0x52a050(0xc4)+_0x1d9aa4[_0x52a050(0xab)]));if(_0x45a849['web']){if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xb8))return console[_0x52a050(0x144)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xf7))return console[_0x52a050(0x144)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x52a050(0x144)](_0x52a050(0xb1)),0x1;if(!_0x1d9aa4[_0x52a050(0xab)])throw new SDKError(ErrorCode[_0x52a050(0x10a)],_0x52a050(0xc8));const _0x2fdb03=getConsoleNextUrl(_0x45a849[_0x52a050(0xaf)],_0x52a050(0xfb)+_0x1d9aa4['parentId']+_0x52a050(0x101)+_0x1d9aa4[_0x52a050(0xab)]);return console[_0x52a050(0x144)](a31_0xe2ca85[_0x52a050(0xe6)]('✔')+'\x20Opening\x20'+a31_0xe2ca85['cyan'](_0x2fdb03)),openBrowser(_0x2fdb03),0x0;}if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xb8)){if(!_0x1d9aa4[_0x52a050(0x126)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x52a050(0xe1));const _0x57868d=await withSpinner(_0x52a050(0x12c),()=>_0x4d23a2[_0x52a050(0xf2)][_0x52a050(0x134)](_0x1d9aa4['folderId']),{'verbose':_0x45a849[_0x52a050(0xeb)]});await handleSingleObjectOutput(_0x57868d[_0x52a050(0x113)],_0x45a849);}else{if(_0x1d9aa4['type']===_0x52a050(0xf2)){if(!_0x1d9aa4['segmentId'])throw new SDKError(ErrorCode[_0x52a050(0x10a)],_0x52a050(0xc8));const _0x37f171=await withSpinner(_0x52a050(0xf8),()=>_0x4d23a2['segment'][_0x52a050(0x116)](_0x1d9aa4[_0x52a050(0x10d)],_0x1d9aa4['segmentId']),{'verbose':_0x45a849[_0x52a050(0xeb)]}),_0x311961=getConsoleNextUrl(_0x45a849[_0x52a050(0xaf)],'/app/ps/'+_0x1d9aa4[_0x52a050(0x10d)]+'/e/'+_0x1d9aa4['segmentId']),_0x41352b=_0x37f171[_0x52a050(0x113)];_0x41352b['url']=_0x311961,await handleSingleObjectOutput(_0x41352b,_0x45a849);}else return console[_0x52a050(0x144)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x52a050(0x12d)),0x1;}return 0x0;}catch(_0x40efda){if(_0x40efda instanceof SDKError)return console[_0x52a050(0x144)](_0x52a050(0xd2)+_0x40efda[_0x52a050(0x13f)]),_0x40efda[_0x52a050(0x140)]&&console[_0x52a050(0x144)](_0x52a050(0x109)+_0x40efda[_0x52a050(0x140)]),0x1;throw _0x40efda;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xd3);[a31_0x21cbf2(0x11e)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x307b3d){const _0x123a3e=a31_0x21cbf2,{options:_0x48b59f,args:_0x13a944,tdx:_0x10a131}=_0x307b3d,_0x384aba=_0x13a944[0x0];if(!_0x384aba)return console[_0x123a3e(0x144)](_0x123a3e(0xc2)),console[_0x123a3e(0x144)](_0x123a3e(0xbb)),console[_0x123a3e(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x123a3e(0x144)](_0x123a3e(0x129)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x123a3e(0x144)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x39b24b=_0x48b59f[_0x123a3e(0x142)],_0x54fac3=await resolveSegmentTarget(_0x384aba,_0x39b24b,_0x48b59f[_0x123a3e(0xeb)]);_0x48b59f[_0x123a3e(0xeb)]&&console[_0x123a3e(0x144)](_0x123a3e(0xf9)+_0x54fac3);const _0x6ed541=await withSpinner('Resolving\x20\x27'+_0x384aba+_0x123a3e(0xe2),()=>_0x10a131[_0x123a3e(0xf2)][_0x123a3e(0x12f)](_0x54fac3),{'verbose':_0x48b59f[_0x123a3e(0xeb)]}),_0x3ebee7=_0x6ed541['data'];_0x48b59f[_0x123a3e(0xeb)]&&(console[_0x123a3e(0x144)](_0x123a3e(0x105)+_0x3ebee7[_0x123a3e(0xc6)]),console[_0x123a3e(0x144)]('Parent\x20ID:\x20'+_0x3ebee7['parentId']));if(_0x3ebee7[_0x123a3e(0xc6)]===_0x123a3e(0xb8))return console['error'](_0x123a3e(0x135)),console['error'](_0x123a3e(0x11f)),0x1;if(_0x3ebee7[_0x123a3e(0xc6)]===_0x123a3e(0xf7))return console[_0x123a3e(0x144)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x123a3e(0x144)](_0x123a3e(0x120)),0x1;if(!_0x3ebee7[_0x123a3e(0xab)])throw new SDKError(ErrorCode[_0x123a3e(0x10a)],_0x123a3e(0xc8));const _0x418e18=await withSpinner(_0x123a3e(0x12e),()=>_0x10a131['segment'][_0x123a3e(0xd0)](_0x3ebee7['parentId'],_0x3ebee7[_0x123a3e(0xab)]),{'verbose':_0x48b59f[_0x123a3e(0xeb)]}),_0x1f40b0=_0x418e18[_0x123a3e(0x113)],_0x48fa33=await executeSchemaQuery(_0x1f40b0,_0x10a131,_0x48b59f);return await handleQueryOutput(_0x48fa33,_0x48b59f),0x0;}catch(_0x2ee6d0){if(_0x2ee6d0 instanceof SDKError)return console[_0x123a3e(0x144)](_0x123a3e(0xd2)+_0x2ee6d0[_0x123a3e(0x13f)]),_0x2ee6d0[_0x123a3e(0x140)]&&console[_0x123a3e(0x144)](_0x123a3e(0x109)+_0x2ee6d0[_0x123a3e(0x140)]),0x1;throw _0x2ee6d0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x4790(){const _0x5ddece=['328515juuTtO','ruleFile','135kbiQMV','\x27...','Resolving\x20folder\x20\x27','verbose','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','9697680kluiRp','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Site:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','1840908BpVIJF','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','\x27\x20with\x20ID:\x20','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20\x20Path:\x20','7mmROjW','name','1935022NnHAWv','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','yellow','createSegment','error','Resolved\x20folder\x20ID:\x20','segments','Parent\x20path:\x20','✔\x20Created\x20segment\x20\x27','segment:create','segmentPath','2587185RziViO','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','resolvePathToResource','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','length','segment','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','2455264fIwefg','1ulDlVf','folder','resolveParentId','87864uzNGfu','type','Resolved\x20relative\x20path\x20to:\x20','Segment\x20name:\x20','parent'];a32_0x4790=function(){return _0x5ddece;};return a32_0x4790();}const a32_0x28b4ad=a32_0x5a64;(function(_0x59e019,_0x24c04c){const _0x1cc1dc=a32_0x5a64,_0x32ab7e=_0x59e019();while(!![]){try{const _0x3eebbf=parseInt(_0x1cc1dc(0x19a))/0x1*(-parseInt(_0x1cc1dc(0x1b9))/0x2)+parseInt(_0x1cc1dc(0x1a2))/0x3+-parseInt(_0x1cc1dc(0x1b0))/0x4+-parseInt(_0x1cc1dc(0x1a4))/0x5*(-parseInt(_0x1cc1dc(0x19d))/0x6)+-parseInt(_0x1cc1dc(0x1b7))/0x7*(-parseInt(_0x1cc1dc(0x199))/0x8)+parseInt(_0x1cc1dc(0x18f))/0x9+parseInt(_0x1cc1dc(0x1ac))/0xa;if(_0x3eebbf===_0x24c04c)break;else _0x32ab7e['push'](_0x32ab7e['shift']());}catch(_0x3ba124){_0x32ab7e['push'](_0x32ab7e['shift']());}}}(a32_0x4790,0x9c910));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x5a64(_0x1cbb7c,_0x40aa7f){_0x1cbb7c=_0x1cbb7c-0x18b;const _0x4790d1=a32_0x4790();let _0x5a640d=_0x4790d1[_0x1cbb7c];return _0x5a640d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a32_0x5b4c3d from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x28b4ad(0x1b8)]=a32_0x28b4ad(0x18d);['description']=a32_0x28b4ad(0x1b1);async['execute'](_0x1d2b10){const _0x30d0b2=a32_0x28b4ad;console[_0x30d0b2(0x1bd)](a32_0x5b4c3d[_0x30d0b2(0x1bb)](_0x30d0b2(0x1b5))),console[_0x30d0b2(0x1bd)](a32_0x5b4c3d[_0x30d0b2(0x1bb)](_0x30d0b2(0x1af)));const {options:_0x34a5d8,args:_0x52ff3d,tdx:_0x3e470c}=_0x1d2b10,_0x39accd=_0x34a5d8;if(_0x52ff3d['length']===0x0)return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1aa)),console['error'](_0x30d0b2(0x1ad)),console[_0x30d0b2(0x1bd)]('Examples:'),console['error'](_0x30d0b2(0x1a9)),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x196)),console[_0x30d0b2(0x1bd)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x20313f=_0x52ff3d[0x0],_0x1280e2=_0x34a5d8[_0x30d0b2(0x18e)];let _0x1fcd93=_0x20313f;_0x1280e2&&!_0x20313f[_0x30d0b2(0x1a8)]('/')&&(_0x1fcd93=_0x1280e2+'/'+_0x20313f,_0x39accd[_0x30d0b2(0x1a7)]&&console['error'](_0x30d0b2(0x19f)+_0x1fcd93));const _0x290b7b=parsePath(_0x1fcd93);if(_0x290b7b['segments'][_0x30d0b2(0x194)]<0x2)return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ba)),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x190)),0x1;const _0x4aa022=_0x290b7b[_0x30d0b2(0x1bf)][0x0],_0x5809fb=getBaseName(_0x1fcd93),_0x4eaed7=getParentPath(_0x1fcd93);_0x39accd[_0x30d0b2(0x1a7)]&&(console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ae)+_0x39accd['site']),console[_0x30d0b2(0x1bd)]('Target\x20path:\x20'+_0x1fcd93),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ab)+_0x4aa022),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1a0)+_0x5809fb),console['error'](_0x30d0b2(0x18b)+_0x4eaed7));const _0x1ef539=await withSpinner(_0x30d0b2(0x197)+_0x4aa022+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x19c)](_0x4aa022),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x5a8a56=_0x1ef539['data'];let _0x1e461b;if(_0x290b7b[_0x30d0b2(0x1bf)][_0x30d0b2(0x194)]>0x2){const _0x51c7a3=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x4eaed7+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x192)](_0x4eaed7),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x3ebd3e=_0x51c7a3[_0x30d0b2(0x191)];if(_0x3ebd3e['type']!==_0x30d0b2(0x19b)&&_0x3ebd3e[_0x30d0b2(0x19e)]!==_0x30d0b2(0x1a1))return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x193)),0x1;_0x1e461b=_0x3ebd3e['folderId'];}else{if(_0x39accd[_0x30d0b2(0x19b)]){const _0x518eb0=await withSpinner(_0x30d0b2(0x1a6)+_0x39accd[_0x30d0b2(0x19b)]+_0x30d0b2(0x1a5),()=>_0x3e470c['segment'][_0x30d0b2(0x198)](_0x5a8a56,_0x39accd[_0x30d0b2(0x19b)]),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]});_0x1e461b=_0x518eb0[_0x30d0b2(0x191)];}}_0x39accd[_0x30d0b2(0x1a7)]&&_0x1e461b&&console['error'](_0x30d0b2(0x1be)+_0x1e461b);const _0x39c20c=await loadJSONFromOptions(_0x39accd[_0x30d0b2(0x1b4)],_0x39accd[_0x30d0b2(0x1a3)]),_0x542e01={'name':_0x5809fb,'description':_0x39accd['description'],'rule':_0x39c20c,'kind':_0x39accd['kind']!==undefined?parseInt(_0x39accd['kind'],0xa):undefined,'isVisible':_0x39accd['invisible']?![]:undefined,'segmentFolderId':_0x1e461b,'countPopulation':_0x39accd['noCountPopulation']?![]:undefined},_0x517126=await withSpinner(_0x30d0b2(0x1b2)+_0x5809fb+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x1bc)](_0x5a8a56,_0x542e01),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x2d8c33=_0x517126[_0x30d0b2(0x191)];return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x18c)+_0x2d8c33['name']+_0x30d0b2(0x1b3)+_0x2d8c33['id']),_0x1fcd93!==_0x20313f&&console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1b6)+_0x1fcd93),await handleSDKOutput([_0x2d8c33],_0x39accd),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x102240=a33_0x846f;function a33_0x5c4a(){const _0x966947=['\x20field','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','1473ExZjkT','segment','453418MjOXVe','data','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2928105HShOHb','✔\x20Found\x20','listFields','366299hNZWZL','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','error','name','1921530vwCsFb','json','length','2799300WeamAz','860mpkSte','56dpVowW','\x27...','execute','Site:\x20','description','1114684hHJauz','Parent\x20segment:\x20','site','jsonl','segment:fields'];a33_0x5c4a=function(){return _0x966947;};return a33_0x5c4a();}(function(_0x4a9936,_0x5f1fc6){const _0x4d8f2f=a33_0x846f,_0x4d6720=_0x4a9936();while(!![]){try{const _0x424f65=-parseInt(_0x4d8f2f(0xb2))/0x1+parseInt(_0x4d8f2f(0xba))/0x2*(parseInt(_0x4d8f2f(0xa9))/0x3)+-parseInt(_0x4d8f2f(0xa1))/0x4+parseInt(_0x4d8f2f(0xb6))/0x5+parseInt(_0x4d8f2f(0xb9))/0x6+parseInt(_0x4d8f2f(0xab))/0x7*(-parseInt(_0x4d8f2f(0x9c))/0x8)+parseInt(_0x4d8f2f(0xaf))/0x9;if(_0x424f65===_0x5f1fc6)break;else _0x4d6720['push'](_0x4d6720['shift']());}catch(_0x4407d9){_0x4d6720['push'](_0x4d6720['shift']());}}}(a33_0x5c4a,0x468af));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a33_0x846f(_0x58f7ea,_0x3428e0){_0x58f7ea=_0x58f7ea-0x9c;const _0x5c4a7a=a33_0x5c4a();let _0x846fd=_0x5c4a7a[_0x58f7ea];return _0x846fd;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x102240(0xb5)]=a33_0x102240(0xa5);[a33_0x102240(0xa0)]=a33_0x102240(0xad);async[a33_0x102240(0x9e)](_0x174e9f){const _0x5f4612=a33_0x102240,{options:_0x6f1559,args:_0x14c19e,tdx:_0xbaa19d}=_0x174e9f,_0x113a51=_0x14c19e[0x0]||_0x6f1559['parentSegment'];if(!_0x113a51)return console['error'](_0x5f4612(0xa7)),console['error'](_0x5f4612(0xae)),console['error'](_0x5f4612(0xb3)),0x1;_0x6f1559[_0x5f4612(0xa8)]&&(console[_0x5f4612(0xb4)](_0x5f4612(0x9f)+_0x6f1559[_0x5f4612(0xa3)]),console[_0x5f4612(0xb4)](_0x5f4612(0xa2)+_0x113a51));const _0x44df5c=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x113a51+_0x5f4612(0x9d),()=>_0xbaa19d[_0x5f4612(0xaa)][_0x5f4612(0xb1)](_0x113a51),{'verbose':_0x6f1559[_0x5f4612(0xa8)]}),_0x4516ba=_0x44df5c[_0x5f4612(0xac)];console[_0x5f4612(0xb4)](_0x5f4612(0xb0)+_0x4516ba[_0x5f4612(0xb8)]+_0x5f4612(0xa6)+(_0x4516ba[_0x5f4612(0xb8)]!==0x1?'s':''));if(_0x6f1559[_0x5f4612(0xb7)]||_0x6f1559[_0x5f4612(0xa4)])return await handleSDKOutput(_0x4516ba,_0x6f1559),0x0;return displayFieldsHumanReadable(_0x4516ba,_0x113a51),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a34_0x3242(_0xaca39c,_0x528ab5){_0xaca39c=_0xaca39c-0xc9;const _0xa749ea=a34_0xa749();let _0x3242f5=_0xa749ea[_0xaca39c];return _0x3242f5;}function a34_0xa749(){const _0x3cd2d6=['Parent\x20segment:\x20','1614219CfewwY','\x20\x20Target:\x20','no_parent','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x0aError:','1995012sGIzZn','198kERMAN','\x20with\x20','file','activations','cyan','resourceName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4993500sTWjZR','helpText','dirname','diff','dryRun','journeyVersions','length','\x27...','files','journeys','Target\x20resource:\x20','✔\x20Pulled\x20','targetDir','381941iWiaXG','parentName','8304375ReqKxn','\x20changed\x20files','isNew','yellow','yes','16573644wVWnNx','parent_segment','\x20unchanged\x20files','segments','session','Aborted.','relativePath','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','143633cmprKl','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','green','\x20files\x20to\x20','Write\x20','description','hasChanges','error','\x20activations','execute','Site:\x20','\x20\x20🎯\x20','\x0aPull\x20summary\x20for\x20\x27','\x20=\x20','repeat','absolutePath','pullSegments','segment:pull','data','32jBCCcx','\x20journeys','\x20new\x20files','\x20segments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','content','\x20\x20🗺️\x20\x20','\x0aChanges\x20to\x20\x27','filter','errorCode','site','✔\x20Context\x20set:\x20','dim','counts','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','message','red','verbose','Error:\x20','name','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'];a34_0xa749=function(){return _0x3cd2d6;};return a34_0xa749();}const a34_0x1547ad=a34_0x3242;(function(_0xdd188b,_0x51f2fa){const _0x464e3b=a34_0x3242,_0x4448f7=_0xdd188b();while(!![]){try{const _0x39bcc5=-parseInt(_0x464e3b(0x110))/0x1+-parseInt(_0x464e3b(0xeb))/0x2+-parseInt(_0x464e3b(0xe6))/0x3+-parseInt(_0x464e3b(0xf3))/0x4+-parseInt(_0x464e3b(0x102))/0x5+parseInt(_0x464e3b(0xec))/0x6*(-parseInt(_0x464e3b(0x100))/0x7)+-parseInt(_0x464e3b(0xd0))/0x8*(-parseInt(_0x464e3b(0x107))/0x9);if(_0x39bcc5===_0x51f2fa)break;else _0x4448f7['push'](_0x4448f7['shift']());}catch(_0x2b0d5a){_0x4448f7['push'](_0x4448f7['shift']());}}}(a34_0xa749,0xee87f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a34_0xe6bdd4 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x1be48b 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{[a34_0x1547ad(0xe3)]=a34_0x1547ad(0xce);[a34_0x1547ad(0x115)]=a34_0x1547ad(0xe9);async[a34_0x1547ad(0x119)](_0x3796f3){const _0x124ad8=a34_0x1547ad,{options:_0x457e0d,args:_0x5cec9f,tdx:_0xa92ce0}=_0x3796f3,_0x35e385=_0x457e0d,_0x116429=await resolveTarget({'arg':_0x5cec9f[0x0],'contextParent':_0x457e0d['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x116429))return _0x116429[_0x124ad8(0xd9)]===_0x124ad8(0xe8)?(console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xde))),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x124ad8(0x111)),console[_0x124ad8(0x117)]('\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['error'](a34_0xe6bdd4[_0x124ad8(0xe0)](_0x124ad8(0xe2)+_0x116429[_0x124ad8(0xdf)]+'\x0a')),_0x116429[_0x124ad8(0xf4)]&&console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0xf0)](_0x116429[_0x124ad8(0xf4)]))),0x1;const _0x508139=_0x116429[_0x124ad8(0x101)],_0x16353b=_0x116429['targetDir'],_0x18e23f=_0x116429['type']===_0x124ad8(0xee)?_0x116429[_0x124ad8(0xf1)]:undefined;_0x35e385[_0x124ad8(0xe1)]&&(console['error'](_0x124ad8(0x11a)+_0x35e385[_0x124ad8(0xda)]),console[_0x124ad8(0x117)](_0x124ad8(0xe5)+_0x508139),_0x18e23f&&console['error'](_0x124ad8(0xfd)+_0x18e23f));const _0x1c8e93=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x508139+_0x124ad8(0xfa),_0x27b0a7=>_0xa92ce0[_0x124ad8(0x10e)][_0x124ad8(0xcd)](_0x508139,{'targetDir':_0x16353b,'targetResourceName':_0x18e23f,'verbose':_0x35e385[_0x124ad8(0xe1)],'progress':{'update':_0xa388fb=>{const _0x282b9b=_0x124ad8;_0x27b0a7['setPhase'](_0xa388fb),_0x35e385[_0x282b9b(0xe1)]&&console[_0x282b9b(0x117)]('\x20\x20'+_0xa388fb);}}}),{'verbose':_0x35e385[_0x124ad8(0xe1)]}),_0x1b8aed=_0x1c8e93[_0x124ad8(0xcf)];if(_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0x10a)]===0x0&&_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xfc)]===0x0)return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xe4)+_0x1b8aed[_0x124ad8(0x101)]+'\x27')),0x0;const _0x33765b=_0x1b8aed[_0x124ad8(0xfb)]['filter'](_0xc2c305=>_0xc2c305[_0x124ad8(0x104)]),_0x194112=_0x1b8aed[_0x124ad8(0xfb)][_0x124ad8(0xd8)](_0x1d1dc7=>!_0x1d1dc7[_0x124ad8(0x104)]&&_0x1d1dc7['hasChanges']),_0x123d15=_0x1b8aed[_0x124ad8(0xfb)][_0x124ad8(0xd8)](_0x1df1fd=>!_0x1df1fd[_0x124ad8(0x104)]&&!_0x1df1fd[_0x124ad8(0x116)]);console['error'](_0x124ad8(0xc9)+_0x1b8aed['parentName']+'\x27:'),console[_0x124ad8(0x117)](_0x124ad8(0x11b)+a34_0xe6bdd4['cyan'](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0x10a)]+_0x124ad8(0xd3))+_0x124ad8(0xed)+a34_0xe6bdd4['cyan'](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xef)]+_0x124ad8(0x118)));if(_0x1b8aed[_0x124ad8(0xdd)]['journeys']>0x0){const _0x524cc0=_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xf8)]>_0x1b8aed['counts']['journeys']?'\x20('+_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xf8)]+'\x20versions)':'';console['error'](_0x124ad8(0xd6)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xfc)]+_0x124ad8(0xd1))+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x524cc0));}console[_0x124ad8(0x117)]('\x20\x20'+a34_0xe6bdd4['green']('+\x20'+_0x33765b['length']+_0x124ad8(0xd2))),console[_0x124ad8(0x117)]('\x20\x20'+a34_0xe6bdd4[_0x124ad8(0x105)]('~\x20'+_0x194112[_0x124ad8(0xf9)]+_0x124ad8(0x103))),console['error']('\x20\x20'+a34_0xe6bdd4[_0x124ad8(0xdc)]('=\x20'+_0x123d15['length']+_0x124ad8(0x109))),console[_0x124ad8(0x117)](_0x124ad8(0xe7)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0xff)])+'\x0a');if(_0x194112[_0x124ad8(0xf9)]>0x0)for(const _0x4898ae of _0x194112){console[_0x124ad8(0x117)](_0x124ad8(0xd7)+_0x4898ae[_0x124ad8(0x10d)]+'\x27:'),console[_0x124ad8(0x117)]('─'[_0x124ad8(0xcb)](0x3c)),console[_0x124ad8(0x117)](_0x4898ae[_0x124ad8(0xf6)]),console[_0x124ad8(0x117)]('─'[_0x124ad8(0xcb)](0x3c));}if(_0x35e385[_0x124ad8(0xf7)])return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xd4))),0x0;if(_0x33765b['length']===0x0&&_0x194112[_0x124ad8(0xf9)]===0x0)return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x112)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1b8aed[_0x124ad8(0x101)]},_0x35e385[_0x124ad8(0x10b)]),console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x112)](_0x124ad8(0xdb)+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x124ad8(0x108))+_0x124ad8(0xca)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0x101)]))),0x0;if(!_0x35e385[_0x124ad8(0x106)]){if(!isInteractive())return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0xe0)](_0x124ad8(0xea)),_0x124ad8(0xf2)),console[_0x124ad8(0x117)](a34_0xe6bdd4['dim'](_0x124ad8(0x10f))),0x1;const _0x2a590f=await confirmKey(_0x124ad8(0x114)+(_0x33765b[_0x124ad8(0xf9)]+_0x194112['length'])+'\x20files?');if(!_0x2a590f)return console[_0x124ad8(0x117)](a34_0xe6bdd4['yellow'](_0x124ad8(0x10c)),'-\x20no\x20files\x20written'),0x1;}for(const _0x23c6da of _0x1b8aed[_0x124ad8(0xfb)]){if(_0x23c6da[_0x124ad8(0x104)]||_0x23c6da[_0x124ad8(0x116)]){const _0x14c2e6=a34_0x1be48b[_0x124ad8(0xf5)](_0x23c6da['absolutePath']);!existsSync(_0x14c2e6)&&mkdirSync(_0x14c2e6,{'recursive':!![]}),writeFileSync(_0x23c6da[_0x124ad8(0xcc)],_0x23c6da[_0x124ad8(0xd5)],'utf-8');}}return console['error'](a34_0xe6bdd4[_0x124ad8(0x112)](_0x124ad8(0xfe)+(_0x33765b['length']+_0x194112['length'])+_0x124ad8(0x113)+_0x1b8aed[_0x124ad8(0xff)])),saveSessionContext({'parent_segment':_0x1b8aed[_0x124ad8(0x101)]},_0x35e385[_0x124ad8(0x10b)]),console[_0x124ad8(0x117)](a34_0xe6bdd4['green'](_0x124ad8(0xdb)+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x124ad8(0x108))+_0x124ad8(0xca)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0x101)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x2d496a=a35_0x2d43;(function(_0x5474d9,_0x50f8ab){const _0x2dc6f=a35_0x2d43,_0x35dd4d=_0x5474d9();while(!![]){try{const _0x5579b7=parseInt(_0x2dc6f(0x1e1))/0x1*(-parseInt(_0x2dc6f(0x18e))/0x2)+-parseInt(_0x2dc6f(0x212))/0x3+-parseInt(_0x2dc6f(0x1af))/0x4*(-parseInt(_0x2dc6f(0x1ed))/0x5)+-parseInt(_0x2dc6f(0x17e))/0x6*(-parseInt(_0x2dc6f(0x1b0))/0x7)+parseInt(_0x2dc6f(0x1a9))/0x8*(parseInt(_0x2dc6f(0x192))/0x9)+-parseInt(_0x2dc6f(0x21b))/0xa*(parseInt(_0x2dc6f(0x1a2))/0xb)+-parseInt(_0x2dc6f(0x1fd))/0xc;if(_0x5579b7===_0x50f8ab)break;else _0x35dd4d['push'](_0x35dd4d['shift']());}catch(_0x3b946d){_0x35dd4d['push'](_0x35dd4d['shift']());}}}(a35_0x4855,0x459dc));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a35_0x4855(){const _0x48bc0f=['folderPath','segmentFolderId','length','2zoBEau','deleted','\x20to\x20update','Changes\x20to\x20journey:','created','getOutputSchemaWithCache','state','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','buildUserMaps','yes','attributes','Source\x20directory:\x20','292145XvTiQF','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/e/','delete','endsWith','changed','/j/da/je','site','execute','Fetching\x20existing\x20activations...','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','nameToId','dryRun','repeat','2607300tIIzbg','journeysOnly','toString','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)','relationships','📁\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Resolving\x20parent\x20segment\x20\x27','helpText','No\x20','Parent\x20segment:\x20','verbose','listFolders','unchanged','red','audienceId','/app/ps/','\x20\x20Source:\x20','Delete\x20journey:','Fetching\x20connections\x20for\x20name\x20resolution...','scopedFolderPath','746340zsCgae','segment:push','isScoped','\x20deleted','versionNumber','parentSegment','targetDir','toDelete','New\x20segment:','38010bYmHjO','Folders\x20to\x20create:','segment','New\x20journey:','786LknfHp','yamlConfig','(Journey\x20will\x20be\x20deleted)','results','activations','Error:\x20Directory\x20not\x20found:\x20','updatedAt','then','Scoped\x20to\x20folder:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveParentId','\x20to\x20delete','all','\x20activations]','folderId','get','73958vbmMUG','\x20\x20Activations:','Error:\x20','diff','1014831XXfdcB','description','journeyBundleId','journey','journeys','\x20created','filter','yellow','connection','journeyBundleName','Error\x20parsing\x20YAML:\x20','paused','file','\x0aPush\x20summary\x20for\x20\x27','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','add','253LpGSgP','user','existingJourney','.yml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','updated','\x0aError:','24oEMbYs','name','setPhase','idToName','\x0a✔\x20Push\x20complete','isNew','4cTajXB','27566CKULHC','push','error','Preparing\x20journeys...','Changes\x20to:','parent_name','map','createdSegmentIds','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20updated','segments','\x20unchanged','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','no_parent','listActivations','getParent','\x20new','Site:\x20','journeyId','createdAt','toCreate','nameToType','\x20changed','join','\x20\x20🗺️\x20\x20Journeys:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','data','.yaml','list','blue','\x20to\x20create','cyan','message','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','getJourney','errorCode','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Fetching\x20existing\x20data...','listJourneysWithDetailsFromParentSegment','\x20\x20Journeys:\x20','parentFolder','\x27...','dim','\x20\x20\x20\x20','green','\x20YAML\x20files\x20found'];a35_0x4855=function(){return _0x48bc0f;};return a35_0x4855();}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 a35_0x5a311a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a35_0x2d43(_0x2f8d32,_0x2b2e94){_0x2f8d32=_0x2f8d32-0x17b;const _0x485535=a35_0x4855();let _0x2d435f=_0x485535[_0x2f8d32];return _0x2d435f;}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{[a35_0x2d496a(0x1aa)]=a35_0x2d496a(0x213);[a35_0x2d496a(0x193)]=a35_0x2d496a(0x1ef);async[a35_0x2d496a(0x1f6)](_0x5baa64){const _0x5cfc74=a35_0x2d496a,{options:_0x5385f1,args:_0x306091,tdx:_0x4ecab4}=_0x5baa64,_0x507469=_0x5385f1,_0xf2a6c1=await resolveTarget({'arg':_0x306091[0x0],'contextParent':_0x5385f1[_0x5cfc74(0x217)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xf2a6c1))return _0xf2a6c1[_0x5cfc74(0x1d3)]===_0x5cfc74(0x1bd)?(console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x199)](_0x5cfc74(0x187))),console['error'](_0x5cfc74(0x200)),console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1f9)),console['error'](_0x5cfc74(0x1ee))):(console[_0x5cfc74(0x1b2)](a35_0x5a311a['red'](_0x5cfc74(0x190)+_0xf2a6c1['message']+'\x0a')),_0xf2a6c1['helpText']&&console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x1cf)](_0xf2a6c1[_0x5cfc74(0x205)]))),0x1;if(_0xf2a6c1[_0x5cfc74(0x1f8)]===_0x5cfc74(0x1b5))return console[_0x5cfc74(0x1b2)](a35_0x5a311a['red'](_0x5cfc74(0x183)+_0xf2a6c1[_0x5cfc74(0x218)]+'\x0a')),console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x1cf)](_0x5cfc74(0x1bc))),0x1;const _0x3a0741=_0xf2a6c1['parentName'],_0x3e82d1=_0xf2a6c1[_0x5cfc74(0x218)],_0x37fb0f=_0xf2a6c1[_0x5cfc74(0x1f8)]===_0x5cfc74(0x19e)?_0xf2a6c1['filePath']:undefined,_0x1c6074=getScopedDetails(_0xf2a6c1),_0x2cd08e=_0x1c6074?.[_0x5cfc74(0x214)]??![],_0x3a7767=_0x1c6074?.[_0x5cfc74(0x211)]??'';if(!existsSync(_0x3e82d1))return console['error'](a35_0x5a311a[_0x5cfc74(0x20b)](_0x5cfc74(0x183)+_0x3e82d1+'\x0a')),console[_0x5cfc74(0x1b2)](a35_0x5a311a['cyan'](_0x5cfc74(0x1bc))),0x1;_0x507469[_0x5cfc74(0x208)]&&(console['error'](_0x5cfc74(0x1c1)+_0x507469[_0x5cfc74(0x1f5)]),console[_0x5cfc74(0x1b2)](_0x5cfc74(0x207)+_0x3a0741),console['error'](_0x5cfc74(0x1ec)+_0x3e82d1),_0x2cd08e&&console[_0x5cfc74(0x1b2)](_0x5cfc74(0x186)+_0x3a7767));const _0x3d1fdb=await withSpinner(_0x5cfc74(0x204)+_0x3a0741+_0x5cfc74(0x1d9),()=>_0x4ecab4[_0x5cfc74(0x17c)][_0x5cfc74(0x188)](_0x3a0741),{'verbose':_0x507469[_0x5cfc74(0x208)]}),_0x273a5a=_0x3d1fdb[_0x5cfc74(0x1ca)],{parentSegmentResult:_0x439706,segmentsResult:_0x1fe1cb,foldersResult:_0x2e9cf2,journeysWithDetailsResult:_0x362077,userMaps:_0x45ae2a}=await withSpinner(_0x5cfc74(0x1d5),async()=>{const _0x312b18=_0x5cfc74,[_0x588aba,_0x4edd21,_0x266968,_0x3b4670,_0x24fe0f]=await Promise[_0x312b18(0x18a)]([_0x4ecab4[_0x312b18(0x17c)][_0x312b18(0x1bf)](_0x273a5a),_0x4ecab4[_0x312b18(0x17c)]['listSegments'](_0x273a5a),_0x4ecab4[_0x312b18(0x17c)][_0x312b18(0x209)](_0x273a5a),_0x4ecab4[_0x312b18(0x195)][_0x312b18(0x1d6)](_0x273a5a,{'includeAllVersions':!![]}),_0x4ecab4['user'][_0x312b18(0x1e9)]()]);return{'parentSegmentResult':_0x588aba,'segmentsResult':_0x4edd21,'foldersResult':_0x266968,'journeysWithDetailsResult':_0x3b4670,'userMaps':_0x24fe0f};},{'verbose':_0x507469[_0x5cfc74(0x208)]})[_0x5cfc74(0x185)](_0x22c423=>_0x22c423[_0x5cfc74(0x1ca)]),_0xce7e0c=_0x439706,_0x56d0ba=extractRootFolderId(_0xce7e0c),_0x228ea7=_0x1fe1cb,_0x2e36a1=_0x2e9cf2,{journeys:_0x3f7acd,activationStepsById:_0x3f2716}=_0x362077,_0x51fcf9=new Map(_0x3f7acd[_0x5cfc74(0x1b6)](_0x19b4b9=>[_0x19b4b9['id'],_0x19b4b9])),_0x3a55f7=_0x3f7acd[_0x5cfc74(0x1b6)](_0x1c6359=>({'id':_0x1c6359['id'],'name':_0x1c6359[_0x5cfc74(0x1eb)]['name'],'journeyBundleName':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x19b)]||'','journeyBundleId':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x194)]||'','versionNumber':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x216)],'description':_0x1c6359[_0x5cfc74(0x1eb)]['description'],'state':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x1e7)],'paused':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x19d)],'audienceId':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x20c)],'folderId':_0x1c6359[_0x5cfc74(0x201)]?.[_0x5cfc74(0x1d8)]?.[_0x5cfc74(0x1ca)]?.['id'],'createdAt':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x1c3)],'updatedAt':_0x1c6359[_0x5cfc74(0x1eb)][_0x5cfc74(0x184)]})),{emailToId:_0x24d465,idToEmail:_0x23f5de}=_0x45ae2a,_0x7d719e=await withSpinner(_0x5cfc74(0x210),async()=>{const _0x270720=_0x5cfc74,_0x39e29b=await _0x4ecab4[_0x270720(0x19a)][_0x270720(0x1cc)]();return buildConnectionMaps(_0x39e29b);},{'verbose':_0x507469['verbose']})[_0x5cfc74(0x185)](_0x1ecb2e=>_0x1ecb2e[_0x5cfc74(0x1ca)]),_0x3de072=_0x7d719e[_0x5cfc74(0x1fa)],_0x3f0f90=_0x7d719e[_0x5cfc74(0x1ac)],_0x46e1c4=_0x7d719e[_0x5cfc74(0x1c5)],_0x308e9c={'emailToIdMap':_0x24d465,'connectionNameToIdMap':_0x3de072,'connectionNameToTypeMap':_0x46e1c4,'getSchema':_0x4f0a04=>_0x4ecab4[_0x5cfc74(0x19a)][_0x5cfc74(0x1e6)](_0x4f0a04)};let {pathToId:_0x10f3bf,idToPath:_0x752b0c}=buildFolderMaps(_0x2e36a1);const _0x59ed1a=buildSegmentLookupMap(_0x228ea7,_0x752b0c),_0x1f756b=buildSegmentNameToIdMap(_0x228ea7),_0x10e75a=buildJourneyBundleLookupMap(_0x3a55f7,_0x752b0c);let _0xbf9a7e;if(_0x37fb0f){if(!_0x37fb0f['endsWith'](_0x5cfc74(0x1a5))&&!_0x37fb0f[_0x5cfc74(0x1f2)](_0x5cfc74(0x1cb)))return console[_0x5cfc74(0x1b2)](a35_0x5a311a['red'](_0x5cfc74(0x203)+_0x37fb0f+'\x0a')),0x1;_0xbf9a7e=[_0x37fb0f];}else _0xbf9a7e=findYamlFiles(_0x3e82d1);if(_0xbf9a7e[_0x5cfc74(0x1e0)]===0x0)return console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x20b)](_0x5cfc74(0x1a6)+_0x3e82d1+'\x0a')),console[_0x5cfc74(0x1b2)](a35_0x5a311a['cyan'](_0x5cfc74(0x1d4))),0x1;let _0x2de00b,_0xbc864b;try{const _0x3a6600=parseAndClassifyYamlFiles(_0xbf9a7e,_0x3e82d1,{'skipSegments':_0x507469[_0x5cfc74(0x1fe)]});_0x2de00b=_0x3a6600['segments'],_0xbc864b=_0x3a6600[_0x5cfc74(0x196)];const _0x2ff9d0=validateParsedFiles(_0x3a6600,_0x3e82d1);if(_0x2ff9d0[_0x5cfc74(0x1e0)]>0x0)return console['error'](a35_0x5a311a[_0x5cfc74(0x20b)]('\x0aValidation\x20failed:')),console[_0x5cfc74(0x1b2)](formatValidationErrors(_0x2ff9d0)),console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x199)](_0x5cfc74(0x1c9))),0x1;}catch(_0x243b1c){return console['error'](a35_0x5a311a['red'](_0x5cfc74(0x19c)+(_0x243b1c instanceof Error?_0x243b1c[_0x5cfc74(0x1d0)]:_0x243b1c))),0x1;}if(_0x2de00b[_0x5cfc74(0x1e0)]===0x0&&_0xbc864b[_0x5cfc74(0x1e0)]===0x0){const _0x35f896=_0x507469['journeysOnly']?_0x5cfc74(0x195):'segment\x20or\x20journey';return console['error'](a35_0x5a311a['yellow'](_0x5cfc74(0x206)+_0x35f896+_0x5cfc74(0x1dd))),0x0;}const _0x406f63=new Map();_0x228ea7[_0x5cfc74(0x1e0)]>0x0&&!_0x507469[_0x5cfc74(0x1fe)]&&await withSpinner(_0x5cfc74(0x1f7),async()=>{await batchAsync(_0x228ea7,async _0x187e4a=>{const _0x19c284=a35_0x2d43,_0x517171=await _0x4ecab4[_0x19c284(0x17c)][_0x19c284(0x1be)](_0x273a5a,_0x187e4a['id']);_0x406f63['set'](_0x187e4a['id'],_0x517171);});},{'verbose':_0x507469[_0x5cfc74(0x208)]});const {segmentFiles:_0x41e01c,foldersToCreate:_0x5b59db}=await prepareSegmentFiles(_0x2de00b,{'segmentByFolderAndName':_0x59ed1a,'activationsBySegmentId':_0x406f63,'folderPathToId':_0x10f3bf,'idToEmailMap':_0x23f5de,'connectionIdToNameMap':_0x3f0f90},_0x308e9c,_0x2cd08e,_0x3a7767),_0x25bb0d=_0x37fb0f?[]:findSegmentsToDelete(_0x228ea7,_0x2de00b[_0x5cfc74(0x1b6)](({yamlConfig:_0x42b5fa,folderPath:_0x31cc8f})=>({'yamlConfig':_0x42b5fa,'folderPath':resolveTDFolderPath(_0x31cc8f,_0x2cd08e,_0x3a7767)})),_0x752b0c,_0x3a7767,_0x2cd08e),{journeyFiles:_0x22261a,foldersToCreate:_0x3c05e1}=await withProgressSpinner(_0x5cfc74(0x1b3),async _0x24fa51=>prepareJourneyFiles(_0xbc864b,{'fetchJourney':async _0x18d10d=>_0x4ecab4[_0x5cfc74(0x195)][_0x5cfc74(0x1d2)](_0x18d10d[_0x5cfc74(0x1c2)]),'journeyBundlesByFolderAndName':_0x10e75a,'folderPathToId':_0x10f3bf,'idToEmailMap':_0x23f5de,'connectionIdToNameMap':_0x3f0f90,'existingSegments':_0x228ea7,'parentId':_0x273a5a,'deps':_0x4ecab4,'progress':{'update':_0x17d9a2=>{const _0x2a70be=_0x5cfc74;_0x24fa51[_0x2a70be(0x1ab)](_0x17d9a2),_0x507469[_0x2a70be(0x208)]&&console[_0x2a70be(0x1b2)]('\x20\x20'+_0x17d9a2);}},'journeyById':_0x51fcf9,'activationStepsById':_0x3f2716},_0x2cd08e,_0x3a7767),{'verbose':_0x507469['verbose']})[_0x5cfc74(0x185)](_0x5051f6=>_0x5051f6[_0x5cfc74(0x1ca)]);for(const _0x2878a4 of _0x3c05e1){_0x5b59db[_0x5cfc74(0x1a1)](_0x2878a4);}const _0x3fbbc9=_0x37fb0f?[]:findJourneysToDelete(_0x3a55f7,_0xbc864b['map'](({yamlConfig:_0x2fcb74,folderPath:_0x1a7cdb})=>({'yamlConfig':_0x2fcb74,'folderPath':resolveTDFolderPath(_0x1a7cdb,_0x2cd08e,_0x3a7767)})),_0x752b0c,_0x3a7767,_0x2cd08e),_0x24fe05=calculatePushStats(_0x41e01c,_0x22261a,_0x5b59db,_0x25bb0d,_0x3fbbc9,!!_0x507469[_0x5cfc74(0x1f1)],!!_0x507469[_0x5cfc74(0x1fe)]),_0x83638e=_0x24fe05[_0x5cfc74(0x1ba)]['new'],_0x454aad=_0x24fe05['segments'][_0x5cfc74(0x1f3)],_0x591b4c=_0x24fe05[_0x5cfc74(0x1ba)][_0x5cfc74(0x20a)],_0x28abb6=_0x24fe05[_0x5cfc74(0x1ba)][_0x5cfc74(0x219)],_0x4b0343=_0x24fe05['folders'][_0x5cfc74(0x1c4)],_0x83f83a=_0x24fe05[_0x5cfc74(0x196)]['new'],_0x53ec76=_0x24fe05[_0x5cfc74(0x196)][_0x5cfc74(0x1f3)],_0x2be199=_0x24fe05[_0x5cfc74(0x196)][_0x5cfc74(0x20a)],_0x1a0adc=_0x24fe05['journeys'][_0x5cfc74(0x219)],_0x35e160=_0x24fe05['activations'][_0x5cfc74(0x18a)],_0x4727a8=_0x24fe05['activations']['toCreate'],_0x157939=_0x24fe05[_0x5cfc74(0x182)]['toUpdate'],_0x52630d=_0x24fe05[_0x5cfc74(0x182)]['toDelete'];console[_0x5cfc74(0x1b2)](_0x5cfc74(0x19f)+_0x3a0741+'\x27:');_0x4b0343[_0x5cfc74(0x1e0)]>0x0&&console['error']('\x20\x20'+a35_0x5a311a[_0x5cfc74(0x1cd)](_0x5cfc74(0x202)+_0x4b0343['length']+'\x20folders\x20to\x20create'));if(!_0x507469[_0x5cfc74(0x1fe)]){console[_0x5cfc74(0x1b2)]('\x20\x20📊\x20Segments:'),console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a['green']('+\x20'+_0x83638e[_0x5cfc74(0x1e0)]+_0x5cfc74(0x1c0))),console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x199)]('~\x20'+_0x454aad[_0x5cfc74(0x1e0)]+'\x20changed'));if(_0x28abb6[_0x5cfc74(0x1e0)]>0x0)console['error'](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x20b)]('-\x20'+_0x28abb6[_0x5cfc74(0x1e0)]+_0x5cfc74(0x189)));else _0x25bb0d['length']>0x0&&!_0x507469[_0x5cfc74(0x1f1)]&&console['error'](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x1da)](_0x25bb0d[_0x5cfc74(0x1e0)]+_0x5cfc74(0x1b8)));console[_0x5cfc74(0x1b2)]('\x20\x20\x20\x20'+a35_0x5a311a[_0x5cfc74(0x1da)]('=\x20'+_0x591b4c[_0x5cfc74(0x1e0)]+'\x20unchanged'));}if(_0x22261a['length']>0x0||_0x3fbbc9[_0x5cfc74(0x1e0)]>0x0){console['error'](_0x5cfc74(0x1c8)),console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x1dc)]('+\x20'+_0x83f83a[_0x5cfc74(0x1e0)]+'\x20new')),console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a['yellow']('~\x20'+_0x53ec76[_0x5cfc74(0x1e0)]+_0x5cfc74(0x1c6)));if(_0x1a0adc['length']>0x0)console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x20b)]('-\x20'+_0x1a0adc['length']+_0x5cfc74(0x189)));else _0x3fbbc9[_0x5cfc74(0x1e0)]>0x0&&!_0x507469[_0x5cfc74(0x1f1)]&&console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x1da)](_0x3fbbc9[_0x5cfc74(0x1e0)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error']('\x20\x20\x20\x20'+a35_0x5a311a[_0x5cfc74(0x1da)]('=\x20'+_0x2be199[_0x5cfc74(0x1e0)]+_0x5cfc74(0x1bb)));}_0x35e160[_0x5cfc74(0x1e0)]>0x0&&!_0x507469[_0x5cfc74(0x1fe)]&&(console[_0x5cfc74(0x1b2)](''),console[_0x5cfc74(0x1b2)](_0x5cfc74(0x18f)),_0x4727a8['length']>0x0&&console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x1dc)]('+\x20'+_0x4727a8[_0x5cfc74(0x1e0)]+_0x5cfc74(0x1ce))),_0x157939[_0x5cfc74(0x1e0)]>0x0&&console['error'](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x199)]('~\x20'+_0x157939['length']+_0x5cfc74(0x1e3))),_0x52630d['length']>0x0&&console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1db)+a35_0x5a311a[_0x5cfc74(0x20b)]('-\x20'+_0x52630d[_0x5cfc74(0x1e0)]+_0x5cfc74(0x189))));console['error'](_0x5cfc74(0x20e)+a35_0x5a311a['cyan'](_0x3e82d1)+'\x0a');if(_0x4b0343[_0x5cfc74(0x1e0)]>0x0){console[_0x5cfc74(0x1b2)](_0x5cfc74(0x17b));for(const _0x3ef19c of _0x4b0343){console[_0x5cfc74(0x1b2)]('\x20\x20'+a35_0x5a311a[_0x5cfc74(0x1cd)]('+')+'\x20'+_0x3ef19c);}console[_0x5cfc74(0x1b2)]('');}if(_0x83638e[_0x5cfc74(0x1e0)]>0x0&&!_0x507469['journeysOnly'])for(const _0x18befa of _0x83638e){const _0x2e539b=_0x18befa[_0x5cfc74(0x1de)]?_0x18befa[_0x5cfc74(0x1de)]+'/'+_0x18befa[_0x5cfc74(0x17f)][_0x5cfc74(0x1aa)]:_0x18befa[_0x5cfc74(0x17f)][_0x5cfc74(0x1aa)],_0x5a4b2f=_0x18befa[_0x5cfc74(0x17f)]['activations']?.['length']||0x0,_0x3aab80=_0x5a4b2f>0x0?a35_0x5a311a[_0x5cfc74(0x1da)]('\x20['+_0x5a4b2f+_0x5cfc74(0x18b)):'';console[_0x5cfc74(0x1b2)]('\x0a'+a35_0x5a311a[_0x5cfc74(0x1dc)](_0x5cfc74(0x21a))+'\x20'+_0x2e539b+_0x3aab80),console[_0x5cfc74(0x1b2)]('─'[_0x5cfc74(0x1fc)](0x3c)),_0x18befa['diff']&&console[_0x5cfc74(0x1b2)](_0x18befa['diff']),console[_0x5cfc74(0x1b2)]('─'[_0x5cfc74(0x1fc)](0x3c));}if(_0x28abb6[_0x5cfc74(0x1e0)]>0x0&&!_0x507469[_0x5cfc74(0x1fe)])for(const _0x39ea34 of _0x28abb6){const _0x636bee=_0x39ea34[_0x5cfc74(0x1df)]?_0x752b0c['get'](_0x39ea34[_0x5cfc74(0x1df)][_0x5cfc74(0x1ff)]())||'':'',_0x523522=_0x636bee?_0x636bee+'/'+_0x39ea34['name']:_0x39ea34[_0x5cfc74(0x1aa)],_0x20e378=_0x406f63[_0x5cfc74(0x18d)](_0x39ea34['id'])||[],_0x3ed99b=_0x20e378[_0x5cfc74(0x1e0)]>0x0?a35_0x5a311a['dim']('\x20['+_0x20e378['length']+_0x5cfc74(0x18b)):'';console[_0x5cfc74(0x1b2)]('\x0a'+a35_0x5a311a[_0x5cfc74(0x20b)]('Delete\x20segment:')+'\x20'+_0x523522+_0x3ed99b),console[_0x5cfc74(0x1b2)]('─'['repeat'](0x3c));const _0x19b019=segmentWithActivationsToYaml(_0x39ea34,_0x20e378,undefined,_0x23f5de,_0x3f0f90),_0x3cb63b=segmentToYamlString(_0x19b019),_0xa61fc=generateDiff(_0x3cb63b,'');console[_0x5cfc74(0x1b2)](formatDiffWithColors(_0xa61fc)),console[_0x5cfc74(0x1b2)]('─'[_0x5cfc74(0x1fc)](0x3c));}const _0xc48b44=_0x41e01c[_0x5cfc74(0x198)](_0x7bd4cb=>!_0x7bd4cb[_0x5cfc74(0x1ae)]&&_0x7bd4cb['diff']);if(_0xc48b44[_0x5cfc74(0x1e0)]>0x0&&!_0x507469[_0x5cfc74(0x1fe)])for(const _0x367729 of _0xc48b44){const _0xe39ff0=_0x367729[_0x5cfc74(0x1de)]?_0x367729[_0x5cfc74(0x1de)]+'/'+_0x367729['yamlConfig'][_0x5cfc74(0x1aa)]:_0x367729['yamlConfig'][_0x5cfc74(0x1aa)];console['error']('\x0a'+a35_0x5a311a[_0x5cfc74(0x199)](_0x5cfc74(0x1b4))+'\x20'+_0xe39ff0),console[_0x5cfc74(0x1b2)]('─'['repeat'](0x3c)),console[_0x5cfc74(0x1b2)](_0x367729['diff']),console[_0x5cfc74(0x1b2)]('─'[_0x5cfc74(0x1fc)](0x3c));}if(_0x83f83a[_0x5cfc74(0x1e0)]>0x0)for(const _0x3f47c8 of _0x83f83a){const _0x25517e=_0x3f47c8[_0x5cfc74(0x1de)]?_0x3f47c8[_0x5cfc74(0x1de)]+'/'+_0x3f47c8[_0x5cfc74(0x17f)][_0x5cfc74(0x1aa)]:_0x3f47c8[_0x5cfc74(0x17f)][_0x5cfc74(0x1aa)];console[_0x5cfc74(0x1b2)]('\x0a'+a35_0x5a311a[_0x5cfc74(0x1dc)](_0x5cfc74(0x17d))+'\x20'+_0x25517e),console[_0x5cfc74(0x1b2)]('─'['repeat'](0x3c)),_0x3f47c8['diff']&&console[_0x5cfc74(0x1b2)](_0x3f47c8[_0x5cfc74(0x191)]),console['error']('─'[_0x5cfc74(0x1fc)](0x3c));}const _0x323fa1=_0x22261a['filter'](_0x272a51=>!_0x272a51[_0x5cfc74(0x1ae)]&&_0x272a51[_0x5cfc74(0x191)]);if(_0x323fa1[_0x5cfc74(0x1e0)]>0x0)for(const _0xa26377 of _0x323fa1){const _0x26638e=_0xa26377[_0x5cfc74(0x1de)]?_0xa26377[_0x5cfc74(0x1de)]+'/'+_0xa26377[_0x5cfc74(0x17f)]['name']:_0xa26377['yamlConfig']['name'];console[_0x5cfc74(0x1b2)]('\x0a'+a35_0x5a311a['yellow'](_0x5cfc74(0x1e4))+'\x20'+_0x26638e),console['error']('─'[_0x5cfc74(0x1fc)](0x3c)),console['error'](_0xa26377[_0x5cfc74(0x191)]),console[_0x5cfc74(0x1b2)]('─'[_0x5cfc74(0x1fc)](0x3c));}if(_0x1a0adc[_0x5cfc74(0x1e0)]>0x0)for(const _0x19d66c of _0x1a0adc){const _0x4c012d=_0x19d66c[_0x5cfc74(0x18c)]?_0x752b0c[_0x5cfc74(0x18d)](_0x19d66c[_0x5cfc74(0x18c)])||'':'',_0x35a357=_0x4c012d?_0x4c012d+'/'+_0x19d66c[_0x5cfc74(0x19b)]:_0x19d66c['journeyBundleName'];console['error']('\x0a'+a35_0x5a311a[_0x5cfc74(0x20b)](_0x5cfc74(0x20f))+'\x20'+_0x35a357),console[_0x5cfc74(0x1b2)]('─'[_0x5cfc74(0x1fc)](0x3c)),console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x20b)](_0x5cfc74(0x180))),console['error']('─'[_0x5cfc74(0x1fc)](0x3c));}if(_0x507469[_0x5cfc74(0x1fb)])return console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x199)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x26d7d2=_0x507469[_0x5cfc74(0x1fe)]?![]:_0x83638e[_0x5cfc74(0x1e0)]>0x0||_0x454aad[_0x5cfc74(0x1e0)]>0x0||_0x28abb6[_0x5cfc74(0x1e0)]>0x0,_0x4bd27a=_0x83f83a[_0x5cfc74(0x1e0)]>0x0||_0x53ec76[_0x5cfc74(0x1e0)]>0x0||_0x1a0adc[_0x5cfc74(0x1e0)]>0x0,_0x2cecaf=_0x507469[_0x5cfc74(0x1fe)]?![]:_0x35e160[_0x5cfc74(0x1e0)]>0x0,_0x259849=_0x4b0343[_0x5cfc74(0x1e0)]>0x0;if(!_0x26d7d2&&!_0x4bd27a&&!_0x2cecaf&&!_0x259849){const _0x3f4add=_0x507469[_0x5cfc74(0x1fe)]?_0x5cfc74(0x1d1):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a35_0x5a311a['green'](_0x3f4add));if(_0x37fb0f&&_0x2be199[_0x5cfc74(0x1e0)]===0x1){const _0x1fc552=_0x2be199[0x0];if(_0x1fc552[_0x5cfc74(0x1a4)]?.['id']){const _0x9ee0db=getConsoleNextUrl(_0x507469['site'],_0x5cfc74(0x20d)+_0x273a5a+_0x5cfc74(0x1f0)+_0x1fc552[_0x5cfc74(0x1a4)]['id']+_0x5cfc74(0x1f4));console['error']('\x20\x20'+a35_0x5a311a[_0x5cfc74(0x1cf)](_0x9ee0db));}}return 0x0;}const _0x337878=_0x507469[_0x5cfc74(0x1fe)]?_0x83f83a[_0x5cfc74(0x1e0)]+_0x53ec76[_0x5cfc74(0x1e0)]+_0x1a0adc[_0x5cfc74(0x1e0)]+_0x4b0343['length']:_0x83638e[_0x5cfc74(0x1e0)]+_0x454aad[_0x5cfc74(0x1e0)]+_0x28abb6[_0x5cfc74(0x1e0)]+_0x83f83a['length']+_0x53ec76[_0x5cfc74(0x1e0)]+_0x1a0adc[_0x5cfc74(0x1e0)]+_0x4b0343['length']+_0x35e160[_0x5cfc74(0x1e0)];if(!_0x507469[_0x5cfc74(0x1ea)]&&_0x337878>0x0){if(!isInteractive())return console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x20b)](_0x5cfc74(0x1a8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x1da)](_0x5cfc74(0x1e8))),0x1;const _0x154269=await confirmKey('Push\x20'+_0x337878+'\x20changes?');if(!_0x154269)return console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x199)]('Aborted.')),0x1;}const _0x1e03e2={'withProgress':async(_0x385b96,_0x3f5484)=>{const _0x2e08fc=_0x5cfc74,_0x120622=await withSpinner(_0x385b96,_0x3f5484,{'verbose':_0x507469['verbose']});return{'data':_0x120622[_0x2e08fc(0x1ca)]};},'logInfo':_0x467a50=>console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x1cd)]('✔\x20'+_0x467a50)),'logSuccess':_0x4d97d9=>console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x1dc)]('✔\x20'+_0x4d97d9)),'logWarning':_0x3430c3=>console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x199)]('⚠\x20'+_0x3430c3)),'logDeleted':_0x4ff9d7=>console['error'](a35_0x5a311a[_0x5cfc74(0x20b)]('✔\x20'+_0x4ff9d7))},_0x48eb84={'segment':_0x4ecab4[_0x5cfc74(0x17c)],'journey':_0x4ecab4['journey'],'user':_0x4ecab4[_0x5cfc74(0x1a3)],'connection':_0x4ecab4[_0x5cfc74(0x19a)]};_0x4b0343[_0x5cfc74(0x1e0)]>0x0&&(_0x10f3bf=await executePushFolders(_0x48eb84,_0x4b0343,_0x10f3bf,{'parentId':_0x273a5a},_0x1e03e2));const _0x544cc3={'rootFolderId':_0x56d0ba,'folderPathToId':_0x10f3bf,'folderIdToPath':_0x752b0c,'segmentNameToId':_0x1f756b,'activationsBySegmentId':_0x406f63,'emailToIdMap':_0x24d465,'idToEmailMap':_0x23f5de,'connectionNameToIdMap':_0x7d719e[_0x5cfc74(0x1fa)],'connectionIdToNameMap':_0x7d719e[_0x5cfc74(0x1ac)],'connectionNameToTypeMap':_0x46e1c4},_0x22122a=await executePushSegments(_0x48eb84,_0x507469[_0x5cfc74(0x1fe)]?[]:_0x41e01c,_0x544cc3,{'parentId':_0x273a5a},_0x1e03e2),_0x1228f0=_0x22122a[_0x5cfc74(0x1e5)],_0x5e22e4=_0x22122a[_0x5cfc74(0x1a7)],_0x2194d0=_0x22122a[_0x5cfc74(0x182)]['created'],_0x53020b=_0x22122a['activations'][_0x5cfc74(0x1a7)],_0x4807da=_0x22122a['activations'][_0x5cfc74(0x1e2)],_0x6ecaf8=await executePushSegmentDeletions(_0x48eb84,_0x507469[_0x5cfc74(0x1fe)]?[]:_0x28abb6,_0x1e03e2);let _0x31f18a=0x0,_0x822c80=0x0,_0x34c3ce=0x0;const _0x21f405=new Map(_0x1f756b);for(const [_0x48dd1a,_0x2358b]of _0x22122a[_0x5cfc74(0x1b7)]){_0x21f405['set'](_0x48dd1a,_0x2358b);}if(_0x22261a[_0x5cfc74(0x1e0)]>0x0){const _0x57307e={..._0x544cc3,'segmentNameToId':_0x21f405,'existingSegments':_0x228ea7,'activationContext':_0x308e9c},_0xf98e16=await executePushJourneys(_0x48eb84,_0x22261a,_0x57307e,{'parentId':_0x273a5a,'rootFolderId':_0x56d0ba,'verbose':_0x507469[_0x5cfc74(0x208)]},_0x1e03e2);_0x31f18a=_0xf98e16[_0x5cfc74(0x1e5)],_0x822c80=_0xf98e16[_0x5cfc74(0x1a7)];if(_0x37fb0f&&_0xf98e16[_0x5cfc74(0x181)][_0x5cfc74(0x1e0)]===0x1){const _0x3f6a67=_0xf98e16['results'][0x0];if(_0x3f6a67[_0x5cfc74(0x1c2)]){const _0x183c70=getConsoleNextUrl(_0x507469[_0x5cfc74(0x1f5)],_0x5cfc74(0x20d)+_0x273a5a+_0x5cfc74(0x1f0)+_0x3f6a67['journeyId']+_0x5cfc74(0x1f4));console[_0x5cfc74(0x1b2)]('\x20\x20'+a35_0x5a311a[_0x5cfc74(0x1cf)](_0x183c70));}}}for(const _0x37da93 of _0x1a0adc){console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x199)](_0x5cfc74(0x1a0)+_0x37da93[_0x5cfc74(0x19b)])),_0x34c3ce++;}const _0x54a6a5=[];if(_0x1228f0>0x0)_0x54a6a5[_0x5cfc74(0x1b1)](_0x1228f0+'\x20created');if(_0x5e22e4>0x0)_0x54a6a5[_0x5cfc74(0x1b1)](_0x5e22e4+_0x5cfc74(0x1b9));if(_0x6ecaf8>0x0)_0x54a6a5['push'](_0x6ecaf8+_0x5cfc74(0x215));const _0x3c9cd9=[];if(_0x31f18a>0x0)_0x3c9cd9[_0x5cfc74(0x1b1)](_0x31f18a+_0x5cfc74(0x197));if(_0x822c80>0x0)_0x3c9cd9[_0x5cfc74(0x1b1)](_0x822c80+'\x20updated');if(_0x34c3ce>0x0)_0x3c9cd9[_0x5cfc74(0x1b1)](_0x34c3ce+_0x5cfc74(0x215));const _0x450154=[];if(_0x2194d0>0x0)_0x450154[_0x5cfc74(0x1b1)](_0x2194d0+_0x5cfc74(0x197));if(_0x53020b>0x0)_0x450154[_0x5cfc74(0x1b1)](_0x53020b+_0x5cfc74(0x1b9));if(_0x4807da>0x0)_0x450154[_0x5cfc74(0x1b1)](_0x4807da+_0x5cfc74(0x215));return console[_0x5cfc74(0x1b2)](a35_0x5a311a[_0x5cfc74(0x1dc)](_0x5cfc74(0x1ad))),_0x54a6a5['length']>0x0&&!_0x507469[_0x5cfc74(0x1fe)]&&console['error']('\x20\x20Segments:\x20'+_0x54a6a5[_0x5cfc74(0x1c7)](',\x20')),_0x3c9cd9['length']>0x0&&console[_0x5cfc74(0x1b2)](_0x5cfc74(0x1d7)+_0x3c9cd9[_0x5cfc74(0x1c7)](',\x20')),_0x450154[_0x5cfc74(0x1e0)]>0x0&&!_0x507469[_0x5cfc74(0x1fe)]&&console['error']('\x20\x20Activations:\x20'+_0x450154[_0x5cfc74(0x1c7)](',\x20')),0x0;}}
|
|
1
|
+
const a35_0xbc02cc=a35_0x4411;(function(_0x42d631,_0x15bee6){const _0x10c9df=a35_0x4411,_0x372312=_0x42d631();while(!![]){try{const _0x2dc407=parseInt(_0x10c9df(0xc9))/0x1+-parseInt(_0x10c9df(0xcd))/0x2+-parseInt(_0x10c9df(0xee))/0x3*(parseInt(_0x10c9df(0x118))/0x4)+parseInt(_0x10c9df(0xae))/0x5+parseInt(_0x10c9df(0xce))/0x6+parseInt(_0x10c9df(0x10b))/0x7*(-parseInt(_0x10c9df(0xc5))/0x8)+parseInt(_0x10c9df(0xb6))/0x9*(parseInt(_0x10c9df(0x12f))/0xa);if(_0x2dc407===_0x15bee6)break;else _0x372312['push'](_0x372312['shift']());}catch(_0x5a7d43){_0x372312['push'](_0x372312['shift']());}}}(a35_0x538b,0x3a321));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a35_0x538b(){const _0x28a624=['yes','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','45qyUGvU','\x20\x20📊\x20Segments:','changed','\x20unchanged','yamlConfig','\x0a✔\x20Push\x20complete','scopedFolderPath','\x0aError:','cyan','getOutputSchemaWithCache','state','green','unchanged','Delete\x20journey:','set','224FkEaup','folderId','dryRun','.yml','117602hriewO','parentSegment','all','updated','556328XcEGtt','1436064kjltqO','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20🗺️\x20\x20Journeys:','repeat','Fetching\x20existing\x20data...','activations','/j/da/je','toString','message','toCreate','parentName','Changes\x20to:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20to\x20create','length','existingJourney','📁\x20','\x20activations]','folderPath','blue','file','New\x20segment:','\x20\x20Activations:','map','segmentFolderId','journey','filter','New\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','attributes','type','journeys','6sEAbsx','new','data','nameToId','listFolders','journeyId','\x20created','red','segment\x20or\x20journey','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/e/','push','isNew','journeyBundleName','journeyBundleId','parent_name','dim','error','segments','join','folders','\x20changed','versionNumber','Resolving\x20parent\x20segment\x20\x27','created','then','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','listJourneysWithDetailsFromParentSegment','58317DpElXI','listActivations','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Changes\x20to\x20journey:','setPhase','toUpdate','connection','\x20new','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20\x20\x20','getJourney','232780LTONkQ','(Journey\x20will\x20be\x20deleted)','description','Push\x20','\x20updated','delete','execute','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20Directory\x20not\x20found:\x20','parentFolder','Aborted.','\x20folders\x20to\x20create','Error\x20parsing\x20YAML:\x20','getParent','results','Error:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment','\x0aValidation\x20failed:','yellow','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','site','\x20changes?','175150YslQCW','Folders\x20to\x20create:','diff','verbose','\x20deleted','user','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','get','segment:push','targetDir','endsWith','\x20\x20Journeys:\x20','name','Source\x20directory:\x20','relationships','idToName','\x20\x20Source:\x20','\x20to\x20delete','Scoped\x20to\x20folder:\x20','deleted','2108350zAqiOl','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','no_parent','toDelete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files'];a35_0x538b=function(){return _0x28a624;};return a35_0x538b();}import{confirmKey,isInteractive}from'../utils/prompt.js';function a35_0x4411(_0xc6a784,_0x18521d){_0xc6a784=_0xc6a784-0xac;const _0x538b1a=a35_0x538b();let _0x441197=_0x538b1a[_0xc6a784];return _0x441197;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x49a32b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0xbc02cc(0x13b)]=a35_0xbc02cc(0x137);[a35_0xbc02cc(0x11a)]=a35_0xbc02cc(0x115);async[a35_0xbc02cc(0x11e)](_0x4fe48){const _0x2028eb=a35_0xbc02cc,{options:_0x38363f,args:_0x1c107d,tdx:_0x2de074}=_0x4fe48,_0x2ceab2=_0x38363f,_0x4df4ef=await resolveTarget({'arg':_0x1c107d[0x0],'contextParent':_0x38363f[_0x2028eb(0xca)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4df4ef))return _0x4df4ef[_0x2028eb(0x113)]===_0x2028eb(0xb0)?(console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x2028eb(0x100)](_0x2028eb(0xf8)),console[_0x2028eb(0x100)](_0x2028eb(0x114))):(console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0x127)+_0x4df4ef['message']+'\x0a')),_0x4df4ef['helpText']&&console['error'](a35_0x49a32b[_0x2028eb(0xbe)](_0x4df4ef['helpText']))),0x1;if(_0x4df4ef[_0x2028eb(0xec)]===_0x2028eb(0xfe))return console['error'](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x120)+_0x4df4ef['targetDir']+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xcf))),0x1;const _0x55bbda=_0x4df4ef[_0x2028eb(0xd8)],_0x4cc21a=_0x4df4ef[_0x2028eb(0x138)],_0x3a85dd=_0x4df4ef[_0x2028eb(0xec)]===_0x2028eb(0xe2)?_0x4df4ef['filePath']:undefined,_0x2cbd4a=getScopedDetails(_0x4df4ef),_0x2e5bd9=_0x2cbd4a?.['isScoped']??![],_0x39660e=_0x2cbd4a?.[_0x2028eb(0xbc)]??'';if(!existsSync(_0x4cc21a))return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x120)+_0x4cc21a+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xcf))),0x1;_0x2ceab2[_0x2028eb(0x132)]&&(console[_0x2028eb(0x100)]('Site:\x20'+_0x2ceab2[_0x2028eb(0x12d)]),console[_0x2028eb(0x100)](_0x2028eb(0xf7)+_0x55bbda),console['error'](_0x2028eb(0x13c)+_0x4cc21a),_0x2e5bd9&&console[_0x2028eb(0x100)](_0x2028eb(0xac)+_0x39660e));const _0x235bd3=await withSpinner(_0x2028eb(0x106)+_0x55bbda+'\x27...',()=>_0x2de074[_0x2028eb(0x129)]['resolveParentId'](_0x55bbda),{'verbose':_0x2ceab2[_0x2028eb(0x132)]}),_0x122245=_0x235bd3[_0x2028eb(0xf0)],{parentSegmentResult:_0x52426a,segmentsResult:_0x48bfd7,foldersResult:_0x2773e5,journeysWithDetailsResult:_0x169d0c,userMaps:_0x2dc2d}=await withSpinner(_0x2028eb(0xd2),async()=>{const _0x2699d6=_0x2028eb,[_0x2c7b81,_0x2ce8e7,_0xefa78c,_0x3f339a,_0x25152c]=await Promise[_0x2699d6(0xcb)]([_0x2de074['segment'][_0x2699d6(0x125)](_0x122245),_0x2de074[_0x2699d6(0x129)]['listSegments'](_0x122245),_0x2de074[_0x2699d6(0x129)][_0x2699d6(0xf2)](_0x122245),_0x2de074[_0x2699d6(0xe7)][_0x2699d6(0x10a)](_0x122245,{'includeAllVersions':!![]}),_0x2de074[_0x2699d6(0x134)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2c7b81,'segmentsResult':_0x2ce8e7,'foldersResult':_0xefa78c,'journeysWithDetailsResult':_0x3f339a,'userMaps':_0x25152c};},{'verbose':_0x2ceab2['verbose']})[_0x2028eb(0x108)](_0x2f1be1=>_0x2f1be1['data']),_0x3e4254=_0x52426a,_0x3daec3=extractRootFolderId(_0x3e4254),_0x37e410=_0x48bfd7,_0x2e7198=_0x2773e5,{journeys:_0x3885f6,activationStepsById:_0x50d112}=_0x169d0c,_0x2a3628=new Map(_0x3885f6[_0x2028eb(0xe5)](_0x38d86d=>[_0x38d86d['id'],_0x38d86d])),_0x357b49=_0x3885f6['map'](_0x32657c=>({'id':_0x32657c['id'],'name':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x13b)],'journeyBundleName':_0x32657c[_0x2028eb(0xeb)]['journeyBundleName']||'','journeyBundleId':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0xfd)]||'','versionNumber':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x105)],'description':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x11a)],'state':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0xc0)],'paused':_0x32657c[_0x2028eb(0xeb)]['paused'],'audienceId':_0x32657c['attributes']['audienceId'],'folderId':_0x32657c[_0x2028eb(0x13d)]?.[_0x2028eb(0x121)]?.[_0x2028eb(0xf0)]?.['id'],'createdAt':_0x32657c[_0x2028eb(0xeb)]['createdAt'],'updatedAt':_0x32657c[_0x2028eb(0xeb)]['updatedAt']})),{emailToId:_0x4a10e3,idToEmail:_0x180aee}=_0x2dc2d,_0x7dce52=await withSpinner(_0x2028eb(0x11f),async()=>{const _0x4a4031=_0x2028eb,_0x1e3a88=await _0x2de074[_0x4a4031(0x111)]['list']();return buildConnectionMaps(_0x1e3a88);},{'verbose':_0x2ceab2['verbose']})[_0x2028eb(0x108)](_0x572db6=>_0x572db6[_0x2028eb(0xf0)]),_0xa0cd6=_0x7dce52['nameToId'],_0x1f099a=_0x7dce52[_0x2028eb(0x13e)],_0x5d9205=_0x7dce52['nameToType'],_0x30f224={'emailToIdMap':_0x4a10e3,'connectionNameToIdMap':_0xa0cd6,'connectionNameToTypeMap':_0x5d9205,'getSchema':_0x102cb2=>_0x2de074['connection'][_0x2028eb(0xbf)](_0x102cb2)};let {pathToId:_0x354b5c,idToPath:_0x54b16d}=buildFolderMaps(_0x2e7198);const _0x1e19bf=buildSegmentLookupMap(_0x37e410,_0x54b16d),_0x44e1b5=buildSegmentNameToIdMap(_0x37e410),_0x3e23e2=buildJourneyBundleLookupMap(_0x357b49,_0x54b16d);let _0x188475;if(_0x3a85dd){if(!_0x3a85dd['endsWith'](_0x2028eb(0xc8))&&!_0x3a85dd[_0x2028eb(0x139)]('.yaml'))return console['error'](a35_0x49a32b['red'](_0x2028eb(0xea)+_0x3a85dd+'\x0a')),0x1;_0x188475=[_0x3a85dd];}else _0x188475=findYamlFiles(_0x4cc21a);if(_0x188475[_0x2028eb(0xdc)]===0x0)return console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0xb5)+_0x4cc21a+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xb2))),0x1;let _0x5266f8,_0x12b8f1;try{const _0xba8c8e=parseAndClassifyYamlFiles(_0x188475,_0x4cc21a,{'skipSegments':_0x2ceab2[_0x2028eb(0xb4)]});_0x5266f8=_0xba8c8e['segments'],_0x12b8f1=_0xba8c8e['journeys'];const _0xd1beb5=validateParsedFiles(_0xba8c8e,_0x4cc21a);if(_0xd1beb5[_0x2028eb(0xdc)]>0x0)return console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0x12a))),console[_0x2028eb(0x100)](formatValidationErrors(_0xd1beb5)),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x109))),0x1;}catch(_0x47b897){return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x124)+(_0x47b897 instanceof Error?_0x47b897[_0x2028eb(0xd6)]:_0x47b897))),0x1;}if(_0x5266f8[_0x2028eb(0xdc)]===0x0&&_0x12b8f1[_0x2028eb(0xdc)]===0x0){const _0xf54ee5=_0x2ceab2[_0x2028eb(0xb4)]?_0x2028eb(0xe7):_0x2028eb(0xf6);return console['error'](a35_0x49a32b[_0x2028eb(0x12b)]('No\x20'+_0xf54ee5+'\x20YAML\x20files\x20found')),0x0;}const _0x3a87b0=new Map();_0x37e410['length']>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x37e410,async _0x2b3595=>{const _0x3c0b46=a35_0x4411,_0x11079f=await _0x2de074[_0x3c0b46(0x129)][_0x3c0b46(0x10c)](_0x122245,_0x2b3595['id']);_0x3a87b0[_0x3c0b46(0xc4)](_0x2b3595['id'],_0x11079f);});},{'verbose':_0x2ceab2[_0x2028eb(0x132)]});const {segmentFiles:_0x5b2276,foldersToCreate:_0x38fecc}=await prepareSegmentFiles(_0x5266f8,{'segmentByFolderAndName':_0x1e19bf,'activationsBySegmentId':_0x3a87b0,'folderPathToId':_0x354b5c,'idToEmailMap':_0x180aee,'connectionIdToNameMap':_0x1f099a},_0x30f224,_0x2e5bd9,_0x39660e),_0x31ffe1=_0x3a85dd?[]:findSegmentsToDelete(_0x37e410,_0x5266f8[_0x2028eb(0xe5)](({yamlConfig:_0x143e7e,folderPath:_0x5aaf75})=>({'yamlConfig':_0x143e7e,'folderPath':resolveTDFolderPath(_0x5aaf75,_0x2e5bd9,_0x39660e)})),_0x54b16d,_0x39660e,_0x2e5bd9),{journeyFiles:_0xebdd7a,foldersToCreate:_0x141d45}=await withProgressSpinner('Preparing\x20journeys...',async _0x596258=>prepareJourneyFiles(_0x12b8f1,{'fetchJourney':async _0x1c3d9d=>_0x2de074[_0x2028eb(0xe7)][_0x2028eb(0x117)](_0x1c3d9d[_0x2028eb(0xf3)]),'journeyBundlesByFolderAndName':_0x3e23e2,'folderPathToId':_0x354b5c,'idToEmailMap':_0x180aee,'connectionIdToNameMap':_0x1f099a,'existingSegments':_0x37e410,'parentId':_0x122245,'deps':_0x2de074,'progress':{'update':_0x10a640=>{const _0x277cba=_0x2028eb;_0x596258[_0x277cba(0x10f)](_0x10a640),_0x2ceab2[_0x277cba(0x132)]&&console['error']('\x20\x20'+_0x10a640);}},'journeyById':_0x2a3628,'activationStepsById':_0x50d112},_0x2e5bd9,_0x39660e),{'verbose':_0x2ceab2[_0x2028eb(0x132)]})[_0x2028eb(0x108)](_0x256d75=>_0x256d75['data']);for(const _0x39819e of _0x141d45){_0x38fecc['add'](_0x39819e);}const _0x505b82=_0x3a85dd?[]:findJourneysToDelete(_0x357b49,_0x12b8f1['map'](({yamlConfig:_0x2be74d,folderPath:_0x43f773})=>({'yamlConfig':_0x2be74d,'folderPath':resolveTDFolderPath(_0x43f773,_0x2e5bd9,_0x39660e)})),_0x54b16d,_0x39660e,_0x2e5bd9),_0x55dc0c=calculatePushStats(_0x5b2276,_0xebdd7a,_0x38fecc,_0x31ffe1,_0x505b82,!!_0x2ceab2[_0x2028eb(0x11d)],!!_0x2ceab2[_0x2028eb(0xb4)]),_0x1c8d8a=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xef)],_0x3628ac=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xb8)],_0xef851a=_0x55dc0c[_0x2028eb(0x101)]['unchanged'],_0x42af08=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xb1)],_0x16ace4=_0x55dc0c[_0x2028eb(0x103)]['toCreate'],_0x486fd6=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xef)],_0x10424b=_0x55dc0c[_0x2028eb(0xed)]['changed'],_0x5773c6=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xc2)],_0x398c59=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xb1)],_0x5aa7dc=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xcb)],_0x355513=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xd7)],_0x5911b4=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0x110)],_0xaa96eb=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xb1)];console[_0x2028eb(0x100)]('\x0aPush\x20summary\x20for\x20\x27'+_0x55bbda+'\x27:');_0x16ace4[_0x2028eb(0xdc)]>0x0&&console['error']('\x20\x20'+a35_0x49a32b[_0x2028eb(0xe1)](_0x2028eb(0xde)+_0x16ace4['length']+_0x2028eb(0x123)));if(!_0x2ceab2[_0x2028eb(0xb4)]){console[_0x2028eb(0x100)](_0x2028eb(0xb7)),console[_0x2028eb(0x100)]('\x20\x20\x20\x20'+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x1c8d8a['length']+_0x2028eb(0x112))),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0x12b)]('~\x20'+_0x3628ac[_0x2028eb(0xdc)]+'\x20changed'));if(_0x42af08[_0x2028eb(0xdc)]>0x0)console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0x42af08[_0x2028eb(0xdc)]+_0x2028eb(0x140)));else _0x31ffe1[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0x11d)]&&console[_0x2028eb(0x100)]('\x20\x20\x20\x20'+a35_0x49a32b[_0x2028eb(0xff)](_0x31ffe1[_0x2028eb(0xdc)]+_0x2028eb(0x10d)));console['error'](_0x2028eb(0x116)+a35_0x49a32b['dim']('=\x20'+_0xef851a['length']+'\x20unchanged'));}if(_0xebdd7a[_0x2028eb(0xdc)]>0x0||_0x505b82[_0x2028eb(0xdc)]>0x0){console[_0x2028eb(0x100)](_0x2028eb(0xd0)),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x486fd6[_0x2028eb(0xdc)]+_0x2028eb(0x112))),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b['yellow']('~\x20'+_0x10424b[_0x2028eb(0xdc)]+_0x2028eb(0x104)));if(_0x398c59[_0x2028eb(0xdc)]>0x0)console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0x398c59['length']+_0x2028eb(0x140)));else _0x505b82[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0x11d)]&&console['error'](_0x2028eb(0x116)+a35_0x49a32b['dim'](_0x505b82[_0x2028eb(0xdc)]+_0x2028eb(0x10d)));console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xff)]('=\x20'+_0x5773c6[_0x2028eb(0xdc)]+_0x2028eb(0xb9)));}_0x5aa7dc[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&(console[_0x2028eb(0x100)](''),console[_0x2028eb(0x100)](_0x2028eb(0xe4)),_0x355513['length']>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x355513[_0x2028eb(0xdc)]+_0x2028eb(0xdb))),_0x5911b4['length']>0x0&&console['error'](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0x12b)]('~\x20'+_0x5911b4[_0x2028eb(0xdc)]+'\x20to\x20update')),_0xaa96eb[_0x2028eb(0xdc)]>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0xaa96eb[_0x2028eb(0xdc)]+_0x2028eb(0x140))));console[_0x2028eb(0x100)](_0x2028eb(0x13f)+a35_0x49a32b[_0x2028eb(0xbe)](_0x4cc21a)+'\x0a');if(_0x16ace4[_0x2028eb(0xdc)]>0x0){console[_0x2028eb(0x100)](_0x2028eb(0x130));for(const _0x77fba7 of _0x16ace4){console[_0x2028eb(0x100)]('\x20\x20'+a35_0x49a32b[_0x2028eb(0xe1)]('+')+'\x20'+_0x77fba7);}console[_0x2028eb(0x100)]('');}if(_0x1c8d8a[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x28b13a of _0x1c8d8a){const _0x2c629b=_0x28b13a[_0x2028eb(0xe0)]?_0x28b13a[_0x2028eb(0xe0)]+'/'+_0x28b13a[_0x2028eb(0xba)]['name']:_0x28b13a['yamlConfig'][_0x2028eb(0x13b)],_0x37b3fa=_0x28b13a['yamlConfig'][_0x2028eb(0xd3)]?.[_0x2028eb(0xdc)]||0x0,_0x3a7744=_0x37b3fa>0x0?a35_0x49a32b[_0x2028eb(0xff)]('\x20['+_0x37b3fa+'\x20activations]'):'';console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b['green'](_0x2028eb(0xe3))+'\x20'+_0x2c629b+_0x3a7744),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),_0x28b13a[_0x2028eb(0x131)]&&console[_0x2028eb(0x100)](_0x28b13a['diff']),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x42af08['length']>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x109a13 of _0x42af08){const _0xe2b25d=_0x109a13[_0x2028eb(0xe6)]?_0x54b16d[_0x2028eb(0x136)](_0x109a13[_0x2028eb(0xe6)][_0x2028eb(0xd5)]())||'':'',_0x3310fb=_0xe2b25d?_0xe2b25d+'/'+_0x109a13[_0x2028eb(0x13b)]:_0x109a13[_0x2028eb(0x13b)],_0x26e899=_0x3a87b0['get'](_0x109a13['id'])||[],_0x4e67b8=_0x26e899['length']>0x0?a35_0x49a32b['dim']('\x20['+_0x26e899[_0x2028eb(0xdc)]+_0x2028eb(0xdf)):'';console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0xf5)]('Delete\x20segment:')+'\x20'+_0x3310fb+_0x4e67b8),console['error']('─'[_0x2028eb(0xd1)](0x3c));const _0x3d1660=segmentWithActivationsToYaml(_0x109a13,_0x26e899,undefined,_0x180aee,_0x1f099a),_0x241a04=segmentToYamlString(_0x3d1660),_0x289689=generateDiff(_0x241a04,'');console[_0x2028eb(0x100)](formatDiffWithColors(_0x289689)),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}const _0x4d2677=_0x5b2276[_0x2028eb(0xe8)](_0x2cee2f=>!_0x2cee2f[_0x2028eb(0xfb)]&&_0x2cee2f[_0x2028eb(0x131)]);if(_0x4d2677[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x2cad70 of _0x4d2677){const _0x24c521=_0x2cad70[_0x2028eb(0xe0)]?_0x2cad70[_0x2028eb(0xe0)]+'/'+_0x2cad70[_0x2028eb(0xba)][_0x2028eb(0x13b)]:_0x2cad70[_0x2028eb(0xba)][_0x2028eb(0x13b)];console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0xd9))+'\x20'+_0x24c521),console[_0x2028eb(0x100)]('─'['repeat'](0x3c)),console['error'](_0x2cad70[_0x2028eb(0x131)]),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x486fd6[_0x2028eb(0xdc)]>0x0)for(const _0x10c276 of _0x486fd6){const _0x3e4db7=_0x10c276[_0x2028eb(0xe0)]?_0x10c276[_0x2028eb(0xe0)]+'/'+_0x10c276[_0x2028eb(0xba)]['name']:_0x10c276[_0x2028eb(0xba)]['name'];console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0xc1)](_0x2028eb(0xe9))+'\x20'+_0x3e4db7),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),_0x10c276[_0x2028eb(0x131)]&&console[_0x2028eb(0x100)](_0x10c276['diff']),console['error']('─'['repeat'](0x3c));}const _0x5a743a=_0xebdd7a['filter'](_0x4963f9=>!_0x4963f9[_0x2028eb(0xfb)]&&_0x4963f9[_0x2028eb(0x131)]);if(_0x5a743a[_0x2028eb(0xdc)]>0x0)for(const _0x326a95 of _0x5a743a){const _0xd23177=_0x326a95['folderPath']?_0x326a95['folderPath']+'/'+_0x326a95[_0x2028eb(0xba)][_0x2028eb(0x13b)]:_0x326a95['yamlConfig']['name'];console['error']('\x0a'+a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x10e))+'\x20'+_0xd23177),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),console['error'](_0x326a95[_0x2028eb(0x131)]),console['error']('─'[_0x2028eb(0xd1)](0x3c));}if(_0x398c59[_0x2028eb(0xdc)]>0x0)for(const _0x3caf28 of _0x398c59){const _0x3bea47=_0x3caf28[_0x2028eb(0xc6)]?_0x54b16d['get'](_0x3caf28[_0x2028eb(0xc6)])||'':'',_0x55903d=_0x3bea47?_0x3bea47+'/'+_0x3caf28[_0x2028eb(0xfc)]:_0x3caf28['journeyBundleName'];console['error']('\x0a'+a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0xc3))+'\x20'+_0x55903d),console['error']('─'[_0x2028eb(0xd1)](0x3c)),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x119))),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x2ceab2[_0x2028eb(0xc7)])return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0xaf))),0x0;const _0x92f17b=_0x2ceab2['journeysOnly']?![]:_0x1c8d8a[_0x2028eb(0xdc)]>0x0||_0x3628ac[_0x2028eb(0xdc)]>0x0||_0x42af08[_0x2028eb(0xdc)]>0x0,_0x2a641f=_0x486fd6[_0x2028eb(0xdc)]>0x0||_0x10424b[_0x2028eb(0xdc)]>0x0||_0x398c59[_0x2028eb(0xdc)]>0x0,_0x30b27d=_0x2ceab2['journeysOnly']?![]:_0x5aa7dc[_0x2028eb(0xdc)]>0x0,_0x5cbedc=_0x16ace4[_0x2028eb(0xdc)]>0x0;if(!_0x92f17b&&!_0x2a641f&&!_0x30b27d&&!_0x5cbedc){const _0x25229c=_0x2ceab2[_0x2028eb(0xb4)]?_0x2028eb(0x135):_0x2028eb(0x12c);console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xc1)](_0x25229c));if(_0x3a85dd&&_0x5773c6[_0x2028eb(0xdc)]===0x1){const _0x10fcda=_0x5773c6[0x0];if(_0x10fcda[_0x2028eb(0xdd)]?.['id']){const _0x6f6bb3=getConsoleNextUrl(_0x2ceab2['site'],'/app/ps/'+_0x122245+_0x2028eb(0xf9)+_0x10fcda[_0x2028eb(0xdd)]['id']+_0x2028eb(0xd4));console[_0x2028eb(0x100)]('\x20\x20'+a35_0x49a32b[_0x2028eb(0xbe)](_0x6f6bb3));}}return 0x0;}const _0x5a4c85=_0x2ceab2[_0x2028eb(0xb4)]?_0x486fd6['length']+_0x10424b[_0x2028eb(0xdc)]+_0x398c59[_0x2028eb(0xdc)]+_0x16ace4[_0x2028eb(0xdc)]:_0x1c8d8a[_0x2028eb(0xdc)]+_0x3628ac[_0x2028eb(0xdc)]+_0x42af08['length']+_0x486fd6[_0x2028eb(0xdc)]+_0x10424b[_0x2028eb(0xdc)]+_0x398c59[_0x2028eb(0xdc)]+_0x16ace4['length']+_0x5aa7dc[_0x2028eb(0xdc)];if(!_0x2ceab2[_0x2028eb(0xb3)]&&_0x5a4c85>0x0){if(!isInteractive())return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0xbd)),_0x2028eb(0x128)),console['error'](a35_0x49a32b[_0x2028eb(0xff)](_0x2028eb(0xda))),0x1;const _0x32579e=await confirmKey(_0x2028eb(0x11b)+_0x5a4c85+_0x2028eb(0x12e));if(!_0x32579e)return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x122))),0x1;}const _0x29c36f={'withProgress':async(_0x594662,_0x448768)=>{const _0x1c69c7=_0x2028eb,_0x400d51=await withSpinner(_0x594662,_0x448768,{'verbose':_0x2ceab2[_0x1c69c7(0x132)]});return{'data':_0x400d51[_0x1c69c7(0xf0)]};},'logInfo':_0x79741c=>console[_0x2028eb(0x100)](a35_0x49a32b['blue']('✔\x20'+_0x79741c)),'logSuccess':_0x2f1257=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xc1)]('✔\x20'+_0x2f1257)),'logWarning':_0x1aee50=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('⚠\x20'+_0x1aee50)),'logDeleted':_0x22fb51=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)]('✔\x20'+_0x22fb51))},_0x31f47b={'segment':_0x2de074[_0x2028eb(0x129)],'journey':_0x2de074['journey'],'user':_0x2de074[_0x2028eb(0x134)],'connection':_0x2de074['connection']};_0x16ace4[_0x2028eb(0xdc)]>0x0&&(_0x354b5c=await executePushFolders(_0x31f47b,_0x16ace4,_0x354b5c,{'parentId':_0x122245},_0x29c36f));const _0x2c96eb={'rootFolderId':_0x3daec3,'folderPathToId':_0x354b5c,'folderIdToPath':_0x54b16d,'segmentNameToId':_0x44e1b5,'activationsBySegmentId':_0x3a87b0,'emailToIdMap':_0x4a10e3,'idToEmailMap':_0x180aee,'connectionNameToIdMap':_0x7dce52[_0x2028eb(0xf1)],'connectionIdToNameMap':_0x7dce52[_0x2028eb(0x13e)],'connectionNameToTypeMap':_0x5d9205},_0x3eb7e3=await executePushSegments(_0x31f47b,_0x2ceab2[_0x2028eb(0xb4)]?[]:_0x5b2276,_0x2c96eb,{'parentId':_0x122245},_0x29c36f),_0xfc3978=_0x3eb7e3[_0x2028eb(0x107)],_0x3b0f04=_0x3eb7e3[_0x2028eb(0xcc)],_0x3ea425=_0x3eb7e3['activations'][_0x2028eb(0x107)],_0x3aebcd=_0x3eb7e3[_0x2028eb(0xd3)][_0x2028eb(0xcc)],_0x3026b9=_0x3eb7e3[_0x2028eb(0xd3)][_0x2028eb(0xad)],_0x79ea10=await executePushSegmentDeletions(_0x31f47b,_0x2ceab2['journeysOnly']?[]:_0x42af08,_0x29c36f);let _0x1d0314=0x0,_0x26bbc1=0x0,_0x45e281=0x0;const _0x5e76aa=new Map(_0x44e1b5);for(const [_0x189897,_0x4eee16]of _0x3eb7e3['createdSegmentIds']){_0x5e76aa[_0x2028eb(0xc4)](_0x189897,_0x4eee16);}if(_0xebdd7a[_0x2028eb(0xdc)]>0x0){const _0x522550={..._0x2c96eb,'segmentNameToId':_0x5e76aa,'existingSegments':_0x37e410,'activationContext':_0x30f224},_0x2cbf3d=await executePushJourneys(_0x31f47b,_0xebdd7a,_0x522550,{'parentId':_0x122245,'rootFolderId':_0x3daec3,'verbose':_0x2ceab2['verbose']},_0x29c36f);_0x1d0314=_0x2cbf3d[_0x2028eb(0x107)],_0x26bbc1=_0x2cbf3d['updated'];if(_0x3a85dd&&_0x2cbf3d[_0x2028eb(0x126)]['length']===0x1){const _0x35b196=_0x2cbf3d[_0x2028eb(0x126)][0x0];if(_0x35b196[_0x2028eb(0xf3)]){const _0x184dc8=getConsoleNextUrl(_0x2ceab2[_0x2028eb(0x12d)],'/app/ps/'+_0x122245+_0x2028eb(0xf9)+_0x35b196[_0x2028eb(0xf3)]+_0x2028eb(0xd4));console['error']('\x20\x20'+a35_0x49a32b[_0x2028eb(0xbe)](_0x184dc8));}}}for(const _0x37e2b of _0x398c59){console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x37e2b[_0x2028eb(0xfc)])),_0x45e281++;}const _0xd7504b=[];if(_0xfc3978>0x0)_0xd7504b[_0x2028eb(0xfa)](_0xfc3978+_0x2028eb(0xf4));if(_0x3b0f04>0x0)_0xd7504b[_0x2028eb(0xfa)](_0x3b0f04+'\x20updated');if(_0x79ea10>0x0)_0xd7504b[_0x2028eb(0xfa)](_0x79ea10+'\x20deleted');const _0xf865c7=[];if(_0x1d0314>0x0)_0xf865c7['push'](_0x1d0314+_0x2028eb(0xf4));if(_0x26bbc1>0x0)_0xf865c7[_0x2028eb(0xfa)](_0x26bbc1+_0x2028eb(0x11c));if(_0x45e281>0x0)_0xf865c7[_0x2028eb(0xfa)](_0x45e281+_0x2028eb(0x133));const _0x56ae6e=[];if(_0x3ea425>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3ea425+_0x2028eb(0xf4));if(_0x3aebcd>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3aebcd+_0x2028eb(0x11c));if(_0x3026b9>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3026b9+_0x2028eb(0x133));return console['error'](a35_0x49a32b[_0x2028eb(0xc1)](_0x2028eb(0xbb))),_0xd7504b[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&console[_0x2028eb(0x100)]('\x20\x20Segments:\x20'+_0xd7504b['join'](',\x20')),_0xf865c7[_0x2028eb(0xdc)]>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x13a)+_0xf865c7[_0x2028eb(0x102)](',\x20')),_0x56ae6e[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&console['error']('\x20\x20Activations:\x20'+_0x56ae6e[_0x2028eb(0x102)](',\x20')),0x0;}}
|