@temps-sdk/node-sdk 0.0.1-alpha.3 → 0.0.1-alpha.6
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.
- package/dist/client/client/client.gen.d.ts +2 -0
- package/dist/client/client/client.gen.js +217 -0
- package/dist/client/client/index.d.ts +7 -0
- package/dist/client/client/index.js +5 -0
- package/dist/client/client/types.gen.d.ts +124 -0
- package/dist/client/client/types.gen.js +2 -0
- package/dist/client/client/utils.gen.d.ts +38 -0
- package/dist/client/client/utils.gen.js +229 -0
- package/dist/client/client.gen.d.ts +12 -0
- package/dist/client/client.gen.js +5 -0
- package/dist/client/core/auth.gen.d.ts +18 -0
- package/dist/client/core/auth.gen.js +14 -0
- package/dist/client/core/bodySerializer.gen.d.ts +17 -0
- package/dist/client/core/bodySerializer.gen.js +57 -0
- package/dist/client/core/params.gen.d.ts +33 -0
- package/dist/client/core/params.gen.js +88 -0
- package/dist/client/core/pathSerializer.gen.d.ts +33 -0
- package/dist/client/core/pathSerializer.gen.js +114 -0
- package/dist/client/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/client/core/serverSentEvents.gen.js +135 -0
- package/dist/client/core/types.gen.d.ts +78 -0
- package/dist/client/core/types.gen.js +2 -0
- package/dist/client/core/utils.gen.d.ts +14 -0
- package/dist/client/core/utils.gen.js +69 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +3 -0
- package/dist/client/sdk.gen.d.ts +1323 -0
- package/dist/client/sdk.gen.js +4659 -0
- package/dist/client/types.gen.d.ts +16792 -0
- package/dist/client/types.gen.js +2 -0
- package/dist/errors/client.d.ts +46 -0
- package/dist/errors/client.js +261 -0
- package/dist/errors/hub.d.ts +22 -0
- package/dist/errors/hub.js +102 -0
- package/dist/errors/index.d.ts +35 -0
- package/dist/errors/index.js +167 -0
- package/dist/errors/scope.d.ts +23 -0
- package/dist/errors/scope.js +82 -0
- package/dist/errors/stacktrace.d.ts +5 -0
- package/dist/errors/stacktrace.js +113 -0
- package/dist/errors/transaction.d.ts +57 -0
- package/dist/errors/transaction.js +163 -0
- package/dist/errors/transport.d.ts +23 -0
- package/dist/errors/transport.js +72 -0
- package/dist/errors/types.d.ts +200 -0
- package/dist/errors/types.js +1 -0
- package/dist/index.d.ts +4796 -0
- package/dist/index.js +595 -0
- package/package.json +6 -4
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { serializeArrayParam, serializeObjectParam, serializePrimitiveParam, } from './pathSerializer.gen';
|
|
3
|
+
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
4
|
+
export const defaultPathSerializer = ({ path, url: _url }) => {
|
|
5
|
+
let url = _url;
|
|
6
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
7
|
+
if (matches) {
|
|
8
|
+
for (const match of matches) {
|
|
9
|
+
let explode = false;
|
|
10
|
+
let name = match.substring(1, match.length - 1);
|
|
11
|
+
let style = 'simple';
|
|
12
|
+
if (name.endsWith('*')) {
|
|
13
|
+
explode = true;
|
|
14
|
+
name = name.substring(0, name.length - 1);
|
|
15
|
+
}
|
|
16
|
+
if (name.startsWith('.')) {
|
|
17
|
+
name = name.substring(1);
|
|
18
|
+
style = 'label';
|
|
19
|
+
}
|
|
20
|
+
else if (name.startsWith(';')) {
|
|
21
|
+
name = name.substring(1);
|
|
22
|
+
style = 'matrix';
|
|
23
|
+
}
|
|
24
|
+
const value = path[name];
|
|
25
|
+
if (value === undefined || value === null) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(value)) {
|
|
29
|
+
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (typeof value === 'object') {
|
|
33
|
+
url = url.replace(match, serializeObjectParam({
|
|
34
|
+
explode,
|
|
35
|
+
name,
|
|
36
|
+
style,
|
|
37
|
+
value: value,
|
|
38
|
+
valueOnly: true,
|
|
39
|
+
}));
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (style === 'matrix') {
|
|
43
|
+
url = url.replace(match, `;${serializePrimitiveParam({
|
|
44
|
+
name,
|
|
45
|
+
value: value,
|
|
46
|
+
})}`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const replaceValue = encodeURIComponent(style === 'label' ? `.${value}` : value);
|
|
50
|
+
url = url.replace(match, replaceValue);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return url;
|
|
54
|
+
};
|
|
55
|
+
export const getUrl = ({ baseUrl, path, query, querySerializer, url: _url, }) => {
|
|
56
|
+
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
57
|
+
let url = (baseUrl ?? '') + pathUrl;
|
|
58
|
+
if (path) {
|
|
59
|
+
url = defaultPathSerializer({ path, url });
|
|
60
|
+
}
|
|
61
|
+
let search = query ? querySerializer(query) : '';
|
|
62
|
+
if (search.startsWith('?')) {
|
|
63
|
+
search = search.substring(1);
|
|
64
|
+
}
|
|
65
|
+
if (search) {
|
|
66
|
+
url += `?${search}`;
|
|
67
|
+
}
|
|
68
|
+
return url;
|
|
69
|
+
};
|