@constructive-io/sdk 0.30.0 → 0.30.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 (324) hide show
  1. package/README.md +1 -0
  2. package/agent/orm/input-types.d.ts +96 -8
  3. package/api/orm/index.d.ts +5 -15
  4. package/api/orm/index.js +2 -2
  5. package/api/orm/input-types.d.ts +250 -231
  6. package/api/orm/models/index.d.ts +1 -1
  7. package/api/orm/models/index.js +3 -3
  8. package/api/orm/mutation/index.d.ts +11 -36
  9. package/api/orm/mutation/index.js +6 -30
  10. package/auth/orm/index.d.ts +10 -5
  11. package/auth/orm/input-types.d.ts +54 -45
  12. package/auth/orm/models/principal.d.ts +1 -10
  13. package/auth/orm/models/principal.js +0 -13
  14. package/auth/orm/mutation/index.d.ts +17 -9
  15. package/auth/orm/mutation/index.js +24 -12
  16. package/compute/orm/index.d.ts +76 -17
  17. package/compute/orm/index.js +56 -12
  18. package/compute/orm/input-types.d.ts +5893 -1343
  19. package/compute/orm/input-types.js +17 -3
  20. package/compute/orm/models/dbPreset.d.ts +54 -0
  21. package/compute/orm/models/dbPreset.js +104 -0
  22. package/compute/orm/models/functionGraphCommit.d.ts +2 -2
  23. package/compute/orm/models/functionGraphCommit.js +2 -2
  24. package/compute/orm/models/functionGraphObject.d.ts +2 -2
  25. package/compute/orm/models/functionGraphObject.js +2 -2
  26. package/compute/orm/models/functionGraphRef.d.ts +2 -2
  27. package/compute/orm/models/functionGraphRef.js +2 -2
  28. package/compute/orm/models/index.d.ts +28 -6
  29. package/compute/orm/models/index.js +57 -13
  30. package/compute/orm/models/infraCommit.d.ts +56 -0
  31. package/compute/orm/models/infraCommit.js +107 -0
  32. package/compute/orm/models/infraGetAllRecord.d.ts +30 -0
  33. package/compute/orm/models/infraGetAllRecord.js +59 -0
  34. package/compute/orm/models/infraObject.d.ts +56 -0
  35. package/compute/orm/models/infraObject.js +97 -0
  36. package/compute/orm/models/infraRef.d.ts +56 -0
  37. package/compute/orm/models/infraRef.js +107 -0
  38. package/compute/orm/models/infraStore.d.ts +54 -0
  39. package/compute/orm/models/infraStore.js +104 -0
  40. package/compute/orm/models/integrationProvider.d.ts +54 -0
  41. package/{modules/orm/models/configSecretsModule.js → compute/orm/models/integrationProvider.js} +27 -27
  42. package/compute/orm/models/namespace.d.ts +54 -0
  43. package/compute/orm/models/namespace.js +104 -0
  44. package/compute/orm/models/namespaceEvent.d.ts +56 -0
  45. package/compute/orm/models/{orgFunctionExecutionLog.js → namespaceEvent.js} +27 -27
  46. package/compute/orm/models/platformFunctionApiBinding.d.ts +54 -0
  47. package/compute/orm/models/platformFunctionApiBinding.js +104 -0
  48. package/compute/orm/models/platformFunctionDefinition.d.ts +54 -0
  49. package/compute/orm/models/platformFunctionDefinition.js +104 -0
  50. package/compute/orm/models/platformFunctionDeployment.d.ts +54 -0
  51. package/compute/orm/models/platformFunctionDeployment.js +104 -0
  52. package/compute/orm/models/platformFunctionDeploymentEvent.d.ts +56 -0
  53. package/compute/orm/models/platformFunctionDeploymentEvent.js +107 -0
  54. package/compute/orm/models/platformFunctionExecutionLog.d.ts +56 -0
  55. package/compute/orm/models/platformFunctionExecutionLog.js +107 -0
  56. package/compute/orm/models/platformFunctionInvocation.d.ts +56 -0
  57. package/compute/orm/models/platformFunctionInvocation.js +107 -0
  58. package/compute/orm/models/platformResource.d.ts +54 -0
  59. package/compute/orm/models/{secretDefinition.js → platformResource.js} +27 -27
  60. package/compute/orm/models/platformResourceDefinition.d.ts +54 -0
  61. package/compute/orm/models/platformResourceDefinition.js +104 -0
  62. package/compute/orm/models/platformResourceEvent.d.ts +56 -0
  63. package/compute/orm/models/{orgFunctionInvocation.js → platformResourceEvent.js} +27 -27
  64. package/compute/orm/models/platformResourceStatusCheck.d.ts +54 -0
  65. package/compute/orm/models/platformResourceStatusCheck.js +104 -0
  66. package/compute/orm/models/platformResourcesRequirementsState.d.ts +30 -0
  67. package/compute/orm/models/platformResourcesRequirementsState.js +59 -0
  68. package/compute/orm/models/platformResourcesResolvedRequirement.d.ts +30 -0
  69. package/compute/orm/models/platformResourcesResolvedRequirement.js +59 -0
  70. package/compute/orm/models/resourceDefinition.d.ts +54 -0
  71. package/compute/orm/models/resourceDefinition.js +104 -0
  72. package/compute/orm/models/resourceStatusCheck.d.ts +54 -0
  73. package/compute/orm/models/resourceStatusCheck.js +104 -0
  74. package/compute/orm/models/resourcesRequirementsState.d.ts +30 -0
  75. package/compute/orm/models/resourcesRequirementsState.js +59 -0
  76. package/compute/orm/models/resourcesResolvedRequirement.d.ts +30 -0
  77. package/compute/orm/models/resourcesResolvedRequirement.js +59 -0
  78. package/compute/orm/mutation/index.d.ts +33 -9
  79. package/compute/orm/mutation/index.js +48 -12
  80. package/config/orm/index.d.ts +42 -16
  81. package/config/orm/index.js +8 -2
  82. package/config/orm/input-types.d.ts +595 -154
  83. package/config/orm/models/config.d.ts +54 -0
  84. package/{modules/orm/models/configSecretsOrgModule.js → config/orm/models/config.js} +27 -27
  85. package/config/orm/models/index.d.ts +4 -1
  86. package/config/orm/models/index.js +9 -3
  87. package/config/orm/models/platformInternalSecret.d.ts +36 -0
  88. package/config/orm/models/platformInternalSecret.js +80 -0
  89. package/config/orm/models/platformSecret.d.ts +36 -0
  90. package/config/orm/models/platformSecret.js +80 -0
  91. package/config/orm/models/secret.d.ts +36 -0
  92. package/config/orm/models/secret.js +80 -0
  93. package/config/orm/mutation/index.d.ts +56 -24
  94. package/config/orm/mutation/index.js +78 -30
  95. package/esm/agent/orm/input-types.d.ts +96 -8
  96. package/esm/api/orm/index.d.ts +5 -15
  97. package/esm/api/orm/index.js +2 -2
  98. package/esm/api/orm/input-types.d.ts +250 -231
  99. package/esm/api/orm/models/index.d.ts +1 -1
  100. package/esm/api/orm/models/index.js +1 -1
  101. package/esm/api/orm/mutation/index.d.ts +11 -36
  102. package/esm/api/orm/mutation/index.js +6 -30
  103. package/esm/auth/orm/index.d.ts +10 -5
  104. package/esm/auth/orm/input-types.d.ts +54 -45
  105. package/esm/auth/orm/models/principal.d.ts +1 -10
  106. package/esm/auth/orm/models/principal.js +1 -14
  107. package/esm/auth/orm/mutation/index.d.ts +17 -9
  108. package/esm/auth/orm/mutation/index.js +24 -12
  109. package/esm/compute/orm/index.d.ts +76 -17
  110. package/esm/compute/orm/index.js +56 -12
  111. package/esm/compute/orm/input-types.d.ts +5893 -1343
  112. package/esm/compute/orm/input-types.js +17 -3
  113. package/esm/compute/orm/models/dbPreset.d.ts +54 -0
  114. package/esm/compute/orm/models/dbPreset.js +100 -0
  115. package/esm/compute/orm/models/functionGraphCommit.d.ts +2 -2
  116. package/esm/compute/orm/models/functionGraphCommit.js +2 -2
  117. package/esm/compute/orm/models/functionGraphObject.d.ts +2 -2
  118. package/esm/compute/orm/models/functionGraphObject.js +2 -2
  119. package/esm/compute/orm/models/functionGraphRef.d.ts +2 -2
  120. package/esm/compute/orm/models/functionGraphRef.js +2 -2
  121. package/esm/compute/orm/models/index.d.ts +28 -6
  122. package/esm/compute/orm/models/index.js +28 -6
  123. package/esm/compute/orm/models/infraCommit.d.ts +56 -0
  124. package/esm/compute/orm/models/infraCommit.js +103 -0
  125. package/esm/compute/orm/models/infraGetAllRecord.d.ts +30 -0
  126. package/esm/compute/orm/models/infraGetAllRecord.js +55 -0
  127. package/esm/compute/orm/models/infraObject.d.ts +56 -0
  128. package/esm/compute/orm/models/infraObject.js +93 -0
  129. package/esm/compute/orm/models/infraRef.d.ts +56 -0
  130. package/esm/compute/orm/models/infraRef.js +103 -0
  131. package/esm/compute/orm/models/infraStore.d.ts +54 -0
  132. package/esm/compute/orm/models/infraStore.js +100 -0
  133. package/esm/compute/orm/models/integrationProvider.d.ts +54 -0
  134. package/esm/compute/orm/models/integrationProvider.js +100 -0
  135. package/esm/compute/orm/models/namespace.d.ts +54 -0
  136. package/esm/compute/orm/models/namespace.js +100 -0
  137. package/esm/compute/orm/models/namespaceEvent.d.ts +56 -0
  138. package/esm/compute/orm/models/{orgFunctionExecutionLog.js → namespaceEvent.js} +25 -25
  139. package/esm/compute/orm/models/platformFunctionApiBinding.d.ts +54 -0
  140. package/esm/compute/orm/models/platformFunctionApiBinding.js +100 -0
  141. package/esm/compute/orm/models/platformFunctionDefinition.d.ts +54 -0
  142. package/esm/compute/orm/models/platformFunctionDefinition.js +100 -0
  143. package/esm/compute/orm/models/platformFunctionDeployment.d.ts +54 -0
  144. package/esm/compute/orm/models/platformFunctionDeployment.js +100 -0
  145. package/esm/compute/orm/models/platformFunctionDeploymentEvent.d.ts +56 -0
  146. package/esm/compute/orm/models/platformFunctionDeploymentEvent.js +103 -0
  147. package/esm/compute/orm/models/platformFunctionExecutionLog.d.ts +56 -0
  148. package/esm/compute/orm/models/platformFunctionExecutionLog.js +103 -0
  149. package/esm/compute/orm/models/platformFunctionInvocation.d.ts +56 -0
  150. package/esm/compute/orm/models/platformFunctionInvocation.js +103 -0
  151. package/esm/compute/orm/models/platformResource.d.ts +54 -0
  152. package/esm/compute/orm/models/{secretDefinition.js → platformResource.js} +25 -25
  153. package/esm/compute/orm/models/platformResourceDefinition.d.ts +54 -0
  154. package/esm/compute/orm/models/platformResourceDefinition.js +100 -0
  155. package/esm/compute/orm/models/platformResourceEvent.d.ts +56 -0
  156. package/esm/compute/orm/models/{orgFunctionInvocation.js → platformResourceEvent.js} +25 -25
  157. package/esm/compute/orm/models/platformResourceStatusCheck.d.ts +54 -0
  158. package/esm/compute/orm/models/platformResourceStatusCheck.js +100 -0
  159. package/esm/compute/orm/models/platformResourcesRequirementsState.d.ts +30 -0
  160. package/esm/compute/orm/models/platformResourcesRequirementsState.js +55 -0
  161. package/esm/compute/orm/models/platformResourcesResolvedRequirement.d.ts +30 -0
  162. package/esm/compute/orm/models/platformResourcesResolvedRequirement.js +55 -0
  163. package/esm/compute/orm/models/resourceDefinition.d.ts +54 -0
  164. package/esm/{modules/orm/models/configSecretsOrgModule.js → compute/orm/models/resourceDefinition.js} +25 -25
  165. package/esm/compute/orm/models/resourceStatusCheck.d.ts +54 -0
  166. package/esm/compute/orm/models/resourceStatusCheck.js +100 -0
  167. package/esm/compute/orm/models/resourcesRequirementsState.d.ts +30 -0
  168. package/esm/compute/orm/models/resourcesRequirementsState.js +55 -0
  169. package/esm/compute/orm/models/resourcesResolvedRequirement.d.ts +30 -0
  170. package/esm/compute/orm/models/resourcesResolvedRequirement.js +55 -0
  171. package/esm/compute/orm/mutation/index.d.ts +33 -9
  172. package/esm/compute/orm/mutation/index.js +48 -12
  173. package/esm/config/orm/index.d.ts +42 -16
  174. package/esm/config/orm/index.js +8 -2
  175. package/esm/config/orm/input-types.d.ts +595 -154
  176. package/esm/config/orm/models/config.d.ts +54 -0
  177. package/esm/{modules/orm/models/configSecretsModule.js → config/orm/models/config.js} +25 -25
  178. package/esm/config/orm/models/index.d.ts +4 -1
  179. package/esm/config/orm/models/index.js +4 -1
  180. package/esm/config/orm/models/platformInternalSecret.d.ts +36 -0
  181. package/esm/config/orm/models/platformInternalSecret.js +76 -0
  182. package/esm/config/orm/models/platformSecret.d.ts +36 -0
  183. package/esm/config/orm/models/platformSecret.js +76 -0
  184. package/esm/config/orm/models/secret.d.ts +36 -0
  185. package/esm/config/orm/models/secret.js +76 -0
  186. package/esm/config/orm/mutation/index.d.ts +56 -24
  187. package/esm/config/orm/mutation/index.js +78 -30
  188. package/esm/index.d.ts +1 -0
  189. package/esm/index.js +1 -0
  190. package/esm/infra/index.d.ts +5 -0
  191. package/esm/infra/index.js +5 -0
  192. package/esm/infra/orm/client.d.ts +97 -0
  193. package/esm/infra/orm/client.js +145 -0
  194. package/esm/infra/orm/index.d.ts +74 -0
  195. package/esm/infra/orm/index.js +61 -0
  196. package/esm/infra/orm/input-types.d.ts +1953 -0
  197. package/esm/infra/orm/input-types.js +2 -0
  198. package/esm/infra/orm/models/dbPreset.d.ts +54 -0
  199. package/esm/infra/orm/models/dbPreset.js +100 -0
  200. package/esm/infra/orm/models/index.d.ts +15 -0
  201. package/esm/infra/orm/models/index.js +15 -0
  202. package/esm/infra/orm/models/infraCommit.d.ts +56 -0
  203. package/esm/infra/orm/models/infraCommit.js +103 -0
  204. package/esm/infra/orm/models/infraGetAllRecord.d.ts +30 -0
  205. package/esm/infra/orm/models/infraGetAllRecord.js +55 -0
  206. package/esm/infra/orm/models/infraObject.d.ts +56 -0
  207. package/esm/infra/orm/models/infraObject.js +93 -0
  208. package/esm/infra/orm/models/infraRef.d.ts +56 -0
  209. package/esm/infra/orm/models/infraRef.js +103 -0
  210. package/esm/infra/orm/models/infraStore.d.ts +54 -0
  211. package/esm/infra/orm/models/infraStore.js +100 -0
  212. package/esm/infra/orm/models/namespace.d.ts +54 -0
  213. package/esm/infra/orm/models/namespace.js +100 -0
  214. package/esm/infra/orm/models/namespaceEvent.d.ts +56 -0
  215. package/esm/infra/orm/models/namespaceEvent.js +103 -0
  216. package/esm/infra/orm/models/platformNamespace.d.ts +54 -0
  217. package/esm/{config/orm/models/platformConfigDefinition.js → infra/orm/models/platformNamespace.js} +25 -25
  218. package/esm/infra/orm/models/platformNamespaceEvent.d.ts +56 -0
  219. package/esm/infra/orm/models/platformNamespaceEvent.js +103 -0
  220. package/esm/infra/orm/mutation/index.d.ts +50 -0
  221. package/esm/infra/orm/mutation/index.js +54 -0
  222. package/esm/infra/orm/query-builder.d.ts +110 -0
  223. package/esm/infra/orm/query-builder.js +705 -0
  224. package/esm/infra/orm/realtime.d.ts +142 -0
  225. package/esm/infra/orm/realtime.js +100 -0
  226. package/esm/infra/orm/select-types.d.ts +125 -0
  227. package/esm/infra/orm/select-types.js +1 -0
  228. package/esm/infra/orm/types.d.ts +6 -0
  229. package/esm/infra/orm/types.js +7 -0
  230. package/esm/modules/orm/index.d.ts +48 -38
  231. package/esm/modules/orm/index.js +48 -38
  232. package/esm/modules/orm/input-types.d.ts +5378 -4022
  233. package/esm/modules/orm/input-types.js +1 -0
  234. package/esm/modules/orm/models/dbPool.d.ts +54 -0
  235. package/esm/modules/orm/models/dbPool.js +100 -0
  236. package/esm/modules/orm/models/dbPoolConfig.d.ts +54 -0
  237. package/esm/modules/orm/models/dbPoolConfig.js +100 -0
  238. package/esm/modules/orm/models/dbPresetModule.d.ts +54 -0
  239. package/esm/modules/orm/models/dbPresetModule.js +100 -0
  240. package/esm/modules/orm/models/index.d.ts +24 -19
  241. package/esm/modules/orm/models/index.js +24 -19
  242. package/esm/modules/orm/models/infraConfigModule.d.ts +54 -0
  243. package/esm/modules/orm/models/infraConfigModule.js +100 -0
  244. package/esm/modules/orm/models/infraSecretsModule.d.ts +54 -0
  245. package/esm/modules/orm/models/infraSecretsModule.js +100 -0
  246. package/esm/modules/orm/models/integrationProvidersModule.d.ts +54 -0
  247. package/esm/modules/orm/models/integrationProvidersModule.js +100 -0
  248. package/esm/modules/orm/models/internalSecretsModule.d.ts +54 -0
  249. package/esm/modules/orm/models/internalSecretsModule.js +100 -0
  250. package/index.d.ts +1 -0
  251. package/index.js +2 -1
  252. package/infra/index.d.ts +5 -0
  253. package/infra/index.js +21 -0
  254. package/infra/orm/client.d.ts +97 -0
  255. package/infra/orm/client.js +152 -0
  256. package/infra/orm/index.d.ts +74 -0
  257. package/infra/orm/index.js +83 -0
  258. package/infra/orm/input-types.d.ts +1953 -0
  259. package/infra/orm/input-types.js +5 -0
  260. package/infra/orm/models/dbPreset.d.ts +54 -0
  261. package/infra/orm/models/dbPreset.js +104 -0
  262. package/infra/orm/models/index.d.ts +15 -0
  263. package/infra/orm/models/index.js +28 -0
  264. package/infra/orm/models/infraCommit.d.ts +56 -0
  265. package/infra/orm/models/infraCommit.js +107 -0
  266. package/infra/orm/models/infraGetAllRecord.d.ts +30 -0
  267. package/infra/orm/models/infraGetAllRecord.js +59 -0
  268. package/infra/orm/models/infraObject.d.ts +56 -0
  269. package/infra/orm/models/infraObject.js +97 -0
  270. package/infra/orm/models/infraRef.d.ts +56 -0
  271. package/infra/orm/models/infraRef.js +107 -0
  272. package/infra/orm/models/infraStore.d.ts +54 -0
  273. package/infra/orm/models/infraStore.js +104 -0
  274. package/infra/orm/models/namespace.d.ts +54 -0
  275. package/infra/orm/models/namespace.js +104 -0
  276. package/infra/orm/models/namespaceEvent.d.ts +56 -0
  277. package/infra/orm/models/namespaceEvent.js +107 -0
  278. package/infra/orm/models/platformNamespace.d.ts +54 -0
  279. package/infra/orm/models/platformNamespace.js +104 -0
  280. package/infra/orm/models/platformNamespaceEvent.d.ts +56 -0
  281. package/{config/orm/models/platformConfigDefinition.js → infra/orm/models/platformNamespaceEvent.js} +30 -27
  282. package/infra/orm/mutation/index.d.ts +50 -0
  283. package/infra/orm/mutation/index.js +57 -0
  284. package/infra/orm/query-builder.d.ts +110 -0
  285. package/infra/orm/query-builder.js +757 -0
  286. package/infra/orm/realtime.d.ts +142 -0
  287. package/infra/orm/realtime.js +104 -0
  288. package/infra/orm/select-types.d.ts +125 -0
  289. package/infra/orm/select-types.js +2 -0
  290. package/infra/orm/types.d.ts +6 -0
  291. package/infra/orm/types.js +23 -0
  292. package/modules/orm/index.d.ts +48 -38
  293. package/modules/orm/index.js +48 -38
  294. package/modules/orm/input-types.d.ts +5378 -4022
  295. package/modules/orm/input-types.js +1 -0
  296. package/modules/orm/models/dbPool.d.ts +54 -0
  297. package/modules/orm/models/dbPool.js +104 -0
  298. package/modules/orm/models/dbPoolConfig.d.ts +54 -0
  299. package/modules/orm/models/dbPoolConfig.js +104 -0
  300. package/modules/orm/models/dbPresetModule.d.ts +54 -0
  301. package/modules/orm/models/dbPresetModule.js +104 -0
  302. package/modules/orm/models/index.d.ts +24 -19
  303. package/modules/orm/models/index.js +50 -40
  304. package/modules/orm/models/infraConfigModule.d.ts +54 -0
  305. package/modules/orm/models/infraConfigModule.js +104 -0
  306. package/modules/orm/models/infraSecretsModule.d.ts +54 -0
  307. package/modules/orm/models/infraSecretsModule.js +104 -0
  308. package/modules/orm/models/integrationProvidersModule.d.ts +54 -0
  309. package/modules/orm/models/integrationProvidersModule.js +104 -0
  310. package/modules/orm/models/internalSecretsModule.d.ts +54 -0
  311. package/modules/orm/models/internalSecretsModule.js +104 -0
  312. package/package.json +4 -4
  313. package/compute/orm/models/orgFunctionExecutionLog.d.ts +0 -56
  314. package/compute/orm/models/orgFunctionInvocation.d.ts +0 -56
  315. package/compute/orm/models/secretDefinition.d.ts +0 -54
  316. package/config/orm/models/platformConfigDefinition.d.ts +0 -54
  317. package/esm/compute/orm/models/orgFunctionExecutionLog.d.ts +0 -56
  318. package/esm/compute/orm/models/orgFunctionInvocation.d.ts +0 -56
  319. package/esm/compute/orm/models/secretDefinition.d.ts +0 -54
  320. package/esm/config/orm/models/platformConfigDefinition.d.ts +0 -54
  321. package/esm/modules/orm/models/configSecretsModule.d.ts +0 -54
  322. package/esm/modules/orm/models/configSecretsOrgModule.d.ts +0 -54
  323. package/modules/orm/models/configSecretsModule.d.ts +0 -54
  324. package/modules/orm/models/configSecretsOrgModule.d.ts +0 -54
@@ -0,0 +1,757 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.QueryBuilder = void 0;
37
+ exports.buildSelections = buildSelections;
38
+ exports.buildFindManyDocument = buildFindManyDocument;
39
+ exports.buildFindFirstDocument = buildFindFirstDocument;
40
+ exports.buildCreateDocument = buildCreateDocument;
41
+ exports.buildUpdateDocument = buildUpdateDocument;
42
+ exports.buildUpdateByPkDocument = buildUpdateByPkDocument;
43
+ exports.buildFindOneDocument = buildFindOneDocument;
44
+ exports.buildDeleteDocument = buildDeleteDocument;
45
+ exports.buildDeleteByPkDocument = buildDeleteByPkDocument;
46
+ exports.buildJunctionRemoveDocument = buildJunctionRemoveDocument;
47
+ exports.buildCustomDocument = buildCustomDocument;
48
+ exports.buildBulkInsertDocument = buildBulkInsertDocument;
49
+ exports.buildBulkUpsertDocument = buildBulkUpsertDocument;
50
+ exports.buildBulkUpdateDocument = buildBulkUpdateDocument;
51
+ exports.buildBulkDeleteDocument = buildBulkDeleteDocument;
52
+ /**
53
+ * Query Builder - Builds and executes GraphQL operations
54
+ * @generated by @constructive-io/graphql-codegen
55
+ * DO NOT EDIT - changes will be overwritten
56
+ */
57
+ const runtime_1 = require("@constructive-io/graphql-query/runtime");
58
+ const t = __importStar(require("gql-ast"));
59
+ const client_1 = require("./client");
60
+ class QueryBuilder {
61
+ config;
62
+ constructor(config) {
63
+ this.config = config;
64
+ }
65
+ /**
66
+ * Execute the query and return a discriminated union result
67
+ * Use result.ok to check success, or .unwrap() to throw on error
68
+ */
69
+ async execute() {
70
+ const rawResult = await this.config.client.execute(this.config.document, this.config.variables);
71
+ if (!rawResult.ok) {
72
+ return rawResult;
73
+ }
74
+ if (!this.config.transform) {
75
+ return rawResult;
76
+ }
77
+ return {
78
+ ok: true,
79
+ data: this.config.transform(rawResult.data),
80
+ errors: undefined,
81
+ };
82
+ }
83
+ /**
84
+ * Execute and unwrap the result, throwing GraphQLRequestError on failure
85
+ * @throws {GraphQLRequestError} If the query returns errors
86
+ */
87
+ async unwrap() {
88
+ const result = await this.execute();
89
+ if (!result.ok) {
90
+ throw new client_1.GraphQLRequestError(result.errors, result.data);
91
+ }
92
+ return result.data;
93
+ }
94
+ /**
95
+ * Execute and unwrap, returning defaultValue on error instead of throwing
96
+ */
97
+ async unwrapOr(defaultValue) {
98
+ const result = await this.execute();
99
+ if (!result.ok) {
100
+ return defaultValue;
101
+ }
102
+ return result.data;
103
+ }
104
+ /**
105
+ * Execute and unwrap, calling onError callback on failure
106
+ */
107
+ async unwrapOrElse(onError) {
108
+ const result = await this.execute();
109
+ if (!result.ok) {
110
+ return onError(result.errors);
111
+ }
112
+ return result.data;
113
+ }
114
+ toGraphQL() {
115
+ return this.config.document;
116
+ }
117
+ getVariables() {
118
+ return this.config.variables;
119
+ }
120
+ }
121
+ exports.QueryBuilder = QueryBuilder;
122
+ const OP_QUERY = 'query';
123
+ const OP_MUTATION = 'mutation';
124
+ const ENUM_VALUE_KIND = 'EnumValue';
125
+ // ============================================================================
126
+ // Selection Builders
127
+ // ============================================================================
128
+ function buildSelections(select, connectionFieldsMap, entityType) {
129
+ if (!select) {
130
+ return [];
131
+ }
132
+ const fields = [];
133
+ const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined;
134
+ for (const [key, value] of Object.entries(select)) {
135
+ if (value === false || value === undefined) {
136
+ continue;
137
+ }
138
+ if (value === true) {
139
+ fields.push(t.field({ name: key }));
140
+ continue;
141
+ }
142
+ if (typeof value === 'object' && value !== null) {
143
+ const nested = value;
144
+ // Field with arguments (e.g. requestUploadUrl on bucket types)
145
+ if (nested.args && typeof nested.args === 'object') {
146
+ const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => t.argument({ name: argName, value: buildValueAst(argValue) }));
147
+ const nestedSelect = nested.select;
148
+ if (nestedSelect && typeof nestedSelect === 'object') {
149
+ const subSelections = Object.entries(nestedSelect)
150
+ .filter(([, v]) => v)
151
+ .map(([name]) => t.field({ name }));
152
+ fields.push(t.field({
153
+ name: key,
154
+ args: fieldArgs.length ? fieldArgs : undefined,
155
+ selectionSet: subSelections.length
156
+ ? t.selectionSet({ selections: subSelections })
157
+ : undefined,
158
+ }));
159
+ }
160
+ else {
161
+ fields.push(t.field({
162
+ name: key,
163
+ args: fieldArgs.length ? fieldArgs : undefined,
164
+ }));
165
+ }
166
+ continue;
167
+ }
168
+ if (!nested.select || typeof nested.select !== 'object') {
169
+ throw new Error(`Invalid selection for field "${key}": nested selections must include a "select" object.`);
170
+ }
171
+ const relatedEntityType = entityConnections?.[key];
172
+ const nestedSelections = buildSelections(nested.select, connectionFieldsMap, relatedEntityType);
173
+ const isConnection = nested.connection === true ||
174
+ nested.first !== undefined ||
175
+ nested.filter !== undefined ||
176
+ relatedEntityType !== undefined;
177
+ const args = buildArgs([
178
+ buildOptionalArg('first', nested.first),
179
+ nested.filter
180
+ ? t.argument({
181
+ name: 'filter',
182
+ value: buildValueAst(nested.filter),
183
+ })
184
+ : null,
185
+ buildEnumListArg('orderBy', nested.orderBy),
186
+ ]);
187
+ if (isConnection) {
188
+ fields.push(t.field({
189
+ name: key,
190
+ args,
191
+ selectionSet: t.selectionSet({
192
+ selections: buildConnectionSelections(nestedSelections),
193
+ }),
194
+ }));
195
+ }
196
+ else {
197
+ fields.push(t.field({
198
+ name: key,
199
+ args,
200
+ selectionSet: t.selectionSet({ selections: nestedSelections }),
201
+ }));
202
+ }
203
+ }
204
+ }
205
+ return fields;
206
+ }
207
+ // ============================================================================
208
+ // Document Builders
209
+ // ============================================================================
210
+ function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) {
211
+ const selections = select
212
+ ? buildSelections(select, connectionFieldsMap, operationName)
213
+ : [t.field({ name: 'id' })];
214
+ const variableDefinitions = [];
215
+ const queryArgs = [];
216
+ const variables = {};
217
+ addVariable({
218
+ varName: 'where',
219
+ typeName: filterTypeName,
220
+ value: args.where,
221
+ }, variableDefinitions, queryArgs, variables);
222
+ addVariable({
223
+ varName: 'orderBy',
224
+ typeName: '[' + orderByTypeName + '!]',
225
+ value: args.orderBy?.length ? args.orderBy : undefined,
226
+ }, variableDefinitions, queryArgs, variables);
227
+ addVariable({ varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, variables);
228
+ addVariable({ varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, variables);
229
+ addVariable({ varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, variables);
230
+ addVariable({ varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, variables);
231
+ addVariable({ varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, variables);
232
+ const document = t.document({
233
+ definitions: [
234
+ t.operationDefinition({
235
+ operation: OP_QUERY,
236
+ name: operationName + 'Query',
237
+ variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined,
238
+ selectionSet: t.selectionSet({
239
+ selections: [
240
+ t.field({
241
+ name: queryField,
242
+ args: queryArgs.length ? queryArgs : undefined,
243
+ selectionSet: t.selectionSet({
244
+ selections: buildConnectionSelections(selections),
245
+ }),
246
+ }),
247
+ ],
248
+ }),
249
+ }),
250
+ ],
251
+ });
252
+ return { document: (0, runtime_1.print)(document), variables };
253
+ }
254
+ function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) {
255
+ const selections = select
256
+ ? buildSelections(select, connectionFieldsMap, operationName)
257
+ : [t.field({ name: 'id' })];
258
+ const variableDefinitions = [];
259
+ const queryArgs = [];
260
+ const variables = {};
261
+ // Always add first: 1 for findFirst
262
+ addVariable({ varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, variables);
263
+ addVariable({
264
+ varName: 'where',
265
+ typeName: filterTypeName,
266
+ value: args.where,
267
+ }, variableDefinitions, queryArgs, variables);
268
+ addVariable({
269
+ varName: 'orderBy',
270
+ typeName: '[' + orderByTypeName + '!]',
271
+ value: args.orderBy?.length ? args.orderBy : undefined,
272
+ }, variableDefinitions, queryArgs, variables);
273
+ const document = t.document({
274
+ definitions: [
275
+ t.operationDefinition({
276
+ operation: OP_QUERY,
277
+ name: operationName + 'Query',
278
+ variableDefinitions,
279
+ selectionSet: t.selectionSet({
280
+ selections: [
281
+ t.field({
282
+ name: queryField,
283
+ args: queryArgs,
284
+ selectionSet: t.selectionSet({
285
+ selections: [
286
+ t.field({
287
+ name: 'nodes',
288
+ selectionSet: t.selectionSet({ selections }),
289
+ }),
290
+ ],
291
+ }),
292
+ }),
293
+ ],
294
+ }),
295
+ }),
296
+ ],
297
+ });
298
+ return { document: (0, runtime_1.print)(document), variables };
299
+ }
300
+ function buildCreateDocument(operationName, mutationField, entityField, select, data, inputTypeName, connectionFieldsMap) {
301
+ const selections = select
302
+ ? buildSelections(select, connectionFieldsMap, operationName)
303
+ : [t.field({ name: 'id' })];
304
+ return {
305
+ document: buildInputMutationDocument({
306
+ operationName,
307
+ mutationField,
308
+ inputTypeName,
309
+ resultSelections: [
310
+ t.field({
311
+ name: entityField,
312
+ selectionSet: t.selectionSet({ selections }),
313
+ }),
314
+ ],
315
+ }),
316
+ variables: {
317
+ input: {
318
+ [entityField]: data,
319
+ },
320
+ },
321
+ };
322
+ }
323
+ function buildUpdateDocument(operationName, mutationField, entityField, select, where, data, inputTypeName, patchFieldName, connectionFieldsMap) {
324
+ const selections = select
325
+ ? buildSelections(select, connectionFieldsMap, operationName)
326
+ : [t.field({ name: 'id' })];
327
+ return {
328
+ document: buildInputMutationDocument({
329
+ operationName,
330
+ mutationField,
331
+ inputTypeName,
332
+ resultSelections: [
333
+ t.field({
334
+ name: entityField,
335
+ selectionSet: t.selectionSet({ selections }),
336
+ }),
337
+ ],
338
+ }),
339
+ variables: {
340
+ input: {
341
+ id: where.id,
342
+ [patchFieldName]: data,
343
+ },
344
+ },
345
+ };
346
+ }
347
+ function buildUpdateByPkDocument(operationName, mutationField, entityField, select, id, data, inputTypeName, idFieldName, patchFieldName, connectionFieldsMap, extraKeys) {
348
+ const selections = select
349
+ ? buildSelections(select, connectionFieldsMap, operationName)
350
+ : [t.field({ name: 'id' })];
351
+ return {
352
+ document: buildInputMutationDocument({
353
+ operationName,
354
+ mutationField,
355
+ inputTypeName,
356
+ resultSelections: [
357
+ t.field({
358
+ name: entityField,
359
+ selectionSet: t.selectionSet({ selections }),
360
+ }),
361
+ ],
362
+ }),
363
+ variables: {
364
+ input: {
365
+ [idFieldName]: id,
366
+ ...extraKeys,
367
+ [patchFieldName]: data,
368
+ },
369
+ },
370
+ };
371
+ }
372
+ function buildFindOneDocument(operationName, queryField, id, select, idArgName, idTypeName, connectionFieldsMap) {
373
+ const selections = select
374
+ ? buildSelections(select, connectionFieldsMap, operationName)
375
+ : [t.field({ name: 'id' })];
376
+ const variableDefinitions = [
377
+ t.variableDefinition({
378
+ variable: t.variable({ name: idArgName }),
379
+ type: (0, runtime_1.parseType)(idTypeName),
380
+ }),
381
+ ];
382
+ const queryArgs = [
383
+ t.argument({
384
+ name: idArgName,
385
+ value: t.variable({ name: idArgName }),
386
+ }),
387
+ ];
388
+ const document = t.document({
389
+ definitions: [
390
+ t.operationDefinition({
391
+ operation: OP_QUERY,
392
+ name: operationName + 'Query',
393
+ variableDefinitions,
394
+ selectionSet: t.selectionSet({
395
+ selections: [
396
+ t.field({
397
+ name: queryField,
398
+ args: queryArgs,
399
+ selectionSet: t.selectionSet({ selections }),
400
+ }),
401
+ ],
402
+ }),
403
+ }),
404
+ ],
405
+ });
406
+ return {
407
+ document: (0, runtime_1.print)(document),
408
+ variables: { [idArgName]: id },
409
+ };
410
+ }
411
+ function buildDeleteDocument(operationName, mutationField, entityField, where, inputTypeName, select, connectionFieldsMap) {
412
+ const entitySelections = select
413
+ ? buildSelections(select, connectionFieldsMap, operationName)
414
+ : [t.field({ name: 'id' })];
415
+ return {
416
+ document: buildInputMutationDocument({
417
+ operationName,
418
+ mutationField,
419
+ inputTypeName,
420
+ resultSelections: [
421
+ t.field({
422
+ name: entityField,
423
+ selectionSet: t.selectionSet({
424
+ selections: entitySelections,
425
+ }),
426
+ }),
427
+ ],
428
+ }),
429
+ variables: {
430
+ input: {
431
+ id: where.id,
432
+ },
433
+ },
434
+ };
435
+ }
436
+ function buildDeleteByPkDocument(operationName, mutationField, entityField, keys, inputTypeName, select, connectionFieldsMap) {
437
+ const entitySelections = select
438
+ ? buildSelections(select, connectionFieldsMap, operationName)
439
+ : [t.field({ name: 'id' })];
440
+ return {
441
+ document: buildInputMutationDocument({
442
+ operationName,
443
+ mutationField,
444
+ inputTypeName,
445
+ resultSelections: [
446
+ t.field({
447
+ name: entityField,
448
+ selectionSet: t.selectionSet({ selections: entitySelections }),
449
+ }),
450
+ ],
451
+ }),
452
+ variables: {
453
+ input: keys,
454
+ },
455
+ };
456
+ }
457
+ function buildJunctionRemoveDocument(operationName, mutationField, keys, inputTypeName) {
458
+ return {
459
+ document: buildInputMutationDocument({
460
+ operationName,
461
+ mutationField,
462
+ inputTypeName,
463
+ resultSelections: [t.field({ name: 'clientMutationId' })],
464
+ }),
465
+ variables: {
466
+ input: keys,
467
+ },
468
+ };
469
+ }
470
+ function buildCustomDocument(operationType, operationName, fieldName, select, args, variableDefinitions, connectionFieldsMap, entityType) {
471
+ let actualSelect = select;
472
+ let isConnection = false;
473
+ if (isCustomSelectionWrapper(select)) {
474
+ actualSelect = select.select;
475
+ isConnection = select.connection === true;
476
+ }
477
+ const selections = actualSelect
478
+ ? buildSelections(actualSelect, connectionFieldsMap, entityType)
479
+ : [];
480
+ const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({
481
+ variable: t.variable({ name: definition.name }),
482
+ type: (0, runtime_1.parseType)(definition.type),
483
+ }));
484
+ const fieldArgs = variableDefinitions.map((definition) => t.argument({
485
+ name: definition.name,
486
+ value: t.variable({ name: definition.name }),
487
+ }));
488
+ const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections;
489
+ const document = t.document({
490
+ definitions: [
491
+ t.operationDefinition({
492
+ operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY,
493
+ name: operationName,
494
+ variableDefinitions: variableDefs.length ? variableDefs : undefined,
495
+ selectionSet: t.selectionSet({
496
+ selections: [
497
+ t.field({
498
+ name: fieldName,
499
+ args: fieldArgs.length ? fieldArgs : undefined,
500
+ selectionSet: fieldSelections.length
501
+ ? t.selectionSet({ selections: fieldSelections })
502
+ : undefined,
503
+ }),
504
+ ],
505
+ }),
506
+ }),
507
+ ],
508
+ });
509
+ return {
510
+ document: (0, runtime_1.print)(document),
511
+ variables: (args ?? {}),
512
+ };
513
+ }
514
+ function isCustomSelectionWrapper(value) {
515
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
516
+ return false;
517
+ }
518
+ const record = value;
519
+ const keys = Object.keys(record);
520
+ if (!keys.includes('select') || !keys.includes('connection')) {
521
+ return false;
522
+ }
523
+ if (keys.some((key) => key !== 'select' && key !== 'connection')) {
524
+ return false;
525
+ }
526
+ return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select);
527
+ }
528
+ // ============================================================================
529
+ // Helper Functions
530
+ // ============================================================================
531
+ function buildArgs(args) {
532
+ return args.filter((arg) => arg !== null);
533
+ }
534
+ function buildOptionalArg(name, value) {
535
+ if (value === undefined) {
536
+ return null;
537
+ }
538
+ const valueNode = typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value });
539
+ return t.argument({ name, value: valueNode });
540
+ }
541
+ function buildEnumListArg(name, values) {
542
+ if (!values || values.length === 0) {
543
+ return null;
544
+ }
545
+ return t.argument({
546
+ name,
547
+ value: t.listValue({
548
+ values: values.map((value) => buildEnumValue(value)),
549
+ }),
550
+ });
551
+ }
552
+ function buildEnumValue(value) {
553
+ return {
554
+ kind: ENUM_VALUE_KIND,
555
+ value,
556
+ };
557
+ }
558
+ function buildPageInfoSelections() {
559
+ return [
560
+ t.field({ name: 'hasNextPage' }),
561
+ t.field({ name: 'hasPreviousPage' }),
562
+ t.field({ name: 'startCursor' }),
563
+ t.field({ name: 'endCursor' }),
564
+ ];
565
+ }
566
+ function buildConnectionSelections(nodeSelections) {
567
+ return [
568
+ t.field({
569
+ name: 'nodes',
570
+ selectionSet: t.selectionSet({ selections: nodeSelections }),
571
+ }),
572
+ t.field({ name: 'totalCount' }),
573
+ t.field({
574
+ name: 'pageInfo',
575
+ selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }),
576
+ }),
577
+ ];
578
+ }
579
+ function buildInputMutationDocument(config) {
580
+ const document = t.document({
581
+ definitions: [
582
+ t.operationDefinition({
583
+ operation: OP_MUTATION,
584
+ name: config.operationName + 'Mutation',
585
+ variableDefinitions: [
586
+ t.variableDefinition({
587
+ variable: t.variable({ name: 'input' }),
588
+ type: (0, runtime_1.parseType)(config.inputTypeName + '!'),
589
+ }),
590
+ ],
591
+ selectionSet: t.selectionSet({
592
+ selections: [
593
+ t.field({
594
+ name: config.mutationField,
595
+ args: [
596
+ t.argument({
597
+ name: 'input',
598
+ value: t.variable({ name: 'input' }),
599
+ }),
600
+ ],
601
+ selectionSet: t.selectionSet({
602
+ selections: config.resultSelections,
603
+ }),
604
+ }),
605
+ ],
606
+ }),
607
+ }),
608
+ ],
609
+ });
610
+ return (0, runtime_1.print)(document);
611
+ }
612
+ function addVariable(spec, definitions, args, variables) {
613
+ if (spec.value === undefined || !spec.typeName)
614
+ return;
615
+ definitions.push(t.variableDefinition({
616
+ variable: t.variable({ name: spec.varName }),
617
+ type: (0, runtime_1.parseType)(spec.typeName),
618
+ }));
619
+ args.push(t.argument({
620
+ name: spec.argName ?? spec.varName,
621
+ value: t.variable({ name: spec.varName }),
622
+ }));
623
+ variables[spec.varName] = spec.value;
624
+ }
625
+ function buildValueAst(value) {
626
+ if (value === null) {
627
+ return t.nullValue();
628
+ }
629
+ if (typeof value === 'boolean') {
630
+ return t.booleanValue({ value });
631
+ }
632
+ if (typeof value === 'number') {
633
+ return Number.isInteger(value)
634
+ ? t.intValue({ value: value.toString() })
635
+ : t.floatValue({ value: value.toString() });
636
+ }
637
+ if (typeof value === 'string') {
638
+ return t.stringValue({ value });
639
+ }
640
+ if (Array.isArray(value)) {
641
+ return t.listValue({
642
+ values: value.map((item) => buildValueAst(item)),
643
+ });
644
+ }
645
+ if (typeof value === 'object' && value !== null) {
646
+ const obj = value;
647
+ return t.objectValue({
648
+ fields: Object.entries(obj).map(([key, val]) => t.objectField({
649
+ name: key,
650
+ value: buildValueAst(val),
651
+ })),
652
+ });
653
+ }
654
+ throw new Error('Unsupported value type: ' + typeof value);
655
+ }
656
+ // ============================================================================
657
+ // Bulk Mutation Document Builders
658
+ // ============================================================================
659
+ function buildBulkInsertDocument(operationName, mutationField, select, data, inputTypeName, onConflict, connectionFieldsMap) {
660
+ const selections = select
661
+ ? buildSelections(select, connectionFieldsMap, operationName)
662
+ : [t.field({ name: 'id' })];
663
+ return {
664
+ document: buildInputMutationDocument({
665
+ operationName,
666
+ mutationField,
667
+ inputTypeName,
668
+ resultSelections: [
669
+ t.field({ name: 'affectedCount' }),
670
+ t.field({
671
+ name: 'returning',
672
+ selectionSet: t.selectionSet({ selections }),
673
+ }),
674
+ ],
675
+ }),
676
+ variables: {
677
+ input: {
678
+ values: data,
679
+ ...(onConflict ? { onConflict } : {}),
680
+ },
681
+ },
682
+ };
683
+ }
684
+ function buildBulkUpsertDocument(operationName, mutationField, select, data, inputTypeName, onConflict, connectionFieldsMap) {
685
+ const selections = select
686
+ ? buildSelections(select, connectionFieldsMap, operationName)
687
+ : [t.field({ name: 'id' })];
688
+ return {
689
+ document: buildInputMutationDocument({
690
+ operationName,
691
+ mutationField,
692
+ inputTypeName,
693
+ resultSelections: [
694
+ t.field({ name: 'affectedCount' }),
695
+ t.field({
696
+ name: 'returning',
697
+ selectionSet: t.selectionSet({ selections }),
698
+ }),
699
+ ],
700
+ }),
701
+ variables: {
702
+ input: {
703
+ values: data,
704
+ onConflict,
705
+ },
706
+ },
707
+ };
708
+ }
709
+ function buildBulkUpdateDocument(operationName, mutationField, select, where, data, inputTypeName, connectionFieldsMap) {
710
+ const selections = select
711
+ ? buildSelections(select, connectionFieldsMap, operationName)
712
+ : [t.field({ name: 'id' })];
713
+ return {
714
+ document: buildInputMutationDocument({
715
+ operationName,
716
+ mutationField,
717
+ inputTypeName,
718
+ resultSelections: [
719
+ t.field({ name: 'affectedCount' }),
720
+ t.field({
721
+ name: 'returning',
722
+ selectionSet: t.selectionSet({ selections }),
723
+ }),
724
+ ],
725
+ }),
726
+ variables: {
727
+ input: {
728
+ where,
729
+ patch: data,
730
+ },
731
+ },
732
+ };
733
+ }
734
+ function buildBulkDeleteDocument(operationName, mutationField, select, where, inputTypeName, connectionFieldsMap) {
735
+ const selections = select
736
+ ? buildSelections(select, connectionFieldsMap, operationName)
737
+ : [t.field({ name: 'id' })];
738
+ return {
739
+ document: buildInputMutationDocument({
740
+ operationName,
741
+ mutationField,
742
+ inputTypeName,
743
+ resultSelections: [
744
+ t.field({ name: 'affectedCount' }),
745
+ t.field({
746
+ name: 'returning',
747
+ selectionSet: t.selectionSet({ selections }),
748
+ }),
749
+ ],
750
+ }),
751
+ variables: {
752
+ input: {
753
+ where,
754
+ },
755
+ },
756
+ };
757
+ }