@quoll/client-lib
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [0.4.0](https://github.com/mzogheib/quoll/compare/@quoll/client-lib@0.3.0...@quoll/client-lib@0.4.0) (2024-02-10) | ||
### Features | ||
- **client-lib:** add a strava activity adapter ([04c92d0](https://github.com/mzogheib/quoll/commit/04c92d08a793b9fcf1ab04a96adc1b7a65c57a81)) | ||
- **client-lib:** add date, distance and random string utilities ([a2b8183](https://github.com/mzogheib/quoll/commit/a2b81834a25c9b140d1e3191a017eab59eda2d38)) | ||
- **client-lib:** add velomobile to strava adapter ([6861af0](https://github.com/mzogheib/quoll/commit/6861af0dcefbb168aad3de03d14ff546ce84e398)) | ||
# [0.3.0](https://github.com/mzogheib/quoll/compare/@quoll/client-lib@0.2.1...@quoll/client-lib@0.3.0) (2024-02-09) | ||
@@ -8,0 +16,0 @@ |
export * from "./model"; | ||
export * from "./service"; | ||
export * from "./types"; | ||
export * from "./feed-adapters"; |
@@ -20,1 +20,2 @@ "use strict"; | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./feed-adapters"), exports); |
import { FeedName } from "../feeds/types"; | ||
export declare enum TimelineEntryType { | ||
Bike = "bike", | ||
Bus = "bus", | ||
Car = "car", | ||
EBike = "e-bike", | ||
Expense = "expense", | ||
Ferry = "ferry", | ||
Flight = "flight", | ||
Hike = "hike", | ||
Home = "home", | ||
Motorcycle = "motorcycle", | ||
Photo = "photo", | ||
Place = "place", | ||
Run = "run", | ||
Train = "train", | ||
Tram = "tram", | ||
Transport = "transport", | ||
Video = "video", | ||
Walk = "walk", | ||
Work = "work", | ||
Yoga = "yoga" | ||
export type TimelineEntryType = "bike" | "bus" | "car" | "e-bike" | "expense" | "ferry" | "flight" | "hike" | "home" | "motorcycle" | "photo" | "place" | "run" | "train" | "tram" | "transport" | "unknown" | "velomobile" | "video" | "walk" | "work" | "yoga"; | ||
export interface TimelineEntryLocation { | ||
latitude: number; | ||
longitude: number; | ||
} | ||
interface TimelineEntryLocation { | ||
latitude?: number; | ||
longitude?: number; | ||
} | ||
export type TimelineEntry = { | ||
@@ -37,7 +16,6 @@ id: string; | ||
description: string | null; | ||
locationStart: TimelineEntryLocation; | ||
locationEnd: TimelineEntryLocation; | ||
locationStart: TimelineEntryLocation | null; | ||
locationEnd: TimelineEntryLocation | null; | ||
polyline: string | null; | ||
mediaUri: string | null; | ||
}; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TimelineEntryType = void 0; | ||
var TimelineEntryType; | ||
(function (TimelineEntryType) { | ||
TimelineEntryType["Bike"] = "bike"; | ||
TimelineEntryType["Bus"] = "bus"; | ||
TimelineEntryType["Car"] = "car"; | ||
TimelineEntryType["EBike"] = "e-bike"; | ||
TimelineEntryType["Expense"] = "expense"; | ||
TimelineEntryType["Ferry"] = "ferry"; | ||
TimelineEntryType["Flight"] = "flight"; | ||
TimelineEntryType["Hike"] = "hike"; | ||
TimelineEntryType["Home"] = "home"; | ||
TimelineEntryType["Motorcycle"] = "motorcycle"; | ||
TimelineEntryType["Photo"] = "photo"; | ||
TimelineEntryType["Place"] = "place"; | ||
TimelineEntryType["Run"] = "run"; | ||
TimelineEntryType["Train"] = "train"; | ||
TimelineEntryType["Tram"] = "tram"; | ||
TimelineEntryType["Transport"] = "transport"; | ||
TimelineEntryType["Video"] = "video"; | ||
TimelineEntryType["Walk"] = "walk"; | ||
TimelineEntryType["Work"] = "work"; | ||
TimelineEntryType["Yoga"] = "yoga"; | ||
})(TimelineEntryType || (exports.TimelineEntryType = TimelineEntryType = {})); |
@@ -9,1 +9,9 @@ /** | ||
export type ISO8601Date = string; | ||
/** | ||
* A date string formatted as `YYYY-MM-DDTHH:MM:SSZ`. | ||
* | ||
* @remarks the purpose of this type is to add meaning to date variables that | ||
* need to take this format. It could be enhanced to enforce the string | ||
* structure but that becomes overly complicated | ||
*/ | ||
export type ISO8601DateAndTime = string; |
@@ -0,1 +1,2 @@ | ||
import { ISO8601Date, ISO8601DateAndTime } from "../../types"; | ||
/** | ||
@@ -32,2 +33,7 @@ * Offsets a date by the input number of days. | ||
*/ | ||
export declare const makeISO8601Date: (date: Date) => string; | ||
export declare const makeISO8601Date: (date: Date) => ISO8601Date; | ||
/** | ||
* @param date a full date and time in ISO 8601 format | ||
* @returns the number of seconds since the epock | ||
*/ | ||
export declare const getUnixTimestamp: (date: ISO8601DateAndTime) => number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.makeISO8601Date = exports.getStartOfDay = exports.getEndOfDay = exports.getOffsetDate = void 0; | ||
exports.getUnixTimestamp = exports.makeISO8601Date = exports.getStartOfDay = exports.getEndOfDay = exports.getOffsetDate = void 0; | ||
/** | ||
@@ -56,1 +56,7 @@ * Offsets a date by the input number of days. | ||
exports.makeISO8601Date = makeISO8601Date; | ||
/** | ||
* @param date a full date and time in ISO 8601 format | ||
* @returns the number of seconds since the epock | ||
*/ | ||
const getUnixTimestamp = (date) => Math.floor(new Date(date).getTime() / 1000); | ||
exports.getUnixTimestamp = getUnixTimestamp; |
{ | ||
"name": "@quoll/client-lib", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Shared code for client side packages", | ||
@@ -30,3 +30,3 @@ "repository": "https://github.com/mzogheib/quoll", | ||
}, | ||
"gitHead": "ac9d91f49bb589922ba8f662364e13778dc875cd" | ||
"gitHead": "ec06dc8b504b7f29c32455656f73e51426e88705" | ||
} |
export * from "./model"; | ||
export * from "./service"; | ||
export * from "./types"; | ||
export * from "./feed-adapters"; |
import { FeedName } from "../feeds/types"; | ||
export enum TimelineEntryType { | ||
Bike = "bike", | ||
Bus = "bus", | ||
Car = "car", | ||
EBike = "e-bike", | ||
Expense = "expense", | ||
Ferry = "ferry", | ||
Flight = "flight", | ||
Hike = "hike", | ||
Home = "home", | ||
Motorcycle = "motorcycle", | ||
Photo = "photo", | ||
Place = "place", | ||
Run = "run", | ||
Train = "train", | ||
Tram = "tram", | ||
Transport = "transport", | ||
Video = "video", | ||
Walk = "walk", | ||
Work = "work", | ||
Yoga = "yoga", | ||
} | ||
export type TimelineEntryType = | ||
| "bike" | ||
| "bus" | ||
| "car" | ||
| "e-bike" | ||
| "expense" | ||
| "ferry" | ||
| "flight" | ||
| "hike" | ||
| "home" | ||
| "motorcycle" | ||
| "photo" | ||
| "place" | ||
| "run" | ||
| "train" | ||
| "tram" | ||
| "transport" | ||
| "unknown" | ||
| "velomobile" | ||
| "video" | ||
| "walk" | ||
| "work" | ||
| "yoga"; | ||
interface TimelineEntryLocation { | ||
latitude?: number; | ||
longitude?: number; | ||
export interface TimelineEntryLocation { | ||
latitude: number; | ||
longitude: number; | ||
} | ||
@@ -40,6 +41,6 @@ | ||
description: string | null; | ||
locationStart: TimelineEntryLocation; | ||
locationEnd: TimelineEntryLocation; | ||
locationStart: TimelineEntryLocation | null; | ||
locationEnd: TimelineEntryLocation | null; | ||
polyline: string | null; | ||
mediaUri: string | null; | ||
}; |
@@ -9,1 +9,10 @@ /** | ||
export type ISO8601Date = string; | ||
/** | ||
* A date string formatted as `YYYY-MM-DDTHH:MM:SSZ`. | ||
* | ||
* @remarks the purpose of this type is to add meaning to date variables that | ||
* need to take this format. It could be enhanced to enforce the string | ||
* structure but that becomes overly complicated | ||
*/ | ||
export type ISO8601DateAndTime = string; |
@@ -0,1 +1,3 @@ | ||
import { ISO8601Date, ISO8601DateAndTime } from "../../types"; | ||
/** | ||
@@ -46,3 +48,3 @@ * Offsets a date by the input number of days. | ||
*/ | ||
export const makeISO8601Date = (date: Date) => { | ||
export const makeISO8601Date = (date: Date): ISO8601Date => { | ||
const YYYY = date.getFullYear().toString(); | ||
@@ -54,1 +56,8 @@ const MM = (date.getMonth() + 1).toString().padStart(2, "0"); | ||
}; | ||
/** | ||
* @param date a full date and time in ISO 8601 format | ||
* @returns the number of seconds since the epock | ||
*/ | ||
export const getUnixTimestamp = (date: ISO8601DateAndTime) => | ||
Math.floor(new Date(date).getTime() / 1000); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
44072
70
1238
0