@adgytec/adgytec-web-utils 0.0.4 → 0.0.5
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 +3 -3
- package/dist/chunks/applicationError.map +1 -0
- package/dist/chunks/decode +21 -20
- package/dist/chunks/decode.map +1 -0
- package/dist/chunks/formParse +1 -0
- package/dist/chunks/formParse.map +1 -0
- package/dist/chunks/parse +5 -4
- package/dist/chunks/parse.map +1 -0
- package/dist/chunks/schema +219 -218
- package/dist/chunks/schema.map +1 -0
- package/dist/chunks/{upload → uploadDetails} +78 -77
- package/dist/chunks/uploadDetails.map +1 -0
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +7 -6
- package/dist/constants/index.js.map +1 -0
- package/dist/errorCodes/index.d.ts +5 -5
- package/dist/errorCodes/index.js +48 -47
- package/dist/errorCodes/index.js.map +1 -0
- package/dist/errorSchema/index.d.ts +6 -6
- package/dist/errorSchema/index.js +1 -0
- package/dist/errorSchema/index.js.map +1 -0
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/parse.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/dist/media/index.d.ts +2 -2
- package/dist/media/index.js +2 -1
- package/dist/media/index.js.map +1 -0
- package/dist/media/mediaInfo.d.ts +1 -1
- package/dist/media/types/index.d.ts +3 -3
- package/dist/media/upload.d.ts +1 -1
- package/dist/response/index.js +1 -0
- package/dist/response/index.js.map +1 -0
- package/package.json +13 -6
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "zod";
|
|
2
1
|
import { g as a } from "./schema";
|
|
3
2
|
class o extends Error {
|
|
4
3
|
}
|
|
5
|
-
class
|
|
4
|
+
class c extends o {
|
|
6
5
|
#s;
|
|
7
6
|
#r;
|
|
8
7
|
constructor(r, s = {}) {
|
|
@@ -23,6 +22,7 @@ class n extends o {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
export {
|
|
26
|
-
|
|
25
|
+
c as A,
|
|
27
26
|
o as B
|
|
28
27
|
};
|
|
28
|
+
//# sourceMappingURL=applicationError.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applicationError","sources":["../../src/errors/baseError.ts","../../src/errors/applicationError.ts"],"sourcesContent":["export class BaseError extends Error {}\n","import type z from \"zod\";\nimport { type ErrorDetails, errorSchema } from \"../errorSchema\";\nimport { BaseError } from \"./baseError\";\n\nexport class ApplicationError extends BaseError {\n #code: string;\n #details: unknown;\n\n constructor(code: string, details: object = {}) {\n super(\"application-error\");\n\n this.#code = code;\n this.#details = {\n ...details,\n code,\n };\n }\n\n get details() {\n return this.#details;\n }\n\n get code() {\n return this.#code;\n }\n\n parse(): ErrorDetails | z.ZodError {\n const { success, error, data } = errorSchema.safeParse(this.#details);\n if (!success) {\n return error;\n }\n return data;\n }\n}\n"],"names":["BaseError","ApplicationError","#code","#details","code","details","success","error","data","errorSchema"],"mappings":";AAAO,MAAMA,UAAkB,MAAM;AAAC;ACI/B,MAAMC,UAAyBD,EAAU;AAAA,EAC5CE;AAAA,EACAC;AAAA,EAEA,YAAYC,GAAcC,IAAkB,IAAI;AAC5C,UAAM,mBAAmB,GAEzB,KAAKH,KAAQE,GACb,KAAKD,KAAW;AAAA,MACZ,GAAGE;AAAA,MACH,MAAAD;AAAA,IAAA;AAAA,EAER;AAAA,EAEA,IAAI,UAAU;AACV,WAAO,KAAKD;AAAA,EAChB;AAAA,EAEA,IAAI,OAAO;AACP,WAAO,KAAKD;AAAA,EAChB;AAAA,EAEA,QAAmC;AAC/B,UAAM,EAAE,SAAAI,GAAS,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAY,UAAU,KAAKN,EAAQ;AACpE,WAAKG,IAGEE,IAFID;AAAA,EAGf;AACJ;"}
|
package/dist/chunks/decode
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { serverCodes as n } from "../errorCodes/index.js";
|
|
2
2
|
import { A as s } from "./applicationError";
|
|
3
|
-
import
|
|
3
|
+
import a from "zod";
|
|
4
|
+
const i = a.object({
|
|
5
|
+
code: a.string()
|
|
6
|
+
}).loose();
|
|
4
7
|
function c(e, o) {
|
|
8
|
+
const r = i.safeParse(o);
|
|
9
|
+
throw r.success ? new s(r.data.code, r.data) : e >= 500 ? new s(n.internalServerError) : new s(n.unknownServerError, {
|
|
10
|
+
payload: o
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function p(e, o) {
|
|
5
14
|
if (!e)
|
|
6
|
-
throw new s(
|
|
15
|
+
throw new s(n.invalidResponseShape, {
|
|
7
16
|
message: "Expected response body but received empty response",
|
|
8
17
|
payload: e
|
|
9
18
|
});
|
|
10
19
|
const r = o.safeParse(e);
|
|
11
20
|
if (r.success) return r.data;
|
|
12
|
-
throw new s(
|
|
21
|
+
throw new s(n.invalidResponseShape, {
|
|
13
22
|
message: r.error.message,
|
|
14
23
|
payload: e
|
|
15
24
|
});
|
|
16
25
|
}
|
|
17
|
-
|
|
18
|
-
code: a.string()
|
|
19
|
-
}).loose();
|
|
20
|
-
function p(e, o) {
|
|
21
|
-
const r = i.safeParse(o);
|
|
22
|
-
throw r.success ? new s(r.data.code, r.data) : e >= 500 ? new s(t.internalServerError) : new s(t.unknownServerError, {
|
|
23
|
-
payload: o
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async function u(e, o) {
|
|
26
|
+
async function d(e, o) {
|
|
27
27
|
if (!o && e.ok)
|
|
28
28
|
return null;
|
|
29
29
|
let r;
|
|
30
30
|
try {
|
|
31
31
|
r = await e.text();
|
|
32
32
|
} catch {
|
|
33
|
-
throw new s(
|
|
33
|
+
throw new s(n.malformedResponseBody, {
|
|
34
34
|
response: e
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
let
|
|
37
|
+
let t;
|
|
38
38
|
if (r.length > 0)
|
|
39
39
|
try {
|
|
40
|
-
|
|
40
|
+
t = JSON.parse(r);
|
|
41
41
|
} catch {
|
|
42
|
-
throw new s(
|
|
42
|
+
throw new s(n.malformedJsonFromServer, {
|
|
43
43
|
response: e
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
return e.ok ?
|
|
46
|
+
return e.ok ? o ? p(t, o) : null : c(e.status, t);
|
|
47
47
|
}
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
d
|
|
50
50
|
};
|
|
51
|
+
//# sourceMappingURL=decode.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode","sources":["../../src/response/errorResponse.ts","../../src/response/successReponse.ts","../../src/response/decode.ts"],"sourcesContent":["import z from \"zod\";\nimport { serverCodes } from \"../errorCodes\";\nimport { ApplicationError } from \"../errors\";\n\nconst serverErrorSchema = z\n .object({\n code: z.string(),\n })\n .loose();\n\nexport function parseErrorResponse(status: number, payload: unknown): never {\n const result = serverErrorSchema.safeParse(payload);\n if (result.success) {\n throw new ApplicationError(result.data.code, result.data);\n }\n\n if (status >= 500) {\n throw new ApplicationError(serverCodes.internalServerError);\n }\n\n throw new ApplicationError(serverCodes.unknownServerError, {\n payload,\n });\n}\n","import type z from \"zod\";\nimport { serverCodes } from \"../errorCodes\";\nimport { ApplicationError } from \"../errors\";\n\nexport function parseSuccessReponse<T>(\n payload: unknown,\n schema: z.ZodSchema<T>\n): T {\n if (!payload) {\n throw new ApplicationError(serverCodes.invalidResponseShape, {\n message: \"Expected response body but received empty response\",\n payload: payload,\n });\n }\n\n const parsed = schema.safeParse(payload);\n if (parsed.success) return parsed.data;\n\n throw new ApplicationError(serverCodes.invalidResponseShape, {\n message: parsed.error.message,\n payload: payload,\n });\n}\n","import type z from \"zod\";\nimport { serverCodes } from \"../errorCodes\";\nimport { ApplicationError } from \"../errors\";\nimport { parseErrorResponse } from \"./errorResponse\";\nimport { parseSuccessReponse } from \"./successReponse\";\n\n// overloaded functions\nexport function decodeAPIResponse<T>(\n res: Response,\n schema: z.ZodSchema<T>\n): Promise<T>;\n\nexport function decodeAPIResponse(res: Response): Promise<null>;\n\nexport async function decodeAPIResponse<T>(\n res: Response,\n schema?: z.ZodSchema<T>\n): Promise<T | null> {\n // no need to handle response body\n // caller expects no response\n if (!schema && res.ok) {\n return null;\n }\n\n let raw: string;\n try {\n raw = await res.text();\n } catch {\n throw new ApplicationError(serverCodes.malformedResponseBody, {\n response: res,\n });\n }\n\n let payload: unknown;\n if (raw.length > 0) {\n try {\n payload = JSON.parse(raw);\n } catch {\n throw new ApplicationError(serverCodes.malformedJsonFromServer, {\n response: res,\n });\n }\n }\n\n if (res.ok) {\n if (schema) return parseSuccessReponse(payload, schema);\n return null;\n }\n\n return parseErrorResponse(res.status, payload);\n}\n"],"names":["serverErrorSchema","z","parseErrorResponse","status","payload","result","ApplicationError","serverCodes","parseSuccessReponse","schema","parsed","decodeAPIResponse","res","raw"],"mappings":";;;AAIA,MAAMA,IAAoBC,EACrB,OAAO;AAAA,EACJ,MAAMA,EAAE,OAAA;AACZ,CAAC,EACA,MAAA;AAEE,SAASC,EAAmBC,GAAgBC,GAAyB;AACxE,QAAMC,IAASL,EAAkB,UAAUI,CAAO;AAClD,QAAIC,EAAO,UACD,IAAIC,EAAiBD,EAAO,KAAK,MAAMA,EAAO,IAAI,IAGxDF,KAAU,MACJ,IAAIG,EAAiBC,EAAY,mBAAmB,IAGxD,IAAID,EAAiBC,EAAY,oBAAoB;AAAA,IACvD,SAAAH;AAAA,EAAA,CACH;AACL;ACnBO,SAASI,EACZJ,GACAK,GACC;AACD,MAAI,CAACL;AACD,UAAM,IAAIE,EAAiBC,EAAY,sBAAsB;AAAA,MACzD,SAAS;AAAA,MACT,SAAAH;AAAA,IAAA,CACH;AAGL,QAAMM,IAASD,EAAO,UAAUL,CAAO;AACvC,MAAIM,EAAO,QAAS,QAAOA,EAAO;AAElC,QAAM,IAAIJ,EAAiBC,EAAY,sBAAsB;AAAA,IACzD,SAASG,EAAO,MAAM;AAAA,IACtB,SAAAN;AAAA,EAAA,CACH;AACL;ACRA,eAAsBO,EAClBC,GACAH,GACiB;AAGjB,MAAI,CAACA,KAAUG,EAAI;AACf,WAAO;AAGX,MAAIC;AACJ,MAAI;AACA,IAAAA,IAAM,MAAMD,EAAI,KAAA;AAAA,EACpB,QAAQ;AACJ,UAAM,IAAIN,EAAiBC,EAAY,uBAAuB;AAAA,MAC1D,UAAUK;AAAA,IAAA,CACb;AAAA,EACL;AAEA,MAAIR;AACJ,MAAIS,EAAI,SAAS;AACb,QAAI;AACA,MAAAT,IAAU,KAAK,MAAMS,CAAG;AAAA,IAC5B,QAAQ;AACJ,YAAM,IAAIP,EAAiBC,EAAY,yBAAyB;AAAA,QAC5D,UAAUK;AAAA,MAAA,CACb;AAAA,IACL;AAGJ,SAAIA,EAAI,KACAH,IAAeD,EAAoBJ,GAASK,CAAM,IAC/C,OAGJP,EAAmBU,EAAI,QAAQR,CAAO;AACjD;"}
|
package/dist/chunks/formParse
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formParse","sources":["../../src/errorSchema/formParse.ts"],"sourcesContent":["import type { FieldNode } from \"./form\";\nimport type { FormFieldError } from \"./formField\";\n\nexport type FlattenedErrors = Record<string, FormFieldError[]>;\n\nexport function flattenFieldNodes(\n nodes: FieldNode[],\n parentKey = \"\"\n): FlattenedErrors {\n const result: FlattenedErrors = {};\n\n for (const node of nodes) {\n const currentKey = parentKey ? `${parentKey}.${node.key}` : node.key;\n\n if (\"errors\" in node) {\n result[currentKey] = node.errors;\n } else {\n Object.assign(result, flattenFieldNodes(node.children, currentKey));\n }\n }\n\n return result;\n}\n"],"names":["flattenFieldNodes","nodes","parentKey","result","node","currentKey"],"mappings":"AAKO,SAASA,EACZC,GACAC,IAAY,IACG;AACf,QAAMC,IAA0B,CAAA;AAEhC,aAAWC,KAAQH,GAAO;AACtB,UAAMI,IAAaH,IAAY,GAAGA,CAAS,IAAIE,EAAK,GAAG,KAAKA,EAAK;AAEjE,IAAI,YAAYA,IACZD,EAAOE,CAAU,IAAID,EAAK,SAE1B,OAAO,OAAOD,GAAQH,EAAkBI,EAAK,UAAUC,CAAU,CAAC;AAAA,EAE1E;AAEA,SAAOF;AACX;"}
|
package/dist/chunks/parse
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import e from "is-network-error";
|
|
2
|
+
import n from "zod";
|
|
2
3
|
import { commonCodes as t } from "../errorCodes/index.js";
|
|
3
|
-
import { A as
|
|
4
|
-
import i from "zod";
|
|
4
|
+
import { A as i } from "./applicationError";
|
|
5
5
|
function p(r) {
|
|
6
6
|
if (e(r))
|
|
7
7
|
return {
|
|
8
8
|
code: t.networkError,
|
|
9
9
|
debugMessage: r.toString()
|
|
10
10
|
};
|
|
11
|
-
if (r instanceof
|
|
11
|
+
if (r instanceof i) {
|
|
12
12
|
const o = r.parse();
|
|
13
|
-
return o instanceof
|
|
13
|
+
return o instanceof n.ZodError ? {
|
|
14
14
|
code: t.zodError,
|
|
15
15
|
error: o
|
|
16
16
|
} : o;
|
|
@@ -23,3 +23,4 @@ function p(r) {
|
|
|
23
23
|
export {
|
|
24
24
|
p
|
|
25
25
|
};
|
|
26
|
+
//# sourceMappingURL=parse.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse","sources":["../../src/errors/parse.ts"],"sourcesContent":["import isNetworkError from \"is-network-error\";\nimport z from \"zod\";\nimport { commonCodes } from \"../errorCodes\";\nimport type { ErrorDetails } from \"../errorSchema\";\nimport { ApplicationError } from \"./applicationError\";\n\ntype ParseErrorResponse =\n | {\n code: typeof commonCodes.networkError;\n debugMessage: string;\n }\n | {\n code: typeof commonCodes.unexpectedError;\n debugMessage: string;\n }\n | {\n code: typeof commonCodes.zodError;\n error: z.ZodError;\n }\n | ErrorDetails;\n\nexport function parseError(err: unknown): ParseErrorResponse {\n if (isNetworkError(err)) {\n return {\n code: commonCodes.networkError,\n debugMessage: err.toString(),\n };\n }\n\n if (err instanceof ApplicationError) {\n const errVal = err.parse();\n if (errVal instanceof z.ZodError) {\n return {\n code: commonCodes.zodError,\n error: errVal,\n };\n }\n return errVal;\n }\n\n return {\n code: commonCodes.unexpectedError,\n debugMessage: err instanceof Error ? err.toString() : String(err),\n };\n}\n"],"names":["parseError","err","isNetworkError","commonCodes","ApplicationError","errVal","z"],"mappings":";;;;AAqBO,SAASA,EAAWC,GAAkC;AACzD,MAAIC,EAAeD,CAAG;AAClB,WAAO;AAAA,MACH,MAAME,EAAY;AAAA,MAClB,cAAcF,EAAI,SAAA;AAAA,IAAS;AAInC,MAAIA,aAAeG,GAAkB;AACjC,UAAMC,IAASJ,EAAI,MAAA;AACnB,WAAII,aAAkBC,EAAE,WACb;AAAA,MACH,MAAMH,EAAY;AAAA,MAClB,OAAOE;AAAA,IAAA,IAGRA;AAAA,EACX;AAEA,SAAO;AAAA,IACH,MAAMF,EAAY;AAAA,IAClB,cAAcF,aAAe,QAAQA,EAAI,SAAA,IAAa,OAAOA,CAAG;AAAA,EAAA;AAExE;"}
|
package/dist/chunks/schema
CHANGED
|
@@ -1,238 +1,244 @@
|
|
|
1
1
|
import e from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { authCodes as o, commonCodes as d, formFieldInvalidTypeCauses as a, formFieldTypes as r, formCodes as b, iamCodes as n, mediaCodes as t, paginationCodes as h, requestBodyCodes as l, serverCodes as c } from "../errorCodes/index.js";
|
|
3
3
|
const S = e.object({
|
|
4
|
-
code: e.literal(
|
|
5
|
-
response: e.instanceof(Response)
|
|
4
|
+
code: e.literal(o.invalidApiKey)
|
|
6
5
|
}), p = e.object({
|
|
7
|
-
code: e.literal(
|
|
8
|
-
response: e.instanceof(Response)
|
|
6
|
+
code: e.literal(o.userNotFound)
|
|
9
7
|
}), j = e.object({
|
|
10
|
-
code: e.literal(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}).transform(({ code: s, message: i, payload: u }) => ({
|
|
14
|
-
code: s,
|
|
15
|
-
debugMessage: i,
|
|
16
|
-
payload: u
|
|
17
|
-
})), g = e.object({
|
|
18
|
-
code: e.literal(c.unknownServerError),
|
|
19
|
-
payload: e.unknown()
|
|
8
|
+
code: e.literal(o.jwtNotAcceptable)
|
|
9
|
+
}), g = e.object({
|
|
10
|
+
code: e.literal(o.invalidSignedUrl)
|
|
20
11
|
}), v = e.object({
|
|
21
|
-
code: e.literal(
|
|
12
|
+
code: e.literal(o.hashMismatch)
|
|
22
13
|
}), y = e.object({
|
|
23
|
-
|
|
14
|
+
code: e.literal(o.invalidAuthHeaderValue)
|
|
24
15
|
}), E = e.object({
|
|
16
|
+
code: e.literal(o.unsupportedAuthScheme)
|
|
17
|
+
}), f = e.object({
|
|
18
|
+
code: e.literal(o.organizationStatusBad)
|
|
19
|
+
}), F = e.object({
|
|
20
|
+
code: e.literal(o.userNotExistsInOrganizationManagement)
|
|
21
|
+
}), U = e.object({
|
|
22
|
+
code: e.literal(o.userNotExistInOrganization)
|
|
23
|
+
}), N = e.object({
|
|
24
|
+
code: e.literal(o.userDisabled)
|
|
25
|
+
}), I = e.object({
|
|
26
|
+
code: e.literal(o.tokenNotFound)
|
|
27
|
+
}), M = e.object({
|
|
28
|
+
code: e.literal(d.invalidId)
|
|
29
|
+
}), w = e.object({
|
|
30
|
+
code: e.literal(d.routeNotFound)
|
|
31
|
+
}), A = e.object({
|
|
32
|
+
code: e.literal(d.methodNotAllowed)
|
|
33
|
+
}), V = e.object({
|
|
34
|
+
cause: e.literal(a.invalidValue)
|
|
35
|
+
}), x = e.object({
|
|
25
36
|
cause: e.literal(a.invalidEnumValue),
|
|
26
37
|
possibleValues: e.array(e.string())
|
|
27
|
-
}),
|
|
38
|
+
}), B = e.object({
|
|
28
39
|
cause: e.literal(a.requireHttps)
|
|
29
|
-
}),
|
|
40
|
+
}), C = e.object({
|
|
30
41
|
cause: e.literal(a.missingHost)
|
|
31
|
-
}),
|
|
42
|
+
}), D = e.object({
|
|
32
43
|
cause: e.literal(a.containsPath)
|
|
33
|
-
}),
|
|
44
|
+
}), R = e.object({
|
|
34
45
|
cause: e.literal(a.containsQuery)
|
|
35
|
-
}),
|
|
46
|
+
}), k = e.object({
|
|
36
47
|
cause: e.literal(a.containsFragment)
|
|
37
|
-
}),
|
|
48
|
+
}), q = e.object({
|
|
38
49
|
cause: e.literal(a.absoluteUrl)
|
|
39
|
-
}),
|
|
50
|
+
}), z = e.object({
|
|
40
51
|
cause: e.literal(a.nilID)
|
|
41
|
-
}),
|
|
52
|
+
}), O = e.object({
|
|
42
53
|
cause: e.literal(a.invalidEmail)
|
|
43
|
-
}),
|
|
54
|
+
}), P = e.object({
|
|
44
55
|
cause: e.literal(a.missingMxRecords)
|
|
45
|
-
}),
|
|
56
|
+
}), T = e.object({
|
|
46
57
|
cause: e.literal(a.notDigit)
|
|
47
|
-
}),
|
|
58
|
+
}), L = e.object({
|
|
48
59
|
cause: e.literal(a.notBase64UrlEncoded)
|
|
49
|
-
}),
|
|
60
|
+
}), H = e.object({
|
|
50
61
|
cause: e.literal(a.invalidUrl)
|
|
51
|
-
}),
|
|
62
|
+
}), J = e.object({
|
|
52
63
|
cause: e.literal(a.nullValue)
|
|
53
|
-
}),
|
|
64
|
+
}), K = e.discriminatedUnion(
|
|
54
65
|
"cause",
|
|
55
66
|
[
|
|
56
|
-
y,
|
|
57
|
-
E,
|
|
58
|
-
f,
|
|
59
|
-
F,
|
|
60
|
-
U,
|
|
61
|
-
N,
|
|
62
|
-
I,
|
|
63
|
-
M,
|
|
64
|
-
w,
|
|
65
|
-
A,
|
|
66
67
|
V,
|
|
67
68
|
x,
|
|
68
69
|
B,
|
|
69
70
|
C,
|
|
70
|
-
D
|
|
71
|
+
D,
|
|
72
|
+
R,
|
|
73
|
+
k,
|
|
74
|
+
q,
|
|
75
|
+
z,
|
|
76
|
+
O,
|
|
77
|
+
P,
|
|
78
|
+
T,
|
|
79
|
+
L,
|
|
80
|
+
H,
|
|
81
|
+
J
|
|
71
82
|
]
|
|
72
|
-
),
|
|
83
|
+
), Q = e.object({
|
|
73
84
|
type: e.literal(r.unknown)
|
|
74
|
-
}),
|
|
85
|
+
}), G = e.object({
|
|
75
86
|
type: e.literal(r.missing)
|
|
76
|
-
}),
|
|
87
|
+
}), W = e.object({
|
|
77
88
|
type: e.literal(r.overflow),
|
|
78
89
|
details: e.object({
|
|
79
90
|
max: e.union([e.coerce.date(), e.number()])
|
|
80
91
|
})
|
|
81
|
-
}),
|
|
92
|
+
}), X = e.object({
|
|
82
93
|
type: e.literal(r.underflow),
|
|
83
94
|
details: e.object({
|
|
84
95
|
min: e.union([e.coerce.date(), e.number()])
|
|
85
96
|
})
|
|
86
|
-
}),
|
|
97
|
+
}), Y = e.object({
|
|
87
98
|
type: e.literal(r.length),
|
|
88
99
|
details: e.object({
|
|
89
100
|
min: e.number(),
|
|
90
101
|
max: e.number()
|
|
91
102
|
})
|
|
92
|
-
}),
|
|
103
|
+
}), Z = e.object({
|
|
93
104
|
type: e.literal(r.invalid),
|
|
94
|
-
details:
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
details: K
|
|
106
|
+
}), _ = e.discriminatedUnion("type", [
|
|
107
|
+
Q,
|
|
108
|
+
G,
|
|
109
|
+
W,
|
|
110
|
+
X,
|
|
111
|
+
Y,
|
|
112
|
+
Z
|
|
102
113
|
]), m = e.lazy(
|
|
103
114
|
() => e.union([
|
|
104
115
|
e.object({
|
|
105
116
|
key: e.string(),
|
|
106
|
-
errors: e.array(
|
|
117
|
+
errors: e.array(_)
|
|
107
118
|
}),
|
|
108
119
|
e.object({
|
|
109
120
|
key: e.string(),
|
|
110
121
|
children: e.array(m)
|
|
111
122
|
})
|
|
112
123
|
])
|
|
113
|
-
),
|
|
124
|
+
), $ = e.object({
|
|
114
125
|
code: e.literal(b.formValidationFailed),
|
|
115
126
|
details: e.array(m)
|
|
116
|
-
}), J = e.object({
|
|
117
|
-
code: e.literal(o.invalidApiKey)
|
|
118
|
-
}), K = e.object({
|
|
119
|
-
code: e.literal(o.userNotFound)
|
|
120
|
-
}), Q = e.object({
|
|
121
|
-
code: e.literal(o.jwtNotAcceptable)
|
|
122
|
-
}), G = e.object({
|
|
123
|
-
code: e.literal(o.invalidSignedUrl)
|
|
124
|
-
}), W = e.object({
|
|
125
|
-
code: e.literal(o.hashMismatch)
|
|
126
|
-
}), X = e.object({
|
|
127
|
-
code: e.literal(o.invalidAuthHeaderValue)
|
|
128
|
-
}), Y = e.object({
|
|
129
|
-
code: e.literal(o.unsupportedAuthScheme)
|
|
130
|
-
}), Z = e.object({
|
|
131
|
-
code: e.literal(o.organizationStatusBad)
|
|
132
|
-
}), _ = e.object({
|
|
133
|
-
code: e.literal(o.userNotExistsInOrganizationManagement)
|
|
134
|
-
}), $ = e.object({
|
|
135
|
-
code: e.literal(o.userNotExistInOrganization)
|
|
136
127
|
}), ee = e.object({
|
|
137
|
-
code: e.literal(
|
|
128
|
+
code: e.literal(n.selfPermissionMismatch),
|
|
129
|
+
permission: e.string(),
|
|
130
|
+
key: e.string(),
|
|
131
|
+
required: e.string(),
|
|
132
|
+
got: e.string()
|
|
138
133
|
}), ae = e.object({
|
|
139
|
-
code: e.literal(
|
|
134
|
+
code: e.literal(n.invalidActor),
|
|
135
|
+
supportedActors: e.array(e.string()),
|
|
136
|
+
currentActor: e.string()
|
|
140
137
|
}), oe = e.object({
|
|
141
|
-
code: e.literal(n.
|
|
142
|
-
|
|
143
|
-
})
|
|
144
|
-
code:
|
|
145
|
-
|
|
146
|
-
})
|
|
147
|
-
code: e.literal(n.unknownFieldInRequestBody),
|
|
148
|
-
message: e.string()
|
|
149
|
-
}).transform(({ code: s, message: i }) => ({
|
|
150
|
-
code: s,
|
|
151
|
-
debugMessage: i
|
|
152
|
-
})), se = e.object({
|
|
153
|
-
code: e.literal(n.requestBodyTooLarge),
|
|
154
|
-
limit: e.int()
|
|
155
|
-
}), ie = e.object({
|
|
156
|
-
code: e.literal(n.emptyRequestBody),
|
|
157
|
-
message: e.string()
|
|
158
|
-
}).transform(({ code: s, message: i }) => ({
|
|
159
|
-
code: s,
|
|
160
|
-
debugMessage: i
|
|
161
|
-
})), re = e.object({
|
|
162
|
-
code: e.literal(h.invalidCursorValue)
|
|
163
|
-
}), ce = e.object({
|
|
164
|
-
code: e.literal(d.invalidId)
|
|
165
|
-
}), ne = e.object({
|
|
166
|
-
code: e.literal(d.routeNotFound)
|
|
167
|
-
}), le = e.object({
|
|
168
|
-
code: e.literal(d.methodNotAllowed)
|
|
169
|
-
}), de = e.object({
|
|
138
|
+
code: e.literal(n.permissionExplicitlyDenied),
|
|
139
|
+
deniedPermission: e.string()
|
|
140
|
+
}), te = e.object({
|
|
141
|
+
code: e.literal(n.missingPermission),
|
|
142
|
+
missingPermission: e.string()
|
|
143
|
+
}), se = e.object({
|
|
170
144
|
code: e.literal(t.invalidMultipartNumber)
|
|
171
|
-
}),
|
|
145
|
+
}), ie = e.object({
|
|
172
146
|
code: e.literal(t.mediaObjectNotFound)
|
|
173
|
-
}),
|
|
147
|
+
}), re = e.object({
|
|
174
148
|
code: e.literal(t.mediaTooLarge),
|
|
175
149
|
mediaID: e.uuidv7(),
|
|
176
150
|
currentSize: e.int(),
|
|
177
151
|
maxSupportedSize: e.int()
|
|
178
|
-
}),
|
|
152
|
+
}), ce = e.object({
|
|
179
153
|
code: e.literal(t.mediaItemsLimitExceeded),
|
|
180
154
|
currentLength: e.int(),
|
|
181
155
|
maxItemsSupported: e.int()
|
|
182
|
-
}),
|
|
156
|
+
}), ne = e.object({
|
|
183
157
|
code: e.literal(t.uploadAlreadyCompleted)
|
|
184
|
-
}),
|
|
158
|
+
}), le = e.object({
|
|
185
159
|
code: e.literal(t.unsupportedObjectUploaded)
|
|
186
|
-
}),
|
|
160
|
+
}), de = e.object({
|
|
187
161
|
code: e.literal(t.completeMultipartUploadCalledTooSoon)
|
|
188
|
-
}),
|
|
162
|
+
}), me = e.object({
|
|
189
163
|
code: e.literal(t.singlepartUploadFailed),
|
|
190
164
|
mediaID: e.uuidv7()
|
|
191
|
-
}),
|
|
165
|
+
}), ue = e.object({
|
|
192
166
|
code: e.literal(t.multipartPartUploadFailed),
|
|
193
167
|
mediaID: e.uuidv7(),
|
|
194
168
|
partNumber: e.int()
|
|
195
|
-
}),
|
|
169
|
+
}), be = e.object({
|
|
196
170
|
code: e.literal(t.missingETagValue),
|
|
197
171
|
mediaID: e.uuidv7(),
|
|
198
172
|
partNumber: e.int()
|
|
173
|
+
}), he = e.object({
|
|
174
|
+
code: e.literal(h.invalidCursorValue)
|
|
175
|
+
}), Se = e.object({
|
|
176
|
+
code: e.literal(l.invalidRequestBody),
|
|
177
|
+
message: e.string()
|
|
178
|
+
}).transform(({ code: s, message: i }) => ({
|
|
179
|
+
code: s,
|
|
180
|
+
debugMessage: i
|
|
181
|
+
})), pe = e.object({
|
|
182
|
+
code: e.literal(l.unknownFieldInRequestBody),
|
|
183
|
+
message: e.string()
|
|
184
|
+
}).transform(({ code: s, message: i }) => ({
|
|
185
|
+
code: s,
|
|
186
|
+
debugMessage: i
|
|
187
|
+
})), je = e.object({
|
|
188
|
+
code: e.literal(l.requestBodyTooLarge),
|
|
189
|
+
limit: e.int()
|
|
190
|
+
}), ge = e.object({
|
|
191
|
+
code: e.literal(l.emptyRequestBody),
|
|
192
|
+
message: e.string()
|
|
193
|
+
}).transform(({ code: s, message: i }) => ({
|
|
194
|
+
code: s,
|
|
195
|
+
debugMessage: i
|
|
196
|
+
})), ve = e.object({
|
|
197
|
+
code: e.literal(c.malformedResponseBody),
|
|
198
|
+
response: e.instanceof(Response)
|
|
199
199
|
}), ye = e.object({
|
|
200
|
-
code: e.literal(
|
|
201
|
-
|
|
202
|
-
key: e.string(),
|
|
203
|
-
required: e.string(),
|
|
204
|
-
got: e.string()
|
|
200
|
+
code: e.literal(c.malformedJsonFromServer),
|
|
201
|
+
response: e.instanceof(Response)
|
|
205
202
|
}), Ee = e.object({
|
|
206
|
-
code: e.literal(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}),
|
|
210
|
-
code:
|
|
211
|
-
|
|
203
|
+
code: e.literal(c.invalidResponseShape),
|
|
204
|
+
message: e.string(),
|
|
205
|
+
payload: e.unknown()
|
|
206
|
+
}).transform(({ code: s, message: i, payload: u }) => ({
|
|
207
|
+
code: s,
|
|
208
|
+
debugMessage: i,
|
|
209
|
+
payload: u
|
|
210
|
+
})), fe = e.object({
|
|
211
|
+
code: e.literal(c.unknownServerError),
|
|
212
|
+
payload: e.unknown()
|
|
212
213
|
}), Fe = e.object({
|
|
213
|
-
code: e.literal(
|
|
214
|
-
missingPermission: e.string()
|
|
214
|
+
code: e.literal(c.internalServerError)
|
|
215
215
|
}), Ie = e.discriminatedUnion("code", [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
216
|
+
S,
|
|
217
|
+
p,
|
|
218
|
+
j,
|
|
219
|
+
g,
|
|
220
|
+
v,
|
|
221
|
+
y,
|
|
222
|
+
f,
|
|
223
|
+
F,
|
|
224
|
+
U,
|
|
225
|
+
N,
|
|
226
|
+
I,
|
|
227
|
+
E,
|
|
228
|
+
M,
|
|
229
|
+
w,
|
|
230
|
+
A,
|
|
224
231
|
$,
|
|
225
232
|
ee,
|
|
226
233
|
ae,
|
|
227
|
-
|
|
234
|
+
oe,
|
|
235
|
+
te,
|
|
236
|
+
se,
|
|
237
|
+
ie,
|
|
238
|
+
re,
|
|
228
239
|
ce,
|
|
229
240
|
ne,
|
|
230
241
|
le,
|
|
231
|
-
H,
|
|
232
|
-
ye,
|
|
233
|
-
Ee,
|
|
234
|
-
fe,
|
|
235
|
-
Fe,
|
|
236
242
|
de,
|
|
237
243
|
me,
|
|
238
244
|
ue,
|
|
@@ -243,80 +249,75 @@ const S = e.object({
|
|
|
243
249
|
je,
|
|
244
250
|
ge,
|
|
245
251
|
ve,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
ie,
|
|
251
|
-
S,
|
|
252
|
-
p,
|
|
253
|
-
j,
|
|
254
|
-
g,
|
|
255
|
-
v
|
|
252
|
+
ye,
|
|
253
|
+
Ee,
|
|
254
|
+
fe,
|
|
255
|
+
Fe
|
|
256
256
|
]);
|
|
257
257
|
export {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
258
|
+
me as $,
|
|
259
|
+
Se as A,
|
|
260
|
+
Ee as B,
|
|
261
|
+
g as C,
|
|
262
|
+
H as D,
|
|
263
|
+
V as E,
|
|
264
|
+
j as F,
|
|
265
|
+
ye as G,
|
|
266
|
+
ve as H,
|
|
267
|
+
ce as I,
|
|
268
|
+
ie as J,
|
|
269
|
+
re as K,
|
|
270
|
+
A as L,
|
|
271
|
+
be as M,
|
|
272
|
+
C as N,
|
|
273
|
+
P as O,
|
|
274
|
+
te as P,
|
|
275
|
+
ue as Q,
|
|
276
|
+
z as R,
|
|
277
|
+
L as S,
|
|
278
|
+
T,
|
|
279
|
+
J as U,
|
|
280
|
+
f as V,
|
|
281
|
+
oe as W,
|
|
282
|
+
je as X,
|
|
283
|
+
B as Y,
|
|
284
|
+
w as Z,
|
|
285
|
+
ee as _,
|
|
286
|
+
q as a,
|
|
287
|
+
I as a0,
|
|
288
|
+
pe as a1,
|
|
289
|
+
fe as a2,
|
|
290
|
+
E as a3,
|
|
291
|
+
le as a4,
|
|
292
|
+
ne as a5,
|
|
293
|
+
N as a6,
|
|
294
|
+
U as a7,
|
|
295
|
+
F as a8,
|
|
296
|
+
p as a9,
|
|
297
|
+
k as b,
|
|
298
|
+
de as c,
|
|
299
|
+
D as d,
|
|
300
|
+
R as e,
|
|
301
|
+
ge as f,
|
|
302
302
|
Ie as g,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
303
|
+
Z as h,
|
|
304
|
+
Y as i,
|
|
305
|
+
G as j,
|
|
306
|
+
W as k,
|
|
307
|
+
X as l,
|
|
308
|
+
Q as m,
|
|
309
|
+
_ as n,
|
|
310
|
+
K as o,
|
|
311
|
+
$ as p,
|
|
312
|
+
v as q,
|
|
313
|
+
Fe as r,
|
|
314
|
+
ae as s,
|
|
315
|
+
S as t,
|
|
316
|
+
y as u,
|
|
317
|
+
he as v,
|
|
318
|
+
O as w,
|
|
319
|
+
x,
|
|
320
|
+
M as y,
|
|
321
|
+
se as z
|
|
322
322
|
};
|
|
323
|
+
//# sourceMappingURL=schema.map
|