@voyant-travel/charters-react 0.117.2

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 (85) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +40 -0
  3. package/dist/client.d.ts +14 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +59 -0
  6. package/dist/components/apa-tracker.d.ts +18 -0
  7. package/dist/components/apa-tracker.d.ts.map +1 -0
  8. package/dist/components/apa-tracker.js +69 -0
  9. package/dist/components/charter-catalog-card.d.ts +13 -0
  10. package/dist/components/charter-catalog-card.d.ts.map +1 -0
  11. package/dist/components/charter-catalog-card.js +58 -0
  12. package/dist/components/external-badge.d.ts +13 -0
  13. package/dist/components/external-badge.d.ts.map +1 -0
  14. package/dist/components/external-badge.js +16 -0
  15. package/dist/components/voyage-suite-grid.d.ts +26 -0
  16. package/dist/components/voyage-suite-grid.d.ts.map +1 -0
  17. package/dist/components/voyage-suite-grid.js +77 -0
  18. package/dist/components/whole-yacht-quote-card.d.ts +21 -0
  19. package/dist/components/whole-yacht-quote-card.d.ts.map +1 -0
  20. package/dist/components/whole-yacht-quote-card.js +46 -0
  21. package/dist/hooks/index.d.ts +10 -0
  22. package/dist/hooks/index.d.ts.map +1 -0
  23. package/dist/hooks/index.js +9 -0
  24. package/dist/hooks/use-apa.d.ts +130 -0
  25. package/dist/hooks/use-apa.d.ts.map +1 -0
  26. package/dist/hooks/use-apa.js +60 -0
  27. package/dist/hooks/use-charter-booking.d.ts +175 -0
  28. package/dist/hooks/use-charter-booking.d.ts.map +1 -0
  29. package/dist/hooks/use-charter-booking.js +39 -0
  30. package/dist/hooks/use-charter-product-mutation.d.ts +124 -0
  31. package/dist/hooks/use-charter-product-mutation.d.ts.map +1 -0
  32. package/dist/hooks/use-charter-product-mutation.js +55 -0
  33. package/dist/hooks/use-charter-products.d.ts +150 -0
  34. package/dist/hooks/use-charter-products.d.ts.map +1 -0
  35. package/dist/hooks/use-charter-products.js +29 -0
  36. package/dist/hooks/use-charter-public.d.ts +232 -0
  37. package/dist/hooks/use-charter-public.d.ts.map +1 -0
  38. package/dist/hooks/use-charter-public.js +41 -0
  39. package/dist/hooks/use-charter-quote.d.ts +42 -0
  40. package/dist/hooks/use-charter-quote.d.ts.map +1 -0
  41. package/dist/hooks/use-charter-quote.js +30 -0
  42. package/dist/hooks/use-charter-voyages.d.ts +111 -0
  43. package/dist/hooks/use-charter-voyages.d.ts.map +1 -0
  44. package/dist/hooks/use-charter-voyages.js +19 -0
  45. package/dist/hooks/use-charter-yachts.d.ts +72 -0
  46. package/dist/hooks/use-charter-yachts.d.ts.map +1 -0
  47. package/dist/hooks/use-charter-yachts.js +19 -0
  48. package/dist/hooks/use-myba-contract.d.ts +28 -0
  49. package/dist/hooks/use-myba-contract.d.ts.map +1 -0
  50. package/dist/hooks/use-myba-contract.js +31 -0
  51. package/dist/i18n/en.d.ts +3 -0
  52. package/dist/i18n/en.d.ts.map +1 -0
  53. package/dist/i18n/en.js +78 -0
  54. package/dist/i18n/index.d.ts +5 -0
  55. package/dist/i18n/index.d.ts.map +1 -0
  56. package/dist/i18n/index.js +3 -0
  57. package/dist/i18n/messages.d.ts +70 -0
  58. package/dist/i18n/messages.d.ts.map +1 -0
  59. package/dist/i18n/messages.js +1 -0
  60. package/dist/i18n/provider.d.ts +26 -0
  61. package/dist/i18n/provider.d.ts.map +1 -0
  62. package/dist/i18n/provider.js +44 -0
  63. package/dist/i18n/ro.d.ts +3 -0
  64. package/dist/i18n/ro.d.ts.map +1 -0
  65. package/dist/i18n/ro.js +78 -0
  66. package/dist/index.d.ts +7 -0
  67. package/dist/index.d.ts.map +1 -0
  68. package/dist/index.js +6 -0
  69. package/dist/provider.d.ts +2 -0
  70. package/dist/provider.d.ts.map +1 -0
  71. package/dist/provider.js +1 -0
  72. package/dist/query-keys.d.ts +61 -0
  73. package/dist/query-keys.d.ts.map +1 -0
  74. package/dist/query-keys.js +31 -0
  75. package/dist/query-options.d.ts +2108 -0
  76. package/dist/query-options.d.ts.map +1 -0
  77. package/dist/query-options.js +110 -0
  78. package/dist/schemas.d.ts +1066 -0
  79. package/dist/schemas.d.ts.map +1 -0
  80. package/dist/schemas.js +323 -0
  81. package/dist/ui.d.ts +6 -0
  82. package/dist/ui.d.ts.map +1 -0
  83. package/dist/ui.js +5 -0
  84. package/package.json +121 -0
  85. package/src/styles.css +11 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAA;AAyBxB,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,mBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWlC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,0BAA0B,EAClC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,GAAG,OAAO,CAAC,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY1F;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,0BAA0B,EAAE,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYzF"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * TanStack `queryOptions()` factories for the charters module.
3
+ *
4
+ * Hooks under `./hooks/` wrap these so they can be used both inside React
5
+ * components and outside (SSR loaders, route preloads, framework adapters).
6
+ * Each factory takes a `FetchWithValidationOptions` instead of reading from
7
+ * context — the hook provides that, but a server loader can pass it in
8
+ * directly.
9
+ */
10
+ import { queryOptions } from "@tanstack/react-query";
11
+ import { fetchWithValidation } from "./client.js";
12
+ import { chartersQueryKeys, } from "./query-keys.js";
13
+ import { adminProductListResponse, productDetailResponse, productListResponse, voyageDetailResponse, voyageListResponse, yachtDetailResponse, yachtListResponse, } from "./schemas.js";
14
+ // ---------- helpers ----------
15
+ function buildQueryString(params) {
16
+ const search = new URLSearchParams();
17
+ for (const [k, v] of Object.entries(params)) {
18
+ if (v === undefined || v === null || v === "")
19
+ continue;
20
+ search.set(k, String(v));
21
+ }
22
+ const qs = search.toString();
23
+ return qs ? `?${qs}` : "";
24
+ }
25
+ // ---------- products ----------
26
+ export function getProductsQueryOptions(client, filters = {}) {
27
+ return queryOptions({
28
+ queryKey: chartersQueryKeys.productsList(filters),
29
+ queryFn: () => fetchWithValidation(`/v1/admin/charters/products${buildQueryString(filters)}`, adminProductListResponse, client),
30
+ });
31
+ }
32
+ export function getProductQueryOptions(client, key, options = {}) {
33
+ const include = options.include ?? [];
34
+ const qs = include.length > 0 ? `?include=${include.join(",")}` : "";
35
+ return queryOptions({
36
+ queryKey: chartersQueryKeys.product(key, include),
37
+ queryFn: async () => {
38
+ const result = await fetchWithValidation(`/v1/admin/charters/products/${encodeURIComponent(key)}${qs}`, productDetailResponse, client);
39
+ return result.data;
40
+ },
41
+ });
42
+ }
43
+ // ---------- voyages ----------
44
+ export function getVoyagesQueryOptions(client, filters = {}) {
45
+ return queryOptions({
46
+ queryKey: chartersQueryKeys.voyagesList(filters),
47
+ queryFn: () => fetchWithValidation(`/v1/admin/charters/voyages${buildQueryString(filters)}`, voyageListResponse, client),
48
+ });
49
+ }
50
+ export function getVoyageQueryOptions(client, key, options = {}) {
51
+ const include = options.include ?? [];
52
+ const qs = include.length > 0 ? `?include=${include.join(",")}` : "";
53
+ return queryOptions({
54
+ queryKey: chartersQueryKeys.voyage(key, include),
55
+ queryFn: async () => {
56
+ const result = await fetchWithValidation(`/v1/admin/charters/voyages/${encodeURIComponent(key)}${qs}`, voyageDetailResponse, client);
57
+ return result.data;
58
+ },
59
+ });
60
+ }
61
+ // ---------- yachts ----------
62
+ export function getYachtsQueryOptions(client, filters = {}) {
63
+ return queryOptions({
64
+ queryKey: chartersQueryKeys.yachtsList(filters),
65
+ queryFn: () => fetchWithValidation(`/v1/admin/charters/yachts${buildQueryString(filters)}`, yachtListResponse, client),
66
+ });
67
+ }
68
+ export function getYachtQueryOptions(client, key) {
69
+ return queryOptions({
70
+ queryKey: chartersQueryKeys.yacht(key),
71
+ queryFn: async () => {
72
+ const result = await fetchWithValidation(`/v1/admin/charters/yachts/${encodeURIComponent(key)}`, yachtDetailResponse, client);
73
+ return result.data;
74
+ },
75
+ });
76
+ }
77
+ // ---------- public surface ----------
78
+ export function getPublicProductsQueryOptions(client, filters = {}) {
79
+ return queryOptions({
80
+ queryKey: chartersQueryKeys.publicProductsList(filters),
81
+ queryFn: () => fetchWithValidation(`/v1/public/charters${buildQueryString(filters)}`, productListResponse, client),
82
+ });
83
+ }
84
+ export function getPublicProductQueryOptions(client, key) {
85
+ return queryOptions({
86
+ queryKey: chartersQueryKeys.publicProduct(key),
87
+ queryFn: async () => {
88
+ const result = await fetchWithValidation(`/v1/public/charters/products/${encodeURIComponent(key)}`, productDetailResponse, client);
89
+ return result.data;
90
+ },
91
+ });
92
+ }
93
+ export function getPublicVoyageQueryOptions(client, key) {
94
+ return queryOptions({
95
+ queryKey: chartersQueryKeys.publicVoyage(key),
96
+ queryFn: async () => {
97
+ const result = await fetchWithValidation(`/v1/public/charters/voyages/${encodeURIComponent(key)}`, voyageDetailResponse, client);
98
+ return result.data;
99
+ },
100
+ });
101
+ }
102
+ export function getPublicYachtQueryOptions(client, key) {
103
+ return queryOptions({
104
+ queryKey: chartersQueryKeys.publicYacht(key),
105
+ queryFn: async () => {
106
+ const result = await fetchWithValidation(`/v1/public/charters/yachts/${encodeURIComponent(key)}`, yachtDetailResponse, client);
107
+ return result.data;
108
+ },
109
+ });
110
+ }