Skip to content

Commit

Permalink
feat: add configuration device config get request
Browse files Browse the repository at this point in the history
  • Loading branch information
Rymul committed Nov 17, 2023
1 parent 7bda667 commit d3761da
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/InboundGarminWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Buffer } from 'node:buffer';
import { request } from './request';
import type {
BaseGetOpts,
DeviceConfig,
DevicesKey,
EmergencyState,
History,
Expand Down Expand Up @@ -182,4 +183,15 @@ export class InboundGarminWrapper {
const opts = Object.assign(this.baseGetOpts, options);
return await request<Version>(`https://${this.IPCUrl}/IPCInbound/V1/Pingback.svc/Version`, opts);
}

/**
* @see https://explore.garmin.com/IPCInbound/docs/#!/Configuration.svc/GetAvailableConfigurationsGET
*
* @params options
*/

public async getConfigurationDeviceConfig(options: RequestInit = {}) {
const opts = Object.assign(this.baseGetOpts, options);
return await request<DeviceConfig>(`https://${this.IPCUrl}/IPCInbound/V1/Configuration.svc/DeviceConfig`, opts);
}
}
21 changes: 21 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,24 @@ export type EmergencyState = {
IMEI: number;
State: string;
};

export type DeviceConfig = {
AcceptedValues: string;
AcceptedValuesDesc: string;
BundleTrackEnabled: boolean;
Category: string;
ConfigEditable: boolean;
ConfigRemovable: boolean;
ConsumerEnabled: boolean;
DefaultConfig: string;
DefaultSetting: string;
Description: string | null;
DeviceKey: number;
DeviceTypes: number;
DisplayName: string;
EnterpriseEnabled: boolean;
ExploreExposed: boolean;
Id: number;
Name: string;
UnitString: string | null;
};

0 comments on commit d3761da

Please sign in to comment.