@axcode/axcloud-sdk 0.1.6 → 0.1.7-dev.580a922
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/README.md +39 -3
- package/dist/index.d.mts +515 -1
- package/dist/index.d.ts +515 -1
- package/dist/index.js +426 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +409 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,10 +87,10 @@ function NewsPage() {
|
|
|
87
87
|
|
|
88
88
|
> **Content visibility:** When the user is authenticated, `useNews`, `useContent('pages')`, and `useContent('events')` automatically fetch **public + internal + members-only** content based on the user's organization membership. For anonymous users, only public content is returned.
|
|
89
89
|
|
|
90
|
-
Pages can be stored once in AxCloud with translations and requested per language:
|
|
90
|
+
Pages and news can be stored once in AxCloud with translations and requested per language:
|
|
91
91
|
|
|
92
92
|
```tsx
|
|
93
|
-
import { useContentItem } from '@axcode/axcloud-sdk'
|
|
93
|
+
import { useContentItem, useNews } from '@axcode/axcloud-sdk'
|
|
94
94
|
|
|
95
95
|
function AboutPage({ locale }: { locale: 'sv' | 'en' }) {
|
|
96
96
|
const { data: page } = useContentItem('pages', 'about-us', {
|
|
@@ -100,6 +100,12 @@ function AboutPage({ locale }: { locale: 'sv' | 'en' }) {
|
|
|
100
100
|
|
|
101
101
|
return <h1>{page?.title}</h1>
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
function NewsList({ locale }: { locale: 'sv' | 'en' }) {
|
|
105
|
+
const { data: news } = useNews({ lang: locale })
|
|
106
|
+
|
|
107
|
+
return news.map(item => <article key={item.id}>{item.title}</article>)
|
|
108
|
+
}
|
|
103
109
|
```
|
|
104
110
|
|
|
105
111
|
### 3. Add authentication
|
|
@@ -215,7 +221,35 @@ function HeroImage() {
|
|
|
215
221
|
|
|
216
222
|
> **Note:** Media URLs are signed S3 URLs that expire after 1 hour. The SDK automatically refreshes them before expiry (staleTime: 30 min).
|
|
217
223
|
|
|
218
|
-
### 6.
|
|
224
|
+
### 6. Fetch public documents
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
import { useDocuments, useDocumentDownload } from '@axcode/axcloud-sdk'
|
|
228
|
+
|
|
229
|
+
function PublicDocuments() {
|
|
230
|
+
const { documents, isLoading } = useDocuments({ tags: ['handbook'], limit: 20 })
|
|
231
|
+
|
|
232
|
+
if (isLoading) return <Skeleton />
|
|
233
|
+
return (
|
|
234
|
+
<ul>
|
|
235
|
+
{documents.map(doc => (
|
|
236
|
+
<li key={doc.document_id}>
|
|
237
|
+
<DocumentLink documentId={doc.document_id} title={doc.title} />
|
|
238
|
+
</li>
|
|
239
|
+
))}
|
|
240
|
+
</ul>
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function DocumentLink({ documentId, title }: { documentId: string; title: string }) {
|
|
245
|
+
const { documentUrl } = useDocumentDownload(documentId)
|
|
246
|
+
return documentUrl ? <a href={documentUrl}>{title}</a> : <span>{title}</span>
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Only documents with `status: "published"` and `audience: "public"` are exposed through SDK document hooks.
|
|
251
|
+
|
|
252
|
+
### 7. Gate features by module
|
|
219
253
|
|
|
220
254
|
```tsx
|
|
221
255
|
import { ModuleGate, useOrg } from '@axcode/axcloud-sdk'
|
|
@@ -261,6 +295,8 @@ function Dashboard() {
|
|
|
261
295
|
| `useMedia(mediaId)` | Fetch specific media file URL |
|
|
262
296
|
| `useAvatar(userId)` | Fetch user avatar URL |
|
|
263
297
|
| `useMediaList(type)` | List media files |
|
|
298
|
+
| `useDocuments(options?)` | List published public documents |
|
|
299
|
+
| `useDocumentDownload(documentId)` | Fetch a signed document download URL |
|
|
264
300
|
|
|
265
301
|
### Content Query Options
|
|
266
302
|
|
package/dist/index.d.mts
CHANGED
|
@@ -366,6 +366,247 @@ interface MediaListResponse {
|
|
|
366
366
|
bucket: string;
|
|
367
367
|
prefix: string;
|
|
368
368
|
}
|
|
369
|
+
type DocumentStatus = 'draft' | 'published' | 'archived';
|
|
370
|
+
type DocumentAudience = 'public' | 'members' | 'section' | 'internal';
|
|
371
|
+
type DocumentSourceProvider = 'upload' | 'sharepoint';
|
|
372
|
+
/**
|
|
373
|
+
* Public document metadata exposed through the AxCloud SDK.
|
|
374
|
+
*/
|
|
375
|
+
interface DocumentItem {
|
|
376
|
+
document_id: string;
|
|
377
|
+
org_id: string;
|
|
378
|
+
title: string;
|
|
379
|
+
description?: string;
|
|
380
|
+
filename: string;
|
|
381
|
+
mime_type: string;
|
|
382
|
+
size: number;
|
|
383
|
+
status: DocumentStatus;
|
|
384
|
+
audience: DocumentAudience;
|
|
385
|
+
tags: string[];
|
|
386
|
+
source_provider: DocumentSourceProvider;
|
|
387
|
+
created_at: string;
|
|
388
|
+
updated_at: string;
|
|
389
|
+
published_at?: string;
|
|
390
|
+
/** Section IDs this document is scoped to (member endpoint only). */
|
|
391
|
+
section_ids?: string[];
|
|
392
|
+
/** Display name of the member who uploaded the document (member endpoint only). */
|
|
393
|
+
uploaded_by_name?: string;
|
|
394
|
+
/** Folder IDs this document belongs to (member endpoint only). */
|
|
395
|
+
folder_ids?: string[];
|
|
396
|
+
}
|
|
397
|
+
interface DocumentListResponse {
|
|
398
|
+
items: DocumentItem[];
|
|
399
|
+
count: number;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* A document folder the current member is allowed to see.
|
|
403
|
+
*
|
|
404
|
+
* Members receive folders for their own sections plus org-level folders
|
|
405
|
+
* (`section_id === null`). Returned by the member document-folders endpoint.
|
|
406
|
+
*/
|
|
407
|
+
interface DocumentFolder {
|
|
408
|
+
id: string;
|
|
409
|
+
/** Section this folder belongs to, or `null` for org-level folders. */
|
|
410
|
+
section_id: string | null;
|
|
411
|
+
/** Parent folder for nesting, or `null` for a top-level folder. */
|
|
412
|
+
parent_folder_id: string | null;
|
|
413
|
+
name: string;
|
|
414
|
+
sort_order: number;
|
|
415
|
+
}
|
|
416
|
+
interface DocumentFolderListResponse {
|
|
417
|
+
folders: DocumentFolder[];
|
|
418
|
+
}
|
|
419
|
+
interface SignedDocumentUrl {
|
|
420
|
+
documentId: string;
|
|
421
|
+
url: string;
|
|
422
|
+
expiresIn: number;
|
|
423
|
+
filename: string;
|
|
424
|
+
mimeType: string;
|
|
425
|
+
}
|
|
426
|
+
interface DocumentQueryOptions {
|
|
427
|
+
search?: string;
|
|
428
|
+
tags?: string[];
|
|
429
|
+
limit?: number;
|
|
430
|
+
/** Restrict results to documents belonging to this folder (member endpoint only). */
|
|
431
|
+
folderId?: string;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
interface BarnsportMunicipality {
|
|
435
|
+
id: string;
|
|
436
|
+
slug: string;
|
|
437
|
+
name: string;
|
|
438
|
+
county?: string;
|
|
439
|
+
geo?: {
|
|
440
|
+
lat: number;
|
|
441
|
+
lng: number;
|
|
442
|
+
bounds?: [number, number, number, number];
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
interface BarnsportSportArticle {
|
|
446
|
+
short_description?: string;
|
|
447
|
+
what_is_it?: string;
|
|
448
|
+
why_fun?: string;
|
|
449
|
+
good_to_know?: {
|
|
450
|
+
age?: string;
|
|
451
|
+
equipment?: string;
|
|
452
|
+
cost?: string;
|
|
453
|
+
};
|
|
454
|
+
fun_facts?: string[];
|
|
455
|
+
}
|
|
456
|
+
interface BarnsportSport {
|
|
457
|
+
id: string;
|
|
458
|
+
slug: string;
|
|
459
|
+
name: string;
|
|
460
|
+
icon?: string;
|
|
461
|
+
color?: string;
|
|
462
|
+
category?: string;
|
|
463
|
+
is_featured?: boolean;
|
|
464
|
+
hero_image_url?: string;
|
|
465
|
+
short_description?: string;
|
|
466
|
+
/** Present on the single-sport endpoint (GET /public/{orgId}/sports/{slug}). */
|
|
467
|
+
article?: BarnsportSportArticle;
|
|
468
|
+
}
|
|
469
|
+
interface BarnsportActivitySchedule {
|
|
470
|
+
weekday?: number;
|
|
471
|
+
starts_at?: string;
|
|
472
|
+
ends_at?: string;
|
|
473
|
+
label?: string;
|
|
474
|
+
season?: string;
|
|
475
|
+
}
|
|
476
|
+
interface BarnsportActivityLocation {
|
|
477
|
+
name?: string;
|
|
478
|
+
address?: string;
|
|
479
|
+
lat?: number;
|
|
480
|
+
lng?: number;
|
|
481
|
+
}
|
|
482
|
+
interface BarnsportRegistrationMethod {
|
|
483
|
+
type: 'url' | 'email' | 'phone' | 'form' | 'external';
|
|
484
|
+
label?: string;
|
|
485
|
+
value: string;
|
|
486
|
+
instructions?: string;
|
|
487
|
+
preferred?: boolean;
|
|
488
|
+
}
|
|
489
|
+
interface BarnsportActivityListItem {
|
|
490
|
+
id: string;
|
|
491
|
+
slug: string;
|
|
492
|
+
title: string;
|
|
493
|
+
summary?: string;
|
|
494
|
+
sport: {
|
|
495
|
+
id: string;
|
|
496
|
+
slug: string;
|
|
497
|
+
name?: string;
|
|
498
|
+
icon?: string;
|
|
499
|
+
};
|
|
500
|
+
municipality: {
|
|
501
|
+
id: string;
|
|
502
|
+
slug: string;
|
|
503
|
+
name?: string;
|
|
504
|
+
};
|
|
505
|
+
club: {
|
|
506
|
+
id: string;
|
|
507
|
+
slug: string;
|
|
508
|
+
name?: string;
|
|
509
|
+
};
|
|
510
|
+
birthYears?: number[];
|
|
511
|
+
minBirthYear?: number;
|
|
512
|
+
maxBirthYear?: number;
|
|
513
|
+
ageLabel?: string;
|
|
514
|
+
schedule: BarnsportActivitySchedule[];
|
|
515
|
+
location?: BarnsportActivityLocation;
|
|
516
|
+
registrationSummary?: string;
|
|
517
|
+
updatedAt: string;
|
|
518
|
+
}
|
|
519
|
+
interface BarnsportActivity {
|
|
520
|
+
activity_id: string;
|
|
521
|
+
org_id: string;
|
|
522
|
+
slug: string;
|
|
523
|
+
title: string;
|
|
524
|
+
summary?: string;
|
|
525
|
+
description?: string;
|
|
526
|
+
sport_id: string;
|
|
527
|
+
sport_slug: string;
|
|
528
|
+
sport_name?: string;
|
|
529
|
+
sport_icon?: string;
|
|
530
|
+
municipality_id: string;
|
|
531
|
+
municipality_slug: string;
|
|
532
|
+
municipality_name?: string;
|
|
533
|
+
club_id: string;
|
|
534
|
+
club_slug: string;
|
|
535
|
+
club_name?: string;
|
|
536
|
+
club_website_url?: string;
|
|
537
|
+
birth_years?: number[];
|
|
538
|
+
min_birth_year?: number;
|
|
539
|
+
max_birth_year?: number;
|
|
540
|
+
age_label?: string;
|
|
541
|
+
schedule: BarnsportActivitySchedule[];
|
|
542
|
+
location?: BarnsportActivityLocation;
|
|
543
|
+
registration: {
|
|
544
|
+
methods: BarnsportRegistrationMethod[];
|
|
545
|
+
deadline?: string;
|
|
546
|
+
price_label?: string;
|
|
547
|
+
};
|
|
548
|
+
seo?: {
|
|
549
|
+
title?: string;
|
|
550
|
+
description?: string;
|
|
551
|
+
image_media_id?: string;
|
|
552
|
+
};
|
|
553
|
+
published_at?: string;
|
|
554
|
+
updated_at: string;
|
|
555
|
+
}
|
|
556
|
+
interface BarnsportActivitiesFilter {
|
|
557
|
+
municipality?: string;
|
|
558
|
+
sport?: string;
|
|
559
|
+
birthYear?: number;
|
|
560
|
+
q?: string;
|
|
561
|
+
search?: string;
|
|
562
|
+
sort?: 'updated' | 'name' | 'relevance';
|
|
563
|
+
cursor?: string;
|
|
564
|
+
limit?: number;
|
|
565
|
+
}
|
|
566
|
+
interface BarnsportListResponse<T> {
|
|
567
|
+
items: T[];
|
|
568
|
+
count: number;
|
|
569
|
+
nextCursor?: string | null;
|
|
570
|
+
}
|
|
571
|
+
interface BarnsportActivityResponse {
|
|
572
|
+
activity: BarnsportActivity;
|
|
573
|
+
}
|
|
574
|
+
interface BarnsportSitemapUrl {
|
|
575
|
+
loc: string;
|
|
576
|
+
lastmod?: string;
|
|
577
|
+
changefreq?: string;
|
|
578
|
+
priority?: number;
|
|
579
|
+
}
|
|
580
|
+
interface BarnsportSitemapResponse {
|
|
581
|
+
baseUrl: string;
|
|
582
|
+
updatedAt: string;
|
|
583
|
+
urls: BarnsportSitemapUrl[];
|
|
584
|
+
}
|
|
585
|
+
interface BarnsportInterestSubmissionRequest {
|
|
586
|
+
activitySlug: string;
|
|
587
|
+
guardianName: string;
|
|
588
|
+
guardianEmail: string;
|
|
589
|
+
guardianPhone?: string;
|
|
590
|
+
childName?: string;
|
|
591
|
+
childBirthYear?: number;
|
|
592
|
+
message?: string;
|
|
593
|
+
consent: {
|
|
594
|
+
contact: boolean;
|
|
595
|
+
privacyVersion: string;
|
|
596
|
+
};
|
|
597
|
+
honeypot?: string;
|
|
598
|
+
source?: {
|
|
599
|
+
site?: string;
|
|
600
|
+
pageUrl?: string;
|
|
601
|
+
utm?: Record<string, string>;
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
interface BarnsportInterestSubmissionResponse {
|
|
605
|
+
success: boolean;
|
|
606
|
+
submissionId?: string;
|
|
607
|
+
duplicate?: boolean;
|
|
608
|
+
message: string;
|
|
609
|
+
}
|
|
369
610
|
|
|
370
611
|
type ContentSlotValue = string | number | boolean | null | undefined | string[] | Record<string, unknown> | unknown[];
|
|
371
612
|
type ContentSlotMap = Record<string, ContentSlotValue>;
|
|
@@ -553,6 +794,128 @@ declare function createFormHelper(config: {
|
|
|
553
794
|
submit: (formType: "waitlist" | "contact" | "membership", email: string, data?: Record<string, unknown>) => Promise<FormSubmissionResponse>;
|
|
554
795
|
};
|
|
555
796
|
|
|
797
|
+
/**
|
|
798
|
+
* AxCloud Voting Module
|
|
799
|
+
*
|
|
800
|
+
* Functions for embedding voting/elections on a customer site (e.g. spf.se).
|
|
801
|
+
*
|
|
802
|
+
* Two channels:
|
|
803
|
+
* - PUBLIC (code): no login — the personal one-time code is the credential.
|
|
804
|
+
* Use {@link checkVotingCode}, {@link castVoteWithCode}, {@link getVotingReceipt}.
|
|
805
|
+
* - AUTHED (Auth0): a logged-in member votes with their access token.
|
|
806
|
+
* Use {@link getBallot}, {@link checkEligibility}, {@link castVote}.
|
|
807
|
+
*
|
|
808
|
+
* `votingApiUrl` is the Voting API base, e.g. 'https://api.axcloud.app/voting'.
|
|
809
|
+
*/
|
|
810
|
+
interface BallotSeat {
|
|
811
|
+
seat_id: string;
|
|
812
|
+
label_sv: string;
|
|
813
|
+
label_en?: string;
|
|
814
|
+
term?: string;
|
|
815
|
+
count: number;
|
|
816
|
+
order?: number;
|
|
817
|
+
}
|
|
818
|
+
interface BallotCandidate {
|
|
819
|
+
candidate_id: string;
|
|
820
|
+
name: string;
|
|
821
|
+
bio_sv?: string;
|
|
822
|
+
bio_en?: string;
|
|
823
|
+
presentation_media_id?: string;
|
|
824
|
+
photo_media_id?: string;
|
|
825
|
+
}
|
|
826
|
+
interface BallotOption {
|
|
827
|
+
option_id: string;
|
|
828
|
+
text: string;
|
|
829
|
+
description?: string;
|
|
830
|
+
}
|
|
831
|
+
interface Ballot {
|
|
832
|
+
poll_id: string;
|
|
833
|
+
poll_type: 'single_choice' | 'multiple_choice' | 'ranking' | 'election';
|
|
834
|
+
title: string;
|
|
835
|
+
title_en?: string;
|
|
836
|
+
description?: string;
|
|
837
|
+
description_en?: string;
|
|
838
|
+
seats?: BallotSeat[];
|
|
839
|
+
max_selections?: number;
|
|
840
|
+
min_selections?: number;
|
|
841
|
+
ends_at?: string;
|
|
842
|
+
options?: BallotOption[];
|
|
843
|
+
candidates?: BallotCandidate[];
|
|
844
|
+
}
|
|
845
|
+
interface CodeEligibility {
|
|
846
|
+
eligible: boolean;
|
|
847
|
+
has_voted: boolean;
|
|
848
|
+
reason?: string;
|
|
849
|
+
ballot?: Ballot;
|
|
850
|
+
}
|
|
851
|
+
interface VoteReceipt {
|
|
852
|
+
has_voted: boolean;
|
|
853
|
+
voted_at?: string;
|
|
854
|
+
selected_option_ids?: string[];
|
|
855
|
+
selection?: string[];
|
|
856
|
+
}
|
|
857
|
+
interface CastVoteResult {
|
|
858
|
+
success: boolean;
|
|
859
|
+
voted_at?: string;
|
|
860
|
+
message?: string;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Validate a personal code and, if valid, return the ballot to render.
|
|
864
|
+
*/
|
|
865
|
+
declare function checkVotingCode(votingApiUrl: string, params: {
|
|
866
|
+
orgId: string;
|
|
867
|
+
pollId: string;
|
|
868
|
+
code: string;
|
|
869
|
+
}): Promise<CodeEligibility>;
|
|
870
|
+
/**
|
|
871
|
+
* Cast a vote using a personal code.
|
|
872
|
+
*/
|
|
873
|
+
declare function castVoteWithCode(votingApiUrl: string, params: {
|
|
874
|
+
orgId: string;
|
|
875
|
+
pollId: string;
|
|
876
|
+
code: string;
|
|
877
|
+
selectedOptions: string[];
|
|
878
|
+
rankings?: Record<string, number>;
|
|
879
|
+
}): Promise<CastVoteResult>;
|
|
880
|
+
/**
|
|
881
|
+
* After voting, re-check a code to retrieve the voter's own selection.
|
|
882
|
+
*/
|
|
883
|
+
declare function getVotingReceipt(votingApiUrl: string, params: {
|
|
884
|
+
orgId: string;
|
|
885
|
+
pollId: string;
|
|
886
|
+
code: string;
|
|
887
|
+
}): Promise<VoteReceipt>;
|
|
888
|
+
/**
|
|
889
|
+
* Load a ballot (poll + candidates) for a logged-in member.
|
|
890
|
+
*/
|
|
891
|
+
declare function getBallot(votingApiUrl: string, params: {
|
|
892
|
+
orgId: string;
|
|
893
|
+
pollId: string;
|
|
894
|
+
accessToken: string;
|
|
895
|
+
}): Promise<Ballot>;
|
|
896
|
+
/**
|
|
897
|
+
* Check whether the logged-in member is eligible to vote / has already voted.
|
|
898
|
+
*/
|
|
899
|
+
declare function checkEligibility(votingApiUrl: string, params: {
|
|
900
|
+
orgId: string;
|
|
901
|
+
pollId: string;
|
|
902
|
+
accessToken: string;
|
|
903
|
+
}): Promise<{
|
|
904
|
+
eligible: boolean;
|
|
905
|
+
has_voted: boolean;
|
|
906
|
+
reason?: string;
|
|
907
|
+
}>;
|
|
908
|
+
/**
|
|
909
|
+
* Cast a vote as a logged-in member.
|
|
910
|
+
*/
|
|
911
|
+
declare function castVote(votingApiUrl: string, params: {
|
|
912
|
+
orgId: string;
|
|
913
|
+
pollId: string;
|
|
914
|
+
accessToken: string;
|
|
915
|
+
selectedOptions: string[];
|
|
916
|
+
rankings?: Record<string, number>;
|
|
917
|
+
}): Promise<CastVoteResult>;
|
|
918
|
+
|
|
556
919
|
interface AxCloudProviderProps {
|
|
557
920
|
children: React.ReactNode;
|
|
558
921
|
orgId: string;
|
|
@@ -1132,6 +1495,25 @@ declare function useUpdateFormSubmission(): _tanstack_react_query.UseMutationRes
|
|
|
1132
1495
|
notes?: string;
|
|
1133
1496
|
}, unknown>;
|
|
1134
1497
|
|
|
1498
|
+
type CodeBallotStage = 'enter_code' | 'ballot' | 'submitted' | 'already_voted';
|
|
1499
|
+
interface UseCodeBallotOptions {
|
|
1500
|
+
pollId: string;
|
|
1501
|
+
/** Override the Voting API base URL. Defaults to `${config.apiUrl}/voting`. */
|
|
1502
|
+
votingApiUrl?: string;
|
|
1503
|
+
}
|
|
1504
|
+
declare function useCodeBallot({ pollId, votingApiUrl }: UseCodeBallotOptions): {
|
|
1505
|
+
stage: CodeBallotStage;
|
|
1506
|
+
code: string;
|
|
1507
|
+
ballot: Ballot | null;
|
|
1508
|
+
receipt: VoteReceipt | null;
|
|
1509
|
+
reason: string | undefined;
|
|
1510
|
+
loading: boolean;
|
|
1511
|
+
error: string | null;
|
|
1512
|
+
validateCode: (inputCode: string) => Promise<CodeEligibility | null>;
|
|
1513
|
+
submitVote: (selectedOptions: string[], rankings?: Record<string, number>) => Promise<boolean>;
|
|
1514
|
+
reset: () => void;
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1135
1517
|
/**
|
|
1136
1518
|
* useLinkedAccounts Hook
|
|
1137
1519
|
*
|
|
@@ -1344,6 +1726,138 @@ declare function useMedia(mediaId: string): {
|
|
|
1344
1726
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedMediaUrl, Error>>;
|
|
1345
1727
|
};
|
|
1346
1728
|
|
|
1729
|
+
/**
|
|
1730
|
+
* List documents that have been explicitly published for public SDK access.
|
|
1731
|
+
*
|
|
1732
|
+
* Documents with members/internal/section audience stay inside AxCloud.
|
|
1733
|
+
*/
|
|
1734
|
+
declare function useDocuments(options?: DocumentQueryOptions): {
|
|
1735
|
+
documents: DocumentItem[];
|
|
1736
|
+
items: DocumentItem[];
|
|
1737
|
+
count: number;
|
|
1738
|
+
isLoading: boolean;
|
|
1739
|
+
isError: boolean;
|
|
1740
|
+
error: Error | null;
|
|
1741
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentListResponse, Error>>;
|
|
1742
|
+
};
|
|
1743
|
+
/**
|
|
1744
|
+
* Fetch a short-lived signed download URL for a public document.
|
|
1745
|
+
*/
|
|
1746
|
+
declare function useDocumentDownload(documentId: string | undefined): {
|
|
1747
|
+
url: string | null;
|
|
1748
|
+
documentUrl: string | null;
|
|
1749
|
+
filename: string | null;
|
|
1750
|
+
mimeType: string | null;
|
|
1751
|
+
expiresIn: number | null;
|
|
1752
|
+
isLoading: boolean;
|
|
1753
|
+
isError: boolean;
|
|
1754
|
+
error: Error | null;
|
|
1755
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
|
|
1756
|
+
};
|
|
1757
|
+
/**
|
|
1758
|
+
* List documents the current member is allowed to see.
|
|
1759
|
+
*
|
|
1760
|
+
* Hits the member endpoint (`/documents/members/...`) which is NOT a
|
|
1761
|
+
* `/public/` path, so the core client automatically attaches the member's
|
|
1762
|
+
* `Authorization: Bearer <JWT>` header instead of the public API key.
|
|
1763
|
+
*
|
|
1764
|
+
* Returns public documents plus members/internal documents and section
|
|
1765
|
+
* documents for the member's sections. Items include `section_ids` and
|
|
1766
|
+
* uploader metadata (`uploaded_by_name`, `created_at`).
|
|
1767
|
+
*/
|
|
1768
|
+
declare function useMemberDocuments(options?: DocumentQueryOptions): {
|
|
1769
|
+
documents: DocumentItem[];
|
|
1770
|
+
items: DocumentItem[];
|
|
1771
|
+
count: number;
|
|
1772
|
+
isLoading: boolean;
|
|
1773
|
+
isError: boolean;
|
|
1774
|
+
error: Error | null;
|
|
1775
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentListResponse, Error>>;
|
|
1776
|
+
};
|
|
1777
|
+
/**
|
|
1778
|
+
* List the document folders the current member is allowed to see.
|
|
1779
|
+
*
|
|
1780
|
+
* Hits the member endpoint (`/documents/members/${orgId}/document-folders`),
|
|
1781
|
+
* which is NOT a `/public/` path, so the core client attaches the member's
|
|
1782
|
+
* `Authorization: Bearer <JWT>` header instead of the public API key.
|
|
1783
|
+
*
|
|
1784
|
+
* Returns the member's section folders plus org-level folders
|
|
1785
|
+
* (`section_id === null`). Use the returned folder ids with
|
|
1786
|
+
* `useMemberDocuments({ folderId })` to scope a document list.
|
|
1787
|
+
*/
|
|
1788
|
+
declare function useMemberDocumentFolders(): {
|
|
1789
|
+
folders: DocumentFolder[];
|
|
1790
|
+
isLoading: boolean;
|
|
1791
|
+
isError: boolean;
|
|
1792
|
+
error: Error | null;
|
|
1793
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentFolderListResponse, Error>>;
|
|
1794
|
+
};
|
|
1795
|
+
/**
|
|
1796
|
+
* Fetch a short-lived signed download URL for a member-accessible document.
|
|
1797
|
+
*/
|
|
1798
|
+
declare function useMemberDocumentDownload(documentId: string | undefined): {
|
|
1799
|
+
url: string | null;
|
|
1800
|
+
documentUrl: string | null;
|
|
1801
|
+
filename: string | null;
|
|
1802
|
+
mimeType: string | null;
|
|
1803
|
+
expiresIn: number | null;
|
|
1804
|
+
isLoading: boolean;
|
|
1805
|
+
isError: boolean;
|
|
1806
|
+
error: Error | null;
|
|
1807
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1810
|
+
declare function useBarnsportMunicipalities(): {
|
|
1811
|
+
municipalities: BarnsportMunicipality[];
|
|
1812
|
+
count: number;
|
|
1813
|
+
isLoading: boolean;
|
|
1814
|
+
isError: boolean;
|
|
1815
|
+
error: Error | null;
|
|
1816
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportMunicipality>, Error>>;
|
|
1817
|
+
};
|
|
1818
|
+
declare function useBarnsportSports(): {
|
|
1819
|
+
sports: BarnsportSport[];
|
|
1820
|
+
count: number;
|
|
1821
|
+
isLoading: boolean;
|
|
1822
|
+
isError: boolean;
|
|
1823
|
+
error: Error | null;
|
|
1824
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportSport>, Error>>;
|
|
1825
|
+
};
|
|
1826
|
+
declare function useBarnsportSport(slug: string | undefined): {
|
|
1827
|
+
sport: BarnsportSport | null;
|
|
1828
|
+
isLoading: boolean;
|
|
1829
|
+
isError: boolean;
|
|
1830
|
+
error: Error | null;
|
|
1831
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
|
|
1832
|
+
sport: BarnsportSport;
|
|
1833
|
+
}, Error>>;
|
|
1834
|
+
};
|
|
1835
|
+
declare function useBarnsportActivities(filters?: BarnsportActivitiesFilter): {
|
|
1836
|
+
activities: BarnsportActivityListItem[];
|
|
1837
|
+
count: number;
|
|
1838
|
+
nextCursor: string | null;
|
|
1839
|
+
isLoading: boolean;
|
|
1840
|
+
isError: boolean;
|
|
1841
|
+
error: Error | null;
|
|
1842
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportActivityListItem>, Error>>;
|
|
1843
|
+
};
|
|
1844
|
+
declare function useBarnsportActivity(slug: string | undefined): {
|
|
1845
|
+
activity: BarnsportActivity | null;
|
|
1846
|
+
isLoading: boolean;
|
|
1847
|
+
isError: boolean;
|
|
1848
|
+
error: Error | null;
|
|
1849
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportActivityResponse, Error>>;
|
|
1850
|
+
};
|
|
1851
|
+
declare function useBarnsportSitemap(baseUrl?: string): {
|
|
1852
|
+
sitemap: BarnsportSitemapResponse | null;
|
|
1853
|
+
urls: BarnsportSitemapUrl[];
|
|
1854
|
+
isLoading: boolean;
|
|
1855
|
+
isError: boolean;
|
|
1856
|
+
error: Error | null;
|
|
1857
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportSitemapResponse, Error>>;
|
|
1858
|
+
};
|
|
1859
|
+
declare function useSubmitBarnsportInterest(): _tanstack_react_query.UseMutationResult<BarnsportInterestSubmissionResponse, Error, BarnsportInterestSubmissionRequest, unknown>;
|
|
1860
|
+
|
|
1347
1861
|
interface LoginButtonProps {
|
|
1348
1862
|
/**
|
|
1349
1863
|
* Button text when not authenticated
|
|
@@ -1569,4 +2083,4 @@ interface LinkedAccountsListProps {
|
|
|
1569
2083
|
*/
|
|
1570
2084
|
declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): react_jsx_runtime.JSX.Element;
|
|
1571
2085
|
|
|
1572
|
-
export { type AvailableProvider, AxCloudClient, type AxCloudConfig, AxCloudError, type AxCloudErrorCode, type AxCloudModule, AxCloudProvider, type BaseRole, type ContentItem, type ContentQueryOptions, type ContentSlotImage, type ContentSlotMap, type ContentSlotReader, type ContentSlotValue, type CustomRole, 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 SignedMediaUrl, type SystemRole, type UseLinkedAccountsReturn, type User, type UserRole, createClient, createContentSlotReader, createFormHelper, getClient, getContentSlotMap, isAxCloudError, submitForm, useAuth, useAvatar, useAxCloudContext, useBranding, useContent, useContentItem, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useModuleAccess, useMySection, useNews, useOrg, usePageContent, useSections, useUpdateFormSubmission, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };
|
|
2086
|
+
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 DocumentFolder, type DocumentFolderListResponse, 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, 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 };
|