@timothyw/pat-common 1.0.157 → 1.0.158

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.
@@ -10,23 +10,31 @@ export declare const authTokensSchema: z.ZodObject<{
10
10
  refreshToken: string;
11
11
  }>;
12
12
  export declare const tokenPayloadSchema: z.ZodObject<{
13
- authId: z.ZodString;
14
- userId: z.ZodString;
13
+ authId: z.ZodEffects<z.ZodString, import("./id-types").AuthId, string>;
14
+ userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
15
15
  }, "strip", z.ZodTypeAny, {
16
- userId: string;
17
- authId: string;
16
+ userId: string & {
17
+ readonly __brand: "UserId";
18
+ };
19
+ authId: string & {
20
+ readonly __brand: "AuthId";
21
+ };
18
22
  }, {
19
23
  userId: string;
20
24
  authId: string;
21
25
  }>;
22
26
  export declare const refreshTokenPayloadSchema: z.ZodObject<{
23
- authId: z.ZodString;
24
- userId: z.ZodString;
27
+ authId: z.ZodEffects<z.ZodString, import("./id-types").AuthId, string>;
28
+ userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
25
29
  } & {
26
30
  tokenId: z.ZodString;
27
31
  }, "strip", z.ZodTypeAny, {
28
- userId: string;
29
- authId: string;
32
+ userId: string & {
33
+ readonly __brand: "UserId";
34
+ };
35
+ authId: string & {
36
+ readonly __brand: "AuthId";
37
+ };
30
38
  tokenId: string;
31
39
  }, {
32
40
  userId: string;
@@ -8,8 +8,8 @@ exports.authTokensSchema = zod_1.z.object({
8
8
  refreshToken: zod_1.z.string()
9
9
  });
10
10
  exports.tokenPayloadSchema = zod_1.z.object({
11
- authId: zod_1.z.string(),
12
- userId: zod_1.z.string()
11
+ authId: id_types_1.authIdSchema,
12
+ userId: id_types_1.userIdSchema
13
13
  });
14
14
  exports.refreshTokenPayloadSchema = exports.tokenPayloadSchema.extend({
15
15
  tokenId: zod_1.z.string()
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@timothyw/pat-common",
3
3
  "description": "",
4
4
  "author": "Timothy Washburn",
5
- "version": "1.0.157",
5
+ "version": "1.0.158",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -7,8 +7,8 @@ export const authTokensSchema = z.object({
7
7
  });
8
8
 
9
9
  export const tokenPayloadSchema = z.object({
10
- authId: z.string(),
11
- userId: z.string()
10
+ authId: authIdSchema,
11
+ userId: userIdSchema
12
12
  });
13
13
 
14
14
  export const refreshTokenPayloadSchema = tokenPayloadSchema.extend({