@noya-app/noya-api-client-react 0.1.35 → 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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +11 -0
- package/dist/index.d.mts +66 -130
- package/dist/index.d.ts +66 -130
- 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,109 +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
|
-
inputs: ({
|
|
50
|
-
required: boolean;
|
|
51
|
-
name: string;
|
|
52
|
-
id: string;
|
|
53
|
-
description: string | null;
|
|
54
|
-
kind: "file";
|
|
55
|
-
toolId: string | null;
|
|
56
|
-
stableId: string;
|
|
57
|
-
} | {
|
|
58
|
-
required: boolean;
|
|
59
|
-
name: string;
|
|
60
|
-
id: string;
|
|
61
|
-
description: string | null;
|
|
62
|
-
kind: "data";
|
|
63
|
-
stableId: string;
|
|
64
|
-
schema?: any;
|
|
65
|
-
} | {
|
|
66
|
-
required: boolean;
|
|
67
|
-
name: string;
|
|
68
|
-
id: string;
|
|
69
|
-
description: string | null;
|
|
70
|
-
kind: "secret";
|
|
71
|
-
stableId: string;
|
|
72
|
-
authProvider: "github" | "figma" | null;
|
|
73
|
-
authScope: string | null;
|
|
74
|
-
})[];
|
|
75
|
-
user?: {
|
|
76
|
-
name: string | null;
|
|
77
|
-
image: string | null;
|
|
78
|
-
} | undefined;
|
|
79
|
-
tool?: {
|
|
80
|
-
name: string;
|
|
81
|
-
id: string;
|
|
82
|
-
} | undefined;
|
|
83
|
-
userId?: string | undefined;
|
|
84
|
-
accessibleByFiles?: any[] | undefined;
|
|
85
|
-
accessibleFiles?: any[] | undefined;
|
|
86
|
-
primarySite?: {
|
|
87
|
-
url: string;
|
|
88
|
-
id: string;
|
|
89
|
-
createdAt: string;
|
|
90
|
-
updatedAt: string;
|
|
91
|
-
subdomain: string | null;
|
|
92
|
-
} | null | undefined;
|
|
93
|
-
} | undefined;
|
|
94
|
-
declare function useNoyaIsOwnFile(fileId?: string): boolean;
|
|
95
15
|
declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
96
16
|
tools: {
|
|
97
17
|
addedById?: string | undefined;
|
|
98
|
-
name: string;
|
|
99
|
-
url: string;
|
|
100
18
|
id: string;
|
|
101
19
|
description: string | null;
|
|
20
|
+
name: string;
|
|
21
|
+
url: string;
|
|
102
22
|
tags: {
|
|
103
23
|
toolCount?: number | undefined;
|
|
104
|
-
name: string;
|
|
105
24
|
id: string;
|
|
25
|
+
name: string;
|
|
106
26
|
rank: number;
|
|
107
27
|
}[];
|
|
108
28
|
createdAt: string;
|
|
109
29
|
updatedAt: string;
|
|
30
|
+
assets: string[];
|
|
110
31
|
slug: string | null;
|
|
111
32
|
tagline: string | null;
|
|
112
|
-
assets: string[];
|
|
113
33
|
homepageUrl: string | null;
|
|
114
34
|
platform: "noya" | "external";
|
|
115
35
|
verificationStatus: "pending" | "approved" | "rejected";
|
|
116
36
|
creator: {
|
|
117
|
-
name: string;
|
|
118
37
|
id: string;
|
|
38
|
+
name: string;
|
|
119
39
|
image: string | null;
|
|
120
40
|
slug: string | null;
|
|
121
41
|
} | null;
|
|
@@ -125,27 +45,27 @@ declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
|
125
45
|
declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
126
46
|
tools: {
|
|
127
47
|
addedById?: string | undefined;
|
|
128
|
-
name: string;
|
|
129
|
-
url: string;
|
|
130
48
|
id: string;
|
|
131
49
|
description: string | null;
|
|
50
|
+
name: string;
|
|
51
|
+
url: string;
|
|
132
52
|
tags: {
|
|
133
53
|
toolCount?: number | undefined;
|
|
134
|
-
name: string;
|
|
135
54
|
id: string;
|
|
55
|
+
name: string;
|
|
136
56
|
rank: number;
|
|
137
57
|
}[];
|
|
138
58
|
createdAt: string;
|
|
139
59
|
updatedAt: string;
|
|
60
|
+
assets: string[];
|
|
140
61
|
slug: string | null;
|
|
141
62
|
tagline: string | null;
|
|
142
|
-
assets: string[];
|
|
143
63
|
homepageUrl: string | null;
|
|
144
64
|
platform: "noya" | "external";
|
|
145
65
|
verificationStatus: "pending" | "approved" | "rejected";
|
|
146
66
|
creator: {
|
|
147
|
-
name: string;
|
|
148
67
|
id: string;
|
|
68
|
+
name: string;
|
|
149
69
|
image: string | null;
|
|
150
70
|
slug: string | null;
|
|
151
71
|
} | null;
|
|
@@ -155,8 +75,8 @@ declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
|
|
|
155
75
|
declare function useNoyaTags(): {
|
|
156
76
|
tags: {
|
|
157
77
|
toolCount?: number | undefined;
|
|
158
|
-
name: string;
|
|
159
78
|
id: string;
|
|
79
|
+
name: string;
|
|
160
80
|
rank: number;
|
|
161
81
|
}[];
|
|
162
82
|
loading: boolean;
|
|
@@ -164,16 +84,16 @@ declare function useNoyaTags(): {
|
|
|
164
84
|
declare function useOptionalNoyaTags(): {
|
|
165
85
|
tags: {
|
|
166
86
|
toolCount?: number | undefined;
|
|
167
|
-
name: string;
|
|
168
87
|
id: string;
|
|
88
|
+
name: string;
|
|
169
89
|
rank: number;
|
|
170
90
|
}[];
|
|
171
91
|
loading: boolean;
|
|
172
92
|
};
|
|
173
93
|
declare function useNoyaCreators(): {
|
|
174
94
|
creators: {
|
|
175
|
-
name: string;
|
|
176
95
|
id: string;
|
|
96
|
+
name: string;
|
|
177
97
|
image: string | null;
|
|
178
98
|
slug: string | null;
|
|
179
99
|
}[];
|
|
@@ -181,8 +101,8 @@ declare function useNoyaCreators(): {
|
|
|
181
101
|
};
|
|
182
102
|
declare function useOptionalNoyaCreators(): {
|
|
183
103
|
creators: {
|
|
184
|
-
name: string;
|
|
185
104
|
id: string;
|
|
105
|
+
name: string;
|
|
186
106
|
image: string | null;
|
|
187
107
|
slug: string | null;
|
|
188
108
|
}[];
|
|
@@ -199,17 +119,17 @@ declare function useNoyaAssets(fileId?: string): {
|
|
|
199
119
|
};
|
|
200
120
|
declare function useNoyaSecrets(fileId?: string): {
|
|
201
121
|
secrets: {
|
|
202
|
-
name: string;
|
|
203
122
|
id: string;
|
|
204
|
-
|
|
123
|
+
name: string;
|
|
205
124
|
fileId: string;
|
|
125
|
+
stableId: string;
|
|
206
126
|
}[];
|
|
207
127
|
loading: boolean;
|
|
208
128
|
};
|
|
209
129
|
declare function useNoyaSession(): {
|
|
210
130
|
user: {
|
|
211
|
-
name: string | null;
|
|
212
131
|
id: string;
|
|
132
|
+
name: string | null;
|
|
213
133
|
image: string | null;
|
|
214
134
|
email: string | null;
|
|
215
135
|
};
|
|
@@ -217,8 +137,8 @@ declare function useNoyaSession(): {
|
|
|
217
137
|
} | null;
|
|
218
138
|
declare function useOptionalNoyaSession(): {
|
|
219
139
|
user: {
|
|
220
|
-
name: string | null;
|
|
221
140
|
id: string;
|
|
141
|
+
name: string | null;
|
|
222
142
|
image: string | null;
|
|
223
143
|
email: string | null;
|
|
224
144
|
};
|
|
@@ -226,13 +146,15 @@ declare function useOptionalNoyaSession(): {
|
|
|
226
146
|
} | null | undefined;
|
|
227
147
|
declare function useNoyaBilling(): {
|
|
228
148
|
subscriptions: {
|
|
149
|
+
id: string;
|
|
150
|
+
status: string;
|
|
229
151
|
items: {
|
|
230
152
|
id: string;
|
|
231
153
|
created: string;
|
|
232
154
|
price: {
|
|
233
155
|
type: string;
|
|
234
|
-
active: boolean;
|
|
235
156
|
id: string;
|
|
157
|
+
active: boolean;
|
|
236
158
|
currency: string;
|
|
237
159
|
nickname: string | null;
|
|
238
160
|
recurringInterval: string;
|
|
@@ -243,8 +165,6 @@ declare function useNoyaBilling(): {
|
|
|
243
165
|
};
|
|
244
166
|
quantity: number;
|
|
245
167
|
}[];
|
|
246
|
-
id: string;
|
|
247
|
-
status: string;
|
|
248
168
|
currency: string;
|
|
249
169
|
created: string;
|
|
250
170
|
cancelAtPeriodEnd: boolean;
|
|
@@ -258,15 +178,15 @@ declare function useNoyaBilling(): {
|
|
|
258
178
|
}[];
|
|
259
179
|
portalUrl: string | null;
|
|
260
180
|
availableProducts: {
|
|
261
|
-
active: boolean;
|
|
262
|
-
name: string;
|
|
263
181
|
id: string;
|
|
264
182
|
description: string | null;
|
|
183
|
+
active: boolean;
|
|
184
|
+
name: string;
|
|
265
185
|
created: string;
|
|
266
186
|
prices: {
|
|
267
187
|
type: string;
|
|
268
|
-
active: boolean;
|
|
269
188
|
id: string;
|
|
189
|
+
active: boolean;
|
|
270
190
|
currency: string;
|
|
271
191
|
nickname: string | null;
|
|
272
192
|
recurringInterval: string;
|
|
@@ -287,10 +207,10 @@ declare function useNoyaWorkspaceBilling(workspaceId: string): {
|
|
|
287
207
|
};
|
|
288
208
|
declare function useNoyaEmailLists(): {
|
|
289
209
|
emailLists: {
|
|
290
|
-
name: string;
|
|
291
|
-
url: string;
|
|
292
210
|
id: string;
|
|
293
211
|
description: string | null;
|
|
212
|
+
name: string;
|
|
213
|
+
url: string;
|
|
294
214
|
optIn: boolean;
|
|
295
215
|
}[];
|
|
296
216
|
loading: boolean;
|
|
@@ -303,10 +223,10 @@ declare function useNoyaUserData(): {
|
|
|
303
223
|
value?: unknown;
|
|
304
224
|
}[];
|
|
305
225
|
emailLists: {
|
|
306
|
-
name: string;
|
|
307
|
-
url: string;
|
|
308
226
|
id: string;
|
|
309
227
|
description: string | null;
|
|
228
|
+
name: string;
|
|
229
|
+
url: string;
|
|
310
230
|
optIn: boolean;
|
|
311
231
|
}[];
|
|
312
232
|
experiments: {};
|
|
@@ -322,10 +242,10 @@ declare function useOptionalNoyaUserData(): {
|
|
|
322
242
|
value?: unknown;
|
|
323
243
|
}[];
|
|
324
244
|
emailLists: {
|
|
325
|
-
name: string;
|
|
326
|
-
url: string;
|
|
327
245
|
id: string;
|
|
328
246
|
description: string | null;
|
|
247
|
+
name: string;
|
|
248
|
+
url: string;
|
|
329
249
|
optIn: boolean;
|
|
330
250
|
}[];
|
|
331
251
|
experiments: {};
|
|
@@ -393,7 +313,6 @@ declare function useGeneratedPageNames(): EnhancedGeneratedPageName[];
|
|
|
393
313
|
declare function useGeneratedPageComponentNames(): EnhancedGeneratedPageName[];
|
|
394
314
|
declare function useNoyaSites(): {
|
|
395
315
|
sites: {
|
|
396
|
-
url?: string | null | undefined;
|
|
397
316
|
id: string;
|
|
398
317
|
createdAt: string;
|
|
399
318
|
updatedAt: string;
|
|
@@ -418,7 +337,6 @@ declare function useNoyaDeployments(): {
|
|
|
418
337
|
};
|
|
419
338
|
declare function useNoyaSite(siteId: string): {
|
|
420
339
|
site: {
|
|
421
|
-
url?: string | null | undefined;
|
|
422
340
|
id: string;
|
|
423
341
|
createdAt: string;
|
|
424
342
|
updatedAt: string;
|
|
@@ -435,8 +353,8 @@ declare function useNoyaPersonalAccessTokens(): {
|
|
|
435
353
|
personalAccessTokens: {
|
|
436
354
|
token?: string | undefined;
|
|
437
355
|
rawToken?: string | undefined;
|
|
438
|
-
name: string;
|
|
439
356
|
id: string;
|
|
357
|
+
name: string;
|
|
440
358
|
createdAt: string;
|
|
441
359
|
lastUsedAt: string | null;
|
|
442
360
|
}[];
|
|
@@ -444,34 +362,37 @@ declare function useNoyaPersonalAccessTokens(): {
|
|
|
444
362
|
};
|
|
445
363
|
declare function useNoyaWorkspaces(): {
|
|
446
364
|
workspaces: {
|
|
447
|
-
name: string;
|
|
448
365
|
id: string;
|
|
366
|
+
name: string;
|
|
449
367
|
createdAt: string;
|
|
450
368
|
updatedAt: string;
|
|
451
369
|
members: {
|
|
452
370
|
id: string;
|
|
453
371
|
role: "OWNER" | "ADMIN" | "MEMBER";
|
|
372
|
+
createdAt: string;
|
|
454
373
|
user: {
|
|
455
|
-
name: string | null;
|
|
456
374
|
id: string;
|
|
375
|
+
name: string | null;
|
|
457
376
|
image: string | null;
|
|
458
377
|
email: string | null;
|
|
459
378
|
};
|
|
460
|
-
createdAt: string;
|
|
461
|
-
userId: string;
|
|
462
379
|
updatedAt: string;
|
|
463
380
|
workspaceId: string;
|
|
381
|
+
userId: string;
|
|
464
382
|
}[];
|
|
465
383
|
}[];
|
|
466
384
|
loading: boolean;
|
|
467
385
|
};
|
|
386
|
+
declare function useNoyaMultiplayerRoomToken(fileId: string): {
|
|
387
|
+
access: "read" | "write";
|
|
388
|
+
} | undefined;
|
|
468
389
|
declare function useNoyaWorkspaceInvitations(workspaceId: string): {
|
|
469
390
|
invitations: {
|
|
470
391
|
id: string;
|
|
471
392
|
role: "OWNER" | "ADMIN" | "MEMBER";
|
|
393
|
+
createdAt: string;
|
|
472
394
|
email: string;
|
|
473
395
|
token: string;
|
|
474
|
-
createdAt: string;
|
|
475
396
|
updatedAt: string;
|
|
476
397
|
workspaceId: string;
|
|
477
398
|
invitedById: string;
|
|
@@ -482,48 +403,63 @@ declare function useNoyaWorkspaceInvitations(workspaceId: string): {
|
|
|
482
403
|
};
|
|
483
404
|
declare function useNoyaOwnedFileVersions(fileId: string): {
|
|
484
405
|
fileVersions: NoyaAPI.FileVersion[];
|
|
485
|
-
loading: NoyaAPI.
|
|
406
|
+
loading: NoyaAPI.FetchStatus;
|
|
486
407
|
reload: () => Promise<void>;
|
|
487
408
|
};
|
|
488
409
|
declare function useNoyaTemplates(): {
|
|
489
410
|
templates: {
|
|
490
|
-
name: string;
|
|
491
411
|
id: string;
|
|
492
412
|
description: string | null;
|
|
493
413
|
status: "pending" | "approved" | "rejected";
|
|
414
|
+
name: string;
|
|
494
415
|
createdAt: string;
|
|
416
|
+
fileId: string | null;
|
|
495
417
|
updatedAt: string;
|
|
496
418
|
workspaceId: string;
|
|
497
|
-
fileId: string | null;
|
|
498
419
|
fileVersionId: string;
|
|
499
420
|
createdByUserId: string;
|
|
500
421
|
fileVersion: {
|
|
501
422
|
data?: any;
|
|
423
|
+
id: string;
|
|
424
|
+
description: string | null;
|
|
502
425
|
icon: string | null;
|
|
503
426
|
name: string;
|
|
504
427
|
version: number;
|
|
505
|
-
id: string;
|
|
506
|
-
description: string | null;
|
|
507
|
-
toolId: string;
|
|
508
428
|
createdAt: string;
|
|
509
|
-
|
|
429
|
+
fileId: string | null;
|
|
430
|
+
toolId: string;
|
|
510
431
|
updatedAt: string;
|
|
511
432
|
access: "private" | "read" | "write";
|
|
512
|
-
|
|
433
|
+
userId: string;
|
|
513
434
|
dataCid: string;
|
|
514
435
|
ownedByFileId: string | null;
|
|
515
436
|
};
|
|
516
437
|
workspace: {
|
|
517
|
-
name: string;
|
|
518
438
|
id: string;
|
|
439
|
+
name: string;
|
|
519
440
|
};
|
|
520
441
|
createdByUser: {
|
|
521
|
-
name: string | null;
|
|
522
442
|
id: string;
|
|
443
|
+
name: string | null;
|
|
523
444
|
image: string | null;
|
|
524
445
|
};
|
|
525
446
|
}[];
|
|
526
447
|
loading: boolean;
|
|
527
448
|
};
|
|
528
449
|
|
|
529
|
-
|
|
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 };
|