@treasuredata/tdx 2026.3.18 β 2026.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x25e1d1=a34_0x1b84;(function(_0x2dc335,_0xcfa7e7){const _0x39a728=a34_0x1b84,_0x2d4918=_0x2dc335();while(!![]){try{const _0x1e723f=parseInt(_0x39a728(0x193))/0x1+parseInt(_0x39a728(0x122))/0x2*(parseInt(_0x39a728(0x14b))/0x3)+parseInt(_0x39a728(0x192))/0x4*(parseInt(_0x39a728(0x164))/0x5)+parseInt(_0x39a728(0x17d))/0x6+-parseInt(_0x39a728(0x120))/0x7+-parseInt(_0x39a728(0x10f))/0x8*(parseInt(_0x39a728(0x169))/0x9)+-parseInt(_0x39a728(0x13f))/0xa;if(_0x1e723f===_0xcfa7e7)break;else _0x2d4918['push'](_0x2d4918['shift']());}catch(_0x40351c){_0x2d4918['push'](_0x2d4918['shift']());}}}(a34_0x273d,0x70cef));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x1b84(_0xc17d5,_0x3b039d){_0xc17d5=_0xc17d5-0x10d;const _0x273dde=a34_0x273d();let _0x1b8495=_0x273dde[_0xc17d5];return _0x1b8495;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x3bc83c from'chalk';function formatRelativeTime(_0x4046b0){const _0x63bc34=a34_0x1b84,_0x10f5c9=new Date(_0x4046b0),_0x220d95=new Date(),_0x4e664c=_0x10f5c9[_0x63bc34(0x16f)]()-_0x220d95['getTime'](),_0x4fde44=Math[_0x63bc34(0x12e)](_0x4e664c)/0x3e8,_0x16ab2e=_0x4e664c<0x0;if(_0x4fde44<0x3c)return _0x16ab2e?_0x63bc34(0x162):'soon';else{if(_0x4fde44<0xe10){const _0x472502=Math[_0x63bc34(0x12c)](_0x4fde44/0x3c);return _0x16ab2e?_0x472502+_0x63bc34(0x176):_0x63bc34(0x121)+_0x472502+'m';}else{if(_0x4fde44<0x15180){const _0x58af5c=Math['round'](_0x4fde44/0xe10);return _0x16ab2e?_0x58af5c+_0x63bc34(0x14f):'in\x20'+_0x58af5c+'h';}else{if(_0x4fde44<0x93a80){const _0x439cfb=Math[_0x63bc34(0x12c)](_0x4fde44/0x15180);return _0x16ab2e?_0x439cfb+_0x63bc34(0x115):'in\x20'+_0x439cfb+'d';}else return _0x10f5c9[_0x63bc34(0x117)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x19d);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x15e);async[a34_0x25e1d1(0x16d)](_0x1e039b){const _0x159f83=a34_0x25e1d1,{options:_0x30b8a7,args:_0x3995ed,tdx:_0x12bd1e}=_0x1e039b,_0x985f08=resolveLimit(_0x30b8a7['limit'],DEFAULT_DISPLAY_LIMIT),_0x117b4b=_0x3995ed[0x0],_0x53303c=_0x117b4b?_0x159f83(0x174)+_0x117b4b+_0x159f83(0x158):_0x159f83(0x11a),_0x42b5af=await withSpinner(_0x53303c,()=>_0x12bd1e['schedules'][_0x159f83(0x18e)]({'limit':_0x985f08,'scheduled':!![],'pattern':_0x117b4b}),{'verbose':_0x30b8a7[_0x159f83(0x154)]}),_0x55058d=_0x42b5af['data'][_0x159f83(0x134)],_0x2f1919=_0x42b5af['data'][_0x159f83(0x179)][_0x159f83(0x199)],_0x332063=_0x117b4b?_0x159f83(0x14c)+_0x117b4b+'\x22':'';_0x2f1919?console[_0x159f83(0x171)](_0x159f83(0x127)+_0x55058d[_0x159f83(0x182)]+'\x20schedules'+_0x332063+_0x159f83(0x16c)):console[_0x159f83(0x171)](_0x159f83(0x118)+_0x55058d[_0x159f83(0x182)]+_0x159f83(0x15d)+(_0x55058d[_0x159f83(0x182)]!==0x1?_0x159f83(0x144):'y')+_0x332063);if(_0x30b8a7['format']===_0x159f83(0x123)||_0x30b8a7[_0x159f83(0x12f)]===_0x159f83(0x18c)||_0x30b8a7['format']===_0x159f83(0x183)||_0x30b8a7[_0x159f83(0x12f)]==='tsv'){const _0x537e52=_0x55058d[_0x159f83(0x16b)](_0x52abed=>({'id':_0x52abed['id'],'name':_0x52abed['name'],'cron':_0x52abed[_0x159f83(0x11e)],'database':_0x52abed['database']?.[_0x159f83(0x15c)],'type':_0x52abed[_0x159f83(0x19c)],'timezone':_0x52abed[_0x159f83(0x17a)],'user_name':_0x52abed[_0x159f83(0x17b)]?.['name'],'updated_at':_0x52abed['updated_at'],'next_run_at':_0x52abed[_0x159f83(0x18a)],'last_job_status':_0x52abed[_0x159f83(0x116)]?.[_0x159f83(0x124)]}));await handleSDKOutput(_0x537e52,_0x30b8a7);}else{if(_0x55058d['length']===0x0)console[_0x159f83(0x140)](_0x159f83(0x14a));else{const _0x2124d4=_0x30b8a7['site'],_0x593e9f=_0x55058d['map'](_0x30fd74=>{const _0x49a543=_0x159f83,_0x969e61=_0x30fd74[_0x49a543(0x116)]?.['status']?_0x30fd74['last_job']['status']==='success'?'β':'β':'-',_0x4fe268=_0x30fd74['last_job']?.[_0x49a543(0x148)]?formatRelativeTime(_0x30fd74['last_job'][_0x49a543(0x148)]):'never',_0x2b4c7b=_0x30fd74[_0x49a543(0x18a)]?formatRelativeTime(_0x30fd74[_0x49a543(0x18a)]):'-',_0x2d9204=_0x30fd74['cron']||'',_0x36a562=_0x30fd74[_0x49a543(0x15c)]||_0x49a543(0x198),_0x40f941=getConsoleUrl(_0x2124d4,_0x49a543(0x110)+_0x30fd74['id']);return{'statusIcon':_0x969e61,'lastRun':_0x4fe268,'nextRun':_0x2b4c7b,'cron':_0x2d9204,'name':_0x36a562,'queryUrl':_0x40f941,'status':_0x30fd74[_0x49a543(0x116)]?.[_0x49a543(0x124)]};}),_0xfdc602=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x52d6b9=>_0x52d6b9['lastRun']['length'])),_0x3cd33c=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x2af7ac=>_0x2af7ac['nextRun'][_0x159f83(0x182)])),_0x1e8bba=Math[_0x159f83(0x130)](..._0x593e9f['map'](_0x559f0b=>_0x559f0b[_0x159f83(0x11e)]['length'])),_0x2e300f=_0x593e9f[_0x159f83(0x16b)](_0x364cf5=>{const _0x2c79c8=_0x159f83,_0x53f663=_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x15b)?a34_0x3bc83c[_0x2c79c8(0x114)](_0x364cf5['statusIcon']):_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x171)?a34_0x3bc83c[_0x2c79c8(0x194)](_0x364cf5[_0x2c79c8(0x155)]):a34_0x3bc83c[_0x2c79c8(0x135)](_0x364cf5[_0x2c79c8(0x155)]),_0x53ae25=_0x364cf5['lastRun']['padEnd'](_0xfdc602),_0x901ef7=_0x364cf5[_0x2c79c8(0x137)][_0x2c79c8(0x186)](_0x3cd33c),_0x59247e=_0x364cf5[_0x2c79c8(0x11e)]?a34_0x3bc83c[_0x2c79c8(0x18b)](_0x364cf5[_0x2c79c8(0x11e)][_0x2c79c8(0x186)](_0x1e8bba)):'\x20'['repeat'](_0x1e8bba),_0xd697c3=hyperlink(_0x364cf5[_0x2c79c8(0x15c)],_0x364cf5[_0x2c79c8(0x147)]);return'π
\x20'+_0x53f663+'\x20'+_0x53ae25+'\x20\x20β\x20'+_0x901ef7+'\x20\x20'+_0x59247e+'\x20\x20'+_0xd697c3;});await writeOutput(_0x2e300f[_0x159f83(0x161)]('\x0a'),_0x30b8a7[_0x159f83(0x12a)],_0x159f83(0x172));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x25e1d1(0x159);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x143);[a34_0x25e1d1(0x19f)](_0xf551e1){const _0x345e5a=a34_0x25e1d1,_0x97b142=_0xf551e1[_0x345e5a(0x14d)][0x0];if(!_0x97b142)return _0x345e5a(0x17e);return undefined;}async['execute'](_0x1edeee){const _0x3097f9=a34_0x25e1d1,{options:_0x362f96,args:_0x225fbd,tdx:_0x12152f}=_0x1edeee,_0x3ed755=_0x225fbd[0x0],_0x441d8a=await withSpinner('Getting\x20schedule\x20details...',()=>_0x12152f[_0x3097f9(0x10d)][_0x3097f9(0x13b)](_0x3ed755),{'verbose':_0x362f96['verbose']}),_0x3062e1=_0x441d8a[_0x3097f9(0x185)],_0x2605fc={'name':_0x3062e1['name'],'cron':_0x3062e1['cron'],'database':_0x3062e1[_0x3097f9(0x160)],'type':_0x3062e1[_0x3097f9(0x19c)],'timezone':_0x3062e1[_0x3097f9(0x19b)],'user_name':_0x3062e1['user_name'],'created_at':_0x3062e1['created_at'],'engine_version':_0x3062e1[_0x3097f9(0x11f)],'executing_user_id':_0x3062e1['executing_user_id'],'query':_0x3062e1[_0x3097f9(0x157)],'delay':_0x3062e1[_0x3097f9(0x142)],'priority':_0x3062e1['priority'],'retry_limit':_0x3062e1['retry_limit'],..._0x3062e1[_0x3097f9(0x190)]&&{'result':_0x3062e1['result']}};return await handleSingleObjectOutput(_0x2605fc,_0x362f96),0x0;}}function a34_0x273d(){const _0x4b4c28=['green','d\x20ago','last_job','toLocaleDateString','Found\x20','...','Listing\x20scheduled\x20queries...','Creating\x20schedule...','run','Create\x20a\x20scheduled\x20query','cron','engine_version','1529787evGMXH','in\x20','130362yNxwVz','json','status','Schedule\x20deleted:\x20','Failed\x20to\x20read\x20file:\x20','Showing\x20first\x20','entries','utf-8','output','delete','round','\x20created','abs','format','max','INVALID_ARGUMENT','trino','priority','queries','dim','\x20\x20Cron:\x20','nextRun','schedule:update','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','options','show','schedule:run','time','Updating\x20schedule:\x20','466930kQiwGs','log','keys','delay','Show\x20schedule\x20details','ies','create','\x20\x20Timezone:\x20','queryUrl','ended_at','Cancelled','No\x20scheduled\x20queries\x20found','15aYbAVL','\x20matching\x20\x22','args','schedule:create','h\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','num','retry_limit','\x20\x20Database:\x20','verbose','statusIcon','Deleting\x20schedule...','query','\x22...','schedule:show','\x20\x20Job\x20ID:\x20','success','name','\x20scheduled\x20quer','List\x20scheduled\x20queries','from','database','join','just\x20now','\x20\x20Type:\x20','428015xyuJdn','Delete\x20a\x20scheduled\x20query','Updating\x20schedule...','start_at','engineVersion','82449UaniDp','description','map','\x20(use\x20--limit\x20to\x20see\x20more)','execute','\x20job','getTime','Getting\x20schedule\x20history...','error','list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Searching\x20scheduled\x20queries\x20matching\x20\x22','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','m\x20ago','retryLimit','history','pagination','time_zone','user','\x20\x20Num:\x20','846162hURoum','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Schedule\x20created:\x20','Creating\x20schedule:\x20','length','table','job_id','data','padEnd','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Update\x20a\x20scheduled\x20query','Schedule\x20updated:\x20','next_run_at','cyan','jsonl','update','listQueries','count','result','Run\x20a\x20scheduled\x20query\x20immediately','24hDUxze','58221iUIlgn','red','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','file','\x20(showing\x20','(unnamed)','has_next_page','end_at','timezone','type','schedule:list','trim','validate','schedules','schedule:history','272durldU','/app/queries/editor?queryId=','jobs','Schedule\x20run\x20submitted:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]'];a34_0x273d=function(){return _0x4b4c28;};return a34_0x273d();}export class ScheduleCreateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x14e);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x11d);['validate'](_0x287cdb){const _0x173c13=a34_0x25e1d1,_0x520954=_0x287cdb['args'][0x0];if(!_0x520954)return _0x173c13(0x113);const _0x26568f=_0x287cdb[_0x173c13(0x13a)];if(!_0x26568f['database'])return _0x173c13(0x187);return undefined;}async['execute'](_0x587f62){const _0x338004=a34_0x25e1d1,{options:_0x5cf415,args:_0xf24e99,tdx:_0x48c1fa}=_0x587f62,_0x2012a1=_0xf24e99[0x0],_0x1913f7=_0x5cf415,_0x17d505=_0x1913f7[_0x338004(0x160)],_0x1249d9=_0x1913f7[_0x338004(0x196)],_0x40d503=_0x1913f7['type']||_0x338004(0x132);let _0x4127c7;try{_0x4127c7=readFileSync(_0x1249d9,_0x338004(0x129))[_0x338004(0x19e)]();}catch(_0x327e04){throw new SDKError(ErrorCode[_0x338004(0x131)],_0x338004(0x126)+_0x1249d9,_0x327e04 instanceof Error?_0x327e04:undefined);}if(!_0x4127c7)throw new SDKError(ErrorCode[_0x338004(0x131)],'Query\x20file\x20is\x20empty');const _0x4b3a70={'database':_0x17d505,'query':_0x4127c7,'type':_0x40d503};if(_0x1913f7[_0x338004(0x11e)])_0x4b3a70[_0x338004(0x11e)]=_0x1913f7[_0x338004(0x11e)];if(_0x1913f7[_0x338004(0x19b)])_0x4b3a70[_0x338004(0x19b)]=_0x1913f7['timezone'];if(_0x1913f7['delay']!==undefined)_0x4b3a70[_0x338004(0x142)]=Number(_0x1913f7['delay']);if(_0x1913f7[_0x338004(0x133)]!==undefined)_0x4b3a70[_0x338004(0x133)]=Number(_0x1913f7['priority']);if(_0x1913f7[_0x338004(0x177)]!==undefined)_0x4b3a70[_0x338004(0x152)]=Number(_0x1913f7[_0x338004(0x177)]);if(_0x1913f7[_0x338004(0x168)])_0x4b3a70[_0x338004(0x11f)]=_0x1913f7[_0x338004(0x168)];if(_0x1913f7['result'])_0x4b3a70[_0x338004(0x190)]=_0x1913f7['result'];if(_0x5cf415['verbose']){console['error'](_0x338004(0x181)+_0x2012a1),console[_0x338004(0x171)](_0x338004(0x153)+_0x17d505),console['error'](_0x338004(0x163)+_0x40d503);if(_0x4b3a70['cron'])console['error'](_0x338004(0x136)+_0x4b3a70[_0x338004(0x11e)]);if(_0x4b3a70[_0x338004(0x19b)])console[_0x338004(0x171)](_0x338004(0x146)+_0x4b3a70['timezone']);}const _0x3171bf=await withSpinner(_0x338004(0x11b),()=>_0x48c1fa[_0x338004(0x10d)][_0x338004(0x145)](_0x2012a1,_0x4b3a70),{'verbose':_0x5cf415[_0x338004(0x154)]});return console[_0x338004(0x171)](_0x338004(0x180)+_0x3171bf[_0x338004(0x185)][_0x338004(0x15c)]),await handleSingleObjectOutput(_0x3171bf[_0x338004(0x185)],_0x5cf415),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x138);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x188);['validate'](_0x48c0e4){const _0x3d8fe6=a34_0x25e1d1,_0x126cf2=_0x48c0e4[_0x3d8fe6(0x14d)][0x0];if(!_0x126cf2)return _0x3d8fe6(0x17f);return undefined;}async[a34_0x25e1d1(0x16d)](_0x2acbae){const _0x62d120=a34_0x25e1d1,{options:_0x181255,args:_0xbe3c80,tdx:_0x1a3deb}=_0x2acbae,_0x4c26b3=_0xbe3c80[0x0],_0x397a16=_0x181255,_0x1372a2={};if(_0x397a16['database'])_0x1372a2['database']=_0x397a16[_0x62d120(0x160)];if(_0x397a16['type'])_0x1372a2[_0x62d120(0x19c)]=_0x397a16[_0x62d120(0x19c)];if(_0x397a16[_0x62d120(0x11e)])_0x1372a2[_0x62d120(0x11e)]=_0x397a16[_0x62d120(0x11e)];if(_0x397a16[_0x62d120(0x19b)])_0x1372a2[_0x62d120(0x19b)]=_0x397a16[_0x62d120(0x19b)];if(_0x397a16[_0x62d120(0x142)]!==undefined)_0x1372a2[_0x62d120(0x142)]=Number(_0x397a16[_0x62d120(0x142)]);if(_0x397a16[_0x62d120(0x133)]!==undefined)_0x1372a2['priority']=Number(_0x397a16[_0x62d120(0x133)]);if(_0x397a16['retryLimit']!==undefined)_0x1372a2[_0x62d120(0x152)]=Number(_0x397a16['retryLimit']);if(_0x397a16[_0x62d120(0x168)])_0x1372a2[_0x62d120(0x11f)]=_0x397a16[_0x62d120(0x168)];if(_0x397a16[_0x62d120(0x190)])_0x1372a2['result']=_0x397a16[_0x62d120(0x190)];if(_0x397a16[_0x62d120(0x196)])try{_0x1372a2[_0x62d120(0x157)]=readFileSync(_0x397a16[_0x62d120(0x196)],_0x62d120(0x129))['trim']();}catch(_0x2f6094){throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x126)+_0x397a16[_0x62d120(0x196)],_0x2f6094 instanceof Error?_0x2f6094:undefined);}if(Object[_0x62d120(0x141)](_0x1372a2)[_0x62d120(0x182)]===0x0)throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x175));if(_0x181255['verbose']){console[_0x62d120(0x171)](_0x62d120(0x13e)+_0x4c26b3);for(const [_0x38f8ca,_0x4c0f80]of Object[_0x62d120(0x128)](_0x1372a2)){_0x38f8ca===_0x62d120(0x157)?console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80['substring'](0x0,0x32)+_0x62d120(0x119)):console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80);}}const _0x1d71bd=await withSpinner(_0x62d120(0x166),()=>_0x1a3deb[_0x62d120(0x10d)][_0x62d120(0x18d)](_0x4c26b3,_0x1372a2),{'verbose':_0x181255[_0x62d120(0x154)]});return console[_0x62d120(0x171)](_0x62d120(0x189)+_0x1d71bd[_0x62d120(0x185)][_0x62d120(0x15c)]),await handleSingleObjectOutput(_0x1d71bd[_0x62d120(0x185)],_0x181255),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]='schedule:delete';[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x165);['validate'](_0x1be25b){const _0x255b0a=a34_0x25e1d1,_0x57a308=_0x1be25b[_0x255b0a(0x14d)][0x0];if(!_0x57a308)return _0x255b0a(0x173);return undefined;}async['execute'](_0x134855){const _0x211f17=a34_0x25e1d1,{options:_0x45fd2b,args:_0x469ced,tdx:_0x38e63f}=_0x134855,_0x2e23b2=_0x469ced[0x0];if(!_0x45fd2b['yes']){const _0x157c71=await confirm(_0x211f17(0x139)+_0x2e23b2+'\x22?');if(!_0x157c71)return console[_0x211f17(0x171)](_0x211f17(0x149)),0x0;}const _0x5670e0=await withSpinner(_0x211f17(0x156),()=>_0x38e63f[_0x211f17(0x10d)][_0x211f17(0x12b)](_0x2e23b2),{'verbose':_0x45fd2b[_0x211f17(0x154)]});return console[_0x211f17(0x171)](_0x211f17(0x125)+_0x5670e0[_0x211f17(0x185)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x13c);['description']=a34_0x25e1d1(0x191);[a34_0x25e1d1(0x19f)](_0x4055e1){const _0x2803e9=a34_0x25e1d1,_0x502d13=_0x4055e1[_0x2803e9(0x14d)][0x0];if(!_0x502d13)return _0x2803e9(0x150);return undefined;}async[a34_0x25e1d1(0x16d)](_0x5b420e){const _0xd9f054=a34_0x25e1d1,{options:_0x307897,args:_0x2a15c2,tdx:_0xcc737}=_0x5b420e,_0x3b9ab0=_0x2a15c2[0x0],_0x128e8c=_0x307897,_0x3a3ff3=_0x128e8c[_0xd9f054(0x13d)],_0x1f3b03=_0x128e8c['num']!==undefined?Number(_0x128e8c[_0xd9f054(0x151)]):undefined;if(_0x307897['verbose']){console[_0xd9f054(0x171)]('Running\x20schedule:\x20'+_0x3b9ab0);if(_0x3a3ff3)console['error']('\x20\x20Time:\x20'+_0x3a3ff3);if(_0x1f3b03)console[_0xd9f054(0x171)](_0xd9f054(0x17c)+_0x1f3b03);}const _0x491cb9=await withSpinner('Running\x20schedule...',()=>_0xcc737[_0xd9f054(0x10d)][_0xd9f054(0x11c)](_0x3b9ab0,{'time':_0x3a3ff3,'num':_0x1f3b03}),{'verbose':_0x307897[_0xd9f054(0x154)]}),_0x4a1635=_0x491cb9['data'][_0xd9f054(0x111)];console['error'](_0xd9f054(0x112)+_0x4a1635[_0xd9f054(0x182)]+_0xd9f054(0x16e)+(_0x4a1635[_0xd9f054(0x182)]!==0x1?'s':'')+_0xd9f054(0x12d));for(const _0x5417ae of _0x4a1635){console[_0xd9f054(0x171)](_0xd9f054(0x15a)+_0x5417ae[_0xd9f054(0x184)]);}return await handleSDKOutput(_0x4a1635,_0x307897),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x10e);[a34_0x25e1d1(0x16a)]='Show\x20schedule\x20execution\x20history';[a34_0x25e1d1(0x19f)](_0x18b4b9){const _0x3d6ab8=a34_0x25e1d1,_0x131698=_0x18b4b9[_0x3d6ab8(0x14d)][0x0];if(!_0x131698)return _0x3d6ab8(0x195);return undefined;}async[a34_0x25e1d1(0x16d)](_0xfd1fe8){const _0x593008=a34_0x25e1d1,{options:_0x4913aa,args:_0x502639,tdx:_0x47a0b0}=_0xfd1fe8,_0x484158=_0x502639[0x0],_0x53d000=_0x4913aa,_0x142c21=_0x53d000[_0x593008(0x15f)]!==undefined?Number(_0x53d000[_0x593008(0x15f)]):undefined,_0x58e717=_0x53d000['to']!==undefined?Number(_0x53d000['to']):undefined,_0x22d0be=await withSpinner(_0x593008(0x170),()=>_0x47a0b0[_0x593008(0x10d)][_0x593008(0x178)](_0x484158,{'from':_0x142c21,'to':_0x58e717}),{'verbose':_0x4913aa[_0x593008(0x154)]}),_0x412eaa=_0x22d0be[_0x593008(0x185)];console[_0x593008(0x171)]('Found\x20'+_0x412eaa[_0x593008(0x18f)]+'\x20execution'+(_0x412eaa[_0x593008(0x18f)]!==0x1?'s':'')+_0x593008(0x197)+_0x412eaa[_0x593008(0x15f)]+'-'+_0x412eaa['to']+')');const _0x16bd74=_0x412eaa['history'][_0x593008(0x16b)](_0x262f92=>({'job_id':_0x262f92[_0x593008(0x184)],'type':_0x262f92[_0x593008(0x19c)],'status':_0x262f92[_0x593008(0x124)],'scheduled_at':_0x262f92['scheduled_at'],'created_at':_0x262f92['created_at'],'start_at':_0x262f92[_0x593008(0x167)],'end_at':_0x262f92[_0x593008(0x19a)]}));return await handleSDKOutput(_0x16bd74,_0x4913aa),0x0;}}
|
|
1
|
+
const a34_0x2ac242=a34_0x48bd;(function(_0x327821,_0x2f8a50){const _0x34b438=a34_0x48bd,_0x265d33=_0x327821();while(!![]){try{const _0x142bb4=-parseInt(_0x34b438(0x1cc))/0x1+-parseInt(_0x34b438(0x214))/0x2*(parseInt(_0x34b438(0x220))/0x3)+parseInt(_0x34b438(0x1d7))/0x4+parseInt(_0x34b438(0x1c7))/0x5+parseInt(_0x34b438(0x1e1))/0x6+parseInt(_0x34b438(0x1c9))/0x7+-parseInt(_0x34b438(0x1a7))/0x8;if(_0x142bb4===_0x2f8a50)break;else _0x265d33['push'](_0x265d33['shift']());}catch(_0x43f40a){_0x265d33['push'](_0x265d33['shift']());}}}(a34_0x89ec,0xc2175));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x89ec(){const _0x1bc654=['data','round','error','time','start_at','join','1421520KlvvkV','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','site','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','limit','\x20execution','output','Deleting\x20schedule...','Update\x20a\x20scheduled\x20query','run','\x20created','schedule:update','time_zone','jsonl','list','d\x20ago','Schedule\x20updated:\x20','\x22...','num','table','options','Running\x20schedule...','schedule:history','\x20\x20Database:\x20','scheduled_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','trino','pagination','repeat','/app/queries/editor?queryId=','Getting\x20schedule\x20history...','verbose','4792470CTjYnd','ies','657713XHywCg','Show\x20schedule\x20details','\x20\x20Type:\x20','1040228GhDCfx','keys','engineVersion','\x20\x20Num:\x20','\x20\x20Time:\x20','retryLimit','nextRun','\x20\x20β\x20','max','schedules','m\x20ago','4937264SVNpax','trim','length','jobs','delete','substring','args','user_name','created_at','yes','2466786jdAzeN','Create\x20a\x20scheduled\x20query','INVALID_ARGUMENT','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','status','tsv','update','timezone','validate','schedule:run','soon','count','\x20scheduled\x20quer','end_at','Found\x20','query','(unnamed)','No\x20scheduled\x20queries\x20found','\x20\x20Timezone:\x20','in\x20','Creating\x20schedule...','priority','database','Running\x20schedule:\x20','format','schedule:list','cyan','show','utf-8','\x20(showing\x20','Query\x20file\x20is\x20empty','retry_limit','last_job','delay','job_id','padEnd','listQueries','queryUrl','next_run_at','Run\x20a\x20scheduled\x20query\x20immediately','Updating\x20schedule...','cron','h\x20ago','log','schedule:delete','Failed\x20to\x20read\x20file:\x20','just\x20now','Updating\x20schedule:\x20','result','type','statusIcon','195710fyuDmE','json','Schedule\x20created:\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','entries','engine_version','name','Delete\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','map','updated_at','21DLylaD','\x20job','from','green','file','\x20(use\x20--limit\x20to\x20see\x20more)','\x20matching\x20\x22','execute','description','success','ended_at','create'];a34_0x89ec=function(){return _0x1bc654;};return a34_0x89ec();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a34_0x48bd(_0x595d9a,_0x109325){_0x595d9a=_0x595d9a-0x198;const _0x89ec85=a34_0x89ec();let _0x48bd30=_0x89ec85[_0x595d9a];return _0x48bd30;}import a34_0x2618e4 from'chalk';function formatRelativeTime(_0x36cbea){const _0x4a595b=a34_0x48bd,_0x1b6f19=new Date(_0x36cbea),_0x133dcd=new Date(),_0x52ac1=_0x1b6f19['getTime']()-_0x133dcd['getTime'](),_0xcc2d79=Math['abs'](_0x52ac1)/0x3e8,_0x4782e6=_0x52ac1<0x0;if(_0xcc2d79<0x3c)return _0x4782e6?_0x4a595b(0x20f):_0x4a595b(0x1eb);else{if(_0xcc2d79<0xe10){const _0x5ab377=Math['round'](_0xcc2d79/0x3c);return _0x4782e6?_0x5ab377+_0x4a595b(0x1d6):_0x4a595b(0x1f4)+_0x5ab377+'m';}else{if(_0xcc2d79<0x15180){const _0x569ce2=Math[_0x4a595b(0x1a2)](_0xcc2d79/0xe10);return _0x4782e6?_0x569ce2+_0x4a595b(0x20b):'in\x20'+_0x569ce2+'h';}else{if(_0xcc2d79<0x93a80){const _0x4f9d9a=Math[_0x4a595b(0x1a2)](_0xcc2d79/0x15180);return _0x4782e6?_0x4f9d9a+_0x4a595b(0x1b6):_0x4a595b(0x1f4)+_0x4f9d9a+'d';}else return _0x1b6f19['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x2ac242(0x21a)]=a34_0x2ac242(0x1fa);[a34_0x2ac242(0x19d)]='List\x20scheduled\x20queries';async[a34_0x2ac242(0x19c)](_0x3d6e79){const _0xebe6e6=a34_0x2ac242,{options:_0x483aef,args:_0x24751b,tdx:_0x4933b8}=_0x3d6e79,_0x4e90a8=resolveLimit(_0x483aef[_0xebe6e6(0x1ab)],DEFAULT_DISPLAY_LIMIT),_0x40c8aa=_0x24751b[0x0],_0x91cc3=_0x40c8aa?_0xebe6e6(0x217)+_0x40c8aa+_0xebe6e6(0x1b8):'Listing\x20scheduled\x20queries...',_0x16d84c=await withSpinner(_0x91cc3,()=>_0x4933b8[_0xebe6e6(0x1d5)][_0xebe6e6(0x205)]({'limit':_0x4e90a8,'scheduled':!![],'pattern':_0x40c8aa}),{'verbose':_0x483aef[_0xebe6e6(0x1c6)]}),_0x6262cd=_0x16d84c[_0xebe6e6(0x1a1)]['queries'],_0x42be10=_0x16d84c[_0xebe6e6(0x1a1)][_0xebe6e6(0x1c2)]['has_next_page'],_0x341bc1=_0x40c8aa?_0xebe6e6(0x19b)+_0x40c8aa+'\x22':'';_0x42be10?console[_0xebe6e6(0x1a3)]('Showing\x20first\x20'+_0x6262cd[_0xebe6e6(0x1d9)]+'\x20schedules'+_0x341bc1+_0xebe6e6(0x19a)):console[_0xebe6e6(0x1a3)](_0xebe6e6(0x1ef)+_0x6262cd[_0xebe6e6(0x1d9)]+_0xebe6e6(0x1ed)+(_0x6262cd[_0xebe6e6(0x1d9)]!==0x1?_0xebe6e6(0x1c8):'y')+_0x341bc1);if(_0x483aef[_0xebe6e6(0x1f9)]===_0xebe6e6(0x215)||_0x483aef[_0xebe6e6(0x1f9)]===_0xebe6e6(0x1b4)||_0x483aef[_0xebe6e6(0x1f9)]===_0xebe6e6(0x1ba)||_0x483aef['format']===_0xebe6e6(0x1e6)){const _0x48716f=_0x6262cd[_0xebe6e6(0x21e)](_0x582475=>({'id':_0x582475['id'],'name':_0x582475[_0xebe6e6(0x21a)],'cron':_0x582475[_0xebe6e6(0x20a)],'database':_0x582475[_0xebe6e6(0x1f7)]?.[_0xebe6e6(0x21a)],'type':_0x582475['type'],'timezone':_0x582475[_0xebe6e6(0x1b3)],'user_name':_0x582475['user']?.[_0xebe6e6(0x21a)],'updated_at':_0x582475[_0xebe6e6(0x21f)],'next_run_at':_0x582475['next_run_at'],'last_job_status':_0x582475[_0xebe6e6(0x201)]?.[_0xebe6e6(0x1e5)]}));await handleSDKOutput(_0x48716f,_0x483aef);}else{if(_0x6262cd[_0xebe6e6(0x1d9)]===0x0)console[_0xebe6e6(0x20c)](_0xebe6e6(0x1f2));else{const _0x1600dc=_0x483aef[_0xebe6e6(0x1a9)],_0x2b6ff5=_0x6262cd[_0xebe6e6(0x21e)](_0x462f93=>{const _0x176881=_0xebe6e6,_0xcebd3e=_0x462f93['last_job']?.[_0x176881(0x1e5)]?_0x462f93[_0x176881(0x201)][_0x176881(0x1e5)]===_0x176881(0x19e)?'β':'β':'-',_0x17820e=_0x462f93['last_job']?.[_0x176881(0x19f)]?formatRelativeTime(_0x462f93['last_job']['ended_at']):'never',_0x43a564=_0x462f93['next_run_at']?formatRelativeTime(_0x462f93[_0x176881(0x207)]):'-',_0x15327f=_0x462f93['cron']||'',_0x3174c1=_0x462f93[_0x176881(0x21a)]||_0x176881(0x1f1),_0x4bc250=getConsoleUrl(_0x1600dc,_0x176881(0x1c4)+_0x462f93['id']);return{'statusIcon':_0xcebd3e,'lastRun':_0x17820e,'nextRun':_0x43a564,'cron':_0x15327f,'name':_0x3174c1,'queryUrl':_0x4bc250,'status':_0x462f93[_0x176881(0x201)]?.[_0x176881(0x1e5)]};}),_0x50398f=Math[_0xebe6e6(0x1d4)](..._0x2b6ff5[_0xebe6e6(0x21e)](_0x5a5723=>_0x5a5723['lastRun']['length'])),_0x47207b=Math[_0xebe6e6(0x1d4)](..._0x2b6ff5[_0xebe6e6(0x21e)](_0x9b5d04=>_0x9b5d04[_0xebe6e6(0x1d2)][_0xebe6e6(0x1d9)])),_0x49ebd6=Math[_0xebe6e6(0x1d4)](..._0x2b6ff5[_0xebe6e6(0x21e)](_0x20e232=>_0x20e232['cron'][_0xebe6e6(0x1d9)])),_0x8e18e4=_0x2b6ff5['map'](_0xbe0982=>{const _0x2e72a2=_0xebe6e6,_0x4ef9e2=_0xbe0982[_0x2e72a2(0x1e5)]===_0x2e72a2(0x19e)?a34_0x2618e4[_0x2e72a2(0x198)](_0xbe0982[_0x2e72a2(0x213)]):_0xbe0982[_0x2e72a2(0x1e5)]===_0x2e72a2(0x1a3)?a34_0x2618e4['red'](_0xbe0982[_0x2e72a2(0x213)]):a34_0x2618e4['dim'](_0xbe0982[_0x2e72a2(0x213)]),_0x56d060=_0xbe0982['lastRun'][_0x2e72a2(0x204)](_0x50398f),_0x21c453=_0xbe0982[_0x2e72a2(0x1d2)][_0x2e72a2(0x204)](_0x47207b),_0x3bf8b1=_0xbe0982[_0x2e72a2(0x20a)]?a34_0x2618e4[_0x2e72a2(0x1fb)](_0xbe0982['cron'][_0x2e72a2(0x204)](_0x49ebd6)):'\x20'[_0x2e72a2(0x1c3)](_0x49ebd6),_0x15690e=hyperlink(_0xbe0982[_0x2e72a2(0x21a)],_0xbe0982[_0x2e72a2(0x206)]);return'π
\x20'+_0x4ef9e2+'\x20'+_0x56d060+_0x2e72a2(0x1d3)+_0x21c453+'\x20\x20'+_0x3bf8b1+'\x20\x20'+_0x15690e;});await writeOutput(_0x8e18e4[_0xebe6e6(0x1a6)]('\x0a'),_0x483aef[_0xebe6e6(0x1ad)],_0xebe6e6(0x1b5));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x2ac242(0x21a)]='schedule:show';[a34_0x2ac242(0x19d)]=a34_0x2ac242(0x1ca);[a34_0x2ac242(0x1e9)](_0x3f9cb5){const _0x490496=_0x3f9cb5['args'][0x0];if(!_0x490496)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a34_0x2ac242(0x19c)](_0x6cce31){const _0x4a4bd6=a34_0x2ac242,{options:_0x416585,args:_0x22b0f3,tdx:_0x21c21c}=_0x6cce31,_0x2faa04=_0x22b0f3[0x0],_0xdc2abe=await withSpinner('Getting\x20schedule\x20details...',()=>_0x21c21c[_0x4a4bd6(0x1d5)][_0x4a4bd6(0x1fc)](_0x2faa04),{'verbose':_0x416585[_0x4a4bd6(0x1c6)]}),_0xb873df=_0xdc2abe[_0x4a4bd6(0x1a1)],_0x28590b={'name':_0xb873df[_0x4a4bd6(0x21a)],'cron':_0xb873df[_0x4a4bd6(0x20a)],'database':_0xb873df[_0x4a4bd6(0x1f7)],'type':_0xb873df['type'],'timezone':_0xb873df[_0x4a4bd6(0x1e8)],'user_name':_0xb873df[_0x4a4bd6(0x1de)],'created_at':_0xb873df[_0x4a4bd6(0x1df)],'engine_version':_0xb873df[_0x4a4bd6(0x219)],'executing_user_id':_0xb873df['executing_user_id'],'query':_0xb873df['query'],'delay':_0xb873df[_0x4a4bd6(0x202)],'priority':_0xb873df['priority'],'retry_limit':_0xb873df[_0x4a4bd6(0x200)],..._0xb873df[_0x4a4bd6(0x211)]&&{'result':_0xb873df[_0x4a4bd6(0x211)]}};return await handleSingleObjectOutput(_0x28590b,_0x416585),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x2ac242(0x21a)]='schedule:create';[a34_0x2ac242(0x19d)]=a34_0x2ac242(0x1e2);[a34_0x2ac242(0x1e9)](_0x4bcea0){const _0x5c34c8=a34_0x2ac242,_0x2548e3=_0x4bcea0['args'][0x0];if(!_0x2548e3)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0xee01d8=_0x4bcea0[_0x5c34c8(0x1bb)];if(!_0xee01d8[_0x5c34c8(0x1f7)])return _0x5c34c8(0x21d);return undefined;}async[a34_0x2ac242(0x19c)](_0x142dd8){const _0x20db05=a34_0x2ac242,{options:_0x39e10e,args:_0xc6cc89,tdx:_0x470ace}=_0x142dd8,_0x545451=_0xc6cc89[0x0],_0x56bab8=_0x39e10e,_0x54272d=_0x56bab8[_0x20db05(0x1f7)],_0x30b7b7=_0x56bab8[_0x20db05(0x199)],_0x58488a=_0x56bab8[_0x20db05(0x212)]||_0x20db05(0x1c1);let _0x3cd0cb;try{_0x3cd0cb=readFileSync(_0x30b7b7,_0x20db05(0x1fd))['trim']();}catch(_0x126b7b){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x30b7b7,_0x126b7b instanceof Error?_0x126b7b:undefined);}if(!_0x3cd0cb)throw new SDKError(ErrorCode[_0x20db05(0x1e3)],_0x20db05(0x1ff));const _0x25b9e5={'database':_0x54272d,'query':_0x3cd0cb,'type':_0x58488a};if(_0x56bab8[_0x20db05(0x20a)])_0x25b9e5[_0x20db05(0x20a)]=_0x56bab8[_0x20db05(0x20a)];if(_0x56bab8[_0x20db05(0x1e8)])_0x25b9e5[_0x20db05(0x1e8)]=_0x56bab8[_0x20db05(0x1e8)];if(_0x56bab8[_0x20db05(0x202)]!==undefined)_0x25b9e5[_0x20db05(0x202)]=Number(_0x56bab8[_0x20db05(0x202)]);if(_0x56bab8['priority']!==undefined)_0x25b9e5[_0x20db05(0x1f6)]=Number(_0x56bab8[_0x20db05(0x1f6)]);if(_0x56bab8[_0x20db05(0x1d1)]!==undefined)_0x25b9e5[_0x20db05(0x200)]=Number(_0x56bab8['retryLimit']);if(_0x56bab8['engineVersion'])_0x25b9e5[_0x20db05(0x219)]=_0x56bab8['engineVersion'];if(_0x56bab8['result'])_0x25b9e5['result']=_0x56bab8['result'];if(_0x39e10e[_0x20db05(0x1c6)]){console[_0x20db05(0x1a3)](_0x20db05(0x21c)+_0x545451),console[_0x20db05(0x1a3)](_0x20db05(0x1be)+_0x54272d),console[_0x20db05(0x1a3)](_0x20db05(0x1cb)+_0x58488a);if(_0x25b9e5['cron'])console[_0x20db05(0x1a3)]('\x20\x20Cron:\x20'+_0x25b9e5[_0x20db05(0x20a)]);if(_0x25b9e5[_0x20db05(0x1e8)])console[_0x20db05(0x1a3)](_0x20db05(0x1f3)+_0x25b9e5[_0x20db05(0x1e8)]);}const _0x54135f=await withSpinner(_0x20db05(0x1f5),()=>_0x470ace[_0x20db05(0x1d5)][_0x20db05(0x1a0)](_0x545451,_0x25b9e5),{'verbose':_0x39e10e[_0x20db05(0x1c6)]});return console[_0x20db05(0x1a3)](_0x20db05(0x216)+_0x54135f[_0x20db05(0x1a1)]['name']),await handleSingleObjectOutput(_0x54135f[_0x20db05(0x1a1)],_0x39e10e),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a34_0x2ac242(0x1b2);[a34_0x2ac242(0x19d)]=a34_0x2ac242(0x1af);[a34_0x2ac242(0x1e9)](_0x55b7a1){const _0x5aae91=a34_0x2ac242,_0x23355b=_0x55b7a1[_0x5aae91(0x1dd)][0x0];if(!_0x23355b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a34_0x2ac242(0x19c)](_0xdddfad){const _0x314dcc=a34_0x2ac242,{options:_0x29aa6a,args:_0x25e6e3,tdx:_0x59058e}=_0xdddfad,_0x5d5838=_0x25e6e3[0x0],_0xf540e2=_0x29aa6a,_0x217254={};if(_0xf540e2['database'])_0x217254[_0x314dcc(0x1f7)]=_0xf540e2[_0x314dcc(0x1f7)];if(_0xf540e2[_0x314dcc(0x212)])_0x217254['type']=_0xf540e2['type'];if(_0xf540e2[_0x314dcc(0x20a)])_0x217254['cron']=_0xf540e2['cron'];if(_0xf540e2[_0x314dcc(0x1e8)])_0x217254[_0x314dcc(0x1e8)]=_0xf540e2['timezone'];if(_0xf540e2[_0x314dcc(0x202)]!==undefined)_0x217254[_0x314dcc(0x202)]=Number(_0xf540e2[_0x314dcc(0x202)]);if(_0xf540e2[_0x314dcc(0x1f6)]!==undefined)_0x217254[_0x314dcc(0x1f6)]=Number(_0xf540e2['priority']);if(_0xf540e2['retryLimit']!==undefined)_0x217254[_0x314dcc(0x200)]=Number(_0xf540e2[_0x314dcc(0x1d1)]);if(_0xf540e2[_0x314dcc(0x1ce)])_0x217254[_0x314dcc(0x219)]=_0xf540e2[_0x314dcc(0x1ce)];if(_0xf540e2[_0x314dcc(0x211)])_0x217254['result']=_0xf540e2[_0x314dcc(0x211)];if(_0xf540e2[_0x314dcc(0x199)])try{_0x217254[_0x314dcc(0x1f0)]=readFileSync(_0xf540e2[_0x314dcc(0x199)],_0x314dcc(0x1fd))[_0x314dcc(0x1d8)]();}catch(_0xc26d1d){throw new SDKError(ErrorCode[_0x314dcc(0x1e3)],_0x314dcc(0x20e)+_0xf540e2[_0x314dcc(0x199)],_0xc26d1d instanceof Error?_0xc26d1d:undefined);}if(Object[_0x314dcc(0x1cd)](_0x217254)[_0x314dcc(0x1d9)]===0x0)throw new SDKError(ErrorCode[_0x314dcc(0x1e3)],_0x314dcc(0x1aa));if(_0x29aa6a['verbose']){console['error'](_0x314dcc(0x210)+_0x5d5838);for(const [_0x3c0639,_0x32cc76]of Object[_0x314dcc(0x218)](_0x217254)){_0x3c0639==='query'?console[_0x314dcc(0x1a3)]('\x20\x20'+_0x3c0639+':\x20'+_0x32cc76[_0x314dcc(0x1dc)](0x0,0x32)+'...'):console[_0x314dcc(0x1a3)]('\x20\x20'+_0x3c0639+':\x20'+_0x32cc76);}}const _0x5a7b23=await withSpinner(_0x314dcc(0x209),()=>_0x59058e[_0x314dcc(0x1d5)][_0x314dcc(0x1e7)](_0x5d5838,_0x217254),{'verbose':_0x29aa6a[_0x314dcc(0x1c6)]});return console['error'](_0x314dcc(0x1b7)+_0x5a7b23[_0x314dcc(0x1a1)][_0x314dcc(0x21a)]),await handleSingleObjectOutput(_0x5a7b23[_0x314dcc(0x1a1)],_0x29aa6a),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x2ac242(0x21a)]=a34_0x2ac242(0x20d);[a34_0x2ac242(0x19d)]=a34_0x2ac242(0x21b);['validate'](_0x385d59){const _0x4cfccc=a34_0x2ac242,_0x36d766=_0x385d59[_0x4cfccc(0x1dd)][0x0];if(!_0x36d766)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x2ac242(0x19c)](_0x1df526){const _0x4f1a5d=a34_0x2ac242,{options:_0x505ad5,args:_0x141da8,tdx:_0x1cedec}=_0x1df526,_0x5afdb0=_0x141da8[0x0];if(!_0x505ad5[_0x4f1a5d(0x1e0)]){const _0x3d67b2=await confirm(_0x4f1a5d(0x1a8)+_0x5afdb0+'\x22?');if(!_0x3d67b2)return console[_0x4f1a5d(0x1a3)]('Cancelled'),0x0;}const _0x3bfbf2=await withSpinner(_0x4f1a5d(0x1ae),()=>_0x1cedec[_0x4f1a5d(0x1d5)][_0x4f1a5d(0x1db)](_0x5afdb0),{'verbose':_0x505ad5[_0x4f1a5d(0x1c6)]});return console[_0x4f1a5d(0x1a3)]('Schedule\x20deleted:\x20'+_0x3bfbf2[_0x4f1a5d(0x1a1)][_0x4f1a5d(0x21a)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x2ac242(0x21a)]=a34_0x2ac242(0x1ea);['description']=a34_0x2ac242(0x208);[a34_0x2ac242(0x1e9)](_0x7a910f){const _0x21445d=a34_0x2ac242,_0x4aa0e9=_0x7a910f['args'][0x0];if(!_0x4aa0e9)return _0x21445d(0x1e4);return undefined;}async[a34_0x2ac242(0x19c)](_0x5173ef){const _0x49a304=a34_0x2ac242,{options:_0x184884,args:_0x350304,tdx:_0x1e5d8c}=_0x5173ef,_0x4dee5b=_0x350304[0x0],_0x4f771f=_0x184884,_0x47d233=_0x4f771f[_0x49a304(0x1a4)],_0x3b3adf=_0x4f771f[_0x49a304(0x1b9)]!==undefined?Number(_0x4f771f[_0x49a304(0x1b9)]):undefined;if(_0x184884[_0x49a304(0x1c6)]){console[_0x49a304(0x1a3)](_0x49a304(0x1f8)+_0x4dee5b);if(_0x47d233)console[_0x49a304(0x1a3)](_0x49a304(0x1d0)+_0x47d233);if(_0x3b3adf)console[_0x49a304(0x1a3)](_0x49a304(0x1cf)+_0x3b3adf);}const _0x1f0b04=await withSpinner(_0x49a304(0x1bc),()=>_0x1e5d8c[_0x49a304(0x1d5)][_0x49a304(0x1b0)](_0x4dee5b,{'time':_0x47d233,'num':_0x3b3adf}),{'verbose':_0x184884[_0x49a304(0x1c6)]}),_0x349081=_0x1f0b04['data'][_0x49a304(0x1da)];console[_0x49a304(0x1a3)]('Schedule\x20run\x20submitted:\x20'+_0x349081[_0x49a304(0x1d9)]+_0x49a304(0x221)+(_0x349081['length']!==0x1?'s':'')+_0x49a304(0x1b1));for(const _0x4d8bb5 of _0x349081){console[_0x49a304(0x1a3)]('\x20\x20Job\x20ID:\x20'+_0x4d8bb5['job_id']);}return await handleSDKOutput(_0x349081,_0x184884),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a34_0x2ac242(0x1bd);['description']='Show\x20schedule\x20execution\x20history';[a34_0x2ac242(0x1e9)](_0x22b5ae){const _0x1df5a2=a34_0x2ac242,_0x12c2ca=_0x22b5ae['args'][0x0];if(!_0x12c2ca)return _0x1df5a2(0x1c0);return undefined;}async['execute'](_0x22b589){const _0x43c562=a34_0x2ac242,{options:_0x35ecb5,args:_0x5af670,tdx:_0x126fed}=_0x22b589,_0x941d99=_0x5af670[0x0],_0x1807aa=_0x35ecb5,_0x413b9=_0x1807aa[_0x43c562(0x222)]!==undefined?Number(_0x1807aa[_0x43c562(0x222)]):undefined,_0x4dd2b9=_0x1807aa['to']!==undefined?Number(_0x1807aa['to']):undefined,_0x103147=await withSpinner(_0x43c562(0x1c5),()=>_0x126fed[_0x43c562(0x1d5)]['history'](_0x941d99,{'from':_0x413b9,'to':_0x4dd2b9}),{'verbose':_0x35ecb5[_0x43c562(0x1c6)]}),_0x4853f3=_0x103147[_0x43c562(0x1a1)];console[_0x43c562(0x1a3)]('Found\x20'+_0x4853f3['count']+_0x43c562(0x1ac)+(_0x4853f3[_0x43c562(0x1ec)]!==0x1?'s':'')+_0x43c562(0x1fe)+_0x4853f3[_0x43c562(0x222)]+'-'+_0x4853f3['to']+')');const _0x3383a4=_0x4853f3['history'][_0x43c562(0x21e)](_0x586121=>({'job_id':_0x586121[_0x43c562(0x203)],'type':_0x586121['type'],'status':_0x586121[_0x43c562(0x1e5)],'scheduled_at':_0x586121[_0x43c562(0x1bf)],'created_at':_0x586121[_0x43c562(0x1df)],'start_at':_0x586121[_0x43c562(0x1a5)],'end_at':_0x586121[_0x43c562(0x1ee)]}));return await handleSDKOutput(_0x3383a4,_0x35ecb5),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x2f6a02=a35_0x45c6;(function(_0x17695e,_0x5aea9c){const _0x1501f9=a35_0x45c6,_0x5261cd=_0x17695e();while(!![]){try{const _0x31f993=parseInt(_0x1501f9(0x15b))/0x1+-parseInt(_0x1501f9(0x179))/0x2+parseInt(_0x1501f9(0x149))/0x3+parseInt(_0x1501f9(0x1d1))/0x4*(-parseInt(_0x1501f9(0x167))/0x5)+parseInt(_0x1501f9(0x156))/0x6+-parseInt(_0x1501f9(0x1d4))/0x7+parseInt(_0x1501f9(0x16c))/0x8;if(_0x31f993===_0x5aea9c)break;else _0x5261cd['push'](_0x5261cd['shift']());}catch(_0x17fcd1){_0x5261cd['push'](_0x5261cd['shift']());}}}(a35_0x2046,0x78bfa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x10ce32 from'chalk';async function resolveSegmentTarget(_0x3eea24,_0x350a51,_0x47ffda){const _0x2c026c=a35_0x45c6;if(isYamlFilePath(_0x3eea24))try{const _0x4eb535=await resolveYamlFilePath(_0x3eea24);return _0x47ffda&&(console[_0x2c026c(0x1c9)](_0x2c026c(0x1c4)+_0x3eea24),console[_0x2c026c(0x1c9)]('\x20\x20Parent\x20segment:\x20'+_0x4eb535['parentSegment']),console[_0x2c026c(0x1c9)](_0x2c026c(0x1bc)+_0x4eb535[_0x2c026c(0x150)]),console['error'](_0x2c026c(0x192)+(_0x4eb535[_0x2c026c(0x178)]||'(root)')),console[_0x2c026c(0x1c9)]('\x20\x20Full\x20path:\x20'+_0x4eb535[_0x2c026c(0x19f)])),_0x4eb535[_0x2c026c(0x19f)];}catch(_0x44e665){throw new SDKError(ErrorCode[_0x2c026c(0x17f)],_0x2c026c(0x1cb)+_0x44e665[_0x2c026c(0x171)]);}if(!_0x350a51)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x350a51+'/'+_0x3eea24;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x145);[a35_0x2f6a02(0x1a0)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0x2f6a02(0x155)](_0x4cd340){const _0x34abc4=a35_0x2f6a02,{options:_0x2a8b14,args:_0xe72236,tdx:_0x4bf29d}=_0x4cd340,_0xa30dff=_0xe72236[0x0],_0x511f26=!_0xa30dff&&!!_0x2a8b14[_0x34abc4(0x1c6)],_0x314ee2=_0xa30dff||_0x2a8b14[_0x34abc4(0x1c6)];if(!_0x314ee2)return console[_0x34abc4(0x1c9)](_0x34abc4(0x16b)),console[_0x34abc4(0x1c9)](_0x34abc4(0x1ad)),console[_0x34abc4(0x1c9)]('Examples:'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x34abc4(0x1c9)](_0x34abc4(0x15d)),console[_0x34abc4(0x1c9)](_0x34abc4(0x18c)),0x1;try{const _0x1e8234=_0x2a8b14[_0x34abc4(0x14d)];let _0x321bbd=_0x314ee2;!_0x511f26&&_0x1e8234&&!_0x314ee2[_0x34abc4(0x161)]('/')&&(_0x321bbd=_0x1e8234+'/'+_0x314ee2,_0x2a8b14[_0x34abc4(0x1c8)]&&console[_0x34abc4(0x1c9)]('Resolved\x20relative\x20path\x20to:\x20'+_0x321bbd));const _0x9cf25b=await withSpinner(_0x34abc4(0x14a)+_0x321bbd+'\x27...',()=>_0x4bf29d['segment'][_0x34abc4(0x1b6)](_0x321bbd),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]}),_0x111d20=_0x9cf25b['data'];_0x2a8b14[_0x34abc4(0x1c8)]&&(console[_0x34abc4(0x1c9)](_0x34abc4(0x18a)+_0x111d20[_0x34abc4(0x19a)]),console[_0x34abc4(0x1c9)](_0x34abc4(0x196)+_0x111d20['parentId']),_0x111d20[_0x34abc4(0x16e)]&&console['error'](_0x34abc4(0x173)+_0x111d20[_0x34abc4(0x16e)]),_0x111d20['segmentId']&&console['error']('Segment\x20ID:\x20'+_0x111d20[_0x34abc4(0x19d)]));if(_0x111d20['type']==='parent'){const _0xd2feef=await withSpinner(_0x34abc4(0x19e),()=>_0x4bf29d[_0x34abc4(0x158)]['getParent'](_0x111d20[_0x34abc4(0x18d)]),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd2feef[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]==='folder'){if(!_0x111d20[_0x34abc4(0x16e)])throw new SDKError(ErrorCode[_0x34abc4(0x187)],_0x34abc4(0x159));const _0x24b348=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x151)](_0x111d20[_0x34abc4(0x16e)]),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]});await handleSingleObjectOutput(_0x24b348[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]===_0x34abc4(0x158)){if(!_0x111d20[_0x34abc4(0x19d)])throw new SDKError(ErrorCode[_0x34abc4(0x188)],_0x34abc4(0x1b8));const _0xd0b109=await withSpinner(_0x34abc4(0x1ba),()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x1b4)](_0x111d20['parentId'],_0x111d20['segmentId']),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd0b109[_0x34abc4(0x1be)],_0x2a8b14);}}}return 0x0;}catch(_0x2643c4){if(_0x2643c4 instanceof SDKError)return console['error'](_0x34abc4(0x18b)+_0x2643c4[_0x34abc4(0x171)]),_0x2643c4[_0x34abc4(0x19c)]&&console[_0x34abc4(0x1c9)]('\x20\x20Cause:\x20'+_0x2643c4[_0x34abc4(0x19c)]),0x1;throw _0x2643c4;}}}function a35_0x45c6(_0x6a9f68,_0x1b0d83){_0x6a9f68=_0x6a9f68-0x145;const _0x2046b0=a35_0x2046();let _0x45c6a9=_0x2046b0[_0x6a9f68];return _0x45c6a9;}export class SegmentShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:show';[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1ce);async['execute'](_0x592b29){const _0x3e314d=a35_0x2f6a02,{options:_0x2d8ece,args:_0x2173e6,tdx:_0xceb6fc}=_0x592b29,_0x1e4e49=_0x2173e6[0x0];if(!_0x1e4e49)return console[_0x3e314d(0x1c9)](_0x3e314d(0x1ac)),console[_0x3e314d(0x1c9)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3e314d(0x1c9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x3e314d(0x1c9)](_0x3e314d(0x15c)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a6)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1cc)),0x1;try{const _0x3d9fa0=_0x2d8ece[_0x3e314d(0x1c6)],_0x2721c9=await resolveSegmentTarget(_0x1e4e49,_0x3d9fa0,_0x2d8ece['verbose']);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x146)+_0x2721c9);const _0x5b0f32=await withSpinner(_0x3e314d(0x1b9)+_0x1e4e49+'\x27...',()=>_0xceb6fc[_0x3e314d(0x158)][_0x3e314d(0x1b6)](_0x2721c9),{'verbose':_0x2d8ece['verbose']}),_0x32c5e1=_0x5b0f32[_0x3e314d(0x1be)];_0x2d8ece[_0x3e314d(0x1c8)]&&(console[_0x3e314d(0x1c9)](_0x3e314d(0x18a)+_0x32c5e1['type']),console[_0x3e314d(0x1c9)](_0x3e314d(0x196)+_0x32c5e1[_0x3e314d(0x18d)]));if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x191))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x174)),0x1;if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x169))return console[_0x3e314d(0x1c9)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a7)),0x1;if(!_0x32c5e1['segmentId'])throw new SDKError(ErrorCode[_0x3e314d(0x188)],_0x3e314d(0x1b8));const _0x57d816=await withSpinner(_0x3e314d(0x198),()=>_0xceb6fc[_0x3e314d(0x158)]['getSegmentSQL'](_0x32c5e1[_0x3e314d(0x18d)],_0x32c5e1[_0x3e314d(0x19d)]),{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]});let _0x1de571=_0x57d816[_0x3e314d(0x1be)];const _0x800972=resolveLimit(_0x2d8ece['limit'],DEFAULT_DISPLAY_LIMIT),_0x38ed8d=/\bLIMIT\s+\d+/i['test'](_0x1de571);!_0x38ed8d&&(_0x1de571=_0x1de571[_0x3e314d(0x18e)]()[_0x3e314d(0x157)](/;+$/,''),_0x1de571=_0x3e314d(0x175)+_0x1de571+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x800972);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x1af)+_0x1de571);const _0x48c65e=await withProgressSpinner('Executing\x20segment\x20query...',async _0x518956=>{const _0xfde832=_0x3e314d,_0x27da0b=await _0xceb6fc[_0xfde832(0x1d6)][_0xfde832(0x155)](_0x1de571,{'catalog':'td','schema':_0xfde832(0x14b),'onJobId':_0x48c10c=>{const _0x307603=_0xfde832;_0x518956[_0x307603(0x17d)](_0x48c10c);}});return _0x27da0b;},{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]}),_0x25cb05=_0x48c65e[_0x3e314d(0x1be)],_0x2c072e=_0x25cb05[_0x3e314d(0x1a3)]?_0x3e314d(0x1b0)+_0x25cb05[_0x3e314d(0x1a3)]+']':'';return console['error']('β\x20Query\x20completed:\x20Processed\x20'+_0x25cb05[_0x3e314d(0x195)][_0x3e314d(0x1c5)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x25cb05['stats'][_0x3e314d(0x1c2)])+_0x2c072e)),await handleQueryOutput(_0x25cb05,_0x2d8ece),0x0;}catch(_0x22c877){if(_0x22c877 instanceof SDKError)return console['error']('β\x20Query\x20failed\x20['+_0x22c877[_0x3e314d(0x17c)]+']'),console['error']('\x0a'+_0x22c877[_0x3e314d(0x171)]),0x1;throw _0x22c877;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x14c);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x172);async['execute'](_0x4ba497){const _0x1a16a2=a35_0x2f6a02,{options:_0x1ab39e,args:_0x3bb269,tdx:_0x66d1c0}=_0x4ba497;if(_0x3bb269['length']===0x0)return console[_0x1a16a2(0x1c9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1a16a2(0x1c9)](_0x1a16a2(0x180)),0x1;const _0x565a49=_0x3bb269[0x0];try{_0x1ab39e[_0x1a16a2(0x1c8)]&&(console[_0x1a16a2(0x1c9)](_0x1a16a2(0x153)+_0x1ab39e['site']),console[_0x1a16a2(0x1c9)]('Parent\x20name:\x20'+_0x565a49));const _0x4f1618=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)]['resolveParentId'](_0x565a49),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2199ec=_0x4f1618['data'];_0x1ab39e[_0x1a16a2(0x1c8)]&&console['error'](_0x1a16a2(0x17a)+_0x2199ec);const _0x23200b=await withSpinner(_0x1a16a2(0x181)+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)][_0x1a16a2(0x1cd)](_0x2199ec),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2b3c7e=_0x23200b[_0x1a16a2(0x1be)];return console[_0x1a16a2(0x1c9)]('β\x20Found\x20'+_0x2b3c7e[_0x1a16a2(0x170)]+_0x1a16a2(0x1b1)+(_0x2b3c7e[_0x1a16a2(0x170)]!==0x1?'s':'')),await handleSDKOutput(_0x2b3c7e,_0x1ab39e),0x0;}catch(_0x13b366){if(_0x13b366 instanceof SDKError)return console[_0x1a16a2(0x1c9)]('Error:\x20'+_0x13b366[_0x1a16a2(0x171)]),_0x13b366['cause']&&console[_0x1a16a2(0x1c9)]('\x20\x20Cause:\x20'+_0x13b366[_0x1a16a2(0x19c)]),0x1;throw _0x13b366;}}}function a35_0x2046(){const _0x2222a1=['List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Folder\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','SELECT\x20*\x20FROM\x20(\x0a','\x27\x20with\x20ID:\x20','Segment\x20ID:\x20','folderPath','1388562VFwrSS','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','code','setJobId','Show\x20segment\x20folder\x20details','INVALID_ARGUMENT','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Listing\x20folders\x20for\x20parent\x20\x27','/e/','\x27...','log','β\x20Created\x20folder\x20\x27','getSQLFromServerSegment','SEGMENT_FOLDER_NOT_FOUND','SEGMENT_NOT_FOUND','url','Resolved\x20type:\x20','Error:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentId','trim','Fetching\x20SQL\x20from\x20rule...','segment:folder:show','folder','\x20\x20Folder\x20path:\x20','/app/ps/','Parent\x20segment:\x20','stats','Parent\x20ID:\x20','resolveFolderId','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20sg\x20desc\x20<name>','type','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','cause','segmentId','Fetching\x20parent\x20segment\x20details...','fullPath','description','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','jobId','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20show','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Options:','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20describe\x20<path>','site','SQL\x20query:\x0a','\x20[Job\x20ID:\x20','\x20folder','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Cause:\x20','getSegment','segment:sql','resolvePathToResource','parentFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20\x27','Fetching\x20segment\x20details...','name','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','data','getSQLFromYamlFile','segment:folder:create','segment:desc','elapsedTimeMillis','Resolving\x20parent\x20segment\x20\x27','Resolved\x20YAML\x20file:\x20','processedRows','parentSegment','\x20\x20tdx\x20sg\x20sql\x20--path\x20','verbose','error','cyan','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','listFolders','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20folder\x20\x27','web','256DjKrrO','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','3693088FSXAjI','path','query','segment:describe','Target\x20path:\x20','Folder\x20name:\x20','\x20Opening\x20','1587408CTPMnq','Resolving\x20path\x20\x27','information_schema','segment:folder:list','segmentPath','getSegmentSQL','createFolder','segmentName','getFolder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Site:\x20','getSegmentSQLFromYaml','execute','423918lGYArp','replace','segment','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','866562rJHufm','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','green','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','includes','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','red','resolveParentId','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Create\x20segment\x20folder\x20for\x20organization','4820Zwndex','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','parent','format','Error:\x20Path\x20or\x20name\x20is\x20required','2494368iMdoia','Use:\x20tdx\x20ps\x20view','folderId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','length','message'];a35_0x2046=function(){return _0x2222a1;};return a35_0x2046();}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x190);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x17e);async[a35_0x2f6a02(0x155)](_0x595cd1){const _0x52a1fa=a35_0x2f6a02,{options:_0x5e363f,args:_0x59af0d,tdx:_0x277965}=_0x595cd1;if(_0x59af0d['length']===0x0)return console[_0x52a1fa(0x1c9)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error'](_0x52a1fa(0x15f)),0x1;try{const {parentId:_0x5e2b1c,childId:_0x365f76}=parseSegmentRef(_0x59af0d[0x0]);_0x5e363f[_0x52a1fa(0x1c8)]&&(console[_0x52a1fa(0x1c9)](_0x52a1fa(0x153)+_0x5e363f[_0x52a1fa(0x1ae)]),console[_0x52a1fa(0x1c9)]('Parent\x20name:\x20'+_0x5e2b1c),_0x365f76&&console[_0x52a1fa(0x1c9)]('Folder\x20name:\x20'+_0x365f76));if(!_0x365f76)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1d3)),0x1;const _0x1943f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5e2b1c+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)]['resolveParentId'](_0x5e2b1c),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x85a500=_0x1943f1[_0x52a1fa(0x1be)];_0x5e363f[_0x52a1fa(0x1c8)]&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x17a)+_0x85a500);const _0x26b656=await withSpinner('Resolving\x20folder\x20\x27'+_0x365f76+'\x27...',()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x197)](_0x85a500,_0x365f76),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x2ba5b4=_0x26b656[_0x52a1fa(0x1be)];_0x5e363f['verbose']&&console[_0x52a1fa(0x1c9)]('Resolved\x20folder\x20ID:\x20'+_0x2ba5b4);const _0x122ab6=await withSpinner('Fetching\x20folder\x20\x27'+_0x365f76+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x151)](_0x2ba5b4),{'verbose':_0x5e363f['verbose']});return await handleSDKOutput([_0x122ab6[_0x52a1fa(0x1be)]],_0x5e363f),0x0;}catch(_0x299e83){if(_0x299e83 instanceof SDKError)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x18b)+_0x299e83[_0x52a1fa(0x171)]),_0x299e83['cause']&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1b3)+_0x299e83[_0x52a1fa(0x19c)]),0x1;throw _0x299e83;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a35_0x2f6a02(0x1b5);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x7d5f0){const _0x38077e=a35_0x2f6a02,{options:_0x525512,args:_0x1554b5}=_0x7d5f0,_0x2e80f3=_0x525512,_0x3047b2=_0x2e80f3[_0x38077e(0x1d5)],_0x3c2a39=_0x1554b5[0x0];if(!_0x3c2a39&&!_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x19b))),console[_0x38077e(0x1c9)]('Usage:'),console[_0x38077e(0x1c9)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x38077e(0x1c9)](_0x38077e(0x1b2)),console['error'](_0x38077e(0x15c)),console[_0x38077e(0x1c9)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x38077e(0x1c9)](_0x38077e(0x1bd)),0x1;if(_0x3c2a39&&_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x6242e0;if(_0x3047b2)_0x6242e0=await this[_0x38077e(0x1bf)](_0x3047b2,_0x7d5f0);else{if(isYamlFilePath(_0x3c2a39))return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x162))),console[_0x38077e(0x1c9)](_0x38077e(0x1c7)+_0x3c2a39),0x1;else _0x6242e0=await this['getSQLFromServerSegment'](_0x3c2a39,_0x7d5f0);}return _0x525512['format']==='json'||_0x525512[_0x38077e(0x16a)]==='jsonl'?await handleSDKOutput([{'sql':_0x6242e0}],_0x525512):console[_0x38077e(0x184)](_0x6242e0),0x0;}catch(_0x2903da){if(_0x2903da instanceof SDKError)return console['error'](_0x38077e(0x18b)+_0x2903da[_0x38077e(0x171)]),_0x2903da[_0x38077e(0x19c)]&&console['error'](_0x38077e(0x1b3)+_0x2903da['cause']),0x1;throw _0x2903da;}}async['getSQLFromYamlFile'](_0x198844,_0x5c3141){const _0x53ba69=a35_0x2f6a02,{options:_0x4ab629,tdx:_0x4f5696}=_0x5c3141;let _0x526f47;try{_0x526f47=await resolveYamlFilePath(_0x198844);}catch(_0x5d1ab8){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53ba69(0x1cb)+_0x5d1ab8[_0x53ba69(0x171)]);}_0x4ab629[_0x53ba69(0x1c8)]&&console[_0x53ba69(0x1c9)]('Resolved:\x20'+_0x526f47['parentSegment']+'/'+_0x526f47['segmentName']);const _0x5d5555=await withSpinner(_0x53ba69(0x18f),()=>_0x4f5696[_0x53ba69(0x158)][_0x53ba69(0x154)](_0x526f47[_0x53ba69(0x1a4)],_0x526f47['parentSegment'],_0x526f47[_0x53ba69(0x150)]),{'verbose':_0x4ab629[_0x53ba69(0x1c8)]});return _0x5d5555[_0x53ba69(0x1be)];}async[a35_0x2f6a02(0x186)](_0xafddba,_0x5193d7){const _0x51e393=a35_0x2f6a02,{options:_0x149ee0,tdx:_0x333010}=_0x5193d7,_0x1d606c=_0x149ee0[_0x51e393(0x1c6)],_0x4415ac=await resolveSegmentTarget(_0xafddba,_0x1d606c,_0x149ee0[_0x51e393(0x1c8)]);_0x149ee0['verbose']&&console[_0x51e393(0x1c9)](_0x51e393(0x146)+_0x4415ac);const _0x54e350=await withSpinner(_0x51e393(0x1b9)+_0xafddba+'\x27...',()=>_0x333010[_0x51e393(0x158)]['resolvePathToResource'](_0x4415ac),{'verbose':_0x149ee0[_0x51e393(0x1c8)]}),_0x45ae5a=_0x54e350[_0x51e393(0x1be)];_0x149ee0[_0x51e393(0x1c8)]&&(console[_0x51e393(0x1c9)]('Resolved\x20type:\x20'+_0x45ae5a[_0x51e393(0x19a)]),console[_0x51e393(0x1c9)](_0x51e393(0x196)+_0x45ae5a['parentId']));if(_0x45ae5a[_0x51e393(0x19a)]===_0x51e393(0x191))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x45ae5a['type']===_0x51e393(0x169))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x45ae5a[_0x51e393(0x19d)])throw new SDKError(ErrorCode[_0x51e393(0x188)],_0x51e393(0x1b8));const _0x28c83b=await withSpinner(_0x51e393(0x198),()=>_0x333010[_0x51e393(0x158)][_0x51e393(0x14e)](_0x45ae5a['parentId'],_0x45ae5a[_0x51e393(0x19d)]),{'verbose':_0x149ee0[_0x51e393(0x1c8)]});return _0x28c83b[_0x51e393(0x1be)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c0);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x166);async[a35_0x2f6a02(0x155)](_0x2f0635){const _0x5c9ba1=a35_0x2f6a02,{options:_0x18d363,args:_0x51de1a,tdx:_0x479601}=_0x2f0635,_0x494df4=_0x18d363;if(_0x51de1a['length']<0x2)return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x1a9)),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x168)),0x1;const _0x26dd30=_0x51de1a[0x0],_0x34f1df=_0x51de1a[0x1];_0x494df4[_0x5c9ba1(0x1c8)]&&(console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x153)+_0x494df4[_0x5c9ba1(0x1ae)]),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x194)+_0x26dd30),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x147)+_0x34f1df));let _0x53074e;if(_0x494df4[_0x5c9ba1(0x1b7)]){const _0x446bf1=_0x494df4[_0x5c9ba1(0x1b7)],_0xf4fff5=await withSpinner(_0x5c9ba1(0x1c3)+_0x26dd30+'\x27...',()=>_0x479601['segment'][_0x5c9ba1(0x164)](_0x26dd30),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]}),_0x225654=_0xf4fff5[_0x5c9ba1(0x1be)],_0x2a1c13=await withSpinner(_0x5c9ba1(0x1cf)+_0x446bf1+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x197)](_0x225654,_0x446bf1),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]});_0x53074e=_0x2a1c13[_0x5c9ba1(0x1be)],_0x494df4[_0x5c9ba1(0x1c8)]&&console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x17b)+_0x53074e);}const _0x3389b1={'name':_0x34f1df,'description':_0x494df4[_0x5c9ba1(0x1a0)],'parentFolderId':_0x53074e},_0x407399=await withSpinner('Creating\x20folder\x20\x27'+_0x34f1df+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x14f)](_0x26dd30,_0x3389b1),{'verbose':_0x494df4['verbose']}),_0x34b3cd=_0x407399[_0x5c9ba1(0x1be)];return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x185)+_0x34b3cd[_0x5c9ba1(0x1bb)]+_0x5c9ba1(0x176)+_0x34b3cd['id']),await handleSDKOutput([_0x34b3cd],_0x494df4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:view';[a35_0x2f6a02(0x1a0)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x2f6a02(0x155)](_0x2685e6){const _0x1bb54f=a35_0x2f6a02,{options:_0x2e9f8b,args:_0x1a6335,tdx:_0x24c124}=_0x2685e6,_0x453213=_0x1a6335[0x0];if(!_0x453213)return console['error'](_0x1bb54f(0x16f)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x165)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a5)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1aa)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a2)),console[_0x1bb54f(0x1c9)]('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1bb54f(0x1c9)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1ab)),0x1;try{const _0x16dcd3=_0x2e9f8b[_0x1bb54f(0x1c6)],_0x29df10=await resolveSegmentTarget(_0x453213,_0x16dcd3,_0x2e9f8b[_0x1bb54f(0x1c8)]);_0x2e9f8b[_0x1bb54f(0x1c8)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x146)+_0x29df10);const _0x222c9d=await withSpinner(_0x1bb54f(0x1b9)+_0x453213+'\x27...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x1b6)](_0x29df10),{'verbose':_0x2e9f8b['verbose']}),_0x3cd70a=_0x222c9d[_0x1bb54f(0x1be)];_0x2e9f8b[_0x1bb54f(0x1c8)]&&(console[_0x1bb54f(0x1c9)]('Resolved\x20type:\x20'+_0x3cd70a[_0x1bb54f(0x19a)]),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x196)+_0x3cd70a['parentId']),_0x3cd70a[_0x1bb54f(0x16e)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x173)+_0x3cd70a[_0x1bb54f(0x16e)]),_0x3cd70a[_0x1bb54f(0x19d)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x177)+_0x3cd70a[_0x1bb54f(0x19d)]));if(_0x2e9f8b[_0x1bb54f(0x1d0)]){if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x191))return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x160)),0x1;if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x169))return console[_0x1bb54f(0x1c9)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1bb54f(0x1c9)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2d6362=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],'/app/ps/'+_0x3cd70a[_0x1bb54f(0x18d)]+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]);return console[_0x1bb54f(0x1c9)](a35_0x10ce32[_0x1bb54f(0x15e)]('β')+_0x1bb54f(0x148)+a35_0x10ce32[_0x1bb54f(0x1ca)](_0x2d6362)),openBrowser(_0x2d6362),0x0;}if(_0x3cd70a[_0x1bb54f(0x19a)]==='folder'){if(!_0x3cd70a[_0x1bb54f(0x16e)])throw new SDKError(ErrorCode[_0x1bb54f(0x187)],_0x1bb54f(0x159));const _0x3e7fd6=await withSpinner('Fetching\x20folder\x20details...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x151)](_0x3cd70a[_0x1bb54f(0x16e)]),{'verbose':_0x2e9f8b['verbose']});await handleSingleObjectOutput(_0x3e7fd6[_0x1bb54f(0x1be)],_0x2e9f8b);}else{if(_0x3cd70a[_0x1bb54f(0x19a)]==='segment'){if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2105be=await withSpinner(_0x1bb54f(0x1ba),()=>_0x24c124[_0x1bb54f(0x158)]['getSegment'](_0x3cd70a[_0x1bb54f(0x18d)],_0x3cd70a[_0x1bb54f(0x19d)]),{'verbose':_0x2e9f8b[_0x1bb54f(0x1c8)]}),_0x574529=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],_0x1bb54f(0x193)+_0x3cd70a['parentId']+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]),_0x2d2ef1=_0x2105be[_0x1bb54f(0x1be)];_0x2d2ef1[_0x1bb54f(0x189)]=_0x574529,await handleSingleObjectOutput(_0x2d2ef1,_0x2e9f8b);}else return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a1)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x16d)),0x1;}return 0x0;}catch(_0x2c21cf){if(_0x2c21cf instanceof SDKError)return console[_0x1bb54f(0x1c9)]('Error:\x20'+_0x2c21cf[_0x1bb54f(0x171)]),_0x2c21cf[_0x1bb54f(0x19c)]&&console[_0x1bb54f(0x1c9)]('\x20\x20Cause:\x20'+_0x2c21cf[_0x1bb54f(0x19c)]),0x1;throw _0x2c21cf;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c1);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1d2);async[a35_0x2f6a02(0x155)](_0x52c4bf){const _0x21fe95=a35_0x2f6a02,{options:_0x5f15da,args:_0x252703,tdx:_0x23dc62}=_0x52c4bf,_0x1d8c55=_0x252703[0x0];if(!_0x1d8c55)return console[_0x21fe95(0x1c9)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x21fe95(0x1c9)](_0x21fe95(0x199)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15a)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15c)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x21fe95(0x152)),0x1;try{const _0x2b0354=_0x5f15da['parentSegment'],_0x1d4da3=await resolveSegmentTarget(_0x1d8c55,_0x2b0354,_0x5f15da[_0x21fe95(0x1c8)]);_0x5f15da[_0x21fe95(0x1c8)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x146)+_0x1d4da3);const _0x2b8ac3=await withSpinner('Resolving\x20\x27'+_0x1d8c55+'\x27...',()=>_0x23dc62['segment']['resolvePathToResource'](_0x1d4da3),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x3e7a3e=_0x2b8ac3[_0x21fe95(0x1be)];_0x5f15da[_0x21fe95(0x1c8)]&&(console[_0x21fe95(0x1c9)]('Resolved\x20type:\x20'+_0x3e7a3e[_0x21fe95(0x19a)]),console['error'](_0x21fe95(0x196)+_0x3e7a3e['parentId']));if(_0x3e7a3e[_0x21fe95(0x19a)]==='folder')return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x21fe95(0x1c9)](_0x21fe95(0x1a8)),0x1;if(_0x3e7a3e[_0x21fe95(0x19a)]==='parent')return console[_0x21fe95(0x1c9)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x21fe95(0x1c9)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x3e7a3e[_0x21fe95(0x19d)])throw new SDKError(ErrorCode[_0x21fe95(0x188)],_0x21fe95(0x1b8));const _0x5e6e79=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x23dc62[_0x21fe95(0x158)][_0x21fe95(0x14e)](_0x3e7a3e[_0x21fe95(0x18d)],_0x3e7a3e[_0x21fe95(0x19d)]),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x8354d2=_0x5e6e79['data'],_0x2cb370=await executeSchemaQuery(_0x8354d2,_0x23dc62,_0x5f15da);return await handleQueryOutput(_0x2cb370,_0x5f15da),0x0;}catch(_0x300018){if(_0x300018 instanceof SDKError)return console[_0x21fe95(0x1c9)](_0x21fe95(0x18b)+_0x300018['message']),_0x300018[_0x21fe95(0x19c)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x1b3)+_0x300018[_0x21fe95(0x19c)]),0x1;throw _0x300018;}}}
|
|
1
|
+
const a35_0x4621d9=a35_0x57d9;(function(_0x468c87,_0x81c88b){const _0xe17a46=a35_0x57d9,_0x14ddda=_0x468c87();while(!![]){try{const _0x114ac5=parseInt(_0xe17a46(0x246))/0x1+-parseInt(_0xe17a46(0x244))/0x2+parseInt(_0xe17a46(0x22c))/0x3*(parseInt(_0xe17a46(0x209))/0x4)+parseInt(_0xe17a46(0x1c2))/0x5*(-parseInt(_0xe17a46(0x214))/0x6)+parseInt(_0xe17a46(0x241))/0x7*(parseInt(_0xe17a46(0x1e6))/0x8)+parseInt(_0xe17a46(0x205))/0x9*(parseInt(_0xe17a46(0x1d3))/0xa)+-parseInt(_0xe17a46(0x1da))/0xb;if(_0x114ac5===_0x81c88b)break;else _0x14ddda['push'](_0x14ddda['shift']());}catch(_0x37de5c){_0x14ddda['push'](_0x14ddda['shift']());}}}(a35_0x5afa,0x87092));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';function a35_0x5afa(){const _0x244643=['getSQLFromYamlFile','parentSegment','segment:folder:create','getSegment','segment','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20Opening\x20','7548147uOLfVx','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Options:','6320hCKwup','resolveParentId','folderId','\x20\x20Cause:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','β\x20Created\x20folder\x20\x27','cause','stats','Fetching\x20folder\x20\x27','/e/','name','5604990UlqxCR','Resolving\x20path\x20\x27','Fetching\x20segment\x20details...','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','β\x20Query\x20failed\x20[','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','data','\x20folder','Examples:','green','getSegmentSQLFromYaml','Usage:\x20tdx\x20sg\x20desc\x20<name>','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','processedRows','type','\x20\x20Segment\x20name:\x20','listFolders','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','/app/ps/','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20view','getSQLFromServerSegment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','2031tqwLhO','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolved\x20parent\x20folder\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','site','Usage:','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','cyan','web','Executing\x20segment\x20query...','jsonl','segment:sql','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','createFolder','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','parentFolder','Parent\x20segment:\x20','segment:folder:show','Resolved\x20parent\x20ID:\x20','2791607xVRcqk','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20Full\x20path:\x20','1365242jEePzq','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','186009tpnpbA','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','json','setJobId','parentId','Usage:\x20tdx\x20segment\x20describe\x20<path>','jobId','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','segment:desc','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','β\x20Found\x20','SEGMENT_NOT_FOUND','format','red','error','SEGMENT_FOLDER_NOT_FOUND','message','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','description','Fetching\x20folder\x20details...','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Resolved\x20type:\x20','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Show\x20segment\x20or\x20folder\x20details','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Target\x20path:\x20','Resolving\x20\x27','segment:describe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','content','Error:\x20','fullPath','5hSlaBz','information_schema','segment:folder:list','code','Error:\x20Path\x20or\x20name\x20is\x20required','path','Site:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','segment:show','segmentName','execute','toLocaleString','length','segment:view','segmentId','Folder\x20ID:\x20','parent','10hZmFZc','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','folderPath','limit','resolveFolderId','elapsedTimeMillis','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','7942682jKDadU','SQL\x20query:\x0a','Fetching\x20SQL\x20from\x20rule...','Parent\x20name:\x20','INVALID_ARGUMENT','Use:\x20tdx\x20ps\x20show','getFolder','Resolved\x20YAML\x20file:\x20','Segment\x20ID:\x20','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolving\x20folder\x20\x27','16aDQQmI','Parent\x20ID:\x20','Folder\x20name:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x27...','Fetching\x20parent\x20segment\x20details...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','verbose','Resolved\x20folder\x20ID:\x20','folder','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20for\x20segment...','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','url','trim','\x20rows\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','replace','Resolving\x20parent\x20segment\x20\x27','getSegmentSQL','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','resolvePathToResource'];a35_0x5afa=function(){return _0x244643;};return a35_0x5afa();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x4ccb21 from'chalk';async function resolveSegmentTarget(_0x456e94,_0x54d904,_0x491b0e){const _0x4129be=a35_0x57d9;if(isYamlFilePath(_0x456e94))try{const _0xd86246=await resolveYamlFilePath(_0x456e94);return _0x491b0e&&(console[_0x4129be(0x254)](_0x4129be(0x1e1)+_0x456e94),console['error']('\x20\x20Parent\x20segment:\x20'+_0xd86246[_0x4129be(0x1ff)]),console['error'](_0x4129be(0x224)+_0xd86246[_0x4129be(0x1cb)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0xd86246[_0x4129be(0x1d5)]||'(root)')),console[_0x4129be(0x254)](_0x4129be(0x243)+_0xd86246[_0x4129be(0x26c)])),_0xd86246[_0x4129be(0x26c)];}catch(_0x198519){throw new SDKError(ErrorCode[_0x4129be(0x1de)],_0x4129be(0x245)+_0x198519[_0x4129be(0x256)]);}if(!_0x54d904)throw new SDKError(ErrorCode[_0x4129be(0x1de)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x54d904+'/'+_0x456e94;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x268);[a35_0x4621d9(0x259)]=a35_0x4621d9(0x263);async[a35_0x4621d9(0x1cc)](_0x2bb958){const _0x5a2fb8=a35_0x4621d9,{options:_0x49ae9a,args:_0x4229d0,tdx:_0x5292bf}=_0x2bb958,_0x101aa8=_0x4229d0[0x0],_0x114d79=!_0x101aa8&&!!_0x49ae9a[_0x5a2fb8(0x1ff)],_0x1a81dc=_0x101aa8||_0x49ae9a[_0x5a2fb8(0x1ff)];if(!_0x1a81dc)return console['error'](_0x5a2fb8(0x1c6)),console['error'](_0x5a2fb8(0x24b)),console[_0x5a2fb8(0x254)](_0x5a2fb8(0x21c)),console['error'](_0x5a2fb8(0x207)),console[_0x5a2fb8(0x254)](_0x5a2fb8(0x1e4)),console['error'](_0x5a2fb8(0x1f7)),console[_0x5a2fb8(0x254)](_0x5a2fb8(0x257)),0x1;try{const _0x4e1582=_0x49ae9a['segmentPath'];let _0x1a37e0=_0x1a81dc;!_0x114d79&&_0x4e1582&&!_0x1a81dc['includes']('/')&&(_0x1a37e0=_0x4e1582+'/'+_0x1a81dc,_0x49ae9a[_0x5a2fb8(0x1ee)]&&console['error'](_0x5a2fb8(0x260)+_0x1a37e0));const _0x3217ce=await withSpinner(_0x5a2fb8(0x215)+_0x1a37e0+_0x5a2fb8(0x1eb),()=>_0x5292bf[_0x5a2fb8(0x202)][_0x5a2fb8(0x1fd)](_0x1a37e0),{'verbose':_0x49ae9a[_0x5a2fb8(0x1ee)]}),_0x128127=_0x3217ce[_0x5a2fb8(0x21a)];_0x49ae9a[_0x5a2fb8(0x1ee)]&&(console[_0x5a2fb8(0x254)](_0x5a2fb8(0x25d)+_0x128127['type']),console[_0x5a2fb8(0x254)](_0x5a2fb8(0x1e7)+_0x128127[_0x5a2fb8(0x24a)]),_0x128127[_0x5a2fb8(0x20b)]&&console[_0x5a2fb8(0x254)]('Folder\x20ID:\x20'+_0x128127[_0x5a2fb8(0x20b)]),_0x128127[_0x5a2fb8(0x1d0)]&&console[_0x5a2fb8(0x254)](_0x5a2fb8(0x1e2)+_0x128127[_0x5a2fb8(0x1d0)]));if(_0x128127[_0x5a2fb8(0x223)]===_0x5a2fb8(0x1d2)){const _0x26e8e4=await withSpinner(_0x5a2fb8(0x1ec),()=>_0x5292bf[_0x5a2fb8(0x202)]['getParent'](_0x128127['parentId']),{'verbose':_0x49ae9a[_0x5a2fb8(0x1ee)]});await handleSingleObjectOutput(_0x26e8e4[_0x5a2fb8(0x21a)],_0x49ae9a);}else{if(_0x128127['type']===_0x5a2fb8(0x1f0)){if(!_0x128127['folderId'])throw new SDKError(ErrorCode[_0x5a2fb8(0x255)],_0x5a2fb8(0x264));const _0x5d77ea=await withSpinner(_0x5a2fb8(0x25a),()=>_0x5292bf[_0x5a2fb8(0x202)][_0x5a2fb8(0x1e0)](_0x128127[_0x5a2fb8(0x20b)]),{'verbose':_0x49ae9a[_0x5a2fb8(0x1ee)]});await handleSingleObjectOutput(_0x5d77ea[_0x5a2fb8(0x21a)],_0x49ae9a);}else{if(_0x128127[_0x5a2fb8(0x223)]===_0x5a2fb8(0x202)){if(!_0x128127['segmentId'])throw new SDKError(ErrorCode[_0x5a2fb8(0x251)],_0x5a2fb8(0x1ed));const _0x5880d9=await withSpinner(_0x5a2fb8(0x216),()=>_0x5292bf[_0x5a2fb8(0x202)][_0x5a2fb8(0x201)](_0x128127[_0x5a2fb8(0x24a)],_0x128127['segmentId']),{'verbose':_0x49ae9a[_0x5a2fb8(0x1ee)]});await handleSingleObjectOutput(_0x5880d9[_0x5a2fb8(0x21a)],_0x49ae9a);}}}return 0x0;}catch(_0x4eb98b){if(_0x4eb98b instanceof SDKError)return console[_0x5a2fb8(0x254)](_0x5a2fb8(0x26b)+_0x4eb98b['message']),_0x4eb98b['cause']&&console['error'](_0x5a2fb8(0x20c)+_0x4eb98b[_0x5a2fb8(0x20f)]),0x1;throw _0x4eb98b;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x1ca);['description']=a35_0x4621d9(0x262);async['execute'](_0x5748bf){const _0x57f933=a35_0x4621d9,{options:_0x483203,args:_0xcf43ff,tdx:_0x471c43}=_0x5748bf,_0x1d3281=_0xcf43ff[0x0];if(!_0x1d3281)return console[_0x57f933(0x254)](_0x57f933(0x226)),console[_0x57f933(0x254)](_0x57f933(0x220)),console['error'](_0x57f933(0x269)),console['error'](_0x57f933(0x21c)),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x57f933(0x254)](_0x57f933(0x1fc)),0x1;try{const _0x298124=_0x483203['parentSegment'],_0x2a2356=await resolveSegmentTarget(_0x1d3281,_0x298124,_0x483203[_0x57f933(0x1ee)]);_0x483203[_0x57f933(0x1ee)]&&console[_0x57f933(0x254)](_0x57f933(0x266)+_0x2a2356);const _0x222f02=await withSpinner('Resolving\x20\x27'+_0x1d3281+_0x57f933(0x1eb),()=>_0x471c43['segment'][_0x57f933(0x1fd)](_0x2a2356),{'verbose':_0x483203[_0x57f933(0x1ee)]}),_0x3bcdd8=_0x222f02[_0x57f933(0x21a)];_0x483203[_0x57f933(0x1ee)]&&(console[_0x57f933(0x254)](_0x57f933(0x25d)+_0x3bcdd8['type']),console[_0x57f933(0x254)](_0x57f933(0x1e7)+_0x3bcdd8[_0x57f933(0x24a)]));if(_0x3bcdd8['type']===_0x57f933(0x1f0))return console[_0x57f933(0x254)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x57f933(0x254)](_0x57f933(0x20d)),0x1;if(_0x3bcdd8[_0x57f933(0x223)]==='parent')return console[_0x57f933(0x254)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x57f933(0x254)](_0x57f933(0x1df)),0x1;if(!_0x3bcdd8[_0x57f933(0x1d0)])throw new SDKError(ErrorCode[_0x57f933(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x12cf26=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x471c43[_0x57f933(0x202)][_0x57f933(0x1fb)](_0x3bcdd8[_0x57f933(0x24a)],_0x3bcdd8[_0x57f933(0x1d0)]),{'verbose':_0x483203[_0x57f933(0x1ee)]});let _0x5c0e94=_0x12cf26['data'];const _0x48307f=resolveLimit(_0x483203[_0x57f933(0x1d6)],DEFAULT_DISPLAY_LIMIT),_0x38b611=/\bLIMIT\s+\d+/i['test'](_0x5c0e94);!_0x38b611&&(_0x5c0e94=_0x5c0e94[_0x57f933(0x1f5)]()[_0x57f933(0x1f9)](/;+$/,''),_0x5c0e94=_0x57f933(0x232)+_0x5c0e94+_0x57f933(0x203)+_0x48307f);_0x483203[_0x57f933(0x1ee)]&&console[_0x57f933(0x254)](_0x57f933(0x1db)+_0x5c0e94);const _0x30431d=await withProgressSpinner(_0x57f933(0x236),async _0x3b5ff6=>{const _0x1748d5=_0x57f933,_0x2203e1=await _0x471c43['query'][_0x1748d5(0x1cc)](_0x5c0e94,{'catalog':'td','schema':_0x1748d5(0x1c3),'onJobId':_0x5465fa=>{const _0x735c0=_0x1748d5;_0x3b5ff6[_0x735c0(0x249)](_0x5465fa);}});return _0x2203e1;},{'verbose':_0x483203[_0x57f933(0x1ee)]}),_0x129165=_0x30431d[_0x57f933(0x21a)],_0x598bfe=_0x129165[_0x57f933(0x24c)]?'\x20[Job\x20ID:\x20'+_0x129165['jobId']+']':'';return console[_0x57f933(0x254)]('β\x20Query\x20completed:\x20Processed\x20'+_0x129165[_0x57f933(0x210)][_0x57f933(0x222)][_0x57f933(0x1cd)]()+_0x57f933(0x1f6)+('in\x20'+formatElapsed(_0x129165[_0x57f933(0x210)][_0x57f933(0x1d8)])+_0x598bfe)),await handleQueryOutput(_0x129165,_0x483203),0x0;}catch(_0x18567a){if(_0x18567a instanceof SDKError)return console['error'](_0x57f933(0x218)+_0x18567a[_0x57f933(0x1c5)]+']'),console[_0x57f933(0x254)]('\x0a'+_0x18567a[_0x57f933(0x256)]),0x1;throw _0x18567a;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x1c4);[a35_0x4621d9(0x259)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x2f2304){const _0x217aaf=a35_0x4621d9,{options:_0x2c9202,args:_0x841c72,tdx:_0x58848f}=_0x2f2304;if(_0x841c72['length']===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x217aaf(0x254)](_0x217aaf(0x22b)),0x1;const _0x3d6acd=_0x841c72[0x0];try{_0x2c9202['verbose']&&(console[_0x217aaf(0x254)]('Site:\x20'+_0x2c9202['site']),console[_0x217aaf(0x254)](_0x217aaf(0x1dd)+_0x3d6acd));const _0x478c31=await withSpinner(_0x217aaf(0x1fa)+_0x3d6acd+_0x217aaf(0x1eb),()=>_0x58848f[_0x217aaf(0x202)]['resolveParentId'](_0x3d6acd),{'verbose':_0x2c9202[_0x217aaf(0x1ee)]}),_0x49de05=_0x478c31['data'];_0x2c9202[_0x217aaf(0x1ee)]&&console['error'](_0x217aaf(0x240)+_0x49de05);const _0x4525f6=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x3d6acd+'\x27...',()=>_0x58848f[_0x217aaf(0x202)][_0x217aaf(0x225)](_0x49de05),{'verbose':_0x2c9202[_0x217aaf(0x1ee)]}),_0x1c3350=_0x4525f6['data'];return console[_0x217aaf(0x254)](_0x217aaf(0x250)+_0x1c3350[_0x217aaf(0x1ce)]+_0x217aaf(0x21b)+(_0x1c3350[_0x217aaf(0x1ce)]!==0x1?'s':'')),await handleSDKOutput(_0x1c3350,_0x2c9202),0x0;}catch(_0x16b34c){if(_0x16b34c instanceof SDKError)return console['error'](_0x217aaf(0x26b)+_0x16b34c[_0x217aaf(0x256)]),_0x16b34c[_0x217aaf(0x20f)]&&console[_0x217aaf(0x254)](_0x217aaf(0x20c)+_0x16b34c[_0x217aaf(0x20f)]),0x1;throw _0x16b34c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x23f);[a35_0x4621d9(0x259)]='Show\x20segment\x20folder\x20details';async[a35_0x4621d9(0x1cc)](_0x165fa4){const _0x7100d7=a35_0x4621d9,{options:_0x4e517c,args:_0x393a50,tdx:_0x5e22d6}=_0x165fa4;if(_0x393a50[_0x7100d7(0x1ce)]===0x0)return console[_0x7100d7(0x254)](_0x7100d7(0x22f)),console['error'](_0x7100d7(0x1ea)),0x1;try{const {parentId:_0x121c80,childId:_0x50dba7}=parseSegmentRef(_0x393a50[0x0]);_0x4e517c[_0x7100d7(0x1ee)]&&(console[_0x7100d7(0x254)](_0x7100d7(0x1c8)+_0x4e517c['site']),console['error'](_0x7100d7(0x1dd)+_0x121c80),_0x50dba7&&console[_0x7100d7(0x254)](_0x7100d7(0x1e8)+_0x50dba7));if(!_0x50dba7)return console[_0x7100d7(0x254)](_0x7100d7(0x24f)),0x1;const _0x9603d0=await withSpinner(_0x7100d7(0x1fa)+_0x121c80+_0x7100d7(0x1eb),()=>_0x5e22d6[_0x7100d7(0x202)][_0x7100d7(0x20a)](_0x121c80),{'verbose':_0x4e517c[_0x7100d7(0x1ee)]}),_0x12f946=_0x9603d0[_0x7100d7(0x21a)];_0x4e517c[_0x7100d7(0x1ee)]&&console[_0x7100d7(0x254)](_0x7100d7(0x240)+_0x12f946);const _0x386667=await withSpinner(_0x7100d7(0x1e5)+_0x50dba7+'\x27...',()=>_0x5e22d6[_0x7100d7(0x202)]['resolveFolderId'](_0x12f946,_0x50dba7),{'verbose':_0x4e517c[_0x7100d7(0x1ee)]}),_0x26af52=_0x386667['data'];_0x4e517c['verbose']&&console[_0x7100d7(0x254)](_0x7100d7(0x1ef)+_0x26af52);const _0x53885f=await withSpinner(_0x7100d7(0x211)+_0x50dba7+_0x7100d7(0x1eb),()=>_0x5e22d6[_0x7100d7(0x202)][_0x7100d7(0x1e0)](_0x26af52),{'verbose':_0x4e517c[_0x7100d7(0x1ee)]});return await handleSDKOutput([_0x53885f[_0x7100d7(0x21a)]],_0x4e517c),0x0;}catch(_0x15e8d6){if(_0x15e8d6 instanceof SDKError)return console[_0x7100d7(0x254)]('Error:\x20'+_0x15e8d6['message']),_0x15e8d6[_0x7100d7(0x20f)]&&console['error']('\x20\x20Cause:\x20'+_0x15e8d6['cause']),0x1;throw _0x15e8d6;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x238);[a35_0x4621d9(0x259)]=a35_0x4621d9(0x1e9);async[a35_0x4621d9(0x1cc)](_0x1416c9){const _0x2e52ed=a35_0x4621d9,{options:_0x40d557,args:_0x3f7338}=_0x1416c9,_0x454edd=_0x40d557,_0x2074d7=_0x454edd[_0x2e52ed(0x1c7)],_0x562f85=_0x3f7338[0x0];if(!_0x562f85&&!_0x2074d7)return console[_0x2e52ed(0x254)](a35_0x4ccb21[_0x2e52ed(0x253)](_0x2e52ed(0x23c))),console['error'](_0x2e52ed(0x231)),console[_0x2e52ed(0x254)](_0x2e52ed(0x25e)),console['error']('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0x2e52ed(0x254)](_0x2e52ed(0x21c)),console['error'](_0x2e52ed(0x221)),console[_0x2e52ed(0x254)](_0x2e52ed(0x1f1)),0x1;if(_0x562f85&&_0x2074d7)return console[_0x2e52ed(0x254)](a35_0x4ccb21['red'](_0x2e52ed(0x265))),0x1;try{let _0x9db760;if(_0x2074d7)_0x9db760=await this[_0x2e52ed(0x1fe)](_0x2074d7,_0x1416c9);else{if(isYamlFilePath(_0x562f85))return console['error'](a35_0x4ccb21[_0x2e52ed(0x253)](_0x2e52ed(0x24d))),console[_0x2e52ed(0x254)](_0x2e52ed(0x22d)+_0x562f85),0x1;else _0x9db760=await this['getSQLFromServerSegment'](_0x562f85,_0x1416c9);}return _0x40d557['format']===_0x2e52ed(0x248)||_0x40d557[_0x2e52ed(0x252)]===_0x2e52ed(0x237)?await handleSDKOutput([{'sql':_0x9db760}],_0x40d557):console['log'](_0x9db760),0x0;}catch(_0x158c04){if(_0x158c04 instanceof SDKError)return console[_0x2e52ed(0x254)](_0x2e52ed(0x26b)+_0x158c04['message']),_0x158c04[_0x2e52ed(0x20f)]&&console['error']('\x20\x20Cause:\x20'+_0x158c04[_0x2e52ed(0x20f)]),0x1;throw _0x158c04;}}async[a35_0x4621d9(0x1fe)](_0x447fbd,_0x580cdd){const _0xee5db4=a35_0x4621d9,{options:_0x37003e,tdx:_0x2cf31f}=_0x580cdd;let _0x1d37c7;try{_0x1d37c7=await resolveYamlFilePath(_0x447fbd);}catch(_0x16fc96){throw new SDKError(ErrorCode[_0xee5db4(0x1de)],_0xee5db4(0x245)+_0x16fc96[_0xee5db4(0x256)]);}_0x37003e[_0xee5db4(0x1ee)]&&console[_0xee5db4(0x254)]('Resolved:\x20'+_0x1d37c7[_0xee5db4(0x1ff)]+'/'+_0x1d37c7[_0xee5db4(0x1cb)]);const _0x5eb2fe=await withSpinner(_0xee5db4(0x1dc),()=>_0x2cf31f[_0xee5db4(0x202)][_0xee5db4(0x21e)](_0x1d37c7[_0xee5db4(0x26a)],_0x1d37c7[_0xee5db4(0x1ff)],_0x1d37c7[_0xee5db4(0x1cb)]),{'verbose':_0x37003e[_0xee5db4(0x1ee)]});return _0x5eb2fe[_0xee5db4(0x21a)];}async[a35_0x4621d9(0x22a)](_0x5c98c0,_0x2b8cc1){const _0x38e924=a35_0x4621d9,{options:_0x1b4903,tdx:_0x94449}=_0x2b8cc1,_0x5fe063=_0x1b4903[_0x38e924(0x1ff)],_0x26fb62=await resolveSegmentTarget(_0x5c98c0,_0x5fe063,_0x1b4903[_0x38e924(0x1ee)]);_0x1b4903['verbose']&&console[_0x38e924(0x254)](_0x38e924(0x266)+_0x26fb62);const _0x1e6a51=await withSpinner('Resolving\x20\x27'+_0x5c98c0+_0x38e924(0x1eb),()=>_0x94449[_0x38e924(0x202)]['resolvePathToResource'](_0x26fb62),{'verbose':_0x1b4903[_0x38e924(0x1ee)]}),_0xb30e5b=_0x1e6a51[_0x38e924(0x21a)];_0x1b4903['verbose']&&(console['error'](_0x38e924(0x25d)+_0xb30e5b[_0x38e924(0x223)]),console['error'](_0x38e924(0x1e7)+_0xb30e5b[_0x38e924(0x24a)]));if(_0xb30e5b['type']===_0x38e924(0x1f0))throw new SDKError(ErrorCode[_0x38e924(0x1de)],_0x38e924(0x219));if(_0xb30e5b[_0x38e924(0x223)]===_0x38e924(0x1d2))throw new SDKError(ErrorCode[_0x38e924(0x1de)],_0x38e924(0x258));if(!_0xb30e5b[_0x38e924(0x1d0)])throw new SDKError(ErrorCode[_0x38e924(0x251)],_0x38e924(0x1ed));const _0x3c8660=await withSpinner(_0x38e924(0x1f2),()=>_0x94449['segment']['getSegmentSQL'](_0xb30e5b['parentId'],_0xb30e5b['segmentId']),{'verbose':_0x1b4903['verbose']});return _0x3c8660[_0x38e924(0x21a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x200);[a35_0x4621d9(0x259)]=a35_0x4621d9(0x23b);async[a35_0x4621d9(0x1cc)](_0x4af142){const _0x18f777=a35_0x4621d9,{options:_0x294fdc,args:_0x1816f8,tdx:_0x18a862}=_0x4af142,_0x1792e6=_0x294fdc;if(_0x1816f8[_0x18f777(0x1ce)]<0x2)return console[_0x18f777(0x254)](_0x18f777(0x228)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x18e026=_0x1816f8[0x0],_0x33a6c6=_0x1816f8[0x1];_0x1792e6[_0x18f777(0x1ee)]&&(console[_0x18f777(0x254)]('Site:\x20'+_0x1792e6['site']),console[_0x18f777(0x254)](_0x18f777(0x23e)+_0x18e026),console['error'](_0x18f777(0x1e8)+_0x33a6c6));let _0x753fcf;if(_0x1792e6[_0x18f777(0x23d)]){const _0x18af29=_0x1792e6[_0x18f777(0x23d)],_0xb27d3b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x18e026+_0x18f777(0x1eb),()=>_0x18a862[_0x18f777(0x202)][_0x18f777(0x20a)](_0x18e026),{'verbose':_0x1792e6['verbose']}),_0x1fa838=_0xb27d3b['data'],_0x3d5d42=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x18af29+_0x18f777(0x1eb),()=>_0x18a862[_0x18f777(0x202)][_0x18f777(0x1d7)](_0x1fa838,_0x18af29),{'verbose':_0x1792e6[_0x18f777(0x1ee)]});_0x753fcf=_0x3d5d42[_0x18f777(0x21a)],_0x1792e6[_0x18f777(0x1ee)]&&console[_0x18f777(0x254)](_0x18f777(0x22e)+_0x753fcf);}const _0x2850b3={'name':_0x33a6c6,'description':_0x1792e6[_0x18f777(0x259)],'parentFolderId':_0x753fcf},_0x59abb4=await withSpinner('Creating\x20folder\x20\x27'+_0x33a6c6+_0x18f777(0x1eb),()=>_0x18a862[_0x18f777(0x202)][_0x18f777(0x23a)](_0x18e026,_0x2850b3),{'verbose':_0x1792e6[_0x18f777(0x1ee)]}),_0x33c76d=_0x59abb4['data'];return console[_0x18f777(0x254)](_0x18f777(0x20e)+_0x33c76d[_0x18f777(0x213)]+_0x18f777(0x25b)+_0x33c76d['id']),await handleSDKOutput([_0x33c76d],_0x1792e6),0x0;}}function a35_0x57d9(_0x258c33,_0x1c18b1){_0x258c33=_0x258c33-0x1c2;const _0x5afa06=a35_0x5afa();let _0x57d95d=_0x5afa06[_0x258c33];return _0x57d95d;}export class SegmentViewCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x1cf);[a35_0x4621d9(0x259)]=a35_0x4621d9(0x206);async[a35_0x4621d9(0x1cc)](_0x58eb75){const _0x2febce=a35_0x4621d9,{options:_0x5c3c7b,args:_0x3c8f5c,tdx:_0x3a5351}=_0x58eb75,_0x59bcb1=_0x3c8f5c[0x0];if(!_0x59bcb1)return console[_0x2febce(0x254)](_0x2febce(0x1f3)),console['error'](_0x2febce(0x261)),console[_0x2febce(0x254)](_0x2febce(0x247)),console[_0x2febce(0x254)](_0x2febce(0x208)),console[_0x2febce(0x254)](_0x2febce(0x1d9)),console[_0x2febce(0x254)](_0x2febce(0x21c)),console[_0x2febce(0x254)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x2febce(0x254)](_0x2febce(0x233)),console[_0x2febce(0x254)](_0x2febce(0x1c9)),0x1;try{const _0x5795e6=_0x5c3c7b[_0x2febce(0x1ff)],_0x110951=await resolveSegmentTarget(_0x59bcb1,_0x5795e6,_0x5c3c7b[_0x2febce(0x1ee)]);_0x5c3c7b['verbose']&&console[_0x2febce(0x254)]('Target\x20path:\x20'+_0x110951);const _0x261feb=await withSpinner(_0x2febce(0x267)+_0x59bcb1+_0x2febce(0x1eb),()=>_0x3a5351[_0x2febce(0x202)][_0x2febce(0x1fd)](_0x110951),{'verbose':_0x5c3c7b[_0x2febce(0x1ee)]}),_0xc9aa9=_0x261feb[_0x2febce(0x21a)];_0x5c3c7b[_0x2febce(0x1ee)]&&(console[_0x2febce(0x254)]('Resolved\x20type:\x20'+_0xc9aa9[_0x2febce(0x223)]),console[_0x2febce(0x254)]('Parent\x20ID:\x20'+_0xc9aa9['parentId']),_0xc9aa9[_0x2febce(0x20b)]&&console[_0x2febce(0x254)](_0x2febce(0x1d1)+_0xc9aa9[_0x2febce(0x20b)]),_0xc9aa9[_0x2febce(0x1d0)]&&console[_0x2febce(0x254)](_0x2febce(0x1e2)+_0xc9aa9[_0x2febce(0x1d0)]));if(_0x5c3c7b[_0x2febce(0x235)]){if(_0xc9aa9[_0x2febce(0x223)]==='folder')return console[_0x2febce(0x254)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0xc9aa9[_0x2febce(0x223)]===_0x2febce(0x1d2))return console['error'](_0x2febce(0x217)),console[_0x2febce(0x254)](_0x2febce(0x1e3)),0x1;if(!_0xc9aa9[_0x2febce(0x1d0)])throw new SDKError(ErrorCode[_0x2febce(0x251)],_0x2febce(0x1ed));const _0x391e7c=getConsoleNextUrl(_0x5c3c7b[_0x2febce(0x230)],_0x2febce(0x227)+_0xc9aa9[_0x2febce(0x24a)]+_0x2febce(0x212)+_0xc9aa9[_0x2febce(0x1d0)]);return console[_0x2febce(0x254)](a35_0x4ccb21[_0x2febce(0x21d)]('β')+_0x2febce(0x204)+a35_0x4ccb21[_0x2febce(0x234)](_0x391e7c)),openBrowser(_0x391e7c),0x0;}if(_0xc9aa9[_0x2febce(0x223)]===_0x2febce(0x1f0)){if(!_0xc9aa9[_0x2febce(0x20b)])throw new SDKError(ErrorCode[_0x2febce(0x255)],_0x2febce(0x264));const _0x400c79=await withSpinner(_0x2febce(0x25a),()=>_0x3a5351[_0x2febce(0x202)]['getFolder'](_0xc9aa9['folderId']),{'verbose':_0x5c3c7b['verbose']});await handleSingleObjectOutput(_0x400c79['data'],_0x5c3c7b);}else{if(_0xc9aa9['type']===_0x2febce(0x202)){if(!_0xc9aa9['segmentId'])throw new SDKError(ErrorCode[_0x2febce(0x251)],_0x2febce(0x1ed));const _0x1c3fa1=await withSpinner(_0x2febce(0x216),()=>_0x3a5351['segment'][_0x2febce(0x201)](_0xc9aa9[_0x2febce(0x24a)],_0xc9aa9[_0x2febce(0x1d0)]),{'verbose':_0x5c3c7b[_0x2febce(0x1ee)]}),_0x2cb392=getConsoleNextUrl(_0x5c3c7b[_0x2febce(0x230)],_0x2febce(0x227)+_0xc9aa9['parentId']+_0x2febce(0x212)+_0xc9aa9[_0x2febce(0x1d0)]),_0x1589b1=_0x1c3fa1['data'];_0x1589b1[_0x2febce(0x1f4)]=_0x2cb392,await handleSingleObjectOutput(_0x1589b1,_0x5c3c7b);}else return console[_0x2febce(0x254)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x2febce(0x254)](_0x2febce(0x229)),0x1;}return 0x0;}catch(_0x1b4b49){if(_0x1b4b49 instanceof SDKError)return console['error']('Error:\x20'+_0x1b4b49[_0x2febce(0x256)]),_0x1b4b49[_0x2febce(0x20f)]&&console[_0x2febce(0x254)](_0x2febce(0x20c)+_0x1b4b49['cause']),0x1;throw _0x1b4b49;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x4621d9(0x213)]=a35_0x4621d9(0x24e);['description']=a35_0x4621d9(0x242);async[a35_0x4621d9(0x1cc)](_0x24734c){const _0x3c8082=a35_0x4621d9,{options:_0x21611c,args:_0x475645,tdx:_0x4faa0e}=_0x24734c,_0x5f7002=_0x475645[0x0];if(!_0x5f7002)return console['error'](_0x3c8082(0x226)),console['error'](_0x3c8082(0x21f)),console['error'](_0x3c8082(0x239)),console[_0x3c8082(0x254)](_0x3c8082(0x21c)),console[_0x3c8082(0x254)](_0x3c8082(0x25c)),console['error'](_0x3c8082(0x1d4)),0x1;try{const _0x332e17=_0x21611c[_0x3c8082(0x1ff)],_0x5118f1=await resolveSegmentTarget(_0x5f7002,_0x332e17,_0x21611c[_0x3c8082(0x1ee)]);_0x21611c[_0x3c8082(0x1ee)]&&console['error']('Target\x20path:\x20'+_0x5118f1);const _0x4495e5=await withSpinner(_0x3c8082(0x267)+_0x5f7002+_0x3c8082(0x1eb),()=>_0x4faa0e['segment'][_0x3c8082(0x1fd)](_0x5118f1),{'verbose':_0x21611c[_0x3c8082(0x1ee)]}),_0x109209=_0x4495e5['data'];_0x21611c['verbose']&&(console[_0x3c8082(0x254)](_0x3c8082(0x25d)+_0x109209[_0x3c8082(0x223)]),console[_0x3c8082(0x254)](_0x3c8082(0x1e7)+_0x109209['parentId']));if(_0x109209[_0x3c8082(0x223)]===_0x3c8082(0x1f0))return console[_0x3c8082(0x254)](_0x3c8082(0x25f)),console[_0x3c8082(0x254)](_0x3c8082(0x1f8)),0x1;if(_0x109209[_0x3c8082(0x223)]===_0x3c8082(0x1d2))return console[_0x3c8082(0x254)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3c8082(0x254)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x109209[_0x3c8082(0x1d0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3c8082(0x1ed));const _0x153299=await withSpinner(_0x3c8082(0x1f2),()=>_0x4faa0e[_0x3c8082(0x202)][_0x3c8082(0x1fb)](_0x109209[_0x3c8082(0x24a)],_0x109209['segmentId']),{'verbose':_0x21611c[_0x3c8082(0x1ee)]}),_0xc13d7f=_0x153299[_0x3c8082(0x21a)],_0x35427e=await executeSchemaQuery(_0xc13d7f,_0x4faa0e,_0x21611c);return await handleQueryOutput(_0x35427e,_0x21611c),0x0;}catch(_0x3142fa){if(_0x3142fa instanceof SDKError)return console[_0x3c8082(0x254)](_0x3c8082(0x26b)+_0x3142fa[_0x3c8082(0x256)]),_0x3142fa[_0x3c8082(0x20f)]&&console[_0x3c8082(0x254)]('\x20\x20Cause:\x20'+_0x3142fa[_0x3c8082(0x20f)]),0x1;throw _0x3142fa;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a36_0x4a3f50=a36_0x4397;function a36_0x4397(_0x5f0427,_0x9bd2e1){_0x5f0427=_0x5f0427-0x1d7;const _0x3a5c47=a36_0x3a5c();let _0x439767=_0x3a5c47[_0x5f0427];return _0x439767;}(function(_0x2ef2d5,_0x3e9743){const _0x44803f=a36_0x4397,_0x14d6b5=_0x2ef2d5();while(!![]){try{const _0x5f356a=-parseInt(_0x44803f(0x1e6))/0x1+parseInt(_0x44803f(0x200))/0x2*(parseInt(_0x44803f(0x1d7))/0x3)+-parseInt(_0x44803f(0x1ff))/0x4*(parseInt(_0x44803f(0x1ef))/0x5)+-parseInt(_0x44803f(0x1f7))/0x6+parseInt(_0x44803f(0x1f9))/0x7*(parseInt(_0x44803f(0x1ec))/0x8)+parseInt(_0x44803f(0x1ed))/0x9+parseInt(_0x44803f(0x1e2))/0xa;if(_0x5f356a===_0x3e9743)break;else _0x14d6b5['push'](_0x14d6b5['shift']());}catch(_0x82206e){_0x14d6b5['push'](_0x14d6b5['shift']());}}}(a36_0x3a5c,0x855ea));import{BaseCommand}from'./command.js';function a36_0x3a5c(){const _0x5cd2d0=['116qlrpZv','42748eKBOoC','type','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Creating\x20segment\x20\x27','parent','folder','\x20\x20\x20Path:\x20','Site:\x20','\x27\x20with\x20ID:\x20','β \x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','name','kind','9AaOCQo','folderId','data','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segment','resolveParentId','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Segment\x20name:\x20','createSegment','\x27...','Examples:','1780190zniFwT','error','site','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','588484USPXHK','execute','segmentPath','rule','verbose','Parent\x20path:\x20','28728yUzrfk','7507359XxeFQg','includes','88280XhqTDR','Create\x20child\x20segment\x20with\x20filtering\x20rules','length','Resolved\x20folder\x20ID:\x20','resolveFolderId','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','2523708GgPYjd','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1932htfpwQ','description','segments','Resolving\x20folder\x20path\x20\x27','Resolving\x20folder\x20\x27','yellow'];a36_0x3a5c=function(){return _0x5cd2d0;};return a36_0x3a5c();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x472c9d from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x4a3f50(0x20a)]='segment:create';[a36_0x4a3f50(0x1fa)]=a36_0x4a3f50(0x1f0);async[a36_0x4a3f50(0x1e7)](_0x586942){const _0x535a1e=a36_0x4a3f50;console['error'](a36_0x472c9d[_0x535a1e(0x1fe)](_0x535a1e(0x209))),console[_0x535a1e(0x1e3)](a36_0x472c9d['yellow'](_0x535a1e(0x1e5)));const {options:_0x18484d,args:_0x2b606f,tdx:_0x3bc571}=_0x586942,_0x3a6ef3=_0x18484d;if(_0x2b606f[_0x535a1e(0x1f1)]===0x0)return console[_0x535a1e(0x1e3)](_0x535a1e(0x1f6)),console['error'](_0x535a1e(0x202)),console[_0x535a1e(0x1e3)](_0x535a1e(0x1e1)),console[_0x535a1e(0x1e3)](_0x535a1e(0x1f4)),console['error'](_0x535a1e(0x1dd)),console[_0x535a1e(0x1e3)](_0x535a1e(0x1f8)),0x1;const _0x22a2fd=_0x2b606f[0x0],_0x1b5b1e=_0x18484d[_0x535a1e(0x1e8)];let _0x28834d=_0x22a2fd;_0x1b5b1e&&!_0x22a2fd[_0x535a1e(0x1ee)]('/')&&(_0x28834d=_0x1b5b1e+'/'+_0x22a2fd,_0x3a6ef3[_0x535a1e(0x1ea)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x28834d));const _0xbeac8a=parsePath(_0x28834d);if(_0xbeac8a[_0x535a1e(0x1fb)][_0x535a1e(0x1f1)]<0x2)return console[_0x535a1e(0x1e3)](_0x535a1e(0x1da)),console[_0x535a1e(0x1e3)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x51bf3e=_0xbeac8a[_0x535a1e(0x1fb)][0x0],_0xdb794b=getBaseName(_0x28834d),_0x6369e2=getParentPath(_0x28834d);_0x3a6ef3[_0x535a1e(0x1ea)]&&(console[_0x535a1e(0x1e3)](_0x535a1e(0x207)+_0x3a6ef3[_0x535a1e(0x1e4)]),console[_0x535a1e(0x1e3)]('Target\x20path:\x20'+_0x28834d),console[_0x535a1e(0x1e3)]('Parent:\x20'+_0x51bf3e),console['error'](_0x535a1e(0x1de)+_0xdb794b),console[_0x535a1e(0x1e3)](_0x535a1e(0x1eb)+_0x6369e2));const _0x4fb41b=await withSpinner(_0x535a1e(0x1f5)+_0x51bf3e+_0x535a1e(0x1e0),()=>_0x3bc571[_0x535a1e(0x1db)][_0x535a1e(0x1dc)](_0x51bf3e),{'verbose':_0x3a6ef3[_0x535a1e(0x1ea)]}),_0x49cee0=_0x4fb41b[_0x535a1e(0x1d9)];let _0x5ca556;if(_0xbeac8a[_0x535a1e(0x1fb)][_0x535a1e(0x1f1)]>0x2){const _0x4b40a6=await withSpinner(_0x535a1e(0x1fc)+_0x6369e2+_0x535a1e(0x1e0),()=>_0x3bc571[_0x535a1e(0x1db)]['resolvePathToResource'](_0x6369e2),{'verbose':_0x3a6ef3[_0x535a1e(0x1ea)]}),_0x4e37b4=_0x4b40a6[_0x535a1e(0x1d9)];if(_0x4e37b4[_0x535a1e(0x201)]!==_0x535a1e(0x205)&&_0x4e37b4[_0x535a1e(0x201)]!==_0x535a1e(0x204))return console[_0x535a1e(0x1e3)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x5ca556=_0x4e37b4[_0x535a1e(0x1d8)];}else{if(_0x3a6ef3['folder']){const _0x1ffbc2=await withSpinner(_0x535a1e(0x1fd)+_0x3a6ef3[_0x535a1e(0x205)]+_0x535a1e(0x1e0),()=>_0x3bc571[_0x535a1e(0x1db)][_0x535a1e(0x1f3)](_0x49cee0,_0x3a6ef3[_0x535a1e(0x205)]),{'verbose':_0x3a6ef3[_0x535a1e(0x1ea)]});_0x5ca556=_0x1ffbc2[_0x535a1e(0x1d9)];}}_0x3a6ef3[_0x535a1e(0x1ea)]&&_0x5ca556&&console[_0x535a1e(0x1e3)](_0x535a1e(0x1f2)+_0x5ca556);const _0x5386b9=await loadJSONFromOptions(_0x3a6ef3[_0x535a1e(0x1e9)],_0x3a6ef3['ruleFile']),_0x2ce006={'name':_0xdb794b,'description':_0x3a6ef3[_0x535a1e(0x1fa)],'rule':_0x5386b9,'kind':_0x3a6ef3[_0x535a1e(0x20b)]!==undefined?parseInt(_0x3a6ef3[_0x535a1e(0x20b)],0xa):undefined,'isVisible':_0x3a6ef3['invisible']?![]:undefined,'segmentFolderId':_0x5ca556,'countPopulation':_0x3a6ef3['noCountPopulation']?![]:undefined},_0x194659=await withSpinner(_0x535a1e(0x203)+_0xdb794b+_0x535a1e(0x1e0),()=>_0x3bc571[_0x535a1e(0x1db)][_0x535a1e(0x1df)](_0x49cee0,_0x2ce006),{'verbose':_0x3a6ef3[_0x535a1e(0x1ea)]}),_0x47545d=_0x194659[_0x535a1e(0x1d9)];return console[_0x535a1e(0x1e3)]('β\x20Created\x20segment\x20\x27'+_0x47545d['name']+_0x535a1e(0x208)+_0x47545d['id']),_0x28834d!==_0x22a2fd&&console[_0x535a1e(0x1e3)](_0x535a1e(0x206)+_0x28834d),await handleSDKOutput([_0x47545d],_0x3a6ef3),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x517fde=a37_0x11f3;(function(_0x11f3ae,_0x2a4e84){const _0x20ed8f=a37_0x11f3,_0x428690=_0x11f3ae();while(!![]){try{const _0x2ce9ae=parseInt(_0x20ed8f(0xe8))/0x1+parseInt(_0x20ed8f(0xe0))/0x2*(parseInt(_0x20ed8f(0xdf))/0x3)+-parseInt(_0x20ed8f(0xea))/0x4+-parseInt(_0x20ed8f(0xec))/0x5*(parseInt(_0x20ed8f(0xdb))/0x6)+-parseInt(_0x20ed8f(0xeb))/0x7*(-parseInt(_0x20ed8f(0xda))/0x8)+-parseInt(_0x20ed8f(0xde))/0x9+parseInt(_0x20ed8f(0xe4))/0xa;if(_0x2ce9ae===_0x2a4e84)break;else _0x428690['push'](_0x428690['shift']());}catch(_0x3a70c4){_0x428690['push'](_0x428690['shift']());}}}(a37_0x4f3a,0xeae56));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x11f3(_0x2c87fe,_0x2dbc2e){_0x2c87fe=_0x2c87fe-0xd9;const _0x4f3a20=a37_0x4f3a();let _0x11f311=_0x4f3a20[_0x2c87fe];return _0x11f311;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a37_0x4f3a(){const _0x5d48e4=['1770615ABYsLQ','Site:\x20','3042644WaDmYf','477470ThrmAn','135YudcwN','\x27...','length','name','Listing\x20fields\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','json','verbose','Parent\x20segment:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','listFields','56MVRIVR','25248ocmQlQ','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','description','15439806KlpKQS','192YgSgus','12932GoySeJ','execute','parentSegment','site','8900360VwtQuk','jsonl','\x20field','segment'];a37_0x4f3a=function(){return _0x5d48e4;};return a37_0x4f3a();}export class SegmentFieldsCommand extends BaseCommand{[a37_0x517fde(0xef)]='segment:fields';[a37_0x517fde(0xdd)]=a37_0x517fde(0xf1);async[a37_0x517fde(0xe1)](_0x453790){const _0x1e6853=a37_0x517fde,{options:_0x45d799,args:_0x1fc2a9,tdx:_0x33dbc5}=_0x453790,_0x4fcbad=_0x1fc2a9[0x0]||_0x45d799[_0x1e6853(0xe2)];if(!_0x4fcbad)return console[_0x1e6853(0xf6)](_0x1e6853(0xf5)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x1e6853(0xf6)](_0x1e6853(0xdc)),0x1;_0x45d799['verbose']&&(console[_0x1e6853(0xf6)](_0x1e6853(0xe9)+_0x45d799[_0x1e6853(0xe3)]),console[_0x1e6853(0xf6)](_0x1e6853(0xf4)+_0x4fcbad));const _0x5cac51=await withSpinner(_0x1e6853(0xf0)+_0x4fcbad+_0x1e6853(0xed),()=>_0x33dbc5[_0x1e6853(0xe7)][_0x1e6853(0xd9)](_0x4fcbad),{'verbose':_0x45d799[_0x1e6853(0xf3)]}),_0x2ed0f4=_0x5cac51['data'];console[_0x1e6853(0xf6)]('β\x20Found\x20'+_0x2ed0f4[_0x1e6853(0xee)]+_0x1e6853(0xe6)+(_0x2ed0f4[_0x1e6853(0xee)]!==0x1?'s':''));if(_0x45d799[_0x1e6853(0xf2)]||_0x45d799[_0x1e6853(0xe5)])return await handleSDKOutput(_0x2ed0f4,_0x45d799),0x0;return displayFieldsHumanReadable(_0x2ed0f4,_0x4fcbad),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0xbbfb=a38_0x92c2;function a38_0x52a2(){const _0x3db0f9=['\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','\x20unchanged\x20files','name','repeat','\x20files?','dim','β\x20All\x20files\x20are\x20up\x20to\x20date','\x20activations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aPull\x20summary\x20for\x20\x27','content','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','248UdIXIQ','errorCode','cyan','setPhase','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','diff','16707132fUbFOt','2opAjnR','targetDir','green','segments','3228gKYUwx','\x20\x20π―\x20','Site:\x20','4051245OsReuj','activations','4826130LCitEF','β\x20Pulled\x20','isNew','Target\x20resource:\x20','\x0aChanges\x20to\x20\x27','\x20new\x20files','relativePath','2124AqEVyo','file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','yes','journeys','89061XKYoic','yellow','execute','verbose','files','\x20with\x20','utf-8','\x20versions)','description','helpText','red','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Parent\x20segment:\x20','session','filter','Write\x20','error','\x20=\x20','2483590DVlXsi','segment:pull','6UxHXfj','Pulling\x20segments\x20from\x20\x27','\x20\x20Target:\x20','β\x20Context\x20set:\x20','parent_segment','cwd','9dTEHwC','601309otATXe','length','parentSegment','data','no_parent','Error:\x20','resourceName','dryRun','\x20files\x20to\x20','counts','\x20changed\x20files'];a38_0x52a2=function(){return _0x3db0f9;};return a38_0x52a2();}(function(_0x2a368e,_0x552f4f){const _0x414049=a38_0x92c2,_0x39f2ad=_0x2a368e();while(!![]){try{const _0x12c1ba=parseInt(_0x414049(0x170))/0x1*(-parseInt(_0x414049(0x13f))/0x2)+-parseInt(_0x414049(0x143))/0x3*(-parseInt(_0x414049(0x14f))/0x4)+parseInt(_0x414049(0x167))/0x5*(parseInt(_0x414049(0x169))/0x6)+parseInt(_0x414049(0x154))/0x7*(parseInt(_0x414049(0x138))/0x8)+parseInt(_0x414049(0x16f))/0x9*(parseInt(_0x414049(0x148))/0xa)+parseInt(_0x414049(0x146))/0xb+-parseInt(_0x414049(0x13e))/0xc;if(_0x12c1ba===_0x552f4f)break;else _0x39f2ad['push'](_0x39f2ad['shift']());}catch(_0x559723){_0x39f2ad['push'](_0x39f2ad['shift']());}}}(a38_0x52a2,0x4e151));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a38_0x26adc0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x3e079b from'path';function a38_0x92c2(_0x2a96cf,_0x23dcfd){_0x2a96cf=_0x2a96cf-0x122;const _0x52a26b=a38_0x52a2();let _0x92c226=_0x52a26b[_0x2a96cf];return _0x92c226;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0xbbfb(0x12e)]=a38_0xbbfb(0x168);[a38_0xbbfb(0x15c)]=a38_0xbbfb(0x13c);async[a38_0xbbfb(0x156)](_0x2ef969){const _0x4cdccf=a38_0xbbfb,{options:_0x31c75a,args:_0x2b85b2,tdx:_0x4e085b}=_0x2ef969,_0x1e5fd0=_0x31c75a,_0x43d147=await resolveTarget({'arg':_0x2b85b2[0x0],'contextParent':_0x31c75a[_0x4cdccf(0x122)],'cwd':process[_0x4cdccf(0x16e)]()});if(!isSuccessfulResolution(_0x43d147))return _0x43d147[_0x4cdccf(0x139)]===_0x4cdccf(0x124)?(console[_0x4cdccf(0x165)](a38_0x26adc0[_0x4cdccf(0x155)](_0x4cdccf(0x137))),console[_0x4cdccf(0x165)]('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[_0x4cdccf(0x165)](_0x4cdccf(0x160)),console[_0x4cdccf(0x165)]('\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[_0x4cdccf(0x165)](a38_0x26adc0[_0x4cdccf(0x15e)](_0x4cdccf(0x125)+_0x43d147['message']+'\x0a')),_0x43d147[_0x4cdccf(0x15d)]&&console['error'](a38_0x26adc0[_0x4cdccf(0x13a)](_0x43d147[_0x4cdccf(0x15d)]))),0x1;const _0x3e9399=_0x43d147[_0x4cdccf(0x12c)],_0xaa88a4=_0x43d147[_0x4cdccf(0x140)],_0x1c5fa4=_0x43d147['type']===_0x4cdccf(0x150)?_0x43d147[_0x4cdccf(0x126)]:undefined;_0x1e5fd0['verbose']&&(console['error'](_0x4cdccf(0x145)+_0x1e5fd0['site']),console['error'](_0x4cdccf(0x161)+_0x3e9399),_0x1c5fa4&&console[_0x4cdccf(0x165)](_0x4cdccf(0x14b)+_0x1c5fa4));const _0x4164fa=await withProgressSpinner(_0x4cdccf(0x16a)+_0x3e9399+'\x27...',_0x52d9fa=>_0x4e085b['segment']['pullSegments'](_0x3e9399,{'targetDir':_0xaa88a4,'targetResourceName':_0x1c5fa4,'verbose':_0x1e5fd0['verbose'],'progress':{'update':_0x126ded=>{const _0x1113d8=_0x4cdccf;_0x52d9fa[_0x1113d8(0x13b)](_0x126ded),_0x1e5fd0[_0x1113d8(0x157)]&&console[_0x1113d8(0x165)]('\x20\x20'+_0x126ded);}}}),{'verbose':_0x1e5fd0[_0x4cdccf(0x157)]}),_0x4f613c=_0x4164fa[_0x4cdccf(0x123)];if(_0x4f613c[_0x4cdccf(0x129)]['segments']===0x0&&_0x4f613c[_0x4cdccf(0x129)][_0x4cdccf(0x153)]===0x0)return console[_0x4cdccf(0x165)](a38_0x26adc0['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x4f613c[_0x4cdccf(0x12c)]+'\x27')),0x0;const _0x151353=_0x4f613c[_0x4cdccf(0x158)][_0x4cdccf(0x163)](_0xf4a944=>_0xf4a944[_0x4cdccf(0x14a)]),_0x240d0d=_0x4f613c['files']['filter'](_0xc0a610=>!_0xc0a610[_0x4cdccf(0x14a)]&&_0xc0a610['hasChanges']),_0x2293d6=_0x4f613c[_0x4cdccf(0x158)][_0x4cdccf(0x163)](_0x106c62=>!_0x106c62[_0x4cdccf(0x14a)]&&!_0x106c62[_0x4cdccf(0x15f)]);console['error'](_0x4cdccf(0x135)+_0x4f613c['parentName']+'\x27:'),console[_0x4cdccf(0x165)](_0x4cdccf(0x144)+a38_0x26adc0[_0x4cdccf(0x13a)](_0x4f613c['counts'][_0x4cdccf(0x142)]+'\x20segments')+_0x4cdccf(0x159)+a38_0x26adc0[_0x4cdccf(0x13a)](_0x4f613c[_0x4cdccf(0x129)][_0x4cdccf(0x147)]+_0x4cdccf(0x133)));if(_0x4f613c[_0x4cdccf(0x129)][_0x4cdccf(0x153)]>0x0){const _0x58257d=_0x4f613c[_0x4cdccf(0x129)]['journeyVersions']>_0x4f613c[_0x4cdccf(0x129)][_0x4cdccf(0x153)]?'\x20('+_0x4f613c['counts']['journeyVersions']+_0x4cdccf(0x15b):'';console['error']('\x20\x20πΊοΈ\x20\x20'+a38_0x26adc0['cyan'](_0x4f613c[_0x4cdccf(0x129)][_0x4cdccf(0x153)]+'\x20journeys')+a38_0x26adc0[_0x4cdccf(0x131)](_0x58257d));}console['error']('\x20\x20'+a38_0x26adc0[_0x4cdccf(0x141)]('+\x20'+_0x151353[_0x4cdccf(0x171)]+_0x4cdccf(0x14d))),console[_0x4cdccf(0x165)]('\x20\x20'+a38_0x26adc0[_0x4cdccf(0x155)]('~\x20'+_0x240d0d[_0x4cdccf(0x171)]+_0x4cdccf(0x12a))),console['error']('\x20\x20'+a38_0x26adc0[_0x4cdccf(0x131)]('=\x20'+_0x2293d6[_0x4cdccf(0x171)]+_0x4cdccf(0x12d))),console[_0x4cdccf(0x165)](_0x4cdccf(0x16b)+a38_0x26adc0[_0x4cdccf(0x13a)](_0x4f613c[_0x4cdccf(0x140)])+'\x0a');if(_0x240d0d[_0x4cdccf(0x171)]>0x0)for(const _0x1af0f0 of _0x240d0d){console[_0x4cdccf(0x165)](_0x4cdccf(0x14c)+_0x1af0f0[_0x4cdccf(0x14e)]+'\x27:'),console[_0x4cdccf(0x165)]('β'['repeat'](0x3c)),console[_0x4cdccf(0x165)](_0x1af0f0[_0x4cdccf(0x13d)]),console[_0x4cdccf(0x165)]('β'[_0x4cdccf(0x12f)](0x3c));}if(_0x1e5fd0[_0x4cdccf(0x127)])return console[_0x4cdccf(0x165)](a38_0x26adc0['yellow'](_0x4cdccf(0x12b))),0x0;if(_0x151353[_0x4cdccf(0x171)]===0x0&&_0x240d0d[_0x4cdccf(0x171)]===0x0)return console[_0x4cdccf(0x165)](a38_0x26adc0[_0x4cdccf(0x141)](_0x4cdccf(0x132))),saveSessionContext({'parent_segment':_0x4f613c[_0x4cdccf(0x12c)]},_0x1e5fd0[_0x4cdccf(0x162)]),console[_0x4cdccf(0x165)](a38_0x26adc0[_0x4cdccf(0x141)](_0x4cdccf(0x16c)+a38_0x26adc0[_0x4cdccf(0x131)](_0x4cdccf(0x16d))+_0x4cdccf(0x166)+a38_0x26adc0[_0x4cdccf(0x13a)](_0x4f613c['parentName']))),0x0;if(!_0x1e5fd0[_0x4cdccf(0x152)]){if(!isInteractive())return console['error'](a38_0x26adc0['red']('\x0aError:'),_0x4cdccf(0x134)),console[_0x4cdccf(0x165)](a38_0x26adc0[_0x4cdccf(0x131)](_0x4cdccf(0x151))),0x1;const _0x199cec=await confirmKey(_0x4cdccf(0x164)+(_0x151353[_0x4cdccf(0x171)]+_0x240d0d['length'])+_0x4cdccf(0x130));if(!_0x199cec)return console[_0x4cdccf(0x165)](a38_0x26adc0['yellow']('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x54982d of _0x4f613c[_0x4cdccf(0x158)]){if(_0x54982d['isNew']||_0x54982d['hasChanges']){const _0x2cc27a=a38_0x3e079b['dirname'](_0x54982d['absolutePath']);!existsSync(_0x2cc27a)&&mkdirSync(_0x2cc27a,{'recursive':!![]}),writeFileSync(_0x54982d['absolutePath'],_0x54982d[_0x4cdccf(0x136)],_0x4cdccf(0x15a));}}return console[_0x4cdccf(0x165)](a38_0x26adc0['green'](_0x4cdccf(0x149)+(_0x151353[_0x4cdccf(0x171)]+_0x240d0d['length'])+_0x4cdccf(0x128)+_0x4f613c['targetDir'])),saveSessionContext({'parent_segment':_0x4f613c[_0x4cdccf(0x12c)]},_0x1e5fd0[_0x4cdccf(0x162)]),console['error'](a38_0x26adc0[_0x4cdccf(0x141)](_0x4cdccf(0x16c)+a38_0x26adc0['dim'](_0x4cdccf(0x16d))+_0x4cdccf(0x166)+a38_0x26adc0[_0x4cdccf(0x13a)](_0x4f613c[_0x4cdccf(0x12c)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x3c6822=a39_0x1a44;(function(_0x5937e4,_0x58641a){const _0x4f91c7=a39_0x1a44,_0x417994=_0x5937e4();while(!![]){try{const _0x5617d0=parseInt(_0x4f91c7(0x195))/0x1*(parseInt(_0x4f91c7(0x20a))/0x2)+parseInt(_0x4f91c7(0x1d3))/0x3*(-parseInt(_0x4f91c7(0x1e0))/0x4)+-parseInt(_0x4f91c7(0x194))/0x5*(-parseInt(_0x4f91c7(0x1ba))/0x6)+parseInt(_0x4f91c7(0x198))/0x7+parseInt(_0x4f91c7(0x1cd))/0x8*(parseInt(_0x4f91c7(0x1a0))/0x9)+-parseInt(_0x4f91c7(0x18e))/0xa*(-parseInt(_0x4f91c7(0x181))/0xb)+parseInt(_0x4f91c7(0x185))/0xc*(-parseInt(_0x4f91c7(0x20d))/0xd);if(_0x5617d0===_0x58641a)break;else _0x417994['push'](_0x417994['shift']());}catch(_0x490f9b){_0x417994['push'](_0x417994['shift']());}}}(a39_0x10f9,0x64ca2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x10f9(){const _0x4084c3=['638463tPzUDA','resolveParentId','\x20\x20Activations:\x20','idToName','targetDir','segmentFolderId','\x20\x20\x20\x20','journeys','267048XQFlBA','file','buildUserMaps','no_parent','helpText','endsWith','journeysOnly','created','error','name','Error:\x20','folders','get','/e/','listActivations','Fetching\x20connections\x20for\x20name\x20resolution...','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','New\x20journey:','\x0aError:','type','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeyBundleId','setPhase','getOutputSchemaWithCache','listJourneysWithDetailsFromParentSegment','updatedAt','12AQAyNo','Changes\x20to:','segment','cyan','verbose','.yaml','createdAt','\x20updated','filePath','\x20folders\x20to\x20create','parent_name','Site:\x20','set','push','.yml','\x20to\x20create','blue','listFolders','Changes\x20to\x20journey:','56DbOdgD','cwd','\x20unchanged','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Preparing\x20journeys...','/j/da/je','13938OMBQgK','existingJourney','\x20to\x20update','\x20\x20Activations:','Fetching\x20existing\x20data...','getJourney','red','\x0aValidation\x20failed:','errorCode','connection','execute','\x20YAML\x20files\x20found','yellow','20LfnJBK','parentFolder','Folders\x20to\x20create:','state','parentName','createdSegmentIds','dim','attributes','Resolving\x20parent\x20segment\x20\x27','\x27...','yamlConfig','then','\x20new','Error:\x20Directory\x20not\x20found:\x20','Source\x20directory:\x20','changed','segment:push','isScoped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','toString','\x0aβ\x20Push\x20complete','repeat','Fetching\x20existing\x20activations...','folderId','\x20to\x20delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20created','new','updated','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','message','user','π\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activations','existingSegment','\x20\x20Source:\x20','folderPath','audienceId','toCreate','toDelete','deleted','589714UgmmMF','segments','green','597701iwOzCL','map','isNew','nameToId','Delete\x20segment:','\x20deleted','Parent\x20segment:\x20','parentSegment','Aborted.','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','data','Push\x20','list','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','journeyId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Scoped\x20to\x20folder:\x20','\x20activations]','\x20\x20Segments:\x20','55099eXhbIY','\x20changed','all','\x20\x20π\x20Segments:','468DESKWb','journeyBundleName','join','journey','delete','add','/sb/da/esr','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','unchanged','1260eSqAsU','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','results','description','diff','relationships','1773515uaoXmw','2LqdQSS','/app/ps/','length'];a39_0x10f9=function(){return _0x4084c3;};return a39_0x10f9();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x30ea8b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a39_0x1a44(_0x114171,_0x5e159f){_0x114171=_0x114171-0x174;const _0x10f9da=a39_0x10f9();let _0x1a4434=_0x10f9da[_0x114171];return _0x1a4434;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a39_0x3c6822(0x1a9)]=a39_0x3c6822(0x1f0);['description']=a39_0x3c6822(0x176);async[a39_0x3c6822(0x1dd)](_0x36466b){const _0x3c4aa7=a39_0x3c6822,{options:_0x2853cc,args:_0x338141,tdx:_0xf398e}=_0x36466b,_0x179d89=_0x2853cc,_0x464c7f=await resolveTarget({'arg':_0x338141[0x0],'contextParent':_0x2853cc[_0x3c4aa7(0x174)],'cwd':process[_0x3c4aa7(0x1ce)]()});if(!isSuccessfulResolution(_0x464c7f))return _0x464c7f[_0x3c4aa7(0x1db)]===_0x3c4aa7(0x1a3)?(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x201))),console[_0x3c4aa7(0x1a8)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1f9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1aa)+_0x464c7f[_0x3c4aa7(0x1fe)]+'\x0a')),_0x464c7f[_0x3c4aa7(0x1a4)]&&console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan'](_0x464c7f['helpText']))),0x1;if(_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1c4))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x464c7f[_0x3c4aa7(0x19c)]+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x3c4aa7(0x17a))),0x1;const _0x5e8349=_0x464c7f[_0x3c4aa7(0x1e4)],_0x4469a6=_0x464c7f[_0x3c4aa7(0x19c)],_0x454d92=_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1a1)?_0x464c7f[_0x3c4aa7(0x1c2)]:undefined,_0x5b647d=getScopedDetails(_0x464c7f),_0x5dce64=_0x5b647d?.[_0x3c4aa7(0x1f1)]??![],_0x2d5f09=_0x5b647d?.['scopedFolderPath']??'';if(!existsSync(_0x4469a6))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x4469a6+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x179d89[_0x3c4aa7(0x1be)]&&(console['error'](_0x3c4aa7(0x1c5)+_0x179d89['site']),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x213)+_0x5e8349),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1ee)+_0x4469a6),_0x5dce64&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x17e)+_0x2d5f09));const _0x4d1c8a=await withSpinner(_0x3c4aa7(0x1e8)+_0x5e8349+_0x3c4aa7(0x1e9),()=>_0xf398e[_0x3c4aa7(0x1bc)][_0x3c4aa7(0x199)](_0x5e8349),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]}),_0x27c4c2=_0x4d1c8a[_0x3c4aa7(0x177)],{parentSegmentResult:_0x479604,segmentsResult:_0x120128,foldersResult:_0x231ac7,journeysWithDetailsResult:_0x5e4cb2,userMaps:_0x273183}=await withSpinner(_0x3c4aa7(0x1d7),async()=>{const _0x106810=_0x3c4aa7,[_0x4f476b,_0x5c6e47,_0x9559b7,_0x1dbb01,_0x2c296c]=await Promise[_0x106810(0x183)]([_0xf398e['segment']['getParent'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)]['listSegments'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)][_0x106810(0x1cb)](_0x27c4c2),_0xf398e[_0x106810(0x188)][_0x106810(0x1b8)](_0x27c4c2,{'includeAllVersions':!![]}),_0xf398e['user'][_0x106810(0x1a2)]()]);return{'parentSegmentResult':_0x4f476b,'segmentsResult':_0x5c6e47,'foldersResult':_0x9559b7,'journeysWithDetailsResult':_0x1dbb01,'userMaps':_0x2c296c};},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x2b9c3f=>_0x2b9c3f[_0x3c4aa7(0x177)]),_0x5855f7=_0x479604,_0x5aca44=extractRootFolderId(_0x5855f7),_0x4c50b7=_0x120128,_0x14b404=_0x231ac7,{journeys:_0x4eabf7,activationStepsById:_0x27bad3}=_0x5e4cb2,_0x3e9f46=new Map(_0x4eabf7[_0x3c4aa7(0x20e)](_0x3bbbe7=>[_0x3bbbe7['id'],_0x3bbbe7])),_0x9a09dd=_0x4eabf7[_0x3c4aa7(0x20e)](_0x4ef5fa=>({'id':_0x4ef5fa['id'],'name':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1a9)],'journeyBundleName':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x186)]||'','journeyBundleId':_0x4ef5fa['attributes'][_0x3c4aa7(0x1b5)]||'','versionNumber':_0x4ef5fa[_0x3c4aa7(0x1e7)]['versionNumber'],'description':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x191)],'state':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1e3)],'paused':_0x4ef5fa['attributes']['paused'],'audienceId':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x206)],'folderId':_0x4ef5fa[_0x3c4aa7(0x193)]?.[_0x3c4aa7(0x1e1)]?.[_0x3c4aa7(0x177)]?.['id'],'createdAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1c0)],'updatedAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1b9)]})),{emailToId:_0x1261a0,idToEmail:_0x12e592}=_0x273183,_0x753f53=await withSpinner(_0x3c4aa7(0x1af),async()=>{const _0x42cce1=_0x3c4aa7,_0x1167ae=await _0xf398e[_0x42cce1(0x1dc)][_0x42cce1(0x179)]();return buildConnectionMaps(_0x1167ae);},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x22b705=>_0x22b705[_0x3c4aa7(0x177)]),_0x30d14a=_0x753f53[_0x3c4aa7(0x210)],_0x2eb4a7=_0x753f53[_0x3c4aa7(0x19b)],_0x5c3fbe=_0x753f53['nameToType'],_0x369f1c={'emailToIdMap':_0x1261a0,'connectionNameToIdMap':_0x30d14a,'connectionNameToTypeMap':_0x5c3fbe,'getSchema':_0x3a6f15=>_0xf398e[_0x3c4aa7(0x1dc)][_0x3c4aa7(0x1b7)](_0x3a6f15)};let {pathToId:_0x54cf4a,idToPath:_0x6b7ab2}=buildFolderMaps(_0x14b404);const _0x47f6c8=buildSegmentLookupMap(_0x4c50b7,_0x6b7ab2),_0x3cc844=buildSegmentNameToIdMap(_0x4c50b7),_0x3a2291=buildJourneyBundleLookupMap(_0x9a09dd,_0x6b7ab2);let _0x32aa0d;if(_0x454d92){if(!_0x454d92[_0x3c4aa7(0x1a5)](_0x3c4aa7(0x1c8))&&!_0x454d92['endsWith'](_0x3c4aa7(0x1bf)))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1f2)+_0x454d92+'\x0a')),0x1;_0x32aa0d=[_0x454d92];}else _0x32aa0d=findYamlFiles(_0x4469a6);if(_0x32aa0d['length']===0x0)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x17d)+_0x4469a6+'\x0a')),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1bd)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x25f969,_0x2185ae;try{const _0x29ef6f=parseAndClassifyYamlFiles(_0x32aa0d,_0x4469a6,{'skipSegments':_0x179d89[_0x3c4aa7(0x1a6)]});_0x25f969=_0x29ef6f[_0x3c4aa7(0x20b)],_0x2185ae=_0x29ef6f[_0x3c4aa7(0x19f)];const _0x493b34=validateParsedFiles(_0x29ef6f,_0x4469a6);if(_0x493b34[_0x3c4aa7(0x197)]>0x0)return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1da))),console[_0x3c4aa7(0x1a8)](formatValidationErrors(_0x493b34)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xd0fce6){return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red']('Error\x20parsing\x20YAML:\x20'+(_0xd0fce6 instanceof Error?_0xd0fce6[_0x3c4aa7(0x1fe)]:_0xd0fce6))),0x1;}if(_0x25f969[_0x3c4aa7(0x197)]===0x0&&_0x2185ae[_0x3c4aa7(0x197)]===0x0){const _0x47907a=_0x179d89['journeysOnly']?_0x3c4aa7(0x188):'segment\x20or\x20journey';return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('No\x20'+_0x47907a+_0x3c4aa7(0x1de))),0x0;}const _0x38e917=new Map();_0x4c50b7['length']>0x0&&!_0x179d89['journeysOnly']&&await withSpinner(_0x3c4aa7(0x1f6),async()=>{await batchAsync(_0x4c50b7,async _0x576479=>{const _0x53ebad=a39_0x1a44,_0x571327=await _0xf398e['segment'][_0x53ebad(0x1ae)](_0x27c4c2,_0x576479['id']);_0x38e917[_0x53ebad(0x1c6)](_0x576479['id'],_0x571327);});},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]});const {segmentFiles:_0x5048ac,foldersToCreate:_0xb93ae0}=await prepareSegmentFiles(_0x25f969,{'segmentByFolderAndName':_0x47f6c8,'activationsBySegmentId':_0x38e917,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7},_0x369f1c,_0x5dce64,_0x2d5f09),_0x23a66c=_0x454d92?[]:findSegmentsToDelete(_0x4c50b7,_0x25f969[_0x3c4aa7(0x20e)](({yamlConfig:_0x48815a,folderPath:_0x100306})=>({'yamlConfig':_0x48815a,'folderPath':resolveTDFolderPath(_0x100306,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),{journeyFiles:_0x26dfdc,foldersToCreate:_0xa528b0}=await withProgressSpinner(_0x3c4aa7(0x1d1),async _0x23e92b=>prepareJourneyFiles(_0x2185ae,{'fetchJourney':async _0x5fa5e2=>_0xf398e[_0x3c4aa7(0x188)][_0x3c4aa7(0x1d8)](_0x5fa5e2[_0x3c4aa7(0x17c)]),'journeyBundlesByFolderAndName':_0x3a2291,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7,'existingSegments':_0x4c50b7,'parentId':_0x27c4c2,'deps':_0xf398e,'progress':{'update':_0x35f932=>{const _0x13f785=_0x3c4aa7;_0x23e92b[_0x13f785(0x1b6)](_0x35f932),_0x179d89[_0x13f785(0x1be)]&&console[_0x13f785(0x1a8)]('\x20\x20'+_0x35f932);}},'journeyById':_0x3e9f46,'activationStepsById':_0x27bad3},_0x5dce64,_0x2d5f09),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0xa07a6c=>_0xa07a6c[_0x3c4aa7(0x177)]);for(const _0x45e717 of _0xa528b0){_0xb93ae0[_0x3c4aa7(0x18a)](_0x45e717);}const _0x2be252=_0x454d92?[]:findJourneysToDelete(_0x9a09dd,_0x2185ae[_0x3c4aa7(0x20e)](({yamlConfig:_0x23d3a8,folderPath:_0x513c5a})=>({'yamlConfig':_0x23d3a8,'folderPath':resolveTDFolderPath(_0x513c5a,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),_0x492beb=calculatePushStats(_0x5048ac,_0x26dfdc,_0xb93ae0,_0x23a66c,_0x2be252,!!_0x179d89['delete'],!!_0x179d89[_0x3c4aa7(0x1a6)]),_0x4db57f=_0x492beb[_0x3c4aa7(0x20b)]['new'],_0x290ab9=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x1ef)],_0x3dd41f=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x18d)],_0x41f115=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x208)],_0x465414=_0x492beb[_0x3c4aa7(0x1ab)][_0x3c4aa7(0x207)],_0x59a7d4=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x1fb)],_0x4a9f7f=_0x492beb['journeys'][_0x3c4aa7(0x1ef)],_0x13e9a8=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x18d)],_0x3beed2=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x208)],_0x478817=_0x492beb[_0x3c4aa7(0x202)]['all'],_0x3a079c=_0x492beb['activations'][_0x3c4aa7(0x207)],_0x2161a4=_0x492beb['activations']['toUpdate'],_0x151d9f=_0x492beb[_0x3c4aa7(0x202)][_0x3c4aa7(0x208)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x5e8349+'\x27:');_0x465414[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1ca)](_0x3c4aa7(0x200)+_0x465414[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c3)));if(!_0x179d89[_0x3c4aa7(0x1a6)]){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x184)),console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x4db57f['length']+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x290ab9[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x41f115[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x41f115[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x23a66c[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x23a66c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1fd)));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x3dd41f['length']+_0x3c4aa7(0x1cf)));}if(_0x26dfdc['length']>0x0||_0x2be252[_0x3c4aa7(0x197)]>0x0){console['error']('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x59a7d4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x3beed2[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b['red']('-\x20'+_0x3beed2[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x2be252['length']>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x2be252['length']+_0x3c4aa7(0x1fd)));console['error']('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x13e9a8[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1cf)));}_0x478817[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&(console['error'](''),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1d6)),_0x3a079c[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x3a079c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c9))),_0x2161a4[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x2161a4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1d5))),_0x151d9f[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x151d9f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8))));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x204)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x4469a6)+'\x0a');if(_0x465414[_0x3c4aa7(0x197)]>0x0){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1e2));for(const _0x530495 of _0x465414){console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['blue']('+')+'\x20'+_0x530495);}console['error']('');}if(_0x4db57f[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x459d8a of _0x4db57f){const _0x486aeb=_0x459d8a[_0x3c4aa7(0x205)]?_0x459d8a[_0x3c4aa7(0x205)]+'/'+_0x459d8a['yamlConfig'][_0x3c4aa7(0x1a9)]:_0x459d8a[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)],_0xefa5a6=_0x459d8a[_0x3c4aa7(0x1ea)]['activations']?.[_0x3c4aa7(0x197)]||0x0,_0x1e7f61=_0xefa5a6>0x0?a39_0x30ea8b[_0x3c4aa7(0x1e6)]('\x20['+_0xefa5a6+_0x3c4aa7(0x17f)):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('New\x20segment:')+'\x20'+_0x486aeb+_0x1e7f61),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c)),_0x459d8a[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x459d8a['diff']),console[_0x3c4aa7(0x1a8)]('β'['repeat'](0x3c));}if(_0x41f115[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x37f245 of _0x41f115){const _0x342106=_0x37f245[_0x3c4aa7(0x19d)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x37f245[_0x3c4aa7(0x19d)][_0x3c4aa7(0x1f3)]())||'':'',_0x53db03=_0x342106?_0x342106+'/'+_0x37f245[_0x3c4aa7(0x1a9)]:_0x37f245['name'],_0x4e10ed=_0x38e917['get'](_0x37f245['id'])||[],_0x59de94=_0x4e10ed['length']>0x0?a39_0x30ea8b['dim']('\x20['+_0x4e10ed[_0x3c4aa7(0x197)]+'\x20activations]'):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red'](_0x3c4aa7(0x211))+'\x20'+_0x53db03+_0x59de94),console['error']('β'['repeat'](0x3c));const _0x157d59=segmentWithActivationsToYaml(_0x37f245,_0x4e10ed,undefined,_0x12e592,_0x2eb4a7),_0x1a8611=segmentToYamlString(_0x157d59),_0xf20e40=generateDiff(_0x1a8611,'');console[_0x3c4aa7(0x1a8)](formatDiffWithColors(_0xf20e40)),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3f4ff6=_0x5048ac['filter'](_0x55b131=>!_0x55b131['isNew']&&_0x55b131[_0x3c4aa7(0x192)]);if(_0x3f4ff6[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x59fccd of _0x3f4ff6){const _0x26de66=_0x59fccd['folderPath']?_0x59fccd[_0x3c4aa7(0x205)]+'/'+_0x59fccd[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x59fccd[_0x3c4aa7(0x1ea)]['name'];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1bb))+'\x20'+_0x26de66),console[_0x3c4aa7(0x1a8)]('β'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x59fccd[_0x3c4aa7(0x192)]),console['error']('β'[_0x3c4aa7(0x1f5)](0x3c));}if(_0x59a7d4[_0x3c4aa7(0x197)]>0x0)for(const _0x5d0cfb of _0x59a7d4){const _0x3d03bf=_0x5d0cfb[_0x3c4aa7(0x205)]?_0x5d0cfb[_0x3c4aa7(0x205)]+'/'+_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x3c4aa7(0x1b1))+'\x20'+_0x3d03bf),console['error']('β'['repeat'](0x3c)),_0x5d0cfb[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x5d0cfb[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3d646d=_0x26dfdc['filter'](_0x40ccfa=>!_0x40ccfa[_0x3c4aa7(0x20f)]&&_0x40ccfa[_0x3c4aa7(0x192)]);if(_0x3d646d['length']>0x0)for(const _0x5582e0 of _0x3d646d){const _0x3f1f83=_0x5582e0[_0x3c4aa7(0x205)]?_0x5582e0[_0x3c4aa7(0x205)]+'/'+_0x5582e0[_0x3c4aa7(0x1ea)]['name']:_0x5582e0[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1cc))+'\x20'+_0x3f1f83),console['error']('β'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x5582e0[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('β'['repeat'](0x3c));}if(_0x3beed2['length']>0x0)for(const _0x4f01d4 of _0x3beed2){const _0x55390f=_0x4f01d4[_0x3c4aa7(0x1f7)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x4f01d4['folderId'])||'':'',_0x124cbe=_0x55390f?_0x55390f+'/'+_0x4f01d4['journeyBundleName']:_0x4f01d4[_0x3c4aa7(0x186)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red']('Delete\x20journey:')+'\x20'+_0x124cbe),console[_0x3c4aa7(0x1a8)]('β'[_0x3c4aa7(0x1f5)](0x3c)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('(Journey\x20will\x20be\x20deleted)')),console['error']('β'['repeat'](0x3c));}if(_0x179d89['dryRun'])return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x596dfa=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x4db57f[_0x3c4aa7(0x197)]>0x0||_0x290ab9['length']>0x0||_0x41f115[_0x3c4aa7(0x197)]>0x0,_0x3fbf21=_0x59a7d4[_0x3c4aa7(0x197)]>0x0||_0x4a9f7f[_0x3c4aa7(0x197)]>0x0||_0x3beed2['length']>0x0,_0xde3d5d=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x478817[_0x3c4aa7(0x197)]>0x0,_0x33ef64=_0x465414['length']>0x0;if(!_0x596dfa&&!_0x3fbf21&&!_0xde3d5d&&!_0x33ef64){const _0x4f6182=_0x179d89[_0x3c4aa7(0x1a6)]?'β\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x3c4aa7(0x1b4);console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x4f6182));if(_0x454d92&&_0x3dd41f[_0x3c4aa7(0x197)]===0x1){const _0x272ed8=_0x3dd41f[0x0];if(_0x272ed8[_0x3c4aa7(0x203)]?.['id']){const _0x376c52=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x272ed8[_0x3c4aa7(0x203)]['id']+_0x3c4aa7(0x18b));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x18c)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x376c52));}}if(_0x454d92&&_0x13e9a8['length']===0x1){const _0x3600ca=_0x13e9a8[0x0];if(_0x3600ca[_0x3c4aa7(0x1d4)]?.['id']){const _0x36a041=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],'/app/ps/'+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x3600ca['existingJourney']['id']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x36a041));}}return 0x0;}const _0x274e38=_0x179d89[_0x3c4aa7(0x1a6)]?_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3beed2[_0x3c4aa7(0x197)]+_0x465414[_0x3c4aa7(0x197)]:_0x4db57f[_0x3c4aa7(0x197)]+_0x290ab9[_0x3c4aa7(0x197)]+_0x41f115[_0x3c4aa7(0x197)]+_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f['length']+_0x3beed2['length']+_0x465414[_0x3c4aa7(0x197)]+_0x478817[_0x3c4aa7(0x197)];if(!_0x179d89['yes']&&_0x274e38>0x0){if(!isInteractive())return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red'](_0x3c4aa7(0x1b2)),_0x3c4aa7(0x18f)),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x3c4aa7(0x1d0))),0x1;const _0x4dbcf1=await confirmKey(_0x3c4aa7(0x178)+_0x274e38+'\x20changes?');if(!_0x4dbcf1)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x175))),0x1;}const _0x566d57={'withProgress':async(_0x2af465,_0x3a4d73)=>{const _0xa2ee3=_0x3c4aa7,_0x463693=await withSpinner(_0x2af465,_0x3a4d73,{'verbose':_0x179d89[_0xa2ee3(0x1be)]});return{'data':_0x463693[_0xa2ee3(0x177)]};},'logInfo':_0x138d6b=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1ca)]('β\x20'+_0x138d6b)),'logSuccess':_0xf4cf46=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green']('β\x20'+_0xf4cf46)),'logWarning':_0x378e24=>console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('β \x20'+_0x378e24)),'logDeleted':_0x189591=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('β\x20'+_0x189591))},_0x188bb5={'segment':_0xf398e[_0x3c4aa7(0x1bc)],'journey':_0xf398e['journey'],'user':_0xf398e[_0x3c4aa7(0x1ff)],'connection':_0xf398e[_0x3c4aa7(0x1dc)]};_0x465414[_0x3c4aa7(0x197)]>0x0&&(_0x54cf4a=await executePushFolders(_0x188bb5,_0x465414,_0x54cf4a,{'parentId':_0x27c4c2},_0x566d57));const _0x127846={'rootFolderId':_0x5aca44,'folderPathToId':_0x54cf4a,'folderIdToPath':_0x6b7ab2,'segmentNameToId':_0x3cc844,'activationsBySegmentId':_0x38e917,'emailToIdMap':_0x1261a0,'idToEmailMap':_0x12e592,'connectionNameToIdMap':_0x753f53[_0x3c4aa7(0x210)],'connectionIdToNameMap':_0x753f53['idToName'],'connectionNameToTypeMap':_0x5c3fbe},_0x299271=await executePushSegments(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x5048ac,_0x127846,{'parentId':_0x27c4c2},_0x566d57),_0x34ecdc=_0x299271[_0x3c4aa7(0x1a7)],_0x227240=_0x299271[_0x3c4aa7(0x1fc)],_0x30c76a=_0x299271[_0x3c4aa7(0x202)]['created'],_0x25ac52=_0x299271[_0x3c4aa7(0x202)][_0x3c4aa7(0x1fc)],_0x336ae2=_0x299271['activations'][_0x3c4aa7(0x209)];let _0x142598;if(_0x454d92&&_0x5048ac['length']===0x1){const _0x108c69=_0x5048ac[0x0];_0x142598=_0x108c69[_0x3c4aa7(0x203)]?.['id']??_0x299271[_0x3c4aa7(0x1e5)][_0x3c4aa7(0x1ac)](_0x108c69[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]);}const _0x3c32db=await executePushSegmentDeletions(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x41f115,_0x566d57);let _0x3b56eb=0x0,_0x2fb9fa=0x0,_0x5b59bb=0x0;const _0x1e9df6=new Map(_0x3cc844);for(const [_0x596406,_0x4c9901]of _0x299271[_0x3c4aa7(0x1e5)]){_0x1e9df6[_0x3c4aa7(0x1c6)](_0x596406,_0x4c9901);}if(_0x26dfdc[_0x3c4aa7(0x197)]>0x0){const _0x405402={..._0x127846,'segmentNameToId':_0x1e9df6,'existingSegments':_0x4c50b7,'activationContext':_0x369f1c},_0x5a442c=await executePushJourneys(_0x188bb5,_0x26dfdc,_0x405402,{'parentId':_0x27c4c2,'rootFolderId':_0x5aca44,'verbose':_0x179d89[_0x3c4aa7(0x1be)]},_0x566d57);_0x3b56eb=_0x5a442c[_0x3c4aa7(0x1a7)],_0x2fb9fa=_0x5a442c[_0x3c4aa7(0x1fc)];if(_0x454d92&&_0x5a442c[_0x3c4aa7(0x190)][_0x3c4aa7(0x197)]===0x1){const _0x58b955=_0x5a442c[_0x3c4aa7(0x190)][0x0];if(_0x58b955[_0x3c4aa7(0x17c)]){const _0x3b339b=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x58b955['journeyId']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['cyan'](_0x3b339b));}}}for(const _0x5501d7 of _0x3beed2){console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1b0)+_0x5501d7[_0x3c4aa7(0x186)])),_0x5b59bb++;}const _0x32d2c5=[];if(_0x34ecdc>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x34ecdc+_0x3c4aa7(0x1fa));if(_0x227240>0x0)_0x32d2c5['push'](_0x227240+_0x3c4aa7(0x1c1));if(_0x3c32db>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x3c32db+_0x3c4aa7(0x212));const _0x17af64=[];if(_0x3b56eb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x3b56eb+_0x3c4aa7(0x1fa));if(_0x2fb9fa>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x2fb9fa+_0x3c4aa7(0x1c1));if(_0x5b59bb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x5b59bb+_0x3c4aa7(0x212));const _0x1073de=[];if(_0x30c76a>0x0)_0x1073de['push'](_0x30c76a+_0x3c4aa7(0x1fa));if(_0x25ac52>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x25ac52+_0x3c4aa7(0x1c1));if(_0x336ae2>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x336ae2+_0x3c4aa7(0x212));console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green'](_0x3c4aa7(0x1f4)));_0x32d2c5[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x180)+_0x32d2c5[_0x3c4aa7(0x187)](',\x20'));_0x17af64[_0x3c4aa7(0x197)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x17af64[_0x3c4aa7(0x187)](',\x20'));_0x1073de[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19a)+_0x1073de[_0x3c4aa7(0x187)](',\x20'));if(_0x142598){const _0x34b8d2=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x142598+_0x3c4aa7(0x18b));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x34b8d2));}return 0x0;}}
|
|
1
|
+
const a39_0x59ecd1=a39_0x123e;function a39_0x123e(_0x2fa279,_0x26abaa){_0x2fa279=_0x2fa279-0x12c;const _0x234140=a39_0x2341();let _0x123edb=_0x234140[_0x2fa279];return _0x123edb;}(function(_0x54c883,_0x1cd403){const _0x4600ea=a39_0x123e,_0x171c65=_0x54c883();while(!![]){try{const _0x4c0157=parseInt(_0x4600ea(0x176))/0x1*(parseInt(_0x4600ea(0x1b3))/0x2)+-parseInt(_0x4600ea(0x133))/0x3+-parseInt(_0x4600ea(0x18a))/0x4*(parseInt(_0x4600ea(0x185))/0x5)+parseInt(_0x4600ea(0x18e))/0x6*(-parseInt(_0x4600ea(0x172))/0x7)+parseInt(_0x4600ea(0x156))/0x8*(parseInt(_0x4600ea(0x184))/0x9)+-parseInt(_0x4600ea(0x16a))/0xa*(-parseInt(_0x4600ea(0x13a))/0xb)+parseInt(_0x4600ea(0x1ae))/0xc;if(_0x4c0157===_0x1cd403)break;else _0x171c65['push'](_0x171c65['shift']());}catch(_0x2d6954){_0x171c65['push'](_0x171c65['shift']());}}}(a39_0x2341,0x544d9));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x2341(){const _0x4e576b=['updatedAt','Source\x20directory:\x20','listFolders','Parent\x20segment:\x20','No\x20','toUpdate','Folders\x20to\x20create:','buildUserMaps','verbose','cyan','/j/da/je','cwd','user','parentFolder','results','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','data','idToName','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','audienceId','targetDir','1948086NrNrdd','\x20to\x20update','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','type','updated','nameToId','toDelete','1496pNYqxO','yes','segment:push','join','Scoped\x20to\x20folder:\x20','diff','add','activations','changed','name','folderPath','/app/ps/','\x20folders\x20to\x20create','.yml','nameToType','created','endsWith','journeys','get','versionNumber','error','length','existingJourney','\x20created','journeyBundleId','/sb/da/esr','relationships','yamlConfig','472wyoNjg','Changes\x20to\x20journey:','journeyId','Site:\x20','journeyBundleName','.yaml','\x20updated','\x20to\x20create','toCreate','all','then','parentName','scopedFolderPath','β \x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','π\x20','repeat','/e/','\x20deleted','resolveParentId','\x20\x20\x20\x20','41770XMehzG','folderId','\x20YAML\x20files\x20found','yellow','Fetching\x20existing\x20activations...','\x20\x20Source:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','dim','7DBOsOA','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aError:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','404134MXPMti','folders','parent_name','filePath','getParent','unchanged','description','red','list','helpText','message','segment','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','setPhase','98019SulmLA','40HmAjhk','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','blue','site','Fetching\x20existing\x20data...','279176UcEbBJ','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','set','createdSegmentIds','2765442MYLNen','attributes','segmentFolderId','New\x20journey:','delete','\x27...','β\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20new','\x0aβ\x20Push\x20complete','push','\x20unchanged','isNew','Push\x20','\x0aPush\x20summary\x20for\x20\x27','Preparing\x20journeys...','no_parent','new','\x20\x20π\x20Segments:','connection','parentSegment','Error:\x20Directory\x20not\x20found:\x20','New\x20segment:','state','segments','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeysOnly','listSegments','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)','\x20activations]','green','paused','Aborted.','4789812tgrJGq','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','map','existingSegment','Error\x20parsing\x20YAML:\x20','2RWDTLJ','\x20\x20Activations:','\x20to\x20delete','file','errorCode','filter','listActivations','\x20\x20Activations:\x20'];a39_0x2341=function(){return _0x4e576b;};return a39_0x2341();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x65df35 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{['name']=a39_0x59ecd1(0x13c);[a39_0x59ecd1(0x17c)]=a39_0x59ecd1(0x175);async['execute'](_0x540c24){const _0x5777b5=a39_0x59ecd1,{options:_0x1dea35,args:_0x183cae,tdx:_0x57c4e9}=_0x540c24,_0x4aed5d=_0x1dea35,_0xe9ab67=await resolveTarget({'arg':_0x183cae[0x0],'contextParent':_0x1dea35[_0x5777b5(0x1a1)],'cwd':process[_0x5777b5(0x1c6)]()});if(!isSuccessfulResolution(_0xe9ab67))return _0xe9ab67[_0x5777b5(0x1b7)]===_0x5777b5(0x19d)?(console[_0x5777b5(0x14e)](a39_0x65df35['yellow'](_0x5777b5(0x12c))),console['error'](_0x5777b5(0x1a9)),console[_0x5777b5(0x14e)](_0x5777b5(0x135)),console[_0x5777b5(0x14e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x5777b5(0x14e)](a39_0x65df35['red']('Error:\x20'+_0xe9ab67[_0x5777b5(0x180)]+'\x0a')),_0xe9ab67[_0x5777b5(0x17f)]&&console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x1c4)](_0xe9ab67[_0x5777b5(0x17f)]))),0x1;if(_0xe9ab67[_0x5777b5(0x136)]===_0x5777b5(0x178))return console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)](_0x5777b5(0x1a2)+_0xe9ab67[_0x5777b5(0x132)]+'\x0a')),console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x1c4)](_0x5777b5(0x170))),0x1;const _0x504f37=_0xe9ab67[_0x5777b5(0x161)],_0x92658f=_0xe9ab67[_0x5777b5(0x132)],_0xcb3292=_0xe9ab67['type']===_0x5777b5(0x1b6)?_0xe9ab67[_0x5777b5(0x179)]:undefined,_0x330a2e=getScopedDetails(_0xe9ab67),_0x448361=_0x330a2e?.['isScoped']??![],_0x351e8e=_0x330a2e?.[_0x5777b5(0x162)]??'';if(!existsSync(_0x92658f))return console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)](_0x5777b5(0x1a2)+_0x92658f+'\x0a')),console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x1c4)](_0x5777b5(0x170))),0x1;_0x4aed5d[_0x5777b5(0x1c3)]&&(console[_0x5777b5(0x14e)](_0x5777b5(0x159)+_0x4aed5d['site']),console[_0x5777b5(0x14e)](_0x5777b5(0x1be)+_0x504f37),console[_0x5777b5(0x14e)](_0x5777b5(0x1bc)+_0x92658f),_0x448361&&console[_0x5777b5(0x14e)](_0x5777b5(0x13e)+_0x351e8e));const _0x5aca0f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x504f37+_0x5777b5(0x193),()=>_0x57c4e9[_0x5777b5(0x181)][_0x5777b5(0x168)](_0x504f37),{'verbose':_0x4aed5d[_0x5777b5(0x1c3)]}),_0x5d9c49=_0x5aca0f['data'],{parentSegmentResult:_0x5db243,segmentsResult:_0x5b263b,foldersResult:_0x4f2995,journeysWithDetailsResult:_0xa7d0bc,userMaps:_0x1ac019}=await withSpinner(_0x5777b5(0x189),async()=>{const _0x4ec195=_0x5777b5,[_0x2ad7b5,_0xa1797,_0x53f3cd,_0x2b52eb,_0x17a2be]=await Promise[_0x4ec195(0x15f)]([_0x57c4e9[_0x4ec195(0x181)][_0x4ec195(0x17a)](_0x5d9c49),_0x57c4e9['segment'][_0x4ec195(0x1a8)](_0x5d9c49),_0x57c4e9[_0x4ec195(0x181)][_0x4ec195(0x1bd)](_0x5d9c49),_0x57c4e9['journey']['listJourneysWithDetailsFromParentSegment'](_0x5d9c49,{'includeAllVersions':!![]}),_0x57c4e9[_0x4ec195(0x1c7)][_0x4ec195(0x1c2)]()]);return{'parentSegmentResult':_0x2ad7b5,'segmentsResult':_0xa1797,'foldersResult':_0x53f3cd,'journeysWithDetailsResult':_0x2b52eb,'userMaps':_0x17a2be};},{'verbose':_0x4aed5d['verbose']})['then'](_0x41ee82=>_0x41ee82[_0x5777b5(0x12d)]),_0x18a43e=_0x5db243,_0x81b254=extractRootFolderId(_0x18a43e),_0x2ae601=_0x5b263b,_0x559758=_0x4f2995,{journeys:_0x429c6d,activationStepsById:_0x23f896}=_0xa7d0bc,_0x3f982a=new Map(_0x429c6d['map'](_0x293f08=>[_0x293f08['id'],_0x293f08])),_0x238027=_0x429c6d[_0x5777b5(0x1b0)](_0x38fbb7=>({'id':_0x38fbb7['id'],'name':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x143)],'journeyBundleName':_0x38fbb7['attributes'][_0x5777b5(0x15a)]||'','journeyBundleId':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x152)]||'','versionNumber':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x14d)],'description':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x17c)],'state':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x1a4)],'paused':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x1ac)],'audienceId':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x131)],'folderId':_0x38fbb7[_0x5777b5(0x154)]?.[_0x5777b5(0x1c8)]?.[_0x5777b5(0x12d)]?.['id'],'createdAt':_0x38fbb7[_0x5777b5(0x18f)]['createdAt'],'updatedAt':_0x38fbb7[_0x5777b5(0x18f)][_0x5777b5(0x1bb)]})),{emailToId:_0x1435a9,idToEmail:_0x19058f}=_0x1ac019,_0x24774f=await withSpinner(_0x5777b5(0x173),async()=>{const _0x292b02=_0x5777b5,_0x3c8540=await _0x57c4e9['connection'][_0x292b02(0x17e)]();return buildConnectionMaps(_0x3c8540);},{'verbose':_0x4aed5d[_0x5777b5(0x1c3)]})['then'](_0xb8b2a5=>_0xb8b2a5[_0x5777b5(0x12d)]),_0x7a1004=_0x24774f[_0x5777b5(0x138)],_0x509c91=_0x24774f[_0x5777b5(0x12e)],_0x595b16=_0x24774f[_0x5777b5(0x148)],_0x53c557={'emailToIdMap':_0x1435a9,'connectionNameToIdMap':_0x7a1004,'connectionNameToTypeMap':_0x595b16,'getSchema':_0x539e5b=>_0x57c4e9['connection']['getOutputSchemaWithCache'](_0x539e5b)};let {pathToId:_0x30b019,idToPath:_0x521e0d}=buildFolderMaps(_0x559758);const _0x2e32ec=buildSegmentLookupMap(_0x2ae601,_0x521e0d),_0x12b666=buildSegmentNameToIdMap(_0x2ae601),_0x1305a3=buildJourneyBundleLookupMap(_0x238027,_0x521e0d);let _0x7a69b8;if(_0xcb3292){if(!_0xcb3292[_0x5777b5(0x14a)](_0x5777b5(0x147))&&!_0xcb3292[_0x5777b5(0x14a)](_0x5777b5(0x15b)))return console['error'](a39_0x65df35[_0x5777b5(0x17d)](_0x5777b5(0x1a6)+_0xcb3292+'\x0a')),0x1;_0x7a69b8=[_0xcb3292];}else _0x7a69b8=findYamlFiles(_0x92658f);if(_0x7a69b8[_0x5777b5(0x14f)]===0x0)return console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x92658f+'\x0a')),console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x1c4)](_0x5777b5(0x18b))),0x1;let _0x563b31,_0x199036;try{const _0xf1bc69=parseAndClassifyYamlFiles(_0x7a69b8,_0x92658f,{'skipSegments':_0x4aed5d[_0x5777b5(0x1a7)]});_0x563b31=_0xf1bc69[_0x5777b5(0x1a5)],_0x199036=_0xf1bc69[_0x5777b5(0x14b)];const _0x754012=validateParsedFiles(_0xf1bc69,_0x92658f);if(_0x754012[_0x5777b5(0x14f)]>0x0)return console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x754012)),console['error'](a39_0x65df35[_0x5777b5(0x16d)](_0x5777b5(0x1af))),0x1;}catch(_0x73a149){return console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)](_0x5777b5(0x1b2)+(_0x73a149 instanceof Error?_0x73a149[_0x5777b5(0x180)]:_0x73a149))),0x1;}if(_0x563b31[_0x5777b5(0x14f)]===0x0&&_0x199036[_0x5777b5(0x14f)]===0x0){const _0x499cea=_0x4aed5d['journeysOnly']?'journey':'segment\x20or\x20journey';return console['error'](a39_0x65df35[_0x5777b5(0x16d)](_0x5777b5(0x1bf)+_0x499cea+_0x5777b5(0x16c))),0x0;}const _0x57f350=new Map();_0x2ae601[_0x5777b5(0x14f)]>0x0&&!_0x4aed5d[_0x5777b5(0x1a7)]&&await withSpinner(_0x5777b5(0x16e),async()=>{await batchAsync(_0x2ae601,async _0x3b9a25=>{const _0x3bfc62=a39_0x123e,_0x267239=await _0x57c4e9[_0x3bfc62(0x181)][_0x3bfc62(0x1b9)](_0x5d9c49,_0x3b9a25['id']);_0x57f350[_0x3bfc62(0x18c)](_0x3b9a25['id'],_0x267239);});},{'verbose':_0x4aed5d[_0x5777b5(0x1c3)]});const {segmentFiles:_0x15e567,foldersToCreate:_0x8ec863}=await prepareSegmentFiles(_0x563b31,{'segmentByFolderAndName':_0x2e32ec,'activationsBySegmentId':_0x57f350,'folderPathToId':_0x30b019,'idToEmailMap':_0x19058f,'connectionIdToNameMap':_0x509c91},_0x53c557,_0x448361,_0x351e8e),_0x534342=_0xcb3292?[]:findSegmentsToDelete(_0x2ae601,_0x563b31[_0x5777b5(0x1b0)](({yamlConfig:_0x115992,folderPath:_0x155d1a})=>({'yamlConfig':_0x115992,'folderPath':resolveTDFolderPath(_0x155d1a,_0x448361,_0x351e8e)})),_0x521e0d,_0x351e8e,_0x448361),{journeyFiles:_0x52391b,foldersToCreate:_0xbf5004}=await withProgressSpinner(_0x5777b5(0x19c),async _0x34c370=>prepareJourneyFiles(_0x199036,{'fetchJourney':async _0x17c0c9=>_0x57c4e9['journey']['getJourney'](_0x17c0c9[_0x5777b5(0x158)]),'journeyBundlesByFolderAndName':_0x1305a3,'folderPathToId':_0x30b019,'idToEmailMap':_0x19058f,'connectionIdToNameMap':_0x509c91,'existingSegments':_0x2ae601,'parentId':_0x5d9c49,'deps':_0x57c4e9,'progress':{'update':_0x17bada=>{const _0x253977=_0x5777b5;_0x34c370[_0x253977(0x183)](_0x17bada),_0x4aed5d['verbose']&&console[_0x253977(0x14e)]('\x20\x20'+_0x17bada);}},'journeyById':_0x3f982a,'activationStepsById':_0x23f896},_0x448361,_0x351e8e),{'verbose':_0x4aed5d[_0x5777b5(0x1c3)]})[_0x5777b5(0x160)](_0x251074=>_0x251074[_0x5777b5(0x12d)]);for(const _0x2897f4 of _0xbf5004){_0x8ec863[_0x5777b5(0x140)](_0x2897f4);}const _0x279953=_0xcb3292?[]:findJourneysToDelete(_0x238027,_0x199036[_0x5777b5(0x1b0)](({yamlConfig:_0x47dd24,folderPath:_0x240f6c})=>({'yamlConfig':_0x47dd24,'folderPath':resolveTDFolderPath(_0x240f6c,_0x448361,_0x351e8e)})),_0x521e0d,_0x351e8e,_0x448361),_0x2cfa45=calculatePushStats(_0x15e567,_0x52391b,_0x8ec863,_0x534342,_0x279953,!!_0x4aed5d[_0x5777b5(0x192)],!!_0x4aed5d[_0x5777b5(0x1a7)]),_0x4d3150=_0x2cfa45['segments']['new'],_0x1e03f3=_0x2cfa45[_0x5777b5(0x1a5)]['changed'],_0x2f0ac8=_0x2cfa45['segments'][_0x5777b5(0x17b)],_0x5b9a08=_0x2cfa45[_0x5777b5(0x1a5)][_0x5777b5(0x139)],_0x51cfdc=_0x2cfa45[_0x5777b5(0x177)][_0x5777b5(0x15e)],_0x43fe24=_0x2cfa45[_0x5777b5(0x14b)][_0x5777b5(0x19e)],_0x406588=_0x2cfa45['journeys'][_0x5777b5(0x142)],_0xb59f81=_0x2cfa45[_0x5777b5(0x14b)][_0x5777b5(0x17b)],_0xa4688=_0x2cfa45[_0x5777b5(0x14b)][_0x5777b5(0x139)],_0x36367a=_0x2cfa45[_0x5777b5(0x141)][_0x5777b5(0x15f)],_0x374aba=_0x2cfa45[_0x5777b5(0x141)]['toCreate'],_0x5b81bb=_0x2cfa45[_0x5777b5(0x141)][_0x5777b5(0x1c0)],_0x313281=_0x2cfa45['activations'][_0x5777b5(0x139)];console[_0x5777b5(0x14e)](_0x5777b5(0x19b)+_0x504f37+'\x27:');_0x51cfdc['length']>0x0&&console[_0x5777b5(0x14e)]('\x20\x20'+a39_0x65df35['blue'](_0x5777b5(0x164)+_0x51cfdc[_0x5777b5(0x14f)]+_0x5777b5(0x146)));if(!_0x4aed5d[_0x5777b5(0x1a7)]){console['error'](_0x5777b5(0x19f)),console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x1ab)]('+\x20'+_0x4d3150[_0x5777b5(0x14f)]+_0x5777b5(0x195))),console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x16d)]('~\x20'+_0x1e03f3[_0x5777b5(0x14f)]+'\x20changed'));if(_0x5b9a08[_0x5777b5(0x14f)]>0x0)console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x17d)]('-\x20'+_0x5b9a08[_0x5777b5(0x14f)]+_0x5777b5(0x1b5)));else _0x534342[_0x5777b5(0x14f)]>0x0&&!_0x4aed5d[_0x5777b5(0x192)]&&console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x171)](_0x534342[_0x5777b5(0x14f)]+_0x5777b5(0x12f)));console[_0x5777b5(0x14e)]('\x20\x20\x20\x20'+a39_0x65df35[_0x5777b5(0x171)]('=\x20'+_0x2f0ac8['length']+'\x20unchanged'));}if(_0x52391b[_0x5777b5(0x14f)]>0x0||_0x279953[_0x5777b5(0x14f)]>0x0){console['error']('\x20\x20πΊοΈ\x20\x20Journeys:'),console[_0x5777b5(0x14e)]('\x20\x20\x20\x20'+a39_0x65df35[_0x5777b5(0x1ab)]('+\x20'+_0x43fe24[_0x5777b5(0x14f)]+'\x20new')),console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x16d)]('~\x20'+_0x406588[_0x5777b5(0x14f)]+'\x20changed'));if(_0xa4688['length']>0x0)console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x17d)]('-\x20'+_0xa4688['length']+'\x20to\x20delete'));else _0x279953['length']>0x0&&!_0x4aed5d[_0x5777b5(0x192)]&&console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x171)](_0x279953['length']+_0x5777b5(0x12f)));console[_0x5777b5(0x14e)]('\x20\x20\x20\x20'+a39_0x65df35[_0x5777b5(0x171)]('=\x20'+_0xb59f81[_0x5777b5(0x14f)]+_0x5777b5(0x198)));}_0x36367a['length']>0x0&&!_0x4aed5d['journeysOnly']&&(console[_0x5777b5(0x14e)](''),console[_0x5777b5(0x14e)](_0x5777b5(0x1b4)),_0x374aba[_0x5777b5(0x14f)]>0x0&&console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35['green']('+\x20'+_0x374aba[_0x5777b5(0x14f)]+_0x5777b5(0x15d))),_0x5b81bb[_0x5777b5(0x14f)]>0x0&&console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35[_0x5777b5(0x16d)]('~\x20'+_0x5b81bb[_0x5777b5(0x14f)]+_0x5777b5(0x134))),_0x313281[_0x5777b5(0x14f)]>0x0&&console[_0x5777b5(0x14e)](_0x5777b5(0x169)+a39_0x65df35['red']('-\x20'+_0x313281['length']+_0x5777b5(0x1b5))));console[_0x5777b5(0x14e)](_0x5777b5(0x16f)+a39_0x65df35[_0x5777b5(0x1c4)](_0x92658f)+'\x0a');if(_0x51cfdc[_0x5777b5(0x14f)]>0x0){console['error'](_0x5777b5(0x1c1));for(const _0x3ef73d of _0x51cfdc){console[_0x5777b5(0x14e)]('\x20\x20'+a39_0x65df35[_0x5777b5(0x187)]('+')+'\x20'+_0x3ef73d);}console[_0x5777b5(0x14e)]('');}if(_0x4d3150[_0x5777b5(0x14f)]>0x0&&!_0x4aed5d[_0x5777b5(0x1a7)])for(const _0x30b265 of _0x4d3150){const _0x15562e=_0x30b265[_0x5777b5(0x144)]?_0x30b265[_0x5777b5(0x144)]+'/'+_0x30b265['yamlConfig'][_0x5777b5(0x143)]:_0x30b265[_0x5777b5(0x155)][_0x5777b5(0x143)],_0x2076a5=_0x30b265[_0x5777b5(0x155)][_0x5777b5(0x141)]?.[_0x5777b5(0x14f)]||0x0,_0x298c22=_0x2076a5>0x0?a39_0x65df35[_0x5777b5(0x171)]('\x20['+_0x2076a5+_0x5777b5(0x1aa)):'';console[_0x5777b5(0x14e)]('\x0a'+a39_0x65df35[_0x5777b5(0x1ab)](_0x5777b5(0x1a3))+'\x20'+_0x15562e+_0x298c22),console[_0x5777b5(0x14e)]('β'['repeat'](0x3c)),_0x30b265[_0x5777b5(0x13f)]&&console[_0x5777b5(0x14e)](_0x30b265['diff']),console[_0x5777b5(0x14e)]('β'['repeat'](0x3c));}if(_0x5b9a08[_0x5777b5(0x14f)]>0x0&&!_0x4aed5d[_0x5777b5(0x1a7)])for(const _0x3a4fef of _0x5b9a08){const _0xab6173=_0x3a4fef[_0x5777b5(0x190)]?_0x521e0d[_0x5777b5(0x14c)](_0x3a4fef[_0x5777b5(0x190)]['toString']())||'':'',_0x13babd=_0xab6173?_0xab6173+'/'+_0x3a4fef[_0x5777b5(0x143)]:_0x3a4fef[_0x5777b5(0x143)],_0x3380ff=_0x57f350[_0x5777b5(0x14c)](_0x3a4fef['id'])||[],_0x557917=_0x3380ff[_0x5777b5(0x14f)]>0x0?a39_0x65df35[_0x5777b5(0x171)]('\x20['+_0x3380ff[_0x5777b5(0x14f)]+_0x5777b5(0x1aa)):'';console['error']('\x0a'+a39_0x65df35[_0x5777b5(0x17d)]('Delete\x20segment:')+'\x20'+_0x13babd+_0x557917),console[_0x5777b5(0x14e)]('β'[_0x5777b5(0x165)](0x3c));const _0x8b5aa=segmentWithActivationsToYaml(_0x3a4fef,_0x3380ff,undefined,_0x19058f,_0x509c91),_0x25dd43=segmentToYamlString(_0x8b5aa),_0x4e33bb=generateDiff(_0x25dd43,'');console[_0x5777b5(0x14e)](formatDiffWithColors(_0x4e33bb)),console[_0x5777b5(0x14e)]('β'[_0x5777b5(0x165)](0x3c));}const _0x5f9757=_0x15e567[_0x5777b5(0x1b8)](_0x2be5eb=>!_0x2be5eb[_0x5777b5(0x199)]&&_0x2be5eb[_0x5777b5(0x13f)]);if(_0x5f9757['length']>0x0&&!_0x4aed5d[_0x5777b5(0x1a7)])for(const _0x29c5a0 of _0x5f9757){const _0x225f93=_0x29c5a0[_0x5777b5(0x144)]?_0x29c5a0[_0x5777b5(0x144)]+'/'+_0x29c5a0[_0x5777b5(0x155)]['name']:_0x29c5a0[_0x5777b5(0x155)][_0x5777b5(0x143)];console[_0x5777b5(0x14e)]('\x0a'+a39_0x65df35[_0x5777b5(0x16d)]('Changes\x20to:')+'\x20'+_0x225f93),console[_0x5777b5(0x14e)]('β'[_0x5777b5(0x165)](0x3c)),console[_0x5777b5(0x14e)](_0x29c5a0[_0x5777b5(0x13f)]),console[_0x5777b5(0x14e)]('β'['repeat'](0x3c));}if(_0x43fe24[_0x5777b5(0x14f)]>0x0)for(const _0x765be of _0x43fe24){const _0x339be3=_0x765be[_0x5777b5(0x144)]?_0x765be[_0x5777b5(0x144)]+'/'+_0x765be['yamlConfig'][_0x5777b5(0x143)]:_0x765be[_0x5777b5(0x155)]['name'];console['error']('\x0a'+a39_0x65df35[_0x5777b5(0x1ab)](_0x5777b5(0x191))+'\x20'+_0x339be3),console[_0x5777b5(0x14e)]('β'[_0x5777b5(0x165)](0x3c)),_0x765be[_0x5777b5(0x13f)]&&console[_0x5777b5(0x14e)](_0x765be[_0x5777b5(0x13f)]),console[_0x5777b5(0x14e)]('β'['repeat'](0x3c));}const _0x64f9d3=_0x52391b[_0x5777b5(0x1b8)](_0x5ddc0f=>!_0x5ddc0f[_0x5777b5(0x199)]&&_0x5ddc0f[_0x5777b5(0x13f)]);if(_0x64f9d3['length']>0x0)for(const _0x32f467 of _0x64f9d3){const _0x45a724=_0x32f467[_0x5777b5(0x144)]?_0x32f467[_0x5777b5(0x144)]+'/'+_0x32f467['yamlConfig'][_0x5777b5(0x143)]:_0x32f467[_0x5777b5(0x155)][_0x5777b5(0x143)];console[_0x5777b5(0x14e)]('\x0a'+a39_0x65df35['yellow'](_0x5777b5(0x157))+'\x20'+_0x45a724),console['error']('β'['repeat'](0x3c)),console[_0x5777b5(0x14e)](_0x32f467[_0x5777b5(0x13f)]),console[_0x5777b5(0x14e)]('β'[_0x5777b5(0x165)](0x3c));}if(_0xa4688[_0x5777b5(0x14f)]>0x0)for(const _0x1f40fe of _0xa4688){const _0x5f4e43=_0x1f40fe[_0x5777b5(0x16b)]?_0x521e0d[_0x5777b5(0x14c)](_0x1f40fe['folderId'])||'':'',_0x437963=_0x5f4e43?_0x5f4e43+'/'+_0x1f40fe[_0x5777b5(0x15a)]:_0x1f40fe[_0x5777b5(0x15a)];console['error']('\x0a'+a39_0x65df35[_0x5777b5(0x17d)]('Delete\x20journey:')+'\x20'+_0x437963),console[_0x5777b5(0x14e)]('β'[_0x5777b5(0x165)](0x3c)),console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)]('(Journey\x20will\x20be\x20deleted)')),console[_0x5777b5(0x14e)]('β'[_0x5777b5(0x165)](0x3c));}if(_0x4aed5d['dryRun'])return console[_0x5777b5(0x14e)](a39_0x65df35['yellow'](_0x5777b5(0x182))),0x0;const _0xd90e0b=_0x4aed5d[_0x5777b5(0x1a7)]?![]:_0x4d3150[_0x5777b5(0x14f)]>0x0||_0x1e03f3[_0x5777b5(0x14f)]>0x0||_0x5b9a08[_0x5777b5(0x14f)]>0x0,_0x2147c5=_0x43fe24[_0x5777b5(0x14f)]>0x0||_0x406588[_0x5777b5(0x14f)]>0x0||_0xa4688[_0x5777b5(0x14f)]>0x0,_0xaa62b5=_0x4aed5d[_0x5777b5(0x1a7)]?![]:_0x36367a[_0x5777b5(0x14f)]>0x0,_0x1c07ad=_0x51cfdc['length']>0x0;if(!_0xd90e0b&&!_0x2147c5&&!_0xaa62b5&&!_0x1c07ad){const _0x2df09a=_0x4aed5d[_0x5777b5(0x1a7)]?'β\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x5777b5(0x194);console[_0x5777b5(0x14e)](a39_0x65df35['green'](_0x2df09a));if(_0xcb3292&&_0x2f0ac8[_0x5777b5(0x14f)]===0x1){const _0x2a3d21=_0x2f0ac8[0x0];if(_0x2a3d21[_0x5777b5(0x1b1)]?.['id']){const _0x34a0ae=getConsoleNextUrl(_0x4aed5d[_0x5777b5(0x188)],'/app/ps/'+_0x5d9c49+_0x5777b5(0x166)+_0x2a3d21[_0x5777b5(0x1b1)]['id']+_0x5777b5(0x153));console['error'](_0x5777b5(0x130)+a39_0x65df35[_0x5777b5(0x1c4)](_0x34a0ae));}}if(_0xcb3292&&_0xb59f81[_0x5777b5(0x14f)]===0x1){const _0xdeea8f=_0xb59f81[0x0];if(_0xdeea8f[_0x5777b5(0x150)]?.['id']){const _0x5bb7e5=getConsoleNextUrl(_0x4aed5d['site'],_0x5777b5(0x145)+_0x5d9c49+_0x5777b5(0x166)+_0xdeea8f[_0x5777b5(0x150)]['id']+_0x5777b5(0x1c5));console[_0x5777b5(0x14e)]('\x20\x20'+a39_0x65df35[_0x5777b5(0x1c4)](_0x5bb7e5));}}return 0x0;}const _0x3ff80b=_0x4aed5d[_0x5777b5(0x1a7)]?_0x43fe24['length']+_0x406588[_0x5777b5(0x14f)]+_0xa4688['length']+_0x51cfdc['length']:_0x4d3150[_0x5777b5(0x14f)]+_0x1e03f3[_0x5777b5(0x14f)]+_0x5b9a08['length']+_0x43fe24['length']+_0x406588[_0x5777b5(0x14f)]+_0xa4688[_0x5777b5(0x14f)]+_0x51cfdc[_0x5777b5(0x14f)]+_0x36367a[_0x5777b5(0x14f)];if(!_0x4aed5d[_0x5777b5(0x13b)]&&_0x3ff80b>0x0){if(!isInteractive())return console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)](_0x5777b5(0x174)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5777b5(0x14e)](a39_0x65df35['dim'](_0x5777b5(0x186))),0x1;const _0x3e71c6=await confirmKey(_0x5777b5(0x19a)+_0x3ff80b+'\x20changes?');if(!_0x3e71c6)return console['error'](a39_0x65df35['yellow'](_0x5777b5(0x1ad))),0x1;}const _0x185d9f={'withProgress':async(_0x47dc0e,_0x2f0ecf)=>{const _0x39cedc=_0x5777b5,_0x4bec6b=await withSpinner(_0x47dc0e,_0x2f0ecf,{'verbose':_0x4aed5d['verbose']});return{'data':_0x4bec6b[_0x39cedc(0x12d)]};},'logInfo':_0x3c3dd1=>console[_0x5777b5(0x14e)](a39_0x65df35['blue']('β\x20'+_0x3c3dd1)),'logSuccess':_0x462712=>console['error'](a39_0x65df35['green']('β\x20'+_0x462712)),'logWarning':_0x2bc160=>console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x16d)]('β \x20'+_0x2bc160)),'logDeleted':_0x21688b=>console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x17d)]('β\x20'+_0x21688b))},_0x5e4983={'segment':_0x57c4e9['segment'],'journey':_0x57c4e9['journey'],'user':_0x57c4e9['user'],'connection':_0x57c4e9[_0x5777b5(0x1a0)]};_0x51cfdc[_0x5777b5(0x14f)]>0x0&&(_0x30b019=await executePushFolders(_0x5e4983,_0x51cfdc,_0x30b019,{'parentId':_0x5d9c49},_0x185d9f));const _0x493b58={'rootFolderId':_0x81b254,'folderPathToId':_0x30b019,'folderIdToPath':_0x521e0d,'segmentNameToId':_0x12b666,'activationsBySegmentId':_0x57f350,'emailToIdMap':_0x1435a9,'idToEmailMap':_0x19058f,'connectionNameToIdMap':_0x24774f[_0x5777b5(0x138)],'connectionIdToNameMap':_0x24774f[_0x5777b5(0x12e)],'connectionNameToTypeMap':_0x595b16},_0x384bb5=await executePushSegments(_0x5e4983,_0x4aed5d['journeysOnly']?[]:_0x15e567,_0x493b58,{'parentId':_0x5d9c49},_0x185d9f),_0x1de0fc=_0x384bb5[_0x5777b5(0x149)],_0x30629e=_0x384bb5[_0x5777b5(0x137)],_0x107a08=_0x384bb5[_0x5777b5(0x141)][_0x5777b5(0x149)],_0x357033=_0x384bb5['activations']['updated'],_0x3f4eb3=_0x384bb5[_0x5777b5(0x141)]['deleted'];let _0x3b8589;if(_0xcb3292&&_0x15e567['length']===0x1){const _0x5a1216=_0x15e567[0x0];_0x3b8589=_0x5a1216['existingSegment']?.['id']??_0x384bb5['createdSegmentIds'][_0x5777b5(0x14c)](_0x5a1216[_0x5777b5(0x155)][_0x5777b5(0x143)]);}const _0x31c779=await executePushSegmentDeletions(_0x5e4983,_0x4aed5d[_0x5777b5(0x1a7)]?[]:_0x5b9a08,_0x185d9f);let _0x235302=0x0,_0x27c41b=0x0,_0x342f2a=0x0;const _0x5d750d=new Map(_0x12b666);for(const [_0x731cc1,_0xa62b29]of _0x384bb5[_0x5777b5(0x18d)]){_0x5d750d[_0x5777b5(0x18c)](_0x731cc1,_0xa62b29);}if(_0x52391b[_0x5777b5(0x14f)]>0x0){const _0x2323b2={..._0x493b58,'segmentNameToId':_0x5d750d,'existingSegments':_0x2ae601,'activationContext':_0x53c557},_0xb660ce=await executePushJourneys(_0x5e4983,_0x52391b,_0x2323b2,{'parentId':_0x5d9c49,'rootFolderId':_0x81b254,'verbose':_0x4aed5d['verbose']},_0x185d9f);_0x235302=_0xb660ce[_0x5777b5(0x149)],_0x27c41b=_0xb660ce[_0x5777b5(0x137)];if(_0xcb3292&&_0xb660ce[_0x5777b5(0x1c9)][_0x5777b5(0x14f)]===0x1){const _0x334f29=_0xb660ce[_0x5777b5(0x1c9)][0x0];if(_0x334f29[_0x5777b5(0x158)]){const _0x53adf0=getConsoleNextUrl(_0x4aed5d[_0x5777b5(0x188)],_0x5777b5(0x145)+_0x5d9c49+_0x5777b5(0x166)+_0x334f29[_0x5777b5(0x158)]+_0x5777b5(0x1c5));console['error']('\x20\x20'+a39_0x65df35[_0x5777b5(0x1c4)](_0x53adf0));}}}for(const _0x2b3468 of _0xa4688){console[_0x5777b5(0x14e)](a39_0x65df35['yellow'](_0x5777b5(0x163)+_0x2b3468[_0x5777b5(0x15a)])),_0x342f2a++;}const _0x4e6335=[];if(_0x1de0fc>0x0)_0x4e6335[_0x5777b5(0x197)](_0x1de0fc+_0x5777b5(0x151));if(_0x30629e>0x0)_0x4e6335[_0x5777b5(0x197)](_0x30629e+'\x20updated');if(_0x31c779>0x0)_0x4e6335[_0x5777b5(0x197)](_0x31c779+_0x5777b5(0x167));const _0x1989c5=[];if(_0x235302>0x0)_0x1989c5[_0x5777b5(0x197)](_0x235302+_0x5777b5(0x151));if(_0x27c41b>0x0)_0x1989c5[_0x5777b5(0x197)](_0x27c41b+_0x5777b5(0x15c));if(_0x342f2a>0x0)_0x1989c5[_0x5777b5(0x197)](_0x342f2a+_0x5777b5(0x167));const _0x4e8e7f=[];if(_0x107a08>0x0)_0x4e8e7f[_0x5777b5(0x197)](_0x107a08+'\x20created');if(_0x357033>0x0)_0x4e8e7f[_0x5777b5(0x197)](_0x357033+_0x5777b5(0x15c));if(_0x3f4eb3>0x0)_0x4e8e7f[_0x5777b5(0x197)](_0x3f4eb3+_0x5777b5(0x167));console[_0x5777b5(0x14e)](a39_0x65df35[_0x5777b5(0x1ab)](_0x5777b5(0x196)));_0x4e6335[_0x5777b5(0x14f)]>0x0&&!_0x4aed5d[_0x5777b5(0x1a7)]&&console[_0x5777b5(0x14e)]('\x20\x20Segments:\x20'+_0x4e6335['join'](',\x20'));_0x1989c5[_0x5777b5(0x14f)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x1989c5['join'](',\x20'));_0x4e8e7f[_0x5777b5(0x14f)]>0x0&&!_0x4aed5d[_0x5777b5(0x1a7)]&&console[_0x5777b5(0x14e)](_0x5777b5(0x1ba)+_0x4e8e7f[_0x5777b5(0x13d)](',\x20'));if(_0x3b8589){const _0x297fbb=getConsoleNextUrl(_0x4aed5d[_0x5777b5(0x188)],_0x5777b5(0x145)+_0x5d9c49+_0x5777b5(0x166)+_0x3b8589+_0x5777b5(0x153));console[_0x5777b5(0x14e)](_0x5777b5(0x130)+a39_0x65df35['cyan'](_0x297fbb));}return 0x0;}}
|