@qwickapps/server 1.3.1 → 1.5.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.
Files changed (395) hide show
  1. package/README.md +157 -0
  2. package/dist/core/control-panel.d.ts.map +1 -1
  3. package/dist/core/control-panel.js +114 -0
  4. package/dist/core/control-panel.js.map +1 -1
  5. package/dist/core/types.d.ts +19 -0
  6. package/dist/core/types.d.ts.map +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +15 -3
  10. package/dist/index.js.map +1 -1
  11. package/dist/plugins/auth/adapter-wrapper.d.ts +47 -0
  12. package/dist/plugins/auth/adapter-wrapper.d.ts.map +1 -0
  13. package/dist/plugins/auth/adapter-wrapper.js +166 -0
  14. package/dist/plugins/auth/adapter-wrapper.js.map +1 -0
  15. package/dist/plugins/auth/adapter-wrapper.test.d.ts +7 -0
  16. package/dist/plugins/auth/adapter-wrapper.test.d.ts.map +1 -0
  17. package/dist/plugins/auth/adapter-wrapper.test.js +303 -0
  18. package/dist/plugins/auth/adapter-wrapper.test.js.map +1 -0
  19. package/dist/plugins/auth/config-store.d.ts +11 -0
  20. package/dist/plugins/auth/config-store.d.ts.map +1 -0
  21. package/dist/plugins/auth/config-store.js +232 -0
  22. package/dist/plugins/auth/config-store.js.map +1 -0
  23. package/dist/plugins/auth/config-store.test.d.ts +7 -0
  24. package/dist/plugins/auth/config-store.test.d.ts.map +1 -0
  25. package/dist/plugins/auth/config-store.test.js +299 -0
  26. package/dist/plugins/auth/config-store.test.js.map +1 -0
  27. package/dist/plugins/auth/env-config.d.ts +51 -1
  28. package/dist/plugins/auth/env-config.d.ts.map +1 -1
  29. package/dist/plugins/auth/env-config.js +640 -7
  30. package/dist/plugins/auth/env-config.js.map +1 -1
  31. package/dist/plugins/auth/index.d.ts +6 -2
  32. package/dist/plugins/auth/index.d.ts.map +1 -1
  33. package/dist/plugins/auth/index.js +5 -1
  34. package/dist/plugins/auth/index.js.map +1 -1
  35. package/dist/plugins/auth/types.d.ts +106 -0
  36. package/dist/plugins/auth/types.d.ts.map +1 -1
  37. package/dist/plugins/bans/bans-plugin.d.ts.map +1 -1
  38. package/dist/plugins/bans/bans-plugin.js +12 -3
  39. package/dist/plugins/bans/bans-plugin.js.map +1 -1
  40. package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts +11 -0
  41. package/dist/plugins/devices/__tests__/devices-plugin.test.d.ts.map +1 -0
  42. package/dist/plugins/devices/__tests__/devices-plugin.test.js +410 -0
  43. package/dist/plugins/devices/__tests__/devices-plugin.test.js.map +1 -0
  44. package/dist/plugins/devices/__tests__/token-utils.test.d.ts +7 -0
  45. package/dist/plugins/devices/__tests__/token-utils.test.d.ts.map +1 -0
  46. package/dist/plugins/devices/__tests__/token-utils.test.js +197 -0
  47. package/dist/plugins/devices/__tests__/token-utils.test.js.map +1 -0
  48. package/dist/plugins/devices/adapters/compute-adapter.d.ts +36 -0
  49. package/dist/plugins/devices/adapters/compute-adapter.d.ts.map +1 -0
  50. package/dist/plugins/devices/adapters/compute-adapter.js +100 -0
  51. package/dist/plugins/devices/adapters/compute-adapter.js.map +1 -0
  52. package/dist/plugins/devices/adapters/index.d.ts +12 -0
  53. package/dist/plugins/devices/adapters/index.d.ts.map +1 -0
  54. package/dist/plugins/devices/adapters/index.js +10 -0
  55. package/dist/plugins/devices/adapters/index.js.map +1 -0
  56. package/dist/plugins/devices/adapters/mobile-adapter.d.ts +41 -0
  57. package/dist/plugins/devices/adapters/mobile-adapter.d.ts.map +1 -0
  58. package/dist/plugins/devices/adapters/mobile-adapter.js +131 -0
  59. package/dist/plugins/devices/adapters/mobile-adapter.js.map +1 -0
  60. package/dist/plugins/devices/devices-plugin.d.ts +70 -0
  61. package/dist/plugins/devices/devices-plugin.d.ts.map +1 -0
  62. package/dist/plugins/devices/devices-plugin.js +453 -0
  63. package/dist/plugins/devices/devices-plugin.js.map +1 -0
  64. package/dist/plugins/devices/index.d.ts +18 -0
  65. package/dist/plugins/devices/index.d.ts.map +1 -0
  66. package/dist/plugins/devices/index.js +18 -0
  67. package/dist/plugins/devices/index.js.map +1 -0
  68. package/dist/plugins/devices/stores/index.d.ts +9 -0
  69. package/dist/plugins/devices/stores/index.d.ts.map +1 -0
  70. package/dist/plugins/devices/stores/index.js +9 -0
  71. package/dist/plugins/devices/stores/index.js.map +1 -0
  72. package/dist/plugins/devices/stores/postgres-store.d.ts +26 -0
  73. package/dist/plugins/devices/stores/postgres-store.d.ts.map +1 -0
  74. package/dist/plugins/devices/stores/postgres-store.js +199 -0
  75. package/dist/plugins/devices/stores/postgres-store.js.map +1 -0
  76. package/dist/plugins/devices/token-utils.d.ts +100 -0
  77. package/dist/plugins/devices/token-utils.d.ts.map +1 -0
  78. package/dist/plugins/devices/token-utils.js +162 -0
  79. package/dist/plugins/devices/token-utils.js.map +1 -0
  80. package/dist/plugins/devices/types.d.ts +307 -0
  81. package/dist/plugins/devices/types.d.ts.map +1 -0
  82. package/dist/plugins/devices/types.js +10 -0
  83. package/dist/plugins/devices/types.js.map +1 -0
  84. package/dist/plugins/index.d.ts +18 -4
  85. package/dist/plugins/index.d.ts.map +1 -1
  86. package/dist/plugins/index.js +16 -2
  87. package/dist/plugins/index.js.map +1 -1
  88. package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts +5 -0
  89. package/dist/plugins/notifications/__tests__/notifications-manager.test.d.ts.map +1 -0
  90. package/dist/plugins/notifications/__tests__/notifications-manager.test.js +470 -0
  91. package/dist/plugins/notifications/__tests__/notifications-manager.test.js.map +1 -0
  92. package/dist/plugins/notifications/index.d.ts +71 -0
  93. package/dist/plugins/notifications/index.d.ts.map +1 -0
  94. package/dist/plugins/notifications/index.js +72 -0
  95. package/dist/plugins/notifications/index.js.map +1 -0
  96. package/dist/plugins/notifications/notifications-manager.d.ts +182 -0
  97. package/dist/plugins/notifications/notifications-manager.d.ts.map +1 -0
  98. package/dist/plugins/notifications/notifications-manager.js +610 -0
  99. package/dist/plugins/notifications/notifications-manager.js.map +1 -0
  100. package/dist/plugins/notifications/notifications-plugin.d.ts +83 -0
  101. package/dist/plugins/notifications/notifications-plugin.d.ts.map +1 -0
  102. package/dist/plugins/notifications/notifications-plugin.js +337 -0
  103. package/dist/plugins/notifications/notifications-plugin.js.map +1 -0
  104. package/dist/plugins/notifications/types.d.ts +164 -0
  105. package/dist/plugins/notifications/types.d.ts.map +1 -0
  106. package/dist/plugins/notifications/types.js +9 -0
  107. package/dist/plugins/notifications/types.js.map +1 -0
  108. package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts +12 -0
  109. package/dist/plugins/parental/__tests__/parental-plugin.test.d.ts.map +1 -0
  110. package/dist/plugins/parental/__tests__/parental-plugin.test.js +349 -0
  111. package/dist/plugins/parental/__tests__/parental-plugin.test.js.map +1 -0
  112. package/dist/plugins/parental/adapters/index.d.ts +8 -0
  113. package/dist/plugins/parental/adapters/index.d.ts.map +1 -0
  114. package/dist/plugins/parental/adapters/index.js +7 -0
  115. package/dist/plugins/parental/adapters/index.js.map +1 -0
  116. package/dist/plugins/parental/adapters/kids-adapter.d.ts +24 -0
  117. package/dist/plugins/parental/adapters/kids-adapter.d.ts.map +1 -0
  118. package/dist/plugins/parental/adapters/kids-adapter.js +174 -0
  119. package/dist/plugins/parental/adapters/kids-adapter.js.map +1 -0
  120. package/dist/plugins/parental/index.d.ts +14 -0
  121. package/dist/plugins/parental/index.d.ts.map +1 -0
  122. package/dist/plugins/parental/index.js +15 -0
  123. package/dist/plugins/parental/index.js.map +1 -0
  124. package/dist/plugins/parental/parental-plugin.d.ts +88 -0
  125. package/dist/plugins/parental/parental-plugin.d.ts.map +1 -0
  126. package/dist/plugins/parental/parental-plugin.js +666 -0
  127. package/dist/plugins/parental/parental-plugin.js.map +1 -0
  128. package/dist/plugins/parental/stores/index.d.ts +7 -0
  129. package/dist/plugins/parental/stores/index.d.ts.map +1 -0
  130. package/dist/plugins/parental/stores/index.js +7 -0
  131. package/dist/plugins/parental/stores/index.js.map +1 -0
  132. package/dist/plugins/parental/stores/postgres-store.d.ts +10 -0
  133. package/dist/plugins/parental/stores/postgres-store.d.ts.map +1 -0
  134. package/dist/plugins/parental/stores/postgres-store.js +209 -0
  135. package/dist/plugins/parental/stores/postgres-store.js.map +1 -0
  136. package/dist/plugins/parental/types.d.ts +154 -0
  137. package/dist/plugins/parental/types.d.ts.map +1 -0
  138. package/dist/plugins/parental/types.js +10 -0
  139. package/dist/plugins/parental/types.js.map +1 -0
  140. package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts +11 -0
  141. package/dist/plugins/profiles/__tests__/profiles-plugin.test.d.ts.map +1 -0
  142. package/dist/plugins/profiles/__tests__/profiles-plugin.test.js +243 -0
  143. package/dist/plugins/profiles/__tests__/profiles-plugin.test.js.map +1 -0
  144. package/dist/plugins/profiles/index.d.ts +12 -0
  145. package/dist/plugins/profiles/index.d.ts.map +1 -0
  146. package/dist/plugins/profiles/index.js +13 -0
  147. package/dist/plugins/profiles/index.js.map +1 -0
  148. package/dist/plugins/profiles/profiles-plugin.d.ts +71 -0
  149. package/dist/plugins/profiles/profiles-plugin.d.ts.map +1 -0
  150. package/dist/plugins/profiles/profiles-plugin.js +481 -0
  151. package/dist/plugins/profiles/profiles-plugin.js.map +1 -0
  152. package/dist/plugins/profiles/stores/index.d.ts +9 -0
  153. package/dist/plugins/profiles/stores/index.d.ts.map +1 -0
  154. package/dist/plugins/profiles/stores/index.js +9 -0
  155. package/dist/plugins/profiles/stores/index.js.map +1 -0
  156. package/dist/plugins/profiles/stores/postgres-store.d.ts +18 -0
  157. package/dist/plugins/profiles/stores/postgres-store.d.ts.map +1 -0
  158. package/dist/plugins/profiles/stores/postgres-store.js +310 -0
  159. package/dist/plugins/profiles/stores/postgres-store.js.map +1 -0
  160. package/dist/plugins/profiles/types.d.ts +289 -0
  161. package/dist/plugins/profiles/types.d.ts.map +1 -0
  162. package/dist/plugins/profiles/types.js +10 -0
  163. package/dist/plugins/profiles/types.js.map +1 -0
  164. package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts +7 -0
  165. package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.d.ts.map +1 -0
  166. package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js +220 -0
  167. package/dist/plugins/rate-limit/__tests__/rate-limit-plugin.test.js.map +1 -0
  168. package/dist/plugins/rate-limit/cleanup.d.ts +40 -0
  169. package/dist/plugins/rate-limit/cleanup.d.ts.map +1 -0
  170. package/dist/plugins/rate-limit/cleanup.js +72 -0
  171. package/dist/plugins/rate-limit/cleanup.js.map +1 -0
  172. package/dist/plugins/rate-limit/env-config.d.ts +91 -0
  173. package/dist/plugins/rate-limit/env-config.d.ts.map +1 -0
  174. package/dist/plugins/rate-limit/env-config.js +318 -0
  175. package/dist/plugins/rate-limit/env-config.js.map +1 -0
  176. package/dist/plugins/rate-limit/index.d.ts +76 -0
  177. package/dist/plugins/rate-limit/index.d.ts.map +1 -0
  178. package/dist/plugins/rate-limit/index.js +79 -0
  179. package/dist/plugins/rate-limit/index.js.map +1 -0
  180. package/dist/plugins/rate-limit/middleware.d.ts +40 -0
  181. package/dist/plugins/rate-limit/middleware.d.ts.map +1 -0
  182. package/dist/plugins/rate-limit/middleware.js +169 -0
  183. package/dist/plugins/rate-limit/middleware.js.map +1 -0
  184. package/dist/plugins/rate-limit/rate-limit-plugin.d.ts +44 -0
  185. package/dist/plugins/rate-limit/rate-limit-plugin.d.ts.map +1 -0
  186. package/dist/plugins/rate-limit/rate-limit-plugin.js +354 -0
  187. package/dist/plugins/rate-limit/rate-limit-plugin.js.map +1 -0
  188. package/dist/plugins/rate-limit/rate-limit-service.d.ts +110 -0
  189. package/dist/plugins/rate-limit/rate-limit-service.d.ts.map +1 -0
  190. package/dist/plugins/rate-limit/rate-limit-service.js +172 -0
  191. package/dist/plugins/rate-limit/rate-limit-service.js.map +1 -0
  192. package/dist/plugins/rate-limit/stores/cache-store.d.ts +33 -0
  193. package/dist/plugins/rate-limit/stores/cache-store.d.ts.map +1 -0
  194. package/dist/plugins/rate-limit/stores/cache-store.js +225 -0
  195. package/dist/plugins/rate-limit/stores/cache-store.js.map +1 -0
  196. package/dist/plugins/rate-limit/stores/index.d.ts +8 -0
  197. package/dist/plugins/rate-limit/stores/index.d.ts.map +1 -0
  198. package/dist/plugins/rate-limit/stores/index.js +8 -0
  199. package/dist/plugins/rate-limit/stores/index.js.map +1 -0
  200. package/dist/plugins/rate-limit/stores/postgres-store.d.ts +34 -0
  201. package/dist/plugins/rate-limit/stores/postgres-store.d.ts.map +1 -0
  202. package/dist/plugins/rate-limit/stores/postgres-store.js +320 -0
  203. package/dist/plugins/rate-limit/stores/postgres-store.js.map +1 -0
  204. package/dist/plugins/rate-limit/strategies/fixed-window.d.ts +21 -0
  205. package/dist/plugins/rate-limit/strategies/fixed-window.d.ts.map +1 -0
  206. package/dist/plugins/rate-limit/strategies/fixed-window.js +97 -0
  207. package/dist/plugins/rate-limit/strategies/fixed-window.js.map +1 -0
  208. package/dist/plugins/rate-limit/strategies/index.d.ts +14 -0
  209. package/dist/plugins/rate-limit/strategies/index.d.ts.map +1 -0
  210. package/dist/plugins/rate-limit/strategies/index.js +27 -0
  211. package/dist/plugins/rate-limit/strategies/index.js.map +1 -0
  212. package/dist/plugins/rate-limit/strategies/sliding-window.d.ts +22 -0
  213. package/dist/plugins/rate-limit/strategies/sliding-window.d.ts.map +1 -0
  214. package/dist/plugins/rate-limit/strategies/sliding-window.js +122 -0
  215. package/dist/plugins/rate-limit/strategies/sliding-window.js.map +1 -0
  216. package/dist/plugins/rate-limit/strategies/token-bucket.d.ts +28 -0
  217. package/dist/plugins/rate-limit/strategies/token-bucket.d.ts.map +1 -0
  218. package/dist/plugins/rate-limit/strategies/token-bucket.js +121 -0
  219. package/dist/plugins/rate-limit/strategies/token-bucket.js.map +1 -0
  220. package/dist/plugins/rate-limit/types.d.ts +265 -0
  221. package/dist/plugins/rate-limit/types.d.ts.map +1 -0
  222. package/dist/plugins/rate-limit/types.js +9 -0
  223. package/dist/plugins/rate-limit/types.js.map +1 -0
  224. package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts +11 -0
  225. package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.d.ts.map +1 -0
  226. package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js +305 -0
  227. package/dist/plugins/subscriptions/__tests__/subscriptions-plugin.test.js.map +1 -0
  228. package/dist/plugins/subscriptions/index.d.ts +12 -0
  229. package/dist/plugins/subscriptions/index.d.ts.map +1 -0
  230. package/dist/plugins/subscriptions/index.js +13 -0
  231. package/dist/plugins/subscriptions/index.js.map +1 -0
  232. package/dist/plugins/subscriptions/stores/index.d.ts +9 -0
  233. package/dist/plugins/subscriptions/stores/index.d.ts.map +1 -0
  234. package/dist/plugins/subscriptions/stores/index.js +9 -0
  235. package/dist/plugins/subscriptions/stores/index.js.map +1 -0
  236. package/dist/plugins/subscriptions/stores/postgres-store.d.ts +14 -0
  237. package/dist/plugins/subscriptions/stores/postgres-store.d.ts.map +1 -0
  238. package/dist/plugins/subscriptions/stores/postgres-store.js +359 -0
  239. package/dist/plugins/subscriptions/stores/postgres-store.js.map +1 -0
  240. package/dist/plugins/subscriptions/subscriptions-plugin.d.ts +82 -0
  241. package/dist/plugins/subscriptions/subscriptions-plugin.d.ts.map +1 -0
  242. package/dist/plugins/subscriptions/subscriptions-plugin.js +449 -0
  243. package/dist/plugins/subscriptions/subscriptions-plugin.js.map +1 -0
  244. package/dist/plugins/subscriptions/types.d.ts +308 -0
  245. package/dist/plugins/subscriptions/types.d.ts.map +1 -0
  246. package/dist/plugins/subscriptions/types.js +10 -0
  247. package/dist/plugins/subscriptions/types.js.map +1 -0
  248. package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts +11 -0
  249. package/dist/plugins/usage/__tests__/usage-plugin.test.d.ts.map +1 -0
  250. package/dist/plugins/usage/__tests__/usage-plugin.test.js +218 -0
  251. package/dist/plugins/usage/__tests__/usage-plugin.test.js.map +1 -0
  252. package/dist/plugins/usage/index.d.ts +12 -0
  253. package/dist/plugins/usage/index.d.ts.map +1 -0
  254. package/dist/plugins/usage/index.js +13 -0
  255. package/dist/plugins/usage/index.js.map +1 -0
  256. package/dist/plugins/usage/stores/index.d.ts +9 -0
  257. package/dist/plugins/usage/stores/index.d.ts.map +1 -0
  258. package/dist/plugins/usage/stores/index.js +9 -0
  259. package/dist/plugins/usage/stores/index.js.map +1 -0
  260. package/dist/plugins/usage/stores/postgres-store.d.ts +14 -0
  261. package/dist/plugins/usage/stores/postgres-store.d.ts.map +1 -0
  262. package/dist/plugins/usage/stores/postgres-store.js +146 -0
  263. package/dist/plugins/usage/stores/postgres-store.js.map +1 -0
  264. package/dist/plugins/usage/types.d.ts +195 -0
  265. package/dist/plugins/usage/types.d.ts.map +1 -0
  266. package/dist/plugins/usage/types.js +10 -0
  267. package/dist/plugins/usage/types.js.map +1 -0
  268. package/dist/plugins/usage/usage-plugin.d.ts +51 -0
  269. package/dist/plugins/usage/usage-plugin.d.ts.map +1 -0
  270. package/dist/plugins/usage/usage-plugin.js +412 -0
  271. package/dist/plugins/usage/usage-plugin.js.map +1 -0
  272. package/dist/plugins/users/__tests__/postgres-store.test.d.ts +10 -0
  273. package/dist/plugins/users/__tests__/postgres-store.test.d.ts.map +1 -0
  274. package/dist/plugins/users/__tests__/postgres-store.test.js +229 -0
  275. package/dist/plugins/users/__tests__/postgres-store.test.js.map +1 -0
  276. package/dist/plugins/users/__tests__/users-plugin.test.js +3 -0
  277. package/dist/plugins/users/__tests__/users-plugin.test.js.map +1 -1
  278. package/dist/plugins/users/index.d.ts +2 -2
  279. package/dist/plugins/users/index.d.ts.map +1 -1
  280. package/dist/plugins/users/index.js +1 -1
  281. package/dist/plugins/users/index.js.map +1 -1
  282. package/dist/plugins/users/stores/postgres-store.d.ts.map +1 -1
  283. package/dist/plugins/users/stores/postgres-store.js +76 -0
  284. package/dist/plugins/users/stores/postgres-store.js.map +1 -1
  285. package/dist/plugins/users/types.d.ts +74 -6
  286. package/dist/plugins/users/types.d.ts.map +1 -1
  287. package/dist/plugins/users/users-plugin.d.ts +15 -1
  288. package/dist/plugins/users/users-plugin.d.ts.map +1 -1
  289. package/dist/plugins/users/users-plugin.js +29 -0
  290. package/dist/plugins/users/users-plugin.js.map +1 -1
  291. package/dist-ui/assets/index-CynOqPkb.js +469 -0
  292. package/dist-ui/assets/{index-BY8OxNgO.js.map → index-CynOqPkb.js.map} +1 -1
  293. package/dist-ui/index.html +1 -1
  294. package/dist-ui-lib/api/controlPanelApi.d.ts +187 -0
  295. package/dist-ui-lib/components/StatCard.d.ts +16 -0
  296. package/dist-ui-lib/dashboard/widgets/AuthStatusWidget.d.ts +9 -0
  297. package/dist-ui-lib/dashboard/widgets/IntegrationStatusWidget.d.ts +9 -0
  298. package/dist-ui-lib/dashboard/widgets/NotificationsStatsWidget.d.ts +12 -0
  299. package/dist-ui-lib/dashboard/widgets/index.d.ts +3 -0
  300. package/dist-ui-lib/index.js +3579 -2379
  301. package/dist-ui-lib/index.js.map +1 -1
  302. package/dist-ui-lib/pages/IntegrationsPage.d.ts +1 -0
  303. package/dist-ui-lib/pages/NotificationsPage.d.ts +9 -0
  304. package/dist-ui-lib/pages/RateLimitPage.d.ts +1 -0
  305. package/dist-ui-lib/utils/formatters.d.ts +19 -0
  306. package/package.json +1 -1
  307. package/src/core/control-panel.ts +128 -0
  308. package/src/core/types.ts +17 -0
  309. package/src/index.ts +216 -0
  310. package/src/plugins/auth/adapter-wrapper.test.ts +395 -0
  311. package/src/plugins/auth/adapter-wrapper.ts +205 -0
  312. package/src/plugins/auth/config-store.test.ts +417 -0
  313. package/src/plugins/auth/config-store.ts +305 -0
  314. package/src/plugins/auth/env-config.ts +714 -7
  315. package/src/plugins/auth/index.ts +22 -1
  316. package/src/plugins/auth/types.ts +138 -0
  317. package/src/plugins/bans/bans-plugin.ts +15 -3
  318. package/src/plugins/devices/__tests__/devices-plugin.test.ts +551 -0
  319. package/src/plugins/devices/__tests__/token-utils.test.ts +264 -0
  320. package/src/plugins/devices/adapters/compute-adapter.ts +139 -0
  321. package/src/plugins/devices/adapters/index.ts +13 -0
  322. package/src/plugins/devices/adapters/mobile-adapter.ts +179 -0
  323. package/src/plugins/devices/devices-plugin.ts +538 -0
  324. package/src/plugins/devices/index.ts +69 -0
  325. package/src/plugins/devices/stores/index.ts +9 -0
  326. package/src/plugins/devices/stores/postgres-store.ts +304 -0
  327. package/src/plugins/devices/token-utils.ts +213 -0
  328. package/src/plugins/devices/types.ts +351 -0
  329. package/src/plugins/index.ts +267 -0
  330. package/src/plugins/notifications/__tests__/notifications-manager.test.ts +637 -0
  331. package/src/plugins/notifications/index.ts +91 -0
  332. package/src/plugins/notifications/notifications-manager.ts +773 -0
  333. package/src/plugins/notifications/notifications-plugin.ts +398 -0
  334. package/src/plugins/notifications/types.ts +207 -0
  335. package/src/plugins/parental/__tests__/parental-plugin.test.ts +465 -0
  336. package/src/plugins/parental/adapters/index.ts +8 -0
  337. package/src/plugins/parental/adapters/kids-adapter.ts +206 -0
  338. package/src/plugins/parental/index.ts +55 -0
  339. package/src/plugins/parental/parental-plugin.ts +759 -0
  340. package/src/plugins/parental/stores/index.ts +7 -0
  341. package/src/plugins/parental/stores/postgres-store.ts +304 -0
  342. package/src/plugins/parental/types.ts +180 -0
  343. package/src/plugins/profiles/__tests__/profiles-plugin.test.ts +321 -0
  344. package/src/plugins/profiles/index.ts +49 -0
  345. package/src/plugins/profiles/profiles-plugin.ts +546 -0
  346. package/src/plugins/profiles/stores/index.ts +9 -0
  347. package/src/plugins/profiles/stores/postgres-store.ts +439 -0
  348. package/src/plugins/profiles/types.ts +338 -0
  349. package/src/plugins/rate-limit/__tests__/rate-limit-plugin.test.ts +259 -0
  350. package/src/plugins/rate-limit/cleanup.ts +117 -0
  351. package/src/plugins/rate-limit/env-config.ts +400 -0
  352. package/src/plugins/rate-limit/index.ts +128 -0
  353. package/src/plugins/rate-limit/middleware.ts +212 -0
  354. package/src/plugins/rate-limit/rate-limit-plugin.ts +400 -0
  355. package/src/plugins/rate-limit/rate-limit-service.ts +228 -0
  356. package/src/plugins/rate-limit/stores/cache-store.ts +261 -0
  357. package/src/plugins/rate-limit/stores/index.ts +8 -0
  358. package/src/plugins/rate-limit/stores/postgres-store.ts +402 -0
  359. package/src/plugins/rate-limit/strategies/fixed-window.ts +116 -0
  360. package/src/plugins/rate-limit/strategies/index.ts +30 -0
  361. package/src/plugins/rate-limit/strategies/sliding-window.ts +157 -0
  362. package/src/plugins/rate-limit/strategies/token-bucket.ts +154 -0
  363. package/src/plugins/rate-limit/types.ts +338 -0
  364. package/src/plugins/subscriptions/__tests__/subscriptions-plugin.test.ts +404 -0
  365. package/src/plugins/subscriptions/index.ts +51 -0
  366. package/src/plugins/subscriptions/stores/index.ts +9 -0
  367. package/src/plugins/subscriptions/stores/postgres-store.ts +482 -0
  368. package/src/plugins/subscriptions/subscriptions-plugin.ts +530 -0
  369. package/src/plugins/subscriptions/types.ts +355 -0
  370. package/src/plugins/usage/__tests__/usage-plugin.test.ts +288 -0
  371. package/src/plugins/usage/index.ts +39 -0
  372. package/src/plugins/usage/stores/index.ts +9 -0
  373. package/src/plugins/usage/stores/postgres-store.ts +213 -0
  374. package/src/plugins/usage/types.ts +222 -0
  375. package/src/plugins/usage/usage-plugin.ts +484 -0
  376. package/src/plugins/users/__tests__/postgres-store.test.ts +326 -0
  377. package/src/plugins/users/__tests__/users-plugin.test.ts +3 -0
  378. package/src/plugins/users/index.ts +6 -0
  379. package/src/plugins/users/stores/postgres-store.ts +104 -0
  380. package/src/plugins/users/types.ts +82 -6
  381. package/src/plugins/users/users-plugin.ts +37 -0
  382. package/ui/src/App.tsx +36 -14
  383. package/ui/src/api/controlPanelApi.ts +329 -6
  384. package/ui/src/components/StatCard.tsx +58 -0
  385. package/ui/src/dashboard/builtInWidgets.tsx +7 -1
  386. package/ui/src/dashboard/widgets/AuthStatusWidget.tsx +143 -0
  387. package/ui/src/dashboard/widgets/IntegrationStatusWidget.tsx +135 -0
  388. package/ui/src/dashboard/widgets/NotificationsStatsWidget.tsx +167 -0
  389. package/ui/src/dashboard/widgets/index.ts +3 -0
  390. package/ui/src/pages/AuthPage.tsx +986 -142
  391. package/ui/src/pages/IntegrationsPage.tsx +288 -0
  392. package/ui/src/pages/NotificationsPage.tsx +417 -0
  393. package/ui/src/pages/RateLimitPage.tsx +292 -0
  394. package/ui/src/utils/formatters.ts +33 -0
  395. package/dist-ui/assets/index-BY8OxNgO.js +0 -465
@@ -0,0 +1,453 @@
1
+ /**
2
+ * Devices Plugin
3
+ *
4
+ * Device management plugin for @qwickapps/server.
5
+ * Supports different device types through adapters (compute, mobile, IoT).
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ import { generateDeviceToken, hashToken, isValidTokenFormat, isTokenExpired, getTokenExpiration, } from './token-utils.js';
10
+ // Store instances for helper access
11
+ let currentStore = null;
12
+ let currentAdapter = null;
13
+ let currentConfig = null;
14
+ /**
15
+ * Create the Devices plugin
16
+ */
17
+ export function createDevicesPlugin(config) {
18
+ const debug = config.debug || false;
19
+ const defaultTokenValidityDays = config.defaultTokenValidityDays || 90;
20
+ const apiPrefix = config.api?.prefix || '/devices';
21
+ function log(message, data) {
22
+ if (debug) {
23
+ console.log(`[DevicesPlugin] ${message}`, data || '');
24
+ }
25
+ }
26
+ return {
27
+ id: 'devices',
28
+ name: 'Devices',
29
+ version: '1.0.0',
30
+ async onStart(_pluginConfig, registry) {
31
+ log('Starting devices plugin', { adapter: config.adapter.name });
32
+ // Initialize the store (creates tables if needed)
33
+ await config.store.initialize();
34
+ log('Devices plugin migrations complete');
35
+ // Store references for helper access
36
+ currentStore = config.store;
37
+ currentAdapter = config.adapter;
38
+ currentConfig = config;
39
+ // Register health check
40
+ registry.registerHealthCheck({
41
+ name: 'devices-store',
42
+ type: 'custom',
43
+ check: async () => {
44
+ try {
45
+ await config.store.search({ limit: 1 });
46
+ return {
47
+ healthy: true,
48
+ details: {
49
+ adapter: config.adapter.name,
50
+ tokenPrefix: config.adapter.tokenPrefix,
51
+ },
52
+ };
53
+ }
54
+ catch {
55
+ return { healthy: false };
56
+ }
57
+ },
58
+ });
59
+ // Add API routes if enabled
60
+ if (config.api?.crud !== false) {
61
+ // List/Search devices
62
+ registry.addRoute({
63
+ method: 'get',
64
+ path: apiPrefix,
65
+ pluginId: 'devices',
66
+ handler: async (req, res) => {
67
+ try {
68
+ const params = {
69
+ org_id: req.query.org_id,
70
+ user_id: req.query.user_id,
71
+ adapter_type: req.query.adapter_type,
72
+ is_active: req.query.is_active === 'true' ? true : req.query.is_active === 'false' ? false : undefined,
73
+ query: req.query.q,
74
+ page: parseInt(req.query.page) || 1,
75
+ limit: Math.min(parseInt(req.query.limit) || 20, 100),
76
+ sortBy: req.query.sortBy || 'created_at',
77
+ sortOrder: req.query.sortOrder || 'desc',
78
+ };
79
+ const result = await config.store.search(params);
80
+ res.json(result);
81
+ }
82
+ catch (error) {
83
+ console.error('[DevicesPlugin] Search error:', error);
84
+ res.status(500).json({ error: 'Failed to search devices' });
85
+ }
86
+ },
87
+ });
88
+ // Get device by ID
89
+ registry.addRoute({
90
+ method: 'get',
91
+ path: `${apiPrefix}/:id`,
92
+ pluginId: 'devices',
93
+ handler: async (req, res) => {
94
+ try {
95
+ const device = await config.store.getById(req.params.id);
96
+ if (!device) {
97
+ return res.status(404).json({ error: 'Device not found' });
98
+ }
99
+ res.json(device);
100
+ }
101
+ catch (error) {
102
+ console.error('[DevicesPlugin] Get device error:', error);
103
+ res.status(500).json({ error: 'Failed to get device' });
104
+ }
105
+ },
106
+ });
107
+ // Create device
108
+ registry.addRoute({
109
+ method: 'post',
110
+ path: apiPrefix,
111
+ pluginId: 'devices',
112
+ handler: async (req, res) => {
113
+ try {
114
+ const input = {
115
+ org_id: req.body.org_id,
116
+ user_id: req.body.user_id,
117
+ name: req.body.name,
118
+ token_validity_days: req.body.token_validity_days,
119
+ metadata: req.body.metadata,
120
+ };
121
+ // Validate using adapter
122
+ const validation = config.adapter.validateDeviceInput(input);
123
+ if (!validation.valid) {
124
+ return res.status(400).json({
125
+ error: 'Validation failed',
126
+ details: validation.errors,
127
+ });
128
+ }
129
+ // Create the device
130
+ const result = await registerDevice(input);
131
+ res.status(201).json(result);
132
+ }
133
+ catch (error) {
134
+ console.error('[DevicesPlugin] Create device error:', error);
135
+ res.status(500).json({ error: 'Failed to create device' });
136
+ }
137
+ },
138
+ });
139
+ // Update device
140
+ registry.addRoute({
141
+ method: 'put',
142
+ path: `${apiPrefix}/:id`,
143
+ pluginId: 'devices',
144
+ handler: async (req, res) => {
145
+ try {
146
+ const input = {
147
+ name: req.body.name,
148
+ is_active: req.body.is_active,
149
+ metadata: req.body.metadata,
150
+ };
151
+ const device = await config.store.update(req.params.id, input);
152
+ if (!device) {
153
+ return res.status(404).json({ error: 'Device not found' });
154
+ }
155
+ res.json(device);
156
+ }
157
+ catch (error) {
158
+ console.error('[DevicesPlugin] Update device error:', error);
159
+ res.status(500).json({ error: 'Failed to update device' });
160
+ }
161
+ },
162
+ });
163
+ // Delete device
164
+ registry.addRoute({
165
+ method: 'delete',
166
+ path: `${apiPrefix}/:id`,
167
+ pluginId: 'devices',
168
+ handler: async (req, res) => {
169
+ try {
170
+ const device = await config.store.getById(req.params.id);
171
+ if (!device) {
172
+ return res.status(404).json({ error: 'Device not found' });
173
+ }
174
+ const deleted = await config.store.delete(req.params.id);
175
+ if (!deleted) {
176
+ return res.status(404).json({ error: 'Device not found' });
177
+ }
178
+ // Call adapter hook
179
+ if (config.adapter.onDeviceDeleted) {
180
+ await config.adapter.onDeviceDeleted(device);
181
+ }
182
+ res.status(204).send();
183
+ }
184
+ catch (error) {
185
+ console.error('[DevicesPlugin] Delete device error:', error);
186
+ res.status(500).json({ error: 'Failed to delete device' });
187
+ }
188
+ },
189
+ });
190
+ // Regenerate token
191
+ registry.addRoute({
192
+ method: 'post',
193
+ path: `${apiPrefix}/:id/regenerate-token`,
194
+ pluginId: 'devices',
195
+ handler: async (req, res) => {
196
+ try {
197
+ const device = await config.store.getById(req.params.id);
198
+ if (!device) {
199
+ return res.status(404).json({ error: 'Device not found' });
200
+ }
201
+ const validityDays = req.body.token_validity_days || defaultTokenValidityDays;
202
+ const result = await regenerateToken(req.params.id, validityDays);
203
+ if (!result) {
204
+ return res.status(500).json({ error: 'Failed to regenerate token' });
205
+ }
206
+ res.json({
207
+ token: result.token,
208
+ expires_at: result.expiresAt,
209
+ message: 'Token regenerated successfully. Store this token securely - it will not be shown again.',
210
+ });
211
+ }
212
+ catch (error) {
213
+ console.error('[DevicesPlugin] Regenerate token error:', error);
214
+ res.status(500).json({ error: 'Failed to regenerate token' });
215
+ }
216
+ },
217
+ });
218
+ }
219
+ // Token verification endpoint
220
+ if (config.api?.verify !== false) {
221
+ registry.addRoute({
222
+ method: 'post',
223
+ path: `${apiPrefix}/verify`,
224
+ pluginId: 'devices',
225
+ handler: async (req, res) => {
226
+ try {
227
+ const { token } = req.body;
228
+ if (!token) {
229
+ return res.status(400).json({ error: 'Token is required' });
230
+ }
231
+ const clientIp = req.ip || req.socket.remoteAddress;
232
+ const result = await verifyDeviceToken(token, clientIp);
233
+ if (!result.valid) {
234
+ return res.status(401).json({
235
+ valid: false,
236
+ error: result.error,
237
+ });
238
+ }
239
+ res.json({
240
+ valid: true,
241
+ device: result.device,
242
+ });
243
+ }
244
+ catch (error) {
245
+ console.error('[DevicesPlugin] Verify token error:', error);
246
+ res.status(500).json({ error: 'Failed to verify token' });
247
+ }
248
+ },
249
+ });
250
+ }
251
+ log('Devices plugin started');
252
+ },
253
+ async onStop() {
254
+ log('Stopping devices plugin');
255
+ await config.store.shutdown();
256
+ currentStore = null;
257
+ currentAdapter = null;
258
+ currentConfig = null;
259
+ log('Devices plugin stopped');
260
+ },
261
+ };
262
+ }
263
+ // ═══════════════════════════════════════════════════════════════════════════
264
+ // Helper Functions
265
+ // ═══════════════════════════════════════════════════════════════════════════
266
+ /**
267
+ * Get the current device store instance
268
+ */
269
+ export function getDeviceStore() {
270
+ return currentStore;
271
+ }
272
+ /**
273
+ * Get the current device adapter instance
274
+ */
275
+ export function getDeviceAdapter() {
276
+ return currentAdapter;
277
+ }
278
+ /**
279
+ * Register a new device
280
+ */
281
+ export async function registerDevice(input) {
282
+ if (!currentStore || !currentAdapter || !currentConfig) {
283
+ throw new Error('Devices plugin not initialized');
284
+ }
285
+ // Validate using adapter
286
+ const validation = currentAdapter.validateDeviceInput(input);
287
+ if (!validation.valid) {
288
+ throw new Error(`Validation failed: ${validation.errors?.join(', ')}`);
289
+ }
290
+ // Transform metadata using adapter
291
+ const transformedMetadata = currentAdapter.transformForStorage(input);
292
+ // Generate token
293
+ const tokenValidityDays = input.token_validity_days || currentConfig.defaultTokenValidityDays || 90;
294
+ const { token, hash, prefix } = await generateDeviceToken(currentAdapter.tokenPrefix);
295
+ const expiresAt = getTokenExpiration(tokenValidityDays);
296
+ // Create device in store
297
+ const device = await currentStore.create({
298
+ ...input,
299
+ metadata: transformedMetadata,
300
+ tokenHash: hash,
301
+ tokenPrefix: prefix,
302
+ tokenExpiresAt: expiresAt,
303
+ adapterType: currentAdapter.name,
304
+ });
305
+ // Call adapter hook
306
+ if (currentAdapter.onDeviceCreated) {
307
+ await currentAdapter.onDeviceCreated(device);
308
+ }
309
+ // Return device with token (token only shown once)
310
+ return {
311
+ ...device,
312
+ token,
313
+ };
314
+ }
315
+ /**
316
+ * Verify a device token
317
+ */
318
+ export async function verifyDeviceToken(token, clientIp) {
319
+ if (!currentStore || !currentAdapter) {
320
+ return { valid: false, error: 'Devices plugin not initialized' };
321
+ }
322
+ // Validate token format
323
+ if (!isValidTokenFormat(token, currentAdapter.tokenPrefix)) {
324
+ return { valid: false, error: 'Invalid token format' };
325
+ }
326
+ // Hash the token
327
+ const tokenHash = await hashToken(token);
328
+ // Look up device by token hash
329
+ const device = await currentStore.getByTokenHash(tokenHash);
330
+ if (!device) {
331
+ return { valid: false, error: 'Token not found or expired' };
332
+ }
333
+ // Check if token is expired
334
+ if (isTokenExpired(device.token_expires_at)) {
335
+ return { valid: false, error: 'Token has expired' };
336
+ }
337
+ // Check if device is active
338
+ if (!device.is_active) {
339
+ return { valid: false, error: 'Device is not active' };
340
+ }
341
+ // Update last seen
342
+ await currentStore.updateLastSeen(device.id, clientIp);
343
+ // Call adapter hook
344
+ if (currentAdapter.onDeviceVerified) {
345
+ await currentAdapter.onDeviceVerified(device, clientIp);
346
+ }
347
+ return { valid: true, device };
348
+ }
349
+ /**
350
+ * Get a device by ID
351
+ */
352
+ export async function getDeviceById(id) {
353
+ if (!currentStore) {
354
+ throw new Error('Devices plugin not initialized');
355
+ }
356
+ return currentStore.getById(id);
357
+ }
358
+ /**
359
+ * Update a device
360
+ */
361
+ export async function updateDevice(id, input) {
362
+ if (!currentStore) {
363
+ throw new Error('Devices plugin not initialized');
364
+ }
365
+ return currentStore.update(id, input);
366
+ }
367
+ /**
368
+ * Delete a device
369
+ */
370
+ export async function deleteDevice(id) {
371
+ if (!currentStore || !currentAdapter) {
372
+ throw new Error('Devices plugin not initialized');
373
+ }
374
+ const device = await currentStore.getById(id);
375
+ if (!device) {
376
+ return false;
377
+ }
378
+ const deleted = await currentStore.delete(id);
379
+ if (deleted && currentAdapter.onDeviceDeleted) {
380
+ await currentAdapter.onDeviceDeleted(device);
381
+ }
382
+ return deleted;
383
+ }
384
+ /**
385
+ * Regenerate token for a device
386
+ */
387
+ export async function regenerateToken(deviceId, validityDays) {
388
+ if (!currentStore || !currentAdapter || !currentConfig) {
389
+ throw new Error('Devices plugin not initialized');
390
+ }
391
+ const device = await currentStore.getById(deviceId);
392
+ if (!device) {
393
+ return null;
394
+ }
395
+ const days = validityDays || currentConfig.defaultTokenValidityDays || 90;
396
+ const { token, hash, prefix } = await generateDeviceToken(currentAdapter.tokenPrefix);
397
+ const expiresAt = getTokenExpiration(days);
398
+ const updated = await currentStore.updateToken(deviceId, hash, prefix, expiresAt);
399
+ if (!updated) {
400
+ return null;
401
+ }
402
+ return { token, expiresAt };
403
+ }
404
+ /**
405
+ * List devices for a user
406
+ */
407
+ export async function listUserDevices(userId) {
408
+ if (!currentStore) {
409
+ throw new Error('Devices plugin not initialized');
410
+ }
411
+ const result = await currentStore.search({ user_id: userId, limit: 100 });
412
+ return result.devices;
413
+ }
414
+ /**
415
+ * List devices for an organization
416
+ */
417
+ export async function listOrgDevices(orgId) {
418
+ if (!currentStore) {
419
+ throw new Error('Devices plugin not initialized');
420
+ }
421
+ const result = await currentStore.search({ org_id: orgId, limit: 100 });
422
+ return result.devices;
423
+ }
424
+ /**
425
+ * Deactivate a device
426
+ */
427
+ export async function deactivateDevice(id) {
428
+ if (!currentStore) {
429
+ throw new Error('Devices plugin not initialized');
430
+ }
431
+ const device = await currentStore.update(id, { is_active: false });
432
+ return device !== null;
433
+ }
434
+ /**
435
+ * Activate a device
436
+ */
437
+ export async function activateDevice(id) {
438
+ if (!currentStore) {
439
+ throw new Error('Devices plugin not initialized');
440
+ }
441
+ const device = await currentStore.update(id, { is_active: true });
442
+ return device !== null;
443
+ }
444
+ /**
445
+ * Cleanup expired device tokens
446
+ */
447
+ export async function cleanupExpiredTokens() {
448
+ if (!currentStore) {
449
+ throw new Error('Devices plugin not initialized');
450
+ }
451
+ return currentStore.cleanupExpired();
452
+ }
453
+ //# sourceMappingURL=devices-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices-plugin.js","sourceRoot":"","sources":["../../../src/plugins/devices/devices-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,OAAO,EACL,mBAAmB,EACnB,SAAS,EAET,kBAAkB,EAClB,cAAc,EACd,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,oCAAoC;AACpC,IAAI,YAAY,GAAuB,IAAI,CAAC;AAC5C,IAAI,cAAc,GAAyB,IAAI,CAAC;AAChD,IAAI,aAAa,GAA+B,IAAI,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,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AAO,YAAY,CAAC,cAAc,EAAE,CAAC;AACvC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Devices Plugin
3
+ *
4
+ * Device management plugin with adapter support.
5
+ * Exports all device-related functionality.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ export { createDevicesPlugin, getDeviceStore, getDeviceAdapter, registerDevice, verifyDeviceToken, getDeviceById, updateDevice, deleteDevice, regenerateToken, listUserDevices, listOrgDevices, deactivateDevice, activateDevice, cleanupExpiredTokens, } from './devices-plugin.js';
10
+ export type { Device, DeviceWithToken, CreateDeviceInput, UpdateDeviceInput, DeviceSearchParams, DeviceListResponse, TokenVerificationResult, DeviceAdapter, ValidationResult, DeviceStore, DevicesPluginConfig, DevicesApiConfig, PostgresDeviceStoreConfig, ComputeDeviceMetadata, MobileDeviceMetadata, IoTDeviceMetadata, } from './types.js';
11
+ export { postgresDeviceStore } from './stores/index.js';
12
+ export { computeDeviceAdapter } from './adapters/index.js';
13
+ export type { ComputeAdapterConfig } from './adapters/index.js';
14
+ export { mobileDeviceAdapter } from './adapters/index.js';
15
+ export type { MobileAdapterConfig } from './adapters/index.js';
16
+ export { generateDeviceToken, generatePairingCode, hashToken, verifyToken, isValidTokenFormat, isTokenExpired, getTokenExpiration, DeviceTokens, } from './token-utils.js';
17
+ export type { DeviceTokenPair } from './token-utils.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/devices/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACV,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Devices Plugin
3
+ *
4
+ * Device management plugin with adapter support.
5
+ * Exports all device-related functionality.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ // Main plugin
10
+ export { createDevicesPlugin, getDeviceStore, getDeviceAdapter, registerDevice, verifyDeviceToken, getDeviceById, updateDevice, deleteDevice, regenerateToken, listUserDevices, listOrgDevices, deactivateDevice, activateDevice, cleanupExpiredTokens, } from './devices-plugin.js';
11
+ // Stores
12
+ export { postgresDeviceStore } from './stores/index.js';
13
+ // Adapters
14
+ export { computeDeviceAdapter } from './adapters/index.js';
15
+ export { mobileDeviceAdapter } from './adapters/index.js';
16
+ // Token utilities
17
+ export { generateDeviceToken, generatePairingCode, hashToken, verifyToken, isValidTokenFormat, isTokenExpired, getTokenExpiration, DeviceTokens, } from './token-utils.js';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/devices/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc;AACd,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAsB7B,SAAS;AACT,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,WAAW;AACX,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,kBAAkB;AAClB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,YAAY,GACb,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Device Stores
3
+ *
4
+ * Export all device storage implementations.
5
+ *
6
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
7
+ */
8
+ export { postgresDeviceStore } from './postgres-store.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/devices/stores/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Device Stores
3
+ *
4
+ * Export all device storage implementations.
5
+ *
6
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
7
+ */
8
+ export { postgresDeviceStore } from './postgres-store.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/devices/stores/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * PostgreSQL Device Store
3
+ *
4
+ * Device storage implementation using PostgreSQL.
5
+ * Supports multi-tenant isolation via org_id.
6
+ *
7
+ * Copyright (c) 2025 QwickApps.com. All rights reserved.
8
+ */
9
+ import type { DeviceStore, PostgresDeviceStoreConfig } from '../types.js';
10
+ /**
11
+ * Create a PostgreSQL device store
12
+ *
13
+ * @param config Configuration including a pg Pool instance
14
+ * @returns DeviceStore implementation
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { Pool } from 'pg';
19
+ * import { postgresDeviceStore } from '@qwickapps/server';
20
+ *
21
+ * const pool = new Pool({ connectionString: process.env.DATABASE_URL });
22
+ * const store = postgresDeviceStore({ pool });
23
+ * ```
24
+ */
25
+ export declare function postgresDeviceStore(config: PostgresDeviceStoreConfig): DeviceStore;
26
+ //# sourceMappingURL=postgres-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres-store.d.ts","sourceRoot":"","sources":["../../../../src/plugins/devices/stores/postgres-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,WAAW,EAMX,yBAAyB,EAC1B,MAAM,aAAa,CAAC;AAOrB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,WAAW,CAwQlF"}