@voyant-travel/quotes-react 0.119.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 (130) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +39 -0
  3. package/dist/client.d.ts +31 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +71 -0
  6. package/dist/components/create-quote-dialog.d.ts +10 -0
  7. package/dist/components/create-quote-dialog.d.ts.map +1 -0
  8. package/dist/components/create-quote-dialog.js +45 -0
  9. package/dist/components/create-quote-version-dialog.d.ts +9 -0
  10. package/dist/components/create-quote-version-dialog.d.ts.map +1 -0
  11. package/dist/components/create-quote-version-dialog.js +108 -0
  12. package/dist/components/crm-format.d.ts +7 -0
  13. package/dist/components/crm-format.d.ts.map +1 -0
  14. package/dist/components/crm-format.js +40 -0
  15. package/dist/components/inline-currency-field.d.ts +12 -0
  16. package/dist/components/inline-currency-field.d.ts.map +1 -0
  17. package/dist/components/inline-currency-field.js +46 -0
  18. package/dist/components/inline-field.d.ts +16 -0
  19. package/dist/components/inline-field.d.ts.map +1 -0
  20. package/dist/components/inline-field.js +45 -0
  21. package/dist/components/inline-language-field.d.ts +12 -0
  22. package/dist/components/inline-language-field.d.ts.map +1 -0
  23. package/dist/components/inline-language-field.js +46 -0
  24. package/dist/components/inline-number-field.d.ts +15 -0
  25. package/dist/components/inline-number-field.d.ts.map +1 -0
  26. package/dist/components/inline-number-field.js +58 -0
  27. package/dist/components/inline-select-field.d.ts +19 -0
  28. package/dist/components/inline-select-field.d.ts.map +1 -0
  29. package/dist/components/inline-select-field.js +34 -0
  30. package/dist/components/quote-summary-card.d.ts +11 -0
  31. package/dist/components/quote-summary-card.d.ts.map +1 -0
  32. package/dist/components/quote-summary-card.js +11 -0
  33. package/dist/components/quote-version-detail-sections.d.ts +22 -0
  34. package/dist/components/quote-version-detail-sections.d.ts.map +1 -0
  35. package/dist/components/quote-version-detail-sections.js +87 -0
  36. package/dist/components/quote-versions-page.d.ts +8 -0
  37. package/dist/components/quote-versions-page.d.ts.map +1 -0
  38. package/dist/components/quote-versions-page.js +30 -0
  39. package/dist/components/quotes-board.d.ts +8 -0
  40. package/dist/components/quotes-board.d.ts.map +1 -0
  41. package/dist/components/quotes-board.js +24 -0
  42. package/dist/hooks/index.d.ts +10 -0
  43. package/dist/hooks/index.d.ts.map +1 -0
  44. package/dist/hooks/index.js +9 -0
  45. package/dist/hooks/use-pipeline-mutation.d.ts +76 -0
  46. package/dist/hooks/use-pipeline-mutation.d.ts.map +1 -0
  47. package/dist/hooks/use-pipeline-mutation.js +76 -0
  48. package/dist/hooks/use-pipelines.d.ts +31 -0
  49. package/dist/hooks/use-pipelines.d.ts.map +1 -0
  50. package/dist/hooks/use-pipelines.js +42 -0
  51. package/dist/hooks/use-quote-mutation.d.ts +72 -0
  52. package/dist/hooks/use-quote-mutation.d.ts.map +1 -0
  53. package/dist/hooks/use-quote-mutation.js +50 -0
  54. package/dist/hooks/use-quote-version-mutation.d.ts +272 -0
  55. package/dist/hooks/use-quote-version-mutation.d.ts.map +1 -0
  56. package/dist/hooks/use-quote-version-mutation.js +164 -0
  57. package/dist/hooks/use-quote-version.d.ts +37 -0
  58. package/dist/hooks/use-quote-version.d.ts.map +1 -0
  59. package/dist/hooks/use-quote-version.js +34 -0
  60. package/dist/hooks/use-quote-versions.d.ts +30 -0
  61. package/dist/hooks/use-quote-versions.d.ts.map +1 -0
  62. package/dist/hooks/use-quote-versions.js +27 -0
  63. package/dist/hooks/use-quote.d.ts +26 -0
  64. package/dist/hooks/use-quote.d.ts.map +1 -0
  65. package/dist/hooks/use-quote.js +23 -0
  66. package/dist/hooks/use-quotes.d.ts +36 -0
  67. package/dist/hooks/use-quotes.d.ts.map +1 -0
  68. package/dist/hooks/use-quotes.js +44 -0
  69. package/dist/hooks/use-stages.d.ts +37 -0
  70. package/dist/hooks/use-stages.d.ts.map +1 -0
  71. package/dist/hooks/use-stages.js +45 -0
  72. package/dist/i18n/en/base.d.ts +189 -0
  73. package/dist/i18n/en/base.d.ts.map +1 -0
  74. package/dist/i18n/en/base.js +188 -0
  75. package/dist/i18n/en/commerce.d.ts +133 -0
  76. package/dist/i18n/en/commerce.d.ts.map +1 -0
  77. package/dist/i18n/en/commerce.js +132 -0
  78. package/dist/i18n/en/detail.d.ts +211 -0
  79. package/dist/i18n/en/detail.d.ts.map +1 -0
  80. package/dist/i18n/en/detail.js +210 -0
  81. package/dist/i18n/en/lists.d.ts +75 -0
  82. package/dist/i18n/en/lists.d.ts.map +1 -0
  83. package/dist/i18n/en/lists.js +74 -0
  84. package/dist/i18n/en.d.ts +599 -0
  85. package/dist/i18n/en.d.ts.map +1 -0
  86. package/dist/i18n/en.js +10 -0
  87. package/dist/i18n/index.d.ts +5 -0
  88. package/dist/i18n/index.d.ts.map +1 -0
  89. package/dist/i18n/index.js +3 -0
  90. package/dist/i18n/messages.d.ts +577 -0
  91. package/dist/i18n/messages.d.ts.map +1 -0
  92. package/dist/i18n/messages.js +15 -0
  93. package/dist/i18n/provider.d.ts +1220 -0
  94. package/dist/i18n/provider.d.ts.map +1 -0
  95. package/dist/i18n/provider.js +44 -0
  96. package/dist/i18n/ro/base.d.ts +189 -0
  97. package/dist/i18n/ro/base.d.ts.map +1 -0
  98. package/dist/i18n/ro/base.js +188 -0
  99. package/dist/i18n/ro/commerce.d.ts +133 -0
  100. package/dist/i18n/ro/commerce.d.ts.map +1 -0
  101. package/dist/i18n/ro/commerce.js +132 -0
  102. package/dist/i18n/ro/detail.d.ts +211 -0
  103. package/dist/i18n/ro/detail.d.ts.map +1 -0
  104. package/dist/i18n/ro/detail.js +210 -0
  105. package/dist/i18n/ro/lists.d.ts +75 -0
  106. package/dist/i18n/ro/lists.d.ts.map +1 -0
  107. package/dist/i18n/ro/lists.js +74 -0
  108. package/dist/i18n/ro.d.ts +599 -0
  109. package/dist/i18n/ro.d.ts.map +1 -0
  110. package/dist/i18n/ro.js +10 -0
  111. package/dist/index.d.ts +22 -0
  112. package/dist/index.d.ts.map +1 -0
  113. package/dist/index.js +21 -0
  114. package/dist/provider.d.ts +2 -0
  115. package/dist/provider.d.ts.map +1 -0
  116. package/dist/provider.js +1 -0
  117. package/dist/query-keys.d.ts +44 -0
  118. package/dist/query-keys.d.ts.map +1 -0
  119. package/dist/query-keys.js +16 -0
  120. package/dist/query-options.d.ts +678 -0
  121. package/dist/query-options.d.ts.map +1 -0
  122. package/dist/query-options.js +160 -0
  123. package/dist/schemas.d.ts +348 -0
  124. package/dist/schemas.d.ts.map +1 -0
  125. package/dist/schemas.js +101 -0
  126. package/dist/ui.d.ts +8 -0
  127. package/dist/ui.d.ts.map +1 -0
  128. package/dist/ui.js +7 -0
  129. package/package.json +117 -0
  130. package/src/styles.css +11 -0
@@ -0,0 +1,160 @@
1
+ "use client";
2
+ import { queryOptions } from "@tanstack/react-query";
3
+ import { fetchWithValidation } from "./client.js";
4
+ import { quotesQueryKeys } from "./query-keys.js";
5
+ import { pipelineListResponse, pipelineSingleResponse, quoteListResponse, quoteSingleResponse, quoteVersionLineListResponse, quoteVersionListResponse, quoteVersionSingleResponse, stageListResponse, stageSingleResponse, } from "./schemas.js";
6
+ const basePath = "/v1/quotes";
7
+ export function getPipelinesQueryOptions(client, options = {}) {
8
+ const { enabled: _enabled = true, ...filters } = options;
9
+ return queryOptions({
10
+ queryKey: quotesQueryKeys.pipelinesList(filters),
11
+ queryFn: () => {
12
+ const params = new URLSearchParams();
13
+ if (filters.entityType)
14
+ params.set("entityType", filters.entityType);
15
+ if (filters.limit !== undefined)
16
+ params.set("limit", String(filters.limit));
17
+ if (filters.offset !== undefined)
18
+ params.set("offset", String(filters.offset));
19
+ const qs = params.toString();
20
+ return fetchWithValidation(`${basePath}/pipelines${qs ? `?${qs}` : ""}`, pipelineListResponse, {
21
+ baseUrl: client.baseUrl,
22
+ fetcher: client.fetcher,
23
+ });
24
+ },
25
+ });
26
+ }
27
+ export function getPipelineQueryOptions(client, id) {
28
+ return queryOptions({
29
+ queryKey: quotesQueryKeys.pipeline(id),
30
+ queryFn: async () => {
31
+ const { data } = await fetchWithValidation(`${basePath}/pipelines/${id}`, pipelineSingleResponse, {
32
+ baseUrl: client.baseUrl,
33
+ fetcher: client.fetcher,
34
+ });
35
+ return data;
36
+ },
37
+ });
38
+ }
39
+ export function getStagesQueryOptions(client, options = {}) {
40
+ const { enabled: _enabled = true, ...filters } = options;
41
+ return queryOptions({
42
+ queryKey: quotesQueryKeys.stagesList(filters),
43
+ queryFn: () => {
44
+ const params = new URLSearchParams();
45
+ if (filters.pipelineId)
46
+ params.set("pipelineId", filters.pipelineId);
47
+ if (filters.limit !== undefined)
48
+ params.set("limit", String(filters.limit));
49
+ if (filters.offset !== undefined)
50
+ params.set("offset", String(filters.offset));
51
+ const qs = params.toString();
52
+ return fetchWithValidation(`${basePath}/stages${qs ? `?${qs}` : ""}`, stageListResponse, {
53
+ baseUrl: client.baseUrl,
54
+ fetcher: client.fetcher,
55
+ });
56
+ },
57
+ });
58
+ }
59
+ export function getStageQueryOptions(client, id) {
60
+ return queryOptions({
61
+ queryKey: quotesQueryKeys.stage(id),
62
+ queryFn: async () => {
63
+ const { data } = await fetchWithValidation(`${basePath}/stages/${id}`, stageSingleResponse, {
64
+ baseUrl: client.baseUrl,
65
+ fetcher: client.fetcher,
66
+ });
67
+ return data;
68
+ },
69
+ });
70
+ }
71
+ export function getQuotesQueryOptions(client, options = {}) {
72
+ const { enabled: _enabled = true, ...filters } = options;
73
+ return queryOptions({
74
+ queryKey: quotesQueryKeys.quotesList(filters),
75
+ queryFn: () => {
76
+ const params = new URLSearchParams();
77
+ if (filters.search)
78
+ params.set("search", filters.search);
79
+ if (filters.personId)
80
+ params.set("personId", filters.personId);
81
+ if (filters.organizationId)
82
+ params.set("organizationId", filters.organizationId);
83
+ if (filters.pipelineId)
84
+ params.set("pipelineId", filters.pipelineId);
85
+ if (filters.stageId)
86
+ params.set("stageId", filters.stageId);
87
+ if (filters.ownerId)
88
+ params.set("ownerId", filters.ownerId);
89
+ if (filters.status)
90
+ params.set("status", filters.status);
91
+ if (filters.limit !== undefined)
92
+ params.set("limit", String(filters.limit));
93
+ if (filters.offset !== undefined)
94
+ params.set("offset", String(filters.offset));
95
+ const qs = params.toString();
96
+ return fetchWithValidation(`${basePath}/quotes${qs ? `?${qs}` : ""}`, quoteListResponse, {
97
+ baseUrl: client.baseUrl,
98
+ fetcher: client.fetcher,
99
+ });
100
+ },
101
+ });
102
+ }
103
+ export function getQuoteQueryOptions(client, id) {
104
+ return queryOptions({
105
+ queryKey: quotesQueryKeys.quote(id),
106
+ queryFn: async () => {
107
+ const { data } = await fetchWithValidation(`${basePath}/quotes/${id}`, quoteSingleResponse, {
108
+ baseUrl: client.baseUrl,
109
+ fetcher: client.fetcher,
110
+ });
111
+ return data;
112
+ },
113
+ });
114
+ }
115
+ export function getQuoteVersionsQueryOptions(client, options = {}) {
116
+ const { enabled: _enabled = true, ...filters } = options;
117
+ return queryOptions({
118
+ queryKey: quotesQueryKeys.quoteVersionsList(filters),
119
+ queryFn: () => {
120
+ const params = new URLSearchParams();
121
+ if (filters.quoteId)
122
+ params.set("quoteId", filters.quoteId);
123
+ if (filters.status)
124
+ params.set("status", filters.status);
125
+ if (filters.limit !== undefined)
126
+ params.set("limit", String(filters.limit));
127
+ if (filters.offset !== undefined)
128
+ params.set("offset", String(filters.offset));
129
+ const qs = params.toString();
130
+ return fetchWithValidation(`${basePath}/quote-versions${qs ? `?${qs}` : ""}`, quoteVersionListResponse, {
131
+ baseUrl: client.baseUrl,
132
+ fetcher: client.fetcher,
133
+ });
134
+ },
135
+ });
136
+ }
137
+ export function getQuoteVersionQueryOptions(client, id) {
138
+ return queryOptions({
139
+ queryKey: quotesQueryKeys.quoteVersion(id),
140
+ queryFn: async () => {
141
+ const { data } = await fetchWithValidation(`${basePath}/quote-versions/${id}`, quoteVersionSingleResponse, {
142
+ baseUrl: client.baseUrl,
143
+ fetcher: client.fetcher,
144
+ });
145
+ return data;
146
+ },
147
+ });
148
+ }
149
+ export function getQuoteVersionLinesQueryOptions(client, quoteVersionId) {
150
+ return queryOptions({
151
+ queryKey: quotesQueryKeys.quoteVersionLines(quoteVersionId),
152
+ queryFn: async () => {
153
+ const data = await fetchWithValidation(`${basePath}/quote-versions/${quoteVersionId}/lines`, quoteVersionLineListResponse, {
154
+ baseUrl: client.baseUrl,
155
+ fetcher: client.fetcher,
156
+ });
157
+ return data.data;
158
+ },
159
+ });
160
+ }
@@ -0,0 +1,348 @@
1
+ import { z } from "zod";
2
+ export declare const paginatedEnvelope: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
3
+ data: z.ZodArray<T>;
4
+ total: z.ZodNumber;
5
+ limit: z.ZodNumber;
6
+ offset: z.ZodNumber;
7
+ }, z.core.$strip>;
8
+ export declare const singleEnvelope: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
9
+ data: T;
10
+ }, z.core.$strip>;
11
+ export declare const listEnvelope: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
12
+ data: z.ZodArray<T>;
13
+ }, z.core.$strip>;
14
+ export declare const successEnvelope: z.ZodObject<{
15
+ success: z.ZodBoolean;
16
+ }, z.core.$strip>;
17
+ export declare const quoteRecordSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ title: z.ZodString;
20
+ personId: z.ZodNullable<z.ZodString>;
21
+ organizationId: z.ZodNullable<z.ZodString>;
22
+ pipelineId: z.ZodString;
23
+ stageId: z.ZodString;
24
+ ownerId: z.ZodNullable<z.ZodString>;
25
+ status: z.ZodString;
26
+ acceptedVersionId: z.ZodNullable<z.ZodString>;
27
+ valueAmountCents: z.ZodNullable<z.ZodNumber>;
28
+ valueCurrency: z.ZodNullable<z.ZodString>;
29
+ expectedCloseDate: z.ZodNullable<z.ZodString>;
30
+ source: z.ZodNullable<z.ZodString>;
31
+ sourceRef: z.ZodNullable<z.ZodString>;
32
+ lostReason: z.ZodNullable<z.ZodString>;
33
+ tags: z.ZodArray<z.ZodString>;
34
+ createdAt: z.ZodString;
35
+ updatedAt: z.ZodString;
36
+ stageChangedAt: z.ZodString;
37
+ closedAt: z.ZodNullable<z.ZodString>;
38
+ }, z.core.$strip>;
39
+ export type QuoteRecord = z.infer<typeof quoteRecordSchema>;
40
+ export declare const quoteListResponse: z.ZodObject<{
41
+ data: z.ZodArray<z.ZodObject<{
42
+ id: z.ZodString;
43
+ title: z.ZodString;
44
+ personId: z.ZodNullable<z.ZodString>;
45
+ organizationId: z.ZodNullable<z.ZodString>;
46
+ pipelineId: z.ZodString;
47
+ stageId: z.ZodString;
48
+ ownerId: z.ZodNullable<z.ZodString>;
49
+ status: z.ZodString;
50
+ acceptedVersionId: z.ZodNullable<z.ZodString>;
51
+ valueAmountCents: z.ZodNullable<z.ZodNumber>;
52
+ valueCurrency: z.ZodNullable<z.ZodString>;
53
+ expectedCloseDate: z.ZodNullable<z.ZodString>;
54
+ source: z.ZodNullable<z.ZodString>;
55
+ sourceRef: z.ZodNullable<z.ZodString>;
56
+ lostReason: z.ZodNullable<z.ZodString>;
57
+ tags: z.ZodArray<z.ZodString>;
58
+ createdAt: z.ZodString;
59
+ updatedAt: z.ZodString;
60
+ stageChangedAt: z.ZodString;
61
+ closedAt: z.ZodNullable<z.ZodString>;
62
+ }, z.core.$strip>>;
63
+ total: z.ZodNumber;
64
+ limit: z.ZodNumber;
65
+ offset: z.ZodNumber;
66
+ }, z.core.$strip>;
67
+ export declare const quoteSingleResponse: z.ZodObject<{
68
+ data: z.ZodObject<{
69
+ id: z.ZodString;
70
+ title: z.ZodString;
71
+ personId: z.ZodNullable<z.ZodString>;
72
+ organizationId: z.ZodNullable<z.ZodString>;
73
+ pipelineId: z.ZodString;
74
+ stageId: z.ZodString;
75
+ ownerId: z.ZodNullable<z.ZodString>;
76
+ status: z.ZodString;
77
+ acceptedVersionId: z.ZodNullable<z.ZodString>;
78
+ valueAmountCents: z.ZodNullable<z.ZodNumber>;
79
+ valueCurrency: z.ZodNullable<z.ZodString>;
80
+ expectedCloseDate: z.ZodNullable<z.ZodString>;
81
+ source: z.ZodNullable<z.ZodString>;
82
+ sourceRef: z.ZodNullable<z.ZodString>;
83
+ lostReason: z.ZodNullable<z.ZodString>;
84
+ tags: z.ZodArray<z.ZodString>;
85
+ createdAt: z.ZodString;
86
+ updatedAt: z.ZodString;
87
+ stageChangedAt: z.ZodString;
88
+ closedAt: z.ZodNullable<z.ZodString>;
89
+ }, z.core.$strip>;
90
+ }, z.core.$strip>;
91
+ export declare const pipelineRecordSchema: z.ZodObject<{
92
+ id: z.ZodString;
93
+ entityType: z.ZodString;
94
+ name: z.ZodString;
95
+ isDefault: z.ZodBoolean;
96
+ sortOrder: z.ZodNumber;
97
+ createdAt: z.ZodString;
98
+ updatedAt: z.ZodString;
99
+ }, z.core.$strip>;
100
+ export type PipelineRecord = z.infer<typeof pipelineRecordSchema>;
101
+ export declare const pipelineListResponse: z.ZodObject<{
102
+ data: z.ZodArray<z.ZodObject<{
103
+ id: z.ZodString;
104
+ entityType: z.ZodString;
105
+ name: z.ZodString;
106
+ isDefault: z.ZodBoolean;
107
+ sortOrder: z.ZodNumber;
108
+ createdAt: z.ZodString;
109
+ updatedAt: z.ZodString;
110
+ }, z.core.$strip>>;
111
+ total: z.ZodNumber;
112
+ limit: z.ZodNumber;
113
+ offset: z.ZodNumber;
114
+ }, z.core.$strip>;
115
+ export declare const pipelineSingleResponse: z.ZodObject<{
116
+ data: z.ZodObject<{
117
+ id: z.ZodString;
118
+ entityType: z.ZodString;
119
+ name: z.ZodString;
120
+ isDefault: z.ZodBoolean;
121
+ sortOrder: z.ZodNumber;
122
+ createdAt: z.ZodString;
123
+ updatedAt: z.ZodString;
124
+ }, z.core.$strip>;
125
+ }, z.core.$strip>;
126
+ export declare const stageRecordSchema: z.ZodObject<{
127
+ id: z.ZodString;
128
+ pipelineId: z.ZodString;
129
+ name: z.ZodString;
130
+ sortOrder: z.ZodNumber;
131
+ probability: z.ZodNullable<z.ZodNumber>;
132
+ isClosed: z.ZodBoolean;
133
+ isWon: z.ZodBoolean;
134
+ isLost: z.ZodBoolean;
135
+ createdAt: z.ZodString;
136
+ updatedAt: z.ZodString;
137
+ }, z.core.$strip>;
138
+ export type StageRecord = z.infer<typeof stageRecordSchema>;
139
+ export declare const stageListResponse: z.ZodObject<{
140
+ data: z.ZodArray<z.ZodObject<{
141
+ id: z.ZodString;
142
+ pipelineId: z.ZodString;
143
+ name: z.ZodString;
144
+ sortOrder: z.ZodNumber;
145
+ probability: z.ZodNullable<z.ZodNumber>;
146
+ isClosed: z.ZodBoolean;
147
+ isWon: z.ZodBoolean;
148
+ isLost: z.ZodBoolean;
149
+ createdAt: z.ZodString;
150
+ updatedAt: z.ZodString;
151
+ }, z.core.$strip>>;
152
+ total: z.ZodNumber;
153
+ limit: z.ZodNumber;
154
+ offset: z.ZodNumber;
155
+ }, z.core.$strip>;
156
+ export declare const stageSingleResponse: z.ZodObject<{
157
+ data: z.ZodObject<{
158
+ id: z.ZodString;
159
+ pipelineId: z.ZodString;
160
+ name: z.ZodString;
161
+ sortOrder: z.ZodNumber;
162
+ probability: z.ZodNullable<z.ZodNumber>;
163
+ isClosed: z.ZodBoolean;
164
+ isWon: z.ZodBoolean;
165
+ isLost: z.ZodBoolean;
166
+ createdAt: z.ZodString;
167
+ updatedAt: z.ZodString;
168
+ }, z.core.$strip>;
169
+ }, z.core.$strip>;
170
+ export declare const quoteVersionRecordSchema: z.ZodObject<{
171
+ id: z.ZodString;
172
+ quoteId: z.ZodString;
173
+ label: z.ZodNullable<z.ZodString>;
174
+ status: z.ZodString;
175
+ supersedesId: z.ZodNullable<z.ZodString>;
176
+ tripSnapshotId: z.ZodNullable<z.ZodString>;
177
+ validUntil: z.ZodNullable<z.ZodString>;
178
+ currency: z.ZodString;
179
+ subtotalAmountCents: z.ZodNumber;
180
+ taxAmountCents: z.ZodNumber;
181
+ totalAmountCents: z.ZodNumber;
182
+ notes: z.ZodNullable<z.ZodString>;
183
+ sentAt: z.ZodNullable<z.ZodString>;
184
+ viewedAt: z.ZodNullable<z.ZodString>;
185
+ decidedAt: z.ZodNullable<z.ZodString>;
186
+ createdAt: z.ZodString;
187
+ updatedAt: z.ZodString;
188
+ archivedAt: z.ZodNullable<z.ZodString>;
189
+ }, z.core.$strip>;
190
+ export type QuoteVersionRecord = z.infer<typeof quoteVersionRecordSchema>;
191
+ export declare const quoteVersionListResponse: z.ZodObject<{
192
+ data: z.ZodArray<z.ZodObject<{
193
+ id: z.ZodString;
194
+ quoteId: z.ZodString;
195
+ label: z.ZodNullable<z.ZodString>;
196
+ status: z.ZodString;
197
+ supersedesId: z.ZodNullable<z.ZodString>;
198
+ tripSnapshotId: z.ZodNullable<z.ZodString>;
199
+ validUntil: z.ZodNullable<z.ZodString>;
200
+ currency: z.ZodString;
201
+ subtotalAmountCents: z.ZodNumber;
202
+ taxAmountCents: z.ZodNumber;
203
+ totalAmountCents: z.ZodNumber;
204
+ notes: z.ZodNullable<z.ZodString>;
205
+ sentAt: z.ZodNullable<z.ZodString>;
206
+ viewedAt: z.ZodNullable<z.ZodString>;
207
+ decidedAt: z.ZodNullable<z.ZodString>;
208
+ createdAt: z.ZodString;
209
+ updatedAt: z.ZodString;
210
+ archivedAt: z.ZodNullable<z.ZodString>;
211
+ }, z.core.$strip>>;
212
+ total: z.ZodNumber;
213
+ limit: z.ZodNumber;
214
+ offset: z.ZodNumber;
215
+ }, z.core.$strip>;
216
+ export declare const quoteVersionSingleResponse: z.ZodObject<{
217
+ data: z.ZodObject<{
218
+ id: z.ZodString;
219
+ quoteId: z.ZodString;
220
+ label: z.ZodNullable<z.ZodString>;
221
+ status: z.ZodString;
222
+ supersedesId: z.ZodNullable<z.ZodString>;
223
+ tripSnapshotId: z.ZodNullable<z.ZodString>;
224
+ validUntil: z.ZodNullable<z.ZodString>;
225
+ currency: z.ZodString;
226
+ subtotalAmountCents: z.ZodNumber;
227
+ taxAmountCents: z.ZodNumber;
228
+ totalAmountCents: z.ZodNumber;
229
+ notes: z.ZodNullable<z.ZodString>;
230
+ sentAt: z.ZodNullable<z.ZodString>;
231
+ viewedAt: z.ZodNullable<z.ZodString>;
232
+ decidedAt: z.ZodNullable<z.ZodString>;
233
+ createdAt: z.ZodString;
234
+ updatedAt: z.ZodString;
235
+ archivedAt: z.ZodNullable<z.ZodString>;
236
+ }, z.core.$strip>;
237
+ }, z.core.$strip>;
238
+ export declare const acceptQuoteVersionResponse: z.ZodObject<{
239
+ data: z.ZodObject<{
240
+ quote: z.ZodObject<{
241
+ id: z.ZodString;
242
+ title: z.ZodString;
243
+ personId: z.ZodNullable<z.ZodString>;
244
+ organizationId: z.ZodNullable<z.ZodString>;
245
+ pipelineId: z.ZodString;
246
+ stageId: z.ZodString;
247
+ ownerId: z.ZodNullable<z.ZodString>;
248
+ status: z.ZodString;
249
+ acceptedVersionId: z.ZodNullable<z.ZodString>;
250
+ valueAmountCents: z.ZodNullable<z.ZodNumber>;
251
+ valueCurrency: z.ZodNullable<z.ZodString>;
252
+ expectedCloseDate: z.ZodNullable<z.ZodString>;
253
+ source: z.ZodNullable<z.ZodString>;
254
+ sourceRef: z.ZodNullable<z.ZodString>;
255
+ lostReason: z.ZodNullable<z.ZodString>;
256
+ tags: z.ZodArray<z.ZodString>;
257
+ createdAt: z.ZodString;
258
+ updatedAt: z.ZodString;
259
+ stageChangedAt: z.ZodString;
260
+ closedAt: z.ZodNullable<z.ZodString>;
261
+ }, z.core.$strip>;
262
+ quoteVersion: z.ZodObject<{
263
+ id: z.ZodString;
264
+ quoteId: z.ZodString;
265
+ label: z.ZodNullable<z.ZodString>;
266
+ status: z.ZodString;
267
+ supersedesId: z.ZodNullable<z.ZodString>;
268
+ tripSnapshotId: z.ZodNullable<z.ZodString>;
269
+ validUntil: z.ZodNullable<z.ZodString>;
270
+ currency: z.ZodString;
271
+ subtotalAmountCents: z.ZodNumber;
272
+ taxAmountCents: z.ZodNumber;
273
+ totalAmountCents: z.ZodNumber;
274
+ notes: z.ZodNullable<z.ZodString>;
275
+ sentAt: z.ZodNullable<z.ZodString>;
276
+ viewedAt: z.ZodNullable<z.ZodString>;
277
+ decidedAt: z.ZodNullable<z.ZodString>;
278
+ createdAt: z.ZodString;
279
+ updatedAt: z.ZodString;
280
+ archivedAt: z.ZodNullable<z.ZodString>;
281
+ }, z.core.$strip>;
282
+ closedQuoteVersions: z.ZodArray<z.ZodObject<{
283
+ id: z.ZodString;
284
+ quoteId: z.ZodString;
285
+ label: z.ZodNullable<z.ZodString>;
286
+ status: z.ZodString;
287
+ supersedesId: z.ZodNullable<z.ZodString>;
288
+ tripSnapshotId: z.ZodNullable<z.ZodString>;
289
+ validUntil: z.ZodNullable<z.ZodString>;
290
+ currency: z.ZodString;
291
+ subtotalAmountCents: z.ZodNumber;
292
+ taxAmountCents: z.ZodNumber;
293
+ totalAmountCents: z.ZodNumber;
294
+ notes: z.ZodNullable<z.ZodString>;
295
+ sentAt: z.ZodNullable<z.ZodString>;
296
+ viewedAt: z.ZodNullable<z.ZodString>;
297
+ decidedAt: z.ZodNullable<z.ZodString>;
298
+ createdAt: z.ZodString;
299
+ updatedAt: z.ZodString;
300
+ archivedAt: z.ZodNullable<z.ZodString>;
301
+ }, z.core.$strip>>;
302
+ }, z.core.$strip>;
303
+ }, z.core.$strip>;
304
+ export declare const quoteVersionLineRecordSchema: z.ZodObject<{
305
+ id: z.ZodString;
306
+ quoteVersionId: z.ZodString;
307
+ productId: z.ZodNullable<z.ZodString>;
308
+ supplierServiceId: z.ZodNullable<z.ZodString>;
309
+ description: z.ZodString;
310
+ quantity: z.ZodNumber;
311
+ unitPriceAmountCents: z.ZodNumber;
312
+ totalAmountCents: z.ZodNumber;
313
+ currency: z.ZodString;
314
+ createdAt: z.ZodString;
315
+ updatedAt: z.ZodString;
316
+ }, z.core.$strip>;
317
+ export type QuoteVersionLineRecord = z.infer<typeof quoteVersionLineRecordSchema>;
318
+ export declare const quoteVersionLineListResponse: z.ZodObject<{
319
+ data: z.ZodArray<z.ZodObject<{
320
+ id: z.ZodString;
321
+ quoteVersionId: z.ZodString;
322
+ productId: z.ZodNullable<z.ZodString>;
323
+ supplierServiceId: z.ZodNullable<z.ZodString>;
324
+ description: z.ZodString;
325
+ quantity: z.ZodNumber;
326
+ unitPriceAmountCents: z.ZodNumber;
327
+ totalAmountCents: z.ZodNumber;
328
+ currency: z.ZodString;
329
+ createdAt: z.ZodString;
330
+ updatedAt: z.ZodString;
331
+ }, z.core.$strip>>;
332
+ }, z.core.$strip>;
333
+ export declare const quoteVersionLineSingleResponse: z.ZodObject<{
334
+ data: z.ZodObject<{
335
+ id: z.ZodString;
336
+ quoteVersionId: z.ZodString;
337
+ productId: z.ZodNullable<z.ZodString>;
338
+ supplierServiceId: z.ZodNullable<z.ZodString>;
339
+ description: z.ZodString;
340
+ quantity: z.ZodNumber;
341
+ unitPriceAmountCents: z.ZodNumber;
342
+ totalAmountCents: z.ZodNumber;
343
+ currency: z.ZodString;
344
+ createdAt: z.ZodString;
345
+ updatedAt: z.ZodString;
346
+ }, z.core.$strip>;
347
+ }, z.core.$strip>;
348
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;;;;iBAM7D,CAAA;AAEJ,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAA6B,CAAA;AAE3F,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAAsC,CAAA;AAElG,eAAO,MAAM,eAAe;;iBAAqC,CAAA;AAEjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iBAqB5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAuC,CAAA;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;iBAAoC,CAAA;AAEpE,eAAO,MAAM,oBAAoB;;;;;;;;iBAQ/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBAA0C,CAAA;AAC3E,eAAO,MAAM,sBAAsB;;;;;;;;;;iBAAuC,CAAA;AAE1E,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAW5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;iBAAuC,CAAA;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;iBAAoC,CAAA;AAEpE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;iBAmBnC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;iBAA8C,CAAA;AACnF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;iBAA2C,CAAA;AAClF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMtC,CAAA;AAED,eAAO,MAAM,4BAA4B;;;;;;;;;;;;iBAYvC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEjF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;iBAA6C,CAAA;AACtF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;iBAA+C,CAAA"}
@@ -0,0 +1,101 @@
1
+ import { z } from "zod";
2
+ export const paginatedEnvelope = (item) => z.object({
3
+ data: z.array(item),
4
+ total: z.number().int(),
5
+ limit: z.number().int(),
6
+ offset: z.number().int(),
7
+ });
8
+ export const singleEnvelope = (item) => z.object({ data: item });
9
+ export const listEnvelope = (item) => z.object({ data: z.array(item) });
10
+ export const successEnvelope = z.object({ success: z.boolean() });
11
+ export const quoteRecordSchema = z.object({
12
+ id: z.string(),
13
+ title: z.string(),
14
+ personId: z.string().nullable(),
15
+ organizationId: z.string().nullable(),
16
+ pipelineId: z.string(),
17
+ stageId: z.string(),
18
+ ownerId: z.string().nullable(),
19
+ status: z.string(),
20
+ acceptedVersionId: z.string().nullable(),
21
+ valueAmountCents: z.number().int().nullable(),
22
+ valueCurrency: z.string().nullable(),
23
+ expectedCloseDate: z.string().nullable(),
24
+ source: z.string().nullable(),
25
+ sourceRef: z.string().nullable(),
26
+ lostReason: z.string().nullable(),
27
+ tags: z.array(z.string()),
28
+ createdAt: z.string(),
29
+ updatedAt: z.string(),
30
+ stageChangedAt: z.string(),
31
+ closedAt: z.string().nullable(),
32
+ });
33
+ export const quoteListResponse = paginatedEnvelope(quoteRecordSchema);
34
+ export const quoteSingleResponse = singleEnvelope(quoteRecordSchema);
35
+ export const pipelineRecordSchema = z.object({
36
+ id: z.string(),
37
+ entityType: z.string(),
38
+ name: z.string(),
39
+ isDefault: z.boolean(),
40
+ sortOrder: z.number().int(),
41
+ createdAt: z.string(),
42
+ updatedAt: z.string(),
43
+ });
44
+ export const pipelineListResponse = paginatedEnvelope(pipelineRecordSchema);
45
+ export const pipelineSingleResponse = singleEnvelope(pipelineRecordSchema);
46
+ export const stageRecordSchema = z.object({
47
+ id: z.string(),
48
+ pipelineId: z.string(),
49
+ name: z.string(),
50
+ sortOrder: z.number().int(),
51
+ probability: z.number().int().nullable(),
52
+ isClosed: z.boolean(),
53
+ isWon: z.boolean(),
54
+ isLost: z.boolean(),
55
+ createdAt: z.string(),
56
+ updatedAt: z.string(),
57
+ });
58
+ export const stageListResponse = paginatedEnvelope(stageRecordSchema);
59
+ export const stageSingleResponse = singleEnvelope(stageRecordSchema);
60
+ export const quoteVersionRecordSchema = z.object({
61
+ id: z.string(),
62
+ quoteId: z.string(),
63
+ label: z.string().nullable(),
64
+ status: z.string(),
65
+ supersedesId: z.string().nullable(),
66
+ tripSnapshotId: z.string().nullable(),
67
+ validUntil: z.string().nullable(),
68
+ currency: z.string(),
69
+ subtotalAmountCents: z.number().int(),
70
+ taxAmountCents: z.number().int(),
71
+ totalAmountCents: z.number().int(),
72
+ notes: z.string().nullable(),
73
+ sentAt: z.string().nullable(),
74
+ viewedAt: z.string().nullable(),
75
+ decidedAt: z.string().nullable(),
76
+ createdAt: z.string(),
77
+ updatedAt: z.string(),
78
+ archivedAt: z.string().nullable(),
79
+ });
80
+ export const quoteVersionListResponse = paginatedEnvelope(quoteVersionRecordSchema);
81
+ export const quoteVersionSingleResponse = singleEnvelope(quoteVersionRecordSchema);
82
+ export const acceptQuoteVersionResponse = singleEnvelope(z.object({
83
+ quote: quoteRecordSchema,
84
+ quoteVersion: quoteVersionRecordSchema,
85
+ closedQuoteVersions: z.array(quoteVersionRecordSchema),
86
+ }));
87
+ export const quoteVersionLineRecordSchema = z.object({
88
+ id: z.string(),
89
+ quoteVersionId: z.string(),
90
+ productId: z.string().nullable(),
91
+ supplierServiceId: z.string().nullable(),
92
+ description: z.string(),
93
+ quantity: z.number().int(),
94
+ unitPriceAmountCents: z.number().int(),
95
+ totalAmountCents: z.number().int(),
96
+ currency: z.string(),
97
+ createdAt: z.string(),
98
+ updatedAt: z.string(),
99
+ });
100
+ export const quoteVersionLineListResponse = listEnvelope(quoteVersionLineRecordSchema);
101
+ export const quoteVersionLineSingleResponse = singleEnvelope(quoteVersionLineRecordSchema);
package/dist/ui.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { CreateQuoteDialog, type CreateQuoteDialogProps, } from "./components/create-quote-dialog.js";
2
+ export { CreateQuoteVersionDialog, type CreateQuoteVersionDialogProps, } from "./components/create-quote-version-dialog.js";
3
+ export { QuoteSummaryCard, type QuoteSummaryCardProps, } from "./components/quote-summary-card.js";
4
+ export { QuoteVersionLinesCard, type QuoteVersionLinesCardProps, } from "./components/quote-version-detail-sections.js";
5
+ export { QuoteVersionsPage, type QuoteVersionsPageProps, } from "./components/quote-versions-page.js";
6
+ export { QuotesBoard, type QuotesBoardProps, } from "./components/quotes-board.js";
7
+ export { type CrmUiMessageOverrides, type CrmUiMessages, CrmUiMessagesProvider, crmUiEn, crmUiMessageDefinitions, crmUiRo, getCrmUiI18n, resolveCrmUiMessages, useCrmUiI18n, useCrmUiI18nOrDefault, useCrmUiMessages, useCrmUiMessagesOrDefault, } from "./i18n/index.js";
8
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,wBAAwB,EACxB,KAAK,6BAA6B,GACnC,MAAM,6CAA6C,CAAA;AACpD,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,qBAAqB,EACrB,OAAO,EACP,uBAAuB,EACvB,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAA"}
package/dist/ui.js ADDED
@@ -0,0 +1,7 @@
1
+ export { CreateQuoteDialog, } from "./components/create-quote-dialog.js";
2
+ export { CreateQuoteVersionDialog, } from "./components/create-quote-version-dialog.js";
3
+ export { QuoteSummaryCard, } from "./components/quote-summary-card.js";
4
+ export { QuoteVersionLinesCard, } from "./components/quote-version-detail-sections.js";
5
+ export { QuoteVersionsPage, } from "./components/quote-versions-page.js";
6
+ export { QuotesBoard, } from "./components/quotes-board.js";
7
+ export { CrmUiMessagesProvider, crmUiEn, crmUiMessageDefinitions, crmUiRo, getCrmUiI18n, resolveCrmUiMessages, useCrmUiI18n, useCrmUiI18nOrDefault, useCrmUiMessages, useCrmUiMessagesOrDefault, } from "./i18n/index.js";