sgerp-frontend-lib 0.1.0 → 0.1.2

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 (255) hide show
  1. package/README.md +1 -1
  2. package/dist/connection-manager.d.ts +48 -0
  3. package/dist/connection-manager.d.ts.map +1 -0
  4. package/dist/connection-manager.js +156 -0
  5. package/dist/index.js +20 -2
  6. package/dist/locales/locale-server.d.ts +10 -0
  7. package/dist/locales/locale-server.d.ts.map +1 -0
  8. package/dist/locales/locale-server.js +49 -0
  9. package/dist/locales/locale.d.ts +23 -0
  10. package/dist/locales/locale.d.ts.map +1 -0
  11. package/dist/locales/locale.js +145 -0
  12. package/dist/locales/locale_en.d.ts.map +1 -1
  13. package/dist/locales/locale_en.js +93 -9
  14. package/dist/locales/locale_ja.d.ts.map +1 -1
  15. package/dist/locales/locale_ja.js +93 -9
  16. package/dist/locales/locale_ms.d.ts.map +1 -1
  17. package/dist/locales/locale_ms.js +84 -9
  18. package/dist/locales/useLocalization.d.ts +11 -0
  19. package/dist/locales/useLocalization.d.ts.map +1 -0
  20. package/dist/locales/useLocalization.js +64 -0
  21. package/dist/locales.d.ts +228 -0
  22. package/dist/locales.d.ts.map +1 -0
  23. package/dist/locales.js +229 -0
  24. package/dist/sgerp/api/client.d.ts +45 -0
  25. package/dist/sgerp/api/client.d.ts.map +1 -0
  26. package/dist/sgerp/api/client.js +141 -0
  27. package/dist/sgerp/client.js +341 -0
  28. package/dist/sgerp/collection.d.ts +391 -0
  29. package/dist/sgerp/collection.d.ts.map +1 -0
  30. package/dist/sgerp/collection.js +756 -0
  31. package/dist/sgerp/collections/account/user.d.ts +8 -0
  32. package/dist/sgerp/collections/account/user.d.ts.map +1 -0
  33. package/dist/sgerp/collections/account/user.js +10 -0
  34. package/dist/sgerp/collections/masstransit/building.d.ts +26 -0
  35. package/dist/sgerp/collections/masstransit/building.d.ts.map +1 -0
  36. package/dist/sgerp/collections/masstransit/building.js +53 -0
  37. package/dist/sgerp/collections/masstransit/transitstop.d.ts +15 -0
  38. package/dist/sgerp/collections/masstransit/transitstop.d.ts.map +1 -0
  39. package/dist/sgerp/collections/masstransit/transitstop.js +54 -0
  40. package/dist/sgerp/collections/masstransit/transitstopset.d.ts +10 -0
  41. package/dist/sgerp/collections/masstransit/transitstopset.d.ts.map +1 -0
  42. package/dist/sgerp/collections/masstransit/transitstopset.js +10 -0
  43. package/dist/sgerp/collections/sharing/organization-project.d.ts +11 -0
  44. package/dist/sgerp/collections/sharing/organization-project.d.ts.map +1 -0
  45. package/dist/sgerp/collections/sharing/organization-project.js +13 -0
  46. package/dist/sgerp/collections/sharing/organization.d.ts +11 -0
  47. package/dist/sgerp/collections/sharing/organization.d.ts.map +1 -0
  48. package/dist/sgerp/collections/sharing/organization.js +13 -0
  49. package/dist/sgerp/collections/sharing/pricing.d.ts +18 -0
  50. package/dist/sgerp/collections/sharing/pricing.d.ts.map +1 -0
  51. package/dist/sgerp/collections/sharing/pricing.js +23 -0
  52. package/dist/sgerp/collections/sharing/project-member.d.ts +8 -0
  53. package/dist/sgerp/collections/sharing/project-member.d.ts.map +1 -0
  54. package/dist/sgerp/collections/sharing/project-member.js +10 -0
  55. package/dist/sgerp/collections/sharing/project.d.ts +8 -0
  56. package/dist/sgerp/collections/sharing/project.d.ts.map +1 -0
  57. package/dist/sgerp/collections/sharing/project.js +10 -0
  58. package/dist/sgerp/collections/simulation/booking.d.ts +11 -0
  59. package/dist/sgerp/collections/simulation/booking.d.ts.map +1 -0
  60. package/dist/sgerp/collections/simulation/booking.js +13 -0
  61. package/dist/sgerp/collections/simulation/dataset.d.ts +14 -0
  62. package/dist/sgerp/collections/simulation/dataset.d.ts.map +1 -0
  63. package/dist/sgerp/collections/simulation/dataset.js +17 -0
  64. package/dist/sgerp/collections/simulation/driver.d.ts +12 -0
  65. package/dist/sgerp/collections/simulation/driver.d.ts.map +1 -0
  66. package/dist/sgerp/collections/simulation/driver.js +40 -0
  67. package/dist/sgerp/collections/simulation/geofence.d.ts +24 -0
  68. package/dist/sgerp/collections/simulation/geofence.d.ts.map +1 -0
  69. package/dist/sgerp/collections/simulation/geofence.js +66 -0
  70. package/dist/sgerp/collections/simulation/mapboxtoken.d.ts +18 -0
  71. package/dist/sgerp/collections/simulation/mapboxtoken.d.ts.map +1 -0
  72. package/dist/sgerp/collections/simulation/mapboxtoken.js +24 -0
  73. package/dist/sgerp/collections/simulation/node.js +13 -0
  74. package/dist/sgerp/collections/simulation/operationslocation.d.ts +28 -0
  75. package/dist/sgerp/collections/simulation/operationslocation.d.ts.map +1 -0
  76. package/dist/sgerp/collections/simulation/operationslocation.js +64 -0
  77. package/dist/sgerp/collections/simulation/operationslocationgroup.d.ts +12 -0
  78. package/dist/sgerp/collections/simulation/operationslocationgroup.d.ts.map +1 -0
  79. package/dist/sgerp/collections/simulation/operationslocationgroup.js +24 -0
  80. package/dist/sgerp/collections/simulation/routingprofile.d.ts +10 -0
  81. package/dist/sgerp/collections/simulation/routingprofile.d.ts.map +1 -0
  82. package/dist/sgerp/collections/simulation/routingprofile.js +10 -0
  83. package/dist/sgerp/collections/simulation/simulation.d.ts +12 -0
  84. package/dist/sgerp/collections/simulation/simulation.d.ts.map +1 -0
  85. package/dist/sgerp/collections/simulation/simulation.js +35 -0
  86. package/dist/sgerp/collections/simulation/simulationprocessor.d.ts +19 -0
  87. package/dist/sgerp/collections/simulation/simulationprocessor.d.ts.map +1 -0
  88. package/dist/sgerp/collections/simulation/simulationprocessor.js +27 -0
  89. package/dist/sgerp/collections/simulation/vehicle.js +13 -0
  90. package/dist/sgerp/collections/simulation/vehicletype.d.ts +11 -0
  91. package/dist/sgerp/collections/simulation/vehicletype.d.ts.map +1 -0
  92. package/dist/sgerp/collections/simulation/vehicletype.js +13 -0
  93. package/dist/sgerp/collections/sms_notify/smsscheduled.d.ts +11 -0
  94. package/dist/sgerp/collections/sms_notify/smsscheduled.d.ts.map +1 -0
  95. package/dist/sgerp/collections/sms_notify/smsscheduled.js +13 -0
  96. package/dist/sgerp/collections/transportation/passenger.d.ts +8 -0
  97. package/dist/sgerp/collections/transportation/passenger.d.ts.map +1 -0
  98. package/dist/sgerp/collections/transportation/passenger.js +10 -0
  99. package/dist/sgerp/collections/transportation/ticket.d.ts +11 -0
  100. package/dist/sgerp/collections/transportation/ticket.d.ts.map +1 -0
  101. package/dist/sgerp/collections/transportation/ticket.js +13 -0
  102. package/dist/sgerp/collections/transportation/transaction.d.ts +11 -0
  103. package/dist/sgerp/collections/transportation/transaction.d.ts.map +1 -0
  104. package/dist/sgerp/collections/transportation/transaction.js +13 -0
  105. package/dist/sgerp/constants/bulkoperations-enums.d.ts +71 -0
  106. package/dist/sgerp/constants/bulkoperations-enums.d.ts.map +1 -0
  107. package/dist/sgerp/constants/bulkoperations-enums.js +99 -0
  108. package/dist/sgerp/constants/messages-enums.d.ts +47 -0
  109. package/dist/sgerp/constants/messages-enums.d.ts.map +1 -0
  110. package/dist/sgerp/constants/messages-enums.js +67 -0
  111. package/dist/sgerp/constants/scheduling-enums.d.ts +42 -0
  112. package/dist/sgerp/constants/scheduling-enums.d.ts.map +1 -0
  113. package/dist/sgerp/constants/scheduling-enums.js +61 -0
  114. package/dist/sgerp/constants/simulation-enums.d.ts +93 -0
  115. package/dist/sgerp/constants/simulation-enums.d.ts.map +1 -0
  116. package/dist/sgerp/constants/simulation-enums.js +147 -0
  117. package/dist/sgerp/constants/solver-strategies.d.ts +75 -0
  118. package/dist/sgerp/constants/solver-strategies.d.ts.map +1 -0
  119. package/dist/sgerp/constants/solver-strategies.js +26 -0
  120. package/dist/sgerp/context/sgerp-context.js +134 -0
  121. package/dist/sgerp/domains.d.ts +47 -0
  122. package/dist/sgerp/domains.d.ts.map +1 -0
  123. package/dist/sgerp/domains.js +45 -0
  124. package/dist/sgerp/hooks/use-collection.js +122 -0
  125. package/dist/sgerp/hooks/use-live-updates.js +16 -13
  126. package/dist/sgerp/index.js +153 -0
  127. package/dist/sgerp/map-states/operations-location-state.d.ts +12 -0
  128. package/dist/sgerp/map-states/operations-location-state.d.ts.map +1 -0
  129. package/dist/sgerp/map-states/operations-location-state.js +86 -0
  130. package/dist/sgerp/routing/index.d.ts +51 -0
  131. package/dist/sgerp/routing/index.d.ts.map +1 -0
  132. package/dist/sgerp/routing/index.js +373 -0
  133. package/dist/sgerp/simulation-logic/fetchUtils.js +226 -0
  134. package/dist/sgerp/simulation-logic/index.js +27 -7
  135. package/dist/sgerp/simulation-logic/manualEditUtils.js +69 -0
  136. package/dist/sgerp/simulation-logic/mapUtils.js +58 -0
  137. package/dist/sgerp/simulation-logic/optimisticUpdateUtils.js +8 -5
  138. package/dist/sgerp/simulation-logic/referenceUtils.js +110 -0
  139. package/dist/sgerp/simulation-logic/routeCalculationUtils.js +43 -0
  140. package/dist/sgerp/simulation-logic/timeShiftUtils.js +63 -0
  141. package/dist/sgerp/types/account/user.d.ts +38 -0
  142. package/dist/sgerp/types/account/user.d.ts.map +1 -0
  143. package/dist/sgerp/types/account/user.js +2 -0
  144. package/dist/sgerp/types/bulkoperations/index.d.ts +37 -0
  145. package/dist/sgerp/types/bulkoperations/index.d.ts.map +1 -0
  146. package/dist/sgerp/types/bulkoperations/index.js +35 -0
  147. package/dist/sgerp/types/bulkoperations/vehicle-upload.d.ts +335 -0
  148. package/dist/sgerp/types/bulkoperations/vehicle-upload.d.ts.map +1 -0
  149. package/dist/sgerp/types/bulkoperations/vehicle-upload.js +49 -0
  150. package/dist/sgerp/types/config.d.ts +25 -0
  151. package/dist/sgerp/types/config.d.ts.map +1 -0
  152. package/dist/sgerp/types/config.js +2 -0
  153. package/dist/sgerp/types/geojson.d.ts +45 -0
  154. package/dist/sgerp/types/geojson.d.ts.map +1 -0
  155. package/dist/sgerp/types/geojson.js +6 -0
  156. package/dist/sgerp/types/map.d.ts +24 -0
  157. package/dist/sgerp/types/map.d.ts.map +1 -0
  158. package/dist/sgerp/types/map.js +2 -0
  159. package/dist/sgerp/types/masstransit/building.d.ts +24 -0
  160. package/dist/sgerp/types/masstransit/building.d.ts.map +1 -0
  161. package/dist/sgerp/types/masstransit/building.js +2 -0
  162. package/dist/sgerp/types/masstransit/transitstop.d.ts +35 -0
  163. package/dist/sgerp/types/masstransit/transitstop.d.ts.map +1 -0
  164. package/dist/sgerp/types/masstransit/transitstop.js +2 -0
  165. package/dist/sgerp/types/masstransit/transitstopset.d.ts +14 -0
  166. package/dist/sgerp/types/masstransit/transitstopset.d.ts.map +1 -0
  167. package/dist/sgerp/types/masstransit/transitstopset.js +2 -0
  168. package/dist/sgerp/types/sharing/organization-project.d.ts +14 -0
  169. package/dist/sgerp/types/sharing/organization-project.d.ts.map +1 -0
  170. package/dist/sgerp/types/sharing/organization-project.js +2 -0
  171. package/dist/sgerp/types/sharing/organization.d.ts +14 -0
  172. package/dist/sgerp/types/sharing/organization.d.ts.map +1 -0
  173. package/dist/sgerp/types/sharing/organization.js +2 -0
  174. package/dist/sgerp/types/sharing/pricing.d.ts +98 -0
  175. package/dist/sgerp/types/sharing/pricing.d.ts.map +1 -0
  176. package/dist/sgerp/types/sharing/pricing.js +2 -0
  177. package/dist/sgerp/types/sharing/project-member.d.ts +15 -0
  178. package/dist/sgerp/types/sharing/project-member.d.ts.map +1 -0
  179. package/dist/sgerp/types/sharing/project-member.js +2 -0
  180. package/dist/sgerp/types/sharing/project.d.ts +16 -0
  181. package/dist/sgerp/types/sharing/project.d.ts.map +1 -0
  182. package/dist/sgerp/types/sharing/project.js +2 -0
  183. package/dist/sgerp/types/simulation/booking.d.ts +128 -0
  184. package/dist/sgerp/types/simulation/booking.d.ts.map +1 -0
  185. package/dist/sgerp/types/simulation/booking.js +24 -0
  186. package/dist/sgerp/types/simulation/calculation-params.d.ts +20 -0
  187. package/dist/sgerp/types/simulation/calculation-params.d.ts.map +1 -0
  188. package/dist/sgerp/types/simulation/calculation-params.js +2 -0
  189. package/dist/sgerp/types/simulation/dataset.d.ts +16 -0
  190. package/dist/sgerp/types/simulation/dataset.d.ts.map +1 -0
  191. package/dist/sgerp/types/simulation/dataset.js +2 -0
  192. package/dist/sgerp/types/simulation/driver.d.ts +19 -0
  193. package/dist/sgerp/types/simulation/driver.d.ts.map +1 -0
  194. package/dist/sgerp/types/simulation/driver.js +2 -0
  195. package/dist/sgerp/types/simulation/geofence.d.ts +19 -0
  196. package/dist/sgerp/types/simulation/geofence.d.ts.map +1 -0
  197. package/dist/sgerp/types/simulation/geofence.js +2 -0
  198. package/dist/sgerp/types/simulation/logistics-api-settings.d.ts +98 -0
  199. package/dist/sgerp/types/simulation/logistics-api-settings.d.ts.map +1 -0
  200. package/dist/sgerp/types/simulation/logistics-api-settings.js +104 -0
  201. package/dist/sgerp/types/simulation/mapboxtoken.d.ts +13 -0
  202. package/dist/sgerp/types/simulation/mapboxtoken.d.ts.map +1 -0
  203. package/dist/sgerp/types/simulation/mapboxtoken.js +2 -0
  204. package/dist/sgerp/types/simulation/node.js +5 -2
  205. package/dist/sgerp/types/simulation/operationslocation.d.ts +40 -0
  206. package/dist/sgerp/types/simulation/operationslocation.d.ts.map +1 -0
  207. package/dist/sgerp/types/simulation/operationslocation.js +2 -0
  208. package/dist/sgerp/types/simulation/operationslocationgroup.d.ts +11 -0
  209. package/dist/sgerp/types/simulation/operationslocationgroup.d.ts.map +1 -0
  210. package/dist/sgerp/types/simulation/operationslocationgroup.js +2 -0
  211. package/dist/sgerp/types/simulation/pricing.d.ts +171 -0
  212. package/dist/sgerp/types/simulation/pricing.d.ts.map +1 -0
  213. package/dist/sgerp/types/simulation/pricing.js +2 -0
  214. package/dist/sgerp/types/simulation/route-cost-modification.d.ts +35 -0
  215. package/dist/sgerp/types/simulation/route-cost-modification.d.ts.map +1 -0
  216. package/dist/sgerp/types/simulation/route-cost-modification.js +5 -0
  217. package/dist/sgerp/types/simulation/routing-engine-settings.d.ts +42 -0
  218. package/dist/sgerp/types/simulation/routing-engine-settings.d.ts.map +1 -0
  219. package/dist/sgerp/types/simulation/routing-engine-settings.js +35 -0
  220. package/dist/sgerp/types/simulation/routingprofile.d.ts +32 -0
  221. package/dist/sgerp/types/simulation/routingprofile.d.ts.map +1 -0
  222. package/dist/sgerp/types/simulation/routingprofile.js +37 -0
  223. package/dist/sgerp/types/simulation/simulation.d.ts +120 -0
  224. package/dist/sgerp/types/simulation/simulation.d.ts.map +1 -0
  225. package/dist/sgerp/types/simulation/simulation.js +2 -0
  226. package/dist/sgerp/types/simulation/simulationprocessor.d.ts +31 -0
  227. package/dist/sgerp/types/simulation/simulationprocessor.d.ts.map +1 -0
  228. package/dist/sgerp/types/simulation/simulationprocessor.js +2 -0
  229. package/dist/sgerp/types/simulation/vehicle.js +2 -1
  230. package/dist/sgerp/types/simulation/vehicletype.d.ts +33 -0
  231. package/dist/sgerp/types/simulation/vehicletype.d.ts.map +1 -0
  232. package/dist/sgerp/types/simulation/vehicletype.js +2 -0
  233. package/dist/sgerp/types/sms_notify/smsscheduled.d.ts +36 -0
  234. package/dist/sgerp/types/sms_notify/smsscheduled.d.ts.map +1 -0
  235. package/dist/sgerp/types/sms_notify/smsscheduled.js +6 -0
  236. package/dist/sgerp/types/transportation/passenger.d.ts +49 -0
  237. package/dist/sgerp/types/transportation/passenger.d.ts.map +1 -0
  238. package/dist/sgerp/types/transportation/passenger.js +13 -0
  239. package/dist/sgerp/types/transportation/ticket.d.ts +31 -0
  240. package/dist/sgerp/types/transportation/ticket.d.ts.map +1 -0
  241. package/dist/sgerp/types/transportation/ticket.js +2 -0
  242. package/dist/sgerp/types/transportation/transaction.d.ts +71 -0
  243. package/dist/sgerp/types/transportation/transaction.d.ts.map +1 -0
  244. package/dist/sgerp/types/transportation/transaction.js +54 -0
  245. package/dist/sgerp/utils/bookingPayload.d.ts +80 -0
  246. package/dist/sgerp/utils/bookingPayload.d.ts.map +1 -0
  247. package/dist/sgerp/utils/bookingPayload.js +44 -0
  248. package/dist/sgerp/utils/color.d.ts +30 -0
  249. package/dist/sgerp/utils/color.d.ts.map +1 -0
  250. package/dist/sgerp/utils/color.js +117 -0
  251. package/dist/sgerp/utils/enum-helpers.d.ts +41 -0
  252. package/dist/sgerp/utils/enum-helpers.d.ts.map +1 -0
  253. package/dist/sgerp/utils/enum-helpers.js +54 -0
  254. package/dist/sgerp/utils/routeUtils.js +171 -0
  255. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { Collection } from '../../collection';
2
+ import type { User } from '../../types/account/user';
3
+ /**
4
+ * Collection for User models
5
+ */
6
+ export declare class UserCollection extends Collection<User> {
7
+ }
8
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/account/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD;;GAEG;AACH,qBAAa,cAAe,SAAQ,UAAU,CAAC,IAAI,CAAC;CAEnD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ /**
6
+ * Collection for User models
7
+ */
8
+ class UserCollection extends collection_1.Collection {
9
+ }
10
+ exports.UserCollection = UserCollection;
@@ -0,0 +1,26 @@
1
+ import { Collection } from "../../collection";
2
+ import type { Building } from "../../types/masstransit/building";
3
+ import type { SGERPListResponse } from "../../types/account/user";
4
+ import type { RequestConfig } from "../../types/config";
5
+ type FetchFunction<T> = (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<T>>;
6
+ export declare class BuildingCollection extends Collection<Building> {
7
+ constructor(fetchFn: FetchFunction<Building>);
8
+ /**
9
+ * Search buildings by postal code
10
+ */
11
+ searchByPostalCode(postalCode: string): Promise<Building[]>;
12
+ /**
13
+ * Search buildings by postal codes (multiple)
14
+ */
15
+ searchByPostalCodes(postalCodes: string[]): Promise<Building[]>;
16
+ /**
17
+ * Search buildings by name or address
18
+ */
19
+ searchByText(query: string): Promise<Building[]>;
20
+ /**
21
+ * Get buildings within a city
22
+ */
23
+ getByCityId(cityId: number): Promise<Building[]>;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=building.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"building.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/masstransit/building.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnC,qBAAa,kBAAmB,SAAQ,UAAU,CAAC,QAAQ,CAAC;gBAC9C,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC;IAI5C;;OAEG;IACG,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAQjE;;OAEG;IACG,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAYrE;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAQtD;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAOvD"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildingCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ class BuildingCollection extends collection_1.Collection {
6
+ constructor(fetchFn) {
7
+ super(fetchFn);
8
+ }
9
+ /**
10
+ * Search buildings by postal code
11
+ */
12
+ async searchByPostalCode(postalCode) {
13
+ await this.fetch({
14
+ postal_code: postalCode,
15
+ limit: 100,
16
+ });
17
+ return this.models;
18
+ }
19
+ /**
20
+ * Search buildings by postal codes (multiple)
21
+ */
22
+ async searchByPostalCodes(postalCodes) {
23
+ if (postalCodes.length === 0) {
24
+ return [];
25
+ }
26
+ await this.fetch({
27
+ postal_code__in: postalCodes.join(","),
28
+ limit: 1000,
29
+ });
30
+ return this.models;
31
+ }
32
+ /**
33
+ * Search buildings by name or address
34
+ */
35
+ async searchByText(query) {
36
+ await this.fetch({
37
+ extended_name__icontains: query,
38
+ limit: 100,
39
+ });
40
+ return this.models;
41
+ }
42
+ /**
43
+ * Get buildings within a city
44
+ */
45
+ async getByCityId(cityId) {
46
+ await this.fetch({
47
+ city_id: cityId,
48
+ limit: 1000,
49
+ });
50
+ return this.models;
51
+ }
52
+ }
53
+ exports.BuildingCollection = BuildingCollection;
@@ -0,0 +1,15 @@
1
+ import { Collection } from "../../collection";
2
+ import type { TransitStop } from "../../types/masstransit/transitstop";
3
+ import type { SGERPListResponse } from "../../types/account/user";
4
+ import type { RequestConfig } from "../../types/config";
5
+ type FetchFunction<T> = (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<T>>;
6
+ export declare class TransitStopCollection extends Collection<TransitStop> {
7
+ constructor(fetchFn: FetchFunction<TransitStop>);
8
+ searchByName(name: string): Promise<TransitStop[]>;
9
+ searchByCode(code: string): Promise<TransitStop[]>;
10
+ getByCityId(cityId: number): Promise<TransitStop[]>;
11
+ getByTransitStopSetId(transitStopSetId: number, orderBy?: string): Promise<TransitStop[]>;
12
+ searchByTransitStopSetId(transitStopSetId: number, searchTerm: string, orderBy?: string): Promise<TransitStop[]>;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=transitstop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitstop.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/masstransit/transitstop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnC,qBAAa,qBAAsB,SAAQ,UAAU,CAAC,WAAW,CAAC;gBACpD,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC;IAKzC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAMlD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAMlD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAMnD,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,GAAE,MAAwB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAmB1G,wBAAwB,CAC5B,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,MAAwB,GAChC,OAAO,CAAC,WAAW,EAAE,CAAC;CAmB1B"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransitStopCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ const client_1 = require("../../api/client");
6
+ class TransitStopCollection extends collection_1.Collection {
7
+ constructor(fetchFn) {
8
+ super(fetchFn);
9
+ }
10
+ // Helper method to search by name
11
+ async searchByName(name) {
12
+ await this.fetch({ name__icontains: name, limit: 100 });
13
+ return this.models;
14
+ }
15
+ // Helper method to search by code
16
+ async searchByCode(code) {
17
+ await this.fetch({ code__icontains: code, limit: 100 });
18
+ return this.models;
19
+ }
20
+ // Helper method to get transit stops by city
21
+ async getByCityId(cityId) {
22
+ await this.fetch({ city_id: cityId, limit: 1000 });
23
+ return this.models;
24
+ }
25
+ // Helper method to get transit stops by transitstopset_id using legacy API
26
+ async getByTransitStopSetId(transitStopSetId, orderBy = 'extended_name') {
27
+ const params = new URLSearchParams({
28
+ transitstopset_id: String(transitStopSetId),
29
+ order_by: orderBy,
30
+ offset: '0',
31
+ limit: '1000'
32
+ });
33
+ const response = await client_1.APIClient.get(`/api/v2/transitstop?${params.toString()}`);
34
+ // Add the models to the collection
35
+ this.add(response.data.objects);
36
+ return response.data.objects;
37
+ }
38
+ // Helper method to search transit stops by name within a transitstopset
39
+ async searchByTransitStopSetId(transitStopSetId, searchTerm, orderBy = 'extended_name') {
40
+ const params = new URLSearchParams({
41
+ transitstopset_id: String(transitStopSetId),
42
+ order_by: orderBy,
43
+ offset: '0',
44
+ limit: '100'
45
+ });
46
+ // Add search filter for name or extended_name
47
+ if (searchTerm) {
48
+ params.append('extended_name__icontains', searchTerm);
49
+ }
50
+ const response = await client_1.APIClient.get(`/api/v2/transitstop?${params.toString()}`);
51
+ return response.data.objects;
52
+ }
53
+ }
54
+ exports.TransitStopCollection = TransitStopCollection;
@@ -0,0 +1,10 @@
1
+ import { Collection } from "../../collection";
2
+ import type { TransitStopSet } from "../../types/masstransit/transitstopset";
3
+ import type { SGERPListResponse } from "../../types/account/user";
4
+ import type { RequestConfig } from "../../types/config";
5
+ type FetchFunction<T> = (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<T>>;
6
+ export declare class TransitStopSetCollection extends Collection<TransitStopSet> {
7
+ constructor(fetchFn: FetchFunction<TransitStopSet>);
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=transitstopset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitstopset.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/masstransit/transitstopset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnC,qBAAa,wBAAyB,SAAQ,UAAU,CAAC,cAAc,CAAC;gBAC1D,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC;CAGnD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransitStopSetCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ class TransitStopSetCollection extends collection_1.Collection {
6
+ constructor(fetchFn) {
7
+ super(fetchFn);
8
+ }
9
+ }
10
+ exports.TransitStopSetCollection = TransitStopSetCollection;
@@ -0,0 +1,11 @@
1
+ import { Collection } from '../../collection';
2
+ import type { OrganizationProject } from '../../types/sharing/organization-project';
3
+ import type { SGERPListResponse } from '../../types/account/user';
4
+ import type { RequestConfig } from '../../types/config';
5
+ /**
6
+ * Collection class for OrganizationProject models
7
+ */
8
+ export declare class OrganizationProjectCollection extends Collection<OrganizationProject> {
9
+ constructor(fetchFn: (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<OrganizationProject>>);
10
+ }
11
+ //# sourceMappingURL=organization-project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-project.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/sharing/organization-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,UAAU,CAAC,mBAAmB,CAAC;gBAE9E,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;CAIzG"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationProjectCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ /**
6
+ * Collection class for OrganizationProject models
7
+ */
8
+ class OrganizationProjectCollection extends collection_1.Collection {
9
+ constructor(fetchFn) {
10
+ super(fetchFn);
11
+ }
12
+ }
13
+ exports.OrganizationProjectCollection = OrganizationProjectCollection;
@@ -0,0 +1,11 @@
1
+ import { Collection } from '../../collection';
2
+ import type { Organization } from '../../types/sharing/organization';
3
+ import type { SGERPListResponse } from '../../types/account/user';
4
+ import type { RequestConfig } from '../../types/config';
5
+ /**
6
+ * Collection class for Organization models
7
+ */
8
+ export declare class OrganizationCollection extends Collection<Organization> {
9
+ constructor(fetchFn: (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<Organization>>);
10
+ }
11
+ //# sourceMappingURL=organization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/sharing/organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,UAAU,CAAC,YAAY,CAAC;gBAEhE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;CAIlG"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ /**
6
+ * Collection class for Organization models
7
+ */
8
+ class OrganizationCollection extends collection_1.Collection {
9
+ constructor(fetchFn) {
10
+ super(fetchFn);
11
+ }
12
+ }
13
+ exports.OrganizationCollection = OrganizationCollection;
@@ -0,0 +1,18 @@
1
+ import { Collection } from "../../collection";
2
+ import type { Pricing } from "../../types/sharing/pricing";
3
+ import type { SGERPListResponse } from "../../types/account/user";
4
+ import type { RequestConfig } from "../../types/config";
5
+ type FetchFunction<T> = (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<T>>;
6
+ export declare class PricingCollection extends Collection<Pricing> {
7
+ constructor(fetchFn: FetchFunction<Pricing>);
8
+ /**
9
+ * Find pricing by project ID
10
+ */
11
+ fetchByProject(projectId: number): Promise<Pricing[]>;
12
+ /**
13
+ * Find pricing by name
14
+ */
15
+ findByName(name: string): Pricing | undefined;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=pricing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/sharing/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnC,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,OAAO,CAAC;gBAC5C,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC;IAI3C;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAK3D;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;CAG9C"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PricingCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ class PricingCollection extends collection_1.Collection {
6
+ constructor(fetchFn) {
7
+ super(fetchFn);
8
+ }
9
+ /**
10
+ * Find pricing by project ID
11
+ */
12
+ async fetchByProject(projectId) {
13
+ await this.fetch({ project_id: projectId, limit: 100 });
14
+ return this.models;
15
+ }
16
+ /**
17
+ * Find pricing by name
18
+ */
19
+ findByName(name) {
20
+ return this.findWhere({ name });
21
+ }
22
+ }
23
+ exports.PricingCollection = PricingCollection;
@@ -0,0 +1,8 @@
1
+ import { Collection } from '../../collection';
2
+ import type { ProjectMember } from '../../types/sharing/project-member';
3
+ /**
4
+ * Collection for ProjectMember models
5
+ */
6
+ export declare class ProjectMemberCollection extends Collection<ProjectMember> {
7
+ }
8
+ //# sourceMappingURL=project-member.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-member.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/sharing/project-member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAExE;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,UAAU,CAAC,aAAa,CAAC;CAErE"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectMemberCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ /**
6
+ * Collection for ProjectMember models
7
+ */
8
+ class ProjectMemberCollection extends collection_1.Collection {
9
+ }
10
+ exports.ProjectMemberCollection = ProjectMemberCollection;
@@ -0,0 +1,8 @@
1
+ import { Collection } from '../../collection';
2
+ import type { Project } from '../../types/sharing/project';
3
+ /**
4
+ * Collection for Project models
5
+ */
6
+ export declare class ProjectCollection extends Collection<Project> {
7
+ }
8
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/sharing/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,OAAO,CAAC;CAEzD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ /**
6
+ * Collection for Project models
7
+ */
8
+ class ProjectCollection extends collection_1.Collection {
9
+ }
10
+ exports.ProjectCollection = ProjectCollection;
@@ -0,0 +1,11 @@
1
+ import { Collection } from '../../collection';
2
+ import type { Booking } from '../../types/simulation/booking';
3
+ import type { SGERPListResponse } from '../../types/account/user';
4
+ import type { RequestConfig } from '../../types/config';
5
+ /**
6
+ * Collection class for Booking models
7
+ */
8
+ export declare class BookingCollection extends Collection<Booking> {
9
+ constructor(fetchFn: (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<Booking>>);
10
+ }
11
+ //# sourceMappingURL=booking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/simulation/booking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,OAAO,CAAC;gBAEtD,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;CAI7F"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BookingCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ /**
6
+ * Collection class for Booking models
7
+ */
8
+ class BookingCollection extends collection_1.Collection {
9
+ constructor(fetchFn) {
10
+ super(fetchFn);
11
+ }
12
+ }
13
+ exports.BookingCollection = BookingCollection;
@@ -0,0 +1,14 @@
1
+ import { Collection } from "../../collection";
2
+ import type { Dataset } from "../../types/simulation/dataset";
3
+ import type { SGERPListResponse } from "../../types/account/user";
4
+ import type { RequestConfig } from "../../types/config";
5
+ type FetchFunction<T> = (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<T>>;
6
+ export declare class DatasetCollection extends Collection<Dataset> {
7
+ constructor(fetchFn: FetchFunction<Dataset>);
8
+ /**
9
+ * Find dataset by project ID
10
+ */
11
+ findByProject(projectId: number): Promise<Dataset | null>;
12
+ }
13
+ export {};
14
+ //# sourceMappingURL=dataset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/simulation/dataset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnC,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,OAAO,CAAC;gBAC5C,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC;IAI3C;;OAEG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAIhE"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatasetCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ class DatasetCollection extends collection_1.Collection {
6
+ constructor(fetchFn) {
7
+ super(fetchFn);
8
+ }
9
+ /**
10
+ * Find dataset by project ID
11
+ */
12
+ async findByProject(projectId) {
13
+ await this.fetch({ project_id: projectId, order_by: '-id', limit: 1 });
14
+ return this.models[0] || null;
15
+ }
16
+ }
17
+ exports.DatasetCollection = DatasetCollection;
@@ -0,0 +1,12 @@
1
+ import { Collection } from '../../collection';
2
+ import type { Driver } from '../../types/simulation/driver';
3
+ import type { User, SGERPListResponse } from '../../types/account/user';
4
+ import type { ProjectMember } from '../../types/sharing/project-member';
5
+ import type { RequestConfig } from '../../types/config';
6
+ /**
7
+ * Collection class for Driver models with automatic user and projectmember data fetching
8
+ */
9
+ export declare class DriverCollection extends Collection<Driver> {
10
+ constructor(fetchFn: (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<Driver>>, userFetchFn?: (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<User>>, projectMemberFetchFn?: (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<ProjectMember>>);
11
+ }
12
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/simulation/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,MAAM,CAAC;gBAEpD,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,EACzF,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,EAC5F,oBAAoB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAiCjH"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DriverCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ /**
6
+ * Collection class for Driver models with automatic user and projectmember data fetching
7
+ */
8
+ class DriverCollection extends collection_1.Collection {
9
+ constructor(fetchFn, userFetchFn, projectMemberFetchFn) {
10
+ super(fetchFn);
11
+ // Register dependent call to fetch user data (one-to-one)
12
+ if (userFetchFn) {
13
+ this.registerDependentCall({
14
+ collectionName: 'user',
15
+ extractIds: (driver) => driver.user_id,
16
+ targetField: 'user',
17
+ idParam: 'id__in',
18
+ onlyFields: ['id', 'username', 'organization_id', 'first_name', 'last_name', 'email'],
19
+ fetchFn: userFetchFn,
20
+ });
21
+ }
22
+ // Register dependent call to fetch project memberships (one-to-many)
23
+ if (projectMemberFetchFn) {
24
+ this.registerDependentCall({
25
+ collectionName: 'projectmember',
26
+ extractIds: (driver) => driver.user_id,
27
+ targetField: 'projectMembers',
28
+ idParam: 'user_id__in',
29
+ onlyFields: ['id', 'user_id', 'project_id'],
30
+ matchField: 'user_id',
31
+ isArray: true,
32
+ extraParams: {
33
+ project__organizations__type: 'participation',
34
+ },
35
+ fetchFn: projectMemberFetchFn,
36
+ });
37
+ }
38
+ }
39
+ }
40
+ exports.DriverCollection = DriverCollection;
@@ -0,0 +1,24 @@
1
+ import { Collection } from "../../collection";
2
+ import type { Geofence } from "../../types/simulation/geofence";
3
+ import type { SGERPListResponse } from "../../types/account/user";
4
+ import type { RequestConfig } from "../../types/config";
5
+ import type { GeoJSONFeatureCollection } from "../../types/geojson";
6
+ type FetchFunction<T> = (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<T>>;
7
+ export declare class GeofenceCollection extends Collection<Geofence> {
8
+ constructor(fetchFn: FetchFunction<Geofence>);
9
+ /**
10
+ * Fetch geofences for a specific project
11
+ */
12
+ fetchByProject(projectId: number): Promise<Geofence[]>;
13
+ /**
14
+ * Find geofences by name (case-insensitive contains)
15
+ */
16
+ searchByName(name: string): Promise<Geofence[]>;
17
+ /**
18
+ * Convert geofences to GeoJSON FeatureCollection
19
+ * Handles both direct Polygon geometry and FeatureCollection geometry
20
+ */
21
+ toGeoJSON(): GeoJSONFeatureCollection;
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=geofence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geofence.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/simulation/geofence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnC,qBAAa,kBAAmB,SAAQ,UAAU,CAAC,QAAQ,CAAC;gBAC9C,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC;IAI5C;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAK5D;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAKrD;;;OAGG;IACH,SAAS,IAAI,wBAAwB;CA2CtC"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeofenceCollection = void 0;
4
+ const collection_1 = require("../../collection");
5
+ class GeofenceCollection extends collection_1.Collection {
6
+ constructor(fetchFn) {
7
+ super(fetchFn);
8
+ }
9
+ /**
10
+ * Fetch geofences for a specific project
11
+ */
12
+ async fetchByProject(projectId) {
13
+ await this.fetch({ project_id: projectId, limit: 1000 });
14
+ return this.models;
15
+ }
16
+ /**
17
+ * Find geofences by name (case-insensitive contains)
18
+ */
19
+ async searchByName(name) {
20
+ await this.fetch({ name__icontains: name, limit: 100 });
21
+ return this.models;
22
+ }
23
+ /**
24
+ * Convert geofences to GeoJSON FeatureCollection
25
+ * Handles both direct Polygon geometry and FeatureCollection geometry
26
+ */
27
+ toGeoJSON() {
28
+ const features = this.models.flatMap(geofence => {
29
+ var _a;
30
+ const baseProperties = {
31
+ id: geofence.id,
32
+ key: geofence.key,
33
+ name: geofence.name,
34
+ description: geofence.description,
35
+ status: geofence.status,
36
+ creation_type: geofence.creation_type,
37
+ project_id: geofence.project_id,
38
+ color: ((_a = geofence.display_options) === null || _a === void 0 ? void 0 : _a.color) || '#3b82f6',
39
+ created_at: geofence.created_at,
40
+ modified_at: geofence.modified_at,
41
+ };
42
+ // Check if geometry is a FeatureCollection
43
+ if (geofence.geometry.type === 'FeatureCollection') {
44
+ // Extract features from the FeatureCollection and merge properties
45
+ return geofence.geometry.features.map(feature => ({
46
+ type: 'Feature',
47
+ id: geofence.id,
48
+ geometry: feature.geometry,
49
+ properties: Object.assign(Object.assign({}, baseProperties), feature.properties),
50
+ }));
51
+ }
52
+ // Direct Polygon geometry
53
+ return [{
54
+ type: 'Feature',
55
+ id: geofence.id,
56
+ geometry: geofence.geometry,
57
+ properties: baseProperties,
58
+ }];
59
+ });
60
+ return {
61
+ type: 'FeatureCollection',
62
+ features,
63
+ };
64
+ }
65
+ }
66
+ exports.GeofenceCollection = GeofenceCollection;
@@ -0,0 +1,18 @@
1
+ import { Collection } from "../../collection";
2
+ import type { MapboxToken } from "../../types/simulation/mapboxtoken";
3
+ import type { SGERPListResponse } from "../../types/account/user";
4
+ import type { RequestConfig } from "../../types/config";
5
+ type FetchFunction<T> = (params?: unknown, config?: RequestConfig) => Promise<SGERPListResponse<T>>;
6
+ export declare class MapboxTokenCollection extends Collection<MapboxToken> {
7
+ constructor(fetchFn: FetchFunction<MapboxToken>);
8
+ /**
9
+ * Fetch mapbox tokens for a specific project
10
+ */
11
+ fetchByProject(projectId: number): Promise<MapboxToken[]>;
12
+ /**
13
+ * Find active tokens for a project
14
+ */
15
+ fetchActiveByProject(projectId: number): Promise<MapboxToken[]>;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=mapboxtoken.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapboxtoken.d.ts","sourceRoot":"","sources":["../../../../sgerplib/sgerp/collections/simulation/mapboxtoken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,KAAK,aAAa,CAAC,CAAC,IAAI,CACtB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,aAAa,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnC,qBAAa,qBAAsB,SAAQ,UAAU,CAAC,WAAW,CAAC;gBACpD,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC;IAI/C;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAK/D;;OAEG;IACG,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAItE"}