@4players/odin-common 1.2.0 → 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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.2
4
+
5
+ - Added optional internal field to token claims schema
6
+
7
+ ## 1.2.1
8
+
9
+ - Updated npm ignore patterns
10
+
3
11
  ## 1.2.0
4
12
 
5
13
  - Added both typed and untyped rpc connection class
@@ -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.0",
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",
@@ -1,4 +0,0 @@
1
- export declare class Base64TestSuite {
2
- decodeBase64(): void;
3
- decodeBase64Url(): void;
4
- }
@@ -1,4 +0,0 @@
1
- export declare class ByteArrayTestSuite {
2
- encodeByteArray(): void;
3
- decodeByteArray(): void;
4
- }
@@ -1,4 +0,0 @@
1
- export declare class EnvironmentTestSuite {
2
- notAudioCapable(): void;
3
- notBlinkBrowser(): void;
4
- }
@@ -1,4 +0,0 @@
1
- export declare class IterableTestSuite {
2
- findReturnsElement(): void;
3
- findReturnsUndefined(): void;
4
- }
@@ -1,7 +0,0 @@
1
- export declare class JsonTestSuite {
2
- handleString(): void;
3
- handleNumber(): void;
4
- handleBoolean(): void;
5
- handleNull(): void;
6
- handleArray(): void;
7
- }
@@ -1,4 +0,0 @@
1
- export declare class ResultTestSuite {
2
- isSuccess(): void;
3
- isFailure(): void;
4
- }
@@ -1,7 +0,0 @@
1
- export declare class RpcTestSuite {
2
- sendRequest(): Promise<void>;
3
- resetWebSocketServer(): void;
4
- closeWebSocketServer(): void;
5
- resetWebSocketClient(): void;
6
- closeWebSocketClient(): void;
7
- }
@@ -1,4 +0,0 @@
1
- export declare class SelectorTestSuite {
2
- nextSingle(): Promise<void>;
3
- setup(): void;
4
- }
@@ -1,4 +0,0 @@
1
- export declare class StrandTestSuite {
2
- enqueueAndExecute(): Promise<void>;
3
- setup(): void;
4
- }
@@ -1,4 +0,0 @@
1
- export declare class UrlTestSuite {
2
- urlNormalization(): Promise<void>;
3
- urlExtension(): Promise<void>;
4
- }
@@ -1,3 +0,0 @@
1
- export declare class ValidationTestSuite {
2
- hasProperty(): Promise<void>;
3
- }
@@ -1,6 +0,0 @@
1
- export declare class WebSocketTestSuite {
2
- connectOnce(): Promise<void>;
3
- connectWithRetries(): Promise<void>;
4
- resetWebSocket(): void;
5
- closeWebSocket(): void;
6
- }