@sunsteel/contracts 0.93.0 → 0.95.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/dist/index.cjs +19 -4
- package/dist/index.d.cts +580 -537
- package/dist/index.d.ts +580 -537
- package/dist/index.js +18 -4
- package/package.json +40 -40
package/dist/index.js
CHANGED
|
@@ -643,11 +643,12 @@ function lpLoadKg(referenceMaxKg, percentage, incrementKg) {
|
|
|
643
643
|
return roundToIncrement(referenceMaxKg * percentage, incrementKg);
|
|
644
644
|
}
|
|
645
645
|
var LP_PHASES = ["BLOCK", "RECOVERY", "FINISHED"];
|
|
646
|
-
|
|
646
|
+
var clampStep = (step) => Math.min(Math.max(Math.trunc(step) || 1, 1), LP_BLOCK_STEPS);
|
|
647
|
+
function startLinearPeriodization(referenceMaxKg, cycle = 1, step = 1) {
|
|
647
648
|
return {
|
|
648
649
|
referenceMaxKg,
|
|
649
650
|
phase: "BLOCK",
|
|
650
|
-
step:
|
|
651
|
+
step: clampStep(step),
|
|
651
652
|
cycle,
|
|
652
653
|
samples: [],
|
|
653
654
|
finishedAt: null,
|
|
@@ -655,6 +656,18 @@ function startLinearPeriodization(referenceMaxKg, cycle = 1) {
|
|
|
655
656
|
nextReferenceMaxKg: null
|
|
656
657
|
};
|
|
657
658
|
}
|
|
659
|
+
function lpAtStep(state, step) {
|
|
660
|
+
const at = clampStep(step);
|
|
661
|
+
return {
|
|
662
|
+
...state,
|
|
663
|
+
phase: "BLOCK",
|
|
664
|
+
step: at,
|
|
665
|
+
samples: state.samples.filter((sample) => sample.step < at),
|
|
666
|
+
finishedAt: null,
|
|
667
|
+
estimatedMaxKg: null,
|
|
668
|
+
nextReferenceMaxKg: null
|
|
669
|
+
};
|
|
670
|
+
}
|
|
658
671
|
function linearPeriodizationProblem(state) {
|
|
659
672
|
if (!Number.isFinite(state.referenceMaxKg) || state.referenceMaxKg <= 0 || state.referenceMaxKg > LP_REFERENCE_MAX_KG) {
|
|
660
673
|
return "The reference max must be above 0";
|
|
@@ -1702,7 +1715,7 @@ var API_ERROR_MESSAGES = {
|
|
|
1702
1715
|
// ── Direct messages (MSG-01) ───────────────────────────────────────────
|
|
1703
1716
|
MESSAGE_SELF: "You cannot message yourself",
|
|
1704
1717
|
MESSAGE_LENGTH: "A message must not be empty and may be at most {max} characters.",
|
|
1705
|
-
MESSAGE_ONE_ATTACHMENT: "A message can carry one routine or one
|
|
1718
|
+
MESSAGE_ONE_ATTACHMENT: "A message can carry one routine, one workout or one record.",
|
|
1706
1719
|
MESSAGES_PER_MINUTE: "You can send at most {max} messages a minute.",
|
|
1707
1720
|
CONVERSATIONS_PER_DAY: "You can start at most {max} new conversations a day.",
|
|
1708
1721
|
MESSAGE_NOT_ADMITTED: "This member is not taking messages from you.",
|
|
@@ -1811,7 +1824,7 @@ function normalizeMessageBody(body) {
|
|
|
1811
1824
|
}
|
|
1812
1825
|
return text;
|
|
1813
1826
|
}
|
|
1814
|
-
var MESSAGE_ATTACHMENT_KINDS = ["ROUTINE", "WORKOUT"];
|
|
1827
|
+
var MESSAGE_ATTACHMENT_KINDS = ["ROUTINE", "WORKOUT", "RECORD"];
|
|
1815
1828
|
function messageNote(body, hasAttachment) {
|
|
1816
1829
|
if ((body ?? "").trim().length === 0) {
|
|
1817
1830
|
return hasAttachment ? null : void 0;
|
|
@@ -2103,6 +2116,7 @@ export {
|
|
|
2103
2116
|
latestBodyWeight,
|
|
2104
2117
|
leadWorkingWeight,
|
|
2105
2118
|
linearPeriodizationProblem,
|
|
2119
|
+
lpAtStep,
|
|
2106
2120
|
lpEstimate,
|
|
2107
2121
|
lpLoadKg,
|
|
2108
2122
|
lpPrescription,
|
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sunsteel/contracts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"repository": {
|
|
5
|
-
"type": "git",
|
|
6
|
-
"url": "git+https://github.com/ezee969/sunsteel-contracts.git"
|
|
7
|
-
},
|
|
8
|
-
"private": false,
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=20.11"
|
|
11
|
-
},
|
|
12
|
-
"type": "module",
|
|
13
|
-
"sideEffects": false,
|
|
14
|
-
"main": "./dist/index.cjs",
|
|
15
|
-
"module": "./dist/index.js",
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"exports": {
|
|
18
|
-
".": {
|
|
19
|
-
"types": "./dist/index.d.ts",
|
|
20
|
-
"import": "./dist/index.js",
|
|
21
|
-
"require": "./dist/index.cjs"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
29
|
-
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
30
|
-
"typecheck": "tsc --noEmit",
|
|
31
|
-
"lint": "npm run typecheck",
|
|
32
|
-
"verify": "npm run typecheck && npm run build",
|
|
33
|
-
"verify:security": "npm audit",
|
|
34
|
-
"prepublishOnly": "npm run build"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"tsup": "^8.3.5",
|
|
38
|
-
"typescript": "^5.7.3"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@sunsteel/contracts",
|
|
3
|
+
"version": "0.95.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/ezee969/sunsteel-contracts.git"
|
|
7
|
+
},
|
|
8
|
+
"private": false,
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20.11"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
29
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "npm run typecheck",
|
|
32
|
+
"verify": "npm run typecheck && npm run build",
|
|
33
|
+
"verify:security": "npm audit",
|
|
34
|
+
"prepublishOnly": "npm run build"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"tsup": "^8.3.5",
|
|
38
|
+
"typescript": "^5.7.3"
|
|
39
|
+
}
|
|
40
|
+
}
|