@schemavaults/auth-common 0.9.5 → 0.9.7

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.
@@ -0,0 +1,5 @@
1
+ declare const ERROR_IDS: readonly ["unknown", "bad_request", "app_id_not_found", "api_server_id_not_found", "unauthenticated", "forbidden", "load_user_data_failure", "internal_server_error", "load_server_config_failure", "server_misconfiguration"];
2
+ export type SchemaVaultsAuthErrorId = (typeof ERROR_IDS)[number];
3
+ export declare const ERROR_MESSAGE_CATALOG: Record<SchemaVaultsAuthErrorId, string>;
4
+ export declare function isValidErrorId(id: string): id is SchemaVaultsAuthErrorId;
5
+ export {};
@@ -0,0 +1,28 @@
1
+ const ERROR_IDS = [
2
+ "unknown",
3
+ "bad_request",
4
+ "app_id_not_found",
5
+ "api_server_id_not_found",
6
+ "unauthenticated",
7
+ "forbidden",
8
+ "load_user_data_failure",
9
+ "internal_server_error",
10
+ "load_server_config_failure",
11
+ "server_misconfiguration",
12
+ ];
13
+ export const ERROR_MESSAGE_CATALOG = {
14
+ unknown: "An unknown error occurred",
15
+ bad_request: "Your request was malformed or invalid.",
16
+ app_id_not_found: "App with specified ID not found!",
17
+ api_server_id_not_found: "API server with specified ID not found",
18
+ unauthenticated: "Failed to authenticate to figure out who you are! Try logging in again or contacting support...",
19
+ forbidden: "Oops! You don't have permission to do that action! Get in touch with support if you believe this is a mistake!",
20
+ load_user_data_failure: "There was an error loading data associated with your SchemaVaults account!",
21
+ internal_server_error: "There was a problem in the SchemaVaults backend logic and something caused a crash!",
22
+ load_server_config_failure: "There was a problem loading server configuration settings.",
23
+ server_misconfiguration: "The server does not appear to be configured properly. If you are the site admin, please see the logs for more details.",
24
+ };
25
+ export function isValidErrorId(id) {
26
+ return ERROR_IDS.includes(id);
27
+ }
28
+ //# sourceMappingURL=auth-error-message-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-error-message-catalog.js","sourceRoot":"","sources":["../src/auth-error-message-catalog.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG;IAChB,SAAS;IACT,aAAa;IACb,kBAAkB;IAClB,yBAAyB;IACzB,iBAAiB;IACjB,WAAW;IACX,wBAAwB;IACxB,uBAAuB;IACvB,4BAA4B;IAC5B,yBAAyB;CACW,CAAC;AAIvC,MAAM,CAAC,MAAM,qBAAqB,GAA4C;IAC5E,OAAO,EAAE,2BAA2B;IACpC,WAAW,EAAE,wCAAwC;IACrD,gBAAgB,EAAE,kCAAkC;IACpD,uBAAuB,EAAE,wCAAwC;IACjE,eAAe,EACb,iGAAiG;IACnG,SAAS,EACP,gHAAgH;IAClH,sBAAsB,EACpB,4EAA4E;IAC9E,qBAAqB,EACnB,qFAAqF;IACvF,0BAA0B,EACxB,4DAA4D;IAC9D,uBAAuB,EACrB,wHAAwH;CAC3H,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,SAAS,CAAC,QAAQ,CAAC,EAA8C,CAAC,CAAC;AAC5E,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export { ERROR_MESSAGE_CATALOG, isValidErrorId } from "./auth-error-message-catalog";
2
+ export type { SchemaVaultsAuthErrorId } from "./auth-error-message-catalog";
1
3
  export { userDataSchema, type UserData } from "./user_data";
2
4
  export * from "./credentials";
3
5
  export type * from "./credentials";
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { ERROR_MESSAGE_CATALOG, isValidErrorId } from "./auth-error-message-catalog";
1
2
  export { userDataSchema } from "./user_data";
2
3
  export * from "./credentials";
3
4
  // Shapes of tokens
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAE5D,cAAc,eAAe,CAAC;AAG9B,mBAAmB;AACnB,cAAc,cAAc,CAAC;AAM7B,cAAc,cAAc,C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Ac,eAAe,CAAC;AAG9B,mBAAmB;AACnB,cAAc,cAAc,CAAC;AAM7B,cAAc,cAAc,CAAC;AAG7B,cAAc,QAAQ,CAAC;AAGvB,OAAO,EACL,wBAAwB,GAEzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yBAAyB,EAEzB,uCAAuC,GAExC,MAAM,yBAAyB,CAAC;AAEjC,cAAc,mCAAmC,CAAC;AAGlD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,EAC5B,aAAa,EACb,4BAA4B,EAC5B,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,GAC7B,MAAM,iBAAiB,CAAC;AAazB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AAEtG,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAE9F,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@schemavaults/auth-common",
3
3
  "description": "Types and utility functions for authentication and authorization",
4
- "version": "0.9.5",
4
+ "version": "0.9.7",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "types": "dist/index.d.ts",
15
15
  "dependencies": {
16
16
  "zod": "3.25.8",
17
- "@schemavaults/app-definitions": "0.6.19",
17
+ "@schemavaults/app-definitions": "0.6.21",
18
18
  "crypto-js": "4.2.0"
19
19
  },
20
20
  "scripts": {
@@ -66,6 +66,11 @@
66
66
  "types": "./dist/AccessTokenCookieNames.d.ts",
67
67
  "import": "./dist/AccessTokenCookieNames.js",
68
68
  "require": "./dist/AccessTokenCookieNames.js"
69
+ },
70
+ "./auth-error-message-catalog": {
71
+ "types": "./dist/auth-error-message-catalog.d.ts",
72
+ "import": "./dist/auth-error-message-catalog.js",
73
+ "require": "./dist/auth-error-message-catalog.js"
69
74
  }
70
75
  }
71
76
  }