@treasuredata/tdx 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +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/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/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.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/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-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.d.ts +27 -20
- package/dist/sdk/llm.d.ts.map +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/llm.js.map +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.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.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.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/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a31_0x5ae9(_0x3c3b83,_0x4cac86){_0x3c3b83=_0x3c3b83-0x178;const _0x52a017=a31_0x52a0();let _0x5ae9fb=_0x52a017[_0x3c3b83];return _0x5ae9fb;}const a31_0x50d114=a31_0x5ae9;function a31_0x52a0(){const _0x4dfdd0=['execute','Catalog:\x20','10juXWgu','information_schema','setJobId','52479JOaSns','push','totalSplits','args','\x20rows\x20','No\x20SQL\x20provided','Executing\x20query\x20[','verbose','...','Site:\x20','state','660735yNouuP','in\x20','error','Statement\x20','query','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','\x20-\x20','originalMessage','6qUhrpB','elapsedTimeMillis','stats','14hVyjdo','Query\x20completed:\x20Processed\x20','Executing\x20query...','27884pOgavD','\x0aAll\x20results\x20saved\x20to\x20','file','output','catalog','processedRows','setExtra','\x20splits','setPhase','description','487984LBgtcC','jobId','6113943BKMMci','options','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','site','\x20[Job\x20ID:\x20','1375465UcQVbp','name','length','999400VTPCGE','join','message','data'];a31_0x52a0=function(){return _0x4dfdd0;};return a31_0x52a0();}(function(_0x354bf7,_0x4fd801){const _0x123940=a31_0x5ae9,_0x234113=_0x354bf7();while(!![]){try{const _0x3c611d=parseInt(_0x123940(0x18b))/0x1*(parseInt(_0x123940(0x188))/0x2)+parseInt(_0x123940(0x1a8))/0x3+parseInt(_0x123940(0x195))/0x4+parseInt(_0x123940(0x17d))/0x5+-parseInt(_0x123940(0x185))/0x6*(-parseInt(_0x123940(0x19c))/0x7)+parseInt(_0x123940(0x19f))/0x8+-parseInt(_0x123940(0x197))/0x9*(parseInt(_0x123940(0x1a5))/0xa);if(_0x3c611d===_0x4fd801)break;else _0x234113['push'](_0x234113['shift']());}catch(_0x254163){_0x234113['push'](_0x234113['shift']());}}}(a31_0x52a0,0x1a975));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a31_0x50d114(0x19d)]=a31_0x50d114(0x181);[a31_0x50d114(0x194)]='Run\x20Trino\x20queries\x20(streaming)';async[a31_0x50d114(0x1a3)](_0x4b73a9){const _0x11456b=a31_0x50d114,{options:_0x2b5075,args:_0x54e6c3,tdx:_0x227ffd}=_0x4b73a9,_0x49c7dd=_0x54e6c3[0x0],_0x379030=_0x2b5075[_0x11456b(0x18d)];let _0x1beb54;try{if(_0x379030)_0x1beb54=readSqlStatementsFromFile(_0x379030);else{if(_0x49c7dd==='-')_0x1beb54=await readSqlStatementsFromStdin();else{if(_0x49c7dd&&isSqlFilePath(_0x49c7dd))_0x1beb54=readSqlStatementsFromFile(_0x49c7dd);else{if(_0x49c7dd)_0x1beb54=splitSqlStatements(_0x49c7dd);else throw new Error(_0x11456b(0x1ad));}}}}catch(_0x2b9029){return console[_0x11456b(0x17f)]('Error:\x20'+_0x2b9029[_0x11456b(0x1a1)]),0x1;}const _0x3b01be=_0x2b5075['database']||_0x11456b(0x1a6),_0x808f3a=_0x2b5075[_0x11456b(0x18f)];try{const _0x4df070=[],_0x3854bf=!!_0x2b5075[_0x11456b(0x18e)];for(let _0x3cde3f=0x0;_0x3cde3f<_0x1beb54[_0x11456b(0x19e)];_0x3cde3f++){const _0x682a92=_0x1beb54[_0x3cde3f],_0x454ef2=_0x3cde3f+0x1,_0xb26daa=_0x1beb54['length'],_0x52bf25=_0xb26daa>0x1;_0x2b5075[_0x11456b(0x179)]&&(console[_0x11456b(0x17f)]('\x0a'+(_0x52bf25?'Statement\x20'+_0x454ef2+'/'+_0xb26daa+':':'')),console[_0x11456b(0x17f)](_0x11456b(0x17b)+_0x2b5075[_0x11456b(0x19a)]),console[_0x11456b(0x17f)](_0x11456b(0x1a4)+(_0x808f3a||'td')),console[_0x11456b(0x17f)]('Schema:\x20'+_0x3b01be),console['error']('SQL:\x20'+_0x682a92));const _0x59482=_0x52bf25?'Executing\x20statement\x20'+_0x454ef2+'/'+_0xb26daa+_0x11456b(0x17a):_0x11456b(0x18a);try{const _0x50e3f7=await withQuerySpinner(_0x59482,async _0x139c6c=>{const _0x2d269a=await _0x227ffd['query']['execute'](_0x682a92,{'catalog':_0x808f3a,'schema':_0x3b01be,'onJobId':_0x445ab3=>{const _0x532d33=a31_0x5ae9;_0x139c6c[_0x532d33(0x1a7)](_0x445ab3);},'onProgress':_0xddfe54=>{const _0x3dee44=a31_0x5ae9;_0x139c6c[_0x3dee44(0x193)](_0x3dee44(0x178)+_0xddfe54[_0x3dee44(0x17c)]+']'),_0x139c6c[_0x3dee44(0x191)](formatRows(_0xddfe54[_0x3dee44(0x190)])+_0x3dee44(0x1ac)+_0xddfe54['completedSplits']+'/'+_0xddfe54[_0x3dee44(0x1aa)]+_0x3dee44(0x192));}});return _0x2d269a;},{'verbose':_0x2b5075[_0x11456b(0x179)]}),_0x39dc36=_0x50e3f7[_0x11456b(0x1a2)],_0x42b51a=_0x39dc36[_0x11456b(0x196)]?_0x11456b(0x19b)+_0x39dc36[_0x11456b(0x196)]+']':'',_0x21086d=_0x52bf25?'Statement\x20'+_0x454ef2+'/'+_0xb26daa+_0x11456b(0x183):'';console[_0x11456b(0x17f)]('✔\x20'+_0x21086d+_0x11456b(0x189)+formatRows(_0x39dc36[_0x11456b(0x187)][_0x11456b(0x190)])+_0x11456b(0x1ac)+(_0x11456b(0x17e)+formatElapsed(_0x39dc36[_0x11456b(0x187)][_0x11456b(0x186)])+_0x42b51a));if(_0x52bf25&&_0x3854bf){const _0x4bba8c=resolveOutputOptions(_0x2b5075),_0xd64bd3=await formatQueryOutput(_0x39dc36,_0x4bba8c);_0x4df070[_0x11456b(0x1a9)](_0xd64bd3);}else await handleQueryOutput(_0x39dc36,_0x2b5075);}catch(_0x3094fe){const _0x49e756=_0x52bf25?_0x11456b(0x180)+_0x454ef2+'/'+_0xb26daa+':\x0a':'',_0x200dd1=_0x3094fe instanceof SDKError?_0x3094fe[_0x11456b(0x184)]:_0x3094fe[_0x11456b(0x1a1)];return console[_0x11456b(0x17f)](''+_0x49e756+_0x200dd1),0x1;}}if(_0x1beb54[_0x11456b(0x19e)]>0x1&&_0x3854bf&&_0x4df070[_0x11456b(0x19e)]>0x0){const _0x17b70f=_0x4df070[_0x11456b(0x1a0)]('\x0a');writeFileSync(_0x2b5075[_0x11456b(0x18e)],_0x17b70f),console[_0x11456b(0x17f)](_0x11456b(0x18c)+_0x2b5075['output']);}return 0x0;}catch(_0x280d7c){throw _0x280d7c;}}['validate'](_0x54fa42){const _0x481f86=a31_0x50d114,_0x30f6bc=_0x54fa42[_0x481f86(0x1ab)][0x0],_0x32b60c=_0x54fa42[_0x481f86(0x198)]['file'];if(!_0x30f6bc&&!_0x32b60c)return _0x481f86(0x199);if(_0x30f6bc&&_0x32b60c)return _0x481f86(0x182);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x413ad9=a32_0x50f8;(function(_0x317f71,_0x5c72d6){const _0x5a2e16=a32_0x50f8,_0x309fd6=_0x317f71();while(!![]){try{const _0x593d8a=parseInt(_0x5a2e16(0x136))/0x1*(-parseInt(_0x5a2e16(0x107))/0x2)+-parseInt(_0x5a2e16(0x104))/0x3+-parseInt(_0x5a2e16(0x15c))/0x4*(parseInt(_0x5a2e16(0x133))/0x5)+parseInt(_0x5a2e16(0x110))/0x6*(-parseInt(_0x5a2e16(0xca))/0x7)+parseInt(_0x5a2e16(0xde))/0x8*(-parseInt(_0x5a2e16(0x103))/0x9)+-parseInt(_0x5a2e16(0xcf))/0xa*(-parseInt(_0x5a2e16(0x153))/0xb)+parseInt(_0x5a2e16(0x11b))/0xc;if(_0x593d8a===_0x5c72d6)break;else _0x309fd6['push'](_0x309fd6['shift']());}catch(_0xa8d2e3){_0x309fd6['push'](_0x309fd6['shift']());}}}(a32_0x8792,0x60613));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0x56ea1f from'chalk';function a32_0x50f8(_0x390fc2,_0x3b5b92){_0x390fc2=_0x390fc2-0xc9;const _0x87924a=a32_0x8792();let _0x50f85c=_0x87924a[_0x390fc2];return _0x50f85c;}function resolveSegmentTarget(_0x2299b7,_0x4f787,_0x789469){const _0x187501=a32_0x50f8;if(isYamlFilePath(_0x2299b7))try{const _0x12153c=resolveYamlFilePath(_0x2299b7);return _0x789469&&(console[_0x187501(0x12c)](_0x187501(0x137)+_0x2299b7),console[_0x187501(0x12c)](_0x187501(0x146)+_0x12153c[_0x187501(0x164)]),console[_0x187501(0x12c)](_0x187501(0xd5)+_0x12153c['segmentName']),console[_0x187501(0x12c)](_0x187501(0x135)+(_0x12153c[_0x187501(0xf2)]||_0x187501(0xcd))),console['error']('\x20\x20Full\x20path:\x20'+_0x12153c[_0x187501(0xd9)])),_0x12153c['fullPath'];}catch(_0xd7aa34){throw new SDKError(ErrorCode[_0x187501(0x112)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xd7aa34[_0x187501(0x147)]);}if(!_0x4f787)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x187501(0x15d));return _0x4f787+'/'+_0x2299b7;}function a32_0x8792(){const _0x4198f0=['Site:\x20','data','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','site','folderPath','stats','✔\x20Found\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20show','length','Create\x20segment\x20folder\x20for\x20organization','log','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','parentFolder','SELECT\x20*\x20FROM\x20(\x0a','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20view','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:describe','Use:\x20tdx\x20ps\x20view\x20-w','7461ECjbIC','1636002VjBaNW','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','8486QOjhnU','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20','Parent\x20name:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Folder\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','6fVjtbB','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','INVALID_ARGUMENT','SEGMENT_NOT_FOUND','Options:','limit','web','Use:\x20tdx\x20ps\x20sql','Parent\x20ID:\x20','/app/ps/','url','33563340HntlDw','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','elapsedTimeMillis','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','verbose','Fetching\x20segment\x20details...','Fetching\x20folder\x20\x27','✔\x20Created\x20folder\x20\x27','\x20rows\x20','Resolved\x20parent\x20folder\x20ID:\x20','Segment\x20ID:\x20','format','segment:folder:show','\x27...','Show\x20child\x20segment\x20schema\x20(column\x20types)','execute','error','Resolved\x20folder\x20ID:\x20','Listing\x20folders\x20for\x20parent\x20\x27','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','query','type','includes','1355xdHHxa','name','\x20\x20Folder\x20path:\x20','93rtpxuL','Resolved\x20YAML\x20file:\x20','Show\x20segment\x20folder\x20details','Use:\x20tdx\x20ps\x20desc','segmentId','description','Parent\x20segment:\x20','jsonl','Resolved\x20parent\x20ID:\x20','segment:desc','Error:\x20Folder\x20reference\x20is\x20required','segment','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','listFolders','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','getSegmentSQL','\x20\x20Parent\x20segment:\x20','message','Target\x20path:\x20','cyan','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved\x20relative\x20path\x20to:\x20','green','cause','SEGMENT_FOLDER_NOT_FOUND','processedRows','json','segment:sql','resolveFolderId','3729pkVVXk','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','parentId','Creating\x20folder\x20\x27','folderId','Folder\x20name:\x20','/e/','segment:view','7628dPYLBu','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','getParent','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','resolveParentId','SQL\x20query:\x0a','parentSegment','resolvePathToResource','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','5221328LpurPq','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','(root)','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','6610DxFhON','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','replace','folder','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20Segment\x20name:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20[Job\x20ID:\x20','parent','fullPath','getSegment','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','Show\x20folder\x20or\x20child\x20segment\x20details','4088UnVBzh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Fetching\x20SQL\x20for\x20segment...','✔\x20Query\x20completed:\x20Processed\x20','jobId','Examples:','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20Opening\x20','Resolved\x20type:\x20','\x20\x20Cause:\x20','in\x20','getFolder','segment:folder:create','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a32_0x8792=function(){return _0x4198f0;};return a32_0x8792();}export class SegmentDescribeCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x101);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0xfe);async[a32_0x413ad9(0x12b)](_0x2cab24){const _0x458ecd=a32_0x413ad9,{options:_0x597858,args:_0x207b03,tdx:_0x280b2a}=_0x2cab24,_0x112d62=_0x207b03[0x0],_0x2ab8c1=!_0x112d62&&!!_0x597858[_0x458ecd(0x164)],_0x578c99=_0x112d62||_0x597858[_0x458ecd(0x164)];if(!_0x578c99)return console[_0x458ecd(0x12c)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x458ecd(0x12c)](_0x458ecd(0xdc)),console[_0x458ecd(0x12c)](_0x458ecd(0xe3)),console['error'](_0x458ecd(0xd1)),console[_0x458ecd(0x12c)](_0x458ecd(0x100)),console[_0x458ecd(0x12c)](_0x458ecd(0xf5)),console[_0x458ecd(0x12c)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x21ed39=_0x597858['segmentPath'];let _0x22a917=_0x578c99;!_0x2ab8c1&&_0x21ed39&&!_0x578c99[_0x458ecd(0x132)]('/')&&(_0x22a917=_0x21ed39+'/'+_0x578c99,_0x597858[_0x458ecd(0x120)]&&console['error'](_0x458ecd(0x14b)+_0x22a917));const _0x4ad6bd=await withSpinner('Resolving\x20path\x20\x27'+_0x22a917+'\x27...',()=>_0x280b2a[_0x458ecd(0x141)][_0x458ecd(0x165)](_0x22a917),{'verbose':_0x597858['verbose']}),_0x3dc0dc=_0x4ad6bd[_0x458ecd(0xee)];_0x597858[_0x458ecd(0x120)]&&(console['error'](_0x458ecd(0xe7)+_0x3dc0dc[_0x458ecd(0x131)]),console[_0x458ecd(0x12c)]('Parent\x20ID:\x20'+_0x3dc0dc['parentId']),_0x3dc0dc['folderId']&&console[_0x458ecd(0x12c)](_0x458ecd(0x10e)+_0x3dc0dc[_0x458ecd(0x158)]),_0x3dc0dc[_0x458ecd(0x13a)]&&console[_0x458ecd(0x12c)](_0x458ecd(0x126)+_0x3dc0dc[_0x458ecd(0x13a)]));if(_0x3dc0dc[_0x458ecd(0x131)]===_0x458ecd(0xd8)){const _0x1d5298=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x280b2a['segment'][_0x458ecd(0x160)](_0x3dc0dc[_0x458ecd(0x156)]),{'verbose':_0x597858[_0x458ecd(0x120)]});await handleSingleObjectOutput(_0x1d5298[_0x458ecd(0xee)],_0x597858);}else{if(_0x3dc0dc[_0x458ecd(0x131)]===_0x458ecd(0xd3)){if(!_0x3dc0dc[_0x458ecd(0x158)])throw new SDKError(ErrorCode[_0x458ecd(0x14e)],_0x458ecd(0x108));const _0x2e3747=await withSpinner(_0x458ecd(0x105),()=>_0x280b2a[_0x458ecd(0x141)][_0x458ecd(0xea)](_0x3dc0dc[_0x458ecd(0x158)]),{'verbose':_0x597858[_0x458ecd(0x120)]});await handleSingleObjectOutput(_0x2e3747[_0x458ecd(0xee)],_0x597858);}else{if(_0x3dc0dc['type']===_0x458ecd(0x141)){if(!_0x3dc0dc['segmentId'])throw new SDKError(ErrorCode[_0x458ecd(0x113)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x125152=await withSpinner('Fetching\x20segment\x20details...',()=>_0x280b2a['segment']['getSegment'](_0x3dc0dc[_0x458ecd(0x156)],_0x3dc0dc[_0x458ecd(0x13a)]),{'verbose':_0x597858['verbose']});await handleSingleObjectOutput(_0x125152[_0x458ecd(0xee)],_0x597858);}}}return 0x0;}catch(_0x229f71){if(_0x229f71 instanceof SDKError)return console['error'](_0x458ecd(0x10a)+_0x229f71['message']),_0x229f71[_0x458ecd(0x14d)]&&console[_0x458ecd(0x12c)](_0x458ecd(0xe8)+_0x229f71['cause']),0x1;throw _0x229f71;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x413ad9(0x134)]='segment:show';[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x14a);async['execute'](_0x16b212){const _0x159e89=a32_0x413ad9,{options:_0x340e96,args:_0x1d1d6b,tdx:_0x4bcd28}=_0x16b212,_0x1db9c1=_0x1d1d6b[0x0];if(!_0x1db9c1)return console['error'](_0x159e89(0x155)),console[_0x159e89(0x12c)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x159e89(0x12c)](_0x159e89(0xf0)),console['error'](_0x159e89(0xe3)),console['error'](_0x159e89(0x11c)),console[_0x159e89(0x12c)](_0x159e89(0x10c)),0x1;try{const _0x482fa1=_0x340e96[_0x159e89(0x164)],_0x5da0fc=resolveSegmentTarget(_0x1db9c1,_0x482fa1,_0x340e96[_0x159e89(0x120)]);_0x340e96[_0x159e89(0x120)]&&console[_0x159e89(0x12c)](_0x159e89(0x148)+_0x5da0fc);const _0x4b4c89=await withSpinner(_0x159e89(0x15e)+_0x1db9c1+_0x159e89(0x129),()=>_0x4bcd28[_0x159e89(0x141)]['resolvePathToResource'](_0x5da0fc),{'verbose':_0x340e96[_0x159e89(0x120)]}),_0x1f9ba5=_0x4b4c89[_0x159e89(0xee)];_0x340e96[_0x159e89(0x120)]&&(console[_0x159e89(0x12c)](_0x159e89(0xe7)+_0x1f9ba5[_0x159e89(0x131)]),console[_0x159e89(0x12c)](_0x159e89(0x118)+_0x1f9ba5['parentId']));if(_0x1f9ba5[_0x159e89(0x131)]===_0x159e89(0xd3))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x159e89(0x12c)](_0x159e89(0xd0)),0x1;if(_0x1f9ba5[_0x159e89(0x131)]===_0x159e89(0xd8))return console[_0x159e89(0x12c)](_0x159e89(0x11f)),console[_0x159e89(0x12c)](_0x159e89(0xf6)),0x1;if(!_0x1f9ba5['segmentId'])throw new SDKError(ErrorCode[_0x159e89(0x113)],_0x159e89(0xec));const _0x114a73=await withSpinner(_0x159e89(0xe0),()=>_0x4bcd28[_0x159e89(0x141)][_0x159e89(0x145)](_0x1f9ba5[_0x159e89(0x156)],_0x1f9ba5['segmentId']),{'verbose':_0x340e96[_0x159e89(0x120)]});let _0x413afc=_0x114a73[_0x159e89(0xee)];const _0x3b2461=resolveLimit(_0x340e96[_0x159e89(0x115)],DEFAULT_DISPLAY_LIMIT),_0x12efd7=/\bLIMIT\s+\d+/i['test'](_0x413afc);!_0x12efd7&&(_0x413afc=_0x413afc['trim']()[_0x159e89(0xd2)](/;+$/,''),_0x413afc=_0x159e89(0xfd)+_0x413afc+_0x159e89(0x109)+_0x3b2461);_0x340e96[_0x159e89(0x120)]&&console[_0x159e89(0x12c)](_0x159e89(0x163)+_0x413afc);const _0x4f246e=await withQuerySpinner('Executing\x20segment\x20query...',async _0x481693=>{const _0x246156=_0x159e89,_0x97f4f1=await _0x4bcd28[_0x246156(0x130)][_0x246156(0x12b)](_0x413afc,{'catalog':'td','schema':'information_schema','onJobId':_0x2b60b1=>{_0x481693['setJobId'](_0x2b60b1);}});return _0x97f4f1;},{'verbose':_0x340e96[_0x159e89(0x120)]}),_0x3f8a35=_0x4f246e[_0x159e89(0xee)],_0x5d88b9=_0x3f8a35['jobId']?_0x159e89(0xd7)+_0x3f8a35[_0x159e89(0xe2)]+']':'';return console[_0x159e89(0x12c)](_0x159e89(0xe1)+_0x3f8a35['stats'][_0x159e89(0x14f)]['toLocaleString']()+_0x159e89(0x124)+(_0x159e89(0xe9)+formatElapsed(_0x3f8a35[_0x159e89(0xf3)][_0x159e89(0x11d)])+_0x5d88b9)),await handleQueryOutput(_0x3f8a35,_0x340e96),0x0;}catch(_0x3c8912){if(_0x3c8912 instanceof SDKError)return console[_0x159e89(0x12c)]('✖\x20Query\x20failed\x20['+_0x3c8912['code']+']'),console[_0x159e89(0x12c)]('\x0a'+_0x3c8912[_0x159e89(0x147)]),0x1;throw _0x3c8912;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0xcb);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x12f);async[a32_0x413ad9(0x12b)](_0x537c92){const _0x235a51=a32_0x413ad9,{options:_0x3fc3ba,args:_0x49dd29,tdx:_0x52f9f6}=_0x537c92;if(_0x49dd29[_0x235a51(0xf7)]===0x0)return console[_0x235a51(0x12c)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x235a51(0x12c)](_0x235a51(0x15f)),0x1;const _0x5dd55e=_0x49dd29[0x0];try{_0x3fc3ba[_0x235a51(0x120)]&&(console[_0x235a51(0x12c)](_0x235a51(0xed)+_0x3fc3ba['site']),console[_0x235a51(0x12c)](_0x235a51(0x10b)+_0x5dd55e));const _0x52670a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5dd55e+_0x235a51(0x129),()=>_0x52f9f6[_0x235a51(0x141)][_0x235a51(0x162)](_0x5dd55e),{'verbose':_0x3fc3ba[_0x235a51(0x120)]}),_0x23eaad=_0x52670a['data'];_0x3fc3ba[_0x235a51(0x120)]&&console[_0x235a51(0x12c)](_0x235a51(0x13e)+_0x23eaad);const _0x3721c2=await withSpinner(_0x235a51(0x12e)+_0x5dd55e+_0x235a51(0x129),()=>_0x52f9f6[_0x235a51(0x141)][_0x235a51(0x143)](_0x23eaad),{'verbose':_0x3fc3ba[_0x235a51(0x120)]}),_0x105f1c=_0x3721c2[_0x235a51(0xee)];return console[_0x235a51(0x12c)](_0x235a51(0xf4)+_0x105f1c['length']+'\x20folder'+(_0x105f1c[_0x235a51(0xf7)]!==0x1?'s':'')),await handleSDKOutput(_0x105f1c,_0x3fc3ba),0x0;}catch(_0x19c4c3){if(_0x19c4c3 instanceof SDKError)return console[_0x235a51(0x12c)](_0x235a51(0x10a)+_0x19c4c3['message']),_0x19c4c3[_0x235a51(0x14d)]&&console[_0x235a51(0x12c)](_0x235a51(0xe8)+_0x19c4c3['cause']),0x1;throw _0x19c4c3;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x128);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x138);async[a32_0x413ad9(0x12b)](_0x155163){const _0x372608=a32_0x413ad9,{options:_0x110f5e,args:_0x26b145,tdx:_0x3aac45}=_0x155163;if(_0x26b145[_0x372608(0xf7)]===0x0)return console[_0x372608(0x12c)](_0x372608(0x140)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x7b522e,childId:_0x521c33}=parseSegmentRef(_0x26b145[0x0]);_0x110f5e[_0x372608(0x120)]&&(console[_0x372608(0x12c)](_0x372608(0xed)+_0x110f5e[_0x372608(0xf1)]),console[_0x372608(0x12c)](_0x372608(0x10b)+_0x7b522e),_0x521c33&&console['error'](_0x372608(0x159)+_0x521c33));if(!_0x521c33)return console[_0x372608(0x12c)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x5c7af3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x7b522e+_0x372608(0x129),()=>_0x3aac45[_0x372608(0x141)][_0x372608(0x162)](_0x7b522e),{'verbose':_0x110f5e[_0x372608(0x120)]}),_0x57dfeb=_0x5c7af3['data'];_0x110f5e[_0x372608(0x120)]&&console[_0x372608(0x12c)](_0x372608(0x13e)+_0x57dfeb);const _0x4c7e58=await withSpinner('Resolving\x20folder\x20\x27'+_0x521c33+_0x372608(0x129),()=>_0x3aac45[_0x372608(0x141)][_0x372608(0x152)](_0x57dfeb,_0x521c33),{'verbose':_0x110f5e[_0x372608(0x120)]}),_0x78a3da=_0x4c7e58['data'];_0x110f5e[_0x372608(0x120)]&&console[_0x372608(0x12c)](_0x372608(0x12d)+_0x78a3da);const _0x9e74e8=await withSpinner(_0x372608(0x122)+_0x521c33+_0x372608(0x129),()=>_0x3aac45[_0x372608(0x141)][_0x372608(0xea)](_0x78a3da),{'verbose':_0x110f5e['verbose']});return await handleSDKOutput([_0x9e74e8[_0x372608(0xee)]],_0x110f5e),0x0;}catch(_0x10f100){if(_0x10f100 instanceof SDKError)return console['error'](_0x372608(0x10a)+_0x10f100[_0x372608(0x147)]),_0x10f100[_0x372608(0x14d)]&&console[_0x372608(0x12c)](_0x372608(0xe8)+_0x10f100[_0x372608(0x14d)]),0x1;throw _0x10f100;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x151);['description']=a32_0x413ad9(0xd6);async[a32_0x413ad9(0x12b)](_0x3a235c){const _0x477fc4=a32_0x413ad9,{options:_0x2a7599,args:_0x1449b7,tdx:_0x13094f}=_0x3a235c,_0x2be35d=_0x1449b7[0x0];if(!_0x2be35d)return console[_0x477fc4(0x12c)](_0x477fc4(0x155)),console[_0x477fc4(0x12c)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x477fc4(0xfb)),console['error'](_0x477fc4(0xe3)),console['error'](_0x477fc4(0x144)),console['error'](_0x477fc4(0x161)),0x1;try{const _0x4f306f=_0x2a7599[_0x477fc4(0x164)],_0x19369b=resolveSegmentTarget(_0x2be35d,_0x4f306f,_0x2a7599[_0x477fc4(0x120)]);_0x2a7599[_0x477fc4(0x120)]&&console[_0x477fc4(0x12c)](_0x477fc4(0x148)+_0x19369b);const _0x564710=await withSpinner(_0x477fc4(0x15e)+_0x2be35d+_0x477fc4(0x129),()=>_0x13094f[_0x477fc4(0x141)][_0x477fc4(0x165)](_0x19369b),{'verbose':_0x2a7599[_0x477fc4(0x120)]}),_0xb3f3ef=_0x564710['data'];_0x2a7599[_0x477fc4(0x120)]&&(console[_0x477fc4(0x12c)]('Resolved\x20type:\x20'+_0xb3f3ef[_0x477fc4(0x131)]),console[_0x477fc4(0x12c)](_0x477fc4(0x118)+_0xb3f3ef[_0x477fc4(0x156)]));if(_0xb3f3ef[_0x477fc4(0x131)]===_0x477fc4(0xd3))return console[_0x477fc4(0x12c)](_0x477fc4(0xfa)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xb3f3ef['type']===_0x477fc4(0xd8))return console[_0x477fc4(0x12c)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x477fc4(0x117)),0x1;if(!_0xb3f3ef['segmentId'])throw new SDKError(ErrorCode[_0x477fc4(0x113)],_0x477fc4(0xec));const _0x170fb7=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x13094f[_0x477fc4(0x141)][_0x477fc4(0x145)](_0xb3f3ef[_0x477fc4(0x156)],_0xb3f3ef[_0x477fc4(0x13a)]),{'verbose':_0x2a7599[_0x477fc4(0x120)]}),_0x1a057b=_0x170fb7['data'];return _0x2a7599[_0x477fc4(0x127)]===_0x477fc4(0x150)||_0x2a7599[_0x477fc4(0x127)]===_0x477fc4(0x13d)?await handleSDKOutput([{'sql':_0x1a057b}],_0x2a7599):console[_0x477fc4(0xf9)](_0x1a057b),0x0;}catch(_0x2c35d3){if(_0x2c35d3 instanceof SDKError)return console[_0x477fc4(0x12c)](_0x477fc4(0x10a)+_0x2c35d3[_0x477fc4(0x147)]),_0x2c35d3[_0x477fc4(0x14d)]&&console[_0x477fc4(0x12c)](_0x477fc4(0xe8)+_0x2c35d3[_0x477fc4(0x14d)]),0x1;throw _0x2c35d3;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a32_0x413ad9(0xeb);['description']=a32_0x413ad9(0xf8);async[a32_0x413ad9(0x12b)](_0x450f2c){const _0x56b22d=a32_0x413ad9,{options:_0x4d9a7a,args:_0x3533f1,tdx:_0x169fc7}=_0x450f2c,_0x353073=_0x4d9a7a;if(_0x3533f1[_0x56b22d(0xf7)]<0x2)return console[_0x56b22d(0x12c)](_0x56b22d(0xd4)),console[_0x56b22d(0x12c)](_0x56b22d(0xcc)),0x1;const _0x3e8fb4=_0x3533f1[0x0],_0x4b157f=_0x3533f1[0x1];_0x353073[_0x56b22d(0x120)]&&(console[_0x56b22d(0x12c)](_0x56b22d(0xed)+_0x353073[_0x56b22d(0xf1)]),console[_0x56b22d(0x12c)](_0x56b22d(0x13c)+_0x3e8fb4),console[_0x56b22d(0x12c)](_0x56b22d(0x159)+_0x4b157f));let _0x27c4fc;if(_0x353073[_0x56b22d(0xfc)]){const _0x1bc503=_0x353073[_0x56b22d(0xfc)],_0x32f42a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3e8fb4+'\x27...',()=>_0x169fc7[_0x56b22d(0x141)][_0x56b22d(0x162)](_0x3e8fb4),{'verbose':_0x353073[_0x56b22d(0x120)]}),_0x4a0ba1=_0x32f42a[_0x56b22d(0xee)],_0x45119a=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x1bc503+'\x27...',()=>_0x169fc7[_0x56b22d(0x141)][_0x56b22d(0x152)](_0x4a0ba1,_0x1bc503),{'verbose':_0x353073[_0x56b22d(0x120)]});_0x27c4fc=_0x45119a[_0x56b22d(0xee)],_0x353073['verbose']&&console[_0x56b22d(0x12c)](_0x56b22d(0x125)+_0x27c4fc);}const _0x11bba1={'name':_0x4b157f,'description':_0x353073[_0x56b22d(0x13b)],'parentFolderId':_0x27c4fc},_0x3bfd7f=await withSpinner(_0x56b22d(0x157)+_0x4b157f+_0x56b22d(0x129),()=>_0x169fc7[_0x56b22d(0x141)]['createFolder'](_0x3e8fb4,_0x11bba1),{'verbose':_0x353073[_0x56b22d(0x120)]}),_0x8b7d0b=_0x3bfd7f[_0x56b22d(0xee)];return console['error'](_0x56b22d(0x123)+_0x8b7d0b[_0x56b22d(0x134)]+_0x56b22d(0xdb)+_0x8b7d0b['id']),await handleSDKOutput([_0x8b7d0b],_0x353073),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x15b);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0xdd);async[a32_0x413ad9(0x12b)](_0x476b59){const _0x523f69=a32_0x413ad9,{options:_0xe2305d,args:_0xe1e5a2,tdx:_0x21f838}=_0x476b59,_0x50e2d7=_0xe1e5a2[0x0];if(!_0x50e2d7)return console[_0x523f69(0x12c)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x523f69(0x12c)](_0x523f69(0xce)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x523f69(0x12c)](_0x523f69(0x114)),console[_0x523f69(0x12c)](_0x523f69(0x111)),console[_0x523f69(0x12c)]('Examples:'),console[_0x523f69(0x12c)](_0x523f69(0x10f)),console['error'](_0x523f69(0x11e)),console[_0x523f69(0x12c)](_0x523f69(0xe4)),console[_0x523f69(0x12c)](_0x523f69(0x154)),0x1;try{const _0x1b2a46=_0xe2305d[_0x523f69(0x164)],_0x4020a4=resolveSegmentTarget(_0x50e2d7,_0x1b2a46,_0xe2305d['verbose']);_0xe2305d['verbose']&&console[_0x523f69(0x12c)](_0x523f69(0x148)+_0x4020a4);const _0x5532d4=await withSpinner(_0x523f69(0x15e)+_0x50e2d7+_0x523f69(0x129),()=>_0x21f838[_0x523f69(0x141)][_0x523f69(0x165)](_0x4020a4),{'verbose':_0xe2305d[_0x523f69(0x120)]}),_0x27816e=_0x5532d4['data'];_0xe2305d[_0x523f69(0x120)]&&(console[_0x523f69(0x12c)]('Resolved\x20type:\x20'+_0x27816e['type']),console[_0x523f69(0x12c)]('Parent\x20ID:\x20'+_0x27816e['parentId']),_0x27816e['folderId']&&console[_0x523f69(0x12c)](_0x523f69(0x10e)+_0x27816e[_0x523f69(0x158)]),_0x27816e[_0x523f69(0x13a)]&&console[_0x523f69(0x12c)](_0x523f69(0x126)+_0x27816e[_0x523f69(0x13a)]));if(_0xe2305d[_0x523f69(0x116)]){if(_0x27816e[_0x523f69(0x131)]===_0x523f69(0xd3))return console[_0x523f69(0x12c)](_0x523f69(0xe5)),0x1;if(_0x27816e['type']===_0x523f69(0xd8))return console[_0x523f69(0x12c)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x523f69(0x12c)](_0x523f69(0x102)),0x1;if(!_0x27816e[_0x523f69(0x13a)])throw new SDKError(ErrorCode[_0x523f69(0x113)],_0x523f69(0xec));const _0x28131a=getConsoleNextUrl(_0xe2305d['site'],_0x523f69(0x119)+_0x27816e['parentId']+_0x523f69(0x15a)+_0x27816e['segmentId']);return console[_0x523f69(0x12c)](a32_0x56ea1f[_0x523f69(0x14c)]('✔')+_0x523f69(0xe6)+a32_0x56ea1f[_0x523f69(0x149)](_0x28131a)),openBrowser(_0x28131a),0x0;}if(_0x27816e[_0x523f69(0x131)]===_0x523f69(0xd3)){if(!_0x27816e[_0x523f69(0x158)])throw new SDKError(ErrorCode[_0x523f69(0x14e)],_0x523f69(0x108));const _0x3fffcc=await withSpinner(_0x523f69(0x105),()=>_0x21f838[_0x523f69(0x141)][_0x523f69(0xea)](_0x27816e[_0x523f69(0x158)]),{'verbose':_0xe2305d[_0x523f69(0x120)]});await handleSingleObjectOutput(_0x3fffcc[_0x523f69(0xee)],_0xe2305d);}else{if(_0x27816e[_0x523f69(0x131)]===_0x523f69(0x141)){if(!_0x27816e[_0x523f69(0x13a)])throw new SDKError(ErrorCode[_0x523f69(0x113)],_0x523f69(0xec));const _0x113bf0=await withSpinner(_0x523f69(0x121),()=>_0x21f838[_0x523f69(0x141)][_0x523f69(0xda)](_0x27816e[_0x523f69(0x156)],_0x27816e[_0x523f69(0x13a)]),{'verbose':_0xe2305d[_0x523f69(0x120)]}),_0x1bb621=getConsoleNextUrl(_0xe2305d['site'],'/app/ps/'+_0x27816e[_0x523f69(0x156)]+_0x523f69(0x15a)+_0x27816e['segmentId']),_0x26b93b=_0x113bf0['data'];_0x26b93b[_0x523f69(0x11a)]=_0x1bb621,await handleSingleObjectOutput(_0x26b93b,_0xe2305d);}else return console[_0x523f69(0x12c)](_0x523f69(0x142)),console[_0x523f69(0x12c)](_0x523f69(0xff)),0x1;}return 0x0;}catch(_0x10bd59){if(_0x10bd59 instanceof SDKError)return console['error'](_0x523f69(0x10a)+_0x10bd59[_0x523f69(0x147)]),_0x10bd59[_0x523f69(0x14d)]&&console[_0x523f69(0x12c)](_0x523f69(0xe8)+_0x10bd59['cause']),0x1;throw _0x10bd59;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x413ad9(0x134)]=a32_0x413ad9(0x13f);[a32_0x413ad9(0x13b)]=a32_0x413ad9(0x12a);async[a32_0x413ad9(0x12b)](_0x471d09){const _0x52ac8f=a32_0x413ad9,{options:_0x486773,args:_0x366784,tdx:_0x37cdda}=_0x471d09,_0x25ea26=_0x366784[0x0];if(!_0x25ea26)return console[_0x52ac8f(0x12c)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x52ac8f(0xdf)),console['error'](_0x52ac8f(0xe3)),console[_0x52ac8f(0x12c)](_0x52ac8f(0xc9)),console[_0x52ac8f(0x12c)](_0x52ac8f(0x106)),0x1;try{const _0x117b67=_0x486773['parentSegment'],_0x7ea73c=resolveSegmentTarget(_0x25ea26,_0x117b67,_0x486773[_0x52ac8f(0x120)]);_0x486773[_0x52ac8f(0x120)]&&console[_0x52ac8f(0x12c)](_0x52ac8f(0x148)+_0x7ea73c);const _0x9d0082=await withSpinner(_0x52ac8f(0x15e)+_0x25ea26+'\x27...',()=>_0x37cdda[_0x52ac8f(0x141)][_0x52ac8f(0x165)](_0x7ea73c),{'verbose':_0x486773[_0x52ac8f(0x120)]}),_0x5f03f8=_0x9d0082[_0x52ac8f(0xee)];_0x486773[_0x52ac8f(0x120)]&&(console[_0x52ac8f(0x12c)](_0x52ac8f(0xe7)+_0x5f03f8[_0x52ac8f(0x131)]),console[_0x52ac8f(0x12c)](_0x52ac8f(0x118)+_0x5f03f8['parentId']));if(_0x5f03f8[_0x52ac8f(0x131)]===_0x52ac8f(0xd3))return console[_0x52ac8f(0x12c)](_0x52ac8f(0x10d)),console['error'](_0x52ac8f(0xef)),0x1;if(_0x5f03f8[_0x52ac8f(0x131)]===_0x52ac8f(0xd8))return console[_0x52ac8f(0x12c)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x52ac8f(0x139)),0x1;if(!_0x5f03f8[_0x52ac8f(0x13a)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x52ac8f(0xec));const _0x550b59=await withSpinner(_0x52ac8f(0xe0),()=>_0x37cdda['segment'][_0x52ac8f(0x145)](_0x5f03f8[_0x52ac8f(0x156)],_0x5f03f8[_0x52ac8f(0x13a)]),{'verbose':_0x486773['verbose']}),_0x3e1156=_0x550b59['data'],_0x4df6b5=await executeSchemaQuery(_0x3e1156,_0x37cdda,_0x486773);return await handleQueryOutput(_0x4df6b5,_0x486773),0x0;}catch(_0x3b38c3){if(_0x3b38c3 instanceof SDKError)return console[_0x52ac8f(0x12c)](_0x52ac8f(0x10a)+_0x3b38c3[_0x52ac8f(0x147)]),_0x3b38c3[_0x52ac8f(0x14d)]&&console[_0x52ac8f(0x12c)]('\x20\x20Cause:\x20'+_0x3b38c3[_0x52ac8f(0x14d)]),0x1;throw _0x3b38c3;}}}
|
|
1
|
+
function a32_0xf358(){const _0x2feda3=['Site:\x20','413861cAFdfn','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','2259vgWtDy','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','SELECT\x20*\x20FROM\x20(\x0a','execute','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','/e/','INVALID_ARGUMENT','Error:\x20Path\x20or\x20name\x20is\x20required','segment:folder:create','trim','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Examples:','Resolved\x20type:\x20','Creating\x20folder\x20\x27','parentSegment','segmentPath','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20Opening\x20','json','29865MCfArM','data','cause','message','getSegmentSQL','description','jobId','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','folderPath','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Show\x20segment\x20folder\x20details','SEGMENT_NOT_FOUND','parentFolder','listFolders','Folder\x20ID:\x20','toLocaleString','log','Usage:\x20tdx\x20sg\x20desc\x20<name>','18668gDFWCT','cyan','Fetching\x20folder\x20details...','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Target\x20path:\x20','\x20rows\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20Parent\x20segment:\x20','Parent\x20ID:\x20','SQL\x20query:\x0a','\x27\x20with\x20ID:\x20','\x27...','Use:\x20tdx\x20ps\x20desc','parentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolved\x20YAML\x20file:\x20','jsonl','includes','url','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','segment:folder:list','Resolved\x20folder\x20ID:\x20','Resolving\x20\x27','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Fetching\x20parent\x20segment\x20details...','limit','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','stats','folder','segment:view','525OKLDAa','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','/app/ps/','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolving\x20parent\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parent','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Resolved\x20parent\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:desc','121840tzrFuP','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','information_schema','✖\x20Query\x20failed\x20[','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','(root)','segmentId','error','✔\x20Found\x20','Resolving\x20path\x20\x27','2136GJmBGV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20folder','Error:\x20Folder\x20reference\x20is\x20required','fullPath','✔\x20Query\x20completed:\x20Processed\x20','test','Error:\x20','folderId','12SdGrOS','✔\x20Created\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','createFolder','length','type','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Fetching\x20folder\x20\x27','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','segment:sql','resolveParentId','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','name','Resolving\x20folder\x20\x27','703520WbGTyf','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','processedRows','getSegment','in\x20','Use:\x20tdx\x20ps\x20show','\x20\x20Cause:\x20','verbose','Segment\x20ID:\x20','\x20[Job\x20ID:\x20','2438lNVRbz','site','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','80GZIZTN','\x20\x20Full\x20path:\x20','Show\x20segment\x20or\x20folder\x20details','Parent\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','segmentName','getFolder','replace','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','web','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20view\x20-w','Use:\x20tdx\x20ps\x20view','query'];a32_0xf358=function(){return _0x2feda3;};return a32_0xf358();}const a32_0x22f685=a32_0xdd02;(function(_0x2123c6,_0x30ddc5){const _0x1a389c=a32_0xdd02,_0x6fb9fd=_0x2123c6();while(!![]){try{const _0x1772e4=parseInt(_0x1a389c(0x23f))/0x1+parseInt(_0x1a389c(0x1d4))/0x2*(-parseInt(_0x1a389c(0x233))/0x3)+parseInt(_0x1a389c(0x211))/0x4*(parseInt(_0x1a389c(0x1d8))/0x5)+parseInt(_0x1a389c(0x256))/0x6*(parseInt(_0x1a389c(0x1e8))/0x7)+parseInt(_0x1a389c(0x24b))/0x8*(-parseInt(_0x1a389c(0x1ea))/0x9)+parseInt(_0x1a389c(0x268))/0xa+parseInt(_0x1a389c(0x1fd))/0xb;if(_0x1772e4===_0x30ddc5)break;else _0x6fb9fd['push'](_0x6fb9fd['shift']());}catch(_0x515890){_0x6fb9fd['push'](_0x6fb9fd['shift']());}}}(a32_0xf358,0x1a3db));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0x10f154 from'chalk';function resolveSegmentTarget(_0x40f1d1,_0x5e1a39,_0x350492){const _0xbed8d8=a32_0xdd02;if(isYamlFilePath(_0x40f1d1))try{const _0x5f351f=resolveYamlFilePath(_0x40f1d1);return _0x350492&&(console[_0xbed8d8(0x248)](_0xbed8d8(0x220)+_0x40f1d1),console[_0xbed8d8(0x248)](_0xbed8d8(0x218)+_0x5f351f[_0xbed8d8(0x1f8)]),console[_0xbed8d8(0x248)]('\x20\x20Segment\x20name:\x20'+_0x5f351f[_0xbed8d8(0x1de)]),console['error'](_0xbed8d8(0x238)+(_0x5f351f[_0xbed8d8(0x205)]||_0xbed8d8(0x246))),console['error'](_0xbed8d8(0x1d9)+_0x5f351f[_0xbed8d8(0x251)])),_0x5f351f[_0xbed8d8(0x251)];}catch(_0x23d5cf){throw new SDKError(ErrorCode[_0xbed8d8(0x1f0)],_0xbed8d8(0x1eb)+_0x23d5cf['message']);}if(!_0x5e1a39)throw new SDKError(ErrorCode[_0xbed8d8(0x1f0)],_0xbed8d8(0x229));return _0x5e1a39+'/'+_0x40f1d1;}export class SegmentDescribeCommand extends BaseCommand{[a32_0x22f685(0x266)]='segment:describe';[a32_0x22f685(0x202)]=a32_0x22f685(0x1da);async[a32_0x22f685(0x1ed)](_0x4c0ead){const _0x331cee=a32_0x22f685,{options:_0x366a45,args:_0x3c1be0,tdx:_0x31495}=_0x4c0ead,_0x1ad931=_0x3c1be0[0x0],_0x1d357a=!_0x1ad931&&!!_0x366a45[_0x331cee(0x1f8)],_0x576040=_0x1ad931||_0x366a45['parentSegment'];if(!_0x576040)return console[_0x331cee(0x248)](_0x331cee(0x1f1)),console[_0x331cee(0x248)](_0x331cee(0x236)),console[_0x331cee(0x248)](_0x331cee(0x1f5)),console[_0x331cee(0x248)](_0x331cee(0x1e9)),console[_0x331cee(0x248)](_0x331cee(0x207)),console[_0x331cee(0x248)](_0x331cee(0x1e1)),console[_0x331cee(0x248)](_0x331cee(0x239)),0x1;try{const _0xb9b6a9=_0x366a45[_0x331cee(0x1f9)];let _0x6ea400=_0x576040;!_0x1d357a&&_0xb9b6a9&&!_0x576040[_0x331cee(0x222)]('/')&&(_0x6ea400=_0xb9b6a9+'/'+_0x576040,_0x366a45['verbose']&&console[_0x331cee(0x248)](_0x331cee(0x225)+_0x6ea400));const _0x5c2c43=await withSpinner(_0x331cee(0x24a)+_0x6ea400+_0x331cee(0x21c),()=>_0x31495['segment'][_0x331cee(0x265)](_0x6ea400),{'verbose':_0x366a45[_0x331cee(0x1d1)]}),_0x4e0e81=_0x5c2c43[_0x331cee(0x1fe)];_0x366a45[_0x331cee(0x1d1)]&&(console[_0x331cee(0x248)]('Resolved\x20type:\x20'+_0x4e0e81[_0x331cee(0x25c)]),console[_0x331cee(0x248)]('Parent\x20ID:\x20'+_0x4e0e81['parentId']),_0x4e0e81['folderId']&&console[_0x331cee(0x248)](_0x331cee(0x20d)+_0x4e0e81[_0x331cee(0x255)]),_0x4e0e81[_0x331cee(0x247)]&&console['error'](_0x331cee(0x1d2)+_0x4e0e81[_0x331cee(0x247)]));if(_0x4e0e81[_0x331cee(0x25c)]===_0x331cee(0x23a)){const _0x47ffc4=await withSpinner(_0x331cee(0x22d),()=>_0x31495['segment']['getParent'](_0x4e0e81[_0x331cee(0x21e)]),{'verbose':_0x366a45[_0x331cee(0x1d1)]});await handleSingleObjectOutput(_0x47ffc4['data'],_0x366a45);}else{if(_0x4e0e81[_0x331cee(0x25c)]===_0x331cee(0x231)){if(!_0x4e0e81[_0x331cee(0x255)])throw new SDKError(ErrorCode[_0x331cee(0x25f)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x43da13=await withSpinner(_0x331cee(0x213),()=>_0x31495['segment'][_0x331cee(0x1df)](_0x4e0e81['folderId']),{'verbose':_0x366a45[_0x331cee(0x1d1)]});await handleSingleObjectOutput(_0x43da13['data'],_0x366a45);}else{if(_0x4e0e81[_0x331cee(0x25c)]===_0x331cee(0x24d)){if(!_0x4e0e81[_0x331cee(0x247)])throw new SDKError(ErrorCode[_0x331cee(0x20a)],_0x331cee(0x224));const _0x25b887=await withSpinner(_0x331cee(0x259),()=>_0x31495[_0x331cee(0x24d)]['getSegment'](_0x4e0e81[_0x331cee(0x21e)],_0x4e0e81[_0x331cee(0x247)]),{'verbose':_0x366a45[_0x331cee(0x1d1)]});await handleSingleObjectOutput(_0x25b887[_0x331cee(0x1fe)],_0x366a45);}}}return 0x0;}catch(_0x375094){if(_0x375094 instanceof SDKError)return console[_0x331cee(0x248)]('Error:\x20'+_0x375094[_0x331cee(0x200)]),_0x375094[_0x331cee(0x1ff)]&&console[_0x331cee(0x248)](_0x331cee(0x1d0)+_0x375094[_0x331cee(0x1ff)]),0x1;throw _0x375094;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x22f685(0x266)]='segment:show';[a32_0x22f685(0x202)]=a32_0x22f685(0x1ee);async[a32_0x22f685(0x1ed)](_0x3b8742){const _0x463922=a32_0x22f685,{options:_0xbc7b6a,args:_0x1928f2,tdx:_0x1bc033}=_0x3b8742,_0x438f10=_0x1928f2[0x0];if(!_0x438f10)return console[_0x463922(0x248)](_0x463922(0x1d7)),console['error'](_0x463922(0x243)),console['error'](_0x463922(0x24c)),console[_0x463922(0x248)](_0x463922(0x1f5)),console[_0x463922(0x248)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x463922(0x248)](_0x463922(0x26a)),0x1;try{const _0x1da838=_0xbc7b6a[_0x463922(0x1f8)],_0x404a30=resolveSegmentTarget(_0x438f10,_0x1da838,_0xbc7b6a[_0x463922(0x1d1)]);_0xbc7b6a['verbose']&&console['error'](_0x463922(0x215)+_0x404a30);const _0x364368=await withSpinner(_0x463922(0x228)+_0x438f10+_0x463922(0x21c),()=>_0x1bc033[_0x463922(0x24d)][_0x463922(0x265)](_0x404a30),{'verbose':_0xbc7b6a[_0x463922(0x1d1)]}),_0x154c1f=_0x364368[_0x463922(0x1fe)];_0xbc7b6a['verbose']&&(console['error'](_0x463922(0x1f6)+_0x154c1f[_0x463922(0x25c)]),console[_0x463922(0x248)](_0x463922(0x219)+_0x154c1f[_0x463922(0x21e)]));if(_0x154c1f['type']===_0x463922(0x231))return console[_0x463922(0x248)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x463922(0x248)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x154c1f[_0x463922(0x25c)]===_0x463922(0x23a))return console['error'](_0x463922(0x26b)),console[_0x463922(0x248)](_0x463922(0x1cf)),0x1;if(!_0x154c1f['segmentId'])throw new SDKError(ErrorCode[_0x463922(0x20a)],_0x463922(0x224));const _0x3a5e69=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1bc033[_0x463922(0x24d)][_0x463922(0x201)](_0x154c1f[_0x463922(0x21e)],_0x154c1f[_0x463922(0x247)]),{'verbose':_0xbc7b6a[_0x463922(0x1d1)]});let _0x196a73=_0x3a5e69[_0x463922(0x1fe)];const _0x240b0e=resolveLimit(_0xbc7b6a[_0x463922(0x22e)],DEFAULT_DISPLAY_LIMIT),_0x4c3c7c=/\bLIMIT\s+\d+/i[_0x463922(0x253)](_0x196a73);!_0x4c3c7c&&(_0x196a73=_0x196a73[_0x463922(0x1f3)]()[_0x463922(0x1e0)](/;+$/,''),_0x196a73=_0x463922(0x1ec)+_0x196a73+_0x463922(0x25d)+_0x240b0e);_0xbc7b6a[_0x463922(0x1d1)]&&console[_0x463922(0x248)](_0x463922(0x21a)+_0x196a73);const _0x113d0d=await withQuerySpinner('Executing\x20segment\x20query...',async _0x5cc080=>{const _0x2de917=_0x463922,_0x372fbe=await _0x1bc033[_0x2de917(0x1e6)][_0x2de917(0x1ed)](_0x196a73,{'catalog':'td','schema':_0x2de917(0x241),'onJobId':_0x57931d=>{_0x5cc080['setJobId'](_0x57931d);}});return _0x372fbe;},{'verbose':_0xbc7b6a[_0x463922(0x1d1)]}),_0x265191=_0x113d0d[_0x463922(0x1fe)],_0xd9fbdf=_0x265191[_0x463922(0x203)]?_0x463922(0x1d3)+_0x265191[_0x463922(0x203)]+']':'';return console[_0x463922(0x248)](_0x463922(0x252)+_0x265191['stats'][_0x463922(0x26c)][_0x463922(0x20e)]()+_0x463922(0x216)+(_0x463922(0x26e)+formatElapsed(_0x265191[_0x463922(0x230)]['elapsedTimeMillis'])+_0xd9fbdf)),await handleQueryOutput(_0x265191,_0xbc7b6a),0x0;}catch(_0x3c1726){if(_0x3c1726 instanceof SDKError)return console[_0x463922(0x248)](_0x463922(0x242)+_0x3c1726['code']+']'),console['error']('\x0a'+_0x3c1726[_0x463922(0x200)]),0x1;throw _0x3c1726;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x226);['description']=a32_0x22f685(0x234);async[a32_0x22f685(0x1ed)](_0x48237b){const _0x59c631=a32_0x22f685,{options:_0x55e24c,args:_0x531f80,tdx:_0x3a0d20}=_0x48237b;if(_0x531f80['length']===0x0)return console[_0x59c631(0x248)](_0x59c631(0x244)),console[_0x59c631(0x248)](_0x59c631(0x269)),0x1;const _0x2b0cc5=_0x531f80[0x0];try{_0x55e24c[_0x59c631(0x1d1)]&&(console['error'](_0x59c631(0x1e7)+_0x55e24c[_0x59c631(0x1d5)]),console[_0x59c631(0x248)](_0x59c631(0x1db)+_0x2b0cc5));const _0x295fb6=await withSpinner(_0x59c631(0x1dc)+_0x2b0cc5+_0x59c631(0x21c),()=>_0x3a0d20[_0x59c631(0x24d)]['resolveParentId'](_0x2b0cc5),{'verbose':_0x55e24c[_0x59c631(0x1d1)]}),_0x55ed2a=_0x295fb6[_0x59c631(0x1fe)];_0x55e24c[_0x59c631(0x1d1)]&&console[_0x59c631(0x248)]('Resolved\x20parent\x20ID:\x20'+_0x55ed2a);const _0x174fe1=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x2b0cc5+_0x59c631(0x21c),()=>_0x3a0d20[_0x59c631(0x24d)][_0x59c631(0x20c)](_0x55ed2a),{'verbose':_0x55e24c[_0x59c631(0x1d1)]}),_0x42973b=_0x174fe1[_0x59c631(0x1fe)];return console['error'](_0x59c631(0x249)+_0x42973b[_0x59c631(0x25b)]+_0x59c631(0x24f)+(_0x42973b['length']!==0x1?'s':'')),await handleSDKOutput(_0x42973b,_0x55e24c),0x0;}catch(_0x5572bc){if(_0x5572bc instanceof SDKError)return console[_0x59c631(0x248)](_0x59c631(0x254)+_0x5572bc[_0x59c631(0x200)]),_0x5572bc[_0x59c631(0x1ff)]&&console[_0x59c631(0x248)](_0x59c631(0x1d0)+_0x5572bc[_0x59c631(0x1ff)]),0x1;throw _0x5572bc;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x22f685(0x266)]='segment:folder:show';[a32_0x22f685(0x202)]=a32_0x22f685(0x209);async[a32_0x22f685(0x1ed)](_0xc53fad){const _0x36113b=a32_0x22f685,{options:_0x34093e,args:_0x9eba61,tdx:_0x232c74}=_0xc53fad;if(_0x9eba61[_0x36113b(0x25b)]===0x0)return console['error'](_0x36113b(0x250)),console[_0x36113b(0x248)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x30520f,childId:_0x1f44de}=parseSegmentRef(_0x9eba61[0x0]);_0x34093e[_0x36113b(0x1d1)]&&(console['error'](_0x36113b(0x1e7)+_0x34093e[_0x36113b(0x1d5)]),console[_0x36113b(0x248)]('Parent\x20name:\x20'+_0x30520f),_0x1f44de&&console[_0x36113b(0x248)]('Folder\x20name:\x20'+_0x1f44de));if(!_0x1f44de)return console[_0x36113b(0x248)](_0x36113b(0x1f4)),0x1;const _0x2d33a9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x30520f+_0x36113b(0x21c),()=>_0x232c74[_0x36113b(0x24d)][_0x36113b(0x262)](_0x30520f),{'verbose':_0x34093e[_0x36113b(0x1d1)]}),_0x3bc630=_0x2d33a9[_0x36113b(0x1fe)];_0x34093e[_0x36113b(0x1d1)]&&console[_0x36113b(0x248)](_0x36113b(0x23c)+_0x3bc630);const _0x1c0e09=await withSpinner(_0x36113b(0x267)+_0x1f44de+_0x36113b(0x21c),()=>_0x232c74['segment'][_0x36113b(0x1dd)](_0x3bc630,_0x1f44de),{'verbose':_0x34093e[_0x36113b(0x1d1)]}),_0x59f8f8=_0x1c0e09[_0x36113b(0x1fe)];_0x34093e[_0x36113b(0x1d1)]&&console[_0x36113b(0x248)](_0x36113b(0x227)+_0x59f8f8);const _0x55176c=await withSpinner(_0x36113b(0x25e)+_0x1f44de+_0x36113b(0x21c),()=>_0x232c74['segment'][_0x36113b(0x1df)](_0x59f8f8),{'verbose':_0x34093e['verbose']});return await handleSDKOutput([_0x55176c[_0x36113b(0x1fe)]],_0x34093e),0x0;}catch(_0x19935f){if(_0x19935f instanceof SDKError)return console[_0x36113b(0x248)]('Error:\x20'+_0x19935f['message']),_0x19935f[_0x36113b(0x1ff)]&&console[_0x36113b(0x248)](_0x36113b(0x1d0)+_0x19935f['cause']),0x1;throw _0x19935f;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x261);[a32_0x22f685(0x202)]=a32_0x22f685(0x24e);async[a32_0x22f685(0x1ed)](_0x52e13a){const _0x12c69a=a32_0x22f685,{options:_0x5dcf9a,args:_0x44470f,tdx:_0x417ac6}=_0x52e13a,_0x1ad84c=_0x44470f[0x0];if(!_0x1ad84c)return console['error'](_0x12c69a(0x1d7)),console[_0x12c69a(0x248)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x12c69a(0x248)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x12c69a(0x248)]('Examples:'),console[_0x12c69a(0x248)](_0x12c69a(0x245)),console[_0x12c69a(0x248)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x53f159=_0x5dcf9a[_0x12c69a(0x1f8)],_0x1d2a90=resolveSegmentTarget(_0x1ad84c,_0x53f159,_0x5dcf9a['verbose']);_0x5dcf9a[_0x12c69a(0x1d1)]&&console['error'](_0x12c69a(0x215)+_0x1d2a90);const _0x5162ab=await withSpinner(_0x12c69a(0x228)+_0x1ad84c+'\x27...',()=>_0x417ac6['segment'][_0x12c69a(0x265)](_0x1d2a90),{'verbose':_0x5dcf9a['verbose']}),_0x2c5aea=_0x5162ab['data'];_0x5dcf9a[_0x12c69a(0x1d1)]&&(console[_0x12c69a(0x248)](_0x12c69a(0x1f6)+_0x2c5aea['type']),console['error'](_0x12c69a(0x219)+_0x2c5aea[_0x12c69a(0x21e)]));if(_0x2c5aea[_0x12c69a(0x25c)]===_0x12c69a(0x231))return console[_0x12c69a(0x248)](_0x12c69a(0x240)),console[_0x12c69a(0x248)](_0x12c69a(0x23b)),0x1;if(_0x2c5aea[_0x12c69a(0x25c)]===_0x12c69a(0x23a))return console[_0x12c69a(0x248)](_0x12c69a(0x23d)),console[_0x12c69a(0x248)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x2c5aea['segmentId'])throw new SDKError(ErrorCode[_0x12c69a(0x20a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5221d3=await withSpinner(_0x12c69a(0x264),()=>_0x417ac6[_0x12c69a(0x24d)]['getSegmentSQL'](_0x2c5aea[_0x12c69a(0x21e)],_0x2c5aea[_0x12c69a(0x247)]),{'verbose':_0x5dcf9a[_0x12c69a(0x1d1)]}),_0x48c0bd=_0x5221d3[_0x12c69a(0x1fe)];return _0x5dcf9a['format']===_0x12c69a(0x1fc)||_0x5dcf9a['format']===_0x12c69a(0x221)?await handleSDKOutput([{'sql':_0x48c0bd}],_0x5dcf9a):console[_0x12c69a(0x20f)](_0x48c0bd),0x0;}catch(_0x34857c){if(_0x34857c instanceof SDKError)return console['error'](_0x12c69a(0x254)+_0x34857c['message']),_0x34857c[_0x12c69a(0x1ff)]&&console[_0x12c69a(0x248)]('\x20\x20Cause:\x20'+_0x34857c[_0x12c69a(0x1ff)]),0x1;throw _0x34857c;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a32_0x22f685(0x1f2);['description']=a32_0x22f685(0x263);async[a32_0x22f685(0x1ed)](_0x48ce56){const _0x67942d=a32_0x22f685,{options:_0x3aeacd,args:_0x1f1087,tdx:_0x25437f}=_0x48ce56,_0x216e39=_0x3aeacd;if(_0x1f1087[_0x67942d(0x25b)]<0x2)return console['error'](_0x67942d(0x1e3)),console[_0x67942d(0x248)](_0x67942d(0x208)),0x1;const _0x4a839b=_0x1f1087[0x0],_0x1fa298=_0x1f1087[0x1];_0x216e39[_0x67942d(0x1d1)]&&(console[_0x67942d(0x248)](_0x67942d(0x1e7)+_0x216e39[_0x67942d(0x1d5)]),console[_0x67942d(0x248)]('Parent\x20segment:\x20'+_0x4a839b),console[_0x67942d(0x248)]('Folder\x20name:\x20'+_0x1fa298));let _0x4ee1af;if(_0x216e39[_0x67942d(0x20b)]){const _0x140b76=_0x216e39[_0x67942d(0x20b)],_0x19085e=await withSpinner(_0x67942d(0x1dc)+_0x4a839b+_0x67942d(0x21c),()=>_0x25437f[_0x67942d(0x24d)][_0x67942d(0x262)](_0x4a839b),{'verbose':_0x216e39[_0x67942d(0x1d1)]}),_0x144b1d=_0x19085e[_0x67942d(0x1fe)],_0x27fa7b=await withSpinner(_0x67942d(0x237)+_0x140b76+_0x67942d(0x21c),()=>_0x25437f[_0x67942d(0x24d)]['resolveFolderId'](_0x144b1d,_0x140b76),{'verbose':_0x216e39[_0x67942d(0x1d1)]});_0x4ee1af=_0x27fa7b[_0x67942d(0x1fe)],_0x216e39[_0x67942d(0x1d1)]&&console[_0x67942d(0x248)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4ee1af);}const _0x2afce6={'name':_0x1fa298,'description':_0x216e39[_0x67942d(0x202)],'parentFolderId':_0x4ee1af},_0x8cd354=await withSpinner(_0x67942d(0x1f7)+_0x1fa298+_0x67942d(0x21c),()=>_0x25437f['segment'][_0x67942d(0x25a)](_0x4a839b,_0x2afce6),{'verbose':_0x216e39[_0x67942d(0x1d1)]}),_0xe3491c=_0x8cd354[_0x67942d(0x1fe)];return console[_0x67942d(0x248)](_0x67942d(0x257)+_0xe3491c[_0x67942d(0x266)]+_0x67942d(0x21b)+_0xe3491c['id']),await handleSDKOutput([_0xe3491c],_0x216e39),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x232);[a32_0x22f685(0x202)]=a32_0x22f685(0x22b);async['execute'](_0x555c00){const _0x4f6937=a32_0x22f685,{options:_0x4bea07,args:_0x1ae342,tdx:_0x4c1618}=_0x555c00,_0x1ba7e1=_0x1ae342[0x0];if(!_0x1ba7e1)return console[_0x4f6937(0x248)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4f6937(0x248)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x4f6937(0x21f)),console['error']('Options:'),console[_0x4f6937(0x248)](_0x4f6937(0x22c)),console[_0x4f6937(0x248)](_0x4f6937(0x1f5)),console['error'](_0x4f6937(0x204)),console[_0x4f6937(0x248)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x4f6937(0x248)](_0x4f6937(0x22a)),console['error'](_0x4f6937(0x1d6)),0x1;try{const _0x5a86ba=_0x4bea07['parentSegment'],_0x2d788f=resolveSegmentTarget(_0x1ba7e1,_0x5a86ba,_0x4bea07[_0x4f6937(0x1d1)]);_0x4bea07[_0x4f6937(0x1d1)]&&console[_0x4f6937(0x248)](_0x4f6937(0x215)+_0x2d788f);const _0x563a17=await withSpinner('Resolving\x20\x27'+_0x1ba7e1+_0x4f6937(0x21c),()=>_0x4c1618[_0x4f6937(0x24d)][_0x4f6937(0x265)](_0x2d788f),{'verbose':_0x4bea07[_0x4f6937(0x1d1)]}),_0x5f55ee=_0x563a17['data'];_0x4bea07[_0x4f6937(0x1d1)]&&(console['error']('Resolved\x20type:\x20'+_0x5f55ee[_0x4f6937(0x25c)]),console['error'](_0x4f6937(0x219)+_0x5f55ee[_0x4f6937(0x21e)]),_0x5f55ee[_0x4f6937(0x255)]&&console[_0x4f6937(0x248)]('Folder\x20ID:\x20'+_0x5f55ee[_0x4f6937(0x255)]),_0x5f55ee['segmentId']&&console[_0x4f6937(0x248)](_0x4f6937(0x1d2)+_0x5f55ee[_0x4f6937(0x247)]));if(_0x4bea07[_0x4f6937(0x1e2)]){if(_0x5f55ee[_0x4f6937(0x25c)]===_0x4f6937(0x231))return console[_0x4f6937(0x248)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x5f55ee[_0x4f6937(0x25c)]===_0x4f6937(0x23a))return console[_0x4f6937(0x248)](_0x4f6937(0x260)),console[_0x4f6937(0x248)](_0x4f6937(0x1e4)),0x1;if(!_0x5f55ee[_0x4f6937(0x247)])throw new SDKError(ErrorCode[_0x4f6937(0x20a)],_0x4f6937(0x224));const _0x38718a=getConsoleNextUrl(_0x4bea07[_0x4f6937(0x1d5)],_0x4f6937(0x235)+_0x5f55ee[_0x4f6937(0x21e)]+'/e/'+_0x5f55ee[_0x4f6937(0x247)]);return console['error'](a32_0x10f154['green']('✔')+_0x4f6937(0x1fb)+a32_0x10f154[_0x4f6937(0x212)](_0x38718a)),openBrowser(_0x38718a),0x0;}if(_0x5f55ee['type']===_0x4f6937(0x231)){if(!_0x5f55ee[_0x4f6937(0x255)])throw new SDKError(ErrorCode[_0x4f6937(0x25f)],_0x4f6937(0x258));const _0x9c6178=await withSpinner(_0x4f6937(0x213),()=>_0x4c1618[_0x4f6937(0x24d)][_0x4f6937(0x1df)](_0x5f55ee[_0x4f6937(0x255)]),{'verbose':_0x4bea07[_0x4f6937(0x1d1)]});await handleSingleObjectOutput(_0x9c6178[_0x4f6937(0x1fe)],_0x4bea07);}else{if(_0x5f55ee[_0x4f6937(0x25c)]===_0x4f6937(0x24d)){if(!_0x5f55ee[_0x4f6937(0x247)])throw new SDKError(ErrorCode[_0x4f6937(0x20a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x17a0c8=await withSpinner(_0x4f6937(0x259),()=>_0x4c1618[_0x4f6937(0x24d)][_0x4f6937(0x26d)](_0x5f55ee[_0x4f6937(0x21e)],_0x5f55ee[_0x4f6937(0x247)]),{'verbose':_0x4bea07[_0x4f6937(0x1d1)]}),_0x19aa1d=getConsoleNextUrl(_0x4bea07[_0x4f6937(0x1d5)],_0x4f6937(0x235)+_0x5f55ee['parentId']+_0x4f6937(0x1ef)+_0x5f55ee[_0x4f6937(0x247)]),_0x52013e=_0x17a0c8[_0x4f6937(0x1fe)];_0x52013e[_0x4f6937(0x223)]=_0x19aa1d,await handleSingleObjectOutput(_0x52013e,_0x4bea07);}else return console[_0x4f6937(0x248)](_0x4f6937(0x217)),console[_0x4f6937(0x248)](_0x4f6937(0x1e5)),0x1;}return 0x0;}catch(_0x2befa2){if(_0x2befa2 instanceof SDKError)return console[_0x4f6937(0x248)](_0x4f6937(0x254)+_0x2befa2[_0x4f6937(0x200)]),_0x2befa2['cause']&&console[_0x4f6937(0x248)](_0x4f6937(0x1d0)+_0x2befa2[_0x4f6937(0x1ff)]),0x1;throw _0x2befa2;}}}function a32_0xdd02(_0x5ebce1,_0x1556c9){_0x5ebce1=_0x5ebce1-0x1cf;const _0xf35816=a32_0xf358();let _0xdd02af=_0xf35816[_0x5ebce1];return _0xdd02af;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x22f685(0x266)]=a32_0x22f685(0x23e);[a32_0x22f685(0x202)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a32_0x22f685(0x1ed)](_0x23ebcd){const _0x4d750c=a32_0x22f685,{options:_0x58c3d9,args:_0x30459e,tdx:_0x2e8548}=_0x23ebcd,_0xee0f79=_0x30459e[0x0];if(!_0xee0f79)return console[_0x4d750c(0x248)](_0x4d750c(0x1d7)),console['error'](_0x4d750c(0x210)),console[_0x4d750c(0x248)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error']('Examples:'),console['error'](_0x4d750c(0x22f)),console[_0x4d750c(0x248)](_0x4d750c(0x1fa)),0x1;try{const _0x4c7431=_0x58c3d9[_0x4d750c(0x1f8)],_0x387f0b=resolveSegmentTarget(_0xee0f79,_0x4c7431,_0x58c3d9[_0x4d750c(0x1d1)]);_0x58c3d9[_0x4d750c(0x1d1)]&&console[_0x4d750c(0x248)]('Target\x20path:\x20'+_0x387f0b);const _0x3d1090=await withSpinner(_0x4d750c(0x228)+_0xee0f79+_0x4d750c(0x21c),()=>_0x2e8548[_0x4d750c(0x24d)][_0x4d750c(0x265)](_0x387f0b),{'verbose':_0x58c3d9['verbose']}),_0x3e6ada=_0x3d1090[_0x4d750c(0x1fe)];_0x58c3d9[_0x4d750c(0x1d1)]&&(console[_0x4d750c(0x248)](_0x4d750c(0x1f6)+_0x3e6ada['type']),console[_0x4d750c(0x248)](_0x4d750c(0x219)+_0x3e6ada['parentId']));if(_0x3e6ada[_0x4d750c(0x25c)]===_0x4d750c(0x231))return console['error'](_0x4d750c(0x214)),console['error'](_0x4d750c(0x23b)),0x1;if(_0x3e6ada['type']===_0x4d750c(0x23a))return console['error'](_0x4d750c(0x206)),console[_0x4d750c(0x248)](_0x4d750c(0x21d)),0x1;if(!_0x3e6ada[_0x4d750c(0x247)])throw new SDKError(ErrorCode[_0x4d750c(0x20a)],_0x4d750c(0x224));const _0x3374b7=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2e8548[_0x4d750c(0x24d)][_0x4d750c(0x201)](_0x3e6ada['parentId'],_0x3e6ada[_0x4d750c(0x247)]),{'verbose':_0x58c3d9['verbose']}),_0x545537=_0x3374b7[_0x4d750c(0x1fe)],_0x4cb884=await executeSchemaQuery(_0x545537,_0x2e8548,_0x58c3d9);return await handleQueryOutput(_0x4cb884,_0x58c3d9),0x0;}catch(_0x252b77){if(_0x252b77 instanceof SDKError)return console[_0x4d750c(0x248)](_0x4d750c(0x254)+_0x252b77[_0x4d750c(0x200)]),_0x252b77[_0x4d750c(0x1ff)]&&console[_0x4d750c(0x248)](_0x4d750c(0x1d0)+_0x252b77[_0x4d750c(0x1ff)]),0x1;throw _0x252b77;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0xcd98e8=a33_0x49d3;(function(_0x3a32c3,_0x466eed){const _0x116529=a33_0x49d3,_0x4b67a5=_0x3a32c3();while(!![]){try{const _0x308a90=-parseInt(_0x116529(0x157))/0x1+-parseInt(_0x116529(0x18b))/0x2*(-parseInt(_0x116529(0x167))/0x3)+parseInt(_0x116529(0x166))/0x4+-parseInt(_0x116529(0x159))/0x5*(parseInt(_0x116529(0x17a))/0x6)+-parseInt(_0x116529(0x18a))/0x7+parseInt(_0x116529(0x175))/0x8*(-parseInt(_0x116529(0x177))/0x9)+parseInt(_0x116529(0x168))/0xa*(parseInt(_0x116529(0x179))/0xb);if(_0x308a90===_0x466eed)break;else _0x4b67a5['push'](_0x4b67a5['shift']());}catch(_0x2b5620){_0x4b67a5['push'](_0x4b67a5['shift']());}}}(a33_0x27b6,0x1ce2f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a33_0x27b6(){const _0x4814c6=['description','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','resolveFolderId','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolved\x20folder\x20ID:\x20','72ZRwguj','name','48123dqoEcU','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','11EHwAXJ','1098nLOizy','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolvePathToResource','site','segment:create','noCountPopulation','data','type','invisible','error','folderId','\x27...','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','parent','279293negtjP','12jnqVFc','122225XjFGjw','Creating\x20segment\x20\x27','2845lUUMgn','Site:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20relative\x20path\x20to:\x20','segment','Parent\x20path:\x20','includes','rule','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','verbose','kind','213264pnYSep','15585dFAXPf','3482070CdoMei','Resolving\x20folder\x20path\x20\x27','execute','segments','folder','yellow'];a33_0x27b6=function(){return _0x4814c6;};return a33_0x27b6();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a33_0x49d3(_0x22a4c2,_0x1e2790){_0x22a4c2=_0x22a4c2-0x157;const _0x27b625=a33_0x27b6();let _0x49d392=_0x27b625[_0x22a4c2];return _0x49d392;}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x357805 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a33_0xcd98e8(0x176)]=a33_0xcd98e8(0x180);[a33_0xcd98e8(0x16e)]=a33_0xcd98e8(0x15d);async[a33_0xcd98e8(0x16a)](_0xe276b7){const _0x1c62b3=a33_0xcd98e8;console['error'](a33_0x357805[_0x1c62b3(0x16d)](_0x1c62b3(0x188))),console['error'](a33_0x357805['yellow'](_0x1c62b3(0x17d)));const {options:_0x5b39c6,args:_0x45726c,tdx:_0x34832f}=_0xe276b7,_0x57b967=_0x5b39c6;if(_0x45726c['length']===0x0)return console['error'](_0x1c62b3(0x15b)),console['error'](_0x1c62b3(0x178)),console[_0x1c62b3(0x185)]('Examples:'),console[_0x1c62b3(0x185)](_0x1c62b3(0x17c)),console[_0x1c62b3(0x185)](_0x1c62b3(0x173)),console['error'](_0x1c62b3(0x171)),0x1;const _0x58ff4c=_0x45726c[0x0],_0x170b5a=_0x5b39c6['segmentPath'];let _0x27f613=_0x58ff4c;_0x170b5a&&!_0x58ff4c[_0x1c62b3(0x161)]('/')&&(_0x27f613=_0x170b5a+'/'+_0x58ff4c,_0x57b967['verbose']&&console[_0x1c62b3(0x185)](_0x1c62b3(0x15e)+_0x27f613));const _0x315ede=parsePath(_0x27f613);if(_0x315ede[_0x1c62b3(0x16b)]['length']<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x1c62b3(0x185)](_0x1c62b3(0x163)),0x1;const _0x7730c3=_0x315ede[_0x1c62b3(0x16b)][0x0],_0x4d658d=getBaseName(_0x27f613),_0x2af671=getParentPath(_0x27f613);_0x57b967[_0x1c62b3(0x164)]&&(console[_0x1c62b3(0x185)](_0x1c62b3(0x15a)+_0x57b967[_0x1c62b3(0x17f)]),console['error'](_0x1c62b3(0x15c)+_0x27f613),console['error']('Parent:\x20'+_0x7730c3),console[_0x1c62b3(0x185)]('Segment\x20name:\x20'+_0x4d658d),console['error'](_0x1c62b3(0x160)+_0x2af671));const _0x33723a=await withSpinner(_0x1c62b3(0x172)+_0x7730c3+_0x1c62b3(0x187),()=>_0x34832f['segment']['resolveParentId'](_0x7730c3),{'verbose':_0x57b967[_0x1c62b3(0x164)]}),_0x2da8a2=_0x33723a[_0x1c62b3(0x182)];let _0x31ca98;if(_0x315ede[_0x1c62b3(0x16b)]['length']>0x2){const _0x446681=await withSpinner(_0x1c62b3(0x169)+_0x2af671+_0x1c62b3(0x187),()=>_0x34832f[_0x1c62b3(0x15f)][_0x1c62b3(0x17e)](_0x2af671),{'verbose':_0x57b967[_0x1c62b3(0x164)]}),_0x4b4bb3=_0x446681[_0x1c62b3(0x182)];if(_0x4b4bb3[_0x1c62b3(0x183)]!=='folder'&&_0x4b4bb3[_0x1c62b3(0x183)]!==_0x1c62b3(0x189))return console['error'](_0x1c62b3(0x16f)),0x1;_0x31ca98=_0x4b4bb3[_0x1c62b3(0x186)];}else{if(_0x57b967['folder']){const _0x244c89=await withSpinner('Resolving\x20folder\x20\x27'+_0x57b967['folder']+_0x1c62b3(0x187),()=>_0x34832f[_0x1c62b3(0x15f)][_0x1c62b3(0x170)](_0x2da8a2,_0x57b967[_0x1c62b3(0x16c)]),{'verbose':_0x57b967[_0x1c62b3(0x164)]});_0x31ca98=_0x244c89[_0x1c62b3(0x182)];}}_0x57b967[_0x1c62b3(0x164)]&&_0x31ca98&&console[_0x1c62b3(0x185)](_0x1c62b3(0x174)+_0x31ca98);const _0x1d01c0=await loadJSONFromOptions(_0x57b967[_0x1c62b3(0x162)],_0x57b967['ruleFile']),_0x110eb2={'name':_0x4d658d,'description':_0x57b967[_0x1c62b3(0x16e)],'rule':_0x1d01c0,'kind':_0x57b967[_0x1c62b3(0x165)]!==undefined?parseInt(_0x57b967[_0x1c62b3(0x165)],0xa):undefined,'isVisible':_0x57b967[_0x1c62b3(0x184)]?![]:undefined,'segmentFolderId':_0x31ca98,'countPopulation':_0x57b967[_0x1c62b3(0x181)]?![]:undefined},_0x2d6fea=await withSpinner(_0x1c62b3(0x158)+_0x4d658d+_0x1c62b3(0x187),()=>_0x34832f[_0x1c62b3(0x15f)]['createSegment'](_0x2da8a2,_0x110eb2),{'verbose':_0x57b967['verbose']}),_0x552b14=_0x2d6fea[_0x1c62b3(0x182)];return console[_0x1c62b3(0x185)]('✔\x20Created\x20segment\x20\x27'+_0x552b14[_0x1c62b3(0x176)]+_0x1c62b3(0x17b)+_0x552b14['id']),_0x27f613!==_0x58ff4c&&console['error']('\x20\x20\x20Path:\x20'+_0x27f613),await handleSDKOutput([_0x552b14],_0x57b967),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x25297a=a34_0x5028;(function(_0x213456,_0x5917cc){const _0x19ca7c=a34_0x5028,_0x4dce49=_0x213456();while(!![]){try{const _0x5a8f1b=-parseInt(_0x19ca7c(0x168))/0x1*(-parseInt(_0x19ca7c(0x154))/0x2)+parseInt(_0x19ca7c(0x15d))/0x3*(-parseInt(_0x19ca7c(0x157))/0x4)+parseInt(_0x19ca7c(0x167))/0x5*(parseInt(_0x19ca7c(0x165))/0x6)+-parseInt(_0x19ca7c(0x15c))/0x7+-parseInt(_0x19ca7c(0x152))/0x8*(parseInt(_0x19ca7c(0x156))/0x9)+parseInt(_0x19ca7c(0x14d))/0xa*(-parseInt(_0x19ca7c(0x155))/0xb)+parseInt(_0x19ca7c(0x14e))/0xc*(parseInt(_0x19ca7c(0x163))/0xd);if(_0x5a8f1b===_0x5917cc)break;else _0x4dce49['push'](_0x4dce49['shift']());}catch(_0x21969a){_0x4dce49['push'](_0x4dce49['shift']());}}}(a34_0x13c9,0x89501));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';function a34_0x5028(_0x1be987,_0x5da407){_0x1be987=_0x1be987-0x14b;const _0x13c9f3=a34_0x13c9();let _0x5028a7=_0x13c9f3[_0x1be987];return _0x5028a7;}export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a34_0x25297a(0x14f)]=a34_0x25297a(0x14c);async[a34_0x25297a(0x158)](_0x5b0395){const _0x17c08f=a34_0x25297a,{options:_0x3ea955,args:_0x496e0f,tdx:_0x1044a9}=_0x5b0395,_0x3cd823=_0x496e0f[0x0]||_0x3ea955[_0x17c08f(0x15e)];if(!_0x3cd823)return console['error'](_0x17c08f(0x162)),console[_0x17c08f(0x161)](_0x17c08f(0x159)),console[_0x17c08f(0x161)](_0x17c08f(0x150)),0x1;_0x3ea955[_0x17c08f(0x153)]&&(console[_0x17c08f(0x161)]('Site:\x20'+_0x3ea955[_0x17c08f(0x15a)]),console[_0x17c08f(0x161)](_0x17c08f(0x15b)+_0x3cd823));const _0x18c199=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3cd823+_0x17c08f(0x160),()=>_0x1044a9['segment'][_0x17c08f(0x14b)](_0x3cd823),{'verbose':_0x3ea955[_0x17c08f(0x153)]}),_0x30943f=_0x18c199['data'];console[_0x17c08f(0x161)](_0x17c08f(0x151)+_0x30943f[_0x17c08f(0x166)]+'\x20field'+(_0x30943f[_0x17c08f(0x166)]!==0x1?'s':''));if(_0x3ea955[_0x17c08f(0x164)]||_0x3ea955[_0x17c08f(0x15f)])return await handleSDKOutput(_0x30943f,_0x3ea955),0x0;return displayFieldsHumanReadable(_0x30943f,_0x3cd823),0x0;}}function a34_0x13c9(){const _0xdeb5bb=['json','6HnpRpa','length','2895105dJKbkj','4OGilCU','listFields','List\x20available\x20fields\x20for\x20segmentation','108340djWSNl','14942244gbBmer','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','✔\x20Found\x20','8XRLYSb','verbose','117712mtdWyP','77ljadQJ','5256549TMgazK','7352JgVbQH','execute','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','site','Parent\x20segment:\x20','4252850HrSBsX','375ZKxZrc','parentSegment','jsonl','\x27...','error','Error:\x20Parent\x20segment\x20name\x20is\x20required','13wXJQPU'];a34_0x13c9=function(){return _0xdeb5bb;};return a34_0x13c9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x57ca53=a35_0x4c9b;(function(_0x12a98a,_0x242cf7){const _0x28271b=a35_0x4c9b,_0x869a1c=_0x12a98a();while(!![]){try{const _0x48a5df=-parseInt(_0x28271b(0x18b))/0x1+-parseInt(_0x28271b(0x1d5))/0x2*(-parseInt(_0x28271b(0x193))/0x3)+parseInt(_0x28271b(0x17c))/0x4*(parseInt(_0x28271b(0x170))/0x5)+parseInt(_0x28271b(0x196))/0x6+parseInt(_0x28271b(0x17f))/0x7+parseInt(_0x28271b(0x1e6))/0x8+-parseInt(_0x28271b(0x185))/0x9;if(_0x48a5df===_0x242cf7)break;else _0x869a1c['push'](_0x869a1c['shift']());}catch(_0x198fb2){_0x869a1c['push'](_0x869a1c['shift']());}}}(a35_0x3087,0xbf4b0));import{BaseCommand}from'./command.js';import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x251cba}from'../sdk/segment/journey-yaml.js';import a35_0x5d08b3 from'chalk';function a35_0x3087(){const _0x3c0e00=['segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','reduce','message','Write\x20','✔\x20Pulled\x20','parentSegment','journeyBundleId','then','\x20=\x20','parentFolderId','708MwGjlA','\x20new\x20files','Found\x20tdx.json\x20at:\x20','\x20files?','✔\x20Context\x20set:\x20','versionNumber','slice','setExtra','yaml','site','segmentFolderId','\x20\x20Target:\x20','Fetching\x20folders...','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)','set','relativePath','folderId','9792672jLgHUQ','795dQZBhf','dirname','\x0aPull\x20summary\x20for\x20\x27','utf-8','segment:pull','absolutePath','tdx.json','getJourney','hasChanges','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','size','2908CuJVkh','\x20unchanged\x20files','\x20with\x20','5665534tvqhKR','getActivation','get','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Resolved\x20parent\x20name:\x20','activationParams','21195333PLhKCd','user','push','diff','length','join','474842YwpoFB','has','values','✔\x20All\x20files\x20are\x20up\x20to\x20date','isNew','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','journey','3912tJcmiM','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','6016560yeDHbi','Fetching\x20connections\x20for\x20name\x20resolution...','name','yes','setPhase','Fetching\x20activations...','relative','\x20\x20🗺️\x20\x20','\x20journeys','attributes','.yml','resolveParentId','Fetching\x20segments...','Using\x20parent\x20segment:\x20','session','listFolders','Fetching\x20parent\x20segment\x20info...','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','red','\x0aChanges\x20to\x20\x27','journeyBundleName','description','\x20segments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Found\x20existing\x20tdx.json\x20at:\x20','isDirectory','green','yellow','Warning:\x20Could\x20not\x20resolve\x20activation\x20','rule','Fetching\x20journeys...','add','data','Parent\x20segment:\x20','from','listSegments','dim','activation_','\x20changed\x20files','filter','parent_segment','Fetching\x20users\x20for\x20email\x20resolution...','getParent','content','verbose','repeat','\x27...','\x20versions)','dryRun','kind','Processing\x20journeys...'];a35_0x3087=function(){return _0x3c0e00;};return a35_0x3087();}import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';function a35_0x4c9b(_0x16712a,_0x239fe9){_0x16712a=_0x16712a-0x170;const _0x3087aa=a35_0x3087();let _0x4c9b9b=_0x3087aa[_0x16712a];return _0x4c9b9b;}import a35_0x441f24 from'path';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{['name']=a35_0x57ca53(0x174);[a35_0x57ca53(0x1ac)]=a35_0x57ca53(0x1a8);async['execute'](_0x57c052){const _0x6b95cb=a35_0x57ca53,{options:_0x55642b,args:_0x115a89,tdx:_0xeaa8a6}=_0x57c052,_0x477e5a=_0x55642b,_0x44a0f8=_0x55642b[_0x6b95cb(0x1d0)],_0x206c38=_0x115a89[0x0],_0x816fa=findTdxConfigPath();let _0x296baa,_0x1a995;if(!_0x206c38&&_0x816fa){const _0x5df5e4=loadTdxConfig(_0x816fa);_0x296baa=_0x5df5e4['parent_segment'],_0x1a995=a35_0x441f24[_0x6b95cb(0x171)](_0x816fa),_0x477e5a[_0x6b95cb(0x1c3)]&&(console['error'](_0x6b95cb(0x1af)+_0x816fa),console[_0x6b95cb(0x194)]('Using\x20parent\x20segment:\x20'+_0x296baa));}else{if(_0x206c38){if(existsSync(_0x206c38)&&statSync(_0x206c38)[_0x6b95cb(0x1b0)]()){const _0x46a393=findTdxConfigPath(_0x206c38);if(_0x46a393){const _0x36e321=loadTdxConfig(_0x46a393);_0x296baa=_0x36e321['parent_segment'],_0x1a995=a35_0x441f24['dirname'](_0x46a393),_0x477e5a['verbose']&&(console['error'](_0x6b95cb(0x1d7)+_0x46a393),console[_0x6b95cb(0x194)](_0x6b95cb(0x1a3)+_0x296baa));}else return console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1a9)](_0x6b95cb(0x1cb)+_0x206c38+'\x0a')),console[_0x6b95cb(0x194)](a35_0x5d08b3['cyan'](_0x6b95cb(0x17a))),0x1;}else _0x296baa=_0x206c38;}else _0x296baa=_0x44a0f8;}if(!_0x296baa)return console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1b2)](_0x6b95cb(0x182))),console[_0x6b95cb(0x194)](_0x6b95cb(0x1e2)),console[_0x6b95cb(0x194)](_0x6b95cb(0x191)),console['error'](_0x6b95cb(0x195)),0x1;_0x477e5a['verbose']&&(console[_0x6b95cb(0x194)]('Site:\x20'+_0x477e5a[_0x6b95cb(0x1de)]),console['error'](_0x6b95cb(0x1b8)+_0x296baa));const _0xf63d82=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x296baa+_0x6b95cb(0x1c5),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1a1)](_0x296baa),{'verbose':_0x477e5a['verbose']}),_0x10c60a=_0xf63d82[_0x6b95cb(0x1b7)],_0x19b758=await withSpinner(_0x6b95cb(0x1a6),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1c1)](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]}),_0x569af6=_0x19b758[_0x6b95cb(0x1b7)][_0x6b95cb(0x19f)]['name'];_0x477e5a[_0x6b95cb(0x1c3)]&&console['error'](_0x6b95cb(0x183)+_0x569af6);const [_0x43f25e,_0x26f0ef,_0xca5e88]=await Promise['all']([withSpinner(_0x6b95cb(0x1a2),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1ba)](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]}),withSpinner(_0x6b95cb(0x1e1),()=>_0xeaa8a6[_0x6b95cb(0x1ca)][_0x6b95cb(0x1a5)](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]}),withSpinner(_0x6b95cb(0x1b5),()=>_0xeaa8a6['journey']['listJourneysFromParentSegment'](_0x10c60a),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]})]),_0x28e134=_0x43f25e['data'],_0x3f0a11=_0x26f0ef[_0x6b95cb(0x1b7)],_0x3d6eea=_0xca5e88[_0x6b95cb(0x1b7)];if(_0x28e134[_0x6b95cb(0x189)]===0x0&&_0x3d6eea[_0x6b95cb(0x189)]===0x0)return console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1b2)](_0x6b95cb(0x190)+_0x569af6+'\x27')),0x0;const _0x10189c=buildFolderPathMap(_0x3f0a11),_0x349f65=_0x1a995||getSegmentRootDir(sanitizeFileName(_0x296baa)),_0x51c8a6=new Map();await withSpinner(_0x6b95cb(0x19b),async()=>{await batchAsync(_0x28e134,async _0x310c06=>{const _0x47df01=a35_0x4c9b,_0x43f1aa=await _0xeaa8a6[_0x47df01(0x1ca)]['listActivations'](_0x10c60a,_0x310c06['id']);_0x51c8a6['set'](_0x310c06['id'],_0x43f1aa);});},{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]});const _0x5577a9=await withSpinner(_0x6b95cb(0x1c0),()=>_0xeaa8a6[_0x6b95cb(0x186)]['buildIdToEmailMap'](),{'verbose':_0x477e5a['verbose']})[_0x6b95cb(0x1d2)](_0x4d5e86=>_0x4d5e86['data']),_0x31c3b2=await withSpinner(_0x6b95cb(0x197),()=>_0xeaa8a6['connection']['buildIdToNameMap'](),{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]})['then'](_0x5e7020=>_0x5e7020[_0x6b95cb(0x1b7)]),_0x418cd=[],_0x573b89=a35_0x441f24['join'](_0x349f65,_0x6b95cb(0x176)),_0x411f86=createTdxConfigContent(_0x569af6);_0x418cd[_0x6b95cb(0x187)](prepareFile(_0x573b89,_0x411f86,_0x349f65));const _0x2cc359=new Map();for(const _0x209869 of _0x28e134){if(_0x209869['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x46ae15=_0x209869['segmentFolderId']?_0x10189c['get'](_0x209869[_0x6b95cb(0x1df)])||'':'',_0x19b262=_0x51c8a6[_0x6b95cb(0x181)](_0x209869['id'])||[],_0x33f7d2=segmentWithActivationsToYaml(_0x209869,_0x19b262,undefined,_0x5577a9,_0x31c3b2),_0x1fa1d9=_0x46ae15?a35_0x441f24[_0x6b95cb(0x18a)](_0x349f65,_0x46ae15):_0x349f65,_0x5c5ecc=sanitizeFileName(_0x209869[_0x6b95cb(0x198)]),_0x38ecb7=getUniqueFileName(_0x1fa1d9,_0x5c5ecc,_0x2cc359),_0x300c64=a35_0x441f24[_0x6b95cb(0x18a)](_0x1fa1d9,_0x38ecb7+_0x6b95cb(0x1a0)),_0x14cc86=segmentToYamlString(_0x33f7d2);_0x418cd['push'](prepareFile(_0x300c64,_0x14cc86,_0x349f65));}const _0x47df8b=new Map();for(const _0x496cea of _0x28e134){_0x47df8b[_0x6b95cb(0x1e3)](_0x496cea['id'],_0x496cea);}const _0x370c4c=new Map();for(const _0x231395 of _0x3d6eea){const _0xfe6abe=_0x231395[_0x6b95cb(0x1d1)];!_0x370c4c[_0x6b95cb(0x18c)](_0xfe6abe)&&_0x370c4c[_0x6b95cb(0x1e3)](_0xfe6abe,[]),_0x370c4c[_0x6b95cb(0x181)](_0xfe6abe)[_0x6b95cb(0x187)](_0x231395);}for(const _0x7b07e1 of _0x370c4c['values']()){_0x7b07e1['sort']((_0x43e694,_0x5d3468)=>(_0x43e694[_0x6b95cb(0x1da)]||0x0)-(_0x5d3468[_0x6b95cb(0x1da)]||0x0));}const _0x5960a4=()=>{const _0x5d126c=_0x6b95cb,_0x4f4140=new Set(),_0xca2e40=new Set(),_0x470c8d=new Map(),_0x253805=new Map(),_0x40e4b0=createJumpTargetCache(),_0x5f4579=(_0x474160,_0xcc7e9a)=>({'resolveSegment':async _0x3011de=>{const _0x448c8f=a35_0x4c9b,_0x52c810=_0x470c8d[_0x448c8f(0x181)](_0x3011de);if(_0x52c810!==undefined)return{'name':_0x52c810,'isJourneyLocal':!![]};if(!_0xcc7e9a)return{'name':_0x3011de,'isJourneyLocal':![]};try{let _0x1c2ad3=_0x47df8b[_0x448c8f(0x181)](_0x3011de);!_0x1c2ad3&&(_0x1c2ad3=await _0xeaa8a6[_0x448c8f(0x1ca)]['getSegment'](_0xcc7e9a,_0x3011de));const _0xf5a340=generateJourneyLocalName(_0x1c2ad3[_0x448c8f(0x198)]),_0x44a356=_0x1c2ad3[_0x448c8f(0x1c8)]===SEGMENT_KIND_JOURNEY&&_0xf5a340!==undefined;let _0x6dcfa7=_0x1c2ad3[_0x448c8f(0x198)];if(_0x44a356&&_0xf5a340){let _0x555890=_0xf5a340,_0x1583e1=0x2;while(_0x4f4140[_0x448c8f(0x18c)](_0x555890)){_0x555890=_0xf5a340+'_'+_0x1583e1,_0x1583e1++;}_0x4f4140[_0x448c8f(0x1b6)](_0x555890),_0x6dcfa7=_0x555890,_0x470c8d['set'](_0x3011de,_0x6dcfa7);}let _0x33e395;return _0x44a356&&_0x1c2ad3[_0x448c8f(0x1b4)]&&(_0x33e395={'description':_0x1c2ad3[_0x448c8f(0x1ac)],'rule':apiRuleToYaml(_0x1c2ad3[_0x448c8f(0x1b4)])}),{'name':_0x6dcfa7,'isJourneyLocal':_0x44a356,'definition':_0x33e395};}catch(_0x311e98){return _0x477e5a[_0x448c8f(0x1c3)]&&console['error'](_0x448c8f(0x1a7)+_0x3011de+':\x20'+_0x311e98[_0x448c8f(0x1cd)]),{'name':_0x3011de,'isJourneyLocal':![]};}},'resolveActivation':async _0x5e6843=>{const _0x18461=a35_0x4c9b,_0x5d33de=_0x253805[_0x18461(0x181)](_0x5e6843);if(_0x5d33de!==undefined)return{'name':_0x5d33de,'isJourneyLocal':!![]};try{const _0x17fbcd=await _0xeaa8a6['journey'][_0x18461(0x180)](_0x474160,_0x5e6843),_0x1ab719=_0x17fbcd[_0x18461(0x19f)][_0x18461(0x184)][_0x18461(0x198)]||_0x5e6843,_0x39b89c=sanitizeYamlKey(_0x1ab719)||_0x18461(0x1bc)+_0x5e6843;let _0x56a1c6=_0x39b89c,_0xe539db=0x2;while(_0xca2e40[_0x18461(0x18c)](_0x56a1c6)){_0x56a1c6=_0x39b89c+'_'+_0xe539db,_0xe539db++;}_0xca2e40[_0x18461(0x1b6)](_0x56a1c6),_0x253805[_0x18461(0x1e3)](_0x5e6843,_0x56a1c6);const _0x2ca8d2=journeyActivationStepToYaml(_0x17fbcd,_0x5577a9,_0x31c3b2);return{'name':_0x56a1c6,'isJourneyLocal':!![],'definition':_0x2ca8d2};}catch(_0x546ae4){return _0x477e5a['verbose']&&console[_0x18461(0x194)](_0x18461(0x1b3)+_0x5e6843+':\x20'+_0x546ae4[_0x18461(0x1cd)]),{'name':_0x5e6843,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x48d773,_0x41cdf7)=>resolveJumpTarget(_0x48d773,_0x41cdf7,_0x40e4b0,_0x1d8f4f=>_0xeaa8a6[_0x5d126c(0x192)][_0x5d126c(0x177)](_0x1d8f4f))});return{'createYamlContext':_0x5f4579};};if(_0x370c4c[_0x6b95cb(0x17b)]>0x0){const _0x3c68c7=Array['from'](_0x370c4c[_0x6b95cb(0x18d)]()),_0x46e6e6=await withQuerySpinner(_0x6b95cb(0x1c9),async _0x5d51c5=>{const _0x23470f=_0x6b95cb,_0x405aa6=[];let _0x532b05=0x0;const _0x175de6=0x5;for(let _0x45c68b=0x0;_0x45c68b<_0x3c68c7[_0x23470f(0x189)];_0x45c68b+=_0x175de6){const _0x183d6f=_0x3c68c7[_0x23470f(0x1db)](_0x45c68b,_0x45c68b+_0x175de6),_0x136391=await Promise['all'](_0x183d6f['map'](async _0x789b7d=>{const _0x47f87a=_0x23470f,_0x2b0f17=_0x789b7d[0x0],_0x347f00=_0x2b0f17[_0x47f87a(0x1ab)];_0x5d51c5[_0x47f87a(0x19a)]('Fetching\x20journey\x20\x27'+_0x347f00+'\x27');const _0x474dea=_0x2b0f17[_0x47f87a(0x1e5)]?_0x10189c[_0x47f87a(0x181)](_0x2b0f17[_0x47f87a(0x1e5)])||'':'',{createYamlContext:_0xa3c5e0}=_0x5960a4(),_0x1021e1=[];for(const _0x5eae41 of _0x789b7d){const _0x4768d6=await _0xeaa8a6[_0x47f87a(0x192)][_0x47f87a(0x177)](_0x5eae41['id']),_0xc02c8c=_0x4768d6[_0x47f87a(0x19f)]?.['audienceId'],_0x59cce9=_0xa3c5e0(_0x5eae41['id'],_0xc02c8c),_0x3358f0=await apiToYamlAsync(_0x4768d6,_0x59cce9);_0x1021e1[_0x47f87a(0x187)]({'item':_0x5eae41,'yaml':_0x3358f0});}let _0x1478db;return _0x1021e1[_0x47f87a(0x189)]===0x1?_0x1478db=_0x1021e1[0x0][_0x47f87a(0x1dd)]:_0x1478db=buildMergedJourneyYaml(_0x1021e1),{'bundleName':_0x347f00,'folderPath':_0x474dea,'finalYaml':_0x1478db};}));_0x405aa6[_0x23470f(0x187)](..._0x136391),_0x532b05+=_0x183d6f[_0x23470f(0x189)],_0x5d51c5[_0x23470f(0x1dc)]('('+_0x532b05+'/'+_0x3c68c7[_0x23470f(0x189)]+')');}return _0x405aa6;},{'verbose':_0x477e5a[_0x6b95cb(0x1c3)]});for(const {bundleName:_0x34b32a,folderPath:_0x4dd62f,finalYaml:_0x15baaf}of _0x46e6e6['data']){const _0xde358f=a35_0x251cba(_0x15baaf),_0x51d4a5=_0x4dd62f?a35_0x441f24[_0x6b95cb(0x18a)](_0x349f65,_0x4dd62f):_0x349f65,_0x9e3572=sanitizeFileName(_0x34b32a),_0x3cc3a6=getUniqueFileName(_0x51d4a5,_0x9e3572,_0x2cc359),_0x44a48f=a35_0x441f24[_0x6b95cb(0x18a)](_0x51d4a5,_0x3cc3a6+_0x6b95cb(0x1a0));_0x418cd[_0x6b95cb(0x187)](prepareFile(_0x44a48f,_0xde358f,_0x349f65));}}const _0x5409b1=Array[_0x6b95cb(0x1b9)](_0x51c8a6[_0x6b95cb(0x18d)]())[_0x6b95cb(0x1cc)]((_0x2f79d4,_0x9c1393)=>_0x2f79d4+_0x9c1393['length'],0x0),_0x2a2cca=_0x418cd['filter'](_0x505027=>_0x505027['isNew']),_0x3a8613=_0x418cd[_0x6b95cb(0x1be)](_0xf036fc=>!_0xf036fc[_0x6b95cb(0x18f)]&&_0xf036fc[_0x6b95cb(0x178)]),_0x4478b7=_0x418cd['filter'](_0xcab230=>!_0xcab230['isNew']&&!_0xcab230[_0x6b95cb(0x178)]),_0x2d6fc2=_0x28e134[_0x6b95cb(0x1be)](_0x8e0f15=>_0x8e0f15['kind']!==SEGMENT_KIND_JOURNEY);console[_0x6b95cb(0x194)](_0x6b95cb(0x172)+_0x569af6+'\x27:'),console[_0x6b95cb(0x194)]('\x20\x20🎯\x20'+a35_0x5d08b3[_0x6b95cb(0x179)](_0x2d6fc2[_0x6b95cb(0x189)]+_0x6b95cb(0x1ad))+_0x6b95cb(0x17e)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x5409b1+'\x20activations'));if(_0x370c4c[_0x6b95cb(0x17b)]>0x0){const _0x3ff0be=_0x3d6eea[_0x6b95cb(0x189)],_0x328def=_0x370c4c[_0x6b95cb(0x17b)],_0x19aa23=_0x3ff0be>_0x328def?'\x20('+_0x3ff0be+_0x6b95cb(0x1c6):'';console[_0x6b95cb(0x194)](_0x6b95cb(0x19d)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x328def+_0x6b95cb(0x19e))+a35_0x5d08b3[_0x6b95cb(0x1bb)](_0x19aa23));}console[_0x6b95cb(0x194)]('\x20\x20'+a35_0x5d08b3['green']('+\x20'+_0x2a2cca[_0x6b95cb(0x189)]+_0x6b95cb(0x1d6))),console[_0x6b95cb(0x194)]('\x20\x20'+a35_0x5d08b3[_0x6b95cb(0x1b2)]('~\x20'+_0x3a8613[_0x6b95cb(0x189)]+_0x6b95cb(0x1bd))),console[_0x6b95cb(0x194)]('\x20\x20'+a35_0x5d08b3[_0x6b95cb(0x1bb)]('=\x20'+_0x4478b7[_0x6b95cb(0x189)]+_0x6b95cb(0x17d))),console[_0x6b95cb(0x194)](_0x6b95cb(0x1e0)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x349f65)+'\x0a');if(_0x3a8613[_0x6b95cb(0x189)]>0x0)for(const _0x2b86f0 of _0x3a8613){console['error'](_0x6b95cb(0x1aa)+_0x2b86f0[_0x6b95cb(0x1e4)]+'\x27:'),console[_0x6b95cb(0x194)]('─'[_0x6b95cb(0x1c4)](0x3c)),console[_0x6b95cb(0x194)](_0x2b86f0[_0x6b95cb(0x188)]),console['error']('─'[_0x6b95cb(0x1c4)](0x3c));}if(_0x477e5a[_0x6b95cb(0x1c7)])return console['error'](a35_0x5d08b3[_0x6b95cb(0x1b2)](_0x6b95cb(0x1ae))),0x0;if(_0x2a2cca['length']===0x0&&_0x3a8613['length']===0x0)return console[_0x6b95cb(0x194)](a35_0x5d08b3['green'](_0x6b95cb(0x18e))),saveSessionContext({'parent_segment':_0x569af6},_0x477e5a[_0x6b95cb(0x1a4)]),console[_0x6b95cb(0x194)](a35_0x5d08b3['green'](_0x6b95cb(0x1d9)+a35_0x5d08b3[_0x6b95cb(0x1bb)](_0x6b95cb(0x1bf))+_0x6b95cb(0x1d3)+a35_0x5d08b3[_0x6b95cb(0x179)](_0x569af6))),0x0;if(!_0x477e5a[_0x6b95cb(0x199)]&&(_0x2a2cca['length']>0x0||_0x3a8613[_0x6b95cb(0x189)]>0x0)){const _0x48e62b=await confirmKey(_0x6b95cb(0x1ce)+(_0x2a2cca[_0x6b95cb(0x189)]+_0x3a8613[_0x6b95cb(0x189)])+_0x6b95cb(0x1d8));if(!_0x48e62b)return console[_0x6b95cb(0x194)]('Aborted.'),0x1;}for(const _0x2b7327 of _0x418cd){if(_0x2b7327[_0x6b95cb(0x18f)]||_0x2b7327[_0x6b95cb(0x178)]){const _0x3d9b7b=a35_0x441f24[_0x6b95cb(0x171)](_0x2b7327[_0x6b95cb(0x175)]);!existsSync(_0x3d9b7b)&&mkdirSync(_0x3d9b7b,{'recursive':!![]}),writeFileSync(_0x2b7327[_0x6b95cb(0x175)],_0x2b7327[_0x6b95cb(0x1c2)],'utf-8');}}return console[_0x6b95cb(0x194)](a35_0x5d08b3['green'](_0x6b95cb(0x1cf)+(_0x2a2cca[_0x6b95cb(0x189)]+_0x3a8613[_0x6b95cb(0x189)])+'\x20files\x20to\x20'+_0x349f65)),saveSessionContext({'parent_segment':_0x569af6},_0x477e5a[_0x6b95cb(0x1a4)]),console[_0x6b95cb(0x194)](a35_0x5d08b3[_0x6b95cb(0x1b1)]('✔\x20Context\x20set:\x20'+a35_0x5d08b3[_0x6b95cb(0x1bb)](_0x6b95cb(0x1bf))+_0x6b95cb(0x1d3)+a35_0x5d08b3['cyan'](_0x569af6))),0x0;}}function buildFolderPathMap(_0x4591b2){const _0x5249e5=a35_0x57ca53,_0x5a3e73=new Map(),_0x1b97b6=new Map();for(const _0x478eb9 of _0x4591b2){_0x1b97b6['set'](_0x478eb9['id'],_0x478eb9);}const _0x3604e4=new Set();for(const _0x23f0c2 of _0x4591b2){!_0x23f0c2[_0x5249e5(0x1d4)]&&_0x3604e4[_0x5249e5(0x1b6)](_0x23f0c2['id']);}function _0x219eb3(_0x173315){const _0x372df=_0x5249e5;if(_0x5a3e73['has'](_0x173315['id']))return _0x5a3e73[_0x372df(0x181)](_0x173315['id']);if(_0x3604e4['has'](_0x173315['id']))return _0x5a3e73[_0x372df(0x1e3)](_0x173315['id'],''),'';if(_0x173315[_0x372df(0x1d4)]){const _0x5d2198=_0x1b97b6[_0x372df(0x181)](_0x173315[_0x372df(0x1d4)]);if(_0x5d2198){const _0x38bea1=_0x219eb3(_0x5d2198),_0x15a4cd=_0x38bea1?_0x38bea1+'/'+_0x173315[_0x372df(0x198)]:_0x173315[_0x372df(0x198)];return _0x5a3e73['set'](_0x173315['id'],_0x15a4cd),_0x15a4cd;}}const _0x570af2=_0x173315[_0x372df(0x198)];return _0x5a3e73[_0x372df(0x1e3)](_0x173315['id'],_0x570af2),_0x570af2;}for(const _0x26399a of _0x4591b2){_0x219eb3(_0x26399a);}return _0x5a3e73;}function getUniqueFileName(_0x4d4dc6,_0x3ca851,_0x22e4d2){const _0x177eaa=a35_0x57ca53,_0x44eedc=_0x4d4dc6+':'+_0x3ca851,_0x4257cf=_0x22e4d2[_0x177eaa(0x181)](_0x44eedc)||0x0;_0x22e4d2[_0x177eaa(0x1e3)](_0x44eedc,_0x4257cf+0x1);if(_0x4257cf===0x0)return _0x3ca851;return _0x3ca851+'-'+_0x4257cf;}function prepareFile(_0x4e37f8,_0x4846d9,_0x1ed564){const _0x11ca61=a35_0x57ca53,_0x44bae0=a35_0x441f24[_0x11ca61(0x19c)](_0x1ed564,_0x4e37f8);if(existsSync(_0x4e37f8)){const _0x5ca8de=readFileSync(_0x4e37f8,_0x11ca61(0x173)),_0xdfc9b9=generateDiff(_0x5ca8de,_0x4846d9),_0x3c152a=hasChanges(_0xdfc9b9);return{'relativePath':_0x44bae0,'absolutePath':_0x4e37f8,'content':_0x4846d9,'isNew':![],'hasChanges':_0x3c152a,'diff':_0x3c152a?formatDiffWithColors(_0xdfc9b9):undefined};}return{'relativePath':_0x44bae0,'absolutePath':_0x4e37f8,'content':_0x4846d9,'isNew':!![],'hasChanges':![]};}
|
|
1
|
+
const a35_0x4ce8e6=a35_0x5099;(function(_0x333b29,_0x2fe5f3){const _0x5d90e6=a35_0x5099,_0x2df1ce=_0x333b29();while(!![]){try{const _0x1c21b9=-parseInt(_0x5d90e6(0x110))/0x1+-parseInt(_0x5d90e6(0xe3))/0x2*(parseInt(_0x5d90e6(0xd5))/0x3)+parseInt(_0x5d90e6(0x13d))/0x4*(-parseInt(_0x5d90e6(0x12c))/0x5)+-parseInt(_0x5d90e6(0x128))/0x6+-parseInt(_0x5d90e6(0x122))/0x7*(parseInt(_0x5d90e6(0xdc))/0x8)+parseInt(_0x5d90e6(0x134))/0x9*(parseInt(_0x5d90e6(0xde))/0xa)+parseInt(_0x5d90e6(0xec))/0xb;if(_0x1c21b9===_0x2fe5f3)break;else _0x2df1ce['push'](_0x2df1ce['shift']());}catch(_0x3eaa47){_0x2df1ce['push'](_0x2df1ce['shift']());}}}(a35_0x36a8,0x1c40a));import{BaseCommand}from'./command.js';function a35_0x36a8(){const _0x23e8ee=['620vIZggt','\x0aChanges\x20to\x20\x27','Processing\x20journeys...','dim','audienceId','14030QbeFvF','getActivation','relativePath','\x20versions)','from','values','Fetching\x20activations...','\x20=\x20','Write\x20','7506400xLQgQn','push','\x0aPull\x20summary\x20for\x20\x27','Fetching\x20users\x20for\x20email\x20resolution...','slice','Fetching\x20connections\x20for\x20name\x20resolution...','absolutePath','hasChanges','green','✔\x20Pulled\x20','\x20\x20🗺️\x20\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20changed\x20files','listSegments','content','message','session','Fetching\x20parent\x20segment\x20info...','\x20files\x20to\x20','Aborted.','connection','journeyBundleId','map','Resolving\x20parent\x20segment\x20\x27','parent_segment','\x20\x20Target:\x20','dirname','segment:pull','attributes','all','verbose','cyan','Resolved\x20parent\x20name:\x20','join','journeyBundleName','Parent\x20segment:\x20','183953yylXXV','\x20new\x20files','resolveParentId','diff','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Found\x20existing\x20tdx.json\x20at:\x20','name','repeat','site','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','isNew','Fetching\x20folders...','Found\x20tdx.json\x20at:\x20','execute','versionNumber','user','has','77NAqIjF','reduce','getJourney','filter','getSegment','Fetching\x20segments...','1181298BMXZHR','yellow','.yml','segmentFolderId','8355GYGCBO','data','journey','rule','relative','\x20activations','kind','listJourneysFromParentSegment','4041dNfMoH','Fetching\x20journey\x20\x27','set','segment','get','✔\x20Context\x20set:\x20','folderId','activation_','buildIdToEmailMap','180YgHRkS','setPhase','Warning:\x20Could\x20not\x20resolve\x20activation\x20','yes','parentFolderId','Using\x20parent\x20segment:\x20','then','Fetching\x20journeys...','getParent','length','listFolders','\x20segments','\x27...','27caDLZJ','buildIdToNameMap','isDirectory','add','red','size','parentSegment','54800VRZvZR','error'];a35_0x36a8=function(){return _0x23e8ee;};return a35_0x36a8();}import{withSpinner,withQuerySpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString,apiRuleToYaml,journeyActivationStepToYaml}from'../sdk/segment/child-segment-yaml.js';import{apiToYamlAsync,toYamlString as a35_0x47142e}from'../sdk/segment/journey-yaml.js';import a35_0xfbd8a5 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a35_0xcc50b from'path';import{sanitizeFileName}from'../utils/string-utils.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';export class SegmentPullCommand extends BaseCommand{[a35_0x4ce8e6(0x117)]=a35_0x4ce8e6(0x107);['description']=a35_0x4ce8e6(0x115);async[a35_0x4ce8e6(0x11e)](_0x337642){const _0x39628c=a35_0x4ce8e6,{options:_0x303a54,args:_0x4d3291,tdx:_0x193b24}=_0x337642,_0x59a985=_0x303a54,_0xf424e4=_0x303a54[_0x39628c(0xdb)],_0x173ca0=_0x4d3291[0x0],_0x8815e2=findTdxConfigPath();let _0x18b0eb,_0x55a966;if(!_0x173ca0&&_0x8815e2){const _0x2d128a=loadTdxConfig(_0x8815e2);_0x18b0eb=_0x2d128a[_0x39628c(0x104)],_0x55a966=a35_0xcc50b[_0x39628c(0x106)](_0x8815e2),_0x59a985['verbose']&&(console['error'](_0x39628c(0x116)+_0x8815e2),console[_0x39628c(0xdd)](_0x39628c(0xcd)+_0x18b0eb));}else{if(_0x173ca0){if(existsSync(_0x173ca0)&&statSync(_0x173ca0)[_0x39628c(0xd7)]()){const _0xbe4244=findTdxConfigPath(_0x173ca0);if(_0xbe4244){const _0x283601=loadTdxConfig(_0xbe4244);_0x18b0eb=_0x283601['parent_segment'],_0x55a966=a35_0xcc50b[_0x39628c(0x106)](_0xbe4244),_0x59a985[_0x39628c(0x10a)]&&(console[_0x39628c(0xdd)](_0x39628c(0x11d)+_0xbe4244),console['error'](_0x39628c(0xcd)+_0x18b0eb));}else return console['error'](a35_0xfbd8a5[_0x39628c(0xd9)](_0x39628c(0x11a)+_0x173ca0+'\x0a')),console[_0x39628c(0xdd)](a35_0xfbd8a5['cyan'](_0x39628c(0x114))),0x1;}else _0x18b0eb=_0x173ca0;}else _0x18b0eb=_0xf424e4;}if(!_0x18b0eb)return console['error'](a35_0xfbd8a5[_0x39628c(0x129)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x39628c(0xdd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file'),0x1;_0x59a985['verbose']&&(console[_0x39628c(0xdd)]('Site:\x20'+_0x59a985[_0x39628c(0x119)]),console[_0x39628c(0xdd)](_0x39628c(0x10f)+_0x18b0eb));const _0x68b661=await withSpinner(_0x39628c(0x103)+_0x18b0eb+_0x39628c(0xd4),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0x112)](_0x18b0eb),{'verbose':_0x59a985['verbose']}),_0x376b31=_0x68b661[_0x39628c(0x12d)],_0x323043=await withSpinner(_0x39628c(0xfd),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0xd0)](_0x376b31),{'verbose':_0x59a985[_0x39628c(0x10a)]}),_0x41a802=_0x323043[_0x39628c(0x12d)]['attributes'][_0x39628c(0x117)];_0x59a985[_0x39628c(0x10a)]&&console[_0x39628c(0xdd)](_0x39628c(0x10c)+_0x41a802);const [_0x3667b9,_0x3dba67,_0x48e37f]=await Promise[_0x39628c(0x109)]([withSpinner(_0x39628c(0x127),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0xf9)](_0x376b31),{'verbose':_0x59a985[_0x39628c(0x10a)]}),withSpinner(_0x39628c(0x11c),()=>_0x193b24[_0x39628c(0x137)][_0x39628c(0xd2)](_0x376b31),{'verbose':_0x59a985[_0x39628c(0x10a)]}),withSpinner(_0x39628c(0xcf),()=>_0x193b24[_0x39628c(0x12e)][_0x39628c(0x133)](_0x376b31),{'verbose':_0x59a985['verbose']})]),_0x37e804=_0x3667b9[_0x39628c(0x12d)],_0x4c29a5=_0x3dba67[_0x39628c(0x12d)],_0x559698=_0x48e37f[_0x39628c(0x12d)];if(_0x37e804[_0x39628c(0xd1)]===0x0&&_0x559698[_0x39628c(0xd1)]===0x0)return console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0x129)](_0x39628c(0xf7)+_0x41a802+'\x27')),0x0;const _0x4bd89e=buildFolderPathMap(_0x4c29a5),_0x3b291f=_0x55a966||getSegmentRootDir(sanitizeFileName(_0x18b0eb)),_0x461ddc=new Map();await withSpinner(_0x39628c(0xe9),async()=>{await batchAsync(_0x37e804,async _0x5b0064=>{const _0x5d564a=a35_0x5099,_0x2c04d4=await _0x193b24['segment']['listActivations'](_0x376b31,_0x5b0064['id']);_0x461ddc[_0x5d564a(0x136)](_0x5b0064['id'],_0x2c04d4);});},{'verbose':_0x59a985[_0x39628c(0x10a)]});const _0x35c75c=await withSpinner(_0x39628c(0xef),()=>_0x193b24[_0x39628c(0x120)][_0x39628c(0x13c)](),{'verbose':_0x59a985[_0x39628c(0x10a)]})[_0x39628c(0xce)](_0x3b91d8=>_0x3b91d8[_0x39628c(0x12d)]),_0x4c52bf=await withSpinner(_0x39628c(0xf1),()=>_0x193b24[_0x39628c(0x100)][_0x39628c(0xd6)](),{'verbose':_0x59a985[_0x39628c(0x10a)]})[_0x39628c(0xce)](_0x42286a=>_0x42286a[_0x39628c(0x12d)]),_0x88912a=[],_0x336d96=a35_0xcc50b[_0x39628c(0x10d)](_0x3b291f,'tdx.json'),_0x1744a8=createTdxConfigContent(_0x41a802);_0x88912a[_0x39628c(0xed)](prepareFile(_0x336d96,_0x1744a8,_0x3b291f));const _0x116c62=new Map();for(const _0x35db49 of _0x37e804){if(_0x35db49[_0x39628c(0x132)]===SEGMENT_KIND_JOURNEY)continue;const _0x3b61b3=_0x35db49[_0x39628c(0x12b)]?_0x4bd89e['get'](_0x35db49[_0x39628c(0x12b)])||'':'',_0x2984f0=_0x461ddc[_0x39628c(0x138)](_0x35db49['id'])||[],_0x383fd3=segmentWithActivationsToYaml(_0x35db49,_0x2984f0,undefined,_0x35c75c,_0x4c52bf),_0x49f958=_0x3b61b3?a35_0xcc50b['join'](_0x3b291f,_0x3b61b3):_0x3b291f,_0x43c206=sanitizeFileName(_0x35db49['name']),_0x383114=getUniqueFileName(_0x49f958,_0x43c206,_0x116c62),_0x1f7bb2=a35_0xcc50b[_0x39628c(0x10d)](_0x49f958,_0x383114+_0x39628c(0x12a)),_0x8e3b7a=segmentToYamlString(_0x383fd3);_0x88912a[_0x39628c(0xed)](prepareFile(_0x1f7bb2,_0x8e3b7a,_0x3b291f));}const _0x3548db=new Map();for(const _0x2efabf of _0x37e804){_0x3548db[_0x39628c(0x136)](_0x2efabf['id'],_0x2efabf);}const _0x52064b=new Map();for(const _0x5bdfd9 of _0x559698){const _0x2436b6=_0x5bdfd9[_0x39628c(0x101)];!_0x52064b[_0x39628c(0x121)](_0x2436b6)&&_0x52064b['set'](_0x2436b6,[]),_0x52064b[_0x39628c(0x138)](_0x2436b6)[_0x39628c(0xed)](_0x5bdfd9);}for(const _0x451266 of _0x52064b[_0x39628c(0xe8)]()){_0x451266['sort']((_0x455105,_0x115c3f)=>(_0x455105[_0x39628c(0x11f)]||0x0)-(_0x115c3f[_0x39628c(0x11f)]||0x0));}const _0xa6b712=()=>{const _0x578807=_0x39628c,_0xc62911=new Set(),_0x3ba5ed=new Set(),_0x58eb03=new Map(),_0x123f34=new Map(),_0x50606e=createJumpTargetCache(),_0x3dd2b2=(_0x2fbe67,_0x2fd627)=>({'resolveSegment':async _0x4cb330=>{const _0x26033e=a35_0x5099,_0x3a8265=_0x58eb03[_0x26033e(0x138)](_0x4cb330);if(_0x3a8265!==undefined)return{'name':_0x3a8265,'isJourneyLocal':!![]};if(!_0x2fd627)return{'name':_0x4cb330,'isJourneyLocal':![]};try{let _0x5f3645=_0x3548db[_0x26033e(0x138)](_0x4cb330);!_0x5f3645&&(_0x5f3645=await _0x193b24[_0x26033e(0x137)][_0x26033e(0x126)](_0x2fd627,_0x4cb330));const _0x5a67a8=generateJourneyLocalName(_0x5f3645[_0x26033e(0x117)]),_0x511693=_0x5f3645[_0x26033e(0x132)]===SEGMENT_KIND_JOURNEY&&_0x5a67a8!==undefined;let _0x4934fc=_0x5f3645[_0x26033e(0x117)];if(_0x511693&&_0x5a67a8){let _0xcbaa8e=_0x5a67a8,_0xedbb7a=0x2;while(_0xc62911['has'](_0xcbaa8e)){_0xcbaa8e=_0x5a67a8+'_'+_0xedbb7a,_0xedbb7a++;}_0xc62911[_0x26033e(0xd8)](_0xcbaa8e),_0x4934fc=_0xcbaa8e,_0x58eb03[_0x26033e(0x136)](_0x4cb330,_0x4934fc);}let _0x12e6c9;return _0x511693&&_0x5f3645[_0x26033e(0x12f)]&&(_0x12e6c9={'description':_0x5f3645['description'],'rule':apiRuleToYaml(_0x5f3645[_0x26033e(0x12f)])}),{'name':_0x4934fc,'isJourneyLocal':_0x511693,'definition':_0x12e6c9};}catch(_0x7f9530){return _0x59a985[_0x26033e(0x10a)]&&console[_0x26033e(0xdd)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x4cb330+':\x20'+_0x7f9530[_0x26033e(0xfb)]),{'name':_0x4cb330,'isJourneyLocal':![]};}},'resolveActivation':async _0x58e17c=>{const _0xdeca34=a35_0x5099,_0x164d6a=_0x123f34[_0xdeca34(0x138)](_0x58e17c);if(_0x164d6a!==undefined)return{'name':_0x164d6a,'isJourneyLocal':!![]};try{const _0xeef562=await _0x193b24['journey'][_0xdeca34(0xe4)](_0x2fbe67,_0x58e17c),_0x5c284=_0xeef562['attributes']['activationParams']['name']||_0x58e17c,_0x49d233=sanitizeYamlKey(_0x5c284)||_0xdeca34(0x13b)+_0x58e17c;let _0xf478a8=_0x49d233,_0xff83c2=0x2;while(_0x3ba5ed[_0xdeca34(0x121)](_0xf478a8)){_0xf478a8=_0x49d233+'_'+_0xff83c2,_0xff83c2++;}_0x3ba5ed[_0xdeca34(0xd8)](_0xf478a8),_0x123f34[_0xdeca34(0x136)](_0x58e17c,_0xf478a8);const _0x1d4f70=journeyActivationStepToYaml(_0xeef562,_0x35c75c,_0x4c52bf);return{'name':_0xf478a8,'isJourneyLocal':!![],'definition':_0x1d4f70};}catch(_0x2481e7){return _0x59a985['verbose']&&console[_0xdeca34(0xdd)](_0xdeca34(0xca)+_0x58e17c+':\x20'+_0x2481e7[_0xdeca34(0xfb)]),{'name':_0x58e17c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x49cb66,_0x299b70)=>resolveJumpTarget(_0x49cb66,_0x299b70,_0x50606e,_0x152a8d=>_0x193b24[_0x578807(0x12e)][_0x578807(0x124)](_0x152a8d))});return{'createYamlContext':_0x3dd2b2};};if(_0x52064b[_0x39628c(0xda)]>0x0){const _0x52dbd1=Array[_0x39628c(0xe7)](_0x52064b[_0x39628c(0xe8)]()),_0x11fae5=await withQuerySpinner(_0x39628c(0xe0),async _0x3984b8=>{const _0x45ad68=_0x39628c,_0x4de842=[];let _0x5e65f2=0x0;const _0x5d282f=0x5;for(let _0x4f923a=0x0;_0x4f923a<_0x52dbd1['length'];_0x4f923a+=_0x5d282f){const _0x30d367=_0x52dbd1[_0x45ad68(0xf0)](_0x4f923a,_0x4f923a+_0x5d282f),_0x2e7da5=await Promise[_0x45ad68(0x109)](_0x30d367[_0x45ad68(0x102)](async _0x4696db=>{const _0x23460f=_0x45ad68,_0x23bdc1=_0x4696db[0x0],_0x8aa522=_0x23bdc1[_0x23460f(0x10e)];_0x3984b8[_0x23460f(0x13e)](_0x23460f(0x135)+_0x8aa522+'\x27');const _0x330172=_0x23bdc1['folderId']?_0x4bd89e[_0x23460f(0x138)](_0x23bdc1[_0x23460f(0x13a)])||'':'',{createYamlContext:_0x48eca1}=_0xa6b712(),_0x4c6e56=[];for(const _0x380963 of _0x4696db){const _0x186d02=await _0x193b24[_0x23460f(0x12e)][_0x23460f(0x124)](_0x380963['id']),_0x128346=_0x186d02[_0x23460f(0x108)]?.[_0x23460f(0xe2)],_0x206c4e=_0x48eca1(_0x380963['id'],_0x128346),_0x5d19a0=await apiToYamlAsync(_0x186d02,_0x206c4e);_0x4c6e56[_0x23460f(0xed)]({'item':_0x380963,'yaml':_0x5d19a0});}let _0x4fd681;return _0x4c6e56[_0x23460f(0xd1)]===0x1?_0x4fd681=_0x4c6e56[0x0]['yaml']:_0x4fd681=buildMergedJourneyYaml(_0x4c6e56),{'bundleName':_0x8aa522,'folderPath':_0x330172,'finalYaml':_0x4fd681};}));_0x4de842[_0x45ad68(0xed)](..._0x2e7da5),_0x5e65f2+=_0x30d367[_0x45ad68(0xd1)],_0x3984b8['setExtra']('('+_0x5e65f2+'/'+_0x52dbd1[_0x45ad68(0xd1)]+')');}return _0x4de842;},{'verbose':_0x59a985[_0x39628c(0x10a)]});for(const {bundleName:_0x268da3,folderPath:_0x4bf847,finalYaml:_0x29e6ff}of _0x11fae5[_0x39628c(0x12d)]){const _0x162e1f=a35_0x47142e(_0x29e6ff),_0x2fd7ec=_0x4bf847?a35_0xcc50b[_0x39628c(0x10d)](_0x3b291f,_0x4bf847):_0x3b291f,_0x879c17=sanitizeFileName(_0x268da3),_0x8ade7d=getUniqueFileName(_0x2fd7ec,_0x879c17,_0x116c62),_0x5af314=a35_0xcc50b[_0x39628c(0x10d)](_0x2fd7ec,_0x8ade7d+'.yml');_0x88912a[_0x39628c(0xed)](prepareFile(_0x5af314,_0x162e1f,_0x3b291f));}}const _0x9ce939=Array[_0x39628c(0xe7)](_0x461ddc['values']())[_0x39628c(0x123)]((_0x5a5bbe,_0x1f48ef)=>_0x5a5bbe+_0x1f48ef['length'],0x0),_0x2c5fae=_0x88912a['filter'](_0x2fa82a=>_0x2fa82a['isNew']),_0x475f2d=_0x88912a[_0x39628c(0x125)](_0x7c78a5=>!_0x7c78a5['isNew']&&_0x7c78a5[_0x39628c(0xf3)]),_0x286af4=_0x88912a[_0x39628c(0x125)](_0x26bc5f=>!_0x26bc5f['isNew']&&!_0x26bc5f[_0x39628c(0xf3)]),_0x481cb7=_0x37e804[_0x39628c(0x125)](_0x5863c3=>_0x5863c3[_0x39628c(0x132)]!==SEGMENT_KIND_JOURNEY);console['error'](_0x39628c(0xee)+_0x41a802+'\x27:'),console[_0x39628c(0xdd)]('\x20\x20🎯\x20'+a35_0xfbd8a5[_0x39628c(0x10b)](_0x481cb7[_0x39628c(0xd1)]+_0x39628c(0xd3))+'\x20with\x20'+a35_0xfbd8a5['cyan'](_0x9ce939+_0x39628c(0x131)));if(_0x52064b['size']>0x0){const _0x561958=_0x559698[_0x39628c(0xd1)],_0x31f28b=_0x52064b[_0x39628c(0xda)],_0x33eced=_0x561958>_0x31f28b?'\x20('+_0x561958+_0x39628c(0xe6):'';console['error'](_0x39628c(0xf6)+a35_0xfbd8a5['cyan'](_0x31f28b+'\x20journeys')+a35_0xfbd8a5[_0x39628c(0xe1)](_0x33eced));}console[_0x39628c(0xdd)]('\x20\x20'+a35_0xfbd8a5['green']('+\x20'+_0x2c5fae['length']+_0x39628c(0x111))),console[_0x39628c(0xdd)]('\x20\x20'+a35_0xfbd8a5[_0x39628c(0x129)]('~\x20'+_0x475f2d['length']+_0x39628c(0xf8))),console[_0x39628c(0xdd)]('\x20\x20'+a35_0xfbd8a5['dim']('=\x20'+_0x286af4[_0x39628c(0xd1)]+'\x20unchanged\x20files')),console[_0x39628c(0xdd)](_0x39628c(0x105)+a35_0xfbd8a5[_0x39628c(0x10b)](_0x3b291f)+'\x0a');if(_0x475f2d['length']>0x0)for(const _0x2116eb of _0x475f2d){console[_0x39628c(0xdd)](_0x39628c(0xdf)+_0x2116eb[_0x39628c(0xe5)]+'\x27:'),console[_0x39628c(0xdd)]('─'[_0x39628c(0x118)](0x3c)),console['error'](_0x2116eb[_0x39628c(0x113)]),console[_0x39628c(0xdd)]('─'[_0x39628c(0x118)](0x3c));}if(_0x59a985['dryRun'])return console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0x129)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2c5fae['length']===0x0&&_0x475f2d['length']===0x0)return console['error'](a35_0xfbd8a5[_0x39628c(0xf4)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x41a802},_0x59a985[_0x39628c(0xfc)]),console[_0x39628c(0xdd)](a35_0xfbd8a5['green'](_0x39628c(0x139)+a35_0xfbd8a5[_0x39628c(0xe1)](_0x39628c(0x104))+'\x20=\x20'+a35_0xfbd8a5['cyan'](_0x41a802))),0x0;if(!_0x59a985[_0x39628c(0xcb)]&&(_0x2c5fae['length']>0x0||_0x475f2d[_0x39628c(0xd1)]>0x0)){const _0x34f860=await confirmKey(_0x39628c(0xeb)+(_0x2c5fae[_0x39628c(0xd1)]+_0x475f2d[_0x39628c(0xd1)])+'\x20files?');if(!_0x34f860)return console[_0x39628c(0xdd)](_0x39628c(0xff)),0x1;}for(const _0x3830a9 of _0x88912a){if(_0x3830a9[_0x39628c(0x11b)]||_0x3830a9[_0x39628c(0xf3)]){const _0x476791=a35_0xcc50b[_0x39628c(0x106)](_0x3830a9[_0x39628c(0xf2)]);!existsSync(_0x476791)&&mkdirSync(_0x476791,{'recursive':!![]}),writeFileSync(_0x3830a9[_0x39628c(0xf2)],_0x3830a9[_0x39628c(0xfa)],'utf-8');}}return console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0xf4)](_0x39628c(0xf5)+(_0x2c5fae[_0x39628c(0xd1)]+_0x475f2d[_0x39628c(0xd1)])+_0x39628c(0xfe)+_0x3b291f)),saveSessionContext({'parent_segment':_0x41a802},_0x59a985[_0x39628c(0xfc)]),console[_0x39628c(0xdd)](a35_0xfbd8a5[_0x39628c(0xf4)](_0x39628c(0x139)+a35_0xfbd8a5['dim']('parent_segment')+_0x39628c(0xea)+a35_0xfbd8a5[_0x39628c(0x10b)](_0x41a802))),0x0;}}function buildFolderPathMap(_0xf66468){const _0x4d2a01=a35_0x4ce8e6,_0x21e9ce=new Map(),_0x227958=new Map();for(const _0x22b820 of _0xf66468){_0x227958[_0x4d2a01(0x136)](_0x22b820['id'],_0x22b820);}const _0x7c0adf=new Set();for(const _0x42b7f2 of _0xf66468){!_0x42b7f2[_0x4d2a01(0xcc)]&&_0x7c0adf[_0x4d2a01(0xd8)](_0x42b7f2['id']);}function _0x33da6d(_0x515843){const _0x111a66=_0x4d2a01;if(_0x21e9ce['has'](_0x515843['id']))return _0x21e9ce[_0x111a66(0x138)](_0x515843['id']);if(_0x7c0adf[_0x111a66(0x121)](_0x515843['id']))return _0x21e9ce['set'](_0x515843['id'],''),'';if(_0x515843[_0x111a66(0xcc)]){const _0x21b23b=_0x227958[_0x111a66(0x138)](_0x515843['parentFolderId']);if(_0x21b23b){const _0x479a50=_0x33da6d(_0x21b23b),_0x45c058=_0x479a50?_0x479a50+'/'+_0x515843['name']:_0x515843[_0x111a66(0x117)];return _0x21e9ce['set'](_0x515843['id'],_0x45c058),_0x45c058;}}const _0xadb9e6=_0x515843[_0x111a66(0x117)];return _0x21e9ce['set'](_0x515843['id'],_0xadb9e6),_0xadb9e6;}for(const _0x53f881 of _0xf66468){_0x33da6d(_0x53f881);}return _0x21e9ce;}function getUniqueFileName(_0x4ea139,_0x19acea,_0x355d9e){const _0x5ed605=a35_0x4ce8e6,_0x5a33f9=_0x4ea139+':'+_0x19acea,_0x4e0d5e=_0x355d9e['get'](_0x5a33f9)||0x0;_0x355d9e[_0x5ed605(0x136)](_0x5a33f9,_0x4e0d5e+0x1);if(_0x4e0d5e===0x0)return _0x19acea;return _0x19acea+'-'+_0x4e0d5e;}function a35_0x5099(_0x47ca84,_0x32bab4){_0x47ca84=_0x47ca84-0xca;const _0x36a88b=a35_0x36a8();let _0x509929=_0x36a88b[_0x47ca84];return _0x509929;}function prepareFile(_0x22403b,_0x59c545,_0x467266){const _0x2d4562=a35_0x4ce8e6,_0x352516=a35_0xcc50b[_0x2d4562(0x130)](_0x467266,_0x22403b);if(existsSync(_0x22403b)){const _0x2a2736=readFileSync(_0x22403b,'utf-8'),_0x50c265=generateDiff(_0x2a2736,_0x59c545),_0x2737bd=hasChanges(_0x50c265);return{'relativePath':_0x352516,'absolutePath':_0x22403b,'content':_0x59c545,'isNew':![],'hasChanges':_0x2737bd,'diff':_0x2737bd?formatDiffWithColors(_0x50c265):undefined};}return{'relativePath':_0x352516,'absolutePath':_0x22403b,'content':_0x59c545,'isNew':!![],'hasChanges':![]};}
|