@truetms/truetms-node 0.4.0 → 0.4.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/src/graphql/generated.js +313 -3
- package/dist/src/graphql/generated.js.map +1 -1
- package/dist/src/sdk/goodProfiles.js +21 -0
- package/dist/src/sdk/goodProfiles.js.map +1 -0
- package/dist/src/sdk/index.js +2 -0
- package/dist/src/sdk/index.js.map +1 -1
- package/dist/src/sdk/shipments.js +3 -0
- package/dist/src/sdk/shipments.js.map +1 -1
- package/package.json +1 -1
- package/src/graphql/drivers.graphql +18 -0
- package/src/graphql/generated.ts +1188 -28
- package/src/graphql/good-profile.graphql +129 -0
- package/src/graphql/shipments.graphql +51 -0
- package/src/sdk/goodProfiles.ts +26 -0
- package/src/sdk/index.ts +3 -0
- package/src/sdk/shipments.ts +3 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
query getGoodProfileList(
|
|
2
|
+
$search: String
|
|
3
|
+
$skip: Int
|
|
4
|
+
$take: Int
|
|
5
|
+
$filter: JSON
|
|
6
|
+
$orderBy: [OrderByItem!]
|
|
7
|
+
) {
|
|
8
|
+
goodProfiles(
|
|
9
|
+
search: $search
|
|
10
|
+
skip: $skip
|
|
11
|
+
take: $take
|
|
12
|
+
filter: $filter
|
|
13
|
+
orderBy: $orderBy
|
|
14
|
+
) {
|
|
15
|
+
data {
|
|
16
|
+
_id
|
|
17
|
+
code
|
|
18
|
+
label
|
|
19
|
+
weight
|
|
20
|
+
liquidGravity
|
|
21
|
+
unit
|
|
22
|
+
supplierIds
|
|
23
|
+
shipperIds
|
|
24
|
+
color
|
|
25
|
+
goodProfileClassId
|
|
26
|
+
goodProfileClass {
|
|
27
|
+
_id
|
|
28
|
+
label
|
|
29
|
+
}
|
|
30
|
+
equivalences {
|
|
31
|
+
equivalentGoodId
|
|
32
|
+
conditions {
|
|
33
|
+
operator
|
|
34
|
+
target
|
|
35
|
+
value
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
restrictions {
|
|
39
|
+
type
|
|
40
|
+
value
|
|
41
|
+
}
|
|
42
|
+
tags
|
|
43
|
+
customFields {
|
|
44
|
+
key
|
|
45
|
+
value
|
|
46
|
+
}
|
|
47
|
+
groupIds
|
|
48
|
+
}
|
|
49
|
+
count
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
query getGoodProfileDetails($id: String!) {
|
|
54
|
+
goodProfileById(id: $id) {
|
|
55
|
+
_id
|
|
56
|
+
code
|
|
57
|
+
label
|
|
58
|
+
documents {
|
|
59
|
+
_id
|
|
60
|
+
name
|
|
61
|
+
url
|
|
62
|
+
}
|
|
63
|
+
weight
|
|
64
|
+
liquidGravity
|
|
65
|
+
unit
|
|
66
|
+
supplierIds
|
|
67
|
+
shipperIds
|
|
68
|
+
color
|
|
69
|
+
goodProfileClassId
|
|
70
|
+
goodProfileClass {
|
|
71
|
+
_id
|
|
72
|
+
label
|
|
73
|
+
}
|
|
74
|
+
equivalences {
|
|
75
|
+
equivalentGoodId
|
|
76
|
+
conditions {
|
|
77
|
+
operator
|
|
78
|
+
target
|
|
79
|
+
value
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
restrictions {
|
|
83
|
+
type
|
|
84
|
+
value
|
|
85
|
+
}
|
|
86
|
+
tags
|
|
87
|
+
customFields {
|
|
88
|
+
key
|
|
89
|
+
value
|
|
90
|
+
}
|
|
91
|
+
groupIds
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
mutation deleteGoodProfile($id: String!) {
|
|
96
|
+
deleteGoodProfile(id: $id)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
mutation addGoodProfile($newGoodProfileData: NewGoodProfileInput!) {
|
|
100
|
+
addGoodProfile(newGoodProfileData: $newGoodProfileData) {
|
|
101
|
+
_id
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
mutation editGoodProfile(
|
|
106
|
+
$id: String!
|
|
107
|
+
$editGoodProfileData: GoodProfileUpdateInput!
|
|
108
|
+
) {
|
|
109
|
+
editGoodProfile(id: $id, editGoodProfileData: $editGoodProfileData) {
|
|
110
|
+
_id
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
mutation bulkAddGoodProfiles($newGoodProfilesData: [NewGoodProfileInput!]!) {
|
|
115
|
+
bulkAddGoodProfiles(newGoodProfilesData: $newGoodProfilesData) {
|
|
116
|
+
_id
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
mutation bulkEditGoodProfiles(
|
|
121
|
+
$editGoodProfileData: GoodProfileUpdateInput!
|
|
122
|
+
$ids: [ObjectId!]!
|
|
123
|
+
) {
|
|
124
|
+
bulkEditGoodProfiles(editGoodProfileData: $editGoodProfileData, ids: $ids) {
|
|
125
|
+
matchedCount
|
|
126
|
+
modifiedCount
|
|
127
|
+
upsertedCount
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -400,4 +400,55 @@ query getShipmentDetails($id: String!) {
|
|
|
400
400
|
}
|
|
401
401
|
groupIds
|
|
402
402
|
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
mutation createShipment($shipment: NewShipmentInput!) {
|
|
406
|
+
addShipment(newShipmentData: $shipment) {
|
|
407
|
+
_id
|
|
408
|
+
shipmentNumber
|
|
409
|
+
shipmentLocations {
|
|
410
|
+
shipper {
|
|
411
|
+
_id
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
mutation generateShipmentRoute($shipment: NewShipmentInput!) {
|
|
418
|
+
generateShipmentRoute(shipmentData: $shipment) {
|
|
419
|
+
locations {
|
|
420
|
+
_id
|
|
421
|
+
locationType
|
|
422
|
+
arrivalTime
|
|
423
|
+
timeWindows {
|
|
424
|
+
fromDate
|
|
425
|
+
toDate
|
|
426
|
+
}
|
|
427
|
+
location {
|
|
428
|
+
latitude
|
|
429
|
+
longitude
|
|
430
|
+
}
|
|
431
|
+
serviceDuration
|
|
432
|
+
setupDuration
|
|
433
|
+
tripShipmentLocationId
|
|
434
|
+
waitingDuration
|
|
435
|
+
}
|
|
436
|
+
routeDistance
|
|
437
|
+
firstPickupTime
|
|
438
|
+
distanceToStart
|
|
439
|
+
distanceToEnd
|
|
440
|
+
firstPickupTime
|
|
441
|
+
lastDropoffTime
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
mutation updateShipment($editShipmentData: ShipmentUpdateInput!, $id: String!) {
|
|
446
|
+
editShipment(editShipmentData: $editShipmentData, id: $id) {
|
|
447
|
+
_id
|
|
448
|
+
shipmentLocations {
|
|
449
|
+
shipper {
|
|
450
|
+
_id
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
403
454
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TrueTMSOptions, authenticateApiCall } from ".";
|
|
2
|
+
import trueTmsGraphqlClient from "../providers/truetms-graphql-client";
|
|
3
|
+
|
|
4
|
+
class TrueTMSGoodProfilesSdk {
|
|
5
|
+
constructor(private options: TrueTMSOptions) {}
|
|
6
|
+
|
|
7
|
+
getGoodProfileList = authenticateApiCall(
|
|
8
|
+
trueTmsGraphqlClient.getGoodProfileList
|
|
9
|
+
);
|
|
10
|
+
getGoodProfileDetails = authenticateApiCall(
|
|
11
|
+
trueTmsGraphqlClient.getGoodProfileDetails
|
|
12
|
+
);
|
|
13
|
+
deleteGoodProfile = authenticateApiCall(
|
|
14
|
+
trueTmsGraphqlClient.deleteGoodProfile
|
|
15
|
+
);
|
|
16
|
+
addGoodProfile = authenticateApiCall(trueTmsGraphqlClient.addGoodProfile);
|
|
17
|
+
editGoodProfile = authenticateApiCall(trueTmsGraphqlClient.editGoodProfile);
|
|
18
|
+
bulkAddGoodProfiles = authenticateApiCall(
|
|
19
|
+
trueTmsGraphqlClient.bulkAddGoodProfiles
|
|
20
|
+
);
|
|
21
|
+
bulkEditGoodProfiles = authenticateApiCall(
|
|
22
|
+
trueTmsGraphqlClient.bulkEditGoodProfiles
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default TrueTMSGoodProfilesSdk;
|
package/src/sdk/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import TrueTMSAuth, { exchangeRefreshTokenForAccessToken } from "./auth";
|
|
|
2
2
|
import TrueTMSBusinessEntitiesSdk from "./businessEntities";
|
|
3
3
|
import TrueTMSDriverSdk from "./drivers";
|
|
4
4
|
import TrueTMSDriverSettlementsSdk from "./driverSettlements";
|
|
5
|
+
import TrueTMSGoodProfilesSdk from "./goodProfiles";
|
|
5
6
|
import TrueTMSInvoicesSdk from "./invoices";
|
|
6
7
|
import TrueTMSShipmentsSdk from "./shipments";
|
|
7
8
|
import TrueTMSStorageFacilityReadingsSdk from "./storageFacilityReadings";
|
|
@@ -29,6 +30,7 @@ class TrueTMS {
|
|
|
29
30
|
public trips: TrueTMSTripsSdk;
|
|
30
31
|
public storageFacilityReadings: TrueTMSStorageFacilityReadingsSdk;
|
|
31
32
|
public shipments: TrueTMSShipmentsSdk;
|
|
33
|
+
public goodProfiles: TrueTMSGoodProfilesSdk;
|
|
32
34
|
|
|
33
35
|
constructor(private options: TrueTMSOptions) {
|
|
34
36
|
this.drivers = new TrueTMSDriverSdk(options);
|
|
@@ -44,6 +46,7 @@ class TrueTMS {
|
|
|
44
46
|
this.storageFacilityReadings = new TrueTMSStorageFacilityReadingsSdk(
|
|
45
47
|
options
|
|
46
48
|
);
|
|
49
|
+
this.goodProfiles = new TrueTMSGoodProfilesSdk(options);
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
|
package/src/sdk/shipments.ts
CHANGED
|
@@ -6,6 +6,9 @@ class TrueTMSShipmentsSdk {
|
|
|
6
6
|
|
|
7
7
|
getShipmentList = authenticateApiCall(trueTmsGraphqlClient.getShipmentList);
|
|
8
8
|
getShipmentDetails = authenticateApiCall(trueTmsGraphqlClient.getShipmentDetails);
|
|
9
|
+
createShipment = authenticateApiCall(trueTmsGraphqlClient.createShipment);
|
|
10
|
+
updateShipment = authenticateApiCall(trueTmsGraphqlClient.updateShipment);
|
|
11
|
+
generateShipmentRoute = authenticateApiCall(trueTmsGraphqlClient.generateShipmentRoute);
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export default TrueTMSShipmentsSdk;
|