@unisonlabs/sixminute-admin 0.1.1369-next → 0.1.1371-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 +51 -40
- 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.1371-next", commit: "f5056a322f68bf05d3bf4bb994ea50d5cb0f4ae2", surface: "20ea8005a02a0df9" };
|
|
25
25
|
|
|
26
26
|
// tools/admin/src/run.ts
|
|
27
27
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "node:fs";
|
|
@@ -5060,7 +5060,8 @@ var SettingSchema = oneOf([
|
|
|
5060
5060
|
"entry_size",
|
|
5061
5061
|
"time_zone",
|
|
5062
5062
|
"launch_at_login",
|
|
5063
|
-
"theme"
|
|
5063
|
+
"theme",
|
|
5064
|
+
"timesheet_pet"
|
|
5064
5065
|
]);
|
|
5065
5066
|
var DeviceSettingSchema = oneOf(["unit_minutes", "narrative_language", "narrative_max_chars", "always_on", "launch_at_login", "theme", "exclusions", "entry_size"]);
|
|
5066
5067
|
var SignOutTriggerSchema = oneOf(["menu", "tray", "revoked"]);
|
|
@@ -5888,6 +5889,34 @@ var CalendarDaySchema = exports_external.object({
|
|
|
5888
5889
|
events: exports_external.array(CalendarEventSchema)
|
|
5889
5890
|
});
|
|
5890
5891
|
|
|
5892
|
+
// packages/contracts/src/firm/index.ts
|
|
5893
|
+
var NARRATIVE_GUIDANCE_MAX_CHARS = 1500;
|
|
5894
|
+
var GUIDANCE_CONTROL = /[\u0000-\u0009\u000B-\u001F\u007F-\u009F]/;
|
|
5895
|
+
var NarrativeMaxCharsSchema = exports_external.number().int().min(40).max(NARRATIVE_LIMIT_MAX);
|
|
5896
|
+
var NarrativeGuidanceSchema = exports_external.string().trim().max(NARRATIVE_GUIDANCE_MAX_CHARS).refine((text) => !GUIDANCE_CONTROL.test(text), { message: "guidance holds no control character but a newline" });
|
|
5897
|
+
var FirmAlwaysOnSchema = exports_external.enum(["member_choice", "enforced"]);
|
|
5898
|
+
var FirmSettingsSchema = exports_external.object({
|
|
5899
|
+
unit_minutes: UnitMinutesSchema.default(6),
|
|
5900
|
+
narrative: exports_external.object({
|
|
5901
|
+
max_chars: NarrativeMaxCharsSchema.nullable().default(null),
|
|
5902
|
+
language: StoredFirmLanguageSchema,
|
|
5903
|
+
guidance: NarrativeGuidanceSchema.default(""),
|
|
5904
|
+
lowered_to_system: exports_external.object({ kind: ConnectorKindSchema, at: TimestampSchema }).nullable().default(null)
|
|
5905
|
+
}).default({}),
|
|
5906
|
+
capture: exports_external.object({ always_on: FirmAlwaysOnSchema.default("member_choice") }).default({}),
|
|
5907
|
+
timesheet_pet: exports_external.object({ on: exports_external.boolean().default(false), on_since: TimestampSchema.nullable().default(null) }).default({})
|
|
5908
|
+
}).default({});
|
|
5909
|
+
var FirmSettingsPatchSchema = exports_external.object({
|
|
5910
|
+
unit_minutes: UnitMinutesSchema.optional(),
|
|
5911
|
+
narrative: exports_external.object({
|
|
5912
|
+
max_chars: NarrativeMaxCharsSchema.nullable().optional(),
|
|
5913
|
+
language: NarrativeLanguageSchema.optional(),
|
|
5914
|
+
guidance: NarrativeGuidanceSchema.optional()
|
|
5915
|
+
}).optional(),
|
|
5916
|
+
capture: exports_external.object({ always_on: FirmAlwaysOnSchema.optional() }).optional(),
|
|
5917
|
+
timesheet_pet: exports_external.object({ on: exports_external.boolean() }).optional()
|
|
5918
|
+
});
|
|
5919
|
+
|
|
5891
5920
|
// packages/contracts/src/evidence.ts
|
|
5892
5921
|
var HostSchema = exports_external.string().transform((h) => h.trim().toLowerCase()).pipe(exports_external.string().max(253).regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/, "expected a url host: lower-case labels, no scheme, no port and no path"));
|
|
5893
5922
|
var WitnessSchema = exports_external.object({
|
|
@@ -6020,30 +6049,6 @@ var TenantPolicySchema = exports_external.object({
|
|
|
6020
6049
|
context_retention_days: exports_external.number().int().min(0).max(365).default(30),
|
|
6021
6050
|
demo: exports_external.object({ enabled: exports_external.boolean() }).optional()
|
|
6022
6051
|
}).default({});
|
|
6023
|
-
var NARRATIVE_GUIDANCE_MAX_CHARS = 1500;
|
|
6024
|
-
var GUIDANCE_CONTROL = /[\u0000-\u0009\u000B-\u001F\u007F-\u009F]/;
|
|
6025
|
-
var NarrativeMaxCharsSchema = exports_external.number().int().min(40).max(NARRATIVE_LIMIT_MAX);
|
|
6026
|
-
var NarrativeGuidanceSchema = exports_external.string().trim().max(NARRATIVE_GUIDANCE_MAX_CHARS).refine((text) => !GUIDANCE_CONTROL.test(text), { message: "guidance holds no control character but a newline" });
|
|
6027
|
-
var FirmAlwaysOnSchema = exports_external.enum(["member_choice", "enforced"]);
|
|
6028
|
-
var FirmSettingsSchema = exports_external.object({
|
|
6029
|
-
unit_minutes: UnitMinutesSchema.default(6),
|
|
6030
|
-
narrative: exports_external.object({
|
|
6031
|
-
max_chars: NarrativeMaxCharsSchema.nullable().default(null),
|
|
6032
|
-
language: StoredFirmLanguageSchema,
|
|
6033
|
-
guidance: NarrativeGuidanceSchema.default(""),
|
|
6034
|
-
lowered_to_system: exports_external.object({ kind: ConnectorKindSchema, at: TimestampSchema }).nullable().default(null)
|
|
6035
|
-
}).default({}),
|
|
6036
|
-
capture: exports_external.object({ always_on: FirmAlwaysOnSchema.default("member_choice") }).default({})
|
|
6037
|
-
}).default({});
|
|
6038
|
-
var FirmSettingsPatchSchema = exports_external.object({
|
|
6039
|
-
unit_minutes: UnitMinutesSchema.optional(),
|
|
6040
|
-
narrative: exports_external.object({
|
|
6041
|
-
max_chars: NarrativeMaxCharsSchema.nullable().optional(),
|
|
6042
|
-
language: NarrativeLanguageSchema.optional(),
|
|
6043
|
-
guidance: NarrativeGuidanceSchema.optional()
|
|
6044
|
-
}).optional(),
|
|
6045
|
-
capture: exports_external.object({ always_on: FirmAlwaysOnSchema.optional() }).optional()
|
|
6046
|
-
});
|
|
6047
6052
|
var TenantSchema = exports_external.object({
|
|
6048
6053
|
id: TenantIdSchema,
|
|
6049
6054
|
workos_org_id: exports_external.string().min(1),
|
|
@@ -6134,6 +6139,7 @@ var MeSchema = exports_external.object({
|
|
|
6134
6139
|
permissions: exports_external.array(exports_external.string()).default([]),
|
|
6135
6140
|
judgment_pipeline: JudgmentPipelineSchema.default("standard"),
|
|
6136
6141
|
legalsense_connector: exports_external.boolean().default(false),
|
|
6142
|
+
timesheet_pet: exports_external.boolean().default(false),
|
|
6137
6143
|
calendar_offered: exports_external.boolean().optional(),
|
|
6138
6144
|
swallow_short_pauses: exports_external.boolean().optional(),
|
|
6139
6145
|
pipeline_shadow: exports_external.boolean().optional(),
|
|
@@ -7266,6 +7272,7 @@ var SignInBrowserArgsSchema = exports_external.object({
|
|
|
7266
7272
|
connection_id: exports_external.string().min(1).optional(),
|
|
7267
7273
|
login_hint: exports_external.string().min(1).optional()
|
|
7268
7274
|
});
|
|
7275
|
+
var OpenDaySchema = exports_external.object({ day: LocalDaySchema });
|
|
7269
7276
|
var DeepLinkSchema = exports_external.object({
|
|
7270
7277
|
host: exports_external.enum(["auth", "calendar"]),
|
|
7271
7278
|
state: exports_external.string().min(1),
|
|
@@ -7303,7 +7310,8 @@ var HOST_EVENTS = {
|
|
|
7303
7310
|
update: UpdateStateSchema,
|
|
7304
7311
|
deep_link: DeepLinkSchema,
|
|
7305
7312
|
window_seen: WindowSeenSchema,
|
|
7306
|
-
install: InstallAskedSchema
|
|
7313
|
+
install: InstallAskedSchema,
|
|
7314
|
+
open_day: OpenDaySchema
|
|
7307
7315
|
};
|
|
7308
7316
|
var HOST_COMMAND_NAMES = Object.keys(HOST_COMMANDS);
|
|
7309
7317
|
var HOST_EVENT_NAMES = Object.keys(HOST_EVENTS);
|
|
@@ -7404,10 +7412,13 @@ var CheckinSchema = exports_external.object({
|
|
|
7404
7412
|
sampler: SamplerStateSchema,
|
|
7405
7413
|
update: UpdatePhaseSchema,
|
|
7406
7414
|
policy_version: exports_external.string().min(1).nullable(),
|
|
7407
|
-
events: exports_external.array(CheckinEventSchema).max(CHECKIN_EVENTS_MAX)
|
|
7415
|
+
events: exports_external.array(CheckinEventSchema).max(CHECKIN_EVENTS_MAX),
|
|
7416
|
+
open_days: exports_external.literal(true).optional()
|
|
7408
7417
|
});
|
|
7418
|
+
var OPEN_DAYS_MAX = 31;
|
|
7409
7419
|
var CheckinAnswerSchema = exports_external.object({
|
|
7410
|
-
policy: VersionedPolicySchema.nullable()
|
|
7420
|
+
policy: VersionedPolicySchema.nullable(),
|
|
7421
|
+
open_days: exports_external.array(LocalDaySchema).max(OPEN_DAYS_MAX).optional()
|
|
7411
7422
|
});
|
|
7412
7423
|
// packages/contracts/src/client-version.ts
|
|
7413
7424
|
var CLIENT_OUTDATED_PROBLEM = "urn:six-minute:problem:client-outdated";
|
|
@@ -10073,13 +10084,13 @@ async function runVocabulary(run2, group, subcommand, action, positionals) {
|
|
|
10073
10084
|
const tenant = required(flags, "tenant", "the firm whose vocabulary this is");
|
|
10074
10085
|
const base = tenantPath(tenant);
|
|
10075
10086
|
let head = null;
|
|
10076
|
-
const
|
|
10087
|
+
const firm2 = async (method, path, body) => {
|
|
10077
10088
|
const answer = await call(run2.api, method, `${base}${path}`, body);
|
|
10078
10089
|
head ??= actingHead(tenant, answer);
|
|
10079
10090
|
return expectOk(answer, `${method} ${base}${path}`);
|
|
10080
10091
|
};
|
|
10081
10092
|
const done = (payload, lines) => render(run2, payload, [...head === null ? [] : [head], ...lines]);
|
|
10082
|
-
const attributes = async () => exports_external.array(AttributeSchema).parse(await
|
|
10093
|
+
const attributes = async () => exports_external.array(AttributeSchema).parse(await firm2("GET", "/attributes"));
|
|
10083
10094
|
const keyOf = (command, why) => {
|
|
10084
10095
|
const positional = positionals[0];
|
|
10085
10096
|
if (positional !== undefined)
|
|
@@ -10102,14 +10113,14 @@ async function runVocabulary(run2, group, subcommand, action, positionals) {
|
|
|
10102
10113
|
if (id !== undefined && id !== set.id)
|
|
10103
10114
|
throw new AdminUsageError(`--id ${id} and ${file}'s own id ${set.id} disagree`);
|
|
10104
10115
|
const written = { ...set, ...name === undefined ? {} : { name } };
|
|
10105
|
-
await
|
|
10116
|
+
await firm2("PUT", `/attributes/${enc2(written.attribute_key)}/sets/${enc2(written.id)}`, written);
|
|
10106
10117
|
return done({ attribute_set: written }, [
|
|
10107
10118
|
`option set ${written.id} ${written.attribute_key} ${written.name} ${written.options.length} option(s)`
|
|
10108
10119
|
]);
|
|
10109
10120
|
}
|
|
10110
10121
|
if (action === "list") {
|
|
10111
10122
|
const attribute = optional(flags, "attribute");
|
|
10112
|
-
const rows = exports_external.array(AttributeSetSchema).parse(await
|
|
10123
|
+
const rows = exports_external.array(AttributeSetSchema).parse(await firm2("GET", `/attribute-sets${attribute === undefined ? "" : `?attribute=${enc2(attribute)}`}`));
|
|
10113
10124
|
return done({ attribute_sets: rows }, [
|
|
10114
10125
|
`${rows.length} option set(s)`,
|
|
10115
10126
|
...rows.map((row) => ` ${row.id} ${row.attribute_key} ${row.name} ${row.options.length} option(s)`)
|
|
@@ -10118,7 +10129,7 @@ async function runVocabulary(run2, group, subcommand, action, positionals) {
|
|
|
10118
10129
|
if (action === "delete") {
|
|
10119
10130
|
const attribute = required(flags, "attribute", "a set belongs to one attribute");
|
|
10120
10131
|
const id = required(flags, "id", "which set to delete");
|
|
10121
|
-
await
|
|
10132
|
+
await firm2("DELETE", `/attributes/${enc2(attribute)}/sets/${enc2(id)}`);
|
|
10122
10133
|
return done({ deleted: { attribute, id } }, [
|
|
10123
10134
|
`option set ${id} deleted. The API refuses this for a set any entry carries.`
|
|
10124
10135
|
]);
|
|
@@ -10138,7 +10149,7 @@ async function runVocabulary(run2, group, subcommand, action, positionals) {
|
|
|
10138
10149
|
proposed: switched(flags, "proposed"),
|
|
10139
10150
|
default_set_ids: defaults
|
|
10140
10151
|
});
|
|
10141
|
-
const written = AttributeSchema.parse(await
|
|
10152
|
+
const written = AttributeSchema.parse(await firm2("PUT", `/attributes/${enc2(row.key)}`, row));
|
|
10142
10153
|
return done({ attribute: written }, [
|
|
10143
10154
|
`attribute ${written.key} ${written.label} ` + `${written.required ? "required" : "optional"} ${written.proposed ? "proposed" : "not proposed"} ` + `sets ${written.default_set_ids.join(", ") || "none"}`
|
|
10144
10155
|
]);
|
|
@@ -10157,7 +10168,7 @@ async function runVocabulary(run2, group, subcommand, action, positionals) {
|
|
|
10157
10168
|
if (row === undefined) {
|
|
10158
10169
|
throw new AdminUsageError(`this firm has no active attribute ${key}; it holds ${rows.map((one) => one.key).join(", ") || "none"}`);
|
|
10159
10170
|
}
|
|
10160
|
-
const written = AttributeSchema.parse(await
|
|
10171
|
+
const written = AttributeSchema.parse(await firm2("PUT", `/attributes/${enc2(key)}`, { ...row, active: false }));
|
|
10161
10172
|
return done({ attribute: written }, [`attribute ${written.key} retired (active false). Nothing was deleted.`]);
|
|
10162
10173
|
}
|
|
10163
10174
|
}
|
|
@@ -10167,8 +10178,8 @@ async function runVocabulary(run2, group, subcommand, action, positionals) {
|
|
|
10167
10178
|
if (pair === undefined)
|
|
10168
10179
|
throw new AdminUsageError("--attribute is required: key=id,id, key=none or key=inherit");
|
|
10169
10180
|
const wanted = parseMatterSets([pair]);
|
|
10170
|
-
const merged = { ...await readMatterSets(
|
|
10171
|
-
await
|
|
10181
|
+
const merged = { ...await readMatterSets(firm2, matterId), ...wanted };
|
|
10182
|
+
await firm2("PATCH", `/matters/${enc2(matterId)}`, { attribute_sets: merged });
|
|
10172
10183
|
return done({ matter: matterId, attribute_sets: merged }, [
|
|
10173
10184
|
`matter ${matterId} ` + Object.entries(merged).map(([key, ids3]) => `${key}=${ids3 === null ? "inherit" : ids3.length === 0 ? "none" : ids3.join(",")}`).join(" ")
|
|
10174
10185
|
]);
|
|
@@ -10177,11 +10188,11 @@ async function runVocabulary(run2, group, subcommand, action, positionals) {
|
|
|
10177
10188
|
}
|
|
10178
10189
|
var MatterSetsPageSchema = pullResultSchema(MatterSchema.pick({ id: true, attribute_sets: true }));
|
|
10179
10190
|
var MATTER_PAGE = 2000;
|
|
10180
|
-
async function readMatterSets(
|
|
10191
|
+
async function readMatterSets(firm2, matterId) {
|
|
10181
10192
|
let since = null;
|
|
10182
10193
|
for (;; ) {
|
|
10183
10194
|
const query = since === null ? `?limit=${MATTER_PAGE}` : `?limit=${MATTER_PAGE}&since=${enc2(since)}`;
|
|
10184
|
-
const page = MatterSetsPageSchema.parse(await
|
|
10195
|
+
const page = MatterSetsPageSchema.parse(await firm2("GET", `/matters${query}`));
|
|
10185
10196
|
const found = page.rows.find((row) => row.id === matterId);
|
|
10186
10197
|
if (found !== undefined)
|
|
10187
10198
|
return found.attribute_sets;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisonlabs/sixminute-admin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1371-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": {
|