@terreno/admin-backend 0.20.2 → 0.21.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.
@@ -509,6 +509,188 @@ var waitForScripts = function () { return new Promise(function (resolve) { retur
509
509
  });
510
510
  }); });
511
511
  });
512
+ (0, bun_test_1.describe)("GET /admin/scripts/runs", function () {
513
+ (0, bun_test_1.beforeEach)(function () { return __awaiter(void 0, void 0, void 0, function () {
514
+ return __generator(this, function (_a) {
515
+ switch (_a.label) {
516
+ case 0: return [4 /*yield*/, (0, tests_1.setupDb)()];
517
+ case 1:
518
+ _a.sent();
519
+ app = buildApp([
520
+ createTestScript({ description: "Migrate old data", name: "migrate-data" }),
521
+ createTestScript({ description: "Clean up orphans", name: "cleanup" }),
522
+ ]);
523
+ return [4 /*yield*/, (0, tests_1.authAsUser)(app, "admin")];
524
+ case 2:
525
+ adminAgent = _a.sent();
526
+ return [4 /*yield*/, (0, tests_1.authAsUser)(app, "notAdmin")];
527
+ case 3:
528
+ notAdminAgent = _a.sent();
529
+ return [2 /*return*/];
530
+ }
531
+ });
532
+ }); });
533
+ (0, bun_test_1.it)("returns runs for registered scripts, newest first", function () { return __awaiter(void 0, void 0, void 0, function () {
534
+ var res;
535
+ return __generator(this, function (_a) {
536
+ switch (_a.label) {
537
+ case 0: return [4 /*yield*/, adminAgent.post("/admin/scripts/migrate-data/run").expect(201)];
538
+ case 1:
539
+ _a.sent();
540
+ return [4 /*yield*/, adminAgent.post("/admin/scripts/cleanup/run?wetRun=true").expect(201)];
541
+ case 2:
542
+ _a.sent();
543
+ return [4 /*yield*/, waitForScripts()];
544
+ case 3:
545
+ _a.sent();
546
+ return [4 /*yield*/, adminAgent.get("/admin/scripts/runs").expect(200)];
547
+ case 4:
548
+ res = _a.sent();
549
+ (0, bun_test_1.expect)(res.body.data).toHaveLength(2);
550
+ (0, bun_test_1.expect)(res.body.total).toBe(2);
551
+ // Newest run (cleanup) is listed first.
552
+ (0, bun_test_1.expect)(res.body.data[0].taskType).toBe("cleanup");
553
+ (0, bun_test_1.expect)(res.body.data[1].taskType).toBe("migrate-data");
554
+ return [2 /*return*/];
555
+ }
556
+ });
557
+ }); });
558
+ (0, bun_test_1.it)("narrows history to a single script via the name query", function () { return __awaiter(void 0, void 0, void 0, function () {
559
+ var res;
560
+ return __generator(this, function (_a) {
561
+ switch (_a.label) {
562
+ case 0: return [4 /*yield*/, adminAgent.post("/admin/scripts/migrate-data/run").expect(201)];
563
+ case 1:
564
+ _a.sent();
565
+ return [4 /*yield*/, adminAgent.post("/admin/scripts/cleanup/run").expect(201)];
566
+ case 2:
567
+ _a.sent();
568
+ return [4 /*yield*/, waitForScripts()];
569
+ case 3:
570
+ _a.sent();
571
+ return [4 /*yield*/, adminAgent.get("/admin/scripts/runs?name=cleanup").expect(200)];
572
+ case 4:
573
+ res = _a.sent();
574
+ (0, bun_test_1.expect)(res.body.data).toHaveLength(1);
575
+ (0, bun_test_1.expect)(res.body.data[0].taskType).toBe("cleanup");
576
+ return [2 /*return*/];
577
+ }
578
+ });
579
+ }); });
580
+ (0, bun_test_1.it)("returns no runs when the name query is not a registered script", function () { return __awaiter(void 0, void 0, void 0, function () {
581
+ var res;
582
+ return __generator(this, function (_a) {
583
+ switch (_a.label) {
584
+ case 0: return [4 /*yield*/, adminAgent.post("/admin/scripts/migrate-data/run").expect(201)];
585
+ case 1:
586
+ _a.sent();
587
+ return [4 /*yield*/, adminAgent.post("/admin/scripts/cleanup/run").expect(201)];
588
+ case 2:
589
+ _a.sent();
590
+ return [4 /*yield*/, waitForScripts()];
591
+ case 3:
592
+ _a.sent();
593
+ return [4 /*yield*/, adminAgent.get("/admin/scripts/runs?name=does-not-exist").expect(200)];
594
+ case 4:
595
+ res = _a.sent();
596
+ (0, bun_test_1.expect)(res.body.data).toHaveLength(0);
597
+ (0, bun_test_1.expect)(res.body.total).toBe(0);
598
+ return [2 /*return*/];
599
+ }
600
+ });
601
+ }); });
602
+ (0, bun_test_1.it)("excludes tasks whose taskType is not a registered script", function () { return __awaiter(void 0, void 0, void 0, function () {
603
+ var res;
604
+ return __generator(this, function (_a) {
605
+ switch (_a.label) {
606
+ case 0: return [4 /*yield*/, api_1.BackgroundTask.create({
607
+ isDryRun: false,
608
+ logs: [],
609
+ status: "completed",
610
+ taskType: "some-other-task",
611
+ })];
612
+ case 1:
613
+ _a.sent();
614
+ return [4 /*yield*/, adminAgent.post("/admin/scripts/migrate-data/run").expect(201)];
615
+ case 2:
616
+ _a.sent();
617
+ return [4 /*yield*/, waitForScripts()];
618
+ case 3:
619
+ _a.sent();
620
+ return [4 /*yield*/, adminAgent.get("/admin/scripts/runs").expect(200)];
621
+ case 4:
622
+ res = _a.sent();
623
+ (0, bun_test_1.expect)(res.body.data).toHaveLength(1);
624
+ (0, bun_test_1.expect)(res.body.data[0].taskType).toBe("migrate-data");
625
+ return [2 /*return*/];
626
+ }
627
+ });
628
+ }); });
629
+ (0, bun_test_1.it)("paginates and reports `more`", function () { return __awaiter(void 0, void 0, void 0, function () {
630
+ var res;
631
+ return __generator(this, function (_a) {
632
+ switch (_a.label) {
633
+ case 0: return [4 /*yield*/, adminAgent.post("/admin/scripts/migrate-data/run").expect(201)];
634
+ case 1:
635
+ _a.sent();
636
+ return [4 /*yield*/, adminAgent.post("/admin/scripts/cleanup/run").expect(201)];
637
+ case 2:
638
+ _a.sent();
639
+ return [4 /*yield*/, waitForScripts()];
640
+ case 3:
641
+ _a.sent();
642
+ return [4 /*yield*/, adminAgent.get("/admin/scripts/runs?limit=1&page=1").expect(200)];
643
+ case 4:
644
+ res = _a.sent();
645
+ (0, bun_test_1.expect)(res.body.data).toHaveLength(1);
646
+ (0, bun_test_1.expect)(res.body.limit).toBe(1);
647
+ (0, bun_test_1.expect)(res.body.more).toBe(true);
648
+ (0, bun_test_1.expect)(res.body.total).toBe(2);
649
+ return [2 /*return*/];
650
+ }
651
+ });
652
+ }); });
653
+ (0, bun_test_1.it)("includes the triggering admin's display name", function () { return __awaiter(void 0, void 0, void 0, function () {
654
+ var res;
655
+ return __generator(this, function (_a) {
656
+ switch (_a.label) {
657
+ case 0: return [4 /*yield*/, adminAgent.post("/admin/scripts/migrate-data/run").expect(201)];
658
+ case 1:
659
+ _a.sent();
660
+ return [4 /*yield*/, waitForScripts()];
661
+ case 2:
662
+ _a.sent();
663
+ return [4 /*yield*/, adminAgent.get("/admin/scripts/runs").expect(200)];
664
+ case 3:
665
+ res = _a.sent();
666
+ (0, bun_test_1.expect)(res.body.data[0].createdByName).toBeDefined();
667
+ return [2 /*return*/];
668
+ }
669
+ });
670
+ }); });
671
+ (0, bun_test_1.it)("returns 403 for non-admin user", function () { return __awaiter(void 0, void 0, void 0, function () {
672
+ var res;
673
+ return __generator(this, function (_a) {
674
+ switch (_a.label) {
675
+ case 0: return [4 /*yield*/, notAdminAgent.get("/admin/scripts/runs").expect(403)];
676
+ case 1:
677
+ res = _a.sent();
678
+ (0, bun_test_1.expect)(res.body.title).toInclude("Only admins can view run history");
679
+ return [2 /*return*/];
680
+ }
681
+ });
682
+ }); });
683
+ (0, bun_test_1.it)("returns 401 for unauthenticated user", function () { return __awaiter(void 0, void 0, void 0, function () {
684
+ return __generator(this, function (_a) {
685
+ switch (_a.label) {
686
+ case 0: return [4 /*yield*/, (0, supertest_1.default)(app).get("/admin/scripts/runs").expect(401)];
687
+ case 1:
688
+ _a.sent();
689
+ return [2 /*return*/];
690
+ }
691
+ });
692
+ }); });
693
+ });
512
694
  (0, bun_test_1.describe)("GET /admin/config with scripts", function () {
513
695
  (0, bun_test_1.beforeEach)(function () { return __awaiter(void 0, void 0, void 0, function () {
514
696
  return __generator(this, function (_a) {
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Admin UI v2 helpers and constants (Django-parity config contract).
3
+ * @see docs/implementationPlans/admin-ui-v2-django-parity.md
4
+ */
5
+ export declare const ADMIN_SCHEMA_VERSION = 2;
6
+ export declare const MAX_BULK_PATCH_IDS = 1000;
7
+ export declare const SYSTEM_ADMIN_FIELDS: Set<string>;
8
+ export interface AdminHomeSlotsInput {
9
+ contentTop?: string[];
10
+ main?: string[];
11
+ navGlobal?: string[];
12
+ sidebar?: string[];
13
+ }
14
+ export interface AdminHomeInput {
15
+ slots?: AdminHomeSlotsInput;
16
+ title?: string;
17
+ /** Legacy: widget ids treated as main column when slots omitted */
18
+ widgets?: string[];
19
+ }
20
+ export interface AdminHomeNormalized {
21
+ slots: {
22
+ contentTop?: string[];
23
+ main?: string[];
24
+ navGlobal?: string[];
25
+ sidebar?: string[];
26
+ };
27
+ title: string;
28
+ }
29
+ export declare const normalizeSidebarRecentLast: (sidebar?: string[]) => string[] | undefined;
30
+ export declare const normalizeAdminHome: (home?: AdminHomeInput) => AdminHomeNormalized;
31
+ export interface AdminListFilterBoolean {
32
+ field: string;
33
+ kind: "boolean";
34
+ label?: string;
35
+ }
36
+ export interface AdminListFilterChoice {
37
+ choices: {
38
+ label: string;
39
+ value: string;
40
+ }[];
41
+ field: string;
42
+ kind: "choice";
43
+ label?: string;
44
+ }
45
+ export interface AdminListFilterDateRange {
46
+ field: string;
47
+ kind: "dateRange";
48
+ label?: string;
49
+ }
50
+ export interface AdminListFilterRef {
51
+ field: string;
52
+ kind: "ref";
53
+ label?: string;
54
+ refModel?: string;
55
+ }
56
+ export interface AdminListFilterText {
57
+ field: string;
58
+ kind: "text";
59
+ label?: string;
60
+ }
61
+ export type AdminListFilter = AdminListFilterBoolean | AdminListFilterChoice | AdminListFilterDateRange | AdminListFilterRef | AdminListFilterText;
62
+ /** Inputs shared by admin config and {@link buildAdminModelQueryFields}. */
63
+ export interface AdminModelQueryFieldSource {
64
+ filters?: AdminListFilter[];
65
+ listDisplay?: string[];
66
+ listFields: string[];
67
+ searchFields?: string[];
68
+ }
69
+ /**
70
+ * Derives `modelRouter` `queryFields` from admin UI v2 list metadata so changelist
71
+ * filters and sort keys match allowed query parameters on `GET` list routes.
72
+ */
73
+ export declare const buildAdminModelQueryFields: (config: AdminModelQueryFieldSource) => string[];
74
+ export interface AdminFieldsetInput {
75
+ fields: string[];
76
+ title: string;
77
+ }
78
+ export interface AdminActionInput {
79
+ background?: boolean;
80
+ confirm?: string;
81
+ id: string;
82
+ label: string;
83
+ /** Keys allowed for synchronous bulk-patch actions */
84
+ patchKeys?: string[];
85
+ }
86
+ export interface AdminModelPermissionsInput {
87
+ create?: boolean;
88
+ delete?: boolean;
89
+ update?: boolean;
90
+ }
91
+ export declare const defaultBulkPatchAllowlistFrom: (params: {
92
+ hiddenFieldSet: Set<string>;
93
+ listFields: string[];
94
+ readonlyFields: string[];
95
+ schemaPaths: Set<string>;
96
+ }) => string[];
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ /**
3
+ * Admin UI v2 helpers and constants (Django-parity config contract).
4
+ * @see docs/implementationPlans/admin-ui-v2-django-parity.md
5
+ */
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __read = (this && this.__read) || function (o, n) {
18
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
19
+ if (!m) return o;
20
+ var i = m.call(o), r, ar = [], e;
21
+ try {
22
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
23
+ }
24
+ catch (error) { e = { error: error }; }
25
+ finally {
26
+ try {
27
+ if (r && !r.done && (m = i["return"])) m.call(i);
28
+ }
29
+ finally { if (e) throw e.error; }
30
+ }
31
+ return ar;
32
+ };
33
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
34
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
35
+ if (ar || !(i in from)) {
36
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
37
+ ar[i] = from[i];
38
+ }
39
+ }
40
+ return to.concat(ar || Array.prototype.slice.call(from));
41
+ };
42
+ var __values = (this && this.__values) || function(o) {
43
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
44
+ if (m) return m.call(o);
45
+ if (o && typeof o.length === "number") return {
46
+ next: function () {
47
+ if (o && i >= o.length) o = void 0;
48
+ return { value: o && o[i++], done: !o };
49
+ }
50
+ };
51
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.defaultBulkPatchAllowlistFrom = exports.buildAdminModelQueryFields = exports.normalizeAdminHome = exports.normalizeSidebarRecentLast = exports.SYSTEM_ADMIN_FIELDS = exports.MAX_BULK_PATCH_IDS = exports.ADMIN_SCHEMA_VERSION = void 0;
55
+ exports.ADMIN_SCHEMA_VERSION = 2;
56
+ exports.MAX_BULK_PATCH_IDS = 1000;
57
+ exports.SYSTEM_ADMIN_FIELDS = new Set(["_id", "id", "__v", "created", "updated", "deleted"]);
58
+ var normalizeSidebarRecentLast = function (sidebar) {
59
+ if (!sidebar || sidebar.length === 0) {
60
+ return sidebar;
61
+ }
62
+ if (!sidebar.includes("recentActivity")) {
63
+ return sidebar;
64
+ }
65
+ var without = sidebar.filter(function (id) { return id !== "recentActivity"; });
66
+ return __spreadArray(__spreadArray([], __read(without), false), ["recentActivity"], false);
67
+ };
68
+ exports.normalizeSidebarRecentLast = normalizeSidebarRecentLast;
69
+ var normalizeAdminHome = function (home) {
70
+ var _a;
71
+ var title = (_a = home === null || home === void 0 ? void 0 : home.title) !== null && _a !== void 0 ? _a : "Administration";
72
+ if (home === null || home === void 0 ? void 0 : home.slots) {
73
+ return {
74
+ slots: __assign(__assign({}, home.slots), { sidebar: (0, exports.normalizeSidebarRecentLast)(home.slots.sidebar) }),
75
+ title: title,
76
+ };
77
+ }
78
+ if ((home === null || home === void 0 ? void 0 : home.widgets) && home.widgets.length > 0) {
79
+ var main = home.widgets.includes("modelsGrid")
80
+ ? __spreadArray([], __read(home.widgets), false) : __spreadArray(["modelsGrid"], __read(home.widgets), false);
81
+ return {
82
+ slots: { main: main },
83
+ title: title,
84
+ };
85
+ }
86
+ return {
87
+ slots: { main: ["modelsGrid"] },
88
+ title: title,
89
+ };
90
+ };
91
+ exports.normalizeAdminHome = normalizeAdminHome;
92
+ /**
93
+ * Derives `modelRouter` `queryFields` from admin UI v2 list metadata so changelist
94
+ * filters and sort keys match allowed query parameters on `GET` list routes.
95
+ */
96
+ var buildAdminModelQueryFields = function (config) {
97
+ var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
98
+ var _e, _f, _g;
99
+ var fields = new Set(["_id"]);
100
+ try {
101
+ for (var _h = __values(config.listFields), _j = _h.next(); !_j.done; _j = _h.next()) {
102
+ var name_1 = _j.value;
103
+ fields.add(name_1);
104
+ }
105
+ }
106
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
107
+ finally {
108
+ try {
109
+ if (_j && !_j.done && (_a = _h.return)) _a.call(_h);
110
+ }
111
+ finally { if (e_1) throw e_1.error; }
112
+ }
113
+ try {
114
+ for (var _k = __values((_e = config.listDisplay) !== null && _e !== void 0 ? _e : []), _l = _k.next(); !_l.done; _l = _k.next()) {
115
+ var name_2 = _l.value;
116
+ fields.add(name_2);
117
+ }
118
+ }
119
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
120
+ finally {
121
+ try {
122
+ if (_l && !_l.done && (_b = _k.return)) _b.call(_k);
123
+ }
124
+ finally { if (e_2) throw e_2.error; }
125
+ }
126
+ try {
127
+ for (var _m = __values((_f = config.searchFields) !== null && _f !== void 0 ? _f : []), _o = _m.next(); !_o.done; _o = _m.next()) {
128
+ var name_3 = _o.value;
129
+ fields.add(name_3);
130
+ }
131
+ }
132
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
133
+ finally {
134
+ try {
135
+ if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
136
+ }
137
+ finally { if (e_3) throw e_3.error; }
138
+ }
139
+ try {
140
+ for (var _p = __values((_g = config.filters) !== null && _g !== void 0 ? _g : []), _q = _p.next(); !_q.done; _q = _p.next()) {
141
+ var filter = _q.value;
142
+ fields.add(filter.field);
143
+ if (filter.kind === "dateRange") {
144
+ fields.add("".concat(filter.field, "_gte"));
145
+ fields.add("".concat(filter.field, "_lte"));
146
+ }
147
+ }
148
+ }
149
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
150
+ finally {
151
+ try {
152
+ if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
153
+ }
154
+ finally { if (e_4) throw e_4.error; }
155
+ }
156
+ return __spreadArray([], __read(fields), false);
157
+ };
158
+ exports.buildAdminModelQueryFields = buildAdminModelQueryFields;
159
+ var defaultBulkPatchAllowlistFrom = function (params) {
160
+ var e_5, _a;
161
+ var out = [];
162
+ try {
163
+ for (var _b = __values(params.listFields), _c = _b.next(); !_c.done; _c = _b.next()) {
164
+ var field = _c.value;
165
+ if (exports.SYSTEM_ADMIN_FIELDS.has(field)) {
166
+ continue;
167
+ }
168
+ if (params.hiddenFieldSet.has(field)) {
169
+ continue;
170
+ }
171
+ if (params.readonlyFields.includes(field)) {
172
+ continue;
173
+ }
174
+ if (!params.schemaPaths.has(field)) {
175
+ continue;
176
+ }
177
+ out.push(field);
178
+ }
179
+ }
180
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
181
+ finally {
182
+ try {
183
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
184
+ }
185
+ finally { if (e_5) throw e_5.error; }
186
+ }
187
+ return out;
188
+ };
189
+ exports.defaultBulkPatchAllowlistFrom = defaultBulkPatchAllowlistFrom;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var bun_test_1 = require("bun:test");
4
+ var adminUiV2_1 = require("./adminUiV2");
5
+ (0, bun_test_1.describe)("buildAdminModelQueryFields", function () {
6
+ (0, bun_test_1.it)("includes _id, list fields, listDisplay, searchFields, and filter fields", function () {
7
+ var fields = (0, adminUiV2_1.buildAdminModelQueryFields)({
8
+ filters: [
9
+ { field: "completed", kind: "boolean" },
10
+ { choices: [{ label: "L", value: "low" }], field: "priority", kind: "choice" },
11
+ { field: "created", kind: "dateRange" },
12
+ ],
13
+ listDisplay: ["title", "created"],
14
+ listFields: ["title", "ownerId"],
15
+ searchFields: ["tags"],
16
+ });
17
+ (0, bun_test_1.expect)(fields).toContain("_id");
18
+ (0, bun_test_1.expect)(fields).toContain("title");
19
+ (0, bun_test_1.expect)(fields).toContain("ownerId");
20
+ (0, bun_test_1.expect)(fields).toContain("created");
21
+ (0, bun_test_1.expect)(fields).toContain("tags");
22
+ (0, bun_test_1.expect)(fields).toContain("completed");
23
+ (0, bun_test_1.expect)(fields).toContain("priority");
24
+ (0, bun_test_1.expect)(fields).toContain("created_gte");
25
+ (0, bun_test_1.expect)(fields).toContain("created_lte");
26
+ (0, bun_test_1.expect)(new Set(fields).size).toBe(fields.length);
27
+ });
28
+ });
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export type { AdminModelConfig, AdminOptions, AdminScriptConfig } from "./adminApp";
1
+ export type { AdminAuditEvent, AdminCustomScreenConfig, AdminFieldOverride, AdminModelConfig, AdminOptions, AdminScriptConfig, } from "./adminApp";
2
2
  export { AdminApp } from "./adminApp";
3
+ export * from "./adminUiV2";
3
4
  export type { DocumentFile, DocumentListResponse, DocumentStorageOptions, } from "./documentStorageApp";
4
5
  export { DocumentStorageApp } from "./documentStorageApp";
package/dist/index.js CHANGED
@@ -1,7 +1,22 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.DocumentStorageApp = exports.AdminApp = void 0;
4
18
  var adminApp_1 = require("./adminApp");
5
19
  Object.defineProperty(exports, "AdminApp", { enumerable: true, get: function () { return adminApp_1.AdminApp; } });
20
+ __exportStar(require("./adminUiV2"), exports);
6
21
  var documentStorageApp_1 = require("./documentStorageApp");
7
22
  Object.defineProperty(exports, "DocumentStorageApp", { enumerable: true, get: function () { return documentStorageApp_1.DocumentStorageApp; } });
File without changes
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Preload before `api/src/tests/bunSetup.ts` so admin-backend tests use
4
+ * mongodb-memory-server (see TERRENO_TEST_USE_MEMORY_MONGO in that file).
5
+ */
6
+ process.env.TERRENO_TEST_USE_MEMORY_MONGO = "true";
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@google-cloud/storage": "^7.15.0",
8
- "@terreno/api": "0.20.2",
8
+ "@terreno/api": "0.21.0",
9
9
  "express": "^5.2.1",
10
10
  "luxon": "^3.7.2",
11
11
  "multer": "2.1.1"
@@ -19,6 +19,7 @@
19
19
  "@types/multer": "^1.4.12",
20
20
  "@types/supertest": "^6.0.2",
21
21
  "passport-local-mongoose": "^9.0.1",
22
+ "mongodb-memory-server": "^11.0.1",
22
23
  "supertest": "^7.0.0",
23
24
  "typescript": "~5.9.2"
24
25
  },
@@ -48,10 +49,10 @@
48
49
  "dev": "bun tsc -w",
49
50
  "lint": "biome check ./src",
50
51
  "lint:fix": "biome check --write ./src",
51
- "test": "bun test",
52
- "test:ci": "bun test",
52
+ "test": "bun test --timeout=120000",
53
+ "test:ci": "bun test --timeout=120000",
53
54
  "test:coverage": "bun run ../scripts/check-coverage.ts"
54
55
  },
55
56
  "types": "dist/index.d.ts",
56
- "version": "0.20.2"
57
+ "version": "0.21.0"
57
58
  }