@treasuredata/tdx 0.1.7 → 0.1.8
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/README.md +72 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-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/chat-command.js +1 -1
- package/dist/commands/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/llm-command.js +1 -1
- package/dist/commands/llm-proxy.d.ts +24 -0
- package/dist/commands/llm-proxy.d.ts.map +1 -0
- package/dist/commands/llm-proxy.js +1 -0
- package/dist/commands/llm-proxy.js.map +1 -0
- 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/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/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.d.ts +44 -0
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -0
- package/dist/proxy/anthropic-adapter.js +1 -0
- package/dist/proxy/anthropic-adapter.js.map +1 -0
- package/dist/proxy/server.d.ts +59 -0
- package/dist/proxy/server.d.ts.map +1 -0
- package/dist/proxy/server.js +1 -0
- package/dist/proxy/server.js.map +1 -0
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/anthropic.d.ts +139 -0
- package/dist/types/anthropic.d.ts.map +1 -0
- package/dist/types/anthropic.js +1 -0
- package/dist/types/anthropic.js.map +1 -0
- 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/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.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/workflow-utils.js +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript types for Anthropic Messages API
|
|
3
|
+
* Based on: https://docs.anthropic.com/en/api/messages
|
|
4
|
+
*/
|
|
5
|
+
export interface AnthropicMessage {
|
|
6
|
+
role: 'user' | 'assistant';
|
|
7
|
+
content: string | AnthropicContentBlock[];
|
|
8
|
+
}
|
|
9
|
+
export interface AnthropicContentBlock {
|
|
10
|
+
type: 'text' | 'image' | 'tool_use' | 'tool_result';
|
|
11
|
+
text?: string;
|
|
12
|
+
source?: {
|
|
13
|
+
type: 'base64';
|
|
14
|
+
media_type: string;
|
|
15
|
+
data: string;
|
|
16
|
+
};
|
|
17
|
+
id?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
input?: Record<string, unknown>;
|
|
20
|
+
tool_use_id?: string;
|
|
21
|
+
content?: string | AnthropicContentBlock[];
|
|
22
|
+
is_error?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface AnthropicTool {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
input_schema: {
|
|
28
|
+
type: 'object';
|
|
29
|
+
properties?: Record<string, unknown>;
|
|
30
|
+
required?: string[];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface AnthropicMessagesRequest {
|
|
34
|
+
model: string;
|
|
35
|
+
messages: AnthropicMessage[];
|
|
36
|
+
max_tokens: number;
|
|
37
|
+
metadata?: {
|
|
38
|
+
user_id?: string;
|
|
39
|
+
};
|
|
40
|
+
stop_sequences?: string[];
|
|
41
|
+
stream?: boolean;
|
|
42
|
+
system?: string | AnthropicContentBlock[];
|
|
43
|
+
temperature?: number;
|
|
44
|
+
tool_choice?: {
|
|
45
|
+
type: 'auto' | 'any' | 'tool';
|
|
46
|
+
name?: string;
|
|
47
|
+
};
|
|
48
|
+
tools?: AnthropicTool[];
|
|
49
|
+
top_k?: number;
|
|
50
|
+
top_p?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface AnthropicUsage {
|
|
53
|
+
input_tokens: number;
|
|
54
|
+
output_tokens: number;
|
|
55
|
+
}
|
|
56
|
+
export interface AnthropicMessagesResponse {
|
|
57
|
+
id: string;
|
|
58
|
+
type: 'message';
|
|
59
|
+
role: 'assistant';
|
|
60
|
+
content: AnthropicContentBlock[];
|
|
61
|
+
model: string;
|
|
62
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
|
|
63
|
+
stop_sequence: string | null;
|
|
64
|
+
usage: AnthropicUsage;
|
|
65
|
+
}
|
|
66
|
+
export type AnthropicStreamEvent = AnthropicMessageStartEvent | AnthropicContentBlockStartEvent | AnthropicContentBlockDeltaEvent | AnthropicContentBlockStopEvent | AnthropicMessageDeltaEvent | AnthropicMessageStopEvent | AnthropicPingEvent | AnthropicErrorEvent;
|
|
67
|
+
export interface AnthropicMessageStartEvent {
|
|
68
|
+
type: 'message_start';
|
|
69
|
+
message: {
|
|
70
|
+
id: string;
|
|
71
|
+
type: 'message';
|
|
72
|
+
role: 'assistant';
|
|
73
|
+
content: [];
|
|
74
|
+
model: string;
|
|
75
|
+
stop_reason: null;
|
|
76
|
+
stop_sequence: null;
|
|
77
|
+
usage: {
|
|
78
|
+
input_tokens: number;
|
|
79
|
+
output_tokens: number;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface AnthropicContentBlockStartEvent {
|
|
84
|
+
type: 'content_block_start';
|
|
85
|
+
index: number;
|
|
86
|
+
content_block: {
|
|
87
|
+
type: 'text' | 'tool_use';
|
|
88
|
+
text?: string;
|
|
89
|
+
id?: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
input?: Record<string, unknown>;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface AnthropicContentBlockDeltaEvent {
|
|
95
|
+
type: 'content_block_delta';
|
|
96
|
+
index: number;
|
|
97
|
+
delta: {
|
|
98
|
+
type: 'text_delta' | 'input_json_delta';
|
|
99
|
+
text?: string;
|
|
100
|
+
partial_json?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface AnthropicContentBlockStopEvent {
|
|
104
|
+
type: 'content_block_stop';
|
|
105
|
+
index: number;
|
|
106
|
+
}
|
|
107
|
+
export interface AnthropicMessageDeltaEvent {
|
|
108
|
+
type: 'message_delta';
|
|
109
|
+
delta: {
|
|
110
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
|
|
111
|
+
stop_sequence: string | null;
|
|
112
|
+
};
|
|
113
|
+
usage: {
|
|
114
|
+
output_tokens: number;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export interface AnthropicMessageStopEvent {
|
|
118
|
+
type: 'message_stop';
|
|
119
|
+
}
|
|
120
|
+
export interface AnthropicPingEvent {
|
|
121
|
+
type: 'ping';
|
|
122
|
+
}
|
|
123
|
+
export interface AnthropicErrorEvent {
|
|
124
|
+
type: 'error';
|
|
125
|
+
error: {
|
|
126
|
+
type: string;
|
|
127
|
+
message: string;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export interface AnthropicCountTokensRequest {
|
|
131
|
+
model: string;
|
|
132
|
+
messages: AnthropicMessage[];
|
|
133
|
+
system?: string | AnthropicContentBlock[];
|
|
134
|
+
tools?: AnthropicTool[];
|
|
135
|
+
}
|
|
136
|
+
export interface AnthropicCountTokensResponse {
|
|
137
|
+
input_tokens: number;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=anthropic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/types/anthropic.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/types/anthropic.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/dist/types/endpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a44_0x2039(){const _0x16492e=['https://api-staging.us01.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://api.ap03.treasuredata.com','https://api-staging.treasuredata.co.jp','https://llm-api.eu01.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://api-presto.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://llm-api.treasuredata.com','1080027RrydVF','https://api-development-presto.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://api-staging.ap03.treasuredata.com','6027330qpsBCG','https://api-development-presto.eu01.treasuredata.com','https://api-presto.treasuredata.co.jp','https://llm-api-development.eu01.treasuredata.com','1165574hUHKRH','42UYfCMD','https://api-staging-presto.treasuredata.com','https://api-cdp.treasuredata.com','https://api.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://api-presto.ap02.treasuredata.com','https://api-development.eu01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','4075aOSdId','\x27\x20and\x20site\x20\x27','https://api.treasuredata.co.jp','272xeZKGA','https://llm-api.treasuredata.co.jp','https://api-development-cdp.us01.treasuredata.com','https://api-presto.eu01.treasuredata.com','2226NrOIXr','https://api-development-cdp.eu01.treasuredata.com','273791zrOQqu','961508ZmWxFq','333944laXZpp','https://api-staging-workflow.us01.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://api-development-workflow.eu01.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://api.eu01.treasuredata.com'];a44_0x2039=function(){return _0x16492e;};return a44_0x2039();}const a44_0x3fc647=a44_0x45f9;(function(_0x3e9c42,_0xeac9ab){const _0x39c00d=a44_0x45f9,_0x3d793f=_0x3e9c42();while(!![]){try{const _0x2ac280=parseInt(_0x39c00d(0xfa))/0x1+-parseInt(_0x39c00d(0xdd))/0x2+parseInt(_0x39c00d(0xfb))/0x3*(-parseInt(_0x39c00d(0xde))/0x4)+-parseInt(_0x39c00d(0x103))/0x5*(-parseInt(_0x39c00d(0xda))/0x6)+-parseInt(_0x39c00d(0xdc))/0x7*(-parseInt(_0x39c00d(0xd6))/0x8)+parseInt(_0x39c00d(0xf2))/0x9+-parseInt(_0x39c00d(0xf6))/0xa;if(_0x2ac280===_0xeac9ab)break;else _0x3d793f['push'](_0x3d793f['shift']());}catch(_0x15d0d1){_0x3d793f['push'](_0x3d793f['shift']());}}}(a44_0x2039,0xa2795));export const TD_ENDPOINTS={'us01':a44_0x3fc647(0xfe),'jp01':a44_0x3fc647(0xd5),'eu01':a44_0x3fc647(0xe4),'ap02':'https://api.ap02.treasuredata.com','ap03':a44_0x3fc647(0xeb),'dev-us01':'https://api-development.us01.treasuredata.com','dev-eu01':a44_0x3fc647(0x101),'stg-us01':a44_0x3fc647(0xe5),'stg-jp01':a44_0x3fc647(0xec),'stg-ap03':a44_0x3fc647(0xf5)};function a44_0x45f9(_0x79d68e,_0x49e265){const _0x2039f4=a44_0x2039();return a44_0x45f9=function(_0x45f905,_0x4f39de){_0x45f905=_0x45f905-0xd4;let _0x184623=_0x2039f4[_0x45f905];return _0x184623;},a44_0x45f9(_0x79d68e,_0x49e265);}export const CDP_ENDPOINTS={'us01':a44_0x3fc647(0xfd),'jp01':a44_0x3fc647(0xf0),'eu01':'https://api-cdp.eu01.treasuredata.com','ap02':a44_0x3fc647(0xe0),'ap03':'https://api-cdp.ap03.treasuredata.com','dev-us01':a44_0x3fc647(0xd8),'dev-eu01':a44_0x3fc647(0xdb),'stg-us01':'https://api-staging-cdp.us01.treasuredata.com','stg-jp01':a44_0x3fc647(0xff),'stg-ap03':a44_0x3fc647(0xe6)};export const WORKFLOW_ENDPOINTS={'us01':'https://api-workflow.treasuredata.com','jp01':a44_0x3fc647(0xe1),'eu01':'https://api-workflow.eu01.treasuredata.com','ap02':'https://api-workflow.ap02.treasuredata.com','ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':'https://api-development-workflow.us01.treasuredata.com','dev-eu01':a44_0x3fc647(0xe2),'stg-us01':a44_0x3fc647(0xdf),'stg-jp01':a44_0x3fc647(0xe3),'stg-ap03':a44_0x3fc647(0xe8)};export const TRINO_ENDPOINTS={'us01':a44_0x3fc647(0xef),'jp01':a44_0x3fc647(0xf8),'eu01':a44_0x3fc647(0xd9),'ap02':a44_0x3fc647(0x100),'ap03':'https://api-presto.ap03.treasuredata.com','dev-us01':a44_0x3fc647(0xf3),'dev-eu01':a44_0x3fc647(0xf7),'stg-us01':a44_0x3fc647(0xfc),'stg-jp01':a44_0x3fc647(0xea),'stg-ap03':a44_0x3fc647(0x102)};export const LLM_ENDPOINTS={'us01':a44_0x3fc647(0xf1),'jp01':a44_0x3fc647(0xd7),'eu01':a44_0x3fc647(0xed),'ap02':a44_0x3fc647(0xe9),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':'https://llm-api-development.us01.treasuredata.com','dev-eu01':a44_0x3fc647(0xf9),'stg-us01':a44_0x3fc647(0xe7),'stg-jp01':a44_0x3fc647(0xee),'stg-ap03':a44_0x3fc647(0xf4)};export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS};export function getEndpoint(_0x23a9e3,_0x48f7e3='td'){const _0x2f1721=a44_0x3fc647,_0xa5f01c=API_ENDPOINTS[_0x48f7e3]?.[_0x23a9e3];if(!_0xa5f01c)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x48f7e3+_0x2f1721(0xd4)+_0x23a9e3+'\x27');return _0xa5f01c;}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x3661ba=a45_0x197b;(function(_0x2bf93b,_0x1337fb){const _0x282b28=a45_0x197b,_0x49864f=_0x2bf93b();while(!![]){try{const _0x309c8e=parseInt(_0x282b28(0x11f))/0x1+-parseInt(_0x282b28(0x11e))/0x2*(-parseInt(_0x282b28(0x120))/0x3)+parseInt(_0x282b28(0x122))/0x4+parseInt(_0x282b28(0x11d))/0x5+-parseInt(_0x282b28(0x11b))/0x6+parseInt(_0x282b28(0x121))/0x7+-parseInt(_0x282b28(0x11c))/0x8;if(_0x309c8e===_0x1337fb)break;else _0x49864f['push'](_0x49864f['shift']());}catch(_0x33509e){_0x49864f['push'](_0x49864f['shift']());}}}(a45_0x2ce3,0x5b665));function a45_0x2ce3(){const _0x230fcf=['441144cVWYhN','120138oIhdqQ','1388023GGgltR','1632840UoxCbe','jp01','stg-us01','dev-us01','us01','1657434wTAEeI','6517696PeFEHu','86105WSxbnH','20NfgqAR'];a45_0x2ce3=function(){return _0x230fcf;};return a45_0x2ce3();}function a45_0x197b(_0x24e102,_0x4ff5e2){const _0x2ce3fa=a45_0x2ce3();return a45_0x197b=function(_0x197b13,_0x5dcc66){_0x197b13=_0x197b13-0x119;let _0x17f80a=_0x2ce3fa[_0x197b13];return _0x17f80a;},a45_0x197b(_0x24e102,_0x4ff5e2);}export const SITE_ALIASES={'us':a45_0x3661ba(0x11a),'aws':a45_0x3661ba(0x11a),'jp':a45_0x3661ba(0x123),'aws-tokyo':a45_0x3661ba(0x123),'dev':a45_0x3661ba(0x119),'stg':a45_0x3661ba(0x124)};export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x7268c1,_0x18bd36){const _0x3699a2=a48_0x227d,_0x3a54e8=_0x7268c1();while(!![]){try{const _0x2e6ba4=parseInt(_0x3699a2(0xe3))/0x1+parseInt(_0x3699a2(0xdf))/0x2+-parseInt(_0x3699a2(0xef))/0x3*(-parseInt(_0x3699a2(0xe4))/0x4)+-parseInt(_0x3699a2(0xed))/0x5*(parseInt(_0x3699a2(0xe1))/0x6)+parseInt(_0x3699a2(0xde))/0x7+parseInt(_0x3699a2(0xe0))/0x8*(-parseInt(_0x3699a2(0xe5))/0x9)+-parseInt(_0x3699a2(0xee))/0xa*(parseInt(_0x3699a2(0xe2))/0xb);if(_0x2e6ba4===_0x18bd36)break;else _0x3a54e8['push'](_0x3a54e8['shift']());}catch(_0x4eabd6){_0x3a54e8['push'](_0x3a54e8['shift']());}}}(a48_0x4e9d,0xb543e));function a48_0x227d(_0x2bb8f4,_0x5f0993){const _0x4e9dee=a48_0x4e9d();return a48_0x227d=function(_0x227d2a,_0x5d1211){_0x227d2a=_0x227d2a-0xde;let _0xe8e9ff=_0x4e9dee[_0x227d2a];return _0xe8e9ff;},a48_0x227d(_0x2bb8f4,_0x5f0993);}function a48_0x4e9d(){const _0x1a2507=['trim','Project\x20name\x20cannot\x20be\x20empty','split','Agent\x20name\x20cannot\x20be\x20empty','Agent\x20reference\x20cannot\x20be\x20empty','Invalid\x20agent\x20reference\x20format:\x20','length','710oEQigI','230aphWFS','787560qKmuKn','1002127asaJbU','605094fpQXnl','56WuiCeu','31890zIuVNE','267487QMtkDz','932380BOxuVE','12lHzyuB','140355YMIdDJ'];a48_0x4e9d=function(){return _0x1a2507;};return a48_0x4e9d();}export function parseAgentRef(_0x4b1a91){const _0x2ccd69=a48_0x227d;if(!_0x4b1a91||_0x4b1a91['trim']()==='')throw new Error(_0x2ccd69(0xea));const _0x28980c=_0x4b1a91[_0x2ccd69(0xe6)](),_0x2aa73a=_0x28980c[_0x2ccd69(0xe8)]('/');if(_0x2aa73a[_0x2ccd69(0xec)]===0x1)return{'projectName':_0x2aa73a[0x0],'agentName':undefined};else{if(_0x2aa73a['length']===0x2){const [_0x3bf5dc,_0x5958a2]=_0x2aa73a;if(!_0x3bf5dc||_0x3bf5dc[_0x2ccd69(0xe6)]()==='')throw new Error(_0x2ccd69(0xe7));if(!_0x5958a2||_0x5958a2[_0x2ccd69(0xe6)]()==='')throw new Error(_0x2ccd69(0xe9));return{'projectName':_0x3bf5dc[_0x2ccd69(0xe6)](),'agentName':_0x5958a2[_0x2ccd69(0xe6)]()};}else throw new Error(_0x2ccd69(0xeb)+_0x4b1a91+'.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22');}}
|
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a49_0x4d57(_0x338ddc,_0x110d18){const _0x2ab0d4=a49_0x2ab0();return a49_0x4d57=function(_0x4d5719,_0x176fcc){_0x4d5719=_0x4d5719-0x1f1;let _0xd6ea03=_0x2ab0d4[_0x4d5719];return _0xd6ea03;},a49_0x4d57(_0x338ddc,_0x110d18);}(function(_0x21287c,_0xf9d369){const _0x21f70b=a49_0x4d57,_0xfb9c71=_0x21287c();while(!![]){try{const _0x735ce=parseInt(_0x21f70b(0x1f5))/0x1*(parseInt(_0x21f70b(0x1f7))/0x2)+-parseInt(_0x21f70b(0x1f4))/0x3+-parseInt(_0x21f70b(0x1f9))/0x4*(-parseInt(_0x21f70b(0x1f2))/0x5)+-parseInt(_0x21f70b(0x1fa))/0x6+parseInt(_0x21f70b(0x1f8))/0x7+parseInt(_0x21f70b(0x1fc))/0x8+-parseInt(_0x21f70b(0x1ff))/0x9;if(_0x735ce===_0xf9d369)break;else _0xfb9c71['push'](_0xfb9c71['shift']());}catch(_0xbeefb8){_0xfb9c71['push'](_0xfb9c71['shift']());}}}(a49_0x2ab0,0x4c5b8));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function getCacheDir(){const _0x1669b7=a49_0x4d57;return join(process[_0x1669b7(0x1f3)](),_0x1669b7(0x1fe),_0x1669b7(0x1fd));}function getLastChatIdPath(){const _0x249d8a=a49_0x4d57;return join(getCacheDir(),_0x249d8a(0x1fb));}function ensureCacheDir(){const _0x149384=getCacheDir();!existsSync(_0x149384)&&mkdirSync(_0x149384,{'recursive':!![]});}export function saveLastChatId(_0xc0b22){const _0x5a063b=a49_0x4d57;ensureCacheDir();const _0x3956af=getLastChatIdPath();writeFileSync(_0x3956af,_0xc0b22,_0x5a063b(0x1f1));}function a49_0x2ab0(){const _0x502d14=['3701912wPkqCO','tdx','.cache','599778VgKBPG','utf-8','635cFbDhm','cwd','826923qQkyVl','136RLGnAV','trim','958LhCLRy','1016127ZrEXKO','6824ZDxOUA','1407978qzAaSk','last_chat_id'];a49_0x2ab0=function(){return _0x502d14;};return a49_0x2ab0();}export function loadLastChatId(){const _0x1545c1=a49_0x4d57,_0x2fb528=getLastChatIdPath();if(!existsSync(_0x2fb528))return undefined;try{const _0x42d36a=readFileSync(_0x2fb528,_0x1545c1(0x1f1))[_0x1545c1(0x1f6)]();return _0x42d36a||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x322228=getLastChatIdPath();if(existsSync(_0x322228))try{writeFileSync(_0x322228,'','utf-8');}catch{}}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55b1ac,_0x29c786){const _0x5bd6f3=a50_0x17b1,_0x38f957=_0x55b1ac();while(!![]){try{const _0x5673f2=parseInt(_0x5bd6f3(0x124))/0x1+-parseInt(_0x5bd6f3(0x11d))/0x2+parseInt(_0x5bd6f3(0x116))/0x3*(-parseInt(_0x5bd6f3(0x123))/0x4)+-parseInt(_0x5bd6f3(0x112))/0x5*(parseInt(_0x5bd6f3(0x127))/0x6)+parseInt(_0x5bd6f3(0x110))/0x7*(-parseInt(_0x5bd6f3(0x125))/0x8)+parseInt(_0x5bd6f3(0x117))/0x9*(parseInt(_0x5bd6f3(0x118))/0xa)+parseInt(_0x5bd6f3(0x113))/0xb*(parseInt(_0x5bd6f3(0x12e))/0xc);if(_0x5673f2===_0x29c786)break;else _0x38f957['push'](_0x38f957['shift']());}catch(_0x8d17b){_0x38f957['push'](_0x38f957['shift']());}}}(a50_0x4838,0x3cf17));import{Chalk}from'chalk';export function shouldUseColor(_0x3943a4={}){const _0x5d46b6=a50_0x17b1;if(_0x3943a4['noColor']===!![])return![];if(_0x3943a4['color']===!![])return!![];if(process['env'][_0x5d46b6(0x126)]!==undefined)return![];return process[_0x5d46b6(0x121)][_0x5d46b6(0x11f)]??![];}function getChalk(_0x340b7d={}){if(shouldUseColor(_0x340b7d))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x4cf4b6,_0x2139dc={}){const _0x3c1c55=a50_0x17b1;return getChalk(_0x2139dc)[_0x3c1c55(0x115)](_0x4cf4b6);}export function colorHeader(_0x262957,_0x5cfacd={}){return getChalk(_0x5cfacd)['cyan'](_0x262957);}export function colorType(_0x345307,_0x44eefc={}){return getChalk(_0x44eefc)['dim'](_0x345307);}export function colorJSONKey(_0x34a511,_0xb29780={}){const _0x2ceff4=a50_0x17b1;return getChalk(_0xb29780)[_0x2ceff4(0x119)](_0x34a511);}export function colorJSONString(_0x564af8,_0x49e4e9={}){const _0x335744=a50_0x17b1;return getChalk(_0x49e4e9)[_0x335744(0x11b)](_0x564af8);}function a50_0x17b1(_0x5ac656,_0xbfa0d8){const _0x483865=a50_0x4838();return a50_0x17b1=function(_0x17b1cc,_0x4faf4b){_0x17b1cc=_0x17b1cc-0x110;let _0x30136d=_0x483865[_0x17b1cc];return _0x30136d;},a50_0x17b1(_0x5ac656,_0xbfa0d8);}function a50_0x4838(){const _0x3dfc41=['941204jUTcxE','stringify','isTTY','isArray','stdout','entries','1847164LBkBMR','235198zNwjkn','32aPzKbx','NO_COLOR','18GwziCU','repeat','join','cyan','length','null','boolean','33588EhSMQu','584255GrspRf','map','481110BXqVnN','6072vQgBJa','yellow','dim','3GxtTNf','18oJsWPF','121480jYHdXE','blue','string','green','number'];a50_0x4838=function(){return _0x3dfc41;};return a50_0x4838();}export function colorJSONNumber(_0x3812a2,_0x34d308={}){const _0x5d2e1d=a50_0x17b1;return getChalk(_0x34d308)[_0x5d2e1d(0x12a)](_0x3812a2);}export function colorJSONBoolean(_0x489d6b,_0x3917e2={}){const _0xd6bcff=a50_0x17b1;return getChalk(_0x3917e2)[_0xd6bcff(0x114)](_0x489d6b);}export function colorJSONNull(_0x2a6d76,_0x48d533={}){const _0x42b0a9=a50_0x17b1;return getChalk(_0x48d533)[_0x42b0a9(0x115)](_0x2a6d76);}export function colorizeJSONCompact(_0x39bea8,_0x1b2414={}){const _0xcadf0d=a50_0x17b1;if(!shouldUseColor(_0x1b2414))return JSON[_0xcadf0d(0x11e)](_0x39bea8);if(_0x39bea8===null)return colorJSONNull(_0xcadf0d(0x12c),_0x1b2414);if(typeof _0x39bea8===_0xcadf0d(0x12d))return colorJSONBoolean(String(_0x39bea8),_0x1b2414);if(typeof _0x39bea8===_0xcadf0d(0x11c))return colorJSONNumber(String(_0x39bea8),_0x1b2414);if(typeof _0x39bea8===_0xcadf0d(0x11a))return colorJSONString(JSON[_0xcadf0d(0x11e)](_0x39bea8),_0x1b2414);if(Array[_0xcadf0d(0x120)](_0x39bea8)){if(_0x39bea8['length']===0x0)return'[]';const _0x2a15b4=_0x39bea8[_0xcadf0d(0x111)](_0x4f9e10=>colorizeJSONCompact(_0x4f9e10,_0x1b2414));return'['+_0x2a15b4[_0xcadf0d(0x129)](',')+']';}if(typeof _0x39bea8==='object'){const _0x3fe0fa=Object[_0xcadf0d(0x122)](_0x39bea8);if(_0x3fe0fa[_0xcadf0d(0x12b)]===0x0)return'{}';const _0x3a91f9=_0x3fe0fa['map'](([_0x2aa9ee,_0x8cdcd9])=>{const _0x23d6b9=colorJSONKey(JSON['stringify'](_0x2aa9ee),_0x1b2414),_0x5b59c2=colorizeJSONCompact(_0x8cdcd9,_0x1b2414);return _0x23d6b9+':'+_0x5b59c2;});return'{'+_0x3a91f9[_0xcadf0d(0x129)](',')+'}';}return String(_0x39bea8);}export function colorizeJSON(_0x470b81,_0x22e0f0={},_0x5efb5b=0x0){const _0x3c4462=a50_0x17b1;if(!shouldUseColor(_0x22e0f0))return JSON[_0x3c4462(0x11e)](_0x470b81,null,0x2);const _0xcc9cd1='\x20'[_0x3c4462(0x128)](_0x5efb5b),_0xc9edaf=_0x5efb5b+0x2;if(_0x470b81===null)return colorJSONNull(_0x3c4462(0x12c),_0x22e0f0);if(typeof _0x470b81==='boolean')return colorJSONBoolean(String(_0x470b81),_0x22e0f0);if(typeof _0x470b81==='number')return colorJSONNumber(String(_0x470b81),_0x22e0f0);if(typeof _0x470b81===_0x3c4462(0x11a))return colorJSONString(JSON[_0x3c4462(0x11e)](_0x470b81),_0x22e0f0);if(Array[_0x3c4462(0x120)](_0x470b81)){if(_0x470b81[_0x3c4462(0x12b)]===0x0)return'[]';const _0x125b72=_0x470b81[_0x3c4462(0x111)](_0x3349de=>{const _0x46ef17=_0x3c4462,_0x5c8ad3=colorizeJSON(_0x3349de,_0x22e0f0,_0xc9edaf);return''+'\x20'[_0x46ef17(0x128)](_0xc9edaf)+_0x5c8ad3;});return'[\x0a'+_0x125b72[_0x3c4462(0x129)](',\x0a')+('\x0a'+_0xcc9cd1+']');}if(typeof _0x470b81==='object'){const _0x36e946=Object[_0x3c4462(0x122)](_0x470b81);if(_0x36e946[_0x3c4462(0x12b)]===0x0)return'{}';const _0x8e1d60=_0x36e946[_0x3c4462(0x111)](([_0x1ba1f5,_0x3c20c7])=>{const _0xba9399=_0x3c4462,_0x5cf856=colorJSONKey(JSON[_0xba9399(0x11e)](_0x1ba1f5),_0x22e0f0),_0x47f553=colorizeJSON(_0x3c20c7,_0x22e0f0,_0xc9edaf);return''+'\x20'[_0xba9399(0x128)](_0xc9edaf)+_0x5cf856+':\x20'+_0x47f553;});return'{\x0a'+_0x8e1d60['join'](',\x0a')+('\x0a'+_0xcc9cd1+'}');}return String(_0x470b81);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5316d1,_0x5d4113){const _0x4abe55=a51_0x5822,_0x38a5b8=_0x5316d1();while(!![]){try{const _0x3c3558=-parseInt(_0x4abe55(0x119))/0x1+-parseInt(_0x4abe55(0x124))/0x2*(-parseInt(_0x4abe55(0x116))/0x3)+-parseInt(_0x4abe55(0x121))/0x4+parseInt(_0x4abe55(0x11f))/0x5+parseInt(_0x4abe55(0x11d))/0x6+parseInt(_0x4abe55(0x114))/0x7+parseInt(_0x4abe55(0x10d))/0x8;if(_0x3c3558===_0x5d4113)break;else _0x38a5b8['push'](_0x38a5b8['shift']());}catch(_0x51436a){_0x38a5b8['push'](_0x38a5b8['shift']());}}}(a51_0x5666,0xa5751));import{writeFileSync}from'fs';import{spawn}from'child_process';function a51_0x5822(_0x1a823b,_0x281305){const _0x56663c=a51_0x5666();return a51_0x5822=function(_0x58220d,_0x494771){_0x58220d=_0x58220d-0x102;let _0xbf0124=_0x56663c[_0x58220d];return _0xbf0124;},a51_0x5822(_0x1a823b,_0x281305);}function a51_0x5666(){const _0x149e0f=['725156uplDZr','./formatters.js','double','noColor','4619826nrQlAz','FINISHED','4151775DNKULu','error','2286056WWuMJg','boolean','-FXRSn','352378NMjzXV','push','Results\x20saved\x20to\x20','format','sdk-result','resolve','isInteger','varchar','entries','stdin','limit','jsonl','bigint','output','inherit','table','1335448lhBOGp','log','number','isTTY','json','stdout','spawn','216559GZturi','write','3iHEQEi','length','color'];a51_0x5666=function(){return _0x149e0f;};return a51_0x5666();}import{resolveOutputFormat}from'./format-detector.js';export function parseOutputOptions(_0x13c39f){const _0x3f4c86=a51_0x5822;return{'format':_0x13c39f[_0x3f4c86(0x127)]||'table','output':_0x13c39f['output']||'','limit':_0x13c39f['limit'],'color':_0x13c39f[_0x3f4c86(0x118)],'noColor':_0x13c39f[_0x3f4c86(0x11c)]};}function convertSDKResultToQueryResult(_0x542d11){const _0x7ed09c=a51_0x5822,_0xe8068c=[];if(_0x542d11[_0x7ed09c(0x117)]>0x0){const _0x3cb580=_0x542d11[0x0];for(const [_0x542fb8,_0x4d07bf]of Object[_0x7ed09c(0x105)](_0x3cb580)){let _0x1c01a2=_0x7ed09c(0x104);if(typeof _0x4d07bf===_0x7ed09c(0x10f))_0x1c01a2=Number[_0x7ed09c(0x103)](_0x4d07bf)?_0x7ed09c(0x109):_0x7ed09c(0x11b);else{if(typeof _0x4d07bf===_0x7ed09c(0x122))_0x1c01a2=_0x7ed09c(0x122);else _0x4d07bf===null&&(_0x1c01a2='varchar');}_0xe8068c[_0x7ed09c(0x125)]({'name':_0x542fb8,'type':_0x1c01a2});}}return{'queryId':_0x7ed09c(0x128),'columns':_0xe8068c,'data':_0x542d11,'stats':{'state':_0x7ed09c(0x11e),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x542d11[_0x7ed09c(0x117)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x271567,_0x2bbcba){const _0x53a0a5=convertSDKResultToQueryResult(_0x271567);return formatQueryOutput(_0x53a0a5,_0x2bbcba);}export async function formatQueryOutput(_0x452926,_0x9db031){const _0x42fab2=a51_0x5822,{format:_0x20b5ef,limit:_0x266eca,output:_0x22139b,color:_0x425a56,noColor:_0x20be4}=_0x9db031,_0x4ee443=Boolean(_0x22139b)&&!_0x425a56,_0x37a89f={'color':_0x425a56,'noColor':_0x20be4||_0x4ee443};if(_0x20b5ef===_0x42fab2(0x10c)){const {formatAsTable:_0x485128}=await import(_0x42fab2(0x11a)),_0x174aa2=shouldUseLess(_0x20b5ef,_0x22139b);return _0x485128(_0x452926,_0x266eca,_0x174aa2,_0x37a89f);}else{if(_0x20b5ef===_0x42fab2(0x111)){const {formatAsJSON:_0x261c71}=await import(_0x42fab2(0x11a));return _0x261c71(_0x452926,_0x37a89f);}else{if(_0x20b5ef===_0x42fab2(0x108)){const {formatAsJSONL:_0x18e64b}=await import(_0x42fab2(0x11a));return _0x18e64b(_0x452926,_0x37a89f);}else{const {formatQueryResult:_0x3daa1d}=await import('./formatters.js');return _0x3daa1d(_0x452926,_0x20b5ef);}}}}function shouldUseLess(_0x14b190,_0x3ecf5f){const _0xe85614=a51_0x5822;return _0x14b190==='table'&&process[_0xe85614(0x112)][_0xe85614(0x110)]&&!_0x3ecf5f;}export function resolveOutputOptions(_0x1b75d6){const _0x584af7=a51_0x5822,_0x3aa22f=resolveOutputFormat(_0x1b75d6['format'],_0x1b75d6[_0x584af7(0x10a)],_0x584af7(0x10c));let _0x1b21a8=typeof _0x1b75d6[_0x584af7(0x107)]===_0x584af7(0x10f)?_0x1b75d6[_0x584af7(0x107)]:parseInt(_0x1b75d6[_0x584af7(0x107)]||'40',0xa);const _0x5da55a=_0x1b75d6[_0x584af7(0x10a)]||'';return shouldUseLess(_0x3aa22f,_0x5da55a)&&(_0x1b21a8=Infinity),{'format':_0x3aa22f,'output':_0x5da55a,'limit':_0x1b21a8,'color':_0x1b75d6[_0x584af7(0x118)],'noColor':_0x1b75d6[_0x584af7(0x11c)]};}export function writeOutput(_0x5b3f29,_0x39a576,_0x4025af){const _0x4cf00c=a51_0x5822;return _0x39a576?(writeFileSync(_0x39a576,_0x5b3f29),console[_0x4cf00c(0x120)](_0x4cf00c(0x126)+_0x39a576),Promise[_0x4cf00c(0x102)]()):shouldUseLess(_0x4025af||'','')?new Promise(_0x5d7917=>{const _0x16de9e=_0x4cf00c,_0x43599c=spawn('less',[_0x16de9e(0x123)],{'stdio':['pipe',_0x16de9e(0x10b),_0x16de9e(0x10b)]});let _0x5af6e9=![];_0x43599c['on']('error',()=>{const _0xbb43ac=_0x16de9e;!_0x5af6e9&&(_0x5af6e9=!![],console[_0xbb43ac(0x10e)](_0x5b3f29),_0x5d7917());}),_0x43599c['on']('close',()=>{!_0x5af6e9&&(_0x5af6e9=!![],_0x5d7917());}),_0x43599c['on'](_0x16de9e(0x113),()=>{const _0x31f041=_0x16de9e;!_0x5af6e9&&_0x43599c['stdin']&&(_0x43599c[_0x31f041(0x106)]['on'](_0x31f041(0x120),()=>{}),_0x43599c['stdin'][_0x31f041(0x115)](_0x5b3f29),_0x43599c[_0x31f041(0x106)]['end']());}),!_0x43599c[_0x16de9e(0x106)]&&(!_0x5af6e9&&(_0x5af6e9=!![],console[_0x16de9e(0x10e)](_0x5b3f29),_0x5d7917()));}):(console[_0x4cf00c(0x10e)](_0x5b3f29),Promise[_0x4cf00c(0x102)]());}export async function handleSDKOutput(_0xda9661,_0x49ec35){const _0x3ecebf=a51_0x5822,_0x60ca19=resolveOutputOptions(_0x49ec35),_0x16ed88=await formatSDKOutput(_0xda9661,_0x60ca19);await writeOutput(_0x16ed88,_0x60ca19[_0x3ecebf(0x10a)]||undefined,_0x60ca19[_0x3ecebf(0x127)]);}export async function handleQueryOutput(_0x4dc035,_0xc9a2b4){const _0x3c74b5=a51_0x5822,_0xd0d931=resolveOutputOptions(_0xc9a2b4),_0xfc9000=await formatQueryOutput(_0x4dc035,_0xd0d931);await writeOutput(_0xfc9000,_0xd0d931[_0x3c74b5(0x10a)]||undefined,_0xd0d931['format']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x50269d,_0x4fbac6){const _0x472a96=a52_0x4b66,_0x5ba60a=_0x50269d();while(!![]){try{const _0x1b41c6=-parseInt(_0x472a96(0x144))/0x1*(-parseInt(_0x472a96(0x159))/0x2)+-parseInt(_0x472a96(0x14d))/0x3+parseInt(_0x472a96(0x14c))/0x4+-parseInt(_0x472a96(0x152))/0x5*(parseInt(_0x472a96(0x145))/0x6)+parseInt(_0x472a96(0x14f))/0x7*(parseInt(_0x472a96(0x146))/0x8)+parseInt(_0x472a96(0x14e))/0x9+-parseInt(_0x472a96(0x147))/0xa*(parseInt(_0x472a96(0x155))/0xb);if(_0x1b41c6===_0x4fbac6)break;else _0x5ba60a['push'](_0x5ba60a['shift']());}catch(_0x5b7b27){_0x5ba60a['push'](_0x5ba60a['shift']());}}}(a52_0x2c16,0x39007));import*as a52_0xfbbfb5 from'node:fs';function a52_0x4b66(_0x427264,_0x256ef1){const _0x2c165f=a52_0x2c16();return a52_0x4b66=function(_0x4b66c2,_0x21ba32){_0x4b66c2=_0x4b66c2-0x142;let _0x5c304d=_0x2c165f[_0x4b66c2];return _0x5c304d;},a52_0x4b66(_0x427264,_0x256ef1);}import*as a52_0xb9e7fe from'node:path';export function setSecureFilePermissions(_0x2bdf0f){const _0x5302e8=a52_0x4b66;try{a52_0xfbbfb5[_0x5302e8(0x149)](_0x2bdf0f,0x180);}catch{console[_0x5302e8(0x151)]('Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'+_0x2bdf0f);}}export function setSecureDirectoryPermissions(_0x2da823){const _0x1b8573=a52_0x4b66;try{a52_0xfbbfb5[_0x1b8573(0x149)](_0x2da823,0x1c0);}catch{console['warn'](_0x1b8573(0x14a)+_0x2da823);}}export function createSecureDirectory(_0x5a0a10){const _0x222f72=a52_0x4b66;!a52_0xfbbfb5[_0x222f72(0x156)](_0x5a0a10)&&(a52_0xfbbfb5[_0x222f72(0x14b)](_0x5a0a10,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x5a0a10));}function a52_0x2c16(){const _0x5d4b1a=['statSync','chmodSync','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','mkdirSync','775400tueQkh','171927BHesnX','3105225acfkie','399189LFlAQr','Warning:\x20','warn','129605iWATiA','toString','mode','584122rEiKUN','existsSync','\x20has\x20insecure\x20permissions\x20(','dirname','28bBujlq','Should\x20be\x200600\x20or\x20more\x20restrictive.',').\x20','10481PvzsAj','24hxOvtb','56tFxMPL','130kVPxoF'];a52_0x2c16=function(){return _0x5d4b1a;};return a52_0x2c16();}export function validateSecureFilePermissions(_0x54962a){const _0x523411=a52_0x4b66;try{const _0x308bb6=a52_0xfbbfb5[_0x523411(0x148)](_0x54962a),_0x14e56d=_0x308bb6[_0x523411(0x154)]&0x1ff,_0x453ac4=(_0x14e56d&0x3f)!==0x0;if(_0x453ac4)return console[_0x523411(0x151)](_0x523411(0x150)+_0x54962a+_0x523411(0x157)+_0x14e56d[_0x523411(0x153)](0x8)+_0x523411(0x143)+_0x523411(0x142)),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x290f03,_0x48afaa){const _0x2d4117=a52_0x4b66,_0x1a9bb0=a52_0xb9e7fe[_0x2d4117(0x158)](_0x290f03);createSecureDirectory(_0x1a9bb0),a52_0xfbbfb5['writeFileSync'](_0x290f03,_0x48afaa,{'mode':0x180}),setSecureFilePermissions(_0x290f03);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x50c92e,_0x4132a8){const _0xbf1a5c=a53_0x5f48,_0x3965e8=_0x50c92e();while(!![]){try{const _0x37728c=parseInt(_0xbf1a5c(0xcc))/0x1+parseInt(_0xbf1a5c(0xc7))/0x2*(-parseInt(_0xbf1a5c(0xc5))/0x3)+-parseInt(_0xbf1a5c(0xd3))/0x4+parseInt(_0xbf1a5c(0xc6))/0x5*(-parseInt(_0xbf1a5c(0xcf))/0x6)+parseInt(_0xbf1a5c(0xd1))/0x7*(-parseInt(_0xbf1a5c(0xce))/0x8)+-parseInt(_0xbf1a5c(0xc8))/0x9*(-parseInt(_0xbf1a5c(0xd6))/0xa)+parseInt(_0xbf1a5c(0xcd))/0xb*(parseInt(_0xbf1a5c(0xca))/0xc);if(_0x37728c===_0x4132a8)break;else _0x3965e8['push'](_0x3965e8['shift']());}catch(_0xa3f012){_0x3965e8['push'](_0x3965e8['shift']());}}}(a53_0x55f4,0xacb92));function a53_0x55f4(){const _0x2f8679=['11FXpfOD','344HDutZX','838254mXUBhq','json','140189ARBxud','split','4172744BwdHfD','toLowerCase','text','10JnJVxv','pop','jsonl','951RYJKwl','35vwMKfN','6634fVcVYg','2294181FGohKU','tsv','38559900CwCcHM','txt','1173039TCTDMU'];a53_0x55f4=function(){return _0x2f8679;};return a53_0x55f4();}export function detectFormatFromExtension(_0x3c3d14){const _0x33da90=a53_0x5f48,_0x566577=_0x3c3d14[_0x33da90(0xd4)]()[_0x33da90(0xd2)]('.')[_0x33da90(0xc3)]();switch(_0x566577){case _0x33da90(0xd0):return _0x33da90(0xd0);case _0x33da90(0xc4):return _0x33da90(0xc4);case _0x33da90(0xc9):case'tab':return'tsv';case _0x33da90(0xcb):case _0x33da90(0xd5):return'table';default:return undefined;}}function a53_0x5f48(_0x17e41c,_0x2e6f4a){const _0x55f46c=a53_0x55f4();return a53_0x5f48=function(_0x5f483a,_0x2166c9){_0x5f483a=_0x5f483a-0xc3;let _0x24ed19=_0x55f46c[_0x5f483a];return _0x24ed19;},a53_0x5f48(_0x17e41c,_0x2e6f4a);}export function resolveOutputFormat(_0xa22ba0,_0x18c44b,_0x5b73e2){if(_0xa22ba0)return _0xa22ba0;if(_0x18c44b){const _0x3bca2d=detectFormatFromExtension(_0x18c44b);if(_0x3bca2d)return _0x3bca2d;}return _0x5b73e2;}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c2c12,_0x129f0e){const _0x2289e7=a54_0x6a4f,_0x44d700=_0x1c2c12();while(!![]){try{const _0x258de8=parseInt(_0x2289e7(0x177))/0x1+parseInt(_0x2289e7(0x180))/0x2+parseInt(_0x2289e7(0x176))/0x3+parseInt(_0x2289e7(0x196))/0x4*(parseInt(_0x2289e7(0x199))/0x5)+-parseInt(_0x2289e7(0x18f))/0x6+parseInt(_0x2289e7(0x187))/0x7+-parseInt(_0x2289e7(0x188))/0x8;if(_0x258de8===_0x129f0e)break;else _0x44d700['push'](_0x44d700['shift']());}catch(_0x12d137){_0x44d700['push'](_0x44d700['shift']());}}}(a54_0x431c,0x815da));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 _0x2998ba=a54_0x6a4f;return process[_0x2998ba(0x16f)][_0x2998ba(0x193)]||Infinity;}export function formatAsTable(_0x25cfd5,_0x23195f=DEFAULT_MAX_DISPLAY_ROWS,_0x2dfdd9=![],_0x142e12={}){const _0xd8ed14=a54_0x6a4f;if(_0x25cfd5[_0xd8ed14(0x183)][_0xd8ed14(0x197)]===0x0)return _0xd8ed14(0x18a);const _0x4d004c=_0x25cfd5[_0xd8ed14(0x193)][_0xd8ed14(0x17a)](_0x5ce35c=>_0x5ce35c[_0xd8ed14(0x18c)]),_0x5f4404=_0x25cfd5[_0xd8ed14(0x193)][_0xd8ed14(0x17a)](_0x4093be=>simplifyType(_0x4093be[_0xd8ed14(0x170)])),_0x127dd3=_0x25cfd5[_0xd8ed14(0x183)][_0xd8ed14(0x190)](0x0,_0x23195f),_0x494275=_0x25cfd5['data'][_0xd8ed14(0x197)],_0x5694aa=_0x494275>_0x23195f,_0x5b56a5=[],_0x60c26c=getTerminalWidth(),_0x5bad11=_0x60c26c!==Infinity,_0x9b37cd=0x32;let _0x52dc6d=_0x4d004c[_0xd8ed14(0x17a)]((_0x4bcf5a,_0x5992e3)=>{const _0x1030e5=_0xd8ed14,_0x1f9dc7=stringWidth(_0x5f4404[_0x5992e3]),_0x5e4f38=Math['max'](..._0x127dd3[_0x1030e5(0x17a)](_0x2d84fa=>{const _0x38011c=_0x2d84fa[_0x4bcf5a];return stringWidth(formatValue(_0x38011c));})),_0x5a2d40=Math[_0x1030e5(0x195)](stringWidth(_0x4bcf5a),_0x1f9dc7,_0x5e4f38);return _0x2dfdd9?_0x5a2d40:Math[_0x1030e5(0x198)](_0x5a2d40,_0x9b37cd);});if(_0x5bad11&&!_0x2dfdd9&&_0x4d004c[_0xd8ed14(0x197)]>0x0){const _0x299e1e=_0x595737=>{let _0x182542=0x1;for(const _0x2f9d98 of _0x595737){_0x182542+=_0x2f9d98+0x3;}return _0x182542+0x1;};let _0x312e37=_0x299e1e(_0x52dc6d);if(_0x312e37>_0x60c26c){const _0x7e8006=0x3;for(let _0x2a4975=_0x52dc6d[_0xd8ed14(0x197)]-0x1;_0x2a4975>=0x0;_0x2a4975--){_0x312e37=_0x299e1e(_0x52dc6d);if(_0x312e37<=_0x60c26c)break;const _0x338be1=_0x52dc6d[_0x2a4975],_0x2e8b2d=_0x312e37-_0x60c26c,_0x4100e4=_0x338be1-_0x7e8006,_0x170308=Math[_0xd8ed14(0x198)](_0x2e8b2d,_0x4100e4);_0x170308>0x0&&(_0x52dc6d[_0x2a4975]=_0x338be1-_0x170308);}}}const _0x2f7d21=_0x4d004c,_0x3b2864=_0x5f4404,_0x8f8b40=_0x52dc6d,_0x1c39f3=_0x52dc6d;_0x5b56a5['push'](colorBorder('┌'+_0x1c39f3[_0xd8ed14(0x17a)](_0x51601d=>'─'[_0xd8ed14(0x175)](_0x51601d+0x2))['join']('┬')+'┐',_0x142e12));const _0xf83bc=_0x2f7d21['map']((_0x484e59,_0x47feda)=>centerAlign(_0x484e59,_0x8f8b40[_0x47feda]));_0x5b56a5[_0xd8ed14(0x184)](colorBorder('│',_0x142e12)+'\x20'+_0xf83bc[_0xd8ed14(0x185)]('\x20'+colorBorder('│',_0x142e12)+'\x20')+'\x20'+colorBorder('│',_0x142e12));const _0x1a6c4d=_0x3b2864[_0xd8ed14(0x17a)]((_0x22595e,_0x533014)=>colorType(centerAlign(_0x22595e,_0x8f8b40[_0x533014]),_0x142e12));_0x5b56a5[_0xd8ed14(0x184)](colorBorder('│',_0x142e12)+'\x20'+_0x1a6c4d[_0xd8ed14(0x185)]('\x20'+colorBorder('│',_0x142e12)+'\x20')+'\x20'+colorBorder('│',_0x142e12)),_0x5b56a5[_0xd8ed14(0x184)](colorBorder('├'+_0x1c39f3[_0xd8ed14(0x17a)](_0x5bc864=>'─'['repeat'](_0x5bc864+0x2))[_0xd8ed14(0x185)]('┼')+'┤',_0x142e12));const _0x1bcc9b=(_0x10f598,_0xf05ee7)=>{const _0x4e220c=_0xd8ed14,_0x154274=stringWidth(_0x10f598);if(_0x154274<=_0xf05ee7)return _0x10f598;let _0x991998=_0x10f598;while(stringWidth(_0x991998+'…')>_0xf05ee7&&_0x991998['length']>0x0){_0x991998=_0x991998[_0x4e220c(0x190)](0x0,-0x1);}return _0x991998+'…';};_0x127dd3[_0xd8ed14(0x181)](_0x2d655d=>{const _0x31d4d3=_0xd8ed14,_0x33a0ad=_0x4d004c[_0x31d4d3(0x17a)]((_0x20c915,_0x15fd50)=>{const _0x1d14eb=_0x31d4d3,_0x2189b7=_0x2d655d[_0x20c915],_0x2e9d69=formatValue(_0x2189b7),_0x4c1b41=_0x8f8b40[_0x15fd50],_0x277f78=_0x1bcc9b(_0x2e9d69,_0x4c1b41),_0x19f4bb=typeof _0x2189b7===_0x1d14eb(0x186)||typeof _0x2189b7===_0x1d14eb(0x18e)&&/^-?\d+$/['test'](_0x2189b7);return _0x19f4bb?padStart(_0x277f78,_0x4c1b41):padEnd(_0x277f78,_0x4c1b41);});_0x5b56a5[_0x31d4d3(0x184)](colorBorder('│',_0x142e12)+'\x20'+_0x33a0ad[_0x31d4d3(0x185)]('\x20'+colorBorder('│',_0x142e12)+'\x20')+'\x20'+colorBorder('│',_0x142e12));});const _0xd88683=_0x1c39f3['reduce']((_0x580eed,_0x248249)=>_0x580eed+_0x248249+0x3,-0x1);_0x5b56a5['push'](colorBorder('├'+_0x1c39f3[_0xd8ed14(0x17a)](_0x4717a4=>'─'[_0xd8ed14(0x175)](_0x4717a4+0x2))[_0xd8ed14(0x185)]('┴')+'┤',_0x142e12));let _0x12799;_0x5694aa?_0x12799=_0x494275+_0xd8ed14(0x173)+_0x23195f+_0xd8ed14(0x171):_0x12799=_0x494275+_0xd8ed14(0x17b)+(_0x494275===0x1?'':'s');const _0x3abe8b=_0x12799[_0xd8ed14(0x18d)](_0xd88683-0x2);return _0x5b56a5['push'](colorBorder('│',_0x142e12)+'\x20'+_0x3abe8b+'\x20'+colorBorder('│',_0x142e12)),_0x5b56a5[_0xd8ed14(0x184)](colorBorder('└'+'─'[_0xd8ed14(0x175)](_0xd88683)+'┘',_0x142e12)),_0x5b56a5[_0xd8ed14(0x185)]('\x0a');}function simplifyType(_0x3376f0){const _0x5d59a2=a54_0x6a4f,_0x5074a3={'varchar':_0x5d59a2(0x18e),'bigint':_0x5d59a2(0x174),'integer':'int','double':_0x5d59a2(0x191),'boolean':_0x5d59a2(0x16d),'date':'date','timestamp':_0x5d59a2(0x178),'array':_0x5d59a2(0x16c),'map':_0x5d59a2(0x17a),'row':_0x5d59a2(0x194)},_0x397923=_0x3376f0[_0x5d59a2(0x17f)]();for(const [_0x1251ed,_0x31c99a]of Object['entries'](_0x5074a3)){if(_0x397923['startsWith'](_0x1251ed))return _0x31c99a;}return _0x3376f0[_0x5d59a2(0x197)]>0xa?_0x3376f0[_0x5d59a2(0x189)](0x0,0xa):_0x3376f0;}export function formatAsJSON(_0x281008,_0x262b0d={}){const _0x5ce748=a54_0x6a4f;if(_0x281008[_0x5ce748(0x183)][_0x5ce748(0x197)]===0x0)return'[]';if(shouldUseColor(_0x262b0d))return colorizeJSON(_0x281008[_0x5ce748(0x183)],_0x262b0d);const _0x16562a=_0x281008['data'][_0x5ce748(0x17a)](_0x344c05=>'\x20\x20'+JSON['stringify'](_0x344c05));return'[\x0a'+_0x16562a[_0x5ce748(0x185)](',\x0a')+'\x0a]';}function a54_0x431c(){const _0x11d11f=['replace','data','push','join','number','5945338bzxnnZ','16386688khiCsX','substring','No\x20rows\x20returned','jsonl','name','padEnd','string','804420ILSecu','slice','double','object','columns','row','max','1355596iidmuN','length','min','15AtlnwO','array','bool','table','stdout','type','\x20shown)','boolean','\x20rows\x20(','long','repeat','2092317vSbgwZ','115080qXIIaF','timestamp','json','map','\x20row','false','stringify','toISOString','toLowerCase','67476bbmkIi','forEach'];a54_0x431c=function(){return _0x11d11f;};return a54_0x431c();}export function formatAsJSONL(_0x50fd63,_0xc7f8d1={}){const _0x46a2ce=a54_0x6a4f;if(_0x50fd63[_0x46a2ce(0x183)][_0x46a2ce(0x197)]===0x0)return'';if(shouldUseColor(_0xc7f8d1))return _0x50fd63[_0x46a2ce(0x183)]['map'](_0x1d0ee1=>colorizeJSONCompact(_0x1d0ee1,_0xc7f8d1))[_0x46a2ce(0x185)]('\x0a');return _0x50fd63[_0x46a2ce(0x183)]['map'](_0xfaf1cf=>JSON[_0x46a2ce(0x17d)](_0xfaf1cf))[_0x46a2ce(0x185)]('\x0a');}function a54_0x6a4f(_0x12387d,_0x57f29d){const _0x431c0a=a54_0x431c();return a54_0x6a4f=function(_0x6a4f3f,_0x53583c){_0x6a4f3f=_0x6a4f3f-0x16c;let _0x2ef5cc=_0x431c0a[_0x6a4f3f];return _0x2ef5cc;},a54_0x6a4f(_0x12387d,_0x57f29d);}export function formatAsTSV(_0x187102){const _0xd2e7a5=a54_0x6a4f;if(_0x187102[_0xd2e7a5(0x183)][_0xd2e7a5(0x197)]===0x0)return'';const _0x330ec2=[],_0x50389d=_0x187102[_0xd2e7a5(0x193)][_0xd2e7a5(0x17a)](_0x443d6a=>_0x443d6a[_0xd2e7a5(0x18c)]);return _0x330ec2[_0xd2e7a5(0x184)](_0x50389d['join']('\x09')),_0x187102[_0xd2e7a5(0x183)][_0xd2e7a5(0x181)](_0x2ed5e2=>{const _0x2ec8c8=_0xd2e7a5,_0x1b0c9c=_0x50389d[_0x2ec8c8(0x17a)](_0x13ed9b=>{const _0x36bf3c=_0x2ed5e2[_0x13ed9b];return formatValueForTSV(_0x36bf3c);});_0x330ec2[_0x2ec8c8(0x184)](_0x1b0c9c[_0x2ec8c8(0x185)]('\x09'));}),_0x330ec2['join']('\x0a');}function formatValue(_0x226a1b){const _0x11a836=a54_0x6a4f;if(_0x226a1b===null||_0x226a1b===undefined)return'';if(typeof _0x226a1b==='string'){const _0x17f4aa=_0x226a1b['replace'](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')[_0x11a836(0x182)](/\t/g,'\x5ct');return _0x17f4aa;}if(typeof _0x226a1b===_0x11a836(0x186))return String(_0x226a1b);if(typeof _0x226a1b==='boolean')return _0x226a1b?'true':_0x11a836(0x17c);if(_0x226a1b instanceof Date)return _0x226a1b[_0x11a836(0x17e)]();if(typeof _0x226a1b==='object')return JSON[_0x11a836(0x17d)](_0x226a1b);return String(_0x226a1b);}function formatValueForTSV(_0x2cbf6e){const _0x48dbfd=a54_0x6a4f;if(_0x2cbf6e===null||_0x2cbf6e===undefined)return'';if(typeof _0x2cbf6e===_0x48dbfd(0x18e))return _0x2cbf6e[_0x48dbfd(0x182)](/\t/g,'\x5ct')[_0x48dbfd(0x182)](/\n/g,'\x5cn');if(typeof _0x2cbf6e===_0x48dbfd(0x186)||typeof _0x2cbf6e===_0x48dbfd(0x172))return String(_0x2cbf6e);if(_0x2cbf6e instanceof Date)return _0x2cbf6e[_0x48dbfd(0x17e)]();if(typeof _0x2cbf6e===_0x48dbfd(0x192))return JSON[_0x48dbfd(0x17d)](_0x2cbf6e);return String(_0x2cbf6e);}export function formatQueryResult(_0x1fa4b1,_0x599b3a){const _0x32c847=a54_0x6a4f;switch(_0x599b3a){case _0x32c847(0x16e):return formatAsTable(_0x1fa4b1);case _0x32c847(0x179):return formatAsJSON(_0x1fa4b1);case _0x32c847(0x18b):return formatAsJSONL(_0x1fa4b1);case'tsv':return formatAsTSV(_0x1fa4b1);default:return formatAsJSON(_0x1fa4b1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a55_0x11f5fc=a55_0x5661;(function(_0x18fed3,_0x4c7ee8){const _0x31e68d=a55_0x5661,_0x547be1=_0x18fed3();while(!![]){try{const _0xecf659=-parseInt(_0x31e68d(0xec))/0x1*(parseInt(_0x31e68d(0xe8))/0x2)+-parseInt(_0x31e68d(0xeb))/0x3+-parseInt(_0x31e68d(0xed))/0x4+parseInt(_0x31e68d(0xf0))/0x5+-parseInt(_0x31e68d(0xea))/0x6*(parseInt(_0x31e68d(0xf2))/0x7)+-parseInt(_0x31e68d(0xe7))/0x8*(-parseInt(_0x31e68d(0xe9))/0x9)+parseInt(_0x31e68d(0xef))/0xa;if(_0xecf659===_0x4c7ee8)break;else _0x547be1['push'](_0x547be1['shift']());}catch(_0x1c323e){_0x547be1['push'](_0x547be1['shift']());}}}(a55_0x2100,0x8836b));function a55_0x5661(_0x474125,_0x3df88b){const _0x2100c1=a55_0x2100();return a55_0x5661=function(_0x566126,_0x3c4668){_0x566126=_0x566126-0xe7;let _0x185bf1=_0x2100c1[_0x566126];return _0x185bf1;},a55_0x5661(_0x474125,_0x3df88b);}const MODEL_ALIASES={'haiku':a55_0x11f5fc(0xf1),'sonnet':'claude-4.5-sonnet'};function a55_0x2100(){const _0x862aca=['claude-4.5-haiku','112bSsxQh','8lhLtYT','26lXwOCd','3167109fYzTMd','295206hKvSTz','2923020zBlYHI','61045drHuwZ','256328pjRmCb','toLowerCase','19633930aEVjMQ','4309300fHCuhx'];a55_0x2100=function(){return _0x862aca;};return a55_0x2100();}export function resolveModelAlias(_0x4d8d49){const _0x4207f1=a55_0x11f5fc;return MODEL_ALIASES[_0x4d8d49[_0x4207f1(0xee)]()]||_0x4d8d49;}export function getModelAliases(){return{...MODEL_ALIASES};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a56_0x3ca6(_0x33556e,_0x584593){const _0x3dc242=a56_0x3dc2();return a56_0x3ca6=function(_0x3ca6d3,_0x2c7fdd){_0x3ca6d3=_0x3ca6d3-0xd2;let _0x3a1dd6=_0x3dc242[_0x3ca6d3];return _0x3a1dd6;},a56_0x3ca6(_0x33556e,_0x584593);}(function(_0x49dd6d,_0xfd4eec){const _0x183a42=a56_0x3ca6,_0x34d4ab=_0x49dd6d();while(!![]){try{const _0x4daab5=parseInt(_0x183a42(0xdb))/0x1+-parseInt(_0x183a42(0xd3))/0x2+parseInt(_0x183a42(0xd7))/0x3*(-parseInt(_0x183a42(0xe0))/0x4)+-parseInt(_0x183a42(0xd4))/0x5*(-parseInt(_0x183a42(0xdf))/0x6)+-parseInt(_0x183a42(0xd6))/0x7+-parseInt(_0x183a42(0xe2))/0x8*(-parseInt(_0x183a42(0xd2))/0x9)+parseInt(_0x183a42(0xd9))/0xa*(parseInt(_0x183a42(0xdd))/0xb);if(_0x4daab5===_0xfd4eec)break;else _0x34d4ab['push'](_0x34d4ab['shift']());}catch(_0xd83f91){_0x34d4ab['push'](_0x34d4ab['shift']());}}}(a56_0x3dc2,0x6507e));export function validateLimitOption(_0x18a062){const _0x2402bd=a56_0x3ca6;if(!Number[_0x2402bd(0xda)](_0x18a062))return{'isValid':![],'error':_0x2402bd(0xd5)+_0x18a062+_0x2402bd(0xd8)};if(_0x18a062<=0x0)return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0x18a062+'.\x20Must\x20be\x20a\x20positive\x20integer.'};return{'isValid':!![],'value':_0x18a062};}function a56_0x3dc2(){const _0x1dc77c=['.\x20Must\x20be\x20a\x20number.','7576BHsVGq','1467YVNQGr','727082mDFmkQ','18985VoOJNH','Invalid\x20limit\x20value:\x20','5294772wnZxFl','27coqEEV','.\x20Must\x20be\x20an\x20integer.','105670bToIZy','isInteger','806740bYIkbj','number','572CEagZh','Invalid\x20timeout\x20value:\x20','924KfciaC','249584rqLlNc'];a56_0x3dc2=function(){return _0x1dc77c;};return a56_0x3dc2();}export function validateTimeoutOption(_0x2b357f,_0x4f6f7a=0x1e){const _0x4b5354=a56_0x3ca6;if(_0x2b357f===undefined)return{'isValid':!![],'value':_0x4f6f7a};const _0x323a77=typeof _0x2b357f===_0x4b5354(0xdc)?_0x2b357f:parseFloat(_0x2b357f);if(isNaN(_0x323a77))return{'isValid':![],'error':_0x4b5354(0xde)+_0x2b357f+_0x4b5354(0xe1)};if(_0x323a77<=0x0)return{'isValid':![],'error':'Invalid\x20timeout\x20value:\x20'+_0x323a77+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x323a77};}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x37ab28,_0x4fcbd3){var _0x5979cc=a57_0x43e0,_0x1d6488=_0x37ab28();while(!![]){try{var _0x51e6d3=-parseInt(_0x5979cc(0x1ef))/0x1+-parseInt(_0x5979cc(0x1ed))/0x2+parseInt(_0x5979cc(0x1e9))/0x3*(-parseInt(_0x5979cc(0x1e7))/0x4)+parseInt(_0x5979cc(0x1e5))/0x5+parseInt(_0x5979cc(0x1e6))/0x6*(parseInt(_0x5979cc(0x1ec))/0x7)+parseInt(_0x5979cc(0x1e8))/0x8+parseInt(_0x5979cc(0x1eb))/0x9;if(_0x51e6d3===_0x4fcbd3)break;else _0x1d6488['push'](_0x1d6488['shift']());}catch(_0x311eef){_0x1d6488['push'](_0x1d6488['shift']());}}}(a57_0x5efa,0xd7967));export function getPPID(){var _0x511cd5=a57_0x43e0;return process[_0x511cd5(0x1ea)];}export function isProcessRunning(_0x4939d7){var _0x285922=a57_0x43e0;try{return process[_0x285922(0x1ee)](_0x4939d7,0x0),!![];}catch{return![];}}function a57_0x43e0(_0x10e6c3,_0x5ad347){var _0x5efa95=a57_0x5efa();return a57_0x43e0=function(_0x43e0c9,_0x73e389){_0x43e0c9=_0x43e0c9-0x1e5;var _0x1d12ef=_0x5efa95[_0x43e0c9];return _0x1d12ef;},a57_0x43e0(_0x10e6c3,_0x5ad347);}function a57_0x5efa(){var _0x51b53a=['kill','1562924OeweSS','2320755UaCCRj','3143388XUxqGc','8zCsMES','2306600RZjxle','1804812kGUcBE','ppid','30642435GwaQgm','7aNDNNZ','2063820CYCHsO'];a57_0x5efa=function(){return _0x51b53a;};return a57_0x5efa();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a58_0x1865(){const _0x24ada7=['indexOf','38031niFSMv','26OXNvbq','Invalid\x20segment\x20reference\x20format:\x20','substring','2723390YUuqbs','125539uEZzvY','57486ceKsSG','.\x20Child\x20name\x20cannot\x20be\x20empty','3479370upMtGg','.\x20Parent\x20name\x20cannot\x20be\x20empty','3815680nRpecE','19660833juQDPT','784oyXJgn'];a58_0x1865=function(){return _0x24ada7;};return a58_0x1865();}function a58_0x5360(_0x3bab24,_0xffee03){const _0x1865ab=a58_0x1865();return a58_0x5360=function(_0x5360ad,_0x13e87c){_0x5360ad=_0x5360ad-0xb3;let _0x5973d3=_0x1865ab[_0x5360ad];return _0x5973d3;},a58_0x5360(_0x3bab24,_0xffee03);}(function(_0x4a90f9,_0x1c7635){const _0x3c2324=a58_0x5360,_0x5c0167=_0x4a90f9();while(!![]){try{const _0x27976e=-parseInt(_0x3c2324(0xb5))/0x1+-parseInt(_0x3c2324(0xbf))/0x2*(-parseInt(_0x3c2324(0xb6))/0x3)+-parseInt(_0x3c2324(0xba))/0x4+parseInt(_0x3c2324(0xb4))/0x5+-parseInt(_0x3c2324(0xb8))/0x6+parseInt(_0x3c2324(0xbe))/0x7*(-parseInt(_0x3c2324(0xbc))/0x8)+parseInt(_0x3c2324(0xbb))/0x9;if(_0x27976e===_0x1c7635)break;else _0x5c0167['push'](_0x5c0167['shift']());}catch(_0x1ab046){_0x5c0167['push'](_0x5c0167['shift']());}}}(a58_0x1865,0xc0065));export function parseSegmentRef(_0x322ed6){const _0x32ae7f=a58_0x5360,_0x2b0a39=_0x322ed6[_0x32ae7f(0xbd)]('/');if(_0x2b0a39===-0x1)return{'parentId':_0x322ed6};if(_0x2b0a39===0x0)throw new Error(_0x32ae7f(0xc0)+_0x322ed6+_0x32ae7f(0xb9));const _0x1bd103=_0x322ed6[_0x32ae7f(0xb3)](0x0,_0x2b0a39),_0x4f2428=_0x322ed6['substring'](_0x2b0a39+0x1);if(_0x4f2428==='')throw new Error(_0x32ae7f(0xc0)+_0x322ed6+_0x32ae7f(0xb7));return{'parentId':_0x1bd103,'childId':_0x4f2428};}
|
package/dist/utils/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3df7d4,_0x420b1f){const _0x288914=a59_0x3c82,_0x4c2183=_0x3df7d4();while(!![]){try{const _0x78bcd0=parseInt(_0x288914(0xf2))/0x1+parseInt(_0x288914(0xf5))/0x2+-parseInt(_0x288914(0xe9))/0x3+-parseInt(_0x288914(0xe8))/0x4+parseInt(_0x288914(0xf6))/0x5+parseInt(_0x288914(0xf0))/0x6*(-parseInt(_0x288914(0xf9))/0x7)+parseInt(_0x288914(0xe7))/0x8*(parseInt(_0x288914(0xfe))/0x9);if(_0x78bcd0===_0x420b1f)break;else _0x4c2183['push'](_0x4c2183['shift']());}catch(_0x22f190){_0x4c2183['push'](_0x4c2183['shift']());}}}(a59_0x58da,0x5fd56));import a59_0x50aa43 from'ora';function a59_0x3c82(_0x555c2e,_0x32144c){const _0x58da5f=a59_0x58da();return a59_0x3c82=function(_0x3c8251,_0x1713ba){_0x3c8251=_0x3c8251-0xe6;let _0x4d66f6=_0x58da5f[_0x3c8251];return _0x4d66f6;},a59_0x3c82(_0x555c2e,_0x32144c);}export function createCommandSpinner(_0x2c3fed,_0x2aaae9={}){const _0x309368=a59_0x3c82,{verbose:verbose=![],forceEnabled:forceEnabled=![]}=_0x2aaae9;return a59_0x50aa43({'text':_0x2c3fed,'color':_0x309368(0xfb),'isEnabled':forceEnabled||process[_0x309368(0xeb)][_0x309368(0xf7)]&&!verbose});}function a59_0x58da(){const _0x44e26e=['now','550056JYbtOu','2643460yZjBoD','289617RykrRg','jobId','stdout','intervalFactory','clock','toFixed','text','6qkpRhm','\x20[Job\x20ID:\x20','45458eTmKKd','extra','replace','1207234DXElWj','3220725KsdjsA','isTTY','phase','3409469IeEikL','stop','cyan','start','isSpinning','45AgRlUl'];a59_0x58da=function(){return _0x44e26e;};return a59_0x58da();}export async function withSpinner(_0xee77dc,_0x3693b9,_0x421a39={}){const _0x5f1664=a59_0x3c82,_0x56819c=_0x421a39[_0x5f1664(0xed)]??(()=>Date[_0x5f1664(0xe6)]()),_0x5515d6=createCommandSpinner(_0xee77dc,_0x421a39);_0x5515d6['start']();const _0x3f04a5=_0x56819c();try{const _0x27f32b=await _0x3693b9(),_0x14094f=_0x56819c()-_0x3f04a5;return _0x5515d6[_0x5f1664(0xfa)](),{'data':_0x27f32b,'elapsedMs':_0x14094f};}catch(_0x50c3d3){_0x5515d6[_0x5f1664(0xfa)]();throw _0x50c3d3;}}export async function withQuerySpinner(_0x1722d3,_0x184985,_0x380f1e={}){const _0x55e926=a59_0x3c82,_0x1e4256=_0x380f1e[_0x55e926(0xed)]??(()=>Date[_0x55e926(0xe6)]()),_0x4523da=_0x380f1e[_0x55e926(0xec)]??setInterval,_0x5740c3=createCommandSpinner(_0x1722d3,_0x380f1e);_0x5740c3[_0x55e926(0xfc)]();const _0x296bd9=_0x1e4256(),_0x6acf91=_0x1722d3[_0x55e926(0xf4)]('...',''),_0x33af8f={},_0x33ccbb=()=>{const _0x4c4a01=_0x55e926;if(!_0x5740c3[_0x4c4a01(0xfd)])return;const _0x77247f=((_0x1e4256()-_0x296bd9)/0x3e8)[_0x4c4a01(0xee)](0x1),_0x31fcfd=_0x33af8f[_0x4c4a01(0xf8)]??_0x6acf91,_0x54341e=_0x33af8f[_0x4c4a01(0xea)]?_0x4c4a01(0xf1)+_0x33af8f[_0x4c4a01(0xea)]+']':'',_0x65d045=_0x33af8f[_0x4c4a01(0xf3)]?'\x20'+_0x33af8f[_0x4c4a01(0xf3)]:'';_0x5740c3[_0x4c4a01(0xef)]=_0x31fcfd+'\x20('+_0x77247f+'s)'+_0x65d045+_0x54341e;},_0x195da1=_0x4523da(()=>{_0x33ccbb();},0x3e8),_0x32fd15={'setPhase':_0x3adffa=>{const _0x441824=_0x55e926;_0x33af8f[_0x441824(0xf8)]=_0x3adffa,_0x33ccbb();},'setJobId':_0x4658aa=>{const _0x39aa96=_0x55e926;_0x33af8f[_0x39aa96(0xea)]=_0x4658aa,_0x33ccbb();},'setExtra':_0x4b3931=>{_0x33af8f['extra']=_0x4b3931,_0x33ccbb();}};_0x33ccbb();try{const _0x4b5bf1=await _0x184985(_0x32fd15),_0x2015de=_0x1e4256()-_0x296bd9;return{'data':_0x4b5bf1,'elapsedMs':_0x2015de};}finally{clearInterval(_0x195da1),_0x5740c3[_0x55e926(0xfa)]();}}export function formatElapsed(_0x4414d6){const _0x11d34f=a59_0x3c82;return(_0x4414d6/0x3e8)[_0x11d34f(0xee)](0x2)+'s';}
|
package/dist/utils/sql-parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a60_0x38b3(_0x4a3b61,_0x45ae35){const _0x1fc520=a60_0x1fc5();return a60_0x38b3=function(_0x38b377,_0x5bbcef){_0x38b377=_0x38b377-0xa0;let _0x5c5d66=_0x1fc520[_0x38b377];return _0x5c5d66;},a60_0x38b3(_0x4a3b61,_0x45ae35);}(function(_0x53d056,_0x1c257b){const _0x30076f=a60_0x38b3,_0x44a122=_0x53d056();while(!![]){try{const _0x85e0d4=-parseInt(_0x30076f(0xa0))/0x1+-parseInt(_0x30076f(0xa4))/0x2*(-parseInt(_0x30076f(0xb0))/0x3)+-parseInt(_0x30076f(0xa3))/0x4+-parseInt(_0x30076f(0xaa))/0x5*(-parseInt(_0x30076f(0xa2))/0x6)+parseInt(_0x30076f(0xb8))/0x7*(parseInt(_0x30076f(0xa7))/0x8)+-parseInt(_0x30076f(0xb7))/0x9*(-parseInt(_0x30076f(0xaf))/0xa)+-parseInt(_0x30076f(0xa9))/0xb;if(_0x85e0d4===_0x1c257b)break;else _0x44a122['push'](_0x44a122['shift']());}catch(_0x4d6472){_0x44a122['push'](_0x44a122['shift']());}}}(a60_0x1fc5,0x33953));import{readFileSync}from'fs';export function stripSqlComments(_0x1371ae){const _0x217164=a60_0x38b3;let _0x167ef0=_0x1371ae[_0x217164(0xad)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x167ef0=_0x167ef0[_0x217164(0xad)](/--.*$/gm,''),_0x167ef0[_0x217164(0xa6)]();}function isEscaped(_0x5b5944,_0x14540f){let _0x6aac4c=0x0;for(let _0x2e48e1=_0x14540f-0x1;_0x2e48e1>=0x0&&_0x5b5944[_0x2e48e1]==='\x5c';_0x2e48e1--){_0x6aac4c++;}return _0x6aac4c%0x2===0x1;}export function splitSqlStatements(_0x23aceb){const _0x36ce3d=a60_0x38b3,_0x4bcff3=stripSqlComments(_0x23aceb);if(!_0x4bcff3)throw new Error('Content\x20contains\x20no\x20SQL\x20statements');const _0x1829a8=[];let _0x5514b5='',_0x42cc31=![],_0x4228b6=![],_0x23462f=![];for(let _0x230ba2=0x0;_0x230ba2<_0x23aceb[_0x36ce3d(0xac)];_0x230ba2++){const _0x36e909=_0x23aceb[_0x230ba2];if(_0x36e909==='\x27'&&!isEscaped(_0x23aceb,_0x230ba2)&&!_0x4228b6&&!_0x23462f)_0x42cc31=!_0x42cc31;else{if(_0x36e909==='\x22'&&!isEscaped(_0x23aceb,_0x230ba2)&&!_0x42cc31&&!_0x23462f)_0x4228b6=!_0x4228b6;else _0x36e909==='`'&&!isEscaped(_0x23aceb,_0x230ba2)&&!_0x42cc31&&!_0x4228b6&&(_0x23462f=!_0x23462f);}if(_0x36e909===';'&&!_0x42cc31&&!_0x4228b6&&!_0x23462f){const _0x2a1ed7=_0x5514b5[_0x36ce3d(0xa6)]();_0x2a1ed7&&_0x1829a8[_0x36ce3d(0xb4)](_0x2a1ed7),_0x5514b5='';}else _0x5514b5+=_0x36e909;}const _0x36dd55=_0x5514b5[_0x36ce3d(0xa6)]();_0x36dd55&&_0x1829a8[_0x36ce3d(0xb4)](_0x36dd55);const _0x2c8398=_0x1829a8[_0x36ce3d(0xbb)](_0x5c6e8f=>_0x5c6e8f[_0x36ce3d(0xa6)]())[_0x36ce3d(0xb9)](_0x446e76=>{const _0x5d2369=_0x36ce3d,_0x4fe8c2=stripSqlComments(_0x446e76);return _0x4fe8c2[_0x5d2369(0xac)]>0x0;});if(_0x2c8398['length']===0x0)throw new Error(_0x36ce3d(0xa1));return _0x2c8398;}export function readFileContent(_0x2bac6b){const _0x202d0b=a60_0x38b3;try{return readFileSync(_0x2bac6b,_0x202d0b(0xb1));}catch(_0xbe338e){const _0x29fa1e=_0xbe338e[_0x202d0b(0xae)];if(_0x29fa1e===_0x202d0b(0xb6))throw new Error(_0x202d0b(0xb5)+_0x2bac6b+_0x202d0b(0xb2));else{if(_0x29fa1e===_0x202d0b(0xba))throw new Error('Permission\x20denied\x20reading\x20file\x20\x27'+_0x2bac6b+'\x27');else throw new Error(_0x202d0b(0xab)+_0x2bac6b+_0x202d0b(0xb3)+_0xbe338e[_0x202d0b(0xa8)]);}}}function a60_0x1fc5(){const _0x7d0002=['EACCES','map','328600IKZGKk','Content\x20contains\x20no\x20SQL\x20statements','2694bZrXuC','1208420DxHiVv','807914SengkQ','toLowerCase','trim','76136WDwCym','message','2998754ScXiVC','115CDIwLa','Error\x20reading\x20file\x20\x27','length','replace','code','20halgHw','3czbWJe','utf-8','\x27\x20not\x20found','\x27:\x20','push','File\x20\x27','ENOENT','1609677JNFkfW','252NSrWly','filter'];a60_0x1fc5=function(){return _0x7d0002;};return a60_0x1fc5();}export function readSqlStatementsFromFile(_0x3d2939){const _0x3de367=a60_0x38b3,_0x1dfeaf=readFileContent(_0x3d2939);try{return splitSqlStatements(_0x1dfeaf);}catch(_0x4067f0){throw new Error('File\x20\x27'+_0x3d2939+'\x27\x20'+_0x4067f0[_0x3de367(0xa8)][_0x3de367(0xa5)]());}}
|