dxcomplete 0.2.0 → 0.2.2
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/.env.example +0 -7
- package/README.md +18 -54
- package/dist/cli.js +0 -22
- package/dist/validate.js +10 -26
- package/docs/model.md +3 -3
- package/docs/taxonomy.md +1 -1
- package/package.json +23 -23
- package/templates/process/README.md +1 -1
- package/dist/http/service.d.ts +0 -7
- package/dist/http/service.js +0 -725
- package/dist/mcp/docs.d.ts +0 -114
- package/dist/mcp/docs.js +0 -626
- package/dist/mcp/server.d.ts +0 -20
- package/dist/mcp/server.js +0 -3059
- package/dist/runtime/auth.d.ts +0 -162
- package/dist/runtime/auth.js +0 -394
- package/dist/runtime/check.d.ts +0 -7
- package/dist/runtime/check.js +0 -16
- package/dist/runtime/config.d.ts +0 -17
- package/dist/runtime/config.js +0 -93
- package/dist/runtime/mongo.d.ts +0 -9
- package/dist/runtime/mongo.js +0 -56
- package/dist/runtime/records.d.ts +0 -427
- package/dist/runtime/records.js +0 -2092
- package/scripts/check-env-surface.mjs +0 -136
- package/scripts/check-public-copy.mjs +0 -263
- package/scripts/check-service-boundary.mjs +0 -63
- package/scripts/dogfood-work-order.mjs +0 -506
- package/scripts/smoke-mcp-http.mjs +0 -4026
- package/src/cli.ts +0 -268
- package/src/http/server.ts +0 -314
- package/src/http/service.ts +0 -934
- package/src/init.ts +0 -262
- package/src/install-manifest.ts +0 -144
- package/src/mcp/docs.ts +0 -777
- package/src/mcp/server.ts +0 -4580
- package/src/package-root.ts +0 -31
- package/src/runtime/actor.ts +0 -61
- package/src/runtime/auth.ts +0 -673
- package/src/runtime/check.ts +0 -18
- package/src/runtime/config.ts +0 -128
- package/src/runtime/mongo.ts +0 -89
- package/src/runtime/records.ts +0 -3205
- package/src/runtime/workspace.ts +0 -155
- package/src/upgrade.ts +0 -356
- package/src/validate.ts +0 -141
- package/src/version.ts +0 -16
package/dist/runtime/mongo.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MongoClient, type Db } from "mongodb";
|
|
2
|
-
import { type RuntimeConfig, type RuntimeOptions } from "./config.js";
|
|
3
|
-
export type DxRuntime = {
|
|
4
|
-
config: RuntimeConfig;
|
|
5
|
-
client: MongoClient;
|
|
6
|
-
db: Db;
|
|
7
|
-
close: () => Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
export declare function connectRuntime(options?: RuntimeOptions): Promise<DxRuntime>;
|
package/dist/runtime/mongo.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { MongoClient } from "mongodb";
|
|
2
|
-
import { OAUTH_AUTH_REQUESTS_COLLECTION, OAUTH_CLIENTS_COLLECTION, OAUTH_CODES_COLLECTION, OAUTH_TOKENS_COLLECTION, WORKSPACE_SERVICE_CLIENTS_COLLECTION, WORKSPACE_MEMBERSHIPS_COLLECTION } from "./auth.js";
|
|
3
|
-
import { loadRuntimeConfig } from "./config.js";
|
|
4
|
-
import { DXCOMPLETE_TICKET_COLLECTION_NAME, INDEX_COLLECTION_NAMES, READABLE_ID_COLLECTION_NAMES, READABLE_ID_SEQUENCES_COLLECTION, migrateLegacyIntakeItemsToDxcompleteTickets } from "./records.js";
|
|
5
|
-
export async function connectRuntime(options = {}) {
|
|
6
|
-
const config = await loadRuntimeConfig(options);
|
|
7
|
-
const client = new MongoClient(config.mongodbUri, {
|
|
8
|
-
serverSelectionTimeoutMS: 10000
|
|
9
|
-
});
|
|
10
|
-
await client.connect();
|
|
11
|
-
const db = client.db(config.databaseName);
|
|
12
|
-
await db.command({ ping: 1 });
|
|
13
|
-
await migrateLegacyIntakeItemsToDxcompleteTickets(db);
|
|
14
|
-
await ensureIndexes(db);
|
|
15
|
-
return {
|
|
16
|
-
config,
|
|
17
|
-
client,
|
|
18
|
-
db,
|
|
19
|
-
close: () => client.close()
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
async function ensureIndexes(db) {
|
|
23
|
-
await Promise.all(INDEX_COLLECTION_NAMES.map(async (collectionName) => {
|
|
24
|
-
const collection = db.collection(collectionName);
|
|
25
|
-
await collection.createIndex({ recordType: 1, createdAt: -1 });
|
|
26
|
-
await collection.createIndex({ workspaceId: 1, recordType: 1, createdAt: -1 });
|
|
27
|
-
await collection.createIndex({ "links.toId": 1 });
|
|
28
|
-
await collection.createIndex({ workspaceId: 1, "links.toId": 1 });
|
|
29
|
-
if (READABLE_ID_COLLECTION_NAMES.includes(collectionName)) {
|
|
30
|
-
await collection.createIndex({ workspaceId: 1, readableId: 1 }, {
|
|
31
|
-
unique: true,
|
|
32
|
-
partialFilterExpression: { readableId: { $exists: true } }
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (collectionName === DXCOMPLETE_TICKET_COLLECTION_NAME) {
|
|
36
|
-
await collection.createIndex({ "fields.ownerActorId": 1, archivedAt: 1, updatedAt: -1 });
|
|
37
|
-
await collection.createIndex({ "fields.entries.addressedToActorId": 1, "fields.entries.readAt": 1 });
|
|
38
|
-
}
|
|
39
|
-
if (collectionName === "journal_entries") {
|
|
40
|
-
await collection.createIndex({ workspaceId: 1, "fields.kind": 1, archivedAt: 1, createdAt: 1 });
|
|
41
|
-
await collection.createIndex({ workspaceId: 1, archivedAt: 1, createdAt: 1 });
|
|
42
|
-
}
|
|
43
|
-
}));
|
|
44
|
-
await Promise.all([
|
|
45
|
-
db.collection(WORKSPACE_MEMBERSHIPS_COLLECTION).createIndex({ workspaceId: 1, email: 1 }, { unique: true }),
|
|
46
|
-
db.collection(WORKSPACE_MEMBERSHIPS_COLLECTION).createIndex({ provider: 1, providerSubject: 1 }),
|
|
47
|
-
db.collection(WORKSPACE_SERVICE_CLIENTS_COLLECTION).createIndex({ workspaceId: 1, clientId: 1 }, { unique: true }),
|
|
48
|
-
db.collection(WORKSPACE_SERVICE_CLIENTS_COLLECTION).createIndex({ clientId: 1 }, { unique: true }),
|
|
49
|
-
db.collection(OAUTH_CLIENTS_COLLECTION).createIndex({ clientId: 1 }, { unique: true }),
|
|
50
|
-
db.collection(OAUTH_AUTH_REQUESTS_COLLECTION).createIndex({ expiresAt: 1 }, { expireAfterSeconds: 0 }),
|
|
51
|
-
db.collection(OAUTH_CODES_COLLECTION).createIndex({ expiresAt: 1 }, { expireAfterSeconds: 0 }),
|
|
52
|
-
db.collection(OAUTH_TOKENS_COLLECTION).createIndex({ expiresAt: 1 }, { expireAfterSeconds: 0 }),
|
|
53
|
-
db.collection(OAUTH_TOKENS_COLLECTION).createIndex({ workspaceId: 1, "actor.actorId": 1 }),
|
|
54
|
-
db.collection(READABLE_ID_SEQUENCES_COLLECTION).createIndex({ workspaceId: 1, recordType: 1 }, { unique: true })
|
|
55
|
-
]);
|
|
56
|
-
}
|
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import type { Db } from "mongodb";
|
|
2
|
-
import type { ActorContext } from "./actor.js";
|
|
3
|
-
export declare const COLLECTION_NAMES: readonly ["workspaces", "statements", "journal_entries", "environments", "components", "estimates", "benefits", "expectations", "requirements", "tasks", "commitments", "deferrals", "changes", "incidents", "problems", "maintenance_schedules", "support_requests", "value_realizations", "decisions", "risks"];
|
|
4
|
-
export declare const LEGACY_COLLECTION_NAMES: readonly ["engagements", "initiatives", "service_charters", "cost_baselines", "cost_actuals", "benefit_measurements"];
|
|
5
|
-
export declare const DXCOMPLETE_TICKET_COLLECTION_NAME = "dxcomplete_tickets";
|
|
6
|
-
export declare const LEGACY_INTAKE_COLLECTION_NAME = "intake_items";
|
|
7
|
-
export declare const LEGACY_PRIVATE_COLLECTION_NAMES: readonly ["intake_items"];
|
|
8
|
-
export declare const INDEX_COLLECTION_NAMES: readonly ["workspaces", "statements", "journal_entries", "environments", "components", "estimates", "benefits", "expectations", "requirements", "tasks", "commitments", "deferrals", "changes", "incidents", "problems", "maintenance_schedules", "support_requests", "value_realizations", "decisions", "risks", "dxcomplete_tickets"];
|
|
9
|
-
export declare const LINK_SCAN_COLLECTION_NAMES: readonly ["workspaces", "statements", "journal_entries", "environments", "components", "estimates", "benefits", "expectations", "requirements", "tasks", "commitments", "deferrals", "changes", "incidents", "problems", "maintenance_schedules", "support_requests", "value_realizations", "decisions", "risks", "engagements", "initiatives", "service_charters", "cost_baselines", "cost_actuals", "benefit_measurements"];
|
|
10
|
-
export declare const READABLE_ID_SEQUENCES_COLLECTION = "readable_id_sequences";
|
|
11
|
-
export declare const READABLE_ID_TYPE_CODES: {
|
|
12
|
-
readonly statements: "STM";
|
|
13
|
-
readonly journal_entries: "JRN";
|
|
14
|
-
readonly environments: "ENV";
|
|
15
|
-
readonly components: "CMP";
|
|
16
|
-
readonly expectations: "EXP";
|
|
17
|
-
readonly requirements: "REQ";
|
|
18
|
-
readonly tasks: "TSK";
|
|
19
|
-
readonly commitments: "CMT";
|
|
20
|
-
readonly deferrals: "DFR";
|
|
21
|
-
readonly decisions: "DEC";
|
|
22
|
-
readonly changes: "CHG";
|
|
23
|
-
readonly incidents: "INC";
|
|
24
|
-
readonly problems: "PRB";
|
|
25
|
-
readonly maintenance_schedules: "MNT";
|
|
26
|
-
readonly support_requests: "SUP";
|
|
27
|
-
readonly value_realizations: "VAL";
|
|
28
|
-
readonly risks: "RSK";
|
|
29
|
-
readonly estimates: "EST";
|
|
30
|
-
readonly benefits: "BFT";
|
|
31
|
-
};
|
|
32
|
-
export declare const READABLE_ID_COLLECTION_NAMES: ReadableIdCollectionName[];
|
|
33
|
-
export type CollectionName = (typeof COLLECTION_NAMES)[number];
|
|
34
|
-
export type ReadableIdCollectionName = keyof typeof READABLE_ID_TYPE_CODES;
|
|
35
|
-
export type PrivateCollectionName = typeof DXCOMPLETE_TICKET_COLLECTION_NAME;
|
|
36
|
-
export type RuntimeCollectionName = CollectionName | PrivateCollectionName | (typeof LEGACY_COLLECTION_NAMES)[number] | (typeof LEGACY_PRIVATE_COLLECTION_NAMES)[number];
|
|
37
|
-
export type RecordLink = {
|
|
38
|
-
toType: RuntimeCollectionName;
|
|
39
|
-
toId: string;
|
|
40
|
-
relationship: string;
|
|
41
|
-
createdAt: string;
|
|
42
|
-
createdBy: string;
|
|
43
|
-
};
|
|
44
|
-
export type RecordEdge = RecordLink & {
|
|
45
|
-
fromType: RuntimeCollectionName;
|
|
46
|
-
fromId: string;
|
|
47
|
-
};
|
|
48
|
-
export type DxcRecord = {
|
|
49
|
-
_id: string;
|
|
50
|
-
recordType: RuntimeCollectionName;
|
|
51
|
-
readableId?: string;
|
|
52
|
-
workspaceId?: string;
|
|
53
|
-
title?: string;
|
|
54
|
-
summary?: string;
|
|
55
|
-
fields: Record<string, unknown>;
|
|
56
|
-
links: RecordLink[];
|
|
57
|
-
archivedAt?: string;
|
|
58
|
-
archivedBy?: string;
|
|
59
|
-
archiveReason?: string;
|
|
60
|
-
createdAt: string;
|
|
61
|
-
createdBy: string;
|
|
62
|
-
updatedAt: string;
|
|
63
|
-
updatedBy: string;
|
|
64
|
-
derived?: Record<string, unknown>;
|
|
65
|
-
};
|
|
66
|
-
export type ReviewableRecordType = "expectations" | "requirements";
|
|
67
|
-
export type ReviewNote = {
|
|
68
|
-
id: string;
|
|
69
|
-
body: string;
|
|
70
|
-
createdAt: string;
|
|
71
|
-
createdBy: string;
|
|
72
|
-
important?: true;
|
|
73
|
-
};
|
|
74
|
-
export type RecordVersionSnapshot = {
|
|
75
|
-
title?: string;
|
|
76
|
-
summary?: string;
|
|
77
|
-
fields: Record<string, unknown>;
|
|
78
|
-
};
|
|
79
|
-
export type RecordVersionHistoryEntry = {
|
|
80
|
-
id: string;
|
|
81
|
-
fromVersion: number;
|
|
82
|
-
toVersion: number;
|
|
83
|
-
createdAt: string;
|
|
84
|
-
createdBy: string;
|
|
85
|
-
changedFields: string[];
|
|
86
|
-
previousSnapshot: RecordVersionSnapshot;
|
|
87
|
-
nextSnapshot: RecordVersionSnapshot;
|
|
88
|
-
revisionNote?: string;
|
|
89
|
-
};
|
|
90
|
-
export type ChangeEventType = "notice_given" | "veto_recorded" | "decision_recorded" | "result_reported" | "recovery_recorded" | "plan_revised" | "note_added";
|
|
91
|
-
export type ChangeEvent = {
|
|
92
|
-
id: string;
|
|
93
|
-
eventType: ChangeEventType;
|
|
94
|
-
createdAt: string;
|
|
95
|
-
createdBy: string;
|
|
96
|
-
} & Record<string, unknown>;
|
|
97
|
-
export type DeferralEventType = "condition_addressed" | "condition_reopened" | "condition_note_added" | "deferral_resolved" | "deferral_abandoned";
|
|
98
|
-
export type DeferralCondition = {
|
|
99
|
-
id: string;
|
|
100
|
-
statement: string;
|
|
101
|
-
state: "open" | "addressed";
|
|
102
|
-
createdAt: string;
|
|
103
|
-
createdBy: string;
|
|
104
|
-
updatedAt: string;
|
|
105
|
-
updatedBy: string;
|
|
106
|
-
};
|
|
107
|
-
export type DeferralEvent = {
|
|
108
|
-
id: string;
|
|
109
|
-
eventType: DeferralEventType;
|
|
110
|
-
createdAt: string;
|
|
111
|
-
createdBy: string;
|
|
112
|
-
} & Record<string, unknown>;
|
|
113
|
-
export type DecisionEntryType = "argument" | "decision" | "note";
|
|
114
|
-
export type DecisionEntry = {
|
|
115
|
-
id: string;
|
|
116
|
-
entryType: DecisionEntryType;
|
|
117
|
-
body: string;
|
|
118
|
-
createdAt: string;
|
|
119
|
-
createdBy: string;
|
|
120
|
-
decidedBy?: string;
|
|
121
|
-
rationale?: string;
|
|
122
|
-
};
|
|
123
|
-
export type TaskEntryType = "comment" | "status_change" | "note";
|
|
124
|
-
export type TaskStatus = "open" | "in_progress" | "blocked" | "done";
|
|
125
|
-
export type TaskEntry = {
|
|
126
|
-
id: string;
|
|
127
|
-
entryType: TaskEntryType;
|
|
128
|
-
body: string;
|
|
129
|
-
createdAt: string;
|
|
130
|
-
createdBy: string;
|
|
131
|
-
status?: TaskStatus;
|
|
132
|
-
};
|
|
133
|
-
export type RiskEntryType = "identified" | "assessment" | "treatment" | "monitor_note" | "closed" | "reopened";
|
|
134
|
-
export type RiskLevel = "low" | "medium" | "high";
|
|
135
|
-
export type RiskTreatment = "accept" | "mitigate" | "transfer" | "avoid";
|
|
136
|
-
export type RiskEntry = {
|
|
137
|
-
id: string;
|
|
138
|
-
entryType: RiskEntryType;
|
|
139
|
-
body: string;
|
|
140
|
-
createdAt: string;
|
|
141
|
-
createdBy: string;
|
|
142
|
-
likelihood?: RiskLevel;
|
|
143
|
-
impact?: RiskLevel;
|
|
144
|
-
treatment?: RiskTreatment;
|
|
145
|
-
treatmentRationale?: string;
|
|
146
|
-
};
|
|
147
|
-
export type IncidentEntryType = "detected" | "update" | "severity" | "resolved" | "reopened" | "note";
|
|
148
|
-
export type IncidentSeverity = "low" | "medium" | "high" | "critical";
|
|
149
|
-
export type IncidentEntry = {
|
|
150
|
-
id: string;
|
|
151
|
-
entryType: IncidentEntryType;
|
|
152
|
-
body: string;
|
|
153
|
-
createdAt: string;
|
|
154
|
-
createdBy: string;
|
|
155
|
-
severity?: IncidentSeverity;
|
|
156
|
-
};
|
|
157
|
-
export type ProblemEntryType = "identified" | "investigation" | "root_cause" | "known_error" | "resolved" | "reopened" | "note";
|
|
158
|
-
export type ProblemEntry = {
|
|
159
|
-
id: string;
|
|
160
|
-
entryType: ProblemEntryType;
|
|
161
|
-
body: string;
|
|
162
|
-
createdAt: string;
|
|
163
|
-
createdBy: string;
|
|
164
|
-
rootCause?: string;
|
|
165
|
-
};
|
|
166
|
-
export type SupportRequestEntryType = "raised" | "triage" | "update" | "escalated" | "resolved" | "reopened" | "note";
|
|
167
|
-
export type SupportRequestEntry = {
|
|
168
|
-
id: string;
|
|
169
|
-
entryType: SupportRequestEntryType;
|
|
170
|
-
body: string;
|
|
171
|
-
createdAt: string;
|
|
172
|
-
createdBy: string;
|
|
173
|
-
incidentId?: string;
|
|
174
|
-
};
|
|
175
|
-
export type JournalEntryKind = "note" | "summary";
|
|
176
|
-
export type AppendJournalNoteInput = {
|
|
177
|
-
workspaceId: string;
|
|
178
|
-
body: string;
|
|
179
|
-
tag?: string;
|
|
180
|
-
};
|
|
181
|
-
export type ReadJournalInput = {
|
|
182
|
-
workspaceId: string;
|
|
183
|
-
limit?: number;
|
|
184
|
-
includeArchived?: boolean;
|
|
185
|
-
};
|
|
186
|
-
export type ReadJournalResult = {
|
|
187
|
-
workspaceId: string;
|
|
188
|
-
readTier: "hot" | "cold";
|
|
189
|
-
compaction: {
|
|
190
|
-
activeRawNoteCount: number;
|
|
191
|
-
threshold: number;
|
|
192
|
-
recommended: boolean;
|
|
193
|
-
};
|
|
194
|
-
entries: DxcRecord[];
|
|
195
|
-
};
|
|
196
|
-
export type GetJournalEntryInput = {
|
|
197
|
-
workspaceId: string;
|
|
198
|
-
id: string;
|
|
199
|
-
};
|
|
200
|
-
export type AppendJournalSummaryInput = {
|
|
201
|
-
workspaceId: string;
|
|
202
|
-
body: string;
|
|
203
|
-
covers: string[];
|
|
204
|
-
tag?: string;
|
|
205
|
-
};
|
|
206
|
-
export type CreateRecordInput = {
|
|
207
|
-
id?: string;
|
|
208
|
-
workspaceId?: string;
|
|
209
|
-
title?: string;
|
|
210
|
-
summary?: string;
|
|
211
|
-
fields?: Record<string, unknown>;
|
|
212
|
-
allowManagedFields?: boolean;
|
|
213
|
-
};
|
|
214
|
-
export type UpdateRecordInput = {
|
|
215
|
-
recordType: CollectionName;
|
|
216
|
-
id: string;
|
|
217
|
-
workspaceId?: string;
|
|
218
|
-
title?: string;
|
|
219
|
-
summary?: string;
|
|
220
|
-
fields?: Record<string, unknown>;
|
|
221
|
-
unsetFields?: string[];
|
|
222
|
-
allowManagedFields?: boolean;
|
|
223
|
-
revisionNote?: string;
|
|
224
|
-
};
|
|
225
|
-
export type AppendReviewNoteInput = {
|
|
226
|
-
recordType: ReviewableRecordType;
|
|
227
|
-
id: string;
|
|
228
|
-
workspaceId: string;
|
|
229
|
-
body: string;
|
|
230
|
-
important?: boolean;
|
|
231
|
-
};
|
|
232
|
-
export type AppendChangeEventInput = {
|
|
233
|
-
workspaceId: string;
|
|
234
|
-
changeId: string;
|
|
235
|
-
eventType: ChangeEventType;
|
|
236
|
-
event: Record<string, unknown>;
|
|
237
|
-
};
|
|
238
|
-
export type AppendDeferralEventInput = {
|
|
239
|
-
workspaceId: string;
|
|
240
|
-
deferralId: string;
|
|
241
|
-
eventType: DeferralEventType;
|
|
242
|
-
event: Record<string, unknown>;
|
|
243
|
-
};
|
|
244
|
-
export type AppendDecisionEntryInput = {
|
|
245
|
-
workspaceId: string;
|
|
246
|
-
decisionId: string;
|
|
247
|
-
entryType: DecisionEntryType;
|
|
248
|
-
body: string;
|
|
249
|
-
decidedBy?: string;
|
|
250
|
-
rationale?: string;
|
|
251
|
-
};
|
|
252
|
-
export type AppendTaskEntryInput = {
|
|
253
|
-
workspaceId: string;
|
|
254
|
-
taskId: string;
|
|
255
|
-
entryType: TaskEntryType;
|
|
256
|
-
body: string;
|
|
257
|
-
status?: TaskStatus;
|
|
258
|
-
};
|
|
259
|
-
export type AppendRiskEntryInput = {
|
|
260
|
-
workspaceId: string;
|
|
261
|
-
riskId: string;
|
|
262
|
-
entryType: RiskEntryType;
|
|
263
|
-
body: string;
|
|
264
|
-
likelihood?: RiskLevel;
|
|
265
|
-
impact?: RiskLevel;
|
|
266
|
-
treatment?: RiskTreatment;
|
|
267
|
-
treatmentRationale?: string;
|
|
268
|
-
};
|
|
269
|
-
export type AppendIncidentEntryInput = {
|
|
270
|
-
workspaceId: string;
|
|
271
|
-
incidentId: string;
|
|
272
|
-
entryType: IncidentEntryType;
|
|
273
|
-
body: string;
|
|
274
|
-
severity?: IncidentSeverity;
|
|
275
|
-
};
|
|
276
|
-
export type AppendProblemEntryInput = {
|
|
277
|
-
workspaceId: string;
|
|
278
|
-
problemId: string;
|
|
279
|
-
entryType: ProblemEntryType;
|
|
280
|
-
body: string;
|
|
281
|
-
rootCause?: string;
|
|
282
|
-
};
|
|
283
|
-
export type AppendSupportRequestEntryInput = {
|
|
284
|
-
workspaceId: string;
|
|
285
|
-
supportRequestId: string;
|
|
286
|
-
entryType: SupportRequestEntryType;
|
|
287
|
-
body: string;
|
|
288
|
-
incidentId?: string;
|
|
289
|
-
};
|
|
290
|
-
export type UnlinkRecordsInput = {
|
|
291
|
-
fromType: CollectionName;
|
|
292
|
-
fromId: string;
|
|
293
|
-
toType: CollectionName;
|
|
294
|
-
toId: string;
|
|
295
|
-
workspaceId?: string;
|
|
296
|
-
relationship?: string;
|
|
297
|
-
};
|
|
298
|
-
export type ArchiveRecordInput = {
|
|
299
|
-
recordType: CollectionName;
|
|
300
|
-
id: string;
|
|
301
|
-
workspaceId?: string;
|
|
302
|
-
reason?: string;
|
|
303
|
-
supersededByType?: CollectionName;
|
|
304
|
-
supersededById?: string;
|
|
305
|
-
};
|
|
306
|
-
export type LinkedRecordsResult = {
|
|
307
|
-
source: DxcRecord;
|
|
308
|
-
outbound: Array<{
|
|
309
|
-
edge: RecordEdge;
|
|
310
|
-
record: DxcRecord;
|
|
311
|
-
}>;
|
|
312
|
-
inbound: Array<{
|
|
313
|
-
edge: RecordEdge;
|
|
314
|
-
record: DxcRecord;
|
|
315
|
-
}>;
|
|
316
|
-
};
|
|
317
|
-
export type DxcompleteTicketEntryDirection = "submitter_entry" | "dxcomplete_reply";
|
|
318
|
-
export type DxcompleteTicketEntry = {
|
|
319
|
-
id: string;
|
|
320
|
-
body: string;
|
|
321
|
-
createdAt: string;
|
|
322
|
-
createdBy: string;
|
|
323
|
-
direction: DxcompleteTicketEntryDirection;
|
|
324
|
-
addressedToActorId?: string;
|
|
325
|
-
readAt?: string;
|
|
326
|
-
};
|
|
327
|
-
export type CreateDxcompleteTicketInput = {
|
|
328
|
-
title: string;
|
|
329
|
-
body: string;
|
|
330
|
-
};
|
|
331
|
-
export type AppendDxcompleteTicketInput = {
|
|
332
|
-
id: string;
|
|
333
|
-
body: string;
|
|
334
|
-
};
|
|
335
|
-
export type AppendDxcompleteTicketReplyInput = {
|
|
336
|
-
id: string;
|
|
337
|
-
body: string;
|
|
338
|
-
addressedToActorId: string;
|
|
339
|
-
};
|
|
340
|
-
export type ArchiveDxcompleteTicketInput = {
|
|
341
|
-
id: string;
|
|
342
|
-
};
|
|
343
|
-
export type ReadDxcompleteTicketInput = {
|
|
344
|
-
id: string;
|
|
345
|
-
};
|
|
346
|
-
export type DxcompleteTicketUnreadReplySummary = {
|
|
347
|
-
id: string;
|
|
348
|
-
createdAt: string;
|
|
349
|
-
createdBy: string;
|
|
350
|
-
direction: "dxcomplete_reply";
|
|
351
|
-
addressedToActorId?: string;
|
|
352
|
-
};
|
|
353
|
-
export type DxcompleteTicketUnreadReplyResult = {
|
|
354
|
-
ticketId: string;
|
|
355
|
-
title?: string;
|
|
356
|
-
updatedAt: string;
|
|
357
|
-
unreadReplyCount: number;
|
|
358
|
-
newestReplyAt?: string;
|
|
359
|
-
replies: DxcompleteTicketUnreadReplySummary[];
|
|
360
|
-
};
|
|
361
|
-
export declare const RUNTIME_ACTOR_ID = "dxcomplete-runtime";
|
|
362
|
-
export declare function assertCollectionName(value: string): CollectionName;
|
|
363
|
-
export declare function createRecord(db: Db, recordType: CollectionName, input: CreateRecordInput, actorId: string): Promise<DxcRecord>;
|
|
364
|
-
export declare function listRecords(db: Db, recordType: CollectionName, limit: number, options?: {
|
|
365
|
-
includeArchived?: boolean;
|
|
366
|
-
workspaceId?: string;
|
|
367
|
-
}): Promise<DxcRecord[]>;
|
|
368
|
-
export declare function getRecord(db: Db, recordType: RuntimeCollectionName, id: string, options?: {
|
|
369
|
-
workspaceId?: string;
|
|
370
|
-
allowAnyWorkspace?: boolean;
|
|
371
|
-
}): Promise<DxcRecord | null>;
|
|
372
|
-
export declare function listLinkedRecords(db: Db, input: {
|
|
373
|
-
recordType: CollectionName;
|
|
374
|
-
id: string;
|
|
375
|
-
workspaceId?: string;
|
|
376
|
-
direction?: "outbound" | "inbound" | "both";
|
|
377
|
-
relationship?: string;
|
|
378
|
-
includeArchived?: boolean;
|
|
379
|
-
}): Promise<LinkedRecordsResult>;
|
|
380
|
-
export declare function migrateLegacyIntakeItemsToDxcompleteTickets(db: Db): Promise<{
|
|
381
|
-
copied: number;
|
|
382
|
-
skipped: number;
|
|
383
|
-
}>;
|
|
384
|
-
export declare function createDxcompleteTicket(db: Db, input: CreateDxcompleteTicketInput, actor: ActorContext): Promise<DxcRecord>;
|
|
385
|
-
export declare function getDxcompleteTicket(db: Db, id: string, actor: ActorContext): Promise<DxcRecord>;
|
|
386
|
-
export declare function listDxcompleteTickets(db: Db, actor: ActorContext, limit: number, options?: {
|
|
387
|
-
includeArchived?: boolean;
|
|
388
|
-
}): Promise<DxcRecord[]>;
|
|
389
|
-
export declare function appendDxcompleteTicket(db: Db, input: AppendDxcompleteTicketInput, actor: ActorContext): Promise<DxcRecord>;
|
|
390
|
-
export declare function appendDxcompleteTicketReply(db: Db, input: AppendDxcompleteTicketReplyInput, actorId?: string): Promise<DxcRecord>;
|
|
391
|
-
export declare function appendJournalNote(db: Db, input: AppendJournalNoteInput, actorId: string): Promise<DxcRecord>;
|
|
392
|
-
export declare function readJournal(db: Db, input: ReadJournalInput): Promise<ReadJournalResult>;
|
|
393
|
-
export declare function getJournalEntry(db: Db, input: GetJournalEntryInput): Promise<DxcRecord>;
|
|
394
|
-
export declare function appendJournalSummary(db: Db, input: AppendJournalSummaryInput, actorId: string): Promise<DxcRecord>;
|
|
395
|
-
export declare function appendReviewNote(db: Db, input: AppendReviewNoteInput, actorId: string): Promise<DxcRecord>;
|
|
396
|
-
export declare function appendChangeEvent(db: Db, input: AppendChangeEventInput, actorId: string): Promise<DxcRecord>;
|
|
397
|
-
export declare function appendDeferralEvent(db: Db, input: AppendDeferralEventInput, actorId: string): Promise<DxcRecord>;
|
|
398
|
-
export declare function appendDecisionEntry(db: Db, input: AppendDecisionEntryInput, actorId: string): Promise<DxcRecord>;
|
|
399
|
-
export declare function appendTaskEntry(db: Db, input: AppendTaskEntryInput, actorId: string): Promise<DxcRecord>;
|
|
400
|
-
export declare function appendRiskEntry(db: Db, input: AppendRiskEntryInput, actorId: string): Promise<DxcRecord>;
|
|
401
|
-
export declare function appendIncidentEntry(db: Db, input: AppendIncidentEntryInput, actorId: string): Promise<DxcRecord>;
|
|
402
|
-
export declare function appendProblemEntry(db: Db, input: AppendProblemEntryInput, actorId: string): Promise<DxcRecord>;
|
|
403
|
-
export declare function appendSupportRequestEntry(db: Db, input: AppendSupportRequestEntryInput, actorId: string): Promise<DxcRecord>;
|
|
404
|
-
export declare function decisionEntryToCurrentDecision(entry: DecisionEntry): Record<string, unknown>;
|
|
405
|
-
export declare function taskEntryToCurrentStatus(entry: TaskEntry): Record<string, unknown>;
|
|
406
|
-
export declare function riskEntryToCurrentStatus(entry: RiskEntry, status: "open" | "closed"): Record<string, unknown>;
|
|
407
|
-
export declare function riskEntryToCurrentAssessment(entry: RiskEntry): Record<string, unknown>;
|
|
408
|
-
export declare function riskEntryToCurrentTreatment(entry: RiskEntry): Record<string, unknown>;
|
|
409
|
-
export declare function incidentEntryToCurrentStatus(entry: IncidentEntry, status: "open" | "resolved"): Record<string, unknown>;
|
|
410
|
-
export declare function incidentEntryToCurrentSeverity(entry: IncidentEntry): Record<string, unknown>;
|
|
411
|
-
export declare function problemEntryToCurrentStatus(entry: ProblemEntry, status: "open" | "known_error" | "resolved"): Record<string, unknown>;
|
|
412
|
-
export declare function problemEntryToCurrentRootCause(entry: ProblemEntry): Record<string, unknown>;
|
|
413
|
-
export declare function supportRequestEntryToCurrentStatus(entry: SupportRequestEntry, previousStatus?: Record<string, unknown>): Record<string, unknown> | undefined;
|
|
414
|
-
export declare function listUnreadDxcompleteTicketReplies(db: Db, actor: ActorContext, limit: number): Promise<DxcompleteTicketUnreadReplyResult[]>;
|
|
415
|
-
export declare function readDxcompleteTicket(db: Db, input: ReadDxcompleteTicketInput, actor: ActorContext): Promise<DxcRecord>;
|
|
416
|
-
export declare function archiveDxcompleteTicket(db: Db, input: ArchiveDxcompleteTicketInput, actor: ActorContext): Promise<DxcRecord>;
|
|
417
|
-
export declare function updateRecord(db: Db, input: UpdateRecordInput, actorId: string): Promise<DxcRecord>;
|
|
418
|
-
export declare function archiveRecord(db: Db, input: ArchiveRecordInput, actorId: string): Promise<DxcRecord>;
|
|
419
|
-
export declare function linkRecords(db: Db, input: {
|
|
420
|
-
fromType: CollectionName;
|
|
421
|
-
fromId: string;
|
|
422
|
-
toType: CollectionName;
|
|
423
|
-
toId: string;
|
|
424
|
-
workspaceId?: string;
|
|
425
|
-
relationship?: string;
|
|
426
|
-
}, actorId: string): Promise<DxcRecord>;
|
|
427
|
-
export declare function unlinkRecords(db: Db, input: UnlinkRecordsInput, actorId: string): Promise<DxcRecord>;
|