@alevnyacow/nzmt 0.0.3 → 0.0.5

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,4 +1,3 @@
1
- var __webpack_modules__ = {};
2
1
  var __webpack_module_cache__ = {};
3
2
  function __webpack_require__(moduleId) {
4
3
  var cachedModule = __webpack_module_cache__[moduleId];
@@ -9,17 +8,30 @@ function __webpack_require__(moduleId) {
9
8
  __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
10
9
  return module.exports;
11
10
  }
12
- __webpack_require__.m = __webpack_modules__;
11
+ (()=>{
12
+ __webpack_require__.d = (exports, definition)=>{
13
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
14
+ enumerable: true,
15
+ get: definition[key]
16
+ });
17
+ };
18
+ })();
13
19
  (()=>{
14
20
  __webpack_require__.add = function(modules) {
15
21
  Object.assign(__webpack_require__.m, modules);
16
22
  };
17
23
  })();
18
24
  (()=>{
19
- __webpack_require__.nmd = (module)=>{
20
- module.paths = [];
21
- if (!module.children) module.children = [];
22
- return module;
25
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
26
+ })();
27
+ (()=>{
28
+ __webpack_require__.r = (exports)=>{
29
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
30
+ value: 'Module'
31
+ });
32
+ Object.defineProperty(exports, '__esModule', {
33
+ value: true
34
+ });
23
35
  };
24
36
  })();
25
37
  export { __webpack_require__ };
@@ -1,7 +1,7 @@
1
1
  import { type NextRequest, NextResponse } from 'next/server';
2
2
  import z, { type ZodObject } from 'zod';
3
3
  import { type ControllerErrorModel, type ErrorBaseCreatingPayload } from './errors.utils';
4
- export declare enum ZodControllerDefaultErrorCodes {
4
+ export declare enum DefaultErrorCodes {
5
5
  REQUEST_PARSING = "ZOD-CONTROLLER___REQUEST-PARSING",
6
6
  RESPONSE_PARSING = "ZOD-CONTROLLER___RESPONSE-PARSING"
7
7
  }
@@ -56,11 +56,11 @@ export type SharedConfig = Partial<{
56
56
  guards: Guard[];
57
57
  onErrorHandlers?: Array<OnErrorHandler>;
58
58
  }>;
59
- export declare const zodAPIEndpointFactory: <T extends ZodControllerSchemas>(metadata: {
59
+ export declare const endpoints: <T extends Schemas>(metadata: {
60
60
  schemas: T;
61
61
  name: string;
62
62
  }, sharedConfig?: SharedConfig) => <Method extends keyof T>(method: Method, handler: EndpointLogic<T[Method]>["handler"], configuration?: Omit<EndpointLogic<T[Method]>, "handler">) => (request: NextRequest) => Promise<NextResponse<unknown>>;
63
- type ZodControllerSchemas = Record<string, ZodAPISchemas>;
63
+ type Schemas = Record<string, ZodAPISchemas>;
64
64
  type Flatten<T extends Record<string, object>> = {
65
65
  [K in keyof T]: T[K];
66
66
  }[keyof T];
@@ -70,7 +70,7 @@ type SchemaShape = {
70
70
  query?: unknown;
71
71
  response?: unknown;
72
72
  };
73
- export type ZodControllerMetadata<T = ZodControllerSchemas> = {
73
+ export type Metadata<T = Schemas> = {
74
74
  name: string;
75
75
  schemas: T;
76
76
  };
@@ -105,7 +105,7 @@ type ZodAPIMethod<Schemas extends {
105
105
  response: SuccessResponse<Schemas['response']>;
106
106
  error: ErrorResponse;
107
107
  };
108
- export type ZodControllerAPI<Metadata extends {
108
+ export type API<Metadata extends {
109
109
  schemas: Record<string, SchemaShape>;
110
110
  }, CustomModels extends Record<string, unknown> | undefined = undefined> = {
111
111
  endpoints: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alevnyacow/nzmt",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Next Zod Modules Toolkit",
5
5
  "type": "module",
6
6
  "exports": {
@@ -32,6 +32,9 @@
32
32
  "next": "^16.1.6",
33
33
  "typescript": "^5.9.3"
34
34
  },
35
+ "peerDependencies": {
36
+ "next": "^16.1.6"
37
+ },
35
38
  "private": false,
36
39
  "dependencies": {
37
40
  "uuid": "^13.0.0",
@@ -1,19 +0,0 @@
1
- /**
2
- * @license React
3
- * react.development.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- /**
12
- * @license React
13
- * react.production.js
14
- *
15
- * Copyright (c) Meta Platforms, Inc. and affiliates.
16
- *
17
- * This source code is licensed under the MIT license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- */
@@ -1,19 +0,0 @@
1
- /**
2
- * @license React
3
- * react.development.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- /**
12
- * @license React
13
- * react.production.js
14
- *
15
- * Copyright (c) Meta Platforms, Inc. and affiliates.
16
- *
17
- * This source code is licensed under the MIT license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- */