@3dverse/api 0.6.2 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -17,10 +17,10 @@ npm i @3dverse/api
17
17
  import * as api3dverse from '@3dverse/api';
18
18
  ```
19
19
 
20
- or
20
+ or
21
21
 
22
22
  ```
23
- import { createUser } from '3dverse/api';
23
+ import { registerUser } from '@3dverse/api';
24
24
  ```
25
25
 
26
26
  ### Authentication
@@ -28,13 +28,13 @@ import { createUser } from '3dverse/api';
28
28
  Only use the API key on the server.
29
29
 
30
30
  ```
31
- import { setApiKey, createUser } from '3dverse/api';
31
+ import { setApiKey, registerUser } from '@3dverse/api';
32
32
 
33
33
 
34
34
  setApiKey(MY_3DVERSE_API_KEY);
35
35
 
36
36
  async () => {
37
- const { user_id } = await createUser({ username: 'my_username' });
37
+ const { user_id } = await registerUser({ username: 'my_username' });
38
38
  }
39
39
  ```
40
40
 
@@ -52,4 +52,3 @@ async () => {
52
52
  });
53
53
  }
54
54
  ```
55
-
@@ -1,10 +1,20 @@
1
1
  /**
2
- * 3dverse v1.0
3
- * # 3dverse API
2
+ * 3dverse Asset API v1.0
3
+ * # Getting Started
4
4
  *
5
- * Welcome to the 3dverse API. The 3dverse API scopes to an API key. Each development environment of an application requires a separate API key.
6
- * Through the API key, you can manage ownership, access, and permissions for each environment.
7
- * Each environment has its own set of users, groups, folders, and assets.
5
+ * Welcome to the 3dverse Asset API. This is the reference for the REST API endpoints.
6
+ *
7
+ * ## NPM package
8
+ *
9
+ * We provide a TypeScript wrapper library to make typesafe API requests and get typed responses: [https://www.npmjs.com/package/@3dverse/api](https://www.npmjs.com/package/@3dverse/api).
10
+ *
11
+ * ## Authentication
12
+ *
13
+ * To authenticate your API calls, you'll need to generate an API key via the [3dverse Console](https://console.3dverse.com) and send an `api_key` header with your API requests.
14
+ * Alternatively, you can create a user, generate a token for the user and authenticate with a `user_token`.
15
+ *
16
+ *
17
+ * ---
8
18
  *
9
19
  *
10
20
  * Contact: 3dverse Support (support@3dverse.com)
@@ -315,17 +325,20 @@ export declare function uploadSourceFiles({ folder_id, body }: {
315
325
  folder_id: string;
316
326
  body: FormData;
317
327
  }): AxiosPromise<UploadSourceFiles_Object>;
328
+ export type GetSourceFilesInFolder_Filters = {
329
+ source_file_name?: string;
330
+ };
318
331
  export type GetSourceFilesInFolder_SourceFile = {
319
332
  source_file_id: string;
320
- upload_task_id: string;
321
333
  source_file_original_name: string;
322
334
  name: string;
323
335
  size: number;
324
336
  };
325
- export declare function getSourceFilesInFolder({ folder_id, offset, limit }: {
337
+ export declare function getSourceFilesInFolder({ folder_id, offset, limit, filters }: {
326
338
  folder_id: string;
327
339
  offset?: number;
328
340
  limit?: number;
341
+ filters?: GetSourceFilesInFolder_Filters;
329
342
  }): AxiosPromise<Array<GetSourceFilesInFolder_SourceFile>>;
330
343
  export declare function moveSourceFiles({ folder_id, source_file_ids }: {
331
344
  folder_id: string;
@@ -361,6 +374,7 @@ export declare function getUploadTasksInFolder({ folder_id, offset, limit }: {
361
374
  export type GetFolderAssets_Filter = {
362
375
  asset_type?: (Array<"action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material"> | "action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material");
363
376
  asset_name?: string;
377
+ include_public_assets?: boolean;
364
378
  };
365
379
  export type GetFolderAssets__index_AssetList_AssetList = {
366
380
  action_maps?: Array<GetFolderAssets_Object>;
@@ -448,16 +462,19 @@ export type GetSessionsInFolder_UserInfo = {
448
462
  export declare function getSessionsInFolder({ folder_id }: {
449
463
  folder_id: string;
450
464
  }): AxiosPromise<Array<GetSessionsInFolder_Session>>;
465
+ export type ListSourceFiles_Filters = {
466
+ source_file_name?: string;
467
+ };
451
468
  export type ListSourceFiles_SourceFile = {
452
469
  source_file_id: string;
453
- upload_task_id: string;
454
470
  source_file_original_name: string;
455
471
  name: string;
456
472
  size: number;
457
473
  };
458
- export declare function listSourceFiles({ offset, limit }: {
474
+ export declare function listSourceFiles({ offset, limit, filters }: {
459
475
  offset?: number;
460
476
  limit?: number;
477
+ filters?: ListSourceFiles_Filters;
461
478
  }): AxiosPromise<Array<ListSourceFiles_SourceFile>>;
462
479
  export declare function deleteSourceFiles({ source_file_ids }: {
463
480
  source_file_ids: Array<string>;
@@ -467,7 +484,6 @@ export declare function downloadSourceFile({ source_file_id }: {
467
484
  }): AxiosPromise<ArrayBuffer>;
468
485
  export type GetSourceFileDetails_SourceFile = {
469
486
  source_file_id: string;
470
- upload_task_id: string;
471
487
  source_file_original_name: string;
472
488
  name: string;
473
489
  size: number;
@@ -543,6 +559,7 @@ export declare function getUploadTask({ upload_task_id }: {
543
559
  export type ListAssets_Filter = {
544
560
  asset_type?: (Array<"action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material"> | "action_map" | "algorithm" | "animation" | "animation_graph" | "animation_sequence" | "animation_set" | "collision_geometry" | "cubemap" | "event_map" | "material" | "mesh" | "module" | "point_cloud" | "render_graph" | "scene" | "script" | "shader" | "skeleton" | "sound" | "texture" | "texture_1d" | "texture_3d" | "volume_material");
545
561
  asset_name?: string;
562
+ include_public_assets?: boolean;
546
563
  };
547
564
  export type ListAssets__index_AssetList_AssetList = {
548
565
  action_maps?: Array<ListAssets_Object>;
@@ -587,7 +604,6 @@ export declare function deleteAsset({ asset_container, asset_id }: {
587
604
  }): Promise<import("axios").AxiosResponse<any, any>>;
588
605
  export type GetAssetSourceFile_SourceFile = {
589
606
  source_file_id: string;
590
- upload_task_id: string;
591
607
  source_file_original_name: string;
592
608
  name: string;
593
609
  size: number;
package/dist/index.js CHANGED
@@ -403,15 +403,20 @@ function listFolderSubFolders({
403
403
  function getSourceFilesInFolder({
404
404
  folder_id,
405
405
  offset = 0,
406
- limit = 10
406
+ limit = 10,
407
+ filters
407
408
  }) {
408
409
  return axiosInstance({
409
410
  method: "get",
410
411
  url: "/folders/" + folder_id + "/source-files",
411
412
  params: {
412
413
  offset,
413
- limit
414
+ limit,
415
+ filters
414
416
  }
417
+ }).then((response) => {
418
+ response.headers["x-source-files-count"] = JSON.parse(response.headers["x-source-files-count"]);
419
+ return response;
415
420
  });
416
421
  }
417
422
  function moveSourceFiles({
@@ -484,15 +489,20 @@ function getSessionsInFolder({
484
489
  }
485
490
  function listSourceFiles({
486
491
  offset = 0,
487
- limit = 10
492
+ limit = 10,
493
+ filters
488
494
  }) {
489
495
  return axiosInstance({
490
496
  method: "get",
491
497
  url: "/source-files",
492
498
  params: {
493
499
  offset,
494
- limit
500
+ limit,
501
+ filters
495
502
  }
503
+ }).then((response) => {
504
+ response.headers["x-source-files-count"] = JSON.parse(response.headers["x-source-files-count"]);
505
+ return response;
496
506
  });
497
507
  }
498
508
  function deleteSourceFiles({