@unisonlabs/sixminute-admin 0.1.1395-next → 0.1.1397-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 +390 -37
- package/package.json +1 -1
package/dist/sixminute-admin.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { homedir } from "node:os";
|
|
|
20
20
|
import { fileURLToPath } from "node:url";
|
|
21
21
|
|
|
22
22
|
// tools/admin/src/build-info.ts
|
|
23
|
-
var BUILT = { version: "0.1.
|
|
23
|
+
var BUILT = { version: "0.1.1397-next", commit: "94511fe12579eb9a8d8af8f21de74d7a5e20f2f2", surface: "ac6c731b1016a56b" };
|
|
24
24
|
|
|
25
25
|
// tools/admin/src/run.ts
|
|
26
26
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "node:fs";
|
|
@@ -4106,6 +4106,70 @@ var OperatorAuditQuerySchema = exports_external.object({
|
|
|
4106
4106
|
limit: exports_external.coerce.number().int().min(1).max(1000).default(100)
|
|
4107
4107
|
});
|
|
4108
4108
|
var OperatorAuditListSchema = exports_external.object({ actions: exports_external.array(OperatorActionSchema) });
|
|
4109
|
+
// packages/contracts/src/call/note.ts
|
|
4110
|
+
var CallEndSchema = exports_external.enum([
|
|
4111
|
+
"left",
|
|
4112
|
+
"window_closed",
|
|
4113
|
+
"app_closed",
|
|
4114
|
+
"surface_gone",
|
|
4115
|
+
"released_unknown",
|
|
4116
|
+
"lock",
|
|
4117
|
+
"sleep",
|
|
4118
|
+
"capture_stopped",
|
|
4119
|
+
"app_quit",
|
|
4120
|
+
"engine_restart"
|
|
4121
|
+
]);
|
|
4122
|
+
var CallPlatformSchema = exports_external.string().regex(/^[a-z][a-z0-9_]{0,31}$/);
|
|
4123
|
+
var CallInspectionStateSchema = exports_external.enum(["in_call", "no_surface", "window_gone", "unknown", "excluded"]);
|
|
4124
|
+
var CALL_PARTICIPANTS_MAX = 50;
|
|
4125
|
+
var CALL_NAME_MAX = 120;
|
|
4126
|
+
var CALL_TEXT_MAX = 2048;
|
|
4127
|
+
var SpanSchema = exports_external.object({ from: TimestampSchema, to: TimestampSchema });
|
|
4128
|
+
var SeenSchema = (max) => exports_external.object({ value: exports_external.string().min(1).max(max), at: TimestampSchema });
|
|
4129
|
+
var CallAppSchema = exports_external.object({ bundle_id: exports_external.string().min(1).max(CALL_NAME_MAX * 2), name: exports_external.string().min(1).max(CALL_NAME_MAX * 2) });
|
|
4130
|
+
var CallNoteSchema = exports_external.object({
|
|
4131
|
+
call_id: exports_external.string().min(1).max(64),
|
|
4132
|
+
resumes: exports_external.string().min(1).max(64).nullable(),
|
|
4133
|
+
state: exports_external.enum(["open", "closed"]),
|
|
4134
|
+
alive_at: TimestampSchema,
|
|
4135
|
+
started_at: TimestampSchema,
|
|
4136
|
+
ended_at: TimestampSchema.nullable(),
|
|
4137
|
+
end: CallEndSchema.nullable(),
|
|
4138
|
+
app: CallAppSchema,
|
|
4139
|
+
platform: CallPlatformSchema,
|
|
4140
|
+
holders: exports_external.array(exports_external.object({ image: exports_external.string().min(1).max(CALL_NAME_MAX * 2), spans: exports_external.array(SpanSchema).max(500) })).max(32),
|
|
4141
|
+
window_title: exports_external.array(SeenSchema(CALL_TEXT_MAX)).max(50),
|
|
4142
|
+
url: exports_external.array(SeenSchema(CALL_TEXT_MAX)).max(50),
|
|
4143
|
+
meeting_code: exports_external.array(SeenSchema(CALL_NAME_MAX)).max(50),
|
|
4144
|
+
participants: exports_external.array(SeenSchema(CALL_NAME_MAX)).max(CALL_PARTICIPANTS_MAX),
|
|
4145
|
+
inspections: exports_external.array(exports_external.object({ at: TimestampSchema, state: CallInspectionStateSchema, reason: exports_external.string().max(64).nullable(), matched: exports_external.string().max(CALL_NAME_MAX).nullable() })).max(2000),
|
|
4146
|
+
released: exports_external.array(SpanSchema).max(500),
|
|
4147
|
+
camera: exports_external.array(SpanSchema).max(500),
|
|
4148
|
+
build: exports_external.string().max(64),
|
|
4149
|
+
ui_language: exports_external.string().max(32).nullable(),
|
|
4150
|
+
policy_version: exports_external.string().max(64).nullable(),
|
|
4151
|
+
os_version: exports_external.string().max(64).nullable(),
|
|
4152
|
+
cost: exports_external.object({ inspections: exports_external.number().int().nonnegative(), slowest_ms: exports_external.number().int().nonnegative() })
|
|
4153
|
+
}).superRefine((note, ctx) => {
|
|
4154
|
+
if (note.state === "closed" && (note.ended_at === null || note.end === null))
|
|
4155
|
+
ctx.addIssue({ code: "custom", path: ["end"], message: "a closed note names its end" });
|
|
4156
|
+
if (note.state === "open" && (note.ended_at !== null || note.end !== null))
|
|
4157
|
+
ctx.addIssue({ code: "custom", path: ["end"], message: "an open note names no end" });
|
|
4158
|
+
if (note.ended_at !== null && Date.parse(note.ended_at) < Date.parse(note.started_at))
|
|
4159
|
+
ctx.addIssue({ code: "custom", path: ["ended_at"], message: "a call ends at or after its start" });
|
|
4160
|
+
if (Date.parse(note.alive_at) < Date.parse(note.started_at))
|
|
4161
|
+
ctx.addIssue({ code: "custom", path: ["alive_at"], message: "a call is alive at or after its start" });
|
|
4162
|
+
});
|
|
4163
|
+
var ContextCallSchema = exports_external.object({
|
|
4164
|
+
call_id: exports_external.string().min(1).max(64),
|
|
4165
|
+
app: exports_external.string().min(1).max(CALL_NAME_MAX * 2),
|
|
4166
|
+
platform: CallPlatformSchema,
|
|
4167
|
+
window_title: exports_external.string().min(1).max(CALL_TEXT_MAX).nullable(),
|
|
4168
|
+
participants: exports_external.array(exports_external.string().min(1).max(CALL_NAME_MAX)).max(CALL_PARTICIPANTS_MAX),
|
|
4169
|
+
live: exports_external.array(SpanSchema).min(1).max(64)
|
|
4170
|
+
});
|
|
4171
|
+
var CallNoteAnswerSchema = exports_external.object({ call_id: exports_external.string(), stored: exports_external.boolean() });
|
|
4172
|
+
|
|
4109
4173
|
// packages/contracts/src/narrative-activities.ts
|
|
4110
4174
|
var NARRATIVE_PRIMARY_LANGUAGES = ["nl", "en", "de", "fr", "es", "it", "pt", "pl", "sv", "da"];
|
|
4111
4175
|
var NarrativePrimaryLanguageSchema = exports_external.enum(NARRATIVE_PRIMARY_LANGUAGES);
|
|
@@ -5071,6 +5135,22 @@ var SignOutTriggerSchema = oneOf(["menu", "tray", "revoked"]);
|
|
|
5071
5135
|
var UpdateStageSchema = oneOf(["check", "download", "verify", "install"]);
|
|
5072
5136
|
var ProposalForSchema = oneOf(["compose", "split", "merge"]);
|
|
5073
5137
|
var HandMadeHowSchema = oneOf(["drag", "form"]);
|
|
5138
|
+
var CallStartHowSchema = oneOf(["label", "automation_id", "window"]);
|
|
5139
|
+
var CallClientSchema = oneOf(["app", "browser"]);
|
|
5140
|
+
var CallReadStateSchema = oneOf(["in_call", "no_surface", "window_gone", "app_gone", "unknown", "excluded", "none"]);
|
|
5141
|
+
var CallReadReasonSchema = oneOf([
|
|
5142
|
+
"hidden",
|
|
5143
|
+
"minimised",
|
|
5144
|
+
"incomplete",
|
|
5145
|
+
"timeout",
|
|
5146
|
+
"no_permission",
|
|
5147
|
+
"not_running",
|
|
5148
|
+
"failed",
|
|
5149
|
+
"no_window",
|
|
5150
|
+
"not_meeting_tab",
|
|
5151
|
+
"surface",
|
|
5152
|
+
"not_starts"
|
|
5153
|
+
]);
|
|
5074
5154
|
var UpdateFailureSchema = oneOf(["offline", "timeout", "http_4xx", "http_5xx", "manifest", "signature", "download", "install", "other"]);
|
|
5075
5155
|
var Role = oneOf(["timekeeper", "billing", "admin"]);
|
|
5076
5156
|
var Origin = oneOf(["engine", "hand"]);
|
|
@@ -5492,7 +5572,12 @@ var CATALOGUE = {
|
|
|
5492
5572
|
run_id: GENERATE.run_id,
|
|
5493
5573
|
day_offset: GENERATE.day_offset,
|
|
5494
5574
|
entries_clipped: count(),
|
|
5495
|
-
attempts: count()
|
|
5575
|
+
attempts: count(),
|
|
5576
|
+
online_calls_by_link: count(),
|
|
5577
|
+
online_calls_by_window: count(),
|
|
5578
|
+
online_calls_by_participants: count(),
|
|
5579
|
+
online_calls_by_nearest_start: count(),
|
|
5580
|
+
online_calls_unmatched: count()
|
|
5496
5581
|
},
|
|
5497
5582
|
wire: { name: "generate.finished" }
|
|
5498
5583
|
}),
|
|
@@ -5665,6 +5750,46 @@ var CATALOGUE = {
|
|
|
5665
5750
|
properties: { reason: oneOf(["person"]) },
|
|
5666
5751
|
wire: { name: "raw_archive.turned_on", beside: ["reason"] }
|
|
5667
5752
|
}),
|
|
5753
|
+
callStarted: spec({
|
|
5754
|
+
name: "call started",
|
|
5755
|
+
owner: "host",
|
|
5756
|
+
expect: "weekly",
|
|
5757
|
+
trigger: "a desktop's call tracker opened an online call",
|
|
5758
|
+
question: "Which meeting platforms and clients are calls read in, how does the start read, and how long after the microphone?",
|
|
5759
|
+
properties: {
|
|
5760
|
+
platform: word(),
|
|
5761
|
+
client: CallClientSchema,
|
|
5762
|
+
how: CallStartHowSchema,
|
|
5763
|
+
resumed: bool(),
|
|
5764
|
+
hold_seconds: duration(),
|
|
5765
|
+
os_version: word(),
|
|
5766
|
+
ui_language: word(),
|
|
5767
|
+
vocabulary_version: word()
|
|
5768
|
+
}
|
|
5769
|
+
}),
|
|
5770
|
+
callEnded: spec({
|
|
5771
|
+
name: "call ended",
|
|
5772
|
+
owner: "host",
|
|
5773
|
+
expect: "weekly",
|
|
5774
|
+
trigger: "a desktop's call tracker closed an online call",
|
|
5775
|
+
question: "How do calls end, hard or soft, and how long are they?",
|
|
5776
|
+
properties: { platform: word(), end: CallEndSchema, minutes: count(), resumed: bool() }
|
|
5777
|
+
}),
|
|
5778
|
+
callMissed: spec({
|
|
5779
|
+
name: "call missed",
|
|
5780
|
+
owner: "host",
|
|
5781
|
+
expect: "rare",
|
|
5782
|
+
trigger: "a meeting client of the served vocabulary held the microphone two minutes with no call started, once per hold",
|
|
5783
|
+
question: "Where does call detection miss a call, and what did the window show?",
|
|
5784
|
+
properties: {
|
|
5785
|
+
platform: word(),
|
|
5786
|
+
state: CallReadStateSchema,
|
|
5787
|
+
reason: CallReadReasonSchema,
|
|
5788
|
+
os_version: word(),
|
|
5789
|
+
ui_language: word(),
|
|
5790
|
+
vocabulary_version: word()
|
|
5791
|
+
}
|
|
5792
|
+
}),
|
|
5668
5793
|
rawArchiveTurnedOff: spec({
|
|
5669
5794
|
name: "raw archive turned off",
|
|
5670
5795
|
owner: "host",
|
|
@@ -6837,6 +6962,168 @@ var TeamApplyResultSchema = exports_external.object({
|
|
|
6837
6962
|
confirmation: TeamConfirmationSchema,
|
|
6838
6963
|
connector: ConnectorSummarySchema.nullable()
|
|
6839
6964
|
});
|
|
6965
|
+
// packages/contracts/src/call/controls.ts
|
|
6966
|
+
var CallControlKindSchema = exports_external.string().regex(/^[a-z][a-z0-9_]{0,31}$/);
|
|
6967
|
+
var Folded = exports_external.string().min(1).max(120).regex(/^[^\p{Lu}\p{Lt}]*$/u, "folded to lower case");
|
|
6968
|
+
var CallControlSchema = exports_external.object({
|
|
6969
|
+
kind: CallControlKindSchema,
|
|
6970
|
+
labels: exports_external.array(Folded),
|
|
6971
|
+
automation_ids: exports_external.array(exports_external.string().min(1).max(120)),
|
|
6972
|
+
starts: exports_external.boolean(),
|
|
6973
|
+
beside: exports_external.array(Folded)
|
|
6974
|
+
});
|
|
6975
|
+
var CallPlatformVocabularySchema = exports_external.object({
|
|
6976
|
+
platform: CallPlatformSchema,
|
|
6977
|
+
apps: exports_external.array(Folded),
|
|
6978
|
+
hosts: exports_external.array(Folded),
|
|
6979
|
+
titles: exports_external.array(Folded),
|
|
6980
|
+
controls: exports_external.array(CallControlSchema),
|
|
6981
|
+
surface: exports_external.array(Folded)
|
|
6982
|
+
});
|
|
6983
|
+
var CallControlsSchema = exports_external.object({
|
|
6984
|
+
version: exports_external.string().min(1),
|
|
6985
|
+
browsers: exports_external.array(Folded),
|
|
6986
|
+
platforms: exports_external.array(CallPlatformVocabularySchema)
|
|
6987
|
+
});
|
|
6988
|
+
var control = (kind, labels, starts, beside = [], automation_ids = []) => ({
|
|
6989
|
+
kind,
|
|
6990
|
+
labels,
|
|
6991
|
+
automation_ids,
|
|
6992
|
+
starts,
|
|
6993
|
+
beside
|
|
6994
|
+
});
|
|
6995
|
+
var CALL_CONTROLS = {
|
|
6996
|
+
version: "2026-11-07.3",
|
|
6997
|
+
browsers: [
|
|
6998
|
+
"com.google.chrome",
|
|
6999
|
+
"com.microsoft.edgemac",
|
|
7000
|
+
"org.mozilla.firefox",
|
|
7001
|
+
"com.apple.safari",
|
|
7002
|
+
"com.brave.browser",
|
|
7003
|
+
"company.thebrowser.browser",
|
|
7004
|
+
"chrome",
|
|
7005
|
+
"msedge",
|
|
7006
|
+
"firefox",
|
|
7007
|
+
"brave"
|
|
7008
|
+
],
|
|
7009
|
+
platforms: [
|
|
7010
|
+
{
|
|
7011
|
+
platform: "teams",
|
|
7012
|
+
apps: ["com.microsoft.teams2", "com.microsoft.teams", "ms-teams", "teams"],
|
|
7013
|
+
hosts: ["teams.microsoft.com", "teams.live.com"],
|
|
7014
|
+
titles: ["microsoft teams"],
|
|
7015
|
+
controls: [
|
|
7016
|
+
control("leave", ["hang up"], true),
|
|
7017
|
+
control("leave", ["leave"], true, ["meeting controls", "calling controls", "meeting chat"]),
|
|
7018
|
+
control("mute", ["mute", "unmute", "mute mic", "unmute mic"], false),
|
|
7019
|
+
control("camera", ["turn camera on", "turn camera off", "camera"], false),
|
|
7020
|
+
control("share", ["share", "share content"], false),
|
|
7021
|
+
control("share", ["stop sharing"], true)
|
|
7022
|
+
],
|
|
7023
|
+
surface: [
|
|
7024
|
+
"hang up",
|
|
7025
|
+
"leave",
|
|
7026
|
+
"meeting controls",
|
|
7027
|
+
"calling controls",
|
|
7028
|
+
"meeting chat",
|
|
7029
|
+
"mute",
|
|
7030
|
+
"unmute",
|
|
7031
|
+
"mute mic",
|
|
7032
|
+
"unmute mic",
|
|
7033
|
+
"turn camera on",
|
|
7034
|
+
"turn camera off",
|
|
7035
|
+
"camera",
|
|
7036
|
+
"share",
|
|
7037
|
+
"share content",
|
|
7038
|
+
"stop sharing",
|
|
7039
|
+
"you're sharing your screen",
|
|
7040
|
+
"join now"
|
|
7041
|
+
]
|
|
7042
|
+
},
|
|
7043
|
+
{
|
|
7044
|
+
platform: "zoom",
|
|
7045
|
+
apps: ["us.zoom.xos", "zoom"],
|
|
7046
|
+
hosts: ["zoom.us", "zoom.com"],
|
|
7047
|
+
titles: ["zoom meeting", "zoom workplace"],
|
|
7048
|
+
controls: [
|
|
7049
|
+
control("leave", ["leave", "leave meeting"], true),
|
|
7050
|
+
control("leave", [], true, ["audio", "video"], ["leave"]),
|
|
7051
|
+
control("end", ["end meeting"], true),
|
|
7052
|
+
control("end", ["end"], true, ["mute", "unmute", "start video", "stop video"]),
|
|
7053
|
+
control("mute", ["mute", "unmute", "mute audio", "unmute audio"], false, [], ["audio"]),
|
|
7054
|
+
control("camera", ["start video", "stop video"], false, [], ["video"]),
|
|
7055
|
+
control("share", ["share screen", "share"], false, [], ["share"]),
|
|
7056
|
+
control("window", [], false, [], ["zm.meeting.window.main"]),
|
|
7057
|
+
control("share", ["stop share"], true),
|
|
7058
|
+
control("share", ["zoom share statusbar window"], true)
|
|
7059
|
+
],
|
|
7060
|
+
surface: [
|
|
7061
|
+
"leave",
|
|
7062
|
+
"leave meeting",
|
|
7063
|
+
"end meeting",
|
|
7064
|
+
"end",
|
|
7065
|
+
"mute",
|
|
7066
|
+
"unmute",
|
|
7067
|
+
"mute audio",
|
|
7068
|
+
"unmute audio",
|
|
7069
|
+
"start video",
|
|
7070
|
+
"stop video",
|
|
7071
|
+
"share screen",
|
|
7072
|
+
"share",
|
|
7073
|
+
"stop share",
|
|
7074
|
+
"zoom share statusbar window",
|
|
7075
|
+
"audio",
|
|
7076
|
+
"video",
|
|
7077
|
+
"zm.meeting.window.main",
|
|
7078
|
+
"participants"
|
|
7079
|
+
]
|
|
7080
|
+
},
|
|
7081
|
+
{
|
|
7082
|
+
platform: "meet",
|
|
7083
|
+
apps: [],
|
|
7084
|
+
hosts: ["meet.google.com"],
|
|
7085
|
+
titles: ["meet - ", "google meet"],
|
|
7086
|
+
controls: [
|
|
7087
|
+
control("leave", ["leave call"], true),
|
|
7088
|
+
control("mute", ["turn off microphone", "turn on microphone"], false),
|
|
7089
|
+
control("camera", ["turn off camera", "turn on camera"], false),
|
|
7090
|
+
control("share", ["present now", "share screen"], false)
|
|
7091
|
+
],
|
|
7092
|
+
surface: [
|
|
7093
|
+
"leave call",
|
|
7094
|
+
"turn off microphone",
|
|
7095
|
+
"turn on microphone",
|
|
7096
|
+
"turn off camera",
|
|
7097
|
+
"turn on camera",
|
|
7098
|
+
"present now",
|
|
7099
|
+
"share screen",
|
|
7100
|
+
"join now",
|
|
7101
|
+
"ask to join"
|
|
7102
|
+
]
|
|
7103
|
+
},
|
|
7104
|
+
{
|
|
7105
|
+
platform: "webex",
|
|
7106
|
+
apps: ["cisco-systems.spark", "com.webex.meetingmanager", "webex", "ciscocollabhost"],
|
|
7107
|
+
hosts: ["webex.com"],
|
|
7108
|
+
titles: ["webex"],
|
|
7109
|
+
controls: [
|
|
7110
|
+
control("leave", ["leave meeting", "leave meeting or end meeting for everyone"], true),
|
|
7111
|
+
control("end", ["end meeting"], true),
|
|
7112
|
+
control("mute", ["mute", "unmute"], false),
|
|
7113
|
+
control("camera", ["start video", "stop video"], false)
|
|
7114
|
+
],
|
|
7115
|
+
surface: ["leave meeting", "leave meeting or end meeting for everyone", "end meeting", "mute", "unmute", "start video", "stop video"]
|
|
7116
|
+
},
|
|
7117
|
+
{
|
|
7118
|
+
platform: "slack",
|
|
7119
|
+
apps: ["com.tinyspeck.slackmacgap", "slack"],
|
|
7120
|
+
hosts: [],
|
|
7121
|
+
titles: [],
|
|
7122
|
+
controls: [control("leave", ["leave huddle"], true), control("end", ["end huddle"], true), control("mute", ["mute", "unmute"], false)],
|
|
7123
|
+
surface: ["leave huddle", "end huddle", "mute", "unmute"]
|
|
7124
|
+
}
|
|
7125
|
+
]
|
|
7126
|
+
};
|
|
6840
7127
|
// packages/contracts/src/capture.ts
|
|
6841
7128
|
var captureSampleFields = exports_external.object({
|
|
6842
7129
|
t: TimestampSchema,
|
|
@@ -6969,6 +7256,7 @@ var DEVICE_ROUTES = [
|
|
|
6969
7256
|
{ method: "POST", path: "/v1/intervals/{from}/context", platforms: DESKTOP_PLATFORMS },
|
|
6970
7257
|
{ method: "POST", path: "/v1/device/signals", platforms: DESKTOP_PLATFORMS },
|
|
6971
7258
|
{ method: "POST", path: "/v1/device/clock", platforms: DESKTOP_PLATFORMS },
|
|
7259
|
+
{ method: "POST", path: "/v1/device/calls", platforms: DESKTOP_PLATFORMS },
|
|
6972
7260
|
{ method: "POST", path: "/v1/recordings/{id}/stop", platforms: DESKTOP_PLATFORMS },
|
|
6973
7261
|
{ method: "POST", path: "/v1/recordings/{id}/clock", platforms: DESKTOP_PLATFORMS },
|
|
6974
7262
|
{ method: "POST", path: "/v1/recordings/{id}/skip", platforms: DESKTOP_PLATFORMS },
|
|
@@ -7005,7 +7293,8 @@ var DevicePolicySchema = exports_external.object({
|
|
|
7005
7293
|
time_zone: exports_external.string().min(1).nullable().default(null),
|
|
7006
7294
|
context_retention_days: exports_external.number().int().nonnegative(),
|
|
7007
7295
|
minimum_version: exports_external.string().nullable(),
|
|
7008
|
-
always_on: FirmAlwaysOnSchema.default("member_choice")
|
|
7296
|
+
always_on: FirmAlwaysOnSchema.default("member_choice"),
|
|
7297
|
+
call_controls: CallControlsSchema.optional()
|
|
7009
7298
|
});
|
|
7010
7299
|
var DEVICE_KNOWN_MAX = 16;
|
|
7011
7300
|
var DeviceKnownHeaderSchema = exports_external.string().transform((value) => [...new Set(value.split(",").map((one) => one.trim()).filter((one) => one !== ""))]).pipe(exports_external.array(DeviceIdSchema).max(DEVICE_KNOWN_MAX));
|
|
@@ -7113,7 +7402,40 @@ var SamplerConfigureSchema = exports_external.object({
|
|
|
7113
7402
|
tick_seconds: exports_external.number().int().positive(),
|
|
7114
7403
|
ax_raw: exports_external.boolean().optional()
|
|
7115
7404
|
});
|
|
7116
|
-
var
|
|
7405
|
+
var SamplerHolderSchema = exports_external.object({
|
|
7406
|
+
pid: exports_external.number().int().nonnegative(),
|
|
7407
|
+
image: exports_external.string().min(1),
|
|
7408
|
+
app: CaptureMarkAppSchema,
|
|
7409
|
+
endpoint: exports_external.string().nullable()
|
|
7410
|
+
});
|
|
7411
|
+
var SamplerHoldersSchema = exports_external.object({
|
|
7412
|
+
at: TimestampSchema,
|
|
7413
|
+
holders: exports_external.array(SamplerHolderSchema).max(64)
|
|
7414
|
+
});
|
|
7415
|
+
var SamplerCallRoleSchema = exports_external.enum(["button", "menu_item", "pop_up_button", "toggle", "text", "group", "other"]);
|
|
7416
|
+
var SamplerCallNodeSchema = exports_external.object({
|
|
7417
|
+
r: SamplerCallRoleSchema,
|
|
7418
|
+
n: exports_external.string().max(512),
|
|
7419
|
+
id: exports_external.string().max(256),
|
|
7420
|
+
e: exports_external.boolean(),
|
|
7421
|
+
v: exports_external.boolean(),
|
|
7422
|
+
d: exports_external.number().int().min(0).max(64)
|
|
7423
|
+
});
|
|
7424
|
+
var CALL_WALK_MAX_NODES = 4000;
|
|
7425
|
+
var SamplerCallWindowSchema = exports_external.object({
|
|
7426
|
+
handle: exports_external.string().min(1),
|
|
7427
|
+
title: exports_external.string().max(2048),
|
|
7428
|
+
url: exports_external.string().max(2048).nullable(),
|
|
7429
|
+
minimised: exports_external.boolean(),
|
|
7430
|
+
complete: exports_external.boolean(),
|
|
7431
|
+
nodes: exports_external.array(SamplerCallNodeSchema).max(CALL_WALK_MAX_NODES)
|
|
7432
|
+
});
|
|
7433
|
+
var SamplerCallTreeSchema = exports_external.object({
|
|
7434
|
+
outcome: exports_external.enum(["read", "excluded", "not_running", "no_permission", "timeout"]),
|
|
7435
|
+
windows: exports_external.array(SamplerCallWindowSchema).max(32),
|
|
7436
|
+
ms: exports_external.number().int().nonnegative()
|
|
7437
|
+
});
|
|
7438
|
+
var SamplerRequestKindSchema = exports_external.enum(["app_list", "app_icon", "permissions", "request_permission", "login_item", "call_inspect"]);
|
|
7117
7439
|
var SamplerRequestSchema = exports_external.object({
|
|
7118
7440
|
id: exports_external.string().min(1),
|
|
7119
7441
|
kind: SamplerRequestKindSchema,
|
|
@@ -7125,6 +7447,7 @@ var SamplerLineSchema = exports_external.discriminatedUnion("kind", [
|
|
|
7125
7447
|
exports_external.object({ v: exports_external.literal(SAMPLER_PROTOCOL), kind: exports_external.literal("marks"), body: CaptureMarkBatchSchema }),
|
|
7126
7448
|
exports_external.object({ v: exports_external.literal(SAMPLER_PROTOCOL), kind: exports_external.literal("file"), body: SamplerFilesSchema }),
|
|
7127
7449
|
exports_external.object({ v: exports_external.literal(SAMPLER_PROTOCOL), kind: exports_external.literal("alive"), body: SamplerAliveSchema }),
|
|
7450
|
+
exports_external.object({ v: exports_external.literal(SAMPLER_PROTOCOL), kind: exports_external.literal("holders"), body: SamplerHoldersSchema }),
|
|
7128
7451
|
exports_external.object({ v: exports_external.literal(SAMPLER_PROTOCOL), kind: exports_external.literal("reply"), body: SamplerReplySchema })
|
|
7129
7452
|
]);
|
|
7130
7453
|
var AppLineSchema = exports_external.discriminatedUnion("kind", [
|
|
@@ -7191,7 +7514,8 @@ var DeviceStatusSchema = exports_external.object({
|
|
|
7191
7514
|
oldest_at: TimestampSchema.nullable()
|
|
7192
7515
|
}),
|
|
7193
7516
|
client_outdated: exports_external.boolean(),
|
|
7194
|
-
policy_widening: exports_external.array(exports_external.string().min(1))
|
|
7517
|
+
policy_widening: exports_external.array(exports_external.string().min(1)),
|
|
7518
|
+
call_live: exports_external.boolean().optional()
|
|
7195
7519
|
});
|
|
7196
7520
|
var UpdatePhaseSchema = exports_external.enum(["current", "available", "required"]);
|
|
7197
7521
|
var UpdateAskedSchema = exports_external.enum(["checking", "downloading", "up_to_date", "unreachable"]);
|
|
@@ -7371,6 +7695,8 @@ var eventBase = {
|
|
|
7371
7695
|
id: exports_external.string().uuid(),
|
|
7372
7696
|
at: TimestampSchema
|
|
7373
7697
|
};
|
|
7698
|
+
var Token = exports_external.string().regex(/^[A-Za-z0-9_.-]{1,48}$/).nullable();
|
|
7699
|
+
var callMachine = { os_version: Token, ui_language: Token, vocabulary_version: Token };
|
|
7374
7700
|
var CaptureStartTriggerSchema = exports_external.enum(["button", "tray", "always_on", "launch", "sign_in"]);
|
|
7375
7701
|
var CaptureStopTriggerSchema = exports_external.enum(["button", "tray", "sign_out"]);
|
|
7376
7702
|
var CheckinEventSchema = exports_external.discriminatedUnion("name", [
|
|
@@ -7407,6 +7733,32 @@ var CheckinEventSchema = exports_external.discriminatedUnion("name", [
|
|
|
7407
7733
|
name: exports_external.literal("raw_archive.switched"),
|
|
7408
7734
|
on: exports_external.boolean(),
|
|
7409
7735
|
reason: RawArchiveReasonSchema
|
|
7736
|
+
}),
|
|
7737
|
+
exports_external.object({
|
|
7738
|
+
...eventBase,
|
|
7739
|
+
name: exports_external.literal("call.started"),
|
|
7740
|
+
platform: CallPlatformSchema,
|
|
7741
|
+
client: CallClientSchema,
|
|
7742
|
+
how: CallStartHowSchema,
|
|
7743
|
+
resumed: exports_external.boolean(),
|
|
7744
|
+
hold_seconds: Count,
|
|
7745
|
+
...callMachine
|
|
7746
|
+
}),
|
|
7747
|
+
exports_external.object({
|
|
7748
|
+
...eventBase,
|
|
7749
|
+
name: exports_external.literal("call.ended"),
|
|
7750
|
+
platform: CallPlatformSchema,
|
|
7751
|
+
end: CallEndSchema,
|
|
7752
|
+
minutes: Count,
|
|
7753
|
+
resumed: exports_external.boolean()
|
|
7754
|
+
}),
|
|
7755
|
+
exports_external.object({
|
|
7756
|
+
...eventBase,
|
|
7757
|
+
name: exports_external.literal("call.missed"),
|
|
7758
|
+
platform: CallPlatformSchema,
|
|
7759
|
+
state: CallReadStateSchema,
|
|
7760
|
+
reason: CallReadReasonSchema.nullable(),
|
|
7761
|
+
...callMachine
|
|
7410
7762
|
})
|
|
7411
7763
|
]);
|
|
7412
7764
|
var CheckinSchema = exports_external.object({
|
|
@@ -8385,7 +8737,8 @@ var intervalContextBody = {
|
|
|
8385
8737
|
last_end_before: TimestampSchema.nullable(),
|
|
8386
8738
|
first_end_inside: TimestampSchema.nullable()
|
|
8387
8739
|
}),
|
|
8388
|
-
lost: exports_external.array(exports_external.string()).optional()
|
|
8740
|
+
lost: exports_external.array(exports_external.string()).optional(),
|
|
8741
|
+
calls: exports_external.array(ContextCallSchema).max(8).optional()
|
|
8389
8742
|
};
|
|
8390
8743
|
var IntervalContextSchema = exports_external.object({
|
|
8391
8744
|
schema_version: exports_external.literal(2),
|
|
@@ -8806,7 +9159,7 @@ async function send(ctx, token, method, path, body, actingFor) {
|
|
|
8806
9159
|
}
|
|
8807
9160
|
return { status: response.status, body: parsed, actingAs: response.headers.get(ACTING_AS_HEADER) };
|
|
8808
9161
|
}
|
|
8809
|
-
async function
|
|
9162
|
+
async function call2(ctx, method, path, body, actingFor) {
|
|
8810
9163
|
let session = await currentSession(ctx.io, ctx.environment);
|
|
8811
9164
|
let answer = await send(ctx, session.access_token, method, path, body, actingFor);
|
|
8812
9165
|
if (answer.status === 401) {
|
|
@@ -9071,11 +9424,11 @@ async function runDemo(run2, subcommand) {
|
|
|
9071
9424
|
const tenantId = required(run2.flags, "tenant", "which firm, an internal one");
|
|
9072
9425
|
const path = (rest) => tenantPath(tenantId, rest);
|
|
9073
9426
|
if (subcommand === "on" || subcommand === "off") {
|
|
9074
|
-
const { tenant } = AdminDemoFlagSchema.parse(expectOk(await
|
|
9427
|
+
const { tenant } = AdminDemoFlagSchema.parse(expectOk(await call2(run2.api, "PUT", path("/demo"), { enabled: subcommand === "on" })));
|
|
9075
9428
|
return render(run2, { tenant }, [`tenant ${tenant.id} ${tenant.name}`, `demo ${tenant.demo}`]);
|
|
9076
9429
|
}
|
|
9077
9430
|
if (subcommand === "status") {
|
|
9078
|
-
const status = AdminDemoStatusSchema.parse(expectOk(await
|
|
9431
|
+
const status = AdminDemoStatusSchema.parse(expectOk(await call2(run2.api, "GET", path("/demo"))));
|
|
9079
9432
|
return render(run2, status, [
|
|
9080
9433
|
`tenant ${status.tenant.id} ${status.tenant.name} demo ${status.tenant.demo}`,
|
|
9081
9434
|
`member ${status.member_id}`,
|
|
@@ -9085,7 +9438,7 @@ async function runDemo(run2, subcommand) {
|
|
|
9085
9438
|
}
|
|
9086
9439
|
if (subcommand === "seed") {
|
|
9087
9440
|
const { body, names } = seedBody(run2);
|
|
9088
|
-
const done = AdminDemoSeedResultSchema.parse(expectOk(await
|
|
9441
|
+
const done = AdminDemoSeedResultSchema.parse(expectOk(await call2(run2.api, "POST", path("/demo/seed"), body)));
|
|
9089
9442
|
const invited = (done.members ?? []).map((one) => `member ${one.email} ${one.outcome === "invited" ? "invited" : one.outcome === "member" ? "already a member, skipped" : "already invited, skipped"}`);
|
|
9090
9443
|
if (done.range !== undefined) {
|
|
9091
9444
|
return render(run2, done, [
|
|
@@ -9105,10 +9458,10 @@ async function runDemo(run2, subcommand) {
|
|
|
9105
9458
|
if (subcommand === "reset" || subcommand === "remove") {
|
|
9106
9459
|
const day2 = dayOf2(run2.flags, "day", `the seeded day to ${subcommand}`);
|
|
9107
9460
|
if (subcommand === "remove") {
|
|
9108
|
-
const done2 = AdminDemoRemoveResultSchema.parse(expectOk(await
|
|
9461
|
+
const done2 = AdminDemoRemoveResultSchema.parse(expectOk(await call2(run2.api, "POST", path("/demo/remove"), { day: day2 })));
|
|
9109
9462
|
return render(run2, done2, [`removed ${done2.day}: ${done2.recordings_deleted} recordings, ${done2.entries_deleted} entries`]);
|
|
9110
9463
|
}
|
|
9111
|
-
const done = AdminDemoResetResultSchema.parse(expectOk(await
|
|
9464
|
+
const done = AdminDemoResetResultSchema.parse(expectOk(await call2(run2.api, "POST", path("/demo/reset"), { day: day2, generate: switched(run2.flags, "generate") })));
|
|
9112
9465
|
return render(run2, done, [
|
|
9113
9466
|
`reset ${done.day}: ${done.runs_deleted} Generate runs, ${done.drafts_deleted} drafts deleted, ${done.released_kept} released kept`,
|
|
9114
9467
|
...done.generate_run === null ? [] : [`generate ${done.generate_run}`]
|
|
@@ -9128,7 +9481,7 @@ async function runLearning(run2, subcommand) {
|
|
|
9128
9481
|
if (member !== undefined)
|
|
9129
9482
|
query.set("member", member);
|
|
9130
9483
|
if (subcommand === "terms") {
|
|
9131
|
-
const answer = await
|
|
9484
|
+
const answer = await call2(run2.api, "GET", `${tenantPath(tenant, "/learning/terms")}${query.size === 0 ? "" : `?${query}`}`);
|
|
9132
9485
|
if (answer.status !== 200)
|
|
9133
9486
|
return refused(run2, answer, [actingHead(tenant, answer)]);
|
|
9134
9487
|
const { terms } = AdminLearnedTermsSchema.parse(answer.body);
|
|
@@ -9156,7 +9509,7 @@ async function runLearning(run2, subcommand) {
|
|
|
9156
9509
|
throw new AdminUsageError(`--${name} is a date, YYYY-MM-DD, got ${JSON.stringify(value)}`);
|
|
9157
9510
|
query.set(name, value);
|
|
9158
9511
|
}
|
|
9159
|
-
const answer = await
|
|
9512
|
+
const answer = await call2(run2.api, "GET", `${tenantPath(tenant, "/learning/report")}${query.size === 0 ? "" : `?${query}`}`);
|
|
9160
9513
|
if (answer.status !== 200)
|
|
9161
9514
|
return refused(run2, answer, [actingHead(tenant, answer)]);
|
|
9162
9515
|
const report = AdminLearningReportSchema.parse(answer.body);
|
|
@@ -9241,7 +9594,7 @@ function wantedAlerts() {
|
|
|
9241
9594
|
class PosthogError extends Error {
|
|
9242
9595
|
}
|
|
9243
9596
|
function client(io, project) {
|
|
9244
|
-
const
|
|
9597
|
+
const call3 = async (method, path, body) => {
|
|
9245
9598
|
const response = await io.fetchImpl(`${POSTHOG_API}/api/projects/${encodeURIComponent(project)}${path}`, {
|
|
9246
9599
|
method,
|
|
9247
9600
|
headers: { Authorization: `Bearer ${io.posthogKey}`, "Content-Type": "application/json", Accept: "application/json" },
|
|
@@ -9253,9 +9606,9 @@ function client(io, project) {
|
|
|
9253
9606
|
return text === "" ? null : JSON.parse(text);
|
|
9254
9607
|
};
|
|
9255
9608
|
return {
|
|
9256
|
-
call:
|
|
9609
|
+
call: call3,
|
|
9257
9610
|
async list(path) {
|
|
9258
|
-
const page = await
|
|
9611
|
+
const page = await call3("GET", path);
|
|
9259
9612
|
return page?.results ?? [];
|
|
9260
9613
|
}
|
|
9261
9614
|
};
|
|
@@ -9942,7 +10295,7 @@ ${ADMIN_USAGE}`);
|
|
|
9942
10295
|
async function runLogin(run2) {
|
|
9943
10296
|
const { environment, deps } = run2;
|
|
9944
10297
|
const session = await deviceLogin(deps, environment);
|
|
9945
|
-
const probe = await
|
|
10298
|
+
const probe = await call2(run2.api, "GET", "/v1/admin/audit?limit=1").catch((err) => {
|
|
9946
10299
|
if (err instanceof AdminUsageError && /is not an operator's/.test(err.message)) {
|
|
9947
10300
|
deleteSession(deps.configDir, environment.name);
|
|
9948
10301
|
throw new AdminUsageError(`signed in as ${session.email ?? "unknown address"}, but not to the Sixminute operators organisation, so the ` + `sign-in was not kept. ${signInAgain(environment.name)} and choose "Sixminute operators" on the sign-in screen.`);
|
|
@@ -9975,7 +10328,7 @@ async function runFirm(run2, group, subcommand) {
|
|
|
9975
10328
|
const name = required(flags, "name", "a firm has a name, and it becomes the WorkOS organisation's");
|
|
9976
10329
|
const admin2 = required(flags, "admin", "somebody has to be the firm's first admin");
|
|
9977
10330
|
const role = roleOf(flags, "admin");
|
|
9978
|
-
const done = FirmCreateResultSchema.parse(expectOk(await
|
|
10331
|
+
const done = FirmCreateResultSchema.parse(expectOk(await call2(api2, "POST", "/v1/admin/firms", { name, admin_email: admin2, role })));
|
|
9979
10332
|
const { organization, invitation } = done;
|
|
9980
10333
|
return render(run2, done, [
|
|
9981
10334
|
`organization ${organization.id} ${organization.name}`,
|
|
@@ -9987,14 +10340,14 @@ async function runFirm(run2, group, subcommand) {
|
|
|
9987
10340
|
]);
|
|
9988
10341
|
}
|
|
9989
10342
|
if (group === "firm" && subcommand === "list") {
|
|
9990
|
-
const { organizations } = FirmListSchema.parse(expectOk(await
|
|
10343
|
+
const { organizations } = FirmListSchema.parse(expectOk(await call2(api2, "GET", "/v1/admin/firms")));
|
|
9991
10344
|
return render(run2, { organizations }, organizations.length === 0 ? ["no organisations"] : organizations.map((org) => `${org.id} ${org.name}`));
|
|
9992
10345
|
}
|
|
9993
10346
|
if (group === "firm" && subcommand === "invite") {
|
|
9994
10347
|
const organizationId = required(flags, "org", "an invitation names the firm it is to");
|
|
9995
10348
|
const email = required(flags, "email", "an invitation names the address it goes to");
|
|
9996
10349
|
const role = roleOf(flags, "member");
|
|
9997
|
-
const done = FirmInviteResultSchema.parse(expectOk(await
|
|
10350
|
+
const done = FirmInviteResultSchema.parse(expectOk(await call2(api2, "POST", `/v1/admin/firms/${enc2(organizationId)}/invitations`, { email, role })));
|
|
9998
10351
|
const { invitation } = done;
|
|
9999
10352
|
return render(run2, done, [
|
|
10000
10353
|
`invitation ${invitation.id} ${invitation.email} ${invitation.role} expires ${invitation.expires_at}`,
|
|
@@ -10006,12 +10359,12 @@ async function runFirm(run2, group, subcommand) {
|
|
|
10006
10359
|
}
|
|
10007
10360
|
if (group === "firm" && subcommand === "invitations") {
|
|
10008
10361
|
const organizationId = required(flags, "org", "the pending invitations of which firm");
|
|
10009
|
-
const { invitations } = FirmInvitationsSchema.parse(expectOk(await
|
|
10362
|
+
const { invitations } = FirmInvitationsSchema.parse(expectOk(await call2(api2, "GET", `/v1/admin/firms/${enc2(organizationId)}/invitations`)));
|
|
10010
10363
|
return render(run2, { invitations }, invitations.length === 0 ? ["no pending invitations"] : invitations.map((row) => `${row.id} ${row.email} ${row.role} expires ${row.expires_at}`));
|
|
10011
10364
|
}
|
|
10012
10365
|
if (group === "invite" && subcommand === "revoke") {
|
|
10013
10366
|
const id = required(flags, "id", "which invitation to revoke");
|
|
10014
|
-
const done = InvitationRevokedSchema.parse(expectOk(await
|
|
10367
|
+
const done = InvitationRevokedSchema.parse(expectOk(await call2(api2, "DELETE", `/v1/admin/invitations/${enc2(id)}`)));
|
|
10015
10368
|
return render(run2, done, [`revoked ${done.invitation.id} ${done.invitation.email}`]);
|
|
10016
10369
|
}
|
|
10017
10370
|
throw new AdminUsageError(`unknown command ${JSON.stringify([group, subcommand].filter(Boolean).join(" "))}.
|
|
@@ -10019,14 +10372,14 @@ async function runFirm(run2, group, subcommand) {
|
|
|
10019
10372
|
${ADMIN_USAGE}`);
|
|
10020
10373
|
}
|
|
10021
10374
|
var tenantPath = (tenant, rest = "") => `/v1/admin/tenants/${enc2(tenant)}${rest}`;
|
|
10022
|
-
var firmCall = (run2, tenant, method, path, body) =>
|
|
10375
|
+
var firmCall = (run2, tenant, method, path, body) => call2(run2.api, method, path, body, tenant);
|
|
10023
10376
|
async function runTenantList(run2) {
|
|
10024
|
-
const { tenants } = AdminTenantListSchema.parse(expectOk(await
|
|
10377
|
+
const { tenants } = AdminTenantListSchema.parse(expectOk(await call2(run2.api, "GET", "/v1/admin/tenants")));
|
|
10025
10378
|
return render(run2, { tenants }, tenants.length === 0 ? ["no firms"] : tenants.map((t) => `${t.id} ${t.workos_org_id} ${t.security_tier.padEnd(12)} ${t.internal ? "internal " : " "}${t.name}`));
|
|
10026
10379
|
}
|
|
10027
10380
|
async function runTenantShow(run2) {
|
|
10028
10381
|
const tenantId = required(run2.flags, "tenant", "which firm to show");
|
|
10029
|
-
const t = AdminTenantDetailSchema.parse(expectOk(await
|
|
10382
|
+
const t = AdminTenantDetailSchema.parse(expectOk(await call2(run2.api, "GET", tenantPath(tenantId))));
|
|
10030
10383
|
return render(run2, { tenant: t }, [
|
|
10031
10384
|
`tenant ${t.id} ${t.name}`,
|
|
10032
10385
|
`organization ${t.workos_org_id}`,
|
|
@@ -10045,7 +10398,7 @@ async function runTierSet(run2) {
|
|
|
10045
10398
|
if (tier !== "standard" && tier !== "confidential") {
|
|
10046
10399
|
throw new AdminUsageError(`--tier is standard or confidential, got ${JSON.stringify(tier)}`);
|
|
10047
10400
|
}
|
|
10048
|
-
const done = AdminTierResultSchema.parse(expectOk(await
|
|
10401
|
+
const done = AdminTierResultSchema.parse(expectOk(await call2(run2.api, "PUT", tenantPath(tenantId, "/tier"), { tier })));
|
|
10049
10402
|
const tenant = { id: done.tenant.id, name: done.tenant.name, security_tier: done.security_tier };
|
|
10050
10403
|
if (done.security_tier !== "confidential") {
|
|
10051
10404
|
return render(run2, { tenant }, [`tenant ${tenant.id} ${tenant.name}`, `security_tier ${tenant.security_tier}`]);
|
|
@@ -10064,7 +10417,7 @@ async function runTenantInternalSet(run2) {
|
|
|
10064
10417
|
const tenantId = required(run2.flags, "tenant", "which tenant is being marked");
|
|
10065
10418
|
required(run2.flags, "internal", "true or false");
|
|
10066
10419
|
const internal = booleanOf(run2.flags, "internal");
|
|
10067
|
-
const { tenant } = AdminTenantFlagsSchema.parse(expectOk(await
|
|
10420
|
+
const { tenant } = AdminTenantFlagsSchema.parse(expectOk(await call2(run2.api, "PUT", tenantPath(tenantId, "/internal"), { internal })));
|
|
10068
10421
|
return render(run2, { tenant }, [
|
|
10069
10422
|
`tenant ${tenant.id} ${tenant.name}`,
|
|
10070
10423
|
`internal ${tenant.internal}`,
|
|
@@ -10081,7 +10434,7 @@ async function runRawArchive(run2, subcommand) {
|
|
|
10081
10434
|
}
|
|
10082
10435
|
const allow = subcommand === "allow";
|
|
10083
10436
|
const tenantId = required(run2.flags, "tenant", "which tenant the raw archive is being set for");
|
|
10084
|
-
const { tenant } = AdminTenantFlagsSchema.parse(expectOk(await
|
|
10437
|
+
const { tenant } = AdminTenantFlagsSchema.parse(expectOk(await call2(run2.api, "PUT", tenantPath(tenantId, "/raw-archive"), { allowed: allow })));
|
|
10085
10438
|
return render(run2, { tenant: { id: tenant.id, name: tenant.name, raw_archive: tenant.raw_archive } }, [
|
|
10086
10439
|
`tenant ${tenant.id} ${tenant.name}`,
|
|
10087
10440
|
`raw_archive ${tenant.raw_archive}`,
|
|
@@ -10091,7 +10444,7 @@ async function runRawArchive(run2, subcommand) {
|
|
|
10091
10444
|
}
|
|
10092
10445
|
async function runShadowReport(run2) {
|
|
10093
10446
|
const day2 = required(run2.flags, "day", "which local day, YYYY-MM-DD");
|
|
10094
|
-
const found = ShadowReportSchema.parse(expectOk(await
|
|
10447
|
+
const found = ShadowReportSchema.parse(expectOk(await call2(run2.api, "GET", `/v1/admin/pipeline/shadow-report?day=${encodeURIComponent(day2)}`)));
|
|
10095
10448
|
const pct2 = (part, whole) => whole === 0 ? "-" : `${Math.round(100 * part / whole)}%`;
|
|
10096
10449
|
return render(run2, found, [
|
|
10097
10450
|
`day ${found.day}`,
|
|
@@ -10103,7 +10456,7 @@ async function runRetentionSet(run2) {
|
|
|
10103
10456
|
const days2 = Number(required(run2.flags, "days", "how many days after each interval's day its context is kept"));
|
|
10104
10457
|
if (!Number.isInteger(days2) || days2 < 1 || days2 > 365)
|
|
10105
10458
|
throw new AdminUsageError("--days is a whole number from 1 to 365.");
|
|
10106
|
-
const done = AdminContextRetentionResultSchema.parse(expectOk(await
|
|
10459
|
+
const done = AdminContextRetentionResultSchema.parse(expectOk(await call2(run2.api, "PUT", tenantPath(tenantId, "/context-retention"), { days: days2 })));
|
|
10107
10460
|
const moved = Object.entries(done.shifted).map(([table2, rows]) => `${table2} ${rows}`).join(", ");
|
|
10108
10461
|
return render(run2, done, [
|
|
10109
10462
|
`tenant ${done.tenant.id} ${done.tenant.name}`,
|
|
@@ -10122,7 +10475,7 @@ async function runNarrativeInstructions(run2, set) {
|
|
|
10122
10475
|
throw new AdminUsageError(`--file ${file} is not readable: ${err.message}`);
|
|
10123
10476
|
}
|
|
10124
10477
|
}
|
|
10125
|
-
const answer = await
|
|
10478
|
+
const answer = await call2(run2.api, set ? "PUT" : "GET", tenantPath(tenantId, "/narrative-instructions"), body);
|
|
10126
10479
|
if (answer.status !== 200)
|
|
10127
10480
|
return refused(run2, answer, [actingHead(tenantId, answer)]);
|
|
10128
10481
|
const done = AdminNarrativeInstructionsSchema.parse(answer.body);
|
|
@@ -10138,7 +10491,7 @@ async function runNarrativeActivities(run2, set) {
|
|
|
10138
10491
|
const tenantId = required(run2.flags, "tenant", "whose narrative activities");
|
|
10139
10492
|
const file = set ? required(run2.flags, "file", "the table is a JSON array of rows, by rank, in a file") : optional(run2.flags, "file");
|
|
10140
10493
|
const body = set ? { activities: readDocument(file, NarrativeActivitiesSchema, "a narrative activity table (a JSON array of rows, by rank)", "file").raw } : undefined;
|
|
10141
|
-
const answer = await
|
|
10494
|
+
const answer = await call2(run2.api, set ? "PUT" : "GET", tenantPath(tenantId, "/narrative-activities"), body);
|
|
10142
10495
|
if (answer.status !== 200)
|
|
10143
10496
|
return refused(run2, answer, [actingHead(tenantId, answer)]);
|
|
10144
10497
|
const done = AdminNarrativeActivitiesSchema.parse(answer.body);
|
|
@@ -10156,7 +10509,7 @@ async function runNarrativeActivities(run2, set) {
|
|
|
10156
10509
|
var ScrubStartedSchema = exports_external.object({ tenant: exports_external.string(), started: exports_external.number().int().nonnegative() });
|
|
10157
10510
|
async function runScrubPlaintext(run2) {
|
|
10158
10511
|
const tenantId = required(run2.flags, "tenant", "whose old rows to scrub");
|
|
10159
|
-
const done = ScrubStartedSchema.parse(expectOk(await
|
|
10512
|
+
const done = ScrubStartedSchema.parse(expectOk(await call2(run2.api, "POST", tenantPath(tenantId, "/scrub-plaintext"))));
|
|
10160
10513
|
return render(run2, done, [
|
|
10161
10514
|
`tenant ${done.tenant}`,
|
|
10162
10515
|
`started ${done.started} scrub job(s), one per active member`
|
|
@@ -10164,7 +10517,7 @@ async function runScrubPlaintext(run2) {
|
|
|
10164
10517
|
}
|
|
10165
10518
|
async function runVersions(run2) {
|
|
10166
10519
|
const tenantId = required(run2.flags, "tenant", "whose devices");
|
|
10167
|
-
const found = AdminDeviceVersionListSchema.parse(expectOk(await
|
|
10520
|
+
const found = AdminDeviceVersionListSchema.parse(expectOk(await call2(run2.api, "GET", tenantPath(tenantId, "/devices"))));
|
|
10168
10521
|
return render(run2, found, [
|
|
10169
10522
|
`tenant ${tenantId}${found.tenant.internal ? " (internal)" : ""}`,
|
|
10170
10523
|
...found.devices.length === 0 ? ["no devices"] : found.devices.map((d) => `${d.id} ${d.version ?? "unknown"} ${d.version_seen_at ?? "never"} ${d.platform} ` + `${d.email ?? "?"} ${d.name}${d.revoked ? " (revoked)" : ""}`)
|
|
@@ -10184,7 +10537,7 @@ async function runEntriesPurge(run2) {
|
|
|
10184
10537
|
}
|
|
10185
10538
|
const dryRun = switched(flags, "dry-run");
|
|
10186
10539
|
const yes = switched(flags, "yes");
|
|
10187
|
-
const purge = async (dry) => AdminEntriesPurgeResultSchema.parse(expectOk(await
|
|
10540
|
+
const purge = async (dry) => AdminEntriesPurgeResultSchema.parse(expectOk(await call2(run2.api, "POST", tenantPath(tenantId, "/entries/purge"), { author, demo: demo2, unmatched, dry_run: dry })));
|
|
10188
10541
|
const done = await purge(dryRun || !yes);
|
|
10189
10542
|
const total = done.rows.demo.length + done.rows.unmatched.length;
|
|
10190
10543
|
const listing = [
|
|
@@ -10232,7 +10585,7 @@ async function runAudit(run2) {
|
|
|
10232
10585
|
query.set("limit", limit);
|
|
10233
10586
|
}
|
|
10234
10587
|
const q = query.toString();
|
|
10235
|
-
const { actions } = OperatorAuditListSchema.parse(expectOk(await
|
|
10588
|
+
const { actions } = OperatorAuditListSchema.parse(expectOk(await call2(run2.api, "GET", `/v1/admin/audit${q === "" ? "" : `?${q}`}`)));
|
|
10236
10589
|
return render(run2, { actions }, actions.length === 0 ? ["no operator actions"] : actions.map((a) => `${a.created_at} ${a.status.padEnd(7)} ${String(a.http_status ?? "").padEnd(3)} ${a.action} ` + `${a.operator_email ?? a.operator_sub}${a.tenant_id === null ? "" : ` ${a.tenant_id}`}` + `${a.subject === null ? "" : ` ${a.subject}`}`));
|
|
10237
10590
|
}
|
|
10238
10591
|
async function runVocabulary(run2, group, subcommand, action, positionals) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisonlabs/sixminute-admin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1397-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": {
|