@gesagro/jaspion-sdk 2.0.0 → 2.0.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.
- package/dist/index.d.mts +70 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +139 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -4
package/dist/index.d.mts
CHANGED
|
@@ -348,6 +348,26 @@ declare class FarrowingCollectionForm extends Report implements PdfReport {
|
|
|
348
348
|
pdf(input: FarrowingCollectionFormInput): Promise<void>;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
interface FarrowingForecastInput {
|
|
352
|
+
farmId: string;
|
|
353
|
+
dateRange: {
|
|
354
|
+
start: string;
|
|
355
|
+
end: string;
|
|
356
|
+
};
|
|
357
|
+
calendarType: CalendarType;
|
|
358
|
+
parity: number | null;
|
|
359
|
+
locationId: string | null;
|
|
360
|
+
pen: string | null;
|
|
361
|
+
}
|
|
362
|
+
declare class FarrowingForecast extends Report implements PdfReport, CsvReport {
|
|
363
|
+
readonly template = "@pig-master/farrowing-forecast";
|
|
364
|
+
fileName: string;
|
|
365
|
+
pdf(input: FarrowingForecastInput): Promise<void>;
|
|
366
|
+
csv(input: FarrowingForecastInput): Promise<void>;
|
|
367
|
+
private getResources;
|
|
368
|
+
private getParameters;
|
|
369
|
+
}
|
|
370
|
+
|
|
351
371
|
interface FarrowingListInput {
|
|
352
372
|
farmId: string;
|
|
353
373
|
calendarType: CalendarType;
|
|
@@ -731,6 +751,7 @@ declare class FemaleSwineRecord extends Report implements PdfReport {
|
|
|
731
751
|
|
|
732
752
|
interface FemaleSwineSalePlanningListInput {
|
|
733
753
|
farmId: string;
|
|
754
|
+
query: string | null;
|
|
734
755
|
dateRange: {
|
|
735
756
|
start: string;
|
|
736
757
|
end: string;
|
|
@@ -970,6 +991,29 @@ declare class MaternityPigletTransferCollectionForm extends Report implements Pd
|
|
|
970
991
|
pdf(input: MaternityPigletTransferCollectionFormInput): Promise<void>;
|
|
971
992
|
}
|
|
972
993
|
|
|
994
|
+
interface MaternityPigletTransferListInput {
|
|
995
|
+
dateRange: {
|
|
996
|
+
start: string;
|
|
997
|
+
end: string;
|
|
998
|
+
} | null;
|
|
999
|
+
calendarType: CalendarType;
|
|
1000
|
+
donorId: string | null;
|
|
1001
|
+
donorParity: number | null;
|
|
1002
|
+
donorContext: MaternityContext | null;
|
|
1003
|
+
recipientId: string | null;
|
|
1004
|
+
recipientParity: number | null;
|
|
1005
|
+
recipientContext: MaternityContext | null;
|
|
1006
|
+
farmId: string;
|
|
1007
|
+
}
|
|
1008
|
+
declare class MaternityPigletTransferList extends Report implements PdfReport, CsvReport {
|
|
1009
|
+
readonly template = "@pig-master/maternity-piglet-transfer-list";
|
|
1010
|
+
fileName: string;
|
|
1011
|
+
pdf(input: MaternityPigletTransferListInput): Promise<void>;
|
|
1012
|
+
csv(input: MaternityPigletTransferListInput): Promise<void>;
|
|
1013
|
+
private getResources;
|
|
1014
|
+
private getParameters;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
973
1017
|
type FemaleSwineArrivalReproductiveStatus = 'virgin' | 'pregnant' | 'empty';
|
|
974
1018
|
|
|
975
1019
|
type MatingContext = 'first' | 'normal' | 'estrus-return' | 'post-reproductive-failure';
|
|
@@ -1328,6 +1372,29 @@ declare class WeaningCollectionForm extends Report implements PdfReport {
|
|
|
1328
1372
|
pdf(input: WeaningCollectionFormInput): Promise<void>;
|
|
1329
1373
|
}
|
|
1330
1374
|
|
|
1375
|
+
interface WeaningForecastInput {
|
|
1376
|
+
farmId: string;
|
|
1377
|
+
weaningDate: string;
|
|
1378
|
+
calendarType: CalendarType;
|
|
1379
|
+
parity: number | null;
|
|
1380
|
+
locationId: string | null;
|
|
1381
|
+
pen: string | null;
|
|
1382
|
+
lactationLengthRange: {
|
|
1383
|
+
start: number;
|
|
1384
|
+
end: number;
|
|
1385
|
+
} | null;
|
|
1386
|
+
context: MaternityContext | null;
|
|
1387
|
+
orderBy: OrderBy<'earTag' | 'lactatingLength' | 'parity' | 'locationName' | 'createdAt'>;
|
|
1388
|
+
}
|
|
1389
|
+
declare class WeaningForecast extends Report implements PdfReport, CsvReport {
|
|
1390
|
+
readonly template = "@pig-master/weaning-forecast";
|
|
1391
|
+
fileName: string;
|
|
1392
|
+
pdf(input: WeaningForecastInput): Promise<void>;
|
|
1393
|
+
csv(input: WeaningForecastInput): Promise<void>;
|
|
1394
|
+
private getResources;
|
|
1395
|
+
private getParameters;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1331
1398
|
interface WeaningListInput {
|
|
1332
1399
|
farmId: string;
|
|
1333
1400
|
dateRange: {
|
|
@@ -1428,6 +1495,9 @@ declare class PigMaster {
|
|
|
1428
1495
|
readonly maternityPigletDeathList: MaternityPigletDeathList;
|
|
1429
1496
|
readonly weaningList: WeaningList;
|
|
1430
1497
|
readonly farrowingList: FarrowingList;
|
|
1498
|
+
readonly maternityPigletTransferList: MaternityPigletTransferList;
|
|
1499
|
+
readonly weaningForecast: WeaningForecast;
|
|
1500
|
+
readonly farrowingForecast: FarrowingForecast;
|
|
1431
1501
|
constructor(http: HttpClient);
|
|
1432
1502
|
}
|
|
1433
1503
|
|
package/dist/index.d.ts
CHANGED
|
@@ -348,6 +348,26 @@ declare class FarrowingCollectionForm extends Report implements PdfReport {
|
|
|
348
348
|
pdf(input: FarrowingCollectionFormInput): Promise<void>;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
interface FarrowingForecastInput {
|
|
352
|
+
farmId: string;
|
|
353
|
+
dateRange: {
|
|
354
|
+
start: string;
|
|
355
|
+
end: string;
|
|
356
|
+
};
|
|
357
|
+
calendarType: CalendarType;
|
|
358
|
+
parity: number | null;
|
|
359
|
+
locationId: string | null;
|
|
360
|
+
pen: string | null;
|
|
361
|
+
}
|
|
362
|
+
declare class FarrowingForecast extends Report implements PdfReport, CsvReport {
|
|
363
|
+
readonly template = "@pig-master/farrowing-forecast";
|
|
364
|
+
fileName: string;
|
|
365
|
+
pdf(input: FarrowingForecastInput): Promise<void>;
|
|
366
|
+
csv(input: FarrowingForecastInput): Promise<void>;
|
|
367
|
+
private getResources;
|
|
368
|
+
private getParameters;
|
|
369
|
+
}
|
|
370
|
+
|
|
351
371
|
interface FarrowingListInput {
|
|
352
372
|
farmId: string;
|
|
353
373
|
calendarType: CalendarType;
|
|
@@ -731,6 +751,7 @@ declare class FemaleSwineRecord extends Report implements PdfReport {
|
|
|
731
751
|
|
|
732
752
|
interface FemaleSwineSalePlanningListInput {
|
|
733
753
|
farmId: string;
|
|
754
|
+
query: string | null;
|
|
734
755
|
dateRange: {
|
|
735
756
|
start: string;
|
|
736
757
|
end: string;
|
|
@@ -970,6 +991,29 @@ declare class MaternityPigletTransferCollectionForm extends Report implements Pd
|
|
|
970
991
|
pdf(input: MaternityPigletTransferCollectionFormInput): Promise<void>;
|
|
971
992
|
}
|
|
972
993
|
|
|
994
|
+
interface MaternityPigletTransferListInput {
|
|
995
|
+
dateRange: {
|
|
996
|
+
start: string;
|
|
997
|
+
end: string;
|
|
998
|
+
} | null;
|
|
999
|
+
calendarType: CalendarType;
|
|
1000
|
+
donorId: string | null;
|
|
1001
|
+
donorParity: number | null;
|
|
1002
|
+
donorContext: MaternityContext | null;
|
|
1003
|
+
recipientId: string | null;
|
|
1004
|
+
recipientParity: number | null;
|
|
1005
|
+
recipientContext: MaternityContext | null;
|
|
1006
|
+
farmId: string;
|
|
1007
|
+
}
|
|
1008
|
+
declare class MaternityPigletTransferList extends Report implements PdfReport, CsvReport {
|
|
1009
|
+
readonly template = "@pig-master/maternity-piglet-transfer-list";
|
|
1010
|
+
fileName: string;
|
|
1011
|
+
pdf(input: MaternityPigletTransferListInput): Promise<void>;
|
|
1012
|
+
csv(input: MaternityPigletTransferListInput): Promise<void>;
|
|
1013
|
+
private getResources;
|
|
1014
|
+
private getParameters;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
973
1017
|
type FemaleSwineArrivalReproductiveStatus = 'virgin' | 'pregnant' | 'empty';
|
|
974
1018
|
|
|
975
1019
|
type MatingContext = 'first' | 'normal' | 'estrus-return' | 'post-reproductive-failure';
|
|
@@ -1328,6 +1372,29 @@ declare class WeaningCollectionForm extends Report implements PdfReport {
|
|
|
1328
1372
|
pdf(input: WeaningCollectionFormInput): Promise<void>;
|
|
1329
1373
|
}
|
|
1330
1374
|
|
|
1375
|
+
interface WeaningForecastInput {
|
|
1376
|
+
farmId: string;
|
|
1377
|
+
weaningDate: string;
|
|
1378
|
+
calendarType: CalendarType;
|
|
1379
|
+
parity: number | null;
|
|
1380
|
+
locationId: string | null;
|
|
1381
|
+
pen: string | null;
|
|
1382
|
+
lactationLengthRange: {
|
|
1383
|
+
start: number;
|
|
1384
|
+
end: number;
|
|
1385
|
+
} | null;
|
|
1386
|
+
context: MaternityContext | null;
|
|
1387
|
+
orderBy: OrderBy<'earTag' | 'lactatingLength' | 'parity' | 'locationName' | 'createdAt'>;
|
|
1388
|
+
}
|
|
1389
|
+
declare class WeaningForecast extends Report implements PdfReport, CsvReport {
|
|
1390
|
+
readonly template = "@pig-master/weaning-forecast";
|
|
1391
|
+
fileName: string;
|
|
1392
|
+
pdf(input: WeaningForecastInput): Promise<void>;
|
|
1393
|
+
csv(input: WeaningForecastInput): Promise<void>;
|
|
1394
|
+
private getResources;
|
|
1395
|
+
private getParameters;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1331
1398
|
interface WeaningListInput {
|
|
1332
1399
|
farmId: string;
|
|
1333
1400
|
dateRange: {
|
|
@@ -1428,6 +1495,9 @@ declare class PigMaster {
|
|
|
1428
1495
|
readonly maternityPigletDeathList: MaternityPigletDeathList;
|
|
1429
1496
|
readonly weaningList: WeaningList;
|
|
1430
1497
|
readonly farrowingList: FarrowingList;
|
|
1498
|
+
readonly maternityPigletTransferList: MaternityPigletTransferList;
|
|
1499
|
+
readonly weaningForecast: WeaningForecast;
|
|
1500
|
+
readonly farrowingForecast: FarrowingForecast;
|
|
1431
1501
|
constructor(http: HttpClient);
|
|
1432
1502
|
}
|
|
1433
1503
|
|
package/dist/index.js
CHANGED
|
@@ -639,6 +639,46 @@ var FarrowingCollectionForm = class extends Report {
|
|
|
639
639
|
}
|
|
640
640
|
};
|
|
641
641
|
|
|
642
|
+
// src/namespaces/pig-master/reports/farrowing-forecast.ts
|
|
643
|
+
var FarrowingForecast = class extends Report {
|
|
644
|
+
constructor() {
|
|
645
|
+
super(...arguments);
|
|
646
|
+
this.template = "@pig-master/farrowing-forecast";
|
|
647
|
+
this.fileName = "Previs\xE3o de partos";
|
|
648
|
+
}
|
|
649
|
+
async pdf(input) {
|
|
650
|
+
await this.requestPdf({
|
|
651
|
+
resources: this.getResources(input),
|
|
652
|
+
parameters: [
|
|
653
|
+
...this.getParameters(input),
|
|
654
|
+
{ key: "DATA_ONLY", value: false }
|
|
655
|
+
]
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
async csv(input) {
|
|
659
|
+
await this.requestCsv({
|
|
660
|
+
resources: this.getResources(input),
|
|
661
|
+
parameters: [
|
|
662
|
+
...this.getParameters(input),
|
|
663
|
+
{ key: "DATA_ONLY", value: true }
|
|
664
|
+
]
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
getResources(input) {
|
|
668
|
+
return [{ key: "FARM_ID", value: input.farmId }];
|
|
669
|
+
}
|
|
670
|
+
getParameters(input) {
|
|
671
|
+
return [
|
|
672
|
+
{ key: "DATE_BEGIN", value: input.dateRange.start },
|
|
673
|
+
{ key: "DATE_END", value: input.dateRange.end },
|
|
674
|
+
{ key: "CALENDAR", value: input.calendarType },
|
|
675
|
+
{ key: "PARITY", value: input.parity?.toString() ?? null },
|
|
676
|
+
{ key: "LOCATION_ID", value: input.locationId },
|
|
677
|
+
{ key: "PEN", value: input.pen }
|
|
678
|
+
];
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
|
|
642
682
|
// src/core/to-snake-case.ts
|
|
643
683
|
function toSnakeCase(str) {
|
|
644
684
|
return str.replace(/[A-Z]/g, (letter, index) => {
|
|
@@ -1359,6 +1399,7 @@ var FemaleSwineSalePlanningList = class extends Report {
|
|
|
1359
1399
|
getParameters(input) {
|
|
1360
1400
|
return [
|
|
1361
1401
|
{ key: "CALENDAR", value: input.calendarType },
|
|
1402
|
+
{ key: "QUERY", value: input.query },
|
|
1362
1403
|
{ key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
|
|
1363
1404
|
{ key: "DATE_END", value: input.dateRange?.end ?? null },
|
|
1364
1405
|
{ key: "RECIPIENT_ID", value: input.recipientId },
|
|
@@ -1798,6 +1839,52 @@ var MaternityPigletTransferCollectionForm = class extends Report {
|
|
|
1798
1839
|
}
|
|
1799
1840
|
};
|
|
1800
1841
|
|
|
1842
|
+
// src/namespaces/pig-master/reports/maternity-piglet-transfer-list.ts
|
|
1843
|
+
var MaternityPigletTransferList = class extends Report {
|
|
1844
|
+
constructor() {
|
|
1845
|
+
super(...arguments);
|
|
1846
|
+
this.template = "@pig-master/maternity-piglet-transfer-list";
|
|
1847
|
+
this.fileName = "Listagem de transfer\xEAncias de leit\xE3o";
|
|
1848
|
+
}
|
|
1849
|
+
async pdf(input) {
|
|
1850
|
+
await this.requestPdf({
|
|
1851
|
+
resources: this.getResources(input),
|
|
1852
|
+
parameters: [
|
|
1853
|
+
...this.getParameters(input),
|
|
1854
|
+
{ key: "DATA_ONLY", value: false }
|
|
1855
|
+
]
|
|
1856
|
+
});
|
|
1857
|
+
}
|
|
1858
|
+
async csv(input) {
|
|
1859
|
+
await this.requestCsv({
|
|
1860
|
+
resources: this.getResources(input),
|
|
1861
|
+
parameters: [
|
|
1862
|
+
...this.getParameters(input),
|
|
1863
|
+
{ key: "DATA_ONLY", value: true }
|
|
1864
|
+
]
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
getResources(input) {
|
|
1868
|
+
return [{ key: "FARM_ID", value: input.farmId }];
|
|
1869
|
+
}
|
|
1870
|
+
getParameters(input) {
|
|
1871
|
+
return [
|
|
1872
|
+
{ key: "DATE_BEGIN", value: input.dateRange?.start ?? null },
|
|
1873
|
+
{ key: "DATE_END", value: input.dateRange?.end ?? null },
|
|
1874
|
+
{ key: "CALENDAR", value: input.calendarType },
|
|
1875
|
+
{ key: "DONOR_ID", value: input.donorId },
|
|
1876
|
+
{ key: "DONOR_PARITY", value: input.donorParity?.toString() ?? null },
|
|
1877
|
+
{ key: "DONOR_CONTEXT", value: input.donorContext },
|
|
1878
|
+
{ key: "RECIPIENT_ID", value: input.recipientId },
|
|
1879
|
+
{
|
|
1880
|
+
key: "RECIPIENT_PARITY",
|
|
1881
|
+
value: input.recipientParity?.toString() ?? null
|
|
1882
|
+
},
|
|
1883
|
+
{ key: "RECIPIENT_CONTEXT", value: input.recipientContext }
|
|
1884
|
+
];
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1801
1888
|
// src/namespaces/pig-master/reports/mating-analysis.ts
|
|
1802
1889
|
var MatingAnalysis = class extends Report {
|
|
1803
1890
|
constructor() {
|
|
@@ -2373,6 +2460,55 @@ var WeaningCollectionForm = class extends Report {
|
|
|
2373
2460
|
}
|
|
2374
2461
|
};
|
|
2375
2462
|
|
|
2463
|
+
// src/namespaces/pig-master/reports/weaning-forecast.ts
|
|
2464
|
+
var WeaningForecast = class extends Report {
|
|
2465
|
+
constructor() {
|
|
2466
|
+
super(...arguments);
|
|
2467
|
+
this.template = "@pig-master/weaning-forecast";
|
|
2468
|
+
this.fileName = "Previs\xE3o de desmames";
|
|
2469
|
+
}
|
|
2470
|
+
async pdf(input) {
|
|
2471
|
+
await this.requestPdf({
|
|
2472
|
+
resources: this.getResources(input),
|
|
2473
|
+
parameters: [
|
|
2474
|
+
...this.getParameters(input),
|
|
2475
|
+
{ key: "DATA_ONLY", value: false }
|
|
2476
|
+
]
|
|
2477
|
+
});
|
|
2478
|
+
}
|
|
2479
|
+
async csv(input) {
|
|
2480
|
+
await this.requestCsv({
|
|
2481
|
+
resources: this.getResources(input),
|
|
2482
|
+
parameters: [
|
|
2483
|
+
...this.getParameters(input),
|
|
2484
|
+
{ key: "DATA_ONLY", value: true }
|
|
2485
|
+
]
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2488
|
+
getResources(input) {
|
|
2489
|
+
return [{ key: "FARM_ID", value: input.farmId }];
|
|
2490
|
+
}
|
|
2491
|
+
getParameters(input) {
|
|
2492
|
+
return [
|
|
2493
|
+
{ key: "WEANING_DATE", value: input.weaningDate },
|
|
2494
|
+
{ key: "CALENDAR", value: input.calendarType },
|
|
2495
|
+
{ key: "PARITY", value: input.parity?.toString() ?? null },
|
|
2496
|
+
{ key: "LOCATION_ID", value: input.locationId },
|
|
2497
|
+
{ key: "PEN", value: input.pen },
|
|
2498
|
+
{
|
|
2499
|
+
key: "MIN_LACTATION_DAYS",
|
|
2500
|
+
value: input.lactationLengthRange?.start.toString() ?? null
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
key: "MAX_LACTATION_DAYS",
|
|
2504
|
+
value: input.lactationLengthRange?.end.toString() ?? null
|
|
2505
|
+
},
|
|
2506
|
+
{ key: "ORDERBYDIRECTION", value: input.orderBy.direction },
|
|
2507
|
+
{ key: "ORDERBYCOLUMN", value: toSnakeCase(input.orderBy.column) }
|
|
2508
|
+
];
|
|
2509
|
+
}
|
|
2510
|
+
};
|
|
2511
|
+
|
|
2376
2512
|
// src/namespaces/pig-master/reports/weaning-list.ts
|
|
2377
2513
|
var WeaningList = class extends Report {
|
|
2378
2514
|
constructor() {
|
|
@@ -2510,6 +2646,9 @@ var PigMaster = class {
|
|
|
2510
2646
|
this.maternityPigletDeathList = new MaternityPigletDeathList(http);
|
|
2511
2647
|
this.weaningList = new WeaningList(http);
|
|
2512
2648
|
this.farrowingList = new FarrowingList(http);
|
|
2649
|
+
this.maternityPigletTransferList = new MaternityPigletTransferList(http);
|
|
2650
|
+
this.weaningForecast = new WeaningForecast(http);
|
|
2651
|
+
this.farrowingForecast = new FarrowingForecast(http);
|
|
2513
2652
|
}
|
|
2514
2653
|
};
|
|
2515
2654
|
|