@lucaapp/service-utils 1.48.4 → 1.49.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.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { ZodType, z } from 'zod';
|
|
2
2
|
declare const noContentSchema: z.ZodVoid;
|
|
3
|
-
export declare const okResponse: <T>(schema
|
|
3
|
+
export declare const okResponse: <T>(schema?: ZodType<T, z.ZodTypeDef, T> | undefined) => {
|
|
4
4
|
status: 200;
|
|
5
5
|
description: string;
|
|
6
|
-
schema: z.ZodType<T, z.ZodTypeDef, T>;
|
|
6
|
+
schema: z.ZodVoid | ZodType<T, z.ZodTypeDef, T>;
|
|
7
7
|
};
|
|
8
|
-
export declare const createdResponse: <T>(schema
|
|
8
|
+
export declare const createdResponse: <T>(schema?: ZodType<T, z.ZodTypeDef, T> | undefined) => {
|
|
9
9
|
status: 201;
|
|
10
10
|
description: string;
|
|
11
|
-
schema: z.ZodType<T, z.ZodTypeDef, T>;
|
|
11
|
+
schema: z.ZodVoid | ZodType<T, z.ZodTypeDef, T>;
|
|
12
12
|
};
|
|
13
13
|
export declare const noContentResponse: () => {
|
|
14
14
|
status: 204;
|
package/dist/lib/api/response.js
CHANGED
|
@@ -10,13 +10,13 @@ const noContentSchema = zod_1.z.void();
|
|
|
10
10
|
const okResponse = (schema) => ({
|
|
11
11
|
status: 200,
|
|
12
12
|
description: 'OK',
|
|
13
|
-
schema,
|
|
13
|
+
schema: schema ?? noContentSchema,
|
|
14
14
|
});
|
|
15
15
|
exports.okResponse = okResponse;
|
|
16
16
|
const createdResponse = (schema) => ({
|
|
17
17
|
status: 201,
|
|
18
18
|
description: 'CREATED',
|
|
19
|
-
schema,
|
|
19
|
+
schema: schema ?? noContentSchema,
|
|
20
20
|
});
|
|
21
21
|
exports.createdResponse = createdResponse;
|
|
22
22
|
const noContentResponse = () => ({
|
package/dist/lib/api/send.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const ok: <T>(body
|
|
1
|
+
export declare const ok: <T>(body?: T | undefined) => {
|
|
2
2
|
status: 200;
|
|
3
3
|
body: T;
|
|
4
4
|
};
|
|
5
|
-
export declare const created: <T>(body
|
|
5
|
+
export declare const created: <T>(body?: T | undefined) => {
|
|
6
6
|
status: 201;
|
|
7
7
|
body: T;
|
|
8
8
|
};
|
package/dist/lib/api/send.js
CHANGED
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.noContent = exports.created = exports.ok = void 0;
|
|
4
4
|
const ok = (body) => ({
|
|
5
5
|
status: 200,
|
|
6
|
-
body,
|
|
6
|
+
body: body,
|
|
7
7
|
});
|
|
8
8
|
exports.ok = ok;
|
|
9
9
|
const created = (body) => ({
|
|
10
10
|
status: 201,
|
|
11
|
-
body,
|
|
11
|
+
body: body,
|
|
12
12
|
});
|
|
13
13
|
exports.created = created;
|
|
14
14
|
const noContent = () => ({
|
|
@@ -141,7 +141,7 @@ class KafkaClient {
|
|
|
141
141
|
this.logger.debug(`Topic=${topic} already exists. Not creating.`);
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
const numPartitions = this.environment == serviceIdentity_1.Environment.PROD ? 3 :
|
|
144
|
+
const numPartitions = this.environment == serviceIdentity_1.Environment.PROD ? 3 : 1;
|
|
145
145
|
const replicationFactor = this.environment == serviceIdentity_1.Environment.LOCAL ? 1 : 3;
|
|
146
146
|
await this.admin.createTopics({
|
|
147
147
|
topics: [
|