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.cjs
CHANGED
|
@@ -4871,11 +4871,21 @@ async function decompress(buffer, type, chunkSize = 128 * 1024) {
|
|
|
4871
4871
|
});
|
|
4872
4872
|
const decompressionStream = new DecompressionStream(type);
|
|
4873
4873
|
const decompressedStream = readableStream.pipeThrough(decompressionStream);
|
|
4874
|
+
const reader = decompressedStream.getReader();
|
|
4874
4875
|
const chunks = [];
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4876
|
+
let totalLength = 0;
|
|
4877
|
+
let result;
|
|
4878
|
+
while (!(result = await reader.read()).done) {
|
|
4879
|
+
chunks.push(result.value);
|
|
4880
|
+
totalLength += result.value.length;
|
|
4881
|
+
}
|
|
4882
|
+
const decompressedArray = new Uint8Array(totalLength);
|
|
4883
|
+
let chunkOffset = 0;
|
|
4884
|
+
for (const chunk of chunks) {
|
|
4885
|
+
decompressedArray.set(chunk, chunkOffset);
|
|
4886
|
+
chunkOffset += chunk.length;
|
|
4887
|
+
}
|
|
4888
|
+
return decompressedArray;
|
|
4879
4889
|
}
|
|
4880
4890
|
|
|
4881
4891
|
// src/sdk/ws.ts
|
|
@@ -6550,7 +6560,10 @@ var ModuleContext = class {
|
|
|
6550
6560
|
schedules: [],
|
|
6551
6561
|
procedures: [],
|
|
6552
6562
|
views: [],
|
|
6563
|
+
viewPrimaryKeys: [],
|
|
6553
6564
|
lifeCycleReducers: [],
|
|
6565
|
+
httpHandlers: [],
|
|
6566
|
+
httpRoutes: [],
|
|
6554
6567
|
caseConversionPolicy: { tag: "SnakeCase" },
|
|
6555
6568
|
explicitNames: {
|
|
6556
6569
|
entries: []
|
|
@@ -6571,6 +6584,12 @@ var ModuleContext = class {
|
|
|
6571
6584
|
push(module.reducers && { tag: "Reducers", value: module.reducers });
|
|
6572
6585
|
push(module.procedures && { tag: "Procedures", value: module.procedures });
|
|
6573
6586
|
push(module.views && { tag: "Views", value: module.views });
|
|
6587
|
+
push(
|
|
6588
|
+
module.viewPrimaryKeys && {
|
|
6589
|
+
tag: "ViewPrimaryKeys",
|
|
6590
|
+
value: module.viewPrimaryKeys
|
|
6591
|
+
}
|
|
6592
|
+
);
|
|
6574
6593
|
push(module.schedules && { tag: "Schedules", value: module.schedules });
|
|
6575
6594
|
push(
|
|
6576
6595
|
module.lifeCycleReducers && {
|
|
@@ -6578,6 +6597,18 @@ var ModuleContext = class {
|
|
|
6578
6597
|
value: module.lifeCycleReducers
|
|
6579
6598
|
}
|
|
6580
6599
|
);
|
|
6600
|
+
push(
|
|
6601
|
+
module.httpHandlers && {
|
|
6602
|
+
tag: "HttpHandlers",
|
|
6603
|
+
value: module.httpHandlers
|
|
6604
|
+
}
|
|
6605
|
+
);
|
|
6606
|
+
push(
|
|
6607
|
+
module.httpRoutes && {
|
|
6608
|
+
tag: "HttpRoutes",
|
|
6609
|
+
value: module.httpRoutes
|
|
6610
|
+
}
|
|
6611
|
+
);
|
|
6581
6612
|
push(
|
|
6582
6613
|
module.rowLevelSecurity && {
|
|
6583
6614
|
tag: "RowLevelSecurity",
|
|
@@ -6836,6 +6867,12 @@ var Lifecycle = t.enum("Lifecycle", {
|
|
|
6836
6867
|
OnConnect: t.unit(),
|
|
6837
6868
|
OnDisconnect: t.unit()
|
|
6838
6869
|
});
|
|
6870
|
+
var MethodOrAny = t.enum("MethodOrAny", {
|
|
6871
|
+
Any: t.unit(),
|
|
6872
|
+
get Method() {
|
|
6873
|
+
return HttpMethod;
|
|
6874
|
+
}
|
|
6875
|
+
});
|
|
6839
6876
|
var MiscModuleExport = t.enum("MiscModuleExport", {
|
|
6840
6877
|
get TypeAlias() {
|
|
6841
6878
|
return TypeAlias;
|
|
@@ -6893,6 +6930,16 @@ var RawConstraintDefV9 = t.object("RawConstraintDefV9", {
|
|
|
6893
6930
|
return RawConstraintDataV9;
|
|
6894
6931
|
}
|
|
6895
6932
|
});
|
|
6933
|
+
var RawHttpHandlerDefV10 = t.object("RawHttpHandlerDefV10", {
|
|
6934
|
+
sourceName: t.string()
|
|
6935
|
+
});
|
|
6936
|
+
var RawHttpRouteDefV10 = t.object("RawHttpRouteDefV10", {
|
|
6937
|
+
handlerFunction: t.string(),
|
|
6938
|
+
get method() {
|
|
6939
|
+
return MethodOrAny;
|
|
6940
|
+
},
|
|
6941
|
+
path: t.string()
|
|
6942
|
+
});
|
|
6896
6943
|
var RawIndexAlgorithm = t.enum("RawIndexAlgorithm", {
|
|
6897
6944
|
BTree: t.array(t.u16()),
|
|
6898
6945
|
Hash: t.array(t.u16()),
|
|
@@ -6989,6 +7036,15 @@ var RawModuleDefV10Section = t.enum("RawModuleDefV10Section", {
|
|
|
6989
7036
|
},
|
|
6990
7037
|
get ExplicitNames() {
|
|
6991
7038
|
return ExplicitNames;
|
|
7039
|
+
},
|
|
7040
|
+
get HttpHandlers() {
|
|
7041
|
+
return t.array(RawHttpHandlerDefV10);
|
|
7042
|
+
},
|
|
7043
|
+
get HttpRoutes() {
|
|
7044
|
+
return t.array(RawHttpRouteDefV10);
|
|
7045
|
+
},
|
|
7046
|
+
get ViewPrimaryKeys() {
|
|
7047
|
+
return t.array(RawViewPrimaryKeyDefV10);
|
|
6992
7048
|
}
|
|
6993
7049
|
});
|
|
6994
7050
|
var RawModuleDefV8 = t.object("RawModuleDefV8", {
|
|
@@ -7226,6 +7282,10 @@ var RawViewDefV9 = t.object("RawViewDefV9", {
|
|
|
7226
7282
|
return AlgebraicType2;
|
|
7227
7283
|
}
|
|
7228
7284
|
});
|
|
7285
|
+
var RawViewPrimaryKeyDefV10 = t.object("RawViewPrimaryKeyDefV10", {
|
|
7286
|
+
viewSourceName: t.string(),
|
|
7287
|
+
columns: t.array(t.string())
|
|
7288
|
+
});
|
|
7229
7289
|
var ReducerDef = t.object("ReducerDef", {
|
|
7230
7290
|
name: t.string(),
|
|
7231
7291
|
get args() {
|