@powerhousedao/vetra-builder-package 0.0.17 → 0.0.19
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/document-models/builder-account/gen/document-model.js +1 -1
- package/dist/document-models/builder-account/gen/profile/actions.d.ts +5 -5
- package/dist/document-models/builder-account/gen/profile/creators.d.ts +3 -3
- package/dist/document-models/builder-account/gen/profile/creators.js +1 -1
- package/dist/document-models/builder-account/gen/profile/object.d.ts +2 -2
- package/dist/document-models/builder-account/gen/profile/object.js +3 -3
- package/dist/document-models/builder-account/gen/profile/operations.d.ts +2 -2
- package/dist/document-models/builder-account/gen/reducer.js +3 -3
- package/dist/document-models/builder-account/gen/schema/types.d.ts +1 -1
- package/dist/document-models/builder-account/gen/schema/zod.js +1 -1
- package/dist/document-models/builder-account/index.d.ts +1 -1
- package/dist/document-models/builder-account/src/reducers/profile.js +4 -0
- package/dist/document-models/builder-team/gen/actions.d.ts +9 -0
- package/dist/document-models/builder-team/gen/actions.js +4 -0
- package/dist/document-models/builder-team/gen/creators.d.ts +4 -0
- package/dist/document-models/builder-team/gen/creators.js +4 -0
- package/dist/document-models/builder-team/gen/document-model.d.ts +2 -0
- package/dist/document-models/builder-team/gen/document-model.js +212 -0
- package/dist/document-models/builder-team/gen/index.d.ts +7 -0
- package/dist/document-models/builder-team/gen/index.js +6 -0
- package/dist/document-models/builder-team/gen/member/actions.d.ts +15 -0
- package/dist/document-models/builder-team/gen/member/actions.js +1 -0
- package/dist/document-models/builder-team/gen/member/creators.d.ts +5 -0
- package/dist/document-models/builder-team/gen/member/creators.js +5 -0
- package/dist/document-models/builder-team/gen/member/error.d.ts +1 -0
- package/dist/document-models/builder-team/gen/member/error.js +1 -0
- package/dist/document-models/builder-team/gen/member/object.d.ts +8 -0
- package/dist/document-models/builder-team/gen/member/object.js +13 -0
- package/dist/document-models/builder-team/gen/member/operations.d.ts +8 -0
- package/dist/document-models/builder-team/gen/member/operations.js +1 -0
- package/dist/document-models/builder-team/gen/object.d.ts +20 -0
- package/dist/document-models/builder-team/gen/object.js +36 -0
- package/dist/document-models/builder-team/gen/packages/actions.d.ts +15 -0
- package/dist/document-models/builder-team/gen/packages/actions.js +1 -0
- package/dist/document-models/builder-team/gen/packages/creators.d.ts +5 -0
- package/dist/document-models/builder-team/gen/packages/creators.js +5 -0
- package/dist/document-models/builder-team/gen/packages/error.d.ts +1 -0
- package/dist/document-models/builder-team/gen/packages/error.js +1 -0
- package/dist/document-models/builder-team/gen/packages/object.d.ts +8 -0
- package/dist/document-models/builder-team/gen/packages/object.js +13 -0
- package/dist/document-models/builder-team/gen/packages/operations.d.ts +8 -0
- package/dist/document-models/builder-team/gen/packages/operations.js +1 -0
- package/dist/document-models/builder-team/gen/ph-factories.d.ts +26 -0
- package/dist/document-models/builder-team/gen/ph-factories.js +62 -0
- package/dist/document-models/builder-team/gen/profile/actions.d.ts +23 -0
- package/dist/document-models/builder-team/gen/profile/actions.js +1 -0
- package/dist/document-models/builder-team/gen/profile/creators.d.ts +7 -0
- package/dist/document-models/builder-team/gen/profile/creators.js +7 -0
- package/dist/document-models/builder-team/gen/profile/error.d.ts +1 -0
- package/dist/document-models/builder-team/gen/profile/error.js +1 -0
- package/dist/document-models/builder-team/gen/profile/object.d.ts +10 -0
- package/dist/document-models/builder-team/gen/profile/object.js +19 -0
- package/dist/document-models/builder-team/gen/profile/operations.d.ts +10 -0
- package/dist/document-models/builder-team/gen/profile/operations.js +1 -0
- package/dist/document-models/builder-team/gen/reducer.d.ts +4 -0
- package/dist/document-models/builder-team/gen/reducer.js +75 -0
- package/dist/document-models/builder-team/gen/schema/index.d.ts +2 -0
- package/dist/document-models/builder-team/gen/schema/index.js +2 -0
- package/dist/document-models/builder-team/gen/schema/types.d.ts +247 -0
- package/dist/document-models/builder-team/gen/schema/types.js +1 -0
- package/dist/document-models/builder-team/gen/schema/zod.d.ts +29 -0
- package/dist/document-models/builder-team/gen/schema/zod.js +148 -0
- package/dist/document-models/builder-team/gen/spaces/actions.d.ts +15 -0
- package/dist/document-models/builder-team/gen/spaces/actions.js +1 -0
- package/dist/document-models/builder-team/gen/spaces/creators.d.ts +5 -0
- package/dist/document-models/builder-team/gen/spaces/creators.js +5 -0
- package/dist/document-models/builder-team/gen/spaces/error.d.ts +1 -0
- package/dist/document-models/builder-team/gen/spaces/error.js +1 -0
- package/dist/document-models/builder-team/gen/spaces/object.d.ts +8 -0
- package/dist/document-models/builder-team/gen/spaces/object.js +13 -0
- package/dist/document-models/builder-team/gen/spaces/operations.d.ts +8 -0
- package/dist/document-models/builder-team/gen/spaces/operations.js +1 -0
- package/dist/document-models/builder-team/gen/types.d.ts +9 -0
- package/dist/document-models/builder-team/gen/types.js +1 -0
- package/dist/document-models/builder-team/gen/utils.d.ts +21 -0
- package/dist/document-models/builder-team/gen/utils.js +54 -0
- package/dist/document-models/builder-team/index.d.ts +37 -0
- package/dist/document-models/builder-team/index.js +21 -0
- package/dist/document-models/builder-team/src/reducers/member.d.ts +2 -0
- package/dist/document-models/builder-team/src/reducers/member.js +30 -0
- package/dist/document-models/builder-team/src/reducers/packages.d.ts +2 -0
- package/dist/document-models/builder-team/src/reducers/packages.js +40 -0
- package/dist/document-models/builder-team/src/reducers/profile.d.ts +2 -0
- package/dist/document-models/builder-team/src/reducers/profile.js +26 -0
- package/dist/document-models/builder-team/src/reducers/spaces.d.ts +2 -0
- package/dist/document-models/builder-team/src/reducers/spaces.js +34 -0
- package/dist/document-models/builder-team/src/tests/document-model.test.d.ts +5 -0
- package/dist/document-models/builder-team/src/tests/document-model.test.js +18 -0
- package/dist/document-models/builder-team/src/tests/member.test.d.ts +5 -0
- package/dist/document-models/builder-team/src/tests/member.test.js +40 -0
- package/dist/document-models/builder-team/src/tests/packages.test.d.ts +5 -0
- package/dist/document-models/builder-team/src/tests/packages.test.js +40 -0
- package/dist/document-models/builder-team/src/tests/profile.test.d.ts +5 -0
- package/dist/document-models/builder-team/src/tests/profile.test.js +56 -0
- package/dist/document-models/builder-team/src/tests/spaces.test.d.ts +5 -0
- package/dist/document-models/builder-team/src/tests/spaces.test.js +40 -0
- package/dist/document-models/builder-team/src/utils.d.ts +1 -0
- package/dist/document-models/builder-team/src/utils.js +1 -0
- package/dist/document-models/index.d.ts +1 -1
- package/dist/document-models/index.js +1 -1
- package/dist/editors/builder-team-editor/components/Header.d.ts +8 -0
- package/dist/editors/builder-team-editor/components/Header.js +5 -0
- package/dist/editors/builder-team-editor/components/MembersSection.d.ts +14 -0
- package/dist/editors/builder-team-editor/components/MembersSection.js +152 -0
- package/dist/editors/builder-team-editor/components/PackageForm.d.ts +8 -0
- package/dist/editors/builder-team-editor/components/PackageForm.js +92 -0
- package/dist/editors/builder-team-editor/components/PackageItem.d.ts +11 -0
- package/dist/editors/builder-team-editor/components/PackageItem.js +99 -0
- package/dist/editors/builder-team-editor/components/ProfileSection.d.ts +17 -0
- package/dist/editors/builder-team-editor/components/ProfileSection.js +5 -0
- package/dist/editors/builder-team-editor/components/QuickStats.d.ts +7 -0
- package/dist/editors/builder-team-editor/components/QuickStats.js +5 -0
- package/dist/editors/builder-team-editor/components/SpaceForm.d.ts +9 -0
- package/dist/editors/builder-team-editor/components/SpaceForm.js +11 -0
- package/dist/editors/builder-team-editor/components/SpaceItem.d.ts +21 -0
- package/dist/editors/builder-team-editor/components/SpaceItem.js +12 -0
- package/dist/editors/builder-team-editor/components/SpacesSection.d.ts +22 -0
- package/dist/editors/builder-team-editor/components/SpacesSection.js +14 -0
- package/dist/editors/builder-team-editor/config.d.ts +6 -0
- package/dist/editors/builder-team-editor/config.js +11 -0
- package/dist/editors/builder-team-editor/editor.d.ts +3 -0
- package/dist/editors/builder-team-editor/editor.js +73 -0
- package/dist/editors/builder-team-editor/hooks/useMemberHandlers.d.ts +12 -0
- package/dist/editors/builder-team-editor/hooks/useMemberHandlers.js +27 -0
- package/dist/editors/builder-team-editor/hooks/usePackageHandlers.d.ts +11 -0
- package/dist/editors/builder-team-editor/hooks/usePackageHandlers.js +49 -0
- package/dist/editors/builder-team-editor/hooks/useProfileHandlers.d.ts +14 -0
- package/dist/editors/builder-team-editor/hooks/useProfileHandlers.js +38 -0
- package/dist/editors/builder-team-editor/hooks/useSpaceHandlers.d.ts +15 -0
- package/dist/editors/builder-team-editor/hooks/useSpaceHandlers.js +82 -0
- package/dist/editors/builder-team-editor/index.d.ts +2 -0
- package/dist/editors/builder-team-editor/index.js +11 -0
- package/dist/editors/hooks/useBuilderTeamDocument.d.ts +3 -0
- package/dist/editors/hooks/useBuilderTeamDocument.js +8 -0
- package/dist/editors/index.d.ts +1 -1
- package/dist/editors/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/powerhouse.manifest.json +21 -6
- package/dist/processors/factory.d.ts +0 -4
- package/dist/processors/factory.js +3 -3
- package/dist/processors/index.d.ts +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/processors/old_vetra-builder-relational-db-processor/factory.d.ts +3 -0
- package/dist/processors/old_vetra-builder-relational-db-processor/factory.js +22 -0
- package/dist/processors/old_vetra-builder-relational-db-processor/index.d.ts +9 -0
- package/dist/processors/old_vetra-builder-relational-db-processor/index.js +32 -0
- package/dist/processors/old_vetra-builder-relational-db-processor/migrations.d.ts +3 -0
- package/dist/processors/old_vetra-builder-relational-db-processor/migrations.js +14 -0
- package/dist/processors/old_vetra-builder-relational-db-processor/schema.d.ts +7 -0
- package/dist/processors/old_vetra-builder-relational-db-processor/schema.js +1 -0
- package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.d.ts +22 -0
- package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.js +261 -0
- package/dist/processors/vetra-builder-relational-db-processor/database-helpers.d.ts +39 -0
- package/dist/processors/vetra-builder-relational-db-processor/database-helpers.js +144 -0
- package/dist/processors/vetra-builder-relational-db-processor/factory.d.ts +3 -0
- package/dist/processors/vetra-builder-relational-db-processor/factory.js +23 -0
- package/dist/processors/vetra-builder-relational-db-processor/index.d.ts +13 -0
- package/dist/processors/vetra-builder-relational-db-processor/index.js +53 -0
- package/dist/processors/vetra-builder-relational-db-processor/migrations.d.ts +3 -0
- package/dist/processors/vetra-builder-relational-db-processor/migrations.js +155 -0
- package/dist/processors/vetra-builder-relational-db-processor/schema.d.ts +66 -0
- package/dist/processors/vetra-builder-relational-db-processor/schema.js +1 -0
- package/dist/processors/vetra-builder-relational-db-processor/types.d.ts +32 -0
- package/dist/processors/vetra-builder-relational-db-processor/types.js +1 -0
- package/dist/style.css +36 -28
- package/dist/subgraphs/builder-account/resolvers.js +3 -3
- package/dist/subgraphs/builder-account/schema.js +4 -4
- package/dist/subgraphs/builder-team/index.d.ts +10 -0
- package/dist/subgraphs/builder-team/index.js +11 -0
- package/dist/subgraphs/builder-team/resolvers.d.ts +2 -0
- package/dist/subgraphs/builder-team/resolvers.js +240 -0
- package/dist/subgraphs/builder-team/schema.d.ts +2 -0
- package/dist/subgraphs/builder-team/schema.js +228 -0
- package/dist/subgraphs/index.d.ts +2 -2
- package/dist/subgraphs/index.js +3 -2
- package/dist/subgraphs/vetra-builders/index.d.ts +10 -0
- package/dist/subgraphs/vetra-builders/index.js +11 -0
- package/dist/subgraphs/vetra-builders/resolvers.d.ts +2 -0
- package/dist/subgraphs/vetra-builders/resolvers.js +144 -0
- package/dist/subgraphs/vetra-builders/schema.d.ts +2 -0
- package/dist/subgraphs/vetra-builders/schema.js +79 -0
- package/dist/subgraphs/vetra-builders-bkp/index.d.ts +10 -0
- package/dist/subgraphs/vetra-builders-bkp/index.js +11 -0
- package/dist/subgraphs/vetra-builders-bkp/resolvers.d.ts +2 -0
- package/dist/subgraphs/vetra-builders-bkp/resolvers.js +10 -0
- package/dist/subgraphs/vetra-builders-bkp/schema.d.ts +2 -0
- package/dist/subgraphs/vetra-builders-bkp/schema.js +9 -0
- package/dist/utils/nano-id.d.ts +1 -0
- package/dist/utils/nano-id.js +4 -0
- package/package.json +4 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory methods for creating BuilderTeamDocument instances
|
|
3
|
+
*/
|
|
4
|
+
import { type PHAuthState, type PHDocumentState, type PHBaseState } from "document-model";
|
|
5
|
+
import type { BuilderTeamDocument, BuilderTeamLocalState, BuilderTeamState } from "./types.js";
|
|
6
|
+
export type BuilderTeamPHState = PHBaseState & {
|
|
7
|
+
global: BuilderTeamState;
|
|
8
|
+
local: BuilderTeamLocalState;
|
|
9
|
+
};
|
|
10
|
+
export declare function defaultGlobalState(): BuilderTeamState;
|
|
11
|
+
export declare function defaultLocalState(): BuilderTeamLocalState;
|
|
12
|
+
export declare function defaultPHState(): BuilderTeamPHState;
|
|
13
|
+
export declare function createGlobalState(state?: Partial<BuilderTeamState>): BuilderTeamState;
|
|
14
|
+
export declare function createLocalState(state?: Partial<BuilderTeamLocalState>): BuilderTeamLocalState;
|
|
15
|
+
export declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<BuilderTeamState>, localState?: Partial<BuilderTeamLocalState>): BuilderTeamPHState;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a BuilderTeamDocument with custom global and local state
|
|
18
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
19
|
+
* document-specific state to be set.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createBuilderTeamDocument(state?: Partial<{
|
|
22
|
+
auth?: Partial<PHAuthState>;
|
|
23
|
+
document?: Partial<PHDocumentState>;
|
|
24
|
+
global?: Partial<BuilderTeamState>;
|
|
25
|
+
local?: Partial<BuilderTeamLocalState>;
|
|
26
|
+
}>): BuilderTeamDocument;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory methods for creating BuilderTeamDocument instances
|
|
3
|
+
*/
|
|
4
|
+
import { createBaseState, defaultBaseState, } from "document-model";
|
|
5
|
+
import { createDocument } from "./utils.js";
|
|
6
|
+
export function defaultGlobalState() {
|
|
7
|
+
return {
|
|
8
|
+
profile: {
|
|
9
|
+
logo: null,
|
|
10
|
+
name: "",
|
|
11
|
+
slug: "",
|
|
12
|
+
description: null,
|
|
13
|
+
socials: {
|
|
14
|
+
xProfile: null,
|
|
15
|
+
github: null,
|
|
16
|
+
website: null,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
members: [],
|
|
20
|
+
spaces: [],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function defaultLocalState() {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
export function defaultPHState() {
|
|
27
|
+
return {
|
|
28
|
+
...defaultBaseState(),
|
|
29
|
+
global: defaultGlobalState(),
|
|
30
|
+
local: defaultLocalState(),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function createGlobalState(state) {
|
|
34
|
+
return {
|
|
35
|
+
...defaultGlobalState(),
|
|
36
|
+
...(state || {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function createLocalState(state) {
|
|
40
|
+
return {
|
|
41
|
+
...defaultLocalState(),
|
|
42
|
+
...(state || {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function createState(baseState, globalState, localState) {
|
|
46
|
+
return {
|
|
47
|
+
...createBaseState(baseState?.auth, baseState?.document),
|
|
48
|
+
global: createGlobalState(globalState),
|
|
49
|
+
local: createLocalState(localState),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates a BuilderTeamDocument with custom global and local state
|
|
54
|
+
* This properly handles the PHBaseState requirements while allowing
|
|
55
|
+
* document-specific state to be set.
|
|
56
|
+
*/
|
|
57
|
+
export function createBuilderTeamDocument(state) {
|
|
58
|
+
const document = createDocument(state
|
|
59
|
+
? createState(createBaseState(state.auth, state.document), state.global, state.local)
|
|
60
|
+
: undefined);
|
|
61
|
+
return document;
|
|
62
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Action } from "document-model";
|
|
2
|
+
import type { SetLogoInput, SetTeamNameInput, SetSlugInput, SetDescriptionInput, SetSocialsInput } from "../types.js";
|
|
3
|
+
export type SetLogoAction = Action & {
|
|
4
|
+
type: "SET_LOGO";
|
|
5
|
+
input: SetLogoInput;
|
|
6
|
+
};
|
|
7
|
+
export type SetTeamNameAction = Action & {
|
|
8
|
+
type: "SET_TEAM_NAME";
|
|
9
|
+
input: SetTeamNameInput;
|
|
10
|
+
};
|
|
11
|
+
export type SetSlugAction = Action & {
|
|
12
|
+
type: "SET_SLUG";
|
|
13
|
+
input: SetSlugInput;
|
|
14
|
+
};
|
|
15
|
+
export type SetDescriptionAction = Action & {
|
|
16
|
+
type: "SET_DESCRIPTION";
|
|
17
|
+
input: SetDescriptionInput;
|
|
18
|
+
};
|
|
19
|
+
export type SetSocialsAction = Action & {
|
|
20
|
+
type: "SET_SOCIALS";
|
|
21
|
+
input: SetSocialsInput;
|
|
22
|
+
};
|
|
23
|
+
export type BuilderTeamProfileAction = SetLogoAction | SetTeamNameAction | SetSlugAction | SetDescriptionAction | SetSocialsAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SetLogoInput, type SetTeamNameInput, type SetSlugInput, type SetDescriptionInput, type SetSocialsInput } from "../types.js";
|
|
2
|
+
import { type SetLogoAction, type SetTeamNameAction, type SetSlugAction, type SetDescriptionAction, type SetSocialsAction } from "./actions.js";
|
|
3
|
+
export declare const setLogo: (input: SetLogoInput) => SetLogoAction;
|
|
4
|
+
export declare const setTeamName: (input: SetTeamNameInput) => SetTeamNameAction;
|
|
5
|
+
export declare const setSlug: (input: SetSlugInput) => SetSlugAction;
|
|
6
|
+
export declare const setDescription: (input: SetDescriptionInput) => SetDescriptionAction;
|
|
7
|
+
export declare const setSocials: (input: SetSocialsInput) => SetSocialsAction;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createAction } from "document-model";
|
|
2
|
+
import { z, } from "../types.js";
|
|
3
|
+
export const setLogo = (input) => createAction("SET_LOGO", { ...input }, undefined, z.SetLogoInputSchema, "global");
|
|
4
|
+
export const setTeamName = (input) => createAction("SET_TEAM_NAME", { ...input }, undefined, z.SetTeamNameInputSchema, "global");
|
|
5
|
+
export const setSlug = (input) => createAction("SET_SLUG", { ...input }, undefined, z.SetSlugInputSchema, "global");
|
|
6
|
+
export const setDescription = (input) => createAction("SET_DESCRIPTION", { ...input }, undefined, z.SetDescriptionInputSchema, "global");
|
|
7
|
+
export const setSocials = (input) => createAction("SET_SOCIALS", { ...input }, undefined, z.SetSocialsInputSchema, "global");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const errors: {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const errors = {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseDocumentClass } from "document-model";
|
|
2
|
+
import { type BuilderTeamPHState } from "../ph-factories.js";
|
|
3
|
+
import { type SetLogoInput, type SetTeamNameInput, type SetSlugInput, type SetDescriptionInput, type SetSocialsInput } from "../types.js";
|
|
4
|
+
export default class BuilderTeam_Profile extends BaseDocumentClass<BuilderTeamPHState> {
|
|
5
|
+
setLogo(input: SetLogoInput): this;
|
|
6
|
+
setTeamName(input: SetTeamNameInput): this;
|
|
7
|
+
setSlug(input: SetSlugInput): this;
|
|
8
|
+
setDescription(input: SetDescriptionInput): this;
|
|
9
|
+
setSocials(input: SetSocialsInput): this;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseDocumentClass } from "document-model";
|
|
2
|
+
import { setLogo, setTeamName, setSlug, setDescription, setSocials, } from "./creators.js";
|
|
3
|
+
export default class BuilderTeam_Profile extends BaseDocumentClass {
|
|
4
|
+
setLogo(input) {
|
|
5
|
+
return this.dispatch(setLogo(input));
|
|
6
|
+
}
|
|
7
|
+
setTeamName(input) {
|
|
8
|
+
return this.dispatch(setTeamName(input));
|
|
9
|
+
}
|
|
10
|
+
setSlug(input) {
|
|
11
|
+
return this.dispatch(setSlug(input));
|
|
12
|
+
}
|
|
13
|
+
setDescription(input) {
|
|
14
|
+
return this.dispatch(setDescription(input));
|
|
15
|
+
}
|
|
16
|
+
setSocials(input) {
|
|
17
|
+
return this.dispatch(setSocials(input));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SignalDispatch } from "document-model";
|
|
2
|
+
import { type SetLogoAction, type SetTeamNameAction, type SetSlugAction, type SetDescriptionAction, type SetSocialsAction } from "./actions.js";
|
|
3
|
+
import { type BuilderTeamState } from "../types.js";
|
|
4
|
+
export interface BuilderTeamProfileOperations {
|
|
5
|
+
setLogoOperation: (state: BuilderTeamState, action: SetLogoAction, dispatch?: SignalDispatch) => void;
|
|
6
|
+
setTeamNameOperation: (state: BuilderTeamState, action: SetTeamNameAction, dispatch?: SignalDispatch) => void;
|
|
7
|
+
setSlugOperation: (state: BuilderTeamState, action: SetSlugAction, dispatch?: SignalDispatch) => void;
|
|
8
|
+
setDescriptionOperation: (state: BuilderTeamState, action: SetDescriptionAction, dispatch?: SignalDispatch) => void;
|
|
9
|
+
setSocialsOperation: (state: BuilderTeamState, action: SetSocialsAction, dispatch?: SignalDispatch) => void;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// TODO: remove eslint-disable rules once refactor is done
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
4
|
+
import { isDocumentAction, createReducer, } from "document-model";
|
|
5
|
+
import { z } from "./types.js";
|
|
6
|
+
import { reducer as ProfileReducer } from "../src/reducers/profile.js";
|
|
7
|
+
import { reducer as MemberReducer } from "../src/reducers/member.js";
|
|
8
|
+
import { reducer as SpacesReducer } from "../src/reducers/spaces.js";
|
|
9
|
+
import { reducer as PackagesReducer } from "../src/reducers/packages.js";
|
|
10
|
+
export const stateReducer = (state, action, dispatch) => {
|
|
11
|
+
if (isDocumentAction(action)) {
|
|
12
|
+
return state;
|
|
13
|
+
}
|
|
14
|
+
switch (action.type) {
|
|
15
|
+
case "SET_LOGO":
|
|
16
|
+
z.SetLogoInputSchema().parse(action.input);
|
|
17
|
+
ProfileReducer.setLogoOperation(state[action.scope], action, dispatch);
|
|
18
|
+
break;
|
|
19
|
+
case "SET_TEAM_NAME":
|
|
20
|
+
z.SetTeamNameInputSchema().parse(action.input);
|
|
21
|
+
ProfileReducer.setTeamNameOperation(state[action.scope], action, dispatch);
|
|
22
|
+
break;
|
|
23
|
+
case "SET_SLUG":
|
|
24
|
+
z.SetSlugInputSchema().parse(action.input);
|
|
25
|
+
ProfileReducer.setSlugOperation(state[action.scope], action, dispatch);
|
|
26
|
+
break;
|
|
27
|
+
case "SET_DESCRIPTION":
|
|
28
|
+
z.SetDescriptionInputSchema().parse(action.input);
|
|
29
|
+
ProfileReducer.setDescriptionOperation(state[action.scope], action, dispatch);
|
|
30
|
+
break;
|
|
31
|
+
case "SET_SOCIALS":
|
|
32
|
+
z.SetSocialsInputSchema().parse(action.input);
|
|
33
|
+
ProfileReducer.setSocialsOperation(state[action.scope], action, dispatch);
|
|
34
|
+
break;
|
|
35
|
+
case "ADD_MEMBER":
|
|
36
|
+
z.AddMemberInputSchema().parse(action.input);
|
|
37
|
+
MemberReducer.addMemberOperation(state[action.scope], action, dispatch);
|
|
38
|
+
break;
|
|
39
|
+
case "UPDATE_MEMBER_INFO":
|
|
40
|
+
z.UpdateMemberInfoInputSchema().parse(action.input);
|
|
41
|
+
MemberReducer.updateMemberInfoOperation(state[action.scope], action, dispatch);
|
|
42
|
+
break;
|
|
43
|
+
case "REMOVE_MEMBER":
|
|
44
|
+
z.RemoveMemberInputSchema().parse(action.input);
|
|
45
|
+
MemberReducer.removeMemberOperation(state[action.scope], action, dispatch);
|
|
46
|
+
break;
|
|
47
|
+
case "ADD_SPACE":
|
|
48
|
+
z.AddSpaceInputSchema().parse(action.input);
|
|
49
|
+
SpacesReducer.addSpaceOperation(state[action.scope], action, dispatch);
|
|
50
|
+
break;
|
|
51
|
+
case "UPDATE_SPACE_INFO":
|
|
52
|
+
z.UpdateSpaceInfoInputSchema().parse(action.input);
|
|
53
|
+
SpacesReducer.updateSpaceInfoOperation(state[action.scope], action, dispatch);
|
|
54
|
+
break;
|
|
55
|
+
case "REMOVE_SPACE":
|
|
56
|
+
z.RemoveSpaceInputSchema().parse(action.input);
|
|
57
|
+
SpacesReducer.removeSpaceOperation(state[action.scope], action, dispatch);
|
|
58
|
+
break;
|
|
59
|
+
case "ADD_PACKAGE":
|
|
60
|
+
z.AddPackageInputSchema().parse(action.input);
|
|
61
|
+
PackagesReducer.addPackageOperation(state[action.scope], action, dispatch);
|
|
62
|
+
break;
|
|
63
|
+
case "UPDATE_PACKAGE_INFO":
|
|
64
|
+
z.UpdatePackageInfoInputSchema().parse(action.input);
|
|
65
|
+
PackagesReducer.updatePackageInfoOperation(state[action.scope], action, dispatch);
|
|
66
|
+
break;
|
|
67
|
+
case "REMOVE_PACKAGE":
|
|
68
|
+
z.RemovePackageInputSchema().parse(action.input);
|
|
69
|
+
PackagesReducer.removePackageOperation(state[action.scope], action, dispatch);
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
return state;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
export const reducer = createReducer(stateReducer);
|
|
@@ -0,0 +1,247 @@
|
|
|
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 AddMemberInput = {
|
|
138
|
+
/** Add your inputs here */
|
|
139
|
+
id: Scalars["OID"]["input"];
|
|
140
|
+
};
|
|
141
|
+
export type AddPackageInput = {
|
|
142
|
+
/** Add your inputs here */
|
|
143
|
+
id: Scalars["OID"]["input"];
|
|
144
|
+
spaceId: Scalars["OID"]["input"];
|
|
145
|
+
};
|
|
146
|
+
export type AddSpaceInput = {
|
|
147
|
+
/** Add your inputs here */
|
|
148
|
+
id: Scalars["OID"]["input"];
|
|
149
|
+
};
|
|
150
|
+
export type BuilderTeamState = {
|
|
151
|
+
members: Array<RenownProfileInfo>;
|
|
152
|
+
profile: VetraBuilderProfile;
|
|
153
|
+
spaces: Array<VetraBuilderSpace>;
|
|
154
|
+
};
|
|
155
|
+
export type RemoveMemberInput = {
|
|
156
|
+
/** Add your inputs here */
|
|
157
|
+
id: Scalars["OID"]["input"];
|
|
158
|
+
};
|
|
159
|
+
export type RemovePackageInput = {
|
|
160
|
+
/** Add your inputs here */
|
|
161
|
+
id: Scalars["OID"]["input"];
|
|
162
|
+
};
|
|
163
|
+
export type RemoveSpaceInput = {
|
|
164
|
+
/** Add your inputs here */
|
|
165
|
+
id: Scalars["OID"]["input"];
|
|
166
|
+
};
|
|
167
|
+
export type RenownProfileInfo = {
|
|
168
|
+
ethAddress: Maybe<Scalars["String"]["output"]>;
|
|
169
|
+
id: Scalars["OID"]["output"];
|
|
170
|
+
name: Maybe<Scalars["String"]["output"]>;
|
|
171
|
+
phid: Maybe<Scalars["PHID"]["output"]>;
|
|
172
|
+
profileImage: Maybe<Scalars["String"]["output"]>;
|
|
173
|
+
};
|
|
174
|
+
export type SetDescriptionInput = {
|
|
175
|
+
/** Add your inputs here */
|
|
176
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
177
|
+
};
|
|
178
|
+
export type SetLogoInput = {
|
|
179
|
+
/** Add your inputs here */
|
|
180
|
+
logo?: InputMaybe<Scalars["String"]["input"]>;
|
|
181
|
+
};
|
|
182
|
+
export type SetSlugInput = {
|
|
183
|
+
/** Add your inputs here */
|
|
184
|
+
slug: Scalars["String"]["input"];
|
|
185
|
+
};
|
|
186
|
+
export type SetSocialsInput = {
|
|
187
|
+
github?: InputMaybe<Scalars["String"]["input"]>;
|
|
188
|
+
website?: InputMaybe<Scalars["String"]["input"]>;
|
|
189
|
+
/** Add your inputs here */
|
|
190
|
+
xProfile?: InputMaybe<Scalars["String"]["input"]>;
|
|
191
|
+
};
|
|
192
|
+
export type SetTeamNameInput = {
|
|
193
|
+
/** Add your inputs here */
|
|
194
|
+
name: Scalars["String"]["input"];
|
|
195
|
+
};
|
|
196
|
+
export type UpdateMemberInfoInput = {
|
|
197
|
+
ethAddress?: InputMaybe<Scalars["String"]["input"]>;
|
|
198
|
+
/** Add your inputs here */
|
|
199
|
+
id: Scalars["OID"]["input"];
|
|
200
|
+
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
201
|
+
phid?: InputMaybe<Scalars["PHID"]["input"]>;
|
|
202
|
+
profileImage?: InputMaybe<Scalars["String"]["input"]>;
|
|
203
|
+
};
|
|
204
|
+
export type UpdatePackageInfoInput = {
|
|
205
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
206
|
+
github?: InputMaybe<Scalars["String"]["input"]>;
|
|
207
|
+
/** Add your inputs here */
|
|
208
|
+
id: Scalars["OID"]["input"];
|
|
209
|
+
npm?: InputMaybe<Scalars["String"]["input"]>;
|
|
210
|
+
phid?: InputMaybe<Scalars["PHID"]["input"]>;
|
|
211
|
+
spaceId?: InputMaybe<Scalars["OID"]["input"]>;
|
|
212
|
+
title?: InputMaybe<Scalars["String"]["input"]>;
|
|
213
|
+
vetraDriveUrl?: InputMaybe<Scalars["URL"]["input"]>;
|
|
214
|
+
};
|
|
215
|
+
export type UpdateSpaceInfoInput = {
|
|
216
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
217
|
+
/** Add your inputs here */
|
|
218
|
+
id: Scalars["OID"]["input"];
|
|
219
|
+
title?: InputMaybe<Scalars["String"]["input"]>;
|
|
220
|
+
};
|
|
221
|
+
export type VetraBuilderProfile = {
|
|
222
|
+
description: Maybe<Scalars["String"]["output"]>;
|
|
223
|
+
logo: Maybe<Scalars["URL"]["output"]>;
|
|
224
|
+
name: Scalars["String"]["output"];
|
|
225
|
+
slug: Scalars["String"]["output"];
|
|
226
|
+
socials: VetraBuilderSocials;
|
|
227
|
+
};
|
|
228
|
+
export type VetraBuilderSocials = {
|
|
229
|
+
github: Maybe<Scalars["URL"]["output"]>;
|
|
230
|
+
website: Maybe<Scalars["URL"]["output"]>;
|
|
231
|
+
xProfile: Maybe<Scalars["URL"]["output"]>;
|
|
232
|
+
};
|
|
233
|
+
export type VetraBuilderSpace = {
|
|
234
|
+
description: Maybe<Scalars["String"]["output"]>;
|
|
235
|
+
id: Scalars["OID"]["output"];
|
|
236
|
+
packages: Array<VetraPackageInfo>;
|
|
237
|
+
title: Scalars["String"]["output"];
|
|
238
|
+
};
|
|
239
|
+
export type VetraPackageInfo = {
|
|
240
|
+
description: Maybe<Scalars["String"]["output"]>;
|
|
241
|
+
github: Maybe<Scalars["String"]["output"]>;
|
|
242
|
+
id: Scalars["OID"]["output"];
|
|
243
|
+
npm: Maybe<Scalars["String"]["output"]>;
|
|
244
|
+
phid: Maybe<Scalars["PHID"]["output"]>;
|
|
245
|
+
title: Maybe<Scalars["String"]["output"]>;
|
|
246
|
+
vetraDriveUrl: Maybe<Scalars["URL"]["output"]>;
|
|
247
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { AddMemberInput, AddPackageInput, AddSpaceInput, BuilderTeamState, RemoveMemberInput, RemovePackageInput, RemoveSpaceInput, RenownProfileInfo, SetDescriptionInput, SetLogoInput, SetSlugInput, SetSocialsInput, SetTeamNameInput, UpdateMemberInfoInput, UpdatePackageInfoInput, UpdateSpaceInfoInput, VetraBuilderProfile, VetraBuilderSocials, VetraBuilderSpace, VetraPackageInfo } 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 AddMemberInputSchema(): z.ZodObject<Properties<AddMemberInput>>;
|
|
10
|
+
export declare function AddPackageInputSchema(): z.ZodObject<Properties<AddPackageInput>>;
|
|
11
|
+
export declare function AddSpaceInputSchema(): z.ZodObject<Properties<AddSpaceInput>>;
|
|
12
|
+
export declare function BuilderTeamStateSchema(): z.ZodObject<Properties<BuilderTeamState>>;
|
|
13
|
+
export declare function RemoveMemberInputSchema(): z.ZodObject<Properties<RemoveMemberInput>>;
|
|
14
|
+
export declare function RemovePackageInputSchema(): z.ZodObject<Properties<RemovePackageInput>>;
|
|
15
|
+
export declare function RemoveSpaceInputSchema(): z.ZodObject<Properties<RemoveSpaceInput>>;
|
|
16
|
+
export declare function RenownProfileInfoSchema(): z.ZodObject<Properties<RenownProfileInfo>>;
|
|
17
|
+
export declare function SetDescriptionInputSchema(): z.ZodObject<Properties<SetDescriptionInput>>;
|
|
18
|
+
export declare function SetLogoInputSchema(): z.ZodObject<Properties<SetLogoInput>>;
|
|
19
|
+
export declare function SetSlugInputSchema(): z.ZodObject<Properties<SetSlugInput>>;
|
|
20
|
+
export declare function SetSocialsInputSchema(): z.ZodObject<Properties<SetSocialsInput>>;
|
|
21
|
+
export declare function SetTeamNameInputSchema(): z.ZodObject<Properties<SetTeamNameInput>>;
|
|
22
|
+
export declare function UpdateMemberInfoInputSchema(): z.ZodObject<Properties<UpdateMemberInfoInput>>;
|
|
23
|
+
export declare function UpdatePackageInfoInputSchema(): z.ZodObject<Properties<UpdatePackageInfoInput>>;
|
|
24
|
+
export declare function UpdateSpaceInfoInputSchema(): z.ZodObject<Properties<UpdateSpaceInfoInput>>;
|
|
25
|
+
export declare function VetraBuilderProfileSchema(): z.ZodObject<Properties<VetraBuilderProfile>>;
|
|
26
|
+
export declare function VetraBuilderSocialsSchema(): z.ZodObject<Properties<VetraBuilderSocials>>;
|
|
27
|
+
export declare function VetraBuilderSpaceSchema(): z.ZodObject<Properties<VetraBuilderSpace>>;
|
|
28
|
+
export declare function VetraPackageInfoSchema(): z.ZodObject<Properties<VetraPackageInfo>>;
|
|
29
|
+
export {};
|