@noya-app/noya-api-client-react 0.1.34 → 0.1.36
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/.eslintrc.js +1 -5
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +20 -0
- package/dist/index.d.mts +66 -102
- package/dist/index.d.ts +66 -102
- package/dist/index.js +10336 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10381 -40
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +1 -0
- package/src/react/context.ts +10 -7
- package/src/react/hooks.ts +17 -52
- package/src/react/tableHooks.ts +102 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NoyaAPI } from '@noya-app/noya-api';
|
|
2
2
|
export * from '@noya-app/noya-api';
|
|
3
|
-
import
|
|
4
|
-
import * as _noya_app_noya_component from '@noya-app/noya-component';
|
|
3
|
+
import { SelectConfig, SelectedShape } from '@noya-app/observable';
|
|
5
4
|
|
|
6
5
|
type NoyaAPIContextValue = NoyaAPI.Client;
|
|
7
6
|
declare const NoyaAPIProvider: React.Provider<NoyaAPIContextValue | undefined>;
|
|
@@ -13,81 +12,30 @@ declare function useOptionalNoyaClient(): NoyaAPIContextValue | undefined;
|
|
|
13
12
|
*/
|
|
14
13
|
declare function useNoyaClientOrFallback(): NoyaAPIContextValue;
|
|
15
14
|
|
|
16
|
-
declare function useNoyaFiles(): {
|
|
17
|
-
files: NoyaAPI.File[];
|
|
18
|
-
loading: boolean;
|
|
19
|
-
reload: () => Promise<void>;
|
|
20
|
-
};
|
|
21
|
-
declare function useNoyaFile(fileId?: string): {
|
|
22
|
-
data: {
|
|
23
|
-
document: _noya_app_noya_component.DS;
|
|
24
|
-
schemaVersion: "0.1.0";
|
|
25
|
-
} | {
|
|
26
|
-
document: _noya_app_noya_sketch_file.SketchFile;
|
|
27
|
-
schemaVersion: "0.1.0";
|
|
28
|
-
} | {
|
|
29
|
-
schemaVersion: "0.1.0";
|
|
30
|
-
document?: unknown;
|
|
31
|
-
} | {
|
|
32
|
-
schemaVersion: "0.1.0";
|
|
33
|
-
document?: unknown;
|
|
34
|
-
} | {
|
|
35
|
-
schemaVersion: "0.1.0";
|
|
36
|
-
document?: unknown;
|
|
37
|
-
};
|
|
38
|
-
icon: string | null;
|
|
39
|
-
name: string | null;
|
|
40
|
-
version: number;
|
|
41
|
-
id: string;
|
|
42
|
-
description: string | null;
|
|
43
|
-
toolId: string;
|
|
44
|
-
createdAt: string;
|
|
45
|
-
updatedAt: string;
|
|
46
|
-
access: "private" | "read" | "write";
|
|
47
|
-
workspaceAccess: "private" | "read" | "write";
|
|
48
|
-
workspaceId: string;
|
|
49
|
-
user?: {
|
|
50
|
-
name: string | null;
|
|
51
|
-
image: string | null;
|
|
52
|
-
} | undefined;
|
|
53
|
-
tool?: {
|
|
54
|
-
name: string;
|
|
55
|
-
id: string;
|
|
56
|
-
} | undefined;
|
|
57
|
-
userId?: string | undefined;
|
|
58
|
-
primarySite?: {
|
|
59
|
-
url: string;
|
|
60
|
-
id: string;
|
|
61
|
-
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
|
-
subdomain: string | null;
|
|
64
|
-
} | null | undefined;
|
|
65
|
-
} | undefined;
|
|
66
|
-
declare function useNoyaIsOwnFile(fileId?: string): boolean;
|
|
67
15
|
declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
68
16
|
tools: {
|
|
69
17
|
addedById?: string | undefined;
|
|
70
|
-
name: string;
|
|
71
|
-
url: string;
|
|
72
18
|
id: string;
|
|
73
19
|
description: string | null;
|
|
20
|
+
name: string;
|
|
21
|
+
url: string;
|
|
74
22
|
tags: {
|
|
75
23
|
toolCount?: number | undefined;
|
|
76
|
-
name: string;
|
|
77
24
|
id: string;
|
|
25
|
+
name: string;
|
|
78
26
|
rank: number;
|
|
79
27
|
}[];
|
|
80
28
|
createdAt: string;
|
|
81
29
|
updatedAt: string;
|
|
30
|
+
assets: string[];
|
|
82
31
|
slug: string | null;
|
|
83
32
|
tagline: string | null;
|
|
84
|
-
assets: string[];
|
|
85
33
|
homepageUrl: string | null;
|
|
86
34
|
platform: "noya" | "external";
|
|
87
35
|
verificationStatus: "pending" | "approved" | "rejected";
|
|
88
36
|
creator: {
|
|
89
|
-
name: string;
|
|
90
37
|
id: string;
|
|
38
|
+
name: string;
|
|
91
39
|
image: string | null;
|
|
92
40
|
slug: string | null;
|
|
93
41
|
} | null;
|
|
@@ -97,27 +45,27 @@ declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
|
97
45
|
declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
98
46
|
tools: {
|
|
99
47
|
addedById?: string | undefined;
|
|
100
|
-
name: string;
|
|
101
|
-
url: string;
|
|
102
48
|
id: string;
|
|
103
49
|
description: string | null;
|
|
50
|
+
name: string;
|
|
51
|
+
url: string;
|
|
104
52
|
tags: {
|
|
105
53
|
toolCount?: number | undefined;
|
|
106
|
-
name: string;
|
|
107
54
|
id: string;
|
|
55
|
+
name: string;
|
|
108
56
|
rank: number;
|
|
109
57
|
}[];
|
|
110
58
|
createdAt: string;
|
|
111
59
|
updatedAt: string;
|
|
60
|
+
assets: string[];
|
|
112
61
|
slug: string | null;
|
|
113
62
|
tagline: string | null;
|
|
114
|
-
assets: string[];
|
|
115
63
|
homepageUrl: string | null;
|
|
116
64
|
platform: "noya" | "external";
|
|
117
65
|
verificationStatus: "pending" | "approved" | "rejected";
|
|
118
66
|
creator: {
|
|
119
|
-
name: string;
|
|
120
67
|
id: string;
|
|
68
|
+
name: string;
|
|
121
69
|
image: string | null;
|
|
122
70
|
slug: string | null;
|
|
123
71
|
} | null;
|
|
@@ -127,8 +75,8 @@ declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
|
127
75
|
declare function useNoyaTags(): {
|
|
128
76
|
tags: {
|
|
129
77
|
toolCount?: number | undefined;
|
|
130
|
-
name: string;
|
|
131
78
|
id: string;
|
|
79
|
+
name: string;
|
|
132
80
|
rank: number;
|
|
133
81
|
}[];
|
|
134
82
|
loading: boolean;
|
|
@@ -136,16 +84,16 @@ declare function useNoyaTags(): {
|
|
|
136
84
|
declare function useOptionalNoyaTags(): {
|
|
137
85
|
tags: {
|
|
138
86
|
toolCount?: number | undefined;
|
|
139
|
-
name: string;
|
|
140
87
|
id: string;
|
|
88
|
+
name: string;
|
|
141
89
|
rank: number;
|
|
142
90
|
}[];
|
|
143
91
|
loading: boolean;
|
|
144
92
|
};
|
|
145
93
|
declare function useNoyaCreators(): {
|
|
146
94
|
creators: {
|
|
147
|
-
name: string;
|
|
148
95
|
id: string;
|
|
96
|
+
name: string;
|
|
149
97
|
image: string | null;
|
|
150
98
|
slug: string | null;
|
|
151
99
|
}[];
|
|
@@ -153,8 +101,8 @@ declare function useNoyaCreators(): {
|
|
|
153
101
|
};
|
|
154
102
|
declare function useOptionalNoyaCreators(): {
|
|
155
103
|
creators: {
|
|
156
|
-
name: string;
|
|
157
104
|
id: string;
|
|
105
|
+
name: string;
|
|
158
106
|
image: string | null;
|
|
159
107
|
slug: string | null;
|
|
160
108
|
}[];
|
|
@@ -171,17 +119,17 @@ declare function useNoyaAssets(fileId?: string): {
|
|
|
171
119
|
};
|
|
172
120
|
declare function useNoyaSecrets(fileId?: string): {
|
|
173
121
|
secrets: {
|
|
174
|
-
name: string;
|
|
175
122
|
id: string;
|
|
176
|
-
|
|
123
|
+
name: string;
|
|
177
124
|
fileId: string;
|
|
125
|
+
stableId: string;
|
|
178
126
|
}[];
|
|
179
127
|
loading: boolean;
|
|
180
128
|
};
|
|
181
129
|
declare function useNoyaSession(): {
|
|
182
130
|
user: {
|
|
183
|
-
name: string | null;
|
|
184
131
|
id: string;
|
|
132
|
+
name: string | null;
|
|
185
133
|
image: string | null;
|
|
186
134
|
email: string | null;
|
|
187
135
|
};
|
|
@@ -189,8 +137,8 @@ declare function useNoyaSession(): {
|
|
|
189
137
|
} | null;
|
|
190
138
|
declare function useOptionalNoyaSession(): {
|
|
191
139
|
user: {
|
|
192
|
-
name: string | null;
|
|
193
140
|
id: string;
|
|
141
|
+
name: string | null;
|
|
194
142
|
image: string | null;
|
|
195
143
|
email: string | null;
|
|
196
144
|
};
|
|
@@ -198,13 +146,15 @@ declare function useOptionalNoyaSession(): {
|
|
|
198
146
|
} | null | undefined;
|
|
199
147
|
declare function useNoyaBilling(): {
|
|
200
148
|
subscriptions: {
|
|
149
|
+
id: string;
|
|
150
|
+
status: string;
|
|
201
151
|
items: {
|
|
202
152
|
id: string;
|
|
203
153
|
created: string;
|
|
204
154
|
price: {
|
|
205
155
|
type: string;
|
|
206
|
-
active: boolean;
|
|
207
156
|
id: string;
|
|
157
|
+
active: boolean;
|
|
208
158
|
currency: string;
|
|
209
159
|
nickname: string | null;
|
|
210
160
|
recurringInterval: string;
|
|
@@ -215,8 +165,6 @@ declare function useNoyaBilling(): {
|
|
|
215
165
|
};
|
|
216
166
|
quantity: number;
|
|
217
167
|
}[];
|
|
218
|
-
id: string;
|
|
219
|
-
status: string;
|
|
220
168
|
currency: string;
|
|
221
169
|
created: string;
|
|
222
170
|
cancelAtPeriodEnd: boolean;
|
|
@@ -230,15 +178,15 @@ declare function useNoyaBilling(): {
|
|
|
230
178
|
}[];
|
|
231
179
|
portalUrl: string | null;
|
|
232
180
|
availableProducts: {
|
|
233
|
-
active: boolean;
|
|
234
|
-
name: string;
|
|
235
181
|
id: string;
|
|
236
182
|
description: string | null;
|
|
183
|
+
active: boolean;
|
|
184
|
+
name: string;
|
|
237
185
|
created: string;
|
|
238
186
|
prices: {
|
|
239
187
|
type: string;
|
|
240
|
-
active: boolean;
|
|
241
188
|
id: string;
|
|
189
|
+
active: boolean;
|
|
242
190
|
currency: string;
|
|
243
191
|
nickname: string | null;
|
|
244
192
|
recurringInterval: string;
|
|
@@ -259,10 +207,10 @@ declare function useNoyaWorkspaceBilling(workspaceId: string): {
|
|
|
259
207
|
};
|
|
260
208
|
declare function useNoyaEmailLists(): {
|
|
261
209
|
emailLists: {
|
|
262
|
-
name: string;
|
|
263
|
-
url: string;
|
|
264
210
|
id: string;
|
|
265
211
|
description: string | null;
|
|
212
|
+
name: string;
|
|
213
|
+
url: string;
|
|
266
214
|
optIn: boolean;
|
|
267
215
|
}[];
|
|
268
216
|
loading: boolean;
|
|
@@ -275,10 +223,10 @@ declare function useNoyaUserData(): {
|
|
|
275
223
|
value?: unknown;
|
|
276
224
|
}[];
|
|
277
225
|
emailLists: {
|
|
278
|
-
name: string;
|
|
279
|
-
url: string;
|
|
280
226
|
id: string;
|
|
281
227
|
description: string | null;
|
|
228
|
+
name: string;
|
|
229
|
+
url: string;
|
|
282
230
|
optIn: boolean;
|
|
283
231
|
}[];
|
|
284
232
|
experiments: {};
|
|
@@ -294,10 +242,10 @@ declare function useOptionalNoyaUserData(): {
|
|
|
294
242
|
value?: unknown;
|
|
295
243
|
}[];
|
|
296
244
|
emailLists: {
|
|
297
|
-
name: string;
|
|
298
|
-
url: string;
|
|
299
245
|
id: string;
|
|
300
246
|
description: string | null;
|
|
247
|
+
name: string;
|
|
248
|
+
url: string;
|
|
301
249
|
optIn: boolean;
|
|
302
250
|
}[];
|
|
303
251
|
experiments: {};
|
|
@@ -365,7 +313,6 @@ declare function useGeneratedPageNames(): EnhancedGeneratedPageName[];
|
|
|
365
313
|
declare function useGeneratedPageComponentNames(): EnhancedGeneratedPageName[];
|
|
366
314
|
declare function useNoyaSites(): {
|
|
367
315
|
sites: {
|
|
368
|
-
url?: string | null | undefined;
|
|
369
316
|
id: string;
|
|
370
317
|
createdAt: string;
|
|
371
318
|
updatedAt: string;
|
|
@@ -390,7 +337,6 @@ declare function useNoyaDeployments(): {
|
|
|
390
337
|
};
|
|
391
338
|
declare function useNoyaSite(siteId: string): {
|
|
392
339
|
site: {
|
|
393
|
-
url?: string | null | undefined;
|
|
394
340
|
id: string;
|
|
395
341
|
createdAt: string;
|
|
396
342
|
updatedAt: string;
|
|
@@ -407,8 +353,8 @@ declare function useNoyaPersonalAccessTokens(): {
|
|
|
407
353
|
personalAccessTokens: {
|
|
408
354
|
token?: string | undefined;
|
|
409
355
|
rawToken?: string | undefined;
|
|
410
|
-
name: string;
|
|
411
356
|
id: string;
|
|
357
|
+
name: string;
|
|
412
358
|
createdAt: string;
|
|
413
359
|
lastUsedAt: string | null;
|
|
414
360
|
}[];
|
|
@@ -416,34 +362,37 @@ declare function useNoyaPersonalAccessTokens(): {
|
|
|
416
362
|
};
|
|
417
363
|
declare function useNoyaWorkspaces(): {
|
|
418
364
|
workspaces: {
|
|
419
|
-
name: string;
|
|
420
365
|
id: string;
|
|
366
|
+
name: string;
|
|
421
367
|
createdAt: string;
|
|
422
368
|
updatedAt: string;
|
|
423
369
|
members: {
|
|
424
370
|
id: string;
|
|
425
371
|
role: "OWNER" | "ADMIN" | "MEMBER";
|
|
372
|
+
createdAt: string;
|
|
426
373
|
user: {
|
|
427
|
-
name: string | null;
|
|
428
374
|
id: string;
|
|
375
|
+
name: string | null;
|
|
429
376
|
image: string | null;
|
|
430
377
|
email: string | null;
|
|
431
378
|
};
|
|
432
|
-
createdAt: string;
|
|
433
|
-
userId: string;
|
|
434
379
|
updatedAt: string;
|
|
435
380
|
workspaceId: string;
|
|
381
|
+
userId: string;
|
|
436
382
|
}[];
|
|
437
383
|
}[];
|
|
438
384
|
loading: boolean;
|
|
439
385
|
};
|
|
386
|
+
declare function useNoyaMultiplayerRoomToken(fileId: string): {
|
|
387
|
+
access: "read" | "write";
|
|
388
|
+
} | undefined;
|
|
440
389
|
declare function useNoyaWorkspaceInvitations(workspaceId: string): {
|
|
441
390
|
invitations: {
|
|
442
391
|
id: string;
|
|
443
392
|
role: "OWNER" | "ADMIN" | "MEMBER";
|
|
393
|
+
createdAt: string;
|
|
444
394
|
email: string;
|
|
445
395
|
token: string;
|
|
446
|
-
createdAt: string;
|
|
447
396
|
updatedAt: string;
|
|
448
397
|
workspaceId: string;
|
|
449
398
|
invitedById: string;
|
|
@@ -454,48 +403,63 @@ declare function useNoyaWorkspaceInvitations(workspaceId: string): {
|
|
|
454
403
|
};
|
|
455
404
|
declare function useNoyaOwnedFileVersions(fileId: string): {
|
|
456
405
|
fileVersions: NoyaAPI.FileVersion[];
|
|
457
|
-
loading: NoyaAPI.
|
|
406
|
+
loading: NoyaAPI.FetchStatus;
|
|
458
407
|
reload: () => Promise<void>;
|
|
459
408
|
};
|
|
460
409
|
declare function useNoyaTemplates(): {
|
|
461
410
|
templates: {
|
|
462
|
-
name: string;
|
|
463
411
|
id: string;
|
|
464
412
|
description: string | null;
|
|
465
413
|
status: "pending" | "approved" | "rejected";
|
|
414
|
+
name: string;
|
|
466
415
|
createdAt: string;
|
|
416
|
+
fileId: string | null;
|
|
467
417
|
updatedAt: string;
|
|
468
418
|
workspaceId: string;
|
|
469
|
-
fileId: string | null;
|
|
470
419
|
fileVersionId: string;
|
|
471
420
|
createdByUserId: string;
|
|
472
421
|
fileVersion: {
|
|
473
422
|
data?: any;
|
|
423
|
+
id: string;
|
|
424
|
+
description: string | null;
|
|
474
425
|
icon: string | null;
|
|
475
426
|
name: string;
|
|
476
427
|
version: number;
|
|
477
|
-
id: string;
|
|
478
|
-
description: string | null;
|
|
479
|
-
toolId: string;
|
|
480
428
|
createdAt: string;
|
|
481
|
-
|
|
429
|
+
fileId: string | null;
|
|
430
|
+
toolId: string;
|
|
482
431
|
updatedAt: string;
|
|
483
432
|
access: "private" | "read" | "write";
|
|
484
|
-
|
|
433
|
+
userId: string;
|
|
485
434
|
dataCid: string;
|
|
486
435
|
ownedByFileId: string | null;
|
|
487
436
|
};
|
|
488
437
|
workspace: {
|
|
489
|
-
name: string;
|
|
490
438
|
id: string;
|
|
439
|
+
name: string;
|
|
491
440
|
};
|
|
492
441
|
createdByUser: {
|
|
493
|
-
name: string | null;
|
|
494
442
|
id: string;
|
|
443
|
+
name: string | null;
|
|
495
444
|
image: string | null;
|
|
496
445
|
};
|
|
497
446
|
}[];
|
|
498
447
|
loading: boolean;
|
|
499
448
|
};
|
|
500
449
|
|
|
501
|
-
|
|
450
|
+
type FileListTableOptions = {
|
|
451
|
+
policy?: NoyaAPI.FetchPolicy;
|
|
452
|
+
debug?: boolean;
|
|
453
|
+
};
|
|
454
|
+
declare function useFileList<Config extends SelectConfig<NoyaAPI.FileListItem>>(select: Config, options?: FileListTableOptions): {
|
|
455
|
+
status: NoyaAPI.FetchStatus;
|
|
456
|
+
data: SelectedShape<NoyaAPI.FileListItem, Config>[];
|
|
457
|
+
refetch: () => void;
|
|
458
|
+
};
|
|
459
|
+
declare function useFileListItem<Config extends SelectConfig<NoyaAPI.FileListItem>>(id: string | undefined, select: Config, options?: FileListTableOptions): {
|
|
460
|
+
status: NoyaAPI.FetchStatus;
|
|
461
|
+
data: SelectedShape<NoyaAPI.FileListItem, Config> | undefined;
|
|
462
|
+
refetch: () => void;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export { type EnhancedGeneratedPageName, NoyaAPIProvider, useFileList, useFileListItem, useGeneratedComponentDescription, useGeneratedComponentDescriptions, useGeneratedComponentNames, useGeneratedPageComponentNames, useGeneratedPageNames, useIsBeta, useMetadata, useNetworkRequests, useNoyaAssets, useNoyaBilling, useNoyaClient, useNoyaClientOrFallback, useNoyaCreators, useNoyaDeployments, useNoyaEmailLists, useNoyaMultiplayerRoomToken, useNoyaOwnedFileVersions, useNoyaPersonalAccessTokens, useNoyaSecrets, useNoyaSession, useNoyaSite, useNoyaSites, useNoyaTags, useNoyaTemplates, useNoyaTools, useNoyaUserData, useNoyaWorkspaceBilling, useNoyaWorkspaceInvitations, useNoyaWorkspaces, useOptionalNoyaClient, useOptionalNoyaCreators, useOptionalNoyaSession, useOptionalNoyaTags, useOptionalNoyaTools, useOptionalNoyaUserData, useRandomIcons, useRandomImages };
|