@truetms/truetms-node 0.3.3 → 0.4.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.
@@ -0,0 +1,403 @@
1
+ query getShipmentList(
2
+ $search: String
3
+ $sort: ShipmentSort
4
+ $skip: Int
5
+ $take: Int
6
+ $status: Status
7
+ $receiverId: String
8
+ $excludePastShipments: Boolean
9
+ $filter: JSON
10
+ $orderBy: [OrderByItem!]
11
+ ) {
12
+ shipments(
13
+ search: $search
14
+ sort: $sort
15
+ skip: $skip
16
+ take: $take
17
+ status: $status
18
+ filter: $filter
19
+ orderBy: $orderBy
20
+ excludeRecurrentShipments: true
21
+ excludeRotationShipments: true
22
+ receiverId: $receiverId
23
+ excludePastShipments: $excludePastShipments
24
+ ) {
25
+ data {
26
+ _id
27
+ shipmentNumber
28
+ purchaseOrderNumbers
29
+ billOfLadingNumbers
30
+ referenceNumbers
31
+ ticketNumbers
32
+ status
33
+ trailerType
34
+ additionalTrailerTypes
35
+ shipmentLocations {
36
+ _id
37
+ locationType
38
+ timeWindows {
39
+ fromDate
40
+ toDate
41
+ }
42
+ shippedGoods {
43
+ _id
44
+ goodProfileId
45
+ label
46
+ quantity
47
+ unit
48
+ weight
49
+ supplierId
50
+ }
51
+ shipper {
52
+ _id
53
+ }
54
+ }
55
+ route {
56
+ locations {
57
+ _id
58
+ locationType
59
+ location {
60
+ latitude
61
+ longitude
62
+ }
63
+ name
64
+ addressLabel
65
+ addressTimezone
66
+ shipper {
67
+ _id
68
+ name
69
+ address {
70
+ label
71
+ }
72
+ addressTimezone
73
+ }
74
+ receiver {
75
+ _id
76
+ name
77
+ address {
78
+ label
79
+ }
80
+ addressTimezone
81
+ }
82
+ timeWindows {
83
+ fromDate
84
+ toDate
85
+ }
86
+ }
87
+ firstPickupTime
88
+ lastDropoffTime
89
+ }
90
+ tripId
91
+ trip {
92
+ _id
93
+ tripNumber
94
+ driver
95
+ tractor
96
+ trailer
97
+ driverEntity {
98
+ _id
99
+ firstname
100
+ lastname
101
+ phoneNumber
102
+ status
103
+ }
104
+ tractorEntity {
105
+ _id
106
+ serialNumber
107
+ licenseNumber
108
+ status
109
+ }
110
+ trailerEntity {
111
+ _id
112
+ serialNumber
113
+ licenseNumber
114
+ status
115
+ type
116
+ }
117
+ carrier
118
+ carrierEntity {
119
+ _id
120
+ name
121
+ contact {
122
+ firstname
123
+ lastname
124
+ phoneNumber
125
+ }
126
+ status
127
+ type
128
+ address {
129
+ label
130
+ coordinates {
131
+ latitude
132
+ longitude
133
+ }
134
+ }
135
+ }
136
+ }
137
+ isSplit
138
+ isFromSplit
139
+ isFromRotation
140
+ parentShipment {
141
+ _id
142
+ }
143
+ tags
144
+ customFields {
145
+ key
146
+ value
147
+ }
148
+ groupIds
149
+ }
150
+ count
151
+ }
152
+ }
153
+
154
+ query getShipmentDetails($id: String!) {
155
+ shipmentById(id: $id) {
156
+ _id
157
+ shipmentNumber
158
+ commodityType
159
+ events {
160
+ _id
161
+ coordinates {
162
+ altitude
163
+ heading
164
+ latitude
165
+ longitude
166
+ speed
167
+ }
168
+ createdBy
169
+ date
170
+ shipmentLocation
171
+ type
172
+ label
173
+ description
174
+ metadata
175
+ }
176
+ issues {
177
+ _id
178
+ type
179
+ content
180
+ date
181
+ shipmentLocation
182
+ delayAmount
183
+ }
184
+ constraints {
185
+ type
186
+ value
187
+ unit
188
+ }
189
+ documents {
190
+ _id
191
+ associatedCharge
192
+ accessLevel
193
+ isBillable
194
+ name
195
+ type
196
+ url
197
+ shipper {
198
+ _id
199
+ name
200
+ }
201
+ receiver {
202
+ _id
203
+ name
204
+ }
205
+ }
206
+ notes {
207
+ _id
208
+ accessLevel
209
+ receiver {
210
+ _id
211
+ name
212
+ }
213
+ shipper {
214
+ _id
215
+ name
216
+ }
217
+ content
218
+ }
219
+ customer {
220
+ _id
221
+ name
222
+ referenceNumberTypes
223
+ address {
224
+ coordinates {
225
+ latitude
226
+ longitude
227
+ }
228
+ label
229
+ }
230
+ contact {
231
+ firstname
232
+ lastname
233
+ phoneNumber
234
+ }
235
+ name
236
+ type
237
+ }
238
+ purchaseOrderNumbers
239
+ billOfLadingNumbers
240
+ referenceNumbers
241
+ purchaseOrderNumbers
242
+ billOfLadingNumbers
243
+ referenceNumbers
244
+ ticketNumbers
245
+ status
246
+ shipmentLocations {
247
+ _id
248
+ name
249
+ addressLabel
250
+ addressTimezone
251
+ addressTimezone
252
+ shipper {
253
+ _id
254
+ name
255
+ address {
256
+ coordinates {
257
+ latitude
258
+ latitude
259
+ }
260
+ label
261
+ }
262
+ addressTimezone
263
+ }
264
+ receiver {
265
+ _id
266
+ name
267
+ address {
268
+ coordinates {
269
+ latitude
270
+ latitude
271
+ }
272
+ label
273
+ }
274
+ addressTimezone
275
+ }
276
+ shippedGoods {
277
+ _id
278
+ quantity
279
+ weight
280
+ label
281
+ unit
282
+ goodProfileId
283
+ supplierId
284
+ pinCode
285
+ }
286
+ receivedGoods {
287
+ goodId
288
+ quantity
289
+ goodProfileId
290
+ shipperId
291
+ supplierId
292
+ pinCode
293
+ }
294
+ timeWindows {
295
+ fromDate
296
+ toDate
297
+ }
298
+ location {
299
+ latitude
300
+ longitude
301
+ }
302
+ locationType
303
+ }
304
+ constraints {
305
+ type
306
+ value
307
+ unit
308
+ }
309
+ charges {
310
+ _id
311
+ total
312
+ label
313
+ rate
314
+ unit
315
+ unitType
316
+ reimburseToDriver
317
+ relatedTransactionId
318
+ billingRule {
319
+ _id
320
+ label
321
+ referenceNumber
322
+ }
323
+ document {
324
+ name
325
+ url
326
+ }
327
+ taxable
328
+ }
329
+ expenses {
330
+ _id
331
+ label
332
+ rate
333
+ unit
334
+ unitType
335
+ reimburseToDriver
336
+ document {
337
+ name
338
+ url
339
+ }
340
+ customFields {
341
+ key
342
+ value
343
+ }
344
+ }
345
+ route {
346
+ routeDistance
347
+ predictedLoadedDistance
348
+ locations {
349
+ _id
350
+ shipper {
351
+ _id
352
+ }
353
+ receiver {
354
+ _id
355
+ }
356
+ timeWindows {
357
+ fromDate
358
+ toDate
359
+ }
360
+ }
361
+ firstPickupTime
362
+ }
363
+ createdBy
364
+ trailerType
365
+ additionalTrailerTypes
366
+ loadType
367
+ tripId
368
+ reasonForCancellation
369
+ isSplit
370
+ isFromSplit
371
+ childShipmentIds
372
+ recurrence {
373
+ freq
374
+ interval
375
+ dtstart
376
+ until
377
+ byweekday {
378
+ weekday
379
+ n
380
+ }
381
+ count
382
+ bysetpos
383
+ bymonth
384
+ bymonthday
385
+ bynmonthday
386
+ byyearday
387
+ byweekno
388
+ byhour
389
+ byminute
390
+ bysecond
391
+ }
392
+ dailyRotationCount
393
+ parentShipment {
394
+ _id
395
+ }
396
+ tags
397
+ customFields {
398
+ key
399
+ value
400
+ }
401
+ groupIds
402
+ }
403
+ }
@@ -95,3 +95,189 @@ query listTrips(
95
95
  }
96
96
  }
97
97
  }
98
+
99
+ query getTripDetails($id: String!) {
100
+ tripById(id: $id) {
101
+ _id
102
+ tripNumber
103
+ status
104
+ routeDistance
105
+ totalDistance
106
+ loadedDistance
107
+ firstPickupTime
108
+ shipmentLocations {
109
+ _id
110
+ name
111
+ addressLabel
112
+ addressTimezone
113
+ location {
114
+ latitude
115
+ longitude
116
+ }
117
+ locationType
118
+ shipper {
119
+ _id
120
+ name
121
+ address {
122
+ label
123
+ }
124
+ addressTimezone
125
+ }
126
+ timeWindows {
127
+ fromDate
128
+ toDate
129
+ }
130
+ receiver {
131
+ _id
132
+ name
133
+ address {
134
+ label
135
+ }
136
+ addressTimezone
137
+ }
138
+ shippedGoods {
139
+ _id
140
+ label
141
+ quantity
142
+ weight
143
+ unit
144
+ goodProfileId
145
+ supplierId
146
+ pinCode
147
+ }
148
+ receivedGoods {
149
+ goodId
150
+ quantity
151
+ goodProfileId
152
+ }
153
+ arrivalTime
154
+ waitingDuration
155
+ setupDuration
156
+ serviceDuration
157
+ shipmentId
158
+ }
159
+ violations {
160
+ cause
161
+ duration
162
+ locationId
163
+ }
164
+ shipments {
165
+ _id
166
+ isFromSplit
167
+ isFromRotation
168
+ parentShipment {
169
+ _id
170
+ }
171
+ shipmentNumber
172
+ referenceNumbers
173
+ status
174
+ charges {
175
+ _id
176
+ rate
177
+ unit
178
+ total
179
+ }
180
+ trailerType
181
+ additionalTrailerTypes
182
+ events {
183
+ _id
184
+ type
185
+ label
186
+ description
187
+ date
188
+ shipmentLocation
189
+ coordinates {
190
+ latitude
191
+ longitude
192
+ }
193
+ metadata
194
+ }
195
+ customer {
196
+ _id
197
+ code
198
+ name
199
+ }
200
+ route {
201
+ locations {
202
+ locationType
203
+ shipper {
204
+ _id
205
+ name
206
+ address {
207
+ label
208
+ }
209
+ addressTimezone
210
+ }
211
+ receiver {
212
+ _id
213
+ name
214
+ address {
215
+ label
216
+ }
217
+ addressTimezone
218
+ }
219
+ timeWindows {
220
+ fromDate
221
+ toDate
222
+ }
223
+ }
224
+ }
225
+ }
226
+ polyline
227
+ trailer {
228
+ _id
229
+ type
230
+ serialNumber
231
+ }
232
+ additionalTrailers {
233
+ _id
234
+ type
235
+ serialNumber
236
+ }
237
+ tractor {
238
+ _id
239
+ serialNumber
240
+ }
241
+ driver {
242
+ _id
243
+ firstname
244
+ lastname
245
+ }
246
+ trailerCompartmentAssignments {
247
+ trailerId
248
+ compartmentId
249
+ commodityId
250
+ quantity
251
+ targetStorageFacilityId
252
+ }
253
+ carrier {
254
+ _id
255
+ name
256
+ code
257
+ contact {
258
+ email
259
+ }
260
+ additionalContacts {
261
+ email
262
+ includeInInvoicing
263
+ }
264
+ }
265
+ additionalTrailers {
266
+ _id
267
+ type
268
+ serialNumber
269
+ }
270
+ lastTrailerLocation {
271
+ latitude
272
+ longitude
273
+ heading
274
+ speed
275
+ }
276
+ lastTrailerLocationDate
277
+ tags
278
+ customFields {
279
+ key
280
+ value
281
+ }
282
+ }
283
+ }
package/src/sdk/index.ts CHANGED
@@ -3,6 +3,7 @@ import TrueTMSBusinessEntitiesSdk from "./businessEntities";
3
3
  import TrueTMSDriverSdk from "./drivers";
4
4
  import TrueTMSDriverSettlementsSdk from "./driverSettlements";
5
5
  import TrueTMSInvoicesSdk from "./invoices";
6
+ import TrueTMSShipmentsSdk from "./shipments";
6
7
  import TrueTMSStorageFacilityReadingsSdk from "./storageFacilityReadings";
7
8
  import TrueTMSTractorsSdk from "./tractors";
8
9
  import TrueTMSTransactionsSdk from "./transactions";
@@ -27,6 +28,7 @@ class TrueTMS {
27
28
  public businessEntities: TrueTMSBusinessEntitiesSdk;
28
29
  public trips: TrueTMSTripsSdk;
29
30
  public storageFacilityReadings: TrueTMSStorageFacilityReadingsSdk;
31
+ public shipments: TrueTMSShipmentsSdk;
30
32
 
31
33
  constructor(private options: TrueTMSOptions) {
32
34
  this.drivers = new TrueTMSDriverSdk(options);
@@ -38,6 +40,7 @@ class TrueTMS {
38
40
  this.transactions = new TrueTMSTransactionsSdk(options);
39
41
  this.businessEntities = new TrueTMSBusinessEntitiesSdk(options);
40
42
  this.trips = new TrueTMSTripsSdk(options);
43
+ this.shipments = new TrueTMSShipmentsSdk(options);
41
44
  this.storageFacilityReadings = new TrueTMSStorageFacilityReadingsSdk(
42
45
  options
43
46
  );
@@ -0,0 +1,11 @@
1
+ import { TrueTMSOptions, authenticateApiCall } from ".";
2
+ import trueTmsGraphqlClient from "../providers/truetms-graphql-client";
3
+
4
+ class TrueTMSShipmentsSdk {
5
+ constructor(private options: TrueTMSOptions) {}
6
+
7
+ getShipmentList = authenticateApiCall(trueTmsGraphqlClient.getShipmentList);
8
+ getShipmentDetails = authenticateApiCall(trueTmsGraphqlClient.getShipmentDetails);
9
+ }
10
+
11
+ export default TrueTMSShipmentsSdk;
package/src/sdk/trips.ts CHANGED
@@ -5,6 +5,8 @@ class TrueTMSTripsSdk {
5
5
  constructor(private options: TrueTMSOptions) {}
6
6
 
7
7
  listTrips = authenticateApiCall(trueTmsGraphqlClient.listTrips);
8
+ getTripList = authenticateApiCall(trueTmsGraphqlClient.listTrips);
9
+ getTripDetails = authenticateApiCall(trueTmsGraphqlClient.getTripDetails);
8
10
  }
9
11
 
10
12
  export default TrueTMSTripsSdk;