@dakkitor/api-contracts 1.1.9 → 1.1.10
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/actives/actives.contract.d.ts +163 -163
- package/dist/actives/actives.contract.d.ts.map +1 -1
- package/dist/actives/actives.contract.js +6 -11
- package/dist/bookings/bookings.contract.d.ts +2092 -0
- package/dist/bookings/bookings.contract.d.ts.map +1 -0
- package/dist/bookings/bookings.contract.js +286 -0
- package/dist/client-contacts/client-contacts.contract.d.ts +254 -252
- package/dist/client-contacts/client-contacts.contract.d.ts.map +1 -1
- package/dist/client-contacts/client-contacts.contract.js +5 -5
- package/dist/clients/clients.contract.d.ts +189 -189
- package/dist/clients/clients.contract.d.ts.map +1 -1
- package/dist/clients/clients.contract.js +5 -23
- package/dist/common/common-schemas.d.ts +20 -0
- package/dist/common/common-schemas.d.ts.map +1 -0
- package/dist/common/common-schemas.js +29 -0
- package/dist/common/error-schemas.d.ts +6 -6
- package/dist/common/pagination-query.schema.d.ts +17 -0
- package/dist/common/pagination-query.schema.d.ts.map +1 -0
- package/dist/common/pagination-query.schema.js +15 -0
- package/dist/common/pagination.schema.d.ts +2 -2
- package/dist/index.d.ts +2209 -752
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/users/users.contract.d.ts +218 -208
- package/dist/users/users.contract.d.ts.map +1 -1
- package/dist/users/users.contract.js +4 -8
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.contract.d.ts","sourceRoot":"","sources":["../../contracts/clients/clients.contract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"clients.contract.d.ts","sourceRoot":"","sources":["../../contracts/clients/clients.contract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,kBAAkB,gEAEa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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FjC,CAAC"}
|
|
@@ -4,30 +4,17 @@ exports.clientsContractRouter = exports.PaginatedResponseSchema = exports.Autoco
|
|
|
4
4
|
const zod_openapi_1 = require("@anatine/zod-openapi");
|
|
5
5
|
const core_1 = require("@ts-rest/core");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
|
+
const common_schemas_1 = require("../common/common-schemas");
|
|
7
8
|
const error_schemas_1 = require("../common/error-schemas");
|
|
9
|
+
const pagination_query_schema_1 = require("../common/pagination-query.schema");
|
|
8
10
|
const pagination_schema_1 = require("../common/pagination.schema");
|
|
9
11
|
(0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
|
|
10
12
|
const ClientStatusSchema = zod_1.z
|
|
11
13
|
.enum(['APPROVED', 'PENDING_VERIFICATION', 'BLACKLISTED'])
|
|
12
14
|
.openapi({ title: 'ClientStatus' });
|
|
13
|
-
const SortOrderSchema = zod_1.z.enum(['ASC', 'DESC']).openapi({ title: 'SortOrder' });
|
|
14
15
|
const ClientSortableFieldsSchema = zod_1.z
|
|
15
16
|
.enum(['name', 'director', 'createdAt', 'updatedAt'])
|
|
16
17
|
.openapi({ title: 'ClientSortableFields' });
|
|
17
|
-
const DateRangeSchema = zod_1.z
|
|
18
|
-
.object({
|
|
19
|
-
from: zod_1.z
|
|
20
|
-
.string()
|
|
21
|
-
.date()
|
|
22
|
-
.nullish()
|
|
23
|
-
.describe('Start of the date range (inclusive).'),
|
|
24
|
-
to: zod_1.z
|
|
25
|
-
.string()
|
|
26
|
-
.date()
|
|
27
|
-
.nullish()
|
|
28
|
-
.describe('End of the date range (inclusive).'),
|
|
29
|
-
})
|
|
30
|
-
.openapi({ title: 'DateRange' });
|
|
31
18
|
exports.ClientUserSchema = zod_1.z.object({
|
|
32
19
|
id: zod_1.z.string().uuid(),
|
|
33
20
|
firstName: zod_1.z.string(),
|
|
@@ -98,12 +85,7 @@ exports.UpdateClientSchema = zod_1.z
|
|
|
98
85
|
path: ['blacklistReason'],
|
|
99
86
|
})
|
|
100
87
|
.openapi({ title: 'UpdateClient' });
|
|
101
|
-
exports.FilterClientSchema =
|
|
102
|
-
limit: zod_1.z.coerce
|
|
103
|
-
.number()
|
|
104
|
-
.default(50)
|
|
105
|
-
.describe('The number of items to return per page.'),
|
|
106
|
-
page: zod_1.z.coerce.number().default(1).describe('The page number to retrieve.'),
|
|
88
|
+
exports.FilterClientSchema = pagination_query_schema_1.PaginationQuerySchema.extend({
|
|
107
89
|
name: zod_1.z
|
|
108
90
|
.string()
|
|
109
91
|
.optional()
|
|
@@ -117,13 +99,13 @@ exports.FilterClientSchema = zod_1.z.object({
|
|
|
117
99
|
.optional()
|
|
118
100
|
.nullable()
|
|
119
101
|
.describe('Filter by director name (case-insensitive contains match)'),
|
|
120
|
-
createdAt: DateRangeSchema.optional()
|
|
102
|
+
createdAt: common_schemas_1.DateRangeSchema.optional()
|
|
121
103
|
.nullable()
|
|
122
104
|
.describe('Filter by created date range.'),
|
|
123
105
|
sortBy: ClientSortableFieldsSchema.optional()
|
|
124
106
|
.nullable()
|
|
125
107
|
.describe('The field to sort the results by.'),
|
|
126
|
-
sortOrder: SortOrderSchema.optional()
|
|
108
|
+
sortOrder: common_schemas_1.SortOrderSchema.optional()
|
|
127
109
|
.nullable()
|
|
128
110
|
.describe('The order to sort the results by.'),
|
|
129
111
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Common enum schemas used across multiple contracts
|
|
4
|
+
*/
|
|
5
|
+
export declare const SortOrderSchema: z.ZodEnum<["ASC", "DESC"]>;
|
|
6
|
+
export declare const RateUnitSchema: z.ZodEnum<["DAILY", "HOURLY"]>;
|
|
7
|
+
export declare const DateRangeSchema: z.ZodObject<{
|
|
8
|
+
from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
to: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
from?: string | null | undefined;
|
|
12
|
+
to?: string | null | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
from?: string | null | undefined;
|
|
15
|
+
to?: string | null | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export type SortOrder = z.infer<typeof SortOrderSchema>;
|
|
18
|
+
export type RateUnit = z.infer<typeof RateUnitSchema>;
|
|
19
|
+
export type DateRange = z.infer<typeof DateRangeSchema>;
|
|
20
|
+
//# sourceMappingURL=common-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-schemas.d.ts","sourceRoot":"","sources":["../../contracts/common/common-schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AAEH,eAAO,MAAM,eAAe,4BAEM,CAAC;AAEnC,eAAO,MAAM,cAAc,gCAEM,CAAC;AAElC,eAAO,MAAM,eAAe;;;;;;;;;EAaM,CAAC;AAEnC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateRangeSchema = exports.RateUnitSchema = exports.SortOrderSchema = void 0;
|
|
4
|
+
const zod_openapi_1 = require("@anatine/zod-openapi");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
(0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
|
|
7
|
+
/**
|
|
8
|
+
* Common enum schemas used across multiple contracts
|
|
9
|
+
*/
|
|
10
|
+
exports.SortOrderSchema = zod_1.z
|
|
11
|
+
.enum(['ASC', 'DESC'])
|
|
12
|
+
.openapi({ title: 'SortOrder' });
|
|
13
|
+
exports.RateUnitSchema = zod_1.z
|
|
14
|
+
.enum(['DAILY', 'HOURLY'])
|
|
15
|
+
.openapi({ title: 'RateUnit' });
|
|
16
|
+
exports.DateRangeSchema = zod_1.z
|
|
17
|
+
.object({
|
|
18
|
+
from: zod_1.z
|
|
19
|
+
.string()
|
|
20
|
+
.date()
|
|
21
|
+
.nullish()
|
|
22
|
+
.describe('Start of the date range (inclusive)'),
|
|
23
|
+
to: zod_1.z
|
|
24
|
+
.string()
|
|
25
|
+
.date()
|
|
26
|
+
.nullish()
|
|
27
|
+
.describe('End of the date range (inclusive)'),
|
|
28
|
+
})
|
|
29
|
+
.openapi({ title: 'DateRange' });
|
|
@@ -12,19 +12,19 @@ export declare const ErrorResponseSchema: z.ZodObject<{
|
|
|
12
12
|
path: z.ZodString;
|
|
13
13
|
correlationId: z.ZodOptional<z.ZodString>;
|
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
statusCode: number;
|
|
16
|
-
message: string;
|
|
17
15
|
code: string;
|
|
18
|
-
timestamp: string;
|
|
19
16
|
path: string;
|
|
17
|
+
message: string;
|
|
18
|
+
statusCode: number;
|
|
19
|
+
timestamp: string;
|
|
20
20
|
details?: unknown;
|
|
21
21
|
correlationId?: string | undefined;
|
|
22
22
|
}, {
|
|
23
|
-
statusCode: number;
|
|
24
|
-
message: string;
|
|
25
23
|
code: string;
|
|
26
|
-
timestamp: string;
|
|
27
24
|
path: string;
|
|
25
|
+
message: string;
|
|
26
|
+
statusCode: number;
|
|
27
|
+
timestamp: string;
|
|
28
28
|
details?: unknown;
|
|
29
29
|
correlationId?: string | undefined;
|
|
30
30
|
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Common pagination query parameters schema for API requests.
|
|
4
|
+
* Provides standard page and limit parameters with sensible defaults.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PaginationQuerySchema: z.ZodObject<{
|
|
7
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
limit: number;
|
|
11
|
+
page: number;
|
|
12
|
+
}, {
|
|
13
|
+
limit?: number | undefined;
|
|
14
|
+
page?: number | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export type PaginationQuery = z.infer<typeof PaginationQuerySchema>;
|
|
17
|
+
//# sourceMappingURL=pagination-query.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination-query.schema.d.ts","sourceRoot":"","sources":["../../contracts/common/pagination-query.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaginationQuerySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Common pagination query parameters schema for API requests.
|
|
7
|
+
* Provides standard page and limit parameters with sensible defaults.
|
|
8
|
+
*/
|
|
9
|
+
exports.PaginationQuerySchema = zod_1.z.object({
|
|
10
|
+
limit: zod_1.z.coerce
|
|
11
|
+
.number()
|
|
12
|
+
.default(50)
|
|
13
|
+
.describe('The number of items to return per page.'),
|
|
14
|
+
page: zod_1.z.coerce.number().default(1).describe('The page number to retrieve.'),
|
|
15
|
+
});
|
|
@@ -7,16 +7,16 @@ export declare const createPaginatedResponseSchema: <T extends z.ZodTypeAny>(ite
|
|
|
7
7
|
currentPage: z.ZodNumber;
|
|
8
8
|
totalPages: z.ZodNumber;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
limit: number;
|
|
10
11
|
items: T["_output"][];
|
|
11
12
|
totalCount: number;
|
|
12
|
-
limit: number;
|
|
13
13
|
skip: number;
|
|
14
14
|
currentPage: number;
|
|
15
15
|
totalPages: number;
|
|
16
16
|
}, {
|
|
17
|
+
limit: number;
|
|
17
18
|
items: T["_input"][];
|
|
18
19
|
totalCount: number;
|
|
19
|
-
limit: number;
|
|
20
20
|
skip: number;
|
|
21
21
|
currentPage: number;
|
|
22
22
|
totalPages: number;
|