@treasuredata/tdx 0.11.0 → 0.12.1
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 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.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/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +39 -5
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.d.ts +2 -4
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +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.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +2 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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.d.ts +45 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +1 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +8 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.d.ts +80 -0
- package/dist/sdk/workflow/clone-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/clone-workflow.js +1 -0
- package/dist/sdk/workflow/clone-workflow.js.map +1 -0
- package/dist/sdk/workflow/index.d.ts +94 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.d.ts +77 -0
- package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/pull-workflow.js +1 -0
- package/dist/sdk/workflow/pull-workflow.js.map +1 -0
- package/dist/sdk/workflow/push-workflow.d.ts +66 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/push-workflow.js +1 -0
- package/dist/sdk/workflow/push-workflow.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.d.ts +110 -0
- package/dist/sdk/workflow/tdx-config.d.ts.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -0
- package/dist/sdk/workflow/tdx-config.js.map +1 -0
- package/dist/sdk/workflow/workflow-utils.d.ts +10 -7
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.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
|
|
1
|
+
const a24_0x3d7fdb=a24_0x35d6;(function(_0x58eff0,_0x5a4f97){const _0x5a5703=a24_0x35d6,_0x46fda4=_0x58eff0();while(!![]){try{const _0x98dc1c=-parseInt(_0x5a5703(0x101))/0x1+parseInt(_0x5a5703(0xee))/0x2+-parseInt(_0x5a5703(0x10b))/0x3+-parseInt(_0x5a5703(0x110))/0x4*(-parseInt(_0x5a5703(0xe8))/0x5)+parseInt(_0x5a5703(0x106))/0x6*(-parseInt(_0x5a5703(0xe2))/0x7)+parseInt(_0x5a5703(0x104))/0x8*(parseInt(_0x5a5703(0xf2))/0x9)+parseInt(_0x5a5703(0x10d))/0xa*(-parseInt(_0x5a5703(0xdd))/0xb);if(_0x98dc1c===_0x5a4f97)break;else _0x46fda4['push'](_0x46fda4['shift']());}catch(_0x101864){_0x46fda4['push'](_0x46fda4['shift']());}}}(a24_0x7d0e,0x7ccf4));import{BaseCommand}from'./command.js';function a24_0x35d6(_0x5552eb,_0x4365af){_0x5552eb=_0x5552eb-0xdc;const _0x7d0e03=a24_0x7d0e();let _0x35d653=_0x7d0e03[_0x5552eb];return _0x35d653;}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';function a24_0x7d0e(){const _0x1dd7d4=['message','36BxOODM','setJobId','jobId','setPhase','validate','Run\x20Trino\x20queries\x20(streaming)','Schema:\x20','Statement\x20','verbose','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','file','Catalog:\x20','Executing\x20query\x20[','output','...','237210fQkOkf','\x20rows\x20','stats','971728EWmqJF','args','53286EWIJVL','processedRows','setExtra','No\x20SQL\x20provided','query','170586xDLKQb','\x20-\x20','167760kErloq','execute','Site:\x20','4FWwiPV','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','options','341sqgnGn','originalMessage','length','database','description','91yDMCCw','Executing\x20statement\x20','in\x20','Query\x20completed:\x20Processed\x20','error','\x20splits','717845HTGvDv','completedSplits','Executing\x20query...','\x20[Job\x20ID:\x20','data','Error:\x20','1622736BJUbuP','name','state'];a24_0x7d0e=function(){return _0x1dd7d4;};return a24_0x7d0e();}import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a24_0x3d7fdb(0xef)]=a24_0x3d7fdb(0x10a);[a24_0x3d7fdb(0xe1)]=a24_0x3d7fdb(0xf7);async[a24_0x3d7fdb(0x10e)](_0x49d24f){const _0x39fdf1=a24_0x3d7fdb,{options:_0x13a966,args:_0x57c7b9,tdx:_0x143acf}=_0x49d24f,_0xd20ac8=_0x57c7b9[0x0],_0x1cc0a9=_0x13a966[_0x39fdf1(0xfc)];let _0x24eec8;try{if(_0x1cc0a9)_0x24eec8=readSqlStatementsFromFile(_0x1cc0a9);else{if(_0xd20ac8==='-')_0x24eec8=await readSqlStatementsFromStdin();else{if(_0xd20ac8&&isSqlFilePath(_0xd20ac8))_0x24eec8=readSqlStatementsFromFile(_0xd20ac8);else{if(_0xd20ac8)_0x24eec8=splitSqlStatements(_0xd20ac8);else throw new Error(_0x39fdf1(0x109));}}}}catch(_0x144c14){return console[_0x39fdf1(0xe6)](_0x39fdf1(0xed)+_0x144c14[_0x39fdf1(0xf1)]),0x1;}const _0x556d96=_0x13a966[_0x39fdf1(0xe0)]||'information_schema',_0x111c95=_0x13a966['catalog'];try{const _0x278140=[],_0x3d9d24=!!_0x13a966[_0x39fdf1(0xff)];for(let _0x158f45=0x0;_0x158f45<_0x24eec8[_0x39fdf1(0xdf)];_0x158f45++){const _0x4be512=_0x24eec8[_0x158f45],_0x43e3c5=_0x158f45+0x1,_0x369015=_0x24eec8['length'],_0x22a97f=_0x369015>0x1;_0x13a966['verbose']&&(console[_0x39fdf1(0xe6)]('\x0a'+(_0x22a97f?_0x39fdf1(0xf9)+_0x43e3c5+'/'+_0x369015+':':'')),console[_0x39fdf1(0xe6)](_0x39fdf1(0x10f)+_0x13a966['site']),console[_0x39fdf1(0xe6)](_0x39fdf1(0xfd)+(_0x111c95||'td')),console['error'](_0x39fdf1(0xf8)+_0x556d96),console[_0x39fdf1(0xe6)]('SQL:\x20'+_0x4be512));const _0x57bbd1=_0x22a97f?_0x39fdf1(0xe3)+_0x43e3c5+'/'+_0x369015+_0x39fdf1(0x100):_0x39fdf1(0xea);try{const _0x2ecdc1=await withProgressSpinner(_0x57bbd1,async _0x54b935=>{const _0x333c91=_0x39fdf1,_0xfd2511=await _0x143acf['query'][_0x333c91(0x10e)](_0x4be512,{'catalog':_0x111c95,'schema':_0x556d96,'onJobId':_0x45f073=>{const _0x270bb4=_0x333c91;_0x54b935[_0x270bb4(0xf3)](_0x45f073);},'onProgress':_0x58cbf5=>{const _0x1f5c77=_0x333c91;_0x54b935[_0x1f5c77(0xf5)](_0x1f5c77(0xfe)+_0x58cbf5[_0x1f5c77(0xf0)]+']'),_0x54b935[_0x1f5c77(0x108)](formatRows(_0x58cbf5[_0x1f5c77(0x107)])+_0x1f5c77(0x102)+_0x58cbf5[_0x1f5c77(0xe9)]+'/'+_0x58cbf5['totalSplits']+_0x1f5c77(0xe7));}});return _0xfd2511;},{'verbose':_0x13a966[_0x39fdf1(0xfa)]}),_0x1cdeac=_0x2ecdc1[_0x39fdf1(0xec)],_0x3a8098=_0x1cdeac[_0x39fdf1(0xf4)]?_0x39fdf1(0xeb)+_0x1cdeac[_0x39fdf1(0xf4)]+']':'',_0x3b2dd0=_0x22a97f?_0x39fdf1(0xf9)+_0x43e3c5+'/'+_0x369015+_0x39fdf1(0x10c):'';console[_0x39fdf1(0xe6)]('✔\x20'+_0x3b2dd0+_0x39fdf1(0xe5)+formatRows(_0x1cdeac[_0x39fdf1(0x103)][_0x39fdf1(0x107)])+_0x39fdf1(0x102)+(_0x39fdf1(0xe4)+formatElapsed(_0x1cdeac['stats']['elapsedTimeMillis'])+_0x3a8098));if(_0x22a97f&&_0x3d9d24){const _0x28a3a6=resolveOutputOptions(_0x13a966),_0x2d02ff=await formatQueryOutput(_0x1cdeac,_0x28a3a6);_0x278140['push'](_0x2d02ff);}else await handleQueryOutput(_0x1cdeac,_0x13a966);}catch(_0x11c18c){const _0x9c7738=_0x22a97f?_0x39fdf1(0xf9)+_0x43e3c5+'/'+_0x369015+':\x0a':'',_0x933600=_0x11c18c instanceof SDKError?_0x11c18c[_0x39fdf1(0xde)]:_0x11c18c['message'];return console[_0x39fdf1(0xe6)](''+_0x9c7738+_0x933600),0x1;}}if(_0x24eec8[_0x39fdf1(0xdf)]>0x1&&_0x3d9d24&&_0x278140['length']>0x0){const _0xc7723e=_0x278140['join']('\x0a');writeFileSync(_0x13a966[_0x39fdf1(0xff)],_0xc7723e),console[_0x39fdf1(0xe6)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x13a966[_0x39fdf1(0xff)]);}return 0x0;}catch(_0x1740f7){throw _0x1740f7;}}[a24_0x3d7fdb(0xf6)](_0x1e37a2){const _0x49666b=a24_0x3d7fdb,_0x2624d8=_0x1e37a2[_0x49666b(0x105)][0x0],_0x15aa64=_0x1e37a2[_0x49666b(0xdc)]['file'];if(!_0x2624d8&&!_0x15aa64)return _0x49666b(0x111);if(_0x2624d8&&_0x15aa64)return _0x49666b(0xfb);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x1f4ab8=a25_0xffa8;(function(_0x5cd39a,_0x47159e){const _0x4a6d1f=a25_0xffa8,_0x28f39d=_0x5cd39a();while(!![]){try{const _0x10c121=parseInt(_0x4a6d1f(0x11c))/0x1*(-parseInt(_0x4a6d1f(0x13f))/0x2)+parseInt(_0x4a6d1f(0x129))/0x3+-parseInt(_0x4a6d1f(0x142))/0x4*(-parseInt(_0x4a6d1f(0xd1))/0x5)+parseInt(_0x4a6d1f(0x148))/0x6*(-parseInt(_0x4a6d1f(0x11b))/0x7)+-parseInt(_0x4a6d1f(0xc5))/0x8+parseInt(_0x4a6d1f(0x107))/0x9+parseInt(_0x4a6d1f(0x14c))/0xa;if(_0x10c121===_0x47159e)break;else _0x28f39d['push'](_0x28f39d['shift']());}catch(_0x52ac44){_0x28f39d['push'](_0x28f39d['shift']());}}}(a25_0x2590,0x4417c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a25_0x2590(){const _0x4214cd=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20path\x20\x27','error','verbose','segmentPath','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20\x27','Resolving\x20\x27','Fetching\x20folder\x20\x27','parentFolder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20type:\x20','SEGMENT_NOT_FOUND','Usage:\x20tdx\x20sg\x20desc\x20<name>','code','Parent\x20name:\x20','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','folderId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parentSegment','Create\x20segment\x20folder\x20for\x20organization','parentId','segment:show','(root)','getFolder','Resolved\x20folder\x20ID:\x20','test','url','Folder\x20ID:\x20','Parent\x20ID:\x20','site','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','✖\x20Query\x20failed\x20[','resolveParentId','resolveFolderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x27\x20with\x20ID:\x20','Examples:','web','Creating\x20folder\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','log','1045638pgQNjP','Target\x20path:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Show\x20segment\x20folder\x20details','segment:folder:create','Fetching\x20segment\x20details...','data','cause','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20sql','parent','jsonl','length','description','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','folder','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:view','14jceeLa','1KViBFs','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','/e/','Listing\x20folders\x20for\x20parent\x20\x27','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20name:\x20','execute','stats','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Use:\x20tdx\x20ps\x20show','608568TzGHpw','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','type','Error:\x20Path\x20or\x20name\x20is\x20required','json','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20sg\x20sql\x20<name>','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segmentId','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20Parent\x20segment:\x20','INVALID_ARGUMENT','information_schema','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderPath','\x20\x20Full\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','740994GhDlwg','processedRows','jobId','12356YcsypB','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Segment\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','message','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','1524858JBcgIi','\x20\x20Folder\x20path:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','trim','12430460BIicFw','in\x20','Resolved\x20YAML\x20file:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentName','getSegment','Fetching\x20folder\x20details...','\x27...','segment:sql','/app/ps/','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Show\x20child\x20segment\x20schema\x20(column\x20types)','Use:\x20tdx\x20ps\x20desc','replace','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','resolvePathToResource','segment','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','3457552gTlYLY','name','format','Resolved\x20parent\x20ID:\x20','\x20Opening\x20','segment:desc','Options:','Fetching\x20SQL\x20for\x20segment...','Parent\x20segment:\x20','query','\x20\x20Cause:\x20','fullPath','45hIWxYA'];a25_0x2590=function(){return _0x4214cd;};return a25_0x2590();}import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0xddf546 from'chalk';async function resolveSegmentTarget(_0xc6e67a,_0x156d05,_0x5b01ac){const _0xb6031e=a25_0xffa8;if(isYamlFilePath(_0xc6e67a))try{const _0x425e2e=await resolveYamlFilePath(_0xc6e67a);return _0x5b01ac&&(console[_0xb6031e(0xd5)](_0xb6031e(0x14e)+_0xc6e67a),console[_0xb6031e(0xd5)](_0xb6031e(0x137)+_0x425e2e[_0xb6031e(0xee)]),console['error']('\x20\x20Segment\x20name:\x20'+_0x425e2e[_0xb6031e(0x150)]),console[_0xb6031e(0xd5)](_0xb6031e(0x149)+(_0x425e2e[_0xb6031e(0x13c)]||_0xb6031e(0xf2))),console['error'](_0xb6031e(0x13d)+_0x425e2e[_0xb6031e(0xd0)])),_0x425e2e[_0xb6031e(0xd0)];}catch(_0x1476b9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xb6031e(0x133)+_0x1476b9[_0xb6031e(0x146)]);}if(!_0x156d05)throw new SDKError(ErrorCode[_0xb6031e(0x138)],_0xb6031e(0x117));return _0x156d05+'/'+_0xc6e67a;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xdf);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x10f);async[a25_0x1f4ab8(0x123)](_0xb25dfc){const _0x2d3ca8=a25_0x1f4ab8,{options:_0x5d8f52,args:_0x3f1187,tdx:_0x4ba699}=_0xb25dfc,_0x4e1152=_0x3f1187[0x0],_0x441a06=!_0x4e1152&&!!_0x5d8f52['parentSegment'],_0x14e8df=_0x4e1152||_0x5d8f52[_0x2d3ca8(0xee)];if(!_0x14e8df)return console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x12d)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x14a)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x102)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xc3)),console['error'](_0x2d3ca8(0x13b)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xd3)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x136)),0x1;try{const _0xeae13f=_0x5d8f52[_0x2d3ca8(0xd7)];let _0x255d2b=_0x14e8df;!_0x441a06&&_0xeae13f&&!_0x14e8df['includes']('/')&&(_0x255d2b=_0xeae13f+'/'+_0x14e8df,_0x5d8f52[_0x2d3ca8(0xd6)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x255d2b));const _0x34f7b1=await withSpinner(_0x2d3ca8(0xd4)+_0x255d2b+_0x2d3ca8(0x153),()=>_0x4ba699[_0x2d3ca8(0xc2)][_0x2d3ca8(0xc1)](_0x255d2b),{'verbose':_0x5d8f52['verbose']}),_0x24bc48=_0x34f7b1[_0x2d3ca8(0x10d)];_0x5d8f52['verbose']&&(console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xe4)+_0x24bc48[_0x2d3ca8(0x12c)]),console[_0x2d3ca8(0xd5)]('Parent\x20ID:\x20'+_0x24bc48[_0x2d3ca8(0xf0)]),_0x24bc48[_0x2d3ca8(0xeb)]&&console[_0x2d3ca8(0xd5)]('Folder\x20ID:\x20'+_0x24bc48['folderId']),_0x24bc48[_0x2d3ca8(0x134)]&&console['error'](_0x2d3ca8(0x144)+_0x24bc48[_0x2d3ca8(0x134)]));if(_0x24bc48[_0x2d3ca8(0x12c)]===_0x2d3ca8(0x111)){const _0x3e04eb=await withSpinner(_0x2d3ca8(0x131),()=>_0x4ba699[_0x2d3ca8(0xc2)]['getParent'](_0x24bc48['parentId']),{'verbose':_0x5d8f52[_0x2d3ca8(0xd6)]});await handleSingleObjectOutput(_0x3e04eb['data'],_0x5d8f52);}else{if(_0x24bc48[_0x2d3ca8(0x12c)]==='folder'){if(!_0x24bc48[_0x2d3ca8(0xeb)])throw new SDKError(ErrorCode[_0x2d3ca8(0x130)],_0x2d3ca8(0xde));const _0x4d47a3=await withSpinner(_0x2d3ca8(0x152),()=>_0x4ba699[_0x2d3ca8(0xc2)]['getFolder'](_0x24bc48[_0x2d3ca8(0xeb)]),{'verbose':_0x5d8f52['verbose']});await handleSingleObjectOutput(_0x4d47a3[_0x2d3ca8(0x10d)],_0x5d8f52);}else{if(_0x24bc48['type']===_0x2d3ca8(0xc2)){if(!_0x24bc48[_0x2d3ca8(0x134)])throw new SDKError(ErrorCode[_0x2d3ca8(0xe5)],_0x2d3ca8(0x145));const _0x45ee01=await withSpinner(_0x2d3ca8(0x10c),()=>_0x4ba699['segment'][_0x2d3ca8(0x151)](_0x24bc48[_0x2d3ca8(0xf0)],_0x24bc48[_0x2d3ca8(0x134)]),{'verbose':_0x5d8f52[_0x2d3ca8(0xd6)]});await handleSingleObjectOutput(_0x45ee01[_0x2d3ca8(0x10d)],_0x5d8f52);}}}return 0x0;}catch(_0x4eace4){if(_0x4eace4 instanceof SDKError)return console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xfb)+_0x4eace4[_0x2d3ca8(0x146)]),_0x4eace4[_0x2d3ca8(0x10e)]&&console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xcf)+_0x4eace4['cause']),0x1;throw _0x4eace4;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xf1);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x109);async[a25_0x1f4ab8(0x123)](_0x215176){const _0x974f9c=a25_0x1f4ab8,{options:_0x456366,args:_0x410e7b,tdx:_0x46b58f}=_0x215176,_0x2b0b95=_0x410e7b[0x0];if(!_0x2b0b95)return console['error'](_0x974f9c(0xfc)),console[_0x974f9c(0xd5)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x974f9c(0xd5)](_0x974f9c(0xd2)),console[_0x974f9c(0xd5)](_0x974f9c(0x102)),console['error'](_0x974f9c(0x12f)),console[_0x974f9c(0xd5)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x38ed49=_0x456366['parentSegment'],_0x460330=await resolveSegmentTarget(_0x2b0b95,_0x38ed49,_0x456366[_0x974f9c(0xd6)]);_0x456366[_0x974f9c(0xd6)]&&console['error']('Target\x20path:\x20'+_0x460330);const _0xa48f54=await withSpinner(_0x974f9c(0xdb)+_0x2b0b95+_0x974f9c(0x153),()=>_0x46b58f[_0x974f9c(0xc2)][_0x974f9c(0xc1)](_0x460330),{'verbose':_0x456366['verbose']}),_0x303ccb=_0xa48f54[_0x974f9c(0x10d)];_0x456366[_0x974f9c(0xd6)]&&(console['error']('Resolved\x20type:\x20'+_0x303ccb[_0x974f9c(0x12c)]),console[_0x974f9c(0xd5)](_0x974f9c(0xf8)+_0x303ccb[_0x974f9c(0xf0)]));if(_0x303ccb[_0x974f9c(0x12c)]===_0x974f9c(0x118))return console[_0x974f9c(0xd5)](_0x974f9c(0xc4)),console[_0x974f9c(0xd5)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x303ccb[_0x974f9c(0x12c)]==='parent')return console[_0x974f9c(0xd5)](_0x974f9c(0x11d)),console[_0x974f9c(0xd5)](_0x974f9c(0x128)),0x1;if(!_0x303ccb[_0x974f9c(0x134)])throw new SDKError(ErrorCode[_0x974f9c(0xe5)],_0x974f9c(0x145));const _0x44f3cc=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x46b58f[_0x974f9c(0xc2)][_0x974f9c(0xe1)](_0x303ccb[_0x974f9c(0xf0)],_0x303ccb[_0x974f9c(0x134)]),{'verbose':_0x456366[_0x974f9c(0xd6)]});let _0x12d95c=_0x44f3cc[_0x974f9c(0x10d)];const _0x11d5cc=resolveLimit(_0x456366['limit'],DEFAULT_DISPLAY_LIMIT),_0x443262=/\bLIMIT\s+\d+/i[_0x974f9c(0xf5)](_0x12d95c);!_0x443262&&(_0x12d95c=_0x12d95c[_0x974f9c(0x14b)]()[_0x974f9c(0xbf)](/;+$/,''),_0x12d95c=_0x974f9c(0x13a)+_0x12d95c+_0x974f9c(0xd8)+_0x11d5cc);_0x456366[_0x974f9c(0xd6)]&&console['error']('SQL\x20query:\x0a'+_0x12d95c);const _0x57a41f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x3e6c91=>{const _0x4ec6a0=_0x974f9c,_0x171a24=await _0x46b58f[_0x4ec6a0(0xce)][_0x4ec6a0(0x123)](_0x12d95c,{'catalog':'td','schema':_0x4ec6a0(0x139),'onJobId':_0x5aa331=>{_0x3e6c91['setJobId'](_0x5aa331);}});return _0x171a24;},{'verbose':_0x456366[_0x974f9c(0xd6)]}),_0x56405a=_0x57a41f['data'],_0x4dec5c=_0x56405a[_0x974f9c(0x141)]?_0x974f9c(0x120)+_0x56405a['jobId']+']':'';return console[_0x974f9c(0xd5)](_0x974f9c(0x105)+_0x56405a[_0x974f9c(0x124)][_0x974f9c(0x140)]['toLocaleString']()+'\x20rows\x20'+(_0x974f9c(0x14d)+formatElapsed(_0x56405a['stats']['elapsedTimeMillis'])+_0x4dec5c)),await handleQueryOutput(_0x56405a,_0x456366),0x0;}catch(_0x17f2a0){if(_0x17f2a0 instanceof SDKError)return console[_0x974f9c(0xd5)](_0x974f9c(0xfd)+_0x17f2a0[_0x974f9c(0xe7)]+']'),console[_0x974f9c(0xd5)]('\x0a'+_0x17f2a0[_0x974f9c(0x146)]),0x1;throw _0x17f2a0;}}}function a25_0xffa8(_0x377863,_0x22c1e4){_0x377863=_0x377863-0xbb;const _0x259035=a25_0x2590();let _0xffa868=_0x259035[_0x377863];return _0xffa868;}export class SegmentFolderListCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]='segment:folder:list';[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xed);async[a25_0x1f4ab8(0x123)](_0x32e91e){const _0x374ea7=a25_0x1f4ab8,{options:_0x12cd81,args:_0x1ce374,tdx:_0x50506f}=_0x32e91e;if(_0x1ce374['length']===0x0)return console[_0x374ea7(0xd5)](_0x374ea7(0x119)),console[_0x374ea7(0xd5)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x272f5f=_0x1ce374[0x0];try{_0x12cd81[_0x374ea7(0xd6)]&&(console[_0x374ea7(0xd5)]('Site:\x20'+_0x12cd81[_0x374ea7(0xf9)]),console[_0x374ea7(0xd5)](_0x374ea7(0xe8)+_0x272f5f));const _0x34949e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x272f5f+_0x374ea7(0x153),()=>_0x50506f[_0x374ea7(0xc2)][_0x374ea7(0xfe)](_0x272f5f),{'verbose':_0x12cd81[_0x374ea7(0xd6)]}),_0x261784=_0x34949e[_0x374ea7(0x10d)];_0x12cd81[_0x374ea7(0xd6)]&&console['error'](_0x374ea7(0xc8)+_0x261784);const _0x133021=await withSpinner(_0x374ea7(0x11f)+_0x272f5f+'\x27...',()=>_0x50506f[_0x374ea7(0xc2)]['listFolders'](_0x261784),{'verbose':_0x12cd81[_0x374ea7(0xd6)]}),_0x43d9e9=_0x133021['data'];return console[_0x374ea7(0xd5)]('✔\x20Found\x20'+_0x43d9e9[_0x374ea7(0x113)]+'\x20folder'+(_0x43d9e9['length']!==0x1?'s':'')),await handleSDKOutput(_0x43d9e9,_0x12cd81),0x0;}catch(_0x40c7e1){if(_0x40c7e1 instanceof SDKError)return console[_0x374ea7(0xd5)]('Error:\x20'+_0x40c7e1[_0x374ea7(0x146)]),_0x40c7e1[_0x374ea7(0x10e)]&&console[_0x374ea7(0xd5)](_0x374ea7(0xcf)+_0x40c7e1[_0x374ea7(0x10e)]),0x1;throw _0x40c7e1;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x10a);async[a25_0x1f4ab8(0x123)](_0x1df1fe){const _0x5e1de7=a25_0x1f4ab8,{options:_0x292c61,args:_0x3fc1d0,tdx:_0x2921b9}=_0x1df1fe;if(_0x3fc1d0[_0x5e1de7(0x113)]===0x0)return console[_0x5e1de7(0xd5)](_0x5e1de7(0x12a)),console[_0x5e1de7(0xd5)](_0x5e1de7(0xc0)),0x1;try{const {parentId:_0x33f62e,childId:_0x38b500}=parseSegmentRef(_0x3fc1d0[0x0]);_0x292c61[_0x5e1de7(0xd6)]&&(console[_0x5e1de7(0xd5)]('Site:\x20'+_0x292c61['site']),console[_0x5e1de7(0xd5)](_0x5e1de7(0xe8)+_0x33f62e),_0x38b500&&console[_0x5e1de7(0xd5)](_0x5e1de7(0x122)+_0x38b500));if(!_0x38b500)return console[_0x5e1de7(0xd5)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x127930=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x33f62e+_0x5e1de7(0x153),()=>_0x2921b9['segment'][_0x5e1de7(0xfe)](_0x33f62e),{'verbose':_0x292c61[_0x5e1de7(0xd6)]}),_0x248e5f=_0x127930[_0x5e1de7(0x10d)];_0x292c61[_0x5e1de7(0xd6)]&&console[_0x5e1de7(0xd5)](_0x5e1de7(0xc8)+_0x248e5f);const _0x5116f8=await withSpinner(_0x5e1de7(0xda)+_0x38b500+_0x5e1de7(0x153),()=>_0x2921b9[_0x5e1de7(0xc2)][_0x5e1de7(0xff)](_0x248e5f,_0x38b500),{'verbose':_0x292c61['verbose']}),_0x2c7880=_0x5116f8[_0x5e1de7(0x10d)];_0x292c61[_0x5e1de7(0xd6)]&&console['error'](_0x5e1de7(0xf4)+_0x2c7880);const _0x5471e1=await withSpinner(_0x5e1de7(0xdc)+_0x38b500+_0x5e1de7(0x153),()=>_0x2921b9[_0x5e1de7(0xc2)]['getFolder'](_0x2c7880),{'verbose':_0x292c61[_0x5e1de7(0xd6)]});return await handleSDKOutput([_0x5471e1[_0x5e1de7(0x10d)]],_0x292c61),0x0;}catch(_0x2bc255){if(_0x2bc255 instanceof SDKError)return console['error'](_0x5e1de7(0xfb)+_0x2bc255[_0x5e1de7(0x146)]),_0x2bc255[_0x5e1de7(0x10e)]&&console['error'](_0x5e1de7(0xcf)+_0x2bc255['cause']),0x1;throw _0x2bc255;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0x154);['description']=a25_0x1f4ab8(0x135);async[a25_0x1f4ab8(0x123)](_0x7730f0){const _0x20234d=a25_0x1f4ab8,{options:_0x370d8b,args:_0x25bab0,tdx:_0x5538a6}=_0x7730f0,_0x40aa19=_0x25bab0[0x0];if(!_0x40aa19)return console['error'](_0x20234d(0xfc)),console[_0x20234d(0xd5)](_0x20234d(0x132)),console[_0x20234d(0xd5)](_0x20234d(0xe0)),console[_0x20234d(0xd5)](_0x20234d(0x102)),console['error'](_0x20234d(0x143)),console['error'](_0x20234d(0x116)),0x1;try{const _0x5a34ff=_0x370d8b['parentSegment'],_0x44ac8f=await resolveSegmentTarget(_0x40aa19,_0x5a34ff,_0x370d8b[_0x20234d(0xd6)]);_0x370d8b['verbose']&&console[_0x20234d(0xd5)](_0x20234d(0x108)+_0x44ac8f);const _0x36cc5b=await withSpinner(_0x20234d(0xdb)+_0x40aa19+_0x20234d(0x153),()=>_0x5538a6[_0x20234d(0xc2)][_0x20234d(0xc1)](_0x44ac8f),{'verbose':_0x370d8b[_0x20234d(0xd6)]}),_0x41b685=_0x36cc5b[_0x20234d(0x10d)];_0x370d8b['verbose']&&(console[_0x20234d(0xd5)]('Resolved\x20type:\x20'+_0x41b685['type']),console['error'](_0x20234d(0xf8)+_0x41b685[_0x20234d(0xf0)]));if(_0x41b685[_0x20234d(0x12c)]===_0x20234d(0x118))return console[_0x20234d(0xd5)](_0x20234d(0x115)),console[_0x20234d(0xd5)](_0x20234d(0xbc)),0x1;if(_0x41b685['type']===_0x20234d(0x111))return console[_0x20234d(0xd5)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x20234d(0x110)),0x1;if(!_0x41b685[_0x20234d(0x134)])throw new SDKError(ErrorCode[_0x20234d(0xe5)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x176167=await withSpinner(_0x20234d(0xcc),()=>_0x5538a6[_0x20234d(0xc2)][_0x20234d(0xe1)](_0x41b685[_0x20234d(0xf0)],_0x41b685['segmentId']),{'verbose':_0x370d8b[_0x20234d(0xd6)]}),_0x8a2190=_0x176167['data'];return _0x370d8b[_0x20234d(0xc7)]===_0x20234d(0x12e)||_0x370d8b[_0x20234d(0xc7)]===_0x20234d(0x112)?await handleSDKOutput([{'sql':_0x8a2190}],_0x370d8b):console[_0x20234d(0x106)](_0x8a2190),0x0;}catch(_0x5d4f70){if(_0x5d4f70 instanceof SDKError)return console[_0x20234d(0xd5)](_0x20234d(0xfb)+_0x5d4f70[_0x20234d(0x146)]),_0x5d4f70['cause']&&console[_0x20234d(0xd5)](_0x20234d(0xcf)+_0x5d4f70[_0x20234d(0x10e)]),0x1;throw _0x5d4f70;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x1f4ab8(0x10b);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xef);async[a25_0x1f4ab8(0x123)](_0x653bcc){const _0x1fb3e0=a25_0x1f4ab8,{options:_0x1bd71b,args:_0x26cb2d,tdx:_0x520e31}=_0x653bcc,_0x3d8cbd=_0x1bd71b;if(_0x26cb2d[_0x1fb3e0(0x113)]<0x2)return console[_0x1fb3e0(0xd5)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1fb3e0(0xd5)](_0x1fb3e0(0x14f)),0x1;const _0x42f835=_0x26cb2d[0x0],_0x5977f7=_0x26cb2d[0x1];_0x3d8cbd[_0x1fb3e0(0xd6)]&&(console[_0x1fb3e0(0xd5)]('Site:\x20'+_0x3d8cbd['site']),console[_0x1fb3e0(0xd5)](_0x1fb3e0(0xcd)+_0x42f835),console[_0x1fb3e0(0xd5)]('Folder\x20name:\x20'+_0x5977f7));let _0x4627ec;if(_0x3d8cbd['parentFolder']){const _0x53b2d9=_0x3d8cbd[_0x1fb3e0(0xdd)],_0x5eaa4d=await withSpinner(_0x1fb3e0(0xd9)+_0x42f835+'\x27...',()=>_0x520e31[_0x1fb3e0(0xc2)][_0x1fb3e0(0xfe)](_0x42f835),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]}),_0x12f15a=_0x5eaa4d[_0x1fb3e0(0x10d)],_0x3cbcbf=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x53b2d9+_0x1fb3e0(0x153),()=>_0x520e31['segment']['resolveFolderId'](_0x12f15a,_0x53b2d9),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]});_0x4627ec=_0x3cbcbf[_0x1fb3e0(0x10d)],_0x3d8cbd[_0x1fb3e0(0xd6)]&&console[_0x1fb3e0(0xd5)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4627ec);}const _0x246aec={'name':_0x5977f7,'description':_0x3d8cbd[_0x1fb3e0(0x114)],'parentFolderId':_0x4627ec},_0xc71955=await withSpinner(_0x1fb3e0(0x104)+_0x5977f7+_0x1fb3e0(0x153),()=>_0x520e31[_0x1fb3e0(0xc2)]['createFolder'](_0x42f835,_0x246aec),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]}),_0x5555e9=_0xc71955['data'];return console[_0x1fb3e0(0xd5)](_0x1fb3e0(0x126)+_0x5555e9[_0x1fb3e0(0xc6)]+_0x1fb3e0(0x101)+_0x5555e9['id']),await handleSDKOutput([_0x5555e9],_0x3d8cbd),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0x11a);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xe3);async[a25_0x1f4ab8(0x123)](_0x30acce){const _0x47fb7b=a25_0x1f4ab8,{options:_0x1978da,args:_0x525f00,tdx:_0x137da4}=_0x30acce,_0x4fca8d=_0x525f00[0x0];if(!_0x4fca8d)return console[_0x47fb7b(0xd5)](_0x47fb7b(0x12b)),console[_0x47fb7b(0xd5)](_0x47fb7b(0x127)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xe2)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xcb)),console[_0x47fb7b(0xd5)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x47fb7b(0xd5)]('Examples:'),console[_0x47fb7b(0xd5)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x47fb7b(0xd5)](_0x47fb7b(0xec)),console[_0x47fb7b(0xd5)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x451d38=_0x1978da[_0x47fb7b(0xee)],_0x42bd13=await resolveSegmentTarget(_0x4fca8d,_0x451d38,_0x1978da['verbose']);_0x1978da[_0x47fb7b(0xd6)]&&console[_0x47fb7b(0xd5)]('Target\x20path:\x20'+_0x42bd13);const _0x4c5562=await withSpinner('Resolving\x20\x27'+_0x4fca8d+_0x47fb7b(0x153),()=>_0x137da4[_0x47fb7b(0xc2)][_0x47fb7b(0xc1)](_0x42bd13),{'verbose':_0x1978da['verbose']}),_0x1aefdb=_0x4c5562['data'];_0x1978da[_0x47fb7b(0xd6)]&&(console[_0x47fb7b(0xd5)](_0x47fb7b(0xe4)+_0x1aefdb[_0x47fb7b(0x12c)]),console[_0x47fb7b(0xd5)](_0x47fb7b(0xf8)+_0x1aefdb['parentId']),_0x1aefdb['folderId']&&console[_0x47fb7b(0xd5)](_0x47fb7b(0xf7)+_0x1aefdb[_0x47fb7b(0xeb)]),_0x1aefdb[_0x47fb7b(0x134)]&&console[_0x47fb7b(0xd5)](_0x47fb7b(0x144)+_0x1aefdb['segmentId']));if(_0x1978da[_0x47fb7b(0x103)]){if(_0x1aefdb[_0x47fb7b(0x12c)]==='folder')return console[_0x47fb7b(0xd5)](_0x47fb7b(0xea)),0x1;if(_0x1aefdb[_0x47fb7b(0x12c)]===_0x47fb7b(0x111))return console[_0x47fb7b(0xd5)](_0x47fb7b(0xfa)),console[_0x47fb7b(0xd5)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x1aefdb[_0x47fb7b(0x134)])throw new SDKError(ErrorCode[_0x47fb7b(0xe5)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2272b8=getConsoleNextUrl(_0x1978da[_0x47fb7b(0xf9)],_0x47fb7b(0xbb)+_0x1aefdb[_0x47fb7b(0xf0)]+_0x47fb7b(0x11e)+_0x1aefdb[_0x47fb7b(0x134)]);return console[_0x47fb7b(0xd5)](a25_0xddf546['green']('✔')+_0x47fb7b(0xc9)+a25_0xddf546['cyan'](_0x2272b8)),openBrowser(_0x2272b8),0x0;}if(_0x1aefdb[_0x47fb7b(0x12c)]===_0x47fb7b(0x118)){if(!_0x1aefdb['folderId'])throw new SDKError(ErrorCode[_0x47fb7b(0x130)],_0x47fb7b(0xde));const _0x26d023=await withSpinner(_0x47fb7b(0x152),()=>_0x137da4['segment'][_0x47fb7b(0xf3)](_0x1aefdb[_0x47fb7b(0xeb)]),{'verbose':_0x1978da[_0x47fb7b(0xd6)]});await handleSingleObjectOutput(_0x26d023[_0x47fb7b(0x10d)],_0x1978da);}else{if(_0x1aefdb[_0x47fb7b(0x12c)]==='segment'){if(!_0x1aefdb[_0x47fb7b(0x134)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x47fb7b(0x145));const _0x2b6a08=await withSpinner(_0x47fb7b(0x10c),()=>_0x137da4[_0x47fb7b(0xc2)]['getSegment'](_0x1aefdb[_0x47fb7b(0xf0)],_0x1aefdb['segmentId']),{'verbose':_0x1978da['verbose']}),_0x57f51e=getConsoleNextUrl(_0x1978da[_0x47fb7b(0xf9)],'/app/ps/'+_0x1aefdb['parentId']+_0x47fb7b(0x11e)+_0x1aefdb[_0x47fb7b(0x134)]),_0x504945=_0x2b6a08['data'];_0x504945[_0x47fb7b(0xf6)]=_0x57f51e,await handleSingleObjectOutput(_0x504945,_0x1978da);}else return console[_0x47fb7b(0xd5)](_0x47fb7b(0x121)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xe9)),0x1;}return 0x0;}catch(_0x580e45){if(_0x580e45 instanceof SDKError)return console[_0x47fb7b(0xd5)](_0x47fb7b(0xfb)+_0x580e45[_0x47fb7b(0x146)]),_0x580e45[_0x47fb7b(0x10e)]&&console[_0x47fb7b(0xd5)](_0x47fb7b(0xcf)+_0x580e45['cause']),0x1;throw _0x580e45;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xca);['description']=a25_0x1f4ab8(0xbd);async[a25_0x1f4ab8(0x123)](_0x4679df){const _0x111b38=a25_0x1f4ab8,{options:_0x3964d2,args:_0x4d331b,tdx:_0xb4568}=_0x4679df,_0x1f0913=_0x4d331b[0x0];if(!_0x1f0913)return console[_0x111b38(0xd5)](_0x111b38(0xfc)),console[_0x111b38(0xd5)](_0x111b38(0xe6)),console[_0x111b38(0xd5)](_0x111b38(0x100)),console[_0x111b38(0xd5)](_0x111b38(0x102)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x111b38(0xd5)](_0x111b38(0x125)),0x1;try{const _0x5943b8=_0x3964d2[_0x111b38(0xee)],_0x20a714=await resolveSegmentTarget(_0x1f0913,_0x5943b8,_0x3964d2[_0x111b38(0xd6)]);_0x3964d2[_0x111b38(0xd6)]&&console[_0x111b38(0xd5)](_0x111b38(0x108)+_0x20a714);const _0x41cd24=await withSpinner(_0x111b38(0xdb)+_0x1f0913+_0x111b38(0x153),()=>_0xb4568[_0x111b38(0xc2)]['resolvePathToResource'](_0x20a714),{'verbose':_0x3964d2[_0x111b38(0xd6)]}),_0x3eb8ad=_0x41cd24[_0x111b38(0x10d)];_0x3964d2[_0x111b38(0xd6)]&&(console['error']('Resolved\x20type:\x20'+_0x3eb8ad[_0x111b38(0x12c)]),console[_0x111b38(0xd5)]('Parent\x20ID:\x20'+_0x3eb8ad['parentId']));if(_0x3eb8ad[_0x111b38(0x12c)]==='folder')return console[_0x111b38(0xd5)](_0x111b38(0x147)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x3eb8ad['type']===_0x111b38(0x111))return console['error'](_0x111b38(0x13e)),console['error'](_0x111b38(0xbe)),0x1;if(!_0x3eb8ad[_0x111b38(0x134)])throw new SDKError(ErrorCode[_0x111b38(0xe5)],_0x111b38(0x145));const _0x13e8f2=await withSpinner(_0x111b38(0xcc),()=>_0xb4568['segment'][_0x111b38(0xe1)](_0x3eb8ad['parentId'],_0x3eb8ad['segmentId']),{'verbose':_0x3964d2[_0x111b38(0xd6)]}),_0x5194dd=_0x13e8f2[_0x111b38(0x10d)],_0x235c54=await executeSchemaQuery(_0x5194dd,_0xb4568,_0x3964d2);return await handleQueryOutput(_0x235c54,_0x3964d2),0x0;}catch(_0x1049ab){if(_0x1049ab instanceof SDKError)return console[_0x111b38(0xd5)](_0x111b38(0xfb)+_0x1049ab[_0x111b38(0x146)]),_0x1049ab[_0x111b38(0x10e)]&&console['error'](_0x111b38(0xcf)+_0x1049ab[_0x111b38(0x10e)]),0x1;throw _0x1049ab;}}}
|
|
1
|
+
const a25_0x108244=a25_0x424d;(function(_0x2b82b5,_0x4aeca5){const _0x8cb412=a25_0x424d,_0xf76e9=_0x2b82b5();while(!![]){try{const _0x3c4a1d=-parseInt(_0x8cb412(0xe5))/0x1+-parseInt(_0x8cb412(0x122))/0x2+-parseInt(_0x8cb412(0x118))/0x3+parseInt(_0x8cb412(0xff))/0x4+-parseInt(_0x8cb412(0x107))/0x5*(-parseInt(_0x8cb412(0xdc))/0x6)+parseInt(_0x8cb412(0x104))/0x7*(-parseInt(_0x8cb412(0x161))/0x8)+parseInt(_0x8cb412(0x15e))/0x9*(parseInt(_0x8cb412(0x141))/0xa);if(_0x3c4a1d===_0x4aeca5)break;else _0xf76e9['push'](_0xf76e9['shift']());}catch(_0x164f68){_0xf76e9['push'](_0xf76e9['shift']());}}}(a25_0x4df9,0x84ab8));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a25_0x424d(_0x26950e,_0x44e834){_0x26950e=_0x26950e-0xd0;const _0x4df982=a25_0x4df9();let _0x424d3a=_0x4df982[_0x26950e];return _0x424d3a;}import a25_0x28a98a from'chalk';function a25_0x4df9(){const _0x27f9e5=['Show\x20folder\x20or\x20child\x20segment\x20details','setJobId','toLocaleString','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segment:view','fullPath','\x27\x20with\x20ID:\x20','type','segmentName','✔\x20Created\x20folder\x20\x27','Error:\x20','parent','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','folderId','2301543VWGLcV','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','verbose','\x27...','Site:\x20','getParent','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','json','1628900JbpQIr','\x20\x20Cause:\x20','segment:describe','segment:folder:list','execute','SEGMENT_NOT_FOUND','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SEGMENT_FOLDER_NOT_FOUND','Use:\x20tdx\x20ps\x20view\x20-w','\x20[Job\x20ID:\x20','folder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','parentId','Target\x20path:\x20','Fetching\x20segment\x20details...','cause','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20rows\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','segmentId','/app/ps/','Options:','getSegment','Usage:\x20tdx\x20sg\x20show\x20<name>','cyan','segment:desc','message','information_schema','resolveParentId','25910xGZFHW','createFolder','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','stats','in\x20','segment:sql','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','/e/','listFolders','segment:folder:create','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','code','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','error','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20ps\x20desc','Resolving\x20\x27','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Creating\x20folder\x20\x27','description','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20Full\x20path:\x20','parentSegment','✖\x20Query\x20failed\x20[','folderPath','7002LBIwwe','(root)','Executing\x20segment\x20query...','32Epgeoe','web','Resolving\x20folder\x20\x27','test','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Use:\x20tdx\x20ps\x20view','green','Parent\x20name:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','INVALID_ARGUMENT','Fetching\x20folder\x20details...','Get\x20SQL\x20query\x20for\x20child\x20segment','Resolving\x20parent\x20folder\x20\x27','Parent\x20ID:\x20','Resolved\x20parent\x20ID:\x20','url','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','jsonl','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20sql','1046172NKDJZe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment','includes','resolvePathToResource','segmentPath','\x20folder','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','367730mUXQxc','data','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','name','jobId','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Create\x20segment\x20folder\x20for\x20organization','getFolder','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolving\x20parent\x20segment\x20\x27','\x20\x20Segment\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','Folder\x20ID\x20missing\x20from\x20resolved\x20path','format','resolveFolderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Listing\x20folders\x20for\x20parent\x20\x27','getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','✔\x20Found\x20','\x20Opening\x20','Folder\x20name:\x20','query','Folder\x20ID:\x20','1766004QBgHFV','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','243047PZWJlk','Error:\x20Path\x20or\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20details...','5CPxgrS'];a25_0x4df9=function(){return _0x27f9e5;};return a25_0x4df9();}async function resolveSegmentTarget(_0x5007aa,_0x3ecfdc,_0x47a376){const _0x55184c=a25_0x424d;if(isYamlFilePath(_0x5007aa))try{const _0x3369a4=await resolveYamlFilePath(_0x5007aa);return _0x47a376&&(console[_0x55184c(0x150)]('Resolved\x20YAML\x20file:\x20'+_0x5007aa),console['error']('\x20\x20Parent\x20segment:\x20'+_0x3369a4[_0x55184c(0x15b)]),console[_0x55184c(0x150)](_0x55184c(0xf1)+_0x3369a4[_0x55184c(0x111)]),console[_0x55184c(0x150)]('\x20\x20Folder\x20path:\x20'+(_0x3369a4[_0x55184c(0x15d)]||_0x55184c(0x15f))),console[_0x55184c(0x150)](_0x55184c(0x15a)+_0x3369a4[_0x55184c(0x10e)])),_0x3369a4[_0x55184c(0x10e)];}catch(_0x23239e){throw new SDKError(ErrorCode[_0x55184c(0x16b)],_0x55184c(0x16a)+_0x23239e[_0x55184c(0x13e)]);}if(!_0x3ecfdc)throw new SDKError(ErrorCode[_0x55184c(0x16b)],_0x55184c(0x120));return _0x3ecfdc+'/'+_0x5007aa;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x108244(0x124);[a25_0x108244(0x157)]='Show\x20segment\x20or\x20folder\x20details';async[a25_0x108244(0x126)](_0x4a2497){const _0x136b0d=a25_0x108244,{options:_0x3efec4,args:_0x1d3600,tdx:_0x18dd6b}=_0x4a2497,_0x408f95=_0x1d3600[0x0],_0x183b98=!_0x408f95&&!!_0x3efec4[_0x136b0d(0x15b)],_0x804581=_0x408f95||_0x3efec4[_0x136b0d(0x15b)];if(!_0x804581)return console[_0x136b0d(0x150)](_0x136b0d(0x105)),console['error'](_0x136b0d(0x165)),console[_0x136b0d(0x150)]('Examples:'),console[_0x136b0d(0x150)](_0x136b0d(0xef)),console[_0x136b0d(0x150)](_0x136b0d(0x100)),console[_0x136b0d(0x150)](_0x136b0d(0x129)),console[_0x136b0d(0x150)](_0x136b0d(0x152)),0x1;try{const _0x402710=_0x3efec4[_0x136b0d(0xe2)];let _0x580338=_0x804581;!_0x183b98&&_0x402710&&!_0x804581[_0x136b0d(0xe0)]('/')&&(_0x580338=_0x402710+'/'+_0x804581,_0x3efec4[_0x136b0d(0x11c)]&&console[_0x136b0d(0x150)](_0x136b0d(0x102)+_0x580338));const _0x4a06bb=await withSpinner(_0x136b0d(0x128)+_0x580338+_0x136b0d(0x11d),()=>_0x18dd6b[_0x136b0d(0xdf)]['resolvePathToResource'](_0x580338),{'verbose':_0x3efec4['verbose']}),_0x4eb027=_0x4a06bb[_0x136b0d(0xe6)];_0x3efec4['verbose']&&(console['error'](_0x136b0d(0xe7)+_0x4eb027['type']),console[_0x136b0d(0x150)](_0x136b0d(0xd3)+_0x4eb027['parentId']),_0x4eb027[_0x136b0d(0x117)]&&console[_0x136b0d(0x150)](_0x136b0d(0xfe)+_0x4eb027[_0x136b0d(0x117)]),_0x4eb027[_0x136b0d(0x137)]&&console[_0x136b0d(0x150)]('Segment\x20ID:\x20'+_0x4eb027[_0x136b0d(0x137)]));if(_0x4eb027[_0x136b0d(0x110)]===_0x136b0d(0x114)){const _0x2d7017=await withSpinner(_0x136b0d(0x106),()=>_0x18dd6b[_0x136b0d(0xdf)][_0x136b0d(0x11f)](_0x4eb027[_0x136b0d(0x130)]),{'verbose':_0x3efec4['verbose']});await handleSingleObjectOutput(_0x2d7017['data'],_0x3efec4);}else{if(_0x4eb027['type']===_0x136b0d(0x12d)){if(!_0x4eb027[_0x136b0d(0x117)])throw new SDKError(ErrorCode[_0x136b0d(0x12a)],_0x136b0d(0xf3));const _0x120230=await withSpinner('Fetching\x20folder\x20details...',()=>_0x18dd6b[_0x136b0d(0xdf)][_0x136b0d(0xed)](_0x4eb027['folderId']),{'verbose':_0x3efec4['verbose']});await handleSingleObjectOutput(_0x120230[_0x136b0d(0xe6)],_0x3efec4);}else{if(_0x4eb027['type']===_0x136b0d(0xdf)){if(!_0x4eb027[_0x136b0d(0x137)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x136b0d(0x14c));const _0x5a1559=await withSpinner('Fetching\x20segment\x20details...',()=>_0x18dd6b[_0x136b0d(0xdf)][_0x136b0d(0x13a)](_0x4eb027['parentId'],_0x4eb027['segmentId']),{'verbose':_0x3efec4[_0x136b0d(0x11c)]});await handleSingleObjectOutput(_0x5a1559['data'],_0x3efec4);}}}return 0x0;}catch(_0x5c50e4){if(_0x5c50e4 instanceof SDKError)return console[_0x136b0d(0x150)]('Error:\x20'+_0x5c50e4[_0x136b0d(0x13e)]),_0x5c50e4['cause']&&console[_0x136b0d(0x150)](_0x136b0d(0x123)+_0x5c50e4[_0x136b0d(0x133)]),0x1;throw _0x5c50e4;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x108244(0xe9)]='segment:show';[a25_0x108244(0x157)]=a25_0x108244(0x136);async[a25_0x108244(0x126)](_0x32d7c1){const _0x4cd887=a25_0x108244,{options:_0x25d875,args:_0xd83522,tdx:_0x51f63c}=_0x32d7c1,_0x92f9d1=_0xd83522[0x0];if(!_0x92f9d1)return console[_0x4cd887(0x150)](_0x4cd887(0x11a)),console[_0x4cd887(0x150)](_0x4cd887(0x13b)),console[_0x4cd887(0x150)](_0x4cd887(0xda)),console['error'](_0x4cd887(0x14b)),console[_0x4cd887(0x150)](_0x4cd887(0x14e)),console[_0x4cd887(0x150)](_0x4cd887(0x12f)),0x1;try{const _0x43be7a=_0x25d875[_0x4cd887(0x15b)],_0x297c4c=await resolveSegmentTarget(_0x92f9d1,_0x43be7a,_0x25d875[_0x4cd887(0x11c)]);_0x25d875['verbose']&&console[_0x4cd887(0x150)](_0x4cd887(0x131)+_0x297c4c);const _0x1b7f55=await withSpinner('Resolving\x20\x27'+_0x92f9d1+_0x4cd887(0x11d),()=>_0x51f63c[_0x4cd887(0xdf)][_0x4cd887(0xe1)](_0x297c4c),{'verbose':_0x25d875['verbose']}),_0x23d616=_0x1b7f55[_0x4cd887(0xe6)];_0x25d875[_0x4cd887(0x11c)]&&(console[_0x4cd887(0x150)]('Resolved\x20type:\x20'+_0x23d616[_0x4cd887(0x110)]),console[_0x4cd887(0x150)](_0x4cd887(0xd3)+_0x23d616[_0x4cd887(0x130)]));if(_0x23d616[_0x4cd887(0x110)]===_0x4cd887(0x12d))return console[_0x4cd887(0x150)](_0x4cd887(0x147)),console[_0x4cd887(0x150)](_0x4cd887(0xde)),0x1;if(_0x23d616[_0x4cd887(0x110)]==='parent')return console[_0x4cd887(0x150)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4cd887(0x150)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x23d616[_0x4cd887(0x137)])throw new SDKError(ErrorCode[_0x4cd887(0x127)],_0x4cd887(0x14c));const _0x3b6d5b=await withSpinner(_0x4cd887(0xf2),()=>_0x51f63c[_0x4cd887(0xdf)][_0x4cd887(0xf8)](_0x23d616[_0x4cd887(0x130)],_0x23d616[_0x4cd887(0x137)]),{'verbose':_0x25d875[_0x4cd887(0x11c)]});let _0xcb97e8=_0x3b6d5b[_0x4cd887(0xe6)];const _0xd1cab3=resolveLimit(_0x25d875['limit'],DEFAULT_DISPLAY_LIMIT),_0x463688=/\bLIMIT\s+\d+/i[_0x4cd887(0x164)](_0xcb97e8);!_0x463688&&(_0xcb97e8=_0xcb97e8['trim']()['replace'](/;+$/,''),_0xcb97e8='SELECT\x20*\x20FROM\x20(\x0a'+_0xcb97e8+_0x4cd887(0xee)+_0xd1cab3);_0x25d875[_0x4cd887(0x11c)]&&console['error']('SQL\x20query:\x0a'+_0xcb97e8);const _0x2512c4=await withProgressSpinner(_0x4cd887(0x160),async _0x33ed62=>{const _0x70f4cb=_0x4cd887,_0x19d70b=await _0x51f63c[_0x70f4cb(0xfd)][_0x70f4cb(0x126)](_0xcb97e8,{'catalog':'td','schema':_0x70f4cb(0x13f),'onJobId':_0x53ac38=>{const _0x169ace=_0x70f4cb;_0x33ed62[_0x169ace(0x109)](_0x53ac38);}});return _0x19d70b;},{'verbose':_0x25d875[_0x4cd887(0x11c)]}),_0x44b0cc=_0x2512c4[_0x4cd887(0xe6)],_0x32be0e=_0x44b0cc[_0x4cd887(0xea)]?_0x4cd887(0x12c)+_0x44b0cc[_0x4cd887(0xea)]+']':'';return console[_0x4cd887(0x150)](_0x4cd887(0x151)+_0x44b0cc[_0x4cd887(0x144)]['processedRows'][_0x4cd887(0x10a)]()+_0x4cd887(0x135)+(_0x4cd887(0x145)+formatElapsed(_0x44b0cc[_0x4cd887(0x144)]['elapsedTimeMillis'])+_0x32be0e)),await handleQueryOutput(_0x44b0cc,_0x25d875),0x0;}catch(_0x1fe7cb){if(_0x1fe7cb instanceof SDKError)return console['error'](_0x4cd887(0x15c)+_0x1fe7cb[_0x4cd887(0x14d)]+']'),console[_0x4cd887(0x150)]('\x0a'+_0x1fe7cb[_0x4cd887(0x13e)]),0x1;throw _0x1fe7cb;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x108244(0x125);[a25_0x108244(0x157)]=a25_0x108244(0x115);async[a25_0x108244(0x126)](_0x75667){const _0x5f172b=a25_0x108244,{options:_0x255e44,args:_0x55fe99,tdx:_0x401799}=_0x75667;if(_0x55fe99['length']===0x0)return console[_0x5f172b(0x150)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5f172b(0x150)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2b2013=_0x55fe99[0x0];try{_0x255e44[_0x5f172b(0x11c)]&&(console[_0x5f172b(0x150)]('Site:\x20'+_0x255e44[_0x5f172b(0x10b)]),console[_0x5f172b(0x150)](_0x5f172b(0x169)+_0x2b2013));const _0x3c1199=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2b2013+_0x5f172b(0x11d),()=>_0x401799[_0x5f172b(0xdf)][_0x5f172b(0x140)](_0x2b2013),{'verbose':_0x255e44[_0x5f172b(0x11c)]}),_0x2e12d2=_0x3c1199[_0x5f172b(0xe6)];_0x255e44[_0x5f172b(0x11c)]&&console[_0x5f172b(0x150)](_0x5f172b(0xd4)+_0x2e12d2);const _0xf89e72=await withSpinner(_0x5f172b(0xf7)+_0x2b2013+_0x5f172b(0x11d),()=>_0x401799[_0x5f172b(0xdf)][_0x5f172b(0x149)](_0x2e12d2),{'verbose':_0x255e44[_0x5f172b(0x11c)]}),_0x49bbda=_0xf89e72['data'];return console[_0x5f172b(0x150)](_0x5f172b(0xfa)+_0x49bbda[_0x5f172b(0xd9)]+_0x5f172b(0xe3)+(_0x49bbda[_0x5f172b(0xd9)]!==0x1?'s':'')),await handleSDKOutput(_0x49bbda,_0x255e44),0x0;}catch(_0x425f2a){if(_0x425f2a instanceof SDKError)return console[_0x5f172b(0x150)](_0x5f172b(0x113)+_0x425f2a[_0x5f172b(0x13e)]),_0x425f2a[_0x5f172b(0x133)]&&console['error'](_0x5f172b(0x123)+_0x425f2a[_0x5f172b(0x133)]),0x1;throw _0x425f2a;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x108244(0xe9)]='segment:folder:show';['description']=a25_0x108244(0x158);async['execute'](_0x26f31d){const _0x217de7=a25_0x108244,{options:_0xdfca54,args:_0x55ee8f,tdx:_0x3e1a8a}=_0x26f31d;if(_0x55ee8f[_0x217de7(0xd9)]===0x0)return console[_0x217de7(0x150)](_0x217de7(0xd6)),console[_0x217de7(0x150)](_0x217de7(0x11b)),0x1;try{const {parentId:_0x3929ef,childId:_0x1460eb}=parseSegmentRef(_0x55ee8f[0x0]);_0xdfca54[_0x217de7(0x11c)]&&(console[_0x217de7(0x150)](_0x217de7(0x11e)+_0xdfca54[_0x217de7(0x10b)]),console[_0x217de7(0x150)](_0x217de7(0x169)+_0x3929ef),_0x1460eb&&console['error'](_0x217de7(0xfc)+_0x1460eb));if(!_0x1460eb)return console[_0x217de7(0x150)](_0x217de7(0xeb)),0x1;const _0x46fcaa=await withSpinner(_0x217de7(0xf0)+_0x3929ef+_0x217de7(0x11d),()=>_0x3e1a8a[_0x217de7(0xdf)][_0x217de7(0x140)](_0x3929ef),{'verbose':_0xdfca54[_0x217de7(0x11c)]}),_0x4262ef=_0x46fcaa[_0x217de7(0xe6)];_0xdfca54[_0x217de7(0x11c)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4262ef);const _0x4cb3c1=await withSpinner(_0x217de7(0x163)+_0x1460eb+_0x217de7(0x11d),()=>_0x3e1a8a[_0x217de7(0xdf)][_0x217de7(0xf5)](_0x4262ef,_0x1460eb),{'verbose':_0xdfca54['verbose']}),_0x48492a=_0x4cb3c1['data'];_0xdfca54['verbose']&&console[_0x217de7(0x150)]('Resolved\x20folder\x20ID:\x20'+_0x48492a);const _0x798ecb=await withSpinner('Fetching\x20folder\x20\x27'+_0x1460eb+_0x217de7(0x11d),()=>_0x3e1a8a[_0x217de7(0xdf)]['getFolder'](_0x48492a),{'verbose':_0xdfca54['verbose']});return await handleSDKOutput([_0x798ecb['data']],_0xdfca54),0x0;}catch(_0x608d4e){if(_0x608d4e instanceof SDKError)return console[_0x217de7(0x150)](_0x217de7(0x113)+_0x608d4e['message']),_0x608d4e[_0x217de7(0x133)]&&console[_0x217de7(0x150)](_0x217de7(0x123)+_0x608d4e['cause']),0x1;throw _0x608d4e;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a25_0x108244(0x146);[a25_0x108244(0x157)]=a25_0x108244(0xd1);async[a25_0x108244(0x126)](_0x556946){const _0x1c982a=a25_0x108244,{options:_0x29cf17,args:_0x10437d,tdx:_0x357611}=_0x556946,_0x417949=_0x10437d[0x0];if(!_0x417949)return console[_0x1c982a(0x150)](_0x1c982a(0x11a)),console[_0x1c982a(0x150)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x1c982a(0x150)](_0x1c982a(0x10c)),console[_0x1c982a(0x150)]('Examples:'),console[_0x1c982a(0x150)](_0x1c982a(0x103)),console[_0x1c982a(0x150)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x31a9f9=_0x29cf17[_0x1c982a(0x15b)],_0x1a0a7d=await resolveSegmentTarget(_0x417949,_0x31a9f9,_0x29cf17[_0x1c982a(0x11c)]);_0x29cf17[_0x1c982a(0x11c)]&&console['error'](_0x1c982a(0x131)+_0x1a0a7d);const _0x2da6e7=await withSpinner(_0x1c982a(0x154)+_0x417949+'\x27...',()=>_0x357611[_0x1c982a(0xdf)][_0x1c982a(0xe1)](_0x1a0a7d),{'verbose':_0x29cf17[_0x1c982a(0x11c)]}),_0x19456b=_0x2da6e7[_0x1c982a(0xe6)];_0x29cf17[_0x1c982a(0x11c)]&&(console['error'](_0x1c982a(0xe7)+_0x19456b[_0x1c982a(0x110)]),console[_0x1c982a(0x150)](_0x1c982a(0xd3)+_0x19456b['parentId']));if(_0x19456b[_0x1c982a(0x110)]===_0x1c982a(0x12d))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x1c982a(0x12e)),0x1;if(_0x19456b[_0x1c982a(0x110)]==='parent')return console[_0x1c982a(0x150)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1c982a(0x150)](_0x1c982a(0xdb)),0x1;if(!_0x19456b['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x50ae01=await withSpinner(_0x1c982a(0xf2),()=>_0x357611[_0x1c982a(0xdf)][_0x1c982a(0xf8)](_0x19456b[_0x1c982a(0x130)],_0x19456b[_0x1c982a(0x137)]),{'verbose':_0x29cf17['verbose']}),_0x5908eb=_0x50ae01['data'];return _0x29cf17[_0x1c982a(0xf4)]===_0x1c982a(0x121)||_0x29cf17['format']===_0x1c982a(0xd8)?await handleSDKOutput([{'sql':_0x5908eb}],_0x29cf17):console['log'](_0x5908eb),0x0;}catch(_0xb5937b){if(_0xb5937b instanceof SDKError)return console['error'](_0x1c982a(0x113)+_0xb5937b['message']),_0xb5937b[_0x1c982a(0x133)]&&console['error'](_0x1c982a(0x123)+_0xb5937b['cause']),0x1;throw _0xb5937b;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x108244(0xe9)]=a25_0x108244(0x14a);['description']=a25_0x108244(0xec);async['execute'](_0x210f3f){const _0x433666=a25_0x108244,{options:_0x8a49af,args:_0xd7c446,tdx:_0x4da5d3}=_0x210f3f,_0x178b71=_0x8a49af;if(_0xd7c446[_0x433666(0xd9)]<0x2)return console[_0x433666(0x150)](_0x433666(0x143)),console['error'](_0x433666(0x101)),0x1;const _0x480af1=_0xd7c446[0x0],_0x29c973=_0xd7c446[0x1];_0x178b71[_0x433666(0x11c)]&&(console['error'](_0x433666(0x11e)+_0x178b71[_0x433666(0x10b)]),console[_0x433666(0x150)]('Parent\x20segment:\x20'+_0x480af1),console[_0x433666(0x150)](_0x433666(0xfc)+_0x29c973));let _0x27f459;if(_0x178b71['parentFolder']){const _0x2f5673=_0x178b71['parentFolder'],_0x1ec02a=await withSpinner(_0x433666(0xf0)+_0x480af1+_0x433666(0x11d),()=>_0x4da5d3[_0x433666(0xdf)][_0x433666(0x140)](_0x480af1),{'verbose':_0x178b71[_0x433666(0x11c)]}),_0x1b1827=_0x1ec02a[_0x433666(0xe6)],_0x28831e=await withSpinner(_0x433666(0xd2)+_0x2f5673+_0x433666(0x11d),()=>_0x4da5d3[_0x433666(0xdf)][_0x433666(0xf5)](_0x1b1827,_0x2f5673),{'verbose':_0x178b71[_0x433666(0x11c)]});_0x27f459=_0x28831e[_0x433666(0xe6)],_0x178b71[_0x433666(0x11c)]&&console[_0x433666(0x150)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x27f459);}const _0x4f0b3c={'name':_0x29c973,'description':_0x178b71[_0x433666(0x157)],'parentFolderId':_0x27f459},_0x3333f5=await withSpinner(_0x433666(0x156)+_0x29c973+_0x433666(0x11d),()=>_0x4da5d3[_0x433666(0xdf)][_0x433666(0x142)](_0x480af1,_0x4f0b3c),{'verbose':_0x178b71[_0x433666(0x11c)]}),_0x317fa0=_0x3333f5['data'];return console[_0x433666(0x150)](_0x433666(0x112)+_0x317fa0[_0x433666(0xe9)]+_0x433666(0x10f)+_0x317fa0['id']),await handleSDKOutput([_0x317fa0],_0x178b71),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x108244(0xe9)]=a25_0x108244(0x10d);[a25_0x108244(0x157)]=a25_0x108244(0x108);async[a25_0x108244(0x126)](_0x1be02b){const _0x4abc4e=a25_0x108244,{options:_0x198c96,args:_0x1ddd36,tdx:_0x1ac576}=_0x1be02b,_0x136d77=_0x1ddd36[0x0];if(!_0x136d77)return console[_0x4abc4e(0x150)](_0x4abc4e(0x155)),console['error']('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x4abc4e(0x150)](_0x4abc4e(0xf6)),console['error'](_0x4abc4e(0x139)),console['error'](_0x4abc4e(0xd7)),console[_0x4abc4e(0x150)](_0x4abc4e(0x14b)),console[_0x4abc4e(0x150)](_0x4abc4e(0xe8)),console[_0x4abc4e(0x150)](_0x4abc4e(0x166)),console[_0x4abc4e(0x150)](_0x4abc4e(0xf9)),console[_0x4abc4e(0x150)](_0x4abc4e(0xe4)),0x1;try{const _0x5634f8=_0x198c96['parentSegment'],_0x5afcc6=await resolveSegmentTarget(_0x136d77,_0x5634f8,_0x198c96['verbose']);_0x198c96[_0x4abc4e(0x11c)]&&console[_0x4abc4e(0x150)]('Target\x20path:\x20'+_0x5afcc6);const _0x3b17b2=await withSpinner(_0x4abc4e(0x154)+_0x136d77+_0x4abc4e(0x11d),()=>_0x1ac576[_0x4abc4e(0xdf)][_0x4abc4e(0xe1)](_0x5afcc6),{'verbose':_0x198c96['verbose']}),_0x23adc0=_0x3b17b2[_0x4abc4e(0xe6)];_0x198c96[_0x4abc4e(0x11c)]&&(console[_0x4abc4e(0x150)](_0x4abc4e(0xe7)+_0x23adc0[_0x4abc4e(0x110)]),console[_0x4abc4e(0x150)]('Parent\x20ID:\x20'+_0x23adc0[_0x4abc4e(0x130)]),_0x23adc0['folderId']&&console[_0x4abc4e(0x150)](_0x4abc4e(0xfe)+_0x23adc0[_0x4abc4e(0x117)]),_0x23adc0[_0x4abc4e(0x137)]&&console[_0x4abc4e(0x150)]('Segment\x20ID:\x20'+_0x23adc0['segmentId']));if(_0x198c96[_0x4abc4e(0x162)]){if(_0x23adc0['type']==='folder')return console['error']('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x23adc0[_0x4abc4e(0x110)]===_0x4abc4e(0x114))return console[_0x4abc4e(0x150)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4abc4e(0x150)](_0x4abc4e(0x12b)),0x1;if(!_0x23adc0[_0x4abc4e(0x137)])throw new SDKError(ErrorCode[_0x4abc4e(0x127)],_0x4abc4e(0x14c));const _0xd332a3=getConsoleNextUrl(_0x198c96[_0x4abc4e(0x10b)],_0x4abc4e(0x138)+_0x23adc0['parentId']+_0x4abc4e(0x148)+_0x23adc0[_0x4abc4e(0x137)]);return console[_0x4abc4e(0x150)](a25_0x28a98a[_0x4abc4e(0x168)]('✔')+_0x4abc4e(0xfb)+a25_0x28a98a[_0x4abc4e(0x13c)](_0xd332a3)),openBrowser(_0xd332a3),0x0;}if(_0x23adc0[_0x4abc4e(0x110)]===_0x4abc4e(0x12d)){if(!_0x23adc0[_0x4abc4e(0x117)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x4abc4e(0xf3));const _0xae9226=await withSpinner(_0x4abc4e(0xd0),()=>_0x1ac576[_0x4abc4e(0xdf)][_0x4abc4e(0xed)](_0x23adc0[_0x4abc4e(0x117)]),{'verbose':_0x198c96[_0x4abc4e(0x11c)]});await handleSingleObjectOutput(_0xae9226[_0x4abc4e(0xe6)],_0x198c96);}else{if(_0x23adc0[_0x4abc4e(0x110)]===_0x4abc4e(0xdf)){if(!_0x23adc0[_0x4abc4e(0x137)])throw new SDKError(ErrorCode[_0x4abc4e(0x127)],_0x4abc4e(0x14c));const _0x1f9430=await withSpinner(_0x4abc4e(0x132),()=>_0x1ac576['segment']['getSegment'](_0x23adc0['parentId'],_0x23adc0['segmentId']),{'verbose':_0x198c96['verbose']}),_0x3df509=getConsoleNextUrl(_0x198c96[_0x4abc4e(0x10b)],_0x4abc4e(0x138)+_0x23adc0[_0x4abc4e(0x130)]+_0x4abc4e(0x148)+_0x23adc0['segmentId']),_0x527300=_0x1f9430[_0x4abc4e(0xe6)];_0x527300[_0x4abc4e(0xd5)]=_0x3df509,await handleSingleObjectOutput(_0x527300,_0x198c96);}else return console[_0x4abc4e(0x150)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4abc4e(0x150)](_0x4abc4e(0x167)),0x1;}return 0x0;}catch(_0x3ca1c5){if(_0x3ca1c5 instanceof SDKError)return console[_0x4abc4e(0x150)](_0x4abc4e(0x113)+_0x3ca1c5['message']),_0x3ca1c5[_0x4abc4e(0x133)]&&console[_0x4abc4e(0x150)]('\x20\x20Cause:\x20'+_0x3ca1c5[_0x4abc4e(0x133)]),0x1;throw _0x3ca1c5;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x108244(0xe9)]=a25_0x108244(0x13d);['description']=a25_0x108244(0x134);async[a25_0x108244(0x126)](_0x58820a){const _0x22fc85=a25_0x108244,{options:_0x155f46,args:_0x445659,tdx:_0x3545a5}=_0x58820a,_0x4ef1ae=_0x445659[0x0];if(!_0x4ef1ae)return console['error'](_0x22fc85(0x11a)),console[_0x22fc85(0x150)](_0x22fc85(0x119)),console['error'](_0x22fc85(0xdd)),console[_0x22fc85(0x150)]('Examples:'),console[_0x22fc85(0x150)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x22fc85(0x150)](_0x22fc85(0x159)),0x1;try{const _0x3d79dc=_0x155f46[_0x22fc85(0x15b)],_0x1c041a=await resolveSegmentTarget(_0x4ef1ae,_0x3d79dc,_0x155f46['verbose']);_0x155f46[_0x22fc85(0x11c)]&&console[_0x22fc85(0x150)]('Target\x20path:\x20'+_0x1c041a);const _0x2bf635=await withSpinner(_0x22fc85(0x154)+_0x4ef1ae+_0x22fc85(0x11d),()=>_0x3545a5[_0x22fc85(0xdf)]['resolvePathToResource'](_0x1c041a),{'verbose':_0x155f46[_0x22fc85(0x11c)]}),_0x4d6e5b=_0x2bf635[_0x22fc85(0xe6)];_0x155f46['verbose']&&(console[_0x22fc85(0x150)](_0x22fc85(0xe7)+_0x4d6e5b[_0x22fc85(0x110)]),console['error'](_0x22fc85(0xd3)+_0x4d6e5b[_0x22fc85(0x130)]));if(_0x4d6e5b[_0x22fc85(0x110)]===_0x22fc85(0x12d))return console[_0x22fc85(0x150)](_0x22fc85(0x116)),console['error'](_0x22fc85(0x12e)),0x1;if(_0x4d6e5b[_0x22fc85(0x110)]===_0x22fc85(0x114))return console[_0x22fc85(0x150)](_0x22fc85(0x14f)),console['error'](_0x22fc85(0x153)),0x1;if(!_0x4d6e5b['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4278c2=await withSpinner(_0x22fc85(0xf2),()=>_0x3545a5[_0x22fc85(0xdf)][_0x22fc85(0xf8)](_0x4d6e5b[_0x22fc85(0x130)],_0x4d6e5b['segmentId']),{'verbose':_0x155f46['verbose']}),_0x538c04=_0x4278c2['data'],_0x11e115=await executeSchemaQuery(_0x538c04,_0x3545a5,_0x155f46);return await handleQueryOutput(_0x11e115,_0x155f46),0x0;}catch(_0x54ed35){if(_0x54ed35 instanceof SDKError)return console[_0x22fc85(0x150)](_0x22fc85(0x113)+_0x54ed35[_0x22fc85(0x13e)]),_0x54ed35[_0x22fc85(0x133)]&&console[_0x22fc85(0x150)](_0x22fc85(0x123)+_0x54ed35[_0x22fc85(0x133)]),0x1;throw _0x54ed35;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x503f39=a26_0x4d9e;(function(_0x5b22f9,_0x33bc5e){const _0x5798c9=a26_0x4d9e,_0x5b42c1=_0x5b22f9();while(!![]){try{const _0x42f720=parseInt(_0x5798c9(0x98))/0x1+parseInt(_0x5798c9(0x95))/0x2*(-parseInt(_0x5798c9(0xa2))/0x3)+parseInt(_0x5798c9(0x74))/0x4*(parseInt(_0x5798c9(0x75))/0x5)+-parseInt(_0x5798c9(0x8c))/0x6+parseInt(_0x5798c9(0x8f))/0x7*(parseInt(_0x5798c9(0xa1))/0x8)+-parseInt(_0x5798c9(0x82))/0x9+-parseInt(_0x5798c9(0x79))/0xa*(-parseInt(_0x5798c9(0x84))/0xb);if(_0x42f720===_0x33bc5e)break;else _0x5b42c1['push'](_0x5b42c1['shift']());}catch(_0x33670d){_0x5b42c1['push'](_0x5b42c1['shift']());}}}(a26_0x507a,0x875ce));function a26_0x507a(){const _0x6d94f3=['32ROXzvk','111ECzKBP','verbose','invisible','segments','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x27...','159924vjKwGz','35OdVvhC','data','Create\x20child\x20segment\x20with\x20filtering\x20rules','description','10zYrkkV','length','Resolving\x20folder\x20path\x20\x27','ruleFile','execute','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','error','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','3741129SwUDGo','Site:\x20','2177417yaKALP','segment:create','site','\x20\x20\x20Path:\x20','folder','Resolving\x20parent\x20segment\x20\x27','yellow','includes','2609172xKbFoh','Parent\x20path:\x20','Resolving\x20folder\x20\x27','6706IzFZEV','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','resolveFolderId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','kind','parent','7208nvFnWa','type','Segment\x20name:\x20','1056691fcCRkM','createSegment','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','rule','noCountPopulation','\x27\x20with\x20ID:\x20','✔\x20Created\x20segment\x20\x27','folderId'];a26_0x507a=function(){return _0x6d94f3;};return a26_0x507a();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x4d9e(_0x3099f5,_0x288a45){_0x3099f5=_0x3099f5-0x72;const _0x507a54=a26_0x507a();let _0x4d9e1e=_0x507a54[_0x3099f5];return _0x4d9e1e;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x561d2d from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a26_0x503f39(0x85);['description']=a26_0x503f39(0x77);async[a26_0x503f39(0x7d)](_0x4ec35c){const _0x425354=a26_0x503f39;console[_0x425354(0x80)](a26_0x561d2d[_0x425354(0x8a)](_0x425354(0x72))),console['error'](a26_0x561d2d[_0x425354(0x8a)](_0x425354(0x92)));const {options:_0x2fe7ec,args:_0x4c4983,tdx:_0x3ac729}=_0x4ec35c,_0x4f66a6=_0x2fe7ec;if(_0x4c4983[_0x425354(0x7a)]===0x0)return console[_0x425354(0x80)](_0x425354(0x7e)),console[_0x425354(0x80)](_0x425354(0x9b)),console['error']('Examples:'),console[_0x425354(0x80)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x425354(0x80)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3d34b3=_0x4c4983[0x0],_0x5ad497=_0x2fe7ec['segmentPath'];let _0x380831=_0x3d34b3;_0x5ad497&&!_0x3d34b3[_0x425354(0x8b)]('/')&&(_0x380831=_0x5ad497+'/'+_0x3d34b3,_0x4f66a6[_0x425354(0xa3)]&&console[_0x425354(0x80)]('Resolved\x20relative\x20path\x20to:\x20'+_0x380831));const _0x2a0b25=parsePath(_0x380831);if(_0x2a0b25[_0x425354(0xa5)][_0x425354(0x7a)]<0x2)return console['error'](_0x425354(0x90)),console[_0x425354(0x80)](_0x425354(0x81)),0x1;const _0x5d07b8=_0x2a0b25[_0x425354(0xa5)][0x0],_0x50bdd5=getBaseName(_0x380831),_0x5e0167=getParentPath(_0x380831);_0x4f66a6['verbose']&&(console[_0x425354(0x80)](_0x425354(0x83)+_0x4f66a6[_0x425354(0x86)]),console[_0x425354(0x80)]('Target\x20path:\x20'+_0x380831),console[_0x425354(0x80)]('Parent:\x20'+_0x5d07b8),console[_0x425354(0x80)](_0x425354(0x97)+_0x50bdd5),console[_0x425354(0x80)](_0x425354(0x8d)+_0x5e0167));const _0x70fe04=await withSpinner(_0x425354(0x89)+_0x5d07b8+_0x425354(0x73),()=>_0x3ac729['segment']['resolveParentId'](_0x5d07b8),{'verbose':_0x4f66a6[_0x425354(0xa3)]}),_0x50ef57=_0x70fe04[_0x425354(0x76)];let _0xd80cc9;if(_0x2a0b25[_0x425354(0xa5)][_0x425354(0x7a)]>0x2){const _0x52abae=await withSpinner(_0x425354(0x7b)+_0x5e0167+_0x425354(0x73),()=>_0x3ac729['segment']['resolvePathToResource'](_0x5e0167),{'verbose':_0x4f66a6[_0x425354(0xa3)]}),_0x208d3e=_0x52abae[_0x425354(0x76)];if(_0x208d3e[_0x425354(0x96)]!==_0x425354(0x88)&&_0x208d3e[_0x425354(0x96)]!==_0x425354(0x94))return console[_0x425354(0x80)](_0x425354(0x9a)),0x1;_0xd80cc9=_0x208d3e[_0x425354(0xa0)];}else{if(_0x4f66a6[_0x425354(0x88)]){const _0x5abba6=await withSpinner(_0x425354(0x8e)+_0x4f66a6[_0x425354(0x88)]+_0x425354(0x73),()=>_0x3ac729[_0x425354(0x7f)][_0x425354(0x91)](_0x50ef57,_0x4f66a6[_0x425354(0x88)]),{'verbose':_0x4f66a6['verbose']});_0xd80cc9=_0x5abba6[_0x425354(0x76)];}}_0x4f66a6['verbose']&&_0xd80cc9&&console['error']('Resolved\x20folder\x20ID:\x20'+_0xd80cc9);const _0x170f2f=await loadJSONFromOptions(_0x4f66a6[_0x425354(0x9c)],_0x4f66a6[_0x425354(0x7c)]),_0x47f785={'name':_0x50bdd5,'description':_0x4f66a6[_0x425354(0x78)],'rule':_0x170f2f,'kind':_0x4f66a6[_0x425354(0x93)]!==undefined?parseInt(_0x4f66a6[_0x425354(0x93)],0xa):undefined,'isVisible':_0x4f66a6[_0x425354(0xa4)]?![]:undefined,'segmentFolderId':_0xd80cc9,'countPopulation':_0x4f66a6[_0x425354(0x9d)]?![]:undefined},_0x2d3d77=await withSpinner('Creating\x20segment\x20\x27'+_0x50bdd5+_0x425354(0x73),()=>_0x3ac729[_0x425354(0x7f)][_0x425354(0x99)](_0x50ef57,_0x47f785),{'verbose':_0x4f66a6[_0x425354(0xa3)]}),_0x34a89c=_0x2d3d77[_0x425354(0x76)];return console[_0x425354(0x80)](_0x425354(0x9f)+_0x34a89c['name']+_0x425354(0x9e)+_0x34a89c['id']),_0x380831!==_0x3d34b3&&console['error'](_0x425354(0x87)+_0x380831),await handleSDKOutput([_0x34a89c],_0x4f66a6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x5122(){const _0x43acc0=['segment:fields','verbose','listFields','\x27...','1192264fLuGBq','length','Parent\x20segment:\x20','✔\x20Found\x20','jsonl','3102556FgpfKJ','data','6507020OelqZX','2272eLKBht','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','site','name','18LXYFAJ','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20field','4254774bwVYIH','3bDaqjV','5NBRWBs','execute','List\x20available\x20fields\x20for\x20segmentation','error','18158WDOBDo','32306791nnTHbR','307714qbkste'];a27_0x5122=function(){return _0x43acc0;};return a27_0x5122();}const a27_0x363a3b=a27_0x2d41;(function(_0x20775f,_0x2fa89d){const _0x21661f=a27_0x2d41,_0x57e13b=_0x20775f();while(!![]){try{const _0x579d04=parseInt(_0x21661f(0x199))/0x1+-parseInt(_0x21661f(0x19e))/0x2*(parseInt(_0x21661f(0x1af))/0x3)+parseInt(_0x21661f(0x1a3))/0x4*(parseInt(_0x21661f(0x1b0))/0x5)+-parseInt(_0x21661f(0x1ae))/0x6+parseInt(_0x21661f(0x197))/0x7*(-parseInt(_0x21661f(0x1a6))/0x8)+parseInt(_0x21661f(0x1ab))/0x9*(-parseInt(_0x21661f(0x1a5))/0xa)+parseInt(_0x21661f(0x198))/0xb;if(_0x579d04===_0x2fa89d)break;else _0x57e13b['push'](_0x57e13b['shift']());}catch(_0x1b7d9b){_0x57e13b['push'](_0x57e13b['shift']());}}}(a27_0x5122,0xa546d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a27_0x2d41(_0x24236c,_0x3c28ea){_0x24236c=_0x24236c-0x197;const _0x51227b=a27_0x5122();let _0x2d41f5=_0x51227b[_0x24236c];return _0x2d41f5;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x363a3b(0x1aa)]=a27_0x363a3b(0x19a);['description']=a27_0x363a3b(0x1b2);async[a27_0x363a3b(0x1b1)](_0x16c7c6){const _0x39d1ef=a27_0x363a3b,{options:_0x16c315,args:_0x4b04ab,tdx:_0xc8efbc}=_0x16c7c6,_0x466bfd=_0x4b04ab[0x0]||_0x16c315['parentSegment'];if(!_0x466bfd)return console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1ac)),console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a7)),console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a8)),0x1;_0x16c315[_0x39d1ef(0x19b)]&&(console[_0x39d1ef(0x1b3)]('Site:\x20'+_0x16c315[_0x39d1ef(0x1a9)]),console['error'](_0x39d1ef(0x1a0)+_0x466bfd));const _0xc9f7d1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x466bfd+_0x39d1ef(0x19d),()=>_0xc8efbc['segment'][_0x39d1ef(0x19c)](_0x466bfd),{'verbose':_0x16c315[_0x39d1ef(0x19b)]}),_0x46648f=_0xc9f7d1[_0x39d1ef(0x1a4)];console[_0x39d1ef(0x1b3)](_0x39d1ef(0x1a1)+_0x46648f[_0x39d1ef(0x19f)]+_0x39d1ef(0x1ad)+(_0x46648f['length']!==0x1?'s':''));if(_0x16c315['json']||_0x16c315[_0x39d1ef(0x1a2)])return await handleSDKOutput(_0x46648f,_0x16c315),0x0;return displayFieldsHumanReadable(_0x46648f,_0x466bfd),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a28_0xbf23c7=a28_0x1cb3;(function(_0x2190f1,_0xa1e8d2){const _0x171cbc=a28_0x1cb3,_0x556b5b=_0x2190f1();while(!![]){try{const _0x4deec6=parseInt(_0x171cbc(0xa0))/0x1+parseInt(_0x171cbc(0x96))/0x2+-parseInt(_0x171cbc(0x8f))/0x3*(parseInt(_0x171cbc(0x90))/0x4)+-parseInt(_0x171cbc(0xb9))/0x5*(parseInt(_0x171cbc(0xb5))/0x6)+parseInt(_0x171cbc(0xa4))/0x7+parseInt(_0x171cbc(0x9b))/0x8*(parseInt(_0x171cbc(0xc7))/0x9)+parseInt(_0x171cbc(0xd0))/0xa;if(_0x4deec6===_0xa1e8d2)break;else _0x556b5b['push'](_0x556b5b['shift']());}catch(_0x35cbb9){_0x556b5b['push'](_0x556b5b['shift']());}}}(a28_0x89d0,0x37482));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x1b2128 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x2b733b from'path';function a28_0x89d0(){const _0x59038a=['session','cyan','\x0aPull\x20summary\x20for\x20\x27','\x20new\x20files','\x20changed\x20files','segment:pull','verbose','parentName','dirname','\x20activations','12lfzSOi','✔\x20Context\x20set:\x20','content','absolutePath','531995VrHUSF','\x20files?','cwd','\x20versions)','targetDir','yellow','utf-8','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','length','name','\x20unchanged\x20files','execute','\x20\x20🎯\x20','repeat','1103373ZioUmu','filter','errorCode','error','description','no_parent','green','activations','dryRun','2048730wCOmzc','journeys','site','red','parent_segment','3XlwMnE','880652tUpNNK','Pulling\x20segments\x20from\x20\x27','\x27...','hasChanges','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dim','205956IwWvUk','Site:\x20','\x20=\x20','journeyVersions','\x20files\x20to\x20','16TFEHIe','\x20with\x20','Aborted.','\x20\x20🗺️\x20\x20','\x20segments','104329tgBbzF','isNew','helpText','segment','14147oOvKdn','counts','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20All\x20files\x20are\x20up\x20to\x20date','files','segments','\x20journeys'];a28_0x89d0=function(){return _0x59038a;};return a28_0x89d0();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x1cb3(_0x3fd6a6,_0x4f2524){_0x3fd6a6=_0x3fd6a6-0x8b;const _0x89d079=a28_0x89d0();let _0x1cb3b3=_0x89d079[_0x3fd6a6];return _0x1cb3b3;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0xbf23c7(0xc2)]=a28_0xbf23c7(0xb0);[a28_0xbf23c7(0xcb)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a28_0xbf23c7(0xc4)](_0x4183a3){const _0x3b1f6e=a28_0xbf23c7,{options:_0x4867d5,args:_0x5548db,tdx:_0x469067}=_0x4183a3,_0x498aca=_0x4867d5,_0x369e2d=await resolveTarget({'arg':_0x5548db[0x0],'contextParent':_0x4867d5['parentSegment'],'cwd':process[_0x3b1f6e(0xbb)]()});if(!isSuccessfulResolution(_0x369e2d))return _0x369e2d[_0x3b1f6e(0xc9)]===_0x3b1f6e(0xcc)?(console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0xc0))),console[_0x3b1f6e(0xca)]('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[_0x3b1f6e(0xca)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x3b1f6e(0xca)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0x8d)]('Error:\x20'+_0x369e2d['message']+'\x0a')),_0x369e2d[_0x3b1f6e(0xa2)]&&console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xac)](_0x369e2d[_0x3b1f6e(0xa2)]))),0x1;const _0x21ab83=_0x369e2d[_0x3b1f6e(0xb2)],_0x3dcf92=_0x369e2d[_0x3b1f6e(0xbd)];_0x498aca[_0x3b1f6e(0xb1)]&&(console[_0x3b1f6e(0xca)](_0x3b1f6e(0x97)+_0x498aca[_0x3b1f6e(0x8c)]),console[_0x3b1f6e(0xca)]('Parent\x20segment:\x20'+_0x21ab83));const _0x18e1f8=await withProgressSpinner(_0x3b1f6e(0x91)+_0x21ab83+_0x3b1f6e(0x92),_0x47cfeb=>_0x469067[_0x3b1f6e(0xa3)]['pullSegments'](_0x21ab83,{'targetDir':_0x3dcf92,'verbose':_0x498aca[_0x3b1f6e(0xb1)],'progress':{'update':_0x536c32=>{const _0x3fa684=_0x3b1f6e;_0x47cfeb['setPhase'](_0x536c32),_0x498aca[_0x3fa684(0xb1)]&&console[_0x3fa684(0xca)]('\x20\x20'+_0x536c32);}}}),{'verbose':_0x498aca[_0x3b1f6e(0xb1)]}),_0x154191=_0x18e1f8['data'];if(_0x154191[_0x3b1f6e(0xa5)]['segments']===0x0&&_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]===0x0)return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0x94)+_0x154191[_0x3b1f6e(0xb2)]+'\x27')),0x0;const _0x3d39a7=_0x154191['files'][_0x3b1f6e(0xc8)](_0x2c9cf5=>_0x2c9cf5['isNew']),_0x3680ef=_0x154191[_0x3b1f6e(0xa8)][_0x3b1f6e(0xc8)](_0x4ecbee=>!_0x4ecbee['isNew']&&_0x4ecbee[_0x3b1f6e(0x93)]),_0x119423=_0x154191[_0x3b1f6e(0xa8)][_0x3b1f6e(0xc8)](_0xdf84d6=>!_0xdf84d6[_0x3b1f6e(0xa1)]&&!_0xdf84d6[_0x3b1f6e(0x93)]);console[_0x3b1f6e(0xca)](_0x3b1f6e(0xad)+_0x154191[_0x3b1f6e(0xb2)]+'\x27:'),console['error'](_0x3b1f6e(0xc5)+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0xa9)]+_0x3b1f6e(0x9f))+_0x3b1f6e(0x9c)+a28_0x1b2128['cyan'](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0xce)]+_0x3b1f6e(0xb4)));if(_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]>0x0){const _0x2767b1=_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x99)]>_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]?'\x20('+_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x99)]+_0x3b1f6e(0xbc):'';console['error'](_0x3b1f6e(0x9e)+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xa5)][_0x3b1f6e(0x8b)]+_0x3b1f6e(0xaa))+a28_0x1b2128[_0x3b1f6e(0x95)](_0x2767b1));}console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128['green']('+\x20'+_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xae))),console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128['yellow']('~\x20'+_0x3680ef[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xaf))),console[_0x3b1f6e(0xca)]('\x20\x20'+a28_0x1b2128[_0x3b1f6e(0x95)]('=\x20'+_0x119423[_0x3b1f6e(0xc1)]+_0x3b1f6e(0xc3))),console[_0x3b1f6e(0xca)]('\x20\x20Target:\x20'+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191[_0x3b1f6e(0xbd)])+'\x0a');if(_0x3680ef[_0x3b1f6e(0xc1)]>0x0)for(const _0x3dd7ee of _0x3680ef){console['error']('\x0aChanges\x20to\x20\x27'+_0x3dd7ee['relativePath']+'\x27:'),console[_0x3b1f6e(0xca)]('─'[_0x3b1f6e(0xc6)](0x3c)),console['error'](_0x3dd7ee['diff']),console[_0x3b1f6e(0xca)]('─'['repeat'](0x3c));}if(_0x498aca[_0x3b1f6e(0xcf)])return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xbe)](_0x3b1f6e(0xa6))),0x0;if(_0x3d39a7['length']===0x0&&_0x3680ef[_0x3b1f6e(0xc1)]===0x0)return console['error'](a28_0x1b2128[_0x3b1f6e(0xcd)](_0x3b1f6e(0xa7))),saveSessionContext({'parent_segment':_0x154191[_0x3b1f6e(0xb2)]},_0x498aca[_0x3b1f6e(0xab)]),console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)]('✔\x20Context\x20set:\x20'+a28_0x1b2128[_0x3b1f6e(0x95)](_0x3b1f6e(0x8e))+'\x20=\x20'+a28_0x1b2128[_0x3b1f6e(0xac)](_0x154191['parentName']))),0x0;if(!_0x498aca['yes']){const _0x1e1d07=await confirmKey('Write\x20'+(_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3680ef[_0x3b1f6e(0xc1)])+_0x3b1f6e(0xba));if(!_0x1e1d07)return console[_0x3b1f6e(0xca)](_0x3b1f6e(0x9d)),0x1;}for(const _0xeeb4b9 of _0x154191['files']){if(_0xeeb4b9['isNew']||_0xeeb4b9['hasChanges']){const _0x1c90a6=a28_0x2b733b[_0x3b1f6e(0xb3)](_0xeeb4b9[_0x3b1f6e(0xb8)]);!existsSync(_0x1c90a6)&&mkdirSync(_0x1c90a6,{'recursive':!![]}),writeFileSync(_0xeeb4b9['absolutePath'],_0xeeb4b9[_0x3b1f6e(0xb7)],_0x3b1f6e(0xbf));}}return console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)]('✔\x20Pulled\x20'+(_0x3d39a7[_0x3b1f6e(0xc1)]+_0x3680ef[_0x3b1f6e(0xc1)])+_0x3b1f6e(0x9a)+_0x154191[_0x3b1f6e(0xbd)])),saveSessionContext({'parent_segment':_0x154191[_0x3b1f6e(0xb2)]},_0x498aca[_0x3b1f6e(0xab)]),console[_0x3b1f6e(0xca)](a28_0x1b2128[_0x3b1f6e(0xcd)](_0x3b1f6e(0xb6)+a28_0x1b2128[_0x3b1f6e(0x95)](_0x3b1f6e(0x8e))+_0x3b1f6e(0x98)+a28_0x1b2128['cyan'](_0x154191[_0x3b1f6e(0xb2)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x2c3d15=a29_0x3df0;(function(_0xb07671,_0x3e1c02){const _0x2e05be=a29_0x3df0,_0x4cdb95=_0xb07671();while(!![]){try{const _0xb6ed36=parseInt(_0x2e05be(0x211))/0x1*(-parseInt(_0x2e05be(0x236))/0x2)+parseInt(_0x2e05be(0x20b))/0x3*(-parseInt(_0x2e05be(0x1be))/0x4)+parseInt(_0x2e05be(0x21d))/0x5*(parseInt(_0x2e05be(0x22b))/0x6)+parseInt(_0x2e05be(0x238))/0x7+parseInt(_0x2e05be(0x201))/0x8*(parseInt(_0x2e05be(0x1bc))/0x9)+-parseInt(_0x2e05be(0x1f2))/0xa+parseInt(_0x2e05be(0x1e3))/0xb;if(_0xb6ed36===_0x3e1c02)break;else _0x4cdb95['push'](_0x4cdb95['shift']());}catch(_0x3bda17){_0x4cdb95['push'](_0x4cdb95['shift']());}}}(a29_0x53e8,0xcb0f2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x3df0(_0x5cee,_0xc73432){_0x5cee=_0x5cee-0x1b6;const _0x53e880=a29_0x53e8();let _0x3df09d=_0x53e880[_0x5cee];return _0x3df09d;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x57bff8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x53e8(){const _0x4ee03b=['nameToId','cyan','createdSegmentIds','journeys','resolveParentId','add','\x20to\x20delete','red','idToName','execute','description','getJourney','getOutputSchemaWithCache','filePath','\x20new','Changes\x20to:','\x20\x20Source:\x20','scopedFolderPath','activations','journey','folderId','message','new','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','25876818TldduZ','Push\x20','error','\x20to\x20create','name','green','\x0aPush\x20summary\x20for\x20\x27','Fetching\x20connections\x20for\x20name\x20resolution...','\x20to\x20update','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20📊\x20Segments:','Fetching\x20existing\x20folders...','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x0aValidation\x20failed:','15451680gikBjB','Preparing\x20journeys...','\x20changed','No\x20','\x20unchanged','Folders\x20to\x20create:','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/e/','/app/ps/','created','helpText','segment','\x20\x20Journeys:\x20','no_parent','104dvPXTJ','\x20\x20\x20\x20','site','Error:\x20Directory\x20not\x20found:\x20','attributes','verbose','yamlConfig','toDelete','errorCode','nameToType','75321wDXKoH','updated','get','connection','segments','type','1479585WMyRkW','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','then','Scoped\x20to\x20folder:\x20','journeyBundleName','results','Source\x20directory:\x20','Resolving\x20parent\x20segment\x20\x27','New\x20segment:','deleted','\x20\x20Segments:\x20','\x20activations]','7435GaBhRz','📁\x20','list','buildUserMaps','journeyBundleId','map','\x20updated','\x20created','user','listJourneysWithDetailsFromParentSegment','\x20\x20🗺️\x20\x20Journeys:','setPhase','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','folders','3162aGevGm','yellow','\x20folders\x20to\x20create','toUpdate','.yml','blue','parentFolder','\x20changes?','Aborted.','.yaml','segmentFolderId','2ptMGiy','folderPath','5163732HHMGWr','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','paused','listFolders','\x0a✔\x20Push\x20complete','join','existingJourney','segment\x20or\x20journey','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','segment:push','isNew','Fetching\x20existing\x20segments...','toString','dim','Delete\x20segment:','file','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filter','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','Fetching\x20existing\x20journeys...','New\x20journey:','length','set','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','parent_name','changed','unchanged','data','getParent','Changes\x20to\x20journey:','\x20YAML\x20files\x20found','\x20\x20Activations:','961416fRXktT','journeyId','224nwfeIi','push','/j/da/je','repeat','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Fetching\x20parent\x20segment\x20details...','createdAt','diff','delete','parentName','Error:\x20','\x27...','all'];a29_0x53e8=function(){return _0x4ee03b;};return a29_0x53e8();}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']=a29_0x2c3d15(0x241);[a29_0x2c3d15(0x1d5)]=a29_0x2c3d15(0x251);async[a29_0x2c3d15(0x1d4)](_0x141a60){const _0x564bf7=a29_0x2c3d15,{options:_0x364e84,args:_0x5cc4f4,tdx:_0x3e41d1}=_0x141a60,_0xbff4b2=_0x364e84,_0x4cc232=await resolveTarget({'arg':_0x5cc4f4[0x0],'contextParent':_0x364e84['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4cc232))return _0x4cc232[_0x564bf7(0x209)]===_0x564bf7(0x200)?(console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x564bf7(0x1e5)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x564bf7(0x1e5)](_0x564bf7(0x1f0)),console['error'](_0x564bf7(0x24c))):(console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x1c8)+_0x4cc232[_0x564bf7(0x1e0)]+'\x0a')),_0x4cc232[_0x564bf7(0x1fd)]&&console[_0x564bf7(0x1e5)](a29_0x57bff8['cyan'](_0x4cc232[_0x564bf7(0x1fd)]))),0x1;if(_0x4cc232[_0x564bf7(0x210)]===_0x564bf7(0x252))return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x204)+_0x4cc232[_0x564bf7(0x1ef)]+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1cc)](_0x564bf7(0x1f9))),0x1;const _0x1715fe=_0x4cc232[_0x564bf7(0x1c7)],_0x5319cf=_0x4cc232[_0x564bf7(0x1ef)],_0x31bb89=_0x4cc232[_0x564bf7(0x210)]===_0x564bf7(0x247)?_0x4cc232[_0x564bf7(0x1d8)]:undefined,_0x5c1d9a=getScopedDetails(_0x4cc232),_0x4c9c8d=_0x5c1d9a?.['isScoped']??![],_0x40e54b=_0x5c1d9a?.[_0x564bf7(0x1dc)]??'';if(!existsSync(_0x5319cf))return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x204)+_0x5319cf+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1cc)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0xbff4b2[_0x564bf7(0x206)]&&(console[_0x564bf7(0x1e5)]('Site:\x20'+_0xbff4b2[_0x564bf7(0x203)]),console[_0x564bf7(0x1e5)]('Parent\x20segment:\x20'+_0x1715fe),console[_0x564bf7(0x1e5)](_0x564bf7(0x217)+_0x5319cf),_0x4c9c8d&&console['error'](_0x564bf7(0x214)+_0x40e54b));const _0x3bd9b4=await withSpinner(_0x564bf7(0x218)+_0x1715fe+_0x564bf7(0x1c9),()=>_0x3e41d1['segment'][_0x564bf7(0x1cf)](_0x1715fe),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),_0x486b22=_0x3bd9b4[_0x564bf7(0x1b7)],[_0x349980,_0x916f4,_0x359655,_0x2e5060,_0x321f02]=await Promise[_0x564bf7(0x1ca)]([withSpinner(_0x564bf7(0x1c3),()=>_0x3e41d1[_0x564bf7(0x1fe)][_0x564bf7(0x1b8)](_0x486b22),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),withSpinner(_0x564bf7(0x243),()=>_0x3e41d1[_0x564bf7(0x1fe)]['listSegments'](_0x486b22),{'verbose':_0xbff4b2['verbose']}),withSpinner(_0x564bf7(0x1ee),()=>_0x3e41d1['segment'][_0x564bf7(0x23b)](_0x486b22),{'verbose':_0xbff4b2['verbose']}),withSpinner(_0x564bf7(0x24d),()=>_0x3e41d1[_0x564bf7(0x1de)][_0x564bf7(0x226)](_0x486b22),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x3e41d1[_0x564bf7(0x225)][_0x564bf7(0x220)](),{'verbose':_0xbff4b2[_0x564bf7(0x206)]})[_0x564bf7(0x213)](_0x33027f=>_0x33027f['data'])]),_0x4bca0b=_0x349980[_0x564bf7(0x1b7)],_0x4e3151=extractRootFolderId(_0x4bca0b),_0x5b957c=_0x916f4[_0x564bf7(0x1b7)],_0x3aad06=_0x359655[_0x564bf7(0x1b7)],{journeys:_0x432906,activationStepsById:_0x18f394}=_0x2e5060[_0x564bf7(0x1b7)],_0x16fbe7=new Map(_0x432906['map'](_0x59c444=>[_0x59c444['id'],_0x59c444])),_0x27be1b=_0x432906['map'](_0xc55420=>({'id':_0xc55420['id'],'name':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1e7)],'journeyBundleName':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x215)]||'','journeyBundleId':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x221)]||'','versionNumber':_0xc55420['attributes']['versionNumber'],'description':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1d5)],'state':_0xc55420[_0x564bf7(0x205)]['state'],'paused':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x23a)],'audienceId':_0xc55420[_0x564bf7(0x205)]['audienceId'],'folderId':_0xc55420['relationships']?.[_0x564bf7(0x231)]?.['data']?.['id'],'createdAt':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1c4)],'updatedAt':_0xc55420[_0x564bf7(0x205)]['updatedAt']})),{emailToId:_0x45d6fa,idToEmail:_0x18d96c}=_0x321f02,_0x5f46eb=await withSpinner(_0x564bf7(0x1ea),async()=>{const _0x55b53e=_0x564bf7,_0x140a65=await _0x3e41d1[_0x55b53e(0x20e)][_0x55b53e(0x21f)]();return buildConnectionMaps(_0x140a65);},{'verbose':_0xbff4b2['verbose']})[_0x564bf7(0x213)](_0x1511b8=>_0x1511b8['data']),_0x465c2f=_0x5f46eb['nameToId'],_0x3f55df=_0x5f46eb['idToName'],_0x51715e=_0x5f46eb[_0x564bf7(0x20a)],_0x3313df={'emailToIdMap':_0x45d6fa,'connectionNameToIdMap':_0x465c2f,'connectionNameToTypeMap':_0x51715e,'getSchema':_0x33685a=>_0x3e41d1[_0x564bf7(0x20e)][_0x564bf7(0x1d7)](_0x33685a)};let {pathToId:_0x1b75d9,idToPath:_0x305d57}=buildFolderMaps(_0x3aad06);const _0x47e3ed=buildSegmentLookupMap(_0x5b957c,_0x305d57),_0x5b61ff=buildSegmentNameToIdMap(_0x5b957c),_0x1f30e8=buildJourneyBundleLookupMap(_0x27be1b,_0x305d57);let _0x29ad8a;if(_0x31bb89){if(!_0x31bb89[_0x564bf7(0x24b)](_0x564bf7(0x22f))&&!_0x31bb89[_0x564bf7(0x24b)](_0x564bf7(0x234)))return console['error'](a29_0x57bff8['red'](_0x564bf7(0x1c2)+_0x31bb89+'\x0a')),0x1;_0x29ad8a=[_0x31bb89];}else _0x29ad8a=findYamlFiles(_0x5319cf);if(_0x29ad8a[_0x564bf7(0x24f)]===0x0)return console[_0x564bf7(0x1e5)](a29_0x57bff8['red'](_0x564bf7(0x249)+_0x5319cf+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8['cyan'](_0x564bf7(0x1ec))),0x1;let _0x15f949,_0x26f58a;try{const _0x3c1807=parseAndClassifyYamlFiles(_0x29ad8a,_0x5319cf,{'skipSegments':_0xbff4b2[_0x564bf7(0x248)]});_0x15f949=_0x3c1807[_0x564bf7(0x20f)],_0x26f58a=_0x3c1807[_0x564bf7(0x1ce)];const _0x11d696=validateParsedFiles(_0x3c1807,_0x5319cf);if(_0x11d696[_0x564bf7(0x24f)]>0x0)return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x1f1))),console[_0x564bf7(0x1e5)](formatValidationErrors(_0x11d696)),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x229))),0x1;}catch(_0x3bd83e){return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('Error\x20parsing\x20YAML:\x20'+(_0x3bd83e instanceof Error?_0x3bd83e['message']:_0x3bd83e))),0x1;}if(_0x15f949[_0x564bf7(0x24f)]===0x0&&_0x26f58a[_0x564bf7(0x24f)]===0x0){const _0x24d0ab=_0xbff4b2['journeysOnly']?_0x564bf7(0x1de):_0x564bf7(0x23f);return console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow'](_0x564bf7(0x1f5)+_0x24d0ab+_0x564bf7(0x1ba))),0x0;}const _0x4aca1c=new Map();_0x5b957c[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x5b957c,async _0x4ec704=>{const _0xb77b26=a29_0x3df0,_0x17bdf7=await _0x3e41d1[_0xb77b26(0x1fe)]['listActivations'](_0x486b22,_0x4ec704['id']);_0x4aca1c[_0xb77b26(0x250)](_0x4ec704['id'],_0x17bdf7);});},{'verbose':_0xbff4b2[_0x564bf7(0x206)]});const {segmentFiles:_0xd09378,foldersToCreate:_0x25bcdb}=await prepareSegmentFiles(_0x15f949,{'segmentByFolderAndName':_0x47e3ed,'activationsBySegmentId':_0x4aca1c,'folderPathToId':_0x1b75d9,'idToEmailMap':_0x18d96c,'connectionIdToNameMap':_0x3f55df},_0x3313df,_0x4c9c8d,_0x40e54b),_0x2ead6b=_0x31bb89?[]:findSegmentsToDelete(_0x5b957c,_0x15f949['map'](({yamlConfig:_0x425623,folderPath:_0x131ad3})=>({'yamlConfig':_0x425623,'folderPath':resolveTDFolderPath(_0x131ad3,_0x4c9c8d,_0x40e54b)})),_0x305d57,_0x40e54b,_0x4c9c8d),{journeyFiles:_0x2d98f9,foldersToCreate:_0x1ed6e1}=await withProgressSpinner(_0x564bf7(0x1f3),async _0x3c6370=>prepareJourneyFiles(_0x26f58a,{'fetchJourney':async _0xdb2ba7=>_0x3e41d1[_0x564bf7(0x1de)][_0x564bf7(0x1d6)](_0xdb2ba7[_0x564bf7(0x1bd)]),'journeyBundlesByFolderAndName':_0x1f30e8,'folderPathToId':_0x1b75d9,'idToEmailMap':_0x18d96c,'connectionIdToNameMap':_0x3f55df,'existingSegments':_0x5b957c,'parentId':_0x486b22,'deps':_0x3e41d1,'progress':{'update':_0x364d96=>{const _0x1abeb9=_0x564bf7;_0x3c6370[_0x1abeb9(0x228)](_0x364d96),_0xbff4b2[_0x1abeb9(0x206)]&&console[_0x1abeb9(0x1e5)]('\x20\x20'+_0x364d96);}},'journeyById':_0x16fbe7,'activationStepsById':_0x18f394},_0x4c9c8d,_0x40e54b),{'verbose':_0xbff4b2['verbose']})[_0x564bf7(0x213)](_0x43e49d=>_0x43e49d[_0x564bf7(0x1b7)]);for(const _0x9742bc of _0x1ed6e1){_0x25bcdb[_0x564bf7(0x1d0)](_0x9742bc);}const _0x3a93b1=_0x31bb89?[]:findJourneysToDelete(_0x27be1b,_0x26f58a[_0x564bf7(0x222)](({yamlConfig:_0x5489ae,folderPath:_0x16b23c})=>({'yamlConfig':_0x5489ae,'folderPath':resolveTDFolderPath(_0x16b23c,_0x4c9c8d,_0x40e54b)})),_0x305d57,_0x40e54b,_0x4c9c8d),_0x38609e=calculatePushStats(_0xd09378,_0x2d98f9,_0x25bcdb,_0x2ead6b,_0x3a93b1,!!_0xbff4b2[_0x564bf7(0x1c6)],!!_0xbff4b2[_0x564bf7(0x248)]),_0x23f765=_0x38609e['segments'][_0x564bf7(0x1e1)],_0x46774c=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x253)],_0x42e718=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x1b6)],_0x15e42c=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x208)],_0x4c0899=_0x38609e[_0x564bf7(0x22a)]['toCreate'],_0x5b17e6=_0x38609e[_0x564bf7(0x1ce)][_0x564bf7(0x1e1)],_0x3c3c7d=_0x38609e['journeys'][_0x564bf7(0x253)],_0x1badb2=_0x38609e[_0x564bf7(0x1ce)][_0x564bf7(0x1b6)],_0x1f2e89=_0x38609e[_0x564bf7(0x1ce)]['toDelete'],_0x6636b3=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x1ca)],_0x2db30c=_0x38609e['activations']['toCreate'],_0x277052=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x22e)],_0x2fcba0=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x208)];console[_0x564bf7(0x1e5)](_0x564bf7(0x1e9)+_0x1715fe+'\x27:');_0x4c0899[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x230)](_0x564bf7(0x21e)+_0x4c0899[_0x564bf7(0x24f)]+_0x564bf7(0x22d)));if(!_0xbff4b2[_0x564bf7(0x248)]){console['error'](_0x564bf7(0x1ed)),console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8['green']('+\x20'+_0x23f765[_0x564bf7(0x24f)]+_0x564bf7(0x1d9))),console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x46774c['length']+_0x564bf7(0x1f4)));if(_0x15e42c[_0x564bf7(0x24f)]>0x0)console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x15e42c[_0x564bf7(0x24f)]+'\x20to\x20delete'));else _0x2ead6b[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x1c6)]&&console['error'](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)](_0x2ead6b['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)]('=\x20'+_0x42e718[_0x564bf7(0x24f)]+'\x20unchanged'));}if(_0x2d98f9[_0x564bf7(0x24f)]>0x0||_0x3a93b1[_0x564bf7(0x24f)]>0x0){console[_0x564bf7(0x1e5)](_0x564bf7(0x227)),console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8['green']('+\x20'+_0x5b17e6[_0x564bf7(0x24f)]+'\x20new')),console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x3c3c7d[_0x564bf7(0x24f)]+'\x20changed'));if(_0x1f2e89[_0x564bf7(0x24f)]>0x0)console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x1f2e89[_0x564bf7(0x24f)]+'\x20to\x20delete'));else _0x3a93b1['length']>0x0&&!_0xbff4b2[_0x564bf7(0x1c6)]&&console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8['dim'](_0x3a93b1[_0x564bf7(0x24f)]+_0x564bf7(0x1e2)));console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)]('=\x20'+_0x1badb2[_0x564bf7(0x24f)]+_0x564bf7(0x1f6)));}_0x6636b3['length']>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&(console['error'](''),console['error'](_0x564bf7(0x1bb)),_0x2db30c['length']>0x0&&console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1e8)]('+\x20'+_0x2db30c['length']+_0x564bf7(0x1e6))),_0x277052[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x277052[_0x564bf7(0x24f)]+_0x564bf7(0x1eb))),_0x2fcba0[_0x564bf7(0x24f)]>0x0&&console['error'](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x2fcba0[_0x564bf7(0x24f)]+_0x564bf7(0x1d1))));console[_0x564bf7(0x1e5)](_0x564bf7(0x1db)+a29_0x57bff8['cyan'](_0x5319cf)+'\x0a');if(_0x4c0899[_0x564bf7(0x24f)]>0x0){console['error'](_0x564bf7(0x1f7));for(const _0x5c941d of _0x4c0899){console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x230)]('+')+'\x20'+_0x5c941d);}console[_0x564bf7(0x1e5)]('');}if(_0x23f765[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x3fe117 of _0x23f765){const _0x325345=_0x3fe117[_0x564bf7(0x237)]?_0x3fe117[_0x564bf7(0x237)]+'/'+_0x3fe117[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x3fe117[_0x564bf7(0x207)]['name'],_0x4f824b=_0x3fe117[_0x564bf7(0x207)][_0x564bf7(0x1dd)]?.[_0x564bf7(0x24f)]||0x0,_0x489c89=_0x4f824b>0x0?a29_0x57bff8['dim']('\x20['+_0x4f824b+'\x20activations]'):'';console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x1e8)](_0x564bf7(0x219))+'\x20'+_0x325345+_0x489c89),console['error']('─'[_0x564bf7(0x1c1)](0x3c)),_0x3fe117[_0x564bf7(0x1c5)]&&console['error'](_0x3fe117[_0x564bf7(0x1c5)]),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}if(_0x15e42c['length']>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x3e819d of _0x15e42c){const _0x5d5d9d=_0x3e819d[_0x564bf7(0x235)]?_0x305d57[_0x564bf7(0x20d)](_0x3e819d[_0x564bf7(0x235)][_0x564bf7(0x244)]())||'':'',_0x4e6f72=_0x5d5d9d?_0x5d5d9d+'/'+_0x3e819d['name']:_0x3e819d[_0x564bf7(0x1e7)],_0x241b53=_0x4aca1c['get'](_0x3e819d['id'])||[],_0x503cdb=_0x241b53[_0x564bf7(0x24f)]>0x0?a29_0x57bff8['dim']('\x20['+_0x241b53[_0x564bf7(0x24f)]+_0x564bf7(0x21c)):'';console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['red'](_0x564bf7(0x246))+'\x20'+_0x4e6f72+_0x503cdb),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c));const _0x402202=segmentWithActivationsToYaml(_0x3e819d,_0x241b53,undefined,_0x18d96c,_0x3f55df),_0x17c1f2=segmentToYamlString(_0x402202),_0x2d9058=generateDiff(_0x17c1f2,'');console['error'](formatDiffWithColors(_0x2d9058)),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}const _0x4a2bb5=_0xd09378[_0x564bf7(0x24a)](_0x319fe2=>!_0x319fe2[_0x564bf7(0x242)]&&_0x319fe2['diff']);if(_0x4a2bb5[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x4d3b88 of _0x4a2bb5){const _0x178543=_0x4d3b88[_0x564bf7(0x237)]?_0x4d3b88['folderPath']+'/'+_0x4d3b88[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x4d3b88[_0x564bf7(0x207)][_0x564bf7(0x1e7)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['yellow'](_0x564bf7(0x1da))+'\x20'+_0x178543),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c)),console[_0x564bf7(0x1e5)](_0x4d3b88[_0x564bf7(0x1c5)]),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c));}if(_0x5b17e6[_0x564bf7(0x24f)]>0x0)for(const _0x1dd694 of _0x5b17e6){const _0x3c51cb=_0x1dd694[_0x564bf7(0x237)]?_0x1dd694[_0x564bf7(0x237)]+'/'+_0x1dd694[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x1dd694['yamlConfig'][_0x564bf7(0x1e7)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['green'](_0x564bf7(0x24e))+'\x20'+_0x3c51cb),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c)),_0x1dd694[_0x564bf7(0x1c5)]&&console[_0x564bf7(0x1e5)](_0x1dd694[_0x564bf7(0x1c5)]),console['error']('─'[_0x564bf7(0x1c1)](0x3c));}const _0x5b32a1=_0x2d98f9[_0x564bf7(0x24a)](_0x4570f2=>!_0x4570f2[_0x564bf7(0x242)]&&_0x4570f2[_0x564bf7(0x1c5)]);if(_0x5b32a1[_0x564bf7(0x24f)]>0x0)for(const _0x4e4ecd of _0x5b32a1){const _0xe6b659=_0x4e4ecd[_0x564bf7(0x237)]?_0x4e4ecd[_0x564bf7(0x237)]+'/'+_0x4e4ecd['yamlConfig'][_0x564bf7(0x1e7)]:_0x4e4ecd[_0x564bf7(0x207)]['name'];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x1b9))+'\x20'+_0xe6b659),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c)),console[_0x564bf7(0x1e5)](_0x4e4ecd[_0x564bf7(0x1c5)]),console['error']('─'[_0x564bf7(0x1c1)](0x3c));}if(_0x1f2e89[_0x564bf7(0x24f)]>0x0)for(const _0x51ee0d of _0x1f2e89){const _0x426688=_0x51ee0d[_0x564bf7(0x1df)]?_0x305d57[_0x564bf7(0x20d)](_0x51ee0d[_0x564bf7(0x1df)])||'':'',_0x5ee445=_0x426688?_0x426688+'/'+_0x51ee0d[_0x564bf7(0x215)]:_0x51ee0d[_0x564bf7(0x215)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x1d2)]('Delete\x20journey:')+'\x20'+_0x5ee445),console['error']('─'[_0x564bf7(0x1c1)](0x3c)),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('(Journey\x20will\x20be\x20deleted)')),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}if(_0xbff4b2['dryRun'])return console['error'](a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x240))),0x0;const _0x1e8353=_0xbff4b2[_0x564bf7(0x248)]?![]:_0x23f765[_0x564bf7(0x24f)]>0x0||_0x46774c[_0x564bf7(0x24f)]>0x0||_0x15e42c[_0x564bf7(0x24f)]>0x0,_0x2faaa6=_0x5b17e6[_0x564bf7(0x24f)]>0x0||_0x3c3c7d['length']>0x0||_0x1f2e89[_0x564bf7(0x24f)]>0x0,_0x3c1cf0=_0xbff4b2['journeysOnly']?![]:_0x6636b3['length']>0x0,_0x1d1429=_0x4c0899['length']>0x0;if(!_0x1e8353&&!_0x2faaa6&&!_0x3c1cf0&&!_0x1d1429){const _0x2d4e49=_0xbff4b2[_0x564bf7(0x248)]?_0x564bf7(0x239):_0x564bf7(0x212);console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1e8)](_0x2d4e49));if(_0x31bb89&&_0x1badb2[_0x564bf7(0x24f)]===0x1){const _0x3788a3=_0x1badb2[0x0];if(_0x3788a3[_0x564bf7(0x23e)]?.['id']){const _0x4ca696=getConsoleNextUrl(_0xbff4b2[_0x564bf7(0x203)],_0x564bf7(0x1fb)+_0x486b22+_0x564bf7(0x1fa)+_0x3788a3[_0x564bf7(0x23e)]['id']+_0x564bf7(0x1c0));console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x1cc)](_0x4ca696));}}return 0x0;}const _0x4dae83=_0xbff4b2[_0x564bf7(0x248)]?_0x5b17e6[_0x564bf7(0x24f)]+_0x3c3c7d['length']+_0x1f2e89[_0x564bf7(0x24f)]+_0x4c0899[_0x564bf7(0x24f)]:_0x23f765[_0x564bf7(0x24f)]+_0x46774c[_0x564bf7(0x24f)]+_0x15e42c[_0x564bf7(0x24f)]+_0x5b17e6[_0x564bf7(0x24f)]+_0x3c3c7d[_0x564bf7(0x24f)]+_0x1f2e89[_0x564bf7(0x24f)]+_0x4c0899[_0x564bf7(0x24f)]+_0x6636b3[_0x564bf7(0x24f)];if(!_0xbff4b2['yes']&&_0x4dae83>0x0){const _0x5b93ff=await confirmKey(_0x564bf7(0x1e4)+_0x4dae83+_0x564bf7(0x232));if(!_0x5b93ff)return console[_0x564bf7(0x1e5)](_0x564bf7(0x233)),0x1;}const _0x1c0cd8={'withProgress':async(_0x3229ea,_0x22c69b)=>{const _0x317ab4=_0x564bf7,_0x500cc5=await withSpinner(_0x3229ea,_0x22c69b,{'verbose':_0xbff4b2[_0x317ab4(0x206)]});return{'data':_0x500cc5[_0x317ab4(0x1b7)]};},'logInfo':_0x4a6cd4=>console['error'](a29_0x57bff8[_0x564bf7(0x230)]('✔\x20'+_0x4a6cd4)),'logSuccess':_0x32986b=>console[_0x564bf7(0x1e5)](a29_0x57bff8['green']('✔\x20'+_0x32986b)),'logWarning':_0x4425a4=>console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow']('⚠\x20'+_0x4425a4)),'logDeleted':_0x327d9b=>console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('✔\x20'+_0x327d9b))},_0x26e833={'segment':_0x3e41d1[_0x564bf7(0x1fe)],'journey':_0x3e41d1['journey'],'user':_0x3e41d1[_0x564bf7(0x225)],'connection':_0x3e41d1[_0x564bf7(0x20e)]};_0x4c0899[_0x564bf7(0x24f)]>0x0&&(_0x1b75d9=await executePushFolders(_0x26e833,_0x4c0899,_0x1b75d9,{'parentId':_0x486b22},_0x1c0cd8));const _0x17336e={'rootFolderId':_0x4e3151,'folderPathToId':_0x1b75d9,'folderIdToPath':_0x305d57,'segmentNameToId':_0x5b61ff,'activationsBySegmentId':_0x4aca1c,'emailToIdMap':_0x45d6fa,'idToEmailMap':_0x18d96c,'connectionNameToIdMap':_0x5f46eb[_0x564bf7(0x1cb)],'connectionIdToNameMap':_0x5f46eb[_0x564bf7(0x1d3)],'connectionNameToTypeMap':_0x51715e},_0x57b598=await executePushSegments(_0x26e833,_0xbff4b2[_0x564bf7(0x248)]?[]:_0xd09378,_0x17336e,{'parentId':_0x486b22},_0x1c0cd8),_0x3ad85e=_0x57b598[_0x564bf7(0x1fc)],_0x53c002=_0x57b598[_0x564bf7(0x20c)],_0x40bf85=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x1fc)],_0x108434=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x20c)],_0x38dcec=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x21a)],_0x3981a4=await executePushSegmentDeletions(_0x26e833,_0xbff4b2[_0x564bf7(0x248)]?[]:_0x15e42c,_0x1c0cd8);let _0x21b865=0x0,_0x3d6f62=0x0,_0x509c88=0x0;const _0xc9eb6a=new Map(_0x5b61ff);for(const [_0x1b2e09,_0x3c92a4]of _0x57b598[_0x564bf7(0x1cd)]){_0xc9eb6a[_0x564bf7(0x250)](_0x1b2e09,_0x3c92a4);}if(_0x2d98f9['length']>0x0){const _0x529349={..._0x17336e,'segmentNameToId':_0xc9eb6a,'existingSegments':_0x5b957c,'activationContext':_0x3313df},_0xb12e38=await executePushJourneys(_0x26e833,_0x2d98f9,_0x529349,{'parentId':_0x486b22,'rootFolderId':_0x4e3151,'verbose':_0xbff4b2['verbose']},_0x1c0cd8);_0x21b865=_0xb12e38['created'],_0x3d6f62=_0xb12e38[_0x564bf7(0x20c)];if(_0x31bb89&&_0xb12e38[_0x564bf7(0x216)][_0x564bf7(0x24f)]===0x1){const _0x167f95=_0xb12e38['results'][0x0];if(_0x167f95[_0x564bf7(0x1bd)]){const _0x451610=getConsoleNextUrl(_0xbff4b2[_0x564bf7(0x203)],_0x564bf7(0x1fb)+_0x486b22+_0x564bf7(0x1fa)+_0x167f95['journeyId']+'/j/da/je');console['error']('\x20\x20'+a29_0x57bff8[_0x564bf7(0x1cc)](_0x451610));}}}for(const _0x2b8d6f of _0x1f2e89){console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x22c)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2b8d6f[_0x564bf7(0x215)])),_0x509c88++;}const _0x549aa0=[];if(_0x3ad85e>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x3ad85e+_0x564bf7(0x224));if(_0x53c002>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x53c002+'\x20updated');if(_0x3981a4>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x3981a4+'\x20deleted');const _0x3111b0=[];if(_0x21b865>0x0)_0x3111b0[_0x564bf7(0x1bf)](_0x21b865+_0x564bf7(0x224));if(_0x3d6f62>0x0)_0x3111b0['push'](_0x3d6f62+_0x564bf7(0x223));if(_0x509c88>0x0)_0x3111b0[_0x564bf7(0x1bf)](_0x509c88+'\x20deleted');const _0x437b4a=[];if(_0x40bf85>0x0)_0x437b4a['push'](_0x40bf85+_0x564bf7(0x224));if(_0x108434>0x0)_0x437b4a[_0x564bf7(0x1bf)](_0x108434+_0x564bf7(0x223));if(_0x38dcec>0x0)_0x437b4a[_0x564bf7(0x1bf)](_0x38dcec+_0x564bf7(0x1f8));return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1e8)](_0x564bf7(0x23c))),_0x549aa0[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&console[_0x564bf7(0x1e5)](_0x564bf7(0x21b)+_0x549aa0[_0x564bf7(0x23d)](',\x20')),_0x3111b0[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)](_0x564bf7(0x1ff)+_0x3111b0[_0x564bf7(0x23d)](',\x20')),_0x437b4a['length']>0x0&&!_0xbff4b2['journeysOnly']&&console[_0x564bf7(0x1e5)]('\x20\x20Activations:\x20'+_0x437b4a[_0x564bf7(0x23d)](',\x20')),0x0;}}
|
|
1
|
+
function a29_0x11e3(){const _0x30fa61=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Delete\x20journey:','\x20\x20Activations:','delete','(Journey\x20will\x20be\x20deleted)','293814XCArNY','folders','\x20activations]','Changes\x20to\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20unchanged','isScoped','Parent\x20segment:\x20','red','New\x20journey:','\x20\x20Journeys:\x20','buildUserMaps','message','join','87ZKrTpa','activations','folderPath','push','11qTLbeE','journeyBundleName','isNew','journeyId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Scoped\x20to\x20folder:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Source\x20directory:\x20','\x20\x20Activations:\x20','unchanged','execute','\x20changes?','/app/ps/','getParent','nameToId','map','updated','results','\x20folders\x20to\x20create','3558TxDWdt','Fetching\x20existing\x20segments...','\x0aValidation\x20failed:','site','list','\x20new','dim','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Preparing\x20journeys...','toDelete','\x20YAML\x20files\x20found','all','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','connection','new','listFolders','No\x20','dryRun','\x20\x20Segments:\x20','error','listActivations','Delete\x20segment:','\x27...','journeys','Resolving\x20parent\x20segment\x20\x27','folderId','journey','segments','attributes','Aborted.','/e/','segment','\x20created','\x20\x20\x20\x20','9HeLezq','type','\x20changed','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20folders...','yamlConfig','.yml','\x20to\x20update','paused','1279180Rthlew','get','toUpdate','journeyBundleId','4RZwMjG','cyan','name','state','blue','📁\x20','changed','no_parent','description','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','526812iFTUck','\x20deleted','\x20to\x20delete','filePath','1215730Sdfxkf','segmentFolderId','toString','set','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','length','createdSegmentIds','parentFolder','repeat','createdAt','updatedAt','Error\x20parsing\x20YAML:\x20','resolveParentId','data','Fetching\x20existing\x20activations...','user','existingJourney','\x0aPush\x20summary\x20for\x20\x27','add','yellow','Site:\x20','Fetching\x20parent\x20segment\x20details...','filter','then','versionNumber','Error:\x20Directory\x20not\x20found:\x20','17768chYFMm','file','Error:\x20','endsWith','New\x20segment:','green','errorCode','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','setPhase','segment\x20or\x20journey','verbose','getJourney','parent_name','Fetching\x20users\x20for\x20email\x20resolution...','\x20\x20📊\x20Segments:','journeysOnly','deleted','helpText','/j/da/je','1469265Axksuc','diff','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20to\x20create','\x20updated','listJourneysWithDetailsFromParentSegment','cwd','toCreate','targetDir','scopedFolderPath','nameToType'];a29_0x11e3=function(){return _0x30fa61;};return a29_0x11e3();}const a29_0x3a669c=a29_0x1808;(function(_0x247488,_0x21a216){const _0x4b31ce=a29_0x1808,_0x30e662=_0x247488();while(!![]){try{const _0x46c2c7=parseInt(_0x4b31ce(0x1e9))/0x1*(-parseInt(_0x4b31ce(0x200))/0x2)+parseInt(_0x4b31ce(0x239))/0x3+-parseInt(_0x4b31ce(0x22f))/0x4*(parseInt(_0x4b31ce(0x22b))/0x5)+parseInt(_0x4b31ce(0x1da))/0x6+parseInt(_0x4b31ce(0x1ca))/0x7+-parseInt(_0x4b31ce(0x1b7))/0x8*(parseInt(_0x4b31ce(0x222))/0x9)+parseInt(_0x4b31ce(0x23d))/0xa*(parseInt(_0x4b31ce(0x1ed))/0xb);if(_0x46c2c7===_0x21a216)break;else _0x30e662['push'](_0x30e662['shift']());}catch(_0x444395){_0x30e662['push'](_0x30e662['shift']());}}}(a29_0x11e3,0x22f6b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x3bbddb from'chalk';function a29_0x1808(_0x2dd087,_0x31d7cb){_0x2dd087=_0x2dd087-0x1a5;const _0x11e382=a29_0x11e3();let _0x180850=_0x11e382[_0x2dd087];return _0x180850;}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{[a29_0x3a669c(0x231)]='segment:push';['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a29_0x3a669c(0x1f7)](_0x199a15){const _0x515249=a29_0x3a669c,{options:_0x4fe2c2,args:_0x51de86,tdx:_0x298f1b}=_0x199a15,_0x4ccd95=_0x4fe2c2,_0x43636b=await resolveTarget({'arg':_0x51de86[0x0],'contextParent':_0x4fe2c2['parentSegment'],'cwd':process[_0x515249(0x1d0)]()});if(!isSuccessfulResolution(_0x43636b))return _0x43636b[_0x515249(0x1bd)]===_0x515249(0x236)?(console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x1f1))),console[_0x515249(0x213)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x515249(0x213)](_0x515249(0x1d5)),console['error'](_0x515249(0x1de))):(console['error'](a29_0x3bbddb['red'](_0x515249(0x1b9)+_0x43636b['message']+'\x0a')),_0x43636b[_0x515249(0x1c8)]&&console['error'](a29_0x3bbddb[_0x515249(0x230)](_0x43636b['helpText']))),0x1;if(_0x43636b[_0x515249(0x223)]===_0x515249(0x1c3))return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1b6)+_0x43636b[_0x515249(0x1d2)]+'\x0a')),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x230)](_0x515249(0x241))),0x1;const _0x577a22=_0x43636b['parentName'],_0xfb5e91=_0x43636b[_0x515249(0x1d2)],_0x474ed8=_0x43636b[_0x515249(0x223)]===_0x515249(0x1b8)?_0x43636b[_0x515249(0x23c)]:undefined,_0x4faf87=getScopedDetails(_0x43636b),_0x4eb55c=_0x4faf87?.[_0x515249(0x1e1)]??![],_0x5d8bf7=_0x4faf87?.[_0x515249(0x1d3)]??'';if(!existsSync(_0xfb5e91))return console['error'](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1b6)+_0xfb5e91+'\x0a')),console['error'](a29_0x3bbddb[_0x515249(0x230)](_0x515249(0x241))),0x1;_0x4ccd95[_0x515249(0x1c1)]&&(console[_0x515249(0x213)](_0x515249(0x1b1)+_0x4ccd95[_0x515249(0x203)]),console[_0x515249(0x213)](_0x515249(0x1e2)+_0x577a22),console[_0x515249(0x213)](_0x515249(0x1f4)+_0xfb5e91),_0x4eb55c&&console[_0x515249(0x213)](_0x515249(0x1f2)+_0x5d8bf7));const _0x418425=await withSpinner(_0x515249(0x218)+_0x577a22+_0x515249(0x216),()=>_0x298f1b['segment'][_0x515249(0x1a9)](_0x577a22),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),_0x3ce21d=_0x418425[_0x515249(0x1aa)],[_0x6e30e,_0x18e4d9,_0x25cddd,_0x50e29b,_0x341e91]=await Promise[_0x515249(0x20b)]([withSpinner(_0x515249(0x1b2),()=>_0x298f1b[_0x515249(0x21f)][_0x515249(0x1fa)](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x201),()=>_0x298f1b['segment']['listSegments'](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x226),()=>_0x298f1b['segment'][_0x515249(0x20f)](_0x3ce21d),{'verbose':_0x4ccd95['verbose']}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x298f1b[_0x515249(0x21a)][_0x515249(0x1cf)](_0x3ce21d),{'verbose':_0x4ccd95[_0x515249(0x1c1)]}),withSpinner(_0x515249(0x1c4),()=>_0x298f1b['user'][_0x515249(0x1e6)](),{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x514aba=>_0x514aba['data'])]),_0x2c60aa=_0x6e30e['data'],_0x57b03c=extractRootFolderId(_0x2c60aa),_0x88dfb2=_0x18e4d9[_0x515249(0x1aa)],_0x23b4fe=_0x25cddd[_0x515249(0x1aa)],{journeys:_0x36f1d7,activationStepsById:_0x56b680}=_0x50e29b[_0x515249(0x1aa)],_0x18d68e=new Map(_0x36f1d7['map'](_0x121018=>[_0x121018['id'],_0x121018])),_0xe2ff26=_0x36f1d7[_0x515249(0x1fc)](_0x2d4d8d=>({'id':_0x2d4d8d['id'],'name':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x231)],'journeyBundleName':_0x2d4d8d['attributes'][_0x515249(0x1ee)]||'','journeyBundleId':_0x2d4d8d['attributes'][_0x515249(0x22e)]||'','versionNumber':_0x2d4d8d['attributes'][_0x515249(0x1b5)],'description':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x237)],'state':_0x2d4d8d['attributes'][_0x515249(0x232)],'paused':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x22a)],'audienceId':_0x2d4d8d[_0x515249(0x21c)]['audienceId'],'folderId':_0x2d4d8d['relationships']?.[_0x515249(0x244)]?.[_0x515249(0x1aa)]?.['id'],'createdAt':_0x2d4d8d[_0x515249(0x21c)][_0x515249(0x1a6)],'updatedAt':_0x2d4d8d['attributes'][_0x515249(0x1a7)]})),{emailToId:_0x375ae0,idToEmail:_0x1d4c3b}=_0x341e91,_0xf86b85=await withSpinner(_0x515249(0x1f3),async()=>{const _0x5e1480=_0x515249,_0x1d534f=await _0x298f1b[_0x5e1480(0x20d)][_0x5e1480(0x204)]();return buildConnectionMaps(_0x1d534f);},{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x2ef9ee=>_0x2ef9ee[_0x515249(0x1aa)]),_0x308d3b=_0xf86b85[_0x515249(0x1fb)],_0x4b93f7=_0xf86b85['idToName'],_0x1c390c=_0xf86b85[_0x515249(0x1d4)],_0x6d306c={'emailToIdMap':_0x375ae0,'connectionNameToIdMap':_0x308d3b,'connectionNameToTypeMap':_0x1c390c,'getSchema':_0x29ef5c=>_0x298f1b[_0x515249(0x20d)]['getOutputSchemaWithCache'](_0x29ef5c)};let {pathToId:_0xf07735,idToPath:_0x48c8d0}=buildFolderMaps(_0x23b4fe);const _0x47ed5c=buildSegmentLookupMap(_0x88dfb2,_0x48c8d0),_0x5358c4=buildSegmentNameToIdMap(_0x88dfb2),_0x2baf70=buildJourneyBundleLookupMap(_0xe2ff26,_0x48c8d0);let _0x57cbf8;if(_0x474ed8){if(!_0x474ed8['endsWith'](_0x515249(0x228))&&!_0x474ed8[_0x515249(0x1ba)]('.yaml'))return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1cc)+_0x474ed8+'\x0a')),0x1;_0x57cbf8=[_0x474ed8];}else _0x57cbf8=findYamlFiles(_0xfb5e91);if(_0x57cbf8[_0x515249(0x242)]===0x0)return console[_0x515249(0x213)](a29_0x3bbddb['red'](_0x515249(0x1df)+_0xfb5e91+'\x0a')),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x230)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x414b9b,_0x33c5a6;try{const _0x11041c=parseAndClassifyYamlFiles(_0x57cbf8,_0xfb5e91,{'skipSegments':_0x4ccd95[_0x515249(0x1c6)]});_0x414b9b=_0x11041c['segments'],_0x33c5a6=_0x11041c[_0x515249(0x217)];const _0x1fce2b=validateParsedFiles(_0x11041c,_0xfb5e91);if(_0x1fce2b[_0x515249(0x242)]>0x0)return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x202))),console[_0x515249(0x213)](formatValidationErrors(_0x1fce2b)),console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xd7bec5){return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1a8)+(_0xd7bec5 instanceof Error?_0xd7bec5[_0x515249(0x1e7)]:_0xd7bec5))),0x1;}if(_0x414b9b[_0x515249(0x242)]===0x0&&_0x33c5a6[_0x515249(0x242)]===0x0){const _0x3d1c09=_0x4ccd95[_0x515249(0x1c6)]?_0x515249(0x21a):_0x515249(0x1c0);return console[_0x515249(0x213)](a29_0x3bbddb['yellow'](_0x515249(0x210)+_0x3d1c09+_0x515249(0x20a))),0x0;}const _0x5bf32d=new Map();_0x88dfb2[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&await withSpinner(_0x515249(0x1ab),async()=>{await batchAsync(_0x88dfb2,async _0x2b6c2e=>{const _0x20eddb=a29_0x1808,_0x2dc4de=await _0x298f1b['segment'][_0x20eddb(0x214)](_0x3ce21d,_0x2b6c2e['id']);_0x5bf32d[_0x20eddb(0x240)](_0x2b6c2e['id'],_0x2dc4de);});},{'verbose':_0x4ccd95[_0x515249(0x1c1)]});const {segmentFiles:_0x3b717d,foldersToCreate:_0x173156}=await prepareSegmentFiles(_0x414b9b,{'segmentByFolderAndName':_0x47ed5c,'activationsBySegmentId':_0x5bf32d,'folderPathToId':_0xf07735,'idToEmailMap':_0x1d4c3b,'connectionIdToNameMap':_0x4b93f7},_0x6d306c,_0x4eb55c,_0x5d8bf7),_0x2bdd7a=_0x474ed8?[]:findSegmentsToDelete(_0x88dfb2,_0x414b9b[_0x515249(0x1fc)](({yamlConfig:_0x47d41d,folderPath:_0x553e8b})=>({'yamlConfig':_0x47d41d,'folderPath':resolveTDFolderPath(_0x553e8b,_0x4eb55c,_0x5d8bf7)})),_0x48c8d0,_0x5d8bf7,_0x4eb55c),{journeyFiles:_0x24fcca,foldersToCreate:_0x201ac3}=await withProgressSpinner(_0x515249(0x208),async _0x5c3585=>prepareJourneyFiles(_0x33c5a6,{'fetchJourney':async _0x525c6e=>_0x298f1b[_0x515249(0x21a)][_0x515249(0x1c2)](_0x525c6e[_0x515249(0x1f0)]),'journeyBundlesByFolderAndName':_0x2baf70,'folderPathToId':_0xf07735,'idToEmailMap':_0x1d4c3b,'connectionIdToNameMap':_0x4b93f7,'existingSegments':_0x88dfb2,'parentId':_0x3ce21d,'deps':_0x298f1b,'progress':{'update':_0x426f23=>{const _0x3b988f=_0x515249;_0x5c3585[_0x3b988f(0x1bf)](_0x426f23),_0x4ccd95['verbose']&&console['error']('\x20\x20'+_0x426f23);}},'journeyById':_0x18d68e,'activationStepsById':_0x56b680},_0x4eb55c,_0x5d8bf7),{'verbose':_0x4ccd95[_0x515249(0x1c1)]})[_0x515249(0x1b4)](_0x5ca943=>_0x5ca943[_0x515249(0x1aa)]);for(const _0x4b2b2c of _0x201ac3){_0x173156[_0x515249(0x1af)](_0x4b2b2c);}const _0x2cf22d=_0x474ed8?[]:findJourneysToDelete(_0xe2ff26,_0x33c5a6[_0x515249(0x1fc)](({yamlConfig:_0x4a86a8,folderPath:_0x21f062})=>({'yamlConfig':_0x4a86a8,'folderPath':resolveTDFolderPath(_0x21f062,_0x4eb55c,_0x5d8bf7)})),_0x48c8d0,_0x5d8bf7,_0x4eb55c),_0x59c3f3=calculatePushStats(_0x3b717d,_0x24fcca,_0x173156,_0x2bdd7a,_0x2cf22d,!!_0x4ccd95[_0x515249(0x1d8)],!!_0x4ccd95[_0x515249(0x1c6)]),_0x32ad35=_0x59c3f3['segments'][_0x515249(0x20e)],_0x5e8417=_0x59c3f3[_0x515249(0x21b)]['changed'],_0x20f679=_0x59c3f3[_0x515249(0x21b)]['unchanged'],_0x4c01a5=_0x59c3f3[_0x515249(0x21b)]['toDelete'],_0x3b501b=_0x59c3f3[_0x515249(0x1db)][_0x515249(0x1d1)],_0x14a92d=_0x59c3f3[_0x515249(0x217)][_0x515249(0x20e)],_0x398faf=_0x59c3f3['journeys'][_0x515249(0x235)],_0x57e86e=_0x59c3f3[_0x515249(0x217)][_0x515249(0x1f6)],_0x1bab11=_0x59c3f3['journeys'][_0x515249(0x209)],_0x327864=_0x59c3f3[_0x515249(0x1ea)]['all'],_0x4452bf=_0x59c3f3[_0x515249(0x1ea)][_0x515249(0x1d1)],_0x4e7baa=_0x59c3f3[_0x515249(0x1ea)][_0x515249(0x22d)],_0x146651=_0x59c3f3['activations'][_0x515249(0x209)];console[_0x515249(0x213)](_0x515249(0x1ae)+_0x577a22+'\x27:');_0x3b501b[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x233)](_0x515249(0x234)+_0x3b501b[_0x515249(0x242)]+_0x515249(0x1ff)));if(!_0x4ccd95[_0x515249(0x1c6)]){console[_0x515249(0x213)](_0x515249(0x1c5)),console['error'](_0x515249(0x221)+a29_0x3bbddb['green']('+\x20'+_0x32ad35['length']+_0x515249(0x205))),console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1b0)]('~\x20'+_0x5e8417[_0x515249(0x242)]+_0x515249(0x224)));if(_0x4c01a5[_0x515249(0x242)]>0x0)console['error']('\x20\x20\x20\x20'+a29_0x3bbddb['red']('-\x20'+_0x4c01a5[_0x515249(0x242)]+_0x515249(0x23b)));else _0x2bdd7a[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1d8)]&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)](_0x2bdd7a[_0x515249(0x242)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x206)]('=\x20'+_0x20f679[_0x515249(0x242)]+'\x20unchanged'));}if(_0x24fcca['length']>0x0||_0x2cf22d['length']>0x0){console[_0x515249(0x213)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1bc)]('+\x20'+_0x14a92d[_0x515249(0x242)]+_0x515249(0x205))),console['error'](_0x515249(0x221)+a29_0x3bbddb['yellow']('~\x20'+_0x398faf[_0x515249(0x242)]+_0x515249(0x224)));if(_0x1bab11[_0x515249(0x242)]>0x0)console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x1e3)]('-\x20'+_0x1bab11[_0x515249(0x242)]+_0x515249(0x23b)));else _0x2cf22d[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1d8)]&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)](_0x2cf22d[_0x515249(0x242)]+_0x515249(0x207)));console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x206)]('=\x20'+_0x57e86e[_0x515249(0x242)]+_0x515249(0x1e0)));}_0x327864[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&(console['error'](''),console[_0x515249(0x213)](_0x515249(0x1d7)),_0x4452bf[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)](_0x515249(0x221)+a29_0x3bbddb['green']('+\x20'+_0x4452bf[_0x515249(0x242)]+_0x515249(0x1cd))),_0x4e7baa[_0x515249(0x242)]>0x0&&console[_0x515249(0x213)]('\x20\x20\x20\x20'+a29_0x3bbddb[_0x515249(0x1b0)]('~\x20'+_0x4e7baa['length']+_0x515249(0x229))),_0x146651[_0x515249(0x242)]>0x0&&console['error'](_0x515249(0x221)+a29_0x3bbddb[_0x515249(0x1e3)]('-\x20'+_0x146651[_0x515249(0x242)]+'\x20to\x20delete')));console[_0x515249(0x213)]('\x20\x20Source:\x20'+a29_0x3bbddb['cyan'](_0xfb5e91)+'\x0a');if(_0x3b501b['length']>0x0){console[_0x515249(0x213)]('Folders\x20to\x20create:');for(const _0x3f5d4d of _0x3b501b){console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x233)]('+')+'\x20'+_0x3f5d4d);}console['error']('');}if(_0x32ad35[_0x515249(0x242)]>0x0&&!_0x4ccd95[_0x515249(0x1c6)])for(const _0x1f3f25 of _0x32ad35){const _0x1a2371=_0x1f3f25[_0x515249(0x1eb)]?_0x1f3f25['folderPath']+'/'+_0x1f3f25[_0x515249(0x227)][_0x515249(0x231)]:_0x1f3f25[_0x515249(0x227)][_0x515249(0x231)],_0x41c355=_0x1f3f25['yamlConfig'][_0x515249(0x1ea)]?.[_0x515249(0x242)]||0x0,_0x48835d=_0x41c355>0x0?a29_0x3bbddb[_0x515249(0x206)]('\x20['+_0x41c355+_0x515249(0x1dc)):'';console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1bc)](_0x515249(0x1bb))+'\x20'+_0x1a2371+_0x48835d),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),_0x1f3f25[_0x515249(0x1cb)]&&console[_0x515249(0x213)](_0x1f3f25[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x4c01a5['length']>0x0&&!_0x4ccd95[_0x515249(0x1c6)])for(const _0x304771 of _0x4c01a5){const _0x3c8aa9=_0x304771[_0x515249(0x23e)]?_0x48c8d0[_0x515249(0x22c)](_0x304771['segmentFolderId'][_0x515249(0x23f)]())||'':'',_0xffd923=_0x3c8aa9?_0x3c8aa9+'/'+_0x304771[_0x515249(0x231)]:_0x304771[_0x515249(0x231)],_0x479760=_0x5bf32d[_0x515249(0x22c)](_0x304771['id'])||[],_0x56125f=_0x479760[_0x515249(0x242)]>0x0?a29_0x3bbddb['dim']('\x20['+_0x479760[_0x515249(0x242)]+_0x515249(0x1dc)):'';console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x215))+'\x20'+_0xffd923+_0x56125f),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));const _0x3968b2=segmentWithActivationsToYaml(_0x304771,_0x479760,undefined,_0x1d4c3b,_0x4b93f7),_0xfe12c1=segmentToYamlString(_0x3968b2),_0x4f4c01=generateDiff(_0xfe12c1,'');console[_0x515249(0x213)](formatDiffWithColors(_0x4f4c01)),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}const _0x5dd79e=_0x3b717d[_0x515249(0x1b3)](_0x373eec=>!_0x373eec[_0x515249(0x1ef)]&&_0x373eec[_0x515249(0x1cb)]);if(_0x5dd79e[_0x515249(0x242)]>0x0&&!_0x4ccd95['journeysOnly'])for(const _0x5651fc of _0x5dd79e){const _0x32452a=_0x5651fc[_0x515249(0x1eb)]?_0x5651fc['folderPath']+'/'+_0x5651fc['yamlConfig']['name']:_0x5651fc['yamlConfig']['name'];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1b0)]('Changes\x20to:')+'\x20'+_0x32452a),console['error']('─'[_0x515249(0x1a5)](0x3c)),console['error'](_0x5651fc[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x14a92d[_0x515249(0x242)]>0x0)for(const _0x40cc67 of _0x14a92d){const _0x4084d6=_0x40cc67[_0x515249(0x1eb)]?_0x40cc67['folderPath']+'/'+_0x40cc67[_0x515249(0x227)][_0x515249(0x231)]:_0x40cc67[_0x515249(0x227)][_0x515249(0x231)];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1bc)](_0x515249(0x1e4))+'\x20'+_0x4084d6),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),_0x40cc67[_0x515249(0x1cb)]&&console[_0x515249(0x213)](_0x40cc67[_0x515249(0x1cb)]),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}const _0x81a8d8=_0x24fcca[_0x515249(0x1b3)](_0x528fff=>!_0x528fff[_0x515249(0x1ef)]&&_0x528fff[_0x515249(0x1cb)]);if(_0x81a8d8[_0x515249(0x242)]>0x0)for(const _0xcfe54 of _0x81a8d8){const _0x3b0322=_0xcfe54[_0x515249(0x1eb)]?_0xcfe54[_0x515249(0x1eb)]+'/'+_0xcfe54[_0x515249(0x227)][_0x515249(0x231)]:_0xcfe54[_0x515249(0x227)]['name'];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x1dd))+'\x20'+_0x3b0322),console['error']('─'[_0x515249(0x1a5)](0x3c)),console[_0x515249(0x213)](_0xcfe54['diff']),console['error']('─'['repeat'](0x3c));}if(_0x1bab11[_0x515249(0x242)]>0x0)for(const _0x3a1793 of _0x1bab11){const _0x129e79=_0x3a1793[_0x515249(0x219)]?_0x48c8d0['get'](_0x3a1793[_0x515249(0x219)])||'':'',_0x4ca6d2=_0x129e79?_0x129e79+'/'+_0x3a1793[_0x515249(0x1ee)]:_0x3a1793[_0x515249(0x1ee)];console[_0x515249(0x213)]('\x0a'+a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1d6))+'\x20'+_0x4ca6d2),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c)),console['error'](a29_0x3bbddb[_0x515249(0x1e3)](_0x515249(0x1d9))),console[_0x515249(0x213)]('─'[_0x515249(0x1a5)](0x3c));}if(_0x4ccd95[_0x515249(0x211)])return console['error'](a29_0x3bbddb['yellow'](_0x515249(0x1be))),0x0;const _0xc213d7=_0x4ccd95[_0x515249(0x1c6)]?![]:_0x32ad35[_0x515249(0x242)]>0x0||_0x5e8417[_0x515249(0x242)]>0x0||_0x4c01a5['length']>0x0,_0x458dc8=_0x14a92d[_0x515249(0x242)]>0x0||_0x398faf[_0x515249(0x242)]>0x0||_0x1bab11['length']>0x0,_0x2b38f6=_0x4ccd95[_0x515249(0x1c6)]?![]:_0x327864[_0x515249(0x242)]>0x0,_0x4ca074=_0x3b501b[_0x515249(0x242)]>0x0;if(!_0xc213d7&&!_0x458dc8&&!_0x2b38f6&&!_0x4ca074){const _0x4c8df8=_0x4ccd95[_0x515249(0x1c6)]?_0x515249(0x225):_0x515249(0x238);console['error'](a29_0x3bbddb[_0x515249(0x1bc)](_0x4c8df8));if(_0x474ed8&&_0x57e86e[_0x515249(0x242)]===0x1){const _0x410828=_0x57e86e[0x0];if(_0x410828['existingJourney']?.['id']){const _0x407002=getConsoleNextUrl(_0x4ccd95['site'],'/app/ps/'+_0x3ce21d+_0x515249(0x21e)+_0x410828[_0x515249(0x1ad)]['id']+'/j/da/je');console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x230)](_0x407002));}}return 0x0;}const _0x3ecc57=_0x4ccd95[_0x515249(0x1c6)]?_0x14a92d[_0x515249(0x242)]+_0x398faf['length']+_0x1bab11[_0x515249(0x242)]+_0x3b501b['length']:_0x32ad35[_0x515249(0x242)]+_0x5e8417[_0x515249(0x242)]+_0x4c01a5['length']+_0x14a92d[_0x515249(0x242)]+_0x398faf[_0x515249(0x242)]+_0x1bab11[_0x515249(0x242)]+_0x3b501b[_0x515249(0x242)]+_0x327864['length'];if(!_0x4ccd95['yes']&&_0x3ecc57>0x0){const _0x2481ca=await confirmKey('Push\x20'+_0x3ecc57+_0x515249(0x1f8));if(!_0x2481ca)return console[_0x515249(0x213)](_0x515249(0x21d)),0x1;}const _0x30fddf={'withProgress':async(_0x1fec37,_0x5218f7)=>{const _0x23a8ae=_0x515249,_0x3c13c0=await withSpinner(_0x1fec37,_0x5218f7,{'verbose':_0x4ccd95[_0x23a8ae(0x1c1)]});return{'data':_0x3c13c0['data']};},'logInfo':_0x1a75bc=>console['error'](a29_0x3bbddb[_0x515249(0x233)]('✔\x20'+_0x1a75bc)),'logSuccess':_0x2dc798=>console['error'](a29_0x3bbddb[_0x515249(0x1bc)]('✔\x20'+_0x2dc798)),'logWarning':_0x3b15f2=>console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)]('⚠\x20'+_0x3b15f2)),'logDeleted':_0x59c049=>console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1e3)]('✔\x20'+_0x59c049))},_0x4d8878={'segment':_0x298f1b[_0x515249(0x21f)],'journey':_0x298f1b['journey'],'user':_0x298f1b[_0x515249(0x1ac)],'connection':_0x298f1b['connection']};_0x3b501b[_0x515249(0x242)]>0x0&&(_0xf07735=await executePushFolders(_0x4d8878,_0x3b501b,_0xf07735,{'parentId':_0x3ce21d},_0x30fddf));const _0x338256={'rootFolderId':_0x57b03c,'folderPathToId':_0xf07735,'folderIdToPath':_0x48c8d0,'segmentNameToId':_0x5358c4,'activationsBySegmentId':_0x5bf32d,'emailToIdMap':_0x375ae0,'idToEmailMap':_0x1d4c3b,'connectionNameToIdMap':_0xf86b85[_0x515249(0x1fb)],'connectionIdToNameMap':_0xf86b85['idToName'],'connectionNameToTypeMap':_0x1c390c},_0x4ec03b=await executePushSegments(_0x4d8878,_0x4ccd95['journeysOnly']?[]:_0x3b717d,_0x338256,{'parentId':_0x3ce21d},_0x30fddf),_0x3ece40=_0x4ec03b['created'],_0xf0739c=_0x4ec03b[_0x515249(0x1fd)],_0x58edb2=_0x4ec03b[_0x515249(0x1ea)]['created'],_0x296d34=_0x4ec03b[_0x515249(0x1ea)][_0x515249(0x1fd)],_0x513578=_0x4ec03b[_0x515249(0x1ea)][_0x515249(0x1c7)],_0x54ee35=await executePushSegmentDeletions(_0x4d8878,_0x4ccd95[_0x515249(0x1c6)]?[]:_0x4c01a5,_0x30fddf);let _0x3a0ea7=0x0,_0x6c993c=0x0,_0x54140e=0x0;const _0x55ea42=new Map(_0x5358c4);for(const [_0x10a09d,_0xa9a0cf]of _0x4ec03b[_0x515249(0x243)]){_0x55ea42[_0x515249(0x240)](_0x10a09d,_0xa9a0cf);}if(_0x24fcca[_0x515249(0x242)]>0x0){const _0x1bd056={..._0x338256,'segmentNameToId':_0x55ea42,'existingSegments':_0x88dfb2,'activationContext':_0x6d306c},_0x3aa464=await executePushJourneys(_0x4d8878,_0x24fcca,_0x1bd056,{'parentId':_0x3ce21d,'rootFolderId':_0x57b03c,'verbose':_0x4ccd95[_0x515249(0x1c1)]},_0x30fddf);_0x3a0ea7=_0x3aa464['created'],_0x6c993c=_0x3aa464[_0x515249(0x1fd)];if(_0x474ed8&&_0x3aa464['results'][_0x515249(0x242)]===0x1){const _0x5d22fc=_0x3aa464[_0x515249(0x1fe)][0x0];if(_0x5d22fc[_0x515249(0x1f0)]){const _0x22e033=getConsoleNextUrl(_0x4ccd95[_0x515249(0x203)],_0x515249(0x1f9)+_0x3ce21d+_0x515249(0x21e)+_0x5d22fc[_0x515249(0x1f0)]+_0x515249(0x1c9));console[_0x515249(0x213)]('\x20\x20'+a29_0x3bbddb[_0x515249(0x230)](_0x22e033));}}}for(const _0x5b72ae of _0x1bab11){console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1b0)](_0x515249(0x20c)+_0x5b72ae['journeyBundleName'])),_0x54140e++;}const _0x89ef05=[];if(_0x3ece40>0x0)_0x89ef05[_0x515249(0x1ec)](_0x3ece40+'\x20created');if(_0xf0739c>0x0)_0x89ef05[_0x515249(0x1ec)](_0xf0739c+_0x515249(0x1ce));if(_0x54ee35>0x0)_0x89ef05[_0x515249(0x1ec)](_0x54ee35+_0x515249(0x23a));const _0x4b2743=[];if(_0x3a0ea7>0x0)_0x4b2743[_0x515249(0x1ec)](_0x3a0ea7+_0x515249(0x220));if(_0x6c993c>0x0)_0x4b2743[_0x515249(0x1ec)](_0x6c993c+_0x515249(0x1ce));if(_0x54140e>0x0)_0x4b2743['push'](_0x54140e+_0x515249(0x23a));const _0x38d425=[];if(_0x58edb2>0x0)_0x38d425[_0x515249(0x1ec)](_0x58edb2+'\x20created');if(_0x296d34>0x0)_0x38d425[_0x515249(0x1ec)](_0x296d34+_0x515249(0x1ce));if(_0x513578>0x0)_0x38d425[_0x515249(0x1ec)](_0x513578+_0x515249(0x23a));return console[_0x515249(0x213)](a29_0x3bbddb[_0x515249(0x1bc)]('\x0a✔\x20Push\x20complete')),_0x89ef05[_0x515249(0x242)]>0x0&&!_0x4ccd95['journeysOnly']&&console[_0x515249(0x213)](_0x515249(0x212)+_0x89ef05[_0x515249(0x1e8)](',\x20')),_0x4b2743['length']>0x0&&console[_0x515249(0x213)](_0x515249(0x1e5)+_0x4b2743['join'](',\x20')),_0x38d425['length']>0x0&&!_0x4ccd95[_0x515249(0x1c6)]&&console['error'](_0x515249(0x1f5)+_0x38d425[_0x515249(0x1e8)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x181df4=a30_0xd639;(function(_0x154769,_0xe7a9e1){const _0x5ed08f=a30_0xd639,_0x5a4bf4=_0x154769();while(!![]){try{const _0x42c4c8=parseInt(_0x5ed08f(0xb3))/0x1+parseInt(_0x5ed08f(0xbc))/0x2*(parseInt(_0x5ed08f(0xb7))/0x3)+parseInt(_0x5ed08f(0xaf))/0x4+-parseInt(_0x5ed08f(0x9a))/0x5*(parseInt(_0x5ed08f(0x93))/0x6)+parseInt(_0x5ed08f(0xb2))/0x7+parseInt(_0x5ed08f(0x9f))/0x8*(parseInt(_0x5ed08f(0xa4))/0x9)+-parseInt(_0x5ed08f(0xbd))/0xa;if(_0x42c4c8===_0xe7a9e1)break;else _0x5a4bf4['push'](_0x5a4bf4['shift']());}catch(_0x3fdda6){_0x5a4bf4['push'](_0x5a4bf4['shift']());}}}(a30_0x35fa,0xd752a));import{BaseCommand}from'./command.js';function a30_0x35fa(){const _0x22bf9d=['yellow','5666899mNDVLQ','121302tLATVM','error','✔\x20Updated\x20segment\x20\x27','Examples:','114024gcUXuy','includes','Resolving\x20folder\x20\x27','segment:update','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','30GfuRiW','2767540DifhRX','name','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','execute','Segment\x20ID:\x20','27498ztlSVM','length','segmentId','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','INTERNAL','parentId','1785RMHAgK','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Parent\x20ID:\x20','Resolving\x20path\x20\x27','data','498928zQPjbO','type','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolveFolderId','resolvePathToResource','126ILTUKl','\x20\x20\x20Path:\x20','description','verbose','segment','Error:\x20Cannot\x20update\x20','\x27...','kind','Updating\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolved\x20relative\x20path\x20to:\x20','1682976aWskDj','Resolved\x20folder\x20ID:\x20'];a30_0x35fa=function(){return _0x22bf9d;};return a30_0x35fa();}function a30_0xd639(_0x29f9cd,_0x2a4f7e){_0x29f9cd=_0x29f9cd-0x8e;const _0x35fa2e=a30_0x35fa();let _0xd639ac=_0x35fa2e[_0x29f9cd];return _0xd639ac;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x5b91b0 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x181df4(0x8e)]=a30_0x181df4(0xba);[a30_0x181df4(0xa6)]='Update\x20existing\x20child\x20segment';async[a30_0x181df4(0x91)](_0x16ec6e){const _0x34c7f6=a30_0x181df4;console['error'](a30_0x5b91b0[_0x34c7f6(0xb1)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a30_0x5b91b0[_0x34c7f6(0xb1)](_0x34c7f6(0xad)));const {options:_0x25f3f6,args:_0xb18496,tdx:_0x4d936d}=_0x16ec6e,_0x5c721f=_0x25f3f6;if(_0xb18496[_0x34c7f6(0x94)]===0x0)return console[_0x34c7f6(0xb4)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x34c7f6(0xb4)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x34c7f6(0xb4)](_0x34c7f6(0xb6)),console['error'](_0x34c7f6(0xa1)),console['error'](_0x34c7f6(0x96)),0x1;const _0xc68ad2=_0xb18496[0x0],_0x3f5a78=_0x25f3f6['segmentPath'];let _0x3c7580=_0xc68ad2;_0x3f5a78&&!_0xc68ad2[_0x34c7f6(0xb8)]('/')&&(_0x3c7580=_0x3f5a78+'/'+_0xc68ad2,_0x5c721f[_0x34c7f6(0xa7)]&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xae)+_0x3c7580));const _0x33414f=await withSpinner(_0x34c7f6(0x9d)+_0x3c7580+_0x34c7f6(0xaa),()=>_0x4d936d['segment'][_0x34c7f6(0xa3)](_0x3c7580),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]}),_0x52bf2b=_0x33414f[_0x34c7f6(0x9e)];_0x5c721f[_0x34c7f6(0xa7)]&&console['error']('Resolved\x20type:\x20'+_0x52bf2b[_0x34c7f6(0xa0)]);if(_0x52bf2b['type']!==_0x34c7f6(0xa8))return console[_0x34c7f6(0xb4)](_0x34c7f6(0xa9)+_0x52bf2b[_0x34c7f6(0xa0)]+_0x34c7f6(0xbb)),console['error'](_0x34c7f6(0x9b)),0x1;if(!_0x52bf2b[_0x34c7f6(0x95)])throw new SDKError(ErrorCode[_0x34c7f6(0x98)],_0x34c7f6(0x8f));const _0x1bce85=_0x52bf2b[_0x34c7f6(0x99)],_0xb3893e=_0x52bf2b['segmentId'];_0x5c721f[_0x34c7f6(0xa7)]&&(console[_0x34c7f6(0xb4)](_0x34c7f6(0x9c)+_0x1bce85),console['error'](_0x34c7f6(0x92)+_0xb3893e));let _0x355846;if(_0x5c721f[_0x34c7f6(0x90)]){const _0x4e8799=_0x5c721f['folder'],_0x35489c=await withSpinner(_0x34c7f6(0xb9)+_0x4e8799+'\x27...',()=>_0x4d936d[_0x34c7f6(0xa8)][_0x34c7f6(0xa2)](_0x1bce85,_0x4e8799),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]});_0x355846=parseInt(_0x35489c[_0x34c7f6(0x9e)],0xa),_0x5c721f['verbose']&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xb0)+_0x355846);}const _0x5e955f=await loadJSONFromOptions(_0x5c721f['rule'],_0x5c721f['ruleFile']),_0x3ce591={'name':_0x5c721f['name'],'description':_0x5c721f[_0x34c7f6(0xa6)],'rule':_0x5e955f,'kind':_0x5c721f[_0x34c7f6(0xab)]!==undefined?parseInt(_0x5c721f[_0x34c7f6(0xab)],0xa):undefined,'segmentFolderId':_0x355846},_0x2f083c=await withSpinner(_0x34c7f6(0xac)+_0x52bf2b[_0x34c7f6(0x97)]+_0x34c7f6(0xaa),()=>_0x4d936d[_0x34c7f6(0xa8)]['updateSegmentById'](_0x1bce85,_0xb3893e,_0x3ce591),{'verbose':_0x5c721f[_0x34c7f6(0xa7)]}),_0x4e0960=_0x2f083c[_0x34c7f6(0x9e)];return console[_0x34c7f6(0xb4)](_0x34c7f6(0xb5)+_0x4e0960['name']+'\x27'),_0x3c7580!==_0xc68ad2&&console[_0x34c7f6(0xb4)](_0x34c7f6(0xa5)+_0x3c7580),await handleSDKOutput([_0x4e0960],_0x5c721f),0x0;}}
|