@treasuredata/tdx 0.5.2 → 0.6.0
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +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.d.ts +1 -1
- package/dist/commands/command.d.ts.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/command.js.map +1 -1
- package/dist/commands/context-command.d.ts.map +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/context-command.js.map +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/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-pwd-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.d.ts +8 -6
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.d.ts +58 -26
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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.d.ts +5 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/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/api.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/llm.d.ts +3 -0
- 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.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-ref-parser.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/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.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-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
package/dist/sdk/segment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0x1df8d6=a62_0x19d8;(function(_0x17371c,_0x43a44e){const _0x25ec6c=a62_0x19d8,_0x3bf956=_0x17371c();while(!![]){try{const _0x244c9d=-parseInt(_0x25ec6c(0xce))/0x1*(parseInt(_0x25ec6c(0xc9))/0x2)+-parseInt(_0x25ec6c(0xed))/0x3+parseInt(_0x25ec6c(0xf6))/0x4*(-parseInt(_0x25ec6c(0xf8))/0x5)+parseInt(_0x25ec6c(0xdf))/0x6*(parseInt(_0x25ec6c(0xbf))/0x7)+-parseInt(_0x25ec6c(0xb5))/0x8+parseInt(_0x25ec6c(0xd7))/0x9*(-parseInt(_0x25ec6c(0xa6))/0xa)+parseInt(_0x25ec6c(0xae))/0xb*(parseInt(_0x25ec6c(0xa2))/0xc);if(_0x244c9d===_0x43a44e)break;else _0x3bf956['push'](_0x3bf956['shift']());}catch(_0x198d11){_0x3bf956['push'](_0x3bf956['shift']());}}}(a62_0xdb9c,0x1f350));function a62_0xdb9c(){const _0x528816=['detectResourceType','802629afqAVW','updatedAt','resolveSegmentId','behaviors','createParentSegment','listFolders','resolvePathToResource','client','290874wfsybF',')\x20exceeded','getSegmentSQL','segments','segmentFolderId','parentDatabaseName','NOT_FOUND','createSegment','population','\x27\x20not\x20found','updateSegment','logger','createParent','parent','558714xZJwUl','updateParent','Resource\x20\x27','getSegment','getParent','join','folder','updateSegmentById','listSegmentFolders','75960BhEXUa','listParentSegments','45SnAkto','resolveFolderId','51192eOugkI','Folder\x20not\x20found:\x20','parentColumn','listParents','10BjPrmK','\x27\x20not\x20found\x20in\x20','createdAt','catch','rootFolderId','attribute','attributes','getParentFull','1562KkOEgF','isArray','parentTableName','all','Path\x20cannot\x20be\x20empty','name','Folder\x20\x27','1594680Vcoynl','then','ambiguous','find','detectResourceTypeInFolder','listSegments','listUnified','type','listActivations','parentFolderId','35oiXpIu','filter','\x20in\x20parent\x20','segment','traversePath','listRecursive','test','description','\x27\x20not\x20found\x20in\x20parent\x20segment','resolveParentIdOrName','186EnYDZJ','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','getParentSegmentFull','behavior','resolveParentId','803vRXKus','length','some','createSegmentFolder','INVALID_ARGUMENT','push','getFolder','schema'];a62_0xdb9c=function(){return _0x528816;};return a62_0xdb9c();}function a62_0x19d8(_0x317c35,_0x39ddb9){const _0xdb9c2=a62_0xdb9c();return a62_0x19d8=function(_0x19d825,_0x3965f1){_0x19d825=_0x19d825-0xa2;let _0x1260ca=_0xdb9c2[_0x19d825];return _0x1260ca;},a62_0x19d8(_0x317c35,_0x39ddb9);}import{CDPApiClient}from'../client/cdp-api-client.js';import{SDKError,ErrorCode}from'./errors.js';import{parsePath}from'../utils/segment-path-parser.js';export class SegmentSDK{[a62_0x1df8d6(0xde)];constructor(_0x14b73b){const _0x404f3e=a62_0x1df8d6;this['client']=new CDPApiClient(_0x14b73b,_0x14b73b[_0x404f3e(0xea)]);}async[a62_0x1df8d6(0xa5)](){const _0x40d478=a62_0x1df8d6;return await this['client'][_0x40d478(0xf7)]();}async[a62_0x1df8d6(0xf1)](_0x508bdd){const _0x55e8a6=a62_0x1df8d6;return await this[_0x55e8a6(0xde)]['getParentSegment'](_0x508bdd);}async[a62_0x1df8d6(0xba)](_0x49aad7){const _0x36dbed=a62_0x1df8d6;return await this[_0x36dbed(0xde)][_0x36dbed(0xba)](_0x49aad7);}async[a62_0x1df8d6(0xf0)](_0xc12bac,_0x368bcd){const _0x296234=a62_0x1df8d6;return await this[_0x296234(0xde)]['getSegment'](_0xc12bac,_0x368bcd);}async[a62_0x1df8d6(0xdc)](_0x55d2ac){const _0x3912bc=a62_0x1df8d6;return await this[_0x3912bc(0xde)][_0x3912bc(0xf5)](_0x55d2ac);}async[a62_0x1df8d6(0xd4)](_0x566837){return await this['client']['getSegmentFolder'](_0x566837);}async[a62_0x1df8d6(0xbd)](_0x574e4e,_0x4bdec3){const _0x4b5eb2=a62_0x1df8d6;return await this['client'][_0x4b5eb2(0xbd)](_0x574e4e,_0x4bdec3);}async['getParentSQL'](_0x4a5857){return await this['client']['getParentSegmentSQL'](_0x4a5857);}async[a62_0x1df8d6(0xe1)](_0x17d4b4,_0x870169){const _0x5cee43=a62_0x1df8d6;return await this[_0x5cee43(0xde)][_0x5cee43(0xe1)](_0x17d4b4,_0x870169);}async[a62_0x1df8d6(0xcd)](_0x4baa51){const _0x11f4b9=a62_0x1df8d6,_0x2df1b9=await this['listParents'](),_0xe81e60=_0x2df1b9[_0x11f4b9(0xb8)](_0x10cbed=>_0x10cbed[_0x11f4b9(0xac)][_0x11f4b9(0xb3)]===_0x4baa51);if(!_0xe81e60)throw new SDKError(ErrorCode[_0x11f4b9(0xe5)],'Parent\x20segment\x20not\x20found:\x20'+_0x4baa51);return _0xe81e60['id'];}async[a62_0x1df8d6(0xd9)](_0x2577d1,_0x4350c5){const _0x460910=a62_0x1df8d6,_0x2f6180=await this['listSegments'](_0x2577d1),_0x5b6333=_0x2f6180[_0x460910(0xb8)](_0x2fa6e7=>_0x2fa6e7[_0x460910(0xb3)]===_0x4350c5);if(!_0x5b6333)throw new SDKError(ErrorCode['NOT_FOUND'],'Child\x20segment\x20not\x20found:\x20'+_0x4350c5+_0x460910(0xc1)+_0x2577d1);return _0x5b6333['id'];}async[a62_0x1df8d6(0xf9)](_0xb3151f,_0x45664d){const _0x3a9054=a62_0x1df8d6,_0x1f3574=await this[_0x3a9054(0xdc)](_0xb3151f),_0x4b2555=_0x1f3574['find'](_0xc21c71=>_0xc21c71[_0x3a9054(0xb3)]===_0x45664d);if(!_0x4b2555)throw new SDKError(ErrorCode['NOT_FOUND'],_0x3a9054(0xa3)+_0x45664d+_0x3a9054(0xc1)+_0xb3151f);return _0x4b2555['id'];}async['listFields'](_0x3b1132){const _0x708b91=a62_0x1df8d6,_0x41eb3c=await this[_0x708b91(0xc8)](_0x3b1132),_0x33b2b5=await this[_0x708b91(0xde)][_0x708b91(0xcb)](_0x41eb3c),_0x3fcebd=[];if(_0x33b2b5[_0x708b91(0xac)]&&Array['isArray'](_0x33b2b5[_0x708b91(0xac)]))for(const _0x1a6cfb of _0x33b2b5['attributes']){const _0x5682dd=_0x1a6cfb;_0x5682dd['name']&&_0x5682dd['type']&&_0x3fcebd['push']({'name':_0x5682dd['name'],'type':_0x5682dd[_0x708b91(0xbc)],'source':_0x708b91(0xab),'parentDatabaseName':_0x5682dd[_0x708b91(0xe4)],'parentTableName':_0x5682dd[_0x708b91(0xb0)],'parentColumn':_0x5682dd[_0x708b91(0xa4)]});}if(_0x33b2b5[_0x708b91(0xda)]&&Array[_0x708b91(0xaf)](_0x33b2b5[_0x708b91(0xda)]))for(const _0x34d151 of _0x33b2b5['behaviors']){const _0x32ed7d=_0x34d151,_0x2d2cde=_0x32ed7d['name'];if(_0x2d2cde&&_0x32ed7d[_0x708b91(0xd5)]&&Array[_0x708b91(0xaf)](_0x32ed7d[_0x708b91(0xd5)]))for(const _0x503321 of _0x32ed7d[_0x708b91(0xd5)]){_0x503321[_0x708b91(0xb3)]&&_0x503321[_0x708b91(0xbc)]&&_0x3fcebd[_0x708b91(0xd3)]({'name':_0x2d2cde+'.'+_0x503321[_0x708b91(0xb3)],'type':_0x503321[_0x708b91(0xbc)],'source':_0x708b91(0xcc),'behaviorName':_0x2d2cde,'parentDatabaseName':_0x32ed7d[_0x708b91(0xe4)],'parentTableName':_0x32ed7d[_0x708b91(0xb0)],'parentColumn':_0x503321[_0x708b91(0xa4)]});}}return _0x3fcebd;}async[a62_0x1df8d6(0xeb)](_0x56db22){const _0x51ca17=a62_0x1df8d6;return await this[_0x51ca17(0xde)][_0x51ca17(0xdb)](_0x56db22);}async[a62_0x1df8d6(0xee)](_0x392363,_0x1ee2c4){const _0x558dad=a62_0x1df8d6,_0x2cdfee=await this[_0x558dad(0xc8)](_0x392363);return await this[_0x558dad(0xde)]['updateParentSegment'](_0x2cdfee,_0x1ee2c4);}async[a62_0x1df8d6(0xad)](_0x5052b7){const _0x2df858=a62_0x1df8d6,_0x4b321a=await this[_0x2df858(0xc8)](_0x5052b7);return await this[_0x2df858(0xde)][_0x2df858(0xcb)](_0x4b321a);}async['createSegment'](_0x303def,_0x9b93cb){const _0x3c4694=a62_0x1df8d6;return await this[_0x3c4694(0xde)][_0x3c4694(0xe6)](_0x303def,_0x9b93cb);}async[a62_0x1df8d6(0xf4)](_0x1b16f2,_0x3ad1d9,_0x260ae6){const _0x5973e0=a62_0x1df8d6;return await this[_0x5973e0(0xde)][_0x5973e0(0xe9)](_0x1b16f2,_0x3ad1d9,_0x260ae6);}async['createFolder'](_0x552a34,_0x4f9981){const _0x3e164c=a62_0x1df8d6,_0x56ba87=await this[_0x3e164c(0xc8)](_0x552a34);return await this['client'][_0x3e164c(0xd1)](_0x56ba87,_0x4f9981);}async['resolveParentIdOrName'](_0x410db1){const _0x4fc775=a62_0x1df8d6;if(/^\d+$/[_0x4fc775(0xc5)](_0x410db1))return _0x410db1;return await this[_0x4fc775(0xcd)](_0x410db1);}async[a62_0x1df8d6(0xd6)](_0x3d83cf,_0x226d6f){const _0x529348=a62_0x1df8d6,[_0x3ad066,_0x5b00b4]=await Promise[_0x529348(0xb1)]([this[_0x529348(0xf9)](_0x3d83cf,_0x226d6f)[_0x529348(0xb6)](()=>!![])[_0x529348(0xa9)](()=>![]),this[_0x529348(0xd9)](_0x3d83cf,_0x226d6f)[_0x529348(0xb6)](()=>!![])[_0x529348(0xa9)](()=>![])]);if(_0x3ad066&&_0x5b00b4)return _0x529348(0xb7);else{if(_0x3ad066)return'folder';else{if(_0x5b00b4)return _0x529348(0xc2);}}throw new SDKError(ErrorCode[_0x529348(0xe5)],_0x529348(0xef)+_0x226d6f+_0x529348(0xc7));}async['detectResourceTypeInFolder'](_0x51f5f4,_0x3d555e,_0x4fa977){const _0x184946=a62_0x1df8d6,[_0x58fd37,_0x53d0fb]=await Promise[_0x184946(0xb1)]([this[_0x184946(0xdc)](_0x51f5f4),this[_0x184946(0xba)](_0x51f5f4)]),_0x41ac07=_0x4fa977?_0x58fd37[_0x184946(0xc0)](_0x8c6108=>_0x8c6108[_0x184946(0xbe)]===_0x4fa977):_0x58fd37[_0x184946(0xc0)](_0x509114=>!_0x509114['parentFolderId']),_0xdba4f2=_0x4fa977?_0x53d0fb[_0x184946(0xc0)](_0x1e5657=>_0x1e5657[_0x184946(0xe3)]===_0x4fa977):_0x53d0fb['filter'](_0x107f8c=>!_0x107f8c[_0x184946(0xe3)]),_0x29e237=_0x41ac07[_0x184946(0xd0)](_0x136531=>_0x136531[_0x184946(0xb3)]===_0x3d555e),_0x4824ca=_0xdba4f2[_0x184946(0xd0)](_0x1709cb=>_0x1709cb['name']===_0x3d555e);if(_0x29e237&&_0x4824ca)return _0x184946(0xb7);else{if(_0x29e237)return _0x184946(0xf3);else{if(_0x4824ca)return _0x184946(0xc2);}}throw new SDKError(ErrorCode[_0x184946(0xe5)],_0x184946(0xef)+_0x3d555e+_0x184946(0xa7)+(_0x4fa977?_0x184946(0xf3):'parent\x20segment'));}async[a62_0x1df8d6(0xc3)](_0x3ae683){const _0x371234=a62_0x1df8d6;if(_0x3ae683[_0x371234(0xcf)]===0x0)throw new SDKError(ErrorCode[_0x371234(0xd2)],_0x371234(0xb2));const _0x9a169d=_0x3ae683[0x0],_0x29e176=await this[_0x371234(0xcd)](_0x9a169d);if(_0x3ae683[_0x371234(0xcf)]===0x1)return{'parentId':_0x29e176,'parentName':_0x9a169d,'type':_0x371234(0xec),'fullPath':_0x9a169d};const _0x76097b=await this[_0x371234(0xad)](_0x29e176),_0x2e7042=_0x76097b[_0x371234(0xaa)],_0x1ecb7e=[];let _0xe40e12=_0x2e7042;for(let _0x35f71d=0x1;_0x35f71d<_0x3ae683[_0x371234(0xcf)]-0x1;_0x35f71d++){const _0x5e399c=_0x3ae683[_0x35f71d],_0x3a60f2=await this[_0x371234(0xdc)](_0x29e176),_0x48266f=_0xe40e12?_0x3a60f2[_0x371234(0xb8)](_0xd157=>_0xd157[_0x371234(0xb3)]===_0x5e399c&&_0xd157[_0x371234(0xbe)]===_0xe40e12):_0x3a60f2[_0x371234(0xb8)](_0x55ee41=>_0x55ee41[_0x371234(0xb3)]===_0x5e399c&&!_0x55ee41[_0x371234(0xbe)]);if(!_0x48266f)throw new SDKError(ErrorCode['NOT_FOUND'],_0x371234(0xb4)+_0x5e399c+'\x27\x20not\x20found\x20in\x20path');_0x1ecb7e[_0x371234(0xd3)](_0x5e399c),_0xe40e12=_0x48266f['id'];}const _0x2e9327=_0x3ae683[_0x3ae683['length']-0x1],_0x2710fa=await this[_0x371234(0xb9)](_0x29e176,_0x2e9327,_0xe40e12);if(_0x2710fa===_0x371234(0xb7))return{'parentId':_0x29e176,'parentName':_0x9a169d,'folderId':_0xe40e12,'folderPath':_0x1ecb7e['length']>0x0?_0x1ecb7e:undefined,'type':_0x371234(0xf3),'fullPath':_0x3ae683[_0x371234(0xf2)]('/')};else{if(_0x2710fa==='folder'){const _0x473f66=await this[_0x371234(0xdc)](_0x29e176),_0x3835fa=_0xe40e12?_0x473f66[_0x371234(0xb8)](_0x2947d7=>_0x2947d7[_0x371234(0xb3)]===_0x2e9327&&_0x2947d7['parentFolderId']===_0xe40e12):_0x473f66['find'](_0x54cfca=>_0x54cfca[_0x371234(0xb3)]===_0x2e9327&&!_0x54cfca[_0x371234(0xbe)]);if(!_0x3835fa)throw new SDKError(ErrorCode[_0x371234(0xe5)],_0x371234(0xb4)+_0x2e9327+_0x371234(0xe8));return _0x1ecb7e[_0x371234(0xd3)](_0x2e9327),{'parentId':_0x29e176,'parentName':_0x9a169d,'folderId':_0x3835fa['id'],'folderPath':_0x1ecb7e,'type':'folder','fullPath':_0x3ae683[_0x371234(0xf2)]('/')};}else{const _0x3ac7fd=await this[_0x371234(0xba)](_0x29e176),_0xdf3863=_0xe40e12?_0x3ac7fd[_0x371234(0xb8)](_0x1455e8=>_0x1455e8[_0x371234(0xb3)]===_0x2e9327&&_0x1455e8[_0x371234(0xe3)]===_0xe40e12):_0x3ac7fd['find'](_0xcc3b7=>_0xcc3b7[_0x371234(0xb3)]===_0x2e9327&&!_0xcc3b7[_0x371234(0xe3)]);if(!_0xdf3863)throw new SDKError(ErrorCode[_0x371234(0xe5)],'Segment\x20\x27'+_0x2e9327+_0x371234(0xe8));return{'parentId':_0x29e176,'parentName':_0x9a169d,'folderId':_0xe40e12,'folderPath':_0x1ecb7e[_0x371234(0xcf)]>0x0?_0x1ecb7e:undefined,'segmentId':_0xdf3863['id'],'segmentName':_0x2e9327,'type':_0x371234(0xc2),'fullPath':_0x3ae683[_0x371234(0xf2)]('/')};}}}async[a62_0x1df8d6(0xdd)](_0x169e95){const _0x21a533=a62_0x1df8d6,_0x4f714c=parsePath(_0x169e95);if(!_0x4f714c['isAbsolute'])throw new SDKError(ErrorCode[_0x21a533(0xd2)],_0x21a533(0xca));return await this[_0x21a533(0xc3)](_0x4f714c[_0x21a533(0xe2)]);}async[a62_0x1df8d6(0xbb)](_0x303169,_0x18cd68){const _0x5153b3=a62_0x1df8d6,[_0x570fd1,_0x148671]=await Promise[_0x5153b3(0xb1)]([this[_0x5153b3(0xdc)](_0x303169),this[_0x5153b3(0xba)](_0x303169)]);if(_0x18cd68){const _0x9c482a=_0x570fd1['filter'](_0x1f7c2e=>_0x1f7c2e[_0x5153b3(0xbe)]===_0x18cd68),_0x4b05a7=_0x148671[_0x5153b3(0xc0)](_0x57f0ff=>_0x57f0ff['segmentFolderId']===_0x18cd68);return{'folders':_0x9c482a,'segments':_0x4b05a7};}const _0x3d3406=await this['getParentFull'](_0x303169),_0x5dca5f=_0x3d3406[_0x5153b3(0xaa)];if(_0x5dca5f){const _0x3f1f16=_0x570fd1[_0x5153b3(0xc0)](_0x25d31a=>_0x25d31a[_0x5153b3(0xbe)]===_0x5dca5f),_0x38b167=_0x148671[_0x5153b3(0xc0)](_0x406feb=>_0x406feb['segmentFolderId']===_0x5dca5f);return{'folders':_0x3f1f16,'segments':_0x38b167};}const _0x3ca005=_0x570fd1[_0x5153b3(0xc0)](_0x1c48a8=>!_0x1c48a8[_0x5153b3(0xbe)]),_0x33fbe8=_0x148671[_0x5153b3(0xc0)](_0x26cd42=>!_0x26cd42[_0x5153b3(0xe3)]);return{'folders':_0x3ca005,'segments':_0x33fbe8};}async[a62_0x1df8d6(0xc4)](_0x2b79ab,_0x1b5f18,_0x3749a6=0x0,_0x41478e=0xa){const _0x4b7b51=a62_0x1df8d6;if(_0x3749a6>=_0x41478e)throw new SDKError(ErrorCode[_0x4b7b51(0xd2)],'Maximum\x20recursion\x20depth\x20('+_0x41478e+_0x4b7b51(0xe0));const {folders:_0x42f4af,segments:_0x40e644}=await this[_0x4b7b51(0xbb)](_0x2b79ab,_0x1b5f18),_0x30af27=[];for(const _0x4765d0 of _0x42f4af){const _0x4a5648=await this[_0x4b7b51(0xc4)](_0x2b79ab,_0x4765d0['id'],_0x3749a6+0x1,_0x41478e);_0x30af27['push']({'type':_0x4b7b51(0xf3),'id':_0x4765d0['id'],'name':_0x4765d0[_0x4b7b51(0xb3)],'children':_0x4a5648[_0x4b7b51(0xcf)]>0x0?_0x4a5648:undefined,'metadata':{'description':_0x4765d0[_0x4b7b51(0xc6)]||undefined,'folderCount':_0x4a5648[_0x4b7b51(0xc0)](_0x4f036d=>_0x4f036d[_0x4b7b51(0xbc)]===_0x4b7b51(0xf3))['length'],'segmentCount':_0x4a5648[_0x4b7b51(0xc0)](_0x546a9b=>_0x546a9b[_0x4b7b51(0xbc)]===_0x4b7b51(0xc2))[_0x4b7b51(0xcf)],'createdAt':_0x4765d0[_0x4b7b51(0xa8)],'updatedAt':_0x4765d0['updatedAt']}});}for(const _0x1285c0 of _0x40e644){_0x30af27[_0x4b7b51(0xd3)]({'type':_0x4b7b51(0xc2),'id':_0x1285c0['id'],'name':_0x1285c0[_0x4b7b51(0xb3)],'population':_0x1285c0[_0x4b7b51(0xe7)],'metadata':{'description':_0x1285c0['description'],'createdAt':_0x1285c0['createdAt'],'updatedAt':_0x1285c0[_0x4b7b51(0xd8)]}});}return _0x30af27;}}
|
|
1
|
+
const a62_0x4f6d9e=a62_0x1155;(function(_0x306591,_0x495169){const _0x47fda9=a62_0x1155,_0x6f6b4d=_0x306591();while(!![]){try{const _0x208378=-parseInt(_0x47fda9(0xb8))/0x1*(-parseInt(_0x47fda9(0xde))/0x2)+-parseInt(_0x47fda9(0xda))/0x3+parseInt(_0x47fda9(0x96))/0x4+parseInt(_0x47fda9(0xba))/0x5*(parseInt(_0x47fda9(0x8c))/0x6)+parseInt(_0x47fda9(0xc5))/0x7+-parseInt(_0x47fda9(0xc1))/0x8+-parseInt(_0x47fda9(0xd3))/0x9*(-parseInt(_0x47fda9(0xab))/0xa);if(_0x208378===_0x495169)break;else _0x6f6b4d['push'](_0x6f6b4d['shift']());}catch(_0x44303c){_0x6f6b4d['push'](_0x6f6b4d['shift']());}}}(a62_0x50ae,0x28511));import{CDPApiClient}from'../client/cdp-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function a62_0x1155(_0x3cd8e6,_0x17e307){const _0x50ae47=a62_0x50ae();return a62_0x1155=function(_0x1155f4,_0x186368){_0x1155f4=_0x1155f4-0x89;let _0x391891=_0x50ae47[_0x1155f4];return _0x391891;},a62_0x1155(_0x3cd8e6,_0x17e307);}function a62_0x50ae(){const _0x484fe7=['schema','rootFolderId','filter','find','population','join','segment','getParentFull','type','length','updateParent','resolveParentIdOrName','1431mCUEUJ','NOT_FOUND','parentDatabaseName','segmentFolderId','client','\x27\x20not\x20found\x20in\x20path','ambiguous','934533sbiKdt','description','getParentSegmentSQL','createdAt','62026gDNasT','segments','Folder\x20not\x20found:\x20','Path\x20cannot\x20be\x20empty','push','name','listParentSegments','parent','all','6BLsFfT','updateSegmentById','then','INVALID_ARGUMENT','createParentSegment','traversePath','Resource\x20\x27','Maximum\x20recursion\x20depth\x20(','createSegmentFolder','listRecursive','1063664yaLjTb','isAbsolute','Child\x20segment\x20not\x20found:\x20','listSegmentFolders','getSegmentFolder','getParentSegment','attribute','\x20in\x20parent\x20','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','resolveFolderId','getSegmentSQL','getParentSegmentFull','getFolder','listSegments','createFolder','catch','listActivations','resolveParentId','isArray','Parent\x20segment\x20not\x20found:\x20','listFields','2890hVTQnl','createSegment','getSegment','some','getParentSQL','updatedAt','attributes','updateParentSegment','\x27\x20not\x20found\x20in\x20','listUnified','parent\x20segment','updateSegment','test','3RNEMjS','\x27\x20not\x20found','218165bxDiqk','parentTableName','detectResourceType','resolveSegmentId','logger','behaviors','parentColumn','900424UODFyS','parentFolderId','listFolders','folder','984634wrMmOJ','Folder\x20\x27'];a62_0x50ae=function(){return _0x484fe7;};return a62_0x50ae();}import{parsePath}from'../utils/segment-path-parser.js';export class SegmentSDK{['client'];constructor(_0x3327db){const _0x1ac18f=a62_0x1155;this[_0x1ac18f(0xd7)]=new CDPApiClient(_0x3327db,_0x3327db[_0x1ac18f(0xbe)]);}async['listParents'](){const _0x1571ec=a62_0x1155;return await this['client'][_0x1571ec(0x89)]();}async['getParent'](_0x13b275){const _0x2a43c1=a62_0x1155;return await this['client'][_0x2a43c1(0x9b)](_0x13b275);}async[a62_0x4f6d9e(0xa3)](_0x2069c1){const _0x26cdea=a62_0x4f6d9e;return await this['client'][_0x26cdea(0xa3)](_0x2069c1);}async[a62_0x4f6d9e(0xad)](_0x553e21,_0x1fdd1e){const _0x29b6c9=a62_0x4f6d9e;return await this[_0x29b6c9(0xd7)][_0x29b6c9(0xad)](_0x553e21,_0x1fdd1e);}async['listFolders'](_0x420ca6){const _0x4c4497=a62_0x4f6d9e;return await this['client'][_0x4c4497(0x99)](_0x420ca6);}async[a62_0x4f6d9e(0xa2)](_0x4d10d8){const _0x1baeac=a62_0x4f6d9e;return await this['client'][_0x1baeac(0x9a)](_0x4d10d8);}async[a62_0x4f6d9e(0xa6)](_0x2f6cc5,_0x25f1cc){const _0x225b38=a62_0x4f6d9e;return await this[_0x225b38(0xd7)][_0x225b38(0xa6)](_0x2f6cc5,_0x25f1cc);}async[a62_0x4f6d9e(0xaf)](_0x3976ec){const _0xc8c3d1=a62_0x4f6d9e;return await this[_0xc8c3d1(0xd7)][_0xc8c3d1(0xdc)](_0x3976ec);}async[a62_0x4f6d9e(0xa0)](_0x14cbc4,_0x4f9337){const _0x35d658=a62_0x4f6d9e;return await this[_0x35d658(0xd7)][_0x35d658(0xa0)](_0x14cbc4,_0x4f9337);}async[a62_0x4f6d9e(0xa7)](_0x47d0ce){const _0x219848=a62_0x4f6d9e,_0x6a89dc=await this['listParents'](),_0x5f3681=_0x6a89dc[_0x219848(0xca)](_0x4ac323=>_0x4ac323[_0x219848(0xb1)][_0x219848(0xe3)]===_0x47d0ce);if(!_0x5f3681)throw new SDKError(ErrorCode[_0x219848(0xd4)],_0x219848(0xa9)+_0x47d0ce);return _0x5f3681['id'];}async[a62_0x4f6d9e(0xbd)](_0x326583,_0x5d3947){const _0x5cde45=a62_0x4f6d9e,_0x33e5df=await this[_0x5cde45(0xa3)](_0x326583),_0x41170b=_0x33e5df['find'](_0x276189=>_0x276189[_0x5cde45(0xe3)]===_0x5d3947);if(!_0x41170b)throw new SDKError(ErrorCode['NOT_FOUND'],_0x5cde45(0x98)+_0x5d3947+_0x5cde45(0x9d)+_0x326583);return _0x41170b['id'];}async[a62_0x4f6d9e(0x9f)](_0x3617a1,_0x20fc75){const _0x1b2311=a62_0x4f6d9e,_0xee0f35=await this[_0x1b2311(0xc3)](_0x3617a1),_0x1fb939=_0xee0f35['find'](_0x2e9a80=>_0x2e9a80['name']===_0x20fc75);if(!_0x1fb939)throw new SDKError(ErrorCode[_0x1b2311(0xd4)],_0x1b2311(0xe0)+_0x20fc75+_0x1b2311(0x9d)+_0x3617a1);return _0x1fb939['id'];}async[a62_0x4f6d9e(0xaa)](_0x44ca6d){const _0x332edb=a62_0x4f6d9e,_0x4652a2=await this['resolveParentIdOrName'](_0x44ca6d),_0x5c75dc=await this[_0x332edb(0xd7)][_0x332edb(0xa1)](_0x4652a2),_0x22488d=[];if(_0x5c75dc[_0x332edb(0xb1)]&&Array[_0x332edb(0xa8)](_0x5c75dc[_0x332edb(0xb1)]))for(const _0xb9e0ee of _0x5c75dc[_0x332edb(0xb1)]){const _0x46ec79=_0xb9e0ee;_0x46ec79['name']&&_0x46ec79[_0x332edb(0xcf)]&&_0x22488d[_0x332edb(0xe2)]({'name':_0x46ec79[_0x332edb(0xe3)],'type':_0x46ec79[_0x332edb(0xcf)],'source':_0x332edb(0x9c),'parentDatabaseName':_0x46ec79['parentDatabaseName'],'parentTableName':_0x46ec79[_0x332edb(0xbb)],'parentColumn':_0x46ec79[_0x332edb(0xc0)]});}if(_0x5c75dc[_0x332edb(0xbf)]&&Array[_0x332edb(0xa8)](_0x5c75dc[_0x332edb(0xbf)]))for(const _0x4a9079 of _0x5c75dc[_0x332edb(0xbf)]){const _0x458066=_0x4a9079,_0x246398=_0x458066[_0x332edb(0xe3)];if(_0x246398&&_0x458066[_0x332edb(0xc7)]&&Array[_0x332edb(0xa8)](_0x458066[_0x332edb(0xc7)]))for(const _0x98c11d of _0x458066['schema']){_0x98c11d[_0x332edb(0xe3)]&&_0x98c11d[_0x332edb(0xcf)]&&_0x22488d[_0x332edb(0xe2)]({'name':_0x246398+'.'+_0x98c11d[_0x332edb(0xe3)],'type':_0x98c11d[_0x332edb(0xcf)],'source':'behavior','behaviorName':_0x246398,'parentDatabaseName':_0x458066[_0x332edb(0xd5)],'parentTableName':_0x458066[_0x332edb(0xbb)],'parentColumn':_0x98c11d[_0x332edb(0xc0)]});}}return _0x22488d;}async['createParent'](_0x4c4783){const _0x4fdb3b=a62_0x4f6d9e;return await this[_0x4fdb3b(0xd7)][_0x4fdb3b(0x90)](_0x4c4783);}async[a62_0x4f6d9e(0xd1)](_0x4cd884,_0x237bc6){const _0x2c334b=a62_0x4f6d9e,_0x54b2e0=await this[_0x2c334b(0xd2)](_0x4cd884);return await this[_0x2c334b(0xd7)][_0x2c334b(0xb2)](_0x54b2e0,_0x237bc6);}async[a62_0x4f6d9e(0xce)](_0x194cea){const _0x4a5c86=a62_0x4f6d9e,_0x22cdc7=await this[_0x4a5c86(0xd2)](_0x194cea);return await this[_0x4a5c86(0xd7)][_0x4a5c86(0xa1)](_0x22cdc7);}async[a62_0x4f6d9e(0xac)](_0x1cdb94,_0x398d24){const _0x428819=a62_0x4f6d9e;return await this[_0x428819(0xd7)][_0x428819(0xac)](_0x1cdb94,_0x398d24);}async[a62_0x4f6d9e(0x8d)](_0x14a48f,_0x3f32c0,_0x306e9){const _0x45c0e9=a62_0x4f6d9e;return await this[_0x45c0e9(0xd7)][_0x45c0e9(0xb6)](_0x14a48f,_0x3f32c0,_0x306e9);}async[a62_0x4f6d9e(0xa4)](_0x58c0dc,_0x34504a){const _0x590177=a62_0x4f6d9e,_0x454fb5=await this['resolveParentIdOrName'](_0x58c0dc);return await this[_0x590177(0xd7)][_0x590177(0x94)](_0x454fb5,_0x34504a);}async[a62_0x4f6d9e(0xd2)](_0x31fbb1){const _0x5f5325=a62_0x4f6d9e;if(/^\d+$/[_0x5f5325(0xb7)](_0x31fbb1))return _0x31fbb1;return await this[_0x5f5325(0xa7)](_0x31fbb1);}async[a62_0x4f6d9e(0xbc)](_0x1db3c9,_0x5231f7){const _0xc76055=a62_0x4f6d9e,[_0x578228,_0x29c254]=await Promise[_0xc76055(0x8b)]([this['resolveFolderId'](_0x1db3c9,_0x5231f7)[_0xc76055(0x8e)](()=>!![])[_0xc76055(0xa5)](()=>![]),this[_0xc76055(0xbd)](_0x1db3c9,_0x5231f7)[_0xc76055(0x8e)](()=>!![])['catch'](()=>![])]);if(_0x578228&&_0x29c254)return _0xc76055(0xd9);else{if(_0x578228)return _0xc76055(0xc4);else{if(_0x29c254)return'segment';}}throw new SDKError(ErrorCode['NOT_FOUND'],_0xc76055(0x92)+_0x5231f7+'\x27\x20not\x20found\x20in\x20parent\x20segment');}async['detectResourceTypeInFolder'](_0x18dcba,_0x26500f,_0x2f41a7){const _0x1e834a=a62_0x4f6d9e,[_0x53b88e,_0x4a212c]=await Promise['all']([this[_0x1e834a(0xc3)](_0x18dcba),this['listSegments'](_0x18dcba)]),_0x3a530f=_0x2f41a7?_0x53b88e[_0x1e834a(0xc9)](_0x345375=>_0x345375['parentFolderId']===_0x2f41a7):_0x53b88e[_0x1e834a(0xc9)](_0x4c63df=>!_0x4c63df[_0x1e834a(0xc2)]),_0x45db21=_0x2f41a7?_0x4a212c[_0x1e834a(0xc9)](_0x1a95bf=>_0x1a95bf[_0x1e834a(0xd6)]===_0x2f41a7):_0x4a212c[_0x1e834a(0xc9)](_0x1ecb81=>!_0x1ecb81[_0x1e834a(0xd6)]),_0x46639a=_0x3a530f[_0x1e834a(0xae)](_0x3fe29f=>_0x3fe29f[_0x1e834a(0xe3)]===_0x26500f),_0xab0446=_0x45db21[_0x1e834a(0xae)](_0x45c175=>_0x45c175[_0x1e834a(0xe3)]===_0x26500f);if(_0x46639a&&_0xab0446)return'ambiguous';else{if(_0x46639a)return _0x1e834a(0xc4);else{if(_0xab0446)return'segment';}}throw new SDKError(ErrorCode[_0x1e834a(0xd4)],_0x1e834a(0x92)+_0x26500f+_0x1e834a(0xb3)+(_0x2f41a7?_0x1e834a(0xc4):_0x1e834a(0xb5)));}async[a62_0x4f6d9e(0x91)](_0xece5d7){const _0x538732=a62_0x4f6d9e;if(_0xece5d7[_0x538732(0xd0)]===0x0)throw new SDKError(ErrorCode[_0x538732(0x8f)],_0x538732(0xe1));const _0x464ed8=_0xece5d7[0x0],_0x5c3d76=await this[_0x538732(0xa7)](_0x464ed8);if(_0xece5d7[_0x538732(0xd0)]===0x1)return{'parentId':_0x5c3d76,'parentName':_0x464ed8,'type':_0x538732(0x8a),'fullPath':_0x464ed8};const _0xaefe07=await this[_0x538732(0xce)](_0x5c3d76),_0x28174a=_0xaefe07['rootFolderId'],_0x4a2aaf=[];let _0x33fa8e=_0x28174a;for(let _0x2d0fad=0x1;_0x2d0fad<_0xece5d7['length']-0x1;_0x2d0fad++){const _0x255c99=_0xece5d7[_0x2d0fad],_0x3dcd95=await this[_0x538732(0xc3)](_0x5c3d76),_0x38a3cf=_0x33fa8e?_0x3dcd95[_0x538732(0xca)](_0xfac9b=>_0xfac9b[_0x538732(0xe3)]===_0x255c99&&_0xfac9b[_0x538732(0xc2)]===_0x33fa8e):_0x3dcd95[_0x538732(0xca)](_0x330aaf=>_0x330aaf['name']===_0x255c99&&!_0x330aaf[_0x538732(0xc2)]);if(!_0x38a3cf)throw new SDKError(ErrorCode['NOT_FOUND'],_0x538732(0xc6)+_0x255c99+_0x538732(0xd8));_0x4a2aaf[_0x538732(0xe2)](_0x255c99),_0x33fa8e=_0x38a3cf['id'];}const _0x3b8032=_0xece5d7[_0xece5d7['length']-0x1],_0x355f07=await this['detectResourceTypeInFolder'](_0x5c3d76,_0x3b8032,_0x33fa8e);if(_0x355f07==='ambiguous')return{'parentId':_0x5c3d76,'parentName':_0x464ed8,'folderId':_0x33fa8e,'folderPath':_0x4a2aaf[_0x538732(0xd0)]>0x0?_0x4a2aaf:undefined,'type':'folder','fullPath':_0xece5d7['join']('/')};else{if(_0x355f07==='folder'){const _0x5e924b=await this[_0x538732(0xc3)](_0x5c3d76),_0x2d19da=_0x33fa8e?_0x5e924b[_0x538732(0xca)](_0x34aa1b=>_0x34aa1b[_0x538732(0xe3)]===_0x3b8032&&_0x34aa1b[_0x538732(0xc2)]===_0x33fa8e):_0x5e924b[_0x538732(0xca)](_0x23133a=>_0x23133a[_0x538732(0xe3)]===_0x3b8032&&!_0x23133a[_0x538732(0xc2)]);if(!_0x2d19da)throw new SDKError(ErrorCode[_0x538732(0xd4)],_0x538732(0xc6)+_0x3b8032+_0x538732(0xb9));return _0x4a2aaf[_0x538732(0xe2)](_0x3b8032),{'parentId':_0x5c3d76,'parentName':_0x464ed8,'folderId':_0x2d19da['id'],'folderPath':_0x4a2aaf,'type':_0x538732(0xc4),'fullPath':_0xece5d7[_0x538732(0xcc)]('/')};}else{const _0x22eb53=await this[_0x538732(0xa3)](_0x5c3d76),_0x55a751=_0x33fa8e?_0x22eb53['find'](_0xd5de71=>_0xd5de71['name']===_0x3b8032&&_0xd5de71[_0x538732(0xd6)]===_0x33fa8e):_0x22eb53[_0x538732(0xca)](_0x36cad0=>_0x36cad0[_0x538732(0xe3)]===_0x3b8032&&!_0x36cad0[_0x538732(0xd6)]);if(!_0x55a751)throw new SDKError(ErrorCode['NOT_FOUND'],'Segment\x20\x27'+_0x3b8032+_0x538732(0xb9));return{'parentId':_0x5c3d76,'parentName':_0x464ed8,'folderId':_0x33fa8e,'folderPath':_0x4a2aaf['length']>0x0?_0x4a2aaf:undefined,'segmentId':_0x55a751['id'],'segmentName':_0x3b8032,'type':_0x538732(0xcd),'fullPath':_0xece5d7[_0x538732(0xcc)]('/')};}}}async['resolvePathToResource'](_0x2adf71){const _0x6f697a=a62_0x4f6d9e,_0x4a53c9=parsePath(_0x2adf71);if(!_0x4a53c9[_0x6f697a(0x97)])throw new SDKError(ErrorCode[_0x6f697a(0x8f)],_0x6f697a(0x9e));return await this[_0x6f697a(0x91)](_0x4a53c9[_0x6f697a(0xdf)]);}async[a62_0x4f6d9e(0xb4)](_0x4ecd7f,_0x47497f){const _0x1d0ea5=a62_0x4f6d9e,[_0x157c05,_0x4ee341]=await Promise[_0x1d0ea5(0x8b)]([this[_0x1d0ea5(0xc3)](_0x4ecd7f),this[_0x1d0ea5(0xa3)](_0x4ecd7f)]);if(_0x47497f){const _0x1bc2a9=_0x157c05['filter'](_0x2a51f8=>_0x2a51f8[_0x1d0ea5(0xc2)]===_0x47497f),_0x3d8770=_0x4ee341[_0x1d0ea5(0xc9)](_0x4fdeca=>_0x4fdeca[_0x1d0ea5(0xd6)]===_0x47497f);return{'folders':_0x1bc2a9,'segments':_0x3d8770};}const _0x403f09=await this[_0x1d0ea5(0xce)](_0x4ecd7f),_0x31be48=_0x403f09[_0x1d0ea5(0xc8)];if(_0x31be48){const _0x3b7f66=_0x157c05[_0x1d0ea5(0xc9)](_0x175401=>_0x175401[_0x1d0ea5(0xc2)]===_0x31be48),_0x249c4c=_0x4ee341[_0x1d0ea5(0xc9)](_0x362158=>_0x362158[_0x1d0ea5(0xd6)]===_0x31be48);return{'folders':_0x3b7f66,'segments':_0x249c4c};}const _0x383b24=_0x157c05['filter'](_0x46e591=>!_0x46e591[_0x1d0ea5(0xc2)]),_0x2df5be=_0x4ee341['filter'](_0x541267=>!_0x541267[_0x1d0ea5(0xd6)]);return{'folders':_0x383b24,'segments':_0x2df5be};}async[a62_0x4f6d9e(0x95)](_0x2d3c89,_0x163e97,_0x212dfd=0x0,_0x258b0b=0xa){const _0x5cc112=a62_0x4f6d9e;if(_0x212dfd>=_0x258b0b)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5cc112(0x93)+_0x258b0b+')\x20exceeded');const {folders:_0x175602,segments:_0x245315}=await this[_0x5cc112(0xb4)](_0x2d3c89,_0x163e97),_0x5d3e7f=[];for(const _0x4737e0 of _0x175602){const _0x174c22=await this['listRecursive'](_0x2d3c89,_0x4737e0['id'],_0x212dfd+0x1,_0x258b0b);_0x5d3e7f['push']({'type':'folder','id':_0x4737e0['id'],'name':_0x4737e0[_0x5cc112(0xe3)],'children':_0x174c22[_0x5cc112(0xd0)]>0x0?_0x174c22:undefined,'metadata':{'description':_0x4737e0['description']||undefined,'folderCount':_0x174c22[_0x5cc112(0xc9)](_0x5e1077=>_0x5e1077[_0x5cc112(0xcf)]===_0x5cc112(0xc4))[_0x5cc112(0xd0)],'segmentCount':_0x174c22[_0x5cc112(0xc9)](_0x25362e=>_0x25362e[_0x5cc112(0xcf)]===_0x5cc112(0xcd))[_0x5cc112(0xd0)],'createdAt':_0x4737e0[_0x5cc112(0xdd)],'updatedAt':_0x4737e0[_0x5cc112(0xb0)]}});}for(const _0x8b17d of _0x245315){_0x5d3e7f['push']({'type':_0x5cc112(0xcd),'id':_0x8b17d['id'],'name':_0x8b17d['name'],'population':_0x8b17d[_0x5cc112(0xcb)],'metadata':{'description':_0x8b17d[_0x5cc112(0xdb)],'createdAt':_0x8b17d[_0x5cc112(0xdd)],'updatedAt':_0x8b17d[_0x5cc112(0xb0)]}});}return _0x5d3e7f;}}
|
package/dist/sdk/workflow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a63_0x5f356f=a63_0x5c19;function a63_0x5c19(_0xed6317,_0x26f5d0){const _0x195fea=a63_0x195f();return a63_0x5c19=function(_0x5c1959,_0x384e84){_0x5c1959=_0x5c1959-0x14d;let _0xeccf90=_0x195fea[_0x5c1959];return _0xeccf90;},a63_0x5c19(_0xed6317,_0x26f5d0);}(function(_0x1a51b9,_0x253a1f){const _0x5c7a44=a63_0x5c19,_0x467f4b=_0x1a51b9();while(!![]){try{const _0x96820e=-parseInt(_0x5c7a44(0x186))/0x1+-parseInt(_0x5c7a44(0x17d))/0x2*(parseInt(_0x5c7a44(0x162))/0x3)+-parseInt(_0x5c7a44(0x176))/0x4*(-parseInt(_0x5c7a44(0x19d))/0x5)+parseInt(_0x5c7a44(0x163))/0x6*(-parseInt(_0x5c7a44(0x18c))/0x7)+-parseInt(_0x5c7a44(0x14d))/0x8*(-parseInt(_0x5c7a44(0x161))/0x9)+-parseInt(_0x5c7a44(0x157))/0xa*(parseInt(_0x5c7a44(0x1c0))/0xb)+-parseInt(_0x5c7a44(0x1a5))/0xc*(-parseInt(_0x5c7a44(0x1c1))/0xd);if(_0x96820e===_0x253a1f)break;else _0x467f4b['push'](_0x467f4b['shift']());}catch(_0x104d80){_0x467f4b['push'](_0x467f4b['shift']());}}}(a63_0x195f,0x326b6));function a63_0x195f(){const _0x1d1a35=['status','getAttemptTasks','sessionUuid','76690nzCEMm','stateParams','tdx-workflow-','createdAt','force','resolveProjectId','skipValidation','sessionId','done','gunzip','27yvJaSy','147TCwqaJ','6QkQnvH','upstreams','sessions','clearSchedule','isGroup','Failed\x20to\x20download\x20log\x20file:\x20','replace','from','extract','readdir','isFile','tmpdir','project','retryAttemptName','.\x20Expected\x20\x22project.workflow\x22','fullName','getAttempt','retryAttempt','timezone','50692ENQAOu','zlib','mkdir','Cannot\x20read\x20workflow\x20file:\x20','error','fromTask','projectName','9942lusGjZ','lastAttempt','isDirectory','data','exportParams','now','\x20workflow\x20files\x20found\x20in\x20project\x20directory','Project\x20not\x20found:\x20','NUMERIC_ID_PATTERN','345820aHXsrS','length','unlink','access','state','.tar.gz','1905358zOsFJh','retrySession','push','resumeFrom','kill','listProjects','run','delete','startedAt','revision','limit','params','message','toISOString','indexOf','listLogFiles','lastId','110aOHiAE','map','listAttempts','arrayBuffer','killAttempt','attempts','fromTime','substring','538116RfoGDc','path','tar','clearScheduleAll','workflows','utf-8','direct','test','Invalid\x20workflow\x20format:\x20','retryParams','success','toString','listSessions','create','listWorkflows','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflowName','finishedAt','attempt','retryAt','find','includeRetried','startAttempt','filter','join','parentId','No\x20','418TPMdOo','299WEshAj','tdx-workflow-push-','131568YNVJrq','name','sessionTime','projects','index','client','tasks'];a63_0x195f=function(){return _0x1d1a35;};return a63_0x195f();}import{WorkflowApiClient}from'../client/workflow-client.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowSDK{static [a63_0x5f356f(0x185)]=/^\d+$/;['client'];constructor(_0x2fd821){const _0x43a3d2=a63_0x5f356f;this[_0x43a3d2(0x152)]=new WorkflowApiClient(_0x2fd821,_0x2fd821['logger']);}async[a63_0x5f356f(0x15c)](_0x19259c){const _0x4571bf=a63_0x5f356f;if(WorkflowSDK[_0x4571bf(0x185)][_0x4571bf(0x1ac)](_0x19259c))return{'id':_0x19259c,'name':_0x19259c};const _0x38611d=await this[_0x4571bf(0x152)][_0x4571bf(0x191)]({'name_pattern':_0x19259c}),_0x25e1d3=_0x38611d[_0x4571bf(0x180)][_0x4571bf(0x1b9)](_0x1db070=>_0x1db070[_0x4571bf(0x14e)]===_0x19259c);if(!_0x25e1d3)throw new Error('Project\x20not\x20found:\x20'+_0x19259c);return{'id':_0x25e1d3['id'],'name':_0x25e1d3[_0x4571bf(0x14e)]};}async[a63_0x5f356f(0x150)](_0x1ed34c,_0x2e6efc){const _0x121352=a63_0x5f356f,_0x23a7d2=await this['client']['listProjects']({'name_pattern':_0x1ed34c,..._0x2e6efc});return _0x23a7d2[_0x121352(0x180)][_0x121352(0x19e)](_0x176f6c=>({..._0x176f6c,'project_id':_0x176f6c['id'],'project_name':_0x176f6c[_0x121352(0x14e)]}));}async[a63_0x5f356f(0x1a9)](_0xdf840,_0x35af0b){const _0x30d52b=a63_0x5f356f,_0x4b63a0=await this[_0x30d52b(0x152)][_0x30d52b(0x1b3)]({'project_name':_0xdf840,..._0x35af0b});return _0x4b63a0[_0x30d52b(0x180)][_0x30d52b(0x19e)](_0x38351f=>({'project_id':_0x38351f[_0x30d52b(0x16f)]?.['id'],'project_name':_0x38351f[_0x30d52b(0x16f)]?.['name'],'workflow_id':_0x38351f['id'],'workflow_name':_0x38351f[_0x30d52b(0x14e)],'revision':_0x38351f['revision'],'timezone':_0x38351f[_0x30d52b(0x175)],'config':_0x38351f['config'],'id':_0x38351f['id'],'name':_0x38351f[_0x30d52b(0x14e)],'project':_0x38351f['project']}));}async[a63_0x5f356f(0x165)](_0x5cde05){const _0x508209=a63_0x5f356f;let _0x509cf9;if(_0x5cde05?.[_0x508209(0x17c)]){let _0x57baa4,_0x476d06=![];while(!_0x476d06){const _0xf7c09=await this['client']['listProjects']({'limit':0x64,'last_id':_0x57baa4}),_0x2404e7=_0xf7c09[_0x508209(0x180)]['find'](_0x2e2b0e=>_0x2e2b0e[_0x508209(0x14e)]===_0x5cde05['projectName']);if(_0x2404e7){_0x509cf9=_0x2404e7['id'],_0x476d06=!![];break;}if(!_0xf7c09[_0x508209(0x19c)]||_0xf7c09[_0x508209(0x180)][_0x508209(0x187)]===0x0)break;_0x57baa4=_0xf7c09['lastId'];}if(!_0x509cf9)throw new Error(_0x508209(0x184)+_0x5cde05[_0x508209(0x17c)]);}const _0x17f866=await this[_0x508209(0x152)][_0x508209(0x1b1)]({'project_id':_0x509cf9,'project_name':_0x5cde05?.['projectName'],'workflow_name':_0x5cde05?.[_0x508209(0x1b5)],'status':_0x5cde05?.[_0x508209(0x154)],'from_time':_0x5cde05?.[_0x508209(0x1a3)],'to_time':_0x5cde05?.['toTime'],'limit':_0x5cde05?.[_0x508209(0x196)],'last_id':_0x5cde05?.['last_id']});return _0x17f866[_0x508209(0x180)][_0x508209(0x19e)](_0x721603=>({'project_id':_0x721603['project']?.['id'],'project_name':_0x721603[_0x508209(0x16f)]?.['name'],'workflow_id':_0x721603['workflow']?.['id'],'workflow_name':_0x721603['workflow']?.[_0x508209(0x14e)],'session_id':_0x721603['id'],'sessionUuid':_0x721603[_0x508209(0x156)],'sessionTime':_0x721603[_0x508209(0x14f)],'lastAttempt':_0x721603[_0x508209(0x17e)],'id':_0x721603['id'],'project':_0x721603[_0x508209(0x16f)],'workflow':_0x721603['workflow']}));}async[a63_0x5f356f(0x1a2)](_0x33f9bf){const _0x55ef7b=a63_0x5f356f,_0x5897b7=await this['client'][_0x55ef7b(0x19f)]({'project_name':_0x33f9bf?.[_0x55ef7b(0x17c)],'workflow_name':_0x33f9bf?.[_0x55ef7b(0x1b5)],'include_retried':_0x33f9bf?.[_0x55ef7b(0x1ba)],'limit':_0x33f9bf?.['limit'],'last_id':_0x33f9bf?.['last_id']});return _0x5897b7[_0x55ef7b(0x180)][_0x55ef7b(0x19e)](_0x29c730=>({'project_id':_0x29c730['project']?.['id'],'project_name':_0x29c730['project']?.['name'],'workflow_id':_0x29c730['workflow']?.['id'],'workflow_name':_0x29c730['workflow']?.[_0x55ef7b(0x14e)],'session_id':_0x29c730['sessionId'],'sessionUuid':_0x29c730[_0x55ef7b(0x156)],'sessionTime':_0x29c730[_0x55ef7b(0x14f)],'attempt_id':_0x29c730['id'],'attempt_index':_0x29c730[_0x55ef7b(0x151)],'retryAttemptName':_0x29c730[_0x55ef7b(0x170)],'done':_0x29c730[_0x55ef7b(0x15f)],'success':_0x29c730[_0x55ef7b(0x1af)],'cancelRequested':_0x29c730['cancelRequested'],'params':_0x29c730[_0x55ef7b(0x197)],'createdAt':_0x29c730[_0x55ef7b(0x15a)],'finishedAt':_0x29c730[_0x55ef7b(0x1b6)],'id':_0x29c730['id'],'index':_0x29c730[_0x55ef7b(0x151)],'project':_0x29c730[_0x55ef7b(0x16f)],'workflow':_0x29c730['workflow']}));}async[a63_0x5f356f(0x1b7)](_0xb8a729){const _0x5429a1=a63_0x5f356f,_0x47e5e3=await this['client'][_0x5429a1(0x173)](_0xb8a729);return _0x47e5e3;}async[a63_0x5f356f(0x153)](_0x2132ca,_0x112adf=![]){const _0x1337b6=a63_0x5f356f,_0x3d8a6c=await this[_0x1337b6(0x152)][_0x1337b6(0x155)](_0x2132ca,_0x112adf);return _0x3d8a6c['map'](_0x575011=>({'task_id':_0x575011['id'],'task_name':_0x575011[_0x1337b6(0x172)],'parentId':_0x575011[_0x1337b6(0x1be)],'config':_0x575011['config'],'upstreams':_0x575011[_0x1337b6(0x164)],'state':_0x575011[_0x1337b6(0x18a)],'exportParams':_0x575011[_0x1337b6(0x181)],'storeParams':_0x575011['storeParams'],'stateParams':_0x575011[_0x1337b6(0x158)],'updatedAt':_0x575011['updatedAt'],'retryAt':_0x575011[_0x1337b6(0x1b8)],'startedAt':_0x575011[_0x1337b6(0x194)],'error':_0x575011[_0x1337b6(0x17a)],'isGroup':_0x575011[_0x1337b6(0x167)],'id':_0x575011['id'],'fullName':_0x575011[_0x1337b6(0x172)]}));}async['logFiles'](_0x15ee2e,_0x44ffbd){const _0x2b1076=a63_0x5f356f;return await this[_0x2b1076(0x152)][_0x2b1076(0x19b)](_0x15ee2e,_0x44ffbd);}async['logs'](_0x24c31b,_0x423eb6){const _0x424b1b=a63_0x5f356f,_0x101056=await import(_0x424b1b(0x177)),{promisify:_0x2915bf}=await import('util'),_0x41692c=_0x2915bf(_0x101056[_0x424b1b(0x160)]),_0x35cd13=await this['client'][_0x424b1b(0x19b)](_0x24c31b,_0x423eb6);if(_0x35cd13['length']===0x0)return'';const _0x170897=[];for(const _0x142c5d of _0x35cd13){if(!_0x142c5d['direct'])continue;const _0x58c575=await fetch(_0x142c5d[_0x424b1b(0x1ab)]);if(!_0x58c575['ok'])throw new Error(_0x424b1b(0x168)+_0x58c575[_0x424b1b(0x154)]);const _0x28a266=Buffer[_0x424b1b(0x16a)](await _0x58c575[_0x424b1b(0x1a0)]()),_0x3c00c8=await _0x41692c(_0x28a266);_0x170897[_0x424b1b(0x18e)](_0x3c00c8[_0x424b1b(0x1b0)](_0x424b1b(0x1aa)));}return _0x170897[_0x424b1b(0x1bd)]('\x0a');}async[a63_0x5f356f(0x190)](_0x325302,_0xf1a08f){const _0x56429c=a63_0x5f356f,_0x5cde4b=await this[_0x56429c(0x152)][_0x56429c(0x1a1)](_0x325302,_0xf1a08f);return _0x5cde4b[_0x56429c(0x198)];}async['retrySession'](_0x5a98f8,_0x4cf480){const _0x53b145=a63_0x5f356f,_0x4fc714=await this['client'][_0x53b145(0x18d)](_0x5a98f8,{'from_task':_0x4cf480?.[_0x53b145(0x17b)],'retry_params':_0x4cf480?.[_0x53b145(0x1ae)]});return{'attemptId':_0x4fc714['id'],'sessionId':_0x4fc714['sessionId']};}async[a63_0x5f356f(0x174)](_0x25415b,_0x482687){const _0x28f385=a63_0x5f356f,_0x3c902f=await this[_0x28f385(0x152)][_0x28f385(0x174)](_0x25415b,{'resume_from':_0x482687?.[_0x28f385(0x18f)],'retry_params':_0x482687?.['retryParams'],'force':_0x482687?.[_0x28f385(0x15b)]});return{'attemptId':_0x3c902f['id'],'sessionId':_0x3c902f[_0x28f385(0x15e)]};}async[a63_0x5f356f(0x192)](_0x3dfe58,_0x3f4c2b={},_0x3ed73d){const _0x43d15d=a63_0x5f356f,_0x4e9378=_0x3dfe58[_0x43d15d(0x19a)]('.');let _0xb5c035,_0x1c3a19;if(_0x4e9378===-0x1)throw new Error(_0x43d15d(0x1b4));_0xb5c035=_0x3dfe58[_0x43d15d(0x1a4)](0x0,_0x4e9378),_0x1c3a19=_0x3dfe58[_0x43d15d(0x1a4)](_0x4e9378+0x1);if(!_0xb5c035||!_0x1c3a19)throw new Error(_0x43d15d(0x1ad)+_0x3dfe58+_0x43d15d(0x171));const _0x21b906=_0x3ed73d?.['sessionTime']||new Date()[_0x43d15d(0x199)]();return await this[_0x43d15d(0x152)][_0x43d15d(0x1bb)]({'projectName':_0xb5c035,'workflowName':_0x1c3a19,'sessionTime':_0x21b906,'params':_0x3f4c2b});}async['download'](_0x3b0df3,_0x32625e,_0x49f64f){const _0x3ec9b2=a63_0x5f356f,{promises:_0x1ad259}=await import('fs'),_0x26a42e=await import(_0x3ec9b2(0x1a6)),_0x453727=await import('os'),_0x28353c=await import(_0x3ec9b2(0x1a7)),{id:_0x4299b3,name:_0x115fdf}=await this[_0x3ec9b2(0x15c)](_0x3b0df3),_0x4d5676=_0x453727[_0x3ec9b2(0x16e)](),_0x160ff6=_0x26a42e[_0x3ec9b2(0x1bd)](_0x4d5676,_0x3ec9b2(0x159)+_0x4299b3+'-'+Date[_0x3ec9b2(0x182)]()+_0x3ec9b2(0x18b));try{await this[_0x3ec9b2(0x152)]['downloadProjectArchive'](_0x4299b3,_0x160ff6,_0x49f64f?.[_0x3ec9b2(0x195)]);const _0x1d68b1=_0x26a42e['join'](_0x32625e,_0x115fdf);await _0x1ad259[_0x3ec9b2(0x178)](_0x1d68b1,{'recursive':!![]}),await _0x28353c[_0x3ec9b2(0x16b)]({'file':_0x160ff6,'cwd':_0x1d68b1,'gzip':!![]});const _0x551009=async _0x2c0c6e=>{const _0x1e13bb=_0x3ec9b2;let _0x336e9f=0x0;const _0x76d359=await _0x1ad259['readdir'](_0x2c0c6e,{'withFileTypes':!![]});for(const _0x59639b of _0x76d359){const _0x15930d=_0x26a42e[_0x1e13bb(0x1bd)](_0x2c0c6e,_0x59639b[_0x1e13bb(0x14e)]);if(_0x59639b[_0x1e13bb(0x16d)]())_0x336e9f++;else _0x59639b['isDirectory']()&&(_0x336e9f+=await _0x551009(_0x15930d));}return _0x336e9f;},_0x397a57=await _0x551009(_0x1d68b1);return{'projectName':_0x115fdf,'revision':_0x49f64f?.[_0x3ec9b2(0x195)]||'latest','filesExtracted':_0x397a57};}finally{try{await _0x1ad259[_0x3ec9b2(0x188)](_0x160ff6);}catch{}}}async[a63_0x5f356f(0x18e)](_0x27f304,_0x2f3849){const _0x1cdea9=a63_0x5f356f,{promises:_0x46412e}=await import('fs'),_0x4f2b9a=await import(_0x1cdea9(0x1a6)),_0x3ca2e6=await import(_0x1cdea9(0x1a7)),_0x22a3b5=_0x2f3849?.[_0x1cdea9(0x17c)]||_0x4f2b9a['basename'](_0x27f304),_0x44b230=_0x2f3849?.[_0x1cdea9(0x195)]||new Date()[_0x1cdea9(0x199)]()[_0x1cdea9(0x169)](/[:.]/g,'-');try{await _0x46412e[_0x1cdea9(0x189)](_0x27f304);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x27f304);}if(!_0x2f3849?.[_0x1cdea9(0x15d)]){const _0x3fdfe9=await _0x46412e[_0x1cdea9(0x16c)](_0x27f304),_0x1073ad=_0x3fdfe9[_0x1cdea9(0x1bc)](_0x13e313=>_0x13e313['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x1073ad[_0x1cdea9(0x187)]===0x0)throw new Error(_0x1cdea9(0x1bf)+WORKFLOW_FILE_EXTENSION+_0x1cdea9(0x183));for(const _0xb1560d of _0x1073ad){const _0x5f43dc=_0x4f2b9a[_0x1cdea9(0x1bd)](_0x27f304,_0xb1560d);try{await _0x46412e[_0x1cdea9(0x189)](_0x5f43dc);}catch{throw new Error(_0x1cdea9(0x179)+_0xb1560d);}}}const _0x116fa2=async(_0x3ea05d,_0x19680c='')=>{const _0x4cbcff=_0x1cdea9,_0x13117d=await _0x46412e[_0x4cbcff(0x16c)](_0x3ea05d,{'withFileTypes':!![]}),_0x13c65=[];for(const _0x3c06c2 of _0x13117d){const _0x2757ba=_0x4f2b9a[_0x4cbcff(0x1bd)](_0x19680c,_0x3c06c2[_0x4cbcff(0x14e)]),_0x8b43d8=_0x4f2b9a[_0x4cbcff(0x1bd)](_0x3ea05d,_0x3c06c2[_0x4cbcff(0x14e)]);if(!shouldIncludeInArchive(_0x3c06c2['name']))continue;_0x3c06c2[_0x4cbcff(0x17f)]()?_0x13c65[_0x4cbcff(0x18e)](...await _0x116fa2(_0x8b43d8,_0x2757ba)):_0x13c65['push'](_0x2757ba);}return _0x13c65;},_0xf8624=await _0x116fa2(_0x27f304),_0xa1a462=await import('os'),_0x32f478=_0xa1a462['tmpdir'](),_0x153cb=_0x4f2b9a[_0x1cdea9(0x1bd)](_0x32f478,_0x1cdea9(0x1c2)+Date['now']()+_0x1cdea9(0x18b));try{await _0x3ca2e6[_0x1cdea9(0x1b2)]({'file':_0x153cb,'gzip':!![],'cwd':_0x27f304,'portable':!![]},_0xf8624);const _0x34c2e7=await this['client']['uploadProjectArchive'](_0x22a3b5,_0x44b230,_0x153cb,{'scheduleFrom':_0x2f3849?.['scheduleFrom'],'clearSchedule':_0x2f3849?.[_0x1cdea9(0x166)],'clearScheduleAll':_0x2f3849?.[_0x1cdea9(0x1a8)]});return{'projectId':_0x34c2e7['id'],'projectName':_0x34c2e7['name'],'revision':_0x34c2e7[_0x1cdea9(0x195)]};}finally{try{await _0x46412e['unlink'](_0x153cb);}catch{}}}async[a63_0x5f356f(0x193)](_0x4005f9){const _0x5f5942=a63_0x5f356f,{id:_0x1bada3}=await this[_0x5f5942(0x15c)](_0x4005f9),_0x342e25=await this[_0x5f5942(0x152)]['deleteProject'](_0x1bada3);return{'projectId':_0x342e25['id'],'projectName':_0x342e25[_0x5f5942(0x14e)]};}}
|
|
1
|
+
function a63_0xdf57(_0x119de1,_0x217a68){const _0x5b17e7=a63_0x5b17();return a63_0xdf57=function(_0xdf5778,_0x142f7f){_0xdf5778=_0xdf5778-0x1ac;let _0x19cc0f=_0x5b17e7[_0xdf5778];return _0x19cc0f;},a63_0xdf57(_0x119de1,_0x217a68);}const a63_0x4b6685=a63_0xdf57;(function(_0x568a14,_0x4a68dc){const _0x2cd025=a63_0xdf57,_0x748d02=_0x568a14();while(!![]){try{const _0xd9b5d1=-parseInt(_0x2cd025(0x207))/0x1+parseInt(_0x2cd025(0x1da))/0x2*(-parseInt(_0x2cd025(0x217))/0x3)+-parseInt(_0x2cd025(0x210))/0x4*(-parseInt(_0x2cd025(0x1e0))/0x5)+-parseInt(_0x2cd025(0x1bc))/0x6*(parseInt(_0x2cd025(0x21f))/0x7)+-parseInt(_0x2cd025(0x1d6))/0x8*(-parseInt(_0x2cd025(0x1f7))/0x9)+-parseInt(_0x2cd025(0x1ea))/0xa*(parseInt(_0x2cd025(0x1dc))/0xb)+parseInt(_0x2cd025(0x1cc))/0xc*(parseInt(_0x2cd025(0x1b0))/0xd);if(_0xd9b5d1===_0x4a68dc)break;else _0x748d02['push'](_0x748d02['shift']());}catch(_0x39840a){_0x748d02['push'](_0x748d02['shift']());}}}(a63_0x5b17,0xf3083));import{WorkflowApiClient}from'../client/workflow-client.js';function a63_0x5b17(){const _0x1566ef=['killAttempt','downloadProjectArchive','sessions','message','fromTime','sessionId','stateParams','833jAyGpz','Project\x20not\x20found:\x20','createdAt','isGroup','listAttempts','success','name','797706qZBWUB','startAttempt','retryAt','attempts','listLogFiles','getAttempt','toISOString','tdx-workflow-','fullName','sessionUuid','workflow','direct','48126MAvoYy','extract','logger','unlink','storeParams','tar','error','find','delete','path','toTime','latest','readdir','revision','retryParams','clearScheduleAll','1044nvwKTi','cancelRequested','getAttemptTasks','retrySession','arrayBuffer','substring','push','listWorkflows','client','retryAttempt','176CQDmRF','listSessions','mkdir','scheduleFrom','1309754WuwcVr','listProjects','11HZjQNz','create','access','deleteProject','46105SVPbnf','config','kill','status','.\x20Expected\x20\x22project.workflow\x22','Invalid\x20workflow\x20format:\x20','fromTask','projects','lastId','sessionTime','18637880zbkKMG','force','length','timezone','isDirectory','tdx-workflow-push-','uploadProjectArchive','attempt','clearSchedule','No\x20','data','projectName','replace','72711NurLER','test','last_id','done','workflowName','logFiles','limit','params','join','toString','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','map','now','.tar.gz','project','upstreams','503384RvIejM','lastAttempt','index','resolveProjectId','resumeFrom','basename','tasks','NUMERIC_ID_PATTERN','tmpdir','48qPQrdO','\x20workflow\x20files\x20found\x20in\x20project\x20directory','workflows','from','run','exportParams','download','6vLqgHa'];a63_0x5b17=function(){return _0x1566ef;};return a63_0x5b17();}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowSDK{static [a63_0x4b6685(0x20e)]=/^\d+$/;[a63_0x4b6685(0x1d4)];constructor(_0x4f7468){const _0x1f1b47=a63_0x4b6685;this[_0x1f1b47(0x1d4)]=new WorkflowApiClient(_0x4f7468,_0x4f7468[_0x1f1b47(0x1be)]);}async[a63_0x4b6685(0x20a)](_0x5be82d){const _0x3d7259=a63_0x4b6685;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x3d7259(0x1f8)](_0x5be82d))return{'id':_0x5be82d,'name':_0x5be82d};const _0x26c920=await this[_0x3d7259(0x1d4)]['listProjects']({'name_pattern':_0x5be82d}),_0x2cc800=_0x26c920[_0x3d7259(0x1f4)][_0x3d7259(0x1c3)](_0x1e6e19=>_0x1e6e19[_0x3d7259(0x1af)]===_0x5be82d);if(!_0x2cc800)throw new Error(_0x3d7259(0x220)+_0x5be82d);return{'id':_0x2cc800['id'],'name':_0x2cc800['name']};}async[a63_0x4b6685(0x1e7)](_0xf54de5,_0x1ee493){const _0x120bcb=a63_0x4b6685,_0x5789a3=await this['client'][_0x120bcb(0x1db)]({'name_pattern':_0xf54de5,..._0x1ee493});return _0x5789a3['data'][_0x120bcb(0x202)](_0x3b6360=>({..._0x3b6360,'project_id':_0x3b6360['id'],'project_name':_0x3b6360[_0x120bcb(0x1af)]}));}async[a63_0x4b6685(0x212)](_0x573fd5,_0x58b301){const _0x64d84b=a63_0x4b6685,_0x1a72e5=await this['client'][_0x64d84b(0x1d3)]({'project_name':_0x573fd5,..._0x58b301});return _0x1a72e5[_0x64d84b(0x1f4)][_0x64d84b(0x202)](_0x54f93b=>({'project_id':_0x54f93b[_0x64d84b(0x205)]?.['id'],'project_name':_0x54f93b[_0x64d84b(0x205)]?.[_0x64d84b(0x1af)],'workflow_id':_0x54f93b['id'],'workflow_name':_0x54f93b[_0x64d84b(0x1af)],'revision':_0x54f93b[_0x64d84b(0x1c9)],'timezone':_0x54f93b[_0x64d84b(0x1ed)],'config':_0x54f93b['config'],'id':_0x54f93b['id'],'name':_0x54f93b['name'],'project':_0x54f93b[_0x64d84b(0x205)]}));}async[a63_0x4b6685(0x21a)](_0x36855d){const _0x2c5a9d=a63_0x4b6685;let _0x3e2094;if(_0x36855d?.[_0x2c5a9d(0x1f5)]){let _0x337afc,_0x3d11c6=![];while(!_0x3d11c6){const _0x52a038=await this[_0x2c5a9d(0x1d4)][_0x2c5a9d(0x1db)]({'limit':0x64,'last_id':_0x337afc}),_0x57fd7d=_0x52a038['data'][_0x2c5a9d(0x1c3)](_0x2f8491=>_0x2f8491[_0x2c5a9d(0x1af)]===_0x36855d[_0x2c5a9d(0x1f5)]);if(_0x57fd7d){_0x3e2094=_0x57fd7d['id'],_0x3d11c6=!![];break;}if(!_0x52a038['lastId']||_0x52a038[_0x2c5a9d(0x1f4)]['length']===0x0)break;_0x337afc=_0x52a038[_0x2c5a9d(0x1e8)];}if(!_0x3e2094)throw new Error('Project\x20not\x20found:\x20'+_0x36855d[_0x2c5a9d(0x1f5)]);}const _0x3034d6=await this['client'][_0x2c5a9d(0x1d7)]({'project_id':_0x3e2094,'project_name':_0x36855d?.[_0x2c5a9d(0x1f5)],'workflow_name':_0x36855d?.[_0x2c5a9d(0x1fb)],'status':_0x36855d?.[_0x2c5a9d(0x1e3)],'from_time':_0x36855d?.[_0x2c5a9d(0x21c)],'to_time':_0x36855d?.[_0x2c5a9d(0x1c6)],'limit':_0x36855d?.[_0x2c5a9d(0x1fd)],'last_id':_0x36855d?.[_0x2c5a9d(0x1f9)]});return _0x3034d6[_0x2c5a9d(0x1f4)]['map'](_0x40623f=>({'project_id':_0x40623f[_0x2c5a9d(0x205)]?.['id'],'project_name':_0x40623f[_0x2c5a9d(0x205)]?.['name'],'workflow_id':_0x40623f[_0x2c5a9d(0x1ba)]?.['id'],'workflow_name':_0x40623f[_0x2c5a9d(0x1ba)]?.['name'],'session_id':_0x40623f['id'],'sessionUuid':_0x40623f[_0x2c5a9d(0x1b9)],'sessionTime':_0x40623f[_0x2c5a9d(0x1e9)],'lastAttempt':_0x40623f[_0x2c5a9d(0x208)],'id':_0x40623f['id'],'project':_0x40623f[_0x2c5a9d(0x205)],'workflow':_0x40623f['workflow']}));}async[a63_0x4b6685(0x1b3)](_0x8e1e43){const _0x1c4f67=a63_0x4b6685,_0x2f5dad=await this[_0x1c4f67(0x1d4)][_0x1c4f67(0x1ad)]({'project_name':_0x8e1e43?.[_0x1c4f67(0x1f5)],'workflow_name':_0x8e1e43?.[_0x1c4f67(0x1fb)],'include_retried':_0x8e1e43?.['includeRetried'],'limit':_0x8e1e43?.[_0x1c4f67(0x1fd)],'last_id':_0x8e1e43?.[_0x1c4f67(0x1f9)]});return _0x2f5dad[_0x1c4f67(0x1f4)][_0x1c4f67(0x202)](_0x35045f=>({'project_id':_0x35045f[_0x1c4f67(0x205)]?.['id'],'project_name':_0x35045f['project']?.[_0x1c4f67(0x1af)],'workflow_id':_0x35045f['workflow']?.['id'],'workflow_name':_0x35045f[_0x1c4f67(0x1ba)]?.[_0x1c4f67(0x1af)],'session_id':_0x35045f[_0x1c4f67(0x21d)],'sessionUuid':_0x35045f['sessionUuid'],'sessionTime':_0x35045f['sessionTime'],'attempt_id':_0x35045f['id'],'attempt_index':_0x35045f[_0x1c4f67(0x209)],'retryAttemptName':_0x35045f['retryAttemptName'],'done':_0x35045f[_0x1c4f67(0x1fa)],'success':_0x35045f[_0x1c4f67(0x1ae)],'cancelRequested':_0x35045f[_0x1c4f67(0x1cd)],'params':_0x35045f[_0x1c4f67(0x1fe)],'createdAt':_0x35045f[_0x1c4f67(0x221)],'finishedAt':_0x35045f['finishedAt'],'id':_0x35045f['id'],'index':_0x35045f['index'],'project':_0x35045f[_0x1c4f67(0x205)],'workflow':_0x35045f['workflow']}));}async[a63_0x4b6685(0x1f1)](_0x3b4f4d){const _0xf3eeee=a63_0x4b6685,_0x11c356=await this[_0xf3eeee(0x1d4)][_0xf3eeee(0x1b5)](_0x3b4f4d);return _0x11c356;}async[a63_0x4b6685(0x20d)](_0x539576,_0x329db4=![]){const _0x286451=a63_0x4b6685,_0xf9431e=await this[_0x286451(0x1d4)][_0x286451(0x1ce)](_0x539576,_0x329db4);return _0xf9431e[_0x286451(0x202)](_0x454ca0=>({'task_id':_0x454ca0['id'],'task_name':_0x454ca0[_0x286451(0x1b8)],'parentId':_0x454ca0['parentId'],'config':_0x454ca0[_0x286451(0x1e1)],'upstreams':_0x454ca0[_0x286451(0x206)],'state':_0x454ca0['state'],'exportParams':_0x454ca0[_0x286451(0x215)],'storeParams':_0x454ca0[_0x286451(0x1c0)],'stateParams':_0x454ca0[_0x286451(0x21e)],'updatedAt':_0x454ca0['updatedAt'],'retryAt':_0x454ca0[_0x286451(0x1b2)],'startedAt':_0x454ca0['startedAt'],'error':_0x454ca0[_0x286451(0x1c2)],'isGroup':_0x454ca0[_0x286451(0x1ac)],'id':_0x454ca0['id'],'fullName':_0x454ca0[_0x286451(0x1b8)]}));}async[a63_0x4b6685(0x1fc)](_0x4cdfc6,_0x5c04f7){const _0xcf4a27=a63_0x4b6685;return await this[_0xcf4a27(0x1d4)][_0xcf4a27(0x1b4)](_0x4cdfc6,_0x5c04f7);}async['logs'](_0x2de3d8,_0x17981a){const _0x4cd45d=a63_0x4b6685,_0x2283d7=await import('zlib'),{promisify:_0x22fccc}=await import('util'),_0x52841f=_0x22fccc(_0x2283d7['gunzip']),_0x3acf8b=await this[_0x4cd45d(0x1d4)][_0x4cd45d(0x1b4)](_0x2de3d8,_0x17981a);if(_0x3acf8b['length']===0x0)return'';const _0x330272=[];for(const _0x574601 of _0x3acf8b){if(!_0x574601[_0x4cd45d(0x1bb)])continue;const _0x215a0f=await fetch(_0x574601['direct']);if(!_0x215a0f['ok'])throw new Error('Failed\x20to\x20download\x20log\x20file:\x20'+_0x215a0f['status']);const _0xd22021=Buffer[_0x4cd45d(0x213)](await _0x215a0f[_0x4cd45d(0x1d0)]()),_0x583eb2=await _0x52841f(_0xd22021);_0x330272[_0x4cd45d(0x1d2)](_0x583eb2[_0x4cd45d(0x200)]('utf-8'));}return _0x330272[_0x4cd45d(0x1ff)]('\x0a');}async[a63_0x4b6685(0x1e2)](_0x5638c7,_0x4dcd2e){const _0x57bd1a=a63_0x4b6685,_0x4656ba=await this[_0x57bd1a(0x1d4)][_0x57bd1a(0x218)](_0x5638c7,_0x4dcd2e);return _0x4656ba[_0x57bd1a(0x21b)];}async[a63_0x4b6685(0x1cf)](_0x514851,_0x4718e3){const _0x4b4808=a63_0x4b6685,_0x17f73b=await this[_0x4b4808(0x1d4)][_0x4b4808(0x1cf)](_0x514851,{'from_task':_0x4718e3?.[_0x4b4808(0x1e6)],'retry_params':_0x4718e3?.[_0x4b4808(0x1ca)]});return{'attemptId':_0x17f73b['id'],'sessionId':_0x17f73b[_0x4b4808(0x21d)]};}async[a63_0x4b6685(0x1d5)](_0x45eef2,_0x2a9bbb){const _0x532d1a=a63_0x4b6685,_0x5657f5=await this[_0x532d1a(0x1d4)][_0x532d1a(0x1d5)](_0x45eef2,{'resume_from':_0x2a9bbb?.[_0x532d1a(0x20b)],'retry_params':_0x2a9bbb?.[_0x532d1a(0x1ca)],'force':_0x2a9bbb?.[_0x532d1a(0x1eb)]});return{'attemptId':_0x5657f5['id'],'sessionId':_0x5657f5[_0x532d1a(0x21d)]};}async[a63_0x4b6685(0x214)](_0x1ec536,_0x426ef8={},_0x26e0f2){const _0xc45d6c=a63_0x4b6685,_0x2a6f28=_0x1ec536['indexOf']('.');let _0x13fbe8,_0x5c73a1;if(_0x2a6f28===-0x1)throw new Error(_0xc45d6c(0x201));_0x13fbe8=_0x1ec536['substring'](0x0,_0x2a6f28),_0x5c73a1=_0x1ec536[_0xc45d6c(0x1d1)](_0x2a6f28+0x1);if(!_0x13fbe8||!_0x5c73a1)throw new Error(_0xc45d6c(0x1e5)+_0x1ec536+_0xc45d6c(0x1e4));const _0x15553f=_0x26e0f2?.[_0xc45d6c(0x1e9)]||new Date()[_0xc45d6c(0x1b6)]();return await this[_0xc45d6c(0x1d4)][_0xc45d6c(0x1b1)]({'projectName':_0x13fbe8,'workflowName':_0x5c73a1,'sessionTime':_0x15553f,'params':_0x426ef8});}async[a63_0x4b6685(0x216)](_0x57d207,_0x190a56,_0x301a44){const _0x742a0=a63_0x4b6685,{promises:_0x8a32ce}=await import('fs'),_0x7e5428=await import(_0x742a0(0x1c5)),_0x59662a=await import('os'),_0x422903=await import(_0x742a0(0x1c1)),{id:_0x35b6a7,name:_0x54c4b3}=await this[_0x742a0(0x20a)](_0x57d207),_0x139d72=_0x59662a['tmpdir'](),_0x1864a7=_0x7e5428[_0x742a0(0x1ff)](_0x139d72,_0x742a0(0x1b7)+_0x35b6a7+'-'+Date[_0x742a0(0x203)]()+_0x742a0(0x204));try{await this[_0x742a0(0x1d4)][_0x742a0(0x219)](_0x35b6a7,_0x1864a7,_0x301a44?.['revision']);const _0x287061=_0x7e5428[_0x742a0(0x1ff)](_0x190a56,_0x54c4b3);await _0x8a32ce[_0x742a0(0x1d8)](_0x287061,{'recursive':!![]}),await _0x422903[_0x742a0(0x1bd)]({'file':_0x1864a7,'cwd':_0x287061,'gzip':!![]});const _0x1029a6=async _0x29efaf=>{const _0x1ecf88=_0x742a0;let _0x37ca5b=0x0;const _0x15f7eb=await _0x8a32ce[_0x1ecf88(0x1c8)](_0x29efaf,{'withFileTypes':!![]});for(const _0x3243ab of _0x15f7eb){const _0x10d99f=_0x7e5428[_0x1ecf88(0x1ff)](_0x29efaf,_0x3243ab['name']);if(_0x3243ab['isFile']())_0x37ca5b++;else _0x3243ab[_0x1ecf88(0x1ee)]()&&(_0x37ca5b+=await _0x1029a6(_0x10d99f));}return _0x37ca5b;},_0x2263ad=await _0x1029a6(_0x287061);return{'projectName':_0x54c4b3,'revision':_0x301a44?.['revision']||_0x742a0(0x1c7),'filesExtracted':_0x2263ad};}finally{try{await _0x8a32ce[_0x742a0(0x1bf)](_0x1864a7);}catch{}}}async['push'](_0x357967,_0x16cc3c){const _0x5eee2c=a63_0x4b6685,{promises:_0x169f63}=await import('fs'),_0x544aba=await import(_0x5eee2c(0x1c5)),_0x486a54=await import(_0x5eee2c(0x1c1)),_0x1f0f8b=_0x16cc3c?.['projectName']||_0x544aba[_0x5eee2c(0x20c)](_0x357967),_0x57f68e=_0x16cc3c?.[_0x5eee2c(0x1c9)]||new Date()[_0x5eee2c(0x1b6)]()[_0x5eee2c(0x1f6)](/[:.]/g,'-');try{await _0x169f63[_0x5eee2c(0x1de)](_0x357967);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x357967);}if(!_0x16cc3c?.['skipValidation']){const _0x5b8eee=await _0x169f63[_0x5eee2c(0x1c8)](_0x357967),_0x42ab56=_0x5b8eee['filter'](_0x52c6aa=>_0x52c6aa['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x42ab56[_0x5eee2c(0x1ec)]===0x0)throw new Error(_0x5eee2c(0x1f3)+WORKFLOW_FILE_EXTENSION+_0x5eee2c(0x211));for(const _0x295e82 of _0x42ab56){const _0x22f597=_0x544aba[_0x5eee2c(0x1ff)](_0x357967,_0x295e82);try{await _0x169f63[_0x5eee2c(0x1de)](_0x22f597);}catch{throw new Error('Cannot\x20read\x20workflow\x20file:\x20'+_0x295e82);}}}const _0x230021=async(_0x2ab7de,_0x2f1187='')=>{const _0xd7e1f2=_0x5eee2c,_0x1422d4=await _0x169f63[_0xd7e1f2(0x1c8)](_0x2ab7de,{'withFileTypes':!![]}),_0x31b191=[];for(const _0x59b468 of _0x1422d4){const _0x3cb175=_0x544aba['join'](_0x2f1187,_0x59b468[_0xd7e1f2(0x1af)]),_0x75cf1d=_0x544aba[_0xd7e1f2(0x1ff)](_0x2ab7de,_0x59b468[_0xd7e1f2(0x1af)]);if(!shouldIncludeInArchive(_0x59b468['name']))continue;_0x59b468[_0xd7e1f2(0x1ee)]()?_0x31b191[_0xd7e1f2(0x1d2)](...await _0x230021(_0x75cf1d,_0x3cb175)):_0x31b191['push'](_0x3cb175);}return _0x31b191;},_0x1ec3f6=await _0x230021(_0x357967),_0x1160af=await import('os'),_0x53ca8b=_0x1160af[_0x5eee2c(0x20f)](),_0x43772b=_0x544aba[_0x5eee2c(0x1ff)](_0x53ca8b,_0x5eee2c(0x1ef)+Date[_0x5eee2c(0x203)]()+'.tar.gz');try{await _0x486a54[_0x5eee2c(0x1dd)]({'file':_0x43772b,'gzip':!![],'cwd':_0x357967,'portable':!![]},_0x1ec3f6);const _0x5134a6=await this['client'][_0x5eee2c(0x1f0)](_0x1f0f8b,_0x57f68e,_0x43772b,{'scheduleFrom':_0x16cc3c?.[_0x5eee2c(0x1d9)],'clearSchedule':_0x16cc3c?.[_0x5eee2c(0x1f2)],'clearScheduleAll':_0x16cc3c?.[_0x5eee2c(0x1cb)]});return{'projectId':_0x5134a6['id'],'projectName':_0x5134a6[_0x5eee2c(0x1af)],'revision':_0x5134a6[_0x5eee2c(0x1c9)]};}finally{try{await _0x169f63[_0x5eee2c(0x1bf)](_0x43772b);}catch{}}}async[a63_0x4b6685(0x1c4)](_0x430c6a){const _0x2dece8=a63_0x4b6685,{id:_0x599dfe}=await this[_0x2dece8(0x20a)](_0x430c6a),_0x47432c=await this[_0x2dece8(0x1d4)][_0x2dece8(0x1df)](_0x599dfe);return{'projectId':_0x47432c['id'],'projectName':_0x47432c['name']};}}
|
package/dist/types/endpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x4576a7=a67_0x1da2;(function(_0x529490,_0x2b4764){const _0x1fe468=a67_0x1da2,_0x478f6a=_0x529490();while(!![]){try{const _0x54e29f=-parseInt(_0x1fe468(0xc0))/0x1+-parseInt(_0x1fe468(0xb5))/0x2*(parseInt(_0x1fe468(0xb2))/0x3)+parseInt(_0x1fe468(0xb6))/0x4+parseInt(_0x1fe468(0xb0))/0x5*(-parseInt(_0x1fe468(0xab))/0x6)+parseInt(_0x1fe468(0x97))/0x7+-parseInt(_0x1fe468(0xa5))/0x8+-parseInt(_0x1fe468(0xb7))/0x9*(-parseInt(_0x1fe468(0x9b))/0xa);if(_0x54e29f===_0x2b4764)break;else _0x478f6a['push'](_0x478f6a['shift']());}catch(_0x223249){_0x478f6a['push'](_0x478f6a['shift']());}}}(a67_0x17af,0xd6b96));export const TD_ENDPOINTS={'us01':a67_0x4576a7(0x84),'jp01':a67_0x4576a7(0x90),'eu01':a67_0x4576a7(0x93),'ap02':a67_0x4576a7(0xa4),'ap03':a67_0x4576a7(0x86),'dev-us01':a67_0x4576a7(0x88),'dev-eu01':'https://api-development.eu01.treasuredata.com','stg-us01':a67_0x4576a7(0xa8),'stg-jp01':a67_0x4576a7(0xba),'stg-ap03':a67_0x4576a7(0x85)};export const CDP_ENDPOINTS={'us01':a67_0x4576a7(0x81),'jp01':'https://api-cdp.treasuredata.co.jp','eu01':a67_0x4576a7(0x82),'ap02':a67_0x4576a7(0xb8),'ap03':a67_0x4576a7(0xa7),'dev-us01':a67_0x4576a7(0x8f),'dev-eu01':a67_0x4576a7(0xc3),'stg-us01':a67_0x4576a7(0xae),'stg-jp01':a67_0x4576a7(0x95),'stg-ap03':'https://api-staging-cdp.ap03.treasuredata.com'};export const WORKFLOW_ENDPOINTS={'us01':a67_0x4576a7(0xa0),'jp01':a67_0x4576a7(0xa2),'eu01':'https://api-workflow.eu01.treasuredata.com','ap02':a67_0x4576a7(0xa6),'ap03':a67_0x4576a7(0xa9),'dev-us01':a67_0x4576a7(0x9f),'dev-eu01':a67_0x4576a7(0xb9),'stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-jp01':a67_0x4576a7(0xad),'stg-ap03':a67_0x4576a7(0x8b)};function a67_0x1da2(_0x3c3a98,_0x324563){const _0x17afc4=a67_0x17af();return a67_0x1da2=function(_0x1da2d0,_0x2a7393){_0x1da2d0=_0x1da2d0-0x7f;let _0x160171=_0x17afc4[_0x1da2d0];return _0x160171;},a67_0x1da2(_0x3c3a98,_0x324563);}export const TRINO_ENDPOINTS={'us01':a67_0x4576a7(0x9d),'jp01':a67_0x4576a7(0xb1),'eu01':'https://api-presto.eu01.treasuredata.com','ap02':a67_0x4576a7(0xa3),'ap03':'https://api-presto.ap03.treasuredata.com','dev-us01':a67_0x4576a7(0x96),'dev-eu01':a67_0x4576a7(0xb4),'stg-us01':a67_0x4576a7(0x91),'stg-jp01':a67_0x4576a7(0xbd),'stg-ap03':a67_0x4576a7(0x94)};export const LLM_ENDPOINTS={'us01':a67_0x4576a7(0x8e),'jp01':a67_0x4576a7(0xac),'eu01':'https://llm-api.eu01.treasuredata.com','ap02':a67_0x4576a7(0x8a),'ap03':a67_0x4576a7(0x89),'dev-us01':a67_0x4576a7(0x98),'dev-eu01':a67_0x4576a7(0x92),'stg-us01':'https://llm-api-staging.us01.treasuredata.com','stg-jp01':a67_0x4576a7(0x9a),'stg-ap03':a67_0x4576a7(0x7f)};export const ENGAGE_ENDPOINTS={'us01':a67_0x4576a7(0xbe),'jp01':a67_0x4576a7(0xbf),'eu01':a67_0x4576a7(0x9e),'ap02':a67_0x4576a7(0xbb),'ap03':a67_0x4576a7(0xa1),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':a67_0x4576a7(0xaf),'stg-us01':a67_0x4576a7(0x87),'stg-jp01':a67_0x4576a7(0x8c),'stg-ap03':a67_0x4576a7(0x99)};export const CONSOLE_ENDPOINTS={'us01':'https://console.treasuredata.com','jp01':'https://console.treasuredata.co.jp','eu01':'https://console.eu01.treasuredata.com','ap02':a67_0x4576a7(0xc1),'ap03':'https://console.ap03.treasuredata.com','dev-us01':a67_0x4576a7(0x80),'dev-eu01':a67_0x4576a7(0xb3),'stg-us01':a67_0x4576a7(0x9c),'stg-jp01':a67_0x4576a7(0x8d),'stg-ap03':a67_0x4576a7(0xc2)};export function getConsoleUrl(_0xcd8a47,_0x4aa5c3){const _0x4d95be=a67_0x4576a7,_0x21e9fb=CONSOLE_ENDPOINTS[_0xcd8a47]||'https://console.'+_0xcd8a47+_0x4d95be(0xbc);return _0x4aa5c3?''+_0x21e9fb+_0x4aa5c3:_0x21e9fb;}function a67_0x17af(){const _0xbd4c4=['https://api.treasuredata.co.jp','https://api-staging-presto.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://api.eu01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://api-development-presto.treasuredata.com','7936355CAegyY','https://llm-api-development.us01.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','1300dyxKjE','https://console-staging.us01.treasuredata.com','https://api-presto.treasuredata.com','https://engage-api.eu01.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://api-workflow.treasuredata.com','https://engage-api.ap03.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://api-presto.ap02.treasuredata.com','https://api.ap02.treasuredata.com','14002952mQiUBr','https://api-workflow.ap02.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://api-staging.us01.treasuredata.com','https://api-workflow.ap03.treasuredata.com','\x27\x20and\x20site\x20\x27','1266ruEOOs','https://llm-api.treasuredata.co.jp','https://api-staging-workflow.treasuredata.co.jp','https://api-staging-cdp.us01.treasuredata.com','https://engage-api-development.eu01.treasuredata.com','37085AynqFr','https://api-presto.treasuredata.co.jp','105Pcwjke','https://console-development.eu01.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','53636yFlSyB','5377944GmkpKU','209619WAOeTe','https://api-cdp.ap02.treasuredata.com','https://api-development-workflow.eu01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://engage-api.ap02.treasuredata.com','.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://engage-api.treasuredata.com','https://engage-api.treasuredata.co.jp','372585BGAqgp','https://console.ap02.treasuredata.com','https://console-staging.ap03.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://console-development.treasuredata.com','https://api-cdp.treasuredata.com','https://api-cdp.eu01.treasuredata.com','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','https://api.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://api.ap03.treasuredata.com','https://engage-api-staging.us01.treasuredata.com','https://api-development.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://console-staging.treasuredata.co.jp','https://llm-api.treasuredata.com','https://api-development-cdp.us01.treasuredata.com'];a67_0x17af=function(){return _0xbd4c4;};return a67_0x17af();}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS};export function getEndpoint(_0x1433c6,_0x116726='td'){const _0x2722f2=a67_0x4576a7,_0x3d8926=API_ENDPOINTS[_0x116726]?.[_0x1433c6];if(!_0x3d8926)throw new Error(_0x2722f2(0x83)+_0x116726+_0x2722f2(0xaa)+_0x1433c6+'\x27');return _0x3d8926;}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a69_0x1d5177=a69_0x1006;function a69_0x3f06(){const _0x4ab61e=['6zaRHic','us01','jp01','614285qxgaee','98280MIVsJd','1090175QqVoEm','49771UmguQp','414746FYHAWH','3632950fRcgPJ','stg-us01','3QixJVR','4mQDhmV','1513656yJjaCg'];a69_0x3f06=function(){return _0x4ab61e;};return a69_0x3f06();}(function(_0x5a5c98,_0x289b44){const _0x3a5a9b=a69_0x1006,_0x3f4be8=_0x5a5c98();while(!![]){try{const _0x55e79f=-parseInt(_0x3a5a9b(0x168))/0x1+parseInt(_0x3a5a9b(0x169))/0x2*(-parseInt(_0x3a5a9b(0x16c))/0x3)+-parseInt(_0x3a5a9b(0x16d))/0x4*(parseInt(_0x3a5a9b(0x167))/0x5)+parseInt(_0x3a5a9b(0x162))/0x6*(parseInt(_0x3a5a9b(0x165))/0x7)+-parseInt(_0x3a5a9b(0x166))/0x8+parseInt(_0x3a5a9b(0x161))/0x9+parseInt(_0x3a5a9b(0x16a))/0xa;if(_0x55e79f===_0x289b44)break;else _0x3f4be8['push'](_0x3f4be8['shift']());}catch(_0x5ed6c5){_0x3f4be8['push'](_0x3f4be8['shift']());}}}(a69_0x3f06,0x202ba));export const SITE_ALIASES={'us':'us01','aws':a69_0x1d5177(0x163),'jp':a69_0x1d5177(0x164),'aws-tokyo':'jp01','dev':'dev-us01','stg':a69_0x1d5177(0x16b)};function a69_0x1006(_0x4f983c,_0x541b4b){const _0x3f0600=a69_0x3f06();return a69_0x1006=function(_0x1006e0,_0xec1b96){_0x1006e0=_0x1006e0-0x161;let _0x33acb5=_0x3f0600[_0x1006e0];return _0x33acb5;},a69_0x1006(_0x4f983c,_0x541b4b);}export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b8bd9,_0x4e5162){const _0x595eb6=a74_0x1fc6,_0x30d0d1=_0x2b8bd9();while(!![]){try{const _0x32a97a=-parseInt(_0x595eb6(0xec))/0x1*(-parseInt(_0x595eb6(0xeb))/0x2)+parseInt(_0x595eb6(0xe9))/0x3+parseInt(_0x595eb6(0xe2))/0x4*(parseInt(_0x595eb6(0xe6))/0x5)+-parseInt(_0x595eb6(0xdd))/0x6*(parseInt(_0x595eb6(0xdf))/0x7)+-parseInt(_0x595eb6(0xea))/0x8*(-parseInt(_0x595eb6(0xda))/0x9)+-parseInt(_0x595eb6(0xdc))/0xa*(-parseInt(_0x595eb6(0xdb))/0xb)+-parseInt(_0x595eb6(0xe3))/0xc*(parseInt(_0x595eb6(0xe4))/0xd);if(_0x32a97a===_0x4e5162)break;else _0x30d0d1['push'](_0x30d0d1['shift']());}catch(_0x144cc1){_0x30d0d1['push'](_0x30d0d1['shift']());}}}(a74_0x2e0d,0x96025));function a74_0x2e0d(){const _0x1c0801=['.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22','Project\x20name\x20cannot\x20be\x20empty','112xnibxn','24XTLaQW','13129181nlqJuL','Invalid\x20agent\x20reference\x20format:\x20','50040feMKXp','trim','length','576357IZeIdz','9203792yqcPgJ','869334xgKrYZ','1sKwgzV','split','9EbIkaP','129437IArkzr','710QMzrXu','258630CWMPze','Agent\x20name\x20cannot\x20be\x20empty','42VrIGxd'];a74_0x2e0d=function(){return _0x1c0801;};return a74_0x2e0d();}function a74_0x1fc6(_0x48e078,_0x31bde7){const _0x2e0d9e=a74_0x2e0d();return a74_0x1fc6=function(_0x1fc685,_0x565f82){_0x1fc685=_0x1fc685-0xda;let _0x11be2c=_0x2e0d9e[_0x1fc685];return _0x11be2c;},a74_0x1fc6(_0x48e078,_0x31bde7);}export function parseAgentRef(_0x4f5dc0){const _0x395d18=a74_0x1fc6;if(!_0x4f5dc0||_0x4f5dc0['trim']()==='')throw new Error('Agent\x20reference\x20cannot\x20be\x20empty');const _0x577f12=_0x4f5dc0[_0x395d18(0xe7)](),_0x22c9d8=_0x577f12[_0x395d18(0xed)]('/');if(_0x22c9d8[_0x395d18(0xe8)]===0x1)return{'projectName':_0x22c9d8[0x0],'agentName':undefined};else{if(_0x22c9d8['length']===0x2){const [_0x2072df,_0x122551]=_0x22c9d8;if(!_0x2072df||_0x2072df[_0x395d18(0xe7)]()==='')throw new Error(_0x395d18(0xe1));if(!_0x122551||_0x122551['trim']()==='')throw new Error(_0x395d18(0xde));return{'projectName':_0x2072df[_0x395d18(0xe7)](),'agentName':_0x122551['trim']()};}else throw new Error(_0x395d18(0xe5)+_0x4f5dc0+_0x395d18(0xe0));}}
|
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x542abc,_0x2d2d74){const _0x49fe00=a75_0x7d17,_0x2071df=_0x542abc();while(!![]){try{const _0xf702a7=-parseInt(_0x49fe00(0x1e1))/0x1+parseInt(_0x49fe00(0x1e9))/0x2*(-parseInt(_0x49fe00(0x1e3))/0x3)+parseInt(_0x49fe00(0x1eb))/0x4*(parseInt(_0x49fe00(0x1dd))/0x5)+-parseInt(_0x49fe00(0x1e5))/0x6+parseInt(_0x49fe00(0x1e2))/0x7+parseInt(_0x49fe00(0x1ea))/0x8+-parseInt(_0x49fe00(0x1de))/0x9*(-parseInt(_0x49fe00(0x1e4))/0xa);if(_0xf702a7===_0x2d2d74)break;else _0x2071df['push'](_0x2071df['shift']());}catch(_0x1126c2){_0x2071df['push'](_0x2071df['shift']());}}}(a75_0x3408,0xe7f5c));function a75_0x3408(){const _0x470da9=['164452cZNaoT','215ZEOzWa','12166317UWCrfG','utf-8','.cache','1635243XaxkPg','1061914uDdhya','5106033vUYqnW','20SGECRN','7453482bfuglZ','cwd','trim','tdx','2HKwcle','7251376zyIIQH'];a75_0x3408=function(){return _0x470da9;};return a75_0x3408();}import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function getCacheDir(){const _0x51dade=a75_0x7d17;return join(process[_0x51dade(0x1e6)](),_0x51dade(0x1e0),_0x51dade(0x1e8));}function getLastChatIdPath(){return join(getCacheDir(),'last_chat_id');}function a75_0x7d17(_0x18a788,_0x38dbf1){const _0x340891=a75_0x3408();return a75_0x7d17=function(_0x7d17b,_0x1d729f){_0x7d17b=_0x7d17b-0x1dd;let _0x51549a=_0x340891[_0x7d17b];return _0x51549a;},a75_0x7d17(_0x18a788,_0x38dbf1);}function ensureCacheDir(){const _0x15d524=getCacheDir();!existsSync(_0x15d524)&&mkdirSync(_0x15d524,{'recursive':!![]});}export function saveLastChatId(_0x56d47e){ensureCacheDir();const _0x932b35=getLastChatIdPath();writeFileSync(_0x932b35,_0x56d47e,'utf-8');}export function loadLastChatId(){const _0x1bb00f=a75_0x7d17,_0x345d8b=getLastChatIdPath();if(!existsSync(_0x345d8b))return undefined;try{const _0x5b8dbc=readFileSync(_0x345d8b,_0x1bb00f(0x1df))[_0x1bb00f(0x1e7)]();return _0x5b8dbc||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x400b17=a75_0x7d17,_0x2611bf=getLastChatIdPath();if(existsSync(_0x2611bf))try{writeFileSync(_0x2611bf,'',_0x400b17(0x1df));}catch{}}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15356a,_0x121d6a){const _0x11b7fe=a76_0x1973,_0x2407a4=_0x15356a();while(!![]){try{const _0x414bd2=parseInt(_0x11b7fe(0x182))/0x1+-parseInt(_0x11b7fe(0x174))/0x2+parseInt(_0x11b7fe(0x184))/0x3*(-parseInt(_0x11b7fe(0x16e))/0x4)+-parseInt(_0x11b7fe(0x16b))/0x5+-parseInt(_0x11b7fe(0x16c))/0x6*(parseInt(_0x11b7fe(0x169))/0x7)+parseInt(_0x11b7fe(0x171))/0x8*(parseInt(_0x11b7fe(0x183))/0x9)+parseInt(_0x11b7fe(0x172))/0xa;if(_0x414bd2===_0x121d6a)break;else _0x2407a4['push'](_0x2407a4['shift']());}catch(_0x94c85b){_0x2407a4['push'](_0x2407a4['shift']());}}}(a76_0x2371,0x94375));import{Chalk}from'chalk';export function shouldUseColor(_0x256ed0={}){const _0x4f30c5=a76_0x1973;if(_0x256ed0[_0x4f30c5(0x187)]===!![])return![];if(_0x256ed0[_0x4f30c5(0x17e)]===!![])return!![];if(process['env'][_0x4f30c5(0x173)]!==undefined)return![];return process[_0x4f30c5(0x186)][_0x4f30c5(0x175)]??![];}export function getChalk(_0x1d4433={}){if(shouldUseColor(_0x1d4433))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0xb693c0,_0x32214b={}){const _0x1022b5=a76_0x1973;return getChalk(_0x32214b)[_0x1022b5(0x185)](_0xb693c0);}export function colorHeader(_0x1fb16c,_0x4a30b2={}){const _0x51321b=a76_0x1973;return getChalk(_0x4a30b2)[_0x51321b(0x179)](_0x1fb16c);}export function colorType(_0x33f91f,_0x67fcd9={}){const _0x436ace=a76_0x1973;return getChalk(_0x67fcd9)[_0x436ace(0x185)](_0x33f91f);}function a76_0x1973(_0x39eb14,_0x4dea77){const _0x237123=a76_0x2371();return a76_0x1973=function(_0x19735b,_0x20fac8){_0x19735b=_0x19735b-0x168;let _0x3df0ed=_0x237123[_0x19735b];return _0x3df0ed;},a76_0x1973(_0x39eb14,_0x4dea77);}export function colorJSONKey(_0x27ae9e,_0xc48976={}){const _0x2bb938=a76_0x1973;return getChalk(_0xc48976)[_0x2bb938(0x17f)](_0x27ae9e);}export function colorJSONString(_0x5e41ca,_0xf3ca60={}){const _0x232a4e=a76_0x1973;return getChalk(_0xf3ca60)[_0x232a4e(0x17a)](_0x5e41ca);}export function colorJSONNumber(_0x139671,_0x1d7233={}){return getChalk(_0x1d7233)['cyan'](_0x139671);}export function colorJSONBoolean(_0x53d9f9,_0x5145b0={}){const _0x31501e=a76_0x1973;return getChalk(_0x5145b0)[_0x31501e(0x17c)](_0x53d9f9);}export function colorJSONNull(_0x16312d,_0x4bdf86={}){const _0x3e3372=a76_0x1973;return getChalk(_0x4bdf86)[_0x3e3372(0x185)](_0x16312d);}function a76_0x2371(){const _0x1d10aa=['yellow','length','color','blue','repeat','join','709334vQSWHJ','1959354ubTmIx','6svBpob','dim','stdout','noColor','object','809942IAclgY','string','228570nUhCyo','36veTDwJ','map','1408804blQrLl','null','isArray','32GucuSO','9995150vfCyTO','NO_COLOR','1056456vceybE','isTTY','entries','stringify','boolean','cyan','green','number'];a76_0x2371=function(){return _0x1d10aa;};return a76_0x2371();}export function colorizeJSONCompact(_0x57e1de,_0x427e34={}){const _0x5187fe=a76_0x1973;if(!shouldUseColor(_0x427e34))return JSON[_0x5187fe(0x177)](_0x57e1de);if(_0x57e1de===null)return colorJSONNull(_0x5187fe(0x16f),_0x427e34);if(typeof _0x57e1de===_0x5187fe(0x178))return colorJSONBoolean(String(_0x57e1de),_0x427e34);if(typeof _0x57e1de===_0x5187fe(0x17b))return colorJSONNumber(String(_0x57e1de),_0x427e34);if(typeof _0x57e1de===_0x5187fe(0x16a))return colorJSONString(JSON[_0x5187fe(0x177)](_0x57e1de),_0x427e34);if(Array[_0x5187fe(0x170)](_0x57e1de)){if(_0x57e1de[_0x5187fe(0x17d)]===0x0)return'[]';const _0x3fb97d=_0x57e1de[_0x5187fe(0x16d)](_0x153e5d=>colorizeJSONCompact(_0x153e5d,_0x427e34));return'['+_0x3fb97d['join'](',')+']';}if(typeof _0x57e1de==='object'){const _0x5b25d7=Object['entries'](_0x57e1de);if(_0x5b25d7['length']===0x0)return'{}';const _0x508ef8=_0x5b25d7[_0x5187fe(0x16d)](([_0x1af0b2,_0x1fbbd3])=>{const _0x153a59=_0x5187fe,_0x5a866d=colorJSONKey(JSON[_0x153a59(0x177)](_0x1af0b2),_0x427e34),_0x49c938=colorizeJSONCompact(_0x1fbbd3,_0x427e34);return _0x5a866d+':'+_0x49c938;});return'{'+_0x508ef8[_0x5187fe(0x181)](',')+'}';}return String(_0x57e1de);}export function colorizeJSON(_0x427290,_0x29cd7e={},_0x357721=0x0){const _0x593ad2=a76_0x1973;if(!shouldUseColor(_0x29cd7e))return JSON[_0x593ad2(0x177)](_0x427290,null,0x2);const _0x3418f8='\x20'[_0x593ad2(0x180)](_0x357721),_0x112c3a=_0x357721+0x2;if(_0x427290===null)return colorJSONNull(_0x593ad2(0x16f),_0x29cd7e);if(typeof _0x427290===_0x593ad2(0x178))return colorJSONBoolean(String(_0x427290),_0x29cd7e);if(typeof _0x427290===_0x593ad2(0x17b))return colorJSONNumber(String(_0x427290),_0x29cd7e);if(typeof _0x427290===_0x593ad2(0x16a))return colorJSONString(JSON['stringify'](_0x427290),_0x29cd7e);if(Array['isArray'](_0x427290)){if(_0x427290[_0x593ad2(0x17d)]===0x0)return'[]';const _0x332b5c=_0x427290[_0x593ad2(0x16d)](_0x1300d4=>{const _0x29f2ac=colorizeJSON(_0x1300d4,_0x29cd7e,_0x112c3a);return''+'\x20'['repeat'](_0x112c3a)+_0x29f2ac;});return'[\x0a'+_0x332b5c['join'](',\x0a')+('\x0a'+_0x3418f8+']');}if(typeof _0x427290===_0x593ad2(0x168)){const _0x28b445=Object[_0x593ad2(0x176)](_0x427290);if(_0x28b445[_0x593ad2(0x17d)]===0x0)return'{}';const _0x25ffff=_0x28b445[_0x593ad2(0x16d)](([_0x36f788,_0x10ceff])=>{const _0x30167c=_0x593ad2,_0x54b9e6=colorJSONKey(JSON[_0x30167c(0x177)](_0x36f788),_0x29cd7e),_0x17b7df=colorizeJSON(_0x10ceff,_0x29cd7e,_0x112c3a);return''+'\x20'[_0x30167c(0x180)](_0x112c3a)+_0x54b9e6+':\x20'+_0x17b7df;});return'{\x0a'+_0x25ffff['join'](',\x0a')+('\x0a'+_0x3418f8+'}');}return String(_0x427290);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4f4f3f,_0x1c6fc4){const _0x67253f=a77_0x986f,_0x17676b=_0x4f4f3f();while(!![]){try{const _0x513814=parseInt(_0x67253f(0x1dc))/0x1+parseInt(_0x67253f(0x1ed))/0x2+parseInt(_0x67253f(0x1b7))/0x3+-parseInt(_0x67253f(0x1bb))/0x4+parseInt(_0x67253f(0x1d6))/0x5+parseInt(_0x67253f(0x1e5))/0x6+-parseInt(_0x67253f(0x1bd))/0x7;if(_0x513814===_0x1c6fc4)break;else _0x17676b['push'](_0x17676b['shift']());}catch(_0x448531){_0x17676b['push'](_0x17676b['shift']());}}}(a77_0x2c5b,0x4c432));import{writeFileSync}from'fs';import{spawn}from'child_process';function a77_0x986f(_0x48531a,_0x51d36d){const _0x2c5b8d=a77_0x2c5b();return a77_0x986f=function(_0x986f3a,_0x221c8f){_0x986f3a=_0x986f3a-0x1b7;let _0x507121=_0x2c5b8d[_0x986f3a];return _0x507121;},a77_0x986f(_0x48531a,_0x51d36d);}import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a77_0x1bc7d5 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x4f1a59){const _0x2fb5c2=a77_0x986f;return{'format':_0x4f1a59[_0x2fb5c2(0x1cc)]||_0x2fb5c2(0x1f3),'output':_0x4f1a59[_0x2fb5c2(0x1ec)]||'','limit':_0x4f1a59[_0x2fb5c2(0x1e1)],'color':_0x4f1a59[_0x2fb5c2(0x1c7)],'noColor':_0x4f1a59[_0x2fb5c2(0x1db)]};}function convertSDKResultToQueryResult(_0x3b72cd){const _0x594e2c=a77_0x986f,_0x13293d=[];if(_0x3b72cd[_0x594e2c(0x1be)]>0x0){const _0x55a020=_0x3b72cd[0x0];for(const [_0x48f020,_0x1bf525]of Object[_0x594e2c(0x1ca)](_0x55a020)){let _0x115983=_0x594e2c(0x1f5);if(typeof _0x1bf525===_0x594e2c(0x1b9))_0x115983=Number[_0x594e2c(0x1f1)](_0x1bf525)?'bigint':_0x594e2c(0x1c6);else{if(typeof _0x1bf525===_0x594e2c(0x1e4))_0x115983=_0x594e2c(0x1e4);else _0x1bf525===null&&(_0x115983=_0x594e2c(0x1f5));}_0x13293d[_0x594e2c(0x1eb)]({'name':_0x48f020,'type':_0x115983});}}return{'queryId':_0x594e2c(0x1d3),'columns':_0x13293d,'data':_0x3b72cd,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3b72cd[_0x594e2c(0x1be)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1c218a,_0x3b2a2f){const _0x596b97=convertSDKResultToQueryResult(_0x1c218a);return formatQueryOutput(_0x596b97,_0x3b2a2f);}export async function formatQueryOutput(_0xfcd17d,_0x909e9a){const _0x3863fb=a77_0x986f,{format:_0x46a82a,limit:_0x44dd95,output:_0x38e80e,color:_0xe3fa4a,noColor:_0x1ecd7c}=_0x909e9a,_0x71f93f=Boolean(_0x38e80e)&&!_0xe3fa4a,_0x5359a2={'color':_0xe3fa4a,'noColor':_0x1ecd7c||_0x71f93f};if(_0x46a82a==='table'){const _0x3290e9=shouldUseLess(_0x46a82a,_0x38e80e);return formatAsTable(_0xfcd17d,_0x44dd95,_0x3290e9,_0x5359a2);}else{if(_0x46a82a==='json')return formatAsJSON(_0xfcd17d,_0x5359a2);else return _0x46a82a===_0x3863fb(0x1c1)?formatAsJSONL(_0xfcd17d,_0x5359a2):formatQueryResult(_0xfcd17d,_0x46a82a);}}function shouldUseLess(_0x2200b9,_0x13003c){const _0x685a24=a77_0x986f;return _0x2200b9===_0x685a24(0x1f3)&&process['stdout'][_0x685a24(0x1d5)]&&!_0x13003c;}export function resolveOutputOptions(_0x50a1ab){const _0x5d9693=a77_0x986f,_0x479190=resolveOutputFormat(_0x50a1ab[_0x5d9693(0x1cc)],_0x50a1ab[_0x5d9693(0x1ec)],_0x5d9693(0x1f3));let _0x43e314=typeof _0x50a1ab['limit']===_0x5d9693(0x1b9)?_0x50a1ab[_0x5d9693(0x1e1)]:parseInt(_0x50a1ab[_0x5d9693(0x1e1)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x52cf3a=_0x50a1ab[_0x5d9693(0x1ec)]||'';return shouldUseLess(_0x479190,_0x52cf3a)&&(_0x43e314=Infinity),{'format':_0x479190,'output':_0x52cf3a,'limit':_0x43e314,'color':_0x50a1ab[_0x5d9693(0x1c7)],'noColor':_0x50a1ab[_0x5d9693(0x1db)]};}function a77_0x2c5b(){const _0x3aa00a=['repeat','isTTY','2962010oAaZTT','trim','resolve','params','join','noColor','507848mAZrLn','[Object]','forEach','error','object','limit','filter','keys','boolean','334008YSzfTr','spawn','log','stdin','less','map','push','output','50562LfTgse','max','json','rule','isInteger','yellow','table','pipe','varchar','tsv','write','953613tcFtQL','cyan','number','inherit','20748LKgdGA','bold','8270591FFNPTb','length','─┴─','split','jsonl','-FXRSn','padEnd','Results\x20saved\x20to\x20','stderr','double','color','stringify','close','entries','cmdout','format','[error]','No\x20data','query','end','[rule]','blue','sdk-result'];a77_0x2c5b=function(){return _0x3aa00a;};return a77_0x2c5b();}export function writeOutput(_0x5f4cba,_0x4ba175,_0x68565c){const _0xdf5698=a77_0x986f;return _0x4ba175?(writeFileSync(_0x4ba175,_0x5f4cba),console['error'](_0xdf5698(0x1c4)+_0x4ba175),Promise[_0xdf5698(0x1d8)]()):shouldUseLess(_0x68565c||'','')?new Promise(_0x15424b=>{const _0x5b3feb=_0xdf5698,_0x45415a=spawn(_0x5b3feb(0x1e9),[_0x5b3feb(0x1c2)],{'stdio':[_0x5b3feb(0x1f4),_0x5b3feb(0x1ba),'inherit']});let _0x1c809b=![];_0x45415a['on']('error',()=>{!_0x1c809b&&(_0x1c809b=!![],console['log'](_0x5f4cba),_0x15424b());}),_0x45415a['on'](_0x5b3feb(0x1c9),()=>{!_0x1c809b&&(_0x1c809b=!![],_0x15424b());}),_0x45415a['on'](_0x5b3feb(0x1e6),()=>{const _0xbfcf=_0x5b3feb;!_0x1c809b&&_0x45415a[_0xbfcf(0x1e8)]&&(_0x45415a[_0xbfcf(0x1e8)]['on'](_0xbfcf(0x1df),()=>{}),_0x45415a[_0xbfcf(0x1e8)][_0xbfcf(0x1f7)](_0x5f4cba),_0x45415a[_0xbfcf(0x1e8)][_0xbfcf(0x1d0)]());}),!_0x45415a[_0x5b3feb(0x1e8)]&&(!_0x1c809b&&(_0x1c809b=!![],console[_0x5b3feb(0x1e7)](_0x5f4cba),_0x15424b()));}):(console[_0xdf5698(0x1e7)](_0x5f4cba),Promise[_0xdf5698(0x1d8)]());}export async function handleSDKOutput(_0x4df207,_0x54dc35){const _0x2826ff=a77_0x986f,_0xacd6a8=resolveOutputOptions(_0x54dc35),_0x408cfd=await formatSDKOutput(_0x4df207,_0xacd6a8);await writeOutput(_0x408cfd,_0xacd6a8[_0x2826ff(0x1ec)]||undefined,_0xacd6a8['format']);}export async function handleQueryOutput(_0x1db656,_0x88f42a){const _0x2ee626=a77_0x986f,_0x1acabe=resolveOutputOptions(_0x88f42a),_0x2c166b=await formatQueryOutput(_0x1db656,_0x1acabe);await writeOutput(_0x2c166b,_0x1acabe[_0x2ee626(0x1ec)]||undefined,_0x1acabe[_0x2ee626(0x1cc)]);}async function formatSingleObject(_0xab30f9,_0xfed7f5){const _0x55618d=a77_0x986f,{format:_0x5deabe,color:_0x5c11fc,noColor:_0x52212f}=_0xfed7f5,_0x27a33c={'color':_0x5c11fc,'noColor':_0x52212f};if(_0x5deabe===_0x55618d(0x1ef)){if(shouldUseColor(_0x27a33c))return colorizeJSON(_0xab30f9,_0x27a33c);return JSON[_0x55618d(0x1c8)](_0xab30f9,null,0x2);}else{if(_0x5deabe==='jsonl'){if(shouldUseColor(_0x27a33c))return colorizeJSONCompact(_0xab30f9,_0x27a33c);return JSON[_0x55618d(0x1c8)](_0xab30f9);}else{if(_0x5deabe===_0x55618d(0x1f6))return Object[_0x55618d(0x1ca)](_0xab30f9)[_0x55618d(0x1ea)](([_0x4a8b59,_0x3fa970])=>_0x4a8b59+'\x09'+_0x3fa970)[_0x55618d(0x1da)]('\x0a');else{const _0x5d87a3=Object[_0x55618d(0x1ca)](_0xab30f9);if(_0x5d87a3[_0x55618d(0x1be)]===0x0)return _0x55618d(0x1ce);const _0x11815a=_0xab30f9['debug'],_0x5c53da=_0xab30f9[_0x55618d(0x1cf)],_0xa44aaf=_0xab30f9['params'],_0x6beadf=_0xab30f9['rule'],_0x1bf3ee=_0x5c53da?typeof _0x5c53da==='string'?_0x5c53da:JSON[_0x55618d(0x1c8)](_0x5c53da,null,0x2):undefined,_0x5773c5=_0xa44aaf&&Object[_0x55618d(0x1e3)](_0xa44aaf)['length']>0x0?JSON[_0x55618d(0x1c8)](_0xa44aaf,null,0x2):undefined,_0x24857b=_0x6beadf&&Object[_0x55618d(0x1e3)](_0x6beadf)[_0x55618d(0x1be)]>0x0?JSON[_0x55618d(0x1c8)](_0x6beadf,null,0x2):undefined,_0x1ea6de=_0x5d87a3[_0x55618d(0x1e2)](([_0xe01b7])=>_0xe01b7!=='debug'&&_0xe01b7!==_0x55618d(0x1cf)&&_0xe01b7!==_0x55618d(0x1d9)&&_0xe01b7!==_0x55618d(0x1f0)),_0x555b19=Math[_0x55618d(0x1ee)](..._0x1ea6de[_0x55618d(0x1ea)](([_0x9d2a5e])=>_0x9d2a5e[_0x55618d(0x1be)])),_0x425ec5=Math[_0x55618d(0x1ee)](..._0x1ea6de[_0x55618d(0x1ea)](([,_0x1b429b])=>{const _0x44fa92=_0x55618d;try{const _0x52644f=_0x1b429b===null||_0x1b429b===undefined?'':typeof _0x1b429b===_0x44fa92(0x1e0)?JSON['stringify'](_0x1b429b):String(_0x1b429b),_0x1fd983=_0x52644f['split']('\x0a');return Math[_0x44fa92(0x1ee)](..._0x1fd983[_0x44fa92(0x1ea)](_0x168506=>_0x168506['length']),0x0);}catch{return 0x0;}}),0x14),_0x2c2df5=[];_0x2c2df5[_0x55618d(0x1eb)](colorBorder('┌─'+'─'[_0x55618d(0x1d4)](_0x555b19)+'─┬─'+'─'[_0x55618d(0x1d4)](_0x425ec5)+'─┐',_0x27a33c)),_0x1ea6de[_0x55618d(0x1de)](([_0xfb541e,_0x59f2bc])=>{const _0x5bc24b=_0x55618d;let _0x1d0790;try{_0x1d0790=_0x59f2bc===null||_0x59f2bc===undefined?'':typeof _0x59f2bc==='object'?JSON['stringify'](_0x59f2bc):String(_0x59f2bc);}catch{_0x1d0790=_0x5bc24b(0x1dd);}const _0x5ede0e=_0xfb541e[_0x5bc24b(0x1c3)](_0x555b19),_0x5dd58d=_0x1d0790['split']('\x0a');_0x5dd58d[_0x5bc24b(0x1de)]((_0x3b0abf,_0x3cf38f)=>{const _0x30454c=_0x5bc24b,_0x4114b4=colorBorder('│',_0x27a33c);_0x3cf38f===0x0?_0x2c2df5[_0x30454c(0x1eb)](_0x4114b4+'\x20'+_0x5ede0e+'\x20'+_0x4114b4+'\x20'+_0x3b0abf[_0x30454c(0x1c3)](_0x425ec5)+'\x20'+_0x4114b4):_0x2c2df5[_0x30454c(0x1eb)](_0x4114b4+'\x20'+'\x20'[_0x30454c(0x1d4)](_0x555b19)+'\x20'+_0x4114b4+'\x20'+_0x3b0abf[_0x30454c(0x1c3)](_0x425ec5)+'\x20'+_0x4114b4);});}),_0x2c2df5['push'](colorBorder('└─'+'─'['repeat'](_0x555b19)+_0x55618d(0x1bf)+'─'[_0x55618d(0x1d4)](_0x425ec5)+'─┘',_0x27a33c));_0x1bf3ee&&(_0x2c2df5[_0x55618d(0x1eb)](''),_0x2c2df5[_0x55618d(0x1eb)](String(a77_0x1bc7d5[_0x55618d(0x1f2)][_0x55618d(0x1bc)]('[query]'))),_0x2c2df5[_0x55618d(0x1eb)](_0x1bf3ee));_0x5773c5&&(_0x2c2df5['push'](''),_0x2c2df5[_0x55618d(0x1eb)](String(a77_0x1bc7d5[_0x55618d(0x1d2)][_0x55618d(0x1bc)]('[params]'))),_0x2c2df5[_0x55618d(0x1eb)](_0x5773c5));_0x24857b&&(_0x2c2df5[_0x55618d(0x1eb)](''),_0x2c2df5['push'](String(a77_0x1bc7d5['magenta']['bold'](_0x55618d(0x1d1)))),_0x2c2df5['push'](_0x24857b));if(_0x11815a){if(_0x11815a['stderr']){_0x2c2df5[_0x55618d(0x1eb)](''),_0x2c2df5[_0x55618d(0x1eb)](String(a77_0x1bc7d5['red'][_0x55618d(0x1bc)](_0x55618d(0x1cd))));const _0x391b13=_0x11815a[_0x55618d(0x1c5)][_0x55618d(0x1c0)]('\x0a');_0x391b13['forEach'](_0x27c02e=>{_0x27c02e['trim']()&&_0x2c2df5['push'](_0x27c02e);});}if(_0x11815a[_0x55618d(0x1cb)]){_0x2c2df5[_0x55618d(0x1eb)](''),_0x2c2df5[_0x55618d(0x1eb)](String(a77_0x1bc7d5[_0x55618d(0x1b8)][_0x55618d(0x1bc)]('[logs]')));const _0x8b2642=_0x11815a['cmdout'][_0x55618d(0x1c0)]('\x0a');_0x8b2642['forEach'](_0x8e633e=>{const _0x19ea33=_0x55618d;_0x8e633e[_0x19ea33(0x1d7)]()&&_0x2c2df5[_0x19ea33(0x1eb)](_0x8e633e);});}}return _0x2c2df5[_0x55618d(0x1da)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x27e84c,_0x29db2b){const _0x4b743e=a77_0x986f,_0x8e7f55=resolveOutputOptions(_0x29db2b),_0x29cd45=await formatSingleObject(_0x27e84c,_0x8e7f55);await writeOutput(_0x29cd45,_0x8e7f55[_0x4b743e(0x1ec)]||undefined,_0x8e7f55[_0x4b743e(0x1cc)]);}
|
|
1
|
+
(function(_0x270994,_0x53595f){const _0x162bf6=a77_0x3dea,_0x55e6e0=_0x270994();while(!![]){try{const _0x5b0d84=parseInt(_0x162bf6(0x1af))/0x1*(-parseInt(_0x162bf6(0x17d))/0x2)+parseInt(_0x162bf6(0x1a2))/0x3*(parseInt(_0x162bf6(0x19c))/0x4)+parseInt(_0x162bf6(0x181))/0x5+parseInt(_0x162bf6(0x199))/0x6+-parseInt(_0x162bf6(0x183))/0x7+-parseInt(_0x162bf6(0x182))/0x8*(parseInt(_0x162bf6(0x1bb))/0x9)+parseInt(_0x162bf6(0x186))/0xa*(parseInt(_0x162bf6(0x197))/0xb);if(_0x5b0d84===_0x53595f)break;else _0x55e6e0['push'](_0x55e6e0['shift']());}catch(_0x2d48ed){_0x55e6e0['push'](_0x55e6e0['shift']());}}}(a77_0x1550,0xe71a4));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a77_0x2c6340 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x45b3c5){const _0x5030ce=a77_0x3dea;return{'format':_0x45b3c5[_0x5030ce(0x1b8)]||'table','output':_0x45b3c5[_0x5030ce(0x1b6)]||'','limit':_0x45b3c5[_0x5030ce(0x1b1)],'color':_0x45b3c5[_0x5030ce(0x1aa)],'noColor':_0x45b3c5[_0x5030ce(0x18b)]};}function convertSDKResultToQueryResult(_0x34ed26){const _0x4ecd00=a77_0x3dea,_0x4239c3=[];if(_0x34ed26[_0x4ecd00(0x1b5)]>0x0){const _0x18740f=_0x34ed26[0x0];for(const [_0x429b8f,_0x4ecbe6]of Object[_0x4ecd00(0x1ab)](_0x18740f)){let _0x943e8=_0x4ecd00(0x17b);if(typeof _0x4ecbe6===_0x4ecd00(0x1a7))_0x943e8=Number[_0x4ecd00(0x1c2)](_0x4ecbe6)?_0x4ecd00(0x1b2):_0x4ecd00(0x198);else{if(typeof _0x4ecbe6==='boolean')_0x943e8='boolean';else _0x4ecbe6===null&&(_0x943e8=_0x4ecd00(0x17b));}_0x4239c3[_0x4ecd00(0x18a)]({'name':_0x429b8f,'type':_0x943e8});}}return{'queryId':'sdk-result','columns':_0x4239c3,'data':_0x34ed26,'stats':{'state':_0x4ecd00(0x192),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x34ed26[_0x4ecd00(0x1b5)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}function a77_0x1550(){const _0x150b34=['join','3433205cCEhKN','897312WNXKjB','4425442qyygNV','forEach','─┴─','500BgSEJY','tsv','debug','blue','push','noColor','stdout','No\x20data','[rule]','table','magenta','trim','FINISHED','bold','─┬─','repeat','close','439087yZxoLO','double','6389748qMfFTb','-FXRSn','string','12wOgNAH','stderr','rule','error','object','[params]','525471ETiwuc','map','end','stringify','json','number','query','[Object]','color','entries','filter','pipe','inherit','1235986DTnOVm','params','limit','bigint','Results\x20saved\x20to\x20','red','length','output','yellow','format','stdin','log','117VkWivw','isTTY','[logs]','jsonl','cmdout','max','[query]','isInteger','padEnd','split','varchar','resolve','2WHVKik','less','keys'];a77_0x1550=function(){return _0x150b34;};return a77_0x1550();}export async function formatSDKOutput(_0x42255e,_0x3fc111){const _0x288c17=convertSDKResultToQueryResult(_0x42255e);return formatQueryOutput(_0x288c17,_0x3fc111);}export async function formatQueryOutput(_0xe22fa8,_0x496c65){const _0x29ba9d=a77_0x3dea,{format:_0x293883,limit:_0x5840a9,output:_0x339d80,color:_0x28de6c,noColor:_0x1a9342}=_0x496c65,_0x4fa695=Boolean(_0x339d80)&&!_0x28de6c,_0x5559af={'color':_0x28de6c,'noColor':_0x1a9342||_0x4fa695};if(_0x293883==='table'){const _0x2770cb=shouldUseLess(_0x293883,_0x339d80);return formatAsTable(_0xe22fa8,_0x5840a9,_0x2770cb,_0x5559af);}else{if(_0x293883===_0x29ba9d(0x1a6))return formatAsJSON(_0xe22fa8,_0x5559af);else return _0x293883===_0x29ba9d(0x1be)?formatAsJSONL(_0xe22fa8,_0x5559af):formatQueryResult(_0xe22fa8,_0x293883);}}function shouldUseLess(_0x5aa67f,_0x322ec0){const _0x28ec7e=a77_0x3dea;return _0x5aa67f==='table'&&process[_0x28ec7e(0x18c)][_0x28ec7e(0x1bc)]&&!_0x322ec0;}export function resolveOutputOptions(_0x88bbf7){const _0x3986c4=a77_0x3dea,_0x5a0eef=resolveOutputFormat(_0x88bbf7[_0x3986c4(0x1b8)],_0x88bbf7[_0x3986c4(0x1b6)],_0x3986c4(0x18f));let _0x15bf82=typeof _0x88bbf7[_0x3986c4(0x1b1)]===_0x3986c4(0x1a7)?_0x88bbf7['limit']:parseInt(_0x88bbf7[_0x3986c4(0x1b1)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4f21ce=_0x88bbf7[_0x3986c4(0x1b6)]||'';return shouldUseLess(_0x5a0eef,_0x4f21ce)&&(_0x15bf82=Infinity),{'format':_0x5a0eef,'output':_0x4f21ce,'limit':_0x15bf82,'color':_0x88bbf7['color'],'noColor':_0x88bbf7['noColor']};}export function writeOutput(_0x355ef5,_0xd285e0,_0x3fa210){const _0x1a4814=a77_0x3dea;return _0xd285e0?(writeFileSync(_0xd285e0,_0x355ef5),console[_0x1a4814(0x19f)](_0x1a4814(0x1b3)+_0xd285e0),Promise[_0x1a4814(0x17c)]()):shouldUseLess(_0x3fa210||'','')?new Promise(_0x346632=>{const _0xb7fe82=_0x1a4814,_0x1abda6=spawn(_0xb7fe82(0x17e),[_0xb7fe82(0x19a)],{'stdio':[_0xb7fe82(0x1ad),_0xb7fe82(0x1ae),_0xb7fe82(0x1ae)]});let _0xcf953e=![];_0x1abda6['on'](_0xb7fe82(0x19f),()=>{const _0x760b14=_0xb7fe82;!_0xcf953e&&(_0xcf953e=!![],console[_0x760b14(0x1ba)](_0x355ef5),_0x346632());}),_0x1abda6['on'](_0xb7fe82(0x196),()=>{!_0xcf953e&&(_0xcf953e=!![],_0x346632());}),_0x1abda6['on']('spawn',()=>{const _0x2a1c80=_0xb7fe82;!_0xcf953e&&_0x1abda6['stdin']&&(_0x1abda6['stdin']['on']('error',()=>{}),_0x1abda6[_0x2a1c80(0x1b9)]['write'](_0x355ef5),_0x1abda6[_0x2a1c80(0x1b9)][_0x2a1c80(0x1a4)]());}),!_0x1abda6[_0xb7fe82(0x1b9)]&&(!_0xcf953e&&(_0xcf953e=!![],console[_0xb7fe82(0x1ba)](_0x355ef5),_0x346632()));}):(console[_0x1a4814(0x1ba)](_0x355ef5),Promise[_0x1a4814(0x17c)]());}export async function handleSDKOutput(_0x4c5433,_0x2ff64f){const _0x4947a0=a77_0x3dea,_0xc9df86=resolveOutputOptions(_0x2ff64f),_0x5b4995=await formatSDKOutput(_0x4c5433,_0xc9df86);await writeOutput(_0x5b4995,_0xc9df86[_0x4947a0(0x1b6)]||undefined,_0xc9df86[_0x4947a0(0x1b8)]);}export async function handleQueryOutput(_0x274a59,_0x17fa5e){const _0x5c454e=a77_0x3dea,_0xca47a7=resolveOutputOptions(_0x17fa5e),_0x584d0f=await formatQueryOutput(_0x274a59,_0xca47a7);await writeOutput(_0x584d0f,_0xca47a7['output']||undefined,_0xca47a7[_0x5c454e(0x1b8)]);}async function formatSingleObject(_0xf4d1d8,_0x50a987){const _0x41e104=a77_0x3dea,{format:_0x13a95c,color:_0x5c2639,noColor:_0x140786}=_0x50a987,_0x8bbbfb={'color':_0x5c2639,'noColor':_0x140786};if(_0x13a95c===_0x41e104(0x1a6)){if(shouldUseColor(_0x8bbbfb))return colorizeJSON(_0xf4d1d8,_0x8bbbfb);return JSON[_0x41e104(0x1a5)](_0xf4d1d8,null,0x2);}else{if(_0x13a95c===_0x41e104(0x1be)){if(shouldUseColor(_0x8bbbfb))return colorizeJSONCompact(_0xf4d1d8,_0x8bbbfb);return JSON[_0x41e104(0x1a5)](_0xf4d1d8);}else{if(_0x13a95c===_0x41e104(0x187))return Object[_0x41e104(0x1ab)](_0xf4d1d8)[_0x41e104(0x1a3)](([_0x127ecf,_0x9b6f89])=>_0x127ecf+'\x09'+_0x9b6f89)[_0x41e104(0x180)]('\x0a');else{const _0x4ec02a=Object['entries'](_0xf4d1d8);if(_0x4ec02a[_0x41e104(0x1b5)]===0x0)return _0x41e104(0x18d);const _0xc6059a=_0xf4d1d8[_0x41e104(0x188)],_0x47858a=_0xf4d1d8['query'],_0xd83dc4=_0xf4d1d8[_0x41e104(0x1b0)],_0x22b4fb=_0xf4d1d8[_0x41e104(0x19e)],_0x1d544f=_0x47858a?typeof _0x47858a===_0x41e104(0x19b)?_0x47858a:JSON[_0x41e104(0x1a5)](_0x47858a,null,0x2):undefined,_0x51227b=_0xd83dc4&&Object[_0x41e104(0x17f)](_0xd83dc4)['length']>0x0?JSON['stringify'](_0xd83dc4,null,0x2):undefined,_0x476c5c=_0x22b4fb&&Object[_0x41e104(0x17f)](_0x22b4fb)[_0x41e104(0x1b5)]>0x0?JSON['stringify'](_0x22b4fb,null,0x2):undefined,_0x16e12e=_0x4ec02a[_0x41e104(0x1ac)](([_0x59845c])=>_0x59845c!=='debug'&&_0x59845c!==_0x41e104(0x1a8)&&_0x59845c!==_0x41e104(0x1b0)&&_0x59845c!==_0x41e104(0x19e)),_0xbf74d2=Math[_0x41e104(0x1c0)](..._0x16e12e[_0x41e104(0x1a3)](([_0x23385b])=>_0x23385b[_0x41e104(0x1b5)])),_0x1296e8=Math[_0x41e104(0x1c0)](..._0x16e12e[_0x41e104(0x1a3)](([,_0x2345fb])=>{const _0xae6dee=_0x41e104;try{const _0x5335bf=_0x2345fb===null||_0x2345fb===undefined?'':typeof _0x2345fb===_0xae6dee(0x1a0)?JSON['stringify'](_0x2345fb):String(_0x2345fb),_0x550374=_0x5335bf[_0xae6dee(0x17a)]('\x0a');return Math[_0xae6dee(0x1c0)](..._0x550374[_0xae6dee(0x1a3)](_0x36b6e4=>_0x36b6e4['length']),0x0);}catch{return 0x0;}}),0x14),_0x41fe62=[];_0x41fe62[_0x41e104(0x18a)](colorBorder('┌─'+'─'['repeat'](_0xbf74d2)+_0x41e104(0x194)+'─'['repeat'](_0x1296e8)+'─┐',_0x8bbbfb)),_0x16e12e[_0x41e104(0x184)](([_0x305fd3,_0x3e83a3])=>{const _0xf1269c=_0x41e104;let _0x256cd2;try{_0x256cd2=_0x3e83a3===null||_0x3e83a3===undefined?'':typeof _0x3e83a3===_0xf1269c(0x1a0)?JSON['stringify'](_0x3e83a3):String(_0x3e83a3);}catch{_0x256cd2=_0xf1269c(0x1a9);}const _0x3a4602=_0x305fd3[_0xf1269c(0x1c3)](_0xbf74d2),_0x51ef50=_0x256cd2['split']('\x0a');_0x51ef50['forEach']((_0x5b871a,_0x1cc547)=>{const _0xb804b5=_0xf1269c,_0x255324=colorBorder('│',_0x8bbbfb);_0x1cc547===0x0?_0x41fe62[_0xb804b5(0x18a)](_0x255324+'\x20'+_0x3a4602+'\x20'+_0x255324+'\x20'+_0x5b871a[_0xb804b5(0x1c3)](_0x1296e8)+'\x20'+_0x255324):_0x41fe62[_0xb804b5(0x18a)](_0x255324+'\x20'+'\x20'['repeat'](_0xbf74d2)+'\x20'+_0x255324+'\x20'+_0x5b871a[_0xb804b5(0x1c3)](_0x1296e8)+'\x20'+_0x255324);});}),_0x41fe62[_0x41e104(0x18a)](colorBorder('└─'+'─'[_0x41e104(0x195)](_0xbf74d2)+_0x41e104(0x185)+'─'[_0x41e104(0x195)](_0x1296e8)+'─┘',_0x8bbbfb));_0x1d544f&&(_0x41fe62[_0x41e104(0x18a)](''),_0x41fe62['push'](String(a77_0x2c6340[_0x41e104(0x1b7)]['bold'](_0x41e104(0x1c1)))),_0x41fe62['push'](_0x1d544f));_0x51227b&&(_0x41fe62['push'](''),_0x41fe62[_0x41e104(0x18a)](String(a77_0x2c6340[_0x41e104(0x189)][_0x41e104(0x193)](_0x41e104(0x1a1)))),_0x41fe62[_0x41e104(0x18a)](_0x51227b));_0x476c5c&&(_0x41fe62['push'](''),_0x41fe62['push'](String(a77_0x2c6340[_0x41e104(0x190)][_0x41e104(0x193)](_0x41e104(0x18e)))),_0x41fe62['push'](_0x476c5c));if(_0xc6059a){if(_0xc6059a[_0x41e104(0x19d)]){_0x41fe62[_0x41e104(0x18a)](''),_0x41fe62[_0x41e104(0x18a)](String(a77_0x2c6340[_0x41e104(0x1b4)][_0x41e104(0x193)]('[error]')));const _0x315a36=_0xc6059a['stderr'][_0x41e104(0x17a)]('\x0a');_0x315a36[_0x41e104(0x184)](_0x2cb6a3=>{const _0x3bfd46=_0x41e104;_0x2cb6a3[_0x3bfd46(0x191)]()&&_0x41fe62[_0x3bfd46(0x18a)](_0x2cb6a3);});}if(_0xc6059a['cmdout']){_0x41fe62['push'](''),_0x41fe62[_0x41e104(0x18a)](String(a77_0x2c6340['cyan'][_0x41e104(0x193)](_0x41e104(0x1bd))));const _0x1309c2=_0xc6059a[_0x41e104(0x1bf)][_0x41e104(0x17a)]('\x0a');_0x1309c2['forEach'](_0x53a6a7=>{const _0x11fd71=_0x41e104;_0x53a6a7[_0x11fd71(0x191)]()&&_0x41fe62[_0x11fd71(0x18a)](_0x53a6a7);});}}return _0x41fe62[_0x41e104(0x180)]('\x0a');}}}}function a77_0x3dea(_0x242266,_0x493f9a){const _0x15501a=a77_0x1550();return a77_0x3dea=function(_0x3dea16,_0x490c9a){_0x3dea16=_0x3dea16-0x17a;let _0xa00bdb=_0x15501a[_0x3dea16];return _0xa00bdb;},a77_0x3dea(_0x242266,_0x493f9a);}export async function handleSingleObjectOutput(_0x5dd4e6,_0xe4deff){const _0x1b1c80=a77_0x3dea,_0xcdd448=resolveOutputOptions(_0xe4deff),_0xc49c22=await formatSingleObject(_0x5dd4e6,_0xcdd448);await writeOutput(_0xc49c22,_0xcdd448[_0x1b1c80(0x1b6)]||undefined,_0xcdd448['format']);}
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5526a9,_0x2c9ecd){const _0x3ffa98=a78_0x1cd0,_0x4af835=_0x5526a9();while(!![]){try{const _0x5038dd=-parseInt(_0x3ffa98(0x175))/0x1+-parseInt(_0x3ffa98(0x173))/0x2*(parseInt(_0x3ffa98(0x16e))/0x3)+-parseInt(_0x3ffa98(0x16f))/0x4+parseInt(_0x3ffa98(0x174))/0x5+parseInt(_0x3ffa98(0x171))/0x6*(-parseInt(_0x3ffa98(0x170))/0x7)+-parseInt(_0x3ffa98(0x172))/0x8+parseInt(_0x3ffa98(0x176))/0x9;if(_0x5038dd===_0x2c9ecd)break;else _0x4af835['push'](_0x4af835['shift']());}catch(_0x11ab04){_0x4af835['push'](_0x4af835['shift']());}}}(a78_0x453a,0x5dfdf));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x4e7aa3,_0x3f6c71){const _0x349263=a78_0x1cd0;if(_0x4e7aa3===undefined)return _0x3f6c71;if(typeof _0x4e7aa3===_0x349263(0x177))return _0x4e7aa3;return parseInt(_0x4e7aa3,0xa);}function a78_0x1cd0(_0x3850e6,_0x3348a6){const _0x453ac4=a78_0x453a();return a78_0x1cd0=function(_0x1cd04a,_0x1fb1c9){_0x1cd04a=_0x1cd04a-0x16e;let _0x2c6a73=_0x453ac4[_0x1cd04a];return _0x2c6a73;},a78_0x1cd0(_0x3850e6,_0x3348a6);}function a78_0x453a(){const _0x260727=['2437844MJdZDy','7UIrdks','3914868dfAWvt','979384lRKOpx','8vcaeZt','225740imIvbR','258818wEWnRM','19955043mSmBln','number','175653itLunf'];a78_0x453a=function(){return _0x260727;};return a78_0x453a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d0363,_0x373148){const _0x449507=a79_0x1462,_0xbb141f=_0x2d0363();while(!![]){try{const _0x98bb25=-parseInt(_0x449507(0xf6))/0x1*(parseInt(_0x449507(0xfe))/0x2)+parseInt(_0x449507(0x100))/0x3*(-parseInt(_0x449507(0xfd))/0x4)+-parseInt(_0x449507(0xfa))/0x5+-parseInt(_0x449507(0xf7))/0x6*(parseInt(_0x449507(0xf5))/0x7)+parseInt(_0x449507(0x102))/0x8+-parseInt(_0x449507(0xf2))/0x9+parseInt(_0x449507(0xff))/0xa*(parseInt(_0x449507(0xf4))/0xb);if(_0x98bb25===_0x373148)break;else _0xbb141f['push'](_0xbb141f['shift']());}catch(_0x266934){_0xbb141f['push'](_0xbb141f['shift']());}}}(a79_0x4926,0xf25d5));import*as a79_0x3aeff2 from'node:fs';import*as a79_0x865ef from'node:path';export function setSecureFilePermissions(_0x567706){const _0x421fc2=a79_0x1462;try{a79_0x3aeff2[_0x421fc2(0xf9)](_0x567706,0x180);}catch{console[_0x421fc2(0xfc)](_0x421fc2(0xfb)+_0x567706);}}export function setSecureDirectoryPermissions(_0xb0fa01){const _0x21d47b=a79_0x1462;try{a79_0x3aeff2[_0x21d47b(0xf9)](_0xb0fa01,0x1c0);}catch{console[_0x21d47b(0xfc)](_0x21d47b(0xfb)+_0xb0fa01);}}export function createSecureDirectory(_0x38a376){const _0x372be3=a79_0x1462;!a79_0x3aeff2['existsSync'](_0x38a376)&&(a79_0x3aeff2[_0x372be3(0xf3)](_0x38a376,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x38a376));}function a79_0x1462(_0x38d34d,_0x2b9c88){const _0x49260d=a79_0x4926();return a79_0x1462=function(_0x1462d7,_0x256707){_0x1462d7=_0x1462d7-0xf1;let _0x2f661f=_0x49260d[_0x1462d7];return _0x2f661f;},a79_0x1462(_0x38d34d,_0x2b9c88);}export function validateSecureFilePermissions(_0x565a19){const _0x519ed3=a79_0x1462;try{const _0x489aef=a79_0x3aeff2[_0x519ed3(0xf1)](_0x565a19),_0x2eb32a=_0x489aef['mode']&0x1ff,_0x784052=(_0x2eb32a&0x3f)!==0x0;if(_0x784052)return console[_0x519ed3(0xfc)](_0x519ed3(0xf8)+_0x565a19+'\x20has\x20insecure\x20permissions\x20('+_0x2eb32a[_0x519ed3(0x101)](0x8)+').\x20'+'Should\x20be\x200600\x20or\x20more\x20restrictive.'),![];return!![];}catch{return!![];}}function a79_0x4926(){const _0x167bee=['statSync','161802qzHFWm','mkdirSync','11GCQMMY','12317515ZOeWcN','558779MbSKNZ','6AxSkYr','Warning:\x20','chmodSync','4883110Kxfqzc','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','warn','1264764zwFVQn','2yOVWjJ','26559430oGMQXm','3hzfRhj','toString','15727976XjTEMM'];a79_0x4926=function(){return _0x167bee;};return a79_0x4926();}export function writeSecureFile(_0x20a2d5,_0x2ffd8f){const _0x5eb755=a79_0x865ef['dirname'](_0x20a2d5);createSecureDirectory(_0x5eb755),a79_0x3aeff2['writeFileSync'](_0x20a2d5,_0x2ffd8f,{'mode':0x180}),setSecureFilePermissions(_0x20a2d5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d6807,_0x272d2e){const _0x3667a9=a80_0x5ee7,_0x266648=_0x1d6807();while(!![]){try{const _0x38dce9=-parseInt(_0x3667a9(0x1b5))/0x1+-parseInt(_0x3667a9(0x1b9))/0x2+parseInt(_0x3667a9(0x1bf))/0x3+parseInt(_0x3667a9(0x1b2))/0x4*(-parseInt(_0x3667a9(0x1b1))/0x5)+parseInt(_0x3667a9(0x1be))/0x6*(-parseInt(_0x3667a9(0x1c0))/0x7)+-parseInt(_0x3667a9(0x1b8))/0x8*(-parseInt(_0x3667a9(0x1b4))/0x9)+-parseInt(_0x3667a9(0x1bd))/0xa*(-parseInt(_0x3667a9(0x1af))/0xb);if(_0x38dce9===_0x272d2e)break;else _0x266648['push'](_0x266648['shift']());}catch(_0x2f5e75){_0x266648['push'](_0x266648['shift']());}}}(a80_0x59b8,0x51c14));export function detectFormatFromExtension(_0x52bd0c){const _0x5348c8=a80_0x5ee7,_0x2c8a96=_0x52bd0c[_0x5348c8(0x1bc)]()[_0x5348c8(0x1b0)]('.')[_0x5348c8(0x1b3)]();switch(_0x2c8a96){case _0x5348c8(0x1bb):return _0x5348c8(0x1bb);case _0x5348c8(0x1b6):return _0x5348c8(0x1b6);case _0x5348c8(0x1ae):case _0x5348c8(0x1b7):return _0x5348c8(0x1ae);case _0x5348c8(0x1ad):case _0x5348c8(0x1ba):return'table';default:return undefined;}}function a80_0x5ee7(_0x4617d2,_0x1abbac){const _0x59b8ca=a80_0x59b8();return a80_0x5ee7=function(_0x5ee719,_0x573704){_0x5ee719=_0x5ee719-0x1ad;let _0x57a86c=_0x59b8ca[_0x5ee719];return _0x57a86c;},a80_0x5ee7(_0x4617d2,_0x1abbac);}export function resolveOutputFormat(_0x4c1fec,_0x56e861,_0x2b9dc1){if(_0x4c1fec)return _0x4c1fec;if(_0x56e861){const _0x1be992=detectFormatFromExtension(_0x56e861);if(_0x1be992)return _0x1be992;}return _0x2b9dc1;}function a80_0x59b8(){const _0x3e0070=['456944lekthS','text','json','toLowerCase','3270QVGslv','2190YbIYsB','900279nATWrs','8575mEQFyo','txt','tsv','47421EGlgYG','split','265EhdAtU','9748UephKe','pop','81VlePaZ','610763cIDjac','jsonl','tab','36088Fiqeck'];a80_0x59b8=function(){return _0x3e0070;};return a80_0x59b8();}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2c2a1c,_0x5a764e){const _0x570521=a81_0x1cea,_0x2217f6=_0x2c2a1c();while(!![]){try{const _0x252eb7=parseInt(_0x570521(0x1e4))/0x1+-parseInt(_0x570521(0x1f5))/0x2+parseInt(_0x570521(0x1f1))/0x3*(-parseInt(_0x570521(0x20c))/0x4)+-parseInt(_0x570521(0x216))/0x5*(parseInt(_0x570521(0x20e))/0x6)+-parseInt(_0x570521(0x218))/0x7*(parseInt(_0x570521(0x1f9))/0x8)+parseInt(_0x570521(0x208))/0x9+-parseInt(_0x570521(0x201))/0xa*(-parseInt(_0x570521(0x1fd))/0xb);if(_0x252eb7===_0x5a764e)break;else _0x2217f6['push'](_0x2217f6['shift']());}catch(_0x9fdba5){_0x2217f6['push'](_0x2217f6['shift']());}}}(a81_0xaddd,0xd1fbd));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x15e3f0=a81_0x1cea;return process[_0x15e3f0(0x1ff)][_0x15e3f0(0x1f7)]||Infinity;}export function formatAsTable(_0xa111c8,_0x25af8d=DEFAULT_MAX_DISPLAY_ROWS,_0x26ffd5=![],_0x15fe46={}){const _0x20df0b=a81_0x1cea;if(_0xa111c8['data'][_0x20df0b(0x1fa)]===0x0)return _0x20df0b(0x219);const _0x4ef5bb=_0xa111c8[_0x20df0b(0x1f7)][_0x20df0b(0x207)](_0x65751c=>_0x65751c[_0x20df0b(0x212)]),_0x249e15=_0xa111c8[_0x20df0b(0x1f7)][_0x20df0b(0x207)](_0x3e8fe7=>simplifyType(_0x3e8fe7['type'])),_0x46eea9=_0xa111c8[_0x20df0b(0x1ee)][_0x20df0b(0x210)](0x0,_0x25af8d),_0x675ddd=_0xa111c8['data'][_0x20df0b(0x1fa)],_0x58eeeb=_0x675ddd>_0x25af8d,_0x38b2b5=[],_0xfc676f=getTerminalWidth(),_0x27bb11=_0xfc676f!==Infinity,_0x543b26=0x32;let _0x1337a5=_0x4ef5bb[_0x20df0b(0x207)]((_0x1046f3,_0x2a5b02)=>{const _0x1e0fd4=_0x20df0b,_0x2d0710=stringWidth(_0x249e15[_0x2a5b02]),_0x194117=Math[_0x1e0fd4(0x20f)](..._0x46eea9[_0x1e0fd4(0x207)](_0x4cc9f8=>{const _0x303116=_0x4cc9f8[_0x1046f3];return stringWidth(formatValue(_0x303116));})),_0x35b58a=Math[_0x1e0fd4(0x20f)](stringWidth(_0x1046f3),_0x2d0710,_0x194117);return _0x26ffd5?_0x35b58a:Math['min'](_0x35b58a,_0x543b26);});if(_0x27bb11&&!_0x26ffd5&&_0x4ef5bb['length']>0x0){const _0x5ee2db=_0x356897=>{let _0xa80d7b=0x1;for(const _0x193f14 of _0x356897){_0xa80d7b+=_0x193f14+0x3;}return _0xa80d7b+0x1;};let _0x326bc9=_0x5ee2db(_0x1337a5);if(_0x326bc9>_0xfc676f){const _0x4c5e76=0x3;for(let _0x2cfc0c=_0x1337a5['length']-0x1;_0x2cfc0c>=0x0;_0x2cfc0c--){_0x326bc9=_0x5ee2db(_0x1337a5);if(_0x326bc9<=_0xfc676f)break;const _0x506d6a=_0x1337a5[_0x2cfc0c],_0x4242ad=_0x326bc9-_0xfc676f,_0x29e616=_0x506d6a-_0x4c5e76,_0x3f198c=Math['min'](_0x4242ad,_0x29e616);_0x3f198c>0x0&&(_0x1337a5[_0x2cfc0c]=_0x506d6a-_0x3f198c);}}}const _0x4d23b0=_0x4ef5bb,_0x2de5fe=_0x249e15,_0x74fe15=_0x1337a5,_0x37aec6=_0x1337a5;_0x38b2b5[_0x20df0b(0x1f4)](colorBorder('┌'+_0x37aec6[_0x20df0b(0x207)](_0x4e34a5=>'─'[_0x20df0b(0x1eb)](_0x4e34a5+0x2))[_0x20df0b(0x1f2)]('┬')+'┐',_0x15fe46));const _0x5e1805=_0x4d23b0[_0x20df0b(0x207)]((_0x4a42ca,_0x588a4e)=>centerAlign(_0x4a42ca,_0x74fe15[_0x588a4e]));_0x38b2b5[_0x20df0b(0x1f4)](colorBorder('│',_0x15fe46)+'\x20'+_0x5e1805['join']('\x20'+colorBorder('│',_0x15fe46)+'\x20')+'\x20'+colorBorder('│',_0x15fe46));const _0x5770d3=_0x2de5fe[_0x20df0b(0x207)]((_0xecd242,_0x1f5356)=>colorType(centerAlign(_0xecd242,_0x74fe15[_0x1f5356]),_0x15fe46));_0x38b2b5['push'](colorBorder('│',_0x15fe46)+'\x20'+_0x5770d3[_0x20df0b(0x1f2)]('\x20'+colorBorder('│',_0x15fe46)+'\x20')+'\x20'+colorBorder('│',_0x15fe46)),_0x38b2b5[_0x20df0b(0x1f4)](colorBorder('├'+_0x37aec6[_0x20df0b(0x207)](_0x246089=>'─'[_0x20df0b(0x1eb)](_0x246089+0x2))[_0x20df0b(0x1f2)]('┼')+'┤',_0x15fe46));const _0xe6f798=(_0x14fb70,_0x1d885b)=>{const _0x40a412=_0x20df0b,_0x12901c=stringWidth(_0x14fb70);if(_0x12901c<=_0x1d885b)return _0x14fb70;let _0x5523d9=_0x14fb70;while(stringWidth(_0x5523d9+'…')>_0x1d885b&&_0x5523d9[_0x40a412(0x1fa)]>0x0){_0x5523d9=_0x5523d9[_0x40a412(0x210)](0x0,-0x1);}return _0x5523d9+'…';};_0x46eea9[_0x20df0b(0x1fc)](_0x279648=>{const _0x381fb9=_0x20df0b,_0x5eb0d7=_0x4ef5bb['map']((_0x583204,_0x1ad059)=>{const _0x55bcc9=a81_0x1cea,_0x9b89f7=_0x279648[_0x583204],_0x2a4fbc=formatValue(_0x9b89f7),_0x38bae2=_0x74fe15[_0x1ad059],_0x435203=_0xe6f798(_0x2a4fbc,_0x38bae2),_0x13f685=typeof _0x9b89f7==='number'||typeof _0x9b89f7===_0x55bcc9(0x21a)&&/^-?\d+$/['test'](_0x9b89f7);return _0x13f685?padStart(_0x435203,_0x38bae2):padEnd(_0x435203,_0x38bae2);});_0x38b2b5[_0x381fb9(0x1f4)](colorBorder('│',_0x15fe46)+'\x20'+_0x5eb0d7[_0x381fb9(0x1f2)]('\x20'+colorBorder('│',_0x15fe46)+'\x20')+'\x20'+colorBorder('│',_0x15fe46));});const _0x5bf0ac=_0x37aec6[_0x20df0b(0x217)]((_0xf1e59,_0x4de64f)=>_0xf1e59+_0x4de64f+0x3,-0x1);_0x38b2b5['push'](colorBorder('├'+_0x37aec6[_0x20df0b(0x207)](_0x46475c=>'─'[_0x20df0b(0x1eb)](_0x46475c+0x2))[_0x20df0b(0x1f2)]('┴')+'┤',_0x15fe46));let _0x5c442a;_0x58eeeb?_0x5c442a=_0x675ddd+_0x20df0b(0x200)+_0x25af8d+_0x20df0b(0x1e7):_0x5c442a=_0x675ddd+_0x20df0b(0x1e8)+(_0x675ddd===0x1?'':'s');const _0x2f65cf=_0x5c442a[_0x20df0b(0x213)](_0x5bf0ac-0x2);return _0x38b2b5[_0x20df0b(0x1f4)](colorBorder('│',_0x15fe46)+'\x20'+_0x2f65cf+'\x20'+colorBorder('│',_0x15fe46)),_0x38b2b5[_0x20df0b(0x1f4)](colorBorder('└'+'─'[_0x20df0b(0x1eb)](_0x5bf0ac)+'┘',_0x15fe46)),_0x38b2b5['join']('\x0a');}function simplifyType(_0x17d225){const _0x13ed4c=a81_0x1cea,_0x4d6dbc={'varchar':_0x13ed4c(0x21a),'bigint':_0x13ed4c(0x203),'integer':_0x13ed4c(0x1f3),'double':_0x13ed4c(0x202),'boolean':_0x13ed4c(0x215),'date':_0x13ed4c(0x209),'timestamp':_0x13ed4c(0x205),'array':_0x13ed4c(0x1e5),'map':_0x13ed4c(0x207),'row':_0x13ed4c(0x20b)},_0x16adad=_0x17d225[_0x13ed4c(0x1ef)]();for(const [_0x15c0ce,_0x29ab41]of Object[_0x13ed4c(0x21c)](_0x4d6dbc)){if(_0x16adad[_0x13ed4c(0x1ea)](_0x15c0ce))return _0x29ab41;}return _0x17d225['length']>0xa?_0x17d225['substring'](0x0,0xa):_0x17d225;}export function formatAsJSON(_0x7bcbdf,_0xd2c272={}){const _0x48acde=a81_0x1cea;if(_0x7bcbdf[_0x48acde(0x1ee)][_0x48acde(0x1fa)]===0x0)return'[]';if(shouldUseColor(_0xd2c272))return colorizeJSON(_0x7bcbdf['data'],_0xd2c272);const _0x540fc7=_0x7bcbdf['data'][_0x48acde(0x207)](_0x115f4a=>'\x20\x20'+JSON[_0x48acde(0x20a)](_0x115f4a));return'[\x0a'+_0x540fc7['join'](',\x0a')+'\x0a]';}function a81_0xaddd(){const _0x6c2a99=['17346ZxoeLD','max','slice','object','name','padEnd','jsonl','bool','1360GLkpfE','reduce','812mImiTy','No\x20rows\x20returned','string','toISOString','entries','1327618owpxqs','array','floor','\x20shown)','\x20row','log','startsWith','repeat','replace','pow','data','toLowerCase','boolean','177nnyMEi','join','int','push','3266872hqVMyS','table','columns','toFixed','93352VTnDWk','length','number','forEach','2897983SPPlct','json','stdout','\x20rows\x20(','80bQZAdH','double','long','false','timestamp','tsv','map','13087134EqQulj','date','stringify','row','17348vQbsQg','toString'];a81_0xaddd=function(){return _0x6c2a99;};return a81_0xaddd();}export function formatAsJSONL(_0x20e70d,_0x5d9186={}){const _0x523084=a81_0x1cea;if(_0x20e70d['data']['length']===0x0)return'';if(shouldUseColor(_0x5d9186))return _0x20e70d[_0x523084(0x1ee)]['map'](_0x2a7f4a=>colorizeJSONCompact(_0x2a7f4a,_0x5d9186))[_0x523084(0x1f2)]('\x0a');return _0x20e70d[_0x523084(0x1ee)]['map'](_0x3eca61=>JSON[_0x523084(0x20a)](_0x3eca61))['join']('\x0a');}export function formatAsTSV(_0x4076a0){const _0x2d3ebf=a81_0x1cea;if(_0x4076a0[_0x2d3ebf(0x1ee)][_0x2d3ebf(0x1fa)]===0x0)return'';const _0x51ddfd=[],_0x243549=_0x4076a0[_0x2d3ebf(0x1f7)]['map'](_0xba00b=>_0xba00b['name']);return _0x51ddfd[_0x2d3ebf(0x1f4)](_0x243549[_0x2d3ebf(0x1f2)]('\x09')),_0x4076a0[_0x2d3ebf(0x1ee)][_0x2d3ebf(0x1fc)](_0x5617e9=>{const _0x18eefe=_0x2d3ebf,_0x1b32f1=_0x243549[_0x18eefe(0x207)](_0x1d165f=>{const _0x4156ae=_0x5617e9[_0x1d165f];return formatValueForTSV(_0x4156ae);});_0x51ddfd['push'](_0x1b32f1[_0x18eefe(0x1f2)]('\x09'));}),_0x51ddfd[_0x2d3ebf(0x1f2)]('\x0a');}function formatValue(_0x196a85){const _0xff33=a81_0x1cea;if(_0x196a85===null||_0x196a85===undefined)return'';if(typeof _0x196a85==='string'){const _0x3bc3e8=_0x196a85[_0xff33(0x1ec)](/\n/g,'\x5cn')[_0xff33(0x1ec)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x3bc3e8;}if(typeof _0x196a85==='number')return String(_0x196a85);if(typeof _0x196a85==='boolean')return _0x196a85?'true':_0xff33(0x204);if(_0x196a85 instanceof Date)return _0x196a85[_0xff33(0x21b)]();if(typeof _0x196a85===_0xff33(0x211))return JSON[_0xff33(0x20a)](_0x196a85);return String(_0x196a85);}function a81_0x1cea(_0x5757c7,_0x59e3ee){const _0xaddd87=a81_0xaddd();return a81_0x1cea=function(_0x1cea9c,_0x55ae63){_0x1cea9c=_0x1cea9c-0x1e4;let _0x2f161e=_0xaddd87[_0x1cea9c];return _0x2f161e;},a81_0x1cea(_0x5757c7,_0x59e3ee);}function formatValueForTSV(_0x52a8fb){const _0x14f159=a81_0x1cea;if(_0x52a8fb===null||_0x52a8fb===undefined)return'';if(typeof _0x52a8fb===_0x14f159(0x21a))return _0x52a8fb[_0x14f159(0x1ec)](/\t/g,'\x5ct')[_0x14f159(0x1ec)](/\n/g,'\x5cn');if(typeof _0x52a8fb===_0x14f159(0x1fb)||typeof _0x52a8fb===_0x14f159(0x1f0))return String(_0x52a8fb);if(_0x52a8fb instanceof Date)return _0x52a8fb['toISOString']();if(typeof _0x52a8fb===_0x14f159(0x211))return JSON['stringify'](_0x52a8fb);return String(_0x52a8fb);}export function formatQueryResult(_0x5ec678,_0x2ada0c){const _0x24d535=a81_0x1cea;switch(_0x2ada0c){case _0x24d535(0x1f6):return formatAsTable(_0x5ec678);case _0x24d535(0x1fe):return formatAsJSON(_0x5ec678);case _0x24d535(0x214):return formatAsJSONL(_0x5ec678);case _0x24d535(0x206):return formatAsTSV(_0x5ec678);default:return formatAsJSON(_0x5ec678);}}export function formatBytes(_0x21863d){const _0x448843=a81_0x1cea;if(_0x21863d===0x0)return'0\x20B';const _0x3ad1df=['B','KB','MB','GB','TB'],_0x1c34d1=0x400,_0x393a4f=Math[_0x448843(0x1e6)](Math[_0x448843(0x1e9)](_0x21863d)/Math[_0x448843(0x1e9)](_0x1c34d1)),_0x24df87=_0x21863d/Math['pow'](_0x1c34d1,_0x393a4f),_0x12a9ce=_0x24df87>=0xa?0x1:0x2;return _0x24df87[_0x448843(0x1f8)](_0x12a9ce)+'\x20'+_0x3ad1df[_0x393a4f];}export function formatRows(_0x206b37){const _0x58118a=a81_0x1cea;if(_0x206b37==null)return'-';if(_0x206b37===0x0)return'0';if(_0x206b37<0x3e8)return _0x206b37[_0x58118a(0x20d)]();const _0x45d473=['','K','M','B','T'],_0x356a77=0x3e8,_0x360f6e=Math[_0x58118a(0x1e6)](Math[_0x58118a(0x1e9)](_0x206b37)/Math[_0x58118a(0x1e9)](_0x356a77)),_0x4ae867=_0x206b37/Math[_0x58118a(0x1ed)](_0x356a77,_0x360f6e),_0x2b0054=_0x4ae867>=0xa?0x1:0x2;return''+_0x4ae867[_0x58118a(0x1f8)](_0x2b0054)+_0x45d473[_0x360f6e];}
|
|
1
|
+
(function(_0x91dd58,_0x3a872d){const _0x25399f=a81_0x1fbf,_0x44571a=_0x91dd58();while(!![]){try{const _0x2d3813=parseInt(_0x25399f(0x122))/0x1+parseInt(_0x25399f(0x123))/0x2*(parseInt(_0x25399f(0xf1))/0x3)+parseInt(_0x25399f(0x10b))/0x4+parseInt(_0x25399f(0x115))/0x5+-parseInt(_0x25399f(0xed))/0x6*(-parseInt(_0x25399f(0x120))/0x7)+-parseInt(_0x25399f(0xee))/0x8+-parseInt(_0x25399f(0x100))/0x9*(parseInt(_0x25399f(0x10a))/0xa);if(_0x2d3813===_0x3a872d)break;else _0x44571a['push'](_0x44571a['shift']());}catch(_0x2986a5){_0x44571a['push'](_0x44571a['shift']());}}}(a81_0x5816,0x797da));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x58ecba=a81_0x1fbf;return process[_0x58ecba(0x109)]['columns']||Infinity;}export function formatAsTable(_0x55b3b6,_0x451016=DEFAULT_MAX_DISPLAY_ROWS,_0x1c1355=![],_0x610991={}){const _0x559648=a81_0x1fbf;if(_0x55b3b6[_0x559648(0x125)][_0x559648(0xf5)]===0x0)return _0x559648(0xfc);const _0x4c4469=_0x55b3b6[_0x559648(0xf2)][_0x559648(0x11e)](_0x40506e=>_0x40506e['name']),_0x7d8ccc=_0x55b3b6['columns'][_0x559648(0x11e)](_0x1cdb2b=>simplifyType(_0x1cdb2b[_0x559648(0x11c)])),_0x3d6d8a=_0x55b3b6[_0x559648(0x125)]['slice'](0x0,_0x451016),_0x5912e5=_0x55b3b6['data']['length'],_0x2a3331=_0x5912e5>_0x451016,_0x5af85b=[],_0x1d2a09=getTerminalWidth(),_0x1ff184=_0x1d2a09!==Infinity,_0x2a2bd2=0x32;let _0x3bd98e=_0x4c4469[_0x559648(0x11e)]((_0x683ded,_0x276c7f)=>{const _0xdf11c4=_0x559648,_0x3a64b4=stringWidth(_0x7d8ccc[_0x276c7f]),_0x38c062=Math[_0xdf11c4(0x112)](..._0x3d6d8a['map'](_0x1016a6=>{const _0x16444e=_0x1016a6[_0x683ded];return stringWidth(formatValue(_0x16444e));})),_0x18d76a=Math[_0xdf11c4(0x112)](stringWidth(_0x683ded),_0x3a64b4,_0x38c062);return _0x1c1355?_0x18d76a:Math['min'](_0x18d76a,_0x2a2bd2);});if(_0x1ff184&&!_0x1c1355&&_0x4c4469[_0x559648(0xf5)]>0x0){const _0x110bd1=_0x45ae9a=>{let _0x5baeae=0x1;for(const _0x31bc01 of _0x45ae9a){_0x5baeae+=_0x31bc01+0x3;}return _0x5baeae+0x1;};let _0x606ef5=_0x110bd1(_0x3bd98e);if(_0x606ef5>_0x1d2a09){const _0x309595=0x3;for(let _0x2f8d6d=_0x3bd98e[_0x559648(0xf5)]-0x1;_0x2f8d6d>=0x0;_0x2f8d6d--){_0x606ef5=_0x110bd1(_0x3bd98e);if(_0x606ef5<=_0x1d2a09)break;const _0x47aca2=_0x3bd98e[_0x2f8d6d],_0x2d32f9=_0x606ef5-_0x1d2a09,_0x2eb8f9=_0x47aca2-_0x309595,_0x4cce1b=Math[_0x559648(0x10d)](_0x2d32f9,_0x2eb8f9);_0x4cce1b>0x0&&(_0x3bd98e[_0x2f8d6d]=_0x47aca2-_0x4cce1b);}}}const _0x457317=_0x4c4469,_0x10aa6d=_0x7d8ccc,_0x5ced04=_0x3bd98e,_0xf3f71d=_0x3bd98e;_0x5af85b[_0x559648(0x108)](colorBorder('┌'+_0xf3f71d[_0x559648(0x11e)](_0x2e2087=>'─'['repeat'](_0x2e2087+0x2))[_0x559648(0xef)]('┬')+'┐',_0x610991));const _0x2539d0=_0x457317['map']((_0x396088,_0x706e58)=>centerAlign(_0x396088,_0x5ced04[_0x706e58]));_0x5af85b[_0x559648(0x108)](colorBorder('│',_0x610991)+'\x20'+_0x2539d0[_0x559648(0xef)]('\x20'+colorBorder('│',_0x610991)+'\x20')+'\x20'+colorBorder('│',_0x610991));const _0x9a564e=_0x10aa6d[_0x559648(0x11e)]((_0xa0e292,_0x173469)=>colorType(centerAlign(_0xa0e292,_0x5ced04[_0x173469]),_0x610991));_0x5af85b['push'](colorBorder('│',_0x610991)+'\x20'+_0x9a564e[_0x559648(0xef)]('\x20'+colorBorder('│',_0x610991)+'\x20')+'\x20'+colorBorder('│',_0x610991)),_0x5af85b[_0x559648(0x108)](colorBorder('├'+_0xf3f71d[_0x559648(0x11e)](_0x3fa49f=>'─'[_0x559648(0xf7)](_0x3fa49f+0x2))[_0x559648(0xef)]('┼')+'┤',_0x610991));const _0x2171c5=(_0x51cfda,_0x5a2f97)=>{const _0x27592f=_0x559648,_0x105b01=stringWidth(_0x51cfda);if(_0x105b01<=_0x5a2f97)return _0x51cfda;let _0x5a2a29=_0x51cfda;while(stringWidth(_0x5a2a29+'…')>_0x5a2f97&&_0x5a2a29[_0x27592f(0xf5)]>0x0){_0x5a2a29=_0x5a2a29['slice'](0x0,-0x1);}return _0x5a2a29+'…';};_0x3d6d8a[_0x559648(0xf6)](_0x58baf0=>{const _0x1e8569=_0x559648,_0x58c482=_0x4c4469[_0x1e8569(0x11e)]((_0x410e38,_0x24f497)=>{const _0x3b5f92=_0x1e8569,_0x1706ef=_0x58baf0[_0x410e38],_0x3279cb=formatValue(_0x1706ef),_0x29682e=_0x5ced04[_0x24f497],_0x1daa1e=_0x2171c5(_0x3279cb,_0x29682e),_0x1a4d84=typeof _0x1706ef===_0x3b5f92(0x110)||typeof _0x1706ef===_0x3b5f92(0x118)&&/^-?\d+$/[_0x3b5f92(0xfd)](_0x1706ef);return _0x1a4d84?padStart(_0x1daa1e,_0x29682e):padEnd(_0x1daa1e,_0x29682e);});_0x5af85b[_0x1e8569(0x108)](colorBorder('│',_0x610991)+'\x20'+_0x58c482[_0x1e8569(0xef)]('\x20'+colorBorder('│',_0x610991)+'\x20')+'\x20'+colorBorder('│',_0x610991));});const _0x230b41=_0xf3f71d['reduce']((_0x2409c6,_0x44071e)=>_0x2409c6+_0x44071e+0x3,-0x1);_0x5af85b[_0x559648(0x108)](colorBorder('├'+_0xf3f71d['map'](_0x3a0aeb=>'─'[_0x559648(0xf7)](_0x3a0aeb+0x2))['join']('┴')+'┤',_0x610991));let _0x3df23d;_0x2a3331?_0x3df23d=_0x5912e5+_0x559648(0xfe)+_0x451016+_0x559648(0x121):_0x3df23d=_0x5912e5+_0x559648(0x102)+(_0x5912e5===0x1?'':'s');const _0x3f3b0c=_0x3df23d[_0x559648(0x111)](_0x230b41-0x2);return _0x5af85b[_0x559648(0x108)](colorBorder('│',_0x610991)+'\x20'+_0x3f3b0c+'\x20'+colorBorder('│',_0x610991)),_0x5af85b[_0x559648(0x108)](colorBorder('└'+'─'[_0x559648(0xf7)](_0x230b41)+'┘',_0x610991)),_0x5af85b[_0x559648(0xef)]('\x0a');}function simplifyType(_0x267770){const _0x84c0d6=a81_0x1fbf,_0x1cadb5={'varchar':_0x84c0d6(0x118),'bigint':_0x84c0d6(0x113),'integer':_0x84c0d6(0x10e),'double':_0x84c0d6(0xf3),'boolean':_0x84c0d6(0x101),'date':_0x84c0d6(0x10c),'timestamp':_0x84c0d6(0x124),'array':_0x84c0d6(0x116),'map':'map','row':_0x84c0d6(0x106)},_0x12341c=_0x267770[_0x84c0d6(0xfa)]();for(const [_0x9cc86e,_0x113c50]of Object[_0x84c0d6(0xf0)](_0x1cadb5)){if(_0x12341c[_0x84c0d6(0xfb)](_0x9cc86e))return _0x113c50;}return _0x267770[_0x84c0d6(0xf5)]>0xa?_0x267770['substring'](0x0,0xa):_0x267770;}export function formatAsJSON(_0x463f73,_0x507dfb={}){const _0x12551c=a81_0x1fbf;if(_0x463f73[_0x12551c(0x125)]['length']===0x0)return'[]';if(shouldUseColor(_0x507dfb))return colorizeJSON(_0x463f73[_0x12551c(0x125)],_0x507dfb);const _0x5c2df3=_0x463f73[_0x12551c(0x125)][_0x12551c(0x11e)](_0x75ff70=>'\x20\x20'+JSON[_0x12551c(0x11a)](_0x75ff70));return'[\x0a'+_0x5c2df3['join'](',\x0a')+'\x0a]';}function a81_0x5816(){const _0x4fc7fb=['true','map','name','7ghgyuz','\x20shown)','259319vlTXJI','43762Hueugh','timestamp','data','1482294IrDKaG','4759864wSzMqm','join','entries','6HAfOtT','columns','double','pow','length','forEach','repeat','replace','json','toLowerCase','startsWith','No\x20rows\x20returned','test','\x20rows\x20(','false','171HXcJKp','bool','\x20row','boolean','toISOString','object','row','floor','push','stdout','328110WMQFLK','1509452AdwYTg','date','min','int','0\x20B','number','padEnd','max','long','log','3942625rCcvmc','array','tsv','string','toFixed','stringify','toString','type'];a81_0x5816=function(){return _0x4fc7fb;};return a81_0x5816();}export function formatAsJSONL(_0x3b752b,_0x369584={}){const _0x450575=a81_0x1fbf;if(_0x3b752b[_0x450575(0x125)][_0x450575(0xf5)]===0x0)return'';if(shouldUseColor(_0x369584))return _0x3b752b['data'][_0x450575(0x11e)](_0x3cbb7d=>colorizeJSONCompact(_0x3cbb7d,_0x369584))['join']('\x0a');return _0x3b752b[_0x450575(0x125)]['map'](_0x332e87=>JSON[_0x450575(0x11a)](_0x332e87))['join']('\x0a');}export function formatAsTSV(_0x540b2e){const _0x9a6106=a81_0x1fbf;if(_0x540b2e['data'][_0x9a6106(0xf5)]===0x0)return'';const _0x13ac25=[],_0x49fd89=_0x540b2e[_0x9a6106(0xf2)][_0x9a6106(0x11e)](_0x54eeb8=>_0x54eeb8[_0x9a6106(0x11f)]);return _0x13ac25[_0x9a6106(0x108)](_0x49fd89[_0x9a6106(0xef)]('\x09')),_0x540b2e['data'][_0x9a6106(0xf6)](_0x462331=>{const _0x3e5518=_0x9a6106,_0x1403a7=_0x49fd89[_0x3e5518(0x11e)](_0x2676c9=>{const _0x44feb5=_0x462331[_0x2676c9];return formatValueForTSV(_0x44feb5);});_0x13ac25[_0x3e5518(0x108)](_0x1403a7[_0x3e5518(0xef)]('\x09'));}),_0x13ac25[_0x9a6106(0xef)]('\x0a');}function formatValue(_0x15b0b0){const _0xd01055=a81_0x1fbf;if(_0x15b0b0===null||_0x15b0b0===undefined)return'';if(typeof _0x15b0b0===_0xd01055(0x118)){const _0x14fb56=_0x15b0b0['replace'](/\n/g,'\x5cn')[_0xd01055(0xf8)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x14fb56;}if(typeof _0x15b0b0==='number')return String(_0x15b0b0);if(typeof _0x15b0b0===_0xd01055(0x103))return _0x15b0b0?_0xd01055(0x11d):_0xd01055(0xff);if(_0x15b0b0 instanceof Date)return _0x15b0b0[_0xd01055(0x104)]();if(typeof _0x15b0b0===_0xd01055(0x105))return JSON[_0xd01055(0x11a)](_0x15b0b0);return String(_0x15b0b0);}function formatValueForTSV(_0x40b65c){const _0x3a4d5f=a81_0x1fbf;if(_0x40b65c===null||_0x40b65c===undefined)return'';if(typeof _0x40b65c===_0x3a4d5f(0x118))return _0x40b65c[_0x3a4d5f(0xf8)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x40b65c===_0x3a4d5f(0x110)||typeof _0x40b65c===_0x3a4d5f(0x103))return String(_0x40b65c);if(_0x40b65c instanceof Date)return _0x40b65c[_0x3a4d5f(0x104)]();if(typeof _0x40b65c===_0x3a4d5f(0x105))return JSON[_0x3a4d5f(0x11a)](_0x40b65c);return String(_0x40b65c);}export function formatQueryResult(_0x6af161,_0x4bdf5e){const _0x5b9be5=a81_0x1fbf;switch(_0x4bdf5e){case'table':return formatAsTable(_0x6af161);case _0x5b9be5(0xf9):return formatAsJSON(_0x6af161);case'jsonl':return formatAsJSONL(_0x6af161);case _0x5b9be5(0x117):return formatAsTSV(_0x6af161);default:return formatAsJSON(_0x6af161);}}function a81_0x1fbf(_0x2d8c10,_0x13794f){const _0x581679=a81_0x5816();return a81_0x1fbf=function(_0x1fbf74,_0x3805a3){_0x1fbf74=_0x1fbf74-0xed;let _0x587129=_0x581679[_0x1fbf74];return _0x587129;},a81_0x1fbf(_0x2d8c10,_0x13794f);}export function formatBytes(_0x48fa9d){const _0x4a2b9e=a81_0x1fbf;if(_0x48fa9d===0x0)return _0x4a2b9e(0x10f);const _0x2d73c2=['B','KB','MB','GB','TB'],_0x130200=0x400,_0x1a4e22=Math[_0x4a2b9e(0x107)](Math['log'](_0x48fa9d)/Math[_0x4a2b9e(0x114)](_0x130200)),_0x764567=_0x48fa9d/Math['pow'](_0x130200,_0x1a4e22),_0x4692e5=_0x764567>=0xa?0x1:0x2;return _0x764567[_0x4a2b9e(0x119)](_0x4692e5)+'\x20'+_0x2d73c2[_0x1a4e22];}export function formatRows(_0x5427b8){const _0x1681f7=a81_0x1fbf;if(_0x5427b8==null)return'-';if(_0x5427b8===0x0)return'0';if(_0x5427b8<0x3e8)return _0x5427b8[_0x1681f7(0x11b)]();const _0x3635d3=['','K','M','B','T'],_0x98795e=0x3e8,_0x3d14f2=Math[_0x1681f7(0x107)](Math[_0x1681f7(0x114)](_0x5427b8)/Math[_0x1681f7(0x114)](_0x98795e)),_0x2dd5b7=_0x5427b8/Math[_0x1681f7(0xf4)](_0x98795e,_0x3d14f2),_0x5c69c2=_0x2dd5b7>=0xa?0x1:0x2;return''+_0x2dd5b7[_0x1681f7(0x119)](_0x5c69c2)+_0x3635d3[_0x3d14f2];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x388581,_0x102c2f){const _0x109bb3=a82_0x16b0,_0x94af61=_0x388581();while(!![]){try{const _0x4a16a0=parseInt(_0x109bb3(0xc7))/0x1+-parseInt(_0x109bb3(0xc9))/0x2*(parseInt(_0x109bb3(0xc2))/0x3)+-parseInt(_0x109bb3(0xcd))/0x4*(-parseInt(_0x109bb3(0xd7))/0x5)+parseInt(_0x109bb3(0xd4))/0x6*(-parseInt(_0x109bb3(0xc3))/0x7)+parseInt(_0x109bb3(0xc5))/0x8*(-parseInt(_0x109bb3(0xcf))/0x9)+-parseInt(_0x109bb3(0xca))/0xa*(parseInt(_0x109bb3(0xce))/0xb)+parseInt(_0x109bb3(0xd5))/0xc;if(_0x4a16a0===_0x102c2f)break;else _0x94af61['push'](_0x94af61['shift']());}catch(_0x87de09){_0x94af61['push'](_0x94af61['shift']());}}}(a82_0x66b2,0x62eb4));import{readFile}from'fs/promises';import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x37e895,_0x55fa67){const _0xe001a2=a82_0x16b0;try{if(_0x55fa67){const _0xb9c240=await readFile(_0x37e895,'utf-8');try{return JSON[_0xe001a2(0xcc)](_0xb9c240);}catch(_0xf1f05){throw new SDKError(ErrorCode[_0xe001a2(0xc8)],_0xe001a2(0xd2)+_0x37e895+_0xe001a2(0xd1)+(_0xf1f05 instanceof Error?_0xf1f05[_0xe001a2(0xc0)]:String(_0xf1f05)));}}else try{return JSON[_0xe001a2(0xcc)](_0x37e895);}catch(_0x1ab9e9){throw new SDKError(ErrorCode[_0xe001a2(0xc8)],_0xe001a2(0xc4)+(_0x1ab9e9 instanceof Error?_0x1ab9e9['message']:String(_0x1ab9e9)));}}catch(_0x4a6d09){if(_0x4a6d09 instanceof SDKError)throw _0x4a6d09;if(_0x4a6d09 instanceof Error&&_0xe001a2(0xbf)in _0x4a6d09){const _0x531b4f=_0x4a6d09;if(_0x531b4f[_0xe001a2(0xbf)]===_0xe001a2(0xc6))throw new SDKError(ErrorCode['NOT_FOUND'],'File\x20not\x20found:\x20'+_0x37e895);else{if(_0x531b4f[_0xe001a2(0xbf)]==='EACCES')throw new SDKError(ErrorCode[_0xe001a2(0xd6)],_0xe001a2(0xd3)+_0x37e895);}}throw new SDKError(ErrorCode[_0xe001a2(0xd0)],_0xe001a2(0xc1)+(_0x4a6d09 instanceof Error?_0x4a6d09[_0xe001a2(0xc0)]:String(_0x4a6d09)));}}export async function loadJSONFromOptions(_0x804196,_0x36da09){const _0x3da8ec=a82_0x16b0;if(_0x804196&&_0x36da09)throw new SDKError(ErrorCode[_0x3da8ec(0xc8)],_0x3da8ec(0xcb));if(_0x804196)return await loadJSON(_0x804196,![]);if(_0x36da09)return await loadJSON(_0x36da09,!![]);return undefined;}function a82_0x16b0(_0x5cdc3f,_0x17e8e5){const _0x66b209=a82_0x66b2();return a82_0x16b0=function(_0x16b0d6,_0x4f1fc8){_0x16b0d6=_0x16b0d6-0xbf;let _0x19fdd0=_0x66b209[_0x16b0d6];return _0x19fdd0;},a82_0x16b0(_0x5cdc3f,_0x17e8e5);}function a82_0x66b2(){const _0x538080=['Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','parse','64WQRIAp','8446889ryCGaF','279dDrhXN','INTERNAL','\x27:\x20','Invalid\x20JSON\x20in\x20file\x20\x27','Permission\x20denied\x20reading\x20file:\x20','60gghiuh','15442620PLCSGN','PERMISSION_DENIED','168410XxfRee','code','message','Failed\x20to\x20load\x20JSON:\x20','283746UCMgYv','4011JokvsW','Invalid\x20JSON\x20string:\x20','125048hwNejz','ENOENT','594221HvSXmz','INVALID_ARGUMENT','16cxBvze','10NPYKJm'];a82_0x66b2=function(){return _0x538080;};return a82_0x66b2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x511c31,_0x81ca26){const _0x51c3a3=a83_0x1e11,_0x1b4143=_0x511c31();while(!![]){try{const _0x52fa22=-parseInt(_0x51c3a3(0x193))/0x1+parseInt(_0x51c3a3(0x196))/0x2*(parseInt(_0x51c3a3(0x187))/0x3)+parseInt(_0x51c3a3(0x18f))/0x4*(-parseInt(_0x51c3a3(0x18c))/0x5)+parseInt(_0x51c3a3(0x18e))/0x6*(-parseInt(_0x51c3a3(0x195))/0x7)+parseInt(_0x51c3a3(0x18b))/0x8+-parseInt(_0x51c3a3(0x194))/0x9*(-parseInt(_0x51c3a3(0x183))/0xa)+parseInt(_0x51c3a3(0x18d))/0xb*(parseInt(_0x51c3a3(0x185))/0xc);if(_0x52fa22===_0x81ca26)break;else _0x1b4143['push'](_0x1b4143['shift']());}catch(_0x22d936){_0x1b4143['push'](_0x1b4143['shift']());}}}(a83_0x49ba,0xeee60));export function canCreateAgent(_0x27809d,_0x427b05){const _0x3af311=a83_0x1e11;for(const _0x39e2ce of _0x27809d[_0x3af311(0x192)][_0x3af311(0x188)]){if(_0x39e2ce['targetAgentId']&&!_0x427b05[_0x3af311(0x186)](_0x39e2ce[_0x3af311(0x190)]))return![];}return!![];}export function remapToolIds(_0x3b83a0,_0x355db9,_0x2fd3f0){const _0xf15131=a83_0x1e11;return _0x3b83a0[_0xf15131(0x18a)](_0x130dda=>({..._0x130dda,'targetKnowledgeBaseId':_0x130dda[_0xf15131(0x184)]?_0x355db9[_0xf15131(0x191)](_0x130dda[_0xf15131(0x184)])||_0x130dda[_0xf15131(0x184)]:undefined,'targetAgentId':_0x130dda['targetAgentId']?_0x2fd3f0['get'](_0x130dda[_0xf15131(0x190)])||_0x130dda[_0xf15131(0x190)]:undefined}));}function a83_0x49ba(){const _0x541be3=['8nbUovS','1789170wFmvIN','targetKnowledgeBaseId','588yUhMyL','has','85713RxHesu','tools','1.0','map','5668640KXMImb','5oQWknu','1017797wTgwSd','11273538xuCHNY','4582480iGKctp','targetAgentId','get','attributes','1711450bladiB','18EHTgAP','7EPPZgm'];a83_0x49ba=function(){return _0x541be3;};return a83_0x49ba();}export function remapVariableIds(_0x480476,_0x44ff18){const _0x282115=a83_0x1e11;return _0x480476[_0x282115(0x18a)](_0x6704c2=>({..._0x6704c2,'targetKnowledgeBaseId':_0x44ff18[_0x282115(0x191)](_0x6704c2[_0x282115(0x184)])||_0x6704c2[_0x282115(0x184)]}));}function a83_0x1e11(_0xfbae4e,_0x5d38f6){const _0x49baf9=a83_0x49ba();return a83_0x1e11=function(_0x1e11fa,_0x42665e){_0x1e11fa=_0x1e11fa-0x183;let _0x584d41=_0x49baf9[_0x1e11fa];return _0x584d41;},a83_0x1e11(_0xfbae4e,_0x5d38f6);}export function isSupportedBackupVersion(_0x2e3d4b){const _0x268c92=a83_0x1e11;return _0x2e3d4b===_0x268c92(0x189);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a84_0x2f08(_0x16a849,_0x148113){const _0x41c08a=a84_0x41c0();return a84_0x2f08=function(_0x2f0844,_0xcb3167){_0x2f0844=_0x2f0844-0x118;let _0x29d70d=_0x41c08a[_0x2f0844];return _0x29d70d;},a84_0x2f08(_0x16a849,_0x148113);}const a84_0x5aadd9=a84_0x2f08;(function(_0x4b1bef,_0x18515a){const _0x51c648=a84_0x2f08,_0xf8603c=_0x4b1bef();while(!![]){try{const _0xc84ad8=parseInt(_0x51c648(0x11c))/0x1+-parseInt(_0x51c648(0x121))/0x2*(-parseInt(_0x51c648(0x11f))/0x3)+parseInt(_0x51c648(0x119))/0x4+-parseInt(_0x51c648(0x11d))/0x5+parseInt(_0x51c648(0x11b))/0x6*(parseInt(_0x51c648(0x118))/0x7)+-parseInt(_0x51c648(0x122))/0x8+parseInt(_0x51c648(0x123))/0x9;if(_0xc84ad8===_0x18515a)break;else _0xf8603c['push'](_0xf8603c['shift']());}catch(_0x3e6018){_0xf8603c['push'](_0xf8603c['shift']());}}}(a84_0x41c0,0x434c4));function a84_0x41c0(){const _0x5ce37a=['67032LysPMT','1196980SMLIQJ','toLowerCase','36aPmgVf','88231tcQnZq','2571485NMhdaU','claude-4.5-sonnet','3kHcKUx','claude-4.5-haiku','394262AfzJMw','3518632FAgpcD','5289435liVSRE'];a84_0x41c0=function(){return _0x5ce37a;};return a84_0x41c0();}const MODEL_ALIASES={'haiku':a84_0x5aadd9(0x120),'sonnet':a84_0x5aadd9(0x11e)};export function extractModelAlias(_0x110bc1){const _0x389d39=a84_0x5aadd9,_0x4e6ce6=_0x110bc1['match'](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x4e6ce6)return _0x4e6ce6[0x1][_0x389d39(0x11a)]();return _0x110bc1;}export function resolveModelAlias(_0x51a984){return MODEL_ALIASES[_0x51a984['toLowerCase']()]||_0x51a984;}export function getModelAliases(){return{...MODEL_ALIASES};}
|