@powerhousedao/vetra 6.2.3-dev.5 → 6.2.3-dev.51
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/codegen/index.d.ts +19 -19
- package/dist/codegen/index.d.ts.map +1 -1
- package/dist/codegen/index.js +14 -11
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/spec.d.ts +3 -2
- package/dist/codegen/spec.js +1 -1
- package/dist/{connect-qpJ9OUaH.js → connect-EqImHuZ2.js} +1 -1
- package/dist/{connect-qpJ9OUaH.js.map → connect-EqImHuZ2.js.map} +1 -1
- package/dist/document-models/app-module/index.d.ts +29 -6
- package/dist/document-models/app-module/index.d.ts.map +1 -1
- package/dist/document-models/app-module/index.js +4 -4
- package/dist/document-models/app-module/index.js.map +1 -1
- package/dist/document-models/document-editor/index.d.ts +27 -6
- package/dist/document-models/document-editor/index.d.ts.map +1 -1
- package/dist/document-models/document-editor/index.js +4 -4
- package/dist/document-models/document-editor/index.js.map +1 -1
- package/dist/document-models/index.d.ts +7 -6
- package/dist/document-models/index.js +5 -5
- package/dist/document-models/processor-module/index.d.ts +30 -6
- package/dist/document-models/processor-module/index.d.ts.map +1 -1
- package/dist/document-models/processor-module/index.js +4 -4
- package/dist/document-models/processor-module/index.js.map +1 -1
- package/dist/document-models/subgraph-module/index.d.ts +25 -6
- package/dist/document-models/subgraph-module/index.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/index.js +4 -4
- package/dist/document-models/subgraph-module/index.js.map +1 -1
- package/dist/document-models/vetra-package/index.d.ts +33 -6
- package/dist/document-models/vetra-package/index.d.ts.map +1 -1
- package/dist/document-models/vetra-package/index.js +3 -3
- package/dist/{editor-LRAwrgdQ.js → editor-BXOEFIDj.js} +8 -7
- package/dist/editor-BXOEFIDj.js.map +1 -0
- package/dist/{editor-CLbvu3pG.js → editor-C5a0rBQj.js} +5 -5
- package/dist/editor-C5a0rBQj.js.map +1 -0
- package/dist/{editor-_0gdltOt.js → editor-CiX3Tq3g.js} +4 -4
- package/dist/editor-CiX3Tq3g.js.map +1 -0
- package/dist/{editor-C13SvgUy.js → editor-DFEeM_dy.js} +3 -3
- package/dist/editor-DFEeM_dy.js.map +1 -0
- package/dist/{editor-CCdg1mJL.js → editor-DpZVlVN1.js} +4 -4
- package/dist/{editor-CCdg1mJL.js.map → editor-DpZVlVN1.js.map} +1 -1
- package/dist/{editor-Fgw7attg.js → editor-DpadPeVq.js} +25 -25
- package/dist/{editor-Fgw7attg.js.map → editor-DpadPeVq.js.map} +1 -1
- package/dist/editors/components/index.d.ts +3 -3
- package/dist/editors/components/index.d.ts.map +1 -1
- package/dist/editors/components/index.js.map +1 -1
- package/dist/editors/hooks/index.d.ts +3 -3
- package/dist/editors/hooks/index.d.ts.map +1 -1
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.d.ts +7 -8
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/{factory-5eiZohiv.js → factory-BUuO4fIN.js} +12 -4
- package/dist/factory-BUuO4fIN.js.map +1 -0
- package/dist/{factory-DMl8eB3P.js → factory-BWrWHoS5.js} +3 -3
- package/dist/{factory-DMl8eB3P.js.map → factory-BWrWHoS5.js.map} +1 -1
- package/dist/{hooks-BIgFcbaF.js → hooks-BbxvC-C3.js} +2 -2
- package/dist/{hooks-BIgFcbaF.js.map → hooks-BbxvC-C3.js.map} +1 -1
- package/dist/{index-SB-AtQdU.d.ts → index-B52jv-LY.d.ts} +30 -64
- package/dist/index-B52jv-LY.d.ts.map +1 -0
- package/dist/{index-Dm_gN1DR.d.ts → index-D6Ai0OOc.d.ts} +26 -59
- package/dist/index-D6Ai0OOc.d.ts.map +1 -0
- package/dist/{index-f_um1g-i.d.ts → index-DPG4u1Ym.d.ts} +26 -62
- package/dist/index-DPG4u1Ym.d.ts.map +1 -0
- package/dist/{index-B5ijieNt.d.ts → index-DplUuZMT.d.ts} +21 -55
- package/dist/index-DplUuZMT.d.ts.map +1 -0
- package/dist/index.d.ts +51 -93
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -12
- package/dist/index.js.map +1 -1
- package/dist/{logger-WHD0fyLm.js → logger-BFxMdimR.js} +1 -1
- package/dist/{logger-WHD0fyLm.js.map → logger-BFxMdimR.js.map} +1 -1
- package/dist/{module-Chqkdq4U.js → module-2JZcvfVs.js} +3 -3
- package/dist/{module-Chqkdq4U.js.map → module-2JZcvfVs.js.map} +1 -1
- package/dist/{module-CRq_lUkG.js → module-Caxhis1M.js} +3 -3
- package/dist/{module-CRq_lUkG.js.map → module-Caxhis1M.js.map} +1 -1
- package/dist/{module-DXT-FMxU.js → module-CdpGkPNN.js} +7 -7
- package/dist/{module-DXT-FMxU.js.map → module-CdpGkPNN.js.map} +1 -1
- package/dist/{module-ciAK1LUC.d.ts → module-D4lqkHHK.d.ts} +37 -70
- package/dist/module-D4lqkHHK.d.ts.map +1 -0
- package/dist/{module-bKT_e3CH.js → module-Db8mmgzN.js} +3 -3
- package/dist/{module-bKT_e3CH.js.map → module-Db8mmgzN.js.map} +1 -1
- package/dist/{module-CRfHlbnq.js → module-FXJRy_1W.js} +2 -2
- package/dist/{module-CRfHlbnq.js.map → module-FXJRy_1W.js.map} +1 -1
- package/dist/{module-Bx1OEHxF.js → module-hLzF5tCL.js} +3 -3
- package/dist/{module-Bx1OEHxF.js.map → module-hLzF5tCL.js.map} +1 -1
- package/dist/{ph-factories-CjbIAMgT.js → ph-factories-Bgnr3mK3.js} +2 -2
- package/dist/{ph-factories-CjbIAMgT.js.map → ph-factories-Bgnr3mK3.js.map} +1 -1
- package/dist/{ph-factories-Ce8oAqs9.js → ph-factories-CgoFCmG0.js} +2 -2
- package/dist/{ph-factories-Ce8oAqs9.js.map → ph-factories-CgoFCmG0.js.map} +1 -1
- package/dist/{ph-factories-dVj6mIlR.js → ph-factories-DhLtvC7j.js} +2 -2
- package/dist/{ph-factories-dVj6mIlR.js.map → ph-factories-DhLtvC7j.js.map} +1 -1
- package/dist/{ph-factories-CljTAAVS.js → ph-factories-HuC7_vvF.js} +2 -2
- package/dist/{ph-factories-CljTAAVS.js.map → ph-factories-HuC7_vvF.js.map} +1 -1
- package/dist/powerhouse.manifest.json +76 -0
- package/dist/{processor-trJFuoHh.js → processor-CsiUWh93.js} +11 -4
- package/dist/processor-CsiUWh93.js.map +1 -0
- package/dist/processors/codegen/index.d.ts +3 -4
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +2 -2
- package/dist/processors/index.d.ts +2 -3
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/index.js.map +1 -1
- package/dist/processors/vetra-read-model/index.d.ts +47 -49
- package/dist/processors/vetra-read-model/index.d.ts.map +1 -1
- package/dist/processors/vetra-read-model/index.js +1 -1
- package/dist/{spec-api-DobY5TUJ.js → spec-api-BIJ_jsGp.js} +9 -9
- package/dist/{spec-api-DobY5TUJ.js.map → spec-api-BIJ_jsGp.js.map} +1 -1
- package/dist/{specs-BeVdfCwg.d.ts → specs-DoTSfuxN.d.ts} +7 -4
- package/dist/specs-DoTSfuxN.d.ts.map +1 -0
- package/dist/switchboard-Bug8BWrz.js +8 -0
- package/dist/{switchboard-Bf0uvxSu.js.map → switchboard-Bug8BWrz.js.map} +1 -1
- package/dist/{upgrade-manifest-OlS1ALVv.js → upgrade-manifest-BOZ5nmyK.js} +1 -1
- package/dist/{upgrade-manifest-OlS1ALVv.js.map → upgrade-manifest-BOZ5nmyK.js.map} +1 -1
- package/dist/{upgrade-manifest-BGuy0v65.js → upgrade-manifest-D7xKGmZc.js} +1 -1
- package/dist/{upgrade-manifest-BGuy0v65.js.map → upgrade-manifest-D7xKGmZc.js.map} +1 -1
- package/dist/{upgrade-manifest-Ck3Mgwhc.js → upgrade-manifest-DLxSL23q.js} +1 -1
- package/dist/{upgrade-manifest-Ck3Mgwhc.js.map → upgrade-manifest-DLxSL23q.js.map} +1 -1
- package/dist/{upgrade-manifest-XdOLymuP.js → upgrade-manifest-Dv62Cod7.js} +1 -1
- package/dist/{upgrade-manifest-XdOLymuP.js.map → upgrade-manifest-Dv62Cod7.js.map} +1 -1
- package/dist/{upgrade-manifest-NaS4SWk9.js → upgrade-manifest-d3LquK-H.js} +1 -1
- package/dist/{upgrade-manifest-NaS4SWk9.js.map → upgrade-manifest-d3LquK-H.js.map} +1 -1
- package/dist/{useVetraDocument-BlLdlhrQ.js → useVetraDocument-B0k3gNtw.js} +1 -1
- package/dist/{useVetraDocument-BlLdlhrQ.js.map → useVetraDocument-B0k3gNtw.js.map} +1 -1
- package/dist/{utils-DXCsvCXL.js → utils-876N1Sph.js} +2 -2
- package/dist/{utils-DXCsvCXL.js.map → utils-876N1Sph.js.map} +1 -1
- package/dist/{utils-CkxGmQ2_.js → utils-Al_SGg2a.js} +2 -2
- package/dist/{utils-CkxGmQ2_.js.map → utils-Al_SGg2a.js.map} +1 -1
- package/dist/{utils-B4KdjDnp.js → utils-COP7hJ-K.js} +2 -2
- package/dist/{utils-B4KdjDnp.js.map → utils-COP7hJ-K.js.map} +1 -1
- package/dist/{utils-DmOIDVQo.js → utils-w_21RRK6.js} +3 -3
- package/dist/{utils-DmOIDVQo.js.map → utils-w_21RRK6.js.map} +1 -1
- package/dist/{vetra-package-Bl6TC4wx.js → vetra-package-DSyRtkdJ.js} +2 -2
- package/dist/{vetra-package-Bl6TC4wx.js.map → vetra-package-DSyRtkdJ.js.map} +1 -1
- package/package.json +14 -13
- package/dist/editor-C13SvgUy.js.map +0 -1
- package/dist/editor-CLbvu3pG.js.map +0 -1
- package/dist/editor-LRAwrgdQ.js.map +0 -1
- package/dist/editor-_0gdltOt.js.map +0 -1
- package/dist/factory-5eiZohiv.js.map +0 -1
- package/dist/index-B5ijieNt.d.ts.map +0 -1
- package/dist/index-Dm_gN1DR.d.ts.map +0 -1
- package/dist/index-SB-AtQdU.d.ts.map +0 -1
- package/dist/index-f_um1g-i.d.ts.map +0 -1
- package/dist/module-ciAK1LUC.d.ts.map +0 -1
- package/dist/powerhouse.manifest.d.ts +0 -34
- package/dist/powerhouse.manifest.d.ts.map +0 -1
- package/dist/powerhouse.manifest.js +0 -86
- package/dist/powerhouse.manifest.js.map +0 -1
- package/dist/processor-trJFuoHh.js.map +0 -1
- package/dist/specs-BeVdfCwg.d.ts.map +0 -1
- package/dist/switchboard-Bf0uvxSu.js +0 -8
- /package/dist/{chunk-pbuEa-1d.js → rolldown-runtime-D7D4PA-g.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region editors/components/StatusPill.d.ts
|
|
2
|
-
interface StatusPillProps {
|
|
2
|
+
export interface StatusPillProps {
|
|
3
3
|
status: "draft" | "confirmed";
|
|
4
4
|
label: string;
|
|
5
5
|
}
|
|
6
|
-
declare const StatusPill: React.FC<StatusPillProps>;
|
|
6
|
+
export declare const StatusPill: React.FC<StatusPillProps>;
|
|
7
7
|
//#endregion
|
|
8
|
-
export {
|
|
8
|
+
export {};
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"mappings":";iBAEiB;EACf;EACA;;qBAGW,YAAY,MAAM,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"sourcesContent":["import { twMerge } from \"tailwind-merge\";\n\nexport interface StatusPillProps {\n status: \"draft\" | \"confirmed\";\n label: string;\n}\n\nexport const StatusPill: React.FC<StatusPillProps> = ({ status, label }) => {\n return (\n <div\n className={twMerge(\n \"rounded-full px-3 py-1 text-xs font-medium\",\n status === \"confirmed\"\n ? \"bg-success/10 text-success\"\n : \"bg-warning/10 text-warning\",\n )}\n >\n {label}\n </div>\n );\n};\n"],"mappings":";;;AAOA,MAAa,cAAyC,EAAE,QAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../editors/components/StatusPill.tsx"],"sourcesContent":["import { twMerge } from \"tailwind-merge\";\n\nexport interface StatusPillProps {\n status: \"draft\" | \"confirmed\";\n label: string;\n}\n\nexport const StatusPill: React.FC<StatusPillProps> = ({ status, label }) => {\n return (\n <div\n className={twMerge(\n \"rounded-full px-3 py-1 text-xs font-medium\",\n status === \"confirmed\"\n ? \"bg-success/10 text-success\"\n : \"bg-warning/10 text-warning\",\n )}\n >\n {label}\n </div>\n );\n};\n"],"mappings":";;;AAOA,MAAa,cAAyC,EAAE,QAAQ,YAAY;CAC1E,OACE,oBAAC,OAAD;EACE,WAAW,QACT,8CACA,WAAW,cACP,+BACA,4BACN;EAEC,UAAA;CACE,CAAA;AAET"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region editors/hooks/useAvailableDocumentTypes.d.ts
|
|
2
|
-
declare function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments?: boolean): string[];
|
|
2
|
+
export declare function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments?: boolean): string[];
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region editors/hooks/useDebounce.d.ts
|
|
5
5
|
/**
|
|
@@ -10,7 +10,7 @@ declare function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments?:
|
|
|
10
10
|
* @param callback - Function to call with the debounced value (optional)
|
|
11
11
|
* @param delay - Delay in milliseconds
|
|
12
12
|
*/
|
|
13
|
-
declare function useDebounce<T>(value: T, callback: ((value: T) => void) | undefined, delay: number): void;
|
|
13
|
+
export declare function useDebounce<T>(value: T, callback: ((value: T) => void) | undefined, delay: number): void;
|
|
14
14
|
//#endregion
|
|
15
|
-
export {
|
|
15
|
+
export {};
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/hooks/useAvailableDocumentTypes.ts","../../../editors/hooks/useDebounce.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../editors/hooks/useAvailableDocumentTypes.ts","../../../editors/hooks/useDebounce.ts"],"mappings":";wBAegB,0BACd;;;;;;;;;;;wBCNc,YAAY,GAC1B,OAAO,GACP,YAAY,OAAO,yBACnB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useAvailableDocumentTypes, t as useDebounce } from "../../hooks-
|
|
1
|
+
import { n as useAvailableDocumentTypes, t as useDebounce } from "../../hooks-BbxvC-C3.js";
|
|
2
2
|
export { useAvailableDocumentTypes, useDebounce };
|
package/dist/editors/index.d.ts
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { EditorModule } from "document-model";
|
|
2
2
|
import { EditorModule as EditorModule$1 } from "@powerhousedao/shared/document-model";
|
|
3
|
-
|
|
4
3
|
//#region editors/app-editor/module.d.ts
|
|
5
4
|
/** Document editor module for the "powerhouse/app" document type */
|
|
6
|
-
declare const AppEditor: EditorModule;
|
|
5
|
+
export declare const AppEditor: EditorModule;
|
|
7
6
|
//#endregion
|
|
8
7
|
//#region editors/document-editor/module.d.ts
|
|
9
8
|
/** Document editor module for the "powerhouse/document-editor" document type */
|
|
10
|
-
declare const DocumentEditorEditor: EditorModule;
|
|
9
|
+
export declare const DocumentEditorEditor: EditorModule;
|
|
11
10
|
//#endregion
|
|
12
11
|
//#region editors/processor-editor/module.d.ts
|
|
13
12
|
/** Document editor module for the "powerhouse/processor" document type */
|
|
14
|
-
declare const ProcessorModuleEditor: EditorModule;
|
|
13
|
+
export declare const ProcessorModuleEditor: EditorModule;
|
|
15
14
|
//#endregion
|
|
16
15
|
//#region editors/subgraph-editor/module.d.ts
|
|
17
16
|
/** Document editor module for the "powerhouse/subgraph" document type */
|
|
18
|
-
declare const SubgraphModuleEditor: EditorModule;
|
|
17
|
+
export declare const SubgraphModuleEditor: EditorModule;
|
|
19
18
|
//#endregion
|
|
20
19
|
//#region editors/vetra-drive-app/module.d.ts
|
|
21
|
-
declare const VetraDriveApp: EditorModule$1;
|
|
20
|
+
export declare const VetraDriveApp: EditorModule$1;
|
|
22
21
|
//#endregion
|
|
23
22
|
//#region editors/vetra-package/module.d.ts
|
|
24
23
|
/** Document editor module for the "powerhouse/package" document type */
|
|
25
|
-
declare const VetraPackageEditor: EditorModule;
|
|
24
|
+
export declare const VetraPackageEditor: EditorModule;
|
|
26
25
|
//#endregion
|
|
27
|
-
export {
|
|
26
|
+
export {};
|
|
28
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../editors/app-editor/module.ts","../../editors/document-editor/module.ts","../../editors/processor-editor/module.ts","../../editors/subgraph-editor/module.ts","../../editors/vetra-drive-app/module.ts","../../editors/vetra-package/module.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../editors/app-editor/module.ts","../../editors/document-editor/module.ts","../../editors/processor-editor/module.ts","../../editors/subgraph-editor/module.ts","../../editors/vetra-drive-app/module.ts","../../editors/vetra-package/module.ts"],"mappings":";;;;qBAQa,WAAW;;;;qBCAX,sBAAsB;;;;qBCAtB,uBAAuB;;;;qBCAvB,sBAAsB;;;qBCLtB,eAAe;;;;qBCKf,oBAAoB"}
|
package/dist/editors/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DocumentEditorEditor, i as ProcessorModuleEditor, n as VetraDriveApp, o as AppEditor, r as SubgraphModuleEditor, t as VetraPackageEditor } from "../module-
|
|
1
|
+
import { a as DocumentEditorEditor, i as ProcessorModuleEditor, n as VetraDriveApp, o as AppEditor, r as SubgraphModuleEditor, t as VetraPackageEditor } from "../module-CdpGkPNN.js";
|
|
2
2
|
export { AppEditor, DocumentEditorEditor, ProcessorModuleEditor, SubgraphModuleEditor, VetraDriveApp, VetraPackageEditor };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as logger } from "./logger-
|
|
1
|
+
import { t as logger } from "./logger-BFxMdimR.js";
|
|
2
|
+
import { deletedDocumentId } from "@powerhousedao/shared/processors";
|
|
2
3
|
//#region processors/vetra-read-model/migrations.ts
|
|
3
4
|
async function up(db) {
|
|
4
5
|
await db.schema.createTable("vetra_package").addColumn("document_id", "varchar(255)", (col) => col.primaryKey()).addColumn("name", "varchar(255)").addColumn("description", "text").addColumn("category", "varchar(255)").addColumn("author_name", "varchar(255)").addColumn("author_website", "varchar(512)").addColumn("keywords", "text").addColumn("github_url", "varchar(512)").addColumn("npm_url", "varchar(512)").addColumn("drive_id", "varchar(255)").addColumn("last_operation_index", "integer", (col) => col.notNull()).addColumn("last_operation_hash", "varchar(255)", (col) => col.notNull()).addColumn("last_operation_timestamp", "timestamptz", (col) => col.notNull()).addColumn("created_at", "timestamptz", (col) => col.notNull().defaultTo("now()")).addColumn("updated_at", "timestamptz", (col) => col.notNull().defaultTo("now()")).ifNotExists().execute();
|
|
@@ -16,8 +17,15 @@ var VetraReadModelProcessor = class {
|
|
|
16
17
|
async onOperations(operations) {
|
|
17
18
|
logger.info(">>> VetraReadModelProcessor.onOperations()");
|
|
18
19
|
if (operations.length === 0) return;
|
|
19
|
-
for (const
|
|
20
|
+
for (const op of operations) {
|
|
21
|
+
const { operation, context } = op;
|
|
20
22
|
if (context.documentType !== "powerhouse/package") continue;
|
|
23
|
+
const deleted = deletedDocumentId(op);
|
|
24
|
+
if (deleted !== void 0) {
|
|
25
|
+
await this.relationalDb.deleteFrom("vetra_package").where("document_id", "=", deleted).execute();
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (context.scope !== "global") continue;
|
|
21
29
|
const state = context.resultingState ? JSON.parse(context.resultingState) : void 0;
|
|
22
30
|
const getString = (val) => typeof val === "string" ? val : null;
|
|
23
31
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -68,7 +76,7 @@ const vetraReadModelFactoryBuilder = (module) => {
|
|
|
68
76
|
branch: ["main"],
|
|
69
77
|
documentId: ["*"],
|
|
70
78
|
documentType: ["powerhouse/package"],
|
|
71
|
-
scope: ["global"]
|
|
79
|
+
scope: ["global", "document"]
|
|
72
80
|
}
|
|
73
81
|
}];
|
|
74
82
|
};
|
|
@@ -76,4 +84,4 @@ const vetraReadModelFactoryBuilder = (module) => {
|
|
|
76
84
|
//#endregion
|
|
77
85
|
export { VetraReadModelProcessor as n, vetraReadModelFactoryBuilder as t };
|
|
78
86
|
|
|
79
|
-
//# sourceMappingURL=factory-
|
|
87
|
+
//# sourceMappingURL=factory-BUuO4fIN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-BUuO4fIN.js","names":[],"sources":["../processors/vetra-read-model/migrations.ts","../processors/vetra-read-model/processor.ts","../processors/vetra-read-model/factory.ts"],"sourcesContent":["import type { IRelationalDb } from \"@powerhousedao/shared/processors\";\n\nexport async function up(db: IRelationalDb<any>): Promise<void> {\n // Create vetra_package table to store VetraPackage document state\n await db.schema\n .createTable(\"vetra_package\")\n .addColumn(\"document_id\", \"varchar(255)\", (col) => col.primaryKey()) // VetraPackage state fields\n .addColumn(\"name\", \"varchar(255)\")\n .addColumn(\"description\", \"text\")\n .addColumn(\"category\", \"varchar(255)\")\n .addColumn(\"author_name\", \"varchar(255)\")\n .addColumn(\"author_website\", \"varchar(512)\")\n .addColumn(\"keywords\", \"text\") // JSON array of {id, label}\n .addColumn(\"github_url\", \"varchar(512)\")\n .addColumn(\"npm_url\", \"varchar(512)\")\n .addColumn(\"drive_id\", \"varchar(255)\")\n // Document metadata\n .addColumn(\"last_operation_index\", \"integer\", (col) => col.notNull())\n .addColumn(\"last_operation_hash\", \"varchar(255)\", (col) => col.notNull())\n .addColumn(\"last_operation_timestamp\", \"timestamptz\", (col) =>\n col.notNull(),\n )\n .addColumn(\"created_at\", \"timestamptz\", (col) =>\n col.notNull().defaultTo(\"now()\"),\n )\n .addColumn(\"updated_at\", \"timestamptz\", (col) =>\n col.notNull().defaultTo(\"now()\"),\n )\n .ifNotExists()\n .execute();\n\n // Create indexes for common queries\n await db.schema\n .createIndex(\"idx_vetra_package_document_id\")\n .on(\"vetra_package\")\n .column(\"document_id\")\n .ifNotExists()\n .execute();\n\n await db.schema\n .createIndex(\"idx_vetra_package_name\")\n .on(\"vetra_package\")\n .column(\"name\")\n .ifNotExists()\n .execute();\n\n await db.schema\n .createIndex(\"idx_vetra_package_category\")\n .on(\"vetra_package\")\n .column(\"category\")\n .ifNotExists()\n .execute();\n}\n\nexport async function down(db: IRelationalDb<any>): Promise<void> {\n // Drop indexes first\n await db.schema.dropIndex(\"idx_vetra_package_category\").ifExists().execute();\n await db.schema.dropIndex(\"idx_vetra_package_name\").ifExists().execute();\n await db.schema\n .dropIndex(\"idx_vetra_package_document_id\")\n .ifExists()\n .execute();\n\n // Drop table\n await db.schema.dropTable(\"vetra_package\").ifExists().execute();\n}\n","import type {\n IProcessor,\n OperationWithContext,\n} from \"@powerhousedao/reactor-browser\";\nimport { deletedDocumentId } from \"@powerhousedao/shared/processors\";\nimport type { Kysely } from \"kysely\";\nimport type { VetraPackageState } from \"../../document-models/vetra-package/v1/gen/schema/types.js\";\nimport { logger } from \"../codegen/logger.js\";\nimport { type DB } from \"./schema.js\";\n\ninterface VetraPackageGlobalState extends VetraPackageState {}\n\nexport class VetraReadModelProcessor implements IProcessor {\n private relationalDb: Kysely<DB>;\n\n constructor(relationalDb: Kysely<DB>) {\n this.relationalDb = relationalDb;\n }\n\n async onOperations(operations: OperationWithContext[]): Promise<void> {\n logger.info(\">>> VetraReadModelProcessor.onOperations()\");\n if (operations.length === 0) return;\n\n for (const op of operations) {\n const { operation, context } = op;\n if (context.documentType !== \"powerhouse/package\") continue;\n\n const deleted = deletedDocumentId(op);\n if (deleted !== undefined) {\n await this.relationalDb\n .deleteFrom(\"vetra_package\")\n .where(\"document_id\", \"=\", deleted)\n .execute();\n continue;\n }\n if (context.scope !== \"global\") continue;\n\n const state = context.resultingState\n ? (JSON.parse(context.resultingState) as VetraPackageGlobalState)\n : undefined;\n\n const getString = (val: unknown): string | null =>\n typeof val === \"string\" ? val : null;\n\n const now = new Date();\n const operationTimestamp = new Date(\n parseInt(operation.timestampUtcMs, 10),\n );\n\n await this.relationalDb\n .insertInto(\"vetra_package\")\n .values({\n document_id: context.documentId,\n name: getString(state?.name),\n description: getString(state?.description),\n category: getString(state?.category),\n author_name: getString(state?.author?.name),\n author_website: getString(state?.author?.website),\n keywords: state?.keywords ? JSON.stringify(state.keywords) : null,\n github_url: getString(state?.githubUrl),\n npm_url: getString(state?.npmUrl),\n last_operation_index: operation.index,\n last_operation_hash: operation.hash,\n last_operation_timestamp: operationTimestamp,\n drive_id: \"\", // Not available in new format\n created_at: now,\n updated_at: now,\n })\n .onConflict((oc) =>\n oc.column(\"document_id\").doUpdateSet({\n name: getString(state?.name),\n description: getString(state?.description),\n category: getString(state?.category),\n author_name: getString(state?.author?.name),\n author_website: getString(state?.author?.website),\n keywords: state?.keywords ? JSON.stringify(state.keywords) : null,\n github_url: getString(state?.githubUrl),\n npm_url: getString(state?.npmUrl),\n last_operation_index: operation.index,\n last_operation_hash: operation.hash,\n last_operation_timestamp: operationTimestamp,\n updated_at: now,\n }),\n )\n .execute();\n }\n }\n\n async onDisconnect() {}\n}\n","import type {\n IProcessorHostModule,\n ProcessorFactoryBuilder,\n ProcessorRecord,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocumentHeader } from \"@powerhousedao/shared/document-model\";\nimport { up } from \"./migrations.js\";\nimport { VetraReadModelProcessor } from \"./processor.js\";\nimport type { DB } from \"./schema.js\";\n\nexport const vetraReadModelFactoryBuilder: ProcessorFactoryBuilder = (\n module: IProcessorHostModule,\n) => {\n return async (_driveHeader: PHDocumentHeader): Promise<ProcessorRecord[]> => {\n // Create namespace (same as legacy - all vetra packages share one namespace)\n const db = await module.relationalDb.createNamespace<DB>(\"vetra-packages\");\n\n // Run migrations (idempotent - uses ifNotExists)\n await up(db);\n\n // Create the processor with the relational database\n const processor = new VetraReadModelProcessor(db);\n return [\n {\n processor,\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n documentType: [\"powerhouse/package\"],\n // \"document\" carries DELETE_DOCUMENT and PURGE_DOCUMENT.\n scope: [\"global\", \"document\"],\n },\n },\n ];\n };\n};\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as logger } from "./logger-
|
|
1
|
+
import { t as logger } from "./logger-BFxMdimR.js";
|
|
2
2
|
import { VETRA_PROCESSOR_CONFIG_KEY } from "@powerhousedao/config";
|
|
3
3
|
//#region processors/codegen/factory.ts
|
|
4
4
|
/**
|
|
@@ -26,7 +26,7 @@ const codegenFactoryBuilder = (module) => {
|
|
|
26
26
|
const [{ buildTsMorphProject }, { getConfig }, { CodegenProcessor }] = await Promise.all([
|
|
27
27
|
import("@powerhousedao/codegen/utils"),
|
|
28
28
|
import("@powerhousedao/config/node"),
|
|
29
|
-
import("./processor-
|
|
29
|
+
import("./processor-CsiUWh93.js").then((n) => n.n)
|
|
30
30
|
]);
|
|
31
31
|
const config = getConfig();
|
|
32
32
|
const cwd = process.cwd();
|
|
@@ -51,4 +51,4 @@ const codegenFactoryBuilder = (module) => {
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { codegenFactoryBuilder as t };
|
|
53
53
|
|
|
54
|
-
//# sourceMappingURL=factory-
|
|
54
|
+
//# sourceMappingURL=factory-BWrWHoS5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory-
|
|
1
|
+
{"version":3,"file":"factory-BWrWHoS5.js","names":[],"sources":["../processors/codegen/factory.ts"],"sourcesContent":["import type { VetraProcessorConfigType } from \"@powerhousedao/config\";\nimport { VETRA_PROCESSOR_CONFIG_KEY } from \"@powerhousedao/config\";\nimport type {\n IProcessorHostModule,\n ProcessorFactoryBuilder,\n ProcessorRecord,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocumentHeader } from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"./logger.js\";\n\n/**\n * Determines if a drive header matches the Vetra drive criteria.\n * @param driveHeader - The drive header to check\n * @param explicitDriveId - Optional explicit drive ID from config (if set, uses exact match)\n * @returns true if the drive is a Vetra drive, false otherwise\n */\nfunction isDriveVetra(\n driveHeader: PHDocumentHeader,\n driveIdFromConfig?: string,\n): boolean {\n // If explicit drive ID is configured, use exact match\n if (driveIdFromConfig) {\n return (\n driveHeader.slug === driveIdFromConfig ||\n driveHeader.id === driveIdFromConfig\n );\n }\n\n // Otherwise, check if slug/id matches Vetra pattern\n // Matches \"vetra\" exactly or IDs starting with \"vetra-\" (case-insensitive)\n const matchesPattern = (identifier: string): boolean => {\n const lower = identifier.toLowerCase();\n return lower === \"vetra\" || lower.startsWith(\"vetra-\");\n };\n\n return matchesPattern(driveHeader.slug) || matchesPattern(driveHeader.id);\n}\n\nexport const codegenFactoryBuilder: ProcessorFactoryBuilder = (\n module: IProcessorHostModule,\n) => {\n return async (driveHeader: PHDocumentHeader): Promise<ProcessorRecord[]> => {\n const processorsConfig = module.config ?? new Map<string, unknown>();\n const vetraConfig = processorsConfig.get(VETRA_PROCESSOR_CONFIG_KEY) as\n | VetraProcessorConfigType\n | undefined;\n\n // Exit early if it's not a vetra drive\n if (!isDriveVetra(driveHeader, vetraConfig?.driveId)) {\n logger.debug(\n `Drive ${driveHeader.slug} is not a Vetra drive, skipping codegen processor`,\n );\n return [];\n }\n\n logger.info(\n `Drive ${driveHeader.slug} is a Vetra drive, using codegen processor`,\n );\n\n // Lazy-load codegen only once a Vetra drive is confirmed.\n const [{ buildTsMorphProject }, { getConfig }, { CodegenProcessor }] =\n await Promise.all([\n import(\"@powerhousedao/codegen/utils\"),\n import(\"@powerhousedao/config/node\"),\n import(\"./processor.js\"),\n ]);\n\n const config = getConfig();\n const cwd = process.cwd();\n\n /* Use one instance of ts-morph project, which handles race conditions */\n const project = buildTsMorphProject(cwd);\n const processor = new CodegenProcessor(\n project,\n config,\n cwd,\n vetraConfig?.interactive,\n );\n return [\n {\n processor,\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n documentType: [\n \"powerhouse/document-model\",\n \"powerhouse/package\",\n \"powerhouse/document-editor\",\n \"powerhouse/subgraph\",\n \"powerhouse/processor\",\n \"powerhouse/app\",\n ],\n scope: [\"global\"],\n },\n },\n ];\n };\n};\n"],"mappings":";;;;;;;;;AAgBA,SAAS,aACP,aACA,mBACS;CAET,IAAI,mBACF,OACE,YAAY,SAAS,qBACrB,YAAY,OAAO;CAMvB,MAAM,kBAAkB,eAAgC;EACtD,MAAM,QAAQ,WAAW,YAAY;EACrC,OAAO,UAAU,WAAW,MAAM,WAAW,QAAQ;CACvD;CAEA,OAAO,eAAe,YAAY,IAAI,KAAK,eAAe,YAAY,EAAE;AAC1E;AAEA,MAAa,yBACX,WACG;CACH,OAAO,OAAO,gBAA8D;EAE1E,MAAM,eADmB,OAAO,0BAAU,IAAI,IAAqB,EAAA,CAC9B,IAAI,0BAA0B;EAKnE,IAAI,CAAC,aAAa,aAAa,aAAa,OAAO,GAAG;GACpD,OAAO,MACL,SAAS,YAAY,KAAK,kDAC5B;GACA,OAAO,CAAC;EACV;EAEA,OAAO,KACL,SAAS,YAAY,KAAK,2CAC5B;EAGA,MAAM,CAAC,EAAE,uBAAuB,EAAE,aAAa,EAAE,sBAC/C,MAAM,QAAQ,IAAI;GAChB,OAAO;GACP,OAAO;GACP,OAAO,0BAAiB,CAAA,MAAA,MAAA,EAAA,CAAA;EAC1B,CAAC;EAEH,MAAM,SAAS,UAAU;EACzB,MAAM,MAAM,QAAQ,IAAI;EAUxB,OAAO,CACL;GACE,WAAA,IARkB,iBADN,oBAAoB,GAE5B,GACN,QACA,KACA,aAAa,WAIH;GACR,QAAQ;IACN,QAAQ,CAAC,MAAM;IACf,YAAY,CAAC,GAAG;IAChB,cAAc;KACZ;KACA;KACA;KACA;KACA;KACA;IACF;IACA,OAAO,CAAC,QAAQ;GAClB;EACF,CACF;CACF;AACF"}
|
|
@@ -8,7 +8,7 @@ function useAvailableDocumentTypes(onlyDocumentTypesFromDriveDocuments = false)
|
|
|
8
8
|
const supportedDocumentTypes = useSupportedDocumentTypesInReactor() ?? [];
|
|
9
9
|
const documentTypesFromDocumentModelDocuments = (useDocumentsInSelectedDrive() ?? []).filter(isDocumentModelDocument).map((doc) => doc.state.global.id);
|
|
10
10
|
if (onlyDocumentTypesFromDriveDocuments) return [...new Set(documentTypesFromDocumentModelDocuments)];
|
|
11
|
-
return [
|
|
11
|
+
return [.../* @__PURE__ */ new Set([...supportedDocumentTypes, ...documentTypesFromDocumentModelDocuments])];
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region editors/hooks/useDebounce.ts
|
|
@@ -36,4 +36,4 @@ function useDebounce(value, callback, delay) {
|
|
|
36
36
|
//#endregion
|
|
37
37
|
export { useAvailableDocumentTypes as n, useDebounce as t };
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=hooks-
|
|
39
|
+
//# sourceMappingURL=hooks-BbxvC-C3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks-
|
|
1
|
+
{"version":3,"file":"hooks-BbxvC-C3.js","names":[],"sources":["../editors/hooks/useAvailableDocumentTypes.ts","../editors/hooks/useDebounce.ts"],"sourcesContent":["import {\n useDocumentsInSelectedDrive,\n useSupportedDocumentTypesInReactor,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n DocumentModelDocument,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\n\nfunction isDocumentModelDocument(\n document: PHDocument,\n): document is DocumentModelDocument {\n return document.header.documentType === \"powerhouse/document-model\";\n}\n\nexport function useAvailableDocumentTypes(\n onlyDocumentTypesFromDriveDocuments = false,\n): string[] {\n const supportedDocumentTypes = useSupportedDocumentTypesInReactor() ?? [];\n const documents = useDocumentsInSelectedDrive() ?? [];\n const documentModelDocumentsInSelectedDrive = documents.filter(\n isDocumentModelDocument,\n );\n const documentTypesFromDocumentModelDocuments =\n documentModelDocumentsInSelectedDrive.map((doc) => doc.state.global.id);\n\n if (onlyDocumentTypesFromDriveDocuments)\n return [...new Set(documentTypesFromDocumentModelDocuments)];\n\n return [\n ...new Set([\n ...supportedDocumentTypes,\n ...documentTypesFromDocumentModelDocuments,\n ]),\n ];\n}\n","import { useEffect } from \"react\";\n\n/**\n * Reusable debounce hook that calls a callback function after a specified delay\n * when the value changes. Useful for API calls, search inputs, etc.\n *\n * @param value - The value to debounce\n * @param callback - Function to call with the debounced value (optional)\n * @param delay - Delay in milliseconds\n */\nexport function useDebounce<T>(\n value: T,\n callback: ((value: T) => void) | undefined,\n delay: number,\n) {\n useEffect(() => {\n if (!callback) return;\n\n const timer = setTimeout(() => {\n callback(value);\n }, delay);\n\n return () => clearTimeout(timer);\n }, [value, callback, delay]);\n}\n"],"mappings":";;;AASA,SAAS,wBACP,UACmC;CACnC,OAAO,SAAS,OAAO,iBAAiB;AAC1C;AAEA,SAAgB,0BACd,sCAAsC,OAC5B;CACV,MAAM,yBAAyB,mCAAmC,KAAK,CAAC;CAKxE,MAAM,2CAJY,4BAA4B,KAAK,CAAC,EAAA,CACI,OACtD,uBAGoC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,OAAO,EAAE;CAExE,IAAI,qCACF,OAAO,CAAC,GAAG,IAAI,IAAI,uCAAuC,CAAC;CAE7D,OAAO,CACL,mBAAG,IAAI,IAAI,CACT,GAAG,wBACH,GAAG,uCACL,CAAC,CACH;AACF;;;;;;;;;;;ACzBA,SAAgB,YACd,OACA,UACA,OACA;CACA,gBAAgB;EACd,IAAI,CAAC,UAAU;EAEf,MAAM,QAAQ,iBAAiB;GAC7B,SAAS,KAAK;EAChB,GAAG,KAAK;EAER,aAAa,aAAa,KAAK;CACjC,GAAG;EAAC;EAAO;EAAU;CAAK,CAAC;AAC7B"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import * as document_model0 from "document-model";
|
|
2
1
|
import { Action, DocumentModelGlobalState, DocumentModelUtils, PHAuthState, PHBaseState, PHDocument, PHDocumentController, PHDocumentState, Reducer, SignalDispatch } from "document-model";
|
|
3
2
|
import * as z$1 from "zod";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
import { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
6
|
-
|
|
7
5
|
//#region document-models/processor-module/v1/gen/schema/types.d.ts
|
|
8
6
|
type Maybe<T> = T | null | undefined;
|
|
9
7
|
type InputMaybe<T> = T | null | undefined;
|
|
10
8
|
type Exact<T extends {
|
|
11
9
|
[key: string]: unknown;
|
|
12
|
-
}> = { [K in keyof T]: T[K] };
|
|
13
|
-
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]
|
|
14
|
-
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]
|
|
10
|
+
}> = { [K in keyof T]: T[K]; };
|
|
11
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]>; };
|
|
12
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]>; };
|
|
15
13
|
type MakeEmpty<T extends {
|
|
16
14
|
[key: string]: unknown;
|
|
17
|
-
}, K extends keyof T> = { [_ in K]?: never };
|
|
18
|
-
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
15
|
+
}, K extends keyof T> = { [_ in K]?: never; };
|
|
16
|
+
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; };
|
|
19
17
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
20
18
|
type Scalars = {
|
|
21
19
|
ID: {
|
|
@@ -152,7 +150,9 @@ type AddProcessorAppInput = {
|
|
|
152
150
|
};
|
|
153
151
|
/** A document type id (e.g. 'my-org/invoice') attached to the processor with a stable entry id. */
|
|
154
152
|
type DocumentTypeItem = {
|
|
155
|
-
/** Document type id this processor subscribes to. */
|
|
153
|
+
/** Document type id this processor subscribes to. */
|
|
154
|
+
documentType: Scalars["String"]["output"];
|
|
155
|
+
/** Stable identifier for the entry; used to remove it. */
|
|
156
156
|
id: Scalars["OID"]["output"];
|
|
157
157
|
};
|
|
158
158
|
/**
|
|
@@ -161,10 +161,15 @@ type DocumentTypeItem = {
|
|
|
161
161
|
* building a read model, indexing, syncing to an external system).
|
|
162
162
|
*/
|
|
163
163
|
type ProcessorModuleState = {
|
|
164
|
-
/** Document types this processor subscribes to. Each entry has a stable id so it can be removed individually. */
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
/** Document types this processor subscribes to. Each entry has a stable id so it can be removed individually. */
|
|
165
|
+
documentTypes: Array<DocumentTypeItem>;
|
|
166
|
+
/** Display name of the processor. Also determines the generated folder name under `processors/`. */
|
|
167
|
+
name: Scalars["String"]["output"];
|
|
168
|
+
/** Drive-app names this processor is attached to. The processor runs in the context of each listed app. */
|
|
169
|
+
processorApps: Array<Scalars["String"]["output"]>;
|
|
170
|
+
/** Lifecycle status. While DRAFT the processor definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation. */
|
|
171
|
+
status: StatusType;
|
|
172
|
+
/** Processor implementation kind (e.g. 'read-model', 'relational-db'). Determines which scaffold codegen emits. */
|
|
168
173
|
type: Scalars["String"]["output"];
|
|
169
174
|
};
|
|
170
175
|
type RemoveDocumentTypeInput = {
|
|
@@ -243,7 +248,7 @@ interface ProcessorModuleBaseOperationsOperations {
|
|
|
243
248
|
}
|
|
244
249
|
//#endregion
|
|
245
250
|
//#region document-models/processor-module/v1/gen/controller.d.ts
|
|
246
|
-
declare const ProcessorModuleController: new (initialDocument?:
|
|
251
|
+
declare const ProcessorModuleController: new (initialDocument?: import("document-model").PHDocument<ProcessorModulePHState> | undefined) => PHDocumentController<ProcessorModulePHState> & import("document-model").ActionMap<ProcessorModuleBaseOperationsAction, PHDocumentController<ProcessorModulePHState>>;
|
|
247
252
|
declare namespace creators_d_exports {
|
|
248
253
|
export { addDocumentType, addProcessorApp, removeDocumentType, removeProcessorApp, setProcessorName, setProcessorStatus, setProcessorType };
|
|
249
254
|
}
|
|
@@ -313,13 +318,6 @@ declare function isProcessorModuleDocument(document: unknown): document is Proce
|
|
|
313
318
|
/** Simple helper function to assert that a document is a ProcessorModule document */
|
|
314
319
|
declare function assertIsProcessorModuleDocument(document: unknown): asserts document is ProcessorModuleDocument;
|
|
315
320
|
//#endregion
|
|
316
|
-
//#region document-models/processor-module/v1/gen/document-type.d.ts
|
|
317
|
-
/**
|
|
318
|
-
* WARNING: DO NOT EDIT
|
|
319
|
-
* This file is auto-generated and updated by codegen
|
|
320
|
-
*/
|
|
321
|
-
declare const processorModuleDocumentType = "powerhouse/processor";
|
|
322
|
-
//#endregion
|
|
323
321
|
//#region document-models/processor-module/v1/gen/ph-factories.d.ts
|
|
324
322
|
declare function defaultGlobalState(): ProcessorModuleState;
|
|
325
323
|
declare function defaultLocalState(): ProcessorModuleLocalState;
|
|
@@ -337,31 +335,6 @@ declare function createProcessorModuleDocument(state?: Partial<{
|
|
|
337
335
|
local?: Partial<ProcessorModuleLocalState>;
|
|
338
336
|
}>): ProcessorModuleDocument;
|
|
339
337
|
//#endregion
|
|
340
|
-
//#region document-models/processor-module/v1/actions.d.ts
|
|
341
|
-
/** Actions for the ProcessorModule document model */
|
|
342
|
-
declare const actions: {
|
|
343
|
-
setProcessorName: (input: SetProcessorNameInput) => SetProcessorNameAction;
|
|
344
|
-
setProcessorType: (input: SetProcessorTypeInput) => SetProcessorTypeAction;
|
|
345
|
-
addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
|
|
346
|
-
removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
|
|
347
|
-
addProcessorApp: (input: AddProcessorAppInput) => AddProcessorAppAction;
|
|
348
|
-
removeProcessorApp: (input: RemoveProcessorAppInput) => RemoveProcessorAppAction;
|
|
349
|
-
setProcessorStatus: (input: SetProcessorStatusInput) => SetProcessorStatusAction;
|
|
350
|
-
setName: (name: string | {
|
|
351
|
-
name: string;
|
|
352
|
-
}) => document_model0.SetNameAction;
|
|
353
|
-
setPreferredEditor: (input: string | null | {
|
|
354
|
-
preferredEditor: string | null;
|
|
355
|
-
}) => document_model0.SetPreferredEditorAction;
|
|
356
|
-
undo: (count?: number, scope?: string) => document_model0.UndoAction;
|
|
357
|
-
redo: (count?: number, scope?: string) => document_model0.RedoAction;
|
|
358
|
-
prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
|
|
359
|
-
loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
|
|
360
|
-
name: string;
|
|
361
|
-
}, operations: number) => document_model0.LoadStateAction;
|
|
362
|
-
noop: (scope?: string) => document_model0.NOOPAction;
|
|
363
|
-
};
|
|
364
|
-
//#endregion
|
|
365
338
|
//#region document-models/processor-module/v1/hooks.d.ts
|
|
366
339
|
/** Hook to get a ProcessorModule document by its id */
|
|
367
340
|
declare function useProcessorModuleDocumentById(documentId: string | null | undefined): [ProcessorModuleDocument, DocumentDispatch<ProcessorModuleAction>] | [undefined, undefined];
|
|
@@ -376,8 +349,13 @@ declare function useProcessorModuleDocumentsInSelectedFolder(): ProcessorModuleD
|
|
|
376
349
|
/** Document model module for the ProcessorModule document type */
|
|
377
350
|
declare const ProcessorModule: {
|
|
378
351
|
readonly version: 1;
|
|
379
|
-
readonly reducer:
|
|
352
|
+
readonly reducer: import("document-model").Reducer<ProcessorModulePHState>;
|
|
380
353
|
readonly actions: {
|
|
354
|
+
setName: typeof import("document-model").setName;
|
|
355
|
+
setPreferredEditor: typeof import("document-model").setPreferredEditor;
|
|
356
|
+
undo: typeof import("document-model").undo;
|
|
357
|
+
redo: typeof import("document-model").redo;
|
|
358
|
+
noop: typeof import("document-model").noop;
|
|
381
359
|
setProcessorName: (input: SetProcessorNameInput) => SetProcessorNameAction;
|
|
382
360
|
setProcessorType: (input: SetProcessorTypeInput) => SetProcessorTypeAction;
|
|
383
361
|
addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
|
|
@@ -385,22 +363,9 @@ declare const ProcessorModule: {
|
|
|
385
363
|
addProcessorApp: (input: AddProcessorAppInput) => AddProcessorAppAction;
|
|
386
364
|
removeProcessorApp: (input: RemoveProcessorAppInput) => RemoveProcessorAppAction;
|
|
387
365
|
setProcessorStatus: (input: SetProcessorStatusInput) => SetProcessorStatusAction;
|
|
388
|
-
setName: (name: string | {
|
|
389
|
-
name: string;
|
|
390
|
-
}) => document_model0.SetNameAction;
|
|
391
|
-
setPreferredEditor: (input: string | null | {
|
|
392
|
-
preferredEditor: string | null;
|
|
393
|
-
}) => document_model0.SetPreferredEditorAction;
|
|
394
|
-
undo: (count?: number, scope?: string) => document_model0.UndoAction;
|
|
395
|
-
redo: (count?: number, scope?: string) => document_model0.RedoAction;
|
|
396
|
-
prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
|
|
397
|
-
loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
|
|
398
|
-
name: string;
|
|
399
|
-
}, operations: number) => document_model0.LoadStateAction;
|
|
400
|
-
noop: (scope?: string) => document_model0.NOOPAction;
|
|
401
366
|
};
|
|
402
|
-
readonly utils:
|
|
403
|
-
readonly documentModel:
|
|
367
|
+
readonly utils: import("document-model").DocumentModelUtils<ProcessorModulePHState>;
|
|
368
|
+
readonly documentModel: import("document-model").DocumentModelPHState;
|
|
404
369
|
};
|
|
405
370
|
//#endregion
|
|
406
371
|
//#region document-models/processor-module/v1/utils.d.ts
|
|
@@ -411,7 +376,7 @@ declare const utils: DocumentModelUtils<ProcessorModulePHState>;
|
|
|
411
376
|
declare const reducer: Reducer<ProcessorModulePHState>;
|
|
412
377
|
//#endregion
|
|
413
378
|
//#region document-models/processor-module/v1/gen/schema/zod.d.ts
|
|
414
|
-
type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]
|
|
379
|
+
type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]>; }>;
|
|
415
380
|
type definedNonNullAny = {};
|
|
416
381
|
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
417
382
|
declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
@@ -433,5 +398,6 @@ declare function SetProcessorTypeInputSchema(): z$1.ZodObject<Properties<SetProc
|
|
|
433
398
|
declare const initialGlobalState: ProcessorModuleState;
|
|
434
399
|
declare const initialLocalState: ProcessorModuleLocalState;
|
|
435
400
|
//#endregion
|
|
436
|
-
export {
|
|
437
|
-
|
|
401
|
+
export { SetProcessorTypeAction as $, assertIsProcessorModuleDocument as A, setProcessorName as B, createState$1 as C, ProcessorModuleDocumentHeaderSchema as D, defaultPHState as E, addDocumentType as F, ProcessorModuleAction as G, setProcessorType as H, addProcessorApp as I, ProcessorModuleBaseOperationsAction as J, AddDocumentTypeAction as K, creators_d_exports as L, isProcessorModuleDocument as M, isProcessorModuleState as N, ProcessorModuleDocumentSchema as O, documentModel as P, SetProcessorStatusAction as Q, removeDocumentType as R, createProcessorModuleDocument as S, defaultLocalState as T, ProcessorModuleController as U, setProcessorStatus as V, ProcessorModuleBaseOperationsOperations as W, RemoveProcessorAppAction as X, RemoveDocumentTypeAction as Y, SetProcessorNameAction as Z, ProcessorModule as _, SetProcessorNameInput as _t, DocumentTypeItemSchema as a, DocumentTypeItem as at, useProcessorModuleDocumentsInSelectedFolder as b, StatusType as bt, RemoveProcessorAppInputSchema as c, InputMaybe as ct, SetProcessorTypeInputSchema as d, MakeOptional as dt, ProcessorModuleDocument as et, StatusTypeSchema as f, Maybe as ft, utils as g, Scalars as gt, reducer as h, RemoveProcessorAppInput as ht, AddProcessorAppInputSchema as i, AddProcessorAppInput as it, assertIsProcessorModuleState as j, ProcessorModulePHStateSchema as k, SetProcessorNameInputSchema as l, MakeEmpty as lt, isDefinedNonNullAny as m, RemoveDocumentTypeInput as mt, initialLocalState as n, ProcessorModulePHState as nt, ProcessorModuleStateSchema as o, Exact as ot, definedNonNullAnySchema as p, ProcessorModuleState as pt, AddProcessorAppAction as q, AddDocumentTypeInputSchema as r, AddDocumentTypeInput as rt, RemoveDocumentTypeInputSchema as s, Incremental as st, initialGlobalState as t, ProcessorModuleLocalState as tt, SetProcessorStatusInputSchema as u, MakeMaybe as ut, useProcessorModuleDocumentById as v, SetProcessorStatusInput as vt, defaultGlobalState as w, useSelectedProcessorModuleDocument as x, useProcessorModuleDocumentsInSelectedDrive as y, SetProcessorTypeInput as yt, removeProcessorApp as z };
|
|
402
|
+
export {};
|
|
403
|
+
//# sourceMappingURL=index-B52jv-LY.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B52jv-LY.d.ts","names":[],"sources":["../document-models/processor-module/v1/gen/schema/types.ts","../document-models/processor-module/v1/gen/types.ts","../document-models/processor-module/v1/gen/base-operations/actions.ts","../document-models/processor-module/v1/gen/actions.ts","../document-models/processor-module/v1/gen/base-operations/operations.ts","../document-models/processor-module/v1/gen/controller.ts","../document-models/processor-module/v1/gen/base-operations/creators.ts","../document-models/processor-module/v1/gen/document-model.ts","../document-models/processor-module/v1/gen/document-schema.ts","../document-models/processor-module/v1/gen/ph-factories.ts","../document-models/processor-module/v1/hooks.ts","../document-models/processor-module/v1/module.ts","../document-models/processor-module/v1/utils.ts","../document-models/processor-module/v1/gen/reducer.ts","../document-models/processor-module/v1/gen/schema/zod.ts","../document-models/processor-module/v1/gen/utils.ts"],"mappings":"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"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import * as document_model0 from "document-model";
|
|
2
1
|
import { Action, DocumentModelGlobalState, DocumentModelUtils, PHAuthState, PHBaseState, PHDocument, PHDocumentController, PHDocumentState, Reducer, SignalDispatch } from "document-model";
|
|
3
2
|
import * as z$1 from "zod";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
import { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
6
|
-
|
|
7
5
|
//#region document-models/document-editor/v1/gen/schema/types.d.ts
|
|
8
6
|
type Maybe<T> = T | null | undefined;
|
|
9
7
|
type InputMaybe<T> = T | null | undefined;
|
|
10
8
|
type Exact<T extends {
|
|
11
9
|
[key: string]: unknown;
|
|
12
|
-
}> = { [K in keyof T]: T[K] };
|
|
13
|
-
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]
|
|
14
|
-
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]
|
|
10
|
+
}> = { [K in keyof T]: T[K]; };
|
|
11
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]>; };
|
|
12
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]>; };
|
|
15
13
|
type MakeEmpty<T extends {
|
|
16
14
|
[key: string]: unknown;
|
|
17
|
-
}, K extends keyof T> = { [_ in K]?: never };
|
|
18
|
-
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
15
|
+
}, K extends keyof T> = { [_ in K]?: never; };
|
|
16
|
+
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; };
|
|
19
17
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
20
18
|
type Scalars = {
|
|
21
19
|
ID: {
|
|
@@ -153,13 +151,18 @@ type AddDocumentTypeInput = {
|
|
|
153
151
|
* the first matching editor when opening a document.
|
|
154
152
|
*/
|
|
155
153
|
type DocumentEditorState = {
|
|
156
|
-
/** Document types this editor can edit. Each entry has a stable id so it can be removed individually. */
|
|
157
|
-
|
|
154
|
+
/** Document types this editor can edit. Each entry has a stable id so it can be removed individually. */
|
|
155
|
+
documentTypes: Array<DocumentTypeItem>;
|
|
156
|
+
/** Display name of the editor. Also determines the generated folder name under `editors/`. */
|
|
157
|
+
name: Scalars["String"]["output"];
|
|
158
|
+
/** Lifecycle status. While DRAFT the editor definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation. */
|
|
158
159
|
status: StatusType;
|
|
159
160
|
};
|
|
160
161
|
/** A document type id (e.g. 'powerhouse/document-drive') attached to the editor with a stable entry id. */
|
|
161
162
|
type DocumentTypeItem = {
|
|
162
|
-
/** Document type id this editor handles (e.g. 'my-org/invoice'). */
|
|
163
|
+
/** Document type id this editor handles (e.g. 'my-org/invoice'). */
|
|
164
|
+
documentType: Scalars["String"]["output"];
|
|
165
|
+
/** Stable identifier for the entry; used to remove it. */
|
|
163
166
|
id: Scalars["OID"]["output"];
|
|
164
167
|
};
|
|
165
168
|
type RemoveDocumentTypeInput = {
|
|
@@ -217,7 +220,7 @@ interface DocumentEditorBaseOperationsOperations {
|
|
|
217
220
|
}
|
|
218
221
|
//#endregion
|
|
219
222
|
//#region document-models/document-editor/v1/gen/controller.d.ts
|
|
220
|
-
declare const DocumentEditorController: new (initialDocument?:
|
|
223
|
+
declare const DocumentEditorController: new (initialDocument?: import("document-model").PHDocument<DocumentEditorPHState> | undefined) => PHDocumentController<DocumentEditorPHState> & import("document-model").ActionMap<DocumentEditorBaseOperationsAction, PHDocumentController<DocumentEditorPHState>>;
|
|
221
224
|
declare namespace creators_d_exports {
|
|
222
225
|
export { addDocumentType, removeDocumentType, setEditorName, setEditorStatus };
|
|
223
226
|
}
|
|
@@ -278,13 +281,6 @@ declare function isDocumentEditorDocument(document: unknown): document is Docume
|
|
|
278
281
|
/** Simple helper function to assert that a document is a DocumentEditor document */
|
|
279
282
|
declare function assertIsDocumentEditorDocument(document: unknown): asserts document is DocumentEditorDocument;
|
|
280
283
|
//#endregion
|
|
281
|
-
//#region document-models/document-editor/v1/gen/document-type.d.ts
|
|
282
|
-
/**
|
|
283
|
-
* WARNING: DO NOT EDIT
|
|
284
|
-
* This file is auto-generated and updated by codegen
|
|
285
|
-
*/
|
|
286
|
-
declare const documentEditorDocumentType = "powerhouse/document-editor";
|
|
287
|
-
//#endregion
|
|
288
284
|
//#region document-models/document-editor/v1/gen/ph-factories.d.ts
|
|
289
285
|
declare function defaultGlobalState(): DocumentEditorState;
|
|
290
286
|
declare function defaultLocalState(): DocumentEditorLocalState;
|
|
@@ -302,28 +298,6 @@ declare function createDocumentEditorDocument(state?: Partial<{
|
|
|
302
298
|
local?: Partial<DocumentEditorLocalState>;
|
|
303
299
|
}>): DocumentEditorDocument;
|
|
304
300
|
//#endregion
|
|
305
|
-
//#region document-models/document-editor/v1/actions.d.ts
|
|
306
|
-
/** Actions for the DocumentEditor document model */
|
|
307
|
-
declare const actions: {
|
|
308
|
-
setEditorName: (input: SetEditorNameInput) => SetEditorNameAction;
|
|
309
|
-
addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
|
|
310
|
-
removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
|
|
311
|
-
setEditorStatus: (input: SetEditorStatusInput) => SetEditorStatusAction;
|
|
312
|
-
setName: (name: string | {
|
|
313
|
-
name: string;
|
|
314
|
-
}) => document_model0.SetNameAction;
|
|
315
|
-
setPreferredEditor: (input: string | null | {
|
|
316
|
-
preferredEditor: string | null;
|
|
317
|
-
}) => document_model0.SetPreferredEditorAction;
|
|
318
|
-
undo: (count?: number, scope?: string) => document_model0.UndoAction;
|
|
319
|
-
redo: (count?: number, scope?: string) => document_model0.RedoAction;
|
|
320
|
-
prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
|
|
321
|
-
loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
|
|
322
|
-
name: string;
|
|
323
|
-
}, operations: number) => document_model0.LoadStateAction;
|
|
324
|
-
noop: (scope?: string) => document_model0.NOOPAction;
|
|
325
|
-
};
|
|
326
|
-
//#endregion
|
|
327
301
|
//#region document-models/document-editor/v1/hooks.d.ts
|
|
328
302
|
/** Hook to get a DocumentEditor document by its id */
|
|
329
303
|
declare function useDocumentEditorDocumentById(documentId: string | null | undefined): [DocumentEditorDocument, DocumentDispatch<DocumentEditorAction>] | [undefined, undefined];
|
|
@@ -338,28 +312,20 @@ declare function useDocumentEditorDocumentsInSelectedFolder(): DocumentEditorDoc
|
|
|
338
312
|
/** Document model module for the DocumentEditor document type */
|
|
339
313
|
declare const DocumentEditor: {
|
|
340
314
|
readonly version: 1;
|
|
341
|
-
readonly reducer:
|
|
315
|
+
readonly reducer: import("document-model").Reducer<DocumentEditorPHState>;
|
|
342
316
|
readonly actions: {
|
|
317
|
+
setName: typeof import("document-model").setName;
|
|
318
|
+
setPreferredEditor: typeof import("document-model").setPreferredEditor;
|
|
319
|
+
undo: typeof import("document-model").undo;
|
|
320
|
+
redo: typeof import("document-model").redo;
|
|
321
|
+
noop: typeof import("document-model").noop;
|
|
343
322
|
setEditorName: (input: SetEditorNameInput) => SetEditorNameAction;
|
|
344
323
|
addDocumentType: (input: AddDocumentTypeInput) => AddDocumentTypeAction;
|
|
345
324
|
removeDocumentType: (input: RemoveDocumentTypeInput) => RemoveDocumentTypeAction;
|
|
346
325
|
setEditorStatus: (input: SetEditorStatusInput) => SetEditorStatusAction;
|
|
347
|
-
setName: (name: string | {
|
|
348
|
-
name: string;
|
|
349
|
-
}) => document_model0.SetNameAction;
|
|
350
|
-
setPreferredEditor: (input: string | null | {
|
|
351
|
-
preferredEditor: string | null;
|
|
352
|
-
}) => document_model0.SetPreferredEditorAction;
|
|
353
|
-
undo: (count?: number, scope?: string) => document_model0.UndoAction;
|
|
354
|
-
redo: (count?: number, scope?: string) => document_model0.RedoAction;
|
|
355
|
-
prune: (start?: number, end?: number, scope?: string) => document_model0.SchemaPruneAction;
|
|
356
|
-
loadState: <TState extends document_model0.PHBaseState = document_model0.PHBaseState>(state: TState & {
|
|
357
|
-
name: string;
|
|
358
|
-
}, operations: number) => document_model0.LoadStateAction;
|
|
359
|
-
noop: (scope?: string) => document_model0.NOOPAction;
|
|
360
326
|
};
|
|
361
|
-
readonly utils:
|
|
362
|
-
readonly documentModel:
|
|
327
|
+
readonly utils: import("document-model").DocumentModelUtils<DocumentEditorPHState>;
|
|
328
|
+
readonly documentModel: import("document-model").DocumentModelPHState;
|
|
363
329
|
};
|
|
364
330
|
//#endregion
|
|
365
331
|
//#region document-models/document-editor/v1/utils.d.ts
|
|
@@ -370,7 +336,7 @@ declare const utils: DocumentModelUtils<DocumentEditorPHState>;
|
|
|
370
336
|
declare const reducer: Reducer<DocumentEditorPHState>;
|
|
371
337
|
//#endregion
|
|
372
338
|
//#region document-models/document-editor/v1/gen/schema/zod.d.ts
|
|
373
|
-
type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]
|
|
339
|
+
type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]>; }>;
|
|
374
340
|
type definedNonNullAny = {};
|
|
375
341
|
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
376
342
|
declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
@@ -389,5 +355,6 @@ declare function SetEditorStatusInputSchema(): z$1.ZodObject<Properties<SetEdito
|
|
|
389
355
|
declare const initialGlobalState: DocumentEditorState;
|
|
390
356
|
declare const initialLocalState: DocumentEditorLocalState;
|
|
391
357
|
//#endregion
|
|
392
|
-
export {
|
|
393
|
-
|
|
358
|
+
export { InputMaybe as $, isDocumentEditorState as A, AddDocumentTypeAction as B, defaultPHState as C, assertIsDocumentEditorDocument as D, DocumentEditorPHStateSchema as E, setEditorName as F, DocumentEditorDocument as G, RemoveDocumentTypeAction as H, setEditorStatus as I, AddDocumentTypeInput as J, DocumentEditorLocalState as K, DocumentEditorController as L, addDocumentType as M, creators_d_exports as N, assertIsDocumentEditorState as O, removeDocumentType as P, Incremental as Q, DocumentEditorBaseOperationsOperations as R, defaultLocalState as S, DocumentEditorDocumentSchema as T, SetEditorNameAction as U, DocumentEditorBaseOperationsAction as V, SetEditorStatusAction as W, DocumentTypeItem as X, DocumentEditorState as Y, Exact as Z, useDocumentEditorDocumentsInSelectedFolder as _, DocumentTypeItemSchema as a, Scalars as at, createState$1 as b, SetEditorStatusInputSchema as c, StatusType as ct, isDefinedNonNullAny as d, MakeEmpty as et, reducer as f, useDocumentEditorDocumentsInSelectedDrive as g, useDocumentEditorDocumentById as h, DocumentEditorStateSchema as i, RemoveDocumentTypeInput as it, documentModel as j, isDocumentEditorDocument as k, StatusTypeSchema as l, DocumentEditor as m, initialLocalState as n, MakeOptional as nt, RemoveDocumentTypeInputSchema as o, SetEditorNameInput as ot, utils as p, DocumentEditorPHState as q, AddDocumentTypeInputSchema as r, Maybe as rt, SetEditorNameInputSchema as s, SetEditorStatusInput as st, initialGlobalState as t, MakeMaybe as tt, definedNonNullAnySchema as u, useSelectedDocumentEditorDocument as v, DocumentEditorDocumentHeaderSchema as w, defaultGlobalState as x, createDocumentEditorDocument as y, DocumentEditorAction as z };
|
|
359
|
+
export {};
|
|
360
|
+
//# sourceMappingURL=index-D6Ai0OOc.d.ts.map
|