@distilled.cloud/namespacelabs 0.0.0-stage → 1.0.0-rc.20
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 +125 -2
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +55 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +1 -0
- package/lib/errors.d.ts +33 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +1 -0
- package/lib/index.d.ts +42 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.lazy.js +7 -0
- package/lib/index.lazy.js.map +1 -0
- package/lib/pagination.d.ts +2 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +1 -0
- package/lib/protocol.d.ts +15 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +1 -0
- package/lib/retry.d.ts +12 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +1 -0
- package/lib/services/artifacts.d.ts +260 -0
- package/lib/services/artifacts.d.ts.map +1 -0
- package/lib/services/artifacts.js +2 -0
- package/lib/services/artifacts.js.map +1 -0
- package/lib/services/audit.d.ts +149 -0
- package/lib/services/audit.d.ts.map +1 -0
- package/lib/services/audit.js +2 -0
- package/lib/services/audit.js.map +1 -0
- package/lib/services/bazel.d.ts +173 -0
- package/lib/services/bazel.d.ts.map +1 -0
- package/lib/services/bazel.js +2 -0
- package/lib/services/bazel.js.map +1 -0
- package/lib/services/bazel_cache.d.ts +118 -0
- package/lib/services/bazel_cache.d.ts.map +1 -0
- package/lib/services/bazel_cache.js +2 -0
- package/lib/services/bazel_cache.js.map +1 -0
- package/lib/services/builder.d.ts +234 -0
- package/lib/services/builder.d.ts.map +1 -0
- package/lib/services/builder.js +2 -0
- package/lib/services/builder.js.map +1 -0
- package/lib/services/buildkite_jobs.d.ts +121 -0
- package/lib/services/buildkite_jobs.d.ts.map +1 -0
- package/lib/services/buildkite_jobs.js +2 -0
- package/lib/services/buildkite_jobs.js.map +1 -0
- package/lib/services/buildkite_queue.d.ts +178 -0
- package/lib/services/buildkite_queue.d.ts.map +1 -0
- package/lib/services/buildkite_queue.js +2 -0
- package/lib/services/buildkite_queue.js.map +1 -0
- package/lib/services/compute.d.ts +1057 -0
- package/lib/services/compute.d.ts.map +1 -0
- package/lib/services/compute.js +43 -0
- package/lib/services/compute.js.map +1 -0
- package/lib/services/compute_command.d.ts +112 -0
- package/lib/services/compute_command.d.ts.map +1 -0
- package/lib/services/compute_command.js +2 -0
- package/lib/services/compute_command.js.map +1 -0
- package/lib/services/compute_observability.d.ts +157 -0
- package/lib/services/compute_observability.d.ts.map +1 -0
- package/lib/services/compute_observability.js +2 -0
- package/lib/services/compute_observability.js.map +1 -0
- package/lib/services/compute_storage.d.ts +371 -0
- package/lib/services/compute_storage.d.ts.map +1 -0
- package/lib/services/compute_storage.js +33 -0
- package/lib/services/compute_storage.js.map +1 -0
- package/lib/services/compute_usage.d.ts +275 -0
- package/lib/services/compute_usage.d.ts.map +1 -0
- package/lib/services/compute_usage.js +2 -0
- package/lib/services/compute_usage.js.map +1 -0
- package/lib/services/egress.d.ts +183 -0
- package/lib/services/egress.d.ts.map +1 -0
- package/lib/services/egress.js +2 -0
- package/lib/services/egress.js.map +1 -0
- package/lib/services/experimental_compute_reservation.d.ts +662 -0
- package/lib/services/experimental_compute_reservation.d.ts.map +1 -0
- package/lib/services/experimental_compute_reservation.js +23 -0
- package/lib/services/experimental_compute_reservation.js.map +1 -0
- package/lib/services/experimental_remote_results.d.ts +488 -0
- package/lib/services/experimental_remote_results.d.ts.map +1 -0
- package/lib/services/experimental_remote_results.js +2 -0
- package/lib/services/experimental_remote_results.js.map +1 -0
- package/lib/services/github_image.d.ts +154 -0
- package/lib/services/github_image.d.ts.map +1 -0
- package/lib/services/github_image.js +2 -0
- package/lib/services/github_image.js.map +1 -0
- package/lib/services/github_jobs.d.ts +175 -0
- package/lib/services/github_jobs.d.ts.map +1 -0
- package/lib/services/github_jobs.js +2 -0
- package/lib/services/github_jobs.js.map +1 -0
- package/lib/services/github_profile.d.ts +288 -0
- package/lib/services/github_profile.d.ts.map +1 -0
- package/lib/services/github_profile.js +2 -0
- package/lib/services/github_profile.js.map +1 -0
- package/lib/services/gradle_cache.d.ts +117 -0
- package/lib/services/gradle_cache.d.ts.map +1 -0
- package/lib/services/gradle_cache.js +2 -0
- package/lib/services/gradle_cache.js.map +1 -0
- package/lib/services/httpcache.d.ts +117 -0
- package/lib/services/httpcache.d.ts.map +1 -0
- package/lib/services/httpcache.js +2 -0
- package/lib/services/httpcache.js.map +1 -0
- package/lib/services/iam_tenant.d.ts +373 -0
- package/lib/services/iam_tenant.d.ts.map +1 -0
- package/lib/services/iam_tenant.js +39 -0
- package/lib/services/iam_tenant.js.map +1 -0
- package/lib/services/iam_tenant_membership.d.ts +106 -0
- package/lib/services/iam_tenant_membership.d.ts.map +1 -0
- package/lib/services/iam_tenant_membership.js +2 -0
- package/lib/services/iam_tenant_membership.js.map +1 -0
- package/lib/services/iam_token.d.ts +249 -0
- package/lib/services/iam_token.d.ts.map +1 -0
- package/lib/services/iam_token.js +2 -0
- package/lib/services/iam_token.js.map +1 -0
- package/lib/services/image.d.ts +214 -0
- package/lib/services/image.d.ts.map +1 -0
- package/lib/services/image.js +2 -0
- package/lib/services/image.js.map +1 -0
- package/lib/services/index.d.ts +30 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +29 -0
- package/lib/services/private_devbox.d.ts +1156 -0
- package/lib/services/private_devbox.d.ts.map +1 -0
- package/lib/services/private_devbox.js +81 -0
- package/lib/services/private_devbox.js.map +1 -0
- package/lib/services/private_user_sessions.d.ts +137 -0
- package/lib/services/private_user_sessions.d.ts.map +1 -0
- package/lib/services/private_user_sessions.js +2 -0
- package/lib/services/private_user_sessions.js.map +1 -0
- package/lib/services/registry.d.ts +365 -0
- package/lib/services/registry.d.ts.map +1 -0
- package/lib/services/registry.js +34 -0
- package/lib/services/registry.js.map +1 -0
- package/lib/services/testing.d.ts +152 -0
- package/lib/services/testing.d.ts.map +1 -0
- package/lib/services/testing.js +2 -0
- package/lib/services/testing.js.map +1 -0
- package/lib/services/vault.d.ts +195 -0
- package/lib/services/vault.d.ts.map +1 -0
- package/lib/services/vault.js +2 -0
- package/lib/services/vault.js.map +1 -0
- package/lib/services.lazy/artifacts.js +1 -0
- package/lib/services.lazy/audit.js +1 -0
- package/lib/services.lazy/bazel.js +1 -0
- package/lib/services.lazy/bazel_cache.js +1 -0
- package/lib/services.lazy/builder.js +1 -0
- package/lib/services.lazy/buildkite_jobs.js +1 -0
- package/lib/services.lazy/buildkite_queue.js +1 -0
- package/lib/services.lazy/compute.js +4 -0
- package/lib/services.lazy/compute_command.js +1 -0
- package/lib/services.lazy/compute_observability.js +1 -0
- package/lib/services.lazy/compute_storage.js +4 -0
- package/lib/services.lazy/compute_usage.js +1 -0
- package/lib/services.lazy/egress.js +1 -0
- package/lib/services.lazy/experimental_compute_reservation.js +4 -0
- package/lib/services.lazy/experimental_remote_results.js +1 -0
- package/lib/services.lazy/github_image.js +1 -0
- package/lib/services.lazy/github_jobs.js +1 -0
- package/lib/services.lazy/github_profile.js +1 -0
- package/lib/services.lazy/gradle_cache.js +1 -0
- package/lib/services.lazy/httpcache.js +1 -0
- package/lib/services.lazy/iam_tenant.js +4 -0
- package/lib/services.lazy/iam_tenant_membership.js +1 -0
- package/lib/services.lazy/iam_token.js +1 -0
- package/lib/services.lazy/image.js +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/private_devbox.js +4 -0
- package/lib/services.lazy/private_user_sessions.js +1 -0
- package/lib/services.lazy/registry.js +4 -0
- package/lib/services.lazy/testing.js +1 -0
- package/lib/services.lazy/vault.js +1 -0
- package/lib/traits.d.ts +3 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +1 -0
- package/package.json +87 -3
- package/src/credentials.ts +164 -0
- package/src/errors.ts +47 -0
- package/src/index.ts +48 -0
- package/src/pagination.ts +1 -0
- package/src/protocol.ts +82 -0
- package/src/retry.ts +28 -0
- package/src/services/artifacts.ts +761 -0
- package/src/services/audit.ts +315 -0
- package/src/services/bazel.ts +415 -0
- package/src/services/bazel_cache.ts +211 -0
- package/src/services/builder.ts +568 -0
- package/src/services/buildkite_jobs.ts +222 -0
- package/src/services/buildkite_queue.ts +445 -0
- package/src/services/compute.ts +2794 -0
- package/src/services/compute_command.ts +212 -0
- package/src/services/compute_observability.ts +428 -0
- package/src/services/compute_storage.ts +1159 -0
- package/src/services/compute_usage.ts +730 -0
- package/src/services/egress.ts +508 -0
- package/src/services/experimental_compute_reservation.ts +1488 -0
- package/src/services/experimental_remote_results.ts +1157 -0
- package/src/services/github_image.ts +293 -0
- package/src/services/github_jobs.ts +381 -0
- package/src/services/github_profile.ts +721 -0
- package/src/services/gradle_cache.ts +263 -0
- package/src/services/httpcache.ts +263 -0
- package/src/services/iam_tenant.ts +1355 -0
- package/src/services/iam_tenant_membership.ts +245 -0
- package/src/services/iam_token.ts +780 -0
- package/src/services/image.ts +594 -0
- package/src/services/index.ts +30 -0
- package/src/services/private_devbox.ts +4217 -0
- package/src/services/private_user_sessions.ts +402 -0
- package/src/services/registry.ts +1234 -0
- package/src/services/testing.ts +386 -0
- package/src/services/vault.ts +514 -0
- package/src/traits.ts +36 -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
CHANGED
|
@@ -1,3 +1,126 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @distilled.cloud/namespacelabs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Effect-native [Namespace](https://namespace.so) SDK, generated from the
|
|
4
|
+
protobuf API Namespace publishes at
|
|
5
|
+
[buf.build/namespace/cloud](https://buf.build/namespace/cloud).
|
|
6
|
+
|
|
7
|
+
## Spec source
|
|
8
|
+
|
|
9
|
+
Namespace does not publish OpenAPI. Its API is defined in protobuf and served
|
|
10
|
+
over gRPC and Connect, and the Buf Schema Registry module is what the `nsc`
|
|
11
|
+
CLI, the Go SDK and the official TypeScript SDK are generated from. The module's
|
|
12
|
+
own files (`proto/namespace/**`) are mirrored; its one dependency, Bazel's
|
|
13
|
+
build-event protos, is not read by anything the generator converts.
|
|
14
|
+
|
|
15
|
+
Convert writes one Smithy model per proto service and maps each unary RPC to
|
|
16
|
+
`POST /<package>.<Service>/<Method>` with a proto3 JSON body (camelCase
|
|
17
|
+
fields, 64-bit integers as strings, `bytes` as base64). Streaming RPCs are
|
|
18
|
+
skipped; most have a polling or `*Sync` counterpart. Five services in the
|
|
19
|
+
module answer 404 on every `namespaceapis.com` host (`ManagementService`,
|
|
20
|
+
the devbox `AgentService` and `DevBoxExtraService`, `private.instance` and
|
|
21
|
+
`experimental.remote.ExecutionService`) and are not generated.
|
|
22
|
+
|
|
23
|
+
The package is `namespacelabs` (Namespace's GitHub org and npm scope) rather
|
|
24
|
+
than `namespace`, so it does not shadow Alchemy's own `Namespace` export when
|
|
25
|
+
both are imported.
|
|
26
|
+
|
|
27
|
+
## Services
|
|
28
|
+
|
|
29
|
+
Every service is `v1beta`. The barrel export is the proto package plus the
|
|
30
|
+
service, so `ComputeService` is `compute`, `CommandService` is
|
|
31
|
+
`computeCommand`, `TokenService` is `iamToken` and the devbox API is
|
|
32
|
+
`privateDevbox`.
|
|
33
|
+
|
|
34
|
+
| Host | Services |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `https://<region>.compute.namespaceapis.com` | `compute`, `computeCommand`, `computeStorage`, `computeUsage`, `computeObservability`, `builder`, `experimentalComputeReservation` |
|
|
37
|
+
| `https://<region>.storage.namespaceapis.com` | `artifacts` |
|
|
38
|
+
| `https://global.namespaceapis.com` | `iamTenant`, `iamTenantMembership`, `iamToken`, `registry`, `vault`, `image`, `egress`, `bazel`, `bazelCache`, `gradleCache`, `httpcache`, `buildkiteJobs`, `buildkiteQueue`, `testing`, `audit`, `experimentalRemoteResults` |
|
|
39
|
+
| `https://private-api.global.namespaceapis.com` | `privateDevbox`, `privateUserSessions`, `githubProfile`, `githubJobs`, `githubImage` |
|
|
40
|
+
|
|
41
|
+
The protocol picks the host from the operation's proto package. The
|
|
42
|
+
`namespace.private.*` services are in the public module and used by the
|
|
43
|
+
official SDKs, but Namespace lists them under no stability promise.
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install @distilled.cloud/namespacelabs effect
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { Effect, Layer } from "effect";
|
|
55
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
56
|
+
import * as NamespaceLabs from "@distilled.cloud/namespacelabs";
|
|
57
|
+
|
|
58
|
+
const program = Effect.gen(function* () {
|
|
59
|
+
const created = yield* NamespaceLabs.compute.createInstance({
|
|
60
|
+
shape: { virtualCpu: 2, memoryMegabytes: 4096, os: "linux", machineArch: "amd64" },
|
|
61
|
+
deadline: new Date(Date.now() + 10 * 60 * 1000).toISOString(),
|
|
62
|
+
});
|
|
63
|
+
const instanceId = created.metadata?.instanceId;
|
|
64
|
+
if (instanceId === undefined) return undefined;
|
|
65
|
+
const instance = yield* NamespaceLabs.compute.describeInstance({ instanceId });
|
|
66
|
+
yield* NamespaceLabs.compute.destroyInstance({ instanceId });
|
|
67
|
+
return instance.metadata?.status;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const Live = Layer.mergeAll(
|
|
71
|
+
FetchHttpClient.layer,
|
|
72
|
+
NamespaceLabs.CredentialsFromEnv,
|
|
73
|
+
NamespaceLabs.NamespaceLabsProtocol,
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
program.pipe(Effect.provide(Live), Effect.runPromise);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Auth
|
|
80
|
+
|
|
81
|
+
`CredentialsFromEnv` sends `NSC_TOKEN` as `Authorization: Bearer`. Mint one
|
|
82
|
+
with `nsc auth generate-dev-token`, `nsc token create --grant ...`, or
|
|
83
|
+
`iamToken.issueTenantTokenWithOIDC` from a CI identity token.
|
|
84
|
+
|
|
85
|
+
Inside a Namespace instance, devbox or GitHub runner the workload token is a
|
|
86
|
+
file instead: `CredentialsFromTokenFile` reads `bearer_token` from
|
|
87
|
+
`NSC_TOKEN_FILE` (default `/var/run/nsc/token.json`) on every call, because
|
|
88
|
+
Namespace refreshes it. The layer needs a `FileSystem`, for example
|
|
89
|
+
`NodeFileSystem.layer` from `@effect/platform-node`. A session token from
|
|
90
|
+
`nsc login` is not a bearer token; exchange it with
|
|
91
|
+
`privateUserSessions.issueTenantTokenFromSession`.
|
|
92
|
+
|
|
93
|
+
Both layers read `NSC_REGION` (default `us`) for the compute and storage hosts
|
|
94
|
+
and `NSC_COMPUTE_URL` (or `NSC_ENDPOINT`, which Namespace sets inside an
|
|
95
|
+
instance), `NSC_STORAGE_URL`, `NSC_GLOBAL_URL` and `NSC_PRIVATE_API_URL` to
|
|
96
|
+
override a host. `credentials({ token, region })`, `fromToken(token)` and
|
|
97
|
+
`fromTokenFile(path)` build the same layers in code.
|
|
98
|
+
|
|
99
|
+
## Errors
|
|
100
|
+
|
|
101
|
+
Every operation declares the Connect error codes as typed errors, matched on
|
|
102
|
+
the HTTP status and, where one status covers several codes, on the body's
|
|
103
|
+
`code`: `InvalidArgument`, `FailedPrecondition`, `Unauthenticated`,
|
|
104
|
+
`PermissionDenied`, `NotFound`, `AlreadyExists` and `ResourceExhausted`. Each
|
|
105
|
+
carries `message` and the Connect `body` (`code`, `message`, `details` with the
|
|
106
|
+
request id).
|
|
107
|
+
A response none of them match is one of core's status errors (`BadRequest`,
|
|
108
|
+
`Conflict`, `InternalServerError`, ...). A status core does not map is
|
|
109
|
+
`UnknownNamespaceLabsError` with `code` and `details`.
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
NamespaceLabs.compute.describeInstance({ instanceId }).pipe(
|
|
113
|
+
Effect.catchTag("NotFound", () => Effect.succeed(undefined)),
|
|
114
|
+
);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Pagination
|
|
118
|
+
|
|
119
|
+
List operations whose request and response carry a cursor (`listInstances`,
|
|
120
|
+
`privateDevbox.list`, `githubJobs.listJobs`, `audit.listEntries`, the registry
|
|
121
|
+
lists, ...) expose `.pages(input)` and `.items(input)` streams that follow
|
|
122
|
+
`paginationCursor` until the last page.
|
|
123
|
+
|
|
124
|
+
Tokens, vault values, issued private keys and the third-party API keys a
|
|
125
|
+
devbox template carries are `Redacted` in responses and accepted as
|
|
126
|
+
`string | Redacted<string>` in requests.
|
package/lib/.lazy.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"serviceDirs":["services"],"twins":["index.js"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{api$D as e,api$call as t,api$error as n,api$named as ee,api$newError as te,api$op as ne,api$opPaginated as re,category$withAuthError as ie,category$withBadRequestError as ae,category$withConflictError as r,category$withParseError as i,category$withServerError as a,category$withThrottlingError as o,config$Redacted as s,config$String as c,config$all as l,config$map as u,config$option as d,config$orElse as oe,config$withDefault as f,pagination$paginateCursor as se,retry$capped as ce,retry$jittered as le,retry$makeDefault as ue,retry$throttlingFactory as p,retry$throttlingOptions as m,retry$transientFactory as h,retry$transientOptions as g,schema_lite_typed$String as _,schema_lite_typed$TaggedError as v,schema_lite_typed$Unknown as y,schema_lite_typed$optional as b,trait$Body as x,trait$FormDataFile as S,trait$Header as C,trait$Http as w,trait$HttpBody as T,trait$KeyDictionary as E,trait$Label as D,trait$Query as O,trait$ResponseCode as k,trait$UnionCases as A,trait$applyErrorMatchers as j,trait$bodySymbol as M,trait$errorMatchersSymbol as N,trait$formDataFileSymbol as P,trait$getErrorMatchers as F,trait$headerSymbol as I,trait$httpBodySymbol as L,trait$httpSymbol as R,trait$keyDictionarySymbol as z,trait$labelSymbol as B,trait$querySymbol as V,trait$responseCodeSymbol as H,trait$unionCasesSymbol as U}from"@distilled.cloud/core/_bundle/base";import{errors$API_ERRORS as de,errors$BadGateway as W,errors$BadRequest as fe,errors$ConfigError as G,errors$Conflict as pe,errors$DEFAULT_ERRORS as me,errors$Forbidden as he,errors$GatewayTimeout as ge,errors$HTTP_STATUS_MAP as _e,errors$InternalServerError as ve,errors$Locked as ye,errors$NotFound as be,errors$ServiceUnavailable as xe,errors$TooManyRequests as Se,errors$Unauthorized as Ce,errors$UnprocessableEntity as we,protocol_rest$RawResponse as Te,protocol_rest$RawResponseRoot as Ee,protocol_rest$SensitiveValue as De,protocol_rest$makeRestProtocol as Oe,protocol_rest$rawResponseRootSymbol as ke,protocol_rest$rawResponseSymbol as Ae,protocol_rest$sensitiveValueSymbol as je,schema_lite$Array as Me,schema_lite$Boolean as Ne,schema_lite$Number as Pe,schema_lite$Record as Fe,schema_lite$String as Ie,schema_lite$Struct as Le,schema_lite$TaggedError as Re,schema_lite$Unknown as ze,schema_lite$at as Be,schema_lite$optional as Ve,schema_lite$suspend as He}from"@distilled.cloud/core/_bundle/rest";import*as K from"effect/Context";import*as q from"effect/Effect";import*as J from"effect/FileSystem";import*as Y from"effect/Layer";import*as X from"effect/Option";import*as Z from"effect/Redacted";const Ue=`us`;const We=`https://global.namespaceapis.com`;const Ge=`https://private-api.global.namespaceapis.com`;const Q=`/var/run/nsc/token.json`;const computeBaseUrlFor=e=>`https://${e}.compute.namespaceapis.com`;const storageBaseUrlFor=e=>`https://${e}.storage.namespaceapis.com`;const resolveConfig=e=>{const t=e.region??`us`;return{token:e.token,region:t,computeBaseUrl:e.computeBaseUrl??computeBaseUrlFor(t),storageBaseUrl:e.storageBaseUrl??storageBaseUrlFor(t),globalBaseUrl:e.globalBaseUrl??`https://global.namespaceapis.com`,privateApiBaseUrl:e.privateApiBaseUrl??`https://private-api.global.namespaceapis.com`}};var Credentials=class extends (/*@__PURE__*/ K.Service()(`NamespaceLabsCredentials`)){};const optionalString=e=>d(c(e)).pipe(u(X.getOrUndefined));const $=/*@__PURE__*/ l({region:/*@__PURE__*/ c(`NSC_REGION`).pipe(/*@__PURE__*/ f(`us`)),computeBaseUrl:/*@__PURE__*/ c(`NSC_COMPUTE_URL`).pipe(/*@__PURE__*/ oe(()=>c(`NSC_ENDPOINT`)),d,/*@__PURE__*/ u(X.getOrUndefined)),storageBaseUrl:/*@__PURE__*/ optionalString(`NSC_STORAGE_URL`),globalBaseUrl:/*@__PURE__*/ optionalString(`NSC_GLOBAL_URL`),privateApiBaseUrl:/*@__PURE__*/ optionalString(`NSC_PRIVATE_API_URL`)});const configError=e=>()=>new G({message:e});const Ke=/*@__PURE__*/ Y.succeed(Credentials,/*@__PURE__*/ l({token:/*@__PURE__*/ s(`NSC_TOKEN`),hosts:$}).pipe(/*@__PURE__*/ q.map(({token:e,hosts:t})=>resolveConfig({token:e,...t})),/*@__PURE__*/ q.mapError(configError(`NSC_TOKEN environment variable is required`))));const readTokenFile=(e,t)=>e.readFileString(t).pipe(q.mapError(configError(`Namespace token file ${t} could not be read`)),q.flatMap(e=>{const n=q.try({try:()=>JSON.parse(e),catch:configError(`Namespace token file ${t} is not JSON`)});return q.flatMap(n,({bearer_token:e})=>typeof e===`string`&&e.length>0?q.succeed(Z.make(e)):q.fail(new G({message:`Namespace token file ${t} has no bearer_token; exchange a session token with privateUserSessions.issueTenantTokenFromSession`})))}));const qe=/*@__PURE__*/ Y.effect(Credentials,/*@__PURE__*/ q.map(J.FileSystem,e=>l({path:c(`NSC_TOKEN_FILE`).pipe(f(Q)),hosts:$}).pipe(q.mapError(configError(`Namespace host configuration could not be read`)),q.flatMap(({path:t,hosts:n})=>q.map(readTokenFile(e,t),e=>resolveConfig({token:e,...n}))))));const credentials=e=>Y.succeed(Credentials,q.succeed(resolveConfig(e)));const fromToken=e=>credentials({token:e});const fromTokenFile=(e,t={})=>Y.effect(Credentials,q.map(J.FileSystem,n=>q.map(readTokenFile(n,e),e=>resolveConfig({token:e,...t}))));var UnknownNamespaceLabsError=class extends (/*@__PURE__*/ v()(`UnknownNamespaceLabsError`,{code:/*@__PURE__*/ b(_),message:/*@__PURE__*/ b(_),details:/*@__PURE__*/ b(y),body:y}).pipe(a)){};var NamespaceLabsParseError=class extends (/*@__PURE__*/ v()(`NamespaceLabsParseError`,{body:y,cause:y}).pipe(i)){};const Je=[[`namespace.cloud.compute.`,`compute`],[`namespace.cloud.builder.`,`compute`],[`namespace.experimental.compute.`,`compute`],[`namespace.cloud.storage.`,`storage`],[`namespace.cloud.github.`,`privateApi`],[`namespace.private.`,`privateApi`]];const hostFor=e=>{const t=e.replace(/^\//,``).split(`/`)[0]??``;return Je.find(([e])=>t.startsWith(e))?.[1]??`global`};const baseUrlFor=(e,t)=>{switch(hostFor(t)){case`compute`:return e.computeBaseUrl;case`storage`:return e.storageBaseUrl;case`privateApi`:return e.privateApiBaseUrl;case`global`:return e.globalBaseUrl}};const errorEnvelope=e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;return{code:typeof t.code===`string`?t.code:void 0,message:typeof t.message===`string`?t.message:void 0}};const errorDetails=e=>e!==null&&typeof e===`object`?e.details:void 0;const Ye=/*@__PURE__*/ Oe({credentials:/*@__PURE__*/ q.flatMap(Credentials,e=>e),baseUrl:(e,t)=>baseUrlFor(e,t.uri),headers:e=>({Authorization:`Bearer ${Z.value(e.token)}`}),emptyJsonBody:true,errorEnvelope,unknownError:({code:e,message:t,body:n})=>new UnknownNamespaceLabsError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,details:errorDetails(n),body:n}),parseError:({body:e,cause:t})=>new NamespaceLabsParseError({body:e,cause:t})});var Retry=class extends K.Service()(`NamespaceLabsRetry`){};const policy=e=>q.provide(Y.succeed(Retry,e));const Xe=q.provide(Y.succeed(Retry,{while:()=>false}));const Ze=policy(p);const Qe=policy(h);export{Re as Ac,r as Ba,ze as Dc,Be as Fc,Ve as Kc,o as La,He as Lc,e as a,t as c,Credentials as credentials$Credentials,Ke as credentials$CredentialsFromEnv,qe as credentials$CredentialsFromTokenFile,We as credentials$DEFAULT_GLOBAL_BASE_URL,Ge as credentials$DEFAULT_PRIVATE_API_BASE_URL,Ue as credentials$DEFAULT_REGION,Q as credentials$DEFAULT_TOKEN_FILE,computeBaseUrlFor as credentials$computeBaseUrlFor,credentials as credentials$credentials,fromToken as credentials$fromToken,fromTokenFile as credentials$fromTokenFile,resolveConfig as credentials$resolveConfig,storageBaseUrlFor as credentials$storageBaseUrlFor,n as e,de as errors$API_ERRORS,W as errors$BadGateway,fe as errors$BadRequest,G as errors$ConfigError,pe as errors$Conflict,me as errors$DEFAULT_ERRORS,he as errors$Forbidden,ge as errors$GatewayTimeout,_e as errors$HTTP_STATUS_MAP,ve as errors$InternalServerError,ye as errors$Locked,NamespaceLabsParseError as errors$NamespaceLabsParseError,be as errors$NotFound,xe as errors$ServiceUnavailable,Se as errors$TooManyRequests,Ce as errors$Unauthorized,UnknownNamespaceLabsError as errors$UnknownNamespaceLabsError,we as errors$UnprocessableEntity,ee as k,te as l,Me as lc,ne as m,Ne as mc,re as n,se as pagination$paginateCursor,Ye as protocol$NamespaceLabsProtocol,baseUrlFor as protocol$baseUrlFor,hostFor as protocol$hostFor,Retry as retry$Retry,ce as retry$capped,le as retry$jittered,ue as retry$makeDefault,Xe as retry$none,policy as retry$policy,Ze as retry$throttling,p as retry$throttlingFactory,m as retry$throttlingOptions,Qe as retry$transient,h as retry$transientFactory,g as retry$transientOptions,x as traits$Body,S as traits$FormDataFile,C as traits$Header,w as traits$Http,T as traits$HttpBody,E as traits$KeyDictionary,D as traits$Label,O as traits$Query,Te as traits$RawResponse,Ee as traits$RawResponseRoot,k as traits$ResponseCode,De as traits$SensitiveValue,A as traits$UnionCases,j as traits$applyErrorMatchers,M as traits$bodySymbol,N as traits$errorMatchersSymbol,P as traits$formDataFileSymbol,F as traits$getErrorMatchers,I as traits$headerSymbol,L as traits$httpBodySymbol,R as traits$httpSymbol,z as traits$keyDictionarySymbol,B as traits$labelSymbol,V as traits$querySymbol,ke as traits$rawResponseRootSymbol,Ae as traits$rawResponseSymbol,H as traits$responseCodeSymbol,je as traits$sensitiveValueSymbol,U as traits$unionCasesSymbol,Pe as uc,Fe as vc,ie as xa,Ie as xc,ae as ya,Le as yc};
|
|
2
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["EffectConfig.option","EffectConfig.String","EffectConfig.map","EffectConfig.all","EffectConfig.withDefault","Schema.String","Schema.Unknown","Category.withServerError","Category.withParseError","D","call","error","named","newError","op","opPaginated","withAuthError","withBadRequestError","withConflictError","withParseError","withServerError","withThrottlingError","Redacted$3","String$3","all$1","map","option","orElse","withDefault","paginateCursor","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","String$2","TaggedError$1","Unknown$1","optional$1","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","makeRestProtocol","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","Array","Boolean","Number","Record","String$1","Struct","TaggedError","Unknown","at","optional","suspend","Context","Effect","FileSystem","Layer","Option","Redacted","DEFAULT_REGION","DEFAULT_GLOBAL_BASE_URL","DEFAULT_PRIVATE_API_BASE_URL","DEFAULT_TOKEN_FILE","region","options","name","hostsConfig","CredentialsFromEnv","hosts","fs","path","parsed","text","bearer_token","CredentialsFromTokenFile","HOST_BY_PACKAGE_PREFIX","service","uri","prefix","creds","body","b","NamespaceLabsProtocol","resolve","target","code","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"8gFASA,MAAawG,GAAiB,KAC9B,MAAaC,GAA0B,mCACvC,MAAaC,GAA+B,+CAE5C,MAAaC,EAAqB,0BAElC,MAAa,kBAAqB,GAChC,WAAWC,EAAO,4BACpB,MAAa,kBAAqB,GAChC,WAAWA,EAAO,4BA2BpB,MAAa,cAAiB,GAA6B,CACzD,MAAMA,EAASC,EAAQ,QAAA,KACvB,MAAO,CACL,MAAOA,EAAQ,MACf,SACA,eAAgBA,EAAQ,gBAAkB,kBAAkBD,CAAM,EAClE,eAAgBC,EAAQ,gBAAkB,kBAAkBD,CAAM,EAClE,cAAeC,EAAQ,eAAA,mCACvB,kBAAmBA,EAAQ,mBAAA,8CAC7B,CACF,EAEA,IAAa,YAAb,eACwB,gBAAQ,QAAyD,CAAC,CACtF,0BACF,EAAA,AAAE,CAAC,EAEL,MAAM,eAAkB,GACtB7G,EAAoBC,EAAoB6G,CAAI,CAAC,CAAC,CAAC,KAAK5G,EAAiBoG,EAAO,cAAc,CAAC,EAQ7F,MAAMS,EAA4B,gBAAiB,CACjD,OAAsB,gBAAoB,YAAY,CAAC,CAAC,KACxC,gBAAA,IAAuC,CACvD,EACA,eAA8B,gBAAoB,iBAAiB,CAAC,CAAC,KACrD,qBAA0B9G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nG,CAAgB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as FileSystem from "effect/FileSystem";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import * as Redacted from "effect/Redacted";
|
|
7
|
+
export declare const DEFAULT_REGION = "us";
|
|
8
|
+
export declare const DEFAULT_GLOBAL_BASE_URL = "https://global.namespaceapis.com";
|
|
9
|
+
export declare const DEFAULT_PRIVATE_API_BASE_URL = "https://private-api.global.namespaceapis.com";
|
|
10
|
+
/** Where a Namespace instance or runner mounts its workload token. */
|
|
11
|
+
export declare const DEFAULT_TOKEN_FILE = "/var/run/nsc/token.json";
|
|
12
|
+
export declare const computeBaseUrlFor: (region: string) => string;
|
|
13
|
+
export declare const storageBaseUrlFor: (region: string) => string;
|
|
14
|
+
export interface Config {
|
|
15
|
+
readonly token: Redacted.Redacted<string>;
|
|
16
|
+
readonly region: string;
|
|
17
|
+
/** `namespace.cloud.compute.*`, `builder`, `experimental.compute`: `https://<region>.compute.namespaceapis.com`. */
|
|
18
|
+
readonly computeBaseUrl: string;
|
|
19
|
+
/** `namespace.cloud.storage.*` (artifacts): `https://<region>.storage.namespaceapis.com`. */
|
|
20
|
+
readonly storageBaseUrl: string;
|
|
21
|
+
/** IAM, registry, vault, images, caches, egress and everything else global. */
|
|
22
|
+
readonly globalBaseUrl: string;
|
|
23
|
+
/** `namespace.private.*` (devboxes, sessions) and `namespace.cloud.github.*`. */
|
|
24
|
+
readonly privateApiBaseUrl: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Hosts {
|
|
27
|
+
readonly region?: string;
|
|
28
|
+
readonly computeBaseUrl?: string;
|
|
29
|
+
readonly storageBaseUrl?: string;
|
|
30
|
+
readonly globalBaseUrl?: string;
|
|
31
|
+
readonly privateApiBaseUrl?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface Options extends Hosts {
|
|
34
|
+
readonly token: Redacted.Redacted<string>;
|
|
35
|
+
}
|
|
36
|
+
export declare const resolveConfig: (options: Options) => Config;
|
|
37
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "NamespaceLabsCredentials", Effect.Effect<Config, ConfigError, never>>;
|
|
38
|
+
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
39
|
+
}
|
|
40
|
+
/** Credentials from the environment: `NSC_TOKEN` (required) plus the host variables. */
|
|
41
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials>;
|
|
42
|
+
/**
|
|
43
|
+
* Credentials from the token file a Namespace workload is given: `NSC_TOKEN_FILE`,
|
|
44
|
+
* else `/var/run/nsc/token.json`. The file is re-read on every resolution because
|
|
45
|
+
* Namespace refreshes it; host variables as in {@link CredentialsFromEnv}.
|
|
46
|
+
*/
|
|
47
|
+
export declare const CredentialsFromTokenFile: Layer.Layer<Credentials, never, FileSystem.FileSystem>;
|
|
48
|
+
/** Convenience layer from a tenant token, an optional region and host overrides. */
|
|
49
|
+
export declare const credentials: (options: Options) => Layer.Layer<Credentials>;
|
|
50
|
+
/** Convenience layer from a tenant token alone. */
|
|
51
|
+
export declare const fromToken: (token: Redacted.Redacted<string>) => Layer.Layer<Credentials>;
|
|
52
|
+
/** Convenience layer reading `bearer_token` from a token file on every resolution. */
|
|
53
|
+
export declare const fromTokenFile: (path: string, hosts?: Hosts) => Layer.Layer<Credentials, never, FileSystem.FileSystem>;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OA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OAAO,KAAG,MAUhD,CAAC;;AAEF,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAErB;CAAG;AA2BN,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CASvD,CAAC;AAyBF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAgBzF,CAAC;AAEJ,oFAAoF;AACpF,eAAO,MAAM,WAAW,YAAa,OAAO,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CACF,CAAC;AAErE,mDAAmD;AACnD,eAAO,MAAM,SAAS,UAAW,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAC5D,CAAC;AAEzB,sFAAsF;AACtF,eAAO,MAAM,aAAa,SAClB,MAAM,UACL,KAAK,KACX,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAMrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { credentials$Credentials as Credentials, credentials$CredentialsFromEnv as CredentialsFromEnv, credentials$CredentialsFromTokenFile as CredentialsFromTokenFile, credentials$DEFAULT_GLOBAL_BASE_URL as DEFAULT_GLOBAL_BASE_URL, credentials$DEFAULT_PRIVATE_API_BASE_URL as DEFAULT_PRIVATE_API_BASE_URL, credentials$DEFAULT_REGION as DEFAULT_REGION, credentials$DEFAULT_TOKEN_FILE as DEFAULT_TOKEN_FILE, credentials$computeBaseUrlFor as computeBaseUrlFor, credentials$credentials as credentials, credentials$fromToken as fromToken, credentials$fromTokenFile as fromTokenFile, credentials$resolveConfig as resolveConfig, credentials$storageBaseUrlFor as storageBaseUrlFor } from "./_bundle/sdk.js";
|
package/lib/errors.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export { API_ERRORS, BadGateway, BadRequest, Conflict, ConfigError, DEFAULT_ERRORS, Forbidden, GatewayTimeout, HTTP_STATUS_MAP, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, } from "@distilled.cloud/core/errors";
|
|
2
|
+
import type { DefaultErrors as CoreDefaultErrors } from "@distilled.cloud/core/errors";
|
|
3
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
4
|
+
declare const UnknownNamespaceLabsError_base: Schema.TaggedErrorClass<"UnknownNamespaceLabsError", {
|
|
5
|
+
readonly code: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6
|
+
readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
7
|
+
readonly details: import("effect/Schema").optional<import("effect/Schema").Unknown>;
|
|
8
|
+
readonly body: import("effect/Schema").Unknown;
|
|
9
|
+
}> & (new (...args: any[]) => {
|
|
10
|
+
"@distilled.cloud/error/categories": {
|
|
11
|
+
ServerError: true;
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* A failed response no declared error class matches. `code` is the Connect
|
|
16
|
+
* error code (`unknown`, `data_loss`, ...) and `details` the Connect error
|
|
17
|
+
* details, which carry the request id.
|
|
18
|
+
*/
|
|
19
|
+
export declare class UnknownNamespaceLabsError extends /*@__PURE__*/ UnknownNamespaceLabsError_base {
|
|
20
|
+
}
|
|
21
|
+
declare const NamespaceLabsParseError_base: Schema.TaggedErrorClass<"NamespaceLabsParseError", {
|
|
22
|
+
readonly body: import("effect/Schema").Unknown;
|
|
23
|
+
readonly cause: import("effect/Schema").Unknown;
|
|
24
|
+
}> & (new (...args: any[]) => {
|
|
25
|
+
"@distilled.cloud/error/categories": {
|
|
26
|
+
ParseError: true;
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
export declare class NamespaceLabsParseError extends /*@__PURE__*/ NamespaceLabsParseError_base {
|
|
30
|
+
}
|
|
31
|
+
export type ClientErrors = UnknownNamespaceLabsError | NamespaceLabsParseError;
|
|
32
|
+
export type DefaultErrors = CoreDefaultErrors | ClientErrors;
|
|
33
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,cAAc,EACd,SAAS,EACT,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;;;;;AAElE;;;;GAIG;AACH,qBAAa,yBACX,SAAQ,aAAa,CAAC,8BAQU;CAAG;;;;;;;;;AAErC,qBAAa,uBACX,SAAQ,aAAa,CAAC,4BAGU;CAAG;AAErC,MAAM,MAAM,YAAY,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;AAE/E,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,YAAY,CAAC"}
|
package/lib/errors.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NamespaceLabsParseError as NamespaceLabsParseError, errors$NotFound as NotFound, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownNamespaceLabsError as UnknownNamespaceLabsError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @distilled.cloud/namespacelabs -- Namespace (namespace.so) SDK for Effect.
|
|
3
|
+
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
|
+
* that `scripts/convert.ts` converts from Namespace's public protobuf API
|
|
6
|
+
* (`buf.build/namespace/cloud`). Everything else in this folder is hand-written.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { Effect, Layer } from "effect";
|
|
11
|
+
* import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
12
|
+
* import * as NamespaceLabs from "@distilled.cloud/namespacelabs";
|
|
13
|
+
*
|
|
14
|
+
* const program = Effect.gen(function* () {
|
|
15
|
+
* const created = yield* NamespaceLabs.compute.createInstance({
|
|
16
|
+
* shape: { virtualCpu: 2, memoryMegabytes: 4096, os: "linux", machineArch: "amd64" },
|
|
17
|
+
* deadline: new Date(Date.now() + 10 * 60 * 1000).toISOString(),
|
|
18
|
+
* });
|
|
19
|
+
* const instanceId = created.metadata?.instanceId;
|
|
20
|
+
* if (instanceId === undefined) return undefined;
|
|
21
|
+
* const instance = yield* NamespaceLabs.compute.describeInstance({ instanceId });
|
|
22
|
+
* yield* NamespaceLabs.compute.destroyInstance({ instanceId });
|
|
23
|
+
* return instance.metadata?.status;
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* const Live = Layer.mergeAll(
|
|
27
|
+
* FetchHttpClient.layer,
|
|
28
|
+
* NamespaceLabs.CredentialsFromEnv,
|
|
29
|
+
* NamespaceLabs.NamespaceLabsProtocol,
|
|
30
|
+
* );
|
|
31
|
+
*
|
|
32
|
+
* program.pipe(Effect.provide(Live), Effect.runPromise);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export * from "./credentials.ts";
|
|
36
|
+
export * from "./errors.ts";
|
|
37
|
+
export * as T from "./traits.ts";
|
|
38
|
+
export { NamespaceLabsProtocol, baseUrlFor, hostFor, type Host, type NamespaceLabsOpError, type NamespaceLabsOpContext, } from "./protocol.ts";
|
|
39
|
+
export { paginateCursor } from "./pagination.ts";
|
|
40
|
+
export * as Retry from "./retry.ts";
|
|
41
|
+
export * from "./services/index.ts";
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,OAAO,EACP,KAAK,IAAI,EACT,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./credentials.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * as T from "./traits.js";
|
|
4
|
+
export { NamespaceLabsProtocol, baseUrlFor, hostFor } from "./protocol.js";
|
|
5
|
+
export { paginateCursor } from "./pagination.js";
|
|
6
|
+
export * as Retry from "./retry.js";
|
|
7
|
+
export * from "./services/index.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./credentials.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * as T from "./traits.js";
|
|
4
|
+
export { NamespaceLabsProtocol, baseUrlFor, hostFor } from "./protocol.js";
|
|
5
|
+
export { paginateCursor } from "./pagination.js";
|
|
6
|
+
export * as Retry from "./retry.js";
|
|
7
|
+
export * from "./services.lazy/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,OAAO,GAIR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { pagination$paginateCursor as paginateCursor } from "./_bundle/sdk.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as API from "@distilled.cloud/core/api";
|
|
2
|
+
import type { ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
|
|
3
|
+
import type * as HttpClient from "effect/http/HttpClient";
|
|
4
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
5
|
+
import type * as Layer from "effect/Layer";
|
|
6
|
+
import { Credentials, type Config } from "./credentials.ts";
|
|
7
|
+
import { type DefaultErrors } from "./errors.ts";
|
|
8
|
+
export type NamespaceLabsOpError = DefaultErrors | ConfigError | HttpClientError.HttpClientError | InvalidInput;
|
|
9
|
+
export type NamespaceLabsOpContext = Credentials | HttpClient.HttpClient;
|
|
10
|
+
export type Host = "compute" | "storage" | "global" | "privateApi";
|
|
11
|
+
/** The host serving `uri` (`/<package>.<Service>/<Method>`), by proto package. */
|
|
12
|
+
export declare const hostFor: (uri: string) => Host;
|
|
13
|
+
export declare const baseUrlFor: (creds: Config, uri: string) => string;
|
|
14
|
+
export declare const NamespaceLabsProtocol: Layer.Layer<API.Protocol>;
|
|
15
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG9E,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,oBAAoB,GAC5B,aAAa,GACb,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,YAAY,CAAC;AAEjB,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEzE,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;AAWnE,kFAAkF;AAClF,eAAO,MAAM,OAAO,QAAS,MAAM,KAAG,IAGrC,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,MAAM,OAAO,MAAM,KAAG,MAWvD,CAAC;AAeF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAexD,CAAC"}
|
package/lib/protocol.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { protocol$NamespaceLabsProtocol as NamespaceLabsProtocol, protocol$baseUrlFor as baseUrlFor, protocol$hostFor as hostFor } from "./_bundle/sdk.js";
|
package/lib/retry.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Policy } from "@distilled.cloud/core/retry";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
export { type Factory, type Options, type Policy, capped, jittered, makeDefault, throttlingFactory, throttlingOptions, transientFactory, transientOptions, } from "@distilled.cloud/core/retry";
|
|
5
|
+
declare const Retry_base: Context.ServiceClass<Retry, "NamespaceLabsRetry", Policy>;
|
|
6
|
+
export declare class Retry extends Retry_base {
|
|
7
|
+
}
|
|
8
|
+
export declare const policy: (optionsOrFactory: Policy) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
9
|
+
export declare const none: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
10
|
+
export declare const throttling: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
11
|
+
export declare const transient: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
12
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,MAAM,EACN,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,qBAAa,KAAM,SAAQ,UAAsD;CAAG;AAEpF,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,eAAO,MAAM,IAAI,mFAA+D,CAAC;AAEjF,eAAO,MAAM,UAAU,mFAA4B,CAAC;AAEpD,eAAO,MAAM,SAAS,mFAA2B,CAAC"}
|
package/lib/retry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { retry$Retry as Retry, retry$capped as capped, retry$jittered as jittered, retry$makeDefault as makeDefault, retry$none as none, retry$policy as policy, retry$throttling as throttling, retry$throttlingFactory as throttlingFactory, retry$throttlingOptions as throttlingOptions, retry$transient as transient, retry$transientFactory as transientFactory, retry$transientOptions as transientOptions } from "./_bundle/sdk.js";
|