@synnaxlabs/x 0.49.3 → 0.52.3
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/.turbo/turbo-build.log +10 -10
- package/dist/eslint.config.d.ts +2 -2
- package/dist/eslint.config.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +26 -2
- package/dist/src/color/color.d.ts.map +1 -1
- package/dist/src/color/gradient.d.ts +10 -0
- package/dist/src/color/gradient.d.ts.map +1 -1
- package/dist/src/color/palette.d.ts +22 -2
- package/dist/src/color/palette.d.ts.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/label/label.d.ts +15 -1
- package/dist/src/label/label.d.ts.map +1 -1
- package/dist/src/record/record.d.ts +23 -9
- package/dist/src/record/record.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +5 -0
- package/dist/src/status/status.d.ts.map +1 -1
- package/dist/src/sync/mutex.d.ts +3 -3
- package/dist/src/zod/util.d.ts +2 -0
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/x.cjs +11 -8
- package/dist/x.js +1106 -1129
- package/eslint.config.ts +3 -3
- package/package.json +9 -8
- package/src/array/external.ts +1 -1
- package/src/array/index.ts +1 -1
- package/src/array/nullable.ts +1 -1
- package/src/array/toArray.spec.ts +1 -1
- package/src/array/toArray.ts +1 -1
- package/src/array/update.spec.ts +1 -1
- package/src/array/update.ts +1 -1
- package/src/binary/codec.spec.ts +1 -1
- package/src/binary/codec.ts +1 -1
- package/src/binary/index.ts +1 -1
- package/src/breaker/breaker.spec.ts +1 -1
- package/src/breaker/breaker.ts +1 -1
- package/src/breaker/index.ts +1 -1
- package/src/caseconv/caseconv.spec.ts +1 -1
- package/src/caseconv/caseconv.ts +1 -1
- package/src/caseconv/index.ts +1 -1
- package/src/change/change.ts +1 -1
- package/src/change/index.ts +1 -1
- package/src/clamp/clamp.ts +1 -1
- package/src/color/color.spec.ts +27 -2
- package/src/color/color.ts +10 -4
- package/src/color/external.ts +1 -1
- package/src/color/gradient.ts +1 -1
- package/src/color/index.ts +1 -1
- package/src/color/palette.ts +1 -1
- package/src/compare/binary.spec.ts +1 -1
- package/src/compare/binary.ts +1 -1
- package/src/compare/compare.spec.ts +1 -1
- package/src/compare/compare.ts +1 -1
- package/src/compare/external.ts +1 -1
- package/src/compare/index.ts +1 -1
- package/src/control/control.ts +1 -1
- package/src/control/index.ts +1 -1
- package/src/csv/csv.spec.ts +1 -1
- package/src/csv/csv.ts +1 -1
- package/src/csv/index.ts +1 -1
- package/src/debounce/debounce.spec.ts +1 -1
- package/src/debounce/debounce.ts +1 -1
- package/src/debounce/index.ts +1 -1
- package/src/deep/copy.spec.ts +1 -1
- package/src/deep/copy.ts +1 -1
- package/src/deep/difference.spec.ts +1 -1
- package/src/deep/difference.ts +1 -1
- package/src/deep/equal.spec.ts +1 -1
- package/src/deep/equal.ts +1 -1
- package/src/deep/external.ts +1 -1
- package/src/deep/get.bench.ts +1 -1
- package/src/deep/get.spec.ts +1 -1
- package/src/deep/get.ts +1 -1
- package/src/deep/index.ts +1 -1
- package/src/deep/join.ts +1 -1
- package/src/deep/merge.spec.ts +1 -1
- package/src/deep/merge.ts +1 -1
- package/src/deep/partial.spec.ts +1 -1
- package/src/deep/partial.ts +1 -1
- package/src/deep/path.spec.ts +1 -1
- package/src/deep/path.ts +1 -1
- package/src/deep/remove.bench.ts +1 -1
- package/src/deep/remove.spec.ts +1 -1
- package/src/deep/remove.ts +1 -1
- package/src/deep/set.bench.ts +1 -1
- package/src/deep/set.spec.ts +1 -1
- package/src/deep/set.ts +1 -1
- package/src/destructor/destructor.ts +1 -1
- package/src/destructor/index.ts +1 -1
- package/src/errors/errors.spec.ts +1 -1
- package/src/errors/errors.ts +1 -1
- package/src/errors/index.ts +1 -1
- package/src/id/id.spec.ts +1 -1
- package/src/id/id.ts +1 -1
- package/src/id/index.ts +1 -1
- package/src/index.ts +1 -2
- package/src/instance/index.ts +1 -1
- package/src/instance/matcher.spec.ts +1 -1
- package/src/instance/matcher.ts +1 -1
- package/src/kv/external.ts +1 -1
- package/src/kv/index.ts +1 -1
- package/src/kv/mock.spec.ts +1 -1
- package/src/kv/mock.ts +1 -1
- package/src/kv/types.ts +2 -4
- package/src/label/index.ts +1 -1
- package/src/label/label.ts +4 -2
- package/src/link/index.ts +1 -1
- package/src/link/link.spec.ts +1 -1
- package/src/link/link.ts +1 -1
- package/src/map/index.ts +1 -1
- package/src/map/map.spec.ts +1 -1
- package/src/map/map.ts +1 -1
- package/src/math/constants.ts +1 -1
- package/src/math/external.ts +1 -1
- package/src/math/index.ts +1 -1
- package/src/math/math.spec.ts +1 -1
- package/src/math/math.ts +1 -1
- package/src/math/round.spec.ts +1 -1
- package/src/math/round.ts +1 -1
- package/src/migrate/index.ts +1 -1
- package/src/migrate/migrate.spec.ts +1 -1
- package/src/migrate/migrate.ts +5 -5
- package/src/mock/MockGLBufferController.ts +1 -1
- package/src/narrow/index.ts +1 -1
- package/src/narrow/narrow.spec.ts +1 -1
- package/src/narrow/narrow.ts +1 -1
- package/src/notation/index.ts +1 -1
- package/src/notation/notation.spec.ts +1 -1
- package/src/notation/notation.ts +1 -1
- package/src/numeric/index.ts +1 -1
- package/src/numeric/numeric.ts +1 -1
- package/src/observe/index.ts +1 -1
- package/src/observe/observe.ts +1 -1
- package/src/observe/obsever.spec.ts +1 -1
- package/src/optional/index.ts +1 -1
- package/src/optional/optional.ts +1 -1
- package/src/primitive/index.ts +1 -1
- package/src/primitive/primitive.spec.ts +1 -1
- package/src/primitive/primitive.ts +1 -1
- package/src/record/index.ts +1 -1
- package/src/record/record.spec.ts +32 -18
- package/src/record/record.ts +30 -14
- package/src/runtime/detect.ts +1 -1
- package/src/runtime/external.ts +1 -1
- package/src/runtime/index.ts +1 -1
- package/src/runtime/os.ts +1 -1
- package/src/scheduler/index.ts +1 -1
- package/src/scheduler/scheduler.spec.ts +1 -1
- package/src/scheduler/scheduler.ts +1 -1
- package/src/shallow/copy.spec.ts +1 -1
- package/src/shallow/copy.ts +1 -1
- package/src/shallow/index.ts +1 -1
- package/src/singleton/define.spec.ts +1 -1
- package/src/singleton/define.ts +1 -1
- package/src/singleton/index.ts +1 -1
- package/src/sleep/index.ts +1 -1
- package/src/sleep/sleep.ts +1 -1
- package/src/spatial/base.ts +1 -1
- package/src/spatial/bounds/bounds.spec.ts +1 -1
- package/src/spatial/bounds/bounds.ts +1 -1
- package/src/spatial/bounds/index.ts +1 -1
- package/src/spatial/box/box.spec.ts +1 -1
- package/src/spatial/box/box.ts +1 -1
- package/src/spatial/box/index.ts +1 -1
- package/src/spatial/dimensions/dimensions.spec.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +1 -1
- package/src/spatial/dimensions/index.ts +1 -1
- package/src/spatial/direction/direction.spec.ts +1 -1
- package/src/spatial/direction/direction.ts +1 -1
- package/src/spatial/direction/index.ts +1 -1
- package/src/spatial/external.ts +1 -1
- package/src/spatial/index.ts +1 -1
- package/src/spatial/location/index.ts +1 -1
- package/src/spatial/location/location.spec.ts +1 -1
- package/src/spatial/location/location.ts +1 -1
- package/src/spatial/scale/index.ts +1 -1
- package/src/spatial/scale/scale.spec.ts +1 -1
- package/src/spatial/scale/scale.ts +1 -1
- package/src/spatial/spatial.ts +1 -1
- package/src/spatial/sticky/index.ts +1 -1
- package/src/spatial/sticky/sticky.spec.ts +1 -1
- package/src/spatial/sticky/sticky.ts +1 -1
- package/src/spatial/xy/index.ts +1 -1
- package/src/spatial/xy/xy.spec.ts +1 -1
- package/src/spatial/xy/xy.ts +1 -1
- package/src/status/index.ts +1 -1
- package/src/status/status.spec.ts +168 -1
- package/src/status/status.ts +47 -1
- package/src/strings/deduplicateFileName.spec.ts +1 -1
- package/src/strings/deduplicateFileName.ts +1 -1
- package/src/strings/external.ts +1 -1
- package/src/strings/index.ts +1 -1
- package/src/strings/strings.spec.ts +1 -1
- package/src/strings/strings.ts +1 -1
- package/src/sync/index.ts +1 -1
- package/src/sync/mutex.ts +4 -4
- package/src/telem/gl.ts +1 -1
- package/src/telem/index.ts +1 -1
- package/src/telem/series.spec.ts +1 -1
- package/src/telem/series.ts +4 -4
- package/src/telem/telem.spec.ts +1 -1
- package/src/telem/telem.ts +1 -1
- package/src/testutil/index.ts +1 -1
- package/src/testutil/testutil.spec.ts +1 -1
- package/src/testutil/testutil.ts +1 -1
- package/src/types/index.ts +1 -1
- package/src/unique/index.ts +1 -1
- package/src/unique/unique.spec.ts +1 -1
- package/src/unique/unique.ts +1 -1
- package/src/url/index.ts +1 -1
- package/src/url/url.spec.ts +1 -1
- package/src/url/url.ts +1 -1
- package/src/uuid/index.ts +1 -1
- package/src/uuid/uuid.spec.ts +1 -1
- package/src/uuid/uuid.ts +1 -1
- package/src/worker/index.ts +1 -1
- package/src/worker/worker.spec.ts +1 -1
- package/src/worker/worker.ts +1 -1
- package/src/zod/external.ts +1 -1
- package/src/zod/index.ts +1 -1
- package/src/zod/nullToUndefined.spec.ts +1 -1
- package/src/zod/nullToUndefined.ts +1 -1
- package/src/zod/schemas.spec.ts +1 -1
- package/src/zod/schemas.ts +1 -1
- package/src/zod/toArray.spec.ts +1 -1
- package/src/zod/toArray.ts +1 -1
- package/src/zod/util.spec.ts +31 -1
- package/src/zod/util.ts +14 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +1 -2
- package/dist/src/jsonrpc/index.d.ts +0 -2
- package/dist/src/jsonrpc/index.d.ts.map +0 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts +0 -70
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +0 -1
- package/dist/src/jsonrpc/jsonrpc.spec.d.ts +0 -2
- package/dist/src/jsonrpc/jsonrpc.spec.d.ts.map +0 -1
- package/src/jsonrpc/index.ts +0 -10
- package/src/jsonrpc/jsonrpc.spec.ts +0 -135
- package/src/jsonrpc/jsonrpc.ts +0 -125
package/src/shallow/copy.ts
CHANGED
package/src/shallow/index.ts
CHANGED
package/src/singleton/define.ts
CHANGED
package/src/singleton/index.ts
CHANGED
package/src/sleep/index.ts
CHANGED
package/src/sleep/sleep.ts
CHANGED
package/src/spatial/base.ts
CHANGED
package/src/spatial/box/box.ts
CHANGED
package/src/spatial/box/index.ts
CHANGED
package/src/spatial/external.ts
CHANGED
package/src/spatial/index.ts
CHANGED
package/src/spatial/spatial.ts
CHANGED
package/src/spatial/xy/index.ts
CHANGED
package/src/spatial/xy/xy.ts
CHANGED
package/src/status/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
10
|
import { describe, expect, it } from "vitest";
|
|
11
|
+
import { z } from "zod";
|
|
11
12
|
|
|
12
13
|
import { id } from "@/id";
|
|
13
14
|
import { status } from "@/status";
|
|
@@ -129,4 +130,170 @@ describe("status", () => {
|
|
|
129
130
|
expect(result.success).toBe(true);
|
|
130
131
|
});
|
|
131
132
|
});
|
|
133
|
+
|
|
134
|
+
describe("toString", () => {
|
|
135
|
+
it("should format a basic status with variant and message", () => {
|
|
136
|
+
const s = status.create({ variant: "success", message: "Operation completed" });
|
|
137
|
+
const result = status.toString(s);
|
|
138
|
+
expect(result).toBe("SUCCESS: Operation completed");
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("should include name when present and includeName is true", () => {
|
|
142
|
+
const s = status.create({
|
|
143
|
+
variant: "info",
|
|
144
|
+
message: "System started",
|
|
145
|
+
name: "SystemStatus",
|
|
146
|
+
});
|
|
147
|
+
const result = status.toString(s);
|
|
148
|
+
expect(result).toBe("INFO [SystemStatus]: System started");
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it("should exclude name when includeName is false", () => {
|
|
152
|
+
const s = status.create({
|
|
153
|
+
variant: "warning",
|
|
154
|
+
message: "Low memory",
|
|
155
|
+
name: "MemoryMonitor",
|
|
156
|
+
});
|
|
157
|
+
const result = status.toString(s, { includeName: false });
|
|
158
|
+
expect(result).toBe("WARNING: Low memory");
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("should include timestamp when includeTimestamp is true", () => {
|
|
162
|
+
const s = status.create({ variant: "error", message: "Failed" });
|
|
163
|
+
const result = status.toString(s, { includeTimestamp: true });
|
|
164
|
+
expect(result).toMatch(/^ERROR: Failed \(.+\)$/);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it("should format plain text description", () => {
|
|
168
|
+
const s = status.create({
|
|
169
|
+
variant: "error",
|
|
170
|
+
message: "Connection failed",
|
|
171
|
+
description: "Unable to reach server at localhost:9090",
|
|
172
|
+
});
|
|
173
|
+
const result = status.toString(s);
|
|
174
|
+
expect(result).toBe(
|
|
175
|
+
"ERROR: Connection failed\n\nDescription: Unable to reach server at localhost:9090",
|
|
176
|
+
);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it("should pretty-print JSON description", () => {
|
|
180
|
+
const s = status.create({
|
|
181
|
+
variant: "error",
|
|
182
|
+
message: "Validation failed",
|
|
183
|
+
description: JSON.stringify({ field: "email", reason: "invalid format" }),
|
|
184
|
+
});
|
|
185
|
+
const result = status.toString(s);
|
|
186
|
+
expect(result).toContain("ERROR: Validation failed");
|
|
187
|
+
expect(result).toContain("Description:");
|
|
188
|
+
expect(result).toContain('"field": "email"');
|
|
189
|
+
expect(result).toContain('"reason": "invalid format"');
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it("should include stack trace from exception details", () => {
|
|
193
|
+
const error = new Error("Something went wrong");
|
|
194
|
+
const s = status.fromException(error);
|
|
195
|
+
const result = status.toString(s);
|
|
196
|
+
expect(result).toContain("ERROR: Something went wrong");
|
|
197
|
+
expect(result).toContain("Stack Trace:");
|
|
198
|
+
expect(result).toContain("Error: Something went wrong");
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it("should handle all variants", () => {
|
|
202
|
+
const variants: status.Variant[] = [
|
|
203
|
+
"success",
|
|
204
|
+
"info",
|
|
205
|
+
"warning",
|
|
206
|
+
"error",
|
|
207
|
+
"loading",
|
|
208
|
+
"disabled",
|
|
209
|
+
];
|
|
210
|
+
for (const variant of variants) {
|
|
211
|
+
const s = status.create({ variant, message: "Test message" });
|
|
212
|
+
const result = status.toString(s);
|
|
213
|
+
expect(result).toBe(`${variant.toUpperCase()}: Test message`);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it("should handle status with all optional fields", () => {
|
|
218
|
+
const error = new Error("Full error");
|
|
219
|
+
const s = status.fromException(error, "Custom message");
|
|
220
|
+
s.name = "ErrorHandler";
|
|
221
|
+
const result = status.toString(s, { includeTimestamp: true });
|
|
222
|
+
expect(result).toContain("ERROR [ErrorHandler]: Custom message");
|
|
223
|
+
expect(result).toContain("Description: Full error");
|
|
224
|
+
expect(result).toContain("Stack Trace:");
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it("should not include name brackets when name is empty string", () => {
|
|
228
|
+
const s = status.create({ variant: "success", message: "Done" });
|
|
229
|
+
const result = status.toString(s);
|
|
230
|
+
expect(result).toBe("SUCCESS: Done");
|
|
231
|
+
expect(result).not.toContain("[]");
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it("should include extra details beyond stack trace", () => {
|
|
235
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
236
|
+
const detailsSchema = z.object({
|
|
237
|
+
statusCode: z.number(),
|
|
238
|
+
endpoint: z.string(),
|
|
239
|
+
requestId: z.string(),
|
|
240
|
+
});
|
|
241
|
+
const s = status.create<typeof detailsSchema>({
|
|
242
|
+
variant: "error",
|
|
243
|
+
message: "Request failed",
|
|
244
|
+
details: {
|
|
245
|
+
statusCode: 404,
|
|
246
|
+
endpoint: "/api/users",
|
|
247
|
+
requestId: "abc-123",
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
const result = status.toString(s);
|
|
251
|
+
expect(result).toContain("ERROR: Request failed");
|
|
252
|
+
expect(result).toContain("Details:");
|
|
253
|
+
expect(result).toContain('"statusCode": 404');
|
|
254
|
+
expect(result).toContain('"endpoint": "/api/users"');
|
|
255
|
+
expect(result).toContain('"requestId": "abc-123"');
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("should include both stack trace and extra details separately", () => {
|
|
259
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
260
|
+
const detailsSchema = z.object({
|
|
261
|
+
stack: z.string(),
|
|
262
|
+
query: z.string(),
|
|
263
|
+
duration: z.number(),
|
|
264
|
+
});
|
|
265
|
+
const s = status.create<typeof detailsSchema>({
|
|
266
|
+
variant: "error",
|
|
267
|
+
message: "Database error",
|
|
268
|
+
details: {
|
|
269
|
+
stack: "Error: Database error\n at query (db.ts:10)",
|
|
270
|
+
query: "SELECT * FROM users",
|
|
271
|
+
duration: 1500,
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
const result = status.toString(s);
|
|
275
|
+
expect(result).toContain("ERROR: Database error");
|
|
276
|
+
expect(result).toContain("Stack Trace:\nError: Database error");
|
|
277
|
+
expect(result).toContain("Details:");
|
|
278
|
+
expect(result).toContain('"query": "SELECT * FROM users"');
|
|
279
|
+
expect(result).toContain('"duration": 1500');
|
|
280
|
+
expect(result).not.toContain('"stack"');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it("should exclude error object from details output", () => {
|
|
284
|
+
const error = new Error("Test error");
|
|
285
|
+
const s = status.fromException(error);
|
|
286
|
+
const result = status.toString(s);
|
|
287
|
+
expect(result).toContain("Stack Trace:");
|
|
288
|
+
expect(result).not.toContain('"error"');
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it("should not include Details section when only stack and error are present", () => {
|
|
292
|
+
const error = new Error("Test error");
|
|
293
|
+
const s = status.fromException(error);
|
|
294
|
+
const result = status.toString(s);
|
|
295
|
+
expect(result).toContain("Stack Trace:");
|
|
296
|
+
expect(result).not.toContain("Details:");
|
|
297
|
+
});
|
|
298
|
+
});
|
|
132
299
|
});
|
package/src/status/status.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -12,6 +12,7 @@ import { z } from "zod";
|
|
|
12
12
|
import { array } from "@/array";
|
|
13
13
|
import { id } from "@/id";
|
|
14
14
|
import { label } from "@/label";
|
|
15
|
+
import { narrow } from "@/narrow";
|
|
15
16
|
import { type optional } from "@/optional";
|
|
16
17
|
import { TimeStamp } from "@/telem";
|
|
17
18
|
|
|
@@ -132,3 +133,48 @@ export const removeVariants = (
|
|
|
132
133
|
}
|
|
133
134
|
return remove === variant ? undefined : variant;
|
|
134
135
|
};
|
|
136
|
+
|
|
137
|
+
export interface ToStringOptions {
|
|
138
|
+
includeTimestamp?: boolean;
|
|
139
|
+
includeName?: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const DEFAULT_TO_STRING_OPTIONS: ToStringOptions = {
|
|
143
|
+
includeTimestamp: false,
|
|
144
|
+
includeName: true,
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const toString = <Details = never>(
|
|
148
|
+
stat: Status<Details>,
|
|
149
|
+
options: ToStringOptions = {},
|
|
150
|
+
): string => {
|
|
151
|
+
const opts = { ...DEFAULT_TO_STRING_OPTIONS, ...options };
|
|
152
|
+
const parts: string[] = [];
|
|
153
|
+
let header = stat.variant.toUpperCase();
|
|
154
|
+
if (opts.includeName && stat.name.length > 0) header += ` [${stat.name}]`;
|
|
155
|
+
header += `: ${stat.message}`;
|
|
156
|
+
if (opts.includeTimestamp) header += ` (${stat.time.toString("dateTime", "local")})`;
|
|
157
|
+
parts.push(header);
|
|
158
|
+
if (stat.description != null) {
|
|
159
|
+
let descriptionText: string;
|
|
160
|
+
try {
|
|
161
|
+
const parsed = JSON.parse(stat.description);
|
|
162
|
+
descriptionText = `Description:\n${JSON.stringify(parsed, null, 2)}`;
|
|
163
|
+
} catch {
|
|
164
|
+
descriptionText = `Description: ${stat.description}`;
|
|
165
|
+
}
|
|
166
|
+
parts.push(descriptionText);
|
|
167
|
+
}
|
|
168
|
+
if ("details" in stat && narrow.isObject(stat.details)) {
|
|
169
|
+
const details = stat.details as Record<string, unknown>;
|
|
170
|
+
// Extract stack trace separately for special formatting
|
|
171
|
+
if ("stack" in details) parts.push(`Stack Trace:\n${String(details.stack)}`);
|
|
172
|
+
// Include other details (excluding stack and error which don't serialize well)
|
|
173
|
+
const extraDetails = Object.fromEntries(
|
|
174
|
+
Object.entries(details).filter(([k]) => k !== "stack" && k !== "error"),
|
|
175
|
+
);
|
|
176
|
+
if (Object.keys(extraDetails).length > 0)
|
|
177
|
+
parts.push(`Details:\n${JSON.stringify(extraDetails, null, 2)}`);
|
|
178
|
+
}
|
|
179
|
+
return parts.join("\n\n");
|
|
180
|
+
};
|
package/src/strings/external.ts
CHANGED
package/src/strings/index.ts
CHANGED
package/src/strings/strings.ts
CHANGED
package/src/sync/index.ts
CHANGED
package/src/sync/mutex.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
8
|
// included in the file licenses/APL.txt.
|
|
9
9
|
|
|
10
|
-
import { Mutex as
|
|
10
|
+
import { Mutex as Base } from "async-mutex";
|
|
11
11
|
|
|
12
|
-
export type Mutex<G> = G &
|
|
12
|
+
export type Mutex<G> = G & Base;
|
|
13
13
|
|
|
14
|
-
export class mutex<G> extends
|
|
14
|
+
export class mutex<G> extends Base {
|
|
15
15
|
constructor(guard: G) {
|
|
16
16
|
super();
|
|
17
17
|
Object.assign(this, guard);
|
package/src/telem/gl.ts
CHANGED
package/src/telem/index.ts
CHANGED
package/src/telem/series.spec.ts
CHANGED
package/src/telem/series.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
2
|
//
|
|
3
3
|
// Use of this software is governed by the Business Source License included in the file
|
|
4
4
|
// licenses/BSL.txt.
|
|
@@ -1553,9 +1553,9 @@ class MultiSeriesIterator<T extends TelemValue = TelemValue> implements Iterator
|
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
1555
|
|
|
1556
|
-
class MultiSubIterator<
|
|
1557
|
-
|
|
1558
|
-
{
|
|
1556
|
+
class MultiSubIterator<
|
|
1557
|
+
T extends TelemValue = TelemValue,
|
|
1558
|
+
> implements IterableIterator<T> {
|
|
1559
1559
|
private readonly series: MultiSeries<T>;
|
|
1560
1560
|
private index: number;
|
|
1561
1561
|
private end: number;
|
package/src/telem/telem.spec.ts
CHANGED
package/src/telem/telem.ts
CHANGED
package/src/testutil/index.ts
CHANGED