@deepintel-ltd/farmpro-contracts 1.8.0 → 1.10.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.
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/routes/academy.routes.d.ts +575 -0
- package/dist/routes/academy.routes.d.ts.map +1 -0
- package/dist/routes/academy.routes.js +27 -0
- package/dist/routes/admin.routes.d.ts +755 -0
- package/dist/routes/admin.routes.d.ts.map +1 -1
- package/dist/routes/admin.routes.js +18 -1
- package/dist/routes/device-gateway-admin.routes.d.ts +378 -3
- package/dist/routes/device-gateway-admin.routes.d.ts.map +1 -1
- package/dist/routes/device-gateway-admin.routes.js +19 -4
- package/dist/routes/farm-gateway-device.routes.d.ts +46 -0
- package/dist/routes/farm-gateway-device.routes.d.ts.map +1 -0
- package/dist/routes/farm-gateway-device.routes.js +15 -0
- package/dist/routes/farm-gateway.routes.d.ts +302 -0
- package/dist/routes/farm-gateway.routes.d.ts.map +1 -0
- package/dist/routes/farm-gateway.routes.js +51 -0
- package/dist/routes/index.d.ts +9 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +6 -0
- package/dist/routes/organizations.routes.d.ts +8 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -1
- package/dist/routes/users.routes.d.ts +14 -0
- package/dist/routes/users.routes.d.ts.map +1 -1
- package/dist/schemas/academy.schemas.d.ts +343 -0
- package/dist/schemas/academy.schemas.d.ts.map +1 -0
- package/dist/schemas/academy.schemas.js +27 -0
- package/dist/schemas/admin.schemas.d.ts +55 -0
- package/dist/schemas/admin.schemas.d.ts.map +1 -1
- package/dist/schemas/admin.schemas.js +7 -0
- package/dist/schemas/device-gateway.schemas.d.ts +361 -0
- package/dist/schemas/device-gateway.schemas.d.ts.map +1 -1
- package/dist/schemas/device-gateway.schemas.js +28 -0
- package/dist/schemas/farm-gateway.schemas.d.ts +232 -0
- package/dist/schemas/farm-gateway.schemas.d.ts.map +1 -0
- package/dist/schemas/farm-gateway.schemas.js +45 -0
- package/dist/schemas/organizations.schemas.d.ts +25 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -1
- package/dist/schemas/organizations.schemas.js +13 -1
- package/dist/schemas/users.schemas.d.ts +15 -0
- package/dist/schemas/users.schemas.d.ts.map +1 -1
- package/dist/schemas/users.schemas.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const farmGatewayErrorSchema: z.ZodObject<{
|
|
3
|
+
message: z.ZodString;
|
|
4
|
+
code: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
code: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}, {
|
|
9
|
+
code: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const createFarmGatewayRequestSchema: z.ZodObject<{
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
name: string;
|
|
16
|
+
}, {
|
|
17
|
+
name: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const createFarmGatewayResponseSchema: z.ZodObject<{
|
|
20
|
+
gateway: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
farmId: z.ZodString;
|
|
24
|
+
createdAt: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
id: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
name: string;
|
|
29
|
+
farmId: string;
|
|
30
|
+
}, {
|
|
31
|
+
id: string;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
name: string;
|
|
34
|
+
farmId: string;
|
|
35
|
+
}>;
|
|
36
|
+
apiKey: z.ZodString;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
gateway: {
|
|
39
|
+
id: string;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
name: string;
|
|
42
|
+
farmId: string;
|
|
43
|
+
};
|
|
44
|
+
apiKey: string;
|
|
45
|
+
}, {
|
|
46
|
+
gateway: {
|
|
47
|
+
id: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
name: string;
|
|
50
|
+
farmId: string;
|
|
51
|
+
};
|
|
52
|
+
apiKey: string;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const farmGatewaySummarySchema: z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
farmId: z.ZodString;
|
|
58
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
59
|
+
firmwareVersion: z.ZodNullable<z.ZodString>;
|
|
60
|
+
isOnline: z.ZodBoolean;
|
|
61
|
+
deviceCount: z.ZodNumber;
|
|
62
|
+
onlineDeviceCount: z.ZodNumber;
|
|
63
|
+
createdAt: z.ZodString;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
id: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
name: string;
|
|
68
|
+
farmId: string;
|
|
69
|
+
firmwareVersion: string | null;
|
|
70
|
+
lastSeenAt: string | null;
|
|
71
|
+
isOnline: boolean;
|
|
72
|
+
deviceCount: number;
|
|
73
|
+
onlineDeviceCount: number;
|
|
74
|
+
}, {
|
|
75
|
+
id: string;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
name: string;
|
|
78
|
+
farmId: string;
|
|
79
|
+
firmwareVersion: string | null;
|
|
80
|
+
lastSeenAt: string | null;
|
|
81
|
+
isOnline: boolean;
|
|
82
|
+
deviceCount: number;
|
|
83
|
+
onlineDeviceCount: number;
|
|
84
|
+
}>;
|
|
85
|
+
export declare const listFarmGatewaysResponseSchema: z.ZodObject<{
|
|
86
|
+
gateways: z.ZodArray<z.ZodObject<{
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
farmId: z.ZodString;
|
|
90
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
91
|
+
firmwareVersion: z.ZodNullable<z.ZodString>;
|
|
92
|
+
isOnline: z.ZodBoolean;
|
|
93
|
+
deviceCount: z.ZodNumber;
|
|
94
|
+
onlineDeviceCount: z.ZodNumber;
|
|
95
|
+
createdAt: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
id: string;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
name: string;
|
|
100
|
+
farmId: string;
|
|
101
|
+
firmwareVersion: string | null;
|
|
102
|
+
lastSeenAt: string | null;
|
|
103
|
+
isOnline: boolean;
|
|
104
|
+
deviceCount: number;
|
|
105
|
+
onlineDeviceCount: number;
|
|
106
|
+
}, {
|
|
107
|
+
id: string;
|
|
108
|
+
createdAt: string;
|
|
109
|
+
name: string;
|
|
110
|
+
farmId: string;
|
|
111
|
+
firmwareVersion: string | null;
|
|
112
|
+
lastSeenAt: string | null;
|
|
113
|
+
isOnline: boolean;
|
|
114
|
+
deviceCount: number;
|
|
115
|
+
onlineDeviceCount: number;
|
|
116
|
+
}>, "many">;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
gateways: {
|
|
119
|
+
id: string;
|
|
120
|
+
createdAt: string;
|
|
121
|
+
name: string;
|
|
122
|
+
farmId: string;
|
|
123
|
+
firmwareVersion: string | null;
|
|
124
|
+
lastSeenAt: string | null;
|
|
125
|
+
isOnline: boolean;
|
|
126
|
+
deviceCount: number;
|
|
127
|
+
onlineDeviceCount: number;
|
|
128
|
+
}[];
|
|
129
|
+
}, {
|
|
130
|
+
gateways: {
|
|
131
|
+
id: string;
|
|
132
|
+
createdAt: string;
|
|
133
|
+
name: string;
|
|
134
|
+
farmId: string;
|
|
135
|
+
firmwareVersion: string | null;
|
|
136
|
+
lastSeenAt: string | null;
|
|
137
|
+
isOnline: boolean;
|
|
138
|
+
deviceCount: number;
|
|
139
|
+
onlineDeviceCount: number;
|
|
140
|
+
}[];
|
|
141
|
+
}>;
|
|
142
|
+
export declare const updateFarmGatewayRequestSchema: z.ZodObject<{
|
|
143
|
+
name: z.ZodString;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
name: string;
|
|
146
|
+
}, {
|
|
147
|
+
name: string;
|
|
148
|
+
}>;
|
|
149
|
+
export declare const updateFarmGatewayResponseSchema: z.ZodObject<{
|
|
150
|
+
gateway: z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
farmId: z.ZodString;
|
|
154
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
155
|
+
firmwareVersion: z.ZodNullable<z.ZodString>;
|
|
156
|
+
isOnline: z.ZodBoolean;
|
|
157
|
+
deviceCount: z.ZodNumber;
|
|
158
|
+
onlineDeviceCount: z.ZodNumber;
|
|
159
|
+
createdAt: z.ZodString;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
id: string;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
name: string;
|
|
164
|
+
farmId: string;
|
|
165
|
+
firmwareVersion: string | null;
|
|
166
|
+
lastSeenAt: string | null;
|
|
167
|
+
isOnline: boolean;
|
|
168
|
+
deviceCount: number;
|
|
169
|
+
onlineDeviceCount: number;
|
|
170
|
+
}, {
|
|
171
|
+
id: string;
|
|
172
|
+
createdAt: string;
|
|
173
|
+
name: string;
|
|
174
|
+
farmId: string;
|
|
175
|
+
firmwareVersion: string | null;
|
|
176
|
+
lastSeenAt: string | null;
|
|
177
|
+
isOnline: boolean;
|
|
178
|
+
deviceCount: number;
|
|
179
|
+
onlineDeviceCount: number;
|
|
180
|
+
}>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
gateway: {
|
|
183
|
+
id: string;
|
|
184
|
+
createdAt: string;
|
|
185
|
+
name: string;
|
|
186
|
+
farmId: string;
|
|
187
|
+
firmwareVersion: string | null;
|
|
188
|
+
lastSeenAt: string | null;
|
|
189
|
+
isOnline: boolean;
|
|
190
|
+
deviceCount: number;
|
|
191
|
+
onlineDeviceCount: number;
|
|
192
|
+
};
|
|
193
|
+
}, {
|
|
194
|
+
gateway: {
|
|
195
|
+
id: string;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
name: string;
|
|
198
|
+
farmId: string;
|
|
199
|
+
firmwareVersion: string | null;
|
|
200
|
+
lastSeenAt: string | null;
|
|
201
|
+
isOnline: boolean;
|
|
202
|
+
deviceCount: number;
|
|
203
|
+
onlineDeviceCount: number;
|
|
204
|
+
};
|
|
205
|
+
}>;
|
|
206
|
+
export declare const gatewayHeartbeatRequestSchema: z.ZodObject<{
|
|
207
|
+
gatewayId: z.ZodString;
|
|
208
|
+
firmwareVersion: z.ZodOptional<z.ZodString>;
|
|
209
|
+
relayedDeviceCount: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
wanConnected: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
|
212
|
+
gatewayId: string;
|
|
213
|
+
firmwareVersion?: string | undefined;
|
|
214
|
+
relayedDeviceCount?: number | undefined;
|
|
215
|
+
wanConnected?: boolean | undefined;
|
|
216
|
+
}, {
|
|
217
|
+
gatewayId: string;
|
|
218
|
+
firmwareVersion?: string | undefined;
|
|
219
|
+
relayedDeviceCount?: number | undefined;
|
|
220
|
+
wanConnected?: boolean | undefined;
|
|
221
|
+
}>;
|
|
222
|
+
export declare const gatewayHeartbeatResponseSchema: z.ZodObject<{
|
|
223
|
+
serverTime: z.ZodString;
|
|
224
|
+
farmId: z.ZodString;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
farmId: string;
|
|
227
|
+
serverTime: string;
|
|
228
|
+
}, {
|
|
229
|
+
farmId: string;
|
|
230
|
+
serverTime: string;
|
|
231
|
+
}>;
|
|
232
|
+
//# sourceMappingURL=farm-gateway.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"farm-gateway.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/farm-gateway.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,sBAAsB;;;;;;;;;EAAoB,CAAC;AAExD,eAAO,MAAM,8BAA8B;;;;;;EAEzC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ1C,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUnC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEzC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;EAEzC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1C,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;EAKxC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deviceErrorSchema } from './device-gateway.schemas';
|
|
3
|
+
export const farmGatewayErrorSchema = deviceErrorSchema;
|
|
4
|
+
export const createFarmGatewayRequestSchema = z.object({
|
|
5
|
+
name: z.string().min(1).max(200),
|
|
6
|
+
});
|
|
7
|
+
export const createFarmGatewayResponseSchema = z.object({
|
|
8
|
+
gateway: z.object({
|
|
9
|
+
id: z.string().uuid(),
|
|
10
|
+
name: z.string(),
|
|
11
|
+
farmId: z.string().uuid(),
|
|
12
|
+
createdAt: z.string().datetime(),
|
|
13
|
+
}),
|
|
14
|
+
apiKey: z.string(),
|
|
15
|
+
});
|
|
16
|
+
export const farmGatewaySummarySchema = z.object({
|
|
17
|
+
id: z.string().uuid(),
|
|
18
|
+
name: z.string(),
|
|
19
|
+
farmId: z.string().uuid(),
|
|
20
|
+
lastSeenAt: z.string().datetime().nullable(),
|
|
21
|
+
firmwareVersion: z.string().nullable(),
|
|
22
|
+
isOnline: z.boolean(),
|
|
23
|
+
deviceCount: z.number().int().nonnegative(),
|
|
24
|
+
onlineDeviceCount: z.number().int().nonnegative(),
|
|
25
|
+
createdAt: z.string().datetime(),
|
|
26
|
+
});
|
|
27
|
+
export const listFarmGatewaysResponseSchema = z.object({
|
|
28
|
+
gateways: z.array(farmGatewaySummarySchema),
|
|
29
|
+
});
|
|
30
|
+
export const updateFarmGatewayRequestSchema = z.object({
|
|
31
|
+
name: z.string().min(1).max(200),
|
|
32
|
+
});
|
|
33
|
+
export const updateFarmGatewayResponseSchema = z.object({
|
|
34
|
+
gateway: farmGatewaySummarySchema,
|
|
35
|
+
});
|
|
36
|
+
export const gatewayHeartbeatRequestSchema = z.object({
|
|
37
|
+
gatewayId: z.string().uuid(),
|
|
38
|
+
firmwareVersion: z.string().max(50).optional(),
|
|
39
|
+
relayedDeviceCount: z.number().int().nonnegative().optional(),
|
|
40
|
+
wanConnected: z.boolean().optional(),
|
|
41
|
+
});
|
|
42
|
+
export const gatewayHeartbeatResponseSchema = z.object({
|
|
43
|
+
serverTime: z.string().datetime(),
|
|
44
|
+
farmId: z.string().uuid(),
|
|
45
|
+
});
|
|
@@ -31,6 +31,8 @@ export declare const organizationAttributesSchema: z.ZodObject<{
|
|
|
31
31
|
logo: string | null;
|
|
32
32
|
commodityCommissionRate: number | null;
|
|
33
33
|
}>;
|
|
34
|
+
/** Where to apply a new commodity commission rate. Paid deals are never rewritten. */
|
|
35
|
+
export declare const commodityCommissionApplyToSchema: z.ZodEnum<["future", "open_and_future"]>;
|
|
34
36
|
export declare const createOrganizationAttributesSchema: z.ZodObject<{
|
|
35
37
|
name: z.ZodString;
|
|
36
38
|
email: z.ZodOptional<z.ZodString>;
|
|
@@ -60,6 +62,14 @@ export declare const updateOrganizationAttributesSchema: z.ZodObject<{
|
|
|
60
62
|
address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
61
63
|
logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
62
64
|
commodityCommissionRate: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
65
|
+
} & {
|
|
66
|
+
/**
|
|
67
|
+
* When updating commodityCommissionRate:
|
|
68
|
+
* - future: org default only (new deals)
|
|
69
|
+
* - open_and_future: org default + snapshot onto currently open (non-paid) deals
|
|
70
|
+
* Defaults to future when omitted.
|
|
71
|
+
*/
|
|
72
|
+
commodityCommissionApplyTo: z.ZodOptional<z.ZodEnum<["future", "open_and_future"]>>;
|
|
63
73
|
}, "strip", z.ZodTypeAny, {
|
|
64
74
|
email?: string | undefined;
|
|
65
75
|
name?: string | undefined;
|
|
@@ -67,6 +77,7 @@ export declare const updateOrganizationAttributesSchema: z.ZodObject<{
|
|
|
67
77
|
address?: string | undefined;
|
|
68
78
|
logo?: string | undefined;
|
|
69
79
|
commodityCommissionRate?: number | undefined;
|
|
80
|
+
commodityCommissionApplyTo?: "future" | "open_and_future" | undefined;
|
|
70
81
|
}, {
|
|
71
82
|
email?: string | undefined;
|
|
72
83
|
name?: string | undefined;
|
|
@@ -74,6 +85,7 @@ export declare const updateOrganizationAttributesSchema: z.ZodObject<{
|
|
|
74
85
|
address?: string | undefined;
|
|
75
86
|
logo?: string | undefined;
|
|
76
87
|
commodityCommissionRate?: number | undefined;
|
|
88
|
+
commodityCommissionApplyTo?: "future" | "open_and_future" | undefined;
|
|
77
89
|
}>;
|
|
78
90
|
export declare const createOrganizationSchema: z.ZodObject<{
|
|
79
91
|
type: z.ZodLiteral<"organizations">;
|
|
@@ -130,6 +142,14 @@ export declare const updateOrganizationSchema: z.ZodObject<{
|
|
|
130
142
|
address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
131
143
|
logo: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
132
144
|
commodityCommissionRate: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
145
|
+
} & {
|
|
146
|
+
/**
|
|
147
|
+
* When updating commodityCommissionRate:
|
|
148
|
+
* - future: org default only (new deals)
|
|
149
|
+
* - open_and_future: org default + snapshot onto currently open (non-paid) deals
|
|
150
|
+
* Defaults to future when omitted.
|
|
151
|
+
*/
|
|
152
|
+
commodityCommissionApplyTo: z.ZodOptional<z.ZodEnum<["future", "open_and_future"]>>;
|
|
133
153
|
}, "strip", z.ZodTypeAny, {
|
|
134
154
|
email?: string | undefined;
|
|
135
155
|
name?: string | undefined;
|
|
@@ -137,6 +157,7 @@ export declare const updateOrganizationSchema: z.ZodObject<{
|
|
|
137
157
|
address?: string | undefined;
|
|
138
158
|
logo?: string | undefined;
|
|
139
159
|
commodityCommissionRate?: number | undefined;
|
|
160
|
+
commodityCommissionApplyTo?: "future" | "open_and_future" | undefined;
|
|
140
161
|
}, {
|
|
141
162
|
email?: string | undefined;
|
|
142
163
|
name?: string | undefined;
|
|
@@ -144,6 +165,7 @@ export declare const updateOrganizationSchema: z.ZodObject<{
|
|
|
144
165
|
address?: string | undefined;
|
|
145
166
|
logo?: string | undefined;
|
|
146
167
|
commodityCommissionRate?: number | undefined;
|
|
168
|
+
commodityCommissionApplyTo?: "future" | "open_and_future" | undefined;
|
|
147
169
|
}>;
|
|
148
170
|
}, "strip", z.ZodTypeAny, {
|
|
149
171
|
type: "organizations";
|
|
@@ -154,6 +176,7 @@ export declare const updateOrganizationSchema: z.ZodObject<{
|
|
|
154
176
|
address?: string | undefined;
|
|
155
177
|
logo?: string | undefined;
|
|
156
178
|
commodityCommissionRate?: number | undefined;
|
|
179
|
+
commodityCommissionApplyTo?: "future" | "open_and_future" | undefined;
|
|
157
180
|
};
|
|
158
181
|
id?: string | undefined;
|
|
159
182
|
}, {
|
|
@@ -165,6 +188,7 @@ export declare const updateOrganizationSchema: z.ZodObject<{
|
|
|
165
188
|
address?: string | undefined;
|
|
166
189
|
logo?: string | undefined;
|
|
167
190
|
commodityCommissionRate?: number | undefined;
|
|
191
|
+
commodityCommissionApplyTo?: "future" | "open_and_future" | undefined;
|
|
168
192
|
};
|
|
169
193
|
id?: string | undefined;
|
|
170
194
|
}>;
|
|
@@ -536,6 +560,7 @@ export declare const organizationListResponseSchema: z.ZodObject<{
|
|
|
536
560
|
meta?: Record<string, unknown> | undefined;
|
|
537
561
|
}[] | undefined;
|
|
538
562
|
}>;
|
|
563
|
+
export type CommodityCommissionApplyTo = z.infer<typeof commodityCommissionApplyToSchema>;
|
|
539
564
|
export type CreateOrganizationAttributes = z.infer<typeof createOrganizationAttributesSchema>;
|
|
540
565
|
export type UpdateOrganizationAttributes = z.infer<typeof updateOrganizationAttributesSchema>;
|
|
541
566
|
export type CreateOrganizationInput = z.infer<typeof createOrganizationSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/organizations.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOf,CAAC;
|
|
1
|
+
{"version":3,"file":"organizations.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/organizations.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOf,CAAC;AAE3B,sFAAsF;AACtF,eAAO,MAAM,gCAAgC,0CAAwC,CAAC;AAGtF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;EAO7C,CAAC;AAGH,eAAO,MAAM,kCAAkC;;;;;;;;IAG3C;;;;;OAKG;;;;;;;;;;;;;;;;;;EAEH,CAAC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C5F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,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,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -12,6 +12,8 @@ export const organizationAttributesSchema = z.object({
|
|
|
12
12
|
logo: z.string().url().nullable(),
|
|
13
13
|
commodityCommissionRate: z.number().min(0).max(100).nullable(),
|
|
14
14
|
}).merge(timestampsSchema);
|
|
15
|
+
/** Where to apply a new commodity commission rate. Paid deals are never rewritten. */
|
|
16
|
+
export const commodityCommissionApplyToSchema = z.enum(['future', 'open_and_future']);
|
|
15
17
|
// Organization attributes for creation (input)
|
|
16
18
|
export const createOrganizationAttributesSchema = z.object({
|
|
17
19
|
name: z.string().min(1).max(200),
|
|
@@ -22,7 +24,17 @@ export const createOrganizationAttributesSchema = z.object({
|
|
|
22
24
|
commodityCommissionRate: z.number().min(0).max(100).optional(),
|
|
23
25
|
});
|
|
24
26
|
// Organization attributes for update (input)
|
|
25
|
-
export const updateOrganizationAttributesSchema = createOrganizationAttributesSchema
|
|
27
|
+
export const updateOrganizationAttributesSchema = createOrganizationAttributesSchema
|
|
28
|
+
.partial()
|
|
29
|
+
.extend({
|
|
30
|
+
/**
|
|
31
|
+
* When updating commodityCommissionRate:
|
|
32
|
+
* - future: org default only (new deals)
|
|
33
|
+
* - open_and_future: org default + snapshot onto currently open (non-paid) deals
|
|
34
|
+
* Defaults to future when omitted.
|
|
35
|
+
*/
|
|
36
|
+
commodityCommissionApplyTo: commodityCommissionApplyToSchema.optional(),
|
|
37
|
+
});
|
|
26
38
|
// Create organization input (JSON:API format)
|
|
27
39
|
export const createOrganizationSchema = z.object({
|
|
28
40
|
type: z.literal('organizations'),
|
|
@@ -8,6 +8,7 @@ export declare const userAttributesSchema: z.ZodObject<{
|
|
|
8
8
|
phone: z.ZodNullable<z.ZodString>;
|
|
9
9
|
emailVerified: z.ZodBoolean;
|
|
10
10
|
avatar: z.ZodNullable<z.ZodString>;
|
|
11
|
+
isPlatformAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
11
12
|
} & {
|
|
12
13
|
createdAt: z.ZodString;
|
|
13
14
|
updatedAt: z.ZodString;
|
|
@@ -19,6 +20,7 @@ export declare const userAttributesSchema: z.ZodObject<{
|
|
|
19
20
|
phone: string | null;
|
|
20
21
|
emailVerified: boolean;
|
|
21
22
|
avatar: string | null;
|
|
23
|
+
isPlatformAdmin?: boolean | undefined;
|
|
22
24
|
}, {
|
|
23
25
|
email: string;
|
|
24
26
|
createdAt: string;
|
|
@@ -27,6 +29,7 @@ export declare const userAttributesSchema: z.ZodObject<{
|
|
|
27
29
|
phone: string | null;
|
|
28
30
|
emailVerified: boolean;
|
|
29
31
|
avatar: string | null;
|
|
32
|
+
isPlatformAdmin?: boolean | undefined;
|
|
30
33
|
}>;
|
|
31
34
|
export declare const updateUserAttributesSchema: z.ZodObject<{
|
|
32
35
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -83,6 +86,7 @@ export declare const userResourceSchema: z.ZodObject<{
|
|
|
83
86
|
phone: z.ZodNullable<z.ZodString>;
|
|
84
87
|
emailVerified: z.ZodBoolean;
|
|
85
88
|
avatar: z.ZodNullable<z.ZodString>;
|
|
89
|
+
isPlatformAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
86
90
|
} & {
|
|
87
91
|
createdAt: z.ZodString;
|
|
88
92
|
updatedAt: z.ZodString;
|
|
@@ -94,6 +98,7 @@ export declare const userResourceSchema: z.ZodObject<{
|
|
|
94
98
|
phone: string | null;
|
|
95
99
|
emailVerified: boolean;
|
|
96
100
|
avatar: string | null;
|
|
101
|
+
isPlatformAdmin?: boolean | undefined;
|
|
97
102
|
}, {
|
|
98
103
|
email: string;
|
|
99
104
|
createdAt: string;
|
|
@@ -102,6 +107,7 @@ export declare const userResourceSchema: z.ZodObject<{
|
|
|
102
107
|
phone: string | null;
|
|
103
108
|
emailVerified: boolean;
|
|
104
109
|
avatar: string | null;
|
|
110
|
+
isPlatformAdmin?: boolean | undefined;
|
|
105
111
|
}>;
|
|
106
112
|
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
107
113
|
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -117,6 +123,7 @@ export declare const userResourceSchema: z.ZodObject<{
|
|
|
117
123
|
phone: string | null;
|
|
118
124
|
emailVerified: boolean;
|
|
119
125
|
avatar: string | null;
|
|
126
|
+
isPlatformAdmin?: boolean | undefined;
|
|
120
127
|
};
|
|
121
128
|
relationships?: Record<string, unknown> | undefined;
|
|
122
129
|
links?: Record<string, string> | undefined;
|
|
@@ -132,6 +139,7 @@ export declare const userResourceSchema: z.ZodObject<{
|
|
|
132
139
|
phone: string | null;
|
|
133
140
|
emailVerified: boolean;
|
|
134
141
|
avatar: string | null;
|
|
142
|
+
isPlatformAdmin?: boolean | undefined;
|
|
135
143
|
};
|
|
136
144
|
relationships?: Record<string, unknown> | undefined;
|
|
137
145
|
links?: Record<string, string> | undefined;
|
|
@@ -147,6 +155,7 @@ export declare const userResponseSchema: z.ZodObject<{
|
|
|
147
155
|
phone: z.ZodNullable<z.ZodString>;
|
|
148
156
|
emailVerified: z.ZodBoolean;
|
|
149
157
|
avatar: z.ZodNullable<z.ZodString>;
|
|
158
|
+
isPlatformAdmin: z.ZodOptional<z.ZodBoolean>;
|
|
150
159
|
} & {
|
|
151
160
|
createdAt: z.ZodString;
|
|
152
161
|
updatedAt: z.ZodString;
|
|
@@ -158,6 +167,7 @@ export declare const userResponseSchema: z.ZodObject<{
|
|
|
158
167
|
phone: string | null;
|
|
159
168
|
emailVerified: boolean;
|
|
160
169
|
avatar: string | null;
|
|
170
|
+
isPlatformAdmin?: boolean | undefined;
|
|
161
171
|
}, {
|
|
162
172
|
email: string;
|
|
163
173
|
createdAt: string;
|
|
@@ -166,6 +176,7 @@ export declare const userResponseSchema: z.ZodObject<{
|
|
|
166
176
|
phone: string | null;
|
|
167
177
|
emailVerified: boolean;
|
|
168
178
|
avatar: string | null;
|
|
179
|
+
isPlatformAdmin?: boolean | undefined;
|
|
169
180
|
}>;
|
|
170
181
|
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
171
182
|
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -181,6 +192,7 @@ export declare const userResponseSchema: z.ZodObject<{
|
|
|
181
192
|
phone: string | null;
|
|
182
193
|
emailVerified: boolean;
|
|
183
194
|
avatar: string | null;
|
|
195
|
+
isPlatformAdmin?: boolean | undefined;
|
|
184
196
|
};
|
|
185
197
|
relationships?: Record<string, unknown> | undefined;
|
|
186
198
|
links?: Record<string, string> | undefined;
|
|
@@ -196,6 +208,7 @@ export declare const userResponseSchema: z.ZodObject<{
|
|
|
196
208
|
phone: string | null;
|
|
197
209
|
emailVerified: boolean;
|
|
198
210
|
avatar: string | null;
|
|
211
|
+
isPlatformAdmin?: boolean | undefined;
|
|
199
212
|
};
|
|
200
213
|
relationships?: Record<string, unknown> | undefined;
|
|
201
214
|
links?: Record<string, string> | undefined;
|
|
@@ -237,6 +250,7 @@ export declare const userResponseSchema: z.ZodObject<{
|
|
|
237
250
|
phone: string | null;
|
|
238
251
|
emailVerified: boolean;
|
|
239
252
|
avatar: string | null;
|
|
253
|
+
isPlatformAdmin?: boolean | undefined;
|
|
240
254
|
};
|
|
241
255
|
relationships?: Record<string, unknown> | undefined;
|
|
242
256
|
links?: Record<string, string> | undefined;
|
|
@@ -264,6 +278,7 @@ export declare const userResponseSchema: z.ZodObject<{
|
|
|
264
278
|
phone: string | null;
|
|
265
279
|
emailVerified: boolean;
|
|
266
280
|
avatar: string | null;
|
|
281
|
+
isPlatformAdmin?: boolean | undefined;
|
|
267
282
|
};
|
|
268
283
|
relationships?: Record<string, unknown> | undefined;
|
|
269
284
|
links?: Record<string, string> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/users.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AAGH,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"users.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/users.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOP,CAAC;AAG3B,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA6D,CAAC;AAG7F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;EAI5B,CAAC;AAGH,eAAO,MAAM,+BAA+B;;;;;;;;;EAG1C,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AAGH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -10,6 +10,7 @@ export const userAttributesSchema = z.object({
|
|
|
10
10
|
phone: z.string().nullable(),
|
|
11
11
|
emailVerified: z.boolean(),
|
|
12
12
|
avatar: z.string().url().nullable(),
|
|
13
|
+
isPlatformAdmin: z.boolean().optional(),
|
|
13
14
|
}).merge(timestampsSchema);
|
|
14
15
|
// Update user profile attributes
|
|
15
16
|
export const updateUserAttributesSchema = z.object({
|