@deepintel-ltd/farmpro-contracts 1.11.4 → 1.11.5
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/routes/admin.routes.d.ts +334 -618
- package/dist/routes/admin.routes.d.ts.map +1 -1
- package/dist/routes/admin.routes.js +26 -36
- package/dist/schemas/admin.schemas.d.ts +45 -6
- package/dist/schemas/admin.schemas.d.ts.map +1 -1
- package/dist/schemas/admin.schemas.js +15 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.routes.d.ts","sourceRoot":"","sources":["../../src/routes/admin.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.routes.d.ts","sourceRoot":"","sources":["../../src/routes/admin.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkKtB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { initContract } from '@ts-rest/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { adminCreateUserSchema, adminLoginLinkResponseSchema, adminUserListResponseSchema, autonomousMonitoringStatsResponseSchema,
|
|
3
|
+
import { adminCreateUserSchema, adminInviteUserSchema, adminLoginLinkResponseSchema, adminUserListResponseSchema, autonomousMonitoringStatsResponseSchema, impersonationResponseSchema, updatePlatformRoleSchema, } from '../schemas/admin.schemas';
|
|
4
4
|
import { userResponseSchema } from '../schemas/users.schemas';
|
|
5
5
|
import { idParamSchema, jsonApiErrorResponseSchema, jsonApiPaginationQuerySchema, jsonApiSuccessResponseSchema, } from '../schemas/common.schemas';
|
|
6
6
|
const c = initContract();
|
|
@@ -26,6 +26,7 @@ export const adminRouter = c.router({
|
|
|
26
26
|
path: '/admin/users',
|
|
27
27
|
query: jsonApiPaginationQuerySchema.extend({
|
|
28
28
|
q: z.string().optional(),
|
|
29
|
+
'filter[platformRole]': z.enum(['super_admin']).optional(),
|
|
29
30
|
}),
|
|
30
31
|
responses: {
|
|
31
32
|
200: adminUserListResponseSchema,
|
|
@@ -34,7 +35,7 @@ export const adminRouter = c.router({
|
|
|
34
35
|
500: jsonApiErrorResponseSchema,
|
|
35
36
|
},
|
|
36
37
|
summary: 'List users (platform admin)',
|
|
37
|
-
description: 'Search and paginate platform users. Restricted to super admins.',
|
|
38
|
+
description: 'Search and paginate platform users. Optional filter[platformRole]=super_admin. Restricted to super admins.',
|
|
38
39
|
},
|
|
39
40
|
createUser: {
|
|
40
41
|
method: 'POST',
|
|
@@ -52,25 +53,10 @@ export const adminRouter = c.router({
|
|
|
52
53
|
summary: 'Create user (platform admin)',
|
|
53
54
|
description: 'Provision a platform user with email and password. Restricted to super admins.',
|
|
54
55
|
},
|
|
55
|
-
|
|
56
|
+
inviteUser: {
|
|
56
57
|
method: 'POST',
|
|
57
|
-
path: '/admin/users
|
|
58
|
-
|
|
59
|
-
body: z.object({}),
|
|
60
|
-
responses: {
|
|
61
|
-
201: adminLoginLinkResponseSchema,
|
|
62
|
-
401: jsonApiErrorResponseSchema,
|
|
63
|
-
403: jsonApiErrorResponseSchema,
|
|
64
|
-
404: jsonApiErrorResponseSchema,
|
|
65
|
-
500: jsonApiErrorResponseSchema,
|
|
66
|
-
},
|
|
67
|
-
summary: 'Create one-time login link (platform admin)',
|
|
68
|
-
description: 'Mint a short-lived, single-use login URL for a user. Restricted to super admins.',
|
|
69
|
-
},
|
|
70
|
-
inviteSuperAdmin: {
|
|
71
|
-
method: 'POST',
|
|
72
|
-
path: '/admin/super-admins',
|
|
73
|
-
body: z.object({ data: inviteSuperAdminSchema }),
|
|
58
|
+
path: '/admin/users/invites',
|
|
59
|
+
body: z.object({ data: adminInviteUserSchema }),
|
|
74
60
|
responses: {
|
|
75
61
|
201: userResponseSchema,
|
|
76
62
|
400: jsonApiErrorResponseSchema,
|
|
@@ -80,12 +66,12 @@ export const adminRouter = c.router({
|
|
|
80
66
|
422: jsonApiErrorResponseSchema,
|
|
81
67
|
500: jsonApiErrorResponseSchema,
|
|
82
68
|
},
|
|
83
|
-
summary: 'Invite a
|
|
84
|
-
description: 'Invite by name+email.
|
|
69
|
+
summary: 'Invite a user (no password)',
|
|
70
|
+
description: 'Invite by name+email. Optionally grant platformRole (e.g. super_admin). Invitee sets password via email.',
|
|
85
71
|
},
|
|
86
|
-
|
|
72
|
+
resendInvite: {
|
|
87
73
|
method: 'POST',
|
|
88
|
-
path: '/admin/
|
|
74
|
+
path: '/admin/users/:id/resend-invite',
|
|
89
75
|
pathParams: idParamSchema,
|
|
90
76
|
body: z.object({}),
|
|
91
77
|
responses: {
|
|
@@ -96,33 +82,37 @@ export const adminRouter = c.router({
|
|
|
96
82
|
404: jsonApiErrorResponseSchema,
|
|
97
83
|
500: jsonApiErrorResponseSchema,
|
|
98
84
|
},
|
|
99
|
-
summary: 'Resend
|
|
85
|
+
summary: 'Resend pending invite email',
|
|
100
86
|
},
|
|
101
|
-
|
|
102
|
-
method: '
|
|
103
|
-
path: '/admin/
|
|
87
|
+
updatePlatformRole: {
|
|
88
|
+
method: 'PATCH',
|
|
89
|
+
path: '/admin/users/:id/platform-role',
|
|
104
90
|
pathParams: idParamSchema,
|
|
91
|
+
body: z.object({ data: updatePlatformRoleSchema }),
|
|
105
92
|
responses: {
|
|
106
|
-
200:
|
|
93
|
+
200: userResponseSchema,
|
|
107
94
|
400: jsonApiErrorResponseSchema,
|
|
108
95
|
401: jsonApiErrorResponseSchema,
|
|
109
96
|
403: jsonApiErrorResponseSchema,
|
|
110
97
|
404: jsonApiErrorResponseSchema,
|
|
111
98
|
500: jsonApiErrorResponseSchema,
|
|
112
99
|
},
|
|
113
|
-
summary: '
|
|
100
|
+
summary: 'Set or clear a user platform role',
|
|
114
101
|
},
|
|
115
|
-
|
|
116
|
-
method: '
|
|
117
|
-
path: '/admin/
|
|
118
|
-
|
|
102
|
+
createLoginLink: {
|
|
103
|
+
method: 'POST',
|
|
104
|
+
path: '/admin/users/:id/login-link',
|
|
105
|
+
pathParams: idParamSchema,
|
|
106
|
+
body: z.object({}),
|
|
119
107
|
responses: {
|
|
120
|
-
|
|
108
|
+
201: adminLoginLinkResponseSchema,
|
|
121
109
|
401: jsonApiErrorResponseSchema,
|
|
122
110
|
403: jsonApiErrorResponseSchema,
|
|
111
|
+
404: jsonApiErrorResponseSchema,
|
|
123
112
|
500: jsonApiErrorResponseSchema,
|
|
124
113
|
},
|
|
125
|
-
summary: '
|
|
114
|
+
summary: 'Create one-time login link (platform admin)',
|
|
115
|
+
description: 'Mint a short-lived, single-use login URL for a user. Restricted to super admins.',
|
|
126
116
|
},
|
|
127
117
|
impersonateUser: {
|
|
128
118
|
method: 'POST',
|
|
@@ -496,39 +496,77 @@ export declare const adminLoginLinkResponseSchema: z.ZodObject<{
|
|
|
496
496
|
meta?: Record<string, unknown> | undefined;
|
|
497
497
|
}[] | undefined;
|
|
498
498
|
}>;
|
|
499
|
-
export declare const
|
|
499
|
+
export declare const adminInviteUserAttributesSchema: z.ZodObject<{
|
|
500
500
|
name: z.ZodString;
|
|
501
501
|
email: z.ZodString;
|
|
502
|
+
/** Role to grant on invite. Extensible later without a new resource. */
|
|
503
|
+
platformRole: z.ZodDefault<z.ZodEnum<["super_admin"]>>;
|
|
502
504
|
}, "strip", z.ZodTypeAny, {
|
|
503
505
|
email: string;
|
|
504
506
|
name: string;
|
|
507
|
+
platformRole: "super_admin";
|
|
505
508
|
}, {
|
|
506
509
|
email: string;
|
|
507
510
|
name: string;
|
|
511
|
+
platformRole?: "super_admin" | undefined;
|
|
508
512
|
}>;
|
|
509
|
-
export declare const
|
|
510
|
-
type: z.ZodLiteral<"
|
|
513
|
+
export declare const adminInviteUserSchema: z.ZodObject<{
|
|
514
|
+
type: z.ZodLiteral<"user-invites">;
|
|
511
515
|
attributes: z.ZodObject<{
|
|
512
516
|
name: z.ZodString;
|
|
513
517
|
email: z.ZodString;
|
|
518
|
+
/** Role to grant on invite. Extensible later without a new resource. */
|
|
519
|
+
platformRole: z.ZodDefault<z.ZodEnum<["super_admin"]>>;
|
|
514
520
|
}, "strip", z.ZodTypeAny, {
|
|
515
521
|
email: string;
|
|
516
522
|
name: string;
|
|
523
|
+
platformRole: "super_admin";
|
|
517
524
|
}, {
|
|
518
525
|
email: string;
|
|
519
526
|
name: string;
|
|
527
|
+
platformRole?: "super_admin" | undefined;
|
|
520
528
|
}>;
|
|
521
529
|
}, "strip", z.ZodTypeAny, {
|
|
522
|
-
type: "
|
|
530
|
+
type: "user-invites";
|
|
523
531
|
attributes: {
|
|
524
532
|
email: string;
|
|
525
533
|
name: string;
|
|
534
|
+
platformRole: "super_admin";
|
|
526
535
|
};
|
|
527
536
|
}, {
|
|
528
|
-
type: "
|
|
537
|
+
type: "user-invites";
|
|
529
538
|
attributes: {
|
|
530
539
|
email: string;
|
|
531
540
|
name: string;
|
|
541
|
+
platformRole?: "super_admin" | undefined;
|
|
542
|
+
};
|
|
543
|
+
}>;
|
|
544
|
+
/** Grant or clear platform role on an existing user. */
|
|
545
|
+
export declare const updatePlatformRoleAttributesSchema: z.ZodObject<{
|
|
546
|
+
platformRole: z.ZodNullable<z.ZodEnum<["super_admin"]>>;
|
|
547
|
+
}, "strip", z.ZodTypeAny, {
|
|
548
|
+
platformRole: "super_admin" | null;
|
|
549
|
+
}, {
|
|
550
|
+
platformRole: "super_admin" | null;
|
|
551
|
+
}>;
|
|
552
|
+
export declare const updatePlatformRoleSchema: z.ZodObject<{
|
|
553
|
+
type: z.ZodLiteral<"users">;
|
|
554
|
+
attributes: z.ZodObject<{
|
|
555
|
+
platformRole: z.ZodNullable<z.ZodEnum<["super_admin"]>>;
|
|
556
|
+
}, "strip", z.ZodTypeAny, {
|
|
557
|
+
platformRole: "super_admin" | null;
|
|
558
|
+
}, {
|
|
559
|
+
platformRole: "super_admin" | null;
|
|
560
|
+
}>;
|
|
561
|
+
}, "strip", z.ZodTypeAny, {
|
|
562
|
+
type: "users";
|
|
563
|
+
attributes: {
|
|
564
|
+
platformRole: "super_admin" | null;
|
|
565
|
+
};
|
|
566
|
+
}, {
|
|
567
|
+
type: "users";
|
|
568
|
+
attributes: {
|
|
569
|
+
platformRole: "super_admin" | null;
|
|
532
570
|
};
|
|
533
571
|
}>;
|
|
534
572
|
export declare const acceptAdminInviteAttributesSchema: z.ZodObject<{
|
|
@@ -1868,7 +1906,8 @@ export type AdminCreateUserResponse = z.infer<typeof userResponseSchema>;
|
|
|
1868
1906
|
export type AdminUserListAttributes = z.infer<typeof adminUserListAttributesSchema>;
|
|
1869
1907
|
export type AdminUserListResponse = z.infer<typeof adminUserListResponseSchema>;
|
|
1870
1908
|
export type AdminLoginLinkResponse = z.infer<typeof adminLoginLinkResponseSchema>;
|
|
1871
|
-
export type
|
|
1909
|
+
export type AdminInviteUserInput = z.infer<typeof adminInviteUserSchema>;
|
|
1910
|
+
export type UpdatePlatformRoleInput = z.infer<typeof updatePlatformRoleSchema>;
|
|
1872
1911
|
export type AcceptAdminInviteInput = z.infer<typeof acceptAdminInviteSchema>;
|
|
1873
1912
|
export type ImpersonationResponse = z.infer<typeof impersonationResponseSchema>;
|
|
1874
1913
|
export type SourceStats = z.infer<typeof sourceStatsSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/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AAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,yCAAyC,CACjD,CAAC;AACF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,uCAAuC,CAC/C,CAAC"}
|
|
@@ -33,14 +33,24 @@ export const adminLoginLinkAttributesSchema = z.object({
|
|
|
33
33
|
});
|
|
34
34
|
export const adminLoginLinkResourceSchema = createJsonApiResourceSchema('login-links', adminLoginLinkAttributesSchema);
|
|
35
35
|
export const adminLoginLinkResponseSchema = jsonApiSingleResponseSchema(adminLoginLinkResourceSchema);
|
|
36
|
-
// Invite
|
|
37
|
-
export const
|
|
36
|
+
// Invite user by email (no password). Currently used to mint super admins.
|
|
37
|
+
export const adminInviteUserAttributesSchema = z.object({
|
|
38
38
|
name: z.string().min(1).max(200),
|
|
39
39
|
email: z.string().email(),
|
|
40
|
+
/** Role to grant on invite. Extensible later without a new resource. */
|
|
41
|
+
platformRole: z.enum(['super_admin']).default('super_admin'),
|
|
40
42
|
});
|
|
41
|
-
export const
|
|
42
|
-
type: z.literal('
|
|
43
|
-
attributes:
|
|
43
|
+
export const adminInviteUserSchema = z.object({
|
|
44
|
+
type: z.literal('user-invites'),
|
|
45
|
+
attributes: adminInviteUserAttributesSchema,
|
|
46
|
+
});
|
|
47
|
+
/** Grant or clear platform role on an existing user. */
|
|
48
|
+
export const updatePlatformRoleAttributesSchema = z.object({
|
|
49
|
+
platformRole: z.enum(['super_admin']).nullable(),
|
|
50
|
+
});
|
|
51
|
+
export const updatePlatformRoleSchema = z.object({
|
|
52
|
+
type: z.literal('users'),
|
|
53
|
+
attributes: updatePlatformRoleAttributesSchema,
|
|
44
54
|
});
|
|
45
55
|
export const acceptAdminInviteAttributesSchema = z.object({
|
|
46
56
|
token: z.string().min(1),
|