@tennantje/identity-types 1.0.21 → 1.0.23

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.
@@ -1,14 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isApiError = exports.isOAuthError = void 0;
1
4
  // Type guards
2
- export const isOAuthError = (data) => {
5
+ const isOAuthError = (data) => {
3
6
  return typeof data === 'object' &&
4
7
  data !== null &&
5
8
  typeof data.error === 'string' &&
6
9
  typeof data.error_description === 'string';
7
10
  };
8
- export const isApiError = (data) => {
11
+ exports.isOAuthError = isOAuthError;
12
+ const isApiError = (data) => {
9
13
  return typeof data === 'object' &&
10
14
  data !== null &&
11
15
  typeof data.error === 'object' &&
12
16
  data.error !== null &&
13
17
  typeof data.error.message === 'string';
14
18
  };
19
+ exports.isApiError = isApiError;
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/OAuth.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,7 @@
1
- export class OAuthError extends Error {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OAuthUnsupportedGrantTypeError = exports.OAuthTemporarilyUnavailableError = exports.OAuthServerError = exports.OAuthInvalidScopeError = exports.OAuthUnsupportedResponseTypeError = exports.OAuthAccessDeniedError = exports.OAuthUnauthorizedClientError = exports.OAuthInvalidGrantError = exports.OAuthInvalidRequestError = exports.OAuthError = void 0;
4
+ class OAuthError extends Error {
2
5
  error;
3
6
  errorDescription;
4
7
  code;
@@ -15,7 +18,8 @@ export class OAuthError extends Error {
15
18
  this.sendCorsHeaders = input.sendCorsHeaders ?? false;
16
19
  }
17
20
  }
18
- export class OAuthInvalidRequestError extends OAuthError {
21
+ exports.OAuthError = OAuthError;
22
+ class OAuthInvalidRequestError extends OAuthError {
19
23
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
20
24
  super({
21
25
  code,
@@ -27,7 +31,8 @@ export class OAuthInvalidRequestError extends OAuthError {
27
31
  });
28
32
  }
29
33
  }
30
- export class OAuthInvalidGrantError extends OAuthError {
34
+ exports.OAuthInvalidRequestError = OAuthInvalidRequestError;
35
+ class OAuthInvalidGrantError extends OAuthError {
31
36
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
32
37
  super({
33
38
  code,
@@ -39,7 +44,8 @@ export class OAuthInvalidGrantError extends OAuthError {
39
44
  });
40
45
  }
41
46
  }
42
- export class OAuthUnauthorizedClientError extends OAuthError {
47
+ exports.OAuthInvalidGrantError = OAuthInvalidGrantError;
48
+ class OAuthUnauthorizedClientError extends OAuthError {
43
49
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
44
50
  super({
45
51
  code,
@@ -51,7 +57,8 @@ export class OAuthUnauthorizedClientError extends OAuthError {
51
57
  });
52
58
  }
53
59
  }
54
- export class OAuthAccessDeniedError extends OAuthError {
60
+ exports.OAuthUnauthorizedClientError = OAuthUnauthorizedClientError;
61
+ class OAuthAccessDeniedError extends OAuthError {
55
62
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
56
63
  super({
57
64
  code,
@@ -63,7 +70,8 @@ export class OAuthAccessDeniedError extends OAuthError {
63
70
  });
64
71
  }
65
72
  }
66
- export class OAuthUnsupportedResponseTypeError extends OAuthError {
73
+ exports.OAuthAccessDeniedError = OAuthAccessDeniedError;
74
+ class OAuthUnsupportedResponseTypeError extends OAuthError {
67
75
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
68
76
  super({
69
77
  code,
@@ -75,7 +83,8 @@ export class OAuthUnsupportedResponseTypeError extends OAuthError {
75
83
  });
76
84
  }
77
85
  }
78
- export class OAuthInvalidScopeError extends OAuthError {
86
+ exports.OAuthUnsupportedResponseTypeError = OAuthUnsupportedResponseTypeError;
87
+ class OAuthInvalidScopeError extends OAuthError {
79
88
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
80
89
  super({
81
90
  code,
@@ -87,7 +96,8 @@ export class OAuthInvalidScopeError extends OAuthError {
87
96
  });
88
97
  }
89
98
  }
90
- export class OAuthServerError extends OAuthError {
99
+ exports.OAuthInvalidScopeError = OAuthInvalidScopeError;
100
+ class OAuthServerError extends OAuthError {
91
101
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
92
102
  super({
93
103
  code,
@@ -99,7 +109,8 @@ export class OAuthServerError extends OAuthError {
99
109
  });
100
110
  }
101
111
  }
102
- export class OAuthTemporarilyUnavailableError extends OAuthError {
112
+ exports.OAuthServerError = OAuthServerError;
113
+ class OAuthTemporarilyUnavailableError extends OAuthError {
103
114
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
104
115
  super({
105
116
  code,
@@ -111,7 +122,8 @@ export class OAuthTemporarilyUnavailableError extends OAuthError {
111
122
  });
112
123
  }
113
124
  }
114
- export class OAuthUnsupportedGrantTypeError extends OAuthError {
125
+ exports.OAuthTemporarilyUnavailableError = OAuthTemporarilyUnavailableError;
126
+ class OAuthUnsupportedGrantTypeError extends OAuthError {
115
127
  constructor({ code, redirectUri, state, sendCorsHeaders, }) {
116
128
  super({
117
129
  code,
@@ -123,3 +135,4 @@ export class OAuthUnsupportedGrantTypeError extends OAuthError {
123
135
  });
124
136
  }
125
137
  }
138
+ exports.OAuthUnsupportedGrantTypeError = OAuthUnsupportedGrantTypeError;
package/dist/Session.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/User.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/WebAuthn.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from "./User";
2
- export * from "./Session";
3
- export * from "./WebAuthn";
4
- export * from "./OAuth";
5
- export * from "./OAuthError";
6
- export * from "./Miscellaneous";
7
- export * from "./ApiResponse";
1
+ export * from "./User.js";
2
+ export * from "./Session.js";
3
+ export * from "./WebAuthn.js";
4
+ export * from "./OAuth.js";
5
+ export * from "./OAuthError.js";
6
+ export * from "./Miscellaneous.js";
7
+ export * from "./ApiResponse.js";
package/dist/index.js CHANGED
@@ -1,7 +1,23 @@
1
- export * from "./User";
2
- export * from "./Session";
3
- export * from "./WebAuthn";
4
- export * from "./OAuth";
5
- export * from "./OAuthError";
6
- export * from "./Miscellaneous";
7
- export * from "./ApiResponse";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./User.js"), exports);
18
+ __exportStar(require("./Session.js"), exports);
19
+ __exportStar(require("./WebAuthn.js"), exports);
20
+ __exportStar(require("./OAuth.js"), exports);
21
+ __exportStar(require("./OAuthError.js"), exports);
22
+ __exportStar(require("./Miscellaneous.js"), exports);
23
+ __exportStar(require("./ApiResponse.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tennantje/identity-types",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Shared TypeScript types for identity server project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",