@lucaapp/service-utils 1.34.0 → 1.35.0

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.
@@ -56,6 +56,11 @@ export declare const okResponse: <T>(schema: z.ZodType<T, z.ZodTypeDef, T>) => {
56
56
  description: string;
57
57
  schema: z.ZodType<T, z.ZodTypeDef, T>;
58
58
  };
59
+ export declare const createdResponse: <T>(schema: z.ZodType<T, z.ZodTypeDef, T>) => {
60
+ status: 201;
61
+ description: string;
62
+ schema: z.ZodType<T, z.ZodTypeDef, T>;
63
+ };
59
64
  export declare const noContentResponse: () => {
60
65
  status: 204;
61
66
  description: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tooManyRequestsResponse = exports.notFoundResponse = exports.forbiddenResponse = exports.unauthorizedResponse = exports.badRequestResponse = exports.noContentResponse = exports.okResponse = void 0;
3
+ exports.tooManyRequestsResponse = exports.notFoundResponse = exports.forbiddenResponse = exports.unauthorizedResponse = exports.badRequestResponse = exports.noContentResponse = exports.createdResponse = exports.okResponse = void 0;
4
4
  const zod_to_openapi_1 = require("@asteasolutions/zod-to-openapi");
5
5
  const zod_1 = require("zod");
6
6
  const http_1 = require("./types/http");
@@ -34,6 +34,12 @@ const okResponse = (schema) => ({
34
34
  schema,
35
35
  });
36
36
  exports.okResponse = okResponse;
37
+ const createdResponse = (schema) => ({
38
+ status: 201,
39
+ description: 'CREATED',
40
+ schema,
41
+ });
42
+ exports.createdResponse = createdResponse;
37
43
  const noContentResponse = () => ({
38
44
  status: 204,
39
45
  description: 'No Content',
@@ -3,6 +3,10 @@ export declare const ok: <T>(body: T) => {
3
3
  status: 200;
4
4
  body: T;
5
5
  };
6
+ export declare const created: <T>(body: T) => {
7
+ status: 201;
8
+ body: T;
9
+ };
6
10
  export declare const noContent: () => {
7
11
  status: 204;
8
12
  body: void;
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.notFound = exports.forbidden = exports.unauthorized = exports.badRequest = exports.noContent = exports.ok = void 0;
3
+ exports.notFound = exports.forbidden = exports.unauthorized = exports.badRequest = exports.noContent = exports.created = exports.ok = void 0;
4
4
  const http_1 = require("./types/http");
5
5
  const ok = (body) => ({
6
6
  status: 200,
7
7
  body,
8
8
  });
9
9
  exports.ok = ok;
10
+ const created = (body) => ({
11
+ status: 201,
12
+ body,
13
+ });
14
+ exports.created = created;
10
15
  const noContent = () => ({
11
16
  status: 204,
12
17
  body: undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "1.34.0",
3
+ "version": "1.35.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -57,7 +57,7 @@
57
57
  "pino-http": "8.2.1",
58
58
  "prom-client": "14.1.0",
59
59
  "response-time": "^2.3.2",
60
- "sequelize": "^6.29.0",
60
+ "sequelize": "6.29.0",
61
61
  "swagger-ui-express": "4.5.0",
62
62
  "url-value-parser": "^2.2.0",
63
63
  "uuid": "^9.0.0",