@cms0/cms0 0.2.23 → 0.2.25
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.
|
@@ -200,7 +200,7 @@ function isBundledFallbackDescriptor(descriptor) {
|
|
|
200
200
|
return (isRecord(descriptor.metadata) &&
|
|
201
201
|
descriptor.metadata.__cms0Fallback === true);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function readBundledSchemaDescriptor() {
|
|
204
204
|
const descriptor = schema_descriptor_1.schemaDescriptor;
|
|
205
205
|
return isBundledFallbackDescriptor(descriptor) ? null : descriptor;
|
|
206
206
|
}
|
|
@@ -220,7 +220,7 @@ function invalidateBrowserSchemaDescriptorCache(baseUrl, apiKey) {
|
|
|
220
220
|
function ensureBrowserSchemaDescriptorDevSubscription(baseUrl, apiKey, onInvalidate) {
|
|
221
221
|
if (typeof window === "undefined")
|
|
222
222
|
return;
|
|
223
|
-
if (
|
|
223
|
+
if (readBundledSchemaDescriptor())
|
|
224
224
|
return;
|
|
225
225
|
if (typeof globalThis.EventSource !== "function")
|
|
226
226
|
return;
|
|
@@ -259,7 +259,7 @@ async function resolveBrowserSchemaDescriptor(baseUrl, apiKey) {
|
|
|
259
259
|
if (injectedDescriptor) {
|
|
260
260
|
return setSchemaDescriptorGlobals(injectedDescriptor);
|
|
261
261
|
}
|
|
262
|
-
const bundledDescriptor =
|
|
262
|
+
const bundledDescriptor = readBundledSchemaDescriptor();
|
|
263
263
|
if (bundledDescriptor) {
|
|
264
264
|
return setSchemaDescriptorGlobals(bundledDescriptor);
|
|
265
265
|
}
|
|
@@ -307,10 +307,14 @@ function getActiveSchemaDescriptor() {
|
|
|
307
307
|
}
|
|
308
308
|
function resolveActiveSchemaDescriptor() {
|
|
309
309
|
const localDescriptor = readLocalSchemaDescriptor();
|
|
310
|
-
if (
|
|
311
|
-
|
|
310
|
+
if (localDescriptor) {
|
|
311
|
+
return localDescriptor;
|
|
312
312
|
}
|
|
313
|
-
|
|
313
|
+
const bundledDescriptor = readBundledSchemaDescriptor();
|
|
314
|
+
if (bundledDescriptor) {
|
|
315
|
+
return bundledDescriptor;
|
|
316
|
+
}
|
|
317
|
+
throw createMissingLocalDescriptorError();
|
|
314
318
|
}
|
|
315
319
|
function syncActiveSchemaDescriptorGlobals() {
|
|
316
320
|
return setSchemaDescriptorGlobals(getActiveSchemaDescriptor());
|
|
@@ -191,7 +191,7 @@ function isBundledFallbackDescriptor(descriptor) {
|
|
|
191
191
|
return (isRecord(descriptor.metadata) &&
|
|
192
192
|
descriptor.metadata.__cms0Fallback === true);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function readBundledSchemaDescriptor() {
|
|
195
195
|
const descriptor = bundledSchemaDescriptor;
|
|
196
196
|
return isBundledFallbackDescriptor(descriptor) ? null : descriptor;
|
|
197
197
|
}
|
|
@@ -211,7 +211,7 @@ export function invalidateBrowserSchemaDescriptorCache(baseUrl, apiKey) {
|
|
|
211
211
|
export function ensureBrowserSchemaDescriptorDevSubscription(baseUrl, apiKey, onInvalidate) {
|
|
212
212
|
if (typeof window === "undefined")
|
|
213
213
|
return;
|
|
214
|
-
if (
|
|
214
|
+
if (readBundledSchemaDescriptor())
|
|
215
215
|
return;
|
|
216
216
|
if (typeof globalThis.EventSource !== "function")
|
|
217
217
|
return;
|
|
@@ -250,7 +250,7 @@ export async function resolveBrowserSchemaDescriptor(baseUrl, apiKey) {
|
|
|
250
250
|
if (injectedDescriptor) {
|
|
251
251
|
return setSchemaDescriptorGlobals(injectedDescriptor);
|
|
252
252
|
}
|
|
253
|
-
const bundledDescriptor =
|
|
253
|
+
const bundledDescriptor = readBundledSchemaDescriptor();
|
|
254
254
|
if (bundledDescriptor) {
|
|
255
255
|
return setSchemaDescriptorGlobals(bundledDescriptor);
|
|
256
256
|
}
|
|
@@ -298,10 +298,14 @@ export function getActiveSchemaDescriptor() {
|
|
|
298
298
|
}
|
|
299
299
|
function resolveActiveSchemaDescriptor() {
|
|
300
300
|
const localDescriptor = readLocalSchemaDescriptor();
|
|
301
|
-
if (
|
|
302
|
-
|
|
301
|
+
if (localDescriptor) {
|
|
302
|
+
return localDescriptor;
|
|
303
303
|
}
|
|
304
|
-
|
|
304
|
+
const bundledDescriptor = readBundledSchemaDescriptor();
|
|
305
|
+
if (bundledDescriptor) {
|
|
306
|
+
return bundledDescriptor;
|
|
307
|
+
}
|
|
308
|
+
throw createMissingLocalDescriptorError();
|
|
305
309
|
}
|
|
306
310
|
export function syncActiveSchemaDescriptorGlobals() {
|
|
307
311
|
return setSchemaDescriptorGlobals(getActiveSchemaDescriptor());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-descriptors.d.ts","sourceRoot":"","sources":["../../src/schema-descriptors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA6CnD,eAAO,MAAM,gBAAgB;;;;;;CAA0B,CAAC;AA+LxD,wBAAgB,yBAAyB,CACvC,WAAW,WAAuC,GACjD,cAAc,GAAG,IAAI,CAmCvB;AA0CD,wBAAgB,sCAAsC,CACpD,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,QAMhB;AAED,wBAAgB,4CAA4C,CAC1D,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,IAAI,QAuC1B;AAED,wBAAsB,8BAA8B,CAClD,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,CAAC,CAiDzB;AAED,wBAAgB,yBAAyB,IAAI,cAAc,CAU1D;
|
|
1
|
+
{"version":3,"file":"schema-descriptors.d.ts","sourceRoot":"","sources":["../../src/schema-descriptors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA6CnD,eAAO,MAAM,gBAAgB;;;;;;CAA0B,CAAC;AA+LxD,wBAAgB,yBAAyB,CACvC,WAAW,WAAuC,GACjD,cAAc,GAAG,IAAI,CAmCvB;AA0CD,wBAAgB,sCAAsC,CACpD,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,QAMhB;AAED,wBAAgB,4CAA4C,CAC1D,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,IAAI,QAuC1B;AAED,wBAAsB,8BAA8B,CAClD,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,CAAC,CAiDzB;AAED,wBAAgB,yBAAyB,IAAI,cAAc,CAU1D;AAgBD,wBAAgB,iCAAiC,mBAEhD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cms0/cms0",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"chokidar": "^4.0.3",
|
|
66
66
|
"ts-morph": "^27.0.2",
|
|
67
67
|
"typescript": "^5.9.3",
|
|
68
|
-
"@cms0/shared": "0.2.
|
|
68
|
+
"@cms0/shared": "0.2.25"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^24.10.1",
|