@knowzai/api-client 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/dist/.tsbuildinfo +1 -0
- package/dist/chat.d.ts +21 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +147 -0
- package/dist/chat.js.map +1 -0
- package/dist/client.d.ts +33 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +198 -0
- package/dist/client.js.map +1 -0
- package/dist/contracts.d.ts +24 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -0
- package/dist/envelope.d.ts +27 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/envelope.js +16 -0
- package/dist/envelope.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/ask.d.ts +14 -0
- package/dist/resources/ask.d.ts.map +1 -0
- package/dist/resources/ask.js +22 -0
- package/dist/resources/ask.js.map +1 -0
- package/dist/resources/auth.d.ts +15 -0
- package/dist/resources/auth.d.ts.map +1 -0
- package/dist/resources/auth.js +35 -0
- package/dist/resources/auth.js.map +1 -0
- package/dist/resources/extras.d.ts +157 -0
- package/dist/resources/extras.d.ts.map +1 -0
- package/dist/resources/extras.js +150 -0
- package/dist/resources/extras.js.map +1 -0
- package/dist/resources/index.d.ts +6 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +6 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/knowledge.d.ts +13 -0
- package/dist/resources/knowledge.d.ts.map +1 -0
- package/dist/resources/knowledge.js +92 -0
- package/dist/resources/knowledge.js.map +1 -0
- package/dist/resources/paging.d.ts +15 -0
- package/dist/resources/paging.d.ts.map +1 -0
- package/dist/resources/paging.js +16 -0
- package/dist/resources/paging.js.map +1 -0
- package/dist/resources/schemas.d.ts +322 -0
- package/dist/resources/schemas.d.ts.map +1 -0
- package/dist/resources/schemas.js +172 -0
- package/dist/resources/schemas.js.map +1 -0
- package/dist/resources/search.d.ts +14 -0
- package/dist/resources/search.d.ts.map +1 -0
- package/dist/resources/search.js +21 -0
- package/dist/resources/search.js.map +1 -0
- package/dist/resources/vaults.d.ts +14 -0
- package/dist/resources/vaults.d.ts.map +1 -0
- package/dist/resources/vaults.js +41 -0
- package/dist/resources/vaults.js.map +1 -0
- package/dist/tls.d.ts +7 -0
- package/dist/tls.d.ts.map +1 -0
- package/dist/tls.js +22 -0
- package/dist/tls.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for the universal Knowz response envelope. Lives here (not in
|
|
4
|
+
* `@knowzai/types`) so `@knowzai/types` stays dependency-free; the `ApiEnvelope<T>`
|
|
5
|
+
* TYPE lives in `@knowzai/types`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ApiEnvelopeSchema: <T>(data: z.ZodType<T>) => z.ZodObject<{
|
|
8
|
+
success: z.ZodBoolean;
|
|
9
|
+
data: z.ZodType<T, z.ZodTypeDef, T>;
|
|
10
|
+
message: z.ZodOptional<z.ZodString>;
|
|
11
|
+
errors: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
timestamp: z.ZodString;
|
|
13
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
14
|
+
success: z.ZodBoolean;
|
|
15
|
+
data: z.ZodType<T, z.ZodTypeDef, T>;
|
|
16
|
+
message: z.ZodOptional<z.ZodString>;
|
|
17
|
+
errors: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
timestamp: z.ZodString;
|
|
19
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
20
|
+
success: z.ZodBoolean;
|
|
21
|
+
data: z.ZodType<T, z.ZodTypeDef, T>;
|
|
22
|
+
message: z.ZodOptional<z.ZodString>;
|
|
23
|
+
errors: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
timestamp: z.ZodString;
|
|
25
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
26
|
+
export type AnyEnvelope = z.infer<ReturnType<typeof ApiEnvelopeSchema<unknown>>>;
|
|
27
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;iEASnD,CAAC;AAEL,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/envelope.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for the universal Knowz response envelope. Lives here (not in
|
|
4
|
+
* `@knowzai/types`) so `@knowzai/types` stays dependency-free; the `ApiEnvelope<T>`
|
|
5
|
+
* TYPE lives in `@knowzai/types`.
|
|
6
|
+
*/
|
|
7
|
+
export const ApiEnvelopeSchema = (data) => z.object({
|
|
8
|
+
success: z.boolean(),
|
|
9
|
+
data,
|
|
10
|
+
// Optional: not all endpoints return a top-level `message` (some nest it in
|
|
11
|
+
// `data` or omit it). Requiring it rejects valid responses as "Malformed".
|
|
12
|
+
message: z.string().optional(),
|
|
13
|
+
errors: z.array(z.string()).nullable(),
|
|
14
|
+
timestamp: z.string(),
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.js","sourceRoot":"","sources":["../src/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAI,IAAkB,EAAE,EAAE,CACzD,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,IAAI;IACJ,4EAA4E;IAC5E,2EAA2E;IAC3E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const NODE_ID: "FEAT_KnowzApiClient";
|
|
2
|
+
export { createApiClient, type ApiClientOptions, type KnowzApiClient } from './client.js';
|
|
3
|
+
export type { RequestSpec, StreamSpec, CoreClient } from './contracts.js';
|
|
4
|
+
export { ApiEnvelopeSchema } from './envelope.js';
|
|
5
|
+
export { assertTlsAllowed } from './tls.js';
|
|
6
|
+
export { AuthApi, KnowledgeApi, VaultsApi, SearchApi, AskApi, type SearchQuery, type AskRequest, } from './resources/index.js';
|
|
7
|
+
export { toPaged, toArray } from './resources/paging.js';
|
|
8
|
+
export { ChatApi, parseSseStream } from './chat.js';
|
|
9
|
+
export { EntitiesApi, TopicsApi, StatsApi, CommentsApi, VersionsApi, AmendApi, type Entity, type Topic, type Comment, type KnowledgeVersion, type AmendEnvelope, type AmendStatus, } from './resources/extras.js';
|
|
10
|
+
export { ApiError } from '@knowzai/types';
|
|
11
|
+
export type { ApiEnvelope, AuthHeader, AuthHeaderName, RegisterTenantRequest, RegisterResult, VerifyResult, ValidateKeyResult, } from '@knowzai/types';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,EAAG,qBAA8B,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1F,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,SAAS,EACT,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,EACR,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const NODE_ID = 'FEAT_KnowzApiClient';
|
|
2
|
+
export { createApiClient } from './client.js';
|
|
3
|
+
export { ApiEnvelopeSchema } from './envelope.js';
|
|
4
|
+
export { assertTlsAllowed } from './tls.js';
|
|
5
|
+
export { AuthApi, KnowledgeApi, VaultsApi, SearchApi, AskApi, } from './resources/index.js';
|
|
6
|
+
export { toPaged, toArray } from './resources/paging.js';
|
|
7
|
+
export { ChatApi, parseSseStream } from './chat.js';
|
|
8
|
+
export { EntitiesApi, TopicsApi, StatsApi, CommentsApi, VersionsApi, AmendApi, } from './resources/extras.js';
|
|
9
|
+
// Re-export the shared envelope/error contract for convenience.
|
|
10
|
+
export { ApiError } from '@knowzai/types';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,qBAA8B,CAAC;AAEtD,OAAO,EAAE,eAAe,EAA8C,MAAM,aAAa,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,SAAS,EACT,MAAM,GAGP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,GAOT,MAAM,uBAAuB,CAAC;AAE/B,gEAAgE;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CoreClient } from '../contracts.js';
|
|
2
|
+
import type { AskResult } from '@knowzai/types';
|
|
3
|
+
export interface AskRequest {
|
|
4
|
+
question: string;
|
|
5
|
+
vaultId?: string;
|
|
6
|
+
researchMode?: boolean;
|
|
7
|
+
includeSharedVaults?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class AskApi {
|
|
10
|
+
private readonly core;
|
|
11
|
+
constructor(core: CoreClient);
|
|
12
|
+
ask(req: AskRequest): Promise<AskResult>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../src/resources/ask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;CAczC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AskResultSchema } from './schemas.js';
|
|
2
|
+
export class AskApi {
|
|
3
|
+
core;
|
|
4
|
+
constructor(core) {
|
|
5
|
+
this.core = core;
|
|
6
|
+
}
|
|
7
|
+
ask(req) {
|
|
8
|
+
// Live Q&A route is POST /api/v1/knowledge/query (field is `query`, not `question`).
|
|
9
|
+
return this.core.request({
|
|
10
|
+
method: 'POST',
|
|
11
|
+
path: '/api/v1/knowledge/query',
|
|
12
|
+
body: {
|
|
13
|
+
query: req.question,
|
|
14
|
+
vaultId: req.vaultId,
|
|
15
|
+
researchMode: req.researchMode,
|
|
16
|
+
includeSharedVaults: req.includeSharedVaults,
|
|
17
|
+
},
|
|
18
|
+
schema: AskResultSchema,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/resources/ask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAS/C,MAAM,OAAO,MAAM;IACY;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,GAAG,CAAC,GAAe;QACjB,qFAAqF;QACrF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,yBAAyB;YAC/B,IAAI,EAAE;gBACJ,KAAK,EAAE,GAAG,CAAC,QAAQ;gBACnB,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,YAAY,EAAE,GAAG,CAAC,YAAY;gBAC9B,mBAAmB,EAAE,GAAG,CAAC,mBAAmB;aAC7C;YACD,MAAM,EAAE,eAAe;SACxB,CAAuB,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CoreClient } from '../contracts.js';
|
|
2
|
+
import type { RegisterTenantRequest, RegisterResult, VerifyResult, ValidateKeyResult } from '@knowzai/types';
|
|
3
|
+
export declare class AuthApi {
|
|
4
|
+
private readonly core;
|
|
5
|
+
constructor(core: CoreClient);
|
|
6
|
+
register(req: RegisterTenantRequest): Promise<RegisterResult>;
|
|
7
|
+
verify(req: {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
apiKey: string;
|
|
10
|
+
}): Promise<VerifyResult>;
|
|
11
|
+
validateKey(req: {
|
|
12
|
+
apiKey: string;
|
|
13
|
+
}): Promise<ValidateKeyResult>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/resources/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAGxB,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,QAAQ,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC;IAU7D,MAAM,CAAC,GAAG,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAUxE,WAAW,CAAC,GAAG,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;CASjE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RegisterResultSchema, VerifyResultSchema } from './schemas.js';
|
|
2
|
+
export class AuthApi {
|
|
3
|
+
core;
|
|
4
|
+
constructor(core) {
|
|
5
|
+
this.core = core;
|
|
6
|
+
}
|
|
7
|
+
register(req) {
|
|
8
|
+
return this.core.request({
|
|
9
|
+
method: 'POST',
|
|
10
|
+
path: '/api/v1/auth/register',
|
|
11
|
+
body: req,
|
|
12
|
+
schema: RegisterResultSchema,
|
|
13
|
+
anonymous: true,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
verify(req) {
|
|
17
|
+
return this.core.request({
|
|
18
|
+
method: 'POST',
|
|
19
|
+
path: '/api/v1/auth/verify',
|
|
20
|
+
body: req,
|
|
21
|
+
schema: VerifyResultSchema,
|
|
22
|
+
anonymous: true,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
validateKey(req) {
|
|
26
|
+
return this.core.request({
|
|
27
|
+
method: 'POST',
|
|
28
|
+
path: '/api/v1/auth/validate-key',
|
|
29
|
+
body: req,
|
|
30
|
+
schema: VerifyResultSchema,
|
|
31
|
+
anonymous: true,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/resources/auth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAExE,MAAM,OAAO,OAAO;IACW;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,QAAQ,CAAC,GAA0B;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,uBAAuB;YAC7B,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,oBAAoB;YAC5B,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,GAAyC;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,kBAAkB;YAC1B,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;IAED,WAAW,CAAC,GAAuB;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,kBAAkB;YAC1B,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CoreClient } from '../contracts.js';
|
|
3
|
+
export declare const EntitySchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
type: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
7
|
+
description: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
8
|
+
knowledgeCount: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
type: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
13
|
+
description: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
14
|
+
knowledgeCount: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
type: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
19
|
+
description: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
20
|
+
knowledgeCount: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
22
|
+
export declare const TopicSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
itemCount: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
itemCount: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
itemCount: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
38
|
+
export declare const CommentSchema: z.ZodEffects<z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
body: z.ZodOptional<z.ZodString>;
|
|
41
|
+
content: z.ZodOptional<z.ZodString>;
|
|
42
|
+
authorName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
44
|
+
parentCommentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
body: z.ZodOptional<z.ZodString>;
|
|
48
|
+
content: z.ZodOptional<z.ZodString>;
|
|
49
|
+
authorName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
51
|
+
parentCommentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
body: z.ZodOptional<z.ZodString>;
|
|
55
|
+
content: z.ZodOptional<z.ZodString>;
|
|
56
|
+
authorName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
58
|
+
parentCommentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
body: z.ZodOptional<z.ZodString>;
|
|
62
|
+
content: z.ZodOptional<z.ZodString>;
|
|
63
|
+
authorName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
65
|
+
parentCommentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
}, z.ZodTypeAny, "passthrough">, unknown>;
|
|
67
|
+
export declare const VersionSchema: z.ZodObject<{
|
|
68
|
+
id: z.ZodOptional<z.ZodString>;
|
|
69
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
71
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
73
|
+
id: z.ZodOptional<z.ZodString>;
|
|
74
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
76
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
78
|
+
id: z.ZodOptional<z.ZodString>;
|
|
79
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
81
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
83
|
+
export declare const StatsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
84
|
+
export declare const AmendEnvelopeSchema: z.ZodObject<{
|
|
85
|
+
amendRequestId: z.ZodString;
|
|
86
|
+
status: z.ZodString;
|
|
87
|
+
pollUrl: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
89
|
+
amendRequestId: z.ZodString;
|
|
90
|
+
status: z.ZodString;
|
|
91
|
+
pollUrl: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
93
|
+
amendRequestId: z.ZodString;
|
|
94
|
+
status: z.ZodString;
|
|
95
|
+
pollUrl: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
97
|
+
export declare const AmendStatusSchema: z.ZodObject<{
|
|
98
|
+
status: z.ZodString;
|
|
99
|
+
amendRequestId: z.ZodOptional<z.ZodString>;
|
|
100
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
102
|
+
status: z.ZodString;
|
|
103
|
+
amendRequestId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
106
|
+
status: z.ZodString;
|
|
107
|
+
amendRequestId: z.ZodOptional<z.ZodString>;
|
|
108
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
109
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
110
|
+
export type Entity = z.infer<typeof EntitySchema>;
|
|
111
|
+
export type Topic = z.infer<typeof TopicSchema>;
|
|
112
|
+
export type Comment = z.infer<typeof CommentSchema>;
|
|
113
|
+
export type KnowledgeVersion = z.infer<typeof VersionSchema>;
|
|
114
|
+
export type AmendEnvelope = z.infer<typeof AmendEnvelopeSchema>;
|
|
115
|
+
export type AmendStatus = z.infer<typeof AmendStatusSchema>;
|
|
116
|
+
export declare class EntitiesApi {
|
|
117
|
+
private readonly core;
|
|
118
|
+
constructor(core: CoreClient);
|
|
119
|
+
find(q?: {
|
|
120
|
+
type?: string;
|
|
121
|
+
q?: string;
|
|
122
|
+
limit?: number;
|
|
123
|
+
}): Promise<Entity[]>;
|
|
124
|
+
}
|
|
125
|
+
export declare class TopicsApi {
|
|
126
|
+
private readonly core;
|
|
127
|
+
constructor(core: CoreClient);
|
|
128
|
+
list(limit?: number): Promise<Topic[]>;
|
|
129
|
+
get(id: string): Promise<Topic>;
|
|
130
|
+
}
|
|
131
|
+
export declare class StatsApi {
|
|
132
|
+
private readonly core;
|
|
133
|
+
constructor(core: CoreClient);
|
|
134
|
+
get(): Promise<Record<string, unknown>>;
|
|
135
|
+
}
|
|
136
|
+
export declare class CommentsApi {
|
|
137
|
+
private readonly core;
|
|
138
|
+
constructor(core: CoreClient);
|
|
139
|
+
list(knowledgeId: string): Promise<Comment[]>;
|
|
140
|
+
add(knowledgeId: string, body: {
|
|
141
|
+
body: string;
|
|
142
|
+
authorName?: string;
|
|
143
|
+
parentCommentId?: string;
|
|
144
|
+
}): Promise<Comment>;
|
|
145
|
+
}
|
|
146
|
+
export declare class VersionsApi {
|
|
147
|
+
private readonly core;
|
|
148
|
+
constructor(core: CoreClient);
|
|
149
|
+
list(knowledgeId: string): Promise<KnowledgeVersion[]>;
|
|
150
|
+
}
|
|
151
|
+
export declare class AmendApi {
|
|
152
|
+
private readonly core;
|
|
153
|
+
constructor(core: CoreClient);
|
|
154
|
+
request(knowledgeId: string, instruction: string, amendRequestId?: string): Promise<AmendEnvelope>;
|
|
155
|
+
status(knowledgeId: string, amendRequestId: string): Promise<AmendStatus>;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=extras.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extras.d.ts","sourceRoot":"","sources":["../../src/resources/extras.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAMlD,eA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---- schemas (tolerant — these endpoints vary across deployments) ----
|
|
5
|
+
// Live entity endpoints return `type`/`description` as null, so allow null.
|
|
6
|
+
export const EntitySchema = z
|
|
7
|
+
.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
type: optStr,
|
|
11
|
+
description: optStr,
|
|
12
|
+
knowledgeCount: z.number().optional(),
|
|
13
|
+
})
|
|
14
|
+
.passthrough();
|
|
15
|
+
export const TopicSchema = z
|
|
16
|
+
.object({ id: z.string(), name: z.string(), description: z.string().nullable().optional(), itemCount: z.number().optional() })
|
|
17
|
+
.passthrough();
|
|
18
|
+
// The live comments endpoint stores the text in `content` (not `body`); normalize
|
|
19
|
+
// to `body` so callers/render code can rely on it.
|
|
20
|
+
export const CommentSchema = z.preprocess((raw) => {
|
|
21
|
+
if (!raw || typeof raw !== 'object')
|
|
22
|
+
return raw;
|
|
23
|
+
const o = raw;
|
|
24
|
+
return { ...o, body: o.body ?? o.content };
|
|
25
|
+
}, z
|
|
26
|
+
.object({
|
|
27
|
+
id: z.string(),
|
|
28
|
+
body: z.string().optional(),
|
|
29
|
+
content: z.string().optional(),
|
|
30
|
+
authorName: z.string().nullable().optional(),
|
|
31
|
+
createdAt: z.string().optional(),
|
|
32
|
+
parentCommentId: z.string().nullable().optional(),
|
|
33
|
+
})
|
|
34
|
+
.passthrough());
|
|
35
|
+
export const VersionSchema = z
|
|
36
|
+
.object({ id: z.string().optional(), version: z.number().optional(), createdAt: z.string().optional(), summary: z.string().nullable().optional() })
|
|
37
|
+
.passthrough();
|
|
38
|
+
export const StatsSchema = z.record(z.string(), z.unknown());
|
|
39
|
+
export const AmendEnvelopeSchema = z
|
|
40
|
+
.object({ amendRequestId: z.string(), status: z.string(), pollUrl: z.string().optional() })
|
|
41
|
+
.passthrough();
|
|
42
|
+
export const AmendStatusSchema = z
|
|
43
|
+
.object({ status: z.string(), amendRequestId: z.string().optional(), error: z.string().nullable().optional() })
|
|
44
|
+
.passthrough();
|
|
45
|
+
// ---- resource modules ----
|
|
46
|
+
export class EntitiesApi {
|
|
47
|
+
core;
|
|
48
|
+
constructor(core) {
|
|
49
|
+
this.core = core;
|
|
50
|
+
}
|
|
51
|
+
find(q = {}) {
|
|
52
|
+
// Live API splits entities into separate collections (no aggregate index route).
|
|
53
|
+
const map = {
|
|
54
|
+
person: 'persons',
|
|
55
|
+
persons: 'persons',
|
|
56
|
+
location: 'locations',
|
|
57
|
+
locations: 'locations',
|
|
58
|
+
event: 'events',
|
|
59
|
+
events: 'events',
|
|
60
|
+
};
|
|
61
|
+
const collection = map[(q.type ?? 'persons').toLowerCase()] ?? 'persons';
|
|
62
|
+
return this.core.request({
|
|
63
|
+
method: 'GET',
|
|
64
|
+
path: `/api/v1/entities/${collection}`,
|
|
65
|
+
query: { pageSize: q.limit ?? 50, search: q.q },
|
|
66
|
+
schema: z.array(EntitySchema),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export class TopicsApi {
|
|
71
|
+
core;
|
|
72
|
+
constructor(core) {
|
|
73
|
+
this.core = core;
|
|
74
|
+
}
|
|
75
|
+
list(limit = 50) {
|
|
76
|
+
return this.core.request({ method: 'GET', path: '/api/v1/topics', query: { limit }, schema: z.array(TopicSchema) });
|
|
77
|
+
}
|
|
78
|
+
get(id) {
|
|
79
|
+
return this.core.request({ method: 'GET', path: `/api/v1/topics/${encodeURIComponent(id)}`, schema: TopicSchema });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export class StatsApi {
|
|
83
|
+
core;
|
|
84
|
+
constructor(core) {
|
|
85
|
+
this.core = core;
|
|
86
|
+
}
|
|
87
|
+
get() {
|
|
88
|
+
return this.core.request({ method: 'GET', path: '/api/v1/knowledge/statistics', schema: StatsSchema });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export class CommentsApi {
|
|
92
|
+
core;
|
|
93
|
+
constructor(core) {
|
|
94
|
+
this.core = core;
|
|
95
|
+
}
|
|
96
|
+
async list(knowledgeId) {
|
|
97
|
+
// Live endpoint returns a paged object ({items,page,…}); normalize to an array.
|
|
98
|
+
const data = await this.core.request({
|
|
99
|
+
method: 'GET',
|
|
100
|
+
path: `/api/v1/knowledge/${encodeURIComponent(knowledgeId)}/comments`,
|
|
101
|
+
schema: pagedSchema(CommentSchema),
|
|
102
|
+
});
|
|
103
|
+
return toArray(data);
|
|
104
|
+
}
|
|
105
|
+
add(knowledgeId, body) {
|
|
106
|
+
return this.core.request({
|
|
107
|
+
method: 'POST',
|
|
108
|
+
path: `/api/v1/knowledge/${encodeURIComponent(knowledgeId)}/comments`,
|
|
109
|
+
body,
|
|
110
|
+
schema: CommentSchema,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export class VersionsApi {
|
|
115
|
+
core;
|
|
116
|
+
constructor(core) {
|
|
117
|
+
this.core = core;
|
|
118
|
+
}
|
|
119
|
+
async list(knowledgeId) {
|
|
120
|
+
// Live endpoint returns a paged object ({items,page,…}); normalize to an array.
|
|
121
|
+
const data = await this.core.request({
|
|
122
|
+
method: 'GET',
|
|
123
|
+
path: `/api/v1/knowledge/${encodeURIComponent(knowledgeId)}/versions`,
|
|
124
|
+
schema: pagedSchema(VersionSchema),
|
|
125
|
+
});
|
|
126
|
+
return toArray(data);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export class AmendApi {
|
|
130
|
+
core;
|
|
131
|
+
constructor(core) {
|
|
132
|
+
this.core = core;
|
|
133
|
+
}
|
|
134
|
+
request(knowledgeId, instruction, amendRequestId) {
|
|
135
|
+
return this.core.request({
|
|
136
|
+
method: 'POST',
|
|
137
|
+
path: `/api/v1/knowledge/${encodeURIComponent(knowledgeId)}/amend-requests`,
|
|
138
|
+
body: { instruction, amendRequestId },
|
|
139
|
+
schema: AmendEnvelopeSchema,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
status(knowledgeId, amendRequestId) {
|
|
143
|
+
return this.core.request({
|
|
144
|
+
method: 'GET',
|
|
145
|
+
path: `/api/v1/knowledge/${encodeURIComponent(knowledgeId)}/amend-requests/${encodeURIComponent(amendRequestId)}`,
|
|
146
|
+
schema: AmendStatusSchema,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=extras.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extras.js","sourceRoot":"","sources":["../../src/resources/extras.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,yEAAyE;AACzE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,WAAW,EAAE,CAAC;AACjB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;KAC7H,WAAW,EAAE,CAAC;AACjB,kFAAkF;AAClF,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,CACvC,CAAC,GAAG,EAAE,EAAE;IACN,IAAI,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AAC,EAAE;YACjH,MAAM,EAAE,iBAAiB;SAC1B,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AuthApi } from './auth.js';
|
|
2
|
+
export { KnowledgeApi } from './knowledge.js';
|
|
3
|
+
export { VaultsApi } from './vaults.js';
|
|
4
|
+
export { SearchApi, type SearchQuery } from './search.js';
|
|
5
|
+
export { AskApi, type AskRequest } from './ask.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAmB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CoreClient } from '../contracts.js';
|
|
2
|
+
import type { CreateKnowledgeRequest, UpdateKnowledgeRequest, KnowledgeDetail, KnowledgeSummary, KnowledgeStatus, KnowledgeListQuery, Paged } from '@knowzai/types';
|
|
3
|
+
export declare class KnowledgeApi {
|
|
4
|
+
private readonly core;
|
|
5
|
+
constructor(core: CoreClient);
|
|
6
|
+
list(q?: KnowledgeListQuery): Promise<Paged<KnowledgeSummary>>;
|
|
7
|
+
create(req: CreateKnowledgeRequest): Promise<KnowledgeDetail>;
|
|
8
|
+
get(id: string): Promise<KnowledgeDetail>;
|
|
9
|
+
update(id: string, req: UpdateKnowledgeRequest): Promise<KnowledgeDetail>;
|
|
10
|
+
remove(id: string): Promise<void>;
|
|
11
|
+
status(id: string): Promise<KnowledgeStatus>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/resources/knowledge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,KAAK,EACN,MAAM,gBAAgB,CAAC;AAWxB,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEvC,IAAI,CAAC,CAAC,GAAE,kBAAuB,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAkBlE,MAAM,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAwBnE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAQnC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAsBzE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAO7C"}
|