skikrumb-api 2.1.12 → 2.1.14
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/index.d.ts +11 -1
- package/dist/index.js +23 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare const skiKrumb: (options?: {
|
|
|
36
36
|
readDevices: (devices: QueryDevice | string) => Promise<Device[]>;
|
|
37
37
|
readApiKeys: () => Promise<apiKeys>;
|
|
38
38
|
readDeviceDailyDistance: (deviceSerialNumber: string) => Promise<unknown>;
|
|
39
|
-
readDeviceData: (deviceSerialNumber: string,
|
|
39
|
+
readDeviceData: (deviceSerialNumber: string, query: QueryDevice) => Promise<unknown>;
|
|
40
40
|
readDataForDevices: (query: QueryDevice) => Promise<Device[]>;
|
|
41
41
|
readOrganizationData: () => Promise<Data[]>;
|
|
42
42
|
readGateways: () => Promise<Gateways>;
|
|
@@ -63,6 +63,16 @@ export declare const skiKrumb: (options?: {
|
|
|
63
63
|
}>;
|
|
64
64
|
getReplayData: (serialNumber: string, date: string, timezone?: string, size?: number) => Promise<any>;
|
|
65
65
|
getDailyStats: (serialNumber: string, date: string, timezone?: string) => Promise<any>;
|
|
66
|
+
getActivityDates: (serialNumber: string, timezone?: string) => Promise<{
|
|
67
|
+
success: boolean;
|
|
68
|
+
dates?: string[] | undefined;
|
|
69
|
+
metadata?: {
|
|
70
|
+
serial_number: string;
|
|
71
|
+
timezone: string;
|
|
72
|
+
count: number;
|
|
73
|
+
} | undefined;
|
|
74
|
+
error?: any;
|
|
75
|
+
}>;
|
|
66
76
|
getAccessibleProfiles: () => Promise<{
|
|
67
77
|
success: boolean;
|
|
68
78
|
accessibleProfiles: any[];
|
package/dist/index.js
CHANGED
|
@@ -282,11 +282,12 @@ export const skiKrumb = (options = {
|
|
|
282
282
|
throw error;
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
|
-
const readDeviceData = async (deviceSerialNumber,
|
|
285
|
+
const readDeviceData = async (deviceSerialNumber, query) => {
|
|
286
286
|
try {
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
const response = await requestWithTimeZone
|
|
288
|
+
.get(`devices/data/${deviceSerialNumber}`, {
|
|
289
|
+
searchParams: new URLSearchParams({ ...query }),
|
|
290
|
+
})
|
|
290
291
|
.json();
|
|
291
292
|
return response;
|
|
292
293
|
}
|
|
@@ -500,6 +501,23 @@ export const skiKrumb = (options = {
|
|
|
500
501
|
.json();
|
|
501
502
|
return response;
|
|
502
503
|
};
|
|
504
|
+
const getActivityDates = async (serialNumber, timezone = 'America/Vancouver') => {
|
|
505
|
+
const requestWithAuth = ky.create({
|
|
506
|
+
prefixUrl: options.url,
|
|
507
|
+
headers: {
|
|
508
|
+
'Content-Type': 'application/json',
|
|
509
|
+
Authorization: `Bearer ${options.apiKey}`,
|
|
510
|
+
'supabase-auth-token': options.supabaseToken || '',
|
|
511
|
+
'x-client': options.requestedWith,
|
|
512
|
+
},
|
|
513
|
+
});
|
|
514
|
+
const response = await requestWithAuth
|
|
515
|
+
.get(`data/activity-dates/${serialNumber}`, {
|
|
516
|
+
searchParams: { timezone },
|
|
517
|
+
})
|
|
518
|
+
.json();
|
|
519
|
+
return response;
|
|
520
|
+
};
|
|
503
521
|
const getAccessibleProfiles = async () => {
|
|
504
522
|
const requestWithAuth = ky.create({
|
|
505
523
|
prefixUrl: options.url,
|
|
@@ -594,6 +612,7 @@ export const skiKrumb = (options = {
|
|
|
594
612
|
updateFamilyShare,
|
|
595
613
|
getReplayData,
|
|
596
614
|
getDailyStats,
|
|
615
|
+
getActivityDates,
|
|
597
616
|
getAccessibleProfiles,
|
|
598
617
|
getLatestDeviceData,
|
|
599
618
|
createRealtimeClient,
|