@torqlab/strava-api 1.0.0
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/LICENSE +21 -0
- package/README.md +167 -0
- package/dist/client/client.d.ts +34 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/create-error/create-error.d.ts +13 -0
- package/dist/client/create-error/create-error.d.ts.map +1 -0
- package/dist/client/create-error/index.d.ts +2 -0
- package/dist/client/create-error/index.d.ts.map +1 -0
- package/dist/client/get-auth-headers/get-auth-headers.d.ts +22 -0
- package/dist/client/get-auth-headers/get-auth-headers.d.ts.map +1 -0
- package/dist/client/get-auth-headers/index.d.ts +2 -0
- package/dist/client/get-auth-headers/index.d.ts.map +1 -0
- package/dist/client/handle-fetch-error/handle-fetch-error.d.ts +19 -0
- package/dist/client/handle-fetch-error/handle-fetch-error.d.ts.map +1 -0
- package/dist/client/handle-fetch-error/index.d.ts +2 -0
- package/dist/client/handle-fetch-error/index.d.ts.map +1 -0
- package/dist/client/handle-rate-limit/constants.d.ts +3 -0
- package/dist/client/handle-rate-limit/constants.d.ts.map +1 -0
- package/dist/client/handle-rate-limit/handle-rate-limit.d.ts +32 -0
- package/dist/client/handle-rate-limit/handle-rate-limit.d.ts.map +1 -0
- package/dist/client/handle-rate-limit/index.d.ts +2 -0
- package/dist/client/handle-rate-limit/index.d.ts.map +1 -0
- package/dist/client/handle-retry/handle-retry.d.ts +30 -0
- package/dist/client/handle-retry/handle-retry.d.ts.map +1 -0
- package/dist/client/handle-retry/index.d.ts +2 -0
- package/dist/client/handle-retry/index.d.ts.map +1 -0
- package/dist/client/handle-retry/types.d.ts +7 -0
- package/dist/client/handle-retry/types.d.ts.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/parse-error/index.d.ts +2 -0
- package/dist/client/parse-error/index.d.ts.map +1 -0
- package/dist/client/parse-error/parse-error.d.ts +14 -0
- package/dist/client/parse-error/parse-error.d.ts.map +1 -0
- package/dist/client/parse-error-code/index.d.ts +2 -0
- package/dist/client/parse-error-code/index.d.ts.map +1 -0
- package/dist/client/parse-error-code/parse-error-code.d.ts +12 -0
- package/dist/client/parse-error-code/parse-error-code.d.ts.map +1 -0
- package/dist/client/parse-response/index.d.ts +2 -0
- package/dist/client/parse-response/index.d.ts.map +1 -0
- package/dist/client/parse-response/parse-response.d.ts +30 -0
- package/dist/client/parse-response/parse-response.d.ts.map +1 -0
- package/dist/constants.d.ts +35 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/exchange-token/exchange-token.d.ts +36 -0
- package/dist/exchange-token/exchange-token.d.ts.map +1 -0
- package/dist/exchange-token/index.d.ts +2 -0
- package/dist/exchange-token/index.d.ts.map +1 -0
- package/dist/fetch-activities/fetch-activities.d.ts +39 -0
- package/dist/fetch-activities/fetch-activities.d.ts.map +1 -0
- package/dist/fetch-activities/index.d.ts +2 -0
- package/dist/fetch-activities/index.d.ts.map +1 -0
- package/dist/fetch-activity/fetch-activity.d.ts +49 -0
- package/dist/fetch-activity/fetch-activity.d.ts.map +1 -0
- package/dist/fetch-activity/index.d.ts +2 -0
- package/dist/fetch-activity/index.d.ts.map +1 -0
- package/dist/get-auth-url/get-auth-url.d.ts +30 -0
- package/dist/get-auth-url/get-auth-url.d.ts.map +1 -0
- package/dist/get-auth-url/index.d.ts +2 -0
- package/dist/get-auth-url/index.d.ts.map +1 -0
- package/dist/index.cjs +473 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +431 -0
- package/dist/refresh-token/index.d.ts +2 -0
- package/dist/refresh-token/index.d.ts.map +1 -0
- package/dist/refresh-token/refresh-token.d.ts +34 -0
- package/dist/refresh-token/refresh-token.d.ts.map +1 -0
- package/dist/refresh-token/types.d.ts +5 -0
- package/dist/refresh-token/types.d.ts.map +1 -0
- package/dist/types.d.ts +192 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/validators/index.d.ts +2 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/validate-activity-id/index.d.ts +2 -0
- package/dist/validators/validate-activity-id/index.d.ts.map +1 -0
- package/dist/validators/validate-activity-id/validate-activity-id.d.ts +22 -0
- package/dist/validators/validate-activity-id/validate-activity-id.d.ts.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../validators/validate-activity-id/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates the format of a Strava activity ID.
|
|
3
|
+
*
|
|
4
|
+
* Ensures the activity ID is a valid numeric string that can be used to fetch
|
|
5
|
+
* activity data from the Strava API. Activity IDs must be positive numbers.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} activityId - The activity ID to validate (can be string or number).
|
|
8
|
+
* @returns {void}
|
|
9
|
+
* @throws {Error} Throws an error with ActivityError structure if validation fails.
|
|
10
|
+
* Error codes: 'INVALID_ID' for all validation failures.
|
|
11
|
+
* The error is not retryable.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* validateActivityId('123456789'); // Valid
|
|
16
|
+
* validateActivityId(''); // Throws INVALID_ID error
|
|
17
|
+
* validateActivityId('abc'); // Throws INVALID_ID error
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const validateActivityId: (activityId: string) => void;
|
|
21
|
+
export default validateActivityId;
|
|
22
|
+
//# sourceMappingURL=validate-activity-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-activity-id.d.ts","sourceRoot":"","sources":["../../../validators/validate-activity-id/validate-activity-id.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,kBAAkB,GAAI,YAAY,MAAM,KAAG,IAuBhD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@torqlab/strava-api",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Strava API client with automatic rate limiting, retry handling, and comprehensive type safety.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Bohdan Balov",
|
|
8
|
+
"email": "balovbohdan@gmail.com",
|
|
9
|
+
"url": "https://balov.dev"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"strava",
|
|
13
|
+
"torq"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "dist/index.cjs",
|
|
17
|
+
"module": "dist/index.mjs",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.mjs",
|
|
23
|
+
"require": "./dist/index.cjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": "24.x"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"registry": "https://registry.npmjs.org/",
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/torqlab/strava-api.git"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/torqlab/strava-api",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/torqlab/strava-api/issues"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build:types": "bunx tsc -p tsconfig.build.json",
|
|
46
|
+
"build:esm": "bun build ./index.ts --outfile dist/index.mjs --target node",
|
|
47
|
+
"build:cjs": "bun build ./index.ts --outfile dist/index.cjs --target node --format cjs",
|
|
48
|
+
"build": "bun run clean && bun run build:types && bun run build:esm && bun run build:cjs",
|
|
49
|
+
"test": "bun test",
|
|
50
|
+
"lint": "eslint . --ext .ts",
|
|
51
|
+
"format": "prettier --write .",
|
|
52
|
+
"format:check": "prettier --check .",
|
|
53
|
+
"prepare": "husky",
|
|
54
|
+
"prepublishOnly": "bun run build",
|
|
55
|
+
"clean": "rm -rf dist"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@eslint/js": "^9.15.0",
|
|
59
|
+
"@types/bun": "^1.1.13",
|
|
60
|
+
"bun": "^1.1.38",
|
|
61
|
+
"eslint": "^9.15.0",
|
|
62
|
+
"eslint-config-prettier": "^9.1.0",
|
|
63
|
+
"eslint-plugin-jsdoc": "^50.5.0",
|
|
64
|
+
"husky": "^9.1.7",
|
|
65
|
+
"prettier": "^3.3.3",
|
|
66
|
+
"typescript": "^5.6.3",
|
|
67
|
+
"typescript-eslint": "^8.15.0"
|
|
68
|
+
}
|
|
69
|
+
}
|