@meistrari/data-token 0.0.14 → 0.0.16

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.
@@ -22,7 +22,18 @@ declare function createDataTokenPlugin(url: string, skipOnError?: boolean, getTo
22
22
  decorator: {};
23
23
  store: {};
24
24
  derive: {
25
- readonly authData?: any;
25
+ readonly authData: {
26
+ requestId: string;
27
+ workspace: {
28
+ id: string;
29
+ title: string;
30
+ };
31
+ user?: {
32
+ id: string;
33
+ email: string;
34
+ uuid: string | null;
35
+ } | undefined;
36
+ } | null;
26
37
  };
27
38
  resolve: {};
28
39
  }, {
@@ -22,7 +22,18 @@ declare function createDataTokenPlugin(url: string, skipOnError?: boolean, getTo
22
22
  decorator: {};
23
23
  store: {};
24
24
  derive: {
25
- readonly authData?: any;
25
+ readonly authData: {
26
+ requestId: string;
27
+ workspace: {
28
+ id: string;
29
+ title: string;
30
+ };
31
+ user?: {
32
+ id: string;
33
+ email: string;
34
+ uuid: string | null;
35
+ } | undefined;
36
+ } | null;
26
37
  };
27
38
  resolve: {};
28
39
  }, {
@@ -1,56 +1,7 @@
1
1
  import * as hono from 'hono';
2
2
  import { Context } from 'hono';
3
- import { z } from 'zod';
4
-
5
- declare const DataToken: z.ZodObject<{
6
- requestId: z.ZodString;
7
- workspace: z.ZodObject<{
8
- id: z.ZodString;
9
- title: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- id?: string;
12
- title?: string;
13
- }, {
14
- id?: string;
15
- title?: string;
16
- }>;
17
- user: z.ZodOptional<z.ZodObject<{
18
- id: z.ZodString;
19
- email: z.ZodString;
20
- uuid: z.ZodNullable<z.ZodString>;
21
- }, "strip", z.ZodTypeAny, {
22
- id?: string;
23
- email?: string;
24
- uuid?: string;
25
- }, {
26
- id?: string;
27
- email?: string;
28
- uuid?: string;
29
- }>>;
30
- }, "strip", z.ZodTypeAny, {
31
- requestId?: string;
32
- workspace?: {
33
- id?: string;
34
- title?: string;
35
- };
36
- user?: {
37
- id?: string;
38
- email?: string;
39
- uuid?: string;
40
- };
41
- }, {
42
- requestId?: string;
43
- workspace?: {
44
- id?: string;
45
- title?: string;
46
- };
47
- user?: {
48
- id?: string;
49
- email?: string;
50
- uuid?: string;
51
- };
52
- }>;
53
- type DataToken = z.infer<typeof DataToken>;
3
+ import { D as DataToken } from '../shared/data-token.815fae84.mjs';
4
+ import 'zod';
54
5
 
55
6
  type DataTokenContext = {
56
7
  Variables: {
@@ -1,56 +1,7 @@
1
1
  import * as hono from 'hono';
2
2
  import { Context } from 'hono';
3
- import { z } from 'zod';
4
-
5
- declare const DataToken: z.ZodObject<{
6
- requestId: z.ZodString;
7
- workspace: z.ZodObject<{
8
- id: z.ZodString;
9
- title: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- id?: string;
12
- title?: string;
13
- }, {
14
- id?: string;
15
- title?: string;
16
- }>;
17
- user: z.ZodOptional<z.ZodObject<{
18
- id: z.ZodString;
19
- email: z.ZodString;
20
- uuid: z.ZodNullable<z.ZodString>;
21
- }, "strip", z.ZodTypeAny, {
22
- id?: string;
23
- email?: string;
24
- uuid?: string;
25
- }, {
26
- id?: string;
27
- email?: string;
28
- uuid?: string;
29
- }>>;
30
- }, "strip", z.ZodTypeAny, {
31
- requestId?: string;
32
- workspace?: {
33
- id?: string;
34
- title?: string;
35
- };
36
- user?: {
37
- id?: string;
38
- email?: string;
39
- uuid?: string;
40
- };
41
- }, {
42
- requestId?: string;
43
- workspace?: {
44
- id?: string;
45
- title?: string;
46
- };
47
- user?: {
48
- id?: string;
49
- email?: string;
50
- uuid?: string;
51
- };
52
- }>;
53
- type DataToken = z.infer<typeof DataToken>;
3
+ import { D as DataToken } from '../shared/data-token.815fae84.js';
4
+ import 'zod';
54
5
 
55
6
  type DataTokenContext = {
56
7
  Variables: {
package/dist/index.d.mts CHANGED
@@ -1,3 +1,6 @@
1
+ export { D as DataToken, V as ValidatorConfig } from './shared/data-token.815fae84.mjs';
2
+ import 'zod';
3
+
1
4
  /**
2
5
  * Get a validator function that can validate a data token.
3
6
  *
@@ -9,16 +12,16 @@
9
12
  declare function getValidator(jwksUrl: string, { algorithms }?: {
10
13
  algorithms: string[];
11
14
  }): (token: string) => Promise<{
12
- requestId?: string;
13
- workspace?: {
14
- id?: string;
15
- title?: string;
15
+ requestId: string;
16
+ workspace: {
17
+ id: string;
18
+ title: string;
16
19
  };
17
20
  user?: {
18
- id?: string;
19
- email?: string;
20
- uuid?: string;
21
- };
21
+ id: string;
22
+ email: string;
23
+ uuid: string | null;
24
+ } | undefined;
22
25
  }>;
23
26
 
24
27
  export { getValidator };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ export { D as DataToken, V as ValidatorConfig } from './shared/data-token.815fae84.js';
2
+ import 'zod';
3
+
1
4
  /**
2
5
  * Get a validator function that can validate a data token.
3
6
  *
@@ -9,16 +12,16 @@
9
12
  declare function getValidator(jwksUrl: string, { algorithms }?: {
10
13
  algorithms: string[];
11
14
  }): (token: string) => Promise<{
12
- requestId?: string;
13
- workspace?: {
14
- id?: string;
15
- title?: string;
15
+ requestId: string;
16
+ workspace: {
17
+ id: string;
18
+ title: string;
16
19
  };
17
20
  user?: {
18
- id?: string;
19
- email?: string;
20
- uuid?: string;
21
- };
21
+ id: string;
22
+ email: string;
23
+ uuid: string | null;
24
+ } | undefined;
22
25
  }>;
23
26
 
24
27
  export { getValidator };
package/dist/index.mjs CHANGED
@@ -70,4 +70,4 @@ function getValidator(jwksUrl, { algorithms } = { algorithms: ["RS256"] }) {
70
70
  };
71
71
  }
72
72
 
73
- export { getValidator };
73
+ export { DataToken, getValidator };
@@ -0,0 +1,57 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const DataToken: z.ZodObject<{
4
+ requestId: z.ZodString;
5
+ workspace: z.ZodObject<{
6
+ id: z.ZodString;
7
+ title: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ id: string;
10
+ title: string;
11
+ }, {
12
+ id: string;
13
+ title: string;
14
+ }>;
15
+ user: z.ZodOptional<z.ZodObject<{
16
+ id: z.ZodString;
17
+ email: z.ZodString;
18
+ uuid: z.ZodNullable<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id: string;
21
+ email: string;
22
+ uuid: string | null;
23
+ }, {
24
+ id: string;
25
+ email: string;
26
+ uuid: string | null;
27
+ }>>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ requestId: string;
30
+ workspace: {
31
+ id: string;
32
+ title: string;
33
+ };
34
+ user?: {
35
+ id: string;
36
+ email: string;
37
+ uuid: string | null;
38
+ } | undefined;
39
+ }, {
40
+ requestId: string;
41
+ workspace: {
42
+ id: string;
43
+ title: string;
44
+ };
45
+ user?: {
46
+ id: string;
47
+ email: string;
48
+ uuid: string | null;
49
+ } | undefined;
50
+ }>;
51
+ type DataToken = z.infer<typeof DataToken>;
52
+ type ValidatorConfig = {
53
+ jwksUrl: string;
54
+ algorithms?: string[];
55
+ };
56
+
57
+ export { DataToken as D, type ValidatorConfig as V };
@@ -0,0 +1,57 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const DataToken: z.ZodObject<{
4
+ requestId: z.ZodString;
5
+ workspace: z.ZodObject<{
6
+ id: z.ZodString;
7
+ title: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ id: string;
10
+ title: string;
11
+ }, {
12
+ id: string;
13
+ title: string;
14
+ }>;
15
+ user: z.ZodOptional<z.ZodObject<{
16
+ id: z.ZodString;
17
+ email: z.ZodString;
18
+ uuid: z.ZodNullable<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id: string;
21
+ email: string;
22
+ uuid: string | null;
23
+ }, {
24
+ id: string;
25
+ email: string;
26
+ uuid: string | null;
27
+ }>>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ requestId: string;
30
+ workspace: {
31
+ id: string;
32
+ title: string;
33
+ };
34
+ user?: {
35
+ id: string;
36
+ email: string;
37
+ uuid: string | null;
38
+ } | undefined;
39
+ }, {
40
+ requestId: string;
41
+ workspace: {
42
+ id: string;
43
+ title: string;
44
+ };
45
+ user?: {
46
+ id: string;
47
+ email: string;
48
+ uuid: string | null;
49
+ } | undefined;
50
+ }>;
51
+ type DataToken = z.infer<typeof DataToken>;
52
+ type ValidatorConfig = {
53
+ jwksUrl: string;
54
+ algorithms?: string[];
55
+ };
56
+
57
+ export { DataToken as D, type ValidatorConfig as V };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/data-token",
3
3
  "type": "module",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "description": "Internal library to verify and decode the API Gateway data token",
6
6
  "author": "Roz <roz@meistrari.com>",
7
7
  "license": "UNLICENSED",