@blinkk/root-cms 2.5.14 → 2.5.16

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/app.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getServerVersion
3
- } from "./chunk-KG774TBP.js";
3
+ } from "./chunk-JGLMVZE4.js";
4
4
  import {
5
5
  getCollectionSchema,
6
6
  getProjectSchemas
7
- } from "./chunk-MSJGHSR6.js";
7
+ } from "./chunk-HDIPAT3C.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
 
10
10
  // core/app.tsx
@@ -234,8 +234,10 @@ async function renderSignIn(req, res, options) {
234
234
  ctx.warning = "Dev warning: Server may be misconfigured. See logs for more information.";
235
235
  }
236
236
  }
237
+ const siteName = ctx.name;
238
+ const title = siteName ? `Sign in \u2013 ${siteName}` : "Sign in";
237
239
  const mainHtml = renderToString(
238
- /* @__PURE__ */ jsx(SignIn, { title: "Sign in", ctx, favicon: options.cmsConfig.favicon })
240
+ /* @__PURE__ */ jsx(SignIn, { title, ctx, favicon: options.cmsConfig.favicon })
239
241
  );
240
242
  const nonce = generateNonce();
241
243
  const html = `<!doctype html>
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RootCMSClient,
3
3
  getCmsPlugin
4
- } from "./chunk-YMUZ5H5C.js";
4
+ } from "./chunk-JUCNU5AP.js";
5
5
 
6
6
  // core/versions.ts
7
7
  import fs from "fs";
@@ -57,10 +57,10 @@ function testValidCollectionId(id) {
57
57
  function isSchemaPattern(value) {
58
58
  return typeof value === "object" && value !== null && "_schemaPattern" in value && value._schemaPattern === true;
59
59
  }
60
- function buildSchemaNameMap() {
60
+ function buildSchemaNameMap(schemaModules = SCHEMA_MODULES) {
61
61
  const nameMap = {};
62
- for (const fileId in SCHEMA_MODULES) {
63
- const module = SCHEMA_MODULES[fileId];
62
+ for (const fileId in schemaModules) {
63
+ const module = schemaModules[fileId];
64
64
  if (module.default && module.default.name) {
65
65
  nameMap[module.default.name] = module.default;
66
66
  }
@@ -71,16 +71,16 @@ function globToRegex(pattern) {
71
71
  const regexStr = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "{{DOUBLE_STAR}}").replace(/\*/g, "[^/]*").replace(/\{\{DOUBLE_STAR\}\}/g, ".*");
72
72
  return new RegExp(`^${regexStr}$`);
73
73
  }
74
- function resolveSchemaPattern(pattern) {
74
+ function resolveSchemaPattern(pattern, schemaModules = SCHEMA_MODULES) {
75
75
  const regex = globToRegex(pattern.pattern);
76
76
  const excludeSet = new Set(pattern.exclude || []);
77
77
  const names = [];
78
78
  const schemas = {};
79
- for (const fileId in SCHEMA_MODULES) {
79
+ for (const fileId in schemaModules) {
80
80
  if (!regex.test(fileId)) {
81
81
  continue;
82
82
  }
83
- const module = SCHEMA_MODULES[fileId];
83
+ const module = schemaModules[fileId];
84
84
  if (!module.default || !module.default.name) {
85
85
  continue;
86
86
  }
@@ -88,28 +88,25 @@ function resolveSchemaPattern(pattern) {
88
88
  if (excludeSet.has(schemaName)) {
89
89
  continue;
90
90
  }
91
- let schemaObj = module.default;
91
+ const schemaObj = structuredClone(module.default);
92
92
  if (pattern.omitFields && pattern.omitFields.length > 0) {
93
93
  const omitSet = new Set(pattern.omitFields);
94
- schemaObj = {
95
- ...schemaObj,
96
- fields: schemaObj.fields.filter(
97
- (f) => !omitSet.has(f.id || "")
98
- )
99
- };
94
+ schemaObj.fields = schemaObj.fields.filter(
95
+ (f) => !omitSet.has(f.id || "")
96
+ );
100
97
  }
101
98
  names.push(schemaName);
102
99
  schemas[schemaName] = schemaObj;
103
100
  }
104
101
  return { names, schemas };
105
102
  }
106
- function convertOneOfTypes(collection) {
103
+ function convertOneOfTypes(collection, schemaModules = SCHEMA_MODULES) {
107
104
  const clone = structuredClone(collection);
108
105
  const types = clone.types || {};
109
- const schemaNameMap = buildSchemaNameMap();
106
+ const schemaNameMap = buildSchemaNameMap(schemaModules);
110
107
  function handleOneOfField(field) {
111
108
  if (isSchemaPattern(field.types)) {
112
- const resolved = resolveSchemaPattern(field.types);
109
+ const resolved = resolveSchemaPattern(field.types, schemaModules);
113
110
  for (const [name, schemaObj] of Object.entries(resolved.schemas)) {
114
111
  if (!types[name]) {
115
112
  types[name] = schemaObj;
@@ -126,7 +123,7 @@ function convertOneOfTypes(collection) {
126
123
  if (typeof sub === "string") {
127
124
  names.push(sub);
128
125
  if (!types[sub] && schemaNameMap[sub]) {
129
- const resolvedSchema = schemaNameMap[sub];
126
+ const resolvedSchema = structuredClone(schemaNameMap[sub]);
130
127
  types[sub] = resolvedSchema;
131
128
  if (resolvedSchema.fields) {
132
129
  walk(resolvedSchema);
@@ -168,5 +165,6 @@ export {
168
165
  SCHEMA_MODULES,
169
166
  getProjectSchemas,
170
167
  resolveOneOfPatterns,
171
- getCollectionSchema
168
+ getCollectionSchema,
169
+ convertOneOfTypes
172
170
  };
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@blinkk/root-cms",
4
- version: "2.5.14",
4
+ version: "2.5.16",
5
5
  author: "s@blinkk.com",
6
6
  license: "MIT",
7
7
  engines: {
@@ -169,7 +169,7 @@ var package_default = {
169
169
  yjs: "13.6.27"
170
170
  },
171
171
  peerDependencies: {
172
- "@blinkk/root": "2.5.14",
172
+ "@blinkk/root": "2.5.16",
173
173
  "firebase-admin": ">=11",
174
174
  "firebase-functions": ">=4",
175
175
  preact: ">=10",
@@ -1501,10 +1501,41 @@ ${errorMessages}`);
1501
1501
  const docRef = this.db.doc(dbPath);
1502
1502
  const doc = await docRef.get();
1503
1503
  if (doc.exists) {
1504
- return doc.data();
1504
+ const dataSource = doc.data();
1505
+ if (dataSource.archivedAt) {
1506
+ console.warn(
1507
+ `warning: data source "${dataSourceId}" is archived` + (dataSource.archivedBy ? ` (archived by ${dataSource.archivedBy})` : "")
1508
+ );
1509
+ }
1510
+ return dataSource;
1505
1511
  }
1506
1512
  return null;
1507
1513
  }
1514
+ /**
1515
+ * Archives a data source. Archived data sources cannot be synced or published.
1516
+ */
1517
+ async archiveDataSource(dataSourceId, options) {
1518
+ const dbPath = `Projects/${this.projectId}/DataSources/${dataSourceId}`;
1519
+ const docRef = this.db.doc(dbPath);
1520
+ const archivedBy = options?.archivedBy || "root-cms-client";
1521
+ await docRef.update({
1522
+ archivedAt: Timestamp2.now(),
1523
+ archivedBy
1524
+ });
1525
+ console.log(`archived data source: ${dataSourceId}`);
1526
+ }
1527
+ /**
1528
+ * Unarchives a data source.
1529
+ */
1530
+ async unarchiveDataSource(dataSourceId) {
1531
+ const dbPath = `Projects/${this.projectId}/DataSources/${dataSourceId}`;
1532
+ const docRef = this.db.doc(dbPath);
1533
+ await docRef.update({
1534
+ archivedAt: FieldValue2.delete(),
1535
+ archivedBy: FieldValue2.delete()
1536
+ });
1537
+ console.log(`unarchived data source: ${dataSourceId}`);
1538
+ }
1508
1539
  /**
1509
1540
  * Syncs a data source to draft state.
1510
1541
  */
@@ -1513,6 +1544,9 @@ ${errorMessages}`);
1513
1544
  if (!dataSource) {
1514
1545
  throw new Error(`data source not found: ${dataSourceId}`);
1515
1546
  }
1547
+ if (dataSource.archivedAt) {
1548
+ throw new Error(`data source is archived: ${dataSourceId}`);
1549
+ }
1516
1550
  const result = await this.fetchData(dataSource);
1517
1551
  const dataSourceDocRef = this.db.doc(
1518
1552
  `Projects/${this.projectId}/DataSources/${dataSourceId}`
@@ -1545,6 +1579,9 @@ ${errorMessages}`);
1545
1579
  if (!dataSource) {
1546
1580
  throw new Error(`data source not found: ${dataSourceId}`);
1547
1581
  }
1582
+ if (dataSource.archivedAt) {
1583
+ throw new Error(`data source is archived: ${dataSourceId}`);
1584
+ }
1548
1585
  const dataSourceDocRef = this.db.doc(
1549
1586
  `Projects/${this.projectId}/DataSources/${dataSourceId}`
1550
1587
  );
@@ -1578,6 +1615,40 @@ ${errorMessages}`);
1578
1615
  console.log(`published data ${dataSourceId}`);
1579
1616
  console.log(`published by: ${publishedBy}`);
1580
1617
  }
1618
+ /**
1619
+ * Unpublishes a data source. Removes the `publishedAt`/`publishedBy`
1620
+ * metadata from the DataSource doc and deletes the `Data/published` doc.
1621
+ */
1622
+ async unpublishDataSource(dataSourceId) {
1623
+ const dataSource = await this.getDataSource(dataSourceId);
1624
+ if (!dataSource) {
1625
+ throw new Error(`data source not found: ${dataSourceId}`);
1626
+ }
1627
+ const dataSourceDocRef = this.db.doc(
1628
+ `Projects/${this.projectId}/DataSources/${dataSourceId}`
1629
+ );
1630
+ const dataDocRefDraft = this.db.doc(
1631
+ `Projects/${this.projectId}/DataSources/${dataSourceId}/Data/draft`
1632
+ );
1633
+ const dataDocRefPublished = this.db.doc(
1634
+ `Projects/${this.projectId}/DataSources/${dataSourceId}/Data/published`
1635
+ );
1636
+ const batch = this.db.batch();
1637
+ batch.update(dataSourceDocRef, {
1638
+ publishedAt: FieldValue2.delete(),
1639
+ publishedBy: FieldValue2.delete()
1640
+ });
1641
+ const draftSnapshot = await dataDocRefDraft.get();
1642
+ if (draftSnapshot.exists) {
1643
+ batch.update(dataDocRefDraft, {
1644
+ "dataSource.publishedAt": FieldValue2.delete(),
1645
+ "dataSource.publishedBy": FieldValue2.delete()
1646
+ });
1647
+ }
1648
+ batch.delete(dataDocRefPublished);
1649
+ await batch.commit();
1650
+ console.log(`unpublished data source: ${dataSourceId}`);
1651
+ }
1581
1652
  async publishDataSources(dataSourceIds, options) {
1582
1653
  const publishedBy = options?.publishedBy || "root-cms-client";
1583
1654
  const batch = options?.batch || this.db.batch();
@@ -1586,6 +1657,9 @@ ${errorMessages}`);
1586
1657
  if (!dataSource) {
1587
1658
  throw new Error(`data source not found: ${id}`);
1588
1659
  }
1660
+ if (dataSource.archivedAt) {
1661
+ throw new Error(`data source is archived: ${id}`);
1662
+ }
1589
1663
  const dataSourceDocRef = this.db.doc(
1590
1664
  `Projects/${this.projectId}/DataSources/${id}`
1591
1665
  );
@@ -1751,7 +1825,14 @@ ${errorMessages}`);
1751
1825
  const docRef = this.dbDataSourceDataRef(dataSourceId, { mode });
1752
1826
  const doc = await docRef.get();
1753
1827
  if (doc.exists) {
1754
- return doc.data();
1828
+ const dataSourceData = doc.data();
1829
+ if (dataSourceData.dataSource?.archivedAt) {
1830
+ const archivedBy = dataSourceData.dataSource.archivedBy;
1831
+ console.warn(
1832
+ `warning: data source "${dataSourceId}" is archived` + (archivedBy ? ` (archived by ${archivedBy})` : "")
1833
+ );
1834
+ }
1835
+ return dataSourceData;
1755
1836
  }
1756
1837
  return null;
1757
1838
  }
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  RootCMSClient,
6
6
  getCmsPlugin,
7
7
  unmarshalData
8
- } from "./chunk-YMUZ5H5C.js";
8
+ } from "./chunk-JUCNU5AP.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
 
11
11
  // cli/cli.ts
@@ -624,6 +624,8 @@ interface DataSource {
624
624
  syncedBy?: string;
625
625
  publishedAt?: Timestamp;
626
626
  publishedBy?: string;
627
+ archivedAt?: Timestamp;
628
+ archivedBy?: string;
627
629
  }
628
630
  interface DataSourceData<T = any> {
629
631
  dataSource: DataSource;
@@ -1005,6 +1007,16 @@ declare class RootCMSClient {
1005
1007
  * Returns a data source configuration object.
1006
1008
  */
1007
1009
  getDataSource(dataSourceId: string): Promise<DataSource | null>;
1010
+ /**
1011
+ * Archives a data source. Archived data sources cannot be synced or published.
1012
+ */
1013
+ archiveDataSource(dataSourceId: string, options?: {
1014
+ archivedBy?: string;
1015
+ }): Promise<void>;
1016
+ /**
1017
+ * Unarchives a data source.
1018
+ */
1019
+ unarchiveDataSource(dataSourceId: string): Promise<void>;
1008
1020
  /**
1009
1021
  * Syncs a data source to draft state.
1010
1022
  */
@@ -1014,6 +1026,11 @@ declare class RootCMSClient {
1014
1026
  publishDataSource(dataSourceId: string, options?: {
1015
1027
  publishedBy?: string;
1016
1028
  }): Promise<void>;
1029
+ /**
1030
+ * Unpublishes a data source. Removes the `publishedAt`/`publishedBy`
1031
+ * metadata from the DataSource doc and deletes the `Data/published` doc.
1032
+ */
1033
+ unpublishDataSource(dataSourceId: string): Promise<void>;
1017
1034
  publishDataSources(dataSourceIds: string[], options?: {
1018
1035
  publishedBy: string;
1019
1036
  batch?: WriteBatch;
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@blinkk/root';
2
2
  import 'firebase-admin/app';
3
3
  import 'firebase-admin/firestore';
4
- export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, D as DocMode, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, l as Release, R as RootCMSClient, g as SaveDraftOptions, S as SetDocOptions, k as Translation, E as TranslationsDoc, T as TranslationsMap, h as UpdateDraftOptions, U as UserRole, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-cP6yMgT8.js';
4
+ export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, D as DocMode, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, l as Release, R as RootCMSClient, g as SaveDraftOptions, S as SetDocOptions, k as Translation, E as TranslationsDoc, T as TranslationsMap, h as UpdateDraftOptions, U as UserRole, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-B_oDIGeJ.js';
5
5
  import './schema-D7MOj-YC.js';
package/dist/client.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  translationsForLocale,
13
13
  unmarshalArray,
14
14
  unmarshalData
15
- } from "./chunk-YMUZ5H5C.js";
15
+ } from "./chunk-JUCNU5AP.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
18
18
  BatchRequest,
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-cP6yMgT8.js';
2
- export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, J as Locale, Q as MultiLocaleTranslationsMap, l as Release, g as SaveDraftOptions, S as SetDocOptions, V as SingleLocaleTranslationsMap, K as SourceString, M as TranslatedString, k as Translation, E as TranslationsDoc, N as TranslationsDocMode, P as TranslationsLocaleDocEntry, O as TranslationsLocaleDocHashMap, W as TranslationsManager, h as UpdateDraftOptions, U as UserRole, X as buildTranslationsDbPath, Y as buildTranslationsLocaleDocDbPath, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-cP6yMgT8.js';
1
+ import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-B_oDIGeJ.js';
2
+ export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, J as Locale, Q as MultiLocaleTranslationsMap, l as Release, g as SaveDraftOptions, S as SetDocOptions, V as SingleLocaleTranslationsMap, K as SourceString, M as TranslatedString, k as Translation, E as TranslationsDoc, N as TranslationsDocMode, P as TranslationsLocaleDocEntry, O as TranslationsLocaleDocHashMap, W as TranslationsManager, h as UpdateDraftOptions, U as UserRole, X as buildTranslationsDbPath, Y as buildTranslationsLocaleDocDbPath, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-B_oDIGeJ.js';
3
3
  import { Request, RootConfig, Response, RouteParams, GetStaticProps, GetStaticPaths } from '@blinkk/root';
4
4
  import { Query } from 'firebase-admin/firestore';
5
5
  export { s as schema } from './schema-D7MOj-YC.js';
package/dist/core.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  translationsForLocale,
17
17
  unmarshalArray,
18
18
  unmarshalData
19
- } from "./chunk-YMUZ5H5C.js";
19
+ } from "./chunk-JUCNU5AP.js";
20
20
  import {
21
21
  __export
22
22
  } from "./chunk-MLKGABMK.js";
package/dist/functions.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runCronJobs
3
- } from "./chunk-H6ZKML2S.js";
4
- import "./chunk-YMUZ5H5C.js";
3
+ } from "./chunk-DKM5LHW3.js";
4
+ import "./chunk-JUCNU5AP.js";
5
5
  import "./chunk-MLKGABMK.js";
6
6
 
7
7
  // core/functions.ts
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@blinkk/root';
2
2
  import 'firebase-admin/app';
3
3
  import 'firebase-admin/firestore';
4
- export { $ as CMSAIConfig, Z as CMSBuiltInSidebarTool, a4 as CMSCheck, a2 as CMSPlugin, a1 as CMSPluginOptions, a0 as CMSSidebarTool, aa as CMSTranslationService, _ as CMSUser, a6 as CheckContext, a5 as CheckResult, a7 as CheckStatus, ab as TranslationExportResult, ac as TranslationImportResult, ad as TranslationRow, ae as TranslationServiceContext, a9 as TranslationsCheckOptions, a3 as cmsPlugin, a8 as translationsCheck } from './client-cP6yMgT8.js';
4
+ export { $ as CMSAIConfig, Z as CMSBuiltInSidebarTool, a4 as CMSCheck, a2 as CMSPlugin, a1 as CMSPluginOptions, a0 as CMSSidebarTool, aa as CMSTranslationService, _ as CMSUser, a6 as CheckContext, a5 as CheckResult, a7 as CheckStatus, ab as TranslationExportResult, ac as TranslationImportResult, ad as TranslationRow, ae as TranslationServiceContext, a9 as TranslationsCheckOptions, a3 as cmsPlugin, a8 as translationsCheck } from './client-B_oDIGeJ.js';
5
5
  import './schema-D7MOj-YC.js';
package/dist/plugin.js CHANGED
@@ -4,15 +4,15 @@ import {
4
4
  } from "./chunk-T5UK2H24.js";
5
5
  import {
6
6
  getServerVersion
7
- } from "./chunk-KG774TBP.js";
7
+ } from "./chunk-JGLMVZE4.js";
8
8
  import {
9
9
  runCronJobs
10
- } from "./chunk-H6ZKML2S.js";
10
+ } from "./chunk-DKM5LHW3.js";
11
11
  import {
12
12
  RootCMSClient,
13
13
  parseDocId,
14
14
  unmarshalData
15
- } from "./chunk-YMUZ5H5C.js";
15
+ } from "./chunk-JUCNU5AP.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
 
18
18
  // core/plugin.ts
package/dist/project.d.ts CHANGED
@@ -27,5 +27,18 @@ declare function resolveOneOfPatterns(schemaObj: Schema): Schema;
27
27
  * `/collections/<id>.schema.ts`.
28
28
  */
29
29
  declare function getCollectionSchema(collectionId: string): Collection | null;
30
+ /**
31
+ * Converts all `oneof` field type definitions into a map keyed by the type
32
+ * name. The field definitions are replaced with an array of type names.
33
+ *
34
+ * String references (used for self-referencing schemas) are resolved from the
35
+ * project's schema modules. SchemaPatterns are resolved by matching file paths.
36
+ *
37
+ * Schemas pulled in via SchemaPattern or string-name reference are always
38
+ * deep-cloned before being walked. The walk rewrites `oneof` fields in place,
39
+ * and skipping the clone would mutate the shared entries in `SCHEMA_MODULES`
40
+ * and corrupt subsequent calls (e.g. when building multiple collections).
41
+ */
42
+ declare function convertOneOfTypes(collection: Collection, schemaModules?: Record<string, SchemaModule>): Collection;
30
43
 
31
- export { SCHEMA_MODULES, type SchemaModule, getCollectionSchema, getProjectSchemas, resolveOneOfPatterns };
44
+ export { SCHEMA_MODULES, type SchemaModule, convertOneOfTypes, getCollectionSchema, getProjectSchemas, resolveOneOfPatterns };
package/dist/project.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  SCHEMA_MODULES,
3
+ convertOneOfTypes,
3
4
  getCollectionSchema,
4
5
  getProjectSchemas,
5
6
  resolveOneOfPatterns
6
- } from "./chunk-MSJGHSR6.js";
7
+ } from "./chunk-HDIPAT3C.js";
7
8
  import "./chunk-MLKGABMK.js";
8
9
  export {
9
10
  SCHEMA_MODULES,
11
+ convertOneOfTypes,
10
12
  getCollectionSchema,
11
13
  getProjectSchemas,
12
14
  resolveOneOfPatterns
@@ -1 +1 @@
1
- :root{--font-family-default: "Inter", sans-serif;--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--color-text-default: #333333;--color-border: #EFEFEF;--button-background-hover: #F5F5F5;--button-background-active: #E5E5E5}html{box-sizing:border-box;overflow-x:hidden;font-size:16px;line-height:1.5}*,*:before,*:after{box-sizing:inherit}html,body{font-family:var(--font-family-default);color:var(--color-text-default);height:100%;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth}img,picture,figure,video,canvas,svg,iframe{display:block;max-width:100%;height:auto;margin:0}a{color:inherit}select{color-scheme:light}h1,h2,h3,h4,h5,p{margin:0}body.menu\:open{overflow:hidden}#root{margin:0 auto;min-height:100vh;position:relative}.bootstrap{font-size:48px;font-weight:900;width:100%;height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:40px;gap:36px;position:relative}.bootstrap-error{font-size:14px;font-weight:400;line-height:20px;position:absolute;bottom:100px;left:0;right:0;text-align:center;animation:.5s forwards bootstrap-loading-error;animation-delay:1s;opacity:0;padding:0 24px}@keyframes bootstrap-loading-error{0%{opacity:0}to{opacity:1}}.signin{font-family:Google Sans,arial,sans-serif;text-align:center;padding:48px 20px;color:#3c4043}.signin__headline{margin-bottom:40px}.signin__headline__title{font-size:36px;line-height:1.3;font-weight:500;margin-bottom:20px}.signin__headline__body{font-size:18px;line-height:1.5;font-weight:500}.signin__button{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;text-align:center;gap:12px;background:#fff;border:1px solid #dadce0;border-radius:4px;cursor:pointer;font-family:inherit;padding:0 12px;height:40px;box-sizing:border-box;transition:all .218s ease}.signin__warning{max-width:520px;margin:0 auto 40px;padding:12px;border:1px solid #fbbc04;border-radius:8px;background:#fff9db;color:#5f370e;font-size:14px;line-height:1.5}.signin__button:hover{border-color:#d2e3fc;background-color:#4285f40a}.signin__button__icon{width:18px;height:18px;background-color:#fff}.signin__button__label{font-size:14px;line-height:1;letter-spacing:.25px;font-weight:500;color:#3c4043}.signin__error{color:red;font-weight:700;text-align:center;max-width:60ch;margin:20px auto 0}
1
+ :root{--font-family-default: "Inter", sans-serif;--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--color-text-default: #333333;--color-border: #EFEFEF;--button-background-hover: #F5F5F5;--button-background-active: #E5E5E5}html{box-sizing:border-box;overflow-x:hidden;font-size:16px;line-height:1.5}*,*:before,*:after{box-sizing:inherit}html,body{font-family:var(--font-family-default);color:var(--color-text-default);height:100%;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth}img,picture,figure,video,canvas,svg,iframe{display:block;max-width:100%;height:auto;margin:0}a{color:inherit}select{color-scheme:light}h1,h2,h3,h4,h5,p{margin:0}body.menu\:open{overflow:hidden}#root{margin:0 auto;min-height:100vh;position:relative}.bootstrap{font-size:48px;font-weight:900;width:100%;height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:40px;gap:36px;position:relative}.bootstrap-error{font-size:14px;font-weight:400;line-height:20px;position:absolute;bottom:100px;left:0;right:0;text-align:center;animation:.5s forwards bootstrap-loading-error;animation-delay:1s;opacity:0;padding:0 24px}@keyframes bootstrap-loading-error{0%{opacity:0}to{opacity:1}}.signin{font-family:Google Sans,arial,sans-serif;text-align:center;padding:48px 20px;color:#3c4043}.signin__headline{margin-bottom:40px}.signin__headline__title{font-size:36px;line-height:1.3;font-weight:500;margin-bottom:20px}.signin__headline__body{font-size:18px;line-height:1.5;font-weight:500}.signin__button{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;text-align:center;gap:12px;background:#fff;border:1px solid #dadce0;border-radius:4px;cursor:pointer;font-family:inherit;padding:0 12px;height:40px;box-sizing:border-box;transition:all .218s ease}.signin__warning{max-width:520px;margin:0 auto 40px;padding:12px;border:1px solid #fbbc04;border-radius:8px;background:#fff9db;color:#5f370e;font-size:14px;line-height:1.5}.signin__button:hover{border-color:#d2e3fc;background-color:#4285f40a}.signin__button__icon{width:18px;height:18px;background-color:#fff}.signin__button__label{font-size:14px;line-height:1;letter-spacing:.25px;font-weight:500;color:#3c4043}.signin__button--busy{cursor:default;opacity:.85;border-color:#d2e3fc;background-color:#4285f40a}.signin__button--busy:hover{background-color:#4285f40a}.signin__spinner{width:18px;height:18px;color:#4285f4;animation:signin-spin .7s linear infinite}@keyframes signin-spin{to{transform:rotate(360deg)}}.signin__error{color:red;font-weight:700;text-align:center;max-width:60ch;margin:20px auto 0}