@semiont/api-client 0.2.32 → 0.2.33-build.74

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/README.md CHANGED
@@ -6,18 +6,18 @@
6
6
  [![npm downloads](https://img.shields.io/npm/dm/@semiont/api-client.svg)](https://www.npmjs.com/package/@semiont/api-client)
7
7
  [![License](https://img.shields.io/npm/l/@semiont/api-client.svg)](https://github.com/The-AI-Alliance/semiont/blob/main/LICENSE)
8
8
 
9
- TypeScript SDK for [Semiont](https://github.com/The-AI-Alliance/semiont) - a knowledge management system for semantic annotations, AI-powered entity detection, and collaborative document analysis.
9
+ TypeScript SDK for [Semiont](https://github.com/The-AI-Alliance/semiont) - a knowledge management system for semantic annotations, AI-powered annotation detection, and collaborative document analysis.
10
10
 
11
11
  ## What is Semiont?
12
12
 
13
13
  Semiont lets you:
14
14
 
15
- - **Store and manage documents** (text, markdown, code)
15
+ - **Store and manage documents** (text, markdown, images, PDFs)
16
16
  - **Create semantic annotations** using W3C Web Annotation standard
17
17
  - **Link and reference** between documents
18
18
  - **Track provenance** with event sourcing
19
19
  - **Collaborate in real-time** via SSE streams
20
- - **Detect entities** using AI (people, organizations, concepts)
20
+ - **Detect annotations** using AI for text formats (highlights, assessments, comments, tags, entity references)
21
21
  - **Retrieve context** for LLMs via graph traversal
22
22
  - **Generate new documents** from annotations with AI
23
23
 
@@ -59,13 +59,13 @@ const { resource } = await client.createResource({
59
59
 
60
60
  console.log('Created resource:', resource['@id']);
61
61
 
62
- // Detect entities with AI
62
+ // Detect annotations with AI (text/markdown formats only)
63
63
  const stream = client.sse.detectAnnotations(resourceUri(resource['@id']), {
64
64
  entityTypes: ['Animal', 'Color']
65
65
  });
66
66
 
67
67
  stream.onProgress((p) => console.log(`Scanning: ${p.currentEntityType}`));
68
- stream.onComplete((result) => console.log(`Found ${result.foundCount} entities`));
68
+ stream.onComplete((result) => console.log(`Found ${result.foundCount} annotations`));
69
69
 
70
70
  // Get annotations
71
71
  const annotations = await client.getResourceAnnotations(resourceUri(resource['@id']));
@@ -2431,7 +2431,7 @@ interface components {
2431
2431
  /** @description IRI of the resource being annotated */
2432
2432
  source: string;
2433
2433
  /** @description Optional selector to identify a specific segment of the source resource */
2434
- selector?: components["schemas"]["TextPositionSelector"] | components["schemas"]["TextQuoteSelector"] | components["schemas"]["SvgSelector"] | (components["schemas"]["TextPositionSelector"] | components["schemas"]["TextQuoteSelector"] | components["schemas"]["SvgSelector"])[];
2434
+ selector?: components["schemas"]["TextPositionSelector"] | components["schemas"]["TextQuoteSelector"] | components["schemas"]["SvgSelector"] | components["schemas"]["FragmentSelector"] | (components["schemas"]["TextPositionSelector"] | components["schemas"]["TextQuoteSelector"] | components["schemas"]["SvgSelector"] | components["schemas"]["FragmentSelector"])[];
2435
2435
  };
2436
2436
  AsyncJobResponse: {
2437
2437
  jobId: string;
@@ -2494,6 +2494,7 @@ interface components {
2494
2494
  * @example text/markdown; charset=windows-1252
2495
2495
  * @example image/png
2496
2496
  * @example image/jpeg
2497
+ * @example application/pdf
2497
2498
  */
2498
2499
  ContentFormat: string;
2499
2500
  ContextualSummaryResponse: {
@@ -2517,13 +2518,13 @@ interface components {
2517
2518
  exact: string;
2518
2519
  prefix?: string;
2519
2520
  suffix?: string;
2520
- } | components["schemas"]["SvgSelector"] | (components["schemas"]["TextPositionSelector"] | {
2521
+ } | components["schemas"]["SvgSelector"] | components["schemas"]["FragmentSelector"] | (components["schemas"]["TextPositionSelector"] | {
2521
2522
  /** @enum {string} */
2522
2523
  type: "TextQuoteSelector";
2523
2524
  exact: string;
2524
2525
  prefix?: string;
2525
2526
  suffix?: string;
2526
- } | components["schemas"]["SvgSelector"])[];
2527
+ } | components["schemas"]["SvgSelector"] | components["schemas"]["FragmentSelector"])[];
2527
2528
  };
2528
2529
  body: unknown[] | components["schemas"]["AnnotationBody"] | components["schemas"]["AnnotationBody"][];
2529
2530
  };
@@ -3138,6 +3139,22 @@ interface components {
3138
3139
  /** @description SVG markup defining the region (must include xmlns attribute) */
3139
3140
  value: string;
3140
3141
  };
3142
+ /** @description W3C Web Annotation FragmentSelector for media fragment identifiers (RFC 3778 for PDFs) */
3143
+ FragmentSelector: {
3144
+ /** @enum {string} */
3145
+ type: "FragmentSelector";
3146
+ /**
3147
+ * @description Media fragment identifier (e.g., 'page=1&viewrect=100,200,50,30' for PDF)
3148
+ * @example page=1&viewrect=100,200,50,30
3149
+ * @example page=5&viewrect=250,400,100,75
3150
+ */
3151
+ value: string;
3152
+ /**
3153
+ * @description URI identifying the fragment syntax specification
3154
+ * @example http://tools.ietf.org/rfc/rfc3778
3155
+ */
3156
+ conformsTo?: string;
3157
+ };
3141
3158
  /** @description Context information used for AI generation. Includes source document excerpts and metadata. */
3142
3159
  GenerationContext: {
3143
3160
  /** @description Text context from the source document */
@@ -3256,7 +3273,8 @@ type ReferenceAnnotation = Annotation$1;
3256
3273
  type TextPositionSelector = components['schemas']['TextPositionSelector'];
3257
3274
  type TextQuoteSelector = components['schemas']['TextQuoteSelector'];
3258
3275
  type SvgSelector = components['schemas']['SvgSelector'];
3259
- type Selector = TextPositionSelector | TextQuoteSelector | SvgSelector;
3276
+ type FragmentSelector = components['schemas']['FragmentSelector'];
3277
+ type Selector = TextPositionSelector | TextQuoteSelector | SvgSelector | FragmentSelector;
3260
3278
 
3261
3279
  /**
3262
3280
  * Get the source from an annotation body (null if stub)
@@ -3291,6 +3309,10 @@ declare function getTargetSelector(target: Annotation$1['target']): {
3291
3309
  } | {
3292
3310
  type: "SvgSelector";
3293
3311
  value: string;
3312
+ } | {
3313
+ type: "FragmentSelector";
3314
+ value: string;
3315
+ conformsTo?: string;
3294
3316
  } | ({
3295
3317
  type: "TextPositionSelector";
3296
3318
  start: number;
@@ -3303,6 +3325,10 @@ declare function getTargetSelector(target: Annotation$1['target']): {
3303
3325
  } | {
3304
3326
  type: "SvgSelector";
3305
3327
  value: string;
3328
+ } | {
3329
+ type: "FragmentSelector";
3330
+ value: string;
3331
+ conformsTo?: string;
3306
3332
  })[] | undefined;
3307
3333
  /**
3308
3334
  * Check if target has a selector
@@ -3383,6 +3409,12 @@ declare function getTextQuoteSelector(selector: Selector | Selector[]): TextQuot
3383
3409
  * Returns the first SvgSelector found, or null if none exists.
3384
3410
  */
3385
3411
  declare function getSvgSelector(selector: Selector | Selector[] | undefined): SvgSelector | null;
3412
+ /**
3413
+ * Get FragmentSelector from a selector (single or array)
3414
+ *
3415
+ * Returns the first FragmentSelector found, or null if none exists.
3416
+ */
3417
+ declare function getFragmentSelector(selector: Selector | Selector[] | undefined): FragmentSelector | null;
3386
3418
  /**
3387
3419
  * Validate SVG markup for W3C compliance
3388
3420
  *
@@ -3868,4 +3900,4 @@ declare function validateData<T>(schema: {
3868
3900
  */
3869
3901
  declare function isValidEmail(email: string): boolean;
3870
3902
 
3871
- export { type $defs as $, type AccessToken as A, type BaseUrl as B, type ContentFormat as C, getExactText as D, type EntityType as E, getAnnotationExactText as F, type GoogleCredential as G, getPrimarySelector as H, getTextPositionSelector as I, type JobId as J, getTextQuoteSelector as K, getSvgSelector as L, type Motivation as M, validateSvgMarkup as N, extractBoundingBox as O, type StoredEvent as P, type EventMetadata as Q, type ResourceUri as R, type SearchQuery as S, type TextPositionSelector as T, type UserDID as U, type ResourceEventType as V, getAnnotationUriFromEvent as W, isEventRelatedToAnnotation as X, isResourceEvent as Y, formatEventType as Z, getEventEmoji as _, type AnnotationUri as a, resourceAnnotationUri as a$, formatRelativeTime as a0, getEventDisplayContent as a1, getEventEntityTypes as a2, type ResourceCreationDetails as a3, getResourceCreationDetails as a4, type TextPosition as a5, findTextWithContext as a6, verifyPosition as a7, type LocaleInfo as a8, LOCALES as a9, extractContext as aA, type ValidatedAnnotation as aB, validateAndCorrectOffsets as aC, extractCharset as aD, decodeWithCharset as aE, type ValidationSuccess as aF, type ValidationFailure as aG, type ValidationResult as aH, JWTTokenSchema as aI, validateData as aJ, isValidEmail as aK, type AuthCode as aL, type MCPToken as aM, email as aN, authCode as aO, googleCredential as aP, accessToken as aQ, refreshToken as aR, mcpToken as aS, cloneToken as aT, jobId as aU, userDID as aV, entityType as aW, searchQuery as aX, baseUrl as aY, resourceUri as aZ, annotationUri as a_, getLocaleInfo as aa, getLocaleNativeName as ab, getLocaleEnglishName as ac, formatLocaleDisplay as ad, getAllLocaleCodes as ae, getResourceId as af, getPrimaryRepresentation as ag, getPrimaryMediaType as ah, getChecksum as ai, getLanguage as aj, getStorageUri as ak, getCreator as al, getDerivedFrom as am, isArchived as an, getResourceEntityTypes as ao, isDraft as ap, getNodeEncoding as aq, decodeRepresentation as ar, type Point as as, type BoundingBox as at, createRectangleSvg as au, createPolygonSvg as av, createCircleSvg as aw, parseSvgSelector as ax, normalizeCoordinates as ay, scaleSvgToNative as az, type Email as b, type ResourceEvent as b0, type components as c, type RefreshToken as d, type CloneToken as e, type ResourceAnnotationUri as f, type TextQuoteSelector as g, type SvgSelector as h, type Selector as i, getBodySource as j, getBodyType as k, isBodyResolved as l, getTargetSource as m, getTargetSelector as n, type operations as o, type paths as p, hasTargetSelector as q, isHighlight as r, isReference as s, isAssessment as t, isComment as u, isTag as v, type webhooks as w, getCommentText as x, isStubReference as y, isResolvedReference as z };
3903
+ export { type $defs as $, type AccessToken as A, type BaseUrl as B, type ContentFormat as C, getExactText as D, type EntityType as E, type FragmentSelector as F, type GoogleCredential as G, getAnnotationExactText as H, getPrimarySelector as I, type JobId as J, getTextPositionSelector as K, getTextQuoteSelector as L, type Motivation as M, getSvgSelector as N, getFragmentSelector as O, validateSvgMarkup as P, extractBoundingBox as Q, type ResourceUri as R, type SearchQuery as S, type TextPositionSelector as T, type UserDID as U, type StoredEvent as V, type EventMetadata as W, type ResourceEventType as X, getAnnotationUriFromEvent as Y, isEventRelatedToAnnotation as Z, isResourceEvent as _, type AnnotationUri as a, resourceUri as a$, formatEventType as a0, getEventEmoji as a1, formatRelativeTime as a2, getEventDisplayContent as a3, getEventEntityTypes as a4, type ResourceCreationDetails as a5, getResourceCreationDetails as a6, type TextPosition as a7, findTextWithContext as a8, verifyPosition as a9, normalizeCoordinates as aA, scaleSvgToNative as aB, extractContext as aC, type ValidatedAnnotation as aD, validateAndCorrectOffsets as aE, extractCharset as aF, decodeWithCharset as aG, type ValidationSuccess as aH, type ValidationFailure as aI, type ValidationResult as aJ, JWTTokenSchema as aK, validateData as aL, isValidEmail as aM, type AuthCode as aN, type MCPToken as aO, email as aP, authCode as aQ, googleCredential as aR, accessToken as aS, refreshToken as aT, mcpToken as aU, cloneToken as aV, jobId as aW, userDID as aX, entityType as aY, searchQuery as aZ, baseUrl as a_, type LocaleInfo as aa, LOCALES as ab, getLocaleInfo as ac, getLocaleNativeName as ad, getLocaleEnglishName as ae, formatLocaleDisplay as af, getAllLocaleCodes as ag, getResourceId as ah, getPrimaryRepresentation as ai, getPrimaryMediaType as aj, getChecksum as ak, getLanguage as al, getStorageUri as am, getCreator as an, getDerivedFrom as ao, isArchived as ap, getResourceEntityTypes as aq, isDraft as ar, getNodeEncoding as as, decodeRepresentation as at, type Point as au, type BoundingBox as av, createRectangleSvg as aw, createPolygonSvg as ax, createCircleSvg as ay, parseSvgSelector as az, type Email as b, annotationUri as b0, resourceAnnotationUri as b1, type ResourceEvent as b2, type components as c, type RefreshToken as d, type CloneToken as e, type ResourceAnnotationUri as f, type TextQuoteSelector as g, type SvgSelector as h, type Selector as i, getBodySource as j, getBodyType as k, isBodyResolved as l, getTargetSource as m, getTargetSelector as n, type operations as o, type paths as p, hasTargetSelector as q, isHighlight as r, isReference as s, isAssessment as t, isComment as u, isTag as v, type webhooks as w, getCommentText as x, isStubReference as y, isResolvedReference as z };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BaseUrl, A as AccessToken, R as ResourceUri, E as EntityType, a as AnnotationUri, c as components, b as Email, p as paths, d as RefreshToken, G as GoogleCredential, C as ContentFormat, S as SearchQuery, e as CloneToken, f as ResourceAnnotationUri, M as Motivation, U as UserDID, J as JobId } from './index-C7xLvxng.js';
2
- export { $ as $defs, aL as AuthCode, at as BoundingBox, Q as EventMetadata, aI as JWTTokenSchema, a9 as LOCALES, a8 as LocaleInfo, aM as MCPToken, as as Point, a3 as ResourceCreationDetails, V as ResourceEventType, i as Selector, P as StoredEvent, h as SvgSelector, a5 as TextPosition, T as TextPositionSelector, g as TextQuoteSelector, aB as ValidatedAnnotation, aG as ValidationFailure, aH as ValidationResult, aF as ValidationSuccess, aQ as accessToken, a_ as annotationUri, aO as authCode, aY as baseUrl, aT as cloneToken, aw as createCircleSvg, av as createPolygonSvg, au as createRectangleSvg, ar as decodeRepresentation, aE as decodeWithCharset, aN as email, aW as entityType, O as extractBoundingBox, aD as extractCharset, aA as extractContext, a6 as findTextWithContext, Z as formatEventType, ad as formatLocaleDisplay, a0 as formatRelativeTime, ae as getAllLocaleCodes, F as getAnnotationExactText, W as getAnnotationUriFromEvent, j as getBodySource, k as getBodyType, ai as getChecksum, x as getCommentText, al as getCreator, am as getDerivedFrom, a1 as getEventDisplayContent, _ as getEventEmoji, a2 as getEventEntityTypes, D as getExactText, aj as getLanguage, ac as getLocaleEnglishName, aa as getLocaleInfo, ab as getLocaleNativeName, aq as getNodeEncoding, ah as getPrimaryMediaType, ag as getPrimaryRepresentation, H as getPrimarySelector, a4 as getResourceCreationDetails, ao as getResourceEntityTypes, af as getResourceId, ak as getStorageUri, L as getSvgSelector, n as getTargetSelector, m as getTargetSource, I as getTextPositionSelector, K as getTextQuoteSelector, aP as googleCredential, q as hasTargetSelector, an as isArchived, t as isAssessment, l as isBodyResolved, u as isComment, ap as isDraft, X as isEventRelatedToAnnotation, r as isHighlight, s as isReference, z as isResolvedReference, Y as isResourceEvent, y as isStubReference, v as isTag, aK as isValidEmail, aU as jobId, aS as mcpToken, ay as normalizeCoordinates, o as operations, ax as parseSvgSelector, aR as refreshToken, a$ as resourceAnnotationUri, aZ as resourceUri, az as scaleSvgToNative, aX as searchQuery, aV as userDID, aC as validateAndCorrectOffsets, aJ as validateData, N as validateSvgMarkup, a7 as verifyPosition, w as webhooks } from './index-C7xLvxng.js';
1
+ import { B as BaseUrl, A as AccessToken, R as ResourceUri, E as EntityType, a as AnnotationUri, c as components, b as Email, p as paths, d as RefreshToken, G as GoogleCredential, C as ContentFormat, S as SearchQuery, e as CloneToken, f as ResourceAnnotationUri, M as Motivation, U as UserDID, J as JobId } from './index-BjpP_lGG.js';
2
+ export { $ as $defs, aN as AuthCode, av as BoundingBox, W as EventMetadata, F as FragmentSelector, aK as JWTTokenSchema, ab as LOCALES, aa as LocaleInfo, aO as MCPToken, au as Point, a5 as ResourceCreationDetails, X as ResourceEventType, i as Selector, V as StoredEvent, h as SvgSelector, a7 as TextPosition, T as TextPositionSelector, g as TextQuoteSelector, aD as ValidatedAnnotation, aI as ValidationFailure, aJ as ValidationResult, aH as ValidationSuccess, aS as accessToken, b0 as annotationUri, aQ as authCode, a_ as baseUrl, aV as cloneToken, ay as createCircleSvg, ax as createPolygonSvg, aw as createRectangleSvg, at as decodeRepresentation, aG as decodeWithCharset, aP as email, aY as entityType, Q as extractBoundingBox, aF as extractCharset, aC as extractContext, a8 as findTextWithContext, a0 as formatEventType, af as formatLocaleDisplay, a2 as formatRelativeTime, ag as getAllLocaleCodes, H as getAnnotationExactText, Y as getAnnotationUriFromEvent, j as getBodySource, k as getBodyType, ak as getChecksum, x as getCommentText, an as getCreator, ao as getDerivedFrom, a3 as getEventDisplayContent, a1 as getEventEmoji, a4 as getEventEntityTypes, D as getExactText, O as getFragmentSelector, al as getLanguage, ae as getLocaleEnglishName, ac as getLocaleInfo, ad as getLocaleNativeName, as as getNodeEncoding, aj as getPrimaryMediaType, ai as getPrimaryRepresentation, I as getPrimarySelector, a6 as getResourceCreationDetails, aq as getResourceEntityTypes, ah as getResourceId, am as getStorageUri, N as getSvgSelector, n as getTargetSelector, m as getTargetSource, K as getTextPositionSelector, L as getTextQuoteSelector, aR as googleCredential, q as hasTargetSelector, ap as isArchived, t as isAssessment, l as isBodyResolved, u as isComment, ar as isDraft, Z as isEventRelatedToAnnotation, r as isHighlight, s as isReference, z as isResolvedReference, _ as isResourceEvent, y as isStubReference, v as isTag, aM as isValidEmail, aW as jobId, aU as mcpToken, aA as normalizeCoordinates, o as operations, az as parseSvgSelector, aT as refreshToken, b1 as resourceAnnotationUri, a$ as resourceUri, aB as scaleSvgToNative, aZ as searchQuery, aX as userDID, aE as validateAndCorrectOffsets, aL as validateData, P as validateSvgMarkup, a9 as verifyPosition, w as webhooks } from './index-BjpP_lGG.js';
3
3
 
4
4
  /**
5
5
  * TypeScript types for Server-Sent Events (SSE) streaming
@@ -916,6 +916,7 @@ declare class SemiontApiClient {
916
916
  * - text/markdown
917
917
  * - image/png
918
918
  * - image/jpeg
919
+ * - application/pdf
919
920
  */
920
921
  /**
921
922
  * Map MIME type to file extension
@@ -929,8 +930,18 @@ declare function isImageMimeType(mimeType: string): boolean;
929
930
  * Detect if MIME type is text-based (plain or markdown only for now)
930
931
  */
931
932
  declare function isTextMimeType(mimeType: string): boolean;
933
+ /**
934
+ * Detect if MIME type is PDF
935
+ */
936
+ declare function isPdfMimeType(mimeType: string): boolean;
932
937
  /**
933
938
  * Get category for MIME type (for routing to appropriate viewer)
939
+ *
940
+ * Categories represent annotation models, not file formats:
941
+ * - 'text': Text-based annotations (TextPositionSelector, TextQuoteSelector)
942
+ * - 'image': Spatial coordinate annotations (SvgSelector, FragmentSelector)
943
+ *
944
+ * PDFs use spatial coordinates for annotations, so they belong to 'image' category.
934
945
  */
935
946
  type MimeCategory = 'text' | 'image' | 'unsupported';
936
947
  declare function getMimeCategory(mimeType: string): MimeCategory;
@@ -969,4 +980,4 @@ declare function getMimeCategory(mimeType: string): MimeCategory;
969
980
  type GenerationContext = components['schemas']['GenerationContext'];
970
981
  type AnnotationLLMContextResponse = components['schemas']['AnnotationLLMContextResponse'];
971
982
 
972
- export { APIError, AccessToken, type AnnotationLLMContextResponse, AnnotationUri, BaseUrl, CloneToken, ContentFormat, type DetectAnnotationsStreamRequest, type DetectionProgress, Email, EntityType, type GenerateResourceStreamRequest, type GenerationContext, type GenerationProgress, GoogleCredential, JobId, type Logger, type MimeCategory, Motivation, RefreshToken, ResourceAnnotationUri, type ResourceEvent, ResourceUri, SSEClient, type SSEClientConfig, type SSEStream, SearchQuery, SemiontApiClient, type SemiontApiClientConfig, UserDID, components, getExtensionForMimeType, getMimeCategory, isImageMimeType, isTextMimeType, paths };
983
+ export { APIError, AccessToken, type AnnotationLLMContextResponse, AnnotationUri, BaseUrl, CloneToken, ContentFormat, type DetectAnnotationsStreamRequest, type DetectionProgress, Email, EntityType, type GenerateResourceStreamRequest, type GenerationContext, type GenerationProgress, GoogleCredential, JobId, type Logger, type MimeCategory, Motivation, RefreshToken, ResourceAnnotationUri, type ResourceEvent, ResourceUri, SSEClient, type SSEClientConfig, type SSEStream, SearchQuery, SemiontApiClient, type SemiontApiClientConfig, UserDID, components, getExtensionForMimeType, getMimeCategory, isImageMimeType, isPdfMimeType, isTextMimeType, paths };
package/dist/index.js CHANGED
@@ -1215,6 +1215,13 @@ function getSvgSelector(selector) {
1215
1215
  if (!found) return null;
1216
1216
  return found.type === "SvgSelector" ? found : null;
1217
1217
  }
1218
+ function getFragmentSelector(selector) {
1219
+ if (!selector) return null;
1220
+ const selectors = Array.isArray(selector) ? selector : [selector];
1221
+ const found = selectors.find((s) => s.type === "FragmentSelector");
1222
+ if (!found) return null;
1223
+ return found.type === "FragmentSelector" ? found : null;
1224
+ }
1218
1225
  function validateSvgMarkup(svg) {
1219
1226
  if (!svg.includes('xmlns="http://www.w3.org/2000/svg"')) {
1220
1227
  return 'SVG must include xmlns="http://www.w3.org/2000/svg" attribute';
@@ -2013,7 +2020,8 @@ function getExtensionForMimeType(mimeType) {
2013
2020
  "text/plain": "txt",
2014
2021
  "text/markdown": "md",
2015
2022
  "image/png": "png",
2016
- "image/jpeg": "jpg"
2023
+ "image/jpeg": "jpg",
2024
+ "application/pdf": "pdf"
2017
2025
  };
2018
2026
  return map[mimeType] || "dat";
2019
2027
  }
@@ -2023,16 +2031,19 @@ function isImageMimeType(mimeType) {
2023
2031
  function isTextMimeType(mimeType) {
2024
2032
  return mimeType === "text/plain" || mimeType === "text/markdown";
2025
2033
  }
2034
+ function isPdfMimeType(mimeType) {
2035
+ return mimeType === "application/pdf";
2036
+ }
2026
2037
  function getMimeCategory(mimeType) {
2027
2038
  if (isTextMimeType(mimeType)) {
2028
2039
  return "text";
2029
2040
  }
2030
- if (isImageMimeType(mimeType)) {
2041
+ if (isImageMimeType(mimeType) || isPdfMimeType(mimeType)) {
2031
2042
  return "image";
2032
2043
  }
2033
2044
  return "unsupported";
2034
2045
  }
2035
2046
 
2036
- export { APIError, JWTTokenSchema, LOCALES, SSEClient, SemiontApiClient, accessToken, annotationUri, authCode, baseUrl, cloneToken, createCircleSvg, createPolygonSvg, createRectangleSvg, decodeRepresentation, decodeWithCharset, email, entityType, extractBoundingBox, extractCharset, extractContext, findTextWithContext, formatEventType, formatLocaleDisplay, formatRelativeTime, getAllLocaleCodes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getEventDisplayContent, getEventEmoji, getEventEntityTypes, getExactText, getExtensionForMimeType, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getMimeCategory, getNodeEncoding, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceCreationDetails, getResourceEntityTypes, getResourceId, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isArchived, isAssessment, isBodyResolved, isComment, isDraft, isEventRelatedToAnnotation, isHighlight, isImageMimeType, isReference, isResolvedReference, isResourceEvent, isStubReference, isTag, isTextMimeType, isValidEmail, jobId, mcpToken, normalizeCoordinates, parseSvgSelector, refreshToken, resourceAnnotationUri, resourceUri, scaleSvgToNative, searchQuery, userDID, validateAndCorrectOffsets, validateData, validateSvgMarkup, verifyPosition };
2047
+ export { APIError, JWTTokenSchema, LOCALES, SSEClient, SemiontApiClient, accessToken, annotationUri, authCode, baseUrl, cloneToken, createCircleSvg, createPolygonSvg, createRectangleSvg, decodeRepresentation, decodeWithCharset, email, entityType, extractBoundingBox, extractCharset, extractContext, findTextWithContext, formatEventType, formatLocaleDisplay, formatRelativeTime, getAllLocaleCodes, getAnnotationExactText, getAnnotationUriFromEvent, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getEventDisplayContent, getEventEmoji, getEventEntityTypes, getExactText, getExtensionForMimeType, getFragmentSelector, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getMimeCategory, getNodeEncoding, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceCreationDetails, getResourceEntityTypes, getResourceId, getStorageUri, getSvgSelector, getTargetSelector, getTargetSource, getTextPositionSelector, getTextQuoteSelector, googleCredential, hasTargetSelector, isArchived, isAssessment, isBodyResolved, isComment, isDraft, isEventRelatedToAnnotation, isHighlight, isImageMimeType, isPdfMimeType, isReference, isResolvedReference, isResourceEvent, isStubReference, isTag, isTextMimeType, isValidEmail, jobId, mcpToken, normalizeCoordinates, parseSvgSelector, refreshToken, resourceAnnotationUri, resourceUri, scaleSvgToNative, searchQuery, userDID, validateAndCorrectOffsets, validateData, validateSvgMarkup, verifyPosition };
2037
2048
  //# sourceMappingURL=index.js.map
2038
2049
  //# sourceMappingURL=index.js.map