@vritti/api-sdk 0.0.5 → 0.0.7
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 +530 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +446 -2
- package/dist/index.d.ts +446 -2
- package/dist/index.js +506 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -821,6 +821,7 @@ MessageTenantContextInterceptor = _ts_decorate7([
|
|
|
821
821
|
|
|
822
822
|
// src/database/interceptors/tenant-context.interceptor.ts
|
|
823
823
|
import { Injectable as Injectable6, Logger as Logger4, Scope as Scope5, UnauthorizedException as UnauthorizedException3 } from "@nestjs/common";
|
|
824
|
+
import { Reflector as Reflector2 } from "@nestjs/core";
|
|
824
825
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
825
826
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
826
827
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -836,11 +837,13 @@ var TenantContextInterceptor = class _TenantContextInterceptor {
|
|
|
836
837
|
static {
|
|
837
838
|
__name(this, "TenantContextInterceptor");
|
|
838
839
|
}
|
|
840
|
+
reflector;
|
|
839
841
|
tenantContext;
|
|
840
842
|
primaryDatabase;
|
|
841
843
|
requestService;
|
|
842
844
|
logger = new Logger4(_TenantContextInterceptor.name);
|
|
843
|
-
constructor(tenantContext, primaryDatabase, requestService) {
|
|
845
|
+
constructor(reflector, tenantContext, primaryDatabase, requestService) {
|
|
846
|
+
this.reflector = reflector;
|
|
844
847
|
this.tenantContext = tenantContext;
|
|
845
848
|
this.primaryDatabase = primaryDatabase;
|
|
846
849
|
this.requestService = requestService;
|
|
@@ -848,8 +851,16 @@ var TenantContextInterceptor = class _TenantContextInterceptor {
|
|
|
848
851
|
async intercept(context, next) {
|
|
849
852
|
const request = context.switchToHttp().getRequest();
|
|
850
853
|
this.logger.debug(`Processing request: ${request.method} ${request.url}`);
|
|
854
|
+
const isPublic = this.reflector.getAllAndOverride("isPublic", [
|
|
855
|
+
context.getHandler(),
|
|
856
|
+
context.getClass()
|
|
857
|
+
]);
|
|
851
858
|
try {
|
|
852
859
|
const tenantIdentifier = this.requestService.getTenantIdentifier();
|
|
860
|
+
if (isPublic && !tenantIdentifier) {
|
|
861
|
+
this.logger.debug("Public endpoint without tenant identifier, skipping tenant context setup");
|
|
862
|
+
return next.handle();
|
|
863
|
+
}
|
|
853
864
|
if (!tenantIdentifier) {
|
|
854
865
|
throw new UnauthorizedException3("Tenant identifier not found in request");
|
|
855
866
|
}
|
|
@@ -884,6 +895,7 @@ TenantContextInterceptor = _ts_decorate8([
|
|
|
884
895
|
}),
|
|
885
896
|
_ts_metadata5("design:type", Function),
|
|
886
897
|
_ts_metadata5("design:paramtypes", [
|
|
898
|
+
typeof Reflector2 === "undefined" ? Object : Reflector2,
|
|
887
899
|
typeof TenantContextService === "undefined" ? Object : TenantContextService,
|
|
888
900
|
typeof PrimaryDatabaseService === "undefined" ? Object : PrimaryDatabaseService,
|
|
889
901
|
typeof RequestService === "undefined" ? Object : RequestService
|
|
@@ -1769,7 +1781,7 @@ import { Module as Module4 } from "@nestjs/common";
|
|
|
1769
1781
|
|
|
1770
1782
|
// src/http/guards/csrf.guard.ts
|
|
1771
1783
|
import { ForbiddenException, Injectable as Injectable8, Logger as Logger8 } from "@nestjs/common";
|
|
1772
|
-
import { Reflector as
|
|
1784
|
+
import { Reflector as Reflector3 } from "@nestjs/core";
|
|
1773
1785
|
function _ts_decorate11(decorators, target, key, desc) {
|
|
1774
1786
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1775
1787
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1836,7 +1848,7 @@ CsrfGuard = _ts_decorate11([
|
|
|
1836
1848
|
Injectable8(),
|
|
1837
1849
|
_ts_metadata7("design:type", Function),
|
|
1838
1850
|
_ts_metadata7("design:paramtypes", [
|
|
1839
|
-
typeof
|
|
1851
|
+
typeof Reflector3 === "undefined" ? Object : Reflector3
|
|
1840
1852
|
])
|
|
1841
1853
|
], CsrfGuard);
|
|
1842
1854
|
|
|
@@ -1977,20 +1989,510 @@ var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
|
1977
1989
|
HttpExceptionFilter = _ts_decorate13([
|
|
1978
1990
|
Catch()
|
|
1979
1991
|
], HttpExceptionFilter);
|
|
1992
|
+
|
|
1993
|
+
// src/filters/http-exception.filter.ts
|
|
1994
|
+
import { Catch as Catch2, HttpException as HttpException2, HttpStatus as HttpStatus2, Logger as Logger10 } from "@nestjs/common";
|
|
1995
|
+
function _ts_decorate14(decorators, target, key, desc) {
|
|
1996
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1997
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1998
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1999
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2000
|
+
}
|
|
2001
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
2002
|
+
function getHttpStatusTitle(status) {
|
|
2003
|
+
const enumKey = Object.entries(HttpStatus2).find(([key, value]) => value === status && isNaN(Number(key)))?.[0];
|
|
2004
|
+
if (!enumKey) {
|
|
2005
|
+
return "Error";
|
|
2006
|
+
}
|
|
2007
|
+
return enumKey.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
2008
|
+
}
|
|
2009
|
+
__name(getHttpStatusTitle, "getHttpStatusTitle");
|
|
2010
|
+
var HttpExceptionFilter2 = class _HttpExceptionFilter {
|
|
2011
|
+
static {
|
|
2012
|
+
__name(this, "HttpExceptionFilter");
|
|
2013
|
+
}
|
|
2014
|
+
logger = new Logger10(_HttpExceptionFilter.name);
|
|
2015
|
+
catch(exception, host) {
|
|
2016
|
+
const ctx = host.switchToHttp();
|
|
2017
|
+
const response = ctx.getResponse();
|
|
2018
|
+
let status = HttpStatus2.INTERNAL_SERVER_ERROR;
|
|
2019
|
+
let errors = [];
|
|
2020
|
+
let detail = "Internal server error";
|
|
2021
|
+
if (exception instanceof HttpException2) {
|
|
2022
|
+
status = exception.getStatus();
|
|
2023
|
+
const exceptionResponse = exception.getResponse();
|
|
2024
|
+
if (typeof exceptionResponse === "object" && exceptionResponse !== null) {
|
|
2025
|
+
const responseObj = exceptionResponse;
|
|
2026
|
+
if (responseObj.errors && Array.isArray(responseObj.errors)) {
|
|
2027
|
+
errors = responseObj.errors;
|
|
2028
|
+
detail = responseObj.detail || exception.message;
|
|
2029
|
+
} else if (responseObj.message && Array.isArray(responseObj.message)) {
|
|
2030
|
+
errors = responseObj.message.map((msg) => {
|
|
2031
|
+
if (typeof msg === "object" && msg.property && msg.constraints) {
|
|
2032
|
+
return {
|
|
2033
|
+
field: msg.property,
|
|
2034
|
+
message: Object.values(msg.constraints)[0]
|
|
2035
|
+
};
|
|
2036
|
+
}
|
|
2037
|
+
return {
|
|
2038
|
+
message: typeof msg === "string" ? msg : JSON.stringify(msg)
|
|
2039
|
+
};
|
|
2040
|
+
});
|
|
2041
|
+
detail = "Validation failed";
|
|
2042
|
+
} else if (responseObj.message) {
|
|
2043
|
+
errors = [
|
|
2044
|
+
{
|
|
2045
|
+
message: Array.isArray(responseObj.message) ? responseObj.message.join(", ") : responseObj.message
|
|
2046
|
+
}
|
|
2047
|
+
];
|
|
2048
|
+
detail = responseObj.error || exception.message;
|
|
2049
|
+
}
|
|
2050
|
+
} else if (typeof exceptionResponse === "string") {
|
|
2051
|
+
errors = [
|
|
2052
|
+
{
|
|
2053
|
+
message: exceptionResponse
|
|
2054
|
+
}
|
|
2055
|
+
];
|
|
2056
|
+
detail = exceptionResponse;
|
|
2057
|
+
}
|
|
2058
|
+
} else {
|
|
2059
|
+
this.logger.error("Unexpected error:", exception);
|
|
2060
|
+
errors = [
|
|
2061
|
+
{
|
|
2062
|
+
message: "An unexpected error occurred"
|
|
2063
|
+
}
|
|
2064
|
+
];
|
|
2065
|
+
}
|
|
2066
|
+
const problemDetails = {
|
|
2067
|
+
title: getHttpStatusTitle(status),
|
|
2068
|
+
status,
|
|
2069
|
+
detail,
|
|
2070
|
+
errors
|
|
2071
|
+
};
|
|
2072
|
+
response.status(status).send(problemDetails);
|
|
2073
|
+
}
|
|
2074
|
+
};
|
|
2075
|
+
HttpExceptionFilter2 = _ts_decorate14([
|
|
2076
|
+
Catch2()
|
|
2077
|
+
], HttpExceptionFilter2);
|
|
2078
|
+
|
|
2079
|
+
// src/exceptions/base-field.exception.ts
|
|
2080
|
+
import { HttpException as HttpException3, HttpStatus as HttpStatus3 } from "@nestjs/common";
|
|
2081
|
+
var BaseFieldException = class extends HttpException3 {
|
|
2082
|
+
static {
|
|
2083
|
+
__name(this, "BaseFieldException");
|
|
2084
|
+
}
|
|
2085
|
+
constructor(statusOrMessageOrErrors, messageOrStatus, statusOrDetail, detail) {
|
|
2086
|
+
let errors;
|
|
2087
|
+
let httpStatus;
|
|
2088
|
+
let finalDetail;
|
|
2089
|
+
if (Array.isArray(statusOrMessageOrErrors)) {
|
|
2090
|
+
errors = statusOrMessageOrErrors;
|
|
2091
|
+
httpStatus = messageOrStatus || HttpStatus3.BAD_REQUEST;
|
|
2092
|
+
finalDetail = typeof statusOrDetail === "string" ? statusOrDetail : void 0;
|
|
2093
|
+
} else if (typeof statusOrMessageOrErrors === "string" && typeof messageOrStatus === "string") {
|
|
2094
|
+
errors = [
|
|
2095
|
+
{
|
|
2096
|
+
field: statusOrMessageOrErrors,
|
|
2097
|
+
message: messageOrStatus
|
|
2098
|
+
}
|
|
2099
|
+
];
|
|
2100
|
+
httpStatus = statusOrDetail;
|
|
2101
|
+
finalDetail = detail;
|
|
2102
|
+
} else if (typeof statusOrMessageOrErrors === "string") {
|
|
2103
|
+
errors = [
|
|
2104
|
+
{
|
|
2105
|
+
message: statusOrMessageOrErrors
|
|
2106
|
+
}
|
|
2107
|
+
];
|
|
2108
|
+
httpStatus = messageOrStatus;
|
|
2109
|
+
finalDetail = typeof statusOrDetail === "string" ? statusOrDetail : void 0;
|
|
2110
|
+
} else {
|
|
2111
|
+
errors = [
|
|
2112
|
+
{
|
|
2113
|
+
message: "An error occurred"
|
|
2114
|
+
}
|
|
2115
|
+
];
|
|
2116
|
+
httpStatus = statusOrMessageOrErrors;
|
|
2117
|
+
finalDetail = void 0;
|
|
2118
|
+
}
|
|
2119
|
+
const response = finalDetail !== void 0 ? {
|
|
2120
|
+
errors,
|
|
2121
|
+
detail: finalDetail
|
|
2122
|
+
} : {
|
|
2123
|
+
errors
|
|
2124
|
+
};
|
|
2125
|
+
super(response, httpStatus);
|
|
2126
|
+
}
|
|
2127
|
+
};
|
|
2128
|
+
|
|
2129
|
+
// src/exceptions/bad-request.exception.ts
|
|
2130
|
+
import { HttpStatus as HttpStatus4 } from "@nestjs/common";
|
|
2131
|
+
var BadRequestException = class extends BaseFieldException {
|
|
2132
|
+
static {
|
|
2133
|
+
__name(this, "BadRequestException");
|
|
2134
|
+
}
|
|
2135
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2136
|
+
if (Array.isArray(messageOrField)) {
|
|
2137
|
+
super(messageOrField, HttpStatus4.BAD_REQUEST, fieldMessageOrDetail);
|
|
2138
|
+
} else if (detail !== void 0) {
|
|
2139
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus4.BAD_REQUEST, detail);
|
|
2140
|
+
} else if (fieldMessageOrDetail) {
|
|
2141
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus4.BAD_REQUEST);
|
|
2142
|
+
} else {
|
|
2143
|
+
super(messageOrField, HttpStatus4.BAD_REQUEST);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2147
|
+
|
|
2148
|
+
// src/exceptions/unauthorized.exception.ts
|
|
2149
|
+
import { HttpStatus as HttpStatus5 } from "@nestjs/common";
|
|
2150
|
+
var UnauthorizedException4 = class extends BaseFieldException {
|
|
2151
|
+
static {
|
|
2152
|
+
__name(this, "UnauthorizedException");
|
|
2153
|
+
}
|
|
2154
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2155
|
+
if (Array.isArray(messageOrField)) {
|
|
2156
|
+
super(messageOrField, HttpStatus5.UNAUTHORIZED, fieldMessageOrDetail);
|
|
2157
|
+
} else if (detail !== void 0) {
|
|
2158
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus5.UNAUTHORIZED, detail);
|
|
2159
|
+
} else if (fieldMessageOrDetail) {
|
|
2160
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus5.UNAUTHORIZED);
|
|
2161
|
+
} else {
|
|
2162
|
+
super(messageOrField, HttpStatus5.UNAUTHORIZED);
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
|
|
2167
|
+
// src/exceptions/forbidden.exception.ts
|
|
2168
|
+
import { HttpStatus as HttpStatus6 } from "@nestjs/common";
|
|
2169
|
+
var ForbiddenException2 = class extends BaseFieldException {
|
|
2170
|
+
static {
|
|
2171
|
+
__name(this, "ForbiddenException");
|
|
2172
|
+
}
|
|
2173
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2174
|
+
if (Array.isArray(messageOrField)) {
|
|
2175
|
+
super(messageOrField, HttpStatus6.FORBIDDEN, fieldMessageOrDetail);
|
|
2176
|
+
} else if (detail !== void 0) {
|
|
2177
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus6.FORBIDDEN, detail);
|
|
2178
|
+
} else if (fieldMessageOrDetail) {
|
|
2179
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus6.FORBIDDEN);
|
|
2180
|
+
} else {
|
|
2181
|
+
super(messageOrField, HttpStatus6.FORBIDDEN);
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
|
|
2186
|
+
// src/exceptions/not-found.exception.ts
|
|
2187
|
+
import { HttpStatus as HttpStatus7 } from "@nestjs/common";
|
|
2188
|
+
var NotFoundException = class extends BaseFieldException {
|
|
2189
|
+
static {
|
|
2190
|
+
__name(this, "NotFoundException");
|
|
2191
|
+
}
|
|
2192
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2193
|
+
if (Array.isArray(messageOrField)) {
|
|
2194
|
+
super(messageOrField, HttpStatus7.NOT_FOUND, fieldMessageOrDetail);
|
|
2195
|
+
} else if (detail !== void 0) {
|
|
2196
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus7.NOT_FOUND, detail);
|
|
2197
|
+
} else if (fieldMessageOrDetail) {
|
|
2198
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus7.NOT_FOUND);
|
|
2199
|
+
} else {
|
|
2200
|
+
super(messageOrField, HttpStatus7.NOT_FOUND);
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2205
|
+
// src/exceptions/conflict.exception.ts
|
|
2206
|
+
import { HttpStatus as HttpStatus8 } from "@nestjs/common";
|
|
2207
|
+
var ConflictException = class extends BaseFieldException {
|
|
2208
|
+
static {
|
|
2209
|
+
__name(this, "ConflictException");
|
|
2210
|
+
}
|
|
2211
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2212
|
+
if (Array.isArray(messageOrField)) {
|
|
2213
|
+
super(messageOrField, HttpStatus8.CONFLICT, fieldMessageOrDetail);
|
|
2214
|
+
} else if (detail !== void 0) {
|
|
2215
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus8.CONFLICT, detail);
|
|
2216
|
+
} else if (fieldMessageOrDetail) {
|
|
2217
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus8.CONFLICT);
|
|
2218
|
+
} else {
|
|
2219
|
+
super(messageOrField, HttpStatus8.CONFLICT);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
|
|
2224
|
+
// src/exceptions/internal-server-error.exception.ts
|
|
2225
|
+
import { HttpStatus as HttpStatus9 } from "@nestjs/common";
|
|
2226
|
+
var InternalServerErrorException3 = class extends BaseFieldException {
|
|
2227
|
+
static {
|
|
2228
|
+
__name(this, "InternalServerErrorException");
|
|
2229
|
+
}
|
|
2230
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2231
|
+
if (Array.isArray(messageOrField)) {
|
|
2232
|
+
super(messageOrField, HttpStatus9.INTERNAL_SERVER_ERROR, fieldMessageOrDetail);
|
|
2233
|
+
} else if (detail !== void 0) {
|
|
2234
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus9.INTERNAL_SERVER_ERROR, detail);
|
|
2235
|
+
} else if (fieldMessageOrDetail) {
|
|
2236
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus9.INTERNAL_SERVER_ERROR);
|
|
2237
|
+
} else {
|
|
2238
|
+
super(messageOrField, HttpStatus9.INTERNAL_SERVER_ERROR);
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2243
|
+
// src/exceptions/validation.exception.ts
|
|
2244
|
+
import { HttpStatus as HttpStatus10 } from "@nestjs/common";
|
|
2245
|
+
var ValidationException = class extends BaseFieldException {
|
|
2246
|
+
static {
|
|
2247
|
+
__name(this, "ValidationException");
|
|
2248
|
+
}
|
|
2249
|
+
constructor(errors, detail) {
|
|
2250
|
+
super(errors, HttpStatus10.BAD_REQUEST, detail);
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
|
|
2254
|
+
// src/exceptions/unprocessable-entity.exception.ts
|
|
2255
|
+
import { HttpStatus as HttpStatus11 } from "@nestjs/common";
|
|
2256
|
+
var UnprocessableEntityException = class extends BaseFieldException {
|
|
2257
|
+
static {
|
|
2258
|
+
__name(this, "UnprocessableEntityException");
|
|
2259
|
+
}
|
|
2260
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2261
|
+
if (Array.isArray(messageOrField)) {
|
|
2262
|
+
super(messageOrField, HttpStatus11.UNPROCESSABLE_ENTITY, fieldMessageOrDetail);
|
|
2263
|
+
} else if (detail !== void 0) {
|
|
2264
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus11.UNPROCESSABLE_ENTITY, detail);
|
|
2265
|
+
} else if (fieldMessageOrDetail) {
|
|
2266
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus11.UNPROCESSABLE_ENTITY);
|
|
2267
|
+
} else {
|
|
2268
|
+
super(messageOrField, HttpStatus11.UNPROCESSABLE_ENTITY);
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
};
|
|
2272
|
+
|
|
2273
|
+
// src/exceptions/too-many-requests.exception.ts
|
|
2274
|
+
import { HttpStatus as HttpStatus12 } from "@nestjs/common";
|
|
2275
|
+
var TooManyRequestsException = class extends BaseFieldException {
|
|
2276
|
+
static {
|
|
2277
|
+
__name(this, "TooManyRequestsException");
|
|
2278
|
+
}
|
|
2279
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2280
|
+
if (Array.isArray(messageOrField)) {
|
|
2281
|
+
super(messageOrField, HttpStatus12.TOO_MANY_REQUESTS, fieldMessageOrDetail);
|
|
2282
|
+
} else if (detail !== void 0) {
|
|
2283
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus12.TOO_MANY_REQUESTS, detail);
|
|
2284
|
+
} else if (fieldMessageOrDetail) {
|
|
2285
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus12.TOO_MANY_REQUESTS);
|
|
2286
|
+
} else {
|
|
2287
|
+
super(messageOrField, HttpStatus12.TOO_MANY_REQUESTS);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
};
|
|
2291
|
+
|
|
2292
|
+
// src/exceptions/service-unavailable.exception.ts
|
|
2293
|
+
import { HttpStatus as HttpStatus13 } from "@nestjs/common";
|
|
2294
|
+
var ServiceUnavailableException = class extends BaseFieldException {
|
|
2295
|
+
static {
|
|
2296
|
+
__name(this, "ServiceUnavailableException");
|
|
2297
|
+
}
|
|
2298
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2299
|
+
if (Array.isArray(messageOrField)) {
|
|
2300
|
+
super(messageOrField, HttpStatus13.SERVICE_UNAVAILABLE, fieldMessageOrDetail);
|
|
2301
|
+
} else if (detail !== void 0) {
|
|
2302
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus13.SERVICE_UNAVAILABLE, detail);
|
|
2303
|
+
} else if (fieldMessageOrDetail) {
|
|
2304
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus13.SERVICE_UNAVAILABLE);
|
|
2305
|
+
} else {
|
|
2306
|
+
super(messageOrField, HttpStatus13.SERVICE_UNAVAILABLE);
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
};
|
|
2310
|
+
|
|
2311
|
+
// src/exceptions/method-not-allowed.exception.ts
|
|
2312
|
+
import { HttpStatus as HttpStatus14 } from "@nestjs/common";
|
|
2313
|
+
var MethodNotAllowedException = class extends BaseFieldException {
|
|
2314
|
+
static {
|
|
2315
|
+
__name(this, "MethodNotAllowedException");
|
|
2316
|
+
}
|
|
2317
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2318
|
+
if (Array.isArray(messageOrField)) {
|
|
2319
|
+
super(messageOrField, HttpStatus14.METHOD_NOT_ALLOWED, fieldMessageOrDetail);
|
|
2320
|
+
} else if (detail !== void 0) {
|
|
2321
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus14.METHOD_NOT_ALLOWED, detail);
|
|
2322
|
+
} else if (fieldMessageOrDetail) {
|
|
2323
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus14.METHOD_NOT_ALLOWED);
|
|
2324
|
+
} else {
|
|
2325
|
+
super(messageOrField, HttpStatus14.METHOD_NOT_ALLOWED);
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
};
|
|
2329
|
+
|
|
2330
|
+
// src/exceptions/gone.exception.ts
|
|
2331
|
+
import { HttpStatus as HttpStatus15 } from "@nestjs/common";
|
|
2332
|
+
var GoneException = class extends BaseFieldException {
|
|
2333
|
+
static {
|
|
2334
|
+
__name(this, "GoneException");
|
|
2335
|
+
}
|
|
2336
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2337
|
+
if (Array.isArray(messageOrField)) {
|
|
2338
|
+
super(messageOrField, HttpStatus15.GONE, fieldMessageOrDetail);
|
|
2339
|
+
} else if (detail !== void 0) {
|
|
2340
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus15.GONE, detail);
|
|
2341
|
+
} else if (fieldMessageOrDetail) {
|
|
2342
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus15.GONE);
|
|
2343
|
+
} else {
|
|
2344
|
+
super(messageOrField, HttpStatus15.GONE);
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
};
|
|
2348
|
+
|
|
2349
|
+
// src/exceptions/not-acceptable.exception.ts
|
|
2350
|
+
import { HttpStatus as HttpStatus16 } from "@nestjs/common";
|
|
2351
|
+
var NotAcceptableException = class extends BaseFieldException {
|
|
2352
|
+
static {
|
|
2353
|
+
__name(this, "NotAcceptableException");
|
|
2354
|
+
}
|
|
2355
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2356
|
+
if (Array.isArray(messageOrField)) {
|
|
2357
|
+
super(messageOrField, HttpStatus16.NOT_ACCEPTABLE, fieldMessageOrDetail);
|
|
2358
|
+
} else if (detail !== void 0) {
|
|
2359
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus16.NOT_ACCEPTABLE, detail);
|
|
2360
|
+
} else if (fieldMessageOrDetail) {
|
|
2361
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus16.NOT_ACCEPTABLE);
|
|
2362
|
+
} else {
|
|
2363
|
+
super(messageOrField, HttpStatus16.NOT_ACCEPTABLE);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
};
|
|
2367
|
+
|
|
2368
|
+
// src/exceptions/request-timeout.exception.ts
|
|
2369
|
+
import { HttpStatus as HttpStatus17 } from "@nestjs/common";
|
|
2370
|
+
var RequestTimeoutException = class extends BaseFieldException {
|
|
2371
|
+
static {
|
|
2372
|
+
__name(this, "RequestTimeoutException");
|
|
2373
|
+
}
|
|
2374
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2375
|
+
if (Array.isArray(messageOrField)) {
|
|
2376
|
+
super(messageOrField, HttpStatus17.REQUEST_TIMEOUT, fieldMessageOrDetail);
|
|
2377
|
+
} else if (detail !== void 0) {
|
|
2378
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus17.REQUEST_TIMEOUT, detail);
|
|
2379
|
+
} else if (fieldMessageOrDetail) {
|
|
2380
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus17.REQUEST_TIMEOUT);
|
|
2381
|
+
} else {
|
|
2382
|
+
super(messageOrField, HttpStatus17.REQUEST_TIMEOUT);
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
};
|
|
2386
|
+
|
|
2387
|
+
// src/exceptions/payload-too-large.exception.ts
|
|
2388
|
+
import { HttpStatus as HttpStatus18 } from "@nestjs/common";
|
|
2389
|
+
var PayloadTooLargeException = class extends BaseFieldException {
|
|
2390
|
+
static {
|
|
2391
|
+
__name(this, "PayloadTooLargeException");
|
|
2392
|
+
}
|
|
2393
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2394
|
+
if (Array.isArray(messageOrField)) {
|
|
2395
|
+
super(messageOrField, HttpStatus18.PAYLOAD_TOO_LARGE, fieldMessageOrDetail);
|
|
2396
|
+
} else if (detail !== void 0) {
|
|
2397
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus18.PAYLOAD_TOO_LARGE, detail);
|
|
2398
|
+
} else if (fieldMessageOrDetail) {
|
|
2399
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus18.PAYLOAD_TOO_LARGE);
|
|
2400
|
+
} else {
|
|
2401
|
+
super(messageOrField, HttpStatus18.PAYLOAD_TOO_LARGE);
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
|
|
2406
|
+
// src/exceptions/unsupported-media-type.exception.ts
|
|
2407
|
+
import { HttpStatus as HttpStatus19 } from "@nestjs/common";
|
|
2408
|
+
var UnsupportedMediaTypeException = class extends BaseFieldException {
|
|
2409
|
+
static {
|
|
2410
|
+
__name(this, "UnsupportedMediaTypeException");
|
|
2411
|
+
}
|
|
2412
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2413
|
+
if (Array.isArray(messageOrField)) {
|
|
2414
|
+
super(messageOrField, HttpStatus19.UNSUPPORTED_MEDIA_TYPE, fieldMessageOrDetail);
|
|
2415
|
+
} else if (detail !== void 0) {
|
|
2416
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus19.UNSUPPORTED_MEDIA_TYPE, detail);
|
|
2417
|
+
} else if (fieldMessageOrDetail) {
|
|
2418
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus19.UNSUPPORTED_MEDIA_TYPE);
|
|
2419
|
+
} else {
|
|
2420
|
+
super(messageOrField, HttpStatus19.UNSUPPORTED_MEDIA_TYPE);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
};
|
|
2424
|
+
|
|
2425
|
+
// src/exceptions/not-implemented.exception.ts
|
|
2426
|
+
import { HttpStatus as HttpStatus20 } from "@nestjs/common";
|
|
2427
|
+
var NotImplementedException = class extends BaseFieldException {
|
|
2428
|
+
static {
|
|
2429
|
+
__name(this, "NotImplementedException");
|
|
2430
|
+
}
|
|
2431
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2432
|
+
if (Array.isArray(messageOrField)) {
|
|
2433
|
+
super(messageOrField, HttpStatus20.NOT_IMPLEMENTED, fieldMessageOrDetail);
|
|
2434
|
+
} else if (detail !== void 0) {
|
|
2435
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus20.NOT_IMPLEMENTED, detail);
|
|
2436
|
+
} else if (fieldMessageOrDetail) {
|
|
2437
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus20.NOT_IMPLEMENTED);
|
|
2438
|
+
} else {
|
|
2439
|
+
super(messageOrField, HttpStatus20.NOT_IMPLEMENTED);
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
};
|
|
2443
|
+
|
|
2444
|
+
// src/exceptions/bad-gateway.exception.ts
|
|
2445
|
+
import { HttpStatus as HttpStatus21 } from "@nestjs/common";
|
|
2446
|
+
var BadGatewayException = class extends BaseFieldException {
|
|
2447
|
+
static {
|
|
2448
|
+
__name(this, "BadGatewayException");
|
|
2449
|
+
}
|
|
2450
|
+
constructor(messageOrField, fieldMessageOrDetail, detail) {
|
|
2451
|
+
if (Array.isArray(messageOrField)) {
|
|
2452
|
+
super(messageOrField, HttpStatus21.BAD_GATEWAY, fieldMessageOrDetail);
|
|
2453
|
+
} else if (detail !== void 0) {
|
|
2454
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus21.BAD_GATEWAY, detail);
|
|
2455
|
+
} else if (fieldMessageOrDetail) {
|
|
2456
|
+
super(messageOrField, fieldMessageOrDetail, HttpStatus21.BAD_GATEWAY);
|
|
2457
|
+
} else {
|
|
2458
|
+
super(messageOrField, HttpStatus21.BAD_GATEWAY);
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
1980
2462
|
export {
|
|
1981
2463
|
AuthConfigModule,
|
|
2464
|
+
BadGatewayException,
|
|
2465
|
+
BadRequestException,
|
|
2466
|
+
BaseFieldException,
|
|
2467
|
+
ConflictException,
|
|
1982
2468
|
CsrfGuard,
|
|
1983
2469
|
DatabaseModule,
|
|
2470
|
+
ForbiddenException2 as ForbiddenException,
|
|
2471
|
+
GoneException,
|
|
1984
2472
|
HttpExceptionFilter,
|
|
1985
2473
|
HttpModule,
|
|
2474
|
+
InternalServerErrorException3 as InternalServerErrorException,
|
|
2475
|
+
MethodNotAllowedException,
|
|
2476
|
+
NotAcceptableException,
|
|
2477
|
+
NotFoundException,
|
|
2478
|
+
NotImplementedException,
|
|
1986
2479
|
Onboarding,
|
|
2480
|
+
PayloadTooLargeException,
|
|
1987
2481
|
PrimaryBaseRepository,
|
|
1988
2482
|
PrimaryDatabaseService,
|
|
1989
2483
|
Public,
|
|
2484
|
+
RequestTimeoutException,
|
|
2485
|
+
ServiceUnavailableException,
|
|
1990
2486
|
Tenant,
|
|
1991
2487
|
TenantBaseRepository,
|
|
1992
2488
|
TenantContextService,
|
|
1993
2489
|
TenantDatabaseService,
|
|
1994
|
-
|
|
2490
|
+
TooManyRequestsException,
|
|
2491
|
+
UnauthorizedException4 as UnauthorizedException,
|
|
2492
|
+
UnprocessableEntityException,
|
|
2493
|
+
UnsupportedMediaTypeException,
|
|
2494
|
+
ValidationException,
|
|
2495
|
+
VrittiAuthGuard,
|
|
2496
|
+
getHttpStatusTitle
|
|
1995
2497
|
};
|
|
1996
2498
|
//# sourceMappingURL=index.js.map
|