@noya-app/noya-api-client-react 0.1.36 → 0.1.38

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.
@@ -7,12 +7,12 @@
7
7
  CJS Build start
8
8
  ESM Build start
9
9
  DTS Build start
10
- ESM dist/index.mjs 371.29 KB
11
- ESM dist/index.mjs.map 979.82 KB
12
- ESM ⚡️ Build success in 269ms
13
- CJS dist/index.js 378.42 KB
14
- CJS dist/index.js.map 980.17 KB
15
- CJS ⚡️ Build success in 270ms
16
- DTS ⚡️ Build success in 8430ms
17
- DTS dist/index.d.ts 12.96 KB
18
- DTS dist/index.d.mts 12.96 KB
10
+ ESM dist/index.mjs 397.35 KB
11
+ ESM dist/index.mjs.map 1.03 MB
12
+ ESM ⚡️ Build success in 661ms
13
+ CJS dist/index.js 405.35 KB
14
+ CJS dist/index.js.map 1.03 MB
15
+ CJS ⚡️ Build success in 766ms
16
+ DTS ⚡️ Build success in 23555ms
17
+ DTS dist/index.d.ts 15.71 KB
18
+ DTS dist/index.d.mts 15.71 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @noya-app/noya-api-client-react
2
2
 
3
+ ## 0.1.38
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [38b4ec2]
8
+ - @noya-app/noya-utils@0.1.8
9
+ - @noya-app/noya-api@0.1.38
10
+
11
+ ## 0.1.37
12
+
13
+ ### Patch Changes
14
+
15
+ - 6f0b309: Bump version
16
+ - Updated dependencies [6f0b309]
17
+ - @noya-app/noya-utils@0.1.7
18
+ - @noya-app/observable@0.1.12
19
+ - @noya-app/noya-api@0.1.37
20
+ - @noya-app/observable-react@0.1.22
21
+ - @noya-app/observable-store@0.1.1
22
+
3
23
  ## 0.1.36
4
24
 
5
25
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { NoyaAPI } from '@noya-app/noya-api';
2
2
  export * from '@noya-app/noya-api';
3
+ import { Static } from '@noya-app/noya-multiplayer-react';
4
+ import { Resource, ActivityEvent } from '@noya-app/noya-schemas';
3
5
  import { SelectConfig, SelectedShape } from '@noya-app/observable';
6
+ import { Table, EntitySchema, TableFetchOptions, RefetchFunction } from '@noya-app/observable-store';
4
7
 
5
8
  type NoyaAPIContextValue = NoyaAPI.Client;
6
9
  declare const NoyaAPIProvider: React.Provider<NoyaAPIContextValue | undefined>;
@@ -16,17 +19,17 @@ declare function useNoyaTools(initial?: NoyaAPI.Tool[]): {
16
19
  tools: {
17
20
  addedById?: string | undefined;
18
21
  id: string;
19
- description: string | null;
20
22
  name: string;
23
+ createdAt: string;
21
24
  url: string;
25
+ description: string | null;
26
+ updatedAt: string;
22
27
  tags: {
23
28
  toolCount?: number | undefined;
24
29
  id: string;
25
30
  name: string;
26
31
  rank: number;
27
32
  }[];
28
- createdAt: string;
29
- updatedAt: string;
30
33
  assets: string[];
31
34
  slug: string | null;
32
35
  tagline: string | null;
@@ -46,17 +49,17 @@ declare function useOptionalNoyaTools(initial?: NoyaAPI.Tool[]): {
46
49
  tools: {
47
50
  addedById?: string | undefined;
48
51
  id: string;
49
- description: string | null;
50
52
  name: string;
53
+ createdAt: string;
51
54
  url: string;
55
+ description: string | null;
56
+ updatedAt: string;
52
57
  tags: {
53
58
  toolCount?: number | undefined;
54
59
  id: string;
55
60
  name: string;
56
61
  rank: number;
57
62
  }[];
58
- createdAt: string;
59
- updatedAt: string;
60
63
  assets: string[];
61
64
  slug: string | null;
62
65
  tagline: string | null;
@@ -110,8 +113,25 @@ declare function useOptionalNoyaCreators(): {
110
113
  };
111
114
  declare function useNoyaAssets(fileId?: string): {
112
115
  assets: {
116
+ width: number | null;
117
+ height: number | null;
118
+ id: string;
119
+ createdAt: string;
120
+ userId: string | null;
121
+ url?: string | undefined;
122
+ size?: number | undefined;
123
+ contentType?: string | undefined;
124
+ }[];
125
+ loading: boolean;
126
+ };
127
+ declare function useNoyaAssetsByFileVersionId(fileVersionId: string): {
128
+ assets: {
129
+ width: number | null;
130
+ height: number | null;
113
131
  id: string;
114
132
  createdAt: string;
133
+ userId: string | null;
134
+ url?: string | undefined;
115
135
  size?: number | undefined;
116
136
  contentType?: string | undefined;
117
137
  }[];
@@ -130,8 +150,8 @@ declare function useNoyaSession(): {
130
150
  user: {
131
151
  id: string;
132
152
  name: string | null;
133
- image: string | null;
134
153
  email: string | null;
154
+ image: string | null;
135
155
  };
136
156
  expires: string;
137
157
  } | null;
@@ -139,15 +159,14 @@ declare function useOptionalNoyaSession(): {
139
159
  user: {
140
160
  id: string;
141
161
  name: string | null;
142
- image: string | null;
143
162
  email: string | null;
163
+ image: string | null;
144
164
  };
145
165
  expires: string;
146
166
  } | null | undefined;
147
167
  declare function useNoyaBilling(): {
148
168
  subscriptions: {
149
169
  id: string;
150
- status: string;
151
170
  items: {
152
171
  id: string;
153
172
  created: string;
@@ -165,6 +184,7 @@ declare function useNoyaBilling(): {
165
184
  };
166
185
  quantity: number;
167
186
  }[];
187
+ status: string;
168
188
  currency: string;
169
189
  created: string;
170
190
  cancelAtPeriodEnd: boolean;
@@ -179,9 +199,9 @@ declare function useNoyaBilling(): {
179
199
  portalUrl: string | null;
180
200
  availableProducts: {
181
201
  id: string;
202
+ name: string;
182
203
  description: string | null;
183
204
  active: boolean;
184
- name: string;
185
205
  created: string;
186
206
  prices: {
187
207
  type: string;
@@ -208,9 +228,9 @@ declare function useNoyaWorkspaceBilling(workspaceId: string): {
208
228
  declare function useNoyaEmailLists(): {
209
229
  emailLists: {
210
230
  id: string;
211
- description: string | null;
212
231
  name: string;
213
232
  url: string;
233
+ description: string | null;
214
234
  optIn: boolean;
215
235
  }[];
216
236
  loading: boolean;
@@ -224,9 +244,9 @@ declare function useNoyaUserData(): {
224
244
  }[];
225
245
  emailLists: {
226
246
  id: string;
227
- description: string | null;
228
247
  name: string;
229
248
  url: string;
249
+ description: string | null;
230
250
  optIn: boolean;
231
251
  }[];
232
252
  experiments: {};
@@ -243,9 +263,9 @@ declare function useOptionalNoyaUserData(): {
243
263
  }[];
244
264
  emailLists: {
245
265
  id: string;
246
- description: string | null;
247
266
  name: string;
248
267
  url: string;
268
+ description: string | null;
249
269
  optIn: boolean;
250
270
  }[];
251
271
  experiments: {};
@@ -271,14 +291,14 @@ declare function useGeneratedComponentDescription(name: string): {
271
291
  };
272
292
  declare function useRandomImages(): {
273
293
  images: Record<string, {
294
+ metadata: {
295
+ color: string;
296
+ };
274
297
  url: string;
275
298
  source: {
276
299
  name: string;
277
300
  url: string;
278
301
  };
279
- metadata: {
280
- color: string;
281
- };
282
302
  user: {
283
303
  name: string;
284
304
  url: string;
@@ -313,15 +333,24 @@ declare function useGeneratedPageNames(): EnhancedGeneratedPageName[];
313
333
  declare function useGeneratedPageComponentNames(): EnhancedGeneratedPageName[];
314
334
  declare function useNoyaSites(): {
315
335
  sites: {
336
+ publishedDeploymentId?: string | null | undefined;
337
+ publishedDeployment?: {
338
+ id: string;
339
+ createdAt: string;
340
+ fileVersionId: string | null;
341
+ siteId: string;
342
+ updatedAt: string;
343
+ } | undefined;
316
344
  id: string;
345
+ subdomain: string | null;
317
346
  createdAt: string;
318
347
  updatedAt: string;
319
- subdomain: string | null;
320
348
  deployments: {
321
349
  id: string;
322
350
  createdAt: string;
323
- updatedAt: string;
351
+ fileVersionId: string | null;
324
352
  siteId: string;
353
+ updatedAt: string;
325
354
  }[];
326
355
  }[];
327
356
  loading: boolean;
@@ -330,22 +359,32 @@ declare function useNoyaDeployments(): {
330
359
  deployments: {
331
360
  id: string;
332
361
  createdAt: string;
333
- updatedAt: string;
362
+ fileVersionId: string | null;
334
363
  siteId: string;
364
+ updatedAt: string;
335
365
  }[];
336
366
  loading: boolean;
337
367
  };
338
368
  declare function useNoyaSite(siteId: string): {
339
369
  site: {
370
+ publishedDeploymentId?: string | null | undefined;
371
+ publishedDeployment?: {
372
+ id: string;
373
+ createdAt: string;
374
+ fileVersionId: string | null;
375
+ siteId: string;
376
+ updatedAt: string;
377
+ } | undefined;
340
378
  id: string;
379
+ subdomain: string | null;
341
380
  createdAt: string;
342
381
  updatedAt: string;
343
- subdomain: string | null;
344
382
  deployments: {
345
383
  id: string;
346
384
  createdAt: string;
347
- updatedAt: string;
385
+ fileVersionId: string | null;
348
386
  siteId: string;
387
+ updatedAt: string;
349
388
  }[];
350
389
  };
351
390
  };
@@ -368,17 +407,17 @@ declare function useNoyaWorkspaces(): {
368
407
  updatedAt: string;
369
408
  members: {
370
409
  id: string;
371
- role: "OWNER" | "ADMIN" | "MEMBER";
372
410
  createdAt: string;
411
+ workspaceId: string;
412
+ userId: string;
413
+ updatedAt: string;
414
+ role: "OWNER" | "ADMIN" | "MEMBER";
373
415
  user: {
374
416
  id: string;
375
417
  name: string | null;
376
- image: string | null;
377
418
  email: string | null;
419
+ image: string | null;
378
420
  };
379
- updatedAt: string;
380
- workspaceId: string;
381
- userId: string;
382
421
  }[];
383
422
  }[];
384
423
  loading: boolean;
@@ -389,12 +428,12 @@ declare function useNoyaMultiplayerRoomToken(fileId: string): {
389
428
  declare function useNoyaWorkspaceInvitations(workspaceId: string): {
390
429
  invitations: {
391
430
  id: string;
392
- role: "OWNER" | "ADMIN" | "MEMBER";
393
- createdAt: string;
394
431
  email: string;
395
- token: string;
396
- updatedAt: string;
432
+ createdAt: string;
397
433
  workspaceId: string;
434
+ updatedAt: string;
435
+ role: "OWNER" | "ADMIN" | "MEMBER";
436
+ token: string;
398
437
  invitedById: string;
399
438
  acceptedAt: string | null;
400
439
  expiresAt: string | null;
@@ -409,35 +448,35 @@ declare function useNoyaOwnedFileVersions(fileId: string): {
409
448
  declare function useNoyaTemplates(): {
410
449
  templates: {
411
450
  id: string;
412
- description: string | null;
413
- status: "pending" | "approved" | "rejected";
414
451
  name: string;
415
- createdAt: string;
416
- fileId: string | null;
417
- updatedAt: string;
418
- workspaceId: string;
419
- fileVersionId: string;
420
- createdByUserId: string;
421
452
  fileVersion: {
422
453
  data?: any;
423
454
  id: string;
424
- description: string | null;
425
- icon: string | null;
426
455
  name: string;
427
- version: number;
428
456
  createdAt: string;
429
457
  fileId: string | null;
458
+ userId: string;
430
459
  toolId: string;
460
+ description: string | null;
431
461
  updatedAt: string;
462
+ icon: string | null;
463
+ version: number;
432
464
  access: "private" | "read" | "write";
433
- userId: string;
434
465
  dataCid: string;
435
466
  ownedByFileId: string | null;
436
467
  };
468
+ createdAt: string;
469
+ workspaceId: string;
437
470
  workspace: {
438
471
  id: string;
439
472
  name: string;
440
473
  };
474
+ fileId: string | null;
475
+ fileVersionId: string;
476
+ description: string | null;
477
+ updatedAt: string;
478
+ status: "pending" | "approved" | "rejected";
479
+ createdByUserId: string;
441
480
  createdByUser: {
442
481
  id: string;
443
482
  name: string | null;
@@ -447,19 +486,43 @@ declare function useNoyaTemplates(): {
447
486
  loading: boolean;
448
487
  };
449
488
 
450
- type FileListTableOptions = {
451
- policy?: NoyaAPI.FetchPolicy;
452
- debug?: boolean;
489
+ type GetRowType<TTable extends Table<EntitySchema>> = Static<TTable["schema"]>;
490
+ type GetSelectConfig<TTable extends Table<EntitySchema>> = SelectConfig<GetRowType<TTable>[]>;
491
+ type UseTableOptions = Omit<TableFetchOptions, "autoStart">;
492
+ declare function useTable<TTable extends Table<any>, Config extends GetSelectConfig<TTable>>(table: TTable | null | undefined, { where, select, }: {
493
+ where?: Partial<Record<string, any>> & {
494
+ id?: string | null;
495
+ };
496
+ select: Config;
497
+ }, options?: UseTableOptions): {
498
+ status: NoyaAPI.FetchStatus;
499
+ data: SelectedShape<GetRowType<TTable>, Config>[];
500
+ refetch: () => void;
453
501
  };
454
- declare function useFileList<Config extends SelectConfig<NoyaAPI.FileListItem>>(select: Config, options?: FileListTableOptions): {
502
+ declare function useFileList<Config extends SelectConfig<NoyaAPI.FileListItem>>(select: Config, options?: UseTableOptions): {
455
503
  status: NoyaAPI.FetchStatus;
456
504
  data: SelectedShape<NoyaAPI.FileListItem, Config>[];
457
- refetch: () => void;
505
+ refetch: RefetchFunction;
458
506
  };
459
- declare function useFileListItem<Config extends SelectConfig<NoyaAPI.FileListItem>>(id: string | undefined, select: Config, options?: FileListTableOptions): {
507
+ declare function useFileListItem<Config extends SelectConfig<NoyaAPI.FileListItem>>(id: string | undefined, select: Config, options?: UseTableOptions): {
460
508
  status: NoyaAPI.FetchStatus;
461
509
  data: SelectedShape<NoyaAPI.FileListItem, Config> | undefined;
462
- refetch: () => void;
510
+ refetch: RefetchFunction;
511
+ };
512
+ declare function useResourcesList<Config extends SelectConfig<Resource>>(fileId: string, select: Config, options?: UseTableOptions): {
513
+ status: NoyaAPI.FetchStatus;
514
+ data: SelectedShape<Resource, Config>[];
515
+ refetch: RefetchFunction;
516
+ };
517
+ declare function useUser<Config extends SelectConfig<NoyaAPI.PublicUser>>(id: string | null | undefined, select: Config, options?: UseTableOptions): {
518
+ status: NoyaAPI.FetchStatus;
519
+ data: SelectedShape<NoyaAPI.PublicUser, Config> | undefined;
520
+ refetch: RefetchFunction;
521
+ };
522
+ declare function useActivityEventsList<Config extends SelectConfig<ActivityEvent>>(fileId: string, select: Config, options?: UseTableOptions): {
523
+ status: NoyaAPI.FetchStatus;
524
+ data: SelectedShape<ActivityEvent, Config>[];
525
+ refetch: RefetchFunction;
463
526
  };
464
527
 
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 };
528
+ export { type EnhancedGeneratedPageName, NoyaAPIProvider, useActivityEventsList, useFileList, useFileListItem, useGeneratedComponentDescription, useGeneratedComponentDescriptions, useGeneratedComponentNames, useGeneratedPageComponentNames, useGeneratedPageNames, useIsBeta, useMetadata, useNetworkRequests, useNoyaAssets, useNoyaAssetsByFileVersionId, 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, useResourcesList, useTable, useUser };