@powerhousedao/contributor-billing 0.0.88 → 0.0.90
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 +8 -4
- package/dist/editors/contributor-billing/util.d.ts +2 -1
- package/dist/editors/contributor-billing/util.d.ts.map +1 -1
- package/dist/editors/contributor-billing/util.js +45 -16
- package/dist/editors/invoice/ingestPDF.js +1 -1
- 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/migrate-zip.d.ts +2 -0
- package/dist/migrate-zip.d.ts.map +1 -0
- package/dist/migrate-zip.js +56 -0
- package/dist/processors/index.d.ts +6 -1
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +18 -1
- package/dist/processors/line-item-processor/index.d.ts +11 -0
- package/dist/processors/line-item-processor/index.d.ts.map +1 -0
- package/dist/processors/line-item-processor/index.js +35 -0
- package/dist/style.css +119 -0
- package/package.json +13 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderStats.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/HeaderStats.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"HeaderStats.d.ts","sourceRoot":"","sources":["../../../../../editors/contributor-billing/components/InvoiceTable/HeaderStats.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,WAAW,+CAoHvB,CAAC"}
|
|
@@ -30,20 +30,24 @@ export const HeaderStats = () => {
|
|
|
30
30
|
for (const doc of invoices) {
|
|
31
31
|
const invoice = doc;
|
|
32
32
|
const invoiceAmount = invoice.state.global.totalPriceTaxIncl;
|
|
33
|
-
let invoiceCurrency = invoice.state.global.currency;
|
|
33
|
+
let invoiceCurrency = invoice.state.global.currency || 'USD'; // Fallback to USD if currency is empty
|
|
34
34
|
let selectCurrency = selectedCurrency;
|
|
35
35
|
if (invoiceCurrency === selectedCurrency) {
|
|
36
36
|
total += invoiceAmount;
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
39
|
try {
|
|
40
|
+
// Only convert crypto currencies to USD for the API call
|
|
41
|
+
let fromCurrency = invoiceCurrency;
|
|
42
|
+
let toCurrency = selectedCurrency;
|
|
43
|
+
// Convert crypto to USD for API compatibility
|
|
40
44
|
if (invoiceCurrency === "DAI" || invoiceCurrency === "USDS") {
|
|
41
|
-
|
|
45
|
+
fromCurrency = "USD";
|
|
42
46
|
}
|
|
43
47
|
if (selectedCurrency === "DAI" || selectedCurrency === "USDS") {
|
|
44
|
-
|
|
48
|
+
toCurrency = "USD";
|
|
45
49
|
}
|
|
46
|
-
const exchangeRate = await getExchangeRate(
|
|
50
|
+
const exchangeRate = await getExchangeRate(fromCurrency, toCurrency, invoiceAmount);
|
|
47
51
|
total += invoiceAmount * exchangeRate;
|
|
48
52
|
}
|
|
49
53
|
catch (error) {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Supports both fiat and crypto currencies.
|
|
4
4
|
* @param fromCurrency - The currency code to convert from (e.g., 'USD', 'DAI').
|
|
5
5
|
* @param toCurrency - The currency code to convert to (e.g., 'EUR', 'USDS').
|
|
6
|
+
* @param amount - The amount to convert (optional, used for validation).
|
|
6
7
|
* @returns The exchange rate from fromCurrency to toCurrency.
|
|
7
8
|
*/
|
|
8
|
-
export declare const getExchangeRate: (fromCurrency: string, toCurrency: string) => Promise<number>;
|
|
9
|
+
export declare const getExchangeRate: (fromCurrency: string, toCurrency: string, amount?: number) => Promise<number>;
|
|
9
10
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../editors/contributor-billing/util.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAU,cAAc,MAAM,EAAE,YAAY,MAAM,EAAE,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,CAoH/G,CAAC"}
|
|
@@ -1,35 +1,58 @@
|
|
|
1
1
|
// Cache for exchange rates to avoid repeated API calls
|
|
2
2
|
const exchangeRateCache = {};
|
|
3
|
+
/**
|
|
4
|
+
* Validates if an amount should trigger an exchange rate fetch
|
|
5
|
+
* @param amount - The amount to validate
|
|
6
|
+
* @returns true if the amount is valid and should trigger API calls
|
|
7
|
+
*/
|
|
8
|
+
const isValidAmount = (amount) => {
|
|
9
|
+
return amount !== undefined && amount !== null && !isNaN(amount) && amount > 0;
|
|
10
|
+
};
|
|
3
11
|
/**
|
|
4
12
|
* Fetches the exchange rate between two currencies using ExchangeRate-API.
|
|
5
13
|
* Supports both fiat and crypto currencies.
|
|
6
14
|
* @param fromCurrency - The currency code to convert from (e.g., 'USD', 'DAI').
|
|
7
15
|
* @param toCurrency - The currency code to convert to (e.g., 'EUR', 'USDS').
|
|
16
|
+
* @param amount - The amount to convert (optional, used for validation).
|
|
8
17
|
* @returns The exchange rate from fromCurrency to toCurrency.
|
|
9
18
|
*/
|
|
10
|
-
export const getExchangeRate = async (fromCurrency, toCurrency) => {
|
|
19
|
+
export const getExchangeRate = async (fromCurrency, toCurrency, amount) => {
|
|
20
|
+
// Normalize inputs
|
|
21
|
+
const base = (fromCurrency || '').trim().toUpperCase();
|
|
22
|
+
const quote = (toCurrency || '').trim().toUpperCase();
|
|
23
|
+
// Guard empty currencies
|
|
24
|
+
if (!base || !quote) {
|
|
25
|
+
return 1;
|
|
26
|
+
}
|
|
11
27
|
// Return 1 if currencies are the same
|
|
12
|
-
if (
|
|
28
|
+
if (base === quote) {
|
|
29
|
+
return 1;
|
|
30
|
+
}
|
|
31
|
+
// Skip API call if amount is explicitly provided and invalid
|
|
32
|
+
if (amount !== undefined && !isValidAmount(amount)) {
|
|
13
33
|
return 1;
|
|
14
34
|
}
|
|
15
35
|
// Create cache key
|
|
16
|
-
const cacheKey = `${
|
|
36
|
+
const cacheKey = `${base}_${quote}`;
|
|
17
37
|
// Return cached rate if available
|
|
18
38
|
if (exchangeRateCache[cacheKey] !== undefined) {
|
|
19
39
|
return exchangeRateCache[cacheKey];
|
|
20
40
|
}
|
|
21
41
|
try {
|
|
22
|
-
// Use
|
|
23
|
-
//
|
|
24
|
-
const
|
|
42
|
+
// Use a CORS-friendly endpoint that does not redirect
|
|
43
|
+
// API: https://open.er-api.com/v6/latest/{BASE}
|
|
44
|
+
const controller = new AbortController();
|
|
45
|
+
const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
|
|
46
|
+
const response = await fetch(`https://open.er-api.com/v6/latest/${base}`, { signal: controller.signal });
|
|
47
|
+
clearTimeout(timeoutId);
|
|
25
48
|
if (!response.ok) {
|
|
26
49
|
throw new Error(`Failed to fetch exchange rates: ${response.status}`);
|
|
27
50
|
}
|
|
28
51
|
const data = await response.json();
|
|
29
|
-
if (!data.rates || !data.rates[
|
|
30
|
-
throw new Error(`Exchange rate not found for ${
|
|
52
|
+
if (!data.rates || !data.rates[quote]) {
|
|
53
|
+
throw new Error(`Exchange rate not found for ${base} to ${quote}`);
|
|
31
54
|
}
|
|
32
|
-
const exchangeRate = data.rates[
|
|
55
|
+
const exchangeRate = data.rates[quote];
|
|
33
56
|
// Cache the result
|
|
34
57
|
exchangeRateCache[cacheKey] = exchangeRate;
|
|
35
58
|
return exchangeRate;
|
|
@@ -37,18 +60,21 @@ export const getExchangeRate = async (fromCurrency, toCurrency) => {
|
|
|
37
60
|
catch (error) {
|
|
38
61
|
console.error('ExchangeRate-API error:', error);
|
|
39
62
|
// Fallback: try a different approach for crypto currencies
|
|
40
|
-
if (['USDS', 'DAI'].includes(
|
|
63
|
+
if (['USDS', 'DAI'].includes(base) || ['USDS', 'DAI'].includes(quote)) {
|
|
41
64
|
try {
|
|
42
65
|
// For crypto currencies, use CoinGecko as fallback
|
|
43
66
|
const cryptoMapping = {
|
|
44
67
|
'USDS': 'usd-coin',
|
|
45
68
|
'DAI': 'dai',
|
|
46
69
|
};
|
|
47
|
-
const fromMapped = cryptoMapping[
|
|
48
|
-
const toMapped = cryptoMapping[
|
|
49
|
-
if (cryptoMapping[
|
|
70
|
+
const fromMapped = cryptoMapping[base] || base.toLowerCase();
|
|
71
|
+
const toMapped = cryptoMapping[quote] || quote.toLowerCase();
|
|
72
|
+
if (cryptoMapping[base]) {
|
|
50
73
|
// From crypto to fiat/crypto
|
|
51
|
-
const
|
|
74
|
+
const cryptoController = new AbortController();
|
|
75
|
+
const cryptoTimeoutId = setTimeout(() => cryptoController.abort(), 8000); // 8 second timeout
|
|
76
|
+
const response = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${fromMapped}&vs_currencies=${toMapped}`, { signal: cryptoController.signal });
|
|
77
|
+
clearTimeout(cryptoTimeoutId);
|
|
52
78
|
if (response.ok) {
|
|
53
79
|
const data = await response.json();
|
|
54
80
|
const rate = data[fromMapped]?.[toMapped];
|
|
@@ -58,9 +84,12 @@ export const getExchangeRate = async (fromCurrency, toCurrency) => {
|
|
|
58
84
|
}
|
|
59
85
|
}
|
|
60
86
|
}
|
|
61
|
-
else if (cryptoMapping[
|
|
87
|
+
else if (cryptoMapping[quote]) {
|
|
62
88
|
// From fiat to crypto
|
|
63
|
-
const
|
|
89
|
+
const cryptoController2 = new AbortController();
|
|
90
|
+
const cryptoTimeoutId2 = setTimeout(() => cryptoController2.abort(), 8000); // 8 second timeout
|
|
91
|
+
const response = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${toMapped}&vs_currencies=${fromMapped}`, { signal: cryptoController2.signal });
|
|
92
|
+
clearTimeout(cryptoTimeoutId2);
|
|
64
93
|
if (response.ok) {
|
|
65
94
|
const data = await response.json();
|
|
66
95
|
const rate = data[toMapped]?.[fromMapped];
|
|
@@ -6,7 +6,7 @@ import { uploadPdfChunked } from "./uploadPdfChunked.js";
|
|
|
6
6
|
import { getCountryCodeFromName } from "./utils/utils.js";
|
|
7
7
|
let GRAPHQL_URL = 'http://localhost:4001/graphql/invoice';
|
|
8
8
|
if (!window.document.baseURI.includes('localhost')) {
|
|
9
|
-
GRAPHQL_URL = 'https://switchboard-
|
|
9
|
+
GRAPHQL_URL = 'https://switchboard-dev.powerhouse.xyz/graphql/invoice';
|
|
10
10
|
}
|
|
11
11
|
export async function loadPDFFile({ file, dispatch, }) {
|
|
12
12
|
if (!file)
|
|
@@ -4,7 +4,7 @@ import { actions } from "../../document-models/invoice/index.js";
|
|
|
4
4
|
import { generateId } from "document-model";
|
|
5
5
|
let GRAPHQL_URL = "http://localhost:4001/graphql/invoice";
|
|
6
6
|
if (!window.document.baseURI.includes('localhost')) {
|
|
7
|
-
GRAPHQL_URL = 'https://switchboard-
|
|
7
|
+
GRAPHQL_URL = 'https://switchboard-dev.powerhouse.xyz/graphql/invoice';
|
|
8
8
|
}
|
|
9
9
|
const InvoiceToGnosis = ({ docState, dispatch, }) => {
|
|
10
10
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -4,7 +4,7 @@ import { actions } from "../../document-models/invoice/index.js";
|
|
|
4
4
|
import { generateId } from "document-model";
|
|
5
5
|
let GRAPHQL_URL = "http://localhost:4001/graphql/invoice";
|
|
6
6
|
if (!window.document.baseURI.includes('localhost')) {
|
|
7
|
-
GRAPHQL_URL = 'https://switchboard-
|
|
7
|
+
GRAPHQL_URL = 'https://switchboard-dev.powerhouse.xyz/graphql/invoice';
|
|
8
8
|
}
|
|
9
9
|
const RequestFinance = ({ docState, dispatch, }) => {
|
|
10
10
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
let GRAPHQL_URL = 'http://localhost:4001/graphql/invoice';
|
|
9
9
|
if (!window.document.baseURI.includes('localhost')) {
|
|
10
|
-
GRAPHQL_URL = 'https://switchboard-
|
|
10
|
+
GRAPHQL_URL = 'https://switchboard-dev.powerhouse.xyz/graphql/invoice';
|
|
11
11
|
}
|
|
12
12
|
export async function uploadPdfChunked(pdfData, endpoint = GRAPHQL_URL, chunkSize = 500 * 1024, // 500KB chunks
|
|
13
13
|
onProgress) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-zip.d.ts","sourceRoot":"","sources":["../migrate-zip.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import JSZip from "jszip";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { documentModelDocumentModelModule } from "document-model";
|
|
5
|
+
import { argv } from "node:process";
|
|
6
|
+
const docModelMap = {
|
|
7
|
+
"powerhouse/document-model": documentModelDocumentModelModule,
|
|
8
|
+
// add other document models here
|
|
9
|
+
};
|
|
10
|
+
async function loadFromZip(zip, entryName) {
|
|
11
|
+
const entry = await zip.file(entryName).async("string");
|
|
12
|
+
return JSON.parse(entry);
|
|
13
|
+
}
|
|
14
|
+
async function resolvePath(argPath) {
|
|
15
|
+
if (fs.lstatSync(argPath).isDirectory()) {
|
|
16
|
+
const children = fs.readdirSync(argPath);
|
|
17
|
+
return children
|
|
18
|
+
.filter((child) => child.endsWith(".zip") &&
|
|
19
|
+
fs.lstatSync(path.join(argPath, child)).isFile())
|
|
20
|
+
.map((child) => path.join(argPath, child));
|
|
21
|
+
}
|
|
22
|
+
return [path.resolve(argPath)];
|
|
23
|
+
}
|
|
24
|
+
async function migrateZip(zipPath) {
|
|
25
|
+
const file = fs.readFileSync(zipPath);
|
|
26
|
+
const docZip = new JSZip();
|
|
27
|
+
await docZip.loadAsync(file);
|
|
28
|
+
const header = await loadFromZip(docZip, "header.json");
|
|
29
|
+
const operations = await loadFromZip(docZip, "operations.json");
|
|
30
|
+
const documentModel = docModelMap[header.documentType];
|
|
31
|
+
if (!documentModel) {
|
|
32
|
+
throw new Error(`Unknown document type: ${header.documentType}. Add it to docModelMap.`);
|
|
33
|
+
}
|
|
34
|
+
const result = Object.values(operations)
|
|
35
|
+
.flat()
|
|
36
|
+
.reduce((doc, operation) => {
|
|
37
|
+
const action = "action" in operation ? operation.action : operation;
|
|
38
|
+
return documentModel.reducer(doc, action);
|
|
39
|
+
}, documentModel.utils.createDocument());
|
|
40
|
+
const targetName = path.basename(zipPath, path.extname(zipPath));
|
|
41
|
+
const targetPath = path.resolve(zipPath, "../");
|
|
42
|
+
await documentModel.utils.saveToFile(result, targetPath, `${targetName}-migrated`);
|
|
43
|
+
console.info(`Migrated ${path.relative(process.cwd(), zipPath)} to ${path.relative(process.cwd(), path.join(targetPath, `${targetName}-migrated.${documentModel.documentModel.extension}.zip`))}`);
|
|
44
|
+
}
|
|
45
|
+
const paths = argv.length > 2 ? argv.slice(2) : [process.cwd()];
|
|
46
|
+
paths.forEach(async (val) => {
|
|
47
|
+
const resolvedPaths = await resolvePath(val);
|
|
48
|
+
for (const zipPath of resolvedPaths) {
|
|
49
|
+
try {
|
|
50
|
+
await migrateZip(zipPath);
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
console.error(`Error migrating ${zipPath}`, e);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
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 { ProcessorRecord } from "document-drive/processors/types";
|
|
6
|
+
export declare const processorFactory: (module: any) => (driveId: string) => ProcessorRecord[];
|
|
2
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../processors/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../processors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,eAAO,MAAM,gBAAgB,GAC1B,QAAQ,GAAG,MACX,SAAS,MAAM,KAAG,eAAe,EAYjC,CAAC"}
|
package/dist/processors/index.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
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 { LineItemProcessorProcessor } from "./line-item-processor/index.js";
|
|
6
|
+
export const processorFactory = (module) => (driveId) => {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
processor: new LineItemProcessorProcessor(module.analyticsStore),
|
|
10
|
+
filter: {
|
|
11
|
+
branch: ["main"],
|
|
12
|
+
documentId: ["*"],
|
|
13
|
+
scope: ["*"],
|
|
14
|
+
documentType: ["powerhouse/billing-statement"],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PHDocument } from "document-model";
|
|
2
|
+
import { IAnalyticsStore } from "@powerhousedao/reactor-api";
|
|
3
|
+
import { InternalTransmitterUpdate, IProcessor } from "document-drive";
|
|
4
|
+
export declare class LineItemProcessorProcessor implements IProcessor {
|
|
5
|
+
private readonly analyticsStore;
|
|
6
|
+
constructor(analyticsStore: IAnalyticsStore);
|
|
7
|
+
onStrands<TDocument extends PHDocument>(strands: InternalTransmitterUpdate[]): Promise<void>;
|
|
8
|
+
onDisconnect(): Promise<void>;
|
|
9
|
+
private clearSource;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../processors/line-item-processor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAiB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvE,qBAAa,0BAA2B,YAAW,UAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,eAAe;IAItD,SAAS,CAAC,SAAS,SAAS,UAAU,EAC1C,OAAO,EAAE,yBAAyB,EAAE,GACnC,OAAO,CAAC,IAAI,CAAC;IAwBV,YAAY;YAEJ,WAAW;CAO1B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AnalyticsPath } from "@powerhousedao/reactor-api";
|
|
2
|
+
export class LineItemProcessorProcessor {
|
|
3
|
+
analyticsStore;
|
|
4
|
+
constructor(analyticsStore) {
|
|
5
|
+
this.analyticsStore = analyticsStore;
|
|
6
|
+
//
|
|
7
|
+
}
|
|
8
|
+
async onStrands(strands) {
|
|
9
|
+
if (strands.length === 0) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
for (const strand of strands) {
|
|
13
|
+
if (strand.operations.length === 0) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const firstOp = strand.operations[0];
|
|
17
|
+
const source = AnalyticsPath.fromString(`ph/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);
|
|
18
|
+
if (firstOp.index === 0) {
|
|
19
|
+
await this.clearSource(source);
|
|
20
|
+
}
|
|
21
|
+
for (const operation of strand.operations) {
|
|
22
|
+
console.log(">>> ", operation.type);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async onDisconnect() { }
|
|
27
|
+
async clearSource(source) {
|
|
28
|
+
try {
|
|
29
|
+
await this.analyticsStore.clearSeriesBySource(source, true);
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
console.error(e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
package/dist/style.css
CHANGED
|
@@ -86,6 +86,10 @@
|
|
|
86
86
|
--color-gray-700: oklch(37.3% 0.034 259.733);
|
|
87
87
|
--color-gray-800: oklch(27.8% 0.033 256.848);
|
|
88
88
|
--color-gray-900: oklch(21% 0.034 264.665);
|
|
89
|
+
--color-zinc-50: oklch(98.5% 0 0);
|
|
90
|
+
--color-zinc-200: oklch(92% 0.004 286.32);
|
|
91
|
+
--color-zinc-500: oklch(55.2% 0.016 285.938);
|
|
92
|
+
--color-zinc-600: oklch(44.2% 0.017 285.786);
|
|
89
93
|
--color-black: #000;
|
|
90
94
|
--color-white: #fff;
|
|
91
95
|
--spacing: 0.25rem;
|
|
@@ -1991,6 +1995,10 @@
|
|
|
1991
1995
|
--color-gray-700: hsl(189 5% 29%);
|
|
1992
1996
|
--color-gray-800: hsl(200 4% 26%);
|
|
1993
1997
|
--color-gray-900: hsl(192 5% 21%);
|
|
1998
|
+
--color-zinc-50: oklch(98.5% 0 0);
|
|
1999
|
+
--color-zinc-200: oklch(92% 0.004 286.32);
|
|
2000
|
+
--color-zinc-500: oklch(55.2% 0.016 285.938);
|
|
2001
|
+
--color-zinc-600: oklch(44.2% 0.017 285.786);
|
|
1994
2002
|
--color-black: hsl(0 0% 0%);
|
|
1995
2003
|
--color-white: hsl(0 0% 100%);
|
|
1996
2004
|
--spacing: 0.25rem;
|
|
@@ -2020,6 +2028,7 @@
|
|
|
2020
2028
|
--radius-xl: 0.75rem;
|
|
2021
2029
|
--radius-2xl: 1rem;
|
|
2022
2030
|
--radius-3xl: 1.5rem;
|
|
2031
|
+
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
2023
2032
|
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2024
2033
|
--animate-spin: spin 1s linear infinite;
|
|
2025
2034
|
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
@@ -2276,6 +2285,9 @@
|
|
|
2276
2285
|
.right-3 {
|
|
2277
2286
|
right: calc(var(--spacing) * 3);
|
|
2278
2287
|
}
|
|
2288
|
+
.right-4 {
|
|
2289
|
+
right: calc(var(--spacing) * 4);
|
|
2290
|
+
}
|
|
2279
2291
|
.right-5 {
|
|
2280
2292
|
right: calc(var(--spacing) * 5);
|
|
2281
2293
|
}
|
|
@@ -2285,9 +2297,15 @@
|
|
|
2285
2297
|
.right-\[0px\] {
|
|
2286
2298
|
right: 0px;
|
|
2287
2299
|
}
|
|
2300
|
+
.-bottom-16 {
|
|
2301
|
+
bottom: calc(var(--spacing) * -16);
|
|
2302
|
+
}
|
|
2288
2303
|
.bottom-0 {
|
|
2289
2304
|
bottom: calc(var(--spacing) * 0);
|
|
2290
2305
|
}
|
|
2306
|
+
.bottom-4 {
|
|
2307
|
+
bottom: calc(var(--spacing) * 4);
|
|
2308
|
+
}
|
|
2291
2309
|
.bottom-5 {
|
|
2292
2310
|
bottom: calc(var(--spacing) * 5);
|
|
2293
2311
|
}
|
|
@@ -2333,6 +2351,12 @@
|
|
|
2333
2351
|
.z-\[20\] {
|
|
2334
2352
|
z-index: 20;
|
|
2335
2353
|
}
|
|
2354
|
+
.z-\[1000\] {
|
|
2355
|
+
z-index: 1000;
|
|
2356
|
+
}
|
|
2357
|
+
.z-\[1001\] {
|
|
2358
|
+
z-index: 1001;
|
|
2359
|
+
}
|
|
2336
2360
|
.container {
|
|
2337
2361
|
width: 100%;
|
|
2338
2362
|
@media (width >= 40rem) {
|
|
@@ -2586,9 +2610,15 @@
|
|
|
2586
2610
|
.h-0\.5 {
|
|
2587
2611
|
height: calc(var(--spacing) * 0.5);
|
|
2588
2612
|
}
|
|
2613
|
+
.h-2 {
|
|
2614
|
+
height: calc(var(--spacing) * 2);
|
|
2615
|
+
}
|
|
2589
2616
|
.h-3 {
|
|
2590
2617
|
height: calc(var(--spacing) * 3);
|
|
2591
2618
|
}
|
|
2619
|
+
.h-4 {
|
|
2620
|
+
height: calc(var(--spacing) * 4);
|
|
2621
|
+
}
|
|
2592
2622
|
.h-5 {
|
|
2593
2623
|
height: calc(var(--spacing) * 5);
|
|
2594
2624
|
}
|
|
@@ -2637,6 +2667,9 @@
|
|
|
2637
2667
|
.h-\[17px\] {
|
|
2638
2668
|
height: 17px;
|
|
2639
2669
|
}
|
|
2670
|
+
.h-\[18px\] {
|
|
2671
|
+
height: 18px;
|
|
2672
|
+
}
|
|
2640
2673
|
.h-\[22px\] {
|
|
2641
2674
|
height: 22px;
|
|
2642
2675
|
}
|
|
@@ -2652,6 +2685,9 @@
|
|
|
2652
2685
|
.h-\[52px\] {
|
|
2653
2686
|
height: 52px;
|
|
2654
2687
|
}
|
|
2688
|
+
.h-\[130px\] {
|
|
2689
|
+
height: 130px;
|
|
2690
|
+
}
|
|
2655
2691
|
.h-\[244px\] {
|
|
2656
2692
|
height: 244px;
|
|
2657
2693
|
}
|
|
@@ -2694,6 +2730,9 @@
|
|
|
2694
2730
|
.max-h-\[370px\] {
|
|
2695
2731
|
max-height: 370px;
|
|
2696
2732
|
}
|
|
2733
|
+
.max-h-\[404px\] {
|
|
2734
|
+
max-height: 404px;
|
|
2735
|
+
}
|
|
2697
2736
|
.max-h-screen {
|
|
2698
2737
|
max-height: 100vh;
|
|
2699
2738
|
}
|
|
@@ -2718,6 +2757,9 @@
|
|
|
2718
2757
|
.min-h-full {
|
|
2719
2758
|
min-height: 100%;
|
|
2720
2759
|
}
|
|
2760
|
+
.min-h-screen {
|
|
2761
|
+
min-height: 100vh;
|
|
2762
|
+
}
|
|
2721
2763
|
.w-\(--radix-popover-trigger-width\) {
|
|
2722
2764
|
width: var(--radix-popover-trigger-width);
|
|
2723
2765
|
}
|
|
@@ -2742,6 +2784,9 @@
|
|
|
2742
2784
|
.w-6 {
|
|
2743
2785
|
width: calc(var(--spacing) * 6);
|
|
2744
2786
|
}
|
|
2787
|
+
.w-7 {
|
|
2788
|
+
width: calc(var(--spacing) * 7);
|
|
2789
|
+
}
|
|
2745
2790
|
.w-8 {
|
|
2746
2791
|
width: calc(var(--spacing) * 8);
|
|
2747
2792
|
}
|
|
@@ -2766,6 +2811,9 @@
|
|
|
2766
2811
|
.w-\[6px\] {
|
|
2767
2812
|
width: 6px;
|
|
2768
2813
|
}
|
|
2814
|
+
.w-\[18px\] {
|
|
2815
|
+
width: 18px;
|
|
2816
|
+
}
|
|
2769
2817
|
.w-\[50px\] {
|
|
2770
2818
|
width: 50px;
|
|
2771
2819
|
}
|
|
@@ -2778,6 +2826,12 @@
|
|
|
2778
2826
|
.w-\[320px\] {
|
|
2779
2827
|
width: 320px;
|
|
2780
2828
|
}
|
|
2829
|
+
.w-\[338px\] {
|
|
2830
|
+
width: 338px;
|
|
2831
|
+
}
|
|
2832
|
+
.w-\[358px\] {
|
|
2833
|
+
width: 358px;
|
|
2834
|
+
}
|
|
2781
2835
|
.w-\[400px\] {
|
|
2782
2836
|
width: 400px;
|
|
2783
2837
|
}
|
|
@@ -2862,6 +2916,9 @@
|
|
|
2862
2916
|
.flex-none {
|
|
2863
2917
|
flex: none;
|
|
2864
2918
|
}
|
|
2919
|
+
.flex-shrink-0 {
|
|
2920
|
+
flex-shrink: 0;
|
|
2921
|
+
}
|
|
2865
2922
|
.shrink-0 {
|
|
2866
2923
|
flex-shrink: 0;
|
|
2867
2924
|
}
|
|
@@ -2886,6 +2943,9 @@
|
|
|
2886
2943
|
.-rotate-90 {
|
|
2887
2944
|
rotate: calc(90deg * -1);
|
|
2888
2945
|
}
|
|
2946
|
+
.rotate-0 {
|
|
2947
|
+
rotate: 0deg;
|
|
2948
|
+
}
|
|
2889
2949
|
.rotate-90 {
|
|
2890
2950
|
rotate: 90deg;
|
|
2891
2951
|
}
|
|
@@ -2973,6 +3033,9 @@
|
|
|
2973
3033
|
.justify-start {
|
|
2974
3034
|
justify-content: flex-start;
|
|
2975
3035
|
}
|
|
3036
|
+
.gap-0\.5 {
|
|
3037
|
+
gap: calc(var(--spacing) * 0.5);
|
|
3038
|
+
}
|
|
2976
3039
|
.gap-1 {
|
|
2977
3040
|
gap: calc(var(--spacing) * 1);
|
|
2978
3041
|
}
|
|
@@ -3053,12 +3116,18 @@
|
|
|
3053
3116
|
.overflow-scroll {
|
|
3054
3117
|
overflow: scroll;
|
|
3055
3118
|
}
|
|
3119
|
+
.overflow-visible {
|
|
3120
|
+
overflow: visible;
|
|
3121
|
+
}
|
|
3056
3122
|
.overflow-x-auto {
|
|
3057
3123
|
overflow-x: auto;
|
|
3058
3124
|
}
|
|
3059
3125
|
.overflow-x-hidden {
|
|
3060
3126
|
overflow-x: hidden;
|
|
3061
3127
|
}
|
|
3128
|
+
.overflow-x-visible {
|
|
3129
|
+
overflow-x: visible;
|
|
3130
|
+
}
|
|
3062
3131
|
.overflow-y-auto {
|
|
3063
3132
|
overflow-y: auto;
|
|
3064
3133
|
}
|
|
@@ -3074,6 +3143,9 @@
|
|
|
3074
3143
|
.rounded-\[2px\] {
|
|
3075
3144
|
border-radius: 2px;
|
|
3076
3145
|
}
|
|
3146
|
+
.rounded-\[24px\] {
|
|
3147
|
+
border-radius: 24px;
|
|
3148
|
+
}
|
|
3077
3149
|
.rounded-full {
|
|
3078
3150
|
border-radius: calc(infinity * 1px);
|
|
3079
3151
|
}
|
|
@@ -3167,6 +3239,9 @@
|
|
|
3167
3239
|
--tw-border-style: solid;
|
|
3168
3240
|
border-style: solid;
|
|
3169
3241
|
}
|
|
3242
|
+
.border-black {
|
|
3243
|
+
border-color: var(--color-black);
|
|
3244
|
+
}
|
|
3170
3245
|
.border-blue-600 {
|
|
3171
3246
|
border-color: var(--color-blue-600);
|
|
3172
3247
|
}
|
|
@@ -3212,6 +3287,9 @@
|
|
|
3212
3287
|
.border-white {
|
|
3213
3288
|
border-color: var(--color-white);
|
|
3214
3289
|
}
|
|
3290
|
+
.border-zinc-200 {
|
|
3291
|
+
border-color: var(--color-zinc-200);
|
|
3292
|
+
}
|
|
3215
3293
|
.border-b-gray-300 {
|
|
3216
3294
|
border-bottom-color: var(--color-gray-300);
|
|
3217
3295
|
}
|
|
@@ -3221,6 +3299,15 @@
|
|
|
3221
3299
|
.bg-black {
|
|
3222
3300
|
background-color: var(--color-black);
|
|
3223
3301
|
}
|
|
3302
|
+
.bg-black\/50 {
|
|
3303
|
+
background-color: color-mix(in srgb, hsl(0 0% 0%) 50%, transparent);
|
|
3304
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3305
|
+
background-color: color-mix(in srgb, #000 50%, transparent);
|
|
3306
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3307
|
+
background-color: color-mix(in oklab, var(--color-black) 50%, transparent);
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3224
3311
|
.bg-blue-100 {
|
|
3225
3312
|
background-color: var(--color-blue-100);
|
|
3226
3313
|
}
|
|
@@ -3320,6 +3407,9 @@
|
|
|
3320
3407
|
.bg-white {
|
|
3321
3408
|
background-color: var(--color-white);
|
|
3322
3409
|
}
|
|
3410
|
+
.bg-zinc-50 {
|
|
3411
|
+
background-color: var(--color-zinc-50);
|
|
3412
|
+
}
|
|
3323
3413
|
.object-contain {
|
|
3324
3414
|
object-fit: contain;
|
|
3325
3415
|
}
|
|
@@ -3389,6 +3479,9 @@
|
|
|
3389
3479
|
.py-4 {
|
|
3390
3480
|
padding-block: calc(var(--spacing) * 4);
|
|
3391
3481
|
}
|
|
3482
|
+
.py-6 {
|
|
3483
|
+
padding-block: calc(var(--spacing) * 6);
|
|
3484
|
+
}
|
|
3392
3485
|
.py-28 {
|
|
3393
3486
|
padding-block: calc(var(--spacing) * 28);
|
|
3394
3487
|
}
|
|
@@ -3552,6 +3645,9 @@
|
|
|
3552
3645
|
.text-nowrap {
|
|
3553
3646
|
text-wrap: nowrap;
|
|
3554
3647
|
}
|
|
3648
|
+
.break-words {
|
|
3649
|
+
overflow-wrap: break-word;
|
|
3650
|
+
}
|
|
3555
3651
|
.whitespace-nowrap {
|
|
3556
3652
|
white-space: nowrap;
|
|
3557
3653
|
}
|
|
@@ -3666,6 +3762,12 @@
|
|
|
3666
3762
|
.text-yellow-900 {
|
|
3667
3763
|
color: var(--color-yellow-900);
|
|
3668
3764
|
}
|
|
3765
|
+
.text-zinc-500 {
|
|
3766
|
+
color: var(--color-zinc-500);
|
|
3767
|
+
}
|
|
3768
|
+
.text-zinc-600 {
|
|
3769
|
+
color: var(--color-zinc-600);
|
|
3770
|
+
}
|
|
3669
3771
|
.capitalize {
|
|
3670
3772
|
text-transform: capitalize;
|
|
3671
3773
|
}
|
|
@@ -3694,10 +3796,18 @@
|
|
|
3694
3796
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
3695
3797
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
3696
3798
|
}
|
|
3799
|
+
.shadow-\[0_2px_12px_rgba\(37\,42\,52\,0\.1\)\] {
|
|
3800
|
+
--tw-shadow: 0 2px 12px var(--tw-shadow-color, rgba(37,42,52,0.1));
|
|
3801
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
3802
|
+
}
|
|
3697
3803
|
.shadow-\[1px_4px_15px_0px_rgba\(74\,88\,115\,0\.25\)\] {
|
|
3698
3804
|
--tw-shadow: 1px 4px 15px 0px var(--tw-shadow-color, rgba(74,88,115,0.25));
|
|
3699
3805
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
3700
3806
|
}
|
|
3807
|
+
.shadow-\[1px_4px_15px_rgba\(74\,88\,115\,0\.25\)\] {
|
|
3808
|
+
--tw-shadow: 1px 4px 15px var(--tw-shadow-color, rgba(74,88,115,0.25));
|
|
3809
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
3810
|
+
}
|
|
3701
3811
|
.shadow-button {
|
|
3702
3812
|
--tw-shadow: 0px -1px 1px 0px var(--tw-shadow-color, rgba(0, 0, 0, 0.04)) inset, 0px 2px 0px 0px var(--tw-shadow-color, rgba(255, 255, 255, 0.25)) inset, 0px 4px 8px -4px var(--tw-shadow-color, rgba(0, 0, 0, 0.1));
|
|
3703
3813
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -3772,6 +3882,11 @@
|
|
|
3772
3882
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
3773
3883
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
3774
3884
|
}
|
|
3885
|
+
.transition-transform {
|
|
3886
|
+
transition-property: transform, translate, scale, rotate;
|
|
3887
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
3888
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
3889
|
+
}
|
|
3775
3890
|
.duration-150 {
|
|
3776
3891
|
--tw-duration: 150ms;
|
|
3777
3892
|
transition-duration: 150ms;
|
|
@@ -3788,6 +3903,10 @@
|
|
|
3788
3903
|
--tw-ease: var(--ease-in-out);
|
|
3789
3904
|
transition-timing-function: var(--ease-in-out);
|
|
3790
3905
|
}
|
|
3906
|
+
.ease-out {
|
|
3907
|
+
--tw-ease: var(--ease-out);
|
|
3908
|
+
transition-timing-function: var(--ease-out);
|
|
3909
|
+
}
|
|
3791
3910
|
.outline-none {
|
|
3792
3911
|
--tw-outline-style: none;
|
|
3793
3912
|
outline-style: none;
|
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.0.
|
|
4
|
+
"version": "0.0.90",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@google-cloud/documentai": "^8.12.0",
|
|
60
|
-
"@powerhousedao/builder-tools": "^5.0.0-staging.
|
|
61
|
-
"@powerhousedao/common": "^5.0.0-staging.
|
|
62
|
-
"@powerhousedao/design-system": "^5.0.0-staging.
|
|
60
|
+
"@powerhousedao/builder-tools": "^5.0.0-staging.15",
|
|
61
|
+
"@powerhousedao/common": "^5.0.0-staging.15",
|
|
62
|
+
"@powerhousedao/design-system": "^5.0.0-staging.15",
|
|
63
63
|
"@powerhousedao/document-engineering": "^1.37.0",
|
|
64
64
|
"@react-pdf/renderer": "^4.3.0",
|
|
65
65
|
"@safe-global/api-kit": "^3.0.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@types/cors": "^2.8.17",
|
|
70
70
|
"axios": "^1.9.0",
|
|
71
71
|
"cors": "^2.8.5",
|
|
72
|
-
"document-model": "^5.0.0-staging.
|
|
72
|
+
"document-model": "^5.0.0-staging.15",
|
|
73
73
|
"dotenv": "^16.5.0",
|
|
74
74
|
"error": "^10.4.0",
|
|
75
75
|
"ethers": "^6.14.0",
|
|
@@ -85,23 +85,24 @@
|
|
|
85
85
|
"@electric-sql/pglite": "^0.2.12",
|
|
86
86
|
"@eslint/js": "^9.25.0",
|
|
87
87
|
"@powerhousedao/analytics-engine-core": "^0.5.0",
|
|
88
|
-
"@powerhousedao/codegen": "^5.0.0-staging.
|
|
89
|
-
"@powerhousedao/ph-cli": "^5.0.0-staging.
|
|
90
|
-
"@powerhousedao/reactor-api": "^5.0.0-staging.
|
|
91
|
-
"@powerhousedao/reactor-browser": "^5.0.0-staging.
|
|
92
|
-
"@powerhousedao/reactor-local": "^5.0.0-staging.
|
|
88
|
+
"@powerhousedao/codegen": "^5.0.0-staging.15",
|
|
89
|
+
"@powerhousedao/ph-cli": "^5.0.0-staging.15",
|
|
90
|
+
"@powerhousedao/reactor-api": "^5.0.0-staging.15",
|
|
91
|
+
"@powerhousedao/reactor-browser": "^5.0.0-staging.15",
|
|
92
|
+
"@powerhousedao/reactor-local": "^5.0.0-staging.15",
|
|
93
93
|
"@powerhousedao/scalars": "^1.33.1-staging.5",
|
|
94
|
-
"@powerhousedao/switchboard": "^5.0.0-staging.
|
|
94
|
+
"@powerhousedao/switchboard": "^5.0.0-staging.15",
|
|
95
95
|
"@tailwindcss/cli": "^4.1.4",
|
|
96
96
|
"@testing-library/react": "^16.3.0",
|
|
97
97
|
"@types/node": "^22.14.1",
|
|
98
98
|
"@types/react": "^18.3.20",
|
|
99
99
|
"@vitejs/plugin-react": "^4.4.1",
|
|
100
|
-
"document-drive": "^5.0.0-staging.
|
|
100
|
+
"document-drive": "^5.0.0-staging.15",
|
|
101
101
|
"eslint": "^9.25.0",
|
|
102
102
|
"eslint-plugin-react": "^7.37.5",
|
|
103
103
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
104
104
|
"globals": "^16.0.0",
|
|
105
|
+
"jszip": "^3.10.1",
|
|
105
106
|
"package-manager-detector": "^0.2.8",
|
|
106
107
|
"pm2": "^5.4.3",
|
|
107
108
|
"react": "^18.3.1",
|