@cemiar/auth-sdk 1.0.17 → 1.0.19

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/dist/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export { registerCemiarAuthHapi } from "./server/ServerHandler.js";
3
3
  export * from "./shared/Types.js";
4
4
  export { tokenToClaim, tokenToClaimBrowser, normalizeBaseUrl, isBrowser } from "./shared/Utils.js";
5
5
  export { authorizeRoute } from "./server/AuthorizationHandler.js";
6
+ export { ACTIONS_OPTIONS, Action, ActionInfo } from "./shared/constants/AuthzConstants.js";
package/dist/index.js CHANGED
@@ -3,3 +3,4 @@ export { registerCemiarAuthHapi } from "./server/ServerHandler.js";
3
3
  export * from "./shared/Types.js";
4
4
  export { tokenToClaim, tokenToClaimBrowser, normalizeBaseUrl, isBrowser } from "./shared/Utils.js";
5
5
  export { authorizeRoute } from "./server/AuthorizationHandler.js";
6
+ export { ACTIONS_OPTIONS } from "./shared/constants/AuthzConstants.js";
@@ -1,5 +1,6 @@
1
1
  import { ReqRefDefaults, ResponseToolkit } from "@hapi/hapi";
2
+ import { Action } from "../shared/constants/AuthzConstants.js";
2
3
  export declare function authorizeRoute({ resource, action }: {
3
4
  resource: string;
4
- action: string;
5
+ action: Action;
5
6
  }): (request: any, h: ResponseToolkit<ReqRefDefaults>) => Promise<symbol | import("@hapi/hapi").ResponseObject>;
@@ -0,0 +1,6 @@
1
+ export interface ActionInfo {
2
+ displayName: string;
3
+ value: Action;
4
+ }
5
+ export type Action = "read" | "write" | "delete" | "*";
6
+ export declare const ACTIONS_OPTIONS: ActionInfo[];
@@ -0,0 +1,6 @@
1
+ export const ACTIONS_OPTIONS = [
2
+ { displayName: "Read", value: "read" },
3
+ { displayName: "Write", value: "write" },
4
+ { displayName: "Delete", value: "delete" },
5
+ { displayName: "All", value: "*" }
6
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cemiar/auth-sdk",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Cemiar Auth integration helpers for web apps and APIs.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",