aeria-sdk 0.0.130 → 0.0.132

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/http.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { InstanceConfig } from './types.js';
2
2
  import { type RequestConfig } from '@aeriajs/common';
3
- export declare const request: <TResponseType = unknown>(config: InstanceConfig, url: string, payload?: any, _requestConfig?: RequestConfig) => Promise<Response & {
3
+ export declare const request: <TResponseType = unknown>(config: InstanceConfig, url: string, payload?: unknown, _requestConfig?: RequestConfig) => Promise<Response & {
4
4
  data: unknown;
5
5
  } & {
6
6
  data: TResponseType;
package/dist/mirror.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import type { InstanceConfig } from './types.js';
2
+ type MirrorObject = {
3
+ descriptions: unknown;
4
+ router?: unknown;
5
+ };
2
6
  export declare const runtimeCjs: (config: InstanceConfig) => string;
3
7
  export declare const runtimeEsm: (config: InstanceConfig) => string;
4
- export declare const writeMirrorFiles: (mirror: any, config: InstanceConfig) => Promise<void>;
8
+ export declare const writeMirrorFiles: (mirror: MirrorObject, config: InstanceConfig) => Promise<void>;
5
9
  export declare const mirrorRemotely: (config: InstanceConfig) => Promise<void>;
10
+ export {};
package/dist/mirror.js CHANGED
@@ -9,7 +9,7 @@ const topLevel_js_1 = require("./topLevel.js");
9
9
  const utils_js_1 = require("./utils.js");
10
10
  const DTS_FILENAME = 'aeria-sdk.d.ts';
11
11
  const mirrorDts = (mirrorObj, config) => {
12
- const collections = mirrorObj.descriptions;
12
+ const { descriptions, router, } = mirrorObj;
13
13
  return `import type {
14
14
  InferProperty,
15
15
  InferResponse,
@@ -20,9 +20,9 @@ const mirrorDts = (mirrorObj, config) => {
20
20
 
21
21
  } from '@aeriajs/types'
22
22
 
23
- declare type MirrorDescriptions = ${JSON.stringify(collections, null, 2)}\n
23
+ declare type MirrorDescriptions = ${JSON.stringify(descriptions, null, 2)}\n
24
24
 
25
- declare type MirrorRouter = ${JSON.stringify(mirrorObj.router, null, 2)}\n
25
+ declare type MirrorRouter = ${JSON.stringify(router, null, 2)}\n
26
26
 
27
27
  ${config.integrated
28
28
  ? ''
@@ -36,7 +36,7 @@ ${config.integrated
36
36
  declare module 'aeria-sdk' {
37
37
  import { TopLevelObject } from 'aeria-sdk'
38
38
 
39
- type UnionToIntersection<T> = (T extends any ? ((x: T) => 0) : never) extends ((x: infer R) => 0)
39
+ type UnionToIntersection<T> = (T extends unknown ? ((x: T) => 0) : never) extends ((x: infer R) => 0)
40
40
  ? R
41
41
  : never
42
42
 
@@ -65,7 +65,7 @@ declare module 'aeria-sdk' {
65
65
  type Endpoints = {
66
66
  [Route in keyof MirrorRouter]: Route extends \`/\${infer Coll}/\${infer Fn}\`
67
67
  ? Coll extends keyof Collections
68
- ? Fn extends keyof CollectionFunctionsSDK<any>
68
+ ? Fn extends keyof CollectionFunctionsSDK
69
69
  ? Record<Coll, Record<
70
70
  Fn, {
71
71
  POST: CollectionFunctionsSDK<SchemaWithId<MirrorDescriptions[Coll]>>[Fn]
package/dist/mirror.mjs CHANGED
@@ -7,7 +7,10 @@ import { topLevel } from "./topLevel.mjs";
7
7
  import { publicUrl } from "./utils.mjs";
8
8
  const DTS_FILENAME = "aeria-sdk.d.ts";
9
9
  const mirrorDts = (mirrorObj, config) => {
10
- const collections = mirrorObj.descriptions;
10
+ const {
11
+ descriptions,
12
+ router
13
+ } = mirrorObj;
11
14
  return `import type {
12
15
  InferProperty,
13
16
  InferResponse,
@@ -18,10 +21,10 @@ const mirrorDts = (mirrorObj, config) => {
18
21
 
19
22
  } from '@aeriajs/types'
20
23
 
21
- declare type MirrorDescriptions = ${JSON.stringify(collections, null, 2)}
24
+ declare type MirrorDescriptions = ${JSON.stringify(descriptions, null, 2)}
22
25
 
23
26
 
24
- declare type MirrorRouter = ${JSON.stringify(mirrorObj.router, null, 2)}
27
+ declare type MirrorRouter = ${JSON.stringify(router, null, 2)}
25
28
 
26
29
 
27
30
  ${config.integrated ? "" : `declare global {
@@ -35,7 +38,7 @@ ${config.integrated ? "" : `declare global {
35
38
  declare module 'aeria-sdk' {
36
39
  import { TopLevelObject } from 'aeria-sdk'
37
40
 
38
- type UnionToIntersection<T> = (T extends any ? ((x: T) => 0) : never) extends ((x: infer R) => 0)
41
+ type UnionToIntersection<T> = (T extends unknown ? ((x: T) => 0) : never) extends ((x: infer R) => 0)
39
42
  ? R
40
43
  : never
41
44
 
@@ -64,7 +67,7 @@ declare module 'aeria-sdk' {
64
67
  type Endpoints = {
65
68
  [Route in keyof MirrorRouter]: Route extends \`/\${infer Coll}/\${infer Fn}\`
66
69
  ? Coll extends keyof Collections
67
- ? Fn extends keyof CollectionFunctionsSDK<any>
70
+ ? Fn extends keyof CollectionFunctionsSDK
68
71
  ? Record<Coll, Record<
69
72
  Fn, {
70
73
  POST: CollectionFunctionsSDK<SchemaWithId<MirrorDescriptions[Coll]>>[Fn]
package/dist/storage.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { InstanceConfig } from './types.js';
2
2
  import type { AuthenticationResult } from './auth.js';
3
- export declare const storageMemo: Record<string, string>;
3
+ export declare const storageMemo: Record<string, unknown>;
4
4
  export declare const storageKey: (key: string, config: InstanceConfig) => string;
5
5
  export declare const getStorage: (config: InstanceConfig) => {
6
6
  get: (key: "auth") => AuthenticationResult | null;
7
7
  remove: (key: string) => void;
8
- set: (key: string, value: any) => void;
8
+ set: (key: string, value: unknown) => void;
9
9
  };
@@ -1,7 +1,7 @@
1
1
  import type { InstanceConfig } from './types.js';
2
2
  export type TopLevelObject = {
3
3
  describe: {
4
- POST: (...args: any) => Promise<any>;
4
+ POST: (...args: unknown[]) => Promise<string>;
5
5
  };
6
6
  };
7
7
  export declare const topLevel: (config: InstanceConfig) => ((bearerToken?: string) => TopLevelObject) & TopLevelObject;
package/dist/topLevel.js CHANGED
@@ -6,6 +6,9 @@ const utils_js_1 = require("./utils.js");
6
6
  const proxify = (config, _target, bearerToken, parent) => {
7
7
  return new Proxy(_target, {
8
8
  get: (target, key) => {
9
+ if (typeof target === 'function') {
10
+ return target;
11
+ }
9
12
  if (typeof key === 'symbol') {
10
13
  return target[key];
11
14
  }
package/dist/topLevel.mjs CHANGED
@@ -4,6 +4,9 @@ import { publicUrl } from "./utils.mjs";
4
4
  const proxify = (config, _target, bearerToken, parent) => {
5
5
  return new Proxy(_target, {
6
6
  get: (target, key) => {
7
+ if (typeof target === "function") {
8
+ return target;
9
+ }
7
10
  if (typeof key === "symbol") {
8
11
  return target[key];
9
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aeria-sdk",
3
- "version": "0.0.130",
3
+ "version": "0.0.132",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -60,8 +60,8 @@
60
60
  "@aeriajs/types": "link:../types"
61
61
  },
62
62
  "peerDependencies": {
63
- "@aeriajs/common": "^0.0.101",
64
- "@aeriajs/types": "^0.0.86"
63
+ "@aeriajs/common": "^0.0.103",
64
+ "@aeriajs/types": "^0.0.87"
65
65
  },
66
66
  "scripts": {
67
67
  "test": "echo skipping",