rlz-engine 1.0.12 → 1.0.14

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.
@@ -6,4 +6,4 @@ export interface AuthParam {
6
6
  userId: string;
7
7
  tempPassword: string;
8
8
  }
9
- export declare function apiCall<T extends ZodType>(method: string, version: string, path: string, auth: AuthParam | null, queryString: Record<string, string> | null, request: object | null, validator: T): Promise<z.infer<T>>;
9
+ export declare function apiCall<T extends ZodType>(method: 'GET' | 'POST', version: string, path: string, auth: AuthParam | null, queryString: Record<string, string> | null, request: object | null, validator: T): Promise<z.infer<T>>;
@@ -1,12 +1,12 @@
1
1
  import { getFrontConfig } from '../config';
2
- const API_DOMAIN = getFrontConfig().apiDomain;
3
2
  export class Forbidden extends Error {
4
3
  constructor(url) {
5
4
  super(`Forbidden: ${url}`);
6
5
  }
7
6
  }
8
7
  function url(version, path, queryString) {
9
- const base = `${API_DOMAIN}api/${version}/${path}`;
8
+ const domain = getFrontConfig().apiDomain;
9
+ const base = `${domain}api/${version}/${path}`;
10
10
  if (queryString === null) {
11
11
  return base;
12
12
  }
@@ -7,15 +7,15 @@ export async function apiSignup(name, email, password) {
7
7
  email,
8
8
  password
9
9
  };
10
- return apiCall('v0', 'post', 'signup', null, null, req, API_AUTH_RESPONSE_SCHEMA_V0);
10
+ return apiCall('POST', 'v0', 'signup', null, null, req, API_AUTH_RESPONSE_SCHEMA_V0);
11
11
  }
12
12
  export async function apiSignin(name, password) {
13
13
  const req = {
14
14
  name,
15
15
  password
16
16
  };
17
- return apiCall('v0', 'post', 'signin', null, null, req, API_AUTH_RESPONSE_SCHEMA_V0);
17
+ return apiCall('POST', 'v0', 'signin', null, null, req, API_AUTH_RESPONSE_SCHEMA_V0);
18
18
  }
19
19
  export async function apiLogout(auth) {
20
- await apiCall('v0', 'post', 'logout', auth, null, null, z.undefined());
20
+ await apiCall('POST', 'v0', 'logout', auth, null, null, z.undefined());
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rlz-engine",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Deps and tools for my style of development",
5
5
  "scripts": {
6
6
  "build": "tsc",