@powerhousedao/vetra 6.0.0-dev.256 → 6.0.0-dev.258
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-module-D_cAVvt0.js +48 -0
- package/dist/app-module-D_cAVvt0.js.map +1 -0
- package/dist/codegen/index.d.ts +117 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +793 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/{connect-CTIucT0o.js → connect-BRlVKs1s.js} +1 -1
- package/dist/{connect-CTIucT0o.js.map → connect-BRlVKs1s.js.map} +1 -1
- package/dist/document-editor-1NFr9t3a.js +48 -0
- package/dist/document-editor-1NFr9t3a.js.map +1 -0
- package/dist/document-models/app-module/index.d.ts +1 -1
- package/dist/document-models/app-module/index.js +4 -2
- package/dist/document-models/document-editor/index.d.ts +1 -1
- package/dist/document-models/document-editor/index.js +4 -2
- package/dist/document-models/index.d.ts +5 -5
- package/dist/document-models/index.js +5 -5
- package/dist/document-models/processor-module/index.d.ts +1 -1
- package/dist/document-models/processor-module/index.js +4 -2
- package/dist/document-models/subgraph-module/index.d.ts +1 -1
- package/dist/document-models/subgraph-module/index.js +4 -2
- package/dist/document-models/vetra-package/index.d.ts +1 -1
- package/dist/document-models/vetra-package/index.js +2 -2
- package/dist/{editor-CbtrPBTP.js → editor-BwbJ65NZ.js} +4 -4
- package/dist/{editor-CbtrPBTP.js.map → editor-BwbJ65NZ.js.map} +1 -1
- package/dist/{editor-BSQfwcdz.js → editor-CJAn9WTA.js} +4 -4
- package/dist/{editor-BSQfwcdz.js.map → editor-CJAn9WTA.js.map} +1 -1
- package/dist/{editor-D70FYIwV.js → editor-CLERZjRS.js} +1 -1
- package/dist/{editor-D70FYIwV.js.map → editor-CLERZjRS.js.map} +1 -1
- package/dist/{editor-Dtg8STyT.js → editor-DWufJcmG.js} +4 -4
- package/dist/{editor-Dtg8STyT.js.map → editor-DWufJcmG.js.map} +1 -1
- package/dist/{editor-SfVorwsP.js → editor-DabfMxkF.js} +4 -4
- package/dist/{editor-SfVorwsP.js.map → editor-DabfMxkF.js.map} +1 -1
- package/dist/{editor-Bku8e2dr.js → editor-WWMGVelM.js} +4 -4
- package/dist/{editor-Bku8e2dr.js.map → editor-WWMGVelM.js.map} +1 -1
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/{factory-D8ZDOMP3.js → factory-Bd_0OaF8.js} +2 -2
- package/dist/{factory-D8ZDOMP3.js.map → factory-Bd_0OaF8.js.map} +1 -1
- package/dist/{factory-BBzu0pRO.js → factory-CEzh-u5J.js} +5 -5
- package/dist/{factory-BBzu0pRO.js.map → factory-CEzh-u5J.js.map} +1 -1
- package/dist/{hooks-Xexr33XS.js → hooks-Btogj1f0.js} +1 -1
- package/dist/{hooks-Xexr33XS.js.map → hooks-Btogj1f0.js.map} +1 -1
- package/dist/{module-BYEvqA47.d.ts → index-BPoF8P3O.d.ts} +57 -57
- package/dist/index-BPoF8P3O.d.ts.map +1 -0
- package/dist/{module-CpP8D2Hl.d.ts → index-BoGed4Fa.d.ts} +88 -88
- package/dist/index-BoGed4Fa.d.ts.map +1 -0
- package/dist/{index-BfK0fsx4.d.ts → index-C4s0aLv3.d.ts} +49 -49
- package/dist/index-C4s0aLv3.d.ts.map +1 -0
- package/dist/{index-BdmD5tsW.d.ts → index-ClaOdn_F.d.ts} +46 -46
- package/dist/index-ClaOdn_F.d.ts.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/{logger-BLNtquAC.js → logger-CYkStoEb.js} +1 -1
- package/dist/{logger-BLNtquAC.js.map → logger-CYkStoEb.js.map} +1 -1
- package/dist/module-DPyV2vUY.js +138 -0
- package/dist/module-DPyV2vUY.js.map +1 -0
- package/dist/{module-CCqD26Hf.d.ts → module-Drla4Vmn.d.ts} +1 -1
- package/dist/{module-CCqD26Hf.d.ts.map → module-Drla4Vmn.d.ts.map} +1 -1
- package/dist/{module-CZLiUtDI.js → module-dDKBr6QY.js} +1 -1
- package/dist/{module-CZLiUtDI.js.map → module-dDKBr6QY.js.map} +1 -1
- package/dist/{module-CXIFrq-R.js → module-jWN6gsmi.js} +7 -7
- package/dist/{module-CXIFrq-R.js.map → module-jWN6gsmi.js.map} +1 -1
- package/dist/module-pK0hpO6c.js +131 -0
- package/dist/module-pK0hpO6c.js.map +1 -0
- package/dist/module-ryHOwQp-.js +105 -0
- package/dist/module-ryHOwQp-.js.map +1 -0
- package/dist/module-x2Liyk0-.js +80 -0
- package/dist/module-x2Liyk0-.js.map +1 -0
- package/dist/ph-factories-B0_E6LY6.js +53 -0
- package/dist/ph-factories-B0_E6LY6.js.map +1 -0
- package/dist/ph-factories-B6PSPkPQ.js +52 -0
- package/dist/ph-factories-B6PSPkPQ.js.map +1 -0
- package/dist/ph-factories-Bn_HTUfT.js +50 -0
- package/dist/ph-factories-Bn_HTUfT.js.map +1 -0
- package/dist/ph-factories-CJXfT_Z1.js +51 -0
- package/dist/ph-factories-CJXfT_Z1.js.map +1 -0
- package/dist/processor-module-B7IAItXQ.js +48 -0
- package/dist/processor-module-B7IAItXQ.js.map +1 -0
- package/dist/processors/codegen/index.d.ts +3 -21305
- package/dist/processors/codegen/index.d.ts.map +1 -1
- package/dist/processors/codegen/index.js +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/vetra-read-model/index.js +1 -1
- package/dist/subgraph-module-CfzSZTNC.js +48 -0
- package/dist/subgraph-module-CfzSZTNC.js.map +1 -0
- package/dist/switchboard-CIUZkhea.js +8 -0
- package/dist/{switchboard-D69j45OO.js.map → switchboard-CIUZkhea.js.map} +1 -1
- package/dist/{useVetraDocument-DoAwvHVi.js → useVetraDocument-BQKyels4.js} +1 -1
- package/dist/{useVetraDocument-DoAwvHVi.js.map → useVetraDocument-BQKyels4.js.map} +1 -1
- package/dist/{module-CTPfENDU.js → utils-BRx88WW3.js} +5 -130
- package/dist/utils-BRx88WW3.js.map +1 -0
- package/dist/{module-BWlCj_0C.js → utils-Byjf33qt.js} +5 -137
- package/dist/utils-Byjf33qt.js.map +1 -0
- package/dist/{module-BoGgbKmO.js → utils-CWO5kDus.js} +5 -79
- package/dist/utils-CWO5kDus.js.map +1 -0
- package/dist/{module-D0SK3Nds.js → utils-CnZc-0E4.js} +5 -104
- package/dist/utils-CnZc-0E4.js.map +1 -0
- package/dist/{vetra-package-YNLxEA-U.js → vetra-package-BgTjv343.js} +2 -2
- package/dist/{vetra-package-YNLxEA-U.js.map → vetra-package-BgTjv343.js.map} +1 -1
- package/package.json +12 -8
- package/dist/app-module-Bbj7PI-S.js +0 -94
- package/dist/app-module-Bbj7PI-S.js.map +0 -1
- package/dist/document-editor-DS-bZMKx.js +0 -93
- package/dist/document-editor-DS-bZMKx.js.map +0 -1
- package/dist/index-BdmD5tsW.d.ts.map +0 -1
- package/dist/index-BfK0fsx4.d.ts.map +0 -1
- package/dist/module-BWlCj_0C.js.map +0 -1
- package/dist/module-BYEvqA47.d.ts.map +0 -1
- package/dist/module-BoGgbKmO.js.map +0 -1
- package/dist/module-CTPfENDU.js.map +0 -1
- package/dist/module-CpP8D2Hl.d.ts.map +0 -1
- package/dist/module-D0SK3Nds.js.map +0 -1
- package/dist/processor-module-D0lRrrpW.js +0 -95
- package/dist/processor-module-D0lRrrpW.js.map +0 -1
- package/dist/subgraph-module-B3ipwOza.js +0 -92
- package/dist/subgraph-module-B3ipwOza.js.map +0 -1
- package/dist/switchboard-D69j45OO.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-pK0hpO6c.js","names":["genUtils","customUtils"],"sources":["../document-models/app-module/v1/gen/document-model.ts","../document-models/app-module/v1/src/utils.ts","../document-models/app-module/v1/utils.ts","../document-models/app-module/v1/module.ts"],"sourcesContent":["import type { DocumentModelGlobalState } from \"document-model\";\n\nexport const documentModel: DocumentModelGlobalState = {\n id: \"powerhouse/app\",\n name: \"App Module\",\n author: {\n name: \"Powerhouse\",\n website: \"https://powerhouse.inc\",\n },\n extension: \".app\",\n description:\n \"Declares a custom Drive App (a drive-level UI surface) shipped by a Vetra Reactor Package. Use one App Module document per drive app: configure which document types it handles, whether it accepts drag-and-drop, and mark it CONFIRMED to trigger codegen of the corresponding app scaffold under `apps/`.\",\n specifications: [\n {\n state: {\n local: {\n schema: \"\",\n examples: [],\n initialValue: \"\",\n },\n global: {\n schema:\n '\"\"\"\\nConfiguration for a Drive App contributed by the package. Drive apps render a\\ncustom view at the drive level (instead of, or alongside, the document file\\ntree) and can opt into which document types they accept.\\n\"\"\"\\ntype AppModuleState {\\n \"\"\"Display name of the drive app. Also used as the source for the generated folder name under `apps/`.\"\"\"\\n name: String!\\n \"\"\"Lifecycle status. While DRAFT the app definition is editable and codegen is skipped; switching to CONFIRMED triggers app scaffold generation.\"\"\"\\n status: StatusType!\\n \"\"\"Document type ids this app handles. `null` means the app accepts any document type; an empty list means it accepts none.\"\"\"\\n allowedDocumentTypes: [String!]\\n \"\"\"Whether the app surface accepts dropped files from the user. Defaults to true.\"\"\"\\n isDragAndDropEnabled: Boolean!\\n}\\n\\n\"\"\"\\nLifecycle status of a module definition.\\n- DRAFT: still being edited; codegen does not run.\\n- CONFIRMED: locked in; codegen produces the corresponding scaffold.\\n\"\"\"\\nenum StatusType {\\n DRAFT\\n CONFIRMED\\n}',\n examples: [],\n initialValue:\n '{\\n \"name\": \"\",\\n \"status\": \"DRAFT\",\\n \"allowedDocumentTypes\": null,\\n \"isDragAndDropEnabled\": true\\n}',\n },\n },\n modules: [\n {\n id: \"d274599a-ceb5-4f2b-8651-b25787306734\",\n name: \"base_operations\",\n description:\n \"Set the app's identity, lifecycle status, and the document types it handles.\",\n operations: [\n {\n id: \"f2ba2ddc-8527-4162-93bd-e045e9932013\",\n name: \"SET_APP_NAME\",\n description:\n \"Set the display name of the drive app. Also determines the generated folder name under `apps/`.\",\n schema: \"input SetAppNameInput {\\n name: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"c842efa4-154c-4fd9-9d12-42bec51af4e9\",\n name: \"SET_APP_STATUS\",\n description:\n \"Move the app between DRAFT and CONFIRMED. Codegen only runs once the status is CONFIRMED.\",\n schema: \"input SetAppStatusInput {\\n status: StatusType!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"7376f168-695f-4aef-94d0-6e381666358c\",\n name: \"ADD_DOCUMENT_TYPE\",\n description:\n \"Append a document type id to the list of types this app handles. Initializes the list if it was `null` (accept-any).\",\n schema:\n \"input AddDocumentTypeInput {\\n documentType: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"310e4e5b-3f14-4e9a-8e09-5583c7698a65\",\n name: \"REMOVE_DOCUMENT_TYPE\",\n description:\n \"Remove a document type id from the handled list. No-op if the type is not present.\",\n schema:\n \"input RemoveDocumentTypeInput {\\n documentType: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"b365727a-7df3-48f0-a4f8-02362f02ad1d\",\n name: \"SET_DOCUMENT_TYPES\",\n description:\n \"Replace the entire allowed-document-types list in one call. Pass an empty list to accept none.\",\n schema:\n \"input SetDocumentTypesInput {\\n documentTypes: [String!]!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n {\n id: \"270faa10-92e9-40d0-b128-2de32704bcb5\",\n name: \"dnd_operations\",\n description:\n \"Toggle drag-and-drop file handling for the app surface.\",\n operations: [\n {\n id: \"077b1ab8-cb32-4b4e-a1fa-76178188c6a1\",\n name: \"SET_DRAG_AND_DROP_ENABLED\",\n description:\n \"Enable or disable drag-and-drop file handling on the app surface.\",\n schema:\n \"input SetDragAndDropEnabledInput {\\n enabled: Boolean!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from \"document-model\";\nimport type { AppModulePHState } from \"./gen/types.js\";\nimport { utils as genUtils } from \"./gen/utils.js\";\nimport * as customUtils from \"./src/utils.js\";\n\n/** Utils for the AppModule document model */\nexport const utils: DocumentModelUtils<AppModulePHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from \"document-model\";\nimport { createState, defaultBaseState } from \"document-model\";\nimport { actions } from \"./actions.js\";\nimport { documentModel } from \"./gen/document-model.js\";\nimport { reducer } from \"./gen/reducer.js\";\nimport type { AppModulePHState } from \"./gen/types.js\";\nimport { utils } from \"./utils.js\";\n\n/** Document model module for the AppModule document type */\nexport const AppModule = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<AppModulePHState>;\n"],"mappings":";;;;AAEA,MAAa,gBAA0C;CACrD,IAAI;CACJ,MAAM;CACN,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CACD,WAAW;CACX,aACE;CACF,gBAAgB,CACd;EACE,OAAO;GACL,OAAO;IACL,QAAQ;IACR,UAAU,EAAE;IACZ,cAAc;IACf;GACD,QAAQ;IACN,QACE;IACF,UAAU,EAAE;IACZ,cACE;IACH;GACF;EACD,SAAS,CACP;GACE,IAAI;GACJ,MAAM;GACN,aACE;GACF,YAAY;IACV;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QAAQ;KACR,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACD;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QAAQ;KACR,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACD;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QACE;KACF,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACD;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QACE;KACF,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACD;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QACE;KACF,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACF;GACF,EACD;GACE,IAAI;GACJ,MAAM;GACN,aACE;GACF,YAAY,CACV;IACE,IAAI;IACJ,MAAM;IACN,aACE;IACF,QACE;IACF,UAAU;IACV,SAAS;IACT,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,OAAO;IACR,CACF;GACF,CACF;EACD,SAAS;EACT,WAAW,EAAE;EACd,CACF;CACF;;;;;;;AEpHD,MAAa,QAA8C;CACzD,GAAGA;CACH,GAAGC;CACJ;;;;ACAD,MAAa,YAAY;CACvB,SAAS;CACT;CACA;CACA;CACA,eAAe,YAAY,kBAAkB,EAAE,cAAc;CAC9D"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
+
import { f as reducer, p as actions, r as utils$1 } from "./utils-CnZc-0E4.js";
|
|
3
|
+
import { createState, defaultBaseState } from "document-model";
|
|
4
|
+
//#region document-models/document-editor/v1/gen/document-model.ts
|
|
5
|
+
const documentModel = {
|
|
6
|
+
id: "powerhouse/document-editor",
|
|
7
|
+
name: "Document Editor",
|
|
8
|
+
author: {
|
|
9
|
+
name: "Powerhouse",
|
|
10
|
+
website: "https://powerhouse.inc"
|
|
11
|
+
},
|
|
12
|
+
extension: ".editor",
|
|
13
|
+
description: "Declares a document editor (a React UI for editing instances of one or more document models) shipped by a Vetra Reactor Package. Create one Document Editor document per editor, list the document types it can edit, then mark it CONFIRMED to trigger codegen of the editor scaffold under `editors/`. The boilerplate it produces is what you then customize.",
|
|
14
|
+
specifications: [{
|
|
15
|
+
state: {
|
|
16
|
+
local: {
|
|
17
|
+
schema: "",
|
|
18
|
+
examples: [],
|
|
19
|
+
initialValue: ""
|
|
20
|
+
},
|
|
21
|
+
global: {
|
|
22
|
+
schema: "\"\"\"\nConfiguration for a document editor contributed by the package. The editor is\nregistered against every document type listed in `documentTypes`; Connect picks\nthe first matching editor when opening a document.\n\"\"\"\ntype DocumentEditorState {\n \"\"\"Display name of the editor. Also determines the generated folder name under `editors/`.\"\"\"\n name: String!\n \"\"\"Document types this editor can edit. Each entry has a stable id so it can be removed individually.\"\"\"\n documentTypes: [DocumentTypeItem!]!\n \"\"\"Lifecycle status. While DRAFT the editor definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation.\"\"\"\n status: StatusType!\n}\n\n\"\"\"A document type id (e.g. 'powerhouse/document-drive') attached to the editor with a stable entry id.\"\"\"\ntype DocumentTypeItem {\n \"\"\"Stable identifier for the entry; used to remove it.\"\"\"\n id: OID!\n \"\"\"Document type id this editor handles (e.g. 'my-org/invoice').\"\"\"\n documentType: String!\n}\n\n\"\"\"\nLifecycle status of a module definition.\n- DRAFT: still being edited; codegen does not run.\n- CONFIRMED: locked in; codegen produces the corresponding scaffold.\n\"\"\"\nenum StatusType {\n DRAFT\n CONFIRMED\n}",
|
|
23
|
+
examples: [],
|
|
24
|
+
initialValue: "{\n \"name\": \"\",\n \"documentTypes\": [],\n \"status\": \"DRAFT\"\n}"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
modules: [{
|
|
28
|
+
id: "73f6d103-47cb-4074-a736-a3eaf5d079bf",
|
|
29
|
+
name: "base_operations",
|
|
30
|
+
description: "Set the editor's identity, lifecycle status, and the document types it handles.",
|
|
31
|
+
operations: [
|
|
32
|
+
{
|
|
33
|
+
id: "50a16f00-d25a-4c97-9632-4ce3b951a402",
|
|
34
|
+
name: "SET_EDITOR_NAME",
|
|
35
|
+
description: "Set the display name of the editor. Also determines the generated folder name under `editors/`.",
|
|
36
|
+
schema: "input SetEditorNameInput {\n name: String!\n}",
|
|
37
|
+
template: "",
|
|
38
|
+
reducer: "",
|
|
39
|
+
errors: [],
|
|
40
|
+
examples: [],
|
|
41
|
+
scope: "global"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "acee4272-f29e-4a19-aaf9-bae2cb6652ab",
|
|
45
|
+
name: "ADD_DOCUMENT_TYPE",
|
|
46
|
+
description: "Register a document type this editor can edit. Caller supplies a stable id so the entry can be removed later.",
|
|
47
|
+
schema: "input AddDocumentTypeInput {\n id: OID!\n documentType: String!\n}",
|
|
48
|
+
template: "",
|
|
49
|
+
reducer: "",
|
|
50
|
+
errors: [],
|
|
51
|
+
examples: [],
|
|
52
|
+
scope: "global"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "6c549776-0fc3-4632-a6c7-8721fa6ee41c",
|
|
56
|
+
name: "REMOVE_DOCUMENT_TYPE",
|
|
57
|
+
description: "Remove a registered document type entry by its id.",
|
|
58
|
+
schema: "input RemoveDocumentTypeInput {\n id: OID!\n}",
|
|
59
|
+
template: "",
|
|
60
|
+
reducer: "",
|
|
61
|
+
errors: [],
|
|
62
|
+
examples: [],
|
|
63
|
+
scope: "global"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "e9aa7f08-553b-452f-a494-126ace6b15f7",
|
|
67
|
+
name: "SET_EDITOR_STATUS",
|
|
68
|
+
description: "Move the editor between DRAFT and CONFIRMED. Codegen only runs once the status is CONFIRMED — leaving it DRAFT means no editor files are produced.",
|
|
69
|
+
schema: "input SetEditorStatusInput {\n status: StatusType!\n}",
|
|
70
|
+
template: "",
|
|
71
|
+
reducer: "",
|
|
72
|
+
errors: [],
|
|
73
|
+
examples: [],
|
|
74
|
+
scope: "global"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}],
|
|
78
|
+
version: 1,
|
|
79
|
+
changeLog: []
|
|
80
|
+
}]
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region document-models/document-editor/v1/src/utils.ts
|
|
84
|
+
var utils_exports = /* @__PURE__ */ __exportAll({});
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region document-models/document-editor/v1/utils.ts
|
|
87
|
+
/** Utils for the DocumentEditor document model */
|
|
88
|
+
const utils = {
|
|
89
|
+
...utils$1,
|
|
90
|
+
...utils_exports
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region document-models/document-editor/v1/module.ts
|
|
94
|
+
/** Document model module for the DocumentEditor document type */
|
|
95
|
+
const DocumentEditor = {
|
|
96
|
+
version: 1,
|
|
97
|
+
reducer,
|
|
98
|
+
actions,
|
|
99
|
+
utils,
|
|
100
|
+
documentModel: createState(defaultBaseState(), documentModel)
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { utils as n, documentModel as r, DocumentEditor as t };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=module-ryHOwQp-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-ryHOwQp-.js","names":["genUtils","customUtils"],"sources":["../document-models/document-editor/v1/gen/document-model.ts","../document-models/document-editor/v1/src/utils.ts","../document-models/document-editor/v1/utils.ts","../document-models/document-editor/v1/module.ts"],"sourcesContent":["import type { DocumentModelGlobalState } from \"document-model\";\n\nexport const documentModel: DocumentModelGlobalState = {\n id: \"powerhouse/document-editor\",\n name: \"Document Editor\",\n author: {\n name: \"Powerhouse\",\n website: \"https://powerhouse.inc\",\n },\n extension: \".editor\",\n description:\n \"Declares a document editor (a React UI for editing instances of one or more document models) shipped by a Vetra Reactor Package. Create one Document Editor document per editor, list the document types it can edit, then mark it CONFIRMED to trigger codegen of the editor scaffold under `editors/`. The boilerplate it produces is what you then customize.\",\n specifications: [\n {\n state: {\n local: {\n schema: \"\",\n examples: [],\n initialValue: \"\",\n },\n global: {\n schema:\n '\"\"\"\\nConfiguration for a document editor contributed by the package. The editor is\\nregistered against every document type listed in `documentTypes`; Connect picks\\nthe first matching editor when opening a document.\\n\"\"\"\\ntype DocumentEditorState {\\n \"\"\"Display name of the editor. Also determines the generated folder name under `editors/`.\"\"\"\\n name: String!\\n \"\"\"Document types this editor can edit. Each entry has a stable id so it can be removed individually.\"\"\"\\n documentTypes: [DocumentTypeItem!]!\\n \"\"\"Lifecycle status. While DRAFT the editor definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation.\"\"\"\\n status: StatusType!\\n}\\n\\n\"\"\"A document type id (e.g. \\'powerhouse/document-drive\\') attached to the editor with a stable entry id.\"\"\"\\ntype DocumentTypeItem {\\n \"\"\"Stable identifier for the entry; used to remove it.\"\"\"\\n id: OID!\\n \"\"\"Document type id this editor handles (e.g. \\'my-org/invoice\\').\"\"\"\\n documentType: String!\\n}\\n\\n\"\"\"\\nLifecycle status of a module definition.\\n- DRAFT: still being edited; codegen does not run.\\n- CONFIRMED: locked in; codegen produces the corresponding scaffold.\\n\"\"\"\\nenum StatusType {\\n DRAFT\\n CONFIRMED\\n}',\n examples: [],\n initialValue:\n '{\\n \"name\": \"\",\\n \"documentTypes\": [],\\n \"status\": \"DRAFT\"\\n}',\n },\n },\n modules: [\n {\n id: \"73f6d103-47cb-4074-a736-a3eaf5d079bf\",\n name: \"base_operations\",\n description:\n \"Set the editor's identity, lifecycle status, and the document types it handles.\",\n operations: [\n {\n id: \"50a16f00-d25a-4c97-9632-4ce3b951a402\",\n name: \"SET_EDITOR_NAME\",\n description:\n \"Set the display name of the editor. Also determines the generated folder name under `editors/`.\",\n schema: \"input SetEditorNameInput {\\n name: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"acee4272-f29e-4a19-aaf9-bae2cb6652ab\",\n name: \"ADD_DOCUMENT_TYPE\",\n description:\n \"Register a document type this editor can edit. Caller supplies a stable id so the entry can be removed later.\",\n schema:\n \"input AddDocumentTypeInput {\\n id: OID!\\n documentType: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"6c549776-0fc3-4632-a6c7-8721fa6ee41c\",\n name: \"REMOVE_DOCUMENT_TYPE\",\n description: \"Remove a registered document type entry by its id.\",\n schema: \"input RemoveDocumentTypeInput {\\n id: OID!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"e9aa7f08-553b-452f-a494-126ace6b15f7\",\n name: \"SET_EDITOR_STATUS\",\n description:\n \"Move the editor between DRAFT and CONFIRMED. Codegen only runs once the status is CONFIRMED \\u2014 leaving it DRAFT means no editor files are produced.\",\n schema: \"input SetEditorStatusInput {\\n status: StatusType!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from \"document-model\";\nimport type { DocumentEditorPHState } from \"./gen/types.js\";\nimport { utils as genUtils } from \"./gen/utils.js\";\nimport * as customUtils from \"./src/utils.js\";\n\n/** Utils for the DocumentEditor document model */\nexport const utils: DocumentModelUtils<DocumentEditorPHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from \"document-model\";\nimport { createState, defaultBaseState } from \"document-model\";\nimport { actions } from \"./actions.js\";\nimport { documentModel } from \"./gen/document-model.js\";\nimport { reducer } from \"./gen/reducer.js\";\nimport type { DocumentEditorPHState } from \"./gen/types.js\";\nimport { utils } from \"./utils.js\";\n\n/** Document model module for the DocumentEditor document type */\nexport const DocumentEditor = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<DocumentEditorPHState>;\n"],"mappings":";;;;AAEA,MAAa,gBAA0C;CACrD,IAAI;CACJ,MAAM;CACN,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CACD,WAAW;CACX,aACE;CACF,gBAAgB,CACd;EACE,OAAO;GACL,OAAO;IACL,QAAQ;IACR,UAAU,EAAE;IACZ,cAAc;IACf;GACD,QAAQ;IACN,QACE;IACF,UAAU,EAAE;IACZ,cACE;IACH;GACF;EACD,SAAS,CACP;GACE,IAAI;GACJ,MAAM;GACN,aACE;GACF,YAAY;IACV;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QAAQ;KACR,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACD;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QACE;KACF,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACD;KACE,IAAI;KACJ,MAAM;KACN,aAAa;KACb,QAAQ;KACR,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACD;KACE,IAAI;KACJ,MAAM;KACN,aACE;KACF,QAAQ;KACR,UAAU;KACV,SAAS;KACT,QAAQ,EAAE;KACV,UAAU,EAAE;KACZ,OAAO;KACR;IACF;GACF,CACF;EACD,SAAS;EACT,WAAW,EAAE;EACd,CACF;CACF;;;;;;;AEhFD,MAAa,QAAmD;CAC9D,GAAGA;CACH,GAAGC;CACJ;;;;ACAD,MAAa,iBAAiB;CAC5B,SAAS;CACT;CACA;CACA;CACA,eAAe,YAAY,kBAAkB,EAAE,cAAc;CAC9D"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
+
import { f as reducer, p as actions, r as utils$1 } from "./utils-CWO5kDus.js";
|
|
3
|
+
import { createState, defaultBaseState } from "document-model";
|
|
4
|
+
//#region document-models/subgraph-module/v1/gen/document-model.ts
|
|
5
|
+
const documentModel = {
|
|
6
|
+
id: "powerhouse/subgraph",
|
|
7
|
+
name: "Subgraph Module",
|
|
8
|
+
author: {
|
|
9
|
+
name: "Powerhouse",
|
|
10
|
+
website: "https://powerhouse.inc"
|
|
11
|
+
},
|
|
12
|
+
extension: ".subgraph",
|
|
13
|
+
description: "Declares a GraphQL subgraph (a slice of the Switchboard API contributed by the package) shipped by a Vetra Reactor Package. Create one Subgraph Module document per subgraph, then mark it CONFIRMED to trigger codegen of the subgraph scaffold under `subgraphs/` — the resolvers and schema you flesh out there are stitched into the Switchboard graph at runtime.",
|
|
14
|
+
specifications: [{
|
|
15
|
+
state: {
|
|
16
|
+
local: {
|
|
17
|
+
schema: "",
|
|
18
|
+
examples: [],
|
|
19
|
+
initialValue: ""
|
|
20
|
+
},
|
|
21
|
+
global: {
|
|
22
|
+
schema: "\"\"\"\nConfiguration for a GraphQL subgraph contributed by the package. The subgraph\nis served by Switchboard and stitched into the unified Powerhouse API.\n\"\"\"\ntype SubgraphModuleState {\n \"\"\"Display name of the subgraph. Also determines the generated folder name under `subgraphs/` and the route segment Switchboard mounts it at.\"\"\"\n name: String!\n \"\"\"Lifecycle status. While DRAFT the subgraph definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation.\"\"\"\n status: StatusType!\n}\n\n\"\"\"\nLifecycle status of a module definition.\n- DRAFT: still being edited; codegen does not run.\n- CONFIRMED: locked in; codegen produces the corresponding scaffold.\n\"\"\"\nenum StatusType {\n DRAFT\n CONFIRMED\n}",
|
|
23
|
+
examples: [],
|
|
24
|
+
initialValue: "{\n \"name\": \"\",\n \"status\": \"DRAFT\"\n}"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
modules: [{
|
|
28
|
+
id: "8af5bda9-6fc7-4427-bfed-1d32d76a552f",
|
|
29
|
+
name: "base_operations",
|
|
30
|
+
description: "Set the subgraph's identity and lifecycle status.",
|
|
31
|
+
operations: [{
|
|
32
|
+
id: "d7cd6b6b-01ea-42c8-97e2-288e04b50b42",
|
|
33
|
+
name: "SET_SUBGRAPH_NAME",
|
|
34
|
+
description: "Set the display name of the subgraph. Also determines the generated folder under `subgraphs/` and the route segment Switchboard mounts it at.",
|
|
35
|
+
schema: "input SetSubgraphNameInput {\n name: String!\n}",
|
|
36
|
+
template: "",
|
|
37
|
+
reducer: "",
|
|
38
|
+
errors: [],
|
|
39
|
+
examples: [],
|
|
40
|
+
scope: "global"
|
|
41
|
+
}, {
|
|
42
|
+
id: "5a20e641-dc36-428e-8924-ecb07f3f1b94",
|
|
43
|
+
name: "SET_SUBGRAPH_STATUS",
|
|
44
|
+
description: "Move the subgraph between DRAFT and CONFIRMED. Codegen only runs once the status is CONFIRMED.",
|
|
45
|
+
schema: "input SetSubgraphStatusInput {\n status: StatusType!\n}",
|
|
46
|
+
template: "",
|
|
47
|
+
reducer: "",
|
|
48
|
+
errors: [],
|
|
49
|
+
examples: [],
|
|
50
|
+
scope: "global"
|
|
51
|
+
}]
|
|
52
|
+
}],
|
|
53
|
+
version: 1,
|
|
54
|
+
changeLog: []
|
|
55
|
+
}]
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region document-models/subgraph-module/v1/src/utils.ts
|
|
59
|
+
var utils_exports = /* @__PURE__ */ __exportAll({});
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region document-models/subgraph-module/v1/utils.ts
|
|
62
|
+
/** Utils for the SubgraphModule document model */
|
|
63
|
+
const utils = {
|
|
64
|
+
...utils$1,
|
|
65
|
+
...utils_exports
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region document-models/subgraph-module/v1/module.ts
|
|
69
|
+
/** Document model module for the SubgraphModule document type */
|
|
70
|
+
const SubgraphModule = {
|
|
71
|
+
version: 1,
|
|
72
|
+
reducer,
|
|
73
|
+
actions,
|
|
74
|
+
utils,
|
|
75
|
+
documentModel: createState(defaultBaseState(), documentModel)
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { utils as n, documentModel as r, SubgraphModule as t };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=module-x2Liyk0-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-x2Liyk0-.js","names":["genUtils","customUtils"],"sources":["../document-models/subgraph-module/v1/gen/document-model.ts","../document-models/subgraph-module/v1/src/utils.ts","../document-models/subgraph-module/v1/utils.ts","../document-models/subgraph-module/v1/module.ts"],"sourcesContent":["import type { DocumentModelGlobalState } from \"document-model\";\n\nexport const documentModel: DocumentModelGlobalState = {\n id: \"powerhouse/subgraph\",\n name: \"Subgraph Module\",\n author: {\n name: \"Powerhouse\",\n website: \"https://powerhouse.inc\",\n },\n extension: \".subgraph\",\n description:\n \"Declares a GraphQL subgraph (a slice of the Switchboard API contributed by the package) shipped by a Vetra Reactor Package. Create one Subgraph Module document per subgraph, then mark it CONFIRMED to trigger codegen of the subgraph scaffold under `subgraphs/` \\u2014 the resolvers and schema you flesh out there are stitched into the Switchboard graph at runtime.\",\n specifications: [\n {\n state: {\n local: {\n schema: \"\",\n examples: [],\n initialValue: \"\",\n },\n global: {\n schema:\n '\"\"\"\\nConfiguration for a GraphQL subgraph contributed by the package. The subgraph\\nis served by Switchboard and stitched into the unified Powerhouse API.\\n\"\"\"\\ntype SubgraphModuleState {\\n \"\"\"Display name of the subgraph. Also determines the generated folder name under `subgraphs/` and the route segment Switchboard mounts it at.\"\"\"\\n name: String!\\n \"\"\"Lifecycle status. While DRAFT the subgraph definition is editable and codegen is skipped; switching to CONFIRMED triggers scaffold generation.\"\"\"\\n status: StatusType!\\n}\\n\\n\"\"\"\\nLifecycle status of a module definition.\\n- DRAFT: still being edited; codegen does not run.\\n- CONFIRMED: locked in; codegen produces the corresponding scaffold.\\n\"\"\"\\nenum StatusType {\\n DRAFT\\n CONFIRMED\\n}',\n examples: [],\n initialValue: '{\\n \"name\": \"\",\\n \"status\": \"DRAFT\"\\n}',\n },\n },\n modules: [\n {\n id: \"8af5bda9-6fc7-4427-bfed-1d32d76a552f\",\n name: \"base_operations\",\n description: \"Set the subgraph's identity and lifecycle status.\",\n operations: [\n {\n id: \"d7cd6b6b-01ea-42c8-97e2-288e04b50b42\",\n name: \"SET_SUBGRAPH_NAME\",\n description:\n \"Set the display name of the subgraph. Also determines the generated folder under `subgraphs/` and the route segment Switchboard mounts it at.\",\n schema: \"input SetSubgraphNameInput {\\n name: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"5a20e641-dc36-428e-8924-ecb07f3f1b94\",\n name: \"SET_SUBGRAPH_STATUS\",\n description:\n \"Move the subgraph between DRAFT and CONFIRMED. Codegen only runs once the status is CONFIRMED.\",\n schema:\n \"input SetSubgraphStatusInput {\\n status: StatusType!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from \"document-model\";\nimport type { SubgraphModulePHState } from \"./gen/types.js\";\nimport { utils as genUtils } from \"./gen/utils.js\";\nimport * as customUtils from \"./src/utils.js\";\n\n/** Utils for the SubgraphModule document model */\nexport const utils: DocumentModelUtils<SubgraphModulePHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from \"document-model\";\nimport { createState, defaultBaseState } from \"document-model\";\nimport { actions } from \"./actions.js\";\nimport { documentModel } from \"./gen/document-model.js\";\nimport { reducer } from \"./gen/reducer.js\";\nimport type { SubgraphModulePHState } from \"./gen/types.js\";\nimport { utils } from \"./utils.js\";\n\n/** Document model module for the SubgraphModule document type */\nexport const SubgraphModule = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<SubgraphModulePHState>;\n"],"mappings":";;;;AAEA,MAAa,gBAA0C;CACrD,IAAI;CACJ,MAAM;CACN,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CACD,WAAW;CACX,aACE;CACF,gBAAgB,CACd;EACE,OAAO;GACL,OAAO;IACL,QAAQ;IACR,UAAU,EAAE;IACZ,cAAc;IACf;GACD,QAAQ;IACN,QACE;IACF,UAAU,EAAE;IACZ,cAAc;IACf;GACF;EACD,SAAS,CACP;GACE,IAAI;GACJ,MAAM;GACN,aAAa;GACb,YAAY,CACV;IACE,IAAI;IACJ,MAAM;IACN,aACE;IACF,QAAQ;IACR,UAAU;IACV,SAAS;IACT,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,OAAO;IACR,EACD;IACE,IAAI;IACJ,MAAM;IACN,aACE;IACF,QACE;IACF,UAAU;IACV,SAAS;IACT,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,OAAO;IACR,CACF;GACF,CACF;EACD,SAAS;EACT,WAAW,EAAE;EACd,CACF;CACF;;;;;;;AEvDD,MAAa,QAAmD;CAC9D,GAAGA;CACH,GAAGC;CACJ;;;;ACAD,MAAa,iBAAiB;CAC5B,SAAS;CACT;CACA;CACA;CACA,eAAe,YAAY,kBAAkB,EAAE,cAAc;CAC9D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { r as utils } from "./utils-Byjf33qt.js";
|
|
2
|
+
import { createBaseState, defaultBaseState } from "document-model";
|
|
3
|
+
//#region document-models/processor-module/v1/gen/ph-factories.ts
|
|
4
|
+
function defaultGlobalState() {
|
|
5
|
+
return {
|
|
6
|
+
name: "",
|
|
7
|
+
type: "",
|
|
8
|
+
documentTypes: [],
|
|
9
|
+
status: "DRAFT",
|
|
10
|
+
processorApps: []
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function defaultLocalState() {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
function defaultPHState() {
|
|
17
|
+
return {
|
|
18
|
+
...defaultBaseState(),
|
|
19
|
+
global: defaultGlobalState(),
|
|
20
|
+
local: defaultLocalState()
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function createGlobalState(state) {
|
|
24
|
+
return {
|
|
25
|
+
...defaultGlobalState(),
|
|
26
|
+
...state || {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function createLocalState(state) {
|
|
30
|
+
return {
|
|
31
|
+
...defaultLocalState(),
|
|
32
|
+
...state || {}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function createState$1(baseState, globalState, localState) {
|
|
36
|
+
return {
|
|
37
|
+
...createBaseState(baseState?.auth, baseState?.document),
|
|
38
|
+
global: createGlobalState(globalState),
|
|
39
|
+
local: createLocalState(localState)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Creates a ProcessorModuleDocument with custom global and local state
|
|
44
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
45
|
+
* document-specific state to be set.
|
|
46
|
+
*/
|
|
47
|
+
function createProcessorModuleDocument(state) {
|
|
48
|
+
return utils.createDocument(state ? createState$1(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { defaultPHState as a, defaultLocalState as i, createState$1 as n, defaultGlobalState as r, createProcessorModuleDocument as t };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=ph-factories-B0_E6LY6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ph-factories-B0_E6LY6.js","names":["createState"],"sources":["../document-models/processor-module/v1/gen/ph-factories.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n * Factory methods for creating ProcessorModuleDocument instances\n */\nimport type { PHAuthState, PHBaseState, PHDocumentState } from \"document-model\";\nimport { createBaseState, defaultBaseState } from \"document-model\";\nimport type {\n ProcessorModuleDocument,\n ProcessorModuleGlobalState,\n ProcessorModuleLocalState,\n ProcessorModulePHState,\n} from \"./types.js\";\nimport { utils } from \"./utils.js\";\n\nexport function defaultGlobalState(): ProcessorModuleGlobalState {\n return {\n name: \"\",\n type: \"\",\n documentTypes: [],\n status: \"DRAFT\",\n processorApps: [],\n };\n}\n\nexport function defaultLocalState(): ProcessorModuleLocalState {\n return {};\n}\n\nexport function defaultPHState(): ProcessorModulePHState {\n return {\n ...defaultBaseState(),\n global: defaultGlobalState(),\n local: defaultLocalState(),\n };\n}\n\nexport function createGlobalState(\n state?: Partial<ProcessorModuleGlobalState>,\n): ProcessorModuleGlobalState {\n return {\n ...defaultGlobalState(),\n ...(state || {}),\n };\n}\n\nexport function createLocalState(\n state?: Partial<ProcessorModuleLocalState>,\n): ProcessorModuleLocalState {\n return {\n ...defaultLocalState(),\n ...(state || {}),\n } as ProcessorModuleLocalState;\n}\n\nexport function createState(\n baseState?: Partial<PHBaseState>,\n globalState?: Partial<ProcessorModuleGlobalState>,\n localState?: Partial<ProcessorModuleLocalState>,\n): ProcessorModulePHState {\n return {\n ...createBaseState(baseState?.auth, baseState?.document),\n global: createGlobalState(globalState),\n local: createLocalState(localState),\n };\n}\n\n/**\n * Creates a ProcessorModuleDocument with custom global and local state\n * This properly handles the PHBaseState requirements while allowing\n * document-specific state to be set.\n */\nexport function createProcessorModuleDocument(\n state?: Partial<{\n auth?: Partial<PHAuthState>;\n document?: Partial<PHDocumentState>;\n global?: Partial<ProcessorModuleGlobalState>;\n local?: Partial<ProcessorModuleLocalState>;\n }>,\n): ProcessorModuleDocument {\n const document = utils.createDocument(\n state\n ? createState(\n createBaseState(state.auth, state.document),\n state.global,\n state.local,\n )\n : undefined,\n );\n\n return document;\n}\n"],"mappings":";;;AAeA,SAAgB,qBAAiD;AAC/D,QAAO;EACL,MAAM;EACN,MAAM;EACN,eAAe,EAAE;EACjB,QAAQ;EACR,eAAe,EAAE;EAClB;;AAGH,SAAgB,oBAA+C;AAC7D,QAAO,EAAE;;AAGX,SAAgB,iBAAyC;AACvD,QAAO;EACL,GAAG,kBAAkB;EACrB,QAAQ,oBAAoB;EAC5B,OAAO,mBAAmB;EAC3B;;AAGH,SAAgB,kBACd,OAC4B;AAC5B,QAAO;EACL,GAAG,oBAAoB;EACvB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgB,iBACd,OAC2B;AAC3B,QAAO;EACL,GAAG,mBAAmB;EACtB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgBA,cACd,WACA,aACA,YACwB;AACxB,QAAO;EACL,GAAG,gBAAgB,WAAW,MAAM,WAAW,SAAS;EACxD,QAAQ,kBAAkB,YAAY;EACtC,OAAO,iBAAiB,WAAW;EACpC;;;;;;;AAQH,SAAgB,8BACd,OAMyB;AAWzB,QAViB,MAAM,eACrB,QACIA,cACE,gBAAgB,MAAM,MAAM,MAAM,SAAS,EAC3C,MAAM,QACN,MAAM,MACP,GACD,KAAA,EACL"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { r as utils } from "./utils-BRx88WW3.js";
|
|
2
|
+
import { createBaseState, defaultBaseState } from "document-model";
|
|
3
|
+
//#region document-models/app-module/v1/gen/ph-factories.ts
|
|
4
|
+
function defaultGlobalState() {
|
|
5
|
+
return {
|
|
6
|
+
name: "",
|
|
7
|
+
status: "DRAFT",
|
|
8
|
+
allowedDocumentTypes: null,
|
|
9
|
+
isDragAndDropEnabled: true
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function defaultLocalState() {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
function defaultPHState() {
|
|
16
|
+
return {
|
|
17
|
+
...defaultBaseState(),
|
|
18
|
+
global: defaultGlobalState(),
|
|
19
|
+
local: defaultLocalState()
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function createGlobalState(state) {
|
|
23
|
+
return {
|
|
24
|
+
...defaultGlobalState(),
|
|
25
|
+
...state || {}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function createLocalState(state) {
|
|
29
|
+
return {
|
|
30
|
+
...defaultLocalState(),
|
|
31
|
+
...state || {}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function createState$1(baseState, globalState, localState) {
|
|
35
|
+
return {
|
|
36
|
+
...createBaseState(baseState?.auth, baseState?.document),
|
|
37
|
+
global: createGlobalState(globalState),
|
|
38
|
+
local: createLocalState(localState)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a AppModuleDocument with custom global and local state
|
|
43
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
44
|
+
* document-specific state to be set.
|
|
45
|
+
*/
|
|
46
|
+
function createAppModuleDocument(state) {
|
|
47
|
+
return utils.createDocument(state ? createState$1(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { defaultPHState as a, defaultLocalState as i, createState$1 as n, defaultGlobalState as r, createAppModuleDocument as t };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=ph-factories-B6PSPkPQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ph-factories-B6PSPkPQ.js","names":["createState"],"sources":["../document-models/app-module/v1/gen/ph-factories.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n * Factory methods for creating AppModuleDocument instances\n */\nimport type { PHAuthState, PHBaseState, PHDocumentState } from \"document-model\";\nimport { createBaseState, defaultBaseState } from \"document-model\";\nimport type {\n AppModuleDocument,\n AppModuleGlobalState,\n AppModuleLocalState,\n AppModulePHState,\n} from \"./types.js\";\nimport { utils } from \"./utils.js\";\n\nexport function defaultGlobalState(): AppModuleGlobalState {\n return {\n name: \"\",\n status: \"DRAFT\",\n allowedDocumentTypes: null,\n isDragAndDropEnabled: true,\n };\n}\n\nexport function defaultLocalState(): AppModuleLocalState {\n return {};\n}\n\nexport function defaultPHState(): AppModulePHState {\n return {\n ...defaultBaseState(),\n global: defaultGlobalState(),\n local: defaultLocalState(),\n };\n}\n\nexport function createGlobalState(\n state?: Partial<AppModuleGlobalState>,\n): AppModuleGlobalState {\n return {\n ...defaultGlobalState(),\n ...(state || {}),\n };\n}\n\nexport function createLocalState(\n state?: Partial<AppModuleLocalState>,\n): AppModuleLocalState {\n return {\n ...defaultLocalState(),\n ...(state || {}),\n } as AppModuleLocalState;\n}\n\nexport function createState(\n baseState?: Partial<PHBaseState>,\n globalState?: Partial<AppModuleGlobalState>,\n localState?: Partial<AppModuleLocalState>,\n): AppModulePHState {\n return {\n ...createBaseState(baseState?.auth, baseState?.document),\n global: createGlobalState(globalState),\n local: createLocalState(localState),\n };\n}\n\n/**\n * Creates a AppModuleDocument with custom global and local state\n * This properly handles the PHBaseState requirements while allowing\n * document-specific state to be set.\n */\nexport function createAppModuleDocument(\n state?: Partial<{\n auth?: Partial<PHAuthState>;\n document?: Partial<PHDocumentState>;\n global?: Partial<AppModuleGlobalState>;\n local?: Partial<AppModuleLocalState>;\n }>,\n): AppModuleDocument {\n const document = utils.createDocument(\n state\n ? createState(\n createBaseState(state.auth, state.document),\n state.global,\n state.local,\n )\n : undefined,\n );\n\n return document;\n}\n"],"mappings":";;;AAeA,SAAgB,qBAA2C;AACzD,QAAO;EACL,MAAM;EACN,QAAQ;EACR,sBAAsB;EACtB,sBAAsB;EACvB;;AAGH,SAAgB,oBAAyC;AACvD,QAAO,EAAE;;AAGX,SAAgB,iBAAmC;AACjD,QAAO;EACL,GAAG,kBAAkB;EACrB,QAAQ,oBAAoB;EAC5B,OAAO,mBAAmB;EAC3B;;AAGH,SAAgB,kBACd,OACsB;AACtB,QAAO;EACL,GAAG,oBAAoB;EACvB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgB,iBACd,OACqB;AACrB,QAAO;EACL,GAAG,mBAAmB;EACtB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgBA,cACd,WACA,aACA,YACkB;AAClB,QAAO;EACL,GAAG,gBAAgB,WAAW,MAAM,WAAW,SAAS;EACxD,QAAQ,kBAAkB,YAAY;EACtC,OAAO,iBAAiB,WAAW;EACpC;;;;;;;AAQH,SAAgB,wBACd,OAMmB;AAWnB,QAViB,MAAM,eACrB,QACIA,cACE,gBAAgB,MAAM,MAAM,MAAM,SAAS,EAC3C,MAAM,QACN,MAAM,MACP,GACD,KAAA,EACL"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { r as utils } from "./utils-CWO5kDus.js";
|
|
2
|
+
import { createBaseState, defaultBaseState } from "document-model";
|
|
3
|
+
//#region document-models/subgraph-module/v1/gen/ph-factories.ts
|
|
4
|
+
function defaultGlobalState() {
|
|
5
|
+
return {
|
|
6
|
+
name: "",
|
|
7
|
+
status: "DRAFT"
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function defaultLocalState() {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
function defaultPHState() {
|
|
14
|
+
return {
|
|
15
|
+
...defaultBaseState(),
|
|
16
|
+
global: defaultGlobalState(),
|
|
17
|
+
local: defaultLocalState()
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function createGlobalState(state) {
|
|
21
|
+
return {
|
|
22
|
+
...defaultGlobalState(),
|
|
23
|
+
...state || {}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createLocalState(state) {
|
|
27
|
+
return {
|
|
28
|
+
...defaultLocalState(),
|
|
29
|
+
...state || {}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function createState$1(baseState, globalState, localState) {
|
|
33
|
+
return {
|
|
34
|
+
...createBaseState(baseState?.auth, baseState?.document),
|
|
35
|
+
global: createGlobalState(globalState),
|
|
36
|
+
local: createLocalState(localState)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a SubgraphModuleDocument with custom global and local state
|
|
41
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
42
|
+
* document-specific state to be set.
|
|
43
|
+
*/
|
|
44
|
+
function createSubgraphModuleDocument(state) {
|
|
45
|
+
return utils.createDocument(state ? createState$1(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { defaultPHState as a, defaultLocalState as i, createSubgraphModuleDocument as n, defaultGlobalState as r, createState$1 as t };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=ph-factories-Bn_HTUfT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ph-factories-Bn_HTUfT.js","names":["createState"],"sources":["../document-models/subgraph-module/v1/gen/ph-factories.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n * Factory methods for creating SubgraphModuleDocument instances\n */\nimport type { PHAuthState, PHBaseState, PHDocumentState } from \"document-model\";\nimport { createBaseState, defaultBaseState } from \"document-model\";\nimport type {\n SubgraphModuleDocument,\n SubgraphModuleGlobalState,\n SubgraphModuleLocalState,\n SubgraphModulePHState,\n} from \"./types.js\";\nimport { utils } from \"./utils.js\";\n\nexport function defaultGlobalState(): SubgraphModuleGlobalState {\n return {\n name: \"\",\n status: \"DRAFT\",\n };\n}\n\nexport function defaultLocalState(): SubgraphModuleLocalState {\n return {};\n}\n\nexport function defaultPHState(): SubgraphModulePHState {\n return {\n ...defaultBaseState(),\n global: defaultGlobalState(),\n local: defaultLocalState(),\n };\n}\n\nexport function createGlobalState(\n state?: Partial<SubgraphModuleGlobalState>,\n): SubgraphModuleGlobalState {\n return {\n ...defaultGlobalState(),\n ...(state || {}),\n };\n}\n\nexport function createLocalState(\n state?: Partial<SubgraphModuleLocalState>,\n): SubgraphModuleLocalState {\n return {\n ...defaultLocalState(),\n ...(state || {}),\n } as SubgraphModuleLocalState;\n}\n\nexport function createState(\n baseState?: Partial<PHBaseState>,\n globalState?: Partial<SubgraphModuleGlobalState>,\n localState?: Partial<SubgraphModuleLocalState>,\n): SubgraphModulePHState {\n return {\n ...createBaseState(baseState?.auth, baseState?.document),\n global: createGlobalState(globalState),\n local: createLocalState(localState),\n };\n}\n\n/**\n * Creates a SubgraphModuleDocument with custom global and local state\n * This properly handles the PHBaseState requirements while allowing\n * document-specific state to be set.\n */\nexport function createSubgraphModuleDocument(\n state?: Partial<{\n auth?: Partial<PHAuthState>;\n document?: Partial<PHDocumentState>;\n global?: Partial<SubgraphModuleGlobalState>;\n local?: Partial<SubgraphModuleLocalState>;\n }>,\n): SubgraphModuleDocument {\n const document = utils.createDocument(\n state\n ? createState(\n createBaseState(state.auth, state.document),\n state.global,\n state.local,\n )\n : undefined,\n );\n\n return document;\n}\n"],"mappings":";;;AAeA,SAAgB,qBAAgD;AAC9D,QAAO;EACL,MAAM;EACN,QAAQ;EACT;;AAGH,SAAgB,oBAA8C;AAC5D,QAAO,EAAE;;AAGX,SAAgB,iBAAwC;AACtD,QAAO;EACL,GAAG,kBAAkB;EACrB,QAAQ,oBAAoB;EAC5B,OAAO,mBAAmB;EAC3B;;AAGH,SAAgB,kBACd,OAC2B;AAC3B,QAAO;EACL,GAAG,oBAAoB;EACvB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgB,iBACd,OAC0B;AAC1B,QAAO;EACL,GAAG,mBAAmB;EACtB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgBA,cACd,WACA,aACA,YACuB;AACvB,QAAO;EACL,GAAG,gBAAgB,WAAW,MAAM,WAAW,SAAS;EACxD,QAAQ,kBAAkB,YAAY;EACtC,OAAO,iBAAiB,WAAW;EACpC;;;;;;;AAQH,SAAgB,6BACd,OAMwB;AAWxB,QAViB,MAAM,eACrB,QACIA,cACE,gBAAgB,MAAM,MAAM,MAAM,SAAS,EAC3C,MAAM,QACN,MAAM,MACP,GACD,KAAA,EACL"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { r as utils } from "./utils-CnZc-0E4.js";
|
|
2
|
+
import { createBaseState, defaultBaseState } from "document-model";
|
|
3
|
+
//#region document-models/document-editor/v1/gen/ph-factories.ts
|
|
4
|
+
function defaultGlobalState() {
|
|
5
|
+
return {
|
|
6
|
+
name: "",
|
|
7
|
+
documentTypes: [],
|
|
8
|
+
status: "DRAFT"
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function defaultLocalState() {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
function defaultPHState() {
|
|
15
|
+
return {
|
|
16
|
+
...defaultBaseState(),
|
|
17
|
+
global: defaultGlobalState(),
|
|
18
|
+
local: defaultLocalState()
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function createGlobalState(state) {
|
|
22
|
+
return {
|
|
23
|
+
...defaultGlobalState(),
|
|
24
|
+
...state || {}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function createLocalState(state) {
|
|
28
|
+
return {
|
|
29
|
+
...defaultLocalState(),
|
|
30
|
+
...state || {}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function createState$1(baseState, globalState, localState) {
|
|
34
|
+
return {
|
|
35
|
+
...createBaseState(baseState?.auth, baseState?.document),
|
|
36
|
+
global: createGlobalState(globalState),
|
|
37
|
+
local: createLocalState(localState)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates a DocumentEditorDocument with custom global and local state
|
|
42
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
43
|
+
* document-specific state to be set.
|
|
44
|
+
*/
|
|
45
|
+
function createDocumentEditorDocument(state) {
|
|
46
|
+
return utils.createDocument(state ? createState$1(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { defaultPHState as a, defaultLocalState as i, createState$1 as n, defaultGlobalState as r, createDocumentEditorDocument as t };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=ph-factories-CJXfT_Z1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ph-factories-CJXfT_Z1.js","names":["createState"],"sources":["../document-models/document-editor/v1/gen/ph-factories.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n * Factory methods for creating DocumentEditorDocument instances\n */\nimport type { PHAuthState, PHBaseState, PHDocumentState } from \"document-model\";\nimport { createBaseState, defaultBaseState } from \"document-model\";\nimport type {\n DocumentEditorDocument,\n DocumentEditorGlobalState,\n DocumentEditorLocalState,\n DocumentEditorPHState,\n} from \"./types.js\";\nimport { utils } from \"./utils.js\";\n\nexport function defaultGlobalState(): DocumentEditorGlobalState {\n return {\n name: \"\",\n documentTypes: [],\n status: \"DRAFT\",\n };\n}\n\nexport function defaultLocalState(): DocumentEditorLocalState {\n return {};\n}\n\nexport function defaultPHState(): DocumentEditorPHState {\n return {\n ...defaultBaseState(),\n global: defaultGlobalState(),\n local: defaultLocalState(),\n };\n}\n\nexport function createGlobalState(\n state?: Partial<DocumentEditorGlobalState>,\n): DocumentEditorGlobalState {\n return {\n ...defaultGlobalState(),\n ...(state || {}),\n };\n}\n\nexport function createLocalState(\n state?: Partial<DocumentEditorLocalState>,\n): DocumentEditorLocalState {\n return {\n ...defaultLocalState(),\n ...(state || {}),\n } as DocumentEditorLocalState;\n}\n\nexport function createState(\n baseState?: Partial<PHBaseState>,\n globalState?: Partial<DocumentEditorGlobalState>,\n localState?: Partial<DocumentEditorLocalState>,\n): DocumentEditorPHState {\n return {\n ...createBaseState(baseState?.auth, baseState?.document),\n global: createGlobalState(globalState),\n local: createLocalState(localState),\n };\n}\n\n/**\n * Creates a DocumentEditorDocument with custom global and local state\n * This properly handles the PHBaseState requirements while allowing\n * document-specific state to be set.\n */\nexport function createDocumentEditorDocument(\n state?: Partial<{\n auth?: Partial<PHAuthState>;\n document?: Partial<PHDocumentState>;\n global?: Partial<DocumentEditorGlobalState>;\n local?: Partial<DocumentEditorLocalState>;\n }>,\n): DocumentEditorDocument {\n const document = utils.createDocument(\n state\n ? createState(\n createBaseState(state.auth, state.document),\n state.global,\n state.local,\n )\n : undefined,\n );\n\n return document;\n}\n"],"mappings":";;;AAeA,SAAgB,qBAAgD;AAC9D,QAAO;EACL,MAAM;EACN,eAAe,EAAE;EACjB,QAAQ;EACT;;AAGH,SAAgB,oBAA8C;AAC5D,QAAO,EAAE;;AAGX,SAAgB,iBAAwC;AACtD,QAAO;EACL,GAAG,kBAAkB;EACrB,QAAQ,oBAAoB;EAC5B,OAAO,mBAAmB;EAC3B;;AAGH,SAAgB,kBACd,OAC2B;AAC3B,QAAO;EACL,GAAG,oBAAoB;EACvB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgB,iBACd,OAC0B;AAC1B,QAAO;EACL,GAAG,mBAAmB;EACtB,GAAI,SAAS,EAAE;EAChB;;AAGH,SAAgBA,cACd,WACA,aACA,YACuB;AACvB,QAAO;EACL,GAAG,gBAAgB,WAAW,MAAM,WAAW,SAAS;EACxD,QAAQ,kBAAkB,YAAY;EACtC,OAAO,iBAAiB,WAAW;EACpC;;;;;;;AAQH,SAAgB,6BACd,OAMwB;AAWxB,QAViB,MAAM,eACrB,QACIA,cACE,gBAAgB,MAAM,MAAM,MAAM,SAAS,EAC3C,MAAM,QACN,MAAM,MACP,GACD,KAAA,EACL"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { l as isProcessorModuleDocument, s as assertIsProcessorModuleDocument } from "./utils-Byjf33qt.js";
|
|
2
|
+
import { t as ProcessorModule } from "./module-DPyV2vUY.js";
|
|
3
|
+
import { PHDocumentController } from "document-model";
|
|
4
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument } from "@powerhousedao/reactor-browser";
|
|
5
|
+
//#region document-models/processor-module/v1/gen/controller.ts
|
|
6
|
+
/**
|
|
7
|
+
* WARNING: DO NOT EDIT
|
|
8
|
+
* This file is auto-generated and updated by codegen
|
|
9
|
+
*/
|
|
10
|
+
const ProcessorModuleController = PHDocumentController.forDocumentModel(ProcessorModule);
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region document-models/processor-module/v1/hooks.ts
|
|
13
|
+
/** Hook to get a ProcessorModule document by its id */
|
|
14
|
+
function useProcessorModuleDocumentById(documentId) {
|
|
15
|
+
const [document, dispatch] = useDocumentById(documentId);
|
|
16
|
+
if (!isProcessorModuleDocument(document)) return [void 0, void 0];
|
|
17
|
+
return [document, dispatch];
|
|
18
|
+
}
|
|
19
|
+
/** Hook to get the selected ProcessorModule document */
|
|
20
|
+
function useSelectedProcessorModuleDocument() {
|
|
21
|
+
const [document, dispatch] = useSelectedDocument();
|
|
22
|
+
assertIsProcessorModuleDocument(document);
|
|
23
|
+
return [document, dispatch];
|
|
24
|
+
}
|
|
25
|
+
/** Hook to get all ProcessorModule documents in the selected drive */
|
|
26
|
+
function useProcessorModuleDocumentsInSelectedDrive() {
|
|
27
|
+
return useDocumentsInSelectedDrive()?.filter(isProcessorModuleDocument);
|
|
28
|
+
}
|
|
29
|
+
/** Hook to get all ProcessorModule documents in the selected folder */
|
|
30
|
+
function useProcessorModuleDocumentsInSelectedFolder() {
|
|
31
|
+
return useDocumentsInSelectedFolder()?.filter(isProcessorModuleDocument);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region document-models/processor-module/upgrades/versions.ts
|
|
35
|
+
const supportedVersions = [1];
|
|
36
|
+
const latestVersion = supportedVersions[0];
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region document-models/processor-module/upgrades/upgrade-manifest.ts
|
|
39
|
+
const processorModuleUpgradeManifest = {
|
|
40
|
+
documentType: "powerhouse/processor",
|
|
41
|
+
latestVersion,
|
|
42
|
+
supportedVersions,
|
|
43
|
+
upgrades: {}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { useProcessorModuleDocumentsInSelectedDrive as a, ProcessorModuleController as c, useProcessorModuleDocumentById as i, latestVersion as n, useProcessorModuleDocumentsInSelectedFolder as o, supportedVersions as r, useSelectedProcessorModuleDocument as s, processorModuleUpgradeManifest as t };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=processor-module-B7IAItXQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor-module-B7IAItXQ.js","names":[],"sources":["../document-models/processor-module/v1/gen/controller.ts","../document-models/processor-module/v1/hooks.ts","../document-models/processor-module/upgrades/versions.ts","../document-models/processor-module/upgrades/upgrade-manifest.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { ProcessorModule } from \"../module.js\";\nimport type { ProcessorModuleAction, ProcessorModulePHState } from \"./types.js\";\n\nexport const ProcessorModuleController = PHDocumentController.forDocumentModel<\n ProcessorModulePHState,\n ProcessorModuleAction\n>(ProcessorModule);\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport {\n useDocumentById,\n useDocumentsInSelectedDrive,\n useDocumentsInSelectedFolder,\n useSelectedDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n ProcessorModuleAction,\n ProcessorModuleDocument,\n} from \"document-models/processor-module/v1\";\nimport {\n assertIsProcessorModuleDocument,\n isProcessorModuleDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a ProcessorModule document by its id */\nexport function useProcessorModuleDocumentById(\n documentId: string | null | undefined,\n):\n | [ProcessorModuleDocument, DocumentDispatch<ProcessorModuleAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isProcessorModuleDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected ProcessorModule document */\nexport function useSelectedProcessorModuleDocument(): [\n ProcessorModuleDocument,\n DocumentDispatch<ProcessorModuleAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsProcessorModuleDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all ProcessorModule documents in the selected drive */\nexport function useProcessorModuleDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isProcessorModuleDocument);\n}\n\n/** Hook to get all ProcessorModule documents in the selected folder */\nexport function useProcessorModuleDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isProcessorModuleDocument);\n}\n","export const supportedVersions = [1] as const;\n\nexport const latestVersion = supportedVersions[0];\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { latestVersion, supportedVersions } from \"./versions.js\";\n\nexport const processorModuleUpgradeManifest: UpgradeManifest<\n typeof supportedVersions\n> = {\n documentType: \"powerhouse/processor\",\n latestVersion,\n supportedVersions,\n upgrades: {},\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,4BAA4B,qBAAqB,iBAG5D,gBAAgB;;;;ACUlB,SAAgB,+BACd,YAGyB;CACzB,MAAM,CAAC,UAAU,YAAY,gBAAgB,WAAW;AACxD,KAAI,CAAC,0BAA0B,SAAS,CAAE,QAAO,CAAC,KAAA,GAAW,KAAA,EAAU;AACvE,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,qCAGd;CACA,MAAM,CAAC,UAAU,YAAY,qBAAqB;AAElD,iCAAgC,SAAS;AACzC,QAAO,CAAC,UAAU,SAAS;;;AAI7B,SAAgB,6CAA6C;AAE3D,QADiC,6BAA6B,EAC7B,OAAO,0BAA0B;;;AAIpE,SAAgB,8CAA8C;AAE5D,QADkC,8BAA8B,EAC9B,OAAO,0BAA0B;;;;ACnDrE,MAAa,oBAAoB,CAAC,EAAE;AAEpC,MAAa,gBAAgB,kBAAkB;;;ACK/C,MAAa,iCAET;CACF,cAAc;CACd;CACA;CACA,UAAU,EAAE;CACb"}
|