@remit/api-http-client 0.0.78 → 0.0.80

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 (47) hide show
  1. package/dist/@tanstack/react-query.gen.d.ts +1363 -0
  2. package/{@tanstack/react-query.gen.ts → dist/@tanstack/react-query.gen.js} +298 -300
  3. package/dist/client/client.gen.d.ts +2 -0
  4. package/dist/client/client.gen.js +216 -0
  5. package/{client/index.ts → dist/client/index.d.ts} +2 -19
  6. package/dist/client/index.js +6 -0
  7. package/dist/client/types.gen.d.ts +120 -0
  8. package/dist/client/types.gen.js +2 -0
  9. package/dist/client/utils.gen.d.ts +37 -0
  10. package/dist/client/utils.gen.js +228 -0
  11. package/{client.gen.ts → dist/client.gen.d.ts} +2 -6
  12. package/dist/client.gen.js +3 -0
  13. package/dist/core/auth.gen.d.ts +25 -0
  14. package/dist/core/auth.gen.js +14 -0
  15. package/dist/core/bodySerializer.gen.d.ts +25 -0
  16. package/dist/core/bodySerializer.gen.js +57 -0
  17. package/dist/core/params.gen.d.ts +43 -0
  18. package/dist/core/params.gen.js +109 -0
  19. package/dist/core/pathSerializer.gen.d.ts +33 -0
  20. package/dist/core/pathSerializer.gen.js +106 -0
  21. package/dist/core/queryKeySerializer.gen.d.ts +18 -0
  22. package/dist/core/queryKeySerializer.gen.js +92 -0
  23. package/dist/core/serverSentEvents.gen.d.ts +71 -0
  24. package/dist/core/serverSentEvents.gen.js +132 -0
  25. package/dist/core/types.gen.d.ts +83 -0
  26. package/dist/core/types.gen.js +2 -0
  27. package/dist/core/utils.gen.d.ts +19 -0
  28. package/dist/core/utils.gen.js +87 -0
  29. package/{index.ts → dist/index.d.ts} +2 -4
  30. package/dist/index.js +2 -0
  31. package/dist/sdk.gen.d.ts +444 -0
  32. package/dist/sdk.gen.js +935 -0
  33. package/{types.gen.ts → dist/types.gen.d.ts} +602 -634
  34. package/dist/types.gen.js +2 -0
  35. package/package.json +19 -3
  36. package/client/client.gen.ts +0 -277
  37. package/client/types.gen.ts +0 -218
  38. package/client/utils.gen.ts +0 -316
  39. package/core/auth.gen.ts +0 -48
  40. package/core/bodySerializer.gen.ts +0 -82
  41. package/core/params.gen.ts +0 -178
  42. package/core/pathSerializer.gen.ts +0 -171
  43. package/core/queryKeySerializer.gen.ts +0 -117
  44. package/core/serverSentEvents.gen.ts +0 -242
  45. package/core/types.gen.ts +0 -110
  46. package/core/utils.gen.ts +0 -140
  47. package/sdk.gen.ts +0 -959
package/core/utils.gen.ts DELETED
@@ -1,140 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import type { BodySerializer, QuerySerializer } from './bodySerializer.gen.js';
4
- import {
5
- type ArraySeparatorStyle,
6
- serializeArrayParam,
7
- serializeObjectParam,
8
- serializePrimitiveParam,
9
- } from './pathSerializer.gen.js';
10
-
11
- export interface PathSerializer {
12
- path: Record<string, unknown>;
13
- url: string;
14
- }
15
-
16
- export const PATH_PARAM_RE: RegExp = /\{[^{}]+\}/g;
17
-
18
- export const defaultPathSerializer = ({ path, url: _url }: PathSerializer): string => {
19
- let url = _url;
20
- const matches = _url.match(PATH_PARAM_RE);
21
- if (matches) {
22
- for (const match of matches) {
23
- let explode = false;
24
- let name = match.substring(1, match.length - 1);
25
- let style: ArraySeparatorStyle = 'simple';
26
-
27
- if (name.endsWith('*')) {
28
- explode = true;
29
- name = name.substring(0, name.length - 1);
30
- }
31
-
32
- if (name.startsWith('.')) {
33
- name = name.substring(1);
34
- style = 'label';
35
- } else if (name.startsWith(';')) {
36
- name = name.substring(1);
37
- style = 'matrix';
38
- }
39
-
40
- const value = path[name];
41
-
42
- if (value === undefined || value === null) {
43
- continue;
44
- }
45
-
46
- if (Array.isArray(value)) {
47
- url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
48
- continue;
49
- }
50
-
51
- if (typeof value === 'object') {
52
- url = url.replace(
53
- match,
54
- serializeObjectParam({
55
- explode,
56
- name,
57
- style,
58
- value: value as Record<string, unknown>,
59
- valueOnly: true,
60
- }),
61
- );
62
- continue;
63
- }
64
-
65
- if (style === 'matrix') {
66
- url = url.replace(
67
- match,
68
- `;${serializePrimitiveParam({
69
- name,
70
- value: value as string,
71
- })}`,
72
- );
73
- continue;
74
- }
75
-
76
- const replaceValue = encodeURIComponent(
77
- style === 'label' ? `.${value as string}` : (value as string),
78
- );
79
- url = url.replace(match, replaceValue);
80
- }
81
- }
82
- return url;
83
- };
84
-
85
- export const getUrl = ({
86
- baseUrl,
87
- path,
88
- query,
89
- querySerializer,
90
- url: _url,
91
- }: {
92
- baseUrl?: string;
93
- path?: Record<string, unknown>;
94
- query?: Record<string, unknown>;
95
- querySerializer: QuerySerializer;
96
- url: string;
97
- }): string => {
98
- const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
99
- let url = (baseUrl ?? '') + pathUrl;
100
- if (path) {
101
- url = defaultPathSerializer({ path, url });
102
- }
103
- let search = query ? querySerializer(query) : '';
104
- if (search.startsWith('?')) {
105
- search = search.substring(1);
106
- }
107
- if (search) {
108
- url += `?${search}`;
109
- }
110
- return url;
111
- };
112
-
113
- export function getValidRequestBody(options: {
114
- body?: unknown;
115
- bodySerializer?: BodySerializer | null;
116
- serializedBody?: unknown;
117
- }): unknown {
118
- const hasBody = options.body !== undefined;
119
- const isSerializedBody = hasBody && options.bodySerializer;
120
-
121
- if (isSerializedBody) {
122
- if ('serializedBody' in options) {
123
- const hasSerializedBody =
124
- options.serializedBody !== undefined && options.serializedBody !== '';
125
-
126
- return hasSerializedBody ? options.serializedBody : null;
127
- }
128
-
129
- // not all clients implement a serializedBody property (i.e., client-axios)
130
- return options.body !== '' ? options.body : null;
131
- }
132
-
133
- // plain/text body
134
- if (hasBody) {
135
- return options.body;
136
- }
137
-
138
- // no body was provided
139
- return undefined;
140
- }