@samsarahq/samsara 13.4.0 → 13.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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/issues/client/Client.d.ts +33 -0
- package/dist/cjs/api/resources/issues/client/Client.js +87 -0
- package/dist/cjs/api/resources/issues/client/requests/IssuesPatchIssueRequestBody.d.ts +5 -5
- package/dist/cjs/api/resources/issues/client/requests/IssuesPatchIssueRequestBody.js +1 -1
- package/dist/cjs/api/resources/issues/client/requests/IssuesPostIssueRequestBody.d.ts +45 -0
- package/dist/cjs/api/resources/issues/client/requests/IssuesPostIssueRequestBody.js +20 -0
- package/dist/cjs/api/resources/issues/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/issues/client/requests/index.js +3 -1
- package/dist/cjs/api/resources/media/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/media/client/Client.js +1 -1
- package/dist/cjs/api/resources/media/client/requests/MediaRetrievalPostMediaRetrievalRequestBody.d.ts +1 -1
- package/dist/cjs/api/types/IssuesPostIssueBadGatewayErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueBadGatewayErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueGatewayTimeoutErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueGatewayTimeoutErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueInternalServerErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueInternalServerErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueMethodNotAllowedErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueMethodNotAllowedErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueNotFoundErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueNotFoundErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueNotImplementedErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueNotImplementedErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueResponseBody.d.ts +4 -0
- package/dist/cjs/api/types/IssuesPostIssueResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueServiceUnavailableErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueServiceUnavailableErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueTooManyRequestsErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueTooManyRequestsErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/IssuesPostIssueUnauthorizedErrorResponseBody.d.ts +9 -0
- package/dist/cjs/api/types/IssuesPostIssueUnauthorizedErrorResponseBody.js +3 -0
- package/dist/cjs/api/types/PostIssueRequestBodyAssetRequestBody.d.ts +7 -0
- package/dist/cjs/api/types/PostIssueRequestBodyAssetRequestBody.js +3 -0
- package/dist/cjs/api/types/PostIssueRequestBodyAssignedToRequestBody.d.ts +16 -0
- package/dist/cjs/api/types/PostIssueRequestBodyAssignedToRequestBody.js +11 -0
- package/dist/cjs/api/types/index.d.ts +12 -0
- package/dist/cjs/api/types/index.js +12 -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/issues/client/Client.d.mts +33 -0
- package/dist/esm/api/resources/issues/client/Client.mjs +87 -0
- package/dist/esm/api/resources/issues/client/requests/IssuesPatchIssueRequestBody.d.mts +5 -5
- package/dist/esm/api/resources/issues/client/requests/IssuesPatchIssueRequestBody.mjs +1 -1
- package/dist/esm/api/resources/issues/client/requests/IssuesPostIssueRequestBody.d.mts +45 -0
- package/dist/esm/api/resources/issues/client/requests/IssuesPostIssueRequestBody.mjs +17 -0
- package/dist/esm/api/resources/issues/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/issues/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/media/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/media/client/Client.mjs +1 -1
- package/dist/esm/api/resources/media/client/requests/MediaRetrievalPostMediaRetrievalRequestBody.d.mts +1 -1
- package/dist/esm/api/types/IssuesPostIssueBadGatewayErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueBadGatewayErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueGatewayTimeoutErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueGatewayTimeoutErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueInternalServerErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueInternalServerErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueMethodNotAllowedErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueMethodNotAllowedErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueNotFoundErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueNotFoundErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueNotImplementedErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueNotImplementedErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueResponseBody.d.mts +4 -0
- package/dist/esm/api/types/IssuesPostIssueResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueServiceUnavailableErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueServiceUnavailableErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueTooManyRequestsErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueTooManyRequestsErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/IssuesPostIssueUnauthorizedErrorResponseBody.d.mts +9 -0
- package/dist/esm/api/types/IssuesPostIssueUnauthorizedErrorResponseBody.mjs +2 -0
- package/dist/esm/api/types/PostIssueRequestBodyAssetRequestBody.d.mts +7 -0
- package/dist/esm/api/types/PostIssueRequestBodyAssetRequestBody.mjs +2 -0
- package/dist/esm/api/types/PostIssueRequestBodyAssignedToRequestBody.d.mts +16 -0
- package/dist/esm/api/types/PostIssueRequestBodyAssignedToRequestBody.mjs +8 -0
- package/dist/esm/api/types/index.d.mts +12 -0
- package/dist/esm/api/types/index.mjs +12 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +76 -1
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": "13.
|
|
48
|
-
"User-Agent": "@samsarahq/samsara/13.
|
|
47
|
+
"X-Fern-SDK-Version": "13.5.0",
|
|
48
|
+
"User-Agent": "@samsarahq/samsara/13.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",
|
|
@@ -38,6 +38,39 @@ export declare class IssuesClient {
|
|
|
38
38
|
*/
|
|
39
39
|
getIssues(request?: Samsara.GetIssuesRequest, requestOptions?: IssuesClient.RequestOptions): core.HttpResponsePromise<Samsara.IssuesGetIssuesResponseBody>;
|
|
40
40
|
private __getIssues;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new issue associated with an asset, with optional media attachments uploaded inline as base64.
|
|
43
|
+
*
|
|
44
|
+
* <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>).
|
|
45
|
+
*
|
|
46
|
+
* To use this endpoint, select **Write Issues** under the Forms 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>
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* **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.
|
|
50
|
+
*
|
|
51
|
+
* @param {Samsara.IssuesPostIssueRequestBody} request
|
|
52
|
+
* @param {IssuesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Samsara.UnauthorizedError}
|
|
55
|
+
* @throws {@link Samsara.NotFoundError}
|
|
56
|
+
* @throws {@link Samsara.MethodNotAllowedError}
|
|
57
|
+
* @throws {@link Samsara.TooManyRequestsError}
|
|
58
|
+
* @throws {@link Samsara.InternalServerError}
|
|
59
|
+
* @throws {@link Samsara.NotImplementedError}
|
|
60
|
+
* @throws {@link Samsara.BadGatewayError}
|
|
61
|
+
* @throws {@link Samsara.ServiceUnavailableError}
|
|
62
|
+
* @throws {@link Samsara.GatewayTimeoutError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.issues.postIssue({
|
|
66
|
+
* asset: {
|
|
67
|
+
* id: "hertzAssetId:HZ-100423"
|
|
68
|
+
* },
|
|
69
|
+
* title: "Front bumper scratch"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
postIssue(request: Samsara.IssuesPostIssueRequestBody, requestOptions?: IssuesClient.RequestOptions): core.HttpResponsePromise<Samsara.IssuesPostIssueResponseBody>;
|
|
73
|
+
private __postIssue;
|
|
41
74
|
/**
|
|
42
75
|
* Updates an instance of an issue.
|
|
43
76
|
*
|
|
@@ -139,6 +139,93 @@ class IssuesClient {
|
|
|
139
139
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/issues");
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Creates a new issue associated with an asset, with optional media attachments uploaded inline as base64.
|
|
144
|
+
*
|
|
145
|
+
* <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>).
|
|
146
|
+
*
|
|
147
|
+
* To use this endpoint, select **Write Issues** under the Forms 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>
|
|
148
|
+
*
|
|
149
|
+
*
|
|
150
|
+
* **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.
|
|
151
|
+
*
|
|
152
|
+
* @param {Samsara.IssuesPostIssueRequestBody} request
|
|
153
|
+
* @param {IssuesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
154
|
+
*
|
|
155
|
+
* @throws {@link Samsara.UnauthorizedError}
|
|
156
|
+
* @throws {@link Samsara.NotFoundError}
|
|
157
|
+
* @throws {@link Samsara.MethodNotAllowedError}
|
|
158
|
+
* @throws {@link Samsara.TooManyRequestsError}
|
|
159
|
+
* @throws {@link Samsara.InternalServerError}
|
|
160
|
+
* @throws {@link Samsara.NotImplementedError}
|
|
161
|
+
* @throws {@link Samsara.BadGatewayError}
|
|
162
|
+
* @throws {@link Samsara.ServiceUnavailableError}
|
|
163
|
+
* @throws {@link Samsara.GatewayTimeoutError}
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* await client.issues.postIssue({
|
|
167
|
+
* asset: {
|
|
168
|
+
* id: "hertzAssetId:HZ-100423"
|
|
169
|
+
* },
|
|
170
|
+
* title: "Front bumper scratch"
|
|
171
|
+
* })
|
|
172
|
+
*/
|
|
173
|
+
postIssue(request, requestOptions) {
|
|
174
|
+
return core.HttpResponsePromise.fromPromise(this.__postIssue(request, requestOptions));
|
|
175
|
+
}
|
|
176
|
+
__postIssue(request, requestOptions) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
179
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
180
|
+
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);
|
|
181
|
+
const _response = yield core.fetcher({
|
|
182
|
+
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, "issues"),
|
|
183
|
+
method: "POST",
|
|
184
|
+
headers: _headers,
|
|
185
|
+
contentType: "application/json",
|
|
186
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
187
|
+
requestType: "json",
|
|
188
|
+
body: request,
|
|
189
|
+
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,
|
|
190
|
+
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,
|
|
191
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
192
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
193
|
+
logging: this._options.logging,
|
|
194
|
+
});
|
|
195
|
+
if (_response.ok) {
|
|
196
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
197
|
+
}
|
|
198
|
+
if (_response.error.reason === "status-code") {
|
|
199
|
+
switch (_response.error.statusCode) {
|
|
200
|
+
case 401:
|
|
201
|
+
throw new Samsara.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
202
|
+
case 404:
|
|
203
|
+
throw new Samsara.NotFoundError(_response.error.body, _response.rawResponse);
|
|
204
|
+
case 405:
|
|
205
|
+
throw new Samsara.MethodNotAllowedError(_response.error.body, _response.rawResponse);
|
|
206
|
+
case 429:
|
|
207
|
+
throw new Samsara.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
208
|
+
case 500:
|
|
209
|
+
throw new Samsara.InternalServerError(_response.error.body, _response.rawResponse);
|
|
210
|
+
case 501:
|
|
211
|
+
throw new Samsara.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
212
|
+
case 502:
|
|
213
|
+
throw new Samsara.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
214
|
+
case 503:
|
|
215
|
+
throw new Samsara.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
216
|
+
case 504:
|
|
217
|
+
throw new Samsara.GatewayTimeoutError(_response.error.body, _response.rawResponse);
|
|
218
|
+
default:
|
|
219
|
+
throw new errors.SamsaraError({
|
|
220
|
+
statusCode: _response.error.statusCode,
|
|
221
|
+
body: _response.error.body,
|
|
222
|
+
rawResponse: _response.rawResponse,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/issues");
|
|
227
|
+
});
|
|
228
|
+
}
|
|
142
229
|
/**
|
|
143
230
|
* Updates an instance of an issue.
|
|
144
231
|
*
|
|
@@ -7,7 +7,7 @@ import type * as Samsara from "../../../../index.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export interface IssuesPatchIssueRequestBody {
|
|
9
9
|
assignedTo?: Samsara.PatchIssueRequestBodyAssignedToRequestBody;
|
|
10
|
-
/** Description of the issue.
|
|
10
|
+
/** Description of the issue. */
|
|
11
11
|
description?: string;
|
|
12
12
|
/** Due date of the issue. UTC timestamp in RFC 3339 format. */
|
|
13
13
|
dueDate?: string;
|
|
@@ -15,17 +15,17 @@ export interface IssuesPatchIssueRequestBody {
|
|
|
15
15
|
externalIds?: Record<string, string>;
|
|
16
16
|
/** ID of the issue. Can be either a unique Samsara ID or an [external ID](https://developers.samsara.com/docs/external-ids) for the issue. */
|
|
17
17
|
id: string;
|
|
18
|
-
/** Media items to append to the issue.
|
|
18
|
+
/** Media items to append to the issue. */
|
|
19
19
|
media?: Samsara.FormSubmissionRequestMediaItemObjectRequestBody[];
|
|
20
|
-
/** Priority of the issue.
|
|
20
|
+
/** Priority of the issue. Valid values: `low`, `medium`, `high` */
|
|
21
21
|
priority?: IssuesPatchIssueRequestBody.Priority;
|
|
22
22
|
/** Status of the issue. Valid values: `open`, `inProgress`, `resolved`, `dismissed` */
|
|
23
23
|
status?: IssuesPatchIssueRequestBody.Status;
|
|
24
|
-
/** Title of the issue.
|
|
24
|
+
/** Title of the issue. */
|
|
25
25
|
title?: string;
|
|
26
26
|
}
|
|
27
27
|
export declare namespace IssuesPatchIssueRequestBody {
|
|
28
|
-
/** Priority of the issue.
|
|
28
|
+
/** Priority of the issue. Valid values: `low`, `medium`, `high` */
|
|
29
29
|
const Priority: {
|
|
30
30
|
readonly Low: "low";
|
|
31
31
|
readonly Medium: "medium";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.IssuesPatchIssueRequestBody = void 0;
|
|
5
5
|
var IssuesPatchIssueRequestBody;
|
|
6
6
|
(function (IssuesPatchIssueRequestBody) {
|
|
7
|
-
/** Priority of the issue.
|
|
7
|
+
/** Priority of the issue. Valid values: `low`, `medium`, `high` */
|
|
8
8
|
IssuesPatchIssueRequestBody.Priority = {
|
|
9
9
|
Low: "low",
|
|
10
10
|
Medium: "medium",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type * as Samsara from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* asset: {
|
|
6
|
+
* id: "hertzAssetId:HZ-100423"
|
|
7
|
+
* },
|
|
8
|
+
* title: "Front bumper scratch"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface IssuesPostIssueRequestBody {
|
|
12
|
+
asset: Samsara.PostIssueRequestBodyAssetRequestBody;
|
|
13
|
+
assignedTo?: Samsara.PostIssueRequestBodyAssignedToRequestBody;
|
|
14
|
+
/** Description of the issue. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Due date of the issue. UTC timestamp in RFC 3339 format. */
|
|
17
|
+
dueDate?: string;
|
|
18
|
+
/** A map of external ids */
|
|
19
|
+
externalIds?: Record<string, string>;
|
|
20
|
+
/** Media items to attach to the issue. */
|
|
21
|
+
media?: Samsara.FormSubmissionRequestMediaItemObjectRequestBody[];
|
|
22
|
+
/** Priority of the issue. Valid values: `low`, `medium`, `high` */
|
|
23
|
+
priority?: IssuesPostIssueRequestBody.Priority;
|
|
24
|
+
/** Status of the issue. Defaults to `open` when omitted. Valid values: `open`, `inProgress`, `resolved`, `dismissed` */
|
|
25
|
+
status?: IssuesPostIssueRequestBody.Status;
|
|
26
|
+
/** Title of the issue. */
|
|
27
|
+
title: string;
|
|
28
|
+
}
|
|
29
|
+
export declare namespace IssuesPostIssueRequestBody {
|
|
30
|
+
/** Priority of the issue. Valid values: `low`, `medium`, `high` */
|
|
31
|
+
const Priority: {
|
|
32
|
+
readonly Low: "low";
|
|
33
|
+
readonly Medium: "medium";
|
|
34
|
+
readonly High: "high";
|
|
35
|
+
};
|
|
36
|
+
type Priority = (typeof Priority)[keyof typeof Priority];
|
|
37
|
+
/** Status of the issue. Defaults to `open` when omitted. Valid values: `open`, `inProgress`, `resolved`, `dismissed` */
|
|
38
|
+
const Status: {
|
|
39
|
+
readonly Open: "open";
|
|
40
|
+
readonly InProgress: "inProgress";
|
|
41
|
+
readonly Resolved: "resolved";
|
|
42
|
+
readonly Dismissed: "dismissed";
|
|
43
|
+
};
|
|
44
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
45
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IssuesPostIssueRequestBody = void 0;
|
|
5
|
+
var IssuesPostIssueRequestBody;
|
|
6
|
+
(function (IssuesPostIssueRequestBody) {
|
|
7
|
+
/** Priority of the issue. Valid values: `low`, `medium`, `high` */
|
|
8
|
+
IssuesPostIssueRequestBody.Priority = {
|
|
9
|
+
Low: "low",
|
|
10
|
+
Medium: "medium",
|
|
11
|
+
High: "high",
|
|
12
|
+
};
|
|
13
|
+
/** Status of the issue. Defaults to `open` when omitted. Valid values: `open`, `inProgress`, `resolved`, `dismissed` */
|
|
14
|
+
IssuesPostIssueRequestBody.Status = {
|
|
15
|
+
Open: "open",
|
|
16
|
+
InProgress: "inProgress",
|
|
17
|
+
Resolved: "resolved",
|
|
18
|
+
Dismissed: "dismissed",
|
|
19
|
+
};
|
|
20
|
+
})(IssuesPostIssueRequestBody || (exports.IssuesPostIssueRequestBody = IssuesPostIssueRequestBody = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { GetIssuesRequest } from "./GetIssuesRequest.js";
|
|
2
2
|
export type { GetIssuesStreamRequest } from "./GetIssuesStreamRequest.js";
|
|
3
3
|
export { IssuesPatchIssueRequestBody } from "./IssuesPatchIssueRequestBody.js";
|
|
4
|
+
export { IssuesPostIssueRequestBody } from "./IssuesPostIssueRequestBody.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IssuesPatchIssueRequestBody = void 0;
|
|
3
|
+
exports.IssuesPostIssueRequestBody = exports.IssuesPatchIssueRequestBody = void 0;
|
|
4
4
|
var IssuesPatchIssueRequestBody_js_1 = require("./IssuesPatchIssueRequestBody.js");
|
|
5
5
|
Object.defineProperty(exports, "IssuesPatchIssueRequestBody", { enumerable: true, get: function () { return IssuesPatchIssueRequestBody_js_1.IssuesPatchIssueRequestBody; } });
|
|
6
|
+
var IssuesPostIssueRequestBody_js_1 = require("./IssuesPostIssueRequestBody.js");
|
|
7
|
+
Object.defineProperty(exports, "IssuesPostIssueRequestBody", { enumerable: true, get: function () { return IssuesPostIssueRequestBody_js_1.IssuesPostIssueRequestBody; } });
|
|
@@ -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"],
|
|
101
|
+
* inputs: ["dashcamRoadFacing", "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"],
|
|
277
|
+
* inputs: ["dashcamRoadFacing", "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"],
|
|
5
|
+
* inputs: ["dashcamRoadFacing", "dashcamRoadFacing", "dashcamRoadFacing"],
|
|
6
6
|
* mediaType: "image",
|
|
7
7
|
* startTime: "2019-06-13T19:08:25Z",
|
|
8
8
|
* vehicleId: "1234"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An internal server error occurred
|
|
3
|
+
*/
|
|
4
|
+
export interface IssuesPostIssueInternalServerErrorResponseBody {
|
|
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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requested endpoint is not yet implemented
|
|
3
|
+
*/
|
|
4
|
+
export interface IssuesPostIssueNotImplementedErrorResponseBody {
|
|
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,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset the issue is associated with.
|
|
3
|
+
*/
|
|
4
|
+
export interface PostIssueRequestBodyAssetRequestBody {
|
|
5
|
+
/** ID of the asset. Can be either a unique Samsara ID or an [external ID](https://developers.samsara.com/docs/external-ids) for the asset. */
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Issue assignee.
|
|
3
|
+
*/
|
|
4
|
+
export interface PostIssueRequestBodyAssignedToRequestBody {
|
|
5
|
+
/** ID of the issue assignee. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Type of the issue assignee. Valid values: `user` */
|
|
8
|
+
type: PostIssueRequestBodyAssignedToRequestBody.Type;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace PostIssueRequestBodyAssignedToRequestBody {
|
|
11
|
+
/** Type of the issue assignee. Valid values: `user` */
|
|
12
|
+
const Type: {
|
|
13
|
+
readonly User: "user";
|
|
14
|
+
};
|
|
15
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PostIssueRequestBodyAssignedToRequestBody = void 0;
|
|
5
|
+
var PostIssueRequestBodyAssignedToRequestBody;
|
|
6
|
+
(function (PostIssueRequestBodyAssignedToRequestBody) {
|
|
7
|
+
/** Type of the issue assignee. Valid values: `user` */
|
|
8
|
+
PostIssueRequestBodyAssignedToRequestBody.Type = {
|
|
9
|
+
User: "user",
|
|
10
|
+
};
|
|
11
|
+
})(PostIssueRequestBodyAssignedToRequestBody || (exports.PostIssueRequestBodyAssignedToRequestBody = PostIssueRequestBodyAssignedToRequestBody = {}));
|
|
@@ -1617,6 +1617,16 @@ export * from "./IssuesPatchIssueResponseBody.js";
|
|
|
1617
1617
|
export * from "./IssuesPatchIssueServiceUnavailableErrorResponseBody.js";
|
|
1618
1618
|
export * from "./IssuesPatchIssueTooManyRequestsErrorResponseBody.js";
|
|
1619
1619
|
export * from "./IssuesPatchIssueUnauthorizedErrorResponseBody.js";
|
|
1620
|
+
export * from "./IssuesPostIssueBadGatewayErrorResponseBody.js";
|
|
1621
|
+
export * from "./IssuesPostIssueGatewayTimeoutErrorResponseBody.js";
|
|
1622
|
+
export * from "./IssuesPostIssueInternalServerErrorResponseBody.js";
|
|
1623
|
+
export * from "./IssuesPostIssueMethodNotAllowedErrorResponseBody.js";
|
|
1624
|
+
export * from "./IssuesPostIssueNotFoundErrorResponseBody.js";
|
|
1625
|
+
export * from "./IssuesPostIssueNotImplementedErrorResponseBody.js";
|
|
1626
|
+
export * from "./IssuesPostIssueResponseBody.js";
|
|
1627
|
+
export * from "./IssuesPostIssueServiceUnavailableErrorResponseBody.js";
|
|
1628
|
+
export * from "./IssuesPostIssueTooManyRequestsErrorResponseBody.js";
|
|
1629
|
+
export * from "./IssuesPostIssueUnauthorizedErrorResponseBody.js";
|
|
1620
1630
|
export * from "./J1939D1StatusDataPoint.js";
|
|
1621
1631
|
export * from "./J1939D1StatusDataPointValue.js";
|
|
1622
1632
|
export * from "./JammingDetectedResponseBody.js";
|
|
@@ -1953,6 +1963,8 @@ export * from "./PostFuelPurchaseRequestBodyDiscountRequestBody.js";
|
|
|
1953
1963
|
export * from "./PostFuelPurchaseRequestBodyPriceRequestBody.js";
|
|
1954
1964
|
export * from "./PostFuelPurchaseResponseBodyResponseBody.js";
|
|
1955
1965
|
export * from "./PostInvoiceScanResponseDataResponseBody.js";
|
|
1966
|
+
export * from "./PostIssueRequestBodyAssetRequestBody.js";
|
|
1967
|
+
export * from "./PostIssueRequestBodyAssignedToRequestBody.js";
|
|
1956
1968
|
export * from "./PostJobObjectjobLocationRequestObjectRequestBody.js";
|
|
1957
1969
|
export * from "./PostJobObjectRequestBody.js";
|
|
1958
1970
|
export * from "./PostMediaRetrievalObjectResponseBody.js";
|
|
@@ -1633,6 +1633,16 @@ __exportStar(require("./IssuesPatchIssueResponseBody.js"), exports);
|
|
|
1633
1633
|
__exportStar(require("./IssuesPatchIssueServiceUnavailableErrorResponseBody.js"), exports);
|
|
1634
1634
|
__exportStar(require("./IssuesPatchIssueTooManyRequestsErrorResponseBody.js"), exports);
|
|
1635
1635
|
__exportStar(require("./IssuesPatchIssueUnauthorizedErrorResponseBody.js"), exports);
|
|
1636
|
+
__exportStar(require("./IssuesPostIssueBadGatewayErrorResponseBody.js"), exports);
|
|
1637
|
+
__exportStar(require("./IssuesPostIssueGatewayTimeoutErrorResponseBody.js"), exports);
|
|
1638
|
+
__exportStar(require("./IssuesPostIssueInternalServerErrorResponseBody.js"), exports);
|
|
1639
|
+
__exportStar(require("./IssuesPostIssueMethodNotAllowedErrorResponseBody.js"), exports);
|
|
1640
|
+
__exportStar(require("./IssuesPostIssueNotFoundErrorResponseBody.js"), exports);
|
|
1641
|
+
__exportStar(require("./IssuesPostIssueNotImplementedErrorResponseBody.js"), exports);
|
|
1642
|
+
__exportStar(require("./IssuesPostIssueResponseBody.js"), exports);
|
|
1643
|
+
__exportStar(require("./IssuesPostIssueServiceUnavailableErrorResponseBody.js"), exports);
|
|
1644
|
+
__exportStar(require("./IssuesPostIssueTooManyRequestsErrorResponseBody.js"), exports);
|
|
1645
|
+
__exportStar(require("./IssuesPostIssueUnauthorizedErrorResponseBody.js"), exports);
|
|
1636
1646
|
__exportStar(require("./J1939D1StatusDataPoint.js"), exports);
|
|
1637
1647
|
__exportStar(require("./J1939D1StatusDataPointValue.js"), exports);
|
|
1638
1648
|
__exportStar(require("./JammingDetectedResponseBody.js"), exports);
|
|
@@ -1969,6 +1979,8 @@ __exportStar(require("./PostFuelPurchaseRequestBodyDiscountRequestBody.js"), exp
|
|
|
1969
1979
|
__exportStar(require("./PostFuelPurchaseRequestBodyPriceRequestBody.js"), exports);
|
|
1970
1980
|
__exportStar(require("./PostFuelPurchaseResponseBodyResponseBody.js"), exports);
|
|
1971
1981
|
__exportStar(require("./PostInvoiceScanResponseDataResponseBody.js"), exports);
|
|
1982
|
+
__exportStar(require("./PostIssueRequestBodyAssetRequestBody.js"), exports);
|
|
1983
|
+
__exportStar(require("./PostIssueRequestBodyAssignedToRequestBody.js"), exports);
|
|
1972
1984
|
__exportStar(require("./PostJobObjectjobLocationRequestObjectRequestBody.js"), exports);
|
|
1973
1985
|
__exportStar(require("./PostJobObjectRequestBody.js"), exports);
|
|
1974
1986
|
__exportStar(require("./PostMediaRetrievalObjectResponseBody.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "13.
|
|
1
|
+
export declare const SDK_VERSION = "13.5.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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": "13.
|
|
11
|
-
"User-Agent": "@samsarahq/samsara/13.
|
|
10
|
+
"X-Fern-SDK-Version": "13.5.0",
|
|
11
|
+
"User-Agent": "@samsarahq/samsara/13.5.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",
|
|
@@ -38,6 +38,39 @@ export declare class IssuesClient {
|
|
|
38
38
|
*/
|
|
39
39
|
getIssues(request?: Samsara.GetIssuesRequest, requestOptions?: IssuesClient.RequestOptions): core.HttpResponsePromise<Samsara.IssuesGetIssuesResponseBody>;
|
|
40
40
|
private __getIssues;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new issue associated with an asset, with optional media attachments uploaded inline as base64.
|
|
43
|
+
*
|
|
44
|
+
* <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>).
|
|
45
|
+
*
|
|
46
|
+
* To use this endpoint, select **Write Issues** under the Forms 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>
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* **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.
|
|
50
|
+
*
|
|
51
|
+
* @param {Samsara.IssuesPostIssueRequestBody} request
|
|
52
|
+
* @param {IssuesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Samsara.UnauthorizedError}
|
|
55
|
+
* @throws {@link Samsara.NotFoundError}
|
|
56
|
+
* @throws {@link Samsara.MethodNotAllowedError}
|
|
57
|
+
* @throws {@link Samsara.TooManyRequestsError}
|
|
58
|
+
* @throws {@link Samsara.InternalServerError}
|
|
59
|
+
* @throws {@link Samsara.NotImplementedError}
|
|
60
|
+
* @throws {@link Samsara.BadGatewayError}
|
|
61
|
+
* @throws {@link Samsara.ServiceUnavailableError}
|
|
62
|
+
* @throws {@link Samsara.GatewayTimeoutError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.issues.postIssue({
|
|
66
|
+
* asset: {
|
|
67
|
+
* id: "hertzAssetId:HZ-100423"
|
|
68
|
+
* },
|
|
69
|
+
* title: "Front bumper scratch"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
postIssue(request: Samsara.IssuesPostIssueRequestBody, requestOptions?: IssuesClient.RequestOptions): core.HttpResponsePromise<Samsara.IssuesPostIssueResponseBody>;
|
|
73
|
+
private __postIssue;
|
|
41
74
|
/**
|
|
42
75
|
* Updates an instance of an issue.
|
|
43
76
|
*
|