@4players/odin-common 1.2.1 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.2
4
+
5
+ - Added optional internal field to token claims schema
6
+
3
7
  ## 1.2.1
4
8
 
5
9
  - Updated npm ignore patterns
@@ -14,6 +14,9 @@ exports.TokenClaimsSchema = zod_1.z.object({
14
14
  aud: zod_1.z.optional(oneOrMany(exports.TokenAudienceSchema)),
15
15
  exp: zod_1.z.optional(zod_1.z.number()),
16
16
  nbf: zod_1.z.optional(zod_1.z.number()),
17
+ internal: zod_1.z.optional(zod_1.z.object({
18
+ server: zod_1.z.optional(zod_1.z.string()),
19
+ })),
17
20
  });
18
21
  function oneOrMany(type) {
19
22
  return zod_1.z.union([type, zod_1.z.array(type)]);
@@ -11,6 +11,9 @@ export const TokenClaimsSchema = z.object({
11
11
  aud: z.optional(oneOrMany(TokenAudienceSchema)),
12
12
  exp: z.optional(z.number()),
13
13
  nbf: z.optional(z.number()),
14
+ internal: z.optional(z.object({
15
+ server: z.optional(z.string()),
16
+ })),
14
17
  });
15
18
  export function oneOrMany(type) {
16
19
  return z.union([type, z.array(type)]);
@@ -11,6 +11,13 @@ export declare const TokenClaimsSchema: z.ZodObject<{
11
11
  aud: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["sfu", "gateway"]>, z.ZodArray<z.ZodEnum<["sfu", "gateway"]>, "many">]>>;
12
12
  exp: z.ZodOptional<z.ZodNumber>;
13
13
  nbf: z.ZodOptional<z.ZodNumber>;
14
+ internal: z.ZodOptional<z.ZodObject<{
15
+ server: z.ZodOptional<z.ZodString>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ server?: string | undefined;
18
+ }, {
19
+ server?: string | undefined;
20
+ }>>;
14
21
  }, "strip", z.ZodTypeAny, {
15
22
  uid: string;
16
23
  rid: (string | string[]) & (string | string[] | undefined);
@@ -21,6 +28,9 @@ export declare const TokenClaimsSchema: z.ZodObject<{
21
28
  aud?: "sfu" | "gateway" | ("sfu" | "gateway")[] | undefined;
22
29
  exp?: number | undefined;
23
30
  nbf?: number | undefined;
31
+ internal?: {
32
+ server?: string | undefined;
33
+ } | undefined;
24
34
  }, {
25
35
  uid: string;
26
36
  rid: (string | string[]) & (string | string[] | undefined);
@@ -31,6 +41,9 @@ export declare const TokenClaimsSchema: z.ZodObject<{
31
41
  aud?: "sfu" | "gateway" | ("sfu" | "gateway")[] | undefined;
32
42
  exp?: number | undefined;
33
43
  nbf?: number | undefined;
44
+ internal?: {
45
+ server?: string | undefined;
46
+ } | undefined;
34
47
  }>;
35
48
  export type TokenClaims = z.infer<typeof TokenClaimsSchema>;
36
49
  export declare function oneOrMany<T extends z.ZodTypeAny>(type: T): z.ZodUnion<[T, z.ZodArray<T, "many">]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4players/odin-common",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "A collection of commonly used type definitions and utility functions across ODIN web projects",
5
5
  "author": "Josho Bleicker <josho.bleicker@4players.io> (https://www.4players.io)",
6
6
  "homepage": "https://www.4players.io",