@statezero/core 0.2.36 → 0.2.38

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 (301) hide show
  1. package/dist/adaptors/vue/components/LayoutRenderer.js +166 -0
  2. package/dist/adaptors/vue/components/defaults/AlertElement.js +31 -0
  3. package/dist/adaptors/vue/components/defaults/DisplayElement.js +44 -0
  4. package/dist/adaptors/vue/components/defaults/DividerElement.js +10 -0
  5. package/dist/adaptors/vue/components/defaults/ErrorBlock.js +24 -0
  6. package/dist/adaptors/vue/components/defaults/GroupElement.js +41 -0
  7. package/dist/adaptors/vue/components/defaults/LabelElement.js +21 -0
  8. package/dist/adaptors/vue/components/defaults/TabsElement.js +38 -0
  9. package/package.json +7 -6
  10. package/dist/actions/backend1/django_app/calculate-hash.d.ts +0 -57
  11. package/dist/actions/backend1/django_app/calculate-hash.js +0 -80
  12. package/dist/actions/backend1/django_app/calculate-hash.schema.json +0 -148
  13. package/dist/actions/backend1/django_app/get-current-username.d.ts +0 -29
  14. package/dist/actions/backend1/django_app/get-current-username.js +0 -65
  15. package/dist/actions/backend1/django_app/get-current-username.schema.json +0 -47
  16. package/dist/actions/backend1/django_app/get-server-status.d.ts +0 -38
  17. package/dist/actions/backend1/django_app/get-server-status.js +0 -68
  18. package/dist/actions/backend1/django_app/get-server-status.schema.json +0 -93
  19. package/dist/actions/backend1/django_app/get-user-info.d.ts +0 -44
  20. package/dist/actions/backend1/django_app/get-user-info.js +0 -70
  21. package/dist/actions/backend1/django_app/get-user-info.schema.json +0 -127
  22. package/dist/actions/backend1/django_app/index.d.ts +0 -1
  23. package/dist/actions/backend1/django_app/index.js +0 -6
  24. package/dist/actions/backend1/django_app/process-data.d.ts +0 -51
  25. package/dist/actions/backend1/django_app/process-data.js +0 -78
  26. package/dist/actions/backend1/django_app/process-data.schema.json +0 -117
  27. package/dist/actions/backend1/django_app/send-notification.d.ts +0 -55
  28. package/dist/actions/backend1/django_app/send-notification.js +0 -81
  29. package/dist/actions/backend1/django_app/send-notification.schema.json +0 -175
  30. package/dist/actions/backend1/index.d.ts +0 -1
  31. package/dist/actions/backend1/index.js +0 -1
  32. package/dist/actions/default/django_app/calculate-hash.d.ts +0 -57
  33. package/dist/actions/default/django_app/calculate-hash.js +0 -80
  34. package/dist/actions/default/django_app/calculate-hash.schema.json +0 -148
  35. package/dist/actions/default/django_app/get-current-username.d.ts +0 -29
  36. package/dist/actions/default/django_app/get-current-username.js +0 -65
  37. package/dist/actions/default/django_app/get-current-username.schema.json +0 -47
  38. package/dist/actions/default/django_app/get-server-status.d.ts +0 -38
  39. package/dist/actions/default/django_app/get-server-status.js +0 -68
  40. package/dist/actions/default/django_app/get-server-status.schema.json +0 -93
  41. package/dist/actions/default/django_app/get-user-info.d.ts +0 -44
  42. package/dist/actions/default/django_app/get-user-info.js +0 -70
  43. package/dist/actions/default/django_app/get-user-info.schema.json +0 -127
  44. package/dist/actions/default/django_app/index.d.ts +0 -1
  45. package/dist/actions/default/django_app/index.js +0 -6
  46. package/dist/actions/default/django_app/process-data.d.ts +0 -51
  47. package/dist/actions/default/django_app/process-data.js +0 -78
  48. package/dist/actions/default/django_app/process-data.schema.json +0 -117
  49. package/dist/actions/default/django_app/send-notification.d.ts +0 -55
  50. package/dist/actions/default/django_app/send-notification.js +0 -81
  51. package/dist/actions/default/django_app/send-notification.schema.json +0 -175
  52. package/dist/actions/default/index.d.ts +0 -1
  53. package/dist/actions/default/index.js +0 -1
  54. package/dist/actions/index.d.ts +0 -1
  55. package/dist/actions/index.js +0 -5
  56. package/dist/adaptors/react/composables.d.ts +0 -1
  57. package/dist/adaptors/react/composables.js +0 -4
  58. package/dist/adaptors/react/index.d.ts +0 -1
  59. package/dist/adaptors/react/index.js +0 -1
  60. package/dist/adaptors/vue/components/defaults/index.d.ts +0 -7
  61. package/dist/adaptors/vue/components/defaults/index.js +0 -31
  62. package/dist/adaptors/vue/components/index.d.ts +0 -1
  63. package/dist/adaptors/vue/components/index.js +0 -7
  64. package/dist/adaptors/vue/composables.d.ts +0 -2
  65. package/dist/adaptors/vue/composables.js +0 -44
  66. package/dist/adaptors/vue/index.d.ts +0 -3
  67. package/dist/adaptors/vue/index.js +0 -4
  68. package/dist/adaptors/vue/reactivity.d.ts +0 -18
  69. package/dist/adaptors/vue/reactivity.js +0 -132
  70. package/dist/cli/commands/sync.d.ts +0 -6
  71. package/dist/cli/commands/sync.js +0 -30
  72. package/dist/cli/commands/syncActions.d.ts +0 -46
  73. package/dist/cli/commands/syncActions.js +0 -717
  74. package/dist/cli/commands/syncModels.d.ts +0 -132
  75. package/dist/cli/commands/syncModels.js +0 -1120
  76. package/dist/cli/configFileLoader.d.ts +0 -10
  77. package/dist/cli/configFileLoader.js +0 -85
  78. package/dist/cli/index.d.ts +0 -2
  79. package/dist/cli/index.js +0 -22
  80. package/dist/config.d.ts +0 -57
  81. package/dist/config.js +0 -273
  82. package/dist/core/eventReceivers.d.ts +0 -185
  83. package/dist/core/eventReceivers.js +0 -266
  84. package/dist/core/utils.d.ts +0 -8
  85. package/dist/core/utils.js +0 -62
  86. package/dist/errorHandler.d.ts +0 -21
  87. package/dist/errorHandler.js +0 -27
  88. package/dist/filtering/localFiltering.d.ts +0 -110
  89. package/dist/filtering/localFiltering.js +0 -1080
  90. package/dist/flavours/django/dates.d.ts +0 -34
  91. package/dist/flavours/django/dates.js +0 -113
  92. package/dist/flavours/django/errors.d.ts +0 -138
  93. package/dist/flavours/django/errors.js +0 -195
  94. package/dist/flavours/django/f.d.ts +0 -6
  95. package/dist/flavours/django/f.js +0 -91
  96. package/dist/flavours/django/files.d.ts +0 -62
  97. package/dist/flavours/django/files.js +0 -355
  98. package/dist/flavours/django/makeApiCall.d.ts +0 -36
  99. package/dist/flavours/django/makeApiCall.js +0 -169
  100. package/dist/flavours/django/manager.d.ts +0 -204
  101. package/dist/flavours/django/manager.js +0 -222
  102. package/dist/flavours/django/model.d.ts +0 -137
  103. package/dist/flavours/django/model.js +0 -366
  104. package/dist/flavours/django/operationFactory.d.ts +0 -73
  105. package/dist/flavours/django/operationFactory.js +0 -248
  106. package/dist/flavours/django/q.d.ts +0 -70
  107. package/dist/flavours/django/q.js +0 -43
  108. package/dist/flavours/django/queryExecutor.d.ts +0 -149
  109. package/dist/flavours/django/queryExecutor.js +0 -590
  110. package/dist/flavours/django/querySet.d.ts +0 -301
  111. package/dist/flavours/django/querySet.js +0 -736
  112. package/dist/flavours/django/serializers.d.ts +0 -39
  113. package/dist/flavours/django/serializers.js +0 -296
  114. package/dist/flavours/django/tempPk.d.ts +0 -31
  115. package/dist/flavours/django/tempPk.js +0 -92
  116. package/dist/flavours/django/utils.d.ts +0 -19
  117. package/dist/flavours/django/utils.js +0 -29
  118. package/dist/index.d.ts +0 -46
  119. package/dist/index.js +0 -48
  120. package/dist/models/backend1/django_app/comprehensivemodel.d.ts +0 -894
  121. package/dist/models/backend1/django_app/comprehensivemodel.js +0 -71
  122. package/dist/models/backend1/django_app/comprehensivemodel.schema.json +0 -870
  123. package/dist/models/backend1/django_app/custompkmodel.d.ts +0 -92
  124. package/dist/models/backend1/django_app/custompkmodel.js +0 -69
  125. package/dist/models/backend1/django_app/custompkmodel.schema.json +0 -71
  126. package/dist/models/backend1/django_app/dailyrate.d.ts +0 -230
  127. package/dist/models/backend1/django_app/dailyrate.js +0 -71
  128. package/dist/models/backend1/django_app/dailyrate.schema.json +0 -212
  129. package/dist/models/backend1/django_app/deepmodellevel1.d.ts +0 -140
  130. package/dist/models/backend1/django_app/deepmodellevel1.js +0 -72
  131. package/dist/models/backend1/django_app/deepmodellevel1.schema.json +0 -114
  132. package/dist/models/backend1/django_app/deepmodellevel2.d.ts +0 -118
  133. package/dist/models/backend1/django_app/deepmodellevel2.js +0 -71
  134. package/dist/models/backend1/django_app/deepmodellevel2.schema.json +0 -92
  135. package/dist/models/backend1/django_app/deepmodellevel3.d.ts +0 -92
  136. package/dist/models/backend1/django_app/deepmodellevel3.js +0 -69
  137. package/dist/models/backend1/django_app/deepmodellevel3.schema.json +0 -69
  138. package/dist/models/backend1/django_app/dummymodel.d.ts +0 -134
  139. package/dist/models/backend1/django_app/dummymodel.js +0 -71
  140. package/dist/models/backend1/django_app/dummymodel.schema.json +0 -109
  141. package/dist/models/backend1/django_app/dummyrelatedmodel.d.ts +0 -92
  142. package/dist/models/backend1/django_app/dummyrelatedmodel.js +0 -69
  143. package/dist/models/backend1/django_app/dummyrelatedmodel.schema.json +0 -69
  144. package/dist/models/backend1/django_app/filetest.d.ts +0 -140
  145. package/dist/models/backend1/django_app/filetest.js +0 -69
  146. package/dist/models/backend1/django_app/filetest.schema.json +0 -111
  147. package/dist/models/backend1/django_app/index.d.ts +0 -1
  148. package/dist/models/backend1/django_app/index.js +0 -21
  149. package/dist/models/backend1/django_app/m2mdepthtestlevel1.d.ts +0 -118
  150. package/dist/models/backend1/django_app/m2mdepthtestlevel1.js +0 -71
  151. package/dist/models/backend1/django_app/m2mdepthtestlevel1.schema.json +0 -94
  152. package/dist/models/backend1/django_app/m2mdepthtestlevel2.d.ts +0 -118
  153. package/dist/models/backend1/django_app/m2mdepthtestlevel2.js +0 -71
  154. package/dist/models/backend1/django_app/m2mdepthtestlevel2.schema.json +0 -94
  155. package/dist/models/backend1/django_app/m2mdepthtestlevel3.d.ts +0 -134
  156. package/dist/models/backend1/django_app/m2mdepthtestlevel3.js +0 -71
  157. package/dist/models/backend1/django_app/m2mdepthtestlevel3.schema.json +0 -112
  158. package/dist/models/backend1/django_app/modelwithcustompkrelation.d.ts +0 -118
  159. package/dist/models/backend1/django_app/modelwithcustompkrelation.js +0 -71
  160. package/dist/models/backend1/django_app/modelwithcustompkrelation.schema.json +0 -93
  161. package/dist/models/backend1/django_app/modelwithrestrictedfields.d.ts +0 -134
  162. package/dist/models/backend1/django_app/modelwithrestrictedfields.js +0 -71
  163. package/dist/models/backend1/django_app/modelwithrestrictedfields.schema.json +0 -111
  164. package/dist/models/backend1/django_app/namefiltercustompkmodel.d.ts +0 -92
  165. package/dist/models/backend1/django_app/namefiltercustompkmodel.js +0 -69
  166. package/dist/models/backend1/django_app/namefiltercustompkmodel.schema.json +0 -71
  167. package/dist/models/backend1/django_app/order.d.ts +0 -220
  168. package/dist/models/backend1/django_app/order.js +0 -71
  169. package/dist/models/backend1/django_app/order.schema.json +0 -203
  170. package/dist/models/backend1/django_app/orderitem.d.ts +0 -172
  171. package/dist/models/backend1/django_app/orderitem.js +0 -72
  172. package/dist/models/backend1/django_app/orderitem.schema.json +0 -149
  173. package/dist/models/backend1/django_app/product.d.ts +0 -254
  174. package/dist/models/backend1/django_app/product.js +0 -71
  175. package/dist/models/backend1/django_app/product.schema.json +0 -277
  176. package/dist/models/backend1/django_app/productcategory.d.ts +0 -92
  177. package/dist/models/backend1/django_app/productcategory.js +0 -69
  178. package/dist/models/backend1/django_app/productcategory.schema.json +0 -70
  179. package/dist/models/backend1/django_app/rateplan.d.ts +0 -92
  180. package/dist/models/backend1/django_app/rateplan.js +0 -69
  181. package/dist/models/backend1/django_app/rateplan.schema.json +0 -70
  182. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.d.ts +0 -108
  183. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.js +0 -69
  184. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.schema.json +0 -87
  185. package/dist/models/backend1/fileobject.d.ts +0 -4
  186. package/dist/models/backend1/fileobject.js +0 -9
  187. package/dist/models/backend1/index.d.ts +0 -2
  188. package/dist/models/backend1/index.js +0 -2
  189. package/dist/models/default/django_app/comprehensivemodel.d.ts +0 -894
  190. package/dist/models/default/django_app/comprehensivemodel.js +0 -71
  191. package/dist/models/default/django_app/comprehensivemodel.schema.json +0 -870
  192. package/dist/models/default/django_app/custompkmodel.d.ts +0 -92
  193. package/dist/models/default/django_app/custompkmodel.js +0 -69
  194. package/dist/models/default/django_app/custompkmodel.schema.json +0 -71
  195. package/dist/models/default/django_app/dailyrate.d.ts +0 -230
  196. package/dist/models/default/django_app/dailyrate.js +0 -71
  197. package/dist/models/default/django_app/dailyrate.schema.json +0 -212
  198. package/dist/models/default/django_app/deepmodellevel1.d.ts +0 -128
  199. package/dist/models/default/django_app/deepmodellevel1.js +0 -72
  200. package/dist/models/default/django_app/deepmodellevel1.schema.json +0 -102
  201. package/dist/models/default/django_app/deepmodellevel2.d.ts +0 -106
  202. package/dist/models/default/django_app/deepmodellevel2.js +0 -71
  203. package/dist/models/default/django_app/deepmodellevel2.schema.json +0 -80
  204. package/dist/models/default/django_app/deepmodellevel3.d.ts +0 -80
  205. package/dist/models/default/django_app/deepmodellevel3.js +0 -69
  206. package/dist/models/default/django_app/deepmodellevel3.schema.json +0 -57
  207. package/dist/models/default/django_app/dummymodel.d.ts +0 -122
  208. package/dist/models/default/django_app/dummymodel.js +0 -71
  209. package/dist/models/default/django_app/dummymodel.schema.json +0 -97
  210. package/dist/models/default/django_app/dummyrelatedmodel.d.ts +0 -80
  211. package/dist/models/default/django_app/dummyrelatedmodel.js +0 -69
  212. package/dist/models/default/django_app/dummyrelatedmodel.schema.json +0 -57
  213. package/dist/models/default/django_app/filetest.d.ts +0 -128
  214. package/dist/models/default/django_app/filetest.js +0 -69
  215. package/dist/models/default/django_app/filetest.schema.json +0 -99
  216. package/dist/models/default/django_app/index.d.ts +0 -1
  217. package/dist/models/default/django_app/index.js +0 -21
  218. package/dist/models/default/django_app/m2mdepthtestlevel1.d.ts +0 -118
  219. package/dist/models/default/django_app/m2mdepthtestlevel1.js +0 -71
  220. package/dist/models/default/django_app/m2mdepthtestlevel1.schema.json +0 -94
  221. package/dist/models/default/django_app/m2mdepthtestlevel2.d.ts +0 -118
  222. package/dist/models/default/django_app/m2mdepthtestlevel2.js +0 -71
  223. package/dist/models/default/django_app/m2mdepthtestlevel2.schema.json +0 -94
  224. package/dist/models/default/django_app/m2mdepthtestlevel3.d.ts +0 -134
  225. package/dist/models/default/django_app/m2mdepthtestlevel3.js +0 -71
  226. package/dist/models/default/django_app/m2mdepthtestlevel3.schema.json +0 -112
  227. package/dist/models/default/django_app/modelwithcustompkrelation.d.ts +0 -118
  228. package/dist/models/default/django_app/modelwithcustompkrelation.js +0 -71
  229. package/dist/models/default/django_app/modelwithcustompkrelation.schema.json +0 -93
  230. package/dist/models/default/django_app/modelwithrestrictedfields.d.ts +0 -134
  231. package/dist/models/default/django_app/modelwithrestrictedfields.js +0 -71
  232. package/dist/models/default/django_app/modelwithrestrictedfields.schema.json +0 -111
  233. package/dist/models/default/django_app/namefiltercustompkmodel.d.ts +0 -92
  234. package/dist/models/default/django_app/namefiltercustompkmodel.js +0 -69
  235. package/dist/models/default/django_app/namefiltercustompkmodel.schema.json +0 -71
  236. package/dist/models/default/django_app/order.d.ts +0 -220
  237. package/dist/models/default/django_app/order.js +0 -71
  238. package/dist/models/default/django_app/order.schema.json +0 -203
  239. package/dist/models/default/django_app/orderitem.d.ts +0 -172
  240. package/dist/models/default/django_app/orderitem.js +0 -72
  241. package/dist/models/default/django_app/orderitem.schema.json +0 -149
  242. package/dist/models/default/django_app/product.d.ts +0 -254
  243. package/dist/models/default/django_app/product.js +0 -71
  244. package/dist/models/default/django_app/product.schema.json +0 -277
  245. package/dist/models/default/django_app/productcategory.d.ts +0 -92
  246. package/dist/models/default/django_app/productcategory.js +0 -69
  247. package/dist/models/default/django_app/productcategory.schema.json +0 -70
  248. package/dist/models/default/django_app/rateplan.d.ts +0 -92
  249. package/dist/models/default/django_app/rateplan.js +0 -69
  250. package/dist/models/default/django_app/rateplan.schema.json +0 -70
  251. package/dist/models/default/django_app/restrictedfieldrelatedmodel.d.ts +0 -108
  252. package/dist/models/default/django_app/restrictedfieldrelatedmodel.js +0 -69
  253. package/dist/models/default/django_app/restrictedfieldrelatedmodel.schema.json +0 -87
  254. package/dist/models/default/fileobject.d.ts +0 -4
  255. package/dist/models/default/fileobject.js +0 -9
  256. package/dist/models/default/index.d.ts +0 -2
  257. package/dist/models/default/index.js +0 -2
  258. package/dist/models/index.d.ts +0 -1
  259. package/dist/models/index.js +0 -5
  260. package/dist/react-entry.d.ts +0 -2
  261. package/dist/react-entry.js +0 -2
  262. package/dist/reactiveAdaptor.d.ts +0 -24
  263. package/dist/reactiveAdaptor.js +0 -38
  264. package/dist/reset.d.ts +0 -15
  265. package/dist/reset.js +0 -97
  266. package/dist/setup.d.ts +0 -15
  267. package/dist/setup.js +0 -33
  268. package/dist/syncEngine/cache/cache.d.ts +0 -75
  269. package/dist/syncEngine/cache/cache.js +0 -355
  270. package/dist/syncEngine/metrics/metricOptCalcs.d.ts +0 -79
  271. package/dist/syncEngine/metrics/metricOptCalcs.js +0 -284
  272. package/dist/syncEngine/registries/metricRegistry.d.ts +0 -58
  273. package/dist/syncEngine/registries/metricRegistry.js +0 -171
  274. package/dist/syncEngine/registries/modelStoreRegistry.d.ts +0 -11
  275. package/dist/syncEngine/registries/modelStoreRegistry.js +0 -63
  276. package/dist/syncEngine/registries/querysetStoreGraph.d.ts +0 -41
  277. package/dist/syncEngine/registries/querysetStoreGraph.js +0 -174
  278. package/dist/syncEngine/registries/querysetStoreRegistry.d.ts +0 -72
  279. package/dist/syncEngine/registries/querysetStoreRegistry.js +0 -335
  280. package/dist/syncEngine/stores/metricStore.d.ts +0 -55
  281. package/dist/syncEngine/stores/metricStore.js +0 -222
  282. package/dist/syncEngine/stores/modelStore.d.ts +0 -53
  283. package/dist/syncEngine/stores/modelStore.js +0 -565
  284. package/dist/syncEngine/stores/operation.d.ts +0 -139
  285. package/dist/syncEngine/stores/operation.js +0 -291
  286. package/dist/syncEngine/stores/operationEventHandlers.d.ts +0 -8
  287. package/dist/syncEngine/stores/operationEventHandlers.js +0 -322
  288. package/dist/syncEngine/stores/querysetStore.d.ts +0 -60
  289. package/dist/syncEngine/stores/querysetStore.js +0 -294
  290. package/dist/syncEngine/stores/reactivity.d.ts +0 -3
  291. package/dist/syncEngine/stores/reactivity.js +0 -4
  292. package/dist/syncEngine/stores/utils.d.ts +0 -14
  293. package/dist/syncEngine/stores/utils.js +0 -32
  294. package/dist/syncEngine/sync.d.ts +0 -46
  295. package/dist/syncEngine/sync.js +0 -389
  296. package/dist/testing.d.ts +0 -63
  297. package/dist/testing.js +0 -175
  298. package/dist/vue-entry.d.ts +0 -15
  299. package/dist/vue-entry.js +0 -7
  300. /package/{src → dist}/adaptors/vue/components/layout.css +0 -0
  301. /package/{src → dist}/adaptors/vue/components/layout.tailwind.css +0 -0
@@ -1,68 +0,0 @@
1
- /**
2
- * This file was auto-generated. Do not make direct changes to the file.
3
- * Action: Get Server Status
4
- * App: django_app
5
- */
6
- import axios from 'axios';
7
- import { z } from 'zod';
8
- import { configInstance, parseStateZeroError, serializeActionPayload } from '../../../../src';
9
- import actionSchema from './get-server-status.schema.json' assert { type: 'json' };
10
- /**
11
- * Zod schema for the response of getServerStatus.
12
- */
13
- export const getServerStatusResponseSchema = z.object({ status: z.string(),
14
- timestamp: z.string().datetime({ message: "Invalid ISO 8601 datetime string" }),
15
- random_number: z.number().int(),
16
- server_info: z.record(z.any()),
17
- demo_data: z.record(z.any()) });
18
- /**
19
- * Get server status and random data (no authentication required)
20
- *
21
- * @param {Object} [axiosOverrides] - Allows overriding Axios request parameters.
22
- * @returns {Promise<Object>} A promise that resolves with the action's result.
23
- */
24
- export async function getServerStatus(axiosOverrides = {}) {
25
- // Construct the data payload from the function arguments
26
- const rawPayload = {};
27
- // Serialize payload - handles model instances (extracts PK), files, dates, etc.
28
- const payload = serializeActionPayload(rawPayload, actionSchema.input_properties);
29
- const config = configInstance.getConfig();
30
- const backend = config.backendConfigs['default'];
31
- if (!backend) {
32
- throw new Error(`No backend configuration found for key: default`);
33
- }
34
- const baseUrl = backend.API_URL.replace(/\/+$/, '');
35
- const actionUrl = `${baseUrl}/actions/get_server_status/`;
36
- const headers = backend.getAuthHeaders ? backend.getAuthHeaders() : {};
37
- try {
38
- const response = await axios.post(actionUrl, payload, {
39
- headers: { 'Content-Type': 'application/json', ...headers },
40
- ...axiosOverrides,
41
- });
42
- return getServerStatusResponseSchema.parse(response.data);
43
- }
44
- catch (error) {
45
- if (error instanceof z.ZodError) {
46
- throw new Error(`Get Server Status failed: Invalid response from server. Details: ${error.message}`);
47
- }
48
- if (error.response && error.response.data) {
49
- const parsedError = parseStateZeroError(error.response.data);
50
- if (Error.captureStackTrace) {
51
- Error.captureStackTrace(parsedError, getServerStatus);
52
- }
53
- throw parsedError;
54
- }
55
- else if (error.request) {
56
- throw new Error(`Get Server Status failed: No response received from server.`);
57
- }
58
- else {
59
- throw new Error(`Get Server Status failed: ${error.message}`);
60
- }
61
- }
62
- }
63
- export default getServerStatus;
64
- getServerStatus.actionName = 'get_server_status';
65
- getServerStatus.title = 'Get Server Status';
66
- getServerStatus.app = 'django_app';
67
- getServerStatus.permissions = [];
68
- getServerStatus.configKey = 'default';
@@ -1,93 +0,0 @@
1
- {
2
- "action_name": "get_server_status",
3
- "app": "django_app",
4
- "title": "Get Server Status",
5
- "docstring": "Get server status and random data (no authentication required)",
6
- "class_name": "GetServerStatus",
7
- "input_properties": {},
8
- "response_properties": {
9
- "status": {
10
- "type": "string",
11
- "title": "Status",
12
- "required": true,
13
- "description": null,
14
- "nullable": false,
15
- "format": null,
16
- "max_length": null,
17
- "choices": null,
18
- "default": null,
19
- "validators": [],
20
- "max_digits": null,
21
- "decimal_places": null,
22
- "read_only": false,
23
- "ref": null
24
- },
25
- "timestamp": {
26
- "type": "string",
27
- "title": "Timestamp",
28
- "required": true,
29
- "description": null,
30
- "nullable": false,
31
- "format": "date-time",
32
- "max_length": null,
33
- "choices": null,
34
- "default": null,
35
- "validators": [],
36
- "max_digits": null,
37
- "decimal_places": null,
38
- "read_only": false,
39
- "ref": null
40
- },
41
- "random_number": {
42
- "type": "integer",
43
- "title": "Random number",
44
- "required": true,
45
- "description": null,
46
- "nullable": false,
47
- "format": null,
48
- "max_length": null,
49
- "choices": null,
50
- "default": null,
51
- "validators": [],
52
- "max_digits": null,
53
- "decimal_places": null,
54
- "read_only": false,
55
- "ref": null
56
- },
57
- "server_info": {
58
- "type": "object",
59
- "title": "Server info",
60
- "required": true,
61
- "description": null,
62
- "nullable": false,
63
- "format": null,
64
- "max_length": null,
65
- "choices": null,
66
- "default": null,
67
- "validators": [],
68
- "max_digits": null,
69
- "decimal_places": null,
70
- "read_only": false,
71
- "ref": null
72
- },
73
- "demo_data": {
74
- "type": "object",
75
- "title": "Demo data",
76
- "required": true,
77
- "description": null,
78
- "nullable": false,
79
- "format": null,
80
- "max_length": null,
81
- "choices": null,
82
- "default": null,
83
- "validators": [],
84
- "max_digits": null,
85
- "decimal_places": null,
86
- "read_only": false,
87
- "ref": null
88
- }
89
- },
90
- "relationships": {},
91
- "permissions": [],
92
- "display": null
93
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * Get current user information (no serializers - simple action)
3
- *
4
- * @param {Object} [axiosOverrides] - Allows overriding Axios request parameters.
5
- * @returns {Promise<Object>} A promise that resolves with the action's result.
6
- */
7
- export function getUserInfo(axiosOverrides?: Object): Promise<Object>;
8
- export namespace getUserInfo {
9
- let actionName: string;
10
- let title: string;
11
- let app: string;
12
- let permissions: string[];
13
- let configKey: string;
14
- }
15
- /**
16
- * Zod schema for the response of getUserInfo.
17
- */
18
- export const getUserInfoResponseSchema: z.ZodObject<{
19
- username: z.ZodString;
20
- email: z.ZodString;
21
- is_staff: z.ZodBoolean;
22
- is_superuser: z.ZodBoolean;
23
- date_joined: z.ZodString;
24
- last_login: z.ZodNullable<z.ZodString>;
25
- server_time: z.ZodString;
26
- }, "strip", z.ZodTypeAny, {
27
- username: string;
28
- email: string;
29
- is_staff: boolean;
30
- is_superuser: boolean;
31
- date_joined: string;
32
- last_login: string | null;
33
- server_time: string;
34
- }, {
35
- username: string;
36
- email: string;
37
- is_staff: boolean;
38
- is_superuser: boolean;
39
- date_joined: string;
40
- last_login: string | null;
41
- server_time: string;
42
- }>;
43
- export default getUserInfo;
44
- import { z } from 'zod';
@@ -1,70 +0,0 @@
1
- /**
2
- * This file was auto-generated. Do not make direct changes to the file.
3
- * Action: Get User Info
4
- * App: django_app
5
- */
6
- import axios from 'axios';
7
- import { z } from 'zod';
8
- import { configInstance, parseStateZeroError, serializeActionPayload } from '../../../../src';
9
- import actionSchema from './get-user-info.schema.json' assert { type: 'json' };
10
- /**
11
- * Zod schema for the response of getUserInfo.
12
- */
13
- export const getUserInfoResponseSchema = z.object({ username: z.string(),
14
- email: z.string().email(),
15
- is_staff: z.boolean(),
16
- is_superuser: z.boolean(),
17
- date_joined: z.string().datetime({ message: "Invalid ISO 8601 datetime string" }),
18
- last_login: z.string().datetime({ message: "Invalid ISO 8601 datetime string" }).nullable(),
19
- server_time: z.string().datetime({ message: "Invalid ISO 8601 datetime string" }) });
20
- /**
21
- * Get current user information (no serializers - simple action)
22
- *
23
- * @param {Object} [axiosOverrides] - Allows overriding Axios request parameters.
24
- * @returns {Promise<Object>} A promise that resolves with the action's result.
25
- */
26
- export async function getUserInfo(axiosOverrides = {}) {
27
- // Construct the data payload from the function arguments
28
- const rawPayload = {};
29
- // Serialize payload - handles model instances (extracts PK), files, dates, etc.
30
- const payload = serializeActionPayload(rawPayload, actionSchema.input_properties);
31
- const config = configInstance.getConfig();
32
- const backend = config.backendConfigs['default'];
33
- if (!backend) {
34
- throw new Error(`No backend configuration found for key: default`);
35
- }
36
- const baseUrl = backend.API_URL.replace(/\/+$/, '');
37
- const actionUrl = `${baseUrl}/actions/get_user_info/`;
38
- const headers = backend.getAuthHeaders ? backend.getAuthHeaders() : {};
39
- try {
40
- const response = await axios.post(actionUrl, payload, {
41
- headers: { 'Content-Type': 'application/json', ...headers },
42
- ...axiosOverrides,
43
- });
44
- return getUserInfoResponseSchema.parse(response.data);
45
- }
46
- catch (error) {
47
- if (error instanceof z.ZodError) {
48
- throw new Error(`Get User Info failed: Invalid response from server. Details: ${error.message}`);
49
- }
50
- if (error.response && error.response.data) {
51
- const parsedError = parseStateZeroError(error.response.data);
52
- if (Error.captureStackTrace) {
53
- Error.captureStackTrace(parsedError, getUserInfo);
54
- }
55
- throw parsedError;
56
- }
57
- else if (error.request) {
58
- throw new Error(`Get User Info failed: No response received from server.`);
59
- }
60
- else {
61
- throw new Error(`Get User Info failed: ${error.message}`);
62
- }
63
- }
64
- }
65
- export default getUserInfo;
66
- getUserInfo.actionName = 'get_user_info';
67
- getUserInfo.title = 'Get User Info';
68
- getUserInfo.app = 'django_app';
69
- getUserInfo.permissions = ['ValidatedIsAuthenticated'];
70
- getUserInfo.configKey = 'default';
@@ -1,127 +0,0 @@
1
- {
2
- "action_name": "get_user_info",
3
- "app": "django_app",
4
- "title": "Get User Info",
5
- "docstring": "Get current user information (no serializers - simple action)",
6
- "class_name": "GetUserInfo",
7
- "input_properties": {},
8
- "response_properties": {
9
- "username": {
10
- "type": "string",
11
- "title": "Username",
12
- "required": true,
13
- "description": null,
14
- "nullable": false,
15
- "format": null,
16
- "max_length": null,
17
- "choices": null,
18
- "default": null,
19
- "validators": [],
20
- "max_digits": null,
21
- "decimal_places": null,
22
- "read_only": false,
23
- "ref": null
24
- },
25
- "email": {
26
- "type": "string",
27
- "title": "Email",
28
- "required": true,
29
- "description": null,
30
- "nullable": false,
31
- "format": "email",
32
- "max_length": null,
33
- "choices": null,
34
- "default": null,
35
- "validators": [],
36
- "max_digits": null,
37
- "decimal_places": null,
38
- "read_only": false,
39
- "ref": null
40
- },
41
- "is_staff": {
42
- "type": "boolean",
43
- "title": "Is staff",
44
- "required": true,
45
- "description": null,
46
- "nullable": false,
47
- "format": null,
48
- "max_length": null,
49
- "choices": null,
50
- "default": null,
51
- "validators": [],
52
- "max_digits": null,
53
- "decimal_places": null,
54
- "read_only": false,
55
- "ref": null
56
- },
57
- "is_superuser": {
58
- "type": "boolean",
59
- "title": "Is superuser",
60
- "required": true,
61
- "description": null,
62
- "nullable": false,
63
- "format": null,
64
- "max_length": null,
65
- "choices": null,
66
- "default": null,
67
- "validators": [],
68
- "max_digits": null,
69
- "decimal_places": null,
70
- "read_only": false,
71
- "ref": null
72
- },
73
- "date_joined": {
74
- "type": "string",
75
- "title": "Date joined",
76
- "required": true,
77
- "description": null,
78
- "nullable": false,
79
- "format": "date-time",
80
- "max_length": null,
81
- "choices": null,
82
- "default": null,
83
- "validators": [],
84
- "max_digits": null,
85
- "decimal_places": null,
86
- "read_only": false,
87
- "ref": null
88
- },
89
- "last_login": {
90
- "type": "string",
91
- "title": "Last login",
92
- "required": true,
93
- "description": null,
94
- "nullable": true,
95
- "format": "date-time",
96
- "max_length": null,
97
- "choices": null,
98
- "default": null,
99
- "validators": [],
100
- "max_digits": null,
101
- "decimal_places": null,
102
- "read_only": false,
103
- "ref": null
104
- },
105
- "server_time": {
106
- "type": "string",
107
- "title": "Server time",
108
- "required": true,
109
- "description": null,
110
- "nullable": false,
111
- "format": "date-time",
112
- "max_length": null,
113
- "choices": null,
114
- "default": null,
115
- "validators": [],
116
- "max_digits": null,
117
- "decimal_places": null,
118
- "read_only": false,
119
- "ref": null
120
- }
121
- },
122
- "relationships": {},
123
- "permissions": [
124
- "ValidatedIsAuthenticated"
125
- ],
126
- "display": null
127
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export * from './calculate-hash';
2
- export * from './get-current-username';
3
- export * from './get-server-status';
4
- export * from './get-user-info';
5
- export * from './process-data';
6
- export * from './send-notification';
@@ -1,51 +0,0 @@
1
- /**
2
- * Process a list of numbers with various mathematical operations
3
- *
4
- * @param any[] data - List of numbers to process
5
- * @param 'sum' | 'avg' | 'max' | 'min' operation - Mathematical operation to perform
6
- * @param {Object} [axiosOverrides] - Allows overriding Axios request parameters.
7
- * @returns {Promise<Object>} A promise that resolves with the action's result.
8
- */
9
- export function processData(data: any, operation: any, axiosOverrides?: Object): Promise<Object>;
10
- export namespace processData {
11
- let actionName: string;
12
- let title: string;
13
- let app: string;
14
- let permissions: string[];
15
- let configKey: string;
16
- }
17
- /**
18
- * Zod schema for the input of processData.
19
- * NOTE: This is an object schema for validating the data payload.
20
- */
21
- export const processDataInputSchema: z.ZodObject<{
22
- data: z.ZodArray<z.ZodAny, "many">;
23
- operation: z.ZodEnum<["sum", "avg", "max", "min"]>;
24
- }, "strip", z.ZodTypeAny, {
25
- data: any[];
26
- operation: "min" | "max" | "avg" | "sum";
27
- }, {
28
- data: any[];
29
- operation: "min" | "max" | "avg" | "sum";
30
- }>;
31
- /**
32
- * Zod schema for the response of processData.
33
- */
34
- export const processDataResponseSchema: z.ZodObject<{
35
- operation: z.ZodString;
36
- result: z.ZodNumber;
37
- processed_count: z.ZodNumber;
38
- execution_time_ms: z.ZodNumber;
39
- }, "strip", z.ZodTypeAny, {
40
- operation: string;
41
- result: number;
42
- processed_count: number;
43
- execution_time_ms: number;
44
- }, {
45
- operation: string;
46
- result: number;
47
- processed_count: number;
48
- execution_time_ms: number;
49
- }>;
50
- export default processData;
51
- import { z } from 'zod';
@@ -1,78 +0,0 @@
1
- /**
2
- * This file was auto-generated. Do not make direct changes to the file.
3
- * Action: Process Data
4
- * App: django_app
5
- */
6
- import axios from 'axios';
7
- import { z } from 'zod';
8
- import { configInstance, parseStateZeroError, serializeActionPayload } from '../../../../src';
9
- import actionSchema from './process-data.schema.json' assert { type: 'json' };
10
- /**
11
- * Zod schema for the input of processData.
12
- * NOTE: This is an object schema for validating the data payload.
13
- */
14
- export const processDataInputSchema = z.object({ data: z.array(z.any()),
15
- operation: z.enum(["sum", "avg", "max", "min"]) });
16
- /**
17
- * Zod schema for the response of processData.
18
- */
19
- export const processDataResponseSchema = z.object({ operation: z.string(),
20
- result: z.number(),
21
- processed_count: z.number().int(),
22
- execution_time_ms: z.number().int() });
23
- /**
24
- * Process a list of numbers with various mathematical operations
25
- *
26
- * @param any[] data - List of numbers to process
27
- * @param 'sum' | 'avg' | 'max' | 'min' operation - Mathematical operation to perform
28
- * @param {Object} [axiosOverrides] - Allows overriding Axios request parameters.
29
- * @returns {Promise<Object>} A promise that resolves with the action's result.
30
- */
31
- export async function processData(data, operation, axiosOverrides = {}) {
32
- // Construct the data payload from the function arguments
33
- const rawPayload = {
34
- data,
35
- operation
36
- };
37
- // Serialize payload - handles model instances (extracts PK), files, dates, etc.
38
- const payload = serializeActionPayload(rawPayload, actionSchema.input_properties);
39
- const config = configInstance.getConfig();
40
- const backend = config.backendConfigs['default'];
41
- if (!backend) {
42
- throw new Error(`No backend configuration found for key: default`);
43
- }
44
- const baseUrl = backend.API_URL.replace(/\/+$/, '');
45
- const actionUrl = `${baseUrl}/actions/process_data/`;
46
- const headers = backend.getAuthHeaders ? backend.getAuthHeaders() : {};
47
- try {
48
- const response = await axios.post(actionUrl, payload, {
49
- headers: { 'Content-Type': 'application/json', ...headers },
50
- ...axiosOverrides,
51
- });
52
- return processDataResponseSchema.parse(response.data);
53
- }
54
- catch (error) {
55
- if (error instanceof z.ZodError) {
56
- throw new Error(`Process Data failed: Invalid response from server. Details: ${error.message}`);
57
- }
58
- if (error.response && error.response.data) {
59
- const parsedError = parseStateZeroError(error.response.data);
60
- if (Error.captureStackTrace) {
61
- Error.captureStackTrace(parsedError, processData);
62
- }
63
- throw parsedError;
64
- }
65
- else if (error.request) {
66
- throw new Error(`Process Data failed: No response received from server.`);
67
- }
68
- else {
69
- throw new Error(`Process Data failed: ${error.message}`);
70
- }
71
- }
72
- }
73
- export default processData;
74
- processData.actionName = 'process_data';
75
- processData.title = 'Process Data';
76
- processData.app = 'django_app';
77
- processData.permissions = ['ValidatedHasValidApiKey'];
78
- processData.configKey = 'default';
@@ -1,117 +0,0 @@
1
- {
2
- "action_name": "process_data",
3
- "app": "django_app",
4
- "title": "Process Data",
5
- "docstring": "Process a list of numbers with various mathematical operations",
6
- "class_name": "ProcessData",
7
- "input_properties": {
8
- "data": {
9
- "type": "array",
10
- "title": "Data",
11
- "required": true,
12
- "description": "List of numbers to process",
13
- "nullable": false,
14
- "format": null,
15
- "max_length": null,
16
- "choices": null,
17
- "default": null,
18
- "validators": [],
19
- "max_digits": null,
20
- "decimal_places": null,
21
- "read_only": false,
22
- "ref": null
23
- },
24
- "operation": {
25
- "type": "string",
26
- "title": "Operation",
27
- "required": true,
28
- "description": "Mathematical operation to perform",
29
- "nullable": false,
30
- "format": null,
31
- "max_length": null,
32
- "choices": {
33
- "sum": "Sum",
34
- "avg": "Average",
35
- "max": "Maximum",
36
- "min": "Minimum"
37
- },
38
- "default": null,
39
- "validators": [],
40
- "max_digits": null,
41
- "decimal_places": null,
42
- "read_only": false,
43
- "ref": null
44
- }
45
- },
46
- "response_properties": {
47
- "operation": {
48
- "type": "string",
49
- "title": "Operation",
50
- "required": true,
51
- "description": null,
52
- "nullable": false,
53
- "format": null,
54
- "max_length": null,
55
- "choices": null,
56
- "default": null,
57
- "validators": [],
58
- "max_digits": null,
59
- "decimal_places": null,
60
- "read_only": false,
61
- "ref": null
62
- },
63
- "result": {
64
- "type": "number",
65
- "title": "Result",
66
- "required": true,
67
- "description": null,
68
- "nullable": false,
69
- "format": null,
70
- "max_length": null,
71
- "choices": null,
72
- "default": null,
73
- "validators": [],
74
- "max_digits": null,
75
- "decimal_places": null,
76
- "read_only": false,
77
- "ref": null
78
- },
79
- "processed_count": {
80
- "type": "integer",
81
- "title": "Processed count",
82
- "required": true,
83
- "description": null,
84
- "nullable": false,
85
- "format": null,
86
- "max_length": null,
87
- "choices": null,
88
- "default": null,
89
- "validators": [],
90
- "max_digits": null,
91
- "decimal_places": null,
92
- "read_only": false,
93
- "ref": null
94
- },
95
- "execution_time_ms": {
96
- "type": "integer",
97
- "title": "Execution time ms",
98
- "required": true,
99
- "description": null,
100
- "nullable": false,
101
- "format": null,
102
- "max_length": null,
103
- "choices": null,
104
- "default": null,
105
- "validators": [],
106
- "max_digits": null,
107
- "decimal_places": null,
108
- "read_only": false,
109
- "ref": null
110
- }
111
- },
112
- "relationships": {},
113
- "permissions": [
114
- "ValidatedHasValidApiKey"
115
- ],
116
- "display": null
117
- }