@axcode/axcloud-sdk 0.1.6 → 0.1.7-dev.332678a
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 +67 -5
- package/dist/index.d.mts +537 -2
- package/dist/index.d.ts +537 -2
- package/dist/index.js +495 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +478 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -297,6 +297,8 @@ interface AxCloudConfig {
|
|
|
297
297
|
clientId: string;
|
|
298
298
|
redirectUri: string;
|
|
299
299
|
audience?: string;
|
|
300
|
+
/** Auth0 Organization ID. Use this for invite-only member sites. */
|
|
301
|
+
organization?: string;
|
|
300
302
|
/** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
|
|
301
303
|
connection?: string;
|
|
302
304
|
};
|
|
@@ -366,6 +368,247 @@ interface MediaListResponse {
|
|
|
366
368
|
bucket: string;
|
|
367
369
|
prefix: string;
|
|
368
370
|
}
|
|
371
|
+
type DocumentStatus = 'draft' | 'published' | 'archived';
|
|
372
|
+
type DocumentAudience = 'public' | 'members' | 'section' | 'internal';
|
|
373
|
+
type DocumentSourceProvider = 'upload' | 'sharepoint';
|
|
374
|
+
/**
|
|
375
|
+
* Public document metadata exposed through the AxCloud SDK.
|
|
376
|
+
*/
|
|
377
|
+
interface DocumentItem {
|
|
378
|
+
document_id: string;
|
|
379
|
+
org_id: string;
|
|
380
|
+
title: string;
|
|
381
|
+
description?: string;
|
|
382
|
+
filename: string;
|
|
383
|
+
mime_type: string;
|
|
384
|
+
size: number;
|
|
385
|
+
status: DocumentStatus;
|
|
386
|
+
audience: DocumentAudience;
|
|
387
|
+
tags: string[];
|
|
388
|
+
source_provider: DocumentSourceProvider;
|
|
389
|
+
created_at: string;
|
|
390
|
+
updated_at: string;
|
|
391
|
+
published_at?: string;
|
|
392
|
+
/** Section IDs this document is scoped to (member endpoint only). */
|
|
393
|
+
section_ids?: string[];
|
|
394
|
+
/** Display name of the member who uploaded the document (member endpoint only). */
|
|
395
|
+
uploaded_by_name?: string;
|
|
396
|
+
/** Folder IDs this document belongs to (member endpoint only). */
|
|
397
|
+
folder_ids?: string[];
|
|
398
|
+
}
|
|
399
|
+
interface DocumentListResponse {
|
|
400
|
+
items: DocumentItem[];
|
|
401
|
+
count: number;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* A document folder the current member is allowed to see.
|
|
405
|
+
*
|
|
406
|
+
* Members receive folders for their own sections plus org-level folders
|
|
407
|
+
* (`section_id === null`). Returned by the member document-folders endpoint.
|
|
408
|
+
*/
|
|
409
|
+
interface DocumentFolder {
|
|
410
|
+
id: string;
|
|
411
|
+
/** Section this folder belongs to, or `null` for org-level folders. */
|
|
412
|
+
section_id: string | null;
|
|
413
|
+
/** Parent folder for nesting, or `null` for a top-level folder. */
|
|
414
|
+
parent_folder_id: string | null;
|
|
415
|
+
name: string;
|
|
416
|
+
sort_order: number;
|
|
417
|
+
}
|
|
418
|
+
interface DocumentFolderListResponse {
|
|
419
|
+
folders: DocumentFolder[];
|
|
420
|
+
}
|
|
421
|
+
interface SignedDocumentUrl {
|
|
422
|
+
documentId: string;
|
|
423
|
+
url: string;
|
|
424
|
+
expiresIn: number;
|
|
425
|
+
filename: string;
|
|
426
|
+
mimeType: string;
|
|
427
|
+
}
|
|
428
|
+
interface DocumentQueryOptions {
|
|
429
|
+
search?: string;
|
|
430
|
+
tags?: string[];
|
|
431
|
+
limit?: number;
|
|
432
|
+
/** Restrict results to documents belonging to this folder (member endpoint only). */
|
|
433
|
+
folderId?: string;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
interface BarnsportMunicipality {
|
|
437
|
+
id: string;
|
|
438
|
+
slug: string;
|
|
439
|
+
name: string;
|
|
440
|
+
county?: string;
|
|
441
|
+
geo?: {
|
|
442
|
+
lat: number;
|
|
443
|
+
lng: number;
|
|
444
|
+
bounds?: [number, number, number, number];
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
interface BarnsportSportArticle {
|
|
448
|
+
short_description?: string;
|
|
449
|
+
what_is_it?: string;
|
|
450
|
+
why_fun?: string;
|
|
451
|
+
good_to_know?: {
|
|
452
|
+
age?: string;
|
|
453
|
+
equipment?: string;
|
|
454
|
+
cost?: string;
|
|
455
|
+
};
|
|
456
|
+
fun_facts?: string[];
|
|
457
|
+
}
|
|
458
|
+
interface BarnsportSport {
|
|
459
|
+
id: string;
|
|
460
|
+
slug: string;
|
|
461
|
+
name: string;
|
|
462
|
+
icon?: string;
|
|
463
|
+
color?: string;
|
|
464
|
+
category?: string;
|
|
465
|
+
is_featured?: boolean;
|
|
466
|
+
hero_image_url?: string;
|
|
467
|
+
short_description?: string;
|
|
468
|
+
/** Present on the single-sport endpoint (GET /public/{orgId}/sports/{slug}). */
|
|
469
|
+
article?: BarnsportSportArticle;
|
|
470
|
+
}
|
|
471
|
+
interface BarnsportActivitySchedule {
|
|
472
|
+
weekday?: number;
|
|
473
|
+
starts_at?: string;
|
|
474
|
+
ends_at?: string;
|
|
475
|
+
label?: string;
|
|
476
|
+
season?: string;
|
|
477
|
+
}
|
|
478
|
+
interface BarnsportActivityLocation {
|
|
479
|
+
name?: string;
|
|
480
|
+
address?: string;
|
|
481
|
+
lat?: number;
|
|
482
|
+
lng?: number;
|
|
483
|
+
}
|
|
484
|
+
interface BarnsportRegistrationMethod {
|
|
485
|
+
type: 'url' | 'email' | 'phone' | 'form' | 'external';
|
|
486
|
+
label?: string;
|
|
487
|
+
value: string;
|
|
488
|
+
instructions?: string;
|
|
489
|
+
preferred?: boolean;
|
|
490
|
+
}
|
|
491
|
+
interface BarnsportActivityListItem {
|
|
492
|
+
id: string;
|
|
493
|
+
slug: string;
|
|
494
|
+
title: string;
|
|
495
|
+
summary?: string;
|
|
496
|
+
sport: {
|
|
497
|
+
id: string;
|
|
498
|
+
slug: string;
|
|
499
|
+
name?: string;
|
|
500
|
+
icon?: string;
|
|
501
|
+
};
|
|
502
|
+
municipality: {
|
|
503
|
+
id: string;
|
|
504
|
+
slug: string;
|
|
505
|
+
name?: string;
|
|
506
|
+
};
|
|
507
|
+
club: {
|
|
508
|
+
id: string;
|
|
509
|
+
slug: string;
|
|
510
|
+
name?: string;
|
|
511
|
+
};
|
|
512
|
+
birthYears?: number[];
|
|
513
|
+
minBirthYear?: number;
|
|
514
|
+
maxBirthYear?: number;
|
|
515
|
+
ageLabel?: string;
|
|
516
|
+
schedule: BarnsportActivitySchedule[];
|
|
517
|
+
location?: BarnsportActivityLocation;
|
|
518
|
+
registrationSummary?: string;
|
|
519
|
+
updatedAt: string;
|
|
520
|
+
}
|
|
521
|
+
interface BarnsportActivity {
|
|
522
|
+
activity_id: string;
|
|
523
|
+
org_id: string;
|
|
524
|
+
slug: string;
|
|
525
|
+
title: string;
|
|
526
|
+
summary?: string;
|
|
527
|
+
description?: string;
|
|
528
|
+
sport_id: string;
|
|
529
|
+
sport_slug: string;
|
|
530
|
+
sport_name?: string;
|
|
531
|
+
sport_icon?: string;
|
|
532
|
+
municipality_id: string;
|
|
533
|
+
municipality_slug: string;
|
|
534
|
+
municipality_name?: string;
|
|
535
|
+
club_id: string;
|
|
536
|
+
club_slug: string;
|
|
537
|
+
club_name?: string;
|
|
538
|
+
club_website_url?: string;
|
|
539
|
+
birth_years?: number[];
|
|
540
|
+
min_birth_year?: number;
|
|
541
|
+
max_birth_year?: number;
|
|
542
|
+
age_label?: string;
|
|
543
|
+
schedule: BarnsportActivitySchedule[];
|
|
544
|
+
location?: BarnsportActivityLocation;
|
|
545
|
+
registration: {
|
|
546
|
+
methods: BarnsportRegistrationMethod[];
|
|
547
|
+
deadline?: string;
|
|
548
|
+
price_label?: string;
|
|
549
|
+
};
|
|
550
|
+
seo?: {
|
|
551
|
+
title?: string;
|
|
552
|
+
description?: string;
|
|
553
|
+
image_media_id?: string;
|
|
554
|
+
};
|
|
555
|
+
published_at?: string;
|
|
556
|
+
updated_at: string;
|
|
557
|
+
}
|
|
558
|
+
interface BarnsportActivitiesFilter {
|
|
559
|
+
municipality?: string;
|
|
560
|
+
sport?: string;
|
|
561
|
+
birthYear?: number;
|
|
562
|
+
q?: string;
|
|
563
|
+
search?: string;
|
|
564
|
+
sort?: 'updated' | 'name' | 'relevance';
|
|
565
|
+
cursor?: string;
|
|
566
|
+
limit?: number;
|
|
567
|
+
}
|
|
568
|
+
interface BarnsportListResponse<T> {
|
|
569
|
+
items: T[];
|
|
570
|
+
count: number;
|
|
571
|
+
nextCursor?: string | null;
|
|
572
|
+
}
|
|
573
|
+
interface BarnsportActivityResponse {
|
|
574
|
+
activity: BarnsportActivity;
|
|
575
|
+
}
|
|
576
|
+
interface BarnsportSitemapUrl {
|
|
577
|
+
loc: string;
|
|
578
|
+
lastmod?: string;
|
|
579
|
+
changefreq?: string;
|
|
580
|
+
priority?: number;
|
|
581
|
+
}
|
|
582
|
+
interface BarnsportSitemapResponse {
|
|
583
|
+
baseUrl: string;
|
|
584
|
+
updatedAt: string;
|
|
585
|
+
urls: BarnsportSitemapUrl[];
|
|
586
|
+
}
|
|
587
|
+
interface BarnsportInterestSubmissionRequest {
|
|
588
|
+
activitySlug: string;
|
|
589
|
+
guardianName: string;
|
|
590
|
+
guardianEmail: string;
|
|
591
|
+
guardianPhone?: string;
|
|
592
|
+
childName?: string;
|
|
593
|
+
childBirthYear?: number;
|
|
594
|
+
message?: string;
|
|
595
|
+
consent: {
|
|
596
|
+
contact: boolean;
|
|
597
|
+
privacyVersion: string;
|
|
598
|
+
};
|
|
599
|
+
honeypot?: string;
|
|
600
|
+
source?: {
|
|
601
|
+
site?: string;
|
|
602
|
+
pageUrl?: string;
|
|
603
|
+
utm?: Record<string, string>;
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
interface BarnsportInterestSubmissionResponse {
|
|
607
|
+
success: boolean;
|
|
608
|
+
submissionId?: string;
|
|
609
|
+
duplicate?: boolean;
|
|
610
|
+
message: string;
|
|
611
|
+
}
|
|
369
612
|
|
|
370
613
|
type ContentSlotValue = string | number | boolean | null | undefined | string[] | Record<string, unknown> | unknown[];
|
|
371
614
|
type ContentSlotMap = Record<string, ContentSlotValue>;
|
|
@@ -553,6 +796,128 @@ declare function createFormHelper(config: {
|
|
|
553
796
|
submit: (formType: "waitlist" | "contact" | "membership", email: string, data?: Record<string, unknown>) => Promise<FormSubmissionResponse>;
|
|
554
797
|
};
|
|
555
798
|
|
|
799
|
+
/**
|
|
800
|
+
* AxCloud Voting Module
|
|
801
|
+
*
|
|
802
|
+
* Functions for embedding voting/elections on a customer site (e.g. spf.se).
|
|
803
|
+
*
|
|
804
|
+
* Two channels:
|
|
805
|
+
* - PUBLIC (code): no login — the personal one-time code is the credential.
|
|
806
|
+
* Use {@link checkVotingCode}, {@link castVoteWithCode}, {@link getVotingReceipt}.
|
|
807
|
+
* - AUTHED (Auth0): a logged-in member votes with their access token.
|
|
808
|
+
* Use {@link getBallot}, {@link checkEligibility}, {@link castVote}.
|
|
809
|
+
*
|
|
810
|
+
* `votingApiUrl` is the Voting API base, e.g. 'https://api.axcloud.app/voting'.
|
|
811
|
+
*/
|
|
812
|
+
interface BallotSeat {
|
|
813
|
+
seat_id: string;
|
|
814
|
+
label_sv: string;
|
|
815
|
+
label_en?: string;
|
|
816
|
+
term?: string;
|
|
817
|
+
count: number;
|
|
818
|
+
order?: number;
|
|
819
|
+
}
|
|
820
|
+
interface BallotCandidate {
|
|
821
|
+
candidate_id: string;
|
|
822
|
+
name: string;
|
|
823
|
+
bio_sv?: string;
|
|
824
|
+
bio_en?: string;
|
|
825
|
+
presentation_media_id?: string;
|
|
826
|
+
photo_media_id?: string;
|
|
827
|
+
}
|
|
828
|
+
interface BallotOption {
|
|
829
|
+
option_id: string;
|
|
830
|
+
text: string;
|
|
831
|
+
description?: string;
|
|
832
|
+
}
|
|
833
|
+
interface Ballot {
|
|
834
|
+
poll_id: string;
|
|
835
|
+
poll_type: 'single_choice' | 'multiple_choice' | 'ranking' | 'election';
|
|
836
|
+
title: string;
|
|
837
|
+
title_en?: string;
|
|
838
|
+
description?: string;
|
|
839
|
+
description_en?: string;
|
|
840
|
+
seats?: BallotSeat[];
|
|
841
|
+
max_selections?: number;
|
|
842
|
+
min_selections?: number;
|
|
843
|
+
ends_at?: string;
|
|
844
|
+
options?: BallotOption[];
|
|
845
|
+
candidates?: BallotCandidate[];
|
|
846
|
+
}
|
|
847
|
+
interface CodeEligibility {
|
|
848
|
+
eligible: boolean;
|
|
849
|
+
has_voted: boolean;
|
|
850
|
+
reason?: string;
|
|
851
|
+
ballot?: Ballot;
|
|
852
|
+
}
|
|
853
|
+
interface VoteReceipt {
|
|
854
|
+
has_voted: boolean;
|
|
855
|
+
voted_at?: string;
|
|
856
|
+
selected_option_ids?: string[];
|
|
857
|
+
selection?: string[];
|
|
858
|
+
}
|
|
859
|
+
interface CastVoteResult {
|
|
860
|
+
success: boolean;
|
|
861
|
+
voted_at?: string;
|
|
862
|
+
message?: string;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Validate a personal code and, if valid, return the ballot to render.
|
|
866
|
+
*/
|
|
867
|
+
declare function checkVotingCode(votingApiUrl: string, params: {
|
|
868
|
+
orgId: string;
|
|
869
|
+
pollId: string;
|
|
870
|
+
code: string;
|
|
871
|
+
}): Promise<CodeEligibility>;
|
|
872
|
+
/**
|
|
873
|
+
* Cast a vote using a personal code.
|
|
874
|
+
*/
|
|
875
|
+
declare function castVoteWithCode(votingApiUrl: string, params: {
|
|
876
|
+
orgId: string;
|
|
877
|
+
pollId: string;
|
|
878
|
+
code: string;
|
|
879
|
+
selectedOptions: string[];
|
|
880
|
+
rankings?: Record<string, number>;
|
|
881
|
+
}): Promise<CastVoteResult>;
|
|
882
|
+
/**
|
|
883
|
+
* After voting, re-check a code to retrieve the voter's own selection.
|
|
884
|
+
*/
|
|
885
|
+
declare function getVotingReceipt(votingApiUrl: string, params: {
|
|
886
|
+
orgId: string;
|
|
887
|
+
pollId: string;
|
|
888
|
+
code: string;
|
|
889
|
+
}): Promise<VoteReceipt>;
|
|
890
|
+
/**
|
|
891
|
+
* Load a ballot (poll + candidates) for a logged-in member.
|
|
892
|
+
*/
|
|
893
|
+
declare function getBallot(votingApiUrl: string, params: {
|
|
894
|
+
orgId: string;
|
|
895
|
+
pollId: string;
|
|
896
|
+
accessToken: string;
|
|
897
|
+
}): Promise<Ballot>;
|
|
898
|
+
/**
|
|
899
|
+
* Check whether the logged-in member is eligible to vote / has already voted.
|
|
900
|
+
*/
|
|
901
|
+
declare function checkEligibility(votingApiUrl: string, params: {
|
|
902
|
+
orgId: string;
|
|
903
|
+
pollId: string;
|
|
904
|
+
accessToken: string;
|
|
905
|
+
}): Promise<{
|
|
906
|
+
eligible: boolean;
|
|
907
|
+
has_voted: boolean;
|
|
908
|
+
reason?: string;
|
|
909
|
+
}>;
|
|
910
|
+
/**
|
|
911
|
+
* Cast a vote as a logged-in member.
|
|
912
|
+
*/
|
|
913
|
+
declare function castVote(votingApiUrl: string, params: {
|
|
914
|
+
orgId: string;
|
|
915
|
+
pollId: string;
|
|
916
|
+
accessToken: string;
|
|
917
|
+
selectedOptions: string[];
|
|
918
|
+
rankings?: Record<string, number>;
|
|
919
|
+
}): Promise<CastVoteResult>;
|
|
920
|
+
|
|
556
921
|
interface AxCloudProviderProps {
|
|
557
922
|
children: React.ReactNode;
|
|
558
923
|
orgId: string;
|
|
@@ -566,6 +931,8 @@ interface AxCloudProviderProps {
|
|
|
566
931
|
clientId: string;
|
|
567
932
|
redirectUri: string;
|
|
568
933
|
audience?: string;
|
|
934
|
+
/** Auth0 Organization ID. Use this for invite-only member sites. */
|
|
935
|
+
organization?: string;
|
|
569
936
|
/** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
|
|
570
937
|
connection?: string;
|
|
571
938
|
};
|
|
@@ -587,7 +954,8 @@ interface AxCloudProviderProps {
|
|
|
587
954
|
* auth0={{
|
|
588
955
|
* domain: "auth.axcloud.app",
|
|
589
956
|
* clientId: "xxx",
|
|
590
|
-
* redirectUri: window.location.origin
|
|
957
|
+
* redirectUri: window.location.origin,
|
|
958
|
+
* organization: "org_abc123" // Optional Auth0 Organization ID for invite-only member sites
|
|
591
959
|
* }}
|
|
592
960
|
* >
|
|
593
961
|
* <App />
|
|
@@ -612,12 +980,22 @@ interface AuthUser {
|
|
|
612
980
|
email: string;
|
|
613
981
|
name: string;
|
|
614
982
|
avatar?: string;
|
|
983
|
+
/** Auth0's authoritative email verification claim. */
|
|
984
|
+
emailVerified?: boolean;
|
|
985
|
+
}
|
|
986
|
+
interface EmailVerificationResult {
|
|
987
|
+
success: boolean;
|
|
988
|
+
status: 'sent' | 'already_verified' | 'rate_limited' | 'failed';
|
|
989
|
+
message: string;
|
|
990
|
+
retryAfterSeconds?: number;
|
|
615
991
|
}
|
|
616
992
|
interface UseAuthReturn {
|
|
617
993
|
isAuthenticated: boolean;
|
|
618
994
|
isLoading: boolean;
|
|
619
995
|
error: Error | undefined;
|
|
620
996
|
user: AuthUser | null;
|
|
997
|
+
/** True only when Auth0 explicitly reports email_verified=false. */
|
|
998
|
+
needsEmailVerification: boolean;
|
|
621
999
|
login: (options?: {
|
|
622
1000
|
returnTo?: string;
|
|
623
1001
|
}) => Promise<void>;
|
|
@@ -626,6 +1004,12 @@ interface UseAuthReturn {
|
|
|
626
1004
|
}) => Promise<void>;
|
|
627
1005
|
getAccessToken: () => Promise<string | undefined>;
|
|
628
1006
|
getAuth0Client: () => Auth0ClientState;
|
|
1007
|
+
/** Refresh Auth0 tokens/profile and return the latest email verification state. */
|
|
1008
|
+
refreshUser: () => Promise<boolean>;
|
|
1009
|
+
/** Send a branded verification email that returns to the current product site. */
|
|
1010
|
+
requestEmailVerification: (options?: {
|
|
1011
|
+
returnTo?: string;
|
|
1012
|
+
}) => Promise<EmailVerificationResult>;
|
|
629
1013
|
/** Request a password reset email for the current user or specified email */
|
|
630
1014
|
requestPasswordReset: (email?: string) => Promise<{
|
|
631
1015
|
success: boolean;
|
|
@@ -1132,6 +1516,25 @@ declare function useUpdateFormSubmission(): _tanstack_react_query.UseMutationRes
|
|
|
1132
1516
|
notes?: string;
|
|
1133
1517
|
}, unknown>;
|
|
1134
1518
|
|
|
1519
|
+
type CodeBallotStage = 'enter_code' | 'ballot' | 'submitted' | 'already_voted';
|
|
1520
|
+
interface UseCodeBallotOptions {
|
|
1521
|
+
pollId: string;
|
|
1522
|
+
/** Override the Voting API base URL. Defaults to `${config.apiUrl}/voting`. */
|
|
1523
|
+
votingApiUrl?: string;
|
|
1524
|
+
}
|
|
1525
|
+
declare function useCodeBallot({ pollId, votingApiUrl }: UseCodeBallotOptions): {
|
|
1526
|
+
stage: CodeBallotStage;
|
|
1527
|
+
code: string;
|
|
1528
|
+
ballot: Ballot | null;
|
|
1529
|
+
receipt: VoteReceipt | null;
|
|
1530
|
+
reason: string | undefined;
|
|
1531
|
+
loading: boolean;
|
|
1532
|
+
error: string | null;
|
|
1533
|
+
validateCode: (inputCode: string) => Promise<CodeEligibility | null>;
|
|
1534
|
+
submitVote: (selectedOptions: string[], rankings?: Record<string, number>) => Promise<boolean>;
|
|
1535
|
+
reset: () => void;
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1135
1538
|
/**
|
|
1136
1539
|
* useLinkedAccounts Hook
|
|
1137
1540
|
*
|
|
@@ -1344,6 +1747,138 @@ declare function useMedia(mediaId: string): {
|
|
|
1344
1747
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedMediaUrl, Error>>;
|
|
1345
1748
|
};
|
|
1346
1749
|
|
|
1750
|
+
/**
|
|
1751
|
+
* List documents that have been explicitly published for public SDK access.
|
|
1752
|
+
*
|
|
1753
|
+
* Documents with members/internal/section audience stay inside AxCloud.
|
|
1754
|
+
*/
|
|
1755
|
+
declare function useDocuments(options?: DocumentQueryOptions): {
|
|
1756
|
+
documents: DocumentItem[];
|
|
1757
|
+
items: DocumentItem[];
|
|
1758
|
+
count: number;
|
|
1759
|
+
isLoading: boolean;
|
|
1760
|
+
isError: boolean;
|
|
1761
|
+
error: Error | null;
|
|
1762
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentListResponse, Error>>;
|
|
1763
|
+
};
|
|
1764
|
+
/**
|
|
1765
|
+
* Fetch a short-lived signed download URL for a public document.
|
|
1766
|
+
*/
|
|
1767
|
+
declare function useDocumentDownload(documentId: string | undefined): {
|
|
1768
|
+
url: string | null;
|
|
1769
|
+
documentUrl: string | null;
|
|
1770
|
+
filename: string | null;
|
|
1771
|
+
mimeType: string | null;
|
|
1772
|
+
expiresIn: number | null;
|
|
1773
|
+
isLoading: boolean;
|
|
1774
|
+
isError: boolean;
|
|
1775
|
+
error: Error | null;
|
|
1776
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
|
|
1777
|
+
};
|
|
1778
|
+
/**
|
|
1779
|
+
* List documents the current member is allowed to see.
|
|
1780
|
+
*
|
|
1781
|
+
* Hits the member endpoint (`/documents/members/...`) which is NOT a
|
|
1782
|
+
* `/public/` path, so the core client automatically attaches the member's
|
|
1783
|
+
* `Authorization: Bearer <JWT>` header instead of the public API key.
|
|
1784
|
+
*
|
|
1785
|
+
* Returns public documents plus members/internal documents and section
|
|
1786
|
+
* documents for the member's sections. Items include `section_ids` and
|
|
1787
|
+
* uploader metadata (`uploaded_by_name`, `created_at`).
|
|
1788
|
+
*/
|
|
1789
|
+
declare function useMemberDocuments(options?: DocumentQueryOptions): {
|
|
1790
|
+
documents: DocumentItem[];
|
|
1791
|
+
items: DocumentItem[];
|
|
1792
|
+
count: number;
|
|
1793
|
+
isLoading: boolean;
|
|
1794
|
+
isError: boolean;
|
|
1795
|
+
error: Error | null;
|
|
1796
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentListResponse, Error>>;
|
|
1797
|
+
};
|
|
1798
|
+
/**
|
|
1799
|
+
* List the document folders the current member is allowed to see.
|
|
1800
|
+
*
|
|
1801
|
+
* Hits the member endpoint (`/documents/members/${orgId}/document-folders`),
|
|
1802
|
+
* which is NOT a `/public/` path, so the core client attaches the member's
|
|
1803
|
+
* `Authorization: Bearer <JWT>` header instead of the public API key.
|
|
1804
|
+
*
|
|
1805
|
+
* Returns the member's section folders plus org-level folders
|
|
1806
|
+
* (`section_id === null`). Use the returned folder ids with
|
|
1807
|
+
* `useMemberDocuments({ folderId })` to scope a document list.
|
|
1808
|
+
*/
|
|
1809
|
+
declare function useMemberDocumentFolders(): {
|
|
1810
|
+
folders: DocumentFolder[];
|
|
1811
|
+
isLoading: boolean;
|
|
1812
|
+
isError: boolean;
|
|
1813
|
+
error: Error | null;
|
|
1814
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<DocumentFolderListResponse, Error>>;
|
|
1815
|
+
};
|
|
1816
|
+
/**
|
|
1817
|
+
* Fetch a short-lived signed download URL for a member-accessible document.
|
|
1818
|
+
*/
|
|
1819
|
+
declare function useMemberDocumentDownload(documentId: string | undefined): {
|
|
1820
|
+
url: string | null;
|
|
1821
|
+
documentUrl: string | null;
|
|
1822
|
+
filename: string | null;
|
|
1823
|
+
mimeType: string | null;
|
|
1824
|
+
expiresIn: number | null;
|
|
1825
|
+
isLoading: boolean;
|
|
1826
|
+
isError: boolean;
|
|
1827
|
+
error: Error | null;
|
|
1828
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
declare function useBarnsportMunicipalities(): {
|
|
1832
|
+
municipalities: BarnsportMunicipality[];
|
|
1833
|
+
count: number;
|
|
1834
|
+
isLoading: boolean;
|
|
1835
|
+
isError: boolean;
|
|
1836
|
+
error: Error | null;
|
|
1837
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportMunicipality>, Error>>;
|
|
1838
|
+
};
|
|
1839
|
+
declare function useBarnsportSports(): {
|
|
1840
|
+
sports: BarnsportSport[];
|
|
1841
|
+
count: number;
|
|
1842
|
+
isLoading: boolean;
|
|
1843
|
+
isError: boolean;
|
|
1844
|
+
error: Error | null;
|
|
1845
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportSport>, Error>>;
|
|
1846
|
+
};
|
|
1847
|
+
declare function useBarnsportSport(slug: string | undefined): {
|
|
1848
|
+
sport: BarnsportSport | null;
|
|
1849
|
+
isLoading: boolean;
|
|
1850
|
+
isError: boolean;
|
|
1851
|
+
error: Error | null;
|
|
1852
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<{
|
|
1853
|
+
sport: BarnsportSport;
|
|
1854
|
+
}, Error>>;
|
|
1855
|
+
};
|
|
1856
|
+
declare function useBarnsportActivities(filters?: BarnsportActivitiesFilter): {
|
|
1857
|
+
activities: BarnsportActivityListItem[];
|
|
1858
|
+
count: number;
|
|
1859
|
+
nextCursor: string | null;
|
|
1860
|
+
isLoading: boolean;
|
|
1861
|
+
isError: boolean;
|
|
1862
|
+
error: Error | null;
|
|
1863
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportActivityListItem>, Error>>;
|
|
1864
|
+
};
|
|
1865
|
+
declare function useBarnsportActivity(slug: string | undefined): {
|
|
1866
|
+
activity: BarnsportActivity | null;
|
|
1867
|
+
isLoading: boolean;
|
|
1868
|
+
isError: boolean;
|
|
1869
|
+
error: Error | null;
|
|
1870
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportActivityResponse, Error>>;
|
|
1871
|
+
};
|
|
1872
|
+
declare function useBarnsportSitemap(baseUrl?: string): {
|
|
1873
|
+
sitemap: BarnsportSitemapResponse | null;
|
|
1874
|
+
urls: BarnsportSitemapUrl[];
|
|
1875
|
+
isLoading: boolean;
|
|
1876
|
+
isError: boolean;
|
|
1877
|
+
error: Error | null;
|
|
1878
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportSitemapResponse, Error>>;
|
|
1879
|
+
};
|
|
1880
|
+
declare function useSubmitBarnsportInterest(): _tanstack_react_query.UseMutationResult<BarnsportInterestSubmissionResponse, Error, BarnsportInterestSubmissionRequest, unknown>;
|
|
1881
|
+
|
|
1347
1882
|
interface LoginButtonProps {
|
|
1348
1883
|
/**
|
|
1349
1884
|
* Button text when not authenticated
|
|
@@ -1569,4 +2104,4 @@ interface LinkedAccountsListProps {
|
|
|
1569
2104
|
*/
|
|
1570
2105
|
declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): react_jsx_runtime.JSX.Element;
|
|
1571
2106
|
|
|
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 };
|
|
2107
|
+
export { type Auth0ClientState, type AuthUser, 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 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, 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 };
|