@softruck/api-contracts 0.1.1-beta.3
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/README.md +0 -0
- package/dist/alerts/api.d.ts +9 -0
- package/dist/alerts/api.js +8 -0
- package/dist/alerts/index.d.ts +3 -0
- package/dist/alerts/index.js +3 -0
- package/dist/alerts/schemas.d.ts +65 -0
- package/dist/alerts/schemas.js +29 -0
- package/dist/alerts/types.d.ts +36 -0
- package/dist/alerts/types.js +1 -0
- package/dist/auth/api.d.ts +26 -0
- package/dist/auth/api.js +39 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +3 -0
- package/dist/auth/schemas/access-codes.d.ts +16 -0
- package/dist/auth/schemas/access-codes.js +13 -0
- package/dist/auth/schemas/login.d.ts +13 -0
- package/dist/auth/schemas/login.js +9 -0
- package/dist/auth/schemas/passwords.d.ts +81 -0
- package/dist/auth/schemas/passwords.js +28 -0
- package/dist/auth/schemas/sessions.d.ts +3 -0
- package/dist/auth/schemas/sessions.js +2 -0
- package/dist/auth/schemas/tokens.d.ts +11 -0
- package/dist/auth/schemas/tokens.js +9 -0
- package/dist/auth/schemas.d.ts +5 -0
- package/dist/auth/schemas.js +5 -0
- package/dist/auth/types.d.ts +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/checklist/api.d.ts +30 -0
- package/dist/checklist/api.js +15 -0
- package/dist/checklist/index.d.ts +3 -0
- package/dist/checklist/index.js +3 -0
- package/dist/checklist/schemas.d.ts +62 -0
- package/dist/checklist/schemas.js +46 -0
- package/dist/checklist/types.d.ts +76 -0
- package/dist/checklist/types.js +1 -0
- package/dist/chips/api.d.ts +17 -0
- package/dist/chips/api.js +8 -0
- package/dist/chips/connections/api.d.ts +13 -0
- package/dist/chips/connections/api.js +4 -0
- package/dist/chips/connections/index.d.ts +3 -0
- package/dist/chips/connections/index.js +3 -0
- package/dist/chips/connections/schemas.d.ts +31 -0
- package/dist/chips/connections/schemas.js +31 -0
- package/dist/chips/connections/types.d.ts +26 -0
- package/dist/chips/connections/types.js +1 -0
- package/dist/chips/index.d.ts +5 -0
- package/dist/chips/index.js +5 -0
- package/dist/chips/requirements/api.d.ts +13 -0
- package/dist/chips/requirements/api.js +4 -0
- package/dist/chips/requirements/index.d.ts +3 -0
- package/dist/chips/requirements/index.js +3 -0
- package/dist/chips/requirements/schemas.d.ts +21 -0
- package/dist/chips/requirements/schemas.js +21 -0
- package/dist/chips/requirements/types.d.ts +16 -0
- package/dist/chips/requirements/types.js +1 -0
- package/dist/chips/schemas.d.ts +78 -0
- package/dist/chips/schemas.js +72 -0
- package/dist/chips/types.d.ts +76 -0
- package/dist/chips/types.js +1 -0
- package/dist/core/client.d.ts +45 -0
- package/dist/core/client.js +42 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +4 -0
- package/dist/core/query-builder.d.ts +34 -0
- package/dist/core/query-builder.js +86 -0
- package/dist/core/schemas.d.ts +80 -0
- package/dist/core/schemas.js +31 -0
- package/dist/core/types.d.ts +119 -0
- package/dist/core/types.js +2 -0
- package/dist/devices/activations/api.d.ts +20 -0
- package/dist/devices/activations/api.js +9 -0
- package/dist/devices/activations/index.d.ts +3 -0
- package/dist/devices/activations/index.js +3 -0
- package/dist/devices/activations/schemas.d.ts +42 -0
- package/dist/devices/activations/schemas.js +42 -0
- package/dist/devices/activations/types.d.ts +75 -0
- package/dist/devices/activations/types.js +1 -0
- package/dist/devices/api.d.ts +28 -0
- package/dist/devices/api.js +11 -0
- package/dist/devices/commands/api.d.ts +17 -0
- package/dist/devices/commands/api.js +8 -0
- package/dist/devices/commands/index.d.ts +3 -0
- package/dist/devices/commands/index.js +3 -0
- package/dist/devices/commands/schemas.d.ts +39 -0
- package/dist/devices/commands/schemas.js +33 -0
- package/dist/devices/commands/types.d.ts +58 -0
- package/dist/devices/commands/types.js +1 -0
- package/dist/devices/index.d.ts +5 -0
- package/dist/devices/index.js +5 -0
- package/dist/devices/schemas.d.ts +115 -0
- package/dist/devices/schemas.js +96 -0
- package/dist/devices/types.d.ts +142 -0
- package/dist/devices/types.js +1 -0
- package/dist/enterprises/api.d.ts +27 -0
- package/dist/enterprises/api.js +15 -0
- package/dist/enterprises/index.d.ts +3 -0
- package/dist/enterprises/index.js +3 -0
- package/dist/enterprises/schemas.d.ts +59 -0
- package/dist/enterprises/schemas.js +53 -0
- package/dist/enterprises/types.d.ts +160 -0
- package/dist/enterprises/types.js +1 -0
- package/dist/events/api.d.ts +18 -0
- package/dist/events/api.js +13 -0
- package/dist/events/index.d.ts +3 -0
- package/dist/events/index.js +3 -0
- package/dist/events/schemas.d.ts +262 -0
- package/dist/events/schemas.js +54 -0
- package/dist/events/types.d.ts +130 -0
- package/dist/events/types.js +1 -0
- package/dist/exports/api.d.ts +18 -0
- package/dist/exports/api.js +9 -0
- package/dist/exports/index.d.ts +3 -0
- package/dist/exports/index.js +3 -0
- package/dist/exports/schemas.d.ts +27 -0
- package/dist/exports/schemas.js +22 -0
- package/dist/exports/types.d.ts +47 -0
- package/dist/exports/types.js +1 -0
- package/dist/fuelings/api.d.ts +22 -0
- package/dist/fuelings/api.js +9 -0
- package/dist/fuelings/index.d.ts +3 -0
- package/dist/fuelings/index.js +3 -0
- package/dist/fuelings/schemas.d.ts +84 -0
- package/dist/fuelings/schemas.js +52 -0
- package/dist/fuelings/types.d.ts +80 -0
- package/dist/fuelings/types.js +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +22 -0
- package/dist/maintenances/api.d.ts +31 -0
- package/dist/maintenances/api.js +12 -0
- package/dist/maintenances/index.d.ts +3 -0
- package/dist/maintenances/index.js +3 -0
- package/dist/maintenances/schemas.d.ts +74 -0
- package/dist/maintenances/schemas.js +44 -0
- package/dist/maintenances/types.d.ts +69 -0
- package/dist/maintenances/types.js +1 -0
- package/dist/operation-logs/api.d.ts +13 -0
- package/dist/operation-logs/api.js +10 -0
- package/dist/operation-logs/index.d.ts +3 -0
- package/dist/operation-logs/index.js +3 -0
- package/dist/operation-logs/schemas.d.ts +34 -0
- package/dist/operation-logs/schemas.js +22 -0
- package/dist/operation-logs/types.d.ts +32 -0
- package/dist/operation-logs/types.js +1 -0
- package/dist/protocols/api.d.ts +34 -0
- package/dist/protocols/api.js +13 -0
- package/dist/protocols/index.d.ts +3 -0
- package/dist/protocols/index.js +3 -0
- package/dist/protocols/schemas.d.ts +66 -0
- package/dist/protocols/schemas.js +36 -0
- package/dist/protocols/types.d.ts +99 -0
- package/dist/protocols/types.js +1 -0
- package/dist/service-orders/api.d.ts +38 -0
- package/dist/service-orders/api.js +14 -0
- package/dist/service-orders/index.d.ts +3 -0
- package/dist/service-orders/index.js +3 -0
- package/dist/service-orders/schemas.d.ts +82 -0
- package/dist/service-orders/schemas.js +47 -0
- package/dist/service-orders/types.d.ts +84 -0
- package/dist/service-orders/types.js +1 -0
- package/dist/sharings/api.d.ts +17 -0
- package/dist/sharings/api.js +8 -0
- package/dist/sharings/index.d.ts +3 -0
- package/dist/sharings/index.js +3 -0
- package/dist/sharings/schemas.d.ts +47 -0
- package/dist/sharings/schemas.js +36 -0
- package/dist/sharings/types.d.ts +54 -0
- package/dist/sharings/types.js +1 -0
- package/dist/surveys/api.d.ts +2 -0
- package/dist/surveys/api.js +3 -0
- package/dist/surveys/index.d.ts +3 -0
- package/dist/surveys/index.js +3 -0
- package/dist/surveys/schemas.d.ts +33 -0
- package/dist/surveys/schemas.js +23 -0
- package/dist/surveys/types.d.ts +27 -0
- package/dist/surveys/types.js +1 -0
- package/dist/tags/api.d.ts +24 -0
- package/dist/tags/api.js +28 -0
- package/dist/tags/index.d.ts +3 -0
- package/dist/tags/index.js +3 -0
- package/dist/tags/schemas.d.ts +26 -0
- package/dist/tags/schemas.js +19 -0
- package/dist/tags/types.d.ts +16 -0
- package/dist/tags/types.js +1 -0
- package/dist/tracking/api.d.ts +2 -0
- package/dist/tracking/api.js +3 -0
- package/dist/tracking/index.d.ts +3 -0
- package/dist/tracking/index.js +3 -0
- package/dist/tracking/schemas.d.ts +12 -0
- package/dist/tracking/schemas.js +12 -0
- package/dist/tracking/types.d.ts +11 -0
- package/dist/tracking/types.js +1 -0
- package/dist/trajectories/api.d.ts +27 -0
- package/dist/trajectories/api.js +13 -0
- package/dist/trajectories/index.d.ts +3 -0
- package/dist/trajectories/index.js +3 -0
- package/dist/trajectories/schemas.d.ts +39 -0
- package/dist/trajectories/schemas.js +30 -0
- package/dist/trajectories/types.d.ts +58 -0
- package/dist/trajectories/types.js +1 -0
- package/dist/trips/api.d.ts +30 -0
- package/dist/trips/api.js +12 -0
- package/dist/trips/index.d.ts +3 -0
- package/dist/trips/index.js +3 -0
- package/dist/trips/schemas.d.ts +62 -0
- package/dist/trips/schemas.js +36 -0
- package/dist/trips/types.d.ts +65 -0
- package/dist/trips/types.js +1 -0
- package/dist/users/api.d.ts +533 -0
- package/dist/users/api.js +102 -0
- package/dist/users/configuration/api.d.ts +21 -0
- package/dist/users/configuration/api.js +16 -0
- package/dist/users/configuration/index.d.ts +3 -0
- package/dist/users/configuration/index.js +3 -0
- package/dist/users/configuration/schemas.d.ts +91 -0
- package/dist/users/configuration/schemas.js +42 -0
- package/dist/users/configuration/types.d.ts +36 -0
- package/dist/users/configuration/types.js +1 -0
- package/dist/users/index.d.ts +4 -0
- package/dist/users/index.js +4 -0
- package/dist/users/schemas/addresses.d.ts +136 -0
- package/dist/users/schemas/addresses.js +94 -0
- package/dist/users/schemas/authenticated-user.d.ts +30 -0
- package/dist/users/schemas/authenticated-user.js +21 -0
- package/dist/users/schemas/common.d.ts +28 -0
- package/dist/users/schemas/common.js +26 -0
- package/dist/users/schemas/documents.d.ts +40 -0
- package/dist/users/schemas/documents.js +53 -0
- package/dist/users/schemas/passwords.d.ts +10 -0
- package/dist/users/schemas/passwords.js +15 -0
- package/dist/users/schemas/roles.d.ts +60 -0
- package/dist/users/schemas/roles.js +9 -0
- package/dist/users/schemas/sessions.d.ts +84 -0
- package/dist/users/schemas/sessions.js +55 -0
- package/dist/users/schemas/usernames.d.ts +14 -0
- package/dist/users/schemas/usernames.js +12 -0
- package/dist/users/schemas/users.d.ts +648 -0
- package/dist/users/schemas/users.js +243 -0
- package/dist/users/schemas.d.ts +8 -0
- package/dist/users/schemas.js +8 -0
- package/dist/users/types.d.ts +1 -0
- package/dist/users/types.js +1 -0
- package/dist/vehicles/api.d.ts +28 -0
- package/dist/vehicles/api.js +13 -0
- package/dist/vehicles/index.d.ts +3 -0
- package/dist/vehicles/index.js +3 -0
- package/dist/vehicles/schemas.d.ts +88 -0
- package/dist/vehicles/schemas.js +71 -0
- package/dist/vehicles/types.d.ts +142 -0
- package/dist/vehicles/types.js +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const RoleSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
attributes: z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type Role = z.infer<typeof RoleSchema>;
|
|
9
|
+
export declare const RoleQueryParamsSchema: z.ZodObject<{
|
|
10
|
+
count: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"only">]>>;
|
|
11
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
search: z.ZodOptional<z.ZodString>;
|
|
14
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodType<"name", unknown, z.core.$ZodTypeInternals<"name", unknown>>, z.ZodLiteral<"*">]>>>;
|
|
15
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodType<"name", unknown, z.core.$ZodTypeInternals<"name", unknown>> & z.core.$partial, z.ZodUnion<readonly [z.ZodObject<{
|
|
16
|
+
operator: z.ZodEnum<{
|
|
17
|
+
in: "in";
|
|
18
|
+
eq: "eq";
|
|
19
|
+
neq: "neq";
|
|
20
|
+
gt: "gt";
|
|
21
|
+
gte: "gte";
|
|
22
|
+
lt: "lt";
|
|
23
|
+
lte: "lte";
|
|
24
|
+
btw: "btw";
|
|
25
|
+
nbtw: "nbtw";
|
|
26
|
+
ilk: "ilk";
|
|
27
|
+
ew: "ew";
|
|
28
|
+
sw: "sw";
|
|
29
|
+
nin: "nin";
|
|
30
|
+
is: "is";
|
|
31
|
+
}>;
|
|
32
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
33
|
+
}, z.core.$strict>, z.ZodArray<z.ZodObject<{
|
|
34
|
+
operator: z.ZodEnum<{
|
|
35
|
+
in: "in";
|
|
36
|
+
eq: "eq";
|
|
37
|
+
neq: "neq";
|
|
38
|
+
gt: "gt";
|
|
39
|
+
gte: "gte";
|
|
40
|
+
lt: "lt";
|
|
41
|
+
lte: "lte";
|
|
42
|
+
btw: "btw";
|
|
43
|
+
nbtw: "nbtw";
|
|
44
|
+
ilk: "ilk";
|
|
45
|
+
ew: "ew";
|
|
46
|
+
sw: "sw";
|
|
47
|
+
nin: "nin";
|
|
48
|
+
is: "is";
|
|
49
|
+
}>;
|
|
50
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
51
|
+
}, z.core.$strict>>]>>>;
|
|
52
|
+
sort: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
prop: z.ZodType<"name", unknown, z.core.$ZodTypeInternals<"name", unknown>>;
|
|
54
|
+
order: z.ZodEnum<{
|
|
55
|
+
ASC: "ASC";
|
|
56
|
+
DESC: "DESC";
|
|
57
|
+
}>;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
export type RoleQueryParams = z.infer<typeof RoleQueryParamsSchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeQueryParamsSchema } from '../../core/schemas.js';
|
|
3
|
+
import { RoleAttributesSchema } from './common.js';
|
|
4
|
+
export const RoleSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
attributes: RoleAttributesSchema,
|
|
7
|
+
});
|
|
8
|
+
const RoleAttributeKeySchema = RoleSchema.shape.attributes.keyof();
|
|
9
|
+
export const RoleQueryParamsSchema = makeQueryParamsSchema(RoleAttributeKeySchema);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UserSessionSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodOptional<z.ZodLiteral<"user_sessions">>;
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
6
|
+
attributes: z.ZodObject<{
|
|
7
|
+
os_name: z.ZodNullable<z.ZodString>;
|
|
8
|
+
os_version: z.ZodNullable<z.ZodString>;
|
|
9
|
+
browser: z.ZodNullable<z.ZodString>;
|
|
10
|
+
browser_version: z.ZodNullable<z.ZodString>;
|
|
11
|
+
last_seen_ip: z.ZodNullable<z.ZodString>;
|
|
12
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
13
|
+
issued_at: z.ZodNullable<z.ZodString>;
|
|
14
|
+
refreshes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
15
|
+
user_agent_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
device: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
device_model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
screen: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
connection: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
platform: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
currentSession: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
relationships: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"user">;
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type UserSession = z.infer<typeof UserSessionSchema>;
|
|
33
|
+
export declare const SessionQueryParamsSchema: z.ZodObject<{
|
|
34
|
+
count: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"only">]>>;
|
|
35
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
search: z.ZodOptional<z.ZodString>;
|
|
38
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodType<"platform" | "screen" | "browser" | "created_at" | "updated_at" | "refreshes" | "user_agent_name" | "device" | "device_model" | "browser_version" | "os_name" | "os_version" | "connection" | "last_seen_ip" | "issued_at" | "expires_at", unknown, z.core.$ZodTypeInternals<"platform" | "screen" | "browser" | "created_at" | "updated_at" | "refreshes" | "user_agent_name" | "device" | "device_model" | "browser_version" | "os_name" | "os_version" | "connection" | "last_seen_ip" | "issued_at" | "expires_at", unknown>>, z.ZodLiteral<"*">]>>>;
|
|
39
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodType<"platform" | "screen" | "browser" | "created_at" | "updated_at" | "refreshes" | "user_agent_name" | "device" | "device_model" | "browser_version" | "os_name" | "os_version" | "connection" | "last_seen_ip" | "issued_at" | "expires_at", unknown, z.core.$ZodTypeInternals<"platform" | "screen" | "browser" | "created_at" | "updated_at" | "refreshes" | "user_agent_name" | "device" | "device_model" | "browser_version" | "os_name" | "os_version" | "connection" | "last_seen_ip" | "issued_at" | "expires_at", unknown>> & z.core.$partial, z.ZodUnion<readonly [z.ZodObject<{
|
|
40
|
+
operator: z.ZodEnum<{
|
|
41
|
+
in: "in";
|
|
42
|
+
eq: "eq";
|
|
43
|
+
neq: "neq";
|
|
44
|
+
gt: "gt";
|
|
45
|
+
gte: "gte";
|
|
46
|
+
lt: "lt";
|
|
47
|
+
lte: "lte";
|
|
48
|
+
btw: "btw";
|
|
49
|
+
nbtw: "nbtw";
|
|
50
|
+
ilk: "ilk";
|
|
51
|
+
ew: "ew";
|
|
52
|
+
sw: "sw";
|
|
53
|
+
nin: "nin";
|
|
54
|
+
is: "is";
|
|
55
|
+
}>;
|
|
56
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
57
|
+
}, z.core.$strict>, z.ZodArray<z.ZodObject<{
|
|
58
|
+
operator: z.ZodEnum<{
|
|
59
|
+
in: "in";
|
|
60
|
+
eq: "eq";
|
|
61
|
+
neq: "neq";
|
|
62
|
+
gt: "gt";
|
|
63
|
+
gte: "gte";
|
|
64
|
+
lt: "lt";
|
|
65
|
+
lte: "lte";
|
|
66
|
+
btw: "btw";
|
|
67
|
+
nbtw: "nbtw";
|
|
68
|
+
ilk: "ilk";
|
|
69
|
+
ew: "ew";
|
|
70
|
+
sw: "sw";
|
|
71
|
+
nin: "nin";
|
|
72
|
+
is: "is";
|
|
73
|
+
}>;
|
|
74
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
75
|
+
}, z.core.$strict>>]>>>;
|
|
76
|
+
sort: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
prop: z.ZodType<"platform" | "screen" | "browser" | "created_at" | "updated_at" | "refreshes" | "user_agent_name" | "device" | "device_model" | "browser_version" | "os_name" | "os_version" | "connection" | "last_seen_ip" | "issued_at" | "expires_at", unknown, z.core.$ZodTypeInternals<"platform" | "screen" | "browser" | "created_at" | "updated_at" | "refreshes" | "user_agent_name" | "device" | "device_model" | "browser_version" | "os_name" | "os_version" | "connection" | "last_seen_ip" | "issued_at" | "expires_at", unknown>>;
|
|
78
|
+
order: z.ZodEnum<{
|
|
79
|
+
ASC: "ASC";
|
|
80
|
+
DESC: "DESC";
|
|
81
|
+
}>;
|
|
82
|
+
}, z.core.$strict>>;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
export type SessionQueryParams = z.infer<typeof SessionQueryParamsSchema>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeQueryParamsSchema } from '../../core/schemas.js';
|
|
3
|
+
const SessionAttributeKeySchema = z.enum([
|
|
4
|
+
'refreshes',
|
|
5
|
+
'user_agent_name',
|
|
6
|
+
'device',
|
|
7
|
+
'device_model',
|
|
8
|
+
'browser',
|
|
9
|
+
'browser_version',
|
|
10
|
+
'os_name',
|
|
11
|
+
'os_version',
|
|
12
|
+
'screen',
|
|
13
|
+
'connection',
|
|
14
|
+
'platform',
|
|
15
|
+
'last_seen_ip',
|
|
16
|
+
'issued_at',
|
|
17
|
+
'expires_at',
|
|
18
|
+
'created_at',
|
|
19
|
+
'updated_at',
|
|
20
|
+
]);
|
|
21
|
+
export const UserSessionSchema = z.object({
|
|
22
|
+
type: z.literal('user_sessions').optional(),
|
|
23
|
+
id: z.string(),
|
|
24
|
+
uuid: z.string().optional(),
|
|
25
|
+
attributes: z.object({
|
|
26
|
+
os_name: z.string().nullable(),
|
|
27
|
+
os_version: z.string().nullable(),
|
|
28
|
+
browser: z.string().nullable(),
|
|
29
|
+
browser_version: z.string().nullable(),
|
|
30
|
+
last_seen_ip: z.string().nullable(),
|
|
31
|
+
created_at: z.string().nullable(),
|
|
32
|
+
issued_at: z.string().nullable(),
|
|
33
|
+
refreshes: z.number().nullable().optional(),
|
|
34
|
+
user_agent_name: z.string().nullable().optional(),
|
|
35
|
+
device: z.string().nullable().optional(),
|
|
36
|
+
device_model: z.string().nullable().optional(),
|
|
37
|
+
screen: z.string().nullable().optional(),
|
|
38
|
+
connection: z.string().nullable().optional(),
|
|
39
|
+
platform: z.string().nullable().optional(),
|
|
40
|
+
expires_at: z.string().nullable().optional(),
|
|
41
|
+
updated_at: z.string().nullable().optional(),
|
|
42
|
+
currentSession: z.boolean().optional(),
|
|
43
|
+
}),
|
|
44
|
+
relationships: z
|
|
45
|
+
.object({
|
|
46
|
+
user: z
|
|
47
|
+
.object({
|
|
48
|
+
type: z.literal('user'),
|
|
49
|
+
id: z.string(),
|
|
50
|
+
})
|
|
51
|
+
.optional(),
|
|
52
|
+
})
|
|
53
|
+
.optional(),
|
|
54
|
+
});
|
|
55
|
+
export const SessionQueryParamsSchema = makeQueryParamsSchema(SessionAttributeKeySchema);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CheckUsernamePayloadSchema: z.ZodObject<{
|
|
3
|
+
data: z.ZodObject<{
|
|
4
|
+
usernames: z.ZodArray<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type CheckUsernamePayload = z.infer<typeof CheckUsernamePayloadSchema>;
|
|
8
|
+
export declare const CheckUsernameResponseSchema: z.ZodObject<{
|
|
9
|
+
data: z.ZodArray<z.ZodObject<{
|
|
10
|
+
username: z.ZodString;
|
|
11
|
+
isTaken: z.ZodBoolean;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type CheckUsernameResponse = z.infer<typeof CheckUsernameResponseSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const CheckUsernamePayloadSchema = z.object({
|
|
3
|
+
data: z.object({
|
|
4
|
+
usernames: z.array(z.string()).min(1).max(1000),
|
|
5
|
+
}),
|
|
6
|
+
});
|
|
7
|
+
export const CheckUsernameResponseSchema = z.object({
|
|
8
|
+
data: z.array(z.object({
|
|
9
|
+
username: z.string(),
|
|
10
|
+
isTaken: z.boolean(),
|
|
11
|
+
})),
|
|
12
|
+
});
|