@carlonicora/nextjs-jsonapi 3.3.1 → 3.3.3

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 (71) hide show
  1. package/dist/{BlockNoteEditor-JLMXCPGB.js → BlockNoteEditor-4LBUVIW6.js} +20 -20
  2. package/dist/{BlockNoteEditor-JLMXCPGB.js.map → BlockNoteEditor-4LBUVIW6.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-G5A34EXN.mjs → BlockNoteEditor-CSPPZOZQ.mjs} +5 -5
  4. package/dist/{JsonApiRequest-2OQCZAK6.mjs → JsonApiRequest-ADNIGXTP.mjs} +2 -2
  5. package/dist/JsonApiRequest-WWGSGV2I.js +26 -0
  6. package/dist/{JsonApiRequest-6TYNBVUL.js.map → JsonApiRequest-WWGSGV2I.js.map} +1 -1
  7. package/dist/billing/index.js +399 -399
  8. package/dist/billing/index.mjs +4 -4
  9. package/dist/{chunk-5AKDE5UW.js → chunk-2PEPIH26.js} +941 -938
  10. package/dist/chunk-2PEPIH26.js.map +1 -0
  11. package/dist/{chunk-PGARO3JT.mjs → chunk-KW6LYVFJ.mjs} +8 -7
  12. package/dist/chunk-KW6LYVFJ.mjs.map +1 -0
  13. package/dist/{chunk-UYENG3GT.js → chunk-OHG2YWNA.js} +22 -27
  14. package/dist/chunk-OHG2YWNA.js.map +1 -0
  15. package/dist/{chunk-LCMVARSP.mjs → chunk-RUEY6XSS.mjs} +8 -13
  16. package/dist/chunk-RUEY6XSS.mjs.map +1 -0
  17. package/dist/{chunk-CMGXH5SA.mjs → chunk-RVASYIQG.mjs} +47 -3
  18. package/dist/chunk-RVASYIQG.mjs.map +1 -0
  19. package/dist/{chunk-YKFXQOQA.js → chunk-S2C5V2XZ.js} +33 -32
  20. package/dist/chunk-S2C5V2XZ.js.map +1 -0
  21. package/dist/{chunk-O4LTJAAM.mjs → chunk-SVCOFVQF.mjs} +15 -12
  22. package/dist/chunk-SVCOFVQF.mjs.map +1 -0
  23. package/dist/{chunk-PFAZPP54.js → chunk-W42MYR3Y.js} +59 -15
  24. package/dist/chunk-W42MYR3Y.js.map +1 -0
  25. package/dist/client/index.js +5 -5
  26. package/dist/client/index.mjs +4 -4
  27. package/dist/components/index.js +5 -5
  28. package/dist/components/index.mjs +4 -4
  29. package/dist/contexts/index.js +5 -5
  30. package/dist/contexts/index.mjs +4 -4
  31. package/dist/core/index.d.mts +59 -1
  32. package/dist/core/index.d.ts +59 -1
  33. package/dist/core/index.js +5 -3
  34. package/dist/core/index.js.map +1 -1
  35. package/dist/core/index.mjs +4 -2
  36. package/dist/features/help/index.js +38 -38
  37. package/dist/features/help/index.mjs +4 -4
  38. package/dist/features/tokenusage/index.js +102 -102
  39. package/dist/features/tokenusage/index.mjs +4 -4
  40. package/dist/index.d.mts +1 -1
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.js +6 -4
  43. package/dist/index.js.map +1 -1
  44. package/dist/index.mjs +5 -3
  45. package/dist/server/index.js +15 -14
  46. package/dist/server/index.js.map +1 -1
  47. package/dist/server/index.mjs +5 -4
  48. package/dist/server/index.mjs.map +1 -1
  49. package/package.json +1 -1
  50. package/src/client/JsonApiClient.ts +3 -2
  51. package/src/client/config.ts +5 -10
  52. package/src/components/forms/FormPlaceAutocomplete.tsx +2 -1
  53. package/src/core/env.ts +73 -0
  54. package/src/core/index.ts +1 -0
  55. package/src/features/auth/utils/AuthCookies.ts +2 -1
  56. package/src/features/company/components/forms/CompanyEditor.tsx +2 -3
  57. package/src/hooks/usePushNotifications.ts +2 -1
  58. package/src/hooks/useSocket.ts +4 -3
  59. package/src/server/JsonApiServer.ts +3 -2
  60. package/src/unified/JsonApiRequest.ts +3 -2
  61. package/dist/JsonApiRequest-6TYNBVUL.js +0 -26
  62. package/dist/chunk-5AKDE5UW.js.map +0 -1
  63. package/dist/chunk-CMGXH5SA.mjs.map +0 -1
  64. package/dist/chunk-LCMVARSP.mjs.map +0 -1
  65. package/dist/chunk-O4LTJAAM.mjs.map +0 -1
  66. package/dist/chunk-PFAZPP54.js.map +0 -1
  67. package/dist/chunk-PGARO3JT.mjs.map +0 -1
  68. package/dist/chunk-UYENG3GT.js.map +0 -1
  69. package/dist/chunk-YKFXQOQA.js.map +0 -1
  70. /package/dist/{BlockNoteEditor-G5A34EXN.mjs.map → BlockNoteEditor-CSPPZOZQ.mjs.map} +0 -0
  71. /package/dist/{JsonApiRequest-2OQCZAK6.mjs.map → JsonApiRequest-ADNIGXTP.mjs.map} +0 -0
@@ -20,7 +20,7 @@ import {
20
20
  useI18nLocale,
21
21
  useI18nRouter,
22
22
  useI18nTranslations
23
- } from "./chunk-LCMVARSP.mjs";
23
+ } from "./chunk-RUEY6XSS.mjs";
24
24
  import {
25
25
  AVAILABLE_OAUTH_SCOPES,
26
26
  AiConnectionService,
@@ -70,7 +70,10 @@ import {
70
70
  useIsMobile,
71
71
  validateItalianTaxCode,
72
72
  validatePartitaIva
73
- } from "./chunk-PGARO3JT.mjs";
73
+ } from "./chunk-KW6LYVFJ.mjs";
74
+ import {
75
+ ENV
76
+ } from "./chunk-RVASYIQG.mjs";
74
77
  import {
75
78
  JsonApiContext
76
79
  } from "./chunk-VOXD3ZLY.mjs";
@@ -10222,7 +10225,7 @@ import { useRef as useRef17 } from "react";
10222
10225
  import dynamic from "next/dynamic";
10223
10226
  import React17 from "react";
10224
10227
  import { jsx as jsx88 } from "react/jsx-runtime";
10225
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-G5A34EXN.mjs"), {
10228
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-CSPPZOZQ.mjs"), {
10226
10229
  ssr: false
10227
10230
  });
10228
10231
  var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -10919,7 +10922,7 @@ function FormPlaceAutocomplete({
10919
10922
  const debounceRef = useRef18(null);
10920
10923
  const containerRef = useRef18(null);
10921
10924
  useEffect20(() => {
10922
- const key = process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY;
10925
+ const key = ENV.GOOGLE_MAPS_API_KEY;
10923
10926
  if (!key) {
10924
10927
  console.error("Google Maps API key not found. Please set NEXT_PUBLIC_GOOGLE_MAPS_API_KEY environment variable.");
10925
10928
  setLoadError(true);
@@ -12449,7 +12452,7 @@ function CompanyEditorInternal({
12449
12452
  const t = useTranslations37();
12450
12453
  const fiscalRef = useRef21(null);
12451
12454
  const addressComponentsRef = useRef21({});
12452
- const canAccessFeatures = hasRole(getRoleId().Administrator) || hasRole(getRoleId().CompanyAdministrator) && process.env.NEXT_PUBLIC_PRIVATE_INSTALLATION?.toLowerCase() === "true";
12455
+ const canAccessFeatures = hasRole(getRoleId().Administrator) || hasRole(getRoleId().CompanyAdministrator) && ENV.PRIVATE_INSTALLATION;
12453
12456
  const handleDialogOpenChange = useCallback21(
12454
12457
  (open) => {
12455
12458
  if (open && features.length === 0 && canAccessFeatures) {
@@ -14446,7 +14449,7 @@ function usePushNotifications() {
14446
14449
  if (permission !== "granted") {
14447
14450
  return;
14448
14451
  }
14449
- const vapidPublicKey = (process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY || "").trim();
14452
+ const vapidPublicKey = ENV.VAPID_PUBLIC_KEY.trim();
14450
14453
  if (!vapidPublicKey) {
14451
14454
  return;
14452
14455
  }
@@ -14493,7 +14496,7 @@ function useSocket({ token }) {
14493
14496
  const socketRef = useRef26(null);
14494
14497
  useEffect37(() => {
14495
14498
  if (!token) return;
14496
- const globalSocketKey = `__socket_${process.env.NEXT_PUBLIC_API_URL?.replace(/[^a-zA-Z0-9]/g, "_")}`;
14499
+ const globalSocketKey = `__socket_${ENV.API_URL.replace(/[^a-zA-Z0-9]/g, "_")}`;
14497
14500
  if (typeof window !== "undefined") {
14498
14501
  const _allSocketKeys = Object.keys(window).filter((key) => key.startsWith("__socket_"));
14499
14502
  const existingSocket = window[globalSocketKey];
@@ -14519,7 +14522,7 @@ function useSocket({ token }) {
14519
14522
  }
14520
14523
  shouldConnect.current = false;
14521
14524
  try {
14522
- currentSocket = io(process.env.NEXT_PUBLIC_API_URL, {
14525
+ currentSocket = io(ENV.API_URL, {
14523
14526
  auth: { token },
14524
14527
  transports: ["websocket"],
14525
14528
  timeout: 2e4
@@ -14574,7 +14577,7 @@ function useSocket({ token }) {
14574
14577
  return () => {
14575
14578
  shouldConnect.current = true;
14576
14579
  if (currentSocket) {
14577
- if (process.env.NODE_ENV === "development") {
14580
+ if (ENV.IS_DEVELOPMENT) {
14578
14581
  currentSocket.off("connect", handleConnect);
14579
14582
  currentSocket.off("disconnect", handleDisconnect);
14580
14583
  currentSocket.off("message", handleMessage);
@@ -16040,7 +16043,7 @@ function useJsonApiGet(params) {
16040
16043
  setLoading(true);
16041
16044
  setError(null);
16042
16045
  try {
16043
- const { JsonApiGet } = await import("./JsonApiRequest-2OQCZAK6.mjs");
16046
+ const { JsonApiGet } = await import("./JsonApiRequest-ADNIGXTP.mjs");
16044
16047
  const language = navigator.language.split("-")[0] || "en";
16045
16048
  const apiResponse = await JsonApiGet({
16046
16049
  classKey: params.classKey,
@@ -16145,7 +16148,7 @@ function useJsonApiMutation(config) {
16145
16148
  setLoading(true);
16146
16149
  setError(null);
16147
16150
  try {
16148
- const { JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } = await import("./JsonApiRequest-2OQCZAK6.mjs");
16151
+ const { JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } = await import("./JsonApiRequest-ADNIGXTP.mjs");
16149
16152
  const language = navigator.language.split("-")[0] || "en";
16150
16153
  let apiResponse;
16151
16154
  switch (config.method) {
@@ -25439,4 +25442,4 @@ export {
25439
25442
  useOAuthClients,
25440
25443
  useOAuthClient
25441
25444
  };
25442
- //# sourceMappingURL=chunk-O4LTJAAM.mjs.map
25445
+ //# sourceMappingURL=chunk-SVCOFVQF.mjs.map