@truetms/truetms-node 0.4.1 → 0.4.3

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.
@@ -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
+ }
@@ -219,6 +219,7 @@ query getShipmentDetails($id: String!) {
219
219
  customer {
220
220
  _id
221
221
  name
222
+ code
222
223
  referenceNumberTypes
223
224
  address {
224
225
  coordinates {
@@ -252,6 +253,8 @@ query getShipmentDetails($id: String!) {
252
253
  shipper {
253
254
  _id
254
255
  name
256
+ externalId
257
+ code
255
258
  address {
256
259
  coordinates {
257
260
  latitude
@@ -264,6 +267,8 @@ query getShipmentDetails($id: String!) {
264
267
  receiver {
265
268
  _id
266
269
  name
270
+ externalId
271
+ code
267
272
  address {
268
273
  coordinates {
269
274
  latitude
@@ -400,4 +405,55 @@ query getShipmentDetails($id: String!) {
400
405
  }
401
406
  groupIds
402
407
  }
408
+ }
409
+
410
+ mutation createShipment($shipment: NewShipmentInput!) {
411
+ addShipment(newShipmentData: $shipment) {
412
+ _id
413
+ shipmentNumber
414
+ shipmentLocations {
415
+ shipper {
416
+ _id
417
+ }
418
+ }
419
+ }
420
+ }
421
+
422
+ mutation generateShipmentRoute($shipment: NewShipmentInput!) {
423
+ generateShipmentRoute(shipmentData: $shipment) {
424
+ locations {
425
+ _id
426
+ locationType
427
+ arrivalTime
428
+ timeWindows {
429
+ fromDate
430
+ toDate
431
+ }
432
+ location {
433
+ latitude
434
+ longitude
435
+ }
436
+ serviceDuration
437
+ setupDuration
438
+ tripShipmentLocationId
439
+ waitingDuration
440
+ }
441
+ routeDistance
442
+ firstPickupTime
443
+ distanceToStart
444
+ distanceToEnd
445
+ firstPickupTime
446
+ lastDropoffTime
447
+ }
448
+ }
449
+
450
+ mutation updateShipment($editShipmentData: ShipmentUpdateInput!, $id: String!) {
451
+ editShipment(editShipmentData: $editShipmentData, id: $id) {
452
+ _id
453
+ shipmentLocations {
454
+ shipper {
455
+ _id
456
+ }
457
+ }
458
+ }
403
459
  }
@@ -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
 
@@ -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;