@fitzzero/quickdraw-core 5.0.0 → 5.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/README.md +343 -49
- package/dist/{admin-BiU4LRZS.d.ts → admin-DKwkIh5i.d.ts} +25 -10
- package/dist/{adminSchemas-k5a1Ov7b.d.ts → adminSchemas-2DUA_hZ8.d.ts} +15 -9
- package/dist/{auth-CMyRkfjZ.d.ts → auth-BhWqdyb-.d.ts} +2 -2
- package/dist/{caller-DHzK3oiI.d.ts → caller-CXTFswBO.d.ts} +28 -6
- package/dist/{chunk-2XJFNVHW.js → chunk-2PWMUVC7.js} +1 -1
- package/dist/{chunk-2XJFNVHW.js.map → chunk-2PWMUVC7.js.map} +1 -1
- package/dist/{chunk-5IC5VZ7T.js → chunk-2UELNHDD.js} +3 -3
- package/dist/{chunk-XFDOGTMC.js → chunk-3674EIRT.js} +4 -4
- package/dist/{chunk-DNCAI3KY.js → chunk-4DIQHASK.js} +1 -1
- package/dist/chunk-4DIQHASK.js.map +1 -0
- package/dist/{chunk-LLLYILEP.js → chunk-A6DJBGOG.js} +411 -43
- package/dist/chunk-A6DJBGOG.js.map +1 -0
- package/dist/{chunk-B2UQ27GH.js → chunk-CDKG4TFA.js} +25 -5
- package/dist/{chunk-B2UQ27GH.js.map → chunk-CDKG4TFA.js.map} +1 -1
- package/dist/{chunk-IRGAGRVG.js → chunk-JZBCLNDU.js} +4 -4
- package/dist/{chunk-XUSN5WKU.js → chunk-KNDDCVQJ.js} +4 -4
- package/dist/{chunk-5YRQ26LF.js → chunk-RT6OILOI.js} +1 -1
- package/dist/chunk-RT6OILOI.js.map +1 -0
- package/dist/{chunk-7QIY2DDX.js → chunk-VJTFXHOK.js} +2 -2
- package/dist/{chunk-7QIY2DDX.js.map → chunk-VJTFXHOK.js.map} +1 -1
- package/dist/chunk-XNLWBZIG.js +9 -0
- package/dist/chunk-XNLWBZIG.js.map +1 -0
- package/dist/cli/quickdraw-docs.js +241 -27
- package/dist/cli/quickdraw-docs.js.map +1 -1
- package/dist/client/index.d.ts +7 -7
- package/dist/client/index.js +5 -5
- package/dist/{clientTypes-B3o_99Xq.d.ts → clientTypes-Bc-G8n-U.d.ts} +3 -3
- package/dist/{connection-DuN8GvcD.d.ts → connection-Cr1BU07W.d.ts} +2 -2
- package/dist/{createServer-DUacdfKl.d.ts → createServer-CP9eDHZZ.d.ts} +30 -9
- package/dist/{createTestApp-DFLXoTKm.d.ts → createTestApp-UKVGEmOf.d.ts} +6 -6
- package/dist/{envelope-nf5eGB-a.d.ts → envelope-Cp3YcVxC.d.ts} +1 -1
- package/dist/{http--uoooIH5.d.ts → http-Djj2Inuu.d.ts} +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/{infer-Dw21kmLw.d.ts → infer-Teo1xpsd.d.ts} +17 -0
- package/dist/{metrics-C0WvB7-I.d.ts → metrics-BdBu5o8G.d.ts} +2 -2
- package/dist/prisma/index.d.ts +4 -4
- package/dist/prisma/index.js +1 -1
- package/dist/server/auth/index.d.ts +14 -5
- package/dist/server/auth/index.js +0 -5
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/index.d.ts +120 -33
- package/dist/server/index.js +146 -193
- package/dist/server/index.js.map +1 -1
- package/dist/server/mcp/index.d.ts +51 -11
- package/dist/server/mcp/index.js +129 -8
- package/dist/server/mcp/index.js.map +1 -1
- package/dist/server/otel.d.ts +3 -3
- package/dist/{sharing-n4ss-ONM.d.ts → sharing-DVa8W-yR.d.ts} +3 -3
- package/dist/testing/client.d.ts +13 -13
- package/dist/testing/client.js +6 -6
- package/dist/testing/index.d.ts +156 -12
- package/dist/testing/index.js +1037 -22
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/mock.d.ts +5 -5
- package/dist/testing/mock.js +5 -5
- package/dist/{types-Bwg3kIEc.d.ts → types-Cu0vmx7c.d.ts} +8 -2
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-5YRQ26LF.js.map +0 -1
- package/dist/chunk-DNCAI3KY.js.map +0 -1
- package/dist/chunk-LLLYILEP.js.map +0 -1
- /package/dist/{chunk-5IC5VZ7T.js.map → chunk-2UELNHDD.js.map} +0 -0
- /package/dist/{chunk-XFDOGTMC.js.map → chunk-3674EIRT.js.map} +0 -0
- /package/dist/{chunk-IRGAGRVG.js.map → chunk-JZBCLNDU.js.map} +0 -0
- /package/dist/{chunk-XUSN5WKU.js.map → chunk-KNDDCVQJ.js.map} +0 -0
|
@@ -1138,7 +1138,7 @@ var DESCRIBE = Object.freeze({
|
|
|
1138
1138
|
adminSubscribers: "Counts the sockets subscribed to one row, per access level.",
|
|
1139
1139
|
adminReemit: "Sends one row as it is now to every socket subscribed to it."
|
|
1140
1140
|
});
|
|
1141
|
-
var OPTIONS2 = ["entity", "filter", "sort", "expose", "describe"];
|
|
1141
|
+
var OPTIONS2 = ["entity", "filter", "sort", "editable", "expose", "describe"];
|
|
1142
1142
|
function isRecord3(value) {
|
|
1143
1143
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1144
1144
|
}
|
|
@@ -1150,7 +1150,7 @@ function quoted3(names) {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
function checkOptions(options) {
|
|
1152
1152
|
if (!isRecord3(options)) {
|
|
1153
|
-
fail2("options must be { entity, filter?, sort?, expose?, describe? }");
|
|
1153
|
+
fail2("options must be { entity, filter?, sort?, editable?, expose?, describe? }");
|
|
1154
1154
|
}
|
|
1155
1155
|
const unknownKey = Object.keys(options).find((key) => !OPTIONS2.includes(key));
|
|
1156
1156
|
if (unknownKey !== void 0) {
|
|
@@ -1177,6 +1177,24 @@ function checkFields2(owner, names, fields) {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
return Object.freeze([...names]);
|
|
1179
1179
|
}
|
|
1180
|
+
function checkEditable(names, fields) {
|
|
1181
|
+
if (names === void 0) {
|
|
1182
|
+
return void 0;
|
|
1183
|
+
}
|
|
1184
|
+
const valid = Array.isArray(names) && names.every((name) => typeof name === "string") && new Set(names).size === names.length;
|
|
1185
|
+
if (!valid) {
|
|
1186
|
+
fail2("editable must be a list of distinct field names");
|
|
1187
|
+
}
|
|
1188
|
+
for (const name of names) {
|
|
1189
|
+
if (ADMIN_NEVER_WRITABLE.includes(name)) {
|
|
1190
|
+
fail2(`editable: "${name}" is never editable; the database sets it`);
|
|
1191
|
+
}
|
|
1192
|
+
if (!fields.some((field) => field.name === name)) {
|
|
1193
|
+
fail2(`editable: "${name}" is not a field of the entity`);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
return Object.freeze([...names]);
|
|
1197
|
+
}
|
|
1180
1198
|
function exposedOf(expose) {
|
|
1181
1199
|
if (expose === void 0) {
|
|
1182
1200
|
return ADMIN_METHODS;
|
|
@@ -1241,15 +1259,17 @@ function contract2(options) {
|
|
|
1241
1259
|
const checked = checkOptions(options);
|
|
1242
1260
|
const { entity } = checked;
|
|
1243
1261
|
const fields = entityFieldsOf(entity, fail2);
|
|
1262
|
+
const editable = checkEditable(checked.editable, fields);
|
|
1244
1263
|
const base = Object.freeze({
|
|
1245
1264
|
entity,
|
|
1246
1265
|
filter: checkFields2("filter", checked.filter, fields),
|
|
1247
1266
|
sort: checkFields2("sort", checked.sort, fields),
|
|
1248
|
-
fields
|
|
1267
|
+
fields,
|
|
1268
|
+
editable
|
|
1249
1269
|
});
|
|
1250
1270
|
const names = exposedOf(checked.expose);
|
|
1251
1271
|
const described = describedOf(names, checked.describe);
|
|
1252
|
-
const writable = fields.map((field) => field.name).filter((field) => !ADMIN_NEVER_WRITABLE.includes(field));
|
|
1272
|
+
const writable = editable ?? fields.map((field) => field.name).filter((field) => !ADMIN_NEVER_WRITABLE.includes(field));
|
|
1253
1273
|
const methods = {};
|
|
1254
1274
|
for (const name of names) {
|
|
1255
1275
|
const own = described[name];
|
|
@@ -1301,4 +1321,4 @@ export {
|
|
|
1301
1321
|
adminSpecOf,
|
|
1302
1322
|
admin
|
|
1303
1323
|
};
|
|
1304
|
-
//# sourceMappingURL=chunk-
|
|
1324
|
+
//# sourceMappingURL=chunk-CDKG4TFA.js.map
|