@storyblok/api-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/error.cjs +21 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.cts +19 -0
- package/dist/error.d.mts +19 -0
- package/dist/error.mjs +20 -0
- package/dist/error.mjs.map +1 -0
- package/dist/generated/datasource_entries/client.gen.cjs +10 -0
- package/dist/generated/datasource_entries/client.gen.cjs.map +1 -0
- package/dist/generated/datasource_entries/client.gen.mjs +10 -0
- package/dist/generated/datasource_entries/client.gen.mjs.map +1 -0
- package/dist/generated/datasource_entries/sdk.gen.cjs +21 -0
- package/dist/generated/datasource_entries/sdk.gen.cjs.map +1 -0
- package/dist/generated/datasource_entries/sdk.gen.mjs +21 -0
- package/dist/generated/datasource_entries/sdk.gen.mjs.map +1 -0
- package/dist/generated/datasource_entries/types.gen.d.cts +67 -0
- package/dist/generated/datasource_entries/types.gen.d.mts +67 -0
- package/dist/generated/datasources/client.gen.cjs +10 -0
- package/dist/generated/datasources/client.gen.cjs.map +1 -0
- package/dist/generated/datasources/client.gen.mjs +10 -0
- package/dist/generated/datasources/client.gen.mjs.map +1 -0
- package/dist/generated/datasources/sdk.gen.cjs +36 -0
- package/dist/generated/datasources/sdk.gen.cjs.map +1 -0
- package/dist/generated/datasources/sdk.gen.mjs +35 -0
- package/dist/generated/datasources/sdk.gen.mjs.map +1 -0
- package/dist/generated/datasources/types.gen.d.cts +109 -0
- package/dist/generated/datasources/types.gen.d.mts +109 -0
- package/dist/generated/links/client.gen.cjs +10 -0
- package/dist/generated/links/client.gen.cjs.map +1 -0
- package/dist/generated/links/client.gen.mjs +10 -0
- package/dist/generated/links/client.gen.mjs.map +1 -0
- package/dist/generated/links/sdk.gen.cjs +21 -0
- package/dist/generated/links/sdk.gen.cjs.map +1 -0
- package/dist/generated/links/sdk.gen.mjs +21 -0
- package/dist/generated/links/sdk.gen.mjs.map +1 -0
- package/dist/generated/links/types.gen.d.cts +142 -0
- package/dist/generated/links/types.gen.d.mts +142 -0
- package/dist/generated/shared/client/client.gen.cjs +215 -0
- package/dist/generated/shared/client/client.gen.cjs.map +1 -0
- package/dist/generated/shared/client/client.gen.mjs +213 -0
- package/dist/generated/shared/client/client.gen.mjs.map +1 -0
- package/dist/generated/shared/client/index.cjs +4 -0
- package/dist/generated/shared/client/index.mjs +6 -0
- package/dist/generated/shared/client/types.gen.d.cts +103 -0
- package/dist/generated/shared/client/types.gen.d.mts +103 -0
- package/dist/generated/shared/client/utils.gen.cjs +188 -0
- package/dist/generated/shared/client/utils.gen.cjs.map +1 -0
- package/dist/generated/shared/client/utils.gen.d.cts +21 -0
- package/dist/generated/shared/client/utils.gen.d.mts +21 -0
- package/dist/generated/shared/client/utils.gen.mjs +182 -0
- package/dist/generated/shared/client/utils.gen.mjs.map +1 -0
- package/dist/generated/shared/core/auth.gen.cjs +13 -0
- package/dist/generated/shared/core/auth.gen.cjs.map +1 -0
- package/dist/generated/shared/core/auth.gen.d.cts +21 -0
- package/dist/generated/shared/core/auth.gen.d.mts +21 -0
- package/dist/generated/shared/core/auth.gen.mjs +12 -0
- package/dist/generated/shared/core/auth.gen.mjs.map +1 -0
- package/dist/generated/shared/core/bodySerializer.gen.cjs +7 -0
- package/dist/generated/shared/core/bodySerializer.gen.cjs.map +1 -0
- package/dist/generated/shared/core/bodySerializer.gen.d.cts +20 -0
- package/dist/generated/shared/core/bodySerializer.gen.d.mts +20 -0
- package/dist/generated/shared/core/bodySerializer.gen.mjs +6 -0
- package/dist/generated/shared/core/bodySerializer.gen.mjs.map +1 -0
- package/dist/generated/shared/core/params.gen.cjs +11 -0
- package/dist/generated/shared/core/params.gen.cjs.map +1 -0
- package/dist/generated/shared/core/params.gen.mjs +11 -0
- package/dist/generated/shared/core/params.gen.mjs.map +1 -0
- package/dist/generated/shared/core/pathSerializer.gen.cjs +85 -0
- package/dist/generated/shared/core/pathSerializer.gen.cjs.map +1 -0
- package/dist/generated/shared/core/pathSerializer.gen.d.cts +13 -0
- package/dist/generated/shared/core/pathSerializer.gen.d.mts +13 -0
- package/dist/generated/shared/core/pathSerializer.gen.mjs +82 -0
- package/dist/generated/shared/core/pathSerializer.gen.mjs.map +1 -0
- package/dist/generated/shared/core/serverSentEvents.gen.cjs +96 -0
- package/dist/generated/shared/core/serverSentEvents.gen.cjs.map +1 -0
- package/dist/generated/shared/core/serverSentEvents.gen.d.cts +72 -0
- package/dist/generated/shared/core/serverSentEvents.gen.d.mts +72 -0
- package/dist/generated/shared/core/serverSentEvents.gen.mjs +95 -0
- package/dist/generated/shared/core/serverSentEvents.gen.mjs.map +1 -0
- package/dist/generated/shared/core/types.gen.d.cts +61 -0
- package/dist/generated/shared/core/types.gen.d.mts +61 -0
- package/dist/generated/shared/core/utils.gen.cjs +80 -0
- package/dist/generated/shared/core/utils.gen.cjs.map +1 -0
- package/dist/generated/shared/core/utils.gen.mjs +79 -0
- package/dist/generated/shared/core/utils.gen.mjs.map +1 -0
- package/dist/generated/spaces/client.gen.cjs +10 -0
- package/dist/generated/spaces/client.gen.cjs.map +1 -0
- package/dist/generated/spaces/client.gen.mjs +10 -0
- package/dist/generated/spaces/client.gen.mjs.map +1 -0
- package/dist/generated/spaces/sdk.gen.cjs +21 -0
- package/dist/generated/spaces/sdk.gen.cjs.map +1 -0
- package/dist/generated/spaces/sdk.gen.mjs +21 -0
- package/dist/generated/spaces/sdk.gen.mjs.map +1 -0
- package/dist/generated/spaces/types.gen.d.cts +34 -0
- package/dist/generated/spaces/types.gen.d.mts +34 -0
- package/dist/generated/stories/client.gen.cjs +10 -0
- package/dist/generated/stories/client.gen.cjs.map +1 -0
- package/dist/generated/stories/client.gen.mjs +10 -0
- package/dist/generated/stories/client.gen.mjs.map +1 -0
- package/dist/generated/stories/sdk.gen.cjs +36 -0
- package/dist/generated/stories/sdk.gen.cjs.map +1 -0
- package/dist/generated/stories/sdk.gen.mjs +35 -0
- package/dist/generated/stories/sdk.gen.mjs.map +1 -0
- package/dist/generated/stories/types.gen.d.cts +544 -0
- package/dist/generated/stories/types.gen.d.mts +544 -0
- package/dist/generated/tags/client.gen.cjs +10 -0
- package/dist/generated/tags/client.gen.cjs.map +1 -0
- package/dist/generated/tags/client.gen.mjs +10 -0
- package/dist/generated/tags/client.gen.mjs.map +1 -0
- package/dist/generated/tags/sdk.gen.cjs +21 -0
- package/dist/generated/tags/sdk.gen.cjs.map +1 -0
- package/dist/generated/tags/sdk.gen.mjs +21 -0
- package/dist/generated/tags/sdk.gen.mjs.map +1 -0
- package/dist/generated/tags/types.gen.d.cts +44 -0
- package/dist/generated/tags/types.gen.d.mts +44 -0
- package/dist/index.cjs +155 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +161 -0
- package/dist/index.d.mts +161 -0
- package/dist/index.mjs +150 -0
- package/dist/index.mjs.map +1 -0
- package/dist/resources/datasource-entries.cjs +22 -0
- package/dist/resources/datasource-entries.cjs.map +1 -0
- package/dist/resources/datasource-entries.mjs +22 -0
- package/dist/resources/datasource-entries.mjs.map +1 -0
- package/dist/resources/datasources.cjs +37 -0
- package/dist/resources/datasources.cjs.map +1 -0
- package/dist/resources/datasources.mjs +37 -0
- package/dist/resources/datasources.mjs.map +1 -0
- package/dist/resources/links.cjs +22 -0
- package/dist/resources/links.cjs.map +1 -0
- package/dist/resources/links.mjs +22 -0
- package/dist/resources/links.mjs.map +1 -0
- package/dist/resources/spaces.cjs +22 -0
- package/dist/resources/spaces.cjs.map +1 -0
- package/dist/resources/spaces.mjs +22 -0
- package/dist/resources/spaces.mjs.map +1 -0
- package/dist/resources/stories.cjs +69 -0
- package/dist/resources/stories.cjs.map +1 -0
- package/dist/resources/stories.d.cts +16 -0
- package/dist/resources/stories.d.mts +16 -0
- package/dist/resources/stories.mjs +69 -0
- package/dist/resources/stories.mjs.map +1 -0
- package/dist/resources/tags.cjs +22 -0
- package/dist/resources/tags.cjs.map +1 -0
- package/dist/resources/tags.mjs +22 -0
- package/dist/resources/tags.mjs.map +1 -0
- package/dist/types.d.cts +19 -0
- package/dist/types.d.mts +19 -0
- package/dist/utils/array.cjs +12 -0
- package/dist/utils/array.cjs.map +1 -0
- package/dist/utils/array.mjs +11 -0
- package/dist/utils/array.mjs.map +1 -0
- package/dist/utils/cache.cjs +73 -0
- package/dist/utils/cache.cjs.map +1 -0
- package/dist/utils/cache.d.cts +26 -0
- package/dist/utils/cache.d.mts +26 -0
- package/dist/utils/cache.mjs +71 -0
- package/dist/utils/cache.mjs.map +1 -0
- package/dist/utils/cv.cjs +19 -0
- package/dist/utils/cv.cjs.map +1 -0
- package/dist/utils/cv.mjs +18 -0
- package/dist/utils/cv.mjs.map +1 -0
- package/dist/utils/fetch-rel-uuids.cjs +45 -0
- package/dist/utils/fetch-rel-uuids.cjs.map +1 -0
- package/dist/utils/fetch-rel-uuids.mjs +45 -0
- package/dist/utils/fetch-rel-uuids.mjs.map +1 -0
- package/dist/utils/inline-relations.cjs +86 -0
- package/dist/utils/inline-relations.cjs.map +1 -0
- package/dist/utils/inline-relations.mjs +84 -0
- package/dist/utils/inline-relations.mjs.map +1 -0
- package/dist/utils/rate-limit.cjs +140 -0
- package/dist/utils/rate-limit.cjs.map +1 -0
- package/dist/utils/rate-limit.d.cts +36 -0
- package/dist/utils/rate-limit.d.mts +36 -0
- package/dist/utils/rate-limit.mjs +137 -0
- package/dist/utils/rate-limit.mjs.map +1 -0
- package/dist/utils/request.cjs +38 -0
- package/dist/utils/request.cjs.map +1 -0
- package/dist/utils/request.mjs +35 -0
- package/dist/utils/request.mjs.map +1 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Storyblok GmbH
|
|
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
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
<h1 align="center">@storyblok/api-client</h1>
|
|
6
|
+
<p>
|
|
7
|
+
A modern TypeScript client for the Storyblok Content Delivery API with built-in caching, retry logic, and rate limiting
|
|
8
|
+
</p>
|
|
9
|
+
<br />
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://npmjs.com/package/@storyblok/api-client">
|
|
14
|
+
<img src="https://img.shields.io/npm/v/@storyblok/api-client/latest.svg?style=flat-square&color=8d60ff" alt="@storyblok/api-client" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://npmjs.com/package/@storyblok/api-client" rel="nofollow">
|
|
17
|
+
<img src="https://img.shields.io/npm/dt/@storyblok/api-client.svg?style=appveyor&color=8d60ff" alt="npm">
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://storyblok.com/join-discord">
|
|
20
|
+
<img src="https://img.shields.io/discord/700316478792138842?label=Join%20Our%20Discord%20Community&style=appveyor&logo=discord&color=8d60ff">
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://twitter.com/intent/follow?screen_name=storyblok">
|
|
23
|
+
<img src="https://img.shields.io/badge/Follow-%40storyblok-8d60ff?style=appveyor&logo=twitter" alt="Follow @Storyblok" />
|
|
24
|
+
</a><br/>
|
|
25
|
+
<a href="https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=@storyblok/api-client">
|
|
26
|
+
<img src="https://img.shields.io/badge/Try%20Storyblok-Free-8d60ff?style=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAHqADAAQAAAABAAAAHgAAAADpiRU/AAACRElEQVRIDWNgGGmAEd3D3Js3LPrP8D8WXZwSPiMjw6qvPoHhyGYwIXNAbGpbCjbzP0MYuj0YFqMroBV/wCxmIeSju64eDNzMBJUxvP/9i2Hnq5cM1devMnz984eQsQwETeRhYWHgIcJiXqC6VHlFBjUeXgav40cIWkz1oLYXFmGwFBImaDFBHyObcOzdW4aSq5eRhRiE2dgYlpuYoYSKJi8vw3GgWnyAJIs/AuPu4scPGObd/fqVQZ+PHy7+6udPOBsXgySLDfn5GRYYmaKYJcXBgWLpsx8/GPa8foWiBhuHJIsl2DkYQqWksZkDFgP5PObcKYYff//iVAOTIDlx/QPqRMb/YSYBaWlOToZIaVkGZmAZSQiQ5OPtwHwacuo4iplMQEu6tXUZMhSUGDiYmBjylFQYvv/7x9B04xqKOnQOyT5GN+Df//8M59ASXKyMHLoyDD5JPtbj42OYrm+EYgg70JfuYuIoYmLs7AwMjIzA+uY/zjAnyWJpDk6GOFnCvrn86SOwmsNtKciVFAc1ileBHFDC67lzG10Yg0+SjzF0ownsf/OaofvOLYaDQJoQIGix94ljv1gIZI8Pv38zPvj2lQWYf3HGKbpDCFp85v07NnRN1OBTPY6JdRSGxcCw2k6sZuLVMZ5AV4s1TozPnGGFKbz+/PE7IJsHmC//MDMyhXBw8e6FyRFLv3Z0/IKuFqvFyIqAzd1PwBzJw8jAGPfVx38JshwlbIygxmYY43/GQmpais0ODDHuzevLMARHBcgIAQAbOJHZW0/EyQAAAABJRU5ErkJggg==" alt="Follow @Storyblok" />
|
|
27
|
+
</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- **Type-Safe**: Generated from OpenAPI specifications with full TypeScript support
|
|
33
|
+
- **Caching**: Pluggable cache providers with `cache-first`, `network-first`, and `swr` strategies
|
|
34
|
+
- **Retry Logic**: Built-in retry with exponential backoff and jitter
|
|
35
|
+
- **Rate Limiting**: Preventive rate limiting with automatic tier detection
|
|
36
|
+
- **Region Support**: Automatic regional endpoint selection (`eu`, `us`, `ap`, `ca`, `cn`)
|
|
37
|
+
- **Relation Inlining**: Optional inlining of resolved relations directly into story content
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
For complete documentation, please visit [package reference](https://www.storyblok.com/docs/packages/storyblok-api-client)
|
|
42
|
+
|
|
43
|
+
## Contributing
|
|
44
|
+
|
|
45
|
+
If you'd like to contribute, please refer to the [contributing guidelines](../../CONTRIBUTING.md).
|
|
46
|
+
|
|
47
|
+
## Community
|
|
48
|
+
|
|
49
|
+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
50
|
+
|
|
51
|
+
- [Discuss Storyblok on GitHub Discussions](https://github.com/storyblok/monoblok/discussions)
|
|
52
|
+
|
|
53
|
+
For community support, chatting with other users, please visit:
|
|
54
|
+
|
|
55
|
+
- [Discuss Storyblok on Discord](https://storyblok.com/join-discord)
|
|
56
|
+
|
|
57
|
+
## Support
|
|
58
|
+
|
|
59
|
+
For bugs or feature requests, please [submit an issue](https://github.com/storyblok/monoblok/issues/new/choose).
|
|
60
|
+
|
|
61
|
+
> [!IMPORTANT]
|
|
62
|
+
> Please search existing issues before submitting a new one. Issues without a minimal reproducible example will be closed. [Why reproductions are Required](https://antfu.me/posts/why-reproductions-are-required).
|
|
63
|
+
|
|
64
|
+
### I can't share my company project code
|
|
65
|
+
|
|
66
|
+
We understand that you might not be able to share your company's project code. Please provide a minimal reproducible example that demonstrates the issue by using tools like [Stackblitz](https://stackblitz.com) or a link to a GitHub repo. Please make sure you include a README file with the instructions to build and run the project, important not to include any access token, password or personal information of any kind.
|
|
67
|
+
|
|
68
|
+
### Feedback
|
|
69
|
+
|
|
70
|
+
If you have a question, please ask in the [Discuss Storyblok on Discord](https://storyblok.com/join-discord) channel.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
[License](/LICENSE)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/dist/error.cjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/error.ts
|
|
3
|
+
/**
|
|
4
|
+
* Structured HTTP error thrown by the Content API client when `throwOnError: true`.
|
|
5
|
+
*/
|
|
6
|
+
var ClientError = class extends Error {
|
|
7
|
+
response;
|
|
8
|
+
constructor(message, options) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "ClientError";
|
|
11
|
+
this.response = {
|
|
12
|
+
status: options.status,
|
|
13
|
+
statusText: options.statusText,
|
|
14
|
+
data: options.data
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.ClientError = ClientError;
|
|
21
|
+
//# sourceMappingURL=error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.cjs","names":[],"sources":["../src/error.ts"],"sourcesContent":["/**\n * Structured HTTP error thrown by the Content API client when `throwOnError: true`.\n */\nexport class ClientError extends Error {\n readonly response: { status: number; statusText: string; data: unknown };\n\n constructor(\n message: string,\n options: { status: number; statusText: string; data: unknown },\n ) {\n super(message);\n this.name = 'ClientError';\n this.response = {\n status: options.status,\n statusText: options.statusText,\n data: options.data,\n };\n }\n}\n"],"mappings":";;;;;AAGA,IAAa,cAAb,cAAiC,MAAM;CACrC,AAAS;CAET,YACE,SACA,SACA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,WAAW;GACd,QAAQ,QAAQ;GAChB,YAAY,QAAQ;GACpB,MAAM,QAAQ;GACf"}
|
package/dist/error.d.cts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/error.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Structured HTTP error thrown by the Content API client when `throwOnError: true`.
|
|
4
|
+
*/
|
|
5
|
+
declare class ClientError extends Error {
|
|
6
|
+
readonly response: {
|
|
7
|
+
status: number;
|
|
8
|
+
statusText: string;
|
|
9
|
+
data: unknown;
|
|
10
|
+
};
|
|
11
|
+
constructor(message: string, options: {
|
|
12
|
+
status: number;
|
|
13
|
+
statusText: string;
|
|
14
|
+
data: unknown;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ClientError };
|
|
19
|
+
//# sourceMappingURL=error.d.cts.map
|
package/dist/error.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/error.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Structured HTTP error thrown by the Content API client when `throwOnError: true`.
|
|
4
|
+
*/
|
|
5
|
+
declare class ClientError extends Error {
|
|
6
|
+
readonly response: {
|
|
7
|
+
status: number;
|
|
8
|
+
statusText: string;
|
|
9
|
+
data: unknown;
|
|
10
|
+
};
|
|
11
|
+
constructor(message: string, options: {
|
|
12
|
+
status: number;
|
|
13
|
+
statusText: string;
|
|
14
|
+
data: unknown;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ClientError };
|
|
19
|
+
//# sourceMappingURL=error.d.mts.map
|
package/dist/error.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/error.ts
|
|
2
|
+
/**
|
|
3
|
+
* Structured HTTP error thrown by the Content API client when `throwOnError: true`.
|
|
4
|
+
*/
|
|
5
|
+
var ClientError = class extends Error {
|
|
6
|
+
response;
|
|
7
|
+
constructor(message, options) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = "ClientError";
|
|
10
|
+
this.response = {
|
|
11
|
+
status: options.status,
|
|
12
|
+
statusText: options.statusText,
|
|
13
|
+
data: options.data
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ClientError };
|
|
20
|
+
//# sourceMappingURL=error.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.mjs","names":[],"sources":["../src/error.ts"],"sourcesContent":["/**\n * Structured HTTP error thrown by the Content API client when `throwOnError: true`.\n */\nexport class ClientError extends Error {\n readonly response: { status: number; statusText: string; data: unknown };\n\n constructor(\n message: string,\n options: { status: number; statusText: string; data: unknown },\n ) {\n super(message);\n this.name = 'ClientError';\n this.response = {\n status: options.status,\n statusText: options.statusText,\n data: options.data,\n };\n }\n}\n"],"mappings":";;;;AAGA,IAAa,cAAb,cAAiC,MAAM;CACrC,AAAS;CAET,YACE,SACA,SACA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,WAAW;GACd,QAAQ,QAAQ;GAChB,YAAY,QAAQ;GACpB,MAAM,QAAQ;GACf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const require_utils_gen = require('../shared/client/utils.gen.cjs');
|
|
2
|
+
const require_client_gen = require('../shared/client/client.gen.cjs');
|
|
3
|
+
require('../shared/client/index.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/generated/datasource_entries/client.gen.ts
|
|
6
|
+
const client = require_client_gen.createClient(require_utils_gen.createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.client = client;
|
|
10
|
+
//# sourceMappingURL=client.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.cjs","names":["createClient","createConfig"],"sources":["../../../src/generated/datasource_entries/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/client';\nimport type { ClientOptions as ClientOptions2 } from './types.gen';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAASA,gCAAaC,+BAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createConfig } from "../shared/client/utils.gen.mjs";
|
|
2
|
+
import { createClient } from "../shared/client/client.gen.mjs";
|
|
3
|
+
import "../shared/client/index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/datasource_entries/client.gen.ts
|
|
6
|
+
const client = createClient(createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { client };
|
|
10
|
+
//# sourceMappingURL=client.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.mjs","names":[],"sources":["../../../src/generated/datasource_entries/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/client';\nimport type { ClientOptions as ClientOptions2 } from './types.gen';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAAS,aAAa,aAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_client_gen = require('./client.gen.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/generated/datasource_entries/sdk.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve Multiple Datasource Entries
|
|
6
|
+
*
|
|
7
|
+
* Returns an array of all datasource entries. The API response can be filtered using the query parameters.
|
|
8
|
+
*/
|
|
9
|
+
const getAll = (options) => (options?.client ?? require_client_gen.client).get({
|
|
10
|
+
security: [{
|
|
11
|
+
in: "query",
|
|
12
|
+
name: "token",
|
|
13
|
+
type: "apiKey"
|
|
14
|
+
}],
|
|
15
|
+
url: "/v2/cdn/datasource_entries",
|
|
16
|
+
...options
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.getAll = getAll;
|
|
21
|
+
//# sourceMappingURL=sdk.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.gen.cjs","names":["client"],"sources":["../../../src/generated/datasource_entries/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from '../shared/client';\nimport { client } from './client.gen';\nimport type { GetAllData, GetAllErrors, GetAllResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Retrieve Multiple Datasource Entries\n *\n * Returns an array of all datasource entries. The API response can be filtered using the query parameters.\n */\nexport const getAll = <ThrowOnError extends boolean = false>(options?: Options<GetAllData, ThrowOnError>) => (options?.client ?? client).get<GetAllResponses, GetAllErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasource_entries',\n ...options\n});\n"],"mappings":";;;;;;;;AAyBA,MAAa,UAAgD,aAAiD,SAAS,UAAUA,2BAAQ,IAAiD;CACtL,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { client } from "./client.gen.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/generated/datasource_entries/sdk.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve Multiple Datasource Entries
|
|
6
|
+
*
|
|
7
|
+
* Returns an array of all datasource entries. The API response can be filtered using the query parameters.
|
|
8
|
+
*/
|
|
9
|
+
const getAll = (options) => (options?.client ?? client).get({
|
|
10
|
+
security: [{
|
|
11
|
+
in: "query",
|
|
12
|
+
name: "token",
|
|
13
|
+
type: "apiKey"
|
|
14
|
+
}],
|
|
15
|
+
url: "/v2/cdn/datasource_entries",
|
|
16
|
+
...options
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { getAll };
|
|
21
|
+
//# sourceMappingURL=sdk.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.gen.mjs","names":[],"sources":["../../../src/generated/datasource_entries/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from '../shared/client';\nimport { client } from './client.gen';\nimport type { GetAllData, GetAllErrors, GetAllResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Retrieve Multiple Datasource Entries\n *\n * Returns an array of all datasource entries. The API response can be filtered using the query parameters.\n */\nexport const getAll = <ThrowOnError extends boolean = false>(options?: Options<GetAllData, ThrowOnError>) => (options?.client ?? client).get<GetAllResponses, GetAllErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasource_entries',\n ...options\n});\n"],"mappings":";;;;;;;;AAyBA,MAAa,UAAgD,aAAiD,SAAS,UAAU,QAAQ,IAAiD;CACtL,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//#region src/generated/datasource_entries/types.gen.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Storyblok datasource entry object for the Content Delivery API
|
|
4
|
+
*/
|
|
5
|
+
type DatasourceEntryCapi = {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier of the datasource entry
|
|
8
|
+
*/
|
|
9
|
+
id: number;
|
|
10
|
+
/**
|
|
11
|
+
* Display name of the datasource entry
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Value of the datasource entry
|
|
16
|
+
*/
|
|
17
|
+
value: string;
|
|
18
|
+
/**
|
|
19
|
+
* Dimension value of the datasource entry (null if no dimension is specified)
|
|
20
|
+
*/
|
|
21
|
+
dimension_value?: string | null;
|
|
22
|
+
};
|
|
23
|
+
type GetAllData = {
|
|
24
|
+
body?: never;
|
|
25
|
+
path?: never;
|
|
26
|
+
query?: {
|
|
27
|
+
/**
|
|
28
|
+
* Slug of the datasource to filter by
|
|
29
|
+
*/
|
|
30
|
+
datasource?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Datasource dimension
|
|
33
|
+
*/
|
|
34
|
+
dimension?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Page number for pagination
|
|
37
|
+
*/
|
|
38
|
+
page?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Number of entries per page (default 25, max 1000)
|
|
41
|
+
*/
|
|
42
|
+
per_page?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Cached version Unix timestamp for cache invalidation
|
|
45
|
+
*/
|
|
46
|
+
cv?: number;
|
|
47
|
+
};
|
|
48
|
+
url: '/v2/cdn/datasource_entries';
|
|
49
|
+
};
|
|
50
|
+
type GetAllResponses = {
|
|
51
|
+
/**
|
|
52
|
+
* Array of datasource entries
|
|
53
|
+
*/
|
|
54
|
+
200: {
|
|
55
|
+
/**
|
|
56
|
+
* Array of datasource entry objects
|
|
57
|
+
*/
|
|
58
|
+
datasource_entries: Array<DatasourceEntryCapi>;
|
|
59
|
+
/**
|
|
60
|
+
* Cache version Unix timestamp
|
|
61
|
+
*/
|
|
62
|
+
cv?: number | null;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { DatasourceEntryCapi, GetAllData, GetAllResponses };
|
|
67
|
+
//# sourceMappingURL=types.gen.d.cts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//#region src/generated/datasource_entries/types.gen.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Storyblok datasource entry object for the Content Delivery API
|
|
4
|
+
*/
|
|
5
|
+
type DatasourceEntryCapi = {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier of the datasource entry
|
|
8
|
+
*/
|
|
9
|
+
id: number;
|
|
10
|
+
/**
|
|
11
|
+
* Display name of the datasource entry
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Value of the datasource entry
|
|
16
|
+
*/
|
|
17
|
+
value: string;
|
|
18
|
+
/**
|
|
19
|
+
* Dimension value of the datasource entry (null if no dimension is specified)
|
|
20
|
+
*/
|
|
21
|
+
dimension_value?: string | null;
|
|
22
|
+
};
|
|
23
|
+
type GetAllData = {
|
|
24
|
+
body?: never;
|
|
25
|
+
path?: never;
|
|
26
|
+
query?: {
|
|
27
|
+
/**
|
|
28
|
+
* Slug of the datasource to filter by
|
|
29
|
+
*/
|
|
30
|
+
datasource?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Datasource dimension
|
|
33
|
+
*/
|
|
34
|
+
dimension?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Page number for pagination
|
|
37
|
+
*/
|
|
38
|
+
page?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Number of entries per page (default 25, max 1000)
|
|
41
|
+
*/
|
|
42
|
+
per_page?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Cached version Unix timestamp for cache invalidation
|
|
45
|
+
*/
|
|
46
|
+
cv?: number;
|
|
47
|
+
};
|
|
48
|
+
url: '/v2/cdn/datasource_entries';
|
|
49
|
+
};
|
|
50
|
+
type GetAllResponses = {
|
|
51
|
+
/**
|
|
52
|
+
* Array of datasource entries
|
|
53
|
+
*/
|
|
54
|
+
200: {
|
|
55
|
+
/**
|
|
56
|
+
* Array of datasource entry objects
|
|
57
|
+
*/
|
|
58
|
+
datasource_entries: Array<DatasourceEntryCapi>;
|
|
59
|
+
/**
|
|
60
|
+
* Cache version Unix timestamp
|
|
61
|
+
*/
|
|
62
|
+
cv?: number | null;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { DatasourceEntryCapi, GetAllData, GetAllResponses };
|
|
67
|
+
//# sourceMappingURL=types.gen.d.mts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const require_utils_gen = require('../shared/client/utils.gen.cjs');
|
|
2
|
+
const require_client_gen = require('../shared/client/client.gen.cjs');
|
|
3
|
+
require('../shared/client/index.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/generated/datasources/client.gen.ts
|
|
6
|
+
const client = require_client_gen.createClient(require_utils_gen.createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.client = client;
|
|
10
|
+
//# sourceMappingURL=client.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.cjs","names":["createClient","createConfig"],"sources":["../../../src/generated/datasources/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/client';\nimport type { ClientOptions as ClientOptions2 } from './types.gen';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAASA,gCAAaC,+BAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createConfig } from "../shared/client/utils.gen.mjs";
|
|
2
|
+
import { createClient } from "../shared/client/client.gen.mjs";
|
|
3
|
+
import "../shared/client/index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/datasources/client.gen.ts
|
|
6
|
+
const client = createClient(createConfig({ baseUrl: "https://api.storyblok.com" }));
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { client };
|
|
10
|
+
//# sourceMappingURL=client.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.gen.mjs","names":[],"sources":["../../../src/generated/datasources/client.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport { type ClientOptions, type Config, createClient, createConfig } from '../shared/client';\nimport type { ClientOptions as ClientOptions2 } from './types.gen';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.storyblok.com' }));\n"],"mappings":";;;;;AAeA,MAAa,SAAS,aAAa,aAA6B,EAAE,SAAS,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const require_client_gen = require('./client.gen.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/generated/datasources/sdk.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve Multiple Datasources
|
|
6
|
+
*
|
|
7
|
+
* Returns an array of all datasources with pagination support.
|
|
8
|
+
*/
|
|
9
|
+
const getAll = (options) => (options?.client ?? require_client_gen.client).get({
|
|
10
|
+
security: [{
|
|
11
|
+
in: "query",
|
|
12
|
+
name: "token",
|
|
13
|
+
type: "apiKey"
|
|
14
|
+
}],
|
|
15
|
+
url: "/v2/cdn/datasources",
|
|
16
|
+
...options
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve One Datasource
|
|
20
|
+
*
|
|
21
|
+
* Returns a single datasource object for the specified ID
|
|
22
|
+
*/
|
|
23
|
+
const get = (options) => (options.client ?? require_client_gen.client).get({
|
|
24
|
+
security: [{
|
|
25
|
+
in: "query",
|
|
26
|
+
name: "token",
|
|
27
|
+
type: "apiKey"
|
|
28
|
+
}],
|
|
29
|
+
url: "/v2/cdn/datasources/{id}",
|
|
30
|
+
...options
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.get = get;
|
|
35
|
+
exports.getAll = getAll;
|
|
36
|
+
//# sourceMappingURL=sdk.gen.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.gen.cjs","names":["client"],"sources":["../../../src/generated/datasources/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from '../shared/client';\nimport { client } from './client.gen';\nimport type { GetAllData, GetAllErrors, GetAllResponses, GetData, GetErrors, GetResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Retrieve Multiple Datasources\n *\n * Returns an array of all datasources with pagination support.\n */\nexport const getAll = <ThrowOnError extends boolean = false>(options?: Options<GetAllData, ThrowOnError>) => (options?.client ?? client).get<GetAllResponses, GetAllErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasources',\n ...options\n});\n\n/**\n * Retrieve One Datasource\n *\n * Returns a single datasource object for the specified ID\n */\nexport const get = <ThrowOnError extends boolean = false>(options: Options<GetData, ThrowOnError>) => (options.client ?? client).get<GetResponses, GetErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasources/{id}',\n ...options\n});\n"],"mappings":";;;;;;;;AAyBA,MAAa,UAAgD,aAAiD,SAAS,UAAUA,2BAAQ,IAAiD;CACtL,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,OAA6C,aAA6C,QAAQ,UAAUA,2BAAQ,IAA2C;CACxK,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { client } from "./client.gen.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/generated/datasources/sdk.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve Multiple Datasources
|
|
6
|
+
*
|
|
7
|
+
* Returns an array of all datasources with pagination support.
|
|
8
|
+
*/
|
|
9
|
+
const getAll = (options) => (options?.client ?? client).get({
|
|
10
|
+
security: [{
|
|
11
|
+
in: "query",
|
|
12
|
+
name: "token",
|
|
13
|
+
type: "apiKey"
|
|
14
|
+
}],
|
|
15
|
+
url: "/v2/cdn/datasources",
|
|
16
|
+
...options
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve One Datasource
|
|
20
|
+
*
|
|
21
|
+
* Returns a single datasource object for the specified ID
|
|
22
|
+
*/
|
|
23
|
+
const get = (options) => (options.client ?? client).get({
|
|
24
|
+
security: [{
|
|
25
|
+
in: "query",
|
|
26
|
+
name: "token",
|
|
27
|
+
type: "apiKey"
|
|
28
|
+
}],
|
|
29
|
+
url: "/v2/cdn/datasources/{id}",
|
|
30
|
+
...options
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { get, getAll };
|
|
35
|
+
//# sourceMappingURL=sdk.gen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.gen.mjs","names":[],"sources":["../../../src/generated/datasources/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from '../shared/client';\nimport { client } from './client.gen';\nimport type { GetAllData, GetAllErrors, GetAllResponses, GetData, GetErrors, GetResponses } from './types.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Retrieve Multiple Datasources\n *\n * Returns an array of all datasources with pagination support.\n */\nexport const getAll = <ThrowOnError extends boolean = false>(options?: Options<GetAllData, ThrowOnError>) => (options?.client ?? client).get<GetAllResponses, GetAllErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasources',\n ...options\n});\n\n/**\n * Retrieve One Datasource\n *\n * Returns a single datasource object for the specified ID\n */\nexport const get = <ThrowOnError extends boolean = false>(options: Options<GetData, ThrowOnError>) => (options.client ?? client).get<GetResponses, GetErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasources/{id}',\n ...options\n});\n"],"mappings":";;;;;;;;AAyBA,MAAa,UAAgD,aAAiD,SAAS,UAAU,QAAQ,IAAiD;CACtL,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,OAA6C,aAA6C,QAAQ,UAAU,QAAQ,IAA2C;CACxK,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
|