@aeriajs/types 0.0.113 → 0.0.115

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,17 +1,17 @@
1
1
  import type { UserRole } from './token.js';
2
- export type AccessCondition = readonly UserRole[] | boolean | 'unauthenticated' | 'unauthenticated-only';
2
+ export type AccessCondition = undefined | boolean | readonly UserRole[] | '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
- export declare enum ACError {
5
- AuthenticationError = "AUTHENTICATION_ERROR",
6
- AuthorizationError = "AUTHORIZATION_ERROR",
7
- FunctionNotFound = "FUNCTION_NOT_FOUND",
8
- FunctionNotExposed = "FUNCTION_NOT_EXPOSED",
9
- TargetImmutable = "TARGET_IMMUTABLE",
10
- InvalidLimit = "INVALID_LIMIT",
11
- OwnershipError = "OWNERSHIP_ERROR",
12
- ResourceNotFound = "RESOURCE_NOT_FOUND",
13
- InsecureOperator = "INSECURE_OPERATOR",
14
- MalformedInput = "MALFORMED_INPUT",
15
- UniquenessViolated = "UNIQUENESS_VIOLATED",
16
- UnknownError = "UNKNOWN_ERROR"
17
- }
4
+ export declare const ACError: {
5
+ readonly AuthenticationError: "AUTHENTICATION_ERROR";
6
+ readonly AuthorizationError: "AUTHORIZATION_ERROR";
7
+ readonly FunctionNotFound: "FUNCTION_NOT_FOUND";
8
+ readonly FunctionNotExposed: "FUNCTION_NOT_EXPOSED";
9
+ readonly TargetImmutable: "TARGET_IMMUTABLE";
10
+ readonly InvalidLimit: "INVALID_LIMIT";
11
+ readonly OwnershipError: "OWNERSHIP_ERROR";
12
+ readonly ResourceNotFound: "RESOURCE_NOT_FOUND";
13
+ readonly InsecureOperator: "INSECURE_OPERATOR";
14
+ readonly MalformedInput: "MALFORMED_INPUT";
15
+ readonly UniquenessViolated: "UNIQUENESS_VIOLATED";
16
+ readonly UnknownError: "UNKNOWN_ERROR";
17
+ };
@@ -1,18 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ACError = void 0;
4
- var ACError;
5
- (function (ACError) {
6
- ACError["AuthenticationError"] = "AUTHENTICATION_ERROR";
7
- ACError["AuthorizationError"] = "AUTHORIZATION_ERROR";
8
- ACError["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
9
- ACError["FunctionNotExposed"] = "FUNCTION_NOT_EXPOSED";
10
- ACError["TargetImmutable"] = "TARGET_IMMUTABLE";
11
- ACError["InvalidLimit"] = "INVALID_LIMIT";
12
- ACError["OwnershipError"] = "OWNERSHIP_ERROR";
13
- ACError["ResourceNotFound"] = "RESOURCE_NOT_FOUND";
14
- ACError["InsecureOperator"] = "INSECURE_OPERATOR";
15
- ACError["MalformedInput"] = "MALFORMED_INPUT";
16
- ACError["UniquenessViolated"] = "UNIQUENESS_VIOLATED";
17
- ACError["UnknownError"] = "UNKNOWN_ERROR";
18
- })(ACError || (exports.ACError = ACError = {}));
4
+ exports.ACError = {
5
+ AuthenticationError: 'AUTHENTICATION_ERROR',
6
+ AuthorizationError: 'AUTHORIZATION_ERROR',
7
+ FunctionNotFound: 'FUNCTION_NOT_FOUND',
8
+ FunctionNotExposed: 'FUNCTION_NOT_EXPOSED',
9
+ TargetImmutable: 'TARGET_IMMUTABLE',
10
+ InvalidLimit: 'INVALID_LIMIT',
11
+ OwnershipError: 'OWNERSHIP_ERROR',
12
+ ResourceNotFound: 'RESOURCE_NOT_FOUND',
13
+ InsecureOperator: 'INSECURE_OPERATOR',
14
+ MalformedInput: 'MALFORMED_INPUT',
15
+ UniquenessViolated: 'UNIQUENESS_VIOLATED',
16
+ UnknownError: 'UNKNOWN_ERROR',
17
+ };
@@ -1,16 +1,15 @@
1
1
  "use strict";
2
- export var ACError = /* @__PURE__ */ ((ACError2) => {
3
- ACError2["AuthenticationError"] = "AUTHENTICATION_ERROR";
4
- ACError2["AuthorizationError"] = "AUTHORIZATION_ERROR";
5
- ACError2["FunctionNotFound"] = "FUNCTION_NOT_FOUND";
6
- ACError2["FunctionNotExposed"] = "FUNCTION_NOT_EXPOSED";
7
- ACError2["TargetImmutable"] = "TARGET_IMMUTABLE";
8
- ACError2["InvalidLimit"] = "INVALID_LIMIT";
9
- ACError2["OwnershipError"] = "OWNERSHIP_ERROR";
10
- ACError2["ResourceNotFound"] = "RESOURCE_NOT_FOUND";
11
- ACError2["InsecureOperator"] = "INSECURE_OPERATOR";
12
- ACError2["MalformedInput"] = "MALFORMED_INPUT";
13
- ACError2["UniquenessViolated"] = "UNIQUENESS_VIOLATED";
14
- ACError2["UnknownError"] = "UNKNOWN_ERROR";
15
- return ACError2;
16
- })(ACError || {});
2
+ export const ACError = {
3
+ AuthenticationError: "AUTHENTICATION_ERROR",
4
+ AuthorizationError: "AUTHORIZATION_ERROR",
5
+ FunctionNotFound: "FUNCTION_NOT_FOUND",
6
+ FunctionNotExposed: "FUNCTION_NOT_EXPOSED",
7
+ TargetImmutable: "TARGET_IMMUTABLE",
8
+ InvalidLimit: "INVALID_LIMIT",
9
+ OwnershipError: "OWNERSHIP_ERROR",
10
+ ResourceNotFound: "RESOURCE_NOT_FOUND",
11
+ InsecureOperator: "INSECURE_OPERATOR",
12
+ MalformedInput: "MALFORMED_INPUT",
13
+ UniquenessViolated: "UNIQUENESS_VIOLATED",
14
+ UnknownError: "UNKNOWN_ERROR"
15
+ };
package/dist/config.d.ts CHANGED
@@ -35,7 +35,7 @@ export type ApiConfig = {
35
35
  allowSignup?: boolean;
36
36
  mutableUserProperties: (keyof CollectionItem<'user'>)[];
37
37
  signupDefaults?: {
38
- roles?: string[];
38
+ roles?: readonly UserRole[];
39
39
  active?: boolean;
40
40
  };
41
41
  paginationLimit?: number;
package/dist/context.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import type { Collection as MongoCollection } from 'mongodb';
2
- import type { AcceptedRole } from './token.js';
3
2
  import type { Collection } from './collection.js';
4
3
  import type { ApiConfig } from './config.js';
5
4
  import type { CollectionFunctions } from './functions.js';
@@ -11,6 +10,7 @@ import type { PackReferences, SchemaWithId } from './schema.js';
11
10
  import type { JsonSchema } from './property.js';
12
11
  import type { RateLimitingParams, RateLimitingError } from './security.js';
13
12
  import type { Token } from './token.js';
13
+ import type { AccessCondition } from './accessControl.js';
14
14
  export type CollectionModel<TDescription extends Description> = MongoCollection<Omit<PackReferences<SchemaWithId<TDescription>>, '_id'>>;
15
15
  type OmitContextParameter<TFunction> = TFunction extends () => unknown ? TFunction : TFunction extends (payload: undefined, ...args: any[]) => infer Return ? () => Return : TFunction extends (payload: infer Payload, context: Context<any>, ...args: infer Rest) => infer Return ? (payload: Payload, ...args: Rest) => Return : never;
16
16
  type RestParameters<TFunction> = TFunction extends (payload: any, context: Context<any>, ...args: infer Rest) => unknown ? Rest : never;
@@ -38,16 +38,16 @@ export type ContextOptions = {
38
38
  inherited?: boolean;
39
39
  calledFunction?: string;
40
40
  };
41
- export type RouteContext<TAcceptedRole extends AcceptedRole = null> = {
41
+ export type RouteContext<TAccessCondition extends AccessCondition = false> = {
42
42
  collections: IndepthCollections;
43
- token: Token<TAcceptedRole>;
43
+ token: Token<TAccessCondition>;
44
44
  request: GenericRequest;
45
45
  response: GenericResponse;
46
46
  log: (message: string, details?: unknown) => Promise<unknown>;
47
- error: <const THTTPStatus extends HTTPStatus, const TEndpointError extends Omit<EndpointError, 'httpStatus'>>(httpStatus: THTTPStatus, error: TEndpointError) => Result.Error<TEndpointError & {
47
+ error: <const THTTPStatus extends typeof HTTPStatus[keyof typeof HTTPStatus], const TEndpointError extends Omit<EndpointError, 'httpStatus'>>(httpStatus: THTTPStatus, error: TEndpointError) => Result.Error<TEndpointError & {
48
48
  httpStatus: THTTPStatus;
49
49
  }>;
50
- limitRate: (params: RateLimitingParams) => Promise<Result.Either<EndpointError<RateLimitingError, HTTPStatus.TooManyRequests>, {
50
+ limitRate: (params: RateLimitingParams) => Promise<Result.Either<EndpointError<typeof RateLimitingError[keyof typeof RateLimitingError], typeof HTTPStatus.TooManyRequests>, {
51
51
  hits: number;
52
52
  points: number;
53
53
  last_reach: Date;
@@ -66,5 +66,5 @@ export type CollectionContext<TDescription extends Description, TFunctions = Col
66
66
  calledFunction?: string;
67
67
  };
68
68
  export type Context<TDescription extends Description = Description, TFunctions = Collection['functions']> = RouteContext & CollectionContext<TDescription, TFunctions>;
69
- export type StrictContext<TAcceptedRole extends AcceptedRole = null, TDescription extends Description = any, TFunctions = Collection['functions']> = RouteContext<TAcceptedRole> & CollectionContext<TDescription, TFunctions>;
69
+ export type StrictContext<TAccessCondition extends AccessCondition = false, TDescription extends Description = any, TFunctions = Collection['functions']> = RouteContext<TAccessCondition> & CollectionContext<TDescription, TFunctions>;
70
70
  export {};
@@ -3,7 +3,10 @@ import type { PhosphorIcon } from '@phosphor-icons/core';
3
3
  import type { Condition } from './condition.js';
4
4
  import type { JsonSchema, PropertiesWithId } from './property.js';
5
5
  import type { OwnershipMode } from './security.js';
6
- export type DescriptionPreset = 'add' | 'crud' | 'duplicate' | 'remove' | 'removeAll' | 'owned' | 'timestamped' | 'view';
6
+ export declare const DESCRIPTION_PRESETS: readonly ["add", "crud", "duplicate", "remove", "removeAll", "owned", "timestamped", "view"];
7
+ export declare const LAYOUT_NAMES: readonly ["tabular", "grid", "list"];
8
+ export type DescriptionPreset = typeof DESCRIPTION_PRESETS[number];
9
+ export type LayoutName = typeof LAYOUT_NAMES[number];
7
10
  export type Icon = PhosphorIcon['name'];
8
11
  export type CollectionActionRoute = {
9
12
  route: {
@@ -23,19 +26,19 @@ export type CollectionActionFunction = {
23
26
  export type CollectionActionEvent = {
24
27
  event?: string;
25
28
  };
26
- export type CollectionActionBase<TDescription extends Description> = {
29
+ export type CollectionActionBase<TDescription extends Description = Description> = {
27
30
  label?: string;
28
31
  icon?: Icon;
29
32
  ask?: boolean;
30
33
  translate?: boolean;
34
+ button?: boolean;
31
35
  roles?: readonly string[];
32
36
  requires?: readonly PropertiesWithId<TDescription>[];
33
37
  };
34
- export type CollectionAction<TDescription extends Description> = CollectionActionBase<TDescription> & (CollectionActionRoute | CollectionActionFunction | CollectionActionEvent);
35
- export type CollectionActions<TDescription extends Description> = Record<string, CollectionAction<TDescription> & {
38
+ export type CollectionAction<TDescription extends Description = Description> = CollectionActionBase<TDescription> & (CollectionActionRoute | CollectionActionFunction | CollectionActionEvent);
39
+ export type CollectionActions<TDescription extends Description = Description> = Record<string, CollectionAction<TDescription> & {
36
40
  button?: boolean;
37
41
  } | null>;
38
- export type CollectionIndividualActions<TDescription extends Description> = Record<string, CollectionAction<TDescription> | null>;
39
42
  export type FormLayout<TDescription extends Description> = {
40
43
  fields?: Partial<Record<PropertiesWithId<TDescription>, FormLayoutField<TDescription>>>;
41
44
  };
@@ -64,7 +67,6 @@ export type FiltersPreset<TDescription extends Description> = {
64
67
  badgeFunction?: string;
65
68
  default?: boolean;
66
69
  };
67
- export type LayoutName = 'tabular' | 'grid' | 'list';
68
70
  export type LayoutOptions<TDescription extends Description = Description> = {
69
71
  title?: PropertiesWithId<TDescription>;
70
72
  picture?: PropertiesWithId<TDescription>;
@@ -77,12 +79,12 @@ export type Layout<TDescription extends Description = Description> = {
77
79
  name: LayoutName;
78
80
  options?: LayoutOptions<TDescription>;
79
81
  };
80
- export type SearchOptions<TDescription extends Description> = {
82
+ export type SearchOptions<TDescription extends Description = Description> = {
81
83
  indexes: readonly (keyof TDescription['properties'])[];
82
84
  placeholder?: string;
83
85
  exactMatches?: boolean;
84
86
  };
85
- export type RuntimeDescription<TDescription extends Description = Description> = Pick<TDescription, 'actions' | 'individualActions' | 'filters' | 'filtersPresets' | 'layout' | 'table' | 'tableMeta' | 'form' | 'tableLayout' | 'formLayout'>;
87
+ export type RuntimeDescription<TDescription extends Description = Description> = Partial<Pick<TDescription, 'actions' | 'individualActions' | 'filters' | 'filtersPresets' | 'layout' | 'table' | 'tableMeta' | 'form' | 'tableLayout' | 'formLayout'>>;
86
88
  export type Description<TDescription extends Description = any> = JsonSchema<TDescription> & {
87
89
  title?: string;
88
90
  categories?: readonly string[];
@@ -115,6 +117,6 @@ export type Description<TDescription extends Description = any> = JsonSchema<TDe
115
117
  formLayout?: Partial<FormLayout<TDescription>>;
116
118
  tableLayout?: Partial<TableLayout<TDescription>>;
117
119
  actions?: CollectionActions<TDescription>;
118
- individualActions?: CollectionIndividualActions<TDescription>;
120
+ individualActions?: CollectionActions<TDescription>;
119
121
  search?: SearchOptions<TDescription>;
120
122
  };
@@ -1,2 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LAYOUT_NAMES = exports.DESCRIPTION_PRESETS = void 0;
4
+ exports.DESCRIPTION_PRESETS = [
5
+ 'add',
6
+ 'crud',
7
+ 'duplicate',
8
+ 'remove',
9
+ 'removeAll',
10
+ 'owned',
11
+ 'timestamped',
12
+ 'view',
13
+ ];
14
+ exports.LAYOUT_NAMES = [
15
+ 'tabular',
16
+ 'grid',
17
+ 'list',
18
+ ];
@@ -1 +1,16 @@
1
1
  "use strict";
2
+ export const DESCRIPTION_PRESETS = [
3
+ "add",
4
+ "crud",
5
+ "duplicate",
6
+ "remove",
7
+ "removeAll",
8
+ "owned",
9
+ "timestamped",
10
+ "view"
11
+ ];
12
+ export const LAYOUT_NAMES = [
13
+ "tabular",
14
+ "grid",
15
+ "list"
16
+ ];
@@ -1,7 +1,7 @@
1
1
  import type { HTTPStatus } from './http.js';
2
2
  export declare const ERROR_SYMBOL_DESCRIPTION = "#__ERROR_SYMBOL__";
3
3
  export declare const ERROR_SYMBOL: unique symbol;
4
- export type EndpointError<TCode extends string = string, TDetails = unknown, THTTPStatus extends HTTPStatus | undefined = HTTPStatus, TMessage extends string | undefined = string> = {
4
+ export type EndpointError<TCode extends string = string, TDetails = unknown, THTTPStatus extends typeof HTTPStatus[keyof typeof HTTPStatus] | undefined = typeof HTTPStatus[keyof typeof HTTPStatus], TMessage extends string | undefined = string> = {
5
5
  code: TCode;
6
6
  details?: TDetails;
7
7
  httpStatus: THTTPStatus;
@@ -1,6 +1,3 @@
1
- import { ACError } from './accessControl.js';
2
- import { HTTPStatus } from './http.js';
3
- import { ValidationErrorCode, TraverseError } from './validation.js';
4
1
  export declare const insertError: () => {
5
2
  readonly type: "object";
6
3
  readonly properties: {
@@ -15,10 +12,10 @@ export declare const insertError: () => {
15
12
  readonly required: readonly ["httpStatus", "code"];
16
13
  readonly properties: {
17
14
  readonly httpStatus: {
18
- readonly enum: [HTTPStatus.Forbidden, HTTPStatus.NotFound, HTTPStatus.UnprocessableContent, HTTPStatus.BadRequest, HTTPStatus.InternalServerError];
15
+ readonly enum: [403, 404, 422, 400, 500];
19
16
  };
20
17
  readonly code: {
21
- readonly enum: [ACError.InsecureOperator, ACError.OwnershipError, ACError.ResourceNotFound, ACError.TargetImmutable, ACError.MalformedInput, ACError.UniquenessViolated, ValidationErrorCode.EmptyTarget, ValidationErrorCode.InvalidProperties, ValidationErrorCode.MissingProperties, TraverseError.InvalidDocumentId, TraverseError.InvalidTempfile];
18
+ readonly enum: ["INSECURE_OPERATOR", "OWNERSHIP_ERROR", "RESOURCE_NOT_FOUND", "TARGET_IMMUTABLE", "MALFORMED_INPUT", "UNIQUENESS_VIOLATED", "EMPTY_TARGET", "INVALID_PROPERTIES", "MISSING_PROPERTIES", "INVALID_DOCUMENT_ID", "INVALID_TEMPFILE"];
22
19
  };
23
20
  readonly message: {
24
21
  readonly type: "string";
@@ -45,10 +42,10 @@ export declare const getError: () => {
45
42
  readonly required: readonly ["httpStatus", "code"];
46
43
  readonly properties: {
47
44
  readonly httpStatus: {
48
- readonly enum: [HTTPStatus.Forbidden, HTTPStatus.NotFound, HTTPStatus.BadRequest];
45
+ readonly enum: [403, 404, 400];
49
46
  };
50
47
  readonly code: {
51
- readonly enum: [ACError.ResourceNotFound, ACError.OwnershipError, ACError.InsecureOperator, ACError.MalformedInput];
48
+ readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
52
49
  };
53
50
  readonly message: {
54
51
  readonly type: "string";
@@ -75,10 +72,10 @@ export declare const getAllError: () => {
75
72
  readonly required: readonly ["httpStatus", "code"];
76
73
  readonly properties: {
77
74
  readonly httpStatus: {
78
- readonly enum: [HTTPStatus.Forbidden];
75
+ readonly enum: [403];
79
76
  };
80
77
  readonly code: {
81
- readonly enum: [ACError.OwnershipError, ACError.InsecureOperator, ACError.InvalidLimit];
78
+ readonly enum: ["OWNERSHIP_ERROR", "INSECURE_OPERATOR", "INVALID_LIMIT"];
82
79
  };
83
80
  readonly message: {
84
81
  readonly type: "string";
@@ -105,10 +102,10 @@ export declare const countError: () => {
105
102
  readonly required: readonly ["httpStatus", "code"];
106
103
  readonly properties: {
107
104
  readonly httpStatus: {
108
- readonly enum: [HTTPStatus.Forbidden];
105
+ readonly enum: [403];
109
106
  };
110
107
  readonly code: {
111
- readonly enum: [ACError.OwnershipError, ACError.InvalidLimit];
108
+ readonly enum: ["OWNERSHIP_ERROR", "INVALID_LIMIT"];
112
109
  };
113
110
  readonly message: {
114
111
  readonly type: "string";
package/dist/http.d.ts CHANGED
@@ -4,18 +4,18 @@ import type { EndpointError } from './endpointError.js';
4
4
  import type { ACError } from './accessControl.js';
5
5
  import type { RateLimitingError } from './security.js';
6
6
  export declare const REQUEST_METHODS: readonly ["GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "TRACE", "SEARCH"];
7
- export declare enum HTTPStatus {
8
- Ok = 200,
9
- NoContent = 204,
10
- BadRequest = 400,
11
- Unauthorized = 401,
12
- Forbidden = 403,
13
- NotFound = 404,
14
- RangeNotSatisfiable = 416,
15
- UnprocessableContent = 422,
16
- TooManyRequests = 429,
17
- InternalServerError = 500
18
- }
7
+ export declare const HTTPStatus: {
8
+ readonly Ok: 200;
9
+ readonly NoContent: 204;
10
+ readonly BadRequest: 400;
11
+ readonly Unauthorized: 401;
12
+ readonly Forbidden: 403;
13
+ readonly NotFound: 404;
14
+ readonly RangeNotSatisfiable: 416;
15
+ readonly UnprocessableContent: 422;
16
+ readonly TooManyRequests: 429;
17
+ readonly InternalServerError: 500;
18
+ };
19
19
  export type RouteUri = `/${string}`;
20
20
  export type RequestMethod = string;
21
21
  export type GenericRequest = Omit<IncomingMessage, 'url' | 'method'> & {
@@ -32,8 +32,8 @@ export type GenericResponse = ServerResponse & {
32
32
  };
33
33
  type ExtractCode<TRouteResponse> = TRouteResponse extends EndpointError<infer PCode> ? PCode : never;
34
34
  type ExtractHTTPStatus<TRouteResponse> = TRouteResponse extends EndpointError<string, unknown, infer PHTTPStatus> ? PHTTPStatus : never;
35
- export type NativeError = ACError.AuthenticationError | ACError.AuthorizationError | RateLimitingError.LimitReached | RateLimitingError.Unauthenticated;
36
- export type NativeHTTPErrorStatus = HTTPStatus.Unauthorized | HTTPStatus.TooManyRequests;
35
+ export type NativeError = typeof ACError.AuthenticationError | typeof ACError.AuthorizationError | typeof RateLimitingError.LimitReached | typeof RateLimitingError.Unauthenticated;
36
+ export type NativeHTTPErrorStatus = typeof HTTPStatus.Unauthorized | typeof HTTPStatus.TooManyRequests;
37
37
  export type WithACErrors<TRouteResponse> = TRouteResponse extends Result.Either<infer InferredError, unknown> ? Result.Either<ExtractError<TRouteResponse> | EndpointError<ExtractCode<InferredError> | NativeError, unknown, ExtractHTTPStatus<InferredError> | NativeHTTPErrorStatus>, ExtractResult<TRouteResponse>> : TRouteResponse | Result.Error<EndpointError<NativeError, unknown, NativeHTTPErrorStatus>>;
38
38
  export type EndpointFunction<TRouteMethod extends RequestMethod, TRouteResponse, TRoutePayload> = (TRoutePayload extends null ? <T = TRouteResponse>(payload?: unknown) => Promise<WithACErrors<T>> : TRoutePayload extends undefined ? <T = TRouteResponse>() => Promise<WithACErrors<T>> : <T = TRouteResponse>(payload: TRoutePayload) => Promise<WithACErrors<T>>) extends infer Function ? Record<TRouteMethod, Function> : never;
39
39
  export type MakeEndpoint<TRoute extends string, TRouteMethod extends RequestMethod, TRouteResponse = unknown, TRoutePayload = null> = TRoute extends `/${infer RouteTail}` ? MakeEndpoint<RouteTail, TRouteMethod, TRouteResponse, TRoutePayload> : TRoute extends `${infer Route}/${infer RouteTail}` ? Record<Route, MakeEndpoint<RouteTail, TRouteMethod, TRouteResponse, TRoutePayload>> : TRoute extends `(${string}` ? Record<string, EndpointFunction<TRouteMethod, TRouteResponse, TRoutePayload>> : Record<TRoute, EndpointFunction<TRouteMethod, TRouteResponse, TRoutePayload>>;
package/dist/http.js CHANGED
@@ -12,17 +12,16 @@ exports.REQUEST_METHODS = [
12
12
  'TRACE',
13
13
  'SEARCH',
14
14
  ];
15
- var HTTPStatus;
16
- (function (HTTPStatus) {
17
- HTTPStatus[HTTPStatus["Ok"] = 200] = "Ok";
18
- HTTPStatus[HTTPStatus["NoContent"] = 204] = "NoContent";
19
- HTTPStatus[HTTPStatus["BadRequest"] = 400] = "BadRequest";
20
- HTTPStatus[HTTPStatus["Unauthorized"] = 401] = "Unauthorized";
21
- HTTPStatus[HTTPStatus["Forbidden"] = 403] = "Forbidden";
22
- HTTPStatus[HTTPStatus["NotFound"] = 404] = "NotFound";
23
- HTTPStatus[HTTPStatus["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
24
- HTTPStatus[HTTPStatus["UnprocessableContent"] = 422] = "UnprocessableContent";
25
- HTTPStatus[HTTPStatus["TooManyRequests"] = 429] = "TooManyRequests";
26
- HTTPStatus[HTTPStatus["InternalServerError"] = 500] = "InternalServerError";
27
- })(HTTPStatus || (exports.HTTPStatus = HTTPStatus = {}));
15
+ exports.HTTPStatus = {
16
+ Ok: 200,
17
+ NoContent: 204,
18
+ BadRequest: 400,
19
+ Unauthorized: 401,
20
+ Forbidden: 403,
21
+ NotFound: 404,
22
+ RangeNotSatisfiable: 416,
23
+ UnprocessableContent: 422,
24
+ TooManyRequests: 429,
25
+ InternalServerError: 500,
26
+ };
28
27
  exports.STREAMED_RESPONSE = Symbol('StreamedResponse');
package/dist/http.mjs CHANGED
@@ -10,17 +10,16 @@ export const REQUEST_METHODS = [
10
10
  "TRACE",
11
11
  "SEARCH"
12
12
  ];
13
- export var HTTPStatus = /* @__PURE__ */ ((HTTPStatus2) => {
14
- HTTPStatus2[HTTPStatus2["Ok"] = 200] = "Ok";
15
- HTTPStatus2[HTTPStatus2["NoContent"] = 204] = "NoContent";
16
- HTTPStatus2[HTTPStatus2["BadRequest"] = 400] = "BadRequest";
17
- HTTPStatus2[HTTPStatus2["Unauthorized"] = 401] = "Unauthorized";
18
- HTTPStatus2[HTTPStatus2["Forbidden"] = 403] = "Forbidden";
19
- HTTPStatus2[HTTPStatus2["NotFound"] = 404] = "NotFound";
20
- HTTPStatus2[HTTPStatus2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
21
- HTTPStatus2[HTTPStatus2["UnprocessableContent"] = 422] = "UnprocessableContent";
22
- HTTPStatus2[HTTPStatus2["TooManyRequests"] = 429] = "TooManyRequests";
23
- HTTPStatus2[HTTPStatus2["InternalServerError"] = 500] = "InternalServerError";
24
- return HTTPStatus2;
25
- })(HTTPStatus || {});
13
+ export const HTTPStatus = {
14
+ Ok: 200,
15
+ NoContent: 204,
16
+ BadRequest: 400,
17
+ Unauthorized: 401,
18
+ Forbidden: 403,
19
+ NotFound: 404,
20
+ RangeNotSatisfiable: 416,
21
+ UnprocessableContent: 422,
22
+ TooManyRequests: 429,
23
+ InternalServerError: 500
24
+ };
26
25
  export const STREAMED_RESPONSE = Symbol("StreamedResponse");
@@ -2,10 +2,14 @@ import type { PhosphorIcon } from '@phosphor-icons/core';
2
2
  import type { ObjectId } from 'mongodb';
3
3
  import type { Condition } from './condition.js';
4
4
  import type { RouteContext } from './context.js';
5
- export type PropertyArrayElement = 'checkbox' | 'radio' | 'select';
6
- export type PropertyInputType = 'text' | 'email' | 'password' | 'search' | 'time' | 'month';
7
- export type PropertyInputElement = 'input' | 'textarea';
8
- export type PropertyFormat = 'date' | 'date-time' | 'objectid';
5
+ export declare const PROPERTY_ARRAY_ELEMENTS: readonly ["checkbox", "radio", "select"];
6
+ export declare const PROPERTY_INPUT_TYPES: readonly ["text", "email", "password", "search", "time", "month"];
7
+ export declare const PROPERTY_INPUT_ELEMENTS: readonly ["input", "textarea"];
8
+ export declare const PROPERTY_FORMATS: readonly ["date", "date-time", "objectid"];
9
+ export type PropertyArrayElement = typeof PROPERTY_ARRAY_ELEMENTS[number];
10
+ export type PropertyInputType = typeof PROPERTY_INPUT_TYPES[number];
11
+ export type PropertyInputElement = typeof PROPERTY_INPUT_ELEMENTS[number];
12
+ export type PropertyFormat = typeof PROPERTY_FORMATS[number];
9
13
  export type PropertiesWithId<TJsonSchema extends JsonSchema> = Extract<keyof TJsonSchema['properties'], string> | '_id';
10
14
  export type RequiredProperties<TJsonSchema extends JsonSchema> = readonly PropertiesWithId<TJsonSchema>[] | Partial<Record<PropertiesWithId<TJsonSchema>, Condition<TJsonSchema> | boolean>>;
11
15
  export type JsonSchema<TJsonSchema extends JsonSchema = any> = {
@@ -21,10 +25,10 @@ export type RefProperty = {
21
25
  $ref: Exclude<keyof Collections, 'file'> & string;
22
26
  indexes?: readonly string[];
23
27
  select?: readonly string[];
24
- inline?: boolean;
28
+ populate?: readonly string[];
25
29
  form?: readonly string[];
30
+ inline?: boolean;
26
31
  purge?: boolean;
27
- populate?: readonly string[];
28
32
  populateDepth?: number;
29
33
  constraints?: Condition;
30
34
  };
@@ -72,8 +76,8 @@ export type StringProperty = {
72
76
  mask?: string | readonly string[];
73
77
  maskedValue?: boolean;
74
78
  placeholder?: string;
75
- element?: PropertyInputElement;
76
79
  inputType?: PropertyInputType;
80
+ element?: PropertyInputElement;
77
81
  };
78
82
  export type NumberProperty = {
79
83
  type: 'number' | 'integer';
package/dist/property.js CHANGED
@@ -1,2 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROPERTY_FORMATS = exports.PROPERTY_INPUT_ELEMENTS = exports.PROPERTY_INPUT_TYPES = exports.PROPERTY_ARRAY_ELEMENTS = void 0;
4
+ exports.PROPERTY_ARRAY_ELEMENTS = [
5
+ 'checkbox',
6
+ 'radio',
7
+ 'select',
8
+ ];
9
+ exports.PROPERTY_INPUT_TYPES = [
10
+ 'text',
11
+ 'email',
12
+ 'password',
13
+ 'search',
14
+ 'time',
15
+ 'month',
16
+ ];
17
+ exports.PROPERTY_INPUT_ELEMENTS = [
18
+ 'input',
19
+ 'textarea',
20
+ ];
21
+ exports.PROPERTY_FORMATS = [
22
+ 'date',
23
+ 'date-time',
24
+ 'objectid',
25
+ ];
package/dist/property.mjs CHANGED
@@ -1 +1,23 @@
1
1
  "use strict";
2
+ export const PROPERTY_ARRAY_ELEMENTS = [
3
+ "checkbox",
4
+ "radio",
5
+ "select"
6
+ ];
7
+ export const PROPERTY_INPUT_TYPES = [
8
+ "text",
9
+ "email",
10
+ "password",
11
+ "search",
12
+ "time",
13
+ "month"
14
+ ];
15
+ export const PROPERTY_INPUT_ELEMENTS = [
16
+ "input",
17
+ "textarea"
18
+ ];
19
+ export const PROPERTY_FORMATS = [
20
+ "date",
21
+ "date-time",
22
+ "objectid"
23
+ ];
@@ -24,7 +24,7 @@ export declare const resultSchema: <const TResult extends Property>(result: TRes
24
24
  readonly result: Property;
25
25
  };
26
26
  };
27
- export declare const endpointErrorSchema: <const THTTPStatus extends HTTPStatus[], const TCode extends string[]>(error: {
27
+ export declare const endpointErrorSchema: <const THTTPStatus extends (typeof HTTPStatus)[keyof typeof HTTPStatus][], const TCode extends string[]>(error: {
28
28
  httpStatus: THTTPStatus;
29
29
  code: TCode;
30
30
  }) => {
@@ -3,10 +3,10 @@ import type { What } from './functions.js';
3
3
  import type { Result } from './result.js';
4
4
  import type { QuerySort } from './functions.js';
5
5
  export type OwnershipMode = boolean | 'always' | 'on-write';
6
- export declare enum RateLimitingError {
7
- Unauthenticated = "UNAUTHENTICATED",
8
- LimitReached = "LIMIT_REACHED"
9
- }
6
+ export declare const RateLimitingError: {
7
+ readonly Unauthenticated: "UNAUTHENTICATED";
8
+ readonly LimitReached: "LIMIT_REACHED";
9
+ };
10
10
  export type DiscriminationStrategy = 'tenant' | 'ip';
11
11
  export type RateLimitingWithScale = {
12
12
  scale: number;
package/dist/security.js CHANGED
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RateLimitingError = void 0;
4
- var RateLimitingError;
5
- (function (RateLimitingError) {
6
- RateLimitingError["Unauthenticated"] = "UNAUTHENTICATED";
7
- RateLimitingError["LimitReached"] = "LIMIT_REACHED";
8
- })(RateLimitingError || (exports.RateLimitingError = RateLimitingError = {}));
4
+ exports.RateLimitingError = {
5
+ Unauthenticated: 'UNAUTHENTICATED',
6
+ LimitReached: 'LIMIT_REACHED',
7
+ };
package/dist/security.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
- export var RateLimitingError = /* @__PURE__ */ ((RateLimitingError2) => {
3
- RateLimitingError2["Unauthenticated"] = "UNAUTHENTICATED";
4
- RateLimitingError2["LimitReached"] = "LIMIT_REACHED";
5
- return RateLimitingError2;
6
- })(RateLimitingError || {});
2
+ export const RateLimitingError = {
3
+ Unauthenticated: "UNAUTHENTICATED",
4
+ LimitReached: "LIMIT_REACHED"
5
+ };
package/dist/token.d.ts CHANGED
@@ -1,15 +1,16 @@
1
1
  import type { ObjectId } from 'mongodb';
2
2
  import type { PackReferences } from './schema.js';
3
+ import type { AccessCondition } from './accessControl.js';
4
+ export type UserInfo = Omit<Collections['user']['item'], '_id' | 'roles'>;
3
5
  export type UserRole = (Collections['user']['item'] extends {
4
6
  roles: infer Roles;
5
7
  } ? Roles extends unknown[] ? Roles[number] extends infer UserDefinedRole ? UserDefinedRole extends string ? `${UserDefinedRole}${UserDefinedRole}` extends UserDefinedRole ? 'root' : UserDefinedRole : never : never : never : never) | 'root' | 'unauthenticated';
6
- export type AcceptedRole = UserRole | UserRole[] | null | unknown;
7
- export type AuthenticatedToken<TAcceptedRole extends AcceptedRole = null, TUserRole = UserRole, TUserInfo = Omit<Collections['user']['item'], '_id' | 'roles'>> = {
8
+ export type AuthenticatedToken<TAccessCondition extends AccessCondition = true, TUserRole = UserRole> = {
8
9
  authenticated: true;
9
10
  sub: ObjectId | null;
10
- roles: readonly (TAcceptedRole extends null ? TUserRole : TAcceptedRole)[];
11
+ roles: TAccessCondition extends readonly unknown[] ? TAccessCondition : TAccessCondition extends true ? readonly TUserRole[] : TAccessCondition extends 'unauthenticated' ? readonly UserRole[] : readonly [];
11
12
  picture?: string;
12
- userinfo: Partial<TUserInfo | PackReferences<TUserInfo>>;
13
+ userinfo: Partial<UserInfo | PackReferences<UserInfo>>;
13
14
  };
14
15
  export type UnauthenticatedToken = {
15
16
  authenticated: false;
@@ -19,4 +20,4 @@ export type TokenRecipient = {
19
20
  type: 'bearer';
20
21
  content: string;
21
22
  };
22
- export type Token<TAcceptedRole extends AcceptedRole = null, TUserRole = UserRole, TUserInfo = Omit<Collections['user']['item'], '_id' | 'roles'>> = (null extends TAcceptedRole ? true : 'unauthenticated' extends TAcceptedRole ? true : false) extends true ? AuthenticatedToken<null, TUserRole, TUserInfo> | UnauthenticatedToken : AuthenticatedToken<TAcceptedRole>;
23
+ export type Token<TAccessCondition extends AccessCondition = false, TUserRole = UserRole> = (false extends TAccessCondition ? false : TAccessCondition extends 'unauthenticated' | 'unauthenticated-only' ? false : true) extends true ? AuthenticatedToken<TAccessCondition> : 'unauthenticated-only' extends TAccessCondition ? UnauthenticatedToken : AuthenticatedToken<true, TUserRole> | UnauthenticatedToken;
@@ -1,24 +1,24 @@
1
- export declare enum ValidationErrorCode {
2
- InvalidProperties = "INVALID_PROPERTIES",
3
- MissingProperties = "MISSING_PROPERTIES",
4
- EmptyTarget = "EMPTY_TARGET"
5
- }
6
- export declare enum PropertyValidationErrorCode {
7
- Missing = "MISSING_PROPERTY",
8
- Extraneous = "EXTRANEOUS_PROPERTY",
9
- Unmatching = "UNMATCHING_PROPERTIES",
10
- ExtraneousElement = "EXTRANEOUS_ELEMENT",
11
- MoreItemsExpected = "MORE_ITEMS_EXPECTED",
12
- LessItemsExpected = "LESS_ITEMS_EXPECTED",
13
- NumericConstraint = "NUMERIC_CONSTRAINT",
14
- StringConstraint = "STRING_CONSTRAINT"
15
- }
16
- export declare enum TraverseError {
17
- InvalidDocumentId = "INVALID_DOCUMENT_ID",
18
- InvalidTempfile = "INVALID_TEMPFILE"
19
- }
1
+ export declare const ValidationErrorCode: {
2
+ readonly InvalidProperties: "INVALID_PROPERTIES";
3
+ readonly MissingProperties: "MISSING_PROPERTIES";
4
+ readonly EmptyTarget: "EMPTY_TARGET";
5
+ };
6
+ export declare const PropertyValidationErrorCode: {
7
+ readonly Missing: "MISSING_PROPERTY";
8
+ readonly Extraneous: "EXTRANEOUS_PROPERTY";
9
+ readonly Unmatching: "UNMATCHING_PROPERTIES";
10
+ readonly ExtraneousElement: "EXTRANEOUS_ELEMENT";
11
+ readonly MoreItemsExpected: "MORE_ITEMS_EXPECTED";
12
+ readonly LessItemsExpected: "LESS_ITEMS_EXPECTED";
13
+ readonly NumericConstraint: "NUMERIC_CONSTRAINT";
14
+ readonly StringConstraint: "STRING_CONSTRAINT";
15
+ };
16
+ export declare const TraverseError: {
17
+ readonly InvalidDocumentId: "INVALID_DOCUMENT_ID";
18
+ readonly InvalidTempfile: "INVALID_TEMPFILE";
19
+ };
20
20
  export type PropertyValidationError = {
21
- type: PropertyValidationErrorCode;
21
+ type: typeof PropertyValidationErrorCode[keyof typeof PropertyValidationErrorCode];
22
22
  index?: number;
23
23
  details?: {
24
24
  expected: unknown;
@@ -26,17 +26,17 @@ export type PropertyValidationError = {
26
26
  };
27
27
  };
28
28
  export type ValidationErrorInvalidProperties = {
29
- code: ValidationErrorCode.InvalidProperties;
30
- errors: Record<string, PropertyValidationError | ValidationError>;
29
+ code: typeof ValidationErrorCode.InvalidProperties;
30
+ details: Record<string, PropertyValidationError | ValidationError>;
31
31
  };
32
32
  export type ValidationErrorMissingProperties = {
33
- code: ValidationErrorCode.MissingProperties;
34
- errors: Record<string, {
33
+ code: typeof ValidationErrorCode.MissingProperties;
34
+ details: Record<string, {
35
35
  type: 'missing';
36
36
  }>;
37
37
  };
38
38
  export type ValidationErrorEmptyTarget = {
39
- code: ValidationErrorCode.EmptyTarget;
40
- errors: {};
39
+ code: typeof ValidationErrorCode.EmptyTarget;
40
+ details: {};
41
41
  };
42
42
  export type ValidationError = ValidationErrorInvalidProperties | ValidationErrorMissingProperties | ValidationErrorEmptyTarget;
@@ -1,25 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TraverseError = exports.PropertyValidationErrorCode = exports.ValidationErrorCode = void 0;
4
- var ValidationErrorCode;
5
- (function (ValidationErrorCode) {
6
- ValidationErrorCode["InvalidProperties"] = "INVALID_PROPERTIES";
7
- ValidationErrorCode["MissingProperties"] = "MISSING_PROPERTIES";
8
- ValidationErrorCode["EmptyTarget"] = "EMPTY_TARGET";
9
- })(ValidationErrorCode || (exports.ValidationErrorCode = ValidationErrorCode = {}));
10
- var PropertyValidationErrorCode;
11
- (function (PropertyValidationErrorCode) {
12
- PropertyValidationErrorCode["Missing"] = "MISSING_PROPERTY";
13
- PropertyValidationErrorCode["Extraneous"] = "EXTRANEOUS_PROPERTY";
14
- PropertyValidationErrorCode["Unmatching"] = "UNMATCHING_PROPERTIES";
15
- PropertyValidationErrorCode["ExtraneousElement"] = "EXTRANEOUS_ELEMENT";
16
- PropertyValidationErrorCode["MoreItemsExpected"] = "MORE_ITEMS_EXPECTED";
17
- PropertyValidationErrorCode["LessItemsExpected"] = "LESS_ITEMS_EXPECTED";
18
- PropertyValidationErrorCode["NumericConstraint"] = "NUMERIC_CONSTRAINT";
19
- PropertyValidationErrorCode["StringConstraint"] = "STRING_CONSTRAINT";
20
- })(PropertyValidationErrorCode || (exports.PropertyValidationErrorCode = PropertyValidationErrorCode = {}));
21
- var TraverseError;
22
- (function (TraverseError) {
23
- TraverseError["InvalidDocumentId"] = "INVALID_DOCUMENT_ID";
24
- TraverseError["InvalidTempfile"] = "INVALID_TEMPFILE";
25
- })(TraverseError || (exports.TraverseError = TraverseError = {}));
4
+ exports.ValidationErrorCode = {
5
+ InvalidProperties: 'INVALID_PROPERTIES',
6
+ MissingProperties: 'MISSING_PROPERTIES',
7
+ EmptyTarget: 'EMPTY_TARGET',
8
+ };
9
+ exports.PropertyValidationErrorCode = {
10
+ Missing: 'MISSING_PROPERTY',
11
+ Extraneous: 'EXTRANEOUS_PROPERTY',
12
+ Unmatching: 'UNMATCHING_PROPERTIES',
13
+ ExtraneousElement: 'EXTRANEOUS_ELEMENT',
14
+ MoreItemsExpected: 'MORE_ITEMS_EXPECTED',
15
+ LessItemsExpected: 'LESS_ITEMS_EXPECTED',
16
+ NumericConstraint: 'NUMERIC_CONSTRAINT',
17
+ StringConstraint: 'STRING_CONSTRAINT',
18
+ };
19
+ exports.TraverseError = {
20
+ InvalidDocumentId: 'INVALID_DOCUMENT_ID',
21
+ InvalidTempfile: 'INVALID_TEMPFILE',
22
+ };
@@ -1,23 +1,20 @@
1
1
  "use strict";
2
- export var ValidationErrorCode = /* @__PURE__ */ ((ValidationErrorCode2) => {
3
- ValidationErrorCode2["InvalidProperties"] = "INVALID_PROPERTIES";
4
- ValidationErrorCode2["MissingProperties"] = "MISSING_PROPERTIES";
5
- ValidationErrorCode2["EmptyTarget"] = "EMPTY_TARGET";
6
- return ValidationErrorCode2;
7
- })(ValidationErrorCode || {});
8
- export var PropertyValidationErrorCode = /* @__PURE__ */ ((PropertyValidationErrorCode2) => {
9
- PropertyValidationErrorCode2["Missing"] = "MISSING_PROPERTY";
10
- PropertyValidationErrorCode2["Extraneous"] = "EXTRANEOUS_PROPERTY";
11
- PropertyValidationErrorCode2["Unmatching"] = "UNMATCHING_PROPERTIES";
12
- PropertyValidationErrorCode2["ExtraneousElement"] = "EXTRANEOUS_ELEMENT";
13
- PropertyValidationErrorCode2["MoreItemsExpected"] = "MORE_ITEMS_EXPECTED";
14
- PropertyValidationErrorCode2["LessItemsExpected"] = "LESS_ITEMS_EXPECTED";
15
- PropertyValidationErrorCode2["NumericConstraint"] = "NUMERIC_CONSTRAINT";
16
- PropertyValidationErrorCode2["StringConstraint"] = "STRING_CONSTRAINT";
17
- return PropertyValidationErrorCode2;
18
- })(PropertyValidationErrorCode || {});
19
- export var TraverseError = /* @__PURE__ */ ((TraverseError2) => {
20
- TraverseError2["InvalidDocumentId"] = "INVALID_DOCUMENT_ID";
21
- TraverseError2["InvalidTempfile"] = "INVALID_TEMPFILE";
22
- return TraverseError2;
23
- })(TraverseError || {});
2
+ export const ValidationErrorCode = {
3
+ InvalidProperties: "INVALID_PROPERTIES",
4
+ MissingProperties: "MISSING_PROPERTIES",
5
+ EmptyTarget: "EMPTY_TARGET"
6
+ };
7
+ export const PropertyValidationErrorCode = {
8
+ Missing: "MISSING_PROPERTY",
9
+ Extraneous: "EXTRANEOUS_PROPERTY",
10
+ Unmatching: "UNMATCHING_PROPERTIES",
11
+ ExtraneousElement: "EXTRANEOUS_ELEMENT",
12
+ MoreItemsExpected: "MORE_ITEMS_EXPECTED",
13
+ LessItemsExpected: "LESS_ITEMS_EXPECTED",
14
+ NumericConstraint: "NUMERIC_CONSTRAINT",
15
+ StringConstraint: "STRING_CONSTRAINT"
16
+ };
17
+ export const TraverseError = {
18
+ InvalidDocumentId: "INVALID_DOCUMENT_ID",
19
+ InvalidTempfile: "INVALID_TEMPFILE"
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.113",
3
+ "version": "0.0.115",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -21,7 +21,7 @@
21
21
  "files": [
22
22
  "dist"
23
23
  ],
24
- "devDependencies": {
24
+ "peerDependencies": {
25
25
  "@phosphor-icons/core": "^2.1.1"
26
26
  },
27
27
  "scripts": {