@aeriajs/types 0.0.31 → 0.0.32

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/api.d.ts CHANGED
@@ -10,7 +10,7 @@ export type Collection<TCollection extends Collection = any> = {
10
10
  functionContracts?: Record<string, Contract>;
11
11
  };
12
12
  export type AssetType = keyof Collection;
13
- export type FunctionPath = `${string}@${string}`;
13
+ export type FunctionPath = `/${string}/${string}`;
14
14
  export type UserRole = Collections['user']['item']['roles'][number] | 'root' | 'guest';
15
15
  export type AuthenticatedToken<TAcceptedRole extends AcceptedRole = null> = {
16
16
  authenticated: true;
package/dist/context.d.ts CHANGED
@@ -43,7 +43,7 @@ export type RouteContext<TAcceptedRole extends AcceptedRole = null> = {
43
43
  inherited: boolean;
44
44
  calledFunction: string;
45
45
  };
46
- export type Context<TDescription extends Description = any, TFunctions = any> = RouteContext & {
46
+ export type CollectionContext<TDescription extends Description = any, TFunctions = any> = {
47
47
  description: TDescription;
48
48
  collectionName?: (keyof Collections & string) | string;
49
49
  collection: TDescription['$id'] extends keyof Collections ? IndepthCollection<{
@@ -51,4 +51,6 @@ export type Context<TDescription extends Description = any, TFunctions = any> =
51
51
  functions: TFunctions;
52
52
  }> : IndepthCollection<any>;
53
53
  };
54
+ export type Context<TDescription extends Description = any, TFunctions = any> = RouteContext & CollectionContext<TDescription, TFunctions>;
55
+ export type StrictContext<TAcceptedRole extends AcceptedRole = null, TDescription extends Description = any, TFunctions = any> = RouteContext<TAcceptedRole> & CollectionContext<TDescription, TFunctions>;
54
56
  export {};
@@ -25,4 +25,6 @@ export type SecurityPolicy = {
25
25
  rateLimiting?: RateLimitingParams;
26
26
  logging?: LoggingParams;
27
27
  };
28
- export type CollectionSecurityPolicy<TCollection extends Collection = any> = Partial<Record<keyof TCollection['functions'], SecurityPolicy>>;
28
+ export type CollectionSecurityPolicy<TCollection extends Collection = any> = {
29
+ functions?: Partial<Record<keyof TCollection['functions'], SecurityPolicy>>;
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/types",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",