@fuzdev/fuz_app 0.4.0 → 0.5.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.
@@ -19,7 +19,7 @@ export const map_action_auth = (auth) => {
19
19
  };
20
20
  /** Derive the default HTTP method from side effects. */
21
21
  export const derive_http_method = (side_effects) => {
22
- return side_effects === true ? 'POST' : 'GET';
22
+ return side_effects ? 'POST' : 'GET';
23
23
  };
24
24
  /**
25
25
  * Derive a `RouteSpec` from an `ActionSpec` and options.
@@ -29,7 +29,7 @@ export declare const ActionAuth: z.ZodUnion<readonly [z.ZodLiteral<"public">, z.
29
29
  role: z.ZodString;
30
30
  }, z.core.$strict>]>;
31
31
  export type ActionAuth = z.infer<typeof ActionAuth>;
32
- export declare const ActionSideEffects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
32
+ export declare const ActionSideEffects: z.ZodBoolean;
33
33
  export type ActionSideEffects = z.infer<typeof ActionSideEffects>;
34
34
  export declare const ActionSpec: z.ZodObject<{
35
35
  method: z.ZodString;
@@ -46,7 +46,7 @@ export declare const ActionSpec: z.ZodObject<{
46
46
  auth: z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"public">, z.ZodLiteral<"authenticated">, z.ZodLiteral<"keeper">, z.ZodObject<{
47
47
  role: z.ZodString;
48
48
  }, z.core.$strict>]>>;
49
- side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
49
+ side_effects: z.ZodBoolean;
50
50
  input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
51
51
  output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
52
52
  async: z.ZodBoolean;
@@ -60,7 +60,7 @@ export declare const RequestResponseActionSpec: z.ZodObject<{
60
60
  frontend: "frontend";
61
61
  backend: "backend";
62
62
  }>;
63
- side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
63
+ side_effects: z.ZodBoolean;
64
64
  input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
65
65
  output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
66
66
  description: z.ZodString;
@@ -82,7 +82,7 @@ export declare const RemoteNotificationActionSpec: z.ZodObject<{
82
82
  description: z.ZodString;
83
83
  kind: z.ZodDefault<z.ZodLiteral<"remote_notification">>;
84
84
  auth: z.ZodDefault<z.ZodNull>;
85
- side_effects: z.ZodDefault<z.ZodNullable<z.ZodLiteral<true>>>;
85
+ side_effects: z.ZodDefault<z.ZodLiteral<true>>;
86
86
  output: z.ZodCustom<z.ZodVoid, z.ZodVoid>;
87
87
  async: z.ZodDefault<z.ZodLiteral<true>>;
88
88
  }, z.core.$strict>;
@@ -98,7 +98,7 @@ export declare const LocalCallActionSpec: z.ZodObject<{
98
98
  frontend: "frontend";
99
99
  backend: "backend";
100
100
  }>;
101
- side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
101
+ side_effects: z.ZodBoolean;
102
102
  input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
103
103
  output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
104
104
  async: z.ZodBoolean;
@@ -114,7 +114,7 @@ export declare const ActionSpecUnion: z.ZodUnion<readonly [z.ZodObject<{
114
114
  frontend: "frontend";
115
115
  backend: "backend";
116
116
  }>;
117
- side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
117
+ side_effects: z.ZodBoolean;
118
118
  input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
119
119
  output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
120
120
  description: z.ZodString;
@@ -134,7 +134,7 @@ export declare const ActionSpecUnion: z.ZodUnion<readonly [z.ZodObject<{
134
134
  description: z.ZodString;
135
135
  kind: z.ZodDefault<z.ZodLiteral<"remote_notification">>;
136
136
  auth: z.ZodDefault<z.ZodNull>;
137
- side_effects: z.ZodDefault<z.ZodNullable<z.ZodLiteral<true>>>;
137
+ side_effects: z.ZodDefault<z.ZodLiteral<true>>;
138
138
  output: z.ZodCustom<z.ZodVoid, z.ZodVoid>;
139
139
  async: z.ZodDefault<z.ZodLiteral<true>>;
140
140
  }, z.core.$strict>, z.ZodObject<{
@@ -144,7 +144,7 @@ export declare const ActionSpecUnion: z.ZodUnion<readonly [z.ZodObject<{
144
144
  frontend: "frontend";
145
145
  backend: "backend";
146
146
  }>;
147
- side_effects: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodNull]>;
147
+ side_effects: z.ZodBoolean;
148
148
  input: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
149
149
  output: z.ZodCustom<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
150
150
  async: z.ZodBoolean;
@@ -1 +1 @@
1
- {"version":3,"file":"action_spec.d.ts","sourceRoot":"../src/lib/","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CAAC,CAAC;AAElF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;kBAMvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;kBAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAI1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,eAKoB,CAAC;AAE9E,eAAO,MAAM,gBAAgB;;;;;;;;;;EAU3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -21,7 +21,7 @@ export const ActionAuth = z.union([
21
21
  z.literal('keeper'),
22
22
  z.strictObject({ role: z.string() }),
23
23
  ]);
24
- export const ActionSideEffects = z.union([z.literal(true), z.null()]);
24
+ export const ActionSideEffects = z.boolean();
25
25
  export const ActionSpec = z.strictObject({
26
26
  method: z.string(),
27
27
  kind: ActionKind,
@@ -41,7 +41,7 @@ export const RequestResponseActionSpec = ActionSpec.extend({
41
41
  export const RemoteNotificationActionSpec = ActionSpec.extend({
42
42
  kind: z.literal('remote_notification').default('remote_notification'),
43
43
  auth: z.null().default(null),
44
- side_effects: z.literal(true).nullable().default(true),
44
+ side_effects: z.literal(true).default(true),
45
45
  output: z.custom((v) => v instanceof z.ZodVoid),
46
46
  async: z.literal(true).default(true),
47
47
  });
@@ -1 +1 @@
1
- {"version":3,"file":"db_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/db_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAmB,KAAK,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAWjE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,cAAc,KAAG,KAAK,CAAC,SAAS,CAqN9E,CAAC"}
1
+ {"version":3,"file":"db_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/db_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAmB,KAAK,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAWjE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,cAAc,KAAG,KAAK,CAAC,SAAS,CAuN9E,CAAC"}
@@ -57,7 +57,9 @@ export const create_db_route_specs = (options) => {
57
57
  auth: { type: 'keeper' },
58
58
  description: 'List public tables with row counts',
59
59
  input: z.null(),
60
- output: z.looseObject({ tables: z.array(z.object({ name: z.string(), row_count: z.number() })) }),
60
+ output: z.looseObject({
61
+ tables: z.array(z.strictObject({ name: z.string(), row_count: z.number() })),
62
+ }),
61
63
  handler: async (c, route) => {
62
64
  const table_names = await route.db.query(`SELECT table_name FROM information_schema.tables
63
65
  WHERE table_schema = 'public'
@@ -83,7 +85,7 @@ export const create_db_route_specs = (options) => {
83
85
  input: z.null(),
84
86
  errors: { 404: z.looseObject({ error: z.literal(ERROR_TABLE_NOT_FOUND) }) },
85
87
  output: z.looseObject({
86
- columns: z.array(z.object({ column_name: z.string(), data_type: z.string(), is_nullable: z.string() })),
88
+ columns: z.array(z.strictObject({ column_name: z.string(), data_type: z.string(), is_nullable: z.string() })),
87
89
  rows: z.array(z.record(z.string(), z.unknown())),
88
90
  total: z.number(),
89
91
  offset: z.number(),
@@ -13,9 +13,9 @@ import { type RateLimitKey, type RouteErrorSchemas } from './error_schemas.js';
13
13
  /**
14
14
  * Check if a schema is exactly `z.null()`.
15
15
  *
16
- * Uses Zod 4 type introspection (`_zod.def.type`) rather than runtime parsing
17
- * to avoid false positives from `z.nullable(z.string())` or similar schemas
18
- * that accept null but also accept other values.
16
+ * Uses `instanceof` rather than runtime parsing to avoid false positives
17
+ * from `z.nullable(z.string())` or similar schemas that accept null
18
+ * but also accept other values.
19
19
  */
20
20
  export declare const is_null_schema: (schema: z.ZodType) => boolean;
21
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"schema_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/schema_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAuB,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAEnG;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAA0C,CAAC;AAE9F;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAI3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,OAcrD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,YAAY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EAAE,CAAC,CAAC,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC3B,EACD,oBAAoB,iBAAiB,GAAG,IAAI,KAC1C,iBAAiB,GAAG,IAUtB,CAAC"}
@@ -12,23 +12,18 @@ import { derive_error_schemas } from './error_schemas.js';
12
12
  /**
13
13
  * Check if a schema is exactly `z.null()`.
14
14
  *
15
- * Uses Zod 4 type introspection (`_zod.def.type`) rather than runtime parsing
16
- * to avoid false positives from `z.nullable(z.string())` or similar schemas
17
- * that accept null but also accept other values.
15
+ * Uses `instanceof` rather than runtime parsing to avoid false positives
16
+ * from `z.nullable(z.string())` or similar schemas that accept null
17
+ * but also accept other values.
18
18
  */
19
- export const is_null_schema = (schema) => schema._zod.def.type === 'null';
19
+ export const is_null_schema = (schema) => schema instanceof z.ZodNull;
20
20
  /**
21
21
  * Check if a schema is a strict object (`z.strictObject()`).
22
22
  *
23
23
  * Strict objects set `catchall` to `ZodNever` to reject unknown keys.
24
24
  * Regular `z.object()` has `catchall: undefined` (strips unknown keys in Zod 4).
25
25
  */
26
- export const is_strict_object_schema = (schema) => {
27
- if (schema._zod.def.type !== 'object')
28
- return false;
29
- const catchall = schema._zod.def.catchall;
30
- return catchall?._zod.def.type === 'never';
31
- };
26
+ export const is_strict_object_schema = (schema) => schema instanceof z.ZodObject && schema.def.catchall instanceof z.ZodNever;
32
27
  /**
33
28
  * Convert a Zod schema to a JSON-serializable representation for the surface.
34
29
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_app",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "fullstack app library",
5
5
  "glyph": "🗝",
6
6
  "logo": "logo.svg",