spacetimedb 2.3.0 → 2.4.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/LICENSE.txt +2 -2
- package/dist/index.browser.mjs +64 -4
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.cjs +64 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +64 -4
- package/dist/index.mjs.map +1 -1
- package/dist/lib/autogen/types.d.ts +675 -2
- package/dist/lib/autogen/types.d.ts.map +1 -1
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/min/index.browser.mjs +1 -1
- package/dist/min/index.browser.mjs.map +1 -1
- package/dist/min/sdk/index.browser.mjs +1 -1
- package/dist/min/sdk/index.browser.mjs.map +1 -1
- package/dist/sdk/decompress.d.ts.map +1 -1
- package/dist/sdk/index.browser.mjs +64 -4
- package/dist/sdk/index.browser.mjs.map +1 -1
- package/dist/sdk/index.cjs +64 -4
- package/dist/sdk/index.cjs.map +1 -1
- package/dist/sdk/index.mjs +64 -4
- package/dist/sdk/index.mjs.map +1 -1
- package/dist/server/http.d.ts +1 -2
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.test-d.d.ts +2 -0
- package/dist/server/http.test-d.d.ts.map +1 -0
- package/dist/server/http_handlers.d.ts +82 -0
- package/dist/server/http_handlers.d.ts.map +1 -0
- package/dist/server/http_internal.d.ts +1 -32
- package/dist/server/http_internal.d.ts.map +1 -1
- package/dist/server/http_shared.d.ts +44 -0
- package/dist/server/http_shared.d.ts.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.mjs +628 -136
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/runtime.d.ts +1 -0
- package/dist/server/runtime.d.ts.map +1 -1
- package/dist/server/schema.d.ts +19 -4
- package/dist/server/schema.d.ts.map +1 -1
- package/dist/server/views.d.ts +17 -1
- package/dist/server/views.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/autogen/types.ts +38 -0
- package/src/lib/schema.ts +21 -0
- package/src/sdk/decompress.ts +19 -4
- package/src/sdk/logger.ts +1 -1
- package/src/server/http.test-d.ts +80 -0
- package/src/server/http.ts +14 -2
- package/src/server/http_handlers.ts +413 -0
- package/src/server/http_internal.ts +15 -142
- package/src/server/http_shared.ts +186 -0
- package/src/server/index.ts +11 -0
- package/src/server/procedures.ts +8 -30
- package/src/server/runtime.ts +137 -1
- package/src/server/schema.ts +86 -4
- package/src/server/sys.d.ts +7 -0
- package/src/server/view.test-d.ts +22 -0
- package/src/server/views.ts +127 -0
- package/dist/lib/http_types.d.ts +0 -2
- package/dist/lib/http_types.d.ts.map +0 -1
- package/src/lib/http_types.ts +0 -8
package/dist/sdk/index.mjs
CHANGED
|
@@ -4869,11 +4869,21 @@ async function decompress(buffer, type, chunkSize = 128 * 1024) {
|
|
|
4869
4869
|
});
|
|
4870
4870
|
const decompressionStream = new DecompressionStream(type);
|
|
4871
4871
|
const decompressedStream = readableStream.pipeThrough(decompressionStream);
|
|
4872
|
+
const reader = decompressedStream.getReader();
|
|
4872
4873
|
const chunks = [];
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4874
|
+
let totalLength = 0;
|
|
4875
|
+
let result;
|
|
4876
|
+
while (!(result = await reader.read()).done) {
|
|
4877
|
+
chunks.push(result.value);
|
|
4878
|
+
totalLength += result.value.length;
|
|
4879
|
+
}
|
|
4880
|
+
const decompressedArray = new Uint8Array(totalLength);
|
|
4881
|
+
let chunkOffset = 0;
|
|
4882
|
+
for (const chunk of chunks) {
|
|
4883
|
+
decompressedArray.set(chunk, chunkOffset);
|
|
4884
|
+
chunkOffset += chunk.length;
|
|
4885
|
+
}
|
|
4886
|
+
return decompressedArray;
|
|
4877
4887
|
}
|
|
4878
4888
|
|
|
4879
4889
|
// src/sdk/ws.ts
|
|
@@ -6548,7 +6558,10 @@ var ModuleContext = class {
|
|
|
6548
6558
|
schedules: [],
|
|
6549
6559
|
procedures: [],
|
|
6550
6560
|
views: [],
|
|
6561
|
+
viewPrimaryKeys: [],
|
|
6551
6562
|
lifeCycleReducers: [],
|
|
6563
|
+
httpHandlers: [],
|
|
6564
|
+
httpRoutes: [],
|
|
6552
6565
|
caseConversionPolicy: { tag: "SnakeCase" },
|
|
6553
6566
|
explicitNames: {
|
|
6554
6567
|
entries: []
|
|
@@ -6569,6 +6582,12 @@ var ModuleContext = class {
|
|
|
6569
6582
|
push(module.reducers && { tag: "Reducers", value: module.reducers });
|
|
6570
6583
|
push(module.procedures && { tag: "Procedures", value: module.procedures });
|
|
6571
6584
|
push(module.views && { tag: "Views", value: module.views });
|
|
6585
|
+
push(
|
|
6586
|
+
module.viewPrimaryKeys && {
|
|
6587
|
+
tag: "ViewPrimaryKeys",
|
|
6588
|
+
value: module.viewPrimaryKeys
|
|
6589
|
+
}
|
|
6590
|
+
);
|
|
6572
6591
|
push(module.schedules && { tag: "Schedules", value: module.schedules });
|
|
6573
6592
|
push(
|
|
6574
6593
|
module.lifeCycleReducers && {
|
|
@@ -6576,6 +6595,18 @@ var ModuleContext = class {
|
|
|
6576
6595
|
value: module.lifeCycleReducers
|
|
6577
6596
|
}
|
|
6578
6597
|
);
|
|
6598
|
+
push(
|
|
6599
|
+
module.httpHandlers && {
|
|
6600
|
+
tag: "HttpHandlers",
|
|
6601
|
+
value: module.httpHandlers
|
|
6602
|
+
}
|
|
6603
|
+
);
|
|
6604
|
+
push(
|
|
6605
|
+
module.httpRoutes && {
|
|
6606
|
+
tag: "HttpRoutes",
|
|
6607
|
+
value: module.httpRoutes
|
|
6608
|
+
}
|
|
6609
|
+
);
|
|
6579
6610
|
push(
|
|
6580
6611
|
module.rowLevelSecurity && {
|
|
6581
6612
|
tag: "RowLevelSecurity",
|
|
@@ -6834,6 +6865,12 @@ var Lifecycle = t.enum("Lifecycle", {
|
|
|
6834
6865
|
OnConnect: t.unit(),
|
|
6835
6866
|
OnDisconnect: t.unit()
|
|
6836
6867
|
});
|
|
6868
|
+
var MethodOrAny = t.enum("MethodOrAny", {
|
|
6869
|
+
Any: t.unit(),
|
|
6870
|
+
get Method() {
|
|
6871
|
+
return HttpMethod;
|
|
6872
|
+
}
|
|
6873
|
+
});
|
|
6837
6874
|
var MiscModuleExport = t.enum("MiscModuleExport", {
|
|
6838
6875
|
get TypeAlias() {
|
|
6839
6876
|
return TypeAlias;
|
|
@@ -6891,6 +6928,16 @@ var RawConstraintDefV9 = t.object("RawConstraintDefV9", {
|
|
|
6891
6928
|
return RawConstraintDataV9;
|
|
6892
6929
|
}
|
|
6893
6930
|
});
|
|
6931
|
+
var RawHttpHandlerDefV10 = t.object("RawHttpHandlerDefV10", {
|
|
6932
|
+
sourceName: t.string()
|
|
6933
|
+
});
|
|
6934
|
+
var RawHttpRouteDefV10 = t.object("RawHttpRouteDefV10", {
|
|
6935
|
+
handlerFunction: t.string(),
|
|
6936
|
+
get method() {
|
|
6937
|
+
return MethodOrAny;
|
|
6938
|
+
},
|
|
6939
|
+
path: t.string()
|
|
6940
|
+
});
|
|
6894
6941
|
var RawIndexAlgorithm = t.enum("RawIndexAlgorithm", {
|
|
6895
6942
|
BTree: t.array(t.u16()),
|
|
6896
6943
|
Hash: t.array(t.u16()),
|
|
@@ -6987,6 +7034,15 @@ var RawModuleDefV10Section = t.enum("RawModuleDefV10Section", {
|
|
|
6987
7034
|
},
|
|
6988
7035
|
get ExplicitNames() {
|
|
6989
7036
|
return ExplicitNames;
|
|
7037
|
+
},
|
|
7038
|
+
get HttpHandlers() {
|
|
7039
|
+
return t.array(RawHttpHandlerDefV10);
|
|
7040
|
+
},
|
|
7041
|
+
get HttpRoutes() {
|
|
7042
|
+
return t.array(RawHttpRouteDefV10);
|
|
7043
|
+
},
|
|
7044
|
+
get ViewPrimaryKeys() {
|
|
7045
|
+
return t.array(RawViewPrimaryKeyDefV10);
|
|
6990
7046
|
}
|
|
6991
7047
|
});
|
|
6992
7048
|
var RawModuleDefV8 = t.object("RawModuleDefV8", {
|
|
@@ -7224,6 +7280,10 @@ var RawViewDefV9 = t.object("RawViewDefV9", {
|
|
|
7224
7280
|
return AlgebraicType2;
|
|
7225
7281
|
}
|
|
7226
7282
|
});
|
|
7283
|
+
var RawViewPrimaryKeyDefV10 = t.object("RawViewPrimaryKeyDefV10", {
|
|
7284
|
+
viewSourceName: t.string(),
|
|
7285
|
+
columns: t.array(t.string())
|
|
7286
|
+
});
|
|
7227
7287
|
var ReducerDef = t.object("ReducerDef", {
|
|
7228
7288
|
name: t.string(),
|
|
7229
7289
|
get args() {
|