aeria-sdk 0.0.201 → 0.0.203
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/instance.d.ts +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/instance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { CollectionFunctionsSDK, ContractWithRoles, Description, JsonSchema } from '@aeriajs/types';
|
|
1
2
|
import type { InstanceConfig, InstanceContext, ApiPrototype, ApiSchema, InferEndpointFromContract } from './types.js';
|
|
2
|
-
import { type CollectionFunctionsSDK, type Description, type JsonSchema } from '@aeriajs/types';
|
|
3
3
|
export declare const interceptors: InstanceContext['interceptors'];
|
|
4
4
|
export declare const call: <TApiSchema extends ApiSchema, TDescriptions extends Record<string, Description> = Record<string, Description>>() => <TRoute extends keyof TApiSchema, TRouteMethod extends keyof TApiSchema[TRoute]>(method: TRouteMethod & string, route: TRoute & string, params: {
|
|
5
5
|
config: InstanceConfig;
|
|
@@ -7,7 +7,7 @@ export declare const call: <TApiSchema extends ApiSchema, TDescriptions extends
|
|
|
7
7
|
bearerToken?: string;
|
|
8
8
|
}) => TApiSchema[TRoute][TRouteMethod] extends {
|
|
9
9
|
builtin: true;
|
|
10
|
-
} ? TRoute extends `/${infer InferredCollection}/${infer InferredEndpoint}` ? InferredEndpoint extends keyof CollectionFunctionsSDK<JsonSchema> ? CollectionFunctionsSDK<TDescriptions[InferredCollection]>[InferredEndpoint] : never : never : InferEndpointFromContract<TApiSchema[TRoute][TRouteMethod]>;
|
|
10
|
+
} ? TRoute extends `/${infer InferredCollection}/${infer InferredEndpoint}` ? InferredEndpoint extends keyof CollectionFunctionsSDK<JsonSchema> ? CollectionFunctionsSDK<TDescriptions[InferredCollection]>[InferredEndpoint] : never : never : TApiSchema[TRoute][TRouteMethod] extends ContractWithRoles ? InferEndpointFromContract<TApiSchema[TRoute][TRouteMethod]> : (...args: unknown[]) => Promise<unknown>;
|
|
11
11
|
export declare const createInstance: <TApiPrototype extends ApiPrototype>(config: InstanceConfig, instanceContext?: {
|
|
12
12
|
interceptors: {
|
|
13
13
|
request?: import("@aeriajs/common").RequestTransformer;
|
package/dist/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type ApiPrototype = {
|
|
|
19
19
|
} | Record<RequestMethod, (payload: unknown) => Promise<unknown>>;
|
|
20
20
|
export type ApiSchema = {
|
|
21
21
|
[route: string]: {
|
|
22
|
-
[method: RequestMethod]: ContractWithRoles;
|
|
22
|
+
[method: RequestMethod]: ContractWithRoles | null;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
export type AeriaInstance = ApiPrototype & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aeria-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.203",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"@aeriajs/types": "link:../types"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@aeriajs/common": "^0.0.
|
|
56
|
-
"@aeriajs/types": "^0.0.
|
|
55
|
+
"@aeriajs/common": "^0.0.152",
|
|
56
|
+
"@aeriajs/types": "^0.0.130"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"test": "echo skipping",
|