@voyantjs/pricing-react 0.2.0 → 0.3.1
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/LICENSE +109 -0
- package/dist/hooks/index.d.ts +33 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +33 -0
- package/dist/hooks/use-cancellation-policies.d.ts +20 -0
- package/dist/hooks/use-cancellation-policies.d.ts.map +1 -0
- package/dist/hooks/use-cancellation-policies.js +12 -0
- package/dist/hooks/use-cancellation-policy-mutation.d.ts +57 -0
- package/dist/hooks/use-cancellation-policy-mutation.d.ts.map +1 -0
- package/dist/hooks/use-cancellation-policy-mutation.js +49 -0
- package/dist/hooks/use-cancellation-policy-rule-mutation.d.ts +58 -0
- package/dist/hooks/use-cancellation-policy-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-cancellation-policy-rule-mutation.js +49 -0
- package/dist/hooks/use-cancellation-policy-rule.d.ts +15 -0
- package/dist/hooks/use-cancellation-policy-rule.d.ts.map +1 -0
- package/dist/hooks/use-cancellation-policy-rule.js +12 -0
- package/dist/hooks/use-cancellation-policy-rules.d.ts +21 -0
- package/dist/hooks/use-cancellation-policy-rules.d.ts.map +1 -0
- package/dist/hooks/use-cancellation-policy-rules.js +12 -0
- package/dist/hooks/use-cancellation-policy.d.ts +14 -0
- package/dist/hooks/use-cancellation-policy.d.ts.map +1 -0
- package/dist/hooks/use-cancellation-policy.js +12 -0
- package/dist/hooks/use-dropoff-price-rule-mutation.d.ts +72 -0
- package/dist/hooks/use-dropoff-price-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-dropoff-price-rule-mutation.js +52 -0
- package/dist/hooks/use-dropoff-price-rule.d.ts +18 -0
- package/dist/hooks/use-dropoff-price-rule.d.ts.map +1 -0
- package/dist/hooks/use-dropoff-price-rule.js +12 -0
- package/dist/hooks/use-dropoff-price-rules.d.ts +24 -0
- package/dist/hooks/use-dropoff-price-rules.d.ts.map +1 -0
- package/dist/hooks/use-dropoff-price-rules.js +12 -0
- package/dist/hooks/use-extra-price-rule-mutation.d.ts +72 -0
- package/dist/hooks/use-extra-price-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-extra-price-rule-mutation.js +52 -0
- package/dist/hooks/use-extra-price-rule.d.ts +18 -0
- package/dist/hooks/use-extra-price-rule.d.ts.map +1 -0
- package/dist/hooks/use-extra-price-rule.js +12 -0
- package/dist/hooks/use-extra-price-rules.d.ts +24 -0
- package/dist/hooks/use-extra-price-rules.d.ts.map +1 -0
- package/dist/hooks/use-extra-price-rules.js +12 -0
- package/dist/hooks/use-option-price-rule-mutation.d.ts +98 -0
- package/dist/hooks/use-option-price-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-option-price-rule-mutation.js +66 -0
- package/dist/hooks/use-option-price-rule.d.ts +24 -0
- package/dist/hooks/use-option-price-rule.d.ts.map +1 -0
- package/dist/hooks/use-option-price-rule.js +12 -0
- package/dist/hooks/use-option-price-rules.d.ts +30 -0
- package/dist/hooks/use-option-price-rules.d.ts.map +1 -0
- package/dist/hooks/use-option-price-rules.js +12 -0
- package/dist/hooks/use-option-start-time-rule-mutation.d.ts +70 -0
- package/dist/hooks/use-option-start-time-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-option-start-time-rule-mutation.js +51 -0
- package/dist/hooks/use-option-start-time-rule.d.ts +17 -0
- package/dist/hooks/use-option-start-time-rule.d.ts.map +1 -0
- package/dist/hooks/use-option-start-time-rule.js +12 -0
- package/dist/hooks/use-option-start-time-rules.d.ts +23 -0
- package/dist/hooks/use-option-start-time-rules.d.ts.map +1 -0
- package/dist/hooks/use-option-start-time-rules.js +12 -0
- package/dist/hooks/use-option-unit-price-rule-mutation.d.ts +79 -0
- package/dist/hooks/use-option-unit-price-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-price-rule-mutation.js +54 -0
- package/dist/hooks/use-option-unit-price-rule.d.ts +19 -0
- package/dist/hooks/use-option-unit-price-rule.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-price-rule.js +12 -0
- package/dist/hooks/use-option-unit-price-rules.d.ts +25 -0
- package/dist/hooks/use-option-unit-price-rules.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-price-rules.js +12 -0
- package/dist/hooks/use-option-unit-tier-mutation.d.ts +50 -0
- package/dist/hooks/use-option-unit-tier-mutation.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-tier-mutation.js +48 -0
- package/dist/hooks/use-option-unit-tier.d.ts +14 -0
- package/dist/hooks/use-option-unit-tier.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-tier.js +12 -0
- package/dist/hooks/use-option-unit-tiers.d.ts +20 -0
- package/dist/hooks/use-option-unit-tiers.d.ts.map +1 -0
- package/dist/hooks/use-option-unit-tiers.js +12 -0
- package/dist/hooks/use-pickup-price-rule-mutation.d.ts +64 -0
- package/dist/hooks/use-pickup-price-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-pickup-price-rule-mutation.js +50 -0
- package/dist/hooks/use-pickup-price-rule.d.ts +16 -0
- package/dist/hooks/use-pickup-price-rule.d.ts.map +1 -0
- package/dist/hooks/use-pickup-price-rule.js +12 -0
- package/dist/hooks/use-pickup-price-rules.d.ts +22 -0
- package/dist/hooks/use-pickup-price-rules.d.ts.map +1 -0
- package/dist/hooks/use-pickup-price-rules.js +12 -0
- package/dist/hooks/use-price-catalog-mutation.d.ts +60 -0
- package/dist/hooks/use-price-catalog-mutation.d.ts.map +1 -0
- package/dist/hooks/use-price-catalog-mutation.js +51 -0
- package/dist/hooks/use-price-catalog.d.ts +14 -0
- package/dist/hooks/use-price-catalog.d.ts.map +1 -0
- package/dist/hooks/use-price-catalog.js +12 -0
- package/dist/hooks/use-price-catalogs.d.ts +20 -0
- package/dist/hooks/use-price-catalogs.d.ts.map +1 -0
- package/dist/hooks/use-price-catalogs.js +12 -0
- package/dist/hooks/use-price-schedule-mutation.d.ts +76 -0
- package/dist/hooks/use-price-schedule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-price-schedule-mutation.js +64 -0
- package/dist/hooks/use-price-schedule.d.ts +18 -0
- package/dist/hooks/use-price-schedule.d.ts.map +1 -0
- package/dist/hooks/use-price-schedule.js +12 -0
- package/dist/hooks/use-price-schedules.d.ts +28 -0
- package/dist/hooks/use-price-schedules.d.ts.map +1 -0
- package/dist/hooks/use-price-schedules.js +11 -0
- package/dist/hooks/use-pricing-categories.d.ts +1 -1
- package/dist/hooks/use-pricing-categories.d.ts.map +1 -1
- package/dist/hooks/use-pricing-categories.js +2 -0
- package/dist/hooks/use-pricing-category-mutation.d.ts +2 -2
- package/dist/hooks/use-pricing-category.d.ts +1 -1
- package/dist/hooks/use-pricing-category.d.ts.map +1 -1
- package/dist/hooks/use-pricing-category.js +2 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/provider.d.ts +1 -13
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +1 -16
- package/dist/query-keys.d.ts +116 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +33 -0
- package/dist/query-options.d.ts +1727 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +409 -0
- package/dist/schemas.d.ts +688 -3
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +165 -0
- package/package.json +42 -46
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +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;AA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;;;;;;;;;;;;iBAAiD,CAAA;AACzF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA8C,CAAA;AACxF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAqD,CAAA;AACjG,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;iBAAkD,CAAA;AAChG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;iBAAgD,CAAA;AACvF,eAAO,MAAM,4BAA4B;;;;;;;;;;;iBAA6C,CAAA;AACtF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;iBAAiD,CAAA;AACzF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;iBAA8C,CAAA;AACxF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;iBAAkD,CAAA;AAC3F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;iBAA+C,CAAA;AAC1F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;iBAAgD,CAAA;AACvF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;iBAA6C,CAAA;AACtF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;iBAAqD,CAAA;AACjG,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;iBAAkD,CAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -49,7 +49,172 @@ export const pricingCategoryDependencyRecordSchema = z.object({
|
|
|
49
49
|
createdAt: z.string(),
|
|
50
50
|
updatedAt: z.string(),
|
|
51
51
|
});
|
|
52
|
+
export const priceCatalogRecordSchema = z.object({
|
|
53
|
+
id: z.string(),
|
|
54
|
+
code: z.string(),
|
|
55
|
+
name: z.string(),
|
|
56
|
+
currencyCode: z.string(),
|
|
57
|
+
catalogType: z.enum(["public", "contract", "net", "gross", "promo", "internal", "other"]),
|
|
58
|
+
isDefault: z.boolean(),
|
|
59
|
+
active: z.boolean(),
|
|
60
|
+
notes: z.string().nullable(),
|
|
61
|
+
});
|
|
62
|
+
export const priceScheduleRecordSchema = z.object({
|
|
63
|
+
id: z.string(),
|
|
64
|
+
priceCatalogId: z.string(),
|
|
65
|
+
code: z.string().nullable(),
|
|
66
|
+
name: z.string(),
|
|
67
|
+
recurrenceRule: z.string(),
|
|
68
|
+
timezone: z.string().nullable(),
|
|
69
|
+
validFrom: z.string().nullable(),
|
|
70
|
+
validTo: z.string().nullable(),
|
|
71
|
+
weekdays: z.array(z.string()).nullable(),
|
|
72
|
+
priority: z.number().int(),
|
|
73
|
+
active: z.boolean(),
|
|
74
|
+
notes: z.string().nullable(),
|
|
75
|
+
});
|
|
76
|
+
export const cancellationPolicyRecordSchema = z.object({
|
|
77
|
+
id: z.string(),
|
|
78
|
+
name: z.string(),
|
|
79
|
+
code: z.string().nullable(),
|
|
80
|
+
policyType: z.enum(["simple", "advanced", "non_refundable", "custom"]),
|
|
81
|
+
simpleCutoffHours: z.number().int().nullable(),
|
|
82
|
+
isDefault: z.boolean(),
|
|
83
|
+
active: z.boolean(),
|
|
84
|
+
notes: z.string().nullable(),
|
|
85
|
+
});
|
|
86
|
+
export const cancellationPolicyRuleRecordSchema = z.object({
|
|
87
|
+
id: z.string(),
|
|
88
|
+
cancellationPolicyId: z.string(),
|
|
89
|
+
sortOrder: z.number().int(),
|
|
90
|
+
cutoffMinutesBefore: z.number().int().nullable(),
|
|
91
|
+
chargeType: z.enum(["none", "amount", "percentage"]),
|
|
92
|
+
chargeAmountCents: z.number().int().nullable(),
|
|
93
|
+
chargePercentBasisPoints: z.number().int().nullable(),
|
|
94
|
+
active: z.boolean(),
|
|
95
|
+
notes: z.string().nullable(),
|
|
96
|
+
});
|
|
97
|
+
export const optionPriceRuleRecordSchema = z.object({
|
|
98
|
+
id: z.string(),
|
|
99
|
+
productId: z.string(),
|
|
100
|
+
optionId: z.string(),
|
|
101
|
+
priceCatalogId: z.string(),
|
|
102
|
+
priceScheduleId: z.string().nullable(),
|
|
103
|
+
cancellationPolicyId: z.string().nullable(),
|
|
104
|
+
code: z.string().nullable(),
|
|
105
|
+
name: z.string(),
|
|
106
|
+
description: z.string().nullable(),
|
|
107
|
+
pricingMode: z.enum(["per_person", "per_booking", "starting_from", "free", "on_request"]),
|
|
108
|
+
baseSellAmountCents: z.number().int().nullable(),
|
|
109
|
+
baseCostAmountCents: z.number().int().nullable(),
|
|
110
|
+
minPerBooking: z.number().int().nullable(),
|
|
111
|
+
maxPerBooking: z.number().int().nullable(),
|
|
112
|
+
allPricingCategories: z.boolean(),
|
|
113
|
+
isDefault: z.boolean(),
|
|
114
|
+
active: z.boolean(),
|
|
115
|
+
notes: z.string().nullable(),
|
|
116
|
+
});
|
|
117
|
+
export const optionUnitPriceRuleRecordSchema = z.object({
|
|
118
|
+
id: z.string(),
|
|
119
|
+
optionPriceRuleId: z.string(),
|
|
120
|
+
optionId: z.string(),
|
|
121
|
+
unitId: z.string(),
|
|
122
|
+
pricingCategoryId: z.string().nullable(),
|
|
123
|
+
pricingMode: z.enum(["per_unit", "per_person", "per_booking", "included", "free", "on_request"]),
|
|
124
|
+
sellAmountCents: z.number().int().nullable(),
|
|
125
|
+
costAmountCents: z.number().int().nullable(),
|
|
126
|
+
minQuantity: z.number().int().nullable(),
|
|
127
|
+
maxQuantity: z.number().int().nullable(),
|
|
128
|
+
sortOrder: z.number().int(),
|
|
129
|
+
active: z.boolean(),
|
|
130
|
+
notes: z.string().nullable(),
|
|
131
|
+
});
|
|
132
|
+
export const optionUnitTierRecordSchema = z.object({
|
|
133
|
+
id: z.string(),
|
|
134
|
+
optionUnitPriceRuleId: z.string(),
|
|
135
|
+
minQuantity: z.number().int(),
|
|
136
|
+
maxQuantity: z.number().int().nullable(),
|
|
137
|
+
sellAmountCents: z.number().int().nullable(),
|
|
138
|
+
costAmountCents: z.number().int().nullable(),
|
|
139
|
+
active: z.boolean(),
|
|
140
|
+
sortOrder: z.number().int(),
|
|
141
|
+
});
|
|
142
|
+
export const pickupPriceRuleRecordSchema = z.object({
|
|
143
|
+
id: z.string(),
|
|
144
|
+
optionPriceRuleId: z.string(),
|
|
145
|
+
optionId: z.string(),
|
|
146
|
+
pickupPointId: z.string(),
|
|
147
|
+
pricingMode: z.enum(["included", "per_person", "per_booking", "on_request", "unavailable"]),
|
|
148
|
+
sellAmountCents: z.number().int().nullable(),
|
|
149
|
+
costAmountCents: z.number().int().nullable(),
|
|
150
|
+
active: z.boolean(),
|
|
151
|
+
sortOrder: z.number().int(),
|
|
152
|
+
notes: z.string().nullable(),
|
|
153
|
+
});
|
|
154
|
+
export const dropoffPriceRuleRecordSchema = z.object({
|
|
155
|
+
id: z.string(),
|
|
156
|
+
optionPriceRuleId: z.string(),
|
|
157
|
+
optionId: z.string(),
|
|
158
|
+
facilityId: z.string().nullable(),
|
|
159
|
+
dropoffCode: z.string().nullable(),
|
|
160
|
+
dropoffName: z.string(),
|
|
161
|
+
pricingMode: z.enum(["included", "per_person", "per_booking", "on_request", "unavailable"]),
|
|
162
|
+
sellAmountCents: z.number().int().nullable(),
|
|
163
|
+
costAmountCents: z.number().int().nullable(),
|
|
164
|
+
active: z.boolean(),
|
|
165
|
+
sortOrder: z.number().int(),
|
|
166
|
+
notes: z.string().nullable(),
|
|
167
|
+
});
|
|
168
|
+
export const extraPriceRuleRecordSchema = z.object({
|
|
169
|
+
id: z.string(),
|
|
170
|
+
optionPriceRuleId: z.string(),
|
|
171
|
+
optionId: z.string(),
|
|
172
|
+
productExtraId: z.string().nullable(),
|
|
173
|
+
optionExtraConfigId: z.string().nullable(),
|
|
174
|
+
pricingMode: z.enum(["included", "per_person", "per_booking", "on_request", "unavailable"]),
|
|
175
|
+
sellAmountCents: z.number().int().nullable(),
|
|
176
|
+
costAmountCents: z.number().int().nullable(),
|
|
177
|
+
active: z.boolean(),
|
|
178
|
+
sortOrder: z.number().int(),
|
|
179
|
+
notes: z.string().nullable(),
|
|
180
|
+
metadata: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
181
|
+
});
|
|
182
|
+
export const optionStartTimeRuleRecordSchema = z.object({
|
|
183
|
+
id: z.string(),
|
|
184
|
+
optionPriceRuleId: z.string(),
|
|
185
|
+
optionId: z.string(),
|
|
186
|
+
startTimeId: z.string(),
|
|
187
|
+
ruleMode: z.enum(["included", "excluded", "override", "adjustment"]),
|
|
188
|
+
adjustmentType: z.enum(["fixed", "percentage"]).nullable(),
|
|
189
|
+
sellAdjustmentCents: z.number().int().nullable(),
|
|
190
|
+
costAdjustmentCents: z.number().int().nullable(),
|
|
191
|
+
adjustmentBasisPoints: z.number().int().nullable(),
|
|
192
|
+
active: z.boolean(),
|
|
193
|
+
notes: z.string().nullable(),
|
|
194
|
+
});
|
|
52
195
|
export const pricingCategoryListResponse = paginatedEnvelope(pricingCategoryRecordSchema);
|
|
53
196
|
export const pricingCategorySingleResponse = singleEnvelope(pricingCategoryRecordSchema);
|
|
54
197
|
export const pricingCategoryDependencyListResponse = paginatedEnvelope(pricingCategoryDependencyRecordSchema);
|
|
55
198
|
export const pricingCategoryDependencySingleResponse = singleEnvelope(pricingCategoryDependencyRecordSchema);
|
|
199
|
+
export const priceCatalogListResponse = paginatedEnvelope(priceCatalogRecordSchema);
|
|
200
|
+
export const priceCatalogSingleResponse = singleEnvelope(priceCatalogRecordSchema);
|
|
201
|
+
export const priceScheduleListResponse = paginatedEnvelope(priceScheduleRecordSchema);
|
|
202
|
+
export const priceScheduleSingleResponse = singleEnvelope(priceScheduleRecordSchema);
|
|
203
|
+
export const cancellationPolicyListResponse = paginatedEnvelope(cancellationPolicyRecordSchema);
|
|
204
|
+
export const cancellationPolicySingleResponse = singleEnvelope(cancellationPolicyRecordSchema);
|
|
205
|
+
export const cancellationPolicyRuleListResponse = paginatedEnvelope(cancellationPolicyRuleRecordSchema);
|
|
206
|
+
export const cancellationPolicyRuleSingleResponse = singleEnvelope(cancellationPolicyRuleRecordSchema);
|
|
207
|
+
export const optionPriceRuleListResponse = paginatedEnvelope(optionPriceRuleRecordSchema);
|
|
208
|
+
export const optionPriceRuleSingleResponse = singleEnvelope(optionPriceRuleRecordSchema);
|
|
209
|
+
export const optionUnitPriceRuleListResponse = paginatedEnvelope(optionUnitPriceRuleRecordSchema);
|
|
210
|
+
export const optionUnitPriceRuleSingleResponse = singleEnvelope(optionUnitPriceRuleRecordSchema);
|
|
211
|
+
export const optionUnitTierListResponse = paginatedEnvelope(optionUnitTierRecordSchema);
|
|
212
|
+
export const optionUnitTierSingleResponse = singleEnvelope(optionUnitTierRecordSchema);
|
|
213
|
+
export const pickupPriceRuleListResponse = paginatedEnvelope(pickupPriceRuleRecordSchema);
|
|
214
|
+
export const pickupPriceRuleSingleResponse = singleEnvelope(pickupPriceRuleRecordSchema);
|
|
215
|
+
export const dropoffPriceRuleListResponse = paginatedEnvelope(dropoffPriceRuleRecordSchema);
|
|
216
|
+
export const dropoffPriceRuleSingleResponse = singleEnvelope(dropoffPriceRuleRecordSchema);
|
|
217
|
+
export const extraPriceRuleListResponse = paginatedEnvelope(extraPriceRuleRecordSchema);
|
|
218
|
+
export const extraPriceRuleSingleResponse = singleEnvelope(extraPriceRuleRecordSchema);
|
|
219
|
+
export const optionStartTimeRuleListResponse = paginatedEnvelope(optionStartTimeRuleRecordSchema);
|
|
220
|
+
export const optionStartTimeRuleSingleResponse = singleEnvelope(optionStartTimeRuleRecordSchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/pricing-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,67 +9,63 @@
|
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"./
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./provider": {
|
|
17
|
+
"types": "./dist/provider.d.ts",
|
|
18
|
+
"import": "./dist/provider.js"
|
|
19
|
+
},
|
|
20
|
+
"./hooks": {
|
|
21
|
+
"types": "./dist/hooks/index.d.ts",
|
|
22
|
+
"import": "./dist/hooks/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./client": {
|
|
25
|
+
"types": "./dist/client.d.ts",
|
|
26
|
+
"import": "./dist/client.js"
|
|
27
|
+
},
|
|
28
|
+
"./query-keys": {
|
|
29
|
+
"types": "./dist/query-keys.d.ts",
|
|
30
|
+
"import": "./dist/query-keys.js"
|
|
31
|
+
}
|
|
25
32
|
},
|
|
26
33
|
"peerDependencies": {
|
|
27
|
-
"@voyantjs/pricing": "workspace:*",
|
|
28
34
|
"@tanstack/react-query": "^5.0.0",
|
|
29
35
|
"react": "^19.0.0",
|
|
30
36
|
"react-dom": "^19.0.0",
|
|
31
|
-
"zod": "^4.0.0"
|
|
37
|
+
"zod": "^4.0.0",
|
|
38
|
+
"@voyantjs/pricing": "0.3.1"
|
|
32
39
|
},
|
|
33
40
|
"devDependencies": {
|
|
34
41
|
"@tanstack/react-query": "^5.96.2",
|
|
35
42
|
"@types/react": "^19.2.14",
|
|
36
43
|
"@types/react-dom": "^19.2.3",
|
|
37
|
-
"@voyantjs/pricing": "workspace:*",
|
|
38
|
-
"@voyantjs/voyant-typescript-config": "workspace:*",
|
|
39
44
|
"react": "^19.2.4",
|
|
40
45
|
"react-dom": "^19.2.4",
|
|
41
46
|
"typescript": "^6.0.2",
|
|
42
47
|
"vitest": "^4.1.2",
|
|
43
|
-
"zod": "^4.3.6"
|
|
48
|
+
"zod": "^4.3.6",
|
|
49
|
+
"@voyantjs/pricing": "0.3.1",
|
|
50
|
+
"@voyantjs/react": "0.3.1",
|
|
51
|
+
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@voyantjs/react": "0.3.1"
|
|
44
55
|
},
|
|
45
56
|
"files": [
|
|
46
57
|
"dist"
|
|
47
58
|
],
|
|
48
59
|
"publishConfig": {
|
|
49
|
-
"access": "public"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"import": "./dist/hooks/index.js"
|
|
62
|
-
},
|
|
63
|
-
"./client": {
|
|
64
|
-
"types": "./dist/client.d.ts",
|
|
65
|
-
"import": "./dist/client.js"
|
|
66
|
-
},
|
|
67
|
-
"./query-keys": {
|
|
68
|
-
"types": "./dist/query-keys.d.ts",
|
|
69
|
-
"import": "./dist/query-keys.js"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"main": "./dist/index.js",
|
|
73
|
-
"types": "./dist/index.d.ts"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsc -p tsconfig.json",
|
|
64
|
+
"clean": "rm -rf dist",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"lint": "biome check src/",
|
|
67
|
+
"test": "vitest run --passWithNoTests"
|
|
68
|
+
},
|
|
69
|
+
"main": "./dist/index.js",
|
|
70
|
+
"types": "./dist/index.d.ts"
|
|
71
|
+
}
|