skikrumb-api 2.1.14 → 2.1.16
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/.claude/settings.local.json +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +46 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare const skiKrumb: (options?: {
|
|
|
62
62
|
error?: any;
|
|
63
63
|
}>;
|
|
64
64
|
getReplayData: (serialNumber: string, date: string, timezone?: string, size?: number) => Promise<any>;
|
|
65
|
+
getReplayFull: (serialNumber: string, date: string, timezone?: string, size?: number) => Promise<any>;
|
|
65
66
|
getDailyStats: (serialNumber: string, date: string, timezone?: string) => Promise<any>;
|
|
66
67
|
getActivityDates: (serialNumber: string, timezone?: string) => Promise<{
|
|
67
68
|
success: boolean;
|
|
@@ -73,6 +74,7 @@ export declare const skiKrumb: (options?: {
|
|
|
73
74
|
} | undefined;
|
|
74
75
|
error?: any;
|
|
75
76
|
}>;
|
|
77
|
+
getLeaderboardStats: (serialNumbers: string[], startDate: string, endDate: string, timezone?: string) => Promise<any>;
|
|
76
78
|
getAccessibleProfiles: () => Promise<{
|
|
77
79
|
success: boolean;
|
|
78
80
|
accessibleProfiles: any[];
|
package/dist/index.js
CHANGED
|
@@ -470,6 +470,7 @@ export const skiKrumb = (options = {
|
|
|
470
470
|
const getReplayData = async (serialNumber, date, timezone = 'America/Vancouver', size = 10000) => {
|
|
471
471
|
const requestWithAuth = ky.create({
|
|
472
472
|
prefixUrl: options.url,
|
|
473
|
+
timeout: 60000,
|
|
473
474
|
headers: {
|
|
474
475
|
'Content-Type': 'application/json',
|
|
475
476
|
Authorization: `Bearer ${options.apiKey}`,
|
|
@@ -484,9 +485,28 @@ export const skiKrumb = (options = {
|
|
|
484
485
|
.json();
|
|
485
486
|
return response;
|
|
486
487
|
};
|
|
488
|
+
const getReplayFull = async (serialNumber, date, timezone = 'America/Vancouver', size = 10000) => {
|
|
489
|
+
const requestWithAuth = ky.create({
|
|
490
|
+
prefixUrl: options.url,
|
|
491
|
+
timeout: 60000,
|
|
492
|
+
headers: {
|
|
493
|
+
'Content-Type': 'application/json',
|
|
494
|
+
Authorization: `Bearer ${options.apiKey}`,
|
|
495
|
+
'supabase-auth-token': options.supabaseToken || '',
|
|
496
|
+
'x-client': options.requestedWith,
|
|
497
|
+
},
|
|
498
|
+
});
|
|
499
|
+
const response = await requestWithAuth
|
|
500
|
+
.get(`data/replay-full/${serialNumber}`, {
|
|
501
|
+
searchParams: { date, timezone, size },
|
|
502
|
+
})
|
|
503
|
+
.json();
|
|
504
|
+
return response;
|
|
505
|
+
};
|
|
487
506
|
const getDailyStats = async (serialNumber, date, timezone = 'America/Vancouver') => {
|
|
488
507
|
const requestWithAuth = ky.create({
|
|
489
508
|
prefixUrl: options.url,
|
|
509
|
+
timeout: 60000,
|
|
490
510
|
headers: {
|
|
491
511
|
'Content-Type': 'application/json',
|
|
492
512
|
Authorization: `Bearer ${options.apiKey}`,
|
|
@@ -504,6 +524,7 @@ export const skiKrumb = (options = {
|
|
|
504
524
|
const getActivityDates = async (serialNumber, timezone = 'America/Vancouver') => {
|
|
505
525
|
const requestWithAuth = ky.create({
|
|
506
526
|
prefixUrl: options.url,
|
|
527
|
+
timeout: 60000,
|
|
507
528
|
headers: {
|
|
508
529
|
'Content-Type': 'application/json',
|
|
509
530
|
Authorization: `Bearer ${options.apiKey}`,
|
|
@@ -518,6 +539,29 @@ export const skiKrumb = (options = {
|
|
|
518
539
|
.json();
|
|
519
540
|
return response;
|
|
520
541
|
};
|
|
542
|
+
const getLeaderboardStats = async (serialNumbers, startDate, endDate, timezone = 'America/Vancouver') => {
|
|
543
|
+
const requestWithAuth = ky.create({
|
|
544
|
+
prefixUrl: options.url,
|
|
545
|
+
timeout: 60000,
|
|
546
|
+
headers: {
|
|
547
|
+
'Content-Type': 'application/json',
|
|
548
|
+
Authorization: `Bearer ${options.apiKey}`,
|
|
549
|
+
'supabase-auth-token': options.supabaseToken || '',
|
|
550
|
+
'x-client': options.requestedWith,
|
|
551
|
+
'TimeZone': timezone,
|
|
552
|
+
},
|
|
553
|
+
});
|
|
554
|
+
const response = await requestWithAuth
|
|
555
|
+
.get('stats/leaderboard', {
|
|
556
|
+
searchParams: {
|
|
557
|
+
serials: serialNumbers.join(','),
|
|
558
|
+
startDate,
|
|
559
|
+
endDate,
|
|
560
|
+
},
|
|
561
|
+
})
|
|
562
|
+
.json();
|
|
563
|
+
return response;
|
|
564
|
+
};
|
|
521
565
|
const getAccessibleProfiles = async () => {
|
|
522
566
|
const requestWithAuth = ky.create({
|
|
523
567
|
prefixUrl: options.url,
|
|
@@ -611,8 +655,10 @@ export const skiKrumb = (options = {
|
|
|
611
655
|
deleteFamilyShare,
|
|
612
656
|
updateFamilyShare,
|
|
613
657
|
getReplayData,
|
|
658
|
+
getReplayFull,
|
|
614
659
|
getDailyStats,
|
|
615
660
|
getActivityDates,
|
|
661
|
+
getLeaderboardStats,
|
|
616
662
|
getAccessibleProfiles,
|
|
617
663
|
getLatestDeviceData,
|
|
618
664
|
createRealtimeClient,
|