@super-line/server 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +348 -16480
- package/dist/index.d.cts +175 -20
- package/dist/index.d.ts +175 -20
- package/dist/index.js +317 -205
- package/package.json +8 -7
- package/dist/arktype-aI7TBD0R-QUZZIMBF.js +0 -9
- package/dist/chunk-BXHVPS35.js +0 -164
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/core-DXJRFNRR.js +0 -9858
- package/dist/dist-S566F7HE.js +0 -9
- package/dist/effect-QlVUlMFu-XUZCEH2A.js +0 -17
- package/dist/esm-F5WYXMGY.js +0 -5222
- package/dist/sury-CWZTCd75-XRKNS4FU.js +0 -17
- package/dist/typebox-Dei93FPO-EURKZGC4.js +0 -9
- package/dist/valibot--1zFm7rT-CYY6WSKB.js +0 -17
- package/dist/zod-Bwrt9trS-3RR2G3Z5.js +0 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@super-line/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Realtime data-bus server for super-line — requests, events, rooms, topics, stores, pluggable transports & adapters.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@super-line/core": "^0.
|
|
50
|
+
"@super-line/core": "^0.10.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
@@ -68,14 +68,15 @@
|
|
|
68
68
|
"zeromq": "^6.0.0",
|
|
69
69
|
"zod": "^3.24.1",
|
|
70
70
|
"zod-to-json-schema": "^3.25.2",
|
|
71
|
-
"@super-line/
|
|
72
|
-
"@super-line/adapter-rabbitmq": "0.5.0",
|
|
73
|
-
"@super-line/client": "0.7.0",
|
|
71
|
+
"@super-line/client": "0.8.0",
|
|
74
72
|
"@super-line/adapter-zeromq": "0.5.0",
|
|
73
|
+
"@super-line/adapter-rabbitmq": "0.5.0",
|
|
75
74
|
"@super-line/adapter-redis": "0.5.0",
|
|
75
|
+
"@super-line/plugin-inspector": "0.1.0",
|
|
76
76
|
"@super-line/transport-http": "0.5.0",
|
|
77
|
-
"@super-line/transport-websocket": "0.
|
|
78
|
-
"@super-line/transport-loopback": "0.5.0"
|
|
77
|
+
"@super-line/transport-websocket": "0.6.0",
|
|
78
|
+
"@super-line/transport-loopback": "0.5.0",
|
|
79
|
+
"@super-line/adapter-libp2p": "0.6.0"
|
|
79
80
|
},
|
|
80
81
|
"optionalDependencies": {
|
|
81
82
|
"@standard-community/standard-json": "^0.3.5"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./chunk-MLKGABMK.js";
|
|
2
|
-
|
|
3
|
-
// ../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_c5121037ae681f5d570421df77d4831b/node_modules/@standard-community/standard-json/dist/arktype-aI7TBD0R.js
|
|
4
|
-
function getToJsonSchemaFn() {
|
|
5
|
-
return (schema, options) => schema.toJsonSchema(options);
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
getToJsonSchemaFn as default
|
|
9
|
-
};
|
package/dist/chunk-BXHVPS35.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/quansync@0.2.11/node_modules/quansync/dist/index.mjs
|
|
2
|
-
var GET_IS_ASYNC = /* @__PURE__ */ Symbol.for("quansync.getIsAsync");
|
|
3
|
-
var QuansyncError = class extends Error {
|
|
4
|
-
constructor(message = "Unexpected promise in sync context") {
|
|
5
|
-
super(message);
|
|
6
|
-
this.name = "QuansyncError";
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
function isThenable(value) {
|
|
10
|
-
return value && typeof value === "object" && typeof value.then === "function";
|
|
11
|
-
}
|
|
12
|
-
function isQuansyncGenerator(value) {
|
|
13
|
-
return value && typeof value === "object" && typeof value[Symbol.iterator] === "function" && "__quansync" in value;
|
|
14
|
-
}
|
|
15
|
-
function fromObject(options) {
|
|
16
|
-
const generator = function* (...args) {
|
|
17
|
-
const isAsync = yield GET_IS_ASYNC;
|
|
18
|
-
if (isAsync)
|
|
19
|
-
return yield options.async.apply(this, args);
|
|
20
|
-
return options.sync.apply(this, args);
|
|
21
|
-
};
|
|
22
|
-
function fn(...args) {
|
|
23
|
-
const iter = generator.apply(this, args);
|
|
24
|
-
iter.then = (...thenArgs) => options.async.apply(this, args).then(...thenArgs);
|
|
25
|
-
iter.__quansync = true;
|
|
26
|
-
return iter;
|
|
27
|
-
}
|
|
28
|
-
fn.sync = options.sync;
|
|
29
|
-
fn.async = options.async;
|
|
30
|
-
return fn;
|
|
31
|
-
}
|
|
32
|
-
function fromPromise(promise) {
|
|
33
|
-
return fromObject({
|
|
34
|
-
async: () => Promise.resolve(promise),
|
|
35
|
-
sync: () => {
|
|
36
|
-
if (isThenable(promise))
|
|
37
|
-
throw new QuansyncError();
|
|
38
|
-
return promise;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function unwrapYield(value, isAsync) {
|
|
43
|
-
if (value === GET_IS_ASYNC)
|
|
44
|
-
return isAsync;
|
|
45
|
-
if (isQuansyncGenerator(value))
|
|
46
|
-
return isAsync ? iterateAsync(value) : iterateSync(value);
|
|
47
|
-
if (!isAsync && isThenable(value))
|
|
48
|
-
throw new QuansyncError();
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
var DEFAULT_ON_YIELD = (value) => value;
|
|
52
|
-
function iterateSync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
53
|
-
let current = generator.next();
|
|
54
|
-
while (!current.done) {
|
|
55
|
-
try {
|
|
56
|
-
current = generator.next(unwrapYield(onYield(current.value, false)));
|
|
57
|
-
} catch (err) {
|
|
58
|
-
current = generator.throw(err);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return unwrapYield(current.value);
|
|
62
|
-
}
|
|
63
|
-
async function iterateAsync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
64
|
-
let current = generator.next();
|
|
65
|
-
while (!current.done) {
|
|
66
|
-
try {
|
|
67
|
-
current = generator.next(await unwrapYield(onYield(current.value, true), true));
|
|
68
|
-
} catch (err) {
|
|
69
|
-
current = generator.throw(err);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return current.value;
|
|
73
|
-
}
|
|
74
|
-
function fromGeneratorFn(generatorFn, options) {
|
|
75
|
-
return fromObject({
|
|
76
|
-
name: generatorFn.name,
|
|
77
|
-
async(...args) {
|
|
78
|
-
return iterateAsync(generatorFn.apply(this, args), options?.onYield);
|
|
79
|
-
},
|
|
80
|
-
sync(...args) {
|
|
81
|
-
return iterateSync(generatorFn.apply(this, args), options?.onYield);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function quansync(input, options) {
|
|
86
|
-
if (isThenable(input))
|
|
87
|
-
return fromPromise(input);
|
|
88
|
-
if (typeof input === "function")
|
|
89
|
-
return fromGeneratorFn(input, options);
|
|
90
|
-
else
|
|
91
|
-
return fromObject(input);
|
|
92
|
-
}
|
|
93
|
-
var getIsAsync = quansync({
|
|
94
|
-
async: () => Promise.resolve(true),
|
|
95
|
-
sync: () => false
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// ../../node_modules/.pnpm/@standard-community+standard-json@0.3.5_@standard-schema+spec@1.1.0_@types+json-schema@_c5121037ae681f5d570421df77d4831b/node_modules/@standard-community/standard-json/dist/index-CLddUTqr.js
|
|
99
|
-
var validationMapper = /* @__PURE__ */ new Map();
|
|
100
|
-
var UnsupportedVendorError = class extends Error {
|
|
101
|
-
constructor(vendor) {
|
|
102
|
-
super(`standard-json: Unsupported schema vendor "${vendor}".`);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
var MissingDependencyError = class extends Error {
|
|
106
|
-
constructor(packageName) {
|
|
107
|
-
super(`standard-json: Missing dependencies "${packageName}".`);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
var getToJsonSchemaFn = async (vendor) => {
|
|
111
|
-
const cached = validationMapper.get(vendor);
|
|
112
|
-
if (cached) {
|
|
113
|
-
return cached;
|
|
114
|
-
}
|
|
115
|
-
let vendorFnPromise;
|
|
116
|
-
switch (vendor) {
|
|
117
|
-
case "arktype":
|
|
118
|
-
vendorFnPromise = (await import("./arktype-aI7TBD0R-QUZZIMBF.js")).default();
|
|
119
|
-
break;
|
|
120
|
-
case "effect":
|
|
121
|
-
vendorFnPromise = (await import("./effect-QlVUlMFu-XUZCEH2A.js")).default();
|
|
122
|
-
break;
|
|
123
|
-
case "sury":
|
|
124
|
-
vendorFnPromise = (await import("./sury-CWZTCd75-XRKNS4FU.js")).default();
|
|
125
|
-
break;
|
|
126
|
-
case "typebox":
|
|
127
|
-
vendorFnPromise = (await import("./typebox-Dei93FPO-EURKZGC4.js")).default();
|
|
128
|
-
break;
|
|
129
|
-
case "valibot":
|
|
130
|
-
vendorFnPromise = (await import("./valibot--1zFm7rT-CYY6WSKB.js")).default();
|
|
131
|
-
break;
|
|
132
|
-
case "zod":
|
|
133
|
-
vendorFnPromise = (await import("./zod-Bwrt9trS-3RR2G3Z5.js")).default();
|
|
134
|
-
break;
|
|
135
|
-
default:
|
|
136
|
-
throw new UnsupportedVendorError(vendor);
|
|
137
|
-
}
|
|
138
|
-
const vendorFn = await vendorFnPromise;
|
|
139
|
-
validationMapper.set(vendor, vendorFn);
|
|
140
|
-
return vendorFn;
|
|
141
|
-
};
|
|
142
|
-
var toJsonSchema = quansync({
|
|
143
|
-
sync: (schema, options) => {
|
|
144
|
-
const vendor = schema["~standard"].vendor;
|
|
145
|
-
const fn = validationMapper.get(vendor);
|
|
146
|
-
if (!fn) {
|
|
147
|
-
throw new UnsupportedVendorError(vendor);
|
|
148
|
-
}
|
|
149
|
-
return fn(schema, options);
|
|
150
|
-
},
|
|
151
|
-
async: async (schema, options) => {
|
|
152
|
-
const fn = await getToJsonSchemaFn(schema["~standard"].vendor);
|
|
153
|
-
return fn(schema, options);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
function loadVendor(vendor, fn) {
|
|
157
|
-
validationMapper.set(vendor, fn);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export {
|
|
161
|
-
MissingDependencyError,
|
|
162
|
-
toJsonSchema,
|
|
163
|
-
loadVendor
|
|
164
|
-
};
|