@manifest-editor/creator-api 1.4.0 → 1.4.2
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.cjs +2 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -190,7 +190,7 @@ function creatorHelper(ctx, parent, property, definition) {
|
|
|
190
190
|
|
|
191
191
|
// src/CreatorResource.ts
|
|
192
192
|
var CreatorResource = class _CreatorResource {
|
|
193
|
-
constructor(
|
|
193
|
+
constructor(inputData, vault) {
|
|
194
194
|
__publicField(this, "resource");
|
|
195
195
|
__publicField(this, "warnings", []);
|
|
196
196
|
__publicField(this, "errors", []);
|
|
@@ -200,6 +200,7 @@ var CreatorResource = class _CreatorResource {
|
|
|
200
200
|
__publicField(this, "vault");
|
|
201
201
|
__publicField(this, "specificResource");
|
|
202
202
|
this.vault = vault;
|
|
203
|
+
let data = { ...inputData };
|
|
203
204
|
if (data.type === "SpecificResource") {
|
|
204
205
|
const source = data.source;
|
|
205
206
|
this.specificResource = { ...data, source: { id: source.id, type: resolveType(source.type) } };
|
package/dist/index.d.cts
CHANGED
|
@@ -78,7 +78,7 @@ declare class CreatorResource {
|
|
|
78
78
|
embedded: CreatorResource[];
|
|
79
79
|
vault: Vault;
|
|
80
80
|
specificResource?: SpecificResource;
|
|
81
|
-
constructor(
|
|
81
|
+
constructor(inputData: any, vault: Vault);
|
|
82
82
|
get(): any;
|
|
83
83
|
ref(): {
|
|
84
84
|
created?: string | undefined;
|
|
@@ -159,6 +159,7 @@ interface CreatorContext<T = any> {
|
|
|
159
159
|
}
|
|
160
160
|
type ResolvedCreatorReturn<T extends CreatorDefinition> = Awaited<ExtractCreatorGenerics<T>["CreateReturnType"]> extends any[] ? CreatorResource[] : CreatorResource;
|
|
161
161
|
interface CreatorFunctionContext {
|
|
162
|
+
vault: Vault;
|
|
162
163
|
options: CreatorOptions;
|
|
163
164
|
ref(idOrRef: string | Reference): ReferencedResource;
|
|
164
165
|
embed(data: any): CreatorResource;
|
package/dist/index.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ declare class CreatorResource {
|
|
|
78
78
|
embedded: CreatorResource[];
|
|
79
79
|
vault: Vault;
|
|
80
80
|
specificResource?: SpecificResource;
|
|
81
|
-
constructor(
|
|
81
|
+
constructor(inputData: any, vault: Vault);
|
|
82
82
|
get(): any;
|
|
83
83
|
ref(): {
|
|
84
84
|
created?: string | undefined;
|
|
@@ -159,6 +159,7 @@ interface CreatorContext<T = any> {
|
|
|
159
159
|
}
|
|
160
160
|
type ResolvedCreatorReturn<T extends CreatorDefinition> = Awaited<ExtractCreatorGenerics<T>["CreateReturnType"]> extends any[] ? CreatorResource[] : CreatorResource;
|
|
161
161
|
interface CreatorFunctionContext {
|
|
162
|
+
vault: Vault;
|
|
162
163
|
options: CreatorOptions;
|
|
163
164
|
ref(idOrRef: string | Reference): ReferencedResource;
|
|
164
165
|
embed(data: any): CreatorResource;
|
package/dist/index.js
CHANGED
|
@@ -169,7 +169,7 @@ function creatorHelper(ctx, parent, property, definition) {
|
|
|
169
169
|
|
|
170
170
|
// src/CreatorResource.ts
|
|
171
171
|
var CreatorResource = class _CreatorResource {
|
|
172
|
-
constructor(
|
|
172
|
+
constructor(inputData, vault) {
|
|
173
173
|
__publicField(this, "resource");
|
|
174
174
|
__publicField(this, "warnings", []);
|
|
175
175
|
__publicField(this, "errors", []);
|
|
@@ -179,6 +179,7 @@ var CreatorResource = class _CreatorResource {
|
|
|
179
179
|
__publicField(this, "vault");
|
|
180
180
|
__publicField(this, "specificResource");
|
|
181
181
|
this.vault = vault;
|
|
182
|
+
let data = { ...inputData };
|
|
182
183
|
if (data.type === "SpecificResource") {
|
|
183
184
|
const source = data.source;
|
|
184
185
|
this.specificResource = { ...data, source: { id: source.id, type: resolveType(source.type) } };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manifest-editor/creator-api",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
|
|
6
6
|
"repository": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "7da90acfb83545d53d34ba95b86c8d5492005e81"
|
|
63
63
|
}
|