@ghentcdh/annotation-api 0.0.1-alpha.25 → 0.0.1-alpha.27
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/index.cjs +21 -41
- package/index.js +21 -41
- package/lib/annotation-namespace.controller.d.ts +3 -4
- package/lib/context/annotation-context.service.d.ts +2 -2
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -6,10 +6,9 @@ let _ghentcdh_crouton_core = require("@ghentcdh/crouton-core");
|
|
|
6
6
|
let _ghentcdh_annotated_text = require("@ghentcdh/annotated-text");
|
|
7
7
|
let _ghentcdh_crouton_api = require("@ghentcdh/crouton-api");
|
|
8
8
|
let _nestjs_swagger = require("@nestjs/swagger");
|
|
9
|
-
|
|
9
|
+
// src/lib/annotation/annotation.repository.ts
|
|
10
10
|
var AnnotationCrudRepository = class {};
|
|
11
|
-
|
|
12
|
-
//#region ../annotation-core/src/lib/types/source.model.ts
|
|
11
|
+
// ../annotation-core/src/lib/types/source.model.ts
|
|
13
12
|
var SourceTypesList = ["text"];
|
|
14
13
|
var SourceTextSchema = zod.z.object({
|
|
15
14
|
text: zod.z.string(),
|
|
@@ -24,8 +23,7 @@ var SourceModelSchema = zod.z.object({
|
|
|
24
23
|
type: zod.z.enum(SourceTypesList),
|
|
25
24
|
content: SourceTextSchema
|
|
26
25
|
});
|
|
27
|
-
|
|
28
|
-
//#region ../annotation-core/src/lib/types/grid-layout.types.ts
|
|
26
|
+
// ../annotation-core/src/lib/types/grid-layout.types.ts
|
|
29
27
|
/** Computed CSS styles for the grid container */
|
|
30
28
|
var buildGridStyle = (layout) => {
|
|
31
29
|
const templateAreas = layout.areas.map((row) => `"${row.join(" ")}"`).join(" ");
|
|
@@ -41,8 +39,7 @@ var buildGridStyle = (layout) => {
|
|
|
41
39
|
var getPaneArea = (layout, sourceId) => {
|
|
42
40
|
return layout.panes.find((p) => p.sourceId === sourceId)?.area;
|
|
43
41
|
};
|
|
44
|
-
|
|
45
|
-
//#region ../annotation-core/src/lib/utils/annotation.context-builder.ts
|
|
42
|
+
// ../annotation-core/src/lib/utils/annotation.context-builder.ts
|
|
46
43
|
var defaultConfig = {
|
|
47
44
|
baseUrl: "http://localhost:3333/",
|
|
48
45
|
crudController: "annotation/annotation",
|
|
@@ -71,8 +68,7 @@ var baseContextBuilder = (id, config) => {
|
|
|
71
68
|
const metaData = AnnotationMetadataType;
|
|
72
69
|
return (0, _ghentcdh_w3c_utils.contextBuilder)(prefix, baseUrl).setType(prefix, metaData).addPrefix(id, `${prefix}:${id}`).setContextUri(`${contextUrl}${id}.jsonld`);
|
|
73
70
|
};
|
|
74
|
-
|
|
75
|
-
//#region ../annotation-core/src/lib/types/annotation.contex.ts
|
|
71
|
+
// ../annotation-core/src/lib/types/annotation.contex.ts
|
|
76
72
|
var AnnotationMetadataType = "AnnotationMetadata";
|
|
77
73
|
var createAnnotationContext = (annotationDefConfig, resource) => {
|
|
78
74
|
const formView = resource.views?.["form"];
|
|
@@ -97,8 +93,7 @@ var createAnnotationContext = (annotationDefConfig, resource) => {
|
|
|
97
93
|
var buildPrefix = (annotationDefConfig, resource) => {
|
|
98
94
|
return `${annotationDefConfig.prefix}:${resource.annotation.type}/`;
|
|
99
95
|
};
|
|
100
|
-
|
|
101
|
-
//#region ../annotation-core/src/lib/types/version.ts
|
|
96
|
+
// ../annotation-core/src/lib/types/version.ts
|
|
102
97
|
/**
|
|
103
98
|
* resource.json schema versioning.
|
|
104
99
|
*
|
|
@@ -120,8 +115,7 @@ var BASELINE_RESOURCE_VERSION = 1;
|
|
|
120
115
|
* shape changes, and add a migration step (`from: N, to: N + 1`) in `./migrations`.
|
|
121
116
|
*/
|
|
122
117
|
var CURRENT_RESOURCE_VERSION = 1;
|
|
123
|
-
|
|
124
|
-
//#region ../annotation-core/src/lib/types/annotation-json-config.types.ts
|
|
118
|
+
// ../annotation-core/src/lib/types/annotation-json-config.types.ts
|
|
125
119
|
var AnnotationTargetEnum = zod.z.enum([
|
|
126
120
|
"gutter",
|
|
127
121
|
"underline",
|
|
@@ -151,8 +145,7 @@ var AnnotationJsonResourceSchema = AnnotationJsonResourceShape.transform((obj) =
|
|
|
151
145
|
...obj
|
|
152
146
|
};
|
|
153
147
|
});
|
|
154
|
-
|
|
155
|
-
//#region ../annotation-core/src/lib/types/annotation-definition.type.ts
|
|
148
|
+
// ../annotation-core/src/lib/types/annotation-definition.type.ts
|
|
156
149
|
var annotationColumnDefinition = zod.z.custom();
|
|
157
150
|
var { id, name, title, operations } = AnnotationJsonResourceShape.shape;
|
|
158
151
|
var AnnotationResourceSchema = zod.z.object({
|
|
@@ -164,8 +157,7 @@ var AnnotationResourceSchema = zod.z.object({
|
|
|
164
157
|
context: zod.z.custom(() => true).optional().nullish(),
|
|
165
158
|
schemas: zod.z.record(zod.z.string(), _ghentcdh_crouton_core.ViewConfigSchema.partial()).optional().nullish()
|
|
166
159
|
});
|
|
167
|
-
|
|
168
|
-
//#region ../annotation-core/src/lib/annotation.style.ts
|
|
160
|
+
// ../annotation-core/src/lib/annotation.style.ts
|
|
169
161
|
var CONTEXT = "annotation.style";
|
|
170
162
|
var AnnotationStyleSchema = zod.z.object({
|
|
171
163
|
id: zod.z.string(),
|
|
@@ -194,31 +186,26 @@ var createAnnotationStyleBodyUnsafe = (annotationConfig, style) => {
|
|
|
194
186
|
}
|
|
195
187
|
return parsed;
|
|
196
188
|
};
|
|
197
|
-
|
|
198
|
-
//#region src/lib/utils/annotation.context-builder.ts
|
|
189
|
+
// src/lib/utils/annotation.context-builder.ts
|
|
199
190
|
var ANNOTATION_DEF_CONFIG_TOKEN = Symbol("ANNOTATION_DEF_CONFIG_TOKEN");
|
|
200
|
-
|
|
201
|
-
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorateMetadata.js
|
|
191
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateMetadata.js
|
|
202
192
|
function __decorateMetadata(k, v) {
|
|
203
193
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
204
194
|
}
|
|
205
|
-
|
|
206
|
-
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorateParam.js
|
|
195
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
207
196
|
function __decorateParam(paramIndex, decorator) {
|
|
208
197
|
return function(target, key) {
|
|
209
198
|
decorator(target, key, paramIndex);
|
|
210
199
|
};
|
|
211
200
|
}
|
|
212
|
-
|
|
213
|
-
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorate.js
|
|
201
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
214
202
|
function __decorate(decorators, target, key, desc) {
|
|
215
203
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
216
204
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
217
205
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
218
206
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
219
207
|
}
|
|
220
|
-
|
|
221
|
-
//#region src/lib/context/annotation-context.service.ts
|
|
208
|
+
// src/lib/context/annotation-context.service.ts
|
|
222
209
|
var AnnotationContextService = class AnnotationContextService {
|
|
223
210
|
configRegistry;
|
|
224
211
|
annotationDefConfig;
|
|
@@ -230,7 +217,7 @@ var AnnotationContextService = class AnnotationContextService {
|
|
|
230
217
|
}
|
|
231
218
|
async reloadAll() {
|
|
232
219
|
this.contextConfigMap.clear();
|
|
233
|
-
this.configRegistry.
|
|
220
|
+
(await this.configRegistry.getAll()).forEach((resource) => {
|
|
234
221
|
const context = createAnnotationContext(this.annotationDefConfig, resource);
|
|
235
222
|
this.contextConfigMap.set(resource.id, context);
|
|
236
223
|
this.prefixMap.set(context.prefix, resource.id);
|
|
@@ -256,8 +243,7 @@ AnnotationContextService = __decorate([
|
|
|
256
243
|
__decorateParam(1, (0, _nestjs_common.Inject)(ANNOTATION_DEF_CONFIG_TOKEN)),
|
|
257
244
|
__decorateMetadata("design:paramtypes", [typeof _ghentcdh_crouton_api.ResourceConfigRegistry === "undefined" ? Object : _ghentcdh_crouton_api.ResourceConfigRegistry, Object])
|
|
258
245
|
], AnnotationContextService);
|
|
259
|
-
|
|
260
|
-
//#region src/lib/annotation/annotation.mapper.service.ts
|
|
246
|
+
// src/lib/annotation/annotation.mapper.service.ts
|
|
261
247
|
var AnnotationW3cMapperService = class AnnotationW3cMapperService {
|
|
262
248
|
contextService;
|
|
263
249
|
constructor(contextService) {
|
|
@@ -273,11 +259,9 @@ var AnnotationW3cMapperService = class AnnotationW3cMapperService {
|
|
|
273
259
|
}
|
|
274
260
|
};
|
|
275
261
|
AnnotationW3cMapperService = __decorate([__decorateParam(0, (0, _nestjs_common.Inject)(AnnotationContextService)), __decorateMetadata("design:paramtypes", [typeof AnnotationContextService === "undefined" ? Object : AnnotationContextService])], AnnotationW3cMapperService);
|
|
276
|
-
|
|
277
|
-
//#region src/lib/prefix.ts
|
|
262
|
+
// src/lib/prefix.ts
|
|
278
263
|
var SCHEMA_PREFIX = "annotation-editor";
|
|
279
|
-
|
|
280
|
-
//#region src/lib/annotation-namespace.controller.ts
|
|
264
|
+
// src/lib/annotation-namespace.controller.ts
|
|
281
265
|
var AnnotationNamespaceController = class AnnotationNamespaceController {
|
|
282
266
|
service;
|
|
283
267
|
annotationContextService;
|
|
@@ -319,8 +303,7 @@ AnnotationNamespaceController = __decorate([
|
|
|
319
303
|
__decorateParam(1, (0, _nestjs_common.Inject)(ANNOTATION_DEF_CONFIG_TOKEN)),
|
|
320
304
|
__decorateMetadata("design:paramtypes", [typeof _ghentcdh_crouton_api.ResourceConfigRegistry === "undefined" ? Object : _ghentcdh_crouton_api.ResourceConfigRegistry, Object])
|
|
321
305
|
], AnnotationNamespaceController);
|
|
322
|
-
|
|
323
|
-
//#region src/lib/annotation/annotation.controller.ts
|
|
306
|
+
// src/lib/annotation/annotation.controller.ts
|
|
324
307
|
var AnnotationController = class AnnotationController {
|
|
325
308
|
annotationRepository;
|
|
326
309
|
wrapper;
|
|
@@ -476,8 +459,7 @@ AnnotationController = __decorate([
|
|
|
476
459
|
typeof AnnotationContextService === "undefined" ? Object : AnnotationContextService
|
|
477
460
|
])
|
|
478
461
|
], AnnotationController);
|
|
479
|
-
|
|
480
|
-
//#region src/lib/utils/schemaEnricher.utils.ts
|
|
462
|
+
// src/lib/utils/schemaEnricher.utils.ts
|
|
481
463
|
var createSchemaEnricher = (baseUrl = "") => (schema) => {
|
|
482
464
|
const uri = `${baseUrl}${SCHEMA_PREFIX}/annotation/${schema.route}`;
|
|
483
465
|
const uriId = `${uri}/{id}`;
|
|
@@ -502,8 +484,7 @@ var createSchemaEnricher = (baseUrl = "") => (schema) => {
|
|
|
502
484
|
};
|
|
503
485
|
return { ...schema };
|
|
504
486
|
};
|
|
505
|
-
|
|
506
|
-
//#region src/lib/annotation-api.module.ts
|
|
487
|
+
// src/lib/annotation-api.module.ts
|
|
507
488
|
var _AnnotationApiModule;
|
|
508
489
|
(0, _ghentcdh_crouton_core.registerResourceExtensions)({ annotation: AnnotationConfigSchema });
|
|
509
490
|
var AnnotationApiModule = _AnnotationApiModule = class AnnotationApiModule {
|
|
@@ -555,7 +536,6 @@ AnnotationApiModule = _AnnotationApiModule = __decorate([(0, _nestjs_common.Modu
|
|
|
555
536
|
providers: [],
|
|
556
537
|
exports: []
|
|
557
538
|
})], AnnotationApiModule);
|
|
558
|
-
//#endregion
|
|
559
539
|
Object.defineProperty(exports, "AnnotationApiModule", {
|
|
560
540
|
enumerable: true,
|
|
561
541
|
get: function() {
|
package/index.js
CHANGED
|
@@ -5,10 +5,9 @@ import { JsonOperationsSchema, ResourceJsonShape, ViewConfigSchema, labelFromId,
|
|
|
5
5
|
import { Debugger } from "@ghentcdh/annotated-text";
|
|
6
6
|
import { CroutonApiModule, ResourceConfigRegistry } from "@ghentcdh/crouton-api";
|
|
7
7
|
import { ApiBody, ApiOperation, ApiParam, ApiResponse, ApiTags } from "@nestjs/swagger";
|
|
8
|
-
|
|
8
|
+
// src/lib/annotation/annotation.repository.ts
|
|
9
9
|
var AnnotationCrudRepository = class {};
|
|
10
|
-
|
|
11
|
-
//#region ../annotation-core/src/lib/types/source.model.ts
|
|
10
|
+
// ../annotation-core/src/lib/types/source.model.ts
|
|
12
11
|
var SourceTypesList = ["text"];
|
|
13
12
|
var SourceTextSchema = z.object({
|
|
14
13
|
text: z.string(),
|
|
@@ -23,8 +22,7 @@ var SourceModelSchema = z.object({
|
|
|
23
22
|
type: z.enum(SourceTypesList),
|
|
24
23
|
content: SourceTextSchema
|
|
25
24
|
});
|
|
26
|
-
|
|
27
|
-
//#region ../annotation-core/src/lib/types/grid-layout.types.ts
|
|
25
|
+
// ../annotation-core/src/lib/types/grid-layout.types.ts
|
|
28
26
|
/** Computed CSS styles for the grid container */
|
|
29
27
|
var buildGridStyle = (layout) => {
|
|
30
28
|
const templateAreas = layout.areas.map((row) => `"${row.join(" ")}"`).join(" ");
|
|
@@ -40,8 +38,7 @@ var buildGridStyle = (layout) => {
|
|
|
40
38
|
var getPaneArea = (layout, sourceId) => {
|
|
41
39
|
return layout.panes.find((p) => p.sourceId === sourceId)?.area;
|
|
42
40
|
};
|
|
43
|
-
|
|
44
|
-
//#region ../annotation-core/src/lib/utils/annotation.context-builder.ts
|
|
41
|
+
// ../annotation-core/src/lib/utils/annotation.context-builder.ts
|
|
45
42
|
var defaultConfig = {
|
|
46
43
|
baseUrl: "http://localhost:3333/",
|
|
47
44
|
crudController: "annotation/annotation",
|
|
@@ -70,8 +67,7 @@ var baseContextBuilder = (id, config) => {
|
|
|
70
67
|
const metaData = AnnotationMetadataType;
|
|
71
68
|
return contextBuilder(prefix, baseUrl).setType(prefix, metaData).addPrefix(id, `${prefix}:${id}`).setContextUri(`${contextUrl}${id}.jsonld`);
|
|
72
69
|
};
|
|
73
|
-
|
|
74
|
-
//#region ../annotation-core/src/lib/types/annotation.contex.ts
|
|
70
|
+
// ../annotation-core/src/lib/types/annotation.contex.ts
|
|
75
71
|
var AnnotationMetadataType = "AnnotationMetadata";
|
|
76
72
|
var createAnnotationContext = (annotationDefConfig, resource) => {
|
|
77
73
|
const formView = resource.views?.["form"];
|
|
@@ -96,8 +92,7 @@ var createAnnotationContext = (annotationDefConfig, resource) => {
|
|
|
96
92
|
var buildPrefix = (annotationDefConfig, resource) => {
|
|
97
93
|
return `${annotationDefConfig.prefix}:${resource.annotation.type}/`;
|
|
98
94
|
};
|
|
99
|
-
|
|
100
|
-
//#region ../annotation-core/src/lib/types/version.ts
|
|
95
|
+
// ../annotation-core/src/lib/types/version.ts
|
|
101
96
|
/**
|
|
102
97
|
* resource.json schema versioning.
|
|
103
98
|
*
|
|
@@ -119,8 +114,7 @@ var BASELINE_RESOURCE_VERSION = 1;
|
|
|
119
114
|
* shape changes, and add a migration step (`from: N, to: N + 1`) in `./migrations`.
|
|
120
115
|
*/
|
|
121
116
|
var CURRENT_RESOURCE_VERSION = 1;
|
|
122
|
-
|
|
123
|
-
//#region ../annotation-core/src/lib/types/annotation-json-config.types.ts
|
|
117
|
+
// ../annotation-core/src/lib/types/annotation-json-config.types.ts
|
|
124
118
|
var AnnotationTargetEnum = z.enum([
|
|
125
119
|
"gutter",
|
|
126
120
|
"underline",
|
|
@@ -150,8 +144,7 @@ var AnnotationJsonResourceSchema = AnnotationJsonResourceShape.transform((obj) =
|
|
|
150
144
|
...obj
|
|
151
145
|
};
|
|
152
146
|
});
|
|
153
|
-
|
|
154
|
-
//#region ../annotation-core/src/lib/types/annotation-definition.type.ts
|
|
147
|
+
// ../annotation-core/src/lib/types/annotation-definition.type.ts
|
|
155
148
|
var annotationColumnDefinition = z.custom();
|
|
156
149
|
var { id, name, title, operations } = AnnotationJsonResourceShape.shape;
|
|
157
150
|
var AnnotationResourceSchema = z.object({
|
|
@@ -163,8 +156,7 @@ var AnnotationResourceSchema = z.object({
|
|
|
163
156
|
context: z.custom(() => true).optional().nullish(),
|
|
164
157
|
schemas: z.record(z.string(), ViewConfigSchema.partial()).optional().nullish()
|
|
165
158
|
});
|
|
166
|
-
|
|
167
|
-
//#region ../annotation-core/src/lib/annotation.style.ts
|
|
159
|
+
// ../annotation-core/src/lib/annotation.style.ts
|
|
168
160
|
var CONTEXT = "annotation.style";
|
|
169
161
|
var AnnotationStyleSchema = z.object({
|
|
170
162
|
id: z.string(),
|
|
@@ -193,31 +185,26 @@ var createAnnotationStyleBodyUnsafe = (annotationConfig, style) => {
|
|
|
193
185
|
}
|
|
194
186
|
return parsed;
|
|
195
187
|
};
|
|
196
|
-
|
|
197
|
-
//#region src/lib/utils/annotation.context-builder.ts
|
|
188
|
+
// src/lib/utils/annotation.context-builder.ts
|
|
198
189
|
var ANNOTATION_DEF_CONFIG_TOKEN = Symbol("ANNOTATION_DEF_CONFIG_TOKEN");
|
|
199
|
-
|
|
200
|
-
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorateMetadata.js
|
|
190
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateMetadata.js
|
|
201
191
|
function __decorateMetadata(k, v) {
|
|
202
192
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
203
193
|
}
|
|
204
|
-
|
|
205
|
-
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorateParam.js
|
|
194
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
206
195
|
function __decorateParam(paramIndex, decorator) {
|
|
207
196
|
return function(target, key) {
|
|
208
197
|
decorator(target, key, paramIndex);
|
|
209
198
|
};
|
|
210
199
|
}
|
|
211
|
-
|
|
212
|
-
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorate.js
|
|
200
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
213
201
|
function __decorate(decorators, target, key, desc) {
|
|
214
202
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
215
203
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
216
204
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
217
205
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
218
206
|
}
|
|
219
|
-
|
|
220
|
-
//#region src/lib/context/annotation-context.service.ts
|
|
207
|
+
// src/lib/context/annotation-context.service.ts
|
|
221
208
|
var AnnotationContextService = class AnnotationContextService {
|
|
222
209
|
configRegistry;
|
|
223
210
|
annotationDefConfig;
|
|
@@ -229,7 +216,7 @@ var AnnotationContextService = class AnnotationContextService {
|
|
|
229
216
|
}
|
|
230
217
|
async reloadAll() {
|
|
231
218
|
this.contextConfigMap.clear();
|
|
232
|
-
this.configRegistry.
|
|
219
|
+
(await this.configRegistry.getAll()).forEach((resource) => {
|
|
233
220
|
const context = createAnnotationContext(this.annotationDefConfig, resource);
|
|
234
221
|
this.contextConfigMap.set(resource.id, context);
|
|
235
222
|
this.prefixMap.set(context.prefix, resource.id);
|
|
@@ -255,8 +242,7 @@ AnnotationContextService = __decorate([
|
|
|
255
242
|
__decorateParam(1, Inject(ANNOTATION_DEF_CONFIG_TOKEN)),
|
|
256
243
|
__decorateMetadata("design:paramtypes", [typeof ResourceConfigRegistry === "undefined" ? Object : ResourceConfigRegistry, Object])
|
|
257
244
|
], AnnotationContextService);
|
|
258
|
-
|
|
259
|
-
//#region src/lib/annotation/annotation.mapper.service.ts
|
|
245
|
+
// src/lib/annotation/annotation.mapper.service.ts
|
|
260
246
|
var AnnotationW3cMapperService = class AnnotationW3cMapperService {
|
|
261
247
|
contextService;
|
|
262
248
|
constructor(contextService) {
|
|
@@ -272,11 +258,9 @@ var AnnotationW3cMapperService = class AnnotationW3cMapperService {
|
|
|
272
258
|
}
|
|
273
259
|
};
|
|
274
260
|
AnnotationW3cMapperService = __decorate([__decorateParam(0, Inject(AnnotationContextService)), __decorateMetadata("design:paramtypes", [typeof AnnotationContextService === "undefined" ? Object : AnnotationContextService])], AnnotationW3cMapperService);
|
|
275
|
-
|
|
276
|
-
//#region src/lib/prefix.ts
|
|
261
|
+
// src/lib/prefix.ts
|
|
277
262
|
var SCHEMA_PREFIX = "annotation-editor";
|
|
278
|
-
|
|
279
|
-
//#region src/lib/annotation-namespace.controller.ts
|
|
263
|
+
// src/lib/annotation-namespace.controller.ts
|
|
280
264
|
var AnnotationNamespaceController = class AnnotationNamespaceController {
|
|
281
265
|
service;
|
|
282
266
|
annotationContextService;
|
|
@@ -318,8 +302,7 @@ AnnotationNamespaceController = __decorate([
|
|
|
318
302
|
__decorateParam(1, Inject(ANNOTATION_DEF_CONFIG_TOKEN)),
|
|
319
303
|
__decorateMetadata("design:paramtypes", [typeof ResourceConfigRegistry === "undefined" ? Object : ResourceConfigRegistry, Object])
|
|
320
304
|
], AnnotationNamespaceController);
|
|
321
|
-
|
|
322
|
-
//#region src/lib/annotation/annotation.controller.ts
|
|
305
|
+
// src/lib/annotation/annotation.controller.ts
|
|
323
306
|
var AnnotationController = class AnnotationController {
|
|
324
307
|
annotationRepository;
|
|
325
308
|
wrapper;
|
|
@@ -475,8 +458,7 @@ AnnotationController = __decorate([
|
|
|
475
458
|
typeof AnnotationContextService === "undefined" ? Object : AnnotationContextService
|
|
476
459
|
])
|
|
477
460
|
], AnnotationController);
|
|
478
|
-
|
|
479
|
-
//#region src/lib/utils/schemaEnricher.utils.ts
|
|
461
|
+
// src/lib/utils/schemaEnricher.utils.ts
|
|
480
462
|
var createSchemaEnricher = (baseUrl = "") => (schema) => {
|
|
481
463
|
const uri = `${baseUrl}${SCHEMA_PREFIX}/annotation/${schema.route}`;
|
|
482
464
|
const uriId = `${uri}/{id}`;
|
|
@@ -501,8 +483,7 @@ var createSchemaEnricher = (baseUrl = "") => (schema) => {
|
|
|
501
483
|
};
|
|
502
484
|
return { ...schema };
|
|
503
485
|
};
|
|
504
|
-
|
|
505
|
-
//#region src/lib/annotation-api.module.ts
|
|
486
|
+
// src/lib/annotation-api.module.ts
|
|
506
487
|
var _AnnotationApiModule;
|
|
507
488
|
registerResourceExtensions({ annotation: AnnotationConfigSchema });
|
|
508
489
|
var AnnotationApiModule = _AnnotationApiModule = class AnnotationApiModule {
|
|
@@ -554,5 +535,4 @@ AnnotationApiModule = _AnnotationApiModule = __decorate([Module({
|
|
|
554
535
|
providers: [],
|
|
555
536
|
exports: []
|
|
556
537
|
})], AnnotationApiModule);
|
|
557
|
-
//#endregion
|
|
558
538
|
export { AnnotationApiModule, AnnotationConfigSchema, AnnotationContextService, AnnotationCrudRepository, AnnotationJsonResourceSchema, AnnotationJsonResourceShape, AnnotationMetadataType, AnnotationResourceSchema, AnnotationStyleContextBuilder, AnnotationStyleType, AnnotationW3cMapperService, BASELINE_RESOURCE_VERSION, CURRENT_RESOURCE_VERSION, SourceModelSchema, SourceTextSchema, annotationColumnDefinition, baseContextBuilder, buildGridStyle, buildPrefix, createAnnotationContext, createAnnotationStyleBodyUnsafe, getPaneArea, resolveConfig };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { AnnotationJsonResource } from '@ghentcdh/annotation-core';
|
|
2
1
|
import { ResourceConfigRegistry } from '@ghentcdh/crouton-api';
|
|
3
2
|
import { AnnotationContextService } from './context/annotation-context.service';
|
|
4
3
|
export declare class AnnotationNamespaceController {
|
|
5
4
|
private readonly service;
|
|
6
5
|
private readonly annotationContextService;
|
|
7
|
-
constructor(service: ResourceConfigRegistry<
|
|
6
|
+
constructor(service: ResourceConfigRegistry<any>, annotationContextService: AnnotationContextService);
|
|
8
7
|
listNames(): Promise<{
|
|
9
8
|
annotations: {
|
|
10
|
-
id:
|
|
11
|
-
name:
|
|
9
|
+
id: any;
|
|
10
|
+
name: any;
|
|
12
11
|
schemas: string;
|
|
13
12
|
jsonld: string;
|
|
14
13
|
}[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AnnotationContext, AnnotationDefConfig
|
|
1
|
+
import { AnnotationContext, AnnotationDefConfig } from '@ghentcdh/annotation-core';
|
|
2
2
|
import { ResourceConfigRegistry } from '@ghentcdh/crouton-api';
|
|
3
3
|
export declare class AnnotationContextService {
|
|
4
4
|
private readonly configRegistry;
|
|
5
5
|
private readonly annotationDefConfig;
|
|
6
6
|
private readonly contextConfigMap;
|
|
7
7
|
private readonly prefixMap;
|
|
8
|
-
constructor(configRegistry: ResourceConfigRegistry<
|
|
8
|
+
constructor(configRegistry: ResourceConfigRegistry<any>, annotationDefConfig: AnnotationDefConfig);
|
|
9
9
|
reloadAll(): Promise<void>;
|
|
10
10
|
findById(annotationId: string): Promise<AnnotationContext | null>;
|
|
11
11
|
getResourceIdFromUri: (uri: string) => string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghentcdh/annotation-api",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.27",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/GhentCDH/annotation-editor"
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"@nestjs/common": "^12.0.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ghentcdh/crouton-api": "0.0.1-alpha.
|
|
16
|
+
"@ghentcdh/crouton-api": "0.0.1-alpha.89"
|
|
17
17
|
}
|
|
18
18
|
}
|