@axcode/axcloud-sdk 0.1.7-dev.3a3be6d → 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/dist/index.d.mts +105 -1
- package/dist/index.d.ts +105 -1
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -387,11 +387,35 @@ interface DocumentItem {
|
|
|
387
387
|
created_at: string;
|
|
388
388
|
updated_at: string;
|
|
389
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[];
|
|
390
396
|
}
|
|
391
397
|
interface DocumentListResponse {
|
|
392
398
|
items: DocumentItem[];
|
|
393
399
|
count: number;
|
|
394
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
|
+
}
|
|
395
419
|
interface SignedDocumentUrl {
|
|
396
420
|
documentId: string;
|
|
397
421
|
url: string;
|
|
@@ -403,6 +427,8 @@ interface DocumentQueryOptions {
|
|
|
403
427
|
search?: string;
|
|
404
428
|
tags?: string[];
|
|
405
429
|
limit?: number;
|
|
430
|
+
/** Restrict results to documents belonging to this folder (member endpoint only). */
|
|
431
|
+
folderId?: string;
|
|
406
432
|
}
|
|
407
433
|
|
|
408
434
|
interface BarnsportMunicipality {
|
|
@@ -416,12 +442,29 @@ interface BarnsportMunicipality {
|
|
|
416
442
|
bounds?: [number, number, number, number];
|
|
417
443
|
};
|
|
418
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
|
+
}
|
|
419
456
|
interface BarnsportSport {
|
|
420
457
|
id: string;
|
|
421
458
|
slug: string;
|
|
422
459
|
name: string;
|
|
423
460
|
icon?: string;
|
|
424
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;
|
|
425
468
|
}
|
|
426
469
|
interface BarnsportActivitySchedule {
|
|
427
470
|
weekday?: number;
|
|
@@ -1711,6 +1754,58 @@ declare function useDocumentDownload(documentId: string | undefined): {
|
|
|
1711
1754
|
error: Error | null;
|
|
1712
1755
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
|
|
1713
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
|
+
};
|
|
1714
1809
|
|
|
1715
1810
|
declare function useBarnsportMunicipalities(): {
|
|
1716
1811
|
municipalities: BarnsportMunicipality[];
|
|
@@ -1728,6 +1823,15 @@ declare function useBarnsportSports(): {
|
|
|
1728
1823
|
error: Error | null;
|
|
1729
1824
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportSport>, Error>>;
|
|
1730
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
|
+
};
|
|
1731
1835
|
declare function useBarnsportActivities(filters?: BarnsportActivitiesFilter): {
|
|
1732
1836
|
activities: BarnsportActivityListItem[];
|
|
1733
1837
|
count: number;
|
|
@@ -1979,4 +2083,4 @@ interface LinkedAccountsListProps {
|
|
|
1979
2083
|
*/
|
|
1980
2084
|
declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): react_jsx_runtime.JSX.Element;
|
|
1981
2085
|
|
|
1982
|
-
export { type AvailableProvider, AxCloudClient, type AxCloudConfig, AxCloudError, type AxCloudErrorCode, type AxCloudModule, AxCloudProvider, type Ballot, type BallotCandidate, type BallotOption, type BallotSeat, type BarnsportActivitiesFilter, type BarnsportActivity, type BarnsportActivityListItem, type BarnsportActivityLocation, type BarnsportActivityResponse, type BarnsportActivitySchedule, type BarnsportInterestSubmissionRequest, type BarnsportInterestSubmissionResponse, type BarnsportListResponse, type BarnsportMunicipality, type BarnsportRegistrationMethod, type BarnsportSitemapResponse, type BarnsportSitemapUrl, type BarnsportSport, type BaseRole, type CastVoteResult, type CodeEligibility, type ContentItem, type ContentQueryOptions, type ContentSlotImage, type ContentSlotMap, type ContentSlotReader, type ContentSlotValue, type CustomRole, type DocumentAudience, type DocumentItem, type DocumentListResponse, type DocumentQueryOptions, type DocumentSourceProvider, type DocumentStatus, type FormStatsResponse, type FormSubmission, type FormSubmissionRecord, type FormSubmissionResponse, type FormSubmissionsResponse, LinkedAccountsList, type LinkedAccountsListProps, type LinkedIdentity, LoginButton, LogoutButton, type MediaItem, type MediaListResponse, type Membership, ModuleGate, type NewsItem, type Organization, type OrganizationBranding, type OrganizationSettings, type Page, type PageContentState, type PaginatedResponse, ProtectedRoute, type Section, type SectionPermissions, type SignedDocumentUrl, type SignedMediaUrl, type SystemRole, type UseLinkedAccountsReturn, type User, type UserRole, type VoteReceipt, castVote, castVoteWithCode, checkEligibility, checkVotingCode, createClient, createContentSlotReader, createFormHelper, getBallot, getClient, getContentSlotMap, getVotingReceipt, isAxCloudError, submitForm, useAuth, useAvatar, useAxCloudContext, useBarnsportActivities, useBarnsportActivity, useBarnsportMunicipalities, useBarnsportSitemap, useBarnsportSports, useBranding, useCodeBallot, useContent, useContentItem, useDocumentDownload, useDocuments, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useModuleAccess, useMySection, useNews, useOrg, usePageContent, useSections, useSubmitBarnsportInterest, useUpdateFormSubmission, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -387,11 +387,35 @@ interface DocumentItem {
|
|
|
387
387
|
created_at: string;
|
|
388
388
|
updated_at: string;
|
|
389
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[];
|
|
390
396
|
}
|
|
391
397
|
interface DocumentListResponse {
|
|
392
398
|
items: DocumentItem[];
|
|
393
399
|
count: number;
|
|
394
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
|
+
}
|
|
395
419
|
interface SignedDocumentUrl {
|
|
396
420
|
documentId: string;
|
|
397
421
|
url: string;
|
|
@@ -403,6 +427,8 @@ interface DocumentQueryOptions {
|
|
|
403
427
|
search?: string;
|
|
404
428
|
tags?: string[];
|
|
405
429
|
limit?: number;
|
|
430
|
+
/** Restrict results to documents belonging to this folder (member endpoint only). */
|
|
431
|
+
folderId?: string;
|
|
406
432
|
}
|
|
407
433
|
|
|
408
434
|
interface BarnsportMunicipality {
|
|
@@ -416,12 +442,29 @@ interface BarnsportMunicipality {
|
|
|
416
442
|
bounds?: [number, number, number, number];
|
|
417
443
|
};
|
|
418
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
|
+
}
|
|
419
456
|
interface BarnsportSport {
|
|
420
457
|
id: string;
|
|
421
458
|
slug: string;
|
|
422
459
|
name: string;
|
|
423
460
|
icon?: string;
|
|
424
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;
|
|
425
468
|
}
|
|
426
469
|
interface BarnsportActivitySchedule {
|
|
427
470
|
weekday?: number;
|
|
@@ -1711,6 +1754,58 @@ declare function useDocumentDownload(documentId: string | undefined): {
|
|
|
1711
1754
|
error: Error | null;
|
|
1712
1755
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SignedDocumentUrl, Error>>;
|
|
1713
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
|
+
};
|
|
1714
1809
|
|
|
1715
1810
|
declare function useBarnsportMunicipalities(): {
|
|
1716
1811
|
municipalities: BarnsportMunicipality[];
|
|
@@ -1728,6 +1823,15 @@ declare function useBarnsportSports(): {
|
|
|
1728
1823
|
error: Error | null;
|
|
1729
1824
|
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<BarnsportListResponse<BarnsportSport>, Error>>;
|
|
1730
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
|
+
};
|
|
1731
1835
|
declare function useBarnsportActivities(filters?: BarnsportActivitiesFilter): {
|
|
1732
1836
|
activities: BarnsportActivityListItem[];
|
|
1733
1837
|
count: number;
|
|
@@ -1979,4 +2083,4 @@ interface LinkedAccountsListProps {
|
|
|
1979
2083
|
*/
|
|
1980
2084
|
declare function LinkedAccountsList({ providers, showConnectButtons, className, onUnlink, onLinkInitiated, renderIdentity, renderAvailableProvider, }: LinkedAccountsListProps): react_jsx_runtime.JSX.Element;
|
|
1981
2085
|
|
|
1982
|
-
export { type AvailableProvider, AxCloudClient, type AxCloudConfig, AxCloudError, type AxCloudErrorCode, type AxCloudModule, AxCloudProvider, type Ballot, type BallotCandidate, type BallotOption, type BallotSeat, type BarnsportActivitiesFilter, type BarnsportActivity, type BarnsportActivityListItem, type BarnsportActivityLocation, type BarnsportActivityResponse, type BarnsportActivitySchedule, type BarnsportInterestSubmissionRequest, type BarnsportInterestSubmissionResponse, type BarnsportListResponse, type BarnsportMunicipality, type BarnsportRegistrationMethod, type BarnsportSitemapResponse, type BarnsportSitemapUrl, type BarnsportSport, type BaseRole, type CastVoteResult, type CodeEligibility, type ContentItem, type ContentQueryOptions, type ContentSlotImage, type ContentSlotMap, type ContentSlotReader, type ContentSlotValue, type CustomRole, type DocumentAudience, type DocumentItem, type DocumentListResponse, type DocumentQueryOptions, type DocumentSourceProvider, type DocumentStatus, type FormStatsResponse, type FormSubmission, type FormSubmissionRecord, type FormSubmissionResponse, type FormSubmissionsResponse, LinkedAccountsList, type LinkedAccountsListProps, type LinkedIdentity, LoginButton, LogoutButton, type MediaItem, type MediaListResponse, type Membership, ModuleGate, type NewsItem, type Organization, type OrganizationBranding, type OrganizationSettings, type Page, type PageContentState, type PaginatedResponse, ProtectedRoute, type Section, type SectionPermissions, type SignedDocumentUrl, type SignedMediaUrl, type SystemRole, type UseLinkedAccountsReturn, type User, type UserRole, type VoteReceipt, castVote, castVoteWithCode, checkEligibility, checkVotingCode, createClient, createContentSlotReader, createFormHelper, getBallot, getClient, getContentSlotMap, getVotingReceipt, isAxCloudError, submitForm, useAuth, useAvatar, useAxCloudContext, useBarnsportActivities, useBarnsportActivity, useBarnsportMunicipalities, useBarnsportSitemap, useBarnsportSports, useBranding, useCodeBallot, useContent, useContentItem, useDocumentDownload, useDocuments, useFormStats, useForms, useLinkedAccounts, useLogo, useMedia, useMediaList, useModuleAccess, useMySection, useNews, useOrg, usePageContent, useSections, useSubmitBarnsportInterest, useUpdateFormSubmission, useUser, userHasAllPermissions, userHasAnyPermission, userHasPermission };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1375,6 +1375,73 @@ function useDocumentDownload(documentId) {
|
|
|
1375
1375
|
refetch: query.refetch
|
|
1376
1376
|
};
|
|
1377
1377
|
}
|
|
1378
|
+
function useMemberDocuments(options) {
|
|
1379
|
+
const { client, orgId } = useAxCloudContext();
|
|
1380
|
+
const params = buildDocumentParams(options);
|
|
1381
|
+
const folderId = options?.folderId;
|
|
1382
|
+
const query = reactQuery.useQuery({
|
|
1383
|
+
queryKey: ["axcloud", "documents", "member", "list", orgId, options],
|
|
1384
|
+
queryFn: async () => {
|
|
1385
|
+
return client.get(`/documents/members/${orgId}/documents`, params);
|
|
1386
|
+
},
|
|
1387
|
+
staleTime: 1e3 * 60 * 5
|
|
1388
|
+
});
|
|
1389
|
+
const allItems = query.data?.items ?? [];
|
|
1390
|
+
const items = folderId ? allItems.filter((doc) => doc.folder_ids?.includes(folderId)) : allItems;
|
|
1391
|
+
return {
|
|
1392
|
+
documents: items,
|
|
1393
|
+
items,
|
|
1394
|
+
count: folderId ? items.length : query.data?.count ?? 0,
|
|
1395
|
+
isLoading: query.isLoading,
|
|
1396
|
+
isError: query.isError,
|
|
1397
|
+
error: query.error,
|
|
1398
|
+
refetch: query.refetch
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
function useMemberDocumentFolders() {
|
|
1402
|
+
const { client, orgId } = useAxCloudContext();
|
|
1403
|
+
const query = reactQuery.useQuery({
|
|
1404
|
+
queryKey: ["axcloud", "documents", "member", "folders", orgId],
|
|
1405
|
+
queryFn: async () => {
|
|
1406
|
+
return client.get(
|
|
1407
|
+
`/documents/members/${orgId}/document-folders`
|
|
1408
|
+
);
|
|
1409
|
+
},
|
|
1410
|
+
staleTime: 1e3 * 60 * 5
|
|
1411
|
+
});
|
|
1412
|
+
return {
|
|
1413
|
+
folders: query.data?.folders ?? [],
|
|
1414
|
+
isLoading: query.isLoading,
|
|
1415
|
+
isError: query.isError,
|
|
1416
|
+
error: query.error,
|
|
1417
|
+
refetch: query.refetch
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
function useMemberDocumentDownload(documentId) {
|
|
1421
|
+
const { client, orgId } = useAxCloudContext();
|
|
1422
|
+
const query = reactQuery.useQuery({
|
|
1423
|
+
queryKey: ["axcloud", "documents", "member", "download", orgId, documentId],
|
|
1424
|
+
queryFn: async () => {
|
|
1425
|
+
return client.get(
|
|
1426
|
+
`/documents/members/${orgId}/documents/${encodeURIComponent(documentId || "")}/download`
|
|
1427
|
+
);
|
|
1428
|
+
},
|
|
1429
|
+
enabled: !!documentId,
|
|
1430
|
+
staleTime: 1e3 * 60 * 10,
|
|
1431
|
+
gcTime: 1e3 * 60 * 14
|
|
1432
|
+
});
|
|
1433
|
+
return {
|
|
1434
|
+
url: query.data?.url ?? null,
|
|
1435
|
+
documentUrl: query.data?.url ?? null,
|
|
1436
|
+
filename: query.data?.filename ?? null,
|
|
1437
|
+
mimeType: query.data?.mimeType ?? null,
|
|
1438
|
+
expiresIn: query.data?.expiresIn ?? null,
|
|
1439
|
+
isLoading: query.isLoading,
|
|
1440
|
+
isError: query.isError,
|
|
1441
|
+
error: query.error,
|
|
1442
|
+
refetch: query.refetch
|
|
1443
|
+
};
|
|
1444
|
+
}
|
|
1378
1445
|
function useBarnsportMunicipalities() {
|
|
1379
1446
|
const { client, orgId } = useAxCloudContext();
|
|
1380
1447
|
const query = reactQuery.useQuery({
|
|
@@ -1411,6 +1478,24 @@ function useBarnsportSports() {
|
|
|
1411
1478
|
refetch: query.refetch
|
|
1412
1479
|
};
|
|
1413
1480
|
}
|
|
1481
|
+
function useBarnsportSport(slug) {
|
|
1482
|
+
const { client, orgId } = useAxCloudContext();
|
|
1483
|
+
const query = reactQuery.useQuery({
|
|
1484
|
+
queryKey: ["axcloud", "barnsport", "sport", orgId, slug],
|
|
1485
|
+
queryFn: () => client.get(
|
|
1486
|
+
`/barnsport/public/${orgId}/sports/${slug || ""}`
|
|
1487
|
+
),
|
|
1488
|
+
enabled: Boolean(slug),
|
|
1489
|
+
staleTime: 1e3 * 60 * 15
|
|
1490
|
+
});
|
|
1491
|
+
return {
|
|
1492
|
+
sport: query.data?.sport ?? null,
|
|
1493
|
+
isLoading: query.isLoading,
|
|
1494
|
+
isError: query.isError,
|
|
1495
|
+
error: query.error,
|
|
1496
|
+
refetch: query.refetch
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1414
1499
|
function useBarnsportActivities(filters = {}) {
|
|
1415
1500
|
const { client, orgId } = useAxCloudContext();
|
|
1416
1501
|
const params = { ...filters };
|
|
@@ -1748,6 +1833,7 @@ exports.useBarnsportActivities = useBarnsportActivities;
|
|
|
1748
1833
|
exports.useBarnsportActivity = useBarnsportActivity;
|
|
1749
1834
|
exports.useBarnsportMunicipalities = useBarnsportMunicipalities;
|
|
1750
1835
|
exports.useBarnsportSitemap = useBarnsportSitemap;
|
|
1836
|
+
exports.useBarnsportSport = useBarnsportSport;
|
|
1751
1837
|
exports.useBarnsportSports = useBarnsportSports;
|
|
1752
1838
|
exports.useBranding = useBranding;
|
|
1753
1839
|
exports.useCodeBallot = useCodeBallot;
|
|
@@ -1761,6 +1847,9 @@ exports.useLinkedAccounts = useLinkedAccounts;
|
|
|
1761
1847
|
exports.useLogo = useLogo;
|
|
1762
1848
|
exports.useMedia = useMedia;
|
|
1763
1849
|
exports.useMediaList = useMediaList;
|
|
1850
|
+
exports.useMemberDocumentDownload = useMemberDocumentDownload;
|
|
1851
|
+
exports.useMemberDocumentFolders = useMemberDocumentFolders;
|
|
1852
|
+
exports.useMemberDocuments = useMemberDocuments;
|
|
1764
1853
|
exports.useModuleAccess = useModuleAccess;
|
|
1765
1854
|
exports.useMySection = useMySection;
|
|
1766
1855
|
exports.useNews = useNews;
|