vintrace-sdk 0.2.0 → 0.2.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/dist/index.cjs +75 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +425 -3
- package/dist/index.d.ts +425 -3
- package/dist/index.js +75 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1406,6 +1406,428 @@ declare const PurchaseOrderSchema: z.ZodObject<{
|
|
|
1406
1406
|
}, z.core.$strip>;
|
|
1407
1407
|
type PurchaseOrderLine = z.infer<typeof PurchaseOrderLineSchema>;
|
|
1408
1408
|
type PurchaseOrder = z.infer<typeof PurchaseOrderSchema>;
|
|
1409
|
+
declare const FractionTypeEnum: z.ZodEnum<{
|
|
1410
|
+
FREE_RUN: "FREE_RUN";
|
|
1411
|
+
PRESSINGS: "PRESSINGS";
|
|
1412
|
+
MUST: "MUST";
|
|
1413
|
+
LEES: "LEES";
|
|
1414
|
+
UNKNOWN: "UNKNOWN";
|
|
1415
|
+
COMBINED: "COMBINED";
|
|
1416
|
+
CONDENSATE: "CONDENSATE";
|
|
1417
|
+
PRESSINGS_LIGHT: "PRESSINGS_LIGHT";
|
|
1418
|
+
PRESSINGS_HEAVY: "PRESSINGS_HEAVY";
|
|
1419
|
+
DRAININGS: "DRAININGS";
|
|
1420
|
+
PRESSINGS_OVERNIGHT: "PRESSINGS_OVERNIGHT";
|
|
1421
|
+
SAIGNEE: "SAIGNEE";
|
|
1422
|
+
}>;
|
|
1423
|
+
declare const WineBatchDataSchema: z.ZodObject<{
|
|
1424
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1425
|
+
batchCode: z.ZodOptional<z.ZodString>;
|
|
1426
|
+
batchNumber: z.ZodOptional<z.ZodString>;
|
|
1427
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1428
|
+
productionYear: z.ZodOptional<z.ZodNumber>;
|
|
1429
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
1430
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1431
|
+
extId: z.ZodOptional<z.ZodString>;
|
|
1432
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1433
|
+
}, z.core.$strip>>;
|
|
1434
|
+
grading: z.ZodOptional<z.ZodObject<{
|
|
1435
|
+
scaleId: z.ZodOptional<z.ZodNumber>;
|
|
1436
|
+
scaleName: z.ZodOptional<z.ZodString>;
|
|
1437
|
+
valueId: z.ZodOptional<z.ZodNumber>;
|
|
1438
|
+
valueName: z.ZodOptional<z.ZodString>;
|
|
1439
|
+
}, z.core.$strip>>;
|
|
1440
|
+
program: z.ZodOptional<z.ZodObject<{
|
|
1441
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1442
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1443
|
+
}, z.core.$strip>>;
|
|
1444
|
+
designatedRegion: z.ZodOptional<z.ZodObject<{
|
|
1445
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1446
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1447
|
+
}, z.core.$strip>>;
|
|
1448
|
+
designatedSubRegion: z.ZodOptional<z.ZodObject<{
|
|
1449
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1450
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1451
|
+
}, z.core.$strip>>;
|
|
1452
|
+
designatedVariety: z.ZodOptional<z.ZodObject<{
|
|
1453
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1454
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1455
|
+
}, z.core.$strip>>;
|
|
1456
|
+
winery: z.ZodOptional<z.ZodObject<{
|
|
1457
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1458
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1459
|
+
businessUnit: z.ZodOptional<z.ZodString>;
|
|
1460
|
+
}, z.core.$strip>>;
|
|
1461
|
+
category: z.ZodOptional<z.ZodObject<{
|
|
1462
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1463
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1464
|
+
}, z.core.$strip>>;
|
|
1465
|
+
designatedProduct: z.ZodOptional<z.ZodObject<{
|
|
1466
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1467
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1468
|
+
}, z.core.$strip>>;
|
|
1469
|
+
costsTrackedPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1470
|
+
ageOfSpirits: z.ZodOptional<z.ZodString>;
|
|
1471
|
+
serviceOrder: z.ZodOptional<z.ZodObject<{
|
|
1472
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1473
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1474
|
+
}, z.core.$strip>>;
|
|
1475
|
+
fractionType: z.ZodOptional<z.ZodEnum<{
|
|
1476
|
+
FREE_RUN: "FREE_RUN";
|
|
1477
|
+
PRESSINGS: "PRESSINGS";
|
|
1478
|
+
MUST: "MUST";
|
|
1479
|
+
LEES: "LEES";
|
|
1480
|
+
UNKNOWN: "UNKNOWN";
|
|
1481
|
+
COMBINED: "COMBINED";
|
|
1482
|
+
CONDENSATE: "CONDENSATE";
|
|
1483
|
+
PRESSINGS_LIGHT: "PRESSINGS_LIGHT";
|
|
1484
|
+
PRESSINGS_HEAVY: "PRESSINGS_HEAVY";
|
|
1485
|
+
DRAININGS: "DRAININGS";
|
|
1486
|
+
PRESSINGS_OVERNIGHT: "PRESSINGS_OVERNIGHT";
|
|
1487
|
+
SAIGNEE: "SAIGNEE";
|
|
1488
|
+
}>>;
|
|
1489
|
+
inactive: z.ZodOptional<z.ZodBoolean>;
|
|
1490
|
+
vessels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1491
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1492
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1493
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
1494
|
+
TANK: "TANK";
|
|
1495
|
+
BIN: "BIN";
|
|
1496
|
+
BARREL: "BARREL";
|
|
1497
|
+
BARREL_GROUP: "BARREL_GROUP";
|
|
1498
|
+
BIN_GROUP: "BIN_GROUP";
|
|
1499
|
+
PRESS: "PRESS";
|
|
1500
|
+
TANKER: "TANKER";
|
|
1501
|
+
}>>;
|
|
1502
|
+
amount: z.ZodOptional<z.ZodObject<{
|
|
1503
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1504
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1505
|
+
}, z.core.$strip>>;
|
|
1506
|
+
}, z.core.$strip>>>;
|
|
1507
|
+
allocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1508
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
1509
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1510
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1511
|
+
}, z.core.$strip>>;
|
|
1512
|
+
vintage: z.ZodOptional<z.ZodString>;
|
|
1513
|
+
itemCode: z.ZodOptional<z.ZodString>;
|
|
1514
|
+
allocationVolume: z.ZodOptional<z.ZodObject<{
|
|
1515
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1516
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1517
|
+
}, z.core.$strip>>;
|
|
1518
|
+
allocationPercentageOfVessel: z.ZodOptional<z.ZodNumber>;
|
|
1519
|
+
}, z.core.$strip>>>;
|
|
1520
|
+
}, z.core.$strip>;
|
|
1521
|
+
declare const GetWineBatchSuccessResponseSchema: z.ZodObject<{
|
|
1522
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
1523
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
1524
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
1525
|
+
first: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1526
|
+
previous: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1527
|
+
next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1528
|
+
last: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1529
|
+
results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1530
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1531
|
+
batchCode: z.ZodOptional<z.ZodString>;
|
|
1532
|
+
batchNumber: z.ZodOptional<z.ZodString>;
|
|
1533
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1534
|
+
productionYear: z.ZodOptional<z.ZodNumber>;
|
|
1535
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
1536
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1537
|
+
extId: z.ZodOptional<z.ZodString>;
|
|
1538
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1539
|
+
}, z.core.$strip>>;
|
|
1540
|
+
grading: z.ZodOptional<z.ZodObject<{
|
|
1541
|
+
scaleId: z.ZodOptional<z.ZodNumber>;
|
|
1542
|
+
scaleName: z.ZodOptional<z.ZodString>;
|
|
1543
|
+
valueId: z.ZodOptional<z.ZodNumber>;
|
|
1544
|
+
valueName: z.ZodOptional<z.ZodString>;
|
|
1545
|
+
}, z.core.$strip>>;
|
|
1546
|
+
program: z.ZodOptional<z.ZodObject<{
|
|
1547
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1548
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1549
|
+
}, z.core.$strip>>;
|
|
1550
|
+
designatedRegion: z.ZodOptional<z.ZodObject<{
|
|
1551
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1552
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1553
|
+
}, z.core.$strip>>;
|
|
1554
|
+
designatedSubRegion: z.ZodOptional<z.ZodObject<{
|
|
1555
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1556
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1557
|
+
}, z.core.$strip>>;
|
|
1558
|
+
designatedVariety: z.ZodOptional<z.ZodObject<{
|
|
1559
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1560
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1561
|
+
}, z.core.$strip>>;
|
|
1562
|
+
winery: z.ZodOptional<z.ZodObject<{
|
|
1563
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1564
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1565
|
+
businessUnit: z.ZodOptional<z.ZodString>;
|
|
1566
|
+
}, z.core.$strip>>;
|
|
1567
|
+
category: z.ZodOptional<z.ZodObject<{
|
|
1568
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1569
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1570
|
+
}, z.core.$strip>>;
|
|
1571
|
+
designatedProduct: z.ZodOptional<z.ZodObject<{
|
|
1572
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1573
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1574
|
+
}, z.core.$strip>>;
|
|
1575
|
+
costsTrackedPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1576
|
+
ageOfSpirits: z.ZodOptional<z.ZodString>;
|
|
1577
|
+
serviceOrder: z.ZodOptional<z.ZodObject<{
|
|
1578
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1579
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1580
|
+
}, z.core.$strip>>;
|
|
1581
|
+
fractionType: z.ZodOptional<z.ZodEnum<{
|
|
1582
|
+
FREE_RUN: "FREE_RUN";
|
|
1583
|
+
PRESSINGS: "PRESSINGS";
|
|
1584
|
+
MUST: "MUST";
|
|
1585
|
+
LEES: "LEES";
|
|
1586
|
+
UNKNOWN: "UNKNOWN";
|
|
1587
|
+
COMBINED: "COMBINED";
|
|
1588
|
+
CONDENSATE: "CONDENSATE";
|
|
1589
|
+
PRESSINGS_LIGHT: "PRESSINGS_LIGHT";
|
|
1590
|
+
PRESSINGS_HEAVY: "PRESSINGS_HEAVY";
|
|
1591
|
+
DRAININGS: "DRAININGS";
|
|
1592
|
+
PRESSINGS_OVERNIGHT: "PRESSINGS_OVERNIGHT";
|
|
1593
|
+
SAIGNEE: "SAIGNEE";
|
|
1594
|
+
}>>;
|
|
1595
|
+
inactive: z.ZodOptional<z.ZodBoolean>;
|
|
1596
|
+
vessels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1597
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1598
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1599
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
1600
|
+
TANK: "TANK";
|
|
1601
|
+
BIN: "BIN";
|
|
1602
|
+
BARREL: "BARREL";
|
|
1603
|
+
BARREL_GROUP: "BARREL_GROUP";
|
|
1604
|
+
BIN_GROUP: "BIN_GROUP";
|
|
1605
|
+
PRESS: "PRESS";
|
|
1606
|
+
TANKER: "TANKER";
|
|
1607
|
+
}>>;
|
|
1608
|
+
amount: z.ZodOptional<z.ZodObject<{
|
|
1609
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1610
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1611
|
+
}, z.core.$strip>>;
|
|
1612
|
+
}, z.core.$strip>>>;
|
|
1613
|
+
allocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1614
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
1615
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1616
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1617
|
+
}, z.core.$strip>>;
|
|
1618
|
+
vintage: z.ZodOptional<z.ZodString>;
|
|
1619
|
+
itemCode: z.ZodOptional<z.ZodString>;
|
|
1620
|
+
allocationVolume: z.ZodOptional<z.ZodObject<{
|
|
1621
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1622
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1623
|
+
}, z.core.$strip>>;
|
|
1624
|
+
allocationPercentageOfVessel: z.ZodOptional<z.ZodNumber>;
|
|
1625
|
+
}, z.core.$strip>>>;
|
|
1626
|
+
}, z.core.$strip>>>;
|
|
1627
|
+
}, z.core.$strip>;
|
|
1628
|
+
declare const CreateWineBatchSuccessResponseSchema: z.ZodObject<{
|
|
1629
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
1630
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1631
|
+
batchCode: z.ZodOptional<z.ZodString>;
|
|
1632
|
+
batchNumber: z.ZodOptional<z.ZodString>;
|
|
1633
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1634
|
+
productionYear: z.ZodOptional<z.ZodNumber>;
|
|
1635
|
+
owner: z.ZodOptional<z.ZodObject<{
|
|
1636
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1637
|
+
extId: z.ZodOptional<z.ZodString>;
|
|
1638
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1639
|
+
}, z.core.$strip>>;
|
|
1640
|
+
grading: z.ZodOptional<z.ZodObject<{
|
|
1641
|
+
scaleId: z.ZodOptional<z.ZodNumber>;
|
|
1642
|
+
scaleName: z.ZodOptional<z.ZodString>;
|
|
1643
|
+
valueId: z.ZodOptional<z.ZodNumber>;
|
|
1644
|
+
valueName: z.ZodOptional<z.ZodString>;
|
|
1645
|
+
}, z.core.$strip>>;
|
|
1646
|
+
program: z.ZodOptional<z.ZodObject<{
|
|
1647
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1648
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1649
|
+
}, z.core.$strip>>;
|
|
1650
|
+
designatedRegion: z.ZodOptional<z.ZodObject<{
|
|
1651
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1652
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1653
|
+
}, z.core.$strip>>;
|
|
1654
|
+
designatedSubRegion: z.ZodOptional<z.ZodObject<{
|
|
1655
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1656
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1657
|
+
}, z.core.$strip>>;
|
|
1658
|
+
designatedVariety: z.ZodOptional<z.ZodObject<{
|
|
1659
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1660
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1661
|
+
}, z.core.$strip>>;
|
|
1662
|
+
winery: z.ZodOptional<z.ZodObject<{
|
|
1663
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1664
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1665
|
+
businessUnit: z.ZodOptional<z.ZodString>;
|
|
1666
|
+
}, z.core.$strip>>;
|
|
1667
|
+
category: z.ZodOptional<z.ZodObject<{
|
|
1668
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1669
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1670
|
+
}, z.core.$strip>>;
|
|
1671
|
+
designatedProduct: z.ZodOptional<z.ZodObject<{
|
|
1672
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1673
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1674
|
+
}, z.core.$strip>>;
|
|
1675
|
+
costsTrackedPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1676
|
+
ageOfSpirits: z.ZodOptional<z.ZodString>;
|
|
1677
|
+
serviceOrder: z.ZodOptional<z.ZodObject<{
|
|
1678
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1679
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1680
|
+
}, z.core.$strip>>;
|
|
1681
|
+
fractionType: z.ZodOptional<z.ZodEnum<{
|
|
1682
|
+
FREE_RUN: "FREE_RUN";
|
|
1683
|
+
PRESSINGS: "PRESSINGS";
|
|
1684
|
+
MUST: "MUST";
|
|
1685
|
+
LEES: "LEES";
|
|
1686
|
+
UNKNOWN: "UNKNOWN";
|
|
1687
|
+
COMBINED: "COMBINED";
|
|
1688
|
+
CONDENSATE: "CONDENSATE";
|
|
1689
|
+
PRESSINGS_LIGHT: "PRESSINGS_LIGHT";
|
|
1690
|
+
PRESSINGS_HEAVY: "PRESSINGS_HEAVY";
|
|
1691
|
+
DRAININGS: "DRAININGS";
|
|
1692
|
+
PRESSINGS_OVERNIGHT: "PRESSINGS_OVERNIGHT";
|
|
1693
|
+
SAIGNEE: "SAIGNEE";
|
|
1694
|
+
}>>;
|
|
1695
|
+
inactive: z.ZodOptional<z.ZodBoolean>;
|
|
1696
|
+
vessels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1697
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1698
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1699
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
1700
|
+
TANK: "TANK";
|
|
1701
|
+
BIN: "BIN";
|
|
1702
|
+
BARREL: "BARREL";
|
|
1703
|
+
BARREL_GROUP: "BARREL_GROUP";
|
|
1704
|
+
BIN_GROUP: "BIN_GROUP";
|
|
1705
|
+
PRESS: "PRESS";
|
|
1706
|
+
TANKER: "TANKER";
|
|
1707
|
+
}>>;
|
|
1708
|
+
amount: z.ZodOptional<z.ZodObject<{
|
|
1709
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1710
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1711
|
+
}, z.core.$strip>>;
|
|
1712
|
+
}, z.core.$strip>>>;
|
|
1713
|
+
allocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1714
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
1715
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1716
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1717
|
+
}, z.core.$strip>>;
|
|
1718
|
+
vintage: z.ZodOptional<z.ZodString>;
|
|
1719
|
+
itemCode: z.ZodOptional<z.ZodString>;
|
|
1720
|
+
allocationVolume: z.ZodOptional<z.ZodObject<{
|
|
1721
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1722
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1723
|
+
}, z.core.$strip>>;
|
|
1724
|
+
allocationPercentageOfVessel: z.ZodOptional<z.ZodNumber>;
|
|
1725
|
+
}, z.core.$strip>>>;
|
|
1726
|
+
}, z.core.$strip>>;
|
|
1727
|
+
}, z.core.$strip>;
|
|
1728
|
+
declare const CreateWineBatchRequestSchema: z.ZodObject<{
|
|
1729
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1730
|
+
batchNumber: z.ZodOptional<z.ZodString>;
|
|
1731
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1732
|
+
grading: z.ZodOptional<z.ZodObject<{
|
|
1733
|
+
scaleId: z.ZodOptional<z.ZodNumber>;
|
|
1734
|
+
scaleName: z.ZodOptional<z.ZodString>;
|
|
1735
|
+
valueId: z.ZodOptional<z.ZodNumber>;
|
|
1736
|
+
valueName: z.ZodOptional<z.ZodString>;
|
|
1737
|
+
}, z.core.$strip>>;
|
|
1738
|
+
program: z.ZodOptional<z.ZodObject<{
|
|
1739
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1740
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1741
|
+
}, z.core.$strip>>;
|
|
1742
|
+
designatedRegion: z.ZodOptional<z.ZodObject<{
|
|
1743
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1744
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1745
|
+
}, z.core.$strip>>;
|
|
1746
|
+
designatedSubRegion: z.ZodOptional<z.ZodObject<{
|
|
1747
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1748
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1749
|
+
}, z.core.$strip>>;
|
|
1750
|
+
designatedVariety: z.ZodOptional<z.ZodObject<{
|
|
1751
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1752
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1753
|
+
}, z.core.$strip>>;
|
|
1754
|
+
category: z.ZodOptional<z.ZodObject<{
|
|
1755
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1756
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1757
|
+
}, z.core.$strip>>;
|
|
1758
|
+
designatedProduct: z.ZodOptional<z.ZodObject<{
|
|
1759
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1760
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1761
|
+
}, z.core.$strip>>;
|
|
1762
|
+
costsTrackedPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1763
|
+
ageOfSpirits: z.ZodOptional<z.ZodString>;
|
|
1764
|
+
serviceOrder: z.ZodOptional<z.ZodObject<{
|
|
1765
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1766
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1767
|
+
}, z.core.$strip>>;
|
|
1768
|
+
fractionType: z.ZodOptional<z.ZodEnum<{
|
|
1769
|
+
FREE_RUN: "FREE_RUN";
|
|
1770
|
+
PRESSINGS: "PRESSINGS";
|
|
1771
|
+
MUST: "MUST";
|
|
1772
|
+
LEES: "LEES";
|
|
1773
|
+
UNKNOWN: "UNKNOWN";
|
|
1774
|
+
COMBINED: "COMBINED";
|
|
1775
|
+
CONDENSATE: "CONDENSATE";
|
|
1776
|
+
PRESSINGS_LIGHT: "PRESSINGS_LIGHT";
|
|
1777
|
+
PRESSINGS_HEAVY: "PRESSINGS_HEAVY";
|
|
1778
|
+
DRAININGS: "DRAININGS";
|
|
1779
|
+
PRESSINGS_OVERNIGHT: "PRESSINGS_OVERNIGHT";
|
|
1780
|
+
SAIGNEE: "SAIGNEE";
|
|
1781
|
+
}>>;
|
|
1782
|
+
inactive: z.ZodOptional<z.ZodBoolean>;
|
|
1783
|
+
vessels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1784
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1785
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1786
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
1787
|
+
TANK: "TANK";
|
|
1788
|
+
BIN: "BIN";
|
|
1789
|
+
BARREL: "BARREL";
|
|
1790
|
+
BARREL_GROUP: "BARREL_GROUP";
|
|
1791
|
+
BIN_GROUP: "BIN_GROUP";
|
|
1792
|
+
PRESS: "PRESS";
|
|
1793
|
+
TANKER: "TANKER";
|
|
1794
|
+
}>>;
|
|
1795
|
+
amount: z.ZodOptional<z.ZodObject<{
|
|
1796
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1797
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1798
|
+
}, z.core.$strip>>;
|
|
1799
|
+
}, z.core.$strip>>>;
|
|
1800
|
+
allocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1801
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
1802
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1803
|
+
code: z.ZodOptional<z.ZodString>;
|
|
1804
|
+
}, z.core.$strip>>;
|
|
1805
|
+
vintage: z.ZodOptional<z.ZodString>;
|
|
1806
|
+
itemCode: z.ZodOptional<z.ZodString>;
|
|
1807
|
+
allocationVolume: z.ZodOptional<z.ZodObject<{
|
|
1808
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
1809
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1810
|
+
}, z.core.$strip>>;
|
|
1811
|
+
allocationPercentageOfVessel: z.ZodOptional<z.ZodNumber>;
|
|
1812
|
+
}, z.core.$strip>>>;
|
|
1813
|
+
batchCode: z.ZodString;
|
|
1814
|
+
productionYear: z.ZodNumber;
|
|
1815
|
+
winery: z.ZodObject<{
|
|
1816
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1817
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1818
|
+
businessUnit: z.ZodOptional<z.ZodString>;
|
|
1819
|
+
}, z.core.$strip>;
|
|
1820
|
+
owner: z.ZodObject<{
|
|
1821
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1822
|
+
extId: z.ZodOptional<z.ZodString>;
|
|
1823
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1824
|
+
}, z.core.$strip>;
|
|
1825
|
+
}, z.core.$strip>;
|
|
1826
|
+
type FractionType = z.infer<typeof FractionTypeEnum>;
|
|
1827
|
+
type WineBatchData = z.infer<typeof WineBatchDataSchema>;
|
|
1828
|
+
type GetWineBatchSuccessResponse = z.infer<typeof GetWineBatchSuccessResponseSchema>;
|
|
1829
|
+
type CreateWineBatchSuccessResponse = z.infer<typeof CreateWineBatchSuccessResponseSchema>;
|
|
1830
|
+
type CreateWineBatchRequest = z.infer<typeof CreateWineBatchRequestSchema>;
|
|
1409
1831
|
|
|
1410
1832
|
interface WorkOrderListParams {
|
|
1411
1833
|
/**
|
|
@@ -1755,11 +2177,11 @@ declare class WineBatchesClient {
|
|
|
1755
2177
|
*
|
|
1756
2178
|
* Returns a paginated list of wine batches.
|
|
1757
2179
|
*/
|
|
1758
|
-
getAll(params?: WineBatchesListParams): Promise<VintraceResult<
|
|
2180
|
+
getAll(params?: WineBatchesListParams): Promise<VintraceResult<WineBatchData[]>>;
|
|
1759
2181
|
/**
|
|
1760
2182
|
* Create a wine batch.
|
|
1761
2183
|
*/
|
|
1762
|
-
create(data:
|
|
2184
|
+
create(data: CreateWineBatchRequest): Promise<VintraceResult<CreateWineBatchSuccessResponse>>;
|
|
1763
2185
|
}
|
|
1764
2186
|
declare class TirageClient {
|
|
1765
2187
|
private client;
|
|
@@ -2073,4 +2495,4 @@ declare class VintraceValidationSchemaError extends VintraceError {
|
|
|
2073
2495
|
declare function validateResponse<T>(schema: ZodType<T>, data: unknown, correlationId?: string): VintraceResult<T>;
|
|
2074
2496
|
declare function validateRequest<T>(schema: ZodType<T>, data: unknown, correlationId?: string): VintraceResult<T>;
|
|
2075
2497
|
|
|
2076
|
-
export { type AnalysisMeasurement, type AnalysisMetricData, type Block, type BlockData, type BlocksListParams, type CompositionComponent, type CostsBusinessUnitTransactionsParams, DEFAULT_OPTIONS, type IntakeOperationSearchParams, type InventoryListParams, type MrpStockHistoryParams, type MrpStockNotesParams, type PaginatedResponse, type PaginationOptions, type PartyListParams, type ProductAnalysisParams, type ProductAnalysisResponse, type ProductCompositionResponse, type ProductListParams, type ProductMetricData, type PurchaseOrder, type PurchaseOrderLine, type RateOfChange, type RefundListParams, type RequestOptions, type SalesOrderListParams, type SampleOperationSearchParams, type SearchListParams, type StockDispatchesListParams, type StockLookupParams, type TransactionSearchParams, type VesselDetailsReportParams, VintraceAggregateError, VintraceAuthenticationError, VintraceClient, type VintraceClientConfig, type VintraceClientOptions, VintraceError, VintraceFetchError, VintraceNotFoundError, VintraceRateLimitError, type VintraceResult, VintraceServerError, VintraceValidationError, VintraceValidationSchemaError, type WineBatchesListParams, type WorkOrderListParams, batchGet, paginate, validateRequest, validateResponse, vintraceFetch };
|
|
2498
|
+
export { type AnalysisMeasurement, type AnalysisMetricData, type Block, type BlockData, type BlocksListParams, type CompositionComponent, type CostsBusinessUnitTransactionsParams, type CreateWineBatchRequest, type CreateWineBatchSuccessResponse, DEFAULT_OPTIONS, type FractionType, type GetWineBatchSuccessResponse, type IntakeOperationSearchParams, type InventoryListParams, type MrpStockHistoryParams, type MrpStockNotesParams, type PaginatedResponse, type PaginationOptions, type PartyListParams, type ProductAnalysisParams, type ProductAnalysisResponse, type ProductCompositionResponse, type ProductListParams, type ProductMetricData, type PurchaseOrder, type PurchaseOrderLine, type RateOfChange, type RefundListParams, type RequestOptions, type SalesOrderListParams, type SampleOperationSearchParams, type SearchListParams, type StockDispatchesListParams, type StockLookupParams, type TransactionSearchParams, type VesselDetailsReportParams, VintraceAggregateError, VintraceAuthenticationError, VintraceClient, type VintraceClientConfig, type VintraceClientOptions, VintraceError, VintraceFetchError, VintraceNotFoundError, VintraceRateLimitError, type VintraceResult, VintraceServerError, VintraceValidationError, VintraceValidationSchemaError, type WineBatchData, type WineBatchesListParams, type WorkOrderListParams, batchGet, paginate, validateRequest, validateResponse, vintraceFetch };
|
package/dist/index.js
CHANGED
|
@@ -1456,6 +1456,59 @@ var PurchaseOrderSchema = z.object({
|
|
|
1456
1456
|
var PurchaseOrderResponseSchema = z.object({
|
|
1457
1457
|
data: PurchaseOrderSchema
|
|
1458
1458
|
});
|
|
1459
|
+
var FractionTypeEnum = z.enum([
|
|
1460
|
+
"FREE_RUN",
|
|
1461
|
+
"PRESSINGS",
|
|
1462
|
+
"MUST",
|
|
1463
|
+
"LEES",
|
|
1464
|
+
"UNKNOWN",
|
|
1465
|
+
"COMBINED",
|
|
1466
|
+
"CONDENSATE",
|
|
1467
|
+
"PRESSINGS_LIGHT",
|
|
1468
|
+
"PRESSINGS_HEAVY",
|
|
1469
|
+
"DRAININGS",
|
|
1470
|
+
"PRESSINGS_OVERNIGHT",
|
|
1471
|
+
"SAIGNEE"
|
|
1472
|
+
]);
|
|
1473
|
+
var WineBatchVesselSchema = z.object({
|
|
1474
|
+
id: z.number().optional(),
|
|
1475
|
+
name: z.string().optional(),
|
|
1476
|
+
type: z.enum(["TANK", "BIN", "BARREL", "BARREL_GROUP", "BIN_GROUP", "PRESS", "TANKER"]).optional(),
|
|
1477
|
+
amount: MeasurementSchema.optional()
|
|
1478
|
+
});
|
|
1479
|
+
var WineBatchDataSchema = z.object({
|
|
1480
|
+
id: z.number().optional(),
|
|
1481
|
+
batchCode: z.string().optional(),
|
|
1482
|
+
batchNumber: z.string().optional(),
|
|
1483
|
+
description: z.string().optional(),
|
|
1484
|
+
productionYear: z.number().optional(),
|
|
1485
|
+
owner: ExtIdentifiableEntitySchema.optional(),
|
|
1486
|
+
grading: VesselGradingSchema.optional(),
|
|
1487
|
+
program: IdentifiableEntitySchema.optional(),
|
|
1488
|
+
designatedRegion: IdentifiableEntitySchema.optional(),
|
|
1489
|
+
designatedSubRegion: IdentifiableEntitySchema.optional(),
|
|
1490
|
+
designatedVariety: IdentifiableEntitySchema.optional(),
|
|
1491
|
+
winery: WinerySchema.optional(),
|
|
1492
|
+
category: IdentifiableEntitySchema.optional(),
|
|
1493
|
+
designatedProduct: IdentifiableEntitySchema.optional(),
|
|
1494
|
+
costsTrackedPercentage: z.number().optional(),
|
|
1495
|
+
ageOfSpirits: z.string().optional(),
|
|
1496
|
+
serviceOrder: IdentifiableEntitySchema.optional(),
|
|
1497
|
+
fractionType: FractionTypeEnum.optional(),
|
|
1498
|
+
inactive: z.boolean().optional(),
|
|
1499
|
+
vessels: z.array(WineBatchVesselSchema).optional(),
|
|
1500
|
+
allocations: z.array(AllocationSliceSchema).optional()
|
|
1501
|
+
});
|
|
1502
|
+
var GetWineBatchSuccessResponseSchema = PaginatedResponseSchema(WineBatchDataSchema);
|
|
1503
|
+
var CreateWineBatchSuccessResponseSchema = z.object({
|
|
1504
|
+
data: WineBatchDataSchema.optional()
|
|
1505
|
+
});
|
|
1506
|
+
var CreateWineBatchRequestSchema = WineBatchDataSchema.extend({
|
|
1507
|
+
batchCode: z.string(),
|
|
1508
|
+
productionYear: z.number(),
|
|
1509
|
+
winery: WinerySchema,
|
|
1510
|
+
owner: ExtIdentifiableEntitySchema
|
|
1511
|
+
});
|
|
1459
1512
|
|
|
1460
1513
|
// src/client/VintraceClient.ts
|
|
1461
1514
|
var VintraceClient = class {
|
|
@@ -2309,11 +2362,17 @@ var WineBatchesClient = class {
|
|
|
2309
2362
|
*/
|
|
2310
2363
|
async getAll(params) {
|
|
2311
2364
|
const limit = params?.limit ?? 100;
|
|
2365
|
+
const queryParams = {
|
|
2366
|
+
limit: String(limit),
|
|
2367
|
+
offset: String(params?.offset ?? 0)
|
|
2368
|
+
};
|
|
2369
|
+
if (params?.ids) queryParams.ids = params.ids;
|
|
2370
|
+
if (params?.include) queryParams.include = params.include;
|
|
2312
2371
|
const firstResponse = await this.client.request(
|
|
2313
2372
|
"v7/operation/wine-batches",
|
|
2314
2373
|
"GET",
|
|
2315
|
-
{},
|
|
2316
|
-
|
|
2374
|
+
{ responseSchema: GetWineBatchSuccessResponseSchema },
|
|
2375
|
+
queryParams
|
|
2317
2376
|
);
|
|
2318
2377
|
if (firstResponse[1]) {
|
|
2319
2378
|
return [null, firstResponse[1]];
|
|
@@ -2333,13 +2392,13 @@ var WineBatchesClient = class {
|
|
|
2333
2392
|
const batchSize = Math.min(parallelLimit, pagesNeeded - i);
|
|
2334
2393
|
const batchPromises = [];
|
|
2335
2394
|
for (let j = 0; j < batchSize; j++) {
|
|
2336
|
-
const
|
|
2395
|
+
const pageOffset = (i + j) * limit;
|
|
2337
2396
|
batchPromises.push(
|
|
2338
2397
|
this.client.request(
|
|
2339
2398
|
"v7/operation/wine-batches",
|
|
2340
2399
|
"GET",
|
|
2341
|
-
{},
|
|
2342
|
-
{ ...
|
|
2400
|
+
{ responseSchema: GetWineBatchSuccessResponseSchema },
|
|
2401
|
+
{ ...queryParams, offset: String(pageOffset) }
|
|
2343
2402
|
)
|
|
2344
2403
|
);
|
|
2345
2404
|
}
|
|
@@ -2348,9 +2407,8 @@ var WineBatchesClient = class {
|
|
|
2348
2407
|
if (pageError) {
|
|
2349
2408
|
return [null, pageError];
|
|
2350
2409
|
}
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
allResults.push(...pData.results);
|
|
2410
|
+
if (pageData?.results) {
|
|
2411
|
+
allResults.push(...pageData.results);
|
|
2354
2412
|
}
|
|
2355
2413
|
}
|
|
2356
2414
|
}
|
|
@@ -2360,7 +2418,15 @@ var WineBatchesClient = class {
|
|
|
2360
2418
|
* Create a wine batch.
|
|
2361
2419
|
*/
|
|
2362
2420
|
create(data) {
|
|
2363
|
-
return this.client.request(
|
|
2421
|
+
return this.client.request(
|
|
2422
|
+
"v7/operation/wine-batches",
|
|
2423
|
+
"POST",
|
|
2424
|
+
{
|
|
2425
|
+
responseSchema: CreateWineBatchSuccessResponseSchema,
|
|
2426
|
+
requestSchema: CreateWineBatchRequestSchema
|
|
2427
|
+
},
|
|
2428
|
+
data
|
|
2429
|
+
);
|
|
2364
2430
|
}
|
|
2365
2431
|
};
|
|
2366
2432
|
var TirageClient = class {
|