@truetms/truetms-node 0.0.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/.github/workflows/pipeline.yml +32 -0
- package/codegen.yml +8 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/src/TrueTms.js +2 -0
- package/dist/src/TrueTms.js.map +1 -0
- package/dist/src/graphql/generated.js +414 -0
- package/dist/src/graphql/generated.js.map +1 -0
- package/dist/src/providers/truetms-graphql-client.js +12 -0
- package/dist/src/providers/truetms-graphql-client.js.map +1 -0
- package/dist/src/sdk/TrueTMS.js +2 -0
- package/dist/src/sdk/TrueTMS.js.map +1 -0
- package/dist/src/sdk/auth.js +118 -0
- package/dist/src/sdk/auth.js.map +1 -0
- package/dist/src/sdk/drivers.js +18 -0
- package/dist/src/sdk/drivers.js.map +1 -0
- package/dist/src/sdk/index.js +71 -0
- package/dist/src/sdk/index.js.map +1 -0
- package/dist/src/sdk/invoices.js +15 -0
- package/dist/src/sdk/invoices.js.map +1 -0
- package/dist/src/sdk/tractors.js +21 -0
- package/dist/src/sdk/tractors.js.map +1 -0
- package/index.ts +8 -0
- package/package.json +53 -0
- package/src/graphql/drivers.graphql +24 -0
- package/src/graphql/generated.ts +2898 -0
- package/src/graphql/invoices.graphql +35 -0
- package/src/graphql/organization.graphql +12 -0
- package/src/graphql/tractors.graphql +39 -0
- package/src/providers/truetms-graphql-client.ts +14 -0
- package/src/sdk/auth.ts +132 -0
- package/src/sdk/drivers.ts +18 -0
- package/src/sdk/index.ts +49 -0
- package/src/sdk/invoices.ts +10 -0
- package/src/sdk/tractors.ts +28 -0
- package/tsconfig.json +103 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ['main']
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Build Image
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Check out code
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
|
|
16
|
+
- name: Setup node
|
|
17
|
+
uses: actions/setup-node@v3
|
|
18
|
+
with:
|
|
19
|
+
node-version: 18
|
|
20
|
+
registry-url: 'https://registry.npmjs.org'
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: |
|
|
24
|
+
npm install
|
|
25
|
+
|
|
26
|
+
- name: Build
|
|
27
|
+
run: |
|
|
28
|
+
npm run build
|
|
29
|
+
|
|
30
|
+
- run: npm publish --access public
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/codegen.yml
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.TrueTMSAuth = void 0;
|
|
21
|
+
const sdk_1 = __importDefault(require("./src/sdk"));
|
|
22
|
+
const auth_1 = __importDefault(require("./src/sdk/auth"));
|
|
23
|
+
exports.TrueTMSAuth = auth_1.default;
|
|
24
|
+
exports.default = sdk_1.default;
|
|
25
|
+
__exportStar(require("./src/graphql/generated"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAAgC;AAChC,0DAAyC;AAIhC,sBAJF,cAAW,CAIE;AAFpB,kBAAe,aAAO,CAAC;AAIvB,0DAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueTms.js","sourceRoot":"","sources":["../../src/TrueTms.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getSdk = exports.PersistTractorPositionsDocument = exports.EditTractorDocument = exports.AddTractorDocument = exports.GetTractorBySerialNumberDocument = exports.GetTractorByPlateNumberDocument = exports.GetTractorByLicenseNumberDocument = exports.GetTractorByEldIdDocument = exports.GetMyOrganizationDocument = exports.GetInvoiceByIdDocument = exports.EditDriverDocument = exports.AddDriverDocument = exports.GetDriverByLicenseNumberDocument = exports.GetDriverByEldIdDocument = exports.TripSortCriteria = exports.TripAssetTypes = exports.TrailerType = exports.Status = exports.ShipmentSortCriteria = exports.ShipmentLocationType = exports.ShipmentEventType = exports.ShipmentConstraintType = exports.S3_Operation = exports.ReportType = exports.PaymentPeriodUnit = exports.NoteAccessLevel = exports.LoadType = exports.InvoiceStatus = exports.ExtensionMessageType = exports.ExtensionHookOperation = exports.DriverPaymentMethod = exports.DriverLicenseRestriction = exports.DriverLicenseEndorsement = exports.DriverLicenseClassification = exports.DriverHosStatus = exports.DriverDeductionMethod = exports.DeductionType = exports.DeductionPeriodUnit = exports.BusinessEntityType = exports.BillingRuleType = exports.BillingRuleConditionTarget = exports.BillingRuleConditionOperator = exports.BillingMethod = exports.AssetStatus = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
var AssetStatus;
|
|
9
|
+
(function (AssetStatus) {
|
|
10
|
+
AssetStatus["Active"] = "ACTIVE";
|
|
11
|
+
AssetStatus["Inactive"] = "INACTIVE";
|
|
12
|
+
})(AssetStatus = exports.AssetStatus || (exports.AssetStatus = {}));
|
|
13
|
+
var BillingMethod;
|
|
14
|
+
(function (BillingMethod) {
|
|
15
|
+
BillingMethod["FlatFee"] = "FLAT_FEE";
|
|
16
|
+
BillingMethod["PerDetentionHour"] = "PER_DETENTION_HOUR";
|
|
17
|
+
BillingMethod["PerHour"] = "PER_HOUR";
|
|
18
|
+
BillingMethod["PerMile"] = "PER_MILE";
|
|
19
|
+
})(BillingMethod = exports.BillingMethod || (exports.BillingMethod = {}));
|
|
20
|
+
var BillingRuleConditionOperator;
|
|
21
|
+
(function (BillingRuleConditionOperator) {
|
|
22
|
+
BillingRuleConditionOperator["Equals"] = "EQUALS";
|
|
23
|
+
BillingRuleConditionOperator["IsBetween"] = "IS_BETWEEN";
|
|
24
|
+
BillingRuleConditionOperator["IsGreaterThanOrEqual"] = "IS_GREATER_THAN_OR_EQUAL";
|
|
25
|
+
BillingRuleConditionOperator["IsLessThanOrEqual"] = "IS_LESS_THAN_OR_EQUAL";
|
|
26
|
+
})(BillingRuleConditionOperator = exports.BillingRuleConditionOperator || (exports.BillingRuleConditionOperator = {}));
|
|
27
|
+
var BillingRuleConditionTarget;
|
|
28
|
+
(function (BillingRuleConditionTarget) {
|
|
29
|
+
BillingRuleConditionTarget["Date"] = "DATE";
|
|
30
|
+
BillingRuleConditionTarget["DetentionTime"] = "DETENTION_TIME";
|
|
31
|
+
BillingRuleConditionTarget["Mileage"] = "MILEAGE";
|
|
32
|
+
BillingRuleConditionTarget["Otherwise"] = "OTHERWISE";
|
|
33
|
+
BillingRuleConditionTarget["Receiver"] = "RECEIVER";
|
|
34
|
+
BillingRuleConditionTarget["Shipper"] = "SHIPPER";
|
|
35
|
+
BillingRuleConditionTarget["Time"] = "TIME";
|
|
36
|
+
BillingRuleConditionTarget["Trailer"] = "TRAILER";
|
|
37
|
+
BillingRuleConditionTarget["TrailerType"] = "TRAILER_TYPE";
|
|
38
|
+
})(BillingRuleConditionTarget = exports.BillingRuleConditionTarget || (exports.BillingRuleConditionTarget = {}));
|
|
39
|
+
var BillingRuleType;
|
|
40
|
+
(function (BillingRuleType) {
|
|
41
|
+
BillingRuleType["Accessorial"] = "ACCESSORIAL";
|
|
42
|
+
BillingRuleType["Primary"] = "PRIMARY";
|
|
43
|
+
})(BillingRuleType = exports.BillingRuleType || (exports.BillingRuleType = {}));
|
|
44
|
+
var BusinessEntityType;
|
|
45
|
+
(function (BusinessEntityType) {
|
|
46
|
+
BusinessEntityType["Broker"] = "BROKER";
|
|
47
|
+
BusinessEntityType["Carrier"] = "CARRIER";
|
|
48
|
+
BusinessEntityType["Customer"] = "CUSTOMER";
|
|
49
|
+
BusinessEntityType["Receiver"] = "RECEIVER";
|
|
50
|
+
BusinessEntityType["Shipper"] = "SHIPPER";
|
|
51
|
+
})(BusinessEntityType = exports.BusinessEntityType || (exports.BusinessEntityType = {}));
|
|
52
|
+
var DeductionPeriodUnit;
|
|
53
|
+
(function (DeductionPeriodUnit) {
|
|
54
|
+
DeductionPeriodUnit["Day"] = "DAY";
|
|
55
|
+
DeductionPeriodUnit["Month"] = "MONTH";
|
|
56
|
+
DeductionPeriodUnit["Week"] = "WEEK";
|
|
57
|
+
DeductionPeriodUnit["Year"] = "YEAR";
|
|
58
|
+
})(DeductionPeriodUnit = exports.DeductionPeriodUnit || (exports.DeductionPeriodUnit = {}));
|
|
59
|
+
var DeductionType;
|
|
60
|
+
(function (DeductionType) {
|
|
61
|
+
DeductionType["Bonus"] = "BONUS";
|
|
62
|
+
DeductionType["Deduction"] = "DEDUCTION";
|
|
63
|
+
})(DeductionType = exports.DeductionType || (exports.DeductionType = {}));
|
|
64
|
+
var DriverDeductionMethod;
|
|
65
|
+
(function (DriverDeductionMethod) {
|
|
66
|
+
DriverDeductionMethod["FlatFee"] = "FLAT_FEE";
|
|
67
|
+
})(DriverDeductionMethod = exports.DriverDeductionMethod || (exports.DriverDeductionMethod = {}));
|
|
68
|
+
var DriverHosStatus;
|
|
69
|
+
(function (DriverHosStatus) {
|
|
70
|
+
DriverHosStatus["Driving"] = "DRIVING";
|
|
71
|
+
DriverHosStatus["OffDuty"] = "OFF_DUTY";
|
|
72
|
+
DriverHosStatus["OnDuty"] = "ON_DUTY";
|
|
73
|
+
DriverHosStatus["Sleeping"] = "SLEEPING";
|
|
74
|
+
})(DriverHosStatus = exports.DriverHosStatus || (exports.DriverHosStatus = {}));
|
|
75
|
+
var DriverLicenseClassification;
|
|
76
|
+
(function (DriverLicenseClassification) {
|
|
77
|
+
DriverLicenseClassification["ClassA"] = "CLASS_A";
|
|
78
|
+
DriverLicenseClassification["ClassB"] = "CLASS_B";
|
|
79
|
+
DriverLicenseClassification["ClassC"] = "CLASS_C";
|
|
80
|
+
})(DriverLicenseClassification = exports.DriverLicenseClassification || (exports.DriverLicenseClassification = {}));
|
|
81
|
+
var DriverLicenseEndorsement;
|
|
82
|
+
(function (DriverLicenseEndorsement) {
|
|
83
|
+
DriverLicenseEndorsement["ComboTankHazardous"] = "COMBO_TANK_HAZARDOUS";
|
|
84
|
+
DriverLicenseEndorsement["HazardousMaterial"] = "HAZARDOUS_MATERIAL";
|
|
85
|
+
DriverLicenseEndorsement["PassengerVehicle"] = "PASSENGER_VEHICLE";
|
|
86
|
+
DriverLicenseEndorsement["SchoolBus"] = "SCHOOL_BUS";
|
|
87
|
+
DriverLicenseEndorsement["SemiTrailer"] = "SEMI_TRAILER";
|
|
88
|
+
DriverLicenseEndorsement["TankTruck"] = "TANK_TRUCK";
|
|
89
|
+
DriverLicenseEndorsement["TowTruck"] = "TOW_TRUCK";
|
|
90
|
+
})(DriverLicenseEndorsement = exports.DriverLicenseEndorsement || (exports.DriverLicenseEndorsement = {}));
|
|
91
|
+
var DriverLicenseRestriction;
|
|
92
|
+
(function (DriverLicenseRestriction) {
|
|
93
|
+
DriverLicenseRestriction["B"] = "B";
|
|
94
|
+
DriverLicenseRestriction["C"] = "C";
|
|
95
|
+
DriverLicenseRestriction["D"] = "D";
|
|
96
|
+
DriverLicenseRestriction["E"] = "E";
|
|
97
|
+
DriverLicenseRestriction["F"] = "F";
|
|
98
|
+
DriverLicenseRestriction["G"] = "G";
|
|
99
|
+
DriverLicenseRestriction["K"] = "K";
|
|
100
|
+
DriverLicenseRestriction["L"] = "L";
|
|
101
|
+
DriverLicenseRestriction["M"] = "M";
|
|
102
|
+
DriverLicenseRestriction["N"] = "N";
|
|
103
|
+
DriverLicenseRestriction["O"] = "O";
|
|
104
|
+
DriverLicenseRestriction["T"] = "T";
|
|
105
|
+
DriverLicenseRestriction["Z"] = "Z";
|
|
106
|
+
})(DriverLicenseRestriction = exports.DriverLicenseRestriction || (exports.DriverLicenseRestriction = {}));
|
|
107
|
+
var DriverPaymentMethod;
|
|
108
|
+
(function (DriverPaymentMethod) {
|
|
109
|
+
DriverPaymentMethod["PerHour"] = "PER_HOUR";
|
|
110
|
+
DriverPaymentMethod["PerMile"] = "PER_MILE";
|
|
111
|
+
DriverPaymentMethod["RevenueShare"] = "REVENUE_SHARE";
|
|
112
|
+
})(DriverPaymentMethod = exports.DriverPaymentMethod || (exports.DriverPaymentMethod = {}));
|
|
113
|
+
var ExtensionHookOperation;
|
|
114
|
+
(function (ExtensionHookOperation) {
|
|
115
|
+
ExtensionHookOperation["GetInvoiceTemplate"] = "GET_INVOICE_TEMPLATE";
|
|
116
|
+
ExtensionHookOperation["SendInvoice"] = "SEND_INVOICE";
|
|
117
|
+
})(ExtensionHookOperation = exports.ExtensionHookOperation || (exports.ExtensionHookOperation = {}));
|
|
118
|
+
var ExtensionMessageType;
|
|
119
|
+
(function (ExtensionMessageType) {
|
|
120
|
+
ExtensionMessageType["Error"] = "ERROR";
|
|
121
|
+
ExtensionMessageType["Info"] = "INFO";
|
|
122
|
+
ExtensionMessageType["Warning"] = "WARNING";
|
|
123
|
+
})(ExtensionMessageType = exports.ExtensionMessageType || (exports.ExtensionMessageType = {}));
|
|
124
|
+
var InvoiceStatus;
|
|
125
|
+
(function (InvoiceStatus) {
|
|
126
|
+
InvoiceStatus["Cancelled"] = "CANCELLED";
|
|
127
|
+
InvoiceStatus["Closed"] = "CLOSED";
|
|
128
|
+
InvoiceStatus["Draft"] = "DRAFT";
|
|
129
|
+
InvoiceStatus["Paid"] = "PAID";
|
|
130
|
+
InvoiceStatus["Sent"] = "SENT";
|
|
131
|
+
})(InvoiceStatus = exports.InvoiceStatus || (exports.InvoiceStatus = {}));
|
|
132
|
+
var LoadType;
|
|
133
|
+
(function (LoadType) {
|
|
134
|
+
LoadType["FullTruckLoad"] = "FULL_TRUCK_LOAD";
|
|
135
|
+
LoadType["LessThanTruckLoad"] = "LESS_THAN_TRUCK_LOAD";
|
|
136
|
+
})(LoadType = exports.LoadType || (exports.LoadType = {}));
|
|
137
|
+
var NoteAccessLevel;
|
|
138
|
+
(function (NoteAccessLevel) {
|
|
139
|
+
NoteAccessLevel["Customer"] = "CUSTOMER";
|
|
140
|
+
NoteAccessLevel["Dispatcher"] = "DISPATCHER";
|
|
141
|
+
NoteAccessLevel["Driver"] = "DRIVER";
|
|
142
|
+
})(NoteAccessLevel = exports.NoteAccessLevel || (exports.NoteAccessLevel = {}));
|
|
143
|
+
var PaymentPeriodUnit;
|
|
144
|
+
(function (PaymentPeriodUnit) {
|
|
145
|
+
PaymentPeriodUnit["Day"] = "DAY";
|
|
146
|
+
PaymentPeriodUnit["Month"] = "MONTH";
|
|
147
|
+
PaymentPeriodUnit["Week"] = "WEEK";
|
|
148
|
+
PaymentPeriodUnit["Year"] = "YEAR";
|
|
149
|
+
})(PaymentPeriodUnit = exports.PaymentPeriodUnit || (exports.PaymentPeriodUnit = {}));
|
|
150
|
+
var ReportType;
|
|
151
|
+
(function (ReportType) {
|
|
152
|
+
ReportType["DriverMileagePerTrip"] = "DRIVER_MILEAGE_PER_TRIP";
|
|
153
|
+
ReportType["RevenuePerDay"] = "REVENUE_PER_DAY";
|
|
154
|
+
})(ReportType = exports.ReportType || (exports.ReportType = {}));
|
|
155
|
+
var S3_Operation;
|
|
156
|
+
(function (S3_Operation) {
|
|
157
|
+
S3_Operation["GetObject"] = "getObject";
|
|
158
|
+
S3_Operation["PutObject"] = "putObject";
|
|
159
|
+
})(S3_Operation = exports.S3_Operation || (exports.S3_Operation = {}));
|
|
160
|
+
var ShipmentConstraintType;
|
|
161
|
+
(function (ShipmentConstraintType) {
|
|
162
|
+
ShipmentConstraintType["Height"] = "HEIGHT";
|
|
163
|
+
ShipmentConstraintType["Length"] = "LENGTH";
|
|
164
|
+
ShipmentConstraintType["MaxTemperature"] = "MAX_TEMPERATURE";
|
|
165
|
+
ShipmentConstraintType["MinTemperature"] = "MIN_TEMPERATURE";
|
|
166
|
+
ShipmentConstraintType["Width"] = "WIDTH";
|
|
167
|
+
})(ShipmentConstraintType = exports.ShipmentConstraintType || (exports.ShipmentConstraintType = {}));
|
|
168
|
+
var ShipmentEventType;
|
|
169
|
+
(function (ShipmentEventType) {
|
|
170
|
+
ShipmentEventType["DropoffCheckpointUnloadStart"] = "DROPOFF_CHECKPOINT_UNLOAD_START";
|
|
171
|
+
ShipmentEventType["DropOffCheckpointArrive"] = "DROP_OFF_CHECKPOINT_ARRIVE";
|
|
172
|
+
ShipmentEventType["DropOffCheckpointLeft"] = "DROP_OFF_CHECKPOINT_LEFT";
|
|
173
|
+
ShipmentEventType["PickupCheckpointArrive"] = "PICKUP_CHECKPOINT_ARRIVE";
|
|
174
|
+
ShipmentEventType["PickupCheckpointLeft"] = "PICKUP_CHECKPOINT_LEFT";
|
|
175
|
+
ShipmentEventType["PickupCheckpointLoadStart"] = "PICKUP_CHECKPOINT_LOAD_START";
|
|
176
|
+
ShipmentEventType["ShipmentComplete"] = "SHIPMENT_COMPLETE";
|
|
177
|
+
ShipmentEventType["TripEnd"] = "TRIP_END";
|
|
178
|
+
ShipmentEventType["TripStarted"] = "TRIP_STARTED";
|
|
179
|
+
})(ShipmentEventType = exports.ShipmentEventType || (exports.ShipmentEventType = {}));
|
|
180
|
+
var ShipmentLocationType;
|
|
181
|
+
(function (ShipmentLocationType) {
|
|
182
|
+
ShipmentLocationType["Break"] = "BREAK";
|
|
183
|
+
ShipmentLocationType["DropOff"] = "DROP_OFF";
|
|
184
|
+
ShipmentLocationType["Pickup"] = "PICKUP";
|
|
185
|
+
})(ShipmentLocationType = exports.ShipmentLocationType || (exports.ShipmentLocationType = {}));
|
|
186
|
+
var ShipmentSortCriteria;
|
|
187
|
+
(function (ShipmentSortCriteria) {
|
|
188
|
+
ShipmentSortCriteria["DropoffDate"] = "DROPOFF_DATE";
|
|
189
|
+
ShipmentSortCriteria["DropoffDistance"] = "DROPOFF_DISTANCE";
|
|
190
|
+
ShipmentSortCriteria["PickupDate"] = "PICKUP_DATE";
|
|
191
|
+
ShipmentSortCriteria["PickupDistance"] = "PICKUP_DISTANCE";
|
|
192
|
+
})(ShipmentSortCriteria = exports.ShipmentSortCriteria || (exports.ShipmentSortCriteria = {}));
|
|
193
|
+
var Status;
|
|
194
|
+
(function (Status) {
|
|
195
|
+
Status["Active"] = "ACTIVE";
|
|
196
|
+
Status["Assigned"] = "ASSIGNED";
|
|
197
|
+
Status["Cancelled"] = "CANCELLED";
|
|
198
|
+
Status["Complete"] = "COMPLETE";
|
|
199
|
+
Status["Deleted"] = "DELETED";
|
|
200
|
+
Status["Delivered"] = "DELIVERED";
|
|
201
|
+
Status["InProgress"] = "IN_PROGRESS";
|
|
202
|
+
Status["Pending"] = "PENDING";
|
|
203
|
+
Status["Planned"] = "PLANNED";
|
|
204
|
+
Status["Unassigned"] = "UNASSIGNED";
|
|
205
|
+
Status["WaitingForApproval"] = "WAITING_FOR_APPROVAL";
|
|
206
|
+
Status["WaitingForAssignment"] = "WAITING_FOR_ASSIGNMENT";
|
|
207
|
+
})(Status = exports.Status || (exports.Status = {}));
|
|
208
|
+
var TrailerType;
|
|
209
|
+
(function (TrailerType) {
|
|
210
|
+
TrailerType["AutoCarrier"] = "AUTO_CARRIER";
|
|
211
|
+
TrailerType["Conestoga"] = "CONESTOGA";
|
|
212
|
+
TrailerType["Container"] = "CONTAINER";
|
|
213
|
+
TrailerType["Conveyor"] = "CONVEYOR";
|
|
214
|
+
TrailerType["DryBulk"] = "DRY_BULK";
|
|
215
|
+
TrailerType["Enclosed"] = "ENCLOSED";
|
|
216
|
+
TrailerType["FlatBed"] = "FLAT_BED";
|
|
217
|
+
TrailerType["HazardousMaterials"] = "HAZARDOUS_MATERIALS";
|
|
218
|
+
TrailerType["Lowboy"] = "LOWBOY";
|
|
219
|
+
TrailerType["MultiCar"] = "MULTI_CAR";
|
|
220
|
+
TrailerType["Other"] = "OTHER";
|
|
221
|
+
TrailerType["Refrigerated"] = "REFRIGERATED";
|
|
222
|
+
TrailerType["SpecializedDeck"] = "SPECIALIZED_DECK";
|
|
223
|
+
TrailerType["StandardDeck"] = "STANDARD_DECK";
|
|
224
|
+
TrailerType["StraightBoxTruck"] = "STRAIGHT_BOX_TRUCK";
|
|
225
|
+
TrailerType["Tanker"] = "TANKER";
|
|
226
|
+
TrailerType["Van"] = "VAN";
|
|
227
|
+
})(TrailerType = exports.TrailerType || (exports.TrailerType = {}));
|
|
228
|
+
var TripAssetTypes;
|
|
229
|
+
(function (TripAssetTypes) {
|
|
230
|
+
TripAssetTypes["Chassis"] = "CHASSIS";
|
|
231
|
+
TripAssetTypes["Driver"] = "DRIVER";
|
|
232
|
+
TripAssetTypes["Tractor"] = "TRACTOR";
|
|
233
|
+
TripAssetTypes["Trailer"] = "TRAILER";
|
|
234
|
+
})(TripAssetTypes = exports.TripAssetTypes || (exports.TripAssetTypes = {}));
|
|
235
|
+
var TripSortCriteria;
|
|
236
|
+
(function (TripSortCriteria) {
|
|
237
|
+
TripSortCriteria["CreatedAt"] = "CREATED_AT";
|
|
238
|
+
TripSortCriteria["EndLocation"] = "END_LOCATION";
|
|
239
|
+
TripSortCriteria["FinishDate"] = "FINISH_DATE";
|
|
240
|
+
TripSortCriteria["StartDate"] = "START_DATE";
|
|
241
|
+
TripSortCriteria["StartLocation"] = "START_LOCATION";
|
|
242
|
+
})(TripSortCriteria = exports.TripSortCriteria || (exports.TripSortCriteria = {}));
|
|
243
|
+
exports.GetDriverByEldIdDocument = (0, graphql_tag_1.default) `
|
|
244
|
+
query getDriverByEldId($eldId: String!) {
|
|
245
|
+
driverByEldId(eldId: $eldId) {
|
|
246
|
+
_id
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
`;
|
|
250
|
+
exports.GetDriverByLicenseNumberDocument = (0, graphql_tag_1.default) `
|
|
251
|
+
query getDriverByLicenseNumber($licenseNumber: String!) {
|
|
252
|
+
driverByLicenseNumber(licenseNumber: $licenseNumber) {
|
|
253
|
+
_id
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
`;
|
|
257
|
+
exports.AddDriverDocument = (0, graphql_tag_1.default) `
|
|
258
|
+
mutation addDriver($newDriverData: NewDriverInput!) {
|
|
259
|
+
addDriver(newDriverData: $newDriverData) {
|
|
260
|
+
_id
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
`;
|
|
264
|
+
exports.EditDriverDocument = (0, graphql_tag_1.default) `
|
|
265
|
+
mutation editDriver($id: String!, $editDriverData: DriverUpdateInput!) {
|
|
266
|
+
editDriver(id: $id, editDriverData: $editDriverData) {
|
|
267
|
+
_id
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
`;
|
|
271
|
+
exports.GetInvoiceByIdDocument = (0, graphql_tag_1.default) `
|
|
272
|
+
query getInvoiceById($id: String!) {
|
|
273
|
+
invoiceById(id: $id) {
|
|
274
|
+
_id
|
|
275
|
+
charges {
|
|
276
|
+
_id
|
|
277
|
+
billToClient
|
|
278
|
+
billingRule {
|
|
279
|
+
_id
|
|
280
|
+
referenceNumber
|
|
281
|
+
label
|
|
282
|
+
}
|
|
283
|
+
label
|
|
284
|
+
rate
|
|
285
|
+
unit
|
|
286
|
+
unitType
|
|
287
|
+
}
|
|
288
|
+
customer {
|
|
289
|
+
_id
|
|
290
|
+
name
|
|
291
|
+
code
|
|
292
|
+
billingEmail
|
|
293
|
+
billingTermsDay
|
|
294
|
+
}
|
|
295
|
+
invoiceNumber
|
|
296
|
+
pdfDocument {
|
|
297
|
+
url
|
|
298
|
+
}
|
|
299
|
+
shipment {
|
|
300
|
+
_id
|
|
301
|
+
shipmentNumber
|
|
302
|
+
referenceNumber
|
|
303
|
+
}
|
|
304
|
+
status
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
exports.GetMyOrganizationDocument = (0, graphql_tag_1.default) `
|
|
309
|
+
query getMyOrganization {
|
|
310
|
+
myOrganization {
|
|
311
|
+
id
|
|
312
|
+
displayName
|
|
313
|
+
name
|
|
314
|
+
realm
|
|
315
|
+
attributes {
|
|
316
|
+
chargebeeCustomerId
|
|
317
|
+
dotNumber
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
`;
|
|
322
|
+
exports.GetTractorByEldIdDocument = (0, graphql_tag_1.default) `
|
|
323
|
+
query getTractorByEldId($eldId: String!) {
|
|
324
|
+
tractorByEldId(eldId: $eldId) {
|
|
325
|
+
_id
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
`;
|
|
329
|
+
exports.GetTractorByLicenseNumberDocument = (0, graphql_tag_1.default) `
|
|
330
|
+
query getTractorByLicenseNumber($licenseNumber: String!) {
|
|
331
|
+
tractorByLicenseNumber(licenseNumber: $licenseNumber) {
|
|
332
|
+
_id
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
`;
|
|
336
|
+
exports.GetTractorByPlateNumberDocument = (0, graphql_tag_1.default) `
|
|
337
|
+
query getTractorByPlateNumber($plateNumber: String!) {
|
|
338
|
+
tractorByPlateNumber(plateNumber: $plateNumber) {
|
|
339
|
+
_id
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
`;
|
|
343
|
+
exports.GetTractorBySerialNumberDocument = (0, graphql_tag_1.default) `
|
|
344
|
+
query getTractorBySerialNumber($serialNumber: String!) {
|
|
345
|
+
tractorBySerialNumber(serialNumber: $serialNumber) {
|
|
346
|
+
_id
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
`;
|
|
350
|
+
exports.AddTractorDocument = (0, graphql_tag_1.default) `
|
|
351
|
+
mutation addTractor($newTractorData: NewTractorInput!) {
|
|
352
|
+
addTractor(newTractorData: $newTractorData) {
|
|
353
|
+
_id
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
`;
|
|
357
|
+
exports.EditTractorDocument = (0, graphql_tag_1.default) `
|
|
358
|
+
mutation editTractor($id: String!, $editTractorData: TractorUpdateInput!) {
|
|
359
|
+
editTractor(id: $id, editTractorData: $editTractorData) {
|
|
360
|
+
_id
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
`;
|
|
364
|
+
exports.PersistTractorPositionsDocument = (0, graphql_tag_1.default) `
|
|
365
|
+
mutation persistTractorPositions($id: String!, $positions: [TractorPositionInput!]!) {
|
|
366
|
+
persistTractorPositions(id: $id, positions: $positions)
|
|
367
|
+
}
|
|
368
|
+
`;
|
|
369
|
+
const defaultWrapper = (action, _operationName, _operationType) => action();
|
|
370
|
+
function getSdk(client, withWrapper = defaultWrapper) {
|
|
371
|
+
return {
|
|
372
|
+
getDriverByEldId(variables, requestHeaders) {
|
|
373
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetDriverByEldIdDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getDriverByEldId', 'query');
|
|
374
|
+
},
|
|
375
|
+
getDriverByLicenseNumber(variables, requestHeaders) {
|
|
376
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetDriverByLicenseNumberDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getDriverByLicenseNumber', 'query');
|
|
377
|
+
},
|
|
378
|
+
addDriver(variables, requestHeaders) {
|
|
379
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.AddDriverDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'addDriver', 'mutation');
|
|
380
|
+
},
|
|
381
|
+
editDriver(variables, requestHeaders) {
|
|
382
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.EditDriverDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'editDriver', 'mutation');
|
|
383
|
+
},
|
|
384
|
+
getInvoiceById(variables, requestHeaders) {
|
|
385
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetInvoiceByIdDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getInvoiceById', 'query');
|
|
386
|
+
},
|
|
387
|
+
getMyOrganization(variables, requestHeaders) {
|
|
388
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetMyOrganizationDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getMyOrganization', 'query');
|
|
389
|
+
},
|
|
390
|
+
getTractorByEldId(variables, requestHeaders) {
|
|
391
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetTractorByEldIdDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getTractorByEldId', 'query');
|
|
392
|
+
},
|
|
393
|
+
getTractorByLicenseNumber(variables, requestHeaders) {
|
|
394
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetTractorByLicenseNumberDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getTractorByLicenseNumber', 'query');
|
|
395
|
+
},
|
|
396
|
+
getTractorByPlateNumber(variables, requestHeaders) {
|
|
397
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetTractorByPlateNumberDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getTractorByPlateNumber', 'query');
|
|
398
|
+
},
|
|
399
|
+
getTractorBySerialNumber(variables, requestHeaders) {
|
|
400
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetTractorBySerialNumberDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getTractorBySerialNumber', 'query');
|
|
401
|
+
},
|
|
402
|
+
addTractor(variables, requestHeaders) {
|
|
403
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.AddTractorDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'addTractor', 'mutation');
|
|
404
|
+
},
|
|
405
|
+
editTractor(variables, requestHeaders) {
|
|
406
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.EditTractorDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'editTractor', 'mutation');
|
|
407
|
+
},
|
|
408
|
+
persistTractorPositions(variables, requestHeaders) {
|
|
409
|
+
return withWrapper((wrappedRequestHeaders) => client.request(exports.PersistTractorPositionsDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'persistTractorPositions', 'mutation');
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
exports.getSdk = getSdk;
|
|
414
|
+
//# sourceMappingURL=generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.js","sourceRoot":"","sources":["../../../src/graphql/generated.ts"],"names":[],"mappings":";;;;;;AAEA,8DAA8B;AAwC9B,IAAY,WA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O,CAAC;KACF,CAAC;AACJ,CAAC;AA1CD,wBA0CC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const graphql_request_1 = require("graphql-request");
|
|
4
|
+
const generated_1 = require("../graphql/generated");
|
|
5
|
+
const client = new graphql_request_1.GraphQLClient(process.env.TRUETMS_STAGE === "LOCAL"
|
|
6
|
+
? "http://localhost:3001/graphql"
|
|
7
|
+
: process.env.TRUETMS_STAGE === "QA"
|
|
8
|
+
? "https://qa-lynks-api.tecafrik.com/graphql"
|
|
9
|
+
: "https://api.truetms.com/graphql");
|
|
10
|
+
const trueTmsGraphqlClient = (0, generated_1.getSdk)(client);
|
|
11
|
+
exports.default = trueTmsGraphqlClient;
|
|
12
|
+
//# sourceMappingURL=truetms-graphql-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truetms-graphql-client.js","sourceRoot":"","sources":["../../../src/providers/truetms-graphql-client.ts"],"names":[],"mappings":";;AAAA,qDAAgD;AAChD,oDAA8C;AAE9C,MAAM,MAAM,GAAG,IAAI,+BAAa,CAC9B,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,OAAO;IACnC,CAAC,CAAC,+BAA+B;IACjC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,IAAI;QACpC,CAAC,CAAC,2CAA2C;QAC7C,CAAC,CAAC,iCAAiC,CACtC,CAAC;AAEF,MAAM,oBAAoB,GAAG,IAAA,kBAAM,EAAC,MAAM,CAA8B,CAAC;AAEzE,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueTMS.js","sourceRoot":"","sources":["../../../src/sdk/TrueTMS.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.exchangeRefreshTokenForAccessToken = exports.trueTmsOpenIdClient = void 0;
|
|
16
|
+
const uuid_1 = require("uuid");
|
|
17
|
+
const apisauce_1 = require("apisauce");
|
|
18
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
19
|
+
const truetms_graphql_client_1 = __importDefault(require("../providers/truetms-graphql-client"));
|
|
20
|
+
const _1 = require(".");
|
|
21
|
+
const openIdConnectUrl = process.env.TRUETMS_STAGE === "QA" || process.env.TRUETMS_STAGE === "LOCAL"
|
|
22
|
+
? "https://qa-lynks-keycloak.tecafrik.com/auth/realms/Lynks/protocol/openid-connect"
|
|
23
|
+
: "https://auth.truetms.com/auth/realms/Lynks/protocol/openid-connect";
|
|
24
|
+
exports.trueTmsOpenIdClient = (0, apisauce_1.create)({
|
|
25
|
+
baseURL: openIdConnectUrl,
|
|
26
|
+
});
|
|
27
|
+
class TrueTMSAuth {
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this.options = options;
|
|
30
|
+
this.getMyOrganization = (0, _1.authenticateApiCall)(truetms_graphql_client_1.default.getMyOrganization);
|
|
31
|
+
}
|
|
32
|
+
requestAuth(req, res) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const state = (0, uuid_1.v4)();
|
|
35
|
+
const nonce = (0, uuid_1.v4)();
|
|
36
|
+
res.cookie("state", state);
|
|
37
|
+
res.cookie("nonce", nonce);
|
|
38
|
+
res.redirect(`${openIdConnectUrl}/auth?client_id=${this.options.clientId}&redirect_uri=${this.options.redirectUri}&state=${state}&response_mode=query&response_type=code&scope=openid offline_access&nonce=${nonce}&prompt=none`);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
authCallback(req, res) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
if (req.query.state !== req.cookies.state) {
|
|
44
|
+
throw new Error("State mismatch");
|
|
45
|
+
}
|
|
46
|
+
const authorizationCode = req.query.code;
|
|
47
|
+
if (!authorizationCode) {
|
|
48
|
+
throw new Error("No authorization code");
|
|
49
|
+
}
|
|
50
|
+
const tokens = yield this.exchangeCodeForToken(authorizationCode);
|
|
51
|
+
const trueTmsOrganization = (yield truetms_graphql_client_1.default.getMyOrganization({}, {
|
|
52
|
+
Authorization: `Bearer ${tokens.access_token}`,
|
|
53
|
+
})).myOrganization;
|
|
54
|
+
return {
|
|
55
|
+
token: tokens.refresh_token,
|
|
56
|
+
organization: trueTmsOrganization,
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
exchangeCodeForToken(code) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const tokenResponse = yield exports.trueTmsOpenIdClient.post("/token", `grant_type=authorization_code&code=${code}&client_id=${this.options.clientId}&client_secret=${this.options.clientSecret}&redirect_uri=${this.options.redirectUri}&scope=offline_access`, {
|
|
63
|
+
headers: {
|
|
64
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
if (!tokenResponse.ok) {
|
|
68
|
+
console.error(tokenResponse);
|
|
69
|
+
throw new Error("Error while authenticating with TrueTMS");
|
|
70
|
+
}
|
|
71
|
+
const body = tokenResponse.data;
|
|
72
|
+
if (!body) {
|
|
73
|
+
throw new Error("No response data while authenticating with TrueTMS");
|
|
74
|
+
}
|
|
75
|
+
return body;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.default = TrueTMSAuth;
|
|
80
|
+
const accessTokenCache = {};
|
|
81
|
+
function exchangeRefreshTokenForAccessToken(refreshToken, clientId, clientSecret) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const cachedToken = accessTokenCache[refreshToken];
|
|
84
|
+
if (cachedToken) {
|
|
85
|
+
const decodedToken = jsonwebtoken_1.default.decode(cachedToken, {
|
|
86
|
+
json: true,
|
|
87
|
+
});
|
|
88
|
+
if (decodedToken && typeof decodedToken.exp === "number") {
|
|
89
|
+
if (decodedToken.exp * 1000 <= Date.now()) {
|
|
90
|
+
delete accessTokenCache[refreshToken];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return {
|
|
95
|
+
access_token: accessTokenCache[refreshToken],
|
|
96
|
+
refresh_token: refreshToken,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const tokenResponse = yield exports.trueTmsOpenIdClient.post("/token", `grant_type=refresh_token&refresh_token=${refreshToken}&client_id=${clientId}&client_secret=${clientSecret}`, {
|
|
101
|
+
headers: {
|
|
102
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
if (!tokenResponse.ok) {
|
|
106
|
+
console.error(tokenResponse);
|
|
107
|
+
throw new Error("Error while authenticating with TrueTMS");
|
|
108
|
+
}
|
|
109
|
+
const body = tokenResponse.data;
|
|
110
|
+
if (!body) {
|
|
111
|
+
throw new Error("No response data while authenticating with TrueTMS");
|
|
112
|
+
}
|
|
113
|
+
accessTokenCache[refreshToken] = body.access_token;
|
|
114
|
+
return body;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
exports.exchangeRefreshTokenForAccessToken = exchangeRefreshTokenForAccessToken;
|
|
118
|
+
//# sourceMappingURL=auth.js.map
|