@phosphorco/bb-cross-references 0.0.0-stage → 0.1.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/CONTRACT.md +109 -0
- package/LICENSE +21 -0
- package/README.md +41 -2
- package/dist/bb.js +665 -0
- package/dist/index.js +649 -0
- package/dist/react.js +1308 -0
- package/dist/references.css +66 -0
- package/dist/testing.js +48 -0
- package/dist/types/bb.d.ts +29 -0
- package/dist/types/canonical.d.ts +65 -0
- package/dist/types/index.d.ts +534 -0
- package/dist/types/react.d.ts +32 -0
- package/dist/types/testing.d.ts +14 -0
- package/package.json +84 -4
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
export declare const FORWARD_REFERENCE_CHECK_LIMIT = 10;
|
|
2
|
+
export * from "./canonical.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { type CanonicalIdentity, type CanonicalResource, type Presentation, type Resource, type ResourceIdentity } from "./canonical.js";
|
|
5
|
+
import { CrossReferenceValidationError, PROTOCOL_VERSION } from "./canonical.js";
|
|
6
|
+
export { PROTOCOL_VERSION, CrossReferenceValidationError, type Presentation, type Resource, type ResourceIdentity, };
|
|
7
|
+
export interface ApplyProjectionInput {
|
|
8
|
+
protocolVersion: 1;
|
|
9
|
+
producerPluginId: string;
|
|
10
|
+
mutationId: string;
|
|
11
|
+
source: Resource;
|
|
12
|
+
revision: number;
|
|
13
|
+
expectedRevision: number;
|
|
14
|
+
payloadDigest: string;
|
|
15
|
+
tombstone: boolean;
|
|
16
|
+
targets: Resource[];
|
|
17
|
+
}
|
|
18
|
+
export type ProjectionOutcome = "applied" | "duplicate" | "equal" | "stale" | "conflict" | "cas-mismatch";
|
|
19
|
+
export interface ApplyProjectionResponse {
|
|
20
|
+
outcome: ProjectionOutcome;
|
|
21
|
+
currentRevision: number;
|
|
22
|
+
currentDigest: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface NormalizedProjectionCommand extends Omit<ApplyProjectionInput, "source" | "targets"> {
|
|
25
|
+
source: CanonicalResource;
|
|
26
|
+
targets: CanonicalResource[];
|
|
27
|
+
payloadJson: string;
|
|
28
|
+
computedPayloadDigest: string;
|
|
29
|
+
}
|
|
30
|
+
export interface Projection {
|
|
31
|
+
producerPluginId: string;
|
|
32
|
+
source: Resource;
|
|
33
|
+
revision: number;
|
|
34
|
+
mutationId: string;
|
|
35
|
+
payloadDigest: string;
|
|
36
|
+
tombstone: boolean;
|
|
37
|
+
targets: Resource[];
|
|
38
|
+
}
|
|
39
|
+
export interface GetProjectionResponse {
|
|
40
|
+
projection: Projection | null;
|
|
41
|
+
}
|
|
42
|
+
export interface ListBacklinksInput {
|
|
43
|
+
target: ResourceIdentity;
|
|
44
|
+
pageSize?: number;
|
|
45
|
+
cursor?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface BacklinkRow {
|
|
48
|
+
source: Resource;
|
|
49
|
+
producerPluginId: string;
|
|
50
|
+
revision: number;
|
|
51
|
+
targetPresentation: Presentation;
|
|
52
|
+
position: number;
|
|
53
|
+
/** Latest source-message time across matching assertions; null when unknown. */
|
|
54
|
+
lastSeenAt?: number | null;
|
|
55
|
+
}
|
|
56
|
+
export interface ListBacklinksResponse {
|
|
57
|
+
rows: BacklinkRow[];
|
|
58
|
+
/** Exact number of distinct source resources at this page's upper bound. */
|
|
59
|
+
total: number;
|
|
60
|
+
nextCursor: string | null;
|
|
61
|
+
}
|
|
62
|
+
/** The deduplicated outgoing view of stored directed edges. No inverse is persisted. */
|
|
63
|
+
export interface ListForwardReferencesInput {
|
|
64
|
+
source: ResourceIdentity;
|
|
65
|
+
/** Limits the outgoing view to one source-owner when supplied. */
|
|
66
|
+
producerPluginId?: string;
|
|
67
|
+
pageSize?: number;
|
|
68
|
+
cursor?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface ForwardReferenceRow {
|
|
71
|
+
target: Resource;
|
|
72
|
+
producerPluginId: string;
|
|
73
|
+
revision: number;
|
|
74
|
+
position: number;
|
|
75
|
+
lastSeenAt?: number | null;
|
|
76
|
+
}
|
|
77
|
+
export interface ListForwardReferencesResponse {
|
|
78
|
+
rows: ForwardReferenceRow[];
|
|
79
|
+
/** Exact number of distinct target resources at this page's upper bound. */
|
|
80
|
+
total: number;
|
|
81
|
+
nextCursor: string | null;
|
|
82
|
+
}
|
|
83
|
+
/** Ephemeral HTTP reachability information for a visible forward target. */
|
|
84
|
+
export interface ForwardReferenceStatus {
|
|
85
|
+
url: string;
|
|
86
|
+
status: number | null;
|
|
87
|
+
label: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The status probe reads current outgoing occurrences but never changes the
|
|
91
|
+
* directed graph. It is intentionally bounded and has no pagination because
|
|
92
|
+
* it serves a compact display-time health indicator.
|
|
93
|
+
*/
|
|
94
|
+
export interface CheckForwardReferencesInput {
|
|
95
|
+
source: ResourceIdentity;
|
|
96
|
+
producerPluginId?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface CrossReferencesChangedSignal {
|
|
99
|
+
protocolVersion: 1;
|
|
100
|
+
affectedIdentityDigests: string[];
|
|
101
|
+
producerPluginId: string;
|
|
102
|
+
sourceIdentityDigest: string;
|
|
103
|
+
revision: number;
|
|
104
|
+
}
|
|
105
|
+
export declare function normalizeProjectionCommand(input: ApplyProjectionInput): NormalizedProjectionCommand;
|
|
106
|
+
export declare function normalizeIdentityInput(input: ResourceIdentity): CanonicalIdentity;
|
|
107
|
+
export declare function defaultPageSize(pageSize: number | undefined): number;
|
|
108
|
+
declare const presentationSchema: z.ZodObject<{
|
|
109
|
+
label: z.ZodString;
|
|
110
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
111
|
+
url: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
declare const resourceSchema: z.ZodObject<{
|
|
114
|
+
provider: z.ZodString;
|
|
115
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
116
|
+
presentation: z.ZodObject<{
|
|
117
|
+
label: z.ZodString;
|
|
118
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
119
|
+
url: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
declare const resourceIdentitySchema: z.ZodObject<{
|
|
123
|
+
provider: z.ZodString;
|
|
124
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
declare const applyProjectionInputSchema: z.ZodObject<{
|
|
127
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
128
|
+
producerPluginId: z.ZodString;
|
|
129
|
+
mutationId: z.ZodString;
|
|
130
|
+
source: z.ZodObject<{
|
|
131
|
+
provider: z.ZodString;
|
|
132
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
133
|
+
presentation: z.ZodObject<{
|
|
134
|
+
label: z.ZodString;
|
|
135
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
136
|
+
url: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
revision: z.ZodNumber;
|
|
140
|
+
expectedRevision: z.ZodNumber;
|
|
141
|
+
payloadDigest: z.ZodString;
|
|
142
|
+
tombstone: z.ZodBoolean;
|
|
143
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
144
|
+
provider: z.ZodString;
|
|
145
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
146
|
+
presentation: z.ZodObject<{
|
|
147
|
+
label: z.ZodString;
|
|
148
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
149
|
+
url: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
declare const applyProjectionResponseSchema: z.ZodObject<{
|
|
154
|
+
outcome: z.ZodEnum<{
|
|
155
|
+
applied: "applied";
|
|
156
|
+
duplicate: "duplicate";
|
|
157
|
+
equal: "equal";
|
|
158
|
+
stale: "stale";
|
|
159
|
+
conflict: "conflict";
|
|
160
|
+
"cas-mismatch": "cas-mismatch";
|
|
161
|
+
}>;
|
|
162
|
+
currentRevision: z.ZodNumber;
|
|
163
|
+
currentDigest: z.ZodNullable<z.ZodString>;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
declare const projectionSchema: z.ZodObject<{
|
|
166
|
+
producerPluginId: z.ZodString;
|
|
167
|
+
source: z.ZodObject<{
|
|
168
|
+
provider: z.ZodString;
|
|
169
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
170
|
+
presentation: z.ZodObject<{
|
|
171
|
+
label: z.ZodString;
|
|
172
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
173
|
+
url: z.ZodOptional<z.ZodString>;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
revision: z.ZodNumber;
|
|
177
|
+
mutationId: z.ZodString;
|
|
178
|
+
payloadDigest: z.ZodString;
|
|
179
|
+
tombstone: z.ZodBoolean;
|
|
180
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
181
|
+
provider: z.ZodString;
|
|
182
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
183
|
+
presentation: z.ZodObject<{
|
|
184
|
+
label: z.ZodString;
|
|
185
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
186
|
+
url: z.ZodOptional<z.ZodString>;
|
|
187
|
+
}, z.core.$strict>;
|
|
188
|
+
}, z.core.$strict>>;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
declare const getProjectionInputSchema: z.ZodObject<{
|
|
191
|
+
producerPluginId: z.ZodString;
|
|
192
|
+
source: z.ZodObject<{
|
|
193
|
+
provider: z.ZodString;
|
|
194
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
195
|
+
}, z.core.$strict>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
declare const getProjectionOutputSchema: z.ZodObject<{
|
|
198
|
+
projection: z.ZodNullable<z.ZodObject<{
|
|
199
|
+
producerPluginId: z.ZodString;
|
|
200
|
+
source: z.ZodObject<{
|
|
201
|
+
provider: z.ZodString;
|
|
202
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
203
|
+
presentation: z.ZodObject<{
|
|
204
|
+
label: z.ZodString;
|
|
205
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
206
|
+
url: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strict>;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
revision: z.ZodNumber;
|
|
210
|
+
mutationId: z.ZodString;
|
|
211
|
+
payloadDigest: z.ZodString;
|
|
212
|
+
tombstone: z.ZodBoolean;
|
|
213
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
214
|
+
provider: z.ZodString;
|
|
215
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
216
|
+
presentation: z.ZodObject<{
|
|
217
|
+
label: z.ZodString;
|
|
218
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
219
|
+
url: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strict>;
|
|
221
|
+
}, z.core.$strict>>;
|
|
222
|
+
}, z.core.$strict>>;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
declare const backlinkRowSchema: z.ZodObject<{
|
|
225
|
+
source: z.ZodObject<{
|
|
226
|
+
provider: z.ZodString;
|
|
227
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
228
|
+
presentation: z.ZodObject<{
|
|
229
|
+
label: z.ZodString;
|
|
230
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
231
|
+
url: z.ZodOptional<z.ZodString>;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
}, z.core.$strict>;
|
|
234
|
+
producerPluginId: z.ZodString;
|
|
235
|
+
revision: z.ZodNumber;
|
|
236
|
+
targetPresentation: z.ZodObject<{
|
|
237
|
+
label: z.ZodString;
|
|
238
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
239
|
+
url: z.ZodOptional<z.ZodString>;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
position: z.ZodNumber;
|
|
242
|
+
lastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
243
|
+
}, z.core.$strict>;
|
|
244
|
+
declare const listBacklinksInputSchema: z.ZodObject<{
|
|
245
|
+
target: z.ZodObject<{
|
|
246
|
+
provider: z.ZodString;
|
|
247
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
248
|
+
}, z.core.$strict>;
|
|
249
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
declare const listBacklinksOutputSchema: z.ZodObject<{
|
|
253
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
254
|
+
source: z.ZodObject<{
|
|
255
|
+
provider: z.ZodString;
|
|
256
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
257
|
+
presentation: z.ZodObject<{
|
|
258
|
+
label: z.ZodString;
|
|
259
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
260
|
+
url: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$strict>;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
producerPluginId: z.ZodString;
|
|
264
|
+
revision: z.ZodNumber;
|
|
265
|
+
targetPresentation: z.ZodObject<{
|
|
266
|
+
label: z.ZodString;
|
|
267
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
268
|
+
url: z.ZodOptional<z.ZodString>;
|
|
269
|
+
}, z.core.$strict>;
|
|
270
|
+
position: z.ZodNumber;
|
|
271
|
+
lastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
272
|
+
}, z.core.$strict>>;
|
|
273
|
+
total: z.ZodNumber;
|
|
274
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
275
|
+
}, z.core.$strict>;
|
|
276
|
+
declare const listForwardReferencesInputSchema: z.ZodObject<{
|
|
277
|
+
source: z.ZodObject<{
|
|
278
|
+
provider: z.ZodString;
|
|
279
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
producerPluginId: z.ZodOptional<z.ZodString>;
|
|
282
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
declare const listForwardReferencesOutputSchema: z.ZodObject<{
|
|
286
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
287
|
+
target: z.ZodObject<{
|
|
288
|
+
provider: z.ZodString;
|
|
289
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
290
|
+
presentation: z.ZodObject<{
|
|
291
|
+
label: z.ZodString;
|
|
292
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
293
|
+
url: z.ZodOptional<z.ZodString>;
|
|
294
|
+
}, z.core.$strict>;
|
|
295
|
+
}, z.core.$strict>;
|
|
296
|
+
producerPluginId: z.ZodString;
|
|
297
|
+
revision: z.ZodNumber;
|
|
298
|
+
position: z.ZodNumber;
|
|
299
|
+
lastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
300
|
+
}, z.core.$strict>>;
|
|
301
|
+
total: z.ZodNumber;
|
|
302
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
303
|
+
}, z.core.$strict>;
|
|
304
|
+
declare const checkForwardReferencesInputSchema: z.ZodObject<{
|
|
305
|
+
source: z.ZodObject<{
|
|
306
|
+
provider: z.ZodString;
|
|
307
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
308
|
+
}, z.core.$strict>;
|
|
309
|
+
producerPluginId: z.ZodOptional<z.ZodString>;
|
|
310
|
+
}, z.core.$strict>;
|
|
311
|
+
declare const forwardReferenceStatusSchema: z.ZodObject<{
|
|
312
|
+
url: z.ZodString;
|
|
313
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
314
|
+
label: z.ZodString;
|
|
315
|
+
}, z.core.$strict>;
|
|
316
|
+
declare const checkForwardReferencesOutputSchema: z.ZodArray<z.ZodObject<{
|
|
317
|
+
url: z.ZodString;
|
|
318
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
319
|
+
label: z.ZodString;
|
|
320
|
+
}, z.core.$strict>>;
|
|
321
|
+
export { applyProjectionInputSchema, applyProjectionResponseSchema, backlinkRowSchema, checkForwardReferencesInputSchema, checkForwardReferencesOutputSchema, forwardReferenceStatusSchema, getProjectionInputSchema, getProjectionOutputSchema, listBacklinksInputSchema, listBacklinksOutputSchema, listForwardReferencesInputSchema, listForwardReferencesOutputSchema, presentationSchema, projectionSchema, resourceIdentitySchema, resourceSchema, };
|
|
322
|
+
export declare const CROSS_REFERENCES_PLUGIN_ID = "cross-references";
|
|
323
|
+
export declare const CROSS_REFERENCES_PROTOCOL: "cross-references";
|
|
324
|
+
export declare const LIMITS: Readonly<{
|
|
325
|
+
callMs: 5000;
|
|
326
|
+
describeMs: 1000;
|
|
327
|
+
responseBytes: number;
|
|
328
|
+
}>;
|
|
329
|
+
export declare const describeInputSchema: z.ZodNull;
|
|
330
|
+
export declare const describeOutputSchema: z.ZodObject<{
|
|
331
|
+
protocol: z.ZodLiteral<"cross-references">;
|
|
332
|
+
versions: z.ZodArray<z.ZodNumber>;
|
|
333
|
+
}, z.core.$strip>;
|
|
334
|
+
export declare const crossReferencesRpcSchemas: {
|
|
335
|
+
readonly "crossReferences.describe": {
|
|
336
|
+
readonly input: z.ZodNull;
|
|
337
|
+
readonly output: z.ZodObject<{
|
|
338
|
+
protocol: z.ZodLiteral<"cross-references">;
|
|
339
|
+
versions: z.ZodArray<z.ZodNumber>;
|
|
340
|
+
}, z.core.$strip>;
|
|
341
|
+
};
|
|
342
|
+
readonly applyProjection: {
|
|
343
|
+
readonly input: z.ZodObject<{
|
|
344
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
345
|
+
producerPluginId: z.ZodString;
|
|
346
|
+
mutationId: z.ZodString;
|
|
347
|
+
source: z.ZodObject<{
|
|
348
|
+
provider: z.ZodString;
|
|
349
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
350
|
+
presentation: z.ZodObject<{
|
|
351
|
+
label: z.ZodString;
|
|
352
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
353
|
+
url: z.ZodOptional<z.ZodString>;
|
|
354
|
+
}, z.core.$strict>;
|
|
355
|
+
}, z.core.$strict>;
|
|
356
|
+
revision: z.ZodNumber;
|
|
357
|
+
expectedRevision: z.ZodNumber;
|
|
358
|
+
payloadDigest: z.ZodString;
|
|
359
|
+
tombstone: z.ZodBoolean;
|
|
360
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
361
|
+
provider: z.ZodString;
|
|
362
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
363
|
+
presentation: z.ZodObject<{
|
|
364
|
+
label: z.ZodString;
|
|
365
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
366
|
+
url: z.ZodOptional<z.ZodString>;
|
|
367
|
+
}, z.core.$strict>;
|
|
368
|
+
}, z.core.$strict>>;
|
|
369
|
+
}, z.core.$strict>;
|
|
370
|
+
readonly output: z.ZodObject<{
|
|
371
|
+
outcome: z.ZodEnum<{
|
|
372
|
+
applied: "applied";
|
|
373
|
+
duplicate: "duplicate";
|
|
374
|
+
equal: "equal";
|
|
375
|
+
stale: "stale";
|
|
376
|
+
conflict: "conflict";
|
|
377
|
+
"cas-mismatch": "cas-mismatch";
|
|
378
|
+
}>;
|
|
379
|
+
currentRevision: z.ZodNumber;
|
|
380
|
+
currentDigest: z.ZodNullable<z.ZodString>;
|
|
381
|
+
}, z.core.$strict>;
|
|
382
|
+
};
|
|
383
|
+
readonly getProjection: {
|
|
384
|
+
readonly input: z.ZodObject<{
|
|
385
|
+
producerPluginId: z.ZodString;
|
|
386
|
+
source: z.ZodObject<{
|
|
387
|
+
provider: z.ZodString;
|
|
388
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
389
|
+
}, z.core.$strict>;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
readonly output: z.ZodObject<{
|
|
392
|
+
projection: z.ZodNullable<z.ZodObject<{
|
|
393
|
+
producerPluginId: z.ZodString;
|
|
394
|
+
source: z.ZodObject<{
|
|
395
|
+
provider: z.ZodString;
|
|
396
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
397
|
+
presentation: z.ZodObject<{
|
|
398
|
+
label: z.ZodString;
|
|
399
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
400
|
+
url: z.ZodOptional<z.ZodString>;
|
|
401
|
+
}, z.core.$strict>;
|
|
402
|
+
}, z.core.$strict>;
|
|
403
|
+
revision: z.ZodNumber;
|
|
404
|
+
mutationId: z.ZodString;
|
|
405
|
+
payloadDigest: z.ZodString;
|
|
406
|
+
tombstone: z.ZodBoolean;
|
|
407
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
408
|
+
provider: z.ZodString;
|
|
409
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
410
|
+
presentation: z.ZodObject<{
|
|
411
|
+
label: z.ZodString;
|
|
412
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
413
|
+
url: z.ZodOptional<z.ZodString>;
|
|
414
|
+
}, z.core.$strict>;
|
|
415
|
+
}, z.core.$strict>>;
|
|
416
|
+
}, z.core.$strict>>;
|
|
417
|
+
}, z.core.$strict>;
|
|
418
|
+
};
|
|
419
|
+
readonly listBacklinks: {
|
|
420
|
+
readonly input: z.ZodObject<{
|
|
421
|
+
target: z.ZodObject<{
|
|
422
|
+
provider: z.ZodString;
|
|
423
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
424
|
+
}, z.core.$strict>;
|
|
425
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
426
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
427
|
+
}, z.core.$strict>;
|
|
428
|
+
readonly output: z.ZodObject<{
|
|
429
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
430
|
+
source: z.ZodObject<{
|
|
431
|
+
provider: z.ZodString;
|
|
432
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
433
|
+
presentation: z.ZodObject<{
|
|
434
|
+
label: z.ZodString;
|
|
435
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
436
|
+
url: z.ZodOptional<z.ZodString>;
|
|
437
|
+
}, z.core.$strict>;
|
|
438
|
+
}, z.core.$strict>;
|
|
439
|
+
producerPluginId: z.ZodString;
|
|
440
|
+
revision: z.ZodNumber;
|
|
441
|
+
targetPresentation: z.ZodObject<{
|
|
442
|
+
label: z.ZodString;
|
|
443
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
444
|
+
url: z.ZodOptional<z.ZodString>;
|
|
445
|
+
}, z.core.$strict>;
|
|
446
|
+
position: z.ZodNumber;
|
|
447
|
+
lastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
448
|
+
}, z.core.$strict>>;
|
|
449
|
+
total: z.ZodNumber;
|
|
450
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
451
|
+
}, z.core.$strict>;
|
|
452
|
+
};
|
|
453
|
+
readonly listForwardReferences: {
|
|
454
|
+
readonly input: z.ZodObject<{
|
|
455
|
+
source: z.ZodObject<{
|
|
456
|
+
provider: z.ZodString;
|
|
457
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
458
|
+
}, z.core.$strict>;
|
|
459
|
+
producerPluginId: z.ZodOptional<z.ZodString>;
|
|
460
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
462
|
+
}, z.core.$strict>;
|
|
463
|
+
readonly output: z.ZodObject<{
|
|
464
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
465
|
+
target: z.ZodObject<{
|
|
466
|
+
provider: z.ZodString;
|
|
467
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
468
|
+
presentation: z.ZodObject<{
|
|
469
|
+
label: z.ZodString;
|
|
470
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
471
|
+
url: z.ZodOptional<z.ZodString>;
|
|
472
|
+
}, z.core.$strict>;
|
|
473
|
+
}, z.core.$strict>;
|
|
474
|
+
producerPluginId: z.ZodString;
|
|
475
|
+
revision: z.ZodNumber;
|
|
476
|
+
position: z.ZodNumber;
|
|
477
|
+
lastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
478
|
+
}, z.core.$strict>>;
|
|
479
|
+
total: z.ZodNumber;
|
|
480
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
481
|
+
}, z.core.$strict>;
|
|
482
|
+
};
|
|
483
|
+
readonly checkForwardReferences: {
|
|
484
|
+
readonly input: z.ZodObject<{
|
|
485
|
+
source: z.ZodObject<{
|
|
486
|
+
provider: z.ZodString;
|
|
487
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
488
|
+
}, z.core.$strict>;
|
|
489
|
+
producerPluginId: z.ZodOptional<z.ZodString>;
|
|
490
|
+
}, z.core.$strict>;
|
|
491
|
+
readonly output: z.ZodArray<z.ZodObject<{
|
|
492
|
+
url: z.ZodString;
|
|
493
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
494
|
+
label: z.ZodString;
|
|
495
|
+
}, z.core.$strict>>;
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
export interface ReferenceSnapshot {
|
|
499
|
+
revision: number;
|
|
500
|
+
targets: Resource[];
|
|
501
|
+
status: {
|
|
502
|
+
state: "synced" | "pending" | "degraded" | "blocked";
|
|
503
|
+
error: string | null;
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
export declare const referenceSnapshotSchema: z.ZodObject<{
|
|
507
|
+
revision: z.ZodNumber;
|
|
508
|
+
targets: z.ZodArray<z.ZodObject<{
|
|
509
|
+
provider: z.ZodString;
|
|
510
|
+
keys: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
511
|
+
presentation: z.ZodObject<{
|
|
512
|
+
label: z.ZodString;
|
|
513
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
514
|
+
url: z.ZodOptional<z.ZodString>;
|
|
515
|
+
}, z.core.$strict>;
|
|
516
|
+
}, z.core.$strict>>;
|
|
517
|
+
status: z.ZodObject<{
|
|
518
|
+
state: z.ZodEnum<{
|
|
519
|
+
synced: "synced";
|
|
520
|
+
pending: "pending";
|
|
521
|
+
degraded: "degraded";
|
|
522
|
+
blocked: "blocked";
|
|
523
|
+
}>;
|
|
524
|
+
error: z.ZodNullable<z.ZodString>;
|
|
525
|
+
}, z.core.$strip>;
|
|
526
|
+
}, z.core.$strip>;
|
|
527
|
+
export type GetProjectionInput = z.infer<typeof getProjectionInputSchema>;
|
|
528
|
+
export type ApplyProjectionRpcInput = ApplyProjectionInput;
|
|
529
|
+
export type CheckForwardReferencesRpcInput = CheckForwardReferencesInput;
|
|
530
|
+
export type CheckForwardReferencesRpcOutput = ForwardReferenceStatus[];
|
|
531
|
+
export type GetProjectionRpcOutput = GetProjectionResponse;
|
|
532
|
+
export type ListBacklinksRpcOutput = ListBacklinksResponse;
|
|
533
|
+
export type ListForwardReferencesRpcOutput = ListForwardReferencesResponse;
|
|
534
|
+
export type AttachmentSnapshot = ReferenceSnapshot;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Resource, AttachmentSnapshot } from "./index.js";
|
|
2
|
+
export type ReferencesApi = {
|
|
3
|
+
get(): Promise<AttachmentSnapshot>;
|
|
4
|
+
replace(revision: number, targets: Resource[]): Promise<AttachmentSnapshot & {
|
|
5
|
+
outcome?: "applied" | "cas-mismatch";
|
|
6
|
+
}>;
|
|
7
|
+
search(query: string): Promise<{
|
|
8
|
+
threads: PickerThread[];
|
|
9
|
+
}>;
|
|
10
|
+
thread(threadId: string): Promise<PickerThread>;
|
|
11
|
+
};
|
|
12
|
+
export type LinkedReferencesProps = {
|
|
13
|
+
/** Stable logical storage owner. Change this key when switching owners. */
|
|
14
|
+
ownerKey: string;
|
|
15
|
+
api: ReferencesApi;
|
|
16
|
+
connection?: string;
|
|
17
|
+
refreshToken?: number | string;
|
|
18
|
+
navigateThread(threadId: string): void;
|
|
19
|
+
origin?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
maxTargets?: number;
|
|
23
|
+
};
|
|
24
|
+
export type PickerThread = {
|
|
25
|
+
id: string;
|
|
26
|
+
projectId: string;
|
|
27
|
+
title: string;
|
|
28
|
+
detail?: string;
|
|
29
|
+
archived?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** Owner changes dispose reads, mutations and picker state as one lifetime. */
|
|
32
|
+
export declare function LinkedReferences(props: LinkedReferencesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ApplyProjectionInput } from "./index.js";
|
|
2
|
+
import { type CrossReferencesSdk } from "./bb.js";
|
|
3
|
+
export interface CrossReferencesConformanceResult {
|
|
4
|
+
level: "source-conformance";
|
|
5
|
+
pluginId: string;
|
|
6
|
+
checks: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Drive the adopter's actual registered handlers using its SDK transport. */
|
|
9
|
+
export declare function runCrossReferencesConformance(options: {
|
|
10
|
+
sdk: CrossReferencesSdk;
|
|
11
|
+
pluginId?: string;
|
|
12
|
+
/** Use an isolated fixture source with a fresh revision and at least one target. */
|
|
13
|
+
command: ApplyProjectionInput;
|
|
14
|
+
}): Promise<CrossReferencesConformanceResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,86 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phosphorco/bb-cross-references",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"description": "Shared Cross References v1 codecs, explicit clients, and reference controls.",
|
|
7
|
+
"author": "Phosphor",
|
|
8
|
+
"homepage": "https://github.com/phosphorco/bb-community-plugins/tree/main/packages/bb-cross-references#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/phosphorco/bb-community-plugins/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/phosphorco/bb-community-plugins.git",
|
|
15
|
+
"directory": "packages/bb-cross-references"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"bb",
|
|
19
|
+
"cross-references"
|
|
20
|
+
],
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/types/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./bb": {
|
|
27
|
+
"types": "./dist/types/bb.d.ts",
|
|
28
|
+
"import": "./dist/bb.js"
|
|
29
|
+
},
|
|
30
|
+
"./react": {
|
|
31
|
+
"types": "./dist/types/react.d.ts",
|
|
32
|
+
"import": "./dist/react.js"
|
|
33
|
+
},
|
|
34
|
+
"./testing": {
|
|
35
|
+
"types": "./dist/types/testing.d.ts",
|
|
36
|
+
"import": "./dist/testing.js"
|
|
37
|
+
},
|
|
38
|
+
"./styles.css": "./dist/references.css"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist/",
|
|
42
|
+
"README.md",
|
|
43
|
+
"CONTRACT.md",
|
|
44
|
+
"LICENSE"
|
|
45
|
+
],
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"zod": "4.3.6",
|
|
51
|
+
"@noble/hashes": "1.8.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@get-bb/plugin-sdk": ">=0.5.29 <0.6",
|
|
55
|
+
"react": "^19.2.1",
|
|
56
|
+
"react-dom": "^19.2.1"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"@get-bb/plugin-sdk": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"react": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"react-dom": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@get-bb/plugin-sdk": "0.5.29",
|
|
71
|
+
"@types/bun": "1.3.14",
|
|
72
|
+
"@types/react": "19.2.2",
|
|
73
|
+
"@types/react-dom": "19.2.2",
|
|
74
|
+
"bun": "1.3.14",
|
|
75
|
+
"react": "19.2.1",
|
|
76
|
+
"react-dom": "19.2.1",
|
|
77
|
+
"typescript": "5.9.3",
|
|
78
|
+
"jsdom": "26.1.0",
|
|
79
|
+
"@types/jsdom": "21.1.7"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "bun tools/build.mjs --entry \"src/index.ts\" --target browser --entry \"src/bb.ts\" --target browser --entry \"src/react.tsx\" --target browser --entry \"src/testing.ts\" --target browser --external \"zod\" --external \"@noble/hashes/*\" --external \"react\" --external \"react/*\" --external \"react-dom\" --external \"react-dom/*\" --external \"@get-bb/plugin-sdk\" --external \"@get-bb/plugin-sdk/*\" && tsc --project tsconfig.declarations.json && cp src/references.css dist/references.css",
|
|
83
|
+
"test": "bun test test",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
|
+
}
|
|
86
|
+
}
|