@semiont/frontend 0.2.43 → 0.2.46
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/package.json +1 -1
- package/standalone/apps/frontend/.next/BUILD_ID +1 -1
- package/standalone/apps/frontend/.next/app-build-manifest.json +169 -143
- package/standalone/apps/frontend/.next/app-path-routes-manifest.json +5 -5
- package/standalone/apps/frontend/.next/build-manifest.json +11 -11
- package/standalone/apps/frontend/.next/prerender-manifest.json +3 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/about/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/about/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/about/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/devops/page.js +16 -8
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/devops/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/devops/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/security/page.js +16 -8
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/security/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/security/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/users/page.js +16 -8
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/users/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/admin/users/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/error/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/error/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/error/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/mcp-setup/route.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/mcp-setup/route.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/mcp-setup/route_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/signin/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/signin/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/signin/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/signup/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/signup/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/signup/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/welcome/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/welcome/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/auth/welcome/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/compose/page.js +28 -33
- package/standalone/apps/frontend/.next/server/app/[locale]/know/compose/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/compose/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/discover/page.js +13 -5
- package/standalone/apps/frontend/.next/server/app/[locale]/know/discover/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/discover/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/page.js +9 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/resource/[id]/page.js +13 -5
- package/standalone/apps/frontend/.next/server/app/[locale]/know/resource/[id]/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/know/resource/[id]/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/entity-tags/page.js +16 -8
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/entity-tags/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/entity-tags/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/recent/page.js +19 -11
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/recent/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/recent/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/tag-schemas/page.js +19 -11
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/tag-schemas/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/moderate/tag-schemas/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/page.js +11 -3
- package/standalone/apps/frontend/.next/server/app/[locale]/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/privacy/page.js +10 -2
- package/standalone/apps/frontend/.next/server/app/[locale]/privacy/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/privacy/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/terms/page.js +10 -2
- package/standalone/apps/frontend/.next/server/app/[locale]/terms/page.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/[locale]/terms/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/_not-found.html +1 -1
- package/standalone/apps/frontend/.next/server/app/_not-found.rsc +1 -1
- package/standalone/apps/frontend/.next/server/app/api/auth/[...nextauth]/route.js +1 -1
- package/standalone/apps/frontend/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/api/auth/[...nextauth]/route_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/api/cookies/consent/route.js +1 -1
- package/standalone/apps/frontend/.next/server/app/api/cookies/consent/route.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/api/cookies/consent/route_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/api/cookies/export/route.js +1 -1
- package/standalone/apps/frontend/.next/server/app/api/cookies/export/route.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/api/cookies/export/route_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app/api/resources/[id]/route.js +1 -1
- package/standalone/apps/frontend/.next/server/app/api/resources/[id]/route.js.nft.json +1 -1
- package/standalone/apps/frontend/.next/server/app/api/resources/[id]/route_client-reference-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/app-paths-manifest.json +5 -5
- package/standalone/apps/frontend/.next/server/chunks/1037.js +16 -16
- package/standalone/apps/frontend/.next/server/chunks/{7912.js → 1571.js} +65158 -64761
- package/standalone/apps/frontend/.next/server/chunks/{1854.js → 243.js} +16469 -6747
- package/standalone/apps/frontend/.next/server/chunks/5015.js +47 -40
- package/standalone/apps/frontend/.next/server/chunks/5919.js +389 -72
- package/standalone/apps/frontend/.next/server/chunks/8387.js +8 -8
- package/standalone/apps/frontend/.next/server/middleware-build-manifest.js +1 -1
- package/standalone/apps/frontend/.next/server/middleware-manifest.json +5 -5
- package/standalone/apps/frontend/.next/server/pages/404.html +1 -1
- package/standalone/apps/frontend/.next/server/pages/500.html +1 -1
- package/standalone/apps/frontend/.next/server/server-reference-manifest.json +1 -1
- package/standalone/apps/frontend/.next/static/chunks/891cff7f-c78128b144881d3d.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/about/{page-28023b5ae5e22ad9.js → page-2612da8196937125.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/devops/{page-da9614b9f1606d7b.js → page-147b0b11a8fe12c0.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/{layout-62ef934e6bcc18b1.js → layout-d81f214219f32295.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/security/{page-8031d11e8dccef6c.js → page-86f20414076a4eac.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/users/{page-a978206777229291.js → page-7a5c39d331b58766.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/error/{page-4e5ee1553c6d8ebe.js → page-c7acbccc5eeb9c65.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/mcp-setup/route-3d9d880043f60fda.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/signin/{page-c878d25b0ae5069c.js → page-3cf5000d8453a051.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/signup/{page-1292f2664ce93b63.js → page-14bd6caad80c5a18.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/welcome/{page-7e79cf1f705618db.js → page-0f23c4489f190553.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/compose/page-c0f5391820294d71.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/discover/{page-f9d0032f45241437.js → page-2fcd56a573698764.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/layout-32d7526fa4d2b63b.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/resource/[id]/{page-4cb67f9bf8be8f1a.js → page-ca3b8a812910df49.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/{layout-2f6c82f89ff0fb38.js → layout-4833049ac5ba6b73.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/entity-tags/{page-f76e2312764ebe0c.js → page-b997f7d29b5da59c.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/{layout-63abc0b7153c03d3.js → layout-03d699862cfdbfb3.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/recent/{page-a00695b21e364495.js → page-a35fc8aa6a6ec74a.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/tag-schemas/{page-874ddff1c67dd96a.js → page-df22b4039ed2f150.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/{not-found-9338290efe925a85.js → not-found-8a8a376b4358015e.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/{page-46fad01f54cffcaf.js → page-38f29470efb2b425.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/privacy/{page-7034c8af05b702cd.js → page-c3fa4b4c758a5117.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/terms/{page-fbfecd018ce6acdd.js → page-8e3d4554b2476d8b.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/app/api/auth/[...nextauth]/route-a0e1a9709b37316f.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/consent/route-7fe48e1a8a111543.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/export/route-32b06db0feb2e923.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/app/api/resources/[id]/route-d30a52945e1daab7.js +1 -0
- package/standalone/apps/frontend/.next/static/chunks/common-44c6928277b056bb.js +7 -0
- package/standalone/apps/frontend/.next/static/chunks/{vendors-8159ca2e2437ac1f.js → vendors-a5e886395f8b2478.js} +1 -1
- package/standalone/apps/frontend/.next/static/chunks/webpack-7f20ed511021701e.js +1 -0
- package/standalone/apps/frontend/package.json +3 -3
- package/standalone/package.json +1 -1
- package/standalone/packages/core/package.json +2 -2
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/mcp-setup/route-e1d196e7f8d38edd.js +0 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/compose/page-7c16ece328eb4a91.js +0 -1
- package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/layout-83fe577a1460d915.js +0 -1
- package/standalone/apps/frontend/.next/static/chunks/app/api/auth/[...nextauth]/route-24502971e8577474.js +0 -1
- package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/consent/route-680f8e085df19751.js +0 -1
- package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/export/route-5c5bd56c39187fd1.js +0 -1
- package/standalone/apps/frontend/.next/static/chunks/app/api/resources/[id]/route-e5f4f3f1353c7a86.js +0 -1
- package/standalone/apps/frontend/.next/static/chunks/common-d8e3aad4ef182cd5.js +0 -7
- package/standalone/apps/frontend/.next/static/chunks/webpack-bb603b0ace5d73b8.js +0 -1
- /package/standalone/apps/frontend/.next/static/{xBGpm09GpDqg_UPzatgHr → 6jveNfQ3loMcIcUP5DDA1}/_buildManifest.js +0 -0
- /package/standalone/apps/frontend/.next/static/{xBGpm09GpDqg_UPzatgHr → 6jveNfQ3loMcIcUP5DDA1}/_ssgManifest.js +0 -0
|
@@ -9,9 +9,11 @@ exports.modules = {
|
|
|
9
9
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10
10
|
/* harmony export */ N: () => (/* binding */ resourceUri)
|
|
11
11
|
/* harmony export */ });
|
|
12
|
-
/* unused harmony exports APIError, CORE_TYPES_VERSION, CREATION_METHODS, ConfigurationError, ConflictError, EventBus, NotFoundError, SDK_VERSION, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, annotationId, annotationIdToURI, annotationUri, authCode, baseUrl, burstBuffer, cloneToken, createConfigLoader, deepMerge, didToAgent, displayConfiguration, email, entityType, extractResourceUriFromAnnotationUri, findBodyItem, formatErrors, getAllPlatformTypes, getAnnotationUriFromEvent, getEventType, getNodeEnvForEnvironment, googleCredential, hasAWSConfig, isAnnotationId, isArray, isBoolean, isDefined, isEventRelatedToAnnotation, isFunction, isNull, isNullish, isNumber, isObject, isResourceEvent, isResourceId, isResourceScopedEvent, isStoredEvent, isString, isSystemEvent, isUndefined, isValidPlatformType, jobId, listEnvironmentNames, mcpToken, parseAndMergeConfigs, parseEnvironment, refreshToken, resolveEnvVars, resourceAnnotationUri, resourceId, resourceIdToURI, searchQuery, uriToAnnotationId, uriToAnnotationIdOrPassthrough, uriToResourceId, userDID, userId, userToAgent, userToDid, validateEnvironment, validateEnvironmentConfig, validateSemiontConfig, validateSiteConfig */
|
|
13
|
-
/* harmony import */ var
|
|
14
|
-
/* harmony import */ var
|
|
12
|
+
/* unused harmony exports APIError, CORE_TYPES_VERSION, CREATION_METHODS, ConfigurationError, ConflictError, EventBus, NotFoundError, SDK_VERSION, ScopedEventBus, ScriptError, SemiontError, UnauthorizedError, ValidationError, accessToken, annotationId, annotationIdToURI, annotationUri, applyBodyOperations, assembleAnnotation, authCode, baseUrl, burstBuffer, cloneToken, createConfigLoader, deepMerge, didToAgent, displayConfiguration, email, entityType, extractResourceUriFromAnnotationUri, findBodyItem, formatErrors, generateUuid, getAllPlatformTypes, getAnnotationUriFromEvent, getEventType, getFragmentSelector, getNodeEnvForEnvironment, getSvgSelector, getTextPositionSelector, googleCredential, hasAWSConfig, isAnnotationId, isArray, isBoolean, isDefined, isEventRelatedToAnnotation, isFunction, isNull, isNullish, isNumber, isObject, isResourceEvent, isResourceId, isResourceScopedEvent, isStoredEvent, isString, isSystemEvent, isUndefined, isValidPlatformType, jobId, listEnvironmentNames, mcpToken, parseAndMergeConfigs, parseEnvironment, refreshToken, resolveEnvVars, resourceAnnotationUri, resourceId, resourceIdToURI, searchQuery, uriToAnnotationId, uriToAnnotationIdOrPassthrough, uriToResourceId, userDID, userId, userToAgent, userToDid, validateEnvironment, validateEnvironmentConfig, validateSemiontConfig, validateSiteConfig, validateSvgMarkup */
|
|
13
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55511);
|
|
14
|
+
/* harmony import */ var ajv__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(64025);
|
|
15
|
+
/* harmony import */ var ajv_formats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33771);
|
|
16
|
+
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
|
|
@@ -400,6 +402,127 @@ function findBodyItem(body, targetItem) {
|
|
|
400
402
|
}
|
|
401
403
|
return -1;
|
|
402
404
|
}
|
|
405
|
+
function generateUuid() {
|
|
406
|
+
return randomBytes(16).toString("hex");
|
|
407
|
+
}
|
|
408
|
+
// src/annotation-assembly.ts
|
|
409
|
+
function getTextPositionSelector(selector) {
|
|
410
|
+
if (!selector) return null;
|
|
411
|
+
const selectors = Array.isArray(selector) ? selector : [
|
|
412
|
+
selector
|
|
413
|
+
];
|
|
414
|
+
const found = selectors.find((s)=>s.type === "TextPositionSelector");
|
|
415
|
+
if (!found) return null;
|
|
416
|
+
return found.type === "TextPositionSelector" ? found : null;
|
|
417
|
+
}
|
|
418
|
+
function getSvgSelector(selector) {
|
|
419
|
+
if (!selector) return null;
|
|
420
|
+
const selectors = Array.isArray(selector) ? selector : [
|
|
421
|
+
selector
|
|
422
|
+
];
|
|
423
|
+
const found = selectors.find((s)=>s.type === "SvgSelector");
|
|
424
|
+
if (!found) return null;
|
|
425
|
+
return found.type === "SvgSelector" ? found : null;
|
|
426
|
+
}
|
|
427
|
+
function getFragmentSelector(selector) {
|
|
428
|
+
if (!selector) return null;
|
|
429
|
+
const selectors = Array.isArray(selector) ? selector : [
|
|
430
|
+
selector
|
|
431
|
+
];
|
|
432
|
+
const found = selectors.find((s)=>s.type === "FragmentSelector");
|
|
433
|
+
if (!found) return null;
|
|
434
|
+
return found.type === "FragmentSelector" ? found : null;
|
|
435
|
+
}
|
|
436
|
+
function validateSvgMarkup(svg) {
|
|
437
|
+
if (!svg.includes('xmlns="http://www.w3.org/2000/svg"')) {
|
|
438
|
+
return 'SVG must include xmlns="http://www.w3.org/2000/svg" attribute';
|
|
439
|
+
}
|
|
440
|
+
if (!svg.includes("<svg") || !svg.includes("</svg>")) {
|
|
441
|
+
return "SVG must have opening and closing tags";
|
|
442
|
+
}
|
|
443
|
+
const shapeElements = [
|
|
444
|
+
"rect",
|
|
445
|
+
"circle",
|
|
446
|
+
"ellipse",
|
|
447
|
+
"polygon",
|
|
448
|
+
"polyline",
|
|
449
|
+
"path",
|
|
450
|
+
"line"
|
|
451
|
+
];
|
|
452
|
+
const hasShape = shapeElements.some((shape)=>svg.includes(`<${shape}`) || svg.includes(`<${shape} `));
|
|
453
|
+
if (!hasShape) {
|
|
454
|
+
return "SVG must contain at least one shape element (rect, circle, ellipse, polygon, polyline, path, or line)";
|
|
455
|
+
}
|
|
456
|
+
return null;
|
|
457
|
+
}
|
|
458
|
+
function generateAnnotationId(baseUrl2) {
|
|
459
|
+
if (!baseUrl2) {
|
|
460
|
+
throw new Error("baseUrl is required to generate annotation URIs");
|
|
461
|
+
}
|
|
462
|
+
const normalizedBase = baseUrl2.endsWith("/") ? baseUrl2.slice(0, -1) : baseUrl2;
|
|
463
|
+
return `${normalizedBase}/annotations/${generateUuid()}`;
|
|
464
|
+
}
|
|
465
|
+
function assembleAnnotation(request, creator, publicURL) {
|
|
466
|
+
const newAnnotationId = generateAnnotationId(publicURL);
|
|
467
|
+
const posSelector = getTextPositionSelector(request.target.selector);
|
|
468
|
+
const svgSelector = getSvgSelector(request.target.selector);
|
|
469
|
+
const fragmentSelector = getFragmentSelector(request.target.selector);
|
|
470
|
+
if (!posSelector && !svgSelector && !fragmentSelector) {
|
|
471
|
+
throw new Error("Either TextPositionSelector, SvgSelector, or FragmentSelector is required for creating annotations");
|
|
472
|
+
}
|
|
473
|
+
if (svgSelector) {
|
|
474
|
+
const svgError = validateSvgMarkup(svgSelector.value);
|
|
475
|
+
if (svgError) {
|
|
476
|
+
throw new Error(`Invalid SVG markup: ${svgError}`);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
if (!request.motivation) {
|
|
480
|
+
throw new Error("motivation is required");
|
|
481
|
+
}
|
|
482
|
+
const now = /* @__PURE__ */ new Date().toISOString();
|
|
483
|
+
const annotation = {
|
|
484
|
+
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
485
|
+
"type": "Annotation",
|
|
486
|
+
id: newAnnotationId,
|
|
487
|
+
motivation: request.motivation,
|
|
488
|
+
target: request.target,
|
|
489
|
+
body: request.body,
|
|
490
|
+
creator,
|
|
491
|
+
created: now,
|
|
492
|
+
modified: now
|
|
493
|
+
};
|
|
494
|
+
const bodyArray = Array.isArray(request.body) ? request.body : request.body ? [
|
|
495
|
+
request.body
|
|
496
|
+
] : [];
|
|
497
|
+
return {
|
|
498
|
+
annotation,
|
|
499
|
+
bodyArray
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function applyBodyOperations(body, operations) {
|
|
503
|
+
const bodyArray = Array.isArray(body) ? [
|
|
504
|
+
...body
|
|
505
|
+
] : [];
|
|
506
|
+
for (const op of operations){
|
|
507
|
+
if (op.op === "add") {
|
|
508
|
+
const exists = bodyArray.some((item)=>JSON.stringify(item) === JSON.stringify(op.item));
|
|
509
|
+
if (!exists) {
|
|
510
|
+
bodyArray.push(op.item);
|
|
511
|
+
}
|
|
512
|
+
} else if (op.op === "remove") {
|
|
513
|
+
const index = bodyArray.findIndex((item)=>JSON.stringify(item) === JSON.stringify(op.item));
|
|
514
|
+
if (index !== -1) {
|
|
515
|
+
bodyArray.splice(index, 1);
|
|
516
|
+
}
|
|
517
|
+
} else if (op.op === "replace") {
|
|
518
|
+
const index = bodyArray.findIndex((item)=>JSON.stringify(item) === JSON.stringify(op.oldItem));
|
|
519
|
+
if (index !== -1) {
|
|
520
|
+
bodyArray[index] = op.newItem;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return bodyArray;
|
|
525
|
+
}
|
|
403
526
|
// src/type-guards.ts
|
|
404
527
|
function isString(value) {
|
|
405
528
|
return typeof value === "string";
|
|
@@ -2128,7 +2251,7 @@ var config_schema_default = {
|
|
|
2128
2251
|
}
|
|
2129
2252
|
};
|
|
2130
2253
|
// src/config/config-validator.ts
|
|
2131
|
-
var ajv = new
|
|
2254
|
+
var ajv = new ajv__WEBPACK_IMPORTED_MODULE_2__({
|
|
2132
2255
|
allErrors: true,
|
|
2133
2256
|
// Return all errors, not just the first one
|
|
2134
2257
|
coerceTypes: true,
|
|
@@ -2139,7 +2262,7 @@ var ajv = new ajv__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
2139
2262
|
// Apply default values from schema
|
|
2140
2263
|
strict: false
|
|
2141
2264
|
});
|
|
2142
|
-
|
|
2265
|
+
ajv_formats__WEBPACK_IMPORTED_MODULE_1__(ajv);
|
|
2143
2266
|
ajv.addSchema(config_schema_default, "config");
|
|
2144
2267
|
function validateSemiontConfig(data) {
|
|
2145
2268
|
const validate = ajv.getSchema("config#/definitions/SemiontConfig");
|
|
@@ -2637,7 +2760,7 @@ const authOptions = {
|
|
|
2637
2760
|
/***/ 66725:
|
|
2638
2761
|
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
|
2639
2762
|
|
|
2640
|
-
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
2763
|
+
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77135));
|
|
2641
2764
|
|
|
2642
2765
|
|
|
2643
2766
|
/***/ }),
|
|
@@ -2651,11 +2774,14 @@ Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_re
|
|
|
2651
2774
|
/* harmony export */ k3: () => (/* binding */ JWTTokenSchema),
|
|
2652
2775
|
/* harmony export */ lv: () => (/* binding */ validateData)
|
|
2653
2776
|
/* harmony export */ });
|
|
2654
|
-
/* unused harmony exports APIError, LOCALES, SSEClient, SSE_STREAM_CONNECTED, buildContentCache, createCircleSvg, createPolygonSvg, createRectangleSvg, decodeRepresentation, decodeWithCharset, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findTextWithContext, formatLocaleDisplay, getAllLocaleCodes, getAnnotationExactText, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getExtensionForMimeType,
|
|
2777
|
+
/* unused harmony exports APIError, EventBusClient, LOCALES, SSEClient, SSE_STREAM_CONNECTED, buildContentCache, createCircleSvg, createPolygonSvg, createRectangleSvg, decodeRepresentation, decodeWithCharset, extractBoundingBox, extractCharset, extractContext, findBestTextMatch, findTextWithContext, formatLocaleDisplay, getAllLocaleCodes, getAnnotationExactText, getBodySource, getBodyType, getChecksum, getCommentText, getCreator, getDerivedFrom, getExactText, getExtensionForMimeType, getLanguage, getLocaleEnglishName, getLocaleInfo, getLocaleNativeName, getMimeCategory, getNodeEncoding, getPrimaryMediaType, getPrimaryRepresentation, getPrimarySelector, getResourceEntityTypes, getResourceId, getStorageUri, getTargetSelector, getTargetSource, getTextQuoteSelector, hasTargetSelector, isArchived, isAssessment, isBodyResolved, isComment, isDraft, isHighlight, isImageMimeType, isPdfMimeType, isReference, isResolvedReference, isStubReference, isTag, isTextMimeType, isValidEmail, normalizeCoordinates, normalizeText, parseSvgSelector, scaleSvgToNative, validateAndCorrectOffsets, verifyPosition */
|
|
2655
2778
|
/* harmony import */ var ky__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5686);
|
|
2656
2779
|
/* harmony import */ var _semiont_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16587);
|
|
2657
2780
|
|
|
2658
2781
|
|
|
2782
|
+
|
|
2783
|
+
|
|
2784
|
+
|
|
2659
2785
|
// src/client.ts
|
|
2660
2786
|
// src/sse/stream.ts
|
|
2661
2787
|
function createSSEStream(url, fetchOptions, config, logger) {
|
|
@@ -3203,6 +3329,50 @@ var SSEClient = class {
|
|
|
3203
3329
|
}
|
|
3204
3330
|
return stream;
|
|
3205
3331
|
}
|
|
3332
|
+
/**
|
|
3333
|
+
* Subscribe to global system events (long-lived stream)
|
|
3334
|
+
*
|
|
3335
|
+
* Opens a long-lived SSE connection to receive system-level domain events
|
|
3336
|
+
* (entity type additions, etc.) that are not scoped to a specific resource.
|
|
3337
|
+
*
|
|
3338
|
+
* @param options - Request options (auth token, eventBus)
|
|
3339
|
+
* @returns SSE stream controller
|
|
3340
|
+
*
|
|
3341
|
+
* @example
|
|
3342
|
+
* ```typescript
|
|
3343
|
+
* const stream = sseClient.globalEvents({ auth: 'your-token', eventBus });
|
|
3344
|
+
*
|
|
3345
|
+
* // Events auto-emit to EventBus — subscribe there
|
|
3346
|
+
* eventBus.get('make-meaning:event').subscribe((event) => {
|
|
3347
|
+
* if (event.type === 'entitytype.added') {
|
|
3348
|
+
* // Invalidate entity types query
|
|
3349
|
+
* }
|
|
3350
|
+
* });
|
|
3351
|
+
*
|
|
3352
|
+
* // Close when no longer needed
|
|
3353
|
+
* stream.close();
|
|
3354
|
+
* ```
|
|
3355
|
+
*/ globalEvents(options) {
|
|
3356
|
+
const url = `${this.baseUrl}/api/events/stream`;
|
|
3357
|
+
const stream = createSSEStream(url, {
|
|
3358
|
+
method: "GET",
|
|
3359
|
+
headers: this.getHeaders(options.auth)
|
|
3360
|
+
}, {
|
|
3361
|
+
progressEvents: [
|
|
3362
|
+
"*"
|
|
3363
|
+
],
|
|
3364
|
+
completeEvent: null,
|
|
3365
|
+
errorEvent: null,
|
|
3366
|
+
eventBus: options.eventBus
|
|
3367
|
+
}, this.logger);
|
|
3368
|
+
if (options.onConnected) {
|
|
3369
|
+
const sub = options.eventBus.get(SSE_STREAM_CONNECTED).subscribe(()=>{
|
|
3370
|
+
options.onConnected();
|
|
3371
|
+
sub.unsubscribe();
|
|
3372
|
+
});
|
|
3373
|
+
}
|
|
3374
|
+
return stream;
|
|
3375
|
+
}
|
|
3206
3376
|
};
|
|
3207
3377
|
// src/client.ts
|
|
3208
3378
|
var APIError = class extends Error {
|
|
@@ -3216,11 +3386,11 @@ var APIError = class extends Error {
|
|
|
3216
3386
|
};
|
|
3217
3387
|
var SemiontApiClient = class {
|
|
3218
3388
|
constructor(config){
|
|
3219
|
-
const { baseUrl, timeout = 3e4, retry = 2, logger } = config;
|
|
3389
|
+
const { baseUrl, timeout: timeout2 = 3e4, retry = 2, logger } = config;
|
|
3220
3390
|
this.logger = logger;
|
|
3221
3391
|
this.baseUrl = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
3222
3392
|
this.http = ky__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Ay.create({
|
|
3223
|
-
timeout,
|
|
3393
|
+
timeout: timeout2,
|
|
3224
3394
|
retry,
|
|
3225
3395
|
hooks: {
|
|
3226
3396
|
beforeRequest: [
|
|
@@ -3496,11 +3666,11 @@ var SemiontApiClient = class {
|
|
|
3496
3666
|
}).json();
|
|
3497
3667
|
}
|
|
3498
3668
|
async updateResource(resourceUri2, data, options) {
|
|
3499
|
-
|
|
3669
|
+
await this.http.patch(resourceUri2, {
|
|
3500
3670
|
json: data,
|
|
3501
3671
|
...options,
|
|
3502
3672
|
auth: options?.auth
|
|
3503
|
-
}).
|
|
3673
|
+
}).text();
|
|
3504
3674
|
}
|
|
3505
3675
|
async getResourceEvents(resourceUri2, options) {
|
|
3506
3676
|
return this.http.get(`${resourceUri2}/events`, {
|
|
@@ -3588,11 +3758,11 @@ var SemiontApiClient = class {
|
|
|
3588
3758
|
});
|
|
3589
3759
|
}
|
|
3590
3760
|
async updateAnnotationBody(annotationUri, data, options) {
|
|
3591
|
-
|
|
3761
|
+
await this.http.put(`${annotationUri}/body`, {
|
|
3592
3762
|
json: data,
|
|
3593
3763
|
...options,
|
|
3594
3764
|
auth: options?.auth
|
|
3595
|
-
})
|
|
3765
|
+
});
|
|
3596
3766
|
}
|
|
3597
3767
|
async getAnnotationHistory(annotationUri, options) {
|
|
3598
3768
|
if (options) {
|
|
@@ -3604,22 +3774,22 @@ var SemiontApiClient = class {
|
|
|
3604
3774
|
// ENTITY TYPES
|
|
3605
3775
|
// ============================================================================
|
|
3606
3776
|
async addEntityType(type, options) {
|
|
3607
|
-
|
|
3777
|
+
await this.http.post(`${this.baseUrl}/api/entity-types`, {
|
|
3608
3778
|
json: {
|
|
3609
|
-
type
|
|
3779
|
+
tag: type
|
|
3610
3780
|
},
|
|
3611
3781
|
...options,
|
|
3612
3782
|
auth: options?.auth
|
|
3613
|
-
})
|
|
3783
|
+
});
|
|
3614
3784
|
}
|
|
3615
3785
|
async addEntityTypesBulk(types, options) {
|
|
3616
|
-
|
|
3786
|
+
await this.http.post(`${this.baseUrl}/api/entity-types/bulk`, {
|
|
3617
3787
|
json: {
|
|
3618
3788
|
tags: types
|
|
3619
3789
|
},
|
|
3620
3790
|
...options,
|
|
3621
3791
|
auth: options?.auth
|
|
3622
|
-
})
|
|
3792
|
+
});
|
|
3623
3793
|
}
|
|
3624
3794
|
async listEntityTypes(options) {
|
|
3625
3795
|
return this.http.get(`${this.baseUrl}/api/entity-types`, {
|
|
@@ -3674,7 +3844,7 @@ var SemiontApiClient = class {
|
|
|
3674
3844
|
* @returns The final job status
|
|
3675
3845
|
*/ async pollJobUntilComplete(id, options) {
|
|
3676
3846
|
const interval = options?.interval ?? 1e3;
|
|
3677
|
-
const
|
|
3847
|
+
const timeout2 = options?.timeout ?? 6e4;
|
|
3678
3848
|
const startTime = Date.now();
|
|
3679
3849
|
while(true){
|
|
3680
3850
|
const status = await this.getJobStatus(id, {
|
|
@@ -3686,8 +3856,8 @@ var SemiontApiClient = class {
|
|
|
3686
3856
|
if (status.status === "complete" || status.status === "failed" || status.status === "cancelled") {
|
|
3687
3857
|
return status;
|
|
3688
3858
|
}
|
|
3689
|
-
if (Date.now() - startTime >
|
|
3690
|
-
throw new Error(`Job polling timeout after ${
|
|
3859
|
+
if (Date.now() - startTime > timeout2) {
|
|
3860
|
+
throw new Error(`Job polling timeout after ${timeout2}ms`);
|
|
3691
3861
|
}
|
|
3692
3862
|
await new Promise((resolve)=>setTimeout(resolve, interval));
|
|
3693
3863
|
}
|
|
@@ -3722,6 +3892,202 @@ var SemiontApiClient = class {
|
|
|
3722
3892
|
return this.http.get(`${this.baseUrl}/api/status`).json();
|
|
3723
3893
|
}
|
|
3724
3894
|
};
|
|
3895
|
+
async function eventBusRequest(eventBus, requestEvent, payload, successEvent, failureEvent, timeoutMs = 3e4) {
|
|
3896
|
+
const correlationId = payload.correlationId;
|
|
3897
|
+
const result$ = merge(eventBus.get(successEvent).pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
3898
|
+
ok: true,
|
|
3899
|
+
response: e.response
|
|
3900
|
+
}))), eventBus.get(failureEvent).pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
3901
|
+
ok: false,
|
|
3902
|
+
error: e.error
|
|
3903
|
+
})))).pipe(take(1), timeout(timeoutMs));
|
|
3904
|
+
const resultPromise = firstValueFrom(result$);
|
|
3905
|
+
eventBus.get(requestEvent).next(payload);
|
|
3906
|
+
const result = await resultPromise;
|
|
3907
|
+
if (!result.ok) {
|
|
3908
|
+
throw result.error;
|
|
3909
|
+
}
|
|
3910
|
+
return result.response;
|
|
3911
|
+
}
|
|
3912
|
+
var EventBusClient = class {
|
|
3913
|
+
constructor(eventBus, timeoutMs = 3e4){
|
|
3914
|
+
this.eventBus = eventBus;
|
|
3915
|
+
this.timeoutMs = timeoutMs;
|
|
3916
|
+
}
|
|
3917
|
+
// ========================================================================
|
|
3918
|
+
// Browse Flow — Resource reads
|
|
3919
|
+
// ========================================================================
|
|
3920
|
+
async getResource(resourceId) {
|
|
3921
|
+
return eventBusRequest(this.eventBus, "browse:resource-requested", {
|
|
3922
|
+
correlationId: crypto.randomUUID(),
|
|
3923
|
+
resourceId
|
|
3924
|
+
}, "browse:resource-result", "browse:resource-failed", this.timeoutMs);
|
|
3925
|
+
}
|
|
3926
|
+
async listResources(options) {
|
|
3927
|
+
return eventBusRequest(this.eventBus, "browse:resources-requested", {
|
|
3928
|
+
correlationId: crypto.randomUUID(),
|
|
3929
|
+
...options
|
|
3930
|
+
}, "browse:resources-result", "browse:resources-failed", this.timeoutMs);
|
|
3931
|
+
}
|
|
3932
|
+
// ========================================================================
|
|
3933
|
+
// Browse Flow — Annotation reads
|
|
3934
|
+
// ========================================================================
|
|
3935
|
+
async getAnnotations(resourceId) {
|
|
3936
|
+
return eventBusRequest(this.eventBus, "browse:annotations-requested", {
|
|
3937
|
+
correlationId: crypto.randomUUID(),
|
|
3938
|
+
resourceId
|
|
3939
|
+
}, "browse:annotations-result", "browse:annotations-failed", this.timeoutMs);
|
|
3940
|
+
}
|
|
3941
|
+
async getAnnotation(resourceId, annotationId) {
|
|
3942
|
+
return eventBusRequest(this.eventBus, "browse:annotation-requested", {
|
|
3943
|
+
correlationId: crypto.randomUUID(),
|
|
3944
|
+
resourceId,
|
|
3945
|
+
annotationId
|
|
3946
|
+
}, "browse:annotation-result", "browse:annotation-failed", this.timeoutMs);
|
|
3947
|
+
}
|
|
3948
|
+
// ========================================================================
|
|
3949
|
+
// Browse Flow — Event history
|
|
3950
|
+
// ========================================================================
|
|
3951
|
+
async getEvents(resourceId, options) {
|
|
3952
|
+
return eventBusRequest(this.eventBus, "browse:events-requested", {
|
|
3953
|
+
correlationId: crypto.randomUUID(),
|
|
3954
|
+
resourceId,
|
|
3955
|
+
...options
|
|
3956
|
+
}, "browse:events-result", "browse:events-failed", this.timeoutMs);
|
|
3957
|
+
}
|
|
3958
|
+
async getAnnotationHistory(resourceId, annotationId) {
|
|
3959
|
+
return eventBusRequest(this.eventBus, "browse:annotation-history-requested", {
|
|
3960
|
+
correlationId: crypto.randomUUID(),
|
|
3961
|
+
resourceId,
|
|
3962
|
+
annotationId
|
|
3963
|
+
}, "browse:annotation-history-result", "browse:annotation-history-failed", this.timeoutMs);
|
|
3964
|
+
}
|
|
3965
|
+
// ========================================================================
|
|
3966
|
+
// Bind Flow — Graph queries
|
|
3967
|
+
// ========================================================================
|
|
3968
|
+
async getReferencedBy(resourceId, motivation) {
|
|
3969
|
+
return eventBusRequest(this.eventBus, "bind:referenced-by-requested", {
|
|
3970
|
+
correlationId: crypto.randomUUID(),
|
|
3971
|
+
resourceId,
|
|
3972
|
+
motivation
|
|
3973
|
+
}, "bind:referenced-by-result", "bind:referenced-by-failed", this.timeoutMs);
|
|
3974
|
+
}
|
|
3975
|
+
// ========================================================================
|
|
3976
|
+
// Mark Flow — Entity types
|
|
3977
|
+
// ========================================================================
|
|
3978
|
+
async listEntityTypes() {
|
|
3979
|
+
return eventBusRequest(this.eventBus, "mark:entity-types-requested", {
|
|
3980
|
+
correlationId: crypto.randomUUID()
|
|
3981
|
+
}, "mark:entity-types-result", "mark:entity-types-failed", this.timeoutMs);
|
|
3982
|
+
}
|
|
3983
|
+
addEntityType(tag, userId) {
|
|
3984
|
+
this.eventBus.get("mark:add-entity-type").next({
|
|
3985
|
+
tag,
|
|
3986
|
+
userId
|
|
3987
|
+
});
|
|
3988
|
+
}
|
|
3989
|
+
// ========================================================================
|
|
3990
|
+
// Yield Flow — Clone tokens
|
|
3991
|
+
// ========================================================================
|
|
3992
|
+
async generateCloneToken(resourceId) {
|
|
3993
|
+
return eventBusRequest(this.eventBus, "yield:clone-token-requested", {
|
|
3994
|
+
correlationId: crypto.randomUUID(),
|
|
3995
|
+
resourceId
|
|
3996
|
+
}, "yield:clone-token-generated", "yield:clone-token-failed", this.timeoutMs);
|
|
3997
|
+
}
|
|
3998
|
+
async getResourceByToken(token) {
|
|
3999
|
+
return eventBusRequest(this.eventBus, "yield:clone-resource-requested", {
|
|
4000
|
+
correlationId: crypto.randomUUID(),
|
|
4001
|
+
token
|
|
4002
|
+
}, "yield:clone-resource-result", "yield:clone-resource-failed", this.timeoutMs);
|
|
4003
|
+
}
|
|
4004
|
+
async createResourceFromToken(options) {
|
|
4005
|
+
return eventBusRequest(this.eventBus, "yield:clone-create", {
|
|
4006
|
+
correlationId: crypto.randomUUID(),
|
|
4007
|
+
...options
|
|
4008
|
+
}, "yield:clone-created", "yield:clone-create-failed", this.timeoutMs);
|
|
4009
|
+
}
|
|
4010
|
+
// ========================================================================
|
|
4011
|
+
// Job Control
|
|
4012
|
+
// ========================================================================
|
|
4013
|
+
async getJobStatus(jobId) {
|
|
4014
|
+
return eventBusRequest(this.eventBus, "job:status-requested", {
|
|
4015
|
+
correlationId: crypto.randomUUID(),
|
|
4016
|
+
jobId
|
|
4017
|
+
}, "job:status-result", "job:status-failed", this.timeoutMs);
|
|
4018
|
+
}
|
|
4019
|
+
// ========================================================================
|
|
4020
|
+
// Gather Flow — LLM context
|
|
4021
|
+
// ========================================================================
|
|
4022
|
+
async getAnnotationLLMContext(annotationUri, resourceUri2, options) {
|
|
4023
|
+
const correlationId = crypto.randomUUID();
|
|
4024
|
+
const result$ = merge(this.eventBus.get("gather:complete").pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
4025
|
+
ok: true,
|
|
4026
|
+
response: e.response
|
|
4027
|
+
}))), this.eventBus.get("gather:failed").pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
4028
|
+
ok: false,
|
|
4029
|
+
error: e.error
|
|
4030
|
+
})))).pipe(take(1), timeout(this.timeoutMs));
|
|
4031
|
+
const resultPromise = firstValueFrom(result$);
|
|
4032
|
+
this.eventBus.get("gather:requested").next({
|
|
4033
|
+
correlationId,
|
|
4034
|
+
annotationUri,
|
|
4035
|
+
resourceUri: resourceUri2,
|
|
4036
|
+
options
|
|
4037
|
+
});
|
|
4038
|
+
const result = await resultPromise;
|
|
4039
|
+
if (!result.ok) {
|
|
4040
|
+
throw result.error;
|
|
4041
|
+
}
|
|
4042
|
+
return result.response;
|
|
4043
|
+
}
|
|
4044
|
+
async getResourceLLMContext(resourceUri2, options) {
|
|
4045
|
+
const correlationId = crypto.randomUUID();
|
|
4046
|
+
const result$ = merge(this.eventBus.get("gather:resource-complete").pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
4047
|
+
ok: true,
|
|
4048
|
+
response: e.context
|
|
4049
|
+
}))), this.eventBus.get("gather:resource-failed").pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
4050
|
+
ok: false,
|
|
4051
|
+
error: e.error
|
|
4052
|
+
})))).pipe(take(1), timeout(this.timeoutMs));
|
|
4053
|
+
const resultPromise = firstValueFrom(result$);
|
|
4054
|
+
this.eventBus.get("gather:resource-requested").next({
|
|
4055
|
+
correlationId,
|
|
4056
|
+
resourceUri: resourceUri2,
|
|
4057
|
+
options
|
|
4058
|
+
});
|
|
4059
|
+
const result = await resultPromise;
|
|
4060
|
+
if (!result.ok) {
|
|
4061
|
+
throw result.error;
|
|
4062
|
+
}
|
|
4063
|
+
return result.response;
|
|
4064
|
+
}
|
|
4065
|
+
// ========================================================================
|
|
4066
|
+
// Bind Flow — Search
|
|
4067
|
+
// ========================================================================
|
|
4068
|
+
async searchResources(searchTerm) {
|
|
4069
|
+
const correlationId = crypto.randomUUID();
|
|
4070
|
+
const referenceId = correlationId;
|
|
4071
|
+
const result$ = merge(this.eventBus.get("bind:search-results").pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
4072
|
+
ok: true,
|
|
4073
|
+
results: e.results
|
|
4074
|
+
}))), this.eventBus.get("bind:search-failed").pipe(filter((e)=>e.correlationId === correlationId), map((e)=>({
|
|
4075
|
+
ok: false,
|
|
4076
|
+
error: e.error
|
|
4077
|
+
})))).pipe(take(1), timeout(this.timeoutMs));
|
|
4078
|
+
const resultPromise = firstValueFrom(result$);
|
|
4079
|
+
this.eventBus.get("bind:search-requested").next({
|
|
4080
|
+
correlationId,
|
|
4081
|
+
referenceId,
|
|
4082
|
+
searchTerm
|
|
4083
|
+
});
|
|
4084
|
+
const result = await resultPromise;
|
|
4085
|
+
if (!result.ok) {
|
|
4086
|
+
throw result.error;
|
|
4087
|
+
}
|
|
4088
|
+
return result.results;
|
|
4089
|
+
}
|
|
4090
|
+
};
|
|
3725
4091
|
function getBodySource(body) {
|
|
3726
4092
|
if (Array.isArray(body)) {
|
|
3727
4093
|
for (const item of body){
|
|
@@ -3842,15 +4208,6 @@ function getPrimarySelector(selector) {
|
|
|
3842
4208
|
}
|
|
3843
4209
|
return selector;
|
|
3844
4210
|
}
|
|
3845
|
-
function getTextPositionSelector(selector) {
|
|
3846
|
-
if (!selector) return null;
|
|
3847
|
-
const selectors = Array.isArray(selector) ? selector : [
|
|
3848
|
-
selector
|
|
3849
|
-
];
|
|
3850
|
-
const found = selectors.find((s)=>s.type === "TextPositionSelector");
|
|
3851
|
-
if (!found) return null;
|
|
3852
|
-
return found.type === "TextPositionSelector" ? found : null;
|
|
3853
|
-
}
|
|
3854
4211
|
function getTextQuoteSelector(selector) {
|
|
3855
4212
|
const selectors = Array.isArray(selector) ? selector : [
|
|
3856
4213
|
selector
|
|
@@ -3859,46 +4216,6 @@ function getTextQuoteSelector(selector) {
|
|
|
3859
4216
|
if (!found) return null;
|
|
3860
4217
|
return found.type === "TextQuoteSelector" ? found : null;
|
|
3861
4218
|
}
|
|
3862
|
-
function getSvgSelector(selector) {
|
|
3863
|
-
if (!selector) return null;
|
|
3864
|
-
const selectors = Array.isArray(selector) ? selector : [
|
|
3865
|
-
selector
|
|
3866
|
-
];
|
|
3867
|
-
const found = selectors.find((s)=>s.type === "SvgSelector");
|
|
3868
|
-
if (!found) return null;
|
|
3869
|
-
return found.type === "SvgSelector" ? found : null;
|
|
3870
|
-
}
|
|
3871
|
-
function getFragmentSelector(selector) {
|
|
3872
|
-
if (!selector) return null;
|
|
3873
|
-
const selectors = Array.isArray(selector) ? selector : [
|
|
3874
|
-
selector
|
|
3875
|
-
];
|
|
3876
|
-
const found = selectors.find((s)=>s.type === "FragmentSelector");
|
|
3877
|
-
if (!found) return null;
|
|
3878
|
-
return found.type === "FragmentSelector" ? found : null;
|
|
3879
|
-
}
|
|
3880
|
-
function validateSvgMarkup(svg) {
|
|
3881
|
-
if (!svg.includes('xmlns="http://www.w3.org/2000/svg"')) {
|
|
3882
|
-
return 'SVG must include xmlns="http://www.w3.org/2000/svg" attribute';
|
|
3883
|
-
}
|
|
3884
|
-
if (!svg.includes("<svg") || !svg.includes("</svg>")) {
|
|
3885
|
-
return "SVG must have opening and closing tags";
|
|
3886
|
-
}
|
|
3887
|
-
const shapeElements = [
|
|
3888
|
-
"rect",
|
|
3889
|
-
"circle",
|
|
3890
|
-
"ellipse",
|
|
3891
|
-
"polygon",
|
|
3892
|
-
"polyline",
|
|
3893
|
-
"path",
|
|
3894
|
-
"line"
|
|
3895
|
-
];
|
|
3896
|
-
const hasShape = shapeElements.some((shape)=>svg.includes(`<${shape}`) || svg.includes(`<${shape} `));
|
|
3897
|
-
if (!hasShape) {
|
|
3898
|
-
return "SVG must contain at least one shape element (rect, circle, ellipse, polygon, polyline, path, or line)";
|
|
3899
|
-
}
|
|
3900
|
-
return null;
|
|
3901
|
-
}
|
|
3902
4219
|
function extractBoundingBox(svg) {
|
|
3903
4220
|
const viewBoxMatch = svg.match(/<svg[^>]*viewBox="([^"]+)"/);
|
|
3904
4221
|
if (viewBoxMatch) {
|
|
@@ -4589,14 +4906,14 @@ function isValidEmail(email) {
|
|
|
4589
4906
|
}
|
|
4590
4907
|
// src/mime-utils.ts
|
|
4591
4908
|
function getExtensionForMimeType(mimeType) {
|
|
4592
|
-
const
|
|
4909
|
+
const map2 = {
|
|
4593
4910
|
"text/plain": "txt",
|
|
4594
4911
|
"text/markdown": "md",
|
|
4595
4912
|
"image/png": "png",
|
|
4596
4913
|
"image/jpeg": "jpg",
|
|
4597
4914
|
"application/pdf": "pdf"
|
|
4598
4915
|
};
|
|
4599
|
-
return
|
|
4916
|
+
return map2[mimeType] || "dat";
|
|
4600
4917
|
}
|
|
4601
4918
|
function isImageMimeType(mimeType) {
|
|
4602
4919
|
return mimeType === "image/png" || mimeType === "image/jpeg";
|
|
@@ -521,8 +521,8 @@ var mutationCache = __webpack_require__(56752);
|
|
|
521
521
|
var QueryClientProvider = __webpack_require__(32315);
|
|
522
522
|
// EXTERNAL MODULE: ../../node_modules/next-auth/react/index.js
|
|
523
523
|
var next_auth_react = __webpack_require__(16422);
|
|
524
|
-
// EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs +
|
|
525
|
-
var dist = __webpack_require__(
|
|
524
|
+
// EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs + 26 modules
|
|
525
|
+
var dist = __webpack_require__(77135);
|
|
526
526
|
;// __barrel_optimize__?names=EventBusProvider,LiveRegionProvider,SessionProvider,ThemeProvider,ToastProvider,TranslationProvider,dispatch401Error,dispatch403Error!=!../../packages/react-ui/dist/index.mjs
|
|
527
527
|
|
|
528
528
|
|
|
@@ -919,7 +919,7 @@ Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_re
|
|
|
919
919
|
;
|
|
920
920
|
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 74774));
|
|
921
921
|
;
|
|
922
|
-
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
922
|
+
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77135));
|
|
923
923
|
|
|
924
924
|
|
|
925
925
|
/***/ }),
|
|
@@ -1466,7 +1466,7 @@ function CookieBanner({ className = '' }) {
|
|
|
1466
1466
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1467
1467
|
/* harmony export */ C$z: () => (/* reexport safe */ _home_runner_work_semiont_semiont_packages_react_ui_dist_index_mjs__WEBPACK_IMPORTED_MODULE_0__.useEventSubscriptions)
|
|
1468
1468
|
/* harmony export */ });
|
|
1469
|
-
/* harmony import */ var _home_runner_work_semiont_semiont_packages_react_ui_dist_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1469
|
+
/* harmony import */ var _home_runner_work_semiont_semiont_packages_react_ui_dist_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77135);
|
|
1470
1470
|
|
|
1471
1471
|
|
|
1472
1472
|
|
|
@@ -1916,8 +1916,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1916
1916
|
|
|
1917
1917
|
// EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js
|
|
1918
1918
|
var react_jsx_runtime = __webpack_require__(78157);
|
|
1919
|
-
// EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs +
|
|
1920
|
-
var dist = __webpack_require__(
|
|
1919
|
+
// EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs + 26 modules
|
|
1920
|
+
var dist = __webpack_require__(77135);
|
|
1921
1921
|
;// __barrel_optimize__?names=SessionExpiryBanner!=!../../packages/react-ui/dist/index.mjs
|
|
1922
1922
|
|
|
1923
1923
|
|
|
@@ -2304,8 +2304,8 @@ var react_jsx_runtime = __webpack_require__(78157);
|
|
|
2304
2304
|
var react = __webpack_require__(31768);
|
|
2305
2305
|
// EXTERNAL MODULE: ./src/i18n/routing.ts
|
|
2306
2306
|
var routing = __webpack_require__(1915);
|
|
2307
|
-
// EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs +
|
|
2308
|
-
var dist = __webpack_require__(
|
|
2307
|
+
// EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs + 26 modules
|
|
2308
|
+
var dist = __webpack_require__(77135);
|
|
2309
2309
|
;// __barrel_optimize__?names=KeyboardShortcutsHelpModal,useDoubleKeyPress,useKeyboardShortcuts!=!../../packages/react-ui/dist/index.mjs
|
|
2310
2310
|
|
|
2311
2311
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-
|
|
1
|
+
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-7f20ed511021701e.js","static/chunks/87c73c54-dd8d81ac9604067c.js","static/chunks/common-44c6928277b056bb.js","static/css/9ed9607bad31b45e.css","static/chunks/vendors-a5e886395f8b2478.js","static/chunks/main-app-4616290e0bdaf4ae.js"],rootMainFilesTree:{},pages:{"/_app":["static/chunks/webpack-7f20ed511021701e.js","static/chunks/framework-18f3d10fd924e320.js","static/chunks/common-44c6928277b056bb.js","static/css/9ed9607bad31b45e.css","static/chunks/vendors-a5e886395f8b2478.js","static/chunks/main-ab9ca449301de589.js","static/chunks/pages/_app-a1bdb3b9c991da72.js"],"/_error":["static/chunks/webpack-7f20ed511021701e.js","static/chunks/framework-18f3d10fd924e320.js","static/chunks/common-44c6928277b056bb.js","static/css/9ed9607bad31b45e.css","static/chunks/vendors-a5e886395f8b2478.js","static/chunks/main-ab9ca449301de589.js","static/chunks/pages/_error-53edfee0a59cc01e.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
|