@saasicat/nest 0.7.0 → 0.9.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/admin/index.cjs +262 -7
- package/dist/admin/index.d.cts +6 -4
- package/dist/admin/index.d.ts +6 -4
- package/dist/admin/index.js +12 -4
- package/dist/{admin-manifest.service-Cp6uwvmt.d.cts → admin-manifest.service-BMeSLRW4.d.ts} +1 -1
- package/dist/{admin-manifest.service-UGgzR1x-.d.ts → admin-manifest.service-StAQe6QO.d.cts} +1 -1
- package/dist/admin-resources.module-BybEjZs-.d.cts +40 -0
- package/dist/admin-resources.module-CUCLlUAi.d.ts +40 -0
- package/dist/billing/index.cjs +3 -1
- package/dist/billing/index.d.cts +5 -287
- package/dist/billing/index.d.ts +5 -287
- package/dist/billing/index.js +5 -8
- package/dist/catalog/index.d.cts +4 -101
- package/dist/catalog/index.d.ts +4 -101
- package/dist/catalog/index.js +12 -10
- package/dist/catalog.module-BKObceo0.d.ts +103 -0
- package/dist/catalog.module-Dw2Hrbyu.d.cts +103 -0
- package/dist/{chunk-U6HT27J7.js → chunk-3M6VLT5N.js} +257 -6
- package/dist/chunk-7K5PT2LX.js +211 -0
- package/dist/{chunk-RZU4HIAN.js → chunk-GW2I3JZD.js} +25 -22
- package/dist/{chunk-6LP7CDS2.js → chunk-HXAWPPFW.js} +10 -5
- package/dist/chunk-OFBDEO45.js +755 -0
- package/dist/{chunk-5DDCSGZC.js → chunk-PBQRPDO2.js} +142 -354
- package/dist/{chunk-SD3TT2BR.js → chunk-WGVTXSYW.js} +1 -1
- package/dist/{chunk-A2QBXDJC.js → chunk-ZZMAHX22.js} +343 -16
- package/dist/{enforce-quota.interceptor-Dj1Kusr5.d.ts → enforce-quota.interceptor-B3CL5MSw.d.ts} +94 -12
- package/dist/{enforce-quota.interceptor-cv7r80VM.d.cts → enforce-quota.interceptor-SqrQVF91.d.cts} +94 -12
- package/dist/entitlement/index.cjs +1 -0
- package/dist/entitlement/index.d.cts +3 -1
- package/dist/entitlement/index.d.ts +3 -1
- package/dist/entitlement/index.js +1 -2
- package/dist/index.cjs +3503 -2811
- package/dist/index.d.cts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +75 -61
- package/dist/module-B5m080F0.d.ts +39 -0
- package/dist/module-DeH_Jkcq.d.cts +39 -0
- package/dist/platform/index.cjs +11113 -971
- package/dist/platform/index.d.cts +41 -7
- package/dist/platform/index.d.ts +41 -7
- package/dist/platform/index.js +26 -6
- package/dist/promo/index.cjs +530 -5
- package/dist/promo/index.d.cts +47 -30
- package/dist/promo/index.d.ts +47 -30
- package/dist/promo/index.js +9 -1
- package/dist/{service-DX8KbGXl.d.cts → service-DlhMnYjW.d.cts} +1 -1
- package/dist/{service-DX8KbGXl.d.ts → service-DlhMnYjW.d.ts} +1 -1
- package/dist/subscription-bundles.module-BQmoozm5.d.ts +291 -0
- package/dist/subscription-bundles.module-DCpV-Pb5.d.cts +291 -0
- package/dist/testing/index.cjs +11101 -973
- package/dist/testing/index.d.cts +9 -4
- package/dist/testing/index.d.ts +9 -4
- package/dist/testing/index.js +10 -4
- package/package.json +4 -4
- package/dist/admin-manifest.config-DyrQNT7M.d.cts +0 -10
- package/dist/admin-manifest.config-DyrQNT7M.d.ts +0 -10
- package/dist/chunk-52UTQRD3.js +0 -326
- package/dist/chunk-Q53N43LQ.js +0 -13
- /package/dist/{chunk-2FR6ZL7R.js → chunk-HWGIMNWR.js} +0 -0
|
@@ -5,10 +5,6 @@ import {
|
|
|
5
5
|
classifyBundleVersionDiff,
|
|
6
6
|
classifyPlanDiff
|
|
7
7
|
} from "./chunk-WPUVJRIN.js";
|
|
8
|
-
import {
|
|
9
|
-
DiscoverySnapshotNotFoundError,
|
|
10
|
-
loadDiscoverySnapshotFromFile
|
|
11
|
-
} from "./chunk-ABB2CRAS.js";
|
|
12
8
|
import {
|
|
13
9
|
AdminAuditService
|
|
14
10
|
} from "./chunk-E56W4U2P.js";
|
|
@@ -38,22 +34,6 @@ import {
|
|
|
38
34
|
__name
|
|
39
35
|
} from "./chunk-SHUYVCID.js";
|
|
40
36
|
|
|
41
|
-
// src/catalog/bundles.service.ts
|
|
42
|
-
import { Inject, Injectable, Logger, NotFoundException, Optional, UnprocessableEntityException } from "@nestjs/common";
|
|
43
|
-
import { isVersionEditable } from "@saasicat/types";
|
|
44
|
-
|
|
45
|
-
// src/core/discovery-snapshot-source.ts
|
|
46
|
-
function resolveDiscoverySnapshot(injected, scanner) {
|
|
47
|
-
if (injected) return injected;
|
|
48
|
-
if (scanner) return scanner.getSnapshot();
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
__name(resolveDiscoverySnapshot, "resolveDiscoverySnapshot");
|
|
52
|
-
function hasDiscoverySnapshotSource(injected, scanner) {
|
|
53
|
-
return injected != null || scanner != null;
|
|
54
|
-
}
|
|
55
|
-
__name(hasDiscoverySnapshotSource, "hasDiscoverySnapshotSource");
|
|
56
|
-
|
|
57
37
|
// src/catalog/approved-keys.ts
|
|
58
38
|
async function loadApprovedCatalogKeys(repo, projectKey) {
|
|
59
39
|
if (!repo) return null;
|
|
@@ -207,6 +187,22 @@ function validatePlanDraft(draft, snapshot, marketedOnlyFeatures = /* @__PURE__
|
|
|
207
187
|
}
|
|
208
188
|
__name(validatePlanDraft, "validatePlanDraft");
|
|
209
189
|
|
|
190
|
+
// src/catalog/bundles.service.ts
|
|
191
|
+
import { Inject, Injectable, Logger, NotFoundException, Optional, UnprocessableEntityException } from "@nestjs/common";
|
|
192
|
+
import { isVersionEditable } from "@saasicat/types";
|
|
193
|
+
|
|
194
|
+
// src/core/discovery-snapshot-source.ts
|
|
195
|
+
function resolveDiscoverySnapshot(injected, scanner) {
|
|
196
|
+
if (injected) return injected;
|
|
197
|
+
if (scanner) return scanner.getSnapshot();
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
__name(resolveDiscoverySnapshot, "resolveDiscoverySnapshot");
|
|
201
|
+
function hasDiscoverySnapshotSource(injected, scanner) {
|
|
202
|
+
return injected != null || scanner != null;
|
|
203
|
+
}
|
|
204
|
+
__name(hasDiscoverySnapshotSource, "hasDiscoverySnapshotSource");
|
|
205
|
+
|
|
210
206
|
// src/catalog/bundles.service.ts
|
|
211
207
|
function _ts_decorate(decorators, target, key, desc) {
|
|
212
208
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -744,9 +740,6 @@ MarketingProjectionsService = _ts_decorate2([
|
|
|
744
740
|
])
|
|
745
741
|
], MarketingProjectionsService);
|
|
746
742
|
|
|
747
|
-
// src/catalog/catalog-entries.service.ts
|
|
748
|
-
import { Inject as Inject3, Injectable as Injectable3, Logger as Logger2, NotFoundException as NotFoundException3, Optional as Optional2, UnprocessableEntityException as UnprocessableEntityException2 } from "@nestjs/common";
|
|
749
|
-
|
|
750
743
|
// src/catalog/approval-signature.ts
|
|
751
744
|
function featureApprovalSignature(featureKey, snapshot) {
|
|
752
745
|
return snapshot.capabilities.filter((c) => c.feature === featureKey && c.status !== "internal").map((c) => `${c.capabilityKey}@${c.status}` + keyListSegment("requires", c.requires) + keyListSegment("replaces", c.replaces)).sort().join("|");
|
|
@@ -770,6 +763,7 @@ function keyListSegment(name, keys) {
|
|
|
770
763
|
__name(keyListSegment, "keyListSegment");
|
|
771
764
|
|
|
772
765
|
// src/catalog/catalog-entries.service.ts
|
|
766
|
+
import { Inject as Inject3, Injectable as Injectable3, Logger as Logger2, NotFoundException as NotFoundException3, Optional as Optional2, UnprocessableEntityException as UnprocessableEntityException2 } from "@nestjs/common";
|
|
773
767
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
774
768
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
775
769
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1158,11 +1152,8 @@ CatalogEntriesService = _ts_decorate3([
|
|
|
1158
1152
|
])
|
|
1159
1153
|
], CatalogEntriesService);
|
|
1160
1154
|
|
|
1161
|
-
// src/catalog/catalog-entries.
|
|
1162
|
-
import {
|
|
1163
|
-
|
|
1164
|
-
// src/core/web-audit.ts
|
|
1165
|
-
import { Inject as Inject4, Injectable as Injectable4, Optional as Optional3 } from "@nestjs/common";
|
|
1155
|
+
// src/catalog/dto/catalog-entries.dto.ts
|
|
1156
|
+
import { IsIn, IsObject, IsOptional, IsString, Matches, MaxLength } from "class-validator";
|
|
1166
1157
|
function _ts_decorate4(decorators, target, key, desc) {
|
|
1167
1158
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1168
1159
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1174,100 +1165,6 @@ function _ts_metadata4(k, v) {
|
|
|
1174
1165
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1175
1166
|
}
|
|
1176
1167
|
__name(_ts_metadata4, "_ts_metadata");
|
|
1177
|
-
function _ts_param4(paramIndex, decorator) {
|
|
1178
|
-
return function(target, key) {
|
|
1179
|
-
decorator(target, key, paramIndex);
|
|
1180
|
-
};
|
|
1181
|
-
}
|
|
1182
|
-
__name(_ts_param4, "_ts_param");
|
|
1183
|
-
var DEFAULT_CONTEXT = "admin";
|
|
1184
|
-
var WebAuditLogger = class {
|
|
1185
|
-
static {
|
|
1186
|
-
__name(this, "WebAuditLogger");
|
|
1187
|
-
}
|
|
1188
|
-
auditService;
|
|
1189
|
-
userIdResolver;
|
|
1190
|
-
userEmailResolver;
|
|
1191
|
-
auditContextResolver;
|
|
1192
|
-
constructor(auditService = null, userIdResolver = null, userEmailResolver = null, auditContextResolver = null) {
|
|
1193
|
-
this.auditService = auditService;
|
|
1194
|
-
this.userIdResolver = userIdResolver;
|
|
1195
|
-
this.userEmailResolver = userEmailResolver;
|
|
1196
|
-
this.auditContextResolver = auditContextResolver;
|
|
1197
|
-
}
|
|
1198
|
-
/**
|
|
1199
|
-
* Resolves the user ID from the request (resolver token or JWT default) —
|
|
1200
|
-
* also usable for domain fields (e.g. `approvedBy`, #20), not just
|
|
1201
|
-
* for the audit log.
|
|
1202
|
-
*/
|
|
1203
|
-
resolveUserId(req) {
|
|
1204
|
-
return (this.userIdResolver ?? ((r) => r.user?.sub ?? r.user?.id ?? null))(req) ?? null;
|
|
1205
|
-
}
|
|
1206
|
-
buildActor(req) {
|
|
1207
|
-
const userId = this.resolveUserId(req) ?? "unknown";
|
|
1208
|
-
const email = (this.userEmailResolver ?? ((r) => r.user?.email ?? null))(req) ?? "unknown";
|
|
1209
|
-
const context = (this.auditContextResolver ?? ((r) => {
|
|
1210
|
-
const sid = r.headers?.["x-session-id"];
|
|
1211
|
-
return Array.isArray(sid) ? sid[0] ?? null : sid ?? null;
|
|
1212
|
-
}))(req) ?? DEFAULT_CONTEXT;
|
|
1213
|
-
return {
|
|
1214
|
-
userId,
|
|
1215
|
-
email,
|
|
1216
|
-
source: "web",
|
|
1217
|
-
context
|
|
1218
|
-
};
|
|
1219
|
-
}
|
|
1220
|
-
/**
|
|
1221
|
-
* Best-effort audit log from a web request. Writes nothing and never
|
|
1222
|
-
* throws when no AdminAuditService is injected; write errors are
|
|
1223
|
-
* swallowed (an observability gap is better than an outage).
|
|
1224
|
-
*/
|
|
1225
|
-
async logFromRequest(req, entity, entityId, action, changes) {
|
|
1226
|
-
if (!this.auditService) return;
|
|
1227
|
-
try {
|
|
1228
|
-
await this.auditService.log({
|
|
1229
|
-
actor: this.buildActor(req),
|
|
1230
|
-
entity,
|
|
1231
|
-
entityId,
|
|
1232
|
-
action,
|
|
1233
|
-
changes
|
|
1234
|
-
});
|
|
1235
|
-
} catch {
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
};
|
|
1239
|
-
WebAuditLogger = _ts_decorate4([
|
|
1240
|
-
Injectable4(),
|
|
1241
|
-
_ts_param4(0, Optional3()),
|
|
1242
|
-
_ts_param4(0, Inject4(AdminAuditService)),
|
|
1243
|
-
_ts_param4(1, Optional3()),
|
|
1244
|
-
_ts_param4(1, Inject4(USER_ID_RESOLVER_TOKEN)),
|
|
1245
|
-
_ts_param4(2, Optional3()),
|
|
1246
|
-
_ts_param4(2, Inject4(USER_EMAIL_RESOLVER_TOKEN)),
|
|
1247
|
-
_ts_param4(3, Optional3()),
|
|
1248
|
-
_ts_param4(3, Inject4(AUDIT_CONTEXT_RESOLVER_TOKEN)),
|
|
1249
|
-
_ts_metadata4("design:type", Function),
|
|
1250
|
-
_ts_metadata4("design:paramtypes", [
|
|
1251
|
-
Object,
|
|
1252
|
-
Object,
|
|
1253
|
-
Object,
|
|
1254
|
-
Object
|
|
1255
|
-
])
|
|
1256
|
-
], WebAuditLogger);
|
|
1257
|
-
|
|
1258
|
-
// src/catalog/dto/catalog-entries.dto.ts
|
|
1259
|
-
import { IsIn, IsObject, IsOptional, IsString, Matches, MaxLength } from "class-validator";
|
|
1260
|
-
function _ts_decorate5(decorators, target, key, desc) {
|
|
1261
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1262
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1263
|
-
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;
|
|
1264
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1265
|
-
}
|
|
1266
|
-
__name(_ts_decorate5, "_ts_decorate");
|
|
1267
|
-
function _ts_metadata5(k, v) {
|
|
1268
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1269
|
-
}
|
|
1270
|
-
__name(_ts_metadata5, "_ts_metadata");
|
|
1271
1168
|
var PROJECT_KEY_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
1272
1169
|
var REVIEW_STATUSES = [
|
|
1273
1170
|
"pending",
|
|
@@ -1291,24 +1188,24 @@ var ListCatalogEntriesQueryDto = class {
|
|
|
1291
1188
|
/** Filter for capabilities (read-only code facts). */
|
|
1292
1189
|
codeStatus;
|
|
1293
1190
|
};
|
|
1294
|
-
|
|
1191
|
+
_ts_decorate4([
|
|
1295
1192
|
IsString(),
|
|
1296
1193
|
Matches(PROJECT_KEY_PATTERN, {
|
|
1297
1194
|
message: "projectKey muss kebab-case sein"
|
|
1298
1195
|
}),
|
|
1299
|
-
|
|
1196
|
+
_ts_metadata4("design:type", String)
|
|
1300
1197
|
], ListCatalogEntriesQueryDto.prototype, "projectKey", void 0);
|
|
1301
|
-
|
|
1198
|
+
_ts_decorate4([
|
|
1302
1199
|
IsOptional(),
|
|
1303
1200
|
IsString(),
|
|
1304
1201
|
IsIn(REVIEW_STATUSES),
|
|
1305
|
-
|
|
1202
|
+
_ts_metadata4("design:type", String)
|
|
1306
1203
|
], ListCatalogEntriesQueryDto.prototype, "discoveryStatus", void 0);
|
|
1307
|
-
|
|
1204
|
+
_ts_decorate4([
|
|
1308
1205
|
IsOptional(),
|
|
1309
1206
|
IsString(),
|
|
1310
1207
|
IsIn(CODE_STATUSES),
|
|
1311
|
-
|
|
1208
|
+
_ts_metadata4("design:type", String)
|
|
1312
1209
|
], ListCatalogEntriesQueryDto.prototype, "codeStatus", void 0);
|
|
1313
1210
|
var ReviewCatalogEntryDto = class {
|
|
1314
1211
|
static {
|
|
@@ -1316,12 +1213,12 @@ var ReviewCatalogEntryDto = class {
|
|
|
1316
1213
|
}
|
|
1317
1214
|
discoveryStatus;
|
|
1318
1215
|
};
|
|
1319
|
-
|
|
1216
|
+
_ts_decorate4([
|
|
1320
1217
|
IsString(),
|
|
1321
1218
|
IsIn(REVIEW_STATUSES, {
|
|
1322
1219
|
message: "discoveryStatus muss pending|approved|outdated|obsolete sein"
|
|
1323
1220
|
}),
|
|
1324
|
-
|
|
1221
|
+
_ts_metadata4("design:type", typeof DiscoveryStatus === "undefined" ? Object : DiscoveryStatus)
|
|
1325
1222
|
], ReviewCatalogEntryDto.prototype, "discoveryStatus", void 0);
|
|
1326
1223
|
var UpdateCatalogEntryI18nDto = class {
|
|
1327
1224
|
static {
|
|
@@ -1329,9 +1226,9 @@ var UpdateCatalogEntryI18nDto = class {
|
|
|
1329
1226
|
}
|
|
1330
1227
|
i18n;
|
|
1331
1228
|
};
|
|
1332
|
-
|
|
1229
|
+
_ts_decorate4([
|
|
1333
1230
|
IsObject(),
|
|
1334
|
-
|
|
1231
|
+
_ts_metadata4("design:type", typeof CatalogEntryI18n === "undefined" ? Object : CatalogEntryI18n)
|
|
1335
1232
|
], UpdateCatalogEntryI18nDto.prototype, "i18n", void 0);
|
|
1336
1233
|
var UpdateCatalogEntryBaseDto = class {
|
|
1337
1234
|
static {
|
|
@@ -1344,29 +1241,29 @@ var UpdateCatalogEntryBaseDto = class {
|
|
|
1344
1241
|
icon;
|
|
1345
1242
|
tier;
|
|
1346
1243
|
};
|
|
1347
|
-
|
|
1244
|
+
_ts_decorate4([
|
|
1348
1245
|
IsOptional(),
|
|
1349
1246
|
IsString(),
|
|
1350
1247
|
MaxLength(120),
|
|
1351
|
-
|
|
1248
|
+
_ts_metadata4("design:type", String)
|
|
1352
1249
|
], UpdateCatalogEntryBaseDto.prototype, "label", void 0);
|
|
1353
|
-
|
|
1250
|
+
_ts_decorate4([
|
|
1354
1251
|
IsOptional(),
|
|
1355
1252
|
IsString(),
|
|
1356
1253
|
MaxLength(2e3),
|
|
1357
|
-
|
|
1254
|
+
_ts_metadata4("design:type", Object)
|
|
1358
1255
|
], UpdateCatalogEntryBaseDto.prototype, "description", void 0);
|
|
1359
|
-
|
|
1256
|
+
_ts_decorate4([
|
|
1360
1257
|
IsOptional(),
|
|
1361
1258
|
IsString(),
|
|
1362
1259
|
MaxLength(64),
|
|
1363
|
-
|
|
1260
|
+
_ts_metadata4("design:type", Object)
|
|
1364
1261
|
], UpdateCatalogEntryBaseDto.prototype, "icon", void 0);
|
|
1365
|
-
|
|
1262
|
+
_ts_decorate4([
|
|
1366
1263
|
IsOptional(),
|
|
1367
1264
|
IsString(),
|
|
1368
1265
|
MaxLength(40),
|
|
1369
|
-
|
|
1266
|
+
_ts_metadata4("design:type", Object)
|
|
1370
1267
|
], UpdateCatalogEntryBaseDto.prototype, "tier", void 0);
|
|
1371
1268
|
var SyncDiscoveryDto = class {
|
|
1372
1269
|
static {
|
|
@@ -1374,11 +1271,108 @@ var SyncDiscoveryDto = class {
|
|
|
1374
1271
|
}
|
|
1375
1272
|
snapshot;
|
|
1376
1273
|
};
|
|
1377
|
-
|
|
1274
|
+
_ts_decorate4([
|
|
1378
1275
|
IsObject(),
|
|
1379
|
-
|
|
1276
|
+
_ts_metadata4("design:type", typeof DiscoverySnapshot === "undefined" ? Object : DiscoverySnapshot)
|
|
1380
1277
|
], SyncDiscoveryDto.prototype, "snapshot", void 0);
|
|
1381
1278
|
|
|
1279
|
+
// src/catalog/catalog-entries.controller.ts
|
|
1280
|
+
import { Body, Controller, Get, Inject as Inject5, Optional as Optional4, Param, Patch, Post, Query, Req, UseGuards } from "@nestjs/common";
|
|
1281
|
+
|
|
1282
|
+
// src/core/web-audit.ts
|
|
1283
|
+
import { Inject as Inject4, Injectable as Injectable4, Optional as Optional3 } from "@nestjs/common";
|
|
1284
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
1285
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1286
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1287
|
+
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;
|
|
1288
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1289
|
+
}
|
|
1290
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
1291
|
+
function _ts_metadata5(k, v) {
|
|
1292
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1293
|
+
}
|
|
1294
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
1295
|
+
function _ts_param4(paramIndex, decorator) {
|
|
1296
|
+
return function(target, key) {
|
|
1297
|
+
decorator(target, key, paramIndex);
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
__name(_ts_param4, "_ts_param");
|
|
1301
|
+
var DEFAULT_CONTEXT = "admin";
|
|
1302
|
+
var WebAuditLogger = class {
|
|
1303
|
+
static {
|
|
1304
|
+
__name(this, "WebAuditLogger");
|
|
1305
|
+
}
|
|
1306
|
+
auditService;
|
|
1307
|
+
userIdResolver;
|
|
1308
|
+
userEmailResolver;
|
|
1309
|
+
auditContextResolver;
|
|
1310
|
+
constructor(auditService = null, userIdResolver = null, userEmailResolver = null, auditContextResolver = null) {
|
|
1311
|
+
this.auditService = auditService;
|
|
1312
|
+
this.userIdResolver = userIdResolver;
|
|
1313
|
+
this.userEmailResolver = userEmailResolver;
|
|
1314
|
+
this.auditContextResolver = auditContextResolver;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Resolves the user ID from the request (resolver token or JWT default) —
|
|
1318
|
+
* also usable for domain fields (e.g. `approvedBy`, #20), not just
|
|
1319
|
+
* for the audit log.
|
|
1320
|
+
*/
|
|
1321
|
+
resolveUserId(req) {
|
|
1322
|
+
return (this.userIdResolver ?? ((r) => r.user?.sub ?? r.user?.id ?? null))(req) ?? null;
|
|
1323
|
+
}
|
|
1324
|
+
buildActor(req) {
|
|
1325
|
+
const userId = this.resolveUserId(req) ?? "unknown";
|
|
1326
|
+
const email = (this.userEmailResolver ?? ((r) => r.user?.email ?? null))(req) ?? "unknown";
|
|
1327
|
+
const context = (this.auditContextResolver ?? ((r) => {
|
|
1328
|
+
const sid = r.headers?.["x-session-id"];
|
|
1329
|
+
return Array.isArray(sid) ? sid[0] ?? null : sid ?? null;
|
|
1330
|
+
}))(req) ?? DEFAULT_CONTEXT;
|
|
1331
|
+
return {
|
|
1332
|
+
userId,
|
|
1333
|
+
email,
|
|
1334
|
+
source: "web",
|
|
1335
|
+
context
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Best-effort audit log from a web request. Writes nothing and never
|
|
1340
|
+
* throws when no AdminAuditService is injected; write errors are
|
|
1341
|
+
* swallowed (an observability gap is better than an outage).
|
|
1342
|
+
*/
|
|
1343
|
+
async logFromRequest(req, entity, entityId, action, changes) {
|
|
1344
|
+
if (!this.auditService) return;
|
|
1345
|
+
try {
|
|
1346
|
+
await this.auditService.log({
|
|
1347
|
+
actor: this.buildActor(req),
|
|
1348
|
+
entity,
|
|
1349
|
+
entityId,
|
|
1350
|
+
action,
|
|
1351
|
+
changes
|
|
1352
|
+
});
|
|
1353
|
+
} catch {
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
};
|
|
1357
|
+
WebAuditLogger = _ts_decorate5([
|
|
1358
|
+
Injectable4(),
|
|
1359
|
+
_ts_param4(0, Optional3()),
|
|
1360
|
+
_ts_param4(0, Inject4(AdminAuditService)),
|
|
1361
|
+
_ts_param4(1, Optional3()),
|
|
1362
|
+
_ts_param4(1, Inject4(USER_ID_RESOLVER_TOKEN)),
|
|
1363
|
+
_ts_param4(2, Optional3()),
|
|
1364
|
+
_ts_param4(2, Inject4(USER_EMAIL_RESOLVER_TOKEN)),
|
|
1365
|
+
_ts_param4(3, Optional3()),
|
|
1366
|
+
_ts_param4(3, Inject4(AUDIT_CONTEXT_RESOLVER_TOKEN)),
|
|
1367
|
+
_ts_metadata5("design:type", Function),
|
|
1368
|
+
_ts_metadata5("design:paramtypes", [
|
|
1369
|
+
Object,
|
|
1370
|
+
Object,
|
|
1371
|
+
Object,
|
|
1372
|
+
Object
|
|
1373
|
+
])
|
|
1374
|
+
], WebAuditLogger);
|
|
1375
|
+
|
|
1382
1376
|
// src/catalog/catalog-entries.controller.ts
|
|
1383
1377
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
1384
1378
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1684,9 +1678,6 @@ PromotionsService = _ts_decorate7([
|
|
|
1684
1678
|
])
|
|
1685
1679
|
], PromotionsService);
|
|
1686
1680
|
|
|
1687
|
-
// src/catalog/promotions.controller.ts
|
|
1688
|
-
import { Body as Body2, Controller as Controller2, Delete, Get as Get2, HttpCode, HttpStatus, Inject as Inject7, Param as Param2, ParseUUIDPipe, Patch as Patch2, Post as Post2, Query as Query2, UseGuards as UseGuards2 } from "@nestjs/common";
|
|
1689
|
-
|
|
1690
1681
|
// src/catalog/dto/promotions.dto.ts
|
|
1691
1682
|
import { IsArray, IsBoolean, IsDefined, IsIn as IsIn2, IsInt, IsObject as IsObject2, IsOptional as IsOptional2, IsString as IsString2, Matches as Matches2, MaxLength as MaxLength2 } from "class-validator";
|
|
1692
1683
|
function _ts_decorate8(decorators, target, key, desc) {
|
|
@@ -1949,6 +1940,7 @@ _ts_decorate8([
|
|
|
1949
1940
|
], UpdatePromotionDto.prototype, "i18n", void 0);
|
|
1950
1941
|
|
|
1951
1942
|
// src/catalog/promotions.controller.ts
|
|
1943
|
+
import { Body as Body2, Controller as Controller2, Delete, Get as Get2, HttpCode, HttpStatus, Inject as Inject7, Param as Param2, ParseUUIDPipe, Patch as Patch2, Post as Post2, Query as Query2, UseGuards as UseGuards2 } from "@nestjs/common";
|
|
1952
1944
|
function _ts_decorate9(decorators, target, key, desc) {
|
|
1953
1945
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1954
1946
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2096,9 +2088,6 @@ MarketingSettingsService = _ts_decorate10([
|
|
|
2096
2088
|
])
|
|
2097
2089
|
], MarketingSettingsService);
|
|
2098
2090
|
|
|
2099
|
-
// src/catalog/marketing-settings.controller.ts
|
|
2100
|
-
import { Body as Body3, Controller as Controller3, Get as Get3, Inject as Inject9, Put, Query as Query3, UseGuards as UseGuards3 } from "@nestjs/common";
|
|
2101
|
-
|
|
2102
2091
|
// src/catalog/dto/marketing-settings.dto.ts
|
|
2103
2092
|
import { ArrayUnique, IsArray as IsArray2, IsString as IsString3, Matches as Matches3 } from "class-validator";
|
|
2104
2093
|
function _ts_decorate11(decorators, target, key, desc) {
|
|
@@ -2155,6 +2144,7 @@ _ts_decorate11([
|
|
|
2155
2144
|
], UpdateMarketingSettingsDto.prototype, "activeLocales", void 0);
|
|
2156
2145
|
|
|
2157
2146
|
// src/catalog/marketing-settings.controller.ts
|
|
2147
|
+
import { Body as Body3, Controller as Controller3, Get as Get3, Inject as Inject9, Put, Query as Query3, UseGuards as UseGuards3 } from "@nestjs/common";
|
|
2158
2148
|
function _ts_decorate12(decorators, target, key, desc) {
|
|
2159
2149
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2160
2150
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3172,9 +3162,6 @@ PlanVersionsService = _ts_decorate16([
|
|
|
3172
3162
|
])
|
|
3173
3163
|
], PlanVersionsService);
|
|
3174
3164
|
|
|
3175
|
-
// src/catalog/bundles.controller.ts
|
|
3176
|
-
import { Body as Body4, Controller as Controller5, Delete as Delete2, Get as Get5, HttpCode as HttpCode2, HttpStatus as HttpStatus2, Inject as Inject14, Param as Param3, ParseUUIDPipe as ParseUUIDPipe2, Patch as Patch3, Post as Post3, Query as Query5, UseGuards as UseGuards5 } from "@nestjs/common";
|
|
3177
|
-
|
|
3178
3165
|
// src/catalog/dto/bundles.dto.ts
|
|
3179
3166
|
import { IsArray as IsArray3, IsBoolean as IsBoolean2, IsInt as IsInt2, IsNumberString, IsObject as IsObject3, IsOptional as IsOptional3, IsString as IsString4, IsUUID, Matches as Matches4, Max, MaxLength as MaxLength3, Min, MinLength, ValidateIf } from "class-validator";
|
|
3180
3167
|
function _ts_decorate17(decorators, target, key, desc) {
|
|
@@ -3517,6 +3504,7 @@ _ts_decorate17([
|
|
|
3517
3504
|
], PublishBundleVersionDto.prototype, "validUntil", void 0);
|
|
3518
3505
|
|
|
3519
3506
|
// src/catalog/bundles.controller.ts
|
|
3507
|
+
import { Body as Body4, Controller as Controller5, Delete as Delete2, Get as Get5, HttpCode as HttpCode2, HttpStatus as HttpStatus2, Inject as Inject14, Param as Param3, ParseUUIDPipe as ParseUUIDPipe2, Patch as Patch3, Post as Post3, Query as Query5, UseGuards as UseGuards5 } from "@nestjs/common";
|
|
3520
3508
|
function _ts_decorate18(decorators, target, key, desc) {
|
|
3521
3509
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3522
3510
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3742,9 +3730,6 @@ function buildBundleVersionsController(guards) {
|
|
|
3742
3730
|
}
|
|
3743
3731
|
__name(buildBundleVersionsController, "buildBundleVersionsController");
|
|
3744
3732
|
|
|
3745
|
-
// src/catalog/marketing-projections.controller.ts
|
|
3746
|
-
import { Body as Body5, Controller as Controller6, Delete as Delete3, Get as Get6, HttpCode as HttpCode3, HttpStatus as HttpStatus3, Inject as Inject15, Param as Param4, ParseUUIDPipe as ParseUUIDPipe3, Patch as Patch4, Post as Post4, Query as Query6, UseGuards as UseGuards6 } from "@nestjs/common";
|
|
3747
|
-
|
|
3748
3733
|
// src/catalog/dto/marketing-projections.dto.ts
|
|
3749
3734
|
import { IsArray as IsArray4, IsBoolean as IsBoolean3, IsIn as IsIn3, IsInt as IsInt3, IsOptional as IsOptional4, IsString as IsString5, IsUUID as IsUUID2, Matches as Matches5, Max as Max2, MaxLength as MaxLength4, Min as Min2, MinLength as MinLength2, ValidateNested } from "class-validator";
|
|
3750
3735
|
import { Type } from "class-transformer";
|
|
@@ -4024,6 +4009,7 @@ _ts_decorate19([
|
|
|
4024
4009
|
], ListMarketingProjectionsQueryDto.prototype, "locale", void 0);
|
|
4025
4010
|
|
|
4026
4011
|
// src/catalog/marketing-projections.controller.ts
|
|
4012
|
+
import { Body as Body5, Controller as Controller6, Delete as Delete3, Get as Get6, HttpCode as HttpCode3, HttpStatus as HttpStatus3, Inject as Inject15, Param as Param4, ParseUUIDPipe as ParseUUIDPipe3, Patch as Patch4, Post as Post4, Query as Query6, UseGuards as UseGuards6 } from "@nestjs/common";
|
|
4027
4013
|
function _ts_decorate20(decorators, target, key, desc) {
|
|
4028
4014
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4029
4015
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4132,9 +4118,6 @@ function buildMarketingProjectionsController(guards) {
|
|
|
4132
4118
|
}
|
|
4133
4119
|
__name(buildMarketingProjectionsController, "buildMarketingProjectionsController");
|
|
4134
4120
|
|
|
4135
|
-
// src/catalog/plans.controller.ts
|
|
4136
|
-
import { Body as Body6, Controller as Controller7, Delete as Delete4, Get as Get7, HttpCode as HttpCode4, HttpStatus as HttpStatus4, Inject as Inject16, Optional as Optional8, Param as Param5, ParseUUIDPipe as ParseUUIDPipe4, Patch as Patch5, Post as Post5, Query as Query7, UseGuards as UseGuards7 } from "@nestjs/common";
|
|
4137
|
-
|
|
4138
4121
|
// src/catalog/dto/plans.dto.ts
|
|
4139
4122
|
import { IsInt as IsInt4, IsOptional as IsOptional5, IsString as IsString6, Matches as Matches6, Max as Max3, MaxLength as MaxLength5, Min as Min3, MinLength as MinLength3 } from "class-validator";
|
|
4140
4123
|
function _ts_decorate21(decorators, target, key, desc) {
|
|
@@ -4473,6 +4456,7 @@ _ts_decorate22([
|
|
|
4473
4456
|
], PublishPlanVersionDto.prototype, "validUntil", void 0);
|
|
4474
4457
|
|
|
4475
4458
|
// src/catalog/plans.controller.ts
|
|
4459
|
+
import { Body as Body6, Controller as Controller7, Delete as Delete4, Get as Get7, HttpCode as HttpCode4, HttpStatus as HttpStatus4, Inject as Inject16, Optional as Optional8, Param as Param5, ParseUUIDPipe as ParseUUIDPipe4, Patch as Patch5, Post as Post5, Query as Query7, UseGuards as UseGuards7 } from "@nestjs/common";
|
|
4476
4460
|
function _ts_decorate23(decorators, target, key, desc) {
|
|
4477
4461
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4478
4462
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -4863,195 +4847,6 @@ CatalogModule = _ts_decorate24([
|
|
|
4863
4847
|
Module({})
|
|
4864
4848
|
], CatalogModule);
|
|
4865
4849
|
|
|
4866
|
-
// src/catalog/preflight.ts
|
|
4867
|
-
function runPreflight(input) {
|
|
4868
|
-
const findings = [];
|
|
4869
|
-
const approved = input.approved ?? null;
|
|
4870
|
-
for (const pv of input.planVersions) {
|
|
4871
|
-
const warns = validatePlanDraft({
|
|
4872
|
-
features: pv.features,
|
|
4873
|
-
quotas: pv.quotas ?? {}
|
|
4874
|
-
}, input.snapshot, /* @__PURE__ */ new Set(), approved);
|
|
4875
|
-
for (const w of warns) {
|
|
4876
|
-
findings.push({
|
|
4877
|
-
kind: "plan",
|
|
4878
|
-
versionId: pv.id,
|
|
4879
|
-
entityKey: pv.planId,
|
|
4880
|
-
version: pv.version,
|
|
4881
|
-
warning: w
|
|
4882
|
-
});
|
|
4883
|
-
}
|
|
4884
|
-
}
|
|
4885
|
-
for (const bv of input.bundleVersions) {
|
|
4886
|
-
const warns = validateBundleDraft({
|
|
4887
|
-
features: bv.features,
|
|
4888
|
-
quotas: bv.quotas ?? {}
|
|
4889
|
-
}, input.snapshot, null, /* @__PURE__ */ new Set(), approved);
|
|
4890
|
-
for (const w of warns) {
|
|
4891
|
-
findings.push({
|
|
4892
|
-
kind: "bundle",
|
|
4893
|
-
versionId: bv.id,
|
|
4894
|
-
entityKey: bv.bundleKey,
|
|
4895
|
-
version: bv.version,
|
|
4896
|
-
warning: w
|
|
4897
|
-
});
|
|
4898
|
-
}
|
|
4899
|
-
}
|
|
4900
|
-
findings.sort((a, b) => {
|
|
4901
|
-
if (a.kind !== b.kind) return a.kind.localeCompare(b.kind);
|
|
4902
|
-
if (a.entityKey !== b.entityKey) return a.entityKey.localeCompare(b.entityKey);
|
|
4903
|
-
if (a.version !== b.version) return a.version - b.version;
|
|
4904
|
-
return a.warning.code.localeCompare(b.warning.code);
|
|
4905
|
-
});
|
|
4906
|
-
const counts = {
|
|
4907
|
-
planFindings: findings.filter((f) => f.kind === "plan").length,
|
|
4908
|
-
bundleFindings: findings.filter((f) => f.kind === "bundle").length,
|
|
4909
|
-
total: findings.length
|
|
4910
|
-
};
|
|
4911
|
-
const hasBlockingFinding = findings.some((f) => !ADVISORY_STRICT_MODE_CODES.has(f.warning.code));
|
|
4912
|
-
return {
|
|
4913
|
-
overall: hasBlockingFinding ? "error" : "ok",
|
|
4914
|
-
counts,
|
|
4915
|
-
findings
|
|
4916
|
-
};
|
|
4917
|
-
}
|
|
4918
|
-
__name(runPreflight, "runPreflight");
|
|
4919
|
-
function formatPreflightReport(report) {
|
|
4920
|
-
const lines = [];
|
|
4921
|
-
lines.push(`Preflight (Status: ${report.overall.toUpperCase()})`, ` Plans: ${report.counts.planFindings} \xB7 Bundles: ${report.counts.bundleFindings} \xB7 Gesamt: ${report.counts.total}`, "");
|
|
4922
|
-
if (report.findings.length === 0) {
|
|
4923
|
-
lines.push(" \u2713 Keine Strict-Mode-Verst\xF6\xDFe gefunden.");
|
|
4924
|
-
return lines.join("\n");
|
|
4925
|
-
}
|
|
4926
|
-
let lastEntity = "";
|
|
4927
|
-
for (const f of report.findings) {
|
|
4928
|
-
const entityHeader = `${f.kind} ${f.entityKey} v${f.version}`;
|
|
4929
|
-
if (entityHeader !== lastEntity) {
|
|
4930
|
-
lines.push(` \u2717 ${entityHeader} (${f.versionId})`);
|
|
4931
|
-
lastEntity = entityHeader;
|
|
4932
|
-
}
|
|
4933
|
-
const fieldHint = f.warning.field ? ` [${f.warning.field}]` : "";
|
|
4934
|
-
lines.push(` ${f.warning.code}${fieldHint}: ${f.warning.message}`);
|
|
4935
|
-
}
|
|
4936
|
-
return lines.join("\n");
|
|
4937
|
-
}
|
|
4938
|
-
__name(formatPreflightReport, "formatPreflightReport");
|
|
4939
|
-
function preflightExitCode(report) {
|
|
4940
|
-
return report.overall === "error" ? 4 : 0;
|
|
4941
|
-
}
|
|
4942
|
-
__name(preflightExitCode, "preflightExitCode");
|
|
4943
|
-
|
|
4944
|
-
// src/catalog/seed-gate.ts
|
|
4945
|
-
function validateSeedAgainstSnapshot(input) {
|
|
4946
|
-
const findings = [];
|
|
4947
|
-
for (const plan of input.plans ?? []) {
|
|
4948
|
-
const warns = validatePlanDraft({
|
|
4949
|
-
features: plan.features,
|
|
4950
|
-
quotas: plan.quotas ?? {}
|
|
4951
|
-
}, input.snapshot, /* @__PURE__ */ new Set(), input.approved ?? null);
|
|
4952
|
-
for (const warning of warns) {
|
|
4953
|
-
findings.push({
|
|
4954
|
-
kind: "plan",
|
|
4955
|
-
entityKey: plan.planKey,
|
|
4956
|
-
warning
|
|
4957
|
-
});
|
|
4958
|
-
}
|
|
4959
|
-
}
|
|
4960
|
-
for (const bundle of input.bundles ?? []) {
|
|
4961
|
-
const warns = validateBundleDraft({
|
|
4962
|
-
features: bundle.features,
|
|
4963
|
-
quotas: bundle.quotas ?? {}
|
|
4964
|
-
}, input.snapshot, null, /* @__PURE__ */ new Set(), input.approved ?? null);
|
|
4965
|
-
for (const warning of warns) {
|
|
4966
|
-
findings.push({
|
|
4967
|
-
kind: "bundle",
|
|
4968
|
-
entityKey: bundle.bundleKey,
|
|
4969
|
-
warning
|
|
4970
|
-
});
|
|
4971
|
-
}
|
|
4972
|
-
}
|
|
4973
|
-
findings.sort((a, b) => {
|
|
4974
|
-
if (a.kind !== b.kind) return a.kind.localeCompare(b.kind);
|
|
4975
|
-
if (a.entityKey !== b.entityKey) return a.entityKey.localeCompare(b.entityKey);
|
|
4976
|
-
return a.warning.code.localeCompare(b.warning.code);
|
|
4977
|
-
});
|
|
4978
|
-
const counts = {
|
|
4979
|
-
planFindings: findings.filter((f) => f.kind === "plan").length,
|
|
4980
|
-
bundleFindings: findings.filter((f) => f.kind === "bundle").length,
|
|
4981
|
-
total: findings.length
|
|
4982
|
-
};
|
|
4983
|
-
const hasBlockingFinding = findings.some((f) => !ADVISORY_STRICT_MODE_CODES.has(f.warning.code));
|
|
4984
|
-
return {
|
|
4985
|
-
overall: hasBlockingFinding ? "error" : "ok",
|
|
4986
|
-
counts,
|
|
4987
|
-
findings
|
|
4988
|
-
};
|
|
4989
|
-
}
|
|
4990
|
-
__name(validateSeedAgainstSnapshot, "validateSeedAgainstSnapshot");
|
|
4991
|
-
function formatSeedGateReport(report) {
|
|
4992
|
-
const lines = [];
|
|
4993
|
-
lines.push(`Seed-Gate (Status: ${report.overall.toUpperCase()})`, ` Plans: ${report.counts.planFindings} \xB7 Bundles: ${report.counts.bundleFindings} \xB7 Gesamt: ${report.counts.total}`, "");
|
|
4994
|
-
if (report.findings.length === 0) {
|
|
4995
|
-
lines.push(" \u2713 Alle geseedeten Plan-/Bundle-Features sind discovered (und, sofern gepr\xFCft, approved).");
|
|
4996
|
-
return lines.join("\n");
|
|
4997
|
-
}
|
|
4998
|
-
let lastEntity = "";
|
|
4999
|
-
for (const f of report.findings) {
|
|
5000
|
-
const entityHeader = `${f.kind} ${f.entityKey}`;
|
|
5001
|
-
if (entityHeader !== lastEntity) {
|
|
5002
|
-
lines.push(` \u2717 ${entityHeader}`);
|
|
5003
|
-
lastEntity = entityHeader;
|
|
5004
|
-
}
|
|
5005
|
-
const fieldHint = f.warning.field ? ` [${f.warning.field}]` : "";
|
|
5006
|
-
lines.push(` ${f.warning.code}${fieldHint}: ${f.warning.message}`);
|
|
5007
|
-
}
|
|
5008
|
-
return lines.join("\n");
|
|
5009
|
-
}
|
|
5010
|
-
__name(formatSeedGateReport, "formatSeedGateReport");
|
|
5011
|
-
function seedGateExitCode(report) {
|
|
5012
|
-
return report.overall === "error" ? 4 : 0;
|
|
5013
|
-
}
|
|
5014
|
-
__name(seedGateExitCode, "seedGateExitCode");
|
|
5015
|
-
|
|
5016
|
-
// src/catalog/seed-gate-runner.ts
|
|
5017
|
-
function runSeedGateFromFile(options) {
|
|
5018
|
-
const mode = options.mode ?? "report-only";
|
|
5019
|
-
const log = options.log ?? ((line) => console.log(line));
|
|
5020
|
-
const warn = options.warn ?? ((line) => console.warn(line));
|
|
5021
|
-
const error = options.error ?? ((line) => console.error(line));
|
|
5022
|
-
const exit = options.exit ?? ((code) => process.exit(code));
|
|
5023
|
-
let snapshot;
|
|
5024
|
-
try {
|
|
5025
|
-
snapshot = loadDiscoverySnapshotFromFile(options.snapshotPath);
|
|
5026
|
-
} catch (err) {
|
|
5027
|
-
if (err instanceof DiscoverySnapshotNotFoundError) {
|
|
5028
|
-
if (mode === "blocking") {
|
|
5029
|
-
error(`[seed-gate] FEHLER: Kein Discovery-Snapshot unter ${options.snapshotPath} \u2014 im blocking-Modus Pflicht (Headless-Scan vor dem Seed ausf\xFChren, #23).`);
|
|
5030
|
-
return exit(4);
|
|
5031
|
-
}
|
|
5032
|
-
warn(`[seed-gate] Kein Discovery-Snapshot unter ${options.snapshotPath} \u2014 \xFCbersprungen (report-only).`);
|
|
5033
|
-
return null;
|
|
5034
|
-
}
|
|
5035
|
-
throw err;
|
|
5036
|
-
}
|
|
5037
|
-
const report = validateSeedAgainstSnapshot({
|
|
5038
|
-
snapshot,
|
|
5039
|
-
plans: options.plans,
|
|
5040
|
-
bundles: options.bundles,
|
|
5041
|
-
approved: options.approved ?? null
|
|
5042
|
-
});
|
|
5043
|
-
log(formatSeedGateReport(report));
|
|
5044
|
-
if (report.overall === "error") {
|
|
5045
|
-
if (mode === "blocking") {
|
|
5046
|
-
error("[seed-gate] blocking: Verst\xF6\xDFe gefunden \u2014 Seed wird abgebrochen (#23).");
|
|
5047
|
-
return exit(seedGateExitCode(report));
|
|
5048
|
-
}
|
|
5049
|
-
warn("[seed-gate] report-only: Verst\xF6\xDFe gefunden, Seed l\xE4uft trotzdem weiter.");
|
|
5050
|
-
}
|
|
5051
|
-
return report;
|
|
5052
|
-
}
|
|
5053
|
-
__name(runSeedGateFromFile, "runSeedGateFromFile");
|
|
5054
|
-
|
|
5055
4850
|
export {
|
|
5056
4851
|
loadApprovedCatalogKeys,
|
|
5057
4852
|
ADVISORY_STRICT_MODE_CODES,
|
|
@@ -5099,12 +4894,5 @@ export {
|
|
|
5099
4894
|
PublishPlanVersionDto,
|
|
5100
4895
|
buildPlansController,
|
|
5101
4896
|
buildPlanVersionsController,
|
|
5102
|
-
CatalogModule
|
|
5103
|
-
runPreflight,
|
|
5104
|
-
formatPreflightReport,
|
|
5105
|
-
preflightExitCode,
|
|
5106
|
-
validateSeedAgainstSnapshot,
|
|
5107
|
-
formatSeedGateReport,
|
|
5108
|
-
seedGateExitCode,
|
|
5109
|
-
runSeedGateFromFile
|
|
4897
|
+
CatalogModule
|
|
5110
4898
|
};
|