@carlonicora/nextjs-jsonapi 3.1.1 → 3.3.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 (68) hide show
  1. package/dist/{AssistantMessageInterface-Dh0BpbP2.d.ts → AssistantMessageInterface-0zyVingf.d.ts} +1 -1
  2. package/dist/{AssistantMessageInterface-Ce8FcllX.d.mts → AssistantMessageInterface-ddyG114R.d.mts} +1 -1
  3. package/dist/{BlockNoteEditor-FIMPVA7K.mjs → BlockNoteEditor-G5A34EXN.mjs} +4 -4
  4. package/dist/{BlockNoteEditor-GJPTMKS7.js → BlockNoteEditor-JLMXCPGB.js} +19 -19
  5. package/dist/{BlockNoteEditor-GJPTMKS7.js.map → BlockNoteEditor-JLMXCPGB.js.map} +1 -1
  6. package/dist/{auth.interface-COmBjh89.d.ts → auth.interface-B6ZQLGjS.d.ts} +1 -1
  7. package/dist/{auth.interface-CkmZqat3.d.mts → auth.interface-jYD8Gc4P.d.mts} +1 -1
  8. package/dist/billing/index.js +420 -399
  9. package/dist/billing/index.js.map +1 -1
  10. package/dist/billing/index.mjs +25 -4
  11. package/dist/billing/index.mjs.map +1 -1
  12. package/dist/{chunk-E5FWGOP5.js → chunk-5AKDE5UW.js} +757 -755
  13. package/dist/chunk-5AKDE5UW.js.map +1 -0
  14. package/dist/{chunk-ZMYZFQN3.mjs → chunk-LCMVARSP.mjs} +2 -2
  15. package/dist/{chunk-VUMM7V5G.mjs → chunk-O4LTJAAM.mjs} +6 -4
  16. package/dist/{chunk-VUMM7V5G.mjs.map → chunk-O4LTJAAM.mjs.map} +1 -1
  17. package/dist/{chunk-CGJW7ZZM.mjs → chunk-PGARO3JT.mjs} +7 -1
  18. package/dist/chunk-PGARO3JT.mjs.map +1 -0
  19. package/dist/{chunk-H7DOSB7W.js → chunk-UYENG3GT.js} +7 -7
  20. package/dist/{chunk-H7DOSB7W.js.map → chunk-UYENG3GT.js.map} +1 -1
  21. package/dist/{chunk-YUXCJ35V.js → chunk-YKFXQOQA.js} +7 -1
  22. package/dist/chunk-YKFXQOQA.js.map +1 -0
  23. package/dist/client/index.d.mts +2 -2
  24. package/dist/client/index.d.ts +2 -2
  25. package/dist/client/index.js +4 -4
  26. package/dist/client/index.mjs +3 -3
  27. package/dist/components/index.d.mts +6 -6
  28. package/dist/components/index.d.ts +6 -6
  29. package/dist/components/index.js +4 -4
  30. package/dist/components/index.mjs +3 -3
  31. package/dist/contexts/index.d.mts +3 -3
  32. package/dist/contexts/index.d.ts +3 -3
  33. package/dist/contexts/index.js +4 -4
  34. package/dist/contexts/index.mjs +3 -3
  35. package/dist/core/index.d.mts +9 -7
  36. package/dist/core/index.d.ts +9 -7
  37. package/dist/core/index.js +2 -2
  38. package/dist/core/index.mjs +1 -1
  39. package/dist/features/help/index.js +37 -37
  40. package/dist/features/help/index.mjs +3 -3
  41. package/dist/features/tokenusage/index.js +101 -101
  42. package/dist/features/tokenusage/index.mjs +3 -3
  43. package/dist/index.d.mts +4 -4
  44. package/dist/index.d.ts +4 -4
  45. package/dist/index.js +3 -3
  46. package/dist/index.mjs +2 -2
  47. package/dist/{notification.interface-CG1vqoxg.d.mts → notification.interface-BWOCvKRP.d.mts} +6 -0
  48. package/dist/{notification.interface--27exGde.d.ts → notification.interface-DYF56CtE.d.ts} +6 -0
  49. package/dist/{s3.service-Dt6MfuHr.d.mts → s3.service-D_dswjgz.d.mts} +2 -2
  50. package/dist/{s3.service-CpwA3sl_.d.ts → s3.service-DserU9VK.d.ts} +2 -2
  51. package/dist/server/index.d.mts +3 -3
  52. package/dist/server/index.d.ts +3 -3
  53. package/dist/server/index.js +3 -3
  54. package/dist/server/index.mjs +1 -1
  55. package/dist/{useSocket-M3YY0aTS.d.mts → useSocket-BZG9oX-L.d.mts} +1 -1
  56. package/dist/{useSocket-DgGAQW6h.d.ts → useSocket-CiyTtYFj.d.ts} +1 -1
  57. package/package.json +1 -1
  58. package/src/features/ai-connection/components/containers/AiConnectionsContainer.tsx +2 -1
  59. package/src/features/ai-connection/i18n-keys.ts +1 -0
  60. package/src/features/billing/stripe-price/components/forms/PriceEditor.tsx +25 -1
  61. package/src/features/company/data/company.interface.ts +7 -0
  62. package/src/features/company/data/company.test.ts +40 -0
  63. package/src/features/company/data/company.ts +7 -0
  64. package/dist/chunk-CGJW7ZZM.mjs.map +0 -1
  65. package/dist/chunk-E5FWGOP5.js.map +0 -1
  66. package/dist/chunk-YUXCJ35V.js.map +0 -1
  67. /package/dist/{BlockNoteEditor-FIMPVA7K.mjs.map → BlockNoteEditor-G5A34EXN.mjs.map} +0 -0
  68. /package/dist/{chunk-ZMYZFQN3.mjs.map → chunk-LCMVARSP.mjs.map} +0 -0
@@ -62,12 +62,12 @@ import {
62
62
  useCurrentUserContext,
63
63
  useDataListRetriever,
64
64
  usePageUrlGenerator
65
- } from "../chunk-VUMM7V5G.mjs";
65
+ } from "../chunk-O4LTJAAM.mjs";
66
66
  import {
67
67
  getRoleId,
68
68
  getStripePublishableKey,
69
69
  useI18nRouter
70
- } from "../chunk-ZMYZFQN3.mjs";
70
+ } from "../chunk-LCMVARSP.mjs";
71
71
  import {
72
72
  FeatureService,
73
73
  Modules,
@@ -80,7 +80,7 @@ import {
80
80
  StripeUsageService,
81
81
  cn,
82
82
  rehydrate
83
- } from "../chunk-CGJW7ZZM.mjs";
83
+ } from "../chunk-PGARO3JT.mjs";
84
84
  import "../chunk-AUXK7QSA.mjs";
85
85
  import "../chunk-C7C7VY4F.mjs";
86
86
  import "../chunk-CMGXH5SA.mjs";
@@ -3181,7 +3181,28 @@ function PriceEditorInternal({
3181
3181
  isTrial: z2.boolean(),
3182
3182
  description: z2.string().optional(),
3183
3183
  features: z2.array(z2.string()),
3184
- token: z2.string(),
3184
+ // Normalised, not a bare `z.string()`: the field renders as
3185
+ // `<FormInput type="number">`, which hands back a number, so a plain
3186
+ // string schema rejects every value with "expected string, received
3187
+ // number".
3188
+ //
3189
+ // Normalised by hand rather than with `z.coerce.string()`, because
3190
+ // zod 4's coercion is `String(input)` — a cleared number input yields
3191
+ // NaN, which would become the TRUTHY string "NaN" and reach
3192
+ // `parseInt` as a NaN token.
3193
+ //
3194
+ // Deliberately NOT converted to the `z.preprocess(... z.number())`
3195
+ // idiom used by unitAmount/intervalCount above. The whole token
3196
+ // pipeline is string-based — seeded with `.toString()` and read back
3197
+ // with `values.token ? parseInt(...)` on both submit branches — and a
3198
+ // number pipeline would make `0` FALSY, silently dropping the token
3199
+ // from the payload. A price with no token is "tokens not configured"
3200
+ // (AI stays enabled), so that would make a zero-token / no-AI plan
3201
+ // impossible to create from this form.
3202
+ token: z2.preprocess(
3203
+ (value) => value === void 0 || value === null || value === "" || typeof value === "number" && Number.isNaN(value) ? "" : String(value),
3204
+ z2.string()
3205
+ ),
3185
3206
  featureIds: z2.array(z2.string())
3186
3207
  }),
3187
3208
  [t]