@openinherit/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 (130) hide show
  1. package/LICENSE +191 -0
  2. package/dist/estate/client/client.gen.d.ts +3 -0
  3. package/dist/estate/client/client.gen.d.ts.map +1 -0
  4. package/dist/estate/client/client.gen.js +236 -0
  5. package/dist/estate/client/client.gen.js.map +1 -0
  6. package/dist/estate/client/index.d.ts +9 -0
  7. package/dist/estate/client/index.d.ts.map +1 -0
  8. package/dist/estate/client/index.js +7 -0
  9. package/dist/estate/client/index.js.map +1 -0
  10. package/dist/estate/client/types.gen.d.ts +118 -0
  11. package/dist/estate/client/types.gen.d.ts.map +1 -0
  12. package/dist/estate/client/types.gen.js +3 -0
  13. package/dist/estate/client/types.gen.js.map +1 -0
  14. package/dist/estate/client/utils.gen.d.ts +34 -0
  15. package/dist/estate/client/utils.gen.d.ts.map +1 -0
  16. package/dist/estate/client/utils.gen.js +229 -0
  17. package/dist/estate/client/utils.gen.js.map +1 -0
  18. package/dist/estate/client.gen.d.ts +13 -0
  19. package/dist/estate/client.gen.d.ts.map +1 -0
  20. package/dist/estate/client.gen.js +4 -0
  21. package/dist/estate/client.gen.js.map +1 -0
  22. package/dist/estate/core/auth.gen.d.ts +19 -0
  23. package/dist/estate/core/auth.gen.d.ts.map +1 -0
  24. package/dist/estate/core/auth.gen.js +15 -0
  25. package/dist/estate/core/auth.gen.js.map +1 -0
  26. package/dist/estate/core/bodySerializer.gen.d.ts +26 -0
  27. package/dist/estate/core/bodySerializer.gen.d.ts.map +1 -0
  28. package/dist/estate/core/bodySerializer.gen.js +58 -0
  29. package/dist/estate/core/bodySerializer.gen.js.map +1 -0
  30. package/dist/estate/core/params.gen.d.ts +44 -0
  31. package/dist/estate/core/params.gen.d.ts.map +1 -0
  32. package/dist/estate/core/params.gen.js +101 -0
  33. package/dist/estate/core/params.gen.js.map +1 -0
  34. package/dist/estate/core/pathSerializer.gen.d.ts +34 -0
  35. package/dist/estate/core/pathSerializer.gen.d.ts.map +1 -0
  36. package/dist/estate/core/pathSerializer.gen.js +107 -0
  37. package/dist/estate/core/pathSerializer.gen.js.map +1 -0
  38. package/dist/estate/core/queryKeySerializer.gen.d.ts +19 -0
  39. package/dist/estate/core/queryKeySerializer.gen.d.ts.map +1 -0
  40. package/dist/estate/core/queryKeySerializer.gen.js +93 -0
  41. package/dist/estate/core/queryKeySerializer.gen.js.map +1 -0
  42. package/dist/estate/core/serverSentEvents.gen.d.ts +72 -0
  43. package/dist/estate/core/serverSentEvents.gen.d.ts.map +1 -0
  44. package/dist/estate/core/serverSentEvents.gen.js +134 -0
  45. package/dist/estate/core/serverSentEvents.gen.js.map +1 -0
  46. package/dist/estate/core/types.gen.d.ts +79 -0
  47. package/dist/estate/core/types.gen.d.ts.map +1 -0
  48. package/dist/estate/core/types.gen.js +3 -0
  49. package/dist/estate/core/types.gen.js.map +1 -0
  50. package/dist/estate/core/utils.gen.d.ts +20 -0
  51. package/dist/estate/core/utils.gen.d.ts.map +1 -0
  52. package/dist/estate/core/utils.gen.js +88 -0
  53. package/dist/estate/core/utils.gen.js.map +1 -0
  54. package/dist/estate/index.d.ts +3 -0
  55. package/dist/estate/index.d.ts.map +1 -0
  56. package/dist/estate/index.js +3 -0
  57. package/dist/estate/index.js.map +1 -0
  58. package/dist/estate/sdk.gen.d.ts +25 -0
  59. package/dist/estate/sdk.gen.d.ts.map +1 -0
  60. package/dist/estate/sdk.gen.js +19 -0
  61. package/dist/estate/sdk.gen.js.map +1 -0
  62. package/dist/estate/types.gen.d.ts +2140 -0
  63. package/dist/estate/types.gen.d.ts.map +1 -0
  64. package/dist/estate/types.gen.js +3 -0
  65. package/dist/estate/types.gen.js.map +1 -0
  66. package/dist/reference/client/client.gen.d.ts +3 -0
  67. package/dist/reference/client/client.gen.d.ts.map +1 -0
  68. package/dist/reference/client/client.gen.js +236 -0
  69. package/dist/reference/client/client.gen.js.map +1 -0
  70. package/dist/reference/client/index.d.ts +9 -0
  71. package/dist/reference/client/index.d.ts.map +1 -0
  72. package/dist/reference/client/index.js +7 -0
  73. package/dist/reference/client/index.js.map +1 -0
  74. package/dist/reference/client/types.gen.d.ts +118 -0
  75. package/dist/reference/client/types.gen.d.ts.map +1 -0
  76. package/dist/reference/client/types.gen.js +3 -0
  77. package/dist/reference/client/types.gen.js.map +1 -0
  78. package/dist/reference/client/utils.gen.d.ts +34 -0
  79. package/dist/reference/client/utils.gen.d.ts.map +1 -0
  80. package/dist/reference/client/utils.gen.js +229 -0
  81. package/dist/reference/client/utils.gen.js.map +1 -0
  82. package/dist/reference/client.gen.d.ts +13 -0
  83. package/dist/reference/client.gen.d.ts.map +1 -0
  84. package/dist/reference/client.gen.js +4 -0
  85. package/dist/reference/client.gen.js.map +1 -0
  86. package/dist/reference/core/auth.gen.d.ts +19 -0
  87. package/dist/reference/core/auth.gen.d.ts.map +1 -0
  88. package/dist/reference/core/auth.gen.js +15 -0
  89. package/dist/reference/core/auth.gen.js.map +1 -0
  90. package/dist/reference/core/bodySerializer.gen.d.ts +26 -0
  91. package/dist/reference/core/bodySerializer.gen.d.ts.map +1 -0
  92. package/dist/reference/core/bodySerializer.gen.js +58 -0
  93. package/dist/reference/core/bodySerializer.gen.js.map +1 -0
  94. package/dist/reference/core/params.gen.d.ts +44 -0
  95. package/dist/reference/core/params.gen.d.ts.map +1 -0
  96. package/dist/reference/core/params.gen.js +101 -0
  97. package/dist/reference/core/params.gen.js.map +1 -0
  98. package/dist/reference/core/pathSerializer.gen.d.ts +34 -0
  99. package/dist/reference/core/pathSerializer.gen.d.ts.map +1 -0
  100. package/dist/reference/core/pathSerializer.gen.js +107 -0
  101. package/dist/reference/core/pathSerializer.gen.js.map +1 -0
  102. package/dist/reference/core/queryKeySerializer.gen.d.ts +19 -0
  103. package/dist/reference/core/queryKeySerializer.gen.d.ts.map +1 -0
  104. package/dist/reference/core/queryKeySerializer.gen.js +93 -0
  105. package/dist/reference/core/queryKeySerializer.gen.js.map +1 -0
  106. package/dist/reference/core/serverSentEvents.gen.d.ts +72 -0
  107. package/dist/reference/core/serverSentEvents.gen.d.ts.map +1 -0
  108. package/dist/reference/core/serverSentEvents.gen.js +134 -0
  109. package/dist/reference/core/serverSentEvents.gen.js.map +1 -0
  110. package/dist/reference/core/types.gen.d.ts +79 -0
  111. package/dist/reference/core/types.gen.d.ts.map +1 -0
  112. package/dist/reference/core/types.gen.js +3 -0
  113. package/dist/reference/core/types.gen.js.map +1 -0
  114. package/dist/reference/core/utils.gen.d.ts +20 -0
  115. package/dist/reference/core/utils.gen.d.ts.map +1 -0
  116. package/dist/reference/core/utils.gen.js +88 -0
  117. package/dist/reference/core/utils.gen.js.map +1 -0
  118. package/dist/reference/index.d.ts +3 -0
  119. package/dist/reference/index.d.ts.map +1 -0
  120. package/dist/reference/index.js +3 -0
  121. package/dist/reference/index.js.map +1 -0
  122. package/dist/reference/sdk.gen.d.ts +508 -0
  123. package/dist/reference/sdk.gen.d.ts.map +1 -0
  124. package/dist/reference/sdk.gen.js +1147 -0
  125. package/dist/reference/sdk.gen.js.map +1 -0
  126. package/dist/reference/types.gen.d.ts +4602 -0
  127. package/dist/reference/types.gen.d.ts.map +1 -0
  128. package/dist/reference/types.gen.js +3 -0
  129. package/dist/reference/types.gen.js.map +1 -0
  130. package/package.json +50 -0
package/LICENSE ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2026 OpenInherit Contributors
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ import type { Client, Config } from './types.gen';
2
+ export declare const createClient: (config?: Config) => Client;
3
+ //# sourceMappingURL=client.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../../src/estate/client/client.gen.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA0C,MAAM,aAAa,CAAC;AAgB1F,eAAO,MAAM,YAAY,GAAI,SAAQ,MAAW,KAAG,MA4QlD,CAAC"}
@@ -0,0 +1,236 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { createSseClient } from '../core/serverSentEvents.gen';
3
+ import { getValidRequestBody } from '../core/utils.gen';
4
+ import { buildUrl, createConfig, createInterceptors, getParseAs, mergeConfigs, mergeHeaders, setAuthParams, } from './utils.gen';
5
+ export const createClient = (config = {}) => {
6
+ let _config = mergeConfigs(createConfig(), config);
7
+ const getConfig = () => ({ ..._config });
8
+ const setConfig = (config) => {
9
+ _config = mergeConfigs(_config, config);
10
+ return getConfig();
11
+ };
12
+ const interceptors = createInterceptors();
13
+ const beforeRequest = async (options) => {
14
+ const opts = {
15
+ ..._config,
16
+ ...options,
17
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
18
+ headers: mergeHeaders(_config.headers, options.headers),
19
+ serializedBody: undefined,
20
+ };
21
+ if (opts.security) {
22
+ await setAuthParams({
23
+ ...opts,
24
+ security: opts.security,
25
+ });
26
+ }
27
+ if (opts.requestValidator) {
28
+ await opts.requestValidator(opts);
29
+ }
30
+ if (opts.body !== undefined && opts.bodySerializer) {
31
+ opts.serializedBody = opts.bodySerializer(opts.body);
32
+ }
33
+ // remove Content-Type header if body is empty to avoid sending invalid requests
34
+ if (opts.body === undefined || opts.serializedBody === '') {
35
+ opts.headers.delete('Content-Type');
36
+ }
37
+ const url = buildUrl(opts);
38
+ return { opts, url };
39
+ };
40
+ const request = async (options) => {
41
+ // @ts-expect-error
42
+ const { opts, url } = await beforeRequest(options);
43
+ const requestInit = {
44
+ redirect: 'follow',
45
+ ...opts,
46
+ body: getValidRequestBody(opts),
47
+ };
48
+ let request = new Request(url, requestInit);
49
+ for (const fn of interceptors.request.fns) {
50
+ if (fn) {
51
+ request = await fn(request, opts);
52
+ }
53
+ }
54
+ // fetch must be assigned here, otherwise it would throw the error:
55
+ // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
56
+ const _fetch = opts.fetch;
57
+ let response;
58
+ try {
59
+ response = await _fetch(request);
60
+ }
61
+ catch (error) {
62
+ // Handle fetch exceptions (AbortError, network errors, etc.)
63
+ let finalError = error;
64
+ for (const fn of interceptors.error.fns) {
65
+ if (fn) {
66
+ finalError = (await fn(error, undefined, request, opts));
67
+ }
68
+ }
69
+ finalError = finalError || {};
70
+ if (opts.throwOnError) {
71
+ throw finalError;
72
+ }
73
+ // Return error response
74
+ return opts.responseStyle === 'data'
75
+ ? undefined
76
+ : {
77
+ error: finalError,
78
+ request,
79
+ response: undefined,
80
+ };
81
+ }
82
+ for (const fn of interceptors.response.fns) {
83
+ if (fn) {
84
+ response = await fn(response, request, opts);
85
+ }
86
+ }
87
+ const result = {
88
+ request,
89
+ response,
90
+ };
91
+ if (response.ok) {
92
+ const parseAs = (opts.parseAs === 'auto'
93
+ ? getParseAs(response.headers.get('Content-Type'))
94
+ : opts.parseAs) ?? 'json';
95
+ if (response.status === 204 || response.headers.get('Content-Length') === '0') {
96
+ let emptyData;
97
+ switch (parseAs) {
98
+ case 'arrayBuffer':
99
+ case 'blob':
100
+ case 'text':
101
+ emptyData = await response[parseAs]();
102
+ break;
103
+ case 'formData':
104
+ emptyData = new FormData();
105
+ break;
106
+ case 'stream':
107
+ emptyData = response.body;
108
+ break;
109
+ case 'json':
110
+ default:
111
+ emptyData = {};
112
+ break;
113
+ }
114
+ return opts.responseStyle === 'data'
115
+ ? emptyData
116
+ : {
117
+ data: emptyData,
118
+ ...result,
119
+ };
120
+ }
121
+ let data;
122
+ switch (parseAs) {
123
+ case 'arrayBuffer':
124
+ case 'blob':
125
+ case 'formData':
126
+ case 'text':
127
+ data = await response[parseAs]();
128
+ break;
129
+ case 'json': {
130
+ // Some servers return 200 with no Content-Length and empty body.
131
+ // response.json() would throw; read as text and parse if non-empty.
132
+ const text = await response.text();
133
+ data = text ? JSON.parse(text) : {};
134
+ break;
135
+ }
136
+ case 'stream':
137
+ return opts.responseStyle === 'data'
138
+ ? response.body
139
+ : {
140
+ data: response.body,
141
+ ...result,
142
+ };
143
+ }
144
+ if (parseAs === 'json') {
145
+ if (opts.responseValidator) {
146
+ await opts.responseValidator(data);
147
+ }
148
+ if (opts.responseTransformer) {
149
+ data = await opts.responseTransformer(data);
150
+ }
151
+ }
152
+ return opts.responseStyle === 'data'
153
+ ? data
154
+ : {
155
+ data,
156
+ ...result,
157
+ };
158
+ }
159
+ const textError = await response.text();
160
+ let jsonError;
161
+ try {
162
+ jsonError = JSON.parse(textError);
163
+ }
164
+ catch {
165
+ // noop
166
+ }
167
+ const error = jsonError ?? textError;
168
+ let finalError = error;
169
+ for (const fn of interceptors.error.fns) {
170
+ if (fn) {
171
+ finalError = (await fn(error, response, request, opts));
172
+ }
173
+ }
174
+ finalError = finalError || {};
175
+ if (opts.throwOnError) {
176
+ throw finalError;
177
+ }
178
+ // TODO: we probably want to return error and improve types
179
+ return opts.responseStyle === 'data'
180
+ ? undefined
181
+ : {
182
+ error: finalError,
183
+ ...result,
184
+ };
185
+ };
186
+ const makeMethodFn = (method) => (options) => request({ ...options, method });
187
+ const makeSseFn = (method) => async (options) => {
188
+ const { opts, url } = await beforeRequest(options);
189
+ return createSseClient({
190
+ ...opts,
191
+ body: opts.body,
192
+ headers: opts.headers,
193
+ method,
194
+ onRequest: async (url, init) => {
195
+ let request = new Request(url, init);
196
+ for (const fn of interceptors.request.fns) {
197
+ if (fn) {
198
+ request = await fn(request, opts);
199
+ }
200
+ }
201
+ return request;
202
+ },
203
+ serializedBody: getValidRequestBody(opts),
204
+ url,
205
+ });
206
+ };
207
+ const _buildUrl = (options) => buildUrl({ ..._config, ...options });
208
+ return {
209
+ buildUrl: _buildUrl,
210
+ connect: makeMethodFn('CONNECT'),
211
+ delete: makeMethodFn('DELETE'),
212
+ get: makeMethodFn('GET'),
213
+ getConfig,
214
+ head: makeMethodFn('HEAD'),
215
+ interceptors,
216
+ options: makeMethodFn('OPTIONS'),
217
+ patch: makeMethodFn('PATCH'),
218
+ post: makeMethodFn('POST'),
219
+ put: makeMethodFn('PUT'),
220
+ request,
221
+ setConfig,
222
+ sse: {
223
+ connect: makeSseFn('CONNECT'),
224
+ delete: makeSseFn('DELETE'),
225
+ get: makeSseFn('GET'),
226
+ head: makeSseFn('HEAD'),
227
+ options: makeSseFn('OPTIONS'),
228
+ patch: makeSseFn('PATCH'),
229
+ post: makeSseFn('POST'),
230
+ put: makeSseFn('PUT'),
231
+ trace: makeSseFn('TRACE'),
232
+ },
233
+ trace: makeMethodFn('TRACE'),
234
+ };
235
+ };
236
+ //# sourceMappingURL=client.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.gen.js","sourceRoot":"","sources":["../../../src/estate/client/client.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,GACd,MAAM,aAAa,CAAC;AAOrB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAE,EAAU,EAAE;IAC1D,IAAI,OAAO,GAAG,YAAY,CAAC,YAAY,EAAE,EAAE,MAAM,CAAC,CAAC;IAEnD,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAG,CAAC,MAAc,EAAU,EAAE;QAC3C,OAAO,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,SAAS,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,kBAAkB,EAAsD,CAAC;IAE9F,MAAM,aAAa,GAAG,KAAK,EAAE,OAAuB,EAAE,EAAE;QACtD,MAAM,IAAI,GAAG;YACX,GAAG,OAAO;YACV,GAAG,OAAO;YACV,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK;YACzD,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;YACvD,cAAc,EAAE,SAA+B;SAChD,CAAC;QAEF,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,aA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,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAExF,OAAO;QACL,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC;QAChC,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC;QAC9B,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC;QACxB,SAAS;QACT,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;QAC1B,YAAY;QACZ,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC;QAChC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC;QAC5B,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;QAC1B,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC;QACxB,OAAO;QACP,SAAS;QACT,GAAG,EAAE;YACH,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;YAC7B,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC;YAC3B,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC;YACrB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;YAC7B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;YACzB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;YACvB,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC;YACrB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;SAC1B;QACD,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC;KACnB,CAAC;AACd,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type { Auth } from '../core/auth.gen';
2
+ export type { QuerySerializerOptions } from '../core/bodySerializer.gen';
3
+ export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer, } from '../core/bodySerializer.gen';
4
+ export { buildClientParams } from '../core/params.gen';
5
+ export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen';
6
+ export { createClient } from './client.gen';
7
+ export type { Client, ClientOptions, Config, CreateClientConfig, Options, RequestOptions, RequestResult, ResolvedRequestOptions, ResponseStyle, TDataShape, } from './types.gen';
8
+ export { createConfig, mergeHeaders } from './utils.gen';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/estate/client/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,MAAM,EACN,aAAa,EACb,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer, } from '../core/bodySerializer.gen';
3
+ export { buildClientParams } from '../core/params.gen';
4
+ export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen';
5
+ export { createClient } from './client.gen';
6
+ export { createConfig, mergeHeaders } from './utils.gen';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/estate/client/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAIrD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,118 @@
1
+ import type { Auth } from '../core/auth.gen';
2
+ import type { ServerSentEventsOptions, ServerSentEventsResult } from '../core/serverSentEvents.gen';
3
+ import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen';
4
+ import type { Middleware } from './utils.gen';
5
+ export type ResponseStyle = 'data' | 'fields';
6
+ export interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, CoreConfig {
7
+ /**
8
+ * Base URL for all requests made by this client.
9
+ */
10
+ baseUrl?: T['baseUrl'];
11
+ /**
12
+ * Fetch API implementation. You can use this option to provide a custom
13
+ * fetch instance.
14
+ *
15
+ * @default globalThis.fetch
16
+ */
17
+ fetch?: typeof fetch;
18
+ /**
19
+ * Please don't use the Fetch client for Next.js applications. The `next`
20
+ * options won't have any effect.
21
+ *
22
+ * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
23
+ */
24
+ next?: never;
25
+ /**
26
+ * Return the response data parsed in a specified format. By default, `auto`
27
+ * will infer the appropriate method from the `Content-Type` response header.
28
+ * You can override this behavior with any of the {@link Body} methods.
29
+ * Select `stream` if you don't want to parse response data at all.
30
+ *
31
+ * @default 'auto'
32
+ */
33
+ parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
34
+ /**
35
+ * Should we return only data or multiple fields (data, error, response, etc.)?
36
+ *
37
+ * @default 'fields'
38
+ */
39
+ responseStyle?: ResponseStyle;
40
+ /**
41
+ * Throw an error instead of returning it in the response?
42
+ *
43
+ * @default false
44
+ */
45
+ throwOnError?: T['throwOnError'];
46
+ }
47
+ export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
48
+ responseStyle: TResponseStyle;
49
+ throwOnError: ThrowOnError;
50
+ }>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
51
+ /**
52
+ * Any body that you want to add to your request.
53
+ *
54
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
55
+ */
56
+ body?: unknown;
57
+ path?: Record<string, unknown>;
58
+ query?: Record<string, unknown>;
59
+ /**
60
+ * Security mechanism(s) to use for the request.
61
+ */
62
+ security?: ReadonlyArray<Auth>;
63
+ url: Url;
64
+ }
65
+ export interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
66
+ serializedBody?: string;
67
+ }
68
+ export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
69
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
70
+ request: Request;
71
+ response: Response;
72
+ }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
73
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
74
+ error: undefined;
75
+ } | {
76
+ data: undefined;
77
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
78
+ }) & {
79
+ request: Request;
80
+ response: Response;
81
+ }>;
82
+ export interface ClientOptions {
83
+ baseUrl?: string;
84
+ responseStyle?: ResponseStyle;
85
+ throwOnError?: boolean;
86
+ }
87
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
88
+ type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData, TError>>;
89
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
90
+ type BuildUrlFn = <TData extends {
91
+ body?: unknown;
92
+ path?: Record<string, unknown>;
93
+ query?: Record<string, unknown>;
94
+ url: string;
95
+ }>(options: TData & Options<TData>) => string;
96
+ export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
97
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
98
+ };
99
+ /**
100
+ * The `createClientConfig()` function will be called on client initialization
101
+ * and the returned object will become the client's initial configuration.
102
+ *
103
+ * You may want to initialize your client this way instead of calling
104
+ * `setConfig()`. This is useful for example if you're using Next.js
105
+ * to ensure your client always has the correct values.
106
+ */
107
+ export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
108
+ export interface TDataShape {
109
+ body?: unknown;
110
+ headers?: unknown;
111
+ path?: unknown;
112
+ query?: unknown;
113
+ url: string;
114
+ }
115
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
116
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
117
+ export {};
118
+ //# sourceMappingURL=types.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.gen.d.ts","sourceRoot":"","sources":["../../../src/estate/client/types.gen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,MAAM,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,CAC7D,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,EAAE,UAAU;IACpE;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;IACvB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC;IACb;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpF;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,cAAc,CAC7B,KAAK,GAAG,OAAO,EACf,cAAc,SAAS,aAAa,GAAG,QAAQ,EAC/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Aa,GAAG,aAAa,IAAI,CACxE,QAAQ,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,KACjC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,KAAK,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEnD,MAAM,MAAM,OAAO,CACjB,KAAK,SAAS,UAAU,GAAG,UAAU,EACrC,YAAY,SAAS,OAAO,GAAG,OAAO,EACtC,SAAS,GAAG,OAAO,EACnB,cAAc,SAAS,aAAa,GAAG,QAAQ,IAC7C,QAAQ,CACV,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,YAAY,CAAC,EACvD,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAClC,GACC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export {};
3
+ //# sourceMappingURL=types.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.gen.js","sourceRoot":"","sources":["../../../src/estate/client/types.gen.ts"],"names":[],"mappings":"AAAA,qDAAqD"}
@@ -0,0 +1,34 @@
1
+ import type { QuerySerializerOptions } from '../core/bodySerializer.gen';
2
+ import type { Client, ClientOptions, Config, RequestOptions } from './types.gen';
3
+ export declare const createQuerySerializer: <T = unknown>({ parameters, ...args }?: QuerySerializerOptions) => (queryParams: T) => string;
4
+ /**
5
+ * Infers parseAs value from provided Content-Type header.
6
+ */
7
+ export declare const getParseAs: (contentType: string | null) => Exclude<Config["parseAs"], "auto">;
8
+ export declare const setAuthParams: ({ security, ...options }: Pick<Required<RequestOptions>, "security"> & Pick<RequestOptions, "auth" | "query"> & {
9
+ headers: Headers;
10
+ }) => Promise<void>;
11
+ export declare const buildUrl: Client['buildUrl'];
12
+ export declare const mergeConfigs: (a: Config, b: Config) => Config;
13
+ export declare const mergeHeaders: (...headers: Array<Required<Config>["headers"] | undefined>) => Headers;
14
+ type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
15
+ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
16
+ type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
17
+ declare class Interceptors<Interceptor> {
18
+ fns: Array<Interceptor | null>;
19
+ clear(): void;
20
+ eject(id: number | Interceptor): void;
21
+ exists(id: number | Interceptor): boolean;
22
+ getInterceptorIndex(id: number | Interceptor): number;
23
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
24
+ use(fn: Interceptor): number;
25
+ }
26
+ export interface Middleware<Req, Res, Err, Options> {
27
+ error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
28
+ request: Interceptors<ReqInterceptor<Req, Options>>;
29
+ response: Interceptors<ResInterceptor<Res, Req, Options>>;
30
+ }
31
+ export declare const createInterceptors: <Req, Res, Err, Options>() => Middleware<Req, Res, Err, Options>;
32
+ export declare const createConfig: <T extends ClientOptions = ClientOptions>(override?: Config<Omit<ClientOptions, keyof T> & T>) => Config<Omit<ClientOptions, keyof T> & T>;
33
+ export {};
34
+ //# sourceMappingURL=utils.gen.d.ts.map