@treasuredata/tdx 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +39 -5
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.d.ts +2 -4
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +2 -1
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.d.ts +45 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +1 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +8 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.d.ts +80 -0
- package/dist/sdk/workflow/clone-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/clone-workflow.js +1 -0
- package/dist/sdk/workflow/clone-workflow.js.map +1 -0
- package/dist/sdk/workflow/index.d.ts +94 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.d.ts +77 -0
- package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/pull-workflow.js +1 -0
- package/dist/sdk/workflow/pull-workflow.js.map +1 -0
- package/dist/sdk/workflow/push-workflow.d.ts +66 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/push-workflow.js +1 -0
- package/dist/sdk/workflow/push-workflow.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.d.ts +110 -0
- package/dist/sdk/workflow/tdx-config.d.ts.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -0
- package/dist/sdk/workflow/tdx-config.js.map +1 -0
- package/dist/sdk/workflow/workflow-utils.d.ts +10 -7
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3105c3,_0x1ef427){const _0x1ee935=a145_0x27e5,_0x4d91f6=_0x3105c3();while(!![]){try{const _0x2849fd=-parseInt(_0x1ee935(0x88))/0x1*(parseInt(_0x1ee935(0x83))/0x2)+parseInt(_0x1ee935(0x73))/0x3*(-parseInt(_0x1ee935(0x72))/0x4)+-parseInt(_0x1ee935(0x77))/0x5+-parseInt(_0x1ee935(0x81))/0x6+parseInt(_0x1ee935(0x7c))/0x7+parseInt(_0x1ee935(0x6f))/0x8*(parseInt(_0x1ee935(0x70))/0x9)+parseInt(_0x1ee935(0x7e))/0xa*(parseInt(_0x1ee935(0x71))/0xb);if(_0x2849fd===_0x1ef427)break;else _0x4d91f6['push'](_0x4d91f6['shift']());}catch(_0x10b16d){_0x4d91f6['push'](_0x4d91f6['shift']());}}}(a145_0x524a,0xbf030));import a145_0x18b18c from'string-width';export function stringWidth(_0x3f6fcb){return a145_0x18b18c(_0x3f6fcb);}export function padEnd(_0x7377d9,_0x2e38a5){const _0x195e2b=a145_0x27e5,_0x412068=stringWidth(_0x7377d9);if(_0x412068>=_0x2e38a5)return _0x7377d9;return _0x7377d9+'\x20'[_0x195e2b(0x82)](_0x2e38a5-_0x412068);}function a145_0x524a(){const _0x36ed57=['11037410rnFNQL','test','trim','3134010VNNBQr','repeat','6idXzpf','toLowerCase','Cannot\x20build\x20LIKE\x20pattern\x20from\x20empty\x20string','\x5c$&','replace','426301xVdjFX','USERNAME','Cannot\x20escape\x20empty\x20string\x20literal','8kvGnyX','13576941YdHtOc','11EkgQUs','1948VCURHM','303AZrcjp','floor','padStart','toString','3971100HhElaJ','random','env','length','substring','5703173OIMCzu','USER'];a145_0x524a=function(){return _0x36ed57;};return a145_0x524a();}export function padStart(_0x27488f,_0x552bf9){const _0x50e30a=stringWidth(_0x27488f);if(_0x50e30a>=_0x552bf9)return _0x27488f;return'\x20'['repeat'](_0x552bf9-_0x50e30a)+_0x27488f;}function a145_0x27e5(_0x25b109,_0x204b0b){_0x25b109=_0x25b109-0x6e;const _0x524aaa=a145_0x524a();let _0x27e58e=_0x524aaa[_0x25b109];return _0x27e58e;}export function centerAlign(_0x2cd61f,_0x260b81){const _0x654e64=a145_0x27e5,_0x5ec9e7=stringWidth(_0x2cd61f);if(_0x5ec9e7>_0x260b81){if(_0x260b81<=0x1)return'…'[_0x654e64(0x7b)](0x0,_0x260b81);let _0x488a68=_0x2cd61f;while(stringWidth(_0x488a68+'…')>_0x260b81){_0x488a68=_0x488a68['slice'](0x0,-0x1);}return _0x488a68+'…';}if(_0x5ec9e7===_0x260b81)return _0x2cd61f;const _0x2af631=_0x260b81-_0x5ec9e7,_0x1c2478=Math[_0x654e64(0x74)](_0x2af631/0x2),_0x3647b9=_0x2af631-_0x1c2478;return'\x20'['repeat'](_0x1c2478)+_0x2cd61f+'\x20'[_0x654e64(0x82)](_0x3647b9);}export function escapeStringLiteral(_0x342bf4){const _0x5918d5=a145_0x27e5;if(!_0x342bf4||_0x342bf4[_0x5918d5(0x80)]()[_0x5918d5(0x7a)]===0x0)throw new Error(_0x5918d5(0x6e));const _0x502eac=_0x342bf4[_0x5918d5(0x87)](/'/g,'\x27\x27');return'\x27'+_0x502eac+'\x27';}export function globToLike(_0x4da3d9){const _0x20475c=a145_0x27e5;let _0x3e2982=_0x4da3d9['replace'](/\\/g,'\x5c\x5c')[_0x20475c(0x87)](/%/g,'\x5c%')[_0x20475c(0x87)](/_/g,'\x5c_');return _0x3e2982=_0x3e2982[_0x20475c(0x87)](/\*/g,'%')['replace'](/\?/g,'_'),_0x3e2982;}export function buildLikePattern(_0x2d1582){const _0xe0fc8b=a145_0x27e5;if(!_0x2d1582||_0x2d1582[_0xe0fc8b(0x80)]()[_0xe0fc8b(0x7a)]===0x0)throw new Error(_0xe0fc8b(0x85));const _0xedfbe9=globToLike(_0x2d1582),_0x411d83=_0xedfbe9[_0xe0fc8b(0x87)](/'/g,'\x27\x27');return'\x27'+_0x411d83+'\x27';}export function matchGlobPattern(_0x15b95a,_0x5c6d8b){const _0xdc6b4e=a145_0x27e5,_0x54fb5b=_0x5c6d8b[_0xdc6b4e(0x87)](/[.+^${}()|[\]\\]/g,_0xdc6b4e(0x86))[_0xdc6b4e(0x87)](/\*/g,'.*')[_0xdc6b4e(0x87)](/\?/g,'.'),_0x43aefe=new RegExp('^'+_0x54fb5b+'$');return _0x43aefe[_0xdc6b4e(0x7f)](_0x15b95a);}export function getSanitizedUsername(){const _0x155ff9=a145_0x27e5,_0x37a1c0=process[_0x155ff9(0x79)][_0x155ff9(0x7d)]||process[_0x155ff9(0x79)][_0x155ff9(0x89)]||'unknown';return _0x37a1c0['replace'](/[^a-zA-Z0-9]/g,'')['toLowerCase']();}export function generateRandomHex(){const _0x33f463=a145_0x27e5,_0x365200=Math[_0x33f463(0x74)](Math[_0x33f463(0x78)]()*0xfffff);return _0x365200[_0x33f463(0x76)](0x10)[_0x33f463(0x75)](0x5,'0');}export function sanitizeFileName(_0x5c9717){const _0x28deb4=a145_0x27e5;return _0x5c9717[_0x28deb4(0x84)]()[_0x28deb4(0x87)](/[/\\:*?"<>|]/g,'-')['replace'](/\s+/g,'-')[_0x28deb4(0x87)](/-+/g,'-')[_0x28deb4(0x87)](/^-|-$/g,'');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e1bdf,_0x2c63a0){const _0x50cfce=a146_0x101c,_0x5926e1=_0x1e1bdf();while(!![]){try{const _0x390d8a=-parseInt(_0x50cfce(0x1e8))/0x1+parseInt(_0x50cfce(0x1e2))/0x2*(-parseInt(_0x50cfce(0x1ee))/0x3)+-parseInt(_0x50cfce(0x1da))/0x4+parseInt(_0x50cfce(0x1ef))/0x5*(-parseInt(_0x50cfce(0x1f3))/0x6)+parseInt(_0x50cfce(0x1e4))/0x7*(parseInt(_0x50cfce(0x1e5))/0x8)+-parseInt(_0x50cfce(0x1e0))/0x9+-parseInt(_0x50cfce(0x1ea))/0xa*(-parseInt(_0x50cfce(0x1db))/0xb);if(_0x390d8a===_0x2c63a0)break;else _0x5926e1['push'](_0x5926e1['shift']());}catch(_0x4f37ec){_0x5926e1['push'](_0x5926e1['shift']());}}}(a146_0x1136,0x28eca));function hasWildcard(_0x3f108f){const _0x3ab05f=a146_0x101c;return _0x3f108f[_0x3ab05f(0x1ed)]('*')||_0x3f108f[_0x3ab05f(0x1ed)]('?');}function a146_0x1136(){const _0x2eaf05=['954588kcGFIV','3938HsvQbc','Table\x20name\x20is\x20required\x20for\x20describe\x20operation','Wildcards\x20are\x20not\x20allowed\x20in\x20database\x20name\x20for\x20describe\x20operation','Database\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20databases\x20(e.g.,\x20\x22*.mytable\x22)','push','613638oFjhKt','join','3562AOBOcj','Table\x20part\x20cannot\x20be\x20empty\x20-\x20use\x20\x22*\x22\x20for\x20all\x20tables\x20(e.g.,\x20\x22mydb.*\x22)','105049knHxNY','168rKXNMQ','split','table','302584CHeSYA','catalog','24010ViwoCg','Pattern\x20cannot\x20be\x20just\x20a\x20dot','trim','includes','369yWXRtk','5Gclhgm','length','Invalid\x20pattern\x20format\x20-\x20too\x20many\x20dots\x20(max:\x20catalog.database.table)','database','1071618jXAYcb','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only'];a146_0x1136=function(){return _0x2eaf05;};return a146_0x1136();}export function parseTableReference(_0x16c55c){const _0x17936e=a146_0x101c;if(!_0x16c55c||_0x16c55c['trim']()[_0x17936e(0x1f0)]===0x0)throw new Error(_0x17936e(0x1d9));const _0x3a5d69=_0x16c55c[_0x17936e(0x1ec)](),_0x5d6e52={'original':_0x3a5d69},_0x1348aa=_0x3a5d69[_0x17936e(0x1e6)]('.');if(_0x1348aa['length']===0x1){const _0x22db9a=_0x1348aa[0x0];if(!_0x22db9a)throw new Error(_0x17936e(0x1eb));_0x5d6e52[_0x17936e(0x1e7)]=_0x22db9a;}else{if(_0x1348aa[_0x17936e(0x1f0)]===0x2){const [_0x4f17ca,_0x3dc9fb]=_0x1348aa;if(!_0x4f17ca)throw new Error(_0x17936e(0x1de));if(!_0x3dc9fb)throw new Error(_0x17936e(0x1e3));_0x5d6e52[_0x17936e(0x1f2)]=_0x4f17ca,_0x5d6e52[_0x17936e(0x1e7)]=_0x3dc9fb;}else{if(_0x1348aa[_0x17936e(0x1f0)]===0x3){const [_0x2968f1,_0x2bd498,_0x25a6c3]=_0x1348aa;if(!_0x2968f1||!_0x2bd498||!_0x25a6c3)throw new Error('Invalid\x20catalog.database.table\x20format\x20-\x20all\x20parts\x20must\x20be\x20non-empty');_0x5d6e52['catalog']=_0x2968f1,_0x5d6e52['database']=_0x2bd498,_0x5d6e52[_0x17936e(0x1e7)]=_0x25a6c3;}else throw new Error(_0x17936e(0x1f1));}}return _0x5d6e52;}export function formatTableReference(_0x3accc0){const _0x550a92=a146_0x101c,_0x6c6120=[];return _0x3accc0['catalog']&&_0x6c6120[_0x550a92(0x1df)](_0x3accc0[_0x550a92(0x1e9)]),_0x3accc0[_0x550a92(0x1f2)]&&_0x6c6120['push'](_0x3accc0[_0x550a92(0x1f2)]),_0x3accc0[_0x550a92(0x1e7)]&&_0x6c6120[_0x550a92(0x1df)](_0x3accc0[_0x550a92(0x1e7)]),_0x6c6120[_0x550a92(0x1e1)]('.');}function a146_0x101c(_0x2a8093,_0x51ecbe){_0x2a8093=_0x2a8093-0x1d9;const _0x11363a=a146_0x1136();let _0x101c36=_0x11363a[_0x2a8093];return _0x101c36;}export function validateTableListReference(_0x365f1a){return undefined;}export function validateTableDescribeReference(_0x44a6c4){const _0x121f65=a146_0x101c;if(!_0x44a6c4[_0x121f65(0x1e7)])return _0x121f65(0x1dc);if(_0x44a6c4[_0x121f65(0x1f2)]&&hasWildcard(_0x44a6c4[_0x121f65(0x1f2)]))return _0x121f65(0x1dd);if(hasWildcard(_0x44a6c4[_0x121f65(0x1e7)]))return'Wildcards\x20are\x20not\x20allowed\x20in\x20table\x20name\x20for\x20describe\x20operation';return undefined;}
|
package/dist/utils/tdx-logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a147_0x20f31f=a147_0x3b5e;(function(_0x4b4bb1,_0x3d8de7){const _0x42571c=a147_0x3b5e,_0x4a70de=_0x4b4bb1();while(!![]){try{const _0x26d703=-parseInt(_0x42571c(0x218))/0x1*(parseInt(_0x42571c(0x1fc))/0x2)+-parseInt(_0x42571c(0x1dd))/0x3*(parseInt(_0x42571c(0x219))/0x4)+-parseInt(_0x42571c(0x208))/0x5+-parseInt(_0x42571c(0x1f1))/0x6*(-parseInt(_0x42571c(0x200))/0x7)+-parseInt(_0x42571c(0x217))/0x8+parseInt(_0x42571c(0x1f5))/0x9+parseInt(_0x42571c(0x1ff))/0xa*(parseInt(_0x42571c(0x1ee))/0xb);if(_0x26d703===_0x3d8de7)break;else _0x4a70de['push'](_0x4a70de['shift']());}catch(_0xacc69e){_0x4a70de['push'](_0x4a70de['shift']());}}}(a147_0x53f2,0x3978b));import{createWriteStream,createReadStream}from'fs';import{mkdir,readdir,unlink,stat,rename}from'fs/promises';function a147_0x3b5e(_0x446198,_0x51860b){_0x446198=_0x446198-0x1dd;const _0x53f217=a147_0x53f2();let _0x3b5eb1=_0x53f217[_0x446198];return _0x3b5eb1;}import{join}from'path';import{homedir}from'os';import{createGzip}from'zlib';import{pipeline}from'stream/promises';import a147_0x58826e from'chalk';function safeStringify(_0x446b87){const _0x10ff38=a147_0x3b5e;if(typeof _0x446b87===_0x10ff38(0x1e3))return _0x446b87;if(_0x446b87 instanceof Error)return _0x446b87[_0x10ff38(0x1de)]||_0x446b87['name']+':\x20'+_0x446b87['message'];try{return JSON[_0x10ff38(0x1e6)](_0x446b87,(_0x521a0c,_0x5b3b30)=>{const _0x324ef6=_0x10ff38;if(_0x5b3b30 instanceof Error)return{'name':_0x5b3b30[_0x324ef6(0x1eb)],'message':_0x5b3b30[_0x324ef6(0x1e9)],'stack':_0x5b3b30[_0x324ef6(0x1de)],'cause':_0x5b3b30[_0x324ef6(0x1fd)]};return _0x5b3b30;});}catch{return String(_0x446b87);}}function getTimezoneOffset(){const _0x51be94=a147_0x3b5e,_0x1d6ce9=-new Date()['getTimezoneOffset'](),_0x28a5cd=Math[_0x51be94(0x21a)](Math[_0x51be94(0x213)](_0x1d6ce9)/0x3c),_0x3b79c4=Math[_0x51be94(0x213)](_0x1d6ce9)%0x3c,_0xab3465=_0x1d6ce9>=0x0?'+':'-';return''+_0xab3465+_0x28a5cd[_0x51be94(0x215)]()[_0x51be94(0x203)](0x2,'0')+_0x3b79c4[_0x51be94(0x215)]()[_0x51be94(0x203)](0x2,'0');}function formatTimestamp(){const _0x314a0b=a147_0x3b5e,_0x2bde13=new Date(),_0x47b996=_0x2bde13['getFullYear'](),_0x52aeae=(_0x2bde13[_0x314a0b(0x1e0)]()+0x1)[_0x314a0b(0x215)]()['padStart'](0x2,'0'),_0x23a70c=_0x2bde13[_0x314a0b(0x206)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x2,'0'),_0x8f36ad=_0x2bde13[_0x314a0b(0x20f)]()[_0x314a0b(0x215)]()['padStart'](0x2,'0'),_0x161071=_0x2bde13[_0x314a0b(0x209)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x2,'0'),_0x37758d=_0x2bde13[_0x314a0b(0x20e)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x2,'0'),_0x433c9a=_0x2bde13[_0x314a0b(0x1e4)]()[_0x314a0b(0x215)]()[_0x314a0b(0x203)](0x3,'0'),_0x8f45e0=getTimezoneOffset();return _0x47b996+'-'+_0x52aeae+'-'+_0x23a70c+'\x20'+_0x8f36ad+':'+_0x161071+':'+_0x37758d+'.'+_0x433c9a+_0x8f45e0;}function formatColoredLogEntry(_0x530992,_0x2049ca){const _0x39356e=a147_0x3b5e,_0x1a2327=formatTimestamp(),_0x194e7e=_0x2049ca[_0x39356e(0x1df)](safeStringify)[_0x39356e(0x1f9)]('\x20'),_0x261632=a147_0x58826e['gray'](_0x1a2327);let _0x4aa7cc;switch(_0x530992){case _0x39356e(0x1ec):_0x4aa7cc=a147_0x58826e['cyan']('['+_0x530992+']\x20');break;case'warn':_0x4aa7cc=a147_0x58826e[_0x39356e(0x20b)]('['+_0x530992+']\x20');break;case'error':_0x4aa7cc=a147_0x58826e['red']('['+_0x530992+']');break;case _0x39356e(0x1f6):_0x4aa7cc=a147_0x58826e['gray']('['+_0x530992+']');break;default:_0x4aa7cc='['+_0x530992+']';}return _0x261632+'\x20'+_0x4aa7cc+'\x20'+_0x194e7e;}export var LogLevel;(function(_0x57fd69){const _0x54e4ca=a147_0x3b5e;_0x57fd69[_0x57fd69[_0x54e4ca(0x1f2)]=-0x2]=_0x54e4ca(0x1f2),_0x57fd69[_0x57fd69[_0x54e4ca(0x1ea)]=-0x1]=_0x54e4ca(0x1ea),_0x57fd69[_0x57fd69['INFO']=0x0]=_0x54e4ca(0x1f8),_0x57fd69[_0x57fd69[_0x54e4ca(0x1fe)]=0x1]=_0x54e4ca(0x1fe),_0x57fd69[_0x57fd69[_0x54e4ca(0x1ef)]=0x2]=_0x54e4ca(0x1ef);}(LogLevel||(LogLevel={})));function a147_0x53f2(){const _0x4d1b61=['getSeconds','getHours','warn','init','close','abs','Proxy\x20session\x20ended','toString','split','2155200hRUVaG','35282xIhdQe','16cbkqlu','floor','267798PPRNlC','stack','map','getMonth','tdx.log','toISOString','string','getMilliseconds','Warning:\x20Failed\x20to\x20compress\x20','stringify','write','tdx','message','DEBUG','name','info','test','38742HOIpap','ERROR','logStream','1324926lXyPUw','TRACE','fileOnly','logs','1113048MezKWa','debug','end','INFO','join','logLevel','rotateOldLogs','4HEtEFy','cause','WARN','1810MclfgA','14ombtzY','Warning:\x20Error\x20writing\x20to\x20tdx.log:','error','padStart','mtime','logDir','getDate','.cache','1351825VuZKjC','getMinutes','trace','yellow','Warning:\x20Failed\x20to\x20initialize\x20log\x20files:','filter'];a147_0x53f2=function(){return _0x4d1b61;};return a147_0x53f2();}export class TDXLogger{[a147_0x20f31f(0x1f0)];[a147_0x20f31f(0x205)];[a147_0x20f31f(0x1fa)];[a147_0x20f31f(0x1f3)];constructor(_0x475435=LogLevel['INFO'],_0x5d3956=![]){const _0x5e3376=a147_0x20f31f;this['logDir']=join(homedir(),_0x5e3376(0x207),_0x5e3376(0x1e8),_0x5e3376(0x1f4)),this[_0x5e3376(0x1fa)]=_0x475435,this[_0x5e3376(0x1f3)]=_0x5d3956;}async[a147_0x20f31f(0x211)](){const _0x454b82=a147_0x20f31f;try{await mkdir(this['logDir'],{'recursive':!![]}),await this[_0x454b82(0x1fb)]();const _0x541da3=join(this['logDir'],_0x454b82(0x1e1));this[_0x454b82(0x1f0)]=createWriteStream(_0x541da3,{'flags':'a'}),this['logStream']['on'](_0x454b82(0x202),_0x59e337=>{const _0x784509=_0x454b82;console['error'](_0x784509(0x201),_0x59e337[_0x784509(0x1e9)]);});}catch(_0x53f293){console[_0x454b82(0x202)](_0x454b82(0x20c),_0x53f293);}}async[a147_0x20f31f(0x1fb)](){const _0x241559=a147_0x20f31f;try{const _0x446b2f=await readdir(this[_0x241559(0x205)]),_0x35fef3=new Date()[_0x241559(0x1e2)]()[_0x241559(0x216)]('T')[0x0];if(_0x446b2f['includes'](_0x241559(0x1e1))){const _0xfccd86=join(this[_0x241559(0x205)],_0x241559(0x1e1)),_0x519b48=await stat(_0xfccd86),_0x314d6e=new Date(_0x519b48[_0x241559(0x204)])['toISOString']()[_0x241559(0x216)]('T')[0x0];if(_0x314d6e<_0x35fef3){const _0xc2f982=join(this[_0x241559(0x205)],'tdx-'+_0x314d6e+'.log');await rename(_0xfccd86,_0xc2f982);}}const _0x25f15e=await readdir(this[_0x241559(0x205)]),_0x4b8c97=/^tdx-(\d{4}-\d{2}-\d{2})\.log$/,_0x629b8f=_0x25f15e[_0x241559(0x20d)](_0x75ef2=>_0x4b8c97[_0x241559(0x1ed)](_0x75ef2));for(const _0x24e2b4 of _0x629b8f){const _0x4f4d82=join(this[_0x241559(0x205)],_0x24e2b4),_0x40ae3e=join(this['logDir'],_0x24e2b4+'.gz');try{await pipeline(createReadStream(_0x4f4d82),createGzip(),createWriteStream(_0x40ae3e)),await unlink(_0x4f4d82);}catch(_0x1939c8){console['error'](_0x241559(0x1e5)+_0x24e2b4+':',_0x1939c8);}}}catch{}}[a147_0x20f31f(0x1f6)](..._0x32c585){const _0x440fff=a147_0x20f31f;if(this['logLevel']>LogLevel['DEBUG'])return;const _0x274074=formatColoredLogEntry(_0x440fff(0x1f6),_0x32c585);this[_0x440fff(0x1f0)]?.[_0x440fff(0x1e7)](_0x274074+'\x0a');}['trace'](..._0x428961){const _0x55abcf=a147_0x20f31f;if(this[_0x55abcf(0x1fa)]>LogLevel[_0x55abcf(0x1f2)])return;const _0x3b2272=formatColoredLogEntry(_0x55abcf(0x20a),_0x428961);this[_0x55abcf(0x1f0)]?.['write'](_0x3b2272+'\x0a');}[a147_0x20f31f(0x1ec)](..._0x28ebfe){const _0x4a81c6=a147_0x20f31f;if(this[_0x4a81c6(0x1fa)]>LogLevel[_0x4a81c6(0x1f8)])return;const _0x233c99=formatColoredLogEntry('info',_0x28ebfe);!this[_0x4a81c6(0x1f3)]&&console['log'](_0x233c99),this[_0x4a81c6(0x1f0)]?.['write'](_0x233c99+'\x0a');}['warn'](..._0x3d964b){const _0x1e23c9=a147_0x20f31f;if(this[_0x1e23c9(0x1fa)]>LogLevel[_0x1e23c9(0x1fe)])return;const _0x2e3820=formatColoredLogEntry(_0x1e23c9(0x210),_0x3d964b);!this[_0x1e23c9(0x1f3)]&&console[_0x1e23c9(0x202)](_0x2e3820),this['logStream']?.[_0x1e23c9(0x1e7)](_0x2e3820+'\x0a');}[a147_0x20f31f(0x202)](..._0x4aa749){const _0xec8edf=a147_0x20f31f,_0x4af7d8=formatColoredLogEntry(_0xec8edf(0x202),_0x4aa749);!this[_0xec8edf(0x1f3)]&&console[_0xec8edf(0x202)](_0x4af7d8),this['logStream']?.['write'](_0x4af7d8+'\x0a');}async[a147_0x20f31f(0x212)](){const _0xc7e196=a147_0x20f31f;return this[_0xc7e196(0x1ec)](_0xc7e196(0x214)),new Promise(_0x5f0719=>{const _0x411ce2=_0xc7e196;this['logStream']?this[_0x411ce2(0x1f0)][_0x411ce2(0x1f7)](()=>{_0x5f0719();}):_0x5f0719();});}['getLogPath'](){const _0x1f03b5=a147_0x20f31f;return join(this[_0x1f03b5(0x205)],'tdx.log');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a148_0x18b3(){const _0x562c3e=['cyan','env','1257310GdzHqL','lastCheck','https://registry.npmjs.org/@treasuredata/tdx/latest','Run:','currentVersion','\x0aRun:\x20','1176232CvTNpN','3190DXnfZC','90156ToPxUY','\x0aUpdate\x20available:\x20','dim','6nlHhgg','toISOString','NO_COLOR','getTime','parse','1561hclJKw','gray','now','error','write','Request\x20timeout','stderr','end','version','167BpnPkS','statusCode','npm\x20install\x20-g\x20@treasuredata/tdx@latest','232036xWMQEM','green','1338470wJiwwc','destroy','22mkVPHd','utf-8','stringify','7818fUIffW','HTTP\x20','isTTY','9OOXyTn','latestVersion','yellow'];a148_0x18b3=function(){return _0x562c3e;};return a148_0x18b3();}const a148_0x4df31e=a148_0x1d81;(function(_0x22c5a7,_0x54e1b4){const _0x696e82=a148_0x1d81,_0x33fc51=_0x22c5a7();while(!![]){try{const _0x347702=parseInt(_0x696e82(0x79))/0x1*(-parseInt(_0x696e82(0x92))/0x2)+parseInt(_0x696e82(0x6b))/0x3*(parseInt(_0x696e82(0x7c))/0x4)+-parseInt(_0x696e82(0x8b))/0x5+parseInt(_0x696e82(0x83))/0x6*(parseInt(_0x696e82(0x70))/0x7)+-parseInt(_0x696e82(0x91))/0x8*(-parseInt(_0x696e82(0x86))/0x9)+parseInt(_0x696e82(0x7e))/0xa+parseInt(_0x696e82(0x80))/0xb*(-parseInt(_0x696e82(0x93))/0xc);if(_0x347702===_0x54e1b4)break;else _0x33fc51['push'](_0x33fc51['shift']());}catch(_0x406f15){_0x33fc51['push'](_0x33fc51['shift']());}}}(a148_0x18b3,0x25bf2));import{get}from'https';import{readFileSync,writeFileSync,mkdirSync}from'fs';import{join}from'path';import{gt,valid}from'semver';import a148_0x3ee7db from'chalk';import{getCacheDir}from'../core/config.js';const CACHE_DURATION_MS=0x18*0x3c*0x3c*0x3e8,NPM_REGISTRY_URL=a148_0x4df31e(0x8d),TIMEOUT_MS=0x7d0;function getCacheFilePath(){const _0x33c436=getCacheDir();return join(_0x33c436,'last_version_check');}function readCache(){const _0x4152dc=a148_0x4df31e;try{const _0x338cf9=getCacheFilePath(),_0x268160=readFileSync(_0x338cf9,_0x4152dc(0x81));return JSON[_0x4152dc(0x6f)](_0x268160);}catch{return null;}}function writeCache(_0x4966e6){const _0x4cc182=a148_0x4df31e;try{const _0x46e4f1=getCacheDir();mkdirSync(_0x46e4f1,{'recursive':!![]});const _0x517ad9={'lastCheck':new Date()[_0x4cc182(0x6c)](),'latestVersion':_0x4966e6},_0xa852fd=getCacheFilePath();writeFileSync(_0xa852fd,JSON[_0x4cc182(0x82)](_0x517ad9,null,0x2),'utf-8');}catch{}}function isCacheValid(_0x172f22){const _0x12ac01=a148_0x4df31e;if(!_0x172f22)return![];const _0x527582=new Date(_0x172f22[_0x12ac01(0x8c)])[_0x12ac01(0x6e)](),_0x5c0b23=Date[_0x12ac01(0x72)]();return _0x5c0b23-_0x527582<CACHE_DURATION_MS;}function fetchLatestVersion(){return new Promise((_0x2739e8,_0x1ea47f)=>{const _0x31718b=a148_0x1d81,_0xbf0f81=get(NPM_REGISTRY_URL,_0x546678=>{const _0x2a9c9b=a148_0x1d81;if(_0x546678[_0x2a9c9b(0x7a)]!==0xc8){clearTimeout(_0x74a747),_0x1ea47f(new Error(_0x2a9c9b(0x84)+_0x546678[_0x2a9c9b(0x7a)]));return;}let _0x250aef='';_0x546678['on']('data',_0x2c5014=>{_0x250aef+=_0x2c5014;}),_0x546678['on'](_0x2a9c9b(0x77),()=>{const _0x50088f=_0x2a9c9b;clearTimeout(_0x74a747);try{const _0x469dab=JSON['parse'](_0x250aef);if(!valid(_0x469dab[_0x50088f(0x78)])){_0x1ea47f(new Error('Invalid\x20version\x20format'));return;}_0x2739e8(_0x469dab[_0x50088f(0x78)]);}catch(_0x1f619e){_0x1ea47f(_0x1f619e);}});})['on'](_0x31718b(0x73),_0x55b223=>{clearTimeout(_0x74a747),_0x1ea47f(_0x55b223);}),_0x74a747=setTimeout(()=>{const _0x4b541e=_0x31718b;_0xbf0f81[_0x4b541e(0x7f)](),_0x1ea47f(new Error(_0x4b541e(0x75)));},TIMEOUT_MS);});}export async function checkForUpdate(_0x1795e1){const _0x34d124=a148_0x4df31e;try{const _0x2d5f5e=readCache();if(isCacheValid(_0x2d5f5e)){const _0x23529d=gt(_0x2d5f5e['latestVersion'],_0x1795e1);return{'updateAvailable':_0x23529d,'currentVersion':_0x1795e1,'latestVersion':_0x2d5f5e[_0x34d124(0x87)]};}const _0x25a807=await fetchLatestVersion();writeCache(_0x25a807);const _0x4d90a0=gt(_0x25a807,_0x1795e1);return{'updateAvailable':_0x4d90a0,'currentVersion':_0x1795e1,'latestVersion':_0x25a807};}catch{return null;}}function a148_0x1d81(_0x17467f,_0x14c951){_0x17467f=_0x17467f-0x6a;const _0x18b349=a148_0x18b3();let _0x1d81bc=_0x18b349[_0x17467f];return _0x1d81bc;}export function displayUpdateNotification(_0x4f742d){const _0x17ebf7=a148_0x4df31e;if(!_0x4f742d['updateAvailable'])return;const _0x5de70c=process[_0x17ebf7(0x76)][_0x17ebf7(0x85)]&&!process[_0x17ebf7(0x8a)][_0x17ebf7(0x6d)],_0x50df7a=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x71)]('→'):'→',_0x16853c=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x6a)](_0x4f742d['currentVersion']):_0x4f742d[_0x17ebf7(0x8f)],_0x3e3765=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x7d)](_0x4f742d[_0x17ebf7(0x87)]):_0x4f742d['latestVersion'],_0x5bebfc=_0x5de70c?a148_0x3ee7db[_0x17ebf7(0x89)](_0x17ebf7(0x7b)):_0x17ebf7(0x7b),_0x127298=_0x5de70c?'\x0a'+a148_0x3ee7db[_0x17ebf7(0x88)]('Update\x20available:')+'\x20'+_0x16853c+'\x20'+_0x50df7a+'\x20'+_0x3e3765+'\x0a'+a148_0x3ee7db[_0x17ebf7(0x6a)](_0x17ebf7(0x8e))+'\x20'+_0x5bebfc+'\x0a':_0x17ebf7(0x94)+_0x16853c+'\x20'+_0x50df7a+'\x20'+_0x3e3765+_0x17ebf7(0x90)+_0x5bebfc+'\x0a';process['stderr'][_0x17ebf7(0x74)](_0x127298);}
|