@samsarahq/samsara 11.9.0 → 11.10.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/betaApIs/client/Client.d.ts +14 -52
- package/dist/cjs/api/resources/betaApIs/client/Client.js +39 -136
- package/dist/cjs/api/resources/betaApIs/client/requests/ListHubRouteTemplatesRequest.d.ts +18 -0
- package/dist/cjs/api/resources/betaApIs/client/requests/index.d.ts +1 -2
- package/dist/cjs/api/resources/hubs/client/Client.d.ts +30 -0
- package/dist/cjs/api/resources/hubs/client/Client.js +94 -0
- package/dist/cjs/api/resources/hubs/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/plans/client/Client.d.ts +34 -0
- package/dist/cjs/api/resources/plans/client/Client.js +91 -0
- package/dist/cjs/api/resources/plans/client/requests/PlanOrdersCreatePlanOrdersRequestBody.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/HubRouteTemplateDepotObjectResponseBody.d.ts +17 -0
- package/dist/cjs/api/types/HubRouteTemplateDepotObjectResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplateLocationObjectResponseBody.d.ts +19 -0
- package/dist/cjs/api/types/HubRouteTemplateLocationObjectResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplateObjectResponseBody.d.ts +28 -0
- package/dist/cjs/api/types/HubRouteTemplateObjectResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesBadGatewayErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesBadGatewayErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesGatewayTimeoutErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesGatewayTimeoutErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesInternalServerErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesInternalServerErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesMethodNotAllowedErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesMethodNotAllowedErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesNotFoundErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesNotFoundErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesNotImplementedErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesNotImplementedErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesResponseBody.d.ts +6 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesServiceUnavailableErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesServiceUnavailableErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesTooManyRequestsErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesTooManyRequestsErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesUnauthorizedErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/HubRouteTemplatesListHubRouteTemplatesUnauthorizedErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/index.d.ts +13 -0
- package/dist/cjs/api/types/index.js +13 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/betaApIs/client/Client.d.mts +14 -52
- package/dist/esm/api/resources/betaApIs/client/Client.mjs +39 -136
- package/dist/esm/api/resources/betaApIs/client/requests/ListHubRouteTemplatesRequest.d.mts +18 -0
- package/dist/esm/api/resources/betaApIs/client/requests/index.d.mts +1 -2
- package/dist/esm/api/resources/hubs/client/Client.d.mts +30 -0
- package/dist/esm/api/resources/hubs/client/Client.mjs +94 -0
- package/dist/esm/api/resources/hubs/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/plans/client/Client.d.mts +34 -0
- package/dist/esm/api/resources/plans/client/Client.mjs +91 -0
- package/dist/esm/api/resources/plans/client/requests/PlanOrdersCreatePlanOrdersRequestBody.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/HubRouteTemplateDepotObjectResponseBody.d.mts +17 -0
- package/dist/esm/api/types/HubRouteTemplateDepotObjectResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplateLocationObjectResponseBody.d.mts +19 -0
- package/dist/esm/api/types/HubRouteTemplateLocationObjectResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplateObjectResponseBody.d.mts +28 -0
- package/dist/esm/api/types/HubRouteTemplateObjectResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesBadGatewayErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesBadGatewayErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesGatewayTimeoutErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesGatewayTimeoutErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesInternalServerErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesInternalServerErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesMethodNotAllowedErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesMethodNotAllowedErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesNotFoundErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesNotFoundErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesNotImplementedErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesNotImplementedErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesResponseBody.d.mts +6 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesServiceUnavailableErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesServiceUnavailableErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesTooManyRequestsErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesTooManyRequestsErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesUnauthorizedErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/HubRouteTemplatesListHubRouteTemplatesUnauthorizedErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +13 -0
- package/dist/esm/api/types/index.mjs +13 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +160 -92
- /package/dist/cjs/api/resources/betaApIs/client/requests/{ListHubCustomPropertiesRequest.js → ListHubRouteTemplatesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{betaApIs → hubs}/client/requests/ListHubCustomPropertiesRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{betaApIs/client/requests/PlanOrdersCreatePlanOrdersRequestBody.js → hubs/client/requests/ListHubCustomPropertiesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{betaApIs → plans}/client/requests/PlanOrdersCreatePlanOrdersRequestBody.d.ts +0 -0
- /package/dist/esm/api/resources/betaApIs/client/requests/{ListHubCustomPropertiesRequest.mjs → ListHubRouteTemplatesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{betaApIs → hubs}/client/requests/ListHubCustomPropertiesRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{betaApIs/client/requests/PlanOrdersCreatePlanOrdersRequestBody.mjs → hubs/client/requests/ListHubCustomPropertiesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{betaApIs → plans}/client/requests/PlanOrdersCreatePlanOrdersRequestBody.d.mts +0 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -44,8 +44,8 @@ function normalizeClientOptions(options) {
|
|
|
44
44
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
45
45
|
"X-Fern-Language": "JavaScript",
|
|
46
46
|
"X-Fern-SDK-Name": "@samsarahq/samsara",
|
|
47
|
-
"X-Fern-SDK-Version": "11.
|
|
48
|
-
"User-Agent": "@samsarahq/samsara/11.
|
|
47
|
+
"X-Fern-SDK-Version": "11.10.1",
|
|
48
|
+
"User-Agent": "@samsarahq/samsara/11.10.1",
|
|
49
49
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
50
50
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
51
51
|
"X-Samsara-Version": (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : "2025-06-11",
|
|
@@ -1060,38 +1060,6 @@ export declare class BetaApIsClient {
|
|
|
1060
1060
|
*/
|
|
1061
1061
|
updateShippingDocs(request: Samsara.HosDailyLogsUpdateShippingDocsRequestBody, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.HosDailyLogsUpdateShippingDocsResponseBody>;
|
|
1062
1062
|
private __updateShippingDocs;
|
|
1063
|
-
/**
|
|
1064
|
-
* Retrieve custom properties for a specific hub.
|
|
1065
|
-
*
|
|
1066
|
-
* **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have RoutePlanning APIs enabled for your organization.
|
|
1067
|
-
*
|
|
1068
|
-
* <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
1069
|
-
*
|
|
1070
|
-
* To use this endpoint, select **Read Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
-
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
1074
|
-
*
|
|
1075
|
-
* @param {Samsara.ListHubCustomPropertiesRequest} request
|
|
1076
|
-
* @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1077
|
-
*
|
|
1078
|
-
* @throws {@link Samsara.UnauthorizedError}
|
|
1079
|
-
* @throws {@link Samsara.NotFoundError}
|
|
1080
|
-
* @throws {@link Samsara.MethodNotAllowedError}
|
|
1081
|
-
* @throws {@link Samsara.TooManyRequestsError}
|
|
1082
|
-
* @throws {@link Samsara.InternalServerError}
|
|
1083
|
-
* @throws {@link Samsara.NotImplementedError}
|
|
1084
|
-
* @throws {@link Samsara.BadGatewayError}
|
|
1085
|
-
* @throws {@link Samsara.ServiceUnavailableError}
|
|
1086
|
-
* @throws {@link Samsara.GatewayTimeoutError}
|
|
1087
|
-
*
|
|
1088
|
-
* @example
|
|
1089
|
-
* await client.betaApIs.listHubCustomProperties({
|
|
1090
|
-
* hubId: "hubId"
|
|
1091
|
-
* })
|
|
1092
|
-
*/
|
|
1093
|
-
listHubCustomProperties(request: Samsara.ListHubCustomPropertiesRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.HubCustomPropertiesListHubCustomPropertiesResponseBody>;
|
|
1094
|
-
private __listHubCustomProperties;
|
|
1095
1063
|
/**
|
|
1096
1064
|
* Retrieve all orders for a specific plan, including both assigned and unassigned orders.
|
|
1097
1065
|
*
|
|
@@ -1125,7 +1093,7 @@ export declare class BetaApIsClient {
|
|
|
1125
1093
|
listPlanOrders(request: Samsara.ListPlanOrdersRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.PlanOrdersListPlanOrdersResponseBody>;
|
|
1126
1094
|
private __listPlanOrders;
|
|
1127
1095
|
/**
|
|
1128
|
-
*
|
|
1096
|
+
* Delete one or more orders from a plan. Pass either `orderIds` (a comma-separated list) or `deleteAll=true`; exactly one is required. Orders are automatically unassigned from their routes before deletion.
|
|
1129
1097
|
*
|
|
1130
1098
|
* **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have RoutePlanning APIs enabled for your organization.
|
|
1131
1099
|
*
|
|
@@ -1136,7 +1104,7 @@ export declare class BetaApIsClient {
|
|
|
1136
1104
|
*
|
|
1137
1105
|
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
1138
1106
|
*
|
|
1139
|
-
* @param {Samsara.
|
|
1107
|
+
* @param {Samsara.DeletePlanOrdersRequest} request
|
|
1140
1108
|
* @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1141
1109
|
*
|
|
1142
1110
|
* @throws {@link Samsara.UnauthorizedError}
|
|
@@ -1150,29 +1118,23 @@ export declare class BetaApIsClient {
|
|
|
1150
1118
|
* @throws {@link Samsara.GatewayTimeoutError}
|
|
1151
1119
|
*
|
|
1152
1120
|
* @example
|
|
1153
|
-
* await client.betaApIs.
|
|
1154
|
-
*
|
|
1155
|
-
* customerOrderId: "ORDER-2024-001",
|
|
1156
|
-
* hubId: "550e8400-e29b-41d4-a716-446655440000",
|
|
1157
|
-
* planId: "650e8400-e29b-41d4-a716-446655440023"
|
|
1158
|
-
* }]
|
|
1121
|
+
* await client.betaApIs.deletePlanOrders({
|
|
1122
|
+
* planId: "planId"
|
|
1159
1123
|
* })
|
|
1160
1124
|
*/
|
|
1161
|
-
|
|
1162
|
-
private
|
|
1125
|
+
deletePlanOrders(request: Samsara.DeletePlanOrdersRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
1126
|
+
private __deletePlanOrders;
|
|
1163
1127
|
/**
|
|
1164
|
-
*
|
|
1128
|
+
* Retrieve route templates for a specific hub. Optionally filter by route template ID or name.
|
|
1165
1129
|
*
|
|
1166
|
-
*
|
|
1167
|
-
*
|
|
1168
|
-
* <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
1130
|
+
* <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
1169
1131
|
*
|
|
1170
|
-
* To use this endpoint, select **
|
|
1132
|
+
* To use this endpoint, select **Read Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
|
|
1171
1133
|
*
|
|
1172
1134
|
*
|
|
1173
1135
|
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
1174
1136
|
*
|
|
1175
|
-
* @param {Samsara.
|
|
1137
|
+
* @param {Samsara.ListHubRouteTemplatesRequest} request
|
|
1176
1138
|
* @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1177
1139
|
*
|
|
1178
1140
|
* @throws {@link Samsara.UnauthorizedError}
|
|
@@ -1186,12 +1148,12 @@ export declare class BetaApIsClient {
|
|
|
1186
1148
|
* @throws {@link Samsara.GatewayTimeoutError}
|
|
1187
1149
|
*
|
|
1188
1150
|
* @example
|
|
1189
|
-
* await client.betaApIs.
|
|
1190
|
-
*
|
|
1151
|
+
* await client.betaApIs.listHubRouteTemplates({
|
|
1152
|
+
* hubId: "hubId"
|
|
1191
1153
|
* })
|
|
1192
1154
|
*/
|
|
1193
|
-
|
|
1194
|
-
private
|
|
1155
|
+
listHubRouteTemplates(request: Samsara.ListHubRouteTemplatesRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.HubRouteTemplatesListHubRouteTemplatesResponseBody>;
|
|
1156
|
+
private __listHubRouteTemplates;
|
|
1195
1157
|
/**
|
|
1196
1158
|
* Returns qualification records for the specified list of IDs.
|
|
1197
1159
|
*
|
|
@@ -3154,102 +3154,6 @@ class BetaApIsClient {
|
|
|
3154
3154
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/hos/daily-logs/log-meta-data");
|
|
3155
3155
|
});
|
|
3156
3156
|
}
|
|
3157
|
-
/**
|
|
3158
|
-
* Retrieve custom properties for a specific hub.
|
|
3159
|
-
*
|
|
3160
|
-
* **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have RoutePlanning APIs enabled for your organization.
|
|
3161
|
-
*
|
|
3162
|
-
* <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
3163
|
-
*
|
|
3164
|
-
* To use this endpoint, select **Read Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
|
|
3165
|
-
*
|
|
3166
|
-
*
|
|
3167
|
-
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
3168
|
-
*
|
|
3169
|
-
* @param {Samsara.ListHubCustomPropertiesRequest} request
|
|
3170
|
-
* @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3171
|
-
*
|
|
3172
|
-
* @throws {@link Samsara.UnauthorizedError}
|
|
3173
|
-
* @throws {@link Samsara.NotFoundError}
|
|
3174
|
-
* @throws {@link Samsara.MethodNotAllowedError}
|
|
3175
|
-
* @throws {@link Samsara.TooManyRequestsError}
|
|
3176
|
-
* @throws {@link Samsara.InternalServerError}
|
|
3177
|
-
* @throws {@link Samsara.NotImplementedError}
|
|
3178
|
-
* @throws {@link Samsara.BadGatewayError}
|
|
3179
|
-
* @throws {@link Samsara.ServiceUnavailableError}
|
|
3180
|
-
* @throws {@link Samsara.GatewayTimeoutError}
|
|
3181
|
-
*
|
|
3182
|
-
* @example
|
|
3183
|
-
* await client.betaApIs.listHubCustomProperties({
|
|
3184
|
-
* hubId: "hubId"
|
|
3185
|
-
* })
|
|
3186
|
-
*/
|
|
3187
|
-
listHubCustomProperties(request, requestOptions) {
|
|
3188
|
-
return core.HttpResponsePromise.fromPromise(this.__listHubCustomProperties(request, requestOptions));
|
|
3189
|
-
}
|
|
3190
|
-
__listHubCustomProperties(request, requestOptions) {
|
|
3191
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
3192
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3193
|
-
const { hubId, customPropertyIds, customPropertyNames, startTime, endTime, after, limit } = request;
|
|
3194
|
-
const _queryParams = {
|
|
3195
|
-
hubId,
|
|
3196
|
-
customPropertyIds,
|
|
3197
|
-
customPropertyNames,
|
|
3198
|
-
startTime: startTime != null ? startTime : undefined,
|
|
3199
|
-
endTime: endTime != null ? endTime : undefined,
|
|
3200
|
-
after,
|
|
3201
|
-
limit,
|
|
3202
|
-
};
|
|
3203
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3204
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3205
|
-
const _response = yield core.fetcher({
|
|
3206
|
-
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.SamsaraEnvironment.ProductionApi, "hub/customProperties"),
|
|
3207
|
-
method: "GET",
|
|
3208
|
-
headers: _headers,
|
|
3209
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3210
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3211
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3212
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3213
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
3214
|
-
logging: this._options.logging,
|
|
3215
|
-
});
|
|
3216
|
-
if (_response.ok) {
|
|
3217
|
-
return {
|
|
3218
|
-
data: _response.body,
|
|
3219
|
-
rawResponse: _response.rawResponse,
|
|
3220
|
-
};
|
|
3221
|
-
}
|
|
3222
|
-
if (_response.error.reason === "status-code") {
|
|
3223
|
-
switch (_response.error.statusCode) {
|
|
3224
|
-
case 401:
|
|
3225
|
-
throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
3226
|
-
case 404:
|
|
3227
|
-
throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3228
|
-
case 405:
|
|
3229
|
-
throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
3230
|
-
case 429:
|
|
3231
|
-
throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3232
|
-
case 500:
|
|
3233
|
-
throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3234
|
-
case 501:
|
|
3235
|
-
throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
3236
|
-
case 502:
|
|
3237
|
-
throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
3238
|
-
case 503:
|
|
3239
|
-
throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
3240
|
-
case 504:
|
|
3241
|
-
throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
|
|
3242
|
-
default:
|
|
3243
|
-
throw new errors.SamsaraError({
|
|
3244
|
-
statusCode: _response.error.statusCode,
|
|
3245
|
-
body: _response.error.body,
|
|
3246
|
-
rawResponse: _response.rawResponse,
|
|
3247
|
-
});
|
|
3248
|
-
}
|
|
3249
|
-
}
|
|
3250
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/hub/customProperties");
|
|
3251
|
-
});
|
|
3252
|
-
}
|
|
3253
3157
|
/**
|
|
3254
3158
|
* Retrieve all orders for a specific plan, including both assigned and unassigned orders.
|
|
3255
3159
|
*
|
|
@@ -3344,7 +3248,7 @@ class BetaApIsClient {
|
|
|
3344
3248
|
});
|
|
3345
3249
|
}
|
|
3346
3250
|
/**
|
|
3347
|
-
*
|
|
3251
|
+
* Delete one or more orders from a plan. Pass either `orderIds` (a comma-separated list) or `deleteAll=true`; exactly one is required. Orders are automatically unassigned from their routes before deletion.
|
|
3348
3252
|
*
|
|
3349
3253
|
* **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have RoutePlanning APIs enabled for your organization.
|
|
3350
3254
|
*
|
|
@@ -3355,7 +3259,7 @@ class BetaApIsClient {
|
|
|
3355
3259
|
*
|
|
3356
3260
|
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
3357
3261
|
*
|
|
3358
|
-
* @param {Samsara.
|
|
3262
|
+
* @param {Samsara.DeletePlanOrdersRequest} request
|
|
3359
3263
|
* @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3360
3264
|
*
|
|
3361
3265
|
* @throws {@link Samsara.UnauthorizedError}
|
|
@@ -3369,30 +3273,29 @@ class BetaApIsClient {
|
|
|
3369
3273
|
* @throws {@link Samsara.GatewayTimeoutError}
|
|
3370
3274
|
*
|
|
3371
3275
|
* @example
|
|
3372
|
-
* await client.betaApIs.
|
|
3373
|
-
*
|
|
3374
|
-
* customerOrderId: "ORDER-2024-001",
|
|
3375
|
-
* hubId: "550e8400-e29b-41d4-a716-446655440000",
|
|
3376
|
-
* planId: "650e8400-e29b-41d4-a716-446655440023"
|
|
3377
|
-
* }]
|
|
3276
|
+
* await client.betaApIs.deletePlanOrders({
|
|
3277
|
+
* planId: "planId"
|
|
3378
3278
|
* })
|
|
3379
3279
|
*/
|
|
3380
|
-
|
|
3381
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
3280
|
+
deletePlanOrders(request, requestOptions) {
|
|
3281
|
+
return core.HttpResponsePromise.fromPromise(this.__deletePlanOrders(request, requestOptions));
|
|
3382
3282
|
}
|
|
3383
|
-
|
|
3283
|
+
__deletePlanOrders(request, requestOptions) {
|
|
3384
3284
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3385
3285
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3286
|
+
const { planId, orderIds, deleteAll } = request;
|
|
3287
|
+
const _queryParams = {
|
|
3288
|
+
planId,
|
|
3289
|
+
orderIds,
|
|
3290
|
+
deleteAll,
|
|
3291
|
+
};
|
|
3386
3292
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3387
3293
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3388
3294
|
const _response = yield core.fetcher({
|
|
3389
3295
|
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.SamsaraEnvironment.ProductionApi, "hub/plan/orders"),
|
|
3390
|
-
method: "
|
|
3296
|
+
method: "DELETE",
|
|
3391
3297
|
headers: _headers,
|
|
3392
|
-
|
|
3393
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3394
|
-
requestType: "json",
|
|
3395
|
-
body: request,
|
|
3298
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3396
3299
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3397
3300
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3398
3301
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -3400,10 +3303,7 @@ class BetaApIsClient {
|
|
|
3400
3303
|
logging: this._options.logging,
|
|
3401
3304
|
});
|
|
3402
3305
|
if (_response.ok) {
|
|
3403
|
-
return {
|
|
3404
|
-
data: _response.body,
|
|
3405
|
-
rawResponse: _response.rawResponse,
|
|
3406
|
-
};
|
|
3306
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
3407
3307
|
}
|
|
3408
3308
|
if (_response.error.reason === "status-code") {
|
|
3409
3309
|
switch (_response.error.statusCode) {
|
|
@@ -3433,22 +3333,20 @@ class BetaApIsClient {
|
|
|
3433
3333
|
});
|
|
3434
3334
|
}
|
|
3435
3335
|
}
|
|
3436
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
3336
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/hub/plan/orders");
|
|
3437
3337
|
});
|
|
3438
3338
|
}
|
|
3439
3339
|
/**
|
|
3440
|
-
*
|
|
3441
|
-
*
|
|
3442
|
-
* **Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have RoutePlanning APIs enabled for your organization.
|
|
3340
|
+
* Retrieve route templates for a specific hub. Optionally filter by route template ID or name.
|
|
3443
3341
|
*
|
|
3444
|
-
* <b>Rate limit:</b>
|
|
3342
|
+
* <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
3445
3343
|
*
|
|
3446
|
-
* To use this endpoint, select **
|
|
3344
|
+
* To use this endpoint, select **Read Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
|
|
3447
3345
|
*
|
|
3448
3346
|
*
|
|
3449
3347
|
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
3450
3348
|
*
|
|
3451
|
-
* @param {Samsara.
|
|
3349
|
+
* @param {Samsara.ListHubRouteTemplatesRequest} request
|
|
3452
3350
|
* @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3453
3351
|
*
|
|
3454
3352
|
* @throws {@link Samsara.UnauthorizedError}
|
|
@@ -3462,27 +3360,29 @@ class BetaApIsClient {
|
|
|
3462
3360
|
* @throws {@link Samsara.GatewayTimeoutError}
|
|
3463
3361
|
*
|
|
3464
3362
|
* @example
|
|
3465
|
-
* await client.betaApIs.
|
|
3466
|
-
*
|
|
3363
|
+
* await client.betaApIs.listHubRouteTemplates({
|
|
3364
|
+
* hubId: "hubId"
|
|
3467
3365
|
* })
|
|
3468
3366
|
*/
|
|
3469
|
-
|
|
3470
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
3367
|
+
listHubRouteTemplates(request, requestOptions) {
|
|
3368
|
+
return core.HttpResponsePromise.fromPromise(this.__listHubRouteTemplates(request, requestOptions));
|
|
3471
3369
|
}
|
|
3472
|
-
|
|
3370
|
+
__listHubRouteTemplates(request, requestOptions) {
|
|
3473
3371
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3474
3372
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3475
|
-
const {
|
|
3373
|
+
const { hubId, id, name, after, limit } = request;
|
|
3476
3374
|
const _queryParams = {
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3375
|
+
hubId,
|
|
3376
|
+
id,
|
|
3377
|
+
name,
|
|
3378
|
+
after,
|
|
3379
|
+
limit,
|
|
3480
3380
|
};
|
|
3481
3381
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
3482
3382
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3483
3383
|
const _response = yield core.fetcher({
|
|
3484
|
-
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.SamsaraEnvironment.ProductionApi, "hub/
|
|
3485
|
-
method: "
|
|
3384
|
+
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.SamsaraEnvironment.ProductionApi, "hub/route-templates"),
|
|
3385
|
+
method: "GET",
|
|
3486
3386
|
headers: _headers,
|
|
3487
3387
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3488
3388
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -3492,7 +3392,10 @@ class BetaApIsClient {
|
|
|
3492
3392
|
logging: this._options.logging,
|
|
3493
3393
|
});
|
|
3494
3394
|
if (_response.ok) {
|
|
3495
|
-
return {
|
|
3395
|
+
return {
|
|
3396
|
+
data: _response.body,
|
|
3397
|
+
rawResponse: _response.rawResponse,
|
|
3398
|
+
};
|
|
3496
3399
|
}
|
|
3497
3400
|
if (_response.error.reason === "status-code") {
|
|
3498
3401
|
switch (_response.error.statusCode) {
|
|
@@ -3522,7 +3425,7 @@ class BetaApIsClient {
|
|
|
3522
3425
|
});
|
|
3523
3426
|
}
|
|
3524
3427
|
}
|
|
3525
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "
|
|
3428
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/hub/route-templates");
|
|
3526
3429
|
});
|
|
3527
3430
|
}
|
|
3528
3431
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* hubId: "hubId"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface ListHubRouteTemplatesRequest {
|
|
8
|
+
/** The hub identifier. */
|
|
9
|
+
hubId: string;
|
|
10
|
+
/** Filter by a specific route template ID. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Filter by route template name (exact match). */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results. */
|
|
15
|
+
after?: string;
|
|
16
|
+
/** The limit for how many objects will be in the response. Default and max for this value is 100 objects. */
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
@@ -43,7 +43,7 @@ export type { JobsPatchJobRequestBody } from "./JobsPatchJobRequestBody.js";
|
|
|
43
43
|
export type { ListAssetAssignmentsRequest } from "./ListAssetAssignmentsRequest.js";
|
|
44
44
|
export type { ListAssociationsRequest } from "./ListAssociationsRequest.js";
|
|
45
45
|
export type { ListDeviceRecoveryMissingAssetsRequest } from "./ListDeviceRecoveryMissingAssetsRequest.js";
|
|
46
|
-
export type {
|
|
46
|
+
export type { ListHubRouteTemplatesRequest } from "./ListHubRouteTemplatesRequest.js";
|
|
47
47
|
export type { ListMaintenanceVendorsRequest } from "./ListMaintenanceVendorsRequest.js";
|
|
48
48
|
export type { ListPlanOrdersRequest } from "./ListPlanOrdersRequest.js";
|
|
49
49
|
export type { ListRidershipAccountsRequest } from "./ListRidershipAccountsRequest.js";
|
|
@@ -51,7 +51,6 @@ export type { ListRidershipPassengersRequest } from "./ListRidershipPassengersRe
|
|
|
51
51
|
export type { ListRidershipRouteSetupsRequest } from "./ListRidershipRouteSetupsRequest.js";
|
|
52
52
|
export type { ListTachographLiveDataRequest } from "./ListTachographLiveDataRequest.js";
|
|
53
53
|
export type { ListVendorCategoriesRequest } from "./ListVendorCategoriesRequest.js";
|
|
54
|
-
export type { PlanOrdersCreatePlanOrdersRequestBody } from "./PlanOrdersCreatePlanOrdersRequestBody.js";
|
|
55
54
|
export type { QualificationsArchiveQualificationRecordRequestBody } from "./QualificationsArchiveQualificationRecordRequestBody.js";
|
|
56
55
|
export type { QualificationsDeleteQualificationRecordRequestBody } from "./QualificationsDeleteQualificationRecordRequestBody.js";
|
|
57
56
|
export type { QualificationsPatchQualificationRecordRequestBody } from "./QualificationsPatchQualificationRecordRequestBody.js";
|
|
@@ -40,6 +40,36 @@ export declare class HubsClient {
|
|
|
40
40
|
*/
|
|
41
41
|
listHubCapacities(request: Samsara.ListHubCapacitiesRequest, requestOptions?: HubsClient.RequestOptions): core.HttpResponsePromise<Samsara.HubCapacitiesListHubCapacitiesResponseBody>;
|
|
42
42
|
private __listHubCapacities;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve custom properties for a specific hub.
|
|
45
|
+
*
|
|
46
|
+
* <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
47
|
+
*
|
|
48
|
+
* To use this endpoint, select **Read Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
|
|
49
|
+
*
|
|
50
|
+
*
|
|
51
|
+
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
52
|
+
*
|
|
53
|
+
* @param {Samsara.ListHubCustomPropertiesRequest} request
|
|
54
|
+
* @param {HubsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
|
+
*
|
|
56
|
+
* @throws {@link Samsara.UnauthorizedError}
|
|
57
|
+
* @throws {@link Samsara.NotFoundError}
|
|
58
|
+
* @throws {@link Samsara.MethodNotAllowedError}
|
|
59
|
+
* @throws {@link Samsara.TooManyRequestsError}
|
|
60
|
+
* @throws {@link Samsara.InternalServerError}
|
|
61
|
+
* @throws {@link Samsara.NotImplementedError}
|
|
62
|
+
* @throws {@link Samsara.BadGatewayError}
|
|
63
|
+
* @throws {@link Samsara.ServiceUnavailableError}
|
|
64
|
+
* @throws {@link Samsara.GatewayTimeoutError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.hubs.listHubCustomProperties({
|
|
68
|
+
* hubId: "hubId"
|
|
69
|
+
* })
|
|
70
|
+
*/
|
|
71
|
+
listHubCustomProperties(request: Samsara.ListHubCustomPropertiesRequest, requestOptions?: HubsClient.RequestOptions): core.HttpResponsePromise<Samsara.HubCustomPropertiesListHubCustomPropertiesResponseBody>;
|
|
72
|
+
private __listHubCustomProperties;
|
|
43
73
|
/**
|
|
44
74
|
* Update existing location by ID.
|
|
45
75
|
*
|
|
@@ -160,6 +160,100 @@ class HubsClient {
|
|
|
160
160
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/hub/capacities");
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Retrieve custom properties for a specific hub.
|
|
165
|
+
*
|
|
166
|
+
* <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
167
|
+
*
|
|
168
|
+
* To use this endpoint, select **Read Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
|
|
169
|
+
*
|
|
170
|
+
*
|
|
171
|
+
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
172
|
+
*
|
|
173
|
+
* @param {Samsara.ListHubCustomPropertiesRequest} request
|
|
174
|
+
* @param {HubsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
175
|
+
*
|
|
176
|
+
* @throws {@link Samsara.UnauthorizedError}
|
|
177
|
+
* @throws {@link Samsara.NotFoundError}
|
|
178
|
+
* @throws {@link Samsara.MethodNotAllowedError}
|
|
179
|
+
* @throws {@link Samsara.TooManyRequestsError}
|
|
180
|
+
* @throws {@link Samsara.InternalServerError}
|
|
181
|
+
* @throws {@link Samsara.NotImplementedError}
|
|
182
|
+
* @throws {@link Samsara.BadGatewayError}
|
|
183
|
+
* @throws {@link Samsara.ServiceUnavailableError}
|
|
184
|
+
* @throws {@link Samsara.GatewayTimeoutError}
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* await client.hubs.listHubCustomProperties({
|
|
188
|
+
* hubId: "hubId"
|
|
189
|
+
* })
|
|
190
|
+
*/
|
|
191
|
+
listHubCustomProperties(request, requestOptions) {
|
|
192
|
+
return core.HttpResponsePromise.fromPromise(this.__listHubCustomProperties(request, requestOptions));
|
|
193
|
+
}
|
|
194
|
+
__listHubCustomProperties(request, requestOptions) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
197
|
+
const { hubId, customPropertyIds, customPropertyNames, startTime, endTime, after, limit } = request;
|
|
198
|
+
const _queryParams = {
|
|
199
|
+
hubId,
|
|
200
|
+
customPropertyIds,
|
|
201
|
+
customPropertyNames,
|
|
202
|
+
startTime: startTime != null ? startTime : undefined,
|
|
203
|
+
endTime: endTime != null ? endTime : undefined,
|
|
204
|
+
after,
|
|
205
|
+
limit,
|
|
206
|
+
};
|
|
207
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
208
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Samsara-Version": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
209
|
+
const _response = yield core.fetcher({
|
|
210
|
+
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.SamsaraEnvironment.ProductionApi, "hub/customProperties"),
|
|
211
|
+
method: "GET",
|
|
212
|
+
headers: _headers,
|
|
213
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
214
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
215
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
216
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
217
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
218
|
+
logging: this._options.logging,
|
|
219
|
+
});
|
|
220
|
+
if (_response.ok) {
|
|
221
|
+
return {
|
|
222
|
+
data: _response.body,
|
|
223
|
+
rawResponse: _response.rawResponse,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
if (_response.error.reason === "status-code") {
|
|
227
|
+
switch (_response.error.statusCode) {
|
|
228
|
+
case 401:
|
|
229
|
+
throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
230
|
+
case 404:
|
|
231
|
+
throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
|
|
232
|
+
case 405:
|
|
233
|
+
throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
234
|
+
case 429:
|
|
235
|
+
throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
236
|
+
case 500:
|
|
237
|
+
throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
|
|
238
|
+
case 501:
|
|
239
|
+
throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
240
|
+
case 502:
|
|
241
|
+
throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
242
|
+
case 503:
|
|
243
|
+
throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
244
|
+
case 504:
|
|
245
|
+
throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
|
|
246
|
+
default:
|
|
247
|
+
throw new errors.SamsaraError({
|
|
248
|
+
statusCode: _response.error.statusCode,
|
|
249
|
+
body: _response.error.body,
|
|
250
|
+
rawResponse: _response.rawResponse,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/hub/customProperties");
|
|
255
|
+
});
|
|
256
|
+
}
|
|
163
257
|
/**
|
|
164
258
|
* Update existing location by ID.
|
|
165
259
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { HubLocationsCreateHubLocationsRequestBody } from "./HubLocationsCreateHubLocationsRequestBody.js";
|
|
2
2
|
export type { HubLocationsUpdateHubLocationRequestBody } from "./HubLocationsUpdateHubLocationRequestBody.js";
|
|
3
3
|
export type { ListHubCapacitiesRequest } from "./ListHubCapacitiesRequest.js";
|
|
4
|
+
export type { ListHubCustomPropertiesRequest } from "./ListHubCustomPropertiesRequest.js";
|
|
4
5
|
export type { ListHubLocationsRequest } from "./ListHubLocationsRequest.js";
|
|
5
6
|
export type { ListHubSkillsRequest } from "./ListHubSkillsRequest.js";
|
|
6
7
|
export type { ListHubsRequest } from "./ListHubsRequest.js";
|
|
@@ -41,6 +41,40 @@ export declare class PlansClient {
|
|
|
41
41
|
*/
|
|
42
42
|
createHubPlan(request: Samsara.HubPlansCreateHubPlanRequestBody, requestOptions?: PlansClient.RequestOptions): core.HttpResponsePromise<Samsara.HubPlansCreateHubPlanResponseBody>;
|
|
43
43
|
private __createHubPlan;
|
|
44
|
+
/**
|
|
45
|
+
* Create one or more orders (bulk upsert). Pass an array of order objects; any object whose customerOrderId already exists will be updated, otherwise a new order is created. Functions can return JSON arrays in this Order POST format. Orders are initially created at the plan level but will migrate to hub-level entities, with planId becoming optional in future versions.
|
|
46
|
+
*
|
|
47
|
+
* <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
|
|
48
|
+
*
|
|
49
|
+
* To use this endpoint, select **Write Routes** under the Driver Workflow category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.
|
|
53
|
+
*
|
|
54
|
+
* @param {Samsara.PlanOrdersCreatePlanOrdersRequestBody} request
|
|
55
|
+
* @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @throws {@link Samsara.UnauthorizedError}
|
|
58
|
+
* @throws {@link Samsara.NotFoundError}
|
|
59
|
+
* @throws {@link Samsara.MethodNotAllowedError}
|
|
60
|
+
* @throws {@link Samsara.TooManyRequestsError}
|
|
61
|
+
* @throws {@link Samsara.InternalServerError}
|
|
62
|
+
* @throws {@link Samsara.NotImplementedError}
|
|
63
|
+
* @throws {@link Samsara.BadGatewayError}
|
|
64
|
+
* @throws {@link Samsara.ServiceUnavailableError}
|
|
65
|
+
* @throws {@link Samsara.GatewayTimeoutError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.plans.createPlanOrders({
|
|
69
|
+
* data: [{
|
|
70
|
+
* customerOrderId: "ORDER-2024-001",
|
|
71
|
+
* hubId: "550e8400-e29b-41d4-a716-446655440000",
|
|
72
|
+
* planId: "650e8400-e29b-41d4-a716-446655440023"
|
|
73
|
+
* }]
|
|
74
|
+
* })
|
|
75
|
+
*/
|
|
76
|
+
createPlanOrders(request: Samsara.PlanOrdersCreatePlanOrdersRequestBody, requestOptions?: PlansClient.RequestOptions): core.HttpResponsePromise<Samsara.PlanOrdersCreatePlanOrdersResponseBody>;
|
|
77
|
+
private __createPlanOrders;
|
|
44
78
|
/**
|
|
45
79
|
* Retrieve all plans for a specific hub.
|
|
46
80
|
*
|