zodvex 0.7.2-beta.0 → 0.7.2
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/dist/cli/index.js +85 -36
- package/dist/cli/index.js.map +1 -1
- package/dist/codegen/index.js +64 -29
- package/dist/codegen/index.js.map +1 -1
- package/dist/core/index.js +13 -2
- package/dist/core/index.js.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/meta.d.ts +11 -0
- package/dist/internal/meta.d.ts.map +1 -1
- package/dist/internal/zx.d.ts +14 -0
- package/dist/internal/zx.d.ts.map +1 -1
- package/dist/legacy/index.js +13 -2
- package/dist/legacy/index.js.map +1 -1
- package/dist/mini/index.js +15 -4
- package/dist/mini/index.js.map +1 -1
- package/dist/mini/server/index.js +13 -2
- package/dist/mini/server/index.js.map +1 -1
- package/dist/public/cli/commands.d.ts +12 -1
- package/dist/public/cli/commands.d.ts.map +1 -1
- package/dist/public/codegen/discover.d.ts +7 -9
- package/dist/public/codegen/discover.d.ts.map +1 -1
- package/dist/public/codegen/generate.d.ts.map +1 -1
- package/dist/public/mini/zx.d.ts +2 -0
- package/dist/public/mini/zx.d.ts.map +1 -1
- package/dist/server/index.js +13 -2
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
- package/src/internal/meta.ts +26 -0
- package/src/internal/zx.ts +18 -2
- package/src/public/cli/commands.ts +37 -15
- package/src/public/codegen/discover.ts +8 -26
- package/src/public/codegen/generate.ts +93 -36
- package/src/public/mini/zx.ts +3 -2
package/dist/mini/index.js
CHANGED
|
@@ -769,6 +769,15 @@ function readMeta(target) {
|
|
|
769
769
|
}
|
|
770
770
|
return target[META_KEY];
|
|
771
771
|
}
|
|
772
|
+
var CODEC_BRAND_KEY = "__zodvexCodecBrand";
|
|
773
|
+
function attachCodecBrand(target, brand) {
|
|
774
|
+
Object.defineProperty(target, CODEC_BRAND_KEY, {
|
|
775
|
+
value: brand,
|
|
776
|
+
enumerable: false,
|
|
777
|
+
writable: false,
|
|
778
|
+
configurable: false
|
|
779
|
+
});
|
|
780
|
+
}
|
|
772
781
|
|
|
773
782
|
// src/public/codegen/extractCodec.ts
|
|
774
783
|
function findCodec(schema) {
|
|
@@ -885,8 +894,10 @@ function id(tableName) {
|
|
|
885
894
|
branded._tableName = tableName;
|
|
886
895
|
return branded;
|
|
887
896
|
}
|
|
888
|
-
function codec(wire, runtime, transforms) {
|
|
889
|
-
|
|
897
|
+
function codec(wire, runtime, transforms, opts) {
|
|
898
|
+
const built = zodvexCodec(wire, runtime, transforms);
|
|
899
|
+
if (opts?.brand) attachCodecBrand(built, opts.brand);
|
|
900
|
+
return built;
|
|
890
901
|
}
|
|
891
902
|
function sharedWeakMap(name) {
|
|
892
903
|
const key = /* @__PURE__ */ Symbol.for(`zodvex.zx.cache.${name}`);
|
|
@@ -1288,8 +1299,8 @@ function date2() {
|
|
|
1288
1299
|
function id2(tableName) {
|
|
1289
1300
|
return zx.id(tableName);
|
|
1290
1301
|
}
|
|
1291
|
-
function codec2(wire, runtime, transforms) {
|
|
1292
|
-
return zx.codec(wire, runtime, transforms);
|
|
1302
|
+
function codec2(wire, runtime, transforms, opts) {
|
|
1303
|
+
return zx.codec(wire, runtime, transforms, opts);
|
|
1293
1304
|
}
|
|
1294
1305
|
var zx2 = {
|
|
1295
1306
|
date: date2,
|