@nativesquare/soma 0.16.0 → 0.16.1
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/package.json +1 -1
- package/src/client/garmin.ts +13 -0
package/package.json
CHANGED
package/src/client/garmin.ts
CHANGED
|
@@ -685,6 +685,16 @@ export class SomaGarmin {
|
|
|
685
685
|
return new Response("Invalid JSON body", { status: 400 });
|
|
686
686
|
}
|
|
687
687
|
|
|
688
|
+
const rawItemCount = Array.isArray(payload)
|
|
689
|
+
? payload.length
|
|
690
|
+
: payload && typeof payload === "object"
|
|
691
|
+
? (Object.values(payload)[0] as unknown[] | undefined)
|
|
692
|
+
?.length ?? 0
|
|
693
|
+
: 0;
|
|
694
|
+
console.log(
|
|
695
|
+
`[soma:garmin:webhook] received dataType=${dataType} items=${rawItemCount}`,
|
|
696
|
+
);
|
|
697
|
+
|
|
688
698
|
let result: GarminWebhookActionResult | undefined;
|
|
689
699
|
try {
|
|
690
700
|
result = await ctx.runAction(route.action, { payload, autoIngest });
|
|
@@ -697,6 +707,9 @@ export class SomaGarmin {
|
|
|
697
707
|
}
|
|
698
708
|
|
|
699
709
|
if (result) {
|
|
710
|
+
console.log(
|
|
711
|
+
`[soma:garmin:webhook] processed dataType=${dataType} items=${result.items.length} errors=${result.errors.length}`,
|
|
712
|
+
);
|
|
700
713
|
const event: GarminWebhookEvent = {
|
|
701
714
|
dataType,
|
|
702
715
|
errors: result.errors,
|