mielk-api 1.0.1 → 1.0.4

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,2 +1,2 @@
1
- import { ApiStatus } from "./types.js";
1
+ import { ApiStatus } from "../types/types.js";
2
2
  export declare const API_STATUS_CODES: Record<string, ApiStatus>;
@@ -1,5 +1,5 @@
1
1
  import { msgTag } from "mielk-fn/tags";
2
- import { Msg } from "../internal/messaging/Msg.js";
2
+ import { Msg } from "../../internal/messaging/Msg.js";
3
3
  const createApiStatus = (success, code, defaultMessageTag) => ({ success, code, defaultMessageTag });
4
4
  export const API_STATUS_CODES = {
5
5
  OK: createApiStatus(true, 200, msgTag(Msg.API_STATUS.OK)),
@@ -1,6 +1,6 @@
1
- import type { ApiStatus } from './types.js';
2
- import { PG_ERROR_CODES } from './pgErrorCodes.js';
3
- import { API_STATUS_CODES } from './ApiStatus.js';
1
+ import type { ApiStatus } from './types/types.js';
2
+ import { PG_ERROR_CODES } from './enums/PostgreErrorCodes.js';
3
+ import { API_STATUS_CODES } from './enums/ApiStatus.js';
4
4
  export type { ApiStatus };
5
5
  export { PG_ERROR_CODES };
6
6
  export { API_STATUS_CODES };
@@ -1,4 +1,4 @@
1
- import { PG_ERROR_CODES } from './pgErrorCodes.js';
2
- import { API_STATUS_CODES } from './ApiStatus.js';
1
+ import { PG_ERROR_CODES } from './enums/PostgreErrorCodes.js';
2
+ import { API_STATUS_CODES } from './enums/ApiStatus.js';
3
3
  export { PG_ERROR_CODES };
4
4
  export { API_STATUS_CODES };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mielk-api",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "keywords": [],
5
5
  "author": "mielk",
6
6
  "description": "Wrapper for API operations",
@@ -1 +0,0 @@
1
- export {};
@@ -1,30 +0,0 @@
1
- // import { ApiSuccess, ApiError } from '../front/types.js';
2
- export {};
3
- // export function ok<T>(res: Response, data: T): void {
4
- // const apiResponse: ApiSuccess<T> = {
5
- // success: true,
6
- // data,
7
- // }
8
- // res.status(200).json(apiResponse);
9
- // }
10
- // export function notFound(res: Response, message = 'Resource not found'): void {
11
- // const apiError: ApiError = {
12
- // success: false,
13
- // error: message,
14
- // };
15
- // res.status(404).json(apiError);
16
- // }
17
- // export function badRequest(res: Response, message: string): void {
18
- // const apiError: ApiError = {
19
- // success: false,
20
- // error: message,
21
- // };
22
- // res.status(400).json(apiError);
23
- // }
24
- // export function serverError(res: Response, err: unknown): void {
25
- // const apiError: ApiError = {
26
- // success: false,
27
- // error: `Internal server error [details: ${err}]`,
28
- // };
29
- // res.status(500).json(apiError);
30
- // }
File without changes
File without changes