@airnauts/comments-core 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/LICENSE +21 -0
- package/README.md +17 -0
- package/dist/anchor/decide.d.ts +15 -0
- package/dist/anchor/decide.d.ts.map +1 -0
- package/dist/anchor/index.d.ts +9 -0
- package/dist/anchor/index.d.ts.map +1 -0
- package/dist/anchor/locate-quote.d.ts +11 -0
- package/dist/anchor/locate-quote.d.ts.map +1 -0
- package/dist/anchor/score.d.ts +10 -0
- package/dist/anchor/score.d.ts.map +1 -0
- package/dist/anchor/weights.d.ts +18 -0
- package/dist/anchor/weights.d.ts.map +1 -0
- package/dist/contract/errors.d.ts +32 -0
- package/dist/contract/errors.d.ts.map +1 -0
- package/dist/contract/openapi.d.ts +3 -0
- package/dist/contract/openapi.d.ts.map +1 -0
- package/dist/contract/operations.d.ts +18 -0
- package/dist/contract/operations.d.ts.map +1 -0
- package/dist/contract/requests.d.ts +113 -0
- package/dist/contract/requests.d.ts.map +1 -0
- package/dist/contract/responses.d.ts +65 -0
- package/dist/contract/responses.d.ts.map +1 -0
- package/dist/contract/wire.d.ts +2 -0
- package/dist/contract/wire.d.ts.map +1 -0
- package/dist/ids.d.ts +10 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +576 -0
- package/dist/index.js.map +1 -0
- package/dist/openapi.json +1579 -0
- package/dist/pageKey.d.ts +3 -0
- package/dist/pageKey.d.ts.map +1 -0
- package/dist/schemas/anchor.d.ts +62 -0
- package/dist/schemas/anchor.d.ts.map +1 -0
- package/dist/schemas/capture.d.ts +15 -0
- package/dist/schemas/capture.d.ts.map +1 -0
- package/dist/schemas/comment.d.ts +39 -0
- package/dist/schemas/comment.d.ts.map +1 -0
- package/dist/schemas/common.d.ts +8 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/thread.d.ts +163 -0
- package/dist/schemas/thread.d.ts.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Airnauts
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @airnauts/comments-core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic core for the [Airnauts commenting tool](https://github.com/Airnauts/commenting-tool): zod schemas,
|
|
4
|
+
page-key normalization, the scoring/threshold policy, and the OpenAPI contract.
|
|
5
|
+
|
|
6
|
+
Most consumers depend on this transitively via `@airnauts/comments-client` or
|
|
7
|
+
`@airnauts/comments-server` rather than installing it directly.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @airnauts/comments-core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## License
|
|
16
|
+
|
|
17
|
+
MIT © Airnauts
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ScoreResult } from './score';
|
|
2
|
+
import { type Thresholds } from './weights';
|
|
3
|
+
export type Decision<T> = {
|
|
4
|
+
kind: 'anchored';
|
|
5
|
+
winner: T;
|
|
6
|
+
score: ScoreResult;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'orphaned';
|
|
9
|
+
reason: 'noCandidates' | 'belowAccept' | 'ambiguous';
|
|
10
|
+
};
|
|
11
|
+
export declare function decide<T>(scored: Array<{
|
|
12
|
+
ref: T;
|
|
13
|
+
score: ScoreResult;
|
|
14
|
+
}>, opts?: Partial<Thresholds>): Decision<T>;
|
|
15
|
+
//# sourceMappingURL=decide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../../src/anchor/decide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAA;AAE/D,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACnD;IACE,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,CAAA;CACrD,CAAA;AAEL,wBAAgB,MAAM,CAAC,CAAC,EACtB,MAAM,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC,EAC7C,IAAI,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GACzB,QAAQ,CAAC,CAAC,CAAC,CAcb"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { Decision } from './decide';
|
|
2
|
+
export { decide } from './decide';
|
|
3
|
+
export type { QuoteContext, QuoteOffsets } from './locate-quote';
|
|
4
|
+
export { locateQuote } from './locate-quote';
|
|
5
|
+
export type { ScoreComponents, ScoreResult } from './score';
|
|
6
|
+
export { scoreCandidate } from './score';
|
|
7
|
+
export type { Thresholds, WeightKey } from './weights';
|
|
8
|
+
export { DEFAULT_THRESHOLDS, DEFAULT_WEIGHTS } from './weights';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/anchor/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type QuoteContext = {
|
|
2
|
+
quote: string;
|
|
3
|
+
prefix: string;
|
|
4
|
+
suffix: string;
|
|
5
|
+
};
|
|
6
|
+
export type QuoteOffsets = {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function locateQuote(haystack: string, ctx: QuoteContext): QuoteOffsets | null;
|
|
11
|
+
//# sourceMappingURL=locate-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locate-quote.d.ts","sourceRoot":"","sources":["../../src/anchor/locate-quote.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAC5E,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AA0DzD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI,CA0CpF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Signals } from '../schemas/anchor';
|
|
2
|
+
import { type WeightKey } from './weights';
|
|
3
|
+
export type ScoreComponents = Record<WeightKey, number>;
|
|
4
|
+
export type ScoreResult = {
|
|
5
|
+
total: number;
|
|
6
|
+
components: ScoreComponents;
|
|
7
|
+
excluded: false | 'tagMismatch';
|
|
8
|
+
};
|
|
9
|
+
export declare function scoreCandidate(stored: Signals, candidate: Signals): ScoreResult;
|
|
10
|
+
//# sourceMappingURL=score.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../../src/anchor/score.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAA;AAE3D,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,eAAe,CAAA;IAC3B,QAAQ,EAAE,KAAK,GAAG,aAAa,CAAA;CAChC,CAAA;AAWD,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,WAAW,CAoB/E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const DEFAULT_WEIGHTS: {
|
|
2
|
+
readonly stableAttrs: 0.4;
|
|
3
|
+
readonly text: 0.25;
|
|
4
|
+
readonly classes: 0.15;
|
|
5
|
+
readonly role: 0.1;
|
|
6
|
+
readonly sibling: 0.05;
|
|
7
|
+
readonly ancestor: 0.05;
|
|
8
|
+
};
|
|
9
|
+
export type WeightKey = keyof typeof DEFAULT_WEIGHTS;
|
|
10
|
+
export declare const DEFAULT_THRESHOLDS: {
|
|
11
|
+
readonly accept: 0.6;
|
|
12
|
+
readonly margin: 0.1;
|
|
13
|
+
};
|
|
14
|
+
export type Thresholds = {
|
|
15
|
+
accept: number;
|
|
16
|
+
margin: number;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=weights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weights.d.ts","sourceRoot":"","sources":["../../src/anchor/weights.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAA;AAEV,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,eAAe,CAAA;AAEpD,eAAO,MAAM,kBAAkB;;;CAGrB,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ERROR_CODES: readonly ["VALIDATION_FAILED", "AUTH_INVALID_KEY", "ORIGIN_NOT_ALLOWED", "NOT_FOUND", "CONFLICT", "UPLOAD_TOO_LARGE", "RATE_LIMITED", "INTERNAL"];
|
|
3
|
+
export declare const ErrorCode: z.ZodEnum<{
|
|
4
|
+
VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
5
|
+
AUTH_INVALID_KEY: "AUTH_INVALID_KEY";
|
|
6
|
+
ORIGIN_NOT_ALLOWED: "ORIGIN_NOT_ALLOWED";
|
|
7
|
+
NOT_FOUND: "NOT_FOUND";
|
|
8
|
+
CONFLICT: "CONFLICT";
|
|
9
|
+
UPLOAD_TOO_LARGE: "UPLOAD_TOO_LARGE";
|
|
10
|
+
RATE_LIMITED: "RATE_LIMITED";
|
|
11
|
+
INTERNAL: "INTERNAL";
|
|
12
|
+
}>;
|
|
13
|
+
export type ErrorCode = z.infer<typeof ErrorCode>;
|
|
14
|
+
export declare const ErrorResponse: z.ZodObject<{
|
|
15
|
+
error: z.ZodObject<{
|
|
16
|
+
code: z.ZodEnum<{
|
|
17
|
+
VALIDATION_FAILED: "VALIDATION_FAILED";
|
|
18
|
+
AUTH_INVALID_KEY: "AUTH_INVALID_KEY";
|
|
19
|
+
ORIGIN_NOT_ALLOWED: "ORIGIN_NOT_ALLOWED";
|
|
20
|
+
NOT_FOUND: "NOT_FOUND";
|
|
21
|
+
CONFLICT: "CONFLICT";
|
|
22
|
+
UPLOAD_TOO_LARGE: "UPLOAD_TOO_LARGE";
|
|
23
|
+
RATE_LIMITED: "RATE_LIMITED";
|
|
24
|
+
INTERNAL: "INTERNAL";
|
|
25
|
+
}>;
|
|
26
|
+
message: z.ZodString;
|
|
27
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type ErrorResponse = z.infer<typeof ErrorResponse>;
|
|
31
|
+
export declare const ERROR_STATUS: Record<ErrorCode, number>;
|
|
32
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/contract/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,WAAW,mJASd,CAAA;AAEV,eAAO,MAAM,SAAS;;;;;;;;;EAAsB,CAAA;AAC5C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEjD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;iBAQM,CAAA;AAChC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEzD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CASlD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/contract/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAIf,MAAM,aAAa,CAAA;AAUpB,wBAAgB,oBAAoB,IAAI,UAAU,CAAC,OAAO,cAAc,CAAC,CAkDxE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { ErrorCode } from './errors';
|
|
3
|
+
export interface Operation {
|
|
4
|
+
operationId: string;
|
|
5
|
+
method: 'GET' | 'POST' | 'PATCH';
|
|
6
|
+
path: string;
|
|
7
|
+
summary: string;
|
|
8
|
+
params?: z.ZodObject;
|
|
9
|
+
query?: z.ZodObject;
|
|
10
|
+
body?: z.ZodType | 'multipart';
|
|
11
|
+
success: {
|
|
12
|
+
status: number;
|
|
13
|
+
schema: z.ZodType;
|
|
14
|
+
};
|
|
15
|
+
errors: ErrorCode[];
|
|
16
|
+
}
|
|
17
|
+
export declare const operations: Operation[];
|
|
18
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/contract/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAG5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAWzC,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAA;IACpB,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS,CAAA;IACnB,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,WAAW,CAAA;IAC9B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAA;KAAE,CAAA;IAC9C,MAAM,EAAE,SAAS,EAAE,CAAA;CACpB;AAID,eAAO,MAAM,UAAU,EAAE,SAAS,EAmEjC,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreateThreadBody: z.ZodObject<{
|
|
3
|
+
pageKey: z.ZodOptional<z.ZodString>;
|
|
4
|
+
pageUrl: z.ZodURL;
|
|
5
|
+
pageTitle: z.ZodOptional<z.ZodString>;
|
|
6
|
+
anchor: z.ZodObject<{
|
|
7
|
+
schemaVersion: z.ZodNumber;
|
|
8
|
+
selectors: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
9
|
+
signals: z.ZodObject<{
|
|
10
|
+
tag: z.ZodString;
|
|
11
|
+
role: z.ZodOptional<z.ZodString>;
|
|
12
|
+
textSnippet: z.ZodOptional<z.ZodString>;
|
|
13
|
+
classes: z.ZodArray<z.ZodString>;
|
|
14
|
+
siblingIndex: z.ZodNumber;
|
|
15
|
+
ancestorTrail: z.ZodArray<z.ZodString>;
|
|
16
|
+
stableAttrs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
offset: z.ZodObject<{
|
|
19
|
+
fx: z.ZodNumber;
|
|
20
|
+
fy: z.ZodNumber;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
selection: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
start: z.ZodObject<{
|
|
24
|
+
selectors: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
25
|
+
textNodeIndex: z.ZodNumber;
|
|
26
|
+
offset: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
end: z.ZodObject<{
|
|
29
|
+
selectors: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
30
|
+
textNodeIndex: z.ZodNumber;
|
|
31
|
+
offset: z.ZodNumber;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
quote: z.ZodString;
|
|
34
|
+
prefix: z.ZodString;
|
|
35
|
+
suffix: z.ZodString;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
comment: z.ZodObject<{
|
|
39
|
+
text: z.ZodString;
|
|
40
|
+
attachmentIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AttachmentId", "out">>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
author: z.ZodObject<{
|
|
43
|
+
id: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AuthorId", "out">>;
|
|
44
|
+
email: z.ZodEmail;
|
|
45
|
+
name: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
captureContext: z.ZodObject<{
|
|
48
|
+
viewportW: z.ZodNumber;
|
|
49
|
+
viewportH: z.ZodNumber;
|
|
50
|
+
devicePixelRatio: z.ZodNumber;
|
|
51
|
+
userAgent: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
provenance: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
commitSha: z.ZodOptional<z.ZodString>;
|
|
55
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
56
|
+
deploymentId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type CreateThreadBody = z.infer<typeof CreateThreadBody>;
|
|
60
|
+
export declare const ListThreadsQuery: z.ZodObject<{
|
|
61
|
+
pageKey: z.ZodOptional<z.ZodString>;
|
|
62
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
open: "open";
|
|
64
|
+
resolved: "resolved";
|
|
65
|
+
}>>;
|
|
66
|
+
sort: z.ZodOptional<z.ZodLiteral<"updatedAt">>;
|
|
67
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type ListThreadsQuery = z.infer<typeof ListThreadsQuery>;
|
|
70
|
+
export declare const ThreadIdParam: z.ZodObject<{
|
|
71
|
+
id: z.core.$ZodBranded<z.ZodString, "ThreadId", "out">;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
export type ThreadIdParam = z.infer<typeof ThreadIdParam>;
|
|
74
|
+
export declare const AddCommentBody: z.ZodObject<{
|
|
75
|
+
text: z.ZodString;
|
|
76
|
+
attachmentIds: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "AttachmentId", "out">>>;
|
|
77
|
+
author: z.ZodObject<{
|
|
78
|
+
id: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AuthorId", "out">>;
|
|
79
|
+
email: z.ZodEmail;
|
|
80
|
+
name: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export type AddCommentBody = z.infer<typeof AddCommentBody>;
|
|
84
|
+
export declare const SetThreadStatusBody: z.ZodObject<{
|
|
85
|
+
status: z.ZodEnum<{
|
|
86
|
+
open: "open";
|
|
87
|
+
resolved: "resolved";
|
|
88
|
+
}>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export type SetThreadStatusBody = z.infer<typeof SetThreadStatusBody>;
|
|
91
|
+
export declare const RefreshAnchorBody: z.ZodObject<{
|
|
92
|
+
selectors: z.ZodOptional<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
93
|
+
signals: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
tag: z.ZodString;
|
|
95
|
+
role: z.ZodOptional<z.ZodString>;
|
|
96
|
+
textSnippet: z.ZodOptional<z.ZodString>;
|
|
97
|
+
classes: z.ZodArray<z.ZodString>;
|
|
98
|
+
siblingIndex: z.ZodNumber;
|
|
99
|
+
ancestorTrail: z.ZodArray<z.ZodString>;
|
|
100
|
+
stableAttrs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
anchorState: z.ZodEnum<{
|
|
103
|
+
anchored: "anchored";
|
|
104
|
+
orphaned: "orphaned";
|
|
105
|
+
}>;
|
|
106
|
+
selectionLost: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type RefreshAnchorBody = z.infer<typeof RefreshAnchorBody>;
|
|
109
|
+
export declare const UploadForm: z.ZodObject<{
|
|
110
|
+
file: z.ZodString;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
export type UploadForm = z.infer<typeof UploadForm>;
|
|
113
|
+
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/contract/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAgBvB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAaM,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,gBAAgB;;;;;;;;iBAOM,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,aAAa;;iBAA6B,CAAA;AACvD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEzD,eAAO,MAAM,cAAc;;;;;;;;iBAOM,CAAA;AACjC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,eAAO,MAAM,mBAAmB;;;;;iBAEM,CAAA;AACtC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;iBAOM,CAAA;AACpC,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAGjE,eAAO,MAAM,UAAU;;iBAIM,CAAA;AAC7B,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ThreadListResponse: z.ZodObject<{
|
|
3
|
+
threads: z.ZodArray<z.ZodObject<{
|
|
4
|
+
id: z.core.$ZodBranded<z.ZodString, "ThreadId", "out">;
|
|
5
|
+
scope: z.ZodLiteral<"page">;
|
|
6
|
+
pageKey: z.ZodNullable<z.ZodString>;
|
|
7
|
+
pageUrl: z.ZodURL;
|
|
8
|
+
pageTitle: z.ZodOptional<z.ZodString>;
|
|
9
|
+
anchor: z.ZodObject<{
|
|
10
|
+
schemaVersion: z.ZodNumber;
|
|
11
|
+
selectors: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
12
|
+
signals: z.ZodObject<{
|
|
13
|
+
tag: z.ZodString;
|
|
14
|
+
role: z.ZodOptional<z.ZodString>;
|
|
15
|
+
textSnippet: z.ZodOptional<z.ZodString>;
|
|
16
|
+
classes: z.ZodArray<z.ZodString>;
|
|
17
|
+
siblingIndex: z.ZodNumber;
|
|
18
|
+
ancestorTrail: z.ZodArray<z.ZodString>;
|
|
19
|
+
stableAttrs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
offset: z.ZodObject<{
|
|
22
|
+
fx: z.ZodNumber;
|
|
23
|
+
fy: z.ZodNumber;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
selection: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
start: z.ZodObject<{
|
|
27
|
+
selectors: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
28
|
+
textNodeIndex: z.ZodNumber;
|
|
29
|
+
offset: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
end: z.ZodObject<{
|
|
32
|
+
selectors: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
33
|
+
textNodeIndex: z.ZodNumber;
|
|
34
|
+
offset: z.ZodNumber;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
quote: z.ZodString;
|
|
37
|
+
prefix: z.ZodString;
|
|
38
|
+
suffix: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
status: z.ZodEnum<{
|
|
42
|
+
open: "open";
|
|
43
|
+
resolved: "resolved";
|
|
44
|
+
}>;
|
|
45
|
+
anchorState: z.ZodEnum<{
|
|
46
|
+
anchored: "anchored";
|
|
47
|
+
orphaned: "orphaned";
|
|
48
|
+
}>;
|
|
49
|
+
selectionLost: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
commentCount: z.ZodNumber;
|
|
51
|
+
unresolvedCount: z.ZodNumber;
|
|
52
|
+
createdBy: z.ZodObject<{
|
|
53
|
+
id: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AuthorId", "out">>;
|
|
54
|
+
email: z.ZodEmail;
|
|
55
|
+
name: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
createdAt: z.ZodISODateTime;
|
|
58
|
+
updatedAt: z.ZodISODateTime;
|
|
59
|
+
lastActivityAt: z.ZodISODateTime;
|
|
60
|
+
schemaVersion: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type ThreadListResponse = z.infer<typeof ThreadListResponse>;
|
|
65
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/contract/responses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKM,CAAA;AACrC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/contract/wire.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,mBAAmB,CAAA"}
|
package/dist/ids.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ThreadId: z.core.$ZodBranded<z.ZodString, "ThreadId", "out">;
|
|
3
|
+
export type ThreadId = z.infer<typeof ThreadId>;
|
|
4
|
+
export declare const CommentId: z.core.$ZodBranded<z.ZodString, "CommentId", "out">;
|
|
5
|
+
export type CommentId = z.infer<typeof CommentId>;
|
|
6
|
+
export declare const AuthorId: z.core.$ZodBranded<z.ZodString, "AuthorId", "out">;
|
|
7
|
+
export type AuthorId = z.infer<typeof AuthorId>;
|
|
8
|
+
export declare const AttachmentId: z.core.$ZodBranded<z.ZodString, "AttachmentId", "out">;
|
|
9
|
+
export type AttachmentId = z.infer<typeof AttachmentId>;
|
|
10
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,QAAQ,oDAAwC,CAAA;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE/C,eAAO,MAAM,SAAS,qDAAyC,CAAA;AAC/D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAEjD,eAAO,MAAM,QAAQ,oDAAwC,CAAA;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE/C,eAAO,MAAM,YAAY,wDAA4C,CAAA;AACrE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './anchor';
|
|
2
|
+
export * from './contract/errors';
|
|
3
|
+
export * from './contract/openapi';
|
|
4
|
+
export * from './contract/operations';
|
|
5
|
+
export * from './contract/requests';
|
|
6
|
+
export * from './contract/responses';
|
|
7
|
+
export * from './contract/wire';
|
|
8
|
+
export * from './ids';
|
|
9
|
+
export * from './pageKey';
|
|
10
|
+
export * from './schemas/anchor';
|
|
11
|
+
export * from './schemas/capture';
|
|
12
|
+
export * from './schemas/comment';
|
|
13
|
+
export * from './schemas/common';
|
|
14
|
+
export * from './schemas/thread';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA"}
|