@blinkk/root-cms 2.5.14 → 2.5.15
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 +1 -1
- package/dist/{chunk-YMUZ5H5C.js → chunk-47KOES6P.js} +49 -2
- package/dist/{chunk-H6ZKML2S.js → chunk-5Y3VCZEZ.js} +1 -1
- package/dist/{chunk-KG774TBP.js → chunk-NMUXWSFO.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-cP6yMgT8.d.ts → client-DUc18VW8.d.ts} +12 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/functions.js +2 -2
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +3 -3
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +151 -151
- package/dist/ui/ui.js.LEGAL.txt +1 -0
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -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
|
-
|
|
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
|
);
|
|
@@ -1586,6 +1623,9 @@ ${errorMessages}`);
|
|
|
1586
1623
|
if (!dataSource) {
|
|
1587
1624
|
throw new Error(`data source not found: ${id}`);
|
|
1588
1625
|
}
|
|
1626
|
+
if (dataSource.archivedAt) {
|
|
1627
|
+
throw new Error(`data source is archived: ${id}`);
|
|
1628
|
+
}
|
|
1589
1629
|
const dataSourceDocRef = this.db.doc(
|
|
1590
1630
|
`Projects/${this.projectId}/DataSources/${id}`
|
|
1591
1631
|
);
|
|
@@ -1751,7 +1791,14 @@ ${errorMessages}`);
|
|
|
1751
1791
|
const docRef = this.dbDataSourceDataRef(dataSourceId, { mode });
|
|
1752
1792
|
const doc = await docRef.get();
|
|
1753
1793
|
if (doc.exists) {
|
|
1754
|
-
|
|
1794
|
+
const dataSourceData = doc.data();
|
|
1795
|
+
if (dataSourceData.dataSource?.archivedAt) {
|
|
1796
|
+
const archivedBy = dataSourceData.dataSource.archivedBy;
|
|
1797
|
+
console.warn(
|
|
1798
|
+
`warning: data source "${dataSourceId}" is archived` + (archivedBy ? ` (archived by ${archivedBy})` : "")
|
|
1799
|
+
);
|
|
1800
|
+
}
|
|
1801
|
+
return dataSourceData;
|
|
1755
1802
|
}
|
|
1756
1803
|
return null;
|
|
1757
1804
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@blinkk/root-cms",
|
|
4
|
-
version: "2.5.
|
|
4
|
+
version: "2.5.15",
|
|
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.
|
|
172
|
+
"@blinkk/root": "2.5.15",
|
|
173
173
|
"firebase-admin": ">=11",
|
|
174
174
|
"firebase-functions": ">=4",
|
|
175
175
|
preact: ">=10",
|
package/dist/cli.js
CHANGED
|
@@ -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
|
*/
|
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-
|
|
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-DUc18VW8.js';
|
|
5
5
|
import './schema-D7MOj-YC.js';
|
package/dist/client.js
CHANGED
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-
|
|
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-
|
|
1
|
+
import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-DUc18VW8.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-DUc18VW8.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
package/dist/functions.js
CHANGED
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-
|
|
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-DUc18VW8.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-
|
|
7
|
+
} from "./chunk-NMUXWSFO.js";
|
|
8
8
|
import {
|
|
9
9
|
runCronJobs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5Y3VCZEZ.js";
|
|
11
11
|
import {
|
|
12
12
|
RootCMSClient,
|
|
13
13
|
parseDocId,
|
|
14
14
|
unmarshalData
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-47KOES6P.js";
|
|
16
16
|
import "./chunk-MLKGABMK.js";
|
|
17
17
|
|
|
18
18
|
// core/plugin.ts
|