@axcode/axcloud-sdk 0.2.0-dev.03fb26c → 0.2.0-dev.85285e0
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 +44 -0
- package/dist/analytics-BOxmSWNt.d.ts +432 -0
- package/dist/analytics-LYZxP7PC.d.mts +432 -0
- package/dist/barnsport.d.mts +30 -0
- package/dist/barnsport.d.ts +30 -0
- package/dist/barnsport.js +69 -0
- package/dist/barnsport.js.map +1 -0
- package/dist/barnsport.mjs +4 -0
- package/dist/barnsport.mjs.map +1 -0
- package/dist/chunk-2A5NJAFA.mjs +15 -0
- package/dist/chunk-2A5NJAFA.mjs.map +1 -0
- package/dist/chunk-DI4M6A7K.js +474 -0
- package/dist/chunk-DI4M6A7K.js.map +1 -0
- package/dist/chunk-DSWRJZWR.js +18 -0
- package/dist/chunk-DSWRJZWR.js.map +1 -0
- package/dist/chunk-EX66R5IA.js +278 -0
- package/dist/chunk-EX66R5IA.js.map +1 -0
- package/dist/chunk-F3JPEND3.mjs +461 -0
- package/dist/chunk-F3JPEND3.mjs.map +1 -0
- package/dist/chunk-HRNRGCCT.mjs +262 -0
- package/dist/chunk-HRNRGCCT.mjs.map +1 -0
- package/dist/client-FOpKwe3e.d.mts +75 -0
- package/dist/client-FOpKwe3e.d.ts +75 -0
- package/dist/index.d.mts +10 -737
- package/dist/index.d.ts +10 -737
- package/dist/index.js +112 -632
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -585
- package/dist/index.mjs.map +1 -1
- package/dist/public.d.mts +27 -0
- package/dist/public.d.ts +27 -0
- package/dist/public.js +111 -0
- package/dist/public.js.map +1 -0
- package/dist/public.mjs +99 -0
- package/dist/public.mjs.map +1 -0
- package/dist/useBarnsport-1DObGZDl.d.mts +526 -0
- package/dist/useBarnsport-1DObGZDl.d.ts +526 -0
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -40,6 +40,50 @@ version in a branch when needed, then promote and pin the stable release.
|
|
|
40
40
|
|
|
41
41
|
## Quick Start
|
|
42
42
|
|
|
43
|
+
### Anonymous public sites (no Auth0)
|
|
44
|
+
|
|
45
|
+
Public product sites that do not have member login should import the dedicated
|
|
46
|
+
provider. It mounts the SDK client, React Query cache and privacy-safe analytics
|
|
47
|
+
without importing or initializing Auth0:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { AxCloudPublicProvider } from '@axcode/axcloud-sdk/public';
|
|
51
|
+
|
|
52
|
+
<AxCloudPublicProvider
|
|
53
|
+
orgId="barnsport"
|
|
54
|
+
apiUrl="https://api.axcloud.app"
|
|
55
|
+
stage="prod"
|
|
56
|
+
apiKey="pk_live_barnsport_read_submit"
|
|
57
|
+
>
|
|
58
|
+
<App />
|
|
59
|
+
</AxCloudPublicProvider>;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Use a browser-safe key restricted to the public scopes needed by the site. Do
|
|
63
|
+
not use `AxCloudPublicProvider` for member or administrator features. Existing
|
|
64
|
+
authenticated applications continue to use `AxCloudProvider` unchanged.
|
|
65
|
+
|
|
66
|
+
### Barnsport product client and hooks
|
|
67
|
+
|
|
68
|
+
Barnsport types, the core client and React hooks are available from a separate
|
|
69
|
+
entrypoint so other products do not load Barnsport code:
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import {
|
|
73
|
+
useBarnsportProviderSearch,
|
|
74
|
+
useBarnsportProvider,
|
|
75
|
+
useSubmitBarnsportReview,
|
|
76
|
+
useTrackBarnsportEvent,
|
|
77
|
+
} from '@axcode/axcloud-sdk/barnsport';
|
|
78
|
+
|
|
79
|
+
const providers = useBarnsportProviderSearch({ q: searchText, limit: 5 });
|
|
80
|
+
const provider = useBarnsportProvider(providerSlug);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Provider reviews and product events remain Barnsport domain data. The SDK
|
|
84
|
+
routes them through the AxCloud Barnsport proxy; it does not store them in the
|
|
85
|
+
generic Content service.
|
|
86
|
+
|
|
43
87
|
### 1. Wrap your app with AxCloudProvider
|
|
44
88
|
|
|
45
89
|
```tsx
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { A as AxCloudClient } from './client-FOpKwe3e.js';
|
|
2
|
+
|
|
3
|
+
type AnalyticsEventValue = string | number | boolean;
|
|
4
|
+
type AnalyticsEventData = Record<string, AnalyticsEventValue>;
|
|
5
|
+
interface AxCloudAnalyticsOptions {
|
|
6
|
+
/** Site key configured in AxCloud, for example "public-web". */
|
|
7
|
+
siteKey: string;
|
|
8
|
+
/** Analytics is opt-in and disabled unless this is true. */
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
/** Allow local collection for explicit development tests. */
|
|
11
|
+
trackLocalhost?: boolean;
|
|
12
|
+
/** Override path normalization. Return null to skip a pageview. */
|
|
13
|
+
normalizePath?: (pathname: string) => string | null;
|
|
14
|
+
}
|
|
15
|
+
interface AnalyticsPublicConfig {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
provider?: 'umami';
|
|
18
|
+
websiteId?: string;
|
|
19
|
+
scriptUrl?: string;
|
|
20
|
+
hostUrl?: string;
|
|
21
|
+
domains?: string[];
|
|
22
|
+
autoTrack?: boolean;
|
|
23
|
+
respectDoNotTrack?: boolean;
|
|
24
|
+
excludeSearch?: boolean;
|
|
25
|
+
excludeHash?: boolean;
|
|
26
|
+
allowedEvents?: string[];
|
|
27
|
+
}
|
|
28
|
+
interface AnalyticsRuntime {
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
ready: boolean;
|
|
31
|
+
track: (eventName: string, data?: AnalyticsEventData) => boolean;
|
|
32
|
+
trackPageView: (pathname?: string) => boolean;
|
|
33
|
+
}
|
|
34
|
+
declare function isLocalAnalyticsHostname(hostname: string): boolean;
|
|
35
|
+
declare function sanitizeAnalyticsPath(pathname: string, customNormalizer?: (pathname: string) => string | null): string | null;
|
|
36
|
+
declare function sanitizeAnalyticsEventData(data: AnalyticsEventData | undefined): AnalyticsEventData | undefined;
|
|
37
|
+
declare function isAllowedAnalyticsEvent(eventName: string, allowedEvents: string[] | undefined): boolean;
|
|
38
|
+
declare function fetchAnalyticsPublicConfig(input: {
|
|
39
|
+
apiUrl: string;
|
|
40
|
+
orgId: string;
|
|
41
|
+
siteKey: string;
|
|
42
|
+
stage: string;
|
|
43
|
+
hostname: string;
|
|
44
|
+
signal?: AbortSignal;
|
|
45
|
+
}): Promise<AnalyticsPublicConfig>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* AxCloud SDK Types
|
|
49
|
+
*
|
|
50
|
+
* Note: In the future, these types should be auto-generated from the OpenAPI spec.
|
|
51
|
+
* For now, they are manually defined based on the AxCloud API.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
type AxCloudModule = 'content' | 'members' | 'sections' | 'training' | 'ai' | 'documents' | 'voting';
|
|
55
|
+
type SystemRole = 'super_admin' | 'org_admin' | 'section_admin' | 'member' | 'viewer';
|
|
56
|
+
type UserRole = SystemRole | 'superadmin' | 'admin' | 'editor';
|
|
57
|
+
type BaseRole = 'org_admin' | 'section_admin' | 'member' | 'viewer';
|
|
58
|
+
/**
|
|
59
|
+
* Custom role definition
|
|
60
|
+
*/
|
|
61
|
+
interface CustomRole {
|
|
62
|
+
role_id: string;
|
|
63
|
+
org_id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
baseRole: BaseRole;
|
|
67
|
+
permissions?: string[];
|
|
68
|
+
deniedPermissions?: string[];
|
|
69
|
+
effectivePermissions?: string[];
|
|
70
|
+
color?: string;
|
|
71
|
+
icon?: string;
|
|
72
|
+
hierarchy: number;
|
|
73
|
+
isSystem: false;
|
|
74
|
+
isActive: boolean;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
}
|
|
78
|
+
interface Organization {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
slug: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
modules: AxCloudModule[];
|
|
84
|
+
settings?: OrganizationSettings;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
updatedAt: string;
|
|
87
|
+
}
|
|
88
|
+
interface OrganizationSettings {
|
|
89
|
+
allowPublicSignup?: boolean;
|
|
90
|
+
requireEmailVerification?: boolean;
|
|
91
|
+
defaultUserRole?: UserRole;
|
|
92
|
+
theme?: {
|
|
93
|
+
primaryColor?: string;
|
|
94
|
+
logo?: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
interface Section {
|
|
98
|
+
id: string;
|
|
99
|
+
organizationId: string;
|
|
100
|
+
name: string;
|
|
101
|
+
description?: string;
|
|
102
|
+
slug: string;
|
|
103
|
+
parentId?: string;
|
|
104
|
+
permissions?: SectionPermissions;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
updatedAt: string;
|
|
107
|
+
}
|
|
108
|
+
interface SectionPermissions {
|
|
109
|
+
canViewMembers?: boolean;
|
|
110
|
+
canEditContent?: boolean;
|
|
111
|
+
canManageMembers?: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface User {
|
|
114
|
+
id: string;
|
|
115
|
+
email: string;
|
|
116
|
+
name: string;
|
|
117
|
+
firstName?: string;
|
|
118
|
+
lastName?: string;
|
|
119
|
+
/** Organization-specific title/position. Managed by organization administrators. */
|
|
120
|
+
title?: string | null;
|
|
121
|
+
phone?: string | null;
|
|
122
|
+
address?: string | null;
|
|
123
|
+
avatar?: string;
|
|
124
|
+
organizationId: string;
|
|
125
|
+
sectionId?: string;
|
|
126
|
+
role: UserRole;
|
|
127
|
+
customRole?: CustomRole;
|
|
128
|
+
permissions?: string[];
|
|
129
|
+
metadata?: Record<string, unknown>;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
updatedAt: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Check if user has a specific permission
|
|
135
|
+
*/
|
|
136
|
+
declare function userHasPermission(user: User, permission: string): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Check if user has any of the specified permissions
|
|
139
|
+
*/
|
|
140
|
+
declare function userHasAnyPermission(user: User, permissions: string[]): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Check if user has all of the specified permissions
|
|
143
|
+
*/
|
|
144
|
+
declare function userHasAllPermissions(user: User, permissions: string[]): boolean;
|
|
145
|
+
interface Membership {
|
|
146
|
+
userId: string;
|
|
147
|
+
organizationId: string;
|
|
148
|
+
sectionId?: string;
|
|
149
|
+
section?: Section;
|
|
150
|
+
role: UserRole;
|
|
151
|
+
/** Organization-specific title/position, separate from the access role. */
|
|
152
|
+
title?: string | null;
|
|
153
|
+
status: 'active' | 'pending' | 'suspended' | 'expired';
|
|
154
|
+
joinedAt: string;
|
|
155
|
+
expiresAt?: string;
|
|
156
|
+
metadata?: Record<string, unknown>;
|
|
157
|
+
}
|
|
158
|
+
interface ContentBlock {
|
|
159
|
+
id: string;
|
|
160
|
+
type: string;
|
|
161
|
+
content?: string;
|
|
162
|
+
url?: string;
|
|
163
|
+
alt?: string;
|
|
164
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
165
|
+
items?: unknown[];
|
|
166
|
+
language?: string;
|
|
167
|
+
caption?: string;
|
|
168
|
+
attributes?: Record<string, unknown>;
|
|
169
|
+
ordered?: boolean;
|
|
170
|
+
author?: string;
|
|
171
|
+
}
|
|
172
|
+
interface ContentTranslation {
|
|
173
|
+
title: string;
|
|
174
|
+
slug: string;
|
|
175
|
+
description?: string;
|
|
176
|
+
blocks: ContentBlock[];
|
|
177
|
+
/** Structured website/template fields for this language. */
|
|
178
|
+
fields?: Record<string, unknown>;
|
|
179
|
+
metaTitle?: string;
|
|
180
|
+
metaDescription?: string;
|
|
181
|
+
keywords?: string[];
|
|
182
|
+
}
|
|
183
|
+
type ContentPublicationState = 'draft' | 'published' | 'archived';
|
|
184
|
+
type ContentAudience = 'public' | 'internal' | 'members' | 'section';
|
|
185
|
+
interface ContentItem {
|
|
186
|
+
id: string;
|
|
187
|
+
/** Present when a consumer needs to distinguish organizations outside its configured provider. */
|
|
188
|
+
organizationId?: string;
|
|
189
|
+
type: string;
|
|
190
|
+
title: string;
|
|
191
|
+
slug: string;
|
|
192
|
+
/** Legacy string content. New AxCloud content uses `blocks`. */
|
|
193
|
+
content?: string;
|
|
194
|
+
description?: string;
|
|
195
|
+
blocks?: ContentBlock[];
|
|
196
|
+
/** Template identifier used by websites, e.g. "home" or "landing". */
|
|
197
|
+
template?: string;
|
|
198
|
+
/** Structured website/template fields. Frontends own layout and read these values by key. */
|
|
199
|
+
fields?: Record<string, unknown>;
|
|
200
|
+
excerpt?: string;
|
|
201
|
+
author?: {
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
};
|
|
205
|
+
status?: ContentPublicationState;
|
|
206
|
+
visibility?: ContentPublicationState;
|
|
207
|
+
/** @deprecated Delivery access is derived from publication metadata and the verified visitor. */
|
|
208
|
+
audience?: ContentAudience;
|
|
209
|
+
sectionId?: string;
|
|
210
|
+
tags?: string[];
|
|
211
|
+
lang?: string;
|
|
212
|
+
featuredImage?: string;
|
|
213
|
+
metaTitle?: string;
|
|
214
|
+
metaDescription?: string;
|
|
215
|
+
keywords?: string[];
|
|
216
|
+
translations?: Record<string, ContentTranslation>;
|
|
217
|
+
currentLanguage?: string;
|
|
218
|
+
availableLanguages?: string[];
|
|
219
|
+
seo?: {
|
|
220
|
+
canonical: string;
|
|
221
|
+
hreflang: Array<{
|
|
222
|
+
lang: string;
|
|
223
|
+
href: string;
|
|
224
|
+
}>;
|
|
225
|
+
};
|
|
226
|
+
publishedAt?: string;
|
|
227
|
+
createdAt: string;
|
|
228
|
+
updatedAt: string;
|
|
229
|
+
}
|
|
230
|
+
interface NewsItem extends ContentItem {
|
|
231
|
+
type: 'news';
|
|
232
|
+
featuredImage?: string;
|
|
233
|
+
category?: string;
|
|
234
|
+
tags?: string[];
|
|
235
|
+
}
|
|
236
|
+
interface Page extends ContentItem {
|
|
237
|
+
type: 'page';
|
|
238
|
+
template?: string;
|
|
239
|
+
order?: number;
|
|
240
|
+
}
|
|
241
|
+
interface ContentListResponse<T> {
|
|
242
|
+
items: T[];
|
|
243
|
+
count: number;
|
|
244
|
+
total: number;
|
|
245
|
+
page: number;
|
|
246
|
+
pageSize: number;
|
|
247
|
+
hasMore: boolean;
|
|
248
|
+
nextCursor?: string;
|
|
249
|
+
}
|
|
250
|
+
/** @deprecated Use ContentListResponse. */
|
|
251
|
+
type PaginatedResponse<T> = ContentListResponse<T>;
|
|
252
|
+
type ContentCollectionType = 'news' | 'pages' | 'events';
|
|
253
|
+
type ContentDetailType = 'news' | 'page' | 'event';
|
|
254
|
+
interface AxCloudConfig {
|
|
255
|
+
orgId: string;
|
|
256
|
+
apiUrl: string;
|
|
257
|
+
/** API stage - defaults to 'dev'. Use 'prod' for production. */
|
|
258
|
+
stage: string;
|
|
259
|
+
/** API key for public content endpoints (optional - required for public API access) */
|
|
260
|
+
apiKey?: string;
|
|
261
|
+
/** Optional privacy-safe web analytics collection. */
|
|
262
|
+
analytics?: AxCloudAnalyticsOptions;
|
|
263
|
+
auth0: {
|
|
264
|
+
domain: string;
|
|
265
|
+
clientId: string;
|
|
266
|
+
redirectUri: string;
|
|
267
|
+
audience?: string;
|
|
268
|
+
/** Auth0 Organization ID. Use this for invite-only member sites. */
|
|
269
|
+
organization?: string;
|
|
270
|
+
/** Database connection name for password operations. Defaults to 'Username-Password-Authentication' */
|
|
271
|
+
connection?: string;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
interface ContentQueryOptions {
|
|
275
|
+
page?: number;
|
|
276
|
+
pageSize?: number;
|
|
277
|
+
/** @deprecated Delivery endpoints always return the published snapshot. */
|
|
278
|
+
status?: ContentPublicationState;
|
|
279
|
+
/** @deprecated Delivery endpoints always return the published snapshot. */
|
|
280
|
+
visibility?: ContentPublicationState;
|
|
281
|
+
audience?: ContentAudience;
|
|
282
|
+
/** @deprecated Member section access is derived from the verified token. */
|
|
283
|
+
sectionId?: string;
|
|
284
|
+
search?: string;
|
|
285
|
+
sortBy?: 'publishedAt' | 'createdAt' | 'updatedAt' | 'title';
|
|
286
|
+
sortOrder?: 'asc' | 'desc';
|
|
287
|
+
tags?: string[];
|
|
288
|
+
/** Return the requested translation when content has language variants. */
|
|
289
|
+
lang?: string;
|
|
290
|
+
/** Force public endpoint even when authenticated (for public pages) */
|
|
291
|
+
publicOnly?: boolean;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Organization branding information
|
|
295
|
+
*/
|
|
296
|
+
interface OrganizationBranding {
|
|
297
|
+
organizationId: string;
|
|
298
|
+
name: string;
|
|
299
|
+
branding: {
|
|
300
|
+
/** Signed URL for logo (expires in 1 hour) */
|
|
301
|
+
logoUrl: string | null;
|
|
302
|
+
/** Seconds until logoUrl expires */
|
|
303
|
+
logoExpiresIn: number | null;
|
|
304
|
+
/** Primary brand color (hex) */
|
|
305
|
+
primaryColor: string | null;
|
|
306
|
+
/** Secondary brand color (hex) */
|
|
307
|
+
secondaryColor: string | null;
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Signed URL response for media assets
|
|
312
|
+
*/
|
|
313
|
+
interface SignedMediaUrl {
|
|
314
|
+
/** Signed S3 URL (expires in 1 hour) */
|
|
315
|
+
url: string;
|
|
316
|
+
/** Seconds until URL expires */
|
|
317
|
+
expiresIn: number;
|
|
318
|
+
/** S3 bucket name */
|
|
319
|
+
bucket: string;
|
|
320
|
+
/** S3 object key */
|
|
321
|
+
key: string;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Media list item
|
|
325
|
+
*/
|
|
326
|
+
interface MediaItem {
|
|
327
|
+
/** File key (filename) */
|
|
328
|
+
key: string;
|
|
329
|
+
/** File size in bytes */
|
|
330
|
+
size: number;
|
|
331
|
+
/** Last modified timestamp */
|
|
332
|
+
lastModified: string;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Media list response
|
|
336
|
+
*/
|
|
337
|
+
interface MediaListResponse {
|
|
338
|
+
items: MediaItem[];
|
|
339
|
+
count: number;
|
|
340
|
+
bucket: string;
|
|
341
|
+
prefix: string;
|
|
342
|
+
}
|
|
343
|
+
type DocumentStatus = 'draft' | 'published' | 'archived';
|
|
344
|
+
type DocumentAudience = 'public' | 'members' | 'section' | 'internal';
|
|
345
|
+
type DocumentSourceProvider = 'upload' | 'sharepoint';
|
|
346
|
+
/**
|
|
347
|
+
* Public document metadata exposed through the AxCloud SDK.
|
|
348
|
+
*/
|
|
349
|
+
interface DocumentItem {
|
|
350
|
+
document_id: string;
|
|
351
|
+
org_id: string;
|
|
352
|
+
title: string;
|
|
353
|
+
description?: string;
|
|
354
|
+
filename: string;
|
|
355
|
+
mime_type: string;
|
|
356
|
+
size: number;
|
|
357
|
+
status: DocumentStatus;
|
|
358
|
+
audience: DocumentAudience;
|
|
359
|
+
tags: string[];
|
|
360
|
+
source_provider: DocumentSourceProvider;
|
|
361
|
+
created_at: string;
|
|
362
|
+
updated_at: string;
|
|
363
|
+
published_at?: string;
|
|
364
|
+
/** Section IDs this document is scoped to (member endpoint only). */
|
|
365
|
+
section_ids?: string[];
|
|
366
|
+
/** Display name of the member who uploaded the document (member endpoint only). */
|
|
367
|
+
uploaded_by_name?: string;
|
|
368
|
+
/** Folder IDs this document belongs to (member endpoint only). */
|
|
369
|
+
folder_ids?: string[];
|
|
370
|
+
}
|
|
371
|
+
interface DocumentListResponse {
|
|
372
|
+
items: DocumentItem[];
|
|
373
|
+
count: number;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* A document folder the current member is allowed to see.
|
|
377
|
+
*
|
|
378
|
+
* Members receive folders for their own sections plus org-level folders
|
|
379
|
+
* (`section_id === null`). Returned by the member document-folders endpoint.
|
|
380
|
+
*/
|
|
381
|
+
interface DocumentFolder {
|
|
382
|
+
id: string;
|
|
383
|
+
/** Section this folder belongs to, or `null` for org-level folders. */
|
|
384
|
+
section_id: string | null;
|
|
385
|
+
/** Parent folder for nesting, or `null` for a top-level folder. */
|
|
386
|
+
parent_folder_id: string | null;
|
|
387
|
+
name: string;
|
|
388
|
+
sort_order: number;
|
|
389
|
+
}
|
|
390
|
+
interface DocumentFolderListResponse {
|
|
391
|
+
folders: DocumentFolder[];
|
|
392
|
+
}
|
|
393
|
+
interface SignedDocumentUrl {
|
|
394
|
+
documentId: string;
|
|
395
|
+
url: string;
|
|
396
|
+
expiresIn: number;
|
|
397
|
+
filename: string;
|
|
398
|
+
mimeType: string;
|
|
399
|
+
}
|
|
400
|
+
interface DocumentQueryOptions {
|
|
401
|
+
search?: string;
|
|
402
|
+
tags?: string[];
|
|
403
|
+
limit?: number;
|
|
404
|
+
/** Restrict results to documents belonging to this folder (member endpoint only). */
|
|
405
|
+
folderId?: string;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
interface AxCloudContextValue {
|
|
409
|
+
config: AxCloudConfig;
|
|
410
|
+
client: AxCloudClient;
|
|
411
|
+
orgId: string;
|
|
412
|
+
/** API stage (e.g., 'dev', 'prod') */
|
|
413
|
+
stage: string;
|
|
414
|
+
/** Whether using public API mode (API key, no auth) */
|
|
415
|
+
isPublicMode: boolean;
|
|
416
|
+
/** Auth0 has completed its initial session check. */
|
|
417
|
+
isAuthLoading?: boolean;
|
|
418
|
+
/** Whether the current browser session is authenticated. */
|
|
419
|
+
isAuthenticated?: boolean;
|
|
420
|
+
/** Auth0 subject used to isolate member-only query caches. */
|
|
421
|
+
authSubject?: string;
|
|
422
|
+
/** Remove identity-bound AxCloud query data before logout or account changes. */
|
|
423
|
+
clearContentCache?: () => void;
|
|
424
|
+
analytics: AnalyticsRuntime;
|
|
425
|
+
}
|
|
426
|
+
declare function useAxCloudContext(): AxCloudContextValue;
|
|
427
|
+
|
|
428
|
+
type AnalyticsRuntimeConfig = Pick<AxCloudConfig, 'analytics' | 'apiUrl' | 'orgId' | 'stage'>;
|
|
429
|
+
declare function useAnalyticsRuntime(config: AnalyticsRuntimeConfig): AnalyticsRuntime;
|
|
430
|
+
declare function useAnalytics(): AnalyticsRuntime;
|
|
431
|
+
|
|
432
|
+
export { type AxCloudAnalyticsOptions as A, type BaseRole as B, type ContentItem as C, type DocumentQueryOptions as D, type PaginatedResponse as E, type SectionPermissions as F, type SystemRole as G, fetchAnalyticsPublicConfig as H, isAllowedAnalyticsEvent as I, isLocalAnalyticsHostname as J, sanitizeAnalyticsEventData as K, sanitizeAnalyticsPath as L, type MediaItem as M, type NewsItem as N, type Organization as O, type Page as P, useAnalytics as Q, useAnalyticsRuntime as R, type Section as S, useAxCloudContext as T, type User as U, userHasAllPermissions as V, userHasAnyPermission as W, userHasPermission as X, type UserRole as a, type AxCloudModule as b, type ContentQueryOptions as c, type ContentListResponse as d, type SignedMediaUrl as e, type OrganizationBranding as f, type MediaListResponse as g, type SignedDocumentUrl as h, type DocumentItem as i, type DocumentListResponse as j, type DocumentFolder as k, type DocumentFolderListResponse as l, type AnalyticsEventData as m, type AnalyticsEventValue as n, type AnalyticsPublicConfig as o, type AnalyticsRuntime as p, type AnalyticsRuntimeConfig as q, type AxCloudConfig as r, type ContentCollectionType as s, type ContentDetailType as t, type CustomRole as u, type DocumentAudience as v, type DocumentSourceProvider as w, type DocumentStatus as x, type Membership as y, type OrganizationSettings as z };
|