@powerhousedao/network-admin 0.0.41 → 0.0.42

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.
Files changed (52) hide show
  1. package/dist/scripts/sow-mirror/mirror_sow_state.d.ts +3 -0
  2. package/dist/scripts/sow-mirror/mirror_sow_state.d.ts.map +1 -0
  3. package/dist/scripts/sow-mirror/mirror_sow_state.js +441 -0
  4. package/dist/subgraphs/index.d.ts +5 -0
  5. package/dist/subgraphs/index.d.ts.map +1 -1
  6. package/dist/subgraphs/index.js +5 -0
  7. package/dist/subgraphs/networks/index.d.ts +11 -0
  8. package/dist/subgraphs/networks/index.d.ts.map +1 -0
  9. package/dist/subgraphs/networks/index.js +11 -0
  10. package/dist/subgraphs/networks/resolvers.d.ts +3 -0
  11. package/dist/subgraphs/networks/resolvers.d.ts.map +1 -0
  12. package/dist/subgraphs/networks/resolvers.js +42 -0
  13. package/dist/subgraphs/networks/schema.d.ts +3 -0
  14. package/dist/subgraphs/networks/schema.d.ts.map +1 -0
  15. package/dist/subgraphs/networks/schema.js +39 -0
  16. package/dist/subgraphs/payment-terms/index.d.ts +11 -0
  17. package/dist/subgraphs/payment-terms/index.d.ts.map +1 -0
  18. package/dist/subgraphs/payment-terms/index.js +11 -0
  19. package/dist/subgraphs/payment-terms/resolvers.d.ts +3 -0
  20. package/dist/subgraphs/payment-terms/resolvers.d.ts.map +1 -0
  21. package/dist/subgraphs/payment-terms/resolvers.js +277 -0
  22. package/dist/subgraphs/payment-terms/schema.d.ts +3 -0
  23. package/dist/subgraphs/payment-terms/schema.d.ts.map +1 -0
  24. package/dist/subgraphs/payment-terms/schema.js +324 -0
  25. package/dist/subgraphs/request-for-proposals/index.d.ts +11 -0
  26. package/dist/subgraphs/request-for-proposals/index.d.ts.map +1 -0
  27. package/dist/subgraphs/request-for-proposals/index.js +11 -0
  28. package/dist/subgraphs/request-for-proposals/resolvers.d.ts +3 -0
  29. package/dist/subgraphs/request-for-proposals/resolvers.d.ts.map +1 -0
  30. package/dist/subgraphs/request-for-proposals/resolvers.js +145 -0
  31. package/dist/subgraphs/request-for-proposals/schema.d.ts +3 -0
  32. package/dist/subgraphs/request-for-proposals/schema.d.ts.map +1 -0
  33. package/dist/subgraphs/request-for-proposals/schema.js +232 -0
  34. package/dist/subgraphs/workstream/index.d.ts +11 -0
  35. package/dist/subgraphs/workstream/index.d.ts.map +1 -0
  36. package/dist/subgraphs/workstream/index.js +11 -0
  37. package/dist/subgraphs/workstream/resolvers.d.ts +3 -0
  38. package/dist/subgraphs/workstream/resolvers.d.ts.map +1 -0
  39. package/dist/subgraphs/workstream/resolvers.js +181 -0
  40. package/dist/subgraphs/workstream/schema.d.ts +3 -0
  41. package/dist/subgraphs/workstream/schema.d.ts.map +1 -0
  42. package/dist/subgraphs/workstream/schema.js +206 -0
  43. package/dist/subgraphs/workstreams/index.d.ts +11 -0
  44. package/dist/subgraphs/workstreams/index.d.ts.map +1 -0
  45. package/dist/subgraphs/workstreams/index.js +11 -0
  46. package/dist/subgraphs/workstreams/resolvers.d.ts +3 -0
  47. package/dist/subgraphs/workstreams/resolvers.d.ts.map +1 -0
  48. package/dist/subgraphs/workstreams/resolvers.js +380 -0
  49. package/dist/subgraphs/workstreams/schema.d.ts +3 -0
  50. package/dist/subgraphs/workstreams/schema.d.ts.map +1 -0
  51. package/dist/subgraphs/workstreams/schema.js +326 -0
  52. package/package.json +1 -1
@@ -0,0 +1,145 @@
1
+ import {} from "@powerhousedao/reactor-api";
2
+ import { addFile } from "document-drive";
3
+ import { actions, } from "../../document-models/request-for-proposals/index.js";
4
+ import { setName } from "document-model";
5
+ export const getResolvers = (subgraph) => {
6
+ const reactor = subgraph.reactor;
7
+ return {
8
+ Query: {
9
+ RequestForProposals: async () => {
10
+ return {
11
+ getDocument: async (args) => {
12
+ const { docId, driveId } = args;
13
+ if (!docId) {
14
+ throw new Error("Document id is required");
15
+ }
16
+ if (driveId) {
17
+ const docIds = await reactor.getDocuments(driveId);
18
+ if (!docIds.includes(docId)) {
19
+ throw new Error(`Document with id ${docId} is not part of ${driveId}`);
20
+ }
21
+ }
22
+ const doc = await reactor.getDocument(docId);
23
+ return {
24
+ driveId: driveId,
25
+ ...doc,
26
+ ...doc.header,
27
+ created: doc.header.createdAtUtcIso,
28
+ lastModified: doc.header.lastModifiedAtUtcIso,
29
+ state: doc.state.global,
30
+ stateJSON: doc.state.global,
31
+ revision: doc.header?.revision?.global ?? 0,
32
+ };
33
+ },
34
+ getDocuments: async (args) => {
35
+ const { driveId } = args;
36
+ const docsIds = await reactor.getDocuments(driveId);
37
+ const docs = await Promise.all(docsIds.map(async (docId) => {
38
+ const doc = await reactor.getDocument(docId);
39
+ return {
40
+ driveId: driveId,
41
+ ...doc,
42
+ ...doc.header,
43
+ created: doc.header.createdAtUtcIso,
44
+ lastModified: doc.header.lastModifiedAtUtcIso,
45
+ state: doc.state.global,
46
+ stateJSON: doc.state.global,
47
+ revision: doc.header?.revision?.global ?? 0,
48
+ };
49
+ }));
50
+ return docs.filter((doc) => doc.header.documentType === "powerhouse/rfp");
51
+ },
52
+ };
53
+ },
54
+ },
55
+ Mutation: {
56
+ RequestForProposals_createDocument: async (_, args) => {
57
+ const { driveId, name } = args;
58
+ const document = await reactor.addDocument("powerhouse/rfp");
59
+ if (driveId) {
60
+ await reactor.addAction(driveId, addFile({
61
+ name,
62
+ id: document.header.id,
63
+ documentType: "powerhouse/rfp",
64
+ }));
65
+ }
66
+ if (name) {
67
+ await reactor.addAction(document.header.id, setName(name));
68
+ }
69
+ return document.header.id;
70
+ },
71
+ RequestForProposals_editRfp: async (_, args) => {
72
+ const { docId, input } = args;
73
+ const doc = await reactor.getDocument(docId);
74
+ if (!doc) {
75
+ throw new Error("Document not found");
76
+ }
77
+ const result = await reactor.addAction(docId, actions.editRfp(input));
78
+ if (result.status !== "SUCCESS") {
79
+ throw new Error(result.error?.message ?? "Failed to editRfp");
80
+ }
81
+ return true;
82
+ },
83
+ RequestForProposals_addContextDocument: async (_, args) => {
84
+ const { docId, input } = args;
85
+ const doc = await reactor.getDocument(docId);
86
+ if (!doc) {
87
+ throw new Error("Document not found");
88
+ }
89
+ const result = await reactor.addAction(docId, actions.addContextDocument(input));
90
+ if (result.status !== "SUCCESS") {
91
+ throw new Error(result.error?.message ?? "Failed to addContextDocument");
92
+ }
93
+ return true;
94
+ },
95
+ RequestForProposals_removeContextDocument: async (_, args) => {
96
+ const { docId, input } = args;
97
+ const doc = await reactor.getDocument(docId);
98
+ if (!doc) {
99
+ throw new Error("Document not found");
100
+ }
101
+ const result = await reactor.addAction(docId, actions.removeContextDocument(input));
102
+ if (result.status !== "SUCCESS") {
103
+ throw new Error(result.error?.message ?? "Failed to removeContextDocument");
104
+ }
105
+ return true;
106
+ },
107
+ RequestForProposals_addProposal: async (_, args) => {
108
+ const { docId, input } = args;
109
+ const doc = await reactor.getDocument(docId);
110
+ if (!doc) {
111
+ throw new Error("Document not found");
112
+ }
113
+ const result = await reactor.addAction(docId, actions.addProposal(input));
114
+ if (result.status !== "SUCCESS") {
115
+ throw new Error(result.error?.message ?? "Failed to addProposal");
116
+ }
117
+ return true;
118
+ },
119
+ RequestForProposals_changeProposalStatus: async (_, args) => {
120
+ const { docId, input } = args;
121
+ const doc = await reactor.getDocument(docId);
122
+ if (!doc) {
123
+ throw new Error("Document not found");
124
+ }
125
+ const result = await reactor.addAction(docId, actions.changeProposalStatus(input));
126
+ if (result.status !== "SUCCESS") {
127
+ throw new Error(result.error?.message ?? "Failed to changeProposalStatus");
128
+ }
129
+ return true;
130
+ },
131
+ RequestForProposals_removeProposal: async (_, args) => {
132
+ const { docId, input } = args;
133
+ const doc = await reactor.getDocument(docId);
134
+ if (!doc) {
135
+ throw new Error("Document not found");
136
+ }
137
+ const result = await reactor.addAction(docId, actions.removeProposal(input));
138
+ if (result.status !== "SUCCESS") {
139
+ throw new Error(result.error?.message ?? "Failed to removeProposal");
140
+ }
141
+ return true;
142
+ },
143
+ },
144
+ };
145
+ };
@@ -0,0 +1,3 @@
1
+ import type { DocumentNode } from "graphql";
2
+ export declare const schema: DocumentNode;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/request-for-proposals/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAsOpB,CAAC"}
@@ -0,0 +1,232 @@
1
+ import { gql } from "graphql-tag";
2
+ export const schema = gql `
3
+ """
4
+ Subgraph definition for RequestForProposals (powerhouse/rfp)
5
+ """
6
+ type RequestForProposalsState {
7
+ issuer: ID!
8
+ code: String
9
+ title: String!
10
+ summary: String! # udpated
11
+ briefing: String! # updated
12
+ rfpCommenter: [RfpCommenter!]!
13
+ eligibilityCriteria: String!
14
+ evaluationCriteria: String!
15
+ budgetRange: BudgetRange!
16
+ contextDocuments: [ContextDocument!]!
17
+ status: RFPStatus!
18
+ proposals: [RfpProposal!]!
19
+ deadline: DateTime
20
+ tags: [String!]
21
+ }
22
+
23
+ type RfpCommenter {
24
+ id: ID!
25
+ rfpCommentatorType: RFPCommentatorType!
26
+ agentType: RfpAgentType!
27
+ name: String!
28
+ code: String!
29
+ imageUrl: String
30
+ }
31
+
32
+ enum RFPCommentatorType {
33
+ INTERNAL # client team
34
+ EXTERNAL # outsourced (if RGH asks BAI team)
35
+ }
36
+
37
+ enum RfpAgentType {
38
+ HUMAN
39
+ GROUP
40
+ AI
41
+ }
42
+
43
+ type BudgetRange {
44
+ min: Float
45
+ max: Float
46
+ currency: String
47
+ }
48
+
49
+ type ContextDocument {
50
+ name: String!
51
+ url: URL!
52
+ }
53
+
54
+ enum RFPStatus {
55
+ DRAFT
56
+ REQUEST_FOR_COMMMENTS
57
+ CANCELED
58
+ OPEN_FOR_PROPOSALS
59
+ AWARDED
60
+ NOT_AWARDED
61
+ CLOSED
62
+ }
63
+
64
+ type RfpProposal {
65
+ id: OID!
66
+ title: String!
67
+ summary: String!
68
+ proposalStatus: RfpProposalStatus!
69
+ submittedby: OID
70
+ budgetEstimate: String! # a rolled-up total from the payment terms
71
+ paymentTerms: RfpPaymentTerm!
72
+ }
73
+
74
+ enum RfpPaymentTerm {
75
+ MILESTONE_BASED_FIXED_PRICE
76
+ MILESTONE_BASED_ADVANCE_PAYMENT
77
+ RETAINER_BASED
78
+ VARIABLE_COST
79
+ ESCROW
80
+ }
81
+
82
+ enum RfpProposalStatus {
83
+ SUBMITTED # or received from an RFP issuer POV
84
+ OPENED
85
+ UNDER_REVIEW
86
+ NEEDS_REVISION
87
+ REVISED
88
+ APPROVED
89
+ CONDITIONALLY_APPROVED #
90
+ REJECTED
91
+ WITHDRAWN
92
+ }
93
+
94
+ """
95
+ Queries: RequestForProposals
96
+ """
97
+ type RequestForProposalsQueries {
98
+ getDocument(docId: PHID!, driveId: PHID): RequestForProposals
99
+ getDocuments(driveId: String!): [RequestForProposals!]
100
+ }
101
+
102
+ type Query {
103
+ RequestForProposals: RequestForProposalsQueries
104
+ }
105
+
106
+ """
107
+ Mutations: RequestForProposals
108
+ """
109
+ type Mutation {
110
+ RequestForProposals_createDocument(name: String!, driveId: String): String
111
+
112
+ RequestForProposals_editRfp(
113
+ driveId: String
114
+ docId: PHID
115
+ input: RequestForProposals_EditRfpInput
116
+ ): Int
117
+ RequestForProposals_addContextDocument(
118
+ driveId: String
119
+ docId: PHID
120
+ input: RequestForProposals_AddContextDocumentInput
121
+ ): Int
122
+ RequestForProposals_removeContextDocument(
123
+ driveId: String
124
+ docId: PHID
125
+ input: RequestForProposals_RemoveContextDocumentInput
126
+ ): Int
127
+ RequestForProposals_addProposal(
128
+ driveId: String
129
+ docId: PHID
130
+ input: RequestForProposals_AddProposalInput
131
+ ): Int
132
+ RequestForProposals_changeProposalStatus(
133
+ driveId: String
134
+ docId: PHID
135
+ input: RequestForProposals_ChangeProposalStatusInput
136
+ ): Int
137
+ RequestForProposals_removeProposal(
138
+ driveId: String
139
+ docId: PHID
140
+ input: RequestForProposals_RemoveProposalInput
141
+ ): Int
142
+ }
143
+
144
+ """
145
+ Module: RfpState
146
+ """
147
+ input RequestForProposals_EditRfpInput {
148
+ title: String
149
+ code: String
150
+ summary: String
151
+ briefing: String
152
+ eligibilityCriteria: String
153
+ evaluationCriteria: String
154
+ budgetRange: BudgetRangeInput
155
+ status: RFPStatusInput
156
+ deadline: DateTime
157
+ tags: [String!]
158
+ }
159
+
160
+ input BudgetRangeInput {
161
+ min: Float
162
+ max: Float
163
+ currency: String
164
+ }
165
+
166
+ enum RFPStatusInput {
167
+ DRAFT
168
+ REQUEST_FOR_COMMMENTS
169
+ CANCELED
170
+ OPEN_FOR_PROPOSALS
171
+ AWARDED
172
+ NOT_AWARDED
173
+ CLOSED
174
+ }
175
+
176
+ """
177
+ Module: ContexDocument
178
+ """
179
+ input RequestForProposals_AddContextDocumentInput {
180
+ rfpId: OID!
181
+ name: String!
182
+ url: URL!
183
+ }
184
+ input RequestForProposals_RemoveContextDocumentInput {
185
+ rfpId: OID!
186
+ name: String!
187
+ }
188
+
189
+ """
190
+ Module: Proposals
191
+ """
192
+ input RequestForProposals_AddProposalInput {
193
+ rfpId: OID!
194
+ id: OID!
195
+ title: String!
196
+ summary: String!
197
+ proposalStatus: RfpProposalStatusInput!
198
+ submittedby: OID
199
+ budgetEstimate: String!
200
+ paymentTerms: RfpPaymentTermInput!
201
+ }
202
+
203
+ enum RfpPaymentTermInput {
204
+ MILESTONE_BASED_FIXED_PRICE
205
+ MILESTONE_BASED_ADVANCE_PAYMENT
206
+ RETAINER_BASED
207
+ VARIABLE_COST
208
+ ESCROW
209
+ }
210
+
211
+ enum RfpProposalStatusInput {
212
+ SUBMITTED # or received from an RFP issuer POV
213
+ OPENED
214
+ UNDER_REVIEW
215
+ NEEDS_REVISION
216
+ REVISED
217
+ APPROVED
218
+ CONDITIONALLY_APPROVED #
219
+ REJECTED
220
+ WITHDRAWN
221
+ }
222
+
223
+ input RequestForProposals_ChangeProposalStatusInput {
224
+ proposalId: OID!
225
+ status: RfpProposalStatusInput!
226
+ }
227
+
228
+ input RequestForProposals_RemoveProposalInput {
229
+ rfpId: OID!
230
+ id: OID!
231
+ }
232
+ `;
@@ -0,0 +1,11 @@
1
+ import { BaseSubgraph } from "@powerhousedao/reactor-api";
2
+ import type { DocumentNode } from "graphql";
3
+ export declare class WorkstreamSubgraph extends BaseSubgraph {
4
+ name: string;
5
+ typeDefs: DocumentNode;
6
+ resolvers: Record<string, unknown>;
7
+ additionalContextFields: {};
8
+ onSetup(): Promise<void>;
9
+ onDisconnect(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/workstream/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,kBAAmB,SAAQ,YAAY;IAClD,IAAI,SAAgB;IACpB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -0,0 +1,11 @@
1
+ import { BaseSubgraph } from "@powerhousedao/reactor-api";
2
+ import { schema } from "./schema.js";
3
+ import { getResolvers } from "./resolvers.js";
4
+ export class WorkstreamSubgraph extends BaseSubgraph {
5
+ name = "workstream";
6
+ typeDefs = schema;
7
+ resolvers = getResolvers(this);
8
+ additionalContextFields = {};
9
+ async onSetup() { }
10
+ async onDisconnect() { }
11
+ }
@@ -0,0 +1,3 @@
1
+ import { type ISubgraph } from "@powerhousedao/reactor-api";
2
+ export declare const getResolvers: (subgraph: ISubgraph) => Record<string, unknown>;
3
+ //# sourceMappingURL=resolvers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/workstream/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAiB5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA6SxE,CAAC"}
@@ -0,0 +1,181 @@
1
+ import {} from "@powerhousedao/reactor-api";
2
+ import { addFile } from "document-drive";
3
+ import { actions, } from "../../document-models/workstream/index.js";
4
+ import { setName } from "document-model";
5
+ export const getResolvers = (subgraph) => {
6
+ const reactor = subgraph.reactor;
7
+ return {
8
+ Query: {
9
+ Workstream: async () => {
10
+ return {
11
+ getDocument: async (args) => {
12
+ const { docId, driveId } = args;
13
+ if (!docId) {
14
+ throw new Error("Document id is required");
15
+ }
16
+ if (driveId) {
17
+ const docIds = await reactor.getDocuments(driveId);
18
+ if (!docIds.includes(docId)) {
19
+ throw new Error(`Document with id ${docId} is not part of ${driveId}`);
20
+ }
21
+ }
22
+ const doc = await reactor.getDocument(docId);
23
+ return {
24
+ driveId: driveId,
25
+ ...doc,
26
+ ...doc.header,
27
+ created: doc.header.createdAtUtcIso,
28
+ lastModified: doc.header.lastModifiedAtUtcIso,
29
+ state: doc.state.global,
30
+ stateJSON: doc.state.global,
31
+ revision: doc.header?.revision?.global ?? 0,
32
+ };
33
+ },
34
+ getDocuments: async (args) => {
35
+ const { driveId } = args;
36
+ const docsIds = await reactor.getDocuments(driveId);
37
+ const docs = await Promise.all(docsIds.map(async (docId) => {
38
+ const doc = await reactor.getDocument(docId);
39
+ return {
40
+ driveId: driveId,
41
+ ...doc,
42
+ ...doc.header,
43
+ created: doc.header.createdAtUtcIso,
44
+ lastModified: doc.header.lastModifiedAtUtcIso,
45
+ state: doc.state.global,
46
+ stateJSON: doc.state.global,
47
+ revision: doc.header?.revision?.global ?? 0,
48
+ };
49
+ }));
50
+ return docs.filter((doc) => doc.header.documentType === "powerhouse/workstream");
51
+ },
52
+ };
53
+ },
54
+ },
55
+ Mutation: {
56
+ Workstream_createDocument: async (_, args) => {
57
+ const { driveId, name } = args;
58
+ const document = await reactor.addDocument("powerhouse/workstream");
59
+ if (driveId) {
60
+ await reactor.addAction(driveId, addFile({
61
+ name,
62
+ id: document.header.id,
63
+ documentType: "powerhouse/workstream",
64
+ }));
65
+ }
66
+ if (name) {
67
+ await reactor.addAction(document.header.id, setName(name));
68
+ }
69
+ return document.header.id;
70
+ },
71
+ Workstream_editWorkstream: async (_, args) => {
72
+ const { docId, input } = args;
73
+ const doc = await reactor.getDocument(docId);
74
+ if (!doc) {
75
+ throw new Error("Document not found");
76
+ }
77
+ const result = await reactor.addAction(docId, actions.editWorkstream(input));
78
+ if (result.status !== "SUCCESS") {
79
+ throw new Error(result.error?.message ?? "Failed to editWorkstream");
80
+ }
81
+ return true;
82
+ },
83
+ Workstream_editClientInfo: async (_, args) => {
84
+ const { docId, input } = args;
85
+ const doc = await reactor.getDocument(docId);
86
+ if (!doc) {
87
+ throw new Error("Document not found");
88
+ }
89
+ const result = await reactor.addAction(docId, actions.editClientInfo(input));
90
+ if (result.status !== "SUCCESS") {
91
+ throw new Error(result.error?.message ?? "Failed to editClientInfo");
92
+ }
93
+ return true;
94
+ },
95
+ Workstream_setRequestForProposal: async (_, args) => {
96
+ const { docId, input } = args;
97
+ const doc = await reactor.getDocument(docId);
98
+ if (!doc) {
99
+ throw new Error("Document not found");
100
+ }
101
+ const result = await reactor.addAction(docId, actions.setRequestForProposal(input));
102
+ if (result.status !== "SUCCESS") {
103
+ throw new Error(result.error?.message ?? "Failed to setRequestForProposal");
104
+ }
105
+ return true;
106
+ },
107
+ Workstream_addPaymentRequest: async (_, args) => {
108
+ const { docId, input } = args;
109
+ const doc = await reactor.getDocument(docId);
110
+ if (!doc) {
111
+ throw new Error("Document not found");
112
+ }
113
+ const result = await reactor.addAction(docId, actions.addPaymentRequest(input));
114
+ if (result.status !== "SUCCESS") {
115
+ throw new Error(result.error?.message ?? "Failed to addPaymentRequest");
116
+ }
117
+ return true;
118
+ },
119
+ Workstream_removePaymentRequest: async (_, args) => {
120
+ const { docId, input } = args;
121
+ const doc = await reactor.getDocument(docId);
122
+ if (!doc) {
123
+ throw new Error("Document not found");
124
+ }
125
+ const result = await reactor.addAction(docId, actions.removePaymentRequest(input));
126
+ if (result.status !== "SUCCESS") {
127
+ throw new Error(result.error?.message ?? "Failed to removePaymentRequest");
128
+ }
129
+ return true;
130
+ },
131
+ Workstream_editInitialProposal: async (_, args) => {
132
+ const { docId, input } = args;
133
+ const doc = await reactor.getDocument(docId);
134
+ if (!doc) {
135
+ throw new Error("Document not found");
136
+ }
137
+ const result = await reactor.addAction(docId, actions.editInitialProposal(input));
138
+ if (result.status !== "SUCCESS") {
139
+ throw new Error(result.error?.message ?? "Failed to editInitialProposal");
140
+ }
141
+ return true;
142
+ },
143
+ Workstream_addAlternativeProposal: async (_, args) => {
144
+ const { docId, input } = args;
145
+ const doc = await reactor.getDocument(docId);
146
+ if (!doc) {
147
+ throw new Error("Document not found");
148
+ }
149
+ const result = await reactor.addAction(docId, actions.addAlternativeProposal(input));
150
+ if (result.status !== "SUCCESS") {
151
+ throw new Error(result.error?.message ?? "Failed to addAlternativeProposal");
152
+ }
153
+ return true;
154
+ },
155
+ Workstream_editAlternativeProposal: async (_, args) => {
156
+ const { docId, input } = args;
157
+ const doc = await reactor.getDocument(docId);
158
+ if (!doc) {
159
+ throw new Error("Document not found");
160
+ }
161
+ const result = await reactor.addAction(docId, actions.editAlternativeProposal(input));
162
+ if (result.status !== "SUCCESS") {
163
+ throw new Error(result.error?.message ?? "Failed to editAlternativeProposal");
164
+ }
165
+ return true;
166
+ },
167
+ Workstream_removeAlternativeProposal: async (_, args) => {
168
+ const { docId, input } = args;
169
+ const doc = await reactor.getDocument(docId);
170
+ if (!doc) {
171
+ throw new Error("Document not found");
172
+ }
173
+ const result = await reactor.addAction(docId, actions.removeAlternativeProposal(input));
174
+ if (result.status !== "SUCCESS") {
175
+ throw new Error(result.error?.message ?? "Failed to removeAlternativeProposal");
176
+ }
177
+ return true;
178
+ },
179
+ },
180
+ };
181
+ };
@@ -0,0 +1,3 @@
1
+ import type { DocumentNode } from "graphql";
2
+ export declare const schema: DocumentNode;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/workstream/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA4MpB,CAAC"}