@samsarahq/samsara 11.4.0 → 11.5.0

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.
Files changed (108) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/betaApIs/client/Client.d.ts +64 -0
  3. package/dist/cjs/api/resources/betaApIs/client/Client.js +182 -0
  4. package/dist/cjs/api/resources/betaApIs/client/requests/DeletePlanOrdersRequest.d.ts +14 -0
  5. package/dist/cjs/api/resources/betaApIs/client/requests/DeletePlanOrdersRequest.js +3 -0
  6. package/dist/cjs/api/resources/betaApIs/client/requests/ListPlanOrdersRequest.d.ts +16 -0
  7. package/dist/cjs/api/resources/betaApIs/client/requests/ListPlanOrdersRequest.js +3 -0
  8. package/dist/cjs/api/resources/betaApIs/client/requests/index.d.ts +2 -0
  9. package/dist/cjs/api/types/ListPlanOrdersResponsePaginationResponseBody.d.ts +9 -0
  10. package/dist/cjs/api/types/ListPlanOrdersResponsePaginationResponseBody.js +3 -0
  11. package/dist/cjs/api/types/OrderObjectResponseBody.d.ts +4 -2
  12. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersBadGatewayErrorResponseBody.d.ts +9 -0
  13. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersBadGatewayErrorResponseBody.js +3 -0
  14. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersGatewayTimeoutErrorResponseBody.d.ts +9 -0
  15. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersGatewayTimeoutErrorResponseBody.js +3 -0
  16. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersInternalServerErrorResponseBody.d.ts +9 -0
  17. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersInternalServerErrorResponseBody.js +3 -0
  18. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersMethodNotAllowedErrorResponseBody.d.ts +9 -0
  19. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersMethodNotAllowedErrorResponseBody.js +3 -0
  20. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersNotFoundErrorResponseBody.d.ts +9 -0
  21. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersNotFoundErrorResponseBody.js +3 -0
  22. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersNotImplementedErrorResponseBody.d.ts +9 -0
  23. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersNotImplementedErrorResponseBody.js +3 -0
  24. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersServiceUnavailableErrorResponseBody.d.ts +9 -0
  25. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersServiceUnavailableErrorResponseBody.js +3 -0
  26. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersTooManyRequestsErrorResponseBody.d.ts +9 -0
  27. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersTooManyRequestsErrorResponseBody.js +3 -0
  28. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersUnauthorizedErrorResponseBody.d.ts +9 -0
  29. package/dist/cjs/api/types/PlanOrdersDeletePlanOrdersUnauthorizedErrorResponseBody.js +3 -0
  30. package/dist/cjs/api/types/PlanOrdersListPlanOrdersBadGatewayErrorResponseBody.d.ts +9 -0
  31. package/dist/cjs/api/types/PlanOrdersListPlanOrdersBadGatewayErrorResponseBody.js +3 -0
  32. package/dist/cjs/api/types/PlanOrdersListPlanOrdersGatewayTimeoutErrorResponseBody.d.ts +9 -0
  33. package/dist/cjs/api/types/PlanOrdersListPlanOrdersGatewayTimeoutErrorResponseBody.js +3 -0
  34. package/dist/cjs/api/types/PlanOrdersListPlanOrdersInternalServerErrorResponseBody.d.ts +9 -0
  35. package/dist/cjs/api/types/PlanOrdersListPlanOrdersInternalServerErrorResponseBody.js +3 -0
  36. package/dist/cjs/api/types/PlanOrdersListPlanOrdersMethodNotAllowedErrorResponseBody.d.ts +9 -0
  37. package/dist/cjs/api/types/PlanOrdersListPlanOrdersMethodNotAllowedErrorResponseBody.js +3 -0
  38. package/dist/cjs/api/types/PlanOrdersListPlanOrdersNotFoundErrorResponseBody.d.ts +9 -0
  39. package/dist/cjs/api/types/PlanOrdersListPlanOrdersNotFoundErrorResponseBody.js +3 -0
  40. package/dist/cjs/api/types/PlanOrdersListPlanOrdersNotImplementedErrorResponseBody.d.ts +9 -0
  41. package/dist/cjs/api/types/PlanOrdersListPlanOrdersNotImplementedErrorResponseBody.js +3 -0
  42. package/dist/cjs/api/types/PlanOrdersListPlanOrdersResponseBody.d.ts +6 -0
  43. package/dist/cjs/api/types/PlanOrdersListPlanOrdersResponseBody.js +3 -0
  44. package/dist/cjs/api/types/PlanOrdersListPlanOrdersServiceUnavailableErrorResponseBody.d.ts +9 -0
  45. package/dist/cjs/api/types/PlanOrdersListPlanOrdersServiceUnavailableErrorResponseBody.js +3 -0
  46. package/dist/cjs/api/types/PlanOrdersListPlanOrdersTooManyRequestsErrorResponseBody.d.ts +9 -0
  47. package/dist/cjs/api/types/PlanOrdersListPlanOrdersTooManyRequestsErrorResponseBody.js +3 -0
  48. package/dist/cjs/api/types/PlanOrdersListPlanOrdersUnauthorizedErrorResponseBody.d.ts +9 -0
  49. package/dist/cjs/api/types/PlanOrdersListPlanOrdersUnauthorizedErrorResponseBody.js +3 -0
  50. package/dist/cjs/api/types/index.d.ts +20 -0
  51. package/dist/cjs/api/types/index.js +20 -0
  52. package/dist/cjs/version.d.ts +1 -1
  53. package/dist/cjs/version.js +1 -1
  54. package/dist/esm/BaseClient.mjs +2 -2
  55. package/dist/esm/api/resources/betaApIs/client/Client.d.mts +64 -0
  56. package/dist/esm/api/resources/betaApIs/client/Client.mjs +182 -0
  57. package/dist/esm/api/resources/betaApIs/client/requests/DeletePlanOrdersRequest.d.mts +14 -0
  58. package/dist/esm/api/resources/betaApIs/client/requests/DeletePlanOrdersRequest.mjs +2 -0
  59. package/dist/esm/api/resources/betaApIs/client/requests/ListPlanOrdersRequest.d.mts +16 -0
  60. package/dist/esm/api/resources/betaApIs/client/requests/ListPlanOrdersRequest.mjs +2 -0
  61. package/dist/esm/api/resources/betaApIs/client/requests/index.d.mts +2 -0
  62. package/dist/esm/api/types/ListPlanOrdersResponsePaginationResponseBody.d.mts +9 -0
  63. package/dist/esm/api/types/ListPlanOrdersResponsePaginationResponseBody.mjs +2 -0
  64. package/dist/esm/api/types/OrderObjectResponseBody.d.mts +4 -2
  65. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersBadGatewayErrorResponseBody.d.mts +9 -0
  66. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersBadGatewayErrorResponseBody.mjs +2 -0
  67. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersGatewayTimeoutErrorResponseBody.d.mts +9 -0
  68. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersGatewayTimeoutErrorResponseBody.mjs +2 -0
  69. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersInternalServerErrorResponseBody.d.mts +9 -0
  70. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersInternalServerErrorResponseBody.mjs +2 -0
  71. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersMethodNotAllowedErrorResponseBody.d.mts +9 -0
  72. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersMethodNotAllowedErrorResponseBody.mjs +2 -0
  73. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersNotFoundErrorResponseBody.d.mts +9 -0
  74. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersNotFoundErrorResponseBody.mjs +2 -0
  75. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersNotImplementedErrorResponseBody.d.mts +9 -0
  76. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersNotImplementedErrorResponseBody.mjs +2 -0
  77. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersServiceUnavailableErrorResponseBody.d.mts +9 -0
  78. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersServiceUnavailableErrorResponseBody.mjs +2 -0
  79. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersTooManyRequestsErrorResponseBody.d.mts +9 -0
  80. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersTooManyRequestsErrorResponseBody.mjs +2 -0
  81. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersUnauthorizedErrorResponseBody.d.mts +9 -0
  82. package/dist/esm/api/types/PlanOrdersDeletePlanOrdersUnauthorizedErrorResponseBody.mjs +2 -0
  83. package/dist/esm/api/types/PlanOrdersListPlanOrdersBadGatewayErrorResponseBody.d.mts +9 -0
  84. package/dist/esm/api/types/PlanOrdersListPlanOrdersBadGatewayErrorResponseBody.mjs +2 -0
  85. package/dist/esm/api/types/PlanOrdersListPlanOrdersGatewayTimeoutErrorResponseBody.d.mts +9 -0
  86. package/dist/esm/api/types/PlanOrdersListPlanOrdersGatewayTimeoutErrorResponseBody.mjs +2 -0
  87. package/dist/esm/api/types/PlanOrdersListPlanOrdersInternalServerErrorResponseBody.d.mts +9 -0
  88. package/dist/esm/api/types/PlanOrdersListPlanOrdersInternalServerErrorResponseBody.mjs +2 -0
  89. package/dist/esm/api/types/PlanOrdersListPlanOrdersMethodNotAllowedErrorResponseBody.d.mts +9 -0
  90. package/dist/esm/api/types/PlanOrdersListPlanOrdersMethodNotAllowedErrorResponseBody.mjs +2 -0
  91. package/dist/esm/api/types/PlanOrdersListPlanOrdersNotFoundErrorResponseBody.d.mts +9 -0
  92. package/dist/esm/api/types/PlanOrdersListPlanOrdersNotFoundErrorResponseBody.mjs +2 -0
  93. package/dist/esm/api/types/PlanOrdersListPlanOrdersNotImplementedErrorResponseBody.d.mts +9 -0
  94. package/dist/esm/api/types/PlanOrdersListPlanOrdersNotImplementedErrorResponseBody.mjs +2 -0
  95. package/dist/esm/api/types/PlanOrdersListPlanOrdersResponseBody.d.mts +6 -0
  96. package/dist/esm/api/types/PlanOrdersListPlanOrdersResponseBody.mjs +2 -0
  97. package/dist/esm/api/types/PlanOrdersListPlanOrdersServiceUnavailableErrorResponseBody.d.mts +9 -0
  98. package/dist/esm/api/types/PlanOrdersListPlanOrdersServiceUnavailableErrorResponseBody.mjs +2 -0
  99. package/dist/esm/api/types/PlanOrdersListPlanOrdersTooManyRequestsErrorResponseBody.d.mts +9 -0
  100. package/dist/esm/api/types/PlanOrdersListPlanOrdersTooManyRequestsErrorResponseBody.mjs +2 -0
  101. package/dist/esm/api/types/PlanOrdersListPlanOrdersUnauthorizedErrorResponseBody.d.mts +9 -0
  102. package/dist/esm/api/types/PlanOrdersListPlanOrdersUnauthorizedErrorResponseBody.mjs +2 -0
  103. package/dist/esm/api/types/index.d.mts +20 -0
  104. package/dist/esm/api/types/index.mjs +20 -0
  105. package/dist/esm/version.d.mts +1 -1
  106. package/dist/esm/version.mjs +1 -1
  107. package/package.json +1 -1
  108. package/reference.md +148 -0
@@ -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.4.0",
48
- "User-Agent": "@samsarahq/samsara/11.4.0",
47
+ "X-Fern-SDK-Version": "11.5.0",
48
+ "User-Agent": "@samsarahq/samsara/11.5.0",
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",
@@ -1002,6 +1002,38 @@ export declare class BetaApIsClient {
1002
1002
  */
1003
1003
  listHubCustomProperties(request: Samsara.ListHubCustomPropertiesRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.HubCustomPropertiesListHubCustomPropertiesResponseBody>;
1004
1004
  private __listHubCustomProperties;
1005
+ /**
1006
+ * Retrieve all orders for a specific plan, including both assigned and unassigned orders.
1007
+ *
1008
+ * **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.
1009
+ *
1010
+ * <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>).
1011
+ *
1012
+ * 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>
1013
+ *
1014
+ *
1015
+ * **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.
1016
+ *
1017
+ * @param {Samsara.ListPlanOrdersRequest} request
1018
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
1019
+ *
1020
+ * @throws {@link Samsara.UnauthorizedError}
1021
+ * @throws {@link Samsara.NotFoundError}
1022
+ * @throws {@link Samsara.MethodNotAllowedError}
1023
+ * @throws {@link Samsara.TooManyRequestsError}
1024
+ * @throws {@link Samsara.InternalServerError}
1025
+ * @throws {@link Samsara.NotImplementedError}
1026
+ * @throws {@link Samsara.BadGatewayError}
1027
+ * @throws {@link Samsara.ServiceUnavailableError}
1028
+ * @throws {@link Samsara.GatewayTimeoutError}
1029
+ *
1030
+ * @example
1031
+ * await client.betaApIs.listPlanOrders({
1032
+ * planId: "planId"
1033
+ * })
1034
+ */
1035
+ listPlanOrders(request: Samsara.ListPlanOrdersRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.PlanOrdersListPlanOrdersResponseBody>;
1036
+ private __listPlanOrders;
1005
1037
  /**
1006
1038
  * 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.
1007
1039
  *
@@ -1038,6 +1070,38 @@ export declare class BetaApIsClient {
1038
1070
  */
1039
1071
  createPlanOrders(request: Samsara.PlanOrdersCreatePlanOrdersRequestBody, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.PlanOrdersCreatePlanOrdersResponseBody>;
1040
1072
  private __createPlanOrders;
1073
+ /**
1074
+ * 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.
1075
+ *
1076
+ * **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.
1077
+ *
1078
+ * <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>).
1079
+ *
1080
+ * 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>
1081
+ *
1082
+ *
1083
+ * **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.
1084
+ *
1085
+ * @param {Samsara.DeletePlanOrdersRequest} request
1086
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
1087
+ *
1088
+ * @throws {@link Samsara.UnauthorizedError}
1089
+ * @throws {@link Samsara.NotFoundError}
1090
+ * @throws {@link Samsara.MethodNotAllowedError}
1091
+ * @throws {@link Samsara.TooManyRequestsError}
1092
+ * @throws {@link Samsara.InternalServerError}
1093
+ * @throws {@link Samsara.NotImplementedError}
1094
+ * @throws {@link Samsara.BadGatewayError}
1095
+ * @throws {@link Samsara.ServiceUnavailableError}
1096
+ * @throws {@link Samsara.GatewayTimeoutError}
1097
+ *
1098
+ * @example
1099
+ * await client.betaApIs.deletePlanOrders({
1100
+ * planId: "planId"
1101
+ * })
1102
+ */
1103
+ deletePlanOrders(request: Samsara.DeletePlanOrdersRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<void>;
1104
+ private __deletePlanOrders;
1041
1105
  /**
1042
1106
  * Returns qualification records for the specified list of IDs.
1043
1107
  *
@@ -2988,6 +2988,99 @@ class BetaApIsClient {
2988
2988
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/hub/customProperties");
2989
2989
  });
2990
2990
  }
2991
+ /**
2992
+ * Retrieve all orders for a specific plan, including both assigned and unassigned orders.
2993
+ *
2994
+ * **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.
2995
+ *
2996
+ * <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>).
2997
+ *
2998
+ * 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>
2999
+ *
3000
+ *
3001
+ * **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.
3002
+ *
3003
+ * @param {Samsara.ListPlanOrdersRequest} request
3004
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
3005
+ *
3006
+ * @throws {@link Samsara.UnauthorizedError}
3007
+ * @throws {@link Samsara.NotFoundError}
3008
+ * @throws {@link Samsara.MethodNotAllowedError}
3009
+ * @throws {@link Samsara.TooManyRequestsError}
3010
+ * @throws {@link Samsara.InternalServerError}
3011
+ * @throws {@link Samsara.NotImplementedError}
3012
+ * @throws {@link Samsara.BadGatewayError}
3013
+ * @throws {@link Samsara.ServiceUnavailableError}
3014
+ * @throws {@link Samsara.GatewayTimeoutError}
3015
+ *
3016
+ * @example
3017
+ * await client.betaApIs.listPlanOrders({
3018
+ * planId: "planId"
3019
+ * })
3020
+ */
3021
+ listPlanOrders(request, requestOptions) {
3022
+ return core.HttpResponsePromise.fromPromise(this.__listPlanOrders(request, requestOptions));
3023
+ }
3024
+ __listPlanOrders(request, requestOptions) {
3025
+ return __awaiter(this, void 0, void 0, function* () {
3026
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3027
+ const { planId, orderIds, after, limit } = request;
3028
+ const _queryParams = {
3029
+ planId,
3030
+ orderIds,
3031
+ after,
3032
+ limit,
3033
+ };
3034
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
3035
+ 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);
3036
+ const _response = yield core.fetcher({
3037
+ 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"),
3038
+ method: "GET",
3039
+ headers: _headers,
3040
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
3041
+ 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,
3042
+ 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,
3043
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3044
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
3045
+ logging: this._options.logging,
3046
+ });
3047
+ if (_response.ok) {
3048
+ return {
3049
+ data: _response.body,
3050
+ rawResponse: _response.rawResponse,
3051
+ };
3052
+ }
3053
+ if (_response.error.reason === "status-code") {
3054
+ switch (_response.error.statusCode) {
3055
+ case 401:
3056
+ throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
3057
+ case 404:
3058
+ throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
3059
+ case 405:
3060
+ throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
3061
+ case 429:
3062
+ throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
3063
+ case 500:
3064
+ throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
3065
+ case 501:
3066
+ throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
3067
+ case 502:
3068
+ throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
3069
+ case 503:
3070
+ throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
3071
+ case 504:
3072
+ throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
3073
+ default:
3074
+ throw new errors.SamsaraError({
3075
+ statusCode: _response.error.statusCode,
3076
+ body: _response.error.body,
3077
+ rawResponse: _response.rawResponse,
3078
+ });
3079
+ }
3080
+ }
3081
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/hub/plan/orders");
3082
+ });
3083
+ }
2991
3084
  /**
2992
3085
  * 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.
2993
3086
  *
@@ -3081,6 +3174,95 @@ class BetaApIsClient {
3081
3174
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/hub/plan/orders");
3082
3175
  });
3083
3176
  }
3177
+ /**
3178
+ * 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.
3179
+ *
3180
+ * **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.
3181
+ *
3182
+ * <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>).
3183
+ *
3184
+ * 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>
3185
+ *
3186
+ *
3187
+ * **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.
3188
+ *
3189
+ * @param {Samsara.DeletePlanOrdersRequest} request
3190
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
3191
+ *
3192
+ * @throws {@link Samsara.UnauthorizedError}
3193
+ * @throws {@link Samsara.NotFoundError}
3194
+ * @throws {@link Samsara.MethodNotAllowedError}
3195
+ * @throws {@link Samsara.TooManyRequestsError}
3196
+ * @throws {@link Samsara.InternalServerError}
3197
+ * @throws {@link Samsara.NotImplementedError}
3198
+ * @throws {@link Samsara.BadGatewayError}
3199
+ * @throws {@link Samsara.ServiceUnavailableError}
3200
+ * @throws {@link Samsara.GatewayTimeoutError}
3201
+ *
3202
+ * @example
3203
+ * await client.betaApIs.deletePlanOrders({
3204
+ * planId: "planId"
3205
+ * })
3206
+ */
3207
+ deletePlanOrders(request, requestOptions) {
3208
+ return core.HttpResponsePromise.fromPromise(this.__deletePlanOrders(request, requestOptions));
3209
+ }
3210
+ __deletePlanOrders(request, requestOptions) {
3211
+ return __awaiter(this, void 0, void 0, function* () {
3212
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
3213
+ const { planId, orderIds, deleteAll } = request;
3214
+ const _queryParams = {
3215
+ planId,
3216
+ orderIds,
3217
+ deleteAll,
3218
+ };
3219
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
3220
+ 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);
3221
+ const _response = yield core.fetcher({
3222
+ 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"),
3223
+ method: "DELETE",
3224
+ headers: _headers,
3225
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
3226
+ 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,
3227
+ 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,
3228
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3229
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
3230
+ logging: this._options.logging,
3231
+ });
3232
+ if (_response.ok) {
3233
+ return { data: undefined, rawResponse: _response.rawResponse };
3234
+ }
3235
+ if (_response.error.reason === "status-code") {
3236
+ switch (_response.error.statusCode) {
3237
+ case 401:
3238
+ throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
3239
+ case 404:
3240
+ throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
3241
+ case 405:
3242
+ throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
3243
+ case 429:
3244
+ throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
3245
+ case 500:
3246
+ throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
3247
+ case 501:
3248
+ throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
3249
+ case 502:
3250
+ throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
3251
+ case 503:
3252
+ throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
3253
+ case 504:
3254
+ throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
3255
+ default:
3256
+ throw new errors.SamsaraError({
3257
+ statusCode: _response.error.statusCode,
3258
+ body: _response.error.body,
3259
+ rawResponse: _response.rawResponse,
3260
+ });
3261
+ }
3262
+ }
3263
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/hub/plan/orders");
3264
+ });
3265
+ }
3084
3266
  /**
3085
3267
  * Returns qualification records for the specified list of IDs.
3086
3268
  *
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * planId: "planId"
5
+ * }
6
+ */
7
+ export interface DeletePlanOrdersRequest {
8
+ /** The plan identifier */
9
+ planId: string;
10
+ /** Comma-separated list of order IDs to delete. Mutually exclusive with `deleteAll=true`; exactly one of the two must be provided. */
11
+ orderIds?: string;
12
+ /** When `true`, every order in the plan is deleted. Must not be combined with `orderIds`. Must be set to `true` explicitly — `false` is equivalent to omitting the parameter and requires `orderIds` to be supplied. */
13
+ deleteAll?: boolean;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * planId: "planId"
5
+ * }
6
+ */
7
+ export interface ListPlanOrdersRequest {
8
+ /** The plan identifier */
9
+ planId: string;
10
+ /** Comma-separated list of order IDs for filtering. */
11
+ orderIds?: string;
12
+ /** If specified, should be the endCursor 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. */
13
+ after?: string;
14
+ /** Maximum number of objects to return. Default and maximum is 100 */
15
+ limit?: number;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  export type { DeleteFunctionRequest } from "./DeleteFunctionRequest.js";
2
2
  export type { DeleteJobRequest } from "./DeleteJobRequest.js";
3
+ export type { DeletePlanOrdersRequest } from "./DeletePlanOrdersRequest.js";
3
4
  export type { DeleteRidershipAccountRequest } from "./DeleteRidershipAccountRequest.js";
4
5
  export type { DeleteRidershipPassengerRequest } from "./DeleteRidershipPassengerRequest.js";
5
6
  export type { DeleteRidershipRouteSetupRequest } from "./DeleteRidershipRouteSetupRequest.js";
@@ -43,6 +44,7 @@ export type { ListAssociationsRequest } from "./ListAssociationsRequest.js";
43
44
  export type { ListDeviceRecoveryMissingAssetsRequest } from "./ListDeviceRecoveryMissingAssetsRequest.js";
44
45
  export type { ListHubCustomPropertiesRequest } from "./ListHubCustomPropertiesRequest.js";
45
46
  export type { ListMaintenanceVendorsRequest } from "./ListMaintenanceVendorsRequest.js";
47
+ export type { ListPlanOrdersRequest } from "./ListPlanOrdersRequest.js";
46
48
  export type { ListReadingsDefinitionsRequest } from "./ListReadingsDefinitionsRequest.js";
47
49
  export type { ListRidershipAccountsRequest } from "./ListRidershipAccountsRequest.js";
48
50
  export type { ListRidershipPassengersRequest } from "./ListRidershipPassengersRequest.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Pagination information
3
+ */
4
+ export interface ListPlanOrdersResponsePaginationResponseBody {
5
+ /** Cursor for the last item in the page */
6
+ endCursor?: string | undefined;
7
+ /** Whether there are more pages available */
8
+ hasNextPage: boolean;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,7 +4,7 @@ import type * as Samsara from "../index.js";
4
4
  */
5
5
  export interface OrderObjectResponseBody {
6
6
  /** The timestamp (in UTC) when the order was created */
7
- createdAt: string;
7
+ createdAtTime: string;
8
8
  /** An array of custom property values for the order */
9
9
  customProperties: Samsara.OrderCustomPropertyResponseBody[];
10
10
  /** The customer-provided identifier for the order */
@@ -21,8 +21,10 @@ export interface OrderObjectResponseBody {
21
21
  priority: number;
22
22
  /** An array of quantities for the order */
23
23
  quantities: Samsara.OrderQuantityResponseBody[];
24
+ /** The ID of the route this order is assigned to. Null if the order is unassigned. Only populated on list responses. */
25
+ routeId?: string | undefined;
24
26
  /** An array of skill IDs required to fulfill the order */
25
27
  skillsRequired: string[];
26
28
  /** The timestamp (in UTC) when the order was last updated */
27
- updatedAt: string;
29
+ updatedAtTime: string;
28
30
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Bad Gateway
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersBadGatewayErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Gateway timeout
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersGatewayTimeoutErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * An internal server error occurred
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersInternalServerErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Method not allowed
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersMethodNotAllowedErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Resource not found
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersNotFoundErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Requested endpoint is not yet implemented
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersNotImplementedErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Service unavailable
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersServiceUnavailableErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Too many requests
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersTooManyRequestsErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Unauthorized
3
+ */
4
+ export interface PlanOrdersDeletePlanOrdersUnauthorizedErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Bad Gateway
3
+ */
4
+ export interface PlanOrdersListPlanOrdersBadGatewayErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Gateway timeout
3
+ */
4
+ export interface PlanOrdersListPlanOrdersGatewayTimeoutErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * An internal server error occurred
3
+ */
4
+ export interface PlanOrdersListPlanOrdersInternalServerErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Method not allowed
3
+ */
4
+ export interface PlanOrdersListPlanOrdersMethodNotAllowedErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Resource not found
3
+ */
4
+ export interface PlanOrdersListPlanOrdersNotFoundErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Requested endpoint is not yet implemented
3
+ */
4
+ export interface PlanOrdersListPlanOrdersNotImplementedErrorResponseBody {
5
+ /** Message of error */
6
+ message: string;
7
+ /** The request ID; used when reaching out to support for issues with requests. */
8
+ requestId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });