@driveflux/pdf 4.0.77 → 5.0.0-feature-e-invoicing.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.
- package/.env +0 -0
- package/.env.development +4 -0
- package/.turbo/turbo-build.log +14 -0
- package/CHANGELOG.md +15 -0
- package/build.ts +45 -0
- package/bun-env.d.ts +34 -0
- package/bunfig.toml +8 -0
- package/catalog-version-stamp.json +8 -0
- package/dist/main.js +4 -0
- package/dist/main.js.map +11 -0
- package/dist/src/config.d.ts +20 -0
- package/dist/src/create-logger.d.ts +1 -0
- package/dist/src/errors.d.ts +43 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/preview/api.d.ts +264 -0
- package/dist/src/preview/client/app.d.ts +2 -0
- package/dist/src/preview/client/invoice/invoice-display.d.ts +5 -0
- package/dist/src/preview/client/invoice/invoice-setup.d.ts +8 -0
- package/dist/src/preview/client/preview-targets.d.ts +12 -0
- package/dist/src/preview/client/preview.d.ts +6 -0
- package/dist/src/preview/client/sidebar.d.ts +7 -0
- package/dist/src/preview/client/treaty.d.ts +200 -0
- package/dist/src/preview/client/use-target.d.ts +1 -0
- package/dist/src/preview/fonts/register-fonts.d.ts +1 -0
- package/dist/src/preview/frontend.d.ts +1 -0
- package/dist/src/preview/server.d.ts +1 -0
- package/dist/src/repository.d.ts +171 -0
- package/dist/src/templates/invoice/colors.d.ts +6 -0
- package/dist/src/templates/invoice/company-details.d.ts +10 -0
- package/dist/src/templates/invoice/flux-invoice.d.ts +6 -0
- package/dist/src/templates/invoice/footer.d.ts +2 -0
- package/dist/src/templates/invoice/host-invoice.d.ts +9 -0
- package/dist/src/templates/invoice/invoice-details.d.ts +13 -0
- package/dist/src/templates/invoice/invoice-notes.d.ts +1 -0
- package/dist/src/templates/invoice/invoice-summary.d.ts +7 -0
- package/dist/src/templates/invoice/letter-head.d.ts +10 -0
- package/dist/src/templates/invoice/li.d.ts +10 -0
- package/dist/src/templates/invoice/platform-and-host-details.d.ts +11 -0
- package/dist/src/templates/invoice/spacer.d.ts +3 -0
- package/dist/src/templates/invoice/split-container-items.d.ts +10 -0
- package/dist/src/templates/invoice/split-container.d.ts +7 -0
- package/dist/src/templates/invoice/standard-page.d.ts +7 -0
- package/dist/src/templates/invoice/types.d.ts +3 -0
- package/dist/src/templates/invoice/ul.d.ts +8 -0
- package/dist/src/templates/invoice/utils.d.ts +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +34 -40
- package/src/config.ts +42 -0
- package/src/create-logger.ts +4 -0
- package/src/errors.ts +35 -0
- package/src/main.ts +7 -0
- package/src/preview/api.ts +33 -0
- package/src/preview/client/app.tsx +30 -0
- package/src/preview/client/invoice/invoice-display.tsx +27 -0
- package/src/preview/client/invoice/invoice-setup.tsx +95 -0
- package/src/preview/client/preview-targets.ts +30 -0
- package/src/preview/client/preview.tsx +37 -0
- package/src/preview/client/sidebar.tsx +39 -0
- package/src/preview/client/treaty.ts +8 -0
- package/src/preview/client/use-target.ts +11 -0
- package/src/preview/fonts/GOTHAM-BLACK.TTF +0 -0
- package/src/preview/fonts/GOTHAM-BLACKITALIC.TTF +0 -0
- package/src/preview/fonts/GOTHAM-BOLD.TTF +0 -0
- package/src/preview/fonts/GOTHAM-BOLDITALIC.TTF +0 -0
- package/src/preview/fonts/GOTHAM-LIGHT.TTF +0 -0
- package/src/preview/fonts/GOTHAM-LIGHTITALIC.TTF +0 -0
- package/src/preview/fonts/GOTHAM-MEDIUM.TTF +0 -0
- package/src/preview/fonts/GOTHAM-MEDIUMITALIC.TTF +0 -0
- package/src/preview/fonts/GOTHAM-THIN.TTF +0 -0
- package/src/preview/fonts/GOTHAM-THINITALIC.TTF +0 -0
- package/src/preview/fonts/GOTHAM-ULTRA.TTF +0 -0
- package/src/preview/fonts/GOTHAM-ULTRAITALIC.TTF +0 -0
- package/src/preview/fonts/GOTHAM-XLIGHT.TTF +0 -0
- package/src/preview/fonts/GOTHAM-XLIGHTITALIC.TTF +0 -0
- package/src/preview/fonts/Gotham Book Italic.otf +0 -0
- package/src/preview/fonts/Gotham-BoldItalic.otf +0 -0
- package/src/preview/fonts/Gotham-Book.otf +0 -0
- package/src/preview/fonts/Gotham-BookItalic.otf +0 -0
- package/src/preview/fonts/Gotham-ExtraLight.otf +0 -0
- package/src/preview/fonts/Gotham-ExtraLightItalic.otf +0 -0
- package/src/preview/fonts/Gotham-Light.otf +0 -0
- package/src/preview/fonts/Gotham-LightItalic.otf +0 -0
- package/src/preview/fonts/Gotham-Medium.otf +0 -0
- package/src/preview/fonts/Gotham-MediumItalic.otf +0 -0
- package/src/preview/fonts/Gotham-Thin.otf +0 -0
- package/src/preview/fonts/Gotham-ThinItalic.otf +0 -0
- package/src/preview/fonts/Gotham-Ultra.otf +0 -0
- package/src/preview/fonts/Gotham-UltraItalic.otf +0 -0
- package/src/preview/fonts/GothamNarrow-Black.otf +0 -0
- package/src/preview/fonts/GothamNarrow-BlackItalic.otf +0 -0
- package/src/preview/fonts/GothamNarrow-Book.otf +0 -0
- package/src/preview/fonts/GothamNarrow-BookItalic.otf +0 -0
- package/src/preview/fonts/GothamNarrow-Light.otf +0 -0
- package/src/preview/fonts/GothamNarrow-LightItalic.otf +0 -0
- package/src/preview/fonts/GothamNarrow-Medium.otf +0 -0
- package/src/preview/fonts/GothamNarrow-MediumItalic.otf +0 -0
- package/src/preview/fonts/GothamNarrow-Thin.otf +0 -0
- package/src/preview/fonts/GothamNarrow-ThinItalic.otf +0 -0
- package/src/preview/fonts/GothamNarrow-Ultra.otf +0 -0
- package/src/preview/fonts/GothamNarrow-UltraItalic.otf +0 -0
- package/src/preview/fonts/GothamNarrow-XLight.otf +0 -0
- package/src/preview/fonts/GothamNarrow-XLightItalic.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-bold-italic.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-bold.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-book-italic.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-book.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-light-italic.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-light.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-medium-italic.otf +0 -0
- package/src/preview/fonts/gotham-extra-narrow-medium.otf +0 -0
- package/src/preview/fonts/gotham-rounded-bold-italic.otf +0 -0
- package/src/preview/fonts/gotham-rounded-bold.otf +0 -0
- package/src/preview/fonts/gotham-rounded-book-italic.otf +0 -0
- package/src/preview/fonts/gotham-rounded-book.otf +0 -0
- package/src/preview/fonts/gotham-rounded-light-italic.otf +0 -0
- package/src/preview/fonts/gotham-rounded-light.otf +0 -0
- package/src/preview/fonts/gotham-rounded-medium-italic.otf +0 -0
- package/src/preview/fonts/gotham-rounded-medium.otf +0 -0
- package/src/preview/fonts/register-fonts.ts +395 -0
- package/src/preview/frontend.tsx +23 -0
- package/src/preview/global.css +39 -0
- package/src/preview/preview.html +12 -0
- package/src/preview/server.ts +28 -0
- package/src/repository.ts +39 -0
- package/src/templates/invoice/E Invoice Format.pdf +0 -0
- package/src/templates/invoice/colors.ts +6 -0
- package/src/templates/invoice/company-details.tsx +124 -0
- package/src/templates/invoice/flux-invoice.tsx +134 -0
- package/src/templates/invoice/footer.tsx +46 -0
- package/src/templates/invoice/host-invoice.tsx +134 -0
- package/src/templates/invoice/images/logo.png +0 -0
- package/src/templates/invoice/images/logo.svg +41 -0
- package/src/templates/invoice/invoice-details.tsx +231 -0
- package/src/templates/invoice/invoice-notes.tsx +74 -0
- package/src/templates/invoice/invoice-summary.tsx +135 -0
- package/src/templates/invoice/letter-head.tsx +132 -0
- package/src/templates/invoice/li.tsx +48 -0
- package/src/templates/invoice/platform-and-host-details.tsx +56 -0
- package/src/templates/invoice/spacer.tsx +5 -0
- package/src/templates/invoice/split-container-items.tsx +80 -0
- package/src/templates/invoice/split-container.tsx +35 -0
- package/src/templates/invoice/standard-page.tsx +45 -0
- package/src/templates/invoice/types.ts +6 -0
- package/src/templates/invoice/ul.tsx +19 -0
- package/src/templates/invoice/utils.ts +5 -0
- package/tsconfig.json +21 -0
- package/dist/components/FluxLogo.d.ts +0 -3
- package/dist/components/FluxLogo.d.ts.map +0 -1
- package/dist/components/FluxLogo.js +0 -66
- package/dist/components/FluxLogo.js.map +0 -1
- package/dist/components/StandardPage.d.ts +0 -7
- package/dist/components/StandardPage.d.ts.map +0 -1
- package/dist/components/StandardPage.js +0 -132
- package/dist/components/StandardPage.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts +0 -10
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -165
- package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js.map +0 -1
- package/dist/templates/QuotationPdf/GFV.d.ts +0 -10
- package/dist/templates/QuotationPdf/GFV.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/GFV.js +0 -61
- package/dist/templates/QuotationPdf/GFV.js.map +0 -1
- package/dist/templates/QuotationPdf/Header.d.ts +0 -9
- package/dist/templates/QuotationPdf/Header.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/Header.js +0 -71
- package/dist/templates/QuotationPdf/Header.js.map +0 -1
- package/dist/templates/QuotationPdf/Pricing.d.ts +0 -10
- package/dist/templates/QuotationPdf/Pricing.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/Pricing.js +0 -723
- package/dist/templates/QuotationPdf/Pricing.js.map +0 -1
- package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts +0 -8
- package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/QuotationPdfPage.js +0 -30
- package/dist/templates/QuotationPdf/QuotationPdfPage.js.map +0 -1
- package/dist/templates/QuotationPdf/SectionBoxNew.d.ts +0 -9
- package/dist/templates/QuotationPdf/SectionBoxNew.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/SectionBoxNew.js +0 -38
- package/dist/templates/QuotationPdf/SectionBoxNew.js.map +0 -1
- package/dist/templates/QuotationPdf/TermsSection.d.ts +0 -8
- package/dist/templates/QuotationPdf/TermsSection.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/TermsSection.js +0 -50
- package/dist/templates/QuotationPdf/TermsSection.js.map +0 -1
- package/dist/templates/QuotationPdf/VehiclePhotos.d.ts +0 -10
- package/dist/templates/QuotationPdf/VehiclePhotos.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/VehiclePhotos.js +0 -66
- package/dist/templates/QuotationPdf/VehiclePhotos.js.map +0 -1
- package/dist/templates/QuotationPdf/index.d.ts +0 -12
- package/dist/templates/QuotationPdf/index.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/index.js +0 -214
- package/dist/templates/QuotationPdf/index.js.map +0 -1
- package/dist/templates/QuotationPdf/translations.d.ts +0 -68
- package/dist/templates/QuotationPdf/translations.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/translations.js +0 -101
- package/dist/templates/QuotationPdf/translations.js.map +0 -1
- package/dist/templates/QuotationPdf/utils.d.ts +0 -14
- package/dist/templates/QuotationPdf/utils.d.ts.map +0 -1
- package/dist/templates/QuotationPdf/utils.js +0 -152
- package/dist/templates/QuotationPdf/utils.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +0 -12
- package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/Confirmation.js +0 -80
- package/dist/templates/SubscriptionAgreement/Confirmation.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +0 -14
- package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/CoverPage.js +0 -111
- package/dist/templates/SubscriptionAgreement/CoverPage.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts +0 -7
- package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js +0 -25
- package/dist/templates/SubscriptionAgreement/CoverPageSection.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/Details.d.ts +0 -10
- package/dist/templates/SubscriptionAgreement/Details.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/Details.js +0 -223
- package/dist/templates/SubscriptionAgreement/Details.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/Footer.d.ts +0 -10
- package/dist/templates/SubscriptionAgreement/Footer.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/Footer.js +0 -58
- package/dist/templates/SubscriptionAgreement/Footer.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/Header.d.ts +0 -10
- package/dist/templates/SubscriptionAgreement/Header.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/Header.js +0 -46
- package/dist/templates/SubscriptionAgreement/Header.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/LabelValue.d.ts +0 -8
- package/dist/templates/SubscriptionAgreement/LabelValue.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/LabelValue.js +0 -29
- package/dist/templates/SubscriptionAgreement/LabelValue.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts +0 -10
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -33
- package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +0 -8
- package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js +0 -101
- package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts +0 -12
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -103
- package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/index.d.ts +0 -13
- package/dist/templates/SubscriptionAgreement/index.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/index.js +0 -271
- package/dist/templates/SubscriptionAgreement/index.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/translations.d.ts +0 -78
- package/dist/templates/SubscriptionAgreement/translations.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/translations.js +0 -662
- package/dist/templates/SubscriptionAgreement/translations.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/types.d.ts +0 -7
- package/dist/templates/SubscriptionAgreement/types.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/types.js +0 -1
- package/dist/templates/SubscriptionAgreement/types.js.map +0 -1
- package/dist/templates/SubscriptionAgreement/utils.d.ts +0 -6
- package/dist/templates/SubscriptionAgreement/utils.d.ts.map +0 -1
- package/dist/templates/SubscriptionAgreement/utils.js +0 -37
- package/dist/templates/SubscriptionAgreement/utils.js.map +0 -1
- package/dist/templates/index.d.ts +0 -3
- package/dist/templates/index.d.ts.map +0 -1
- package/dist/templates/index.js +0 -2
- package/dist/templates/index.js.map +0 -1
- package/dist/theme/colors.d.ts +0 -148
- package/dist/theme/colors.d.ts.map +0 -1
- package/dist/theme/colors.js +0 -137
- package/dist/theme/colors.js.map +0 -1
- package/dist/theme/index.d.ts +0 -2
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -1
- package/dist/theme/index.js.map +0 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -10
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -175
- package/dist/utils.js.map +0 -1
- package/dist/watch.d.ts +0 -2
- package/dist/watch.d.ts.map +0 -1
- package/dist/watch.js +0 -11
- package/dist/watch.js.map +0 -1
package/.env
ADDED
|
File without changes
|
package/.env.development
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
$ bun run ./build.ts
|
|
2
|
+
[38;5;142m[dotenvx@1.51.1] injecting env (3) from .env.development, .env[39m
|
|
3
|
+
🔍 Scanning folder: ./dist
|
|
4
|
+
📄 Found 1 JS files to process
|
|
5
|
+
|
|
6
|
+
📊 Processing Summary:
|
|
7
|
+
Files processed: 1
|
|
8
|
+
Total exports found: 1
|
|
9
|
+
Duplicates removed: 0
|
|
10
|
+
Total processing time: 0.83ms
|
|
11
|
+
Average time per file: 0.83ms
|
|
12
|
+
|
|
13
|
+
✅ No duplicate exports found in any files
|
|
14
|
+
✅ Build successful
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @driveflux/pdf
|
|
2
|
+
|
|
3
|
+
## 5.0.0-feature-e-invoicing.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 5903282: E-invoice pdf
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 60bddb1: E-invoicing init
|
|
12
|
+
- e42b788: status fixes
|
|
13
|
+
- Updated dependencies [60bddb1]
|
|
14
|
+
- Updated dependencies [5903282]
|
|
15
|
+
- @driveflux/db@4.0.24-feature-e-invoicing.0
|
package/build.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { readdirSync, rmdirSync, statSync, unlinkSync } from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { autoRemoveDuplicateExports } from '@driveflux/fix-builds'
|
|
4
|
+
import type { Target } from 'bun'
|
|
5
|
+
|
|
6
|
+
// Clean the dist directory
|
|
7
|
+
const outdir = './dist'
|
|
8
|
+
const clearDir = (dir: string) => {
|
|
9
|
+
try {
|
|
10
|
+
const files = readdirSync(dir)
|
|
11
|
+
for (const file of files) {
|
|
12
|
+
if (file.endsWith('.js') || file.endsWith('.js.map')) {
|
|
13
|
+
unlinkSync(path.join(dir, file))
|
|
14
|
+
} else {
|
|
15
|
+
try {
|
|
16
|
+
if (statSync(path.join(dir, file)).isDirectory()) {
|
|
17
|
+
clearDir(path.join(dir, file))
|
|
18
|
+
rmdirSync(path.join(dir, file))
|
|
19
|
+
}
|
|
20
|
+
} catch (_error) {
|
|
21
|
+
// Directory might not exist, that's fine
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} catch (_error) {
|
|
26
|
+
// Directory might not exist, that's fine
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
clearDir(outdir)
|
|
30
|
+
|
|
31
|
+
await Bun.build({
|
|
32
|
+
entrypoints: ['./src/main.ts'],
|
|
33
|
+
root: './src',
|
|
34
|
+
plugins: [],
|
|
35
|
+
packages: 'external',
|
|
36
|
+
outdir,
|
|
37
|
+
target: (process.env.BUILD_TARGET as Target) ?? 'bun',
|
|
38
|
+
splitting: true,
|
|
39
|
+
minify: process.env.CI === 'true' || process.env.CI === '1',
|
|
40
|
+
sourcemap: 'linked',
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
await autoRemoveDuplicateExports(outdir)
|
|
44
|
+
|
|
45
|
+
console.info('✅ Build successful')
|
package/bun-env.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare module '*.woff' {
|
|
2
|
+
const content: string
|
|
3
|
+
export default content
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module '*.otf' {
|
|
7
|
+
const content: string
|
|
8
|
+
export default content
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module '*.TTF' {
|
|
12
|
+
const content: string
|
|
13
|
+
export default content
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '*.ttf' {
|
|
17
|
+
const content: string
|
|
18
|
+
export default content
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module '*.svg' {
|
|
22
|
+
const content: string
|
|
23
|
+
export default content
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module '*.png' {
|
|
27
|
+
const content: string
|
|
28
|
+
export default content
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare module '*.jpg' {
|
|
32
|
+
const content: string
|
|
33
|
+
export default content
|
|
34
|
+
}
|
package/bunfig.toml
ADDED
package/dist/main.js
ADDED
package/dist/main.js.map
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/create-logger.ts", "../src/main.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { createLogger } from '@driveflux/logger'\n\nexport const createScopedLogger = (name: string) =>\n createLogger(`flux:pdf:${name}`)\n",
|
|
6
|
+
"import { createScopedLogger } from './create-logger'\n\nconst _log = createScopedLogger('main')\n\nexport const main = () => {\n console.info('Hello, world!')\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": "AAAA,uBAAS,0BAEF,IAAM,EAAqB,CAAC,IACjC,EAAa,YAAY,GAAM,ECDjC,IAAM,EAAO,EAAmB,MAAM,EAEzB,EAAO,IAAM,CACxB,QAAQ,KAAK,eAAe",
|
|
9
|
+
"debugId": "E2E1AD01A670738764756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __pdfConfig: Config;
|
|
3
|
+
}
|
|
4
|
+
export type Config = (typeof Config)['infer'];
|
|
5
|
+
export declare const Config: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
6
|
+
appUrl: string;
|
|
7
|
+
timezone: string;
|
|
8
|
+
}, {}>;
|
|
9
|
+
export declare let config: {
|
|
10
|
+
appUrl: string;
|
|
11
|
+
timezone: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const loadConfig: () => {
|
|
14
|
+
appUrl: string;
|
|
15
|
+
timezone: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const setConfig: <K extends keyof Config>(key: K, value: Config[K]) => {
|
|
18
|
+
appUrl: string;
|
|
19
|
+
timezone: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createScopedLogger: (name: string) => import("@driveflux/logger").pino.Logger;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare abstract class PDFError extends Error {
|
|
2
|
+
abstract readonly code: string;
|
|
3
|
+
abstract readonly status: number;
|
|
4
|
+
toResponse(): Response;
|
|
5
|
+
}
|
|
6
|
+
export declare const PDFErrors: {
|
|
7
|
+
readonly InvoiceNotEInvoice: {
|
|
8
|
+
new (invoiceId: string): {
|
|
9
|
+
readonly code: "invoice_not_einvoice";
|
|
10
|
+
readonly status: 400;
|
|
11
|
+
readonly invoiceId: string;
|
|
12
|
+
toResponse(): Response;
|
|
13
|
+
name: string;
|
|
14
|
+
message: string;
|
|
15
|
+
stack?: string;
|
|
16
|
+
cause?: unknown;
|
|
17
|
+
};
|
|
18
|
+
isError(error: unknown): error is Error;
|
|
19
|
+
isError(value: unknown): value is Error;
|
|
20
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
21
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
22
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
23
|
+
stackTraceLimit: number;
|
|
24
|
+
};
|
|
25
|
+
readonly InvoiceNotFound: {
|
|
26
|
+
new (invoiceId: string): {
|
|
27
|
+
readonly code: "invoice_not_found";
|
|
28
|
+
readonly status: 404;
|
|
29
|
+
readonly invoiceId: string;
|
|
30
|
+
toResponse(): Response;
|
|
31
|
+
name: string;
|
|
32
|
+
message: string;
|
|
33
|
+
stack?: string;
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
};
|
|
36
|
+
isError(error: unknown): error is Error;
|
|
37
|
+
isError(value: unknown): value is Error;
|
|
38
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
39
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
40
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
41
|
+
stackTraceLimit: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const main: () => void;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import Elysia from 'elysia';
|
|
2
|
+
export declare const api: Elysia<"", {
|
|
3
|
+
decorator: {};
|
|
4
|
+
store: {};
|
|
5
|
+
derive: {};
|
|
6
|
+
resolve: {};
|
|
7
|
+
}, {
|
|
8
|
+
typebox: {};
|
|
9
|
+
error: {
|
|
10
|
+
readonly InvoiceNotEInvoice: {
|
|
11
|
+
readonly code: "invoice_not_einvoice";
|
|
12
|
+
readonly status: 400;
|
|
13
|
+
readonly invoiceId: string;
|
|
14
|
+
toResponse(): Response;
|
|
15
|
+
name: string;
|
|
16
|
+
message: string;
|
|
17
|
+
stack?: string;
|
|
18
|
+
cause?: unknown;
|
|
19
|
+
};
|
|
20
|
+
readonly InvoiceNotFound: {
|
|
21
|
+
readonly code: "invoice_not_found";
|
|
22
|
+
readonly status: 404;
|
|
23
|
+
readonly invoiceId: string;
|
|
24
|
+
toResponse(): Response;
|
|
25
|
+
name: string;
|
|
26
|
+
message: string;
|
|
27
|
+
stack?: string;
|
|
28
|
+
cause?: unknown;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}, {
|
|
32
|
+
schema: {};
|
|
33
|
+
standaloneSchema: {};
|
|
34
|
+
macro: {};
|
|
35
|
+
macroFn: {};
|
|
36
|
+
parser: {};
|
|
37
|
+
response: {};
|
|
38
|
+
}, {
|
|
39
|
+
api: {
|
|
40
|
+
"invoice-for-pdf": {
|
|
41
|
+
":invoiceId": {
|
|
42
|
+
get: {
|
|
43
|
+
body: unknown;
|
|
44
|
+
params: {
|
|
45
|
+
invoiceId: string;
|
|
46
|
+
};
|
|
47
|
+
query: unknown;
|
|
48
|
+
headers: unknown;
|
|
49
|
+
response: {
|
|
50
|
+
400: {
|
|
51
|
+
readonly code: "invoice_not_einvoice" | "invoice_not_found";
|
|
52
|
+
readonly context: "PDFError";
|
|
53
|
+
readonly message: string;
|
|
54
|
+
};
|
|
55
|
+
404: {
|
|
56
|
+
readonly code: "invoice_not_einvoice" | "invoice_not_found";
|
|
57
|
+
readonly context: "PDFError";
|
|
58
|
+
readonly message: string;
|
|
59
|
+
};
|
|
60
|
+
200: Omit<{
|
|
61
|
+
date: Date;
|
|
62
|
+
id: string;
|
|
63
|
+
eInvoice: {
|
|
64
|
+
poNumber: string | null;
|
|
65
|
+
fluxDetails: {
|
|
66
|
+
invoiceNumber: string;
|
|
67
|
+
poNumber: string | null;
|
|
68
|
+
companyNumber: string | null;
|
|
69
|
+
companyName: string;
|
|
70
|
+
id: string | null;
|
|
71
|
+
sstNo: string | null;
|
|
72
|
+
tinNo: string | null;
|
|
73
|
+
address: string;
|
|
74
|
+
} & {
|
|
75
|
+
lines: {
|
|
76
|
+
description: string;
|
|
77
|
+
amount: number;
|
|
78
|
+
discountedAmount: number | null;
|
|
79
|
+
promoCode: string | null;
|
|
80
|
+
taxAmount: number;
|
|
81
|
+
total: number;
|
|
82
|
+
}[];
|
|
83
|
+
};
|
|
84
|
+
hostDetails: ({
|
|
85
|
+
invoiceNumber: string;
|
|
86
|
+
poNumber: string | null;
|
|
87
|
+
companyNumber: string | null;
|
|
88
|
+
companyName: string;
|
|
89
|
+
id: string | null;
|
|
90
|
+
sstNo: string | null;
|
|
91
|
+
tinNo: string | null;
|
|
92
|
+
address: string;
|
|
93
|
+
} & {
|
|
94
|
+
lines: {
|
|
95
|
+
description: string;
|
|
96
|
+
amount: number;
|
|
97
|
+
discountedAmount: number | null;
|
|
98
|
+
promoCode: string | null;
|
|
99
|
+
taxAmount: number;
|
|
100
|
+
total: number;
|
|
101
|
+
}[];
|
|
102
|
+
}) | null;
|
|
103
|
+
vehicle: {
|
|
104
|
+
plateNumber: string;
|
|
105
|
+
name: string;
|
|
106
|
+
color: string;
|
|
107
|
+
};
|
|
108
|
+
linesSummary: {
|
|
109
|
+
description: string;
|
|
110
|
+
amount: number;
|
|
111
|
+
discountedAmount: number | null;
|
|
112
|
+
promoCode: string | null;
|
|
113
|
+
}[];
|
|
114
|
+
} | null;
|
|
115
|
+
payerName: string;
|
|
116
|
+
payerEmail: string;
|
|
117
|
+
payerPhoneNumber: string | null;
|
|
118
|
+
billingAddress: {
|
|
119
|
+
name: string | null;
|
|
120
|
+
street1: string;
|
|
121
|
+
street2: string | null;
|
|
122
|
+
city: string;
|
|
123
|
+
state: string;
|
|
124
|
+
country: string;
|
|
125
|
+
postalCode: string;
|
|
126
|
+
} | null;
|
|
127
|
+
lines: {
|
|
128
|
+
id: string;
|
|
129
|
+
object: import("@driveflux/db").InvoiceLineObject;
|
|
130
|
+
taxPercentage: number;
|
|
131
|
+
amount: number;
|
|
132
|
+
discountAmount: number | null;
|
|
133
|
+
amountAfterTax: number;
|
|
134
|
+
taxAmount: number;
|
|
135
|
+
discountRatio: number;
|
|
136
|
+
subTotal: number;
|
|
137
|
+
total: number;
|
|
138
|
+
description: string;
|
|
139
|
+
quantity: number;
|
|
140
|
+
periodStart: Date | null;
|
|
141
|
+
periodEnd: Date | null;
|
|
142
|
+
isProration: boolean;
|
|
143
|
+
chargingFor: string | null;
|
|
144
|
+
exemptFromTax: boolean;
|
|
145
|
+
appliedDiscountId: string | null;
|
|
146
|
+
couponCode: string | null;
|
|
147
|
+
metadata: PrismaJson.SimpleMetadata | null;
|
|
148
|
+
plan: string | null;
|
|
149
|
+
mileagePackage: string | null;
|
|
150
|
+
subscriptionId: string | null;
|
|
151
|
+
cycleId: string | null;
|
|
152
|
+
vehicleId: string | null;
|
|
153
|
+
excessMileage: number | null;
|
|
154
|
+
suggestedPayoutAmount: number | null;
|
|
155
|
+
payoutId: string | null;
|
|
156
|
+
payoutLineId: string | null;
|
|
157
|
+
depositNoOfMonths: number | null;
|
|
158
|
+
}[];
|
|
159
|
+
total: number;
|
|
160
|
+
paid: boolean;
|
|
161
|
+
paidAt: Date | null;
|
|
162
|
+
createdAt: Date;
|
|
163
|
+
subscriptionDetails: {
|
|
164
|
+
subscriptionId: string | null;
|
|
165
|
+
vehicleId: string;
|
|
166
|
+
make: string;
|
|
167
|
+
vehicleModel: string;
|
|
168
|
+
variant: string;
|
|
169
|
+
year: number;
|
|
170
|
+
plan: import("@driveflux/db").PlanType;
|
|
171
|
+
mileagePackage: import("@driveflux/db").MileagePackage;
|
|
172
|
+
} | null;
|
|
173
|
+
}, "eInvoice"> & {
|
|
174
|
+
eInvoice: NonNullable<{
|
|
175
|
+
poNumber: string | null;
|
|
176
|
+
fluxDetails: {
|
|
177
|
+
invoiceNumber: string;
|
|
178
|
+
poNumber: string | null;
|
|
179
|
+
companyNumber: string | null;
|
|
180
|
+
companyName: string;
|
|
181
|
+
id: string | null;
|
|
182
|
+
sstNo: string | null;
|
|
183
|
+
tinNo: string | null;
|
|
184
|
+
address: string;
|
|
185
|
+
} & {
|
|
186
|
+
lines: {
|
|
187
|
+
description: string;
|
|
188
|
+
amount: number;
|
|
189
|
+
discountedAmount: number | null;
|
|
190
|
+
promoCode: string | null;
|
|
191
|
+
taxAmount: number;
|
|
192
|
+
total: number;
|
|
193
|
+
}[];
|
|
194
|
+
};
|
|
195
|
+
hostDetails: ({
|
|
196
|
+
invoiceNumber: string;
|
|
197
|
+
poNumber: string | null;
|
|
198
|
+
companyNumber: string | null;
|
|
199
|
+
companyName: string;
|
|
200
|
+
id: string | null;
|
|
201
|
+
sstNo: string | null;
|
|
202
|
+
tinNo: string | null;
|
|
203
|
+
address: string;
|
|
204
|
+
} & {
|
|
205
|
+
lines: {
|
|
206
|
+
description: string;
|
|
207
|
+
amount: number;
|
|
208
|
+
discountedAmount: number | null;
|
|
209
|
+
promoCode: string | null;
|
|
210
|
+
taxAmount: number;
|
|
211
|
+
total: number;
|
|
212
|
+
}[];
|
|
213
|
+
}) | null;
|
|
214
|
+
vehicle: {
|
|
215
|
+
plateNumber: string;
|
|
216
|
+
name: string;
|
|
217
|
+
color: string;
|
|
218
|
+
};
|
|
219
|
+
linesSummary: {
|
|
220
|
+
description: string;
|
|
221
|
+
amount: number;
|
|
222
|
+
discountedAmount: number | null;
|
|
223
|
+
promoCode: string | null;
|
|
224
|
+
}[];
|
|
225
|
+
}>;
|
|
226
|
+
};
|
|
227
|
+
422: {
|
|
228
|
+
type: "validation";
|
|
229
|
+
on: string;
|
|
230
|
+
summary?: string;
|
|
231
|
+
message?: string;
|
|
232
|
+
found?: unknown;
|
|
233
|
+
property?: string;
|
|
234
|
+
expected?: string;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
}, {
|
|
242
|
+
derive: {};
|
|
243
|
+
resolve: {};
|
|
244
|
+
schema: {};
|
|
245
|
+
standaloneSchema: {};
|
|
246
|
+
response: {};
|
|
247
|
+
}, {
|
|
248
|
+
derive: {};
|
|
249
|
+
resolve: {};
|
|
250
|
+
schema: {};
|
|
251
|
+
standaloneSchema: {};
|
|
252
|
+
response: {
|
|
253
|
+
400: {
|
|
254
|
+
readonly code: "invoice_not_einvoice" | "invoice_not_found";
|
|
255
|
+
readonly context: "PDFError";
|
|
256
|
+
readonly message: string;
|
|
257
|
+
};
|
|
258
|
+
404: {
|
|
259
|
+
readonly code: "invoice_not_einvoice" | "invoice_not_found";
|
|
260
|
+
readonly context: "PDFError";
|
|
261
|
+
readonly message: string;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InvoiceDisplayProps } from './invoice-display';
|
|
2
|
+
type Props = {
|
|
3
|
+
onPropsUpdated: (props: InvoiceDisplayProps | {
|
|
4
|
+
error: string;
|
|
5
|
+
}) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const InvoiceSetup: ({ onPropsUpdated }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const PREVIEW_TARGETS: {
|
|
2
|
+
readonly invoice: {
|
|
3
|
+
readonly title: "Invoice";
|
|
4
|
+
readonly Setup: ({ onPropsUpdated }: {
|
|
5
|
+
onPropsUpdated: (props: import("./invoice/invoice-display").InvoiceDisplayProps | {
|
|
6
|
+
error: string;
|
|
7
|
+
}) => void;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
readonly Display: ({ invoice }: import("./invoice/invoice-display").InvoiceDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type PreviewTarget = keyof typeof PREVIEW_TARGETS;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PreviewTarget } from './preview-targets';
|
|
2
|
+
type Props = {
|
|
3
|
+
onSelect: (target: PreviewTarget) => void;
|
|
4
|
+
selectedTarget?: PreviewTarget | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const Sidebar: ({ onSelect, selectedTarget }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|