@storyblok/api-client 0.3.1 → 1.0.0-alpha.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.
Files changed (216) hide show
  1. package/README.md +3 -1
  2. package/dist/client.cjs +179 -0
  3. package/dist/client.cjs.map +1 -0
  4. package/dist/client.d.cts +567 -0
  5. package/dist/client.d.mts +567 -0
  6. package/dist/client.mjs +178 -0
  7. package/dist/client.mjs.map +1 -0
  8. package/dist/error.cjs.map +1 -1
  9. package/dist/error.d.cts +13 -2
  10. package/dist/error.d.mts +13 -2
  11. package/dist/error.mjs.map +1 -1
  12. package/dist/generated/capi/_internal.gen.d.cts +120 -0
  13. package/dist/generated/capi/_internal.gen.d.mts +120 -0
  14. package/dist/generated/{shared → capi}/client/client.gen.cjs +1 -1
  15. package/dist/generated/capi/client/client.gen.cjs.map +1 -0
  16. package/dist/generated/capi/client/client.gen.d.mts +1 -0
  17. package/dist/generated/{shared → capi}/client/client.gen.mjs +1 -1
  18. package/dist/generated/capi/client/client.gen.mjs.map +1 -0
  19. package/dist/generated/capi/client/index.d.mts +3 -0
  20. package/dist/generated/{shared → capi}/client/types.gen.d.cts +40 -4
  21. package/dist/generated/{shared → capi}/client/types.gen.d.mts +40 -4
  22. package/dist/generated/{shared → capi}/client/utils.gen.cjs +1 -1
  23. package/dist/generated/capi/client/utils.gen.cjs.map +1 -0
  24. package/dist/generated/{shared → capi}/client/utils.gen.d.cts +1 -1
  25. package/dist/generated/{shared → capi}/client/utils.gen.d.mts +1 -1
  26. package/dist/generated/{shared → capi}/client/utils.gen.mjs +1 -1
  27. package/dist/generated/capi/client/utils.gen.mjs.map +1 -0
  28. package/dist/generated/capi/client.gen.cjs +10 -0
  29. package/dist/generated/capi/client.gen.cjs.map +1 -0
  30. package/dist/generated/capi/client.gen.mjs +10 -0
  31. package/dist/generated/capi/client.gen.mjs.map +1 -0
  32. package/dist/generated/{shared → capi}/core/auth.gen.cjs +1 -1
  33. package/dist/generated/capi/core/auth.gen.cjs.map +1 -0
  34. package/dist/generated/{shared → capi}/core/auth.gen.d.cts +1 -1
  35. package/dist/generated/{shared → capi}/core/auth.gen.d.mts +1 -1
  36. package/dist/generated/{shared → capi}/core/auth.gen.mjs +1 -1
  37. package/dist/generated/capi/core/auth.gen.mjs.map +1 -0
  38. package/dist/generated/{shared → capi}/core/bodySerializer.gen.cjs +1 -1
  39. package/dist/generated/capi/core/bodySerializer.gen.cjs.map +1 -0
  40. package/dist/generated/{shared → capi}/core/bodySerializer.gen.d.cts +1 -1
  41. package/dist/generated/{shared → capi}/core/bodySerializer.gen.d.mts +1 -1
  42. package/dist/generated/{shared → capi}/core/bodySerializer.gen.mjs +1 -1
  43. package/dist/generated/capi/core/bodySerializer.gen.mjs.map +1 -0
  44. package/dist/generated/{shared → capi}/core/params.gen.cjs +1 -1
  45. package/dist/generated/capi/core/params.gen.cjs.map +1 -0
  46. package/dist/generated/{shared → capi}/core/params.gen.mjs +1 -1
  47. package/dist/generated/capi/core/params.gen.mjs.map +1 -0
  48. package/dist/generated/{shared → capi}/core/pathSerializer.gen.cjs +1 -1
  49. package/dist/generated/capi/core/pathSerializer.gen.cjs.map +1 -0
  50. package/dist/generated/{shared → capi}/core/pathSerializer.gen.d.cts +1 -1
  51. package/dist/generated/{shared → capi}/core/pathSerializer.gen.d.mts +1 -1
  52. package/dist/generated/{shared → capi}/core/pathSerializer.gen.mjs +1 -1
  53. package/dist/generated/capi/core/pathSerializer.gen.mjs.map +1 -0
  54. package/dist/generated/{shared → capi}/core/serverSentEvents.gen.cjs +1 -1
  55. package/dist/generated/capi/core/serverSentEvents.gen.cjs.map +1 -0
  56. package/dist/generated/{shared → capi}/core/serverSentEvents.gen.d.cts +5 -2
  57. package/dist/generated/{shared → capi}/core/serverSentEvents.gen.d.mts +5 -2
  58. package/dist/generated/{shared → capi}/core/serverSentEvents.gen.mjs +1 -1
  59. package/dist/generated/capi/core/serverSentEvents.gen.mjs.map +1 -0
  60. package/dist/generated/{shared → capi}/core/types.gen.d.cts +15 -2
  61. package/dist/generated/{shared → capi}/core/types.gen.d.mts +15 -2
  62. package/dist/generated/{shared → capi}/core/utils.gen.cjs +1 -1
  63. package/dist/generated/capi/core/utils.gen.cjs.map +1 -0
  64. package/dist/generated/{shared → capi}/core/utils.gen.mjs +1 -1
  65. package/dist/generated/capi/core/utils.gen.mjs.map +1 -0
  66. package/dist/generated/capi/sdk.gen.cjs +141 -0
  67. package/dist/generated/capi/sdk.gen.cjs.map +1 -0
  68. package/dist/generated/capi/sdk.gen.mjs +133 -0
  69. package/dist/generated/capi/sdk.gen.mjs.map +1 -0
  70. package/dist/generated/capi/types-aliased.gen.d.cts +181 -0
  71. package/dist/generated/capi/types-aliased.gen.d.mts +181 -0
  72. package/dist/generated/capi/types.gen.d.cts +919 -0
  73. package/dist/generated/capi/types.gen.d.mts +919 -0
  74. package/dist/generated/mapi/_internal.gen.d.cts +146 -0
  75. package/dist/generated/mapi/_internal.gen.d.mts +146 -0
  76. package/dist/generated/mapi/types.gen.d.cts +293 -0
  77. package/dist/generated/mapi/types.gen.d.mts +293 -0
  78. package/dist/generated/overlay/_internal.gen.d.cts +831 -0
  79. package/dist/generated/overlay/_internal.gen.d.mts +831 -0
  80. package/dist/generated/types/_utils.d.cts +7 -0
  81. package/dist/generated/types/_utils.d.mts +7 -0
  82. package/dist/generated/types/block.d.cts +29 -0
  83. package/dist/generated/types/block.d.mts +29 -0
  84. package/dist/generated/types/field.d.cts +64 -0
  85. package/dist/generated/types/field.d.mts +64 -0
  86. package/dist/generated/types/story.d.cts +19 -0
  87. package/dist/generated/types/story.d.mts +19 -0
  88. package/dist/index.cjs +2 -154
  89. package/dist/index.d.cts +8 -184
  90. package/dist/index.d.mts +8 -184
  91. package/dist/index.mjs +2 -151
  92. package/dist/resources/datasource-entries.cjs +2 -2
  93. package/dist/resources/datasource-entries.cjs.map +1 -1
  94. package/dist/resources/datasource-entries.mjs +2 -2
  95. package/dist/resources/datasource-entries.mjs.map +1 -1
  96. package/dist/resources/datasources.cjs +4 -4
  97. package/dist/resources/datasources.cjs.map +1 -1
  98. package/dist/resources/datasources.mjs +4 -4
  99. package/dist/resources/datasources.mjs.map +1 -1
  100. package/dist/resources/experiments.cjs +26 -0
  101. package/dist/resources/experiments.cjs.map +1 -0
  102. package/dist/resources/experiments.mjs +26 -0
  103. package/dist/resources/experiments.mjs.map +1 -0
  104. package/dist/resources/links.cjs +2 -2
  105. package/dist/resources/links.cjs.map +1 -1
  106. package/dist/resources/links.mjs +2 -2
  107. package/dist/resources/links.mjs.map +1 -1
  108. package/dist/resources/spaces.cjs +4 -4
  109. package/dist/resources/spaces.cjs.map +1 -1
  110. package/dist/resources/spaces.mjs +4 -4
  111. package/dist/resources/spaces.mjs.map +1 -1
  112. package/dist/resources/stories.cjs +16 -12
  113. package/dist/resources/stories.cjs.map +1 -1
  114. package/dist/resources/stories.d.cts +82 -4
  115. package/dist/resources/stories.d.mts +82 -4
  116. package/dist/resources/stories.mjs +16 -12
  117. package/dist/resources/stories.mjs.map +1 -1
  118. package/dist/resources/tags.cjs +2 -2
  119. package/dist/resources/tags.cjs.map +1 -1
  120. package/dist/resources/tags.mjs +2 -2
  121. package/dist/resources/tags.mjs.map +1 -1
  122. package/dist/utils/fetch-rel-uuids.cjs +2 -2
  123. package/dist/utils/fetch-rel-uuids.cjs.map +1 -1
  124. package/dist/utils/fetch-rel-uuids.mjs +2 -2
  125. package/dist/utils/fetch-rel-uuids.mjs.map +1 -1
  126. package/dist/utils/inline-relations.cjs.map +1 -1
  127. package/dist/utils/inline-relations.mjs.map +1 -1
  128. package/dist/utils/rate-limit.cjs +9 -5
  129. package/dist/utils/rate-limit.cjs.map +1 -1
  130. package/dist/utils/rate-limit.d.cts +4 -18
  131. package/dist/utils/rate-limit.d.mts +4 -18
  132. package/dist/utils/rate-limit.mjs +10 -4
  133. package/dist/utils/rate-limit.mjs.map +1 -1
  134. package/package.json +16 -12
  135. package/dist/generated/datasource_entries/client.gen.cjs +0 -10
  136. package/dist/generated/datasource_entries/client.gen.cjs.map +0 -1
  137. package/dist/generated/datasource_entries/client.gen.mjs +0 -10
  138. package/dist/generated/datasource_entries/client.gen.mjs.map +0 -1
  139. package/dist/generated/datasource_entries/sdk.gen.cjs +0 -21
  140. package/dist/generated/datasource_entries/sdk.gen.cjs.map +0 -1
  141. package/dist/generated/datasource_entries/sdk.gen.mjs +0 -21
  142. package/dist/generated/datasource_entries/sdk.gen.mjs.map +0 -1
  143. package/dist/generated/datasource_entries/types.gen.d.cts +0 -67
  144. package/dist/generated/datasource_entries/types.gen.d.mts +0 -67
  145. package/dist/generated/datasources/client.gen.cjs +0 -10
  146. package/dist/generated/datasources/client.gen.cjs.map +0 -1
  147. package/dist/generated/datasources/client.gen.mjs +0 -10
  148. package/dist/generated/datasources/client.gen.mjs.map +0 -1
  149. package/dist/generated/datasources/sdk.gen.cjs +0 -36
  150. package/dist/generated/datasources/sdk.gen.cjs.map +0 -1
  151. package/dist/generated/datasources/sdk.gen.mjs +0 -35
  152. package/dist/generated/datasources/sdk.gen.mjs.map +0 -1
  153. package/dist/generated/datasources/types.gen.d.cts +0 -109
  154. package/dist/generated/datasources/types.gen.d.mts +0 -109
  155. package/dist/generated/links/client.gen.cjs +0 -10
  156. package/dist/generated/links/client.gen.cjs.map +0 -1
  157. package/dist/generated/links/client.gen.mjs +0 -10
  158. package/dist/generated/links/client.gen.mjs.map +0 -1
  159. package/dist/generated/links/sdk.gen.cjs +0 -21
  160. package/dist/generated/links/sdk.gen.cjs.map +0 -1
  161. package/dist/generated/links/sdk.gen.mjs +0 -21
  162. package/dist/generated/links/sdk.gen.mjs.map +0 -1
  163. package/dist/generated/links/types.gen.d.cts +0 -142
  164. package/dist/generated/links/types.gen.d.mts +0 -142
  165. package/dist/generated/shared/client/client.gen.cjs.map +0 -1
  166. package/dist/generated/shared/client/client.gen.mjs.map +0 -1
  167. package/dist/generated/shared/client/utils.gen.cjs.map +0 -1
  168. package/dist/generated/shared/client/utils.gen.mjs.map +0 -1
  169. package/dist/generated/shared/core/auth.gen.cjs.map +0 -1
  170. package/dist/generated/shared/core/auth.gen.mjs.map +0 -1
  171. package/dist/generated/shared/core/bodySerializer.gen.cjs.map +0 -1
  172. package/dist/generated/shared/core/bodySerializer.gen.mjs.map +0 -1
  173. package/dist/generated/shared/core/params.gen.cjs.map +0 -1
  174. package/dist/generated/shared/core/params.gen.mjs.map +0 -1
  175. package/dist/generated/shared/core/pathSerializer.gen.cjs.map +0 -1
  176. package/dist/generated/shared/core/pathSerializer.gen.mjs.map +0 -1
  177. package/dist/generated/shared/core/serverSentEvents.gen.cjs.map +0 -1
  178. package/dist/generated/shared/core/serverSentEvents.gen.mjs.map +0 -1
  179. package/dist/generated/shared/core/utils.gen.cjs.map +0 -1
  180. package/dist/generated/shared/core/utils.gen.mjs.map +0 -1
  181. package/dist/generated/spaces/client.gen.cjs +0 -10
  182. package/dist/generated/spaces/client.gen.cjs.map +0 -1
  183. package/dist/generated/spaces/client.gen.mjs +0 -10
  184. package/dist/generated/spaces/client.gen.mjs.map +0 -1
  185. package/dist/generated/spaces/sdk.gen.cjs +0 -21
  186. package/dist/generated/spaces/sdk.gen.cjs.map +0 -1
  187. package/dist/generated/spaces/sdk.gen.mjs +0 -21
  188. package/dist/generated/spaces/sdk.gen.mjs.map +0 -1
  189. package/dist/generated/spaces/types.gen.d.cts +0 -34
  190. package/dist/generated/spaces/types.gen.d.mts +0 -34
  191. package/dist/generated/stories/client.gen.cjs +0 -10
  192. package/dist/generated/stories/client.gen.cjs.map +0 -1
  193. package/dist/generated/stories/client.gen.mjs +0 -10
  194. package/dist/generated/stories/client.gen.mjs.map +0 -1
  195. package/dist/generated/stories/sdk.gen.cjs +0 -36
  196. package/dist/generated/stories/sdk.gen.cjs.map +0 -1
  197. package/dist/generated/stories/sdk.gen.mjs +0 -35
  198. package/dist/generated/stories/sdk.gen.mjs.map +0 -1
  199. package/dist/generated/stories/types.gen.d.cts +0 -544
  200. package/dist/generated/stories/types.gen.d.mts +0 -544
  201. package/dist/generated/tags/client.gen.cjs +0 -10
  202. package/dist/generated/tags/client.gen.cjs.map +0 -1
  203. package/dist/generated/tags/client.gen.mjs +0 -10
  204. package/dist/generated/tags/client.gen.mjs.map +0 -1
  205. package/dist/generated/tags/sdk.gen.cjs +0 -21
  206. package/dist/generated/tags/sdk.gen.cjs.map +0 -1
  207. package/dist/generated/tags/sdk.gen.mjs +0 -21
  208. package/dist/generated/tags/sdk.gen.mjs.map +0 -1
  209. package/dist/generated/tags/types.gen.d.cts +0 -44
  210. package/dist/generated/tags/types.gen.d.mts +0 -44
  211. package/dist/index.cjs.map +0 -1
  212. package/dist/index.mjs.map +0 -1
  213. package/dist/types.d.cts +0 -37
  214. package/dist/types.d.mts +0 -37
  215. /package/dist/generated/{shared → capi}/client/index.cjs +0 -0
  216. /package/dist/generated/{shared → capi}/client/index.mjs +0 -0
@@ -1,8 +1,21 @@
1
1
  import { Auth, AuthToken } from "./auth.gen.cjs";
2
2
  import { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.cjs";
3
3
 
4
- //#region src/generated/shared/core/types.gen.d.ts
4
+ //#region src/generated/capi/core/types.gen.d.ts
5
5
  type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
6
+ type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
7
+ /**
8
+ * Returns the final request URL.
9
+ */
10
+ buildUrl: BuildUrlFn;
11
+ getConfig: () => Config;
12
+ request: RequestFn;
13
+ setConfig: (config: Config) => Config;
14
+ } & { [K in HttpMethod]: MethodFn } & ([SseFn] extends [never] ? {
15
+ sse?: never;
16
+ } : {
17
+ sse: { [K in HttpMethod]: SseFn };
18
+ });
6
19
  interface Config {
7
20
  /**
8
21
  * Auth token or a function returning auth token. The resolved value will be
@@ -57,5 +70,5 @@ interface Config {
57
70
  responseValidator?: (data: unknown) => Promise<unknown>;
58
71
  }
59
72
  //#endregion
60
- export { Config };
73
+ export { Client, Config };
61
74
  //# sourceMappingURL=types.gen.d.cts.map
@@ -1,8 +1,21 @@
1
1
  import { Auth, AuthToken } from "./auth.gen.mjs";
2
2
  import { BodySerializer, QuerySerializer, QuerySerializerOptions } from "./bodySerializer.gen.mjs";
3
3
 
4
- //#region src/generated/shared/core/types.gen.d.ts
4
+ //#region src/generated/capi/core/types.gen.d.ts
5
5
  type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
6
+ type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
7
+ /**
8
+ * Returns the final request URL.
9
+ */
10
+ buildUrl: BuildUrlFn;
11
+ getConfig: () => Config;
12
+ request: RequestFn;
13
+ setConfig: (config: Config) => Config;
14
+ } & { [K in HttpMethod]: MethodFn } & ([SseFn] extends [never] ? {
15
+ sse?: never;
16
+ } : {
17
+ sse: { [K in HttpMethod]: SseFn };
18
+ });
6
19
  interface Config {
7
20
  /**
8
21
  * Auth token or a function returning auth token. The resolved value will be
@@ -57,5 +70,5 @@ interface Config {
57
70
  responseValidator?: (data: unknown) => Promise<unknown>;
58
71
  }
59
72
  //#endregion
60
- export { Config };
73
+ export { Client, Config };
61
74
  //# sourceMappingURL=types.gen.d.mts.map
@@ -1,6 +1,6 @@
1
1
  const require_pathSerializer_gen = require('./pathSerializer.gen.cjs');
2
2
 
3
- //#region src/generated/shared/core/utils.gen.ts
3
+ //#region src/generated/capi/core/utils.gen.ts
4
4
  const PATH_PARAM_RE = /\{[^{}]+\}/g;
5
5
  const defaultPathSerializer = ({ path, url: _url }) => {
6
6
  let url = _url;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.gen.cjs","names":["serializeArrayParam","serializeObjectParam","serializePrimitiveParam"],"sources":["../../../../src/generated/capi/core/utils.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { BodySerializer, QuerySerializer } from './bodySerializer.gen';\nimport {\n type ArraySeparatorStyle,\n serializeArrayParam,\n serializeObjectParam,\n serializePrimitiveParam,\n} from './pathSerializer.gen';\n\nexport interface PathSerializer {\n path: Record<string, unknown>;\n url: string;\n}\n\nexport const PATH_PARAM_RE = /\\{[^{}]+\\}/g;\n\nexport const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {\n let url = _url;\n const matches = _url.match(PATH_PARAM_RE);\n if (matches) {\n for (const match of matches) {\n let explode = false;\n let name = match.substring(1, match.length - 1);\n let style: ArraySeparatorStyle = 'simple';\n\n if (name.endsWith('*')) {\n explode = true;\n name = name.substring(0, name.length - 1);\n }\n\n if (name.startsWith('.')) {\n name = name.substring(1);\n style = 'label';\n } else if (name.startsWith(';')) {\n name = name.substring(1);\n style = 'matrix';\n }\n\n const value = path[name];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n if (Array.isArray(value)) {\n url = url.replace(match, serializeArrayParam({ explode, name, style, value }));\n continue;\n }\n\n if (typeof value === 'object') {\n url = url.replace(\n match,\n serializeObjectParam({\n explode,\n name,\n style,\n value: value as Record<string, unknown>,\n valueOnly: true,\n }),\n );\n continue;\n }\n\n if (style === 'matrix') {\n url = url.replace(\n match,\n `;${serializePrimitiveParam({\n name,\n value: value as string,\n })}`,\n );\n continue;\n }\n\n const replaceValue = encodeURIComponent(\n style === 'label' ? `.${value as string}` : (value as string),\n );\n url = url.replace(match, replaceValue);\n }\n }\n return url;\n};\n\nexport const getUrl = ({\n baseUrl,\n path,\n query,\n querySerializer,\n url: _url,\n}: {\n baseUrl?: string;\n path?: Record<string, unknown>;\n query?: Record<string, unknown>;\n querySerializer: QuerySerializer;\n url: string;\n}) => {\n const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;\n let url = (baseUrl ?? '') + pathUrl;\n if (path) {\n url = defaultPathSerializer({ path, url });\n }\n let search = query ? querySerializer(query) : '';\n if (search.startsWith('?')) {\n search = search.substring(1);\n }\n if (search) {\n url += `?${search}`;\n }\n return url;\n};\n\nexport function getValidRequestBody(options: {\n body?: unknown;\n bodySerializer?: BodySerializer | null;\n serializedBody?: unknown;\n}) {\n const hasBody = options.body !== undefined;\n const isSerializedBody = hasBody && options.bodySerializer;\n\n if (isSerializedBody) {\n if ('serializedBody' in options) {\n const hasSerializedBody =\n options.serializedBody !== undefined && options.serializedBody !== '';\n\n return hasSerializedBody ? options.serializedBody : null;\n }\n\n // not all clients implement a serializedBody property (i.e. client-axios)\n return options.body !== '' ? options.body : null;\n }\n\n // plain/text body\n if (hasBody) {\n return options.body;\n }\n\n // no body was provided\n return undefined;\n}\n"],"mappings":";;;AAeA,MAAa,gBAAgB;AAE7B,MAAa,yBAAyB,EAAE,MAAM,KAAK,WAA2B;CAC5E,IAAI,MAAM;CACV,MAAM,UAAU,KAAK,MAAM,cAAc;AACzC,KAAI,QACF,MAAK,MAAM,SAAS,SAAS;EAC3B,IAAI,UAAU;EACd,IAAI,OAAO,MAAM,UAAU,GAAG,MAAM,SAAS,EAAE;EAC/C,IAAI,QAA6B;AAEjC,MAAI,KAAK,SAAS,IAAI,EAAE;AACtB,aAAU;AACV,UAAO,KAAK,UAAU,GAAG,KAAK,SAAS,EAAE;;AAG3C,MAAI,KAAK,WAAW,IAAI,EAAE;AACxB,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;aACC,KAAK,WAAW,IAAI,EAAE;AAC/B,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;;EAGV,MAAM,QAAQ,KAAK;AAEnB,MAAI,UAAU,UAAa,UAAU,KACnC;AAGF,MAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,SAAM,IAAI,QAAQ,OAAOA,+CAAoB;IAAE;IAAS;IAAM;IAAO;IAAO,CAAC,CAAC;AAC9E;;AAGF,MAAI,OAAO,UAAU,UAAU;AAC7B,SAAM,IAAI,QACR,OACAC,gDAAqB;IACnB;IACA;IACA;IACO;IACP,WAAW;IACZ,CAAC,CACH;AACD;;AAGF,MAAI,UAAU,UAAU;AACtB,SAAM,IAAI,QACR,OACA,IAAIC,mDAAwB;IAC1B;IACO;IACR,CAAC,GACH;AACD;;EAGF,MAAM,eAAe,mBACnB,UAAU,UAAU,IAAI,UAAqB,MAC9C;AACD,QAAM,IAAI,QAAQ,OAAO,aAAa;;AAG1C,QAAO;;AAGT,MAAa,UAAU,EACrB,SACA,MACA,OACA,iBACA,KAAK,WAOD;CACJ,MAAM,UAAU,KAAK,WAAW,IAAI,GAAG,OAAO,IAAI;CAClD,IAAI,OAAO,WAAW,MAAM;AAC5B,KAAI,KACF,OAAM,sBAAsB;EAAE;EAAM;EAAK,CAAC;CAE5C,IAAI,SAAS,QAAQ,gBAAgB,MAAM,GAAG;AAC9C,KAAI,OAAO,WAAW,IAAI,CACxB,UAAS,OAAO,UAAU,EAAE;AAE9B,KAAI,OACF,QAAO,IAAI;AAEb,QAAO;;AAGT,SAAgB,oBAAoB,SAIjC;CACD,MAAM,UAAU,QAAQ,SAAS;AAGjC,KAFyB,WAAW,QAAQ,gBAEtB;AACpB,MAAI,oBAAoB,QAItB,QAFE,QAAQ,mBAAmB,UAAa,QAAQ,mBAAmB,KAE1C,QAAQ,iBAAiB;AAItD,SAAO,QAAQ,SAAS,KAAK,QAAQ,OAAO;;AAI9C,KAAI,QACF,QAAO,QAAQ"}
@@ -1,6 +1,6 @@
1
1
  import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam } from "./pathSerializer.gen.mjs";
2
2
 
3
- //#region src/generated/shared/core/utils.gen.ts
3
+ //#region src/generated/capi/core/utils.gen.ts
4
4
  const PATH_PARAM_RE = /\{[^{}]+\}/g;
5
5
  const defaultPathSerializer = ({ path, url: _url }) => {
6
6
  let url = _url;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.gen.mjs","names":[],"sources":["../../../../src/generated/capi/core/utils.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { BodySerializer, QuerySerializer } from './bodySerializer.gen';\nimport {\n type ArraySeparatorStyle,\n serializeArrayParam,\n serializeObjectParam,\n serializePrimitiveParam,\n} from './pathSerializer.gen';\n\nexport interface PathSerializer {\n path: Record<string, unknown>;\n url: string;\n}\n\nexport const PATH_PARAM_RE = /\\{[^{}]+\\}/g;\n\nexport const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {\n let url = _url;\n const matches = _url.match(PATH_PARAM_RE);\n if (matches) {\n for (const match of matches) {\n let explode = false;\n let name = match.substring(1, match.length - 1);\n let style: ArraySeparatorStyle = 'simple';\n\n if (name.endsWith('*')) {\n explode = true;\n name = name.substring(0, name.length - 1);\n }\n\n if (name.startsWith('.')) {\n name = name.substring(1);\n style = 'label';\n } else if (name.startsWith(';')) {\n name = name.substring(1);\n style = 'matrix';\n }\n\n const value = path[name];\n\n if (value === undefined || value === null) {\n continue;\n }\n\n if (Array.isArray(value)) {\n url = url.replace(match, serializeArrayParam({ explode, name, style, value }));\n continue;\n }\n\n if (typeof value === 'object') {\n url = url.replace(\n match,\n serializeObjectParam({\n explode,\n name,\n style,\n value: value as Record<string, unknown>,\n valueOnly: true,\n }),\n );\n continue;\n }\n\n if (style === 'matrix') {\n url = url.replace(\n match,\n `;${serializePrimitiveParam({\n name,\n value: value as string,\n })}`,\n );\n continue;\n }\n\n const replaceValue = encodeURIComponent(\n style === 'label' ? `.${value as string}` : (value as string),\n );\n url = url.replace(match, replaceValue);\n }\n }\n return url;\n};\n\nexport const getUrl = ({\n baseUrl,\n path,\n query,\n querySerializer,\n url: _url,\n}: {\n baseUrl?: string;\n path?: Record<string, unknown>;\n query?: Record<string, unknown>;\n querySerializer: QuerySerializer;\n url: string;\n}) => {\n const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;\n let url = (baseUrl ?? '') + pathUrl;\n if (path) {\n url = defaultPathSerializer({ path, url });\n }\n let search = query ? querySerializer(query) : '';\n if (search.startsWith('?')) {\n search = search.substring(1);\n }\n if (search) {\n url += `?${search}`;\n }\n return url;\n};\n\nexport function getValidRequestBody(options: {\n body?: unknown;\n bodySerializer?: BodySerializer | null;\n serializedBody?: unknown;\n}) {\n const hasBody = options.body !== undefined;\n const isSerializedBody = hasBody && options.bodySerializer;\n\n if (isSerializedBody) {\n if ('serializedBody' in options) {\n const hasSerializedBody =\n options.serializedBody !== undefined && options.serializedBody !== '';\n\n return hasSerializedBody ? options.serializedBody : null;\n }\n\n // not all clients implement a serializedBody property (i.e. client-axios)\n return options.body !== '' ? options.body : null;\n }\n\n // plain/text body\n if (hasBody) {\n return options.body;\n }\n\n // no body was provided\n return undefined;\n}\n"],"mappings":";;;AAeA,MAAa,gBAAgB;AAE7B,MAAa,yBAAyB,EAAE,MAAM,KAAK,WAA2B;CAC5E,IAAI,MAAM;CACV,MAAM,UAAU,KAAK,MAAM,cAAc;AACzC,KAAI,QACF,MAAK,MAAM,SAAS,SAAS;EAC3B,IAAI,UAAU;EACd,IAAI,OAAO,MAAM,UAAU,GAAG,MAAM,SAAS,EAAE;EAC/C,IAAI,QAA6B;AAEjC,MAAI,KAAK,SAAS,IAAI,EAAE;AACtB,aAAU;AACV,UAAO,KAAK,UAAU,GAAG,KAAK,SAAS,EAAE;;AAG3C,MAAI,KAAK,WAAW,IAAI,EAAE;AACxB,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;aACC,KAAK,WAAW,IAAI,EAAE;AAC/B,UAAO,KAAK,UAAU,EAAE;AACxB,WAAQ;;EAGV,MAAM,QAAQ,KAAK;AAEnB,MAAI,UAAU,UAAa,UAAU,KACnC;AAGF,MAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,SAAM,IAAI,QAAQ,OAAO,oBAAoB;IAAE;IAAS;IAAM;IAAO;IAAO,CAAC,CAAC;AAC9E;;AAGF,MAAI,OAAO,UAAU,UAAU;AAC7B,SAAM,IAAI,QACR,OACA,qBAAqB;IACnB;IACA;IACA;IACO;IACP,WAAW;IACZ,CAAC,CACH;AACD;;AAGF,MAAI,UAAU,UAAU;AACtB,SAAM,IAAI,QACR,OACA,IAAI,wBAAwB;IAC1B;IACO;IACR,CAAC,GACH;AACD;;EAGF,MAAM,eAAe,mBACnB,UAAU,UAAU,IAAI,UAAqB,MAC9C;AACD,QAAM,IAAI,QAAQ,OAAO,aAAa;;AAG1C,QAAO;;AAGT,MAAa,UAAU,EACrB,SACA,MACA,OACA,iBACA,KAAK,WAOD;CACJ,MAAM,UAAU,KAAK,WAAW,IAAI,GAAG,OAAO,IAAI;CAClD,IAAI,OAAO,WAAW,MAAM;AAC5B,KAAI,KACF,OAAM,sBAAsB;EAAE;EAAM;EAAK,CAAC;CAE5C,IAAI,SAAS,QAAQ,gBAAgB,MAAM,GAAG;AAC9C,KAAI,OAAO,WAAW,IAAI,CACxB,UAAS,OAAO,UAAU,EAAE;AAE9B,KAAI,OACF,QAAO,IAAI;AAEb,QAAO;;AAGT,SAAgB,oBAAoB,SAIjC;CACD,MAAM,UAAU,QAAQ,SAAS;AAGjC,KAFyB,WAAW,QAAQ,gBAEtB;AACpB,MAAI,oBAAoB,QAItB,QAFE,QAAQ,mBAAmB,UAAa,QAAQ,mBAAmB,KAE1C,QAAQ,iBAAiB;AAItD,SAAO,QAAQ,SAAS,KAAK,QAAQ,OAAO;;AAI9C,KAAI,QACF,QAAO,QAAQ"}
@@ -0,0 +1,141 @@
1
+ const require_client_gen = require('./client.gen.cjs');
2
+
3
+ //#region src/generated/capi/sdk.gen.ts
4
+ /**
5
+ * List data source entries
6
+ *
7
+ * Retrieve all data source entries from the CDN with optional filtering parameters.
8
+ */
9
+ const listDatasourceEntries = (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
+ * List data sources
20
+ *
21
+ * Retrieve all data sources from the CDN with optional filtering parameters.
22
+ */
23
+ const listDatasources = (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",
30
+ ...options
31
+ });
32
+ /**
33
+ * Retrieve a single datasource by Id, full_slug.
34
+ *
35
+ * Fetch a single datasource by full_slug, numeric ID, slug.
36
+ */
37
+ const getDatasourceById = (options) => (options.client ?? require_client_gen.client).get({
38
+ security: [{
39
+ in: "query",
40
+ name: "token",
41
+ type: "apiKey"
42
+ }],
43
+ url: "/v2/cdn/datasources/{id}",
44
+ ...options
45
+ });
46
+ /**
47
+ * List running experiments
48
+ *
49
+ * Retrieve all running experiments with their variants and associated story IDs. Only experiments with status 'running' are returned. No pagination — the result set is expected to be small per space.
50
+ */
51
+ const listCdnExperimentsV2 = (options) => (options?.client ?? require_client_gen.client).get({
52
+ security: [{
53
+ in: "query",
54
+ name: "token",
55
+ type: "apiKey"
56
+ }],
57
+ url: "/v2/cdn/experiments",
58
+ ...options
59
+ });
60
+ /**
61
+ * List Links
62
+ *
63
+ * Retrieve all links (story references) in the space.
64
+ */
65
+ const listLinks = (options) => (options?.client ?? require_client_gen.client).get({
66
+ security: [{
67
+ in: "query",
68
+ name: "token",
69
+ type: "apiKey"
70
+ }],
71
+ url: "/v2/cdn/links",
72
+ ...options
73
+ });
74
+ /**
75
+ * Retrieve space
76
+ *
77
+ * Retrieve space details including its ID, name, and domain.
78
+ */
79
+ const getSpace = (options) => (options?.client ?? require_client_gen.client).get({
80
+ security: [{
81
+ in: "query",
82
+ name: "token",
83
+ type: "apiKey"
84
+ }],
85
+ url: "/v2/cdn/spaces/me",
86
+ ...options
87
+ });
88
+ /**
89
+ * Retrieve a single story by Id, UUID or full_slug.
90
+ *
91
+ * Fetch a single story by full_slug, numeric ID, or UUID, with optional resolution parameters.
92
+ */
93
+ const getStoryById = (options) => (options.client ?? require_client_gen.client).get({
94
+ security: [{
95
+ in: "query",
96
+ name: "token",
97
+ type: "apiKey"
98
+ }],
99
+ url: "/v2/cdn/stories/{id}",
100
+ ...options
101
+ });
102
+ /**
103
+ * List all stories
104
+ *
105
+ * Retrieve all published stories from the CDN with optional filtering parameters.
106
+ */
107
+ const listStories = (options) => (options?.client ?? require_client_gen.client).get({
108
+ security: [{
109
+ in: "query",
110
+ name: "token",
111
+ type: "apiKey"
112
+ }],
113
+ url: "/v2/cdn/stories",
114
+ ...options
115
+ });
116
+ /**
117
+ * List tags
118
+ *
119
+ * Retrieve all tags from the CDN with optional filtering parameters.
120
+ */
121
+ const listTags = (options) => (options?.client ?? require_client_gen.client).get({
122
+ security: [{
123
+ in: "query",
124
+ name: "token",
125
+ type: "apiKey"
126
+ }],
127
+ url: "/v2/cdn/tags",
128
+ ...options
129
+ });
130
+
131
+ //#endregion
132
+ exports.getDatasourceById = getDatasourceById;
133
+ exports.getSpace = getSpace;
134
+ exports.getStoryById = getStoryById;
135
+ exports.listCdnExperimentsV2 = listCdnExperimentsV2;
136
+ exports.listDatasourceEntries = listDatasourceEntries;
137
+ exports.listDatasources = listDatasources;
138
+ exports.listLinks = listLinks;
139
+ exports.listStories = listStories;
140
+ exports.listTags = listTags;
141
+ //# sourceMappingURL=sdk.gen.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.gen.cjs","names":["client"],"sources":["../../../src/generated/capi/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from './client';\nimport { client } from './client.gen';\nimport type { GetAssetData, GetAssetErrors, GetAssetResponses, GetDatasourceByIdData, GetDatasourceByIdErrors, GetDatasourceByIdResponses, GetLinkByUuIdData, GetLinkByUuIdErrors, GetLinkByUuIdResponses, GetSpaceData, GetSpaceErrors, GetSpaceResponses, GetStoryByIdData, GetStoryByIdErrors, GetStoryByIdResponses, ListCdnExperimentsV2Data, ListCdnExperimentsV2Errors, ListCdnExperimentsV2Responses, ListDatasourceEntriesData, ListDatasourceEntriesErrors, ListDatasourceEntriesResponses, ListDatasourcesData, ListDatasourcesErrors, ListDatasourcesResponses, ListLinksData, ListLinksErrors, ListLinksResponses, ListStoriesData, ListStoriesErrors, ListStoriesResponses, ListTagsData, ListTagsErrors, ListTagsResponses } 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 asset\n *\n * Retrieve asset details.\n */\nexport const getAsset = <ThrowOnError extends boolean = false>(options: Options<GetAssetData, ThrowOnError>) => (options.client ?? client).get<GetAssetResponses, GetAssetErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/assets/me',\n ...options\n});\n\n/**\n * List data source entries\n *\n * Retrieve all data source entries from the CDN with optional filtering parameters.\n */\nexport const listDatasourceEntries = <ThrowOnError extends boolean = false>(options?: Options<ListDatasourceEntriesData, ThrowOnError>) => (options?.client ?? client).get<ListDatasourceEntriesResponses, ListDatasourceEntriesErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasource_entries',\n ...options\n});\n\n/**\n * List data sources\n *\n * Retrieve all data sources from the CDN with optional filtering parameters.\n */\nexport const listDatasources = <ThrowOnError extends boolean = false>(options?: Options<ListDatasourcesData, ThrowOnError>) => (options?.client ?? client).get<ListDatasourcesResponses, ListDatasourcesErrors, 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 a single datasource by Id, full_slug.\n *\n * Fetch a single datasource by full_slug, numeric ID, slug.\n */\nexport const getDatasourceById = <ThrowOnError extends boolean = false>(options: Options<GetDatasourceByIdData, ThrowOnError>) => (options.client ?? client).get<GetDatasourceByIdResponses, GetDatasourceByIdErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasources/{id}',\n ...options\n});\n\n/**\n * List running experiments\n *\n * Retrieve all running experiments with their variants and associated story IDs. Only experiments with status 'running' are returned. No pagination — the result set is expected to be small per space.\n */\nexport const listCdnExperimentsV2 = <ThrowOnError extends boolean = false>(options?: Options<ListCdnExperimentsV2Data, ThrowOnError>) => (options?.client ?? client).get<ListCdnExperimentsV2Responses, ListCdnExperimentsV2Errors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/experiments',\n ...options\n});\n\n/**\n * List Links\n *\n * Retrieve all links (story references) in the space.\n */\nexport const listLinks = <ThrowOnError extends boolean = false>(options?: Options<ListLinksData, ThrowOnError>) => (options?.client ?? client).get<ListLinksResponses, ListLinksErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/links',\n ...options\n});\n\n/**\n * Retrieve a single link by uuid.\n *\n * Fetch a single link by UUID.\n */\nexport const getLinkByUuId = <ThrowOnError extends boolean = false>(options: Options<GetLinkByUuIdData, ThrowOnError>) => (options.client ?? client).get<GetLinkByUuIdResponses, GetLinkByUuIdErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/links/{id}',\n ...options\n});\n\n/**\n * Retrieve space\n *\n * Retrieve space details including its ID, name, and domain.\n */\nexport const getSpace = <ThrowOnError extends boolean = false>(options?: Options<GetSpaceData, ThrowOnError>) => (options?.client ?? client).get<GetSpaceResponses, GetSpaceErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/spaces/me',\n ...options\n});\n\n/**\n * Retrieve a single story by Id, UUID or full_slug.\n *\n * Fetch a single story by full_slug, numeric ID, or UUID, with optional resolution parameters.\n */\nexport const getStoryById = <ThrowOnError extends boolean = false>(options: Options<GetStoryByIdData, ThrowOnError>) => (options.client ?? client).get<GetStoryByIdResponses, GetStoryByIdErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/stories/{id}',\n ...options\n});\n\n/**\n * List all stories\n *\n * Retrieve all published stories from the CDN with optional filtering parameters.\n */\nexport const listStories = <ThrowOnError extends boolean = false>(options?: Options<ListStoriesData, ThrowOnError>) => (options?.client ?? client).get<ListStoriesResponses, ListStoriesErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/stories',\n ...options\n});\n\n/**\n * List tags\n *\n * Retrieve all tags from the CDN with optional filtering parameters.\n */\nexport const listTags = <ThrowOnError extends boolean = false>(options?: Options<ListTagsData, ThrowOnError>) => (options?.client ?? client).get<ListTagsResponses, ListTagsErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/tags',\n ...options\n});\n"],"mappings":";;;;;;;;AAwCA,MAAa,yBAA+D,aAAgE,SAAS,UAAUA,2BAAQ,IAA+E;CAClP,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,mBAAyD,aAA0D,SAAS,UAAUA,2BAAQ,IAAmE;CAC1N,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,qBAA2D,aAA2D,QAAQ,UAAUA,2BAAQ,IAAuE;CAChO,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,wBAA8D,aAA+D,SAAS,UAAUA,2BAAQ,IAA6E;CAC9O,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,aAAmD,aAAoD,SAAS,UAAUA,2BAAQ,IAAuD;CAClM,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAsBF,MAAa,YAAkD,aAAmD,SAAS,UAAUA,2BAAQ,IAAqD;CAC9L,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,gBAAsD,aAAsD,QAAQ,UAAUA,2BAAQ,IAA6D;CAC5M,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,eAAqD,aAAsD,SAAS,UAAUA,2BAAQ,IAA2D;CAC1M,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,YAAkD,aAAmD,SAAS,UAAUA,2BAAQ,IAAqD;CAC9L,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { client } from "./client.gen.mjs";
2
+
3
+ //#region src/generated/capi/sdk.gen.ts
4
+ /**
5
+ * List data source entries
6
+ *
7
+ * Retrieve all data source entries from the CDN with optional filtering parameters.
8
+ */
9
+ const listDatasourceEntries = (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
+ * List data sources
20
+ *
21
+ * Retrieve all data sources from the CDN with optional filtering parameters.
22
+ */
23
+ const listDatasources = (options) => (options?.client ?? client).get({
24
+ security: [{
25
+ in: "query",
26
+ name: "token",
27
+ type: "apiKey"
28
+ }],
29
+ url: "/v2/cdn/datasources",
30
+ ...options
31
+ });
32
+ /**
33
+ * Retrieve a single datasource by Id, full_slug.
34
+ *
35
+ * Fetch a single datasource by full_slug, numeric ID, slug.
36
+ */
37
+ const getDatasourceById = (options) => (options.client ?? client).get({
38
+ security: [{
39
+ in: "query",
40
+ name: "token",
41
+ type: "apiKey"
42
+ }],
43
+ url: "/v2/cdn/datasources/{id}",
44
+ ...options
45
+ });
46
+ /**
47
+ * List running experiments
48
+ *
49
+ * Retrieve all running experiments with their variants and associated story IDs. Only experiments with status 'running' are returned. No pagination — the result set is expected to be small per space.
50
+ */
51
+ const listCdnExperimentsV2 = (options) => (options?.client ?? client).get({
52
+ security: [{
53
+ in: "query",
54
+ name: "token",
55
+ type: "apiKey"
56
+ }],
57
+ url: "/v2/cdn/experiments",
58
+ ...options
59
+ });
60
+ /**
61
+ * List Links
62
+ *
63
+ * Retrieve all links (story references) in the space.
64
+ */
65
+ const listLinks = (options) => (options?.client ?? client).get({
66
+ security: [{
67
+ in: "query",
68
+ name: "token",
69
+ type: "apiKey"
70
+ }],
71
+ url: "/v2/cdn/links",
72
+ ...options
73
+ });
74
+ /**
75
+ * Retrieve space
76
+ *
77
+ * Retrieve space details including its ID, name, and domain.
78
+ */
79
+ const getSpace = (options) => (options?.client ?? client).get({
80
+ security: [{
81
+ in: "query",
82
+ name: "token",
83
+ type: "apiKey"
84
+ }],
85
+ url: "/v2/cdn/spaces/me",
86
+ ...options
87
+ });
88
+ /**
89
+ * Retrieve a single story by Id, UUID or full_slug.
90
+ *
91
+ * Fetch a single story by full_slug, numeric ID, or UUID, with optional resolution parameters.
92
+ */
93
+ const getStoryById = (options) => (options.client ?? client).get({
94
+ security: [{
95
+ in: "query",
96
+ name: "token",
97
+ type: "apiKey"
98
+ }],
99
+ url: "/v2/cdn/stories/{id}",
100
+ ...options
101
+ });
102
+ /**
103
+ * List all stories
104
+ *
105
+ * Retrieve all published stories from the CDN with optional filtering parameters.
106
+ */
107
+ const listStories = (options) => (options?.client ?? client).get({
108
+ security: [{
109
+ in: "query",
110
+ name: "token",
111
+ type: "apiKey"
112
+ }],
113
+ url: "/v2/cdn/stories",
114
+ ...options
115
+ });
116
+ /**
117
+ * List tags
118
+ *
119
+ * Retrieve all tags from the CDN with optional filtering parameters.
120
+ */
121
+ const listTags = (options) => (options?.client ?? client).get({
122
+ security: [{
123
+ in: "query",
124
+ name: "token",
125
+ type: "apiKey"
126
+ }],
127
+ url: "/v2/cdn/tags",
128
+ ...options
129
+ });
130
+
131
+ //#endregion
132
+ export { getDatasourceById, getSpace, getStoryById, listCdnExperimentsV2, listDatasourceEntries, listDatasources, listLinks, listStories, listTags };
133
+ //# sourceMappingURL=sdk.gen.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.gen.mjs","names":[],"sources":["../../../src/generated/capi/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Client, Options as Options2, TDataShape } from './client';\nimport { client } from './client.gen';\nimport type { GetAssetData, GetAssetErrors, GetAssetResponses, GetDatasourceByIdData, GetDatasourceByIdErrors, GetDatasourceByIdResponses, GetLinkByUuIdData, GetLinkByUuIdErrors, GetLinkByUuIdResponses, GetSpaceData, GetSpaceErrors, GetSpaceResponses, GetStoryByIdData, GetStoryByIdErrors, GetStoryByIdResponses, ListCdnExperimentsV2Data, ListCdnExperimentsV2Errors, ListCdnExperimentsV2Responses, ListDatasourceEntriesData, ListDatasourceEntriesErrors, ListDatasourceEntriesResponses, ListDatasourcesData, ListDatasourcesErrors, ListDatasourcesResponses, ListLinksData, ListLinksErrors, ListLinksResponses, ListStoriesData, ListStoriesErrors, ListStoriesResponses, ListTagsData, ListTagsErrors, ListTagsResponses } 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 asset\n *\n * Retrieve asset details.\n */\nexport const getAsset = <ThrowOnError extends boolean = false>(options: Options<GetAssetData, ThrowOnError>) => (options.client ?? client).get<GetAssetResponses, GetAssetErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/assets/me',\n ...options\n});\n\n/**\n * List data source entries\n *\n * Retrieve all data source entries from the CDN with optional filtering parameters.\n */\nexport const listDatasourceEntries = <ThrowOnError extends boolean = false>(options?: Options<ListDatasourceEntriesData, ThrowOnError>) => (options?.client ?? client).get<ListDatasourceEntriesResponses, ListDatasourceEntriesErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasource_entries',\n ...options\n});\n\n/**\n * List data sources\n *\n * Retrieve all data sources from the CDN with optional filtering parameters.\n */\nexport const listDatasources = <ThrowOnError extends boolean = false>(options?: Options<ListDatasourcesData, ThrowOnError>) => (options?.client ?? client).get<ListDatasourcesResponses, ListDatasourcesErrors, 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 a single datasource by Id, full_slug.\n *\n * Fetch a single datasource by full_slug, numeric ID, slug.\n */\nexport const getDatasourceById = <ThrowOnError extends boolean = false>(options: Options<GetDatasourceByIdData, ThrowOnError>) => (options.client ?? client).get<GetDatasourceByIdResponses, GetDatasourceByIdErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/datasources/{id}',\n ...options\n});\n\n/**\n * List running experiments\n *\n * Retrieve all running experiments with their variants and associated story IDs. Only experiments with status 'running' are returned. No pagination — the result set is expected to be small per space.\n */\nexport const listCdnExperimentsV2 = <ThrowOnError extends boolean = false>(options?: Options<ListCdnExperimentsV2Data, ThrowOnError>) => (options?.client ?? client).get<ListCdnExperimentsV2Responses, ListCdnExperimentsV2Errors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/experiments',\n ...options\n});\n\n/**\n * List Links\n *\n * Retrieve all links (story references) in the space.\n */\nexport const listLinks = <ThrowOnError extends boolean = false>(options?: Options<ListLinksData, ThrowOnError>) => (options?.client ?? client).get<ListLinksResponses, ListLinksErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/links',\n ...options\n});\n\n/**\n * Retrieve a single link by uuid.\n *\n * Fetch a single link by UUID.\n */\nexport const getLinkByUuId = <ThrowOnError extends boolean = false>(options: Options<GetLinkByUuIdData, ThrowOnError>) => (options.client ?? client).get<GetLinkByUuIdResponses, GetLinkByUuIdErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/links/{id}',\n ...options\n});\n\n/**\n * Retrieve space\n *\n * Retrieve space details including its ID, name, and domain.\n */\nexport const getSpace = <ThrowOnError extends boolean = false>(options?: Options<GetSpaceData, ThrowOnError>) => (options?.client ?? client).get<GetSpaceResponses, GetSpaceErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/spaces/me',\n ...options\n});\n\n/**\n * Retrieve a single story by Id, UUID or full_slug.\n *\n * Fetch a single story by full_slug, numeric ID, or UUID, with optional resolution parameters.\n */\nexport const getStoryById = <ThrowOnError extends boolean = false>(options: Options<GetStoryByIdData, ThrowOnError>) => (options.client ?? client).get<GetStoryByIdResponses, GetStoryByIdErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/stories/{id}',\n ...options\n});\n\n/**\n * List all stories\n *\n * Retrieve all published stories from the CDN with optional filtering parameters.\n */\nexport const listStories = <ThrowOnError extends boolean = false>(options?: Options<ListStoriesData, ThrowOnError>) => (options?.client ?? client).get<ListStoriesResponses, ListStoriesErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/stories',\n ...options\n});\n\n/**\n * List tags\n *\n * Retrieve all tags from the CDN with optional filtering parameters.\n */\nexport const listTags = <ThrowOnError extends boolean = false>(options?: Options<ListTagsData, ThrowOnError>) => (options?.client ?? client).get<ListTagsResponses, ListTagsErrors, ThrowOnError>({\n security: [{\n in: 'query',\n name: 'token',\n type: 'apiKey'\n }],\n url: '/v2/cdn/tags',\n ...options\n});\n"],"mappings":";;;;;;;;AAwCA,MAAa,yBAA+D,aAAgE,SAAS,UAAU,QAAQ,IAA+E;CAClP,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,mBAAyD,aAA0D,SAAS,UAAU,QAAQ,IAAmE;CAC1N,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,qBAA2D,aAA2D,QAAQ,UAAU,QAAQ,IAAuE;CAChO,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,wBAA8D,aAA+D,SAAS,UAAU,QAAQ,IAA6E;CAC9O,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,aAAmD,aAAoD,SAAS,UAAU,QAAQ,IAAuD;CAClM,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAsBF,MAAa,YAAkD,aAAmD,SAAS,UAAU,QAAQ,IAAqD;CAC9L,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,gBAAsD,aAAsD,QAAQ,UAAU,QAAQ,IAA6D;CAC5M,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,eAAqD,aAAsD,SAAS,UAAU,QAAQ,IAA2D;CAC1M,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC;;;;;;AAOF,MAAa,YAAkD,aAAmD,SAAS,UAAU,QAAQ,IAAqD;CAC9L,UAAU,CAAC;EACH,IAAI;EACJ,MAAM;EACN,MAAM;EACT,CAAC;CACN,KAAK;CACL,GAAG;CACN,CAAC"}
@@ -0,0 +1,181 @@
1
+ //#region src/generated/capi/types-aliased.gen.d.ts
2
+ type Datasource = {
3
+ /**
4
+ * ID.
5
+ */
6
+ id: number;
7
+ /**
8
+ * Name.
9
+ */
10
+ name: string;
11
+ /**
12
+ * The unique slug of the datasource.
13
+ */
14
+ slug: string;
15
+ /**
16
+ * Dimensions of the datasource.
17
+ */
18
+ dimensions: Array<Dimension>;
19
+ /**
20
+ * Creation timestamp (format is ISO 8601 standard in UTC).
21
+ */
22
+ created_at?: string;
23
+ /**
24
+ * Latest update timestamp (format is ISO 8601 standard in UTC).
25
+ */
26
+ updated_at?: string;
27
+ };
28
+ type DatasourceEntry = {
29
+ /**
30
+ * ID.
31
+ */
32
+ id: number;
33
+ /**
34
+ * Name.
35
+ */
36
+ name: string;
37
+ /**
38
+ * Given value in default dimension.
39
+ */
40
+ value: string;
41
+ /**
42
+ * Given value in the requested dimension.
43
+ */
44
+ dimension_value: string | null;
45
+ };
46
+ type Link = {
47
+ /**
48
+ * ID.
49
+ */
50
+ id: number;
51
+ uuid: string;
52
+ /**
53
+ * The full slug of the story or folder.
54
+ */
55
+ slug: string;
56
+ /**
57
+ * Real path defined in the story's entry configuration.
58
+ */
59
+ path?: string | null;
60
+ /**
61
+ * Either the full slug of the story or folder with a leading /, or, if existent, the value of the real path defined in the story's entry configuration with a leading /.
62
+ */
63
+ real_path?: string | null;
64
+ /**
65
+ * The complete name of the story or folder.
66
+ */
67
+ name: string;
68
+ /**
69
+ * true if a story is currently published, even if it has unpublished changes.
70
+ */
71
+ published: boolean;
72
+ /**
73
+ * ID of the parent folder.
74
+ */
75
+ parent_id: number;
76
+ /**
77
+ * true if the instance constitutes a folder.
78
+ */
79
+ is_folder: boolean;
80
+ /**
81
+ * true if the story is defined as root for the folder.
82
+ */
83
+ is_startpage: boolean;
84
+ /**
85
+ * Numeric representation of the story's position in the folder.
86
+ */
87
+ position: number;
88
+ /**
89
+ * Latest publication timestamp (format is ISO 8601 standard in UTC).
90
+ */
91
+ published_at?: string | null;
92
+ /**
93
+ * Creation timestamp (format is ISO 8601 standard in UTC).
94
+ */
95
+ created_at?: string | null;
96
+ /**
97
+ * Latest update timestamp (format is ISO 8601 standard in UTC).
98
+ */
99
+ updated_at?: string | null;
100
+ /**
101
+ * Alternate language variants.
102
+ */
103
+ alternates?: Array<Alternate>;
104
+ };
105
+ type Tag = {
106
+ /**
107
+ * The name of the tag.
108
+ */
109
+ name: string;
110
+ /**
111
+ * The minimum value of `taggings_count` is 1, not 0.
112
+ * - The number of tags with this name that exist in the space, or
113
+ * - The number of draft or published stories with this tag, or
114
+ * - The number of deleted stories with this tag.
115
+ */
116
+ taggings_count?: number;
117
+ /**
118
+ * Only visible when passing the `all_tags` parameter. The number of stories currently associated with the tag, corresponding to the <strong>Assigned items</strong> column in the <a href='https://www.storyblok.com/docs/manuals/stories#tags'>Tags tab</a>.
119
+ */
120
+ tag_on_stories?: number;
121
+ };
122
+ type StoryAlternate = {
123
+ id: number;
124
+ name: string;
125
+ slug: string;
126
+ published: boolean | null;
127
+ full_slug: string;
128
+ is_folder: boolean;
129
+ parent_id: number;
130
+ };
131
+ type Dimension = {
132
+ /**
133
+ * ID.
134
+ */
135
+ id: number;
136
+ /**
137
+ * Name.
138
+ */
139
+ name: string;
140
+ /**
141
+ * The value provided for the datasource dimension.
142
+ */
143
+ entry_value: string;
144
+ /**
145
+ * The numeric ID of the datasource that the dimension belongs to.
146
+ */
147
+ datasource_id?: number;
148
+ /**
149
+ * Creation timestamp (format is ISO 8601 standard in UTC).
150
+ */
151
+ created_at?: string;
152
+ /**
153
+ * Latest update timestamp (format is ISO 8601 standard in UTC).
154
+ */
155
+ updated_at?: string;
156
+ };
157
+ type Alternate = {
158
+ /**
159
+ * Translated slug (or parent slug if not installed).
160
+ */
161
+ path: string;
162
+ /**
163
+ * Translated name of the story or folder.
164
+ */
165
+ name: string;
166
+ /**
167
+ * Language code of this story variant.
168
+ */
169
+ lang: string;
170
+ /**
171
+ * True if this variant is published.
172
+ */
173
+ published: boolean;
174
+ /**
175
+ * Translated slug of the story.
176
+ */
177
+ translated_slug: string;
178
+ };
179
+ //#endregion
180
+ export { Datasource, DatasourceEntry, Link, StoryAlternate, Tag };
181
+ //# sourceMappingURL=types-aliased.gen.d.cts.map