@treasuredata/tdx 0.29.1 → 0.29.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/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/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +1 -2
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +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.d.ts +13 -6
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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/push-workflow.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +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.d.ts +184 -0
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/activation-schema.js +1 -0
- package/dist/sdk/segment/types/activation-schema.js.map +1 -0
- package/dist/sdk/segment/types/journey-def.d.ts +5 -0
- package/dist/sdk/segment/types/journey-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-def.js.map +1 -1
- package/dist/sdk/segment/types/journey-schema.d.ts +419 -0
- package/dist/sdk/segment/types/journey-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/journey-schema.js +1 -0
- package/dist/sdk/segment/types/journey-schema.js.map +1 -0
- package/dist/sdk/segment/types/segment-def.d.ts +4 -87
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +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/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +14 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +3 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x5933df=a30_0x1790;(function(_0x35d8fa,_0x57e692){const _0x333cd1=a30_0x1790,_0x29e22f=_0x35d8fa();while(!![]){try{const _0x1091cf=parseInt(_0x333cd1(0x198))/0x1+parseInt(_0x333cd1(0x16f))/0x2*(-parseInt(_0x333cd1(0x165))/0x3)+-parseInt(_0x333cd1(0x199))/0x4+-parseInt(_0x333cd1(0x151))/0x5+-parseInt(_0x333cd1(0x145))/0x6+-parseInt(_0x333cd1(0x150))/0x7*(parseInt(_0x333cd1(0x14b))/0x8)+parseInt(_0x333cd1(0x127))/0x9;if(_0x1091cf===_0x57e692)break;else _0x29e22f['push'](_0x29e22f['shift']());}catch(_0x53882b){_0x29e22f['push'](_0x29e22f['shift']());}}}(a30_0x5597,0xc8d40));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';function a30_0x1790(_0x48fa24,_0xce277f){_0x48fa24=_0x48fa24-0x114;const _0x559770=a30_0x5597();let _0x17907f=_0x559770[_0x48fa24];return _0x17907f;}import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x27b4a8 from'chalk';function formatRelativeTime(_0x39fd84){const _0x5c1b82=a30_0x1790,_0x1c2dcb=new Date(_0x39fd84),_0x42d702=new Date(),_0x9dc2d5=_0x1c2dcb[_0x5c1b82(0x183)]()-_0x42d702[_0x5c1b82(0x183)](),_0x2583fa=Math[_0x5c1b82(0x15f)](_0x9dc2d5)/0x3e8,_0x395e25=_0x9dc2d5<0x0;if(_0x2583fa<0x3c)return _0x395e25?_0x5c1b82(0x13a):'soon';else{if(_0x2583fa<0xe10){const _0x366643=Math[_0x5c1b82(0x12d)](_0x2583fa/0x3c);return _0x395e25?_0x366643+'m\x20ago':_0x5c1b82(0x166)+_0x366643+'m';}else{if(_0x2583fa<0x15180){const _0x2ceeba=Math[_0x5c1b82(0x12d)](_0x2583fa/0xe10);return _0x395e25?_0x2ceeba+'h\x20ago':_0x5c1b82(0x166)+_0x2ceeba+'h';}else{if(_0x2583fa<0x93a80){const _0x483459=Math[_0x5c1b82(0x12d)](_0x2583fa/0x15180);return _0x395e25?_0x483459+_0x5c1b82(0x14e):_0x5c1b82(0x166)+_0x483459+'d';}else return _0x1c2dcb[_0x5c1b82(0x197)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x5933df(0x153)]=a30_0x5933df(0x126);[a30_0x5933df(0x135)]=a30_0x5933df(0x18e);async[a30_0x5933df(0x12b)](_0x31902b){const _0x30f81c=a30_0x5933df,{options:_0x380923,args:_0x4aa4db,tdx:_0x481acd}=_0x31902b,_0x529753=resolveLimit(_0x380923['limit'],DEFAULT_DISPLAY_LIMIT),_0x1a39f3=_0x4aa4db[0x0],_0x15561d=_0x1a39f3?_0x30f81c(0x16a)+_0x1a39f3+_0x30f81c(0x123):'Listing\x20scheduled\x20queries...',_0x3a5ded=await withSpinner(_0x15561d,()=>_0x481acd[_0x30f81c(0x171)]['listQueries']({'limit':_0x529753,'scheduled':!![],'pattern':_0x1a39f3}),{'verbose':_0x380923[_0x30f81c(0x117)]}),_0x4c63e4=_0x3a5ded[_0x30f81c(0x139)][_0x30f81c(0x130)],_0xf6d2f8=_0x3a5ded[_0x30f81c(0x139)][_0x30f81c(0x114)][_0x30f81c(0x119)],_0x301cbd=_0x1a39f3?_0x30f81c(0x161)+_0x1a39f3+'\x22':'';_0xf6d2f8?console[_0x30f81c(0x143)]('Showing\x20first\x20'+_0x4c63e4['length']+'\x20schedules'+_0x301cbd+_0x30f81c(0x159)):console[_0x30f81c(0x143)](_0x30f81c(0x154)+_0x4c63e4[_0x30f81c(0x15c)]+'\x20scheduled\x20quer'+(_0x4c63e4['length']!==0x1?'ies':'y')+_0x301cbd);if(_0x380923['format']===_0x30f81c(0x152)||_0x380923[_0x30f81c(0x12c)]===_0x30f81c(0x147)||_0x380923[_0x30f81c(0x12c)]===_0x30f81c(0x124)||_0x380923['format']===_0x30f81c(0x142)){const _0x4abfe5=_0x4c63e4['map'](_0xb67ddc=>({'id':_0xb67ddc['id'],'name':_0xb67ddc[_0x30f81c(0x153)],'cron':_0xb67ddc['cron'],'database':_0xb67ddc['database']?.['name'],'type':_0xb67ddc[_0x30f81c(0x192)],'timezone':_0xb67ddc[_0x30f81c(0x13d)],'user_name':_0xb67ddc[_0x30f81c(0x16c)]?.[_0x30f81c(0x153)],'updated_at':_0xb67ddc[_0x30f81c(0x182)],'next_run_at':_0xb67ddc[_0x30f81c(0x18a)],'last_job_status':_0xb67ddc[_0x30f81c(0x146)]?.['status']}));await handleSDKOutput(_0x4abfe5,_0x380923);}else{if(_0x4c63e4[_0x30f81c(0x15c)]===0x0)console[_0x30f81c(0x141)](_0x30f81c(0x12f));else{const _0x5430a0=_0x380923[_0x30f81c(0x170)],_0x20cd3f=_0x4c63e4[_0x30f81c(0x13c)](_0x5a3e98=>{const _0x351aec=_0x30f81c,_0x1b721=_0x5a3e98[_0x351aec(0x146)]?.[_0x351aec(0x134)]?_0x5a3e98[_0x351aec(0x146)][_0x351aec(0x134)]==='success'?'✓':'✗':'-',_0x5961f5=_0x5a3e98[_0x351aec(0x146)]?.['ended_at']?formatRelativeTime(_0x5a3e98[_0x351aec(0x146)]['ended_at']):_0x351aec(0x193),_0x172355=_0x5a3e98[_0x351aec(0x18a)]?formatRelativeTime(_0x5a3e98[_0x351aec(0x18a)]):'-',_0x2f3881=_0x5a3e98[_0x351aec(0x184)]||'',_0x5e9f48=_0x5a3e98[_0x351aec(0x153)]||_0x351aec(0x18b),_0x1c0362=getConsoleUrl(_0x5430a0,_0x351aec(0x188)+_0x5a3e98['id']);return{'statusIcon':_0x1b721,'lastRun':_0x5961f5,'nextRun':_0x172355,'cron':_0x2f3881,'name':_0x5e9f48,'queryUrl':_0x1c0362,'status':_0x5a3e98[_0x351aec(0x146)]?.[_0x351aec(0x134)]};}),_0xd341da=Math[_0x30f81c(0x16b)](..._0x20cd3f[_0x30f81c(0x13c)](_0x17f3c9=>_0x17f3c9[_0x30f81c(0x190)][_0x30f81c(0x15c)])),_0x4dd4aa=Math[_0x30f81c(0x16b)](..._0x20cd3f[_0x30f81c(0x13c)](_0x22c9e3=>_0x22c9e3[_0x30f81c(0x172)][_0x30f81c(0x15c)])),_0x5d7c1a=Math[_0x30f81c(0x16b)](..._0x20cd3f[_0x30f81c(0x13c)](_0x421003=>_0x421003[_0x30f81c(0x184)][_0x30f81c(0x15c)])),_0x1e4c76=_0x20cd3f['map'](_0x324759=>{const _0x297086=_0x30f81c,_0x1e0392=_0x324759[_0x297086(0x134)]===_0x297086(0x16e)?a30_0x27b4a8[_0x297086(0x15a)](_0x324759[_0x297086(0x136)]):_0x324759[_0x297086(0x134)]===_0x297086(0x143)?a30_0x27b4a8[_0x297086(0x17a)](_0x324759[_0x297086(0x136)]):a30_0x27b4a8['dim'](_0x324759[_0x297086(0x136)]),_0x5b7230=_0x324759[_0x297086(0x190)][_0x297086(0x12a)](_0xd341da),_0x52fd78=_0x324759[_0x297086(0x172)]['padEnd'](_0x4dd4aa),_0x21cfca=_0x324759[_0x297086(0x184)]?a30_0x27b4a8[_0x297086(0x17c)](_0x324759['cron'][_0x297086(0x12a)](_0x5d7c1a)):'\x20'['repeat'](_0x5d7c1a),_0x291d70=hyperlink(_0x324759[_0x297086(0x153)],_0x324759[_0x297086(0x128)]);return'📅\x20'+_0x1e0392+'\x20'+_0x5b7230+'\x20\x20→\x20'+_0x52fd78+'\x20\x20'+_0x21cfca+'\x20\x20'+_0x291d70;});await writeOutput(_0x1e4c76[_0x30f81c(0x156)]('\x0a'),_0x380923[_0x30f81c(0x189)],_0x30f81c(0x14d));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x5933df(0x153)]=a30_0x5933df(0x177);[a30_0x5933df(0x135)]=a30_0x5933df(0x191);[a30_0x5933df(0x185)](_0x4009f1){const _0x3cdc9b=a30_0x5933df,_0xb86fdf=_0x4009f1[_0x3cdc9b(0x18f)][0x0];if(!_0xb86fdf)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x4e26af){const _0x359fcb=a30_0x5933df,{options:_0x24b362,args:_0xb7e26f,tdx:_0x3cfeb1}=_0x4e26af,_0x4cbfa7=_0xb7e26f[0x0],_0x3b509f=await withSpinner(_0x359fcb(0x15b),()=>_0x3cfeb1[_0x359fcb(0x171)][_0x359fcb(0x17b)](_0x4cbfa7),{'verbose':_0x24b362['verbose']}),_0x98b56c=_0x3b509f[_0x359fcb(0x139)],_0x34ec85={'name':_0x98b56c['name'],'cron':_0x98b56c[_0x359fcb(0x184)],'database':_0x98b56c[_0x359fcb(0x178)],'type':_0x98b56c[_0x359fcb(0x192)],'timezone':_0x98b56c[_0x359fcb(0x195)],'user_name':_0x98b56c[_0x359fcb(0x12e)],'created_at':_0x98b56c['created_at'],'engine_version':_0x98b56c[_0x359fcb(0x169)],'executing_user_id':_0x98b56c[_0x359fcb(0x14f)],'query':_0x98b56c[_0x359fcb(0x11e)],'delay':_0x98b56c[_0x359fcb(0x180)],'priority':_0x98b56c['priority'],'retry_limit':_0x98b56c['retry_limit'],..._0x98b56c['result']&&{'result':_0x98b56c[_0x359fcb(0x118)]}};return await handleSingleObjectOutput(_0x34ec85,_0x24b362),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x5933df(0x153)]=a30_0x5933df(0x140);[a30_0x5933df(0x135)]=a30_0x5933df(0x132);[a30_0x5933df(0x185)](_0xe9fb84){const _0x1f82c8=a30_0x5933df,_0x267306=_0xe9fb84['args'][0x0];if(!_0x267306)return _0x1f82c8(0x137);const _0x2326bc=_0xe9fb84[_0x1f82c8(0x144)];if(!_0x2326bc[_0x1f82c8(0x178)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async['execute'](_0x52d98a){const _0x19b52d=a30_0x5933df,{options:_0x2430cb,args:_0x57544f,tdx:_0x1adc15}=_0x52d98a,_0x28f4f8=_0x57544f[0x0],_0x32538e=_0x2430cb,_0x3e931c=_0x32538e['database'],_0xe9e5f9=_0x32538e[_0x19b52d(0x120)],_0x2c886b=_0x32538e['type']||_0x19b52d(0x11a);let _0x861ee7;try{_0x861ee7=readFileSync(_0xe9e5f9,_0x19b52d(0x187))[_0x19b52d(0x122)]();}catch(_0x24e104){throw new SDKError(ErrorCode[_0x19b52d(0x17f)],'Failed\x20to\x20read\x20file:\x20'+_0xe9e5f9,_0x24e104 instanceof Error?_0x24e104:undefined);}if(!_0x861ee7)throw new SDKError(ErrorCode[_0x19b52d(0x17f)],_0x19b52d(0x194));const _0x55ce86={'database':_0x3e931c,'query':_0x861ee7,'type':_0x2c886b};if(_0x32538e[_0x19b52d(0x184)])_0x55ce86['cron']=_0x32538e[_0x19b52d(0x184)];if(_0x32538e[_0x19b52d(0x195)])_0x55ce86[_0x19b52d(0x195)]=_0x32538e[_0x19b52d(0x195)];if(_0x32538e['delay']!==undefined)_0x55ce86['delay']=Number(_0x32538e[_0x19b52d(0x180)]);if(_0x32538e['priority']!==undefined)_0x55ce86['priority']=Number(_0x32538e[_0x19b52d(0x138)]);if(_0x32538e['retryLimit']!==undefined)_0x55ce86[_0x19b52d(0x196)]=Number(_0x32538e['retryLimit']);if(_0x32538e['engineVersion'])_0x55ce86[_0x19b52d(0x169)]=_0x32538e['engineVersion'];if(_0x32538e['result'])_0x55ce86[_0x19b52d(0x118)]=_0x32538e[_0x19b52d(0x118)];if(_0x2430cb['verbose']){console[_0x19b52d(0x143)](_0x19b52d(0x167)+_0x28f4f8),console['error'](_0x19b52d(0x164)+_0x3e931c),console[_0x19b52d(0x143)](_0x19b52d(0x179)+_0x2c886b);if(_0x55ce86['cron'])console[_0x19b52d(0x143)](_0x19b52d(0x16d)+_0x55ce86[_0x19b52d(0x184)]);if(_0x55ce86[_0x19b52d(0x195)])console[_0x19b52d(0x143)](_0x19b52d(0x162)+_0x55ce86[_0x19b52d(0x195)]);}const _0x58375c=await withSpinner(_0x19b52d(0x11d),()=>_0x1adc15['schedules']['create'](_0x28f4f8,_0x55ce86),{'verbose':_0x2430cb[_0x19b52d(0x117)]});return console[_0x19b52d(0x143)]('Schedule\x20created:\x20'+_0x58375c['data'][_0x19b52d(0x153)]),await handleSingleObjectOutput(_0x58375c['data'],_0x2430cb),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x5933df(0x153)]='schedule:update';[a30_0x5933df(0x135)]=a30_0x5933df(0x155);['validate'](_0x32b303){const _0x2a7c2f=a30_0x5933df,_0x151c3b=_0x32b303[_0x2a7c2f(0x18f)][0x0];if(!_0x151c3b)return _0x2a7c2f(0x125);return undefined;}async['execute'](_0x4f0bed){const _0x438e82=a30_0x5933df,{options:_0x8ee190,args:_0x4e4605,tdx:_0x3d5b56}=_0x4f0bed,_0x1c0046=_0x4e4605[0x0],_0x5e6495=_0x8ee190,_0x1d0585={};if(_0x5e6495[_0x438e82(0x178)])_0x1d0585[_0x438e82(0x178)]=_0x5e6495[_0x438e82(0x178)];if(_0x5e6495[_0x438e82(0x192)])_0x1d0585[_0x438e82(0x192)]=_0x5e6495[_0x438e82(0x192)];if(_0x5e6495[_0x438e82(0x184)])_0x1d0585[_0x438e82(0x184)]=_0x5e6495[_0x438e82(0x184)];if(_0x5e6495['timezone'])_0x1d0585['timezone']=_0x5e6495[_0x438e82(0x195)];if(_0x5e6495[_0x438e82(0x180)]!==undefined)_0x1d0585[_0x438e82(0x180)]=Number(_0x5e6495[_0x438e82(0x180)]);if(_0x5e6495[_0x438e82(0x138)]!==undefined)_0x1d0585[_0x438e82(0x138)]=Number(_0x5e6495[_0x438e82(0x138)]);if(_0x5e6495[_0x438e82(0x168)]!==undefined)_0x1d0585[_0x438e82(0x196)]=Number(_0x5e6495[_0x438e82(0x168)]);if(_0x5e6495[_0x438e82(0x13e)])_0x1d0585['engine_version']=_0x5e6495['engineVersion'];if(_0x5e6495[_0x438e82(0x118)])_0x1d0585[_0x438e82(0x118)]=_0x5e6495['result'];if(_0x5e6495[_0x438e82(0x120)])try{_0x1d0585[_0x438e82(0x11e)]=readFileSync(_0x5e6495[_0x438e82(0x120)],_0x438e82(0x187))[_0x438e82(0x122)]();}catch(_0x48c8f2){throw new SDKError(ErrorCode[_0x438e82(0x17f)],'Failed\x20to\x20read\x20file:\x20'+_0x5e6495[_0x438e82(0x120)],_0x48c8f2 instanceof Error?_0x48c8f2:undefined);}if(Object['keys'](_0x1d0585)[_0x438e82(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x438e82(0x17f)],_0x438e82(0x157));if(_0x8ee190[_0x438e82(0x117)]){console[_0x438e82(0x143)]('Updating\x20schedule:\x20'+_0x1c0046);for(const [_0x225b96,_0x5c362d]of Object[_0x438e82(0x18d)](_0x1d0585)){_0x225b96===_0x438e82(0x11e)?console[_0x438e82(0x143)]('\x20\x20'+_0x225b96+':\x20'+_0x5c362d[_0x438e82(0x13b)](0x0,0x32)+_0x438e82(0x174)):console[_0x438e82(0x143)]('\x20\x20'+_0x225b96+':\x20'+_0x5c362d);}}const _0x530867=await withSpinner('Updating\x20schedule...',()=>_0x3d5b56['schedules']['update'](_0x1c0046,_0x1d0585),{'verbose':_0x8ee190[_0x438e82(0x117)]});return console[_0x438e82(0x143)](_0x438e82(0x18c)+_0x530867[_0x438e82(0x139)][_0x438e82(0x153)]),await handleSingleObjectOutput(_0x530867['data'],_0x8ee190),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a30_0x5933df(0x17e);[a30_0x5933df(0x135)]=a30_0x5933df(0x173);['validate'](_0x2afb32){const _0x48de5e=a30_0x5933df,_0xc63b44=_0x2afb32[_0x48de5e(0x18f)][0x0];if(!_0xc63b44)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a30_0x5933df(0x12b)](_0xf648b0){const _0x14d7ef=a30_0x5933df,{options:_0x5b6bcf,args:_0xdb9dd1,tdx:_0x4d0ddd}=_0xf648b0,_0x359456=_0xdb9dd1[0x0];if(!_0x5b6bcf[_0x14d7ef(0x175)]){const _0x57d07f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x359456+'\x22?');if(!_0x57d07f)return console[_0x14d7ef(0x143)](_0x14d7ef(0x15d)),0x0;}const _0x515c07=await withSpinner(_0x14d7ef(0x148),()=>_0x4d0ddd[_0x14d7ef(0x171)]['delete'](_0x359456),{'verbose':_0x5b6bcf['verbose']});return console[_0x14d7ef(0x143)]('Schedule\x20deleted:\x20'+_0x515c07['data'][_0x14d7ef(0x153)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x5933df(0x153)]=a30_0x5933df(0x129);[a30_0x5933df(0x135)]='Run\x20a\x20scheduled\x20query\x20immediately';[a30_0x5933df(0x185)](_0x439365){const _0x381bc3=a30_0x5933df,_0x4e002a=_0x439365[_0x381bc3(0x18f)][0x0];if(!_0x4e002a)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a30_0x5933df(0x12b)](_0x3b5198){const _0x53e7ff=a30_0x5933df,{options:_0x3172ac,args:_0xc7e253,tdx:_0x2cc89f}=_0x3b5198,_0x523069=_0xc7e253[0x0],_0x588018=_0x3172ac,_0x6473e1=_0x588018[_0x53e7ff(0x176)],_0x5e61a8=_0x588018[_0x53e7ff(0x186)]!==undefined?Number(_0x588018[_0x53e7ff(0x186)]):undefined;if(_0x3172ac[_0x53e7ff(0x117)]){console[_0x53e7ff(0x143)]('Running\x20schedule:\x20'+_0x523069);if(_0x6473e1)console['error'](_0x53e7ff(0x133)+_0x6473e1);if(_0x5e61a8)console['error'](_0x53e7ff(0x13f)+_0x5e61a8);}const _0xa3a8bb=await withSpinner('Running\x20schedule...',()=>_0x2cc89f[_0x53e7ff(0x171)][_0x53e7ff(0x131)](_0x523069,{'time':_0x6473e1,'num':_0x5e61a8}),{'verbose':_0x3172ac[_0x53e7ff(0x117)]}),_0x91d15c=_0xa3a8bb[_0x53e7ff(0x139)][_0x53e7ff(0x14c)];console[_0x53e7ff(0x143)](_0x53e7ff(0x181)+_0x91d15c['length']+'\x20job'+(_0x91d15c[_0x53e7ff(0x15c)]!==0x1?'s':'')+'\x20created');for(const _0x65df78 of _0x91d15c){console['error'](_0x53e7ff(0x121)+_0x65df78[_0x53e7ff(0x15e)]);}return await handleSDKOutput(_0x91d15c,_0x3172ac),0x0;}}function a30_0x5597(){const _0x38a123=['end_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Creating\x20schedule...','query','history','file','\x20\x20Job\x20ID:\x20','trim','\x22...','table','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','schedule:list','26886663NtHQwB','queryUrl','schedule:run','padEnd','execute','format','round','user_name','No\x20scheduled\x20queries\x20found','queries','run','Create\x20a\x20scheduled\x20query','\x20\x20Time:\x20','status','description','statusIcon','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','priority','data','just\x20now','substring','map','time_zone','engineVersion','\x20\x20Num:\x20','schedule:create','log','tsv','error','options','4095522QgdSiW','last_job','jsonl','Deleting\x20schedule...','count','\x20(showing\x20','6136uPsDti','jobs','list','d\x20ago','executing_user_id','8127MjIzbc','1900700CNbLkU','json','name','Found\x20','Update\x20a\x20scheduled\x20query','join','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','scheduled_at','\x20(use\x20--limit\x20to\x20see\x20more)','green','Getting\x20schedule\x20details...','length','Cancelled','job_id','abs','created_at','\x20matching\x20\x22','\x20\x20Timezone:\x20','schedule:history','\x20\x20Database:\x20','3EpBoxC','in\x20','Creating\x20schedule:\x20','retryLimit','engine_version','Searching\x20scheduled\x20queries\x20matching\x20\x22','max','user','\x20\x20Cron:\x20','success','1985514ngJlWG','site','schedules','nextRun','Delete\x20a\x20scheduled\x20query','...','yes','time','schedule:show','database','\x20\x20Type:\x20','red','show','cyan','start_at','schedule:delete','INVALID_ARGUMENT','delay','Schedule\x20run\x20submitted:\x20','updated_at','getTime','cron','validate','num','utf-8','/app/queries/editor?queryId=','output','next_run_at','(unnamed)','Schedule\x20updated:\x20','entries','List\x20scheduled\x20queries','args','lastRun','Show\x20schedule\x20details','type','never','Query\x20file\x20is\x20empty','timezone','retry_limit','toLocaleDateString','1115726gzdDNW','1338280FAxHNr','pagination','from','Show\x20schedule\x20execution\x20history','verbose','result','has_next_page','trino'];a30_0x5597=function(){return _0x38a123;};return a30_0x5597();}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x5933df(0x153)]=a30_0x5933df(0x163);['description']=a30_0x5933df(0x116);[a30_0x5933df(0x185)](_0x39c82e){const _0xa5c0e1=a30_0x5933df,_0x1ed8af=_0x39c82e[_0xa5c0e1(0x18f)][0x0];if(!_0x1ed8af)return _0xa5c0e1(0x11c);return undefined;}async[a30_0x5933df(0x12b)](_0xb3ddb){const _0x3231a7=a30_0x5933df,{options:_0x21bd70,args:_0x467f63,tdx:_0x80f620}=_0xb3ddb,_0x3974ae=_0x467f63[0x0],_0x3f0b2a=_0x21bd70,_0x2e4af2=_0x3f0b2a[_0x3231a7(0x115)]!==undefined?Number(_0x3f0b2a[_0x3231a7(0x115)]):undefined,_0x8a41a6=_0x3f0b2a['to']!==undefined?Number(_0x3f0b2a['to']):undefined,_0x46e7d9=await withSpinner('Getting\x20schedule\x20history...',()=>_0x80f620[_0x3231a7(0x171)][_0x3231a7(0x11f)](_0x3974ae,{'from':_0x2e4af2,'to':_0x8a41a6}),{'verbose':_0x21bd70[_0x3231a7(0x117)]}),_0x1876b8=_0x46e7d9['data'];console[_0x3231a7(0x143)](_0x3231a7(0x154)+_0x1876b8['count']+'\x20execution'+(_0x1876b8[_0x3231a7(0x149)]!==0x1?'s':'')+_0x3231a7(0x14a)+_0x1876b8['from']+'-'+_0x1876b8['to']+')');const _0x53d313=_0x1876b8[_0x3231a7(0x11f)][_0x3231a7(0x13c)](_0x5dfd8a=>({'job_id':_0x5dfd8a[_0x3231a7(0x15e)],'type':_0x5dfd8a[_0x3231a7(0x192)],'status':_0x5dfd8a[_0x3231a7(0x134)],'scheduled_at':_0x5dfd8a[_0x3231a7(0x158)],'created_at':_0x5dfd8a[_0x3231a7(0x160)],'start_at':_0x5dfd8a[_0x3231a7(0x17d)],'end_at':_0x5dfd8a[_0x3231a7(0x11b)]}));return await handleSDKOutput(_0x53d313,_0x21bd70),0x0;}}
|
|
1
|
+
const a30_0x468473=a30_0x4eef;function a30_0x5e0b(){const _0x497569=['Listing\x20scheduled\x20queries...','padEnd','jobs','data','verbose','time_zone','6BFcLEY','2370208AydcIW','type','green','\x20schedules','852tCsSib','cron','status','Updating\x20schedule:\x20','\x20\x20Database:\x20','nextRun','start_at','json','\x20\x20Num:\x20','soon','create','162321RzUMyB','last_job','ended_at','schedule:run','\x20\x20→\x20','d\x20ago','queryUrl','ies','\x20job','\x20(use\x20--limit\x20to\x20see\x20more)','\x20scheduled\x20quer','44985RARywi','substring','map','trim','/app/queries/editor?queryId=','Failed\x20to\x20read\x20file:\x20','retryLimit','log','\x20(showing\x20','20041520AXpQyk','dim','description','Schedule\x20run\x20submitted:\x20','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','error','file','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','cyan','engine_version','schedule:update','\x20\x20Time:\x20','lastRun','name','9585486DvsYia','Run\x20a\x20scheduled\x20query\x20immediately','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','getTime','Creating\x20schedule...','Update\x20a\x20scheduled\x20query','database','success','INVALID_ARGUMENT','Updating\x20schedule...','created_at','round','statusIcon','schedule:list','\x20matching\x20\x22','length','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','jsonl','max','timezone','toLocaleDateString','result','schedule:show','end_at','pagination','validate','query','join','h\x20ago','has_next_page','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','job_id','List\x20scheduled\x20queries','run','utf-8','Create\x20a\x20scheduled\x20query','retry_limit','update','Running\x20schedule...','engineVersion','Query\x20file\x20is\x20empty','args','repeat','Found\x20','schedule:delete','list','Schedule\x20updated:\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','queries','red','count','schedules','Deleting\x20schedule...','next_run_at','No\x20scheduled\x20queries\x20found','time','trino','priority','output','\x20\x20Timezone:\x20','Running\x20schedule:\x20','site','format','\x20\x20Type:\x20','3129tUlhuV','just\x20now','\x22...','delay','\x20\x20Job\x20ID:\x20','18204xCvNyw','num','yes','(unnamed)','\x20\x20Cron:\x20','1485346qSzVBb','delete','keys','tsv','executing_user_id','listQueries','schedule:history','user_name','📅\x20','in\x20','from','Show\x20schedule\x20details','never','execute'];a30_0x5e0b=function(){return _0x497569;};return a30_0x5e0b();}(function(_0x1e05f2,_0x550d6a){const _0x45bfde=a30_0x4eef,_0x1d4559=_0x1e05f2();while(!![]){try{const _0x2b1de0=parseInt(_0x45bfde(0x18f))/0x1+parseInt(_0x45bfde(0x16b))/0x2*(parseInt(_0x45bfde(0x17f))/0x3)+parseInt(_0x45bfde(0x184))/0x4*(parseInt(_0x45bfde(0x19a))/0x5)+-parseInt(_0x45bfde(0x166))/0x6*(parseInt(_0x45bfde(0x161))/0x7)+-parseInt(_0x45bfde(0x180))/0x8+parseInt(_0x45bfde(0x121))/0x9+-parseInt(_0x45bfde(0x113))/0xa;if(_0x2b1de0===_0x550d6a)break;else _0x1d4559['push'](_0x1d4559['shift']());}catch(_0x552c1a){_0x1d4559['push'](_0x1d4559['shift']());}}}(a30_0x5e0b,0xed6a8));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x2d3e2d from'chalk';function formatRelativeTime(_0x4a48cf){const _0x33007e=a30_0x4eef,_0x1b2a3c=new Date(_0x4a48cf),_0x5f133d=new Date(),_0x53e722=_0x1b2a3c[_0x33007e(0x124)]()-_0x5f133d[_0x33007e(0x124)](),_0x2694b2=Math['abs'](_0x53e722)/0x3e8,_0x4d56d6=_0x53e722<0x0;if(_0x2694b2<0x3c)return _0x4d56d6?_0x33007e(0x162):_0x33007e(0x18d);else{if(_0x2694b2<0xe10){const _0xc3c0fc=Math[_0x33007e(0x12c)](_0x2694b2/0x3c);return _0x4d56d6?_0xc3c0fc+'m\x20ago':_0x33007e(0x174)+_0xc3c0fc+'m';}else{if(_0x2694b2<0x15180){const _0x23e453=Math[_0x33007e(0x12c)](_0x2694b2/0xe10);return _0x4d56d6?_0x23e453+_0x33007e(0x13d):_0x33007e(0x174)+_0x23e453+'h';}else{if(_0x2694b2<0x93a80){const _0x2b145e=Math[_0x33007e(0x12c)](_0x2694b2/0x15180);return _0x4d56d6?_0x2b145e+_0x33007e(0x194):_0x33007e(0x174)+_0x2b145e+'d';}else return _0x1b2a3c[_0x33007e(0x135)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x468473(0x120)]=a30_0x468473(0x12e);[a30_0x468473(0x115)]=a30_0x468473(0x141);async[a30_0x468473(0x178)](_0x4a1be3){const _0x432652=a30_0x468473,{options:_0x327b71,args:_0x27ce65,tdx:_0x4423ba}=_0x4a1be3,_0x5abddf=resolveLimit(_0x327b71['limit'],DEFAULT_DISPLAY_LIMIT),_0x1a2c51=_0x27ce65[0x0],_0x5cfec3=_0x1a2c51?_0x432652(0x150)+_0x1a2c51+_0x432652(0x163):_0x432652(0x179),_0x76fbec=await withSpinner(_0x5cfec3,()=>_0x4423ba[_0x432652(0x154)][_0x432652(0x170)]({'limit':_0x5abddf,'scheduled':!![],'pattern':_0x1a2c51}),{'verbose':_0x327b71[_0x432652(0x17d)]}),_0x45c46b=_0x76fbec[_0x432652(0x17c)][_0x432652(0x151)],_0x274986=_0x76fbec['data'][_0x432652(0x139)][_0x432652(0x13e)],_0x3f0617=_0x1a2c51?_0x432652(0x12f)+_0x1a2c51+'\x22':'';_0x274986?console[_0x432652(0x118)]('Showing\x20first\x20'+_0x45c46b[_0x432652(0x130)]+_0x432652(0x183)+_0x3f0617+_0x432652(0x198)):console[_0x432652(0x118)](_0x432652(0x14c)+_0x45c46b[_0x432652(0x130)]+_0x432652(0x199)+(_0x45c46b[_0x432652(0x130)]!==0x1?_0x432652(0x196):'y')+_0x3f0617);if(_0x327b71['format']===_0x432652(0x18b)||_0x327b71['format']===_0x432652(0x132)||_0x327b71[_0x432652(0x15f)]==='table'||_0x327b71[_0x432652(0x15f)]===_0x432652(0x16e)){const _0x12ff97=_0x45c46b['map'](_0xd6a44b=>({'id':_0xd6a44b['id'],'name':_0xd6a44b['name'],'cron':_0xd6a44b[_0x432652(0x185)],'database':_0xd6a44b[_0x432652(0x127)]?.[_0x432652(0x120)],'type':_0xd6a44b[_0x432652(0x181)],'timezone':_0xd6a44b[_0x432652(0x17e)],'user_name':_0xd6a44b['user']?.[_0x432652(0x120)],'updated_at':_0xd6a44b['updated_at'],'next_run_at':_0xd6a44b[_0x432652(0x156)],'last_job_status':_0xd6a44b[_0x432652(0x190)]?.[_0x432652(0x186)]}));await handleSDKOutput(_0x12ff97,_0x327b71);}else{if(_0x45c46b['length']===0x0)console[_0x432652(0x111)](_0x432652(0x157));else{const _0x109595=_0x327b71[_0x432652(0x15e)],_0x3dae87=_0x45c46b['map'](_0x322e90=>{const _0x204aa2=_0x432652,_0x17c96c=_0x322e90[_0x204aa2(0x190)]?.[_0x204aa2(0x186)]?_0x322e90[_0x204aa2(0x190)][_0x204aa2(0x186)]===_0x204aa2(0x128)?'✓':'✗':'-',_0x110d3a=_0x322e90[_0x204aa2(0x190)]?.[_0x204aa2(0x191)]?formatRelativeTime(_0x322e90[_0x204aa2(0x190)][_0x204aa2(0x191)]):_0x204aa2(0x177),_0x24df89=_0x322e90[_0x204aa2(0x156)]?formatRelativeTime(_0x322e90[_0x204aa2(0x156)]):'-',_0x281c91=_0x322e90[_0x204aa2(0x185)]||'',_0xb8ddc3=_0x322e90[_0x204aa2(0x120)]||_0x204aa2(0x169),_0x918379=getConsoleUrl(_0x109595,_0x204aa2(0x10e)+_0x322e90['id']);return{'statusIcon':_0x17c96c,'lastRun':_0x110d3a,'nextRun':_0x24df89,'cron':_0x281c91,'name':_0xb8ddc3,'queryUrl':_0x918379,'status':_0x322e90[_0x204aa2(0x190)]?.[_0x204aa2(0x186)]};}),_0x43cf74=Math[_0x432652(0x133)](..._0x3dae87[_0x432652(0x19c)](_0x48c1ad=>_0x48c1ad[_0x432652(0x11f)][_0x432652(0x130)])),_0x39acc0=Math[_0x432652(0x133)](..._0x3dae87['map'](_0x2b0759=>_0x2b0759[_0x432652(0x189)][_0x432652(0x130)])),_0x2402fa=Math[_0x432652(0x133)](..._0x3dae87[_0x432652(0x19c)](_0x32072c=>_0x32072c[_0x432652(0x185)][_0x432652(0x130)])),_0x27b5c9=_0x3dae87[_0x432652(0x19c)](_0xa537b4=>{const _0x5ab745=_0x432652,_0x28f3be=_0xa537b4[_0x5ab745(0x186)]==='success'?a30_0x2d3e2d[_0x5ab745(0x182)](_0xa537b4[_0x5ab745(0x12d)]):_0xa537b4[_0x5ab745(0x186)]===_0x5ab745(0x118)?a30_0x2d3e2d[_0x5ab745(0x152)](_0xa537b4[_0x5ab745(0x12d)]):a30_0x2d3e2d[_0x5ab745(0x114)](_0xa537b4[_0x5ab745(0x12d)]),_0x1d91d4=_0xa537b4[_0x5ab745(0x11f)][_0x5ab745(0x17a)](_0x43cf74),_0x475176=_0xa537b4[_0x5ab745(0x189)][_0x5ab745(0x17a)](_0x39acc0),_0x45bf35=_0xa537b4[_0x5ab745(0x185)]?a30_0x2d3e2d[_0x5ab745(0x11b)](_0xa537b4['cron'][_0x5ab745(0x17a)](_0x2402fa)):'\x20'[_0x5ab745(0x14b)](_0x2402fa),_0x5ed913=hyperlink(_0xa537b4[_0x5ab745(0x120)],_0xa537b4[_0x5ab745(0x195)]);return _0x5ab745(0x173)+_0x28f3be+'\x20'+_0x1d91d4+_0x5ab745(0x193)+_0x475176+'\x20\x20'+_0x45bf35+'\x20\x20'+_0x5ed913;});await writeOutput(_0x27b5c9[_0x432652(0x13c)]('\x0a'),_0x327b71[_0x432652(0x15b)],_0x432652(0x14e));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a30_0x468473(0x137);[a30_0x468473(0x115)]=a30_0x468473(0x176);[a30_0x468473(0x13a)](_0x2a4b90){const _0x5f20ef=a30_0x468473,_0x40d929=_0x2a4b90[_0x5f20ef(0x14a)][0x0];if(!_0x40d929)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x33f21a){const _0x31fc30=a30_0x468473,{options:_0x7c1aa3,args:_0xca728c,tdx:_0x5cc12b}=_0x33f21a,_0x1cec8b=_0xca728c[0x0],_0x27bd76=await withSpinner('Getting\x20schedule\x20details...',()=>_0x5cc12b[_0x31fc30(0x154)]['show'](_0x1cec8b),{'verbose':_0x7c1aa3[_0x31fc30(0x17d)]}),_0x4545a4=_0x27bd76['data'],_0x2d0449={'name':_0x4545a4[_0x31fc30(0x120)],'cron':_0x4545a4[_0x31fc30(0x185)],'database':_0x4545a4['database'],'type':_0x4545a4['type'],'timezone':_0x4545a4[_0x31fc30(0x134)],'user_name':_0x4545a4[_0x31fc30(0x172)],'created_at':_0x4545a4[_0x31fc30(0x12b)],'engine_version':_0x4545a4[_0x31fc30(0x11c)],'executing_user_id':_0x4545a4[_0x31fc30(0x16f)],'query':_0x4545a4[_0x31fc30(0x13b)],'delay':_0x4545a4[_0x31fc30(0x164)],'priority':_0x4545a4[_0x31fc30(0x15a)],'retry_limit':_0x4545a4[_0x31fc30(0x145)],..._0x4545a4[_0x31fc30(0x136)]&&{'result':_0x4545a4[_0x31fc30(0x136)]}};return await handleSingleObjectOutput(_0x2d0449,_0x7c1aa3),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x468473(0x120)]='schedule:create';['description']=a30_0x468473(0x144);[a30_0x468473(0x13a)](_0x119759){const _0x2c9d36=a30_0x468473,_0x332816=_0x119759[_0x2c9d36(0x14a)][0x0];if(!_0x332816)return _0x2c9d36(0x131);const _0x5d04eb=_0x119759['options'];if(!_0x5d04eb[_0x2c9d36(0x127)])return _0x2c9d36(0x117);return undefined;}async['execute'](_0x5b636e){const _0xba40f8=a30_0x468473,{options:_0x33bc55,args:_0x6f3a2f,tdx:_0x568be8}=_0x5b636e,_0x89a89=_0x6f3a2f[0x0],_0x4afec0=_0x33bc55,_0x4162f5=_0x4afec0[_0xba40f8(0x127)],_0x4be872=_0x4afec0[_0xba40f8(0x119)],_0x46a2be=_0x4afec0[_0xba40f8(0x181)]||_0xba40f8(0x159);let _0xbaf222;try{_0xbaf222=readFileSync(_0x4be872,'utf-8')['trim']();}catch(_0xd11a7e){throw new SDKError(ErrorCode[_0xba40f8(0x129)],_0xba40f8(0x10f)+_0x4be872,_0xd11a7e instanceof Error?_0xd11a7e:undefined);}if(!_0xbaf222)throw new SDKError(ErrorCode[_0xba40f8(0x129)],_0xba40f8(0x149));const _0x5d7053={'database':_0x4162f5,'query':_0xbaf222,'type':_0x46a2be};if(_0x4afec0['cron'])_0x5d7053['cron']=_0x4afec0[_0xba40f8(0x185)];if(_0x4afec0[_0xba40f8(0x134)])_0x5d7053['timezone']=_0x4afec0[_0xba40f8(0x134)];if(_0x4afec0['delay']!==undefined)_0x5d7053[_0xba40f8(0x164)]=Number(_0x4afec0['delay']);if(_0x4afec0[_0xba40f8(0x15a)]!==undefined)_0x5d7053[_0xba40f8(0x15a)]=Number(_0x4afec0[_0xba40f8(0x15a)]);if(_0x4afec0[_0xba40f8(0x110)]!==undefined)_0x5d7053['retry_limit']=Number(_0x4afec0[_0xba40f8(0x110)]);if(_0x4afec0[_0xba40f8(0x148)])_0x5d7053[_0xba40f8(0x11c)]=_0x4afec0['engineVersion'];if(_0x4afec0['result'])_0x5d7053[_0xba40f8(0x136)]=_0x4afec0[_0xba40f8(0x136)];if(_0x33bc55[_0xba40f8(0x17d)]){console[_0xba40f8(0x118)]('Creating\x20schedule:\x20'+_0x89a89),console['error'](_0xba40f8(0x188)+_0x4162f5),console[_0xba40f8(0x118)](_0xba40f8(0x160)+_0x46a2be);if(_0x5d7053['cron'])console[_0xba40f8(0x118)](_0xba40f8(0x16a)+_0x5d7053[_0xba40f8(0x185)]);if(_0x5d7053[_0xba40f8(0x134)])console[_0xba40f8(0x118)](_0xba40f8(0x15c)+_0x5d7053[_0xba40f8(0x134)]);}const _0x3855ec=await withSpinner(_0xba40f8(0x125),()=>_0x568be8['schedules'][_0xba40f8(0x18e)](_0x89a89,_0x5d7053),{'verbose':_0x33bc55[_0xba40f8(0x17d)]});return console['error']('Schedule\x20created:\x20'+_0x3855ec[_0xba40f8(0x17c)]['name']),await handleSingleObjectOutput(_0x3855ec[_0xba40f8(0x17c)],_0x33bc55),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x468473(0x120)]=a30_0x468473(0x11d);[a30_0x468473(0x115)]=a30_0x468473(0x126);[a30_0x468473(0x13a)](_0x177a1b){const _0x3af23c=a30_0x468473,_0x4466d2=_0x177a1b[_0x3af23c(0x14a)][0x0];if(!_0x4466d2)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a30_0x468473(0x178)](_0x2c7da4){const _0x5e505a=a30_0x468473,{options:_0x298ea8,args:_0x23631b,tdx:_0x10ee6e}=_0x2c7da4,_0xcd283c=_0x23631b[0x0],_0x5c575f=_0x298ea8,_0x4a3d10={};if(_0x5c575f['database'])_0x4a3d10[_0x5e505a(0x127)]=_0x5c575f[_0x5e505a(0x127)];if(_0x5c575f[_0x5e505a(0x181)])_0x4a3d10[_0x5e505a(0x181)]=_0x5c575f[_0x5e505a(0x181)];if(_0x5c575f['cron'])_0x4a3d10[_0x5e505a(0x185)]=_0x5c575f[_0x5e505a(0x185)];if(_0x5c575f[_0x5e505a(0x134)])_0x4a3d10['timezone']=_0x5c575f[_0x5e505a(0x134)];if(_0x5c575f[_0x5e505a(0x164)]!==undefined)_0x4a3d10[_0x5e505a(0x164)]=Number(_0x5c575f[_0x5e505a(0x164)]);if(_0x5c575f[_0x5e505a(0x15a)]!==undefined)_0x4a3d10[_0x5e505a(0x15a)]=Number(_0x5c575f[_0x5e505a(0x15a)]);if(_0x5c575f[_0x5e505a(0x110)]!==undefined)_0x4a3d10[_0x5e505a(0x145)]=Number(_0x5c575f[_0x5e505a(0x110)]);if(_0x5c575f[_0x5e505a(0x148)])_0x4a3d10[_0x5e505a(0x11c)]=_0x5c575f[_0x5e505a(0x148)];if(_0x5c575f[_0x5e505a(0x136)])_0x4a3d10[_0x5e505a(0x136)]=_0x5c575f['result'];if(_0x5c575f['file'])try{_0x4a3d10[_0x5e505a(0x13b)]=readFileSync(_0x5c575f[_0x5e505a(0x119)],_0x5e505a(0x143))[_0x5e505a(0x10d)]();}catch(_0xc0d361){throw new SDKError(ErrorCode[_0x5e505a(0x129)],_0x5e505a(0x10f)+_0x5c575f[_0x5e505a(0x119)],_0xc0d361 instanceof Error?_0xc0d361:undefined);}if(Object[_0x5e505a(0x16d)](_0x4a3d10)['length']===0x0)throw new SDKError(ErrorCode[_0x5e505a(0x129)],_0x5e505a(0x11a));if(_0x298ea8[_0x5e505a(0x17d)]){console[_0x5e505a(0x118)](_0x5e505a(0x187)+_0xcd283c);for(const [_0x41c055,_0x530216]of Object['entries'](_0x4a3d10)){_0x41c055===_0x5e505a(0x13b)?console[_0x5e505a(0x118)]('\x20\x20'+_0x41c055+':\x20'+_0x530216[_0x5e505a(0x19b)](0x0,0x32)+'...'):console[_0x5e505a(0x118)]('\x20\x20'+_0x41c055+':\x20'+_0x530216);}}const _0x121070=await withSpinner(_0x5e505a(0x12a),()=>_0x10ee6e['schedules'][_0x5e505a(0x146)](_0xcd283c,_0x4a3d10),{'verbose':_0x298ea8[_0x5e505a(0x17d)]});return console[_0x5e505a(0x118)](_0x5e505a(0x14f)+_0x121070[_0x5e505a(0x17c)]['name']),await handleSingleObjectOutput(_0x121070[_0x5e505a(0x17c)],_0x298ea8),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x468473(0x120)]=a30_0x468473(0x14d);[a30_0x468473(0x115)]='Delete\x20a\x20scheduled\x20query';[a30_0x468473(0x13a)](_0x45c517){const _0x4d4d63=a30_0x468473,_0x3879c4=_0x45c517[_0x4d4d63(0x14a)][0x0];if(!_0x3879c4)return _0x4d4d63(0x123);return undefined;}async['execute'](_0x221ddd){const _0x2dfa13=a30_0x468473,{options:_0x1b7c5b,args:_0x5c96ad,tdx:_0x5dfa8c}=_0x221ddd,_0xf3e297=_0x5c96ad[0x0];if(!_0x1b7c5b[_0x2dfa13(0x168)]){const _0x1eb380=await confirm(_0x2dfa13(0x13f)+_0xf3e297+'\x22?');if(!_0x1eb380)return console[_0x2dfa13(0x118)]('Cancelled'),0x0;}const _0x28266a=await withSpinner(_0x2dfa13(0x155),()=>_0x5dfa8c[_0x2dfa13(0x154)][_0x2dfa13(0x16c)](_0xf3e297),{'verbose':_0x1b7c5b['verbose']});return console[_0x2dfa13(0x118)]('Schedule\x20deleted:\x20'+_0x28266a[_0x2dfa13(0x17c)][_0x2dfa13(0x120)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a30_0x468473(0x192);[a30_0x468473(0x115)]=a30_0x468473(0x122);[a30_0x468473(0x13a)](_0x2aea68){const _0x2d798e=_0x2aea68['args'][0x0];if(!_0x2d798e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a30_0x468473(0x178)](_0xe74f1c){const _0x7111de=a30_0x468473,{options:_0x2e7d39,args:_0x226102,tdx:_0x44cb97}=_0xe74f1c,_0x33c1e9=_0x226102[0x0],_0x4c4313=_0x2e7d39,_0x3a77fb=_0x4c4313[_0x7111de(0x158)],_0x5d5db6=_0x4c4313[_0x7111de(0x167)]!==undefined?Number(_0x4c4313['num']):undefined;if(_0x2e7d39[_0x7111de(0x17d)]){console['error'](_0x7111de(0x15d)+_0x33c1e9);if(_0x3a77fb)console['error'](_0x7111de(0x11e)+_0x3a77fb);if(_0x5d5db6)console[_0x7111de(0x118)](_0x7111de(0x18c)+_0x5d5db6);}const _0x34c448=await withSpinner(_0x7111de(0x147),()=>_0x44cb97[_0x7111de(0x154)][_0x7111de(0x142)](_0x33c1e9,{'time':_0x3a77fb,'num':_0x5d5db6}),{'verbose':_0x2e7d39[_0x7111de(0x17d)]}),_0x22fbb2=_0x34c448[_0x7111de(0x17c)][_0x7111de(0x17b)];console['error'](_0x7111de(0x116)+_0x22fbb2[_0x7111de(0x130)]+_0x7111de(0x197)+(_0x22fbb2[_0x7111de(0x130)]!==0x1?'s':'')+'\x20created');for(const _0x208fa7 of _0x22fbb2){console[_0x7111de(0x118)](_0x7111de(0x165)+_0x208fa7[_0x7111de(0x140)]);}return await handleSDKOutput(_0x22fbb2,_0x2e7d39),0x0;}}function a30_0x4eef(_0x577e3a,_0x3dc60c){_0x577e3a=_0x577e3a-0x10d;const _0x5e0b01=a30_0x5e0b();let _0x4eefb0=_0x5e0b01[_0x577e3a];return _0x4eefb0;}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x468473(0x120)]=a30_0x468473(0x171);['description']='Show\x20schedule\x20execution\x20history';[a30_0x468473(0x13a)](_0x14ab88){const _0x4a7ed7=_0x14ab88['args'][0x0];if(!_0x4a7ed7)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a30_0x468473(0x178)](_0x2bc7b3){const _0x2f3c5c=a30_0x468473,{options:_0xc0fcc1,args:_0x590274,tdx:_0xab2ac}=_0x2bc7b3,_0x2c2711=_0x590274[0x0],_0x3356dc=_0xc0fcc1,_0x3dc796=_0x3356dc[_0x2f3c5c(0x175)]!==undefined?Number(_0x3356dc[_0x2f3c5c(0x175)]):undefined,_0x39d1b7=_0x3356dc['to']!==undefined?Number(_0x3356dc['to']):undefined,_0x5a3446=await withSpinner('Getting\x20schedule\x20history...',()=>_0xab2ac['schedules']['history'](_0x2c2711,{'from':_0x3dc796,'to':_0x39d1b7}),{'verbose':_0xc0fcc1[_0x2f3c5c(0x17d)]}),_0x5c20b4=_0x5a3446['data'];console['error'](_0x2f3c5c(0x14c)+_0x5c20b4[_0x2f3c5c(0x153)]+'\x20execution'+(_0x5c20b4[_0x2f3c5c(0x153)]!==0x1?'s':'')+_0x2f3c5c(0x112)+_0x5c20b4['from']+'-'+_0x5c20b4['to']+')');const _0x4940a9=_0x5c20b4['history'][_0x2f3c5c(0x19c)](_0x1899d7=>({'job_id':_0x1899d7[_0x2f3c5c(0x140)],'type':_0x1899d7['type'],'status':_0x1899d7[_0x2f3c5c(0x186)],'scheduled_at':_0x1899d7['scheduled_at'],'created_at':_0x1899d7['created_at'],'start_at':_0x1899d7[_0x2f3c5c(0x18a)],'end_at':_0x1899d7[_0x2f3c5c(0x138)]}));return await handleSDKOutput(_0x4940a9,_0xc0fcc1),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x35e85e=a31_0x4c50;(function(_0x401dab,_0x109d7b){const _0x3f06ce=a31_0x4c50,_0x324e14=_0x401dab();while(!![]){try{const _0x4b339a=-parseInt(_0x3f06ce(0x1f0))/0x1*(-parseInt(_0x3f06ce(0x1fd))/0x2)+parseInt(_0x3f06ce(0x1ea))/0x3+-parseInt(_0x3f06ce(0x18d))/0x4*(parseInt(_0x3f06ce(0x1b1))/0x5)+parseInt(_0x3f06ce(0x1ba))/0x6*(-parseInt(_0x3f06ce(0x182))/0x7)+parseInt(_0x3f06ce(0x17e))/0x8+-parseInt(_0x3f06ce(0x1bc))/0x9*(-parseInt(_0x3f06ce(0x19c))/0xa)+-parseInt(_0x3f06ce(0x1ce))/0xb*(parseInt(_0x3f06ce(0x198))/0xc);if(_0x4b339a===_0x109d7b)break;else _0x324e14['push'](_0x324e14['shift']());}catch(_0xa65987){_0x324e14['push'](_0x324e14['shift']());}}}(a31_0x5ce7,0x1f710));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 a31_0x4c50(_0x5e790e,_0x4813dd){_0x5e790e=_0x5e790e-0x167;const _0x5ce7c0=a31_0x5ce7();let _0x4c5057=_0x5ce7c0[_0x5e790e];return _0x4c5057;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0x162462 from'chalk';async function resolveSegmentTarget(_0x17e73e,_0x51cba6,_0x16456d){const _0x399dce=a31_0x4c50;if(isYamlFilePath(_0x17e73e))try{const _0x45f4a2=await resolveYamlFilePath(_0x17e73e);return _0x16456d&&(console[_0x399dce(0x1ad)](_0x399dce(0x1e3)+_0x17e73e),console[_0x399dce(0x1ad)](_0x399dce(0x19e)+_0x45f4a2[_0x399dce(0x167)]),console[_0x399dce(0x1ad)]('\x20\x20Segment\x20name:\x20'+_0x45f4a2[_0x399dce(0x1cd)]),console[_0x399dce(0x1ad)]('\x20\x20Folder\x20path:\x20'+(_0x45f4a2['folderPath']||'(root)')),console[_0x399dce(0x1ad)](_0x399dce(0x1e9)+_0x45f4a2[_0x399dce(0x19a)])),_0x45f4a2[_0x399dce(0x19a)];}catch(_0x31d430){throw new SDKError(ErrorCode[_0x399dce(0x180)],_0x399dce(0x1b9)+_0x31d430[_0x399dce(0x19b)]);}if(!_0x51cba6)throw new SDKError(ErrorCode[_0x399dce(0x180)],_0x399dce(0x1b7));return _0x51cba6+'/'+_0x17e73e;}export class SegmentDescribeCommand extends BaseCommand{['name']=a31_0x35e85e(0x17a);['description']=a31_0x35e85e(0x16e);async[a31_0x35e85e(0x207)](_0x137fee){const _0xd0953a=a31_0x35e85e,{options:_0x4639d4,args:_0x9ad1b9,tdx:_0x124d0b}=_0x137fee,_0xd36075=_0x9ad1b9[0x0],_0x5a0d8d=!_0xd36075&&!!_0x4639d4[_0xd0953a(0x167)],_0x1e5812=_0xd36075||_0x4639d4['parentSegment'];if(!_0x1e5812)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0xd0953a(0x1ad)](_0xd0953a(0x1a5)),console[_0xd0953a(0x1ad)]('Examples:'),console[_0xd0953a(0x1ad)](_0xd0953a(0x189)),console[_0xd0953a(0x1ad)](_0xd0953a(0x1fe)),console[_0xd0953a(0x1ad)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0xd0953a(0x1ad)](_0xd0953a(0x1be)),0x1;try{const _0x335ddf=_0x4639d4[_0xd0953a(0x18a)];let _0x356d2f=_0x1e5812;!_0x5a0d8d&&_0x335ddf&&!_0x1e5812['includes']('/')&&(_0x356d2f=_0x335ddf+'/'+_0x1e5812,_0x4639d4[_0xd0953a(0x16b)]&&console[_0xd0953a(0x1ad)](_0xd0953a(0x211)+_0x356d2f));const _0x795736=await withSpinner(_0xd0953a(0x1c7)+_0x356d2f+_0xd0953a(0x1cc),()=>_0x124d0b[_0xd0953a(0x194)][_0xd0953a(0x1eb)](_0x356d2f),{'verbose':_0x4639d4[_0xd0953a(0x16b)]}),_0x521e92=_0x795736[_0xd0953a(0x1ab)];_0x4639d4[_0xd0953a(0x16b)]&&(console[_0xd0953a(0x1ad)](_0xd0953a(0x16f)+_0x521e92[_0xd0953a(0x192)]),console['error'](_0xd0953a(0x1b8)+_0x521e92['parentId']),_0x521e92[_0xd0953a(0x18c)]&&console[_0xd0953a(0x1ad)](_0xd0953a(0x177)+_0x521e92[_0xd0953a(0x18c)]),_0x521e92[_0xd0953a(0x1bb)]&&console[_0xd0953a(0x1ad)](_0xd0953a(0x1ff)+_0x521e92[_0xd0953a(0x1bb)]));if(_0x521e92[_0xd0953a(0x192)]===_0xd0953a(0x1ec)){const _0x4222c6=await withSpinner(_0xd0953a(0x1a7),()=>_0x124d0b[_0xd0953a(0x194)]['getParent'](_0x521e92[_0xd0953a(0x1d9)]),{'verbose':_0x4639d4['verbose']});await handleSingleObjectOutput(_0x4222c6[_0xd0953a(0x1ab)],_0x4639d4);}else{if(_0x521e92[_0xd0953a(0x192)]===_0xd0953a(0x210)){if(!_0x521e92['folderId'])throw new SDKError(ErrorCode[_0xd0953a(0x1cf)],_0xd0953a(0x1f8));const _0x52e79a=await withSpinner(_0xd0953a(0x1fb),()=>_0x124d0b[_0xd0953a(0x194)]['getFolder'](_0x521e92[_0xd0953a(0x18c)]),{'verbose':_0x4639d4[_0xd0953a(0x16b)]});await handleSingleObjectOutput(_0x52e79a[_0xd0953a(0x1ab)],_0x4639d4);}else{if(_0x521e92['type']==='segment'){if(!_0x521e92[_0xd0953a(0x1bb)])throw new SDKError(ErrorCode[_0xd0953a(0x176)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4fafb5=await withSpinner(_0xd0953a(0x172),()=>_0x124d0b[_0xd0953a(0x194)][_0xd0953a(0x1f7)](_0x521e92[_0xd0953a(0x1d9)],_0x521e92[_0xd0953a(0x1bb)]),{'verbose':_0x4639d4[_0xd0953a(0x16b)]});await handleSingleObjectOutput(_0x4fafb5[_0xd0953a(0x1ab)],_0x4639d4);}}}return 0x0;}catch(_0x503db6){if(_0x503db6 instanceof SDKError)return console[_0xd0953a(0x1ad)]('Error:\x20'+_0x503db6[_0xd0953a(0x19b)]),_0x503db6['cause']&&console[_0xd0953a(0x1ad)](_0xd0953a(0x1ed)+_0x503db6[_0xd0953a(0x1ae)]),0x1;throw _0x503db6;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x35e85e(0x1a8)]=a31_0x35e85e(0x1c4);[a31_0x35e85e(0x202)]=a31_0x35e85e(0x193);async[a31_0x35e85e(0x207)](_0x53f0cd){const _0x535c19=a31_0x35e85e,{options:_0xf88972,args:_0x393c3d,tdx:_0x31322c}=_0x53f0cd,_0x365250=_0x393c3d[0x0];if(!_0x365250)return console['error'](_0x535c19(0x173)),console['error'](_0x535c19(0x1dc)),console[_0x535c19(0x1ad)](_0x535c19(0x171)),console['error']('Examples:'),console[_0x535c19(0x1ad)](_0x535c19(0x201)),console[_0x535c19(0x1ad)](_0x535c19(0x1af)),0x1;try{const _0x16ef3a=_0xf88972['parentSegment'],_0x39ea10=await resolveSegmentTarget(_0x365250,_0x16ef3a,_0xf88972[_0x535c19(0x16b)]);_0xf88972[_0x535c19(0x16b)]&&console[_0x535c19(0x1ad)](_0x535c19(0x1a0)+_0x39ea10);const _0x2f0f61=await withSpinner('Resolving\x20\x27'+_0x365250+_0x535c19(0x1cc),()=>_0x31322c[_0x535c19(0x194)][_0x535c19(0x1eb)](_0x39ea10),{'verbose':_0xf88972[_0x535c19(0x16b)]}),_0x1bcdcb=_0x2f0f61[_0x535c19(0x1ab)];_0xf88972[_0x535c19(0x16b)]&&(console[_0x535c19(0x1ad)](_0x535c19(0x16f)+_0x1bcdcb[_0x535c19(0x192)]),console['error'](_0x535c19(0x1b8)+_0x1bcdcb['parentId']));if(_0x1bcdcb[_0x535c19(0x192)]===_0x535c19(0x210))return console[_0x535c19(0x1ad)](_0x535c19(0x18e)),console[_0x535c19(0x1ad)](_0x535c19(0x1b5)),0x1;if(_0x1bcdcb[_0x535c19(0x192)]==='parent')return console['error'](_0x535c19(0x205)),console[_0x535c19(0x1ad)](_0x535c19(0x208)),0x1;if(!_0x1bcdcb[_0x535c19(0x1bb)])throw new SDKError(ErrorCode[_0x535c19(0x176)],_0x535c19(0x1d8));const _0x448772=await withSpinner(_0x535c19(0x1b4),()=>_0x31322c[_0x535c19(0x194)][_0x535c19(0x1e0)](_0x1bcdcb[_0x535c19(0x1d9)],_0x1bcdcb[_0x535c19(0x1bb)]),{'verbose':_0xf88972[_0x535c19(0x16b)]});let _0x54b92d=_0x448772['data'];const _0x302a14=resolveLimit(_0xf88972[_0x535c19(0x20e)],DEFAULT_DISPLAY_LIMIT),_0x256357=/\bLIMIT\s+\d+/i['test'](_0x54b92d);!_0x256357&&(_0x54b92d=_0x54b92d[_0x535c19(0x206)]()[_0x535c19(0x20f)](/;+$/,''),_0x54b92d=_0x535c19(0x1d1)+_0x54b92d+_0x535c19(0x204)+_0x302a14);_0xf88972[_0x535c19(0x16b)]&&console['error'](_0x535c19(0x185)+_0x54b92d);const _0x3f905d=await withProgressSpinner(_0x535c19(0x188),async _0x2596a5=>{const _0x3223e2=_0x535c19,_0x32a5e6=await _0x31322c[_0x3223e2(0x16d)][_0x3223e2(0x207)](_0x54b92d,{'catalog':'td','schema':_0x3223e2(0x1d3),'onJobId':_0x1570e3=>{const _0x3675da=_0x3223e2;_0x2596a5[_0x3675da(0x1ee)](_0x1570e3);}});return _0x32a5e6;},{'verbose':_0xf88972[_0x535c19(0x16b)]}),_0x3ecbd9=_0x3f905d[_0x535c19(0x1ab)],_0x284117=_0x3ecbd9['jobId']?_0x535c19(0x17b)+_0x3ecbd9[_0x535c19(0x20a)]+']':'';return console[_0x535c19(0x1ad)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x3ecbd9['stats'][_0x535c19(0x200)]['toLocaleString']()+'\x20rows\x20'+(_0x535c19(0x1df)+formatElapsed(_0x3ecbd9['stats'][_0x535c19(0x1d2)])+_0x284117)),await handleQueryOutput(_0x3ecbd9,_0xf88972),0x0;}catch(_0x2542e2){if(_0x2542e2 instanceof SDKError)return console[_0x535c19(0x1ad)]('✖\x20Query\x20failed\x20['+_0x2542e2[_0x535c19(0x1ca)]+']'),console[_0x535c19(0x1ad)]('\x0a'+_0x2542e2[_0x535c19(0x19b)]),0x1;throw _0x2542e2;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a31_0x35e85e(0x1d5);[a31_0x35e85e(0x202)]=a31_0x35e85e(0x183);async[a31_0x35e85e(0x207)](_0x456cd7){const _0x30a4bf=a31_0x35e85e,{options:_0x4a6991,args:_0x5ebfc4,tdx:_0x3aaf52}=_0x456cd7;if(_0x5ebfc4[_0x30a4bf(0x1f9)]===0x0)return console['error'](_0x30a4bf(0x1b2)),console[_0x30a4bf(0x1ad)](_0x30a4bf(0x1b6)),0x1;const _0x26ab54=_0x5ebfc4[0x0];try{_0x4a6991[_0x30a4bf(0x16b)]&&(console[_0x30a4bf(0x1ad)](_0x30a4bf(0x1c1)+_0x4a6991[_0x30a4bf(0x19d)]),console[_0x30a4bf(0x1ad)](_0x30a4bf(0x1d7)+_0x26ab54));const _0x4a6f96=await withSpinner(_0x30a4bf(0x1f5)+_0x26ab54+_0x30a4bf(0x1cc),()=>_0x3aaf52[_0x30a4bf(0x194)][_0x30a4bf(0x196)](_0x26ab54),{'verbose':_0x4a6991['verbose']}),_0x2e6b9e=_0x4a6f96[_0x30a4bf(0x1ab)];_0x4a6991[_0x30a4bf(0x16b)]&&console[_0x30a4bf(0x1ad)](_0x30a4bf(0x1e4)+_0x2e6b9e);const _0x4449d4=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x26ab54+_0x30a4bf(0x1cc),()=>_0x3aaf52[_0x30a4bf(0x194)][_0x30a4bf(0x1ef)](_0x2e6b9e),{'verbose':_0x4a6991[_0x30a4bf(0x16b)]}),_0x4515f5=_0x4449d4[_0x30a4bf(0x1ab)];return console[_0x30a4bf(0x1ad)](_0x30a4bf(0x1a1)+_0x4515f5[_0x30a4bf(0x1f9)]+_0x30a4bf(0x1f2)+(_0x4515f5[_0x30a4bf(0x1f9)]!==0x1?'s':'')),await handleSDKOutput(_0x4515f5,_0x4a6991),0x0;}catch(_0x3040b8){if(_0x3040b8 instanceof SDKError)return console[_0x30a4bf(0x1ad)](_0x30a4bf(0x1e5)+_0x3040b8['message']),_0x3040b8['cause']&&console['error'](_0x30a4bf(0x1ed)+_0x3040b8[_0x30a4bf(0x1ae)]),0x1;throw _0x3040b8;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x35e85e(0x1a8)]=a31_0x35e85e(0x1b3);['description']=a31_0x35e85e(0x1c3);async[a31_0x35e85e(0x207)](_0x10a6c4){const _0x21b33f=a31_0x35e85e,{options:_0x3efd10,args:_0x520a7c,tdx:_0x48d351}=_0x10a6c4;if(_0x520a7c[_0x21b33f(0x1f9)]===0x0)return console[_0x21b33f(0x1ad)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x21b33f(0x1ad)](_0x21b33f(0x199)),0x1;try{const {parentId:_0x55fcfc,childId:_0x124342}=parseSegmentRef(_0x520a7c[0x0]);_0x3efd10[_0x21b33f(0x16b)]&&(console[_0x21b33f(0x1ad)](_0x21b33f(0x1c1)+_0x3efd10[_0x21b33f(0x19d)]),console[_0x21b33f(0x1ad)]('Parent\x20name:\x20'+_0x55fcfc),_0x124342&&console['error'](_0x21b33f(0x1c9)+_0x124342));if(!_0x124342)return console[_0x21b33f(0x1ad)](_0x21b33f(0x1a9)),0x1;const _0xb9fa98=await withSpinner(_0x21b33f(0x1f5)+_0x55fcfc+_0x21b33f(0x1cc),()=>_0x48d351['segment'][_0x21b33f(0x196)](_0x55fcfc),{'verbose':_0x3efd10[_0x21b33f(0x16b)]}),_0x1057e2=_0xb9fa98['data'];_0x3efd10[_0x21b33f(0x16b)]&&console['error'](_0x21b33f(0x1e4)+_0x1057e2);const _0x1640b8=await withSpinner(_0x21b33f(0x20d)+_0x124342+'\x27...',()=>_0x48d351[_0x21b33f(0x194)][_0x21b33f(0x1a2)](_0x1057e2,_0x124342),{'verbose':_0x3efd10[_0x21b33f(0x16b)]}),_0x2cebb7=_0x1640b8[_0x21b33f(0x1ab)];_0x3efd10[_0x21b33f(0x16b)]&&console[_0x21b33f(0x1ad)](_0x21b33f(0x1d4)+_0x2cebb7);const _0x2a511b=await withSpinner(_0x21b33f(0x1f1)+_0x124342+_0x21b33f(0x1cc),()=>_0x48d351['segment']['getFolder'](_0x2cebb7),{'verbose':_0x3efd10[_0x21b33f(0x16b)]});return await handleSDKOutput([_0x2a511b[_0x21b33f(0x1ab)]],_0x3efd10),0x0;}catch(_0x2ab5dd){if(_0x2ab5dd instanceof SDKError)return console[_0x21b33f(0x1ad)](_0x21b33f(0x1e5)+_0x2ab5dd[_0x21b33f(0x19b)]),_0x2ab5dd[_0x21b33f(0x1ae)]&&console[_0x21b33f(0x1ad)](_0x21b33f(0x1ed)+_0x2ab5dd[_0x21b33f(0x1ae)]),0x1;throw _0x2ab5dd;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x35e85e(0x1a8)]=a31_0x35e85e(0x1c2);[a31_0x35e85e(0x202)]=a31_0x35e85e(0x170);async['execute'](_0x418659){const _0x467e58=a31_0x35e85e,{options:_0x4b653d,args:_0x54d8e2}=_0x418659,_0x512f5f=_0x4b653d,_0x16afe9=_0x512f5f[_0x467e58(0x1f4)],_0x29948f=_0x54d8e2[0x0];if(!_0x29948f&&!_0x16afe9)return console[_0x467e58(0x1ad)](a31_0x162462['red'](_0x467e58(0x209))),console[_0x467e58(0x1ad)](_0x467e58(0x1e8)),console[_0x467e58(0x1ad)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x467e58(0x1bd)),console[_0x467e58(0x1ad)](_0x467e58(0x195)),console[_0x467e58(0x1ad)](_0x467e58(0x1c0)),console['error'](_0x467e58(0x197)),0x1;if(_0x29948f&&_0x16afe9)return console['error'](a31_0x162462[_0x467e58(0x1f6)](_0x467e58(0x1a4))),0x1;try{let _0x4ff4a7;if(_0x16afe9)_0x4ff4a7=await this[_0x467e58(0x18b)](_0x16afe9,_0x418659);else{if(isYamlFilePath(_0x29948f))return console[_0x467e58(0x1ad)](a31_0x162462[_0x467e58(0x1f6)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x467e58(0x1ad)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0x29948f),0x1;else _0x4ff4a7=await this[_0x467e58(0x190)](_0x29948f,_0x418659);}return _0x4b653d[_0x467e58(0x203)]===_0x467e58(0x1c6)||_0x4b653d[_0x467e58(0x203)]===_0x467e58(0x175)?await handleSDKOutput([{'sql':_0x4ff4a7}],_0x4b653d):console[_0x467e58(0x1de)](_0x4ff4a7),0x0;}catch(_0x21748d){if(_0x21748d instanceof SDKError)return console[_0x467e58(0x1ad)](_0x467e58(0x1e5)+_0x21748d[_0x467e58(0x19b)]),_0x21748d['cause']&&console[_0x467e58(0x1ad)](_0x467e58(0x1ed)+_0x21748d['cause']),0x1;throw _0x21748d;}}async[a31_0x35e85e(0x18b)](_0x3a3988,_0x32d4f0){const _0x479cab=a31_0x35e85e,{options:_0x5c543b,tdx:_0x312c97}=_0x32d4f0;let _0x1325e8;try{_0x1325e8=await resolveYamlFilePath(_0x3a3988);}catch(_0x5f05b0){throw new SDKError(ErrorCode[_0x479cab(0x180)],_0x479cab(0x1b9)+_0x5f05b0[_0x479cab(0x19b)]);}_0x5c543b[_0x479cab(0x16b)]&&console[_0x479cab(0x1ad)](_0x479cab(0x16a)+_0x1325e8[_0x479cab(0x167)]+'/'+_0x1325e8[_0x479cab(0x1cd)]);const _0x1797e3=await withSpinner(_0x479cab(0x1e6),()=>_0x312c97[_0x479cab(0x194)]['getSegmentSQLFromYaml'](_0x1325e8[_0x479cab(0x184)],_0x1325e8[_0x479cab(0x167)],_0x1325e8[_0x479cab(0x1cd)]),{'verbose':_0x5c543b['verbose']});return _0x1797e3[_0x479cab(0x1ab)];}async[a31_0x35e85e(0x190)](_0x4e7ab5,_0x3fdf51){const _0x55e66d=a31_0x35e85e,{options:_0x452c10,tdx:_0x10bf02}=_0x3fdf51,_0x500bc3=_0x452c10[_0x55e66d(0x167)],_0x15cb0e=await resolveSegmentTarget(_0x4e7ab5,_0x500bc3,_0x452c10['verbose']);_0x452c10[_0x55e66d(0x16b)]&&console[_0x55e66d(0x1ad)](_0x55e66d(0x1a0)+_0x15cb0e);const _0x11b5ca=await withSpinner(_0x55e66d(0x1aa)+_0x4e7ab5+_0x55e66d(0x1cc),()=>_0x10bf02[_0x55e66d(0x194)][_0x55e66d(0x1eb)](_0x15cb0e),{'verbose':_0x452c10[_0x55e66d(0x16b)]}),_0x5e4b77=_0x11b5ca[_0x55e66d(0x1ab)];_0x452c10[_0x55e66d(0x16b)]&&(console[_0x55e66d(0x1ad)](_0x55e66d(0x16f)+_0x5e4b77[_0x55e66d(0x192)]),console[_0x55e66d(0x1ad)](_0x55e66d(0x1b8)+_0x5e4b77['parentId']));if(_0x5e4b77[_0x55e66d(0x192)]===_0x55e66d(0x210))throw new SDKError(ErrorCode[_0x55e66d(0x180)],_0x55e66d(0x1da));if(_0x5e4b77[_0x55e66d(0x192)]===_0x55e66d(0x1ec))throw new SDKError(ErrorCode[_0x55e66d(0x180)],_0x55e66d(0x17d));if(!_0x5e4b77[_0x55e66d(0x1bb)])throw new SDKError(ErrorCode[_0x55e66d(0x176)],_0x55e66d(0x1d8));const _0x4956c9=await withSpinner(_0x55e66d(0x1b4),()=>_0x10bf02[_0x55e66d(0x194)][_0x55e66d(0x1e0)](_0x5e4b77[_0x55e66d(0x1d9)],_0x5e4b77[_0x55e66d(0x1bb)]),{'verbose':_0x452c10[_0x55e66d(0x16b)]});return _0x4956c9[_0x55e66d(0x1ab)];}}function a31_0x5ce7(){const _0x598c7d=['16914LTtTJx','segmentId','18FAfJus','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','createFolder','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Site:\x20','segment:sql','Show\x20segment\x20folder\x20details','segment:show','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','json','Resolving\x20path\x20\x27','segment:folder:create','Folder\x20name:\x20','code','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x27...','segmentName','55BjyiRP','SEGMENT_FOLDER_NOT_FOUND','\x20Opening\x20','SELECT\x20*\x20FROM\x20(\x0a','elapsedTimeMillis','information_schema','Resolved\x20folder\x20ID:\x20','segment:folder:list','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Parent\x20name:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','parentId','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','log','in\x20','getSegmentSQL','url','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Resolved\x20YAML\x20file:\x20','Resolved\x20parent\x20ID:\x20','Error:\x20','Fetching\x20SQL\x20from\x20rule...','Use:\x20tdx\x20ps\x20view\x20-w','Usage:','\x20\x20Full\x20path:\x20','536163UAdTYn','resolvePathToResource','parent','\x20\x20Cause:\x20','setJobId','listFolders','5jdxksK','Fetching\x20folder\x20\x27','\x20folder','Use:\x20tdx\x20ps\x20desc','path','Resolving\x20parent\x20segment\x20\x27','red','getSegment','Folder\x20ID\x20missing\x20from\x20resolved\x20path','length','Creating\x20folder\x20\x27','Fetching\x20folder\x20details...','/app/ps/','7102wgpKzI','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Segment\x20ID:\x20','processedRows','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','description','format','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','trim','execute','Use:\x20tdx\x20ps\x20show','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','jobId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20view','Resolving\x20folder\x20\x27','limit','replace','folder','Resolved\x20relative\x20path\x20to:\x20','parentSegment','parentFolder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Resolved:\x20','verbose','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','query','Show\x20segment\x20or\x20folder\x20details','Resolved\x20type:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Fetching\x20segment\x20details...','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment:desc','jsonl','SEGMENT_NOT_FOUND','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','segment:describe','\x20[Job\x20ID:\x20','Options:','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','1909776sYyoGA','Show\x20folder\x20or\x20child\x20segment\x20details','INVALID_ARGUMENT','segment:view','469FUFdqJ','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','content','SQL\x20query:\x0a','Resolving\x20parent\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20desc\x20<name>','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','segmentPath','getSQLFromYamlFile','folderId','8lltAcF','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','getSQLFromServerSegment','✔\x20Created\x20folder\x20\x27','type','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','segment','Examples:','resolveParentId','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','416124MApOpr','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','fullPath','message','1186660cqnFkD','site','\x20\x20Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Target\x20path:\x20','✔\x20Found\x20','resolveFolderId','\x27\x20with\x20ID:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Usage:\x20tdx\x20segment\x20describe\x20<path>','getFolder','Fetching\x20parent\x20segment\x20details...','name','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Resolving\x20\x27','data','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','error','cause','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Create\x20segment\x20folder\x20for\x20organization','453720ngjran','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:folder:show','Fetching\x20SQL\x20for\x20segment...','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Parent\x20ID:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'];a31_0x5ce7=function(){return _0x598c7d;};return a31_0x5ce7();}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x35e85e(0x1a8)]=a31_0x35e85e(0x1c8);[a31_0x35e85e(0x202)]=a31_0x35e85e(0x1b0);async[a31_0x35e85e(0x207)](_0x1e2088){const _0x4d8185=a31_0x35e85e,{options:_0x216158,args:_0x2a8a07,tdx:_0x320e53}=_0x1e2088,_0x3af815=_0x216158;if(_0x2a8a07['length']<0x2)return console[_0x4d8185(0x1ad)](_0x4d8185(0x20b)),console[_0x4d8185(0x1ad)](_0x4d8185(0x178)),0x1;const _0x55a7e4=_0x2a8a07[0x0],_0x280bcc=_0x2a8a07[0x1];_0x3af815['verbose']&&(console[_0x4d8185(0x1ad)](_0x4d8185(0x1c1)+_0x3af815[_0x4d8185(0x19d)]),console['error']('Parent\x20segment:\x20'+_0x55a7e4),console[_0x4d8185(0x1ad)](_0x4d8185(0x1c9)+_0x280bcc));let _0x507a7c;if(_0x3af815[_0x4d8185(0x168)]){const _0x21cce6=_0x3af815[_0x4d8185(0x168)],_0x449c04=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x55a7e4+_0x4d8185(0x1cc),()=>_0x320e53['segment'][_0x4d8185(0x196)](_0x55a7e4),{'verbose':_0x3af815[_0x4d8185(0x16b)]}),_0x5df803=_0x449c04[_0x4d8185(0x1ab)],_0x3720c2=await withSpinner(_0x4d8185(0x186)+_0x21cce6+'\x27...',()=>_0x320e53[_0x4d8185(0x194)][_0x4d8185(0x1a2)](_0x5df803,_0x21cce6),{'verbose':_0x3af815[_0x4d8185(0x16b)]});_0x507a7c=_0x3720c2[_0x4d8185(0x1ab)],_0x3af815['verbose']&&console[_0x4d8185(0x1ad)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x507a7c);}const _0x466e36={'name':_0x280bcc,'description':_0x3af815[_0x4d8185(0x202)],'parentFolderId':_0x507a7c},_0x2fa652=await withSpinner(_0x4d8185(0x1fa)+_0x280bcc+_0x4d8185(0x1cc),()=>_0x320e53[_0x4d8185(0x194)][_0x4d8185(0x1bf)](_0x55a7e4,_0x466e36),{'verbose':_0x3af815[_0x4d8185(0x16b)]}),_0x5ec754=_0x2fa652['data'];return console[_0x4d8185(0x1ad)](_0x4d8185(0x191)+_0x5ec754[_0x4d8185(0x1a8)]+_0x4d8185(0x1a3)+_0x5ec754['id']),await handleSDKOutput([_0x5ec754],_0x3af815),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x35e85e(0x1a8)]=a31_0x35e85e(0x181);[a31_0x35e85e(0x202)]=a31_0x35e85e(0x17f);async[a31_0x35e85e(0x207)](_0x109469){const _0x20e0e3=a31_0x35e85e,{options:_0x50ba66,args:_0x35bf1d,tdx:_0x401ba8}=_0x109469,_0x5936e3=_0x35bf1d[0x0];if(!_0x5936e3)return console[_0x20e0e3(0x1ad)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x18f)),console['error'](_0x20e0e3(0x16c)),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x17c)),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1e2)),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x195)),console[_0x20e0e3(0x1ad)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x179)),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x169)),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1d6)),0x1;try{const _0x44657e=_0x50ba66[_0x20e0e3(0x167)],_0x57a126=await resolveSegmentTarget(_0x5936e3,_0x44657e,_0x50ba66[_0x20e0e3(0x16b)]);_0x50ba66[_0x20e0e3(0x16b)]&&console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1a0)+_0x57a126);const _0x351813=await withSpinner(_0x20e0e3(0x1aa)+_0x5936e3+'\x27...',()=>_0x401ba8[_0x20e0e3(0x194)][_0x20e0e3(0x1eb)](_0x57a126),{'verbose':_0x50ba66[_0x20e0e3(0x16b)]}),_0x5c073e=_0x351813[_0x20e0e3(0x1ab)];_0x50ba66[_0x20e0e3(0x16b)]&&(console[_0x20e0e3(0x1ad)]('Resolved\x20type:\x20'+_0x5c073e[_0x20e0e3(0x192)]),console[_0x20e0e3(0x1ad)]('Parent\x20ID:\x20'+_0x5c073e[_0x20e0e3(0x1d9)]),_0x5c073e[_0x20e0e3(0x18c)]&&console['error'](_0x20e0e3(0x177)+_0x5c073e[_0x20e0e3(0x18c)]),_0x5c073e[_0x20e0e3(0x1bb)]&&console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1ff)+_0x5c073e['segmentId']));if(_0x50ba66['web']){if(_0x5c073e[_0x20e0e3(0x192)]===_0x20e0e3(0x210))return console['error'](_0x20e0e3(0x1dd)),0x1;if(_0x5c073e[_0x20e0e3(0x192)]===_0x20e0e3(0x1ec))return console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1db)),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1e7)),0x1;if(!_0x5c073e['segmentId'])throw new SDKError(ErrorCode[_0x20e0e3(0x176)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x35e871=getConsoleNextUrl(_0x50ba66[_0x20e0e3(0x19d)],_0x20e0e3(0x1fc)+_0x5c073e[_0x20e0e3(0x1d9)]+'/e/'+_0x5c073e['segmentId']);return console[_0x20e0e3(0x1ad)](a31_0x162462['green']('✔')+_0x20e0e3(0x1d0)+a31_0x162462['cyan'](_0x35e871)),openBrowser(_0x35e871),0x0;}if(_0x5c073e[_0x20e0e3(0x192)]==='folder'){if(!_0x5c073e[_0x20e0e3(0x18c)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x20e0e3(0x1f8));const _0x558d1d=await withSpinner('Fetching\x20folder\x20details...',()=>_0x401ba8[_0x20e0e3(0x194)][_0x20e0e3(0x1a6)](_0x5c073e[_0x20e0e3(0x18c)]),{'verbose':_0x50ba66[_0x20e0e3(0x16b)]});await handleSingleObjectOutput(_0x558d1d[_0x20e0e3(0x1ab)],_0x50ba66);}else{if(_0x5c073e[_0x20e0e3(0x192)]==='segment'){if(!_0x5c073e[_0x20e0e3(0x1bb)])throw new SDKError(ErrorCode[_0x20e0e3(0x176)],_0x20e0e3(0x1d8));const _0x5cf824=await withSpinner(_0x20e0e3(0x172),()=>_0x401ba8[_0x20e0e3(0x194)]['getSegment'](_0x5c073e[_0x20e0e3(0x1d9)],_0x5c073e[_0x20e0e3(0x1bb)]),{'verbose':_0x50ba66[_0x20e0e3(0x16b)]}),_0x1b6892=getConsoleNextUrl(_0x50ba66['site'],_0x20e0e3(0x1fc)+_0x5c073e[_0x20e0e3(0x1d9)]+'/e/'+_0x5c073e[_0x20e0e3(0x1bb)]),_0x26cd65=_0x5cf824[_0x20e0e3(0x1ab)];_0x26cd65[_0x20e0e3(0x1e1)]=_0x1b6892,await handleSingleObjectOutput(_0x26cd65,_0x50ba66);}else return console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1c5)),console[_0x20e0e3(0x1ad)](_0x20e0e3(0x20c)),0x1;}return 0x0;}catch(_0x536f6b){if(_0x536f6b instanceof SDKError)return console['error'](_0x20e0e3(0x1e5)+_0x536f6b[_0x20e0e3(0x19b)]),_0x536f6b[_0x20e0e3(0x1ae)]&&console[_0x20e0e3(0x1ad)](_0x20e0e3(0x1ed)+_0x536f6b[_0x20e0e3(0x1ae)]),0x1;throw _0x536f6b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x35e85e(0x1a8)]=a31_0x35e85e(0x174);[a31_0x35e85e(0x202)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x477ce7){const _0x32c7be=a31_0x35e85e,{options:_0x1eb9bf,args:_0x305135,tdx:_0x3352ac}=_0x477ce7,_0x107266=_0x305135[0x0];if(!_0x107266)return console[_0x32c7be(0x1ad)](_0x32c7be(0x173)),console[_0x32c7be(0x1ad)](_0x32c7be(0x187)),console[_0x32c7be(0x1ad)](_0x32c7be(0x19f)),console[_0x32c7be(0x1ad)](_0x32c7be(0x195)),console[_0x32c7be(0x1ad)](_0x32c7be(0x1cb)),console['error'](_0x32c7be(0x1ac)),0x1;try{const _0x5738e6=_0x1eb9bf['parentSegment'],_0x67f1e9=await resolveSegmentTarget(_0x107266,_0x5738e6,_0x1eb9bf[_0x32c7be(0x16b)]);_0x1eb9bf['verbose']&&console[_0x32c7be(0x1ad)](_0x32c7be(0x1a0)+_0x67f1e9);const _0x3ed744=await withSpinner('Resolving\x20\x27'+_0x107266+_0x32c7be(0x1cc),()=>_0x3352ac[_0x32c7be(0x194)]['resolvePathToResource'](_0x67f1e9),{'verbose':_0x1eb9bf['verbose']}),_0x6dfc61=_0x3ed744['data'];_0x1eb9bf[_0x32c7be(0x16b)]&&(console[_0x32c7be(0x1ad)](_0x32c7be(0x16f)+_0x6dfc61[_0x32c7be(0x192)]),console['error'](_0x32c7be(0x1b8)+_0x6dfc61['parentId']));if(_0x6dfc61['type']===_0x32c7be(0x210))return console[_0x32c7be(0x1ad)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x6dfc61['type']===_0x32c7be(0x1ec))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x32c7be(0x1f3)),0x1;if(!_0x6dfc61[_0x32c7be(0x1bb)])throw new SDKError(ErrorCode[_0x32c7be(0x176)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xe91c3b=await withSpinner(_0x32c7be(0x1b4),()=>_0x3352ac['segment']['getSegmentSQL'](_0x6dfc61[_0x32c7be(0x1d9)],_0x6dfc61[_0x32c7be(0x1bb)]),{'verbose':_0x1eb9bf[_0x32c7be(0x16b)]}),_0x22076f=_0xe91c3b[_0x32c7be(0x1ab)],_0x573247=await executeSchemaQuery(_0x22076f,_0x3352ac,_0x1eb9bf);return await handleQueryOutput(_0x573247,_0x1eb9bf),0x0;}catch(_0x31d613){if(_0x31d613 instanceof SDKError)return console[_0x32c7be(0x1ad)](_0x32c7be(0x1e5)+_0x31d613[_0x32c7be(0x19b)]),_0x31d613[_0x32c7be(0x1ae)]&&console[_0x32c7be(0x1ad)](_0x32c7be(0x1ed)+_0x31d613['cause']),0x1;throw _0x31d613;}}}
|
|
1
|
+
const a31_0x38beab=a31_0x2aa3;(function(_0x485a67,_0x5ba946){const _0x46ed41=a31_0x2aa3,_0x280baa=_0x485a67();while(!![]){try{const _0x17727f=-parseInt(_0x46ed41(0x169))/0x1+parseInt(_0x46ed41(0x115))/0x2*(parseInt(_0x46ed41(0x108))/0x3)+-parseInt(_0x46ed41(0x125))/0x4+parseInt(_0x46ed41(0xfe))/0x5*(parseInt(_0x46ed41(0x11a))/0x6)+parseInt(_0x46ed41(0x19a))/0x7+parseInt(_0x46ed41(0x13e))/0x8*(-parseInt(_0x46ed41(0x15a))/0x9)+parseInt(_0x46ed41(0x13f))/0xa;if(_0x17727f===_0x5ba946)break;else _0x280baa['push'](_0x280baa['shift']());}catch(_0x303281){_0x280baa['push'](_0x280baa['shift']());}}}(a31_0x1271,0x8bf02));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';function a31_0x2aa3(_0x2ae574,_0x60c09d){_0x2ae574=_0x2ae574-0xfd;const _0x12717c=a31_0x1271();let _0x2aa384=_0x12717c[_0x2ae574];return _0x2aa384;}import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a31_0x1271(){const _0x31bf06=['Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20\x27','Parent\x20segment:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','stats','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','segment','Show\x20child\x20segment\x20schema\x20(column\x20types)','in\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','✔\x20Query\x20completed:\x20Processed\x20','processedRows','Parent\x20name:\x20','2215496rgBUmm','1730530iRYunk','segmentName','\x20\x20Parent\x20segment:\x20','cause','execute','trim','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment:show','INVALID_ARGUMENT','includes','segment:folder:show','getSegment','SEGMENT_FOLDER_NOT_FOUND','resolvePathToResource','Fetching\x20parent\x20segment\x20details...','red','Options:','segment:sql','folderPath','\x20\x20Folder\x20path:\x20','Folder\x20ID:\x20','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','segment:desc','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Resolved\x20parent\x20ID:\x20','9awXjpn','✔\x20Created\x20folder\x20\x27','jobId','SEGMENT_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','segment:describe','Fetching\x20folder\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','\x20\x20Segment\x20name:\x20','parentSegment','✔\x20Found\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','setJobId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Fetching\x20SQL\x20for\x20segment...','1137279cwjrNR','\x27...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','web','SQL\x20query:\x0a','resolveParentId','Resolved\x20type:\x20','/e/','SELECT\x20*\x20FROM\x20(\x0a','getSQLFromServerSegment','segmentId','Resolving\x20parent\x20segment\x20\x27','Usage:','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20Full\x20path:\x20','name','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Examples:','Use:\x20tdx\x20ps\x20view\x20-w','url','getSegmentSQL','Segment\x20ID:\x20','jsonl','replace','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Use:\x20tdx\x20ps\x20show','log','length','getFolder','Show\x20segment\x20or\x20folder\x20details','Show\x20folder\x20or\x20child\x20segment\x20details','Parent\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20rows\x20','query','parentId','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','/app/ps/','createFolder','Get\x20SQL\x20query\x20for\x20child\x20segment','Executing\x20segment\x20query...','format','Resolving\x20parent\x20folder\x20\x27','folder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:folder:list','\x20[Job\x20ID:\x20','7877723GLPZhc','Resolved\x20parent\x20folder\x20ID:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Fetching\x20SQL\x20from\x20rule...','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','path','fullPath','content','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','data','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','cyan','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','428845LPcwVW','listFolders','folderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','parent','Use:\x20tdx\x20ps\x20desc','getParent','Fetching\x20segment\x20details...','618HzXbCP','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Folder\x20name:\x20','Resolved:\x20','error','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20','Use:\x20tdx\x20ps\x20view','getSQLFromYamlFile','segment:view','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Site:\x20','8528JtZnpW','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','getSegmentSQLFromYaml','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','24pStnEj','Usage:\x20tdx\x20sg\x20show\x20<name>','Create\x20segment\x20folder\x20for\x20organization','resolveFolderId','description','json','Target\x20path:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','message','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20Cause:\x20','2130000qNyNst','site','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20Opening\x20','type','Creating\x20folder\x20\x27','verbose','green','Fetching\x20folder\x20details...','✖\x20Query\x20failed\x20[','test'];a31_0x1271=function(){return _0x31bf06;};return a31_0x1271();}import{openBrowser}from'../utils/process.js';import a31_0x442dd3 from'chalk';async function resolveSegmentTarget(_0x343a74,_0x2e5d7f,_0xef35c2){const _0x149cf6=a31_0x2aa3;if(isYamlFilePath(_0x343a74))try{const _0x9a2cc0=await resolveYamlFilePath(_0x343a74);return _0xef35c2&&(console[_0x149cf6(0x10c)]('Resolved\x20YAML\x20file:\x20'+_0x343a74),console['error'](_0x149cf6(0x141)+_0x9a2cc0[_0x149cf6(0x163)]),console[_0x149cf6(0x10c)](_0x149cf6(0x162)+_0x9a2cc0[_0x149cf6(0x140)]),console[_0x149cf6(0x10c)](_0x149cf6(0x152)+(_0x9a2cc0[_0x149cf6(0x151)]||'(root)')),console[_0x149cf6(0x10c)](_0x149cf6(0x177)+_0x9a2cc0['fullPath'])),_0x9a2cc0[_0x149cf6(0x1a0)];}catch(_0x20210a){throw new SDKError(ErrorCode[_0x149cf6(0x147)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x20210a[_0x149cf6(0x122)]);}if(!_0x2e5d7f)throw new SDKError(ErrorCode[_0x149cf6(0x147)],_0x149cf6(0x1a3));return _0x2e5d7f+'/'+_0x343a74;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x38beab(0x178)]=a31_0x38beab(0x15f);['description']=a31_0x38beab(0x188);async['execute'](_0x257a2f){const _0x3d4eed=a31_0x38beab,{options:_0x278f4b,args:_0x59c128,tdx:_0x42dd05}=_0x257a2f,_0x20eac7=_0x59c128[0x0],_0x17088b=!_0x20eac7&&!!_0x278f4b[_0x3d4eed(0x163)],_0xcfed25=_0x20eac7||_0x278f4b[_0x3d4eed(0x163)];if(!_0xcfed25)return console[_0x3d4eed(0x10c)](_0x3d4eed(0x157)),console[_0x3d4eed(0x10c)](_0x3d4eed(0x139)),console[_0x3d4eed(0x10c)]('Examples:'),console[_0x3d4eed(0x10c)](_0x3d4eed(0x167)),console[_0x3d4eed(0x10c)](_0x3d4eed(0x197)),console[_0x3d4eed(0x10c)](_0x3d4eed(0x121)),console[_0x3d4eed(0x10c)](_0x3d4eed(0x127)),0x1;try{const _0x40656f=_0x278f4b['segmentPath'];let _0x5afd76=_0xcfed25;!_0x17088b&&_0x40656f&&!_0xcfed25[_0x3d4eed(0x148)]('/')&&(_0x5afd76=_0x40656f+'/'+_0xcfed25,_0x278f4b[_0x3d4eed(0x12b)]&&console[_0x3d4eed(0x10c)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5afd76));const _0x492b03=await withSpinner('Resolving\x20path\x20\x27'+_0x5afd76+_0x3d4eed(0x16a),()=>_0x42dd05['segment'][_0x3d4eed(0x14c)](_0x5afd76),{'verbose':_0x278f4b[_0x3d4eed(0x12b)]}),_0x339ef3=_0x492b03[_0x3d4eed(0x1a4)];_0x278f4b[_0x3d4eed(0x12b)]&&(console[_0x3d4eed(0x10c)](_0x3d4eed(0x16f)+_0x339ef3[_0x3d4eed(0x129)]),console[_0x3d4eed(0x10c)](_0x3d4eed(0x18a)+_0x339ef3[_0x3d4eed(0x18e)]),_0x339ef3[_0x3d4eed(0x100)]&&console[_0x3d4eed(0x10c)](_0x3d4eed(0x153)+_0x339ef3[_0x3d4eed(0x100)]),_0x339ef3[_0x3d4eed(0x173)]&&console[_0x3d4eed(0x10c)](_0x3d4eed(0x17f)+_0x339ef3[_0x3d4eed(0x173)]));if(_0x339ef3[_0x3d4eed(0x129)]===_0x3d4eed(0x104)){const _0x8f9811=await withSpinner(_0x3d4eed(0x14d),()=>_0x42dd05['segment'][_0x3d4eed(0x106)](_0x339ef3[_0x3d4eed(0x18e)]),{'verbose':_0x278f4b[_0x3d4eed(0x12b)]});await handleSingleObjectOutput(_0x8f9811['data'],_0x278f4b);}else{if(_0x339ef3[_0x3d4eed(0x129)]===_0x3d4eed(0x196)){if(!_0x339ef3['folderId'])throw new SDKError(ErrorCode[_0x3d4eed(0x14b)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3622e7=await withSpinner(_0x3d4eed(0x12d),()=>_0x42dd05[_0x3d4eed(0x136)][_0x3d4eed(0x187)](_0x339ef3[_0x3d4eed(0x100)]),{'verbose':_0x278f4b[_0x3d4eed(0x12b)]});await handleSingleObjectOutput(_0x3622e7[_0x3d4eed(0x1a4)],_0x278f4b);}else{if(_0x339ef3['type']==='segment'){if(!_0x339ef3[_0x3d4eed(0x173)])throw new SDKError(ErrorCode[_0x3d4eed(0x15d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5f4fed=await withSpinner(_0x3d4eed(0x107),()=>_0x42dd05[_0x3d4eed(0x136)][_0x3d4eed(0x14a)](_0x339ef3['parentId'],_0x339ef3['segmentId']),{'verbose':_0x278f4b[_0x3d4eed(0x12b)]});await handleSingleObjectOutput(_0x5f4fed['data'],_0x278f4b);}}}return 0x0;}catch(_0x5c3191){if(_0x5c3191 instanceof SDKError)return console[_0x3d4eed(0x10c)](_0x3d4eed(0x10f)+_0x5c3191[_0x3d4eed(0x122)]),_0x5c3191['cause']&&console['error'](_0x3d4eed(0x124)+_0x5c3191[_0x3d4eed(0x142)]),0x1;throw _0x5c3191;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x38beab(0x178)]=a31_0x38beab(0x146);['description']=a31_0x38beab(0x103);async['execute'](_0x40e9cb){const _0x3fa40f=a31_0x38beab,{options:_0x1d8175,args:_0x125ce0,tdx:_0x2e4023}=_0x40e9cb,_0x5626e0=_0x125ce0[0x0];if(!_0x5626e0)return console['error'](_0x3fa40f(0x145)),console[_0x3fa40f(0x10c)](_0x3fa40f(0x11b)),console[_0x3fa40f(0x10c)](_0x3fa40f(0x10e)),console[_0x3fa40f(0x10c)]('Examples:'),console[_0x3fa40f(0x10c)](_0x3fa40f(0x182)),console[_0x3fa40f(0x10c)](_0x3fa40f(0x1a5)),0x1;try{const _0x3b37ea=_0x1d8175['parentSegment'],_0x10f409=await resolveSegmentTarget(_0x5626e0,_0x3b37ea,_0x1d8175[_0x3fa40f(0x12b)]);_0x1d8175[_0x3fa40f(0x12b)]&&console[_0x3fa40f(0x10c)](_0x3fa40f(0x120)+_0x10f409);const _0x2ad380=await withSpinner('Resolving\x20\x27'+_0x5626e0+'\x27...',()=>_0x2e4023[_0x3fa40f(0x136)][_0x3fa40f(0x14c)](_0x10f409),{'verbose':_0x1d8175['verbose']}),_0x65bf0f=_0x2ad380['data'];_0x1d8175[_0x3fa40f(0x12b)]&&(console[_0x3fa40f(0x10c)](_0x3fa40f(0x16f)+_0x65bf0f['type']),console[_0x3fa40f(0x10c)](_0x3fa40f(0x18a)+_0x65bf0f[_0x3fa40f(0x18e)]));if(_0x65bf0f[_0x3fa40f(0x129)]==='folder')return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x3fa40f(0x10c)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x65bf0f[_0x3fa40f(0x129)]===_0x3fa40f(0x104))return console[_0x3fa40f(0x10c)](_0x3fa40f(0x109)),console[_0x3fa40f(0x10c)](_0x3fa40f(0x184)),0x1;if(!_0x65bf0f[_0x3fa40f(0x173)])throw new SDKError(ErrorCode[_0x3fa40f(0x15d)],_0x3fa40f(0x101));const _0x47ce88=await withSpinner(_0x3fa40f(0x168),()=>_0x2e4023[_0x3fa40f(0x136)][_0x3fa40f(0x17e)](_0x65bf0f[_0x3fa40f(0x18e)],_0x65bf0f[_0x3fa40f(0x173)]),{'verbose':_0x1d8175[_0x3fa40f(0x12b)]});let _0x549c39=_0x47ce88[_0x3fa40f(0x1a4)];const _0x37d9ca=resolveLimit(_0x1d8175['limit'],DEFAULT_DISPLAY_LIMIT),_0x2a5654=/\bLIMIT\s+\d+/i[_0x3fa40f(0x12f)](_0x549c39);!_0x2a5654&&(_0x549c39=_0x549c39[_0x3fa40f(0x144)]()[_0x3fa40f(0x181)](/;+$/,''),_0x549c39=_0x3fa40f(0x171)+_0x549c39+_0x3fa40f(0x13a)+_0x37d9ca);_0x1d8175['verbose']&&console[_0x3fa40f(0x10c)](_0x3fa40f(0x16d)+_0x549c39);const _0x3f139c=await withProgressSpinner(_0x3fa40f(0x193),async _0xe26a68=>{const _0x3a6b58=_0x3fa40f,_0x510ef0=await _0x2e4023[_0x3a6b58(0x18d)]['execute'](_0x549c39,{'catalog':'td','schema':'information_schema','onJobId':_0x498a55=>{const _0x5657ce=_0x3a6b58;_0xe26a68[_0x5657ce(0x166)](_0x498a55);}});return _0x510ef0;},{'verbose':_0x1d8175[_0x3fa40f(0x12b)]}),_0x4a2d46=_0x3f139c[_0x3fa40f(0x1a4)],_0x110cc9=_0x4a2d46[_0x3fa40f(0x15c)]?_0x3fa40f(0x199)+_0x4a2d46['jobId']+']':'';return console['error'](_0x3fa40f(0x13b)+_0x4a2d46[_0x3fa40f(0x134)][_0x3fa40f(0x13c)]['toLocaleString']()+_0x3fa40f(0x18c)+(_0x3fa40f(0x138)+formatElapsed(_0x4a2d46['stats']['elapsedTimeMillis'])+_0x110cc9)),await handleQueryOutput(_0x4a2d46,_0x1d8175),0x0;}catch(_0x8e5d70){if(_0x8e5d70 instanceof SDKError)return console[_0x3fa40f(0x10c)](_0x3fa40f(0x12e)+_0x8e5d70['code']+']'),console['error']('\x0a'+_0x8e5d70['message']),0x1;throw _0x8e5d70;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a31_0x38beab(0x198);[a31_0x38beab(0x11e)]=a31_0x38beab(0x10d);async[a31_0x38beab(0x143)](_0x7741a1){const _0x3317c7=a31_0x38beab,{options:_0x58aaf6,args:_0x48fc72,tdx:_0x430d47}=_0x7741a1;if(_0x48fc72[_0x3317c7(0x186)]===0x0)return console[_0x3317c7(0x10c)](_0x3317c7(0x133)),console[_0x3317c7(0x10c)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x225f55=_0x48fc72[0x0];try{_0x58aaf6[_0x3317c7(0x12b)]&&(console[_0x3317c7(0x10c)](_0x3317c7(0x114)+_0x58aaf6[_0x3317c7(0x126)]),console['error'](_0x3317c7(0x13d)+_0x225f55));const _0x3ed536=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x225f55+_0x3317c7(0x16a),()=>_0x430d47[_0x3317c7(0x136)]['resolveParentId'](_0x225f55),{'verbose':_0x58aaf6['verbose']}),_0x4af859=_0x3ed536[_0x3317c7(0x1a4)];_0x58aaf6['verbose']&&console[_0x3317c7(0x10c)](_0x3317c7(0x159)+_0x4af859);const _0x254883=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x225f55+_0x3317c7(0x16a),()=>_0x430d47[_0x3317c7(0x136)][_0x3317c7(0xff)](_0x4af859),{'verbose':_0x58aaf6[_0x3317c7(0x12b)]}),_0x390d2c=_0x254883[_0x3317c7(0x1a4)];return console['error'](_0x3317c7(0x164)+_0x390d2c[_0x3317c7(0x186)]+'\x20folder'+(_0x390d2c[_0x3317c7(0x186)]!==0x1?'s':'')),await handleSDKOutput(_0x390d2c,_0x58aaf6),0x0;}catch(_0x39caae){if(_0x39caae instanceof SDKError)return console[_0x3317c7(0x10c)](_0x3317c7(0x10f)+_0x39caae[_0x3317c7(0x122)]),_0x39caae[_0x3317c7(0x142)]&&console[_0x3317c7(0x10c)](_0x3317c7(0x124)+_0x39caae[_0x3317c7(0x142)]),0x1;throw _0x39caae;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x38beab(0x178)]=a31_0x38beab(0x149);['description']='Show\x20segment\x20folder\x20details';async[a31_0x38beab(0x143)](_0x58e55a){const _0x4e455f=a31_0x38beab,{options:_0x198962,args:_0x243155,tdx:_0x5aadf5}=_0x58e55a;if(_0x243155[_0x4e455f(0x186)]===0x0)return console[_0x4e455f(0x10c)](_0x4e455f(0x176)),console[_0x4e455f(0x10c)](_0x4e455f(0x179)),0x1;try{const {parentId:_0x2c3697,childId:_0x4716ab}=parseSegmentRef(_0x243155[0x0]);_0x198962[_0x4e455f(0x12b)]&&(console[_0x4e455f(0x10c)](_0x4e455f(0x114)+_0x198962[_0x4e455f(0x126)]),console[_0x4e455f(0x10c)](_0x4e455f(0x13d)+_0x2c3697),_0x4716ab&&console['error'](_0x4e455f(0x10a)+_0x4716ab));if(!_0x4716ab)return console[_0x4e455f(0x10c)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x3896c7=await withSpinner(_0x4e455f(0x174)+_0x2c3697+_0x4e455f(0x16a),()=>_0x5aadf5[_0x4e455f(0x136)]['resolveParentId'](_0x2c3697),{'verbose':_0x198962[_0x4e455f(0x12b)]}),_0x3a03ae=_0x3896c7[_0x4e455f(0x1a4)];_0x198962[_0x4e455f(0x12b)]&&console[_0x4e455f(0x10c)]('Resolved\x20parent\x20ID:\x20'+_0x3a03ae);const _0x2e1ab0=await withSpinner('Resolving\x20folder\x20\x27'+_0x4716ab+_0x4e455f(0x16a),()=>_0x5aadf5[_0x4e455f(0x136)]['resolveFolderId'](_0x3a03ae,_0x4716ab),{'verbose':_0x198962[_0x4e455f(0x12b)]}),_0x2aa691=_0x2e1ab0[_0x4e455f(0x1a4)];_0x198962[_0x4e455f(0x12b)]&&console[_0x4e455f(0x10c)]('Resolved\x20folder\x20ID:\x20'+_0x2aa691);const _0x52ef23=await withSpinner(_0x4e455f(0x160)+_0x4716ab+'\x27...',()=>_0x5aadf5[_0x4e455f(0x136)][_0x4e455f(0x187)](_0x2aa691),{'verbose':_0x198962[_0x4e455f(0x12b)]});return await handleSDKOutput([_0x52ef23[_0x4e455f(0x1a4)]],_0x198962),0x0;}catch(_0x213ce3){if(_0x213ce3 instanceof SDKError)return console[_0x4e455f(0x10c)](_0x4e455f(0x10f)+_0x213ce3[_0x4e455f(0x122)]),_0x213ce3[_0x4e455f(0x142)]&&console[_0x4e455f(0x10c)](_0x4e455f(0x124)+_0x213ce3['cause']),0x1;throw _0x213ce3;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x38beab(0x178)]=a31_0x38beab(0x150);[a31_0x38beab(0x11e)]=a31_0x38beab(0x192);async[a31_0x38beab(0x143)](_0x25046a){const _0x295ece=a31_0x38beab,{options:_0x2c2e51,args:_0x2eee1b}=_0x25046a,_0x41cf0d=_0x2c2e51,_0x27467b=_0x41cf0d[_0x295ece(0x19f)],_0x4066dd=_0x2eee1b[0x0];if(!_0x4066dd&&!_0x27467b)return console[_0x295ece(0x10c)](a31_0x442dd3[_0x295ece(0x14e)](_0x295ece(0x17a))),console[_0x295ece(0x10c)](_0x295ece(0x175)),console['error'](_0x295ece(0x135)),console['error'](_0x295ece(0x154)),console['error']('Examples:'),console[_0x295ece(0x10c)](_0x295ece(0xfd)),console['error']('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x4066dd&&_0x27467b)return console[_0x295ece(0x10c)](a31_0x442dd3['red'](_0x295ece(0x183))),0x1;try{let _0x27d93d;if(_0x27467b)_0x27d93d=await this['getSQLFromYamlFile'](_0x27467b,_0x25046a);else{if(isYamlFilePath(_0x4066dd))return console['error'](a31_0x442dd3[_0x295ece(0x14e)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x295ece(0x10c)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0x4066dd),0x1;else _0x27d93d=await this[_0x295ece(0x172)](_0x4066dd,_0x25046a);}return _0x2c2e51[_0x295ece(0x194)]===_0x295ece(0x11f)||_0x2c2e51[_0x295ece(0x194)]===_0x295ece(0x180)?await handleSDKOutput([{'sql':_0x27d93d}],_0x2c2e51):console[_0x295ece(0x185)](_0x27d93d),0x0;}catch(_0xa13296){if(_0xa13296 instanceof SDKError)return console[_0x295ece(0x10c)](_0x295ece(0x10f)+_0xa13296['message']),_0xa13296[_0x295ece(0x142)]&&console[_0x295ece(0x10c)](_0x295ece(0x124)+_0xa13296['cause']),0x1;throw _0xa13296;}}async[a31_0x38beab(0x111)](_0x1c169c,_0x3672cb){const _0x178a13=a31_0x38beab,{options:_0x51efac,tdx:_0xb27a9f}=_0x3672cb;let _0x47f1c5;try{_0x47f1c5=await resolveYamlFilePath(_0x1c169c);}catch(_0x4e0553){throw new SDKError(ErrorCode[_0x178a13(0x147)],_0x178a13(0x117)+_0x4e0553[_0x178a13(0x122)]);}_0x51efac[_0x178a13(0x12b)]&&console[_0x178a13(0x10c)](_0x178a13(0x10b)+_0x47f1c5['parentSegment']+'/'+_0x47f1c5[_0x178a13(0x140)]);const _0x3058ab=await withSpinner(_0x178a13(0x19d),()=>_0xb27a9f['segment'][_0x178a13(0x118)](_0x47f1c5[_0x178a13(0x1a1)],_0x47f1c5[_0x178a13(0x163)],_0x47f1c5[_0x178a13(0x140)]),{'verbose':_0x51efac[_0x178a13(0x12b)]});return _0x3058ab[_0x178a13(0x1a4)];}async['getSQLFromServerSegment'](_0x26aed9,_0x3b6146){const _0x3a5b18=a31_0x38beab,{options:_0x2ed3c8,tdx:_0x5b7d2c}=_0x3b6146,_0x228f4a=_0x2ed3c8['parentSegment'],_0x55151f=await resolveSegmentTarget(_0x26aed9,_0x228f4a,_0x2ed3c8[_0x3a5b18(0x12b)]);_0x2ed3c8[_0x3a5b18(0x12b)]&&console[_0x3a5b18(0x10c)](_0x3a5b18(0x120)+_0x55151f);const _0x1fbe05=await withSpinner(_0x3a5b18(0x131)+_0x26aed9+_0x3a5b18(0x16a),()=>_0x5b7d2c[_0x3a5b18(0x136)][_0x3a5b18(0x14c)](_0x55151f),{'verbose':_0x2ed3c8[_0x3a5b18(0x12b)]}),_0x28aa07=_0x1fbe05[_0x3a5b18(0x1a4)];_0x2ed3c8[_0x3a5b18(0x12b)]&&(console[_0x3a5b18(0x10c)]('Resolved\x20type:\x20'+_0x28aa07[_0x3a5b18(0x129)]),console['error'](_0x3a5b18(0x18a)+_0x28aa07[_0x3a5b18(0x18e)]));if(_0x28aa07[_0x3a5b18(0x129)]==='folder')throw new SDKError(ErrorCode[_0x3a5b18(0x147)],_0x3a5b18(0x165));if(_0x28aa07['type']==='parent')throw new SDKError(ErrorCode[_0x3a5b18(0x147)],_0x3a5b18(0x18f));if(!_0x28aa07[_0x3a5b18(0x173)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3a5b18(0x101));const _0x37b648=await withSpinner(_0x3a5b18(0x168),()=>_0x5b7d2c[_0x3a5b18(0x136)][_0x3a5b18(0x17e)](_0x28aa07['parentId'],_0x28aa07[_0x3a5b18(0x173)]),{'verbose':_0x2ed3c8[_0x3a5b18(0x12b)]});return _0x37b648[_0x3a5b18(0x1a4)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x38beab(0x178)]='segment:folder:create';[a31_0x38beab(0x11e)]=a31_0x38beab(0x11c);async[a31_0x38beab(0x143)](_0x228262){const _0x15b58e=a31_0x38beab,{options:_0x3a08f0,args:_0x3cdfa1,tdx:_0x1dd062}=_0x228262,_0x4b7058=_0x3a08f0;if(_0x3cdfa1[_0x15b58e(0x186)]<0x2)return console['error'](_0x15b58e(0x19e)),console[_0x15b58e(0x10c)](_0x15b58e(0x123)),0x1;const _0x57a411=_0x3cdfa1[0x0],_0x4cd139=_0x3cdfa1[0x1];_0x4b7058[_0x15b58e(0x12b)]&&(console[_0x15b58e(0x10c)](_0x15b58e(0x114)+_0x4b7058[_0x15b58e(0x126)]),console[_0x15b58e(0x10c)](_0x15b58e(0x132)+_0x57a411),console[_0x15b58e(0x10c)](_0x15b58e(0x10a)+_0x4cd139));let _0x5c8693;if(_0x4b7058['parentFolder']){const _0x4dbd19=_0x4b7058['parentFolder'],_0x265601=await withSpinner(_0x15b58e(0x174)+_0x57a411+_0x15b58e(0x16a),()=>_0x1dd062['segment'][_0x15b58e(0x16e)](_0x57a411),{'verbose':_0x4b7058[_0x15b58e(0x12b)]}),_0x5d0081=_0x265601[_0x15b58e(0x1a4)],_0x4b3d91=await withSpinner(_0x15b58e(0x195)+_0x4dbd19+'\x27...',()=>_0x1dd062[_0x15b58e(0x136)][_0x15b58e(0x11d)](_0x5d0081,_0x4dbd19),{'verbose':_0x4b7058[_0x15b58e(0x12b)]});_0x5c8693=_0x4b3d91[_0x15b58e(0x1a4)],_0x4b7058[_0x15b58e(0x12b)]&&console['error'](_0x15b58e(0x19b)+_0x5c8693);}const _0x1f2868={'name':_0x4cd139,'description':_0x4b7058[_0x15b58e(0x11e)],'parentFolderId':_0x5c8693},_0x39c633=await withSpinner(_0x15b58e(0x12a)+_0x4cd139+'\x27...',()=>_0x1dd062[_0x15b58e(0x136)][_0x15b58e(0x191)](_0x57a411,_0x1f2868),{'verbose':_0x4b7058['verbose']}),_0x569478=_0x39c633['data'];return console[_0x15b58e(0x10c)](_0x15b58e(0x15b)+_0x569478[_0x15b58e(0x178)]+'\x27\x20with\x20ID:\x20'+_0x569478['id']),await handleSDKOutput([_0x569478],_0x4b7058),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x38beab(0x178)]=a31_0x38beab(0x112);[a31_0x38beab(0x11e)]=a31_0x38beab(0x189);async[a31_0x38beab(0x143)](_0x3d4c71){const _0x127516=a31_0x38beab,{options:_0xe1b9f2,args:_0x22a7ac,tdx:_0x5cea1c}=_0x3d4c71,_0x4bd942=_0x22a7ac[0x0];if(!_0x4bd942)return console[_0x127516(0x10c)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x127516(0x10c)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x127516(0x10c)](_0x127516(0x15e)),console['error'](_0x127516(0x14f)),console[_0x127516(0x10c)](_0x127516(0x1a7)),console[_0x127516(0x10c)](_0x127516(0x17b)),console[_0x127516(0x10c)](_0x127516(0x161)),console[_0x127516(0x10c)](_0x127516(0x18b)),console[_0x127516(0x10c)](_0x127516(0x16b)),console[_0x127516(0x10c)](_0x127516(0x113)),0x1;try{const _0x3b3483=_0xe1b9f2[_0x127516(0x163)],_0x295091=await resolveSegmentTarget(_0x4bd942,_0x3b3483,_0xe1b9f2[_0x127516(0x12b)]);_0xe1b9f2[_0x127516(0x12b)]&&console[_0x127516(0x10c)](_0x127516(0x120)+_0x295091);const _0x2fe170=await withSpinner(_0x127516(0x131)+_0x4bd942+_0x127516(0x16a),()=>_0x5cea1c['segment'][_0x127516(0x14c)](_0x295091),{'verbose':_0xe1b9f2[_0x127516(0x12b)]}),_0x207795=_0x2fe170['data'];_0xe1b9f2[_0x127516(0x12b)]&&(console[_0x127516(0x10c)](_0x127516(0x16f)+_0x207795['type']),console[_0x127516(0x10c)](_0x127516(0x18a)+_0x207795[_0x127516(0x18e)]),_0x207795[_0x127516(0x100)]&&console[_0x127516(0x10c)](_0x127516(0x153)+_0x207795['folderId']),_0x207795['segmentId']&&console['error'](_0x127516(0x17f)+_0x207795[_0x127516(0x173)]));if(_0xe1b9f2[_0x127516(0x16c)]){if(_0x207795['type']===_0x127516(0x196))return console[_0x127516(0x10c)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x207795[_0x127516(0x129)]===_0x127516(0x104))return console['error'](_0x127516(0x1a2)),console['error'](_0x127516(0x17c)),0x1;if(!_0x207795[_0x127516(0x173)])throw new SDKError(ErrorCode[_0x127516(0x15d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2a6e2e=getConsoleNextUrl(_0xe1b9f2['site'],_0x127516(0x190)+_0x207795[_0x127516(0x18e)]+'/e/'+_0x207795[_0x127516(0x173)]);return console['error'](a31_0x442dd3[_0x127516(0x12c)]('✔')+_0x127516(0x128)+a31_0x442dd3[_0x127516(0x1a6)](_0x2a6e2e)),openBrowser(_0x2a6e2e),0x0;}if(_0x207795['type']===_0x127516(0x196)){if(!_0x207795['folderId'])throw new SDKError(ErrorCode[_0x127516(0x14b)],_0x127516(0x130));const _0x5e2453=await withSpinner('Fetching\x20folder\x20details...',()=>_0x5cea1c['segment'][_0x127516(0x187)](_0x207795[_0x127516(0x100)]),{'verbose':_0xe1b9f2[_0x127516(0x12b)]});await handleSingleObjectOutput(_0x5e2453[_0x127516(0x1a4)],_0xe1b9f2);}else{if(_0x207795[_0x127516(0x129)]===_0x127516(0x136)){if(!_0x207795[_0x127516(0x173)])throw new SDKError(ErrorCode[_0x127516(0x15d)],_0x127516(0x101));const _0x10c0d3=await withSpinner(_0x127516(0x107),()=>_0x5cea1c[_0x127516(0x136)]['getSegment'](_0x207795[_0x127516(0x18e)],_0x207795[_0x127516(0x173)]),{'verbose':_0xe1b9f2['verbose']}),_0x423f7b=getConsoleNextUrl(_0xe1b9f2[_0x127516(0x126)],_0x127516(0x190)+_0x207795['parentId']+_0x127516(0x170)+_0x207795['segmentId']),_0x5a2784=_0x10c0d3[_0x127516(0x1a4)];_0x5a2784[_0x127516(0x17d)]=_0x423f7b,await handleSingleObjectOutput(_0x5a2784,_0xe1b9f2);}else return console['error'](_0x127516(0x155)),console[_0x127516(0x10c)](_0x127516(0x110)),0x1;}return 0x0;}catch(_0x4b13e9){if(_0x4b13e9 instanceof SDKError)return console[_0x127516(0x10c)](_0x127516(0x10f)+_0x4b13e9[_0x127516(0x122)]),_0x4b13e9[_0x127516(0x142)]&&console['error'](_0x127516(0x124)+_0x4b13e9[_0x127516(0x142)]),0x1;throw _0x4b13e9;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x38beab(0x178)]=a31_0x38beab(0x156);['description']=a31_0x38beab(0x137);async[a31_0x38beab(0x143)](_0x5a4d0b){const _0xa17ddb=a31_0x38beab,{options:_0x486448,args:_0x48c6f4,tdx:_0xa3f326}=_0x5a4d0b,_0x2b7964=_0x48c6f4[0x0];if(!_0x2b7964)return console[_0xa17ddb(0x10c)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0xa17ddb(0x10c)](_0xa17ddb(0x19c)),console[_0xa17ddb(0x10c)](_0xa17ddb(0x102)),console[_0xa17ddb(0x10c)](_0xa17ddb(0x17b)),console[_0xa17ddb(0x10c)](_0xa17ddb(0x158)),console['error'](_0xa17ddb(0x119)),0x1;try{const _0x16bcb7=_0x486448[_0xa17ddb(0x163)],_0x112f79=await resolveSegmentTarget(_0x2b7964,_0x16bcb7,_0x486448[_0xa17ddb(0x12b)]);_0x486448['verbose']&&console[_0xa17ddb(0x10c)]('Target\x20path:\x20'+_0x112f79);const _0x15675e=await withSpinner(_0xa17ddb(0x131)+_0x2b7964+'\x27...',()=>_0xa3f326['segment'][_0xa17ddb(0x14c)](_0x112f79),{'verbose':_0x486448[_0xa17ddb(0x12b)]}),_0x32c9fb=_0x15675e[_0xa17ddb(0x1a4)];_0x486448[_0xa17ddb(0x12b)]&&(console[_0xa17ddb(0x10c)]('Resolved\x20type:\x20'+_0x32c9fb[_0xa17ddb(0x129)]),console[_0xa17ddb(0x10c)](_0xa17ddb(0x18a)+_0x32c9fb[_0xa17ddb(0x18e)]));if(_0x32c9fb[_0xa17ddb(0x129)]===_0xa17ddb(0x196))return console[_0xa17ddb(0x10c)](_0xa17ddb(0x116)),console[_0xa17ddb(0x10c)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x32c9fb[_0xa17ddb(0x129)]===_0xa17ddb(0x104))return console[_0xa17ddb(0x10c)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0xa17ddb(0x10c)](_0xa17ddb(0x105)),0x1;if(!_0x32c9fb[_0xa17ddb(0x173)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1d635a=await withSpinner(_0xa17ddb(0x168),()=>_0xa3f326[_0xa17ddb(0x136)][_0xa17ddb(0x17e)](_0x32c9fb[_0xa17ddb(0x18e)],_0x32c9fb[_0xa17ddb(0x173)]),{'verbose':_0x486448[_0xa17ddb(0x12b)]}),_0xd42e30=_0x1d635a[_0xa17ddb(0x1a4)],_0x3491d8=await executeSchemaQuery(_0xd42e30,_0xa3f326,_0x486448);return await handleQueryOutput(_0x3491d8,_0x486448),0x0;}catch(_0x3a171a){if(_0x3a171a instanceof SDKError)return console['error'](_0xa17ddb(0x10f)+_0x3a171a[_0xa17ddb(0x122)]),_0x3a171a[_0xa17ddb(0x142)]&&console[_0xa17ddb(0x10c)](_0xa17ddb(0x124)+_0x3a171a[_0xa17ddb(0x142)]),0x1;throw _0x3a171a;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x2a24(){const _0x334df6=['\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x27\x20with\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolvePathToResource','type','verbose','segmentPath','152ViKHFa','73hUOXuB','Site:\x20','folderId','length','Parent\x20path:\x20','description','Examples:','createSegment','10254QlCMxE','4055080gxSxoa','Resolved\x20relative\x20path\x20to:\x20','invisible','execute','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','includes','Creating\x20segment\x20\x27','site','kind','Resolved\x20folder\x20ID:\x20','2209368IzQQjf','segments','Resolving\x20folder\x20path\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','41780IBIvld','6115194dvciHd','858wzXmeE','segment','resolveParentId','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','yellow','folder','11sxLtIu','ruleFile','noCountPopulation','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','10wwsVgJ','error','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','segment:create','data','parent','472297QJZntl','Target\x20path:\x20','1265829tWJrhW','Parent:\x20','Resolving\x20parent\x20segment\x20\x27','\x27...'];a32_0x2a24=function(){return _0x334df6;};return a32_0x2a24();}const a32_0x3109b3=a32_0x5622;(function(_0x40cdf2,_0x447a0a){const _0x2d0aa1=a32_0x5622,_0x18de8a=_0x40cdf2();while(!![]){try{const _0x1bec9f=-parseInt(_0x2d0aa1(0xb1))/0x1*(parseInt(_0x2d0aa1(0xb9))/0x2)+-parseInt(_0x2d0aa1(0xa5))/0x3+parseInt(_0x2d0aa1(0xba))/0x4+parseInt(_0x2d0aa1(0xc8))/0x5*(-parseInt(_0x2d0aa1(0xca))/0x6)+-parseInt(_0x2d0aa1(0xa3))/0x7*(-parseInt(_0x2d0aa1(0xb0))/0x8)+-parseInt(_0x2d0aa1(0xc9))/0x9*(-parseInt(_0x2d0aa1(0x9d))/0xa)+parseInt(_0x2d0aa1(0xd0))/0xb*(-parseInt(_0x2d0aa1(0xc4))/0xc);if(_0x1bec9f===_0x447a0a)break;else _0x18de8a['push'](_0x18de8a['shift']());}catch(_0x3e9726){_0x18de8a['push'](_0x18de8a['shift']());}}}(a32_0x2a24,0xc34cd));import{BaseCommand}from'./command.js';function a32_0x5622(_0x179a42,_0x53d837){_0x179a42=_0x179a42-0x9d;const _0x2a245d=a32_0x2a24();let _0x56220c=_0x2a245d[_0x179a42];return _0x56220c;}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 a32_0x1f1692 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a32_0x3109b3(0xa0);[a32_0x3109b3(0xb6)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a32_0x3109b3(0xbd)](_0x3edf9a){const _0x2ccf73=a32_0x3109b3;console[_0x2ccf73(0x9e)](a32_0x1f1692[_0x2ccf73(0xce)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a32_0x1f1692[_0x2ccf73(0xce)](_0x2ccf73(0xab)));const {options:_0x5342d4,args:_0x38c1c5,tdx:_0x3f7a23}=_0x3edf9a,_0x3db512=_0x5342d4;if(_0x38c1c5[_0x2ccf73(0xb4)]===0x0)return console[_0x2ccf73(0x9e)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2ccf73(0x9e)](_0x2ccf73(0xc7)),console[_0x2ccf73(0x9e)](_0x2ccf73(0xb7)),console['error'](_0x2ccf73(0x9f)),console['error'](_0x2ccf73(0xd3)),console[_0x2ccf73(0x9e)](_0x2ccf73(0xa9)),0x1;const _0x343085=_0x38c1c5[0x0],_0x13bc03=_0x5342d4[_0x2ccf73(0xaf)];let _0x42b1ff=_0x343085;_0x13bc03&&!_0x343085[_0x2ccf73(0xbf)]('/')&&(_0x42b1ff=_0x13bc03+'/'+_0x343085,_0x3db512[_0x2ccf73(0xae)]&&console[_0x2ccf73(0x9e)](_0x2ccf73(0xbb)+_0x42b1ff));const _0x262a6f=parsePath(_0x42b1ff);if(_0x262a6f['segments'][_0x2ccf73(0xb4)]<0x2)return console[_0x2ccf73(0x9e)](_0x2ccf73(0xcd)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x56aa27=_0x262a6f['segments'][0x0],_0x37bcd6=getBaseName(_0x42b1ff),_0x88b28d=getParentPath(_0x42b1ff);_0x3db512[_0x2ccf73(0xae)]&&(console['error'](_0x2ccf73(0xb2)+_0x3db512[_0x2ccf73(0xc1)]),console[_0x2ccf73(0x9e)](_0x2ccf73(0xa4)+_0x42b1ff),console[_0x2ccf73(0x9e)](_0x2ccf73(0xa6)+_0x56aa27),console['error']('Segment\x20name:\x20'+_0x37bcd6),console['error'](_0x2ccf73(0xb5)+_0x88b28d));const _0x31a8ce=await withSpinner(_0x2ccf73(0xa7)+_0x56aa27+_0x2ccf73(0xa8),()=>_0x3f7a23[_0x2ccf73(0xcb)][_0x2ccf73(0xcc)](_0x56aa27),{'verbose':_0x3db512[_0x2ccf73(0xae)]}),_0x566321=_0x31a8ce[_0x2ccf73(0xa1)];let _0x5f5221;if(_0x262a6f[_0x2ccf73(0xc5)][_0x2ccf73(0xb4)]>0x2){const _0x4889ad=await withSpinner(_0x2ccf73(0xc6)+_0x88b28d+_0x2ccf73(0xa8),()=>_0x3f7a23[_0x2ccf73(0xcb)][_0x2ccf73(0xac)](_0x88b28d),{'verbose':_0x3db512[_0x2ccf73(0xae)]}),_0x12a07c=_0x4889ad['data'];if(_0x12a07c[_0x2ccf73(0xad)]!==_0x2ccf73(0xcf)&&_0x12a07c[_0x2ccf73(0xad)]!==_0x2ccf73(0xa2))return console[_0x2ccf73(0x9e)](_0x2ccf73(0xbe)),0x1;_0x5f5221=_0x12a07c[_0x2ccf73(0xb3)];}else{if(_0x3db512['folder']){const _0x153787=await withSpinner('Resolving\x20folder\x20\x27'+_0x3db512[_0x2ccf73(0xcf)]+_0x2ccf73(0xa8),()=>_0x3f7a23['segment']['resolveFolderId'](_0x566321,_0x3db512['folder']),{'verbose':_0x3db512[_0x2ccf73(0xae)]});_0x5f5221=_0x153787[_0x2ccf73(0xa1)];}}_0x3db512[_0x2ccf73(0xae)]&&_0x5f5221&&console['error'](_0x2ccf73(0xc3)+_0x5f5221);const _0x392183=await loadJSONFromOptions(_0x3db512['rule'],_0x3db512[_0x2ccf73(0xd1)]),_0xcd5357={'name':_0x37bcd6,'description':_0x3db512[_0x2ccf73(0xb6)],'rule':_0x392183,'kind':_0x3db512[_0x2ccf73(0xc2)]!==undefined?parseInt(_0x3db512[_0x2ccf73(0xc2)],0xa):undefined,'isVisible':_0x3db512[_0x2ccf73(0xbc)]?![]:undefined,'segmentFolderId':_0x5f5221,'countPopulation':_0x3db512[_0x2ccf73(0xd2)]?![]:undefined},_0x5a84e0=await withSpinner(_0x2ccf73(0xc0)+_0x37bcd6+'\x27...',()=>_0x3f7a23[_0x2ccf73(0xcb)][_0x2ccf73(0xb8)](_0x566321,_0xcd5357),{'verbose':_0x3db512[_0x2ccf73(0xae)]}),_0x16a005=_0x5a84e0[_0x2ccf73(0xa1)];return console[_0x2ccf73(0x9e)]('✔\x20Created\x20segment\x20\x27'+_0x16a005['name']+_0x2ccf73(0xaa)+_0x16a005['id']),_0x42b1ff!==_0x343085&&console[_0x2ccf73(0x9e)]('\x20\x20\x20Path:\x20'+_0x42b1ff),await handleSDKOutput([_0x16a005],_0x3db512),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x22e28f=a33_0xb2f6;(function(_0x43c464,_0x1d5c4a){const _0x49c713=a33_0xb2f6,_0x240b6d=_0x43c464();while(!![]){try{const _0x5ca417=parseInt(_0x49c713(0x1a7))/0x1+parseInt(_0x49c713(0x1af))/0x2*(parseInt(_0x49c713(0x1a5))/0x3)+-parseInt(_0x49c713(0x1ad))/0x4*(parseInt(_0x49c713(0x1a4))/0x5)+-parseInt(_0x49c713(0x1a2))/0x6+parseInt(_0x49c713(0x19c))/0x7+-parseInt(_0x49c713(0x1aa))/0x8*(-parseInt(_0x49c713(0x1a8))/0x9)+parseInt(_0x49c713(0x19a))/0xa*(-parseInt(_0x49c713(0x19f))/0xb);if(_0x5ca417===_0x1d5c4a)break;else _0x240b6d['push'](_0x240b6d['shift']());}catch(_0x2bc761){_0x240b6d['push'](_0x240b6d['shift']());}}}(a33_0x2304,0x4d9cb));function a33_0x2304(){const _0x47af23=['length','Parent\x20segment:\x20','error','6689630kFhZWL','site','2702210KrZSGw','verbose','description','11bJuJEk','\x27...','listFields','525324wOUtun','json','10MczeYv','21wmYYpP','Site:\x20','390654MUHmCj','636102cvkaGl','Listing\x20fields\x20for\x20\x27','40ZdxWJk','execute','segment:fields','591460rxJncn','data','68592iOGQfM','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment'];a33_0x2304=function(){return _0x47af23;};return a33_0x2304();}function a33_0xb2f6(_0x174873,_0x42e0ec){_0x174873=_0x174873-0x19a;const _0x2304db=a33_0x2304();let _0xb2f641=_0x2304db[_0x174873];return _0xb2f641;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a33_0x22e28f(0x1ac);[a33_0x22e28f(0x19e)]='List\x20available\x20fields\x20for\x20segmentation';async[a33_0x22e28f(0x1ab)](_0x13a901){const _0xa6979f=a33_0x22e28f,{options:_0x406bf6,args:_0xaa347b,tdx:_0x5641f4}=_0x13a901,_0x308b7c=_0xaa347b[0x0]||_0x406bf6['parentSegment'];if(!_0x308b7c)return console[_0xa6979f(0x1b4)](_0xa6979f(0x1b0)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0xa6979f(0x1b4)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x406bf6[_0xa6979f(0x19d)]&&(console[_0xa6979f(0x1b4)](_0xa6979f(0x1a6)+_0x406bf6[_0xa6979f(0x19b)]),console[_0xa6979f(0x1b4)](_0xa6979f(0x1b3)+_0x308b7c));const _0x526ffc=await withSpinner(_0xa6979f(0x1a9)+_0x308b7c+_0xa6979f(0x1a0),()=>_0x5641f4[_0xa6979f(0x1b1)][_0xa6979f(0x1a1)](_0x308b7c),{'verbose':_0x406bf6[_0xa6979f(0x19d)]}),_0x5b92a6=_0x526ffc[_0xa6979f(0x1ae)];console[_0xa6979f(0x1b4)]('✔\x20Found\x20'+_0x5b92a6[_0xa6979f(0x1b2)]+'\x20field'+(_0x5b92a6['length']!==0x1?'s':''));if(_0x406bf6[_0xa6979f(0x1a3)]||_0x406bf6['jsonl'])return await handleSDKOutput(_0x5b92a6,_0x406bf6),0x0;return displayFieldsHumanReadable(_0x5b92a6,_0x308b7c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x105f(_0x5145b0,_0x4d6b28){_0x5145b0=_0x5145b0-0x67;const _0x1432e3=a34_0x1432();let _0x105f78=_0x1432e3[_0x5145b0];return _0x105f78;}const a34_0x4fa24b=a34_0x105f;(function(_0x28c1ae,_0x35989b){const _0x2b6281=a34_0x105f,_0x23b17d=_0x28c1ae();while(!![]){try{const _0x3576fc=parseInt(_0x2b6281(0xb2))/0x1+parseInt(_0x2b6281(0x8a))/0x2+-parseInt(_0x2b6281(0x77))/0x3+-parseInt(_0x2b6281(0x6f))/0x4*(parseInt(_0x2b6281(0x6a))/0x5)+parseInt(_0x2b6281(0x8c))/0x6*(-parseInt(_0x2b6281(0x88))/0x7)+parseInt(_0x2b6281(0x6c))/0x8+parseInt(_0x2b6281(0xaa))/0x9;if(_0x3576fc===_0x35989b)break;else _0x23b17d['push'](_0x23b17d['shift']());}catch(_0x112763){_0x23b17d['push'](_0x23b17d['shift']());}}}(a34_0x1432,0x877ad));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a34_0x1432(){const _0x48245=['site','yellow','\x20segments','\x27...','\x20new\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segment','segments','Pulling\x20segments\x20from\x20\x27','parent_segment','file','Parent\x20segment:\x20','pullSegments','\x20=\x20','journeys','\x0aPull\x20summary\x20for\x20\x27','\x20journeys','activations','dirname','dim','red','filter','helpText','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','cwd','setPhase','\x20\x20🎯\x20','6922278RmLnCZ','repeat','name','session','no_parent','parentSegment','type','content','611848WNyLVP','errorCode','✔\x20Context\x20set:\x20','\x20unchanged\x20files','counts','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','verbose','green','targetDir','Site:\x20','5WFCzgu','Write\x20','8213384ikXUiC','\x20\x20🗺️\x20\x20','cyan','4230308OJbltE','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','error','relativePath','\x20\x20Target:\x20','length','dryRun','utf-8','2883594iaxKCH','files','\x20with\x20','message','\x0aChanges\x20to\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20activations','hasChanges','execute','isNew','diff','✔\x20Pulled\x20','resourceName','journeyVersions','-\x20no\x20files\x20written','Target\x20resource:\x20','description','1480367rIawlV','absolutePath','2023922qpoiqp','Aborted.','24imRBIn','\x20changed\x20files'];a34_0x1432=function(){return _0x48245;};return a34_0x1432();}import a34_0x2b0163 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x3eda8a from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a34_0x4fa24b(0xac)]='segment:pull';[a34_0x4fa24b(0x87)]=a34_0x4fa24b(0xb7);async[a34_0x4fa24b(0x7f)](_0x126de2){const _0x1fea36=a34_0x4fa24b,{options:_0x112827,args:_0x5aad82,tdx:_0x267003}=_0x126de2,_0x375a21=_0x112827,_0x3949c3=await resolveTarget({'arg':_0x5aad82[0x0],'contextParent':_0x112827[_0x1fea36(0xaf)],'cwd':process[_0x1fea36(0xa7)]()});if(!isSuccessfulResolution(_0x3949c3))return _0x3949c3[_0x1fea36(0xb3)]===_0x1fea36(0xae)?(console[_0x1fea36(0x71)](a34_0x2b0163['yellow'](_0x1fea36(0x7c))),console[_0x1fea36(0x71)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x1fea36(0xa6)),console[_0x1fea36(0x71)](_0x1fea36(0x93))):(console['error'](a34_0x2b0163[_0x1fea36(0xa2)]('Error:\x20'+_0x3949c3[_0x1fea36(0x7a)]+'\x0a')),_0x3949c3['helpText']&&console[_0x1fea36(0x71)](a34_0x2b0163[_0x1fea36(0x6e)](_0x3949c3[_0x1fea36(0xa4)]))),0x1;const _0x3e306f=_0x3949c3[_0x1fea36(0xa5)],_0x2f65cf=_0x3949c3[_0x1fea36(0x68)],_0x38822d=_0x3949c3[_0x1fea36(0xb0)]===_0x1fea36(0x98)?_0x3949c3[_0x1fea36(0x83)]:undefined;_0x375a21[_0x1fea36(0xb8)]&&(console[_0x1fea36(0x71)](_0x1fea36(0x69)+_0x375a21[_0x1fea36(0x8e)]),console['error'](_0x1fea36(0x99)+_0x3e306f),_0x38822d&&console[_0x1fea36(0x71)](_0x1fea36(0x86)+_0x38822d));const _0x226ef6=await withProgressSpinner(_0x1fea36(0x96)+_0x3e306f+_0x1fea36(0x91),_0x596ca6=>_0x267003[_0x1fea36(0x94)][_0x1fea36(0x9a)](_0x3e306f,{'targetDir':_0x2f65cf,'targetResourceName':_0x38822d,'verbose':_0x375a21['verbose'],'progress':{'update':_0x43bf56=>{const _0xf4058c=_0x1fea36;_0x596ca6[_0xf4058c(0xa8)](_0x43bf56),_0x375a21[_0xf4058c(0xb8)]&&console[_0xf4058c(0x71)]('\x20\x20'+_0x43bf56);}}}),{'verbose':_0x375a21['verbose']}),_0x163bdb=_0x226ef6['data'];if(_0x163bdb[_0x1fea36(0xb6)][_0x1fea36(0x95)]===0x0&&_0x163bdb[_0x1fea36(0xb6)][_0x1fea36(0x9c)]===0x0)return console['error'](a34_0x2b0163[_0x1fea36(0x8f)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x163bdb[_0x1fea36(0xa5)]+'\x27')),0x0;const _0x51dc0f=_0x163bdb[_0x1fea36(0x78)][_0x1fea36(0xa3)](_0x7cc159=>_0x7cc159[_0x1fea36(0x80)]),_0x89792c=_0x163bdb['files'][_0x1fea36(0xa3)](_0x284168=>!_0x284168['isNew']&&_0x284168[_0x1fea36(0x7e)]),_0x120579=_0x163bdb[_0x1fea36(0x78)][_0x1fea36(0xa3)](_0x5d8a4c=>!_0x5d8a4c[_0x1fea36(0x80)]&&!_0x5d8a4c[_0x1fea36(0x7e)]);console[_0x1fea36(0x71)](_0x1fea36(0x9d)+_0x163bdb['parentName']+'\x27:'),console[_0x1fea36(0x71)](_0x1fea36(0xa9)+a34_0x2b0163[_0x1fea36(0x6e)](_0x163bdb['counts'][_0x1fea36(0x95)]+_0x1fea36(0x90))+_0x1fea36(0x79)+a34_0x2b0163[_0x1fea36(0x6e)](_0x163bdb[_0x1fea36(0xb6)][_0x1fea36(0x9f)]+_0x1fea36(0x7d)));if(_0x163bdb[_0x1fea36(0xb6)][_0x1fea36(0x9c)]>0x0){const _0x330008=_0x163bdb[_0x1fea36(0xb6)][_0x1fea36(0x84)]>_0x163bdb[_0x1fea36(0xb6)]['journeys']?'\x20('+_0x163bdb[_0x1fea36(0xb6)]['journeyVersions']+'\x20versions)':'';console[_0x1fea36(0x71)](_0x1fea36(0x6d)+a34_0x2b0163['cyan'](_0x163bdb['counts'][_0x1fea36(0x9c)]+_0x1fea36(0x9e))+a34_0x2b0163[_0x1fea36(0xa1)](_0x330008));}console[_0x1fea36(0x71)]('\x20\x20'+a34_0x2b0163['green']('+\x20'+_0x51dc0f[_0x1fea36(0x74)]+_0x1fea36(0x92))),console[_0x1fea36(0x71)]('\x20\x20'+a34_0x2b0163['yellow']('~\x20'+_0x89792c[_0x1fea36(0x74)]+_0x1fea36(0x8d))),console[_0x1fea36(0x71)]('\x20\x20'+a34_0x2b0163['dim']('=\x20'+_0x120579[_0x1fea36(0x74)]+_0x1fea36(0xb5))),console[_0x1fea36(0x71)](_0x1fea36(0x73)+a34_0x2b0163[_0x1fea36(0x6e)](_0x163bdb[_0x1fea36(0x68)])+'\x0a');if(_0x89792c[_0x1fea36(0x74)]>0x0)for(const _0x338085 of _0x89792c){console[_0x1fea36(0x71)](_0x1fea36(0x7b)+_0x338085[_0x1fea36(0x72)]+'\x27:'),console[_0x1fea36(0x71)]('─'[_0x1fea36(0xab)](0x3c)),console[_0x1fea36(0x71)](_0x338085[_0x1fea36(0x81)]),console['error']('─'[_0x1fea36(0xab)](0x3c));}if(_0x375a21[_0x1fea36(0x75)])return console['error'](a34_0x2b0163[_0x1fea36(0x8f)](_0x1fea36(0x70))),0x0;if(_0x51dc0f['length']===0x0&&_0x89792c[_0x1fea36(0x74)]===0x0)return console[_0x1fea36(0x71)](a34_0x2b0163['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x163bdb['parentName']},_0x375a21[_0x1fea36(0xad)]),console['error'](a34_0x2b0163[_0x1fea36(0x67)]('✔\x20Context\x20set:\x20'+a34_0x2b0163['dim'](_0x1fea36(0x97))+_0x1fea36(0x9b)+a34_0x2b0163[_0x1fea36(0x6e)](_0x163bdb[_0x1fea36(0xa5)]))),0x0;if(!_0x375a21['yes']){if(!isInteractive())return console[_0x1fea36(0x71)](a34_0x2b0163['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1fea36(0x71)](a34_0x2b0163[_0x1fea36(0xa1)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x228a15=await confirmKey(_0x1fea36(0x6b)+(_0x51dc0f[_0x1fea36(0x74)]+_0x89792c[_0x1fea36(0x74)])+'\x20files?');if(!_0x228a15)return console[_0x1fea36(0x71)](a34_0x2b0163[_0x1fea36(0x8f)](_0x1fea36(0x8b)),_0x1fea36(0x85)),0x1;}for(const _0x193bf9 of _0x163bdb['files']){if(_0x193bf9[_0x1fea36(0x80)]||_0x193bf9[_0x1fea36(0x7e)]){const _0x41d9d6=a34_0x3eda8a[_0x1fea36(0xa0)](_0x193bf9['absolutePath']);!existsSync(_0x41d9d6)&&mkdirSync(_0x41d9d6,{'recursive':!![]}),writeFileSync(_0x193bf9[_0x1fea36(0x89)],_0x193bf9[_0x1fea36(0xb1)],_0x1fea36(0x76));}}return console[_0x1fea36(0x71)](a34_0x2b0163[_0x1fea36(0x67)](_0x1fea36(0x82)+(_0x51dc0f[_0x1fea36(0x74)]+_0x89792c[_0x1fea36(0x74)])+'\x20files\x20to\x20'+_0x163bdb['targetDir'])),saveSessionContext({'parent_segment':_0x163bdb[_0x1fea36(0xa5)]},_0x375a21['session']),console[_0x1fea36(0x71)](a34_0x2b0163[_0x1fea36(0x67)](_0x1fea36(0xb4)+a34_0x2b0163[_0x1fea36(0xa1)](_0x1fea36(0x97))+_0x1fea36(0x9b)+a34_0x2b0163[_0x1fea36(0x6e)](_0x163bdb['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a35_0x422c(){const _0x4fd019=['Fetching\x20connections\x20for\x20name\x20resolution...','setPhase','existingJourney','Fetching\x20existing\x20data...','journeys','196VcTTRq','Scoped\x20to\x20folder:\x20','\x20to\x20create','delete','name','Preparing\x20journeys...','cwd','idToName','\x20\x20📊\x20Segments:','dim','3774456uPDNZf','listActivations','segmentFolderId','\x20deleted','then','listFolders','(Journey\x20will\x20be\x20deleted)','createdAt','description','290059RBpUMk','folders','\x20created','20NTQTxc','10610gAqPMu','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','resolveParentId','Resolving\x20parent\x20segment\x20\x27','updatedAt','push','Source\x20directory:\x20','relationships','user','.yaml','getParent','Push\x20','segments','\x20\x20Journeys:\x20','filter','/j/da/je','createdSegmentIds','get','getOutputSchemaWithCache','data','list','Error\x20parsing\x20YAML:\x20','existingSegment','join','1053348Qdswsz','changed','📁\x20','updated','Error:\x20Directory\x20not\x20found:\x20','set','\x27...','No\x20','\x20new','14EDlnYm','listSegments','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yes','parent_name','type','message','endsWith','journeysOnly','1117716fXRMiv','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','errorCode','Aborted.','versionNumber','/app/ps/','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','verbose','\x20to\x20delete','cyan','no_parent','green','\x0aPush\x20summary\x20for\x20\x27','red','Changes\x20to:','listJourneysWithDetailsFromParentSegment','Fetching\x20existing\x20activations...','segment\x20or\x20journey','New\x20segment:','paused','getJourney','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','blue','\x20\x20🗺️\x20\x20Journeys:','diff','\x20unchanged','audienceId','new','yellow','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeyId','Parent\x20segment:\x20','\x0a✔\x20Push\x20complete','activations','Error:\x20','folderPath','targetDir','\x0aValidation\x20failed:','scopedFolderPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','created','yamlConfig','connection','\x20activations]','nameToId','\x20YAML\x20files\x20found','error','site','/e/','\x20\x20Activations:','unchanged','execute','file','\x20updated','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/sb/da/esr','folderId','40032nAQqsO','journey','Changes\x20to\x20journey:','toDelete','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeyBundleName','toString','isNew','repeat','attributes','map','results','2kYSQTw','parentSegment','length','\x20folders\x20to\x20create','segment','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','journeyBundleId','all','\x20\x20\x20\x20','\x20changed','helpText','toCreate','10080224AyUUWN'];a35_0x422c=function(){return _0x4fd019;};return a35_0x422c();}const a35_0x326f6b=a35_0xf7a3;(function(_0x4f2217,_0x554647){const _0x18cd7c=a35_0xf7a3,_0x23cd6e=_0x4f2217();while(!![]){try{const _0x342d6e=-parseInt(_0x18cd7c(0x210))/0x1*(parseInt(_0x18cd7c(0x1eb))/0x2)+-parseInt(_0x18cd7c(0x22c))/0x3+parseInt(_0x18cd7c(0x1fd))/0x4*(-parseInt(_0x18cd7c(0x214))/0x5)+-parseInt(_0x18cd7c(0x23e))/0x6*(parseInt(_0x18cd7c(0x235))/0x7)+-parseInt(_0x18cd7c(0x207))/0x8+parseInt(_0x18cd7c(0x1df))/0x9+-parseInt(_0x18cd7c(0x213))/0xa*(-parseInt(_0x18cd7c(0x1f7))/0xb);if(_0x342d6e===_0x554647)break;else _0x23cd6e['push'](_0x23cd6e['shift']());}catch(_0x7290e4){_0x23cd6e['push'](_0x23cd6e['shift']());}}}(a35_0x422c,0x3c784));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x34fe77 from'chalk';function a35_0xf7a3(_0x30e7a6,_0x9aa813){_0x30e7a6=_0x30e7a6-0x1da;const _0x422cce=a35_0x422c();let _0xf7a31f=_0x422cce[_0x30e7a6];return _0xf7a31f;}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']='segment:push';[a35_0x326f6b(0x20f)]=a35_0x326f6b(0x215);async[a35_0x326f6b(0x273)](_0x5ceffa){const _0x206a67=a35_0x326f6b,{options:_0x2174e7,args:_0x5a1f6f,tdx:_0x35440d}=_0x5ceffa,_0x549452=_0x2174e7,_0x2b4011=await resolveTarget({'arg':_0x5a1f6f[0x0],'contextParent':_0x2174e7[_0x206a67(0x1ec)],'cwd':process[_0x206a67(0x203)]()});if(!isSuccessfulResolution(_0x2b4011))return _0x2b4011[_0x206a67(0x240)]===_0x206a67(0x248)?(console['error'](a35_0x34fe77[_0x206a67(0x25c)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x206a67(0x26e)](_0x206a67(0x1f0)),console[_0x206a67(0x26e)](_0x206a67(0x267)),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[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x24b)](_0x206a67(0x262)+_0x2b4011[_0x206a67(0x23b)]+'\x0a')),_0x2b4011[_0x206a67(0x1f5)]&&console['error'](a35_0x34fe77[_0x206a67(0x247)](_0x2b4011['helpText']))),0x1;if(_0x2b4011[_0x206a67(0x23a)]===_0x206a67(0x239))return console['error'](a35_0x34fe77[_0x206a67(0x24b)](_0x206a67(0x230)+_0x2b4011[_0x206a67(0x264)]+'\x0a')),console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x247)](_0x206a67(0x23f))),0x1;const _0x1e4a46=_0x2b4011['parentName'],_0x29b83d=_0x2b4011[_0x206a67(0x264)],_0x559370=_0x2b4011[_0x206a67(0x23a)]===_0x206a67(0x1da)?_0x2b4011['filePath']:undefined,_0x223d28=getScopedDetails(_0x2b4011),_0x20df82=_0x223d28?.['isScoped']??![],_0x2f27d3=_0x223d28?.[_0x206a67(0x266)]??'';if(!existsSync(_0x29b83d))return console[_0x206a67(0x26e)](a35_0x34fe77['red'](_0x206a67(0x230)+_0x29b83d+'\x0a')),console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x247)](_0x206a67(0x23f))),0x1;_0x549452[_0x206a67(0x245)]&&(console['error']('Site:\x20'+_0x549452['site']),console[_0x206a67(0x26e)](_0x206a67(0x25f)+_0x1e4a46),console[_0x206a67(0x26e)](_0x206a67(0x21a)+_0x29b83d),_0x20df82&&console[_0x206a67(0x26e)](_0x206a67(0x1fe)+_0x2f27d3));const _0x12b620=await withSpinner(_0x206a67(0x217)+_0x1e4a46+_0x206a67(0x232),()=>_0x35440d[_0x206a67(0x1ef)][_0x206a67(0x216)](_0x1e4a46),{'verbose':_0x549452['verbose']}),_0x47c05a=_0x12b620[_0x206a67(0x227)],{parentSegmentResult:_0x2bf1e4,segmentsResult:_0x1c44d7,foldersResult:_0x2acbf8,journeysWithDetailsResult:_0x20090f,userMaps:_0x5229f2}=await withSpinner(_0x206a67(0x1fb),async()=>{const _0x5d0b65=_0x206a67,[_0x5bd2c7,_0x4975a5,_0x3c37ce,_0xe7909f,_0x5deeac]=await Promise[_0x5d0b65(0x1f2)]([_0x35440d[_0x5d0b65(0x1ef)][_0x5d0b65(0x21e)](_0x47c05a),_0x35440d[_0x5d0b65(0x1ef)][_0x5d0b65(0x236)](_0x47c05a),_0x35440d[_0x5d0b65(0x1ef)][_0x5d0b65(0x20c)](_0x47c05a),_0x35440d[_0x5d0b65(0x1e0)][_0x5d0b65(0x24d)](_0x47c05a,{'includeAllVersions':!![]}),_0x35440d[_0x5d0b65(0x21c)]['buildUserMaps']()]);return{'parentSegmentResult':_0x5bd2c7,'segmentsResult':_0x4975a5,'foldersResult':_0x3c37ce,'journeysWithDetailsResult':_0xe7909f,'userMaps':_0x5deeac};},{'verbose':_0x549452[_0x206a67(0x245)]})['then'](_0x3e39a3=>_0x3e39a3[_0x206a67(0x227)]),_0x43e259=_0x2bf1e4,_0x237ffb=extractRootFolderId(_0x43e259),_0x420698=_0x1c44d7,_0x315ea0=_0x2acbf8,{journeys:_0xf48a53,activationStepsById:_0x18c3eb}=_0x20090f,_0x4133a7=new Map(_0xf48a53[_0x206a67(0x1e9)](_0x4aeb1b=>[_0x4aeb1b['id'],_0x4aeb1b])),_0xda10b5=_0xf48a53[_0x206a67(0x1e9)](_0x42beca=>({'id':_0x42beca['id'],'name':_0x42beca['attributes']['name'],'journeyBundleName':_0x42beca[_0x206a67(0x1e8)][_0x206a67(0x1e4)]||'','journeyBundleId':_0x42beca['attributes'][_0x206a67(0x1f1)]||'','versionNumber':_0x42beca[_0x206a67(0x1e8)][_0x206a67(0x242)],'description':_0x42beca['attributes'][_0x206a67(0x20f)],'state':_0x42beca['attributes']['state'],'paused':_0x42beca['attributes'][_0x206a67(0x251)],'audienceId':_0x42beca['attributes'][_0x206a67(0x25a)],'folderId':_0x42beca[_0x206a67(0x21b)]?.['parentFolder']?.[_0x206a67(0x227)]?.['id'],'createdAt':_0x42beca[_0x206a67(0x1e8)][_0x206a67(0x20e)],'updatedAt':_0x42beca[_0x206a67(0x1e8)][_0x206a67(0x218)]})),{emailToId:_0x1e2513,idToEmail:_0x357c80}=_0x5229f2,_0x5a50fd=await withSpinner(_0x206a67(0x1f8),async()=>{const _0x7736de=_0x206a67,_0x542b6f=await _0x35440d[_0x7736de(0x26a)][_0x7736de(0x228)]();return buildConnectionMaps(_0x542b6f);},{'verbose':_0x549452[_0x206a67(0x245)]})[_0x206a67(0x20b)](_0x7bc1da=>_0x7bc1da[_0x206a67(0x227)]),_0x55e1df=_0x5a50fd['nameToId'],_0x27c94c=_0x5a50fd['idToName'],_0x5ec7a1=_0x5a50fd['nameToType'],_0x4b5e26={'emailToIdMap':_0x1e2513,'connectionNameToIdMap':_0x55e1df,'connectionNameToTypeMap':_0x5ec7a1,'getSchema':_0x45040b=>_0x35440d[_0x206a67(0x26a)][_0x206a67(0x226)](_0x45040b)};let {pathToId:_0x33099b,idToPath:_0x2f7c66}=buildFolderMaps(_0x315ea0);const _0x523190=buildSegmentLookupMap(_0x420698,_0x2f7c66),_0x100f99=buildSegmentNameToIdMap(_0x420698),_0x4031c1=buildJourneyBundleLookupMap(_0xda10b5,_0x2f7c66);let _0x479e75;if(_0x559370){if(!_0x559370[_0x206a67(0x23c)]('.yml')&&!_0x559370[_0x206a67(0x23c)](_0x206a67(0x21d)))return console[_0x206a67(0x26e)](a35_0x34fe77['red'](_0x206a67(0x255)+_0x559370+'\x0a')),0x1;_0x479e75=[_0x559370];}else _0x479e75=findYamlFiles(_0x29b83d);if(_0x479e75[_0x206a67(0x1ed)]===0x0)return console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x24b)](_0x206a67(0x237)+_0x29b83d+'\x0a')),console['error'](a35_0x34fe77['cyan'](_0x206a67(0x1dc))),0x1;let _0x2acab3,_0x5a7654;try{const _0x549027=parseAndClassifyYamlFiles(_0x479e75,_0x29b83d,{'skipSegments':_0x549452['journeysOnly']});_0x2acab3=_0x549027[_0x206a67(0x220)],_0x5a7654=_0x549027['journeys'];const _0x17bb45=validateParsedFiles(_0x549027,_0x29b83d);if(_0x17bb45[_0x206a67(0x1ed)]>0x0)return console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x24b)](_0x206a67(0x265))),console[_0x206a67(0x26e)](formatValidationErrors(_0x17bb45)),console[_0x206a67(0x26e)](a35_0x34fe77['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x164330){return console['error'](a35_0x34fe77[_0x206a67(0x24b)](_0x206a67(0x229)+(_0x164330 instanceof Error?_0x164330[_0x206a67(0x23b)]:_0x164330))),0x1;}if(_0x2acab3[_0x206a67(0x1ed)]===0x0&&_0x5a7654[_0x206a67(0x1ed)]===0x0){const _0x37fea1=_0x549452[_0x206a67(0x23d)]?'journey':_0x206a67(0x24f);return console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x25c)](_0x206a67(0x233)+_0x37fea1+_0x206a67(0x26d))),0x0;}const _0x28d291=new Map();_0x420698[_0x206a67(0x1ed)]>0x0&&!_0x549452[_0x206a67(0x23d)]&&await withSpinner(_0x206a67(0x24e),async()=>{await batchAsync(_0x420698,async _0x3799bc=>{const _0x430d65=a35_0xf7a3,_0x2de49e=await _0x35440d[_0x430d65(0x1ef)][_0x430d65(0x208)](_0x47c05a,_0x3799bc['id']);_0x28d291[_0x430d65(0x231)](_0x3799bc['id'],_0x2de49e);});},{'verbose':_0x549452[_0x206a67(0x245)]});const {segmentFiles:_0x57e375,foldersToCreate:_0x3ae519}=await prepareSegmentFiles(_0x2acab3,{'segmentByFolderAndName':_0x523190,'activationsBySegmentId':_0x28d291,'folderPathToId':_0x33099b,'idToEmailMap':_0x357c80,'connectionIdToNameMap':_0x27c94c},_0x4b5e26,_0x20df82,_0x2f27d3),_0x58026c=_0x559370?[]:findSegmentsToDelete(_0x420698,_0x2acab3[_0x206a67(0x1e9)](({yamlConfig:_0x28bf35,folderPath:_0x7afd01})=>({'yamlConfig':_0x28bf35,'folderPath':resolveTDFolderPath(_0x7afd01,_0x20df82,_0x2f27d3)})),_0x2f7c66,_0x2f27d3,_0x20df82),{journeyFiles:_0xbfe77a,foldersToCreate:_0x505cf5}=await withProgressSpinner(_0x206a67(0x202),async _0x2c5951=>prepareJourneyFiles(_0x5a7654,{'fetchJourney':async _0x57e49c=>_0x35440d[_0x206a67(0x1e0)][_0x206a67(0x252)](_0x57e49c['journeyId']),'journeyBundlesByFolderAndName':_0x4031c1,'folderPathToId':_0x33099b,'idToEmailMap':_0x357c80,'connectionIdToNameMap':_0x27c94c,'existingSegments':_0x420698,'parentId':_0x47c05a,'deps':_0x35440d,'progress':{'update':_0x5c3ab7=>{const _0x15908d=_0x206a67;_0x2c5951[_0x15908d(0x1f9)](_0x5c3ab7),_0x549452[_0x15908d(0x245)]&&console[_0x15908d(0x26e)]('\x20\x20'+_0x5c3ab7);}},'journeyById':_0x4133a7,'activationStepsById':_0x18c3eb},_0x20df82,_0x2f27d3),{'verbose':_0x549452[_0x206a67(0x245)]})['then'](_0x11a42f=>_0x11a42f[_0x206a67(0x227)]);for(const _0x1b6d98 of _0x505cf5){_0x3ae519['add'](_0x1b6d98);}const _0x32179d=_0x559370?[]:findJourneysToDelete(_0xda10b5,_0x5a7654[_0x206a67(0x1e9)](({yamlConfig:_0x48275b,folderPath:_0x501348})=>({'yamlConfig':_0x48275b,'folderPath':resolveTDFolderPath(_0x501348,_0x20df82,_0x2f27d3)})),_0x2f7c66,_0x2f27d3,_0x20df82),_0x5844b9=calculatePushStats(_0x57e375,_0xbfe77a,_0x3ae519,_0x58026c,_0x32179d,!!_0x549452[_0x206a67(0x200)],!!_0x549452[_0x206a67(0x23d)]),_0x2070a3=_0x5844b9[_0x206a67(0x220)][_0x206a67(0x25b)],_0x5529dc=_0x5844b9[_0x206a67(0x220)][_0x206a67(0x22d)],_0x3938c7=_0x5844b9[_0x206a67(0x220)][_0x206a67(0x272)],_0x5dbe99=_0x5844b9[_0x206a67(0x220)]['toDelete'],_0x41f4e0=_0x5844b9[_0x206a67(0x211)][_0x206a67(0x1f6)],_0x56b611=_0x5844b9['journeys']['new'],_0x1ea9d7=_0x5844b9[_0x206a67(0x1fc)][_0x206a67(0x22d)],_0x21fef0=_0x5844b9[_0x206a67(0x1fc)][_0x206a67(0x272)],_0x559c1f=_0x5844b9['journeys'][_0x206a67(0x1e2)],_0x3664a4=_0x5844b9[_0x206a67(0x261)][_0x206a67(0x1f2)],_0x3993b5=_0x5844b9[_0x206a67(0x261)]['toCreate'],_0x445fbd=_0x5844b9[_0x206a67(0x261)]['toUpdate'],_0x4b0b9e=_0x5844b9['activations'][_0x206a67(0x1e2)];console[_0x206a67(0x26e)](_0x206a67(0x24a)+_0x1e4a46+'\x27:');_0x41f4e0[_0x206a67(0x1ed)]>0x0&&console[_0x206a67(0x26e)]('\x20\x20'+a35_0x34fe77['blue'](_0x206a67(0x22e)+_0x41f4e0['length']+_0x206a67(0x1ee)));if(!_0x549452[_0x206a67(0x23d)]){console[_0x206a67(0x26e)](_0x206a67(0x205)),console[_0x206a67(0x26e)]('\x20\x20\x20\x20'+a35_0x34fe77[_0x206a67(0x249)]('+\x20'+_0x2070a3['length']+_0x206a67(0x234))),console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x25c)]('~\x20'+_0x5529dc[_0x206a67(0x1ed)]+_0x206a67(0x1f4)));if(_0x5dbe99['length']>0x0)console['error'](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x24b)]('-\x20'+_0x5dbe99['length']+_0x206a67(0x246)));else _0x58026c[_0x206a67(0x1ed)]>0x0&&!_0x549452['delete']&&console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x206)](_0x58026c[_0x206a67(0x1ed)]+_0x206a67(0x244)));console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x206)]('=\x20'+_0x3938c7[_0x206a67(0x1ed)]+_0x206a67(0x259)));}if(_0xbfe77a[_0x206a67(0x1ed)]>0x0||_0x32179d[_0x206a67(0x1ed)]>0x0){console['error'](_0x206a67(0x257)),console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x249)]('+\x20'+_0x56b611[_0x206a67(0x1ed)]+_0x206a67(0x234))),console['error']('\x20\x20\x20\x20'+a35_0x34fe77[_0x206a67(0x25c)]('~\x20'+_0x1ea9d7[_0x206a67(0x1ed)]+'\x20changed'));if(_0x559c1f[_0x206a67(0x1ed)]>0x0)console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x24b)]('-\x20'+_0x559c1f[_0x206a67(0x1ed)]+'\x20to\x20delete'));else _0x32179d[_0x206a67(0x1ed)]>0x0&&!_0x549452[_0x206a67(0x200)]&&console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x206)](_0x32179d['length']+_0x206a67(0x244)));console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x206)]('=\x20'+_0x21fef0[_0x206a67(0x1ed)]+_0x206a67(0x259)));}_0x3664a4['length']>0x0&&!_0x549452[_0x206a67(0x23d)]&&(console[_0x206a67(0x26e)](''),console['error'](_0x206a67(0x271)),_0x3993b5[_0x206a67(0x1ed)]>0x0&&console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77[_0x206a67(0x249)]('+\x20'+_0x3993b5[_0x206a67(0x1ed)]+_0x206a67(0x1ff))),_0x445fbd[_0x206a67(0x1ed)]>0x0&&console[_0x206a67(0x26e)](_0x206a67(0x1f3)+a35_0x34fe77['yellow']('~\x20'+_0x445fbd['length']+'\x20to\x20update')),_0x4b0b9e[_0x206a67(0x1ed)]>0x0&&console['error'](_0x206a67(0x1f3)+a35_0x34fe77['red']('-\x20'+_0x4b0b9e[_0x206a67(0x1ed)]+'\x20to\x20delete')));console['error']('\x20\x20Source:\x20'+a35_0x34fe77[_0x206a67(0x247)](_0x29b83d)+'\x0a');if(_0x41f4e0['length']>0x0){console[_0x206a67(0x26e)]('Folders\x20to\x20create:');for(const _0x787510 of _0x41f4e0){console['error']('\x20\x20'+a35_0x34fe77['blue']('+')+'\x20'+_0x787510);}console[_0x206a67(0x26e)]('');}if(_0x2070a3['length']>0x0&&!_0x549452[_0x206a67(0x23d)])for(const _0x86f087 of _0x2070a3){const _0x3031f7=_0x86f087[_0x206a67(0x263)]?_0x86f087['folderPath']+'/'+_0x86f087['yamlConfig'][_0x206a67(0x201)]:_0x86f087[_0x206a67(0x269)][_0x206a67(0x201)],_0x1fd9c8=_0x86f087['yamlConfig'][_0x206a67(0x261)]?.[_0x206a67(0x1ed)]||0x0,_0x3f5314=_0x1fd9c8>0x0?a35_0x34fe77[_0x206a67(0x206)]('\x20['+_0x1fd9c8+_0x206a67(0x26b)):'';console[_0x206a67(0x26e)]('\x0a'+a35_0x34fe77[_0x206a67(0x249)](_0x206a67(0x250))+'\x20'+_0x3031f7+_0x3f5314),console['error']('─'['repeat'](0x3c)),_0x86f087['diff']&&console['error'](_0x86f087[_0x206a67(0x258)]),console['error']('─'[_0x206a67(0x1e7)](0x3c));}if(_0x5dbe99[_0x206a67(0x1ed)]>0x0&&!_0x549452['journeysOnly'])for(const _0x252595 of _0x5dbe99){const _0x24be1a=_0x252595[_0x206a67(0x209)]?_0x2f7c66[_0x206a67(0x225)](_0x252595['segmentFolderId'][_0x206a67(0x1e5)]())||'':'',_0x46b2e9=_0x24be1a?_0x24be1a+'/'+_0x252595[_0x206a67(0x201)]:_0x252595[_0x206a67(0x201)],_0xf97ca0=_0x28d291[_0x206a67(0x225)](_0x252595['id'])||[],_0x4724a4=_0xf97ca0['length']>0x0?a35_0x34fe77[_0x206a67(0x206)]('\x20['+_0xf97ca0[_0x206a67(0x1ed)]+'\x20activations]'):'';console[_0x206a67(0x26e)]('\x0a'+a35_0x34fe77[_0x206a67(0x24b)]('Delete\x20segment:')+'\x20'+_0x46b2e9+_0x4724a4),console[_0x206a67(0x26e)]('─'[_0x206a67(0x1e7)](0x3c));const _0x1e8c62=segmentWithActivationsToYaml(_0x252595,_0xf97ca0,undefined,_0x357c80,_0x27c94c),_0x152a86=segmentToYamlString(_0x1e8c62),_0x1555a3=generateDiff(_0x152a86,'');console[_0x206a67(0x26e)](formatDiffWithColors(_0x1555a3)),console[_0x206a67(0x26e)]('─'[_0x206a67(0x1e7)](0x3c));}const _0x193a79=_0x57e375['filter'](_0x130e7e=>!_0x130e7e[_0x206a67(0x1e6)]&&_0x130e7e[_0x206a67(0x258)]);if(_0x193a79['length']>0x0&&!_0x549452[_0x206a67(0x23d)])for(const _0x39d2ae of _0x193a79){const _0x55dffc=_0x39d2ae[_0x206a67(0x263)]?_0x39d2ae[_0x206a67(0x263)]+'/'+_0x39d2ae[_0x206a67(0x269)]['name']:_0x39d2ae[_0x206a67(0x269)][_0x206a67(0x201)];console[_0x206a67(0x26e)]('\x0a'+a35_0x34fe77[_0x206a67(0x25c)](_0x206a67(0x24c))+'\x20'+_0x55dffc),console['error']('─'[_0x206a67(0x1e7)](0x3c)),console[_0x206a67(0x26e)](_0x39d2ae[_0x206a67(0x258)]),console['error']('─'[_0x206a67(0x1e7)](0x3c));}if(_0x56b611[_0x206a67(0x1ed)]>0x0)for(const _0x4a6f07 of _0x56b611){const _0x184109=_0x4a6f07[_0x206a67(0x263)]?_0x4a6f07[_0x206a67(0x263)]+'/'+_0x4a6f07['yamlConfig'][_0x206a67(0x201)]:_0x4a6f07[_0x206a67(0x269)][_0x206a67(0x201)];console[_0x206a67(0x26e)]('\x0a'+a35_0x34fe77['green']('New\x20journey:')+'\x20'+_0x184109),console[_0x206a67(0x26e)]('─'[_0x206a67(0x1e7)](0x3c)),_0x4a6f07['diff']&&console[_0x206a67(0x26e)](_0x4a6f07[_0x206a67(0x258)]),console[_0x206a67(0x26e)]('─'[_0x206a67(0x1e7)](0x3c));}const _0x5dc743=_0xbfe77a[_0x206a67(0x222)](_0x58af92=>!_0x58af92['isNew']&&_0x58af92[_0x206a67(0x258)]);if(_0x5dc743[_0x206a67(0x1ed)]>0x0)for(const _0x21c66b of _0x5dc743){const _0x268fda=_0x21c66b[_0x206a67(0x263)]?_0x21c66b[_0x206a67(0x263)]+'/'+_0x21c66b[_0x206a67(0x269)]['name']:_0x21c66b['yamlConfig'][_0x206a67(0x201)];console[_0x206a67(0x26e)]('\x0a'+a35_0x34fe77['yellow'](_0x206a67(0x1e1))+'\x20'+_0x268fda),console[_0x206a67(0x26e)]('─'[_0x206a67(0x1e7)](0x3c)),console[_0x206a67(0x26e)](_0x21c66b[_0x206a67(0x258)]),console['error']('─'[_0x206a67(0x1e7)](0x3c));}if(_0x559c1f[_0x206a67(0x1ed)]>0x0)for(const _0x1c4c60 of _0x559c1f){const _0x3a2a3e=_0x1c4c60[_0x206a67(0x1de)]?_0x2f7c66['get'](_0x1c4c60[_0x206a67(0x1de)])||'':'',_0x46ee96=_0x3a2a3e?_0x3a2a3e+'/'+_0x1c4c60[_0x206a67(0x1e4)]:_0x1c4c60['journeyBundleName'];console[_0x206a67(0x26e)]('\x0a'+a35_0x34fe77[_0x206a67(0x24b)]('Delete\x20journey:')+'\x20'+_0x46ee96),console[_0x206a67(0x26e)]('─'[_0x206a67(0x1e7)](0x3c)),console[_0x206a67(0x26e)](a35_0x34fe77['red'](_0x206a67(0x20d))),console[_0x206a67(0x26e)]('─'[_0x206a67(0x1e7)](0x3c));}if(_0x549452['dryRun'])return console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x25c)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x52d3ca=_0x549452[_0x206a67(0x23d)]?![]:_0x2070a3[_0x206a67(0x1ed)]>0x0||_0x5529dc[_0x206a67(0x1ed)]>0x0||_0x5dbe99['length']>0x0,_0x4bfdb3=_0x56b611[_0x206a67(0x1ed)]>0x0||_0x1ea9d7[_0x206a67(0x1ed)]>0x0||_0x559c1f['length']>0x0,_0x38a8d9=_0x549452[_0x206a67(0x23d)]?![]:_0x3664a4[_0x206a67(0x1ed)]>0x0,_0x178046=_0x41f4e0[_0x206a67(0x1ed)]>0x0;if(!_0x52d3ca&&!_0x4bfdb3&&!_0x38a8d9&&!_0x178046){const _0x55955a=_0x549452[_0x206a67(0x23d)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x206a67(0x25d);console['error'](a35_0x34fe77['green'](_0x55955a));if(_0x559370&&_0x3938c7[_0x206a67(0x1ed)]===0x1){const _0x457c9e=_0x3938c7[0x0];if(_0x457c9e['existingSegment']?.['id']){const _0x34b179=getConsoleNextUrl(_0x549452[_0x206a67(0x26f)],_0x206a67(0x243)+_0x47c05a+_0x206a67(0x270)+_0x457c9e[_0x206a67(0x22a)]['id']+_0x206a67(0x1dd));console[_0x206a67(0x26e)](_0x206a67(0x253)+a35_0x34fe77[_0x206a67(0x247)](_0x34b179));}}if(_0x559370&&_0x21fef0[_0x206a67(0x1ed)]===0x1){const _0x4cdf62=_0x21fef0[0x0];if(_0x4cdf62[_0x206a67(0x1fa)]?.['id']){const _0x51b328=getConsoleNextUrl(_0x549452['site'],_0x206a67(0x243)+_0x47c05a+'/e/'+_0x4cdf62[_0x206a67(0x1fa)]['id']+'/j/da/je');console['error']('\x20\x20'+a35_0x34fe77[_0x206a67(0x247)](_0x51b328));}}return 0x0;}const _0x5bd246=_0x549452['journeysOnly']?_0x56b611['length']+_0x1ea9d7['length']+_0x559c1f['length']+_0x41f4e0[_0x206a67(0x1ed)]:_0x2070a3[_0x206a67(0x1ed)]+_0x5529dc['length']+_0x5dbe99['length']+_0x56b611[_0x206a67(0x1ed)]+_0x1ea9d7[_0x206a67(0x1ed)]+_0x559c1f[_0x206a67(0x1ed)]+_0x41f4e0[_0x206a67(0x1ed)]+_0x3664a4[_0x206a67(0x1ed)];if(!_0x549452[_0x206a67(0x238)]&&_0x5bd246>0x0){if(!isInteractive())return console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x24b)]('\x0aError:'),_0x206a67(0x1e3)),console['error'](a35_0x34fe77[_0x206a67(0x206)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x32a385=await confirmKey(_0x206a67(0x21f)+_0x5bd246+'\x20changes?');if(!_0x32a385)return console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x25c)](_0x206a67(0x241))),0x1;}const _0x29a2c8={'withProgress':async(_0x2c8446,_0x50e290)=>{const _0x4242fa=_0x206a67,_0x4b79b3=await withSpinner(_0x2c8446,_0x50e290,{'verbose':_0x549452[_0x4242fa(0x245)]});return{'data':_0x4b79b3['data']};},'logInfo':_0x1d1db9=>console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x256)]('✔\x20'+_0x1d1db9)),'logSuccess':_0x37ab3f=>console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x249)]('✔\x20'+_0x37ab3f)),'logWarning':_0x3c9e37=>console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x25c)]('⚠\x20'+_0x3c9e37)),'logDeleted':_0x2518ee=>console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x24b)]('✔\x20'+_0x2518ee))},_0x2069b4={'segment':_0x35440d[_0x206a67(0x1ef)],'journey':_0x35440d[_0x206a67(0x1e0)],'user':_0x35440d[_0x206a67(0x21c)],'connection':_0x35440d['connection']};_0x41f4e0[_0x206a67(0x1ed)]>0x0&&(_0x33099b=await executePushFolders(_0x2069b4,_0x41f4e0,_0x33099b,{'parentId':_0x47c05a},_0x29a2c8));const _0x324f2b={'rootFolderId':_0x237ffb,'folderPathToId':_0x33099b,'folderIdToPath':_0x2f7c66,'segmentNameToId':_0x100f99,'activationsBySegmentId':_0x28d291,'emailToIdMap':_0x1e2513,'idToEmailMap':_0x357c80,'connectionNameToIdMap':_0x5a50fd[_0x206a67(0x26c)],'connectionIdToNameMap':_0x5a50fd[_0x206a67(0x204)],'connectionNameToTypeMap':_0x5ec7a1},_0x1ae5e5=await executePushSegments(_0x2069b4,_0x549452[_0x206a67(0x23d)]?[]:_0x57e375,_0x324f2b,{'parentId':_0x47c05a},_0x29a2c8),_0x559a2b=_0x1ae5e5[_0x206a67(0x268)],_0x30f22d=_0x1ae5e5['updated'],_0x720499=_0x1ae5e5[_0x206a67(0x261)][_0x206a67(0x268)],_0x2fa227=_0x1ae5e5['activations'][_0x206a67(0x22f)],_0xa5dc32=_0x1ae5e5[_0x206a67(0x261)]['deleted'];let _0x326992;if(_0x559370&&_0x57e375[_0x206a67(0x1ed)]===0x1){const _0x3af563=_0x57e375[0x0];_0x326992=_0x3af563[_0x206a67(0x22a)]?.['id']??_0x1ae5e5['createdSegmentIds'][_0x206a67(0x225)](_0x3af563[_0x206a67(0x269)]['name']);}const _0x4a7ae0=await executePushSegmentDeletions(_0x2069b4,_0x549452[_0x206a67(0x23d)]?[]:_0x5dbe99,_0x29a2c8);let _0x4da16f=0x0,_0x3e00d5=0x0,_0x360dc3=0x0;const _0x21d2d7=new Map(_0x100f99);for(const [_0x137c34,_0x1165a2]of _0x1ae5e5[_0x206a67(0x224)]){_0x21d2d7['set'](_0x137c34,_0x1165a2);}if(_0xbfe77a[_0x206a67(0x1ed)]>0x0){const _0x8de478={..._0x324f2b,'segmentNameToId':_0x21d2d7,'existingSegments':_0x420698,'activationContext':_0x4b5e26},_0x12ddfa=await executePushJourneys(_0x2069b4,_0xbfe77a,_0x8de478,{'parentId':_0x47c05a,'rootFolderId':_0x237ffb,'verbose':_0x549452[_0x206a67(0x245)]},_0x29a2c8);_0x4da16f=_0x12ddfa[_0x206a67(0x268)],_0x3e00d5=_0x12ddfa[_0x206a67(0x22f)];if(_0x559370&&_0x12ddfa[_0x206a67(0x1ea)][_0x206a67(0x1ed)]===0x1){const _0x1bddb9=_0x12ddfa[_0x206a67(0x1ea)][0x0];if(_0x1bddb9['journeyId']){const _0x48b467=getConsoleNextUrl(_0x549452[_0x206a67(0x26f)],'/app/ps/'+_0x47c05a+_0x206a67(0x270)+_0x1bddb9[_0x206a67(0x25e)]+_0x206a67(0x223));console['error']('\x20\x20'+a35_0x34fe77[_0x206a67(0x247)](_0x48b467));}}}for(const _0x5a06b0 of _0x559c1f){console[_0x206a67(0x26e)](a35_0x34fe77['yellow'](_0x206a67(0x254)+_0x5a06b0[_0x206a67(0x1e4)])),_0x360dc3++;}const _0x4c71d2=[];if(_0x559a2b>0x0)_0x4c71d2[_0x206a67(0x219)](_0x559a2b+_0x206a67(0x212));if(_0x30f22d>0x0)_0x4c71d2['push'](_0x30f22d+_0x206a67(0x1db));if(_0x4a7ae0>0x0)_0x4c71d2['push'](_0x4a7ae0+_0x206a67(0x20a));const _0x4096da=[];if(_0x4da16f>0x0)_0x4096da[_0x206a67(0x219)](_0x4da16f+_0x206a67(0x212));if(_0x3e00d5>0x0)_0x4096da['push'](_0x3e00d5+_0x206a67(0x1db));if(_0x360dc3>0x0)_0x4096da[_0x206a67(0x219)](_0x360dc3+_0x206a67(0x20a));const _0x41580a=[];if(_0x720499>0x0)_0x41580a[_0x206a67(0x219)](_0x720499+_0x206a67(0x212));if(_0x2fa227>0x0)_0x41580a['push'](_0x2fa227+_0x206a67(0x1db));if(_0xa5dc32>0x0)_0x41580a[_0x206a67(0x219)](_0xa5dc32+_0x206a67(0x20a));console[_0x206a67(0x26e)](a35_0x34fe77[_0x206a67(0x249)](_0x206a67(0x260)));_0x4c71d2[_0x206a67(0x1ed)]>0x0&&!_0x549452[_0x206a67(0x23d)]&&console[_0x206a67(0x26e)]('\x20\x20Segments:\x20'+_0x4c71d2[_0x206a67(0x22b)](',\x20'));_0x4096da[_0x206a67(0x1ed)]>0x0&&console['error'](_0x206a67(0x221)+_0x4096da[_0x206a67(0x22b)](',\x20'));_0x41580a[_0x206a67(0x1ed)]>0x0&&!_0x549452[_0x206a67(0x23d)]&&console[_0x206a67(0x26e)]('\x20\x20Activations:\x20'+_0x41580a[_0x206a67(0x22b)](',\x20'));if(_0x326992){const _0xfd5fe1=getConsoleNextUrl(_0x549452[_0x206a67(0x26f)],_0x206a67(0x243)+_0x47c05a+_0x206a67(0x270)+_0x326992+'/sb/da/esr');console[_0x206a67(0x26e)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a35_0x34fe77['cyan'](_0xfd5fe1));}return 0x0;}}
|
|
1
|
+
const a35_0x40a4b7=a35_0x50e2;function a35_0x50e2(_0x380bbf,_0x1b1a95){_0x380bbf=_0x380bbf-0x75;const _0x28fdea=a35_0x28fd();let _0x50e2e1=_0x28fdea[_0x380bbf];return _0x50e2e1;}(function(_0xc9fb2d,_0x153543){const _0x517eb4=a35_0x50e2,_0x2b310e=_0xc9fb2d();while(!![]){try{const _0x5e7eaa=parseInt(_0x517eb4(0xb6))/0x1+parseInt(_0x517eb4(0xcf))/0x2*(parseInt(_0x517eb4(0x75))/0x3)+-parseInt(_0x517eb4(0xe3))/0x4+parseInt(_0x517eb4(0x104))/0x5+-parseInt(_0x517eb4(0xf7))/0x6*(parseInt(_0x517eb4(0xcb))/0x7)+parseInt(_0x517eb4(0xbe))/0x8+-parseInt(_0x517eb4(0xf9))/0x9;if(_0x5e7eaa===_0x153543)break;else _0x2b310e['push'](_0x2b310e['shift']());}catch(_0x839a34){_0x2b310e['push'](_0x2b310e['shift']());}}}(a35_0x28fd,0x38735));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x9322fb from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0x40a4b7(0xde)]=a35_0x40a4b7(0xb5);['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x3d8a75){const _0x4b6a53=a35_0x40a4b7,{options:_0x565b27,args:_0x3612f2,tdx:_0x27090d}=_0x3d8a75,_0x47ec94=_0x565b27,_0x4c6922=await resolveTarget({'arg':_0x3612f2[0x0],'contextParent':_0x565b27[_0x4b6a53(0xd6)],'cwd':process[_0x4b6a53(0xeb)]()});if(!isSuccessfulResolution(_0x4c6922))return _0x4c6922[_0x4b6a53(0xf2)]===_0x4b6a53(0xc9)?(console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xca))),console['error'](_0x4b6a53(0x9e)),console[_0x4b6a53(0xbf)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x4b6a53(0xbf)](_0x4b6a53(0xaa))):(console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xa6)+_0x4c6922[_0x4b6a53(0xab)]+'\x0a')),_0x4c6922[_0x4b6a53(0xae)]&&console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0xe6)](_0x4c6922[_0x4b6a53(0xae)]))),0x1;if(_0x4c6922[_0x4b6a53(0xd8)]===_0x4b6a53(0xd9))return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4c6922[_0x4b6a53(0xa1)]+'\x0a')),console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0xe6)](_0x4b6a53(0xfa))),0x1;const _0x5185ba=_0x4c6922[_0x4b6a53(0xe9)],_0x25fb78=_0x4c6922[_0x4b6a53(0xa1)],_0x20991c=_0x4c6922['type']===_0x4b6a53(0xee)?_0x4c6922[_0x4b6a53(0x100)]:undefined,_0xb03f2b=getScopedDetails(_0x4c6922),_0x4e6063=_0xb03f2b?.[_0x4b6a53(0xd5)]??![],_0x3a847d=_0xb03f2b?.[_0x4b6a53(0xf8)]??'';if(!existsSync(_0x25fb78))return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xaf)+_0x25fb78+'\x0a')),console[_0x4b6a53(0xbf)](a35_0x9322fb['cyan'](_0x4b6a53(0xfa))),0x1;_0x47ec94[_0x4b6a53(0x98)]&&(console[_0x4b6a53(0xbf)](_0x4b6a53(0xe2)+_0x47ec94[_0x4b6a53(0x81)]),console[_0x4b6a53(0xbf)](_0x4b6a53(0xb0)+_0x5185ba),console[_0x4b6a53(0xbf)]('Source\x20directory:\x20'+_0x25fb78),_0x4e6063&&console[_0x4b6a53(0xbf)](_0x4b6a53(0xc3)+_0x3a847d));const _0x2a1b7a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5185ba+_0x4b6a53(0x93),()=>_0x27090d[_0x4b6a53(0xc6)][_0x4b6a53(0xac)](_0x5185ba),{'verbose':_0x47ec94['verbose']}),_0xa9efd6=_0x2a1b7a[_0x4b6a53(0x91)],{parentSegmentResult:_0x183aae,segmentsResult:_0x2897e1,foldersResult:_0x155405,journeysWithDetailsResult:_0x3bf855,userMaps:_0x21df76}=await withSpinner(_0x4b6a53(0xf3),async()=>{const _0x4361e0=_0x4b6a53,[_0x2537b1,_0x21f2b8,_0x1d06d8,_0x21f2cf,_0x203161]=await Promise[_0x4361e0(0xbd)]([_0x27090d[_0x4361e0(0xc6)][_0x4361e0(0x96)](_0xa9efd6),_0x27090d[_0x4361e0(0xc6)]['listSegments'](_0xa9efd6),_0x27090d[_0x4361e0(0xc6)][_0x4361e0(0xf0)](_0xa9efd6),_0x27090d[_0x4361e0(0xc7)][_0x4361e0(0xa8)](_0xa9efd6,{'includeAllVersions':!![]}),_0x27090d['user']['buildUserMaps']()]);return{'parentSegmentResult':_0x2537b1,'segmentsResult':_0x21f2b8,'foldersResult':_0x1d06d8,'journeysWithDetailsResult':_0x21f2cf,'userMaps':_0x203161};},{'verbose':_0x47ec94[_0x4b6a53(0x98)]})[_0x4b6a53(0xc8)](_0x11dd87=>_0x11dd87[_0x4b6a53(0x91)]),_0x1a4570=_0x183aae,_0x3eb23b=extractRootFolderId(_0x1a4570),_0x102cd5=_0x2897e1,_0x4c0187=_0x155405,{journeys:_0x1d9c31,activationStepsById:_0x3b2d39}=_0x3bf855,_0x5eff8a=new Map(_0x1d9c31[_0x4b6a53(0xdc)](_0x12b9ed=>[_0x12b9ed['id'],_0x12b9ed])),_0x5018a1=_0x1d9c31['map'](_0x435418=>({'id':_0x435418['id'],'name':_0x435418[_0x4b6a53(0x87)]['name'],'journeyBundleName':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0x95)]||'','journeyBundleId':_0x435418[_0x4b6a53(0x87)]['journeyBundleId']||'','versionNumber':_0x435418[_0x4b6a53(0x87)]['versionNumber'],'description':_0x435418[_0x4b6a53(0x87)]['description'],'state':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0x9d)],'paused':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0xc0)],'audienceId':_0x435418['attributes'][_0x4b6a53(0x79)],'folderId':_0x435418[_0x4b6a53(0xcc)]?.['parentFolder']?.[_0x4b6a53(0x91)]?.['id'],'createdAt':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0x94)],'updatedAt':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0xe1)]})),{emailToId:_0x59ea11,idToEmail:_0x3357ef}=_0x21df76,_0x354f56=await withSpinner(_0x4b6a53(0xf5),async()=>{const _0x2f5c40=_0x4b6a53,_0x1c46a6=await _0x27090d[_0x2f5c40(0x9b)][_0x2f5c40(0xdd)]();return buildConnectionMaps(_0x1c46a6);},{'verbose':_0x47ec94[_0x4b6a53(0x98)]})[_0x4b6a53(0xc8)](_0x21d4f2=>_0x21d4f2[_0x4b6a53(0x91)]),_0x47a44d=_0x354f56[_0x4b6a53(0xa3)],_0x351d8d=_0x354f56[_0x4b6a53(0x105)],_0x4289d3=_0x354f56[_0x4b6a53(0xbc)],_0x192463={'emailToIdMap':_0x59ea11,'connectionNameToIdMap':_0x47a44d,'connectionNameToTypeMap':_0x4289d3,'getSchema':_0xa6d587=>_0x27090d[_0x4b6a53(0x9b)]['getOutputSchemaWithCache'](_0xa6d587)};let {pathToId:_0x6cff36,idToPath:_0x3957af}=buildFolderMaps(_0x4c0187);const _0x3cba0c=buildSegmentLookupMap(_0x102cd5,_0x3957af),_0x2380f8=buildSegmentNameToIdMap(_0x102cd5),_0x2446bf=buildJourneyBundleLookupMap(_0x5018a1,_0x3957af);let _0x184634;if(_0x20991c){if(!_0x20991c[_0x4b6a53(0xa9)]('.yml')&&!_0x20991c[_0x4b6a53(0xa9)](_0x4b6a53(0x7d)))return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xfc)+_0x20991c+'\x0a')),0x1;_0x184634=[_0x20991c];}else _0x184634=findYamlFiles(_0x25fb78);if(_0x184634[_0x4b6a53(0x84)]===0x0)return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xdb)+_0x25fb78+'\x0a')),console['error'](a35_0x9322fb['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x55376c,_0x31c0c4;try{const _0x3c6507=parseAndClassifyYamlFiles(_0x184634,_0x25fb78,{'skipSegments':_0x47ec94[_0x4b6a53(0xec)]});_0x55376c=_0x3c6507[_0x4b6a53(0xa7)],_0x31c0c4=_0x3c6507[_0x4b6a53(0x86)];const _0x1bd9ab=validateParsedFiles(_0x3c6507,_0x25fb78);if(_0x1bd9ab[_0x4b6a53(0x84)]>0x0)return console['error'](a35_0x9322fb[_0x4b6a53(0x77)]('\x0aValidation\x20failed:')),console[_0x4b6a53(0xbf)](formatValidationErrors(_0x1bd9ab)),console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xf4))),0x1;}catch(_0x270a5e){return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xd7)+(_0x270a5e instanceof Error?_0x270a5e['message']:_0x270a5e))),0x1;}if(_0x55376c[_0x4b6a53(0x84)]===0x0&&_0x31c0c4['length']===0x0){const _0x327e2b=_0x47ec94[_0x4b6a53(0xec)]?_0x4b6a53(0xc7):_0x4b6a53(0xb9);return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xa0)+_0x327e2b+_0x4b6a53(0x8a))),0x0;}const _0xe5ae74=new Map();_0x102cd5[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&await withSpinner(_0x4b6a53(0x80),async()=>{await batchAsync(_0x102cd5,async _0x3a8fec=>{const _0x14c002=a35_0x50e2,_0x501904=await _0x27090d['segment'][_0x14c002(0xe5)](_0xa9efd6,_0x3a8fec['id']);_0xe5ae74['set'](_0x3a8fec['id'],_0x501904);});},{'verbose':_0x47ec94['verbose']});const {segmentFiles:_0x960be4,foldersToCreate:_0x556398}=await prepareSegmentFiles(_0x55376c,{'segmentByFolderAndName':_0x3cba0c,'activationsBySegmentId':_0xe5ae74,'folderPathToId':_0x6cff36,'idToEmailMap':_0x3357ef,'connectionIdToNameMap':_0x351d8d},_0x192463,_0x4e6063,_0x3a847d),_0x3cc7a1=_0x20991c?[]:findSegmentsToDelete(_0x102cd5,_0x55376c['map'](({yamlConfig:_0x121170,folderPath:_0x593496})=>({'yamlConfig':_0x121170,'folderPath':resolveTDFolderPath(_0x593496,_0x4e6063,_0x3a847d)})),_0x3957af,_0x3a847d,_0x4e6063),{journeyFiles:_0x3767db,foldersToCreate:_0x4854c7}=await withProgressSpinner('Preparing\x20journeys...',async _0x3e2236=>prepareJourneyFiles(_0x31c0c4,{'fetchJourney':async _0x529094=>_0x27090d[_0x4b6a53(0xc7)]['getJourney'](_0x529094['journeyId']),'journeyBundlesByFolderAndName':_0x2446bf,'folderPathToId':_0x6cff36,'idToEmailMap':_0x3357ef,'connectionIdToNameMap':_0x351d8d,'existingSegments':_0x102cd5,'parentId':_0xa9efd6,'deps':_0x27090d,'progress':{'update':_0x1b81cc=>{const _0x1097b6=_0x4b6a53;_0x3e2236[_0x1097b6(0x88)](_0x1b81cc),_0x47ec94[_0x1097b6(0x98)]&&console[_0x1097b6(0xbf)]('\x20\x20'+_0x1b81cc);}},'journeyById':_0x5eff8a,'activationStepsById':_0x3b2d39},_0x4e6063,_0x3a847d),{'verbose':_0x47ec94[_0x4b6a53(0x98)]})['then'](_0x574e4c=>_0x574e4c[_0x4b6a53(0x91)]);for(const _0x5eb079 of _0x4854c7){_0x556398[_0x4b6a53(0xe0)](_0x5eb079);}const _0x59aada=_0x20991c?[]:findJourneysToDelete(_0x5018a1,_0x31c0c4['map'](({yamlConfig:_0x1f1b1d,folderPath:_0x3683cc})=>({'yamlConfig':_0x1f1b1d,'folderPath':resolveTDFolderPath(_0x3683cc,_0x4e6063,_0x3a847d)})),_0x3957af,_0x3a847d,_0x4e6063),_0x6493ce=calculatePushStats(_0x960be4,_0x3767db,_0x556398,_0x3cc7a1,_0x59aada,!!_0x47ec94[_0x4b6a53(0xd2)],!!_0x47ec94[_0x4b6a53(0xec)]),_0x2502e9=_0x6493ce[_0x4b6a53(0xa7)]['new'],_0x355cb4=_0x6493ce['segments']['changed'],_0x51e347=_0x6493ce[_0x4b6a53(0xa7)]['unchanged'],_0x4ddc06=_0x6493ce['segments']['toDelete'],_0x382a59=_0x6493ce['folders']['toCreate'],_0x491c08=_0x6493ce[_0x4b6a53(0x86)]['new'],_0x4190b8=_0x6493ce['journeys']['changed'],_0x2a8e16=_0x6493ce[_0x4b6a53(0x86)]['unchanged'],_0x7c2e8e=_0x6493ce[_0x4b6a53(0x86)]['toDelete'],_0x288a94=_0x6493ce[_0x4b6a53(0xed)][_0x4b6a53(0xbd)],_0x4fdacf=_0x6493ce['activations'][_0x4b6a53(0x90)],_0x7b8a38=_0x6493ce[_0x4b6a53(0xed)][_0x4b6a53(0xce)],_0x50309=_0x6493ce['activations']['toDelete'];console[_0x4b6a53(0xbf)](_0x4b6a53(0xa5)+_0x5185ba+'\x27:');_0x382a59[_0x4b6a53(0x84)]>0x0&&console['error']('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xa4)](_0x4b6a53(0xad)+_0x382a59[_0x4b6a53(0x84)]+'\x20folders\x20to\x20create'));if(!_0x47ec94['journeysOnly']){console[_0x4b6a53(0xbf)]('\x20\x20📊\x20Segments:'),console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb['green']('+\x20'+_0x2502e9['length']+_0x4b6a53(0xb3))),console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x8b)]('~\x20'+_0x355cb4[_0x4b6a53(0x84)]+_0x4b6a53(0xf1)));if(_0x4ddc06[_0x4b6a53(0x84)]>0x0)console[_0x4b6a53(0xbf)]('\x20\x20\x20\x20'+a35_0x9322fb[_0x4b6a53(0x77)]('-\x20'+_0x4ddc06[_0x4b6a53(0x84)]+_0x4b6a53(0xea)));else _0x3cc7a1['length']>0x0&&!_0x47ec94[_0x4b6a53(0xd2)]&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0xc4)](_0x3cc7a1['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb['dim']('=\x20'+_0x51e347[_0x4b6a53(0x84)]+'\x20unchanged'));}if(_0x3767db[_0x4b6a53(0x84)]>0x0||_0x59aada[_0x4b6a53(0x84)]>0x0){console[_0x4b6a53(0xbf)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x99)]('+\x20'+_0x491c08[_0x4b6a53(0x84)]+_0x4b6a53(0xb3))),console['error'](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x8b)]('~\x20'+_0x4190b8[_0x4b6a53(0x84)]+'\x20changed'));if(_0x7c2e8e['length']>0x0)console[_0x4b6a53(0xbf)]('\x20\x20\x20\x20'+a35_0x9322fb['red']('-\x20'+_0x7c2e8e[_0x4b6a53(0x84)]+_0x4b6a53(0xea)));else _0x59aada['length']>0x0&&!_0x47ec94[_0x4b6a53(0xd2)]&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb['dim'](_0x59aada[_0x4b6a53(0x84)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0xc4)]('=\x20'+_0x2a8e16['length']+_0x4b6a53(0x7c)));}_0x288a94[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&(console[_0x4b6a53(0xbf)](''),console['error'](_0x4b6a53(0x9c)),_0x4fdacf[_0x4b6a53(0x84)]>0x0&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x99)]('+\x20'+_0x4fdacf[_0x4b6a53(0x84)]+_0x4b6a53(0x7a))),_0x7b8a38['length']>0x0&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x8b)]('~\x20'+_0x7b8a38['length']+_0x4b6a53(0xb4))),_0x50309[_0x4b6a53(0x84)]>0x0&&console['error']('\x20\x20\x20\x20'+a35_0x9322fb[_0x4b6a53(0x77)]('-\x20'+_0x50309['length']+_0x4b6a53(0xea))));console[_0x4b6a53(0xbf)](_0x4b6a53(0xb1)+a35_0x9322fb['cyan'](_0x25fb78)+'\x0a');if(_0x382a59['length']>0x0){console[_0x4b6a53(0xbf)](_0x4b6a53(0xba));for(const _0x252cc0 of _0x382a59){console[_0x4b6a53(0xbf)]('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xa4)]('+')+'\x20'+_0x252cc0);}console[_0x4b6a53(0xbf)]('');}if(_0x2502e9[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)])for(const _0x29769d of _0x2502e9){const _0x393c6a=_0x29769d[_0x4b6a53(0x103)]?_0x29769d['folderPath']+'/'+_0x29769d['yamlConfig']['name']:_0x29769d[_0x4b6a53(0x8e)][_0x4b6a53(0xde)],_0x3c2b7c=_0x29769d[_0x4b6a53(0x8e)]['activations']?.[_0x4b6a53(0x84)]||0x0,_0x9a7925=_0x3c2b7c>0x0?a35_0x9322fb['dim']('\x20['+_0x3c2b7c+_0x4b6a53(0xfe)):'';console[_0x4b6a53(0xbf)]('\x0a'+a35_0x9322fb[_0x4b6a53(0x99)](_0x4b6a53(0xe7))+'\x20'+_0x393c6a+_0x9a7925),console['error']('─'[_0x4b6a53(0xd0)](0x3c)),_0x29769d[_0x4b6a53(0x85)]&&console[_0x4b6a53(0xbf)](_0x29769d[_0x4b6a53(0x85)]),console['error']('─'[_0x4b6a53(0xd0)](0x3c));}if(_0x4ddc06['length']>0x0&&!_0x47ec94['journeysOnly'])for(const _0x4405d4 of _0x4ddc06){const _0x5b296e=_0x4405d4['segmentFolderId']?_0x3957af[_0x4b6a53(0x76)](_0x4405d4[_0x4b6a53(0x9f)]['toString']())||'':'',_0x26e557=_0x5b296e?_0x5b296e+'/'+_0x4405d4[_0x4b6a53(0xde)]:_0x4405d4[_0x4b6a53(0xde)],_0x8633a0=_0xe5ae74[_0x4b6a53(0x76)](_0x4405d4['id'])||[],_0x5df35e=_0x8633a0[_0x4b6a53(0x84)]>0x0?a35_0x9322fb[_0x4b6a53(0xc4)]('\x20['+_0x8633a0['length']+_0x4b6a53(0xfe)):'';console[_0x4b6a53(0xbf)]('\x0a'+a35_0x9322fb['red'](_0x4b6a53(0xc1))+'\x20'+_0x26e557+_0x5df35e),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c));const _0x5d9728=segmentWithActivationsToYaml(_0x4405d4,_0x8633a0,undefined,_0x3357ef,_0x351d8d),_0x9fd1d6=segmentToYamlString(_0x5d9728),_0x18c558=generateDiff(_0x9fd1d6,'');console[_0x4b6a53(0xbf)](formatDiffWithColors(_0x18c558)),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c));}const _0x552efc=_0x960be4['filter'](_0x4160a8=>!_0x4160a8[_0x4b6a53(0x83)]&&_0x4160a8[_0x4b6a53(0x85)]);if(_0x552efc[_0x4b6a53(0x84)]>0x0&&!_0x47ec94['journeysOnly'])for(const _0x456309 of _0x552efc){const _0x3e7182=_0x456309[_0x4b6a53(0x103)]?_0x456309[_0x4b6a53(0x103)]+'/'+_0x456309[_0x4b6a53(0x8e)][_0x4b6a53(0xde)]:_0x456309[_0x4b6a53(0x8e)][_0x4b6a53(0xde)];console['error']('\x0a'+a35_0x9322fb['yellow'](_0x4b6a53(0xb8))+'\x20'+_0x3e7182),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c)),console[_0x4b6a53(0xbf)](_0x456309[_0x4b6a53(0x85)]),console['error']('─'['repeat'](0x3c));}if(_0x491c08['length']>0x0)for(const _0x40c32c of _0x491c08){const _0x1df0b4=_0x40c32c[_0x4b6a53(0x103)]?_0x40c32c['folderPath']+'/'+_0x40c32c[_0x4b6a53(0x8e)][_0x4b6a53(0xde)]:_0x40c32c['yamlConfig'][_0x4b6a53(0xde)];console['error']('\x0a'+a35_0x9322fb['green'](_0x4b6a53(0x8c))+'\x20'+_0x1df0b4),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c)),_0x40c32c['diff']&&console['error'](_0x40c32c[_0x4b6a53(0x85)]),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c));}const _0x2013c7=_0x3767db[_0x4b6a53(0x8d)](_0x4b85b3=>!_0x4b85b3[_0x4b6a53(0x83)]&&_0x4b85b3['diff']);if(_0x2013c7[_0x4b6a53(0x84)]>0x0)for(const _0x5bcb0a of _0x2013c7){const _0x1c5a8e=_0x5bcb0a[_0x4b6a53(0x103)]?_0x5bcb0a[_0x4b6a53(0x103)]+'/'+_0x5bcb0a[_0x4b6a53(0x8e)]['name']:_0x5bcb0a['yamlConfig'][_0x4b6a53(0xde)];console['error']('\x0a'+a35_0x9322fb[_0x4b6a53(0x8b)]('Changes\x20to\x20journey:')+'\x20'+_0x1c5a8e),console['error']('─'[_0x4b6a53(0xd0)](0x3c)),console['error'](_0x5bcb0a['diff']),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c));}if(_0x7c2e8e[_0x4b6a53(0x84)]>0x0)for(const _0x119520 of _0x7c2e8e){const _0x28a2dd=_0x119520[_0x4b6a53(0xc5)]?_0x3957af[_0x4b6a53(0x76)](_0x119520['folderId'])||'':'',_0x3f6604=_0x28a2dd?_0x28a2dd+'/'+_0x119520['journeyBundleName']:_0x119520[_0x4b6a53(0x95)];console[_0x4b6a53(0xbf)]('\x0a'+a35_0x9322fb['red'](_0x4b6a53(0xff))+'\x20'+_0x3f6604),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c)),console[_0x4b6a53(0xbf)](a35_0x9322fb['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c));}if(_0x47ec94[_0x4b6a53(0xd4)])return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x587f4a=_0x47ec94['journeysOnly']?![]:_0x2502e9[_0x4b6a53(0x84)]>0x0||_0x355cb4[_0x4b6a53(0x84)]>0x0||_0x4ddc06[_0x4b6a53(0x84)]>0x0,_0x23d002=_0x491c08[_0x4b6a53(0x84)]>0x0||_0x4190b8[_0x4b6a53(0x84)]>0x0||_0x7c2e8e[_0x4b6a53(0x84)]>0x0,_0x362255=_0x47ec94[_0x4b6a53(0xec)]?![]:_0x288a94[_0x4b6a53(0x84)]>0x0,_0x4486ec=_0x382a59[_0x4b6a53(0x84)]>0x0;if(!_0x587f4a&&!_0x23d002&&!_0x362255&&!_0x4486ec){const _0x1b1925=_0x47ec94[_0x4b6a53(0xec)]?_0x4b6a53(0x7b):_0x4b6a53(0x78);console['error'](a35_0x9322fb['green'](_0x1b1925));if(_0x20991c&&_0x51e347[_0x4b6a53(0x84)]===0x1){const _0x167d5d=_0x51e347[0x0];if(_0x167d5d[_0x4b6a53(0x97)]?.['id']){const _0x5f167e=getConsoleNextUrl(_0x47ec94[_0x4b6a53(0x81)],_0x4b6a53(0xda)+_0xa9efd6+_0x4b6a53(0xf6)+_0x167d5d[_0x4b6a53(0x97)]['id']+_0x4b6a53(0xd1));console['error'](_0x4b6a53(0x92)+a35_0x9322fb['cyan'](_0x5f167e));}}if(_0x20991c&&_0x2a8e16[_0x4b6a53(0x84)]===0x1){const _0x10806b=_0x2a8e16[0x0];if(_0x10806b[_0x4b6a53(0xfd)]?.['id']){const _0x982544=getConsoleNextUrl(_0x47ec94[_0x4b6a53(0x81)],_0x4b6a53(0xda)+_0xa9efd6+_0x4b6a53(0xf6)+_0x10806b[_0x4b6a53(0xfd)]['id']+_0x4b6a53(0xe8));console[_0x4b6a53(0xbf)]('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xe6)](_0x982544));}}return 0x0;}const _0x102bb1=_0x47ec94[_0x4b6a53(0xec)]?_0x491c08[_0x4b6a53(0x84)]+_0x4190b8[_0x4b6a53(0x84)]+_0x7c2e8e[_0x4b6a53(0x84)]+_0x382a59[_0x4b6a53(0x84)]:_0x2502e9['length']+_0x355cb4[_0x4b6a53(0x84)]+_0x4ddc06[_0x4b6a53(0x84)]+_0x491c08[_0x4b6a53(0x84)]+_0x4190b8['length']+_0x7c2e8e[_0x4b6a53(0x84)]+_0x382a59[_0x4b6a53(0x84)]+_0x288a94['length'];if(!_0x47ec94[_0x4b6a53(0x7e)]&&_0x102bb1>0x0){if(!isInteractive())return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0x89)),_0x4b6a53(0xa2)),console['error'](a35_0x9322fb[_0x4b6a53(0xc4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4efd5c=await confirmKey(_0x4b6a53(0xbb)+_0x102bb1+_0x4b6a53(0x8f));if(!_0x4efd5c)return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xdf))),0x1;}const _0x1df97d={'withProgress':async(_0x181f33,_0x4d8cd6)=>{const _0x5521b5=_0x4b6a53,_0x5c341f=await withSpinner(_0x181f33,_0x4d8cd6,{'verbose':_0x47ec94[_0x5521b5(0x98)]});return{'data':_0x5c341f[_0x5521b5(0x91)]};},'logInfo':_0x53b6be=>console['error'](a35_0x9322fb['blue']('✔\x20'+_0x53b6be)),'logSuccess':_0x2f7fff=>console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x99)]('✔\x20'+_0x2f7fff)),'logWarning':_0x4c54fb=>console['error'](a35_0x9322fb[_0x4b6a53(0x8b)]('⚠\x20'+_0x4c54fb)),'logDeleted':_0x31d134=>console['error'](a35_0x9322fb[_0x4b6a53(0x77)]('✔\x20'+_0x31d134))},_0x3e17c6={'segment':_0x27090d[_0x4b6a53(0xc6)],'journey':_0x27090d[_0x4b6a53(0xc7)],'user':_0x27090d[_0x4b6a53(0x9a)],'connection':_0x27090d[_0x4b6a53(0x9b)]};_0x382a59[_0x4b6a53(0x84)]>0x0&&(_0x6cff36=await executePushFolders(_0x3e17c6,_0x382a59,_0x6cff36,{'parentId':_0xa9efd6},_0x1df97d));const _0x30fd0b={'rootFolderId':_0x3eb23b,'folderPathToId':_0x6cff36,'folderIdToPath':_0x3957af,'segmentNameToId':_0x2380f8,'activationsBySegmentId':_0xe5ae74,'emailToIdMap':_0x59ea11,'idToEmailMap':_0x3357ef,'connectionNameToIdMap':_0x354f56[_0x4b6a53(0xa3)],'connectionIdToNameMap':_0x354f56[_0x4b6a53(0x105)],'connectionNameToTypeMap':_0x4289d3},_0x461475=await executePushSegments(_0x3e17c6,_0x47ec94[_0x4b6a53(0xec)]?[]:_0x960be4,_0x30fd0b,{'parentId':_0xa9efd6},_0x1df97d),_0x39b45b=_0x461475[_0x4b6a53(0xc2)],_0x3500bb=_0x461475[_0x4b6a53(0xfb)],_0x4b9696=_0x461475[_0x4b6a53(0xed)][_0x4b6a53(0xc2)],_0x195449=_0x461475[_0x4b6a53(0xed)][_0x4b6a53(0xfb)],_0x225d40=_0x461475['activations']['deleted'];let _0x41e145;if(_0x20991c&&_0x960be4[_0x4b6a53(0x84)]===0x1){const _0x25ab05=_0x960be4[0x0];_0x41e145=_0x25ab05[_0x4b6a53(0x97)]?.['id']??_0x461475['createdSegmentIds'][_0x4b6a53(0x76)](_0x25ab05[_0x4b6a53(0x8e)][_0x4b6a53(0xde)]);}const _0x20bec7=await executePushSegmentDeletions(_0x3e17c6,_0x47ec94[_0x4b6a53(0xec)]?[]:_0x4ddc06,_0x1df97d);let _0x483658=0x0,_0x401dc6=0x0,_0x44d1c9=0x0;const _0x984091=new Map(_0x2380f8);for(const [_0x554439,_0x38b3aa]of _0x461475['createdSegmentIds']){_0x984091[_0x4b6a53(0xd3)](_0x554439,_0x38b3aa);}if(_0x3767db[_0x4b6a53(0x84)]>0x0){const _0x52efb3={..._0x30fd0b,'segmentNameToId':_0x984091,'existingSegments':_0x102cd5,'activationContext':_0x192463},_0x42789e=await executePushJourneys(_0x3e17c6,_0x3767db,_0x52efb3,{'parentId':_0xa9efd6,'rootFolderId':_0x3eb23b,'verbose':_0x47ec94['verbose']},_0x1df97d);_0x483658=_0x42789e['created'],_0x401dc6=_0x42789e[_0x4b6a53(0xfb)];if(_0x20991c&&_0x42789e[_0x4b6a53(0x101)][_0x4b6a53(0x84)]===0x1){const _0x5d5341=_0x42789e[_0x4b6a53(0x101)][0x0];if(_0x5d5341[_0x4b6a53(0xef)]){const _0x37cb5b=getConsoleNextUrl(_0x47ec94['site'],_0x4b6a53(0xda)+_0xa9efd6+'/e/'+_0x5d5341[_0x4b6a53(0xef)]+'/j/da/je');console[_0x4b6a53(0xbf)]('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xe6)](_0x37cb5b));}}}for(const _0x3ead10 of _0x7c2e8e){console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3ead10['journeyBundleName'])),_0x44d1c9++;}const _0x4ba9f3=[];if(_0x39b45b>0x0)_0x4ba9f3['push'](_0x39b45b+_0x4b6a53(0xb2));if(_0x3500bb>0x0)_0x4ba9f3['push'](_0x3500bb+'\x20updated');if(_0x20bec7>0x0)_0x4ba9f3[_0x4b6a53(0x7f)](_0x20bec7+_0x4b6a53(0xcd));const _0x4c5137=[];if(_0x483658>0x0)_0x4c5137[_0x4b6a53(0x7f)](_0x483658+'\x20created');if(_0x401dc6>0x0)_0x4c5137[_0x4b6a53(0x7f)](_0x401dc6+'\x20updated');if(_0x44d1c9>0x0)_0x4c5137['push'](_0x44d1c9+_0x4b6a53(0xcd));const _0x367ef7=[];if(_0x4b9696>0x0)_0x367ef7[_0x4b6a53(0x7f)](_0x4b9696+_0x4b6a53(0xb2));if(_0x195449>0x0)_0x367ef7['push'](_0x195449+'\x20updated');if(_0x225d40>0x0)_0x367ef7['push'](_0x225d40+_0x4b6a53(0xcd));console[_0x4b6a53(0xbf)](a35_0x9322fb['green'](_0x4b6a53(0xb7)));_0x4ba9f3[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&console[_0x4b6a53(0xbf)]('\x20\x20Segments:\x20'+_0x4ba9f3[_0x4b6a53(0xe4)](',\x20'));_0x4c5137['length']>0x0&&console[_0x4b6a53(0xbf)]('\x20\x20Journeys:\x20'+_0x4c5137['join'](',\x20'));_0x367ef7[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&console['error'](_0x4b6a53(0x102)+_0x367ef7['join'](',\x20'));if(_0x41e145){const _0xa0dcdf=getConsoleNextUrl(_0x47ec94[_0x4b6a53(0x81)],_0x4b6a53(0xda)+_0xa9efd6+'/e/'+_0x41e145+'/sb/da/esr');console[_0x4b6a53(0xbf)](_0x4b6a53(0x92)+a35_0x9322fb[_0x4b6a53(0xe6)](_0xa0dcdf));}return 0x0;}}function a35_0x28fd(){const _0x5b2110=['/sb/da/esr','delete','set','dryRun','isScoped','parentSegment','Error\x20parsing\x20YAML:\x20','type','parent_name','/app/ps/','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','map','list','name','Aborted.','add','updatedAt','Site:\x20','782976GHuCsf','join','listActivations','cyan','New\x20segment:','/j/da/je','parentName','\x20to\x20delete','cwd','journeysOnly','activations','file','journeyId','listFolders','\x20changed','errorCode','Fetching\x20existing\x20data...','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Fetching\x20connections\x20for\x20name\x20resolution...','/e/','102126RWoogo','scopedFolderPath','4026861LWfiLe','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','updated','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','existingJourney','\x20activations]','Delete\x20journey:','filePath','results','\x20\x20Activations:\x20','folderPath','2121255wmbNMk','idToName','1071834IeuiHz','get','red','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','audienceId','\x20to\x20create','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20unchanged','.yaml','yes','push','Fetching\x20existing\x20activations...','site','\x20\x20\x20\x20','isNew','length','diff','journeys','attributes','setPhase','\x0aError:','\x20YAML\x20files\x20found','yellow','New\x20journey:','filter','yamlConfig','\x20changes?','toCreate','data','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x27...','createdAt','journeyBundleName','getParent','existingSegment','verbose','green','user','connection','\x20\x20Activations:','state','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)','segmentFolderId','No\x20','targetDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','nameToId','blue','\x0aPush\x20summary\x20for\x20\x27','Error:\x20','segments','listJourneysWithDetailsFromParentSegment','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','message','resolveParentId','📁\x20','helpText','Error:\x20Directory\x20not\x20found:\x20','Parent\x20segment:\x20','\x20\x20Source:\x20','\x20created','\x20new','\x20to\x20update','segment:push','9134uoIkCo','\x0a✔\x20Push\x20complete','Changes\x20to:','segment\x20or\x20journey','Folders\x20to\x20create:','Push\x20','nameToType','all','2984704cuJvGB','error','paused','Delete\x20segment:','created','Scoped\x20to\x20folder:\x20','dim','folderId','segment','journey','then','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','119yiwqGh','relationships','\x20deleted','toUpdate','2InaJko','repeat'];a35_0x28fd=function(){return _0x5b2110;};return a35_0x28fd();}
|