@samsarahq/samsara 11.2.0 → 11.4.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 (28) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/assets/client/Client.js +2 -1
  3. package/dist/cjs/api/resources/assets/client/requests/AssetsCreateAssetRequestBody.d.ts +5 -0
  4. package/dist/cjs/api/resources/assets/client/requests/ListAssetsRequest.d.ts +2 -0
  5. package/dist/cjs/api/resources/betaApIs/client/Client.d.ts +0 -1
  6. package/dist/cjs/api/resources/betaApIs/client/Client.js +0 -1
  7. package/dist/cjs/api/resources/betaApIs/client/requests/ReadingsPostReadingsRequestBody.d.ts +0 -1
  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/types/ReadingDatapointRequestBody.d.ts +4 -2
  12. package/dist/cjs/version.d.ts +1 -1
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/esm/BaseClient.mjs +2 -2
  15. package/dist/esm/api/resources/assets/client/Client.mjs +2 -1
  16. package/dist/esm/api/resources/assets/client/requests/AssetsCreateAssetRequestBody.d.mts +5 -0
  17. package/dist/esm/api/resources/assets/client/requests/ListAssetsRequest.d.mts +2 -0
  18. package/dist/esm/api/resources/betaApIs/client/Client.d.mts +0 -1
  19. package/dist/esm/api/resources/betaApIs/client/Client.mjs +0 -1
  20. package/dist/esm/api/resources/betaApIs/client/requests/ReadingsPostReadingsRequestBody.d.mts +0 -1
  21. package/dist/esm/api/resources/media/client/Client.d.mts +1 -1
  22. package/dist/esm/api/resources/media/client/Client.mjs +1 -1
  23. package/dist/esm/api/resources/media/client/requests/MediaRetrievalPostMediaRetrievalRequestBody.d.mts +1 -1
  24. package/dist/esm/api/types/ReadingDatapointRequestBody.d.mts +4 -2
  25. package/dist/esm/version.d.mts +1 -1
  26. package/dist/esm/version.mjs +1 -1
  27. package/package.json +1 -1
  28. package/reference.md +1 -2
@@ -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.2.0",
48
- "User-Agent": "@samsarahq/samsara/11.2.0",
47
+ "X-Fern-SDK-Version": "11.4.0",
48
+ "User-Agent": "@samsarahq/samsara/11.4.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",
@@ -96,7 +96,7 @@ class AssetsClient {
96
96
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
97
97
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
98
98
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
99
- const { type: type_, after, updatedAfterTime, includeExternalIds, includeTags, tagIds, parentTagIds, ids, attributeValueIds, attributes, } = request;
99
+ const { type: type_, after, updatedAfterTime, includeExternalIds, includeTags, tagIds, parentTagIds, ids, externalIds, attributeValueIds, attributes, } = request;
100
100
  const _queryParams = {
101
101
  type: type_ != null ? type_ : undefined,
102
102
  after,
@@ -106,6 +106,7 @@ class AssetsClient {
106
106
  tagIds,
107
107
  parentTagIds,
108
108
  ids,
109
+ externalIds,
109
110
  attributeValueIds,
110
111
  attributes,
111
112
  };
@@ -1,8 +1,11 @@
1
+ import type * as Samsara from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {}
4
5
  */
5
6
  export interface AssetsCreateAssetRequestBody {
7
+ /** A list of attributes to assign to the asset. */
8
+ attributes?: Samsara.GoaAttributeTinyRequestBody[];
6
9
  /** A map of external ids */
7
10
  externalIds?: Record<string, string>;
8
11
  /** The license plate of the asset. */
@@ -21,6 +24,8 @@ export interface AssetsCreateAssetRequestBody {
21
24
  regulationMode?: AssetsCreateAssetRequestBody.RegulationMode;
22
25
  /** The serial number of the asset. This can be an internal serial number or used to hold legacy VIN/PIN numbers such as ones of shorter lengths. */
23
26
  serialNumber?: string;
27
+ /** An array of IDs of tags to associate with this asset. If your access to the API is scoped by one or more tags, this field is required to pass in. */
28
+ tagIds?: string[];
24
29
  /** The operational context in which the asset interacts with the Samsara system. Examples: Vehicle (eg: truck, bus...), Trailer (eg: dry van, reefer, flatbed...), Powered Equipment (eg: dozer, crane...), Unpowered Equipment (eg: container, dumpster...), or Uncategorized. Valid values: `uncategorized`, `trailer`, `equipment`, `unpowered`, `vehicle` */
25
30
  type?: AssetsCreateAssetRequestBody.Type;
26
31
  /** The unique 17-digit VIN (Vehicle Identification Number) or PIN (Product Identification Number) of the asset. */
@@ -20,6 +20,8 @@ export interface ListAssetsRequest {
20
20
  parentTagIds?: string;
21
21
  /** A filter on the data based on this comma-separated list of asset IDs and External IDs. */
22
22
  ids?: string | string[];
23
+ /** A filter on the data based on this comma-separated list of external IDs. Example: `externalIds=maintenanceId:250020,vin:1HGBH41JXMN109186` */
24
+ externalIds?: string | string[];
23
25
  /** A filter on the data based on this comma-separated list of attribute value IDs. Only entities associated with ALL of the referenced values will be returned (i.e. the intersection of the sets of entities with each value). Example: `attributeValueIds=076efac2-83b5-47aa-ba36-18428436dcac,6707b3f0-23b9-4fe3-b7be-11be34aea544` */
24
26
  attributeValueIds?: string;
25
27
  /** A filter on the data to return entities within given range query (only for numeric and date attributes) separated by a comma. Only entities meeting all the conditions will be returned. At least one bound must be provided. Example: `attributes=Length:range(8,)&attributes=Length:range(10,20)&attributes=Date:range(2025-01-01,2025-01-31)` */
@@ -1323,7 +1323,6 @@ export declare class BetaApIsClient {
1323
1323
  * @example
1324
1324
  * await client.betaApIs.postReadings({
1325
1325
  * data: [{
1326
- * entityId: "123451234512345",
1327
1326
  * entityType: "asset",
1328
1327
  * happenedAtTime: "2023-10-27T10:00:00Z",
1329
1328
  * readingId: "airInletPressure",
@@ -3826,7 +3826,6 @@ class BetaApIsClient {
3826
3826
  * @example
3827
3827
  * await client.betaApIs.postReadings({
3828
3828
  * data: [{
3829
- * entityId: "123451234512345",
3830
3829
  * entityType: "asset",
3831
3830
  * happenedAtTime: "2023-10-27T10:00:00Z",
3832
3831
  * readingId: "airInletPressure",
@@ -3,7 +3,6 @@ import type * as Samsara from "../../../../index.js";
3
3
  * @example
4
4
  * {
5
5
  * data: [{
6
- * entityId: "123451234512345",
7
6
  * entityType: "asset",
8
7
  * happenedAtTime: "2023-10-27T10:00:00Z",
9
8
  * readingId: "airInletPressure",
@@ -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"
@@ -2,10 +2,12 @@
2
2
  * A single reading data point to be created.
3
3
  */
4
4
  export interface ReadingDatapointRequestBody {
5
- /** Samsara entity ID. In case of an asset, it’s the assetId. If the asset is not yet present in the system, it is required to create a new one via the /assets endpoint. */
6
- entityId: string;
5
+ /** Samsara entity ID. Required if externalId is not provided. In case of an asset, it’s the assetId. If the asset is not yet present in the system, it is required to create a new one via the /assets endpoint. */
6
+ entityId?: string | undefined;
7
7
  /** The type of the entity (e.g., asset). Valid values: `asset` */
8
8
  entityType: ReadingDatapointRequestBody.EntityType;
9
+ /** An external ID in key:value format. Required if entityId is not provided. Use this to reference an asset by its external ID instead of the Samsara entity ID. */
10
+ externalId?: string | undefined;
9
11
  /** The timestamp of when the reading happened in RFC 3339 format. happenedAtTime must not be older than the last known reading for the same series. */
10
12
  happenedAtTime: string;
11
13
  /** The ID of the reading, you can get it from the /readings/definitions endpoint. */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "11.2.0";
1
+ export declare const SDK_VERSION = "11.4.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 = "11.2.0";
4
+ exports.SDK_VERSION = "11.4.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": "11.2.0",
11
- "User-Agent": "@samsarahq/samsara/11.2.0",
10
+ "X-Fern-SDK-Version": "11.4.0",
11
+ "User-Agent": "@samsarahq/samsara/11.4.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",
@@ -60,7 +60,7 @@ export class AssetsClient {
60
60
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
61
61
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
62
62
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
63
- const { type: type_, after, updatedAfterTime, includeExternalIds, includeTags, tagIds, parentTagIds, ids, attributeValueIds, attributes, } = request;
63
+ const { type: type_, after, updatedAfterTime, includeExternalIds, includeTags, tagIds, parentTagIds, ids, externalIds, attributeValueIds, attributes, } = request;
64
64
  const _queryParams = {
65
65
  type: type_ != null ? type_ : undefined,
66
66
  after,
@@ -70,6 +70,7 @@ export class AssetsClient {
70
70
  tagIds,
71
71
  parentTagIds,
72
72
  ids,
73
+ externalIds,
73
74
  attributeValueIds,
74
75
  attributes,
75
76
  };
@@ -1,8 +1,11 @@
1
+ import type * as Samsara from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {}
4
5
  */
5
6
  export interface AssetsCreateAssetRequestBody {
7
+ /** A list of attributes to assign to the asset. */
8
+ attributes?: Samsara.GoaAttributeTinyRequestBody[];
6
9
  /** A map of external ids */
7
10
  externalIds?: Record<string, string>;
8
11
  /** The license plate of the asset. */
@@ -21,6 +24,8 @@ export interface AssetsCreateAssetRequestBody {
21
24
  regulationMode?: AssetsCreateAssetRequestBody.RegulationMode;
22
25
  /** The serial number of the asset. This can be an internal serial number or used to hold legacy VIN/PIN numbers such as ones of shorter lengths. */
23
26
  serialNumber?: string;
27
+ /** An array of IDs of tags to associate with this asset. If your access to the API is scoped by one or more tags, this field is required to pass in. */
28
+ tagIds?: string[];
24
29
  /** The operational context in which the asset interacts with the Samsara system. Examples: Vehicle (eg: truck, bus...), Trailer (eg: dry van, reefer, flatbed...), Powered Equipment (eg: dozer, crane...), Unpowered Equipment (eg: container, dumpster...), or Uncategorized. Valid values: `uncategorized`, `trailer`, `equipment`, `unpowered`, `vehicle` */
25
30
  type?: AssetsCreateAssetRequestBody.Type;
26
31
  /** The unique 17-digit VIN (Vehicle Identification Number) or PIN (Product Identification Number) of the asset. */
@@ -20,6 +20,8 @@ export interface ListAssetsRequest {
20
20
  parentTagIds?: string;
21
21
  /** A filter on the data based on this comma-separated list of asset IDs and External IDs. */
22
22
  ids?: string | string[];
23
+ /** A filter on the data based on this comma-separated list of external IDs. Example: `externalIds=maintenanceId:250020,vin:1HGBH41JXMN109186` */
24
+ externalIds?: string | string[];
23
25
  /** A filter on the data based on this comma-separated list of attribute value IDs. Only entities associated with ALL of the referenced values will be returned (i.e. the intersection of the sets of entities with each value). Example: `attributeValueIds=076efac2-83b5-47aa-ba36-18428436dcac,6707b3f0-23b9-4fe3-b7be-11be34aea544` */
24
26
  attributeValueIds?: string;
25
27
  /** A filter on the data to return entities within given range query (only for numeric and date attributes) separated by a comma. Only entities meeting all the conditions will be returned. At least one bound must be provided. Example: `attributes=Length:range(8,)&attributes=Length:range(10,20)&attributes=Date:range(2025-01-01,2025-01-31)` */
@@ -1323,7 +1323,6 @@ export declare class BetaApIsClient {
1323
1323
  * @example
1324
1324
  * await client.betaApIs.postReadings({
1325
1325
  * data: [{
1326
- * entityId: "123451234512345",
1327
1326
  * entityType: "asset",
1328
1327
  * happenedAtTime: "2023-10-27T10:00:00Z",
1329
1328
  * readingId: "airInletPressure",
@@ -3790,7 +3790,6 @@ export class BetaApIsClient {
3790
3790
  * @example
3791
3791
  * await client.betaApIs.postReadings({
3792
3792
  * data: [{
3793
- * entityId: "123451234512345",
3794
3793
  * entityType: "asset",
3795
3794
  * happenedAtTime: "2023-10-27T10:00:00Z",
3796
3795
  * readingId: "airInletPressure",
@@ -3,7 +3,6 @@ import type * as Samsara from "../../../../index.mjs";
3
3
  * @example
4
4
  * {
5
5
  * data: [{
6
- * entityId: "123451234512345",
7
6
  * entityType: "asset",
8
7
  * happenedAtTime: "2023-10-27T10:00:00Z",
9
8
  * readingId: "airInletPressure",
@@ -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"
@@ -238,7 +238,7 @@ export class MediaClient {
238
238
  * @example
239
239
  * await client.media.postMediaRetrieval({
240
240
  * endTime: "2019-06-13T19:08:55Z",
241
- * inputs: ["dashcamRoadFacing", "dashcamRoadFacing", "dashcamRoadFacing"],
241
+ * inputs: ["dashcamRoadFacing", "dashcamRoadFacing"],
242
242
  * mediaType: "image",
243
243
  * startTime: "2019-06-13T19:08:25Z",
244
244
  * 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"
@@ -2,10 +2,12 @@
2
2
  * A single reading data point to be created.
3
3
  */
4
4
  export interface ReadingDatapointRequestBody {
5
- /** Samsara entity ID. In case of an asset, it’s the assetId. If the asset is not yet present in the system, it is required to create a new one via the /assets endpoint. */
6
- entityId: string;
5
+ /** Samsara entity ID. Required if externalId is not provided. In case of an asset, it’s the assetId. If the asset is not yet present in the system, it is required to create a new one via the /assets endpoint. */
6
+ entityId?: string | undefined;
7
7
  /** The type of the entity (e.g., asset). Valid values: `asset` */
8
8
  entityType: ReadingDatapointRequestBody.EntityType;
9
+ /** An external ID in key:value format. Required if entityId is not provided. Use this to reference an asset by its external ID instead of the Samsara entity ID. */
10
+ externalId?: string | undefined;
9
11
  /** The timestamp of when the reading happened in RFC 3339 format. happenedAtTime must not be older than the last known reading for the same series. */
10
12
  happenedAtTime: string;
11
13
  /** The ID of the reading, you can get it from the /readings/definitions endpoint. */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "11.2.0";
1
+ export declare const SDK_VERSION = "11.4.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "11.2.0";
1
+ export const SDK_VERSION = "11.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samsarahq/samsara",
3
- "version": "11.2.0",
3
+ "version": "11.4.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -4577,7 +4577,6 @@ To use this endpoint, select **Write Readings** under the Closed Beta category w
4577
4577
  ```typescript
4578
4578
  await client.betaApIs.postReadings({
4579
4579
  data: [{
4580
- entityId: "123451234512345",
4581
4580
  entityType: "asset",
4582
4581
  happenedAtTime: "2023-10-27T10:00:00Z",
4583
4582
  readingId: "airInletPressure",
@@ -6894,7 +6893,7 @@ To use this endpoint, select **Write Media Retrieval** under the Safety & Camera
6894
6893
  ```typescript
6895
6894
  await client.media.postMediaRetrieval({
6896
6895
  endTime: "2019-06-13T19:08:55Z",
6897
- inputs: ["dashcamRoadFacing", "dashcamRoadFacing", "dashcamRoadFacing"],
6896
+ inputs: ["dashcamRoadFacing", "dashcamRoadFacing"],
6898
6897
  mediaType: "image",
6899
6898
  startTime: "2019-06-13T19:08:25Z",
6900
6899
  vehicleId: "1234"