@tinyrack/issuary-server 0.29.2 → 0.29.3

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.
@@ -48,12 +48,9 @@ export declare function createApp(options: CreateAppOptions, runtimeOptions?: Cr
48
48
  }, "/">, "/.well-known"> | import("hono/types").MergeSchemaPath<import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
49
49
  "/end_session": {
50
50
  $get: {
51
- output: {
52
- error: string;
53
- error_description: string;
54
- };
55
- outputFormat: "json";
56
- status: 400;
51
+ output: undefined;
52
+ outputFormat: "redirect";
53
+ status: 302;
57
54
  input: {
58
55
  query: {
59
56
  client_id?: string | undefined;
@@ -63,9 +60,12 @@ export declare function createApp(options: CreateAppOptions, runtimeOptions?: Cr
63
60
  };
64
61
  };
65
62
  } | {
66
- output: undefined;
67
- outputFormat: "redirect";
68
- status: 302;
63
+ output: {
64
+ error: string;
65
+ error_description: string;
66
+ };
67
+ outputFormat: "json";
68
+ status: 400;
69
69
  input: {
70
70
  query: {
71
71
  client_id?: string | undefined;
@@ -456,12 +456,9 @@ export declare function createApp(options: CreateAppOptions, runtimeOptions?: Cr
456
456
  }, "/">, "/"> | import("hono/types").MergeSchemaPath<import("hono/types").MergeSchemaPath<{
457
457
  "/oauth/:provider/callback": {
458
458
  $post: {
459
- output: {
460
- code: any;
461
- message: any;
462
- };
463
- outputFormat: "json";
464
- status: any;
459
+ output: undefined;
460
+ outputFormat: "redirect";
461
+ status: 302;
465
462
  input: {
466
463
  param: {
467
464
  provider: string;
@@ -475,9 +472,12 @@ export declare function createApp(options: CreateAppOptions, runtimeOptions?: Cr
475
472
  };
476
473
  };
477
474
  } | {
478
- output: undefined;
479
- outputFormat: "redirect";
480
- status: 302;
475
+ output: {
476
+ code: any;
477
+ message: any;
478
+ };
479
+ outputFormat: "json";
480
+ status: any;
481
481
  input: {
482
482
  param: {
483
483
  provider: string;
@@ -1390,12 +1390,9 @@ export declare function createApp(options: CreateAppOptions, runtimeOptions?: Cr
1390
1390
  }, "/">, "/"> | import("hono/types").MergeSchemaPath<import("hono/types").MergeSchemaPath<{
1391
1391
  "/oauth/:provider/callback": {
1392
1392
  $get: {
1393
- output: {
1394
- code: any;
1395
- message: any;
1396
- };
1397
- outputFormat: "json";
1398
- status: any;
1393
+ output: undefined;
1394
+ outputFormat: "redirect";
1395
+ status: 302;
1399
1396
  input: {
1400
1397
  param: {
1401
1398
  provider: string;
@@ -1409,9 +1406,12 @@ export declare function createApp(options: CreateAppOptions, runtimeOptions?: Cr
1409
1406
  };
1410
1407
  };
1411
1408
  } | {
1412
- output: undefined;
1413
- outputFormat: "redirect";
1414
- status: 302;
1409
+ output: {
1410
+ code: any;
1411
+ message: any;
1412
+ };
1413
+ outputFormat: "json";
1414
+ status: any;
1415
1415
  input: {
1416
1416
  param: {
1417
1417
  provider: string;
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/middleware/logger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE;QACT,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAWF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,qEAwBvD"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/middleware/logger.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE;QACT,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAWF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,qEAiCvD"}
@@ -1,3 +1,4 @@
1
+ import { isSpanContextValid, context as otelContext, trace, } from '@opentelemetry/api';
1
2
  import { createMiddleware } from 'hono/factory';
2
3
  /**
3
4
  * Determine the pino log level for a response status code.
@@ -19,7 +20,14 @@ function levelForStatus(status) {
19
20
  export function loggerMiddleware(rootLogger) {
20
21
  return createMiddleware(async (c, next) => {
21
22
  const reqId = crypto.randomUUID();
22
- const child = rootLogger.child({ reqId });
23
+ const spanContext = trace.getSpan(otelContext.active())?.spanContext();
24
+ const child = rootLogger.child(spanContext && isSpanContextValid(spanContext)
25
+ ? {
26
+ reqId,
27
+ trace_id: spanContext.traceId,
28
+ span_id: spanContext.spanId,
29
+ }
30
+ : { reqId });
23
31
  c.set('logger', child);
24
32
  const start = performance.now();
25
33
  await next();
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/middleware/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAYhD;;GAEG;AACH,SAAS,cAAc,CAAC,MAAc;IACpC,IAAI,MAAM,IAAI,GAAG;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,MAAM,IAAI,GAAG;QAAE,OAAO,MAAM,CAAC;IACjC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAuB;IACtD,OAAO,gBAAgB,CAAY,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1C,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAEvB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,IAAI,EAAE,CAAC;QACb,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,W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,CAAC;QACvE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAC5B,WAAW,IAAI,kBAAkB,CAAC,WAAW,CAAC;YAC5C,CAAC,CAAC;gBACE,KAAK;gBACL,QAAQ,EAAE,WAAW,CAAC,OAAO;gBAC7B,OAAO,EAAE,WAAW,CAAC,MAAM;aAC5B;YACH,CAAC,CAAC,EAAE,KAAK,EAAE,CACd,CAAC;QACF,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAEvB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,IAAI,EAAE,CAAC;QACb,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;QAE3D,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;QACxB,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;QAC5B,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;QAEhD,KAAK,CAAC,KAAK,CAAC,CACV;YACE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;YACxC,GAAG,EAAE,EAAE,MAAM,EAAE;YACf,YAAY;SACb,EACD,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -3,11 +3,10 @@ export declare const authAccountsRemovePost: import("hono/hono-base").HonoBase<A
3
3
  "/auth/accounts/remove": {
4
4
  $post: {
5
5
  output: {
6
- code: string;
7
- message: string;
6
+ ok: true;
8
7
  };
9
8
  outputFormat: "json";
10
- status: 400;
9
+ status: 200;
11
10
  input: {
12
11
  json: {
13
12
  sub: string;
@@ -15,10 +14,11 @@ export declare const authAccountsRemovePost: import("hono/hono-base").HonoBase<A
15
14
  };
16
15
  } | {
17
16
  output: {
18
- ok: true;
17
+ code: string;
18
+ message: string;
19
19
  };
20
20
  outputFormat: "json";
21
- status: 200;
21
+ status: 400;
22
22
  input: {
23
23
  json: {
24
24
  sub: string;
@@ -1489,12 +1489,9 @@ export declare const apiRoutes: import("hono/hono-base").HonoBase<AppEnv, import
1489
1489
  }, "/">, "/"> | import("hono/types").MergeSchemaPath<import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
1490
1490
  "/oauth/:provider/callback": {
1491
1491
  $post: {
1492
- output: {
1493
- code: any;
1494
- message: any;
1495
- };
1496
- outputFormat: "json";
1497
- status: any;
1492
+ output: undefined;
1493
+ outputFormat: "redirect";
1494
+ status: 302;
1498
1495
  input: {
1499
1496
  param: {
1500
1497
  provider: string;
@@ -1508,9 +1505,12 @@ export declare const apiRoutes: import("hono/hono-base").HonoBase<AppEnv, import
1508
1505
  };
1509
1506
  };
1510
1507
  } | {
1511
- output: undefined;
1512
- outputFormat: "redirect";
1513
- status: 302;
1508
+ output: {
1509
+ code: any;
1510
+ message: any;
1511
+ };
1512
+ outputFormat: "json";
1513
+ status: any;
1514
1514
  input: {
1515
1515
  param: {
1516
1516
  provider: string;
@@ -1574,12 +1574,9 @@ export declare const apiRoutes: import("hono/hono-base").HonoBase<AppEnv, import
1574
1574
  }, "/"> | import("hono/types").MergeSchemaPath<{
1575
1575
  "/oauth/:provider/callback": {
1576
1576
  $get: {
1577
- output: {
1578
- code: any;
1579
- message: any;
1580
- };
1581
- outputFormat: "json";
1582
- status: any;
1577
+ output: undefined;
1578
+ outputFormat: "redirect";
1579
+ status: 302;
1583
1580
  input: {
1584
1581
  param: {
1585
1582
  provider: string;
@@ -1593,9 +1590,12 @@ export declare const apiRoutes: import("hono/hono-base").HonoBase<AppEnv, import
1593
1590
  };
1594
1591
  };
1595
1592
  } | {
1596
- output: undefined;
1597
- outputFormat: "redirect";
1598
- status: 302;
1593
+ output: {
1594
+ code: any;
1595
+ message: any;
1596
+ };
1597
+ outputFormat: "json";
1598
+ status: any;
1599
1599
  input: {
1600
1600
  param: {
1601
1601
  provider: string;
@@ -2,9 +2,12 @@ import type { AppEnv } from '../../../../../lib/app-env.ts';
2
2
  export declare const oauthProviderCallbackGet: import("hono/hono-base").HonoBase<AppEnv, {
3
3
  "/oauth/:provider/callback": {
4
4
  $get: {
5
- output: undefined;
6
- outputFormat: "redirect";
7
- status: 302;
5
+ output: {
6
+ code: any;
7
+ message: any;
8
+ };
9
+ outputFormat: "json";
10
+ status: any;
8
11
  input: {
9
12
  param: {
10
13
  provider: string;
@@ -18,12 +21,9 @@ export declare const oauthProviderCallbackGet: import("hono/hono-base").HonoBase
18
21
  };
19
22
  };
20
23
  } | {
21
- output: {
22
- code: any;
23
- message: any;
24
- };
25
- outputFormat: "json";
26
- status: any;
24
+ output: undefined;
25
+ outputFormat: "redirect";
26
+ status: 302;
27
27
  input: {
28
28
  param: {
29
29
  provider: string;
@@ -2,12 +2,9 @@ import type { AppEnv } from '../../../../../lib/app-env.ts';
2
2
  export declare const oauthProviderCallbackPost: import("hono/hono-base").HonoBase<AppEnv, {
3
3
  "/oauth/:provider/callback": {
4
4
  $post: {
5
- output: {
6
- code: any;
7
- message: any;
8
- };
9
- outputFormat: "json";
10
- status: any;
5
+ output: undefined;
6
+ outputFormat: "redirect";
7
+ status: 302;
11
8
  input: {
12
9
  param: {
13
10
  provider: string;
@@ -21,9 +18,12 @@ export declare const oauthProviderCallbackPost: import("hono/hono-base").HonoBas
21
18
  };
22
19
  };
23
20
  } | {
24
- output: undefined;
25
- outputFormat: "redirect";
26
- status: 302;
21
+ output: {
22
+ code: any;
23
+ message: any;
24
+ };
25
+ outputFormat: "json";
26
+ status: any;
27
27
  input: {
28
28
  param: {
29
29
  provider: string;
@@ -2,9 +2,12 @@ import type { AppEnv } from '../../../lib/app-env.ts';
2
2
  export declare const oauthRoutes: import("hono/hono-base").HonoBase<AppEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
3
3
  "/oauth/:provider/callback": {
4
4
  $get: {
5
- output: undefined;
6
- outputFormat: "redirect";
7
- status: 302;
5
+ output: {
6
+ code: any;
7
+ message: any;
8
+ };
9
+ outputFormat: "json";
10
+ status: any;
8
11
  input: {
9
12
  param: {
10
13
  provider: string;
@@ -18,12 +21,9 @@ export declare const oauthRoutes: import("hono/hono-base").HonoBase<AppEnv, impo
18
21
  };
19
22
  };
20
23
  } | {
21
- output: {
22
- code: any;
23
- message: any;
24
- };
25
- outputFormat: "json";
26
- status: any;
24
+ output: undefined;
25
+ outputFormat: "redirect";
26
+ status: 302;
27
27
  input: {
28
28
  param: {
29
29
  provider: string;
@@ -87,9 +87,12 @@ export declare const oauthRoutes: import("hono/hono-base").HonoBase<AppEnv, impo
87
87
  }, "/"> | import("hono/types").MergeSchemaPath<{
88
88
  "/oauth/:provider/callback": {
89
89
  $post: {
90
- output: undefined;
91
- outputFormat: "redirect";
92
- status: 302;
90
+ output: {
91
+ code: any;
92
+ message: any;
93
+ };
94
+ outputFormat: "json";
95
+ status: any;
93
96
  input: {
94
97
  param: {
95
98
  provider: string;
@@ -103,12 +106,9 @@ export declare const oauthRoutes: import("hono/hono-base").HonoBase<AppEnv, impo
103
106
  };
104
107
  };
105
108
  } | {
106
- output: {
107
- code: any;
108
- message: any;
109
- };
110
- outputFormat: "json";
111
- status: any;
109
+ output: undefined;
110
+ outputFormat: "redirect";
111
+ status: 302;
112
112
  input: {
113
113
  param: {
114
114
  provider: string;
@@ -308,11 +308,10 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
308
308
  "/auth/accounts/remove": {
309
309
  $post: {
310
310
  output: {
311
- code: string;
312
- message: string;
311
+ ok: true;
313
312
  };
314
313
  outputFormat: "json";
315
- status: 400;
314
+ status: 200;
316
315
  input: {
317
316
  json: {
318
317
  sub: string;
@@ -320,10 +319,11 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
320
319
  };
321
320
  } | {
322
321
  output: {
323
- ok: true;
322
+ code: string;
323
+ message: string;
324
324
  };
325
325
  outputFormat: "json";
326
- status: 200;
326
+ status: 400;
327
327
  input: {
328
328
  json: {
329
329
  sub: string;
@@ -557,9 +557,12 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
557
557
  }, "/">, "/"> | import("hono/types").MergeSchemaPath<import("hono/types").MergeSchemaPath<{
558
558
  "/oauth/:provider/callback": {
559
559
  $get: {
560
- output: undefined;
561
- outputFormat: "redirect";
562
- status: 302;
560
+ output: {
561
+ code: any;
562
+ message: any;
563
+ };
564
+ outputFormat: "json";
565
+ status: any;
563
566
  input: {
564
567
  param: {
565
568
  provider: string;
@@ -573,12 +576,9 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
573
576
  };
574
577
  };
575
578
  } | {
576
- output: {
577
- code: any;
578
- message: any;
579
- };
580
- outputFormat: "json";
581
- status: any;
579
+ output: undefined;
580
+ outputFormat: "redirect";
581
+ status: 302;
582
582
  input: {
583
583
  param: {
584
584
  provider: string;
@@ -642,9 +642,12 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
642
642
  }, "/">, "/"> | import("hono/types").MergeSchemaPath<import("hono/types").MergeSchemaPath<{
643
643
  "/oauth/:provider/callback": {
644
644
  $post: {
645
- output: undefined;
646
- outputFormat: "redirect";
647
- status: 302;
645
+ output: {
646
+ code: any;
647
+ message: any;
648
+ };
649
+ outputFormat: "json";
650
+ status: any;
648
651
  input: {
649
652
  param: {
650
653
  provider: string;
@@ -658,12 +661,9 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
658
661
  };
659
662
  };
660
663
  } | {
661
- output: {
662
- code: any;
663
- message: any;
664
- };
665
- outputFormat: "json";
666
- status: any;
664
+ output: undefined;
665
+ outputFormat: "redirect";
666
+ status: 302;
667
667
  input: {
668
668
  param: {
669
669
  provider: string;
@@ -1079,11 +1079,11 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
1079
1079
  "/auth/accounts/select": {
1080
1080
  $post: {
1081
1081
  output: {
1082
- code: string;
1083
- message: string;
1082
+ ok: true;
1083
+ active_sub: string;
1084
1084
  };
1085
1085
  outputFormat: "json";
1086
- status: 400;
1086
+ status: 200;
1087
1087
  input: {
1088
1088
  json: {
1089
1089
  sub: string;
@@ -1091,11 +1091,11 @@ export declare const routes: import("hono/hono-base").HonoBase<AppEnv, import("h
1091
1091
  };
1092
1092
  } | {
1093
1093
  output: {
1094
- ok: true;
1095
- active_sub: string;
1094
+ code: string;
1095
+ message: string;
1096
1096
  };
1097
1097
  outputFormat: "json";
1098
- status: 200;
1098
+ status: 400;
1099
1099
  input: {
1100
1100
  json: {
1101
1101
  sub: string;
@@ -2,12 +2,9 @@ import type { AppEnv } from '../../../lib/app-env.js';
2
2
  export declare const endSessionGet: import("hono/hono-base").HonoBase<AppEnv, {
3
3
  "/end_session": {
4
4
  $get: {
5
- output: {
6
- error: string;
7
- error_description: string;
8
- };
9
- outputFormat: "json";
10
- status: 400;
5
+ output: undefined;
6
+ outputFormat: "redirect";
7
+ status: 302;
11
8
  input: {
12
9
  query: {
13
10
  client_id?: string | undefined;
@@ -17,9 +14,12 @@ export declare const endSessionGet: import("hono/hono-base").HonoBase<AppEnv, {
17
14
  };
18
15
  };
19
16
  } | {
20
- output: undefined;
21
- outputFormat: "redirect";
22
- status: 302;
17
+ output: {
18
+ error: string;
19
+ error_description: string;
20
+ };
21
+ outputFormat: "json";
22
+ status: 400;
23
23
  input: {
24
24
  query: {
25
25
  client_id?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinyrack/issuary-server",
3
- "version": "0.29.2",
3
+ "version": "0.29.3",
4
4
  "type": "module",
5
5
  "description": "OpenID Connect Provider with OAuth2 support",
6
6
  "license": "MIT",