@vritti/api-sdk 0.2.9 → 0.3.1
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/cache.cjs +252 -0
- package/dist/cache.cjs.map +1 -0
- package/dist/cache.d.cts +25 -0
- package/dist/cache.d.ts +25 -0
- package/dist/cache.js +214 -0
- package/dist/cache.js.map +1 -0
- package/dist/cache.service-_SuJIcNA.d.cts +20 -0
- package/dist/cache.service-_SuJIcNA.d.ts +20 -0
- package/dist/catalog-resolver.cjs +364 -0
- package/dist/catalog-resolver.cjs.map +1 -0
- package/dist/catalog-resolver.d.cts +109 -0
- package/dist/catalog-resolver.d.ts +109 -0
- package/dist/catalog-resolver.js +330 -0
- package/dist/catalog-resolver.js.map +1 -0
- package/dist/email.cjs +691 -0
- package/dist/email.cjs.map +1 -0
- package/dist/email.d.cts +35 -0
- package/dist/email.d.ts +35 -0
- package/dist/email.js +665 -0
- package/dist/email.js.map +1 -0
- package/dist/fastify-augmentation-CQPBNS5a.d.cts +105 -0
- package/dist/fastify-augmentation-CQPBNS5a.d.ts +105 -0
- package/dist/icons.cjs +13803 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.d.cts +8 -0
- package/dist/icons.d.ts +8 -0
- package/dist/icons.js +13778 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.cjs +750 -1368
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +103 -181
- package/dist/index.d.ts +103 -181
- package/dist/index.js +609 -1234
- package/dist/index.js.map +1 -1
- package/dist/license.cjs +104 -0
- package/dist/license.cjs.map +1 -0
- package/dist/license.d.cts +32 -0
- package/dist/license.d.ts +32 -0
- package/dist/license.js +75 -0
- package/dist/license.js.map +1 -0
- package/dist/money.cjs +93 -6
- package/dist/money.cjs.map +1 -1
- package/dist/money.d.cts +13 -1
- package/dist/money.d.ts +13 -1
- package/dist/money.js +115 -3
- package/dist/money.js.map +1 -1
- package/dist/nats.cjs +196 -179
- package/dist/nats.cjs.map +1 -1
- package/dist/nats.d.cts +13 -11
- package/dist/nats.d.ts +13 -11
- package/dist/nats.js +172 -155
- package/dist/nats.js.map +1 -1
- package/dist/types-DQRwj5rr.d.cts +113 -0
- package/dist/types-DQRwj5rr.d.ts +113 -0
- package/package.json +55 -1
package/dist/index.cjs
CHANGED
|
@@ -30,24 +30,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
31
|
|
|
32
32
|
// src/index.ts
|
|
33
|
-
var
|
|
34
|
-
__export(
|
|
33
|
+
var src_exports = {};
|
|
34
|
+
__export(src_exports, {
|
|
35
35
|
AUTH_CONFIG: () => AUTH_CONFIG,
|
|
36
36
|
AUTH_CONFIG_DEFAULTS: () => AUTH_CONFIG_DEFAULTS,
|
|
37
37
|
AccessToken: () => AccessToken,
|
|
38
38
|
AuthConfigModule: () => AuthConfigModule,
|
|
39
39
|
BadGatewayException: () => BadGatewayException,
|
|
40
40
|
BadRequestException: () => BadRequestException,
|
|
41
|
-
|
|
42
|
-
CacheModule: () => CacheModule,
|
|
43
|
-
CacheService: () => CacheService,
|
|
41
|
+
ClientIp: () => ClientIp,
|
|
44
42
|
ConflictException: () => ConflictException,
|
|
45
43
|
CookieDomain: () => CookieDomain,
|
|
46
44
|
CookieName: () => CookieName,
|
|
47
45
|
CorrelationIdMiddleware: () => CorrelationIdMiddleware,
|
|
48
46
|
CreateDataTableViewDto: () => CreateDataTableViewDto,
|
|
49
47
|
CreateResponseDto: () => CreateResponseDto,
|
|
50
|
-
|
|
48
|
+
CursorCodec: () => CursorCodec,
|
|
49
|
+
CursorListResponseDto: () => CursorListResponseDto,
|
|
51
50
|
DATA_TABLE_VIEWS_TABLE: () => DATA_TABLE_VIEWS_TABLE,
|
|
52
51
|
DEFAULT_CORRELATION_HEADER: () => DEFAULT_CORRELATION_HEADER,
|
|
53
52
|
DataTableModule: () => DataTableModule,
|
|
@@ -55,8 +54,7 @@ __export(index_exports, {
|
|
|
55
54
|
DataTableViewDto: () => DataTableViewDto,
|
|
56
55
|
DataTableViewsService: () => DataTableViewsService,
|
|
57
56
|
DatabaseModule: () => DatabaseModule,
|
|
58
|
-
|
|
59
|
-
EmailService: () => EmailService,
|
|
57
|
+
ErrorCode: () => ErrorCode,
|
|
60
58
|
FilterOperators: () => FilterOperators,
|
|
61
59
|
FilterProcessor: () => FilterProcessor,
|
|
62
60
|
ForbiddenException: () => ForbiddenException2,
|
|
@@ -68,9 +66,8 @@ __export(index_exports, {
|
|
|
68
66
|
ImportResponseDto: () => ImportResponseDto,
|
|
69
67
|
ImportSummaryDto: () => ImportSummaryDto,
|
|
70
68
|
InternalServerErrorException: () => InternalServerErrorException,
|
|
71
|
-
IsCurrency: () => IsCurrency,
|
|
72
|
-
IsCurrencyCode: () => IsCurrencyCode,
|
|
73
69
|
IsDateTime: () => IsDateTime,
|
|
70
|
+
KeysetProcessor: () => KeysetProcessor,
|
|
74
71
|
LOGGER_MODULE_OPTIONS: () => LOGGER_MODULE_OPTIONS,
|
|
75
72
|
LoggerModule: () => LoggerModule,
|
|
76
73
|
LoggerService: () => LoggerService,
|
|
@@ -83,7 +80,6 @@ __export(index_exports, {
|
|
|
83
80
|
PrimaryDatabaseService: () => PrimaryDatabaseService,
|
|
84
81
|
Public: () => Public,
|
|
85
82
|
REQUIRE_SESSION_KEY: () => REQUIRE_SESSION_KEY,
|
|
86
|
-
RedisCacheProvider: () => RedisCacheProvider,
|
|
87
83
|
RefreshCookieOptions: () => RefreshCookieOptions,
|
|
88
84
|
RefreshTokenCookie: () => RefreshTokenCookie,
|
|
89
85
|
RenameDataTableViewDto: () => RenameDataTableViewDto,
|
|
@@ -91,7 +87,6 @@ __export(index_exports, {
|
|
|
91
87
|
RequireSession: () => RequireSession,
|
|
92
88
|
RootModule: () => RootModule,
|
|
93
89
|
SKIP_CSRF_KEY: () => SKIP_CSRF_KEY,
|
|
94
|
-
SUPPORTED_CURRENCIES: () => SUPPORTED_CURRENCIES,
|
|
95
90
|
SelectOptionsQueryDto: () => SelectOptionsQueryDto,
|
|
96
91
|
ServiceUnavailableException: () => ServiceUnavailableException,
|
|
97
92
|
SessionData: () => SessionData,
|
|
@@ -103,6 +98,7 @@ __export(index_exports, {
|
|
|
103
98
|
TokenService: () => TokenService,
|
|
104
99
|
TokenType: () => TokenType,
|
|
105
100
|
TooManyRequestsException: () => TooManyRequestsException,
|
|
101
|
+
TransportAwareExceptionFilter: () => TransportAwareExceptionFilter,
|
|
106
102
|
UnauthorizedException: () => UnauthorizedException3,
|
|
107
103
|
UnprocessableEntityException: () => UnprocessableEntityException,
|
|
108
104
|
UnsupportedMediaTypeException: () => UnsupportedMediaTypeException,
|
|
@@ -110,29 +106,35 @@ __export(index_exports, {
|
|
|
110
106
|
UploadedFile: () => UploadedFile,
|
|
111
107
|
UploadedFiles: () => UploadedFiles,
|
|
112
108
|
UpsertDataTableStateDto: () => UpsertDataTableStateDto,
|
|
109
|
+
UserAgent: () => UserAgent,
|
|
113
110
|
UserId: () => UserId,
|
|
114
111
|
ValidatedRowDto: () => ValidatedRowDto,
|
|
115
112
|
ValidationException: () => ValidationException,
|
|
116
113
|
VrittiAuthGuard: () => VrittiAuthGuard,
|
|
117
114
|
addCorrelationIdToResponse: () => addCorrelationIdToResponse,
|
|
118
115
|
correlationStorage: () => correlationStorage,
|
|
116
|
+
createGraphqlFormatError: () => createGraphqlFormatError,
|
|
119
117
|
dataTableViewsColumns: () => dataTableViewsColumns,
|
|
120
118
|
dataTableViewsIndexes: () => dataTableViewsIndexes,
|
|
119
|
+
errorCodeFromStatus: () => errorCodeFromStatus,
|
|
121
120
|
extractCountryFromPhone: () => extractCountryFromPhone,
|
|
122
121
|
gcd: () => gcd,
|
|
123
122
|
generateCorrelationId: () => generateCorrelationId,
|
|
124
123
|
getCorrelationContext: () => getCorrelationContext,
|
|
125
124
|
getHttpStatusTitle: () => getHttpStatusTitle,
|
|
125
|
+
getRequestFromContext: () => getRequestFromContext,
|
|
126
|
+
getResponseFromContext: () => getResponseFromContext,
|
|
126
127
|
hashToken: () => hashToken,
|
|
127
|
-
majorToMinor: () => majorToMinor,
|
|
128
|
-
minorToMajor: () => minorToMajor,
|
|
129
128
|
normalizePhoneNumber: () => normalizePhoneNumber,
|
|
130
129
|
parseExpiryToMs: () => parseExpiryToMs,
|
|
130
|
+
registerTransport: () => registerTransport,
|
|
131
|
+
resolveExtractor: () => resolveExtractor,
|
|
132
|
+
resolveInjectedRequest: () => resolveInjectedRequest,
|
|
131
133
|
runWithCorrelationContext: () => runWithCorrelationContext,
|
|
132
134
|
updateCorrelationContext: () => updateCorrelationContext,
|
|
133
135
|
verifyTokenHash: () => verifyTokenHash
|
|
134
136
|
});
|
|
135
|
-
module.exports = __toCommonJS(
|
|
137
|
+
module.exports = __toCommonJS(src_exports);
|
|
136
138
|
|
|
137
139
|
// src/auth/auth.config.ts
|
|
138
140
|
var AUTH_CONFIG = Symbol("AUTH_CONFIG");
|
|
@@ -149,6 +151,7 @@ var AUTH_CONFIG_DEFAULTS = {
|
|
|
149
151
|
authHeaderName: "authorization",
|
|
150
152
|
tokenPrefix: "Bearer",
|
|
151
153
|
csrfExemptSessionTypes: [],
|
|
154
|
+
csrfExemptTransports: [],
|
|
152
155
|
refreshTokenBindingExemptSessionTypes: []
|
|
153
156
|
}
|
|
154
157
|
};
|
|
@@ -170,6 +173,18 @@ var import_common2 = require("@nestjs/common");
|
|
|
170
173
|
// src/request/services/request.service.ts
|
|
171
174
|
var import_common = require("@nestjs/common");
|
|
172
175
|
var import_core = require("@nestjs/core");
|
|
176
|
+
|
|
177
|
+
// src/context/resolve-request.ts
|
|
178
|
+
function resolveInjectedRequest(injected) {
|
|
179
|
+
const candidate = injected;
|
|
180
|
+
if (candidate && candidate.headers === void 0 && candidate.req) {
|
|
181
|
+
return candidate.req;
|
|
182
|
+
}
|
|
183
|
+
return injected;
|
|
184
|
+
}
|
|
185
|
+
__name(resolveInjectedRequest, "resolveInjectedRequest");
|
|
186
|
+
|
|
187
|
+
// src/request/services/request.service.ts
|
|
173
188
|
function _ts_decorate(decorators, target, key, desc3) {
|
|
174
189
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
175
190
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
@@ -191,12 +206,17 @@ var RequestService = class {
|
|
|
191
206
|
static {
|
|
192
207
|
__name(this, "RequestService");
|
|
193
208
|
}
|
|
194
|
-
|
|
209
|
+
injectedRequest;
|
|
195
210
|
config;
|
|
196
|
-
constructor(
|
|
197
|
-
this.
|
|
211
|
+
constructor(injectedRequest, config) {
|
|
212
|
+
this.injectedRequest = injectedRequest;
|
|
198
213
|
this.config = config;
|
|
199
214
|
}
|
|
215
|
+
// For GraphQL, @Inject(REQUEST) is the { req, reply } context wrapper, not the Fastify request;
|
|
216
|
+
// unwrap so every accessor below works identically across both transports.
|
|
217
|
+
get request() {
|
|
218
|
+
return resolveInjectedRequest(this.injectedRequest);
|
|
219
|
+
}
|
|
200
220
|
// Extracts the bearer access token from the Authorization header
|
|
201
221
|
getAccessToken() {
|
|
202
222
|
const authHeader = this.request.headers?.[this.config.guard.authHeaderName];
|
|
@@ -277,6 +297,50 @@ var import_common6 = require("@nestjs/common");
|
|
|
277
297
|
var import_constants = require("@nestjs/common/constants");
|
|
278
298
|
var import_core2 = require("@nestjs/core");
|
|
279
299
|
|
|
300
|
+
// src/context/extractors/graphql.extractor.ts
|
|
301
|
+
var graphqlExtractor = {
|
|
302
|
+
getRequest: /* @__PURE__ */ __name((host) => host.getArgByIndex(2).req, "getRequest"),
|
|
303
|
+
getResponse: /* @__PURE__ */ __name((host) => host.getArgByIndex(2).reply, "getResponse")
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
// src/context/extractors/http.extractor.ts
|
|
307
|
+
var httpExtractor = {
|
|
308
|
+
getRequest: /* @__PURE__ */ __name((host) => host.switchToHttp().getRequest(), "getRequest"),
|
|
309
|
+
getResponse: /* @__PURE__ */ __name((host) => host.switchToHttp().getResponse(), "getResponse")
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// src/context/context.registry.ts
|
|
313
|
+
var registry = /* @__PURE__ */ new Map([
|
|
314
|
+
[
|
|
315
|
+
"http",
|
|
316
|
+
httpExtractor
|
|
317
|
+
],
|
|
318
|
+
[
|
|
319
|
+
"graphql",
|
|
320
|
+
graphqlExtractor
|
|
321
|
+
]
|
|
322
|
+
]);
|
|
323
|
+
function registerTransport(type, extractor) {
|
|
324
|
+
registry.set(type, extractor);
|
|
325
|
+
}
|
|
326
|
+
__name(registerTransport, "registerTransport");
|
|
327
|
+
function resolveExtractor(type) {
|
|
328
|
+
return registry.get(type) ?? httpExtractor;
|
|
329
|
+
}
|
|
330
|
+
__name(resolveExtractor, "resolveExtractor");
|
|
331
|
+
|
|
332
|
+
// src/context/get-request.ts
|
|
333
|
+
function getRequestFromContext(host) {
|
|
334
|
+
return resolveExtractor(host.getType()).getRequest(host);
|
|
335
|
+
}
|
|
336
|
+
__name(getRequestFromContext, "getRequestFromContext");
|
|
337
|
+
|
|
338
|
+
// src/context/get-response.ts
|
|
339
|
+
function getResponseFromContext(host) {
|
|
340
|
+
return resolveExtractor(host.getType()).getResponse(host);
|
|
341
|
+
}
|
|
342
|
+
__name(getResponseFromContext, "getResponseFromContext");
|
|
343
|
+
|
|
280
344
|
// src/auth/decorators/require-session.decorator.ts
|
|
281
345
|
var import_common3 = require("@nestjs/common");
|
|
282
346
|
var REQUIRE_SESSION_KEY = "requiredSessionTypes";
|
|
@@ -295,7 +359,8 @@ var import_jwt = require("@nestjs/jwt");
|
|
|
295
359
|
function parseExpiryToMs(expiry) {
|
|
296
360
|
const match = expiry.match(/^(\d+)([smhdwy])$/);
|
|
297
361
|
if (!match) throw new Error(`Invalid expiry format: ${expiry}`);
|
|
298
|
-
const
|
|
362
|
+
const [, digits = "", unit = ""] = match;
|
|
363
|
+
const value = Number.parseInt(digits, 10);
|
|
299
364
|
const multipliers = {
|
|
300
365
|
s: 1e3,
|
|
301
366
|
m: 6e4,
|
|
@@ -304,7 +369,9 @@ function parseExpiryToMs(expiry) {
|
|
|
304
369
|
w: 6048e5,
|
|
305
370
|
y: 31536e6
|
|
306
371
|
};
|
|
307
|
-
|
|
372
|
+
const multiplier = multipliers[unit];
|
|
373
|
+
if (multiplier === void 0) throw new Error(`Invalid expiry format: ${expiry}`);
|
|
374
|
+
return value * multiplier;
|
|
308
375
|
}
|
|
309
376
|
__name(parseExpiryToMs, "parseExpiryToMs");
|
|
310
377
|
|
|
@@ -491,14 +558,15 @@ var VrittiAuthGuard = class _VrittiAuthGuard {
|
|
|
491
558
|
this.config = config;
|
|
492
559
|
}
|
|
493
560
|
async canActivate(context) {
|
|
494
|
-
const request = context
|
|
495
|
-
const reply = context
|
|
561
|
+
const request = getRequestFromContext(context);
|
|
562
|
+
const reply = getResponseFromContext(context);
|
|
496
563
|
const route = `${request.method} ${request.url}`;
|
|
497
564
|
request.authConfig = this.config;
|
|
565
|
+
const csrfExemptTransports = this.config.guard.csrfExemptTransports ?? [];
|
|
498
566
|
const skipCsrf = this.reflector.getAllAndOverride(SKIP_CSRF_KEY, [
|
|
499
567
|
context.getHandler(),
|
|
500
568
|
context.getClass()
|
|
501
|
-
]);
|
|
569
|
+
]) || csrfExemptTransports.includes(context.getType());
|
|
502
570
|
const isPublic = this.reflector.getAllAndOverride("isPublic", [
|
|
503
571
|
context.getHandler(),
|
|
504
572
|
context.getClass()
|
|
@@ -711,15 +779,21 @@ AuthConfigModule = _ts_decorate5([
|
|
|
711
779
|
// src/auth/decorators/access-token.decorator.ts
|
|
712
780
|
var import_common8 = require("@nestjs/common");
|
|
713
781
|
var AccessToken = (0, import_common8.createParamDecorator)((_data, ctx) => {
|
|
714
|
-
const request = ctx
|
|
782
|
+
const request = getRequestFromContext(ctx);
|
|
715
783
|
const authHeader = request.headers.authorization;
|
|
716
784
|
return authHeader?.replace("Bearer ", "") || "";
|
|
717
785
|
});
|
|
718
786
|
|
|
719
|
-
// src/auth/decorators/
|
|
787
|
+
// src/auth/decorators/client-ip.decorator.ts
|
|
720
788
|
var import_common9 = require("@nestjs/common");
|
|
721
|
-
var
|
|
722
|
-
|
|
789
|
+
var ClientIp = (0, import_common9.createParamDecorator)((_data, ctx) => {
|
|
790
|
+
return getRequestFromContext(ctx).ip;
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
// src/auth/decorators/cookie-domain.decorator.ts
|
|
794
|
+
var import_common10 = require("@nestjs/common");
|
|
795
|
+
var CookieDomain = (0, import_common10.createParamDecorator)((_data, ctx) => {
|
|
796
|
+
const request = getRequestFromContext(ctx);
|
|
723
797
|
const forwarded = request.headers["x-forwarded-host"];
|
|
724
798
|
const raw = Array.isArray(forwarded) ? forwarded[0] : forwarded;
|
|
725
799
|
const hostStr = raw ?? request.hostname;
|
|
@@ -729,16 +803,16 @@ var CookieDomain = (0, import_common9.createParamDecorator)((_data, ctx) => {
|
|
|
729
803
|
});
|
|
730
804
|
|
|
731
805
|
// src/auth/decorators/cookie-name.decorator.ts
|
|
732
|
-
var
|
|
733
|
-
var CookieName = (0,
|
|
734
|
-
const request = ctx
|
|
806
|
+
var import_common11 = require("@nestjs/common");
|
|
807
|
+
var CookieName = (0, import_common11.createParamDecorator)((_data, ctx) => {
|
|
808
|
+
const request = getRequestFromContext(ctx);
|
|
735
809
|
return request.authConfig?.cookie.refreshCookieName ?? AUTH_CONFIG_DEFAULTS.cookie.refreshCookieName;
|
|
736
810
|
});
|
|
737
811
|
|
|
738
812
|
// src/auth/decorators/hostname.decorator.ts
|
|
739
|
-
var
|
|
740
|
-
var Hostname = (0,
|
|
741
|
-
const request = ctx
|
|
813
|
+
var import_common12 = require("@nestjs/common");
|
|
814
|
+
var Hostname = (0, import_common12.createParamDecorator)((_data, ctx) => {
|
|
815
|
+
const request = getRequestFromContext(ctx);
|
|
742
816
|
const forwarded = request.headers["x-forwarded-host"];
|
|
743
817
|
const raw = Array.isArray(forwarded) ? forwarded[0] : forwarded;
|
|
744
818
|
const hostStr = raw ?? request.hostname;
|
|
@@ -746,18 +820,18 @@ var Hostname = (0, import_common11.createParamDecorator)((_data, ctx) => {
|
|
|
746
820
|
});
|
|
747
821
|
|
|
748
822
|
// src/auth/decorators/public.decorator.ts
|
|
749
|
-
var
|
|
750
|
-
var Public = /* @__PURE__ */ __name(() => (0,
|
|
823
|
+
var import_common13 = require("@nestjs/common");
|
|
824
|
+
var Public = /* @__PURE__ */ __name(() => (0, import_common13.SetMetadata)("isPublic", true), "Public");
|
|
751
825
|
|
|
752
826
|
// src/auth/decorators/refresh-cookie-options.decorator.ts
|
|
753
|
-
var
|
|
827
|
+
var import_common33 = require("@nestjs/common");
|
|
754
828
|
|
|
755
829
|
// src/exceptions/bad-gateway.exception.ts
|
|
756
|
-
var
|
|
830
|
+
var import_common15 = require("@nestjs/common");
|
|
757
831
|
|
|
758
832
|
// src/exceptions/base-field.exception.ts
|
|
759
|
-
var
|
|
760
|
-
var HttpProblemException = class extends
|
|
833
|
+
var import_common14 = require("@nestjs/common");
|
|
834
|
+
var HttpProblemException = class extends import_common14.HttpException {
|
|
761
835
|
static {
|
|
762
836
|
__name(this, "HttpProblemException");
|
|
763
837
|
}
|
|
@@ -780,194 +854,194 @@ var BadGatewayException = class extends HttpProblemException {
|
|
|
780
854
|
__name(this, "BadGatewayException");
|
|
781
855
|
}
|
|
782
856
|
constructor(detailOrOptions) {
|
|
783
|
-
super(detailOrOptions ?? "Bad Gateway",
|
|
857
|
+
super(detailOrOptions ?? "Bad Gateway", import_common15.HttpStatus.BAD_GATEWAY);
|
|
784
858
|
}
|
|
785
859
|
};
|
|
786
860
|
|
|
787
861
|
// src/exceptions/bad-request.exception.ts
|
|
788
|
-
var
|
|
862
|
+
var import_common16 = require("@nestjs/common");
|
|
789
863
|
var BadRequestException = class extends HttpProblemException {
|
|
790
864
|
static {
|
|
791
865
|
__name(this, "BadRequestException");
|
|
792
866
|
}
|
|
793
867
|
constructor(detailOrOptions) {
|
|
794
|
-
super(detailOrOptions ?? "Bad Request",
|
|
868
|
+
super(detailOrOptions ?? "Bad Request", import_common16.HttpStatus.BAD_REQUEST);
|
|
795
869
|
}
|
|
796
870
|
};
|
|
797
871
|
|
|
798
872
|
// src/exceptions/conflict.exception.ts
|
|
799
|
-
var
|
|
873
|
+
var import_common17 = require("@nestjs/common");
|
|
800
874
|
var ConflictException = class extends HttpProblemException {
|
|
801
875
|
static {
|
|
802
876
|
__name(this, "ConflictException");
|
|
803
877
|
}
|
|
804
878
|
constructor(detailOrOptions) {
|
|
805
|
-
super(detailOrOptions ?? "Conflict",
|
|
879
|
+
super(detailOrOptions ?? "Conflict", import_common17.HttpStatus.CONFLICT);
|
|
806
880
|
}
|
|
807
881
|
};
|
|
808
882
|
|
|
809
883
|
// src/exceptions/forbidden.exception.ts
|
|
810
|
-
var
|
|
884
|
+
var import_common18 = require("@nestjs/common");
|
|
811
885
|
var ForbiddenException2 = class extends HttpProblemException {
|
|
812
886
|
static {
|
|
813
887
|
__name(this, "ForbiddenException");
|
|
814
888
|
}
|
|
815
889
|
constructor(detailOrOptions) {
|
|
816
|
-
super(detailOrOptions ?? "Forbidden",
|
|
890
|
+
super(detailOrOptions ?? "Forbidden", import_common18.HttpStatus.FORBIDDEN);
|
|
817
891
|
}
|
|
818
892
|
};
|
|
819
893
|
|
|
820
894
|
// src/exceptions/gone.exception.ts
|
|
821
|
-
var
|
|
895
|
+
var import_common19 = require("@nestjs/common");
|
|
822
896
|
var GoneException = class extends HttpProblemException {
|
|
823
897
|
static {
|
|
824
898
|
__name(this, "GoneException");
|
|
825
899
|
}
|
|
826
900
|
constructor(detailOrOptions) {
|
|
827
|
-
super(detailOrOptions ?? "Gone",
|
|
901
|
+
super(detailOrOptions ?? "Gone", import_common19.HttpStatus.GONE);
|
|
828
902
|
}
|
|
829
903
|
};
|
|
830
904
|
|
|
831
905
|
// src/exceptions/internal-server-error.exception.ts
|
|
832
|
-
var
|
|
906
|
+
var import_common20 = require("@nestjs/common");
|
|
833
907
|
var InternalServerErrorException = class extends HttpProblemException {
|
|
834
908
|
static {
|
|
835
909
|
__name(this, "InternalServerErrorException");
|
|
836
910
|
}
|
|
837
911
|
constructor(detailOrOptions) {
|
|
838
|
-
super(detailOrOptions ?? "Internal Server Error",
|
|
912
|
+
super(detailOrOptions ?? "Internal Server Error", import_common20.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
839
913
|
}
|
|
840
914
|
};
|
|
841
915
|
|
|
842
916
|
// src/exceptions/method-not-allowed.exception.ts
|
|
843
|
-
var
|
|
917
|
+
var import_common21 = require("@nestjs/common");
|
|
844
918
|
var MethodNotAllowedException = class extends HttpProblemException {
|
|
845
919
|
static {
|
|
846
920
|
__name(this, "MethodNotAllowedException");
|
|
847
921
|
}
|
|
848
922
|
constructor(detailOrOptions) {
|
|
849
|
-
super(detailOrOptions ?? "Method Not Allowed",
|
|
923
|
+
super(detailOrOptions ?? "Method Not Allowed", import_common21.HttpStatus.METHOD_NOT_ALLOWED);
|
|
850
924
|
}
|
|
851
925
|
};
|
|
852
926
|
|
|
853
927
|
// src/exceptions/not-acceptable.exception.ts
|
|
854
|
-
var
|
|
928
|
+
var import_common22 = require("@nestjs/common");
|
|
855
929
|
var NotAcceptableException = class extends HttpProblemException {
|
|
856
930
|
static {
|
|
857
931
|
__name(this, "NotAcceptableException");
|
|
858
932
|
}
|
|
859
933
|
constructor(detailOrOptions) {
|
|
860
|
-
super(detailOrOptions ?? "Not Acceptable",
|
|
934
|
+
super(detailOrOptions ?? "Not Acceptable", import_common22.HttpStatus.NOT_ACCEPTABLE);
|
|
861
935
|
}
|
|
862
936
|
};
|
|
863
937
|
|
|
864
938
|
// src/exceptions/not-found.exception.ts
|
|
865
|
-
var
|
|
939
|
+
var import_common23 = require("@nestjs/common");
|
|
866
940
|
var NotFoundException = class extends HttpProblemException {
|
|
867
941
|
static {
|
|
868
942
|
__name(this, "NotFoundException");
|
|
869
943
|
}
|
|
870
944
|
constructor(detailOrOptions) {
|
|
871
|
-
super(detailOrOptions ?? "Not Found",
|
|
945
|
+
super(detailOrOptions ?? "Not Found", import_common23.HttpStatus.NOT_FOUND);
|
|
872
946
|
}
|
|
873
947
|
};
|
|
874
948
|
|
|
875
949
|
// src/exceptions/not-implemented.exception.ts
|
|
876
|
-
var
|
|
950
|
+
var import_common24 = require("@nestjs/common");
|
|
877
951
|
var NotImplementedException = class extends HttpProblemException {
|
|
878
952
|
static {
|
|
879
953
|
__name(this, "NotImplementedException");
|
|
880
954
|
}
|
|
881
955
|
constructor(detailOrOptions) {
|
|
882
|
-
super(detailOrOptions ?? "Not Implemented",
|
|
956
|
+
super(detailOrOptions ?? "Not Implemented", import_common24.HttpStatus.NOT_IMPLEMENTED);
|
|
883
957
|
}
|
|
884
958
|
};
|
|
885
959
|
|
|
886
960
|
// src/exceptions/payload-too-large.exception.ts
|
|
887
|
-
var
|
|
961
|
+
var import_common25 = require("@nestjs/common");
|
|
888
962
|
var PayloadTooLargeException = class extends HttpProblemException {
|
|
889
963
|
static {
|
|
890
964
|
__name(this, "PayloadTooLargeException");
|
|
891
965
|
}
|
|
892
966
|
constructor(detailOrOptions) {
|
|
893
|
-
super(detailOrOptions ?? "Payload Too Large",
|
|
967
|
+
super(detailOrOptions ?? "Payload Too Large", import_common25.HttpStatus.PAYLOAD_TOO_LARGE);
|
|
894
968
|
}
|
|
895
969
|
};
|
|
896
970
|
|
|
897
971
|
// src/exceptions/request-timeout.exception.ts
|
|
898
|
-
var
|
|
972
|
+
var import_common26 = require("@nestjs/common");
|
|
899
973
|
var RequestTimeoutException = class extends HttpProblemException {
|
|
900
974
|
static {
|
|
901
975
|
__name(this, "RequestTimeoutException");
|
|
902
976
|
}
|
|
903
977
|
constructor(detailOrOptions) {
|
|
904
|
-
super(detailOrOptions ?? "Request Timeout",
|
|
978
|
+
super(detailOrOptions ?? "Request Timeout", import_common26.HttpStatus.REQUEST_TIMEOUT);
|
|
905
979
|
}
|
|
906
980
|
};
|
|
907
981
|
|
|
908
982
|
// src/exceptions/service-unavailable.exception.ts
|
|
909
|
-
var
|
|
983
|
+
var import_common27 = require("@nestjs/common");
|
|
910
984
|
var ServiceUnavailableException = class extends HttpProblemException {
|
|
911
985
|
static {
|
|
912
986
|
__name(this, "ServiceUnavailableException");
|
|
913
987
|
}
|
|
914
988
|
constructor(detailOrOptions) {
|
|
915
|
-
super(detailOrOptions ?? "Service Unavailable",
|
|
989
|
+
super(detailOrOptions ?? "Service Unavailable", import_common27.HttpStatus.SERVICE_UNAVAILABLE);
|
|
916
990
|
}
|
|
917
991
|
};
|
|
918
992
|
|
|
919
993
|
// src/exceptions/too-many-requests.exception.ts
|
|
920
|
-
var
|
|
994
|
+
var import_common28 = require("@nestjs/common");
|
|
921
995
|
var TooManyRequestsException = class extends HttpProblemException {
|
|
922
996
|
static {
|
|
923
997
|
__name(this, "TooManyRequestsException");
|
|
924
998
|
}
|
|
925
999
|
constructor(detailOrOptions) {
|
|
926
|
-
super(detailOrOptions ?? "Too Many Requests",
|
|
1000
|
+
super(detailOrOptions ?? "Too Many Requests", import_common28.HttpStatus.TOO_MANY_REQUESTS);
|
|
927
1001
|
}
|
|
928
1002
|
};
|
|
929
1003
|
|
|
930
1004
|
// src/exceptions/unauthorized.exception.ts
|
|
931
|
-
var
|
|
1005
|
+
var import_common29 = require("@nestjs/common");
|
|
932
1006
|
var UnauthorizedException3 = class extends HttpProblemException {
|
|
933
1007
|
static {
|
|
934
1008
|
__name(this, "UnauthorizedException");
|
|
935
1009
|
}
|
|
936
1010
|
constructor(detailOrOptions) {
|
|
937
|
-
super(detailOrOptions ?? "Unauthorized",
|
|
1011
|
+
super(detailOrOptions ?? "Unauthorized", import_common29.HttpStatus.UNAUTHORIZED);
|
|
938
1012
|
}
|
|
939
1013
|
};
|
|
940
1014
|
|
|
941
1015
|
// src/exceptions/unprocessable-entity.exception.ts
|
|
942
|
-
var
|
|
1016
|
+
var import_common30 = require("@nestjs/common");
|
|
943
1017
|
var UnprocessableEntityException = class extends HttpProblemException {
|
|
944
1018
|
static {
|
|
945
1019
|
__name(this, "UnprocessableEntityException");
|
|
946
1020
|
}
|
|
947
1021
|
constructor(detailOrOptions) {
|
|
948
|
-
super(detailOrOptions ?? "Unprocessable Entity",
|
|
1022
|
+
super(detailOrOptions ?? "Unprocessable Entity", import_common30.HttpStatus.UNPROCESSABLE_ENTITY);
|
|
949
1023
|
}
|
|
950
1024
|
};
|
|
951
1025
|
|
|
952
1026
|
// src/exceptions/unsupported-media-type.exception.ts
|
|
953
|
-
var
|
|
1027
|
+
var import_common31 = require("@nestjs/common");
|
|
954
1028
|
var UnsupportedMediaTypeException = class extends HttpProblemException {
|
|
955
1029
|
static {
|
|
956
1030
|
__name(this, "UnsupportedMediaTypeException");
|
|
957
1031
|
}
|
|
958
1032
|
constructor(detailOrOptions) {
|
|
959
|
-
super(detailOrOptions ?? "Unsupported Media Type",
|
|
1033
|
+
super(detailOrOptions ?? "Unsupported Media Type", import_common31.HttpStatus.UNSUPPORTED_MEDIA_TYPE);
|
|
960
1034
|
}
|
|
961
1035
|
};
|
|
962
1036
|
|
|
963
1037
|
// src/exceptions/validation.exception.ts
|
|
964
|
-
var
|
|
1038
|
+
var import_common32 = require("@nestjs/common");
|
|
965
1039
|
var ValidationException = class extends HttpProblemException {
|
|
966
1040
|
static {
|
|
967
1041
|
__name(this, "ValidationException");
|
|
968
1042
|
}
|
|
969
1043
|
constructor(detailOrOptions) {
|
|
970
|
-
super(detailOrOptions ?? "Validation Failed",
|
|
1044
|
+
super(detailOrOptions ?? "Validation Failed", import_common32.HttpStatus.UNPROCESSABLE_ENTITY);
|
|
971
1045
|
}
|
|
972
1046
|
};
|
|
973
1047
|
|
|
@@ -990,8 +1064,8 @@ function buildCookieOptionsForHost(cookieConfig, hostname) {
|
|
|
990
1064
|
};
|
|
991
1065
|
}
|
|
992
1066
|
__name(buildCookieOptionsForHost, "buildCookieOptionsForHost");
|
|
993
|
-
var RefreshCookieOptions = (0,
|
|
994
|
-
const request = ctx
|
|
1067
|
+
var RefreshCookieOptions = (0, import_common33.createParamDecorator)((_data, ctx) => {
|
|
1068
|
+
const request = getRequestFromContext(ctx);
|
|
995
1069
|
const forwarded = request.headers["x-forwarded-host"];
|
|
996
1070
|
const raw = Array.isArray(forwarded) ? forwarded[0] : forwarded;
|
|
997
1071
|
const hostStr = raw ?? request.hostname;
|
|
@@ -1001,18 +1075,18 @@ var RefreshCookieOptions = (0, import_common32.createParamDecorator)((_data, ctx
|
|
|
1001
1075
|
});
|
|
1002
1076
|
|
|
1003
1077
|
// src/auth/decorators/refresh-token-cookie.decorator.ts
|
|
1004
|
-
var
|
|
1005
|
-
var RefreshTokenCookie = (0,
|
|
1006
|
-
const request = ctx
|
|
1078
|
+
var import_common34 = require("@nestjs/common");
|
|
1079
|
+
var RefreshTokenCookie = (0, import_common34.createParamDecorator)((_data, ctx) => {
|
|
1080
|
+
const request = getRequestFromContext(ctx);
|
|
1007
1081
|
const cookies = request.cookies ?? {};
|
|
1008
1082
|
const cookieName = request.authConfig?.cookie.refreshCookieName ?? AUTH_CONFIG_DEFAULTS.cookie.refreshCookieName;
|
|
1009
1083
|
return cookies[cookieName];
|
|
1010
1084
|
});
|
|
1011
1085
|
|
|
1012
1086
|
// src/auth/decorators/session-data.decorator.ts
|
|
1013
|
-
var
|
|
1014
|
-
var SessionData = (0,
|
|
1015
|
-
const request = ctx
|
|
1087
|
+
var import_common35 = require("@nestjs/common");
|
|
1088
|
+
var SessionData = (0, import_common35.createParamDecorator)((_data, ctx) => {
|
|
1089
|
+
const request = getRequestFromContext(ctx);
|
|
1016
1090
|
const sessionInfo = request.sessionInfo;
|
|
1017
1091
|
if (!sessionInfo?.sessionId) {
|
|
1018
1092
|
throw new Error("Session info not found on request. Ensure route is protected by auth guard.");
|
|
@@ -1025,9 +1099,9 @@ var SessionData = (0, import_common34.createParamDecorator)((_data, ctx) => {
|
|
|
1025
1099
|
});
|
|
1026
1100
|
|
|
1027
1101
|
// src/auth/decorators/subdomain.decorator.ts
|
|
1028
|
-
var
|
|
1029
|
-
var Subdomain = (0,
|
|
1030
|
-
const request = ctx
|
|
1102
|
+
var import_common36 = require("@nestjs/common");
|
|
1103
|
+
var Subdomain = (0, import_common36.createParamDecorator)((_data, ctx) => {
|
|
1104
|
+
const request = getRequestFromContext(ctx);
|
|
1031
1105
|
const origin = request.headers.origin;
|
|
1032
1106
|
if (origin) {
|
|
1033
1107
|
try {
|
|
@@ -1042,10 +1116,17 @@ var Subdomain = (0, import_common35.createParamDecorator)((_data, ctx) => {
|
|
|
1042
1116
|
return void 0;
|
|
1043
1117
|
});
|
|
1044
1118
|
|
|
1119
|
+
// src/auth/decorators/user-agent.decorator.ts
|
|
1120
|
+
var import_common37 = require("@nestjs/common");
|
|
1121
|
+
var UserAgent = (0, import_common37.createParamDecorator)((_data, ctx) => {
|
|
1122
|
+
const userAgent = getRequestFromContext(ctx).headers["user-agent"];
|
|
1123
|
+
return Array.isArray(userAgent) ? userAgent[0] : userAgent;
|
|
1124
|
+
});
|
|
1125
|
+
|
|
1045
1126
|
// src/auth/decorators/user-id.decorator.ts
|
|
1046
|
-
var
|
|
1047
|
-
var UserId = (0,
|
|
1048
|
-
const request = ctx
|
|
1127
|
+
var import_common38 = require("@nestjs/common");
|
|
1128
|
+
var UserId = (0, import_common38.createParamDecorator)((_data, ctx) => {
|
|
1129
|
+
const request = getRequestFromContext(ctx);
|
|
1049
1130
|
const sessionInfo = request.sessionInfo;
|
|
1050
1131
|
if (!sessionInfo?.userId) {
|
|
1051
1132
|
throw new Error("User ID not found on request. Ensure route is protected by auth guard.");
|
|
@@ -1053,12 +1134,16 @@ var UserId = (0, import_common36.createParamDecorator)((_data, ctx) => {
|
|
|
1053
1134
|
return sessionInfo.userId;
|
|
1054
1135
|
});
|
|
1055
1136
|
|
|
1137
|
+
// src/data-table/data-table.module.ts
|
|
1138
|
+
var import_common51 = require("@nestjs/common");
|
|
1139
|
+
var import_config6 = require("@nestjs/config");
|
|
1140
|
+
|
|
1056
1141
|
// src/cache/cache.module.ts
|
|
1057
|
-
var
|
|
1142
|
+
var import_common41 = require("@nestjs/common");
|
|
1058
1143
|
var import_config3 = require("@nestjs/config");
|
|
1059
1144
|
|
|
1060
1145
|
// src/cache/cache.service.ts
|
|
1061
|
-
var
|
|
1146
|
+
var import_common39 = require("@nestjs/common");
|
|
1062
1147
|
|
|
1063
1148
|
// src/cache/constants.ts
|
|
1064
1149
|
var CACHE_PROVIDER = Symbol("CACHE_PROVIDER");
|
|
@@ -1086,7 +1171,7 @@ var CacheService = class _CacheService {
|
|
|
1086
1171
|
__name(this, "CacheService");
|
|
1087
1172
|
}
|
|
1088
1173
|
provider;
|
|
1089
|
-
logger = new
|
|
1174
|
+
logger = new import_common39.Logger(_CacheService.name);
|
|
1090
1175
|
constructor(provider) {
|
|
1091
1176
|
this.provider = provider;
|
|
1092
1177
|
}
|
|
@@ -1135,8 +1220,8 @@ var CacheService = class _CacheService {
|
|
|
1135
1220
|
}
|
|
1136
1221
|
};
|
|
1137
1222
|
CacheService = _ts_decorate6([
|
|
1138
|
-
(0,
|
|
1139
|
-
_ts_param4(0, (0,
|
|
1223
|
+
(0, import_common39.Injectable)(),
|
|
1224
|
+
_ts_param4(0, (0, import_common39.Inject)(CACHE_PROVIDER)),
|
|
1140
1225
|
_ts_metadata4("design:type", Function),
|
|
1141
1226
|
_ts_metadata4("design:paramtypes", [
|
|
1142
1227
|
typeof ICacheProvider === "undefined" ? Object : ICacheProvider
|
|
@@ -1144,7 +1229,7 @@ CacheService = _ts_decorate6([
|
|
|
1144
1229
|
], CacheService);
|
|
1145
1230
|
|
|
1146
1231
|
// src/cache/providers/redis.provider.ts
|
|
1147
|
-
var
|
|
1232
|
+
var import_common40 = require("@nestjs/common");
|
|
1148
1233
|
var import_config2 = require("@nestjs/config");
|
|
1149
1234
|
var import_ioredis = __toESM(require("ioredis"), 1);
|
|
1150
1235
|
function _ts_decorate7(decorators, target, key, desc3) {
|
|
@@ -1163,7 +1248,7 @@ var RedisCacheProvider = class _RedisCacheProvider {
|
|
|
1163
1248
|
__name(this, "RedisCacheProvider");
|
|
1164
1249
|
}
|
|
1165
1250
|
configService;
|
|
1166
|
-
logger = new
|
|
1251
|
+
logger = new import_common40.Logger(_RedisCacheProvider.name);
|
|
1167
1252
|
client;
|
|
1168
1253
|
constructor(configService) {
|
|
1169
1254
|
this.configService = configService;
|
|
@@ -1217,7 +1302,7 @@ var RedisCacheProvider = class _RedisCacheProvider {
|
|
|
1217
1302
|
}
|
|
1218
1303
|
};
|
|
1219
1304
|
RedisCacheProvider = _ts_decorate7([
|
|
1220
|
-
(0,
|
|
1305
|
+
(0, import_common40.Injectable)(),
|
|
1221
1306
|
_ts_metadata5("design:type", Function),
|
|
1222
1307
|
_ts_metadata5("design:paramtypes", [
|
|
1223
1308
|
typeof import_config2.ConfigService === "undefined" ? Object : import_config2.ConfigService
|
|
@@ -1238,7 +1323,7 @@ var CacheModule = class {
|
|
|
1238
1323
|
}
|
|
1239
1324
|
};
|
|
1240
1325
|
CacheModule = _ts_decorate8([
|
|
1241
|
-
(0,
|
|
1326
|
+
(0, import_common41.Module)({
|
|
1242
1327
|
imports: [
|
|
1243
1328
|
import_config3.ConfigModule
|
|
1244
1329
|
],
|
|
@@ -1258,19 +1343,15 @@ CacheModule = _ts_decorate8([
|
|
|
1258
1343
|
})
|
|
1259
1344
|
], CacheModule);
|
|
1260
1345
|
|
|
1261
|
-
// src/data-table/data-table.module.ts
|
|
1262
|
-
var import_common49 = require("@nestjs/common");
|
|
1263
|
-
var import_config6 = require("@nestjs/config");
|
|
1264
|
-
|
|
1265
1346
|
// src/data-table/data-table.constants.ts
|
|
1266
1347
|
var DATA_TABLE_VIEWS_TABLE = Symbol("DATA_TABLE_VIEWS_TABLE");
|
|
1267
1348
|
|
|
1268
1349
|
// src/data-table/state/controllers/data-table-state.controller.ts
|
|
1269
|
-
var
|
|
1350
|
+
var import_common44 = require("@nestjs/common");
|
|
1270
1351
|
var import_swagger3 = require("@nestjs/swagger");
|
|
1271
1352
|
|
|
1272
1353
|
// src/data-table/state/docs/data-table-state.docs.ts
|
|
1273
|
-
var
|
|
1354
|
+
var import_common42 = require("@nestjs/common");
|
|
1274
1355
|
var import_swagger2 = require("@nestjs/swagger");
|
|
1275
1356
|
|
|
1276
1357
|
// src/data-table/state/dto/request/upsert-data-table-state.dto.ts
|
|
@@ -1320,7 +1401,7 @@ _ts_decorate9([
|
|
|
1320
1401
|
|
|
1321
1402
|
// src/data-table/state/docs/data-table-state.docs.ts
|
|
1322
1403
|
function ApiUpsertDataTableState() {
|
|
1323
|
-
return (0,
|
|
1404
|
+
return (0, import_common42.applyDecorators)((0, import_swagger2.ApiOperation)({
|
|
1324
1405
|
summary: "Save live table state",
|
|
1325
1406
|
description: "Stores the current filter, sort, and column visibility state in Redis cache. Called on filter Apply and sort column click. State expires after TABLE_STATE_CACHE_TTL seconds."
|
|
1326
1407
|
}), (0, import_swagger2.ApiBody)({
|
|
@@ -1339,7 +1420,7 @@ function ApiUpsertDataTableState() {
|
|
|
1339
1420
|
__name(ApiUpsertDataTableState, "ApiUpsertDataTableState");
|
|
1340
1421
|
|
|
1341
1422
|
// src/data-table/state/services/data-table-state.service.ts
|
|
1342
|
-
var
|
|
1423
|
+
var import_common43 = require("@nestjs/common");
|
|
1343
1424
|
var import_config4 = require("@nestjs/config");
|
|
1344
1425
|
function _ts_decorate10(decorators, target, key, desc3) {
|
|
1345
1426
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
@@ -1378,7 +1459,7 @@ var DataTableStateService = class _DataTableStateService {
|
|
|
1378
1459
|
}
|
|
1379
1460
|
cacheService;
|
|
1380
1461
|
configService;
|
|
1381
|
-
logger = new
|
|
1462
|
+
logger = new import_common43.Logger(_DataTableStateService.name);
|
|
1382
1463
|
constructor(cacheService, configService) {
|
|
1383
1464
|
this.cacheService = cacheService;
|
|
1384
1465
|
this.configService = configService;
|
|
@@ -1407,7 +1488,7 @@ var DataTableStateService = class _DataTableStateService {
|
|
|
1407
1488
|
}
|
|
1408
1489
|
};
|
|
1409
1490
|
DataTableStateService = _ts_decorate10([
|
|
1410
|
-
(0,
|
|
1491
|
+
(0, import_common43.Injectable)(),
|
|
1411
1492
|
_ts_metadata7("design:type", Function),
|
|
1412
1493
|
_ts_metadata7("design:paramtypes", [
|
|
1413
1494
|
typeof CacheService === "undefined" ? Object : CacheService,
|
|
@@ -1438,7 +1519,7 @@ var DataTableStateController = class _DataTableStateController {
|
|
|
1438
1519
|
__name(this, "DataTableStateController");
|
|
1439
1520
|
}
|
|
1440
1521
|
dataTableStateService;
|
|
1441
|
-
logger = new
|
|
1522
|
+
logger = new import_common44.Logger(_DataTableStateController.name);
|
|
1442
1523
|
constructor(dataTableStateService) {
|
|
1443
1524
|
this.dataTableStateService = dataTableStateService;
|
|
1444
1525
|
}
|
|
@@ -1449,11 +1530,11 @@ var DataTableStateController = class _DataTableStateController {
|
|
|
1449
1530
|
}
|
|
1450
1531
|
};
|
|
1451
1532
|
_ts_decorate11([
|
|
1452
|
-
(0,
|
|
1453
|
-
(0,
|
|
1533
|
+
(0, import_common44.Post)(),
|
|
1534
|
+
(0, import_common44.HttpCode)(import_common44.HttpStatus.OK),
|
|
1454
1535
|
ApiUpsertDataTableState(),
|
|
1455
1536
|
_ts_param5(0, UserId()),
|
|
1456
|
-
_ts_param5(1, (0,
|
|
1537
|
+
_ts_param5(1, (0, import_common44.Body)()),
|
|
1457
1538
|
_ts_metadata8("design:type", Function),
|
|
1458
1539
|
_ts_metadata8("design:paramtypes", [
|
|
1459
1540
|
String,
|
|
@@ -1464,7 +1545,7 @@ _ts_decorate11([
|
|
|
1464
1545
|
DataTableStateController = _ts_decorate11([
|
|
1465
1546
|
(0, import_swagger3.ApiTags)("Table States"),
|
|
1466
1547
|
(0, import_swagger3.ApiBearerAuth)(),
|
|
1467
|
-
(0,
|
|
1548
|
+
(0, import_common44.Controller)("table-states"),
|
|
1468
1549
|
_ts_metadata8("design:type", Function),
|
|
1469
1550
|
_ts_metadata8("design:paramtypes", [
|
|
1470
1551
|
typeof DataTableStateService === "undefined" ? Object : DataTableStateService
|
|
@@ -1472,11 +1553,11 @@ DataTableStateController = _ts_decorate11([
|
|
|
1472
1553
|
], DataTableStateController);
|
|
1473
1554
|
|
|
1474
1555
|
// src/data-table/views/controllers/data-table-views.controller.ts
|
|
1475
|
-
var
|
|
1556
|
+
var import_common50 = require("@nestjs/common");
|
|
1476
1557
|
var import_swagger10 = require("@nestjs/swagger");
|
|
1477
1558
|
|
|
1478
1559
|
// src/data-table/views/docs/data-table-views.docs.ts
|
|
1479
|
-
var
|
|
1560
|
+
var import_common45 = require("@nestjs/common");
|
|
1480
1561
|
var import_swagger9 = require("@nestjs/swagger");
|
|
1481
1562
|
|
|
1482
1563
|
// src/data-table/views/dto/entity/data-table-view.dto.ts
|
|
@@ -1720,7 +1801,7 @@ _ts_decorate16([
|
|
|
1720
1801
|
|
|
1721
1802
|
// src/data-table/views/docs/data-table-views.docs.ts
|
|
1722
1803
|
function ApiListDataTableViews() {
|
|
1723
|
-
return (0,
|
|
1804
|
+
return (0, import_common45.applyDecorators)((0, import_swagger9.ApiOperation)({
|
|
1724
1805
|
summary: "List named table views",
|
|
1725
1806
|
description: "Returns the authenticated user's own named views plus all shared views for the given table slug."
|
|
1726
1807
|
}), (0, import_swagger9.ApiQuery)({
|
|
@@ -1741,7 +1822,7 @@ function ApiListDataTableViews() {
|
|
|
1741
1822
|
}
|
|
1742
1823
|
__name(ApiListDataTableViews, "ApiListDataTableViews");
|
|
1743
1824
|
function ApiCreateDataTableView() {
|
|
1744
|
-
return (0,
|
|
1825
|
+
return (0, import_common45.applyDecorators)((0, import_swagger9.ApiOperation)({
|
|
1745
1826
|
summary: "Create named table view",
|
|
1746
1827
|
description: "Saves the current table state as a named view snapshot. The name must be unique per user+table."
|
|
1747
1828
|
}), (0, import_swagger9.ApiBody)({
|
|
@@ -1760,7 +1841,7 @@ function ApiCreateDataTableView() {
|
|
|
1760
1841
|
}
|
|
1761
1842
|
__name(ApiCreateDataTableView, "ApiCreateDataTableView");
|
|
1762
1843
|
function ApiUpdateDataTableView() {
|
|
1763
|
-
return (0,
|
|
1844
|
+
return (0, import_common45.applyDecorators)((0, import_swagger9.ApiOperation)({
|
|
1764
1845
|
summary: "Update named table view",
|
|
1765
1846
|
description: "Updates the state of an existing named view. Only the owner can update."
|
|
1766
1847
|
}), (0, import_swagger9.ApiParam)({
|
|
@@ -1785,7 +1866,7 @@ function ApiUpdateDataTableView() {
|
|
|
1785
1866
|
}
|
|
1786
1867
|
__name(ApiUpdateDataTableView, "ApiUpdateDataTableView");
|
|
1787
1868
|
function ApiRenameDataTableView() {
|
|
1788
|
-
return (0,
|
|
1869
|
+
return (0, import_common45.applyDecorators)((0, import_swagger9.ApiOperation)({
|
|
1789
1870
|
summary: "Rename a named table view",
|
|
1790
1871
|
description: "Updates the display name of an existing view. The new name must be unique per user+table. Only the owner can rename."
|
|
1791
1872
|
}), (0, import_swagger9.ApiParam)({
|
|
@@ -1813,7 +1894,7 @@ function ApiRenameDataTableView() {
|
|
|
1813
1894
|
}
|
|
1814
1895
|
__name(ApiRenameDataTableView, "ApiRenameDataTableView");
|
|
1815
1896
|
function ApiToggleShareDataTableView() {
|
|
1816
|
-
return (0,
|
|
1897
|
+
return (0, import_common45.applyDecorators)((0, import_swagger9.ApiOperation)({
|
|
1817
1898
|
summary: "Toggle view sharing",
|
|
1818
1899
|
description: "Makes a view visible to all users (shared) or restricts it to the owner only (private). Only the owner can toggle sharing."
|
|
1819
1900
|
}), (0, import_swagger9.ApiParam)({
|
|
@@ -1838,7 +1919,7 @@ function ApiToggleShareDataTableView() {
|
|
|
1838
1919
|
}
|
|
1839
1920
|
__name(ApiToggleShareDataTableView, "ApiToggleShareDataTableView");
|
|
1840
1921
|
function ApiDeleteDataTableView() {
|
|
1841
|
-
return (0,
|
|
1922
|
+
return (0, import_common45.applyDecorators)((0, import_swagger9.ApiOperation)({
|
|
1842
1923
|
summary: "Delete named table view",
|
|
1843
1924
|
description: "Permanently deletes a named view. Only the owner can delete their own views."
|
|
1844
1925
|
}), (0, import_swagger9.ApiParam)({
|
|
@@ -1863,16 +1944,17 @@ __name(ApiDeleteDataTableView, "ApiDeleteDataTableView");
|
|
|
1863
1944
|
|
|
1864
1945
|
// src/data-table/views/services/data-table-views.service.ts
|
|
1865
1946
|
var import_node_crypto = require("crypto");
|
|
1866
|
-
var
|
|
1947
|
+
var import_common49 = require("@nestjs/common");
|
|
1867
1948
|
var import_config5 = require("@nestjs/config");
|
|
1868
1949
|
|
|
1869
1950
|
// src/data-table/views/repositories/data-table-views.repository.ts
|
|
1870
|
-
var
|
|
1951
|
+
var import_common48 = require("@nestjs/common");
|
|
1871
1952
|
var import_drizzle_orm2 = require("drizzle-orm");
|
|
1872
1953
|
|
|
1873
1954
|
// src/database/repositories/primary-base.repository.ts
|
|
1874
|
-
var
|
|
1955
|
+
var import_common46 = require("@nestjs/common");
|
|
1875
1956
|
var import_drizzle_orm = require("drizzle-orm");
|
|
1957
|
+
var import_view_base = require("drizzle-orm/pg-core/view-base");
|
|
1876
1958
|
function snakeToCamel(str) {
|
|
1877
1959
|
return str.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
1878
1960
|
}
|
|
@@ -1886,10 +1968,14 @@ var PrimaryBaseRepository = class {
|
|
|
1886
1968
|
logger;
|
|
1887
1969
|
sequence;
|
|
1888
1970
|
tableName;
|
|
1971
|
+
isView;
|
|
1889
1972
|
get db() {
|
|
1890
1973
|
return this.database.drizzleClient;
|
|
1891
1974
|
}
|
|
1892
1975
|
get model() {
|
|
1976
|
+
if (this.isView) {
|
|
1977
|
+
throw new Error(`${this.constructor.name}: relational queries (.model) are not supported on the view '${this.tableName}'. Use findForSelect / findAllAndCount instead.`);
|
|
1978
|
+
}
|
|
1893
1979
|
const query = this.database.drizzleClient.query;
|
|
1894
1980
|
const queryKeys = Object.keys(query || {});
|
|
1895
1981
|
this.logger.debug(`Looking for '${this.tableName}' in query keys: [${queryKeys.join(", ")}]`);
|
|
@@ -1902,10 +1988,11 @@ var PrimaryBaseRepository = class {
|
|
|
1902
1988
|
constructor(database, table, options) {
|
|
1903
1989
|
this.database = database;
|
|
1904
1990
|
this.table = table;
|
|
1905
|
-
|
|
1991
|
+
this.isView = (0, import_drizzle_orm.is)(table, import_view_base.PgViewBase);
|
|
1992
|
+
const dbTableName = this.isView ? (0, import_drizzle_orm.getViewName)(table) : (0, import_drizzle_orm.getTableName)(table);
|
|
1906
1993
|
this.tableName = snakeToCamel(dbTableName);
|
|
1907
1994
|
this.sequence = options?.sequence;
|
|
1908
|
-
this.logger = new
|
|
1995
|
+
this.logger = new import_common46.Logger(this.constructor.name);
|
|
1909
1996
|
this.logger.debug(`Initialized ${this.constructor.name}`);
|
|
1910
1997
|
this.logger.debug(`Table name: '${dbTableName}' -> query key: '${this.tableName}'`);
|
|
1911
1998
|
}
|
|
@@ -2027,6 +2114,19 @@ var PrimaryBaseRepository = class {
|
|
|
2027
2114
|
count: countResult[0].count
|
|
2028
2115
|
};
|
|
2029
2116
|
}
|
|
2117
|
+
// Fetches limit+1 rows for keyset/cursor pagination and trims, returning rows plus hasMore.
|
|
2118
|
+
// The WHERE must already include the keyset "after" predicate; orderBy must be a total order.
|
|
2119
|
+
async findKeyset(options) {
|
|
2120
|
+
const rows = await this.buildSelectQuery({
|
|
2121
|
+
...options,
|
|
2122
|
+
limit: options.limit + 1
|
|
2123
|
+
});
|
|
2124
|
+
const hasMore = rows.length > options.limit;
|
|
2125
|
+
return {
|
|
2126
|
+
rows: hasMore ? rows.slice(0, options.limit) : rows,
|
|
2127
|
+
hasMore
|
|
2128
|
+
};
|
|
2129
|
+
}
|
|
2030
2130
|
// Updates a record by ID and returns the updated record
|
|
2031
2131
|
async update(id, data, tx) {
|
|
2032
2132
|
this.logger.log(`Updating record with ID: ${id}`);
|
|
@@ -2293,7 +2393,7 @@ var PrimaryBaseRepository = class {
|
|
|
2293
2393
|
|
|
2294
2394
|
// src/database/services/primary-database.service.ts
|
|
2295
2395
|
var import_node_async_hooks = require("async_hooks");
|
|
2296
|
-
var
|
|
2396
|
+
var import_common47 = require("@nestjs/common");
|
|
2297
2397
|
var import_node_postgres = require("drizzle-orm/node-postgres");
|
|
2298
2398
|
|
|
2299
2399
|
// src/database/constants.ts
|
|
@@ -2376,7 +2476,7 @@ var PrimaryDatabaseService = class _PrimaryDatabaseService {
|
|
|
2376
2476
|
__name(this, "PrimaryDatabaseService");
|
|
2377
2477
|
}
|
|
2378
2478
|
options;
|
|
2379
|
-
logger = new
|
|
2479
|
+
logger = new import_common47.Logger(_PrimaryDatabaseService.name);
|
|
2380
2480
|
pool = null;
|
|
2381
2481
|
db = null;
|
|
2382
2482
|
// Per-request RLS context values (e.g. { orgId, buId, ... }). Read by RlsAwarePool on each
|
|
@@ -2424,7 +2524,7 @@ var PrimaryDatabaseService = class _PrimaryDatabaseService {
|
|
|
2424
2524
|
this.logger.log(`Connected to primary database (schema: ${schema ?? "public"})`);
|
|
2425
2525
|
} catch (error) {
|
|
2426
2526
|
this.logger.error("Failed to connect to primary database", error);
|
|
2427
|
-
throw new
|
|
2527
|
+
throw new import_common47.InternalServerErrorException("Failed to initialize database connection");
|
|
2428
2528
|
}
|
|
2429
2529
|
}
|
|
2430
2530
|
// Returns the active Drizzle client. When inside runInTransaction, returns the pinned tx so
|
|
@@ -2479,8 +2579,8 @@ var PrimaryDatabaseService = class _PrimaryDatabaseService {
|
|
|
2479
2579
|
}
|
|
2480
2580
|
};
|
|
2481
2581
|
PrimaryDatabaseService = _ts_decorate17([
|
|
2482
|
-
(0,
|
|
2483
|
-
_ts_param6(0, (0,
|
|
2582
|
+
(0, import_common47.Injectable)(),
|
|
2583
|
+
_ts_param6(0, (0, import_common47.Inject)(DATABASE_MODULE_OPTIONS)),
|
|
2484
2584
|
_ts_metadata14("design:type", Function),
|
|
2485
2585
|
_ts_metadata14("design:paramtypes", [
|
|
2486
2586
|
typeof DatabaseModuleOptions === "undefined" ? Object : DatabaseModuleOptions
|
|
@@ -2525,8 +2625,8 @@ var DataTableViewsRepository = class extends PrimaryBaseRepository {
|
|
|
2525
2625
|
}
|
|
2526
2626
|
};
|
|
2527
2627
|
DataTableViewsRepository = _ts_decorate18([
|
|
2528
|
-
(0,
|
|
2529
|
-
_ts_param7(1, (0,
|
|
2628
|
+
(0, import_common48.Injectable)(),
|
|
2629
|
+
_ts_param7(1, (0, import_common48.Inject)(DATA_TABLE_VIEWS_TABLE)),
|
|
2530
2630
|
_ts_metadata15("design:type", Function),
|
|
2531
2631
|
_ts_metadata15("design:paramtypes", [
|
|
2532
2632
|
typeof PrimaryDatabaseService === "undefined" ? Object : PrimaryDatabaseService,
|
|
@@ -2557,7 +2657,7 @@ var DataTableViewsService = class _DataTableViewsService {
|
|
|
2557
2657
|
dataTableViewsRepository;
|
|
2558
2658
|
cacheService;
|
|
2559
2659
|
configService;
|
|
2560
|
-
logger = new
|
|
2660
|
+
logger = new import_common49.Logger(_DataTableViewsService.name);
|
|
2561
2661
|
constructor(dataTableViewsRepository, cacheService, configService) {
|
|
2562
2662
|
this.dataTableViewsRepository = dataTableViewsRepository;
|
|
2563
2663
|
this.cacheService = cacheService;
|
|
@@ -2701,7 +2801,7 @@ var DataTableViewsService = class _DataTableViewsService {
|
|
|
2701
2801
|
}
|
|
2702
2802
|
};
|
|
2703
2803
|
DataTableViewsService = _ts_decorate19([
|
|
2704
|
-
(0,
|
|
2804
|
+
(0, import_common49.Injectable)(),
|
|
2705
2805
|
_ts_metadata16("design:type", Function),
|
|
2706
2806
|
_ts_metadata16("design:paramtypes", [
|
|
2707
2807
|
typeof DataTableViewsRepository === "undefined" ? Object : DataTableViewsRepository,
|
|
@@ -2733,7 +2833,7 @@ var DataTableViewsController = class _DataTableViewsController {
|
|
|
2733
2833
|
__name(this, "DataTableViewsController");
|
|
2734
2834
|
}
|
|
2735
2835
|
dataTableViewsService;
|
|
2736
|
-
logger = new
|
|
2836
|
+
logger = new import_common50.Logger(_DataTableViewsController.name);
|
|
2737
2837
|
constructor(dataTableViewsService) {
|
|
2738
2838
|
this.dataTableViewsService = dataTableViewsService;
|
|
2739
2839
|
}
|
|
@@ -2769,10 +2869,10 @@ var DataTableViewsController = class _DataTableViewsController {
|
|
|
2769
2869
|
}
|
|
2770
2870
|
};
|
|
2771
2871
|
_ts_decorate20([
|
|
2772
|
-
(0,
|
|
2872
|
+
(0, import_common50.Get)(),
|
|
2773
2873
|
ApiListDataTableViews(),
|
|
2774
2874
|
_ts_param8(0, UserId()),
|
|
2775
|
-
_ts_param8(1, (0,
|
|
2875
|
+
_ts_param8(1, (0, import_common50.Query)("tableSlug")),
|
|
2776
2876
|
_ts_metadata17("design:type", Function),
|
|
2777
2877
|
_ts_metadata17("design:paramtypes", [
|
|
2778
2878
|
String,
|
|
@@ -2781,11 +2881,11 @@ _ts_decorate20([
|
|
|
2781
2881
|
_ts_metadata17("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
2782
2882
|
], DataTableViewsController.prototype, "findViews", null);
|
|
2783
2883
|
_ts_decorate20([
|
|
2784
|
-
(0,
|
|
2785
|
-
(0,
|
|
2884
|
+
(0, import_common50.Post)(),
|
|
2885
|
+
(0, import_common50.HttpCode)(import_common50.HttpStatus.CREATED),
|
|
2786
2886
|
ApiCreateDataTableView(),
|
|
2787
2887
|
_ts_param8(0, UserId()),
|
|
2788
|
-
_ts_param8(1, (0,
|
|
2888
|
+
_ts_param8(1, (0, import_common50.Body)()),
|
|
2789
2889
|
_ts_metadata17("design:type", Function),
|
|
2790
2890
|
_ts_metadata17("design:paramtypes", [
|
|
2791
2891
|
String,
|
|
@@ -2794,11 +2894,11 @@ _ts_decorate20([
|
|
|
2794
2894
|
_ts_metadata17("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
2795
2895
|
], DataTableViewsController.prototype, "createView", null);
|
|
2796
2896
|
_ts_decorate20([
|
|
2797
|
-
(0,
|
|
2897
|
+
(0, import_common50.Patch)(":id"),
|
|
2798
2898
|
ApiUpdateDataTableView(),
|
|
2799
2899
|
_ts_param8(0, UserId()),
|
|
2800
|
-
_ts_param8(1, (0,
|
|
2801
|
-
_ts_param8(2, (0,
|
|
2900
|
+
_ts_param8(1, (0, import_common50.Param)("id")),
|
|
2901
|
+
_ts_param8(2, (0, import_common50.Body)()),
|
|
2802
2902
|
_ts_metadata17("design:type", Function),
|
|
2803
2903
|
_ts_metadata17("design:paramtypes", [
|
|
2804
2904
|
String,
|
|
@@ -2808,11 +2908,11 @@ _ts_decorate20([
|
|
|
2808
2908
|
_ts_metadata17("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
2809
2909
|
], DataTableViewsController.prototype, "updateView", null);
|
|
2810
2910
|
_ts_decorate20([
|
|
2811
|
-
(0,
|
|
2911
|
+
(0, import_common50.Patch)(":id/rename"),
|
|
2812
2912
|
ApiRenameDataTableView(),
|
|
2813
2913
|
_ts_param8(0, UserId()),
|
|
2814
|
-
_ts_param8(1, (0,
|
|
2815
|
-
_ts_param8(2, (0,
|
|
2914
|
+
_ts_param8(1, (0, import_common50.Param)("id")),
|
|
2915
|
+
_ts_param8(2, (0, import_common50.Body)()),
|
|
2816
2916
|
_ts_metadata17("design:type", Function),
|
|
2817
2917
|
_ts_metadata17("design:paramtypes", [
|
|
2818
2918
|
String,
|
|
@@ -2822,11 +2922,11 @@ _ts_decorate20([
|
|
|
2822
2922
|
_ts_metadata17("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
2823
2923
|
], DataTableViewsController.prototype, "renameView", null);
|
|
2824
2924
|
_ts_decorate20([
|
|
2825
|
-
(0,
|
|
2925
|
+
(0, import_common50.Patch)(":id/share"),
|
|
2826
2926
|
ApiToggleShareDataTableView(),
|
|
2827
2927
|
_ts_param8(0, UserId()),
|
|
2828
|
-
_ts_param8(1, (0,
|
|
2829
|
-
_ts_param8(2, (0,
|
|
2928
|
+
_ts_param8(1, (0, import_common50.Param)("id")),
|
|
2929
|
+
_ts_param8(2, (0, import_common50.Body)()),
|
|
2830
2930
|
_ts_metadata17("design:type", Function),
|
|
2831
2931
|
_ts_metadata17("design:paramtypes", [
|
|
2832
2932
|
String,
|
|
@@ -2836,10 +2936,10 @@ _ts_decorate20([
|
|
|
2836
2936
|
_ts_metadata17("design:returntype", typeof Promise === "undefined" ? Object : Promise)
|
|
2837
2937
|
], DataTableViewsController.prototype, "toggleShareView", null);
|
|
2838
2938
|
_ts_decorate20([
|
|
2839
|
-
(0,
|
|
2939
|
+
(0, import_common50.Delete)(":id"),
|
|
2840
2940
|
ApiDeleteDataTableView(),
|
|
2841
2941
|
_ts_param8(0, UserId()),
|
|
2842
|
-
_ts_param8(1, (0,
|
|
2942
|
+
_ts_param8(1, (0, import_common50.Param)("id")),
|
|
2843
2943
|
_ts_metadata17("design:type", Function),
|
|
2844
2944
|
_ts_metadata17("design:paramtypes", [
|
|
2845
2945
|
String,
|
|
@@ -2850,7 +2950,7 @@ _ts_decorate20([
|
|
|
2850
2950
|
DataTableViewsController = _ts_decorate20([
|
|
2851
2951
|
(0, import_swagger10.ApiTags)("Table Views"),
|
|
2852
2952
|
(0, import_swagger10.ApiBearerAuth)(),
|
|
2853
|
-
(0,
|
|
2953
|
+
(0, import_common50.Controller)("table-views"),
|
|
2854
2954
|
_ts_metadata17("design:type", Function),
|
|
2855
2955
|
_ts_metadata17("design:paramtypes", [
|
|
2856
2956
|
typeof DataTableViewsService === "undefined" ? Object : DataTableViewsService
|
|
@@ -2898,7 +2998,7 @@ var DataTableModule = class _DataTableModule {
|
|
|
2898
2998
|
}
|
|
2899
2999
|
};
|
|
2900
3000
|
DataTableModule = _ts_decorate21([
|
|
2901
|
-
(0,
|
|
3001
|
+
(0, import_common51.Module)({})
|
|
2902
3002
|
], DataTableModule);
|
|
2903
3003
|
|
|
2904
3004
|
// src/drizzle-pg-core.ts
|
|
@@ -2937,7 +3037,7 @@ function dataTableViewsIndexes(table) {
|
|
|
2937
3037
|
__name(dataTableViewsIndexes, "dataTableViewsIndexes");
|
|
2938
3038
|
|
|
2939
3039
|
// src/database/database.module.ts
|
|
2940
|
-
var
|
|
3040
|
+
var import_common52 = require("@nestjs/common");
|
|
2941
3041
|
var import_core4 = require("@nestjs/core");
|
|
2942
3042
|
function _ts_decorate22(decorators, target, key, desc3) {
|
|
2943
3043
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
@@ -2975,8 +3075,8 @@ var DatabaseModule = class _DatabaseModule {
|
|
|
2975
3075
|
}
|
|
2976
3076
|
};
|
|
2977
3077
|
DatabaseModule = _ts_decorate22([
|
|
2978
|
-
(0,
|
|
2979
|
-
(0,
|
|
3078
|
+
(0, import_common52.Global)(),
|
|
3079
|
+
(0, import_common52.Module)({})
|
|
2980
3080
|
], DatabaseModule);
|
|
2981
3081
|
|
|
2982
3082
|
// src/database/dto/create-response.dto.ts
|
|
@@ -3017,7 +3117,7 @@ _ts_decorate23([
|
|
|
3017
3117
|
_ts_metadata18("design:type", typeof T === "undefined" ? Object : T)
|
|
3018
3118
|
], CreateResponseDto.prototype, "data", void 0);
|
|
3019
3119
|
|
|
3020
|
-
// src/database/dto/
|
|
3120
|
+
// src/database/dto/cursor-list-response.dto.ts
|
|
3021
3121
|
var import_swagger12 = require("@nestjs/swagger");
|
|
3022
3122
|
function _ts_decorate24(decorators, target, key, desc3) {
|
|
3023
3123
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
@@ -3030,6 +3130,42 @@ function _ts_metadata19(k, v) {
|
|
|
3030
3130
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3031
3131
|
}
|
|
3032
3132
|
__name(_ts_metadata19, "_ts_metadata");
|
|
3133
|
+
var CursorListResponseDto = class {
|
|
3134
|
+
static {
|
|
3135
|
+
__name(this, "CursorListResponseDto");
|
|
3136
|
+
}
|
|
3137
|
+
items;
|
|
3138
|
+
nextCursor;
|
|
3139
|
+
hasMore;
|
|
3140
|
+
};
|
|
3141
|
+
_ts_decorate24([
|
|
3142
|
+
(0, import_swagger12.ApiProperty)(),
|
|
3143
|
+
_ts_metadata19("design:type", Array)
|
|
3144
|
+
], CursorListResponseDto.prototype, "items", void 0);
|
|
3145
|
+
_ts_decorate24([
|
|
3146
|
+
(0, import_swagger12.ApiPropertyOptional)({
|
|
3147
|
+
nullable: true
|
|
3148
|
+
}),
|
|
3149
|
+
_ts_metadata19("design:type", Object)
|
|
3150
|
+
], CursorListResponseDto.prototype, "nextCursor", void 0);
|
|
3151
|
+
_ts_decorate24([
|
|
3152
|
+
(0, import_swagger12.ApiProperty)(),
|
|
3153
|
+
_ts_metadata19("design:type", Boolean)
|
|
3154
|
+
], CursorListResponseDto.prototype, "hasMore", void 0);
|
|
3155
|
+
|
|
3156
|
+
// src/database/dto/import-response.dto.ts
|
|
3157
|
+
var import_swagger13 = require("@nestjs/swagger");
|
|
3158
|
+
function _ts_decorate25(decorators, target, key, desc3) {
|
|
3159
|
+
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
3160
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
3161
|
+
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;
|
|
3162
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3163
|
+
}
|
|
3164
|
+
__name(_ts_decorate25, "_ts_decorate");
|
|
3165
|
+
function _ts_metadata20(k, v) {
|
|
3166
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3167
|
+
}
|
|
3168
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
3033
3169
|
var ValidatedRowDto = class {
|
|
3034
3170
|
static {
|
|
3035
3171
|
__name(this, "ValidatedRowDto");
|
|
@@ -3039,34 +3175,34 @@ var ValidatedRowDto = class {
|
|
|
3039
3175
|
valid;
|
|
3040
3176
|
errors;
|
|
3041
3177
|
};
|
|
3042
|
-
|
|
3043
|
-
(0,
|
|
3178
|
+
_ts_decorate25([
|
|
3179
|
+
(0, import_swagger13.ApiProperty)({
|
|
3044
3180
|
example: 1
|
|
3045
3181
|
}),
|
|
3046
|
-
|
|
3182
|
+
_ts_metadata20("design:type", Number)
|
|
3047
3183
|
], ValidatedRowDto.prototype, "index", void 0);
|
|
3048
|
-
|
|
3049
|
-
(0,
|
|
3184
|
+
_ts_decorate25([
|
|
3185
|
+
(0, import_swagger13.ApiProperty)({
|
|
3050
3186
|
example: {
|
|
3051
3187
|
code: "products",
|
|
3052
3188
|
name: "Products"
|
|
3053
3189
|
}
|
|
3054
3190
|
}),
|
|
3055
|
-
|
|
3191
|
+
_ts_metadata20("design:type", typeof Record === "undefined" ? Object : Record)
|
|
3056
3192
|
], ValidatedRowDto.prototype, "data", void 0);
|
|
3057
|
-
|
|
3058
|
-
(0,
|
|
3193
|
+
_ts_decorate25([
|
|
3194
|
+
(0, import_swagger13.ApiProperty)({
|
|
3059
3195
|
example: true
|
|
3060
3196
|
}),
|
|
3061
|
-
|
|
3197
|
+
_ts_metadata20("design:type", Boolean)
|
|
3062
3198
|
], ValidatedRowDto.prototype, "valid", void 0);
|
|
3063
|
-
|
|
3064
|
-
(0,
|
|
3199
|
+
_ts_decorate25([
|
|
3200
|
+
(0, import_swagger13.ApiProperty)({
|
|
3065
3201
|
example: [
|
|
3066
3202
|
"Code already exists"
|
|
3067
3203
|
]
|
|
3068
3204
|
}),
|
|
3069
|
-
|
|
3205
|
+
_ts_metadata20("design:type", Array)
|
|
3070
3206
|
], ValidatedRowDto.prototype, "errors", void 0);
|
|
3071
3207
|
var ImportSummaryDto = class {
|
|
3072
3208
|
static {
|
|
@@ -3076,23 +3212,23 @@ var ImportSummaryDto = class {
|
|
|
3076
3212
|
valid;
|
|
3077
3213
|
invalid;
|
|
3078
3214
|
};
|
|
3079
|
-
|
|
3080
|
-
(0,
|
|
3215
|
+
_ts_decorate25([
|
|
3216
|
+
(0, import_swagger13.ApiProperty)({
|
|
3081
3217
|
example: 10
|
|
3082
3218
|
}),
|
|
3083
|
-
|
|
3219
|
+
_ts_metadata20("design:type", Number)
|
|
3084
3220
|
], ImportSummaryDto.prototype, "total", void 0);
|
|
3085
|
-
|
|
3086
|
-
(0,
|
|
3221
|
+
_ts_decorate25([
|
|
3222
|
+
(0, import_swagger13.ApiProperty)({
|
|
3087
3223
|
example: 8
|
|
3088
3224
|
}),
|
|
3089
|
-
|
|
3225
|
+
_ts_metadata20("design:type", Number)
|
|
3090
3226
|
], ImportSummaryDto.prototype, "valid", void 0);
|
|
3091
|
-
|
|
3092
|
-
(0,
|
|
3227
|
+
_ts_decorate25([
|
|
3228
|
+
(0, import_swagger13.ApiProperty)({
|
|
3093
3229
|
example: 2
|
|
3094
3230
|
}),
|
|
3095
|
-
|
|
3231
|
+
_ts_metadata20("design:type", Number)
|
|
3096
3232
|
], ImportSummaryDto.prototype, "invalid", void 0);
|
|
3097
3233
|
var ImportResponseDto = class {
|
|
3098
3234
|
static {
|
|
@@ -3106,66 +3242,66 @@ var ImportResponseDto = class {
|
|
|
3106
3242
|
rows;
|
|
3107
3243
|
summary;
|
|
3108
3244
|
};
|
|
3109
|
-
|
|
3110
|
-
(0,
|
|
3245
|
+
_ts_decorate25([
|
|
3246
|
+
(0, import_swagger13.ApiProperty)({
|
|
3111
3247
|
example: true
|
|
3112
3248
|
}),
|
|
3113
|
-
|
|
3249
|
+
_ts_metadata20("design:type", Boolean)
|
|
3114
3250
|
], ImportResponseDto.prototype, "success", void 0);
|
|
3115
|
-
|
|
3116
|
-
(0,
|
|
3251
|
+
_ts_decorate25([
|
|
3252
|
+
(0, import_swagger13.ApiProperty)({
|
|
3117
3253
|
example: "Import complete."
|
|
3118
3254
|
}),
|
|
3119
|
-
|
|
3255
|
+
_ts_metadata20("design:type", String)
|
|
3120
3256
|
], ImportResponseDto.prototype, "message", void 0);
|
|
3121
|
-
|
|
3122
|
-
(0,
|
|
3257
|
+
_ts_decorate25([
|
|
3258
|
+
(0, import_swagger13.ApiPropertyOptional)({
|
|
3123
3259
|
example: 3
|
|
3124
3260
|
}),
|
|
3125
|
-
|
|
3261
|
+
_ts_metadata20("design:type", Number)
|
|
3126
3262
|
], ImportResponseDto.prototype, "created", void 0);
|
|
3127
|
-
|
|
3128
|
-
(0,
|
|
3263
|
+
_ts_decorate25([
|
|
3264
|
+
(0, import_swagger13.ApiPropertyOptional)({
|
|
3129
3265
|
example: 2
|
|
3130
3266
|
}),
|
|
3131
|
-
|
|
3267
|
+
_ts_metadata20("design:type", Number)
|
|
3132
3268
|
], ImportResponseDto.prototype, "updated", void 0);
|
|
3133
|
-
|
|
3134
|
-
(0,
|
|
3269
|
+
_ts_decorate25([
|
|
3270
|
+
(0, import_swagger13.ApiPropertyOptional)({
|
|
3135
3271
|
example: 1
|
|
3136
3272
|
}),
|
|
3137
|
-
|
|
3273
|
+
_ts_metadata20("design:type", Number)
|
|
3138
3274
|
], ImportResponseDto.prototype, "skipped", void 0);
|
|
3139
|
-
|
|
3140
|
-
(0,
|
|
3275
|
+
_ts_decorate25([
|
|
3276
|
+
(0, import_swagger13.ApiPropertyOptional)({
|
|
3141
3277
|
type: [
|
|
3142
3278
|
ValidatedRowDto
|
|
3143
3279
|
]
|
|
3144
3280
|
}),
|
|
3145
|
-
|
|
3281
|
+
_ts_metadata20("design:type", Array)
|
|
3146
3282
|
], ImportResponseDto.prototype, "rows", void 0);
|
|
3147
|
-
|
|
3148
|
-
(0,
|
|
3283
|
+
_ts_decorate25([
|
|
3284
|
+
(0, import_swagger13.ApiPropertyOptional)({
|
|
3149
3285
|
type: ImportSummaryDto
|
|
3150
3286
|
}),
|
|
3151
|
-
|
|
3287
|
+
_ts_metadata20("design:type", typeof ImportSummaryDto === "undefined" ? Object : ImportSummaryDto)
|
|
3152
3288
|
], ImportResponseDto.prototype, "summary", void 0);
|
|
3153
3289
|
|
|
3154
3290
|
// src/database/dto/select-options-query.dto.ts
|
|
3155
|
-
var
|
|
3291
|
+
var import_swagger14 = require("@nestjs/swagger");
|
|
3156
3292
|
var import_class_transformer = require("class-transformer");
|
|
3157
3293
|
var import_class_validator6 = require("class-validator");
|
|
3158
|
-
function
|
|
3294
|
+
function _ts_decorate26(decorators, target, key, desc3) {
|
|
3159
3295
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
3160
3296
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
3161
3297
|
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;
|
|
3162
3298
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3163
3299
|
}
|
|
3164
|
-
__name(
|
|
3165
|
-
function
|
|
3300
|
+
__name(_ts_decorate26, "_ts_decorate");
|
|
3301
|
+
function _ts_metadata21(k, v) {
|
|
3166
3302
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3167
3303
|
}
|
|
3168
|
-
__name(
|
|
3304
|
+
__name(_ts_metadata21, "_ts_metadata");
|
|
3169
3305
|
var SelectOptionsQueryDto = class {
|
|
3170
3306
|
static {
|
|
3171
3307
|
__name(this, "SelectOptionsQueryDto");
|
|
@@ -3183,17 +3319,17 @@ var SelectOptionsQueryDto = class {
|
|
|
3183
3319
|
orderByKey;
|
|
3184
3320
|
orderDirection;
|
|
3185
3321
|
};
|
|
3186
|
-
|
|
3187
|
-
(0,
|
|
3322
|
+
_ts_decorate26([
|
|
3323
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3188
3324
|
description: "Search term to filter by label",
|
|
3189
3325
|
example: "united"
|
|
3190
3326
|
}),
|
|
3191
3327
|
(0, import_class_validator6.IsOptional)(),
|
|
3192
3328
|
(0, import_class_validator6.IsString)(),
|
|
3193
|
-
|
|
3329
|
+
_ts_metadata21("design:type", String)
|
|
3194
3330
|
], SelectOptionsQueryDto.prototype, "search", void 0);
|
|
3195
|
-
|
|
3196
|
-
(0,
|
|
3331
|
+
_ts_decorate26([
|
|
3332
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3197
3333
|
description: "Maximum number of results",
|
|
3198
3334
|
example: 20,
|
|
3199
3335
|
default: 20
|
|
@@ -3202,10 +3338,10 @@ _ts_decorate25([
|
|
|
3202
3338
|
(0, import_class_transformer.Type)(() => Number),
|
|
3203
3339
|
(0, import_class_validator6.IsInt)(),
|
|
3204
3340
|
(0, import_class_validator6.Min)(1),
|
|
3205
|
-
|
|
3341
|
+
_ts_metadata21("design:type", Number)
|
|
3206
3342
|
], SelectOptionsQueryDto.prototype, "limit", void 0);
|
|
3207
|
-
|
|
3208
|
-
(0,
|
|
3343
|
+
_ts_decorate26([
|
|
3344
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3209
3345
|
description: "Number of results to skip",
|
|
3210
3346
|
example: 0,
|
|
3211
3347
|
default: 0
|
|
@@ -3214,85 +3350,85 @@ _ts_decorate25([
|
|
|
3214
3350
|
(0, import_class_transformer.Type)(() => Number),
|
|
3215
3351
|
(0, import_class_validator6.IsInt)(),
|
|
3216
3352
|
(0, import_class_validator6.Min)(0),
|
|
3217
|
-
|
|
3353
|
+
_ts_metadata21("design:type", Number)
|
|
3218
3354
|
], SelectOptionsQueryDto.prototype, "offset", void 0);
|
|
3219
|
-
|
|
3220
|
-
(0,
|
|
3355
|
+
_ts_decorate26([
|
|
3356
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3221
3357
|
description: "Comma-separated values to fetch specific options",
|
|
3222
3358
|
example: "1,2,3"
|
|
3223
3359
|
}),
|
|
3224
3360
|
(0, import_class_validator6.IsOptional)(),
|
|
3225
3361
|
(0, import_class_validator6.IsString)(),
|
|
3226
|
-
|
|
3362
|
+
_ts_metadata21("design:type", String)
|
|
3227
3363
|
], SelectOptionsQueryDto.prototype, "values", void 0);
|
|
3228
|
-
|
|
3229
|
-
(0,
|
|
3364
|
+
_ts_decorate26([
|
|
3365
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3230
3366
|
description: "Comma-separated IDs to exclude from results (already selected)",
|
|
3231
3367
|
example: "5,10"
|
|
3232
3368
|
}),
|
|
3233
3369
|
(0, import_class_validator6.IsOptional)(),
|
|
3234
3370
|
(0, import_class_validator6.IsString)(),
|
|
3235
|
-
|
|
3371
|
+
_ts_metadata21("design:type", String)
|
|
3236
3372
|
], SelectOptionsQueryDto.prototype, "excludeIds", void 0);
|
|
3237
|
-
|
|
3238
|
-
(0,
|
|
3373
|
+
_ts_decorate26([
|
|
3374
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3239
3375
|
description: "Column name for option value",
|
|
3240
3376
|
example: "id",
|
|
3241
3377
|
default: "id"
|
|
3242
3378
|
}),
|
|
3243
3379
|
(0, import_class_validator6.IsOptional)(),
|
|
3244
3380
|
(0, import_class_validator6.IsString)(),
|
|
3245
|
-
|
|
3381
|
+
_ts_metadata21("design:type", String)
|
|
3246
3382
|
], SelectOptionsQueryDto.prototype, "valueKey", void 0);
|
|
3247
|
-
|
|
3248
|
-
(0,
|
|
3383
|
+
_ts_decorate26([
|
|
3384
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3249
3385
|
description: "Column name for option label",
|
|
3250
3386
|
example: "name",
|
|
3251
3387
|
default: "name"
|
|
3252
3388
|
}),
|
|
3253
3389
|
(0, import_class_validator6.IsOptional)(),
|
|
3254
3390
|
(0, import_class_validator6.IsString)(),
|
|
3255
|
-
|
|
3391
|
+
_ts_metadata21("design:type", String)
|
|
3256
3392
|
], SelectOptionsQueryDto.prototype, "labelKey", void 0);
|
|
3257
|
-
|
|
3258
|
-
(0,
|
|
3393
|
+
_ts_decorate26([
|
|
3394
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3259
3395
|
description: "Column name for option description",
|
|
3260
3396
|
example: "description"
|
|
3261
3397
|
}),
|
|
3262
3398
|
(0, import_class_validator6.IsOptional)(),
|
|
3263
3399
|
(0, import_class_validator6.IsString)(),
|
|
3264
|
-
|
|
3400
|
+
_ts_metadata21("design:type", String)
|
|
3265
3401
|
], SelectOptionsQueryDto.prototype, "descriptionKey", void 0);
|
|
3266
|
-
|
|
3267
|
-
(0,
|
|
3402
|
+
_ts_decorate26([
|
|
3403
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3268
3404
|
description: "Comma-separated column names to include in option.additionals",
|
|
3269
3405
|
example: "locationName,availableQuantity"
|
|
3270
3406
|
}),
|
|
3271
3407
|
(0, import_class_validator6.IsOptional)(),
|
|
3272
3408
|
(0, import_class_validator6.IsString)(),
|
|
3273
|
-
|
|
3409
|
+
_ts_metadata21("design:type", String)
|
|
3274
3410
|
], SelectOptionsQueryDto.prototype, "additionalKeys", void 0);
|
|
3275
|
-
|
|
3276
|
-
(0,
|
|
3411
|
+
_ts_decorate26([
|
|
3412
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3277
3413
|
description: "Column name for group ID",
|
|
3278
3414
|
example: "regionId"
|
|
3279
3415
|
}),
|
|
3280
3416
|
(0, import_class_validator6.IsOptional)(),
|
|
3281
3417
|
(0, import_class_validator6.IsString)(),
|
|
3282
|
-
|
|
3418
|
+
_ts_metadata21("design:type", String)
|
|
3283
3419
|
], SelectOptionsQueryDto.prototype, "groupIdKey", void 0);
|
|
3284
|
-
|
|
3285
|
-
(0,
|
|
3420
|
+
_ts_decorate26([
|
|
3421
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3286
3422
|
description: "Column name to sort options by",
|
|
3287
3423
|
example: "name",
|
|
3288
3424
|
default: "name"
|
|
3289
3425
|
}),
|
|
3290
3426
|
(0, import_class_validator6.IsOptional)(),
|
|
3291
3427
|
(0, import_class_validator6.IsString)(),
|
|
3292
|
-
|
|
3428
|
+
_ts_metadata21("design:type", String)
|
|
3293
3429
|
], SelectOptionsQueryDto.prototype, "orderByKey", void 0);
|
|
3294
|
-
|
|
3295
|
-
(0,
|
|
3430
|
+
_ts_decorate26([
|
|
3431
|
+
(0, import_swagger14.ApiPropertyOptional)({
|
|
3296
3432
|
description: "Sort direction for options",
|
|
3297
3433
|
example: "asc",
|
|
3298
3434
|
default: "asc",
|
|
@@ -3307,23 +3443,23 @@ _ts_decorate25([
|
|
|
3307
3443
|
"asc",
|
|
3308
3444
|
"desc"
|
|
3309
3445
|
]),
|
|
3310
|
-
|
|
3446
|
+
_ts_metadata21("design:type", String)
|
|
3311
3447
|
], SelectOptionsQueryDto.prototype, "orderDirection", void 0);
|
|
3312
3448
|
|
|
3313
3449
|
// src/database/dto/success-response.dto.ts
|
|
3314
|
-
var
|
|
3450
|
+
var import_swagger15 = require("@nestjs/swagger");
|
|
3315
3451
|
var import_class_validator7 = require("class-validator");
|
|
3316
|
-
function
|
|
3452
|
+
function _ts_decorate27(decorators, target, key, desc3) {
|
|
3317
3453
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
3318
3454
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
3319
3455
|
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;
|
|
3320
3456
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3321
3457
|
}
|
|
3322
|
-
__name(
|
|
3323
|
-
function
|
|
3458
|
+
__name(_ts_decorate27, "_ts_decorate");
|
|
3459
|
+
function _ts_metadata22(k, v) {
|
|
3324
3460
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3325
3461
|
}
|
|
3326
|
-
__name(
|
|
3462
|
+
__name(_ts_metadata22, "_ts_metadata");
|
|
3327
3463
|
var SuccessResponseDto = class {
|
|
3328
3464
|
static {
|
|
3329
3465
|
__name(this, "SuccessResponseDto");
|
|
@@ -3331,36 +3467,36 @@ var SuccessResponseDto = class {
|
|
|
3331
3467
|
success;
|
|
3332
3468
|
message;
|
|
3333
3469
|
};
|
|
3334
|
-
|
|
3335
|
-
(0,
|
|
3470
|
+
_ts_decorate27([
|
|
3471
|
+
(0, import_swagger15.ApiProperty)({
|
|
3336
3472
|
example: true
|
|
3337
3473
|
}),
|
|
3338
3474
|
(0, import_class_validator7.IsNotEmpty)(),
|
|
3339
3475
|
(0, import_class_validator7.IsBoolean)(),
|
|
3340
|
-
|
|
3476
|
+
_ts_metadata22("design:type", Boolean)
|
|
3341
3477
|
], SuccessResponseDto.prototype, "success", void 0);
|
|
3342
|
-
|
|
3343
|
-
(0,
|
|
3478
|
+
_ts_decorate27([
|
|
3479
|
+
(0, import_swagger15.ApiProperty)({
|
|
3344
3480
|
example: "Operation completed successfully"
|
|
3345
3481
|
}),
|
|
3346
3482
|
(0, import_class_validator7.IsNotEmpty)(),
|
|
3347
3483
|
(0, import_class_validator7.IsString)(),
|
|
3348
|
-
|
|
3484
|
+
_ts_metadata22("design:type", String)
|
|
3349
3485
|
], SuccessResponseDto.prototype, "message", void 0);
|
|
3350
3486
|
|
|
3351
3487
|
// src/database/dto/table-response.dto.ts
|
|
3352
|
-
var
|
|
3353
|
-
function
|
|
3488
|
+
var import_swagger16 = require("@nestjs/swagger");
|
|
3489
|
+
function _ts_decorate28(decorators, target, key, desc3) {
|
|
3354
3490
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
3355
3491
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
3356
3492
|
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;
|
|
3357
3493
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3358
3494
|
}
|
|
3359
|
-
__name(
|
|
3360
|
-
function
|
|
3495
|
+
__name(_ts_decorate28, "_ts_decorate");
|
|
3496
|
+
function _ts_metadata23(k, v) {
|
|
3361
3497
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3362
3498
|
}
|
|
3363
|
-
__name(
|
|
3499
|
+
__name(_ts_metadata23, "_ts_metadata");
|
|
3364
3500
|
var TableResponseDto = class {
|
|
3365
3501
|
static {
|
|
3366
3502
|
__name(this, "TableResponseDto");
|
|
@@ -3370,25 +3506,55 @@ var TableResponseDto = class {
|
|
|
3370
3506
|
state;
|
|
3371
3507
|
activeViewId;
|
|
3372
3508
|
};
|
|
3373
|
-
|
|
3374
|
-
(0,
|
|
3375
|
-
|
|
3509
|
+
_ts_decorate28([
|
|
3510
|
+
(0, import_swagger16.ApiProperty)(),
|
|
3511
|
+
_ts_metadata23("design:type", Array)
|
|
3376
3512
|
], TableResponseDto.prototype, "result", void 0);
|
|
3377
|
-
|
|
3378
|
-
(0,
|
|
3379
|
-
|
|
3513
|
+
_ts_decorate28([
|
|
3514
|
+
(0, import_swagger16.ApiProperty)(),
|
|
3515
|
+
_ts_metadata23("design:type", Number)
|
|
3380
3516
|
], TableResponseDto.prototype, "count", void 0);
|
|
3381
|
-
|
|
3382
|
-
(0,
|
|
3383
|
-
|
|
3517
|
+
_ts_decorate28([
|
|
3518
|
+
(0, import_swagger16.ApiProperty)(),
|
|
3519
|
+
_ts_metadata23("design:type", typeof TableViewState === "undefined" ? Object : TableViewState)
|
|
3384
3520
|
], TableResponseDto.prototype, "state", void 0);
|
|
3385
|
-
|
|
3386
|
-
(0,
|
|
3521
|
+
_ts_decorate28([
|
|
3522
|
+
(0, import_swagger16.ApiPropertyOptional)({
|
|
3387
3523
|
nullable: true
|
|
3388
3524
|
}),
|
|
3389
|
-
|
|
3525
|
+
_ts_metadata23("design:type", Object)
|
|
3390
3526
|
], TableResponseDto.prototype, "activeViewId", void 0);
|
|
3391
3527
|
|
|
3528
|
+
// src/database/filter/cursor.codec.ts
|
|
3529
|
+
var CursorCodec = class {
|
|
3530
|
+
static {
|
|
3531
|
+
__name(this, "CursorCodec");
|
|
3532
|
+
}
|
|
3533
|
+
// Encodes ORDER BY boundary values (id tie-breaker last) into a base64url JSON string
|
|
3534
|
+
static encode(values) {
|
|
3535
|
+
const serialized = values.map((v) => {
|
|
3536
|
+
if (v instanceof Date) return {
|
|
3537
|
+
__t: "date",
|
|
3538
|
+
v: v.toISOString()
|
|
3539
|
+
};
|
|
3540
|
+
if (v === null || v === void 0) return null;
|
|
3541
|
+
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean") return v;
|
|
3542
|
+
return String(v);
|
|
3543
|
+
});
|
|
3544
|
+
const json = JSON.stringify(serialized);
|
|
3545
|
+
return Buffer.from(json, "utf8").toString("base64url");
|
|
3546
|
+
}
|
|
3547
|
+
// Decodes a cursor back into the ordered boundary values, rehydrating ISO strings as Dates
|
|
3548
|
+
static decode(cursor) {
|
|
3549
|
+
const json = Buffer.from(cursor, "base64url").toString("utf8");
|
|
3550
|
+
const parsed = JSON.parse(json);
|
|
3551
|
+
return parsed.map((v) => {
|
|
3552
|
+
if (v && typeof v === "object" && "__t" in v && v.__t === "date") return new Date(v.v);
|
|
3553
|
+
return v;
|
|
3554
|
+
});
|
|
3555
|
+
}
|
|
3556
|
+
};
|
|
3557
|
+
|
|
3392
3558
|
// src/database/filter/filter.processor.ts
|
|
3393
3559
|
var import_drizzle_orm3 = require("drizzle-orm");
|
|
3394
3560
|
var FilterProcessor = class {
|
|
@@ -3499,350 +3665,41 @@ var FilterOperators = {
|
|
|
3499
3665
|
IS_NOT_ANY_OF: "isNotAnyOf"
|
|
3500
3666
|
};
|
|
3501
3667
|
|
|
3502
|
-
// src/
|
|
3503
|
-
var
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
exponent: 2n
|
|
3520
|
-
};
|
|
3521
|
-
var HRK = {
|
|
3522
|
-
code: "HRK",
|
|
3523
|
-
base: 10n,
|
|
3524
|
-
exponent: 2n
|
|
3525
|
-
};
|
|
3526
|
-
var XAG = {
|
|
3527
|
-
code: "XAG",
|
|
3528
|
-
base: 10n,
|
|
3529
|
-
exponent: 0n
|
|
3530
|
-
};
|
|
3531
|
-
var XAU = {
|
|
3532
|
-
code: "XAU",
|
|
3533
|
-
base: 10n,
|
|
3534
|
-
exponent: 0n
|
|
3535
|
-
};
|
|
3536
|
-
var XDR = {
|
|
3537
|
-
code: "XDR",
|
|
3538
|
-
base: 10n,
|
|
3539
|
-
exponent: 0n
|
|
3540
|
-
};
|
|
3541
|
-
var XPD = {
|
|
3542
|
-
code: "XPD",
|
|
3543
|
-
base: 10n,
|
|
3544
|
-
exponent: 0n
|
|
3545
|
-
};
|
|
3546
|
-
var XPT = {
|
|
3547
|
-
code: "XPT",
|
|
3548
|
-
base: 10n,
|
|
3549
|
-
exponent: 0n
|
|
3550
|
-
};
|
|
3551
|
-
var ZWL = {
|
|
3552
|
-
code: "ZWL",
|
|
3553
|
-
base: 10n,
|
|
3554
|
-
exponent: 2n
|
|
3555
|
-
};
|
|
3556
|
-
var SUPPORTED_CURRENCIES = {
|
|
3557
|
-
AED: import_currencies.AED,
|
|
3558
|
-
AFN: import_currencies.AFN,
|
|
3559
|
-
ALL: import_currencies.ALL,
|
|
3560
|
-
AMD: import_currencies.AMD,
|
|
3561
|
-
ANG,
|
|
3562
|
-
AOA: import_currencies.AOA,
|
|
3563
|
-
ARS: import_currencies.ARS,
|
|
3564
|
-
AUD: import_currencies.AUD,
|
|
3565
|
-
AWG: import_currencies.AWG,
|
|
3566
|
-
AZN: import_currencies.AZN,
|
|
3567
|
-
BAM: import_currencies.BAM,
|
|
3568
|
-
BBD: import_currencies.BBD,
|
|
3569
|
-
BDT: import_currencies.BDT,
|
|
3570
|
-
BGN: import_currencies.BGN,
|
|
3571
|
-
BHD: import_currencies.BHD,
|
|
3572
|
-
BIF: import_currencies.BIF,
|
|
3573
|
-
BMD: import_currencies.BMD,
|
|
3574
|
-
BND: import_currencies.BND,
|
|
3575
|
-
BOB: import_currencies.BOB,
|
|
3576
|
-
BOV: import_currencies.BOV,
|
|
3577
|
-
BRL: import_currencies.BRL,
|
|
3578
|
-
BSD: import_currencies.BSD,
|
|
3579
|
-
BTN: import_currencies.BTN,
|
|
3580
|
-
BWP: import_currencies.BWP,
|
|
3581
|
-
BYN: import_currencies.BYN,
|
|
3582
|
-
BZD: import_currencies.BZD,
|
|
3583
|
-
CAD: import_currencies.CAD,
|
|
3584
|
-
CDF: import_currencies.CDF,
|
|
3585
|
-
CHE: import_currencies.CHE,
|
|
3586
|
-
CHF: import_currencies.CHF,
|
|
3587
|
-
CHW: import_currencies.CHW,
|
|
3588
|
-
CLF: import_currencies.CLF,
|
|
3589
|
-
CLP: import_currencies.CLP,
|
|
3590
|
-
CNY: import_currencies.CNY,
|
|
3591
|
-
COP: import_currencies.COP,
|
|
3592
|
-
COU: import_currencies.COU,
|
|
3593
|
-
CRC: import_currencies.CRC,
|
|
3594
|
-
CUP: import_currencies.CUP,
|
|
3595
|
-
CVE: import_currencies.CVE,
|
|
3596
|
-
CZK: import_currencies.CZK,
|
|
3597
|
-
DJF: import_currencies.DJF,
|
|
3598
|
-
DKK: import_currencies.DKK,
|
|
3599
|
-
DOP: import_currencies.DOP,
|
|
3600
|
-
DZD: import_currencies.DZD,
|
|
3601
|
-
EGP: import_currencies.EGP,
|
|
3602
|
-
ERN: import_currencies.ERN,
|
|
3603
|
-
ETB: import_currencies.ETB,
|
|
3604
|
-
EUR: import_currencies.EUR,
|
|
3605
|
-
FJD: import_currencies.FJD,
|
|
3606
|
-
FKP: import_currencies.FKP,
|
|
3607
|
-
GBP: import_currencies.GBP,
|
|
3608
|
-
GEL: import_currencies.GEL,
|
|
3609
|
-
GHS: import_currencies.GHS,
|
|
3610
|
-
GIP: import_currencies.GIP,
|
|
3611
|
-
GMD: import_currencies.GMD,
|
|
3612
|
-
GNF: import_currencies.GNF,
|
|
3613
|
-
GTQ: import_currencies.GTQ,
|
|
3614
|
-
GYD: import_currencies.GYD,
|
|
3615
|
-
HKD: import_currencies.HKD,
|
|
3616
|
-
HNL: import_currencies.HNL,
|
|
3617
|
-
HRK,
|
|
3618
|
-
HTG: import_currencies.HTG,
|
|
3619
|
-
HUF: import_currencies.HUF,
|
|
3620
|
-
IDR: import_currencies.IDR,
|
|
3621
|
-
ILS: import_currencies.ILS,
|
|
3622
|
-
INR: import_currencies.INR,
|
|
3623
|
-
IQD: import_currencies.IQD,
|
|
3624
|
-
IRR: import_currencies.IRR,
|
|
3625
|
-
ISK: import_currencies.ISK,
|
|
3626
|
-
JMD: import_currencies.JMD,
|
|
3627
|
-
JOD: import_currencies.JOD,
|
|
3628
|
-
JPY: import_currencies.JPY,
|
|
3629
|
-
KES: import_currencies.KES,
|
|
3630
|
-
KGS: import_currencies.KGS,
|
|
3631
|
-
KHR: import_currencies.KHR,
|
|
3632
|
-
KMF: import_currencies.KMF,
|
|
3633
|
-
KPW: import_currencies.KPW,
|
|
3634
|
-
KRW: import_currencies.KRW,
|
|
3635
|
-
KWD: import_currencies.KWD,
|
|
3636
|
-
KYD: import_currencies.KYD,
|
|
3637
|
-
KZT: import_currencies.KZT,
|
|
3638
|
-
LAK: import_currencies.LAK,
|
|
3639
|
-
LBP: import_currencies.LBP,
|
|
3640
|
-
LKR: import_currencies.LKR,
|
|
3641
|
-
LRD: import_currencies.LRD,
|
|
3642
|
-
LSL: import_currencies.LSL,
|
|
3643
|
-
LYD: import_currencies.LYD,
|
|
3644
|
-
MAD: import_currencies.MAD,
|
|
3645
|
-
MDL: import_currencies.MDL,
|
|
3646
|
-
MGA: import_currencies.MGA,
|
|
3647
|
-
MKD: import_currencies.MKD,
|
|
3648
|
-
MMK: import_currencies.MMK,
|
|
3649
|
-
MNT: import_currencies.MNT,
|
|
3650
|
-
MOP: import_currencies.MOP,
|
|
3651
|
-
MRU: import_currencies.MRU,
|
|
3652
|
-
MUR: import_currencies.MUR,
|
|
3653
|
-
MVR: import_currencies.MVR,
|
|
3654
|
-
MWK: import_currencies.MWK,
|
|
3655
|
-
MXN: import_currencies.MXN,
|
|
3656
|
-
MXV: import_currencies.MXV,
|
|
3657
|
-
MYR: import_currencies.MYR,
|
|
3658
|
-
MZN: import_currencies.MZN,
|
|
3659
|
-
NAD: import_currencies.NAD,
|
|
3660
|
-
NGN: import_currencies.NGN,
|
|
3661
|
-
NIO: import_currencies.NIO,
|
|
3662
|
-
NOK: import_currencies.NOK,
|
|
3663
|
-
NPR: import_currencies.NPR,
|
|
3664
|
-
NZD: import_currencies.NZD,
|
|
3665
|
-
OMR: import_currencies.OMR,
|
|
3666
|
-
PAB: import_currencies.PAB,
|
|
3667
|
-
PEN: import_currencies.PEN,
|
|
3668
|
-
PGK: import_currencies.PGK,
|
|
3669
|
-
PHP: import_currencies.PHP,
|
|
3670
|
-
PKR: import_currencies.PKR,
|
|
3671
|
-
PLN: import_currencies.PLN,
|
|
3672
|
-
PYG: import_currencies.PYG,
|
|
3673
|
-
QAR: import_currencies.QAR,
|
|
3674
|
-
RON: import_currencies.RON,
|
|
3675
|
-
RSD: import_currencies.RSD,
|
|
3676
|
-
RUB: import_currencies.RUB,
|
|
3677
|
-
RWF: import_currencies.RWF,
|
|
3678
|
-
SAR: import_currencies.SAR,
|
|
3679
|
-
SBD: import_currencies.SBD,
|
|
3680
|
-
SCR: import_currencies.SCR,
|
|
3681
|
-
SDG: import_currencies.SDG,
|
|
3682
|
-
SEK: import_currencies.SEK,
|
|
3683
|
-
SGD: import_currencies.SGD,
|
|
3684
|
-
SHP: import_currencies.SHP,
|
|
3685
|
-
SLE: import_currencies.SLE,
|
|
3686
|
-
SOS: import_currencies.SOS,
|
|
3687
|
-
SRD: import_currencies.SRD,
|
|
3688
|
-
SSP: import_currencies.SSP,
|
|
3689
|
-
STN: import_currencies.STN,
|
|
3690
|
-
SVC: import_currencies.SVC,
|
|
3691
|
-
SYP: import_currencies.SYP,
|
|
3692
|
-
SZL: import_currencies.SZL,
|
|
3693
|
-
THB: import_currencies.THB,
|
|
3694
|
-
TJS: import_currencies.TJS,
|
|
3695
|
-
TMT: import_currencies.TMT,
|
|
3696
|
-
TND: import_currencies.TND,
|
|
3697
|
-
TOP: import_currencies.TOP,
|
|
3698
|
-
TRY: import_currencies.TRY,
|
|
3699
|
-
TTD: import_currencies.TTD,
|
|
3700
|
-
TWD: import_currencies.TWD,
|
|
3701
|
-
TZS: import_currencies.TZS,
|
|
3702
|
-
UAH: import_currencies.UAH,
|
|
3703
|
-
UGX: import_currencies.UGX,
|
|
3704
|
-
USD: import_currencies.USD,
|
|
3705
|
-
USN: import_currencies.USN,
|
|
3706
|
-
UYI: import_currencies.UYI,
|
|
3707
|
-
UYU: import_currencies.UYU,
|
|
3708
|
-
UYW: import_currencies.UYW,
|
|
3709
|
-
UZS: import_currencies.UZS,
|
|
3710
|
-
VED: import_currencies.VED,
|
|
3711
|
-
VES: import_currencies.VES,
|
|
3712
|
-
VND: import_currencies.VND,
|
|
3713
|
-
VUV: import_currencies.VUV,
|
|
3714
|
-
WST: import_currencies.WST,
|
|
3715
|
-
XAD: import_currencies.XAD,
|
|
3716
|
-
XAF: import_currencies.XAF,
|
|
3717
|
-
XAG,
|
|
3718
|
-
XAU,
|
|
3719
|
-
XCD: import_currencies.XCD,
|
|
3720
|
-
XCG: import_currencies.XCG,
|
|
3721
|
-
XDR,
|
|
3722
|
-
XOF: import_currencies.XOF,
|
|
3723
|
-
XPD,
|
|
3724
|
-
XPF: import_currencies.XPF,
|
|
3725
|
-
XPT,
|
|
3726
|
-
YER: import_currencies.YER,
|
|
3727
|
-
ZAR: import_currencies.ZAR,
|
|
3728
|
-
ZMW: import_currencies.ZMW,
|
|
3729
|
-
ZWG: import_currencies.ZWG,
|
|
3730
|
-
ZWL
|
|
3731
|
-
};
|
|
3732
|
-
function resolveCurrency(currencyCode) {
|
|
3733
|
-
return SUPPORTED_CURRENCIES[currencyCode];
|
|
3734
|
-
}
|
|
3735
|
-
__name(resolveCurrency, "resolveCurrency");
|
|
3736
|
-
function minorToMajor(minor, currencyCode, transform) {
|
|
3737
|
-
const currency = resolveCurrency(currencyCode);
|
|
3738
|
-
const amount = (0, import_bigint.dinero)({
|
|
3739
|
-
amount: minor,
|
|
3740
|
-
currency
|
|
3741
|
-
});
|
|
3742
|
-
if (!transform) {
|
|
3743
|
-
return (0, import_bigint.toDecimal)(amount);
|
|
3744
|
-
}
|
|
3745
|
-
return (0, import_bigint.toDecimal)(amount, ({ value, currency: resolvedCurrency }) => transform({
|
|
3746
|
-
value,
|
|
3747
|
-
currency: resolvedCurrency
|
|
3748
|
-
}));
|
|
3749
|
-
}
|
|
3750
|
-
__name(minorToMajor, "minorToMajor");
|
|
3751
|
-
function majorToMinor(major, currencyCode, field = "amount") {
|
|
3752
|
-
const { exponent } = resolveCurrency(currencyCode);
|
|
3753
|
-
const scale = typeof exponent === "bigint" ? Number(exponent) : exponent;
|
|
3754
|
-
const trimmed = major.trim();
|
|
3755
|
-
if (!/^-?\d+(\.\d+)?$/.test(trimmed)) {
|
|
3756
|
-
throw new ValidationException({
|
|
3757
|
-
detail: `Invalid amount: "${major}".`,
|
|
3758
|
-
errors: [
|
|
3759
|
-
{
|
|
3760
|
-
field,
|
|
3761
|
-
message: "Enter a valid number."
|
|
3762
|
-
}
|
|
3763
|
-
]
|
|
3764
|
-
});
|
|
3765
|
-
}
|
|
3766
|
-
const isNegative = trimmed.startsWith("-");
|
|
3767
|
-
const unsignedValue = isNegative ? trimmed.slice(1) : trimmed;
|
|
3768
|
-
const [wholePart, fractionalPart = ""] = unsignedValue.split(".");
|
|
3769
|
-
if (fractionalPart.length > scale) {
|
|
3770
|
-
throw new ValidationException({
|
|
3771
|
-
detail: `Too many decimal places for ${currencyCode}. Maximum allowed is ${scale}.`,
|
|
3772
|
-
errors: [
|
|
3773
|
-
{
|
|
3774
|
-
field,
|
|
3775
|
-
message: `${currencyCode} allows up to ${scale} decimal place${scale === 1 ? "" : "s"}.`
|
|
3776
|
-
}
|
|
3777
|
-
]
|
|
3778
|
-
});
|
|
3779
|
-
}
|
|
3780
|
-
const paddedFraction = fractionalPart.padEnd(scale, "0");
|
|
3781
|
-
const normalizedDigits = `${wholePart}${paddedFraction}`.replace(/^0+(?=\d)/, "");
|
|
3782
|
-
const minor = BigInt(normalizedDigits || "0");
|
|
3783
|
-
return isNegative ? -minor : minor;
|
|
3784
|
-
}
|
|
3785
|
-
__name(majorToMinor, "majorToMinor");
|
|
3786
|
-
|
|
3787
|
-
// src/decorators/is-currency.decorator.ts
|
|
3788
|
-
function IsCurrency(validationOptions) {
|
|
3789
|
-
return (target, propertyName) => {
|
|
3790
|
-
(0, import_class_validator8.registerDecorator)({
|
|
3791
|
-
name: "isCurrency",
|
|
3792
|
-
target: target.constructor,
|
|
3793
|
-
propertyName: String(propertyName),
|
|
3794
|
-
options: validationOptions,
|
|
3795
|
-
validator: {
|
|
3796
|
-
validate(value) {
|
|
3797
|
-
if (!value || typeof value !== "object") return false;
|
|
3798
|
-
const { currency, value: amount } = value;
|
|
3799
|
-
if (typeof currency !== "string" || typeof amount !== "string") return false;
|
|
3800
|
-
if (!(currency in SUPPORTED_CURRENCIES)) return false;
|
|
3801
|
-
try {
|
|
3802
|
-
majorToMinor(amount, currency);
|
|
3803
|
-
return true;
|
|
3804
|
-
} catch {
|
|
3805
|
-
return false;
|
|
3806
|
-
}
|
|
3807
|
-
},
|
|
3808
|
-
defaultMessage(args) {
|
|
3809
|
-
return `${args.property} must be {currency, value} where currency is a valid ISO 4217 code and value precision matches the currency exponent.`;
|
|
3810
|
-
}
|
|
3811
|
-
}
|
|
3812
|
-
});
|
|
3813
|
-
};
|
|
3814
|
-
}
|
|
3815
|
-
__name(IsCurrency, "IsCurrency");
|
|
3816
|
-
|
|
3817
|
-
// src/decorators/is-currency-code.decorator.ts
|
|
3818
|
-
var import_class_validator9 = require("class-validator");
|
|
3819
|
-
function IsCurrencyCode(validationOptions) {
|
|
3820
|
-
return (target, propertyName) => {
|
|
3821
|
-
(0, import_class_validator9.registerDecorator)({
|
|
3822
|
-
name: "isCurrencyCode",
|
|
3823
|
-
target: target.constructor,
|
|
3824
|
-
propertyName: String(propertyName),
|
|
3825
|
-
options: validationOptions,
|
|
3826
|
-
validator: {
|
|
3827
|
-
validate(value) {
|
|
3828
|
-
if (typeof value !== "string") return false;
|
|
3829
|
-
return value in SUPPORTED_CURRENCIES;
|
|
3830
|
-
},
|
|
3831
|
-
defaultMessage(args) {
|
|
3832
|
-
return `${args.property} must be a valid ISO 4217 currency code.`;
|
|
3833
|
-
}
|
|
3668
|
+
// src/database/filter/keyset.processor.ts
|
|
3669
|
+
var import_drizzle_orm4 = require("drizzle-orm");
|
|
3670
|
+
var KeysetProcessor = class {
|
|
3671
|
+
static {
|
|
3672
|
+
__name(this, "KeysetProcessor");
|
|
3673
|
+
}
|
|
3674
|
+
// Builds the "after this row" predicate for keyset pagination via lexicographic OR-expansion.
|
|
3675
|
+
// Correct for multi-column AND mixed directions: OR over i of [ AND over j<i of eq(col_j, v_j) AND cmp(col_i, v_i) ].
|
|
3676
|
+
static buildAfter(orderBy, values) {
|
|
3677
|
+
const groups = [];
|
|
3678
|
+
for (let i = 0; i < orderBy.length; i++) {
|
|
3679
|
+
const current = orderBy[i];
|
|
3680
|
+
if (!current) continue;
|
|
3681
|
+
const conditions = [];
|
|
3682
|
+
for (let j = 0; j < i; j++) {
|
|
3683
|
+
const prior = orderBy[j];
|
|
3684
|
+
if (prior) conditions.push((0, import_drizzle_orm4.eq)(prior.column, values[j]));
|
|
3834
3685
|
}
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3686
|
+
const cmp = current.direction === "asc" ? import_drizzle_orm4.gt : import_drizzle_orm4.lt;
|
|
3687
|
+
conditions.push(cmp(current.column, values[i]));
|
|
3688
|
+
const group = conditions.length === 1 ? conditions[0] : (0, import_drizzle_orm4.and)(...conditions);
|
|
3689
|
+
if (group) groups.push(group);
|
|
3690
|
+
}
|
|
3691
|
+
const first = groups[0];
|
|
3692
|
+
if (groups.length === 1 && first) return first;
|
|
3693
|
+
return (0, import_drizzle_orm4.or)(...groups);
|
|
3694
|
+
}
|
|
3695
|
+
};
|
|
3839
3696
|
|
|
3840
3697
|
// src/decorators/is-date-time.decorator.ts
|
|
3841
|
-
var
|
|
3698
|
+
var import_class_validator8 = require("class-validator");
|
|
3842
3699
|
var UTC_ISO_DATETIME_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/;
|
|
3843
3700
|
function IsDateTime(validationOptions) {
|
|
3844
3701
|
return (target, propertyName) => {
|
|
3845
|
-
(0,
|
|
3702
|
+
(0, import_class_validator8.registerDecorator)({
|
|
3846
3703
|
name: "isDateTime",
|
|
3847
3704
|
target: target.constructor,
|
|
3848
3705
|
propertyName: String(propertyName),
|
|
@@ -3863,7 +3720,7 @@ function IsDateTime(validationOptions) {
|
|
|
3863
3720
|
__name(IsDateTime, "IsDateTime");
|
|
3864
3721
|
|
|
3865
3722
|
// src/decorators/uploaded-file.decorator.ts
|
|
3866
|
-
var
|
|
3723
|
+
var import_common53 = require("@nestjs/common");
|
|
3867
3724
|
async function collectFiles(request, fieldName) {
|
|
3868
3725
|
if (!fieldName) {
|
|
3869
3726
|
const file = await request.file();
|
|
@@ -3886,7 +3743,7 @@ async function collectFiles(request, fieldName) {
|
|
|
3886
3743
|
};
|
|
3887
3744
|
}
|
|
3888
3745
|
__name(collectFiles, "collectFiles");
|
|
3889
|
-
var UploadedFile = (0,
|
|
3746
|
+
var UploadedFile = (0, import_common53.createParamDecorator)(async (fieldName, ctx) => {
|
|
3890
3747
|
const request = ctx.switchToHttp().getRequest();
|
|
3891
3748
|
const { files } = await collectFiles(request, fieldName);
|
|
3892
3749
|
const file = files[0];
|
|
@@ -3910,7 +3767,7 @@ var UploadedFile = (0, import_common51.createParamDecorator)(async (fieldName, c
|
|
|
3910
3767
|
mimetype: file.mimetype
|
|
3911
3768
|
};
|
|
3912
3769
|
});
|
|
3913
|
-
var UploadedFiles = (0,
|
|
3770
|
+
var UploadedFiles = (0, import_common53.createParamDecorator)(async (fieldName, ctx) => {
|
|
3914
3771
|
const request = ctx.switchToHttp().getRequest();
|
|
3915
3772
|
const { files } = await collectFiles(request, fieldName);
|
|
3916
3773
|
if (files.length === 0) {
|
|
@@ -3938,682 +3795,203 @@ var UploadedFiles = (0, import_common51.createParamDecorator)(async (fieldName,
|
|
|
3938
3795
|
return results;
|
|
3939
3796
|
});
|
|
3940
3797
|
|
|
3941
|
-
// src/
|
|
3942
|
-
var
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3798
|
+
// src/filters/error-code.ts
|
|
3799
|
+
var import_common54 = require("@nestjs/common");
|
|
3800
|
+
var ErrorCode = /* @__PURE__ */ (function(ErrorCode2) {
|
|
3801
|
+
ErrorCode2["UNAUTHENTICATED"] = "UNAUTHENTICATED";
|
|
3802
|
+
ErrorCode2["FORBIDDEN"] = "FORBIDDEN";
|
|
3803
|
+
ErrorCode2["NOT_FOUND"] = "NOT_FOUND";
|
|
3804
|
+
ErrorCode2["VALIDATION_FAILED"] = "VALIDATION_FAILED";
|
|
3805
|
+
ErrorCode2["CONFLICT"] = "CONFLICT";
|
|
3806
|
+
ErrorCode2["RATE_LIMITED"] = "RATE_LIMITED";
|
|
3807
|
+
ErrorCode2["BAD_REQUEST"] = "BAD_REQUEST";
|
|
3808
|
+
ErrorCode2["INTERNAL"] = "INTERNAL";
|
|
3809
|
+
return ErrorCode2;
|
|
3810
|
+
})({});
|
|
3811
|
+
function errorCodeFromStatus(status) {
|
|
3812
|
+
switch (status) {
|
|
3813
|
+
case import_common54.HttpStatus.UNAUTHORIZED:
|
|
3814
|
+
return "UNAUTHENTICATED";
|
|
3815
|
+
case import_common54.HttpStatus.FORBIDDEN:
|
|
3816
|
+
return "FORBIDDEN";
|
|
3817
|
+
case import_common54.HttpStatus.NOT_FOUND:
|
|
3818
|
+
return "NOT_FOUND";
|
|
3819
|
+
case import_common54.HttpStatus.BAD_REQUEST:
|
|
3820
|
+
case import_common54.HttpStatus.UNPROCESSABLE_ENTITY:
|
|
3821
|
+
return "VALIDATION_FAILED";
|
|
3822
|
+
case import_common54.HttpStatus.CONFLICT:
|
|
3823
|
+
return "CONFLICT";
|
|
3824
|
+
case import_common54.HttpStatus.TOO_MANY_REQUESTS:
|
|
3825
|
+
return "RATE_LIMITED";
|
|
3826
|
+
default:
|
|
3827
|
+
if (status >= 400 && status < 500) {
|
|
3828
|
+
return "BAD_REQUEST";
|
|
3829
|
+
}
|
|
3830
|
+
return "INTERNAL";
|
|
3954
3831
|
}
|
|
3955
|
-
}
|
|
3956
|
-
|
|
3957
|
-
// src/email/email.module.ts
|
|
3958
|
-
var import_common53 = require("@nestjs/common");
|
|
3959
|
-
var import_config8 = require("@nestjs/config");
|
|
3832
|
+
}
|
|
3833
|
+
__name(errorCodeFromStatus, "errorCodeFromStatus");
|
|
3960
3834
|
|
|
3961
|
-
// src/
|
|
3962
|
-
var
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3835
|
+
// src/filters/problem-extraction.ts
|
|
3836
|
+
var import_common55 = require("@nestjs/common");
|
|
3837
|
+
function getHttpStatusTitle(status) {
|
|
3838
|
+
const enumKey = Object.entries(import_common55.HttpStatus).find(([key, value]) => value === status && Number.isNaN(Number(key)))?.[0];
|
|
3839
|
+
if (!enumKey) {
|
|
3840
|
+
return "Error";
|
|
3841
|
+
}
|
|
3842
|
+
return enumKey.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
3970
3843
|
}
|
|
3971
|
-
__name(
|
|
3972
|
-
function
|
|
3973
|
-
|
|
3844
|
+
__name(getHttpStatusTitle, "getHttpStatusTitle");
|
|
3845
|
+
function extractValidationFieldErrors(message) {
|
|
3846
|
+
return message.map((msg) => {
|
|
3847
|
+
if (typeof msg === "object" && "property" in msg && "constraints" in msg) {
|
|
3848
|
+
const constraintValues = Object.values(msg.constraints);
|
|
3849
|
+
return {
|
|
3850
|
+
field: msg.property,
|
|
3851
|
+
message: constraintValues[0] ?? "Validation failed"
|
|
3852
|
+
};
|
|
3853
|
+
}
|
|
3854
|
+
return null;
|
|
3855
|
+
}).filter((error) => error !== null);
|
|
3974
3856
|
}
|
|
3975
|
-
__name(
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3857
|
+
__name(extractValidationFieldErrors, "extractValidationFieldErrors");
|
|
3858
|
+
function extractProblemFromResponse(exceptionResponse, problemFallbackDetail) {
|
|
3859
|
+
let type = "about:blank";
|
|
3860
|
+
let label;
|
|
3861
|
+
let detail;
|
|
3862
|
+
let errors = [];
|
|
3863
|
+
if (typeof exceptionResponse === "string") {
|
|
3864
|
+
detail = exceptionResponse;
|
|
3865
|
+
return {
|
|
3866
|
+
type,
|
|
3867
|
+
label,
|
|
3868
|
+
detail,
|
|
3869
|
+
errors
|
|
3870
|
+
};
|
|
3979
3871
|
}
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
if (
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
}
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
maxRetries: 3
|
|
3995
|
-
});
|
|
3996
|
-
const senderEmail = this.configService.get("SENDER_EMAIL");
|
|
3997
|
-
const senderName = this.configService.get("SENDER_NAME");
|
|
3998
|
-
if (!senderEmail || !senderName) {
|
|
3999
|
-
this.logger.error("Sender email or name is not configured.");
|
|
4000
|
-
throw new Error("Email service configuration error: Missing SENDER_EMAIL or SENDER_NAME");
|
|
3872
|
+
if (exceptionResponse !== null && typeof exceptionResponse === "object") {
|
|
3873
|
+
const responseObj = exceptionResponse;
|
|
3874
|
+
if ("type" in responseObj || "label" in responseObj || "errors" in responseObj) {
|
|
3875
|
+
const problemResponse = responseObj;
|
|
3876
|
+
type = problemResponse.type ?? "about:blank";
|
|
3877
|
+
label = problemResponse.label;
|
|
3878
|
+
detail = problemResponse.detail ?? problemFallbackDetail;
|
|
3879
|
+
errors = problemResponse.errors ?? [];
|
|
3880
|
+
} else if ("message" in responseObj && Array.isArray(responseObj.message)) {
|
|
3881
|
+
errors = extractValidationFieldErrors(responseObj.message);
|
|
3882
|
+
detail = "Validation failed";
|
|
3883
|
+
} else if ("message" in responseObj) {
|
|
3884
|
+
const message = responseObj.message;
|
|
3885
|
+
detail = Array.isArray(message) ? message.join(", ") : message;
|
|
4001
3886
|
}
|
|
4002
|
-
this.senderEmail = senderEmail;
|
|
4003
|
-
this.senderName = senderName;
|
|
4004
|
-
this.logger.log("Brevo email service initialized successfully");
|
|
4005
|
-
}
|
|
4006
|
-
// Sends an email verification OTP to the given recipient
|
|
4007
|
-
async sendVerificationEmail(email, otp, expiresAt, displayName) {
|
|
4008
|
-
const name = displayName || "there";
|
|
4009
|
-
const expiryMinutes = Math.ceil((expiresAt.getTime() - Date.now()) / 6e4);
|
|
4010
|
-
const subject = "Verify Your Email - Vritti AI Cloud";
|
|
4011
|
-
const htmlContent = `
|
|
4012
|
-
<!DOCTYPE html>
|
|
4013
|
-
<html>
|
|
4014
|
-
<head>
|
|
4015
|
-
<meta charset="UTF-8">
|
|
4016
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
4017
|
-
</head>
|
|
4018
|
-
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;">
|
|
4019
|
-
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
4020
|
-
<tr>
|
|
4021
|
-
<td style="padding: 40px 20px;">
|
|
4022
|
-
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
4023
|
-
<!-- Header -->
|
|
4024
|
-
<tr>
|
|
4025
|
-
<td style="padding: 40px 40px 20px; text-align: center; border-bottom: 1px solid #e0e0e0;">
|
|
4026
|
-
<h1 style="margin: 0; color: #1a1a1a; font-size: 24px; font-weight: 600;">Email Verification</h1>
|
|
4027
|
-
</td>
|
|
4028
|
-
</tr>
|
|
4029
|
-
|
|
4030
|
-
<!-- Content -->
|
|
4031
|
-
<tr>
|
|
4032
|
-
<td style="padding: 40px;">
|
|
4033
|
-
<p style="margin: 0 0 20px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4034
|
-
Hello <strong>${name}</strong>,
|
|
4035
|
-
</p>
|
|
4036
|
-
<p style="margin: 0 0 30px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4037
|
-
Thank you for signing up with Vritti AI Cloud. Please use the following verification code to complete your registration:
|
|
4038
|
-
</p>
|
|
4039
|
-
|
|
4040
|
-
<!-- OTP Box -->
|
|
4041
|
-
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 30px; border-radius: 8px; text-align: center; margin: 30px 0;">
|
|
4042
|
-
<div style="color: #ffffff; font-size: 36px; font-weight: bold; letter-spacing: 10px; font-family: 'Courier New', monospace;">
|
|
4043
|
-
${otp}
|
|
4044
|
-
</div>
|
|
4045
|
-
</div>
|
|
4046
|
-
|
|
4047
|
-
<p style="margin: 30px 0 20px; color: #666666; font-size: 14px; line-height: 1.6;">
|
|
4048
|
-
<strong>Important:</strong> This code will expire in <strong>${expiryMinutes} minute${expiryMinutes === 1 ? "" : "s"}</strong>.
|
|
4049
|
-
</p>
|
|
4050
|
-
<p style="margin: 0; color: #666666; font-size: 14px; line-height: 1.6;">
|
|
4051
|
-
If you didn't request this verification, please ignore this email.
|
|
4052
|
-
</p>
|
|
4053
|
-
</td>
|
|
4054
|
-
</tr>
|
|
4055
|
-
|
|
4056
|
-
<!-- Footer -->
|
|
4057
|
-
<tr>
|
|
4058
|
-
<td style="padding: 30px 40px; border-top: 1px solid #e0e0e0; text-align: center;">
|
|
4059
|
-
<p style="margin: 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4060
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4061
|
-
</p>
|
|
4062
|
-
<p style="margin: 8px 0 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4063
|
-
This is an automated message, please do not reply.
|
|
4064
|
-
</p>
|
|
4065
|
-
</td>
|
|
4066
|
-
</tr>
|
|
4067
|
-
</table>
|
|
4068
|
-
</td>
|
|
4069
|
-
</tr>
|
|
4070
|
-
</table>
|
|
4071
|
-
</body>
|
|
4072
|
-
</html>
|
|
4073
|
-
`;
|
|
4074
|
-
const textContent = `
|
|
4075
|
-
Hello ${name},
|
|
4076
|
-
|
|
4077
|
-
Thank you for signing up with Vritti AI Cloud. Please use the following verification code to complete your registration:
|
|
4078
|
-
|
|
4079
|
-
Verification Code: ${otp}
|
|
4080
|
-
|
|
4081
|
-
This code will expire in ${expiryMinutes} minute${expiryMinutes === 1 ? "" : "s"}.
|
|
4082
|
-
|
|
4083
|
-
If you didn't request this verification, please ignore this email.
|
|
4084
|
-
|
|
4085
|
-
---
|
|
4086
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4087
|
-
This is an automated message, please do not reply.
|
|
4088
|
-
`.trim();
|
|
4089
|
-
await this.sendEmail({
|
|
4090
|
-
to: [
|
|
4091
|
-
{
|
|
4092
|
-
email,
|
|
4093
|
-
name
|
|
4094
|
-
}
|
|
4095
|
-
],
|
|
4096
|
-
subject,
|
|
4097
|
-
htmlContent,
|
|
4098
|
-
textContent
|
|
4099
|
-
});
|
|
4100
|
-
this.logger.log(`Verification email sent to ${email}`);
|
|
4101
|
-
}
|
|
4102
|
-
// Sends a password reset OTP to the given recipient
|
|
4103
|
-
async sendPasswordResetEmail(email, otp, expiresAt, displayName) {
|
|
4104
|
-
const name = displayName || "there";
|
|
4105
|
-
const expiryMinutes = Math.ceil((expiresAt.getTime() - Date.now()) / 6e4);
|
|
4106
|
-
const subject = "Reset Your Password - Vritti AI Cloud";
|
|
4107
|
-
const htmlContent = `
|
|
4108
|
-
<!DOCTYPE html>
|
|
4109
|
-
<html>
|
|
4110
|
-
<head>
|
|
4111
|
-
<meta charset="UTF-8">
|
|
4112
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
4113
|
-
</head>
|
|
4114
|
-
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;">
|
|
4115
|
-
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
4116
|
-
<tr>
|
|
4117
|
-
<td style="padding: 40px 20px;">
|
|
4118
|
-
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
4119
|
-
<!-- Header -->
|
|
4120
|
-
<tr>
|
|
4121
|
-
<td style="padding: 40px 40px 20px; text-align: center; border-bottom: 1px solid #e0e0e0;">
|
|
4122
|
-
<h1 style="margin: 0; color: #1a1a1a; font-size: 24px; font-weight: 600;">Password Reset</h1>
|
|
4123
|
-
</td>
|
|
4124
|
-
</tr>
|
|
4125
|
-
|
|
4126
|
-
<!-- Content -->
|
|
4127
|
-
<tr>
|
|
4128
|
-
<td style="padding: 40px;">
|
|
4129
|
-
<p style="margin: 0 0 20px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4130
|
-
Hello <strong>${name}</strong>,
|
|
4131
|
-
</p>
|
|
4132
|
-
<p style="margin: 0 0 30px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4133
|
-
We received a request to reset your password. Use the following code to complete the process:
|
|
4134
|
-
</p>
|
|
4135
|
-
|
|
4136
|
-
<!-- OTP Box -->
|
|
4137
|
-
<div style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); padding: 30px; border-radius: 8px; text-align: center; margin: 30px 0;">
|
|
4138
|
-
<div style="color: #ffffff; font-size: 36px; font-weight: bold; letter-spacing: 10px; font-family: 'Courier New', monospace;">
|
|
4139
|
-
${otp}
|
|
4140
|
-
</div>
|
|
4141
|
-
</div>
|
|
4142
|
-
|
|
4143
|
-
<p style="margin: 30px 0 20px; color: #666666; font-size: 14px; line-height: 1.6;">
|
|
4144
|
-
<strong>Important:</strong> This code will expire in <strong>${expiryMinutes} minute${expiryMinutes === 1 ? "" : "s"}</strong>.
|
|
4145
|
-
</p>
|
|
4146
|
-
<p style="margin: 0 0 20px; color: #666666; font-size: 14px; line-height: 1.6;">
|
|
4147
|
-
If you didn't request a password reset, please ignore this email and your password will remain unchanged.
|
|
4148
|
-
</p>
|
|
4149
|
-
<div style="background-color: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; margin-top: 20px; border-radius: 4px;">
|
|
4150
|
-
<p style="margin: 0; color: #856404; font-size: 13px; line-height: 1.5;">
|
|
4151
|
-
<strong>Security Tip:</strong> Never share this code with anyone. Vritti will never ask for your verification code.
|
|
4152
|
-
</p>
|
|
4153
|
-
</div>
|
|
4154
|
-
</td>
|
|
4155
|
-
</tr>
|
|
4156
|
-
|
|
4157
|
-
<!-- Footer -->
|
|
4158
|
-
<tr>
|
|
4159
|
-
<td style="padding: 30px 40px; border-top: 1px solid #e0e0e0; text-align: center;">
|
|
4160
|
-
<p style="margin: 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4161
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4162
|
-
</p>
|
|
4163
|
-
<p style="margin: 8px 0 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4164
|
-
This is an automated message, please do not reply.
|
|
4165
|
-
</p>
|
|
4166
|
-
</td>
|
|
4167
|
-
</tr>
|
|
4168
|
-
</table>
|
|
4169
|
-
</td>
|
|
4170
|
-
</tr>
|
|
4171
|
-
</table>
|
|
4172
|
-
</body>
|
|
4173
|
-
</html>
|
|
4174
|
-
`;
|
|
4175
|
-
const textContent = `
|
|
4176
|
-
Hello ${name},
|
|
4177
|
-
|
|
4178
|
-
We received a request to reset your password. Use the following code to complete the process:
|
|
4179
|
-
|
|
4180
|
-
Reset Code: ${otp}
|
|
4181
|
-
|
|
4182
|
-
This code will expire in ${expiryMinutes} minute${expiryMinutes === 1 ? "" : "s"}.
|
|
4183
|
-
|
|
4184
|
-
If you didn't request a password reset, please ignore this email and your password will remain unchanged.
|
|
4185
|
-
|
|
4186
|
-
SECURITY TIP: Never share this code with anyone. Vritti will never ask for your verification code.
|
|
4187
|
-
|
|
4188
|
-
---
|
|
4189
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4190
|
-
This is an automated message, please do not reply.
|
|
4191
|
-
`.trim();
|
|
4192
|
-
await this.sendEmail({
|
|
4193
|
-
to: [
|
|
4194
|
-
{
|
|
4195
|
-
email,
|
|
4196
|
-
name
|
|
4197
|
-
}
|
|
4198
|
-
],
|
|
4199
|
-
subject,
|
|
4200
|
-
htmlContent,
|
|
4201
|
-
textContent
|
|
4202
|
-
});
|
|
4203
|
-
this.logger.log(`Password reset email sent to ${email}`);
|
|
4204
|
-
}
|
|
4205
|
-
// Sends an email change notification to the old address with a revert link
|
|
4206
|
-
async sendEmailChangeNotification(oldEmail, newEmail, revertToken, revertExpiresAt, displayName) {
|
|
4207
|
-
const name = displayName || "there";
|
|
4208
|
-
const subject = "Your Email Address Has Been Changed - Vritti AI Cloud";
|
|
4209
|
-
const hoursUntilExpiry = Math.floor((revertExpiresAt.getTime() - Date.now()) / (1e3 * 60 * 60));
|
|
4210
|
-
const revertLink = `https://local.vrittiai.com:3012/settings/profile/revert-email?token=${revertToken}`;
|
|
4211
|
-
const htmlContent = `
|
|
4212
|
-
<!DOCTYPE html>
|
|
4213
|
-
<html>
|
|
4214
|
-
<head>
|
|
4215
|
-
<meta charset="UTF-8">
|
|
4216
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
4217
|
-
</head>
|
|
4218
|
-
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;">
|
|
4219
|
-
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
4220
|
-
<tr>
|
|
4221
|
-
<td style="padding: 40px 20px;">
|
|
4222
|
-
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
4223
|
-
<!-- Header -->
|
|
4224
|
-
<tr>
|
|
4225
|
-
<td style="padding: 40px 40px 20px; text-align: center; border-bottom: 1px solid #e0e0e0;">
|
|
4226
|
-
<h1 style="margin: 0; color: #1a1a1a; font-size: 24px; font-weight: 600;">Email Address Changed</h1>
|
|
4227
|
-
</td>
|
|
4228
|
-
</tr>
|
|
4229
|
-
|
|
4230
|
-
<!-- Content -->
|
|
4231
|
-
<tr>
|
|
4232
|
-
<td style="padding: 40px;">
|
|
4233
|
-
<p style="margin: 0 0 20px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4234
|
-
Hello <strong>${name}</strong>,
|
|
4235
|
-
</p>
|
|
4236
|
-
<p style="margin: 0 0 30px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4237
|
-
We're writing to inform you that your Vritti AI Cloud email address has been successfully changed.
|
|
4238
|
-
</p>
|
|
4239
|
-
|
|
4240
|
-
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin: 30px 0;">
|
|
4241
|
-
<p style="margin: 0 0 10px; color: #666666; font-size: 14px;">
|
|
4242
|
-
<strong>Previous Email:</strong>
|
|
4243
|
-
</p>
|
|
4244
|
-
<p style="margin: 0 0 20px; color: #333333; font-size: 16px; font-family: monospace;">
|
|
4245
|
-
${oldEmail}
|
|
4246
|
-
</p>
|
|
4247
|
-
<p style="margin: 0 0 10px; color: #666666; font-size: 14px;">
|
|
4248
|
-
<strong>New Email:</strong>
|
|
4249
|
-
</p>
|
|
4250
|
-
<p style="margin: 0; color: #333333; font-size: 16px; font-family: monospace;">
|
|
4251
|
-
${newEmail}
|
|
4252
|
-
</p>
|
|
4253
|
-
</div>
|
|
4254
|
-
|
|
4255
|
-
<div style="background-color: #fff3cd; border-left: 4px solid #ffc107; padding: 20px; margin: 30px 0; border-radius: 4px;">
|
|
4256
|
-
<p style="margin: 0 0 15px; color: #856404; font-size: 14px; line-height: 1.6;">
|
|
4257
|
-
<strong>Didn't make this change?</strong>
|
|
4258
|
-
</p>
|
|
4259
|
-
<p style="margin: 0 0 20px; color: #856404; font-size: 14px; line-height: 1.6;">
|
|
4260
|
-
If you did not authorize this change, you can revert it within the next <strong>${hoursUntilExpiry} hours</strong> by clicking the button below:
|
|
4261
|
-
</p>
|
|
4262
|
-
<div style="text-align: center;">
|
|
4263
|
-
<a href="${revertLink}" style="display: inline-block; padding: 12px 30px; background-color: #dc3545; color: #ffffff; text-decoration: none; border-radius: 6px; font-weight: 600; font-size: 14px;">
|
|
4264
|
-
Revert Email Change
|
|
4265
|
-
</a>
|
|
4266
|
-
</div>
|
|
4267
|
-
</div>
|
|
4268
|
-
|
|
4269
|
-
<p style="margin: 30px 0 0; color: #666666; font-size: 14px; line-height: 1.6;">
|
|
4270
|
-
If you made this change, you can safely ignore this email.
|
|
4271
|
-
</p>
|
|
4272
|
-
</td>
|
|
4273
|
-
</tr>
|
|
4274
|
-
|
|
4275
|
-
<!-- Footer -->
|
|
4276
|
-
<tr>
|
|
4277
|
-
<td style="padding: 30px 40px; border-top: 1px solid #e0e0e0; text-align: center;">
|
|
4278
|
-
<p style="margin: 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4279
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4280
|
-
</p>
|
|
4281
|
-
<p style="margin: 8px 0 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4282
|
-
This is an automated message, please do not reply.
|
|
4283
|
-
</p>
|
|
4284
|
-
</td>
|
|
4285
|
-
</tr>
|
|
4286
|
-
</table>
|
|
4287
|
-
</td>
|
|
4288
|
-
</tr>
|
|
4289
|
-
</table>
|
|
4290
|
-
</body>
|
|
4291
|
-
</html>
|
|
4292
|
-
`;
|
|
4293
|
-
const textContent = `
|
|
4294
|
-
Hello ${name},
|
|
4295
|
-
|
|
4296
|
-
We're writing to inform you that your Vritti AI Cloud email address has been successfully changed.
|
|
4297
|
-
|
|
4298
|
-
Previous Email: ${oldEmail}
|
|
4299
|
-
New Email: ${newEmail}
|
|
4300
|
-
|
|
4301
|
-
DIDN'T MAKE THIS CHANGE?
|
|
4302
|
-
|
|
4303
|
-
If you did not authorize this change, you can revert it within the next ${hoursUntilExpiry} hours by visiting:
|
|
4304
|
-
${revertLink}
|
|
4305
|
-
|
|
4306
|
-
If you made this change, you can safely ignore this email.
|
|
4307
|
-
|
|
4308
|
-
---
|
|
4309
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4310
|
-
This is an automated message, please do not reply.
|
|
4311
|
-
`.trim();
|
|
4312
|
-
await this.sendEmail({
|
|
4313
|
-
to: [
|
|
4314
|
-
{
|
|
4315
|
-
email: oldEmail,
|
|
4316
|
-
name
|
|
4317
|
-
}
|
|
4318
|
-
],
|
|
4319
|
-
subject,
|
|
4320
|
-
htmlContent,
|
|
4321
|
-
textContent
|
|
4322
|
-
});
|
|
4323
|
-
this.logger.log(`Email change notification sent to ${oldEmail}`);
|
|
4324
|
-
}
|
|
4325
|
-
// Sends a confirmation to the restored email address after a revert
|
|
4326
|
-
async sendEmailRevertConfirmation(email, displayName) {
|
|
4327
|
-
const name = displayName || "there";
|
|
4328
|
-
const subject = "Email Address Change Reverted - Vritti AI Cloud";
|
|
4329
|
-
const htmlContent = `
|
|
4330
|
-
<!DOCTYPE html>
|
|
4331
|
-
<html>
|
|
4332
|
-
<head>
|
|
4333
|
-
<meta charset="UTF-8">
|
|
4334
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
4335
|
-
</head>
|
|
4336
|
-
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;">
|
|
4337
|
-
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
4338
|
-
<tr>
|
|
4339
|
-
<td style="padding: 40px 20px;">
|
|
4340
|
-
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
4341
|
-
<!-- Header -->
|
|
4342
|
-
<tr>
|
|
4343
|
-
<td style="padding: 40px 40px 20px; text-align: center; border-bottom: 1px solid #e0e0e0;">
|
|
4344
|
-
<h1 style="margin: 0; color: #1a1a1a; font-size: 24px; font-weight: 600;">Email Change Reverted</h1>
|
|
4345
|
-
</td>
|
|
4346
|
-
</tr>
|
|
4347
|
-
|
|
4348
|
-
<!-- Content -->
|
|
4349
|
-
<tr>
|
|
4350
|
-
<td style="padding: 40px;">
|
|
4351
|
-
<p style="margin: 0 0 20px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4352
|
-
Hello <strong>${name}</strong>,
|
|
4353
|
-
</p>
|
|
4354
|
-
<p style="margin: 0 0 30px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4355
|
-
Your recent email address change has been successfully reverted. Your email is now:
|
|
4356
|
-
</p>
|
|
4357
|
-
|
|
4358
|
-
<div style="background-color: #d4edda; padding: 20px; border-radius: 8px; margin: 30px 0; text-align: center;">
|
|
4359
|
-
<p style="margin: 0; color: #155724; font-size: 18px; font-weight: 600; font-family: monospace;">
|
|
4360
|
-
${email}
|
|
4361
|
-
</p>
|
|
4362
|
-
</div>
|
|
4363
|
-
|
|
4364
|
-
<p style="margin: 30px 0 20px; color: #666666; font-size: 14px; line-height: 1.6;">
|
|
4365
|
-
If you did not request this revert, please contact our support team immediately.
|
|
4366
|
-
</p>
|
|
4367
|
-
</td>
|
|
4368
|
-
</tr>
|
|
4369
|
-
|
|
4370
|
-
<!-- Footer -->
|
|
4371
|
-
<tr>
|
|
4372
|
-
<td style="padding: 30px 40px; border-top: 1px solid #e0e0e0; text-align: center;">
|
|
4373
|
-
<p style="margin: 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4374
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4375
|
-
</p>
|
|
4376
|
-
<p style="margin: 8px 0 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4377
|
-
This is an automated message, please do not reply.
|
|
4378
|
-
</p>
|
|
4379
|
-
</td>
|
|
4380
|
-
</tr>
|
|
4381
|
-
</table>
|
|
4382
|
-
</td>
|
|
4383
|
-
</tr>
|
|
4384
|
-
</table>
|
|
4385
|
-
</body>
|
|
4386
|
-
</html>
|
|
4387
|
-
`;
|
|
4388
|
-
const textContent = `
|
|
4389
|
-
Hello ${name},
|
|
4390
|
-
|
|
4391
|
-
Your recent email address change has been successfully reverted. Your email is now:
|
|
4392
|
-
|
|
4393
|
-
${email}
|
|
4394
|
-
|
|
4395
|
-
If you did not request this revert, please contact our support team immediately.
|
|
4396
|
-
|
|
4397
|
-
---
|
|
4398
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4399
|
-
This is an automated message, please do not reply.
|
|
4400
|
-
`.trim();
|
|
4401
|
-
await this.sendEmail({
|
|
4402
|
-
to: [
|
|
4403
|
-
{
|
|
4404
|
-
email,
|
|
4405
|
-
name
|
|
4406
|
-
}
|
|
4407
|
-
],
|
|
4408
|
-
subject,
|
|
4409
|
-
htmlContent,
|
|
4410
|
-
textContent
|
|
4411
|
-
});
|
|
4412
|
-
this.logger.log(`Email revert confirmation sent to ${email}`);
|
|
4413
|
-
}
|
|
4414
|
-
// Sends an invite email to a new portal user with their set-password link
|
|
4415
|
-
async sendInviteEmail(params) {
|
|
4416
|
-
const { to, name, inviteUrl } = params;
|
|
4417
|
-
const subject = "You have been invited to Vritti AI";
|
|
4418
|
-
const htmlContent = `
|
|
4419
|
-
<!DOCTYPE html>
|
|
4420
|
-
<html>
|
|
4421
|
-
<head>
|
|
4422
|
-
<meta charset="UTF-8">
|
|
4423
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
4424
|
-
</head>
|
|
4425
|
-
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5;">
|
|
4426
|
-
<table role="presentation" style="width: 100%; border-collapse: collapse;">
|
|
4427
|
-
<tr>
|
|
4428
|
-
<td style="padding: 40px 20px;">
|
|
4429
|
-
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
|
4430
|
-
<!-- Header -->
|
|
4431
|
-
<tr>
|
|
4432
|
-
<td style="padding: 40px 40px 20px; text-align: center; border-bottom: 1px solid #e0e0e0;">
|
|
4433
|
-
<h1 style="margin: 0; color: #1a1a1a; font-size: 24px; font-weight: 600;">You're Invited</h1>
|
|
4434
|
-
</td>
|
|
4435
|
-
</tr>
|
|
4436
|
-
|
|
4437
|
-
<!-- Content -->
|
|
4438
|
-
<tr>
|
|
4439
|
-
<td style="padding: 40px;">
|
|
4440
|
-
<p style="margin: 0 0 20px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4441
|
-
Hello <strong>${name}</strong>,
|
|
4442
|
-
</p>
|
|
4443
|
-
<p style="margin: 0 0 30px; color: #333333; font-size: 16px; line-height: 1.6;">
|
|
4444
|
-
You have been invited to join Vritti AI. Click the button below to set your password and get started.
|
|
4445
|
-
</p>
|
|
4446
|
-
|
|
4447
|
-
<div style="text-align: center; margin: 30px 0;">
|
|
4448
|
-
<a href="${inviteUrl}" style="display: inline-block; padding: 14px 32px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #ffffff; text-decoration: none; border-radius: 6px; font-weight: 600; font-size: 16px;">
|
|
4449
|
-
Set Your Password
|
|
4450
|
-
</a>
|
|
4451
|
-
</div>
|
|
4452
|
-
|
|
4453
|
-
<p style="margin: 30px 0 0; color: #666666; font-size: 14px; line-height: 1.6;">
|
|
4454
|
-
If you did not expect this invitation, you can safely ignore this email.
|
|
4455
|
-
</p>
|
|
4456
|
-
</td>
|
|
4457
|
-
</tr>
|
|
4458
|
-
|
|
4459
|
-
<!-- Footer -->
|
|
4460
|
-
<tr>
|
|
4461
|
-
<td style="padding: 30px 40px; border-top: 1px solid #e0e0e0; text-align: center;">
|
|
4462
|
-
<p style="margin: 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4463
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4464
|
-
</p>
|
|
4465
|
-
<p style="margin: 8px 0 0; color: #999999; font-size: 12px; line-height: 1.5;">
|
|
4466
|
-
This is an automated message, please do not reply.
|
|
4467
|
-
</p>
|
|
4468
|
-
</td>
|
|
4469
|
-
</tr>
|
|
4470
|
-
</table>
|
|
4471
|
-
</td>
|
|
4472
|
-
</tr>
|
|
4473
|
-
</table>
|
|
4474
|
-
</body>
|
|
4475
|
-
</html>
|
|
4476
|
-
`;
|
|
4477
|
-
const textContent = `
|
|
4478
|
-
Hello ${name},
|
|
4479
|
-
|
|
4480
|
-
You have been invited to join Vritti AI. Visit the link below to set your password and get started:
|
|
4481
|
-
|
|
4482
|
-
${inviteUrl}
|
|
4483
|
-
|
|
4484
|
-
If you did not expect this invitation, you can safely ignore this email.
|
|
4485
|
-
|
|
4486
|
-
---
|
|
4487
|
-
Vritti AI Cloud - Cloud Management Platform
|
|
4488
|
-
This is an automated message, please do not reply.
|
|
4489
|
-
`.trim();
|
|
4490
|
-
await this.sendEmail({
|
|
4491
|
-
to: [
|
|
4492
|
-
{
|
|
4493
|
-
email: to,
|
|
4494
|
-
name
|
|
4495
|
-
}
|
|
4496
|
-
],
|
|
4497
|
-
subject,
|
|
4498
|
-
htmlContent,
|
|
4499
|
-
textContent
|
|
4500
|
-
});
|
|
4501
|
-
this.logger.log(`Invite email sent to ${to}`);
|
|
4502
3887
|
}
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
3888
|
+
return {
|
|
3889
|
+
type,
|
|
3890
|
+
label,
|
|
3891
|
+
detail,
|
|
3892
|
+
errors
|
|
3893
|
+
};
|
|
3894
|
+
}
|
|
3895
|
+
__name(extractProblemFromResponse, "extractProblemFromResponse");
|
|
3896
|
+
|
|
3897
|
+
// src/filters/graphql-format-error.ts
|
|
3898
|
+
function isHttpExceptionLike(error) {
|
|
3899
|
+
return error instanceof Error && typeof error.getStatus === "function" && typeof error.getResponse === "function";
|
|
3900
|
+
}
|
|
3901
|
+
__name(isHttpExceptionLike, "isHttpExceptionLike");
|
|
3902
|
+
function isProblemLike(error) {
|
|
3903
|
+
if (error == null || typeof error !== "object") {
|
|
3904
|
+
return false;
|
|
4514
3905
|
}
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
htmlContent: "<p>Test</p>"
|
|
4530
|
-
});
|
|
4531
|
-
return true;
|
|
4532
|
-
} catch (err) {
|
|
4533
|
-
if (err instanceof import_brevo.BrevoError && err.statusCode === 400) {
|
|
4534
|
-
return true;
|
|
4535
|
-
}
|
|
4536
|
-
this.logger.error("Brevo connection verification failed:", err);
|
|
4537
|
-
return false;
|
|
3906
|
+
const o = error;
|
|
3907
|
+
return typeof o.status === "number" || typeof o.statusCode === "number";
|
|
3908
|
+
}
|
|
3909
|
+
__name(isProblemLike, "isProblemLike");
|
|
3910
|
+
function findProblemSource(error) {
|
|
3911
|
+
let current = error;
|
|
3912
|
+
for (let depth = 0; current && depth < 10; depth++) {
|
|
3913
|
+
if (isHttpExceptionLike(current)) {
|
|
3914
|
+
const status = current.getStatus();
|
|
3915
|
+
return {
|
|
3916
|
+
status,
|
|
3917
|
+
response: current.getResponse(),
|
|
3918
|
+
fallback: current.message ?? getHttpStatusTitle(status)
|
|
3919
|
+
};
|
|
4538
3920
|
}
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
name: this.senderName
|
|
4547
|
-
},
|
|
4548
|
-
to: emailData.to,
|
|
4549
|
-
subject: emailData.subject,
|
|
4550
|
-
htmlContent: emailData.htmlContent,
|
|
4551
|
-
textContent: emailData.textContent
|
|
4552
|
-
});
|
|
4553
|
-
this.logger.debug(`Email sent successfully. Message ID: ${result.messageId}`);
|
|
4554
|
-
} catch (err) {
|
|
4555
|
-
if (err instanceof import_brevo.BrevoTimeoutError) {
|
|
4556
|
-
this.logger.error("Brevo request timed out after retries.");
|
|
4557
|
-
throw new Error("Email sending failed: timeout");
|
|
4558
|
-
}
|
|
4559
|
-
if (err instanceof import_brevo.BrevoError) {
|
|
4560
|
-
if (err.statusCode === 429) {
|
|
4561
|
-
this.logger.error("Brevo rate limit exceeded after retries.");
|
|
4562
|
-
throw new Error("Email sending failed: rate limit exceeded");
|
|
4563
|
-
}
|
|
4564
|
-
if (err.statusCode === 401) {
|
|
4565
|
-
this.logger.error("Brevo authentication failed. Check your API key.");
|
|
4566
|
-
throw new Error("Email service authentication failed");
|
|
4567
|
-
}
|
|
4568
|
-
if (err.statusCode === 400) {
|
|
4569
|
-
this.logger.error("Bad request to Brevo API:", err.message);
|
|
4570
|
-
throw new Error(`Invalid email parameters: ${err.message}`);
|
|
4571
|
-
}
|
|
4572
|
-
this.logger.error(`Brevo API error ${err.statusCode}:`, err.message);
|
|
4573
|
-
throw new Error(`Email sending failed: ${err.message}`);
|
|
4574
|
-
}
|
|
4575
|
-
throw err;
|
|
3921
|
+
if (isProblemLike(current)) {
|
|
3922
|
+
const status = current.status ?? current.statusCode ?? 500;
|
|
3923
|
+
return {
|
|
3924
|
+
status,
|
|
3925
|
+
response: current,
|
|
3926
|
+
fallback: current.detail ?? current.message ?? getHttpStatusTitle(status)
|
|
3927
|
+
};
|
|
4576
3928
|
}
|
|
3929
|
+
const next = current;
|
|
3930
|
+
current = next.originalError ?? next.thrownValue;
|
|
4577
3931
|
}
|
|
4578
|
-
|
|
4579
|
-
EmailService = _ts_decorate28([
|
|
4580
|
-
(0, import_common52.Injectable)(),
|
|
4581
|
-
_ts_metadata23("design:type", Function),
|
|
4582
|
-
_ts_metadata23("design:paramtypes", [
|
|
4583
|
-
typeof import_config7.ConfigService === "undefined" ? Object : import_config7.ConfigService
|
|
4584
|
-
])
|
|
4585
|
-
], EmailService);
|
|
4586
|
-
|
|
4587
|
-
// src/email/email.module.ts
|
|
4588
|
-
function _ts_decorate29(decorators, target, key, desc3) {
|
|
4589
|
-
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
4590
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
4591
|
-
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;
|
|
4592
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3932
|
+
return void 0;
|
|
4593
3933
|
}
|
|
4594
|
-
__name(
|
|
4595
|
-
var
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
3934
|
+
__name(findProblemSource, "findProblemSource");
|
|
3935
|
+
var GENERIC_INTERNAL_MESSAGE = "Internal server error";
|
|
3936
|
+
function createGraphqlFormatError(opts) {
|
|
3937
|
+
const { isProduction, getTraceId } = opts;
|
|
3938
|
+
return (formattedError, error) => {
|
|
3939
|
+
const gqlError = error ?? void 0;
|
|
3940
|
+
const source = findProblemSource(gqlError);
|
|
3941
|
+
let status = 500;
|
|
3942
|
+
let detail;
|
|
3943
|
+
let label;
|
|
3944
|
+
let fieldErrors = [];
|
|
3945
|
+
if (source) {
|
|
3946
|
+
status = source.status;
|
|
3947
|
+
const extracted = extractProblemFromResponse(source.response, source.fallback);
|
|
3948
|
+
detail = extracted.detail;
|
|
3949
|
+
label = extracted.label;
|
|
3950
|
+
fieldErrors = extracted.errors;
|
|
3951
|
+
}
|
|
3952
|
+
const code = errorCodeFromStatus(status);
|
|
3953
|
+
let message = detail ?? formattedError.message;
|
|
3954
|
+
if (code === "INTERNAL" && isProduction) {
|
|
3955
|
+
message = GENERIC_INTERNAL_MESSAGE;
|
|
3956
|
+
}
|
|
3957
|
+
const incoming = {
|
|
3958
|
+
...formattedError.extensions ?? {}
|
|
3959
|
+
};
|
|
3960
|
+
const traceId = getTraceId?.();
|
|
3961
|
+
const timestamp2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
3962
|
+
const extensions = {
|
|
3963
|
+
...incoming,
|
|
3964
|
+
// Always our canonical code — overrides Apollo's default INTERNAL_SERVER_ERROR.
|
|
3965
|
+
code,
|
|
3966
|
+
...traceId !== void 0 ? {
|
|
3967
|
+
traceId
|
|
3968
|
+
} : {},
|
|
3969
|
+
timestamp: timestamp2,
|
|
3970
|
+
...label !== void 0 ? {
|
|
3971
|
+
label
|
|
3972
|
+
} : {},
|
|
3973
|
+
...fieldErrors.length > 0 ? {
|
|
3974
|
+
fieldErrors
|
|
3975
|
+
} : {}
|
|
3976
|
+
};
|
|
3977
|
+
if (isProduction) {
|
|
3978
|
+
delete extensions.stacktrace;
|
|
3979
|
+
delete extensions.exception;
|
|
3980
|
+
delete extensions.originalError;
|
|
3981
|
+
}
|
|
3982
|
+
const result = {
|
|
3983
|
+
message,
|
|
3984
|
+
extensions
|
|
3985
|
+
};
|
|
3986
|
+
if (formattedError.locations) result.locations = formattedError.locations;
|
|
3987
|
+
if (formattedError.path) result.path = formattedError.path;
|
|
3988
|
+
return result;
|
|
3989
|
+
};
|
|
3990
|
+
}
|
|
3991
|
+
__name(createGraphqlFormatError, "createGraphqlFormatError");
|
|
4614
3992
|
|
|
4615
3993
|
// src/filters/http-exception.filter.ts
|
|
4616
|
-
var
|
|
3994
|
+
var import_common56 = require("@nestjs/common");
|
|
4617
3995
|
|
|
4618
3996
|
// src/filters/pg-error.translator.ts
|
|
4619
3997
|
var PG_UNIQUE_VIOLATION = "23505";
|
|
@@ -4644,33 +4022,25 @@ function findPgError(error, depth = 0) {
|
|
|
4644
4022
|
__name(findPgError, "findPgError");
|
|
4645
4023
|
|
|
4646
4024
|
// src/filters/http-exception.filter.ts
|
|
4647
|
-
function
|
|
4025
|
+
function _ts_decorate29(decorators, target, key, desc3) {
|
|
4648
4026
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
4649
4027
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
4650
4028
|
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;
|
|
4651
4029
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4652
4030
|
}
|
|
4653
|
-
__name(
|
|
4654
|
-
function getHttpStatusTitle(status) {
|
|
4655
|
-
const enumKey = Object.entries(import_common54.HttpStatus).find(([key, value]) => value === status && Number.isNaN(Number(key)))?.[0];
|
|
4656
|
-
if (!enumKey) {
|
|
4657
|
-
return "Error";
|
|
4658
|
-
}
|
|
4659
|
-
return enumKey.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
|
4660
|
-
}
|
|
4661
|
-
__name(getHttpStatusTitle, "getHttpStatusTitle");
|
|
4031
|
+
__name(_ts_decorate29, "_ts_decorate");
|
|
4662
4032
|
var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
4663
4033
|
static {
|
|
4664
4034
|
__name(this, "HttpExceptionFilter");
|
|
4665
4035
|
}
|
|
4666
|
-
logger = new
|
|
4036
|
+
logger = new import_common56.Logger(_HttpExceptionFilter.name);
|
|
4667
4037
|
catch(exception, host) {
|
|
4668
4038
|
const ctx = host.switchToHttp();
|
|
4669
4039
|
const response = ctx.getResponse();
|
|
4670
4040
|
const request = ctx.getRequest();
|
|
4671
4041
|
const translatedPgError = tryTranslatePgError(exception);
|
|
4672
4042
|
if (translatedPgError) exception = translatedPgError;
|
|
4673
|
-
let status =
|
|
4043
|
+
let status = import_common56.HttpStatus.INTERNAL_SERVER_ERROR;
|
|
4674
4044
|
let type = "about:blank";
|
|
4675
4045
|
let label;
|
|
4676
4046
|
let detail = "Internal server error";
|
|
@@ -4678,33 +4048,11 @@ var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
|
4678
4048
|
if (this.isHttpException(exception)) {
|
|
4679
4049
|
status = exception.getStatus();
|
|
4680
4050
|
const exceptionResponse = exception.getResponse();
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
label = problemResponse.label;
|
|
4687
|
-
detail = problemResponse.detail ?? exception.message ?? getHttpStatusTitle(status);
|
|
4688
|
-
errors = problemResponse.errors ?? [];
|
|
4689
|
-
} else if ("message" in responseObj && Array.isArray(responseObj.message)) {
|
|
4690
|
-
errors = responseObj.message.map((msg) => {
|
|
4691
|
-
if (typeof msg === "object" && "property" in msg && "constraints" in msg) {
|
|
4692
|
-
const constraintValues = Object.values(msg.constraints);
|
|
4693
|
-
return {
|
|
4694
|
-
field: msg.property,
|
|
4695
|
-
message: constraintValues[0] ?? "Validation failed"
|
|
4696
|
-
};
|
|
4697
|
-
}
|
|
4698
|
-
return null;
|
|
4699
|
-
}).filter((error) => error !== null);
|
|
4700
|
-
detail = "Validation failed";
|
|
4701
|
-
} else if ("message" in responseObj) {
|
|
4702
|
-
const message = responseObj.message;
|
|
4703
|
-
detail = Array.isArray(message) ? message.join(", ") : message;
|
|
4704
|
-
}
|
|
4705
|
-
} else if (typeof exceptionResponse === "string") {
|
|
4706
|
-
detail = exceptionResponse;
|
|
4707
|
-
}
|
|
4051
|
+
const extracted = extractProblemFromResponse(exceptionResponse, exception.message ?? getHttpStatusTitle(status));
|
|
4052
|
+
type = extracted.type;
|
|
4053
|
+
label = extracted.label;
|
|
4054
|
+
detail = extracted.detail ?? detail;
|
|
4055
|
+
errors = extracted.errors;
|
|
4708
4056
|
} else if (this.isProblemLikeObject(exception)) {
|
|
4709
4057
|
const problemObj = exception;
|
|
4710
4058
|
const statusCandidate = problemObj.status ?? problemObj.statusCode;
|
|
@@ -4719,7 +4067,7 @@ var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
|
4719
4067
|
const axiosStatus = exception.response?.status;
|
|
4720
4068
|
const axiosDetail = exception.response?.data?.message || exception.response?.data?.detail || exception.message;
|
|
4721
4069
|
const url = exception.config?.url;
|
|
4722
|
-
status =
|
|
4070
|
+
status = import_common56.HttpStatus.BAD_GATEWAY;
|
|
4723
4071
|
detail = `Upstream service error${axiosStatus ? ` (${axiosStatus})` : ""}: ${axiosDetail}`;
|
|
4724
4072
|
this.logger.error(`Upstream API error [${axiosStatus}]: ${axiosDetail} \u2014 URL: ${url}`, exception.stack);
|
|
4725
4073
|
} else {
|
|
@@ -4752,16 +4100,41 @@ var HttpExceptionFilter = class _HttpExceptionFilter {
|
|
|
4752
4100
|
return typeof obj.status === "number" || typeof obj.statusCode === "number" || typeof obj.detail === "string" || Array.isArray(obj.errors);
|
|
4753
4101
|
}
|
|
4754
4102
|
};
|
|
4755
|
-
HttpExceptionFilter =
|
|
4756
|
-
(0,
|
|
4103
|
+
HttpExceptionFilter = _ts_decorate29([
|
|
4104
|
+
(0, import_common56.Catch)()
|
|
4757
4105
|
], HttpExceptionFilter);
|
|
4758
4106
|
|
|
4107
|
+
// src/filters/transport-aware-exception.filter.ts
|
|
4108
|
+
var import_common57 = require("@nestjs/common");
|
|
4109
|
+
function _ts_decorate30(decorators, target, key, desc3) {
|
|
4110
|
+
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
4111
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
4112
|
+
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;
|
|
4113
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4114
|
+
}
|
|
4115
|
+
__name(_ts_decorate30, "_ts_decorate");
|
|
4116
|
+
var TransportAwareExceptionFilter = class {
|
|
4117
|
+
static {
|
|
4118
|
+
__name(this, "TransportAwareExceptionFilter");
|
|
4119
|
+
}
|
|
4120
|
+
httpFilter = new HttpExceptionFilter();
|
|
4121
|
+
catch(exception, host) {
|
|
4122
|
+
if (host.getType() !== "http") {
|
|
4123
|
+
throw exception;
|
|
4124
|
+
}
|
|
4125
|
+
this.httpFilter.catch(exception, host);
|
|
4126
|
+
}
|
|
4127
|
+
};
|
|
4128
|
+
TransportAwareExceptionFilter = _ts_decorate30([
|
|
4129
|
+
(0, import_common57.Catch)()
|
|
4130
|
+
], TransportAwareExceptionFilter);
|
|
4131
|
+
|
|
4759
4132
|
// src/logger/interceptors/http-logger.interceptor.ts
|
|
4760
|
-
var
|
|
4133
|
+
var import_common59 = require("@nestjs/common");
|
|
4761
4134
|
var import_operators = require("rxjs/operators");
|
|
4762
4135
|
|
|
4763
4136
|
// src/logger/services/logger.service.ts
|
|
4764
|
-
var
|
|
4137
|
+
var import_common58 = require("@nestjs/common");
|
|
4765
4138
|
var import_winston = require("winston");
|
|
4766
4139
|
var import_winston_daily_rotate_file = __toESM(require("winston-daily-rotate-file"), 1);
|
|
4767
4140
|
|
|
@@ -5008,9 +4381,9 @@ ${trace}`;
|
|
|
5008
4381
|
}
|
|
5009
4382
|
};
|
|
5010
4383
|
LoggerService = _ts_decorate31([
|
|
5011
|
-
(0,
|
|
5012
|
-
_ts_param9(0, (0,
|
|
5013
|
-
_ts_param9(1, (0,
|
|
4384
|
+
(0, import_common58.Injectable)(),
|
|
4385
|
+
_ts_param9(0, (0, import_common58.Optional)()),
|
|
4386
|
+
_ts_param9(1, (0, import_common58.Optional)()),
|
|
5014
4387
|
_ts_metadata24("design:type", Function),
|
|
5015
4388
|
_ts_metadata24("design:paramtypes", [
|
|
5016
4389
|
typeof LoggerModuleOptions === "undefined" ? Object : LoggerModuleOptions,
|
|
@@ -5115,7 +4488,11 @@ var HttpLoggerInterceptor = class {
|
|
|
5115
4488
|
const correlationContext = getCorrelationContext();
|
|
5116
4489
|
const err = error;
|
|
5117
4490
|
const statusCode = err.status ?? err.statusCode ?? response.statusCode ?? 500;
|
|
5118
|
-
const
|
|
4491
|
+
const pgCause = findPgError(error);
|
|
4492
|
+
let errorMessage = err.message || err.detail || "Unknown error";
|
|
4493
|
+
if (pgCause?.message && pgCause.message !== err.message) {
|
|
4494
|
+
errorMessage = `${errorMessage} \u2014 cause: ${pgCause.message}${pgCause.code ? ` [${pgCause.code}]` : ""}`;
|
|
4495
|
+
}
|
|
5119
4496
|
const metadata = {
|
|
5120
4497
|
type: "http_error",
|
|
5121
4498
|
method: request.method,
|
|
@@ -5126,6 +4503,9 @@ var HttpLoggerInterceptor = class {
|
|
|
5126
4503
|
errorName: err.name || "Error",
|
|
5127
4504
|
errorMessage
|
|
5128
4505
|
};
|
|
4506
|
+
if (pgCause) {
|
|
4507
|
+
metadata.pgError = pgCause;
|
|
4508
|
+
}
|
|
5129
4509
|
if (err.stack) {
|
|
5130
4510
|
metadata.trace = err.stack;
|
|
5131
4511
|
}
|
|
@@ -5140,8 +4520,8 @@ var HttpLoggerInterceptor = class {
|
|
|
5140
4520
|
}
|
|
5141
4521
|
};
|
|
5142
4522
|
HttpLoggerInterceptor = _ts_decorate32([
|
|
5143
|
-
(0,
|
|
5144
|
-
_ts_param10(1, (0,
|
|
4523
|
+
(0, import_common59.Injectable)(),
|
|
4524
|
+
_ts_param10(1, (0, import_common59.Optional)()),
|
|
5145
4525
|
_ts_metadata25("design:type", Function),
|
|
5146
4526
|
_ts_metadata25("design:paramtypes", [
|
|
5147
4527
|
typeof LoggerService === "undefined" ? Object : LoggerService,
|
|
@@ -5150,10 +4530,10 @@ HttpLoggerInterceptor = _ts_decorate32([
|
|
|
5150
4530
|
], HttpLoggerInterceptor);
|
|
5151
4531
|
|
|
5152
4532
|
// src/logger/logger.module.ts
|
|
5153
|
-
var
|
|
4533
|
+
var import_common61 = require("@nestjs/common");
|
|
5154
4534
|
|
|
5155
4535
|
// src/logger/middleware/correlation-id.middleware.ts
|
|
5156
|
-
var
|
|
4536
|
+
var import_common60 = require("@nestjs/common");
|
|
5157
4537
|
function _ts_decorate33(decorators, target, key, desc3) {
|
|
5158
4538
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
5159
4539
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
@@ -5202,7 +4582,7 @@ var CorrelationIdMiddleware = class {
|
|
|
5202
4582
|
}
|
|
5203
4583
|
};
|
|
5204
4584
|
CorrelationIdMiddleware = _ts_decorate33([
|
|
5205
|
-
(0,
|
|
4585
|
+
(0, import_common60.Injectable)(),
|
|
5206
4586
|
_ts_metadata26("design:type", Function),
|
|
5207
4587
|
_ts_metadata26("design:paramtypes", [
|
|
5208
4588
|
typeof CorrelationIdMiddlewareOptions === "undefined" ? Object : CorrelationIdMiddlewareOptions
|
|
@@ -5293,9 +4673,9 @@ function mergeWithDefaults2(options = {}) {
|
|
|
5293
4673
|
__name(mergeWithDefaults2, "mergeWithDefaults");
|
|
5294
4674
|
function createDefaultLoggerProvider(options) {
|
|
5295
4675
|
return {
|
|
5296
|
-
provide:
|
|
4676
|
+
provide: import_common61.Logger,
|
|
5297
4677
|
useFactory: /* @__PURE__ */ __name(() => {
|
|
5298
|
-
const logger = new
|
|
4678
|
+
const logger = new import_common61.Logger();
|
|
5299
4679
|
if (options.level) {
|
|
5300
4680
|
const levels = getLevelsUpTo(options.level);
|
|
5301
4681
|
logger.setLogLevels?.(levels);
|
|
@@ -5325,7 +4705,7 @@ function createLoggerProviders(options = {}) {
|
|
|
5325
4705
|
inject: [
|
|
5326
4706
|
LOGGER_MODULE_OPTIONS,
|
|
5327
4707
|
{
|
|
5328
|
-
token:
|
|
4708
|
+
token: import_common61.Logger,
|
|
5329
4709
|
optional: true
|
|
5330
4710
|
}
|
|
5331
4711
|
]
|
|
@@ -5404,10 +4784,10 @@ var LoggerModule = class _LoggerModule {
|
|
|
5404
4784
|
...asyncProviders,
|
|
5405
4785
|
// Default logger provider
|
|
5406
4786
|
{
|
|
5407
|
-
provide:
|
|
4787
|
+
provide: import_common61.Logger,
|
|
5408
4788
|
useFactory: /* @__PURE__ */ __name((opts) => {
|
|
5409
4789
|
if (opts.provider === "default") {
|
|
5410
|
-
const logger = new
|
|
4790
|
+
const logger = new import_common61.Logger();
|
|
5411
4791
|
if (opts.level) {
|
|
5412
4792
|
const levels = getLevelsUpTo(opts.level);
|
|
5413
4793
|
logger.setLogLevels?.(levels);
|
|
@@ -5429,7 +4809,7 @@ var LoggerModule = class _LoggerModule {
|
|
|
5429
4809
|
inject: [
|
|
5430
4810
|
LOGGER_MODULE_OPTIONS,
|
|
5431
4811
|
{
|
|
5432
|
-
token:
|
|
4812
|
+
token: import_common61.Logger,
|
|
5433
4813
|
optional: true
|
|
5434
4814
|
}
|
|
5435
4815
|
]
|
|
@@ -5529,24 +4909,24 @@ var LoggerModule = class _LoggerModule {
|
|
|
5529
4909
|
}
|
|
5530
4910
|
};
|
|
5531
4911
|
LoggerModule = _ts_decorate34([
|
|
5532
|
-
(0,
|
|
5533
|
-
(0,
|
|
4912
|
+
(0, import_common61.Global)(),
|
|
4913
|
+
(0, import_common61.Module)({})
|
|
5534
4914
|
], LoggerModule);
|
|
5535
4915
|
|
|
5536
4916
|
// src/root/root.module.ts
|
|
5537
|
-
var
|
|
4917
|
+
var import_common67 = require("@nestjs/common");
|
|
5538
4918
|
|
|
5539
4919
|
// src/root/controllers/app.controller.ts
|
|
5540
|
-
var
|
|
5541
|
-
var
|
|
4920
|
+
var import_common64 = require("@nestjs/common");
|
|
4921
|
+
var import_swagger18 = require("@nestjs/swagger");
|
|
5542
4922
|
|
|
5543
4923
|
// src/root/docs/app.docs.ts
|
|
5544
|
-
var
|
|
5545
|
-
var
|
|
4924
|
+
var import_common62 = require("@nestjs/common");
|
|
4925
|
+
var import_swagger17 = require("@nestjs/swagger");
|
|
5546
4926
|
function ApiHealthCheck() {
|
|
5547
|
-
return (0,
|
|
4927
|
+
return (0, import_common62.applyDecorators)((0, import_swagger17.ApiOperation)({
|
|
5548
4928
|
summary: "Health check endpoint"
|
|
5549
|
-
}), (0,
|
|
4929
|
+
}), (0, import_swagger17.ApiResponse)({
|
|
5550
4930
|
status: 200,
|
|
5551
4931
|
description: "Returns a welcome message indicating the API is running",
|
|
5552
4932
|
type: String
|
|
@@ -5555,7 +4935,7 @@ function ApiHealthCheck() {
|
|
|
5555
4935
|
__name(ApiHealthCheck, "ApiHealthCheck");
|
|
5556
4936
|
|
|
5557
4937
|
// src/root/services/app.service.ts
|
|
5558
|
-
var
|
|
4938
|
+
var import_common63 = require("@nestjs/common");
|
|
5559
4939
|
function _ts_decorate35(decorators, target, key, desc3) {
|
|
5560
4940
|
var c = arguments.length, r = c < 3 ? target : desc3 === null ? desc3 = Object.getOwnPropertyDescriptor(target, key) : desc3, d;
|
|
5561
4941
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc3);
|
|
@@ -5573,7 +4953,7 @@ var AppService = class {
|
|
|
5573
4953
|
}
|
|
5574
4954
|
};
|
|
5575
4955
|
AppService = _ts_decorate35([
|
|
5576
|
-
(0,
|
|
4956
|
+
(0, import_common63.Injectable)()
|
|
5577
4957
|
], AppService);
|
|
5578
4958
|
|
|
5579
4959
|
// src/root/controllers/app.controller.ts
|
|
@@ -5602,7 +4982,7 @@ var AppController = class {
|
|
|
5602
4982
|
}
|
|
5603
4983
|
};
|
|
5604
4984
|
_ts_decorate36([
|
|
5605
|
-
(0,
|
|
4985
|
+
(0, import_common64.Get)(),
|
|
5606
4986
|
Public(),
|
|
5607
4987
|
ApiHealthCheck(),
|
|
5608
4988
|
_ts_metadata27("design:type", Function),
|
|
@@ -5610,8 +4990,8 @@ _ts_decorate36([
|
|
|
5610
4990
|
_ts_metadata27("design:returntype", String)
|
|
5611
4991
|
], AppController.prototype, "getHello", null);
|
|
5612
4992
|
AppController = _ts_decorate36([
|
|
5613
|
-
(0,
|
|
5614
|
-
(0,
|
|
4993
|
+
(0, import_swagger18.ApiTags)("Health"),
|
|
4994
|
+
(0, import_common64.Controller)(),
|
|
5615
4995
|
_ts_metadata27("design:type", Function),
|
|
5616
4996
|
_ts_metadata27("design:paramtypes", [
|
|
5617
4997
|
typeof AppService === "undefined" ? Object : AppService
|
|
@@ -5619,17 +4999,17 @@ AppController = _ts_decorate36([
|
|
|
5619
4999
|
], AppController);
|
|
5620
5000
|
|
|
5621
5001
|
// src/root/controllers/csrf.controller.ts
|
|
5622
|
-
var
|
|
5623
|
-
var
|
|
5002
|
+
var import_common66 = require("@nestjs/common");
|
|
5003
|
+
var import_swagger20 = require("@nestjs/swagger");
|
|
5624
5004
|
|
|
5625
5005
|
// src/root/docs/csrf.docs.ts
|
|
5626
|
-
var
|
|
5627
|
-
var
|
|
5006
|
+
var import_common65 = require("@nestjs/common");
|
|
5007
|
+
var import_swagger19 = require("@nestjs/swagger");
|
|
5628
5008
|
function ApiGetCsrfToken() {
|
|
5629
|
-
return (0,
|
|
5009
|
+
return (0, import_common65.applyDecorators)((0, import_swagger19.ApiOperation)({
|
|
5630
5010
|
summary: "Get CSRF token",
|
|
5631
5011
|
description: "Generates and returns a CSRF token that must be included in all state-changing requests (POST, PUT, PATCH, DELETE). The token should be sent in the X-CSRF-Token header."
|
|
5632
|
-
}), (0,
|
|
5012
|
+
}), (0, import_swagger19.ApiResponse)({
|
|
5633
5013
|
status: 200,
|
|
5634
5014
|
description: "CSRF token generated successfully",
|
|
5635
5015
|
schema: {
|
|
@@ -5680,11 +5060,11 @@ var CsrfController = class {
|
|
|
5680
5060
|
}
|
|
5681
5061
|
};
|
|
5682
5062
|
_ts_decorate37([
|
|
5683
|
-
(0,
|
|
5063
|
+
(0, import_common66.Get)("token"),
|
|
5684
5064
|
Public(),
|
|
5685
|
-
(0,
|
|
5065
|
+
(0, import_common66.HttpCode)(import_common66.HttpStatus.OK),
|
|
5686
5066
|
ApiGetCsrfToken(),
|
|
5687
|
-
_ts_param11(0, (0,
|
|
5067
|
+
_ts_param11(0, (0, import_common66.Res)({
|
|
5688
5068
|
passthrough: true
|
|
5689
5069
|
})),
|
|
5690
5070
|
_ts_metadata28("design:type", Function),
|
|
@@ -5694,8 +5074,8 @@ _ts_decorate37([
|
|
|
5694
5074
|
_ts_metadata28("design:returntype", Object)
|
|
5695
5075
|
], CsrfController.prototype, "getToken", null);
|
|
5696
5076
|
CsrfController = _ts_decorate37([
|
|
5697
|
-
(0,
|
|
5698
|
-
(0,
|
|
5077
|
+
(0, import_swagger20.ApiTags)("CSRF"),
|
|
5078
|
+
(0, import_common66.Controller)("csrf")
|
|
5699
5079
|
], CsrfController);
|
|
5700
5080
|
|
|
5701
5081
|
// src/root/root.module.ts
|
|
@@ -5712,7 +5092,7 @@ var RootModule = class {
|
|
|
5712
5092
|
}
|
|
5713
5093
|
};
|
|
5714
5094
|
RootModule = _ts_decorate38([
|
|
5715
|
-
(0,
|
|
5095
|
+
(0, import_common67.Module)({
|
|
5716
5096
|
controllers: [
|
|
5717
5097
|
AppController,
|
|
5718
5098
|
CsrfController
|
|
@@ -5946,16 +5326,15 @@ __name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
|
5946
5326
|
AuthConfigModule,
|
|
5947
5327
|
BadGatewayException,
|
|
5948
5328
|
BadRequestException,
|
|
5949
|
-
|
|
5950
|
-
CacheModule,
|
|
5951
|
-
CacheService,
|
|
5329
|
+
ClientIp,
|
|
5952
5330
|
ConflictException,
|
|
5953
5331
|
CookieDomain,
|
|
5954
5332
|
CookieName,
|
|
5955
5333
|
CorrelationIdMiddleware,
|
|
5956
5334
|
CreateDataTableViewDto,
|
|
5957
5335
|
CreateResponseDto,
|
|
5958
|
-
|
|
5336
|
+
CursorCodec,
|
|
5337
|
+
CursorListResponseDto,
|
|
5959
5338
|
DATA_TABLE_VIEWS_TABLE,
|
|
5960
5339
|
DEFAULT_CORRELATION_HEADER,
|
|
5961
5340
|
DataTableModule,
|
|
@@ -5963,8 +5342,7 @@ __name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
|
5963
5342
|
DataTableViewDto,
|
|
5964
5343
|
DataTableViewsService,
|
|
5965
5344
|
DatabaseModule,
|
|
5966
|
-
|
|
5967
|
-
EmailService,
|
|
5345
|
+
ErrorCode,
|
|
5968
5346
|
FilterOperators,
|
|
5969
5347
|
FilterProcessor,
|
|
5970
5348
|
ForbiddenException,
|
|
@@ -5976,9 +5354,8 @@ __name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
|
5976
5354
|
ImportResponseDto,
|
|
5977
5355
|
ImportSummaryDto,
|
|
5978
5356
|
InternalServerErrorException,
|
|
5979
|
-
IsCurrency,
|
|
5980
|
-
IsCurrencyCode,
|
|
5981
5357
|
IsDateTime,
|
|
5358
|
+
KeysetProcessor,
|
|
5982
5359
|
LOGGER_MODULE_OPTIONS,
|
|
5983
5360
|
LoggerModule,
|
|
5984
5361
|
LoggerService,
|
|
@@ -5991,7 +5368,6 @@ __name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
|
5991
5368
|
PrimaryDatabaseService,
|
|
5992
5369
|
Public,
|
|
5993
5370
|
REQUIRE_SESSION_KEY,
|
|
5994
|
-
RedisCacheProvider,
|
|
5995
5371
|
RefreshCookieOptions,
|
|
5996
5372
|
RefreshTokenCookie,
|
|
5997
5373
|
RenameDataTableViewDto,
|
|
@@ -5999,7 +5375,6 @@ __name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
|
5999
5375
|
RequireSession,
|
|
6000
5376
|
RootModule,
|
|
6001
5377
|
SKIP_CSRF_KEY,
|
|
6002
|
-
SUPPORTED_CURRENCIES,
|
|
6003
5378
|
SelectOptionsQueryDto,
|
|
6004
5379
|
ServiceUnavailableException,
|
|
6005
5380
|
SessionData,
|
|
@@ -6011,6 +5386,7 @@ __name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
|
6011
5386
|
TokenService,
|
|
6012
5387
|
TokenType,
|
|
6013
5388
|
TooManyRequestsException,
|
|
5389
|
+
TransportAwareExceptionFilter,
|
|
6014
5390
|
UnauthorizedException,
|
|
6015
5391
|
UnprocessableEntityException,
|
|
6016
5392
|
UnsupportedMediaTypeException,
|
|
@@ -6018,24 +5394,30 @@ __name(normalizePhoneNumber, "normalizePhoneNumber");
|
|
|
6018
5394
|
UploadedFile,
|
|
6019
5395
|
UploadedFiles,
|
|
6020
5396
|
UpsertDataTableStateDto,
|
|
5397
|
+
UserAgent,
|
|
6021
5398
|
UserId,
|
|
6022
5399
|
ValidatedRowDto,
|
|
6023
5400
|
ValidationException,
|
|
6024
5401
|
VrittiAuthGuard,
|
|
6025
5402
|
addCorrelationIdToResponse,
|
|
6026
5403
|
correlationStorage,
|
|
5404
|
+
createGraphqlFormatError,
|
|
6027
5405
|
dataTableViewsColumns,
|
|
6028
5406
|
dataTableViewsIndexes,
|
|
5407
|
+
errorCodeFromStatus,
|
|
6029
5408
|
extractCountryFromPhone,
|
|
6030
5409
|
gcd,
|
|
6031
5410
|
generateCorrelationId,
|
|
6032
5411
|
getCorrelationContext,
|
|
6033
5412
|
getHttpStatusTitle,
|
|
5413
|
+
getRequestFromContext,
|
|
5414
|
+
getResponseFromContext,
|
|
6034
5415
|
hashToken,
|
|
6035
|
-
majorToMinor,
|
|
6036
|
-
minorToMajor,
|
|
6037
5416
|
normalizePhoneNumber,
|
|
6038
5417
|
parseExpiryToMs,
|
|
5418
|
+
registerTransport,
|
|
5419
|
+
resolveExtractor,
|
|
5420
|
+
resolveInjectedRequest,
|
|
6039
5421
|
runWithCorrelationContext,
|
|
6040
5422
|
updateCorrelationContext,
|
|
6041
5423
|
verifyTokenHash
|