@adgytec/adgytec-web-utils 0.0.2 → 0.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/dist/chunks/applicationError +28 -0
- package/dist/chunks/decode +42 -31
- package/dist/chunks/formParse +11 -0
- package/dist/chunks/parse +19 -82
- package/dist/chunks/schema +322 -0
- package/dist/chunks/upload +97 -95
- package/dist/constants/httpRequestCredentials.d.ts +1 -0
- package/dist/constants/httpRequestHeaders.d.ts +14 -6
- package/dist/constants/http_methods.d.ts +7 -0
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +27 -15
- package/dist/errorCodes/auth.d.ts +14 -0
- package/dist/errorCodes/common.d.ts +8 -0
- package/dist/errorCodes/form.d.ts +28 -0
- package/dist/errorCodes/iam.d.ts +6 -0
- package/dist/errorCodes/index.d.ts +8 -0
- package/dist/errorCodes/index.js +87 -0
- package/dist/errorCodes/media.d.ts +12 -0
- package/dist/errorCodes/pagination.d.ts +3 -0
- package/dist/errorCodes/reqBody.d.ts +6 -0
- package/dist/errorCodes/server.d.ts +7 -0
- package/dist/errorSchema/auth.d.ts +37 -0
- package/dist/errorSchema/common.d.ts +10 -0
- package/dist/errorSchema/form.d.ts +14 -0
- package/dist/errorSchema/formField.d.ts +117 -0
- package/dist/errorSchema/formFieldInvalid.d.ts +79 -0
- package/dist/errorSchema/formParse.d.ts +4 -0
- package/dist/errorSchema/iam.d.ts +21 -0
- package/dist/errorSchema/index.d.ts +12 -0
- package/dist/errorSchema/index.js +69 -0
- package/dist/errorSchema/media.d.ts +41 -0
- package/dist/errorSchema/pagination.d.ts +4 -0
- package/dist/errorSchema/reqBody.d.ts +35 -0
- package/dist/errorSchema/schema.d.ts +138 -0
- package/dist/errorSchema/server.d.ts +29 -0
- package/dist/errors/applicationError.d.ts +10 -0
- package/dist/errors/index.d.ts +1 -2
- package/dist/errors/index.js +5 -6
- package/dist/errors/parse.d.ts +15 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +99 -33
- package/dist/media/types/lifecycle.d.ts +1 -2
- package/dist/response/decode.d.ts +1 -1
- package/dist/response/errorResponse.d.ts +1 -0
- package/dist/response/successReponse.d.ts +2 -0
- package/package.json +4 -2
- package/dist/chunks/apiError +0 -24
- package/dist/constants/http.d.ts +0 -5
- package/dist/constants/httpRequest.d.ts +0 -3
- package/dist/errors/apiError.d.ts +0 -8
- package/dist/errors/types.d.ts +0 -20
package/dist/chunks/upload
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import r from "zod";
|
|
2
|
-
import { v7 as
|
|
3
|
-
import { B as n } from "./
|
|
4
|
-
import { Queue as
|
|
5
|
-
import {
|
|
6
|
-
import { d as
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
2
|
+
import { v7 as u } from "uuid";
|
|
3
|
+
import { B as n, A as l } from "./applicationError";
|
|
4
|
+
import { Queue as m } from "@datastructures-js/queue";
|
|
5
|
+
import { d as y } from "./decode";
|
|
6
|
+
import { httpMethods as c, httpReqHeaders as d, httpRequestCredentials as f } from "../constants/index.js";
|
|
7
|
+
import { mediaCodes as p } from "../errorCodes/index.js";
|
|
8
|
+
const w = r.object({
|
|
9
9
|
presignPut: r.url(),
|
|
10
10
|
partNumber: r.int().positive().lte(1e4),
|
|
11
11
|
partSize: r.int().positive().gt(0)
|
|
12
|
-
}),
|
|
12
|
+
}), g = r.object({
|
|
13
13
|
mediaID: r.uuidv7(),
|
|
14
14
|
uploadType: r.literal("multipart"),
|
|
15
|
-
multipartPresignPart: r.array(
|
|
15
|
+
multipartPresignPart: r.array(w).nonempty(),
|
|
16
16
|
multipartSuccessCallback: r.url()
|
|
17
|
-
}),
|
|
17
|
+
}), U = r.object({
|
|
18
18
|
mediaID: r.uuidv7(),
|
|
19
19
|
uploadType: r.literal("singlepart"),
|
|
20
20
|
presignPut: r.url(),
|
|
21
21
|
singlepartSuccessCallback: r.url()
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
]),
|
|
26
|
-
id:
|
|
27
|
-
name:
|
|
28
|
-
size:
|
|
29
|
-
file:
|
|
30
|
-
}),
|
|
31
|
-
id:
|
|
32
|
-
size:
|
|
33
|
-
name:
|
|
34
|
-
}),
|
|
35
|
-
if (
|
|
22
|
+
}), I = r.discriminatedUnion("uploadType", [
|
|
23
|
+
g,
|
|
24
|
+
U
|
|
25
|
+
]), C = (a) => ({
|
|
26
|
+
id: u(),
|
|
27
|
+
name: a.name,
|
|
28
|
+
size: a.size,
|
|
29
|
+
file: a
|
|
30
|
+
}), k = (a) => a.map(C), P = (a) => ({
|
|
31
|
+
id: a.id,
|
|
32
|
+
size: a.size,
|
|
33
|
+
name: a.name
|
|
34
|
+
}), q = (a) => a.map(P), R = (a, t) => {
|
|
35
|
+
if (a.id !== t.mediaID)
|
|
36
36
|
throw new n("media item and response id mismatch");
|
|
37
37
|
return {
|
|
38
38
|
...t,
|
|
39
|
-
file:
|
|
40
|
-
size:
|
|
39
|
+
file: a.file,
|
|
40
|
+
size: a.size
|
|
41
41
|
};
|
|
42
|
-
},
|
|
43
|
-
if (
|
|
42
|
+
}, $ = (a, t) => {
|
|
43
|
+
if (a.length !== t.length)
|
|
44
44
|
throw new n(
|
|
45
|
-
`items mismatch: mediaInfos=${
|
|
45
|
+
`items mismatch: mediaInfos=${a.length}, apiResponses=${t.length}`
|
|
46
46
|
);
|
|
47
47
|
const e = new Map(
|
|
48
48
|
t.map((i) => [i.mediaID, i])
|
|
49
49
|
);
|
|
50
|
-
return
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
50
|
+
return a.map((i) => {
|
|
51
|
+
const s = e.get(i.id);
|
|
52
|
+
if (!s)
|
|
53
53
|
throw new n(
|
|
54
54
|
`Could not find a matching API response for media info with id: ${i.id}`
|
|
55
55
|
);
|
|
56
|
-
return R(i,
|
|
56
|
+
return R(i, s);
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
class S {
|
|
@@ -65,8 +65,8 @@ class S {
|
|
|
65
65
|
#n;
|
|
66
66
|
#o;
|
|
67
67
|
#r;
|
|
68
|
-
constructor(t, e, i,
|
|
69
|
-
this.#s = t, this.#t = e, this.#a = [], this.#i = /* @__PURE__ */ new Set(), this.#e =
|
|
68
|
+
constructor(t, e, i, s) {
|
|
69
|
+
this.#s = t, this.#t = e, this.#a = [], this.#i = /* @__PURE__ */ new Set(), this.#e = s, this.#n = i, this.#o = !1, this.#r = !1;
|
|
70
70
|
}
|
|
71
71
|
get failed() {
|
|
72
72
|
return this.#o;
|
|
@@ -114,8 +114,8 @@ class N {
|
|
|
114
114
|
#a;
|
|
115
115
|
#i;
|
|
116
116
|
#e;
|
|
117
|
-
constructor(t, e, i,
|
|
118
|
-
this.#s = t, this.#t = e, this.#i =
|
|
117
|
+
constructor(t, e, i, s) {
|
|
118
|
+
this.#s = t, this.#t = e, this.#i = s, this.#a = i, this.#e = !1;
|
|
119
119
|
}
|
|
120
120
|
get canComplete() {
|
|
121
121
|
return this.#e;
|
|
@@ -140,15 +140,15 @@ const L = {
|
|
|
140
140
|
concurrentUploads: 4,
|
|
141
141
|
retryLimit: 3
|
|
142
142
|
};
|
|
143
|
-
class
|
|
143
|
+
class z {
|
|
144
144
|
#s;
|
|
145
145
|
#t;
|
|
146
146
|
#a;
|
|
147
147
|
#i;
|
|
148
148
|
#e;
|
|
149
149
|
#n;
|
|
150
|
-
constructor(t, e, i = L,
|
|
151
|
-
this.#s = t, this.#t = e, this.#a = i.concurrentUploads, this.#i = i.retryLimit, this.#e = new
|
|
150
|
+
constructor(t, e, i = L, s) {
|
|
151
|
+
this.#s = t, this.#t = e, this.#a = i.concurrentUploads, this.#i = i.retryLimit, this.#e = new m(), this.#n = s;
|
|
152
152
|
}
|
|
153
153
|
#o(t) {
|
|
154
154
|
return t < this.#i;
|
|
@@ -163,11 +163,11 @@ class _ {
|
|
|
163
163
|
const i = e().finally(() => t.delete(i));
|
|
164
164
|
t.add(i), t.size >= this.#a && await Promise.race(t);
|
|
165
165
|
}
|
|
166
|
-
await Promise.all(t), await this.#
|
|
166
|
+
await Promise.all(t), await this.#f(), this.#t.completed();
|
|
167
167
|
}
|
|
168
168
|
async #l(t, e) {
|
|
169
169
|
return await fetch(t, {
|
|
170
|
-
method:
|
|
170
|
+
method: c.put,
|
|
171
171
|
body: e
|
|
172
172
|
});
|
|
173
173
|
}
|
|
@@ -178,33 +178,39 @@ class _ {
|
|
|
178
178
|
t.uploadURL,
|
|
179
179
|
t.blob
|
|
180
180
|
)).ok)
|
|
181
|
-
throw new
|
|
182
|
-
|
|
183
|
-
);
|
|
181
|
+
throw new l(p.singlepartUploadFailed, {
|
|
182
|
+
mediaID: t.id
|
|
183
|
+
});
|
|
184
184
|
t.allowComplete(), await this.#h(t);
|
|
185
185
|
} catch (i) {
|
|
186
|
-
const a = l(i);
|
|
187
186
|
this.#o(e) ? (this.#t.uploadRetrying(t.id), this.#r({
|
|
188
187
|
type: "singlepart-upload",
|
|
189
188
|
retryCount: e + 1,
|
|
190
189
|
singlepartObj: t
|
|
191
|
-
})) : this.#t.failed(t.id,
|
|
190
|
+
})) : this.#t.failed(t.id, i);
|
|
192
191
|
}
|
|
193
192
|
}
|
|
194
|
-
async #
|
|
193
|
+
async #p(t, e, i = 0) {
|
|
195
194
|
if (!(t.failed || t.contains(e.partNumber)))
|
|
196
195
|
try {
|
|
197
|
-
const
|
|
196
|
+
const s = await this.#l(
|
|
198
197
|
e.uploadURL,
|
|
199
198
|
t.blob.slice(e.startByte, e.endByte)
|
|
200
199
|
);
|
|
201
|
-
if (!
|
|
202
|
-
throw new
|
|
203
|
-
|
|
200
|
+
if (!s.ok)
|
|
201
|
+
throw new l(
|
|
202
|
+
p.multipartPartUploadFailed,
|
|
203
|
+
{
|
|
204
|
+
mediaID: t.id,
|
|
205
|
+
partNumber: e.partNumber
|
|
206
|
+
}
|
|
204
207
|
);
|
|
205
|
-
const o =
|
|
208
|
+
const o = s.headers.get("ETag");
|
|
206
209
|
if (!o)
|
|
207
|
-
throw new
|
|
210
|
+
throw new l(p.missingETagValue, {
|
|
211
|
+
mediaID: t.id,
|
|
212
|
+
partNumber: e.partNumber
|
|
213
|
+
});
|
|
208
214
|
if (t.add({
|
|
209
215
|
partNumber: e.partNumber,
|
|
210
216
|
etag: o
|
|
@@ -214,8 +220,7 @@ class _ {
|
|
|
214
220
|
t.totalPartsCount
|
|
215
221
|
), !t.canComplete) return;
|
|
216
222
|
await this.#u(t);
|
|
217
|
-
} catch (
|
|
218
|
-
const o = l(a);
|
|
223
|
+
} catch (s) {
|
|
219
224
|
this.#o(i) ? (this.#t.multipartPartUploadRetrying(
|
|
220
225
|
t.id,
|
|
221
226
|
e.partNumber
|
|
@@ -224,52 +229,49 @@ class _ {
|
|
|
224
229
|
retryCount: i + 1,
|
|
225
230
|
multipartObj: t,
|
|
226
231
|
partInfo: e
|
|
227
|
-
})) : (t.fail(), this.#t.failed(t.id,
|
|
232
|
+
})) : (t.fail(), this.#t.failed(t.id, s));
|
|
228
233
|
}
|
|
229
234
|
}
|
|
230
|
-
async #
|
|
231
|
-
let i,
|
|
235
|
+
async #c(t, e) {
|
|
236
|
+
let i, s;
|
|
232
237
|
e && (i = JSON.stringify({
|
|
233
238
|
partsInfo: e
|
|
234
|
-
}),
|
|
235
|
-
[
|
|
236
|
-
}), this.#n && (
|
|
239
|
+
}), s = {
|
|
240
|
+
[d.contentType.key]: d.contentType.valueApplicationJSON
|
|
241
|
+
}), this.#n && (s = s || {}, s[d.userLocale.key] = this.#n);
|
|
237
242
|
const o = await fetch(t, {
|
|
238
|
-
method:
|
|
243
|
+
method: c.post,
|
|
239
244
|
body: i,
|
|
240
|
-
headers:
|
|
241
|
-
credentials: f
|
|
245
|
+
headers: s,
|
|
246
|
+
credentials: f.include
|
|
242
247
|
});
|
|
243
|
-
await
|
|
248
|
+
await y(o);
|
|
244
249
|
}
|
|
245
250
|
async #h(t, e = 0) {
|
|
246
251
|
if (t.canComplete)
|
|
247
252
|
try {
|
|
248
|
-
await this.#
|
|
253
|
+
await this.#c(t.completeURL), this.#t.itemUploaded(t.id);
|
|
249
254
|
} catch (i) {
|
|
250
|
-
const a = l(i);
|
|
251
255
|
this.#o(e) ? (this.#t.uploadRetrying(t.id), this.#r({
|
|
252
256
|
type: "singlepart-complete",
|
|
253
257
|
retryCount: e + 1,
|
|
254
258
|
singlepartObj: t
|
|
255
|
-
})) : this.#t.failed(t.id,
|
|
259
|
+
})) : this.#t.failed(t.id, i);
|
|
256
260
|
}
|
|
257
261
|
}
|
|
258
262
|
async #u(t, e = 0) {
|
|
259
263
|
if (t.tryStartComplete())
|
|
260
264
|
try {
|
|
261
|
-
await this.#
|
|
265
|
+
await this.#c(
|
|
262
266
|
t.completeURL,
|
|
263
267
|
t.list
|
|
264
268
|
), this.#t.itemUploaded(t.id);
|
|
265
269
|
} catch (i) {
|
|
266
|
-
t.resetComplete()
|
|
267
|
-
const a = l(i);
|
|
268
|
-
this.#o(e) ? (this.#t.uploadRetrying(t.id), this.#r({
|
|
270
|
+
t.resetComplete(), this.#o(e) ? (this.#t.uploadRetrying(t.id), this.#r({
|
|
269
271
|
type: "multipart-complete",
|
|
270
272
|
retryCount: e + 1,
|
|
271
273
|
multipartObj: t
|
|
272
|
-
})) : (t.fail(), this.#t.failed(t.id,
|
|
274
|
+
})) : (t.fail(), this.#t.failed(t.id, i));
|
|
273
275
|
}
|
|
274
276
|
}
|
|
275
277
|
async *#m() {
|
|
@@ -292,22 +294,22 @@ class _ {
|
|
|
292
294
|
t.multipartSuccessCallback,
|
|
293
295
|
t.multipartPresignPart.length
|
|
294
296
|
);
|
|
295
|
-
let i = 0,
|
|
297
|
+
let i = 0, s = 0;
|
|
296
298
|
for (const o of t.multipartPresignPart) {
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
+
s += o.partSize;
|
|
300
|
+
const h = {
|
|
299
301
|
partNumber: o.partNumber,
|
|
300
302
|
uploadURL: o.presignPut,
|
|
301
303
|
startByte: i,
|
|
302
|
-
endByte:
|
|
304
|
+
endByte: s
|
|
303
305
|
};
|
|
304
306
|
yield async () => {
|
|
305
|
-
await this.#
|
|
306
|
-
}, i =
|
|
307
|
+
await this.#p(e, h);
|
|
308
|
+
}, i = s;
|
|
307
309
|
}
|
|
308
310
|
}
|
|
309
311
|
}
|
|
310
|
-
#
|
|
312
|
+
#y(t) {
|
|
311
313
|
switch (t.type) {
|
|
312
314
|
case "singlepart-upload":
|
|
313
315
|
return this.#d(
|
|
@@ -320,7 +322,7 @@ class _ {
|
|
|
320
322
|
t.retryCount
|
|
321
323
|
);
|
|
322
324
|
case "multipart-part-upload":
|
|
323
|
-
return this.#
|
|
325
|
+
return this.#p(
|
|
324
326
|
t.multipartObj,
|
|
325
327
|
t.partInfo,
|
|
326
328
|
t.retryCount
|
|
@@ -337,12 +339,12 @@ class _ {
|
|
|
337
339
|
);
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
|
-
async #
|
|
342
|
+
async #f() {
|
|
341
343
|
const t = /* @__PURE__ */ new Set();
|
|
342
344
|
for (; !this.#e.isEmpty(); ) {
|
|
343
345
|
for (; !this.#e.isEmpty(); ) {
|
|
344
346
|
const e = this.#e.dequeue();
|
|
345
|
-
let i = this.#
|
|
347
|
+
let i = this.#y(e).finally(
|
|
346
348
|
() => t.delete(i)
|
|
347
349
|
);
|
|
348
350
|
t.add(i), t.size >= this.#a && await Promise.race(t);
|
|
@@ -351,19 +353,19 @@ class _ {
|
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
355
|
}
|
|
354
|
-
const
|
|
355
|
-
await D([
|
|
356
|
-
}, D = async (
|
|
357
|
-
await new
|
|
356
|
+
const x = async (a, t, e, i) => {
|
|
357
|
+
await D([a], t, e, i);
|
|
358
|
+
}, D = async (a, t, e, i) => {
|
|
359
|
+
await new z(a, t, e, i).init();
|
|
358
360
|
};
|
|
359
361
|
export {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
I as U,
|
|
363
|
+
k as a,
|
|
362
364
|
R as b,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
+
$ as c,
|
|
366
|
+
q as d,
|
|
365
367
|
D as e,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
368
|
+
C as n,
|
|
369
|
+
P as t,
|
|
370
|
+
x as u
|
|
369
371
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const httpRequestCredentials: Record<string, RequestCredentials>;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export declare const httpReqHeaders: {
|
|
2
|
+
readonly contentType: {
|
|
3
|
+
readonly key: "Content-Type";
|
|
4
|
+
readonly valueApplicationJSON: "application/json";
|
|
5
|
+
};
|
|
6
|
+
readonly authorization: {
|
|
7
|
+
readonly key: "Authorization";
|
|
8
|
+
readonly schemeBearer: "Bearer";
|
|
9
|
+
readonly schemeBasic: "Basic";
|
|
10
|
+
};
|
|
11
|
+
readonly userLocale: {
|
|
12
|
+
readonly key: "x-user-locale";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './http_methods';
|
|
2
2
|
export * from './httpRequestHeaders';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './httpRequestCredentials';
|
package/dist/constants/index.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
|
+
get: "GET",
|
|
3
|
+
post: "POST",
|
|
4
|
+
put: "PUT",
|
|
5
|
+
patch: "PATCH",
|
|
6
|
+
delete: "DELETE"
|
|
7
|
+
}, t = {
|
|
8
|
+
contentType: {
|
|
9
|
+
key: "Content-Type",
|
|
10
|
+
valueApplicationJSON: "application/json"
|
|
11
|
+
},
|
|
12
|
+
authorization: {
|
|
13
|
+
key: "Authorization",
|
|
14
|
+
schemeBearer: "Bearer",
|
|
15
|
+
schemeBasic: "Basic"
|
|
16
|
+
},
|
|
17
|
+
userLocale: {
|
|
18
|
+
key: "x-user-locale"
|
|
19
|
+
}
|
|
20
|
+
}, o = {
|
|
21
|
+
include: "include",
|
|
22
|
+
sameOrigin: "same-origin",
|
|
23
|
+
omit: "omit"
|
|
24
|
+
};
|
|
2
25
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
o as
|
|
6
|
-
R as HTTP_HEADER_AUTHORIZATION_BASIC_SCHEME,
|
|
7
|
-
t as HTTP_HEADER_AUTHORIZATION_BEARER_SCHEME,
|
|
8
|
-
P as HTTP_HEADER_CONTENT_TYPE,
|
|
9
|
-
n as HTTP_HEADER_CONTENT_TYPE_APPLICATION_JSON,
|
|
10
|
-
c as HTTP_HEADER_USER_LOCALE,
|
|
11
|
-
H as HTTP_PATCH,
|
|
12
|
-
E as HTTP_POST,
|
|
13
|
-
_ as HTTP_PUT,
|
|
14
|
-
s as HTTP_REQUEST_CREDENTIALS_INCLUDE,
|
|
15
|
-
I as HTTP_REQUEST_CREDENTIALS_NONE,
|
|
16
|
-
N as HTTP_REQUEST_CREDENTIALS_SAME_ORIGIN
|
|
26
|
+
e as httpMethods,
|
|
27
|
+
t as httpReqHeaders,
|
|
28
|
+
o as httpRequestCredentials
|
|
17
29
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const authCodes: {
|
|
2
|
+
readonly invalidApiKey: "invalid-api-key";
|
|
3
|
+
readonly userNotFound: "user-not-found";
|
|
4
|
+
readonly jwtNotAcceptable: "jwt-not-acceptable";
|
|
5
|
+
readonly invalidSignedUrl: "invalid-signed-url";
|
|
6
|
+
readonly hashMismatch: "hash-mismatch";
|
|
7
|
+
readonly invalidAuthHeaderValue: "invalid-auth-header-value";
|
|
8
|
+
readonly unsupportedAuthScheme: "unsupported-auth-scheme";
|
|
9
|
+
readonly organizationStatusBad: "bad-org-status";
|
|
10
|
+
readonly userNotExistsInOrganizationManagement: "user-not-exists-in-organization-management";
|
|
11
|
+
readonly userNotExistInOrganization: "user-not-exists-in-organization";
|
|
12
|
+
readonly userDisabled: "user-disabled";
|
|
13
|
+
readonly tokenNotFound: "token-not-found";
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const commonCodes: {
|
|
2
|
+
readonly invalidId: "invalid-id";
|
|
3
|
+
readonly routeNotFound: "route-not-found";
|
|
4
|
+
readonly methodNotAllowed: "method-not-allowed";
|
|
5
|
+
readonly networkError: "network-error";
|
|
6
|
+
readonly unexpectedError: "unexpected-error";
|
|
7
|
+
readonly zodError: "zod-error";
|
|
8
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const formCodes: {
|
|
2
|
+
readonly formValidationFailed: "validation-failed";
|
|
3
|
+
};
|
|
4
|
+
export declare const formFieldTypes: {
|
|
5
|
+
readonly missing: "missing";
|
|
6
|
+
readonly overflow: "overflow";
|
|
7
|
+
readonly underflow: "underflow";
|
|
8
|
+
readonly length: "length";
|
|
9
|
+
readonly invalid: "invalid";
|
|
10
|
+
readonly unknown: "unknown";
|
|
11
|
+
};
|
|
12
|
+
export declare const formFieldInvalidTypeCauses: {
|
|
13
|
+
readonly invalidValue: "invalid-value";
|
|
14
|
+
readonly invalidEnumValue: "invalid-enum-value";
|
|
15
|
+
readonly requireHttps: "require-https";
|
|
16
|
+
readonly missingHost: "missing-host";
|
|
17
|
+
readonly containsPath: "contains-path";
|
|
18
|
+
readonly containsQuery: "contains-query";
|
|
19
|
+
readonly containsFragment: "contains-fragment";
|
|
20
|
+
readonly absoluteUrl: "absolute-url";
|
|
21
|
+
readonly nilID: "nil-id";
|
|
22
|
+
readonly invalidEmail: "invalid-email";
|
|
23
|
+
readonly missingMxRecords: "missing-mx-records";
|
|
24
|
+
readonly notDigit: "not-digit";
|
|
25
|
+
readonly notBase64UrlEncoded: "not-base64-url-encoded";
|
|
26
|
+
readonly invalidUrl: "invalid-url";
|
|
27
|
+
readonly nullValue: "null-value";
|
|
28
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
malformedResponseBody: "malformed-response-body",
|
|
3
|
+
malformedJsonFromServer: "malformed-json-from-server",
|
|
4
|
+
invalidResponseShape: "invalid-response-shape",
|
|
5
|
+
unknownServerError: "unknown-server-error",
|
|
6
|
+
internalServerError: "internal-server-error"
|
|
7
|
+
}, o = {
|
|
8
|
+
formValidationFailed: "validation-failed"
|
|
9
|
+
}, i = {
|
|
10
|
+
missing: "missing",
|
|
11
|
+
overflow: "overflow",
|
|
12
|
+
underflow: "underflow",
|
|
13
|
+
length: "length",
|
|
14
|
+
invalid: "invalid",
|
|
15
|
+
unknown: "unknown"
|
|
16
|
+
}, n = {
|
|
17
|
+
invalidValue: "invalid-value",
|
|
18
|
+
invalidEnumValue: "invalid-enum-value",
|
|
19
|
+
requireHttps: "require-https",
|
|
20
|
+
missingHost: "missing-host",
|
|
21
|
+
containsPath: "contains-path",
|
|
22
|
+
containsQuery: "contains-query",
|
|
23
|
+
containsFragment: "contains-fragment",
|
|
24
|
+
absoluteUrl: "absolute-url",
|
|
25
|
+
nilID: "nil-id",
|
|
26
|
+
invalidEmail: "invalid-email",
|
|
27
|
+
missingMxRecords: "missing-mx-records",
|
|
28
|
+
notDigit: "not-digit",
|
|
29
|
+
notBase64UrlEncoded: "not-base64-url-encoded",
|
|
30
|
+
invalidUrl: "invalid-url",
|
|
31
|
+
nullValue: "null-value"
|
|
32
|
+
}, a = {
|
|
33
|
+
invalidApiKey: "invalid-api-key",
|
|
34
|
+
userNotFound: "user-not-found",
|
|
35
|
+
jwtNotAcceptable: "jwt-not-acceptable",
|
|
36
|
+
invalidSignedUrl: "invalid-signed-url",
|
|
37
|
+
hashMismatch: "hash-mismatch",
|
|
38
|
+
invalidAuthHeaderValue: "invalid-auth-header-value",
|
|
39
|
+
unsupportedAuthScheme: "unsupported-auth-scheme",
|
|
40
|
+
organizationStatusBad: "bad-org-status",
|
|
41
|
+
userNotExistsInOrganizationManagement: "user-not-exists-in-organization-management",
|
|
42
|
+
userNotExistInOrganization: "user-not-exists-in-organization",
|
|
43
|
+
userDisabled: "user-disabled",
|
|
44
|
+
tokenNotFound: "token-not-found"
|
|
45
|
+
}, t = {
|
|
46
|
+
invalidRequestBody: "invalid-request-body",
|
|
47
|
+
unknownFieldInRequestBody: "unknown-field-in-request-body",
|
|
48
|
+
emptyRequestBody: "empty-request-body",
|
|
49
|
+
requestBodyTooLarge: "request-body-too-large"
|
|
50
|
+
}, r = {
|
|
51
|
+
invalidCursorValue: "invalid-cursor-value"
|
|
52
|
+
}, d = {
|
|
53
|
+
invalidId: "invalid-id",
|
|
54
|
+
routeNotFound: "route-not-found",
|
|
55
|
+
methodNotAllowed: "method-not-allowed",
|
|
56
|
+
networkError: "network-error",
|
|
57
|
+
unexpectedError: "unexpected-error",
|
|
58
|
+
zodError: "zod-error"
|
|
59
|
+
}, s = {
|
|
60
|
+
invalidMultipartNumber: "invalid-multipart-upload-part-number",
|
|
61
|
+
mediaObjectNotFound: "object-not-found",
|
|
62
|
+
mediaTooLarge: "media-too-large",
|
|
63
|
+
mediaItemsLimitExceeded: "media-items-limit-exceeded",
|
|
64
|
+
uploadAlreadyCompleted: "upload-already-completed",
|
|
65
|
+
unsupportedObjectUploaded: "unsupported-object-uploaded",
|
|
66
|
+
completeMultipartUploadCalledTooSoon: "complete-multipart-upload-called-too-soon",
|
|
67
|
+
singlepartUploadFailed: "singlepart-upload-failed",
|
|
68
|
+
multipartPartUploadFailed: "multipart-part-upload-failed",
|
|
69
|
+
missingETagValue: "missing-etag-value"
|
|
70
|
+
}, l = {
|
|
71
|
+
selfPermissionMismatch: "self-permission-mismatch",
|
|
72
|
+
invalidActor: "invalid-actor",
|
|
73
|
+
permissionExplicitlyDenied: "permission-explicitly-denied",
|
|
74
|
+
missingPermission: "missing-permission"
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
a as authCodes,
|
|
78
|
+
d as commonCodes,
|
|
79
|
+
o as formCodes,
|
|
80
|
+
n as formFieldInvalidTypeCauses,
|
|
81
|
+
i as formFieldTypes,
|
|
82
|
+
l as iamCodes,
|
|
83
|
+
s as mediaCodes,
|
|
84
|
+
r as paginationCodes,
|
|
85
|
+
t as requestBodyCodes,
|
|
86
|
+
e as serverCodes
|
|
87
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const mediaCodes: {
|
|
2
|
+
readonly invalidMultipartNumber: "invalid-multipart-upload-part-number";
|
|
3
|
+
readonly mediaObjectNotFound: "object-not-found";
|
|
4
|
+
readonly mediaTooLarge: "media-too-large";
|
|
5
|
+
readonly mediaItemsLimitExceeded: "media-items-limit-exceeded";
|
|
6
|
+
readonly uploadAlreadyCompleted: "upload-already-completed";
|
|
7
|
+
readonly unsupportedObjectUploaded: "unsupported-object-uploaded";
|
|
8
|
+
readonly completeMultipartUploadCalledTooSoon: "complete-multipart-upload-called-too-soon";
|
|
9
|
+
readonly singlepartUploadFailed: "singlepart-upload-failed";
|
|
10
|
+
readonly multipartPartUploadFailed: "multipart-part-upload-failed";
|
|
11
|
+
readonly missingETagValue: "missing-etag-value";
|
|
12
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const requestBodyCodes: {
|
|
2
|
+
readonly invalidRequestBody: "invalid-request-body";
|
|
3
|
+
readonly unknownFieldInRequestBody: "unknown-field-in-request-body";
|
|
4
|
+
readonly emptyRequestBody: "empty-request-body";
|
|
5
|
+
readonly requestBodyTooLarge: "request-body-too-large";
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const serverCodes: {
|
|
2
|
+
readonly malformedResponseBody: "malformed-response-body";
|
|
3
|
+
readonly malformedJsonFromServer: "malformed-json-from-server";
|
|
4
|
+
readonly invalidResponseShape: "invalid-response-shape";
|
|
5
|
+
readonly unknownServerError: "unknown-server-error";
|
|
6
|
+
readonly internalServerError: "internal-server-error";
|
|
7
|
+
};
|