@company-semantics/contracts 2.8.0 → 2.11.0
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/package.json +1 -1
- package/src/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +440 -0
- package/src/index.ts +5 -0
- package/src/permissions/access-levels.ts +40 -0
- package/src/permissions/access-source.ts +28 -0
- package/src/permissions/index.ts +9 -0
- package/src/permissions/orgchart-roles.ts +24 -0
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
|
|
2
|
-
export const SPEC_HASH = '
|
|
3
|
-
export const SPEC_HASH_FULL = '
|
|
2
|
+
export const SPEC_HASH = 'ed5f74bd901b' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = 'ed5f74bd901b8b8cf6bfd08165b7f885e0493ca1d1f83db11ddb8df8c65d5732' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -1402,6 +1402,23 @@ export interface paths {
|
|
|
1402
1402
|
patch?: never;
|
|
1403
1403
|
trace?: never;
|
|
1404
1404
|
};
|
|
1405
|
+
"/api/company-md/search": {
|
|
1406
|
+
parameters: {
|
|
1407
|
+
query?: never;
|
|
1408
|
+
header?: never;
|
|
1409
|
+
path?: never;
|
|
1410
|
+
cookie?: never;
|
|
1411
|
+
};
|
|
1412
|
+
get?: never;
|
|
1413
|
+
put?: never;
|
|
1414
|
+
/** Search Company.md knowledge across opted-in sources */
|
|
1415
|
+
post: operations["searchCompanyMd"];
|
|
1416
|
+
delete?: never;
|
|
1417
|
+
options?: never;
|
|
1418
|
+
head?: never;
|
|
1419
|
+
patch?: never;
|
|
1420
|
+
trace?: never;
|
|
1421
|
+
};
|
|
1405
1422
|
"/api/company-md/docs/{slug}/sharing": {
|
|
1406
1423
|
parameters: {
|
|
1407
1424
|
query?: never;
|
|
@@ -2313,6 +2330,91 @@ export interface paths {
|
|
|
2313
2330
|
patch?: never;
|
|
2314
2331
|
trace?: never;
|
|
2315
2332
|
};
|
|
2333
|
+
"/api/me/meetings/recordings/{id}/export": {
|
|
2334
|
+
parameters: {
|
|
2335
|
+
query?: never;
|
|
2336
|
+
header?: never;
|
|
2337
|
+
path?: never;
|
|
2338
|
+
cookie?: never;
|
|
2339
|
+
};
|
|
2340
|
+
get?: never;
|
|
2341
|
+
put?: never;
|
|
2342
|
+
/** Export a transcript as markdown/JSON (sync) or PDF (async job) */
|
|
2343
|
+
post: operations["exportMeetingRecording"];
|
|
2344
|
+
delete?: never;
|
|
2345
|
+
options?: never;
|
|
2346
|
+
head?: never;
|
|
2347
|
+
patch?: never;
|
|
2348
|
+
trace?: never;
|
|
2349
|
+
};
|
|
2350
|
+
"/api/me/meetings/recordings/{id}/export/{jobId}": {
|
|
2351
|
+
parameters: {
|
|
2352
|
+
query?: never;
|
|
2353
|
+
header?: never;
|
|
2354
|
+
path?: never;
|
|
2355
|
+
cookie?: never;
|
|
2356
|
+
};
|
|
2357
|
+
/** Download a rendered PDF export, or poll its job status */
|
|
2358
|
+
get: operations["downloadMeetingRecordingExport"];
|
|
2359
|
+
put?: never;
|
|
2360
|
+
post?: never;
|
|
2361
|
+
delete?: never;
|
|
2362
|
+
options?: never;
|
|
2363
|
+
head?: never;
|
|
2364
|
+
patch?: never;
|
|
2365
|
+
trace?: never;
|
|
2366
|
+
};
|
|
2367
|
+
"/api/me/meetings/recordings/{id}": {
|
|
2368
|
+
parameters: {
|
|
2369
|
+
query?: never;
|
|
2370
|
+
header?: never;
|
|
2371
|
+
path?: never;
|
|
2372
|
+
cookie?: never;
|
|
2373
|
+
};
|
|
2374
|
+
get?: never;
|
|
2375
|
+
put?: never;
|
|
2376
|
+
post?: never;
|
|
2377
|
+
/** Soft-delete a recording (30-day hard-delete grace; idempotent) */
|
|
2378
|
+
delete: operations["softDeleteMeetingRecording"];
|
|
2379
|
+
options?: never;
|
|
2380
|
+
head?: never;
|
|
2381
|
+
patch?: never;
|
|
2382
|
+
trace?: never;
|
|
2383
|
+
};
|
|
2384
|
+
"/api/me/meetings/recordings/{id}/restore": {
|
|
2385
|
+
parameters: {
|
|
2386
|
+
query?: never;
|
|
2387
|
+
header?: never;
|
|
2388
|
+
path?: never;
|
|
2389
|
+
cookie?: never;
|
|
2390
|
+
};
|
|
2391
|
+
get?: never;
|
|
2392
|
+
put?: never;
|
|
2393
|
+
/** Restore a soft-deleted recording within its 30-day window */
|
|
2394
|
+
post: operations["restoreMeetingRecording"];
|
|
2395
|
+
delete?: never;
|
|
2396
|
+
options?: never;
|
|
2397
|
+
head?: never;
|
|
2398
|
+
patch?: never;
|
|
2399
|
+
trace?: never;
|
|
2400
|
+
};
|
|
2401
|
+
"/api/me/meetings/recordings/{id}/visibility": {
|
|
2402
|
+
parameters: {
|
|
2403
|
+
query?: never;
|
|
2404
|
+
header?: never;
|
|
2405
|
+
path?: never;
|
|
2406
|
+
cookie?: never;
|
|
2407
|
+
};
|
|
2408
|
+
get?: never;
|
|
2409
|
+
put?: never;
|
|
2410
|
+
/** Change recording visibility (post-finalize only) */
|
|
2411
|
+
post: operations["changeMeetingRecordingVisibility"];
|
|
2412
|
+
delete?: never;
|
|
2413
|
+
options?: never;
|
|
2414
|
+
head?: never;
|
|
2415
|
+
patch?: never;
|
|
2416
|
+
trace?: never;
|
|
2417
|
+
};
|
|
2316
2418
|
"/api/internal-admin/impersonate/start": {
|
|
2317
2419
|
parameters: {
|
|
2318
2420
|
query?: never;
|
|
@@ -3332,6 +3434,32 @@ export interface components {
|
|
|
3332
3434
|
AssociateContextDocRequest: {
|
|
3333
3435
|
contextDocSlug: string;
|
|
3334
3436
|
};
|
|
3437
|
+
/** @description Ranked retrieval hits plus the source kinds actually searched. */
|
|
3438
|
+
CompanyMdSearchResponse: {
|
|
3439
|
+
hits: {
|
|
3440
|
+
/** @enum {string} */
|
|
3441
|
+
sourceKind: "docs" | "slack" | "meetings";
|
|
3442
|
+
documentId: string;
|
|
3443
|
+
recordingId: string | null;
|
|
3444
|
+
title: string | null;
|
|
3445
|
+
snippet: string;
|
|
3446
|
+
score: number;
|
|
3447
|
+
/** @enum {string} */
|
|
3448
|
+
matchedVia: "fts" | "vector";
|
|
3449
|
+
}[];
|
|
3450
|
+
searchedSources: ("docs" | "slack" | "meetings")[];
|
|
3451
|
+
};
|
|
3452
|
+
/** @description A Company.md retrieval query with optional per-source opt-in. */
|
|
3453
|
+
CompanyMdSearchRequest: {
|
|
3454
|
+
query: string;
|
|
3455
|
+
limit?: number;
|
|
3456
|
+
/** @description Per-source opt-in. Server defaults: docs/slack ON, meetings OFF (INV-MTG-23) — applied even when this object or the meetings field is omitted. */
|
|
3457
|
+
includeSources?: {
|
|
3458
|
+
docs?: boolean;
|
|
3459
|
+
slack?: boolean;
|
|
3460
|
+
meetings?: boolean;
|
|
3461
|
+
};
|
|
3462
|
+
};
|
|
3335
3463
|
CompanyMdShareResponse: {
|
|
3336
3464
|
/** @enum {string} */
|
|
3337
3465
|
sharingPolicy: "restricted" | "org_read" | "org_comment" | "org_edit";
|
|
@@ -4068,6 +4196,112 @@ export interface components {
|
|
|
4068
4196
|
checksum: string;
|
|
4069
4197
|
cancelled?: boolean;
|
|
4070
4198
|
};
|
|
4199
|
+
/** @description Synchronous markdown/JSON content, or a queued PDF job id. */
|
|
4200
|
+
ExportMeetingRecordingResponse: {
|
|
4201
|
+
/** @constant */
|
|
4202
|
+
format: "markdown";
|
|
4203
|
+
content: string;
|
|
4204
|
+
} | {
|
|
4205
|
+
/** @constant */
|
|
4206
|
+
format: "json";
|
|
4207
|
+
/** @description Finalized read projection for a recording (excludes drafts). */
|
|
4208
|
+
metadata: {
|
|
4209
|
+
/** @description ULID; unified trace key for the recording (INV-MTG-7). */
|
|
4210
|
+
recordingId: string;
|
|
4211
|
+
/** Format: uuid */
|
|
4212
|
+
ownerUserId: string;
|
|
4213
|
+
/** Format: uuid */
|
|
4214
|
+
orgId: string;
|
|
4215
|
+
title: string | null;
|
|
4216
|
+
/**
|
|
4217
|
+
* @description Auto-detected meeting app that owns the system audio stream.
|
|
4218
|
+
* @enum {string}
|
|
4219
|
+
*/
|
|
4220
|
+
detectedApp: "zoom" | "teams" | "meet-browser" | "slack-huddle" | "manual";
|
|
4221
|
+
/**
|
|
4222
|
+
* @description Visibility band for the finalized meeting projection. Default `meeting_only`.
|
|
4223
|
+
* @enum {string}
|
|
4224
|
+
*/
|
|
4225
|
+
visibility: "meeting_only" | "shared" | "org" | "finalized_private";
|
|
4226
|
+
/**
|
|
4227
|
+
* @description Coarse lifecycle state for a recording entity.
|
|
4228
|
+
* @enum {string}
|
|
4229
|
+
*/
|
|
4230
|
+
status: "draft" | "recording" | "processing" | "finalized" | "failed" | "partial-transcript-network" | "cancelled";
|
|
4231
|
+
/**
|
|
4232
|
+
* @description Capture-runtime quality signal. `degraded` triggers a UI hint.
|
|
4233
|
+
* @enum {string}
|
|
4234
|
+
*/
|
|
4235
|
+
quality: "clean" | "degraded";
|
|
4236
|
+
/** Format: date-time */
|
|
4237
|
+
startedAt: string;
|
|
4238
|
+
endedAt: string | null;
|
|
4239
|
+
durationMs: number;
|
|
4240
|
+
participantUserIds: string[];
|
|
4241
|
+
transcriptAvailable: boolean;
|
|
4242
|
+
};
|
|
4243
|
+
segments: {
|
|
4244
|
+
startMs: number;
|
|
4245
|
+
endMs: number;
|
|
4246
|
+
/** @enum {string} */
|
|
4247
|
+
source: "mic" | "remote" | "unknown";
|
|
4248
|
+
speakerLabel: string | null;
|
|
4249
|
+
text: string;
|
|
4250
|
+
confidence: number | null;
|
|
4251
|
+
}[];
|
|
4252
|
+
} | {
|
|
4253
|
+
/** @constant */
|
|
4254
|
+
format: "pdf";
|
|
4255
|
+
/** Format: uuid */
|
|
4256
|
+
jobId: string;
|
|
4257
|
+
/** @constant */
|
|
4258
|
+
status: "queued";
|
|
4259
|
+
};
|
|
4260
|
+
/** @description Export a recording transcript as markdown, JSON, or PDF. */
|
|
4261
|
+
ExportMeetingRecordingRequest: {
|
|
4262
|
+
/** @enum {string} */
|
|
4263
|
+
format: "markdown" | "json" | "pdf";
|
|
4264
|
+
};
|
|
4265
|
+
/** @description PDF export job not yet ready (pending) or failed. */
|
|
4266
|
+
MeetingRecordingExportJobStatus: {
|
|
4267
|
+
/** Format: uuid */
|
|
4268
|
+
jobId: string;
|
|
4269
|
+
/** @enum {string} */
|
|
4270
|
+
status: "pending" | "failed";
|
|
4271
|
+
};
|
|
4272
|
+
/** @description Recording soft-deleted; hard-delete scheduled 30 days out. */
|
|
4273
|
+
SoftDeleteMeetingRecordingResponse: {
|
|
4274
|
+
/** @description ULID; unified trace key for the recording (INV-MTG-7). */
|
|
4275
|
+
recordingId: string;
|
|
4276
|
+
/** @constant */
|
|
4277
|
+
deleted: true;
|
|
4278
|
+
hardDeleteScheduledAt: string | null;
|
|
4279
|
+
};
|
|
4280
|
+
/** @description Restore a soft-deleted recording within its grace window. */
|
|
4281
|
+
RestoreMeetingRecordingResponse: {
|
|
4282
|
+
/** @description ULID; unified trace key for the recording (INV-MTG-7). */
|
|
4283
|
+
recordingId: string;
|
|
4284
|
+
restored: boolean;
|
|
4285
|
+
status: string;
|
|
4286
|
+
};
|
|
4287
|
+
/** @description Result of a visibility change. */
|
|
4288
|
+
ChangeMeetingRecordingVisibilityResponse: {
|
|
4289
|
+
/** @description ULID; unified trace key for the recording (INV-MTG-7). */
|
|
4290
|
+
recordingId: string;
|
|
4291
|
+
/**
|
|
4292
|
+
* @description Visibility band for the finalized meeting projection. Default `meeting_only`.
|
|
4293
|
+
* @enum {string}
|
|
4294
|
+
*/
|
|
4295
|
+
visibility: "meeting_only" | "shared" | "org" | "finalized_private";
|
|
4296
|
+
};
|
|
4297
|
+
/** @description Change a recording visibility (post-finalize only). */
|
|
4298
|
+
ChangeMeetingRecordingVisibilityRequest: {
|
|
4299
|
+
/**
|
|
4300
|
+
* @description Visibility band for the finalized meeting projection. Default `meeting_only`.
|
|
4301
|
+
* @enum {string}
|
|
4302
|
+
*/
|
|
4303
|
+
visibility: "meeting_only" | "shared" | "org" | "finalized_private";
|
|
4304
|
+
};
|
|
4071
4305
|
ImpersonationSessionResponse: {
|
|
4072
4306
|
session: {
|
|
4073
4307
|
impersonationSessionId: string;
|
|
@@ -6251,6 +6485,44 @@ export interface operations {
|
|
|
6251
6485
|
};
|
|
6252
6486
|
};
|
|
6253
6487
|
};
|
|
6488
|
+
searchCompanyMd: {
|
|
6489
|
+
parameters: {
|
|
6490
|
+
query?: never;
|
|
6491
|
+
header?: never;
|
|
6492
|
+
path?: never;
|
|
6493
|
+
cookie?: never;
|
|
6494
|
+
};
|
|
6495
|
+
requestBody: {
|
|
6496
|
+
content: {
|
|
6497
|
+
"application/json": components["schemas"]["CompanyMdSearchRequest"];
|
|
6498
|
+
};
|
|
6499
|
+
};
|
|
6500
|
+
responses: {
|
|
6501
|
+
/** @description Ranked retrieval hits plus the source kinds searched */
|
|
6502
|
+
200: {
|
|
6503
|
+
headers: {
|
|
6504
|
+
[name: string]: unknown;
|
|
6505
|
+
};
|
|
6506
|
+
content: {
|
|
6507
|
+
"application/json": components["schemas"]["CompanyMdSearchResponse"];
|
|
6508
|
+
};
|
|
6509
|
+
};
|
|
6510
|
+
/** @description Invalid query body */
|
|
6511
|
+
400: {
|
|
6512
|
+
headers: {
|
|
6513
|
+
[name: string]: unknown;
|
|
6514
|
+
};
|
|
6515
|
+
content?: never;
|
|
6516
|
+
};
|
|
6517
|
+
/** @description Requires org.view_company_md scope */
|
|
6518
|
+
403: {
|
|
6519
|
+
headers: {
|
|
6520
|
+
[name: string]: unknown;
|
|
6521
|
+
};
|
|
6522
|
+
content?: never;
|
|
6523
|
+
};
|
|
6524
|
+
};
|
|
6525
|
+
};
|
|
6254
6526
|
getCompanyMdDocSharing: {
|
|
6255
6527
|
parameters: {
|
|
6256
6528
|
query?: never;
|
|
@@ -7783,6 +8055,174 @@ export interface operations {
|
|
|
7783
8055
|
};
|
|
7784
8056
|
};
|
|
7785
8057
|
};
|
|
8058
|
+
exportMeetingRecording: {
|
|
8059
|
+
parameters: {
|
|
8060
|
+
query?: never;
|
|
8061
|
+
header?: never;
|
|
8062
|
+
path: {
|
|
8063
|
+
id: string;
|
|
8064
|
+
};
|
|
8065
|
+
cookie?: never;
|
|
8066
|
+
};
|
|
8067
|
+
requestBody: {
|
|
8068
|
+
content: {
|
|
8069
|
+
"application/json": components["schemas"]["ExportMeetingRecordingRequest"];
|
|
8070
|
+
};
|
|
8071
|
+
};
|
|
8072
|
+
responses: {
|
|
8073
|
+
/** @description Markdown/JSON content inline, or a queued PDF job id */
|
|
8074
|
+
200: {
|
|
8075
|
+
headers: {
|
|
8076
|
+
[name: string]: unknown;
|
|
8077
|
+
};
|
|
8078
|
+
content: {
|
|
8079
|
+
"application/json": components["schemas"]["ExportMeetingRecordingResponse"];
|
|
8080
|
+
};
|
|
8081
|
+
};
|
|
8082
|
+
/** @description Recording not found or not owned by this user */
|
|
8083
|
+
404: {
|
|
8084
|
+
headers: {
|
|
8085
|
+
[name: string]: unknown;
|
|
8086
|
+
};
|
|
8087
|
+
content?: never;
|
|
8088
|
+
};
|
|
8089
|
+
};
|
|
8090
|
+
};
|
|
8091
|
+
downloadMeetingRecordingExport: {
|
|
8092
|
+
parameters: {
|
|
8093
|
+
query?: never;
|
|
8094
|
+
header?: never;
|
|
8095
|
+
path: {
|
|
8096
|
+
id: string;
|
|
8097
|
+
jobId: string;
|
|
8098
|
+
};
|
|
8099
|
+
cookie?: never;
|
|
8100
|
+
};
|
|
8101
|
+
requestBody?: never;
|
|
8102
|
+
responses: {
|
|
8103
|
+
/** @description The rendered PDF */
|
|
8104
|
+
200: {
|
|
8105
|
+
headers: {
|
|
8106
|
+
[name: string]: unknown;
|
|
8107
|
+
};
|
|
8108
|
+
content?: never;
|
|
8109
|
+
};
|
|
8110
|
+
/** @description PDF not yet ready (pending) or failed */
|
|
8111
|
+
202: {
|
|
8112
|
+
headers: {
|
|
8113
|
+
[name: string]: unknown;
|
|
8114
|
+
};
|
|
8115
|
+
content: {
|
|
8116
|
+
"application/json": components["schemas"]["MeetingRecordingExportJobStatus"];
|
|
8117
|
+
};
|
|
8118
|
+
};
|
|
8119
|
+
/** @description Recording or export job not found / not owned by this user */
|
|
8120
|
+
404: {
|
|
8121
|
+
headers: {
|
|
8122
|
+
[name: string]: unknown;
|
|
8123
|
+
};
|
|
8124
|
+
content?: never;
|
|
8125
|
+
};
|
|
8126
|
+
};
|
|
8127
|
+
};
|
|
8128
|
+
softDeleteMeetingRecording: {
|
|
8129
|
+
parameters: {
|
|
8130
|
+
query?: never;
|
|
8131
|
+
header?: never;
|
|
8132
|
+
path: {
|
|
8133
|
+
id: string;
|
|
8134
|
+
};
|
|
8135
|
+
cookie?: never;
|
|
8136
|
+
};
|
|
8137
|
+
requestBody?: never;
|
|
8138
|
+
responses: {
|
|
8139
|
+
/** @description Recording soft-deleted */
|
|
8140
|
+
200: {
|
|
8141
|
+
headers: {
|
|
8142
|
+
[name: string]: unknown;
|
|
8143
|
+
};
|
|
8144
|
+
content: {
|
|
8145
|
+
"application/json": components["schemas"]["SoftDeleteMeetingRecordingResponse"];
|
|
8146
|
+
};
|
|
8147
|
+
};
|
|
8148
|
+
/** @description Recording not found or not owned by this user */
|
|
8149
|
+
404: {
|
|
8150
|
+
headers: {
|
|
8151
|
+
[name: string]: unknown;
|
|
8152
|
+
};
|
|
8153
|
+
content?: never;
|
|
8154
|
+
};
|
|
8155
|
+
};
|
|
8156
|
+
};
|
|
8157
|
+
restoreMeetingRecording: {
|
|
8158
|
+
parameters: {
|
|
8159
|
+
query?: never;
|
|
8160
|
+
header?: never;
|
|
8161
|
+
path: {
|
|
8162
|
+
id: string;
|
|
8163
|
+
};
|
|
8164
|
+
cookie?: never;
|
|
8165
|
+
};
|
|
8166
|
+
requestBody?: never;
|
|
8167
|
+
responses: {
|
|
8168
|
+
/** @description Recording restored (or a no-op outside the window) */
|
|
8169
|
+
200: {
|
|
8170
|
+
headers: {
|
|
8171
|
+
[name: string]: unknown;
|
|
8172
|
+
};
|
|
8173
|
+
content: {
|
|
8174
|
+
"application/json": components["schemas"]["RestoreMeetingRecordingResponse"];
|
|
8175
|
+
};
|
|
8176
|
+
};
|
|
8177
|
+
/** @description Recording not found or not owned by this user */
|
|
8178
|
+
404: {
|
|
8179
|
+
headers: {
|
|
8180
|
+
[name: string]: unknown;
|
|
8181
|
+
};
|
|
8182
|
+
content?: never;
|
|
8183
|
+
};
|
|
8184
|
+
};
|
|
8185
|
+
};
|
|
8186
|
+
changeMeetingRecordingVisibility: {
|
|
8187
|
+
parameters: {
|
|
8188
|
+
query?: never;
|
|
8189
|
+
header?: never;
|
|
8190
|
+
path: {
|
|
8191
|
+
id: string;
|
|
8192
|
+
};
|
|
8193
|
+
cookie?: never;
|
|
8194
|
+
};
|
|
8195
|
+
requestBody: {
|
|
8196
|
+
content: {
|
|
8197
|
+
"application/json": components["schemas"]["ChangeMeetingRecordingVisibilityRequest"];
|
|
8198
|
+
};
|
|
8199
|
+
};
|
|
8200
|
+
responses: {
|
|
8201
|
+
/** @description Visibility changed */
|
|
8202
|
+
200: {
|
|
8203
|
+
headers: {
|
|
8204
|
+
[name: string]: unknown;
|
|
8205
|
+
};
|
|
8206
|
+
content: {
|
|
8207
|
+
"application/json": components["schemas"]["ChangeMeetingRecordingVisibilityResponse"];
|
|
8208
|
+
};
|
|
8209
|
+
};
|
|
8210
|
+
/** @description Recording not found or not owned by this user */
|
|
8211
|
+
404: {
|
|
8212
|
+
headers: {
|
|
8213
|
+
[name: string]: unknown;
|
|
8214
|
+
};
|
|
8215
|
+
content?: never;
|
|
8216
|
+
};
|
|
8217
|
+
/** @description Cannot change visibility while recording (pre-finalize) */
|
|
8218
|
+
409: {
|
|
8219
|
+
headers: {
|
|
8220
|
+
[name: string]: unknown;
|
|
8221
|
+
};
|
|
8222
|
+
content?: never;
|
|
8223
|
+
};
|
|
8224
|
+
};
|
|
8225
|
+
};
|
|
7786
8226
|
startImpersonation: {
|
|
7787
8227
|
parameters: {
|
|
7788
8228
|
query?: never;
|
package/src/index.ts
CHANGED
|
@@ -747,3 +747,8 @@ export type {
|
|
|
747
747
|
// Meeting recorder vocabulary (PRD-00651)
|
|
748
748
|
// @see ./meetings/schemas.ts for invariants
|
|
749
749
|
export * from './meetings'
|
|
750
|
+
|
|
751
|
+
// Permission model vocabulary (PRD-00669 AUTH-001)
|
|
752
|
+
// AccessLevel / OrgChartRole / AccessSource — see ADR-CTRL-084..088.
|
|
753
|
+
// No consumers in this PRD; cutover starts in AUTH-002 (PRD-00670).
|
|
754
|
+
export * from './permissions'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permission Access Levels
|
|
3
|
+
*
|
|
4
|
+
* Canonical four-level access vocabulary for object permissions across
|
|
5
|
+
* Company Semantics, modeled on the Google-Docs four-level scheme.
|
|
6
|
+
*
|
|
7
|
+
* Authority: ADR-CTRL-085 (Rights Table). See ADR-CTRL-084 for how these
|
|
8
|
+
* levels are materialized into `effective_acl_grants`, and ADR-CTRL-086 for
|
|
9
|
+
* the aggregation rule (most-permissive across sources).
|
|
10
|
+
*
|
|
11
|
+
* The commenter level is currently a stub — see ADR-CTRL-087.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
|
|
15
|
+
export const ACCESS_LEVELS = ['owner', 'editor', 'commenter', 'viewer'] as const;
|
|
16
|
+
export type AccessLevel = (typeof ACCESS_LEVELS)[number];
|
|
17
|
+
|
|
18
|
+
export const AccessLevelSchema = z.enum(ACCESS_LEVELS);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Ordered weakest → strongest. Index = ranking.
|
|
22
|
+
* Used by `highestGrant()` in AUTH-006 (PRD-00674) to aggregate across sources.
|
|
23
|
+
*/
|
|
24
|
+
export const ACCESS_LEVEL_ORDER: Record<AccessLevel, number> = {
|
|
25
|
+
viewer: 0,
|
|
26
|
+
commenter: 1,
|
|
27
|
+
editor: 2,
|
|
28
|
+
owner: 3,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Returns true when `actual` is at least as strong as `required`.
|
|
33
|
+
* Examples:
|
|
34
|
+
* isAtLeast('editor', 'viewer') === true
|
|
35
|
+
* isAtLeast('viewer', 'editor') === false
|
|
36
|
+
* isAtLeast('owner', 'owner') === true
|
|
37
|
+
*/
|
|
38
|
+
export function isAtLeast(actual: AccessLevel, required: AccessLevel): boolean {
|
|
39
|
+
return ACCESS_LEVEL_ORDER[actual] >= ACCESS_LEVEL_ORDER[required];
|
|
40
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Access Source
|
|
3
|
+
*
|
|
4
|
+
* Provenance tag on rows in `effective_acl_grants`. Each row is materialized
|
|
5
|
+
* from exactly one input source; multiple rows for the same
|
|
6
|
+
* (entity, principal) pair are allowed, one per source.
|
|
7
|
+
*
|
|
8
|
+
* Authority: ADR-CTRL-084 (Permission Resolution Architecture).
|
|
9
|
+
*
|
|
10
|
+
* Sources:
|
|
11
|
+
* - `explicit` — direct `acl_grants` row
|
|
12
|
+
* - `ownership` — entity.owner_user_id column projection
|
|
13
|
+
* - `visibility` — entity.visibility tier compiled to viewer rows
|
|
14
|
+
* - `inheritance` — org-chart-membership-based unit walk
|
|
15
|
+
* - `migration` — one-shot backfill from legacy systems (AUTH-004)
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
|
|
19
|
+
export const ACCESS_SOURCES = [
|
|
20
|
+
'explicit',
|
|
21
|
+
'ownership',
|
|
22
|
+
'visibility',
|
|
23
|
+
'inheritance',
|
|
24
|
+
'migration',
|
|
25
|
+
] as const;
|
|
26
|
+
export type AccessSource = (typeof ACCESS_SOURCES)[number];
|
|
27
|
+
|
|
28
|
+
export const AccessSourceSchema = z.enum(ACCESS_SOURCES);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permissions Vocabulary Barrel
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the three canonical enums introduced in AUTH-001 (PRD-00669).
|
|
5
|
+
* Import from '@company-semantics/contracts' (root).
|
|
6
|
+
*/
|
|
7
|
+
export * from './access-levels';
|
|
8
|
+
export * from './orgchart-roles';
|
|
9
|
+
export * from './access-source';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Org-Chart Roles
|
|
3
|
+
*
|
|
4
|
+
* Canonical four-role vocabulary for subtree-CRUD authority on org_units.
|
|
5
|
+
*
|
|
6
|
+
* Authority: ADR-CTRL-088 (Org-Chart Roles).
|
|
7
|
+
*
|
|
8
|
+
* These roles govern only member CRUD on a unit and its ltree descendants.
|
|
9
|
+
* They never grant object access — object access flows through ownership +
|
|
10
|
+
* ACL + visibility + inheritance per ADR-CTRL-084.
|
|
11
|
+
*
|
|
12
|
+
* Consumers: AUTH-006 policy registry (PRD-00674),
|
|
13
|
+
* AUTH-009 org-chart member CRUD UI (PRD-00677),
|
|
14
|
+
* AUTH-011C strict-guard flip (PRD-00681).
|
|
15
|
+
*
|
|
16
|
+
* The legacy `WorkspaceRole` and `OrgUnitMembershipRole` enums coexist with
|
|
17
|
+
* this enum until AUTH-011C deletes them.
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
|
|
21
|
+
export const ORG_CHART_ROLES = ['ceo', 'leader', 'delegate', 'admin'] as const;
|
|
22
|
+
export type OrgChartRole = (typeof ORG_CHART_ROLES)[number];
|
|
23
|
+
|
|
24
|
+
export const OrgChartRoleSchema = z.enum(ORG_CHART_ROLES);
|