@dakkitor/api-contracts 1.1.131 → 1.1.133
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.
- package/dist/abilities/abilities.contract.d.ts +19 -13
- package/dist/abilities/abilities.contract.js +33 -18
- package/dist/abilities/first-agent.abilities.json +68 -56
- package/dist/abilities/second-agent.abilities.json +3 -3
- package/dist/abilities/team-leads.json +3 -6
- package/dist/actives/actives.contract.d.ts +6313 -6313
- package/dist/actives/actives.contract.js +92 -92
- package/dist/agent-client-links/agent-client-links.contract.d.ts +511 -511
- package/dist/auth/auth.contract.d.ts +16 -16
- package/dist/bookings/bookings.contract.d.ts +23378 -23378
- package/dist/call-history/call-history.contract.d.ts +366 -366
- package/dist/call-history/call-history.contract.js +67 -67
- package/dist/client-contacts/client-contacts.contract.d.ts +159 -159
- package/dist/clients/clients.contract.d.ts +72 -72
- package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +1330 -1330
- package/dist/collaborations/collaborations.contract.d.ts +1198 -1198
- package/dist/common/call-rating.schema.d.ts +12 -12
- package/dist/common/call-rating.schema.js +48 -40
- package/dist/common/common-schemas.d.ts +4 -4
- package/dist/common/common-schemas.d.ts.map +1 -1
- package/dist/common/common-schemas.js +1 -2
- package/dist/common/error-schemas.d.ts +11 -5
- package/dist/common/error-schemas.js +11 -8
- package/dist/common/openapi-metadata.d.ts +54 -44
- package/dist/common/openapi-metadata.js +135 -129
- package/dist/common/pagination-query.schema.d.ts +11 -5
- package/dist/common/pagination-query.schema.js +11 -8
- package/dist/companies/companies.contract.d.ts +40 -40
- package/dist/cron-executions/cron-executions.contract.d.ts +14 -14
- package/dist/curated-workers/curated-workers.contract.d.ts +211 -211
- package/dist/dashboards/agent-daily-metrics.contract.d.ts +798 -616
- package/dist/dashboards/agent-daily-metrics.contract.js +100 -89
- package/dist/dashboards/dashboard-widgets.contract.d.ts +75 -75
- package/dist/dashboards/dashboard-widgets.contract.js +89 -89
- package/dist/dashboards/dashboard.contract.d.ts +305 -215
- package/dist/files/files.contract.d.ts +1544 -1177
- package/dist/files/files.contract.js +177 -162
- package/dist/health/health.contract.d.ts +191 -144
- package/dist/health/health.contract.js +53 -40
- package/dist/index.d.ts +67 -67
- package/dist/jobs/jobs.contract.d.ts +2553 -2553
- package/dist/jobs/jobs.contract.js +150 -150
- package/dist/lead-assignments/lead-assignments.contract.d.ts +587 -587
- package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +239 -239
- package/dist/lead-distribution/lead-distribution-config.contract.d.ts +25 -25
- package/dist/leads/leads.contract.d.ts +108 -108
- package/dist/leads/leads.contract.js +119 -119
- package/dist/locations/locations.contract.d.ts +7 -7
- package/dist/monitoring/monitoring.contract.d.ts +13 -13
- package/dist/monitoring/monitoring.contract.js +37 -37
- package/dist/own-research/own-research.contract.d.ts +535 -134
- package/dist/own-research/own-research.contract.d.ts.map +1 -1
- package/dist/own-research/own-research.contract.js +88 -56
- package/dist/postcodes/postcodes.contract.d.ts +24 -24
- package/dist/qualifications/qualifications.contract.d.ts +1898 -1387
- package/dist/qualifications/qualifications.contract.js +193 -171
- package/dist/trades/trades.contract.d.ts +991 -763
- package/dist/trades/trades.contract.js +111 -89
- package/dist/users/users.contract.d.ts +202 -202
- package/dist/users/users.contract.js +121 -121
- package/dist/workers/workers.contract.d.ts +710 -710
- package/dist/workers/workers.contract.js +150 -150
- package/package.json +1 -1
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
export declare enum CallRating {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
NO_ANSWER = 0,
|
|
10
|
+
INVALID_NUMBER = 1,
|
|
11
|
+
STRONGLY_NOT_INTERESTED = 2,
|
|
12
|
+
NOT_INTERESTED_NOW = 3,
|
|
13
|
+
BRUSHED_OFF = 4,
|
|
14
|
+
INTERESTED = 5,
|
|
15
|
+
REQUESTED_INFO = 6,
|
|
16
|
+
WANTS_TO_COLLABORATE = 7,
|
|
17
|
+
FUTURE_NEEDS_IDENTIFIED = 8,
|
|
18
|
+
COLLABORATION_ACCEPTED = 9,
|
|
19
|
+
JOB_RECEIVED = 10,
|
|
20
20
|
}
|
|
21
21
|
export declare const CallRatingSchema: z.ZodNativeEnum<typeof CallRating>;
|
|
22
22
|
export type CallRatingType = z.infer<typeof CallRatingSchema>;
|
|
@@ -28,4 +28,4 @@ export declare const CALL_RATING_LABELS: Record<CallRating, string>;
|
|
|
28
28
|
* Short labels for compact UI displays
|
|
29
29
|
*/
|
|
30
30
|
export declare const CALL_RATING_SHORT_LABELS: Record<CallRating, string>;
|
|
31
|
-
//# sourceMappingURL=call-rating.schema.d.ts.map
|
|
31
|
+
//# sourceMappingURL=call-rating.schema.d.ts.map
|
|
@@ -1,63 +1,71 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
/**
|
|
3
3
|
* Project: Internal Recruitment Platform API
|
|
4
4
|
* File: call-rating.schema.ts
|
|
5
5
|
*
|
|
6
6
|
* Description: Shared CallRating enum and schema to avoid circular imports.
|
|
7
7
|
*/
|
|
8
|
-
Object.defineProperty(exports,
|
|
9
|
-
exports.CALL_RATING_SHORT_LABELS =
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
exports.CALL_RATING_SHORT_LABELS =
|
|
10
|
+
exports.CALL_RATING_LABELS =
|
|
11
|
+
exports.CallRatingSchema =
|
|
12
|
+
exports.CallRating =
|
|
13
|
+
void 0;
|
|
14
|
+
const zod_openapi_1 = require('@anatine/zod-openapi');
|
|
15
|
+
const zod_1 = require('zod');
|
|
12
16
|
(0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
|
|
13
17
|
// Call Rating Enum - shared between call-history and lead-assignments
|
|
14
18
|
var CallRating;
|
|
15
19
|
(function (CallRating) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
CallRating[(CallRating['NO_ANSWER'] = 0)] = 'NO_ANSWER';
|
|
21
|
+
CallRating[(CallRating['INVALID_NUMBER'] = 1)] = 'INVALID_NUMBER';
|
|
22
|
+
CallRating[(CallRating['STRONGLY_NOT_INTERESTED'] = 2)] =
|
|
23
|
+
'STRONGLY_NOT_INTERESTED';
|
|
24
|
+
CallRating[(CallRating['NOT_INTERESTED_NOW'] = 3)] = 'NOT_INTERESTED_NOW';
|
|
25
|
+
CallRating[(CallRating['BRUSHED_OFF'] = 4)] = 'BRUSHED_OFF';
|
|
26
|
+
CallRating[(CallRating['INTERESTED'] = 5)] = 'INTERESTED';
|
|
27
|
+
CallRating[(CallRating['REQUESTED_INFO'] = 6)] = 'REQUESTED_INFO';
|
|
28
|
+
CallRating[(CallRating['WANTS_TO_COLLABORATE'] = 7)] = 'WANTS_TO_COLLABORATE';
|
|
29
|
+
CallRating[(CallRating['FUTURE_NEEDS_IDENTIFIED'] = 8)] =
|
|
30
|
+
'FUTURE_NEEDS_IDENTIFIED';
|
|
31
|
+
CallRating[(CallRating['COLLABORATION_ACCEPTED'] = 9)] =
|
|
32
|
+
'COLLABORATION_ACCEPTED';
|
|
33
|
+
CallRating[(CallRating['JOB_RECEIVED'] = 10)] = 'JOB_RECEIVED';
|
|
27
34
|
})(CallRating || (exports.CallRating = CallRating = {}));
|
|
28
35
|
exports.CallRatingSchema = zod_1.z.nativeEnum(CallRating).openapi({
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
title: 'CallRating',
|
|
37
|
+
description: 'Rating of the call outcome (0-10)',
|
|
31
38
|
});
|
|
32
39
|
/**
|
|
33
40
|
* User-friendly labels for display in UI
|
|
34
41
|
*/
|
|
35
42
|
exports.CALL_RATING_LABELS = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
[CallRating.NO_ANSWER]: 'No Answer / Denied / Voicemail',
|
|
44
|
+
[CallRating.INVALID_NUMBER]: "Not Construction / Invalid Number / Won't Call",
|
|
45
|
+
[CallRating.STRONGLY_NOT_INTERESTED]:
|
|
46
|
+
'Strongly Not Interested / Annoyed / Blacklist',
|
|
47
|
+
[CallRating.NOT_INTERESTED_NOW]: 'Not Interested Now (Call Again Later)',
|
|
48
|
+
[CallRating.BRUSHED_OFF]: 'Asked for Details to Get Rid of Caller',
|
|
49
|
+
[CallRating.INTERESTED]: 'Interested',
|
|
50
|
+
[CallRating.REQUESTED_INFO]: 'Asked for Company Details (Genuine)',
|
|
51
|
+
[CallRating.WANTS_TO_COLLABORATE]: 'Wants to Collaborate',
|
|
52
|
+
[CallRating.FUTURE_NEEDS_IDENTIFIED]: 'Identified Future Trade Needs',
|
|
53
|
+
[CallRating.COLLABORATION_ACCEPTED]: 'Collaboration Accepted',
|
|
54
|
+
[CallRating.JOB_RECEIVED]: 'Job Received from Call',
|
|
47
55
|
};
|
|
48
56
|
/**
|
|
49
57
|
* Short labels for compact UI displays
|
|
50
58
|
*/
|
|
51
59
|
exports.CALL_RATING_SHORT_LABELS = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
[CallRating.NO_ANSWER]: 'No Answer',
|
|
61
|
+
[CallRating.INVALID_NUMBER]: 'Invalid',
|
|
62
|
+
[CallRating.STRONGLY_NOT_INTERESTED]: 'Rejected',
|
|
63
|
+
[CallRating.NOT_INTERESTED_NOW]: 'Not Now',
|
|
64
|
+
[CallRating.BRUSHED_OFF]: 'Brushed Off',
|
|
65
|
+
[CallRating.INTERESTED]: 'Interested',
|
|
66
|
+
[CallRating.REQUESTED_INFO]: 'Info Request',
|
|
67
|
+
[CallRating.WANTS_TO_COLLABORATE]: 'Wants Collab',
|
|
68
|
+
[CallRating.FUTURE_NEEDS_IDENTIFIED]: 'Future Needs',
|
|
69
|
+
[CallRating.COLLABORATION_ACCEPTED]: 'Accepted',
|
|
70
|
+
[CallRating.JOB_RECEIVED]: 'Job Received',
|
|
63
71
|
};
|
|
@@ -44,23 +44,23 @@ export declare const UpsertPhoneNumberSchema: z.ZodEffects<z.ZodObject<{
|
|
|
44
44
|
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
45
45
|
}, "strip", z.ZodTypeAny, {
|
|
46
46
|
id?: string | undefined;
|
|
47
|
-
description?: string | null | undefined;
|
|
48
47
|
phoneNumber?: string | undefined;
|
|
48
|
+
description?: string | null | undefined;
|
|
49
49
|
isPrimary?: boolean | undefined;
|
|
50
50
|
}, {
|
|
51
51
|
id?: string | undefined;
|
|
52
|
-
description?: string | null | undefined;
|
|
53
52
|
phoneNumber?: string | undefined;
|
|
53
|
+
description?: string | null | undefined;
|
|
54
54
|
isPrimary?: boolean | undefined;
|
|
55
55
|
}>, {
|
|
56
56
|
id?: string | undefined;
|
|
57
|
-
description?: string | null | undefined;
|
|
58
57
|
phoneNumber?: string | undefined;
|
|
58
|
+
description?: string | null | undefined;
|
|
59
59
|
isPrimary?: boolean | undefined;
|
|
60
60
|
}, {
|
|
61
61
|
id?: string | undefined;
|
|
62
|
-
description?: string | null | undefined;
|
|
63
62
|
phoneNumber?: string | undefined;
|
|
63
|
+
description?: string | null | undefined;
|
|
64
64
|
isPrimary?: boolean | undefined;
|
|
65
65
|
}>;
|
|
66
66
|
export type PhoneNumberResponse = z.infer<typeof PhoneNumberResponseSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-schemas.d.ts","sourceRoot":"","sources":["../../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AC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;EAeM,CAAC;AAElC,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,qBAAqB;;;;;;EAIM,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -336,9 +336,8 @@ exports.AutocompleteQuerySchema = zod_1.z
|
|
|
336
336
|
.describe('Search query string to filter results'),
|
|
337
337
|
id: zod_1.z
|
|
338
338
|
.string()
|
|
339
|
-
.uuid()
|
|
340
339
|
.optional()
|
|
341
|
-
.describe('Specific record ID to include in results'),
|
|
340
|
+
.describe('Specific record ID(s) to include in results. Supports a single UUID or comma-separated UUIDs.'),
|
|
342
341
|
})
|
|
343
342
|
.openapi({ title: 'AutocompleteQuery' });
|
|
344
343
|
exports.ResourceIdSchema = zod_1.z.object({
|
|
@@ -3,7 +3,8 @@ import { z } from 'zod';
|
|
|
3
3
|
* Shared error response schema matching IErrorResponse interface.
|
|
4
4
|
* This ensures type consistency between backend error handling and contract definitions.
|
|
5
5
|
*/
|
|
6
|
-
export declare const ErrorResponseSchema: z.ZodObject<
|
|
6
|
+
export declare const ErrorResponseSchema: z.ZodObject<
|
|
7
|
+
{
|
|
7
8
|
statusCode: z.ZodNumber;
|
|
8
9
|
message: z.ZodString;
|
|
9
10
|
code: z.ZodString;
|
|
@@ -11,7 +12,10 @@ export declare const ErrorResponseSchema: z.ZodObject<{
|
|
|
11
12
|
timestamp: z.ZodString;
|
|
12
13
|
path: z.ZodString;
|
|
13
14
|
correlationId: z.ZodOptional<z.ZodString>;
|
|
14
|
-
},
|
|
15
|
+
},
|
|
16
|
+
'strip',
|
|
17
|
+
z.ZodTypeAny,
|
|
18
|
+
{
|
|
15
19
|
code: string;
|
|
16
20
|
path: string;
|
|
17
21
|
message: string;
|
|
@@ -19,7 +23,8 @@ export declare const ErrorResponseSchema: z.ZodObject<{
|
|
|
19
23
|
timestamp: string;
|
|
20
24
|
details?: unknown;
|
|
21
25
|
correlationId?: string | undefined;
|
|
22
|
-
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
23
28
|
code: string;
|
|
24
29
|
path: string;
|
|
25
30
|
message: string;
|
|
@@ -27,6 +32,7 @@ export declare const ErrorResponseSchema: z.ZodObject<{
|
|
|
27
32
|
timestamp: string;
|
|
28
33
|
details?: unknown;
|
|
29
34
|
correlationId?: string | undefined;
|
|
30
|
-
}
|
|
35
|
+
}
|
|
36
|
+
>;
|
|
31
37
|
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
|
32
|
-
//# sourceMappingURL=error-schemas.d.ts.map
|
|
38
|
+
//# sourceMappingURL=error-schemas.d.ts.map
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.ErrorResponseSchema = void 0;
|
|
4
|
-
const zod_openapi_1 = require(
|
|
5
|
-
const zod_1 = require(
|
|
4
|
+
const zod_openapi_1 = require('@anatine/zod-openapi');
|
|
5
|
+
const zod_1 = require('zod');
|
|
6
6
|
(0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
|
|
7
7
|
/**
|
|
8
8
|
* Shared error response schema matching IErrorResponse interface.
|
|
9
9
|
* This ensures type consistency between backend error handling and contract definitions.
|
|
10
10
|
*/
|
|
11
11
|
exports.ErrorResponseSchema = zod_1.z
|
|
12
|
-
|
|
12
|
+
.object({
|
|
13
13
|
statusCode: zod_1.z.number().describe('HTTP Status Code'),
|
|
14
14
|
message: zod_1.z.string().describe('Human-readable error message'),
|
|
15
15
|
code: zod_1.z.string().describe('Machine-readable error code'),
|
|
16
16
|
details: zod_1.z.unknown().optional().describe('Additional error details'),
|
|
17
17
|
timestamp: zod_1.z.string().describe('Error timestamp'),
|
|
18
18
|
path: zod_1.z.string().describe('Request path'),
|
|
19
|
-
correlationId: zod_1.z
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
correlationId: zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('Request correlation ID'),
|
|
23
|
+
})
|
|
24
|
+
.openapi({ title: 'ErrorResponse' });
|
|
@@ -10,34 +10,34 @@
|
|
|
10
10
|
* Metadata for a single response status code.
|
|
11
11
|
*/
|
|
12
12
|
export interface ResponseMetadata {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Description of the response.
|
|
15
|
+
*/
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Example response data.
|
|
19
|
+
*/
|
|
20
|
+
example?: Record<string, unknown>;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Metadata for OpenAPI documentation that can be attached to ts-rest routes.
|
|
24
24
|
*/
|
|
25
25
|
export interface OpenApiMetadata {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Tags for grouping endpoints in Swagger UI.
|
|
28
|
+
*/
|
|
29
|
+
tags?: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Custom response metadata for each status code.
|
|
32
|
+
* Keys are status codes (e.g., '200', '201', '400', '401', etc.)
|
|
33
|
+
*/
|
|
34
|
+
responses?: Record<string, ResponseMetadata>;
|
|
35
|
+
/**
|
|
36
|
+
* Indicates if the route is public (no authentication required).
|
|
37
|
+
* If true, the route will not require JWT authentication in the OpenAPI spec.
|
|
38
|
+
* If false or undefined, the route requires authentication (default).
|
|
39
|
+
*/
|
|
40
|
+
isPublic?: boolean;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Standard error response examples and descriptions
|
|
@@ -47,25 +47,35 @@ export declare const STANDARD_ERROR_RESPONSES: Record<number, ResponseMetadata>;
|
|
|
47
47
|
* Helper to create metadata for standard CRUD operations
|
|
48
48
|
*/
|
|
49
49
|
export declare const createStandardMetadata: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Metadata for CREATE operations (201)
|
|
52
|
+
*/
|
|
53
|
+
create: (
|
|
54
|
+
customResponses?: Record<string, ResponseMetadata>,
|
|
55
|
+
) => OpenApiMetadata;
|
|
56
|
+
/**
|
|
57
|
+
* Metadata for FIND ONE operations (200)
|
|
58
|
+
*/
|
|
59
|
+
findOne: (
|
|
60
|
+
customResponses?: Record<string, ResponseMetadata>,
|
|
61
|
+
) => OpenApiMetadata;
|
|
62
|
+
/**
|
|
63
|
+
* Metadata for FIND ALL operations (200)
|
|
64
|
+
*/
|
|
65
|
+
findAll: (
|
|
66
|
+
customResponses?: Record<string, ResponseMetadata>,
|
|
67
|
+
) => OpenApiMetadata;
|
|
68
|
+
/**
|
|
69
|
+
* Metadata for UPDATE operations (200)
|
|
70
|
+
*/
|
|
71
|
+
update: (
|
|
72
|
+
customResponses?: Record<string, ResponseMetadata>,
|
|
73
|
+
) => OpenApiMetadata;
|
|
74
|
+
/**
|
|
75
|
+
* Metadata for DELETE operations (204)
|
|
76
|
+
*/
|
|
77
|
+
delete: (
|
|
78
|
+
customResponses?: Record<string, ResponseMetadata>,
|
|
79
|
+
) => OpenApiMetadata;
|
|
70
80
|
};
|
|
71
|
-
//# sourceMappingURL=openapi-metadata.d.ts.map
|
|
81
|
+
//# sourceMappingURL=openapi-metadata.d.ts.map
|