dbnexus 0.5.4 → 0.6.0
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/api.js +1208 -867
- package/dist/cli.js +45 -7
- package/dist/web/assets/{index-DCJ7drPm.js → index-6pOQ4v1N.js} +100 -100
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -2887,7 +2887,7 @@ var require_http_exception = __commonJS({
|
|
|
2887
2887
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
2888
2888
|
exports2.HttpException = void 0;
|
|
2889
2889
|
var shared_utils_1 = require_shared_utils();
|
|
2890
|
-
var
|
|
2890
|
+
var HttpException2 = class extends Error {
|
|
2891
2891
|
/**
|
|
2892
2892
|
* Instantiate a plain HTTP Exception.
|
|
2893
2893
|
*
|
|
@@ -2996,7 +2996,7 @@ var require_http_exception = __commonJS({
|
|
|
2996
2996
|
};
|
|
2997
2997
|
}
|
|
2998
2998
|
};
|
|
2999
|
-
exports2.HttpException =
|
|
2999
|
+
exports2.HttpException = HttpException2;
|
|
3000
3000
|
}
|
|
3001
3001
|
});
|
|
3002
3002
|
|
|
@@ -3008,7 +3008,7 @@ var require_bad_request_exception = __commonJS({
|
|
|
3008
3008
|
exports2.BadRequestException = void 0;
|
|
3009
3009
|
var http_status_enum_1 = require_http_status_enum();
|
|
3010
3010
|
var http_exception_1 = require_http_exception();
|
|
3011
|
-
var
|
|
3011
|
+
var BadRequestException6 = class extends http_exception_1.HttpException {
|
|
3012
3012
|
/**
|
|
3013
3013
|
* Instantiate a `BadRequestException` Exception.
|
|
3014
3014
|
*
|
|
@@ -3038,7 +3038,7 @@ var require_bad_request_exception = __commonJS({
|
|
|
3038
3038
|
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.BAD_REQUEST), http_status_enum_1.HttpStatus.BAD_REQUEST, httpExceptionOptions);
|
|
3039
3039
|
}
|
|
3040
3040
|
};
|
|
3041
|
-
exports2.BadRequestException =
|
|
3041
|
+
exports2.BadRequestException = BadRequestException6;
|
|
3042
3042
|
}
|
|
3043
3043
|
});
|
|
3044
3044
|
|
|
@@ -3134,7 +3134,7 @@ var require_not_found_exception = __commonJS({
|
|
|
3134
3134
|
exports2.NotFoundException = void 0;
|
|
3135
3135
|
var http_status_enum_1 = require_http_status_enum();
|
|
3136
3136
|
var http_exception_1 = require_http_exception();
|
|
3137
|
-
var
|
|
3137
|
+
var NotFoundException5 = class extends http_exception_1.HttpException {
|
|
3138
3138
|
/**
|
|
3139
3139
|
* Instantiate a `NotFoundException` Exception.
|
|
3140
3140
|
*
|
|
@@ -3164,7 +3164,7 @@ var require_not_found_exception = __commonJS({
|
|
|
3164
3164
|
super(http_exception_1.HttpException.createBody(objectOrError, description, http_status_enum_1.HttpStatus.NOT_FOUND), http_status_enum_1.HttpStatus.NOT_FOUND, httpExceptionOptions);
|
|
3165
3165
|
}
|
|
3166
3166
|
};
|
|
3167
|
-
exports2.NotFoundException =
|
|
3167
|
+
exports2.NotFoundException = NotFoundException5;
|
|
3168
3168
|
}
|
|
3169
3169
|
});
|
|
3170
3170
|
|
|
@@ -6788,7 +6788,7 @@ var require_IsOptional = __commonJS({
|
|
|
6788
6788
|
var ValidationMetadata_1 = require_ValidationMetadata();
|
|
6789
6789
|
var MetadataStorage_1 = require_MetadataStorage();
|
|
6790
6790
|
exports2.IS_OPTIONAL = "isOptional";
|
|
6791
|
-
function
|
|
6791
|
+
function IsOptional24(validationOptions) {
|
|
6792
6792
|
return function(object, propertyName) {
|
|
6793
6793
|
const args = {
|
|
6794
6794
|
type: ValidationTypes_1.ValidationTypes.CONDITIONAL_VALIDATION,
|
|
@@ -6805,7 +6805,7 @@ var require_IsOptional = __commonJS({
|
|
|
6805
6805
|
(0, MetadataStorage_1.getMetadataStorage)().addValidationMetadata(new ValidationMetadata_1.ValidationMetadata(args));
|
|
6806
6806
|
};
|
|
6807
6807
|
}
|
|
6808
|
-
exports2.IsOptional =
|
|
6808
|
+
exports2.IsOptional = IsOptional24;
|
|
6809
6809
|
}
|
|
6810
6810
|
});
|
|
6811
6811
|
|
|
@@ -7215,7 +7215,7 @@ var require_IsIn = __commonJS({
|
|
|
7215
7215
|
return Array.isArray(possibleValues) && possibleValues.some((possibleValue) => possibleValue === value);
|
|
7216
7216
|
}
|
|
7217
7217
|
exports2.isIn = isIn;
|
|
7218
|
-
function
|
|
7218
|
+
function IsIn12(values, validationOptions) {
|
|
7219
7219
|
return (0, ValidateBy_1.ValidateBy)({
|
|
7220
7220
|
name: exports2.IS_IN,
|
|
7221
7221
|
constraints: [values],
|
|
@@ -7225,7 +7225,7 @@ var require_IsIn = __commonJS({
|
|
|
7225
7225
|
}
|
|
7226
7226
|
}, validationOptions);
|
|
7227
7227
|
}
|
|
7228
|
-
exports2.IsIn =
|
|
7228
|
+
exports2.IsIn = IsIn12;
|
|
7229
7229
|
}
|
|
7230
7230
|
});
|
|
7231
7231
|
|
|
@@ -7599,7 +7599,7 @@ var require_Max = __commonJS({
|
|
|
7599
7599
|
return typeof num === "number" && typeof max2 === "number" && num <= max2;
|
|
7600
7600
|
}
|
|
7601
7601
|
exports2.max = max;
|
|
7602
|
-
function
|
|
7602
|
+
function Max6(maxValue, validationOptions) {
|
|
7603
7603
|
return (0, ValidateBy_1.ValidateBy)({
|
|
7604
7604
|
name: exports2.MAX,
|
|
7605
7605
|
constraints: [maxValue],
|
|
@@ -7609,7 +7609,7 @@ var require_Max = __commonJS({
|
|
|
7609
7609
|
}
|
|
7610
7610
|
}, validationOptions);
|
|
7611
7611
|
}
|
|
7612
|
-
exports2.Max =
|
|
7612
|
+
exports2.Max = Max6;
|
|
7613
7613
|
}
|
|
7614
7614
|
});
|
|
7615
7615
|
|
|
@@ -7625,7 +7625,7 @@ var require_Min = __commonJS({
|
|
|
7625
7625
|
return typeof num === "number" && typeof min2 === "number" && num >= min2;
|
|
7626
7626
|
}
|
|
7627
7627
|
exports2.min = min;
|
|
7628
|
-
function
|
|
7628
|
+
function Min6(minValue, validationOptions) {
|
|
7629
7629
|
return (0, ValidateBy_1.ValidateBy)({
|
|
7630
7630
|
name: exports2.MIN,
|
|
7631
7631
|
constraints: [minValue],
|
|
@@ -7635,7 +7635,7 @@ var require_Min = __commonJS({
|
|
|
7635
7635
|
}
|
|
7636
7636
|
}, validationOptions);
|
|
7637
7637
|
}
|
|
7638
|
-
exports2.Min =
|
|
7638
|
+
exports2.Min = Min6;
|
|
7639
7639
|
}
|
|
7640
7640
|
});
|
|
7641
7641
|
|
|
@@ -10726,7 +10726,7 @@ var require_MaxLength = __commonJS({
|
|
|
10726
10726
|
return typeof value === "string" && (0, isLength_1.default)(value, { min: 0, max });
|
|
10727
10727
|
}
|
|
10728
10728
|
exports2.maxLength = maxLength;
|
|
10729
|
-
function
|
|
10729
|
+
function MaxLength3(max, validationOptions) {
|
|
10730
10730
|
return (0, ValidateBy_1.ValidateBy)({
|
|
10731
10731
|
name: exports2.MAX_LENGTH,
|
|
10732
10732
|
constraints: [max],
|
|
@@ -10736,7 +10736,7 @@ var require_MaxLength = __commonJS({
|
|
|
10736
10736
|
}
|
|
10737
10737
|
}, validationOptions);
|
|
10738
10738
|
}
|
|
10739
|
-
exports2.MaxLength =
|
|
10739
|
+
exports2.MaxLength = MaxLength3;
|
|
10740
10740
|
}
|
|
10741
10741
|
});
|
|
10742
10742
|
|
|
@@ -22948,7 +22948,7 @@ var require_IsBoolean = __commonJS({
|
|
|
22948
22948
|
return value instanceof Boolean || typeof value === "boolean";
|
|
22949
22949
|
}
|
|
22950
22950
|
exports2.isBoolean = isBoolean;
|
|
22951
|
-
function
|
|
22951
|
+
function IsBoolean16(validationOptions) {
|
|
22952
22952
|
return (0, ValidateBy_1.ValidateBy)({
|
|
22953
22953
|
name: exports2.IS_BOOLEAN,
|
|
22954
22954
|
validator: {
|
|
@@ -22957,7 +22957,7 @@ var require_IsBoolean = __commonJS({
|
|
|
22957
22957
|
}
|
|
22958
22958
|
}, validationOptions);
|
|
22959
22959
|
}
|
|
22960
|
-
exports2.IsBoolean =
|
|
22960
|
+
exports2.IsBoolean = IsBoolean16;
|
|
22961
22961
|
}
|
|
22962
22962
|
});
|
|
22963
22963
|
|
|
@@ -23072,7 +23072,7 @@ var require_IsInt = __commonJS({
|
|
|
23072
23072
|
return typeof val === "number" && Number.isInteger(val);
|
|
23073
23073
|
}
|
|
23074
23074
|
exports2.isInt = isInt;
|
|
23075
|
-
function
|
|
23075
|
+
function IsInt2(validationOptions) {
|
|
23076
23076
|
return (0, ValidateBy_1.ValidateBy)({
|
|
23077
23077
|
name: exports2.IS_INT,
|
|
23078
23078
|
validator: {
|
|
@@ -23081,7 +23081,7 @@ var require_IsInt = __commonJS({
|
|
|
23081
23081
|
}
|
|
23082
23082
|
}, validationOptions);
|
|
23083
23083
|
}
|
|
23084
|
-
exports2.IsInt =
|
|
23084
|
+
exports2.IsInt = IsInt2;
|
|
23085
23085
|
}
|
|
23086
23086
|
});
|
|
23087
23087
|
|
|
@@ -23097,7 +23097,7 @@ var require_IsString = __commonJS({
|
|
|
23097
23097
|
return value instanceof String || typeof value === "string";
|
|
23098
23098
|
}
|
|
23099
23099
|
exports2.isString = isString;
|
|
23100
|
-
function
|
|
23100
|
+
function IsString29(validationOptions) {
|
|
23101
23101
|
return (0, ValidateBy_1.ValidateBy)({
|
|
23102
23102
|
name: exports2.IS_STRING,
|
|
23103
23103
|
validator: {
|
|
@@ -23106,7 +23106,7 @@ var require_IsString = __commonJS({
|
|
|
23106
23106
|
}
|
|
23107
23107
|
}, validationOptions);
|
|
23108
23108
|
}
|
|
23109
|
-
exports2.IsString =
|
|
23109
|
+
exports2.IsString = IsString29;
|
|
23110
23110
|
}
|
|
23111
23111
|
});
|
|
23112
23112
|
|
|
@@ -76035,7 +76035,7 @@ var require_serve_static_options_interface = __commonJS({
|
|
|
76035
76035
|
var require_abstract_loader = __commonJS({
|
|
76036
76036
|
"node_modules/.pnpm/@nestjs+serve-static@4.0.2_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.1_kmdzv4ihqpcjmuu5h5u36hctmy/node_modules/@nestjs/serve-static/dist/loaders/abstract.loader.js"(exports2) {
|
|
76037
76037
|
"use strict";
|
|
76038
|
-
var
|
|
76038
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
76039
76039
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
76040
76040
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
76041
76041
|
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;
|
|
@@ -76051,7 +76051,7 @@ var require_abstract_loader = __commonJS({
|
|
|
76051
76051
|
}
|
|
76052
76052
|
};
|
|
76053
76053
|
exports2.AbstractLoader = AbstractLoader;
|
|
76054
|
-
exports2.AbstractLoader = AbstractLoader =
|
|
76054
|
+
exports2.AbstractLoader = AbstractLoader = __decorate82([
|
|
76055
76055
|
(0, common_1.Injectable)()
|
|
76056
76056
|
], AbstractLoader);
|
|
76057
76057
|
}
|
|
@@ -76197,7 +76197,7 @@ var require_validate_path_util = __commonJS({
|
|
|
76197
76197
|
var require_express_loader = __commonJS({
|
|
76198
76198
|
"node_modules/.pnpm/@nestjs+serve-static@4.0.2_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.1_kmdzv4ihqpcjmuu5h5u36hctmy/node_modules/@nestjs/serve-static/dist/loaders/express.loader.js"(exports2) {
|
|
76199
76199
|
"use strict";
|
|
76200
|
-
var
|
|
76200
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
76201
76201
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
76202
76202
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
76203
76203
|
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;
|
|
@@ -76243,7 +76243,7 @@ var require_express_loader = __commonJS({
|
|
|
76243
76243
|
}
|
|
76244
76244
|
};
|
|
76245
76245
|
exports2.ExpressLoader = ExpressLoader;
|
|
76246
|
-
exports2.ExpressLoader = ExpressLoader =
|
|
76246
|
+
exports2.ExpressLoader = ExpressLoader = __decorate82([
|
|
76247
76247
|
(0, common_1.Injectable)()
|
|
76248
76248
|
], ExpressLoader);
|
|
76249
76249
|
}
|
|
@@ -76253,7 +76253,7 @@ var require_express_loader = __commonJS({
|
|
|
76253
76253
|
var require_fastify_loader = __commonJS({
|
|
76254
76254
|
"node_modules/.pnpm/@nestjs+serve-static@4.0.2_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.1_kmdzv4ihqpcjmuu5h5u36hctmy/node_modules/@nestjs/serve-static/dist/loaders/fastify.loader.js"(exports2) {
|
|
76255
76255
|
"use strict";
|
|
76256
|
-
var
|
|
76256
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
76257
76257
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
76258
76258
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
76259
76259
|
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;
|
|
@@ -76306,7 +76306,7 @@ var require_fastify_loader = __commonJS({
|
|
|
76306
76306
|
}
|
|
76307
76307
|
};
|
|
76308
76308
|
exports2.FastifyLoader = FastifyLoader;
|
|
76309
|
-
exports2.FastifyLoader = FastifyLoader =
|
|
76309
|
+
exports2.FastifyLoader = FastifyLoader = __decorate82([
|
|
76310
76310
|
(0, common_1.Injectable)()
|
|
76311
76311
|
], FastifyLoader);
|
|
76312
76312
|
}
|
|
@@ -76316,7 +76316,7 @@ var require_fastify_loader = __commonJS({
|
|
|
76316
76316
|
var require_noop_loader = __commonJS({
|
|
76317
76317
|
"node_modules/.pnpm/@nestjs+serve-static@4.0.2_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.1_kmdzv4ihqpcjmuu5h5u36hctmy/node_modules/@nestjs/serve-static/dist/loaders/noop.loader.js"(exports2) {
|
|
76318
76318
|
"use strict";
|
|
76319
|
-
var
|
|
76319
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
76320
76320
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
76321
76321
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
76322
76322
|
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;
|
|
@@ -76331,7 +76331,7 @@ var require_noop_loader = __commonJS({
|
|
|
76331
76331
|
}
|
|
76332
76332
|
};
|
|
76333
76333
|
exports2.NoopLoader = NoopLoader;
|
|
76334
|
-
exports2.NoopLoader = NoopLoader =
|
|
76334
|
+
exports2.NoopLoader = NoopLoader = __decorate82([
|
|
76335
76335
|
(0, common_1.Injectable)()
|
|
76336
76336
|
], NoopLoader);
|
|
76337
76337
|
}
|
|
@@ -76371,13 +76371,13 @@ var require_serve_static_providers = __commonJS({
|
|
|
76371
76371
|
var require_serve_static_module = __commonJS({
|
|
76372
76372
|
"node_modules/.pnpm/@nestjs+serve-static@4.0.2_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.1_kmdzv4ihqpcjmuu5h5u36hctmy/node_modules/@nestjs/serve-static/dist/serve-static.module.js"(exports2) {
|
|
76373
76373
|
"use strict";
|
|
76374
|
-
var
|
|
76374
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
76375
76375
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
76376
76376
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
76377
76377
|
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;
|
|
76378
76378
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
76379
76379
|
};
|
|
76380
|
-
var
|
|
76380
|
+
var __metadata62 = exports2 && exports2.__metadata || function(k, v) {
|
|
76381
76381
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
76382
76382
|
};
|
|
76383
76383
|
var __param16 = exports2 && exports2.__param || function(paramIndex, decorator) {
|
|
@@ -76453,12 +76453,12 @@ var require_serve_static_module = __commonJS({
|
|
|
76453
76453
|
}
|
|
76454
76454
|
};
|
|
76455
76455
|
exports2.ServeStaticModule = ServeStaticModule2;
|
|
76456
|
-
exports2.ServeStaticModule = ServeStaticModule2 = ServeStaticModule_1 =
|
|
76456
|
+
exports2.ServeStaticModule = ServeStaticModule2 = ServeStaticModule_1 = __decorate82([
|
|
76457
76457
|
(0, common_1.Module)({
|
|
76458
76458
|
providers: [...serve_static_providers_1.serveStaticProviders]
|
|
76459
76459
|
}),
|
|
76460
76460
|
__param16(0, (0, common_1.Inject)(serve_static_constants_1.SERVE_STATIC_MODULE_OPTIONS)),
|
|
76461
|
-
|
|
76461
|
+
__metadata62("design:paramtypes", [
|
|
76462
76462
|
Array,
|
|
76463
76463
|
abstract_loader_1.AbstractLoader,
|
|
76464
76464
|
core_1.HttpAdapterHost
|
|
@@ -103658,13 +103658,13 @@ var require_jsonwebtoken = __commonJS({
|
|
|
103658
103658
|
var require_jwt_service = __commonJS({
|
|
103659
103659
|
"node_modules/.pnpm/@nestjs+jwt@11.0.2_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.3_refl_tb2k3hwaeibzs5qkwqj56q6ttq/node_modules/@nestjs/jwt/dist/jwt.service.js"(exports2) {
|
|
103660
103660
|
"use strict";
|
|
103661
|
-
var
|
|
103661
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
103662
103662
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
103663
103663
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
103664
103664
|
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;
|
|
103665
103665
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
103666
103666
|
};
|
|
103667
|
-
var
|
|
103667
|
+
var __metadata62 = exports2 && exports2.__metadata || function(k, v) {
|
|
103668
103668
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
103669
103669
|
};
|
|
103670
103670
|
var __param16 = exports2 && exports2.__param || function(paramIndex, decorator) {
|
|
@@ -103755,11 +103755,11 @@ var require_jwt_service = __commonJS({
|
|
|
103755
103755
|
}
|
|
103756
103756
|
};
|
|
103757
103757
|
exports2.JwtService = JwtService2;
|
|
103758
|
-
exports2.JwtService = JwtService2 =
|
|
103758
|
+
exports2.JwtService = JwtService2 = __decorate82([
|
|
103759
103759
|
(0, common_1.Injectable)(),
|
|
103760
103760
|
__param16(0, (0, common_1.Optional)()),
|
|
103761
103761
|
__param16(0, (0, common_1.Inject)(jwt_constants_1.JWT_MODULE_OPTIONS)),
|
|
103762
|
-
|
|
103762
|
+
__metadata62("design:paramtypes", [Object])
|
|
103763
103763
|
], JwtService2);
|
|
103764
103764
|
}
|
|
103765
103765
|
});
|
|
@@ -103768,7 +103768,7 @@ var require_jwt_service = __commonJS({
|
|
|
103768
103768
|
var require_jwt_module = __commonJS({
|
|
103769
103769
|
"node_modules/.pnpm/@nestjs+jwt@11.0.2_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.3_refl_tb2k3hwaeibzs5qkwqj56q6ttq/node_modules/@nestjs/jwt/dist/jwt.module.js"(exports2) {
|
|
103770
103770
|
"use strict";
|
|
103771
|
-
var
|
|
103771
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
103772
103772
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
103773
103773
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
103774
103774
|
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;
|
|
@@ -103828,7 +103828,7 @@ var require_jwt_module = __commonJS({
|
|
|
103828
103828
|
}
|
|
103829
103829
|
};
|
|
103830
103830
|
exports2.JwtModule = JwtModule2;
|
|
103831
|
-
exports2.JwtModule = JwtModule2 = JwtModule_1 =
|
|
103831
|
+
exports2.JwtModule = JwtModule2 = JwtModule_1 = __decorate82([
|
|
103832
103832
|
(0, common_1.Module)({
|
|
103833
103833
|
providers: [jwt_service_1.JwtService],
|
|
103834
103834
|
exports: [jwt_service_1.JwtService]
|
|
@@ -104635,13 +104635,13 @@ var require_memoize_util = __commonJS({
|
|
|
104635
104635
|
var require_auth_guard = __commonJS({
|
|
104636
104636
|
"node_modules/.pnpm/@nestjs+passport@11.0.5_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.3_bz5s6qwi6r6ots5rioaykmbz5a/node_modules/@nestjs/passport/dist/auth.guard.js"(exports2) {
|
|
104637
104637
|
"use strict";
|
|
104638
|
-
var
|
|
104638
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
104639
104639
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
104640
104640
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
104641
104641
|
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;
|
|
104642
104642
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
104643
104643
|
};
|
|
104644
|
-
var
|
|
104644
|
+
var __metadata62 = exports2 && exports2.__metadata || function(k, v) {
|
|
104645
104645
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
104646
104646
|
};
|
|
104647
104647
|
var __param16 = exports2 && exports2.__param || function(paramIndex, decorator) {
|
|
@@ -104703,14 +104703,14 @@ var require_auth_guard = __commonJS({
|
|
|
104703
104703
|
return void 0;
|
|
104704
104704
|
}
|
|
104705
104705
|
};
|
|
104706
|
-
|
|
104706
|
+
__decorate82([
|
|
104707
104707
|
(0, common_1.Optional)(),
|
|
104708
104708
|
(0, common_1.Inject)(auth_module_options_1.AuthModuleOptions),
|
|
104709
|
-
|
|
104709
|
+
__metadata62("design:type", auth_module_options_1.AuthModuleOptions)
|
|
104710
104710
|
], MixinAuthGuard.prototype, "options", void 0);
|
|
104711
|
-
MixinAuthGuard =
|
|
104711
|
+
MixinAuthGuard = __decorate82([
|
|
104712
104712
|
__param16(0, (0, common_1.Optional)()),
|
|
104713
|
-
|
|
104713
|
+
__metadata62("design:paramtypes", [auth_module_options_1.AuthModuleOptions])
|
|
104714
104714
|
], MixinAuthGuard);
|
|
104715
104715
|
const guard = (0, common_1.mixin)(MixinAuthGuard);
|
|
104716
104716
|
return guard;
|
|
@@ -104764,7 +104764,7 @@ var require_interfaces8 = __commonJS({
|
|
|
104764
104764
|
var require_passport_module = __commonJS({
|
|
104765
104765
|
"node_modules/.pnpm/@nestjs+passport@11.0.5_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.3_bz5s6qwi6r6ots5rioaykmbz5a/node_modules/@nestjs/passport/dist/passport.module.js"(exports2) {
|
|
104766
104766
|
"use strict";
|
|
104767
|
-
var
|
|
104767
|
+
var __decorate82 = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
|
|
104768
104768
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
104769
104769
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
104770
104770
|
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;
|
|
@@ -104819,7 +104819,7 @@ var require_passport_module = __commonJS({
|
|
|
104819
104819
|
}
|
|
104820
104820
|
};
|
|
104821
104821
|
exports2.PassportModule = PassportModule2;
|
|
104822
|
-
exports2.PassportModule = PassportModule2 = PassportModule_1 =
|
|
104822
|
+
exports2.PassportModule = PassportModule2 = PassportModule_1 = __decorate82([
|
|
104823
104823
|
(0, common_1.Module)({})
|
|
104824
104824
|
], PassportModule2);
|
|
104825
104825
|
}
|
|
@@ -107036,10 +107036,10 @@ var require_lib14 = __commonJS({
|
|
|
107036
107036
|
// apps/api/dist/main.js
|
|
107037
107037
|
var import_reflect_metadata = __toESM(require_Reflect(), 1);
|
|
107038
107038
|
var import_core5 = __toESM(require_core3(), 1);
|
|
107039
|
-
var
|
|
107039
|
+
var import_common55 = __toESM(require_common(), 1);
|
|
107040
107040
|
|
|
107041
107041
|
// apps/api/dist/app.module.js
|
|
107042
|
-
var
|
|
107042
|
+
var import_common54 = __toESM(require_common(), 1);
|
|
107043
107043
|
var import_core4 = __toESM(require_core3(), 1);
|
|
107044
107044
|
var import_serve_static = __toESM(require_serve_static2(), 1);
|
|
107045
107045
|
import { join as join4 } from "path";
|
|
@@ -110227,7 +110227,7 @@ var esm_default = import_lib.default;
|
|
|
110227
110227
|
|
|
110228
110228
|
// packages/connectors/dist/postgres/postgres.connector.js
|
|
110229
110229
|
var { Pool: Pool2 } = esm_default;
|
|
110230
|
-
var PostgresConnector = class {
|
|
110230
|
+
var PostgresConnector = class _PostgresConnector {
|
|
110231
110231
|
pool = null;
|
|
110232
110232
|
config;
|
|
110233
110233
|
constructor(config) {
|
|
@@ -110293,20 +110293,56 @@ var PostgresConnector = class {
|
|
|
110293
110293
|
isConnected() {
|
|
110294
110294
|
return this.pool !== null;
|
|
110295
110295
|
}
|
|
110296
|
+
/**
|
|
110297
|
+
* node-pg returns an array of Result objects when the SQL string contains multiple
|
|
110298
|
+
* statements (simple query protocol). Callers expect a single Result shape.
|
|
110299
|
+
*/
|
|
110300
|
+
static normalizePoolQueryResults(raw) {
|
|
110301
|
+
if (Array.isArray(raw)) {
|
|
110302
|
+
return raw;
|
|
110303
|
+
}
|
|
110304
|
+
if (raw != null && typeof raw === "object") {
|
|
110305
|
+
return [raw];
|
|
110306
|
+
}
|
|
110307
|
+
return [];
|
|
110308
|
+
}
|
|
110309
|
+
static emptyPgQueryResult() {
|
|
110310
|
+
return {
|
|
110311
|
+
rows: [],
|
|
110312
|
+
fields: [],
|
|
110313
|
+
rowCount: 0,
|
|
110314
|
+
command: "",
|
|
110315
|
+
oid: 0
|
|
110316
|
+
};
|
|
110317
|
+
}
|
|
110318
|
+
/** Last statement wins (matches common SQL client behavior). */
|
|
110319
|
+
static pickLastPgQueryResult(results) {
|
|
110320
|
+
if (results.length === 0) {
|
|
110321
|
+
return _PostgresConnector.emptyPgQueryResult();
|
|
110322
|
+
}
|
|
110323
|
+
return results[results.length - 1];
|
|
110324
|
+
}
|
|
110325
|
+
static fieldPackets(result) {
|
|
110326
|
+
const f = result.fields;
|
|
110327
|
+
return Array.isArray(f) ? f : [];
|
|
110328
|
+
}
|
|
110296
110329
|
async query(sql, params) {
|
|
110297
110330
|
if (!this.pool) {
|
|
110298
110331
|
throw new Error("Not connected to database");
|
|
110299
110332
|
}
|
|
110300
110333
|
const startTime = Date.now();
|
|
110301
|
-
const
|
|
110334
|
+
const raw = await this.pool.query(sql, params);
|
|
110302
110335
|
const executionTimeMs = Date.now() - startTime;
|
|
110303
|
-
const
|
|
110336
|
+
const results = _PostgresConnector.normalizePoolQueryResults(raw);
|
|
110337
|
+
const result = _PostgresConnector.pickLastPgQueryResult(results);
|
|
110338
|
+
const fields = _PostgresConnector.fieldPackets(result);
|
|
110339
|
+
const columns = fields.map((field) => ({
|
|
110304
110340
|
name: field.name,
|
|
110305
110341
|
dataType: this.pgTypeToString(field.dataTypeID)
|
|
110306
110342
|
}));
|
|
110307
110343
|
return {
|
|
110308
110344
|
columns,
|
|
110309
|
-
rows: result.rows,
|
|
110345
|
+
rows: result.rows ?? [],
|
|
110310
110346
|
rowCount: result.rowCount ?? 0,
|
|
110311
110347
|
executionTimeMs,
|
|
110312
110348
|
truncated: false
|
|
@@ -110316,8 +110352,10 @@ var PostgresConnector = class {
|
|
|
110316
110352
|
if (!this.pool) {
|
|
110317
110353
|
throw new Error("Not connected to database");
|
|
110318
110354
|
}
|
|
110319
|
-
const
|
|
110320
|
-
|
|
110355
|
+
const raw = await this.pool.query(sql, params);
|
|
110356
|
+
const results = _PostgresConnector.normalizePoolQueryResults(raw);
|
|
110357
|
+
const rowsAffected = results.reduce((acc, r) => acc + (r.rowCount ?? 0), 0);
|
|
110358
|
+
return { rowsAffected };
|
|
110321
110359
|
}
|
|
110322
110360
|
async getTables(schema = "public") {
|
|
110323
110361
|
if (!this.pool) {
|
|
@@ -116329,11 +116367,11 @@ AuditModule = __decorate39([
|
|
|
116329
116367
|
], AuditModule);
|
|
116330
116368
|
|
|
116331
116369
|
// apps/api/dist/backup/backup.module.js
|
|
116332
|
-
var
|
|
116370
|
+
var import_common32 = __toESM(require_common(), 1);
|
|
116333
116371
|
var import_platform_express2 = __toESM(require_platform_express(), 1);
|
|
116334
116372
|
|
|
116335
116373
|
// apps/api/dist/backup/backup.controller.js
|
|
116336
|
-
var
|
|
116374
|
+
var import_common31 = __toESM(require_common(), 1);
|
|
116337
116375
|
var import_platform_express = __toESM(require_platform_express(), 1);
|
|
116338
116376
|
|
|
116339
116377
|
// apps/api/dist/backup/backup.service.js
|
|
@@ -116376,7 +116414,7 @@ var BackupService = BackupService_1 = class BackupService2 {
|
|
|
116376
116414
|
const startTime = Date.now();
|
|
116377
116415
|
const connection = this.connectionsService.findById(connectionId);
|
|
116378
116416
|
if (!connection) {
|
|
116379
|
-
throw new
|
|
116417
|
+
throw new import_common28.NotFoundException("Connection not found");
|
|
116380
116418
|
}
|
|
116381
116419
|
let password = "";
|
|
116382
116420
|
if (connection.engine !== "sqlite") {
|
|
@@ -116439,7 +116477,14 @@ var BackupService = BackupService_1 = class BackupService2 {
|
|
|
116439
116477
|
status: "failed",
|
|
116440
116478
|
error: errorMessage
|
|
116441
116479
|
});
|
|
116442
|
-
|
|
116480
|
+
if (error instanceof import_common28.HttpException) {
|
|
116481
|
+
throw error;
|
|
116482
|
+
}
|
|
116483
|
+
let clientMessage = errorMessage;
|
|
116484
|
+
if (errorMessage.includes("server version mismatch")) {
|
|
116485
|
+
clientMessage = `${errorMessage} Install PostgreSQL client tools (pg_dump) with a major version that matches or exceeds the server, or run the API on a host that has them.`;
|
|
116486
|
+
}
|
|
116487
|
+
throw new import_common28.BadRequestException(clientMessage);
|
|
116443
116488
|
}
|
|
116444
116489
|
}
|
|
116445
116490
|
async performBackup(connection, filePath, backupType, compression, method = "native") {
|
|
@@ -116826,7 +116871,7 @@ var RestoreService = RestoreService_1 = class RestoreService2 {
|
|
|
116826
116871
|
this.connectionsService = connectionsService;
|
|
116827
116872
|
}
|
|
116828
116873
|
async restoreBackup(options) {
|
|
116829
|
-
const { connectionId, backupId, method = "native" } = options;
|
|
116874
|
+
const { connectionId, backupId, method = "native", skipPreClean } = options;
|
|
116830
116875
|
const startTime = Date.now();
|
|
116831
116876
|
const backup = this.metadataService.backupRepository.getById(backupId);
|
|
116832
116877
|
if (!backup) {
|
|
@@ -116866,7 +116911,9 @@ var RestoreService = RestoreService_1 = class RestoreService2 {
|
|
|
116866
116911
|
if (method === "sql") {
|
|
116867
116912
|
await this.performSQLRestore(connectionId, backup.filePath);
|
|
116868
116913
|
} else {
|
|
116869
|
-
await this.performRestore({ ...connection, password }, backup.filePath
|
|
116914
|
+
await this.performRestore({ ...connection, password }, backup.filePath, {
|
|
116915
|
+
skipPreClean
|
|
116916
|
+
});
|
|
116870
116917
|
}
|
|
116871
116918
|
const duration = Date.now() - startTime;
|
|
116872
116919
|
this.metadataService.backupLogsRepository.create({
|
|
@@ -116899,19 +116946,19 @@ var RestoreService = RestoreService_1 = class RestoreService2 {
|
|
|
116899
116946
|
throw error;
|
|
116900
116947
|
}
|
|
116901
116948
|
}
|
|
116902
|
-
async performRestore(connection, filePath) {
|
|
116949
|
+
async performRestore(connection, filePath, opts = {}) {
|
|
116903
116950
|
switch (connection.engine) {
|
|
116904
116951
|
case "postgres":
|
|
116905
|
-
return this.performPostgresRestore(connection, filePath);
|
|
116952
|
+
return this.performPostgresRestore(connection, filePath, opts);
|
|
116906
116953
|
case "mysql":
|
|
116907
|
-
return this.performMySQLRestore(connection, filePath);
|
|
116954
|
+
return this.performMySQLRestore(connection, filePath, opts);
|
|
116908
116955
|
case "sqlite":
|
|
116909
116956
|
return this.performSQLiteRestore(connection, filePath);
|
|
116910
116957
|
default:
|
|
116911
116958
|
throw new Error(`Unsupported database engine: ${connection.engine}`);
|
|
116912
116959
|
}
|
|
116913
116960
|
}
|
|
116914
|
-
async performPostgresRestore(connection, filePath) {
|
|
116961
|
+
async performPostgresRestore(connection, filePath, opts = {}) {
|
|
116915
116962
|
const isCompressed = await this.isGzipCompressed(filePath);
|
|
116916
116963
|
this.logger.log(`Postgres restore - File is compressed: ${isCompressed}`);
|
|
116917
116964
|
let actualFilePath = filePath;
|
|
@@ -116919,7 +116966,11 @@ var RestoreService = RestoreService_1 = class RestoreService2 {
|
|
|
116919
116966
|
actualFilePath = filePath.replace(/\.gz$/, "") + ".tmp";
|
|
116920
116967
|
await this.decompressFile(filePath, actualFilePath);
|
|
116921
116968
|
}
|
|
116922
|
-
|
|
116969
|
+
if (opts.skipPreClean) {
|
|
116970
|
+
this.logger.warn("Skipping Postgres pre-restore clean (skipPreClean=true)");
|
|
116971
|
+
} else {
|
|
116972
|
+
await this.cleanPostgresDatabase(connection);
|
|
116973
|
+
}
|
|
116923
116974
|
const args = [
|
|
116924
116975
|
"-h",
|
|
116925
116976
|
connection.host,
|
|
@@ -117061,7 +117112,8 @@ var RestoreService = RestoreService_1 = class RestoreService2 {
|
|
|
117061
117112
|
resolve();
|
|
117062
117113
|
} else {
|
|
117063
117114
|
this.logger.error(`Clean stderr: ${stderr}`);
|
|
117064
|
-
|
|
117115
|
+
const message = this.formatPostgresSchemaOwnerError(stderr, schemasToClean) ?? `Failed to clean database: ${stderr}`;
|
|
117116
|
+
reject(new Error(message));
|
|
117065
117117
|
}
|
|
117066
117118
|
});
|
|
117067
117119
|
proc.on("error", (error) => {
|
|
@@ -117072,8 +117124,22 @@ var RestoreService = RestoreService_1 = class RestoreService2 {
|
|
|
117072
117124
|
this.logger.log("No schemas to drop");
|
|
117073
117125
|
}
|
|
117074
117126
|
}
|
|
117075
|
-
|
|
117076
|
-
|
|
117127
|
+
/**
|
|
117128
|
+
* Turns opaque Postgres privilege errors into actionable guidance.
|
|
117129
|
+
*/
|
|
117130
|
+
formatPostgresSchemaOwnerError(stderr, schemasToClean) {
|
|
117131
|
+
if (!stderr.includes("must be owner of schema")) {
|
|
117132
|
+
return null;
|
|
117133
|
+
}
|
|
117134
|
+
const quoted = schemasToClean.map((s) => `"${s.replaceAll('"', '""')}"`).join(", ");
|
|
117135
|
+
return `Failed to clean database before restore: DROP SCHEMA requires the connection user to own the schema(s) ${quoted} (or be a superuser). Fix: connect as the schema owner or a superuser, or run (as a privileged role) ALTER SCHEMA schema_name OWNER TO your_user for each schema. Advanced: POST /backups/:id/restore with { "connectionId": "...", "skipPreClean": true } only if your dump is safe without a wipe (e.g. includes DROP/CLEAN or targets an empty DB). PostgreSQL said: ${stderr.trim()}`;
|
|
117136
|
+
}
|
|
117137
|
+
async performMySQLRestore(connection, filePath, opts = {}) {
|
|
117138
|
+
if (opts.skipPreClean) {
|
|
117139
|
+
this.logger.warn("Skipping MySQL pre-restore clean (skipPreClean=true)");
|
|
117140
|
+
} else {
|
|
117141
|
+
await this.cleanMySQLDatabase(connection);
|
|
117142
|
+
}
|
|
117077
117143
|
const isCompressed = await this.isGzipCompressed(filePath);
|
|
117078
117144
|
const catCommand = isCompressed ? `gunzip -c "${filePath}"` : `cat "${filePath}"`;
|
|
117079
117145
|
const command = `${catCommand} | mysql -h ${connection.host} -P ${connection.port} -u ${connection.username} --protocol=TCP --force ${connection.database}`;
|
|
@@ -117316,6 +117382,7 @@ RestoreService = RestoreService_1 = __decorate41([
|
|
|
117316
117382
|
], RestoreService);
|
|
117317
117383
|
|
|
117318
117384
|
// apps/api/dist/backup/setup-tools.js
|
|
117385
|
+
var import_common30 = __toESM(require_common(), 1);
|
|
117319
117386
|
import { spawn as spawn3 } from "node:child_process";
|
|
117320
117387
|
import { platform } from "node:os";
|
|
117321
117388
|
import * as fs5 from "node:fs";
|
|
@@ -117365,6 +117432,21 @@ var BackupToolsSetup = class {
|
|
|
117365
117432
|
}
|
|
117366
117433
|
return results;
|
|
117367
117434
|
}
|
|
117435
|
+
/**
|
|
117436
|
+
* Short guidance when native CLI tools are present — client major version must match server
|
|
117437
|
+
* expectations (e.g. pg_dump "server version mismatch").
|
|
117438
|
+
*/
|
|
117439
|
+
static getToolCompatibilityNotes(tools) {
|
|
117440
|
+
const notes = [];
|
|
117441
|
+
const cmd = (name) => tools.find((t) => t.command === name);
|
|
117442
|
+
if (cmd("pg_dump")?.installed) {
|
|
117443
|
+
notes.push('PostgreSQL: backups run pg_dump on this host. Use a client major version compatible with each server (if you see "server version mismatch", upgrade postgresql-client to match or exceed the server version, e.g. server 16 \u2192 client 16+).');
|
|
117444
|
+
}
|
|
117445
|
+
if (cmd("mysqldump")?.installed) {
|
|
117446
|
+
notes.push("MySQL: backups use mysqldump on this host. Keep client tools in line with your MySQL/MariaDB server versions.");
|
|
117447
|
+
}
|
|
117448
|
+
return notes;
|
|
117449
|
+
}
|
|
117368
117450
|
/**
|
|
117369
117451
|
* Detect Linux distribution
|
|
117370
117452
|
*/
|
|
@@ -117464,45 +117546,107 @@ var BackupToolsSetup = class {
|
|
|
117464
117546
|
}
|
|
117465
117547
|
}
|
|
117466
117548
|
/**
|
|
117467
|
-
* Attempt to auto-install tools (requires sudo/admin privileges)
|
|
117549
|
+
* Attempt to auto-install or upgrade tools (requires sudo/admin privileges where applicable).
|
|
117468
117550
|
*/
|
|
117469
|
-
static async autoInstall() {
|
|
117551
|
+
static async autoInstall(options = {}) {
|
|
117552
|
+
const incPg = options.includePostgresqlTools !== false;
|
|
117553
|
+
const incMysql = options.includeMysqlTools !== false;
|
|
117554
|
+
if (!incPg && !incMysql) {
|
|
117555
|
+
throw new import_common30.BadRequestException("Select at least one client stack: PostgreSQL (pg_dump, psql) and/or MySQL (mysqldump, mysql).");
|
|
117556
|
+
}
|
|
117470
117557
|
const os3 = platform();
|
|
117471
117558
|
if (os3 === "linux") {
|
|
117472
|
-
return this.installLinux(
|
|
117473
|
-
|
|
117474
|
-
|
|
117475
|
-
|
|
117476
|
-
|
|
117477
|
-
|
|
117478
|
-
|
|
117479
|
-
|
|
117559
|
+
return this.installLinux({
|
|
117560
|
+
...options,
|
|
117561
|
+
includePostgresqlTools: incPg,
|
|
117562
|
+
includeMysqlTools: incMysql
|
|
117563
|
+
});
|
|
117564
|
+
}
|
|
117565
|
+
if (os3 === "darwin") {
|
|
117566
|
+
return this.installMacOS({
|
|
117567
|
+
...options,
|
|
117568
|
+
includePostgresqlTools: incPg,
|
|
117569
|
+
includeMysqlTools: incMysql
|
|
117570
|
+
});
|
|
117571
|
+
}
|
|
117572
|
+
return {
|
|
117573
|
+
success: false,
|
|
117574
|
+
message: "Auto-installation is not supported on this platform. Please install manually."
|
|
117575
|
+
};
|
|
117576
|
+
}
|
|
117577
|
+
static buildAptPackages(options) {
|
|
117578
|
+
const pkgs = [];
|
|
117579
|
+
if (options.includePostgresqlTools !== false) {
|
|
117580
|
+
pkgs.push(options.postgresqlClientMajor != null ? `postgresql-client-${options.postgresqlClientMajor}` : "postgresql-client");
|
|
117581
|
+
}
|
|
117582
|
+
if (options.includeMysqlTools !== false) {
|
|
117583
|
+
pkgs.push(options.mysqlClientPackage === "8.0" ? "mysql-client-8.0" : "mysql-client");
|
|
117480
117584
|
}
|
|
117585
|
+
return pkgs;
|
|
117481
117586
|
}
|
|
117482
|
-
static
|
|
117587
|
+
static mysqlAptOnlyHint(options) {
|
|
117588
|
+
return options.mysqlClientPackage === "8.0" ? " MySQL 8.0 client package selection applies on apt (Debian/Ubuntu) only; other package managers use their default MySQL/MariaDB client packages." : "";
|
|
117589
|
+
}
|
|
117590
|
+
static async installLinux(options) {
|
|
117483
117591
|
const hasApt = await this.checkCommand("apt-get").then((r) => r.installed);
|
|
117484
117592
|
const hasDnf = await this.checkCommand("dnf").then((r) => r.installed);
|
|
117485
117593
|
const hasPacman = await this.checkCommand("pacman").then((r) => r.installed);
|
|
117486
|
-
|
|
117487
|
-
|
|
117594
|
+
const mode = options.mode ?? "install";
|
|
117595
|
+
const pw = options.sudoPassword;
|
|
117488
117596
|
if (hasApt) {
|
|
117489
|
-
|
|
117490
|
-
|
|
117491
|
-
|
|
117492
|
-
|
|
117493
|
-
|
|
117494
|
-
|
|
117495
|
-
|
|
117496
|
-
|
|
117497
|
-
|
|
117498
|
-
|
|
117499
|
-
|
|
117500
|
-
|
|
117501
|
-
|
|
117597
|
+
const pkgs = this.buildAptPackages(options);
|
|
117598
|
+
const pkgStr = pkgs.join(" ");
|
|
117599
|
+
const script = mode === "upgrade_latest" ? `apt-get update -qq && apt-get install -y --only-upgrade ${pkgStr} || apt-get install -y ${pkgStr}` : `apt-get update -qq && apt-get install -y ${pkgStr}`;
|
|
117600
|
+
const result = await this.runSudoShell(script, pw);
|
|
117601
|
+
if (result.success && options.mysqlClientPackage === "8.0") {
|
|
117602
|
+
return {
|
|
117603
|
+
...result,
|
|
117604
|
+
message: `${result.message} (MySQL apt package: mysql-client-8.0 where available.)`
|
|
117605
|
+
};
|
|
117606
|
+
}
|
|
117607
|
+
return result;
|
|
117608
|
+
}
|
|
117609
|
+
const incPg = options.includePostgresqlTools !== false;
|
|
117610
|
+
const incMysql = options.includeMysqlTools !== false;
|
|
117611
|
+
const major = options.postgresqlClientMajor;
|
|
117612
|
+
const pgSuffix = major != null ? " PostgreSQL client major is applied on apt only; dnf/pacman use distro PostgreSQL client packages." : "";
|
|
117613
|
+
if (hasDnf) {
|
|
117614
|
+
const dnfPkgs = [];
|
|
117615
|
+
if (incPg)
|
|
117616
|
+
dnfPkgs.push("postgresql");
|
|
117617
|
+
if (incMysql)
|
|
117618
|
+
dnfPkgs.push("mysql");
|
|
117619
|
+
if (dnfPkgs.length === 0) {
|
|
117620
|
+
return { success: false, message: "No packages selected for dnf." };
|
|
117621
|
+
}
|
|
117622
|
+
const op = mode === "upgrade_latest" ? "upgrade" : "install";
|
|
117623
|
+
const result = await this.runSudoArgv(["dnf", op, "-y", ...dnfPkgs], pw);
|
|
117624
|
+
return result.success ? {
|
|
117625
|
+
...result,
|
|
117626
|
+
message: result.message + pgSuffix + this.mysqlAptOnlyHint(options)
|
|
117627
|
+
} : result;
|
|
117628
|
+
}
|
|
117629
|
+
if (hasPacman) {
|
|
117630
|
+
const pacPkgs = [];
|
|
117631
|
+
if (incPg)
|
|
117632
|
+
pacPkgs.push("postgresql-libs");
|
|
117633
|
+
if (incMysql)
|
|
117634
|
+
pacPkgs.push("mysql-clients");
|
|
117635
|
+
if (pacPkgs.length === 0) {
|
|
117636
|
+
return { success: false, message: "No packages selected for pacman." };
|
|
117637
|
+
}
|
|
117638
|
+
const result = mode === "upgrade_latest" ? await this.runSudoArgv(["pacman", "-Sy", "--noconfirm", ...pacPkgs], pw) : await this.runSudoArgv(["pacman", "-S", "--noconfirm", ...pacPkgs], pw);
|
|
117639
|
+
return result.success ? {
|
|
117640
|
+
...result,
|
|
117641
|
+
message: result.message + pgSuffix + this.mysqlAptOnlyHint(options)
|
|
117642
|
+
} : result;
|
|
117502
117643
|
}
|
|
117503
|
-
return
|
|
117644
|
+
return {
|
|
117645
|
+
success: false,
|
|
117646
|
+
message: "Could not detect package manager. Please install manually."
|
|
117647
|
+
};
|
|
117504
117648
|
}
|
|
117505
|
-
static async installMacOS() {
|
|
117649
|
+
static async installMacOS(options) {
|
|
117506
117650
|
const hasBrew = await this.checkCommand("brew").then((r) => r.installed);
|
|
117507
117651
|
if (!hasBrew) {
|
|
117508
117652
|
return {
|
|
@@ -117510,11 +117654,121 @@ var BackupToolsSetup = class {
|
|
|
117510
117654
|
message: "Homebrew is not installed. Please install Homebrew first or install tools manually."
|
|
117511
117655
|
};
|
|
117512
117656
|
}
|
|
117513
|
-
|
|
117657
|
+
const mode = options.mode ?? "install";
|
|
117658
|
+
const incPg = options.includePostgresqlTools !== false;
|
|
117659
|
+
const incMysql = options.includeMysqlTools !== false;
|
|
117660
|
+
const major = options.postgresqlClientMajor;
|
|
117661
|
+
const mysqlHint = options.mysqlClientPackage === "8.0" ? " For MySQL 8.0-style clients on macOS, try: brew install mysql@8.0 (formula names vary; mysql-client may be enough)." : "";
|
|
117662
|
+
if (mode === "upgrade_latest") {
|
|
117663
|
+
const parts = ["brew update"];
|
|
117664
|
+
if (incPg) {
|
|
117665
|
+
parts.push(major != null ? `brew upgrade postgresql@${major} || brew upgrade postgresql` : "brew upgrade postgresql");
|
|
117666
|
+
}
|
|
117667
|
+
if (incMysql) {
|
|
117668
|
+
parts.push("brew upgrade mysql-client");
|
|
117669
|
+
}
|
|
117670
|
+
const result2 = await this.runShellCommand(parts.join(" && "));
|
|
117671
|
+
return result2.success ? {
|
|
117672
|
+
...result2,
|
|
117673
|
+
message: result2.message + mysqlHint
|
|
117674
|
+
} : result2;
|
|
117675
|
+
}
|
|
117676
|
+
const installParts = [];
|
|
117677
|
+
if (incPg) {
|
|
117678
|
+
installParts.push(major != null ? `brew install postgresql@${major}` : "brew install postgresql");
|
|
117679
|
+
}
|
|
117680
|
+
if (incMysql) {
|
|
117681
|
+
installParts.push("brew install mysql-client");
|
|
117682
|
+
}
|
|
117683
|
+
if (installParts.length === 0) {
|
|
117684
|
+
return { success: false, message: "No Homebrew packages selected." };
|
|
117685
|
+
}
|
|
117686
|
+
const result = await this.runShellCommand(installParts.join(" && "));
|
|
117687
|
+
let message = result.message;
|
|
117688
|
+
if (result.success && major != null && incPg) {
|
|
117689
|
+
message += ` You may need: brew link --overwrite postgresql@${major} so pg_dump/psql match that version.`;
|
|
117690
|
+
}
|
|
117691
|
+
if (result.success) {
|
|
117692
|
+
message += mysqlHint;
|
|
117693
|
+
}
|
|
117694
|
+
return { ...result, message };
|
|
117695
|
+
}
|
|
117696
|
+
/**
|
|
117697
|
+
* Turns generic "exit code 100" into guidance when apt/brew output explains the failure.
|
|
117698
|
+
*/
|
|
117699
|
+
static formatToolInstallFailure(baseMessage, exitCode, combined) {
|
|
117700
|
+
const out = combined;
|
|
117701
|
+
const locateMatch = out.match(/Unable to locate package\s+(\S+)/i);
|
|
117702
|
+
if (locateMatch) {
|
|
117703
|
+
const pkg = locateMatch[1];
|
|
117704
|
+
return `${baseMessage} (exit ${exitCode}). Apt could not find "${pkg}" in your current sources. Try "Distro default" or a PostgreSQL major your distribution actually ships (on Debian/Ubuntu, search with apt-cache search postgresql-client). For newer majors (e.g. 17\u201318) you often need the PostgreSQL PGDG apt repository: https://wiki.postgresql.org/wiki/Apt`;
|
|
117705
|
+
}
|
|
117706
|
+
if (/No available formula|Could not find formula/i.test(out)) {
|
|
117707
|
+
return `${baseMessage} (exit ${exitCode}). Homebrew did not find a matching formula. Run brew update, choose "Distro default" for PostgreSQL, or install the version you need manually.`;
|
|
117708
|
+
}
|
|
117709
|
+
if (/Sorry, try again|incorrect password|authentication failure/i.test(out) && /sudo/i.test(out)) {
|
|
117710
|
+
return `${baseMessage} (exit ${exitCode}). Sudo rejected the password or requires a TTY. Double-check the password or configure passwordless sudo for these package commands.`;
|
|
117711
|
+
}
|
|
117712
|
+
return `${baseMessage} (exit ${exitCode}).`;
|
|
117713
|
+
}
|
|
117714
|
+
/**
|
|
117715
|
+
* Run `sudo sh -c '<script>'`. If `password` is set, uses `sudo -S -k` and writes the password to stdin.
|
|
117716
|
+
*/
|
|
117717
|
+
static async runSudoShell(script, password) {
|
|
117718
|
+
return this.runSudoArgv(["sh", "-c", script], password);
|
|
117719
|
+
}
|
|
117720
|
+
/** Run `sudo [ -S -k ] arg0 arg1 ...` */
|
|
117721
|
+
static async runSudoArgv(args, password) {
|
|
117722
|
+
const usePw = password != null && password.length > 0;
|
|
117723
|
+
const sudoArgs = usePw ? ["-S", "-k", ...args] : args;
|
|
117724
|
+
return new Promise((resolve) => {
|
|
117725
|
+
const proc = spawn3("sudo", [...sudoArgs], {
|
|
117726
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
117727
|
+
env: { ...process.env }
|
|
117728
|
+
});
|
|
117729
|
+
let output = "";
|
|
117730
|
+
let errorOutput = "";
|
|
117731
|
+
if (usePw) {
|
|
117732
|
+
proc.stdin?.write(`${password}
|
|
117733
|
+
`);
|
|
117734
|
+
proc.stdin?.end();
|
|
117735
|
+
}
|
|
117736
|
+
proc.stdout?.on("data", (data) => {
|
|
117737
|
+
output += data.toString();
|
|
117738
|
+
});
|
|
117739
|
+
proc.stderr?.on("data", (data) => {
|
|
117740
|
+
errorOutput += data.toString();
|
|
117741
|
+
});
|
|
117742
|
+
proc.on("close", (code) => {
|
|
117743
|
+
const combined = output + errorOutput;
|
|
117744
|
+
if (code === 0) {
|
|
117745
|
+
resolve({
|
|
117746
|
+
success: true,
|
|
117747
|
+
message: "Command completed successfully",
|
|
117748
|
+
output: combined
|
|
117749
|
+
});
|
|
117750
|
+
} else {
|
|
117751
|
+
resolve({
|
|
117752
|
+
success: false,
|
|
117753
|
+
message: this.formatToolInstallFailure("Command failed", code, combined),
|
|
117754
|
+
output: combined
|
|
117755
|
+
});
|
|
117756
|
+
}
|
|
117757
|
+
});
|
|
117758
|
+
proc.on("error", (error) => {
|
|
117759
|
+
resolve({
|
|
117760
|
+
success: false,
|
|
117761
|
+
message: `Failed to run sudo: ${error.message}`
|
|
117762
|
+
});
|
|
117763
|
+
});
|
|
117764
|
+
});
|
|
117514
117765
|
}
|
|
117515
|
-
static async
|
|
117766
|
+
static async runShellCommand(script) {
|
|
117516
117767
|
return new Promise((resolve) => {
|
|
117517
|
-
const proc = spawn3(
|
|
117768
|
+
const proc = spawn3("sh", ["-c", script], {
|
|
117769
|
+
stdio: "pipe",
|
|
117770
|
+
env: { ...process.env }
|
|
117771
|
+
});
|
|
117518
117772
|
let output = "";
|
|
117519
117773
|
let errorOutput = "";
|
|
117520
117774
|
proc.stdout?.on("data", (data) => {
|
|
@@ -117524,24 +117778,25 @@ var BackupToolsSetup = class {
|
|
|
117524
117778
|
errorOutput += data.toString();
|
|
117525
117779
|
});
|
|
117526
117780
|
proc.on("close", (code) => {
|
|
117781
|
+
const combined = output + errorOutput;
|
|
117527
117782
|
if (code === 0) {
|
|
117528
117783
|
resolve({
|
|
117529
117784
|
success: true,
|
|
117530
|
-
message: "
|
|
117531
|
-
output:
|
|
117785
|
+
message: "Command completed successfully",
|
|
117786
|
+
output: combined
|
|
117532
117787
|
});
|
|
117533
117788
|
} else {
|
|
117534
117789
|
resolve({
|
|
117535
117790
|
success: false,
|
|
117536
|
-
message:
|
|
117537
|
-
output:
|
|
117791
|
+
message: this.formatToolInstallFailure("Command failed", code, combined),
|
|
117792
|
+
output: combined
|
|
117538
117793
|
});
|
|
117539
117794
|
}
|
|
117540
117795
|
});
|
|
117541
117796
|
proc.on("error", (error) => {
|
|
117542
117797
|
resolve({
|
|
117543
117798
|
success: false,
|
|
117544
|
-
message: `Failed to run
|
|
117799
|
+
message: `Failed to run command: ${error.message}`
|
|
117545
117800
|
});
|
|
117546
117801
|
});
|
|
117547
117802
|
});
|
|
@@ -117602,6 +117857,8 @@ var __metadata32 = function(k, v) {
|
|
|
117602
117857
|
var RestoreBackupDto = class {
|
|
117603
117858
|
connectionId;
|
|
117604
117859
|
method;
|
|
117860
|
+
/** Skip native pre-restore clean (drop schema / MySQL tables). Use only when your dump handles conflicts or you cleaned manually. */
|
|
117861
|
+
skipPreClean;
|
|
117605
117862
|
};
|
|
117606
117863
|
__decorate43([
|
|
117607
117864
|
(0, import_class_validator16.IsString)(),
|
|
@@ -117613,8 +117870,14 @@ __decorate43([
|
|
|
117613
117870
|
(0, import_class_validator16.IsIn)(["native", "sql"], { message: "Method must be native or sql" }),
|
|
117614
117871
|
__metadata32("design:type", String)
|
|
117615
117872
|
], RestoreBackupDto.prototype, "method", void 0);
|
|
117873
|
+
__decorate43([
|
|
117874
|
+
(0, import_class_validator16.IsOptional)(),
|
|
117875
|
+
(0, import_class_validator16.IsBoolean)(),
|
|
117876
|
+
__metadata32("design:type", Boolean)
|
|
117877
|
+
], RestoreBackupDto.prototype, "skipPreClean", void 0);
|
|
117616
117878
|
|
|
117617
|
-
// apps/api/dist/backup/backup.
|
|
117879
|
+
// apps/api/dist/backup/dto/install-backup-tools.dto.js
|
|
117880
|
+
var import_class_validator17 = __toESM(require_cjs(), 1);
|
|
117618
117881
|
var __decorate44 = function(decorators, target, key, desc) {
|
|
117619
117882
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
117620
117883
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -117624,6 +117887,73 @@ var __decorate44 = function(decorators, target, key, desc) {
|
|
|
117624
117887
|
var __metadata33 = function(k, v) {
|
|
117625
117888
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
117626
117889
|
};
|
|
117890
|
+
var InstallBackupToolsDto = class {
|
|
117891
|
+
mode;
|
|
117892
|
+
/** Install/upgrade PostgreSQL client stack (pg_dump, psql). Default true. */
|
|
117893
|
+
includePostgresqlTools;
|
|
117894
|
+
/** Install/upgrade MySQL client stack (mysqldump, mysql). Default true. */
|
|
117895
|
+
includeMysqlTools;
|
|
117896
|
+
/**
|
|
117897
|
+
* Debian/Ubuntu: `postgresql-client-{major}`.
|
|
117898
|
+
* macOS/Homebrew: `postgresql@{major}`. Ignored for dnf/pacman (distro meta packages only).
|
|
117899
|
+
*/
|
|
117900
|
+
postgresqlClientMajor;
|
|
117901
|
+
/**
|
|
117902
|
+
* Debian/Ubuntu only: `mysql-client` vs `mysql-client-8.0`. Other platforms use distro default.
|
|
117903
|
+
*/
|
|
117904
|
+
mysqlClientPackage;
|
|
117905
|
+
/**
|
|
117906
|
+
* If set, passed to sudo via stdin (`sudo -S`). Only use on trusted machines over HTTPS.
|
|
117907
|
+
* Homebrew installs on macOS do not use sudo.
|
|
117908
|
+
*/
|
|
117909
|
+
sudoPassword;
|
|
117910
|
+
};
|
|
117911
|
+
__decorate44([
|
|
117912
|
+
(0, import_class_validator17.IsOptional)(),
|
|
117913
|
+
(0, import_class_validator17.IsIn)(["install", "upgrade_latest"], {
|
|
117914
|
+
message: "mode must be install or upgrade_latest"
|
|
117915
|
+
}),
|
|
117916
|
+
__metadata33("design:type", String)
|
|
117917
|
+
], InstallBackupToolsDto.prototype, "mode", void 0);
|
|
117918
|
+
__decorate44([
|
|
117919
|
+
(0, import_class_validator17.IsOptional)(),
|
|
117920
|
+
(0, import_class_validator17.IsBoolean)(),
|
|
117921
|
+
__metadata33("design:type", Boolean)
|
|
117922
|
+
], InstallBackupToolsDto.prototype, "includePostgresqlTools", void 0);
|
|
117923
|
+
__decorate44([
|
|
117924
|
+
(0, import_class_validator17.IsOptional)(),
|
|
117925
|
+
(0, import_class_validator17.IsBoolean)(),
|
|
117926
|
+
__metadata33("design:type", Boolean)
|
|
117927
|
+
], InstallBackupToolsDto.prototype, "includeMysqlTools", void 0);
|
|
117928
|
+
__decorate44([
|
|
117929
|
+
(0, import_class_validator17.IsOptional)(),
|
|
117930
|
+
(0, import_class_validator17.IsInt)(),
|
|
117931
|
+
(0, import_class_validator17.Min)(12),
|
|
117932
|
+
(0, import_class_validator17.Max)(18),
|
|
117933
|
+
__metadata33("design:type", Number)
|
|
117934
|
+
], InstallBackupToolsDto.prototype, "postgresqlClientMajor", void 0);
|
|
117935
|
+
__decorate44([
|
|
117936
|
+
(0, import_class_validator17.IsOptional)(),
|
|
117937
|
+
(0, import_class_validator17.IsIn)(["default", "8.0"]),
|
|
117938
|
+
__metadata33("design:type", String)
|
|
117939
|
+
], InstallBackupToolsDto.prototype, "mysqlClientPackage", void 0);
|
|
117940
|
+
__decorate44([
|
|
117941
|
+
(0, import_class_validator17.IsOptional)(),
|
|
117942
|
+
(0, import_class_validator17.IsString)(),
|
|
117943
|
+
(0, import_class_validator17.MaxLength)(512),
|
|
117944
|
+
__metadata33("design:type", String)
|
|
117945
|
+
], InstallBackupToolsDto.prototype, "sudoPassword", void 0);
|
|
117946
|
+
|
|
117947
|
+
// apps/api/dist/backup/backup.controller.js
|
|
117948
|
+
var __decorate45 = function(decorators, target, key, desc) {
|
|
117949
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
117950
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
117951
|
+
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;
|
|
117952
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
117953
|
+
};
|
|
117954
|
+
var __metadata34 = function(k, v) {
|
|
117955
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
117956
|
+
};
|
|
117627
117957
|
var __param9 = function(paramIndex, decorator) {
|
|
117628
117958
|
return function(target, key) {
|
|
117629
117959
|
decorator(target, key, paramIndex);
|
|
@@ -117680,7 +118010,8 @@ var BackupController = class BackupController2 {
|
|
|
117680
118010
|
return this.restoreService.restoreBackup({
|
|
117681
118011
|
connectionId: body.connectionId,
|
|
117682
118012
|
backupId: id,
|
|
117683
|
-
method: body.method
|
|
118013
|
+
method: body.method,
|
|
118014
|
+
skipPreClean: body.skipPreClean
|
|
117684
118015
|
});
|
|
117685
118016
|
}
|
|
117686
118017
|
async deleteBackup(id) {
|
|
@@ -117689,103 +118020,113 @@ var BackupController = class BackupController2 {
|
|
|
117689
118020
|
async getToolsStatus() {
|
|
117690
118021
|
const tools = await BackupToolsSetup.checkTools();
|
|
117691
118022
|
const instructions = BackupToolsSetup.getInstallInstructions();
|
|
118023
|
+
const compatibilityNotes = BackupToolsSetup.getToolCompatibilityNotes(tools);
|
|
117692
118024
|
return {
|
|
117693
118025
|
tools,
|
|
117694
118026
|
allInstalled: tools.every((t) => t.installed),
|
|
117695
|
-
instructions
|
|
117696
|
-
|
|
117697
|
-
|
|
117698
|
-
|
|
117699
|
-
|
|
118027
|
+
instructions,
|
|
118028
|
+
compatibilityNotes
|
|
118029
|
+
};
|
|
118030
|
+
}
|
|
118031
|
+
async installTools(body) {
|
|
118032
|
+
return BackupToolsSetup.autoInstall({
|
|
118033
|
+
mode: body.mode ?? "install",
|
|
118034
|
+
includePostgresqlTools: body.includePostgresqlTools,
|
|
118035
|
+
includeMysqlTools: body.includeMysqlTools,
|
|
118036
|
+
postgresqlClientMajor: body.postgresqlClientMajor,
|
|
118037
|
+
mysqlClientPackage: body.mysqlClientPackage,
|
|
118038
|
+
sudoPassword: body.sudoPassword
|
|
118039
|
+
});
|
|
117700
118040
|
}
|
|
117701
118041
|
};
|
|
117702
|
-
|
|
117703
|
-
(0,
|
|
117704
|
-
__param9(0, (0,
|
|
117705
|
-
|
|
117706
|
-
|
|
117707
|
-
|
|
118042
|
+
__decorate45([
|
|
118043
|
+
(0, import_common31.Post)(),
|
|
118044
|
+
__param9(0, (0, import_common31.Body)()),
|
|
118045
|
+
__metadata34("design:type", Function),
|
|
118046
|
+
__metadata34("design:paramtypes", [CreateBackupDto]),
|
|
118047
|
+
__metadata34("design:returntype", Promise)
|
|
117708
118048
|
], BackupController.prototype, "createBackup", null);
|
|
117709
|
-
|
|
117710
|
-
(0,
|
|
117711
|
-
__param9(0, (0,
|
|
117712
|
-
|
|
117713
|
-
|
|
117714
|
-
|
|
118049
|
+
__decorate45([
|
|
118050
|
+
(0, import_common31.Get)(),
|
|
118051
|
+
__param9(0, (0, import_common31.Query)("connectionId")),
|
|
118052
|
+
__metadata34("design:type", Function),
|
|
118053
|
+
__metadata34("design:paramtypes", [String]),
|
|
118054
|
+
__metadata34("design:returntype", Promise)
|
|
117715
118055
|
], BackupController.prototype, "getBackups", null);
|
|
117716
|
-
|
|
117717
|
-
(0,
|
|
117718
|
-
__param9(0, (0,
|
|
117719
|
-
__param9(1, (0,
|
|
117720
|
-
__param9(2, (0,
|
|
117721
|
-
|
|
117722
|
-
|
|
117723
|
-
|
|
118056
|
+
__decorate45([
|
|
118057
|
+
(0, import_common31.Get)("logs"),
|
|
118058
|
+
__param9(0, (0, import_common31.Query)("connectionId")),
|
|
118059
|
+
__param9(1, (0, import_common31.Query)("operation")),
|
|
118060
|
+
__param9(2, (0, import_common31.Query)("limit")),
|
|
118061
|
+
__metadata34("design:type", Function),
|
|
118062
|
+
__metadata34("design:paramtypes", [String, String, String]),
|
|
118063
|
+
__metadata34("design:returntype", Promise)
|
|
117724
118064
|
], BackupController.prototype, "getBackupLogs", null);
|
|
117725
|
-
|
|
117726
|
-
(0,
|
|
117727
|
-
__param9(0, (0,
|
|
117728
|
-
|
|
117729
|
-
|
|
117730
|
-
|
|
118065
|
+
__decorate45([
|
|
118066
|
+
(0, import_common31.Get)("logs/:id"),
|
|
118067
|
+
__param9(0, (0, import_common31.Param)("id")),
|
|
118068
|
+
__metadata34("design:type", Function),
|
|
118069
|
+
__metadata34("design:paramtypes", [String]),
|
|
118070
|
+
__metadata34("design:returntype", Promise)
|
|
117731
118071
|
], BackupController.prototype, "getBackupLog", null);
|
|
117732
|
-
|
|
117733
|
-
(0,
|
|
117734
|
-
__param9(0, (0,
|
|
117735
|
-
|
|
117736
|
-
|
|
117737
|
-
|
|
118072
|
+
__decorate45([
|
|
118073
|
+
(0, import_common31.Get)(":id"),
|
|
118074
|
+
__param9(0, (0, import_common31.Param)("id")),
|
|
118075
|
+
__metadata34("design:type", Function),
|
|
118076
|
+
__metadata34("design:paramtypes", [String]),
|
|
118077
|
+
__metadata34("design:returntype", Promise)
|
|
117738
118078
|
], BackupController.prototype, "getBackup", null);
|
|
117739
|
-
|
|
117740
|
-
(0,
|
|
117741
|
-
__param9(0, (0,
|
|
117742
|
-
__param9(1, (0,
|
|
117743
|
-
|
|
117744
|
-
|
|
117745
|
-
|
|
118079
|
+
__decorate45([
|
|
118080
|
+
(0, import_common31.Get)(":id/download"),
|
|
118081
|
+
__param9(0, (0, import_common31.Param)("id")),
|
|
118082
|
+
__param9(1, (0, import_common31.Res)()),
|
|
118083
|
+
__metadata34("design:type", Function),
|
|
118084
|
+
__metadata34("design:paramtypes", [String, Object]),
|
|
118085
|
+
__metadata34("design:returntype", Promise)
|
|
117746
118086
|
], BackupController.prototype, "downloadBackup", null);
|
|
117747
|
-
|
|
117748
|
-
(0,
|
|
117749
|
-
(0,
|
|
117750
|
-
__param9(0, (0,
|
|
117751
|
-
__param9(1, (0,
|
|
117752
|
-
|
|
117753
|
-
|
|
117754
|
-
|
|
118087
|
+
__decorate45([
|
|
118088
|
+
(0, import_common31.Post)("upload"),
|
|
118089
|
+
(0, import_common31.UseInterceptors)((0, import_platform_express.FileInterceptor)("file")),
|
|
118090
|
+
__param9(0, (0, import_common31.UploadedFile)()),
|
|
118091
|
+
__param9(1, (0, import_common31.Body)("connectionId")),
|
|
118092
|
+
__metadata34("design:type", Function),
|
|
118093
|
+
__metadata34("design:paramtypes", [Object, String]),
|
|
118094
|
+
__metadata34("design:returntype", Promise)
|
|
117755
118095
|
], BackupController.prototype, "uploadBackup", null);
|
|
117756
|
-
|
|
117757
|
-
(0,
|
|
117758
|
-
(0,
|
|
117759
|
-
__param9(0, (0,
|
|
117760
|
-
__param9(1, (0,
|
|
117761
|
-
|
|
117762
|
-
|
|
117763
|
-
|
|
118096
|
+
__decorate45([
|
|
118097
|
+
(0, import_common31.Post)(":id/restore"),
|
|
118098
|
+
(0, import_common31.HttpCode)(import_common31.HttpStatus.OK),
|
|
118099
|
+
__param9(0, (0, import_common31.Param)("id")),
|
|
118100
|
+
__param9(1, (0, import_common31.Body)()),
|
|
118101
|
+
__metadata34("design:type", Function),
|
|
118102
|
+
__metadata34("design:paramtypes", [String, RestoreBackupDto]),
|
|
118103
|
+
__metadata34("design:returntype", Promise)
|
|
117764
118104
|
], BackupController.prototype, "restoreBackup", null);
|
|
117765
|
-
|
|
117766
|
-
(0,
|
|
117767
|
-
(0,
|
|
117768
|
-
__param9(0, (0,
|
|
117769
|
-
|
|
117770
|
-
|
|
117771
|
-
|
|
118105
|
+
__decorate45([
|
|
118106
|
+
(0, import_common31.Delete)(":id"),
|
|
118107
|
+
(0, import_common31.HttpCode)(import_common31.HttpStatus.OK),
|
|
118108
|
+
__param9(0, (0, import_common31.Param)("id")),
|
|
118109
|
+
__metadata34("design:type", Function),
|
|
118110
|
+
__metadata34("design:paramtypes", [String]),
|
|
118111
|
+
__metadata34("design:returntype", Promise)
|
|
117772
118112
|
], BackupController.prototype, "deleteBackup", null);
|
|
117773
|
-
|
|
117774
|
-
(0,
|
|
117775
|
-
|
|
117776
|
-
|
|
117777
|
-
|
|
118113
|
+
__decorate45([
|
|
118114
|
+
(0, import_common31.Get)("tools/status"),
|
|
118115
|
+
__metadata34("design:type", Function),
|
|
118116
|
+
__metadata34("design:paramtypes", []),
|
|
118117
|
+
__metadata34("design:returntype", Promise)
|
|
117778
118118
|
], BackupController.prototype, "getToolsStatus", null);
|
|
117779
|
-
|
|
117780
|
-
(0,
|
|
117781
|
-
(0,
|
|
117782
|
-
|
|
117783
|
-
|
|
117784
|
-
|
|
118119
|
+
__decorate45([
|
|
118120
|
+
(0, import_common31.Post)("tools/install"),
|
|
118121
|
+
(0, import_common31.HttpCode)(import_common31.HttpStatus.OK),
|
|
118122
|
+
__param9(0, (0, import_common31.Body)()),
|
|
118123
|
+
__metadata34("design:type", Function),
|
|
118124
|
+
__metadata34("design:paramtypes", [InstallBackupToolsDto]),
|
|
118125
|
+
__metadata34("design:returntype", Promise)
|
|
117785
118126
|
], BackupController.prototype, "installTools", null);
|
|
117786
|
-
BackupController =
|
|
117787
|
-
(0,
|
|
117788
|
-
|
|
118127
|
+
BackupController = __decorate45([
|
|
118128
|
+
(0, import_common31.Controller)("backups"),
|
|
118129
|
+
__metadata34("design:paramtypes", [
|
|
117789
118130
|
BackupService,
|
|
117790
118131
|
RestoreService,
|
|
117791
118132
|
MetadataService
|
|
@@ -117793,7 +118134,7 @@ BackupController = __decorate44([
|
|
|
117793
118134
|
], BackupController);
|
|
117794
118135
|
|
|
117795
118136
|
// apps/api/dist/backup/backup.module.js
|
|
117796
|
-
var
|
|
118137
|
+
var __decorate46 = function(decorators, target, key, desc) {
|
|
117797
118138
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
117798
118139
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
117799
118140
|
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;
|
|
@@ -117801,8 +118142,8 @@ var __decorate45 = function(decorators, target, key, desc) {
|
|
|
117801
118142
|
};
|
|
117802
118143
|
var BackupModule = class BackupModule2 {
|
|
117803
118144
|
};
|
|
117804
|
-
BackupModule =
|
|
117805
|
-
(0,
|
|
118145
|
+
BackupModule = __decorate46([
|
|
118146
|
+
(0, import_common32.Module)({
|
|
117806
118147
|
imports: [
|
|
117807
118148
|
MetadataModule,
|
|
117808
118149
|
ConnectionsModule,
|
|
@@ -117820,15 +118161,15 @@ BackupModule = __decorate45([
|
|
|
117820
118161
|
], BackupModule);
|
|
117821
118162
|
|
|
117822
118163
|
// apps/api/dist/import/import.module.js
|
|
117823
|
-
var
|
|
118164
|
+
var import_common35 = __toESM(require_common(), 1);
|
|
117824
118165
|
var import_platform_express4 = __toESM(require_platform_express(), 1);
|
|
117825
118166
|
|
|
117826
118167
|
// apps/api/dist/import/import.controller.js
|
|
117827
|
-
var
|
|
118168
|
+
var import_common34 = __toESM(require_common(), 1);
|
|
117828
118169
|
var import_platform_express3 = __toESM(require_platform_express(), 1);
|
|
117829
118170
|
|
|
117830
118171
|
// apps/api/dist/import/import.service.js
|
|
117831
|
-
var
|
|
118172
|
+
var import_common33 = __toESM(require_common(), 1);
|
|
117832
118173
|
|
|
117833
118174
|
// node_modules/.pnpm/csv-parse@5.6.0/node_modules/csv-parse/lib/api/CsvError.js
|
|
117834
118175
|
var CsvError = class _CsvError extends Error {
|
|
@@ -119317,13 +119658,13 @@ var parse = function(data, opts = {}) {
|
|
|
119317
119658
|
};
|
|
119318
119659
|
|
|
119319
119660
|
// apps/api/dist/import/import.service.js
|
|
119320
|
-
var
|
|
119661
|
+
var __decorate47 = function(decorators, target, key, desc) {
|
|
119321
119662
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
119322
119663
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
119323
119664
|
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;
|
|
119324
119665
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
119325
119666
|
};
|
|
119326
|
-
var
|
|
119667
|
+
var __metadata35 = function(k, v) {
|
|
119327
119668
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119328
119669
|
};
|
|
119329
119670
|
var ImportService_1;
|
|
@@ -119360,7 +119701,7 @@ function serializeValueForInsert2(value, dataType) {
|
|
|
119360
119701
|
}
|
|
119361
119702
|
var ImportService = ImportService_1 = class ImportService2 {
|
|
119362
119703
|
connectionsService;
|
|
119363
|
-
logger = new
|
|
119704
|
+
logger = new import_common33.Logger(ImportService_1.name);
|
|
119364
119705
|
constructor(connectionsService) {
|
|
119365
119706
|
this.connectionsService = connectionsService;
|
|
119366
119707
|
}
|
|
@@ -119493,20 +119834,20 @@ var ImportService = ImportService_1 = class ImportService2 {
|
|
|
119493
119834
|
return result;
|
|
119494
119835
|
}
|
|
119495
119836
|
};
|
|
119496
|
-
ImportService = ImportService_1 =
|
|
119497
|
-
(0,
|
|
119498
|
-
|
|
119837
|
+
ImportService = ImportService_1 = __decorate47([
|
|
119838
|
+
(0, import_common33.Injectable)(),
|
|
119839
|
+
__metadata35("design:paramtypes", [ConnectionsService])
|
|
119499
119840
|
], ImportService);
|
|
119500
119841
|
|
|
119501
119842
|
// apps/api/dist/import/dto/import.dto.js
|
|
119502
|
-
var
|
|
119503
|
-
var
|
|
119843
|
+
var import_class_validator18 = __toESM(require_cjs(), 1);
|
|
119844
|
+
var __decorate48 = function(decorators, target, key, desc) {
|
|
119504
119845
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
119505
119846
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
119506
119847
|
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;
|
|
119507
119848
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
119508
119849
|
};
|
|
119509
|
-
var
|
|
119850
|
+
var __metadata36 = function(k, v) {
|
|
119510
119851
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119511
119852
|
};
|
|
119512
119853
|
var PreviewImportDto = class {
|
|
@@ -119514,19 +119855,19 @@ var PreviewImportDto = class {
|
|
|
119514
119855
|
delimiter;
|
|
119515
119856
|
hasHeader;
|
|
119516
119857
|
};
|
|
119517
|
-
|
|
119518
|
-
(0,
|
|
119519
|
-
(0,
|
|
119520
|
-
|
|
119858
|
+
__decorate48([
|
|
119859
|
+
(0, import_class_validator18.IsString)(),
|
|
119860
|
+
(0, import_class_validator18.IsOptional)(),
|
|
119861
|
+
__metadata36("design:type", String)
|
|
119521
119862
|
], PreviewImportDto.prototype, "format", void 0);
|
|
119522
|
-
|
|
119523
|
-
(0,
|
|
119524
|
-
(0,
|
|
119525
|
-
|
|
119863
|
+
__decorate48([
|
|
119864
|
+
(0, import_class_validator18.IsString)(),
|
|
119865
|
+
(0, import_class_validator18.IsOptional)(),
|
|
119866
|
+
__metadata36("design:type", String)
|
|
119526
119867
|
], PreviewImportDto.prototype, "delimiter", void 0);
|
|
119527
|
-
|
|
119528
|
-
(0,
|
|
119529
|
-
|
|
119868
|
+
__decorate48([
|
|
119869
|
+
(0, import_class_validator18.IsOptional)(),
|
|
119870
|
+
__metadata36("design:type", Boolean)
|
|
119530
119871
|
], PreviewImportDto.prototype, "hasHeader", void 0);
|
|
119531
119872
|
var ExecuteImportDto = class {
|
|
119532
119873
|
connectionId;
|
|
@@ -119536,40 +119877,40 @@ var ExecuteImportDto = class {
|
|
|
119536
119877
|
rows;
|
|
119537
119878
|
mode;
|
|
119538
119879
|
};
|
|
119539
|
-
|
|
119540
|
-
(0,
|
|
119541
|
-
|
|
119880
|
+
__decorate48([
|
|
119881
|
+
(0, import_class_validator18.IsString)(),
|
|
119882
|
+
__metadata36("design:type", String)
|
|
119542
119883
|
], ExecuteImportDto.prototype, "connectionId", void 0);
|
|
119543
|
-
|
|
119544
|
-
(0,
|
|
119545
|
-
|
|
119884
|
+
__decorate48([
|
|
119885
|
+
(0, import_class_validator18.IsString)(),
|
|
119886
|
+
__metadata36("design:type", String)
|
|
119546
119887
|
], ExecuteImportDto.prototype, "schema", void 0);
|
|
119547
|
-
|
|
119548
|
-
(0,
|
|
119549
|
-
|
|
119888
|
+
__decorate48([
|
|
119889
|
+
(0, import_class_validator18.IsString)(),
|
|
119890
|
+
__metadata36("design:type", String)
|
|
119550
119891
|
], ExecuteImportDto.prototype, "table", void 0);
|
|
119551
|
-
|
|
119552
|
-
(0,
|
|
119553
|
-
|
|
119892
|
+
__decorate48([
|
|
119893
|
+
(0, import_class_validator18.IsObject)(),
|
|
119894
|
+
__metadata36("design:type", Object)
|
|
119554
119895
|
], ExecuteImportDto.prototype, "columnMapping", void 0);
|
|
119555
|
-
|
|
119556
|
-
(0,
|
|
119557
|
-
|
|
119896
|
+
__decorate48([
|
|
119897
|
+
(0, import_class_validator18.IsArray)(),
|
|
119898
|
+
__metadata36("design:type", Array)
|
|
119558
119899
|
], ExecuteImportDto.prototype, "rows", void 0);
|
|
119559
|
-
|
|
119560
|
-
(0,
|
|
119561
|
-
(0,
|
|
119562
|
-
|
|
119900
|
+
__decorate48([
|
|
119901
|
+
(0, import_class_validator18.IsEnum)(["insert", "upsert"]),
|
|
119902
|
+
(0, import_class_validator18.IsOptional)(),
|
|
119903
|
+
__metadata36("design:type", String)
|
|
119563
119904
|
], ExecuteImportDto.prototype, "mode", void 0);
|
|
119564
119905
|
|
|
119565
119906
|
// apps/api/dist/import/import.controller.js
|
|
119566
|
-
var
|
|
119907
|
+
var __decorate49 = function(decorators, target, key, desc) {
|
|
119567
119908
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
119568
119909
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
119569
119910
|
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;
|
|
119570
119911
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
119571
119912
|
};
|
|
119572
|
-
var
|
|
119913
|
+
var __metadata37 = function(k, v) {
|
|
119573
119914
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119574
119915
|
};
|
|
119575
119916
|
var __param10 = function(paramIndex, decorator) {
|
|
@@ -119596,31 +119937,31 @@ var ImportController = class ImportController2 {
|
|
|
119596
119937
|
return this.importService.executeImport(body);
|
|
119597
119938
|
}
|
|
119598
119939
|
};
|
|
119599
|
-
|
|
119600
|
-
(0,
|
|
119601
|
-
(0,
|
|
119602
|
-
(0,
|
|
119603
|
-
__param10(0, (0,
|
|
119604
|
-
__param10(1, (0,
|
|
119605
|
-
|
|
119606
|
-
|
|
119607
|
-
|
|
119940
|
+
__decorate49([
|
|
119941
|
+
(0, import_common34.Post)("preview"),
|
|
119942
|
+
(0, import_common34.UseInterceptors)((0, import_platform_express3.FileInterceptor)("file")),
|
|
119943
|
+
(0, import_common34.HttpCode)(import_common34.HttpStatus.OK),
|
|
119944
|
+
__param10(0, (0, import_common34.UploadedFile)()),
|
|
119945
|
+
__param10(1, (0, import_common34.Body)()),
|
|
119946
|
+
__metadata37("design:type", Function),
|
|
119947
|
+
__metadata37("design:paramtypes", [Object, PreviewImportDto]),
|
|
119948
|
+
__metadata37("design:returntype", Promise)
|
|
119608
119949
|
], ImportController.prototype, "previewImport", null);
|
|
119609
|
-
|
|
119610
|
-
(0,
|
|
119611
|
-
(0,
|
|
119612
|
-
__param10(0, (0,
|
|
119613
|
-
|
|
119614
|
-
|
|
119615
|
-
|
|
119950
|
+
__decorate49([
|
|
119951
|
+
(0, import_common34.Post)("execute"),
|
|
119952
|
+
(0, import_common34.HttpCode)(import_common34.HttpStatus.OK),
|
|
119953
|
+
__param10(0, (0, import_common34.Body)()),
|
|
119954
|
+
__metadata37("design:type", Function),
|
|
119955
|
+
__metadata37("design:paramtypes", [ExecuteImportDto]),
|
|
119956
|
+
__metadata37("design:returntype", Promise)
|
|
119616
119957
|
], ImportController.prototype, "executeImport", null);
|
|
119617
|
-
ImportController =
|
|
119618
|
-
(0,
|
|
119619
|
-
|
|
119958
|
+
ImportController = __decorate49([
|
|
119959
|
+
(0, import_common34.Controller)("import"),
|
|
119960
|
+
__metadata37("design:paramtypes", [ImportService])
|
|
119620
119961
|
], ImportController);
|
|
119621
119962
|
|
|
119622
119963
|
// apps/api/dist/import/import.module.js
|
|
119623
|
-
var
|
|
119964
|
+
var __decorate50 = function(decorators, target, key, desc) {
|
|
119624
119965
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
119625
119966
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
119626
119967
|
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;
|
|
@@ -119628,8 +119969,8 @@ var __decorate49 = function(decorators, target, key, desc) {
|
|
|
119628
119969
|
};
|
|
119629
119970
|
var ImportModule = class ImportModule2 {
|
|
119630
119971
|
};
|
|
119631
|
-
ImportModule =
|
|
119632
|
-
(0,
|
|
119972
|
+
ImportModule = __decorate50([
|
|
119973
|
+
(0, import_common35.Module)({
|
|
119633
119974
|
imports: [
|
|
119634
119975
|
ConnectionsModule,
|
|
119635
119976
|
import_platform_express4.MulterModule.register({
|
|
@@ -119646,97 +119987,14 @@ ImportModule = __decorate49([
|
|
|
119646
119987
|
], ImportModule);
|
|
119647
119988
|
|
|
119648
119989
|
// apps/api/dist/servers/servers.module.js
|
|
119649
|
-
var
|
|
119990
|
+
var import_common37 = __toESM(require_common(), 1);
|
|
119650
119991
|
|
|
119651
119992
|
// apps/api/dist/servers/servers.controller.js
|
|
119652
|
-
var
|
|
119993
|
+
var import_common36 = __toESM(require_common(), 1);
|
|
119653
119994
|
import { exec } from "child_process";
|
|
119654
119995
|
import { promisify } from "util";
|
|
119655
119996
|
|
|
119656
119997
|
// apps/api/dist/servers/dto/create-server.dto.js
|
|
119657
|
-
var import_class_validator18 = __toESM(require_cjs(), 1);
|
|
119658
|
-
var __decorate50 = function(decorators, target, key, desc) {
|
|
119659
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
119660
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
119661
|
-
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;
|
|
119662
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
119663
|
-
};
|
|
119664
|
-
var __metadata37 = function(k, v) {
|
|
119665
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119666
|
-
};
|
|
119667
|
-
var CreateServerDto = class {
|
|
119668
|
-
name;
|
|
119669
|
-
engine;
|
|
119670
|
-
connectionType;
|
|
119671
|
-
host;
|
|
119672
|
-
port;
|
|
119673
|
-
username;
|
|
119674
|
-
password;
|
|
119675
|
-
ssl;
|
|
119676
|
-
tags;
|
|
119677
|
-
startCommand;
|
|
119678
|
-
stopCommand;
|
|
119679
|
-
};
|
|
119680
|
-
__decorate50([
|
|
119681
|
-
(0, import_class_validator18.IsString)(),
|
|
119682
|
-
(0, import_class_validator18.IsNotEmpty)({ message: "Server name is required" }),
|
|
119683
|
-
__metadata37("design:type", String)
|
|
119684
|
-
], CreateServerDto.prototype, "name", void 0);
|
|
119685
|
-
__decorate50([
|
|
119686
|
-
(0, import_class_validator18.IsString)(),
|
|
119687
|
-
(0, import_class_validator18.IsIn)([...DATABASE_ENGINES], { message: "Engine must be postgres, mysql, or sqlite" }),
|
|
119688
|
-
__metadata37("design:type", String)
|
|
119689
|
-
], CreateServerDto.prototype, "engine", void 0);
|
|
119690
|
-
__decorate50([
|
|
119691
|
-
(0, import_class_validator18.IsOptional)(),
|
|
119692
|
-
(0, import_class_validator18.IsString)(),
|
|
119693
|
-
(0, import_class_validator18.IsIn)([...CONNECTION_TYPES], { message: "Connection type must be local, docker, or remote" }),
|
|
119694
|
-
__metadata37("design:type", String)
|
|
119695
|
-
], CreateServerDto.prototype, "connectionType", void 0);
|
|
119696
|
-
__decorate50([
|
|
119697
|
-
(0, import_class_validator18.IsString)(),
|
|
119698
|
-
(0, import_class_validator18.IsNotEmpty)({ message: "Host is required" }),
|
|
119699
|
-
__metadata37("design:type", String)
|
|
119700
|
-
], CreateServerDto.prototype, "host", void 0);
|
|
119701
|
-
__decorate50([
|
|
119702
|
-
(0, import_class_validator18.IsNumber)(),
|
|
119703
|
-
(0, import_class_validator18.Min)(1, { message: "Port must be between 1 and 65535" }),
|
|
119704
|
-
(0, import_class_validator18.Max)(65535, { message: "Port must be between 1 and 65535" }),
|
|
119705
|
-
__metadata37("design:type", Number)
|
|
119706
|
-
], CreateServerDto.prototype, "port", void 0);
|
|
119707
|
-
__decorate50([
|
|
119708
|
-
(0, import_class_validator18.IsString)(),
|
|
119709
|
-
(0, import_class_validator18.IsNotEmpty)({ message: "Username is required" }),
|
|
119710
|
-
__metadata37("design:type", String)
|
|
119711
|
-
], CreateServerDto.prototype, "username", void 0);
|
|
119712
|
-
__decorate50([
|
|
119713
|
-
(0, import_class_validator18.IsString)(),
|
|
119714
|
-
(0, import_class_validator18.IsNotEmpty)({ message: "Password is required" }),
|
|
119715
|
-
__metadata37("design:type", String)
|
|
119716
|
-
], CreateServerDto.prototype, "password", void 0);
|
|
119717
|
-
__decorate50([
|
|
119718
|
-
(0, import_class_validator18.IsOptional)(),
|
|
119719
|
-
(0, import_class_validator18.IsBoolean)(),
|
|
119720
|
-
__metadata37("design:type", Boolean)
|
|
119721
|
-
], CreateServerDto.prototype, "ssl", void 0);
|
|
119722
|
-
__decorate50([
|
|
119723
|
-
(0, import_class_validator18.IsOptional)(),
|
|
119724
|
-
(0, import_class_validator18.IsArray)(),
|
|
119725
|
-
(0, import_class_validator18.IsString)({ each: true }),
|
|
119726
|
-
__metadata37("design:type", Array)
|
|
119727
|
-
], CreateServerDto.prototype, "tags", void 0);
|
|
119728
|
-
__decorate50([
|
|
119729
|
-
(0, import_class_validator18.IsOptional)(),
|
|
119730
|
-
(0, import_class_validator18.IsString)(),
|
|
119731
|
-
__metadata37("design:type", String)
|
|
119732
|
-
], CreateServerDto.prototype, "startCommand", void 0);
|
|
119733
|
-
__decorate50([
|
|
119734
|
-
(0, import_class_validator18.IsOptional)(),
|
|
119735
|
-
(0, import_class_validator18.IsString)(),
|
|
119736
|
-
__metadata37("design:type", String)
|
|
119737
|
-
], CreateServerDto.prototype, "stopCommand", void 0);
|
|
119738
|
-
|
|
119739
|
-
// apps/api/dist/servers/dto/update-server.dto.js
|
|
119740
119998
|
var import_class_validator19 = __toESM(require_cjs(), 1);
|
|
119741
119999
|
var __decorate51 = function(decorators, target, key, desc) {
|
|
119742
120000
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -119747,8 +120005,9 @@ var __decorate51 = function(decorators, target, key, desc) {
|
|
|
119747
120005
|
var __metadata38 = function(k, v) {
|
|
119748
120006
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119749
120007
|
};
|
|
119750
|
-
var
|
|
120008
|
+
var CreateServerDto = class {
|
|
119751
120009
|
name;
|
|
120010
|
+
engine;
|
|
119752
120011
|
connectionType;
|
|
119753
120012
|
host;
|
|
119754
120013
|
port;
|
|
@@ -119758,71 +120017,67 @@ var UpdateServerDto = class {
|
|
|
119758
120017
|
tags;
|
|
119759
120018
|
startCommand;
|
|
119760
120019
|
stopCommand;
|
|
119761
|
-
isPublic;
|
|
119762
120020
|
};
|
|
119763
120021
|
__decorate51([
|
|
119764
|
-
(0, import_class_validator19.IsOptional)(),
|
|
119765
120022
|
(0, import_class_validator19.IsString)(),
|
|
119766
|
-
(0, import_class_validator19.IsNotEmpty)({ message: "Server name
|
|
120023
|
+
(0, import_class_validator19.IsNotEmpty)({ message: "Server name is required" }),
|
|
119767
120024
|
__metadata38("design:type", String)
|
|
119768
|
-
],
|
|
120025
|
+
], CreateServerDto.prototype, "name", void 0);
|
|
120026
|
+
__decorate51([
|
|
120027
|
+
(0, import_class_validator19.IsString)(),
|
|
120028
|
+
(0, import_class_validator19.IsIn)([...DATABASE_ENGINES], { message: "Engine must be postgres, mysql, or sqlite" }),
|
|
120029
|
+
__metadata38("design:type", String)
|
|
120030
|
+
], CreateServerDto.prototype, "engine", void 0);
|
|
119769
120031
|
__decorate51([
|
|
119770
120032
|
(0, import_class_validator19.IsOptional)(),
|
|
119771
120033
|
(0, import_class_validator19.IsString)(),
|
|
119772
120034
|
(0, import_class_validator19.IsIn)([...CONNECTION_TYPES], { message: "Connection type must be local, docker, or remote" }),
|
|
119773
120035
|
__metadata38("design:type", String)
|
|
119774
|
-
],
|
|
120036
|
+
], CreateServerDto.prototype, "connectionType", void 0);
|
|
119775
120037
|
__decorate51([
|
|
119776
|
-
(0, import_class_validator19.IsOptional)(),
|
|
119777
120038
|
(0, import_class_validator19.IsString)(),
|
|
119778
|
-
(0, import_class_validator19.IsNotEmpty)({ message: "Host
|
|
120039
|
+
(0, import_class_validator19.IsNotEmpty)({ message: "Host is required" }),
|
|
119779
120040
|
__metadata38("design:type", String)
|
|
119780
|
-
],
|
|
120041
|
+
], CreateServerDto.prototype, "host", void 0);
|
|
119781
120042
|
__decorate51([
|
|
119782
|
-
(0, import_class_validator19.IsOptional)(),
|
|
119783
120043
|
(0, import_class_validator19.IsNumber)(),
|
|
119784
120044
|
(0, import_class_validator19.Min)(1, { message: "Port must be between 1 and 65535" }),
|
|
119785
120045
|
(0, import_class_validator19.Max)(65535, { message: "Port must be between 1 and 65535" }),
|
|
119786
120046
|
__metadata38("design:type", Number)
|
|
119787
|
-
],
|
|
120047
|
+
], CreateServerDto.prototype, "port", void 0);
|
|
119788
120048
|
__decorate51([
|
|
119789
|
-
(0, import_class_validator19.IsOptional)(),
|
|
119790
120049
|
(0, import_class_validator19.IsString)(),
|
|
120050
|
+
(0, import_class_validator19.IsNotEmpty)({ message: "Username is required" }),
|
|
119791
120051
|
__metadata38("design:type", String)
|
|
119792
|
-
],
|
|
120052
|
+
], CreateServerDto.prototype, "username", void 0);
|
|
119793
120053
|
__decorate51([
|
|
119794
|
-
(0, import_class_validator19.IsOptional)(),
|
|
119795
120054
|
(0, import_class_validator19.IsString)(),
|
|
120055
|
+
(0, import_class_validator19.IsNotEmpty)({ message: "Password is required" }),
|
|
119796
120056
|
__metadata38("design:type", String)
|
|
119797
|
-
],
|
|
120057
|
+
], CreateServerDto.prototype, "password", void 0);
|
|
119798
120058
|
__decorate51([
|
|
119799
120059
|
(0, import_class_validator19.IsOptional)(),
|
|
119800
120060
|
(0, import_class_validator19.IsBoolean)(),
|
|
119801
120061
|
__metadata38("design:type", Boolean)
|
|
119802
|
-
],
|
|
120062
|
+
], CreateServerDto.prototype, "ssl", void 0);
|
|
119803
120063
|
__decorate51([
|
|
119804
120064
|
(0, import_class_validator19.IsOptional)(),
|
|
119805
120065
|
(0, import_class_validator19.IsArray)(),
|
|
119806
120066
|
(0, import_class_validator19.IsString)({ each: true }),
|
|
119807
120067
|
__metadata38("design:type", Array)
|
|
119808
|
-
],
|
|
120068
|
+
], CreateServerDto.prototype, "tags", void 0);
|
|
119809
120069
|
__decorate51([
|
|
119810
120070
|
(0, import_class_validator19.IsOptional)(),
|
|
119811
120071
|
(0, import_class_validator19.IsString)(),
|
|
119812
120072
|
__metadata38("design:type", String)
|
|
119813
|
-
],
|
|
120073
|
+
], CreateServerDto.prototype, "startCommand", void 0);
|
|
119814
120074
|
__decorate51([
|
|
119815
120075
|
(0, import_class_validator19.IsOptional)(),
|
|
119816
120076
|
(0, import_class_validator19.IsString)(),
|
|
119817
120077
|
__metadata38("design:type", String)
|
|
119818
|
-
],
|
|
119819
|
-
__decorate51([
|
|
119820
|
-
(0, import_class_validator19.IsOptional)(),
|
|
119821
|
-
(0, import_class_validator19.IsBoolean)(),
|
|
119822
|
-
__metadata38("design:type", Boolean)
|
|
119823
|
-
], UpdateServerDto.prototype, "isPublic", void 0);
|
|
120078
|
+
], CreateServerDto.prototype, "stopCommand", void 0);
|
|
119824
120079
|
|
|
119825
|
-
// apps/api/dist/servers/dto/
|
|
120080
|
+
// apps/api/dist/servers/dto/update-server.dto.js
|
|
119826
120081
|
var import_class_validator20 = __toESM(require_cjs(), 1);
|
|
119827
120082
|
var __decorate52 = function(decorators, target, key, desc) {
|
|
119828
120083
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -119833,36 +120088,82 @@ var __decorate52 = function(decorators, target, key, desc) {
|
|
|
119833
120088
|
var __metadata39 = function(k, v) {
|
|
119834
120089
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119835
120090
|
};
|
|
119836
|
-
var
|
|
119837
|
-
|
|
120091
|
+
var UpdateServerDto = class {
|
|
120092
|
+
name;
|
|
120093
|
+
connectionType;
|
|
120094
|
+
host;
|
|
120095
|
+
port;
|
|
119838
120096
|
username;
|
|
119839
120097
|
password;
|
|
119840
|
-
|
|
120098
|
+
ssl;
|
|
120099
|
+
tags;
|
|
120100
|
+
startCommand;
|
|
120101
|
+
stopCommand;
|
|
120102
|
+
isPublic;
|
|
119841
120103
|
};
|
|
119842
120104
|
__decorate52([
|
|
120105
|
+
(0, import_class_validator20.IsOptional)(),
|
|
119843
120106
|
(0, import_class_validator20.IsString)(),
|
|
119844
|
-
(0, import_class_validator20.IsNotEmpty)({ message: "
|
|
119845
|
-
(0, import_class_validator20.Matches)(IDENTIFIER_PATTERN, { message: IDENTIFIER_MESSAGE }),
|
|
120107
|
+
(0, import_class_validator20.IsNotEmpty)({ message: "Server name cannot be empty" }),
|
|
119846
120108
|
__metadata39("design:type", String)
|
|
119847
|
-
],
|
|
120109
|
+
], UpdateServerDto.prototype, "name", void 0);
|
|
119848
120110
|
__decorate52([
|
|
119849
120111
|
(0, import_class_validator20.IsOptional)(),
|
|
119850
120112
|
(0, import_class_validator20.IsString)(),
|
|
119851
|
-
(0, import_class_validator20.
|
|
120113
|
+
(0, import_class_validator20.IsIn)([...CONNECTION_TYPES], { message: "Connection type must be local, docker, or remote" }),
|
|
119852
120114
|
__metadata39("design:type", String)
|
|
119853
|
-
],
|
|
120115
|
+
], UpdateServerDto.prototype, "connectionType", void 0);
|
|
119854
120116
|
__decorate52([
|
|
119855
120117
|
(0, import_class_validator20.IsOptional)(),
|
|
119856
120118
|
(0, import_class_validator20.IsString)(),
|
|
120119
|
+
(0, import_class_validator20.IsNotEmpty)({ message: "Host cannot be empty" }),
|
|
119857
120120
|
__metadata39("design:type", String)
|
|
119858
|
-
],
|
|
120121
|
+
], UpdateServerDto.prototype, "host", void 0);
|
|
120122
|
+
__decorate52([
|
|
120123
|
+
(0, import_class_validator20.IsOptional)(),
|
|
120124
|
+
(0, import_class_validator20.IsNumber)(),
|
|
120125
|
+
(0, import_class_validator20.Min)(1, { message: "Port must be between 1 and 65535" }),
|
|
120126
|
+
(0, import_class_validator20.Max)(65535, { message: "Port must be between 1 and 65535" }),
|
|
120127
|
+
__metadata39("design:type", Number)
|
|
120128
|
+
], UpdateServerDto.prototype, "port", void 0);
|
|
120129
|
+
__decorate52([
|
|
120130
|
+
(0, import_class_validator20.IsOptional)(),
|
|
120131
|
+
(0, import_class_validator20.IsString)(),
|
|
120132
|
+
__metadata39("design:type", String)
|
|
120133
|
+
], UpdateServerDto.prototype, "username", void 0);
|
|
120134
|
+
__decorate52([
|
|
120135
|
+
(0, import_class_validator20.IsOptional)(),
|
|
120136
|
+
(0, import_class_validator20.IsString)(),
|
|
120137
|
+
__metadata39("design:type", String)
|
|
120138
|
+
], UpdateServerDto.prototype, "password", void 0);
|
|
119859
120139
|
__decorate52([
|
|
119860
120140
|
(0, import_class_validator20.IsOptional)(),
|
|
119861
120141
|
(0, import_class_validator20.IsBoolean)(),
|
|
119862
120142
|
__metadata39("design:type", Boolean)
|
|
119863
|
-
],
|
|
120143
|
+
], UpdateServerDto.prototype, "ssl", void 0);
|
|
120144
|
+
__decorate52([
|
|
120145
|
+
(0, import_class_validator20.IsOptional)(),
|
|
120146
|
+
(0, import_class_validator20.IsArray)(),
|
|
120147
|
+
(0, import_class_validator20.IsString)({ each: true }),
|
|
120148
|
+
__metadata39("design:type", Array)
|
|
120149
|
+
], UpdateServerDto.prototype, "tags", void 0);
|
|
120150
|
+
__decorate52([
|
|
120151
|
+
(0, import_class_validator20.IsOptional)(),
|
|
120152
|
+
(0, import_class_validator20.IsString)(),
|
|
120153
|
+
__metadata39("design:type", String)
|
|
120154
|
+
], UpdateServerDto.prototype, "startCommand", void 0);
|
|
120155
|
+
__decorate52([
|
|
120156
|
+
(0, import_class_validator20.IsOptional)(),
|
|
120157
|
+
(0, import_class_validator20.IsString)(),
|
|
120158
|
+
__metadata39("design:type", String)
|
|
120159
|
+
], UpdateServerDto.prototype, "stopCommand", void 0);
|
|
120160
|
+
__decorate52([
|
|
120161
|
+
(0, import_class_validator20.IsOptional)(),
|
|
120162
|
+
(0, import_class_validator20.IsBoolean)(),
|
|
120163
|
+
__metadata39("design:type", Boolean)
|
|
120164
|
+
], UpdateServerDto.prototype, "isPublic", void 0);
|
|
119864
120165
|
|
|
119865
|
-
// apps/api/dist/servers/dto/
|
|
120166
|
+
// apps/api/dist/servers/dto/create-database.dto.js
|
|
119866
120167
|
var import_class_validator21 = __toESM(require_cjs(), 1);
|
|
119867
120168
|
var __decorate53 = function(decorators, target, key, desc) {
|
|
119868
120169
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -119873,28 +120174,37 @@ var __decorate53 = function(decorators, target, key, desc) {
|
|
|
119873
120174
|
var __metadata40 = function(k, v) {
|
|
119874
120175
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119875
120176
|
};
|
|
119876
|
-
var
|
|
119877
|
-
|
|
119878
|
-
|
|
119879
|
-
|
|
120177
|
+
var CreateDatabaseDto = class {
|
|
120178
|
+
databaseName;
|
|
120179
|
+
username;
|
|
120180
|
+
password;
|
|
120181
|
+
grantSchemaAccess;
|
|
119880
120182
|
};
|
|
119881
120183
|
__decorate53([
|
|
119882
120184
|
(0, import_class_validator21.IsString)(),
|
|
119883
|
-
(0, import_class_validator21.IsNotEmpty)(),
|
|
120185
|
+
(0, import_class_validator21.IsNotEmpty)({ message: "Database name is required" }),
|
|
120186
|
+
(0, import_class_validator21.Matches)(IDENTIFIER_PATTERN, { message: IDENTIFIER_MESSAGE }),
|
|
119884
120187
|
__metadata40("design:type", String)
|
|
119885
|
-
],
|
|
120188
|
+
], CreateDatabaseDto.prototype, "databaseName", void 0);
|
|
119886
120189
|
__decorate53([
|
|
120190
|
+
(0, import_class_validator21.IsOptional)(),
|
|
119887
120191
|
(0, import_class_validator21.IsString)(),
|
|
119888
|
-
(0, import_class_validator21.
|
|
120192
|
+
(0, import_class_validator21.Matches)(IDENTIFIER_PATTERN, { message: IDENTIFIER_MESSAGE }),
|
|
119889
120193
|
__metadata40("design:type", String)
|
|
119890
|
-
],
|
|
120194
|
+
], CreateDatabaseDto.prototype, "username", void 0);
|
|
119891
120195
|
__decorate53([
|
|
120196
|
+
(0, import_class_validator21.IsOptional)(),
|
|
119892
120197
|
(0, import_class_validator21.IsString)(),
|
|
119893
|
-
(0, import_class_validator21.IsNotEmpty)(),
|
|
119894
120198
|
__metadata40("design:type", String)
|
|
119895
|
-
],
|
|
120199
|
+
], CreateDatabaseDto.prototype, "password", void 0);
|
|
120200
|
+
__decorate53([
|
|
120201
|
+
(0, import_class_validator21.IsOptional)(),
|
|
120202
|
+
(0, import_class_validator21.IsBoolean)(),
|
|
120203
|
+
__metadata40("design:type", Boolean)
|
|
120204
|
+
], CreateDatabaseDto.prototype, "grantSchemaAccess", void 0);
|
|
119896
120205
|
|
|
119897
|
-
// apps/api/dist/servers/
|
|
120206
|
+
// apps/api/dist/servers/dto/connection-tag.dto.js
|
|
120207
|
+
var import_class_validator22 = __toESM(require_cjs(), 1);
|
|
119898
120208
|
var __decorate54 = function(decorators, target, key, desc) {
|
|
119899
120209
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
119900
120210
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -119904,6 +120214,37 @@ var __decorate54 = function(decorators, target, key, desc) {
|
|
|
119904
120214
|
var __metadata41 = function(k, v) {
|
|
119905
120215
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
119906
120216
|
};
|
|
120217
|
+
var ConnectionTagDto = class {
|
|
120218
|
+
id;
|
|
120219
|
+
name;
|
|
120220
|
+
color;
|
|
120221
|
+
};
|
|
120222
|
+
__decorate54([
|
|
120223
|
+
(0, import_class_validator22.IsString)(),
|
|
120224
|
+
(0, import_class_validator22.IsNotEmpty)(),
|
|
120225
|
+
__metadata41("design:type", String)
|
|
120226
|
+
], ConnectionTagDto.prototype, "id", void 0);
|
|
120227
|
+
__decorate54([
|
|
120228
|
+
(0, import_class_validator22.IsString)(),
|
|
120229
|
+
(0, import_class_validator22.IsNotEmpty)(),
|
|
120230
|
+
__metadata41("design:type", String)
|
|
120231
|
+
], ConnectionTagDto.prototype, "name", void 0);
|
|
120232
|
+
__decorate54([
|
|
120233
|
+
(0, import_class_validator22.IsString)(),
|
|
120234
|
+
(0, import_class_validator22.IsNotEmpty)(),
|
|
120235
|
+
__metadata41("design:type", String)
|
|
120236
|
+
], ConnectionTagDto.prototype, "color", void 0);
|
|
120237
|
+
|
|
120238
|
+
// apps/api/dist/servers/servers.controller.js
|
|
120239
|
+
var __decorate55 = function(decorators, target, key, desc) {
|
|
120240
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120241
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120242
|
+
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;
|
|
120243
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
120244
|
+
};
|
|
120245
|
+
var __metadata42 = function(k, v) {
|
|
120246
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
120247
|
+
};
|
|
119907
120248
|
var __param11 = function(paramIndex, decorator) {
|
|
119908
120249
|
return function(target, key) {
|
|
119909
120250
|
decorator(target, key, paramIndex);
|
|
@@ -119960,7 +120301,7 @@ var ServersController = class ServersController2 {
|
|
|
119960
120301
|
isAdmin: user?.role === "admin"
|
|
119961
120302
|
};
|
|
119962
120303
|
if (!this.metadataService.serverRepository.canModify(id, userContext)) {
|
|
119963
|
-
throw new
|
|
120304
|
+
throw new import_common36.ForbiddenException("You do not have permission to modify this server");
|
|
119964
120305
|
}
|
|
119965
120306
|
const server = this.metadataService.serverRepository.update(id, input);
|
|
119966
120307
|
if (server) {
|
|
@@ -119983,7 +120324,7 @@ var ServersController = class ServersController2 {
|
|
|
119983
120324
|
};
|
|
119984
120325
|
const server = this.metadataService.serverRepository.findById(id);
|
|
119985
120326
|
if (!this.metadataService.serverRepository.canModify(id, userContext)) {
|
|
119986
|
-
throw new
|
|
120327
|
+
throw new import_common36.ForbiddenException("You do not have permission to delete this server");
|
|
119987
120328
|
}
|
|
119988
120329
|
const linkedDatabases = this.metadataService.connectionRepository.findByServerId(id);
|
|
119989
120330
|
if (linkedDatabases.length > 0) {
|
|
@@ -120415,121 +120756,121 @@ var ServersController = class ServersController2 {
|
|
|
120415
120756
|
return new PostgresConnector(config);
|
|
120416
120757
|
}
|
|
120417
120758
|
};
|
|
120418
|
-
|
|
120419
|
-
(0,
|
|
120420
|
-
__param11(0, (0,
|
|
120759
|
+
__decorate55([
|
|
120760
|
+
(0, import_common36.Get)(),
|
|
120761
|
+
__param11(0, (0, import_common36.Query)("engine")),
|
|
120421
120762
|
__param11(1, CurrentUser()),
|
|
120422
|
-
|
|
120423
|
-
|
|
120424
|
-
|
|
120763
|
+
__metadata42("design:type", Function),
|
|
120764
|
+
__metadata42("design:paramtypes", [String, Object]),
|
|
120765
|
+
__metadata42("design:returntype", Array)
|
|
120425
120766
|
], ServersController.prototype, "getServers", null);
|
|
120426
|
-
|
|
120427
|
-
(0,
|
|
120428
|
-
__param11(0, (0,
|
|
120429
|
-
|
|
120430
|
-
|
|
120431
|
-
|
|
120767
|
+
__decorate55([
|
|
120768
|
+
(0, import_common36.Get)(":id"),
|
|
120769
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120770
|
+
__metadata42("design:type", Function),
|
|
120771
|
+
__metadata42("design:paramtypes", [String]),
|
|
120772
|
+
__metadata42("design:returntype", Object)
|
|
120432
120773
|
], ServersController.prototype, "getServer", null);
|
|
120433
|
-
|
|
120434
|
-
(0,
|
|
120435
|
-
__param11(0, (0,
|
|
120774
|
+
__decorate55([
|
|
120775
|
+
(0, import_common36.Get)(":id/databases"),
|
|
120776
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120436
120777
|
__param11(1, CurrentUser()),
|
|
120437
|
-
|
|
120438
|
-
|
|
120439
|
-
|
|
120778
|
+
__metadata42("design:type", Function),
|
|
120779
|
+
__metadata42("design:paramtypes", [String, Object]),
|
|
120780
|
+
__metadata42("design:returntype", Array)
|
|
120440
120781
|
], ServersController.prototype, "getServerDatabases", null);
|
|
120441
|
-
|
|
120442
|
-
(0,
|
|
120443
|
-
__param11(0, (0,
|
|
120444
|
-
|
|
120445
|
-
|
|
120446
|
-
|
|
120782
|
+
__decorate55([
|
|
120783
|
+
(0, import_common36.Get)(":id/password"),
|
|
120784
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120785
|
+
__metadata42("design:type", Function),
|
|
120786
|
+
__metadata42("design:paramtypes", [String]),
|
|
120787
|
+
__metadata42("design:returntype", Object)
|
|
120447
120788
|
], ServersController.prototype, "getServerPassword", null);
|
|
120448
|
-
|
|
120449
|
-
(0,
|
|
120450
|
-
__param11(0, (0,
|
|
120789
|
+
__decorate55([
|
|
120790
|
+
(0, import_common36.Post)(),
|
|
120791
|
+
__param11(0, (0, import_common36.Body)()),
|
|
120451
120792
|
__param11(1, CurrentUser()),
|
|
120452
|
-
|
|
120453
|
-
|
|
120454
|
-
|
|
120793
|
+
__metadata42("design:type", Function),
|
|
120794
|
+
__metadata42("design:paramtypes", [CreateServerDto, Object]),
|
|
120795
|
+
__metadata42("design:returntype", Object)
|
|
120455
120796
|
], ServersController.prototype, "createServer", null);
|
|
120456
|
-
|
|
120457
|
-
(0,
|
|
120458
|
-
__param11(0, (0,
|
|
120459
|
-
__param11(1, (0,
|
|
120797
|
+
__decorate55([
|
|
120798
|
+
(0, import_common36.Put)(":id"),
|
|
120799
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120800
|
+
__param11(1, (0, import_common36.Body)()),
|
|
120460
120801
|
__param11(2, CurrentUser()),
|
|
120461
|
-
|
|
120462
|
-
|
|
120463
|
-
|
|
120802
|
+
__metadata42("design:type", Function),
|
|
120803
|
+
__metadata42("design:paramtypes", [String, UpdateServerDto, Object]),
|
|
120804
|
+
__metadata42("design:returntype", Object)
|
|
120464
120805
|
], ServersController.prototype, "updateServer", null);
|
|
120465
|
-
|
|
120466
|
-
(0,
|
|
120467
|
-
__param11(0, (0,
|
|
120806
|
+
__decorate55([
|
|
120807
|
+
(0, import_common36.Delete)(":id"),
|
|
120808
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120468
120809
|
__param11(1, CurrentUser()),
|
|
120469
|
-
|
|
120470
|
-
|
|
120471
|
-
|
|
120810
|
+
__metadata42("design:type", Function),
|
|
120811
|
+
__metadata42("design:paramtypes", [String, Object]),
|
|
120812
|
+
__metadata42("design:returntype", Object)
|
|
120472
120813
|
], ServersController.prototype, "deleteServer", null);
|
|
120473
|
-
|
|
120474
|
-
(0,
|
|
120475
|
-
__param11(0, (0,
|
|
120476
|
-
|
|
120477
|
-
|
|
120478
|
-
|
|
120814
|
+
__decorate55([
|
|
120815
|
+
(0, import_common36.Post)(":id/test"),
|
|
120816
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120817
|
+
__metadata42("design:type", Function),
|
|
120818
|
+
__metadata42("design:paramtypes", [String]),
|
|
120819
|
+
__metadata42("design:returntype", Promise)
|
|
120479
120820
|
], ServersController.prototype, "testServerConnection", null);
|
|
120480
|
-
|
|
120481
|
-
(0,
|
|
120482
|
-
__param11(0, (0,
|
|
120483
|
-
__param11(1, (0,
|
|
120484
|
-
|
|
120485
|
-
|
|
120486
|
-
|
|
120821
|
+
__decorate55([
|
|
120822
|
+
(0, import_common36.Post)(":id/create-database"),
|
|
120823
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120824
|
+
__param11(1, (0, import_common36.Body)()),
|
|
120825
|
+
__metadata42("design:type", Function),
|
|
120826
|
+
__metadata42("design:paramtypes", [String, CreateDatabaseDto]),
|
|
120827
|
+
__metadata42("design:returntype", Promise)
|
|
120487
120828
|
], ServersController.prototype, "createDatabase", null);
|
|
120488
|
-
|
|
120489
|
-
(0,
|
|
120490
|
-
__param11(0, (0,
|
|
120491
|
-
|
|
120492
|
-
|
|
120493
|
-
|
|
120829
|
+
__decorate55([
|
|
120830
|
+
(0, import_common36.Get)(":id/list-databases"),
|
|
120831
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120832
|
+
__metadata42("design:type", Function),
|
|
120833
|
+
__metadata42("design:paramtypes", [String]),
|
|
120834
|
+
__metadata42("design:returntype", Promise)
|
|
120494
120835
|
], ServersController.prototype, "listDatabases", null);
|
|
120495
|
-
|
|
120496
|
-
(0,
|
|
120497
|
-
__param11(0, (0,
|
|
120498
|
-
|
|
120499
|
-
|
|
120500
|
-
|
|
120836
|
+
__decorate55([
|
|
120837
|
+
(0, import_common36.Get)(":id/info"),
|
|
120838
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120839
|
+
__metadata42("design:type", Function),
|
|
120840
|
+
__metadata42("design:paramtypes", [String]),
|
|
120841
|
+
__metadata42("design:returntype", Promise)
|
|
120501
120842
|
], ServersController.prototype, "getServerInfo", null);
|
|
120502
|
-
|
|
120503
|
-
(0,
|
|
120504
|
-
__param11(0, (0,
|
|
120505
|
-
__param11(1, (0,
|
|
120506
|
-
|
|
120507
|
-
|
|
120508
|
-
|
|
120843
|
+
__decorate55([
|
|
120844
|
+
(0, import_common36.Delete)(":id/databases/:dbName"),
|
|
120845
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120846
|
+
__param11(1, (0, import_common36.Param)("dbName")),
|
|
120847
|
+
__metadata42("design:type", Function),
|
|
120848
|
+
__metadata42("design:paramtypes", [String, String]),
|
|
120849
|
+
__metadata42("design:returntype", Promise)
|
|
120509
120850
|
], ServersController.prototype, "dropDatabase", null);
|
|
120510
|
-
|
|
120511
|
-
(0,
|
|
120512
|
-
__param11(0, (0,
|
|
120513
|
-
__param11(1, (0,
|
|
120514
|
-
|
|
120515
|
-
|
|
120516
|
-
|
|
120851
|
+
__decorate55([
|
|
120852
|
+
(0, import_common36.Post)(":id/start"),
|
|
120853
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120854
|
+
__param11(1, (0, import_common36.Query)("confirmed")),
|
|
120855
|
+
__metadata42("design:type", Function),
|
|
120856
|
+
__metadata42("design:paramtypes", [String, String]),
|
|
120857
|
+
__metadata42("design:returntype", Promise)
|
|
120517
120858
|
], ServersController.prototype, "startServer", null);
|
|
120518
|
-
|
|
120519
|
-
(0,
|
|
120520
|
-
__param11(0, (0,
|
|
120521
|
-
__param11(1, (0,
|
|
120522
|
-
|
|
120523
|
-
|
|
120524
|
-
|
|
120859
|
+
__decorate55([
|
|
120860
|
+
(0, import_common36.Post)(":id/stop"),
|
|
120861
|
+
__param11(0, (0, import_common36.Param)("id")),
|
|
120862
|
+
__param11(1, (0, import_common36.Query)("confirmed")),
|
|
120863
|
+
__metadata42("design:type", Function),
|
|
120864
|
+
__metadata42("design:paramtypes", [String, String]),
|
|
120865
|
+
__metadata42("design:returntype", Promise)
|
|
120525
120866
|
], ServersController.prototype, "stopServer", null);
|
|
120526
|
-
ServersController =
|
|
120527
|
-
(0,
|
|
120528
|
-
|
|
120867
|
+
ServersController = __decorate55([
|
|
120868
|
+
(0, import_common36.Controller)("servers"),
|
|
120869
|
+
__metadata42("design:paramtypes", [MetadataService])
|
|
120529
120870
|
], ServersController);
|
|
120530
120871
|
|
|
120531
120872
|
// apps/api/dist/servers/servers.module.js
|
|
120532
|
-
var
|
|
120873
|
+
var __decorate56 = function(decorators, target, key, desc) {
|
|
120533
120874
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120534
120875
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120535
120876
|
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;
|
|
@@ -120537,87 +120878,87 @@ var __decorate55 = function(decorators, target, key, desc) {
|
|
|
120537
120878
|
};
|
|
120538
120879
|
var ServersModule = class ServersModule2 {
|
|
120539
120880
|
};
|
|
120540
|
-
ServersModule =
|
|
120541
|
-
(0,
|
|
120881
|
+
ServersModule = __decorate56([
|
|
120882
|
+
(0, import_common37.Module)({
|
|
120542
120883
|
imports: [MetadataModule],
|
|
120543
120884
|
controllers: [ServersController]
|
|
120544
120885
|
})
|
|
120545
120886
|
], ServersModule);
|
|
120546
120887
|
|
|
120547
120888
|
// apps/api/dist/settings/settings.module.js
|
|
120548
|
-
var
|
|
120889
|
+
var import_common39 = __toESM(require_common(), 1);
|
|
120549
120890
|
|
|
120550
120891
|
// apps/api/dist/settings/settings.controller.js
|
|
120551
|
-
var
|
|
120892
|
+
var import_common38 = __toESM(require_common(), 1);
|
|
120552
120893
|
|
|
120553
120894
|
// apps/api/dist/settings/dto/setting.dto.js
|
|
120554
|
-
var
|
|
120555
|
-
var
|
|
120895
|
+
var import_class_validator23 = __toESM(require_cjs(), 1);
|
|
120896
|
+
var __decorate57 = function(decorators, target, key, desc) {
|
|
120556
120897
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120557
120898
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120558
120899
|
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;
|
|
120559
120900
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
120560
120901
|
};
|
|
120561
|
-
var
|
|
120902
|
+
var __metadata43 = function(k, v) {
|
|
120562
120903
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
120563
120904
|
};
|
|
120564
120905
|
var SetSettingDto = class {
|
|
120565
120906
|
value;
|
|
120566
120907
|
};
|
|
120567
|
-
|
|
120568
|
-
(0,
|
|
120569
|
-
|
|
120908
|
+
__decorate57([
|
|
120909
|
+
(0, import_class_validator23.IsNotEmpty)({ message: "Value is required" }),
|
|
120910
|
+
__metadata43("design:type", Object)
|
|
120570
120911
|
], SetSettingDto.prototype, "value", void 0);
|
|
120571
120912
|
|
|
120572
120913
|
// apps/api/dist/settings/dto/tag.dto.js
|
|
120573
|
-
var
|
|
120574
|
-
var
|
|
120914
|
+
var import_class_validator24 = __toESM(require_cjs(), 1);
|
|
120915
|
+
var __decorate58 = function(decorators, target, key, desc) {
|
|
120575
120916
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120576
120917
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120577
120918
|
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;
|
|
120578
120919
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
120579
120920
|
};
|
|
120580
|
-
var
|
|
120921
|
+
var __metadata44 = function(k, v) {
|
|
120581
120922
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
120582
120923
|
};
|
|
120583
120924
|
var CreateTagDto = class {
|
|
120584
120925
|
name;
|
|
120585
120926
|
color;
|
|
120586
120927
|
};
|
|
120587
|
-
|
|
120588
|
-
(0,
|
|
120589
|
-
(0,
|
|
120590
|
-
|
|
120928
|
+
__decorate58([
|
|
120929
|
+
(0, import_class_validator24.IsString)(),
|
|
120930
|
+
(0, import_class_validator24.IsNotEmpty)({ message: "Tag name is required" }),
|
|
120931
|
+
__metadata44("design:type", String)
|
|
120591
120932
|
], CreateTagDto.prototype, "name", void 0);
|
|
120592
|
-
|
|
120593
|
-
(0,
|
|
120594
|
-
(0,
|
|
120595
|
-
|
|
120933
|
+
__decorate58([
|
|
120934
|
+
(0, import_class_validator24.IsString)(),
|
|
120935
|
+
(0, import_class_validator24.IsNotEmpty)({ message: "Tag color is required" }),
|
|
120936
|
+
__metadata44("design:type", String)
|
|
120596
120937
|
], CreateTagDto.prototype, "color", void 0);
|
|
120597
120938
|
var UpdateTagDto = class {
|
|
120598
120939
|
name;
|
|
120599
120940
|
color;
|
|
120600
120941
|
};
|
|
120601
|
-
|
|
120602
|
-
(0,
|
|
120603
|
-
(0,
|
|
120604
|
-
(0,
|
|
120605
|
-
|
|
120942
|
+
__decorate58([
|
|
120943
|
+
(0, import_class_validator24.IsOptional)(),
|
|
120944
|
+
(0, import_class_validator24.IsString)(),
|
|
120945
|
+
(0, import_class_validator24.IsNotEmpty)({ message: "Tag name cannot be empty" }),
|
|
120946
|
+
__metadata44("design:type", String)
|
|
120606
120947
|
], UpdateTagDto.prototype, "name", void 0);
|
|
120607
|
-
|
|
120608
|
-
(0,
|
|
120609
|
-
(0,
|
|
120610
|
-
|
|
120948
|
+
__decorate58([
|
|
120949
|
+
(0, import_class_validator24.IsOptional)(),
|
|
120950
|
+
(0, import_class_validator24.IsString)(),
|
|
120951
|
+
__metadata44("design:type", String)
|
|
120611
120952
|
], UpdateTagDto.prototype, "color", void 0);
|
|
120612
120953
|
|
|
120613
120954
|
// apps/api/dist/settings/settings.controller.js
|
|
120614
|
-
var
|
|
120955
|
+
var __decorate59 = function(decorators, target, key, desc) {
|
|
120615
120956
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120616
120957
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120617
120958
|
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;
|
|
120618
120959
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
120619
120960
|
};
|
|
120620
|
-
var
|
|
120961
|
+
var __metadata45 = function(k, v) {
|
|
120621
120962
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
120622
120963
|
};
|
|
120623
120964
|
var __param12 = function(paramIndex, decorator) {
|
|
@@ -120663,75 +121004,75 @@ var SettingsController = class SettingsController2 {
|
|
|
120663
121004
|
return this.metadataService.userPreferencesRepository.resetTags();
|
|
120664
121005
|
}
|
|
120665
121006
|
};
|
|
120666
|
-
|
|
120667
|
-
(0,
|
|
120668
|
-
|
|
120669
|
-
|
|
120670
|
-
|
|
121007
|
+
__decorate59([
|
|
121008
|
+
(0, import_common38.Get)(),
|
|
121009
|
+
__metadata45("design:type", Function),
|
|
121010
|
+
__metadata45("design:paramtypes", []),
|
|
121011
|
+
__metadata45("design:returntype", Object)
|
|
120671
121012
|
], SettingsController.prototype, "getAllSettings", null);
|
|
120672
|
-
|
|
120673
|
-
(0,
|
|
120674
|
-
__param12(0, (0,
|
|
120675
|
-
|
|
120676
|
-
|
|
120677
|
-
|
|
121013
|
+
__decorate59([
|
|
121014
|
+
(0, import_common38.Get)(":key"),
|
|
121015
|
+
__param12(0, (0, import_common38.Param)("key")),
|
|
121016
|
+
__metadata45("design:type", Function),
|
|
121017
|
+
__metadata45("design:paramtypes", [String]),
|
|
121018
|
+
__metadata45("design:returntype", Object)
|
|
120678
121019
|
], SettingsController.prototype, "getSetting", null);
|
|
120679
|
-
|
|
120680
|
-
(0,
|
|
120681
|
-
__param12(0, (0,
|
|
120682
|
-
__param12(1, (0,
|
|
120683
|
-
|
|
120684
|
-
|
|
120685
|
-
|
|
121020
|
+
__decorate59([
|
|
121021
|
+
(0, import_common38.Put)(":key"),
|
|
121022
|
+
__param12(0, (0, import_common38.Param)("key")),
|
|
121023
|
+
__param12(1, (0, import_common38.Body)()),
|
|
121024
|
+
__metadata45("design:type", Function),
|
|
121025
|
+
__metadata45("design:paramtypes", [String, SetSettingDto]),
|
|
121026
|
+
__metadata45("design:returntype", Object)
|
|
120686
121027
|
], SettingsController.prototype, "setSetting", null);
|
|
120687
|
-
|
|
120688
|
-
(0,
|
|
120689
|
-
__param12(0, (0,
|
|
120690
|
-
|
|
120691
|
-
|
|
120692
|
-
|
|
121028
|
+
__decorate59([
|
|
121029
|
+
(0, import_common38.Delete)(":key"),
|
|
121030
|
+
__param12(0, (0, import_common38.Param)("key")),
|
|
121031
|
+
__metadata45("design:type", Function),
|
|
121032
|
+
__metadata45("design:paramtypes", [String]),
|
|
121033
|
+
__metadata45("design:returntype", Object)
|
|
120693
121034
|
], SettingsController.prototype, "deleteSetting", null);
|
|
120694
|
-
|
|
120695
|
-
(0,
|
|
120696
|
-
|
|
120697
|
-
|
|
120698
|
-
|
|
121035
|
+
__decorate59([
|
|
121036
|
+
(0, import_common38.Get)("tags/all"),
|
|
121037
|
+
__metadata45("design:type", Function),
|
|
121038
|
+
__metadata45("design:paramtypes", []),
|
|
121039
|
+
__metadata45("design:returntype", Array)
|
|
120699
121040
|
], SettingsController.prototype, "getTags", null);
|
|
120700
|
-
|
|
120701
|
-
(0,
|
|
120702
|
-
__param12(0, (0,
|
|
120703
|
-
|
|
120704
|
-
|
|
120705
|
-
|
|
121041
|
+
__decorate59([
|
|
121042
|
+
(0, import_common38.Post)("tags"),
|
|
121043
|
+
__param12(0, (0, import_common38.Body)()),
|
|
121044
|
+
__metadata45("design:type", Function),
|
|
121045
|
+
__metadata45("design:paramtypes", [CreateTagDto]),
|
|
121046
|
+
__metadata45("design:returntype", Object)
|
|
120706
121047
|
], SettingsController.prototype, "createTag", null);
|
|
120707
|
-
|
|
120708
|
-
(0,
|
|
120709
|
-
__param12(0, (0,
|
|
120710
|
-
__param12(1, (0,
|
|
120711
|
-
|
|
120712
|
-
|
|
120713
|
-
|
|
121048
|
+
__decorate59([
|
|
121049
|
+
(0, import_common38.Put)("tags/:id"),
|
|
121050
|
+
__param12(0, (0, import_common38.Param)("id")),
|
|
121051
|
+
__param12(1, (0, import_common38.Body)()),
|
|
121052
|
+
__metadata45("design:type", Function),
|
|
121053
|
+
__metadata45("design:paramtypes", [String, UpdateTagDto]),
|
|
121054
|
+
__metadata45("design:returntype", Object)
|
|
120714
121055
|
], SettingsController.prototype, "updateTag", null);
|
|
120715
|
-
|
|
120716
|
-
(0,
|
|
120717
|
-
__param12(0, (0,
|
|
120718
|
-
|
|
120719
|
-
|
|
120720
|
-
|
|
121056
|
+
__decorate59([
|
|
121057
|
+
(0, import_common38.Delete)("tags/:id"),
|
|
121058
|
+
__param12(0, (0, import_common38.Param)("id")),
|
|
121059
|
+
__metadata45("design:type", Function),
|
|
121060
|
+
__metadata45("design:paramtypes", [String]),
|
|
121061
|
+
__metadata45("design:returntype", Object)
|
|
120721
121062
|
], SettingsController.prototype, "deleteTag", null);
|
|
120722
|
-
|
|
120723
|
-
(0,
|
|
120724
|
-
|
|
120725
|
-
|
|
120726
|
-
|
|
121063
|
+
__decorate59([
|
|
121064
|
+
(0, import_common38.Post)("tags/reset"),
|
|
121065
|
+
__metadata45("design:type", Function),
|
|
121066
|
+
__metadata45("design:paramtypes", []),
|
|
121067
|
+
__metadata45("design:returntype", Array)
|
|
120727
121068
|
], SettingsController.prototype, "resetTags", null);
|
|
120728
|
-
SettingsController =
|
|
120729
|
-
(0,
|
|
120730
|
-
|
|
121069
|
+
SettingsController = __decorate59([
|
|
121070
|
+
(0, import_common38.Controller)("settings"),
|
|
121071
|
+
__metadata45("design:paramtypes", [MetadataService])
|
|
120731
121072
|
], SettingsController);
|
|
120732
121073
|
|
|
120733
121074
|
// apps/api/dist/settings/settings.module.js
|
|
120734
|
-
var
|
|
121075
|
+
var __decorate60 = function(decorators, target, key, desc) {
|
|
120735
121076
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120736
121077
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120737
121078
|
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;
|
|
@@ -120739,25 +121080,25 @@ var __decorate59 = function(decorators, target, key, desc) {
|
|
|
120739
121080
|
};
|
|
120740
121081
|
var SettingsModule = class SettingsModule2 {
|
|
120741
121082
|
};
|
|
120742
|
-
SettingsModule =
|
|
120743
|
-
(0,
|
|
121083
|
+
SettingsModule = __decorate60([
|
|
121084
|
+
(0, import_common39.Module)({
|
|
120744
121085
|
imports: [MetadataModule],
|
|
120745
121086
|
controllers: [SettingsController]
|
|
120746
121087
|
})
|
|
120747
121088
|
], SettingsModule);
|
|
120748
121089
|
|
|
120749
121090
|
// apps/api/dist/preferences/preferences.module.js
|
|
120750
|
-
var
|
|
121091
|
+
var import_common41 = __toESM(require_common(), 1);
|
|
120751
121092
|
|
|
120752
121093
|
// apps/api/dist/preferences/preferences.controller.js
|
|
120753
|
-
var
|
|
120754
|
-
var
|
|
121094
|
+
var import_common40 = __toESM(require_common(), 1);
|
|
121095
|
+
var __decorate61 = function(decorators, target, key, desc) {
|
|
120755
121096
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120756
121097
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120757
121098
|
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;
|
|
120758
121099
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
120759
121100
|
};
|
|
120760
|
-
var
|
|
121101
|
+
var __metadata46 = function(k, v) {
|
|
120761
121102
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
120762
121103
|
};
|
|
120763
121104
|
var __param13 = function(paramIndex, decorator) {
|
|
@@ -120810,45 +121151,45 @@ var PreferencesController = class PreferencesController2 {
|
|
|
120810
121151
|
return { success };
|
|
120811
121152
|
}
|
|
120812
121153
|
};
|
|
120813
|
-
|
|
120814
|
-
(0,
|
|
121154
|
+
__decorate61([
|
|
121155
|
+
(0, import_common40.Get)(),
|
|
120815
121156
|
__param13(0, CurrentUser("id")),
|
|
120816
|
-
|
|
120817
|
-
|
|
120818
|
-
|
|
121157
|
+
__metadata46("design:type", Function),
|
|
121158
|
+
__metadata46("design:paramtypes", [String]),
|
|
121159
|
+
__metadata46("design:returntype", Object)
|
|
120819
121160
|
], PreferencesController.prototype, "getAllPreferences", null);
|
|
120820
|
-
|
|
120821
|
-
(0,
|
|
121161
|
+
__decorate61([
|
|
121162
|
+
(0, import_common40.Get)(":key"),
|
|
120822
121163
|
__param13(0, CurrentUser("id")),
|
|
120823
|
-
__param13(1, (0,
|
|
120824
|
-
|
|
120825
|
-
|
|
120826
|
-
|
|
121164
|
+
__param13(1, (0, import_common40.Param)("key")),
|
|
121165
|
+
__metadata46("design:type", Function),
|
|
121166
|
+
__metadata46("design:paramtypes", [String, String]),
|
|
121167
|
+
__metadata46("design:returntype", Object)
|
|
120827
121168
|
], PreferencesController.prototype, "getPreference", null);
|
|
120828
|
-
|
|
120829
|
-
(0,
|
|
121169
|
+
__decorate61([
|
|
121170
|
+
(0, import_common40.Put)(":key"),
|
|
120830
121171
|
__param13(0, CurrentUser("id")),
|
|
120831
|
-
__param13(1, (0,
|
|
120832
|
-
__param13(2, (0,
|
|
120833
|
-
|
|
120834
|
-
|
|
120835
|
-
|
|
121172
|
+
__param13(1, (0, import_common40.Param)("key")),
|
|
121173
|
+
__param13(2, (0, import_common40.Body)()),
|
|
121174
|
+
__metadata46("design:type", Function),
|
|
121175
|
+
__metadata46("design:paramtypes", [String, String, Object]),
|
|
121176
|
+
__metadata46("design:returntype", Object)
|
|
120836
121177
|
], PreferencesController.prototype, "setPreference", null);
|
|
120837
|
-
|
|
120838
|
-
(0,
|
|
121178
|
+
__decorate61([
|
|
121179
|
+
(0, import_common40.Delete)(":key"),
|
|
120839
121180
|
__param13(0, CurrentUser("id")),
|
|
120840
|
-
__param13(1, (0,
|
|
120841
|
-
|
|
120842
|
-
|
|
120843
|
-
|
|
121181
|
+
__param13(1, (0, import_common40.Param)("key")),
|
|
121182
|
+
__metadata46("design:type", Function),
|
|
121183
|
+
__metadata46("design:paramtypes", [String, String]),
|
|
121184
|
+
__metadata46("design:returntype", Object)
|
|
120844
121185
|
], PreferencesController.prototype, "deletePreference", null);
|
|
120845
|
-
PreferencesController =
|
|
120846
|
-
(0,
|
|
120847
|
-
|
|
121186
|
+
PreferencesController = __decorate61([
|
|
121187
|
+
(0, import_common40.Controller)("preferences"),
|
|
121188
|
+
__metadata46("design:paramtypes", [MetadataService])
|
|
120848
121189
|
], PreferencesController);
|
|
120849
121190
|
|
|
120850
121191
|
// apps/api/dist/preferences/preferences.module.js
|
|
120851
|
-
var
|
|
121192
|
+
var __decorate62 = function(decorators, target, key, desc) {
|
|
120852
121193
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120853
121194
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120854
121195
|
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;
|
|
@@ -120856,33 +121197,33 @@ var __decorate61 = function(decorators, target, key, desc) {
|
|
|
120856
121197
|
};
|
|
120857
121198
|
var PreferencesModule = class PreferencesModule2 {
|
|
120858
121199
|
};
|
|
120859
|
-
PreferencesModule =
|
|
120860
|
-
(0,
|
|
121200
|
+
PreferencesModule = __decorate62([
|
|
121201
|
+
(0, import_common41.Module)({
|
|
120861
121202
|
imports: [MetadataModule],
|
|
120862
121203
|
controllers: [PreferencesController]
|
|
120863
121204
|
})
|
|
120864
121205
|
], PreferencesModule);
|
|
120865
121206
|
|
|
120866
121207
|
// apps/api/dist/auth/auth.module.js
|
|
120867
|
-
var
|
|
121208
|
+
var import_common47 = __toESM(require_common(), 1);
|
|
120868
121209
|
var import_jwt2 = __toESM(require_jwt(), 1);
|
|
120869
121210
|
var import_passport4 = __toESM(require_passport(), 1);
|
|
120870
121211
|
|
|
120871
121212
|
// apps/api/dist/auth/auth.controller.js
|
|
120872
|
-
var
|
|
121213
|
+
var import_common43 = __toESM(require_common(), 1);
|
|
120873
121214
|
|
|
120874
121215
|
// apps/api/dist/auth/auth.service.js
|
|
120875
|
-
var
|
|
121216
|
+
var import_common42 = __toESM(require_common(), 1);
|
|
120876
121217
|
var import_jwt = __toESM(require_jwt(), 1);
|
|
120877
121218
|
var import_bcryptjs = __toESM(require_bcryptjs(), 1);
|
|
120878
121219
|
import { createHash as createHash2 } from "crypto";
|
|
120879
|
-
var
|
|
121220
|
+
var __decorate63 = function(decorators, target, key, desc) {
|
|
120880
121221
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
120881
121222
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
120882
121223
|
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;
|
|
120883
121224
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
120884
121225
|
};
|
|
120885
|
-
var
|
|
121226
|
+
var __metadata47 = function(k, v) {
|
|
120886
121227
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
120887
121228
|
};
|
|
120888
121229
|
var AuthService = class AuthService2 {
|
|
@@ -120898,7 +121239,7 @@ var AuthService = class AuthService2 {
|
|
|
120898
121239
|
async register(dto) {
|
|
120899
121240
|
const existingUser = this.metadataService.userRepository.findByEmail(dto.email);
|
|
120900
121241
|
if (existingUser) {
|
|
120901
|
-
throw new
|
|
121242
|
+
throw new import_common42.ConflictException("Email already registered");
|
|
120902
121243
|
}
|
|
120903
121244
|
const passwordHash = await import_bcryptjs.default.hash(dto.password, this.SALT_ROUNDS);
|
|
120904
121245
|
const isFirstUser = this.metadataService.userRepository.count() === 0;
|
|
@@ -120923,12 +121264,12 @@ var AuthService = class AuthService2 {
|
|
|
120923
121264
|
email: dto.email,
|
|
120924
121265
|
reason: "user_not_found"
|
|
120925
121266
|
});
|
|
120926
|
-
throw new
|
|
121267
|
+
throw new import_common42.UnauthorizedException("Invalid credentials");
|
|
120927
121268
|
}
|
|
120928
121269
|
const isPasswordValid = await import_bcryptjs.default.compare(dto.password, user.passwordHash);
|
|
120929
121270
|
if (!isPasswordValid) {
|
|
120930
121271
|
this.logAuthEvent("login_failed", user.id, { reason: "invalid_password" });
|
|
120931
|
-
throw new
|
|
121272
|
+
throw new import_common42.UnauthorizedException("Invalid credentials");
|
|
120932
121273
|
}
|
|
120933
121274
|
const tokens = await this.generateTokens(user);
|
|
120934
121275
|
this.logAuthEvent("user_logged_in", user.id);
|
|
@@ -120941,15 +121282,15 @@ var AuthService = class AuthService2 {
|
|
|
120941
121282
|
const tokenHash = this.hashToken(refreshToken);
|
|
120942
121283
|
const storedToken = this.metadataService.userRepository.findRefreshToken(tokenHash);
|
|
120943
121284
|
if (!storedToken) {
|
|
120944
|
-
throw new
|
|
121285
|
+
throw new import_common42.UnauthorizedException("Invalid refresh token");
|
|
120945
121286
|
}
|
|
120946
121287
|
if (new Date(storedToken.expiresAt) < /* @__PURE__ */ new Date()) {
|
|
120947
121288
|
this.metadataService.userRepository.deleteRefreshToken(tokenHash);
|
|
120948
|
-
throw new
|
|
121289
|
+
throw new import_common42.UnauthorizedException("Refresh token expired");
|
|
120949
121290
|
}
|
|
120950
121291
|
const user = this.metadataService.userRepository.findById(storedToken.userId);
|
|
120951
121292
|
if (!user) {
|
|
120952
|
-
throw new
|
|
121293
|
+
throw new import_common42.UnauthorizedException("User not found");
|
|
120953
121294
|
}
|
|
120954
121295
|
this.metadataService.userRepository.deleteRefreshToken(tokenHash);
|
|
120955
121296
|
return this.generateTokens(user);
|
|
@@ -121002,14 +121343,14 @@ var AuthService = class AuthService2 {
|
|
|
121002
121343
|
async changePassword(userId, currentPassword, newPassword) {
|
|
121003
121344
|
const user = this.metadataService.userRepository.findById(userId);
|
|
121004
121345
|
if (!user) {
|
|
121005
|
-
throw new
|
|
121346
|
+
throw new import_common42.UnauthorizedException("User not found");
|
|
121006
121347
|
}
|
|
121007
121348
|
const isPasswordValid = await import_bcryptjs.default.compare(currentPassword, user.passwordHash);
|
|
121008
121349
|
if (!isPasswordValid) {
|
|
121009
121350
|
this.logAuthEvent("password_change_failed", userId, {
|
|
121010
121351
|
reason: "invalid_current_password"
|
|
121011
121352
|
});
|
|
121012
|
-
throw new
|
|
121353
|
+
throw new import_common42.BadRequestException("Current password is incorrect");
|
|
121013
121354
|
}
|
|
121014
121355
|
const newPasswordHash = await import_bcryptjs.default.hash(newPassword, this.SALT_ROUNDS);
|
|
121015
121356
|
this.metadataService.userRepository.update(userId, { passwordHash: newPasswordHash });
|
|
@@ -121026,7 +121367,7 @@ var AuthService = class AuthService2 {
|
|
|
121026
121367
|
async updateProfile(userId, updates) {
|
|
121027
121368
|
const user = this.metadataService.userRepository.update(userId, updates);
|
|
121028
121369
|
if (!user) {
|
|
121029
|
-
throw new
|
|
121370
|
+
throw new import_common42.UnauthorizedException("User not found");
|
|
121030
121371
|
}
|
|
121031
121372
|
return this.sanitizeUser(user);
|
|
121032
121373
|
}
|
|
@@ -121075,23 +121416,23 @@ var AuthService = class AuthService2 {
|
|
|
121075
121416
|
return sanitized;
|
|
121076
121417
|
}
|
|
121077
121418
|
};
|
|
121078
|
-
AuthService =
|
|
121079
|
-
(0,
|
|
121080
|
-
|
|
121419
|
+
AuthService = __decorate63([
|
|
121420
|
+
(0, import_common42.Injectable)(),
|
|
121421
|
+
__metadata47("design:paramtypes", [
|
|
121081
121422
|
MetadataService,
|
|
121082
121423
|
import_jwt.JwtService
|
|
121083
121424
|
])
|
|
121084
121425
|
], AuthService);
|
|
121085
121426
|
|
|
121086
121427
|
// apps/api/dist/auth/dto/register.dto.js
|
|
121087
|
-
var
|
|
121088
|
-
var
|
|
121428
|
+
var import_class_validator25 = __toESM(require_cjs(), 1);
|
|
121429
|
+
var __decorate64 = function(decorators, target, key, desc) {
|
|
121089
121430
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121090
121431
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121091
121432
|
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;
|
|
121092
121433
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121093
121434
|
};
|
|
121094
|
-
var
|
|
121435
|
+
var __metadata48 = function(k, v) {
|
|
121095
121436
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121096
121437
|
};
|
|
121097
121438
|
var RegisterDto = class {
|
|
@@ -121099,124 +121440,124 @@ var RegisterDto = class {
|
|
|
121099
121440
|
password;
|
|
121100
121441
|
name;
|
|
121101
121442
|
};
|
|
121102
|
-
|
|
121103
|
-
(0,
|
|
121104
|
-
|
|
121443
|
+
__decorate64([
|
|
121444
|
+
(0, import_class_validator25.IsEmail)({}, { message: "Please provide a valid email address" }),
|
|
121445
|
+
__metadata48("design:type", String)
|
|
121105
121446
|
], RegisterDto.prototype, "email", void 0);
|
|
121106
|
-
|
|
121107
|
-
(0,
|
|
121108
|
-
(0,
|
|
121109
|
-
|
|
121447
|
+
__decorate64([
|
|
121448
|
+
(0, import_class_validator25.IsString)(),
|
|
121449
|
+
(0, import_class_validator25.MinLength)(8, { message: "Password must be at least 8 characters long" }),
|
|
121450
|
+
__metadata48("design:type", String)
|
|
121110
121451
|
], RegisterDto.prototype, "password", void 0);
|
|
121111
|
-
|
|
121112
|
-
(0,
|
|
121113
|
-
(0,
|
|
121114
|
-
|
|
121452
|
+
__decorate64([
|
|
121453
|
+
(0, import_class_validator25.IsOptional)(),
|
|
121454
|
+
(0, import_class_validator25.IsString)(),
|
|
121455
|
+
__metadata48("design:type", String)
|
|
121115
121456
|
], RegisterDto.prototype, "name", void 0);
|
|
121116
121457
|
|
|
121117
121458
|
// apps/api/dist/auth/dto/login.dto.js
|
|
121118
|
-
var
|
|
121119
|
-
var
|
|
121459
|
+
var import_class_validator26 = __toESM(require_cjs(), 1);
|
|
121460
|
+
var __decorate65 = function(decorators, target, key, desc) {
|
|
121120
121461
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121121
121462
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121122
121463
|
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;
|
|
121123
121464
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121124
121465
|
};
|
|
121125
|
-
var
|
|
121466
|
+
var __metadata49 = function(k, v) {
|
|
121126
121467
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121127
121468
|
};
|
|
121128
121469
|
var LoginDto = class {
|
|
121129
121470
|
email;
|
|
121130
121471
|
password;
|
|
121131
121472
|
};
|
|
121132
|
-
|
|
121133
|
-
(0,
|
|
121134
|
-
|
|
121473
|
+
__decorate65([
|
|
121474
|
+
(0, import_class_validator26.IsEmail)({}, { message: "Please provide a valid email address" }),
|
|
121475
|
+
__metadata49("design:type", String)
|
|
121135
121476
|
], LoginDto.prototype, "email", void 0);
|
|
121136
|
-
|
|
121137
|
-
(0,
|
|
121138
|
-
|
|
121477
|
+
__decorate65([
|
|
121478
|
+
(0, import_class_validator26.IsString)(),
|
|
121479
|
+
__metadata49("design:type", String)
|
|
121139
121480
|
], LoginDto.prototype, "password", void 0);
|
|
121140
121481
|
|
|
121141
121482
|
// apps/api/dist/auth/dto/refresh-token.dto.js
|
|
121142
|
-
var
|
|
121143
|
-
var
|
|
121483
|
+
var import_class_validator27 = __toESM(require_cjs(), 1);
|
|
121484
|
+
var __decorate66 = function(decorators, target, key, desc) {
|
|
121144
121485
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121145
121486
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121146
121487
|
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;
|
|
121147
121488
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121148
121489
|
};
|
|
121149
|
-
var
|
|
121490
|
+
var __metadata50 = function(k, v) {
|
|
121150
121491
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121151
121492
|
};
|
|
121152
121493
|
var RefreshTokenDto = class {
|
|
121153
121494
|
refreshToken;
|
|
121154
121495
|
};
|
|
121155
|
-
|
|
121156
|
-
(0,
|
|
121157
|
-
|
|
121496
|
+
__decorate66([
|
|
121497
|
+
(0, import_class_validator27.IsString)(),
|
|
121498
|
+
__metadata50("design:type", String)
|
|
121158
121499
|
], RefreshTokenDto.prototype, "refreshToken", void 0);
|
|
121159
121500
|
|
|
121160
121501
|
// apps/api/dist/auth/dto/create-api-key.dto.js
|
|
121161
|
-
var
|
|
121162
|
-
var
|
|
121502
|
+
var import_class_validator28 = __toESM(require_cjs(), 1);
|
|
121503
|
+
var __decorate67 = function(decorators, target, key, desc) {
|
|
121163
121504
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121164
121505
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121165
121506
|
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;
|
|
121166
121507
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121167
121508
|
};
|
|
121168
|
-
var
|
|
121509
|
+
var __metadata51 = function(k, v) {
|
|
121169
121510
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121170
121511
|
};
|
|
121171
121512
|
var CreateApiKeyDto = class {
|
|
121172
121513
|
name;
|
|
121173
121514
|
expiresAt;
|
|
121174
121515
|
};
|
|
121175
|
-
|
|
121176
|
-
(0,
|
|
121177
|
-
(0,
|
|
121178
|
-
(0,
|
|
121179
|
-
|
|
121516
|
+
__decorate67([
|
|
121517
|
+
(0, import_class_validator28.IsString)(),
|
|
121518
|
+
(0, import_class_validator28.MinLength)(1),
|
|
121519
|
+
(0, import_class_validator28.MaxLength)(100),
|
|
121520
|
+
__metadata51("design:type", String)
|
|
121180
121521
|
], CreateApiKeyDto.prototype, "name", void 0);
|
|
121181
|
-
|
|
121182
|
-
(0,
|
|
121183
|
-
(0,
|
|
121184
|
-
|
|
121522
|
+
__decorate67([
|
|
121523
|
+
(0, import_class_validator28.IsOptional)(),
|
|
121524
|
+
(0, import_class_validator28.IsDateString)(),
|
|
121525
|
+
__metadata51("design:type", String)
|
|
121185
121526
|
], CreateApiKeyDto.prototype, "expiresAt", void 0);
|
|
121186
121527
|
|
|
121187
121528
|
// apps/api/dist/auth/dto/change-password.dto.js
|
|
121188
|
-
var
|
|
121189
|
-
var
|
|
121529
|
+
var import_class_validator29 = __toESM(require_cjs(), 1);
|
|
121530
|
+
var __decorate68 = function(decorators, target, key, desc) {
|
|
121190
121531
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121191
121532
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121192
121533
|
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;
|
|
121193
121534
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121194
121535
|
};
|
|
121195
|
-
var
|
|
121536
|
+
var __metadata52 = function(k, v) {
|
|
121196
121537
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121197
121538
|
};
|
|
121198
121539
|
var ChangePasswordDto = class {
|
|
121199
121540
|
currentPassword;
|
|
121200
121541
|
newPassword;
|
|
121201
121542
|
};
|
|
121202
|
-
|
|
121203
|
-
(0,
|
|
121204
|
-
|
|
121543
|
+
__decorate68([
|
|
121544
|
+
(0, import_class_validator29.IsString)(),
|
|
121545
|
+
__metadata52("design:type", String)
|
|
121205
121546
|
], ChangePasswordDto.prototype, "currentPassword", void 0);
|
|
121206
|
-
|
|
121207
|
-
(0,
|
|
121208
|
-
(0,
|
|
121209
|
-
|
|
121547
|
+
__decorate68([
|
|
121548
|
+
(0, import_class_validator29.IsString)(),
|
|
121549
|
+
(0, import_class_validator29.MinLength)(8, { message: "New password must be at least 8 characters long" }),
|
|
121550
|
+
__metadata52("design:type", String)
|
|
121210
121551
|
], ChangePasswordDto.prototype, "newPassword", void 0);
|
|
121211
121552
|
|
|
121212
121553
|
// apps/api/dist/auth/auth.controller.js
|
|
121213
|
-
var
|
|
121554
|
+
var __decorate69 = function(decorators, target, key, desc) {
|
|
121214
121555
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121215
121556
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121216
121557
|
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;
|
|
121217
121558
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121218
121559
|
};
|
|
121219
|
-
var
|
|
121560
|
+
var __metadata53 = function(k, v) {
|
|
121220
121561
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121221
121562
|
};
|
|
121222
121563
|
var __param14 = function(paramIndex, decorator) {
|
|
@@ -121284,129 +121625,129 @@ var AuthController = class AuthController2 {
|
|
|
121284
121625
|
};
|
|
121285
121626
|
}
|
|
121286
121627
|
};
|
|
121287
|
-
|
|
121628
|
+
__decorate69([
|
|
121288
121629
|
Public(),
|
|
121289
|
-
(0,
|
|
121290
|
-
__param14(0, (0,
|
|
121291
|
-
|
|
121292
|
-
|
|
121293
|
-
|
|
121630
|
+
(0, import_common43.Post)("register"),
|
|
121631
|
+
__param14(0, (0, import_common43.Body)()),
|
|
121632
|
+
__metadata53("design:type", Function),
|
|
121633
|
+
__metadata53("design:paramtypes", [RegisterDto]),
|
|
121634
|
+
__metadata53("design:returntype", Promise)
|
|
121294
121635
|
], AuthController.prototype, "register", null);
|
|
121295
|
-
|
|
121636
|
+
__decorate69([
|
|
121296
121637
|
Public(),
|
|
121297
|
-
(0,
|
|
121298
|
-
(0,
|
|
121299
|
-
__param14(0, (0,
|
|
121300
|
-
|
|
121301
|
-
|
|
121302
|
-
|
|
121638
|
+
(0, import_common43.Post)("login"),
|
|
121639
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121640
|
+
__param14(0, (0, import_common43.Body)()),
|
|
121641
|
+
__metadata53("design:type", Function),
|
|
121642
|
+
__metadata53("design:paramtypes", [LoginDto]),
|
|
121643
|
+
__metadata53("design:returntype", Promise)
|
|
121303
121644
|
], AuthController.prototype, "login", null);
|
|
121304
|
-
|
|
121645
|
+
__decorate69([
|
|
121305
121646
|
Public(),
|
|
121306
|
-
(0,
|
|
121307
|
-
(0,
|
|
121308
|
-
__param14(0, (0,
|
|
121309
|
-
|
|
121310
|
-
|
|
121311
|
-
|
|
121647
|
+
(0, import_common43.Post)("refresh"),
|
|
121648
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121649
|
+
__param14(0, (0, import_common43.Body)()),
|
|
121650
|
+
__metadata53("design:type", Function),
|
|
121651
|
+
__metadata53("design:paramtypes", [RefreshTokenDto]),
|
|
121652
|
+
__metadata53("design:returntype", Promise)
|
|
121312
121653
|
], AuthController.prototype, "refreshTokens", null);
|
|
121313
|
-
|
|
121314
|
-
(0,
|
|
121315
|
-
(0,
|
|
121316
|
-
__param14(0, (0,
|
|
121317
|
-
|
|
121318
|
-
|
|
121319
|
-
|
|
121654
|
+
__decorate69([
|
|
121655
|
+
(0, import_common43.Post)("logout"),
|
|
121656
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121657
|
+
__param14(0, (0, import_common43.Body)()),
|
|
121658
|
+
__metadata53("design:type", Function),
|
|
121659
|
+
__metadata53("design:paramtypes", [RefreshTokenDto]),
|
|
121660
|
+
__metadata53("design:returntype", Promise)
|
|
121320
121661
|
], AuthController.prototype, "logout", null);
|
|
121321
|
-
|
|
121322
|
-
(0,
|
|
121323
|
-
(0,
|
|
121662
|
+
__decorate69([
|
|
121663
|
+
(0, import_common43.Post)("logout-all"),
|
|
121664
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121324
121665
|
__param14(0, CurrentUser("id")),
|
|
121325
|
-
|
|
121326
|
-
|
|
121327
|
-
|
|
121666
|
+
__metadata53("design:type", Function),
|
|
121667
|
+
__metadata53("design:paramtypes", [String]),
|
|
121668
|
+
__metadata53("design:returntype", Promise)
|
|
121328
121669
|
], AuthController.prototype, "logoutAll", null);
|
|
121329
|
-
|
|
121330
|
-
(0,
|
|
121670
|
+
__decorate69([
|
|
121671
|
+
(0, import_common43.Get)("me"),
|
|
121331
121672
|
__param14(0, CurrentUser()),
|
|
121332
|
-
|
|
121333
|
-
|
|
121334
|
-
|
|
121673
|
+
__metadata53("design:type", Function),
|
|
121674
|
+
__metadata53("design:paramtypes", [Object]),
|
|
121675
|
+
__metadata53("design:returntype", Object)
|
|
121335
121676
|
], AuthController.prototype, "getMe", null);
|
|
121336
|
-
|
|
121337
|
-
(0,
|
|
121338
|
-
(0,
|
|
121677
|
+
__decorate69([
|
|
121678
|
+
(0, import_common43.Post)("change-password"),
|
|
121679
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121339
121680
|
__param14(0, CurrentUser("id")),
|
|
121340
|
-
__param14(1, (0,
|
|
121341
|
-
|
|
121342
|
-
|
|
121343
|
-
|
|
121681
|
+
__param14(1, (0, import_common43.Body)()),
|
|
121682
|
+
__metadata53("design:type", Function),
|
|
121683
|
+
__metadata53("design:paramtypes", [String, ChangePasswordDto]),
|
|
121684
|
+
__metadata53("design:returntype", Promise)
|
|
121344
121685
|
], AuthController.prototype, "changePassword", null);
|
|
121345
|
-
|
|
121346
|
-
(0,
|
|
121347
|
-
(0,
|
|
121686
|
+
__decorate69([
|
|
121687
|
+
(0, import_common43.Post)("verify-password"),
|
|
121688
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121348
121689
|
__param14(0, CurrentUser("id")),
|
|
121349
|
-
__param14(1, (0,
|
|
121350
|
-
|
|
121351
|
-
|
|
121352
|
-
|
|
121690
|
+
__param14(1, (0, import_common43.Body)()),
|
|
121691
|
+
__metadata53("design:type", Function),
|
|
121692
|
+
__metadata53("design:paramtypes", [String, Object]),
|
|
121693
|
+
__metadata53("design:returntype", Promise)
|
|
121353
121694
|
], AuthController.prototype, "verifyPassword", null);
|
|
121354
|
-
|
|
121355
|
-
(0,
|
|
121356
|
-
(0,
|
|
121695
|
+
__decorate69([
|
|
121696
|
+
(0, import_common43.Post)("update-profile"),
|
|
121697
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121357
121698
|
__param14(0, CurrentUser("id")),
|
|
121358
|
-
__param14(1, (0,
|
|
121359
|
-
|
|
121360
|
-
|
|
121361
|
-
|
|
121699
|
+
__param14(1, (0, import_common43.Body)()),
|
|
121700
|
+
__metadata53("design:type", Function),
|
|
121701
|
+
__metadata53("design:paramtypes", [String, Object]),
|
|
121702
|
+
__metadata53("design:returntype", Promise)
|
|
121362
121703
|
], AuthController.prototype, "updateProfile", null);
|
|
121363
|
-
|
|
121704
|
+
__decorate69([
|
|
121364
121705
|
Public(),
|
|
121365
|
-
(0,
|
|
121366
|
-
|
|
121367
|
-
|
|
121368
|
-
|
|
121706
|
+
(0, import_common43.Get)("status"),
|
|
121707
|
+
__metadata53("design:type", Function),
|
|
121708
|
+
__metadata53("design:paramtypes", []),
|
|
121709
|
+
__metadata53("design:returntype", Object)
|
|
121369
121710
|
], AuthController.prototype, "getAuthStatus", null);
|
|
121370
|
-
|
|
121371
|
-
(0,
|
|
121711
|
+
__decorate69([
|
|
121712
|
+
(0, import_common43.Post)("api-keys"),
|
|
121372
121713
|
__param14(0, CurrentUser("id")),
|
|
121373
|
-
__param14(1, (0,
|
|
121374
|
-
|
|
121375
|
-
|
|
121376
|
-
|
|
121714
|
+
__param14(1, (0, import_common43.Body)()),
|
|
121715
|
+
__metadata53("design:type", Function),
|
|
121716
|
+
__metadata53("design:paramtypes", [String, CreateApiKeyDto]),
|
|
121717
|
+
__metadata53("design:returntype", Promise)
|
|
121377
121718
|
], AuthController.prototype, "createApiKey", null);
|
|
121378
|
-
|
|
121379
|
-
(0,
|
|
121719
|
+
__decorate69([
|
|
121720
|
+
(0, import_common43.Get)("api-keys"),
|
|
121380
121721
|
__param14(0, CurrentUser("id")),
|
|
121381
|
-
|
|
121382
|
-
|
|
121383
|
-
|
|
121722
|
+
__metadata53("design:type", Function),
|
|
121723
|
+
__metadata53("design:paramtypes", [String]),
|
|
121724
|
+
__metadata53("design:returntype", Promise)
|
|
121384
121725
|
], AuthController.prototype, "getApiKeys", null);
|
|
121385
|
-
|
|
121386
|
-
(0,
|
|
121387
|
-
(0,
|
|
121726
|
+
__decorate69([
|
|
121727
|
+
(0, import_common43.Delete)("api-keys/:id"),
|
|
121728
|
+
(0, import_common43.HttpCode)(import_common43.HttpStatus.OK),
|
|
121388
121729
|
__param14(0, CurrentUser("id")),
|
|
121389
|
-
__param14(1, (0,
|
|
121390
|
-
|
|
121391
|
-
|
|
121392
|
-
|
|
121730
|
+
__param14(1, (0, import_common43.Param)("id")),
|
|
121731
|
+
__metadata53("design:type", Function),
|
|
121732
|
+
__metadata53("design:paramtypes", [String, String]),
|
|
121733
|
+
__metadata53("design:returntype", Promise)
|
|
121393
121734
|
], AuthController.prototype, "deleteApiKey", null);
|
|
121394
|
-
AuthController =
|
|
121395
|
-
(0,
|
|
121396
|
-
|
|
121735
|
+
AuthController = __decorate69([
|
|
121736
|
+
(0, import_common43.Controller)("auth"),
|
|
121737
|
+
__metadata53("design:paramtypes", [AuthService])
|
|
121397
121738
|
], AuthController);
|
|
121398
121739
|
|
|
121399
121740
|
// apps/api/dist/auth/strategies/jwt.strategy.js
|
|
121400
|
-
var
|
|
121741
|
+
var import_common44 = __toESM(require_common(), 1);
|
|
121401
121742
|
var import_passport = __toESM(require_passport(), 1);
|
|
121402
121743
|
var import_passport_jwt = __toESM(require_lib13(), 1);
|
|
121403
|
-
var
|
|
121744
|
+
var __decorate70 = function(decorators, target, key, desc) {
|
|
121404
121745
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121405
121746
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121406
121747
|
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;
|
|
121407
121748
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121408
121749
|
};
|
|
121409
|
-
var
|
|
121750
|
+
var __metadata54 = function(k, v) {
|
|
121410
121751
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121411
121752
|
};
|
|
121412
121753
|
var JwtStrategy = class JwtStrategy2 extends (0, import_passport.PassportStrategy)(import_passport_jwt.Strategy) {
|
|
@@ -121422,28 +121763,28 @@ var JwtStrategy = class JwtStrategy2 extends (0, import_passport.PassportStrateg
|
|
|
121422
121763
|
async validate(payload) {
|
|
121423
121764
|
const user = this.metadataService.userRepository.findById(payload.sub);
|
|
121424
121765
|
if (!user) {
|
|
121425
|
-
throw new
|
|
121766
|
+
throw new import_common44.UnauthorizedException("User not found");
|
|
121426
121767
|
}
|
|
121427
121768
|
return user;
|
|
121428
121769
|
}
|
|
121429
121770
|
};
|
|
121430
|
-
JwtStrategy =
|
|
121431
|
-
(0,
|
|
121432
|
-
|
|
121771
|
+
JwtStrategy = __decorate70([
|
|
121772
|
+
(0, import_common44.Injectable)(),
|
|
121773
|
+
__metadata54("design:paramtypes", [MetadataService])
|
|
121433
121774
|
], JwtStrategy);
|
|
121434
121775
|
|
|
121435
121776
|
// apps/api/dist/auth/strategies/api-key.strategy.js
|
|
121436
|
-
var
|
|
121777
|
+
var import_common45 = __toESM(require_common(), 1);
|
|
121437
121778
|
var import_passport2 = __toESM(require_passport(), 1);
|
|
121438
121779
|
var import_passport_custom = __toESM(require_lib14(), 1);
|
|
121439
121780
|
import { createHash as createHash3 } from "crypto";
|
|
121440
|
-
var
|
|
121781
|
+
var __decorate71 = function(decorators, target, key, desc) {
|
|
121441
121782
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121442
121783
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121443
121784
|
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;
|
|
121444
121785
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121445
121786
|
};
|
|
121446
|
-
var
|
|
121787
|
+
var __metadata55 = function(k, v) {
|
|
121447
121788
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121448
121789
|
};
|
|
121449
121790
|
var ApiKeyStrategy = class ApiKeyStrategy2 extends (0, import_passport2.PassportStrategy)(import_passport_custom.Strategy, "api-key") {
|
|
@@ -121455,19 +121796,19 @@ var ApiKeyStrategy = class ApiKeyStrategy2 extends (0, import_passport2.Passport
|
|
|
121455
121796
|
async validate(req) {
|
|
121456
121797
|
const apiKey = this.extractApiKey(req);
|
|
121457
121798
|
if (!apiKey) {
|
|
121458
|
-
throw new
|
|
121799
|
+
throw new import_common45.UnauthorizedException("API key is required");
|
|
121459
121800
|
}
|
|
121460
121801
|
const keyHash = this.hashKey(apiKey);
|
|
121461
121802
|
const storedKey = this.metadataService.userRepository.findApiKeyByHash(keyHash);
|
|
121462
121803
|
if (!storedKey) {
|
|
121463
|
-
throw new
|
|
121804
|
+
throw new import_common45.UnauthorizedException("Invalid API key");
|
|
121464
121805
|
}
|
|
121465
121806
|
if (storedKey.expiresAt && new Date(storedKey.expiresAt) < /* @__PURE__ */ new Date()) {
|
|
121466
|
-
throw new
|
|
121807
|
+
throw new import_common45.UnauthorizedException("API key has expired");
|
|
121467
121808
|
}
|
|
121468
121809
|
const user = this.metadataService.userRepository.findById(storedKey.userId);
|
|
121469
121810
|
if (!user) {
|
|
121470
|
-
throw new
|
|
121811
|
+
throw new import_common45.UnauthorizedException("User not found");
|
|
121471
121812
|
}
|
|
121472
121813
|
this.metadataService.userRepository.updateApiKeyLastUsed(storedKey.id);
|
|
121473
121814
|
return user;
|
|
@@ -121490,22 +121831,22 @@ var ApiKeyStrategy = class ApiKeyStrategy2 extends (0, import_passport2.Passport
|
|
|
121490
121831
|
return createHash3("sha256").update(key).digest("hex");
|
|
121491
121832
|
}
|
|
121492
121833
|
};
|
|
121493
|
-
ApiKeyStrategy =
|
|
121494
|
-
(0,
|
|
121495
|
-
|
|
121834
|
+
ApiKeyStrategy = __decorate71([
|
|
121835
|
+
(0, import_common45.Injectable)(),
|
|
121836
|
+
__metadata55("design:paramtypes", [MetadataService])
|
|
121496
121837
|
], ApiKeyStrategy);
|
|
121497
121838
|
|
|
121498
121839
|
// apps/api/dist/auth/guards/combined-auth.guard.js
|
|
121499
|
-
var
|
|
121840
|
+
var import_common46 = __toESM(require_common(), 1);
|
|
121500
121841
|
var import_core = __toESM(require_core3(), 1);
|
|
121501
121842
|
var import_passport3 = __toESM(require_passport(), 1);
|
|
121502
|
-
var
|
|
121843
|
+
var __decorate72 = function(decorators, target, key, desc) {
|
|
121503
121844
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121504
121845
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121505
121846
|
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;
|
|
121506
121847
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121507
121848
|
};
|
|
121508
|
-
var
|
|
121849
|
+
var __metadata56 = function(k, v) {
|
|
121509
121850
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121510
121851
|
};
|
|
121511
121852
|
var CombinedAuthGuard = class CombinedAuthGuard2 extends (0, import_passport3.AuthGuard)(["jwt", "api-key"]) {
|
|
@@ -121537,7 +121878,7 @@ var CombinedAuthGuard = class CombinedAuthGuard2 extends (0, import_passport3.Au
|
|
|
121537
121878
|
if (authHeader?.startsWith("Bearer ")) {
|
|
121538
121879
|
return this.activateJwt(context);
|
|
121539
121880
|
}
|
|
121540
|
-
throw new
|
|
121881
|
+
throw new import_common46.UnauthorizedException("Authentication required");
|
|
121541
121882
|
}
|
|
121542
121883
|
async activateJwt(context) {
|
|
121543
121884
|
const jwtGuard = new ((0, import_passport3.AuthGuard)("jwt"))();
|
|
@@ -121545,7 +121886,7 @@ var CombinedAuthGuard = class CombinedAuthGuard2 extends (0, import_passport3.Au
|
|
|
121545
121886
|
await jwtGuard.canActivate(context);
|
|
121546
121887
|
return true;
|
|
121547
121888
|
} catch {
|
|
121548
|
-
throw new
|
|
121889
|
+
throw new import_common46.UnauthorizedException("Invalid or expired token");
|
|
121549
121890
|
}
|
|
121550
121891
|
}
|
|
121551
121892
|
async activateApiKey(context) {
|
|
@@ -121554,26 +121895,26 @@ var CombinedAuthGuard = class CombinedAuthGuard2 extends (0, import_passport3.Au
|
|
|
121554
121895
|
await apiKeyGuard.canActivate(context);
|
|
121555
121896
|
return true;
|
|
121556
121897
|
} catch {
|
|
121557
|
-
throw new
|
|
121898
|
+
throw new import_common46.UnauthorizedException("Invalid API key");
|
|
121558
121899
|
}
|
|
121559
121900
|
}
|
|
121560
121901
|
handleRequest(err, user) {
|
|
121561
121902
|
if (err || !user) {
|
|
121562
|
-
throw err || new
|
|
121903
|
+
throw err || new import_common46.UnauthorizedException();
|
|
121563
121904
|
}
|
|
121564
121905
|
return user;
|
|
121565
121906
|
}
|
|
121566
121907
|
};
|
|
121567
|
-
CombinedAuthGuard =
|
|
121568
|
-
(0,
|
|
121569
|
-
|
|
121908
|
+
CombinedAuthGuard = __decorate72([
|
|
121909
|
+
(0, import_common46.Injectable)(),
|
|
121910
|
+
__metadata56("design:paramtypes", [
|
|
121570
121911
|
import_core.Reflector,
|
|
121571
121912
|
MetadataService
|
|
121572
121913
|
])
|
|
121573
121914
|
], CombinedAuthGuard);
|
|
121574
121915
|
|
|
121575
121916
|
// apps/api/dist/auth/auth.module.js
|
|
121576
|
-
var
|
|
121917
|
+
var __decorate73 = function(decorators, target, key, desc) {
|
|
121577
121918
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121578
121919
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121579
121920
|
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;
|
|
@@ -121581,8 +121922,8 @@ var __decorate72 = function(decorators, target, key, desc) {
|
|
|
121581
121922
|
};
|
|
121582
121923
|
var AuthModule = class AuthModule2 {
|
|
121583
121924
|
};
|
|
121584
|
-
AuthModule =
|
|
121585
|
-
(0,
|
|
121925
|
+
AuthModule = __decorate73([
|
|
121926
|
+
(0, import_common47.Module)({
|
|
121586
121927
|
imports: [
|
|
121587
121928
|
MetadataModule,
|
|
121588
121929
|
import_passport4.PassportModule.register({ defaultStrategy: "jwt" }),
|
|
@@ -121600,16 +121941,16 @@ AuthModule = __decorate72([
|
|
|
121600
121941
|
], AuthModule);
|
|
121601
121942
|
|
|
121602
121943
|
// apps/api/dist/auth/guards/jwt-auth.guard.js
|
|
121603
|
-
var
|
|
121944
|
+
var import_common48 = __toESM(require_common(), 1);
|
|
121604
121945
|
var import_core2 = __toESM(require_core3(), 1);
|
|
121605
121946
|
var import_passport5 = __toESM(require_passport(), 1);
|
|
121606
|
-
var
|
|
121947
|
+
var __decorate74 = function(decorators, target, key, desc) {
|
|
121607
121948
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121608
121949
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121609
121950
|
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;
|
|
121610
121951
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121611
121952
|
};
|
|
121612
|
-
var
|
|
121953
|
+
var __metadata57 = function(k, v) {
|
|
121613
121954
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121614
121955
|
};
|
|
121615
121956
|
var JwtAuthGuard = class JwtAuthGuard2 extends (0, import_passport5.AuthGuard)("jwt") {
|
|
@@ -121629,21 +121970,21 @@ var JwtAuthGuard = class JwtAuthGuard2 extends (0, import_passport5.AuthGuard)("
|
|
|
121629
121970
|
return super.canActivate(context);
|
|
121630
121971
|
}
|
|
121631
121972
|
};
|
|
121632
|
-
JwtAuthGuard =
|
|
121633
|
-
(0,
|
|
121634
|
-
|
|
121973
|
+
JwtAuthGuard = __decorate74([
|
|
121974
|
+
(0, import_common48.Injectable)(),
|
|
121975
|
+
__metadata57("design:paramtypes", [import_core2.Reflector])
|
|
121635
121976
|
], JwtAuthGuard);
|
|
121636
121977
|
|
|
121637
121978
|
// apps/api/dist/auth/guards/roles.guard.js
|
|
121638
|
-
var
|
|
121979
|
+
var import_common49 = __toESM(require_common(), 1);
|
|
121639
121980
|
var import_core3 = __toESM(require_core3(), 1);
|
|
121640
|
-
var
|
|
121981
|
+
var __decorate75 = function(decorators, target, key, desc) {
|
|
121641
121982
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121642
121983
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121643
121984
|
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;
|
|
121644
121985
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121645
121986
|
};
|
|
121646
|
-
var
|
|
121987
|
+
var __metadata58 = function(k, v) {
|
|
121647
121988
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121648
121989
|
};
|
|
121649
121990
|
var RolesGuard = class RolesGuard2 {
|
|
@@ -121667,15 +122008,15 @@ var RolesGuard = class RolesGuard2 {
|
|
|
121667
122008
|
return requiredRoles.includes(user.role);
|
|
121668
122009
|
}
|
|
121669
122010
|
};
|
|
121670
|
-
RolesGuard =
|
|
121671
|
-
(0,
|
|
121672
|
-
|
|
122011
|
+
RolesGuard = __decorate75([
|
|
122012
|
+
(0, import_common49.Injectable)(),
|
|
122013
|
+
__metadata58("design:paramtypes", [import_core3.Reflector])
|
|
121673
122014
|
], RolesGuard);
|
|
121674
122015
|
|
|
121675
122016
|
// apps/api/dist/auth/guards/api-key.guard.js
|
|
121676
|
-
var
|
|
122017
|
+
var import_common50 = __toESM(require_common(), 1);
|
|
121677
122018
|
var import_passport6 = __toESM(require_passport(), 1);
|
|
121678
|
-
var
|
|
122019
|
+
var __decorate76 = function(decorators, target, key, desc) {
|
|
121679
122020
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121680
122021
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121681
122022
|
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;
|
|
@@ -121686,25 +122027,25 @@ var ApiKeyGuard = class ApiKeyGuard2 extends (0, import_passport6.AuthGuard)("ap
|
|
|
121686
122027
|
return super.canActivate(context);
|
|
121687
122028
|
}
|
|
121688
122029
|
};
|
|
121689
|
-
ApiKeyGuard =
|
|
121690
|
-
(0,
|
|
122030
|
+
ApiKeyGuard = __decorate76([
|
|
122031
|
+
(0, import_common50.Injectable)()
|
|
121691
122032
|
], ApiKeyGuard);
|
|
121692
122033
|
|
|
121693
122034
|
// apps/api/dist/users/users.module.js
|
|
121694
|
-
var
|
|
122035
|
+
var import_common53 = __toESM(require_common(), 1);
|
|
121695
122036
|
|
|
121696
122037
|
// apps/api/dist/users/users.controller.js
|
|
121697
|
-
var
|
|
122038
|
+
var import_common52 = __toESM(require_common(), 1);
|
|
121698
122039
|
|
|
121699
122040
|
// apps/api/dist/users/users.service.js
|
|
121700
|
-
var
|
|
121701
|
-
var
|
|
122041
|
+
var import_common51 = __toESM(require_common(), 1);
|
|
122042
|
+
var __decorate77 = function(decorators, target, key, desc) {
|
|
121702
122043
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121703
122044
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121704
122045
|
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;
|
|
121705
122046
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121706
122047
|
};
|
|
121707
|
-
var
|
|
122048
|
+
var __metadata59 = function(k, v) {
|
|
121708
122049
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121709
122050
|
};
|
|
121710
122051
|
var UsersService = class UsersService2 {
|
|
@@ -121723,7 +122064,7 @@ var UsersService = class UsersService2 {
|
|
|
121723
122064
|
updateUserRole(id, role) {
|
|
121724
122065
|
const user = this.metadataService.userRepository.update(id, { role });
|
|
121725
122066
|
if (!user) {
|
|
121726
|
-
throw new
|
|
122067
|
+
throw new import_common51.NotFoundException("User not found");
|
|
121727
122068
|
}
|
|
121728
122069
|
return this.sanitizeUser(user);
|
|
121729
122070
|
}
|
|
@@ -121735,39 +122076,39 @@ var UsersService = class UsersService2 {
|
|
|
121735
122076
|
return sanitized;
|
|
121736
122077
|
}
|
|
121737
122078
|
};
|
|
121738
|
-
UsersService =
|
|
121739
|
-
(0,
|
|
121740
|
-
|
|
122079
|
+
UsersService = __decorate77([
|
|
122080
|
+
(0, import_common51.Injectable)(),
|
|
122081
|
+
__metadata59("design:paramtypes", [MetadataService])
|
|
121741
122082
|
], UsersService);
|
|
121742
122083
|
|
|
121743
122084
|
// apps/api/dist/users/dto/update-user-role.dto.js
|
|
121744
|
-
var
|
|
121745
|
-
var
|
|
122085
|
+
var import_class_validator30 = __toESM(require_cjs(), 1);
|
|
122086
|
+
var __decorate78 = function(decorators, target, key, desc) {
|
|
121746
122087
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121747
122088
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121748
122089
|
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;
|
|
121749
122090
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121750
122091
|
};
|
|
121751
|
-
var
|
|
122092
|
+
var __metadata60 = function(k, v) {
|
|
121752
122093
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121753
122094
|
};
|
|
121754
122095
|
var UpdateUserRoleDto = class {
|
|
121755
122096
|
role;
|
|
121756
122097
|
};
|
|
121757
|
-
|
|
121758
|
-
(0,
|
|
121759
|
-
(0,
|
|
121760
|
-
|
|
122098
|
+
__decorate78([
|
|
122099
|
+
(0, import_class_validator30.IsString)(),
|
|
122100
|
+
(0, import_class_validator30.IsIn)(["admin", "editor", "viewer"], { message: "Role must be admin, editor, or viewer" }),
|
|
122101
|
+
__metadata60("design:type", String)
|
|
121761
122102
|
], UpdateUserRoleDto.prototype, "role", void 0);
|
|
121762
122103
|
|
|
121763
122104
|
// apps/api/dist/users/users.controller.js
|
|
121764
|
-
var
|
|
122105
|
+
var __decorate79 = function(decorators, target, key, desc) {
|
|
121765
122106
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121766
122107
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121767
122108
|
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;
|
|
121768
122109
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
121769
122110
|
};
|
|
121770
|
-
var
|
|
122111
|
+
var __metadata61 = function(k, v) {
|
|
121771
122112
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
121772
122113
|
};
|
|
121773
122114
|
var __param15 = function(paramIndex, decorator) {
|
|
@@ -121788,13 +122129,13 @@ var UsersController = class UsersController2 {
|
|
|
121788
122129
|
}
|
|
121789
122130
|
async updateUserRole(userId, dto, currentUserId) {
|
|
121790
122131
|
if (userId === currentUserId && dto.role !== "admin") {
|
|
121791
|
-
throw new
|
|
122132
|
+
throw new import_common52.ForbiddenException("Cannot demote yourself from admin");
|
|
121792
122133
|
}
|
|
121793
122134
|
return this.usersService.updateUserRole(userId, dto.role);
|
|
121794
122135
|
}
|
|
121795
122136
|
async deleteUser(userId, currentUserId) {
|
|
121796
122137
|
if (userId === currentUserId) {
|
|
121797
|
-
throw new
|
|
122138
|
+
throw new import_common52.ForbiddenException("Cannot delete your own account");
|
|
121798
122139
|
}
|
|
121799
122140
|
const deleted = await this.usersService.deleteUser(userId);
|
|
121800
122141
|
return {
|
|
@@ -121803,48 +122144,48 @@ var UsersController = class UsersController2 {
|
|
|
121803
122144
|
};
|
|
121804
122145
|
}
|
|
121805
122146
|
};
|
|
121806
|
-
|
|
121807
|
-
(0,
|
|
122147
|
+
__decorate79([
|
|
122148
|
+
(0, import_common52.Get)(),
|
|
121808
122149
|
Roles("admin"),
|
|
121809
|
-
|
|
121810
|
-
|
|
121811
|
-
|
|
122150
|
+
__metadata61("design:type", Function),
|
|
122151
|
+
__metadata61("design:paramtypes", []),
|
|
122152
|
+
__metadata61("design:returntype", Promise)
|
|
121812
122153
|
], UsersController.prototype, "getAllUsers", null);
|
|
121813
|
-
|
|
121814
|
-
(0,
|
|
122154
|
+
__decorate79([
|
|
122155
|
+
(0, import_common52.Get)(":id"),
|
|
121815
122156
|
Roles("admin"),
|
|
121816
|
-
__param15(0, (0,
|
|
121817
|
-
|
|
121818
|
-
|
|
121819
|
-
|
|
122157
|
+
__param15(0, (0, import_common52.Param)("id")),
|
|
122158
|
+
__metadata61("design:type", Function),
|
|
122159
|
+
__metadata61("design:paramtypes", [String]),
|
|
122160
|
+
__metadata61("design:returntype", Promise)
|
|
121820
122161
|
], UsersController.prototype, "getUser", null);
|
|
121821
|
-
|
|
121822
|
-
(0,
|
|
122162
|
+
__decorate79([
|
|
122163
|
+
(0, import_common52.Patch)(":id/role"),
|
|
121823
122164
|
Roles("admin"),
|
|
121824
|
-
__param15(0, (0,
|
|
121825
|
-
__param15(1, (0,
|
|
122165
|
+
__param15(0, (0, import_common52.Param)("id")),
|
|
122166
|
+
__param15(1, (0, import_common52.Body)()),
|
|
121826
122167
|
__param15(2, CurrentUser("id")),
|
|
121827
|
-
|
|
121828
|
-
|
|
121829
|
-
|
|
122168
|
+
__metadata61("design:type", Function),
|
|
122169
|
+
__metadata61("design:paramtypes", [String, UpdateUserRoleDto, String]),
|
|
122170
|
+
__metadata61("design:returntype", Promise)
|
|
121830
122171
|
], UsersController.prototype, "updateUserRole", null);
|
|
121831
|
-
|
|
121832
|
-
(0,
|
|
122172
|
+
__decorate79([
|
|
122173
|
+
(0, import_common52.Delete)(":id"),
|
|
121833
122174
|
Roles("admin"),
|
|
121834
|
-
(0,
|
|
121835
|
-
__param15(0, (0,
|
|
122175
|
+
(0, import_common52.HttpCode)(import_common52.HttpStatus.OK),
|
|
122176
|
+
__param15(0, (0, import_common52.Param)("id")),
|
|
121836
122177
|
__param15(1, CurrentUser("id")),
|
|
121837
|
-
|
|
121838
|
-
|
|
121839
|
-
|
|
122178
|
+
__metadata61("design:type", Function),
|
|
122179
|
+
__metadata61("design:paramtypes", [String, String]),
|
|
122180
|
+
__metadata61("design:returntype", Promise)
|
|
121840
122181
|
], UsersController.prototype, "deleteUser", null);
|
|
121841
|
-
UsersController =
|
|
121842
|
-
(0,
|
|
121843
|
-
|
|
122182
|
+
UsersController = __decorate79([
|
|
122183
|
+
(0, import_common52.Controller)("users"),
|
|
122184
|
+
__metadata61("design:paramtypes", [UsersService])
|
|
121844
122185
|
], UsersController);
|
|
121845
122186
|
|
|
121846
122187
|
// apps/api/dist/users/users.module.js
|
|
121847
|
-
var
|
|
122188
|
+
var __decorate80 = function(decorators, target, key, desc) {
|
|
121848
122189
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121849
122190
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121850
122191
|
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;
|
|
@@ -121852,8 +122193,8 @@ var __decorate79 = function(decorators, target, key, desc) {
|
|
|
121852
122193
|
};
|
|
121853
122194
|
var UsersModule = class UsersModule2 {
|
|
121854
122195
|
};
|
|
121855
|
-
UsersModule =
|
|
121856
|
-
(0,
|
|
122196
|
+
UsersModule = __decorate80([
|
|
122197
|
+
(0, import_common53.Module)({
|
|
121857
122198
|
imports: [MetadataModule],
|
|
121858
122199
|
controllers: [UsersController],
|
|
121859
122200
|
providers: [UsersService],
|
|
@@ -121862,7 +122203,7 @@ UsersModule = __decorate79([
|
|
|
121862
122203
|
], UsersModule);
|
|
121863
122204
|
|
|
121864
122205
|
// apps/api/dist/app.module.js
|
|
121865
|
-
var
|
|
122206
|
+
var __decorate81 = function(decorators, target, key, desc) {
|
|
121866
122207
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
121867
122208
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
121868
122209
|
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;
|
|
@@ -121871,8 +122212,8 @@ var __decorate80 = function(decorators, target, key, desc) {
|
|
|
121871
122212
|
var __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|
121872
122213
|
var AppModule = class AppModule2 {
|
|
121873
122214
|
};
|
|
121874
|
-
AppModule =
|
|
121875
|
-
(0,
|
|
122215
|
+
AppModule = __decorate81([
|
|
122216
|
+
(0, import_common54.Module)({
|
|
121876
122217
|
imports: [
|
|
121877
122218
|
// Serve static files from web build in production
|
|
121878
122219
|
...true ? [
|
|
@@ -121918,13 +122259,13 @@ import * as fs6 from "node:fs";
|
|
|
121918
122259
|
var __filename = fileURLToPath2(import.meta.url);
|
|
121919
122260
|
var __dirname2 = path4.dirname(__filename);
|
|
121920
122261
|
async function bootstrap() {
|
|
121921
|
-
const logger = new
|
|
122262
|
+
const logger = new import_common55.Logger("Bootstrap");
|
|
121922
122263
|
const app = await import_core5.NestFactory.create(AppModule, {
|
|
121923
122264
|
bodyParser: true
|
|
121924
122265
|
});
|
|
121925
122266
|
app.useBodyParser("json", { limit: "50mb" });
|
|
121926
122267
|
app.useBodyParser("urlencoded", { limit: "50mb", extended: true });
|
|
121927
|
-
app.useGlobalPipes(new
|
|
122268
|
+
app.useGlobalPipes(new import_common55.ValidationPipe({
|
|
121928
122269
|
whitelist: true,
|
|
121929
122270
|
// Strip properties not in DTO
|
|
121930
122271
|
forbidNonWhitelisted: true,
|