@webstir-io/module-contract 0.6.0 → 0.7.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/dist/index.d.ts CHANGED
@@ -1608,6 +1608,8 @@ export declare const routeDefinitionSchema: z.ZodObject<{
1608
1608
  mode?: "optional" | "required" | undefined;
1609
1609
  write?: boolean | undefined;
1610
1610
  }>>;
1611
+ /** `required`: only a signed-in user reaches the route; others are sent to sign in. */
1612
+ auth: z.ZodOptional<z.ZodEnum<["required"]>>;
1611
1613
  flash: z.ZodOptional<z.ZodObject<{
1612
1614
  consume: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1613
1615
  publish: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2311,6 +2313,7 @@ export declare const routeDefinitionSchema: z.ZodObject<{
2311
2313
  mode?: "optional" | "required" | undefined;
2312
2314
  write?: boolean | undefined;
2313
2315
  } | undefined;
2316
+ auth?: "required" | undefined;
2314
2317
  flash?: {
2315
2318
  consume?: string[] | undefined;
2316
2319
  publish?: {
@@ -2474,6 +2477,7 @@ export declare const routeDefinitionSchema: z.ZodObject<{
2474
2477
  mode?: "optional" | "required" | undefined;
2475
2478
  write?: boolean | undefined;
2476
2479
  } | undefined;
2480
+ auth?: "required" | undefined;
2477
2481
  flash?: {
2478
2482
  consume?: string[] | undefined;
2479
2483
  publish?: {
@@ -2704,6 +2708,8 @@ export declare const viewDefinitionSchema: z.ZodObject<{
2704
2708
  summary: z.ZodOptional<z.ZodString>;
2705
2709
  description: z.ZodOptional<z.ZodString>;
2706
2710
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2711
+ /** `required`: only a signed-in user sees the page; others are sent to sign in. */
2712
+ auth: z.ZodOptional<z.ZodEnum<["required"]>>;
2707
2713
  params: z.ZodOptional<z.ZodObject<{
2708
2714
  kind: z.ZodDefault<z.ZodEnum<["zod", "json-schema", "ts-rest"]>>;
2709
2715
  name: z.ZodString;
@@ -2746,6 +2752,7 @@ export declare const viewDefinitionSchema: z.ZodObject<{
2746
2752
  summary?: string | undefined;
2747
2753
  description?: string | undefined;
2748
2754
  tags?: string[] | undefined;
2755
+ auth?: "required" | undefined;
2749
2756
  params?: {
2750
2757
  kind: "json-schema" | "ts-rest" | "zod";
2751
2758
  name: string;
@@ -2768,6 +2775,7 @@ export declare const viewDefinitionSchema: z.ZodObject<{
2768
2775
  summary?: string | undefined;
2769
2776
  description?: string | undefined;
2770
2777
  tags?: string[] | undefined;
2778
+ auth?: "required" | undefined;
2771
2779
  params?: {
2772
2780
  kind?: "json-schema" | "ts-rest" | "zod" | undefined;
2773
2781
  name: string;
@@ -2909,6 +2917,8 @@ export declare const moduleManifestSchema: z.ZodObject<{
2909
2917
  mode?: "optional" | "required" | undefined;
2910
2918
  write?: boolean | undefined;
2911
2919
  }>>;
2920
+ /** `required`: only a signed-in user reaches the route; others are sent to sign in. */
2921
+ auth: z.ZodOptional<z.ZodEnum<["required"]>>;
2912
2922
  flash: z.ZodOptional<z.ZodObject<{
2913
2923
  consume: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2914
2924
  publish: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -3612,6 +3622,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
3612
3622
  mode?: "optional" | "required" | undefined;
3613
3623
  write?: boolean | undefined;
3614
3624
  } | undefined;
3625
+ auth?: "required" | undefined;
3615
3626
  flash?: {
3616
3627
  consume?: string[] | undefined;
3617
3628
  publish?: {
@@ -3775,6 +3786,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
3775
3786
  mode?: "optional" | "required" | undefined;
3776
3787
  write?: boolean | undefined;
3777
3788
  } | undefined;
3789
+ auth?: "required" | undefined;
3778
3790
  flash?: {
3779
3791
  consume?: string[] | undefined;
3780
3792
  publish?: {
@@ -3931,6 +3943,8 @@ export declare const moduleManifestSchema: z.ZodObject<{
3931
3943
  summary: z.ZodOptional<z.ZodString>;
3932
3944
  description: z.ZodOptional<z.ZodString>;
3933
3945
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3946
+ /** `required`: only a signed-in user sees the page; others are sent to sign in. */
3947
+ auth: z.ZodOptional<z.ZodEnum<["required"]>>;
3934
3948
  params: z.ZodOptional<z.ZodObject<{
3935
3949
  kind: z.ZodDefault<z.ZodEnum<["zod", "json-schema", "ts-rest"]>>;
3936
3950
  name: z.ZodString;
@@ -3973,6 +3987,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
3973
3987
  summary?: string | undefined;
3974
3988
  description?: string | undefined;
3975
3989
  tags?: string[] | undefined;
3990
+ auth?: "required" | undefined;
3976
3991
  params?: {
3977
3992
  kind: "json-schema" | "ts-rest" | "zod";
3978
3993
  name: string;
@@ -3995,6 +4010,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
3995
4010
  summary?: string | undefined;
3996
4011
  description?: string | undefined;
3997
4012
  tags?: string[] | undefined;
4013
+ auth?: "required" | undefined;
3998
4014
  params?: {
3999
4015
  kind?: "json-schema" | "ts-rest" | "zod" | undefined;
4000
4016
  name: string;
@@ -4101,6 +4117,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
4101
4117
  mode?: "optional" | "required" | undefined;
4102
4118
  write?: boolean | undefined;
4103
4119
  } | undefined;
4120
+ auth?: "required" | undefined;
4104
4121
  flash?: {
4105
4122
  consume?: string[] | undefined;
4106
4123
  publish?: {
@@ -4257,6 +4274,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
4257
4274
  summary?: string | undefined;
4258
4275
  description?: string | undefined;
4259
4276
  tags?: string[] | undefined;
4277
+ auth?: "required" | undefined;
4260
4278
  params?: {
4261
4279
  kind: "json-schema" | "ts-rest" | "zod";
4262
4280
  name: string;
@@ -4323,6 +4341,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
4323
4341
  mode?: "optional" | "required" | undefined;
4324
4342
  write?: boolean | undefined;
4325
4343
  } | undefined;
4344
+ auth?: "required" | undefined;
4326
4345
  flash?: {
4327
4346
  consume?: string[] | undefined;
4328
4347
  publish?: {
@@ -4479,6 +4498,7 @@ export declare const moduleManifestSchema: z.ZodObject<{
4479
4498
  summary?: string | undefined;
4480
4499
  description?: string | undefined;
4481
4500
  tags?: string[] | undefined;
4501
+ auth?: "required" | undefined;
4482
4502
  params?: {
4483
4503
  kind?: "json-schema" | "ts-rest" | "zod" | undefined;
4484
4504
  name: string;
package/dist/index.js CHANGED
@@ -159,6 +159,8 @@ export const routeDefinitionSchema = z.object({
159
159
  interaction: routeInteractionKindSchema.optional(),
160
160
  requestHooks: z.array(requestHookReferenceSchema).optional(),
161
161
  session: routeSessionSchema.optional(),
162
+ /** `required`: only a signed-in user reaches the route; others are sent to sign in. */
163
+ auth: z.enum(['required']).optional(),
162
164
  flash: routeFlashSchema.optional(),
163
165
  form: routeFormSchema.optional(),
164
166
  fragment: routeFragmentSchema.optional(),
@@ -180,6 +182,8 @@ export const viewDefinitionSchema = z.object({
180
182
  summary: z.string().optional(),
181
183
  description: z.string().optional(),
182
184
  tags: z.array(z.string()).optional(),
185
+ /** `required`: only a signed-in user sees the page; others are sent to sign in. */
186
+ auth: z.enum(['required']).optional(),
183
187
  params: schemaReferenceSchema.optional(),
184
188
  data: schemaReferenceSchema.optional(),
185
189
  renderMode: z.enum(['ssg', 'ssr', 'spa']).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstir-io/module-contract",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Public contract definitions for Webstir frontend and backend module providers.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -146,6 +146,12 @@
146
146
  },
147
147
  "additionalProperties": false
148
148
  },
149
+ "auth": {
150
+ "type": "string",
151
+ "enum": [
152
+ "required"
153
+ ]
154
+ },
149
155
  "flash": {
150
156
  "type": "object",
151
157
  "properties": {
@@ -479,6 +485,12 @@
479
485
  "type": "string"
480
486
  }
481
487
  },
488
+ "auth": {
489
+ "type": "string",
490
+ "enum": [
491
+ "required"
492
+ ]
493
+ },
482
494
  "params": {
483
495
  "$ref": "#/definitions/module-manifest/properties/routes/items/properties/input/properties/params"
484
496
  },
@@ -75,6 +75,12 @@
75
75
  },
76
76
  "additionalProperties": false
77
77
  },
78
+ "auth": {
79
+ "type": "string",
80
+ "enum": [
81
+ "required"
82
+ ]
83
+ },
78
84
  "flash": {
79
85
  "type": "object",
80
86
  "properties": {
@@ -28,6 +28,12 @@
28
28
  "type": "string"
29
29
  }
30
30
  },
31
+ "auth": {
32
+ "type": "string",
33
+ "enum": [
34
+ "required"
35
+ ]
36
+ },
31
37
  "params": {
32
38
  "type": "object",
33
39
  "properties": {