@bunny.net/api-client-effect-v4-magic-containers 0.0.0-stage → 1.3.202611121515
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 +21 -0
- package/README.md +75 -2
- package/dist/mod.d.ts +29 -0
- package/dist/mod.js +29 -0
- package/dist/mod.js.map +1 -0
- package/dist/src/generated/client.d.ts +8954 -0
- package/dist/src/generated/client.js +1663 -0
- package/dist/src/generated/client.js.map +1 -0
- package/dist/src/generated/schemas.d.ts +2459 -0
- package/dist/src/generated/schemas.js +746 -0
- package/dist/src/generated/schemas.js.map +1 -0
- package/package.json +43 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bunny.net
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://bunny.net">
|
|
3
|
+
<img src="https://github.com/BunnyWay/bunnynet-typescript/blob/main/asset/bunny.png?raw=true" width="500" height="auto" alt="Bunny"/>
|
|
4
|
+
</a>
|
|
5
|
+
</div>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
# Bunny Magic Containers API client for Effect 4
|
|
8
|
+
|
|
9
|
+
This package contains `@bunny.net/api-client-effect-v4-magic-containers`, the
|
|
10
|
+
Bunny Magic Containers API as an [Effect](https://effect.website) service: apps,
|
|
11
|
+
containers, endpoints, volumes, autoscaling, registries, regions and log
|
|
12
|
+
forwarding. It is generated from the official OpenAPI spec, so there is one
|
|
13
|
+
method per endpoint, a schema per model and a typed error per documented status.
|
|
14
|
+
|
|
15
|
+
Effect 3 or 4? This package is the Effect 4 flavour (`effect` 4, HTTP client
|
|
16
|
+
from `effect/http`). On Effect 3, install
|
|
17
|
+
`@bunny.net/api-client-effect-magic-containers` instead; the exported names are
|
|
18
|
+
the same.
|
|
19
|
+
|
|
20
|
+
## 🥕 Usage
|
|
21
|
+
|
|
22
|
+
Install it together with `effect`:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install @bunny.net/api-client-effect-v4-magic-containers effect
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Listing your apps
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { Effect, Layer } from "effect";
|
|
32
|
+
import { FetchHttpClient } from "effect/http";
|
|
33
|
+
import { BunnyMagicContainers } from "@bunny.net/api-client-effect-v4-magic-containers";
|
|
34
|
+
import { BunnyCredentials } from "@bunny.net/api-client-effect-v4-runtime";
|
|
35
|
+
|
|
36
|
+
const program = Effect.gen(function* () {
|
|
37
|
+
const mc = yield* BunnyMagicContainers;
|
|
38
|
+
const apps = yield* mc.listApplications({ query: { limit: 10 } });
|
|
39
|
+
for (const app of apps.value.items ?? []) {
|
|
40
|
+
console.log(app.id, app.name);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const Live = BunnyMagicContainers.Default.pipe(
|
|
45
|
+
Layer.provide(BunnyCredentials.fromEnv()), // reads BUNNY_API_KEY
|
|
46
|
+
Layer.provide(FetchHttpClient.layer),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
await Effect.runPromise(program.pipe(Effect.provide(Live)));
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`BunnyMagicContainers.Default` talks to `https://api.bunny.net/mc`;
|
|
53
|
+
`BunnyMagicContainers.layer({ baseUrl })` targets another host. Every method
|
|
54
|
+
returns `{ status, value }` typed by the documented success statuses. A
|
|
55
|
+
documented error status fails with `BunnyResponseError`, carrying the status and
|
|
56
|
+
the decoded body, and anything else with another `BunnyClientError`. Transport
|
|
57
|
+
failures come through as Effect's own `HttpClientError` from `effect/http`, so
|
|
58
|
+
retries, timeouts and tracing are whatever your `HttpClient` layer does.
|
|
59
|
+
|
|
60
|
+
The package exports the service, `securitySchemes`, the component schemas and
|
|
61
|
+
the per-operation `*Input` types. The spec names several response schemas like
|
|
62
|
+
per-operation aliases, so the response aliases are not re-exported. The same API
|
|
63
|
+
with Zod schemas instead of Effect is
|
|
64
|
+
`@bunny.net/api-client-zod-magic-containers`. On Deno, import
|
|
65
|
+
`npm:@bunny.net/api-client-effect-v4-magic-containers`.
|
|
66
|
+
|
|
67
|
+
Versions are `<spec major>.<minor>.<fetch time>`: a breaking change in Bunny's
|
|
68
|
+
spec raises the minor, so the caret range `npm install` writes follows breaking
|
|
69
|
+
upstream changes; depend with `~` to review them first.
|
|
70
|
+
|
|
71
|
+
## 🔧 Contributing
|
|
72
|
+
|
|
73
|
+
This package is generated from the official OpenAPI spec and versioned from it.
|
|
74
|
+
How to regenerate it, how versions are derived and how to run the checks is
|
|
75
|
+
described in
|
|
76
|
+
[docs/human_development.md](https://github.com/BunnyWay/bunnynet-typescript/blob/main/docs/human_development.md).
|
package/dist/mod.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated barrel for the Bunny Magic Containers API — `/apps/*`
|
|
3
|
+
* (application lifecycle, deploy/undeploy, containers, endpoints,
|
|
4
|
+
* volumes, autoscaling, region settings), `/registries/*` (container
|
|
5
|
+
* registries + image search), and `/regions`, `/nodes`, `/limits`,
|
|
6
|
+
* `/log/forwarding`.
|
|
7
|
+
*
|
|
8
|
+
* `./src/generated/{schemas,client}.ts` are produced by
|
|
9
|
+
* `pnpm codegen:magic-containers-effect-v4` from
|
|
10
|
+
* `https://api-mc.opsbunny.net/docs/public/swagger.json`, whose documented
|
|
11
|
+
* server is the production host `https://api.bunny.net/mc`.
|
|
12
|
+
* Do not hand-edit them — a re-run overwrites both.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: unlike the core/compute barrels, this one does NOT blanket
|
|
15
|
+
* `export *` from BOTH generated files. This spec names ~10 response
|
|
16
|
+
* component schemas (e.g. `ListApplicationsResponse`) identically to the
|
|
17
|
+
* per-operation response TYPE aliases the client generates, which makes
|
|
18
|
+
* a double `export *` ambiguous. Component schemas (from `schemas.ts`)
|
|
19
|
+
* are the canonical shapes consumers want, so we export those wholesale
|
|
20
|
+
* and re-export only the client's RUNTIME surface (the service class and `securitySchemes`).
|
|
21
|
+
* The per-op response aliases stay internal to `client.ts`; consumers
|
|
22
|
+
* read responses structurally.
|
|
23
|
+
*
|
|
24
|
+
* When live Bunny drifts from the spec, follow the patches pattern
|
|
25
|
+
* (docs/agent_development.md, "Codegen and drift patches").
|
|
26
|
+
*/
|
|
27
|
+
export * from "./src/generated/schemas.js";
|
|
28
|
+
export { BunnyMagicContainers, type BunnyMagicContainersService, securitySchemes, } from "./src/generated/client.js";
|
|
29
|
+
export type { AddApplicationEndpointInput, AddApplicationInput, SearchForPublicContainerImagesInput, UpdateApplicationAutoscalingInput, UpdateApplicationEndpointInput, UpdateApplicationInput, UpdateApplicationRegionSettingsInput, UpdateLogForwardingConfigurationInput, } from "./src/generated/client.js";
|
package/dist/mod.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated barrel for the Bunny Magic Containers API — `/apps/*`
|
|
3
|
+
* (application lifecycle, deploy/undeploy, containers, endpoints,
|
|
4
|
+
* volumes, autoscaling, region settings), `/registries/*` (container
|
|
5
|
+
* registries + image search), and `/regions`, `/nodes`, `/limits`,
|
|
6
|
+
* `/log/forwarding`.
|
|
7
|
+
*
|
|
8
|
+
* `./src/generated/{schemas,client}.ts` are produced by
|
|
9
|
+
* `pnpm codegen:magic-containers-effect-v4` from
|
|
10
|
+
* `https://api-mc.opsbunny.net/docs/public/swagger.json`, whose documented
|
|
11
|
+
* server is the production host `https://api.bunny.net/mc`.
|
|
12
|
+
* Do not hand-edit them — a re-run overwrites both.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: unlike the core/compute barrels, this one does NOT blanket
|
|
15
|
+
* `export *` from BOTH generated files. This spec names ~10 response
|
|
16
|
+
* component schemas (e.g. `ListApplicationsResponse`) identically to the
|
|
17
|
+
* per-operation response TYPE aliases the client generates, which makes
|
|
18
|
+
* a double `export *` ambiguous. Component schemas (from `schemas.ts`)
|
|
19
|
+
* are the canonical shapes consumers want, so we export those wholesale
|
|
20
|
+
* and re-export only the client's RUNTIME surface (the service class and `securitySchemes`).
|
|
21
|
+
* The per-op response aliases stay internal to `client.ts`; consumers
|
|
22
|
+
* read responses structurally.
|
|
23
|
+
*
|
|
24
|
+
* When live Bunny drifts from the spec, follow the patches pattern
|
|
25
|
+
* (docs/agent_development.md, "Codegen and drift patches").
|
|
26
|
+
*/
|
|
27
|
+
export * from "./src/generated/schemas.js";
|
|
28
|
+
export { BunnyMagicContainers, securitySchemes, } from "./src/generated/client.js";
|
|
29
|
+
//# sourceMappingURL=mod.js.map
|
package/dist/mod.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACL,oBAAoB,EAEpB,eAAe,GAChB,MAAM,2BAA2B,CAAC","sourcesContent":["/**\n * Curated barrel for the Bunny Magic Containers API — `/apps/*`\n * (application lifecycle, deploy/undeploy, containers, endpoints,\n * volumes, autoscaling, region settings), `/registries/*` (container\n * registries + image search), and `/regions`, `/nodes`, `/limits`,\n * `/log/forwarding`.\n *\n * `./src/generated/{schemas,client}.ts` are produced by\n * `pnpm codegen:magic-containers-effect-v4` from\n * `https://api-mc.opsbunny.net/docs/public/swagger.json`, whose documented\n * server is the production host `https://api.bunny.net/mc`.\n * Do not hand-edit them — a re-run overwrites both.\n *\n * NOTE: unlike the core/compute barrels, this one does NOT blanket\n * `export *` from BOTH generated files. This spec names ~10 response\n * component schemas (e.g. `ListApplicationsResponse`) identically to the\n * per-operation response TYPE aliases the client generates, which makes\n * a double `export *` ambiguous. Component schemas (from `schemas.ts`)\n * are the canonical shapes consumers want, so we export those wholesale\n * and re-export only the client's RUNTIME surface (the service class and `securitySchemes`).\n * The per-op response aliases stay internal to `client.ts`; consumers\n * read responses structurally.\n *\n * When live Bunny drifts from the spec, follow the patches pattern\n * (docs/agent_development.md, \"Codegen and drift patches\").\n */\nexport * from \"./src/generated/schemas.ts\";\nexport {\n BunnyMagicContainers,\n type BunnyMagicContainersService,\n securitySchemes,\n} from \"./src/generated/client.ts\";\n// Per-operation Input TYPES are safe to re-export: the collision that\n// forces the narrow barrel above is on RESPONSE type aliases (this spec\n// names several response component schemas identically to per-operation\n// response aliases), not on these `*Input` types.\nexport type {\n AddApplicationEndpointInput,\n AddApplicationInput,\n SearchForPublicContainerImagesInput,\n UpdateApplicationAutoscalingInput,\n UpdateApplicationEndpointInput,\n UpdateApplicationInput,\n UpdateApplicationRegionSettingsInput,\n UpdateLogForwardingConfigurationInput,\n} from \"./src/generated/client.ts\";\n"]}
|