@truetms/truetms-node 0.2.0 → 0.2.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 +238 -3
- package/dist/src/graphql/generated.js.map +1 -1
- package/dist/src/sdk/auth.js +1 -1
- package/dist/src/sdk/auth.js.map +1 -1
- package/dist/src/sdk/businessEntities.js +20 -0
- package/dist/src/sdk/businessEntities.js.map +1 -0
- package/dist/src/sdk/index.js +2 -0
- package/dist/src/sdk/index.js.map +1 -1
- package/package.json +1 -1
- package/src/graphql/business-entities.graphql +191 -0
- package/src/graphql/generated.ts +617 -45
- package/src/graphql/invoices.graphql +2 -0
- package/src/sdk/auth.ts +1 -1
- package/src/sdk/businessEntities.ts +29 -0
- package/src/sdk/index.ts +3 -0
|
@@ -66,6 +66,7 @@ query getInvoiceById($id: String!) {
|
|
|
66
66
|
weight
|
|
67
67
|
}
|
|
68
68
|
type
|
|
69
|
+
externalId
|
|
69
70
|
}
|
|
70
71
|
invoiceNumber
|
|
71
72
|
pdfDocument {
|
|
@@ -160,6 +161,7 @@ query getInvoiceByNumber($invoiceNumber: String!) {
|
|
|
160
161
|
weight
|
|
161
162
|
}
|
|
162
163
|
type
|
|
164
|
+
externalId
|
|
163
165
|
}
|
|
164
166
|
invoiceNumber
|
|
165
167
|
pdfDocument {
|
package/src/sdk/auth.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { authenticateApiCall, TrueTMSOptions } from ".";
|
|
|
10
10
|
const openIdConnectUrl =
|
|
11
11
|
process.env.TRUETMS_STAGE === "QA" || process.env.TRUETMS_STAGE === "LOCAL"
|
|
12
12
|
? "https://qa-lynks-keycloak.tecafrik.com/auth/realms/truetms/protocol/openid-connect"
|
|
13
|
-
: "https://auth.truetms.com/auth/realms/
|
|
13
|
+
: "https://auth.truetms.com/auth/realms/truetms/protocol/openid-connect";
|
|
14
14
|
|
|
15
15
|
export const trueTmsOpenIdClient = create({
|
|
16
16
|
baseURL: openIdConnectUrl,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TrueTMSOptions, authenticateApiCall } from ".";
|
|
2
|
+
import trueTmsGraphqlClient from "../providers/truetms-graphql-client";
|
|
3
|
+
|
|
4
|
+
class TrueTMSBusinessEntitiesSdk {
|
|
5
|
+
constructor(private options: TrueTMSOptions) {}
|
|
6
|
+
|
|
7
|
+
getBusinessEntityList = authenticateApiCall(
|
|
8
|
+
trueTmsGraphqlClient.getBusinessEntityList
|
|
9
|
+
);
|
|
10
|
+
getBusinessEntityDetails = authenticateApiCall(
|
|
11
|
+
trueTmsGraphqlClient.getBusinessEntityDetails
|
|
12
|
+
);
|
|
13
|
+
getBusinessEntityDetailsByExternalId = authenticateApiCall(
|
|
14
|
+
trueTmsGraphqlClient.getBusinessEntityDetailsByExternalId
|
|
15
|
+
);
|
|
16
|
+
addBusinessEntity = authenticateApiCall(
|
|
17
|
+
trueTmsGraphqlClient.addBusinessEntity
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
editBusinessEntity = authenticateApiCall(
|
|
21
|
+
trueTmsGraphqlClient.editBusinessEntity
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
deleteBusinessEntity = authenticateApiCall(
|
|
25
|
+
trueTmsGraphqlClient.deleteBusinessEntity
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default TrueTMSBusinessEntitiesSdk;
|
package/src/sdk/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import TrueTMSAuth, { exchangeRefreshTokenForAccessToken } from "./auth";
|
|
2
|
+
import TrueTMSBusinessEntitiesSdk from "./businessEntities";
|
|
2
3
|
import TrueTMSDriverSdk from "./drivers";
|
|
3
4
|
import TrueTMSDriverSettlementsSdk from "./driverSettlements";
|
|
4
5
|
import TrueTMSInvoicesSdk from "./invoices";
|
|
@@ -21,6 +22,7 @@ class TrueTMS {
|
|
|
21
22
|
public driverSettlements: TrueTMSDriverSettlementsSdk;
|
|
22
23
|
public users: TrueTMSUsersSdk;
|
|
23
24
|
public transactions: TrueTMSTransactionsSdk;
|
|
25
|
+
public businessEntities: TrueTMSBusinessEntitiesSdk;
|
|
24
26
|
|
|
25
27
|
constructor(private options: TrueTMSOptions) {
|
|
26
28
|
this.drivers = new TrueTMSDriverSdk(options);
|
|
@@ -30,6 +32,7 @@ class TrueTMS {
|
|
|
30
32
|
this.driverSettlements = new TrueTMSDriverSettlementsSdk(options);
|
|
31
33
|
this.users = new TrueTMSUsersSdk(options);
|
|
32
34
|
this.transactions = new TrueTMSTransactionsSdk(options);
|
|
35
|
+
this.businessEntities = new TrueTMSBusinessEntitiesSdk(options);
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
|