@tmlmobilidade/types 20251103.1255.55 → 20251202.1817.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.
Files changed (235) hide show
  1. package/dist/{src/_common → _common}/index.d.ts +4 -2
  2. package/dist/{src/_common → _common}/index.js +4 -2
  3. package/dist/_common/mongo.d.ts +3 -0
  4. package/dist/_common/status.d.ts +13 -0
  5. package/dist/_common/status.js +20 -0
  6. package/dist/_common/utility.js +1 -0
  7. package/dist/{src/agency.d.ts → agency.d.ts} +4 -15
  8. package/dist/{src/agency.js → agency.js} +1 -6
  9. package/dist/{src/alert.d.ts → alert.d.ts} +20 -21
  10. package/dist/{src/alert.js → alert.js} +8 -14
  11. package/dist/{src/simplified-apex → apex}/simplified-apex-validation.d.ts +20 -20
  12. package/dist/{src/auth → auth}/index.d.ts +1 -1
  13. package/dist/{src/auth → auth}/index.js +1 -1
  14. package/dist/{src/auth → auth}/password-requirements.js +2 -1
  15. package/dist/auth/role.d.ts +958 -0
  16. package/dist/{src/auth → auth}/role.js +2 -2
  17. package/dist/{src/auth → auth}/session.d.ts +13 -9
  18. package/dist/{src/auth → auth}/session.js +1 -1
  19. package/dist/auth/user.d.ts +1281 -0
  20. package/dist/{src/auth → auth}/user.js +11 -14
  21. package/dist/{src/file-exports → file-exports}/common.d.ts +9 -8
  22. package/dist/{src/file-exports → file-exports}/common.js +1 -1
  23. package/dist/file-exports/index.d.ts +121 -0
  24. package/dist/file-exports/ride-export.d.ts +410 -0
  25. package/dist/file-exports/ride-export.js +131 -0
  26. package/dist/{src/file.d.ts → file.d.ts} +18 -18
  27. package/dist/gtfs/agency.d.ts +30 -0
  28. package/dist/gtfs/agency.js +13 -0
  29. package/dist/gtfs/feed-info.d.ts +33 -0
  30. package/dist/{src/gtfs.js → gtfs/feed-info.js} +1 -11
  31. package/dist/{src/gtfs → gtfs}/index.d.ts +3 -0
  32. package/dist/{src/gtfs → gtfs}/index.js +3 -0
  33. package/dist/gtfs/service-alert.d.ts +26 -0
  34. package/dist/index.d.ts +22 -22
  35. package/dist/index.js +22 -22
  36. package/dist/locations/census.d.ts +211 -0
  37. package/dist/locations/census.js +2 -0
  38. package/dist/locations/district.d.ts +24 -0
  39. package/dist/locations/district.js +2 -0
  40. package/dist/locations/index.d.ts +6 -0
  41. package/dist/locations/index.js +6 -0
  42. package/dist/locations/locality.d.ts +27 -0
  43. package/dist/locations/locality.js +2 -0
  44. package/dist/locations/municipality.d.ts +25 -0
  45. package/dist/locations/municipality.js +2 -0
  46. package/dist/locations/parish.d.ts +26 -0
  47. package/dist/locations/parish.js +2 -0
  48. package/dist/locations/queries.d.ts +117 -0
  49. package/dist/{src/locations.js → locations/queries.js} +5 -16
  50. package/dist/metrics/demand/demand_by_agency.d.ts +210 -0
  51. package/dist/metrics/demand/demand_by_agency.js +39 -0
  52. package/dist/metrics/demand/demand_by_category.d.ts +475 -0
  53. package/dist/metrics/demand/demand_by_category.js +114 -0
  54. package/dist/metrics/demand/demand_by_line.d.ts +246 -0
  55. package/dist/metrics/demand/demand_by_line.js +56 -0
  56. package/dist/metrics/demand/demand_by_pattern.d.ts +332 -0
  57. package/dist/metrics/demand/demand_by_pattern.js +56 -0
  58. package/dist/metrics/demand/demand_by_product.d.ts +475 -0
  59. package/dist/metrics/demand/demand_by_product.js +114 -0
  60. package/dist/metrics/demand/index.d.ts +6 -0
  61. package/dist/metrics/demand/index.js +8 -0
  62. package/dist/metrics/demand/records.d.ts +320 -0
  63. package/dist/metrics/demand/records.js +53 -0
  64. package/dist/metrics/index.d.ts +2647 -0
  65. package/dist/metrics/index.js +48 -0
  66. package/dist/metrics/realtime.d.ts +667 -0
  67. package/dist/metrics/realtime.js +41 -0
  68. package/dist/{src/notification.d.ts → notification.d.ts} +4 -4
  69. package/dist/{src/organization.d.ts → organization.d.ts} +32 -32
  70. package/dist/{src/organization.js → organization.js} +7 -7
  71. package/dist/permissions/agencies.d.ts +12 -0
  72. package/dist/permissions/agencies.js +13 -0
  73. package/dist/permissions/alerts.d.ts +36 -0
  74. package/dist/permissions/alerts.js +25 -0
  75. package/dist/permissions/controller.d.ts +36 -0
  76. package/dist/permissions/controller.js +30 -0
  77. package/dist/permissions/gtfs-validations.d.ts +25 -0
  78. package/dist/permissions/gtfs-validations.js +14 -0
  79. package/dist/permissions/home.d.ts +12 -0
  80. package/dist/permissions/home.js +10 -0
  81. package/dist/permissions/index.d.ts +268 -0
  82. package/dist/permissions/index.js +149 -0
  83. package/dist/permissions/organizations.d.ts +12 -0
  84. package/dist/permissions/organizations.js +12 -0
  85. package/dist/permissions/performance.d.ts +12 -0
  86. package/dist/permissions/performance.js +9 -0
  87. package/dist/permissions/plans.d.ts +25 -0
  88. package/dist/permissions/plans.js +22 -0
  89. package/dist/permissions/roles.d.ts +12 -0
  90. package/dist/permissions/roles.js +12 -0
  91. package/dist/permissions/stops.d.ts +30 -0
  92. package/dist/permissions/stops.js +17 -0
  93. package/dist/permissions/users.d.ts +12 -0
  94. package/dist/permissions/users.js +12 -0
  95. package/dist/{src/plans → plans}/gtfs-validation.d.ts +55 -63
  96. package/dist/{src/plans → plans}/gtfs-validation.js +3 -6
  97. package/dist/plans/plan-app-status.d.ts +15 -0
  98. package/dist/plans/plan-app-status.js +10 -0
  99. package/dist/{src/plans → plans}/plan.d.ts +240 -104
  100. package/dist/{src/plans → plans}/plan.js +8 -10
  101. package/dist/{src/_common/proposed-change.d.ts → proposed-change.d.ts} +21 -22
  102. package/dist/{src/_common/proposed-change.js → proposed-change.js} +5 -7
  103. package/dist/{src/rides → rides}/index.d.ts +1 -0
  104. package/dist/{src/rides → rides}/index.js +1 -0
  105. package/dist/{src/rides → rides}/ride-acceptance.d.ts +65 -65
  106. package/dist/{src/rides → rides}/ride-analysis.d.ts +34 -34
  107. package/dist/{src/rides → rides}/ride-audit.d.ts +10 -10
  108. package/dist/rides/ride-normalized.d.ts +29 -0
  109. package/dist/rides/ride-normalized.js +2 -0
  110. package/dist/{src/rides → rides}/ride.d.ts +523 -567
  111. package/dist/{src/rides → rides}/ride.js +2 -16
  112. package/dist/{src/sams → sams}/sam-analysis.d.ts +11 -11
  113. package/dist/{src/sams → sams}/sam-analysis.js +4 -4
  114. package/dist/{src/sams → sams}/sam.d.ts +76 -76
  115. package/dist/{src/sams → sams}/sam.js +1 -1
  116. package/dist/{src/stop.d.ts → stop.d.ts} +32 -43
  117. package/dist/{src/stop.js → stop.js} +3 -8
  118. package/dist/vehicle-events/gtfs-rt-vehicle-event-extended.d.ts +77 -0
  119. package/dist/vehicle-events/gtfs-rt-vehicle-event-extended.js +21 -0
  120. package/dist/vehicle-events/index.d.ts +2 -0
  121. package/dist/vehicle-events/index.js +2 -0
  122. package/dist/{src/vehicle-event.d.ts → vehicle-events/simplified-vehicle-event.d.ts} +9 -9
  123. package/dist/{src/vehicle-event.js → vehicle-events/simplified-vehicle-event.js} +3 -3
  124. package/dist/wiki.js +2 -0
  125. package/dist/{src/zone.d.ts → zone.d.ts} +2 -16
  126. package/dist/{src/zone.js → zone.js} +0 -6
  127. package/package.json +18 -21
  128. package/README.md +0 -13
  129. package/dist/src/_common/email.d.ts +0 -4
  130. package/dist/src/_common/email.js +0 -7
  131. package/dist/src/auth/permission.d.ts +0 -19
  132. package/dist/src/auth/permission.js +0 -8
  133. package/dist/src/auth/role.d.ts +0 -127
  134. package/dist/src/auth/user.d.ts +0 -311
  135. package/dist/src/file-exports/index.d.ts +0 -121
  136. package/dist/src/file-exports/ride-export.d.ts +0 -407
  137. package/dist/src/file-exports/ride-export.js +0 -120
  138. package/dist/src/gtfs.d.ts +0 -88
  139. package/dist/src/locations.d.ts +0 -319
  140. package/dist/src/metrics/demand.d.ts +0 -803
  141. package/dist/src/metrics/demand.js +0 -153
  142. package/dist/src/metrics/index.d.ts +0 -806
  143. package/dist/src/metrics/index.js +0 -19
  144. package/dist/src/plans/plan-controller.d.ts +0 -15
  145. package/dist/src/plans/plan-controller.js +0 -10
  146. package/dist/src/system/index.d.ts +0 -2
  147. package/dist/src/system/index.js +0 -2
  148. package/dist/src/system/processing-status.d.ts +0 -9
  149. package/dist/src/system/processing-status.js +0 -5
  150. package/dist/{src/_common → _common}/comment.d.ts +8 -8
  151. package/dist/{src/_common → _common}/comment.js +0 -0
  152. package/dist/{src/_common → _common}/document.d.ts +0 -0
  153. package/dist/{src/_common → _common}/document.js +0 -0
  154. package/dist/{src/system → _common}/environment.d.ts +0 -0
  155. package/dist/{src/system → _common}/environment.js +0 -0
  156. package/dist/{src/_common → _common}/fastify.d.ts +0 -0
  157. package/dist/{src/_common → _common}/fastify.js +0 -0
  158. package/dist/{src/_common/utility.js → _common/mongo.js} +0 -0
  159. package/dist/{src/_common → _common}/operational-date.d.ts +0 -0
  160. package/dist/{src/_common → _common}/operational-date.js +0 -0
  161. package/dist/{src/_common → _common}/unix-timestamp.d.ts +0 -0
  162. package/dist/{src/_common → _common}/unix-timestamp.js +0 -0
  163. package/dist/{src/_common → _common}/utility.d.ts +0 -0
  164. package/dist/{src/simplified-apex → apex}/index.d.ts +0 -0
  165. package/dist/{src/simplified-apex → apex}/index.js +0 -0
  166. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection-decision.d.ts +0 -0
  167. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection-decision.js +0 -0
  168. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection.d.ts +0 -0
  169. package/dist/{src/simplified-apex → apex}/simplified-apex-inspection.js +0 -0
  170. package/dist/{src/simplified-apex → apex}/simplified-apex-location.d.ts +16 -16
  171. package/dist/{src/simplified-apex → apex}/simplified-apex-location.js +0 -0
  172. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-refund.d.ts +20 -20
  173. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-refund.js +0 -0
  174. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-sale.d.ts +25 -25
  175. package/dist/{src/simplified-apex → apex}/simplified-apex-on-board-sale.js +0 -0
  176. package/dist/{src/simplified-apex → apex}/simplified-apex-type.d.ts +0 -0
  177. package/dist/{src/simplified-apex → apex}/simplified-apex-type.js +0 -0
  178. package/dist/{src/simplified-apex → apex}/simplified-apex-validation.js +0 -0
  179. package/dist/{src/auth → auth}/login.d.ts +0 -0
  180. package/dist/{src/auth → auth}/login.js +0 -0
  181. package/dist/{src/auth → auth}/password-requirements.d.ts +0 -0
  182. package/dist/{src/auth → auth}/verification-token.d.ts +0 -0
  183. package/dist/{src/auth → auth}/verification-token.js +0 -0
  184. package/dist/{src/file-exports → file-exports}/index.js +0 -0
  185. package/dist/{src/file.js → file.js} +0 -0
  186. package/dist/{src/gtfs → gtfs}/calendar-dates.d.ts +0 -0
  187. package/dist/{src/gtfs → gtfs}/calendar-dates.js +0 -0
  188. package/dist/{src/gtfs → gtfs}/calendar.d.ts +0 -0
  189. package/dist/{src/gtfs → gtfs}/calendar.js +0 -0
  190. package/dist/{src/gtfs → gtfs}/cause-effetcs.d.ts +0 -0
  191. package/dist/{src/gtfs → gtfs}/cause-effetcs.js +0 -0
  192. package/dist/{src/gtfs → gtfs}/common.d.ts +0 -0
  193. package/dist/{src/gtfs → gtfs}/common.js +0 -0
  194. package/dist/{src/gtfs → gtfs}/routes.d.ts +0 -0
  195. package/dist/{src/gtfs → gtfs}/routes.js +0 -0
  196. package/dist/{src/pcgi/pcgi-apex-location.js → gtfs/service-alert.js} +0 -0
  197. package/dist/{src/gtfs → gtfs}/shapes.d.ts +0 -0
  198. package/dist/{src/gtfs → gtfs}/shapes.js +0 -0
  199. package/dist/{src/gtfs → gtfs}/stop-times.d.ts +0 -0
  200. package/dist/{src/gtfs → gtfs}/stop-times.js +0 -0
  201. package/dist/{src/gtfs → gtfs}/stops.d.ts +0 -0
  202. package/dist/{src/gtfs → gtfs}/stops.js +0 -0
  203. package/dist/{src/gtfs → gtfs}/trips.d.ts +0 -0
  204. package/dist/{src/gtfs → gtfs}/trips.js +0 -0
  205. package/dist/{src/metrics → metrics}/common.d.ts +0 -0
  206. package/dist/{src/metrics → metrics}/common.js +0 -0
  207. package/dist/{src/notification.js → notification.js} +0 -0
  208. package/dist/{src/pcgi → pcgi}/index.d.ts +0 -0
  209. package/dist/{src/pcgi → pcgi}/index.js +0 -0
  210. package/dist/{src/pcgi → pcgi}/pcgi-apex-location.d.ts +0 -0
  211. package/dist/{src/pcgi/pcgi-apex-refund.js → pcgi/pcgi-apex-location.js} +0 -0
  212. package/dist/{src/pcgi → pcgi}/pcgi-apex-refund.d.ts +0 -0
  213. package/dist/{src/pcgi/pcgi-apex-sale.js → pcgi/pcgi-apex-refund.js} +0 -0
  214. package/dist/{src/pcgi → pcgi}/pcgi-apex-sale.d.ts +0 -0
  215. package/dist/{src/pcgi/pcgi-apex-validation.js → pcgi/pcgi-apex-sale.js} +0 -0
  216. package/dist/{src/pcgi → pcgi}/pcgi-apex-validation.d.ts +0 -0
  217. package/dist/{src/pcgi/pcgi-transaction-entity.js → pcgi/pcgi-apex-validation.js} +0 -0
  218. package/dist/{src/pcgi → pcgi}/pcgi-transaction-entity.d.ts +0 -0
  219. package/dist/{src/rides/hashed-shape.js → pcgi/pcgi-transaction-entity.js} +0 -0
  220. package/dist/{src/plans → plans}/index.d.ts +0 -0
  221. package/dist/{src/plans → plans}/index.js +0 -0
  222. package/dist/{src/plans → plans}/plan-pcgi-legacy.d.ts +0 -0
  223. package/dist/{src/plans → plans}/plan-pcgi-legacy.js +0 -0
  224. package/dist/{src/rides → rides}/hashed-shape.d.ts +0 -0
  225. package/dist/{src/rides/hashed-trip.js → rides/hashed-shape.js} +0 -0
  226. package/dist/{src/rides → rides}/hashed-trip.d.ts +0 -0
  227. package/dist/{src/wiki.js → rides/hashed-trip.js} +0 -0
  228. package/dist/{src/rides → rides}/ride-acceptance.js +1 -1
  229. /package/dist/{src/rides → rides}/ride-analysis.js +0 -0
  230. /package/dist/{src/rides → rides}/ride-audit.js +0 -0
  231. /package/dist/{src/rides → rides}/ride-overrides.d.ts +0 -0
  232. /package/dist/{src/rides → rides}/ride-overrides.js +0 -0
  233. /package/dist/{src/sams → sams}/index.d.ts +0 -0
  234. /package/dist/{src/sams → sams}/index.js +0 -0
  235. /package/dist/{src/wiki.d.ts → wiki.d.ts} +0 -0
package/package.json CHANGED
@@ -1,55 +1,52 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20251103.1255.55",
4
- "author": "João de Vasconcelos & Jusi Monteiro",
3
+ "version": "20251202.1817.5",
4
+ "author": {
5
+ "email": "iso@tmlmobilidade.pt",
6
+ "name": "TML-ISO"
7
+ },
5
8
  "license": "AGPL-3.0-or-later",
6
- "homepage": "https://github.com/tmlmobilidade/services#readme",
9
+ "homepage": "https://github.com/tmlmobilidade/go#readme",
7
10
  "bugs": {
8
- "url": "https://github.com/tmlmobilidade/services/issues"
11
+ "url": "https://github.com/tmlmobilidade/go/issues"
9
12
  },
10
13
  "repository": {
11
14
  "type": "git",
12
- "url": "git+https://github.com/tmlmobilidade/services.git"
15
+ "url": "git+https://github.com/tmlmobilidade/go.git"
13
16
  },
14
17
  "keywords": [
15
18
  "public transit",
16
19
  "tml",
17
20
  "transportes metropolitanos de lisboa",
18
- "services"
21
+ "go"
19
22
  ],
20
23
  "publishConfig": {
21
24
  "access": "public"
22
25
  },
23
26
  "type": "module",
24
27
  "files": [
25
- "dist/"
28
+ "dist"
26
29
  ],
27
- "exports": {
28
- ".": {
29
- "types": "./dist/index.d.ts",
30
- "default": "./dist/index.js"
31
- }
32
- },
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
33
32
  "scripts": {
34
- "build": "rimraf ./dist && tsc && resolve-tspaths",
35
- "lint": "eslint && tsc --noEmit",
36
- "lint:fix": "eslint --fix"
33
+ "build": "tsc && resolve-tspaths",
34
+ "lint": "eslint ./src/ && tsc --noEmit",
35
+ "lint:fix": "eslint ./src/ --fix",
36
+ "watch": "tsc-watch --onSuccess 'resolve-tspaths'"
37
37
  },
38
38
  "dependencies": {
39
39
  "@types/geojson": "7946.0.16",
40
- "geojson": "0.5.0",
41
40
  "gtfs-types": "5.1.0",
42
41
  "luxon": "3.7.2",
43
42
  "zod": "3.25.76"
44
43
  },
45
44
  "devDependencies": {
46
- "@carrismetropolitana/eslint": "20250622.1204.50",
47
45
  "@tmlmobilidade/tsconfig": "*",
48
46
  "@types/luxon": "3.7.1",
49
- "@types/node": "24.9.1",
47
+ "@types/node": "24.10.1",
50
48
  "resolve-tspaths": "0.8.23",
51
- "rimraf": "6.0.1",
52
- "turbo": "2.5.8",
49
+ "tsc-watch": "7.2.0",
53
50
  "typescript": "5.9.3"
54
51
  }
55
52
  }
package/README.md DELETED
@@ -1,13 +0,0 @@
1
- ## @tmlmobilidade/types
2
-
3
- This package provides shared Zod validation schemas and their corresponding TypeScript types for use across projects. All types are automatically inferred from the schemas to ensure full type safety and reduce maintenance overhead.
4
-
5
- ### Purpose
6
- - Ensure consistent validation rules across services
7
- - Reduce duplication by centralizing schema definitions
8
- - Automatically infer TypeScript types from schemas for type-safe usage
9
-
10
- ### Installation
11
- ```
12
- npm install -D @tmlmobilidade/types
13
- ```
@@ -1,4 +0,0 @@
1
- export type Email = string & {
2
- __brand: 'Email';
3
- };
4
- export declare function createEmail(email: string): Email;
@@ -1,7 +0,0 @@
1
- /* * */
2
- export function createEmail(email) {
3
- const parsedEmail = email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);
4
- if (!parsedEmail)
5
- throw new Error(`Invalid email format '${email}'`);
6
- return email;
7
- }
@@ -1,19 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const PermissionSchema: z.ZodObject<{
3
- action: z.ZodString;
4
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
5
- scope: z.ZodString;
6
- }, "strip", z.ZodTypeAny, {
7
- action: string;
8
- scope: string;
9
- resource?: Record<string, any> | null | undefined;
10
- }, {
11
- action: string;
12
- scope: string;
13
- resource?: Record<string, any> | null | undefined;
14
- }>;
15
- export interface Permission<T> {
16
- action: string;
17
- resource?: Partial<Record<keyof T, T[keyof T]>>;
18
- scope: string;
19
- }
@@ -1,8 +0,0 @@
1
- /* * */
2
- import { z } from 'zod';
3
- /* * */
4
- export const PermissionSchema = z.object({
5
- action: z.string(),
6
- resource: z.record(z.any()).nullish(),
7
- scope: z.string(),
8
- });
@@ -1,127 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const RoleSchema: z.ZodObject<{
3
- _id: z.ZodString;
4
- created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
5
- created_by: z.ZodOptional<z.ZodString>;
6
- updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
7
- updated_by: z.ZodOptional<z.ZodString>;
8
- } & {
9
- name: z.ZodString;
10
- permissions: z.ZodArray<z.ZodObject<{
11
- action: z.ZodString;
12
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
13
- scope: z.ZodString;
14
- }, "strip", z.ZodTypeAny, {
15
- action: string;
16
- scope: string;
17
- resource?: Record<string, any> | null | undefined;
18
- }, {
19
- action: string;
20
- scope: string;
21
- resource?: Record<string, any> | null | undefined;
22
- }>, "many">;
23
- }, "strict", z.ZodTypeAny, {
24
- _id: string;
25
- created_at: number & {
26
- __brand: "UnixTimestamp";
27
- };
28
- updated_at: number & {
29
- __brand: "UnixTimestamp";
30
- };
31
- name: string;
32
- permissions: {
33
- action: string;
34
- scope: string;
35
- resource?: Record<string, any> | null | undefined;
36
- }[];
37
- created_by?: string | undefined;
38
- updated_by?: string | undefined;
39
- }, {
40
- _id: string;
41
- created_at: number;
42
- updated_at: number;
43
- name: string;
44
- permissions: {
45
- action: string;
46
- scope: string;
47
- resource?: Record<string, any> | null | undefined;
48
- }[];
49
- created_by?: string | undefined;
50
- updated_by?: string | undefined;
51
- }>;
52
- export declare const CreateRoleSchema: z.ZodObject<Omit<{
53
- _id: z.ZodString;
54
- created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
55
- created_by: z.ZodOptional<z.ZodString>;
56
- updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
57
- updated_by: z.ZodOptional<z.ZodString>;
58
- } & {
59
- name: z.ZodString;
60
- permissions: z.ZodArray<z.ZodObject<{
61
- action: z.ZodString;
62
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
63
- scope: z.ZodString;
64
- }, "strip", z.ZodTypeAny, {
65
- action: string;
66
- scope: string;
67
- resource?: Record<string, any> | null | undefined;
68
- }, {
69
- action: string;
70
- scope: string;
71
- resource?: Record<string, any> | null | undefined;
72
- }>, "many">;
73
- }, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
74
- name: string;
75
- permissions: {
76
- action: string;
77
- scope: string;
78
- resource?: Record<string, any> | null | undefined;
79
- }[];
80
- created_by?: string | undefined;
81
- updated_by?: string | undefined;
82
- }, {
83
- name: string;
84
- permissions: {
85
- action: string;
86
- scope: string;
87
- resource?: Record<string, any> | null | undefined;
88
- }[];
89
- created_by?: string | undefined;
90
- updated_by?: string | undefined;
91
- }>;
92
- export declare const UpdateRoleSchema: z.ZodObject<{
93
- updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
94
- name: z.ZodOptional<z.ZodString>;
95
- permissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
96
- action: z.ZodString;
97
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
98
- scope: z.ZodString;
99
- }, "strip", z.ZodTypeAny, {
100
- action: string;
101
- scope: string;
102
- resource?: Record<string, any> | null | undefined;
103
- }, {
104
- action: string;
105
- scope: string;
106
- resource?: Record<string, any> | null | undefined;
107
- }>, "many">>;
108
- }, "strict", z.ZodTypeAny, {
109
- updated_by?: string | undefined;
110
- name?: string | undefined;
111
- permissions?: {
112
- action: string;
113
- scope: string;
114
- resource?: Record<string, any> | null | undefined;
115
- }[] | undefined;
116
- }, {
117
- updated_by?: string | undefined;
118
- name?: string | undefined;
119
- permissions?: {
120
- action: string;
121
- scope: string;
122
- resource?: Record<string, any> | null | undefined;
123
- }[] | undefined;
124
- }>;
125
- export type Role = z.infer<typeof RoleSchema>;
126
- export type CreateRoleDto = z.infer<typeof CreateRoleSchema>;
127
- export type UpdateRoleDto = z.infer<typeof UpdateRoleSchema>;
@@ -1,311 +0,0 @@
1
- import { type Permission } from './permission.js';
2
- import { z } from 'zod';
3
- export declare const UserPreferenceValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>;
4
- export type UserPreferenceValue = z.infer<typeof UserPreferenceValueSchema>;
5
- export declare const UserSchema: z.ZodObject<{
6
- _id: z.ZodString;
7
- created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
8
- created_by: z.ZodOptional<z.ZodString>;
9
- updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
10
- updated_by: z.ZodOptional<z.ZodString>;
11
- } & {
12
- avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
- bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
- email: z.ZodString;
15
- email_verified: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
16
- first_name: z.ZodString;
17
- last_name: z.ZodString;
18
- organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
- password_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
- permissions: z.ZodArray<z.ZodObject<{
21
- action: z.ZodString;
22
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
23
- scope: z.ZodString;
24
- }, "strip", z.ZodTypeAny, {
25
- action: string;
26
- scope: string;
27
- resource?: Record<string, any> | null | undefined;
28
- }, {
29
- action: string;
30
- scope: string;
31
- resource?: Record<string, any> | null | undefined;
32
- }>, "many">;
33
- phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
- preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
35
- role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
36
- session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
37
- theme_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
- verification_token_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
39
- }, "strict", z.ZodTypeAny, {
40
- _id: string;
41
- created_at: number & {
42
- __brand: "UnixTimestamp";
43
- };
44
- updated_at: number & {
45
- __brand: "UnixTimestamp";
46
- };
47
- email: string;
48
- permissions: {
49
- action: string;
50
- scope: string;
51
- resource?: Record<string, any> | null | undefined;
52
- }[];
53
- first_name: string;
54
- last_name: string;
55
- role_ids: string[];
56
- session_ids: string[];
57
- verification_token_ids: string[];
58
- created_by?: string | undefined;
59
- updated_by?: string | undefined;
60
- phone?: string | null | undefined;
61
- avatar?: string | null | undefined;
62
- bio?: string | null | undefined;
63
- email_verified?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
64
- organization_id?: string | null | undefined;
65
- password_hash?: string | null | undefined;
66
- preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
67
- theme_id?: string | null | undefined;
68
- }, {
69
- _id: string;
70
- created_at: number;
71
- updated_at: number;
72
- email: string;
73
- permissions: {
74
- action: string;
75
- scope: string;
76
- resource?: Record<string, any> | null | undefined;
77
- }[];
78
- first_name: string;
79
- last_name: string;
80
- created_by?: string | undefined;
81
- updated_by?: string | undefined;
82
- phone?: string | null | undefined;
83
- avatar?: string | null | undefined;
84
- bio?: string | null | undefined;
85
- email_verified?: number | null | undefined;
86
- organization_id?: string | null | undefined;
87
- password_hash?: string | null | undefined;
88
- preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
89
- role_ids?: string[] | undefined;
90
- session_ids?: string[] | undefined;
91
- theme_id?: string | null | undefined;
92
- verification_token_ids?: string[] | undefined;
93
- }>;
94
- export declare const CreateUserSchema: z.ZodObject<Omit<{
95
- _id: z.ZodString;
96
- created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
97
- created_by: z.ZodOptional<z.ZodString>;
98
- updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
99
- updated_by: z.ZodOptional<z.ZodString>;
100
- } & {
101
- avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
- bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
- email: z.ZodString;
104
- email_verified: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
105
- first_name: z.ZodString;
106
- last_name: z.ZodString;
107
- organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
- password_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
- permissions: z.ZodArray<z.ZodObject<{
110
- action: z.ZodString;
111
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
112
- scope: z.ZodString;
113
- }, "strip", z.ZodTypeAny, {
114
- action: string;
115
- scope: string;
116
- resource?: Record<string, any> | null | undefined;
117
- }, {
118
- action: string;
119
- scope: string;
120
- resource?: Record<string, any> | null | undefined;
121
- }>, "many">;
122
- phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
- preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
124
- role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
125
- session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
126
- theme_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
127
- verification_token_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
128
- }, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
129
- email: string;
130
- permissions: {
131
- action: string;
132
- scope: string;
133
- resource?: Record<string, any> | null | undefined;
134
- }[];
135
- first_name: string;
136
- last_name: string;
137
- role_ids: string[];
138
- session_ids: string[];
139
- verification_token_ids: string[];
140
- created_by?: string | undefined;
141
- updated_by?: string | undefined;
142
- phone?: string | null | undefined;
143
- avatar?: string | null | undefined;
144
- bio?: string | null | undefined;
145
- email_verified?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
146
- organization_id?: string | null | undefined;
147
- password_hash?: string | null | undefined;
148
- preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
149
- theme_id?: string | null | undefined;
150
- }, {
151
- email: string;
152
- permissions: {
153
- action: string;
154
- scope: string;
155
- resource?: Record<string, any> | null | undefined;
156
- }[];
157
- first_name: string;
158
- last_name: string;
159
- created_by?: string | undefined;
160
- updated_by?: string | undefined;
161
- phone?: string | null | undefined;
162
- avatar?: string | null | undefined;
163
- bio?: string | null | undefined;
164
- email_verified?: number | null | undefined;
165
- organization_id?: string | null | undefined;
166
- password_hash?: string | null | undefined;
167
- preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
168
- role_ids?: string[] | undefined;
169
- session_ids?: string[] | undefined;
170
- theme_id?: string | null | undefined;
171
- verification_token_ids?: string[] | undefined;
172
- }>;
173
- export declare const UpdateUserSchema: z.ZodObject<{
174
- updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
175
- phone: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
176
- email: z.ZodOptional<z.ZodString>;
177
- permissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
178
- action: z.ZodString;
179
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
180
- scope: z.ZodString;
181
- }, "strip", z.ZodTypeAny, {
182
- action: string;
183
- scope: string;
184
- resource?: Record<string, any> | null | undefined;
185
- }, {
186
- action: string;
187
- scope: string;
188
- resource?: Record<string, any> | null | undefined;
189
- }>, "many">>;
190
- avatar: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
191
- bio: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
192
- email_verified: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>>;
193
- first_name: z.ZodOptional<z.ZodString>;
194
- last_name: z.ZodOptional<z.ZodString>;
195
- organization_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
196
- password_hash: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
197
- preferences: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>>;
198
- role_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
199
- session_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
200
- theme_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
201
- verification_token_ids: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
202
- }, "strict", z.ZodTypeAny, {
203
- updated_by?: string | undefined;
204
- phone?: string | null | undefined;
205
- email?: string | undefined;
206
- permissions?: {
207
- action: string;
208
- scope: string;
209
- resource?: Record<string, any> | null | undefined;
210
- }[] | undefined;
211
- avatar?: string | null | undefined;
212
- bio?: string | null | undefined;
213
- email_verified?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
214
- first_name?: string | undefined;
215
- last_name?: string | undefined;
216
- organization_id?: string | null | undefined;
217
- password_hash?: string | null | undefined;
218
- preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
219
- role_ids?: string[] | undefined;
220
- session_ids?: string[] | undefined;
221
- theme_id?: string | null | undefined;
222
- verification_token_ids?: string[] | undefined;
223
- }, {
224
- updated_by?: string | undefined;
225
- phone?: string | null | undefined;
226
- email?: string | undefined;
227
- permissions?: {
228
- action: string;
229
- scope: string;
230
- resource?: Record<string, any> | null | undefined;
231
- }[] | undefined;
232
- avatar?: string | null | undefined;
233
- bio?: string | null | undefined;
234
- email_verified?: number | null | undefined;
235
- first_name?: string | undefined;
236
- last_name?: string | undefined;
237
- organization_id?: string | null | undefined;
238
- password_hash?: string | null | undefined;
239
- preferences?: Record<string, Record<string, string | number | boolean | string[] | number[]>> | null | undefined;
240
- role_ids?: string[] | undefined;
241
- session_ids?: string[] | undefined;
242
- theme_id?: string | null | undefined;
243
- verification_token_ids?: string[] | undefined;
244
- }>;
245
- export interface User extends Omit<z.infer<typeof UserSchema>, 'permissions'> {
246
- permissions: Permission<unknown>[];
247
- }
248
- export type CreateUserDto = z.infer<typeof CreateUserSchema>;
249
- export type UpdateUserDto = z.infer<typeof UpdateUserSchema>;
250
- export declare const UserDisplayFields: {
251
- readonly _id: true;
252
- readonly avatar: true;
253
- readonly email: true;
254
- readonly first_name: true;
255
- readonly last_name: true;
256
- readonly phone: true;
257
- };
258
- export declare const UserDisplaySchema: z.ZodObject<Pick<{
259
- _id: z.ZodString;
260
- created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
261
- created_by: z.ZodOptional<z.ZodString>;
262
- updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
263
- updated_by: z.ZodOptional<z.ZodString>;
264
- } & {
265
- avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
266
- bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
267
- email: z.ZodString;
268
- email_verified: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
269
- first_name: z.ZodString;
270
- last_name: z.ZodString;
271
- organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
- password_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
- permissions: z.ZodArray<z.ZodObject<{
274
- action: z.ZodString;
275
- resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
276
- scope: z.ZodString;
277
- }, "strip", z.ZodTypeAny, {
278
- action: string;
279
- scope: string;
280
- resource?: Record<string, any> | null | undefined;
281
- }, {
282
- action: string;
283
- scope: string;
284
- resource?: Record<string, any> | null | undefined;
285
- }>, "many">;
286
- phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
- preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
288
- role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
289
- session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
290
- theme_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
- verification_token_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
292
- }, "_id" | "phone" | "email" | "avatar" | "first_name" | "last_name">, "strict", z.ZodTypeAny, {
293
- _id: string;
294
- email: string;
295
- first_name: string;
296
- last_name: string;
297
- phone?: string | null | undefined;
298
- avatar?: string | null | undefined;
299
- }, {
300
- _id: string;
301
- email: string;
302
- first_name: string;
303
- last_name: string;
304
- phone?: string | null | undefined;
305
- avatar?: string | null | undefined;
306
- }>;
307
- export type UserDisplay = z.infer<typeof UserDisplaySchema>;
308
- export type WithUser<T> = Omit<T, 'created_by' | 'updated_by'> & {
309
- created_by?: string | UserDisplay;
310
- updated_by?: string | UserDisplay;
311
- };