@unisonlabs/sixminute-admin 0.1.1150-next → 0.1.1152-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 +40 -6
- 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.1152-next", commit: "8962237d6a5f3c295f602aa853b4ceb92beee7cf", surface: "550b9f230b291637" };
|
|
25
25
|
|
|
26
26
|
// tools/admin/src/run.ts
|
|
27
27
|
import { rmSync as rmSync3 } from "node:fs";
|
|
@@ -4520,8 +4520,10 @@ var ReviewerSettingSchema = exports_external.discriminatedUnion("mode", [
|
|
|
4520
4520
|
]);
|
|
4521
4521
|
var PmsSettingsSchema = exports_external.object({
|
|
4522
4522
|
notation: exports_external.string().nullable().default(null),
|
|
4523
|
-
reviewer: ReviewerSettingSchema.nullable().default(null)
|
|
4523
|
+
reviewer: ReviewerSettingSchema.nullable().default(null),
|
|
4524
|
+
auto_approve: exports_external.array(MemberIdSchema).optional()
|
|
4524
4525
|
});
|
|
4526
|
+
var ApprovalModeSchema = exports_external.enum(["review", "auto"]);
|
|
4525
4527
|
var PmsListsSchema = exports_external.object({
|
|
4526
4528
|
clients: exports_external.array(PmsClientSchema).default([]),
|
|
4527
4529
|
matters: exports_external.array(PmsMatterSchema).default([]),
|
|
@@ -4571,7 +4573,8 @@ var PmsEntryStateSchema = exports_external.object({
|
|
|
4571
4573
|
raw_status: exports_external.string().nullable().default(null)
|
|
4572
4574
|
});
|
|
4573
4575
|
var PmsEntryFactSchema = PmsEntryStateSchema.extend({
|
|
4574
|
-
followed_ref: exports_external.string().min(1).optional()
|
|
4576
|
+
followed_ref: exports_external.string().min(1).optional(),
|
|
4577
|
+
direct: exports_external.literal(true).optional()
|
|
4575
4578
|
});
|
|
4576
4579
|
var DeliveryStateSchema = exports_external.enum(["released", "accepted", "rejected", "edited"]);
|
|
4577
4580
|
var PushRefusalSchema = exports_external.enum([
|
|
@@ -4663,6 +4666,10 @@ var ConnectorSummarySchema = exports_external.object({
|
|
|
4663
4666
|
var ConnectorSettingsPutSchema = exports_external.object({
|
|
4664
4667
|
reviewer: ReviewerSettingSchema.nullable()
|
|
4665
4668
|
});
|
|
4669
|
+
var ConnectorApprovalPutSchema = exports_external.object({
|
|
4670
|
+
member_id: MemberIdSchema,
|
|
4671
|
+
mode: ApprovalModeSchema
|
|
4672
|
+
});
|
|
4666
4673
|
var ConnectResultSchema = exports_external.object({
|
|
4667
4674
|
connector: ConnectorSummarySchema,
|
|
4668
4675
|
team: TeamProposalSchema.nullable()
|
|
@@ -4911,7 +4918,8 @@ var MeSystemLinkSchema = exports_external.object({
|
|
|
4911
4918
|
code: exports_external.string().min(1).nullable(),
|
|
4912
4919
|
status: exports_external.enum(["connected", "needs_reconnect"]).optional(),
|
|
4913
4920
|
synced: exports_external.boolean().optional(),
|
|
4914
|
-
narrative_language: NarrativeLanguageSchema.nullable().optional()
|
|
4921
|
+
narrative_language: NarrativeLanguageSchema.nullable().optional(),
|
|
4922
|
+
approval: ApprovalModeSchema.optional()
|
|
4915
4923
|
});
|
|
4916
4924
|
var MeSchema = exports_external.object({
|
|
4917
4925
|
user: UserSchema,
|
|
@@ -6668,9 +6676,13 @@ function summaryLines(summary) {
|
|
|
6668
6676
|
`lists ${counts.matters} matters, ${counts.clients} clients, ` + `${counts.timekeepers} timekeepers, ${counts.options} options`,
|
|
6669
6677
|
`last sync ${summary.last_sync_at ?? "never"}`,
|
|
6670
6678
|
`last error ${summary.last_error ?? "none"}`,
|
|
6671
|
-
...summary.capabilities.accepts_by === "approval" ? [`reviewer ${reviewerLine(summary)}`] : []
|
|
6679
|
+
...summary.capabilities.accepts_by === "approval" ? [`reviewer ${reviewerLine(summary)}`, `approval ${approvalLine(summary)}`] : []
|
|
6672
6680
|
];
|
|
6673
6681
|
}
|
|
6682
|
+
function approvalLine(summary) {
|
|
6683
|
+
const auto = summary.settings?.auto_approve ?? [];
|
|
6684
|
+
return auto.length === 0 ? "every release waits there as a draft until it is approved" : `written as approved time for ${auto.join(", ")}; everyone else's waits as a draft`;
|
|
6685
|
+
}
|
|
6674
6686
|
function reviewerLine(summary) {
|
|
6675
6687
|
const reviewer = summary.settings?.reviewer ?? null;
|
|
6676
6688
|
return reviewer === null || reviewer.mode === "timekeeper" ? "each lawyer approves their own time" : `${reviewer.name} (${reviewer.external_ref}) approves every entry`;
|
|
@@ -7063,6 +7075,14 @@ is required; without one every command answers 403.
|
|
|
7063
7075
|
default), or --person, one active timekeeper of the team table by
|
|
7064
7076
|
their ref. A sync never changes it.
|
|
7065
7077
|
|
|
7078
|
+
sixminute-admin connector approval --env <env> --firm tenant_... \\
|
|
7079
|
+
--member <member-id> (--auto | --review) [--json]
|
|
7080
|
+
What one member's release does in a system that takes drafts for
|
|
7081
|
+
approval: --review, the draft waits there until it is approved (the
|
|
7082
|
+
default), or --auto, it is written as approved time on that member's
|
|
7083
|
+
account, with no draft. Where the system refuses that, the release
|
|
7084
|
+
fails and says why. One member a call; a sync never changes it.
|
|
7085
|
+
|
|
7066
7086
|
sixminute-admin connector status --env <env> --firm tenant_... [--json]
|
|
7067
7087
|
sixminute-admin connector sync --env <env> --firm tenant_... [--json]
|
|
7068
7088
|
sixminute-admin connector disconnect --env <env> --firm tenant_... [--json]
|
|
@@ -7096,7 +7116,9 @@ var BOOLEAN_FLAGS = new Set([
|
|
|
7096
7116
|
"confirm",
|
|
7097
7117
|
"password-stdin",
|
|
7098
7118
|
"all",
|
|
7099
|
-
"timekeeper"
|
|
7119
|
+
"timekeeper",
|
|
7120
|
+
"auto",
|
|
7121
|
+
"review"
|
|
7100
7122
|
]);
|
|
7101
7123
|
function parseFlags(argv, offset) {
|
|
7102
7124
|
const values = new Map;
|
|
@@ -8047,6 +8069,18 @@ async function runConnector(run2, subcommand) {
|
|
|
8047
8069
|
const summary = ConnectorSummarySchema.parse(answer.body);
|
|
8048
8070
|
return render(run2, { connector: summary }, [...head(answer), ...summaryLines(summary)]);
|
|
8049
8071
|
}
|
|
8072
|
+
if (subcommand === "approval") {
|
|
8073
|
+
const member = required(flags, "member", "connector approval names the member it is for, by member id");
|
|
8074
|
+
const auto = switched(flags, "auto");
|
|
8075
|
+
if (auto === switched(flags, "review")) {
|
|
8076
|
+
throw new AdminUsageError("connector approval takes one of --review (the draft waits in the practice system until it is approved) " + "or --auto (it is written as approved time, with no draft)");
|
|
8077
|
+
}
|
|
8078
|
+
const answer = await call(run2.api, "PUT", path("/approval"), { member_id: member, mode: auto ? "auto" : "review" });
|
|
8079
|
+
if (answer.status !== 200)
|
|
8080
|
+
return refused(run2, answer, head(answer));
|
|
8081
|
+
const summary = ConnectorSummarySchema.parse(answer.body);
|
|
8082
|
+
return render(run2, { connector: summary }, [...head(answer), ...summaryLines(summary)]);
|
|
8083
|
+
}
|
|
8050
8084
|
if (subcommand === "status") {
|
|
8051
8085
|
const answer = await call(run2.api, "GET", path(""));
|
|
8052
8086
|
if (answer.status !== 200)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisonlabs/sixminute-admin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1152-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": {
|