@touhidrahman/auditlog-sdk 1.0.2 → 1.0.4
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/index.cjs.js +249 -1
- package/index.esm.js +242 -1
- package/package.json +1 -1
- package/src/{hey-api/core → core}/params.gen.d.ts +1 -1
- package/src/index.d.ts +3 -3
- package/src/{hey-api/types.gen.d.ts → types.gen.d.ts} +2 -0
- package/src/hey-api/index.d.ts +0 -2
- /package/src/{hey-api/client → client}/client.gen.d.ts +0 -0
- /package/src/{hey-api/client → client}/index.d.ts +0 -0
- /package/src/{hey-api/client → client}/types.gen.d.ts +0 -0
- /package/src/{hey-api/client → client}/utils.gen.d.ts +0 -0
- /package/src/{hey-api/client.gen.d.ts → client.gen.d.ts} +0 -0
- /package/src/{hey-api/core → core}/auth.gen.d.ts +0 -0
- /package/src/{hey-api/core → core}/bodySerializer.gen.d.ts +0 -0
- /package/src/{hey-api/core → core}/pathSerializer.gen.d.ts +0 -0
- /package/src/{hey-api/core → core}/queryKeySerializer.gen.d.ts +0 -0
- /package/src/{hey-api/core → core}/serverSentEvents.gen.d.ts +0 -0
- /package/src/{hey-api/core → core}/types.gen.d.ts +0 -0
- /package/src/{hey-api/core → core}/utils.gen.d.ts +0 -0
- /package/src/{hey-api/sdk.gen.d.ts → sdk.gen.d.ts} +0 -0
- /package/src/{hey-api/transformers.gen.d.ts → transformers.gen.d.ts} +0 -0
package/index.cjs.js
CHANGED
|
@@ -1,9 +1,250 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
4
|
+
const serializeFormDataPair = (data, key, value) => {
|
|
5
|
+
if (typeof value === 'string' || value instanceof Blob) {
|
|
6
|
+
data.append(key, value);
|
|
7
|
+
} else if (value instanceof Date) {
|
|
8
|
+
data.append(key, value.toISOString());
|
|
9
|
+
} else {
|
|
10
|
+
data.append(key, JSON.stringify(value));
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const serializeUrlSearchParamsPair = (data, key, value) => {
|
|
14
|
+
if (typeof value === 'string') {
|
|
15
|
+
data.append(key, value);
|
|
16
|
+
} else {
|
|
17
|
+
data.append(key, JSON.stringify(value));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const formDataBodySerializer = {
|
|
21
|
+
bodySerializer: body => {
|
|
22
|
+
const data = new FormData();
|
|
23
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
24
|
+
if (value === undefined || value === null) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
value.forEach(v => serializeFormDataPair(data, key, v));
|
|
29
|
+
} else {
|
|
30
|
+
serializeFormDataPair(data, key, value);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
4
36
|
const jsonBodySerializer = {
|
|
5
37
|
bodySerializer: body => JSON.stringify(body, (_key, value) => typeof value === 'bigint' ? value.toString() : value)
|
|
6
38
|
};
|
|
39
|
+
const urlSearchParamsBodySerializer = {
|
|
40
|
+
bodySerializer: body => {
|
|
41
|
+
const data = new URLSearchParams();
|
|
42
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
43
|
+
if (value === undefined || value === null) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
value.forEach(v => serializeUrlSearchParamsPair(data, key, v));
|
|
48
|
+
} else {
|
|
49
|
+
serializeUrlSearchParamsPair(data, key, value);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return data.toString();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
57
|
+
const extraPrefixesMap = {
|
|
58
|
+
$body_: 'body',
|
|
59
|
+
$headers_: 'headers',
|
|
60
|
+
$path_: 'path',
|
|
61
|
+
$query_: 'query'
|
|
62
|
+
};
|
|
63
|
+
const extraPrefixes = Object.entries(extraPrefixesMap);
|
|
64
|
+
function buildKeyMap(fields, map) {
|
|
65
|
+
if (!map) {
|
|
66
|
+
map = new Map();
|
|
67
|
+
}
|
|
68
|
+
for (const config of fields) {
|
|
69
|
+
if ('in' in config) {
|
|
70
|
+
if (config.key) {
|
|
71
|
+
map.set(config.key, {
|
|
72
|
+
in: config.in,
|
|
73
|
+
map: config.map
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
} else if ('key' in config) {
|
|
77
|
+
map.set(config.key, {
|
|
78
|
+
map: config.map
|
|
79
|
+
});
|
|
80
|
+
} else if (config.args) {
|
|
81
|
+
buildKeyMap(config.args, map);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return map;
|
|
85
|
+
}
|
|
86
|
+
function stripEmptySlots(params) {
|
|
87
|
+
for (const [slot, value] of Object.entries(params)) {
|
|
88
|
+
if (slot === 'body') continue;
|
|
89
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
90
|
+
delete params[slot];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function buildClientParams(args, fields) {
|
|
95
|
+
const params = {
|
|
96
|
+
headers: Object.create(null),
|
|
97
|
+
path: Object.create(null),
|
|
98
|
+
query: Object.create(null)
|
|
99
|
+
};
|
|
100
|
+
const map = buildKeyMap(fields);
|
|
101
|
+
function writeSlot(slot, key, value) {
|
|
102
|
+
let record = params[slot];
|
|
103
|
+
if (record === undefined) {
|
|
104
|
+
record = Object.create(null);
|
|
105
|
+
params[slot] = record;
|
|
106
|
+
}
|
|
107
|
+
record[key] = value;
|
|
108
|
+
}
|
|
109
|
+
let config;
|
|
110
|
+
for (const [index, arg] of args.entries()) {
|
|
111
|
+
if (fields[index]) {
|
|
112
|
+
config = fields[index];
|
|
113
|
+
}
|
|
114
|
+
if (!config) {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if ('in' in config) {
|
|
118
|
+
if (config.key) {
|
|
119
|
+
const field = map.get(config.key);
|
|
120
|
+
const name = field.map || config.key;
|
|
121
|
+
if (field.in) {
|
|
122
|
+
writeSlot(field.in, name, arg);
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
params.body = arg;
|
|
126
|
+
}
|
|
127
|
+
} else {
|
|
128
|
+
for (const [key, value] of Object.entries(arg ?? {})) {
|
|
129
|
+
const field = map.get(key);
|
|
130
|
+
if (field) {
|
|
131
|
+
if (field.in) {
|
|
132
|
+
const name = field.map || key;
|
|
133
|
+
writeSlot(field.in, name, value);
|
|
134
|
+
} else {
|
|
135
|
+
params[field.map] = value;
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
|
|
139
|
+
if (extra) {
|
|
140
|
+
const [prefix, slot] = extra;
|
|
141
|
+
writeSlot(slot, key.slice(prefix.length), value);
|
|
142
|
+
} else if ('allowExtra' in config && config.allowExtra) {
|
|
143
|
+
for (const [slot, allowed] of Object.entries(config.allowExtra)) {
|
|
144
|
+
if (allowed) {
|
|
145
|
+
writeSlot(slot, key, value);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
stripEmptySlots(params);
|
|
155
|
+
return params;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
159
|
+
/**
|
|
160
|
+
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
161
|
+
*/
|
|
162
|
+
const queryKeyJsonReplacer = (_key, value) => {
|
|
163
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
if (typeof value === 'bigint') {
|
|
167
|
+
return value.toString();
|
|
168
|
+
}
|
|
169
|
+
if (value instanceof Date) {
|
|
170
|
+
return value.toISOString();
|
|
171
|
+
}
|
|
172
|
+
return value;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Safely stringifies a value and parses it back into a JsonValue.
|
|
176
|
+
*/
|
|
177
|
+
const stringifyToJsonValue = input => {
|
|
178
|
+
try {
|
|
179
|
+
const json = JSON.stringify(input, queryKeyJsonReplacer);
|
|
180
|
+
if (json === undefined) {
|
|
181
|
+
return undefined;
|
|
182
|
+
}
|
|
183
|
+
return JSON.parse(json);
|
|
184
|
+
} catch {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Detects plain objects (including objects with a null prototype).
|
|
190
|
+
*/
|
|
191
|
+
const isPlainObject = value => {
|
|
192
|
+
if (value === null || typeof value !== 'object') {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
const prototype = Object.getPrototypeOf(value);
|
|
196
|
+
return prototype === Object.prototype || prototype === null;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
200
|
+
*/
|
|
201
|
+
const serializeSearchParams = params => {
|
|
202
|
+
const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
|
|
203
|
+
const result = {};
|
|
204
|
+
for (const [key, value] of entries) {
|
|
205
|
+
const existing = result[key];
|
|
206
|
+
if (existing === undefined) {
|
|
207
|
+
result[key] = value;
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
if (Array.isArray(existing)) {
|
|
211
|
+
existing.push(value);
|
|
212
|
+
} else {
|
|
213
|
+
result[key] = [existing, value];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return result;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
220
|
+
*/
|
|
221
|
+
const serializeQueryKeyValue = value => {
|
|
222
|
+
if (value === null) {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
229
|
+
return undefined;
|
|
230
|
+
}
|
|
231
|
+
if (typeof value === 'bigint') {
|
|
232
|
+
return value.toString();
|
|
233
|
+
}
|
|
234
|
+
if (value instanceof Date) {
|
|
235
|
+
return value.toISOString();
|
|
236
|
+
}
|
|
237
|
+
if (Array.isArray(value)) {
|
|
238
|
+
return stringifyToJsonValue(value);
|
|
239
|
+
}
|
|
240
|
+
if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) {
|
|
241
|
+
return serializeSearchParams(value);
|
|
242
|
+
}
|
|
243
|
+
if (isPlainObject(value)) {
|
|
244
|
+
return stringifyToJsonValue(value);
|
|
245
|
+
}
|
|
246
|
+
return undefined;
|
|
247
|
+
};
|
|
7
248
|
|
|
8
249
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
9
250
|
function createSseClient({
|
|
@@ -1076,11 +1317,14 @@ const deleteLogsEntityEntityId = options => (options.client ?? client).delete({
|
|
|
1076
1317
|
...options
|
|
1077
1318
|
});
|
|
1078
1319
|
|
|
1079
|
-
exports.
|
|
1320
|
+
exports.buildClientParams = buildClientParams;
|
|
1321
|
+
exports.createClient = createClient;
|
|
1322
|
+
exports.createConfig = createConfig;
|
|
1080
1323
|
exports.deleteLogsEntityEntityId = deleteLogsEntityEntityId;
|
|
1081
1324
|
exports.deleteLogsId = deleteLogsId;
|
|
1082
1325
|
exports.deleteProjectsByProjectId = deleteProjectsByProjectId;
|
|
1083
1326
|
exports.deleteSecretKeysById = deleteSecretKeysById;
|
|
1327
|
+
exports.formDataBodySerializer = formDataBodySerializer;
|
|
1084
1328
|
exports.get = get;
|
|
1085
1329
|
exports.getLogs = getLogs;
|
|
1086
1330
|
exports.getLogsExportCsv = getLogsExportCsv;
|
|
@@ -1089,6 +1333,8 @@ exports.getProjects = getProjects;
|
|
|
1089
1333
|
exports.getProjectsByProjectId = getProjectsByProjectId;
|
|
1090
1334
|
exports.getSecretKeys = getSecretKeys;
|
|
1091
1335
|
exports.getSecretKeysById = getSecretKeysById;
|
|
1336
|
+
exports.jsonBodySerializer = jsonBodySerializer;
|
|
1337
|
+
exports.mergeHeaders = mergeHeaders;
|
|
1092
1338
|
exports.postAdminLogin = postAdminLogin;
|
|
1093
1339
|
exports.postAdminNewToken = postAdminNewToken;
|
|
1094
1340
|
exports.postLogs = postLogs;
|
|
@@ -1096,3 +1342,5 @@ exports.postProjects = postProjects;
|
|
|
1096
1342
|
exports.postSecretKeys = postSecretKeys;
|
|
1097
1343
|
exports.putProjectsByProjectId = putProjectsByProjectId;
|
|
1098
1344
|
exports.putProjectsByProjectIdChangeId = putProjectsByProjectIdChangeId;
|
|
1345
|
+
exports.serializeQueryKeyValue = serializeQueryKeyValue;
|
|
1346
|
+
exports.urlSearchParamsBodySerializer = urlSearchParamsBodySerializer;
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,248 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
const serializeFormDataPair = (data, key, value) => {
|
|
3
|
+
if (typeof value === 'string' || value instanceof Blob) {
|
|
4
|
+
data.append(key, value);
|
|
5
|
+
} else if (value instanceof Date) {
|
|
6
|
+
data.append(key, value.toISOString());
|
|
7
|
+
} else {
|
|
8
|
+
data.append(key, JSON.stringify(value));
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const serializeUrlSearchParamsPair = (data, key, value) => {
|
|
12
|
+
if (typeof value === 'string') {
|
|
13
|
+
data.append(key, value);
|
|
14
|
+
} else {
|
|
15
|
+
data.append(key, JSON.stringify(value));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const formDataBodySerializer = {
|
|
19
|
+
bodySerializer: body => {
|
|
20
|
+
const data = new FormData();
|
|
21
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
22
|
+
if (value === undefined || value === null) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
value.forEach(v => serializeFormDataPair(data, key, v));
|
|
27
|
+
} else {
|
|
28
|
+
serializeFormDataPair(data, key, value);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
2
34
|
const jsonBodySerializer = {
|
|
3
35
|
bodySerializer: body => JSON.stringify(body, (_key, value) => typeof value === 'bigint' ? value.toString() : value)
|
|
4
36
|
};
|
|
37
|
+
const urlSearchParamsBodySerializer = {
|
|
38
|
+
bodySerializer: body => {
|
|
39
|
+
const data = new URLSearchParams();
|
|
40
|
+
Object.entries(body).forEach(([key, value]) => {
|
|
41
|
+
if (value === undefined || value === null) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (Array.isArray(value)) {
|
|
45
|
+
value.forEach(v => serializeUrlSearchParamsPair(data, key, v));
|
|
46
|
+
} else {
|
|
47
|
+
serializeUrlSearchParamsPair(data, key, value);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return data.toString();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
55
|
+
const extraPrefixesMap = {
|
|
56
|
+
$body_: 'body',
|
|
57
|
+
$headers_: 'headers',
|
|
58
|
+
$path_: 'path',
|
|
59
|
+
$query_: 'query'
|
|
60
|
+
};
|
|
61
|
+
const extraPrefixes = Object.entries(extraPrefixesMap);
|
|
62
|
+
function buildKeyMap(fields, map) {
|
|
63
|
+
if (!map) {
|
|
64
|
+
map = new Map();
|
|
65
|
+
}
|
|
66
|
+
for (const config of fields) {
|
|
67
|
+
if ('in' in config) {
|
|
68
|
+
if (config.key) {
|
|
69
|
+
map.set(config.key, {
|
|
70
|
+
in: config.in,
|
|
71
|
+
map: config.map
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
} else if ('key' in config) {
|
|
75
|
+
map.set(config.key, {
|
|
76
|
+
map: config.map
|
|
77
|
+
});
|
|
78
|
+
} else if (config.args) {
|
|
79
|
+
buildKeyMap(config.args, map);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return map;
|
|
83
|
+
}
|
|
84
|
+
function stripEmptySlots(params) {
|
|
85
|
+
for (const [slot, value] of Object.entries(params)) {
|
|
86
|
+
if (slot === 'body') continue;
|
|
87
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) {
|
|
88
|
+
delete params[slot];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function buildClientParams(args, fields) {
|
|
93
|
+
const params = {
|
|
94
|
+
headers: Object.create(null),
|
|
95
|
+
path: Object.create(null),
|
|
96
|
+
query: Object.create(null)
|
|
97
|
+
};
|
|
98
|
+
const map = buildKeyMap(fields);
|
|
99
|
+
function writeSlot(slot, key, value) {
|
|
100
|
+
let record = params[slot];
|
|
101
|
+
if (record === undefined) {
|
|
102
|
+
record = Object.create(null);
|
|
103
|
+
params[slot] = record;
|
|
104
|
+
}
|
|
105
|
+
record[key] = value;
|
|
106
|
+
}
|
|
107
|
+
let config;
|
|
108
|
+
for (const [index, arg] of args.entries()) {
|
|
109
|
+
if (fields[index]) {
|
|
110
|
+
config = fields[index];
|
|
111
|
+
}
|
|
112
|
+
if (!config) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if ('in' in config) {
|
|
116
|
+
if (config.key) {
|
|
117
|
+
const field = map.get(config.key);
|
|
118
|
+
const name = field.map || config.key;
|
|
119
|
+
if (field.in) {
|
|
120
|
+
writeSlot(field.in, name, arg);
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
params.body = arg;
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
for (const [key, value] of Object.entries(arg ?? {})) {
|
|
127
|
+
const field = map.get(key);
|
|
128
|
+
if (field) {
|
|
129
|
+
if (field.in) {
|
|
130
|
+
const name = field.map || key;
|
|
131
|
+
writeSlot(field.in, name, value);
|
|
132
|
+
} else {
|
|
133
|
+
params[field.map] = value;
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
|
|
137
|
+
if (extra) {
|
|
138
|
+
const [prefix, slot] = extra;
|
|
139
|
+
writeSlot(slot, key.slice(prefix.length), value);
|
|
140
|
+
} else if ('allowExtra' in config && config.allowExtra) {
|
|
141
|
+
for (const [slot, allowed] of Object.entries(config.allowExtra)) {
|
|
142
|
+
if (allowed) {
|
|
143
|
+
writeSlot(slot, key, value);
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
stripEmptySlots(params);
|
|
153
|
+
return params;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
157
|
+
/**
|
|
158
|
+
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
|
|
159
|
+
*/
|
|
160
|
+
const queryKeyJsonReplacer = (_key, value) => {
|
|
161
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
if (typeof value === 'bigint') {
|
|
165
|
+
return value.toString();
|
|
166
|
+
}
|
|
167
|
+
if (value instanceof Date) {
|
|
168
|
+
return value.toISOString();
|
|
169
|
+
}
|
|
170
|
+
return value;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Safely stringifies a value and parses it back into a JsonValue.
|
|
174
|
+
*/
|
|
175
|
+
const stringifyToJsonValue = input => {
|
|
176
|
+
try {
|
|
177
|
+
const json = JSON.stringify(input, queryKeyJsonReplacer);
|
|
178
|
+
if (json === undefined) {
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
return JSON.parse(json);
|
|
182
|
+
} catch {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Detects plain objects (including objects with a null prototype).
|
|
188
|
+
*/
|
|
189
|
+
const isPlainObject = value => {
|
|
190
|
+
if (value === null || typeof value !== 'object') {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
const prototype = Object.getPrototypeOf(value);
|
|
194
|
+
return prototype === Object.prototype || prototype === null;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Turns URLSearchParams into a sorted JSON object for deterministic keys.
|
|
198
|
+
*/
|
|
199
|
+
const serializeSearchParams = params => {
|
|
200
|
+
const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b));
|
|
201
|
+
const result = {};
|
|
202
|
+
for (const [key, value] of entries) {
|
|
203
|
+
const existing = result[key];
|
|
204
|
+
if (existing === undefined) {
|
|
205
|
+
result[key] = value;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (Array.isArray(existing)) {
|
|
209
|
+
existing.push(value);
|
|
210
|
+
} else {
|
|
211
|
+
result[key] = [existing, value];
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Normalizes any accepted value into a JSON-friendly shape for query keys.
|
|
218
|
+
*/
|
|
219
|
+
const serializeQueryKeyValue = value => {
|
|
220
|
+
if (value === null) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
224
|
+
return value;
|
|
225
|
+
}
|
|
226
|
+
if (value === undefined || typeof value === 'function' || typeof value === 'symbol') {
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
if (typeof value === 'bigint') {
|
|
230
|
+
return value.toString();
|
|
231
|
+
}
|
|
232
|
+
if (value instanceof Date) {
|
|
233
|
+
return value.toISOString();
|
|
234
|
+
}
|
|
235
|
+
if (Array.isArray(value)) {
|
|
236
|
+
return stringifyToJsonValue(value);
|
|
237
|
+
}
|
|
238
|
+
if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) {
|
|
239
|
+
return serializeSearchParams(value);
|
|
240
|
+
}
|
|
241
|
+
if (isPlainObject(value)) {
|
|
242
|
+
return stringifyToJsonValue(value);
|
|
243
|
+
}
|
|
244
|
+
return undefined;
|
|
245
|
+
};
|
|
5
246
|
|
|
6
247
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
7
248
|
function createSseClient({
|
|
@@ -1074,4 +1315,4 @@ const deleteLogsEntityEntityId = options => (options.client ?? client).delete({
|
|
|
1074
1315
|
...options
|
|
1075
1316
|
});
|
|
1076
1317
|
|
|
1077
|
-
export {
|
|
1318
|
+
export { buildClientParams, createClient, createConfig, deleteLogsEntityEntityId, deleteLogsId, deleteProjectsByProjectId, deleteSecretKeysById, formDataBodySerializer, get, getLogs, getLogsExportCsv, getLogsId, getProjects, getProjectsByProjectId, getSecretKeys, getSecretKeysById, jsonBodySerializer, mergeHeaders, postAdminLogin, postAdminNewToken, postLogs, postProjects, postSecretKeys, putProjectsByProjectId, putProjectsByProjectIdChangeId, serializeQueryKeyValue, urlSearchParamsBodySerializer };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './client';
|
|
2
|
+
export { deleteLogsEntityEntityId, deleteLogsId, deleteProjectsByProjectId, deleteSecretKeysById, get, getLogs, getLogsExportCsv, getLogsId, getProjects, getProjectsByProjectId, getSecretKeys, getSecretKeysById, type Options, postAdminLogin, postAdminNewToken, postLogs, postProjects, postSecretKeys, putProjectsByProjectId, putProjectsByProjectIdChangeId, } from './sdk.gen';
|
|
3
|
+
export type { ClientOptions, DeleteLogsEntityEntityIdData, DeleteLogsEntityEntityIdError, DeleteLogsEntityEntityIdErrors, DeleteLogsEntityEntityIdResponse, DeleteLogsEntityEntityIdResponses, DeleteLogsIdData, DeleteLogsIdError, DeleteLogsIdErrors, DeleteLogsIdResponse, DeleteLogsIdResponses, DeleteProjectsByProjectIdData, DeleteProjectsByProjectIdResponse, DeleteProjectsByProjectIdResponses, DeleteSecretKeysByIdData, DeleteSecretKeysByIdResponse, DeleteSecretKeysByIdResponses, GetData, GetLogsData, GetLogsExportCsvData, GetLogsExportCsvResponse, GetLogsExportCsvResponses, GetLogsIdData, GetLogsIdError, GetLogsIdErrors, GetLogsIdResponse, GetLogsIdResponses, GetLogsResponse, GetLogsResponses, GetProjectsByProjectIdData, GetProjectsByProjectIdResponse, GetProjectsByProjectIdResponses, GetProjectsData, GetProjectsResponse, GetProjectsResponses, GetResponse, GetResponses, GetSecretKeysByIdData, GetSecretKeysByIdResponse, GetSecretKeysByIdResponses, GetSecretKeysData, GetSecretKeysResponse, GetSecretKeysResponses, PostAdminLoginData, PostAdminLoginResponse, PostAdminLoginResponses, PostAdminNewTokenData, PostAdminNewTokenResponse, PostAdminNewTokenResponses, PostLogsData, PostLogsError, PostLogsErrors, PostLogsResponse, PostLogsResponses, PostProjectsData, PostProjectsResponse, PostProjectsResponses, PostSecretKeysData, PostSecretKeysResponse, PostSecretKeysResponses, PutProjectsByProjectIdChangeIdData, PutProjectsByProjectIdChangeIdResponse, PutProjectsByProjectIdChangeIdResponses, PutProjectsByProjectIdData, PutProjectsByProjectIdResponse, PutProjectsByProjectIdResponses, } from './types.gen';
|
|
@@ -433,6 +433,7 @@ export type GetLogsData = {
|
|
|
433
433
|
sortOrder?: 'asc' | 'desc';
|
|
434
434
|
page?: number;
|
|
435
435
|
size?: number;
|
|
436
|
+
searchField?: string;
|
|
436
437
|
dateFrom?: string;
|
|
437
438
|
dateTo?: string;
|
|
438
439
|
};
|
|
@@ -587,6 +588,7 @@ export type GetLogsExportCsvData = {
|
|
|
587
588
|
sortOrder?: 'asc' | 'desc';
|
|
588
589
|
page?: number;
|
|
589
590
|
size?: number;
|
|
591
|
+
searchField?: string;
|
|
590
592
|
dateFrom?: string;
|
|
591
593
|
dateTo?: string;
|
|
592
594
|
};
|
package/src/hey-api/index.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { deleteLogsEntityEntityId, deleteLogsId, deleteProjectsByProjectId, deleteSecretKeysById, get, getLogs, getLogsExportCsv, getLogsId, getProjects, getProjectsByProjectId, getSecretKeys, getSecretKeysById, type Options, postAdminLogin, postAdminNewToken, postLogs, postProjects, postSecretKeys, putProjectsByProjectId, putProjectsByProjectIdChangeId, } from './sdk.gen';
|
|
2
|
-
export type { ClientOptions, DeleteLogsEntityEntityIdData, DeleteLogsEntityEntityIdError, DeleteLogsEntityEntityIdErrors, DeleteLogsEntityEntityIdResponse, DeleteLogsEntityEntityIdResponses, DeleteLogsIdData, DeleteLogsIdError, DeleteLogsIdErrors, DeleteLogsIdResponse, DeleteLogsIdResponses, DeleteProjectsByProjectIdData, DeleteProjectsByProjectIdResponse, DeleteProjectsByProjectIdResponses, DeleteSecretKeysByIdData, DeleteSecretKeysByIdResponse, DeleteSecretKeysByIdResponses, GetData, GetLogsData, GetLogsExportCsvData, GetLogsExportCsvResponse, GetLogsExportCsvResponses, GetLogsIdData, GetLogsIdError, GetLogsIdErrors, GetLogsIdResponse, GetLogsIdResponses, GetLogsResponse, GetLogsResponses, GetProjectsByProjectIdData, GetProjectsByProjectIdResponse, GetProjectsByProjectIdResponses, GetProjectsData, GetProjectsResponse, GetProjectsResponses, GetResponse, GetResponses, GetSecretKeysByIdData, GetSecretKeysByIdResponse, GetSecretKeysByIdResponses, GetSecretKeysData, GetSecretKeysResponse, GetSecretKeysResponses, PostAdminLoginData, PostAdminLoginResponse, PostAdminLoginResponses, PostAdminNewTokenData, PostAdminNewTokenResponse, PostAdminNewTokenResponses, PostLogsData, PostLogsError, PostLogsErrors, PostLogsResponse, PostLogsResponses, PostProjectsData, PostProjectsResponse, PostProjectsResponses, PostSecretKeysData, PostSecretKeysResponse, PostSecretKeysResponses, PutProjectsByProjectIdChangeIdData, PutProjectsByProjectIdChangeIdResponse, PutProjectsByProjectIdChangeIdResponses, PutProjectsByProjectIdData, PutProjectsByProjectIdResponse, PutProjectsByProjectIdResponses, } from './types.gen';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|