@remkoj/optimizely-graph-client 1.0.1

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 (207) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +135 -0
  3. package/dist/admin-api/client/OptimizelyGraphAdminApi.d.ts +22 -0
  4. package/dist/admin-api/client/OptimizelyGraphAdminApi.js +31 -0
  5. package/dist/admin-api/client/OptimizelyGraphAdminApi.js.map +1 -0
  6. package/dist/admin-api/client/core/ApiError.d.ts +10 -0
  7. package/dist/admin-api/client/core/ApiError.js +12 -0
  8. package/dist/admin-api/client/core/ApiError.js.map +1 -0
  9. package/dist/admin-api/client/core/ApiRequestOptions.d.ts +13 -0
  10. package/dist/admin-api/client/core/ApiRequestOptions.js +2 -0
  11. package/dist/admin-api/client/core/ApiRequestOptions.js.map +1 -0
  12. package/dist/admin-api/client/core/ApiResult.d.ts +7 -0
  13. package/dist/admin-api/client/core/ApiResult.js +2 -0
  14. package/dist/admin-api/client/core/ApiResult.js.map +1 -0
  15. package/dist/admin-api/client/core/BaseHttpRequest.d.ts +8 -0
  16. package/dist/admin-api/client/core/BaseHttpRequest.js +6 -0
  17. package/dist/admin-api/client/core/BaseHttpRequest.js.map +1 -0
  18. package/dist/admin-api/client/core/CancelablePromise.d.ts +20 -0
  19. package/dist/admin-api/client/core/CancelablePromise.js +112 -0
  20. package/dist/admin-api/client/core/CancelablePromise.js.map +1 -0
  21. package/dist/admin-api/client/core/FetchHttpRequest.d.ts +14 -0
  22. package/dist/admin-api/client/core/FetchHttpRequest.js +17 -0
  23. package/dist/admin-api/client/core/FetchHttpRequest.js.map +1 -0
  24. package/dist/admin-api/client/core/OpenAPI.d.ts +16 -0
  25. package/dist/admin-api/client/core/OpenAPI.js +12 -0
  26. package/dist/admin-api/client/core/OpenAPI.js.map +1 -0
  27. package/dist/admin-api/client/core/request.d.ts +30 -0
  28. package/dist/admin-api/client/core/request.js +276 -0
  29. package/dist/admin-api/client/core/request.js.map +1 -0
  30. package/dist/admin-api/client/index.d.ts +45 -0
  31. package/dist/admin-api/client/index.js +17 -0
  32. package/dist/admin-api/client/index.js.map +1 -0
  33. package/dist/admin-api/client/models/CacheInvalidationConfig.d.ts +3 -0
  34. package/dist/admin-api/client/models/CacheInvalidationConfig.js +2 -0
  35. package/dist/admin-api/client/models/CacheInvalidationConfig.js.map +1 -0
  36. package/dist/admin-api/client/models/ContentTypeDefinition_V2.d.ts +10 -0
  37. package/dist/admin-api/client/models/ContentTypeDefinition_V2.js +2 -0
  38. package/dist/admin-api/client/models/ContentTypeDefinition_V2.js.map +1 -0
  39. package/dist/admin-api/client/models/ContentTypeDefinition_V3.d.ts +11 -0
  40. package/dist/admin-api/client/models/ContentTypeDefinition_V3.js +2 -0
  41. package/dist/admin-api/client/models/ContentTypeDefinition_V3.js.map +1 -0
  42. package/dist/admin-api/client/models/ContentTypeMap_V3.d.ts +2 -0
  43. package/dist/admin-api/client/models/ContentTypeMap_V3.js +2 -0
  44. package/dist/admin-api/client/models/ContentTypeMap_V3.js.map +1 -0
  45. package/dist/admin-api/client/models/ContentTypeProperty_V2.d.ts +5 -0
  46. package/dist/admin-api/client/models/ContentTypeProperty_V2.js +2 -0
  47. package/dist/admin-api/client/models/ContentTypeProperty_V2.js.map +1 -0
  48. package/dist/admin-api/client/models/ContentTypeProperty_V3.d.ts +7 -0
  49. package/dist/admin-api/client/models/ContentTypeProperty_V3.js +2 -0
  50. package/dist/admin-api/client/models/ContentTypeProperty_V3.js.map +1 -0
  51. package/dist/admin-api/client/models/ContentType_V2.d.ts +12 -0
  52. package/dist/admin-api/client/models/ContentType_V2.js +2 -0
  53. package/dist/admin-api/client/models/ContentType_V2.js.map +1 -0
  54. package/dist/admin-api/client/models/ContentType_V3.d.ts +11 -0
  55. package/dist/admin-api/client/models/ContentType_V3.js +2 -0
  56. package/dist/admin-api/client/models/ContentType_V3.js.map +1 -0
  57. package/dist/admin-api/client/models/FilterMap.d.ts +2 -0
  58. package/dist/admin-api/client/models/FilterMap.js +2 -0
  59. package/dist/admin-api/client/models/FilterMap.js.map +1 -0
  60. package/dist/admin-api/client/models/GraphQLRequest.d.ts +6 -0
  61. package/dist/admin-api/client/models/GraphQLRequest.js +2 -0
  62. package/dist/admin-api/client/models/GraphQLRequest.js.map +1 -0
  63. package/dist/admin-api/client/models/GraphQLResponse.d.ts +5 -0
  64. package/dist/admin-api/client/models/GraphQLResponse.js +2 -0
  65. package/dist/admin-api/client/models/GraphQLResponse.js.map +1 -0
  66. package/dist/admin-api/client/models/LinkMap.d.ts +2 -0
  67. package/dist/admin-api/client/models/LinkMap.js +2 -0
  68. package/dist/admin-api/client/models/LinkMap.js.map +1 -0
  69. package/dist/admin-api/client/models/LinkProperty.d.ts +4 -0
  70. package/dist/admin-api/client/models/LinkProperty.js +2 -0
  71. package/dist/admin-api/client/models/LinkProperty.js.map +1 -0
  72. package/dist/admin-api/client/models/OperationMap.d.ts +4 -0
  73. package/dist/admin-api/client/models/OperationMap.js +2 -0
  74. package/dist/admin-api/client/models/OperationMap.js.map +1 -0
  75. package/dist/admin-api/client/models/Optional_string_.d.ts +1 -0
  76. package/dist/admin-api/client/models/Optional_string_.js +2 -0
  77. package/dist/admin-api/client/models/Optional_string_.js.map +1 -0
  78. package/dist/admin-api/client/models/Partial_Record_FieldKeys_OperationMap__.d.ts +8 -0
  79. package/dist/admin-api/client/models/Partial_Record_FieldKeys_OperationMap__.js +2 -0
  80. package/dist/admin-api/client/models/Partial_Record_FieldKeys_OperationMap__.js.map +1 -0
  81. package/dist/admin-api/client/models/PropertyTypeMap_V3.d.ts +2 -0
  82. package/dist/admin-api/client/models/PropertyTypeMap_V3.js +2 -0
  83. package/dist/admin-api/client/models/PropertyTypeMap_V3.js.map +1 -0
  84. package/dist/admin-api/client/models/PropertyType_V2.d.ts +5 -0
  85. package/dist/admin-api/client/models/PropertyType_V2.js +2 -0
  86. package/dist/admin-api/client/models/PropertyType_V2.js.map +1 -0
  87. package/dist/admin-api/client/models/PropertyType_V3.d.ts +4 -0
  88. package/dist/admin-api/client/models/PropertyType_V3.js +2 -0
  89. package/dist/admin-api/client/models/PropertyType_V3.js.map +1 -0
  90. package/dist/admin-api/client/models/Property_V2.d.ts +6 -0
  91. package/dist/admin-api/client/models/Property_V2.js +2 -0
  92. package/dist/admin-api/client/models/Property_V2.js.map +1 -0
  93. package/dist/admin-api/client/models/Property_V3.d.ts +5 -0
  94. package/dist/admin-api/client/models/Property_V3.js +2 -0
  95. package/dist/admin-api/client/models/Property_V3.js.map +1 -0
  96. package/dist/admin-api/client/models/Record_string_any_.d.ts +4 -0
  97. package/dist/admin-api/client/models/Record_string_any_.js +2 -0
  98. package/dist/admin-api/client/models/Record_string_any_.js.map +1 -0
  99. package/dist/admin-api/client/models/Record_string_string_.d.ts +4 -0
  100. package/dist/admin-api/client/models/Record_string_string_.js +2 -0
  101. package/dist/admin-api/client/models/Record_string_string_.js.map +1 -0
  102. package/dist/admin-api/client/models/Request.d.ts +6 -0
  103. package/dist/admin-api/client/models/Request.js +2 -0
  104. package/dist/admin-api/client/models/Request.js.map +1 -0
  105. package/dist/admin-api/client/models/RequestLog.d.ts +15 -0
  106. package/dist/admin-api/client/models/RequestLog.js +2 -0
  107. package/dist/admin-api/client/models/RequestLog.js.map +1 -0
  108. package/dist/admin-api/client/models/SourceInfo.d.ts +5 -0
  109. package/dist/admin-api/client/models/SourceInfo.js +2 -0
  110. package/dist/admin-api/client/models/SourceInfo.js.map +1 -0
  111. package/dist/admin-api/client/models/SourceInfoMap.d.ts +2 -0
  112. package/dist/admin-api/client/models/SourceInfoMap.js +2 -0
  113. package/dist/admin-api/client/models/SourceInfoMap.js.map +1 -0
  114. package/dist/admin-api/client/models/StopwordsBody.d.ts +1 -0
  115. package/dist/admin-api/client/models/StopwordsBody.js +2 -0
  116. package/dist/admin-api/client/models/StopwordsBody.js.map +1 -0
  117. package/dist/admin-api/client/models/SynonymsBody.d.ts +1 -0
  118. package/dist/admin-api/client/models/SynonymsBody.js +2 -0
  119. package/dist/admin-api/client/models/SynonymsBody.js.map +1 -0
  120. package/dist/admin-api/client/models/TokenClaims.d.ts +4 -0
  121. package/dist/admin-api/client/models/TokenClaims.js +2 -0
  122. package/dist/admin-api/client/models/TokenClaims.js.map +1 -0
  123. package/dist/admin-api/client/models/Webhook.d.ts +4 -0
  124. package/dist/admin-api/client/models/Webhook.js +2 -0
  125. package/dist/admin-api/client/models/Webhook.js.map +1 -0
  126. package/dist/admin-api/client/models/WebhookPayload.d.ts +12 -0
  127. package/dist/admin-api/client/models/WebhookPayload.js +2 -0
  128. package/dist/admin-api/client/models/WebhookPayload.js.map +1 -0
  129. package/dist/admin-api/client/services/DefinitionV2Service.d.ts +34 -0
  130. package/dist/admin-api/client/services/DefinitionV2Service.js +62 -0
  131. package/dist/admin-api/client/services/DefinitionV2Service.js.map +1 -0
  132. package/dist/admin-api/client/services/DefinitionV3Service.d.ts +51 -0
  133. package/dist/admin-api/client/services/DefinitionV3Service.js +97 -0
  134. package/dist/admin-api/client/services/DefinitionV3Service.js.map +1 -0
  135. package/dist/admin-api/client/services/LogsService.d.ts +19 -0
  136. package/dist/admin-api/client/services/LogsService.js +30 -0
  137. package/dist/admin-api/client/services/LogsService.js.map +1 -0
  138. package/dist/admin-api/client/services/OidcService.d.ts +22 -0
  139. package/dist/admin-api/client/services/OidcService.js +33 -0
  140. package/dist/admin-api/client/services/OidcService.js.map +1 -0
  141. package/dist/admin-api/client/services/QueryGraphQlService.d.ts +27 -0
  142. package/dist/admin-api/client/services/QueryGraphQlService.js +43 -0
  143. package/dist/admin-api/client/services/QueryGraphQlService.js.map +1 -0
  144. package/dist/admin-api/client/services/ResourcesService.d.ts +30 -0
  145. package/dist/admin-api/client/services/ResourcesService.js +49 -0
  146. package/dist/admin-api/client/services/ResourcesService.js.map +1 -0
  147. package/dist/admin-api/client/services/WebhooksService.d.ts +42 -0
  148. package/dist/admin-api/client/services/WebhooksService.js +70 -0
  149. package/dist/admin-api/client/services/WebhooksService.js.map +1 -0
  150. package/dist/admin-api/index.d.ts +6 -0
  151. package/dist/admin-api/index.js +25 -0
  152. package/dist/admin-api/index.js.map +1 -0
  153. package/dist/admin-api/request.d.ts +5 -0
  154. package/dist/admin-api/request.js +32 -0
  155. package/dist/admin-api/request.js.map +1 -0
  156. package/dist/client/client.d.ts +36 -0
  157. package/dist/client/client.js +200 -0
  158. package/dist/client/client.js.map +1 -0
  159. package/dist/client/hmac-fetch.d.ts +3 -0
  160. package/dist/client/hmac-fetch.js +52 -0
  161. package/dist/client/hmac-fetch.js.map +1 -0
  162. package/dist/client/index.d.ts +4 -0
  163. package/dist/client/index.js +5 -0
  164. package/dist/client/index.js.map +1 -0
  165. package/dist/client/types.d.ts +67 -0
  166. package/dist/client/types.js +8 -0
  167. package/dist/client/types.js.map +1 -0
  168. package/dist/client/utils.d.ts +6 -0
  169. package/dist/client/utils.js +32 -0
  170. package/dist/client/utils.js.map +1 -0
  171. package/dist/codegen.d.ts +10 -0
  172. package/dist/codegen.js +18 -0
  173. package/dist/codegen.js.map +1 -0
  174. package/dist/config.d.ts +12 -0
  175. package/dist/config.js +97 -0
  176. package/dist/config.js.map +1 -0
  177. package/dist/index.d.ts +5 -0
  178. package/dist/index.js +9 -0
  179. package/dist/index.js.map +1 -0
  180. package/dist/services/channel-repository/definition.d.ts +86 -0
  181. package/dist/services/channel-repository/definition.js +125 -0
  182. package/dist/services/channel-repository/definition.js.map +1 -0
  183. package/dist/services/channel-repository/index.d.ts +2 -0
  184. package/dist/services/channel-repository/index.js +3 -0
  185. package/dist/services/channel-repository/index.js.map +1 -0
  186. package/dist/services/channel-repository/queries.d.ts +3 -0
  187. package/dist/services/channel-repository/queries.js +93 -0
  188. package/dist/services/channel-repository/queries.js.map +1 -0
  189. package/dist/services/channel-repository/repository.d.ts +15 -0
  190. package/dist/services/channel-repository/repository.js +75 -0
  191. package/dist/services/channel-repository/repository.js.map +1 -0
  192. package/dist/services/channel-repository/types.d.ts +26 -0
  193. package/dist/services/channel-repository/types.js +2 -0
  194. package/dist/services/channel-repository/types.js.map +1 -0
  195. package/dist/services/index.d.ts +4 -0
  196. package/dist/services/index.js +3 -0
  197. package/dist/services/index.js.map +1 -0
  198. package/dist/services/routing/index.d.ts +83 -0
  199. package/dist/services/routing/index.js +243 -0
  200. package/dist/services/routing/index.js.map +1 -0
  201. package/dist/services/routing/types.d.ts +25 -0
  202. package/dist/services/routing/types.js +2 -0
  203. package/dist/services/routing/types.js.map +1 -0
  204. package/dist/types.d.ts +39 -0
  205. package/dist/types.js +2 -0
  206. package/dist/types.js.map +1 -0
  207. package/package.json +73 -0
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2024 Remko Jantzen
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # Optimizely Graph Client <!-- omit in toc -->
2
+ An extension of the [graphql-request](https://www.npmjs.com/package/graphql-request) package, providing the configuration and additional logic needed to connect with Optimizely Graph.
3
+
4
+ ## Within this document <!-- omit in toc -->
5
+ - [1. Provided services](#1-provided-services)
6
+ - [2. Usage example](#2-usage-example)
7
+ - [2.1. GraphQL Client](#21-graphql-client)
8
+ - [2.2. Admin API](#22-admin-api)
9
+ - [3. Configuration](#3-configuration)
10
+ - [3.1. Advanced Features](#31-advanced-features)
11
+
12
+ ## 1. Provided services
13
+ The package contains the following services:
14
+ - The configuration logic, to read and validate the configuration. Supports both runtime configuration objects as well a reading from environment variables.
15
+ - The GraphQL Client, based upon [graphql-request](https://www.npmjs.com/package/graphql-request), supporting the following authentication schemes for Optimizely Graph:
16
+ - Public access (e.g. using the Single key)
17
+ - HMAC Signed messages
18
+ - Basic Authentication
19
+ - Token pass-through (for Optimizely CMS in context editing)
20
+ - A RouteResolver, which simplifies handling routes when using Optimizely CMS, using the Optimizely Graph as datasource.
21
+ - A ChannelRepository, which simplifies reading channel (website) configuration from the Optimizely CMS, using the Optimizely Graph as datasource.
22
+ - An OpenAPI Client for the administrative REST services of Optimizely Graph. This follows the [service specification](https://cg.optimizely.com/app/swagger/swagger.json) and is based upon the code generated by [openapi-typescript-codegen](https://www.npmjs.com/package/openapi-typescript-codegen) from this service specification.
23
+
24
+ ## 2. Usage example
25
+ ### 2.1. GraphQL Client
26
+ ```typescript
27
+ // Import the library
28
+ import { gql } from 'graphql-request'
29
+ import createClient, { AuthMode } from '@remkoj/optimizely-graph-client/client'
30
+ import Router from '@remkoj/optimizely-graph-client/router'
31
+ import ChannelRepository from '@remkoj/optimizely-graph-client/channels'
32
+
33
+ // Prepare the query
34
+ const document = gql`query {
35
+ Content {
36
+ items {
37
+ Name
38
+ ContentLink {
39
+ GuidValue
40
+ }
41
+ Language {
42
+ Name
43
+ }
44
+ }
45
+ }
46
+ }`
47
+
48
+ // Create an instance of the client, the configuration object may be omitted
49
+ // when executing on Node.JS. If no configuration is provided, it will be read
50
+ // from the environment variables.
51
+ // The variable client will be of type: GraphQLClient
52
+ const client = createClient({
53
+ single_key: "your_single_key"
54
+ })
55
+
56
+ // By default the client will always use AuthMode.Public, unless overridden by the
57
+ // second parameter of createClient. Use the updateAuthentication to change the
58
+ // authentication mode after creation
59
+ client.updateAuthentication(AuthMode.Public)
60
+
61
+ // Execute a GraphQL query, the second paramer can be used to send in variables
62
+ const result = await client.request(document)
63
+
64
+ // Use the Router to get all routes registered by Optimizely CMS
65
+ const router = new Router(client)
66
+ const allPaths = await router.getRoutes()
67
+
68
+ // Use the ChannelRepository to get all registered channels within Optimizely CMS
69
+ const channels = new ChannelRepository(client)
70
+ const allChannels = await channels.getAll()
71
+ ```
72
+
73
+ ### 2.2. Admin API
74
+ ***Warning***: The AdminAPI of Optimizely Graph requires your App Key & Secret as it allows full management of the service. When used in a browser, take all needed steps to prevent leaking of these credentials.
75
+
76
+ ```typescript
77
+ import createAdminApi from '@remkoj/optimizely-graph-client/admin'
78
+
79
+ // Create an instance of the client, the configuration object may be omitted
80
+ // when executing on Node.JS. If no configuration is provided, it will be read
81
+ // from the environment variables.
82
+ const api = createAdminApi({
83
+ single_key: "your single key",
84
+ app_key: "your app key",
85
+ secret: "your secret"
86
+ })
87
+
88
+ // Use the webhooks endpoint to list all registered webhooks
89
+ const hooks = await api.webhooks.listWebhookHandler()
90
+ ```
91
+
92
+ ## 3. Configuration
93
+ The following configuration options are available, the table lists both the environment variable as well as property within the configuration object.
94
+
95
+ | Environment | Configuration object | Required | Usage |
96
+ | --- | --- | --- | --- |
97
+ | `OPTIMIZELY_GRAPH_GATEWAY` | gateway | no | The endpoint for Optimizely Graph |
98
+ | `OPTIMIZELY_GRAPH_SINGLE_KEY` | single_key | yes | The key needed for public, read-only access |
99
+ | `OPTIMIZELY_GRAPH_SECRET` | secret | no | The Optimizely Graph secret for write access, this value must never be made available in a browser |
100
+ | `OPTIMIZELY_GRAPH_APP_KEY` | app_key | no | The Optimizely Graph app_key for write access, this value must never be made available in a browser |
101
+ | `SITE_DOMAIN` | deploy_domain | no | The domain of the frontend |
102
+ | `OPTIMIZELY_CMS_URL` | dxp_url | yes | The domain where the CMS has been installed |
103
+ | `OPTIMIZELY_GRAPH_QUERY_LOG` | query_log | no | Set to "true" to enable query output to the console |
104
+ | `OPTIMIZELY_DEBUG` | debug | no | Set to "true" to enable verbose debug output to the console |
105
+
106
+ ### 3.1. Advanced Features
107
+ The Optimizely Graph Client has support for a number of the feature flags in Optimizely Graph and can enable/disable those on the fly.
108
+
109
+ The following features can currently be toggled:
110
+ - **Caching *[Default: enabled]*:** Provides control over the service output cache, setting this to false will make all requests be evaluated in real time instead of being cached.
111
+ - **Stored queries *[Default: enabled]*:** This will store the query to the underlying data store, so even when the output cache is invalidated, this will prevent the query to the data store to be regenerated. **Warning**: This feature does not work with cursors, so either disable it temporary or completely if you need cursors in you queries.
112
+ - **Recursive queries *[Default: disabled]*:** When enabled it enables the execution of the `@recursive(depth: n)` directive. If compatible with the queries used, this can significantly reduce the number of queries needed to build a page.
113
+
114
+ The flags are controlled by the following instance methods & fields on the Client object:
115
+ - `updateFlags(newFlags, temporary)`: Update the flags for the instance. If there's roll-back information it will throw an Error. When temporary is enabled it will create a roll-back copy of the current flags prior to updating.
116
+ - `restoreFlags()`: Restore the flags to the stored 'roll-back' copy, if there's no roll-back copy, no action is taken and no Error will be thrown.
117
+
118
+ #### Example <!-- omit in toc -->
119
+ For server-side code, with access to environment variables, adjust according to your case.
120
+ ```typescript
121
+ // Import client & create instance
122
+ import createClient from '@remkoj/optimizely-graph-client/client';
123
+ const client = createClient();
124
+
125
+ // Set the default for this client to add support for recursive queries
126
+ client.updateFlags({ recursive: true });
127
+
128
+ // Temporary disable the query cache to allow queries with cursor
129
+ client.updateFlags({ queryCache: false }, true);
130
+
131
+ ...
132
+
133
+ // Roll-back to preferred flag settings
134
+ client.restoreFlags();
135
+ ```
@@ -0,0 +1,22 @@
1
+ import type { BaseHttpRequest } from './core/BaseHttpRequest.js';
2
+ import type { OpenAPIConfig } from './core/OpenAPI.js';
3
+ import { DefinitionV2Service } from './services/DefinitionV2Service.js';
4
+ import { DefinitionV3Service } from './services/DefinitionV3Service.js';
5
+ import { LogsService } from './services/LogsService.js';
6
+ import { OidcService } from './services/OidcService.js';
7
+ import { QueryGraphQlService } from './services/QueryGraphQlService.js';
8
+ import { ResourcesService } from './services/ResourcesService.js';
9
+ import { WebhooksService } from './services/WebhooksService.js';
10
+ type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
11
+ export declare class OptimizelyGraphAdminApi {
12
+ readonly definitionV2: DefinitionV2Service;
13
+ readonly definitionV3: DefinitionV3Service;
14
+ readonly logs: LogsService;
15
+ readonly oidc: OidcService;
16
+ readonly queryGraphQl: QueryGraphQlService;
17
+ readonly resources: ResourcesService;
18
+ readonly webhooks: WebhooksService;
19
+ readonly request: BaseHttpRequest;
20
+ constructor(config?: Partial<OpenAPIConfig>, HttpRequest?: HttpRequestConstructor);
21
+ }
22
+ export {};
@@ -0,0 +1,31 @@
1
+ import { FetchHttpRequest } from './core/FetchHttpRequest.js';
2
+ import { DefinitionV2Service } from './services/DefinitionV2Service.js';
3
+ import { DefinitionV3Service } from './services/DefinitionV3Service.js';
4
+ import { LogsService } from './services/LogsService.js';
5
+ import { OidcService } from './services/OidcService.js';
6
+ import { QueryGraphQlService } from './services/QueryGraphQlService.js';
7
+ import { ResourcesService } from './services/ResourcesService.js';
8
+ import { WebhooksService } from './services/WebhooksService.js';
9
+ export class OptimizelyGraphAdminApi {
10
+ constructor(config, HttpRequest = FetchHttpRequest) {
11
+ this.request = new HttpRequest({
12
+ BASE: config?.BASE ?? 'https://prod.cg.optimizely.com',
13
+ VERSION: config?.VERSION ?? '3.6.2',
14
+ WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
15
+ CREDENTIALS: config?.CREDENTIALS ?? 'include',
16
+ TOKEN: config?.TOKEN,
17
+ USERNAME: config?.USERNAME,
18
+ PASSWORD: config?.PASSWORD,
19
+ HEADERS: config?.HEADERS,
20
+ ENCODE_PATH: config?.ENCODE_PATH,
21
+ });
22
+ this.definitionV2 = new DefinitionV2Service(this.request);
23
+ this.definitionV3 = new DefinitionV3Service(this.request);
24
+ this.logs = new LogsService(this.request);
25
+ this.oidc = new OidcService(this.request);
26
+ this.queryGraphQl = new QueryGraphQlService(this.request);
27
+ this.resources = new ResourcesService(this.request);
28
+ this.webhooks = new WebhooksService(this.request);
29
+ }
30
+ }
31
+ //# sourceMappingURL=OptimizelyGraphAdminApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptimizelyGraphAdminApi.js","sourceRoot":"","sources":["../../../src/admin-api/client/OptimizelyGraphAdminApi.ts"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AI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CACJ"}
@@ -0,0 +1,10 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions.js';
2
+ import type { ApiResult } from './ApiResult.js';
3
+ export declare class ApiError extends Error {
4
+ readonly url: string;
5
+ readonly status: number;
6
+ readonly statusText: string;
7
+ readonly body: any;
8
+ readonly request: ApiRequestOptions;
9
+ constructor(request: ApiRequestOptions, response: ApiResult, message: string);
10
+ }
@@ -0,0 +1,12 @@
1
+ export class ApiError extends Error {
2
+ constructor(request, response, message) {
3
+ super(message);
4
+ this.name = 'ApiError';
5
+ this.url = response.url;
6
+ this.status = response.status;
7
+ this.statusText = response.statusText;
8
+ this.body = response.body;
9
+ this.request = request;
10
+ }
11
+ }
12
+ //# sourceMappingURL=ApiError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiError.js","sourceRoot":"","sources":["../../../../src/admin-api/client/core/ApiError.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,QAAS,SAAQ,KAAK;IAO/B,YAAY,OAA0B,EAAE,QAAmB,EAAE,OAAe;QACxE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ"}
@@ -0,0 +1,13 @@
1
+ export type ApiRequestOptions = {
2
+ readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
3
+ readonly url: string;
4
+ readonly path?: Record<string, any>;
5
+ readonly cookies?: Record<string, any>;
6
+ readonly headers?: Record<string, any>;
7
+ readonly query?: Record<string, any>;
8
+ readonly formData?: Record<string, any>;
9
+ readonly body?: any;
10
+ readonly mediaType?: string;
11
+ readonly responseHeader?: string;
12
+ readonly errors?: Record<number, string>;
13
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ApiRequestOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiRequestOptions.js","sourceRoot":"","sources":["../../../../src/admin-api/client/core/ApiRequestOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export type ApiResult = {
2
+ readonly url: string;
3
+ readonly ok: boolean;
4
+ readonly status: number;
5
+ readonly statusText: string;
6
+ readonly body: any;
7
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ApiResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiResult.js","sourceRoot":"","sources":["../../../../src/admin-api/client/core/ApiResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions.js';
2
+ import type { CancelablePromise } from './CancelablePromise.js';
3
+ import type { OpenAPIConfig } from './OpenAPI.js';
4
+ export declare abstract class BaseHttpRequest {
5
+ readonly config: OpenAPIConfig;
6
+ constructor(config: OpenAPIConfig);
7
+ abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
8
+ }
@@ -0,0 +1,6 @@
1
+ export class BaseHttpRequest {
2
+ constructor(config) {
3
+ this.config = config;
4
+ }
5
+ }
6
+ //# sourceMappingURL=BaseHttpRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseHttpRequest.js","sourceRoot":"","sources":["../../../../src/admin-api/client/core/BaseHttpRequest.ts"],"names":[],"mappings":"AAQA,MAAM,OAAgB,eAAe;IAEjC,YAA4B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;CAGxD"}
@@ -0,0 +1,20 @@
1
+ export declare class CancelError extends Error {
2
+ constructor(message: string);
3
+ get isCancelled(): boolean;
4
+ }
5
+ export interface OnCancel {
6
+ readonly isResolved: boolean;
7
+ readonly isRejected: boolean;
8
+ readonly isCancelled: boolean;
9
+ (cancelHandler: () => void): void;
10
+ }
11
+ export declare class CancelablePromise<T> implements Promise<T> {
12
+ #private;
13
+ constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
14
+ get [Symbol.toStringTag](): string;
15
+ then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
16
+ catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
17
+ finally(onFinally?: (() => void) | null): Promise<T>;
18
+ cancel(): void;
19
+ get isCancelled(): boolean;
20
+ }
@@ -0,0 +1,112 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _CancelablePromise_isResolved, _CancelablePromise_isRejected, _CancelablePromise_isCancelled, _CancelablePromise_cancelHandlers, _CancelablePromise_promise, _CancelablePromise_resolve, _CancelablePromise_reject;
13
+ /* generated using openapi-typescript-codegen -- do not edit */
14
+ /* istanbul ignore file */
15
+ /* tslint:disable */
16
+ /* eslint-disable */
17
+ export class CancelError extends Error {
18
+ constructor(message) {
19
+ super(message);
20
+ this.name = 'CancelError';
21
+ }
22
+ get isCancelled() {
23
+ return true;
24
+ }
25
+ }
26
+ export class CancelablePromise {
27
+ constructor(executor) {
28
+ _CancelablePromise_isResolved.set(this, void 0);
29
+ _CancelablePromise_isRejected.set(this, void 0);
30
+ _CancelablePromise_isCancelled.set(this, void 0);
31
+ _CancelablePromise_cancelHandlers.set(this, void 0);
32
+ _CancelablePromise_promise.set(this, void 0);
33
+ _CancelablePromise_resolve.set(this, void 0);
34
+ _CancelablePromise_reject.set(this, void 0);
35
+ __classPrivateFieldSet(this, _CancelablePromise_isResolved, false, "f");
36
+ __classPrivateFieldSet(this, _CancelablePromise_isRejected, false, "f");
37
+ __classPrivateFieldSet(this, _CancelablePromise_isCancelled, false, "f");
38
+ __classPrivateFieldSet(this, _CancelablePromise_cancelHandlers, [], "f");
39
+ __classPrivateFieldSet(this, _CancelablePromise_promise, new Promise((resolve, reject) => {
40
+ __classPrivateFieldSet(this, _CancelablePromise_resolve, resolve, "f");
41
+ __classPrivateFieldSet(this, _CancelablePromise_reject, reject, "f");
42
+ const onResolve = (value) => {
43
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
44
+ return;
45
+ }
46
+ __classPrivateFieldSet(this, _CancelablePromise_isResolved, true, "f");
47
+ if (__classPrivateFieldGet(this, _CancelablePromise_resolve, "f"))
48
+ __classPrivateFieldGet(this, _CancelablePromise_resolve, "f").call(this, value);
49
+ };
50
+ const onReject = (reason) => {
51
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
52
+ return;
53
+ }
54
+ __classPrivateFieldSet(this, _CancelablePromise_isRejected, true, "f");
55
+ if (__classPrivateFieldGet(this, _CancelablePromise_reject, "f"))
56
+ __classPrivateFieldGet(this, _CancelablePromise_reject, "f").call(this, reason);
57
+ };
58
+ const onCancel = (cancelHandler) => {
59
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
60
+ return;
61
+ }
62
+ __classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").push(cancelHandler);
63
+ };
64
+ Object.defineProperty(onCancel, 'isResolved', {
65
+ get: () => __classPrivateFieldGet(this, _CancelablePromise_isResolved, "f"),
66
+ });
67
+ Object.defineProperty(onCancel, 'isRejected', {
68
+ get: () => __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f"),
69
+ });
70
+ Object.defineProperty(onCancel, 'isCancelled', {
71
+ get: () => __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f"),
72
+ });
73
+ return executor(onResolve, onReject, onCancel);
74
+ }), "f");
75
+ }
76
+ get [(_CancelablePromise_isResolved = new WeakMap(), _CancelablePromise_isRejected = new WeakMap(), _CancelablePromise_isCancelled = new WeakMap(), _CancelablePromise_cancelHandlers = new WeakMap(), _CancelablePromise_promise = new WeakMap(), _CancelablePromise_resolve = new WeakMap(), _CancelablePromise_reject = new WeakMap(), Symbol.toStringTag)]() {
77
+ return "Cancellable Promise";
78
+ }
79
+ then(onFulfilled, onRejected) {
80
+ return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").then(onFulfilled, onRejected);
81
+ }
82
+ catch(onRejected) {
83
+ return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").catch(onRejected);
84
+ }
85
+ finally(onFinally) {
86
+ return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").finally(onFinally);
87
+ }
88
+ cancel() {
89
+ if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
90
+ return;
91
+ }
92
+ __classPrivateFieldSet(this, _CancelablePromise_isCancelled, true, "f");
93
+ if (__classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").length) {
94
+ try {
95
+ for (const cancelHandler of __classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f")) {
96
+ cancelHandler();
97
+ }
98
+ }
99
+ catch (error) {
100
+ console.warn('Cancellation threw an error', error);
101
+ return;
102
+ }
103
+ }
104
+ __classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").length = 0;
105
+ if (__classPrivateFieldGet(this, _CancelablePromise_reject, "f"))
106
+ __classPrivateFieldGet(this, _CancelablePromise_reject, "f").call(this, new CancelError('Request aborted'));
107
+ }
108
+ get isCancelled() {
109
+ return __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f");
110
+ }
111
+ }
112
+ //# sourceMappingURL=CancelablePromise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CancelablePromise.js","sourceRoot":"","sources":["../../../../src/admin-api/client/core/CancelablePromise.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA+D;AAC/D,0BAA0B;AAC1B,oBAAoB;AACpB,oBAAoB;AACpB,MAAM,OAAO,WAAY,SAAQ,KAAK;IAElC,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,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IAC5C,CAAC;IAEM,MAAM;QACT,IAAI,uBAAA,IAAI,qCAAY,IAAI,uBAAA,IAAI,qCAAY,IAAI,uBAAA,IAAI,sCAAa,EAAE,CAAC;YAC5D,OAAO;QACX,CAAC;QACD,uBAAA,IAAI,kCAAgB,IAAI,MAAA,CAAC;QACzB,IAAI,uBAAA,IAAI,yCAAgB,CAAC,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC;gBACD,KAAK,MAAM,aAAa,IAAI,uBAAA,IAAI,yCAAgB,EAAE,CAAC;oBAC/C,aAAa,EAAE,CAAC;gBACpB,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;gBACnD,OAAO;YACX,CAAC;QACL,CAAC;QACD,uBAAA,IAAI,yCAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;QAChC,IAAI,uBAAA,IAAI,iCAAQ;YAAE,uBAAA,IAAI,iCAAQ,MAAZ,IAAI,EAAS,IAAI,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,IAAW,WAAW;QAClB,OAAO,uBAAA,IAAI,sCAAa,CAAC;IAC7B,CAAC;CACJ"}
@@ -0,0 +1,14 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions.js';
2
+ import { BaseHttpRequest } from './BaseHttpRequest.js';
3
+ import type { CancelablePromise } from './CancelablePromise.js';
4
+ import type { OpenAPIConfig } from './OpenAPI.js';
5
+ export declare class FetchHttpRequest extends BaseHttpRequest {
6
+ constructor(config: OpenAPIConfig);
7
+ /**
8
+ * Request method
9
+ * @param options The request options from the service
10
+ * @returns CancelablePromise<T>
11
+ * @throws ApiError
12
+ */
13
+ request<T>(options: ApiRequestOptions): CancelablePromise<T>;
14
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseHttpRequest } from './BaseHttpRequest.js';
2
+ import { request as __request } from './request.js';
3
+ export class FetchHttpRequest extends BaseHttpRequest {
4
+ constructor(config) {
5
+ super(config);
6
+ }
7
+ /**
8
+ * Request method
9
+ * @param options The request options from the service
10
+ * @returns CancelablePromise<T>
11
+ * @throws ApiError
12
+ */
13
+ request(options) {
14
+ return __request(this.config, options);
15
+ }
16
+ }
17
+ //# sourceMappingURL=FetchHttpRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchHttpRequest.js","sourceRoot":"","sources":["../../../../src/admin-api/client/core/FetchHttpRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAEjD,YAAY,MAAqB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED;;;;;OAKG;IACa,OAAO,CAAI,OAA0B;QACjD,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CACJ"}
@@ -0,0 +1,16 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions.js';
2
+ type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
3
+ type Headers = Record<string, string>;
4
+ export type OpenAPIConfig = {
5
+ BASE: string;
6
+ VERSION: string;
7
+ WITH_CREDENTIALS: boolean;
8
+ CREDENTIALS: 'include' | 'omit' | 'same-origin';
9
+ TOKEN?: string | Resolver<string> | undefined;
10
+ USERNAME?: string | Resolver<string> | undefined;
11
+ PASSWORD?: string | Resolver<string> | undefined;
12
+ HEADERS?: Headers | Resolver<Headers> | undefined;
13
+ ENCODE_PATH?: ((path: string) => string) | undefined;
14
+ };
15
+ export declare const OpenAPI: OpenAPIConfig;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ export const OpenAPI = {
2
+ BASE: 'https://prod.cg.optimizely.com',
3
+ VERSION: '3.6.2',
4
+ WITH_CREDENTIALS: false,
5
+ CREDENTIALS: 'include',
6
+ TOKEN: undefined,
7
+ USERNAME: undefined,
8
+ PASSWORD: undefined,
9
+ HEADERS: undefined,
10
+ ENCODE_PATH: undefined,
11
+ };
12
+ //# sourceMappingURL=OpenAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAPI.js","sourceRoot":"","sources":["../../../../src/admin-api/client/core/OpenAPI.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,OAAO,GAAkB;IAClC,IAAI,EAAE,gCAAgC;IACtC,OAAO,EAAE,OAAO;IAChB,gBAAgB,EAAE,KAAK;IACvB,WAAW,EAAE,SAAS;IACtB,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,SAAS;CACzB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions.js';
2
+ import type { ApiResult } from './ApiResult.js';
3
+ import { CancelablePromise } from './CancelablePromise.js';
4
+ import type { OnCancel } from './CancelablePromise.js';
5
+ import type { OpenAPIConfig } from './OpenAPI.js';
6
+ export declare const isDefined: <T>(value: T | null | undefined) => value is Exclude<T, null | undefined>;
7
+ export declare const isString: (value: any) => value is string;
8
+ export declare const isStringWithValue: (value: any) => value is string;
9
+ export declare const isBlob: (value: any) => value is Blob;
10
+ export declare const isFormData: (value: any) => value is FormData;
11
+ export declare const base64: (str: string) => string;
12
+ export declare const getQueryString: (params: Record<string, any>) => string;
13
+ export declare const getFormData: (options: ApiRequestOptions) => FormData | undefined;
14
+ type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
15
+ export declare const resolve: <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>) => Promise<T | undefined>;
16
+ export declare const getHeaders: (config: OpenAPIConfig, options: ApiRequestOptions) => Promise<Headers>;
17
+ export declare const getRequestBody: (options: ApiRequestOptions) => any;
18
+ export declare const sendRequest: (config: OpenAPIConfig, options: ApiRequestOptions, url: string, body: any, formData: FormData | undefined, headers: Headers, onCancel: OnCancel) => Promise<Response>;
19
+ export declare const getResponseHeader: (response: Response, responseHeader?: string) => string | undefined;
20
+ export declare const getResponseBody: (response: Response) => Promise<any>;
21
+ export declare const catchErrorCodes: (options: ApiRequestOptions, result: ApiResult) => void;
22
+ /**
23
+ * Request method
24
+ * @param config The OpenAPI configuration object
25
+ * @param options The request options from the service
26
+ * @returns CancelablePromise<T>
27
+ * @throws ApiError
28
+ */
29
+ export declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
30
+ export {};