@distilled.cloud/daytona 0.0.0-placeholder → 1.0.0-rc.13
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/LICENSE +201 -0
- package/README.md +34 -0
- package/lib/credentials.d.ts +46 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +67 -0
- package/lib/credentials.js.map +1 -0
- package/lib/endpoints.d.ts +15 -0
- package/lib/endpoints.d.ts.map +1 -0
- package/lib/endpoints.js +28 -0
- package/lib/endpoints.js.map +1 -0
- package/lib/errors.d.ts +53 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +30 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/pagination.d.ts +10 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +10 -0
- package/lib/pagination.js.map +1 -0
- package/lib/protocol.d.ts +18 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +75 -0
- package/lib/protocol.js.map +1 -0
- package/lib/response-validation.test.d.ts +4 -0
- package/lib/response-validation.test.d.ts.map +1 -0
- package/lib/response-validation.test.js +31 -0
- package/lib/response-validation.test.js.map +1 -0
- package/lib/retry.d.ts +50 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +43 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/api_keys.d.ts +120 -0
- package/lib/services/api_keys.d.ts.map +1 -0
- package/lib/services/api_keys.js +126 -0
- package/lib/services/api_keys.js.map +1 -0
- package/lib/services/audit.d.ts +159 -0
- package/lib/services/audit.d.ts.map +1 -0
- package/lib/services/audit.js +126 -0
- package/lib/services/audit.js.map +1 -0
- package/lib/services/computer_use.d.ts +484 -0
- package/lib/services/computer_use.d.ts.map +1 -0
- package/lib/services/computer_use.js +672 -0
- package/lib/services/computer_use.js.map +1 -0
- package/lib/services/config.d.ts +138 -0
- package/lib/services/config.d.ts.map +1 -0
- package/lib/services/config.js +88 -0
- package/lib/services/config.js.map +1 -0
- package/lib/services/docker_registry.d.ts +126 -0
- package/lib/services/docker_registry.d.ts.map +1 -0
- package/lib/services/docker_registry.js +135 -0
- package/lib/services/docker_registry.js.map +1 -0
- package/lib/services/file_system.d.ts +203 -0
- package/lib/services/file_system.d.ts.map +1 -0
- package/lib/services/file_system.js +255 -0
- package/lib/services/file_system.js.map +1 -0
- package/lib/services/git.d.ts +338 -0
- package/lib/services/git.d.ts.map +1 -0
- package/lib/services/git.js +417 -0
- package/lib/services/git.js.map +1 -0
- package/lib/services/health.d.ts +41 -0
- package/lib/services/health.d.ts.map +1 -0
- package/lib/services/health.js +49 -0
- package/lib/services/health.js.map +1 -0
- package/lib/services/index.d.ts +31 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +32 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/info.d.ts +37 -0
- package/lib/services/info.d.ts.map +1 -0
- package/lib/services/info.js +55 -0
- package/lib/services/info.js.map +1 -0
- package/lib/services/interpreter.d.ts +56 -0
- package/lib/services/interpreter.d.ts.map +1 -0
- package/lib/services/interpreter.js +83 -0
- package/lib/services/interpreter.js.map +1 -0
- package/lib/services/jobs.d.ts +104 -0
- package/lib/services/jobs.d.ts.map +1 -0
- package/lib/services/jobs.js +94 -0
- package/lib/services/jobs.js.map +1 -0
- package/lib/services/lsp.d.ts +137 -0
- package/lib/services/lsp.d.ts.map +1 -0
- package/lib/services/lsp.js +160 -0
- package/lib/services/lsp.js.map +1 -0
- package/lib/services/object_storage.d.ts +31 -0
- package/lib/services/object_storage.d.ts.map +1 -0
- package/lib/services/object_storage.js +33 -0
- package/lib/services/object_storage.js.map +1 -0
- package/lib/services/organizations.d.ts +963 -0
- package/lib/services/organizations.d.ts.map +1 -0
- package/lib/services/organizations.js +1143 -0
- package/lib/services/organizations.js.map +1 -0
- package/lib/services/port.d.ts +29 -0
- package/lib/services/port.d.ts.map +1 -0
- package/lib/services/port.js +41 -0
- package/lib/services/port.js.map +1 -0
- package/lib/services/preview.d.ts +73 -0
- package/lib/services/preview.d.ts.map +1 -0
- package/lib/services/preview.js +125 -0
- package/lib/services/preview.js.map +1 -0
- package/lib/services/process.d.ts +329 -0
- package/lib/services/process.d.ts.map +1 -0
- package/lib/services/process.js +421 -0
- package/lib/services/process.js.map +1 -0
- package/lib/services/regions.d.ts +41 -0
- package/lib/services/regions.d.ts.map +1 -0
- package/lib/services/regions.js +36 -0
- package/lib/services/regions.js.map +1 -0
- package/lib/services/runners.d.ts +358 -0
- package/lib/services/runners.d.ts.map +1 -0
- package/lib/services/runners.js +316 -0
- package/lib/services/runners.js.map +1 -0
- package/lib/services/sandbox.d.ts +1276 -0
- package/lib/services/sandbox.d.ts.map +1 -0
- package/lib/services/sandbox.js +1218 -0
- package/lib/services/sandbox.js.map +1 -0
- package/lib/services/secret.d.ts +120 -0
- package/lib/services/secret.d.ts.map +1 -0
- package/lib/services/secret.js +113 -0
- package/lib/services/secret.js.map +1 -0
- package/lib/services/server.d.ts +44 -0
- package/lib/services/server.d.ts.map +1 -0
- package/lib/services/server.js +46 -0
- package/lib/services/server.js.map +1 -0
- package/lib/services/snapshots.d.ts +208 -0
- package/lib/services/snapshots.d.ts.map +1 -0
- package/lib/services/snapshots.js +189 -0
- package/lib/services/snapshots.js.map +1 -0
- package/lib/services/system.d.ts +24 -0
- package/lib/services/system.d.ts.map +1 -0
- package/lib/services/system.js +31 -0
- package/lib/services/system.js.map +1 -0
- package/lib/services/telemetry.d.ts +141 -0
- package/lib/services/telemetry.d.ts.map +1 -0
- package/lib/services/telemetry.js +165 -0
- package/lib/services/telemetry.js.map +1 -0
- package/lib/services/usage.d.ts +111 -0
- package/lib/services/usage.d.ts.map +1 -0
- package/lib/services/usage.js +146 -0
- package/lib/services/usage.js.map +1 -0
- package/lib/services/users.d.ts +125 -0
- package/lib/services/users.d.ts.map +1 -0
- package/lib/services/users.js +172 -0
- package/lib/services/users.js.map +1 -0
- package/lib/services/volumes.d.ts +83 -0
- package/lib/services/volumes.d.ts.map +1 -0
- package/lib/services/volumes.js +96 -0
- package/lib/services/volumes.js.map +1 -0
- package/lib/services/warm_pools.d.ts +79 -0
- package/lib/services/warm_pools.d.ts.map +1 -0
- package/lib/services/warm_pools.js +90 -0
- package/lib/services/warm_pools.js.map +1 -0
- package/lib/services/webhooks.d.ts +67 -0
- package/lib/services/webhooks.d.ts.map +1 -0
- package/lib/services/webhooks.js +103 -0
- package/lib/services/webhooks.js.map +1 -0
- package/lib/traits.d.ts +10 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +11 -0
- package/lib/traits.js.map +1 -0
- package/package.json +78 -7
- package/src/credentials.ts +135 -0
- package/src/endpoints.ts +28 -0
- package/src/errors.ts +85 -0
- package/src/index.ts +33 -0
- package/src/pagination.ts +9 -0
- package/src/protocol.ts +108 -0
- package/src/response-validation.test.ts +45 -0
- package/src/retry.ts +74 -0
- package/src/services/api_keys.ts +378 -0
- package/src/services/audit.ts +416 -0
- package/src/services/computer_use.ts +1496 -0
- package/src/services/config.ts +256 -0
- package/src/services/docker_registry.ts +325 -0
- package/src/services/file_system.ts +575 -0
- package/src/services/git.ts +928 -0
- package/src/services/health.ts +116 -0
- package/src/services/index.ts +31 -0
- package/src/services/info.ts +116 -0
- package/src/services/interpreter.ts +182 -0
- package/src/services/jobs.ts +249 -0
- package/src/services/lsp.ts +367 -0
- package/src/services/object_storage.ts +75 -0
- package/src/services/organizations.ts +2712 -0
- package/src/services/port.ts +87 -0
- package/src/services/preview.ts +256 -0
- package/src/services/process.ts +948 -0
- package/src/services/regions.ts +90 -0
- package/src/services/runners.ts +811 -0
- package/src/services/sandbox.ts +3158 -0
- package/src/services/secret.ts +289 -0
- package/src/services/server.ts +111 -0
- package/src/services/snapshots.ts +508 -0
- package/src/services/system.ts +64 -0
- package/src/services/telemetry.ts +385 -0
- package/src/services/usage.ts +316 -0
- package/src/services/users.ts +380 -0
- package/src/services/volumes.ts +233 -0
- package/src/services/warm_pools.ts +209 -0
- package/src/services/webhooks.ts +214 -0
- package/src/traits.ts +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @distilled.cloud/daytona
|
|
2
|
+
|
|
3
|
+
Effect-native SDK for [daytona](https://www.npmjs.com/package/@distilled.cloud/daytona).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @distilled.cloud/daytona effect
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { Effect, Layer } from "effect";
|
|
15
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
16
|
+
import * as Daytona from "@distilled.cloud/daytona";
|
|
17
|
+
|
|
18
|
+
const program = Effect.gen(function* () {
|
|
19
|
+
const result = yield* Daytona.sandbox.createSandbox({});
|
|
20
|
+
return result;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const Live = Layer.mergeAll(
|
|
24
|
+
FetchHttpClient.layer,
|
|
25
|
+
Daytona.CredentialsFromEnv,
|
|
26
|
+
Daytona.DaytonaProtocol,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
program.pipe(Effect.provide(Live), Effect.runPromise);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Auth
|
|
33
|
+
|
|
34
|
+
Required: `DAYTONA_API_KEY`, `DAYTONA_ORGANIZATION_ID`, `DAYTONA_SANDBOX_ID`. Optional: `DAYTONA_ANALYTICS_URL`, `DAYTONA_API_URL`, `DAYTONA_TOOLBOX_URL`. Sent as `Authorization: Bearer`.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Redacted from "effect/Redacted";
|
|
5
|
+
/** Daytona Cloud's platform API root. */
|
|
6
|
+
export declare const DEFAULT_API_BASE_URL = "https://app.daytona.io/api";
|
|
7
|
+
/** Daytona Cloud's analytics API root. */
|
|
8
|
+
export declare const DEFAULT_ANALYTICS_BASE_URL = "https://analytics.app.daytona.io";
|
|
9
|
+
/**
|
|
10
|
+
* Toolbox endpoint template. `{sandboxId}` is replaced with the configured
|
|
11
|
+
* sandbox (the docs' `{toolboxProxyUrl}/{sandboxId}` form). Pass a fully
|
|
12
|
+
* resolved URL — e.g. a sandbox's `toolboxProxyUrl` — to skip substitution.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DEFAULT_TOOLBOX_BASE_URL = "https://proxy.app.daytona.io/toolbox/{sandboxId}";
|
|
15
|
+
export interface Config {
|
|
16
|
+
readonly apiKey: Redacted.Redacted<string>;
|
|
17
|
+
readonly apiBaseUrl: string;
|
|
18
|
+
readonly analyticsBaseUrl: string;
|
|
19
|
+
readonly toolboxBaseUrl: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sandbox scope for the toolbox services. Calling a toolbox operation
|
|
22
|
+
* without a sandbox configured (and with a `{sandboxId}` template still
|
|
23
|
+
* in `toolboxBaseUrl`) fails with `ConfigError`.
|
|
24
|
+
*/
|
|
25
|
+
readonly sandboxId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Sent as `X-Daytona-Organization-ID` when set. Required with JWT auth
|
|
28
|
+
* to pick an organization; API keys already carry one.
|
|
29
|
+
*/
|
|
30
|
+
readonly organizationId?: string;
|
|
31
|
+
}
|
|
32
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "DaytonaCredentials", Effect.Effect<Config, never, never>>;
|
|
33
|
+
export declare class Credentials extends Credentials_base {
|
|
34
|
+
}
|
|
35
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
36
|
+
/** Convenience layer from a plain API key + optional endpoints/scope. */
|
|
37
|
+
export declare const credentials: (config: {
|
|
38
|
+
readonly apiKey: string;
|
|
39
|
+
readonly apiBaseUrl?: string;
|
|
40
|
+
readonly analyticsBaseUrl?: string;
|
|
41
|
+
readonly toolboxBaseUrl?: string;
|
|
42
|
+
readonly sandboxId?: string;
|
|
43
|
+
readonly organizationId?: string;
|
|
44
|
+
}) => Layer.Layer<Credentials>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,yCAAyC;AACzC,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AAEjE,0CAA0C;AAC1C,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,qDACe,CAAC;AAErD,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;;AAED,qBAAa,WAAY,SAAQ,gBAGR;CAAG;AAqB5B,eAAO,MAAM,kBAAkB,wCA6B9B,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAWxB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daytona credentials — hand-written.
|
|
3
|
+
*
|
|
4
|
+
* The `Credentials` service resolves `{ apiKey, apiBaseUrl, analyticsBaseUrl,
|
|
5
|
+
* toolboxBaseUrl, sandboxId?, organizationId? }` per request; the protocol
|
|
6
|
+
* layer formats the `Authorization: Bearer <apiKey>` header from it. The
|
|
7
|
+
* key is a Daytona API key from https://app.daytona.io/dashboard/keys.
|
|
8
|
+
*
|
|
9
|
+
* Daytona speaks from THREE endpoints:
|
|
10
|
+
*
|
|
11
|
+
* • Platform (`https://app.daytona.io/api`) — sandboxes, orgs, snapshots
|
|
12
|
+
* • Analytics (`https://analytics.app.daytona.io`) — telemetry and usage
|
|
13
|
+
* • Toolbox (`https://proxy.app.daytona.io/toolbox/{sandboxId}`) —
|
|
14
|
+
* in-sandbox fs/git/process/computer-use. The sandbox id is part of
|
|
15
|
+
* the CLIENT configuration, not of any operation input: set `sandboxId`
|
|
16
|
+
* (or a fully-resolved `toolboxBaseUrl`) to call those services.
|
|
17
|
+
*
|
|
18
|
+
* The protocol picks the endpoint per request from the operation's route
|
|
19
|
+
* (see protocol.ts). `DAYTONA_API_KEY` / `DAYTONA_API_URL` are what the
|
|
20
|
+
* official SDKs read.
|
|
21
|
+
*/
|
|
22
|
+
import * as EffectConfig from "effect/Config";
|
|
23
|
+
import * as Context from "effect/Context";
|
|
24
|
+
import * as Effect from "effect/Effect";
|
|
25
|
+
import * as Layer from "effect/Layer";
|
|
26
|
+
import * as Redacted from "effect/Redacted";
|
|
27
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
28
|
+
/** Daytona Cloud's platform API root. */
|
|
29
|
+
export const DEFAULT_API_BASE_URL = "https://app.daytona.io/api";
|
|
30
|
+
/** Daytona Cloud's analytics API root. */
|
|
31
|
+
export const DEFAULT_ANALYTICS_BASE_URL = "https://analytics.app.daytona.io";
|
|
32
|
+
/**
|
|
33
|
+
* Toolbox endpoint template. `{sandboxId}` is replaced with the configured
|
|
34
|
+
* sandbox (the docs' `{toolboxProxyUrl}/{sandboxId}` form). Pass a fully
|
|
35
|
+
* resolved URL — e.g. a sandbox's `toolboxProxyUrl` — to skip substitution.
|
|
36
|
+
*/
|
|
37
|
+
export const DEFAULT_TOOLBOX_BASE_URL = "https://proxy.app.daytona.io/toolbox/{sandboxId}";
|
|
38
|
+
export class Credentials extends Context.Service()("DaytonaCredentials") {
|
|
39
|
+
}
|
|
40
|
+
const envConfig = EffectConfig.all({
|
|
41
|
+
apiKey: EffectConfig.String("DAYTONA_API_KEY"),
|
|
42
|
+
apiBaseUrl: EffectConfig.String("DAYTONA_API_URL").pipe(EffectConfig.withDefault(DEFAULT_API_BASE_URL)),
|
|
43
|
+
analyticsBaseUrl: EffectConfig.String("DAYTONA_ANALYTICS_URL").pipe(EffectConfig.withDefault(DEFAULT_ANALYTICS_BASE_URL)),
|
|
44
|
+
toolboxBaseUrl: EffectConfig.String("DAYTONA_TOOLBOX_URL").pipe(EffectConfig.withDefault(DEFAULT_TOOLBOX_BASE_URL)),
|
|
45
|
+
sandboxId: EffectConfig.String("DAYTONA_SANDBOX_ID").pipe(EffectConfig.option),
|
|
46
|
+
organizationId: EffectConfig.String("DAYTONA_ORGANIZATION_ID").pipe(EffectConfig.option),
|
|
47
|
+
});
|
|
48
|
+
export const CredentialsFromEnv = Layer.succeed(Credentials, envConfig.pipe(Effect.mapError(() => new ConfigError({
|
|
49
|
+
message: "DAYTONA_API_KEY environment variable is required",
|
|
50
|
+
})), Effect.map(({ apiKey, apiBaseUrl, analyticsBaseUrl, toolboxBaseUrl, sandboxId, organizationId, }) => ({
|
|
51
|
+
apiKey: Redacted.make(apiKey),
|
|
52
|
+
apiBaseUrl,
|
|
53
|
+
analyticsBaseUrl,
|
|
54
|
+
toolboxBaseUrl,
|
|
55
|
+
sandboxId: sandboxId._tag === "Some" ? sandboxId.value : undefined,
|
|
56
|
+
organizationId: organizationId._tag === "Some" ? organizationId.value : undefined,
|
|
57
|
+
})), Effect.orDie));
|
|
58
|
+
/** Convenience layer from a plain API key + optional endpoints/scope. */
|
|
59
|
+
export const credentials = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
60
|
+
apiKey: Redacted.make(config.apiKey),
|
|
61
|
+
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
62
|
+
analyticsBaseUrl: config.analyticsBaseUrl ?? DEFAULT_ANALYTICS_BASE_URL,
|
|
63
|
+
toolboxBaseUrl: config.toolboxBaseUrl ?? DEFAULT_TOOLBOX_BASE_URL,
|
|
64
|
+
sandboxId: config.sandboxId,
|
|
65
|
+
organizationId: config.organizationId,
|
|
66
|
+
}));
|
|
67
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First path segments of the Toolbox API.
|
|
3
|
+
*
|
|
4
|
+
* Daytona speaks from THREE hosts, and the route picks between them (see
|
|
5
|
+
* protocol.ts). Toolbox paths have no sandbox id in the OpenAPI document —
|
|
6
|
+
* the sandbox is a prefix on the base URL — so the protocol recognises a
|
|
7
|
+
* toolbox call by this set of roots. Convert asserts the live spec still
|
|
8
|
+
* matches (the list is duplicated in `scripts/convert.ts` so convert
|
|
9
|
+
* does not import across the scripts/src tsconfig rootDir boundary); a
|
|
10
|
+
* new root fails convert rather than silently hitting the platform host.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TOOLBOX_ROOTS: readonly ["computeruse", "env", "files", "git", "init", "lsp", "port", "process", "system", "user-home-dir", "version", "work-dir"];
|
|
13
|
+
/** Analytics paths are `/organization/{organizationId}/…` (singular). */
|
|
14
|
+
export declare const ANALYTICS_PREFIX = "/organization/";
|
|
15
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,YACxB,aAAa,EACb,KAAK,EACL,OAAO,EACP,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,eAAe,EACf,SAAS,EACT,UAAU,CACF,CAAC;AAEX,yEAAyE;AACzE,eAAO,MAAM,gBAAgB,mBAAmB,CAAC"}
|
package/lib/endpoints.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First path segments of the Toolbox API.
|
|
3
|
+
*
|
|
4
|
+
* Daytona speaks from THREE hosts, and the route picks between them (see
|
|
5
|
+
* protocol.ts). Toolbox paths have no sandbox id in the OpenAPI document —
|
|
6
|
+
* the sandbox is a prefix on the base URL — so the protocol recognises a
|
|
7
|
+
* toolbox call by this set of roots. Convert asserts the live spec still
|
|
8
|
+
* matches (the list is duplicated in `scripts/convert.ts` so convert
|
|
9
|
+
* does not import across the scripts/src tsconfig rootDir boundary); a
|
|
10
|
+
* new root fails convert rather than silently hitting the platform host.
|
|
11
|
+
*/
|
|
12
|
+
export const TOOLBOX_ROOTS = [
|
|
13
|
+
"computeruse",
|
|
14
|
+
"env",
|
|
15
|
+
"files",
|
|
16
|
+
"git",
|
|
17
|
+
"init",
|
|
18
|
+
"lsp",
|
|
19
|
+
"port",
|
|
20
|
+
"process",
|
|
21
|
+
"system",
|
|
22
|
+
"user-home-dir",
|
|
23
|
+
"version",
|
|
24
|
+
"work-dir",
|
|
25
|
+
];
|
|
26
|
+
/** Analytics paths are `/organization/{organizationId}/…` (singular). */
|
|
27
|
+
export const ANALYTICS_PREFIX = "/organization/";
|
|
28
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa;IACb,KAAK;IACL,OAAO;IACP,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,SAAS;IACT,QAAQ;IACR,eAAe;IACf,SAAS;IACT,UAAU;CACF,CAAC;AAEX,yEAAyE;AACzE,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC"}
|
package/lib/errors.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daytona-specific error types.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the common HTTP errors from core and adds the unknown-error
|
|
5
|
+
* and parse-error wrappers. Daytona declares failures as HTTP statuses
|
|
6
|
+
* against a shared `{ message }` (toolbox) or untyped (platform) body —
|
|
7
|
+
* no operation narrows which codes it can produce — so the SDK dispatches
|
|
8
|
+
* on the status (the classes here) and carries any machine-readable `code`
|
|
9
|
+
* through on {@link UnknownDaytonaError}.
|
|
10
|
+
*/
|
|
11
|
+
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
12
|
+
import type { BadRequest as CoreBadRequest, Conflict as CoreConflict, DefaultErrors as CoreDefaultErrors, Forbidden as CoreForbidden, Locked as CoreLocked, NotFound as CoreNotFound, UnprocessableEntity as CoreUnprocessableEntity } from "@distilled.cloud/core/errors";
|
|
13
|
+
import * as Schema from "effect/Schema";
|
|
14
|
+
declare const UnknownDaytonaError_base: Schema.Class<UnknownDaytonaError, Schema.TaggedStruct<"UnknownDaytonaError", {
|
|
15
|
+
readonly code: Schema.optional<Schema.String>;
|
|
16
|
+
readonly message: Schema.optional<Schema.String>;
|
|
17
|
+
readonly body: Schema.Unknown;
|
|
18
|
+
}>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
|
|
19
|
+
"@distilled.cloud/error/categories": {
|
|
20
|
+
ServerError: true;
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Unknown Daytona error — returned when a failed response's HTTP status has
|
|
25
|
+
* no mapped error class.
|
|
26
|
+
*/
|
|
27
|
+
export declare class UnknownDaytonaError extends UnknownDaytonaError_base {
|
|
28
|
+
}
|
|
29
|
+
declare const DaytonaParseError_base: Schema.Class<DaytonaParseError, Schema.TaggedStruct<"DaytonaParseError", {
|
|
30
|
+
readonly body: Schema.Unknown;
|
|
31
|
+
readonly cause: Schema.Unknown;
|
|
32
|
+
}>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
|
|
33
|
+
"@distilled.cloud/error/categories": {
|
|
34
|
+
ParseError: true;
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
/** Schema parse error wrapper. */
|
|
38
|
+
export declare class DaytonaParseError extends DaytonaParseError_base {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Errors any Daytona operation may surface in addition to the shared HTTP
|
|
42
|
+
* status errors.
|
|
43
|
+
*/
|
|
44
|
+
export type ClientErrors = UnknownDaytonaError | DaytonaParseError;
|
|
45
|
+
/**
|
|
46
|
+
* Default Daytona operation errors.
|
|
47
|
+
*
|
|
48
|
+
* EVERY operation carries the whole set: the specs type failures only as a
|
|
49
|
+
* per-operation status list (and often not even that), so any documented
|
|
50
|
+
* status can come back from any call.
|
|
51
|
+
*/
|
|
52
|
+
export type DefaultErrors = CoreDefaultErrors | CoreBadRequest | CoreForbidden | CoreNotFound | CoreConflict | CoreUnprocessableEntity | CoreLocked | ClientErrors;
|
|
53
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,UAAU,IAAI,cAAc,EAC5B,QAAQ,IAAI,YAAY,EACxB,aAAa,IAAI,iBAAiB,EAClC,SAAS,IAAI,aAAa,EAC1B,MAAM,IAAI,UAAU,EACpB,QAAQ,IAAI,YAAY,EACxB,mBAAmB,IAAI,uBAAuB,EAC/C,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;;;;;AAGxC;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,wBAOT;CAAG;;;;;;;;;AAEnC,kCAAkC;AAClC,qBAAa,iBAAkB,SAAQ,sBAMR;CAAG;AAElC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,uBAAuB,GACvB,UAAU,GACV,YAAY,CAAC"}
|
package/lib/errors.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daytona-specific error types.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the common HTTP errors from core and adds the unknown-error
|
|
5
|
+
* and parse-error wrappers. Daytona declares failures as HTTP statuses
|
|
6
|
+
* against a shared `{ message }` (toolbox) or untyped (platform) body —
|
|
7
|
+
* no operation narrows which codes it can produce — so the SDK dispatches
|
|
8
|
+
* on the status (the classes here) and carries any machine-readable `code`
|
|
9
|
+
* through on {@link UnknownDaytonaError}.
|
|
10
|
+
*/
|
|
11
|
+
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
12
|
+
import * as Schema from "effect/Schema";
|
|
13
|
+
import * as Category from "@distilled.cloud/core/category";
|
|
14
|
+
/**
|
|
15
|
+
* Unknown Daytona error — returned when a failed response's HTTP status has
|
|
16
|
+
* no mapped error class.
|
|
17
|
+
*/
|
|
18
|
+
export class UnknownDaytonaError extends Schema.TaggedError()("UnknownDaytonaError", {
|
|
19
|
+
code: Schema.optional(Schema.String),
|
|
20
|
+
message: Schema.optional(Schema.String),
|
|
21
|
+
body: Schema.Unknown,
|
|
22
|
+
}).pipe(Category.withServerError) {
|
|
23
|
+
}
|
|
24
|
+
/** Schema parse error wrapper. */
|
|
25
|
+
export class DaytonaParseError extends Schema.TaggedError()("DaytonaParseError", {
|
|
26
|
+
body: Schema.Unknown,
|
|
27
|
+
cause: Schema.Unknown,
|
|
28
|
+
}).pipe(Category.withParseError) {
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAWtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,EAAuB,CAChF,qBAAqB,EACrB;IACE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;CAAG;AAEnC,kCAAkC;AAClC,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAC5E,mBAAmB,EACnB;IACE,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @distilled.cloud/daytona — Daytona SDK for Effect.
|
|
3
|
+
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
|
+
* in `.generated-specs` (written by `scripts/convert.ts` from the three
|
|
6
|
+
* OpenAPI documents mirrored at `specs/spec-mirror-daytona/specs/`).
|
|
7
|
+
* Everything else in this folder is hand-written.
|
|
8
|
+
*
|
|
9
|
+
* One module per API tag. Platform tags (`sandbox`, `organizations`,
|
|
10
|
+
* `snapshots`, …) hit `https://app.daytona.io/api`. Toolbox tags
|
|
11
|
+
* (`process`, `git`, `fileSystem`, `computerUse`, …) hit the sandbox
|
|
12
|
+
* toolbox proxy — configure `sandboxId` on the credentials to call them.
|
|
13
|
+
* Analytics tags (`telemetry`, `usage`) hit
|
|
14
|
+
* `https://analytics.app.daytona.io`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import * as Daytona from "@distilled.cloud/daytona";
|
|
19
|
+
*
|
|
20
|
+
* const sandbox = yield* Daytona.sandbox.createSandbox({});
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export * from "./credentials.ts";
|
|
24
|
+
export * from "./errors.ts";
|
|
25
|
+
export * as T from "./traits.ts";
|
|
26
|
+
export { DaytonaProtocol, type DaytonaOpError, type DaytonaOpContext, } from "./protocol.ts";
|
|
27
|
+
export { paginateToken } from "./pagination.ts";
|
|
28
|
+
export * as Retry from "./retry.ts";
|
|
29
|
+
export * from "./services/index.ts";
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @distilled.cloud/daytona — Daytona SDK for Effect.
|
|
3
|
+
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
|
+
* in `.generated-specs` (written by `scripts/convert.ts` from the three
|
|
6
|
+
* OpenAPI documents mirrored at `specs/spec-mirror-daytona/specs/`).
|
|
7
|
+
* Everything else in this folder is hand-written.
|
|
8
|
+
*
|
|
9
|
+
* One module per API tag. Platform tags (`sandbox`, `organizations`,
|
|
10
|
+
* `snapshots`, …) hit `https://app.daytona.io/api`. Toolbox tags
|
|
11
|
+
* (`process`, `git`, `fileSystem`, `computerUse`, …) hit the sandbox
|
|
12
|
+
* toolbox proxy — configure `sandboxId` on the credentials to call them.
|
|
13
|
+
* Analytics tags (`telemetry`, `usage`) hit
|
|
14
|
+
* `https://analytics.app.daytona.io`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import * as Daytona from "@distilled.cloud/daytona";
|
|
19
|
+
*
|
|
20
|
+
* const sandbox = yield* Daytona.sandbox.createSandbox({});
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export * from "./credentials.js";
|
|
24
|
+
export * from "./errors.js";
|
|
25
|
+
export * as T from "./traits.js";
|
|
26
|
+
export { DaytonaProtocol, } from "./protocol.js";
|
|
27
|
+
export { paginateToken } from "./pagination.js";
|
|
28
|
+
export * as Retry from "./retry.js";
|
|
29
|
+
export * from "./services/index.js";
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,eAAe,GAGhB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daytona pagination — hand-written.
|
|
3
|
+
*
|
|
4
|
+
* Audit logs page by token (`nextToken` in and out, items under `items`).
|
|
5
|
+
* The OpenAPI converter stamps `smithy.api#paginated` when it recognises
|
|
6
|
+
* that shape; generated operations pass core's {@link paginateToken}
|
|
7
|
+
* strategy to `API.makePaginated`.
|
|
8
|
+
*/
|
|
9
|
+
export { paginateToken } from "@distilled.cloud/core/pagination";
|
|
10
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daytona pagination — hand-written.
|
|
3
|
+
*
|
|
4
|
+
* Audit logs page by token (`nextToken` in and out, items under `items`).
|
|
5
|
+
* The OpenAPI converter stamps `smithy.api#paginated` when it recognises
|
|
6
|
+
* that shape; generated operations pass core's {@link paginateToken}
|
|
7
|
+
* strategy to `API.makePaginated`.
|
|
8
|
+
*/
|
|
9
|
+
export { paginateToken } from "@distilled.cloud/core/pagination";
|
|
10
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as Layer from "effect/Layer";
|
|
2
|
+
import type * as HttpClient from "effect/http/HttpClient";
|
|
3
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
4
|
+
import type * as API from "@distilled.cloud/core/api";
|
|
5
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
6
|
+
import { Credentials } from "./credentials.ts";
|
|
7
|
+
import { type DefaultErrors } from "./errors.ts";
|
|
8
|
+
/**
|
|
9
|
+
* Error channel shared by every generated Daytona operation. Generated
|
|
10
|
+
* service files annotate operations with `API.OperationMethod<I, O,
|
|
11
|
+
* DaytonaOpError, DaytonaOpContext>` explicitly so the compiler never infers
|
|
12
|
+
* these back out of the schema generics.
|
|
13
|
+
*/
|
|
14
|
+
export type DaytonaOpError = DefaultErrors | ConfigError | HttpClientError.HttpClientError;
|
|
15
|
+
/** Context (requirements) shared by every generated Daytona operation. */
|
|
16
|
+
export type DaytonaOpContext = Credentials | HttpClient.HttpClient;
|
|
17
|
+
export declare const DaytonaProtocol: Layer.Layer<API.Protocol>;
|
|
18
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AAGrB;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,WAAW,GACX,eAAe,CAAC,eAAe,CAAC;AAEpC,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AA8BnE,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CA+BlD,CAAC"}
|