@axcode/axcloud-sdk 0.2.0-dev.1e6c3d5 → 0.2.0-dev.5dc7e06

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.ts CHANGED
@@ -1,82 +1,11 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ export { A as AxCloudClient, c as createClient, g as getClient } from './client-FOpKwe3e.js';
2
+ import { A as AxCloudAnalyticsOptions, U as User$1, a as UserRole, O as Organization, b as AxCloudModule, C as ContentQueryOptions, N as NewsItem, c as ContentListResponse, S as Section, d as SignedMediaUrl, e as OrganizationBranding, M as MediaItem, f as MediaListResponse, g as SignedDocumentUrl, D as DocumentQueryOptions, h as DocumentItem, i as DocumentListResponse, j as DocumentFolder, k as DocumentFolderListResponse } from './useContent-Cl7dvERE.js';
3
+ export { l as AnalyticsEventData, m as AnalyticsEventValue, n as AnalyticsPublicConfig, o as AnalyticsRuntime, p as AnalyticsRuntimeConfig, q as AxCloudConfig, B as BaseRole, r as ContentCollectionType, s as ContentDetailType, t as ContentItem, u as ContentSlotImage, v as ContentSlotMap, w as ContentSlotReader, x as ContentSlotValue, y as CustomRole, z as DocumentAudience, E as DocumentSourceProvider, F as DocumentStatus, G as Membership, H as OrganizationSettings, P as Page, I as PageContentState, J as PaginatedResponse, K as SectionPermissions, L as SystemRole, Q as createContentSlotReader, R as fetchAnalyticsPublicConfig, T as getContentSlotMap, V as isAllowedAnalyticsEvent, W as isLocalAnalyticsHostname, X as sanitizeAnalyticsEventData, Y as sanitizeAnalyticsPath, Z as useAnalytics, _ as useAnalyticsRuntime, $ as useAxCloudContext, a0 as useContent, a1 as useContentItem, a2 as usePageContent, a3 as userHasAllPermissions, a4 as userHasAnyPermission, a5 as userHasPermission } from './useContent-Cl7dvERE.js';
4
+ export { B as BarnsportActivitiesFilter, a as BarnsportActivity, b as BarnsportActivityListItem, c as BarnsportActivityLocation, d as BarnsportActivityResponse, e as BarnsportActivitySchedule, f as BarnsportInquirySubmissionRequest, g as BarnsportInterestSubmissionRequest, h as BarnsportInterestSubmissionResponse, i as BarnsportListResponse, j as BarnsportMunicipality, k as BarnsportRegistrationMethod, l as BarnsportSitemapResponse, m as BarnsportSitemapUrl, n as BarnsportSport, u as useBarnsportActivities, o as useBarnsportActivity, p as useBarnsportMunicipalities, q as useBarnsportSitemap, r as useBarnsportSport, s as useBarnsportSports, t as useSubmitBarnsportInterest } from './useBarnsport-C6uDSuHf.js';
2
5
  import React from 'react';
3
6
  import * as _tanstack_react_query from '@tanstack/react-query';
4
7
  import { QueryClient } from '@tanstack/react-query';
5
- import { useAuth0, User as User$1 } from '@auth0/auth0-react';
6
-
7
- /**
8
- * AxCloud API Client
9
- *
10
- * Fetch wrapper with authentication header injection and error handling.
11
- */
12
- interface ClientConfig {
13
- baseUrl: string;
14
- getAccessToken?: () => Promise<string | undefined>;
15
- /** API key for public content endpoints */
16
- apiKey?: string;
17
- /** Default request timeout in milliseconds (default: 30000) */
18
- timeout?: number;
19
- }
20
- interface RequestOptions extends Omit<RequestInit, 'body'> {
21
- body?: unknown;
22
- params?: Record<string, string | number | boolean | undefined>;
23
- /** Request timeout in milliseconds (overrides client default) */
24
- timeout?: number;
25
- }
26
- declare class AxCloudClient {
27
- private baseUrl;
28
- private getAccessToken?;
29
- private apiKey?;
30
- private defaultTimeout;
31
- constructor(config: ClientConfig);
32
- /**
33
- * Update the access token getter (used when auth state changes)
34
- */
35
- setAccessTokenGetter(getter: () => Promise<string | undefined>): void;
36
- /**
37
- * Build URL with query parameters
38
- */
39
- private buildUrl;
40
- /**
41
- * API key should only be sent to public endpoints.
42
- * This avoids leaking public keys to authenticated/internal routes.
43
- */
44
- private shouldAttachApiKey;
45
- /**
46
- * Make an authenticated request
47
- */
48
- request<T>(path: string, options?: RequestOptions): Promise<T>;
49
- /**
50
- * GET request
51
- */
52
- get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
53
- /**
54
- * POST request
55
- */
56
- post<T>(path: string, body?: unknown): Promise<T>;
57
- /**
58
- * PUT request
59
- */
60
- put<T>(path: string, body?: unknown): Promise<T>;
61
- /**
62
- * PATCH request
63
- */
64
- patch<T>(path: string, body?: unknown): Promise<T>;
65
- /**
66
- * DELETE request
67
- */
68
- delete<T>(path: string): Promise<T>;
69
- }
70
- /**
71
- * Create a client instance associated with a key (typically the provider instance)
72
- * This allows multiple AxCloudProviders to coexist without conflicts
73
- */
74
- declare function createClient(config: ClientConfig, key?: object): AxCloudClient;
75
- /**
76
- * Get a client instance by key
77
- * @deprecated Use the client from useAxCloudContext() instead
78
- */
79
- declare function getClient(key?: object): AxCloudClient;
8
+ import { useAuth0, User } from '@auth0/auth0-react';
80
9
 
81
10
  /**
82
11
  * AxCloud SDK Error Types
@@ -93,609 +22,6 @@ declare class AxCloudError extends Error {
93
22
  }
94
23
  declare function isAxCloudError(error: unknown): error is AxCloudError;
95
24
 
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
-
140
- /**
141
- * AxCloud SDK Types
142
- *
143
- * Note: In the future, these types should be auto-generated from the OpenAPI spec.
144
- * For now, they are manually defined based on the AxCloud API.
145
- */
146
-
147
- type AxCloudModule = 'content' | 'members' | 'sections' | 'training' | 'ai' | 'documents' | 'voting';
148
- type SystemRole = 'super_admin' | 'org_admin' | 'section_admin' | 'member' | 'viewer';
149
- type UserRole = SystemRole | 'superadmin' | 'admin' | 'editor';
150
- type BaseRole = 'org_admin' | 'section_admin' | 'member' | 'viewer';
151
- /**
152
- * Custom role definition
153
- */
154
- interface CustomRole {
155
- role_id: string;
156
- org_id: string;
157
- name: string;
158
- description?: string;
159
- baseRole: BaseRole;
160
- permissions?: string[];
161
- deniedPermissions?: string[];
162
- effectivePermissions?: string[];
163
- color?: string;
164
- icon?: string;
165
- hierarchy: number;
166
- isSystem: false;
167
- isActive: boolean;
168
- createdAt: string;
169
- updatedAt: string;
170
- }
171
- interface Organization {
172
- id: string;
173
- name: string;
174
- slug: string;
175
- description?: string;
176
- modules: AxCloudModule[];
177
- settings?: OrganizationSettings;
178
- createdAt: string;
179
- updatedAt: string;
180
- }
181
- interface OrganizationSettings {
182
- allowPublicSignup?: boolean;
183
- requireEmailVerification?: boolean;
184
- defaultUserRole?: UserRole;
185
- theme?: {
186
- primaryColor?: string;
187
- logo?: string;
188
- };
189
- }
190
- interface Section {
191
- id: string;
192
- organizationId: string;
193
- name: string;
194
- description?: string;
195
- slug: string;
196
- parentId?: string;
197
- permissions?: SectionPermissions;
198
- createdAt: string;
199
- updatedAt: string;
200
- }
201
- interface SectionPermissions {
202
- canViewMembers?: boolean;
203
- canEditContent?: boolean;
204
- canManageMembers?: boolean;
205
- }
206
- interface User {
207
- id: string;
208
- email: string;
209
- name: string;
210
- firstName?: string;
211
- lastName?: string;
212
- /** Organization-specific title/position. Managed by organization administrators. */
213
- title?: string | null;
214
- phone?: string | null;
215
- address?: string | null;
216
- avatar?: string;
217
- organizationId: string;
218
- sectionId?: string;
219
- role: UserRole;
220
- customRole?: CustomRole;
221
- permissions?: string[];
222
- metadata?: Record<string, unknown>;
223
- createdAt: string;
224
- updatedAt: string;
225
- }
226
- /**
227
- * Check if user has a specific permission
228
- */
229
- declare function userHasPermission(user: User, permission: string): boolean;
230
- /**
231
- * Check if user has any of the specified permissions
232
- */
233
- declare function userHasAnyPermission(user: User, permissions: string[]): boolean;
234
- /**
235
- * Check if user has all of the specified permissions
236
- */
237
- declare function userHasAllPermissions(user: User, permissions: string[]): boolean;
238
- interface Membership {
239
- userId: string;
240
- organizationId: string;
241
- sectionId?: string;
242
- section?: Section;
243
- role: UserRole;
244
- /** Organization-specific title/position, separate from the access role. */
245
- title?: string | null;
246
- status: 'active' | 'pending' | 'suspended' | 'expired';
247
- joinedAt: string;
248
- expiresAt?: string;
249
- metadata?: Record<string, unknown>;
250
- }
251
- interface ContentBlock {
252
- id: string;
253
- type: string;
254
- content?: string;
255
- url?: string;
256
- alt?: string;
257
- level?: 1 | 2 | 3 | 4 | 5 | 6;
258
- items?: unknown[];
259
- language?: string;
260
- caption?: string;
261
- attributes?: Record<string, unknown>;
262
- ordered?: boolean;
263
- author?: string;
264
- }
265
- interface ContentTranslation {
266
- title: string;
267
- slug: string;
268
- description?: string;
269
- blocks: ContentBlock[];
270
- /** Structured website/template fields for this language. */
271
- fields?: Record<string, unknown>;
272
- metaTitle?: string;
273
- metaDescription?: string;
274
- keywords?: string[];
275
- }
276
- type ContentPublicationState = 'draft' | 'published' | 'archived';
277
- type ContentAudience = 'public' | 'internal' | 'members' | 'section';
278
- interface ContentItem {
279
- id: string;
280
- /** Present when a consumer needs to distinguish organizations outside its configured provider. */
281
- organizationId?: string;
282
- type: string;
283
- title: string;
284
- slug: string;
285
- /** Legacy string content. New AxCloud content uses `blocks`. */
286
- content?: string;
287
- description?: string;
288
- blocks?: ContentBlock[];
289
- /** Template identifier used by websites, e.g. "home" or "landing". */
290
- template?: string;
291
- /** Structured website/template fields. Frontends own layout and read these values by key. */
292
- fields?: Record<string, unknown>;
293
- excerpt?: string;
294
- author?: {
295
- id: string;
296
- name: string;
297
- };
298
- status?: ContentPublicationState;
299
- visibility?: ContentPublicationState;
300
- /** @deprecated Delivery access is derived from publication metadata and the verified visitor. */
301
- audience?: ContentAudience;
302
- sectionId?: string;
303
- tags?: string[];
304
- lang?: string;
305
- featuredImage?: string;
306
- metaTitle?: string;
307
- metaDescription?: string;
308
- keywords?: string[];
309
- translations?: Record<string, ContentTranslation>;
310
- currentLanguage?: string;
311
- availableLanguages?: string[];
312
- seo?: {
313
- canonical: string;
314
- hreflang: Array<{
315
- lang: string;
316
- href: string;
317
- }>;
318
- };
319
- publishedAt?: string;
320
- createdAt: string;
321
- updatedAt: string;
322
- }
323
- interface NewsItem extends ContentItem {
324
- type: 'news';
325
- featuredImage?: string;
326
- category?: string;
327
- tags?: string[];
328
- }
329
- interface Page extends ContentItem {
330
- type: 'page';
331
- template?: string;
332
- order?: number;
333
- }
334
- interface ContentListResponse<T> {
335
- items: T[];
336
- count: number;
337
- total: number;
338
- page: number;
339
- pageSize: number;
340
- hasMore: boolean;
341
- nextCursor?: string;
342
- }
343
- /** @deprecated Use ContentListResponse. */
344
- type PaginatedResponse<T> = ContentListResponse<T>;
345
- type ContentCollectionType = 'news' | 'pages' | 'events';
346
- type ContentDetailType = 'news' | 'page' | 'event';
347
- interface AxCloudConfig {
348
- orgId: string;
349
- apiUrl: string;
350
- /** API stage - defaults to 'dev'. Use 'prod' for production. */
351
- stage: string;
352
- /** API key for public content endpoints (optional - required for public API access) */
353
- apiKey?: string;
354
- /** Optional privacy-safe web analytics collection. */
355
- analytics?: AxCloudAnalyticsOptions;
356
- auth0: {
357
- domain: string;
358
- clientId: string;
359
- redirectUri: string;
360
- audience?: string;
361
- /** Auth0 Organization ID. Use this for invite-only member sites. */
362
- organization?: string;
363
- /** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
364
- connection?: string;
365
- };
366
- }
367
- interface ContentQueryOptions {
368
- page?: number;
369
- pageSize?: number;
370
- /** @deprecated Delivery endpoints always return the published snapshot. */
371
- status?: ContentPublicationState;
372
- /** @deprecated Delivery endpoints always return the published snapshot. */
373
- visibility?: ContentPublicationState;
374
- audience?: ContentAudience;
375
- /** @deprecated Member section access is derived from the verified token. */
376
- sectionId?: string;
377
- search?: string;
378
- sortBy?: 'publishedAt' | 'createdAt' | 'updatedAt' | 'title';
379
- sortOrder?: 'asc' | 'desc';
380
- tags?: string[];
381
- /** Return the requested translation when content has language variants. */
382
- lang?: string;
383
- /** Force public endpoint even when authenticated (for public pages) */
384
- publicOnly?: boolean;
385
- }
386
- /**
387
- * Organization branding information
388
- */
389
- interface OrganizationBranding {
390
- organizationId: string;
391
- name: string;
392
- branding: {
393
- /** Signed URL for logo (expires in 1 hour) */
394
- logoUrl: string | null;
395
- /** Seconds until logoUrl expires */
396
- logoExpiresIn: number | null;
397
- /** Primary brand color (hex) */
398
- primaryColor: string | null;
399
- /** Secondary brand color (hex) */
400
- secondaryColor: string | null;
401
- };
402
- }
403
- /**
404
- * Signed URL response for media assets
405
- */
406
- interface SignedMediaUrl {
407
- /** Signed S3 URL (expires in 1 hour) */
408
- url: string;
409
- /** Seconds until URL expires */
410
- expiresIn: number;
411
- /** S3 bucket name */
412
- bucket: string;
413
- /** S3 object key */
414
- key: string;
415
- }
416
- /**
417
- * Media list item
418
- */
419
- interface MediaItem {
420
- /** File key (filename) */
421
- key: string;
422
- /** File size in bytes */
423
- size: number;
424
- /** Last modified timestamp */
425
- lastModified: string;
426
- }
427
- /**
428
- * Media list response
429
- */
430
- interface MediaListResponse {
431
- items: MediaItem[];
432
- count: number;
433
- bucket: string;
434
- prefix: string;
435
- }
436
- type DocumentStatus = 'draft' | 'published' | 'archived';
437
- type DocumentAudience = 'public' | 'members' | 'section' | 'internal';
438
- type DocumentSourceProvider = 'upload' | 'sharepoint';
439
- /**
440
- * Public document metadata exposed through the AxCloud SDK.
441
- */
442
- interface DocumentItem {
443
- document_id: string;
444
- org_id: string;
445
- title: string;
446
- description?: string;
447
- filename: string;
448
- mime_type: string;
449
- size: number;
450
- status: DocumentStatus;
451
- audience: DocumentAudience;
452
- tags: string[];
453
- source_provider: DocumentSourceProvider;
454
- created_at: string;
455
- updated_at: string;
456
- published_at?: string;
457
- /** Section IDs this document is scoped to (member endpoint only). */
458
- section_ids?: string[];
459
- /** Display name of the member who uploaded the document (member endpoint only). */
460
- uploaded_by_name?: string;
461
- /** Folder IDs this document belongs to (member endpoint only). */
462
- folder_ids?: string[];
463
- }
464
- interface DocumentListResponse {
465
- items: DocumentItem[];
466
- count: number;
467
- }
468
- /**
469
- * A document folder the current member is allowed to see.
470
- *
471
- * Members receive folders for their own sections plus org-level folders
472
- * (`section_id === null`). Returned by the member document-folders endpoint.
473
- */
474
- interface DocumentFolder {
475
- id: string;
476
- /** Section this folder belongs to, or `null` for org-level folders. */
477
- section_id: string | null;
478
- /** Parent folder for nesting, or `null` for a top-level folder. */
479
- parent_folder_id: string | null;
480
- name: string;
481
- sort_order: number;
482
- }
483
- interface DocumentFolderListResponse {
484
- folders: DocumentFolder[];
485
- }
486
- interface SignedDocumentUrl {
487
- documentId: string;
488
- url: string;
489
- expiresIn: number;
490
- filename: string;
491
- mimeType: string;
492
- }
493
- interface DocumentQueryOptions {
494
- search?: string;
495
- tags?: string[];
496
- limit?: number;
497
- /** Restrict results to documents belonging to this folder (member endpoint only). */
498
- folderId?: string;
499
- }
500
-
501
- interface BarnsportMunicipality {
502
- id: string;
503
- slug: string;
504
- name: string;
505
- county?: string;
506
- geo?: {
507
- lat: number;
508
- lng: number;
509
- bounds?: [number, number, number, number];
510
- };
511
- }
512
- interface BarnsportSportArticle {
513
- short_description?: string;
514
- what_is_it?: string;
515
- why_fun?: string;
516
- good_to_know?: {
517
- age?: string;
518
- equipment?: string;
519
- cost?: string;
520
- };
521
- fun_facts?: string[];
522
- }
523
- interface BarnsportSport {
524
- id: string;
525
- slug: string;
526
- name: string;
527
- icon?: string;
528
- color?: string;
529
- category?: string;
530
- is_featured?: boolean;
531
- hero_image_url?: string;
532
- short_description?: string;
533
- /** Present on the single-sport endpoint (GET /public/{orgId}/sports/{slug}). */
534
- article?: BarnsportSportArticle;
535
- }
536
- interface BarnsportActivitySchedule {
537
- weekday?: number;
538
- starts_at?: string;
539
- ends_at?: string;
540
- label?: string;
541
- season?: string;
542
- }
543
- interface BarnsportActivityLocation {
544
- name?: string;
545
- address?: string;
546
- lat?: number;
547
- lng?: number;
548
- }
549
- interface BarnsportRegistrationMethod {
550
- type: 'url' | 'email' | 'phone' | 'form' | 'external';
551
- label?: string;
552
- value: string;
553
- instructions?: string;
554
- preferred?: boolean;
555
- }
556
- interface BarnsportActivityListItem {
557
- id: string;
558
- slug: string;
559
- title: string;
560
- summary?: string;
561
- sport: {
562
- id: string;
563
- slug: string;
564
- name?: string;
565
- icon?: string;
566
- };
567
- municipality: {
568
- id: string;
569
- slug: string;
570
- name?: string;
571
- };
572
- club: {
573
- id: string;
574
- slug: string;
575
- name?: string;
576
- };
577
- birthYears?: number[];
578
- minBirthYear?: number;
579
- maxBirthYear?: number;
580
- ageLabel?: string;
581
- schedule: BarnsportActivitySchedule[];
582
- location?: BarnsportActivityLocation;
583
- registrationSummary?: string;
584
- updatedAt: string;
585
- }
586
- interface BarnsportActivity {
587
- activity_id: string;
588
- org_id: string;
589
- slug: string;
590
- title: string;
591
- summary?: string;
592
- description?: string;
593
- sport_id: string;
594
- sport_slug: string;
595
- sport_name?: string;
596
- sport_icon?: string;
597
- municipality_id: string;
598
- municipality_slug: string;
599
- municipality_name?: string;
600
- club_id: string;
601
- club_slug: string;
602
- club_name?: string;
603
- club_website_url?: string;
604
- birth_years?: number[];
605
- min_birth_year?: number;
606
- max_birth_year?: number;
607
- age_label?: string;
608
- schedule: BarnsportActivitySchedule[];
609
- location?: BarnsportActivityLocation;
610
- registration: {
611
- methods: BarnsportRegistrationMethod[];
612
- deadline?: string;
613
- price_label?: string;
614
- };
615
- seo?: {
616
- title?: string;
617
- description?: string;
618
- image_media_id?: string;
619
- };
620
- published_at?: string;
621
- updated_at: string;
622
- }
623
- interface BarnsportActivitiesFilter {
624
- municipality?: string;
625
- sport?: string;
626
- birthYear?: number;
627
- q?: string;
628
- search?: string;
629
- sort?: 'updated' | 'name' | 'relevance';
630
- cursor?: string;
631
- limit?: number;
632
- }
633
- interface BarnsportListResponse<T> {
634
- items: T[];
635
- count: number;
636
- nextCursor?: string | null;
637
- }
638
- interface BarnsportActivityResponse {
639
- activity: BarnsportActivity;
640
- }
641
- interface BarnsportSitemapUrl {
642
- loc: string;
643
- lastmod?: string;
644
- changefreq?: string;
645
- priority?: number;
646
- }
647
- interface BarnsportSitemapResponse {
648
- baseUrl: string;
649
- updatedAt: string;
650
- urls: BarnsportSitemapUrl[];
651
- }
652
- interface BarnsportInterestSubmissionRequest {
653
- activitySlug: string;
654
- guardianName: string;
655
- guardianEmail: string;
656
- guardianPhone?: string;
657
- childName?: string;
658
- childBirthYear?: number;
659
- message?: string;
660
- consent: {
661
- contact: boolean;
662
- privacyVersion: string;
663
- };
664
- honeypot?: string;
665
- source?: {
666
- site?: string;
667
- pageUrl?: string;
668
- utm?: Record<string, string>;
669
- };
670
- }
671
- interface BarnsportInterestSubmissionResponse {
672
- success: boolean;
673
- submissionId?: string;
674
- duplicate?: boolean;
675
- message: string;
676
- }
677
-
678
- type ContentSlotValue = string | number | boolean | null | undefined | string[] | Record<string, unknown> | unknown[];
679
- type ContentSlotMap = Record<string, ContentSlotValue>;
680
- interface ContentSlotImage {
681
- url: string;
682
- alt?: string;
683
- caption?: string;
684
- }
685
- interface ContentSlotReader {
686
- fields: ContentSlotMap;
687
- value<T = ContentSlotValue>(key: string, fallback?: T): ContentSlotValue | T;
688
- text(key: string, fallback?: string): string;
689
- /** @deprecated HTML is untrusted. Prefer text(), or unsafeHtml() with sanitization. */
690
- html(key: string, fallback?: string): string;
691
- /** Returns untrusted CMS HTML. Sanitize it before inserting it into the DOM. */
692
- unsafeHtml(key: string, fallback?: string): string;
693
- list(key: string, fallback?: string[]): string[];
694
- image(key: string, fallback?: ContentSlotImage): ContentSlotImage | undefined;
695
- }
696
- declare function getContentSlotMap(content?: Pick<ContentItem, 'fields' | 'blocks'> | null): ContentSlotMap;
697
- declare function createContentSlotReader(content?: Pick<ContentItem, 'fields' | 'blocks'> | null): ContentSlotReader;
698
-
699
25
  /**
700
26
  * AxCloud Forms Module
701
27
  *
@@ -1032,31 +358,7 @@ interface AxCloudProviderProps {
1032
358
  * </AxCloudProvider>
1033
359
  * ```
1034
360
  */
1035
- declare function AxCloudProvider({ children, orgId, apiUrl, stage, apiKey, analytics, auth0, queryClient: providedQueryClient, timeout, }: AxCloudProviderProps): react_jsx_runtime.JSX.Element;
1036
-
1037
- interface AxCloudContextValue {
1038
- config: AxCloudConfig;
1039
- client: AxCloudClient;
1040
- orgId: string;
1041
- /** API stage (e.g., 'dev', 'prod') */
1042
- stage: string;
1043
- /** Whether using public API mode (API key, no auth) */
1044
- isPublicMode: boolean;
1045
- /** Auth0 has completed its initial session check. */
1046
- isAuthLoading?: boolean;
1047
- /** Whether the current browser session is authenticated. */
1048
- isAuthenticated?: boolean;
1049
- /** Auth0 subject used to isolate member-only query caches. */
1050
- authSubject?: string;
1051
- /** Remove identity-bound AxCloud query data before logout or account changes. */
1052
- clearContentCache?: () => void;
1053
- analytics: AnalyticsRuntime;
1054
- }
1055
- declare function useAxCloudContext(): AxCloudContextValue;
1056
-
1057
- type AnalyticsRuntimeConfig = Pick<AxCloudConfig, 'analytics' | 'apiUrl' | 'orgId' | 'stage'>;
1058
- declare function useAnalyticsRuntime(config: AnalyticsRuntimeConfig): AnalyticsRuntime;
1059
- declare function useAnalytics(): AnalyticsRuntime;
361
+ declare function AxCloudProvider({ children, orgId, apiUrl, stage, apiKey, analytics, auth0, queryClient: providedQueryClient, timeout, }: AxCloudProviderProps): React.JSX.Element;
1060
362
 
1061
363
  interface AuthUser {
1062
364
  id: string;
@@ -1104,7 +406,7 @@ interface Auth0ClientState {
1104
406
  logout: ReturnType<typeof useAuth0>['logout'];
1105
407
  getAccessTokenSilently: ReturnType<typeof useAuth0>['getAccessTokenSilently'];
1106
408
  getIdTokenClaims: ReturnType<typeof useAuth0>['getIdTokenClaims'];
1107
- user: User$1 | undefined;
409
+ user: User | undefined;
1108
410
  isAuthenticated: boolean;
1109
411
  isLoading: boolean;
1110
412
  error: Error | undefined;
@@ -1159,7 +461,7 @@ interface UserOrganizationMembership {
1159
461
  sectionIds: string[];
1160
462
  sections: UserOrganizationSection[];
1161
463
  }
1162
- interface UserApiResponse extends User {
464
+ interface UserApiResponse extends User$1 {
1163
465
  allOrgIds: string[];
1164
466
  organizationMemberships: Record<string, UserOrganizationMembership>;
1165
467
  effectiveOrganizationId: string | null;
@@ -1341,62 +643,8 @@ declare function useNews(options?: ContentQueryOptions): {
1341
643
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ContentListResponse<NewsItem>, Error>>;
1342
644
  };
1343
645
 
1344
- /**
1345
- * Fetch a published content collection.
1346
- *
1347
- * AxCloud owns editorial data and publication. The consuming application owns
1348
- * layout and rendering. Drafts are intentionally never selectable through
1349
- * this delivery hook.
1350
- */
1351
- declare function useContent<T extends ContentItem = ContentItem>(contentType: string, options?: ContentQueryOptions): {
1352
- data: T[];
1353
- count: number;
1354
- total: number;
1355
- page: number;
1356
- pageSize: number;
1357
- hasMore: boolean;
1358
- nextCursor: string | undefined;
1359
- isLoading: boolean;
1360
- isFetching: boolean;
1361
- isError: boolean;
1362
- error: Error | null;
1363
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<ContentListResponse<T>, Error>>;
1364
- };
1365
- interface ContentItemOptions {
1366
- /** Force public delivery even when the visitor is authenticated. */
1367
- publicOnly?: boolean;
1368
- /** Return the requested translation when content has language variants. */
1369
- lang?: string;
1370
- }
1371
- /** Fetch one published content item by ID or slug. */
1372
- declare function useContentItem<T extends ContentItem = ContentItem>(contentType: string, idOrSlug: string, options?: ContentItemOptions): {
1373
- data: _tanstack_react_query.NoInfer<T> | null;
1374
- isLoading: boolean;
1375
- isFetching: boolean;
1376
- isError: boolean;
1377
- error: Error | null;
1378
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.NoInfer<T>, Error>>;
1379
- };
1380
- interface PageContentState<T extends ContentItem = ContentItem> extends ContentSlotReader {
1381
- page: T | null;
1382
- data: T | null;
1383
- isLoading: boolean;
1384
- isFetching: boolean;
1385
- isError: boolean;
1386
- error: Error | null;
1387
- refetch: () => unknown;
1388
- }
1389
- /**
1390
- * Fetch a website page and expose structured template fields.
1391
- *
1392
- * Use `page.content`/`page.blocks` for article-like rich text pages. Use
1393
- * `text('hero.title')`, `list('benefits.items')`, etc. for designed website
1394
- * templates where the frontend owns layout and AxCloud owns content.
1395
- */
1396
- declare function usePageContent<T extends ContentItem = ContentItem>(slug: string, options?: ContentItemOptions): PageContentState<T>;
1397
-
1398
646
  interface SectionWithMembers extends Section {
1399
- members?: User[];
647
+ members?: User$1[];
1400
648
  memberCount?: number;
1401
649
  }
1402
650
  /**
@@ -1431,7 +679,7 @@ declare function useMySection(options?: {
1431
679
  }): {
1432
680
  section: SectionWithMembers | null;
1433
681
  sectionId: string | null;
1434
- members: User[];
682
+ members: User$1[];
1435
683
  memberCount: number;
1436
684
  isLoading: boolean;
1437
685
  isError: boolean;
@@ -1902,57 +1150,6 @@ declare function useMemberDocumentDownload(documentId: string | undefined): {
1902
1150
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
1903
1151
  };
1904
1152
 
1905
- declare function useBarnsportMunicipalities(): {
1906
- municipalities: BarnsportMunicipality[];
1907
- count: number;
1908
- isLoading: boolean;
1909
- isError: boolean;
1910
- error: Error | null;
1911
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportMunicipality>, Error>>;
1912
- };
1913
- declare function useBarnsportSports(): {
1914
- sports: BarnsportSport[];
1915
- count: number;
1916
- isLoading: boolean;
1917
- isError: boolean;
1918
- error: Error | null;
1919
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportSport>, Error>>;
1920
- };
1921
- declare function useBarnsportSport(slug: string | undefined): {
1922
- sport: BarnsportSport | null;
1923
- isLoading: boolean;
1924
- isError: boolean;
1925
- error: Error | null;
1926
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
1927
- sport: BarnsportSport;
1928
- }, Error>>;
1929
- };
1930
- declare function useBarnsportActivities(filters?: BarnsportActivitiesFilter): {
1931
- activities: BarnsportActivityListItem[];
1932
- count: number;
1933
- nextCursor: string | null;
1934
- isLoading: boolean;
1935
- isError: boolean;
1936
- error: Error | null;
1937
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportActivityListItem>, Error>>;
1938
- };
1939
- declare function useBarnsportActivity(slug: string | undefined): {
1940
- activity: BarnsportActivity | null;
1941
- isLoading: boolean;
1942
- isError: boolean;
1943
- error: Error | null;
1944
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportActivityResponse, Error>>;
1945
- };
1946
- declare function useBarnsportSitemap(baseUrl?: string): {
1947
- sitemap: BarnsportSitemapResponse | null;
1948
- urls: BarnsportSitemapUrl[];
1949
- isLoading: boolean;
1950
- isError: boolean;
1951
- error: Error | null;
1952
- refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportSitemapResponse, Error>>;
1953
- };
1954
- declare function useSubmitBarnsportInterest(): _tanstack_react_query.UseMutationResult<BarnsportInterestSubmissionResponse, Error, BarnsportInterestSubmissionRequest, unknown>;
1955
-
1956
1153
  interface LoginButtonProps {
1957
1154
  /**
1958
1155
  * Button text when not authenticated
@@ -1985,7 +1182,7 @@ interface LoginButtonProps {
1985
1182
  * <LoginButton className="btn btn-primary">Sign In</LoginButton>
1986
1183
  * ```
1987
1184
  */
1988
- declare function LoginButton({ children, returnTo, className, style, }: LoginButtonProps): react_jsx_runtime.JSX.Element;
1185
+ declare function LoginButton({ children, returnTo, className, style, }: LoginButtonProps): React.JSX.Element;
1989
1186
  interface LogoutButtonProps {
1990
1187
  /**
1991
1188
  * Button text
@@ -2012,7 +1209,7 @@ interface LogoutButtonProps {
2012
1209
  * <LogoutButton>Sign Out</LogoutButton>
2013
1210
  * ```
2014
1211
  */
2015
- declare function LogoutButton({ children, returnTo, className, style, }: LogoutButtonProps): react_jsx_runtime.JSX.Element;
1212
+ declare function LogoutButton({ children, returnTo, className, style, }: LogoutButtonProps): React.JSX.Element;
2016
1213
 
2017
1214
  interface ProtectedRouteProps {
2018
1215
  /**
@@ -2080,7 +1277,7 @@ interface ProtectedRouteProps {
2080
1277
  * </ProtectedRoute>
2081
1278
  * ```
2082
1279
  */
2083
- declare function ProtectedRoute({ children, roles, loadingComponent, unauthenticatedComponent, unauthorizedComponent, redirectToLogin, returnTo, }: ProtectedRouteProps): react_jsx_runtime.JSX.Element;
1280
+ declare function ProtectedRoute({ children, roles, loadingComponent, unauthenticatedComponent, unauthorizedComponent, redirectToLogin, returnTo, }: ProtectedRouteProps): React.JSX.Element;
2084
1281
 
2085
1282
  interface ModuleGateProps {
2086
1283
  /**
@@ -2129,7 +1326,7 @@ interface ModuleGateProps {
2129
1326
  * </ModuleGate>
2130
1327
  * ```
2131
1328
  */
2132
- declare function ModuleGate({ module, children, fallback, requireAll, }: ModuleGateProps): react_jsx_runtime.JSX.Element | null;
1329
+ declare function ModuleGate({ module, children, fallback, requireAll, }: ModuleGateProps): React.JSX.Element | null;
2133
1330
  /**
2134
1331
  * useModuleAccess - Hook for programmatic module checks
2135
1332
  *
@@ -2154,6 +1351,31 @@ declare function useModuleAccess(): {
2154
1351
  isLoading: boolean;
2155
1352
  };
2156
1353
 
1354
+ /**
1355
+ * LinkedAccountsList Component
1356
+ *
1357
+ * Ready-to-use component for displaying and managing linked social accounts.
1358
+ * Can be used in customer frontends (SPF "mina sidor" etc.).
1359
+ *
1360
+ * Import the CSS file for default styling:
1361
+ * import '@axcode/axcloud-sdk/styles/linked-accounts.css'
1362
+ *
1363
+ * @example
1364
+ * ```tsx
1365
+ * import { LinkedAccountsList } from '@axcode/axcloud-sdk'
1366
+ * import '@axcode/axcloud-sdk/styles/linked-accounts.css'
1367
+ *
1368
+ * function MinProfil() {
1369
+ * return (
1370
+ * <div>
1371
+ * <h2>Kopplade konton</h2>
1372
+ * <LinkedAccountsList providers={['google', 'microsoft']} />
1373
+ * </div>
1374
+ * )
1375
+ * }
1376
+ * ```
1377
+ */
1378
+
2157
1379
  interface LinkedAccountsListProps {
2158
1380
  /** Which providers to show (default: all available) */
2159
1381
  providers?: ('google' | 'microsoft' | 'apple')[];
@@ -2176,6 +1398,6 @@ interface LinkedAccountsListProps {
2176
1398
  * Uses CSS classes for styling. Import the CSS file for default styles:
2177
1399
  * import '@axcode/axcloud-sdk/styles/linked-accounts.css'
2178
1400
  */
2179
- declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): react_jsx_runtime.JSX.Element;
1401
+ declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): React.JSX.Element;
2180
1402
 
2181
- 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 ContentCollectionType, type ContentDetailType, type ContentItem, type ContentListResponse, 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 MyProfileResponse, 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 UpdateMyProfileInput, type UseAuthReturn, type UseLinkedAccountsReturn, type User, type UserApiResponse, type UserOrganizationMembership, type UserOrganizationSection, 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, useUpdateMyProfile, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };
1403
+ export { type Auth0ClientState, type AuthUser, type AvailableProvider, AxCloudAnalyticsOptions, AxCloudError, type AxCloudErrorCode, AxCloudModule, AxCloudProvider, type Ballot, type BallotCandidate, type BallotOption, type BallotSeat, type CastVoteResult, type CodeEligibility, ContentListResponse, ContentQueryOptions, DocumentFolder, DocumentFolderListResponse, DocumentItem, DocumentListResponse, DocumentQueryOptions, type EmailVerificationResult, type FormStatsResponse, type FormSubmission, type FormSubmissionRecord, type FormSubmissionResponse, type FormSubmissionsResponse, LinkedAccountsList, type LinkedAccountsListProps, type LinkedIdentity, LoginButton, LogoutButton, MediaItem, MediaListResponse, ModuleGate, type MyProfileResponse, NewsItem, Organization, OrganizationBranding, ProtectedRoute, Section, SignedDocumentUrl, SignedMediaUrl, type UpdateMyProfileInput, type UseAuthReturn, type UseLinkedAccountsReturn, User$1 as User, type UserApiResponse, type UserOrganizationMembership, type UserOrganizationSection, UserRole, type VoteReceipt, castVote, castVoteWithCode, checkEligibility, checkVotingCode, createFormHelper, getBallot, getVotingReceipt, isAxCloudError, submitForm, useAuth, useAvatar, useBranding, useCodeBallot, useDocumentDownload, useDocuments, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useMemberDocumentDownload, useMemberDocumentFolders, useMemberDocuments, useModuleAccess, useMySection, useNews, useOrg, useSections, useUpdateFormSubmission, useUpdateMyProfile, useUser };