@chrt-inc/typescript-sdk 0.0.170-f → 0.0.170-h
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/README.md +11 -7
- package/dist/cjs/Client.d.ts +9 -12
- package/dist/cjs/Client.js +39 -44
- package/dist/cjs/api/index.d.ts +1 -1
- package/dist/cjs/api/index.js +1 -1
- package/dist/cjs/api/resources/connections/client/Client.d.ts +51 -0
- package/dist/cjs/api/resources/{oortConnections → connections}/client/Client.js +22 -80
- package/dist/cjs/api/resources/connections/index.d.ts +2 -0
- package/dist/cjs/api/resources/{oortCourierPayDriverPayouts → connections}/index.js +1 -0
- package/dist/cjs/api/resources/{directory → connections/resources/connectionToCourier}/client/Client.d.ts +15 -13
- package/dist/cjs/api/resources/{directory → connections/resources/connectionToCourier}/client/Client.js +20 -18
- package/dist/cjs/api/resources/connections/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/connections/resources/index.js +41 -0
- package/dist/cjs/api/resources/courierPayDriverLineItemGroup/client/Client.d.ts +134 -0
- package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/Client.js +112 -103
- package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/AddLineItemsReq.d.ts +2 -0
- package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups/client/requests/CreateCourierPayDriverLineItemGroupRequest.d.ts → courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupCreateRequest.d.ts} +1 -1
- package/dist/{esm/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCalculateCourierPayDriverLineItemGroupRequest.d.mts → cjs/api/resources/courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupPreviewRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/RemoveLineItemsReq.d.ts +2 -0
- package/dist/cjs/api/resources/courierPayDriverLineItemGroup/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/Client.d.ts +24 -24
- package/dist/cjs/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/Client.js +37 -37
- package/dist/cjs/api/resources/dev/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/dev/client/Client.js +4 -4
- package/dist/cjs/api/resources/index.d.ts +5 -9
- package/dist/cjs/api/resources/index.js +6 -10
- package/dist/cjs/api/resources/notifications/resources/courier/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/notifications/resources/courier/client/Client.js +12 -12
- package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.js +12 -12
- package/dist/cjs/api/resources/oortCourierPayDriverRateSheets/client/Client.d.ts +38 -38
- package/dist/cjs/api/resources/oortCourierPayDriverRateSheets/client/Client.js +65 -65
- package/dist/cjs/api/resources/oortOffChrtShipperOrgConnectionInfo/client/Client.d.ts +10 -0
- package/dist/cjs/api/resources/oortOffChrtShipperOrgConnectionInfo/client/Client.js +52 -0
- package/dist/cjs/api/resources/orgs/client/Client.d.ts +18 -18
- package/dist/cjs/api/resources/orgs/client/Client.js +30 -30
- package/dist/cjs/api/resources/payments/client/Client.d.ts +0 -8
- package/dist/cjs/api/resources/payments/client/Client.js +0 -47
- package/dist/cjs/api/resources/root/client/Client.d.ts +15 -34
- package/dist/cjs/api/resources/root/client/Client.js +20 -116
- package/dist/cjs/api/resources/root/index.d.ts +0 -1
- package/dist/cjs/api/resources/root/index.js +0 -1
- package/dist/cjs/api/resources/users/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/users/client/Client.js +4 -4
- package/dist/cjs/api/types/index.d.ts +0 -2
- package/dist/cjs/api/types/index.js +0 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +9 -12
- package/dist/esm/Client.mjs +11 -16
- package/dist/esm/api/index.d.mts +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/resources/connections/client/Client.d.mts +51 -0
- package/dist/esm/api/resources/{oortConnections → connections}/client/Client.mjs +20 -78
- package/dist/esm/api/resources/connections/index.d.mts +2 -0
- package/dist/esm/api/resources/connections/index.mjs +2 -0
- package/dist/esm/api/resources/{directory → connections/resources/connectionToCourier}/client/Client.d.mts +15 -13
- package/dist/esm/api/resources/{directory → connections/resources/connectionToCourier}/client/Client.mjs +18 -16
- package/dist/esm/api/resources/connections/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/connections/resources/index.mjs +2 -0
- package/dist/esm/api/resources/courierPayDriverLineItemGroup/client/Client.d.mts +134 -0
- package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/Client.mjs +110 -101
- package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/AddLineItemsReq.d.mts +2 -0
- package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups/client/requests/CreateCourierPayDriverLineItemGroupRequest.d.mts → courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupCreateRequest.d.mts} +1 -1
- package/dist/{cjs/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCalculateCourierPayDriverLineItemGroupRequest.d.ts → esm/api/resources/courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupPreviewRequest.d.mts} +1 -1
- package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/RemoveLineItemsReq.d.mts +2 -0
- package/dist/esm/api/resources/courierPayDriverLineItemGroup/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/courierPayDriverLineItemGroup/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/Client.d.mts +24 -24
- package/dist/esm/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/Client.mjs +35 -35
- package/dist/esm/api/resources/courierPayDriverPayouts/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/dev/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/dev/client/Client.mjs +4 -4
- package/dist/esm/api/resources/index.d.mts +5 -9
- package/dist/esm/api/resources/index.mjs +5 -9
- package/dist/esm/api/resources/notifications/resources/courier/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/notifications/resources/courier/client/Client.mjs +12 -12
- package/dist/esm/api/resources/notifications/resources/shipper/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/notifications/resources/shipper/client/Client.mjs +12 -12
- package/dist/esm/api/resources/oortCourierPayDriverRateSheets/client/Client.d.mts +38 -38
- package/dist/esm/api/resources/oortCourierPayDriverRateSheets/client/Client.mjs +65 -65
- package/dist/esm/api/resources/oortOffChrtShipperOrgConnectionInfo/client/Client.d.mts +10 -0
- package/dist/esm/api/resources/oortOffChrtShipperOrgConnectionInfo/client/Client.mjs +52 -0
- package/dist/esm/api/resources/orgs/client/Client.d.mts +18 -18
- package/dist/esm/api/resources/orgs/client/Client.mjs +30 -30
- package/dist/esm/api/resources/payments/client/Client.d.mts +0 -8
- package/dist/esm/api/resources/payments/client/Client.mjs +0 -47
- package/dist/esm/api/resources/root/client/Client.d.mts +15 -34
- package/dist/esm/api/resources/root/client/Client.mjs +20 -116
- package/dist/esm/api/resources/root/index.d.mts +0 -1
- package/dist/esm/api/resources/root/index.mjs +0 -1
- package/dist/esm/api/resources/users/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/users/client/Client.mjs +4 -4
- package/dist/esm/api/types/index.d.mts +0 -2
- package/dist/esm/api/types/index.mjs +0 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +246 -391
- package/dist/cjs/api/resources/directory/client/requests/DbQueryParams.d.ts +0 -12
- package/dist/cjs/api/resources/directory/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/oortConnections/client/Client.d.ts +0 -63
- package/dist/cjs/api/resources/oortCourierPayDriverLineItemGroups/client/Client.d.ts +0 -136
- package/dist/cjs/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCalculateCourierPayDriverLineItemGroupRequest.js +0 -5
- package/dist/cjs/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByIdRequest.d.ts +0 -12
- package/dist/cjs/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByIdRequest.js +0 -5
- package/dist/cjs/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByTaskGroupIdRequest.d.ts +0 -12
- package/dist/cjs/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByTaskGroupIdRequest.js +0 -5
- package/dist/cjs/api/resources/oortCourierPayDriverLineItemGroups/client/requests/index.d.ts +0 -6
- package/dist/cjs/api/resources/oortCourierPayDriverPayouts/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/oortCourierPayDriverPayouts/client/index.js +0 -17
- package/dist/cjs/api/resources/oortCourierPayDriverPayouts/index.d.ts +0 -1
- package/dist/cjs/api/resources/root/types/PydanticResponse.d.ts +0 -8
- package/dist/cjs/api/resources/root/types/PydanticResponse.js +0 -5
- package/dist/cjs/api/resources/root/types/index.d.ts +0 -1
- package/dist/cjs/api/resources/root/types/index.js +0 -17
- package/dist/cjs/api/types/Shipper2.d.ts +0 -20
- package/dist/cjs/api/types/Shipper2.js +0 -5
- package/dist/cjs/api/types/StreetAddress1.d.ts +0 -18
- package/dist/cjs/api/types/StreetAddress1.js +0 -5
- package/dist/esm/api/resources/directory/client/requests/DbQueryParams.d.mts +0 -12
- package/dist/esm/api/resources/directory/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/oortConnections/client/Client.d.mts +0 -63
- package/dist/esm/api/resources/oortCourierPayDriverLineItemGroups/client/Client.d.mts +0 -136
- package/dist/esm/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCalculateCourierPayDriverLineItemGroupRequest.mjs +0 -4
- package/dist/esm/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByIdRequest.d.mts +0 -12
- package/dist/esm/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByIdRequest.mjs +0 -4
- package/dist/esm/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByTaskGroupIdRequest.d.mts +0 -12
- package/dist/esm/api/resources/oortCourierPayDriverLineItemGroups/client/requests/GetCourierPayDriverLineItemGroupByTaskGroupIdRequest.mjs +0 -4
- package/dist/esm/api/resources/oortCourierPayDriverLineItemGroups/client/requests/index.d.mts +0 -6
- package/dist/esm/api/resources/oortCourierPayDriverPayouts/client/index.d.mts +0 -2
- package/dist/esm/api/resources/oortCourierPayDriverPayouts/client/index.mjs +0 -1
- package/dist/esm/api/resources/oortCourierPayDriverPayouts/index.d.mts +0 -1
- package/dist/esm/api/resources/oortCourierPayDriverPayouts/index.mjs +0 -1
- package/dist/esm/api/resources/root/types/PydanticResponse.d.mts +0 -8
- package/dist/esm/api/resources/root/types/PydanticResponse.mjs +0 -4
- package/dist/esm/api/resources/root/types/index.d.mts +0 -1
- package/dist/esm/api/resources/root/types/index.mjs +0 -1
- package/dist/esm/api/types/Shipper2.d.mts +0 -20
- package/dist/esm/api/types/Shipper2.mjs +0 -4
- package/dist/esm/api/types/StreetAddress1.d.mts +0 -18
- package/dist/esm/api/types/StreetAddress1.mjs +0 -4
- /package/dist/{esm/api/resources/directory/client/requests/index.mjs → cjs/api/resources/connections/client/index.d.ts} +0 -0
- /package/dist/cjs/api/resources/{directory/client/requests → connections/client}/index.js +0 -0
- /package/dist/cjs/api/resources/{directory → connections/resources/connectionToCourier}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{directory → connections/resources/connectionToCourier}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{oortConnections → connections/resources/connectionToCourier}/client/requests/CreateConnectionReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortConnections → connections/resources/connectionToCourier}/client/requests/CreateConnectionReq.js +0 -0
- /package/dist/cjs/api/resources/{oortConnections → connections/resources/connectionToCourier}/client/requests/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortConnections → connections/resources/connectionToCourier}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{directory → connections/resources/connectionToCourier}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{directory → connections/resources/connectionToCourier}/index.js +0 -0
- /package/dist/cjs/api/resources/{oortConnections → courierPayDriverLineItemGroup}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortConnections → courierPayDriverLineItemGroup}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/AddLineItemsReq.js +0 -0
- /package/dist/cjs/api/resources/{directory/client/requests/DbQueryParams.js → courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupCreateRequest.js} +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups/client/requests/CreateCourierPayDriverLineItemGroupRequest.js → courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupPreviewRequest.js} +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/RemoveLineItemsReq.js +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{oortConnections → courierPayDriverLineItemGroup}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortConnections → courierPayDriverLineItemGroup}/index.js +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/requests/CourierPayDriverPayoutClientCreate1.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/requests/CourierPayDriverPayoutClientCreate1.js +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/requests/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/index.js +0 -0
- /package/dist/esm/api/resources/{oortConnections/client/requests/index.mjs → connections/client/index.d.mts} +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups/client/requests → connections/client}/index.mjs +0 -0
- /package/dist/esm/api/resources/{directory → connections/resources/connectionToCourier}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{directory → connections/resources/connectionToCourier}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{oortConnections → connections/resources/connectionToCourier}/client/requests/CreateConnectionReq.d.mts +0 -0
- /package/dist/esm/api/resources/{oortConnections → connections/resources/connectionToCourier}/client/requests/CreateConnectionReq.mjs +0 -0
- /package/dist/esm/api/resources/{oortConnections → connections/resources/connectionToCourier}/client/requests/index.d.mts +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverPayouts → connections/resources/connectionToCourier}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{directory → connections/resources/connectionToCourier}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{directory → connections/resources/connectionToCourier}/index.mjs +0 -0
- /package/dist/esm/api/resources/{oortConnections → courierPayDriverLineItemGroup}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{oortConnections → courierPayDriverLineItemGroup}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/AddLineItemsReq.mjs +0 -0
- /package/dist/esm/api/resources/{directory/client/requests/DbQueryParams.mjs → courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupCreateRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups/client/requests/CreateCourierPayDriverLineItemGroupRequest.mjs → courierPayDriverLineItemGroup/client/requests/CourierPayDriverLineItemGroupPreviewRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverLineItemGroup}/client/requests/RemoveLineItemsReq.mjs +0 -0
- /package/dist/esm/api/resources/{oortConnections → courierPayDriverLineItemGroup}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{oortConnections → courierPayDriverLineItemGroup}/index.mjs +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/requests/CourierPayDriverPayoutClientCreate1.d.mts +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/requests/CourierPayDriverPayoutClientCreate1.mjs +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverPayouts → courierPayDriverPayouts}/client/requests/index.d.mts +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{oortCourierPayDriverLineItemGroups → courierPayDriverPayouts}/index.mjs +0 -0
package/README.md
CHANGED
|
@@ -23,7 +23,11 @@ Instantiate and use the client with the following:
|
|
|
23
23
|
import { ChrtClient } from "@chrt-inc/typescript-sdk";
|
|
24
24
|
|
|
25
25
|
const client = new ChrtClient({ token: "YOUR_TOKEN" });
|
|
26
|
-
await client.
|
|
26
|
+
await client.dev.createTemplate({
|
|
27
|
+
message: "message",
|
|
28
|
+
number: 1,
|
|
29
|
+
timestamp: "2024-01-15T09:30:00Z",
|
|
30
|
+
});
|
|
27
31
|
```
|
|
28
32
|
|
|
29
33
|
## Request And Response Types
|
|
@@ -48,7 +52,7 @@ will be thrown.
|
|
|
48
52
|
import { ChrtError } from "@chrt-inc/typescript-sdk";
|
|
49
53
|
|
|
50
54
|
try {
|
|
51
|
-
await client.
|
|
55
|
+
await client.dev.createTemplate(...);
|
|
52
56
|
} catch (err) {
|
|
53
57
|
if (err instanceof ChrtError) {
|
|
54
58
|
console.log(err.statusCode);
|
|
@@ -66,7 +70,7 @@ try {
|
|
|
66
70
|
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
67
71
|
|
|
68
72
|
```typescript
|
|
69
|
-
const response = await client.
|
|
73
|
+
const response = await client.dev.createTemplate(..., {
|
|
70
74
|
headers: {
|
|
71
75
|
'X-Custom-Header': 'custom value'
|
|
72
76
|
}
|
|
@@ -88,7 +92,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
88
92
|
Use the `maxRetries` request option to configure this behavior.
|
|
89
93
|
|
|
90
94
|
```typescript
|
|
91
|
-
const response = await client.
|
|
95
|
+
const response = await client.dev.createTemplate(..., {
|
|
92
96
|
maxRetries: 0 // override maxRetries at the request level
|
|
93
97
|
});
|
|
94
98
|
```
|
|
@@ -98,7 +102,7 @@ const response = await client.root.postAuthd(..., {
|
|
|
98
102
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
99
103
|
|
|
100
104
|
```typescript
|
|
101
|
-
const response = await client.
|
|
105
|
+
const response = await client.dev.createTemplate(..., {
|
|
102
106
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
103
107
|
});
|
|
104
108
|
```
|
|
@@ -109,7 +113,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
|
|
|
109
113
|
|
|
110
114
|
```typescript
|
|
111
115
|
const controller = new AbortController();
|
|
112
|
-
const response = await client.
|
|
116
|
+
const response = await client.dev.createTemplate(..., {
|
|
113
117
|
abortSignal: controller.signal
|
|
114
118
|
});
|
|
115
119
|
controller.abort(); // aborts the request
|
|
@@ -121,7 +125,7 @@ The SDK provides access to raw response data, including headers, through the `.w
|
|
|
121
125
|
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
122
126
|
|
|
123
127
|
```typescript
|
|
124
|
-
const { data, rawResponse } = await client.
|
|
128
|
+
const { data, rawResponse } = await client.dev.createTemplate(...).withRawResponse();
|
|
125
129
|
|
|
126
130
|
console.log(data);
|
|
127
131
|
console.log(rawResponse.headers['X-My-Header']);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -5,10 +5,9 @@ import * as environments from "./environments.js";
|
|
|
5
5
|
import * as core from "./core/index.js";
|
|
6
6
|
import { Root } from "./api/resources/root/client/Client.js";
|
|
7
7
|
import { Dev } from "./api/resources/dev/client/Client.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { OortCourierPayDriverPayouts } from "./api/resources/oortCourierPayDriverPayouts/client/Client.js";
|
|
8
|
+
import { Connections } from "./api/resources/connections/client/Client.js";
|
|
9
|
+
import { CourierPayDriverLineItemGroup } from "./api/resources/courierPayDriverLineItemGroup/client/Client.js";
|
|
10
|
+
import { CourierPayDriverPayouts } from "./api/resources/courierPayDriverPayouts/client/Client.js";
|
|
12
11
|
import { OortCourierPayDriverRateSheets } from "./api/resources/oortCourierPayDriverRateSheets/client/Client.js";
|
|
13
12
|
import { OortDrivers } from "./api/resources/oortDrivers/client/Client.js";
|
|
14
13
|
import { OortMilestoneNotificationPreferences } from "./api/resources/oortMilestoneNotificationPreferences/client/Client.js";
|
|
@@ -48,10 +47,9 @@ export declare class ChrtClient {
|
|
|
48
47
|
protected readonly _options: ChrtClient.Options;
|
|
49
48
|
protected _root: Root | undefined;
|
|
50
49
|
protected _dev: Dev | undefined;
|
|
51
|
-
protected
|
|
52
|
-
protected
|
|
53
|
-
protected
|
|
54
|
-
protected _oortCourierPayDriverPayouts: OortCourierPayDriverPayouts | undefined;
|
|
50
|
+
protected _connections: Connections | undefined;
|
|
51
|
+
protected _courierPayDriverLineItemGroup: CourierPayDriverLineItemGroup | undefined;
|
|
52
|
+
protected _courierPayDriverPayouts: CourierPayDriverPayouts | undefined;
|
|
55
53
|
protected _oortCourierPayDriverRateSheets: OortCourierPayDriverRateSheets | undefined;
|
|
56
54
|
protected _oortDrivers: OortDrivers | undefined;
|
|
57
55
|
protected _oortMilestoneNotificationPreferences: OortMilestoneNotificationPreferences | undefined;
|
|
@@ -69,10 +67,9 @@ export declare class ChrtClient {
|
|
|
69
67
|
constructor(_options?: ChrtClient.Options);
|
|
70
68
|
get root(): Root;
|
|
71
69
|
get dev(): Dev;
|
|
72
|
-
get
|
|
73
|
-
get
|
|
74
|
-
get
|
|
75
|
-
get oortCourierPayDriverPayouts(): OortCourierPayDriverPayouts;
|
|
70
|
+
get connections(): Connections;
|
|
71
|
+
get courierPayDriverLineItemGroup(): CourierPayDriverLineItemGroup;
|
|
72
|
+
get courierPayDriverPayouts(): CourierPayDriverPayouts;
|
|
76
73
|
get oortCourierPayDriverRateSheets(): OortCourierPayDriverRateSheets;
|
|
77
74
|
get oortDrivers(): OortDrivers;
|
|
78
75
|
get oortMilestoneNotificationPreferences(): OortMilestoneNotificationPreferences;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -41,31 +41,30 @@ const core = __importStar(require("./core/index.js"));
|
|
|
41
41
|
const headers_js_1 = require("./core/headers.js");
|
|
42
42
|
const Client_js_1 = require("./api/resources/root/client/Client.js");
|
|
43
43
|
const Client_js_2 = require("./api/resources/dev/client/Client.js");
|
|
44
|
-
const Client_js_3 = require("./api/resources/
|
|
45
|
-
const Client_js_4 = require("./api/resources/
|
|
46
|
-
const Client_js_5 = require("./api/resources/
|
|
47
|
-
const Client_js_6 = require("./api/resources/
|
|
48
|
-
const Client_js_7 = require("./api/resources/
|
|
49
|
-
const Client_js_8 = require("./api/resources/
|
|
50
|
-
const Client_js_9 = require("./api/resources/
|
|
51
|
-
const Client_js_10 = require("./api/resources/
|
|
52
|
-
const Client_js_11 = require("./api/resources/
|
|
53
|
-
const Client_js_12 = require("./api/resources/
|
|
54
|
-
const Client_js_13 = require("./api/resources/
|
|
55
|
-
const Client_js_14 = require("./api/resources/
|
|
56
|
-
const Client_js_15 = require("./api/resources/
|
|
57
|
-
const Client_js_16 = require("./api/resources/
|
|
58
|
-
const Client_js_17 = require("./api/resources/
|
|
59
|
-
const Client_js_18 = require("./api/resources/
|
|
60
|
-
const Client_js_19 = require("./api/resources/
|
|
61
|
-
const Client_js_20 = require("./api/resources/notifications/client/Client.js");
|
|
44
|
+
const Client_js_3 = require("./api/resources/connections/client/Client.js");
|
|
45
|
+
const Client_js_4 = require("./api/resources/courierPayDriverLineItemGroup/client/Client.js");
|
|
46
|
+
const Client_js_5 = require("./api/resources/courierPayDriverPayouts/client/Client.js");
|
|
47
|
+
const Client_js_6 = require("./api/resources/oortCourierPayDriverRateSheets/client/Client.js");
|
|
48
|
+
const Client_js_7 = require("./api/resources/oortDrivers/client/Client.js");
|
|
49
|
+
const Client_js_8 = require("./api/resources/oortMilestoneNotificationPreferences/client/Client.js");
|
|
50
|
+
const Client_js_9 = require("./api/resources/oortMilestones/client/Client.js");
|
|
51
|
+
const Client_js_10 = require("./api/resources/oortOffChrtShipperOrgConnectionInfo/client/Client.js");
|
|
52
|
+
const Client_js_11 = require("./api/resources/oortOrders/client/Client.js");
|
|
53
|
+
const Client_js_12 = require("./api/resources/oortOrgConnectionInfos/client/Client.js");
|
|
54
|
+
const Client_js_13 = require("./api/resources/oortOrgProfiles/client/Client.js");
|
|
55
|
+
const Client_js_14 = require("./api/resources/oortShipperContactInfo/client/Client.js");
|
|
56
|
+
const Client_js_15 = require("./api/resources/oortTaskGroups/client/Client.js");
|
|
57
|
+
const Client_js_16 = require("./api/resources/orgs/client/Client.js");
|
|
58
|
+
const Client_js_17 = require("./api/resources/payments/client/Client.js");
|
|
59
|
+
const Client_js_18 = require("./api/resources/users/client/Client.js");
|
|
60
|
+
const Client_js_19 = require("./api/resources/notifications/client/Client.js");
|
|
62
61
|
class ChrtClient {
|
|
63
62
|
constructor(_options = {}) {
|
|
64
63
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
65
64
|
"X-Fern-Language": "JavaScript",
|
|
66
65
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
67
|
-
"X-Fern-SDK-Version": "0.0.170-
|
|
68
|
-
"User-Agent": "@chrt-inc/typescript-sdk/0.0.170-
|
|
66
|
+
"X-Fern-SDK-Version": "0.0.170-h",
|
|
67
|
+
"User-Agent": "@chrt-inc/typescript-sdk/0.0.170-h",
|
|
69
68
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
70
69
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
71
70
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -78,77 +77,73 @@ class ChrtClient {
|
|
|
78
77
|
var _a;
|
|
79
78
|
return ((_a = this._dev) !== null && _a !== void 0 ? _a : (this._dev = new Client_js_2.Dev(this._options)));
|
|
80
79
|
}
|
|
81
|
-
get
|
|
80
|
+
get connections() {
|
|
82
81
|
var _a;
|
|
83
|
-
return ((_a = this.
|
|
82
|
+
return ((_a = this._connections) !== null && _a !== void 0 ? _a : (this._connections = new Client_js_3.Connections(this._options)));
|
|
84
83
|
}
|
|
85
|
-
get
|
|
84
|
+
get courierPayDriverLineItemGroup() {
|
|
86
85
|
var _a;
|
|
87
|
-
return ((_a = this.
|
|
86
|
+
return ((_a = this._courierPayDriverLineItemGroup) !== null && _a !== void 0 ? _a : (this._courierPayDriverLineItemGroup = new Client_js_4.CourierPayDriverLineItemGroup(this._options)));
|
|
88
87
|
}
|
|
89
|
-
get
|
|
88
|
+
get courierPayDriverPayouts() {
|
|
90
89
|
var _a;
|
|
91
|
-
return ((_a = this.
|
|
92
|
-
}
|
|
93
|
-
get oortCourierPayDriverPayouts() {
|
|
94
|
-
var _a;
|
|
95
|
-
return ((_a = this._oortCourierPayDriverPayouts) !== null && _a !== void 0 ? _a : (this._oortCourierPayDriverPayouts = new Client_js_6.OortCourierPayDriverPayouts(this._options)));
|
|
90
|
+
return ((_a = this._courierPayDriverPayouts) !== null && _a !== void 0 ? _a : (this._courierPayDriverPayouts = new Client_js_5.CourierPayDriverPayouts(this._options)));
|
|
96
91
|
}
|
|
97
92
|
get oortCourierPayDriverRateSheets() {
|
|
98
93
|
var _a;
|
|
99
|
-
return ((_a = this._oortCourierPayDriverRateSheets) !== null && _a !== void 0 ? _a : (this._oortCourierPayDriverRateSheets = new
|
|
94
|
+
return ((_a = this._oortCourierPayDriverRateSheets) !== null && _a !== void 0 ? _a : (this._oortCourierPayDriverRateSheets = new Client_js_6.OortCourierPayDriverRateSheets(this._options)));
|
|
100
95
|
}
|
|
101
96
|
get oortDrivers() {
|
|
102
97
|
var _a;
|
|
103
|
-
return ((_a = this._oortDrivers) !== null && _a !== void 0 ? _a : (this._oortDrivers = new
|
|
98
|
+
return ((_a = this._oortDrivers) !== null && _a !== void 0 ? _a : (this._oortDrivers = new Client_js_7.OortDrivers(this._options)));
|
|
104
99
|
}
|
|
105
100
|
get oortMilestoneNotificationPreferences() {
|
|
106
101
|
var _a;
|
|
107
|
-
return ((_a = this._oortMilestoneNotificationPreferences) !== null && _a !== void 0 ? _a : (this._oortMilestoneNotificationPreferences = new
|
|
102
|
+
return ((_a = this._oortMilestoneNotificationPreferences) !== null && _a !== void 0 ? _a : (this._oortMilestoneNotificationPreferences = new Client_js_8.OortMilestoneNotificationPreferences(this._options)));
|
|
108
103
|
}
|
|
109
104
|
get oortMilestones() {
|
|
110
105
|
var _a;
|
|
111
|
-
return ((_a = this._oortMilestones) !== null && _a !== void 0 ? _a : (this._oortMilestones = new
|
|
106
|
+
return ((_a = this._oortMilestones) !== null && _a !== void 0 ? _a : (this._oortMilestones = new Client_js_9.OortMilestones(this._options)));
|
|
112
107
|
}
|
|
113
108
|
get oortOffChrtShipperOrgConnectionInfo() {
|
|
114
109
|
var _a;
|
|
115
|
-
return ((_a = this._oortOffChrtShipperOrgConnectionInfo) !== null && _a !== void 0 ? _a : (this._oortOffChrtShipperOrgConnectionInfo = new
|
|
110
|
+
return ((_a = this._oortOffChrtShipperOrgConnectionInfo) !== null && _a !== void 0 ? _a : (this._oortOffChrtShipperOrgConnectionInfo = new Client_js_10.OortOffChrtShipperOrgConnectionInfo(this._options)));
|
|
116
111
|
}
|
|
117
112
|
get oortOrders() {
|
|
118
113
|
var _a;
|
|
119
|
-
return ((_a = this._oortOrders) !== null && _a !== void 0 ? _a : (this._oortOrders = new
|
|
114
|
+
return ((_a = this._oortOrders) !== null && _a !== void 0 ? _a : (this._oortOrders = new Client_js_11.OortOrders(this._options)));
|
|
120
115
|
}
|
|
121
116
|
get oortOrgConnectionInfos() {
|
|
122
117
|
var _a;
|
|
123
|
-
return ((_a = this._oortOrgConnectionInfos) !== null && _a !== void 0 ? _a : (this._oortOrgConnectionInfos = new
|
|
118
|
+
return ((_a = this._oortOrgConnectionInfos) !== null && _a !== void 0 ? _a : (this._oortOrgConnectionInfos = new Client_js_12.OortOrgConnectionInfos(this._options)));
|
|
124
119
|
}
|
|
125
120
|
get oortOrgProfiles() {
|
|
126
121
|
var _a;
|
|
127
|
-
return ((_a = this._oortOrgProfiles) !== null && _a !== void 0 ? _a : (this._oortOrgProfiles = new
|
|
122
|
+
return ((_a = this._oortOrgProfiles) !== null && _a !== void 0 ? _a : (this._oortOrgProfiles = new Client_js_13.OortOrgProfiles(this._options)));
|
|
128
123
|
}
|
|
129
124
|
get oortShipperContactInfo() {
|
|
130
125
|
var _a;
|
|
131
|
-
return ((_a = this._oortShipperContactInfo) !== null && _a !== void 0 ? _a : (this._oortShipperContactInfo = new
|
|
126
|
+
return ((_a = this._oortShipperContactInfo) !== null && _a !== void 0 ? _a : (this._oortShipperContactInfo = new Client_js_14.OortShipperContactInfo(this._options)));
|
|
132
127
|
}
|
|
133
128
|
get oortTaskGroups() {
|
|
134
129
|
var _a;
|
|
135
|
-
return ((_a = this._oortTaskGroups) !== null && _a !== void 0 ? _a : (this._oortTaskGroups = new
|
|
130
|
+
return ((_a = this._oortTaskGroups) !== null && _a !== void 0 ? _a : (this._oortTaskGroups = new Client_js_15.OortTaskGroups(this._options)));
|
|
136
131
|
}
|
|
137
132
|
get orgs() {
|
|
138
133
|
var _a;
|
|
139
|
-
return ((_a = this._orgs) !== null && _a !== void 0 ? _a : (this._orgs = new
|
|
134
|
+
return ((_a = this._orgs) !== null && _a !== void 0 ? _a : (this._orgs = new Client_js_16.Orgs(this._options)));
|
|
140
135
|
}
|
|
141
136
|
get payments() {
|
|
142
137
|
var _a;
|
|
143
|
-
return ((_a = this._payments) !== null && _a !== void 0 ? _a : (this._payments = new
|
|
138
|
+
return ((_a = this._payments) !== null && _a !== void 0 ? _a : (this._payments = new Client_js_17.Payments(this._options)));
|
|
144
139
|
}
|
|
145
140
|
get users() {
|
|
146
141
|
var _a;
|
|
147
|
-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new
|
|
142
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_18.Users(this._options)));
|
|
148
143
|
}
|
|
149
144
|
get notifications() {
|
|
150
145
|
var _a;
|
|
151
|
-
return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new
|
|
146
|
+
return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new Client_js_19.Notifications(this._options)));
|
|
152
147
|
}
|
|
153
148
|
}
|
|
154
149
|
exports.ChrtClient = ChrtClient;
|
package/dist/cjs/api/index.d.ts
CHANGED
package/dist/cjs/api/index.js
CHANGED
|
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./resources/index.js"), exports);
|
|
18
17
|
__exportStar(require("./types/index.js"), exports);
|
|
19
18
|
__exportStar(require("./errors/index.js"), exports);
|
|
19
|
+
__exportStar(require("./resources/index.js"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../core/index.js";
|
|
6
|
+
import * as Chrt from "../../../index.js";
|
|
7
|
+
import { ConnectionToCourier } from "../resources/connectionToCourier/client/Client.js";
|
|
8
|
+
export declare namespace Connections {
|
|
9
|
+
interface Options {
|
|
10
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
11
|
+
/** Specify a custom URL to connect the client to. */
|
|
12
|
+
baseUrl?: core.Supplier<string>;
|
|
13
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
14
|
+
/** Additional headers to include in requests. */
|
|
15
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
16
|
+
fetcher?: core.FetchFunction;
|
|
17
|
+
}
|
|
18
|
+
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
20
|
+
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
22
|
+
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
24
|
+
abortSignal?: AbortSignal;
|
|
25
|
+
/** Additional headers to include in the request. */
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare class Connections {
|
|
30
|
+
protected readonly _options: Connections.Options;
|
|
31
|
+
protected _connectionToCourier: ConnectionToCourier | undefined;
|
|
32
|
+
constructor(_options?: Connections.Options);
|
|
33
|
+
get connectionToCourier(): ConnectionToCourier;
|
|
34
|
+
/**
|
|
35
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await client.connections.listCouriers()
|
|
39
|
+
*/
|
|
40
|
+
listCouriers(requestOptions?: Connections.RequestOptions): core.HttpResponsePromise<Chrt.CourierOrgConnectionInfo1[]>;
|
|
41
|
+
private __listCouriers;
|
|
42
|
+
/**
|
|
43
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await client.connections.listShippers()
|
|
47
|
+
*/
|
|
48
|
+
listShippers(requestOptions?: Connections.RequestOptions): core.HttpResponsePromise<Chrt.ShipperOrgConnectionInfo1[]>;
|
|
49
|
+
private __listShippers;
|
|
50
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
51
|
+
}
|
|
@@ -45,30 +45,34 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.
|
|
48
|
+
exports.Connections = void 0;
|
|
49
49
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
50
|
const core = __importStar(require("../../../../core/index.js"));
|
|
51
|
-
const Chrt = __importStar(require("../../../index.js"));
|
|
52
51
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
53
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
54
|
-
|
|
53
|
+
const Client_js_1 = require("../resources/connectionToCourier/client/Client.js");
|
|
54
|
+
class Connections {
|
|
55
55
|
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
|
+
get connectionToCourier() {
|
|
59
|
+
var _a;
|
|
60
|
+
return ((_a = this._connectionToCourier) !== null && _a !== void 0 ? _a : (this._connectionToCourier = new Client_js_1.ConnectionToCourier(this._options)));
|
|
61
|
+
}
|
|
58
62
|
/**
|
|
59
|
-
* @param {
|
|
63
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
64
|
*
|
|
61
65
|
* @example
|
|
62
|
-
* await client.
|
|
66
|
+
* await client.connections.listCouriers()
|
|
63
67
|
*/
|
|
64
|
-
|
|
65
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
68
|
+
listCouriers(requestOptions) {
|
|
69
|
+
return core.HttpResponsePromise.fromPromise(this.__listCouriers(requestOptions));
|
|
66
70
|
}
|
|
67
|
-
|
|
71
|
+
__listCouriers(requestOptions) {
|
|
68
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
73
|
var _a, _b, _c, _d;
|
|
70
74
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/connections/
|
|
75
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/connections/couriers/list"),
|
|
72
76
|
method: "GET",
|
|
73
77
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
74
78
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -93,7 +97,7 @@ class OortConnections {
|
|
|
93
97
|
rawResponse: _response.rawResponse,
|
|
94
98
|
});
|
|
95
99
|
case "timeout":
|
|
96
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/connections/
|
|
100
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/connections/couriers/list.");
|
|
97
101
|
case "unknown":
|
|
98
102
|
throw new errors.ChrtError({
|
|
99
103
|
message: _response.error.errorMessage,
|
|
@@ -103,19 +107,19 @@ class OortConnections {
|
|
|
103
107
|
});
|
|
104
108
|
}
|
|
105
109
|
/**
|
|
106
|
-
* @param {
|
|
110
|
+
* @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
|
|
107
111
|
*
|
|
108
112
|
* @example
|
|
109
|
-
* await client.
|
|
113
|
+
* await client.connections.listShippers()
|
|
110
114
|
*/
|
|
111
|
-
|
|
112
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
115
|
+
listShippers(requestOptions) {
|
|
116
|
+
return core.HttpResponsePromise.fromPromise(this.__listShippers(requestOptions));
|
|
113
117
|
}
|
|
114
|
-
|
|
118
|
+
__listShippers(requestOptions) {
|
|
115
119
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
120
|
var _a, _b, _c, _d;
|
|
117
121
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
118
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/connections/
|
|
122
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/connections/shippers/list"),
|
|
119
123
|
method: "GET",
|
|
120
124
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
121
125
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -140,69 +144,7 @@ class OortConnections {
|
|
|
140
144
|
rawResponse: _response.rawResponse,
|
|
141
145
|
});
|
|
142
146
|
case "timeout":
|
|
143
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/connections/
|
|
144
|
-
case "unknown":
|
|
145
|
-
throw new errors.ChrtError({
|
|
146
|
-
message: _response.error.errorMessage,
|
|
147
|
-
rawResponse: _response.rawResponse,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Body: Courier Handle, Shipper Org Id from JWT
|
|
154
|
-
*
|
|
155
|
-
* @param {Chrt.CreateConnectionReq} request
|
|
156
|
-
* @param {OortConnections.RequestOptions} requestOptions - Request-specific configuration.
|
|
157
|
-
*
|
|
158
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
159
|
-
*
|
|
160
|
-
* @example
|
|
161
|
-
* await client.oortConnections.createConnectionToCourier({
|
|
162
|
-
* handle: "handle"
|
|
163
|
-
* })
|
|
164
|
-
*/
|
|
165
|
-
createConnectionToCourier(request, requestOptions) {
|
|
166
|
-
return core.HttpResponsePromise.fromPromise(this.__createConnectionToCourier(request, requestOptions));
|
|
167
|
-
}
|
|
168
|
-
__createConnectionToCourier(request, requestOptions) {
|
|
169
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
var _a, _b, _c, _d;
|
|
171
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
172
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/connections/create_connection_to_courier"),
|
|
173
|
-
method: "POST",
|
|
174
|
-
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
175
|
-
contentType: "application/json",
|
|
176
|
-
requestType: "json",
|
|
177
|
-
body: request,
|
|
178
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
179
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
180
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
181
|
-
});
|
|
182
|
-
if (_response.ok) {
|
|
183
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
184
|
-
}
|
|
185
|
-
if (_response.error.reason === "status-code") {
|
|
186
|
-
switch (_response.error.statusCode) {
|
|
187
|
-
case 422:
|
|
188
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
189
|
-
default:
|
|
190
|
-
throw new errors.ChrtError({
|
|
191
|
-
statusCode: _response.error.statusCode,
|
|
192
|
-
body: _response.error.body,
|
|
193
|
-
rawResponse: _response.rawResponse,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
switch (_response.error.reason) {
|
|
198
|
-
case "non-json":
|
|
199
|
-
throw new errors.ChrtError({
|
|
200
|
-
statusCode: _response.error.statusCode,
|
|
201
|
-
body: _response.error.rawBody,
|
|
202
|
-
rawResponse: _response.rawResponse,
|
|
203
|
-
});
|
|
204
|
-
case "timeout":
|
|
205
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/connections/create_connection_to_courier.");
|
|
147
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/connections/shippers/list.");
|
|
206
148
|
case "unknown":
|
|
207
149
|
throw new errors.ChrtError({
|
|
208
150
|
message: _response.error.errorMessage,
|
|
@@ -221,4 +163,4 @@ class OortConnections {
|
|
|
221
163
|
});
|
|
222
164
|
}
|
|
223
165
|
}
|
|
224
|
-
exports.
|
|
166
|
+
exports.Connections = Connections;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as environments from "
|
|
5
|
-
import * as core from "
|
|
6
|
-
import * as Chrt from "
|
|
7
|
-
export declare namespace
|
|
4
|
+
import * as environments from "../../../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../../../core/index.js";
|
|
6
|
+
import * as Chrt from "../../../../../index.js";
|
|
7
|
+
export declare namespace ConnectionToCourier {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
@@ -25,21 +25,23 @@ export declare namespace Directory {
|
|
|
25
25
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
export declare class
|
|
29
|
-
protected readonly _options:
|
|
30
|
-
constructor(_options?:
|
|
28
|
+
export declare class ConnectionToCourier {
|
|
29
|
+
protected readonly _options: ConnectionToCourier.Options;
|
|
30
|
+
constructor(_options?: ConnectionToCourier.Options);
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Body: Courier Handle, Shipper Org Id from JWT
|
|
33
33
|
*
|
|
34
|
-
* @param {Chrt.
|
|
35
|
-
* @param {
|
|
34
|
+
* @param {Chrt.connections.CreateConnectionReq} request
|
|
35
|
+
* @param {ConnectionToCourier.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
|
-
* await client.
|
|
40
|
+
* await client.connections.connectionToCourier.create({
|
|
41
|
+
* handle: "handle"
|
|
42
|
+
* })
|
|
41
43
|
*/
|
|
42
|
-
|
|
43
|
-
private
|
|
44
|
+
create(request: Chrt.connections.CreateConnectionReq, requestOptions?: ConnectionToCourier.RequestOptions): core.HttpResponsePromise<string>;
|
|
45
|
+
private __create;
|
|
44
46
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
45
47
|
}
|
|
@@ -45,35 +45,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.
|
|
49
|
-
const environments = __importStar(require("
|
|
50
|
-
const core = __importStar(require("
|
|
51
|
-
const Chrt = __importStar(require("
|
|
52
|
-
const headers_js_1 = require("
|
|
53
|
-
const errors = __importStar(require("
|
|
54
|
-
class
|
|
48
|
+
exports.ConnectionToCourier = void 0;
|
|
49
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
50
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
51
|
+
const Chrt = __importStar(require("../../../../../index.js"));
|
|
52
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
53
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
54
|
+
class ConnectionToCourier {
|
|
55
55
|
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Body: Courier Handle, Shipper Org Id from JWT
|
|
60
60
|
*
|
|
61
|
-
* @param {Chrt.
|
|
62
|
-
* @param {
|
|
61
|
+
* @param {Chrt.connections.CreateConnectionReq} request
|
|
62
|
+
* @param {ConnectionToCourier.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
63
|
*
|
|
64
64
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
|
-
* await client.
|
|
67
|
+
* await client.connections.connectionToCourier.create({
|
|
68
|
+
* handle: "handle"
|
|
69
|
+
* })
|
|
68
70
|
*/
|
|
69
|
-
|
|
70
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
71
|
+
create(request, requestOptions) {
|
|
72
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
return __awaiter(this,
|
|
74
|
+
__create(request, requestOptions) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
76
|
var _a, _b, _c, _d;
|
|
75
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
76
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "
|
|
78
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/connections/connection_to_courier/create"),
|
|
77
79
|
method: "POST",
|
|
78
80
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
79
81
|
contentType: "application/json",
|
|
@@ -106,7 +108,7 @@ class Directory {
|
|
|
106
108
|
rawResponse: _response.rawResponse,
|
|
107
109
|
});
|
|
108
110
|
case "timeout":
|
|
109
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /
|
|
111
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/connections/connection_to_courier/create.");
|
|
110
112
|
case "unknown":
|
|
111
113
|
throw new errors.ChrtError({
|
|
112
114
|
message: _response.error.errorMessage,
|
|
@@ -125,4 +127,4 @@ class Directory {
|
|
|
125
127
|
});
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
exports.
|
|
130
|
+
exports.ConnectionToCourier = ConnectionToCourier;
|