@aeriajs/types 0.0.50 → 0.0.51

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.
@@ -2,7 +2,6 @@ import type { UserRole } from './token.js';
2
2
  export type AccessCondition = readonly UserRole[] | boolean | 'unauthenticated' | 'unauthenticated-only';
3
3
  export type RoleFromAccessCondition<TAccessCondition extends AccessCondition | undefined> = undefined extends TAccessCondition ? null : TAccessCondition extends readonly (infer Role)[] ? Role : TAccessCondition extends true ? Exclude<UserRole, 'unauthenticated'> : TAccessCondition extends false ? never : TAccessCondition extends 'unauthenticated-only' ? 'unauthenticated' : TAccessCondition extends 'unauthenticated' ? UserRole : never;
4
4
  export declare enum ACError {
5
- AssetNotFound = "ASSET_NOT_FOUND",
6
5
  AuthenticationError = "AUTHENTICATION_ERROR",
7
6
  AuthorizationError = "AUTHORIZATION_ERROR",
8
7
  FunctionNotFound = "FUNCTION_NOT_FOUND",
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ACErrorMessages = exports.ACError = void 0;
4
4
  var ACError;
5
5
  (function (ACError) {
6
- ACError["AssetNotFound"] = "ASSET_NOT_FOUND";
7
6
  ACError["AuthenticationError"] = "AUTHENTICATION_ERROR";
8
7
  ACError["AuthorizationError"] = "AUTHORIZATION_ERROR";
9
8
  ACError["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
@@ -16,7 +15,6 @@ var ACError;
16
15
  ACError["ResourceNotFound"] = "RESOURCE_NOT_FOUND";
17
16
  })(ACError || (exports.ACError = ACError = {}));
18
17
  exports.ACErrorMessages = {
19
- [ACError.AssetNotFound]: 'collection has no registered functions',
20
18
  [ACError.AuthenticationError]: 'you have insufficient privileges',
21
19
  [ACError.AuthorizationError]: 'you have insufficient privileges',
22
20
  [ACError.FunctionNotFound]: 'function not found',
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  export var ACError = /* @__PURE__ */ ((ACError2) => {
3
- ACError2["AssetNotFound"] = "ASSET_NOT_FOUND";
4
3
  ACError2["AuthenticationError"] = "AUTHENTICATION_ERROR";
5
4
  ACError2["AuthorizationError"] = "AUTHORIZATION_ERROR";
6
5
  ACError2["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
@@ -14,7 +13,6 @@ export var ACError = /* @__PURE__ */ ((ACError2) => {
14
13
  return ACError2;
15
14
  })(ACError || {});
16
15
  export const ACErrorMessages = {
17
- ["ASSET_NOT_FOUND" /* AssetNotFound */]: "collection has no registered functions",
18
16
  ["AUTHENTICATION_ERROR" /* AuthenticationError */]: "you have insufficient privileges",
19
17
  ["AUTHORIZATION_ERROR" /* AuthorizationError */]: "you have insufficient privileges",
20
18
  ["FUNCTION_NOT_FOUND" /* FunctionNotFound */]: "function not found",
package/dist/monad.d.ts CHANGED
@@ -9,7 +9,7 @@ export type Right<T> = {
9
9
  export type EndpointErrorContent = {
10
10
  httpStatus?: number;
11
11
  code: string;
12
- message: string;
12
+ message?: string;
13
13
  details?: Record<string, any>;
14
14
  };
15
15
  export type EndpointError<T extends EndpointErrorContent> = {
@@ -25,7 +25,7 @@ export type SecurityPolicy = {
25
25
  logging?: LoggingParams;
26
26
  };
27
27
  export type CollectionSecurityPolicy<TCollection extends {
28
- functions?: Record<string, (...args: any[]) => unknown>;
28
+ functions?: Record<string, unknown>;
29
29
  }> = {
30
30
  functions?: Partial<Record<keyof TCollection['functions'], SecurityPolicy>>;
31
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",