@unisonlabs/sixminute-admin 0.1.1144-next → 0.1.1146-next
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/sixminute-admin.mjs +159 -17
- package/package.json +1 -1
package/dist/sixminute-admin.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import { homedir } from "node:os";
|
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
22
|
|
|
23
23
|
// tools/admin/src/build-info.ts
|
|
24
|
-
var BUILT = { version: "0.1.
|
|
24
|
+
var BUILT = { version: "0.1.1146-next", commit: "ac2bed90440bfb12fb85c479e00bcefd662b0f01", surface: "05ec6b71af5f095b" };
|
|
25
25
|
|
|
26
26
|
// tools/admin/src/run.ts
|
|
27
27
|
import { rmSync as rmSync3 } from "node:fs";
|
|
@@ -5096,9 +5096,25 @@ var EntrySplitResponseSchema = exports_external.object({ first: EntrySchema, sec
|
|
|
5096
5096
|
});
|
|
5097
5097
|
var EntryMergeRequestSchema = exports_external.object({
|
|
5098
5098
|
matter_id: MatterIdSchema.nullable().optional(),
|
|
5099
|
-
with: EntryIdSchema,
|
|
5099
|
+
with: EntryIdSchema.optional(),
|
|
5100
|
+
with_all: exports_external.array(EntryIdSchema).min(1).max(49).optional(),
|
|
5100
5101
|
narrative: ConfirmedNarrativeSchema,
|
|
5101
5102
|
attributes: EntryAttributesSchema
|
|
5103
|
+
}).superRefine((body, ctx) => {
|
|
5104
|
+
if (body.with === undefined === (body.with_all === undefined)) {
|
|
5105
|
+
ctx.addIssue({
|
|
5106
|
+
code: exports_external.ZodIssueCode.custom,
|
|
5107
|
+
path: ["with_all"],
|
|
5108
|
+
message: "a merge names the rows that follow in `with` or in `with_all`, and in exactly " + "one of them: `with` is one row, `with_all` is the list"
|
|
5109
|
+
});
|
|
5110
|
+
}
|
|
5111
|
+
if (body.with_all !== undefined && new Set(body.with_all).size !== body.with_all.length) {
|
|
5112
|
+
ctx.addIssue({
|
|
5113
|
+
code: exports_external.ZodIssueCode.custom,
|
|
5114
|
+
path: ["with_all"],
|
|
5115
|
+
message: "a merge names each row once: an id is in `with_all` twice"
|
|
5116
|
+
});
|
|
5117
|
+
}
|
|
5102
5118
|
});
|
|
5103
5119
|
var EntryBatchItemSchema = exports_external.object({
|
|
5104
5120
|
entry: JudgedEntrySchema,
|
|
@@ -5255,20 +5271,116 @@ var RawArchiveReasonSchema = exports_external.enum([
|
|
|
5255
5271
|
"disk_low"
|
|
5256
5272
|
]);
|
|
5257
5273
|
var RAW_ARCHIVE_EVENT_NAMES = ["raw_archive.turned_on", "raw_archive.turned_off"];
|
|
5258
|
-
var
|
|
5259
|
-
|
|
5260
|
-
"
|
|
5261
|
-
"
|
|
5262
|
-
"
|
|
5263
|
-
"
|
|
5264
|
-
"
|
|
5265
|
-
"
|
|
5266
|
-
|
|
5274
|
+
var TelemetryScreenSchema = exports_external.enum(["day", "timeline", "entry", "settings", "sign_in", "onboarding", "permissions"]);
|
|
5275
|
+
var TelemetryCommandSchema = exports_external.enum([
|
|
5276
|
+
"new-entry",
|
|
5277
|
+
"release-all",
|
|
5278
|
+
"settings",
|
|
5279
|
+
"exit",
|
|
5280
|
+
"undo",
|
|
5281
|
+
"redo",
|
|
5282
|
+
"cut",
|
|
5283
|
+
"copy",
|
|
5284
|
+
"paste",
|
|
5285
|
+
"select-all",
|
|
5286
|
+
"today",
|
|
5287
|
+
"previous-day",
|
|
5288
|
+
"next-day",
|
|
5289
|
+
"previous-entry",
|
|
5290
|
+
"next-entry",
|
|
5291
|
+
"actions",
|
|
5292
|
+
"capture",
|
|
5293
|
+
"privacy",
|
|
5294
|
+
"about",
|
|
5295
|
+
"folder",
|
|
5296
|
+
"release",
|
|
5297
|
+
"matter",
|
|
5298
|
+
"attribute",
|
|
5299
|
+
"merge",
|
|
5300
|
+
"delete",
|
|
5301
|
+
"open"
|
|
5267
5302
|
]);
|
|
5303
|
+
var Whole = exports_external.number().int().nonnegative();
|
|
5304
|
+
var TELEMETRY_SECONDS_MAX = 86400;
|
|
5305
|
+
var ForegroundSeconds = Whole.max(TELEMETRY_SECONDS_MAX);
|
|
5306
|
+
var TELEMETRY_DAY_OFFSET_MAX = 3660;
|
|
5307
|
+
var TELEMETRY_ENTRY_ID_MAX = 64;
|
|
5308
|
+
var TELEMETRY_EVENT_PROPERTIES = {
|
|
5309
|
+
"capture.started": exports_external.object({
|
|
5310
|
+
trigger: exports_external.enum(["button", "tray", "always_on", "launch", "sign_in"]),
|
|
5311
|
+
is_always_on: exports_external.boolean()
|
|
5312
|
+
}),
|
|
5313
|
+
"capture.stopped": exports_external.object({
|
|
5314
|
+
trigger: exports_external.enum(["button", "tray", "quit", "update", "sign_out"]),
|
|
5315
|
+
seconds: Whole,
|
|
5316
|
+
entries: Whole,
|
|
5317
|
+
windows_failed: Whole
|
|
5318
|
+
}),
|
|
5319
|
+
"user.signed_out": exports_external.object({ trigger: exports_external.enum(["menu", "tray", "session_expired"]) }),
|
|
5320
|
+
"permission.changed": exports_external.object({ permission: exports_external.enum(["accessibility", "automation"]), is_granted: exports_external.boolean() }),
|
|
5321
|
+
"update.failed": exports_external.object({ stage: exports_external.enum(["check", "download", "apply"]) }),
|
|
5322
|
+
"setting.changed": exports_external.object({
|
|
5323
|
+
setting: exports_external.enum([
|
|
5324
|
+
"unit_minutes",
|
|
5325
|
+
"narrative_language",
|
|
5326
|
+
"narrative_max_chars",
|
|
5327
|
+
"always_on",
|
|
5328
|
+
"launch_at_login",
|
|
5329
|
+
"theme",
|
|
5330
|
+
"exclusions"
|
|
5331
|
+
]),
|
|
5332
|
+
scope: exports_external.enum(["device"])
|
|
5333
|
+
}),
|
|
5334
|
+
"raw_archive.turned_on": exports_external.object({}),
|
|
5335
|
+
"raw_archive.turned_off": exports_external.object({}),
|
|
5336
|
+
"application.opened": exports_external.object({
|
|
5337
|
+
trigger: exports_external.enum(["launch", "login_item", "after_update", "tray"]),
|
|
5338
|
+
is_first_open: exports_external.boolean()
|
|
5339
|
+
}),
|
|
5340
|
+
"application.became_active": exports_external.object({ trigger: exports_external.enum(["launch", "tray", "dock", "notification", "shortcut"]) }),
|
|
5341
|
+
"application.backgrounded": exports_external.object({ foreground_seconds: ForegroundSeconds }),
|
|
5342
|
+
"app.usage": exports_external.object({ day: LocalDaySchema, foreground_seconds: ForegroundSeconds, sessions: Whole }),
|
|
5343
|
+
"screen.viewed": exports_external.object({
|
|
5344
|
+
screen: TelemetryScreenSchema,
|
|
5345
|
+
settings_page: exports_external.enum([
|
|
5346
|
+
"profile",
|
|
5347
|
+
"capture",
|
|
5348
|
+
"privacy",
|
|
5349
|
+
"general",
|
|
5350
|
+
"members",
|
|
5351
|
+
"timekeeping",
|
|
5352
|
+
"narratives",
|
|
5353
|
+
"practice-system",
|
|
5354
|
+
"member"
|
|
5355
|
+
]),
|
|
5356
|
+
from_screen: TelemetryScreenSchema,
|
|
5357
|
+
day_offset: exports_external.number().int().min(-TELEMETRY_DAY_OFFSET_MAX).max(TELEMETRY_DAY_OFFSET_MAX)
|
|
5358
|
+
}),
|
|
5359
|
+
"command.used": exports_external.object({
|
|
5360
|
+
command: TelemetryCommandSchema,
|
|
5361
|
+
via: exports_external.enum(["menu", "palette", "shortcut", "row_menu", "tray", "button"])
|
|
5362
|
+
}),
|
|
5363
|
+
"entry.opened": exports_external.object({
|
|
5364
|
+
entry_id: EntryIdSchema.max(TELEMETRY_ENTRY_ID_MAX),
|
|
5365
|
+
from_screen: TelemetryScreenSchema,
|
|
5366
|
+
status: exports_external.enum(["draft", "released"])
|
|
5367
|
+
}),
|
|
5368
|
+
"release.clicked": exports_external.object({
|
|
5369
|
+
entries: Whole,
|
|
5370
|
+
via: exports_external.enum(["row", "release_all", "palette", "entry_page", "selection", "shortcut", "menu"])
|
|
5371
|
+
}),
|
|
5372
|
+
"onboarding.step_viewed": exports_external.object({ step: exports_external.enum(["capture", "entries", "permissions", "release"]) }),
|
|
5373
|
+
"onboarding.completed": exports_external.object({ seconds: Whole })
|
|
5374
|
+
};
|
|
5375
|
+
var TelemetryEventNameSchema = exports_external.enum(Object.keys(TELEMETRY_EVENT_PROPERTIES));
|
|
5376
|
+
var TelemetryPropertyValueSchema = exports_external.union([exports_external.string(), exports_external.number(), exports_external.boolean()]);
|
|
5377
|
+
var TelemetrySessionIdSchema = exports_external.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, "expected a UUIDv7");
|
|
5268
5378
|
var TelemetryEventSchema = exports_external.object({
|
|
5269
5379
|
name: TelemetryEventNameSchema,
|
|
5270
5380
|
at: TimestampSchema,
|
|
5271
|
-
reason: RawArchiveReasonSchema.optional()
|
|
5381
|
+
reason: RawArchiveReasonSchema.optional(),
|
|
5382
|
+
session_id: TelemetrySessionIdSchema.optional(),
|
|
5383
|
+
properties: exports_external.record(exports_external.string(), TelemetryPropertyValueSchema).optional()
|
|
5272
5384
|
}).superRefine((event, ctx) => {
|
|
5273
5385
|
const archive = RAW_ARCHIVE_EVENT_NAMES.includes(event.name);
|
|
5274
5386
|
const refuse = (message) => ctx.addIssue({ code: exports_external.ZodIssueCode.custom, path: ["reason"], message });
|
|
@@ -5280,6 +5392,14 @@ var TelemetryEventSchema = exports_external.object({
|
|
|
5280
5392
|
} else if (event.name === "raw_archive.turned_on" && event.reason !== "person") {
|
|
5281
5393
|
refuse("raw_archive.turned_on carries the reason person, and only that");
|
|
5282
5394
|
}
|
|
5395
|
+
if (event.properties !== undefined) {
|
|
5396
|
+
const allowed = TELEMETRY_EVENT_PROPERTIES[event.name].partial().strict().safeParse(event.properties);
|
|
5397
|
+
if (!allowed.success) {
|
|
5398
|
+
for (const issue of allowed.error.issues) {
|
|
5399
|
+
ctx.addIssue({ code: exports_external.ZodIssueCode.custom, path: ["properties", ...issue.path], message: issue.message });
|
|
5400
|
+
}
|
|
5401
|
+
}
|
|
5402
|
+
}
|
|
5283
5403
|
});
|
|
5284
5404
|
var TelemetryBatchSchema = exports_external.object({
|
|
5285
5405
|
device_id: DeviceIdSchema,
|
|
@@ -5814,6 +5934,9 @@ var ReadResultSchema = exports_external.discriminatedUnion("type", [
|
|
|
5814
5934
|
]);
|
|
5815
5935
|
|
|
5816
5936
|
// packages/contracts/src/local.ts
|
|
5937
|
+
var LocalStartTriggerSchema = exports_external.enum(["button", "tray"]);
|
|
5938
|
+
var LocalStopTriggerSchema = exports_external.enum(["button", "tray", "quit", "update", "sign_out"]);
|
|
5939
|
+
var LocalSignOutTriggerSchema = exports_external.enum(["menu", "tray"]);
|
|
5817
5940
|
var LocalSecretSchema = exports_external.string().regex(/^[0-9a-f]{64}$/, "expected 32 random bytes as 64 lower-case hex characters");
|
|
5818
5941
|
var LocalEndpointSchema = exports_external.object({
|
|
5819
5942
|
port: exports_external.number().int().min(1).max(65535),
|
|
@@ -5896,7 +6019,9 @@ var LocalSessionStateSchema = exports_external.object({
|
|
|
5896
6019
|
tenant: exports_external.object({ name: exports_external.string() }).nullable(),
|
|
5897
6020
|
role: RoleSchema.nullable(),
|
|
5898
6021
|
firm_state: LocalFirmStateSchema.default("none"),
|
|
5899
|
-
last_refusal: LocalAuthRefusalSchema.nullable().default(null)
|
|
6022
|
+
last_refusal: LocalAuthRefusalSchema.nullable().default(null),
|
|
6023
|
+
account_id: exports_external.string().min(1).nullable().optional(),
|
|
6024
|
+
organization_id: exports_external.string().min(1).nullable().optional()
|
|
5900
6025
|
});
|
|
5901
6026
|
var LocalSessionSchema = LocalSessionStateSchema.extend({
|
|
5902
6027
|
access_token: exports_external.string().min(1).nullable().default(null),
|
|
@@ -5974,13 +6099,13 @@ var LocalAcceptedSchema = exports_external.object({ accepted: exports_external.l
|
|
|
5974
6099
|
var LocalProposeKeptReasonSchema = exports_external.enum(["no_cells", "not_signed_in", "refused", "offline"]);
|
|
5975
6100
|
var LocalProposeRequestSchema = exports_external.discriminatedUnion("kind", [
|
|
5976
6101
|
exports_external.object({ kind: exports_external.literal("split"), id: EntryIdSchema, at: TimestampSchema }),
|
|
5977
|
-
exports_external.object({ kind: exports_external.literal("merge"),
|
|
6102
|
+
exports_external.object({ kind: exports_external.literal("merge"), entries: exports_external.array(EntryIdSchema).min(2).max(50) })
|
|
5978
6103
|
]).superRefine((ask, ctx) => {
|
|
5979
|
-
if (ask.kind === "merge" && ask.
|
|
6104
|
+
if (ask.kind === "merge" && new Set(ask.entries).size !== ask.entries.length) {
|
|
5980
6105
|
ctx.addIssue({
|
|
5981
6106
|
code: exports_external.ZodIssueCode.custom,
|
|
5982
|
-
path: ["
|
|
5983
|
-
message: "a merge joins
|
|
6107
|
+
path: ["entries"],
|
|
6108
|
+
message: "a merge joins different rows: an id is in `entries` twice"
|
|
5984
6109
|
});
|
|
5985
6110
|
}
|
|
5986
6111
|
});
|
|
@@ -6026,6 +6151,23 @@ var LocalEventSchema = exports_external.discriminatedUnion("type", [
|
|
|
6026
6151
|
to_at: TimestampSchema.nullable()
|
|
6027
6152
|
})
|
|
6028
6153
|
]);
|
|
6154
|
+
var LocalHostEventSchema = exports_external.discriminatedUnion("name", [
|
|
6155
|
+
exports_external.object({
|
|
6156
|
+
name: exports_external.literal("permission.changed"),
|
|
6157
|
+
properties: TELEMETRY_EVENT_PROPERTIES["permission.changed"].strict()
|
|
6158
|
+
}).strict(),
|
|
6159
|
+
exports_external.object({
|
|
6160
|
+
name: exports_external.literal("update.failed"),
|
|
6161
|
+
properties: TELEMETRY_EVENT_PROPERTIES["update.failed"].strict()
|
|
6162
|
+
}).strict(),
|
|
6163
|
+
exports_external.object({
|
|
6164
|
+
name: exports_external.literal("setting.changed"),
|
|
6165
|
+
properties: exports_external.object({
|
|
6166
|
+
setting: TELEMETRY_EVENT_PROPERTIES["setting.changed"].shape.setting.extract(["launch_at_login", "theme"]),
|
|
6167
|
+
scope: exports_external.literal("device")
|
|
6168
|
+
}).strict()
|
|
6169
|
+
}).strict()
|
|
6170
|
+
]);
|
|
6029
6171
|
var LocalMethodSchema = exports_external.enum(["GET", "POST", "PATCH", "DELETE"]);
|
|
6030
6172
|
// packages/contracts/src/run.ts
|
|
6031
6173
|
var VerdictSchema = exports_external.enum(["matter", "unmatched", "absent"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisonlabs/sixminute-admin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1146-next",
|
|
4
4
|
"description": "Sixminute operator tool: the admin commands of the Sixminute API, run with your own operator sign-in.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|