@s2-dev/streamstore 0.16.0 → 0.16.2
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 +1 -2
- package/dist/accessTokens.d.ts +37 -0
- package/dist/accessTokens.d.ts.map +1 -0
- package/dist/accessTokens.js +74 -0
- package/dist/accessTokens.js.map +1 -0
- package/dist/basin.d.ts +26 -0
- package/dist/basin.d.ts.map +1 -0
- package/dist/basin.js +34 -0
- package/dist/basin.js.map +1 -0
- package/dist/basins.d.ts +53 -0
- package/dist/basins.d.ts.map +1 -0
- package/dist/basins.js +115 -0
- package/dist/basins.js.map +1 -0
- package/dist/common.d.ts +44 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +2 -0
- package/dist/common.js.map +1 -0
- package/dist/error.d.ts +28 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +43 -0
- package/dist/error.js.map +1 -0
- package/dist/generated/client/client.gen.d.ts +3 -0
- package/dist/generated/client/client.gen.d.ts.map +1 -0
- package/dist/generated/client/client.gen.js +205 -0
- package/dist/generated/client/client.gen.js.map +1 -0
- package/dist/generated/client/index.d.ts +9 -0
- package/dist/generated/client/index.d.ts.map +1 -0
- package/dist/generated/client/index.js +7 -0
- package/dist/generated/client/index.js.map +1 -0
- package/dist/generated/client/types.gen.d.ts +125 -0
- package/dist/generated/client/types.gen.d.ts.map +1 -0
- package/dist/generated/client/types.gen.js +3 -0
- package/dist/generated/client/types.gen.js.map +1 -0
- package/dist/generated/client/utils.gen.d.ts +34 -0
- package/dist/generated/client/utils.gen.d.ts.map +1 -0
- package/dist/generated/client/utils.gen.js +231 -0
- package/dist/generated/client/utils.gen.js.map +1 -0
- package/{src/generated/client.gen.ts → dist/generated/client.gen.d.ts} +3 -8
- package/dist/generated/client.gen.d.ts.map +1 -0
- package/dist/generated/client.gen.js +6 -0
- package/dist/generated/client.gen.js.map +1 -0
- package/dist/generated/core/auth.gen.d.ts +19 -0
- package/dist/generated/core/auth.gen.d.ts.map +1 -0
- package/dist/generated/core/auth.gen.js +15 -0
- package/dist/generated/core/auth.gen.js.map +1 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +18 -0
- package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/bodySerializer.gen.js +58 -0
- package/dist/generated/core/bodySerializer.gen.js.map +1 -0
- package/dist/generated/core/params.gen.d.ts +34 -0
- package/dist/generated/core/params.gen.d.ts.map +1 -0
- package/dist/generated/core/params.gen.js +89 -0
- package/dist/generated/core/params.gen.js.map +1 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
- package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/pathSerializer.gen.js +115 -0
- package/dist/generated/core/pathSerializer.gen.js.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.js +100 -0
- package/dist/generated/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.js +136 -0
- package/dist/generated/core/serverSentEvents.gen.js.map +1 -0
- package/dist/generated/core/types.gen.d.ts +79 -0
- package/dist/generated/core/types.gen.d.ts.map +1 -0
- package/dist/generated/core/types.gen.js +3 -0
- package/dist/generated/core/types.gen.js.map +1 -0
- package/dist/generated/core/utils.gen.d.ts +20 -0
- package/dist/generated/core/utils.gen.d.ts.map +1 -0
- package/dist/generated/core/utils.gen.js +88 -0
- package/dist/generated/core/utils.gen.js.map +1 -0
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/{src/generated/index.ts → dist/generated/index.js} +1 -2
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/sdk.gen.d.ts +100 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -0
- package/dist/generated/sdk.gen.js +350 -0
- package/dist/generated/sdk.gen.js.map +1 -0
- package/{src/generated/types.gen.ts → dist/generated/types.gen.d.ts} +1 -158
- package/dist/generated/types.gen.d.ts.map +1 -0
- package/dist/generated/types.gen.js +3 -0
- package/dist/generated/types.gen.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/event-stream.d.ts +26 -0
- package/dist/lib/event-stream.d.ts.map +1 -0
- package/dist/lib/event-stream.js +138 -0
- package/dist/lib/event-stream.js.map +1 -0
- package/dist/metrics.d.ts +44 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +83 -0
- package/dist/metrics.js.map +1 -0
- package/dist/s2.d.ts +38 -0
- package/dist/s2.d.ts.map +1 -0
- package/dist/s2.js +56 -0
- package/dist/s2.js.map +1 -0
- package/dist/stream.d.ts +156 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.js +598 -0
- package/dist/stream.js.map +1 -0
- package/dist/streams.d.ts +52 -0
- package/dist/streams.d.ts.map +1 -0
- package/dist/streams.js +114 -0
- package/dist/streams.js.map +1 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +52 -0
- package/dist/utils.js.map +1 -0
- package/package.json +13 -4
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.claude/settings.local.json +0 -9
- package/.github/workflows/ci.yml +0 -59
- package/.github/workflows/publish.yml +0 -35
- package/CHANGELOG.md +0 -7
- package/biome.json +0 -30
- package/bun.lock +0 -598
- package/examples/append.ts +0 -84
- package/examples/kitchen-sink.ts +0 -73
- package/examples/read.ts +0 -30
- package/openapi-ts.config.ts +0 -7
- package/src/accessTokens.ts +0 -100
- package/src/basin.ts +0 -43
- package/src/basins.ts +0 -154
- package/src/common.ts +0 -45
- package/src/error.ts +0 -58
- package/src/generated/client/client.gen.ts +0 -268
- package/src/generated/client/index.ts +0 -26
- package/src/generated/client/types.gen.ts +0 -268
- package/src/generated/client/utils.gen.ts +0 -331
- package/src/generated/core/auth.gen.ts +0 -42
- package/src/generated/core/bodySerializer.gen.ts +0 -92
- package/src/generated/core/params.gen.ts +0 -153
- package/src/generated/core/pathSerializer.gen.ts +0 -181
- package/src/generated/core/queryKeySerializer.gen.ts +0 -136
- package/src/generated/core/serverSentEvents.gen.ts +0 -264
- package/src/generated/core/types.gen.ts +0 -118
- package/src/generated/core/utils.gen.ts +0 -143
- package/src/generated/sdk.gen.ts +0 -387
- package/src/index.ts +0 -66
- package/src/lib/event-stream.ts +0 -167
- package/src/metrics.ts +0 -106
- package/src/s2.ts +0 -65
- package/src/stream.ts +0 -791
- package/src/streams.ts +0 -156
- package/src/tests/appendSession.test.ts +0 -149
- package/src/tests/batcher-session.integration.test.ts +0 -80
- package/src/tests/batcher.test.ts +0 -216
- package/src/tests/index.test.ts +0 -7
- package/src/utils.ts +0 -80
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -31
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
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
</p>
|
|
21
21
|
</div>
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
[S2 API](https://s2.dev/docs/rest/protocol).
|
|
23
|
+
This TypeScript SDK is an ergonomic way to consume the [S2 REST API](https://s2.dev/docs/rest/protocol).
|
|
25
24
|
|
|
26
25
|
> **Note:** This is a rewrite of the TypeScript SDK. The older version (0.15.3) is still available and can be installed:
|
|
27
26
|
> ```bash
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DataToObject, S2RequestOptions } from "./common";
|
|
2
|
+
import { type IssueAccessTokenData, type ListAccessTokensData, type RevokeAccessTokenData } from "./generated";
|
|
3
|
+
import type { Client } from "./generated/client/types.gen";
|
|
4
|
+
export interface ListAccessTokensArgs extends DataToObject<ListAccessTokensData> {
|
|
5
|
+
}
|
|
6
|
+
export interface IssueAccessTokenArgs extends DataToObject<IssueAccessTokenData> {
|
|
7
|
+
}
|
|
8
|
+
export interface RevokeAccessTokenArgs extends DataToObject<RevokeAccessTokenData> {
|
|
9
|
+
}
|
|
10
|
+
export declare class S2AccessTokens {
|
|
11
|
+
readonly client: Client;
|
|
12
|
+
constructor(client: Client);
|
|
13
|
+
/**
|
|
14
|
+
* List access tokens.
|
|
15
|
+
*
|
|
16
|
+
* @param args.prefix Filter to IDs beginning with this prefix
|
|
17
|
+
* @param args.start_after Filter to IDs lexicographically after this value
|
|
18
|
+
* @param args.limit Max results (up to 1000)
|
|
19
|
+
*/
|
|
20
|
+
list(args?: ListAccessTokensArgs, options?: S2RequestOptions): Promise<import("./generated").ListAccessTokensResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Issue a new access token.
|
|
23
|
+
*
|
|
24
|
+
* @param args.id Unique token ID (1-96 bytes)
|
|
25
|
+
* @param args.scope Token scope (operations and resource sets)
|
|
26
|
+
* @param args.auto_prefix_streams Namespace stream names by configured prefix scope
|
|
27
|
+
* @param args.expires_at Expiration in ISO 8601; defaults to requestor's token expiry
|
|
28
|
+
*/
|
|
29
|
+
issue(args: IssueAccessTokenArgs, options?: S2RequestOptions): Promise<import("./generated").IssueAccessTokenResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Revoke an access token by ID.
|
|
32
|
+
*
|
|
33
|
+
* @param args.id Token ID to revoke
|
|
34
|
+
*/
|
|
35
|
+
revoke(args: RevokeAccessTokenArgs, options?: S2RequestOptions): Promise<unknown>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=accessTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessTokens.d.ts","sourceRoot":"","sources":["../src/accessTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EACN,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EAEzB,KAAK,qBAAqB,EAE1B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,WAAW,oBAChB,SAAQ,YAAY,CAAC,oBAAoB,CAAC;CAAG;AAC9C,MAAM,WAAW,oBAChB,SAAQ,YAAY,CAAC,oBAAoB,CAAC;CAAG;AAC9C,MAAM,WAAW,qBAChB,SAAQ,YAAY,CAAC,qBAAqB,CAAC;CAAG;AAE/C,qBAAa,cAAc;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;IAI1B;;;;;;OAMG;IACU,IAAI,CAAC,IAAI,CAAC,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkBzE;;;;;;;OAOG;IACU,KAAK,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkBzE;;;;OAIG;IACU,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,gBAAgB;CAiB3E"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { S2Error } from "./error";
|
|
2
|
+
import { issueAccessToken, listAccessTokens, revokeAccessToken, } from "./generated";
|
|
3
|
+
export class S2AccessTokens {
|
|
4
|
+
client;
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List access tokens.
|
|
10
|
+
*
|
|
11
|
+
* @param args.prefix Filter to IDs beginning with this prefix
|
|
12
|
+
* @param args.start_after Filter to IDs lexicographically after this value
|
|
13
|
+
* @param args.limit Max results (up to 1000)
|
|
14
|
+
*/
|
|
15
|
+
async list(args, options) {
|
|
16
|
+
const response = await listAccessTokens({
|
|
17
|
+
client: this.client,
|
|
18
|
+
query: args,
|
|
19
|
+
...options,
|
|
20
|
+
});
|
|
21
|
+
if (response.error) {
|
|
22
|
+
throw new S2Error({
|
|
23
|
+
message: response.error.message,
|
|
24
|
+
code: response.error.code ?? undefined,
|
|
25
|
+
status: response.response.status,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Issue a new access token.
|
|
32
|
+
*
|
|
33
|
+
* @param args.id Unique token ID (1-96 bytes)
|
|
34
|
+
* @param args.scope Token scope (operations and resource sets)
|
|
35
|
+
* @param args.auto_prefix_streams Namespace stream names by configured prefix scope
|
|
36
|
+
* @param args.expires_at Expiration in ISO 8601; defaults to requestor's token expiry
|
|
37
|
+
*/
|
|
38
|
+
async issue(args, options) {
|
|
39
|
+
const response = await issueAccessToken({
|
|
40
|
+
client: this.client,
|
|
41
|
+
body: args,
|
|
42
|
+
...options,
|
|
43
|
+
});
|
|
44
|
+
if (response.error) {
|
|
45
|
+
throw new S2Error({
|
|
46
|
+
message: response.error.message,
|
|
47
|
+
code: response.error.code ?? undefined,
|
|
48
|
+
status: response.response.status,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return response.data;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Revoke an access token by ID.
|
|
55
|
+
*
|
|
56
|
+
* @param args.id Token ID to revoke
|
|
57
|
+
*/
|
|
58
|
+
async revoke(args, options) {
|
|
59
|
+
const response = await revokeAccessToken({
|
|
60
|
+
client: this.client,
|
|
61
|
+
path: args,
|
|
62
|
+
...options,
|
|
63
|
+
});
|
|
64
|
+
if (response.error) {
|
|
65
|
+
throw new S2Error({
|
|
66
|
+
message: response.error.message,
|
|
67
|
+
code: response.error.code ?? undefined,
|
|
68
|
+
status: response.response.status,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return response.data;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=accessTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessTokens.js","sourceRoot":"","sources":["../src/accessTokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAEN,gBAAgB,EAEhB,gBAAgB,EAEhB,iBAAiB,GACjB,MAAM,aAAa,CAAC;AAUrB,MAAM,OAAO,cAAc;IACjB,MAAM,CAAS;IAExB,YAAY,MAAc;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,IAAI,CAAC,IAA2B,EAAE,OAA0B;QACxE,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC;YACvC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI;YACX,GAAG,OAAO;SACV,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpB,MAAM,IAAI,OAAO,CAAC;gBACjB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO;gBAC/B,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS;gBACtC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM;aAChC,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,KAAK,CAAC,IAA0B,EAAE,OAA0B;QACxE,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC;YACvC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI;YACV,GAAG,OAAO;SACV,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpB,MAAM,IAAI,OAAO,CAAC;gBACjB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO;gBAC/B,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS;gBACtC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM;aAChC,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,MAAM,CAAC,IAA2B,EAAE,OAA0B;QAC1E,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC;YACxC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI;YACV,GAAG,OAAO;SACV,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpB,MAAM,IAAI,OAAO,CAAC;gBACjB,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO;gBAC/B,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS;gBACtC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM;aAChC,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;CACD"}
|
package/dist/basin.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Redacted } from "effect";
|
|
2
|
+
import { S2Stream } from "./stream";
|
|
3
|
+
import { S2Streams } from "./streams";
|
|
4
|
+
export declare class S2Basin {
|
|
5
|
+
private readonly client;
|
|
6
|
+
private readonly accessToken;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly streams: S2Streams;
|
|
9
|
+
/**
|
|
10
|
+
* Create a basin-scoped client that talks to `https://{basin}.b.aws.s2.dev/v1`.
|
|
11
|
+
*
|
|
12
|
+
* Use this to work with streams inside a single basin.
|
|
13
|
+
* @param name Basin name
|
|
14
|
+
* @param accessToken Redacted access token from the parent `S2` client
|
|
15
|
+
*/
|
|
16
|
+
constructor(name: string, options: {
|
|
17
|
+
accessToken: Redacted.Redacted;
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Create a stream-scoped helper bound to `this` basin.
|
|
22
|
+
* @param name Stream name
|
|
23
|
+
*/
|
|
24
|
+
stream(name: string): S2Stream;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=basin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basin.d.ts","sourceRoot":"","sources":["../src/basin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,qBAAa,OAAO;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAEhD,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,OAAO,EAAE,SAAS,CAAC;IAEnC;;;;;;OAMG;gBAEF,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,WAAW,EAAE,QAAQ,CAAC,QAAQ,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAa7D;;;OAGG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM;CAG1B"}
|
package/dist/basin.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Redacted } from "effect";
|
|
2
|
+
import { createClient, createConfig } from "./generated/client";
|
|
3
|
+
import { S2Stream } from "./stream";
|
|
4
|
+
import { S2Streams } from "./streams";
|
|
5
|
+
export class S2Basin {
|
|
6
|
+
client;
|
|
7
|
+
accessToken;
|
|
8
|
+
name;
|
|
9
|
+
streams;
|
|
10
|
+
/**
|
|
11
|
+
* Create a basin-scoped client that talks to `https://{basin}.b.aws.s2.dev/v1`.
|
|
12
|
+
*
|
|
13
|
+
* Use this to work with streams inside a single basin.
|
|
14
|
+
* @param name Basin name
|
|
15
|
+
* @param accessToken Redacted access token from the parent `S2` client
|
|
16
|
+
*/
|
|
17
|
+
constructor(name, options) {
|
|
18
|
+
this.name = name;
|
|
19
|
+
this.accessToken = options.accessToken;
|
|
20
|
+
this.client = createClient(createConfig({
|
|
21
|
+
baseUrl: options.baseUrl,
|
|
22
|
+
auth: () => Redacted.value(this.accessToken),
|
|
23
|
+
}));
|
|
24
|
+
this.streams = new S2Streams(this.client);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a stream-scoped helper bound to `this` basin.
|
|
28
|
+
* @param name Stream name
|
|
29
|
+
*/
|
|
30
|
+
stream(name) {
|
|
31
|
+
return new S2Stream(name, this.client);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=basin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basin.js","sourceRoot":"","sources":["../src/basin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,OAAO,OAAO;IACF,MAAM,CAAS;IACf,WAAW,CAAoB;IAEhC,IAAI,CAAS;IACb,OAAO,CAAY;IAEnC;;;;;;OAMG;IACH,YACC,IAAY,EACZ,OAA4D;QAE5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,YAAY,CACzB,YAAY,CAAC;YACZ,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;SAC5C,CAAC,CACF,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAY;QACzB,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACD"}
|
package/dist/basins.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { DataToObject, S2RequestOptions } from "./common";
|
|
2
|
+
import { type CreateBasinData, type DeleteBasinData, type GetBasinConfigData, type ListBasinsData, type ReconfigureBasinData } from "./generated";
|
|
3
|
+
import type { Client } from "./generated/client/types.gen";
|
|
4
|
+
export interface ListBasinsArgs extends DataToObject<ListBasinsData> {
|
|
5
|
+
}
|
|
6
|
+
export interface CreateBasinArgs extends DataToObject<CreateBasinData> {
|
|
7
|
+
}
|
|
8
|
+
export interface GetBasinConfigArgs extends DataToObject<GetBasinConfigData> {
|
|
9
|
+
}
|
|
10
|
+
export interface DeleteBasinArgs extends DataToObject<DeleteBasinData> {
|
|
11
|
+
}
|
|
12
|
+
export interface ReconfigureBasinArgs extends DataToObject<ReconfigureBasinData> {
|
|
13
|
+
}
|
|
14
|
+
export declare class S2Basins {
|
|
15
|
+
private readonly client;
|
|
16
|
+
constructor(client: Client);
|
|
17
|
+
/**
|
|
18
|
+
* List basins.
|
|
19
|
+
*
|
|
20
|
+
* @param args.prefix Return basins whose names start with the given prefix
|
|
21
|
+
* @param args.start_after Name to start after (for pagination)
|
|
22
|
+
* @param args.limit Max results (up to 1000)
|
|
23
|
+
*/
|
|
24
|
+
list(args?: ListBasinsArgs, options?: S2RequestOptions): Promise<import("./generated").ListBasinsResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a basin.
|
|
27
|
+
*
|
|
28
|
+
* @param args.basin Globally unique basin name (8-48 chars, lowercase letters, numbers, hyphens; cannot begin or end with a hyphen)
|
|
29
|
+
* @param args.config Optional basin configuration (e.g. default stream config)
|
|
30
|
+
* @param args.scope Basin scope
|
|
31
|
+
*/
|
|
32
|
+
create(args: CreateBasinArgs, options?: S2RequestOptions): Promise<import("./generated").BasinInfo>;
|
|
33
|
+
/**
|
|
34
|
+
* Get basin configuration.
|
|
35
|
+
*
|
|
36
|
+
* @param args.basin Basin name
|
|
37
|
+
*/
|
|
38
|
+
getConfig(args: GetBasinConfigArgs, options?: S2RequestOptions): Promise<import("./generated").BasinConfig>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete a basin.
|
|
41
|
+
*
|
|
42
|
+
* @param args.basin Basin name
|
|
43
|
+
*/
|
|
44
|
+
delete(args: DeleteBasinArgs, options?: S2RequestOptions): Promise<unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* Reconfigure a basin.
|
|
47
|
+
*
|
|
48
|
+
* @param args.basin Basin name
|
|
49
|
+
* @param args.body Configuration fields to change (e.g. default stream config)
|
|
50
|
+
*/
|
|
51
|
+
reconfigure(args: ReconfigureBasinArgs, options?: S2RequestOptions): Promise<import("./generated").BasinConfig>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=basins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basins.d.ts","sourceRoot":"","sources":["../src/basins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EACN,KAAK,eAAe,EAEpB,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EAEvB,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAEzB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,cAAc,CAAC;CAAG;AACvE,MAAM,WAAW,eAAgB,SAAQ,YAAY,CAAC,eAAe,CAAC;CAAG;AACzE,MAAM,WAAW,kBAAmB,SAAQ,YAAY,CAAC,kBAAkB,CAAC;CAAG;AAC/E,MAAM,WAAW,eAAgB,SAAQ,YAAY,CAAC,eAAe,CAAC;CAAG;AACzE,MAAM,WAAW,oBAChB,SAAQ,YAAY,CAAC,oBAAoB,CAAC;CAAG;AAE9C,qBAAa,QAAQ;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,MAAM;IAI1B;;;;;;OAMG;IACU,IAAI,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkBnE;;;;;;OAMG;IACU,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkBrE;;;;OAIG;IACU,SAAS,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkB3E;;;;OAIG;IACU,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkBrE;;;;;OAKG;IACU,WAAW,CACvB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,gBAAgB;CAmB3B"}
|
package/dist/basins.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { S2Error } from "./error";
|
|
2
|
+
import { createBasin, deleteBasin, getBasinConfig, listBasins, reconfigureBasin, } from "./generated";
|
|
3
|
+
export class S2Basins {
|
|
4
|
+
client;
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* List basins.
|
|
10
|
+
*
|
|
11
|
+
* @param args.prefix Return basins whose names start with the given prefix
|
|
12
|
+
* @param args.start_after Name to start after (for pagination)
|
|
13
|
+
* @param args.limit Max results (up to 1000)
|
|
14
|
+
*/
|
|
15
|
+
async list(args, options) {
|
|
16
|
+
const response = await listBasins({
|
|
17
|
+
client: this.client,
|
|
18
|
+
query: args,
|
|
19
|
+
...options,
|
|
20
|
+
});
|
|
21
|
+
if (response.error) {
|
|
22
|
+
throw new S2Error({
|
|
23
|
+
message: response.error.message,
|
|
24
|
+
code: response.error.code ?? undefined,
|
|
25
|
+
status: response.response.status,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return response.data;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a basin.
|
|
32
|
+
*
|
|
33
|
+
* @param args.basin Globally unique basin name (8-48 chars, lowercase letters, numbers, hyphens; cannot begin or end with a hyphen)
|
|
34
|
+
* @param args.config Optional basin configuration (e.g. default stream config)
|
|
35
|
+
* @param args.scope Basin scope
|
|
36
|
+
*/
|
|
37
|
+
async create(args, options) {
|
|
38
|
+
const response = await createBasin({
|
|
39
|
+
client: this.client,
|
|
40
|
+
body: args,
|
|
41
|
+
...options,
|
|
42
|
+
});
|
|
43
|
+
if (response.error) {
|
|
44
|
+
throw new S2Error({
|
|
45
|
+
message: response.error.message,
|
|
46
|
+
code: response.error.code ?? undefined,
|
|
47
|
+
status: response.response.status,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return response.data;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get basin configuration.
|
|
54
|
+
*
|
|
55
|
+
* @param args.basin Basin name
|
|
56
|
+
*/
|
|
57
|
+
async getConfig(args, options) {
|
|
58
|
+
const response = await getBasinConfig({
|
|
59
|
+
client: this.client,
|
|
60
|
+
path: args,
|
|
61
|
+
...options,
|
|
62
|
+
});
|
|
63
|
+
if (response.error) {
|
|
64
|
+
throw new S2Error({
|
|
65
|
+
message: response.error.message,
|
|
66
|
+
code: response.error.code ?? undefined,
|
|
67
|
+
status: response.response.status,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return response.data;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Delete a basin.
|
|
74
|
+
*
|
|
75
|
+
* @param args.basin Basin name
|
|
76
|
+
*/
|
|
77
|
+
async delete(args, options) {
|
|
78
|
+
const response = await deleteBasin({
|
|
79
|
+
client: this.client,
|
|
80
|
+
path: args,
|
|
81
|
+
...options,
|
|
82
|
+
});
|
|
83
|
+
if (response.error) {
|
|
84
|
+
throw new S2Error({
|
|
85
|
+
message: response.error.message,
|
|
86
|
+
code: response.error.code ?? undefined,
|
|
87
|
+
status: response.response.status,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return response.data;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Reconfigure a basin.
|
|
94
|
+
*
|
|
95
|
+
* @param args.basin Basin name
|
|
96
|
+
* @param args.body Configuration fields to change (e.g. default stream config)
|
|
97
|
+
*/
|
|
98
|
+
async reconfigure(args, options) {
|
|
99
|
+
const response = await reconfigureBasin({
|
|
100
|
+
client: this.client,
|
|
101
|
+
path: args,
|
|
102
|
+
body: args,
|
|
103
|
+
...options,
|
|
104
|
+
});
|
|
105
|
+
if (response.error) {
|
|
106
|
+
throw new S2Error({
|
|
107
|
+
message: response.error.message,
|
|
108
|
+
code: response.error.code ?? undefined,
|
|
109
|
+
status: response.response.status,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return response.data;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=basins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basins.js","sourceRoot":"","sources":["../src/basins.ts"],"names":[],"mappings":"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"}
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for constructing the top-level `S2` client.
|
|
3
|
+
*
|
|
4
|
+
* - The client authenticates using a Bearer access token on every request.
|
|
5
|
+
*/
|
|
6
|
+
export type S2ClientOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* Access token used for HTTP Bearer authentication.
|
|
9
|
+
* Typically obtained via your S2 account or created using `s2.accessTokens.issue`.
|
|
10
|
+
*/
|
|
11
|
+
accessToken: string;
|
|
12
|
+
/**
|
|
13
|
+
* Base URL for the S2 API.
|
|
14
|
+
* Defaults to `https://aws.s2.dev`.
|
|
15
|
+
*/
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Function to make a basin-specific base URL.
|
|
19
|
+
* Defaults to `https://{basin}.b.aws.s2.dev`.
|
|
20
|
+
*/
|
|
21
|
+
makeBasinBaseUrl?: (basin: string) => string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Per-request options that apply to all SDK operations.
|
|
25
|
+
*/
|
|
26
|
+
export type S2RequestOptions = {
|
|
27
|
+
/**
|
|
28
|
+
* Optional abort signal to cancel the underlying HTTP request.
|
|
29
|
+
*/
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Helper type that flattens an endpoint's `body`, `path` and `query` into a
|
|
34
|
+
* single object. This lets public methods accept one coherent argument object
|
|
35
|
+
* instead of three separate bags.
|
|
36
|
+
*/
|
|
37
|
+
export type DataToObject<T> = (T extends {
|
|
38
|
+
body?: infer B;
|
|
39
|
+
} ? B extends undefined | never ? {} : B : {}) & (T extends {
|
|
40
|
+
path?: infer P;
|
|
41
|
+
} ? (P extends undefined | never ? {} : P) : {}) & (T extends {
|
|
42
|
+
query?: infer Q;
|
|
43
|
+
} ? (Q extends undefined | never ? {} : Q) : {});
|
|
44
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,GACxD,CAAC,SAAS,SAAS,GAAG,KAAK,GAC1B,EAAE,GACF,CAAC,GACF,EAAE,CAAC,GACL,CAAC,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAC5E,CAAC,CAAC,SAAS;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC"}
|
package/dist/common.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":""}
|