File tree Expand file tree Collapse file tree 5 files changed +285
-15
lines changed Expand file tree Collapse file tree 5 files changed +285
-15
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @team-plain/typescript-sdk ' : minor
3+ ---
4+
5+ Add support for indexing documents into Plain.
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ import {
4141 DeleteThreadFieldDocument ,
4242 DeleteWebhookTargetDocument ,
4343 type EmailPartsFragment ,
44+ IndexDocumentDocument ,
45+ type IndexedDocumentPartsFragment ,
4446 type LabelPartsFragment ,
4547 LabelTypeDocument ,
4648 type LabelTypePartsFragment ,
@@ -1171,4 +1173,17 @@ export class PlainClient {
11711173
11721174 return unwrapData ( res , ( q ) => nonNullable ( q . createLabelType . labelType ) ) ;
11731175 }
1176+
1177+ async indexDocument (
1178+ input : VariablesOf < typeof IndexDocumentDocument > [ 'input' ]
1179+ ) : SDKResult < IndexedDocumentPartsFragment > {
1180+ const res = await request ( this . #ctx, {
1181+ query : IndexDocumentDocument ,
1182+ variables : {
1183+ input,
1184+ } ,
1185+ } ) ;
1186+
1187+ return unwrapData ( res , ( q ) => nonNullable ( q . createIndexedDocument . indexedDocument ) ) ;
1188+ }
11741189}
Original file line number Diff line number Diff line change 1+ fragment IndexedDocumentParts on IndexedDocument {
2+ __typename
3+ id
4+ url
5+ createdAt {
6+ ... DateTimeParts
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ mutation indexDocument ($input :CreateIndexedDocumentInput ! ) {
2+ createIndexedDocument (input : $input ) {
3+ indexedDocument {
4+ ... IndexedDocumentParts
5+ }
6+ error {
7+ ... MutationErrorParts
8+ }
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments