@sunsteel/contracts 0.91.0 → 0.92.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 +13 -2
- package/dist/index.d.cts +550 -504
- package/dist/index.d.ts +550 -504
- package/dist/index.js +11 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -116,6 +116,7 @@ __export(index_exports, {
|
|
|
116
116
|
MEASURABLE_GOAL_TYPES: () => MEASURABLE_GOAL_TYPES,
|
|
117
117
|
MESSAGES_PAGE_SIZE: () => MESSAGES_PAGE_SIZE,
|
|
118
118
|
MESSAGES_PER_MINUTE_MAX: () => MESSAGES_PER_MINUTE_MAX,
|
|
119
|
+
MESSAGE_ATTACHMENT_KINDS: () => MESSAGE_ATTACHMENT_KINDS,
|
|
119
120
|
MESSAGE_BODY_MAX: () => MESSAGE_BODY_MAX,
|
|
120
121
|
MESSAGE_PERMISSIONS: () => MESSAGE_PERMISSIONS,
|
|
121
122
|
MESSAGE_PUSH_DELAY_SECONDS: () => MESSAGE_PUSH_DELAY_SECONDS,
|
|
@@ -308,6 +309,7 @@ __export(index_exports, {
|
|
|
308
309
|
lpWorkingSets: () => lpWorkingSets,
|
|
309
310
|
matchesDeletionConfirmation: () => matchesDeletionConfirmation,
|
|
310
311
|
messageBodyLength: () => messageBodyLength,
|
|
312
|
+
messageNote: () => messageNote,
|
|
311
313
|
normalizeDashboardLayout: () => normalizeDashboardLayout,
|
|
312
314
|
normalizeExerciseLinks: () => normalizeExerciseLinks,
|
|
313
315
|
normalizeExerciseName: () => normalizeExerciseName,
|
|
@@ -1638,7 +1640,7 @@ var ROUTINE_VISIBILITY_VALUES = [
|
|
|
1638
1640
|
"PUBLIC"
|
|
1639
1641
|
];
|
|
1640
1642
|
var ROUTINE_SHARE_MAX_ACTIVE_LINKS = 10;
|
|
1641
|
-
var SHARED_ROUTINE_SOURCES = ["LINK", "VISIBILITY"];
|
|
1643
|
+
var SHARED_ROUTINE_SOURCES = ["LINK", "VISIBILITY", "MESSAGE"];
|
|
1642
1644
|
var CLONE_ROUTINE_REFUSALS = {
|
|
1643
1645
|
/** Neither `token` nor `routineId`, or both at once. */
|
|
1644
1646
|
SOURCE_REQUIRED: "SOURCE_REQUIRED",
|
|
@@ -1926,7 +1928,7 @@ var API_ERROR_MESSAGES = {
|
|
|
1926
1928
|
EXERCISE_GROUP_TOO_LARGE: "A superset or circuit has at most {max} exercises",
|
|
1927
1929
|
ROUTINE_ACTIVE_SESSION: "Finish the active session before changing the routine structure",
|
|
1928
1930
|
ROUTINE_SHARE_LINKS_MAX: "A routine keeps at most {max} active links.",
|
|
1929
|
-
CLONE_SOURCE_REQUIRED: "SOURCE_REQUIRED: send
|
|
1931
|
+
CLONE_SOURCE_REQUIRED: "SOURCE_REQUIRED: send one of a share token, a routine id or a message id",
|
|
1930
1932
|
CLONE_UNKNOWN_EXERCISE: "UNKNOWN_EXERCISE: an exercise in this routine is no longer in the catalog",
|
|
1931
1933
|
ROUTINE_VERSIONS_MAX: "A routine keeps at most {max} versions; delete one first",
|
|
1932
1934
|
ROUTINE_VERSION_EXERCISE_GONE: "An exercise in this version is no longer in the catalog",
|
|
@@ -2145,6 +2147,13 @@ function normalizeMessageBody(body) {
|
|
|
2145
2147
|
}
|
|
2146
2148
|
return text;
|
|
2147
2149
|
}
|
|
2150
|
+
var MESSAGE_ATTACHMENT_KINDS = ["ROUTINE"];
|
|
2151
|
+
function messageNote(body, hasAttachment) {
|
|
2152
|
+
if ((body ?? "").trim().length === 0) {
|
|
2153
|
+
return hasAttachment ? null : void 0;
|
|
2154
|
+
}
|
|
2155
|
+
return normalizeMessageBody(body ?? "") ?? void 0;
|
|
2156
|
+
}
|
|
2148
2157
|
var CONVERSATION_BOXES = ["INBOX", "REQUESTS"];
|
|
2149
2158
|
var MESSAGE_REQUEST_DECLINE_COOLDOWN_DAYS = 30;
|
|
2150
2159
|
var MESSAGE_PUSH_DELAY_SECONDS = 30;
|
|
@@ -2250,6 +2259,7 @@ function isMessagePermission(value) {
|
|
|
2250
2259
|
MEASURABLE_GOAL_TYPES,
|
|
2251
2260
|
MESSAGES_PAGE_SIZE,
|
|
2252
2261
|
MESSAGES_PER_MINUTE_MAX,
|
|
2262
|
+
MESSAGE_ATTACHMENT_KINDS,
|
|
2253
2263
|
MESSAGE_BODY_MAX,
|
|
2254
2264
|
MESSAGE_PERMISSIONS,
|
|
2255
2265
|
MESSAGE_PUSH_DELAY_SECONDS,
|
|
@@ -2442,6 +2452,7 @@ function isMessagePermission(value) {
|
|
|
2442
2452
|
lpWorkingSets,
|
|
2443
2453
|
matchesDeletionConfirmation,
|
|
2444
2454
|
messageBodyLength,
|
|
2455
|
+
messageNote,
|
|
2445
2456
|
normalizeDashboardLayout,
|
|
2446
2457
|
normalizeExerciseLinks,
|
|
2447
2458
|
normalizeExerciseName,
|