@valkey/valkey-glide 1.3.4 → 1.3.5-rc2
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/LICENSE +201 -0
- package/README.md +36 -14
- package/build-ts/{src/BaseClient.d.ts → BaseClient.d.ts} +62 -118
- package/build-ts/BaseClient.js +6049 -0
- package/build-ts/{src/Transaction.d.ts → Batch.d.ts} +124 -67
- package/build-ts/Batch.js +3457 -0
- package/build-ts/{src/Commands.d.ts → Commands.d.ts} +171 -791
- package/build-ts/Commands.js +2708 -0
- package/build-ts/Errors.js +42 -0
- package/build-ts/{src/GlideClient.d.ts → GlideClient.d.ts} +55 -19
- package/build-ts/GlideClient.js +899 -0
- package/build-ts/{src/GlideClusterClient.d.ts → GlideClusterClient.d.ts} +78 -42
- package/build-ts/GlideClusterClient.js +1251 -0
- package/build-ts/Logger.js +67 -0
- package/build-ts/{src/ProtobufMessage.d.ts → ProtobufMessage.d.ts} +171 -634
- package/build-ts/ProtobufMessage.js +5265 -0
- package/build-ts/index.d.ts +16 -11
- package/build-ts/index.js +53 -216
- package/build-ts/native.d.ts +14 -0
- package/build-ts/native.js +342 -0
- package/build-ts/server-modules/GlideFt.js +628 -0
- package/build-ts/{src/server-modules → server-modules}/GlideFtOptions.d.ts +1 -1
- package/build-ts/server-modules/GlideFtOptions.js +5 -0
- package/build-ts/{src/server-modules → server-modules}/GlideJson.d.ts +65 -65
- package/build-ts/server-modules/GlideJson.js +1572 -0
- package/package.json +141 -64
- /package/build-ts/{src/Errors.d.ts → Errors.d.ts} +0 -0
- /package/build-ts/{src/Logger.d.ts → Logger.d.ts} +0 -0
- /package/build-ts/{src/server-modules → server-modules}/GlideFt.d.ts +0 -0
package/build-ts/index.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* This entry point re-exports:
|
|
5
|
+
* - Native bindings auto-generated by napi-rs (moved to ./native.js)
|
|
6
|
+
* - All TypeScript client-side APIs from ./src/
|
|
3
7
|
*/
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
8
|
+
import * as Native from "./native";
|
|
9
|
+
export declare const Level: typeof Native.Level, MAX_REQUEST_ARGS_LEN: number, DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS: number, DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS: number, DEFAULT_INFLIGHT_REQUESTS_LIMIT: number, AsyncClient: typeof Native.AsyncClient, StartSocketConnection: typeof Native.StartSocketConnection, log: typeof Native.log, InitInternalLogger: typeof Native.InitInternalLogger, valueFromSplitPointer: typeof Native.valueFromSplitPointer, createLeakedStringVec: typeof Native.createLeakedStringVec, Script: typeof Native.Script, ClusterScanCursor: typeof Native.ClusterScanCursor, getStatistics: typeof Native.getStatistics;
|
|
10
|
+
export * from "./BaseClient.js";
|
|
11
|
+
export * from "./Batch.js";
|
|
12
|
+
export * from "./Commands.js";
|
|
13
|
+
export * from "./Errors.js";
|
|
14
|
+
export * from "./GlideClient.js";
|
|
15
|
+
export * from "./GlideClusterClient.js";
|
|
16
|
+
export * from "./Logger.js";
|
|
17
|
+
export * from "./server-modules/GlideFt.js";
|
|
18
|
+
export * from "./server-modules/GlideFtOptions.js";
|
|
19
|
+
export * from "./server-modules/GlideJson.js";
|
package/build-ts/index.js
CHANGED
|
@@ -1,222 +1,59 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
/**
|
|
4
3
|
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* This entry point re-exports:
|
|
6
|
+
* - Native bindings auto-generated by napi-rs (moved to ./native.js)
|
|
7
|
+
* - All TypeScript client-side APIs from ./src/
|
|
5
8
|
*/
|
|
6
|
-
Object.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function loadNativeBinding() {
|
|
12
|
-
let nativeBinding = null;
|
|
13
|
-
switch (process_1.platform) {
|
|
14
|
-
case "linux":
|
|
15
|
-
switch (process_1.arch) {
|
|
16
|
-
case "x64":
|
|
17
|
-
switch ((0, detect_libc_1.familySync)()) {
|
|
18
|
-
case detect_libc_1.GLIBC:
|
|
19
|
-
nativeBinding = require("@valkey/valkey-glide-linux-x64");
|
|
20
|
-
break;
|
|
21
|
-
case detect_libc_1.MUSL:
|
|
22
|
-
nativeBinding = require("@valkey/valkey-glide-linux-musl-x64");
|
|
23
|
-
break;
|
|
24
|
-
default:
|
|
25
|
-
nativeBinding = require("@valkey/valkey-glide-linux-x64");
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
break;
|
|
29
|
-
case "arm64":
|
|
30
|
-
switch ((0, detect_libc_1.familySync)()) {
|
|
31
|
-
case detect_libc_1.GLIBC:
|
|
32
|
-
nativeBinding = require("@valkey/valkey-glide-linux-arm64");
|
|
33
|
-
break;
|
|
34
|
-
case detect_libc_1.MUSL:
|
|
35
|
-
nativeBinding = require("@valkey/valkey-glide-linux-musl-arm64");
|
|
36
|
-
break;
|
|
37
|
-
default:
|
|
38
|
-
nativeBinding = require("@valkey/valkey-glide-linux-arm64");
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
break;
|
|
42
|
-
default:
|
|
43
|
-
throw new Error(`Unsupported OS: ${process_1.platform}, architecture: ${process_1.arch}`);
|
|
44
|
-
}
|
|
45
|
-
break;
|
|
46
|
-
case "darwin":
|
|
47
|
-
switch (process_1.arch) {
|
|
48
|
-
case "arm64":
|
|
49
|
-
nativeBinding = require("@valkey/valkey-glide-darwin-arm64");
|
|
50
|
-
break;
|
|
51
|
-
case "x64":
|
|
52
|
-
nativeBinding = require("@valkey/valkey-glide-darwin-x64");
|
|
53
|
-
break;
|
|
54
|
-
default:
|
|
55
|
-
throw new Error(`Unsupported OS: ${process_1.platform}, architecture: ${process_1.arch}`);
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
throw new Error(`Unsupported OS: ${process_1.platform}, architecture: ${process_1.arch}`);
|
|
60
|
-
}
|
|
61
|
-
if (!nativeBinding) {
|
|
62
|
-
throw new Error(`Failed to load native binding`);
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
63
14
|
}
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
BitOffset,
|
|
83
|
-
BitOffsetMultiplier,
|
|
84
|
-
BitOffsetOptions,
|
|
85
|
-
BitOverflowControl,
|
|
86
|
-
BitmapIndexType,
|
|
87
|
-
BitwiseOperation,
|
|
88
|
-
ConditionalChange,
|
|
89
|
-
Decoder,
|
|
90
|
-
DecoderOption,
|
|
91
|
-
GeoAddOptions,
|
|
92
|
-
GlideFt,
|
|
93
|
-
Field,
|
|
94
|
-
TextField,
|
|
95
|
-
TagField,
|
|
96
|
-
NumericField,
|
|
97
|
-
VectorField,
|
|
98
|
-
VectorFieldAttributesFlat,
|
|
99
|
-
VectorFieldAttributesHnsw,
|
|
100
|
-
FtCreateOptions,
|
|
101
|
-
FtSearchOptions,
|
|
102
|
-
FtInfoReturnType,
|
|
103
|
-
FtAggregateOptions,
|
|
104
|
-
FtAggregateLimit,
|
|
105
|
-
FtAggregateFilter,
|
|
106
|
-
FtAggregateGroupBy,
|
|
107
|
-
FtAggregateReducer,
|
|
108
|
-
FtAggregateSortBy,
|
|
109
|
-
FtAggregateSortProperty,
|
|
110
|
-
FtAggregateApply,
|
|
111
|
-
FtAggregateReturnType,
|
|
112
|
-
FtSearchReturnType,
|
|
113
|
-
GlideRecord,
|
|
114
|
-
GlideJson,
|
|
115
|
-
JsonBatch,
|
|
116
|
-
GlideString,
|
|
117
|
-
JsonGetOptions,
|
|
118
|
-
JsonArrPopOptions,
|
|
119
|
-
SortedSetDataType,
|
|
120
|
-
StreamEntryDataType,
|
|
121
|
-
HashDataType,
|
|
122
|
-
CoordOrigin,
|
|
123
|
-
MemberOrigin,
|
|
124
|
-
SearchOrigin,
|
|
125
|
-
GeoBoxShape,
|
|
126
|
-
GeoCircleShape,
|
|
127
|
-
GeoSearchShape,
|
|
128
|
-
GeoSearchResultOptions,
|
|
129
|
-
GeoSearchStoreResultOptions,
|
|
130
|
-
SortOrder,
|
|
131
|
-
GeoUnit,
|
|
132
|
-
GeospatialData,
|
|
133
|
-
GlideClient,
|
|
134
|
-
GlideClusterClient,
|
|
135
|
-
GlideClientConfiguration,
|
|
136
|
-
AdvancedGlideClientConfiguration,
|
|
137
|
-
AdvancedGlideClusterClientConfiguration,
|
|
138
|
-
FunctionListOptions,
|
|
139
|
-
FunctionListResponse,
|
|
140
|
-
FunctionStatsSingleResponse,
|
|
141
|
-
FunctionStatsFullResponse,
|
|
142
|
-
FunctionRestorePolicy,
|
|
143
|
-
SlotIdTypes,
|
|
144
|
-
SlotKeyTypes,
|
|
145
|
-
StreamEntries,
|
|
146
|
-
TimeUnit,
|
|
147
|
-
ReturnTypeXinfoStream,
|
|
148
|
-
RouteByAddress,
|
|
149
|
-
RouteOption,
|
|
150
|
-
Routes,
|
|
151
|
-
RestoreOptions,
|
|
152
|
-
SingleNodeRoute,
|
|
153
|
-
PeriodicChecksManualInterval,
|
|
154
|
-
PeriodicChecks,
|
|
155
|
-
Logger,
|
|
156
|
-
LolwutOptions,
|
|
157
|
-
Limit,
|
|
158
|
-
LPosOptions,
|
|
159
|
-
ListDirection,
|
|
160
|
-
ExpireOptions,
|
|
161
|
-
FlushMode,
|
|
162
|
-
InfoOptions,
|
|
163
|
-
InsertPosition,
|
|
164
|
-
SetOptions,
|
|
165
|
-
ZAddOptions,
|
|
166
|
-
InfBoundary,
|
|
167
|
-
KeyWeight,
|
|
168
|
-
Boundary,
|
|
169
|
-
ProtocolVersion,
|
|
170
|
-
RangeByIndex,
|
|
171
|
-
RangeByScore,
|
|
172
|
-
RangeByLex,
|
|
173
|
-
ReadFrom,
|
|
174
|
-
ServerCredentials,
|
|
175
|
-
SortOptions,
|
|
176
|
-
StreamGroupOptions,
|
|
177
|
-
StreamTrimOptions,
|
|
178
|
-
StreamAddOptions,
|
|
179
|
-
StreamClaimOptions,
|
|
180
|
-
StreamReadGroupOptions,
|
|
181
|
-
StreamReadOptions,
|
|
182
|
-
StreamPendingOptions,
|
|
183
|
-
ClosingError,
|
|
184
|
-
ConfigurationError,
|
|
185
|
-
ExecAbortError,
|
|
186
|
-
ValkeyError,
|
|
187
|
-
GlideReturnType,
|
|
188
|
-
RequestError,
|
|
189
|
-
TimeoutError,
|
|
190
|
-
ConnectionError,
|
|
191
|
-
ClusterTransaction,
|
|
192
|
-
Transaction,
|
|
193
|
-
PubSubMsg,
|
|
194
|
-
ScoreFilter,
|
|
195
|
-
SignedEncoding,
|
|
196
|
-
UnsignedEncoding,
|
|
197
|
-
UpdateByScore,
|
|
198
|
-
createLeakedArray,
|
|
199
|
-
createLeakedAttribute,
|
|
200
|
-
createLeakedBigint,
|
|
201
|
-
createLeakedDouble,
|
|
202
|
-
createLeakedMap,
|
|
203
|
-
createLeakedString,
|
|
204
|
-
Script,
|
|
205
|
-
ObjectType,
|
|
206
|
-
ClusterScanCursor,
|
|
207
|
-
BaseClientConfiguration,
|
|
208
|
-
GlideClusterClientConfiguration,
|
|
209
|
-
LevelOptions,
|
|
210
|
-
ReturnTypeRecord,
|
|
211
|
-
ReturnTypeMap,
|
|
212
|
-
ClusterResponse,
|
|
213
|
-
ReturnTypeAttribute,
|
|
214
|
-
ReturnTypeJson,
|
|
215
|
-
UniversalReturnTypeJson,
|
|
216
|
-
Score,
|
|
217
|
-
ElementAndScore,
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
218
33
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
43
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.getStatistics = exports.ClusterScanCursor = exports.Script = exports.createLeakedStringVec = exports.valueFromSplitPointer = exports.InitInternalLogger = exports.log = exports.StartSocketConnection = exports.AsyncClient = exports.DEFAULT_INFLIGHT_REQUESTS_LIMIT = exports.DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS = exports.DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS = exports.MAX_REQUEST_ARGS_LEN = exports.Level = void 0;
|
|
47
|
+
const Native = __importStar(require("./native"));
|
|
48
|
+
exports.Level = Native.Level, exports.MAX_REQUEST_ARGS_LEN = Native.MAX_REQUEST_ARGS_LEN, exports.DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS = Native.DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS, exports.DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS = Native.DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS, exports.DEFAULT_INFLIGHT_REQUESTS_LIMIT = Native.DEFAULT_INFLIGHT_REQUESTS_LIMIT, exports.AsyncClient = Native.AsyncClient, exports.StartSocketConnection = Native.StartSocketConnection, exports.log = Native.log, exports.InitInternalLogger = Native.InitInternalLogger, exports.valueFromSplitPointer = Native.valueFromSplitPointer, exports.createLeakedStringVec = Native.createLeakedStringVec, exports.Script = Native.Script, exports.ClusterScanCursor = Native.ClusterScanCursor, exports.getStatistics = Native.getStatistics;
|
|
49
|
+
// Export TypeScript APIs
|
|
50
|
+
__exportStar(require("./BaseClient.js"), exports);
|
|
51
|
+
__exportStar(require("./Batch.js"), exports);
|
|
52
|
+
__exportStar(require("./Commands.js"), exports);
|
|
53
|
+
__exportStar(require("./Errors.js"), exports);
|
|
54
|
+
__exportStar(require("./GlideClient.js"), exports);
|
|
55
|
+
__exportStar(require("./GlideClusterClient.js"), exports);
|
|
56
|
+
__exportStar(require("./Logger.js"), exports);
|
|
57
|
+
__exportStar(require("./server-modules/GlideFt.js"), exports);
|
|
58
|
+
__exportStar(require("./server-modules/GlideFtOptions.js"), exports);
|
|
59
|
+
__exportStar(require("./server-modules/GlideJson.js"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const Level: any;
|
|
2
|
+
export const MAX_REQUEST_ARGS_LEN: any;
|
|
3
|
+
export const DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS: any;
|
|
4
|
+
export const DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS: any;
|
|
5
|
+
export const DEFAULT_INFLIGHT_REQUESTS_LIMIT: any;
|
|
6
|
+
export const AsyncClient: any;
|
|
7
|
+
export const StartSocketConnection: any;
|
|
8
|
+
export const log: any;
|
|
9
|
+
export const InitInternalLogger: any;
|
|
10
|
+
export const valueFromSplitPointer: any;
|
|
11
|
+
export const createLeakedStringVec: any;
|
|
12
|
+
export const Script: any;
|
|
13
|
+
export const ClusterScanCursor: any;
|
|
14
|
+
export const getStatistics: any;
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/* prettier-ignore */
|
|
5
|
+
/* auto-generated by NAPI-RS */
|
|
6
|
+
const { existsSync, readFileSync } = require('fs');
|
|
7
|
+
const { join } = require("path");
|
|
8
|
+
const { platform, arch } = process;
|
|
9
|
+
let nativeBinding = null;
|
|
10
|
+
let localFileExisted = false;
|
|
11
|
+
let loadError = null;
|
|
12
|
+
function isMusl() {
|
|
13
|
+
// For Node 10
|
|
14
|
+
if (!process.report || typeof process.report.getReport !== "function") {
|
|
15
|
+
try {
|
|
16
|
+
const lddPath = require("child_process")
|
|
17
|
+
.execSync("which ldd")
|
|
18
|
+
.toString()
|
|
19
|
+
.trim();
|
|
20
|
+
return readFileSync(lddPath, "utf8").includes("musl");
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const { glibcVersionRuntime } = process.report.getReport().header;
|
|
28
|
+
return !glibcVersionRuntime;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
switch (platform) {
|
|
32
|
+
case "android":
|
|
33
|
+
switch (arch) {
|
|
34
|
+
case "arm64":
|
|
35
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.android-arm64.node"));
|
|
36
|
+
try {
|
|
37
|
+
if (localFileExisted) {
|
|
38
|
+
nativeBinding = require("./valkey-glide.android-arm64.node");
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
nativeBinding = require("@valkey/valkey-glide-android-arm64");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
loadError = e;
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
case "arm":
|
|
49
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.android-arm-eabi.node"));
|
|
50
|
+
try {
|
|
51
|
+
if (localFileExisted) {
|
|
52
|
+
nativeBinding = require("./valkey-glide.android-arm-eabi.node");
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
nativeBinding = require("@valkey/valkey-glide-android-arm-eabi");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
loadError = e;
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
throw new Error(`Unsupported architecture on Android ${arch}`);
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case "win32":
|
|
67
|
+
switch (arch) {
|
|
68
|
+
case "x64":
|
|
69
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.win32-x64-msvc.node"));
|
|
70
|
+
try {
|
|
71
|
+
if (localFileExisted) {
|
|
72
|
+
nativeBinding = require("./valkey-glide.win32-x64-msvc.node");
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
nativeBinding = require("@valkey/valkey-glide-win32-x64-msvc");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
loadError = e;
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
case "ia32":
|
|
83
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.win32-ia32-msvc.node"));
|
|
84
|
+
try {
|
|
85
|
+
if (localFileExisted) {
|
|
86
|
+
nativeBinding = require("./valkey-glide.win32-ia32-msvc.node");
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
nativeBinding = require("@valkey/valkey-glide-win32-ia32-msvc");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
loadError = e;
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
case "arm64":
|
|
97
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.win32-arm64-msvc.node"));
|
|
98
|
+
try {
|
|
99
|
+
if (localFileExisted) {
|
|
100
|
+
nativeBinding = require("./valkey-glide.win32-arm64-msvc.node");
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
nativeBinding = require("@valkey/valkey-glide-win32-arm64-msvc");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
loadError = e;
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
throw new Error(`Unsupported architecture on Windows: ${arch}`);
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
case "darwin":
|
|
115
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.darwin-universal.node"));
|
|
116
|
+
try {
|
|
117
|
+
if (localFileExisted) {
|
|
118
|
+
nativeBinding = require("./valkey-glide.darwin-universal.node");
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
nativeBinding = require("@valkey/valkey-glide-darwin-universal");
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
catch { }
|
|
126
|
+
switch (arch) {
|
|
127
|
+
case "x64":
|
|
128
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.darwin-x64.node"));
|
|
129
|
+
try {
|
|
130
|
+
if (localFileExisted) {
|
|
131
|
+
nativeBinding = require("./valkey-glide.darwin-x64.node");
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
nativeBinding = require("@valkey/valkey-glide-darwin-x64");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch (e) {
|
|
138
|
+
loadError = e;
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
case "arm64":
|
|
142
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.darwin-arm64.node"));
|
|
143
|
+
try {
|
|
144
|
+
if (localFileExisted) {
|
|
145
|
+
nativeBinding = require("./valkey-glide.darwin-arm64.node");
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
nativeBinding = require("@valkey/valkey-glide-darwin-arm64");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
loadError = e;
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
throw new Error(`Unsupported architecture on macOS: ${arch}`);
|
|
157
|
+
}
|
|
158
|
+
break;
|
|
159
|
+
case "freebsd":
|
|
160
|
+
if (arch !== "x64") {
|
|
161
|
+
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
|
|
162
|
+
}
|
|
163
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.freebsd-x64.node"));
|
|
164
|
+
try {
|
|
165
|
+
if (localFileExisted) {
|
|
166
|
+
nativeBinding = require("./valkey-glide.freebsd-x64.node");
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
nativeBinding = require("@valkey/valkey-glide-freebsd-x64");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
loadError = e;
|
|
174
|
+
}
|
|
175
|
+
break;
|
|
176
|
+
case "linux":
|
|
177
|
+
switch (arch) {
|
|
178
|
+
case "x64":
|
|
179
|
+
if (isMusl()) {
|
|
180
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-x64-musl.node"));
|
|
181
|
+
try {
|
|
182
|
+
if (localFileExisted) {
|
|
183
|
+
nativeBinding = require("./valkey-glide.linux-x64-musl.node");
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
nativeBinding = require("@valkey/valkey-glide-linux-x64-musl");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch (e) {
|
|
190
|
+
loadError = e;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-x64-gnu.node"));
|
|
195
|
+
try {
|
|
196
|
+
if (localFileExisted) {
|
|
197
|
+
nativeBinding = require("./valkey-glide.linux-x64-gnu.node");
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
nativeBinding = require("@valkey/valkey-glide-linux-x64-gnu");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
catch (e) {
|
|
204
|
+
loadError = e;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
break;
|
|
208
|
+
case "arm64":
|
|
209
|
+
if (isMusl()) {
|
|
210
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-arm64-musl.node"));
|
|
211
|
+
try {
|
|
212
|
+
if (localFileExisted) {
|
|
213
|
+
nativeBinding = require("./valkey-glide.linux-arm64-musl.node");
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
nativeBinding = require("@valkey/valkey-glide-linux-arm64-musl");
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (e) {
|
|
220
|
+
loadError = e;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-arm64-gnu.node"));
|
|
225
|
+
try {
|
|
226
|
+
if (localFileExisted) {
|
|
227
|
+
nativeBinding = require("./valkey-glide.linux-arm64-gnu.node");
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
nativeBinding = require("@valkey/valkey-glide-linux-arm64-gnu");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (e) {
|
|
234
|
+
loadError = e;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
238
|
+
case "arm":
|
|
239
|
+
if (isMusl()) {
|
|
240
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-arm-musleabihf.node"));
|
|
241
|
+
try {
|
|
242
|
+
if (localFileExisted) {
|
|
243
|
+
nativeBinding = require("./valkey-glide.linux-arm-musleabihf.node");
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
nativeBinding = require("@valkey/valkey-glide-linux-arm-musleabihf");
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
catch (e) {
|
|
250
|
+
loadError = e;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-arm-gnueabihf.node"));
|
|
255
|
+
try {
|
|
256
|
+
if (localFileExisted) {
|
|
257
|
+
nativeBinding = require("./valkey-glide.linux-arm-gnueabihf.node");
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
nativeBinding = require("@valkey/valkey-glide-linux-arm-gnueabihf");
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
catch (e) {
|
|
264
|
+
loadError = e;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
break;
|
|
268
|
+
case "riscv64":
|
|
269
|
+
if (isMusl()) {
|
|
270
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-riscv64-musl.node"));
|
|
271
|
+
try {
|
|
272
|
+
if (localFileExisted) {
|
|
273
|
+
nativeBinding = require("./valkey-glide.linux-riscv64-musl.node");
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
nativeBinding = require("@valkey/valkey-glide-linux-riscv64-musl");
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
catch (e) {
|
|
280
|
+
loadError = e;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-riscv64-gnu.node"));
|
|
285
|
+
try {
|
|
286
|
+
if (localFileExisted) {
|
|
287
|
+
nativeBinding = require("./valkey-glide.linux-riscv64-gnu.node");
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
nativeBinding = require("@valkey/valkey-glide-linux-riscv64-gnu");
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
catch (e) {
|
|
294
|
+
loadError = e;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
break;
|
|
298
|
+
case "s390x":
|
|
299
|
+
localFileExisted = existsSync(join(__dirname, "valkey-glide.linux-s390x-gnu.node"));
|
|
300
|
+
try {
|
|
301
|
+
if (localFileExisted) {
|
|
302
|
+
nativeBinding = require("./valkey-glide.linux-s390x-gnu.node");
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
nativeBinding = require("@valkey/valkey-glide-linux-s390x-gnu");
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
catch (e) {
|
|
309
|
+
loadError = e;
|
|
310
|
+
}
|
|
311
|
+
break;
|
|
312
|
+
default:
|
|
313
|
+
throw new Error(`Unsupported architecture on Linux: ${arch}`);
|
|
314
|
+
}
|
|
315
|
+
break;
|
|
316
|
+
default:
|
|
317
|
+
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
|
|
318
|
+
}
|
|
319
|
+
if (!nativeBinding) {
|
|
320
|
+
if (loadError) {
|
|
321
|
+
throw loadError;
|
|
322
|
+
}
|
|
323
|
+
throw new Error(`Failed to load native binding`);
|
|
324
|
+
}
|
|
325
|
+
const { Level, MAX_REQUEST_ARGS_LEN, DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS, DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS, DEFAULT_INFLIGHT_REQUESTS_LIMIT, AsyncClient, StartSocketConnection, log, InitInternalLogger, valueFromSplitPointer, createLeakedStringVec, Script, ClusterScanCursor, getStatistics, } = nativeBinding;
|
|
326
|
+
module.exports.Level = Level;
|
|
327
|
+
module.exports.MAX_REQUEST_ARGS_LEN = MAX_REQUEST_ARGS_LEN;
|
|
328
|
+
module.exports.DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS =
|
|
329
|
+
DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS;
|
|
330
|
+
module.exports.DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS =
|
|
331
|
+
DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS;
|
|
332
|
+
module.exports.DEFAULT_INFLIGHT_REQUESTS_LIMIT =
|
|
333
|
+
DEFAULT_INFLIGHT_REQUESTS_LIMIT;
|
|
334
|
+
module.exports.AsyncClient = AsyncClient;
|
|
335
|
+
module.exports.StartSocketConnection = StartSocketConnection;
|
|
336
|
+
module.exports.log = log;
|
|
337
|
+
module.exports.InitInternalLogger = InitInternalLogger;
|
|
338
|
+
module.exports.valueFromSplitPointer = valueFromSplitPointer;
|
|
339
|
+
module.exports.createLeakedStringVec = createLeakedStringVec;
|
|
340
|
+
module.exports.Script = Script;
|
|
341
|
+
module.exports.ClusterScanCursor = ClusterScanCursor;
|
|
342
|
+
module.exports.getStatistics = getStatistics;
|