@axcode/axcloud-sdk 0.1.7-dev.87ea138 → 0.1.7-dev.bf490b9

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.
package/dist/index.d.mts CHANGED
@@ -93,12 +93,57 @@ declare class AxCloudError extends Error {
93
93
  }
94
94
  declare function isAxCloudError(error: unknown): error is AxCloudError;
95
95
 
96
+ type AnalyticsEventValue = string | number | boolean;
97
+ type AnalyticsEventData = Record<string, AnalyticsEventValue>;
98
+ interface AxCloudAnalyticsOptions {
99
+ /** Site key configured in AxCloud, for example "public-web". */
100
+ siteKey: string;
101
+ /** Analytics is opt-in and disabled unless this is true. */
102
+ enabled?: boolean;
103
+ /** Allow local collection for explicit development tests. */
104
+ trackLocalhost?: boolean;
105
+ /** Override path normalization. Return null to skip a pageview. */
106
+ normalizePath?: (pathname: string) => string | null;
107
+ }
108
+ interface AnalyticsPublicConfig {
109
+ enabled: boolean;
110
+ provider?: 'umami';
111
+ websiteId?: string;
112
+ scriptUrl?: string;
113
+ hostUrl?: string;
114
+ domains?: string[];
115
+ autoTrack?: boolean;
116
+ respectDoNotTrack?: boolean;
117
+ excludeSearch?: boolean;
118
+ excludeHash?: boolean;
119
+ allowedEvents?: string[];
120
+ }
121
+ interface AnalyticsRuntime {
122
+ enabled: boolean;
123
+ ready: boolean;
124
+ track: (eventName: string, data?: AnalyticsEventData) => boolean;
125
+ trackPageView: (pathname?: string) => boolean;
126
+ }
127
+ declare function isLocalAnalyticsHostname(hostname: string): boolean;
128
+ declare function sanitizeAnalyticsPath(pathname: string, customNormalizer?: (pathname: string) => string | null): string | null;
129
+ declare function sanitizeAnalyticsEventData(data: AnalyticsEventData | undefined): AnalyticsEventData | undefined;
130
+ declare function isAllowedAnalyticsEvent(eventName: string, allowedEvents: string[] | undefined): boolean;
131
+ declare function fetchAnalyticsPublicConfig(input: {
132
+ apiUrl: string;
133
+ orgId: string;
134
+ siteKey: string;
135
+ stage: string;
136
+ hostname: string;
137
+ signal?: AbortSignal;
138
+ }): Promise<AnalyticsPublicConfig>;
139
+
96
140
  /**
97
141
  * AxCloud SDK Types
98
142
  *
99
143
  * Note: In the future, these types should be auto-generated from the OpenAPI spec.
100
144
  * For now, they are manually defined based on the AxCloud API.
101
145
  */
146
+
102
147
  type AxCloudModule = 'content' | 'members' | 'sections' | 'training' | 'ai' | 'documents' | 'voting';
103
148
  type SystemRole = 'super_admin' | 'org_admin' | 'section_admin' | 'member' | 'viewer';
104
149
  type UserRole = SystemRole | 'superadmin' | 'admin' | 'editor';
@@ -292,11 +337,15 @@ interface AxCloudConfig {
292
337
  stage: string;
293
338
  /** API key for public content endpoints (optional - required for public API access) */
294
339
  apiKey?: string;
340
+ /** Optional privacy-safe web analytics collection. */
341
+ analytics?: AxCloudAnalyticsOptions;
295
342
  auth0: {
296
343
  domain: string;
297
344
  clientId: string;
298
345
  redirectUri: string;
299
346
  audience?: string;
347
+ /** Auth0 Organization ID. Use this for invite-only member sites. */
348
+ organization?: string;
300
349
  /** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
301
350
  connection?: string;
302
351
  };
@@ -387,11 +436,35 @@ interface DocumentItem {
387
436
  created_at: string;
388
437
  updated_at: string;
389
438
  published_at?: string;
439
+ /** Section IDs this document is scoped to (member endpoint only). */
440
+ section_ids?: string[];
441
+ /** Display name of the member who uploaded the document (member endpoint only). */
442
+ uploaded_by_name?: string;
443
+ /** Folder IDs this document belongs to (member endpoint only). */
444
+ folder_ids?: string[];
390
445
  }
391
446
  interface DocumentListResponse {
392
447
  items: DocumentItem[];
393
448
  count: number;
394
449
  }
450
+ /**
451
+ * A document folder the current member is allowed to see.
452
+ *
453
+ * Members receive folders for their own sections plus org-level folders
454
+ * (`section_id === null`). Returned by the member document-folders endpoint.
455
+ */
456
+ interface DocumentFolder {
457
+ id: string;
458
+ /** Section this folder belongs to, or `null` for org-level folders. */
459
+ section_id: string | null;
460
+ /** Parent folder for nesting, or `null` for a top-level folder. */
461
+ parent_folder_id: string | null;
462
+ name: string;
463
+ sort_order: number;
464
+ }
465
+ interface DocumentFolderListResponse {
466
+ folders: DocumentFolder[];
467
+ }
395
468
  interface SignedDocumentUrl {
396
469
  documentId: string;
397
470
  url: string;
@@ -403,6 +476,8 @@ interface DocumentQueryOptions {
403
476
  search?: string;
404
477
  tags?: string[];
405
478
  limit?: number;
479
+ /** Restrict results to documents belonging to this folder (member endpoint only). */
480
+ folderId?: string;
406
481
  }
407
482
 
408
483
  interface BarnsportMunicipality {
@@ -416,12 +491,29 @@ interface BarnsportMunicipality {
416
491
  bounds?: [number, number, number, number];
417
492
  };
418
493
  }
494
+ interface BarnsportSportArticle {
495
+ short_description?: string;
496
+ what_is_it?: string;
497
+ why_fun?: string;
498
+ good_to_know?: {
499
+ age?: string;
500
+ equipment?: string;
501
+ cost?: string;
502
+ };
503
+ fun_facts?: string[];
504
+ }
419
505
  interface BarnsportSport {
420
506
  id: string;
421
507
  slug: string;
422
508
  name: string;
423
509
  icon?: string;
424
510
  color?: string;
511
+ category?: string;
512
+ is_featured?: boolean;
513
+ hero_image_url?: string;
514
+ short_description?: string;
515
+ /** Present on the single-sport endpoint (GET /public/{orgId}/sports/{slug}). */
516
+ article?: BarnsportSportArticle;
425
517
  }
426
518
  interface BarnsportActivitySchedule {
427
519
  weekday?: number;
@@ -881,11 +973,15 @@ interface AxCloudProviderProps {
881
973
  stage?: string;
882
974
  /** API key for public content endpoints */
883
975
  apiKey?: string;
976
+ /** Optional privacy-safe analytics collection through AxCloud. */
977
+ analytics?: AxCloudAnalyticsOptions;
884
978
  auth0: {
885
979
  domain: string;
886
980
  clientId: string;
887
981
  redirectUri: string;
888
982
  audience?: string;
983
+ /** Auth0 Organization ID. Use this for invite-only member sites. */
984
+ organization?: string;
889
985
  /** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
890
986
  connection?: string;
891
987
  };
@@ -907,14 +1003,15 @@ interface AxCloudProviderProps {
907
1003
  * auth0={{
908
1004
  * domain: "auth.axcloud.app",
909
1005
  * clientId: "xxx",
910
- * redirectUri: window.location.origin
1006
+ * redirectUri: window.location.origin,
1007
+ * organization: "org_abc123" // Optional Auth0 Organization ID for invite-only member sites
911
1008
  * }}
912
1009
  * >
913
1010
  * <App />
914
1011
  * </AxCloudProvider>
915
1012
  * ```
916
1013
  */
917
- declare function AxCloudProvider({ children, orgId, apiUrl, stage, apiKey, auth0, queryClient, timeout, }: AxCloudProviderProps): react_jsx_runtime.JSX.Element;
1014
+ declare function AxCloudProvider({ children, orgId, apiUrl, stage, apiKey, analytics, auth0, queryClient, timeout, }: AxCloudProviderProps): react_jsx_runtime.JSX.Element;
918
1015
 
919
1016
  interface AxCloudContextValue {
920
1017
  config: AxCloudConfig;
@@ -924,20 +1021,35 @@ interface AxCloudContextValue {
924
1021
  stage: string;
925
1022
  /** Whether using public API mode (API key, no auth) */
926
1023
  isPublicMode: boolean;
1024
+ analytics: AnalyticsRuntime;
927
1025
  }
928
1026
  declare function useAxCloudContext(): AxCloudContextValue;
929
1027
 
1028
+ type AnalyticsRuntimeConfig = Pick<AxCloudConfig, 'analytics' | 'apiUrl' | 'orgId' | 'stage'>;
1029
+ declare function useAnalyticsRuntime(config: AnalyticsRuntimeConfig): AnalyticsRuntime;
1030
+ declare function useAnalytics(): AnalyticsRuntime;
1031
+
930
1032
  interface AuthUser {
931
1033
  id: string;
932
1034
  email: string;
933
1035
  name: string;
934
1036
  avatar?: string;
1037
+ /** Auth0's authoritative email verification claim. */
1038
+ emailVerified?: boolean;
1039
+ }
1040
+ interface EmailVerificationResult {
1041
+ success: boolean;
1042
+ status: 'sent' | 'already_verified' | 'rate_limited' | 'failed';
1043
+ message: string;
1044
+ retryAfterSeconds?: number;
935
1045
  }
936
1046
  interface UseAuthReturn {
937
1047
  isAuthenticated: boolean;
938
1048
  isLoading: boolean;
939
1049
  error: Error | undefined;
940
1050
  user: AuthUser | null;
1051
+ /** True only when Auth0 explicitly reports email_verified=false. */
1052
+ needsEmailVerification: boolean;
941
1053
  login: (options?: {
942
1054
  returnTo?: string;
943
1055
  }) => Promise<void>;
@@ -946,6 +1058,12 @@ interface UseAuthReturn {
946
1058
  }) => Promise<void>;
947
1059
  getAccessToken: () => Promise<string | undefined>;
948
1060
  getAuth0Client: () => Auth0ClientState;
1061
+ /** Refresh Auth0 tokens/profile and return the latest email verification state. */
1062
+ refreshUser: () => Promise<boolean>;
1063
+ /** Send a branded verification email that returns to the current product site. */
1064
+ requestEmailVerification: (options?: {
1065
+ returnTo?: string;
1066
+ }) => Promise<EmailVerificationResult>;
949
1067
  /** Request a password reset email for the current user or specified email */
950
1068
  requestPasswordReset: (email?: string) => Promise<{
951
1069
  success: boolean;
@@ -1711,6 +1829,58 @@ declare function useDocumentDownload(documentId: string | undefined): {
1711
1829
  error: Error | null;
1712
1830
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
1713
1831
  };
1832
+ /**
1833
+ * List documents the current member is allowed to see.
1834
+ *
1835
+ * Hits the member endpoint (`/documents/members/...`) which is NOT a
1836
+ * `/public/` path, so the core client automatically attaches the member's
1837
+ * `Authorization: Bearer <JWT>` header instead of the public API key.
1838
+ *
1839
+ * Returns public documents plus members/internal documents and section
1840
+ * documents for the member's sections. Items include `section_ids` and
1841
+ * uploader metadata (`uploaded_by_name`, `created_at`).
1842
+ */
1843
+ declare function useMemberDocuments(options?: DocumentQueryOptions): {
1844
+ documents: DocumentItem[];
1845
+ items: DocumentItem[];
1846
+ count: number;
1847
+ isLoading: boolean;
1848
+ isError: boolean;
1849
+ error: Error | null;
1850
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentListResponse, Error>>;
1851
+ };
1852
+ /**
1853
+ * List the document folders the current member is allowed to see.
1854
+ *
1855
+ * Hits the member endpoint (`/documents/members/${orgId}/document-folders`),
1856
+ * which is NOT a `/public/` path, so the core client attaches the member's
1857
+ * `Authorization: Bearer <JWT>` header instead of the public API key.
1858
+ *
1859
+ * Returns the member's section folders plus org-level folders
1860
+ * (`section_id === null`). Use the returned folder ids with
1861
+ * `useMemberDocuments({ folderId })` to scope a document list.
1862
+ */
1863
+ declare function useMemberDocumentFolders(): {
1864
+ folders: DocumentFolder[];
1865
+ isLoading: boolean;
1866
+ isError: boolean;
1867
+ error: Error | null;
1868
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentFolderListResponse, Error>>;
1869
+ };
1870
+ /**
1871
+ * Fetch a short-lived signed download URL for a member-accessible document.
1872
+ */
1873
+ declare function useMemberDocumentDownload(documentId: string | undefined): {
1874
+ url: string | null;
1875
+ documentUrl: string | null;
1876
+ filename: string | null;
1877
+ mimeType: string | null;
1878
+ expiresIn: number | null;
1879
+ isLoading: boolean;
1880
+ isError: boolean;
1881
+ error: Error | null;
1882
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
1883
+ };
1714
1884
 
1715
1885
  declare function useBarnsportMunicipalities(): {
1716
1886
  municipalities: BarnsportMunicipality[];
@@ -1728,6 +1898,15 @@ declare function useBarnsportSports(): {
1728
1898
  error: Error | null;
1729
1899
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportSport>, Error>>;
1730
1900
  };
1901
+ declare function useBarnsportSport(slug: string | undefined): {
1902
+ sport: BarnsportSport | null;
1903
+ isLoading: boolean;
1904
+ isError: boolean;
1905
+ error: Error | null;
1906
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1907
+ sport: BarnsportSport;
1908
+ }, Error>>;
1909
+ };
1731
1910
  declare function useBarnsportActivities(filters?: BarnsportActivitiesFilter): {
1732
1911
  activities: BarnsportActivityListItem[];
1733
1912
  count: number;
@@ -1979,4 +2158,4 @@ interface LinkedAccountsListProps {
1979
2158
  */
1980
2159
  declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): react_jsx_runtime.JSX.Element;
1981
2160
 
1982
- export { type AvailableProvider, AxCloudClient, type AxCloudConfig, AxCloudError, type AxCloudErrorCode, type AxCloudModule, AxCloudProvider, type Ballot, type BallotCandidate, type BallotOption, type BallotSeat, type BarnsportActivitiesFilter, type BarnsportActivity, type BarnsportActivityListItem, type BarnsportActivityLocation, type BarnsportActivityResponse, type BarnsportActivitySchedule, type BarnsportInterestSubmissionRequest, type BarnsportInterestSubmissionResponse, type BarnsportListResponse, type BarnsportMunicipality, type BarnsportRegistrationMethod, type BarnsportSitemapResponse, type BarnsportSitemapUrl, type BarnsportSport, type BaseRole, type CastVoteResult, type CodeEligibility, type ContentItem, type ContentQueryOptions, type ContentSlotImage, type ContentSlotMap, type ContentSlotReader, type ContentSlotValue, type CustomRole, type DocumentAudience, type DocumentItem, type DocumentListResponse, type DocumentQueryOptions, type DocumentSourceProvider, type DocumentStatus, type FormStatsResponse, type FormSubmission, type FormSubmissionRecord, type FormSubmissionResponse, type FormSubmissionsResponse, LinkedAccountsList, type LinkedAccountsListProps, type LinkedIdentity, LoginButton, LogoutButton, type MediaItem, type MediaListResponse, type Membership, ModuleGate, type NewsItem, type Organization, type OrganizationBranding, type OrganizationSettings, type Page, type PageContentState, type PaginatedResponse, ProtectedRoute, type Section, type SectionPermissions, type SignedDocumentUrl, type SignedMediaUrl, type SystemRole, type UseLinkedAccountsReturn, type User, type UserRole, type VoteReceipt, castVote, castVoteWithCode, checkEligibility, checkVotingCode, createClient, createContentSlotReader, createFormHelper, getBallot, getClient, getContentSlotMap, getVotingReceipt, isAxCloudError, submitForm, useAuth, useAvatar, useAxCloudContext, useBarnsportActivities, useBarnsportActivity, useBarnsportMunicipalities, useBarnsportSitemap, useBarnsportSports, useBranding, useCodeBallot, useContent, useContentItem, useDocumentDownload, useDocuments, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useModuleAccess, useMySection, useNews, useOrg, usePageContent, useSections, useSubmitBarnsportInterest, useUpdateFormSubmission, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };
2161
+ export { type AnalyticsEventData, type AnalyticsEventValue, type AnalyticsPublicConfig, type AnalyticsRuntime, type AnalyticsRuntimeConfig, type Auth0ClientState, type AuthUser, type AvailableProvider, type AxCloudAnalyticsOptions, AxCloudClient, type AxCloudConfig, AxCloudError, type AxCloudErrorCode, type AxCloudModule, AxCloudProvider, type Ballot, type BallotCandidate, type BallotOption, type BallotSeat, type BarnsportActivitiesFilter, type BarnsportActivity, type BarnsportActivityListItem, type BarnsportActivityLocation, type BarnsportActivityResponse, type BarnsportActivitySchedule, type BarnsportInterestSubmissionRequest, type BarnsportInterestSubmissionResponse, type BarnsportListResponse, type BarnsportMunicipality, type BarnsportRegistrationMethod, type BarnsportSitemapResponse, type BarnsportSitemapUrl, type BarnsportSport, type BaseRole, type CastVoteResult, type CodeEligibility, type ContentItem, type ContentQueryOptions, type ContentSlotImage, type ContentSlotMap, type ContentSlotReader, type ContentSlotValue, type CustomRole, type DocumentAudience, type DocumentFolder, type DocumentFolderListResponse, type DocumentItem, type DocumentListResponse, type DocumentQueryOptions, type DocumentSourceProvider, type DocumentStatus, type EmailVerificationResult, type FormStatsResponse, type FormSubmission, type FormSubmissionRecord, type FormSubmissionResponse, type FormSubmissionsResponse, LinkedAccountsList, type LinkedAccountsListProps, type LinkedIdentity, LoginButton, LogoutButton, type MediaItem, type MediaListResponse, type Membership, ModuleGate, type NewsItem, type Organization, type OrganizationBranding, type OrganizationSettings, type Page, type PageContentState, type PaginatedResponse, ProtectedRoute, type Section, type SectionPermissions, type SignedDocumentUrl, type SignedMediaUrl, type SystemRole, type UseAuthReturn, type UseLinkedAccountsReturn, type User, type UserRole, type VoteReceipt, castVote, castVoteWithCode, checkEligibility, checkVotingCode, createClient, createContentSlotReader, createFormHelper, fetchAnalyticsPublicConfig, getBallot, getClient, getContentSlotMap, getVotingReceipt, isAllowedAnalyticsEvent, isAxCloudError, isLocalAnalyticsHostname, sanitizeAnalyticsEventData, sanitizeAnalyticsPath, submitForm, useAnalytics, useAnalyticsRuntime, useAuth, useAvatar, useAxCloudContext, useBarnsportActivities, useBarnsportActivity, useBarnsportMunicipalities, useBarnsportSitemap, useBarnsportSport, useBarnsportSports, useBranding, useCodeBallot, useContent, useContentItem, useDocumentDownload, useDocuments, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useMemberDocumentDownload, useMemberDocumentFolders, useMemberDocuments, useModuleAccess, useMySection, useNews, useOrg, usePageContent, useSections, useSubmitBarnsportInterest, useUpdateFormSubmission, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };
package/dist/index.d.ts CHANGED
@@ -93,12 +93,57 @@ declare class AxCloudError extends Error {
93
93
  }
94
94
  declare function isAxCloudError(error: unknown): error is AxCloudError;
95
95
 
96
+ type AnalyticsEventValue = string | number | boolean;
97
+ type AnalyticsEventData = Record<string, AnalyticsEventValue>;
98
+ interface AxCloudAnalyticsOptions {
99
+ /** Site key configured in AxCloud, for example "public-web". */
100
+ siteKey: string;
101
+ /** Analytics is opt-in and disabled unless this is true. */
102
+ enabled?: boolean;
103
+ /** Allow local collection for explicit development tests. */
104
+ trackLocalhost?: boolean;
105
+ /** Override path normalization. Return null to skip a pageview. */
106
+ normalizePath?: (pathname: string) => string | null;
107
+ }
108
+ interface AnalyticsPublicConfig {
109
+ enabled: boolean;
110
+ provider?: 'umami';
111
+ websiteId?: string;
112
+ scriptUrl?: string;
113
+ hostUrl?: string;
114
+ domains?: string[];
115
+ autoTrack?: boolean;
116
+ respectDoNotTrack?: boolean;
117
+ excludeSearch?: boolean;
118
+ excludeHash?: boolean;
119
+ allowedEvents?: string[];
120
+ }
121
+ interface AnalyticsRuntime {
122
+ enabled: boolean;
123
+ ready: boolean;
124
+ track: (eventName: string, data?: AnalyticsEventData) => boolean;
125
+ trackPageView: (pathname?: string) => boolean;
126
+ }
127
+ declare function isLocalAnalyticsHostname(hostname: string): boolean;
128
+ declare function sanitizeAnalyticsPath(pathname: string, customNormalizer?: (pathname: string) => string | null): string | null;
129
+ declare function sanitizeAnalyticsEventData(data: AnalyticsEventData | undefined): AnalyticsEventData | undefined;
130
+ declare function isAllowedAnalyticsEvent(eventName: string, allowedEvents: string[] | undefined): boolean;
131
+ declare function fetchAnalyticsPublicConfig(input: {
132
+ apiUrl: string;
133
+ orgId: string;
134
+ siteKey: string;
135
+ stage: string;
136
+ hostname: string;
137
+ signal?: AbortSignal;
138
+ }): Promise<AnalyticsPublicConfig>;
139
+
96
140
  /**
97
141
  * AxCloud SDK Types
98
142
  *
99
143
  * Note: In the future, these types should be auto-generated from the OpenAPI spec.
100
144
  * For now, they are manually defined based on the AxCloud API.
101
145
  */
146
+
102
147
  type AxCloudModule = 'content' | 'members' | 'sections' | 'training' | 'ai' | 'documents' | 'voting';
103
148
  type SystemRole = 'super_admin' | 'org_admin' | 'section_admin' | 'member' | 'viewer';
104
149
  type UserRole = SystemRole | 'superadmin' | 'admin' | 'editor';
@@ -292,11 +337,15 @@ interface AxCloudConfig {
292
337
  stage: string;
293
338
  /** API key for public content endpoints (optional - required for public API access) */
294
339
  apiKey?: string;
340
+ /** Optional privacy-safe web analytics collection. */
341
+ analytics?: AxCloudAnalyticsOptions;
295
342
  auth0: {
296
343
  domain: string;
297
344
  clientId: string;
298
345
  redirectUri: string;
299
346
  audience?: string;
347
+ /** Auth0 Organization ID. Use this for invite-only member sites. */
348
+ organization?: string;
300
349
  /** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
301
350
  connection?: string;
302
351
  };
@@ -387,11 +436,35 @@ interface DocumentItem {
387
436
  created_at: string;
388
437
  updated_at: string;
389
438
  published_at?: string;
439
+ /** Section IDs this document is scoped to (member endpoint only). */
440
+ section_ids?: string[];
441
+ /** Display name of the member who uploaded the document (member endpoint only). */
442
+ uploaded_by_name?: string;
443
+ /** Folder IDs this document belongs to (member endpoint only). */
444
+ folder_ids?: string[];
390
445
  }
391
446
  interface DocumentListResponse {
392
447
  items: DocumentItem[];
393
448
  count: number;
394
449
  }
450
+ /**
451
+ * A document folder the current member is allowed to see.
452
+ *
453
+ * Members receive folders for their own sections plus org-level folders
454
+ * (`section_id === null`). Returned by the member document-folders endpoint.
455
+ */
456
+ interface DocumentFolder {
457
+ id: string;
458
+ /** Section this folder belongs to, or `null` for org-level folders. */
459
+ section_id: string | null;
460
+ /** Parent folder for nesting, or `null` for a top-level folder. */
461
+ parent_folder_id: string | null;
462
+ name: string;
463
+ sort_order: number;
464
+ }
465
+ interface DocumentFolderListResponse {
466
+ folders: DocumentFolder[];
467
+ }
395
468
  interface SignedDocumentUrl {
396
469
  documentId: string;
397
470
  url: string;
@@ -403,6 +476,8 @@ interface DocumentQueryOptions {
403
476
  search?: string;
404
477
  tags?: string[];
405
478
  limit?: number;
479
+ /** Restrict results to documents belonging to this folder (member endpoint only). */
480
+ folderId?: string;
406
481
  }
407
482
 
408
483
  interface BarnsportMunicipality {
@@ -416,12 +491,29 @@ interface BarnsportMunicipality {
416
491
  bounds?: [number, number, number, number];
417
492
  };
418
493
  }
494
+ interface BarnsportSportArticle {
495
+ short_description?: string;
496
+ what_is_it?: string;
497
+ why_fun?: string;
498
+ good_to_know?: {
499
+ age?: string;
500
+ equipment?: string;
501
+ cost?: string;
502
+ };
503
+ fun_facts?: string[];
504
+ }
419
505
  interface BarnsportSport {
420
506
  id: string;
421
507
  slug: string;
422
508
  name: string;
423
509
  icon?: string;
424
510
  color?: string;
511
+ category?: string;
512
+ is_featured?: boolean;
513
+ hero_image_url?: string;
514
+ short_description?: string;
515
+ /** Present on the single-sport endpoint (GET /public/{orgId}/sports/{slug}). */
516
+ article?: BarnsportSportArticle;
425
517
  }
426
518
  interface BarnsportActivitySchedule {
427
519
  weekday?: number;
@@ -881,11 +973,15 @@ interface AxCloudProviderProps {
881
973
  stage?: string;
882
974
  /** API key for public content endpoints */
883
975
  apiKey?: string;
976
+ /** Optional privacy-safe analytics collection through AxCloud. */
977
+ analytics?: AxCloudAnalyticsOptions;
884
978
  auth0: {
885
979
  domain: string;
886
980
  clientId: string;
887
981
  redirectUri: string;
888
982
  audience?: string;
983
+ /** Auth0 Organization ID. Use this for invite-only member sites. */
984
+ organization?: string;
889
985
  /** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
890
986
  connection?: string;
891
987
  };
@@ -907,14 +1003,15 @@ interface AxCloudProviderProps {
907
1003
  * auth0={{
908
1004
  * domain: "auth.axcloud.app",
909
1005
  * clientId: "xxx",
910
- * redirectUri: window.location.origin
1006
+ * redirectUri: window.location.origin,
1007
+ * organization: "org_abc123" // Optional Auth0 Organization ID for invite-only member sites
911
1008
  * }}
912
1009
  * >
913
1010
  * <App />
914
1011
  * </AxCloudProvider>
915
1012
  * ```
916
1013
  */
917
- declare function AxCloudProvider({ children, orgId, apiUrl, stage, apiKey, auth0, queryClient, timeout, }: AxCloudProviderProps): react_jsx_runtime.JSX.Element;
1014
+ declare function AxCloudProvider({ children, orgId, apiUrl, stage, apiKey, analytics, auth0, queryClient, timeout, }: AxCloudProviderProps): react_jsx_runtime.JSX.Element;
918
1015
 
919
1016
  interface AxCloudContextValue {
920
1017
  config: AxCloudConfig;
@@ -924,20 +1021,35 @@ interface AxCloudContextValue {
924
1021
  stage: string;
925
1022
  /** Whether using public API mode (API key, no auth) */
926
1023
  isPublicMode: boolean;
1024
+ analytics: AnalyticsRuntime;
927
1025
  }
928
1026
  declare function useAxCloudContext(): AxCloudContextValue;
929
1027
 
1028
+ type AnalyticsRuntimeConfig = Pick<AxCloudConfig, 'analytics' | 'apiUrl' | 'orgId' | 'stage'>;
1029
+ declare function useAnalyticsRuntime(config: AnalyticsRuntimeConfig): AnalyticsRuntime;
1030
+ declare function useAnalytics(): AnalyticsRuntime;
1031
+
930
1032
  interface AuthUser {
931
1033
  id: string;
932
1034
  email: string;
933
1035
  name: string;
934
1036
  avatar?: string;
1037
+ /** Auth0's authoritative email verification claim. */
1038
+ emailVerified?: boolean;
1039
+ }
1040
+ interface EmailVerificationResult {
1041
+ success: boolean;
1042
+ status: 'sent' | 'already_verified' | 'rate_limited' | 'failed';
1043
+ message: string;
1044
+ retryAfterSeconds?: number;
935
1045
  }
936
1046
  interface UseAuthReturn {
937
1047
  isAuthenticated: boolean;
938
1048
  isLoading: boolean;
939
1049
  error: Error | undefined;
940
1050
  user: AuthUser | null;
1051
+ /** True only when Auth0 explicitly reports email_verified=false. */
1052
+ needsEmailVerification: boolean;
941
1053
  login: (options?: {
942
1054
  returnTo?: string;
943
1055
  }) => Promise<void>;
@@ -946,6 +1058,12 @@ interface UseAuthReturn {
946
1058
  }) => Promise<void>;
947
1059
  getAccessToken: () => Promise<string | undefined>;
948
1060
  getAuth0Client: () => Auth0ClientState;
1061
+ /** Refresh Auth0 tokens/profile and return the latest email verification state. */
1062
+ refreshUser: () => Promise<boolean>;
1063
+ /** Send a branded verification email that returns to the current product site. */
1064
+ requestEmailVerification: (options?: {
1065
+ returnTo?: string;
1066
+ }) => Promise<EmailVerificationResult>;
949
1067
  /** Request a password reset email for the current user or specified email */
950
1068
  requestPasswordReset: (email?: string) => Promise<{
951
1069
  success: boolean;
@@ -1711,6 +1829,58 @@ declare function useDocumentDownload(documentId: string | undefined): {
1711
1829
  error: Error | null;
1712
1830
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
1713
1831
  };
1832
+ /**
1833
+ * List documents the current member is allowed to see.
1834
+ *
1835
+ * Hits the member endpoint (`/documents/members/...`) which is NOT a
1836
+ * `/public/` path, so the core client automatically attaches the member's
1837
+ * `Authorization: Bearer <JWT>` header instead of the public API key.
1838
+ *
1839
+ * Returns public documents plus members/internal documents and section
1840
+ * documents for the member's sections. Items include `section_ids` and
1841
+ * uploader metadata (`uploaded_by_name`, `created_at`).
1842
+ */
1843
+ declare function useMemberDocuments(options?: DocumentQueryOptions): {
1844
+ documents: DocumentItem[];
1845
+ items: DocumentItem[];
1846
+ count: number;
1847
+ isLoading: boolean;
1848
+ isError: boolean;
1849
+ error: Error | null;
1850
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentListResponse, Error>>;
1851
+ };
1852
+ /**
1853
+ * List the document folders the current member is allowed to see.
1854
+ *
1855
+ * Hits the member endpoint (`/documents/members/${orgId}/document-folders`),
1856
+ * which is NOT a `/public/` path, so the core client attaches the member's
1857
+ * `Authorization: Bearer <JWT>` header instead of the public API key.
1858
+ *
1859
+ * Returns the member's section folders plus org-level folders
1860
+ * (`section_id === null`). Use the returned folder ids with
1861
+ * `useMemberDocuments({ folderId })` to scope a document list.
1862
+ */
1863
+ declare function useMemberDocumentFolders(): {
1864
+ folders: DocumentFolder[];
1865
+ isLoading: boolean;
1866
+ isError: boolean;
1867
+ error: Error | null;
1868
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentFolderListResponse, Error>>;
1869
+ };
1870
+ /**
1871
+ * Fetch a short-lived signed download URL for a member-accessible document.
1872
+ */
1873
+ declare function useMemberDocumentDownload(documentId: string | undefined): {
1874
+ url: string | null;
1875
+ documentUrl: string | null;
1876
+ filename: string | null;
1877
+ mimeType: string | null;
1878
+ expiresIn: number | null;
1879
+ isLoading: boolean;
1880
+ isError: boolean;
1881
+ error: Error | null;
1882
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
1883
+ };
1714
1884
 
1715
1885
  declare function useBarnsportMunicipalities(): {
1716
1886
  municipalities: BarnsportMunicipality[];
@@ -1728,6 +1898,15 @@ declare function useBarnsportSports(): {
1728
1898
  error: Error | null;
1729
1899
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportSport>, Error>>;
1730
1900
  };
1901
+ declare function useBarnsportSport(slug: string | undefined): {
1902
+ sport: BarnsportSport | null;
1903
+ isLoading: boolean;
1904
+ isError: boolean;
1905
+ error: Error | null;
1906
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1907
+ sport: BarnsportSport;
1908
+ }, Error>>;
1909
+ };
1731
1910
  declare function useBarnsportActivities(filters?: BarnsportActivitiesFilter): {
1732
1911
  activities: BarnsportActivityListItem[];
1733
1912
  count: number;
@@ -1979,4 +2158,4 @@ interface LinkedAccountsListProps {
1979
2158
  */
1980
2159
  declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): react_jsx_runtime.JSX.Element;
1981
2160
 
1982
- export { type AvailableProvider, AxCloudClient, type AxCloudConfig, AxCloudError, type AxCloudErrorCode, type AxCloudModule, AxCloudProvider, type Ballot, type BallotCandidate, type BallotOption, type BallotSeat, type BarnsportActivitiesFilter, type BarnsportActivity, type BarnsportActivityListItem, type BarnsportActivityLocation, type BarnsportActivityResponse, type BarnsportActivitySchedule, type BarnsportInterestSubmissionRequest, type BarnsportInterestSubmissionResponse, type BarnsportListResponse, type BarnsportMunicipality, type BarnsportRegistrationMethod, type BarnsportSitemapResponse, type BarnsportSitemapUrl, type BarnsportSport, type BaseRole, type CastVoteResult, type CodeEligibility, type ContentItem, type ContentQueryOptions, type ContentSlotImage, type ContentSlotMap, type ContentSlotReader, type ContentSlotValue, type CustomRole, type DocumentAudience, type DocumentItem, type DocumentListResponse, type DocumentQueryOptions, type DocumentSourceProvider, type DocumentStatus, type FormStatsResponse, type FormSubmission, type FormSubmissionRecord, type FormSubmissionResponse, type FormSubmissionsResponse, LinkedAccountsList, type LinkedAccountsListProps, type LinkedIdentity, LoginButton, LogoutButton, type MediaItem, type MediaListResponse, type Membership, ModuleGate, type NewsItem, type Organization, type OrganizationBranding, type OrganizationSettings, type Page, type PageContentState, type PaginatedResponse, ProtectedRoute, type Section, type SectionPermissions, type SignedDocumentUrl, type SignedMediaUrl, type SystemRole, type UseLinkedAccountsReturn, type User, type UserRole, type VoteReceipt, castVote, castVoteWithCode, checkEligibility, checkVotingCode, createClient, createContentSlotReader, createFormHelper, getBallot, getClient, getContentSlotMap, getVotingReceipt, isAxCloudError, submitForm, useAuth, useAvatar, useAxCloudContext, useBarnsportActivities, useBarnsportActivity, useBarnsportMunicipalities, useBarnsportSitemap, useBarnsportSports, useBranding, useCodeBallot, useContent, useContentItem, useDocumentDownload, useDocuments, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useModuleAccess, useMySection, useNews, useOrg, usePageContent, useSections, useSubmitBarnsportInterest, useUpdateFormSubmission, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };
2161
+ export { type AnalyticsEventData, type AnalyticsEventValue, type AnalyticsPublicConfig, type AnalyticsRuntime, type AnalyticsRuntimeConfig, type Auth0ClientState, type AuthUser, type AvailableProvider, type AxCloudAnalyticsOptions, AxCloudClient, type AxCloudConfig, AxCloudError, type AxCloudErrorCode, type AxCloudModule, AxCloudProvider, type Ballot, type BallotCandidate, type BallotOption, type BallotSeat, type BarnsportActivitiesFilter, type BarnsportActivity, type BarnsportActivityListItem, type BarnsportActivityLocation, type BarnsportActivityResponse, type BarnsportActivitySchedule, type BarnsportInterestSubmissionRequest, type BarnsportInterestSubmissionResponse, type BarnsportListResponse, type BarnsportMunicipality, type BarnsportRegistrationMethod, type BarnsportSitemapResponse, type BarnsportSitemapUrl, type BarnsportSport, type BaseRole, type CastVoteResult, type CodeEligibility, type ContentItem, type ContentQueryOptions, type ContentSlotImage, type ContentSlotMap, type ContentSlotReader, type ContentSlotValue, type CustomRole, type DocumentAudience, type DocumentFolder, type DocumentFolderListResponse, type DocumentItem, type DocumentListResponse, type DocumentQueryOptions, type DocumentSourceProvider, type DocumentStatus, type EmailVerificationResult, type FormStatsResponse, type FormSubmission, type FormSubmissionRecord, type FormSubmissionResponse, type FormSubmissionsResponse, LinkedAccountsList, type LinkedAccountsListProps, type LinkedIdentity, LoginButton, LogoutButton, type MediaItem, type MediaListResponse, type Membership, ModuleGate, type NewsItem, type Organization, type OrganizationBranding, type OrganizationSettings, type Page, type PageContentState, type PaginatedResponse, ProtectedRoute, type Section, type SectionPermissions, type SignedDocumentUrl, type SignedMediaUrl, type SystemRole, type UseAuthReturn, type UseLinkedAccountsReturn, type User, type UserRole, type VoteReceipt, castVote, castVoteWithCode, checkEligibility, checkVotingCode, createClient, createContentSlotReader, createFormHelper, fetchAnalyticsPublicConfig, getBallot, getClient, getContentSlotMap, getVotingReceipt, isAllowedAnalyticsEvent, isAxCloudError, isLocalAnalyticsHostname, sanitizeAnalyticsEventData, sanitizeAnalyticsPath, submitForm, useAnalytics, useAnalyticsRuntime, useAuth, useAvatar, useAxCloudContext, useBarnsportActivities, useBarnsportActivity, useBarnsportMunicipalities, useBarnsportSitemap, useBarnsportSport, useBarnsportSports, useBranding, useCodeBallot, useContent, useContentItem, useDocumentDownload, useDocuments, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useMemberDocumentDownload, useMemberDocumentFolders, useMemberDocuments, useModuleAccess, useMySection, useNews, useOrg, usePageContent, useSections, useSubmitBarnsportInterest, useUpdateFormSubmission, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };