@fuzionx/client 0.1.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/fuzionx_client_wasm.d.ts +227 -0
- package/fuzionx_client_wasm.js +1344 -0
- package/fuzionx_client_wasm_bg.wasm +0 -0
- package/fuzionx_client_wasm_bg.wasm.d.ts +48 -0
- package/package.json +21 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 브라우저 ASP 클라이언트.
|
|
6
|
+
*
|
|
7
|
+
* `master_secret`을 보유하고, 현재 도메인 + UA 기반으로
|
|
8
|
+
* ASP transport 키를 유도하여 암/복호화를 수행한다.
|
|
9
|
+
*/
|
|
10
|
+
export class RuxyClient {
|
|
11
|
+
free(): void;
|
|
12
|
+
[Symbol.dispose](): void;
|
|
13
|
+
/**
|
|
14
|
+
* 범용 복호화.
|
|
15
|
+
*/
|
|
16
|
+
decrypt_custom(key: string, data: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* ASP Transport 복호화.
|
|
19
|
+
*/
|
|
20
|
+
decrypt_transport(path: string, encrypted: string, timestamp: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* DELETE 요청.
|
|
23
|
+
*/
|
|
24
|
+
delete(path: string, encrypt?: boolean | null): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* 키 유도 결과를 hex로 반환 (테스트용).
|
|
27
|
+
*/
|
|
28
|
+
derive_key_hex(path: string, timestamp: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* 범용 암호화: SHA256(key) → AES-256-GCM + Nibble Swap.
|
|
31
|
+
*/
|
|
32
|
+
encrypt_custom(key: string, data: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* ASP Transport 암호화.
|
|
35
|
+
*
|
|
36
|
+
* `master_secret` + 현재 도메인 + UA + path + timestamp 기반 키 유도 후 암호화.
|
|
37
|
+
*/
|
|
38
|
+
encrypt_transport(path: string, data: string, timestamp: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* GET 요청. `encrypt` = true면 ASP 암호화 적용.
|
|
41
|
+
*/
|
|
42
|
+
get(path: string, encrypt?: boolean | null): Promise<any>;
|
|
43
|
+
/**
|
|
44
|
+
* ASP 헤더 시그널 이름을 반환한다.
|
|
45
|
+
*/
|
|
46
|
+
get_header_signal(): string;
|
|
47
|
+
/**
|
|
48
|
+
* 클라이언트를 생성한다.
|
|
49
|
+
*
|
|
50
|
+
* `window.navigator.userAgent`와 `window.location.host`를 자동 추출.
|
|
51
|
+
*/
|
|
52
|
+
constructor(master_secret: string);
|
|
53
|
+
/**
|
|
54
|
+
* header_signal을 지정하여 생성 (서버 YAML `asp.header_signal`과 일치시켜야 함).
|
|
55
|
+
*/
|
|
56
|
+
static new_with_options(master_secret: string, header_signal?: string | null): RuxyClient;
|
|
57
|
+
/**
|
|
58
|
+
* PATCH 요청.
|
|
59
|
+
*/
|
|
60
|
+
patch(path: string, body: any, encrypt?: boolean | null): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
* POST 요청.
|
|
63
|
+
*/
|
|
64
|
+
post(path: string, body: any, encrypt?: boolean | null): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* PUT 요청.
|
|
67
|
+
*/
|
|
68
|
+
put(path: string, body: any, encrypt?: boolean | null): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* UUID v4 생성.
|
|
71
|
+
*/
|
|
72
|
+
uuid(): string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 📡 RuxySocket — WASM WebSocket 클라이언트.
|
|
77
|
+
*/
|
|
78
|
+
export class RuxySocket {
|
|
79
|
+
free(): void;
|
|
80
|
+
[Symbol.dispose](): void;
|
|
81
|
+
/**
|
|
82
|
+
* 서버 연결.
|
|
83
|
+
*/
|
|
84
|
+
connect(): void;
|
|
85
|
+
/**
|
|
86
|
+
* 명시적 연결 종료.
|
|
87
|
+
*/
|
|
88
|
+
disconnect(): void;
|
|
89
|
+
/**
|
|
90
|
+
* 연결 상태 확인.
|
|
91
|
+
*/
|
|
92
|
+
is_connected(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 생성자.
|
|
95
|
+
*
|
|
96
|
+
* @param url - WebSocket 주소 (예: "ws://localhost:3000/ws/chat")
|
|
97
|
+
* @param master_secret - Transport 암호화 키
|
|
98
|
+
* @param encrypt_enabled - 암호화 활성화 (기본: false)
|
|
99
|
+
*/
|
|
100
|
+
constructor(url: string, master_secret: string, encrypt_enabled?: boolean | null);
|
|
101
|
+
/**
|
|
102
|
+
* 이벤트 핸들러 등록.
|
|
103
|
+
*/
|
|
104
|
+
on(event_type: string, callback: Function): void;
|
|
105
|
+
/**
|
|
106
|
+
* 이벤트 기반 메시지 전송 (Transport 암호화).
|
|
107
|
+
*/
|
|
108
|
+
send(event_type: string, data: any): void;
|
|
109
|
+
/**
|
|
110
|
+
* 자동 재연결 설정.
|
|
111
|
+
*/
|
|
112
|
+
set_auto_reconnect(enabled: boolean): void;
|
|
113
|
+
/**
|
|
114
|
+
* 최대 재연결 시도 횟수 설정.
|
|
115
|
+
*/
|
|
116
|
+
set_max_reconnect_attempts(count: number): void;
|
|
117
|
+
/**
|
|
118
|
+
* Ping 주기 설정 (밀리초).
|
|
119
|
+
*/
|
|
120
|
+
set_ping_interval(ms: number): void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 브라우저 WASM 유틸리티.
|
|
125
|
+
*/
|
|
126
|
+
export class RuxyUtil {
|
|
127
|
+
private constructor();
|
|
128
|
+
free(): void;
|
|
129
|
+
[Symbol.dispose](): void;
|
|
130
|
+
/**
|
|
131
|
+
* 임계값 초과 필터.
|
|
132
|
+
*/
|
|
133
|
+
static filter_gt(list: Int32Array, threshold: number): Int32Array;
|
|
134
|
+
/**
|
|
135
|
+
* MD5 해시 (hex).
|
|
136
|
+
*/
|
|
137
|
+
static md5(input: string): string;
|
|
138
|
+
/**
|
|
139
|
+
* SHA-256 해시 (hex).
|
|
140
|
+
*/
|
|
141
|
+
static sha256(input: string): string;
|
|
142
|
+
/**
|
|
143
|
+
* Fisher-Yates 셔플 (JS `sort(() => 0.5 - Math.random())` 대비 균등 분포 + 고속).
|
|
144
|
+
*/
|
|
145
|
+
static shuffle_i32(list: Int32Array): Int32Array;
|
|
146
|
+
/**
|
|
147
|
+
* 고속 정렬 (unstable sort — 동일 값 순서 미보장, 대신 빠름).
|
|
148
|
+
*/
|
|
149
|
+
static sort_i32(list: Int32Array): Int32Array;
|
|
150
|
+
/**
|
|
151
|
+
* UUID v4 생성.
|
|
152
|
+
*/
|
|
153
|
+
static uuid(): string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
157
|
+
|
|
158
|
+
export interface InitOutput {
|
|
159
|
+
readonly memory: WebAssembly.Memory;
|
|
160
|
+
readonly __wbg_ruxyclient_free: (a: number, b: number) => void;
|
|
161
|
+
readonly __wbg_ruxysocket_free: (a: number, b: number) => void;
|
|
162
|
+
readonly __wbg_ruxyutil_free: (a: number, b: number) => void;
|
|
163
|
+
readonly ruxyclient_decrypt_custom: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
164
|
+
readonly ruxyclient_decrypt_transport: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
165
|
+
readonly ruxyclient_delete: (a: number, b: number, c: number, d: number) => number;
|
|
166
|
+
readonly ruxyclient_derive_key_hex: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
167
|
+
readonly ruxyclient_encrypt_custom: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
168
|
+
readonly ruxyclient_encrypt_transport: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
169
|
+
readonly ruxyclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
170
|
+
readonly ruxyclient_get_header_signal: (a: number, b: number) => void;
|
|
171
|
+
readonly ruxyclient_new: (a: number, b: number, c: number) => void;
|
|
172
|
+
readonly ruxyclient_new_with_options: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
173
|
+
readonly ruxyclient_patch: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
174
|
+
readonly ruxyclient_post: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
175
|
+
readonly ruxyclient_put: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
176
|
+
readonly ruxyclient_uuid: (a: number, b: number) => void;
|
|
177
|
+
readonly ruxysocket_connect: (a: number, b: number) => void;
|
|
178
|
+
readonly ruxysocket_disconnect: (a: number) => void;
|
|
179
|
+
readonly ruxysocket_is_connected: (a: number) => number;
|
|
180
|
+
readonly ruxysocket_new: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
181
|
+
readonly ruxysocket_on: (a: number, b: number, c: number, d: number) => void;
|
|
182
|
+
readonly ruxysocket_send: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
183
|
+
readonly ruxysocket_set_auto_reconnect: (a: number, b: number) => void;
|
|
184
|
+
readonly ruxysocket_set_max_reconnect_attempts: (a: number, b: number) => void;
|
|
185
|
+
readonly ruxysocket_set_ping_interval: (a: number, b: number) => void;
|
|
186
|
+
readonly ruxyutil_filter_gt: (a: number, b: number, c: number, d: number) => void;
|
|
187
|
+
readonly ruxyutil_md5: (a: number, b: number, c: number) => void;
|
|
188
|
+
readonly ruxyutil_sha256: (a: number, b: number, c: number) => void;
|
|
189
|
+
readonly ruxyutil_shuffle_i32: (a: number, b: number, c: number) => void;
|
|
190
|
+
readonly ruxyutil_sort_i32: (a: number, b: number, c: number) => void;
|
|
191
|
+
readonly ruxyutil_uuid: (a: number) => void;
|
|
192
|
+
readonly __wasm_bindgen_func_elem_74: (a: number, b: number) => void;
|
|
193
|
+
readonly __wasm_bindgen_func_elem_545: (a: number, b: number) => void;
|
|
194
|
+
readonly __wasm_bindgen_func_elem_546: (a: number, b: number, c: number, d: number) => void;
|
|
195
|
+
readonly __wasm_bindgen_func_elem_605: (a: number, b: number, c: number, d: number) => void;
|
|
196
|
+
readonly __wasm_bindgen_func_elem_75: (a: number, b: number, c: number) => void;
|
|
197
|
+
readonly __wasm_bindgen_func_elem_75_1: (a: number, b: number, c: number) => void;
|
|
198
|
+
readonly __wasm_bindgen_func_elem_75_2: (a: number, b: number, c: number) => void;
|
|
199
|
+
readonly __wasm_bindgen_func_elem_77: (a: number, b: number) => void;
|
|
200
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
201
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
202
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
203
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
204
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
211
|
+
* a precompiled `WebAssembly.Module`.
|
|
212
|
+
*
|
|
213
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
214
|
+
*
|
|
215
|
+
* @returns {InitOutput}
|
|
216
|
+
*/
|
|
217
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
221
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
222
|
+
*
|
|
223
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
224
|
+
*
|
|
225
|
+
* @returns {Promise<InitOutput>}
|
|
226
|
+
*/
|
|
227
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|