@powerhousedao/builder-profile 0.0.1
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/LICENSE +661 -0
- package/README.md +179 -0
- package/dist/document-models/builder-profile/gen/actions.d.ts +4 -0
- package/dist/document-models/builder-profile/gen/actions.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/actions.js +1 -0
- package/dist/document-models/builder-profile/gen/builder/actions.d.ts +8 -0
- package/dist/document-models/builder-profile/gen/builder/actions.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/builder/actions.js +1 -0
- package/dist/document-models/builder-profile/gen/builder/creators.d.ts +4 -0
- package/dist/document-models/builder-profile/gen/builder/creators.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/builder/creators.js +3 -0
- package/dist/document-models/builder-profile/gen/builder/error.d.ts +2 -0
- package/dist/document-models/builder-profile/gen/builder/error.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/builder/error.js +1 -0
- package/dist/document-models/builder-profile/gen/builder/object.d.ts +7 -0
- package/dist/document-models/builder-profile/gen/builder/object.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/builder/object.js +7 -0
- package/dist/document-models/builder-profile/gen/builder/operations.d.ts +7 -0
- package/dist/document-models/builder-profile/gen/builder/operations.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/builder/operations.js +1 -0
- package/dist/document-models/builder-profile/gen/creators.d.ts +2 -0
- package/dist/document-models/builder-profile/gen/creators.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/creators.js +1 -0
- package/dist/document-models/builder-profile/gen/document-model.d.ts +3 -0
- package/dist/document-models/builder-profile/gen/document-model.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/document-model.js +48 -0
- package/dist/document-models/builder-profile/gen/index.d.ts +8 -0
- package/dist/document-models/builder-profile/gen/index.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/index.js +6 -0
- package/dist/document-models/builder-profile/gen/object.d.ts +15 -0
- package/dist/document-models/builder-profile/gen/object.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/object.js +25 -0
- package/dist/document-models/builder-profile/gen/ph-factories.d.ts +27 -0
- package/dist/document-models/builder-profile/gen/ph-factories.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/ph-factories.js +54 -0
- package/dist/document-models/builder-profile/gen/reducer.d.ts +5 -0
- package/dist/document-models/builder-profile/gen/reducer.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/reducer.js +20 -0
- package/dist/document-models/builder-profile/gen/schema/index.d.ts +3 -0
- package/dist/document-models/builder-profile/gen/schema/index.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/schema/index.js +2 -0
- package/dist/document-models/builder-profile/gen/schema/types.d.ts +151 -0
- package/dist/document-models/builder-profile/gen/schema/types.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/schema/types.js +1 -0
- package/dist/document-models/builder-profile/gen/schema/zod.d.ts +12 -0
- package/dist/document-models/builder-profile/gen/schema/zod.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/schema/zod.js +24 -0
- package/dist/document-models/builder-profile/gen/types.d.ts +10 -0
- package/dist/document-models/builder-profile/gen/types.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/types.js +1 -0
- package/dist/document-models/builder-profile/gen/utils.d.ts +22 -0
- package/dist/document-models/builder-profile/gen/utils.d.ts.map +1 -0
- package/dist/document-models/builder-profile/gen/utils.js +46 -0
- package/dist/document-models/builder-profile/index.d.ts +25 -0
- package/dist/document-models/builder-profile/index.d.ts.map +1 -0
- package/dist/document-models/builder-profile/index.js +21 -0
- package/dist/document-models/builder-profile/src/reducers/builder.d.ts +3 -0
- package/dist/document-models/builder-profile/src/reducers/builder.d.ts.map +1 -0
- package/dist/document-models/builder-profile/src/reducers/builder.js +9 -0
- package/dist/document-models/builder-profile/src/tests/builder.test.d.ts +2 -0
- package/dist/document-models/builder-profile/src/tests/builder.test.d.ts.map +1 -0
- package/dist/document-models/builder-profile/src/tests/builder.test.js +116 -0
- package/dist/document-models/builder-profile/src/tests/document-model.test.d.ts +6 -0
- package/dist/document-models/builder-profile/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/builder-profile/src/tests/document-model.test.js +18 -0
- package/dist/document-models/builder-profile/src/utils.d.ts +2 -0
- package/dist/document-models/builder-profile/src/utils.d.ts.map +1 -0
- package/dist/document-models/builder-profile/src/utils.js +1 -0
- package/dist/document-models/index.d.ts +3 -0
- package/dist/document-models/index.d.ts.map +1 -0
- package/dist/document-models/index.js +1 -0
- package/dist/editors/builder-profile/editor.d.ts +4 -0
- package/dist/editors/builder-profile/editor.d.ts.map +1 -0
- package/dist/editors/builder-profile/editor.js +131 -0
- package/dist/editors/builder-profile/index.d.ts +3 -0
- package/dist/editors/builder-profile/index.d.ts.map +1 -0
- package/dist/editors/builder-profile/index.js +11 -0
- package/dist/editors/hooks/useBuilderProfileDocument.d.ts +4 -0
- package/dist/editors/hooks/useBuilderProfileDocument.d.ts.map +1 -0
- package/dist/editors/hooks/useBuilderProfileDocument.js +8 -0
- package/dist/editors/index.d.ts +3 -0
- package/dist/editors/index.d.ts.map +1 -0
- package/dist/editors/index.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/powerhouse.manifest.json +27 -0
- package/dist/processors/index.d.ts +2 -0
- package/dist/processors/index.d.ts.map +1 -0
- package/dist/processors/index.js +1 -0
- package/dist/style.css +5604 -0
- package/dist/subgraphs/builder-profile/index.d.ts +11 -0
- package/dist/subgraphs/builder-profile/index.d.ts.map +1 -0
- package/dist/subgraphs/builder-profile/index.js +11 -0
- package/dist/subgraphs/builder-profile/resolvers.d.ts +3 -0
- package/dist/subgraphs/builder-profile/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/builder-profile/resolvers.js +84 -0
- package/dist/subgraphs/builder-profile/schema.d.ts +3 -0
- package/dist/subgraphs/builder-profile/schema.d.ts.map +1 -0
- package/dist/subgraphs/builder-profile/schema.js +49 -0
- package/dist/subgraphs/index.d.ts +3 -0
- package/dist/subgraphs/index.d.ts.map +1 -0
- package/dist/subgraphs/index.js +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.config.js +8 -0
- package/package.json +102 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
export type Maybe<T> = T | null;
|
|
2
|
+
export type InputMaybe<T> = T | null | undefined;
|
|
3
|
+
export type Exact<T extends {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}> = {
|
|
6
|
+
[K in keyof T]: T[K];
|
|
7
|
+
};
|
|
8
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
9
|
+
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
10
|
+
};
|
|
11
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
12
|
+
[SubKey in K]: Maybe<T[SubKey]>;
|
|
13
|
+
};
|
|
14
|
+
export type MakeEmpty<T extends {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}, K extends keyof T> = {
|
|
17
|
+
[_ in K]?: never;
|
|
18
|
+
};
|
|
19
|
+
export type Incremental<T> = T | {
|
|
20
|
+
[P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never;
|
|
21
|
+
};
|
|
22
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
23
|
+
export type Scalars = {
|
|
24
|
+
ID: {
|
|
25
|
+
input: string;
|
|
26
|
+
output: string;
|
|
27
|
+
};
|
|
28
|
+
String: {
|
|
29
|
+
input: string;
|
|
30
|
+
output: string;
|
|
31
|
+
};
|
|
32
|
+
Boolean: {
|
|
33
|
+
input: boolean;
|
|
34
|
+
output: boolean;
|
|
35
|
+
};
|
|
36
|
+
Int: {
|
|
37
|
+
input: number;
|
|
38
|
+
output: number;
|
|
39
|
+
};
|
|
40
|
+
Float: {
|
|
41
|
+
input: number;
|
|
42
|
+
output: number;
|
|
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
|
+
Currency: {
|
|
97
|
+
input: string;
|
|
98
|
+
output: string;
|
|
99
|
+
};
|
|
100
|
+
Date: {
|
|
101
|
+
input: string;
|
|
102
|
+
output: string;
|
|
103
|
+
};
|
|
104
|
+
DateTime: {
|
|
105
|
+
input: string;
|
|
106
|
+
output: string;
|
|
107
|
+
};
|
|
108
|
+
EmailAddress: {
|
|
109
|
+
input: string;
|
|
110
|
+
output: string;
|
|
111
|
+
};
|
|
112
|
+
EthereumAddress: {
|
|
113
|
+
input: string;
|
|
114
|
+
output: string;
|
|
115
|
+
};
|
|
116
|
+
OID: {
|
|
117
|
+
input: string;
|
|
118
|
+
output: string;
|
|
119
|
+
};
|
|
120
|
+
OLabel: {
|
|
121
|
+
input: string;
|
|
122
|
+
output: string;
|
|
123
|
+
};
|
|
124
|
+
PHID: {
|
|
125
|
+
input: string;
|
|
126
|
+
output: string;
|
|
127
|
+
};
|
|
128
|
+
URL: {
|
|
129
|
+
input: string;
|
|
130
|
+
output: string;
|
|
131
|
+
};
|
|
132
|
+
Upload: {
|
|
133
|
+
input: File;
|
|
134
|
+
output: File;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export type BuilderProfileState = {
|
|
138
|
+
description: Maybe<Scalars["String"]["output"]>;
|
|
139
|
+
icon: Maybe<Scalars["URL"]["output"]>;
|
|
140
|
+
id: Maybe<Scalars["PHID"]["output"]>;
|
|
141
|
+
name: Maybe<Scalars["String"]["output"]>;
|
|
142
|
+
slug: Maybe<Scalars["String"]["output"]>;
|
|
143
|
+
};
|
|
144
|
+
export type UpdateProfileInput = {
|
|
145
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
146
|
+
icon?: InputMaybe<Scalars["URL"]["input"]>;
|
|
147
|
+
id?: InputMaybe<Scalars["PHID"]["input"]>;
|
|
148
|
+
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
149
|
+
slug?: InputMaybe<Scalars["String"]["input"]>;
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../document-models/builder-profile/gen/schema/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAChC,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,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AO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,EAAE,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { BuilderProfileState, UpdateProfileInput } from "./types.js";
|
|
3
|
+
type Properties<T> = Required<{
|
|
4
|
+
[K in keyof T]: z.ZodType<T[K], any, T[K]>;
|
|
5
|
+
}>;
|
|
6
|
+
type definedNonNullAny = {};
|
|
7
|
+
export declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
8
|
+
export declare const definedNonNullAnySchema: z.ZodEffects<z.ZodAny, definedNonNullAny, any>;
|
|
9
|
+
export declare function BuilderProfileStateSchema(): z.ZodObject<Properties<BuilderProfileState>>;
|
|
10
|
+
export declare function UpdateProfileInputSchema(): z.ZodObject<Properties<UpdateProfileInput>>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../../../document-models/builder-profile/gen/schema/zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE1E,KAAK,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C,CAAC,CAAC;AAEH,KAAK,iBAAiB,GAAG,EAAE,CAAC;AAE5B,eAAO,MAAM,mBAAmB,GAAI,GAAG,GAAG,KAAG,CAAC,IAAI,iBACnB,CAAC;AAEhC,eAAO,MAAM,uBAAuB,gDAEI,CAAC;AAEzC,wBAAgB,yBAAyB,IAAI,CAAC,CAAC,SAAS,CACtD,UAAU,CAAC,mBAAmB,CAAC,CAChC,CASA;AAED,wBAAgB,wBAAwB,IAAI,CAAC,CAAC,SAAS,CACrD,UAAU,CAAC,kBAAkB,CAAC,CAC/B,CAQA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const isDefinedNonNullAny = (v) => v !== undefined && v !== null;
|
|
3
|
+
export const definedNonNullAnySchema = z
|
|
4
|
+
.any()
|
|
5
|
+
.refine((v) => isDefinedNonNullAny(v));
|
|
6
|
+
export function BuilderProfileStateSchema() {
|
|
7
|
+
return z.object({
|
|
8
|
+
__typename: z.literal("BuilderProfileState").optional(),
|
|
9
|
+
description: z.string().nullable(),
|
|
10
|
+
icon: z.string().url().nullable(),
|
|
11
|
+
id: z.string().nullable(),
|
|
12
|
+
name: z.string().nullable(),
|
|
13
|
+
slug: z.string().nullable(),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export function UpdateProfileInputSchema() {
|
|
17
|
+
return z.object({
|
|
18
|
+
description: z.string().nullish(),
|
|
19
|
+
icon: z.string().url().nullish(),
|
|
20
|
+
id: z.string().nullish(),
|
|
21
|
+
name: z.string().nullish(),
|
|
22
|
+
slug: z.string().nullish(),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PHDocument } from "document-model";
|
|
2
|
+
import type { BuilderProfileAction } from "./actions.js";
|
|
3
|
+
import type { BuilderProfilePHState } from "./ph-factories.js";
|
|
4
|
+
import type { BuilderProfileState } from "./schema/types.js";
|
|
5
|
+
export { z } from "./schema/index.js";
|
|
6
|
+
export type * from "./schema/types.js";
|
|
7
|
+
type BuilderProfileLocalState = Record<PropertyKey, never>;
|
|
8
|
+
export type BuilderProfileDocument = PHDocument<BuilderProfilePHState>;
|
|
9
|
+
export type { BuilderProfileState, BuilderProfileLocalState, BuilderProfileAction, };
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../document-models/builder-profile/gen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,mBAAmB,mBAAmB,CAAC;AACvC,KAAK,wBAAwB,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAC3D,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;AACvE,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { z } from "./schema/index.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CreateDocument, type CreateState, type LoadFromFile, type LoadFromInput } from "document-model";
|
|
2
|
+
import { type BuilderProfileState, type BuilderProfileLocalState } from "./types.js";
|
|
3
|
+
import { BuilderProfilePHState } from "./ph-factories.js";
|
|
4
|
+
export declare const initialGlobalState: BuilderProfileState;
|
|
5
|
+
export declare const initialLocalState: BuilderProfileLocalState;
|
|
6
|
+
export declare const createState: CreateState<BuilderProfilePHState>;
|
|
7
|
+
export declare const createDocument: CreateDocument<BuilderProfilePHState>;
|
|
8
|
+
export declare const saveToFile: (document: any, path: string, name?: string) => Promise<string>;
|
|
9
|
+
export declare const saveToFileHandle: (document: any, input: any) => Promise<void>;
|
|
10
|
+
export declare const loadFromFile: LoadFromFile<BuilderProfilePHState>;
|
|
11
|
+
export declare const loadFromInput: LoadFromInput<BuilderProfilePHState>;
|
|
12
|
+
declare const utils: {
|
|
13
|
+
fileExtension: string;
|
|
14
|
+
createState: CreateState<BuilderProfilePHState>;
|
|
15
|
+
createDocument: CreateDocument<BuilderProfilePHState>;
|
|
16
|
+
saveToFile: (document: any, path: string, name?: string) => Promise<string>;
|
|
17
|
+
saveToFileHandle: (document: any, input: any) => Promise<void>;
|
|
18
|
+
loadFromFile: LoadFromFile<BuilderProfilePHState>;
|
|
19
|
+
loadFromInput: LoadFromInput<BuilderProfilePHState>;
|
|
20
|
+
};
|
|
21
|
+
export default utils;
|
|
22
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../document-models/builder-profile/gen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAQnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,eAAO,MAAM,kBAAkB,EAAE,mBAMhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,wBAA6B,CAAC;AAE9D,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAM1D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,qBAAqB,CAQhE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,UAAU,GAAG,EAAE,MAAM,MAAM,EAAE,OAAO,MAAM,oBAEpE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,UAAU,GAAG,EAAE,OAAO,GAAG,kBAEzD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,qBAAqB,CAE5D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,qBAAqB,CAE9D,CAAC;AAEF,QAAA,MAAM,KAAK;;;;2BAhB0B,GAAG,QAAQ,MAAM,SAAS,MAAM;iCAI1B,GAAG,SAAS,GAAG;;;CAoBzD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { baseCreateDocument, baseSaveToFile, baseSaveToFileHandle, baseLoadFromFile, baseLoadFromInput, defaultBaseState, generateId, } from "document-model";
|
|
2
|
+
import { reducer } from "./reducer.js";
|
|
3
|
+
export const initialGlobalState = {
|
|
4
|
+
id: null,
|
|
5
|
+
slug: null,
|
|
6
|
+
name: null,
|
|
7
|
+
icon: null,
|
|
8
|
+
description: null,
|
|
9
|
+
};
|
|
10
|
+
export const initialLocalState = {};
|
|
11
|
+
export const createState = (state) => {
|
|
12
|
+
return {
|
|
13
|
+
...defaultBaseState(),
|
|
14
|
+
global: { ...initialGlobalState, ...(state?.global ?? {}) },
|
|
15
|
+
local: { ...initialLocalState, ...(state?.local ?? {}) },
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const createDocument = (state) => {
|
|
19
|
+
const document = baseCreateDocument(createState, state);
|
|
20
|
+
document.header.documentType = "powerhouse/builder-profile";
|
|
21
|
+
// for backwards compatibility, but this is NOT a valid signed document id
|
|
22
|
+
document.header.id = generateId();
|
|
23
|
+
return document;
|
|
24
|
+
};
|
|
25
|
+
export const saveToFile = (document, path, name) => {
|
|
26
|
+
return baseSaveToFile(document, path, ".phdm", name);
|
|
27
|
+
};
|
|
28
|
+
export const saveToFileHandle = (document, input) => {
|
|
29
|
+
return baseSaveToFileHandle(document, input);
|
|
30
|
+
};
|
|
31
|
+
export const loadFromFile = (path) => {
|
|
32
|
+
return baseLoadFromFile(path, reducer);
|
|
33
|
+
};
|
|
34
|
+
export const loadFromInput = (input) => {
|
|
35
|
+
return baseLoadFromInput(input, reducer);
|
|
36
|
+
};
|
|
37
|
+
const utils = {
|
|
38
|
+
fileExtension: ".phdm",
|
|
39
|
+
createState,
|
|
40
|
+
createDocument,
|
|
41
|
+
saveToFile,
|
|
42
|
+
saveToFileHandle,
|
|
43
|
+
loadFromFile,
|
|
44
|
+
loadFromInput,
|
|
45
|
+
};
|
|
46
|
+
export default utils;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization.
|
|
3
|
+
* Delete the file and run the code generator again to have it reset
|
|
4
|
+
*/
|
|
5
|
+
import { type DocumentModelModule } from "document-model";
|
|
6
|
+
import { reducer } from "./gen/reducer.js";
|
|
7
|
+
import { documentModel } from "./gen/document-model.js";
|
|
8
|
+
import type { BuilderProfilePHState } from "./gen/ph-factories.js";
|
|
9
|
+
declare const utils: {
|
|
10
|
+
fileExtension: string;
|
|
11
|
+
createState: import("document-model").CreateState<BuilderProfilePHState>;
|
|
12
|
+
createDocument: import("document-model").CreateDocument<BuilderProfilePHState>;
|
|
13
|
+
saveToFile: (document: any, path: string, name?: string) => Promise<string>;
|
|
14
|
+
saveToFileHandle: (document: any, input: any) => Promise<void>;
|
|
15
|
+
loadFromFile: import("document-model").LoadFromFile<BuilderProfilePHState>;
|
|
16
|
+
loadFromInput: import("document-model").LoadFromInput<BuilderProfilePHState>;
|
|
17
|
+
};
|
|
18
|
+
declare const actions: {
|
|
19
|
+
updateProfile: (input: import("./gen/index.js").UpdateProfileInput) => import("./gen/index.js").UpdateProfileAction;
|
|
20
|
+
};
|
|
21
|
+
export declare const module: DocumentModelModule<BuilderProfilePHState>;
|
|
22
|
+
export { reducer, actions, utils, documentModel };
|
|
23
|
+
export * from "./gen/types.js";
|
|
24
|
+
export * from "./src/utils.js";
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../document-models/builder-profile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,QAAA,MAAM,KAAK;;;;;;;;CAAkC,CAAC;AAC9C,QAAA,MAAM,OAAO;oBATb,kDACA;CAQ4D,CAAC;AAE7D,eAAO,MAAM,MAAM,EAAE,mBAAmB,CAAC,qBAAqB,CAK7D,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAElD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization.
|
|
3
|
+
* Delete the file and run the code generator again to have it reset
|
|
4
|
+
*/
|
|
5
|
+
import { actions as BaseActions, } from "document-model";
|
|
6
|
+
import { actions as BuilderProfileActions } from "./gen/index.js";
|
|
7
|
+
import { reducer } from "./gen/reducer.js";
|
|
8
|
+
import { documentModel } from "./gen/document-model.js";
|
|
9
|
+
import genUtils from "./gen/utils.js";
|
|
10
|
+
import * as customUtils from "./src/utils.js";
|
|
11
|
+
const utils = { ...genUtils, ...customUtils };
|
|
12
|
+
const actions = { ...BaseActions, ...BuilderProfileActions };
|
|
13
|
+
export const module = {
|
|
14
|
+
reducer,
|
|
15
|
+
actions,
|
|
16
|
+
utils,
|
|
17
|
+
documentModel,
|
|
18
|
+
};
|
|
19
|
+
export { reducer, actions, utils, documentModel };
|
|
20
|
+
export * from "./gen/types.js";
|
|
21
|
+
export * from "./src/utils.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../../document-models/builder-profile/src/reducers/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAEvF,eAAO,MAAM,OAAO,EAAE,+BAQrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const reducer = {
|
|
2
|
+
updateProfileOperation(state, action, dispatch) {
|
|
3
|
+
state.id = action.input.id ?? state.id;
|
|
4
|
+
state.slug = action.input.slug ?? state.slug;
|
|
5
|
+
state.name = action.input.name ?? state.name;
|
|
6
|
+
state.icon = action.input.icon ?? state.icon;
|
|
7
|
+
state.description = action.input.description ?? state.description;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/builder-profile/src/tests/builder.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
|
+
import utils from "../../gen/utils.js";
|
|
3
|
+
import { reducer } from "../../gen/reducer.js";
|
|
4
|
+
import * as creators from "../../gen/builder/creators.js";
|
|
5
|
+
import { z } from "../../gen/schema/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* BuilderProfile Document Model: Comprehensive Tests
|
|
8
|
+
* Focus: PHID and URL field validation, update, and expected behaviors
|
|
9
|
+
*/
|
|
10
|
+
const VALID_PHID = "phd:baefc2a4-f9a0-4950-8161-fd8d8cc7dea7";
|
|
11
|
+
const VALID_URL = "https://powerhouse.inc/icon.png";
|
|
12
|
+
const INVALID_PHID = "invalid:format:phid";
|
|
13
|
+
const INVALID_URL = "not-a-url";
|
|
14
|
+
describe("BuilderProfile Document Model", () => {
|
|
15
|
+
let document;
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
document = utils.createDocument();
|
|
18
|
+
});
|
|
19
|
+
it("should accept a valid PHID and URL in updateProfile", () => {
|
|
20
|
+
const input = {
|
|
21
|
+
id: VALID_PHID,
|
|
22
|
+
slug: "builder-slug",
|
|
23
|
+
name: "Builder Name",
|
|
24
|
+
icon: VALID_URL,
|
|
25
|
+
description: "A valid builder description"
|
|
26
|
+
};
|
|
27
|
+
// Should not throw during reducer/update
|
|
28
|
+
const updatedDocument = reducer(document, creators.updateProfile(input));
|
|
29
|
+
// Check operation appended with strict equality
|
|
30
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
31
|
+
const op = updatedDocument.operations.global[0];
|
|
32
|
+
expect(op.action.type).toBe("UPDATE_PROFILE");
|
|
33
|
+
expect(op.action.input).toStrictEqual(input);
|
|
34
|
+
// Ensure the PHID and URL fields persisted in state
|
|
35
|
+
expect(updatedDocument.state.global.id).toBe(VALID_PHID);
|
|
36
|
+
expect(updatedDocument.state.global.icon).toBe(VALID_URL);
|
|
37
|
+
});
|
|
38
|
+
it("should reject an invalid PHID using Zod validation", () => {
|
|
39
|
+
const input = {
|
|
40
|
+
id: INVALID_PHID,
|
|
41
|
+
slug: "builder-slug",
|
|
42
|
+
name: "Builder Name",
|
|
43
|
+
icon: VALID_URL,
|
|
44
|
+
description: "should fail phid"
|
|
45
|
+
};
|
|
46
|
+
// Zod parsing should throw
|
|
47
|
+
expect(() => z.UpdateProfileInputSchema().parse(input)).toThrow();
|
|
48
|
+
});
|
|
49
|
+
it("should reject an invalid URL using Zod validation", () => {
|
|
50
|
+
const input = {
|
|
51
|
+
id: VALID_PHID,
|
|
52
|
+
slug: "builder-slug",
|
|
53
|
+
name: "Builder Name",
|
|
54
|
+
icon: INVALID_URL,
|
|
55
|
+
description: "should fail url"
|
|
56
|
+
};
|
|
57
|
+
// Zod parsing should throw
|
|
58
|
+
expect(() => z.UpdateProfileInputSchema().parse(input)).toThrow();
|
|
59
|
+
});
|
|
60
|
+
it("should update only the URL and PHID fields if only they are provided", () => {
|
|
61
|
+
// The rest of the state is initialized to undefined by utils.createDocument()
|
|
62
|
+
// Set initial values
|
|
63
|
+
const initialInput = {
|
|
64
|
+
id: VALID_PHID,
|
|
65
|
+
slug: "slug-main",
|
|
66
|
+
name: "Initial Name",
|
|
67
|
+
icon: VALID_URL,
|
|
68
|
+
description: "Initial desc"
|
|
69
|
+
};
|
|
70
|
+
let currDoc = reducer(document, creators.updateProfile(initialInput));
|
|
71
|
+
// Now, update only id and icon
|
|
72
|
+
const updateInput = {
|
|
73
|
+
id: "phd:12345678-1111-2222-3333-abcdefabcdef:main:public",
|
|
74
|
+
icon: "https://updated-url.com/icon.svg"
|
|
75
|
+
};
|
|
76
|
+
currDoc = reducer(currDoc, creators.updateProfile(updateInput));
|
|
77
|
+
// id & icon changed, others remain
|
|
78
|
+
expect(currDoc.state.global.id).toBe(updateInput.id);
|
|
79
|
+
expect(currDoc.state.global.icon).toBe(updateInput.icon);
|
|
80
|
+
expect(currDoc.state.global.slug).toBe(initialInput.slug);
|
|
81
|
+
expect(currDoc.state.global.name).toBe(initialInput.name);
|
|
82
|
+
expect(currDoc.state.global.description).toBe(initialInput.description);
|
|
83
|
+
});
|
|
84
|
+
it("should allow updateProfile with partial inputs, always keeping PHID format valid", () => {
|
|
85
|
+
// Start with valid state
|
|
86
|
+
const initialState = {
|
|
87
|
+
id: VALID_PHID,
|
|
88
|
+
slug: "val-slug",
|
|
89
|
+
name: "val-name",
|
|
90
|
+
icon: VALID_URL,
|
|
91
|
+
description: "val desc"
|
|
92
|
+
};
|
|
93
|
+
let doc = reducer(document, creators.updateProfile(initialState));
|
|
94
|
+
// Now update only slug
|
|
95
|
+
const partialInput = {
|
|
96
|
+
slug: "new-slug"
|
|
97
|
+
};
|
|
98
|
+
doc = reducer(doc, creators.updateProfile(partialInput));
|
|
99
|
+
// id is preserved and still valid PHID
|
|
100
|
+
expect(doc.state.global.id).toBe(VALID_PHID);
|
|
101
|
+
// slug should update
|
|
102
|
+
expect(doc.state.global.slug).toBe("new-slug");
|
|
103
|
+
});
|
|
104
|
+
it("should throw if after a partial update the PHID is not valid", () => {
|
|
105
|
+
// Start with bad PHID in state
|
|
106
|
+
document.state.global.id = INVALID_PHID;
|
|
107
|
+
const input = {
|
|
108
|
+
slug: "doesnt-matter"
|
|
109
|
+
};
|
|
110
|
+
// Can't validate via reducer, so check with zod directly
|
|
111
|
+
expect(() => z.BuilderProfileStateSchema().parse({
|
|
112
|
+
...document.state,
|
|
113
|
+
...input
|
|
114
|
+
})).toThrow();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-model.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/builder-profile/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a scaffold file meant for customization:
|
|
3
|
+
* - change it by adding new tests or modifying the existing ones
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import utils, { initialGlobalState, initialLocalState, } from "../../gen/utils.js";
|
|
7
|
+
describe("Builder Profile Document Model", () => {
|
|
8
|
+
it("should create a new Builder Profile document", () => {
|
|
9
|
+
const document = utils.createDocument();
|
|
10
|
+
expect(document).toBeDefined();
|
|
11
|
+
expect(document.header.documentType).toBe("powerhouse/builder-profile");
|
|
12
|
+
});
|
|
13
|
+
it("should create a new Builder Profile document with a valid initial state", () => {
|
|
14
|
+
const document = utils.createDocument();
|
|
15
|
+
expect(document.state.global).toStrictEqual(initialGlobalState);
|
|
16
|
+
expect(document.state.local).toStrictEqual(initialLocalState);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../document-models/builder-profile/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AACV,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { module as BuilderProfile } from "./builder-profile/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/builder-profile/editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AA6LjC,MAAM,CAAC,OAAO,UAAU,MAAM,4CAgN7B"}
|