@voyantjs/finance 0.76.0 → 0.77.0
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.
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
expiresAt: string | null;
|
|
4
|
-
}
|
|
5
|
-
export type DocumentDownloadResolution = {
|
|
6
|
-
status: "ready";
|
|
7
|
-
download: DocumentDownloadEnvelope;
|
|
8
|
-
} | {
|
|
9
|
-
status: "resolver_not_configured";
|
|
10
|
-
} | {
|
|
11
|
-
status: "not_available";
|
|
12
|
-
};
|
|
13
|
-
export type DocumentDownloadResolver = (bindings: unknown, storageKey: string) => Promise<string | null> | string | null;
|
|
14
|
-
export interface StoredDocumentReference {
|
|
15
|
-
storageKey?: string | null;
|
|
16
|
-
metadata?: unknown;
|
|
17
|
-
}
|
|
18
|
-
export declare function resolveStoredDocumentDownload(reference: StoredDocumentReference, options: {
|
|
19
|
-
bindings: unknown;
|
|
20
|
-
resolveDocumentDownloadUrl?: DocumentDownloadResolver;
|
|
21
|
-
}): Promise<DocumentDownloadResolution>;
|
|
1
|
+
export type { DocumentDownloadEnvelope, DocumentDownloadResolution, DocumentDownloadResolver, DocumentDownloadResolverResult, StoredDocumentReference, } from "@voyantjs/hono/document-download";
|
|
2
|
+
export { resolveStoredDocumentDownload } from "@voyantjs/hono/document-download";
|
|
22
3
|
//# sourceMappingURL=document-download.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-download.d.ts","sourceRoot":"","sources":["../src/document-download.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"document-download.d.ts","sourceRoot":"","sources":["../src/document-download.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
3
|
-
return null;
|
|
4
|
-
}
|
|
5
|
-
return metadata;
|
|
6
|
-
}
|
|
7
|
-
function maybeUrl(value) {
|
|
8
|
-
return typeof value === "string" && /^https?:\/\//i.test(value) ? value : null;
|
|
9
|
-
}
|
|
10
|
-
function maybeIsoString(value) {
|
|
11
|
-
return typeof value === "string" && value.length > 0 ? value : null;
|
|
12
|
-
}
|
|
13
|
-
function getFallbackDownload(metadata) {
|
|
14
|
-
const record = getMetadataRecord(metadata);
|
|
15
|
-
if (!record) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const url = maybeUrl(record.url) ?? maybeUrl(record.downloadUrl);
|
|
19
|
-
if (!url) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
url,
|
|
24
|
-
expiresAt: maybeIsoString(record.expiresAt) ?? maybeIsoString(record.expires_at),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export async function resolveStoredDocumentDownload(reference, options) {
|
|
28
|
-
let needsResolver = false;
|
|
29
|
-
if (reference.storageKey) {
|
|
30
|
-
if (!options.resolveDocumentDownloadUrl) {
|
|
31
|
-
needsResolver = true;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
const url = await options.resolveDocumentDownloadUrl(options.bindings, reference.storageKey);
|
|
35
|
-
if (url) {
|
|
36
|
-
return { status: "ready", download: { url, expiresAt: null } };
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const fallback = getFallbackDownload(reference.metadata);
|
|
41
|
-
if (fallback) {
|
|
42
|
-
return { status: "ready", download: fallback };
|
|
43
|
-
}
|
|
44
|
-
if (needsResolver) {
|
|
45
|
-
return { status: "resolver_not_configured" };
|
|
46
|
-
}
|
|
47
|
-
return { status: "not_available" };
|
|
48
|
-
}
|
|
1
|
+
export { resolveStoredDocumentDownload } from "@voyantjs/hono/document-download";
|
package/dist/routes.d.ts
CHANGED
|
@@ -2557,6 +2557,7 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
2557
2557
|
download: {
|
|
2558
2558
|
url: string;
|
|
2559
2559
|
expiresAt: string | null;
|
|
2560
|
+
filename: string | null;
|
|
2560
2561
|
};
|
|
2561
2562
|
invoice: {
|
|
2562
2563
|
id: string;
|
|
@@ -4609,6 +4610,7 @@ export declare const financeRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
4609
4610
|
download: {
|
|
4610
4611
|
url: string;
|
|
4611
4612
|
expiresAt: string | null;
|
|
4613
|
+
filename: string | null;
|
|
4612
4614
|
};
|
|
4613
4615
|
rendition: {
|
|
4614
4616
|
format: "json" | "html" | "pdf" | "xml";
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAuJ7C,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAuJ7C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"drizzle-orm": "^0.45.2",
|
|
60
60
|
"hono": "^4.12.10",
|
|
61
61
|
"zod": "^4.3.6",
|
|
62
|
-
"@voyantjs/action-ledger": "0.
|
|
63
|
-
"@voyantjs/bookings": "0.
|
|
64
|
-
"@voyantjs/core": "0.
|
|
65
|
-
"@voyantjs/db": "0.
|
|
66
|
-
"@voyantjs/hono": "0.
|
|
67
|
-
"@voyantjs/products": "0.
|
|
68
|
-
"@voyantjs/utils": "0.
|
|
69
|
-
"@voyantjs/storage": "0.
|
|
62
|
+
"@voyantjs/action-ledger": "0.77.0",
|
|
63
|
+
"@voyantjs/bookings": "0.77.0",
|
|
64
|
+
"@voyantjs/core": "0.77.0",
|
|
65
|
+
"@voyantjs/db": "0.77.0",
|
|
66
|
+
"@voyantjs/hono": "0.77.0",
|
|
67
|
+
"@voyantjs/products": "0.77.0",
|
|
68
|
+
"@voyantjs/utils": "0.77.0",
|
|
69
|
+
"@voyantjs/storage": "0.77.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"typescript": "^6.0.2",
|