@cyberskill/shared 2.28.0 → 3.1.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 (363) hide show
  1. package/dist/config/commitlint/index.js +1 -0
  2. package/dist/config/commitlint/index.js.map +1 -0
  3. package/dist/config/config.test.unit.d.ts +1 -0
  4. package/dist/config/config.type.js +1 -0
  5. package/dist/config/config.type.js.map +1 -0
  6. package/dist/config/config.type.test.unit.d.ts +1 -0
  7. package/dist/config/config.util.js +25 -33
  8. package/dist/config/config.util.js.map +1 -0
  9. package/dist/config/env/env.constant.js +1 -0
  10. package/dist/config/env/env.constant.js.map +1 -0
  11. package/dist/config/env/env.util.js +1 -0
  12. package/dist/config/env/env.util.js.map +1 -0
  13. package/dist/config/env/index.js +1 -0
  14. package/dist/config/env/index.js.map +1 -0
  15. package/dist/config/eslint/index.d.ts +4 -0
  16. package/dist/config/eslint/index.js +5 -12
  17. package/dist/config/eslint/index.js.map +1 -0
  18. package/dist/config/graphql-codegen/graphql-codegen.util.js +29 -33
  19. package/dist/config/graphql-codegen/graphql-codegen.util.js.map +1 -0
  20. package/dist/config/graphql-codegen/index.js +1 -0
  21. package/dist/config/graphql-codegen/index.js.map +1 -0
  22. package/dist/config/index.js +1 -0
  23. package/dist/config/index.js.map +1 -0
  24. package/dist/config/lint-staged/index.js +1 -0
  25. package/dist/config/lint-staged/index.js.map +1 -0
  26. package/dist/config/storybook/index.js +1 -0
  27. package/dist/config/storybook/index.js.map +1 -0
  28. package/dist/config/storybook/storybook.main.js +1 -0
  29. package/dist/config/storybook/storybook.main.js.map +1 -0
  30. package/dist/config/storybook/storybook.preview.js +11 -13
  31. package/dist/config/storybook/storybook.preview.js.map +1 -0
  32. package/dist/config/vitest/index.js +1 -0
  33. package/dist/config/vitest/index.js.map +1 -0
  34. package/dist/config/vitest/vitest.e2e.js +2 -1
  35. package/dist/config/vitest/vitest.e2e.js.map +1 -0
  36. package/dist/config/vitest/vitest.unit.js +20 -8
  37. package/dist/config/vitest/vitest.unit.js.map +1 -0
  38. package/dist/constant/common.js +2 -1
  39. package/dist/constant/common.js.map +1 -0
  40. package/dist/constant/constant.test.unit.d.ts +1 -0
  41. package/dist/constant/index.js +1 -0
  42. package/dist/constant/index.js.map +1 -0
  43. package/dist/constant/response-status.js +1 -0
  44. package/dist/constant/response-status.js.map +1 -0
  45. package/dist/node/apollo-server/apollo-server.util.js +22 -48
  46. package/dist/node/apollo-server/apollo-server.util.js.map +1 -0
  47. package/dist/node/apollo-server/index.js +1 -0
  48. package/dist/node/apollo-server/index.js.map +1 -0
  49. package/dist/node/cli/index.js +110 -165
  50. package/dist/node/cli/index.js.map +1 -0
  51. package/dist/node/command/command.test.unit.d.ts +1 -0
  52. package/dist/node/command/command.type.js +1 -0
  53. package/dist/node/command/command.type.js.map +1 -0
  54. package/dist/node/command/command.util.js +142 -169
  55. package/dist/node/command/command.util.js.map +1 -0
  56. package/dist/node/command/index.js +1 -0
  57. package/dist/node/command/index.js.map +1 -0
  58. package/dist/node/express/express.type.d.ts +4 -0
  59. package/dist/node/express/express.util.js +56 -71
  60. package/dist/node/express/express.util.js.map +1 -0
  61. package/dist/node/express/index.js +1 -0
  62. package/dist/node/express/index.js.map +1 -0
  63. package/dist/node/fs/fs.test.unit.d.ts +1 -0
  64. package/dist/node/fs/fs.util.js +46 -60
  65. package/dist/node/fs/fs.util.js.map +1 -0
  66. package/dist/node/fs/index.js +1 -0
  67. package/dist/node/fs/index.js.map +1 -0
  68. package/dist/node/log/index.js +1 -0
  69. package/dist/node/log/index.js.map +1 -0
  70. package/dist/node/log/log.test.unit.d.ts +1 -0
  71. package/dist/node/log/log.type.js +1 -0
  72. package/dist/node/log/log.type.js.map +1 -0
  73. package/dist/node/log/log.util.js +30 -30
  74. package/dist/node/log/log.util.js.map +1 -0
  75. package/dist/node/mongo/index.d.ts +2 -0
  76. package/dist/node/mongo/index.js +21 -12
  77. package/dist/node/mongo/index.js.map +1 -0
  78. package/dist/node/mongo/mongo.constant.js +1 -0
  79. package/dist/node/mongo/mongo.constant.js.map +1 -0
  80. package/dist/node/mongo/mongo.controller.d.ts +5 -315
  81. package/dist/node/mongo/mongo.controller.mongoose.d.ts +234 -0
  82. package/dist/node/mongo/mongo.controller.mongoose.js +468 -0
  83. package/dist/node/mongo/mongo.controller.mongoose.js.map +1 -0
  84. package/dist/node/mongo/mongo.controller.native.d.ts +84 -0
  85. package/dist/node/mongo/mongo.controller.native.js +214 -0
  86. package/dist/node/mongo/mongo.controller.native.js.map +1 -0
  87. package/dist/node/mongo/mongo.dynamic-populate.d.ts +61 -0
  88. package/dist/node/mongo/mongo.dynamic-populate.js +197 -0
  89. package/dist/node/mongo/mongo.dynamic-populate.js.map +1 -0
  90. package/dist/node/mongo/mongo.populate.d.ts +15 -0
  91. package/dist/node/mongo/mongo.populate.js +269 -0
  92. package/dist/node/mongo/mongo.populate.js.map +1 -0
  93. package/dist/node/mongo/mongo.type.js +1 -0
  94. package/dist/node/mongo/mongo.type.js.map +1 -0
  95. package/dist/node/mongo/mongo.util.d.ts +52 -0
  96. package/dist/node/mongo/mongo.util.js +111 -409
  97. package/dist/node/mongo/mongo.util.js.map +1 -0
  98. package/dist/node/package/index.js +1 -0
  99. package/dist/node/package/index.js.map +1 -0
  100. package/dist/node/package/package.test.unit.d.ts +1 -0
  101. package/dist/node/package/package.type.js +1 -0
  102. package/dist/node/package/package.type.js.map +1 -0
  103. package/dist/node/package/package.util.js +197 -226
  104. package/dist/node/package/package.util.js.map +1 -0
  105. package/dist/node/path/index.js +27 -25
  106. package/dist/node/path/index.js.map +1 -0
  107. package/dist/node/path/path.constant.d.ts +2 -0
  108. package/dist/node/path/path.constant.js +131 -150
  109. package/dist/node/path/path.constant.js.map +1 -0
  110. package/dist/node/path/path.util.js +1 -0
  111. package/dist/node/path/path.util.js.map +1 -0
  112. package/dist/node/storage/index.js +1 -0
  113. package/dist/node/storage/index.js.map +1 -0
  114. package/dist/node/storage/storage.constant.js +1 -0
  115. package/dist/node/storage/storage.constant.js.map +1 -0
  116. package/dist/node/storage/storage.util.js +111 -158
  117. package/dist/node/storage/storage.util.js.map +1 -0
  118. package/dist/node/upload/index.js +1 -0
  119. package/dist/node/upload/index.js.map +1 -0
  120. package/dist/node/upload/upload.constant.js +1 -0
  121. package/dist/node/upload/upload.constant.js.map +1 -0
  122. package/dist/node/upload/upload.type.js +1 -0
  123. package/dist/node/upload/upload.type.js.map +1 -0
  124. package/dist/node/upload/upload.util.js +120 -150
  125. package/dist/node/upload/upload.util.js.map +1 -0
  126. package/dist/node/ws/index.d.ts +1 -1
  127. package/dist/node/ws/index.js +2 -1
  128. package/dist/node/ws/index.js.map +1 -0
  129. package/dist/node/ws/ws.util.js +46 -0
  130. package/dist/node/ws/ws.util.js.map +1 -0
  131. package/dist/node_modules/.pnpm/{vitest@4.0.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +1 -0
  132. package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.js.map +1 -0
  133. package/dist/react/apollo-client/apollo-client.component.js +5 -4
  134. package/dist/react/apollo-client/apollo-client.component.js.map +1 -0
  135. package/dist/react/apollo-client/apollo-client.constant.js +1 -0
  136. package/dist/react/apollo-client/apollo-client.constant.js.map +1 -0
  137. package/dist/react/apollo-client/apollo-client.context.js +1 -0
  138. package/dist/react/apollo-client/apollo-client.context.js.map +1 -0
  139. package/dist/react/apollo-client/apollo-client.module.scss.js +1 -0
  140. package/dist/react/apollo-client/apollo-client.module.scss.js.map +1 -0
  141. package/dist/react/apollo-client/apollo-client.util.js +52 -58
  142. package/dist/react/apollo-client/apollo-client.util.js.map +1 -0
  143. package/dist/react/apollo-client/index.js +1 -0
  144. package/dist/react/apollo-client/index.js.map +1 -0
  145. package/dist/react/apollo-client/links/index.js +1 -0
  146. package/dist/react/apollo-client/links/index.js.map +1 -0
  147. package/dist/react/apollo-client/links/upload.js +72 -74
  148. package/dist/react/apollo-client/links/upload.js.map +1 -0
  149. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js +1 -0
  150. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.js.map +1 -0
  151. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +1 -0
  152. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js.map +1 -0
  153. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +12 -18
  154. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js.map +1 -0
  155. package/dist/react/apollo-client-nextjs/index.js +1 -0
  156. package/dist/react/apollo-client-nextjs/index.js.map +1 -0
  157. package/dist/react/apollo-error/apollo-error.component.js +62 -23
  158. package/dist/react/apollo-error/apollo-error.component.js.map +1 -0
  159. package/dist/react/apollo-error/apollo-error.context.js +1 -0
  160. package/dist/react/apollo-error/apollo-error.context.js.map +1 -0
  161. package/dist/react/apollo-error/apollo-error.hook.js +1 -0
  162. package/dist/react/apollo-error/apollo-error.hook.js.map +1 -0
  163. package/dist/react/apollo-error/apollo-error.module.scss.js +7 -6
  164. package/dist/react/apollo-error/apollo-error.module.scss.js.map +1 -0
  165. package/dist/react/apollo-error/apollo-error.provider.js +1 -0
  166. package/dist/react/apollo-error/apollo-error.provider.js.map +1 -0
  167. package/dist/react/apollo-error/apollo-error.test.unit.d.ts +1 -0
  168. package/dist/react/apollo-error/apollo-error.util.js +7 -6
  169. package/dist/react/apollo-error/apollo-error.util.js.map +1 -0
  170. package/dist/react/apollo-error/index.js +1 -0
  171. package/dist/react/apollo-error/index.js.map +1 -0
  172. package/dist/react/i18next/i18next.hook.js +1 -0
  173. package/dist/react/i18next/i18next.hook.js.map +1 -0
  174. package/dist/react/i18next/i18next.util.js +1 -0
  175. package/dist/react/i18next/i18next.util.js.map +1 -0
  176. package/dist/react/i18next/index.js +1 -0
  177. package/dist/react/i18next/index.js.map +1 -0
  178. package/dist/react/loading/index.js +1 -0
  179. package/dist/react/loading/index.js.map +1 -0
  180. package/dist/react/loading/loading.component.js +31 -46
  181. package/dist/react/loading/loading.component.js.map +1 -0
  182. package/dist/react/loading/loading.context.js +1 -0
  183. package/dist/react/loading/loading.context.js.map +1 -0
  184. package/dist/react/loading/loading.hook.js +1 -0
  185. package/dist/react/loading/loading.hook.js.map +1 -0
  186. package/dist/react/loading/loading.module.scss.js +1 -0
  187. package/dist/react/loading/loading.module.scss.js.map +1 -0
  188. package/dist/react/loading/loading.provider.js +1 -0
  189. package/dist/react/loading/loading.provider.js.map +1 -0
  190. package/dist/react/log/index.js +1 -0
  191. package/dist/react/log/index.js.map +1 -0
  192. package/dist/react/log/log.util.js +5 -4
  193. package/dist/react/log/log.util.js.map +1 -0
  194. package/dist/react/next-intl/index.js +1 -0
  195. package/dist/react/next-intl/index.js.map +1 -0
  196. package/dist/react/next-intl/next-intl.constant.js +1 -0
  197. package/dist/react/next-intl/next-intl.constant.js.map +1 -0
  198. package/dist/react/next-intl/next-intl.context.js +1 -0
  199. package/dist/react/next-intl/next-intl.context.js.map +1 -0
  200. package/dist/react/next-intl/next-intl.hoc.js +14 -22
  201. package/dist/react/next-intl/next-intl.hoc.js.map +1 -0
  202. package/dist/react/next-intl/next-intl.hook.js +1 -0
  203. package/dist/react/next-intl/next-intl.hook.js.map +1 -0
  204. package/dist/react/next-intl/next-intl.provider.js +8 -7
  205. package/dist/react/next-intl/next-intl.provider.js.map +1 -0
  206. package/dist/react/storage/index.js +1 -0
  207. package/dist/react/storage/index.js.map +1 -0
  208. package/dist/react/storage/storage.hook.js +44 -59
  209. package/dist/react/storage/storage.hook.js.map +1 -0
  210. package/dist/react/storage/storage.test.unit.d.ts +1 -0
  211. package/dist/react/storage/storage.util.js +29 -53
  212. package/dist/react/storage/storage.util.js.map +1 -0
  213. package/dist/react/toast/index.js +1 -0
  214. package/dist/react/toast/index.js.map +1 -0
  215. package/dist/react/userback/index.js +1 -0
  216. package/dist/react/userback/index.js.map +1 -0
  217. package/dist/react/userback/userback.component.js +19 -42
  218. package/dist/react/userback/userback.component.js.map +1 -0
  219. package/dist/style.css +1 -1
  220. package/dist/typescript/common.type.js +1 -0
  221. package/dist/typescript/common.type.js.map +1 -0
  222. package/dist/typescript/index.js +1 -0
  223. package/dist/typescript/index.js.map +1 -0
  224. package/dist/typescript/typescript.test.unit.d.ts +1 -0
  225. package/dist/util/common/common.util.d.ts +2 -0
  226. package/dist/util/common/common.util.js +30 -37
  227. package/dist/util/common/common.util.js.map +1 -0
  228. package/dist/util/common/index.js +1 -0
  229. package/dist/util/common/index.js.map +1 -0
  230. package/dist/util/index.js +11 -9
  231. package/dist/util/index.js.map +1 -0
  232. package/dist/util/object/index.js +1 -0
  233. package/dist/util/object/index.js.map +1 -0
  234. package/dist/util/object/object.util.js +73 -76
  235. package/dist/util/object/object.util.js.map +1 -0
  236. package/dist/util/serializer/index.js +1 -0
  237. package/dist/util/serializer/index.js.map +1 -0
  238. package/dist/util/serializer/serializer.util.js +1 -0
  239. package/dist/util/serializer/serializer.util.js.map +1 -0
  240. package/dist/util/string/index.js +5 -3
  241. package/dist/util/string/index.js.map +1 -0
  242. package/dist/util/string/string.util.d.ts +12 -0
  243. package/dist/util/string/string.util.js +64 -44
  244. package/dist/util/string/string.util.js.map +1 -0
  245. package/dist/util/validate/index.js +1 -0
  246. package/dist/util/validate/index.js.map +1 -0
  247. package/dist/util/validate/validate.util.js +1 -0
  248. package/dist/util/validate/validate.util.js.map +1 -0
  249. package/package.json +76 -96
  250. package/public/tsconfig.base.json +7 -3
  251. package/README.md +0 -470
  252. package/dist/config/commitlint/index.cjs +0 -1
  253. package/dist/config/config.type.cjs +0 -1
  254. package/dist/config/config.util.cjs +0 -1
  255. package/dist/config/env/env.constant.cjs +0 -1
  256. package/dist/config/env/env.util.cjs +0 -1
  257. package/dist/config/env/index.cjs +0 -1
  258. package/dist/config/eslint/index.cjs +0 -1
  259. package/dist/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
  260. package/dist/config/graphql-codegen/index.cjs +0 -1
  261. package/dist/config/index.cjs +0 -1
  262. package/dist/config/lint-staged/index.cjs +0 -1
  263. package/dist/config/storybook/index.cjs +0 -1
  264. package/dist/config/storybook/storybook.main.cjs +0 -1
  265. package/dist/config/storybook/storybook.preview.cjs +0 -1
  266. package/dist/config/vitest/index.cjs +0 -1
  267. package/dist/config/vitest/vitest.e2e.cjs +0 -1
  268. package/dist/config/vitest/vitest.unit.cjs +0 -1
  269. package/dist/constant/common.cjs +0 -1
  270. package/dist/constant/index.cjs +0 -1
  271. package/dist/constant/response-status.cjs +0 -1
  272. package/dist/node/apollo-server/apollo-server.util.cjs +0 -1
  273. package/dist/node/apollo-server/index.cjs +0 -1
  274. package/dist/node/cli/index.cjs +0 -3
  275. package/dist/node/command/command.type.cjs +0 -1
  276. package/dist/node/command/command.util.cjs +0 -2
  277. package/dist/node/command/index.cjs +0 -1
  278. package/dist/node/express/express.util.cjs +0 -1
  279. package/dist/node/express/index.cjs +0 -1
  280. package/dist/node/fs/fs.util.cjs +0 -4
  281. package/dist/node/fs/index.cjs +0 -1
  282. package/dist/node/log/index.cjs +0 -1
  283. package/dist/node/log/log.type.cjs +0 -1
  284. package/dist/node/log/log.util.cjs +0 -1
  285. package/dist/node/mongo/index.cjs +0 -1
  286. package/dist/node/mongo/mongo.constant.cjs +0 -1
  287. package/dist/node/mongo/mongo.controller.cjs +0 -1
  288. package/dist/node/mongo/mongo.controller.js +0 -956
  289. package/dist/node/mongo/mongo.type.cjs +0 -1
  290. package/dist/node/mongo/mongo.util.cjs +0 -2
  291. package/dist/node/package/index.cjs +0 -1
  292. package/dist/node/package/package.type.cjs +0 -1
  293. package/dist/node/package/package.util.cjs +0 -1
  294. package/dist/node/path/index.cjs +0 -1
  295. package/dist/node/path/path.constant.cjs +0 -1
  296. package/dist/node/path/path.util.cjs +0 -1
  297. package/dist/node/storage/index.cjs +0 -1
  298. package/dist/node/storage/storage.constant.cjs +0 -1
  299. package/dist/node/storage/storage.util.cjs +0 -1
  300. package/dist/node/upload/index.cjs +0 -1
  301. package/dist/node/upload/upload.constant.cjs +0 -1
  302. package/dist/node/upload/upload.type.cjs +0 -1
  303. package/dist/node/upload/upload.util.cjs +0 -1
  304. package/dist/node/ws/index.cjs +0 -1
  305. package/dist/node/ws/ts.util.cjs +0 -1
  306. package/dist/node/ws/ts.util.js +0 -68
  307. package/dist/node_modules/.pnpm/vitest@4.0.18_@types_node@25.3.0_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2/node_modules/vitest/dist/config.cjs +0 -1
  308. package/dist/react/apollo-client/apollo-client.component.cjs +0 -1
  309. package/dist/react/apollo-client/apollo-client.constant.cjs +0 -1
  310. package/dist/react/apollo-client/apollo-client.context.cjs +0 -1
  311. package/dist/react/apollo-client/apollo-client.module.scss.cjs +0 -1
  312. package/dist/react/apollo-client/apollo-client.util.cjs +0 -1
  313. package/dist/react/apollo-client/index.cjs +0 -1
  314. package/dist/react/apollo-client/links/index.cjs +0 -1
  315. package/dist/react/apollo-client/links/upload.cjs +0 -1
  316. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
  317. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
  318. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
  319. package/dist/react/apollo-client-nextjs/index.cjs +0 -1
  320. package/dist/react/apollo-error/apollo-error.component.cjs +0 -1
  321. package/dist/react/apollo-error/apollo-error.context.cjs +0 -1
  322. package/dist/react/apollo-error/apollo-error.hook.cjs +0 -1
  323. package/dist/react/apollo-error/apollo-error.module.scss.cjs +0 -1
  324. package/dist/react/apollo-error/apollo-error.provider.cjs +0 -1
  325. package/dist/react/apollo-error/apollo-error.util.cjs +0 -1
  326. package/dist/react/apollo-error/index.cjs +0 -1
  327. package/dist/react/i18next/i18next.hook.cjs +0 -1
  328. package/dist/react/i18next/i18next.util.cjs +0 -1
  329. package/dist/react/i18next/index.cjs +0 -1
  330. package/dist/react/loading/index.cjs +0 -1
  331. package/dist/react/loading/loading.component.cjs +0 -6
  332. package/dist/react/loading/loading.context.cjs +0 -1
  333. package/dist/react/loading/loading.hook.cjs +0 -1
  334. package/dist/react/loading/loading.module.scss.cjs +0 -1
  335. package/dist/react/loading/loading.provider.cjs +0 -1
  336. package/dist/react/log/index.cjs +0 -1
  337. package/dist/react/log/log.util.cjs +0 -1
  338. package/dist/react/next-intl/index.cjs +0 -1
  339. package/dist/react/next-intl/next-intl.constant.cjs +0 -1
  340. package/dist/react/next-intl/next-intl.context.cjs +0 -1
  341. package/dist/react/next-intl/next-intl.hoc.cjs +0 -1
  342. package/dist/react/next-intl/next-intl.hook.cjs +0 -1
  343. package/dist/react/next-intl/next-intl.provider.cjs +0 -1
  344. package/dist/react/storage/index.cjs +0 -1
  345. package/dist/react/storage/storage.hook.cjs +0 -1
  346. package/dist/react/storage/storage.util.cjs +0 -1
  347. package/dist/react/toast/index.cjs +0 -1
  348. package/dist/react/userback/index.cjs +0 -1
  349. package/dist/react/userback/userback.component.cjs +0 -1
  350. package/dist/typescript/common.type.cjs +0 -1
  351. package/dist/typescript/index.cjs +0 -1
  352. package/dist/util/common/common.util.cjs +0 -1
  353. package/dist/util/common/index.cjs +0 -1
  354. package/dist/util/index.cjs +0 -1
  355. package/dist/util/object/index.cjs +0 -1
  356. package/dist/util/object/object.util.cjs +0 -1
  357. package/dist/util/serializer/index.cjs +0 -1
  358. package/dist/util/serializer/serializer.util.cjs +0 -1
  359. package/dist/util/string/index.cjs +0 -1
  360. package/dist/util/string/string.util.cjs +0 -1
  361. package/dist/util/validate/index.cjs +0 -1
  362. package/dist/util/validate/validate.util.cjs +0 -1
  363. /package/dist/node/ws/{ts.util.d.ts → ws.util.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-client.util.js","sources":["../../../src/react/apollo-client/apollo-client.util.tsx"],"sourcesContent":["import { ApolloClient, CombinedGraphQLErrors, CombinedProtocolErrors, InMemoryCache, ServerError } from '@apollo/client/core';\nimport { ApolloLink } from '@apollo/client/link';\nimport { ErrorLink } from '@apollo/client/link/error';\nimport { RemoveTypenameFromVariablesLink } from '@apollo/client/link/remove-typename';\nimport { GraphQLWsLink } from '@apollo/client/link/subscriptions';\nimport { OperationTypeNode } from 'graphql';\nimport { createClient } from 'graphql-ws';\nimport * as React from 'react';\nimport { tap } from 'rxjs';\n\nimport type { I_ApolloOptions } from './apollo-client.type.js';\n\nimport { hasCustomApolloErrorHandler, showGlobalApolloError } from '../apollo-error/index.js';\nimport { log } from '../log/index.js';\nimport { toast } from '../toast/index.js';\nimport { GRAPHQL_URI_DEFAULT } from './apollo-client.constant.js';\nimport styles from './apollo-client.module.scss';\nimport { createUploadLink } from './links/index.js';\n\nconst roundTripLink = new ApolloLink((operation, forward) => {\n operation.setContext({ start: new Date() });\n\n return forward(operation).pipe(\n tap(() => {\n const time = new Date().getTime() - operation.getContext()['start'];\n\n log.info(`Operation ${operation.operationName} took ${time}ms to complete`);\n }),\n );\n});\n\nconst errorLink = new ErrorLink(({ error, operation }) => {\n const opName = operation?.operationName || 'Unknown';\n let errorMessage = '';\n\n if (CombinedGraphQLErrors.is(error)) {\n error.errors.forEach(({ message, locations, path }, index) => {\n if (index === 0) {\n errorMessage = message;\n }\n\n log.error(\n `[GraphQL error] ${opName}: ${message}, Location: ${JSON.stringify(locations, null, 4)}, Path: ${path}`,\n );\n });\n }\n else if (CombinedProtocolErrors.is(error)) {\n error.errors.forEach(({ message, extensions }, index) => {\n if (index === 0) {\n errorMessage = message;\n }\n\n log.error(\n `[Protocol error]: ${message}, Extensions: ${JSON.stringify(extensions, null, 4)}`,\n );\n });\n }\n else if (ServerError.is(error)) {\n errorMessage = error.message;\n\n log.error(`[Server error]: ${error.message}`);\n }\n else {\n errorMessage = error.message;\n\n log.error(`[Network error]: ${error.message}`);\n }\n\n if (error && errorMessage && typeof window !== 'undefined') {\n if (hasCustomApolloErrorHandler()) {\n showGlobalApolloError(error);\n }\n else {\n toast.error((t: { id: string }) => (\n <div className={styles['error-container']}>\n {errorMessage}\n <button\n type=\"button\"\n className={styles['error-details-button']}\n onClick={() => {\n showGlobalApolloError(error);\n\n toast.dismiss(t.id);\n }}\n >\n Error Details\n </button>\n </div>\n ));\n }\n }\n});\n\n/**\n * Creates a comprehensive Apollo Link chain with all necessary middleware.\n * This function sets up a complete Apollo Link chain including error handling,\n * logging, file uploads, WebSocket subscriptions, and custom links. The chain\n * is configured to handle both HTTP and WebSocket operations with proper routing.\n *\n * The link chain includes:\n * - Development logging for operation tracking\n * - Error handling with user-friendly notifications\n * - Type name removal for cleaner requests\n * - File upload support\n * - WebSocket subscription support\n * - Custom link integration\n *\n * @param options - Configuration options for the Apollo Client including URI, WebSocket URL, and custom links.\n * @returns An array of Apollo Links configured for the specified options.\n */\nexport function createApolloLinks(options: I_ApolloOptions): ApolloLink[] {\n const { uri, wsUrl, customLinks } = options;\n\n const removeTypenameLink = new RemoveTypenameFromVariablesLink();\n\n if (!uri) {\n log.warn(`[Apollo] No GraphQL URI provided — using \"${GRAPHQL_URI_DEFAULT}\" as default`);\n }\n\n const uploadLink = createUploadLink({\n uri: uri ?? GRAPHQL_URI_DEFAULT,\n credentials: 'include',\n headers: {\n 'apollo-require-preflight': 'true',\n },\n });\n\n const wsLink = wsUrl\n ? new GraphQLWsLink(createClient({ url: wsUrl }))\n : ApolloLink.empty();\n\n const splitLink = wsUrl\n ? ApolloLink.split(\n ({ operationType }) => {\n return operationType === OperationTypeNode.SUBSCRIPTION;\n },\n wsLink,\n uploadLink as unknown as ApolloLink,\n )\n : uploadLink;\n\n if (wsUrl && splitLink === uploadLink) {\n log.warn('[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config.');\n }\n\n return [\n roundTripLink,\n errorLink,\n removeTypenameLink,\n ...(customLinks ?? []),\n splitLink as unknown as ApolloLink,\n ];\n}\n\n/**\n * Creates a fully configured Apollo Client instance.\n * This function creates an Apollo Client with all necessary configuration including\n * the link chain, cache, and any additional options provided. The client is ready\n * for immediate use in React applications with comprehensive error handling and\n * development tooling.\n *\n * @param options - Configuration options for the Apollo Client including links, cache, and other settings.\n * @returns A fully configured Apollo Client instance ready for use.\n */\nexport function getClient(options: I_ApolloOptions) {\n const link = ApolloLink.from(createApolloLinks(options));\n\n return new ApolloClient({\n link,\n cache: new InMemoryCache(),\n ...options,\n });\n}\n"],"names":["roundTripLink","ApolloLink","operation","forward","tap","time","log","errorLink","ErrorLink","error","opName","errorMessage","CombinedGraphQLErrors","message","locations","path","index","CombinedProtocolErrors","extensions","ServerError","hasCustomApolloErrorHandler","showGlobalApolloError","toast","t","React","styles","createApolloLinks","options","uri","wsUrl","customLinks","removeTypenameLink","RemoveTypenameFromVariablesLink","GRAPHQL_URI_DEFAULT","uploadLink","createUploadLink","wsLink","GraphQLWsLink","createClient","splitLink","operationType","OperationTypeNode","getClient","link","ApolloClient","InMemoryCache"],"mappings":"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"}
@@ -28,3 +28,4 @@ export {
28
28
  F as useSuspenseFragment,
29
29
  P as useSuspenseQuery
30
30
  };
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -2,3 +2,4 @@ import { createUploadLink as r } from "./upload.js";
2
2
  export {
3
3
  r as createUploadLink
4
4
  };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,88 +1,85 @@
1
1
  import { ApolloLink as q } from "@apollo/client/link";
2
- import { selectHttpOptionsAndBodyInternal as G, defaultPrinter as H, fallbackHttpConfig as J, selectURI as L, rewriteURIForGET as N, parseAndCheckHttpResponse as T } from "@apollo/client/link/http";
3
- import { Observable as O } from "@apollo/client/utilities";
4
- import j from "extract-files/extractFiles.mjs";
2
+ import { selectHttpOptionsAndBodyInternal as G, defaultPrinter as H, fallbackHttpConfig as J, selectURI as L, rewriteURIForGET as T, parseAndCheckHttpResponse as N } from "@apollo/client/link/http";
3
+ import { Observable as y } from "@apollo/client/utilities";
4
+ import v from "extract-files/extractFiles.mjs";
5
5
  import z from "extract-files/isExtractableFile.mjs";
6
- var B = Object.defineProperty, w = Object.getOwnPropertySymbols, V = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable, _ = (n, t, e) => t in n ? B(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, m = (n, t) => {
7
- for (var e in t || (t = {}))
8
- V.call(t, e) && _(n, e, t[e]);
9
- if (w)
10
- for (var e of w(t))
11
- K.call(t, e) && _(n, e, t[e]);
12
- return n;
13
- };
14
- function M() {
15
- if (typeof AbortController == "undefined")
6
+ function B() {
7
+ if (typeof AbortController > "u")
16
8
  return { controller: !1, signal: !1 };
17
- const n = new AbortController(), t = n.signal;
18
- return { controller: n, signal: t };
9
+ const r = new AbortController(), i = r.signal;
10
+ return { controller: r, signal: i };
19
11
  }
20
- function Q(n, t, e) {
21
- "name" in e ? n.append(t, e, e.name) : n.append(t, e);
12
+ function P(r, i, a) {
13
+ "name" in a ? r.append(i, a, a.name) : r.append(i, a);
22
14
  }
23
- function tt({
24
- uri: n = "/graphql",
25
- useGETForQueries: t,
26
- isExtractableFile: e = z,
27
- FormData: E,
28
- formDataAppendFile: x = Q,
29
- print: F = H,
30
- fetch: v,
15
+ function V({
16
+ uri: r = "/graphql",
17
+ useGETForQueries: i,
18
+ isExtractableFile: a = z,
19
+ FormData: x,
20
+ formDataAppendFile: F = P,
21
+ print: E = H,
22
+ fetch: w,
31
23
  fetchOptions: A,
32
24
  credentials: C,
33
- headers: P,
34
- includeExtensions: S
25
+ headers: O,
26
+ includeExtensions: k
35
27
  } = {}) {
36
- const I = {
37
- http: { includeExtensions: S },
28
+ const S = {
29
+ http: { includeExtensions: k },
38
30
  options: A,
39
31
  credentials: C,
40
- headers: P
32
+ headers: O
41
33
  };
42
34
  return new q((l) => {
43
- const p = l.getContext(), {
35
+ const c = l.getContext(), {
44
36
  // Apollo Studio client awareness `name` and `version` can be configured
45
37
  // via `ApolloClient` constructor options:
46
38
  // https://www.apollographql.com/docs/graphos/metrics/client-awareness/#setup
47
- clientAwareness: { name: u, version: h } = {},
39
+ clientAwareness: { name: m, version: h } = {},
48
40
  headers: D
49
- } = p, R = {
50
- http: p.http,
51
- options: p.fetchOptions,
52
- credentials: p.credentials,
53
- headers: m(m(m({}, u && { "apollographql-client-name": u }), h && { "apollographql-client-version": h }), D)
54
- }, { options: o, body: g } = G(
41
+ } = c, I = {
42
+ http: c.http,
43
+ options: c.fetchOptions,
44
+ credentials: c.credentials,
45
+ headers: {
46
+ // Client awareness headers can be overridden by context `headers`.
47
+ ...m && { "apollographql-client-name": m },
48
+ ...h && { "apollographql-client-version": h },
49
+ ...D
50
+ }
51
+ }, { options: e, body: u } = G(
55
52
  l,
56
- F,
53
+ E,
57
54
  J,
58
- I,
59
- R
60
- ), { clone: y, files: c } = j(g, e, "");
61
- let f = L(l, n);
62
- if (c.size) {
63
- o.headers && delete o.headers["content-type"];
64
- const a = E || FormData, i = new a();
65
- i.append("operations", JSON.stringify(y));
66
- const r = {};
55
+ S,
56
+ I
57
+ ), { clone: g, files: p } = v(u, a, "");
58
+ let f = L(l, r);
59
+ if (p.size) {
60
+ e.headers && delete e.headers["content-type"];
61
+ const n = x || FormData, o = new n();
62
+ o.append("operations", JSON.stringify(g));
63
+ const t = {};
67
64
  let d = 0;
68
- c.forEach((b) => {
69
- r[++d] = b;
70
- }), i.append("map", JSON.stringify(r)), d = 0, c.forEach((b, k) => {
71
- x(i, String(++d), k);
72
- }), o.body = i;
73
- } else if (t && !l.query.definitions.some(
74
- (a) => a.kind === "OperationDefinition" && a.operation === "mutation"
75
- ) && (o.method = "GET"), o.method === "GET") {
76
- const { newURI: a, parseError: i } = N(f, g);
77
- if (i)
78
- return new O((r) => {
79
- r.error(i);
65
+ p.forEach((b) => {
66
+ t[++d] = b;
67
+ }), o.append("map", JSON.stringify(t)), d = 0, p.forEach((b, U) => {
68
+ F(o, String(++d), U);
69
+ }), e.body = o;
70
+ } else if (i && !l.query.definitions.some(
71
+ (n) => n.kind === "OperationDefinition" && n.operation === "mutation"
72
+ ) && (e.method = "GET"), e.method === "GET") {
73
+ const { newURI: n, parseError: o } = T(f, u);
74
+ if (o)
75
+ return new y((t) => {
76
+ t.error(o);
80
77
  });
81
- f = a;
78
+ f = n;
82
79
  } else
83
- o.body = JSON.stringify(y);
84
- const { controller: s } = M();
85
- typeof s != "boolean" && (o.signal && (o.signal.aborted ? s.abort() : o.signal.addEventListener(
80
+ e.body = JSON.stringify(g);
81
+ const { controller: s } = B();
82
+ typeof s != "boolean" && (e.signal && (e.signal.aborted ? s.abort() : e.signal.addEventListener(
86
83
  "abort",
87
84
  () => {
88
85
  s.abort();
@@ -92,20 +89,21 @@ function tt({
92
89
  // is long lasting, or controls multiple things.
93
90
  once: !0
94
91
  }
95
- )), o.signal = s.signal);
96
- const U = v || fetch;
97
- return new O((a) => {
98
- let i;
99
- return U(f, o).then((r) => (l.setContext({ response: r }), r)).then(T(l)).then((r) => {
100
- a.next(r), a.complete();
101
- }).catch((r) => {
102
- i || (r.result && r.result.errors && r.result.data && a.next(r.result), a.error(r));
92
+ )), e.signal = s.signal);
93
+ const R = w || fetch;
94
+ return new y((n) => {
95
+ let o;
96
+ return R(f, e).then((t) => (l.setContext({ response: t }), t)).then(N(l)).then((t) => {
97
+ n.next(t), n.complete();
98
+ }).catch((t) => {
99
+ o || (t.result && t.result.errors && t.result.data && n.next(t.result), n.error(t));
103
100
  }), () => {
104
- i = !0, typeof s != "boolean" && s.abort();
101
+ o = !0, typeof s != "boolean" && s.abort();
105
102
  };
106
103
  });
107
104
  });
108
105
  }
109
106
  export {
110
- tt as createUploadLink
107
+ V as createUploadLink
111
108
  };
109
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.js","sources":["../../../../src/react/apollo-client/links/upload.tsx"],"sourcesContent":["import type { BaseHttpLink } from '@apollo/client/link/http';\nimport type { ExtractableFile } from 'extract-files/isExtractableFile.mjs';\n\nimport { ApolloLink } from '@apollo/client/link';\nimport { defaultPrinter, fallbackHttpConfig, parseAndCheckHttpResponse, rewriteURIForGET, selectHttpOptionsAndBodyInternal, selectURI } from '@apollo/client/link/http';\nimport { Observable } from '@apollo/client/utilities';\nimport extractFiles from 'extract-files/extractFiles.mjs';\nimport isExtractableFile from 'extract-files/isExtractableFile.mjs';\n\n/**\n * Creates a signal if supported.\n * @returns {boolean} Signal if supported.\n */\nfunction createSignalIfSupported() {\n if (typeof AbortController === 'undefined') {\n return { controller: false, signal: false };\n }\n\n const controller = new AbortController();\n const signal = controller.signal;\n\n return { controller, signal };\n}\n\n/**\n * Appends a file to the form data.\n * @param {FormData} formData Form data to append the file to.\n * @param {string} fieldName Field name to append the file to.\n * @param {ExtractableFile} file File to append.\n */\nfunction formDataAppendFile(formData: FormData, fieldName: string, file: ExtractableFile) {\n 'name' in file\n ? formData.append(fieldName, file, file.name)\n : formData.append(fieldName, file);\n}\n\n/**\n * Creates a\n * [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link)\n * for [Apollo Client](https://www.apollographql.com/docs/react) that fetches a\n * [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec)\n * if the GraphQL variables contain files (by default\n * [`FileList`](https://developer.mozilla.org/en-US/docs/Web/API/FileList),\n * [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File), or\n * [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) instances),\n * or else fetches a regular\n * [GraphQL POST or GET request](https://www.apollographql.com/docs/apollo-server/workflow/requests)\n * (depending on the config and GraphQL operation).\n *\n * Some of the options are similar to the\n * [`createHttpLink` options](https://www.apollographql.com/docs/react/api/link/apollo-link-http/#httplink-constructor-options).\n * @see [GraphQL multipart request spec](https://github.com/jaydenseric/graphql-multipart-request-spec).\n * @param {object} options Options.\n * @param {Parameters<typeof selectURI>[1]} [options.uri] GraphQL endpoint URI.\n * Defaults to `\"/graphql\"`.\n * @param {boolean} [options.useGETForQueries] Should GET be used to fetch\n * queries, if there are no files to upload.\n * @param {ExtractableFileMatcher} [options.isExtractableFile] Matches\n * extractable files in the GraphQL operation. Defaults to\n * {@linkcode isExtractableFile}.\n * @param {typeof FormData} [options.FormData]\n * [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)\n * class. Defaults to the {@linkcode FormData} global.\n * @param {FormDataFileAppender} [options.formDataAppendFile]\n * Customizes how extracted files are appended to the\n * [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)\n * instance. Defaults to {@linkcode formDataAppendFile}.\n * @param {import(\"@apollo/client/link/http/selectHttpOptionsAndBody.js\").Printer} [options.print]\n * Prints the GraphQL query or mutation AST to a string for transport.\n * Defaults to {@linkcode defaultPrinter}.\n * @param {typeof fetch} [options.fetch] [`fetch`](https://fetch.spec.whatwg.org)\n * implementation. Defaults to the {@linkcode fetch} global.\n * @param {RequestInit} [options.fetchOptions] `fetch` options; overridden by\n * upload requirements.\n * @param {string} [options.credentials] Overrides\n * {@linkcode RequestInit.credentials credentials} in\n * {@linkcode fetchOptions}.\n * @param {{ [headerName: string]: string }} [options.headers] Merges with and\n * overrides {@linkcode RequestInit.headers headers} in\n * {@linkcode fetchOptions}.\n * @param {boolean} [options.includeExtensions] Toggles sending `extensions`\n * fields to the GraphQL server. Defaults to `false`.\n * @returns A [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link).\n * @example\n * A basic Apollo Client setup:\n *\n * ```js\n * import { ApolloClient, InMemoryCache } from \"@apollo/client\";\n * import createUploadLink from \"apollo-upload-client/createUploadLink.mjs\";\n *\n * const client = new ApolloClient({\n * cache: new InMemoryCache(),\n * link: createUploadLink(),\n * });\n * ```\n */\nexport function createUploadLink({\n uri: fetchUri = '/graphql',\n useGETForQueries,\n isExtractableFile: customIsExtractableFile = isExtractableFile,\n FormData: CustomFormData,\n formDataAppendFile: customFormDataAppendFile = formDataAppendFile,\n print = defaultPrinter,\n fetch: customFetch,\n fetchOptions,\n credentials,\n headers,\n includeExtensions,\n}: {\n uri?: string;\n useGETForQueries?: boolean;\n isExtractableFile?: (value: unknown) => value is ExtractableFile;\n FormData?: typeof FormData;\n formDataAppendFile?: (formData: FormData, fieldName: string, file: ExtractableFile) => void;\n print?: BaseHttpLink.Printer;\n fetch?: typeof fetch;\n fetchOptions?: RequestInit;\n credentials?: RequestCredentials;\n headers?: Record<string, string>;\n includeExtensions?: boolean;\n} = {}) {\n const linkConfig = {\n http: { includeExtensions },\n options: fetchOptions,\n credentials,\n headers,\n };\n\n return new ApolloLink((operation) => {\n const context = (operation.getContext());\n const {\n // Apollo Studio client awareness `name` and `version` can be configured\n // via `ApolloClient` constructor options:\n // https://www.apollographql.com/docs/graphos/metrics/client-awareness/#setup\n clientAwareness: { name, version } = {},\n headers,\n } = context;\n\n const contextConfig = {\n http: context['http'],\n options: context['fetchOptions'],\n credentials: context['credentials'],\n headers: {\n // Client awareness headers can be overridden by context `headers`.\n ...(name && { 'apollographql-client-name': name }),\n ...(version && { 'apollographql-client-version': version }),\n ...headers,\n },\n };\n\n const { options, body } = selectHttpOptionsAndBodyInternal(\n operation,\n print,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n const { clone, files } = extractFiles(body, customIsExtractableFile, '');\n\n let uri = selectURI(operation, fetchUri);\n\n if (files.size) {\n if (options.headers)\n // Automatically set by `fetch` when the `body` is a `FormData` instance.\n delete options.headers['content-type'];\n\n // GraphQL multipart request spec:\n // https://github.com/jaydenseric/graphql-multipart-request-spec\n\n const RuntimeFormData = CustomFormData || FormData;\n\n const form = new RuntimeFormData();\n\n form.append('operations', JSON.stringify(clone));\n\n const map: Record<string, Array<string>> = {};\n\n let i = 0;\n files.forEach((paths) => {\n map[++i] = paths;\n });\n form.append('map', JSON.stringify(map));\n\n i = 0;\n files.forEach((_paths, file) => {\n customFormDataAppendFile(form, String(++i), file);\n });\n\n options['body'] = form;\n }\n else {\n if (\n useGETForQueries\n // If the operation contains some mutations GET shouldn’t be used.\n && !operation.query.definitions.some(\n definition =>\n definition.kind === 'OperationDefinition'\n && definition.operation === 'mutation',\n )\n ) {\n options['method'] = 'GET';\n }\n\n if (options['method'] === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(uri, body);\n if (parseError) {\n // Apollo’s `HttpLink` uses `fromError` for this, but it’s not\n // exported from `@apollo/client/link/http`.\n return new Observable((observer) => {\n observer.error(parseError);\n });\n }\n uri = newURI;\n }\n else {\n options['body'] = JSON.stringify(clone);\n }\n }\n\n const { controller } = createSignalIfSupported();\n\n if (typeof controller !== 'boolean') {\n if (options['signal']) {\n // Respect the user configured abort controller signal.\n options['signal'].aborted\n // Signal already aborted, so immediately abort.\n ? controller.abort()\n // Signal not already aborted, so setup a listener to abort when it does.\n : options['signal'].addEventListener(\n 'abort',\n () => {\n controller.abort();\n },\n {\n // Prevent a memory leak if the user configured abort controller\n // is long lasting, or controls multiple things.\n once: true,\n },\n );\n }\n\n options['signal'] = controller.signal;\n }\n\n const runtimeFetch = customFetch || fetch;\n\n return new Observable((observer) => {\n /**\n * Is the observable being cleaned up.\n */\n let cleaningUp: boolean;\n\n runtimeFetch(uri, options)\n .then((response) => {\n // Forward the response on the context.\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then((result) => {\n observer.next(result);\n observer.complete();\n })\n .catch((error) => {\n // If the observable is being cleaned up, there is no need to call\n // next or error because there are no more subscribers. An error after\n // cleanup begins is likely from the cleanup function aborting the\n // fetch.\n if (!cleaningUp) {\n // For errors such as an invalid fetch URI there will be no GraphQL\n // result with errors or data to forward.\n if (error.result && error.result.errors && error.result.data)\n observer.next(error.result);\n\n observer.error(error);\n }\n });\n\n // Cleanup function.\n return () => {\n cleaningUp = true;\n\n // Abort fetch. It’s ok to signal an abort even when not fetching.\n if (typeof controller !== 'boolean')\n controller.abort();\n };\n });\n });\n}\n"],"names":["ApolloLink","selectHttpOptionsAndBodyInternal","defaultPrinter","fallbackHttpConfig","selectURI","rewriteURIForGET","parseAndCheckHttpResponse","Observable","extractFiles","isExtractableFile","createSignalIfSupported","controller","signal","formDataAppendFile","formData","fieldName","file","createUploadLink","fetchUri","useGETForQueries","customIsExtractableFile","CustomFormData","customFormDataAppendFile","print","customFetch","fetchOptions","credentials","headers","includeExtensions","linkConfig","operation","context","name","version","contextConfig","options","body","clone","files","uri","RuntimeFormData","form","map","i","paths","_paths","definition","newURI","parseError","observer","runtimeFetch","cleaningUp","response","result","error"],"mappings":"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"}
@@ -15,3 +15,4 @@ function g({ options: r, children: t, onError: o }) {
15
15
  export {
16
16
  g as ApolloProvider
17
17
  };
18
+ //# sourceMappingURL=apollo-client-nextjs.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-client-nextjs.component.js","sources":["../../../src/react/apollo-client-nextjs/apollo-client-nextjs.component.tsx"],"sourcesContent":["import { ApolloNextAppProvider } from '@apollo/client-integration-nextjs';\nimport * as React from 'react';\nimport { useMemo } from 'react';\n\nimport type { I_ApolloProviderProps } from '../apollo-client/index.js';\n\nimport { ApolloErrorComponent, ApolloErrorProvider } from '../apollo-error/index.js';\nimport { Toaster } from '../toast/index.js';\nimport { getClient } from './apollo-client-nextjs.util.js';\n\n/**\n * Next.js Apollo Provider component that wraps the application with Apollo Client context.\n * This component provides the Apollo Client instance to all child components,\n * enabling GraphQL operations throughout the component tree. It includes\n * error handling and toast integration for a complete GraphQL experience.\n *\n * Features:\n * - Apollo Client context provision\n * - Error boundary integration\n * - Toast notification support\n * - Automatic error handling\n * - Next.js specific optimizations\n *\n * @param props - Component props containing options, children, and optional error override.\n * @param props.options - Apollo Client configuration options.\n * @param props.children - React children that will have access to Apollo Client context.\n * @param props.onError - Optional callback to override the default modal/toast error handling.\n * @returns A React component that provides Apollo Client context to its children.\n */\nexport function ApolloProvider({ options, children, onError }: I_ApolloProviderProps) {\n const makeClient = useMemo(\n () => () => getClient(options || {}),\n [options],\n );\n\n return (\n <>\n <ApolloErrorProvider onError={onError}>\n <ApolloNextAppProvider makeClient={makeClient}>\n {children}\n </ApolloNextAppProvider>\n {!onError && <ApolloErrorComponent />}\n </ApolloErrorProvider>\n <Toaster position=\"top-right\" />\n </>\n );\n}\n"],"names":["ApolloProvider","options","children","onError","makeClient","useMemo","getClient","React","ApolloErrorProvider","ApolloNextAppProvider","ApolloErrorComponent","Toaster"],"mappings":";;;;;;;AA6BO,SAASA,EAAe,EAAE,SAAAC,GAAS,UAAAC,GAAU,SAAAC,KAAkC;AAClF,QAAMC,IAAaC;AAAA,IACf,MAAM,MAAMC,EAAUL,KAAW,EAAE;AAAA,IACnC,CAACA,CAAO;AAAA,EAAA;AAGZ,2DAEQ,gBAAAM,EAAA,cAACC,GAAA,EAAoB,SAAAL,KACjB,gBAAAI,EAAA,cAACE,GAAA,EAAsB,YAAAL,KAClBF,CACL,GACC,CAACC,KAAW,gBAAAI,EAAA,cAACG,OAAqB,CACvC,mCACCC,GAAA,EAAQ,UAAS,aAAY,CAClC;AAER;"}
@@ -4,3 +4,4 @@ const l = (t = {}) => e(() => o(t));
4
4
  export {
5
5
  l as makeClient
6
6
  };
7
+ //# sourceMappingURL=apollo-client-nextjs.rsc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-client-nextjs.rsc.js","sources":["../../../src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.ts"],"sourcesContent":["import { registerApolloClient } from '@apollo/client-integration-nextjs';\n\nimport type { I_ApolloOptions } from '../apollo-client/index.js';\n\nimport { getClient } from './apollo-client-nextjs.util.js';\n\n/**\n * Creates a registered Apollo Client factory for Next.js server components.\n * This function creates a client factory that is registered with Next.js for\n * proper server-side rendering support. The factory function ensures that\n * each request gets its own Apollo Client instance, which is essential for\n * SSR compatibility and preventing client state leakage between requests.\n *\n * @param options - Configuration options for the Apollo Client including URI, WebSocket URL, and custom links.\n * @returns A registered Apollo Client factory function that can be used with Next.js server components.\n */\nexport const makeClient = (options: I_ApolloOptions = {}) => registerApolloClient(() => getClient(options));\n"],"names":["registerApolloClient","getClient","makeClient","options"],"mappings":"AAgBO,SAAA,wBAAAA,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,MAAMC,IAAa,CAACC,IAA2B,CAAA,MAAOH,EAAqB,MAAMC,EAAUE,CAAO,CAAC;"}
@@ -1,21 +1,15 @@
1
- import { ApolloClient as l, InMemoryCache as p } from "@apollo/client-integration-nextjs";
2
- import { ApolloLink as a } from "@apollo/client/link";
3
- import { createApolloLinks as i } from "../apollo-client/apollo-client.util.js";
4
- var f = Object.defineProperty, t = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable, n = (e, r, o) => r in e ? f(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, _ = (e, r) => {
5
- for (var o in r || (r = {}))
6
- m.call(r, o) && n(e, o, r[o]);
7
- if (t)
8
- for (var o of t(r))
9
- c.call(r, o) && n(e, o, r[o]);
10
- return e;
11
- };
12
- function v(e = {}) {
13
- const r = a.from(i(e));
14
- return new l(_({
15
- link: r,
16
- cache: new p()
17
- }, e));
1
+ import { ApolloClient as r, InMemoryCache as n } from "@apollo/client-integration-nextjs";
2
+ import { ApolloLink as t } from "@apollo/client/link";
3
+ import { createApolloLinks as l } from "../apollo-client/apollo-client.util.js";
4
+ function p(o = {}) {
5
+ const e = t.from(l(o));
6
+ return new r({
7
+ link: e,
8
+ cache: new n(),
9
+ ...o
10
+ });
18
11
  }
19
12
  export {
20
- v as getClient
13
+ p as getClient
21
14
  };
15
+ //# sourceMappingURL=apollo-client-nextjs.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-client-nextjs.util.js","sources":["../../../src/react/apollo-client-nextjs/apollo-client-nextjs.util.ts"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client-integration-nextjs';\nimport { ApolloLink } from '@apollo/client/link';\n\nimport type { I_ApolloOptions } from '../apollo-client/index.js';\n\nimport { createApolloLinks } from '../apollo-client/apollo-client.util.js';\n\n/**\n * Creates a Next.js optimized Apollo Client instance.\n * This function creates an Apollo Client specifically configured for Next.js applications,\n * using the Next.js integration package for proper server-side rendering support.\n * The client includes all standard Apollo features like error handling, logging,\n * file uploads, and WebSocket subscriptions, but is optimized for Next.js environments.\n *\n * @param options - Configuration options for the Apollo Client including URI, WebSocket URL, and custom links.\n * @returns A Next.js optimized Apollo Client instance ready for use in Next.js applications.\n */\nexport function getClient(options: I_ApolloOptions = {}) {\n const link = ApolloLink.from(createApolloLinks(options));\n\n return new ApolloClient({\n link,\n cache: new InMemoryCache(),\n ...options,\n });\n}\n"],"names":["ApolloClient","InMemoryCache","ApolloLink","createApolloLinks","getClient","options","link"],"mappings":"AAiBO,SAAA,gBAAAA,GAAA,iBAAAC,SAAA;AAAA,SAAA,cAAAC,SAAA;AAAA,SAAA,qBAAAC,SAAA;AAAA,SAASC,EAAUC,IAA2B,IAAI;AACrD,QAAMC,IAAOJ,EAAW,KAAKC,EAAkBE,CAAO,CAAC;AAEvD,SAAO,IAAIL,EAAa;AAAA,IACpB,MAAAM;AAAA,IACA,OAAO,IAAIL,EAAA;AAAA,IACX,GAAGI;AAAA,EAAA,CACN;AACL;"}
@@ -4,3 +4,4 @@ export {
4
4
  e as ApolloProvider,
5
5
  l as getClient
6
6
  };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,31 +1,70 @@
1
1
  import * as t from "react";
2
- import { use as a } from "react";
3
- import { validate as s } from "../../util/validate/validate.util.js";
4
- import { ApolloErrorContext as i } from "./apollo-error.context.js";
5
- import n from "./apollo-error.module.scss.js";
6
- function u() {
7
- const o = a(i), e = o == null ? void 0 : o.error;
2
+ import { use as g, useRef as d, useEffect as f } from "react";
3
+ import { validate as E } from "../../util/validate/validate.util.js";
4
+ import { ApolloErrorContext as h } from "./apollo-error.context.js";
5
+ import o from "./apollo-error.module.scss.js";
6
+ const N = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
7
+ function C() {
8
+ const p = g(h), { error: e, hideError: a } = p ?? {}, l = d(null), s = d(null);
9
+ f(() => {
10
+ if (!e || !a) return;
11
+ const r = (n) => {
12
+ n.key === "Escape" && a();
13
+ };
14
+ return window.addEventListener("keydown", r), () => {
15
+ window.removeEventListener("keydown", r);
16
+ };
17
+ }, [e, a]), f(() => {
18
+ e && l.current ? (s.current = document.activeElement, l.current.focus()) : !e && s.current && (s.current.focus(), s.current = null);
19
+ }, [e]);
20
+ const y = (r) => {
21
+ if (r.key !== "Tab" || !l.current) return;
22
+ const n = Array.from(
23
+ l.current.querySelectorAll(N)
24
+ ).filter((b) => !b.hasAttribute("disabled"));
25
+ if (n.length === 0) return;
26
+ const c = n[0], u = n[n.length - 1];
27
+ !c || !u || (r.shiftKey ? document.activeElement === c && (r.preventDefault(), u.focus()) : document.activeElement === u && (r.preventDefault(), c.focus()));
28
+ };
8
29
  if (!e)
9
30
  return null;
10
- const r = "locations" in e || "path" in e || "extensions" in e, l = "message" in e ? e.message : "Unknown error occurred";
11
- return /* @__PURE__ */ t.createElement("div", { className: n["modal-backdrop"] }, /* @__PURE__ */ t.createElement("div", { className: n["modal-content"] }, /* @__PURE__ */ t.createElement(
12
- "button",
31
+ const i = "locations" in e || "path" in e || "extensions" in e, m = "message" in e ? e.message : "Unknown error occurred";
32
+ return /* @__PURE__ */ t.createElement("div", { className: o["modal-backdrop"] }, /* @__PURE__ */ t.createElement(
33
+ "div",
13
34
  {
14
- type: "button",
15
- className: n["btn-close"],
16
- onClick: o.hideError
35
+ ref: l,
36
+ className: o["modal-content"],
37
+ role: "dialog",
38
+ "aria-modal": "true",
39
+ "aria-labelledby": "apollo-error-title",
40
+ tabIndex: -1,
41
+ onKeyDown: y
17
42
  },
18
- "✕"
19
- ), /* @__PURE__ */ t.createElement("div", { className: n["error-title"] }, /* @__PURE__ */ t.createElement(
20
- "button",
21
- {
22
- type: "button",
23
- className: n["btn-retry"],
24
- onClick: () => window.location.reload()
25
- },
26
- "Reload"
27
- ), " ", !s.isEmpty(e) && l), /* @__PURE__ */ t.createElement("div", { className: n["error-details"] }, r && "locations" in e && e.locations && /* @__PURE__ */ t.createElement("pre", { className: "locations" }, /* @__PURE__ */ t.createElement("strong", null, "Locations:"), " ", JSON.stringify(e.locations, null, 4)), r && "path" in e && e.path && /* @__PURE__ */ t.createElement("pre", { className: "path" }, /* @__PURE__ */ t.createElement("strong", null, "Path:"), " ", JSON.stringify(e.path, null, 4)), r && "extensions" in e && e.extensions && /* @__PURE__ */ t.createElement("pre", { className: "extensions" }, /* @__PURE__ */ t.createElement("strong", null, "Extensions:"), " ", JSON.stringify(e.extensions, null, 4)), !r && /* @__PURE__ */ t.createElement("pre", { className: "error-details" }, /* @__PURE__ */ t.createElement("strong", null, "Error Details:"), " ", s.isEmpty(e) ? l : JSON.stringify(e, null, 4)))));
43
+ /* @__PURE__ */ t.createElement(
44
+ "button",
45
+ {
46
+ type: "button",
47
+ className: o["btn-close"],
48
+ onClick: a,
49
+ "aria-label": "Close error details",
50
+ title: "Close error details"
51
+ },
52
+ ""
53
+ ),
54
+ /* @__PURE__ */ t.createElement("div", { id: "apollo-error-title", className: o["error-title"] }, /* @__PURE__ */ t.createElement(
55
+ "button",
56
+ {
57
+ type: "button",
58
+ className: o["btn-retry"],
59
+ onClick: () => window.location.reload(),
60
+ "aria-label": "Reload page"
61
+ },
62
+ "Reload"
63
+ ), " ", !E.isEmpty(e) && m),
64
+ /* @__PURE__ */ t.createElement("div", { className: o["error-details"] }, i && "locations" in e && e.locations && /* @__PURE__ */ t.createElement("pre", { className: "locations" }, /* @__PURE__ */ t.createElement("strong", null, "Locations:"), " ", JSON.stringify(e.locations, null, 4)), i && "path" in e && e.path && /* @__PURE__ */ t.createElement("pre", { className: "path" }, /* @__PURE__ */ t.createElement("strong", null, "Path:"), " ", JSON.stringify(e.path, null, 4)), i && "extensions" in e && e.extensions && /* @__PURE__ */ t.createElement("pre", { className: "extensions" }, /* @__PURE__ */ t.createElement("strong", null, "Extensions:"), " ", JSON.stringify(e.extensions, null, 4)), !i && /* @__PURE__ */ t.createElement("pre", { className: "error-details" }, /* @__PURE__ */ t.createElement("strong", null, "Error Details:"), " ", E.isEmpty(e) ? m : JSON.stringify(e, null, 4)))
65
+ ));
28
66
  }
29
67
  export {
30
- u as ApolloErrorComponent
68
+ C as ApolloErrorComponent
31
69
  };
70
+ //# sourceMappingURL=apollo-error.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-error.component.js","sources":["../../../src/react/apollo-error/apollo-error.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport { use, useEffect, useRef } from 'react';\n\nimport { validate } from '#util/validate/validate.util.js';\n\nimport { ApolloErrorContext } from './apollo-error.context.js';\nimport style from './apollo-error.module.scss';\n\nconst FOCUSABLE_SELECTORS = 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Apollo Error Component that displays detailed error information in a modal.\n * This component provides a comprehensive error display interface that shows\n * GraphQL errors and other error types with detailed information for debugging purposes.\n *\n * Features:\n * - Modal overlay with backdrop for focus\n * - Detailed error categorization and display\n * - Reload functionality for error recovery\n * - Close button to dismiss the error modal\n * - Structured display of different error types\n * - Extra information display for debugging\n *\n * @returns A modal component displaying Apollo error details, or null if no error is present.\n */\nexport function ApolloErrorComponent() {\n const context = use(ApolloErrorContext);\n const { error, hideError } = context ?? {};\n const dialogRef = useRef<HTMLDivElement>(null);\n const previousFocusRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!error || !hideError) return;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n hideError();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [error, hideError]);\n\n useEffect(() => {\n if (error && dialogRef.current) {\n previousFocusRef.current = document.activeElement as HTMLElement;\n dialogRef.current.focus();\n }\n else if (!error && previousFocusRef.current) {\n previousFocusRef.current.focus();\n previousFocusRef.current = null;\n }\n }, [error]);\n\n const handleFocusTrap = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab' || !dialogRef.current) return;\n\n const focusableElements = Array.from(\n dialogRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTORS),\n ).filter(el => !el.hasAttribute('disabled'));\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0];\n const lastElement = focusableElements[focusableElements.length - 1];\n\n if (!firstElement || !lastElement) return;\n\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n }\n else if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n };\n\n if (!error) {\n return null;\n }\n\n const isGraphQLError = 'locations' in error || 'path' in error || 'extensions' in error;\n const errorMessage = 'message' in error ? error.message : 'Unknown error occurred';\n\n return (\n <div className={style['modal-backdrop']}>\n <div\n ref={dialogRef}\n className={style['modal-content']}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"apollo-error-title\"\n tabIndex={-1}\n onKeyDown={handleFocusTrap}\n >\n <button\n type=\"button\"\n className={style['btn-close']}\n onClick={hideError}\n aria-label=\"Close error details\"\n title=\"Close error details\"\n >\n ✕\n </button>\n <div id=\"apollo-error-title\" className={style['error-title']}>\n <button\n type=\"button\"\n className={style['btn-retry']}\n onClick={() => window.location.reload()}\n aria-label=\"Reload page\"\n >\n Reload\n </button>\n {' '}\n {!validate.isEmpty(error) && errorMessage}\n </div>\n <div className={style['error-details']}>\n {isGraphQLError && 'locations' in error && error.locations && (\n <pre className=\"locations\">\n <strong>Locations:</strong>\n {' '}\n {JSON.stringify(error.locations, null, 4)}\n </pre>\n )}\n {isGraphQLError && 'path' in error && error.path && (\n <pre className=\"path\">\n <strong>Path:</strong>\n {' '}\n {JSON.stringify(error.path, null, 4)}\n </pre>\n )}\n {isGraphQLError && 'extensions' in error && error.extensions && (\n <pre className=\"extensions\">\n <strong>Extensions:</strong>\n {' '}\n {JSON.stringify(error.extensions, null, 4)}\n </pre>\n )}\n {!isGraphQLError && (\n <pre className=\"error-details\">\n <strong>Error Details:</strong>\n {' '}\n {validate.isEmpty(error) ? errorMessage : JSON.stringify(error, null, 4)}\n </pre>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["FOCUSABLE_SELECTORS","ApolloErrorComponent","context","use","ApolloErrorContext","error","hideError","dialogRef","useRef","previousFocusRef","useEffect","handleKeyDown","event","handleFocusTrap","focusableElements","el","firstElement","lastElement","isGraphQLError","errorMessage","React","style","validate"],"mappings":"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"}
@@ -3,3 +3,4 @@ const r = o(void 0);
3
3
  export {
4
4
  r as ApolloErrorContext
5
5
  };
6
+ //# sourceMappingURL=apollo-error.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-error.context.js","sources":["../../../src/react/apollo-error/apollo-error.context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nimport type { I_ApolloErrorContext } from './apollo-error.type.js';\n\nexport const ApolloErrorContext = createContext<I_ApolloErrorContext | undefined>(undefined);\n"],"names":["createContext","ApolloErrorContext"],"mappings":"AAIO,SAAA,iBAAAA,SAAA;AAAA,MAAMC,IAAqBD,EAAgD,MAAS;"}
@@ -9,3 +9,4 @@ function n() {
9
9
  export {
10
10
  n as useApolloError
11
11
  };
12
+ //# sourceMappingURL=apollo-error.hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-error.hook.js","sources":["../../../src/react/apollo-error/apollo-error.hook.tsx"],"sourcesContent":["import { use } from 'react';\n\nimport { ApolloErrorContext } from './apollo-error.context.js';\n\n/**\n * React hook that provides access to Apollo error context.\n * This hook retrieves the Apollo error context which contains the current error state\n * and methods to show or hide errors. It provides a convenient way to access error\n * handling functionality within components.\n *\n * The hook will throw an error if used outside of an ApolloErrorProvider,\n * ensuring proper context usage and providing clear error messages for debugging.\n *\n * @returns The Apollo error context containing error state and control methods.\n * @throws {Error} When used outside of an ApolloErrorProvider context.\n */\nexport function useApolloError() {\n const context = use(ApolloErrorContext);\n\n if (!context) {\n throw new Error('useApolloError must be used within ApolloErrorProvider');\n }\n\n return context;\n}\n"],"names":["use","ApolloErrorContext","useApolloError","context"],"mappings":"AAgBO,SAAA,OAAAA,SAAA;AAAA,SAAA,sBAAAC,SAAA;AAAA,SAASC,IAAiB;AAC7B,QAAMC,IAAUH,EAAIC,CAAkB;AAEtC,MAAI,CAACE;AACD,UAAM,IAAI,MAAM,wDAAwD;AAG5E,SAAOA;AACX;"}
@@ -1,11 +1,12 @@
1
1
  const t = {
2
- "modal-backdrop": "_modal-backdrop_1i2kc_1",
3
- "modal-content": "_modal-content_1i2kc_11",
4
- "btn-close": "_btn-close_1i2kc_22",
5
- "error-title": "_error-title_1i2kc_36",
6
- "btn-retry": "_btn-retry_1i2kc_40",
7
- "error-details": "_error-details_1i2kc_53"
2
+ "modal-backdrop": "_modal-backdrop_199u4_1",
3
+ "modal-content": "_modal-content_199u4_11",
4
+ "btn-close": "_btn-close_199u4_22",
5
+ "error-title": "_error-title_199u4_41",
6
+ "btn-retry": "_btn-retry_199u4_45",
7
+ "error-details": "_error-details_199u4_62"
8
8
  };
9
9
  export {
10
10
  t as default
11
11
  };
12
+ //# sourceMappingURL=apollo-error.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-error.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -23,3 +23,4 @@ function k({ children: u, onError: l }) {
23
23
  export {
24
24
  k as ApolloErrorProvider
25
25
  };
26
+ //# sourceMappingURL=apollo-error.provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-error.provider.js","sources":["../../../src/react/apollo-error/apollo-error.provider.tsx"],"sourcesContent":["import type { GraphQLError } from 'graphql';\n\nimport * as React from 'react';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport type { I_ApolloErrorProviderProps } from './apollo-error.type.js';\n\nimport { ApolloErrorContext } from './apollo-error.context.js';\nimport { clearGlobalApolloErrorCallback, setGlobalApolloErrorCallback } from './apollo-error.util.js';\n\n/**\n * Provider component that manages Apollo error state and provides error context.\n * This component sets up error handling for Apollo Client operations and provides\n * error state management to all child components through React context.\n *\n * Features:\n * - Global Apollo error state management\n * - Error context provision to child components\n * - Automatic error handling and display\n * - Optional custom error handling callbacks\n * - Integration with error boundaries\n *\n * @param props - Component props containing children.\n * @param props.children - React children that will have access to the error context.\n * @param props.onError - Optional callback to override the default error modal/toast flow.\n * @returns A React component that provides Apollo error context to its children.\n */\nexport function ApolloErrorProvider({ children, onError }: I_ApolloErrorProviderProps) {\n const [error, setError] = useState<GraphQLError | Error | null>(null);\n\n const handleGlobalError = useCallback((apolloError: GraphQLError | Error) => {\n if (onError) {\n onError(apolloError);\n\n return;\n }\n\n setError(apolloError);\n }, [onError]);\n\n useEffect(() => {\n setGlobalApolloErrorCallback(handleGlobalError, Boolean(onError));\n\n return () => {\n clearGlobalApolloErrorCallback();\n };\n }, [handleGlobalError, onError]);\n\n const hideError = useCallback(() => setError(null), []);\n\n const contextValue = useMemo(() => ({\n error: onError ? null : error,\n showError: handleGlobalError,\n hideError,\n }), [error, handleGlobalError, hideError, onError]);\n\n return (\n <ApolloErrorContext value={contextValue}>\n {children}\n </ApolloErrorContext>\n );\n}\n"],"names":["React","useState","useCallback","useEffect","useMemo","ApolloErrorContext","setGlobalApolloErrorCallback","clearGlobalApolloErrorCallback","ApolloErrorProvider","children","onError","error","setError","handleGlobalError","apolloError","hideError","contextValue"],"mappings":"AA2BO,YAAAA,OAAA;AAAA,SAAA,YAAAC,GAAA,eAAAC,GAAA,aAAAC,GAAA,WAAAC,SAAA;AAAA,SAAA,sBAAAC,SAAA;AAAA,SAAA,gCAAAC,GAAA,kCAAAC,SAAA;AAAA,SAASC,EAAoB,EAAE,UAAAC,GAAU,SAAAC,KAAuC;AACnF,QAAM,CAACC,GAAOC,CAAQ,IAAIX,EAAsC,IAAI,GAE9DY,IAAoBX,EAAY,CAACY,MAAsC;AACzE,QAAIJ,GAAS;AACT,MAAAA,EAAQI,CAAW;AAEnB;AAAA,IACJ;AAEA,IAAAF,EAASE,CAAW;AAAA,EACxB,GAAG,CAACJ,CAAO,CAAC;AAEZ,EAAAP,EAAU,OACNG,EAA6BO,GAAmB,EAAQH,CAAQ,GAEzD,MAAM;AACT,IAAAH,EAAA;AAAA,EACJ,IACD,CAACM,GAAmBH,CAAO,CAAC;AAE/B,QAAMK,IAAYb,EAAY,MAAMU,EAAS,IAAI,GAAG,CAAA,CAAE,GAEhDI,IAAeZ,EAAQ,OAAO;AAAA,IAChC,OAAOM,IAAU,OAAOC;AAAA,IACxB,WAAWE;AAAA,IACX,WAAAE;AAAA,EAAA,IACA,CAACJ,GAAOE,GAAmBE,GAAWL,CAAO,CAAC;AAElD,SACI,gBAAAV,EAAA,cAACK,GAAA,EAAmB,OAAOW,EAAA,GACtBP,CACL;AAER;"}
@@ -1,15 +1,15 @@
1
- let l = null, r = !1;
2
- function n(o, a = !1) {
3
- l = o, r = a;
1
+ let o = null, r = !1;
2
+ function n(l, a = !1) {
3
+ o = l, r = a;
4
4
  }
5
5
  function e() {
6
- l = null, r = !1;
6
+ o = null, r = !1;
7
7
  }
8
8
  function t() {
9
9
  return r;
10
10
  }
11
- function s(o) {
12
- l == null || l(o);
11
+ function s(l) {
12
+ o?.(l);
13
13
  }
14
14
  export {
15
15
  e as clearGlobalApolloErrorCallback,
@@ -17,3 +17,4 @@ export {
17
17
  n as setGlobalApolloErrorCallback,
18
18
  s as showGlobalApolloError
19
19
  };
20
+ //# sourceMappingURL=apollo-error.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apollo-error.util.js","sources":["../../../src/react/apollo-error/apollo-error.util.tsx"],"sourcesContent":["import type { GraphQLError } from 'graphql';\n\n/**\n * Global callback function for displaying Apollo errors.\n * This variable holds the callback function that will be called when a global\n * Apollo error needs to be displayed. It is set by the ApolloErrorProvider\n * and used throughout the application for consistent error handling.\n */\nlet showErrorCallback: ((err: GraphQLError | Error) => void) | null = null;\nlet hasCustomHandler = false;\n\n/**\n * Sets the global callback function for Apollo error handling.\n * This function registers a callback that will be called whenever a global\n * Apollo error needs to be displayed. The callback is typically set by the\n * ApolloErrorProvider component and used throughout the application for\n * consistent error handling.\n *\n * @param callback - The function to be called when a global Apollo error occurs.\n * @param isCustomHandler - Flag that identifies whether the handler was provided by the consumer.\n */\nexport function setGlobalApolloErrorCallback(\n callback: (err: GraphQLError | Error) => void,\n isCustomHandler = false,\n) {\n showErrorCallback = callback;\n hasCustomHandler = isCustomHandler;\n}\n\n/**\n * Clears the global callback function for Apollo error handling.\n * Useful when the ApolloErrorProvider unmounts to avoid stale references.\n */\nexport function clearGlobalApolloErrorCallback() {\n showErrorCallback = null;\n hasCustomHandler = false;\n}\n\n/**\n * Indicates whether a custom Apollo error handler is registered.\n *\n * @returns True if a custom handler is registered, otherwise false.\n */\nexport function hasCustomApolloErrorHandler() {\n return hasCustomHandler;\n}\n\n/**\n * Displays a global Apollo error using the registered callback.\n * This function triggers the global error display system by calling the\n * registered callback function. If no callback is registered, the function\n * does nothing, providing safe error handling even when the provider is not set up.\n *\n * @param error - The Apollo error to display globally.\n */\nexport function showGlobalApolloError(error: GraphQLError | Error) {\n showErrorCallback?.(error);\n}\n"],"names":["showErrorCallback","hasCustomHandler","setGlobalApolloErrorCallback","callback","isCustomHandler","clearGlobalApolloErrorCallback","hasCustomApolloErrorHandler","showGlobalApolloError","error"],"mappings":"AAQA,IAAIA,IAAkE,MAClEC,IAAmB;AAYhB,SAASC,EACZC,GACAC,IAAkB,IACpB;AACE,EAAAJ,IAAoBG,GACpBF,IAAmBG;AACvB;AAMO,SAASC,IAAiC;AAC7C,EAAAL,IAAoB,MACpBC,IAAmB;AACvB;AAOO,SAASK,IAA8B;AAC1C,SAAOL;AACX;AAUO,SAASM,EAAsBC,GAA6B;AAC/D,EAAAR,IAAoBQ,CAAK;AAC7B;"}
@@ -13,3 +13,4 @@ export {
13
13
  s as showGlobalApolloError,
14
14
  t as useApolloError
15
15
  };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -3,3 +3,4 @@ const n = t;
3
3
  export {
4
4
  n as useTranslateI18next
5
5
  };
6
+ //# sourceMappingURL=i18next.hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18next.hook.js","sources":["../../../src/react/i18next/i18next.hook.ts"],"sourcesContent":["import { useTranslation } from 'react-i18next';\n\n/**\n * React hook that provides i18next translation functionality.\n * This hook is a wrapper around react-i18next's useTranslation hook,\n * providing access to translation functions and current language information.\n * It enables internationalization features including text translation,\n * language switching, and pluralization support.\n *\n * @returns The useTranslation hook result with translation functions and language information.\n */\nexport const useTranslateI18next: typeof useTranslation = useTranslation;\n"],"names":["useTranslation","useTranslateI18next"],"mappings":"AAWO,SAAA,kBAAAA,SAAA;AAAA,MAAMC,IAA6CD;"}
@@ -6,3 +6,4 @@ function o(t) {
6
6
  export {
7
7
  o as initI18next
8
8
  };
9
+ //# sourceMappingURL=i18next.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18next.util.js","sources":["../../../src/react/i18next/i18next.util.ts"],"sourcesContent":["import type { InitOptions } from 'i18next';\n\nimport i18next from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\n/**\n * Initializes i18next with React integration.\n * This function sets up i18next for use with React applications by configuring\n * the react-i18next plugin and initializing the i18next instance with the provided\n * options. It enables internationalization features including translation,\n * language detection, and pluralization rules.\n *\n * @param options - Configuration options for i18next initialization including languages, namespaces, and plugins.\n * @returns A promise that resolves when i18next initialization is complete.\n */\nexport function initI18next(options: InitOptions) {\n return i18next.use(initReactI18next).init(options);\n}\n"],"names":["initI18next","options","i18next","initReactI18next"],"mappings":";;AAeO,SAASA,EAAYC,GAAsB;AAC9C,SAAOC,EAAQ,IAAIC,CAAgB,EAAE,KAAKF,CAAO;AACrD;"}