@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.
Files changed (282) hide show
  1. package/.env +0 -0
  2. package/.env.development +4 -0
  3. package/.turbo/turbo-build.log +14 -0
  4. package/CHANGELOG.md +15 -0
  5. package/build.ts +45 -0
  6. package/bun-env.d.ts +34 -0
  7. package/bunfig.toml +8 -0
  8. package/catalog-version-stamp.json +8 -0
  9. package/dist/main.js +4 -0
  10. package/dist/main.js.map +11 -0
  11. package/dist/src/config.d.ts +20 -0
  12. package/dist/src/create-logger.d.ts +1 -0
  13. package/dist/src/errors.d.ts +43 -0
  14. package/dist/src/main.d.ts +1 -0
  15. package/dist/src/preview/api.d.ts +264 -0
  16. package/dist/src/preview/client/app.d.ts +2 -0
  17. package/dist/src/preview/client/invoice/invoice-display.d.ts +5 -0
  18. package/dist/src/preview/client/invoice/invoice-setup.d.ts +8 -0
  19. package/dist/src/preview/client/preview-targets.d.ts +12 -0
  20. package/dist/src/preview/client/preview.d.ts +6 -0
  21. package/dist/src/preview/client/sidebar.d.ts +7 -0
  22. package/dist/src/preview/client/treaty.d.ts +200 -0
  23. package/dist/src/preview/client/use-target.d.ts +1 -0
  24. package/dist/src/preview/fonts/register-fonts.d.ts +1 -0
  25. package/dist/src/preview/frontend.d.ts +1 -0
  26. package/dist/src/preview/server.d.ts +1 -0
  27. package/dist/src/repository.d.ts +171 -0
  28. package/dist/src/templates/invoice/colors.d.ts +6 -0
  29. package/dist/src/templates/invoice/company-details.d.ts +10 -0
  30. package/dist/src/templates/invoice/flux-invoice.d.ts +6 -0
  31. package/dist/src/templates/invoice/footer.d.ts +2 -0
  32. package/dist/src/templates/invoice/host-invoice.d.ts +9 -0
  33. package/dist/src/templates/invoice/invoice-details.d.ts +13 -0
  34. package/dist/src/templates/invoice/invoice-notes.d.ts +1 -0
  35. package/dist/src/templates/invoice/invoice-summary.d.ts +7 -0
  36. package/dist/src/templates/invoice/letter-head.d.ts +10 -0
  37. package/dist/src/templates/invoice/li.d.ts +10 -0
  38. package/dist/src/templates/invoice/platform-and-host-details.d.ts +11 -0
  39. package/dist/src/templates/invoice/spacer.d.ts +3 -0
  40. package/dist/src/templates/invoice/split-container-items.d.ts +10 -0
  41. package/dist/src/templates/invoice/split-container.d.ts +7 -0
  42. package/dist/src/templates/invoice/standard-page.d.ts +7 -0
  43. package/dist/src/templates/invoice/types.d.ts +3 -0
  44. package/dist/src/templates/invoice/ul.d.ts +8 -0
  45. package/dist/src/templates/invoice/utils.d.ts +2 -0
  46. package/dist/tsconfig.tsbuildinfo +1 -0
  47. package/package.json +34 -40
  48. package/src/config.ts +42 -0
  49. package/src/create-logger.ts +4 -0
  50. package/src/errors.ts +35 -0
  51. package/src/main.ts +7 -0
  52. package/src/preview/api.ts +33 -0
  53. package/src/preview/client/app.tsx +30 -0
  54. package/src/preview/client/invoice/invoice-display.tsx +27 -0
  55. package/src/preview/client/invoice/invoice-setup.tsx +95 -0
  56. package/src/preview/client/preview-targets.ts +30 -0
  57. package/src/preview/client/preview.tsx +37 -0
  58. package/src/preview/client/sidebar.tsx +39 -0
  59. package/src/preview/client/treaty.ts +8 -0
  60. package/src/preview/client/use-target.ts +11 -0
  61. package/src/preview/fonts/GOTHAM-BLACK.TTF +0 -0
  62. package/src/preview/fonts/GOTHAM-BLACKITALIC.TTF +0 -0
  63. package/src/preview/fonts/GOTHAM-BOLD.TTF +0 -0
  64. package/src/preview/fonts/GOTHAM-BOLDITALIC.TTF +0 -0
  65. package/src/preview/fonts/GOTHAM-LIGHT.TTF +0 -0
  66. package/src/preview/fonts/GOTHAM-LIGHTITALIC.TTF +0 -0
  67. package/src/preview/fonts/GOTHAM-MEDIUM.TTF +0 -0
  68. package/src/preview/fonts/GOTHAM-MEDIUMITALIC.TTF +0 -0
  69. package/src/preview/fonts/GOTHAM-THIN.TTF +0 -0
  70. package/src/preview/fonts/GOTHAM-THINITALIC.TTF +0 -0
  71. package/src/preview/fonts/GOTHAM-ULTRA.TTF +0 -0
  72. package/src/preview/fonts/GOTHAM-ULTRAITALIC.TTF +0 -0
  73. package/src/preview/fonts/GOTHAM-XLIGHT.TTF +0 -0
  74. package/src/preview/fonts/GOTHAM-XLIGHTITALIC.TTF +0 -0
  75. package/src/preview/fonts/Gotham Book Italic.otf +0 -0
  76. package/src/preview/fonts/Gotham-BoldItalic.otf +0 -0
  77. package/src/preview/fonts/Gotham-Book.otf +0 -0
  78. package/src/preview/fonts/Gotham-BookItalic.otf +0 -0
  79. package/src/preview/fonts/Gotham-ExtraLight.otf +0 -0
  80. package/src/preview/fonts/Gotham-ExtraLightItalic.otf +0 -0
  81. package/src/preview/fonts/Gotham-Light.otf +0 -0
  82. package/src/preview/fonts/Gotham-LightItalic.otf +0 -0
  83. package/src/preview/fonts/Gotham-Medium.otf +0 -0
  84. package/src/preview/fonts/Gotham-MediumItalic.otf +0 -0
  85. package/src/preview/fonts/Gotham-Thin.otf +0 -0
  86. package/src/preview/fonts/Gotham-ThinItalic.otf +0 -0
  87. package/src/preview/fonts/Gotham-Ultra.otf +0 -0
  88. package/src/preview/fonts/Gotham-UltraItalic.otf +0 -0
  89. package/src/preview/fonts/GothamNarrow-Black.otf +0 -0
  90. package/src/preview/fonts/GothamNarrow-BlackItalic.otf +0 -0
  91. package/src/preview/fonts/GothamNarrow-Book.otf +0 -0
  92. package/src/preview/fonts/GothamNarrow-BookItalic.otf +0 -0
  93. package/src/preview/fonts/GothamNarrow-Light.otf +0 -0
  94. package/src/preview/fonts/GothamNarrow-LightItalic.otf +0 -0
  95. package/src/preview/fonts/GothamNarrow-Medium.otf +0 -0
  96. package/src/preview/fonts/GothamNarrow-MediumItalic.otf +0 -0
  97. package/src/preview/fonts/GothamNarrow-Thin.otf +0 -0
  98. package/src/preview/fonts/GothamNarrow-ThinItalic.otf +0 -0
  99. package/src/preview/fonts/GothamNarrow-Ultra.otf +0 -0
  100. package/src/preview/fonts/GothamNarrow-UltraItalic.otf +0 -0
  101. package/src/preview/fonts/GothamNarrow-XLight.otf +0 -0
  102. package/src/preview/fonts/GothamNarrow-XLightItalic.otf +0 -0
  103. package/src/preview/fonts/gotham-extra-narrow-bold-italic.otf +0 -0
  104. package/src/preview/fonts/gotham-extra-narrow-bold.otf +0 -0
  105. package/src/preview/fonts/gotham-extra-narrow-book-italic.otf +0 -0
  106. package/src/preview/fonts/gotham-extra-narrow-book.otf +0 -0
  107. package/src/preview/fonts/gotham-extra-narrow-light-italic.otf +0 -0
  108. package/src/preview/fonts/gotham-extra-narrow-light.otf +0 -0
  109. package/src/preview/fonts/gotham-extra-narrow-medium-italic.otf +0 -0
  110. package/src/preview/fonts/gotham-extra-narrow-medium.otf +0 -0
  111. package/src/preview/fonts/gotham-rounded-bold-italic.otf +0 -0
  112. package/src/preview/fonts/gotham-rounded-bold.otf +0 -0
  113. package/src/preview/fonts/gotham-rounded-book-italic.otf +0 -0
  114. package/src/preview/fonts/gotham-rounded-book.otf +0 -0
  115. package/src/preview/fonts/gotham-rounded-light-italic.otf +0 -0
  116. package/src/preview/fonts/gotham-rounded-light.otf +0 -0
  117. package/src/preview/fonts/gotham-rounded-medium-italic.otf +0 -0
  118. package/src/preview/fonts/gotham-rounded-medium.otf +0 -0
  119. package/src/preview/fonts/register-fonts.ts +395 -0
  120. package/src/preview/frontend.tsx +23 -0
  121. package/src/preview/global.css +39 -0
  122. package/src/preview/preview.html +12 -0
  123. package/src/preview/server.ts +28 -0
  124. package/src/repository.ts +39 -0
  125. package/src/templates/invoice/E Invoice Format.pdf +0 -0
  126. package/src/templates/invoice/colors.ts +6 -0
  127. package/src/templates/invoice/company-details.tsx +124 -0
  128. package/src/templates/invoice/flux-invoice.tsx +134 -0
  129. package/src/templates/invoice/footer.tsx +46 -0
  130. package/src/templates/invoice/host-invoice.tsx +134 -0
  131. package/src/templates/invoice/images/logo.png +0 -0
  132. package/src/templates/invoice/images/logo.svg +41 -0
  133. package/src/templates/invoice/invoice-details.tsx +231 -0
  134. package/src/templates/invoice/invoice-notes.tsx +74 -0
  135. package/src/templates/invoice/invoice-summary.tsx +135 -0
  136. package/src/templates/invoice/letter-head.tsx +132 -0
  137. package/src/templates/invoice/li.tsx +48 -0
  138. package/src/templates/invoice/platform-and-host-details.tsx +56 -0
  139. package/src/templates/invoice/spacer.tsx +5 -0
  140. package/src/templates/invoice/split-container-items.tsx +80 -0
  141. package/src/templates/invoice/split-container.tsx +35 -0
  142. package/src/templates/invoice/standard-page.tsx +45 -0
  143. package/src/templates/invoice/types.ts +6 -0
  144. package/src/templates/invoice/ul.tsx +19 -0
  145. package/src/templates/invoice/utils.ts +5 -0
  146. package/tsconfig.json +21 -0
  147. package/dist/components/FluxLogo.d.ts +0 -3
  148. package/dist/components/FluxLogo.d.ts.map +0 -1
  149. package/dist/components/FluxLogo.js +0 -66
  150. package/dist/components/FluxLogo.js.map +0 -1
  151. package/dist/components/StandardPage.d.ts +0 -7
  152. package/dist/components/StandardPage.d.ts.map +0 -1
  153. package/dist/components/StandardPage.js +0 -132
  154. package/dist/components/StandardPage.js.map +0 -1
  155. package/dist/index.d.ts +0 -4
  156. package/dist/index.d.ts.map +0 -1
  157. package/dist/index.js +0 -3
  158. package/dist/index.js.map +0 -1
  159. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts +0 -10
  160. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +0 -1
  161. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -165
  162. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js.map +0 -1
  163. package/dist/templates/QuotationPdf/GFV.d.ts +0 -10
  164. package/dist/templates/QuotationPdf/GFV.d.ts.map +0 -1
  165. package/dist/templates/QuotationPdf/GFV.js +0 -61
  166. package/dist/templates/QuotationPdf/GFV.js.map +0 -1
  167. package/dist/templates/QuotationPdf/Header.d.ts +0 -9
  168. package/dist/templates/QuotationPdf/Header.d.ts.map +0 -1
  169. package/dist/templates/QuotationPdf/Header.js +0 -71
  170. package/dist/templates/QuotationPdf/Header.js.map +0 -1
  171. package/dist/templates/QuotationPdf/Pricing.d.ts +0 -10
  172. package/dist/templates/QuotationPdf/Pricing.d.ts.map +0 -1
  173. package/dist/templates/QuotationPdf/Pricing.js +0 -723
  174. package/dist/templates/QuotationPdf/Pricing.js.map +0 -1
  175. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts +0 -8
  176. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts.map +0 -1
  177. package/dist/templates/QuotationPdf/QuotationPdfPage.js +0 -30
  178. package/dist/templates/QuotationPdf/QuotationPdfPage.js.map +0 -1
  179. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts +0 -9
  180. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts.map +0 -1
  181. package/dist/templates/QuotationPdf/SectionBoxNew.js +0 -38
  182. package/dist/templates/QuotationPdf/SectionBoxNew.js.map +0 -1
  183. package/dist/templates/QuotationPdf/TermsSection.d.ts +0 -8
  184. package/dist/templates/QuotationPdf/TermsSection.d.ts.map +0 -1
  185. package/dist/templates/QuotationPdf/TermsSection.js +0 -50
  186. package/dist/templates/QuotationPdf/TermsSection.js.map +0 -1
  187. package/dist/templates/QuotationPdf/VehiclePhotos.d.ts +0 -10
  188. package/dist/templates/QuotationPdf/VehiclePhotos.d.ts.map +0 -1
  189. package/dist/templates/QuotationPdf/VehiclePhotos.js +0 -66
  190. package/dist/templates/QuotationPdf/VehiclePhotos.js.map +0 -1
  191. package/dist/templates/QuotationPdf/index.d.ts +0 -12
  192. package/dist/templates/QuotationPdf/index.d.ts.map +0 -1
  193. package/dist/templates/QuotationPdf/index.js +0 -214
  194. package/dist/templates/QuotationPdf/index.js.map +0 -1
  195. package/dist/templates/QuotationPdf/translations.d.ts +0 -68
  196. package/dist/templates/QuotationPdf/translations.d.ts.map +0 -1
  197. package/dist/templates/QuotationPdf/translations.js +0 -101
  198. package/dist/templates/QuotationPdf/translations.js.map +0 -1
  199. package/dist/templates/QuotationPdf/utils.d.ts +0 -14
  200. package/dist/templates/QuotationPdf/utils.d.ts.map +0 -1
  201. package/dist/templates/QuotationPdf/utils.js +0 -152
  202. package/dist/templates/QuotationPdf/utils.js.map +0 -1
  203. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +0 -12
  204. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +0 -1
  205. package/dist/templates/SubscriptionAgreement/Confirmation.js +0 -80
  206. package/dist/templates/SubscriptionAgreement/Confirmation.js.map +0 -1
  207. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +0 -14
  208. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +0 -1
  209. package/dist/templates/SubscriptionAgreement/CoverPage.js +0 -111
  210. package/dist/templates/SubscriptionAgreement/CoverPage.js.map +0 -1
  211. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts +0 -7
  212. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts.map +0 -1
  213. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +0 -25
  214. package/dist/templates/SubscriptionAgreement/CoverPageSection.js.map +0 -1
  215. package/dist/templates/SubscriptionAgreement/Details.d.ts +0 -10
  216. package/dist/templates/SubscriptionAgreement/Details.d.ts.map +0 -1
  217. package/dist/templates/SubscriptionAgreement/Details.js +0 -223
  218. package/dist/templates/SubscriptionAgreement/Details.js.map +0 -1
  219. package/dist/templates/SubscriptionAgreement/Footer.d.ts +0 -10
  220. package/dist/templates/SubscriptionAgreement/Footer.d.ts.map +0 -1
  221. package/dist/templates/SubscriptionAgreement/Footer.js +0 -58
  222. package/dist/templates/SubscriptionAgreement/Footer.js.map +0 -1
  223. package/dist/templates/SubscriptionAgreement/Header.d.ts +0 -10
  224. package/dist/templates/SubscriptionAgreement/Header.d.ts.map +0 -1
  225. package/dist/templates/SubscriptionAgreement/Header.js +0 -46
  226. package/dist/templates/SubscriptionAgreement/Header.js.map +0 -1
  227. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts +0 -8
  228. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts.map +0 -1
  229. package/dist/templates/SubscriptionAgreement/LabelValue.js +0 -29
  230. package/dist/templates/SubscriptionAgreement/LabelValue.js.map +0 -1
  231. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts +0 -10
  232. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts.map +0 -1
  233. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -33
  234. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js.map +0 -1
  235. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +0 -8
  236. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +0 -1
  237. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +0 -101
  238. package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +0 -1
  239. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts +0 -12
  240. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +0 -1
  241. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -103
  242. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js.map +0 -1
  243. package/dist/templates/SubscriptionAgreement/index.d.ts +0 -13
  244. package/dist/templates/SubscriptionAgreement/index.d.ts.map +0 -1
  245. package/dist/templates/SubscriptionAgreement/index.js +0 -271
  246. package/dist/templates/SubscriptionAgreement/index.js.map +0 -1
  247. package/dist/templates/SubscriptionAgreement/translations.d.ts +0 -78
  248. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +0 -1
  249. package/dist/templates/SubscriptionAgreement/translations.js +0 -662
  250. package/dist/templates/SubscriptionAgreement/translations.js.map +0 -1
  251. package/dist/templates/SubscriptionAgreement/types.d.ts +0 -7
  252. package/dist/templates/SubscriptionAgreement/types.d.ts.map +0 -1
  253. package/dist/templates/SubscriptionAgreement/types.js +0 -1
  254. package/dist/templates/SubscriptionAgreement/types.js.map +0 -1
  255. package/dist/templates/SubscriptionAgreement/utils.d.ts +0 -6
  256. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +0 -1
  257. package/dist/templates/SubscriptionAgreement/utils.js +0 -37
  258. package/dist/templates/SubscriptionAgreement/utils.js.map +0 -1
  259. package/dist/templates/index.d.ts +0 -3
  260. package/dist/templates/index.d.ts.map +0 -1
  261. package/dist/templates/index.js +0 -2
  262. package/dist/templates/index.js.map +0 -1
  263. package/dist/theme/colors.d.ts +0 -148
  264. package/dist/theme/colors.d.ts.map +0 -1
  265. package/dist/theme/colors.js +0 -137
  266. package/dist/theme/colors.js.map +0 -1
  267. package/dist/theme/index.d.ts +0 -2
  268. package/dist/theme/index.d.ts.map +0 -1
  269. package/dist/theme/index.js +0 -1
  270. package/dist/theme/index.js.map +0 -1
  271. package/dist/types.d.ts +0 -2
  272. package/dist/types.d.ts.map +0 -1
  273. package/dist/types.js +0 -1
  274. package/dist/types.js.map +0 -1
  275. package/dist/utils.d.ts +0 -10
  276. package/dist/utils.d.ts.map +0 -1
  277. package/dist/utils.js +0 -175
  278. package/dist/utils.js.map +0 -1
  279. package/dist/watch.d.ts +0 -2
  280. package/dist/watch.d.ts.map +0 -1
  281. package/dist/watch.js +0 -11
  282. package/dist/watch.js.map +0 -1
package/.env ADDED
File without changes
@@ -0,0 +1,4 @@
1
+ FLUX_PUBLIC_APP_URL=http://localhost:3000
2
+ DATABASE_URL="mongodb://localhost:27017,127.0.0.1:27018,127.0.0.1:27019/flux4?replicaSet=rs0&retryWrites=false&w=majority"
3
+
4
+ SINGLETON_DEBUG=false
@@ -0,0 +1,14 @@
1
+ $ bun run ./build.ts
2
+ [dotenvx@1.51.1] injecting env (3) from .env.development, .env
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
@@ -0,0 +1,8 @@
1
+ preload = ["@driveflux/env"]
2
+
3
+ [define]
4
+ "process.env.SINGLETON_DEBUG" = "false"
5
+
6
+ [serve.static]
7
+ env = "FLUX_PUBLIC_*"
8
+ plugins = ["bun-plugin-tailwind"]
@@ -0,0 +1,8 @@
1
+ {
2
+ "@date-fns/tz": "^1.4.1",
3
+ "@driveflux/singleton": "3.0.0",
4
+ "@types/bun": "^1.3",
5
+ "arktype": "^2.1.22",
6
+ "date-fns": "^4.1.0",
7
+ "typescript": "5.9.3"
8
+ }
package/dist/main.js ADDED
@@ -0,0 +1,4 @@
1
+ import{createLogger as r}from"@driveflux/logger";var o=(e)=>r(`flux:pdf:${e}`);var n=o("main"),p=()=>{console.info("Hello, world!")};export{p as main};
2
+
3
+ //# debugId=E2E1AD01A670738764756E2164756E21
4
+ //# sourceMappingURL=main.js.map
@@ -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,2 @@
1
+ import '../global.css';
2
+ export declare const App: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { InvoiceForPDF } from '../../../templates/invoice/types';
2
+ export type InvoiceDisplayProps = {
3
+ invoice: InvoiceForPDF;
4
+ };
5
+ export declare const InvoiceDisplay: ({ invoice }: InvoiceDisplayProps) => import("react/jsx-runtime").JSX.Element;
@@ -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,6 @@
1
+ import { type PreviewTarget } from './preview-targets';
2
+ type Props = {
3
+ target: PreviewTarget;
4
+ };
5
+ export declare const Preview: ({ target }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -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 {};