@planqk/planqk-api-sdk 1.0.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.
Files changed (222) hide show
  1. package/.devcontainer/devcontainer.json +32 -0
  2. package/.devcontainer/post-create.sh +7 -0
  3. package/.env.template +2 -0
  4. package/.gitlab-ci.yml +71 -0
  5. package/.python-version +1 -0
  6. package/.releaserc.json +45 -0
  7. package/LICENSE +201 -0
  8. package/README-node.md +18 -0
  9. package/README-python.md +21 -0
  10. package/README.md +56 -0
  11. package/dist/Client.d.ts +32 -0
  12. package/dist/Client.js +60 -0
  13. package/dist/api/errors/BadRequestError.d.ts +8 -0
  14. package/dist/api/errors/BadRequestError.js +52 -0
  15. package/dist/api/errors/ForbiddenError.d.ts +8 -0
  16. package/dist/api/errors/ForbiddenError.js +52 -0
  17. package/dist/api/errors/InternalServerError.d.ts +8 -0
  18. package/dist/api/errors/InternalServerError.js +52 -0
  19. package/dist/api/errors/NotFoundError.d.ts +8 -0
  20. package/dist/api/errors/NotFoundError.js +52 -0
  21. package/dist/api/errors/UnauthorizedError.d.ts +8 -0
  22. package/dist/api/errors/UnauthorizedError.js +52 -0
  23. package/dist/api/errors/index.d.ts +5 -0
  24. package/dist/api/errors/index.js +21 -0
  25. package/dist/api/index.d.ts +3 -0
  26. package/dist/api/index.js +19 -0
  27. package/dist/api/resources/dataPools/client/Client.d.ts +177 -0
  28. package/dist/api/resources/dataPools/client/Client.js +676 -0
  29. package/dist/api/resources/dataPools/client/index.d.ts +2 -0
  30. package/dist/api/resources/dataPools/client/index.js +17 -0
  31. package/dist/api/resources/dataPools/client/requests/AddDataPoolFileRequest.d.ts +14 -0
  32. package/dist/api/resources/dataPools/client/requests/AddDataPoolFileRequest.js +5 -0
  33. package/dist/api/resources/dataPools/client/requests/CreateDataPoolRequest.d.ts +10 -0
  34. package/dist/api/resources/dataPools/client/requests/CreateDataPoolRequest.js +5 -0
  35. package/dist/api/resources/dataPools/client/requests/UpdateDataPoolRequest.d.ts +12 -0
  36. package/dist/api/resources/dataPools/client/requests/UpdateDataPoolRequest.js +5 -0
  37. package/dist/api/resources/dataPools/client/requests/index.d.ts +3 -0
  38. package/dist/api/resources/dataPools/client/requests/index.js +2 -0
  39. package/dist/api/resources/dataPools/index.d.ts +1 -0
  40. package/dist/api/resources/dataPools/index.js +17 -0
  41. package/dist/api/resources/index.d.ts +2 -0
  42. package/dist/api/resources/index.js +41 -0
  43. package/dist/api/types/DataPoolDto.d.ts +23 -0
  44. package/dist/api/types/DataPoolDto.js +14 -0
  45. package/dist/api/types/DataPoolFileDto.d.ts +12 -0
  46. package/dist/api/types/DataPoolFileDto.js +5 -0
  47. package/dist/api/types/OauthScope.d.ts +9 -0
  48. package/dist/api/types/OauthScope.js +9 -0
  49. package/dist/api/types/index.d.ts +3 -0
  50. package/dist/api/types/index.js +19 -0
  51. package/dist/core/fetcher/APIResponse.d.ts +20 -0
  52. package/dist/core/fetcher/APIResponse.js +2 -0
  53. package/dist/core/fetcher/BinaryResponse.d.ts +20 -0
  54. package/dist/core/fetcher/BinaryResponse.js +17 -0
  55. package/dist/core/fetcher/Fetcher.d.ts +40 -0
  56. package/dist/core/fetcher/Fetcher.js +105 -0
  57. package/dist/core/fetcher/Headers.d.ts +2 -0
  58. package/dist/core/fetcher/Headers.js +85 -0
  59. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  60. package/dist/core/fetcher/HttpResponsePromise.js +94 -0
  61. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  62. package/dist/core/fetcher/RawResponse.js +44 -0
  63. package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
  64. package/dist/core/fetcher/ResponseWithBody.js +6 -0
  65. package/dist/core/fetcher/Supplier.d.ts +4 -0
  66. package/dist/core/fetcher/Supplier.js +13 -0
  67. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  68. package/dist/core/fetcher/createRequestUrl.js +8 -0
  69. package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
  70. package/dist/core/fetcher/getErrorResponseBody.js +32 -0
  71. package/dist/core/fetcher/getFetchFn.d.ts +1 -0
  72. package/dist/core/fetcher/getFetchFn.js +6 -0
  73. package/dist/core/fetcher/getHeader.d.ts +1 -0
  74. package/dist/core/fetcher/getHeader.js +11 -0
  75. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  76. package/dist/core/fetcher/getRequestBody.js +12 -0
  77. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  78. package/dist/core/fetcher/getResponseBody.js +44 -0
  79. package/dist/core/fetcher/index.d.ts +9 -0
  80. package/dist/core/fetcher/index.js +15 -0
  81. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  82. package/dist/core/fetcher/makeRequest.js +33 -0
  83. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  84. package/dist/core/fetcher/requestWithRetries.js +29 -0
  85. package/dist/core/fetcher/signals.d.ts +11 -0
  86. package/dist/core/fetcher/signals.js +36 -0
  87. package/dist/core/file.d.ts +1 -0
  88. package/dist/core/file.js +2 -0
  89. package/dist/core/form-data-utils/FormDataWrapper.d.ts +16 -0
  90. package/dist/core/form-data-utils/FormDataWrapper.js +166 -0
  91. package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
  92. package/dist/core/form-data-utils/encodeAsFormParameter.js +12 -0
  93. package/dist/core/form-data-utils/index.d.ts +2 -0
  94. package/dist/core/form-data-utils/index.js +20 -0
  95. package/dist/core/headers.d.ts +3 -0
  96. package/dist/core/headers.js +29 -0
  97. package/dist/core/index.d.ts +5 -0
  98. package/dist/core/index.js +44 -0
  99. package/dist/core/json.d.ts +15 -0
  100. package/dist/core/json.js +24 -0
  101. package/dist/core/runtime/index.d.ts +1 -0
  102. package/dist/core/runtime/index.js +5 -0
  103. package/dist/core/runtime/runtime.d.ts +9 -0
  104. package/dist/core/runtime/runtime.js +101 -0
  105. package/dist/core/url/index.d.ts +2 -0
  106. package/dist/core/url/index.js +7 -0
  107. package/dist/core/url/join.d.ts +1 -0
  108. package/dist/core/url/join.js +49 -0
  109. package/dist/core/url/qs.d.ts +6 -0
  110. package/dist/core/url/qs.js +67 -0
  111. package/dist/environments.d.ts +7 -0
  112. package/dist/environments.js +9 -0
  113. package/dist/errors/PlanqkApiError.d.ts +15 -0
  114. package/dist/errors/PlanqkApiError.js +33 -0
  115. package/dist/errors/PlanqkApiTimeoutError.d.ts +6 -0
  116. package/dist/errors/PlanqkApiTimeoutError.js +13 -0
  117. package/dist/errors/index.d.ts +2 -0
  118. package/dist/errors/index.js +7 -0
  119. package/dist/index.d.ts +4 -0
  120. package/dist/index.js +44 -0
  121. package/eslint.config.mjs +11 -0
  122. package/fern/fern.config.json +4 -0
  123. package/fern/generators.yml +25 -0
  124. package/fern/openapi/openapi.json +610 -0
  125. package/notebooks/python-sdk.ipynb +218 -0
  126. package/package.json +48 -0
  127. package/planqk/__init__.py +0 -0
  128. package/planqk/api/__init__.py +1 -0
  129. package/planqk/api/_version.py +1 -0
  130. package/planqk/api/client.py +19 -0
  131. package/planqk/api/credentials.py +103 -0
  132. package/planqk/api/sdk/__init__.py +25 -0
  133. package/planqk/api/sdk/client.py +153 -0
  134. package/planqk/api/sdk/core/__init__.py +52 -0
  135. package/planqk/api/sdk/core/api_error.py +23 -0
  136. package/planqk/api/sdk/core/client_wrapper.py +76 -0
  137. package/planqk/api/sdk/core/datetime_utils.py +28 -0
  138. package/planqk/api/sdk/core/file.py +67 -0
  139. package/planqk/api/sdk/core/force_multipart.py +16 -0
  140. package/planqk/api/sdk/core/http_client.py +543 -0
  141. package/planqk/api/sdk/core/http_response.py +55 -0
  142. package/planqk/api/sdk/core/jsonable_encoder.py +100 -0
  143. package/planqk/api/sdk/core/pydantic_utilities.py +255 -0
  144. package/planqk/api/sdk/core/query_encoder.py +58 -0
  145. package/planqk/api/sdk/core/remove_none_from_dict.py +11 -0
  146. package/planqk/api/sdk/core/request_options.py +35 -0
  147. package/planqk/api/sdk/core/serialization.py +276 -0
  148. package/planqk/api/sdk/data_pools/__init__.py +4 -0
  149. package/planqk/api/sdk/data_pools/client.py +700 -0
  150. package/planqk/api/sdk/data_pools/raw_client.py +1650 -0
  151. package/planqk/api/sdk/environment.py +7 -0
  152. package/planqk/api/sdk/errors/__init__.py +11 -0
  153. package/planqk/api/sdk/errors/bad_request_error.py +10 -0
  154. package/planqk/api/sdk/errors/forbidden_error.py +10 -0
  155. package/planqk/api/sdk/errors/internal_server_error.py +10 -0
  156. package/planqk/api/sdk/errors/not_found_error.py +10 -0
  157. package/planqk/api/sdk/errors/unauthorized_error.py +10 -0
  158. package/planqk/api/sdk/types/__init__.py +10 -0
  159. package/planqk/api/sdk/types/data_pool_dto.py +33 -0
  160. package/planqk/api/sdk/types/data_pool_dto_current_user_permission.py +5 -0
  161. package/planqk/api/sdk/types/data_pool_file_dto.py +27 -0
  162. package/planqk/api/sdk/types/oauth_scope.py +5 -0
  163. package/pyproject.toml +51 -0
  164. package/scripts/update-version.sh +6 -0
  165. package/src/Client.ts +53 -0
  166. package/src/api/errors/BadRequestError.ts +18 -0
  167. package/src/api/errors/ForbiddenError.ts +18 -0
  168. package/src/api/errors/InternalServerError.ts +18 -0
  169. package/src/api/errors/NotFoundError.ts +18 -0
  170. package/src/api/errors/UnauthorizedError.ts +18 -0
  171. package/src/api/errors/index.ts +5 -0
  172. package/src/api/index.ts +3 -0
  173. package/src/api/resources/dataPools/client/Client.ts +825 -0
  174. package/src/api/resources/dataPools/client/index.ts +2 -0
  175. package/src/api/resources/dataPools/client/requests/AddDataPoolFileRequest.ts +17 -0
  176. package/src/api/resources/dataPools/client/requests/CreateDataPoolRequest.ts +11 -0
  177. package/src/api/resources/dataPools/client/requests/UpdateDataPoolRequest.ts +13 -0
  178. package/src/api/resources/dataPools/client/requests/index.ts +3 -0
  179. package/src/api/resources/dataPools/index.ts +1 -0
  180. package/src/api/resources/index.ts +2 -0
  181. package/src/api/types/DataPoolDto.ts +25 -0
  182. package/src/api/types/DataPoolFileDto.ts +13 -0
  183. package/src/api/types/OauthScope.ts +10 -0
  184. package/src/api/types/index.ts +3 -0
  185. package/src/core/fetcher/APIResponse.ts +23 -0
  186. package/src/core/fetcher/BinaryResponse.ts +36 -0
  187. package/src/core/fetcher/Fetcher.ts +163 -0
  188. package/src/core/fetcher/Headers.ts +93 -0
  189. package/src/core/fetcher/HttpResponsePromise.ts +116 -0
  190. package/src/core/fetcher/RawResponse.ts +61 -0
  191. package/src/core/fetcher/ResponseWithBody.ts +7 -0
  192. package/src/core/fetcher/Supplier.ts +11 -0
  193. package/src/core/fetcher/createRequestUrl.ts +6 -0
  194. package/src/core/fetcher/getErrorResponseBody.ts +32 -0
  195. package/src/core/fetcher/getFetchFn.ts +3 -0
  196. package/src/core/fetcher/getHeader.ts +8 -0
  197. package/src/core/fetcher/getRequestBody.ts +16 -0
  198. package/src/core/fetcher/getResponseBody.ts +43 -0
  199. package/src/core/fetcher/index.ts +9 -0
  200. package/src/core/fetcher/makeRequest.ts +44 -0
  201. package/src/core/fetcher/requestWithRetries.ts +33 -0
  202. package/src/core/fetcher/signals.ts +38 -0
  203. package/src/core/file.ts +11 -0
  204. package/src/core/form-data-utils/FormDataWrapper.ts +176 -0
  205. package/src/core/form-data-utils/encodeAsFormParameter.ts +12 -0
  206. package/src/core/form-data-utils/index.ts +2 -0
  207. package/src/core/headers.ts +35 -0
  208. package/src/core/index.ts +5 -0
  209. package/src/core/json.ts +27 -0
  210. package/src/core/runtime/index.ts +1 -0
  211. package/src/core/runtime/runtime.ts +133 -0
  212. package/src/core/url/index.ts +2 -0
  213. package/src/core/url/join.ts +55 -0
  214. package/src/core/url/qs.ts +74 -0
  215. package/src/environments.ts +9 -0
  216. package/src/errors/PlanqkApiError.ts +55 -0
  217. package/src/errors/PlanqkApiTimeoutError.ts +10 -0
  218. package/src/errors/index.ts +2 -0
  219. package/src/index.test.ts +17 -0
  220. package/src/index.ts +4 -0
  221. package/tsconfig.json +18 -0
  222. package/uv.lock +1102 -0
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import enum
4
+
5
+
6
+ class PlanqkApiEnvironment(enum.Enum):
7
+ DEFAULT = "https://34.90.225.20.nip.io/qc-catalog"
@@ -0,0 +1,11 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .bad_request_error import BadRequestError
6
+ from .forbidden_error import ForbiddenError
7
+ from .internal_server_error import InternalServerError
8
+ from .not_found_error import NotFoundError
9
+ from .unauthorized_error import UnauthorizedError
10
+
11
+ __all__ = ["BadRequestError", "ForbiddenError", "InternalServerError", "NotFoundError", "UnauthorizedError"]
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+
7
+
8
+ class BadRequestError(ApiError):
9
+ def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
+ super().__init__(status_code=400, headers=headers, body=body)
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+
7
+
8
+ class ForbiddenError(ApiError):
9
+ def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
+ super().__init__(status_code=403, headers=headers, body=body)
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+
7
+
8
+ class InternalServerError(ApiError):
9
+ def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
+ super().__init__(status_code=500, headers=headers, body=body)
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+
7
+
8
+ class NotFoundError(ApiError):
9
+ def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
+ super().__init__(status_code=404, headers=headers, body=body)
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.api_error import ApiError
6
+
7
+
8
+ class UnauthorizedError(ApiError):
9
+ def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
10
+ super().__init__(status_code=401, headers=headers, body=body)
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .data_pool_dto import DataPoolDto
6
+ from .data_pool_dto_current_user_permission import DataPoolDtoCurrentUserPermission
7
+ from .data_pool_file_dto import DataPoolFileDto
8
+ from .oauth_scope import OauthScope
9
+
10
+ __all__ = ["DataPoolDto", "DataPoolDtoCurrentUserPermission", "DataPoolFileDto", "OauthScope"]
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .data_pool_dto_current_user_permission import DataPoolDtoCurrentUserPermission
10
+
11
+
12
+ class DataPoolDto(UniversalBaseModel):
13
+ current_user_permission: typing_extensions.Annotated[
14
+ typing.Optional[DataPoolDtoCurrentUserPermission], FieldMetadata(alias="currentUserPermission")
15
+ ] = pydantic.Field(default=None)
16
+ """
17
+ The access permission role for this entity of the current user
18
+ """
19
+
20
+ id: typing.Optional[str] = None
21
+ name: typing.Optional[str] = None
22
+ short_description: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="shortDescription")] = None
23
+ description: typing.Optional[str] = None
24
+ created_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdAt")] = None
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28
+ else:
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ DataPoolDtoCurrentUserPermission = typing.Union[typing.Literal["VIEWER", "MAINTAINER", "OWNER"], typing.Any]
@@ -0,0 +1,27 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+
10
+
11
+ class DataPoolFileDto(UniversalBaseModel):
12
+ id: typing.Optional[str] = None
13
+ data_pool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="dataPoolId")] = None
14
+ name: typing.Optional[str] = None
15
+ full_path: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="fullPath")] = None
16
+ content_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="contentType")] = None
17
+ content_length: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="contentLength")] = None
18
+ created_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdAt")] = None
19
+
20
+ if IS_PYDANTIC_V2:
21
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
22
+ else:
23
+
24
+ class Config:
25
+ frozen = True
26
+ smart_union = True
27
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ OauthScope = typing.Union[typing.Literal["profile"], typing.Any]
package/pyproject.toml ADDED
@@ -0,0 +1,51 @@
1
+ [project]
2
+ name = "planqk-api-sdk"
3
+ version = "1.0.0"
4
+ description = "SDK to interact with the official PLANQK API."
5
+ authors = [
6
+ { name = "Kipu Quantum GmbH", email = "info@kipu-quantum.com" },
7
+ ]
8
+ maintainers = [
9
+ { name = "Michael Wurster", email = "michael.wurster@kipu-quantum.com" },
10
+ ]
11
+ classifiers = [
12
+ "Programming Language :: Python :: 3",
13
+ "License :: OSI Approved :: Apache Software License",
14
+ "Operating System :: OS Independent",
15
+ ]
16
+ readme = "README-python.md"
17
+ license = { file = "LICENSE" }
18
+ requires-python = ">=3.9"
19
+ dependencies = [
20
+ "authlib>=1.5.1",
21
+ "httpx>=0.28.1",
22
+ "pydantic>=2.5.0,<2.10",
23
+ ]
24
+
25
+ [dependency-groups]
26
+ dev = [
27
+ "ipykernel>=6.29.5",
28
+ "pylint>=3.3.5",
29
+ "pytest>=8.3.5",
30
+ "pytest-dotenv>=0.5.2",
31
+ ]
32
+
33
+ [project.urls]
34
+ Homepage = "https://kipu-quantum.com/platform"
35
+ Documentation = "https://docs.planqk.de"
36
+ Repository = "https://gitlab.com/planqk-foss/planqk-api-sdk"
37
+ Issues = "https://gitlab.com/planqk-foss/planqk-api-sdk/-/issues"
38
+ Changelog = "https://gitlab.com/planqk-foss/planqk-api-sdk/-/releases"
39
+
40
+ [build-system]
41
+ requires = ["setuptools >= 61.0", "wheel", "twine"]
42
+ build-backend = "setuptools.build_meta"
43
+
44
+ # https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
45
+ [tool.setuptools.packages.find]
46
+ include = ["planqk*"]
47
+
48
+ [tool.pylint.MASTER]
49
+ ignore-paths = '^planqk/api/sdk/.*$'
50
+ max-line-length = 120
51
+ disable = ['missing-module-docstring', 'missing-class-docstring', 'missing-function-docstring']
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env sh
2
+
3
+ version=${1:-0.0.0}
4
+
5
+ sed -i "s/^__version__ = .*$/__version__ = \"${version}\"/g" planqk/service/_version.py
6
+ sed -i "s/^version = .*$/version = \"${version}\"/g" pyproject.toml
package/src/Client.ts ADDED
@@ -0,0 +1,53 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ import * as environments from "./environments.js";
6
+ import * as core from "./core/index.js";
7
+ import { mergeHeaders } from "./core/headers.js";
8
+ import { DataPools } from "./api/resources/dataPools/client/Client.js";
9
+
10
+ export declare namespace PlanqkApiClient {
11
+ export interface Options {
12
+ environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
13
+ /** Specify a custom URL to connect the client to. */
14
+ baseUrl?: core.Supplier<string>;
15
+ apiKey: core.Supplier<string>;
16
+ /** Additional headers to include in requests. */
17
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
18
+ }
19
+
20
+ export interface RequestOptions {
21
+ /** The maximum time to wait for a response in seconds. */
22
+ timeoutInSeconds?: number;
23
+ /** The number of times to retry the request. Defaults to 2. */
24
+ maxRetries?: number;
25
+ /** A hook to abort the request. */
26
+ abortSignal?: AbortSignal;
27
+ /** Additional headers to include in the request. */
28
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
29
+ }
30
+ }
31
+
32
+ export class PlanqkApiClient {
33
+ protected readonly _options: PlanqkApiClient.Options;
34
+ protected _dataPools: DataPools | undefined;
35
+
36
+ constructor(_options: PlanqkApiClient.Options) {
37
+ this._options = {
38
+ ..._options,
39
+ headers: mergeHeaders(
40
+ {
41
+ "X-Fern-Language": "JavaScript",
42
+ "X-Fern-Runtime": core.RUNTIME.type,
43
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
44
+ },
45
+ _options?.headers,
46
+ ),
47
+ };
48
+ }
49
+
50
+ public get dataPools(): DataPools {
51
+ return (this._dataPools ??= new DataPools(this._options));
52
+ }
53
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ import * as errors from "../../errors/index.js";
6
+ import * as core from "../../core/index.js";
7
+
8
+ export class BadRequestError extends errors.PlanqkApiError {
9
+ constructor(body?: any, rawResponse?: core.RawResponse) {
10
+ super({
11
+ message: "BadRequestError",
12
+ statusCode: 400,
13
+ body: body,
14
+ rawResponse: rawResponse,
15
+ });
16
+ Object.setPrototypeOf(this, BadRequestError.prototype);
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ import * as errors from "../../errors/index.js";
6
+ import * as core from "../../core/index.js";
7
+
8
+ export class ForbiddenError extends errors.PlanqkApiError {
9
+ constructor(body?: any, rawResponse?: core.RawResponse) {
10
+ super({
11
+ message: "ForbiddenError",
12
+ statusCode: 403,
13
+ body: body,
14
+ rawResponse: rawResponse,
15
+ });
16
+ Object.setPrototypeOf(this, ForbiddenError.prototype);
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ import * as errors from "../../errors/index.js";
6
+ import * as core from "../../core/index.js";
7
+
8
+ export class InternalServerError extends errors.PlanqkApiError {
9
+ constructor(body?: any, rawResponse?: core.RawResponse) {
10
+ super({
11
+ message: "InternalServerError",
12
+ statusCode: 500,
13
+ body: body,
14
+ rawResponse: rawResponse,
15
+ });
16
+ Object.setPrototypeOf(this, InternalServerError.prototype);
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ import * as errors from "../../errors/index.js";
6
+ import * as core from "../../core/index.js";
7
+
8
+ export class NotFoundError extends errors.PlanqkApiError {
9
+ constructor(body?: any, rawResponse?: core.RawResponse) {
10
+ super({
11
+ message: "NotFoundError",
12
+ statusCode: 404,
13
+ body: body,
14
+ rawResponse: rawResponse,
15
+ });
16
+ Object.setPrototypeOf(this, NotFoundError.prototype);
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ import * as errors from "../../errors/index.js";
6
+ import * as core from "../../core/index.js";
7
+
8
+ export class UnauthorizedError extends errors.PlanqkApiError {
9
+ constructor(body?: any, rawResponse?: core.RawResponse) {
10
+ super({
11
+ message: "UnauthorizedError",
12
+ statusCode: 401,
13
+ body: body,
14
+ rawResponse: rawResponse,
15
+ });
16
+ Object.setPrototypeOf(this, UnauthorizedError.prototype);
17
+ }
18
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./UnauthorizedError.js";
2
+ export * from "./ForbiddenError.js";
3
+ export * from "./NotFoundError.js";
4
+ export * from "./InternalServerError.js";
5
+ export * from "./BadRequestError.js";
@@ -0,0 +1,3 @@
1
+ export * from "./types/index.js";
2
+ export * from "./errors/index.js";
3
+ export * from "./resources/index.js";