@powerhousedao/vetra 6.0.2-staging.8 → 6.1.0-dev.0
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-BRlVKs1s.js +6 -0
- package/dist/connect-BRlVKs1s.js.map +1 -0
- 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 +12 -2
- package/dist/document-models/app-module/index.d.ts.map +1 -0
- package/dist/document-models/app-module/index.js +5 -2
- package/dist/document-models/document-editor/index.d.ts +12 -2
- package/dist/document-models/document-editor/index.d.ts.map +1 -0
- package/dist/document-models/document-editor/index.js +5 -2
- package/dist/document-models/index.d.ts +6 -29
- package/dist/document-models/index.js +6 -2
- package/dist/document-models/processor-module/index.d.ts +12 -2
- package/dist/document-models/processor-module/index.d.ts.map +1 -0
- package/dist/document-models/processor-module/index.js +5 -2
- package/dist/document-models/subgraph-module/index.d.ts +12 -2
- package/dist/document-models/subgraph-module/index.d.ts.map +1 -0
- package/dist/document-models/subgraph-module/index.js +5 -2
- package/dist/document-models/vetra-package/index.d.ts +12 -2
- package/dist/document-models/vetra-package/index.d.ts.map +1 -0
- package/dist/document-models/vetra-package/index.js +3 -2
- package/dist/{editor-9B-mf9yE.js → editor-BwbJ65NZ.js} +10 -9
- package/dist/editor-BwbJ65NZ.js.map +1 -0
- package/dist/{editor-CQwD5q6a.js → editor-CJAn9WTA.js} +8 -7
- package/dist/editor-CJAn9WTA.js.map +1 -0
- package/dist/{editor-CwC9mpEu.js → editor-CLERZjRS.js} +11 -11
- package/dist/editor-CLERZjRS.js.map +1 -0
- package/dist/{editor-Bm0GwtcN.js → editor-DWufJcmG.js} +7 -7
- package/dist/editor-DWufJcmG.js.map +1 -0
- package/dist/{editor-ouUpfWQx.js → editor-DabfMxkF.js} +15 -15
- package/dist/editor-DabfMxkF.js.map +1 -0
- package/dist/{editor-BwBHWEmR.js → editor-WWMGVelM.js} +9 -9
- package/dist/editor-WWMGVelM.js.map +1 -0
- package/dist/editors/hooks/index.js +1 -1
- package/dist/editors/index.d.ts +13 -12
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/factory-Bd_0OaF8.js +79 -0
- package/dist/factory-Bd_0OaF8.js.map +1 -0
- package/dist/{codegen-PnsnCMkw.js → factory-CEzh-u5J.js} +55 -7
- package/dist/factory-CEzh-u5J.js.map +1 -0
- package/dist/{hooks-Vx4YtE1e.js → hooks-Btogj1f0.js} +1 -1
- package/dist/{hooks-Vx4YtE1e.js.map → hooks-Btogj1f0.js.map} +1 -1
- package/dist/index-BPoF8P3O.d.ts +357 -0
- package/dist/index-BPoF8P3O.d.ts.map +1 -0
- package/dist/index-BoGed4Fa.d.ts +437 -0
- package/dist/index-BoGed4Fa.d.ts.map +1 -0
- package/dist/index-C4s0aLv3.d.ts +424 -0
- package/dist/index-C4s0aLv3.d.ts.map +1 -0
- package/dist/index-ClaOdn_F.d.ts +393 -0
- package/dist/index-ClaOdn_F.d.ts.map +1 -0
- package/dist/index.d.ts +142 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- 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-Drla4Vmn.d.ts +478 -0
- package/dist/module-Drla4Vmn.d.ts.map +1 -0
- package/dist/{vetra-package-VqptqKzx.js → module-dDKBr6QY.js} +186 -236
- package/dist/module-dDKBr6QY.js.map +1 -0
- package/dist/{module-DWvO3WCv.js → module-jWN6gsmi.js} +15 -11
- package/dist/module-jWN6gsmi.js.map +1 -0
- 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/powerhouse.manifest.d.ts +8 -5
- package/dist/powerhouse.manifest.d.ts.map +1 -1
- package/dist/powerhouse.manifest.js +19 -12
- package/dist/processor-module-B7IAItXQ.js +48 -0
- package/dist/processor-module-B7IAItXQ.js.map +1 -0
- package/dist/processors/codegen/index.d.ts +7 -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 +4 -15
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +8 -81
- package/dist/processors/index.js.map +1 -1
- package/dist/processors/vetra-read-model/index.d.ts +18599 -2
- package/dist/processors/vetra-read-model/index.d.ts.map +1 -0
- package/dist/processors/vetra-read-model/index.js +2 -54
- package/dist/style.css +7 -8
- 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-CIUZkhea.js.map +1 -0
- package/dist/{useVetraDocument-DF0teXXM.js → useVetraDocument-BQKyels4.js} +1 -1
- package/dist/{useVetraDocument-DF0teXXM.js.map → useVetraDocument-BQKyels4.js.map} +1 -1
- package/dist/{app-module-BbhoykB5.js → utils-BRx88WW3.js} +70 -235
- package/dist/utils-BRx88WW3.js.map +1 -0
- package/dist/{processor-module-CkuQiq7B.js → utils-Byjf33qt.js} +63 -240
- package/dist/utils-Byjf33qt.js.map +1 -0
- package/dist/utils-CWO5kDus.js +162 -0
- package/dist/utils-CWO5kDus.js.map +1 -0
- package/dist/utils-CnZc-0E4.js +202 -0
- package/dist/utils-CnZc-0E4.js.map +1 -0
- package/dist/vetra-package-BgTjv343.js +100 -0
- package/dist/vetra-package-BgTjv343.js.map +1 -0
- package/package.json +19 -14
- package/dist/app-module-BbhoykB5.js.map +0 -1
- package/dist/codegen-PnsnCMkw.js.map +0 -1
- package/dist/document-editor-CHM7Pu4m.js +0 -344
- package/dist/document-editor-CHM7Pu4m.js.map +0 -1
- package/dist/document-models/index.d.ts.map +0 -1
- package/dist/editor-9B-mf9yE.js.map +0 -1
- package/dist/editor-Bm0GwtcN.js.map +0 -1
- package/dist/editor-BwBHWEmR.js.map +0 -1
- package/dist/editor-CD3KcVf6.js +0 -2
- package/dist/editor-CQwD5q6a.js.map +0 -1
- package/dist/editor-CwC9mpEu.js.map +0 -1
- package/dist/editor-ouUpfWQx.js.map +0 -1
- package/dist/index-CHfOF-Et.d.ts +0 -363
- package/dist/index-CHfOF-Et.d.ts.map +0 -1
- package/dist/index-CL_CHW_Z.d.ts +0 -330
- package/dist/index-CL_CHW_Z.d.ts.map +0 -1
- package/dist/index-COsHJRmm.d.ts +0 -37
- package/dist/index-COsHJRmm.d.ts.map +0 -1
- package/dist/index-C_kUPMNf.d.ts +0 -298
- package/dist/index-C_kUPMNf.d.ts.map +0 -1
- package/dist/index-Qr_rU6VS.d.ts +0 -271
- package/dist/index-Qr_rU6VS.d.ts.map +0 -1
- package/dist/index-cBMMID-w.d.ts +0 -323
- package/dist/index-cBMMID-w.d.ts.map +0 -1
- package/dist/module-DWvO3WCv.js.map +0 -1
- package/dist/module-XCoMwFat.js +0 -59
- package/dist/module-XCoMwFat.js.map +0 -1
- package/dist/processor-module-CkuQiq7B.js.map +0 -1
- package/dist/processors/vetra-read-model/index.js.map +0 -1
- package/dist/subgraph-module-CU_-umq2.js +0 -278
- package/dist/subgraph-module-CU_-umq2.js.map +0 -1
- package/dist/vetra-package-VqptqKzx.js.map +0 -1
package/dist/index-cBMMID-w.d.ts
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { Action, Actions, DocumentModelGlobalState, DocumentModelUtils, PHAuthState, PHBaseState, PHDocument as PHDocument$1, PHDocumentState, Reducer, SignalDispatch } from "@powerhousedao/shared/document-model";
|
|
2
|
-
import * as z$1 from "zod";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
5
|
-
|
|
6
|
-
//#region document-models/app-module/gen/schema/types.d.ts
|
|
7
|
-
type Maybe<T> = T | null | undefined;
|
|
8
|
-
type InputMaybe<T> = T | null | undefined;
|
|
9
|
-
type Exact<T extends {
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
}> = { [K in keyof T]: T[K] };
|
|
12
|
-
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
13
|
-
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
14
|
-
type MakeEmpty<T extends {
|
|
15
|
-
[key: string]: unknown;
|
|
16
|
-
}, K extends keyof T> = { [_ in K]?: never };
|
|
17
|
-
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
18
|
-
/** All built-in and custom scalars, mapped to their actual values */
|
|
19
|
-
type Scalars = {
|
|
20
|
-
ID: {
|
|
21
|
-
input: string;
|
|
22
|
-
output: string;
|
|
23
|
-
};
|
|
24
|
-
String: {
|
|
25
|
-
input: string;
|
|
26
|
-
output: string;
|
|
27
|
-
};
|
|
28
|
-
Boolean: {
|
|
29
|
-
input: boolean;
|
|
30
|
-
output: boolean;
|
|
31
|
-
};
|
|
32
|
-
Int: {
|
|
33
|
-
input: number;
|
|
34
|
-
output: number;
|
|
35
|
-
};
|
|
36
|
-
Float: {
|
|
37
|
-
input: number;
|
|
38
|
-
output: number;
|
|
39
|
-
};
|
|
40
|
-
Address: {
|
|
41
|
-
input: `${string}:0x${string}`;
|
|
42
|
-
output: `${string}:0x${string}`;
|
|
43
|
-
};
|
|
44
|
-
Amount: {
|
|
45
|
-
input: {
|
|
46
|
-
unit?: string;
|
|
47
|
-
value?: number;
|
|
48
|
-
};
|
|
49
|
-
output: {
|
|
50
|
-
unit?: string;
|
|
51
|
-
value?: number;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
Amount_Crypto: {
|
|
55
|
-
input: {
|
|
56
|
-
unit: string;
|
|
57
|
-
value: string;
|
|
58
|
-
};
|
|
59
|
-
output: {
|
|
60
|
-
unit: string;
|
|
61
|
-
value: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
Amount_Currency: {
|
|
65
|
-
input: {
|
|
66
|
-
unit: string;
|
|
67
|
-
value: string;
|
|
68
|
-
};
|
|
69
|
-
output: {
|
|
70
|
-
unit: string;
|
|
71
|
-
value: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
Amount_Fiat: {
|
|
75
|
-
input: {
|
|
76
|
-
unit: string;
|
|
77
|
-
value: number;
|
|
78
|
-
};
|
|
79
|
-
output: {
|
|
80
|
-
unit: string;
|
|
81
|
-
value: number;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
Amount_Money: {
|
|
85
|
-
input: number;
|
|
86
|
-
output: number;
|
|
87
|
-
};
|
|
88
|
-
Amount_Percentage: {
|
|
89
|
-
input: number;
|
|
90
|
-
output: number;
|
|
91
|
-
};
|
|
92
|
-
Amount_Tokens: {
|
|
93
|
-
input: number;
|
|
94
|
-
output: number;
|
|
95
|
-
};
|
|
96
|
-
Attachment: {
|
|
97
|
-
input: string;
|
|
98
|
-
output: string;
|
|
99
|
-
};
|
|
100
|
-
Currency: {
|
|
101
|
-
input: string;
|
|
102
|
-
output: string;
|
|
103
|
-
};
|
|
104
|
-
Date: {
|
|
105
|
-
input: string;
|
|
106
|
-
output: string;
|
|
107
|
-
};
|
|
108
|
-
DateTime: {
|
|
109
|
-
input: string;
|
|
110
|
-
output: string;
|
|
111
|
-
};
|
|
112
|
-
EmailAddress: {
|
|
113
|
-
input: string;
|
|
114
|
-
output: string;
|
|
115
|
-
};
|
|
116
|
-
EthereumAddress: {
|
|
117
|
-
input: string;
|
|
118
|
-
output: string;
|
|
119
|
-
};
|
|
120
|
-
OID: {
|
|
121
|
-
input: string;
|
|
122
|
-
output: string;
|
|
123
|
-
};
|
|
124
|
-
OLabel: {
|
|
125
|
-
input: string;
|
|
126
|
-
output: string;
|
|
127
|
-
};
|
|
128
|
-
PHID: {
|
|
129
|
-
input: string;
|
|
130
|
-
output: string;
|
|
131
|
-
};
|
|
132
|
-
URL: {
|
|
133
|
-
input: string;
|
|
134
|
-
output: string;
|
|
135
|
-
};
|
|
136
|
-
Unknown: {
|
|
137
|
-
input: unknown;
|
|
138
|
-
output: unknown;
|
|
139
|
-
};
|
|
140
|
-
Upload: {
|
|
141
|
-
input: File;
|
|
142
|
-
output: File;
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
type AddDocumentTypeInput = {
|
|
146
|
-
documentType: Scalars["String"]["input"];
|
|
147
|
-
};
|
|
148
|
-
type AppModuleState = {
|
|
149
|
-
allowedDocumentTypes: Maybe<Array<Scalars["String"]["output"]>>;
|
|
150
|
-
isDragAndDropEnabled: Scalars["Boolean"]["output"];
|
|
151
|
-
name: Scalars["String"]["output"];
|
|
152
|
-
status: StatusType;
|
|
153
|
-
};
|
|
154
|
-
type RemoveDocumentTypeInput = {
|
|
155
|
-
documentType: Scalars["String"]["input"];
|
|
156
|
-
};
|
|
157
|
-
type SetAppNameInput = {
|
|
158
|
-
name: Scalars["String"]["input"];
|
|
159
|
-
};
|
|
160
|
-
type SetAppStatusInput = {
|
|
161
|
-
status: StatusType;
|
|
162
|
-
};
|
|
163
|
-
type SetDocumentTypesInput = {
|
|
164
|
-
documentTypes: Array<Scalars["String"]["input"]>;
|
|
165
|
-
};
|
|
166
|
-
type SetDragAndDropEnabledInput = {
|
|
167
|
-
enabled: Scalars["Boolean"]["input"];
|
|
168
|
-
};
|
|
169
|
-
type StatusType = "CONFIRMED" | "DRAFT";
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region document-models/app-module/gen/types.d.ts
|
|
172
|
-
type AppModuleLocalState = Record<PropertyKey, never>;
|
|
173
|
-
type AppModulePHState = PHBaseState & {
|
|
174
|
-
global: AppModuleState;
|
|
175
|
-
local: AppModuleLocalState;
|
|
176
|
-
};
|
|
177
|
-
type AppModuleDocument = PHDocument$1<AppModulePHState>;
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region document-models/app-module/gen/base-operations/actions.d.ts
|
|
180
|
-
type SetAppNameAction = Action & {
|
|
181
|
-
type: "SET_APP_NAME";
|
|
182
|
-
input: SetAppNameInput;
|
|
183
|
-
};
|
|
184
|
-
type SetAppStatusAction = Action & {
|
|
185
|
-
type: "SET_APP_STATUS";
|
|
186
|
-
input: SetAppStatusInput;
|
|
187
|
-
};
|
|
188
|
-
type AddDocumentTypeAction = Action & {
|
|
189
|
-
type: "ADD_DOCUMENT_TYPE";
|
|
190
|
-
input: AddDocumentTypeInput;
|
|
191
|
-
};
|
|
192
|
-
type RemoveDocumentTypeAction = Action & {
|
|
193
|
-
type: "REMOVE_DOCUMENT_TYPE";
|
|
194
|
-
input: RemoveDocumentTypeInput;
|
|
195
|
-
};
|
|
196
|
-
type SetDocumentTypesAction = Action & {
|
|
197
|
-
type: "SET_DOCUMENT_TYPES";
|
|
198
|
-
input: SetDocumentTypesInput;
|
|
199
|
-
};
|
|
200
|
-
type AppModuleBaseOperationsAction = SetAppNameAction | SetAppStatusAction | AddDocumentTypeAction | RemoveDocumentTypeAction | SetDocumentTypesAction;
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region document-models/app-module/gen/dnd-operations/actions.d.ts
|
|
203
|
-
type SetDragAndDropEnabledAction = Action & {
|
|
204
|
-
type: "SET_DRAG_AND_DROP_ENABLED";
|
|
205
|
-
input: SetDragAndDropEnabledInput;
|
|
206
|
-
};
|
|
207
|
-
type AppModuleDndOperationsAction = SetDragAndDropEnabledAction;
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region document-models/app-module/gen/actions.d.ts
|
|
210
|
-
type AppModuleAction = AppModuleBaseOperationsAction | AppModuleDndOperationsAction;
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region document-models/app-module/gen/document-model.d.ts
|
|
213
|
-
declare const documentModel: DocumentModelGlobalState;
|
|
214
|
-
declare namespace creators_d_exports$1 {
|
|
215
|
-
export { addDocumentType, removeDocumentType, setAppName, setAppStatus, setDocumentTypes };
|
|
216
|
-
}
|
|
217
|
-
declare const setAppName: (input: SetAppNameInput) => any;
|
|
218
|
-
declare const setAppStatus: (input: SetAppStatusInput) => any;
|
|
219
|
-
declare const addDocumentType: (input: AddDocumentTypeInput) => any;
|
|
220
|
-
declare const removeDocumentType: (input: RemoveDocumentTypeInput) => any;
|
|
221
|
-
declare const setDocumentTypes: (input: SetDocumentTypesInput) => any;
|
|
222
|
-
declare namespace creators_d_exports {
|
|
223
|
-
export { setDragAndDropEnabled };
|
|
224
|
-
}
|
|
225
|
-
declare const setDragAndDropEnabled: (input: SetDragAndDropEnabledInput) => any;
|
|
226
|
-
//#endregion
|
|
227
|
-
//#region document-models/app-module/gen/ph-factories.d.ts
|
|
228
|
-
declare function defaultGlobalState(): AppModuleState;
|
|
229
|
-
declare function defaultLocalState(): AppModuleLocalState;
|
|
230
|
-
declare function defaultPHState(): AppModulePHState;
|
|
231
|
-
declare function createState$1(baseState?: Partial<PHBaseState>, globalState?: Partial<AppModuleState>, localState?: Partial<AppModuleLocalState>): AppModulePHState;
|
|
232
|
-
/**
|
|
233
|
-
* Creates a AppModuleDocument with custom global and local state
|
|
234
|
-
* This properly handles the PHBaseState requirements while allowing
|
|
235
|
-
* document-specific state to be set.
|
|
236
|
-
*/
|
|
237
|
-
declare function createAppModuleDocument(state?: Partial<{
|
|
238
|
-
auth?: Partial<PHAuthState>;
|
|
239
|
-
document?: Partial<PHDocumentState>;
|
|
240
|
-
global?: Partial<AppModuleState>;
|
|
241
|
-
local?: Partial<AppModuleLocalState>;
|
|
242
|
-
}>): AppModuleDocument;
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region document-models/app-module/gen/utils.d.ts
|
|
245
|
-
declare const initialGlobalState: AppModuleState;
|
|
246
|
-
declare const initialLocalState: AppModuleLocalState;
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region document-models/app-module/gen/reducer.d.ts
|
|
249
|
-
declare const reducer: Reducer<AppModulePHState>;
|
|
250
|
-
//#endregion
|
|
251
|
-
//#region document-models/app-module/gen/schema/zod.d.ts
|
|
252
|
-
type Properties<T> = Required<{ [K in keyof T]: z$1.ZodType<T[K]> }>;
|
|
253
|
-
type definedNonNullAny = {};
|
|
254
|
-
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
255
|
-
declare const definedNonNullAnySchema: z$1.ZodAny & z$1.ZodType<definedNonNullAny, any, z$1.core.$ZodTypeInternals<definedNonNullAny, any>>;
|
|
256
|
-
declare const StatusTypeSchema: z$1.ZodEnum<{
|
|
257
|
-
CONFIRMED: "CONFIRMED";
|
|
258
|
-
DRAFT: "DRAFT";
|
|
259
|
-
}>;
|
|
260
|
-
declare function AddDocumentTypeInputSchema(): z$1.ZodObject<Properties<AddDocumentTypeInput>>;
|
|
261
|
-
declare function AppModuleStateSchema(): z$1.ZodObject<Properties<AppModuleState>>;
|
|
262
|
-
declare function RemoveDocumentTypeInputSchema(): z$1.ZodObject<Properties<RemoveDocumentTypeInput>>;
|
|
263
|
-
declare function SetAppNameInputSchema(): z$1.ZodObject<Properties<SetAppNameInput>>;
|
|
264
|
-
declare function SetAppStatusInputSchema(): z$1.ZodObject<Properties<SetAppStatusInput>>;
|
|
265
|
-
declare function SetDocumentTypesInputSchema(): z$1.ZodObject<Properties<SetDocumentTypesInput>>;
|
|
266
|
-
declare function SetDragAndDropEnabledInputSchema(): z$1.ZodObject<Properties<SetDragAndDropEnabledInput>>;
|
|
267
|
-
//#endregion
|
|
268
|
-
//#region document-models/app-module/gen/document-type.d.ts
|
|
269
|
-
declare const appModuleDocumentType = "powerhouse/app";
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region document-models/app-module/gen/document-schema.d.ts
|
|
272
|
-
/** Schema for validating the header object of a AppModule document */
|
|
273
|
-
declare const AppModuleDocumentHeaderSchema: any;
|
|
274
|
-
/** Schema for validating the state object of a AppModule document */
|
|
275
|
-
declare const AppModulePHStateSchema: any;
|
|
276
|
-
declare const AppModuleDocumentSchema: z.ZodObject<{
|
|
277
|
-
header: any;
|
|
278
|
-
state: any;
|
|
279
|
-
initialState: any;
|
|
280
|
-
}, z.core.$strip>;
|
|
281
|
-
/** Simple helper function to check if a state object is a AppModule document state object */
|
|
282
|
-
declare function isAppModuleState(state: unknown): state is AppModulePHState;
|
|
283
|
-
/** Simple helper function to assert that a document state object is a AppModule document state object */
|
|
284
|
-
declare function assertIsAppModuleState(state: unknown): asserts state is AppModulePHState;
|
|
285
|
-
/** Simple helper function to check if a document is a AppModule document */
|
|
286
|
-
declare function isAppModuleDocument(document: unknown): document is AppModuleDocument;
|
|
287
|
-
/** Simple helper function to assert that a document is a AppModule document */
|
|
288
|
-
declare function assertIsAppModuleDocument(document: unknown): asserts document is AppModuleDocument;
|
|
289
|
-
//#endregion
|
|
290
|
-
//#region document-models/app-module/gen/base-operations/operations.d.ts
|
|
291
|
-
interface AppModuleBaseOperationsOperations {
|
|
292
|
-
setAppNameOperation: (state: AppModuleState, action: SetAppNameAction, dispatch?: SignalDispatch) => void;
|
|
293
|
-
setAppStatusOperation: (state: AppModuleState, action: SetAppStatusAction, dispatch?: SignalDispatch) => void;
|
|
294
|
-
addDocumentTypeOperation: (state: AppModuleState, action: AddDocumentTypeAction, dispatch?: SignalDispatch) => void;
|
|
295
|
-
removeDocumentTypeOperation: (state: AppModuleState, action: RemoveDocumentTypeAction, dispatch?: SignalDispatch) => void;
|
|
296
|
-
setDocumentTypesOperation: (state: AppModuleState, action: SetDocumentTypesAction, dispatch?: SignalDispatch) => void;
|
|
297
|
-
}
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region document-models/app-module/gen/dnd-operations/operations.d.ts
|
|
300
|
-
interface AppModuleDndOperationsOperations {
|
|
301
|
-
setDragAndDropEnabledOperation: (state: AppModuleState, action: SetDragAndDropEnabledAction, dispatch?: SignalDispatch) => void;
|
|
302
|
-
}
|
|
303
|
-
//#endregion
|
|
304
|
-
//#region document-models/app-module/hooks.d.ts
|
|
305
|
-
/** Hook to get a AppModule document by its id */
|
|
306
|
-
declare function useAppModuleDocumentById(documentId: string | null | undefined): [AppModuleDocument, DocumentDispatch<AppModuleAction>] | [undefined, undefined];
|
|
307
|
-
/** Hook to get the selected AppModule document */
|
|
308
|
-
declare function useSelectedAppModuleDocument(): [AppModuleDocument, DocumentDispatch<AppModuleAction>];
|
|
309
|
-
/** Hook to get all AppModule documents in the selected drive */
|
|
310
|
-
declare function useAppModuleDocumentsInSelectedDrive(): PHDocument<any>[] | undefined;
|
|
311
|
-
/** Hook to get all AppModule documents in the selected folder */
|
|
312
|
-
declare function useAppModuleDocumentsInSelectedFolder(): PHDocument<any>[] | undefined;
|
|
313
|
-
//#endregion
|
|
314
|
-
//#region document-models/app-module/actions.d.ts
|
|
315
|
-
/** Actions for the AppModule document model */
|
|
316
|
-
declare const actions: Actions;
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region document-models/app-module/utils.d.ts
|
|
319
|
-
/** Utils for the AppModule document model */
|
|
320
|
-
declare const utils: DocumentModelUtils<AppModulePHState>;
|
|
321
|
-
//#endregion
|
|
322
|
-
export { AppModuleDocument as $, createAppModuleDocument as A, setAppName as B, SetDragAndDropEnabledInputSchema as C, reducer as D, isDefinedNonNullAny as E, creators_d_exports as F, AppModuleDndOperationsAction as G, setDocumentTypes as H, setDragAndDropEnabled as I, AppModuleBaseOperationsAction as J, SetDragAndDropEnabledAction as K, addDocumentType as L, defaultGlobalState as M, defaultLocalState as N, initialGlobalState as O, defaultPHState as P, SetDocumentTypesAction as Q, creators_d_exports$1 as R, SetDocumentTypesInputSchema as S, definedNonNullAnySchema as T, documentModel as U, setAppStatus as V, AppModuleAction as W, SetAppNameAction as X, RemoveDocumentTypeAction as Y, SetAppStatusAction as Z, AddDocumentTypeInputSchema as _, StatusType as _t, useAppModuleDocumentsInSelectedFolder as a, Incremental as at, SetAppNameInputSchema as b, AppModuleBaseOperationsOperations as c, MakeMaybe as ct, AppModulePHStateSchema as d, RemoveDocumentTypeInput as dt, AppModuleLocalState as et, assertIsAppModuleDocument as f, Scalars as ft, appModuleDocumentType as g, SetDragAndDropEnabledInput as gt, isAppModuleState as h, SetDocumentTypesInput as ht, useAppModuleDocumentsInSelectedDrive as i, Exact as it, createState$1 as j, initialLocalState as k, AppModuleDocumentHeaderSchema as l, MakeOptional as lt, isAppModuleDocument as m, SetAppStatusInput as mt, actions as n, AddDocumentTypeInput as nt, useSelectedAppModuleDocument as o, InputMaybe as ot, assertIsAppModuleState as p, SetAppNameInput as pt, AddDocumentTypeAction as q, useAppModuleDocumentById as r, AppModuleState as rt, AppModuleDndOperationsOperations as s, MakeEmpty as st, utils as t, AppModulePHState as tt, AppModuleDocumentSchema as u, Maybe as ut, AppModuleStateSchema as v, StatusTypeSchema as w, SetAppStatusInputSchema as x, RemoveDocumentTypeInputSchema as y, removeDocumentType as z };
|
|
323
|
-
//# sourceMappingURL=index-cBMMID-w.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-cBMMID-w.d.ts","names":[],"sources":["../document-models/app-module/gen/schema/types.ts","../document-models/app-module/gen/types.ts","../document-models/app-module/gen/base-operations/actions.ts","../document-models/app-module/gen/dnd-operations/actions.ts","../document-models/app-module/gen/actions.ts","../document-models/app-module/gen/document-model.ts","../document-models/app-module/gen/base-operations/creators.ts","../document-models/app-module/gen/dnd-operations/creators.ts","../document-models/app-module/gen/ph-factories.ts","../document-models/app-module/gen/utils.ts","../document-models/app-module/gen/reducer.ts","../document-models/app-module/gen/schema/zod.ts","../document-models/app-module/gen/document-type.ts","../document-models/app-module/gen/document-schema.ts","../document-models/app-module/gen/base-operations/operations.ts","../document-models/app-module/gen/dnd-operations/operations.ts","../document-models/app-module/hooks.ts","../document-models/app-module/actions.ts","../document-models/app-module/utils.ts"],"mappings":";;;;;;KAAY,KAAA,MAAW,CAAA;AAAA,KACX,UAAA,MAAgB,CAAA;AAAA,KAChB,KAAA;EAAA,CAAmB,GAAA;AAAA,mBACjB,CAAA,GAAI,CAAA,CAAE,CAAA;AAAA,KAER,YAAA,oBAAgC,CAAA,IAAK,IAAA,CAAK,CAAA,EAAG,CAAA,iBAC5C,CAAA,IAAK,KAAA,CAAM,CAAA,CAAE,MAAA;AAAA,KAEd,SAAA,oBAA6B,CAAA,IAAK,IAAA,CAAK,CAAA,EAAG,CAAA,iBACzC,CAAA,GAAI,KAAA,CAAM,CAAA,CAAE,MAAA;AAAA,KAEb,SAAA;EAAA,CACG,GAAA;AAAA,mBACG,CAAA,YACN,CAAA;AAAA,KACA,WAAA,MACR,CAAA,iBAEc,CAAA,IAAK,CAAA,2CAA4C,CAAA,CAAE,CAAA;;KAGzD,OAAA;EACV,EAAA;IAAM,KAAA;IAAe,MAAA;EAAA;EACrB,MAAA;IAAU,KAAA;IAAe,MAAA;EAAA;EACzB,OAAA;IAAW,KAAA;IAAgB,MAAA;EAAA;EAC3B,GAAA;IAAO,KAAA;IAAe,MAAA;EAAA;EACtB,KAAA;IAAS,KAAA;IAAe,MAAA;EAAA;EACxB,OAAA;IAAW,KA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AAA,GAAW,cAAA;AAAA;;;UC9BE,gCAAA;EACf,8BAAA,GACE,KAAA,EAAO,cAAA,EACP,MAAA,EAAQ,2BAAA,EACR,QAAA,GAAW,cAAA;AAAA;;;;iBCSC,wBAAA,CACd,UAAA,+BAEG,iBAAA,EAAmB,gBAAA,CAAiB,eAAA;;iBAQzB,4BAAA,CAAA,IACd,iBAAA,EACA,gBAAA,CAAiB,eAAA;;iBASH,oCAAA,CAAA,GAAoC,UAAA;;iBAMpC,qCAAA,CAAA,GAAqC,UAAA;;;;cCrCxC,OAAA,EAAS,OAAA;;;;cCFT,KAAA,EAAO,kBAAA,CAAmB,gBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-DWvO3WCv.js","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"],"sourcesContent":["import type { EditorModule } from \"@powerhousedao/shared/document-model\";\nimport { lazy } from \"react\";\n\n/** Document editor module for the \"powerhouse/app\" document type */\nexport const AppEditor: EditorModule = {\n Component: lazy(() => import(\"./editor.js\")),\n documentTypes: [\"powerhouse/app\"],\n config: {\n id: \"app-editor\",\n name: \"AppEditor\",\n },\n};\n","import type { EditorModule } from \"@powerhousedao/shared/document-model\";\nimport { lazy } from \"react\";\n\nexport const DocumentEditor: EditorModule = {\n Component: lazy(() => import(\"./editor.js\")),\n documentTypes: [\"powerhouse/document-editor\"],\n config: {\n id: \"document-editor-editor\",\n name: \"Document Editor Editor\",\n },\n};\n","import type { EditorModule } from \"@powerhousedao/shared/document-model\";\nimport { lazy } from \"react\";\n\nexport const ProcessorEditor: EditorModule = {\n Component: lazy(() => import(\"./editor.js\")),\n documentTypes: [\"powerhouse/processor\"],\n config: {\n id: \"processor-module-editor\",\n name: \"Processor Module Editor\",\n },\n};\n","import type { EditorModule } from \"@powerhousedao/shared/document-model\";\nimport { lazy } from \"react\";\n\nexport const SubgraphEditor: EditorModule = {\n Component: lazy(() => import(\"./editor.js\")),\n documentTypes: [\"powerhouse/subgraph\"],\n config: {\n id: \"subgraph-module-editor\",\n name: \"Subgraph Module Editor\",\n },\n};\n","import type { EditorModule } from \"@powerhousedao/shared/document-model\";\nimport { lazy } from \"react\";\n\nexport const VetraDriveApp: EditorModule = {\n Component: lazy(() => import(\"./editor.js\")),\n documentTypes: [\"powerhouse/document-drive\"],\n config: {\n id: \"vetra-drive-app\",\n name: \"Vetra Drive App\",\n },\n};\n","import type { EditorModule } from \"@powerhousedao/shared/document-model\";\nimport { lazy } from \"react\";\nimport { type EditorProps } from \"./editor.js\";\n\nexport const VetraPackageEditor: EditorModule<EditorProps> = {\n Component: lazy(() => import(\"./editor.js\")),\n documentTypes: [\"powerhouse/package\"],\n config: {\n id: \"vetra-package-editor\",\n name: \"Vetra Package Editor\",\n },\n};\n"],"mappings":";;;AAIA,MAAa,YAA0B;CACrC,WAAW,WAAW,OAAO,wBAAe;CAC5C,eAAe,CAAC,iBAAiB;CACjC,QAAQ;EACN,IAAI;EACJ,MAAM;EACP;CACF;;;ACRD,MAAa,iBAA+B;CAC1C,WAAW,WAAW,OAAO,wBAAe;CAC5C,eAAe,CAAC,6BAA6B;CAC7C,QAAQ;EACN,IAAI;EACJ,MAAM;EACP;CACF;;;ACPD,MAAa,kBAAgC;CAC3C,WAAW,WAAW,OAAO,wBAAe;CAC5C,eAAe,CAAC,uBAAuB;CACvC,QAAQ;EACN,IAAI;EACJ,MAAM;EACP;CACF;;;ACPD,MAAa,iBAA+B;CAC1C,WAAW,WAAW,OAAO,wBAAe;CAC5C,eAAe,CAAC,sBAAsB;CACtC,QAAQ;EACN,IAAI;EACJ,MAAM;EACP;CACF;;;ACPD,MAAa,gBAA8B;CACzC,WAAW,WAAW,OAAO,wBAAe;CAC5C,eAAe,CAAC,4BAA4B;CAC5C,QAAQ;EACN,IAAI;EACJ,MAAM;EACP;CACF;;;ACND,MAAa,qBAAgD;CAC3D,WAAW,WAAW,OAAO,wBAAe;CAC5C,eAAe,CAAC,qBAAqB;CACrC,QAAQ;EACN,IAAI;EACJ,MAAM;EACP;CACF"}
|
package/dist/module-XCoMwFat.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { V as documentModel, m as reducer, n as actions, t as utils } from "./app-module-BbhoykB5.js";
|
|
2
|
-
import { L as documentModel$1, m as reducer$1, n as actions$1, t as utils$1 } from "./document-editor-CHM7Pu4m.js";
|
|
3
|
-
import { U as documentModel$2, m as reducer$2, n as actions$2, t as utils$2 } from "./processor-module-CkuQiq7B.js";
|
|
4
|
-
import { M as documentModel$3, m as reducer$3, n as actions$3, t as utils$3 } from "./subgraph-module-CU_-umq2.js";
|
|
5
|
-
import { Y as documentModel$4, m as reducer$4, n as actions$4, t as utils$4 } from "./vetra-package-VqptqKzx.js";
|
|
6
|
-
import { createState, defaultBaseState } from "@powerhousedao/shared/document-model";
|
|
7
|
-
//#region document-models/app-module/module.ts
|
|
8
|
-
/** Document model module for the Todo List document type */
|
|
9
|
-
const AppModule = {
|
|
10
|
-
version: 1,
|
|
11
|
-
reducer,
|
|
12
|
-
actions,
|
|
13
|
-
utils,
|
|
14
|
-
documentModel: createState(defaultBaseState(), documentModel)
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region document-models/document-editor/module.ts
|
|
18
|
-
/** Document model module for the Todo List document type */
|
|
19
|
-
const DocumentEditor = {
|
|
20
|
-
version: 1,
|
|
21
|
-
reducer: reducer$1,
|
|
22
|
-
actions: actions$1,
|
|
23
|
-
utils: utils$1,
|
|
24
|
-
documentModel: createState(defaultBaseState(), documentModel$1)
|
|
25
|
-
};
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region document-models/processor-module/module.ts
|
|
28
|
-
/** Document model module for the Todo List document type */
|
|
29
|
-
const ProcessorModule = {
|
|
30
|
-
version: 1,
|
|
31
|
-
reducer: reducer$2,
|
|
32
|
-
actions: actions$2,
|
|
33
|
-
utils: utils$2,
|
|
34
|
-
documentModel: createState(defaultBaseState(), documentModel$2)
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region document-models/subgraph-module/module.ts
|
|
38
|
-
/** Document model module for the Todo List document type */
|
|
39
|
-
const SubgraphModule = {
|
|
40
|
-
version: 1,
|
|
41
|
-
reducer: reducer$3,
|
|
42
|
-
actions: actions$3,
|
|
43
|
-
utils: utils$3,
|
|
44
|
-
documentModel: createState(defaultBaseState(), documentModel$3)
|
|
45
|
-
};
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region document-models/vetra-package/module.ts
|
|
48
|
-
/** Document model module for the Todo List document type */
|
|
49
|
-
const VetraPackage = {
|
|
50
|
-
version: 1,
|
|
51
|
-
reducer: reducer$4,
|
|
52
|
-
actions: actions$4,
|
|
53
|
-
utils: utils$4,
|
|
54
|
-
documentModel: createState(defaultBaseState(), documentModel$4)
|
|
55
|
-
};
|
|
56
|
-
//#endregion
|
|
57
|
-
export { AppModule as a, DocumentEditor as i, SubgraphModule as n, ProcessorModule as r, VetraPackage as t };
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=module-XCoMwFat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-XCoMwFat.js","names":["documentModel","documentModel","documentModel","documentModel"],"sources":["../document-models/app-module/module.ts","../document-models/document-editor/module.ts","../document-models/processor-module/module.ts","../document-models/subgraph-module/module.ts","../document-models/vetra-package/module.ts"],"sourcesContent":["import type { AppModulePHState } from \"@powerhousedao/vetra/document-models/app-module\";\nimport {\n actions,\n documentModel,\n reducer,\n utils,\n} from \"@powerhousedao/vetra/document-models/app-module\";\nimport type { DocumentModelModule } from \"@powerhousedao/shared/document-model\";\nimport {\n createState,\n defaultBaseState,\n} from \"@powerhousedao/shared/document-model\";\n\n/** Document model module for the Todo List document type */\nexport const AppModule: DocumentModelModule<AppModulePHState> = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n};\n","import type { DocumentEditorPHState } from \"@powerhousedao/vetra/document-models/document-editor\";\nimport {\n actions,\n documentModel,\n reducer,\n utils,\n} from \"@powerhousedao/vetra/document-models/document-editor\";\nimport type { DocumentModelModule } from \"@powerhousedao/shared/document-model\";\nimport {\n createState,\n defaultBaseState,\n} from \"@powerhousedao/shared/document-model\";\n\n/** Document model module for the Todo List document type */\nexport const DocumentEditor: DocumentModelModule<DocumentEditorPHState> = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n};\n","import type { ProcessorModulePHState } from \"@powerhousedao/vetra/document-models/processor-module\";\nimport {\n actions,\n documentModel,\n reducer,\n utils,\n} from \"@powerhousedao/vetra/document-models/processor-module\";\nimport type { DocumentModelModule } from \"@powerhousedao/shared/document-model\";\nimport {\n createState,\n defaultBaseState,\n} from \"@powerhousedao/shared/document-model\";\n\n/** Document model module for the Todo List document type */\nexport const ProcessorModule: DocumentModelModule<ProcessorModulePHState> = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n};\n","import type { SubgraphModulePHState } from \"@powerhousedao/vetra/document-models/subgraph-module\";\nimport {\n actions,\n documentModel,\n reducer,\n utils,\n} from \"@powerhousedao/vetra/document-models/subgraph-module\";\nimport type { DocumentModelModule } from \"@powerhousedao/shared/document-model\";\nimport {\n createState,\n defaultBaseState,\n} from \"@powerhousedao/shared/document-model\";\n\n/** Document model module for the Todo List document type */\nexport const SubgraphModule: DocumentModelModule<SubgraphModulePHState> = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n};\n","import type { VetraPackagePHState } from \"@powerhousedao/vetra/document-models/vetra-package\";\nimport {\n actions,\n documentModel,\n reducer,\n utils,\n} from \"@powerhousedao/vetra/document-models/vetra-package\";\nimport type { DocumentModelModule } from \"@powerhousedao/shared/document-model\";\nimport {\n createState,\n defaultBaseState,\n} from \"@powerhousedao/shared/document-model\";\n\n/** Document model module for the Todo List document type */\nexport const VetraPackage: DocumentModelModule<VetraPackagePHState> = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n};\n"],"mappings":";;;;;;;;AAcA,MAAa,YAAmD;CAC9D,SAAS;CACT;CACA;CACA;CACA,eAAe,YAAY,kBAAkB,EAAE,cAAc;CAC9D;;;;ACND,MAAa,iBAA6D;CACxE,SAAS;CACT,SAAA;CACA,SAAA;CACA,OAAA;CACA,eAAe,YAAY,kBAAkB,EAAEA,gBAAc;CAC9D;;;;ACND,MAAa,kBAA+D;CAC1E,SAAS;CACT,SAAA;CACA,SAAA;CACA,OAAA;CACA,eAAe,YAAY,kBAAkB,EAAEC,gBAAc;CAC9D;;;;ACND,MAAa,iBAA6D;CACxE,SAAS;CACT,SAAA;CACA,SAAA;CACA,OAAA;CACA,eAAe,YAAY,kBAAkB,EAAEC,gBAAc;CAC9D;;;;ACND,MAAa,eAAyD;CACpE,SAAS;CACT,SAAA;CACA,SAAA;CACA,OAAA;CACA,eAAe,YAAY,kBAAkB,EAAEC,gBAAc;CAC9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processor-module-CkuQiq7B.js","names":["z","utils","createState","utils","baseOperationsActions","genUtils","customUtils"],"sources":["../document-models/processor-module/gen/document-model.ts","../document-models/processor-module/gen/schema/zod.ts","../document-models/processor-module/gen/base-operations/creators.ts","../document-models/processor-module/gen/document-type.ts","../document-models/processor-module/gen/document-schema.ts","../document-models/processor-module/src/reducers/base-operations.ts","../document-models/processor-module/gen/reducer.ts","../document-models/processor-module/gen/utils.ts","../document-models/processor-module/gen/ph-factories.ts","../document-models/processor-module/src/utils.ts","../document-models/processor-module/hooks.ts","../document-models/processor-module/actions.ts","../document-models/processor-module/utils.ts"],"sourcesContent":["import type { DocumentModelGlobalState } from \"@powerhousedao/shared/document-model\";\n\nexport const documentModel: DocumentModelGlobalState = {\n id: \"powerhouse/processor\",\n name: \"Processor Module\",\n extension: \".phdm\",\n description: \"\",\n author: {\n name: \"Powerhouse\",\n website: \"https://powerhouse.inc\",\n },\n specifications: [\n {\n version: 1,\n changeLog: [],\n state: {\n global: {\n schema:\n \"type ProcessorModuleState {\\n name: String!\\n type: String!\\n documentTypes: [DocumentTypeItem!]!\\n status: StatusType!\\n processorApps: [String!]! \\n}\\n\\ntype DocumentTypeItem {\\n id: OID!\\n documentType: String!\\n}\\n\\nenum StatusType {\\n DRAFT\\n CONFIRMED\\n}\",\n initialValue:\n '{\\n \"name\": \"\",\\n \"type\": \"\",\\n \"documentTypes\": [],\\n \"status\": \"DRAFT\",\\n processorApps: [] \\n}',\n examples: [],\n },\n local: {\n schema: \"\",\n initialValue: \"\",\n examples: [],\n },\n },\n modules: [\n {\n id: \"91ad39c1-4e8b-4127-b3c8-e835b85e6360\",\n name: \"base_operations\",\n description: \"\",\n operations: [\n {\n id: \"6f3a5c90-39f2-4302-a073-6195a71c5054\",\n name: \"SET_PROCESSOR_NAME\",\n description: \"\",\n schema: \"input SetProcessorNameInput {\\n name: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"b8f28bb4-c6ae-40e6-86fa-29ef14ff8667\",\n name: \"SET_PROCESSOR_TYPE\",\n description: \"\",\n schema: \"input SetProcessorTypeInput {\\n type: String!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"fbbd7a71-c495-4efc-b8f6-1e57798dbbb4\",\n name: \"ADD_DOCUMENT_TYPE\",\n description: \"\",\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: \"544d413f-423c-4d97-9570-84a19bffeab9\",\n name: \"REMOVE_DOCUMENT_TYPE\",\n description: \"\",\n schema: \"input RemoveDocumentTypeInput {\\n id: OID!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"df5eb500-7308-498c-9b80-028878ee198b\",\n name: \"ADD_PROCESSOR_APP\",\n description: \"\",\n schema:\n \"input AddProcessorAppInput {\\n processorApp: String! \\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"07e4168f-1a7b-41ef-953d-219028be7bb9\",\n name: \"REMOVE_PROCESSOR_APP\",\n description: \"\",\n schema:\n \"input RemoveProcessorAppInput {\\n processorApp: String! \\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n {\n id: \"7b6706eb-5e25-4d64-829a-e3a251380fd1\",\n name: \"SET_PROCESSOR_STATUS\",\n description: \"\",\n schema:\n \"input SetProcessorStatusInput {\\n status: StatusType!\\n}\",\n template: \"\",\n reducer: \"\",\n errors: [],\n examples: [],\n scope: \"global\",\n },\n ],\n },\n ],\n },\n ],\n};\n","import * as z from \"zod\";\nimport type {\n AddDocumentTypeInput,\n AddProcessorAppInput,\n DocumentTypeItem,\n ProcessorModuleState,\n RemoveDocumentTypeInput,\n RemoveProcessorAppInput,\n SetProcessorNameInput,\n SetProcessorStatusInput,\n SetProcessorTypeInput,\n StatusType,\n} from \"./types.js\";\n\ntype Properties<T> = Required<{\n [K in keyof T]: z.ZodType<T[K]>;\n}>;\n\ntype definedNonNullAny = {};\n\nexport const isDefinedNonNullAny = (v: any): v is definedNonNullAny =>\n v !== undefined && v !== null;\n\nexport const definedNonNullAnySchema = z\n .any()\n .refine((v) => isDefinedNonNullAny(v));\n\nexport const StatusTypeSchema = z.enum([\"CONFIRMED\", \"DRAFT\"]);\n\nexport function AddDocumentTypeInputSchema(): z.ZodObject<\n Properties<AddDocumentTypeInput>\n> {\n return z.object({\n documentType: z.string(),\n id: z.string(),\n });\n}\n\nexport function AddProcessorAppInputSchema(): z.ZodObject<\n Properties<AddProcessorAppInput>\n> {\n return z.object({\n processorApp: z.string(),\n });\n}\n\nexport function DocumentTypeItemSchema(): z.ZodObject<\n Properties<DocumentTypeItem>\n> {\n return z.object({\n __typename: z.literal(\"DocumentTypeItem\").optional(),\n documentType: z.string(),\n id: z.string(),\n });\n}\n\nexport function ProcessorModuleStateSchema(): z.ZodObject<\n Properties<ProcessorModuleState>\n> {\n return z.object({\n __typename: z.literal(\"ProcessorModuleState\").optional(),\n documentTypes: z.array(z.lazy(() => DocumentTypeItemSchema())),\n name: z.string(),\n processorApps: z.array(z.string()),\n status: StatusTypeSchema,\n type: z.string(),\n });\n}\n\nexport function RemoveDocumentTypeInputSchema(): z.ZodObject<\n Properties<RemoveDocumentTypeInput>\n> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveProcessorAppInputSchema(): z.ZodObject<\n Properties<RemoveProcessorAppInput>\n> {\n return z.object({\n processorApp: z.string(),\n });\n}\n\nexport function SetProcessorNameInputSchema(): z.ZodObject<\n Properties<SetProcessorNameInput>\n> {\n return z.object({\n name: z.string(),\n });\n}\n\nexport function SetProcessorStatusInputSchema(): z.ZodObject<\n Properties<SetProcessorStatusInput>\n> {\n return z.object({\n status: StatusTypeSchema,\n });\n}\n\nexport function SetProcessorTypeInputSchema(): z.ZodObject<\n Properties<SetProcessorTypeInput>\n> {\n return z.object({\n type: z.string(),\n });\n}\n","import { createAction } from \"@powerhousedao/shared/document-model\";\nimport {\n AddDocumentTypeInputSchema,\n AddProcessorAppInputSchema,\n RemoveDocumentTypeInputSchema,\n RemoveProcessorAppInputSchema,\n SetProcessorNameInputSchema,\n SetProcessorStatusInputSchema,\n SetProcessorTypeInputSchema,\n} from \"../schema/zod.js\";\nimport type {\n AddDocumentTypeInput,\n AddProcessorAppInput,\n RemoveDocumentTypeInput,\n RemoveProcessorAppInput,\n SetProcessorNameInput,\n SetProcessorStatusInput,\n SetProcessorTypeInput,\n} from \"../types.js\";\nimport type {\n AddDocumentTypeAction,\n AddProcessorAppAction,\n RemoveDocumentTypeAction,\n RemoveProcessorAppAction,\n SetProcessorNameAction,\n SetProcessorStatusAction,\n SetProcessorTypeAction,\n} from \"./actions.js\";\n\nexport const setProcessorName = (input: SetProcessorNameInput) =>\n createAction<SetProcessorNameAction>(\n \"SET_PROCESSOR_NAME\",\n { ...input },\n undefined,\n SetProcessorNameInputSchema,\n \"global\",\n );\n\nexport const setProcessorType = (input: SetProcessorTypeInput) =>\n createAction<SetProcessorTypeAction>(\n \"SET_PROCESSOR_TYPE\",\n { ...input },\n undefined,\n SetProcessorTypeInputSchema,\n \"global\",\n );\n\nexport const addDocumentType = (input: AddDocumentTypeInput) =>\n createAction<AddDocumentTypeAction>(\n \"ADD_DOCUMENT_TYPE\",\n { ...input },\n undefined,\n AddDocumentTypeInputSchema,\n \"global\",\n );\n\nexport const removeDocumentType = (input: RemoveDocumentTypeInput) =>\n createAction<RemoveDocumentTypeAction>(\n \"REMOVE_DOCUMENT_TYPE\",\n { ...input },\n undefined,\n RemoveDocumentTypeInputSchema,\n \"global\",\n );\n\nexport const addProcessorApp = (input: AddProcessorAppInput) =>\n createAction<AddProcessorAppAction>(\n \"ADD_PROCESSOR_APP\",\n { ...input },\n undefined,\n AddProcessorAppInputSchema,\n \"global\",\n );\n\nexport const removeProcessorApp = (input: RemoveProcessorAppInput) =>\n createAction<RemoveProcessorAppAction>(\n \"REMOVE_PROCESSOR_APP\",\n { ...input },\n undefined,\n RemoveProcessorAppInputSchema,\n \"global\",\n );\n\nexport const setProcessorStatus = (input: SetProcessorStatusInput) =>\n createAction<SetProcessorStatusAction>(\n \"SET_PROCESSOR_STATUS\",\n { ...input },\n undefined,\n SetProcessorStatusInputSchema,\n \"global\",\n );\n","export const processorModuleDocumentType = \"powerhouse/processor\";\n","import {\n BaseDocumentHeaderSchema,\n BaseDocumentStateSchema,\n} from \"@powerhousedao/shared/document-model\";\nimport { z } from \"zod\";\nimport { processorModuleDocumentType } from \"./document-type.js\";\nimport { ProcessorModuleStateSchema } from \"./schema/zod.js\";\nimport type {\n ProcessorModuleDocument,\n ProcessorModulePHState,\n} from \"./types.js\";\n\n/** Schema for validating the header object of a ProcessorModule document */\nexport const ProcessorModuleDocumentHeaderSchema =\n BaseDocumentHeaderSchema.extend({\n documentType: z.literal(processorModuleDocumentType),\n });\n\n/** Schema for validating the state object of a ProcessorModule document */\nexport const ProcessorModulePHStateSchema = BaseDocumentStateSchema.extend({\n global: ProcessorModuleStateSchema(),\n});\n\nexport const ProcessorModuleDocumentSchema = z.object({\n header: ProcessorModuleDocumentHeaderSchema,\n state: ProcessorModulePHStateSchema,\n initialState: ProcessorModulePHStateSchema,\n});\n\n/** Simple helper function to check if a state object is a ProcessorModule document state object */\nexport function isProcessorModuleState(\n state: unknown,\n): state is ProcessorModulePHState {\n return ProcessorModulePHStateSchema.safeParse(state).success;\n}\n\n/** Simple helper function to assert that a document state object is a ProcessorModule document state object */\nexport function assertIsProcessorModuleState(\n state: unknown,\n): asserts state is ProcessorModulePHState {\n ProcessorModulePHStateSchema.parse(state);\n}\n\n/** Simple helper function to check if a document is a ProcessorModule document */\nexport function isProcessorModuleDocument(\n document: unknown,\n): document is ProcessorModuleDocument {\n return ProcessorModuleDocumentSchema.safeParse(document).success;\n}\n\n/** Simple helper function to assert that a document is a ProcessorModule document */\nexport function assertIsProcessorModuleDocument(\n document: unknown,\n): asserts document is ProcessorModuleDocument {\n ProcessorModuleDocumentSchema.parse(document);\n}\n","import {\n PROCESSOR_APPS,\n type ProcessorApp,\n} from \"@powerhousedao/shared/processors\";\nimport type { ProcessorModuleBaseOperationsOperations } from \"@powerhousedao/vetra/document-models/processor-module\";\n\nexport const processorModuleBaseOperationsOperations: ProcessorModuleBaseOperationsOperations =\n {\n setProcessorNameOperation(state, action, dispatch) {\n const trimmedName = action.input.name.trim();\n if (trimmedName === \"\") {\n throw new Error(\"Processor name cannot be empty\");\n }\n state.name = trimmedName;\n },\n setProcessorTypeOperation(state, action, dispatch) {\n const trimmedType = action.input.type.trim();\n if (trimmedType === \"\") {\n throw new Error(\"Processor type cannot be empty\");\n }\n state.type = trimmedType;\n },\n addDocumentTypeOperation(state, action, dispatch) {\n // Check for duplicate ID\n const existingId = state.documentTypes.find(\n (dt) => dt.id === action.input.id,\n );\n if (existingId) {\n throw new Error(\n `Document type with id \"${action.input.id}\" already exists`,\n );\n }\n\n state.documentTypes.push({\n id: action.input.id,\n documentType: action.input.documentType,\n });\n },\n removeDocumentTypeOperation(state, action, dispatch) {\n state.documentTypes = state.documentTypes.filter(\n (documentType) => documentType.id !== action.input.id,\n );\n },\n setProcessorStatusOperation(state, action, dispatch) {\n state.status = action.input.status;\n },\n addProcessorAppOperation(state, action) {\n const { processorApp } = action.input;\n if (!PROCESSOR_APPS.includes(processorApp as ProcessorApp)) {\n throw new Error(\n `${processorApp} is not a valid processor app. Must be one of ${PROCESSOR_APPS.join(\", \")}.`,\n );\n }\n state.processorApps = [\n ...new Set([...state.processorApps, processorApp]),\n ];\n },\n removeProcessorAppOperation(state, action) {\n const { processorApp } = action.input;\n state.processorApps = state.processorApps.filter(\n (p) => p !== processorApp,\n );\n },\n };\n","// TODO: remove eslint-disable rules once refactor is done\n\nimport type { ProcessorModulePHState } from \"@powerhousedao/vetra/document-models/processor-module\";\nimport type {\n Reducer,\n StateReducer,\n} from \"@powerhousedao/shared/document-model\";\nimport {\n createReducer,\n isDocumentAction,\n} from \"@powerhousedao/shared/document-model\";\n\nimport { processorModuleBaseOperationsOperations } from \"../src/reducers/base-operations.js\";\n\nimport {\n AddDocumentTypeInputSchema,\n AddProcessorAppInputSchema,\n RemoveDocumentTypeInputSchema,\n RemoveProcessorAppInputSchema,\n SetProcessorNameInputSchema,\n SetProcessorStatusInputSchema,\n SetProcessorTypeInputSchema,\n} from \"./schema/zod.js\";\n\nconst stateReducer: StateReducer<ProcessorModulePHState> = (\n state,\n action,\n dispatch,\n) => {\n if (isDocumentAction(action)) {\n return state;\n }\n switch (action.type) {\n case \"SET_PROCESSOR_NAME\": {\n SetProcessorNameInputSchema().parse(action.input);\n\n processorModuleBaseOperationsOperations.setProcessorNameOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_PROCESSOR_TYPE\": {\n SetProcessorTypeInputSchema().parse(action.input);\n\n processorModuleBaseOperationsOperations.setProcessorTypeOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"ADD_DOCUMENT_TYPE\": {\n AddDocumentTypeInputSchema().parse(action.input);\n\n processorModuleBaseOperationsOperations.addDocumentTypeOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"REMOVE_DOCUMENT_TYPE\": {\n RemoveDocumentTypeInputSchema().parse(action.input);\n\n processorModuleBaseOperationsOperations.removeDocumentTypeOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"ADD_PROCESSOR_APP\": {\n AddProcessorAppInputSchema().parse(action.input);\n\n processorModuleBaseOperationsOperations.addProcessorAppOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"REMOVE_PROCESSOR_APP\": {\n RemoveProcessorAppInputSchema().parse(action.input);\n\n processorModuleBaseOperationsOperations.removeProcessorAppOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n case \"SET_PROCESSOR_STATUS\": {\n SetProcessorStatusInputSchema().parse(action.input);\n\n processorModuleBaseOperationsOperations.setProcessorStatusOperation(\n (state as any)[action.scope],\n action as any,\n dispatch,\n );\n\n break;\n }\n\n default:\n return state;\n }\n};\n\nexport const reducer: Reducer<ProcessorModulePHState> =\n createReducer(stateReducer);\n","import type { DocumentModelUtils } from \"@powerhousedao/shared/document-model\";\nimport {\n baseCreateDocument,\n baseLoadFromInput,\n baseSaveToFileHandle,\n defaultBaseState,\n generateId,\n} from \"@powerhousedao/shared/document-model\";\nimport {\n assertIsProcessorModuleDocument,\n assertIsProcessorModuleState,\n isProcessorModuleDocument,\n isProcessorModuleState,\n} from \"./document-schema.js\";\nimport { processorModuleDocumentType } from \"./document-type.js\";\nimport { reducer } from \"./reducer.js\";\nimport type {\n ProcessorModuleGlobalState,\n ProcessorModuleLocalState,\n ProcessorModulePHState,\n} from \"./types.js\";\n\nexport const initialGlobalState: ProcessorModuleGlobalState = {\n name: \"\",\n type: \"\",\n documentTypes: [],\n status: \"DRAFT\",\n processorApps: [],\n};\nexport const initialLocalState: ProcessorModuleLocalState = {};\n\nexport const utils: DocumentModelUtils<ProcessorModulePHState> = {\n fileExtension: \".phdm\",\n createState(state) {\n return {\n ...defaultBaseState(),\n global: { ...initialGlobalState, ...state?.global },\n local: { ...initialLocalState, ...state?.local },\n };\n },\n createDocument(state) {\n const document = baseCreateDocument(utils.createState, state);\n\n document.header.documentType = processorModuleDocumentType;\n\n // for backwards compatibility, but this is NOT a valid signed document id\n document.header.id = generateId();\n\n return document;\n },\n saveToFileHandle(document, input) {\n return baseSaveToFileHandle(document, input);\n },\n loadFromInput(input) {\n return baseLoadFromInput(input, reducer);\n },\n isStateOfType(state) {\n return isProcessorModuleState(state);\n },\n assertIsStateOfType(state) {\n return assertIsProcessorModuleState(state);\n },\n isDocumentOfType(document) {\n return isProcessorModuleDocument(document);\n },\n assertIsDocumentOfType(document) {\n return assertIsProcessorModuleDocument(document);\n },\n};\n","/**\n * Factory methods for creating ProcessorModuleDocument instances\n */\nimport type {\n PHAuthState,\n PHBaseState,\n PHDocumentState,\n} from \"@powerhousedao/shared/document-model\";\nimport {\n createBaseState,\n defaultBaseState,\n} from \"@powerhousedao/shared/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 } as ProcessorModuleGlobalState;\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","export {};\n","import 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 \"@powerhousedao/vetra/document-models/processor-module\";\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","import {\n baseActions,\n type Actions,\n} from \"@powerhousedao/shared/document-model\";\nimport { baseOperationsActions } from \"./gen/creators.js\";\n\n/** Actions for the ProcessorModule document model */\n\nexport const actions: Actions = { ...baseActions, ...baseOperationsActions };\n","import type { DocumentModelUtils } from \"@powerhousedao/shared/document-model\";\nimport type { ProcessorModulePHState } from \"./gen/types.js\";\nimport { utils as genUtils } from \"./gen/utils.js\";\nimport * as customUtils from \"./src/utils.js\";\n\n/** Utils for the ProcessorModule document model */\nexport const utils: DocumentModelUtils<ProcessorModulePHState> = {\n ...genUtils,\n ...customUtils,\n};\n"],"mappings":";;;;;;;AAEA,MAAa,gBAA0C;CACrD,IAAI;CACJ,MAAM;CACN,WAAW;CACX,aAAa;CACb,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CACD,gBAAgB,CACd;EACE,SAAS;EACT,WAAW,EAAE;EACb,OAAO;GACL,QAAQ;IACN,QACE;IACF,cACE;IACF,UAAU,EAAE;IACb;GACD,OAAO;IACL,QAAQ;IACR,cAAc;IACd,UAAU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-
{"version":3,"file":"index.js","names":[],"sources":["../../../processors/vetra-read-model/index.ts"],"sourcesContent":["import type {\n IProcessor,\n OperationWithContext,\n} from \"@powerhousedao/reactor-browser\";\nimport type { Kysely } from \"kysely\";\nimport type { VetraPackageState } from \"../../document-models/vetra-package/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 { operation, context } of operations) {\n if (context.documentType !== \"powerhouse/package\") 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"],"mappings":";;AAWA,IAAa,0BAAb,MAA2D;CACzD;CAEA,YAAY,cAA0B;AACpC,OAAK,eAAe;;CAGtB,MAAM,aAAa,YAAmD;AACpE,SAAO,KAAK,6CAA6C;AACzD,MAAI,WAAW,WAAW,EAAG;AAE7B,OAAK,MAAM,EAAE,WAAW,aAAa,YAAY;AAC/C,OAAI,QAAQ,iBAAiB,qBAAsB;GAEnD,MAAM,QAAQ,QAAQ,iBACjB,KAAK,MAAM,QAAQ,eAAe,GACnC,KAAA;GAEJ,MAAM,aAAa,QACjB,OAAO,QAAQ,WAAW,MAAM;GAElC,MAAM,sBAAM,IAAI,MAAM;GACtB,MAAM,qBAAqB,IAAI,KAC7B,SAAS,UAAU,gBAAgB,GAAG,CACvC;AAED,SAAM,KAAK,aACR,WAAW,gBAAgB,CAC3B,OAAO;IACN,aAAa,QAAQ;IACrB,MAAM,UAAU,OAAO,KAAK;IAC5B,aAAa,UAAU,OAAO,YAAY;IAC1C,UAAU,UAAU,OAAO,SAAS;IACpC,aAAa,UAAU,OAAO,QAAQ,KAAK;IAC3C,gBAAgB,UAAU,OAAO,QAAQ,QAAQ;IACjD,UAAU,OAAO,WAAW,KAAK,UAAU,MAAM,SAAS,GAAG;IAC7D,YAAY,UAAU,OAAO,UAAU;IACvC,SAAS,UAAU,OAAO,OAAO;IACjC,sBAAsB,UAAU;IAChC,qBAAqB,UAAU;IAC/B,0BAA0B;IAC1B,UAAU;IACV,YAAY;IACZ,YAAY;IACb,CAAC,CACD,YAAY,OACX,GAAG,OAAO,cAAc,CAAC,YAAY;IACnC,MAAM,UAAU,OAAO,KAAK;IAC5B,aAAa,UAAU,OAAO,YAAY;IAC1C,UAAU,UAAU,OAAO,SAAS;IACpC,aAAa,UAAU,OAAO,QAAQ,KAAK;IAC3C,gBAAgB,UAAU,OAA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