const annotationIds = [{ id: 1 }, { id: 2 }];
await client.annotations.delete(annotationIds);
const annotatedFileId = 1;
const limitOne = await client.annotations.list({
limit: 1,
filter: {
annotatedResourceType: 'file',
annotatedResourceIds: [{ id: 1 }],
},
});
const annotationIds = [{ id: 1 }, { id: 2 }];
const response = await client.annotations.retrieve(annotationIds);
const assetQueryData = {
limit: -1,
filter: {
annotatedResourceType: 'file' as const,
annotationType: 'images.AssetLink',
data: {
assetRef: { id: 123 }
}
}
};
const resourceIdsResponse = client.annotations.reverseLookup(assetQueryData);
const data = {
pageNumber: 7,
textRegion: { xMin: 0, xMax: 0.1, yMin: 0, yMax: 0.2 },
extractedText: 'i am your father',
};
const partial = {
annotatedResourceType: 'file' as const,
annotatedResourceId: 1,
annotationType: 'documents.ExtractedText',
creatingApp: 'integration-tests',
creatingAppVersion: '0.0.1',
creatingUser: 'integration-tests',
data,
};
const created = await client.annotations.suggest([partial]);
const data = {
pageNumber: 8,
fileRef: { externalId: 'def_file_changed' },
textRegion: { xMin: 0, xMax: 0.1, yMin: 0, yMax: 0.2 },
};
const changes = [
{
id: 1,
update: {
data: {
set: data,
},
},
},
];
const updatedResp = await client.annotations.update(changes);
Create annotations