@vritti/api-sdk 0.0.6 → 0.0.8
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/index.cjs +458 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +455 -16
- package/dist/index.d.ts +455 -16
- package/dist/index.js +437 -61
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -32,19 +32,39 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
32
|
var index_exports = {};
|
|
33
33
|
__export(index_exports, {
|
|
34
34
|
AuthConfigModule: () => AuthConfigModule,
|
|
35
|
+
BadGatewayException: () => BadGatewayException,
|
|
36
|
+
BadRequestException: () => BadRequestException,
|
|
37
|
+
BaseFieldException: () => BaseFieldException,
|
|
38
|
+
ConflictException: () => ConflictException,
|
|
35
39
|
CsrfGuard: () => CsrfGuard,
|
|
36
40
|
DatabaseModule: () => DatabaseModule,
|
|
41
|
+
ForbiddenException: () => ForbiddenException2,
|
|
42
|
+
GoneException: () => GoneException,
|
|
37
43
|
HttpExceptionFilter: () => HttpExceptionFilter,
|
|
38
44
|
HttpModule: () => HttpModule,
|
|
45
|
+
InternalServerErrorException: () => InternalServerErrorException3,
|
|
46
|
+
MethodNotAllowedException: () => MethodNotAllowedException,
|
|
47
|
+
NotAcceptableException: () => NotAcceptableException,
|
|
48
|
+
NotFoundException: () => NotFoundException,
|
|
49
|
+
NotImplementedException: () => NotImplementedException,
|
|
39
50
|
Onboarding: () => Onboarding,
|
|
51
|
+
PayloadTooLargeException: () => PayloadTooLargeException,
|
|
40
52
|
PrimaryBaseRepository: () => PrimaryBaseRepository,
|
|
41
53
|
PrimaryDatabaseService: () => PrimaryDatabaseService,
|
|
42
54
|
Public: () => Public,
|
|
55
|
+
RequestTimeoutException: () => RequestTimeoutException,
|
|
56
|
+
ServiceUnavailableException: () => ServiceUnavailableException,
|
|
43
57
|
Tenant: () => Tenant,
|
|
44
58
|
TenantBaseRepository: () => TenantBaseRepository,
|
|
45
59
|
TenantContextService: () => TenantContextService,
|
|
46
60
|
TenantDatabaseService: () => TenantDatabaseService,
|
|
47
|
-
|
|
61
|
+
TooManyRequestsException: () => TooManyRequestsException,
|
|
62
|
+
UnauthorizedException: () => UnauthorizedException4,
|
|
63
|
+
UnprocessableEntityException: () => UnprocessableEntityException,
|
|
64
|
+
UnsupportedMediaTypeException: () => UnsupportedMediaTypeException,
|
|
65
|
+
ValidationException: () => ValidationException,
|
|
66
|
+
VrittiAuthGuard: () => VrittiAuthGuard,
|
|
67
|
+
getHttpStatusTitle: () => getHttpStatusTitle
|
|
48
68
|
});
|
|
49
69
|
module.exports = __toCommonJS(index_exports);
|
|
50
70
|
|
|
@@ -1923,7 +1943,7 @@ HttpModule = _ts_decorate12([
|
|
|
1923
1943
|
})
|
|
1924
1944
|
], HttpModule);
|
|
1925
1945
|
|
|
1926
|
-
// src/
|
|
1946
|
+
// src/filters/http-exception.filter.ts
|
|
1927
1947
|
var import_common18 = require("@nestjs/common");
|
|
1928
1948
|
function _ts_decorate13(decorators, target, key, desc) {
|
|
1929
1949
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1932,6 +1952,14 @@ function _ts_decorate13(decorators, target, key, desc) {
|
|
|
1932
1952
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1933
1953
|
}
|
|
1934
1954
|
__name(_ts_decorate13, "_ts_decorate");
|
|
1955
|
+
function getHttpStatusTitle(status) {
|
|
1956
|
+
const enumKey = Object.entries(import_common18.HttpStatus).find(([key, value]) => value === status && isNaN(Number(key)))?.[0];
|
|
1957
|
+
if (!enumKey) {
|
|
1958
|
+
return "Error";
|
|
1959
|
+
}
|
|
1960
|
+
return enumKey.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
1961
|
+
}
|
|
1962
|
+
__name(getHttpStatusTitle, "getHttpStatusTitle");
|
|
1935
1963
|
var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
1936
1964
|
static {
|
|
1937
1965
|
__name(this, "HttpExceptionFilter");
|
|
@@ -1939,118 +1967,486 @@ var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
|
1939
1967
|
logger = new import_common18.Logger(_HttpExceptionFilter.name);
|
|
1940
1968
|
catch(exception, host) {
|
|
1941
1969
|
const ctx = host.switchToHttp();
|
|
1942
|
-
const
|
|
1943
|
-
const request = ctx.getRequest();
|
|
1970
|
+
const response = ctx.getResponse();
|
|
1944
1971
|
let status = import_common18.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
1945
1972
|
let errors = [];
|
|
1946
|
-
let
|
|
1973
|
+
let detail = "Internal server error";
|
|
1947
1974
|
if (exception instanceof import_common18.HttpException) {
|
|
1948
1975
|
status = exception.getStatus();
|
|
1949
1976
|
const exceptionResponse = exception.getResponse();
|
|
1950
1977
|
if (typeof exceptionResponse === "object" && exceptionResponse !== null) {
|
|
1951
1978
|
const responseObj = exceptionResponse;
|
|
1952
|
-
if (Array.isArray(responseObj.
|
|
1953
|
-
errors =
|
|
1954
|
-
|
|
1979
|
+
if (responseObj.errors && Array.isArray(responseObj.errors)) {
|
|
1980
|
+
errors = responseObj.errors;
|
|
1981
|
+
detail = responseObj.detail || exception.message;
|
|
1982
|
+
} else if (responseObj.message && Array.isArray(responseObj.message)) {
|
|
1983
|
+
errors = responseObj.message.map((msg) => {
|
|
1984
|
+
if (typeof msg === "object" && msg.property && msg.constraints) {
|
|
1985
|
+
return {
|
|
1986
|
+
field: msg.property,
|
|
1987
|
+
message: Object.values(msg.constraints)[0]
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
return {
|
|
1991
|
+
message: typeof msg === "string" ? msg : JSON.stringify(msg)
|
|
1992
|
+
};
|
|
1993
|
+
});
|
|
1994
|
+
detail = "Validation failed";
|
|
1955
1995
|
} else if (responseObj.message) {
|
|
1956
1996
|
errors = [
|
|
1957
1997
|
{
|
|
1958
|
-
|
|
1959
|
-
message: responseObj.message
|
|
1998
|
+
message: Array.isArray(responseObj.message) ? responseObj.message.join(", ") : responseObj.message
|
|
1960
1999
|
}
|
|
1961
2000
|
];
|
|
1962
|
-
|
|
2001
|
+
detail = responseObj.error || exception.message;
|
|
1963
2002
|
}
|
|
1964
2003
|
} else if (typeof exceptionResponse === "string") {
|
|
1965
2004
|
errors = [
|
|
1966
2005
|
{
|
|
1967
|
-
field: "general",
|
|
1968
2006
|
message: exceptionResponse
|
|
1969
2007
|
}
|
|
1970
2008
|
];
|
|
1971
|
-
|
|
2009
|
+
detail = exceptionResponse;
|
|
1972
2010
|
}
|
|
1973
|
-
} else
|
|
1974
|
-
this.logger.error(
|
|
2011
|
+
} else {
|
|
2012
|
+
this.logger.error("Unexpected error:", exception);
|
|
2013
|
+
errors = [
|
|
2014
|
+
{
|
|
2015
|
+
message: "An unexpected error occurred"
|
|
2016
|
+
}
|
|
2017
|
+
];
|
|
2018
|
+
}
|
|
2019
|
+
const problemDetails = {
|
|
2020
|
+
title: getHttpStatusTitle(status),
|
|
2021
|
+
status,
|
|
2022
|
+
detail,
|
|
2023
|
+
errors
|
|
2024
|
+
};
|
|
2025
|
+
response.status(status).send(problemDetails);
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
HttpExceptionFilter = _ts_decorate13([
|
|
2029
|
+
(0, import_common18.Catch)()
|
|
2030
|
+
], HttpExceptionFilter);
|
|
2031
|
+
|
|
2032
|
+
// src/exceptions/base-field.exception.ts
|
|
2033
|
+
var import_common19 = require("@nestjs/common");
|
|
2034
|
+
var BaseFieldException = class extends import_common19.HttpException {
|
|
2035
|
+
static {
|
|
2036
|
+
__name(this, "BaseFieldException");
|
|
2037
|
+
}
|
|
2038
|
+
constructor(statusOrMessageOrErrors, messageOrStatus, statusOrDetail, detail) {
|
|
2039
|
+
let errors;
|
|
2040
|
+
let httpStatus;
|
|
2041
|
+
let finalDetail;
|
|
2042
|
+
if (Array.isArray(statusOrMessageOrErrors)) {
|
|
2043
|
+
errors = statusOrMessageOrErrors;
|
|
2044
|
+
httpStatus = messageOrStatus || import_common19.HttpStatus.BAD_REQUEST;
|
|
2045
|
+
finalDetail = typeof statusOrDetail === "string" ? statusOrDetail : void 0;
|
|
2046
|
+
} else if (typeof statusOrMessageOrErrors === "string" && typeof messageOrStatus === "string") {
|
|
2047
|
+
errors = [
|
|
2048
|
+
{
|
|
2049
|
+
field: statusOrMessageOrErrors,
|
|
2050
|
+
message: messageOrStatus
|
|
2051
|
+
}
|
|
2052
|
+
];
|
|
2053
|
+
httpStatus = statusOrDetail;
|
|
2054
|
+
finalDetail = detail;
|
|
2055
|
+
} else if (typeof statusOrMessageOrErrors === "string") {
|
|
1975
2056
|
errors = [
|
|
1976
2057
|
{
|
|
1977
|
-
|
|
1978
|
-
message: "Internal server error"
|
|
2058
|
+
message: statusOrMessageOrErrors
|
|
1979
2059
|
}
|
|
1980
2060
|
];
|
|
1981
|
-
|
|
2061
|
+
httpStatus = messageOrStatus;
|
|
2062
|
+
finalDetail = typeof statusOrDetail === "string" ? statusOrDetail : void 0;
|
|
1982
2063
|
} else {
|
|
1983
|
-
this.logger.error("Unknown exception type", exception);
|
|
1984
2064
|
errors = [
|
|
1985
2065
|
{
|
|
1986
|
-
|
|
1987
|
-
message: "Internal server error"
|
|
2066
|
+
message: "An error occurred"
|
|
1988
2067
|
}
|
|
1989
2068
|
];
|
|
1990
|
-
|
|
2069
|
+
httpStatus = statusOrMessageOrErrors;
|
|
2070
|
+
finalDetail = void 0;
|
|
1991
2071
|
}
|
|
1992
|
-
const
|
|
2072
|
+
const response = finalDetail !== void 0 ? {
|
|
1993
2073
|
errors,
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
path: request.url
|
|
2074
|
+
detail: finalDetail
|
|
2075
|
+
} : {
|
|
2076
|
+
errors
|
|
1998
2077
|
};
|
|
1999
|
-
|
|
2000
|
-
|
|
2078
|
+
super(response, httpStatus);
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
|
|
2082
|
+
// src/exceptions/bad-request.exception.ts
|
|
2083
|
+
var import_common20 = require("@nestjs/common");
|
|
2084
|
+
var BadRequestException = class extends BaseFieldException {
|
|
2085
|
+
static {
|
|
2086
|
+
__name(this, "BadRequestException");
|
|
2087
|
+
}
|
|
2088
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2089
|
+
if (Array.isArray(messageOrField)) {
|
|
2090
|
+
super(messageOrField, import_common20.HttpStatus.BAD_REQUEST, fieldMessageOrDetail);
|
|
2091
|
+
} else if (detail !== void 0) {
|
|
2092
|
+
super(messageOrField, fieldMessageOrDetail, import_common20.HttpStatus.BAD_REQUEST, detail);
|
|
2093
|
+
} else if (fieldMessageOrDetail) {
|
|
2094
|
+
super(messageOrField, fieldMessageOrDetail, import_common20.HttpStatus.BAD_REQUEST);
|
|
2001
2095
|
} else {
|
|
2002
|
-
|
|
2096
|
+
super(messageOrField, import_common20.HttpStatus.BAD_REQUEST);
|
|
2003
2097
|
}
|
|
2004
|
-
reply.status(status).send(errorResponse);
|
|
2005
2098
|
}
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2099
|
+
};
|
|
2100
|
+
|
|
2101
|
+
// src/exceptions/unauthorized.exception.ts
|
|
2102
|
+
var import_common21 = require("@nestjs/common");
|
|
2103
|
+
var UnauthorizedException4 = class extends BaseFieldException {
|
|
2104
|
+
static {
|
|
2105
|
+
__name(this, "UnauthorizedException");
|
|
2106
|
+
}
|
|
2107
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2108
|
+
if (Array.isArray(messageOrField)) {
|
|
2109
|
+
super(messageOrField, import_common21.HttpStatus.UNAUTHORIZED, fieldMessageOrDetail);
|
|
2110
|
+
} else if (detail !== void 0) {
|
|
2111
|
+
super(messageOrField, fieldMessageOrDetail, import_common21.HttpStatus.UNAUTHORIZED, detail);
|
|
2112
|
+
} else if (fieldMessageOrDetail) {
|
|
2113
|
+
super(messageOrField, fieldMessageOrDetail, import_common21.HttpStatus.UNAUTHORIZED);
|
|
2114
|
+
} else {
|
|
2115
|
+
super(messageOrField, import_common21.HttpStatus.UNAUTHORIZED);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
// src/exceptions/forbidden.exception.ts
|
|
2121
|
+
var import_common22 = require("@nestjs/common");
|
|
2122
|
+
var ForbiddenException2 = class extends BaseFieldException {
|
|
2123
|
+
static {
|
|
2124
|
+
__name(this, "ForbiddenException");
|
|
2125
|
+
}
|
|
2126
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2127
|
+
if (Array.isArray(messageOrField)) {
|
|
2128
|
+
super(messageOrField, import_common22.HttpStatus.FORBIDDEN, fieldMessageOrDetail);
|
|
2129
|
+
} else if (detail !== void 0) {
|
|
2130
|
+
super(messageOrField, fieldMessageOrDetail, import_common22.HttpStatus.FORBIDDEN, detail);
|
|
2131
|
+
} else if (fieldMessageOrDetail) {
|
|
2132
|
+
super(messageOrField, fieldMessageOrDetail, import_common22.HttpStatus.FORBIDDEN);
|
|
2133
|
+
} else {
|
|
2134
|
+
super(messageOrField, import_common22.HttpStatus.FORBIDDEN);
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
};
|
|
2138
|
+
|
|
2139
|
+
// src/exceptions/not-found.exception.ts
|
|
2140
|
+
var import_common23 = require("@nestjs/common");
|
|
2141
|
+
var NotFoundException = class extends BaseFieldException {
|
|
2142
|
+
static {
|
|
2143
|
+
__name(this, "NotFoundException");
|
|
2144
|
+
}
|
|
2145
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2146
|
+
if (Array.isArray(messageOrField)) {
|
|
2147
|
+
super(messageOrField, import_common23.HttpStatus.NOT_FOUND, fieldMessageOrDetail);
|
|
2148
|
+
} else if (detail !== void 0) {
|
|
2149
|
+
super(messageOrField, fieldMessageOrDetail, import_common23.HttpStatus.NOT_FOUND, detail);
|
|
2150
|
+
} else if (fieldMessageOrDetail) {
|
|
2151
|
+
super(messageOrField, fieldMessageOrDetail, import_common23.HttpStatus.NOT_FOUND);
|
|
2152
|
+
} else {
|
|
2153
|
+
super(messageOrField, import_common23.HttpStatus.NOT_FOUND);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
};
|
|
2157
|
+
|
|
2158
|
+
// src/exceptions/conflict.exception.ts
|
|
2159
|
+
var import_common24 = require("@nestjs/common");
|
|
2160
|
+
var ConflictException = class extends BaseFieldException {
|
|
2161
|
+
static {
|
|
2162
|
+
__name(this, "ConflictException");
|
|
2163
|
+
}
|
|
2164
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2165
|
+
if (Array.isArray(messageOrField)) {
|
|
2166
|
+
super(messageOrField, import_common24.HttpStatus.CONFLICT, fieldMessageOrDetail);
|
|
2167
|
+
} else if (detail !== void 0) {
|
|
2168
|
+
super(messageOrField, fieldMessageOrDetail, import_common24.HttpStatus.CONFLICT, detail);
|
|
2169
|
+
} else if (fieldMessageOrDetail) {
|
|
2170
|
+
super(messageOrField, fieldMessageOrDetail, import_common24.HttpStatus.CONFLICT);
|
|
2171
|
+
} else {
|
|
2172
|
+
super(messageOrField, import_common24.HttpStatus.CONFLICT);
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2176
|
+
|
|
2177
|
+
// src/exceptions/internal-server-error.exception.ts
|
|
2178
|
+
var import_common25 = require("@nestjs/common");
|
|
2179
|
+
var InternalServerErrorException3 = class extends BaseFieldException {
|
|
2180
|
+
static {
|
|
2181
|
+
__name(this, "InternalServerErrorException");
|
|
2182
|
+
}
|
|
2183
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2184
|
+
if (Array.isArray(messageOrField)) {
|
|
2185
|
+
super(messageOrField, import_common25.HttpStatus.INTERNAL_SERVER_ERROR, fieldMessageOrDetail);
|
|
2186
|
+
} else if (detail !== void 0) {
|
|
2187
|
+
super(messageOrField, fieldMessageOrDetail, import_common25.HttpStatus.INTERNAL_SERVER_ERROR, detail);
|
|
2188
|
+
} else if (fieldMessageOrDetail) {
|
|
2189
|
+
super(messageOrField, fieldMessageOrDetail, import_common25.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
2190
|
+
} else {
|
|
2191
|
+
super(messageOrField, import_common25.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
|
|
2196
|
+
// src/exceptions/validation.exception.ts
|
|
2197
|
+
var import_common26 = require("@nestjs/common");
|
|
2198
|
+
var ValidationException = class extends BaseFieldException {
|
|
2199
|
+
static {
|
|
2200
|
+
__name(this, "ValidationException");
|
|
2201
|
+
}
|
|
2202
|
+
constructor(errors, detail) {
|
|
2203
|
+
super(errors, import_common26.HttpStatus.BAD_REQUEST, detail);
|
|
2204
|
+
}
|
|
2205
|
+
};
|
|
2206
|
+
|
|
2207
|
+
// src/exceptions/unprocessable-entity.exception.ts
|
|
2208
|
+
var import_common27 = require("@nestjs/common");
|
|
2209
|
+
var UnprocessableEntityException = class extends BaseFieldException {
|
|
2210
|
+
static {
|
|
2211
|
+
__name(this, "UnprocessableEntityException");
|
|
2212
|
+
}
|
|
2213
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2214
|
+
if (Array.isArray(messageOrField)) {
|
|
2215
|
+
super(messageOrField, import_common27.HttpStatus.UNPROCESSABLE_ENTITY, fieldMessageOrDetail);
|
|
2216
|
+
} else if (detail !== void 0) {
|
|
2217
|
+
super(messageOrField, fieldMessageOrDetail, import_common27.HttpStatus.UNPROCESSABLE_ENTITY, detail);
|
|
2218
|
+
} else if (fieldMessageOrDetail) {
|
|
2219
|
+
super(messageOrField, fieldMessageOrDetail, import_common27.HttpStatus.UNPROCESSABLE_ENTITY);
|
|
2220
|
+
} else {
|
|
2221
|
+
super(messageOrField, import_common27.HttpStatus.UNPROCESSABLE_ENTITY);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
};
|
|
2225
|
+
|
|
2226
|
+
// src/exceptions/too-many-requests.exception.ts
|
|
2227
|
+
var import_common28 = require("@nestjs/common");
|
|
2228
|
+
var TooManyRequestsException = class extends BaseFieldException {
|
|
2229
|
+
static {
|
|
2230
|
+
__name(this, "TooManyRequestsException");
|
|
2231
|
+
}
|
|
2232
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2233
|
+
if (Array.isArray(messageOrField)) {
|
|
2234
|
+
super(messageOrField, import_common28.HttpStatus.TOO_MANY_REQUESTS, fieldMessageOrDetail);
|
|
2235
|
+
} else if (detail !== void 0) {
|
|
2236
|
+
super(messageOrField, fieldMessageOrDetail, import_common28.HttpStatus.TOO_MANY_REQUESTS, detail);
|
|
2237
|
+
} else if (fieldMessageOrDetail) {
|
|
2238
|
+
super(messageOrField, fieldMessageOrDetail, import_common28.HttpStatus.TOO_MANY_REQUESTS);
|
|
2239
|
+
} else {
|
|
2240
|
+
super(messageOrField, import_common28.HttpStatus.TOO_MANY_REQUESTS);
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
};
|
|
2244
|
+
|
|
2245
|
+
// src/exceptions/service-unavailable.exception.ts
|
|
2246
|
+
var import_common29 = require("@nestjs/common");
|
|
2247
|
+
var ServiceUnavailableException = class extends BaseFieldException {
|
|
2248
|
+
static {
|
|
2249
|
+
__name(this, "ServiceUnavailableException");
|
|
2250
|
+
}
|
|
2251
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2252
|
+
if (Array.isArray(messageOrField)) {
|
|
2253
|
+
super(messageOrField, import_common29.HttpStatus.SERVICE_UNAVAILABLE, fieldMessageOrDetail);
|
|
2254
|
+
} else if (detail !== void 0) {
|
|
2255
|
+
super(messageOrField, fieldMessageOrDetail, import_common29.HttpStatus.SERVICE_UNAVAILABLE, detail);
|
|
2256
|
+
} else if (fieldMessageOrDetail) {
|
|
2257
|
+
super(messageOrField, fieldMessageOrDetail, import_common29.HttpStatus.SERVICE_UNAVAILABLE);
|
|
2258
|
+
} else {
|
|
2259
|
+
super(messageOrField, import_common29.HttpStatus.SERVICE_UNAVAILABLE);
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
};
|
|
2263
|
+
|
|
2264
|
+
// src/exceptions/method-not-allowed.exception.ts
|
|
2265
|
+
var import_common30 = require("@nestjs/common");
|
|
2266
|
+
var MethodNotAllowedException = class extends BaseFieldException {
|
|
2267
|
+
static {
|
|
2268
|
+
__name(this, "MethodNotAllowedException");
|
|
2269
|
+
}
|
|
2270
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2271
|
+
if (Array.isArray(messageOrField)) {
|
|
2272
|
+
super(messageOrField, import_common30.HttpStatus.METHOD_NOT_ALLOWED, fieldMessageOrDetail);
|
|
2273
|
+
} else if (detail !== void 0) {
|
|
2274
|
+
super(messageOrField, fieldMessageOrDetail, import_common30.HttpStatus.METHOD_NOT_ALLOWED, detail);
|
|
2275
|
+
} else if (fieldMessageOrDetail) {
|
|
2276
|
+
super(messageOrField, fieldMessageOrDetail, import_common30.HttpStatus.METHOD_NOT_ALLOWED);
|
|
2277
|
+
} else {
|
|
2278
|
+
super(messageOrField, import_common30.HttpStatus.METHOD_NOT_ALLOWED);
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
};
|
|
2282
|
+
|
|
2283
|
+
// src/exceptions/gone.exception.ts
|
|
2284
|
+
var import_common31 = require("@nestjs/common");
|
|
2285
|
+
var GoneException = class extends BaseFieldException {
|
|
2286
|
+
static {
|
|
2287
|
+
__name(this, "GoneException");
|
|
2288
|
+
}
|
|
2289
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2290
|
+
if (Array.isArray(messageOrField)) {
|
|
2291
|
+
super(messageOrField, import_common31.HttpStatus.GONE, fieldMessageOrDetail);
|
|
2292
|
+
} else if (detail !== void 0) {
|
|
2293
|
+
super(messageOrField, fieldMessageOrDetail, import_common31.HttpStatus.GONE, detail);
|
|
2294
|
+
} else if (fieldMessageOrDetail) {
|
|
2295
|
+
super(messageOrField, fieldMessageOrDetail, import_common31.HttpStatus.GONE);
|
|
2296
|
+
} else {
|
|
2297
|
+
super(messageOrField, import_common31.HttpStatus.GONE);
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
};
|
|
2301
|
+
|
|
2302
|
+
// src/exceptions/not-acceptable.exception.ts
|
|
2303
|
+
var import_common32 = require("@nestjs/common");
|
|
2304
|
+
var NotAcceptableException = class extends BaseFieldException {
|
|
2305
|
+
static {
|
|
2306
|
+
__name(this, "NotAcceptableException");
|
|
2307
|
+
}
|
|
2308
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2309
|
+
if (Array.isArray(messageOrField)) {
|
|
2310
|
+
super(messageOrField, import_common32.HttpStatus.NOT_ACCEPTABLE, fieldMessageOrDetail);
|
|
2311
|
+
} else if (detail !== void 0) {
|
|
2312
|
+
super(messageOrField, fieldMessageOrDetail, import_common32.HttpStatus.NOT_ACCEPTABLE, detail);
|
|
2313
|
+
} else if (fieldMessageOrDetail) {
|
|
2314
|
+
super(messageOrField, fieldMessageOrDetail, import_common32.HttpStatus.NOT_ACCEPTABLE);
|
|
2315
|
+
} else {
|
|
2316
|
+
super(messageOrField, import_common32.HttpStatus.NOT_ACCEPTABLE);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
|
|
2321
|
+
// src/exceptions/request-timeout.exception.ts
|
|
2322
|
+
var import_common33 = require("@nestjs/common");
|
|
2323
|
+
var RequestTimeoutException = class extends BaseFieldException {
|
|
2324
|
+
static {
|
|
2325
|
+
__name(this, "RequestTimeoutException");
|
|
2326
|
+
}
|
|
2327
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2328
|
+
if (Array.isArray(messageOrField)) {
|
|
2329
|
+
super(messageOrField, import_common33.HttpStatus.REQUEST_TIMEOUT, fieldMessageOrDetail);
|
|
2330
|
+
} else if (detail !== void 0) {
|
|
2331
|
+
super(messageOrField, fieldMessageOrDetail, import_common33.HttpStatus.REQUEST_TIMEOUT, detail);
|
|
2332
|
+
} else if (fieldMessageOrDetail) {
|
|
2333
|
+
super(messageOrField, fieldMessageOrDetail, import_common33.HttpStatus.REQUEST_TIMEOUT);
|
|
2334
|
+
} else {
|
|
2335
|
+
super(messageOrField, import_common33.HttpStatus.REQUEST_TIMEOUT);
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
};
|
|
2339
|
+
|
|
2340
|
+
// src/exceptions/payload-too-large.exception.ts
|
|
2341
|
+
var import_common34 = require("@nestjs/common");
|
|
2342
|
+
var PayloadTooLargeException = class extends BaseFieldException {
|
|
2343
|
+
static {
|
|
2344
|
+
__name(this, "PayloadTooLargeException");
|
|
2345
|
+
}
|
|
2346
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2347
|
+
if (Array.isArray(messageOrField)) {
|
|
2348
|
+
super(messageOrField, import_common34.HttpStatus.PAYLOAD_TOO_LARGE, fieldMessageOrDetail);
|
|
2349
|
+
} else if (detail !== void 0) {
|
|
2350
|
+
super(messageOrField, fieldMessageOrDetail, import_common34.HttpStatus.PAYLOAD_TOO_LARGE, detail);
|
|
2351
|
+
} else if (fieldMessageOrDetail) {
|
|
2352
|
+
super(messageOrField, fieldMessageOrDetail, import_common34.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
2353
|
+
} else {
|
|
2354
|
+
super(messageOrField, import_common34.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
};
|
|
2358
|
+
|
|
2359
|
+
// src/exceptions/unsupported-media-type.exception.ts
|
|
2360
|
+
var import_common35 = require("@nestjs/common");
|
|
2361
|
+
var UnsupportedMediaTypeException = class extends BaseFieldException {
|
|
2362
|
+
static {
|
|
2363
|
+
__name(this, "UnsupportedMediaTypeException");
|
|
2364
|
+
}
|
|
2365
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2366
|
+
if (Array.isArray(messageOrField)) {
|
|
2367
|
+
super(messageOrField, import_common35.HttpStatus.UNSUPPORTED_MEDIA_TYPE, fieldMessageOrDetail);
|
|
2368
|
+
} else if (detail !== void 0) {
|
|
2369
|
+
super(messageOrField, fieldMessageOrDetail, import_common35.HttpStatus.UNSUPPORTED_MEDIA_TYPE, detail);
|
|
2370
|
+
} else if (fieldMessageOrDetail) {
|
|
2371
|
+
super(messageOrField, fieldMessageOrDetail, import_common35.HttpStatus.UNSUPPORTED_MEDIA_TYPE);
|
|
2372
|
+
} else {
|
|
2373
|
+
super(messageOrField, import_common35.HttpStatus.UNSUPPORTED_MEDIA_TYPE);
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
};
|
|
2377
|
+
|
|
2378
|
+
// src/exceptions/not-implemented.exception.ts
|
|
2379
|
+
var import_common36 = require("@nestjs/common");
|
|
2380
|
+
var NotImplementedException = class extends BaseFieldException {
|
|
2381
|
+
static {
|
|
2382
|
+
__name(this, "NotImplementedException");
|
|
2383
|
+
}
|
|
2384
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2385
|
+
if (Array.isArray(messageOrField)) {
|
|
2386
|
+
super(messageOrField, import_common36.HttpStatus.NOT_IMPLEMENTED, fieldMessageOrDetail);
|
|
2387
|
+
} else if (detail !== void 0) {
|
|
2388
|
+
super(messageOrField, fieldMessageOrDetail, import_common36.HttpStatus.NOT_IMPLEMENTED, detail);
|
|
2389
|
+
} else if (fieldMessageOrDetail) {
|
|
2390
|
+
super(messageOrField, fieldMessageOrDetail, import_common36.HttpStatus.NOT_IMPLEMENTED);
|
|
2391
|
+
} else {
|
|
2392
|
+
super(messageOrField, import_common36.HttpStatus.NOT_IMPLEMENTED);
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
};
|
|
2396
|
+
|
|
2397
|
+
// src/exceptions/bad-gateway.exception.ts
|
|
2398
|
+
var import_common37 = require("@nestjs/common");
|
|
2399
|
+
var BadGatewayException = class extends BaseFieldException {
|
|
2400
|
+
static {
|
|
2401
|
+
__name(this, "BadGatewayException");
|
|
2402
|
+
}
|
|
2403
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2404
|
+
if (Array.isArray(messageOrField)) {
|
|
2405
|
+
super(messageOrField, import_common37.HttpStatus.BAD_GATEWAY, fieldMessageOrDetail);
|
|
2406
|
+
} else if (detail !== void 0) {
|
|
2407
|
+
super(messageOrField, fieldMessageOrDetail, import_common37.HttpStatus.BAD_GATEWAY, detail);
|
|
2408
|
+
} else if (fieldMessageOrDetail) {
|
|
2409
|
+
super(messageOrField, fieldMessageOrDetail, import_common37.HttpStatus.BAD_GATEWAY);
|
|
2410
|
+
} else {
|
|
2411
|
+
super(messageOrField, import_common37.HttpStatus.BAD_GATEWAY);
|
|
2027
2412
|
}
|
|
2028
|
-
return errors.length > 0 ? errors : [
|
|
2029
|
-
{
|
|
2030
|
-
field: "general",
|
|
2031
|
-
message: "Validation failed"
|
|
2032
|
-
}
|
|
2033
|
-
];
|
|
2034
2413
|
}
|
|
2035
2414
|
};
|
|
2036
|
-
HttpExceptionFilter = _ts_decorate13([
|
|
2037
|
-
(0, import_common18.Catch)()
|
|
2038
|
-
], HttpExceptionFilter);
|
|
2039
2415
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2040
2416
|
0 && (module.exports = {
|
|
2041
2417
|
AuthConfigModule,
|
|
2418
|
+
BadGatewayException,
|
|
2419
|
+
BadRequestException,
|
|
2420
|
+
BaseFieldException,
|
|
2421
|
+
ConflictException,
|
|
2042
2422
|
CsrfGuard,
|
|
2043
2423
|
DatabaseModule,
|
|
2424
|
+
ForbiddenException,
|
|
2425
|
+
GoneException,
|
|
2044
2426
|
HttpExceptionFilter,
|
|
2045
2427
|
HttpModule,
|
|
2428
|
+
InternalServerErrorException,
|
|
2429
|
+
MethodNotAllowedException,
|
|
2430
|
+
NotAcceptableException,
|
|
2431
|
+
NotFoundException,
|
|
2432
|
+
NotImplementedException,
|
|
2046
2433
|
Onboarding,
|
|
2434
|
+
PayloadTooLargeException,
|
|
2047
2435
|
PrimaryBaseRepository,
|
|
2048
2436
|
PrimaryDatabaseService,
|
|
2049
2437
|
Public,
|
|
2438
|
+
RequestTimeoutException,
|
|
2439
|
+
ServiceUnavailableException,
|
|
2050
2440
|
Tenant,
|
|
2051
2441
|
TenantBaseRepository,
|
|
2052
2442
|
TenantContextService,
|
|
2053
2443
|
TenantDatabaseService,
|
|
2054
|
-
|
|
2444
|
+
TooManyRequestsException,
|
|
2445
|
+
UnauthorizedException,
|
|
2446
|
+
UnprocessableEntityException,
|
|
2447
|
+
UnsupportedMediaTypeException,
|
|
2448
|
+
ValidationException,
|
|
2449
|
+
VrittiAuthGuard,
|
|
2450
|
+
getHttpStatusTitle
|
|
2055
2451
|
});
|
|
2056
2452
|
//# sourceMappingURL=index.cjs.map
|