@samsarahq/samsara 9.1.0 → 9.2.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 (84) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/betaApIs/client/Client.d.ts +32 -1
  3. package/dist/cjs/api/resources/betaApIs/client/Client.js +87 -1
  4. package/dist/cjs/api/resources/betaApIs/client/requests/EngineImmobilizerUpdateEngineImmobilizerStateRequestBody.d.ts +1 -1
  5. package/dist/cjs/api/resources/betaApIs/client/requests/GetFunctionRunRequest.d.ts +13 -0
  6. package/dist/cjs/api/resources/betaApIs/client/requests/GetFunctionRunRequest.js +3 -0
  7. package/dist/cjs/api/resources/betaApIs/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/media/client/Client.d.ts +1 -1
  9. package/dist/cjs/api/resources/media/client/Client.js +1 -1
  10. package/dist/cjs/api/resources/media/client/requests/MediaRetrievalPostMediaRetrievalRequestBody.d.ts +1 -1
  11. package/dist/cjs/api/resources/previewApIs/client/Client.d.ts +1 -1
  12. package/dist/cjs/api/resources/previewApIs/client/Client.js +1 -1
  13. package/dist/cjs/api/resources/previewApIs/client/requests/SafetyEventsV2PatchSafetyEventsV2BatchRequestBody.d.ts +1 -1
  14. package/dist/cjs/api/types/FunctionRunContextResponseBody.d.ts +11 -0
  15. package/dist/cjs/api/types/FunctionRunContextResponseBody.js +3 -0
  16. package/dist/cjs/api/types/FunctionsGetFunctionRunBadGatewayErrorResponseBody.d.ts +9 -0
  17. package/dist/cjs/api/types/FunctionsGetFunctionRunBadGatewayErrorResponseBody.js +3 -0
  18. package/dist/cjs/api/types/FunctionsGetFunctionRunGatewayTimeoutErrorResponseBody.d.ts +9 -0
  19. package/dist/cjs/api/types/FunctionsGetFunctionRunGatewayTimeoutErrorResponseBody.js +3 -0
  20. package/dist/cjs/api/types/FunctionsGetFunctionRunInternalServerErrorResponseBody.d.ts +9 -0
  21. package/dist/cjs/api/types/FunctionsGetFunctionRunInternalServerErrorResponseBody.js +3 -0
  22. package/dist/cjs/api/types/FunctionsGetFunctionRunMethodNotAllowedErrorResponseBody.d.ts +9 -0
  23. package/dist/cjs/api/types/FunctionsGetFunctionRunMethodNotAllowedErrorResponseBody.js +3 -0
  24. package/dist/cjs/api/types/FunctionsGetFunctionRunNotFoundErrorResponseBody.d.ts +9 -0
  25. package/dist/cjs/api/types/FunctionsGetFunctionRunNotFoundErrorResponseBody.js +3 -0
  26. package/dist/cjs/api/types/FunctionsGetFunctionRunNotImplementedErrorResponseBody.d.ts +9 -0
  27. package/dist/cjs/api/types/FunctionsGetFunctionRunNotImplementedErrorResponseBody.js +3 -0
  28. package/dist/cjs/api/types/FunctionsGetFunctionRunResponseBody.d.ts +4 -0
  29. package/dist/cjs/api/types/FunctionsGetFunctionRunResponseBody.js +3 -0
  30. package/dist/cjs/api/types/FunctionsGetFunctionRunServiceUnavailableErrorResponseBody.d.ts +9 -0
  31. package/dist/cjs/api/types/FunctionsGetFunctionRunServiceUnavailableErrorResponseBody.js +3 -0
  32. package/dist/cjs/api/types/FunctionsGetFunctionRunTooManyRequestsErrorResponseBody.d.ts +9 -0
  33. package/dist/cjs/api/types/FunctionsGetFunctionRunTooManyRequestsErrorResponseBody.js +3 -0
  34. package/dist/cjs/api/types/FunctionsGetFunctionRunUnauthorizedErrorResponseBody.d.ts +9 -0
  35. package/dist/cjs/api/types/FunctionsGetFunctionRunUnauthorizedErrorResponseBody.js +3 -0
  36. package/dist/cjs/api/types/GetFunctionRunDetailResponseBody.d.ts +28 -0
  37. package/dist/cjs/api/types/GetFunctionRunDetailResponseBody.js +15 -0
  38. package/dist/cjs/api/types/index.d.ts +12 -0
  39. package/dist/cjs/api/types/index.js +12 -0
  40. package/dist/cjs/version.d.ts +1 -1
  41. package/dist/cjs/version.js +1 -1
  42. package/dist/esm/BaseClient.mjs +2 -2
  43. package/dist/esm/api/resources/betaApIs/client/Client.d.mts +32 -1
  44. package/dist/esm/api/resources/betaApIs/client/Client.mjs +87 -1
  45. package/dist/esm/api/resources/betaApIs/client/requests/EngineImmobilizerUpdateEngineImmobilizerStateRequestBody.d.mts +1 -1
  46. package/dist/esm/api/resources/betaApIs/client/requests/GetFunctionRunRequest.d.mts +13 -0
  47. package/dist/esm/api/resources/betaApIs/client/requests/GetFunctionRunRequest.mjs +2 -0
  48. package/dist/esm/api/resources/betaApIs/client/requests/index.d.mts +1 -0
  49. package/dist/esm/api/resources/media/client/Client.d.mts +1 -1
  50. package/dist/esm/api/resources/media/client/Client.mjs +1 -1
  51. package/dist/esm/api/resources/media/client/requests/MediaRetrievalPostMediaRetrievalRequestBody.d.mts +1 -1
  52. package/dist/esm/api/resources/previewApIs/client/Client.d.mts +1 -1
  53. package/dist/esm/api/resources/previewApIs/client/Client.mjs +1 -1
  54. package/dist/esm/api/resources/previewApIs/client/requests/SafetyEventsV2PatchSafetyEventsV2BatchRequestBody.d.mts +1 -1
  55. package/dist/esm/api/types/FunctionRunContextResponseBody.d.mts +11 -0
  56. package/dist/esm/api/types/FunctionRunContextResponseBody.mjs +2 -0
  57. package/dist/esm/api/types/FunctionsGetFunctionRunBadGatewayErrorResponseBody.d.mts +9 -0
  58. package/dist/esm/api/types/FunctionsGetFunctionRunBadGatewayErrorResponseBody.mjs +2 -0
  59. package/dist/esm/api/types/FunctionsGetFunctionRunGatewayTimeoutErrorResponseBody.d.mts +9 -0
  60. package/dist/esm/api/types/FunctionsGetFunctionRunGatewayTimeoutErrorResponseBody.mjs +2 -0
  61. package/dist/esm/api/types/FunctionsGetFunctionRunInternalServerErrorResponseBody.d.mts +9 -0
  62. package/dist/esm/api/types/FunctionsGetFunctionRunInternalServerErrorResponseBody.mjs +2 -0
  63. package/dist/esm/api/types/FunctionsGetFunctionRunMethodNotAllowedErrorResponseBody.d.mts +9 -0
  64. package/dist/esm/api/types/FunctionsGetFunctionRunMethodNotAllowedErrorResponseBody.mjs +2 -0
  65. package/dist/esm/api/types/FunctionsGetFunctionRunNotFoundErrorResponseBody.d.mts +9 -0
  66. package/dist/esm/api/types/FunctionsGetFunctionRunNotFoundErrorResponseBody.mjs +2 -0
  67. package/dist/esm/api/types/FunctionsGetFunctionRunNotImplementedErrorResponseBody.d.mts +9 -0
  68. package/dist/esm/api/types/FunctionsGetFunctionRunNotImplementedErrorResponseBody.mjs +2 -0
  69. package/dist/esm/api/types/FunctionsGetFunctionRunResponseBody.d.mts +4 -0
  70. package/dist/esm/api/types/FunctionsGetFunctionRunResponseBody.mjs +2 -0
  71. package/dist/esm/api/types/FunctionsGetFunctionRunServiceUnavailableErrorResponseBody.d.mts +9 -0
  72. package/dist/esm/api/types/FunctionsGetFunctionRunServiceUnavailableErrorResponseBody.mjs +2 -0
  73. package/dist/esm/api/types/FunctionsGetFunctionRunTooManyRequestsErrorResponseBody.d.mts +9 -0
  74. package/dist/esm/api/types/FunctionsGetFunctionRunTooManyRequestsErrorResponseBody.mjs +2 -0
  75. package/dist/esm/api/types/FunctionsGetFunctionRunUnauthorizedErrorResponseBody.d.mts +9 -0
  76. package/dist/esm/api/types/FunctionsGetFunctionRunUnauthorizedErrorResponseBody.mjs +2 -0
  77. package/dist/esm/api/types/GetFunctionRunDetailResponseBody.d.mts +28 -0
  78. package/dist/esm/api/types/GetFunctionRunDetailResponseBody.mjs +12 -0
  79. package/dist/esm/api/types/index.d.mts +12 -0
  80. package/dist/esm/api/types/index.mjs +12 -0
  81. package/dist/esm/version.d.mts +1 -1
  82. package/dist/esm/version.mjs +1 -1
  83. package/package.json +1 -1
  84. package/reference.md +76 -3
@@ -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": "9.1.0",
48
- "User-Agent": "@samsarahq/samsara/9.1.0",
47
+ "X-Fern-SDK-Version": "9.2.0",
48
+ "User-Agent": "@samsarahq/samsara/9.2.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",
@@ -307,7 +307,7 @@ export declare class BetaApIsClient {
307
307
  * id: 1000000,
308
308
  * relayStates: [{
309
309
  * id: "relay1",
310
- * isOpen: false
310
+ * isOpen: true
311
311
  * }]
312
312
  * })
313
313
  */
@@ -913,6 +913,37 @@ export declare class BetaApIsClient {
913
913
  */
914
914
  startFunctionRun(request: Samsara.FunctionsStartFunctionRunRequestBody, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.FunctionsStartFunctionRunResponseBody>;
915
915
  private __startFunctionRun;
916
+ /**
917
+ * Retrieve the execution summary for a specific Function run, identified by the correlationId returned from the start run endpoint.
918
+ *
919
+ * <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
920
+ *
921
+ * To use this endpoint, select **Read Functions** under the Closed Beta 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>
922
+ *
923
+ *
924
+ * **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.
925
+ *
926
+ * @param {Samsara.GetFunctionRunRequest} request
927
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
928
+ *
929
+ * @throws {@link Samsara.UnauthorizedError}
930
+ * @throws {@link Samsara.NotFoundError}
931
+ * @throws {@link Samsara.MethodNotAllowedError}
932
+ * @throws {@link Samsara.TooManyRequestsError}
933
+ * @throws {@link Samsara.InternalServerError}
934
+ * @throws {@link Samsara.NotImplementedError}
935
+ * @throws {@link Samsara.BadGatewayError}
936
+ * @throws {@link Samsara.ServiceUnavailableError}
937
+ * @throws {@link Samsara.GatewayTimeoutError}
938
+ *
939
+ * @example
940
+ * await client.betaApIs.getFunctionRun({
941
+ * name: "name",
942
+ * correlationId: "correlationId"
943
+ * })
944
+ */
945
+ getFunctionRun(request: Samsara.GetFunctionRunRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.FunctionsGetFunctionRunResponseBody>;
946
+ private __getFunctionRun;
916
947
  /**
917
948
  * Update the shippingDocs field of an existing assignment.
918
949
  *
@@ -898,7 +898,7 @@ class BetaApIsClient {
898
898
  * id: 1000000,
899
899
  * relayStates: [{
900
900
  * id: "relay1",
901
- * isOpen: false
901
+ * isOpen: true
902
902
  * }]
903
903
  * })
904
904
  */
@@ -2738,6 +2738,92 @@ class BetaApIsClient {
2738
2738
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/functions/{name}/runs");
2739
2739
  });
2740
2740
  }
2741
+ /**
2742
+ * Retrieve the execution summary for a specific Function run, identified by the correlationId returned from the start run endpoint.
2743
+ *
2744
+ * <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
2745
+ *
2746
+ * To use this endpoint, select **Read Functions** under the Closed Beta 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>
2747
+ *
2748
+ *
2749
+ * **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.
2750
+ *
2751
+ * @param {Samsara.GetFunctionRunRequest} request
2752
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
2753
+ *
2754
+ * @throws {@link Samsara.UnauthorizedError}
2755
+ * @throws {@link Samsara.NotFoundError}
2756
+ * @throws {@link Samsara.MethodNotAllowedError}
2757
+ * @throws {@link Samsara.TooManyRequestsError}
2758
+ * @throws {@link Samsara.InternalServerError}
2759
+ * @throws {@link Samsara.NotImplementedError}
2760
+ * @throws {@link Samsara.BadGatewayError}
2761
+ * @throws {@link Samsara.ServiceUnavailableError}
2762
+ * @throws {@link Samsara.GatewayTimeoutError}
2763
+ *
2764
+ * @example
2765
+ * await client.betaApIs.getFunctionRun({
2766
+ * name: "name",
2767
+ * correlationId: "correlationId"
2768
+ * })
2769
+ */
2770
+ getFunctionRun(request, requestOptions) {
2771
+ return core.HttpResponsePromise.fromPromise(this.__getFunctionRun(request, requestOptions));
2772
+ }
2773
+ __getFunctionRun(request, requestOptions) {
2774
+ return __awaiter(this, void 0, void 0, function* () {
2775
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2776
+ const { name, correlationId } = request;
2777
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2778
+ 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);
2779
+ const _response = yield core.fetcher({
2780
+ 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, `functions/${core.url.encodePathParam(name)}/runs/${core.url.encodePathParam(correlationId)}`),
2781
+ method: "GET",
2782
+ headers: _headers,
2783
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2784
+ 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,
2785
+ 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,
2786
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2787
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
2788
+ logging: this._options.logging,
2789
+ });
2790
+ if (_response.ok) {
2791
+ return {
2792
+ data: _response.body,
2793
+ rawResponse: _response.rawResponse,
2794
+ };
2795
+ }
2796
+ if (_response.error.reason === "status-code") {
2797
+ switch (_response.error.statusCode) {
2798
+ case 401:
2799
+ throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
2800
+ case 404:
2801
+ throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
2802
+ case 405:
2803
+ throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
2804
+ case 429:
2805
+ throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
2806
+ case 500:
2807
+ throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
2808
+ case 501:
2809
+ throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
2810
+ case 502:
2811
+ throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
2812
+ case 503:
2813
+ throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
2814
+ case 504:
2815
+ throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
2816
+ default:
2817
+ throw new errors.SamsaraError({
2818
+ statusCode: _response.error.statusCode,
2819
+ body: _response.error.body,
2820
+ rawResponse: _response.rawResponse,
2821
+ });
2822
+ }
2823
+ }
2824
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/functions/{name}/runs/{correlationId}");
2825
+ });
2826
+ }
2741
2827
  /**
2742
2828
  * Update the shippingDocs field of an existing assignment.
2743
2829
  *
@@ -5,7 +5,7 @@ import type * as Samsara from "../../../../index.js";
5
5
  * id: 1000000,
6
6
  * relayStates: [{
7
7
  * id: "relay1",
8
- * isOpen: false
8
+ * isOpen: true
9
9
  * }]
10
10
  * }
11
11
  */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * name: "name",
5
+ * correlationId: "correlationId"
6
+ * }
7
+ */
8
+ export interface GetFunctionRunRequest {
9
+ /** The name of the Function. */
10
+ name: string;
11
+ /** The unique correlationId of the Function run, returned by the start run endpoint. */
12
+ correlationId: string;
13
+ }
@@ -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 });
@@ -19,6 +19,7 @@ export type { GetDevicesRequest } from "./GetDevicesRequest.js";
19
19
  export type { GetDriverEfficiencyRequest } from "./GetDriverEfficiencyRequest.js";
20
20
  export type { GetEngineImmobilizerStatesRequest } from "./GetEngineImmobilizerStatesRequest.js";
21
21
  export type { GetFunctionRequest } from "./GetFunctionRequest.js";
22
+ export type { GetFunctionRunRequest } from "./GetFunctionRunRequest.js";
22
23
  export type { GetHosEldEventsRequest } from "./GetHosEldEventsRequest.js";
23
24
  export type { GetJobsRequest } from "./GetJobsRequest.js";
24
25
  export type { GetQualificationRecordsRequest } from "./GetQualificationRecordsRequest.js";
@@ -98,7 +98,7 @@ export declare class MediaClient {
98
98
  * @example
99
99
  * await client.media.postMediaRetrieval({
100
100
  * endTime: "2019-06-13T19:08:55Z",
101
- * inputs: ["dashcamRoadFacing", "dashcamRoadFacing", "dashcamRoadFacing"],
101
+ * inputs: ["dashcamRoadFacing", "dashcamRoadFacing"],
102
102
  * mediaType: "image",
103
103
  * startTime: "2019-06-13T19:08:25Z",
104
104
  * vehicleId: "1234"
@@ -274,7 +274,7 @@ class MediaClient {
274
274
  * @example
275
275
  * await client.media.postMediaRetrieval({
276
276
  * endTime: "2019-06-13T19:08:55Z",
277
- * inputs: ["dashcamRoadFacing", "dashcamRoadFacing", "dashcamRoadFacing"],
277
+ * inputs: ["dashcamRoadFacing", "dashcamRoadFacing"],
278
278
  * mediaType: "image",
279
279
  * startTime: "2019-06-13T19:08:25Z",
280
280
  * vehicleId: "1234"
@@ -2,7 +2,7 @@
2
2
  * @example
3
3
  * {
4
4
  * endTime: "2019-06-13T19:08:55Z",
5
- * inputs: ["dashcamRoadFacing", "dashcamRoadFacing", "dashcamRoadFacing"],
5
+ * inputs: ["dashcamRoadFacing", "dashcamRoadFacing"],
6
6
  * mediaType: "image",
7
7
  * startTime: "2019-06-13T19:08:25Z",
8
8
  * vehicleId: "1234"
@@ -149,7 +149,7 @@ export declare class PreviewApIsClient {
149
149
  *
150
150
  * @example
151
151
  * await client.previewApIs.patchSafetyEventsV2Batch({
152
- * safetyEventIds: ["bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"]
152
+ * safetyEventIds: ["bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"]
153
153
  * })
154
154
  */
155
155
  patchSafetyEventsV2Batch(request: Samsara.SafetyEventsV2PatchSafetyEventsV2BatchRequestBody, requestOptions?: PreviewApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.SafetyEventsV2PatchSafetyEventsV2BatchResponseBody>;
@@ -355,7 +355,7 @@ class PreviewApIsClient {
355
355
  *
356
356
  * @example
357
357
  * await client.previewApIs.patchSafetyEventsV2Batch({
358
- * safetyEventIds: ["bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"]
358
+ * safetyEventIds: ["bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"]
359
359
  * })
360
360
  */
361
361
  patchSafetyEventsV2Batch(request, requestOptions) {
@@ -2,7 +2,7 @@ import type * as Samsara from "../../../../index.js";
2
2
  /**
3
3
  * @example
4
4
  * {
5
- * safetyEventIds: ["bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"]
5
+ * safetyEventIds: ["bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590", "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"]
6
6
  * }
7
7
  */
8
8
  export interface SafetyEventsV2PatchSafetyEventsV2BatchRequestBody {
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Context details of the Function run execution.
3
+ */
4
+ export interface FunctionRunContextResponseBody {
5
+ /** Unique request identifier for the execution. */
6
+ requestId: string;
7
+ /** The request payload sent to the Function. */
8
+ requestPayload?: Record<string, unknown> | undefined;
9
+ /** The response payload returned by the Function. */
10
+ responsePayload?: Record<string, unknown> | undefined;
11
+ }
@@ -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 FunctionsGetFunctionRunBadGatewayErrorResponseBody {
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 FunctionsGetFunctionRunGatewayTimeoutErrorResponseBody {
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 FunctionsGetFunctionRunInternalServerErrorResponseBody {
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 FunctionsGetFunctionRunMethodNotAllowedErrorResponseBody {
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 FunctionsGetFunctionRunNotFoundErrorResponseBody {
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 FunctionsGetFunctionRunNotImplementedErrorResponseBody {
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,4 @@
1
+ import type * as Samsara from "../index.js";
2
+ export interface FunctionsGetFunctionRunResponseBody {
3
+ data: Samsara.GetFunctionRunDetailResponseBody;
4
+ }
@@ -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 FunctionsGetFunctionRunServiceUnavailableErrorResponseBody {
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 FunctionsGetFunctionRunTooManyRequestsErrorResponseBody {
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 FunctionsGetFunctionRunUnauthorizedErrorResponseBody {
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,28 @@
1
+ import type * as Samsara from "../index.js";
2
+ /**
3
+ * Details of a specific Function run.
4
+ */
5
+ export interface GetFunctionRunDetailResponseBody {
6
+ /** RFC 3339 timestamp when the Function run completed. Absent while the run is in progress. */
7
+ completedAtTime?: string | undefined;
8
+ context: Samsara.FunctionRunContextResponseBody;
9
+ /** Unique identifier for this Function run. */
10
+ correlationId: string;
11
+ /** Name of the Function. */
12
+ name: string;
13
+ /** RFC 3339 timestamp when the Function run started. */
14
+ startedAtTime: string;
15
+ /** Execution status of the Function run. Valid values: `started`, `timeout`, `error`, `success`, `dropped` */
16
+ status: GetFunctionRunDetailResponseBody.Status;
17
+ }
18
+ export declare namespace GetFunctionRunDetailResponseBody {
19
+ /** Execution status of the Function run. Valid values: `started`, `timeout`, `error`, `success`, `dropped` */
20
+ const Status: {
21
+ readonly Started: "started";
22
+ readonly Timeout: "timeout";
23
+ readonly Error: "error";
24
+ readonly Success: "success";
25
+ readonly Dropped: "dropped";
26
+ };
27
+ type Status = (typeof Status)[keyof typeof Status];
28
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.GetFunctionRunDetailResponseBody = void 0;
5
+ var GetFunctionRunDetailResponseBody;
6
+ (function (GetFunctionRunDetailResponseBody) {
7
+ /** Execution status of the Function run. Valid values: `started`, `timeout`, `error`, `success`, `dropped` */
8
+ GetFunctionRunDetailResponseBody.Status = {
9
+ Started: "started",
10
+ Timeout: "timeout",
11
+ Error: "error",
12
+ Success: "success",
13
+ Dropped: "dropped",
14
+ };
15
+ })(GetFunctionRunDetailResponseBody || (exports.GetFunctionRunDetailResponseBody = GetFunctionRunDetailResponseBody = {}));
@@ -1040,6 +1040,7 @@ export * from "./FuelVolumeResponseBody.js";
1040
1040
  export * from "./FunctionCodePackageResponseBody.js";
1041
1041
  export * from "./FunctionConfigResponseBody.js";
1042
1042
  export * from "./FunctionEffectsResponseBody.js";
1043
+ export * from "./FunctionRunContextResponseBody.js";
1043
1044
  export * from "./FunctionScheduleEntryRequestBody.js";
1044
1045
  export * from "./FunctionScheduleEntryResponseBody.js";
1045
1046
  export * from "./FunctionScheduleRequestBody.js";
@@ -1071,6 +1072,16 @@ export * from "./FunctionsGetFunctionMethodNotAllowedErrorResponseBody.js";
1071
1072
  export * from "./FunctionsGetFunctionNotFoundErrorResponseBody.js";
1072
1073
  export * from "./FunctionsGetFunctionNotImplementedErrorResponseBody.js";
1073
1074
  export * from "./FunctionsGetFunctionResponseBody.js";
1075
+ export * from "./FunctionsGetFunctionRunBadGatewayErrorResponseBody.js";
1076
+ export * from "./FunctionsGetFunctionRunGatewayTimeoutErrorResponseBody.js";
1077
+ export * from "./FunctionsGetFunctionRunInternalServerErrorResponseBody.js";
1078
+ export * from "./FunctionsGetFunctionRunMethodNotAllowedErrorResponseBody.js";
1079
+ export * from "./FunctionsGetFunctionRunNotFoundErrorResponseBody.js";
1080
+ export * from "./FunctionsGetFunctionRunNotImplementedErrorResponseBody.js";
1081
+ export * from "./FunctionsGetFunctionRunResponseBody.js";
1082
+ export * from "./FunctionsGetFunctionRunServiceUnavailableErrorResponseBody.js";
1083
+ export * from "./FunctionsGetFunctionRunTooManyRequestsErrorResponseBody.js";
1084
+ export * from "./FunctionsGetFunctionRunUnauthorizedErrorResponseBody.js";
1074
1085
  export * from "./FunctionsGetFunctionServiceUnavailableErrorResponseBody.js";
1075
1086
  export * from "./FunctionsGetFunctionTooManyRequestsErrorResponseBody.js";
1076
1087
  export * from "./FunctionsGetFunctionUnauthorizedErrorResponseBody.js";
@@ -1143,6 +1154,7 @@ export * from "./GetAttributesByEntityTypeResponse.js";
1143
1154
  export * from "./GetDocumentTypeResponseObjectResponseBody.js";
1144
1155
  export * from "./GetDriverTrailerAssignmentsResponseBodyResponseBody.js";
1145
1156
  export * from "./GetFunctionDetailResponseBody.js";
1157
+ export * from "./GetFunctionRunDetailResponseBody.js";
1146
1158
  export * from "./GetMediaRetrievalObjectResponseBody.js";
1147
1159
  export * from "./GetReportRunsDataObjectResponseBody.js";
1148
1160
  export * from "./GetResponseWorkflowConfigurationObjectResponseBody.js";
@@ -1056,6 +1056,7 @@ __exportStar(require("./FuelVolumeResponseBody.js"), exports);
1056
1056
  __exportStar(require("./FunctionCodePackageResponseBody.js"), exports);
1057
1057
  __exportStar(require("./FunctionConfigResponseBody.js"), exports);
1058
1058
  __exportStar(require("./FunctionEffectsResponseBody.js"), exports);
1059
+ __exportStar(require("./FunctionRunContextResponseBody.js"), exports);
1059
1060
  __exportStar(require("./FunctionScheduleEntryRequestBody.js"), exports);
1060
1061
  __exportStar(require("./FunctionScheduleEntryResponseBody.js"), exports);
1061
1062
  __exportStar(require("./FunctionScheduleRequestBody.js"), exports);
@@ -1087,6 +1088,16 @@ __exportStar(require("./FunctionsGetFunctionMethodNotAllowedErrorResponseBody.js
1087
1088
  __exportStar(require("./FunctionsGetFunctionNotFoundErrorResponseBody.js"), exports);
1088
1089
  __exportStar(require("./FunctionsGetFunctionNotImplementedErrorResponseBody.js"), exports);
1089
1090
  __exportStar(require("./FunctionsGetFunctionResponseBody.js"), exports);
1091
+ __exportStar(require("./FunctionsGetFunctionRunBadGatewayErrorResponseBody.js"), exports);
1092
+ __exportStar(require("./FunctionsGetFunctionRunGatewayTimeoutErrorResponseBody.js"), exports);
1093
+ __exportStar(require("./FunctionsGetFunctionRunInternalServerErrorResponseBody.js"), exports);
1094
+ __exportStar(require("./FunctionsGetFunctionRunMethodNotAllowedErrorResponseBody.js"), exports);
1095
+ __exportStar(require("./FunctionsGetFunctionRunNotFoundErrorResponseBody.js"), exports);
1096
+ __exportStar(require("./FunctionsGetFunctionRunNotImplementedErrorResponseBody.js"), exports);
1097
+ __exportStar(require("./FunctionsGetFunctionRunResponseBody.js"), exports);
1098
+ __exportStar(require("./FunctionsGetFunctionRunServiceUnavailableErrorResponseBody.js"), exports);
1099
+ __exportStar(require("./FunctionsGetFunctionRunTooManyRequestsErrorResponseBody.js"), exports);
1100
+ __exportStar(require("./FunctionsGetFunctionRunUnauthorizedErrorResponseBody.js"), exports);
1090
1101
  __exportStar(require("./FunctionsGetFunctionServiceUnavailableErrorResponseBody.js"), exports);
1091
1102
  __exportStar(require("./FunctionsGetFunctionTooManyRequestsErrorResponseBody.js"), exports);
1092
1103
  __exportStar(require("./FunctionsGetFunctionUnauthorizedErrorResponseBody.js"), exports);
@@ -1159,6 +1170,7 @@ __exportStar(require("./GetAttributesByEntityTypeResponse.js"), exports);
1159
1170
  __exportStar(require("./GetDocumentTypeResponseObjectResponseBody.js"), exports);
1160
1171
  __exportStar(require("./GetDriverTrailerAssignmentsResponseBodyResponseBody.js"), exports);
1161
1172
  __exportStar(require("./GetFunctionDetailResponseBody.js"), exports);
1173
+ __exportStar(require("./GetFunctionRunDetailResponseBody.js"), exports);
1162
1174
  __exportStar(require("./GetMediaRetrievalObjectResponseBody.js"), exports);
1163
1175
  __exportStar(require("./GetReportRunsDataObjectResponseBody.js"), exports);
1164
1176
  __exportStar(require("./GetResponseWorkflowConfigurationObjectResponseBody.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "9.1.0";
1
+ export declare const SDK_VERSION = "9.2.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "9.1.0";
4
+ exports.SDK_VERSION = "9.2.0";
@@ -7,8 +7,8 @@ export function normalizeClientOptions(options) {
7
7
  const headers = mergeHeaders({
8
8
  "X-Fern-Language": "JavaScript",
9
9
  "X-Fern-SDK-Name": "@samsarahq/samsara",
10
- "X-Fern-SDK-Version": "9.1.0",
11
- "User-Agent": "@samsarahq/samsara/9.1.0",
10
+ "X-Fern-SDK-Version": "9.2.0",
11
+ "User-Agent": "@samsarahq/samsara/9.2.0",
12
12
  "X-Fern-Runtime": core.RUNTIME.type,
13
13
  "X-Fern-Runtime-Version": core.RUNTIME.version,
14
14
  "X-Samsara-Version": (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : "2025-06-11",
@@ -307,7 +307,7 @@ export declare class BetaApIsClient {
307
307
  * id: 1000000,
308
308
  * relayStates: [{
309
309
  * id: "relay1",
310
- * isOpen: false
310
+ * isOpen: true
311
311
  * }]
312
312
  * })
313
313
  */
@@ -913,6 +913,37 @@ export declare class BetaApIsClient {
913
913
  */
914
914
  startFunctionRun(request: Samsara.FunctionsStartFunctionRunRequestBody, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.FunctionsStartFunctionRunResponseBody>;
915
915
  private __startFunctionRun;
916
+ /**
917
+ * Retrieve the execution summary for a specific Function run, identified by the correlationId returned from the start run endpoint.
918
+ *
919
+ * <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).
920
+ *
921
+ * To use this endpoint, select **Read Functions** under the Closed Beta 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>
922
+ *
923
+ *
924
+ * **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.
925
+ *
926
+ * @param {Samsara.GetFunctionRunRequest} request
927
+ * @param {BetaApIsClient.RequestOptions} requestOptions - Request-specific configuration.
928
+ *
929
+ * @throws {@link Samsara.UnauthorizedError}
930
+ * @throws {@link Samsara.NotFoundError}
931
+ * @throws {@link Samsara.MethodNotAllowedError}
932
+ * @throws {@link Samsara.TooManyRequestsError}
933
+ * @throws {@link Samsara.InternalServerError}
934
+ * @throws {@link Samsara.NotImplementedError}
935
+ * @throws {@link Samsara.BadGatewayError}
936
+ * @throws {@link Samsara.ServiceUnavailableError}
937
+ * @throws {@link Samsara.GatewayTimeoutError}
938
+ *
939
+ * @example
940
+ * await client.betaApIs.getFunctionRun({
941
+ * name: "name",
942
+ * correlationId: "correlationId"
943
+ * })
944
+ */
945
+ getFunctionRun(request: Samsara.GetFunctionRunRequest, requestOptions?: BetaApIsClient.RequestOptions): core.HttpResponsePromise<Samsara.FunctionsGetFunctionRunResponseBody>;
946
+ private __getFunctionRun;
916
947
  /**
917
948
  * Update the shippingDocs field of an existing assignment.
918
949
  *