@carlonicora/nextjs-jsonapi 1.78.0 → 1.80.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 (128) hide show
  1. package/dist/{AssistantMessageInterface-DS_tyJTV.d.ts → AssistantMessageInterface-BpEhx2pC.d.ts} +19 -2
  2. package/dist/{AssistantMessageInterface-D0Kwf8CR.d.mts → AssistantMessageInterface-DJ3Me16Y.d.mts} +19 -2
  3. package/dist/{AuthComponent-Blbs06ud.d.ts → AuthComponent-B6DIk8Vf.d.ts} +1 -1
  4. package/dist/{AuthComponent-huIaK5rm.d.mts → AuthComponent-BKI0ZbtD.d.mts} +1 -1
  5. package/dist/{BlockNoteEditor-JXK3JGKJ.mjs → BlockNoteEditor-3M5PD3BZ.mjs} +4 -4
  6. package/dist/{BlockNoteEditor-2G5UYALC.js → BlockNoteEditor-YLTPJPTV.js} +14 -14
  7. package/dist/{BlockNoteEditor-2G5UYALC.js.map → BlockNoteEditor-YLTPJPTV.js.map} +1 -1
  8. package/dist/RbacTypes-BTbr27Ew.d.mts +43 -0
  9. package/dist/RbacTypes-BTbr27Ew.d.ts +43 -0
  10. package/dist/{auth.interface-CQJ6A2Cj.d.ts → auth.interface-BBUgMZzs.d.ts} +1 -1
  11. package/dist/{auth.interface-Bdq7-8iV.d.mts → auth.interface-XYEREOD6.d.mts} +1 -1
  12. package/dist/billing/index.js +346 -346
  13. package/dist/billing/index.mjs +3 -3
  14. package/dist/{chunk-ZEDB6JVB.js → chunk-4NOQNTFI.js} +1585 -1405
  15. package/dist/chunk-4NOQNTFI.js.map +1 -0
  16. package/dist/{chunk-I65SSQ5Z.mjs → chunk-6UMB5LTQ.mjs} +157 -7
  17. package/dist/chunk-6UMB5LTQ.mjs.map +1 -0
  18. package/dist/{chunk-FDJQRIMY.js → chunk-N4YZ45SK.js} +174 -24
  19. package/dist/chunk-N4YZ45SK.js.map +1 -0
  20. package/dist/{chunk-NB6TIKHK.mjs → chunk-NQV5RDCK.mjs} +2524 -2344
  21. package/dist/chunk-NQV5RDCK.mjs.map +1 -0
  22. package/dist/{chunk-NZOUEN67.mjs → chunk-PV5V6CVW.mjs} +38 -29
  23. package/dist/{chunk-NZOUEN67.mjs.map → chunk-PV5V6CVW.mjs.map} +1 -1
  24. package/dist/{chunk-X4YDETTD.js → chunk-ZEJSPTHS.js} +39 -30
  25. package/dist/chunk-ZEJSPTHS.js.map +1 -0
  26. package/dist/client/index.d.mts +6 -24
  27. package/dist/client/index.d.ts +6 -24
  28. package/dist/client/index.js +4 -10
  29. package/dist/client/index.js.map +1 -1
  30. package/dist/client/index.mjs +3 -9
  31. package/dist/components/index.d.mts +55 -39
  32. package/dist/components/index.d.ts +55 -39
  33. package/dist/components/index.js +4 -8
  34. package/dist/components/index.js.map +1 -1
  35. package/dist/components/index.mjs +5 -9
  36. package/dist/{config-B3jKt9P7.d.ts → config-B5oBQVEA.d.ts} +1 -1
  37. package/dist/{config-DkHF61xA.d.mts → config-Bx_uh22h.d.mts} +1 -1
  38. package/dist/contexts/index.d.mts +41 -4
  39. package/dist/contexts/index.d.ts +41 -4
  40. package/dist/contexts/index.js +8 -4
  41. package/dist/contexts/index.js.map +1 -1
  42. package/dist/contexts/index.mjs +7 -3
  43. package/dist/core/index.d.mts +51 -11
  44. package/dist/core/index.d.ts +51 -11
  45. package/dist/core/index.js +8 -2
  46. package/dist/core/index.js.map +1 -1
  47. package/dist/core/index.mjs +7 -1
  48. package/dist/index.d.mts +117 -20
  49. package/dist/index.d.ts +117 -20
  50. package/dist/index.js +11 -3
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.mjs +10 -2
  53. package/dist/{notification.interface-DG6obXUH.d.mts → notification.interface-DLZGtV7Z.d.mts} +1 -1
  54. package/dist/{notification.interface-DcSuc9CL.d.ts → notification.interface-aLEJbA_g.d.ts} +1 -1
  55. package/dist/{s3.service-DGilbikH.d.mts → s3.service-CVgLWaDc.d.mts} +2 -2
  56. package/dist/{s3.service-DjwEQJPe.d.ts → s3.service-SLlX0Zbz.d.ts} +2 -2
  57. package/dist/server/index.d.mts +3 -3
  58. package/dist/server/index.d.ts +3 -3
  59. package/dist/server/index.js +3 -3
  60. package/dist/server/index.mjs +1 -1
  61. package/dist/useDataListRetriever-BqJSFBck.d.mts +33 -0
  62. package/dist/useDataListRetriever-BqJSFBck.d.ts +33 -0
  63. package/dist/{useSocket-CmzVtg32.d.mts → useSocket-BkxHHujj.d.mts} +1 -1
  64. package/dist/{useSocket-8eUtnL7J.d.ts → useSocket-CMDjWFYm.d.ts} +1 -1
  65. package/package.json +1 -1
  66. package/src/client/index.ts +0 -4
  67. package/src/components/index.ts +0 -3
  68. package/src/contexts/index.ts +1 -0
  69. package/src/core/index.ts +2 -0
  70. package/src/core/registry/ModuleRegistry.ts +2 -0
  71. package/src/features/assistant/components/parts/AssistantThread.tsx +1 -1
  72. package/src/features/assistant-message/AssistantMessageModule.ts +4 -0
  73. package/src/features/assistant-message/components/MessageItem.tsx +7 -7
  74. package/src/features/assistant-message/components/MessageList.tsx +1 -1
  75. package/src/features/assistant-message/components/__tests__/MessageItem.spec.tsx +11 -7
  76. package/src/features/assistant-message/components/index.ts +1 -0
  77. package/src/features/assistant-message/components/parts/MessageSourcesContainer.tsx +135 -0
  78. package/src/features/assistant-message/components/parts/MessageSourcesPanel.tsx +151 -0
  79. package/src/features/assistant-message/components/parts/RelevanceMeter.tsx +29 -0
  80. package/src/features/assistant-message/components/parts/__tests__/MessageSourcesPanel.spec.tsx +70 -0
  81. package/src/features/assistant-message/components/parts/tabs/CitationsTab.tsx +105 -0
  82. package/src/features/assistant-message/components/parts/tabs/ContentsTab.tsx +88 -0
  83. package/src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx +51 -0
  84. package/src/features/assistant-message/components/parts/tabs/SuggestedQuestionsTab.tsx +24 -0
  85. package/src/features/assistant-message/components/parts/tabs/UsersTab.tsx +142 -0
  86. package/src/features/assistant-message/data/AssistantMessage.ts +20 -0
  87. package/src/features/assistant-message/data/AssistantMessageInterface.ts +2 -0
  88. package/src/features/assistant-message/data/AssistantMessageService.ts +13 -4
  89. package/src/features/assistant-message/data/__tests__/AssistantMessage.citations.spec.ts +65 -0
  90. package/src/features/assistant-message/data/__tests__/AssistantMessage.spec.ts +8 -0
  91. package/src/features/chunk/ChunkModule.ts +18 -0
  92. package/src/features/chunk/data/Chunk.ts +49 -0
  93. package/src/features/chunk/data/ChunkInput.ts +3 -0
  94. package/src/features/chunk/data/ChunkInterface.ts +18 -0
  95. package/src/features/chunk/data/__tests__/Chunk.spec.ts +83 -0
  96. package/src/features/chunk/data/index.ts +3 -0
  97. package/src/features/chunk/index.ts +2 -0
  98. package/src/features/rbac/components/RbacContainer.tsx +318 -49
  99. package/src/features/rbac/components/RbacPermissionPicker.tsx +144 -121
  100. package/src/features/rbac/contexts/RbacContext.tsx +209 -0
  101. package/src/features/rbac/contexts/index.ts +1 -0
  102. package/src/features/rbac/data/RbacMatrixModel.ts +84 -0
  103. package/src/features/rbac/data/RbacService.ts +61 -33
  104. package/src/features/rbac/data/RbacTypes.ts +28 -0
  105. package/src/features/rbac/data/index.ts +1 -0
  106. package/src/features/rbac/index.ts +1 -10
  107. package/src/features/rbac/rbac.module.ts +13 -0
  108. package/dist/ModulePathsInterface-BrdqgteS.d.mts +0 -31
  109. package/dist/ModulePathsInterface-DJKs7s_s.d.ts +0 -31
  110. package/dist/chunk-FDJQRIMY.js.map +0 -1
  111. package/dist/chunk-I65SSQ5Z.mjs.map +0 -1
  112. package/dist/chunk-NB6TIKHK.mjs.map +0 -1
  113. package/dist/chunk-X4YDETTD.js.map +0 -1
  114. package/dist/chunk-ZEDB6JVB.js.map +0 -1
  115. package/dist/useRbacState-C88O-5L8.d.ts +0 -77
  116. package/dist/useRbacState-mqYiRp3J.d.mts +0 -77
  117. package/src/features/assistant-message/components/parts/ReferenceBadges.tsx +0 -46
  118. package/src/features/assistant-message/components/parts/SuggestedFollowUps.tsx +0 -52
  119. package/src/features/assistant-message/components/parts/__tests__/ReferenceBadges.spec.tsx +0 -59
  120. package/src/features/assistant-message/components/parts/__tests__/SuggestedFollowUps.spec.tsx +0 -29
  121. package/src/features/rbac/components/RbacFeatureSection.tsx +0 -66
  122. package/src/features/rbac/components/RbacModuleTable.tsx +0 -121
  123. package/src/features/rbac/components/RbacToolbar.tsx +0 -40
  124. package/src/features/rbac/hooks/useRbacState.test.ts +0 -180
  125. package/src/features/rbac/hooks/useRbacState.ts +0 -319
  126. package/src/features/rbac/utils/RbacMigrationGenerator.test.ts +0 -124
  127. package/src/features/rbac/utils/RbacMigrationGenerator.ts +0 -184
  128. /package/dist/{BlockNoteEditor-JXK3JGKJ.mjs.map → BlockNoteEditor-3M5PD3BZ.mjs.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  AbstractService,
3
3
  EndpointCreator,
4
4
  Modules
5
- } from "./chunk-I65SSQ5Z.mjs";
5
+ } from "./chunk-6UMB5LTQ.mjs";
6
6
  import {
7
7
  setBootstrapper
8
8
  } from "./chunk-BTKJFMFL.mjs";
@@ -194,37 +194,46 @@ var RbacService = class extends AbstractService {
194
194
  static {
195
195
  __name(this, "RbacService");
196
196
  }
197
- static async getFeatures() {
198
- const endpoint = new EndpointCreator({ endpoint: Modules.Feature }).addAdditionalParam("fetchAll", "true");
199
- return this.callApi({
200
- type: Modules.Feature,
197
+ /**
198
+ * Fetch the current RBAC matrix plus each module's known BFS relationship
199
+ * paths (used by the permission picker as scope suggestions).
200
+ *
201
+ * Dev-only endpoint — see class header.
202
+ */
203
+ static async fetchMatrix() {
204
+ const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();
205
+ const model = await this.callApi({
206
+ type: Modules.RbacMatrix,
201
207
  method: "GET" /* GET */,
202
- endpoint: endpoint.generate()
208
+ endpoint
203
209
  });
210
+ return {
211
+ matrix: model.matrix ?? {},
212
+ modulePaths: model.modulePaths ?? {}
213
+ };
204
214
  }
205
- static async getRoles() {
206
- const endpoint = new EndpointCreator({ endpoint: Modules.Role }).addAdditionalParam("fetchAll", "true");
207
- return this.callApi({
208
- type: Modules.Role,
209
- method: "GET" /* GET */,
210
- endpoint: endpoint.generate()
211
- });
212
- }
213
- static async getPermissionMappings() {
214
- const endpoint = new EndpointCreator({ endpoint: Modules.PermissionMapping });
215
- return this.callApi({
216
- type: Modules.PermissionMapping,
217
- method: "GET" /* GET */,
218
- endpoint: endpoint.generate()
219
- });
220
- }
221
- static async getModuleRelationshipPaths() {
222
- const endpoint = new EndpointCreator({ endpoint: Modules.ModulePaths });
223
- return this.callApi({
224
- type: Modules.ModulePaths,
225
- method: "GET" /* GET */,
226
- endpoint: endpoint.generate()
215
+ /**
216
+ * Persist a matrix back to the declarative `permissions.ts` file.
217
+ *
218
+ * The backend serializes the matrix to formatted TypeScript using the
219
+ * provided `roleNames` / `moduleNames` lookup tables (so the emitted file
220
+ * references `RoleId.X` / `ModuleId.X` rather than raw UUIDs) and writes
221
+ * it to `outputPath` (absolute, or relative to the repo root).
222
+ *
223
+ * Dev-only endpoint — see class header.
224
+ */
225
+ static async saveMatrix(args) {
226
+ const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();
227
+ const model = await this.callApi({
228
+ type: Modules.RbacMatrix,
229
+ method: "PUT" /* PUT */,
230
+ endpoint,
231
+ input: args
227
232
  });
233
+ return {
234
+ bytesWritten: model.bytesWritten ?? 0,
235
+ path: model.path ?? ""
236
+ };
228
237
  }
229
238
  };
230
239
 
@@ -259,4 +268,4 @@ export {
259
268
  ACTION_TYPES,
260
269
  RbacService
261
270
  };
262
- //# sourceMappingURL=chunk-NZOUEN67.mjs.map
271
+ //# sourceMappingURL=chunk-PV5V6CVW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client/config.ts","../src/i18n/config.ts","../src/login/config.ts","../src/roles/config.ts","../src/features/waitlist/config/waitlist.config.ts","../src/features/referral/config.ts","../src/features/rbac/data/RbacTypes.ts","../src/features/rbac/data/RbacService.ts"],"sourcesContent":["\"use client\";\n\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { setBootstrapper } from \"../core/registry/bootstrapStore\";\n\n// Config storage for client-side contexts\nlet _clientConfig: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n} | null = null;\n\n/**\n * Configure the JSON:API client. This is the main configuration function.\n * This is typically called during app initialization.\n */\nexport function configureJsonApi(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n}): void {\n _clientConfig = config;\n // Register and call bootstrapper to register all modules\n if (config.bootstrapper) {\n setBootstrapper(config.bootstrapper);\n config.bootstrapper();\n }\n}\n\n/**\n * Configure the client config. This is typically called during app initialization.\n * @deprecated Use configureJsonApi instead\n */\nexport function configureClientConfig(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n}): void {\n _clientConfig = config;\n}\n\n/**\n * Get the configured API URL.\n */\nexport function getApiUrl(): string {\n if (_clientConfig?.apiUrl) {\n return _clientConfig.apiUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_API_URL) {\n return process.env.NEXT_PUBLIC_API_URL;\n }\n return \"\";\n}\n\n/**\n * Get the configured app URL.\n */\nexport function getAppUrl(): string {\n if (_clientConfig?.appUrl) {\n return _clientConfig.appUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_APP_URL) {\n return process.env.NEXT_PUBLIC_APP_URL;\n }\n if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"\";\n}\n\n/**\n * Get the configured trackable pages.\n */\nexport function getTrackablePages(): ModuleWithPermissions[] {\n return _clientConfig?.trackablePages ?? [];\n}\n\n/**\n * Get the configured Stripe publishable key.\n */\nexport function getStripePublishableKey(): string | undefined {\n return _clientConfig?.stripePublishableKey;\n}\n","import { ComponentType } from \"react\";\n\n// Types for injected hooks\nexport interface I18nRouter {\n push: (href: string) => void;\n replace: (href: string) => void;\n back: () => void;\n forward: () => void;\n refresh: () => void;\n prefetch: (href: string) => void;\n}\n\nexport type UseRouterHook = () => I18nRouter;\nexport type UseTranslationsHook = (namespace?: string) => (key: string, values?: Record<string, any>) => string;\nexport type UseLocaleHook = () => string;\n\nexport type UseDateFnsLocaleHook = () => any; // date-fns Locale type\nexport type LinkComponent = ComponentType<{ href: string; children: React.ReactNode; [key: string]: any }>;\n\nexport interface I18nConfig {\n useRouter: UseRouterHook;\n useTranslations: UseTranslationsHook;\n useLocale?: UseLocaleHook;\n useDateFnsLocale?: UseDateFnsLocaleHook;\n Link: LinkComponent;\n usePathname: () => string;\n}\n\n// Private storage\nlet _config: I18nConfig | null = null;\n\n// Configuration function (called by app at startup)\nexport function configureI18n(config: I18nConfig): void {\n _config = config;\n}\n\n// Hooks for library components to use\nexport function useI18nRouter(): I18nRouter {\n if (!_config?.useRouter) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.useRouter();\n}\n\nexport function useI18nTranslations(namespace?: string): (key: string, values?: Record<string, any>) => string {\n if (!_config?.useTranslations) {\n // Fallback: return key as-is (safe for server/client)\n return (key: string) => key;\n }\n return _config.useTranslations(namespace);\n}\n\nexport function getI18nLink(): LinkComponent {\n if (!_config?.Link) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.Link;\n}\n\nexport function useI18nLocale(): string {\n if (_config?.useLocale) {\n return _config.useLocale();\n }\n // Fallback to English (safe for server/client)\n return \"en\";\n}\n\nexport function useI18nDateFnsLocale(): any {\n if (_config?.useDateFnsLocale) {\n return _config.useDateFnsLocale();\n }\n // Fallback to undefined (Calendar will use default)\n return undefined;\n}\n","let _useDiscordAuth: boolean = false;\nlet _useGoogleAuth: boolean = false;\nlet _useInternalAuth: boolean = true;\nlet _allowRegistration: boolean = true;\nlet _registrationMode: \"open\" | \"closed\" | \"waitlist\" = \"open\";\n\nexport type RegistrationMode = \"open\" | \"closed\" | \"waitlist\";\n\nexport interface LoginConfig {\n discordClientId?: string;\n googleClientId?: string;\n useInternalAuth?: boolean;\n allowRegistration?: boolean;\n registrationMode?: RegistrationMode;\n}\n\nexport function configureLogin(params: LoginConfig): void {\n _useDiscordAuth = !!params.discordClientId;\n _useGoogleAuth = !!params.googleClientId;\n _useInternalAuth = params.useInternalAuth ?? true;\n _allowRegistration = params.allowRegistration ?? true;\n _registrationMode = params.registrationMode ?? \"open\";\n}\n\nexport function isDiscordAuthEnabled(): boolean {\n return _useDiscordAuth;\n}\n\nexport function isGoogleAuthEnabled(): boolean {\n return _useGoogleAuth;\n}\n\nexport function isInternalAuthEnabled(): boolean {\n return _useInternalAuth;\n}\n\nexport function isRegistrationAllowed(): boolean {\n return _allowRegistration;\n}\n\nexport function getRegistrationMode(): RegistrationMode {\n return _registrationMode;\n}\n","/**\n * Role ID configuration interface\n * Apps provide their role IDs via configureRoles()\n */\nexport interface RoleIdConfig {\n Administrator: string;\n CompanyAdministrator: string;\n [key: string]: string; // Allow additional roles\n}\n\n// Private storage for the injected role IDs\nlet _roleId: RoleIdConfig | null = null;\n\n/**\n * Configure role IDs for the library\n * Call this at app startup to provide role ID constants\n *\n * @example\n * ```typescript\n * import { configureRoles } from \"@carlonicora/nextjs-jsonapi\";\n * import { RoleId } from \"@phlow/shared\";\n *\n * configureRoles(RoleId);\n * ```\n */\nexport function configureRoles(roleId: RoleIdConfig): void {\n _roleId = roleId;\n}\n\n/**\n * Get configured role IDs\n * @throws Error if roles not configured\n */\nexport function getRoleId(): RoleIdConfig {\n if (!_roleId) {\n throw new Error(\"Roles not configured. Call configureRoles() at app startup.\");\n }\n return _roleId;\n}\n\n/**\n * Check if roles have been configured\n */\nexport function isRolesConfigured(): boolean {\n return _roleId !== null;\n}\n","export type QuestionnaireFieldType = \"text\" | \"textarea\" | \"select\" | \"checkbox\";\n\nexport interface QuestionnaireOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface QuestionnaireField {\n id: string;\n type: QuestionnaireFieldType;\n label: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n options?: QuestionnaireOption[];\n}\n\nexport interface WaitlistConfig {\n questionnaire?: QuestionnaireField[];\n heroTitle?: string;\n heroSubtitle?: string;\n heroDescription?: string;\n benefits?: string[];\n}\n\nlet _waitlistConfig: WaitlistConfig = {};\n\nexport function configureWaitlist(config: WaitlistConfig): void {\n _waitlistConfig = config;\n}\n\nexport function getWaitlistConfig(): WaitlistConfig {\n return _waitlistConfig;\n}\n","/**\n * Configuration interface for frontend referral feature.\n */\nexport interface ReferralConfig {\n /**\n * Whether the referral feature is enabled.\n * When false, components render nothing and hooks return null.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * Name of the cookie used to store referral codes.\n * @default \"referral_code\"\n */\n cookieName?: string;\n\n /**\n * Number of days the referral cookie is valid.\n * @default 30\n */\n cookieDays?: number;\n\n /**\n * Query parameter name for referral code in URL.\n * @default \"ref\"\n */\n urlParamName?: string;\n\n /**\n * Base URL for referral links.\n * @default window.location.origin (client-side only)\n */\n referralUrlBase?: string;\n\n /**\n * Path to append to base URL for referral links.\n * @default \"/\"\n */\n referralPath?: string;\n}\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_REFERRAL_CONFIG: Required<ReferralConfig> = {\n enabled: false,\n cookieName: \"referral_code\",\n cookieDays: 30,\n urlParamName: \"ref\",\n referralUrlBase: \"\",\n referralPath: \"/\",\n};\n\n// Private storage for configuration\nlet _referralConfig: Required<ReferralConfig> = { ...DEFAULT_REFERRAL_CONFIG };\n\n/**\n * Configure referral feature settings.\n * Call this at app startup to enable and configure referral functionality.\n *\n * @example\n * ```typescript\n * import { configureReferral } from \"@carlonicora/nextjs-jsonapi\";\n *\n * configureReferral({\n * enabled: process.env.NEXT_PUBLIC_REFERRAL_ENABLED === 'true',\n * cookieDays: 30,\n * });\n * ```\n */\nexport function configureReferral(config: ReferralConfig): void {\n _referralConfig = { ...DEFAULT_REFERRAL_CONFIG, ...config };\n}\n\n/**\n * Get the current referral configuration.\n * @internal\n */\nexport function getReferralConfig(): Required<ReferralConfig> {\n return _referralConfig;\n}\n\n/**\n * Check if referral feature is enabled.\n */\nexport function isReferralEnabled(): boolean {\n return _referralConfig.enabled;\n}\n","export const COMPANY_ADMINISTRATOR_ROLE_ID = \"2e1eee00-6cba-4506-9059-ccd24e4ea5b0\";\n\nexport type PermissionValue = boolean | string;\n\nexport type ActionType = \"read\" | \"create\" | \"update\" | \"delete\";\n\nexport const ACTION_TYPES: ActionType[] = [\"read\", \"create\", \"update\", \"delete\"];\n\n/** The permissions object shape used by both Module and PermissionMapping entities */\nexport type PermissionsMap = {\n create?: PermissionValue;\n read?: PermissionValue;\n update?: PermissionValue;\n delete?: PermissionValue;\n};\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport { FeatureInterface } from \"../../feature\";\nimport { RoleInterface } from \"../../role\";\nimport { PermissionMappingInterface } from \"./PermissionMappingInterface\";\nimport { ModulePathsInterface } from \"./ModulePathsInterface\";\n\nexport class RbacService extends AbstractService {\n static async getFeatures(): Promise<FeatureInterface[]> {\n const endpoint = new EndpointCreator({ endpoint: Modules.Feature }).addAdditionalParam(\"fetchAll\", \"true\");\n\n return this.callApi<FeatureInterface[]>({\n type: Modules.Feature,\n method: HttpMethod.GET,\n endpoint: endpoint.generate(),\n });\n }\n\n static async getRoles(): Promise<RoleInterface[]> {\n const endpoint = new EndpointCreator({ endpoint: Modules.Role }).addAdditionalParam(\"fetchAll\", \"true\");\n\n return this.callApi<RoleInterface[]>({\n type: Modules.Role,\n method: HttpMethod.GET,\n endpoint: endpoint.generate(),\n });\n }\n\n static async getPermissionMappings(): Promise<PermissionMappingInterface[]> {\n const endpoint = new EndpointCreator({ endpoint: Modules.PermissionMapping });\n\n return this.callApi<PermissionMappingInterface[]>({\n type: Modules.PermissionMapping,\n method: HttpMethod.GET,\n endpoint: endpoint.generate(),\n });\n }\n\n static async getModuleRelationshipPaths(): Promise<ModulePathsInterface[]> {\n const endpoint = new EndpointCreator({ endpoint: Modules.ModulePaths });\n\n return this.callApi<ModulePathsInterface[]>({\n type: Modules.ModulePaths,\n method: HttpMethod.GET,\n endpoint: endpoint.generate(),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,IAAI,gBAOO;AAMJ,SAAS,iBAAiB,QAOxB;AACP,kBAAgB;AAEhB,MAAI,OAAO,cAAc;AACvB,oBAAgB,OAAO,YAAY;AACnC,WAAO,aAAa;AAAA,EACtB;AACF;AAdgB;AAoBT,SAAS,sBAAsB,QAI7B;AACP,kBAAgB;AAClB;AANgB;AAWT,SAAS,YAAoB;AAClC,MAAI,eAAe,QAAQ;AACzB,WAAO,cAAc;AAAA,EACvB;AACA,MAAI,OAAO,YAAY,eAAe,QAAQ,KAAK,qBAAqB;AACtE,WAAO,QAAQ,IAAI;AAAA,EACrB;AACA,SAAO;AACT;AARgB;AAaT,SAAS,YAAoB;AAClC,MAAI,eAAe,QAAQ;AACzB,WAAO,cAAc;AAAA,EACvB;AACA,MAAI,OAAO,YAAY,eAAe,QAAQ,KAAK,qBAAqB;AACtE,WAAO,QAAQ,IAAI;AAAA,EACrB;AACA,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,OAAO,SAAS;AAAA,EACzB;AACA,SAAO;AACT;AAXgB;AAgBT,SAAS,oBAA6C;AAC3D,SAAO,eAAe,kBAAkB,CAAC;AAC3C;AAFgB;AAOT,SAAS,0BAA8C;AAC5D,SAAO,eAAe;AACxB;AAFgB;;;ACzDhB,IAAI,UAA6B;AAG1B,SAAS,cAAc,QAA0B;AACtD,YAAU;AACZ;AAFgB;AAKT,SAAS,gBAA4B;AAC1C,MAAI,CAAC,SAAS,WAAW;AACvB,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAO,QAAQ,UAAU;AAC3B;AALgB;AAOT,SAAS,oBAAoB,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AE5E,WAAO,KAAK,QAAsC;AAAA,MAChD,MAAM,QAAQ;AAAA,MACd;AAAA,MACA,UAAU,SAAS,SAAS;AAAA,IAC9B,CAAC;AAAA,EACH;AAAA,EAEA,aAAa,6BAA8D;AACzE,UAAM,WAAW,IAAI,gBAAgB,EAAE,UAAU,QAAQ,YAAY,CAAC;AAEtE,WAAO,KAAK,QAAgC;AAAA,MAC1C,MAAM,QAAQ;AAAA,MACd;AAAA,MACA,UAAU,SAAS,SAAS;AAAA,IAC9B,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/client/config.ts","../src/i18n/config.ts","../src/login/config.ts","../src/roles/config.ts","../src/features/waitlist/config/waitlist.config.ts","../src/features/referral/config.ts","../src/features/rbac/data/RbacTypes.ts","../src/features/rbac/data/RbacService.ts"],"sourcesContent":["\"use client\";\n\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { setBootstrapper } from \"../core/registry/bootstrapStore\";\n\n// Config storage for client-side contexts\nlet _clientConfig: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n} | null = null;\n\n/**\n * Configure the JSON:API client. This is the main configuration function.\n * This is typically called during app initialization.\n */\nexport function configureJsonApi(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n}): void {\n _clientConfig = config;\n // Register and call bootstrapper to register all modules\n if (config.bootstrapper) {\n setBootstrapper(config.bootstrapper);\n config.bootstrapper();\n }\n}\n\n/**\n * Configure the client config. This is typically called during app initialization.\n * @deprecated Use configureJsonApi instead\n */\nexport function configureClientConfig(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n}): void {\n _clientConfig = config;\n}\n\n/**\n * Get the configured API URL.\n */\nexport function getApiUrl(): string {\n if (_clientConfig?.apiUrl) {\n return _clientConfig.apiUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_API_URL) {\n return process.env.NEXT_PUBLIC_API_URL;\n }\n return \"\";\n}\n\n/**\n * Get the configured app URL.\n */\nexport function getAppUrl(): string {\n if (_clientConfig?.appUrl) {\n return _clientConfig.appUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_APP_URL) {\n return process.env.NEXT_PUBLIC_APP_URL;\n }\n if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"\";\n}\n\n/**\n * Get the configured trackable pages.\n */\nexport function getTrackablePages(): ModuleWithPermissions[] {\n return _clientConfig?.trackablePages ?? [];\n}\n\n/**\n * Get the configured Stripe publishable key.\n */\nexport function getStripePublishableKey(): string | undefined {\n return _clientConfig?.stripePublishableKey;\n}\n","import { ComponentType } from \"react\";\n\n// Types for injected hooks\nexport interface I18nRouter {\n push: (href: string) => void;\n replace: (href: string) => void;\n back: () => void;\n forward: () => void;\n refresh: () => void;\n prefetch: (href: string) => void;\n}\n\nexport type UseRouterHook = () => I18nRouter;\nexport type UseTranslationsHook = (namespace?: string) => (key: string, values?: Record<string, any>) => string;\nexport type UseLocaleHook = () => string;\n\nexport type UseDateFnsLocaleHook = () => any; // date-fns Locale type\nexport type LinkComponent = ComponentType<{ href: string; children: React.ReactNode; [key: string]: any }>;\n\nexport interface I18nConfig {\n useRouter: UseRouterHook;\n useTranslations: UseTranslationsHook;\n useLocale?: UseLocaleHook;\n useDateFnsLocale?: UseDateFnsLocaleHook;\n Link: LinkComponent;\n usePathname: () => string;\n}\n\n// Private storage\nlet _config: I18nConfig | null = null;\n\n// Configuration function (called by app at startup)\nexport function configureI18n(config: I18nConfig): void {\n _config = config;\n}\n\n// Hooks for library components to use\nexport function useI18nRouter(): I18nRouter {\n if (!_config?.useRouter) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.useRouter();\n}\n\nexport function useI18nTranslations(namespace?: string): (key: string, values?: Record<string, any>) => string {\n if (!_config?.useTranslations) {\n // Fallback: return key as-is (safe for server/client)\n return (key: string) => key;\n }\n return _config.useTranslations(namespace);\n}\n\nexport function getI18nLink(): LinkComponent {\n if (!_config?.Link) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.Link;\n}\n\nexport function useI18nLocale(): string {\n if (_config?.useLocale) {\n return _config.useLocale();\n }\n // Fallback to English (safe for server/client)\n return \"en\";\n}\n\nexport function useI18nDateFnsLocale(): any {\n if (_config?.useDateFnsLocale) {\n return _config.useDateFnsLocale();\n }\n // Fallback to undefined (Calendar will use default)\n return undefined;\n}\n","let _useDiscordAuth: boolean = false;\nlet _useGoogleAuth: boolean = false;\nlet _useInternalAuth: boolean = true;\nlet _allowRegistration: boolean = true;\nlet _registrationMode: \"open\" | \"closed\" | \"waitlist\" = \"open\";\n\nexport type RegistrationMode = \"open\" | \"closed\" | \"waitlist\";\n\nexport interface LoginConfig {\n discordClientId?: string;\n googleClientId?: string;\n useInternalAuth?: boolean;\n allowRegistration?: boolean;\n registrationMode?: RegistrationMode;\n}\n\nexport function configureLogin(params: LoginConfig): void {\n _useDiscordAuth = !!params.discordClientId;\n _useGoogleAuth = !!params.googleClientId;\n _useInternalAuth = params.useInternalAuth ?? true;\n _allowRegistration = params.allowRegistration ?? true;\n _registrationMode = params.registrationMode ?? \"open\";\n}\n\nexport function isDiscordAuthEnabled(): boolean {\n return _useDiscordAuth;\n}\n\nexport function isGoogleAuthEnabled(): boolean {\n return _useGoogleAuth;\n}\n\nexport function isInternalAuthEnabled(): boolean {\n return _useInternalAuth;\n}\n\nexport function isRegistrationAllowed(): boolean {\n return _allowRegistration;\n}\n\nexport function getRegistrationMode(): RegistrationMode {\n return _registrationMode;\n}\n","/**\n * Role ID configuration interface\n * Apps provide their role IDs via configureRoles()\n */\nexport interface RoleIdConfig {\n Administrator: string;\n CompanyAdministrator: string;\n [key: string]: string; // Allow additional roles\n}\n\n// Private storage for the injected role IDs\nlet _roleId: RoleIdConfig | null = null;\n\n/**\n * Configure role IDs for the library\n * Call this at app startup to provide role ID constants\n *\n * @example\n * ```typescript\n * import { configureRoles } from \"@carlonicora/nextjs-jsonapi\";\n * import { RoleId } from \"@phlow/shared\";\n *\n * configureRoles(RoleId);\n * ```\n */\nexport function configureRoles(roleId: RoleIdConfig): void {\n _roleId = roleId;\n}\n\n/**\n * Get configured role IDs\n * @throws Error if roles not configured\n */\nexport function getRoleId(): RoleIdConfig {\n if (!_roleId) {\n throw new Error(\"Roles not configured. Call configureRoles() at app startup.\");\n }\n return _roleId;\n}\n\n/**\n * Check if roles have been configured\n */\nexport function isRolesConfigured(): boolean {\n return _roleId !== null;\n}\n","export type QuestionnaireFieldType = \"text\" | \"textarea\" | \"select\" | \"checkbox\";\n\nexport interface QuestionnaireOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface QuestionnaireField {\n id: string;\n type: QuestionnaireFieldType;\n label: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n options?: QuestionnaireOption[];\n}\n\nexport interface WaitlistConfig {\n questionnaire?: QuestionnaireField[];\n heroTitle?: string;\n heroSubtitle?: string;\n heroDescription?: string;\n benefits?: string[];\n}\n\nlet _waitlistConfig: WaitlistConfig = {};\n\nexport function configureWaitlist(config: WaitlistConfig): void {\n _waitlistConfig = config;\n}\n\nexport function getWaitlistConfig(): WaitlistConfig {\n return _waitlistConfig;\n}\n","/**\n * Configuration interface for frontend referral feature.\n */\nexport interface ReferralConfig {\n /**\n * Whether the referral feature is enabled.\n * When false, components render nothing and hooks return null.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * Name of the cookie used to store referral codes.\n * @default \"referral_code\"\n */\n cookieName?: string;\n\n /**\n * Number of days the referral cookie is valid.\n * @default 30\n */\n cookieDays?: number;\n\n /**\n * Query parameter name for referral code in URL.\n * @default \"ref\"\n */\n urlParamName?: string;\n\n /**\n * Base URL for referral links.\n * @default window.location.origin (client-side only)\n */\n referralUrlBase?: string;\n\n /**\n * Path to append to base URL for referral links.\n * @default \"/\"\n */\n referralPath?: string;\n}\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_REFERRAL_CONFIG: Required<ReferralConfig> = {\n enabled: false,\n cookieName: \"referral_code\",\n cookieDays: 30,\n urlParamName: \"ref\",\n referralUrlBase: \"\",\n referralPath: \"/\",\n};\n\n// Private storage for configuration\nlet _referralConfig: Required<ReferralConfig> = { ...DEFAULT_REFERRAL_CONFIG };\n\n/**\n * Configure referral feature settings.\n * Call this at app startup to enable and configure referral functionality.\n *\n * @example\n * ```typescript\n * import { configureReferral } from \"@carlonicora/nextjs-jsonapi\";\n *\n * configureReferral({\n * enabled: process.env.NEXT_PUBLIC_REFERRAL_ENABLED === 'true',\n * cookieDays: 30,\n * });\n * ```\n */\nexport function configureReferral(config: ReferralConfig): void {\n _referralConfig = { ...DEFAULT_REFERRAL_CONFIG, ...config };\n}\n\n/**\n * Get the current referral configuration.\n * @internal\n */\nexport function getReferralConfig(): Required<ReferralConfig> {\n return _referralConfig;\n}\n\n/**\n * Check if referral feature is enabled.\n */\nexport function isReferralEnabled(): boolean {\n return _referralConfig.enabled;\n}\n","export const COMPANY_ADMINISTRATOR_ROLE_ID = \"2e1eee00-6cba-4506-9059-ccd24e4ea5b0\";\n\nexport type PermissionValue = boolean | string;\n\nexport type ActionType = \"read\" | \"create\" | \"update\" | \"delete\";\n\nexport const ACTION_TYPES: ActionType[] = [\"read\", \"create\", \"update\", \"delete\"];\n\n/** The permissions object shape used by both Module and PermissionMapping entities */\nexport type PermissionsMap = {\n create?: PermissionValue;\n read?: PermissionValue;\n update?: PermissionValue;\n delete?: PermissionValue;\n};\n\n/**\n * Declarative-RBAC matrix types.\n *\n * Mirror of the library types defined in\n * `packages/nestjs-neo4jsonapi/src/foundations/rbac/dsl/types.ts`.\n * Frontend does not import from backend, so the shape is redefined here.\n *\n * A `PermToken` represents a single permission entry:\n * - `scope: true` → unconditional (e.g. full read of the module)\n * - `scope: false` → nothing (rarely used, mostly a placeholder)\n * - `scope: \"path\"` → scoped by relationship path (e.g. \"orders.account\")\n */\nexport type PermToken = { action: string; scope: boolean | string };\n\n/**\n * A per-module block of the matrix. Always has a `default` row (permissions\n * granted to every role). Additional keys are role IDs → role-specific\n * permission tokens that are unioned with `default` to produce the effective\n * permissions for that role in that module.\n */\nexport type RbacModuleBlock = { default: PermToken[] } & Record<string, PermToken[]>;\n\n/**\n * The full RBAC matrix as served by the dev endpoint `GET /_dev/rbac/matrix`.\n * Keys are module IDs; values are module blocks.\n */\nexport type RbacMatrix = Record<string, RbacModuleBlock>;\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport type { RbacMatrixModel } from \"./RbacMatrixModel\";\nimport type { RbacMatrix } from \"./RbacTypes\";\n\n/**\n * RbacService — fetches RBAC configuration for the admin UI.\n *\n * Declarative-matrix methods (`fetchMatrix`, `saveMatrix`) talk to the\n * dev-only endpoints added in\n * `packages/nestjs-neo4jsonapi/.../rbac-dev.controller.ts`. The controller\n * speaks JSON:API (singleton resource with `type: \"rbac-matrix\"`, `id:\n * \"singleton\"`), so these methods go through the standard `callApi()`\n * pipeline like every other service in the codebase.\n *\n * The backend only registers these routes when `devMode` is enabled on\n * `RbacModule.register` (see `apps/api/src/features/features.modules.ts`).\n * In production the routes return 404; callers should guard with a dev-mode\n * check.\n */\nexport class RbacService extends AbstractService {\n /**\n * Fetch the current RBAC matrix plus each module's known BFS relationship\n * paths (used by the permission picker as scope suggestions).\n *\n * Dev-only endpoint — see class header.\n */\n static async fetchMatrix(): Promise<{\n matrix: RbacMatrix;\n modulePaths: Record<string, readonly string[]>;\n }> {\n const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();\n\n const model = await this.callApi<RbacMatrixModel>({\n type: Modules.RbacMatrix,\n method: HttpMethod.GET,\n endpoint,\n });\n\n return {\n matrix: model.matrix ?? {},\n modulePaths: model.modulePaths ?? {},\n };\n }\n\n /**\n * Persist a matrix back to the declarative `permissions.ts` file.\n *\n * The backend serializes the matrix to formatted TypeScript using the\n * provided `roleNames` / `moduleNames` lookup tables (so the emitted file\n * references `RoleId.X` / `ModuleId.X` rather than raw UUIDs) and writes\n * it to `outputPath` (absolute, or relative to the repo root).\n *\n * Dev-only endpoint — see class header.\n */\n static async saveMatrix(args: {\n matrix: RbacMatrix;\n roleNames: Record<string, string>;\n moduleNames: Record<string, string>;\n outputPath: string;\n }): Promise<{ bytesWritten: number; path: string }> {\n const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();\n\n const model = await this.callApi<RbacMatrixModel>({\n type: Modules.RbacMatrix,\n method: HttpMethod.PUT,\n endpoint,\n input: args,\n });\n\n return {\n bytesWritten: model.bytesWritten ?? 0,\n path: model.path ?? \"\",\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,IAAI,gBAOO;AAMJ,SAAS,iBAAiB,QAOxB;AACP,kBAAgB;AAEhB,MAAI,OAAO,cAAc;AACvB,oBAAgB,OAAO,YAAY;AACnC,WAAO,aAAa;AAAA,EACtB;AACF;AAdgB;AAoBT,SAAS,sBAAsB,QAI7B;AACP,kBAAgB;AAClB;AANgB;AAWT,SAAS,YAAoB;AAClC,MAAI,eAAe,QAAQ;AACzB,WAAO,cAAc;AAAA,EACvB;AACA,MAAI,OAAO,YAAY,eAAe,QAAQ,KAAK,qBAAqB;AACtE,WAAO,QAAQ,IAAI;AAAA,EACrB;AACA,SAAO;AACT;AARgB;AAaT,SAAS,YAAoB;AAClC,MAAI,eAAe,QAAQ;AACzB,WAAO,cAAc;AAAA,EACvB;AACA,MAAI,OAAO,YAAY,eAAe,QAAQ,KAAK,qBAAqB;AACtE,WAAO,QAAQ,IAAI;AAAA,EACrB;AACA,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,OAAO,SAAS;AAAA,EACzB;AACA,SAAO;AACT;AAXgB;AAgBT,SAAS,oBAA6C;AAC3D,SAAO,eAAe,kBAAkB,CAAC;AAC3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UAAU,CAAC;AAAA,MACzB,aAAa,MAAM,eAAe,CAAC;AAAA,IACrC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,aAAa,WAAW,MAK4B;AAClD,UAAM,WAAW,IAAI,gBAAgB,EAAE,UAAU,QAAQ,WAAW,CAAC,EAAE,SAAS;AAEhF,UAAM,QAAQ,MAAM,KAAK,QAAyB;AAAA,MAChD,MAAM,QAAQ;AAAA,MACd;AAAA,MACA;AAAA,MACA,OAAO;AAAA,IACT,CAAC;AAED,WAAO;AAAA,MACL,cAAc,MAAM,gBAAgB;AAAA,MACpC,MAAM,MAAM,QAAQ;AAAA,IACtB;AAAA,EACF;AACF;","names":[]}
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkFDJQRIMYjs = require('./chunk-FDJQRIMY.js');
5
+ var _chunkN4YZ45SKjs = require('./chunk-N4YZ45SK.js');
6
6
 
7
7
 
8
8
  var _chunk4MN547K7js = require('./chunk-4MN547K7.js');
@@ -190,41 +190,50 @@ var COMPANY_ADMINISTRATOR_ROLE_ID = "2e1eee00-6cba-4506-9059-ccd24e4ea5b0";
190
190
  var ACTION_TYPES = ["read", "create", "update", "delete"];
191
191
 
192
192
  // src/features/rbac/data/RbacService.ts
193
- var RbacService = class extends _chunkFDJQRIMYjs.AbstractService {
193
+ var RbacService = class extends _chunkN4YZ45SKjs.AbstractService {
194
194
  static {
195
195
  _chunk7QVYU63Ejs.__name.call(void 0, this, "RbacService");
196
196
  }
197
- static async getFeatures() {
198
- const endpoint = new (0, _chunkFDJQRIMYjs.EndpointCreator)({ endpoint: _chunkFDJQRIMYjs.Modules.Feature }).addAdditionalParam("fetchAll", "true");
199
- return this.callApi({
200
- type: _chunkFDJQRIMYjs.Modules.Feature,
197
+ /**
198
+ * Fetch the current RBAC matrix plus each module's known BFS relationship
199
+ * paths (used by the permission picker as scope suggestions).
200
+ *
201
+ * Dev-only endpoint — see class header.
202
+ */
203
+ static async fetchMatrix() {
204
+ const endpoint = new (0, _chunkN4YZ45SKjs.EndpointCreator)({ endpoint: _chunkN4YZ45SKjs.Modules.RbacMatrix }).generate();
205
+ const model = await this.callApi({
206
+ type: _chunkN4YZ45SKjs.Modules.RbacMatrix,
201
207
  method: "GET" /* GET */,
202
- endpoint: endpoint.generate()
208
+ endpoint
203
209
  });
210
+ return {
211
+ matrix: _nullishCoalesce(model.matrix, () => ( {})),
212
+ modulePaths: _nullishCoalesce(model.modulePaths, () => ( {}))
213
+ };
204
214
  }
205
- static async getRoles() {
206
- const endpoint = new (0, _chunkFDJQRIMYjs.EndpointCreator)({ endpoint: _chunkFDJQRIMYjs.Modules.Role }).addAdditionalParam("fetchAll", "true");
207
- return this.callApi({
208
- type: _chunkFDJQRIMYjs.Modules.Role,
209
- method: "GET" /* GET */,
210
- endpoint: endpoint.generate()
211
- });
212
- }
213
- static async getPermissionMappings() {
214
- const endpoint = new (0, _chunkFDJQRIMYjs.EndpointCreator)({ endpoint: _chunkFDJQRIMYjs.Modules.PermissionMapping });
215
- return this.callApi({
216
- type: _chunkFDJQRIMYjs.Modules.PermissionMapping,
217
- method: "GET" /* GET */,
218
- endpoint: endpoint.generate()
219
- });
220
- }
221
- static async getModuleRelationshipPaths() {
222
- const endpoint = new (0, _chunkFDJQRIMYjs.EndpointCreator)({ endpoint: _chunkFDJQRIMYjs.Modules.ModulePaths });
223
- return this.callApi({
224
- type: _chunkFDJQRIMYjs.Modules.ModulePaths,
225
- method: "GET" /* GET */,
226
- endpoint: endpoint.generate()
215
+ /**
216
+ * Persist a matrix back to the declarative `permissions.ts` file.
217
+ *
218
+ * The backend serializes the matrix to formatted TypeScript using the
219
+ * provided `roleNames` / `moduleNames` lookup tables (so the emitted file
220
+ * references `RoleId.X` / `ModuleId.X` rather than raw UUIDs) and writes
221
+ * it to `outputPath` (absolute, or relative to the repo root).
222
+ *
223
+ * Dev-only endpoint — see class header.
224
+ */
225
+ static async saveMatrix(args) {
226
+ const endpoint = new (0, _chunkN4YZ45SKjs.EndpointCreator)({ endpoint: _chunkN4YZ45SKjs.Modules.RbacMatrix }).generate();
227
+ const model = await this.callApi({
228
+ type: _chunkN4YZ45SKjs.Modules.RbacMatrix,
229
+ method: "PUT" /* PUT */,
230
+ endpoint,
231
+ input: args
227
232
  });
233
+ return {
234
+ bytesWritten: _nullishCoalesce(model.bytesWritten, () => ( 0)),
235
+ path: _nullishCoalesce(model.path, () => ( ""))
236
+ };
228
237
  }
229
238
  };
230
239
 
@@ -259,4 +268,4 @@ var RbacService = class extends _chunkFDJQRIMYjs.AbstractService {
259
268
 
260
269
 
261
270
  exports.configureJsonApi = configureJsonApi; exports.configureClientConfig = configureClientConfig; exports.getApiUrl = getApiUrl; exports.getAppUrl = getAppUrl; exports.getTrackablePages = getTrackablePages; exports.getStripePublishableKey = getStripePublishableKey; exports.configureI18n = configureI18n; exports.useI18nRouter = useI18nRouter; exports.useI18nTranslations = useI18nTranslations; exports.getI18nLink = getI18nLink; exports.useI18nLocale = useI18nLocale; exports.useI18nDateFnsLocale = useI18nDateFnsLocale; exports.configureLogin = configureLogin; exports.isDiscordAuthEnabled = isDiscordAuthEnabled; exports.isGoogleAuthEnabled = isGoogleAuthEnabled; exports.isInternalAuthEnabled = isInternalAuthEnabled; exports.isRegistrationAllowed = isRegistrationAllowed; exports.getRegistrationMode = getRegistrationMode; exports.configureRoles = configureRoles; exports.getRoleId = getRoleId; exports.isRolesConfigured = isRolesConfigured; exports.configureWaitlist = configureWaitlist; exports.getWaitlistConfig = getWaitlistConfig; exports.configureReferral = configureReferral; exports.getReferralConfig = getReferralConfig; exports.isReferralEnabled = isReferralEnabled; exports.COMPANY_ADMINISTRATOR_ROLE_ID = COMPANY_ADMINISTRATOR_ROLE_ID; exports.ACTION_TYPES = ACTION_TYPES; exports.RbacService = RbacService;
262
- //# sourceMappingURL=chunk-X4YDETTD.js.map
271
+ //# sourceMappingURL=chunk-ZEJSPTHS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-ZEJSPTHS.js","../src/client/config.ts","../src/i18n/config.ts","../src/login/config.ts","../src/roles/config.ts","../src/features/waitlist/config/waitlist.config.ts","../src/features/referral/config.ts","../src/features/rbac/data/RbacTypes.ts","../src/features/rbac/data/RbacService.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACNA,IAAI,cAAA,EAOO,IAAA;AAMJ,SAAS,gBAAA,CAAiB,MAAA,EAOxB;AACP,EAAA,cAAA,EAAgB,MAAA;AAEhB,EAAA,GAAA,CAAI,MAAA,CAAO,YAAA,EAAc;AACvB,IAAA,8CAAA,MAAgB,CAAO,YAAY,CAAA;AACnC,IAAA,MAAA,CAAO,YAAA,CAAa,CAAA;AAAA,EACtB;AACF;AAdgB,qCAAA,gBAAA,EAAA,kBAAA,CAAA;AAoBT,SAAS,qBAAA,CAAsB,MAAA,EAI7B;AACP,EAAA,cAAA,EAAgB,MAAA;AAClB;AANgB,qCAAA,qBAAA,EAAA,uBAAA,CAAA;AAWT,SAAS,SAAA,CAAA,EAAoB;AAClC,EAAA,GAAA,iBAAI,aAAA,2BAAe,QAAA,EAAQ;AACzB,IAAA,OAAO,aAAA,CAAc,MAAA;AAAA,EACvB;AACA,EAAA,GAAA,CAAI,OAAO,QAAA,IAAY,YAAA,mBAAe,OAAA,qBAAQ,GAAA,6BAAK,qBAAA,EAAqB;AACtE,IAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,mBAAA;AAAA,EACrB;AACA,EAAA,OAAO,EAAA;AACT;AARgB,qCAAA,SAAA,EAAA,WAAA,CAAA;AAaT,SAAS,SAAA,CAAA,EAAoB;AAClC,EAAA,GAAA,iBAAI,aAAA,6BAAe,QAAA,EAAQ;AACzB,IAAA,OAAO,aAAA,CAAc,MAAA;AAA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,MAAM,MAAA,EAAQ,MAAM,IAAA,CAAK,OAAA,CAAyB;AAAA,MAChD,IAAA,EAAM,wBAAA,CAAQ,UAAA;AAAA,MACd,MAAA,EAAA,eAAA;AAAA,MACA;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAO;AAAA,MACL,MAAA,mBAAQ,KAAA,CAAM,MAAA,UAAU,CAAC,GAAA;AAAA,MACzB,WAAA,mBAAa,KAAA,CAAM,WAAA,UAAe,CAAC;AAAA,IACrC,CAAA;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,OAAA,MAAa,UAAA,CAAW,IAAA,EAK4B;AAClD,IAAA,MAAM,SAAA,EAAW,IAAI,qCAAA,CAAgB,EAAE,QAAA,EAAU,wBAAA,CAAQ,WAAW,CAAC,CAAA,CAAE,QAAA,CAAS,CAAA;AAEhF,IAAA,MAAM,MAAA,EAAQ,MAAM,IAAA,CAAK,OAAA,CAAyB;AAAA,MAChD,IAAA,EAAM,wBAAA,CAAQ,UAAA;AAAA,MACd,MAAA,EAAA,eAAA;AAAA,MACA,QAAA;AAAA,MACA,KAAA,EAAO;AAAA,IACT,CAAC,CAAA;AAED,IAAA,OAAO;AAAA,MACL,YAAA,mBAAc,KAAA,CAAM,YAAA,UAAgB,GAAA;AAAA,MACpC,IAAA,mBAAM,KAAA,CAAM,IAAA,UAAQ;AAAA,IACtB,CAAA;AAAA,EACF;AACF,CAAA;ARoKA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,8yCAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-ZEJSPTHS.js","sourcesContent":[null,"\"use client\";\n\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { setBootstrapper } from \"../core/registry/bootstrapStore\";\n\n// Config storage for client-side contexts\nlet _clientConfig: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n} | null = null;\n\n/**\n * Configure the JSON:API client. This is the main configuration function.\n * This is typically called during app initialization.\n */\nexport function configureJsonApi(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n}): void {\n _clientConfig = config;\n // Register and call bootstrapper to register all modules\n if (config.bootstrapper) {\n setBootstrapper(config.bootstrapper);\n config.bootstrapper();\n }\n}\n\n/**\n * Configure the client config. This is typically called during app initialization.\n * @deprecated Use configureJsonApi instead\n */\nexport function configureClientConfig(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n}): void {\n _clientConfig = config;\n}\n\n/**\n * Get the configured API URL.\n */\nexport function getApiUrl(): string {\n if (_clientConfig?.apiUrl) {\n return _clientConfig.apiUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_API_URL) {\n return process.env.NEXT_PUBLIC_API_URL;\n }\n return \"\";\n}\n\n/**\n * Get the configured app URL.\n */\nexport function getAppUrl(): string {\n if (_clientConfig?.appUrl) {\n return _clientConfig.appUrl;\n }\n if (typeof process !== \"undefined\" && process.env?.NEXT_PUBLIC_APP_URL) {\n return process.env.NEXT_PUBLIC_APP_URL;\n }\n if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"\";\n}\n\n/**\n * Get the configured trackable pages.\n */\nexport function getTrackablePages(): ModuleWithPermissions[] {\n return _clientConfig?.trackablePages ?? [];\n}\n\n/**\n * Get the configured Stripe publishable key.\n */\nexport function getStripePublishableKey(): string | undefined {\n return _clientConfig?.stripePublishableKey;\n}\n","import { ComponentType } from \"react\";\n\n// Types for injected hooks\nexport interface I18nRouter {\n push: (href: string) => void;\n replace: (href: string) => void;\n back: () => void;\n forward: () => void;\n refresh: () => void;\n prefetch: (href: string) => void;\n}\n\nexport type UseRouterHook = () => I18nRouter;\nexport type UseTranslationsHook = (namespace?: string) => (key: string, values?: Record<string, any>) => string;\nexport type UseLocaleHook = () => string;\n\nexport type UseDateFnsLocaleHook = () => any; // date-fns Locale type\nexport type LinkComponent = ComponentType<{ href: string; children: React.ReactNode; [key: string]: any }>;\n\nexport interface I18nConfig {\n useRouter: UseRouterHook;\n useTranslations: UseTranslationsHook;\n useLocale?: UseLocaleHook;\n useDateFnsLocale?: UseDateFnsLocaleHook;\n Link: LinkComponent;\n usePathname: () => string;\n}\n\n// Private storage\nlet _config: I18nConfig | null = null;\n\n// Configuration function (called by app at startup)\nexport function configureI18n(config: I18nConfig): void {\n _config = config;\n}\n\n// Hooks for library components to use\nexport function useI18nRouter(): I18nRouter {\n if (!_config?.useRouter) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.useRouter();\n}\n\nexport function useI18nTranslations(namespace?: string): (key: string, values?: Record<string, any>) => string {\n if (!_config?.useTranslations) {\n // Fallback: return key as-is (safe for server/client)\n return (key: string) => key;\n }\n return _config.useTranslations(namespace);\n}\n\nexport function getI18nLink(): LinkComponent {\n if (!_config?.Link) {\n throw new Error(\"i18n not configured. Call configureI18n() at app startup.\");\n }\n return _config.Link;\n}\n\nexport function useI18nLocale(): string {\n if (_config?.useLocale) {\n return _config.useLocale();\n }\n // Fallback to English (safe for server/client)\n return \"en\";\n}\n\nexport function useI18nDateFnsLocale(): any {\n if (_config?.useDateFnsLocale) {\n return _config.useDateFnsLocale();\n }\n // Fallback to undefined (Calendar will use default)\n return undefined;\n}\n","let _useDiscordAuth: boolean = false;\nlet _useGoogleAuth: boolean = false;\nlet _useInternalAuth: boolean = true;\nlet _allowRegistration: boolean = true;\nlet _registrationMode: \"open\" | \"closed\" | \"waitlist\" = \"open\";\n\nexport type RegistrationMode = \"open\" | \"closed\" | \"waitlist\";\n\nexport interface LoginConfig {\n discordClientId?: string;\n googleClientId?: string;\n useInternalAuth?: boolean;\n allowRegistration?: boolean;\n registrationMode?: RegistrationMode;\n}\n\nexport function configureLogin(params: LoginConfig): void {\n _useDiscordAuth = !!params.discordClientId;\n _useGoogleAuth = !!params.googleClientId;\n _useInternalAuth = params.useInternalAuth ?? true;\n _allowRegistration = params.allowRegistration ?? true;\n _registrationMode = params.registrationMode ?? \"open\";\n}\n\nexport function isDiscordAuthEnabled(): boolean {\n return _useDiscordAuth;\n}\n\nexport function isGoogleAuthEnabled(): boolean {\n return _useGoogleAuth;\n}\n\nexport function isInternalAuthEnabled(): boolean {\n return _useInternalAuth;\n}\n\nexport function isRegistrationAllowed(): boolean {\n return _allowRegistration;\n}\n\nexport function getRegistrationMode(): RegistrationMode {\n return _registrationMode;\n}\n","/**\n * Role ID configuration interface\n * Apps provide their role IDs via configureRoles()\n */\nexport interface RoleIdConfig {\n Administrator: string;\n CompanyAdministrator: string;\n [key: string]: string; // Allow additional roles\n}\n\n// Private storage for the injected role IDs\nlet _roleId: RoleIdConfig | null = null;\n\n/**\n * Configure role IDs for the library\n * Call this at app startup to provide role ID constants\n *\n * @example\n * ```typescript\n * import { configureRoles } from \"@carlonicora/nextjs-jsonapi\";\n * import { RoleId } from \"@phlow/shared\";\n *\n * configureRoles(RoleId);\n * ```\n */\nexport function configureRoles(roleId: RoleIdConfig): void {\n _roleId = roleId;\n}\n\n/**\n * Get configured role IDs\n * @throws Error if roles not configured\n */\nexport function getRoleId(): RoleIdConfig {\n if (!_roleId) {\n throw new Error(\"Roles not configured. Call configureRoles() at app startup.\");\n }\n return _roleId;\n}\n\n/**\n * Check if roles have been configured\n */\nexport function isRolesConfigured(): boolean {\n return _roleId !== null;\n}\n","export type QuestionnaireFieldType = \"text\" | \"textarea\" | \"select\" | \"checkbox\";\n\nexport interface QuestionnaireOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface QuestionnaireField {\n id: string;\n type: QuestionnaireFieldType;\n label: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n options?: QuestionnaireOption[];\n}\n\nexport interface WaitlistConfig {\n questionnaire?: QuestionnaireField[];\n heroTitle?: string;\n heroSubtitle?: string;\n heroDescription?: string;\n benefits?: string[];\n}\n\nlet _waitlistConfig: WaitlistConfig = {};\n\nexport function configureWaitlist(config: WaitlistConfig): void {\n _waitlistConfig = config;\n}\n\nexport function getWaitlistConfig(): WaitlistConfig {\n return _waitlistConfig;\n}\n","/**\n * Configuration interface for frontend referral feature.\n */\nexport interface ReferralConfig {\n /**\n * Whether the referral feature is enabled.\n * When false, components render nothing and hooks return null.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * Name of the cookie used to store referral codes.\n * @default \"referral_code\"\n */\n cookieName?: string;\n\n /**\n * Number of days the referral cookie is valid.\n * @default 30\n */\n cookieDays?: number;\n\n /**\n * Query parameter name for referral code in URL.\n * @default \"ref\"\n */\n urlParamName?: string;\n\n /**\n * Base URL for referral links.\n * @default window.location.origin (client-side only)\n */\n referralUrlBase?: string;\n\n /**\n * Path to append to base URL for referral links.\n * @default \"/\"\n */\n referralPath?: string;\n}\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_REFERRAL_CONFIG: Required<ReferralConfig> = {\n enabled: false,\n cookieName: \"referral_code\",\n cookieDays: 30,\n urlParamName: \"ref\",\n referralUrlBase: \"\",\n referralPath: \"/\",\n};\n\n// Private storage for configuration\nlet _referralConfig: Required<ReferralConfig> = { ...DEFAULT_REFERRAL_CONFIG };\n\n/**\n * Configure referral feature settings.\n * Call this at app startup to enable and configure referral functionality.\n *\n * @example\n * ```typescript\n * import { configureReferral } from \"@carlonicora/nextjs-jsonapi\";\n *\n * configureReferral({\n * enabled: process.env.NEXT_PUBLIC_REFERRAL_ENABLED === 'true',\n * cookieDays: 30,\n * });\n * ```\n */\nexport function configureReferral(config: ReferralConfig): void {\n _referralConfig = { ...DEFAULT_REFERRAL_CONFIG, ...config };\n}\n\n/**\n * Get the current referral configuration.\n * @internal\n */\nexport function getReferralConfig(): Required<ReferralConfig> {\n return _referralConfig;\n}\n\n/**\n * Check if referral feature is enabled.\n */\nexport function isReferralEnabled(): boolean {\n return _referralConfig.enabled;\n}\n","export const COMPANY_ADMINISTRATOR_ROLE_ID = \"2e1eee00-6cba-4506-9059-ccd24e4ea5b0\";\n\nexport type PermissionValue = boolean | string;\n\nexport type ActionType = \"read\" | \"create\" | \"update\" | \"delete\";\n\nexport const ACTION_TYPES: ActionType[] = [\"read\", \"create\", \"update\", \"delete\"];\n\n/** The permissions object shape used by both Module and PermissionMapping entities */\nexport type PermissionsMap = {\n create?: PermissionValue;\n read?: PermissionValue;\n update?: PermissionValue;\n delete?: PermissionValue;\n};\n\n/**\n * Declarative-RBAC matrix types.\n *\n * Mirror of the library types defined in\n * `packages/nestjs-neo4jsonapi/src/foundations/rbac/dsl/types.ts`.\n * Frontend does not import from backend, so the shape is redefined here.\n *\n * A `PermToken` represents a single permission entry:\n * - `scope: true` → unconditional (e.g. full read of the module)\n * - `scope: false` → nothing (rarely used, mostly a placeholder)\n * - `scope: \"path\"` → scoped by relationship path (e.g. \"orders.account\")\n */\nexport type PermToken = { action: string; scope: boolean | string };\n\n/**\n * A per-module block of the matrix. Always has a `default` row (permissions\n * granted to every role). Additional keys are role IDs → role-specific\n * permission tokens that are unioned with `default` to produce the effective\n * permissions for that role in that module.\n */\nexport type RbacModuleBlock = { default: PermToken[] } & Record<string, PermToken[]>;\n\n/**\n * The full RBAC matrix as served by the dev endpoint `GET /_dev/rbac/matrix`.\n * Keys are module IDs; values are module blocks.\n */\nexport type RbacMatrix = Record<string, RbacModuleBlock>;\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport type { RbacMatrixModel } from \"./RbacMatrixModel\";\nimport type { RbacMatrix } from \"./RbacTypes\";\n\n/**\n * RbacService — fetches RBAC configuration for the admin UI.\n *\n * Declarative-matrix methods (`fetchMatrix`, `saveMatrix`) talk to the\n * dev-only endpoints added in\n * `packages/nestjs-neo4jsonapi/.../rbac-dev.controller.ts`. The controller\n * speaks JSON:API (singleton resource with `type: \"rbac-matrix\"`, `id:\n * \"singleton\"`), so these methods go through the standard `callApi()`\n * pipeline like every other service in the codebase.\n *\n * The backend only registers these routes when `devMode` is enabled on\n * `RbacModule.register` (see `apps/api/src/features/features.modules.ts`).\n * In production the routes return 404; callers should guard with a dev-mode\n * check.\n */\nexport class RbacService extends AbstractService {\n /**\n * Fetch the current RBAC matrix plus each module's known BFS relationship\n * paths (used by the permission picker as scope suggestions).\n *\n * Dev-only endpoint — see class header.\n */\n static async fetchMatrix(): Promise<{\n matrix: RbacMatrix;\n modulePaths: Record<string, readonly string[]>;\n }> {\n const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();\n\n const model = await this.callApi<RbacMatrixModel>({\n type: Modules.RbacMatrix,\n method: HttpMethod.GET,\n endpoint,\n });\n\n return {\n matrix: model.matrix ?? {},\n modulePaths: model.modulePaths ?? {},\n };\n }\n\n /**\n * Persist a matrix back to the declarative `permissions.ts` file.\n *\n * The backend serializes the matrix to formatted TypeScript using the\n * provided `roleNames` / `moduleNames` lookup tables (so the emitted file\n * references `RoleId.X` / `ModuleId.X` rather than raw UUIDs) and writes\n * it to `outputPath` (absolute, or relative to the repo root).\n *\n * Dev-only endpoint — see class header.\n */\n static async saveMatrix(args: {\n matrix: RbacMatrix;\n roleNames: Record<string, string>;\n moduleNames: Record<string, string>;\n outputPath: string;\n }): Promise<{ bytesWritten: number; path: string }> {\n const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();\n\n const model = await this.callApi<RbacMatrixModel>({\n type: Modules.RbacMatrix,\n method: HttpMethod.PUT,\n endpoint,\n input: args,\n });\n\n return {\n bytesWritten: model.bytesWritten ?? 0,\n path: model.path ?? \"\",\n };\n }\n}\n"]}
@@ -7,15 +7,14 @@ import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from '../Api
7
7
  import { A as ApiRequestDataTypeInterface } from '../ApiRequestDataTypeInterface-CYEcRUrh.mjs';
8
8
  import { A as ApiResponseInterface } from '../ApiResponseInterface-rsXRL_Hn.mjs';
9
9
  import { A as ApiData } from '../ApiData-DPKNfY-9.mjs';
10
- import { M as ModuleWithPermissions, b as PageUrl, C as ContentInterface, R as RoleInterface, U as UserInterface } from '../notification.interface-DG6obXUH.mjs';
11
- export { I as I18nConfig, l as I18nRouter, L as LinkComponent, U as UseDateFnsLocaleHook, m as UseLocaleHook, n as UseRouterHook, o as UseTranslationsHook, f as configureClientConfig, e as configureI18n, c as configureJsonApi, g as getApiUrl, a as getAppUrl, h as getI18nLink, d as getStripePublishableKey, b as getTrackablePages, u as useI18nDateFnsLocale, i as useI18nLocale, j as useI18nRouter, k as useI18nTranslations } from '../config-DkHF61xA.mjs';
10
+ import { M as ModuleWithPermissions, b as PageUrl, C as ContentInterface, l as RoleInterface, U as UserInterface } from '../notification.interface-DLZGtV7Z.mjs';
11
+ export { I as I18nConfig, l as I18nRouter, L as LinkComponent, U as UseDateFnsLocaleHook, m as UseLocaleHook, n as UseRouterHook, o as UseTranslationsHook, f as configureClientConfig, e as configureI18n, c as configureJsonApi, g as getApiUrl, a as getAppUrl, h as getI18nLink, d as getStripePublishableKey, b as getTrackablePages, u as useI18nDateFnsLocale, i as useI18nLocale, j as useI18nRouter, k as useI18nTranslations } from '../config-Bx_uh22h.mjs';
12
12
  import { ColumnDef } from '@tanstack/react-table';
13
- import { D as DataListRetriever } from '../useRbacState-mqYiRp3J.mjs';
14
- export { a as useDataListRetriever, u as useRbacState } from '../useRbacState-mqYiRp3J.mjs';
13
+ import { D as DataListRetriever } from '../useDataListRetriever-BqJSFBck.mjs';
14
+ export { u as useDataListRetriever } from '../useDataListRetriever-BqJSFBck.mjs';
15
15
  import { a as D3Node, D as D3Link, C as ContentFields, R as RoleFields, U as UserFields } from '../content.fields-Ck5lkQ5d.mjs';
16
- export { u as useSocket } from '../useSocket-CmzVtg32.mjs';
16
+ export { u as useSocket } from '../useSocket-BkxHHujj.mjs';
17
17
  import { O as OAuthClientInterface, b as OAuthClientCreateRequest, c as OAuthClientCreateResponse, a as OAuthClientInput, f as OAuthConsentInfo, d as OAuthConsentRequest } from '../oauth.interface-o5FLpiN7.mjs';
18
- import { b as PermissionsMap } from '../ModulePathsInterface-BrdqgteS.mjs';
19
18
  import 'lucide-react';
20
19
  import '../feature.interface-CXb1-vNq.mjs';
21
20
  import 'd3';
@@ -498,21 +497,4 @@ interface TrialSubscriptionStatus {
498
497
  }
499
498
  declare function useSubscriptionStatus(): TrialSubscriptionStatus;
500
499
 
501
- interface EffectiveFeature {
502
- id: string;
503
- name: string;
504
- isCore: boolean;
505
- modules: Array<{
506
- id: string;
507
- name: string;
508
- permissions: PermissionsMap;
509
- }>;
510
- }
511
- declare function generateMigrationFile(params: {
512
- features: EffectiveFeature[];
513
- roles: RoleInterface[];
514
- rolePermissionsMap: Map<string, PermissionsMap>;
515
- }): string;
516
- declare function downloadMigrationFile(content: string): void;
517
-
518
- export { ClientJsonApiDelete, ClientJsonApiGet, ClientJsonApiPatch, ClientJsonApiPost, ClientJsonApiPut, DataListRetriever, type DirectFetchParams, JsonApiConfig, JsonApiProvider, type JsonApiProviderProps, type MutationMethod, type MutationParams, type TableContent, TableGeneratorRegistry, type TableStructureGeneratorInterface, type TrialSubscriptionStatus, type UseJsonApiGetOptions, type UseJsonApiGetResult, type UseJsonApiMutationResult, type UseOAuthClientReturn, type UseOAuthClientsReturn, type UseOAuthConsentReturn, type UseTableStructureHook, type UseTableStructureHookParams, type UseTableStructureHookReturn, configureClientJsonApi, directFetch, downloadMigrationFile, generateMigrationFile, getClientApiUrl, getClientAppUrl, getClientToken, getClientTrackablePages, registerTableGenerator, tableGeneratorRegistry, useContentTableStructure, useCustomD3Graph, useDebounce, useJsonApiGet, useJsonApiMutation, useNotificationSync, useOAuthClient, useOAuthClients, useOAuthConsent, usePageTracker, usePageUrlGenerator, useRehydration, useRehydrationList, useRoleTableStructure, useSubscriptionStatus, useTableGenerator, useUrlRewriter, useUserSearch, useUserTableStructure };
500
+ export { ClientJsonApiDelete, ClientJsonApiGet, ClientJsonApiPatch, ClientJsonApiPost, ClientJsonApiPut, DataListRetriever, type DirectFetchParams, JsonApiConfig, JsonApiProvider, type JsonApiProviderProps, type MutationMethod, type MutationParams, type TableContent, TableGeneratorRegistry, type TableStructureGeneratorInterface, type TrialSubscriptionStatus, type UseJsonApiGetOptions, type UseJsonApiGetResult, type UseJsonApiMutationResult, type UseOAuthClientReturn, type UseOAuthClientsReturn, type UseOAuthConsentReturn, type UseTableStructureHook, type UseTableStructureHookParams, type UseTableStructureHookReturn, configureClientJsonApi, directFetch, getClientApiUrl, getClientAppUrl, getClientToken, getClientTrackablePages, registerTableGenerator, tableGeneratorRegistry, useContentTableStructure, useCustomD3Graph, useDebounce, useJsonApiGet, useJsonApiMutation, useNotificationSync, useOAuthClient, useOAuthClients, useOAuthConsent, usePageTracker, usePageUrlGenerator, useRehydration, useRehydrationList, useRoleTableStructure, useSubscriptionStatus, useTableGenerator, useUrlRewriter, useUserSearch, useUserTableStructure };
@@ -7,15 +7,14 @@ import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from '../Api
7
7
  import { A as ApiRequestDataTypeInterface } from '../ApiRequestDataTypeInterface-CYEcRUrh.js';
8
8
  import { A as ApiResponseInterface } from '../ApiResponseInterface-CWLvSCvS.js';
9
9
  import { A as ApiData } from '../ApiData-DPKNfY-9.js';
10
- import { M as ModuleWithPermissions, b as PageUrl, C as ContentInterface, R as RoleInterface, U as UserInterface } from '../notification.interface-DcSuc9CL.js';
11
- export { I as I18nConfig, l as I18nRouter, L as LinkComponent, U as UseDateFnsLocaleHook, m as UseLocaleHook, n as UseRouterHook, o as UseTranslationsHook, f as configureClientConfig, e as configureI18n, c as configureJsonApi, g as getApiUrl, a as getAppUrl, h as getI18nLink, d as getStripePublishableKey, b as getTrackablePages, u as useI18nDateFnsLocale, i as useI18nLocale, j as useI18nRouter, k as useI18nTranslations } from '../config-B3jKt9P7.js';
10
+ import { M as ModuleWithPermissions, b as PageUrl, C as ContentInterface, l as RoleInterface, U as UserInterface } from '../notification.interface-aLEJbA_g.js';
11
+ export { I as I18nConfig, l as I18nRouter, L as LinkComponent, U as UseDateFnsLocaleHook, m as UseLocaleHook, n as UseRouterHook, o as UseTranslationsHook, f as configureClientConfig, e as configureI18n, c as configureJsonApi, g as getApiUrl, a as getAppUrl, h as getI18nLink, d as getStripePublishableKey, b as getTrackablePages, u as useI18nDateFnsLocale, i as useI18nLocale, j as useI18nRouter, k as useI18nTranslations } from '../config-B5oBQVEA.js';
12
12
  import { ColumnDef } from '@tanstack/react-table';
13
- import { D as DataListRetriever } from '../useRbacState-C88O-5L8.js';
14
- export { a as useDataListRetriever, u as useRbacState } from '../useRbacState-C88O-5L8.js';
13
+ import { D as DataListRetriever } from '../useDataListRetriever-BqJSFBck.js';
14
+ export { u as useDataListRetriever } from '../useDataListRetriever-BqJSFBck.js';
15
15
  import { a as D3Node, D as D3Link, C as ContentFields, R as RoleFields, U as UserFields } from '../content.fields-Ck5lkQ5d.js';
16
- export { u as useSocket } from '../useSocket-8eUtnL7J.js';
16
+ export { u as useSocket } from '../useSocket-CMDjWFYm.js';
17
17
  import { O as OAuthClientInterface, b as OAuthClientCreateRequest, c as OAuthClientCreateResponse, a as OAuthClientInput, f as OAuthConsentInfo, d as OAuthConsentRequest } from '../oauth.interface-B6xmfDzK.js';
18
- import { b as PermissionsMap } from '../ModulePathsInterface-DJKs7s_s.js';
19
18
  import 'lucide-react';
20
19
  import '../feature.interface-BO25VLlx.js';
21
20
  import 'd3';
@@ -498,21 +497,4 @@ interface TrialSubscriptionStatus {
498
497
  }
499
498
  declare function useSubscriptionStatus(): TrialSubscriptionStatus;
500
499
 
501
- interface EffectiveFeature {
502
- id: string;
503
- name: string;
504
- isCore: boolean;
505
- modules: Array<{
506
- id: string;
507
- name: string;
508
- permissions: PermissionsMap;
509
- }>;
510
- }
511
- declare function generateMigrationFile(params: {
512
- features: EffectiveFeature[];
513
- roles: RoleInterface[];
514
- rolePermissionsMap: Map<string, PermissionsMap>;
515
- }): string;
516
- declare function downloadMigrationFile(content: string): void;
517
-
518
- export { ClientJsonApiDelete, ClientJsonApiGet, ClientJsonApiPatch, ClientJsonApiPost, ClientJsonApiPut, DataListRetriever, type DirectFetchParams, JsonApiConfig, JsonApiProvider, type JsonApiProviderProps, type MutationMethod, type MutationParams, type TableContent, TableGeneratorRegistry, type TableStructureGeneratorInterface, type TrialSubscriptionStatus, type UseJsonApiGetOptions, type UseJsonApiGetResult, type UseJsonApiMutationResult, type UseOAuthClientReturn, type UseOAuthClientsReturn, type UseOAuthConsentReturn, type UseTableStructureHook, type UseTableStructureHookParams, type UseTableStructureHookReturn, configureClientJsonApi, directFetch, downloadMigrationFile, generateMigrationFile, getClientApiUrl, getClientAppUrl, getClientToken, getClientTrackablePages, registerTableGenerator, tableGeneratorRegistry, useContentTableStructure, useCustomD3Graph, useDebounce, useJsonApiGet, useJsonApiMutation, useNotificationSync, useOAuthClient, useOAuthClients, useOAuthConsent, usePageTracker, usePageUrlGenerator, useRehydration, useRehydrationList, useRoleTableStructure, useSubscriptionStatus, useTableGenerator, useUrlRewriter, useUserSearch, useUserTableStructure };
500
+ export { ClientJsonApiDelete, ClientJsonApiGet, ClientJsonApiPatch, ClientJsonApiPost, ClientJsonApiPut, DataListRetriever, type DirectFetchParams, JsonApiConfig, JsonApiProvider, type JsonApiProviderProps, type MutationMethod, type MutationParams, type TableContent, TableGeneratorRegistry, type TableStructureGeneratorInterface, type TrialSubscriptionStatus, type UseJsonApiGetOptions, type UseJsonApiGetResult, type UseJsonApiMutationResult, type UseOAuthClientReturn, type UseOAuthClientsReturn, type UseOAuthConsentReturn, type UseTableStructureHook, type UseTableStructureHookParams, type UseTableStructureHookReturn, configureClientJsonApi, directFetch, getClientApiUrl, getClientAppUrl, getClientToken, getClientTrackablePages, registerTableGenerator, tableGeneratorRegistry, useContentTableStructure, useCustomD3Graph, useDebounce, useJsonApiGet, useJsonApiMutation, useNotificationSync, useOAuthClient, useOAuthClients, useOAuthConsent, usePageTracker, usePageUrlGenerator, useRehydration, useRehydrationList, useRoleTableStructure, useSubscriptionStatus, useTableGenerator, useUrlRewriter, useUserSearch, useUserTableStructure };
@@ -26,10 +26,10 @@
26
26
 
27
27
 
28
28
 
29
+ var _chunk4NOQNTFIjs = require('../chunk-4NOQNTFI.js');
29
30
 
30
31
 
31
32
 
32
- var _chunkZEDB6JVBjs = require('../chunk-ZEDB6JVB.js');
33
33
 
34
34
 
35
35
 
@@ -40,10 +40,10 @@ var _chunkZEDB6JVBjs = require('../chunk-ZEDB6JVB.js');
40
40
 
41
41
 
42
42
 
43
+ var _chunkZEJSPTHSjs = require('../chunk-ZEJSPTHS.js');
43
44
 
44
45
 
45
46
 
46
- var _chunkX4YDETTDjs = require('../chunk-X4YDETTD.js');
47
47
 
48
48
 
49
49
 
@@ -51,10 +51,7 @@ var _chunkX4YDETTDjs = require('../chunk-X4YDETTD.js');
51
51
 
52
52
 
53
53
 
54
-
55
-
56
-
57
- var _chunkFDJQRIMYjs = require('../chunk-FDJQRIMY.js');
54
+ var _chunkN4YZ45SKjs = require('../chunk-N4YZ45SK.js');
58
55
 
59
56
 
60
57
  var _chunkLXKSUWAVjs = require('../chunk-LXKSUWAV.js');
@@ -120,8 +117,5 @@ require('../chunk-7QVYU63E.js');
120
117
 
121
118
 
122
119
 
123
-
124
-
125
-
126
- exports.ClientJsonApiDelete = _chunkFDJQRIMYjs.ClientJsonApiDelete; exports.ClientJsonApiGet = _chunkFDJQRIMYjs.ClientJsonApiGet; exports.ClientJsonApiPatch = _chunkFDJQRIMYjs.ClientJsonApiPatch; exports.ClientJsonApiPost = _chunkFDJQRIMYjs.ClientJsonApiPost; exports.ClientJsonApiPut = _chunkFDJQRIMYjs.ClientJsonApiPut; exports.JsonApiContext = _chunk3EPNHTMHjs.JsonApiContext; exports.JsonApiProvider = _chunkZEDB6JVBjs.JsonApiProvider; exports.TableGeneratorRegistry = _chunkZEDB6JVBjs.TableGeneratorRegistry; exports.configureClientConfig = _chunkX4YDETTDjs.configureClientConfig; exports.configureClientJsonApi = _chunkFDJQRIMYjs.configureClientJsonApi; exports.configureI18n = _chunkX4YDETTDjs.configureI18n; exports.configureJsonApi = _chunkX4YDETTDjs.configureJsonApi; exports.directFetch = _chunkIBS6NI7Djs.directFetch; exports.downloadMigrationFile = _chunkZEDB6JVBjs.downloadMigrationFile; exports.generateMigrationFile = _chunkZEDB6JVBjs.generateMigrationFile; exports.getApiUrl = _chunkX4YDETTDjs.getApiUrl; exports.getAppUrl = _chunkX4YDETTDjs.getAppUrl; exports.getClientApiUrl = _chunkFDJQRIMYjs.getClientApiUrl; exports.getClientAppUrl = _chunkFDJQRIMYjs.getClientAppUrl; exports.getClientToken = _chunkLXKSUWAVjs.getClientToken; exports.getClientTrackablePages = _chunkFDJQRIMYjs.getClientTrackablePages; exports.getI18nLink = _chunkX4YDETTDjs.getI18nLink; exports.getStripePublishableKey = _chunkX4YDETTDjs.getStripePublishableKey; exports.getTrackablePages = _chunkX4YDETTDjs.getTrackablePages; exports.registerTableGenerator = _chunkZEDB6JVBjs.registerTableGenerator; exports.tableGeneratorRegistry = _chunkZEDB6JVBjs.tableGeneratorRegistry; exports.useContentTableStructure = _chunkZEDB6JVBjs.useContentTableStructure; exports.useCustomD3Graph = _chunkZEDB6JVBjs.useCustomD3Graph; exports.useDataListRetriever = _chunkZEDB6JVBjs.useDataListRetriever; exports.useDebounce = _chunkZEDB6JVBjs.useDebounce; exports.useI18nDateFnsLocale = _chunkX4YDETTDjs.useI18nDateFnsLocale; exports.useI18nLocale = _chunkX4YDETTDjs.useI18nLocale; exports.useI18nRouter = _chunkX4YDETTDjs.useI18nRouter; exports.useI18nTranslations = _chunkX4YDETTDjs.useI18nTranslations; exports.useJsonApiConfig = _chunk3EPNHTMHjs.useJsonApiConfig; exports.useJsonApiConfigOptional = _chunk3EPNHTMHjs.useJsonApiConfigOptional; exports.useJsonApiGet = _chunkZEDB6JVBjs.useJsonApiGet; exports.useJsonApiMutation = _chunkZEDB6JVBjs.useJsonApiMutation; exports.useNotificationSync = _chunkZEDB6JVBjs.useNotificationSync; exports.useOAuthClient = _chunkZEDB6JVBjs.useOAuthClient; exports.useOAuthClients = _chunkZEDB6JVBjs.useOAuthClients; exports.useOAuthConsent = _chunkZEDB6JVBjs.useOAuthConsent; exports.usePageTracker = _chunkZEDB6JVBjs.usePageTracker; exports.usePageUrlGenerator = _chunkZEDB6JVBjs.usePageUrlGenerator; exports.useRbacState = _chunkZEDB6JVBjs.useRbacState; exports.useRehydration = _chunkZEDB6JVBjs.useRehydration; exports.useRehydrationList = _chunkZEDB6JVBjs.useRehydrationList; exports.useRoleTableStructure = _chunkZEDB6JVBjs.useRoleTableStructure; exports.useSocket = _chunkZEDB6JVBjs.useSocket; exports.useSubscriptionStatus = _chunkZEDB6JVBjs.useSubscriptionStatus; exports.useTableGenerator = _chunkZEDB6JVBjs.useTableGenerator; exports.useUrlRewriter = _chunkZEDB6JVBjs.useUrlRewriter; exports.useUserSearch = _chunkZEDB6JVBjs.useUserSearch; exports.useUserTableStructure = _chunkZEDB6JVBjs.useUserTableStructure;
120
+ exports.ClientJsonApiDelete = _chunkN4YZ45SKjs.ClientJsonApiDelete; exports.ClientJsonApiGet = _chunkN4YZ45SKjs.ClientJsonApiGet; exports.ClientJsonApiPatch = _chunkN4YZ45SKjs.ClientJsonApiPatch; exports.ClientJsonApiPost = _chunkN4YZ45SKjs.ClientJsonApiPost; exports.ClientJsonApiPut = _chunkN4YZ45SKjs.ClientJsonApiPut; exports.JsonApiContext = _chunk3EPNHTMHjs.JsonApiContext; exports.JsonApiProvider = _chunk4NOQNTFIjs.JsonApiProvider; exports.TableGeneratorRegistry = _chunk4NOQNTFIjs.TableGeneratorRegistry; exports.configureClientConfig = _chunkZEJSPTHSjs.configureClientConfig; exports.configureClientJsonApi = _chunkN4YZ45SKjs.configureClientJsonApi; exports.configureI18n = _chunkZEJSPTHSjs.configureI18n; exports.configureJsonApi = _chunkZEJSPTHSjs.configureJsonApi; exports.directFetch = _chunkIBS6NI7Djs.directFetch; exports.getApiUrl = _chunkZEJSPTHSjs.getApiUrl; exports.getAppUrl = _chunkZEJSPTHSjs.getAppUrl; exports.getClientApiUrl = _chunkN4YZ45SKjs.getClientApiUrl; exports.getClientAppUrl = _chunkN4YZ45SKjs.getClientAppUrl; exports.getClientToken = _chunkLXKSUWAVjs.getClientToken; exports.getClientTrackablePages = _chunkN4YZ45SKjs.getClientTrackablePages; exports.getI18nLink = _chunkZEJSPTHSjs.getI18nLink; exports.getStripePublishableKey = _chunkZEJSPTHSjs.getStripePublishableKey; exports.getTrackablePages = _chunkZEJSPTHSjs.getTrackablePages; exports.registerTableGenerator = _chunk4NOQNTFIjs.registerTableGenerator; exports.tableGeneratorRegistry = _chunk4NOQNTFIjs.tableGeneratorRegistry; exports.useContentTableStructure = _chunk4NOQNTFIjs.useContentTableStructure; exports.useCustomD3Graph = _chunk4NOQNTFIjs.useCustomD3Graph; exports.useDataListRetriever = _chunk4NOQNTFIjs.useDataListRetriever; exports.useDebounce = _chunk4NOQNTFIjs.useDebounce; exports.useI18nDateFnsLocale = _chunkZEJSPTHSjs.useI18nDateFnsLocale; exports.useI18nLocale = _chunkZEJSPTHSjs.useI18nLocale; exports.useI18nRouter = _chunkZEJSPTHSjs.useI18nRouter; exports.useI18nTranslations = _chunkZEJSPTHSjs.useI18nTranslations; exports.useJsonApiConfig = _chunk3EPNHTMHjs.useJsonApiConfig; exports.useJsonApiConfigOptional = _chunk3EPNHTMHjs.useJsonApiConfigOptional; exports.useJsonApiGet = _chunk4NOQNTFIjs.useJsonApiGet; exports.useJsonApiMutation = _chunk4NOQNTFIjs.useJsonApiMutation; exports.useNotificationSync = _chunk4NOQNTFIjs.useNotificationSync; exports.useOAuthClient = _chunk4NOQNTFIjs.useOAuthClient; exports.useOAuthClients = _chunk4NOQNTFIjs.useOAuthClients; exports.useOAuthConsent = _chunk4NOQNTFIjs.useOAuthConsent; exports.usePageTracker = _chunk4NOQNTFIjs.usePageTracker; exports.usePageUrlGenerator = _chunk4NOQNTFIjs.usePageUrlGenerator; exports.useRehydration = _chunk4NOQNTFIjs.useRehydration; exports.useRehydrationList = _chunk4NOQNTFIjs.useRehydrationList; exports.useRoleTableStructure = _chunk4NOQNTFIjs.useRoleTableStructure; exports.useSocket = _chunk4NOQNTFIjs.useSocket; exports.useSubscriptionStatus = _chunk4NOQNTFIjs.useSubscriptionStatus; exports.useTableGenerator = _chunk4NOQNTFIjs.useTableGenerator; exports.useUrlRewriter = _chunk4NOQNTFIjs.useUrlRewriter; exports.useUserSearch = _chunk4NOQNTFIjs.useUserSearch; exports.useUserTableStructure = _chunk4NOQNTFIjs.useUserTableStructure;
127
121
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/client/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,q2GAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/client/index.js"}
1
+ {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/client/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,+pGAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/client/index.js"}
@@ -2,8 +2,6 @@
2
2
  import {
3
3
  JsonApiProvider,
4
4
  TableGeneratorRegistry,
5
- downloadMigrationFile,
6
- generateMigrationFile,
7
5
  registerTableGenerator,
8
6
  tableGeneratorRegistry,
9
7
  useContentTableStructure,
@@ -18,7 +16,6 @@ import {
18
16
  useOAuthConsent,
19
17
  usePageTracker,
20
18
  usePageUrlGenerator,
21
- useRbacState,
22
19
  useRehydration,
23
20
  useRehydrationList,
24
21
  useRoleTableStructure,
@@ -28,7 +25,7 @@ import {
28
25
  useUrlRewriter,
29
26
  useUserSearch,
30
27
  useUserTableStructure
31
- } from "../chunk-NB6TIKHK.mjs";
28
+ } from "../chunk-NQV5RDCK.mjs";
32
29
  import {
33
30
  configureClientConfig,
34
31
  configureI18n,
@@ -42,7 +39,7 @@ import {
42
39
  useI18nLocale,
43
40
  useI18nRouter,
44
41
  useI18nTranslations
45
- } from "../chunk-NZOUEN67.mjs";
42
+ } from "../chunk-PV5V6CVW.mjs";
46
43
  import {
47
44
  ClientJsonApiDelete,
48
45
  ClientJsonApiGet,
@@ -53,7 +50,7 @@ import {
53
50
  getClientApiUrl,
54
51
  getClientAppUrl,
55
52
  getClientTrackablePages
56
- } from "../chunk-I65SSQ5Z.mjs";
53
+ } from "../chunk-6UMB5LTQ.mjs";
57
54
  import {
58
55
  getClientToken
59
56
  } from "../chunk-AUXK7QSA.mjs";
@@ -81,8 +78,6 @@ export {
81
78
  configureI18n,
82
79
  configureJsonApi,
83
80
  directFetch,
84
- downloadMigrationFile,
85
- generateMigrationFile,
86
81
  getApiUrl,
87
82
  getAppUrl,
88
83
  getClientApiUrl,
@@ -112,7 +107,6 @@ export {
112
107
  useOAuthConsent,
113
108
  usePageTracker,
114
109
  usePageUrlGenerator,
115
- useRbacState,
116
110
  useRehydration,
117
111
  useRehydrationList,
118
112
  useRoleTableStructure,