@worldlabsai/client 0.1.0

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.
Files changed (54) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +109 -0
  3. package/dist/client.d.ts +34 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +31 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/core/assets.d.ts +138 -0
  8. package/dist/core/assets.d.ts.map +1 -0
  9. package/dist/core/assets.js +104 -0
  10. package/dist/core/assets.js.map +1 -0
  11. package/dist/core/index.d.ts +5 -0
  12. package/dist/core/index.d.ts.map +1 -0
  13. package/dist/core/index.js +5 -0
  14. package/dist/core/index.js.map +1 -0
  15. package/dist/core/operations.d.ts +52 -0
  16. package/dist/core/operations.d.ts.map +1 -0
  17. package/dist/core/operations.js +81 -0
  18. package/dist/core/operations.js.map +1 -0
  19. package/dist/core/sleep.d.ts +7 -0
  20. package/dist/core/sleep.d.ts.map +1 -0
  21. package/dist/core/sleep.js +23 -0
  22. package/dist/core/sleep.js.map +1 -0
  23. package/dist/core/tasks.d.ts +27 -0
  24. package/dist/core/tasks.d.ts.map +1 -0
  25. package/dist/core/tasks.js +26 -0
  26. package/dist/core/tasks.js.map +1 -0
  27. package/dist/core/transport.d.ts +84 -0
  28. package/dist/core/transport.d.ts.map +1 -0
  29. package/dist/core/transport.js +171 -0
  30. package/dist/core/transport.js.map +1 -0
  31. package/dist/generated/developer-api.gen.d.ts +2760 -0
  32. package/dist/generated/developer-api.gen.d.ts.map +1 -0
  33. package/dist/generated/developer-api.gen.js +6 -0
  34. package/dist/generated/developer-api.gen.js.map +1 -0
  35. package/dist/generated/tasks.gen.d.ts +153 -0
  36. package/dist/generated/tasks.gen.d.ts.map +1 -0
  37. package/dist/generated/tasks.gen.js +80 -0
  38. package/dist/generated/tasks.gen.js.map +1 -0
  39. package/dist/index.d.ts +4 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +3 -0
  42. package/dist/index.js.map +1 -0
  43. package/examples/posing.ts +62 -0
  44. package/package.json +49 -0
  45. package/src/client.ts +55 -0
  46. package/src/core/assets.ts +162 -0
  47. package/src/core/index.ts +27 -0
  48. package/src/core/operations.ts +114 -0
  49. package/src/core/sleep.ts +22 -0
  50. package/src/core/tasks.ts +45 -0
  51. package/src/core/transport.ts +246 -0
  52. package/src/generated/developer-api.gen.ts +2760 -0
  53. package/src/generated/tasks.gen.ts +110 -0
  54. package/src/index.ts +24 -0
@@ -0,0 +1,110 @@
1
+ // Generated by tooling/openapi-codegen/generate-tasks.ts from marble_developer_api_v2.yaml. Do not edit.
2
+ import type { SubmitOptions, Transport } from "../core/index.ts";
3
+ import { submitTask } from "../core/index.ts";
4
+
5
+ import type {
6
+ AtlasChiselRequest,
7
+ AtlasChiselResponseOperation,
8
+ AtlasGenerateRequest,
9
+ AtlasGenerateResponseOperation,
10
+ AtlasMaskedRequest,
11
+ AtlasMaskedResponseOperation,
12
+ AtlasTextToImageRequest,
13
+ AtlasTextToImageResponseOperation,
14
+ Images2PosedRGBDRequest,
15
+ Images2PosedRGBDResponseOperation,
16
+ Splats2MeshRequest,
17
+ Splats2MeshResponseOperation,
18
+ } from "./developer-api.gen.ts";
19
+
20
+ /** GET route for operations on this surface. */
21
+ export const operationPath = "/api/v2/operations/{operation}";
22
+
23
+ /** Asset collection route on this surface; item routes hang off it. */
24
+ export const assetsPath = "/api/v2/assets";
25
+
26
+ export const createTasks = (transport: Transport) => ({
27
+ /**
28
+ * Submits the atlasChisel task.
29
+ * Retries network failures and HTTP 429/502/503/504 up to three times with the same key and body.
30
+ *
31
+ * @param body - Task inputs and settings.
32
+ * @param options - Abort signal, idempotency key, and server-wait preference.
33
+ * @returns An operation to pass to `client.operations.wait` for the typed result.
34
+ * Check the completed operation's `error` before reading its `response`.
35
+ * @throws {ApiError} If the API rejects the submission or retries are exhausted.
36
+ * @beta Requires beta access for your account.
37
+ */
38
+ atlasChisel: async (body: AtlasChiselRequest, options?: SubmitOptions) =>
39
+ await submitTask<AtlasChiselResponseOperation>(transport, "/api/v2/tasks:atlasChisel", body, options),
40
+
41
+ /**
42
+ * Submits the atlasGenerate task.
43
+ * Retries network failures and HTTP 429/502/503/504 up to three times with the same key and body.
44
+ *
45
+ * @param body - Task inputs and settings.
46
+ * @param options - Abort signal, idempotency key, and server-wait preference.
47
+ * @returns An operation to pass to `client.operations.wait` for the typed result.
48
+ * Check the completed operation's `error` before reading its `response`.
49
+ * @throws {ApiError} If the API rejects the submission or retries are exhausted.
50
+ * @beta Requires beta access for your account.
51
+ */
52
+ atlasGenerate: async (body: AtlasGenerateRequest, options?: SubmitOptions) =>
53
+ await submitTask<AtlasGenerateResponseOperation>(transport, "/api/v2/tasks:atlasGenerate", body, options),
54
+
55
+ /**
56
+ * Submits the atlasMasked task.
57
+ * Retries network failures and HTTP 429/502/503/504 up to three times with the same key and body.
58
+ *
59
+ * @param body - Task inputs and settings.
60
+ * @param options - Abort signal, idempotency key, and server-wait preference.
61
+ * @returns An operation to pass to `client.operations.wait` for the typed result.
62
+ * Check the completed operation's `error` before reading its `response`.
63
+ * @throws {ApiError} If the API rejects the submission or retries are exhausted.
64
+ * @beta Requires beta access for your account.
65
+ */
66
+ atlasMasked: async (body: AtlasMaskedRequest, options?: SubmitOptions) =>
67
+ await submitTask<AtlasMaskedResponseOperation>(transport, "/api/v2/tasks:atlasMasked", body, options),
68
+
69
+ /**
70
+ * Submits the atlasTextToImage task.
71
+ * Retries network failures and HTTP 429/502/503/504 up to three times with the same key and body.
72
+ *
73
+ * @param body - Task inputs and settings.
74
+ * @param options - Abort signal, idempotency key, and server-wait preference.
75
+ * @returns An operation to pass to `client.operations.wait` for the typed result.
76
+ * Check the completed operation's `error` before reading its `response`.
77
+ * @throws {ApiError} If the API rejects the submission or retries are exhausted.
78
+ * @beta Requires beta access for your account.
79
+ */
80
+ atlasTextToImage: async (body: AtlasTextToImageRequest, options?: SubmitOptions) =>
81
+ await submitTask<AtlasTextToImageResponseOperation>(transport, "/api/v2/tasks:atlasTextToImage", body, options),
82
+
83
+ /**
84
+ * Submits the images2PosedRGBD task.
85
+ * Retries network failures and HTTP 429/502/503/504 up to three times with the same key and body.
86
+ *
87
+ * @param body - Task inputs and settings.
88
+ * @param options - Abort signal, idempotency key, and server-wait preference.
89
+ * @returns An operation to pass to `client.operations.wait` for the typed result.
90
+ * Check the completed operation's `error` before reading its `response`.
91
+ * @throws {ApiError} If the API rejects the submission or retries are exhausted.
92
+ * @beta Requires beta access for your account.
93
+ */
94
+ images2PosedRGBD: async (body: Images2PosedRGBDRequest, options?: SubmitOptions) =>
95
+ await submitTask<Images2PosedRGBDResponseOperation>(transport, "/api/v2/tasks:images2PosedRGBD", body, options),
96
+
97
+ /**
98
+ * Submits the splats2Mesh task.
99
+ * Retries network failures and HTTP 429/502/503/504 up to three times with the same key and body.
100
+ *
101
+ * @param body - Task inputs and settings.
102
+ * @param options - Abort signal, idempotency key, and server-wait preference.
103
+ * @returns An operation to pass to `client.operations.wait` for the typed result.
104
+ * Check the completed operation's `error` before reading its `response`.
105
+ * @throws {ApiError} If the API rejects the submission or retries are exhausted.
106
+ * @beta Requires beta access for your account.
107
+ */
108
+ splats2Mesh: async (body: Splats2MeshRequest, options?: SubmitOptions) =>
109
+ await submitTask<Splats2MeshResponseOperation>(transport, "/api/v2/tasks:splats2Mesh", body, options),
110
+ });
package/src/index.ts ADDED
@@ -0,0 +1,24 @@
1
+ export {
2
+ type ClientOptions,
3
+ createClient,
4
+ DEFAULT_BASE_URL,
5
+ type WorldLabsClient,
6
+ } from "./client.ts";
7
+ export {
8
+ ApiError,
9
+ type ApiKey,
10
+ apiKeyAuth,
11
+ assetId,
12
+ assetRef,
13
+ type DoneOperation,
14
+ type Fetch,
15
+ type Middleware,
16
+ type Operation,
17
+ type ListAssetsOptions,
18
+ type SubmitOptions,
19
+ type UploadOptions,
20
+ waitForOperation,
21
+ type WaitOptions,
22
+ withHeader,
23
+ } from "./core/index.ts";
24
+ export type * from "./generated/developer-api.gen.ts";