@powerhousedao/contributor-billing 0.1.10 → 0.1.12
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/editors/contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.js +2 -1
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts +1 -2
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.js +1 -0
- package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.js +34 -6
- package/dist/editors/invoice/invoiceToGnosis.js +1 -1
- package/dist/editors/invoice/requestFinance.js +1 -1
- package/dist/editors/invoice/uploadPdfChunked.js +1 -1
- package/dist/reducers/general.d.ts +8 -0
- package/dist/reducers/general.d.ts.map +1 -0
- package/dist/reducers/general.js +73 -0
- package/dist/reducers/items.d.ts +8 -0
- package/dist/reducers/items.d.ts.map +1 -0
- package/dist/reducers/items.js +195 -0
- package/dist/reducers/parties.d.ts +8 -0
- package/dist/reducers/parties.d.ts.map +1 -0
- package/dist/reducers/parties.js +266 -0
- package/dist/reducers/transitions.d.ts +8 -0
- package/dist/reducers/transitions.d.ts.map +1 -0
- package/dist/reducers/transitions.js +162 -0
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts +4 -0
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -0
- package/dist/scripts/invoice/pdfToClaudeAI.js +339 -0
- package/dist/style.css +26 -65
- package/dist/subgraphs/invoice/customResolvers.d.ts +18 -6
- package/dist/subgraphs/invoice/customResolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/customResolvers.js +30 -9
- package/package.json +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customResolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/customResolvers.ts"],"names":[],"mappings":"AAOA,QAAA,IAAI,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,GAAG,CAAC;IACpB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"customResolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/invoice/customResolvers.ts"],"names":[],"mappings":"AAOA,QAAA,IAAI,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,GAAG,CAAC;IACpB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAM,CAAC;AAKR,UAAU,yBAAyB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACrB;AAaD,eAAO,MAAM,4BAA4B,GAAU,GAAG,GAAG,EAAE,MAAM,GAAG;;;;;;;;EA8CnE,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAAU,GAAG,GAAG,EAAE,MAAM,GAAG;;;;;;;;;;;EAkC1E,CAAA;AAED,eAAO,MAAM,6BAA6B,GAAU,GAAG,GAAG,EAAE,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;EA8E1F,CAAA;AAGD,eAAO,MAAM,UAAU,GAAI,iBAAiB,GAAG,SAE9C,CAAC;AAGF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAG/B,eAAO,MAAM,6BAA6B,YAyBzC,CAAA;AAwCD,eAAO,MAAM,aAAa,GAAU,KAAK,GAAG,EAAE,KAAK,GAAG,iBAkJrD,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { executeTransferProposal } from "../../scripts/invoice/gnosisTransactionBuilder.js";
|
|
2
2
|
import { requestDirectPayment } from "../../scripts/invoice/requestFinance.js";
|
|
3
3
|
import { actions } from "../../document-models/invoice/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { uploadPdfAndGetJsonClaude } from "../../scripts/invoice/pdfToClaudeAI.js";
|
|
5
5
|
import * as crypto from "crypto";
|
|
6
6
|
// Store pending transactions for webhook matching
|
|
7
7
|
let pendingTransactions = {};
|
|
@@ -104,14 +104,35 @@ export const Invoice_uploadInvoicePdfChunk = async (_, args) => {
|
|
|
104
104
|
if (fileData.receivedChunks === totalChunks) {
|
|
105
105
|
// Combine all chunks
|
|
106
106
|
const completeFile = fileData.chunks.join('');
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
console.log("Processing PDF with Claude Haiku 4.5...");
|
|
108
|
+
const startTime = Date.now();
|
|
109
|
+
try {
|
|
110
|
+
const claudeResult = await uploadPdfAndGetJsonClaude(completeFile);
|
|
111
|
+
const processingTime = Date.now() - startTime;
|
|
112
|
+
console.log(`PDF processing completed in ${processingTime}ms`);
|
|
113
|
+
const responseData = {
|
|
114
|
+
invoiceData: claudeResult.invoiceData,
|
|
115
|
+
processingMetadata: {
|
|
116
|
+
provider: 'claude-haiku-4.5',
|
|
117
|
+
processingTimeMs: processingTime,
|
|
118
|
+
processingTimestamp: new Date().toISOString()
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
// Clean up
|
|
122
|
+
fileChunksMap.delete(fileKey);
|
|
123
|
+
return {
|
|
124
|
+
success: true,
|
|
125
|
+
data: responseData
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.error("Error in PDF processing:", error);
|
|
130
|
+
fileChunksMap.delete(fileKey);
|
|
131
|
+
return {
|
|
132
|
+
success: false,
|
|
133
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
134
|
+
};
|
|
135
|
+
}
|
|
115
136
|
}
|
|
116
137
|
// If not all chunks received yet, just acknowledge receipt
|
|
117
138
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/contributor-billing",
|
|
3
3
|
"description": "Document models that help contributors of open organisations get paid anonymously for their work on a monthly basis.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.12",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"service-unstartup": "bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@google-cloud/documentai": "^8.12.0",
|
|
60
59
|
"@powerhousedao/builder-tools": "^5.0.0-staging.30",
|
|
61
60
|
"@powerhousedao/common": "^5.0.0-staging.30",
|
|
62
61
|
"@powerhousedao/design-system": "^5.0.0-staging.30",
|