@open-resource-discovery/metadata-renderer 1.0.0 → 1.0.1

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/dist/index.js CHANGED
@@ -1,11 +1,33 @@
1
1
  import { i as loadObject, n as detectMetaType, r as extractVersion } from "./chunks/utils-BC3WF3-9.js";
2
- import { n as sapOpenApiAttributesConfig, t as OpenApiRenderer } from "./chunks/openApi-Ccp9Pa_k.js";
3
- import { n as sapCsnAttributesConfig, t as CsnRenderer } from "./chunks/csn-D4GBs8tC.js";
4
- import { n as sapAsyncApiAttributesConfig, t as AsyncApiRenderer } from "./chunks/asyncApi-K0uQpQwz.js";
2
+ import { n as attributeLink, t as OpenApiRenderer } from "./chunks/openApi-BTb5yzun.js";
3
+ import { t as CsnRenderer } from "./chunks/csn-3ek2O4d6.js";
4
+ import { n as AttributeLink, t as AsyncApiRenderer } from "./chunks/asyncApi-DtAXW7IY.js";
5
5
  import { t as A2ARenderer } from "./chunks/a2a-B5lkgqLU.js";
6
6
  import { t as McpRenderer } from "./chunks/mcp-qA5sYRAN.js";
7
- import { useMemo } from "react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { useMemo, useState } from "react";
8
+ import Markdown from "react-markdown";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/lib/core/dispatch.ts
11
+ function buildRendererExtraProps(metaType, options) {
12
+ const extraProps = {};
13
+ const customAttributes = options?.customAttributes;
14
+ const ca = customAttributes !== false ? customAttributes : void 0;
15
+ if (metaType === "openapi") {
16
+ if (ca?.openapi) extraProps.customAttributes = ca.openapi;
17
+ }
18
+ if (metaType === "asyncapi") {
19
+ if (options?.asyncapi) Object.assign(extraProps, { config: options.asyncapi });
20
+ if (ca?.asyncapi) extraProps.customAttributes = ca.asyncapi;
21
+ }
22
+ if (metaType === "csn") {
23
+ if (options?.csn) Object.assign(extraProps, { config: options.csn });
24
+ if (ca?.csn) extraProps.customAttributes = ca.csn;
25
+ }
26
+ if (metaType === "a2a" && options?.a2a) Object.assign(extraProps, options.a2a);
27
+ if (metaType === "mcp" && options?.mcp) Object.assign(extraProps, options.mcp);
28
+ return extraProps;
29
+ }
30
+ //#endregion
9
31
  //#region src/lib/core/index.tsx
10
32
  var DEFAULT_RENDERERS = {
11
33
  openapi: OpenApiRenderer,
@@ -59,31 +81,13 @@ function MetadataRenderer({ content, renderers, options, type, className, theme
59
81
  "’ was specified."
60
82
  ]
61
83
  });
62
- } else if (RendererComponent) {
63
- const extraProps = {};
64
- if (metaType === "openapi") {
65
- if (options?.customAttributes === false || options?.showSAPCustomFields === false) extraProps.showCustomAttributes = false;
66
- else if (options?.customAttributes?.openapi) extraProps.customAttributes = options.customAttributes.openapi;
67
- }
68
- if (metaType === "asyncapi") {
69
- if (options?.asyncapi) Object.assign(extraProps, { config: options.asyncapi });
70
- if (options?.customAttributes === false) extraProps.showCustomAttributes = false;
71
- else if (options?.customAttributes?.asyncapi) extraProps.customAttributes = options.customAttributes.asyncapi;
72
- }
73
- if (metaType === "csn") {
74
- if (options?.csn) Object.assign(extraProps, { config: options.csn });
75
- if (options?.customAttributes === false) extraProps.showCustomAttributes = false;
76
- else if (options?.customAttributes?.csn) extraProps.customAttributes = options.customAttributes.csn;
77
- }
78
- if (metaType === "a2a" && options?.a2a) Object.assign(extraProps, options.a2a);
79
- if (metaType === "mcp" && options?.mcp) Object.assign(extraProps, options.mcp);
80
- renderer = /* @__PURE__ */ jsx(RendererComponent, {
81
- content,
82
- className,
83
- theme,
84
- ...extraProps
85
- });
86
- } else if (options?.fallback === "raw") renderer = /* @__PURE__ */ jsx("pre", {
84
+ } else if (RendererComponent) renderer = /* @__PURE__ */ jsx(RendererComponent, {
85
+ content,
86
+ className,
87
+ theme,
88
+ ...buildRendererExtraProps(metaType, options)
89
+ });
90
+ else if (options?.fallback === "raw") renderer = /* @__PURE__ */ jsx("pre", {
87
91
  style: {
88
92
  margin: 0,
89
93
  padding: 16,
@@ -163,4 +167,617 @@ function createTheme(tokens) {
163
167
  return result;
164
168
  }
165
169
  //#endregion
170
+ //#region src/lib/openApi/customAttributes/sapAttributes/root/typeCheckXxtOverview.ts
171
+ function typeCheckExSapExtOverviewExSapExtOverview(obj) {
172
+ if (typeof obj !== "object" || obj === null) return false;
173
+ if (!("xSapExtOverview" in obj) || !Array.isArray(obj.xSapExtOverview)) return false;
174
+ return obj.xSapExtOverview.every((xSapExtOverview) => {
175
+ if (typeof xSapExtOverview !== "object" || xSapExtOverview === null) return false;
176
+ if (!("name" in xSapExtOverview) || !("values" in xSapExtOverview)) return false;
177
+ if (typeof xSapExtOverview.name !== "string") return false;
178
+ if (typeof xSapExtOverview.values === "string") return true;
179
+ if (!Array.isArray(xSapExtOverview.values)) return false;
180
+ if (xSapExtOverview.values.every((value) => typeof value === "string")) return true;
181
+ return xSapExtOverview.values.every((value) => {
182
+ if (typeof value !== "object" || value === null) return false;
183
+ if (!("text" in value) || typeof value.text !== "string") return false;
184
+ return "format" in value && (value.format === "plain" || value.format === "markdown");
185
+ });
186
+ });
187
+ }
188
+ //#endregion
189
+ //#region src/lib/openApi/customAttributes/sapAttributes/root/extOverview.tsx
190
+ function extOverview(props) {
191
+ if (!typeCheckExSapExtOverviewExSapExtOverview(props)) return null;
192
+ const { xSapExtOverview } = props;
193
+ return /* @__PURE__ */ jsxs("div", {
194
+ className: "sap-api-container",
195
+ children: [/* @__PURE__ */ jsxs("div", {
196
+ className: "sap-api-label sap-api-label--root",
197
+ children: ["SAP Extensibility Overview ", /* @__PURE__ */ jsx(attributeLink, { attributeName: "x-sap-ext-overview" })]
198
+ }), /* @__PURE__ */ jsx("div", {
199
+ className: "sap-api-value sap-api-value--root",
200
+ children: xSapExtOverview.map((extension) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: extension.name }), /* @__PURE__ */ jsx("ul", {
201
+ className: "sap-api-list",
202
+ children: typeof extension.values === "string" ? /* @__PURE__ */ jsx("li", { children: extension.values }) : extension.values.map((value) => typeof value === "string" ? /* @__PURE__ */ jsx("li", { children: value }, value) : /* @__PURE__ */ jsx("li", { children: value.format === "plain" ? value.text : /* @__PURE__ */ jsx(Markdown, { children: value.text }) }, value.text))
203
+ })] }, extension.name))
204
+ })]
205
+ });
206
+ }
207
+ //#endregion
208
+ //#region src/lib/openApi/customAttributes/sapAttributes/root/stateInfo.tsx
209
+ var background$1 = {
210
+ ACTIVE: "color-mix(in srgb, var(--scalar-color-green) 15%, transparent)",
211
+ BETA: "color-mix(in srgb, var(--scalar-color-blue) 15%, transparent)",
212
+ DEPRECATED: "color-mix(in srgb, var(--scalar-color-orange) 15%, transparent)",
213
+ DECOMMISSIONED: "color-mix(in srgb, var(--scalar-color-red) 15%, transparent)"
214
+ };
215
+ var color$1 = {
216
+ ACTIVE: "var(--scalar-color-green)",
217
+ BETA: "var(--scalar-color-blue)",
218
+ DEPRECATED: "var(--scalar-color-orange)",
219
+ DECOMMISSIONED: "var(--scalar-color-red)"
220
+ };
221
+ function StateInfo({ xSapStateInfo }) {
222
+ if (!xSapStateInfo) return null;
223
+ const status = xSapStateInfo.state?.toUpperCase();
224
+ const badge = /* @__PURE__ */ jsx("span", {
225
+ style: {
226
+ display: "inline-block",
227
+ borderRadius: "10px",
228
+ padding: "0 6px",
229
+ background: background$1[status] || "",
230
+ color: color$1[status] || ""
231
+ },
232
+ children: status
233
+ });
234
+ const dateFormatter = new Intl.DateTimeFormat("en-GB", { dateStyle: "long" });
235
+ const formatDate = (d) => {
236
+ const parsed = new Date(d);
237
+ return isNaN(parsed.getTime()) ? d : dateFormatter.format(parsed);
238
+ };
239
+ return /* @__PURE__ */ jsxs("div", {
240
+ className: "sap-api-container",
241
+ children: [/* @__PURE__ */ jsxs("div", {
242
+ className: "sap-api-label",
243
+ children: ["API State ", /* @__PURE__ */ jsx(attributeLink, { attributeName: "x-sap-stateInfo" })]
244
+ }), /* @__PURE__ */ jsxs("div", {
245
+ className: "sap-api-value",
246
+ children: [
247
+ badge,
248
+ xSapStateInfo.deprecationDate && /* @__PURE__ */ jsxs("div", { children: ["Deprecated on ", formatDate(xSapStateInfo.deprecationDate)] }),
249
+ xSapStateInfo.decommissionedDate && /* @__PURE__ */ jsxs("div", { children: ["Decommissioned on ", formatDate(xSapStateInfo.decommissionedDate)] }),
250
+ xSapStateInfo.successorApi && /* @__PURE__ */ jsxs("div", { children: ["Successor API: ", /* @__PURE__ */ jsx("a", {
251
+ href: xSapStateInfo.successorApi,
252
+ target: "_blank",
253
+ rel: "noreferrer",
254
+ className: "sap-api-link",
255
+ children: xSapStateInfo.successorApi
256
+ })] })
257
+ ]
258
+ })]
259
+ });
260
+ }
261
+ //#endregion
262
+ //#region src/lib/openApi/customAttributes/sapAttributes/root/ordId.tsx
263
+ function CopyIcon() {
264
+ return /* @__PURE__ */ jsxs("svg", {
265
+ viewBox: "0 0 24 24",
266
+ width: "1em",
267
+ height: "1em",
268
+ fill: "none",
269
+ stroke: "currentColor",
270
+ strokeWidth: "2",
271
+ "aria-hidden": "true",
272
+ children: [/* @__PURE__ */ jsx("rect", {
273
+ x: "9",
274
+ y: "9",
275
+ width: "13",
276
+ height: "13",
277
+ rx: "2"
278
+ }), /* @__PURE__ */ jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })]
279
+ });
280
+ }
281
+ function CheckIcon() {
282
+ return /* @__PURE__ */ jsx("svg", {
283
+ viewBox: "0 0 24 24",
284
+ width: "1em",
285
+ height: "1em",
286
+ fill: "none",
287
+ stroke: "currentColor",
288
+ strokeWidth: "2",
289
+ "aria-hidden": "true",
290
+ children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
291
+ });
292
+ }
293
+ function ordId({ xSapOrdId }) {
294
+ const [copied, setCopied] = useState(false);
295
+ if (!xSapOrdId) return null;
296
+ const copy = () => {
297
+ navigator.clipboard?.writeText(xSapOrdId).then(() => {
298
+ setCopied(true);
299
+ setTimeout(() => setCopied(false), 1500);
300
+ });
301
+ };
302
+ return /* @__PURE__ */ jsxs("div", {
303
+ className: "sap-api-container",
304
+ children: [/* @__PURE__ */ jsxs("div", {
305
+ className: "sap-api-label",
306
+ children: ["ORD ID ", /* @__PURE__ */ jsx(attributeLink, { attributeName: "x-sap-ord-id" })]
307
+ }), /* @__PURE__ */ jsxs("div", {
308
+ className: "sap-api-value sap-api-ord-id",
309
+ children: [/* @__PURE__ */ jsx("span", {
310
+ className: "sap-api-ord-id-text",
311
+ children: xSapOrdId
312
+ }), /* @__PURE__ */ jsx("button", {
313
+ type: "button",
314
+ className: "sap-api-copy-btn",
315
+ onClick: copy,
316
+ "aria-label": "Copy ORD ID",
317
+ title: copied ? "Copied" : "Copy",
318
+ children: copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {})
319
+ })]
320
+ })]
321
+ });
322
+ }
323
+ //#endregion
324
+ //#region src/lib/openApi/customAttributes/sapAttributes/operation/deprecatedOperation.tsx
325
+ function deprecatedOperation({ xSapDeprecatedOperation }) {
326
+ const deprecationDate = new Intl.DateTimeFormat("en-GB", { dateStyle: "long" }).format(new Date(xSapDeprecatedOperation.deprecationDate));
327
+ return /* @__PURE__ */ jsxs("div", {
328
+ className: "sap-api-container",
329
+ children: [/* @__PURE__ */ jsxs("div", {
330
+ className: "sap-api-label",
331
+ children: ["SAP Deprecated Operation ", /* @__PURE__ */ jsx(attributeLink, { attributeName: "x-sap-deprecated-operation" })]
332
+ }), /* @__PURE__ */ jsxs("div", {
333
+ className: "sap-api-value",
334
+ children: [
335
+ "Deprecated on ",
336
+ deprecationDate,
337
+ " ",
338
+ /* @__PURE__ */ jsx("br", {}),
339
+ !xSapDeprecatedOperation.successorOperationRef && !xSapDeprecatedOperation.successorOperationId ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
340
+ " Successor ",
341
+ xSapDeprecatedOperation.successorOperationRef ? /* @__PURE__ */ jsx("a", {
342
+ href: xSapDeprecatedOperation.successorOperationRef,
343
+ rel: "noreferrer, noopener",
344
+ children: xSapDeprecatedOperation.successorOperationRef
345
+ }) : null,
346
+ xSapDeprecatedOperation.successorOperationId ? /* @__PURE__ */ jsx("span", { children: xSapDeprecatedOperation.successorOperationId }) : null
347
+ ] })
348
+ ]
349
+ })]
350
+ });
351
+ }
352
+ //#endregion
353
+ //#region src/lib/openApi/customAttributes/sapAttributes/schema/odmEntityName.tsx
354
+ function odmEntityName({ xSapOdmEntityName }) {
355
+ return /* @__PURE__ */ jsxs("div", {
356
+ className: "sap-api-container",
357
+ children: [/* @__PURE__ */ jsxs("div", {
358
+ className: "sap-api-label",
359
+ children: ["ODM entity name ", /* @__PURE__ */ jsx(attributeLink, { attributeName: "x-sap-odm-entity-name" })]
360
+ }), /* @__PURE__ */ jsx("div", {
361
+ className: "sap-api-value",
362
+ children: xSapOdmEntityName
363
+ })]
364
+ });
365
+ }
366
+ //#endregion
367
+ //#region src/lib/openApi/customAttributes/sapAttributes/schema/odmSemanticKey.tsx
368
+ function odmSemanticKey({ xSapOdmSemanticKey }) {
369
+ return /* @__PURE__ */ jsxs("div", {
370
+ className: "sap-api-container",
371
+ children: [/* @__PURE__ */ jsxs("div", {
372
+ className: "sap-api-label",
373
+ children: ["ODM Semantic Key ", /* @__PURE__ */ jsx(attributeLink, { attributeName: "x-sap-odm-semantic-key" })]
374
+ }), /* @__PURE__ */ jsx("div", {
375
+ className: "sap-api-value",
376
+ children: xSapOdmSemanticKey.map((entry) => /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: entry.name }), /* @__PURE__ */ jsx("ul", {
377
+ className: "sap-api-list",
378
+ children: entry.values.map((v) => /* @__PURE__ */ jsx("li", { children: v }, v))
379
+ })] }, entry.name))
380
+ })]
381
+ });
382
+ }
383
+ //#endregion
384
+ //#region src/lib/openApi/customAttributes/sapAttributes/sapPreset.ts
385
+ function component(fn) {
386
+ return { component: fn };
387
+ }
388
+ var sapOpenApiAttributesConfig = {
389
+ prefixStartsWith: "x-sap-",
390
+ documentationUrl: (name, { version }) => `https://github.com/SAP/openapi-specification/tree/main/sap-schemas/v${version}#${name}`,
391
+ extensions: {
392
+ "x-sap-compliance-level": {
393
+ type: "link",
394
+ label: "SAP Compliance Level",
395
+ callback: (v) => {
396
+ return {
397
+ "sap:base:v1": "https://github.com/open-resource-discovery/specification/blob/main/docs/spec-extensions/policy-levels/sap-base-v1.md",
398
+ "sap:core:v1": "https://github.com/open-resource-discovery/specification/blob/main/docs/spec-extensions/policy-levels/sap-core-v1.md",
399
+ "sap:core:v2": "https://github.com/open-resource-discovery/specification/blob/main/docs/spec-extensions/policy-levels/sap-core-v1.md"
400
+ }[String(v)];
401
+ }
402
+ },
403
+ "x-sap-shortText": {
404
+ type: "string",
405
+ label: "SAP Short Text"
406
+ },
407
+ "x-sap-software-min-version": {
408
+ type: "string",
409
+ label: "SAP Software Version"
410
+ },
411
+ "x-sap-api-type": {
412
+ type: "string",
413
+ label: "SAP API Type"
414
+ },
415
+ "x-sap-direction": {
416
+ type: "string",
417
+ label: "SAP Direction"
418
+ },
419
+ "x-sap-ord-id": component(ordId),
420
+ "x-sap-operation-intent": {
421
+ type: "string",
422
+ label: "SAP Operation Intent"
423
+ },
424
+ "x-sap-odm-oid": {
425
+ type: "string",
426
+ label: "ODM OID"
427
+ },
428
+ "x-sap-odm-oid-reference-entity-name": {
429
+ type: "string",
430
+ label: "ODM OID Reference Entity Name"
431
+ },
432
+ "x-sap-precision": {
433
+ type: "number",
434
+ label: "SAP Precision"
435
+ },
436
+ "x-sap-scale": {
437
+ type: "number",
438
+ label: "SAP Scale"
439
+ },
440
+ "x-sap-root-entity": {
441
+ type: "boolean",
442
+ label: "SAP Root Entity"
443
+ },
444
+ "x-sap-dpp-entity-semantics": {
445
+ type: "string",
446
+ label: "SAP DPP: Entity Semantics"
447
+ },
448
+ "x-sap-dpp-data-subject-role": {
449
+ type: "string",
450
+ label: "SAP DPP: Data Subject Role"
451
+ },
452
+ "x-sap-dpp-data-subject-role-description": {
453
+ type: "string",
454
+ label: "SAP DPP: Data Subject Role Description"
455
+ },
456
+ "x-sap-dpp-field-semantics": {
457
+ type: "string",
458
+ label: "SAP DPP: Field Semantics"
459
+ },
460
+ "x-sap-dpp-is-potentially-personal": {
461
+ type: "boolean",
462
+ label: "SAP DPP: Potentially Personal"
463
+ },
464
+ "x-sap-dpp-is-potentially-sensitive": {
465
+ type: "boolean",
466
+ label: "SAP DPP: Potentially Sensitive"
467
+ },
468
+ "x-sap-ext-overview": component(extOverview),
469
+ "x-sap-stateInfo": component(StateInfo),
470
+ "x-sap-extensible": {
471
+ type: "object",
472
+ label: "SAP Extensible"
473
+ },
474
+ "x-sap-deprecated-operation": component(deprecatedOperation),
475
+ "x-sap-odm-entity-name": component(odmEntityName),
476
+ "x-sap-odm-semantic-key": component(odmSemanticKey)
477
+ }
478
+ };
479
+ //#endregion
480
+ //#region src/lib/asyncApi/customAttributes/stateInfo.tsx
481
+ var background = {
482
+ ACTIVE: "color-mix(in srgb, #22c55e 15%, transparent)",
483
+ BETA: "color-mix(in srgb, #3b82f6 15%, transparent)",
484
+ DEPRECATED: "color-mix(in srgb, #f97316 15%, transparent)",
485
+ DECOMMISSIONED: "color-mix(in srgb, #ef4444 15%, transparent)"
486
+ };
487
+ var color = {
488
+ ACTIVE: "#16a34a",
489
+ BETA: "#2563eb",
490
+ DEPRECATED: "#ea580c",
491
+ DECOMMISSIONED: "#dc2626"
492
+ };
493
+ function AsyncApiStateInfo({ propertyName, propertyValue }) {
494
+ if (!propertyValue || typeof propertyValue !== "object") return null;
495
+ const info = propertyValue;
496
+ const status = info.state?.toUpperCase();
497
+ const badge = /* @__PURE__ */ jsx("span", {
498
+ style: {
499
+ display: "inline-block",
500
+ borderRadius: "10px",
501
+ padding: "0 6px",
502
+ background: background[status] || "",
503
+ color: color[status] || ""
504
+ },
505
+ children: status
506
+ });
507
+ const dateFormatter = new Intl.DateTimeFormat("en-GB", { dateStyle: "long" });
508
+ const formatDate = (d) => {
509
+ const parsed = new Date(d);
510
+ return isNaN(parsed.getTime()) ? d : dateFormatter.format(parsed);
511
+ };
512
+ return /* @__PURE__ */ jsxs("div", {
513
+ className: "asyncapi-attr-row",
514
+ children: [/* @__PURE__ */ jsxs("div", {
515
+ className: "asyncapi-attr-label",
516
+ children: ["API State ", /* @__PURE__ */ jsx(AttributeLink, { attributeName: propertyName })]
517
+ }), /* @__PURE__ */ jsxs("div", {
518
+ className: "asyncapi-attr-value",
519
+ children: [
520
+ badge,
521
+ info.deprecationDate && /* @__PURE__ */ jsxs("div", { children: ["Deprecated on ", formatDate(info.deprecationDate)] }),
522
+ info.decommissionedDate && /* @__PURE__ */ jsxs("div", { children: ["Decommissioned on ", formatDate(info.decommissionedDate)] }),
523
+ info.link && /* @__PURE__ */ jsxs("div", { children: ["More info: ", /* @__PURE__ */ jsx("a", {
524
+ href: info.link,
525
+ target: "_blank",
526
+ rel: "noreferrer",
527
+ className: "asyncapi-attr-link",
528
+ children: info.link
529
+ })] })
530
+ ]
531
+ })]
532
+ });
533
+ }
534
+ //#endregion
535
+ //#region src/lib/asyncApi/customAttributes/sapPreset.ts
536
+ var sapAsyncApiAttributesConfig = {
537
+ prefixStartsWith: "x-sap-",
538
+ documentationUrl: (name) => `https://github.com/SAP/asyncapi-specification#${name}`,
539
+ extensions: {
540
+ "x-sap-catalog-spec-version": {
541
+ type: "string",
542
+ label: "SAP Catalog Spec Version"
543
+ },
544
+ "x-sap-application-namespace": {
545
+ type: "string",
546
+ label: "SAP Application Namespace"
547
+ },
548
+ "x-sap-ord-id": {
549
+ type: "string",
550
+ label: "ORD ID"
551
+ },
552
+ "x-sap-shortText": {
553
+ type: "string",
554
+ label: "SAP Short Text"
555
+ },
556
+ "x-sap-software-min-version": {
557
+ type: "string",
558
+ label: "SAP Software Version"
559
+ },
560
+ "x-sap-stateInfo": { component: AsyncApiStateInfo },
561
+ "x-sap-event-spec-version": {
562
+ type: "string",
563
+ label: "SAP Event Spec Version"
564
+ },
565
+ "x-sap-event-source": {
566
+ type: "string",
567
+ label: "SAP Event Source"
568
+ },
569
+ "x-sap-event-source-parameters": {
570
+ type: "object",
571
+ label: "SAP Event Source Parameters"
572
+ },
573
+ "x-sap-event-version": {
574
+ type: "string",
575
+ label: "SAP Event Version"
576
+ },
577
+ "x-sap-event-characteristics": {
578
+ type: "object",
579
+ label: "SAP Event Characteristics"
580
+ },
581
+ "x-sap-object-type": {
582
+ type: "string",
583
+ label: "SAP Object Type"
584
+ },
585
+ "x-sap-odm-version": {
586
+ type: "string",
587
+ label: "SAP ODM Version"
588
+ },
589
+ "x-sap-logical-odm-event-version": {
590
+ type: "string",
591
+ label: "SAP Logical ODM Event Version"
592
+ },
593
+ "x-sap-dpp-entity-semantics": {
594
+ type: "string",
595
+ label: "SAP DPP: Entity Semantics"
596
+ },
597
+ "x-sap-dpp-data-subject-role": {
598
+ type: "string",
599
+ label: "SAP DPP: Data Subject Role"
600
+ },
601
+ "x-sap-dpp-data-subject-role-description": {
602
+ type: "string",
603
+ label: "SAP DPP: Data Subject Role Description"
604
+ },
605
+ "x-sap-dpp-field-semantics": {
606
+ type: "string",
607
+ label: "SAP DPP: Field Semantics"
608
+ },
609
+ "x-sap-dpp-is-potentially-personal": {
610
+ type: "boolean",
611
+ label: "SAP DPP: Potentially Personal"
612
+ },
613
+ "x-sap-dpp-is-potentially-sensitive": {
614
+ type: "boolean",
615
+ label: "SAP DPP: Potentially Sensitive"
616
+ }
617
+ }
618
+ };
619
+ //#endregion
620
+ //#region src/lib/csn/customAttributes/sapPreset.ts
621
+ var sapCsnAttributesConfig = {
622
+ prefixStartsWith: "@",
623
+ annotations: {
624
+ "@EndUserText.label": {
625
+ type: "string",
626
+ label: "End User Text · Label"
627
+ },
628
+ "@EndUserText.heading": {
629
+ type: "string",
630
+ label: "End User Text · Heading"
631
+ },
632
+ "@EndUserText.quickInfo": {
633
+ type: "string",
634
+ label: "End User Text · Quick Info"
635
+ },
636
+ "@ObjectModel.modelingPattern": {
637
+ type: "object",
638
+ label: "Modeling Pattern"
639
+ },
640
+ "@ObjectModel.text.element": {
641
+ type: "array",
642
+ label: "Text Element"
643
+ },
644
+ "@ObjectModel.text.association": {
645
+ type: "object",
646
+ label: "Text Association"
647
+ },
648
+ "@ObjectModel.semanticKey": {
649
+ type: "array",
650
+ label: "Semantic Key"
651
+ },
652
+ "@ObjectModel.representativeKey": {
653
+ type: "object",
654
+ label: "Representative Key"
655
+ },
656
+ "@ObjectModel.compositionRoot": {
657
+ type: "boolean",
658
+ label: "Composition Root"
659
+ },
660
+ "@ObjectModel.supportedCapabilities": {
661
+ type: "array",
662
+ label: "Supported Capabilities"
663
+ },
664
+ "@ObjectModel.usageType.sizeCategory": {
665
+ type: "string",
666
+ label: "Usage Type · Size Category"
667
+ },
668
+ "@ObjectModel.foreignKey.association": {
669
+ type: "object",
670
+ label: "Foreign Key Association"
671
+ },
672
+ "@Consumption.valueHelpDefinition": {
673
+ type: "array",
674
+ label: "Value Help"
675
+ },
676
+ "@Consumption.hidden": {
677
+ type: "boolean",
678
+ label: "Hidden"
679
+ },
680
+ "@PersonalData.entitySemantics": {
681
+ type: "string",
682
+ label: "DPP · Entity Semantics"
683
+ },
684
+ "@PersonalData.dataSubjectRole": {
685
+ type: "string",
686
+ label: "DPP · Data Subject Role"
687
+ },
688
+ "@PersonalData.dataSubjectRoleDescription": {
689
+ type: "string",
690
+ label: "DPP · Data Subject Role Description"
691
+ },
692
+ "@PersonalData.fieldSemantics": {
693
+ type: "string",
694
+ label: "DPP · Field Semantics"
695
+ },
696
+ "@PersonalData.isPotentiallyPersonal": {
697
+ type: "boolean",
698
+ label: "DPP · Potentially Personal"
699
+ },
700
+ "@PersonalData.isPotentiallySensitive": {
701
+ type: "boolean",
702
+ label: "DPP · Potentially Sensitive"
703
+ },
704
+ "@Semantics.currencyCode": {
705
+ type: "boolean",
706
+ label: "Semantics · Currency Code"
707
+ },
708
+ "@Semantics.amount.currencyCode": {
709
+ type: "object",
710
+ label: "Semantics · Amount Currency"
711
+ },
712
+ "@Semantics.unitOfMeasure": {
713
+ type: "boolean",
714
+ label: "Semantics · Unit of Measure"
715
+ },
716
+ "@Semantics.quantity.unitOfMeasure": {
717
+ type: "object",
718
+ label: "Semantics · Quantity Unit"
719
+ },
720
+ "@Semantics.text": {
721
+ type: "boolean",
722
+ label: "Semantics · Text"
723
+ },
724
+ "@Semantics.uuid": {
725
+ type: "boolean",
726
+ label: "Semantics · UUID"
727
+ },
728
+ "@Semantics.language": {
729
+ type: "boolean",
730
+ label: "Semantics · Language"
731
+ },
732
+ "@API.element.releaseState": {
733
+ type: "string",
734
+ label: "API · Element Release State"
735
+ },
736
+ "@API.entity.releaseState": {
737
+ type: "string",
738
+ label: "API · Entity Release State"
739
+ },
740
+ "@ODM.entityName": {
741
+ type: "string",
742
+ label: "ODM · Entity Name"
743
+ },
744
+ "@ODM.oid": {
745
+ type: "string",
746
+ label: "ODM · OID"
747
+ },
748
+ "@ODM.oidReference.entityName": {
749
+ type: "string",
750
+ label: "ODM · OID Reference Entity"
751
+ },
752
+ "@Aggregation.default": {
753
+ type: "object",
754
+ label: "Default Aggregation"
755
+ },
756
+ "@EntityRelationship.entityType": {
757
+ type: "string",
758
+ label: "Entity Relationship · Type"
759
+ },
760
+ "@EntityRelationship.entityIds": {
761
+ type: "array",
762
+ label: "Entity Relationship · IDs"
763
+ },
764
+ "@EntityRelationship.propertyType": {
765
+ type: "string",
766
+ label: "Entity Relationship · Property Type"
767
+ },
768
+ "@EntityRelationship.compositeReferences": {
769
+ type: "array",
770
+ label: "Entity Relationship · Composite References"
771
+ },
772
+ "@EntityRelationship.reference": {
773
+ type: "array",
774
+ label: "Entity Relationship · Reference"
775
+ },
776
+ "@DataIntegration.dataUnavailable": {
777
+ type: "boolean",
778
+ label: "Data Integration · Unavailable"
779
+ }
780
+ }
781
+ };
782
+ //#endregion
166
783
  export { A2ARenderer, AsyncApiRenderer, CsnRenderer, McpRenderer, MetadataRenderer, OpenApiRenderer, createTheme, detectMetaType, extractVersion, loadObject, sapAsyncApiAttributesConfig, sapCsnAttributesConfig, sapOpenApiAttributesConfig };