@company-semantics/contracts 0.136.0 → 0.137.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/index.ts +9 -0
- package/src/requests.ts +28 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -603,3 +603,12 @@ export { wrapSecret, unwrapSecret } from './security/index'
|
|
|
603
603
|
// Analytics response metadata (shared vocabulary for OLTP/OLAP separation)
|
|
604
604
|
// @see ADR-CTRL-053 for design rationale
|
|
605
605
|
export type { AnalyticsBackend, AnalyticsResponseMeta } from './types/analytics'
|
|
606
|
+
|
|
607
|
+
// Client request scheduler types (shared tier vocabulary)
|
|
608
|
+
export type {
|
|
609
|
+
Tier,
|
|
610
|
+
MutationBehavior,
|
|
611
|
+
SchedulerResourceKey,
|
|
612
|
+
RequestDescriptor,
|
|
613
|
+
SchedulerEvent,
|
|
614
|
+
} from './requests'
|
package/src/requests.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type Tier = 'P0' | 'P1' | 'P2' | 'P3';
|
|
2
|
+
|
|
3
|
+
export type MutationBehavior = 'collapse' | 'queue' | 'parallel';
|
|
4
|
+
|
|
5
|
+
export type SchedulerResourceKey = {
|
|
6
|
+
type: string;
|
|
7
|
+
orgId?: string;
|
|
8
|
+
resourceId?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type RequestDescriptor = {
|
|
12
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
13
|
+
path: string;
|
|
14
|
+
params?: Record<string, unknown>;
|
|
15
|
+
tier: Tier;
|
|
16
|
+
resourceKey: SchedulerResourceKey;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
mutationBehavior?: MutationBehavior;
|
|
19
|
+
headers?: Record<string, string>;
|
|
20
|
+
body?: unknown;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type SchedulerEvent =
|
|
24
|
+
| { type: 'enqueued'; id: string; descriptor: RequestDescriptor; queuedAt: number }
|
|
25
|
+
| { type: 'started'; id: string; descriptor: RequestDescriptor; startedAt: number; waitedMs: number }
|
|
26
|
+
| { type: 'settled'; id: string; descriptor: RequestDescriptor; durationMs: number; ok: boolean; status?: number }
|
|
27
|
+
| { type: 'aborted'; id: string; descriptor: RequestDescriptor; reason: 'superseded' | 'invalidated' | 'unmounted' | 'external' }
|
|
28
|
+
| { type: 'deduped'; id: string; descriptor: RequestDescriptor; sharedWith: string };
|