@pontix/adapter-duin 0.0.0-stage → 0.1.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 +661 -0
- package/README.md +96 -2
- package/dist/auth.d.ts +30 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +170 -0
- package/dist/auth.js.map +1 -0
- package/dist/available-plans.d.ts +10 -0
- package/dist/available-plans.d.ts.map +1 -0
- package/dist/available-plans.js +14 -0
- package/dist/available-plans.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/dist/mappers.d.ts +33 -0
- package/dist/mappers.d.ts.map +1 -0
- package/dist/mappers.js +35 -0
- package/dist/mappers.js.map +1 -0
- package/dist/plan-edit.d.ts +79 -0
- package/dist/plan-edit.d.ts.map +1 -0
- package/dist/plan-edit.js +122 -0
- package/dist/plan-edit.js.map +1 -0
- package/dist/session.d.ts +20 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +59 -0
- package/dist/session.js.map +1 -0
- package/dist/shapes.d.ts +626 -0
- package/dist/shapes.d.ts.map +1 -0
- package/dist/shapes.js +219 -0
- package/dist/shapes.js.map +1 -0
- package/dist/tools/add-plan-exercise.d.ts +87 -0
- package/dist/tools/add-plan-exercise.d.ts.map +1 -0
- package/dist/tools/add-plan-exercise.js +47 -0
- package/dist/tools/add-plan-exercise.js.map +1 -0
- package/dist/tools/get-plan.d.ts +29 -0
- package/dist/tools/get-plan.d.ts.map +1 -0
- package/dist/tools/get-plan.js +150 -0
- package/dist/tools/get-plan.js.map +1 -0
- package/dist/tools/list-plans.d.ts +40 -0
- package/dist/tools/list-plans.d.ts.map +1 -0
- package/dist/tools/list-plans.js +110 -0
- package/dist/tools/list-plans.js.map +1 -0
- package/dist/tools/list-workouts.d.ts +73 -0
- package/dist/tools/list-workouts.d.ts.map +1 -0
- package/dist/tools/list-workouts.js +269 -0
- package/dist/tools/list-workouts.js.map +1 -0
- package/dist/tools/remove-plan-exercise.d.ts +23 -0
- package/dist/tools/remove-plan-exercise.d.ts.map +1 -0
- package/dist/tools/remove-plan-exercise.js +33 -0
- package/dist/tools/remove-plan-exercise.js.map +1 -0
- package/dist/tools/search-activities.d.ts +68 -0
- package/dist/tools/search-activities.d.ts.map +1 -0
- package/dist/tools/search-activities.js +136 -0
- package/dist/tools/search-activities.js.map +1 -0
- package/dist/tools/set-plan-exercise-sets.d.ts +79 -0
- package/dist/tools/set-plan-exercise-sets.d.ts.map +1 -0
- package/dist/tools/set-plan-exercise-sets.js +39 -0
- package/dist/tools/set-plan-exercise-sets.js.map +1 -0
- package/mappers.json +197 -0
- package/package.json +45 -3
package/dist/shapes.d.ts
ADDED
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
import { z } from "@pontix/core/adapter";
|
|
2
|
+
/**
|
|
3
|
+
* What the tools return to the model.
|
|
4
|
+
*
|
|
5
|
+
* Ours, not DUIN's, and deliberately not data: a mapper may change where a value
|
|
6
|
+
* is read from, never what a caller receives. Every mapped result is validated
|
|
7
|
+
* against these.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* One workout, summarised.
|
|
11
|
+
*
|
|
12
|
+
* Enough to answer "how often did I train" and "what did I do on Tuesday", and
|
|
13
|
+
* no more. Sets, weights and heart rate are health data and belong to a tool
|
|
14
|
+
* that is asked for them.
|
|
15
|
+
*
|
|
16
|
+
* No `id` and no `duration`: the live response has neither at workout level.
|
|
17
|
+
* A workout is identified by its date and plan, and a duration exists only per
|
|
18
|
+
* exercise (a set's `duration` and the exercise `summary`), which this summary
|
|
19
|
+
* does not open.
|
|
20
|
+
*/
|
|
21
|
+
export declare const workout: z.ZodObject<{
|
|
22
|
+
/**
|
|
23
|
+
* Exactly as the service reports it: the gym-local wall clock with no
|
|
24
|
+
* offset, such as `2026-11-16T19:08:17.216`. Read it together with
|
|
25
|
+
* `timezone`; it is not a UTC instant.
|
|
26
|
+
*/
|
|
27
|
+
completedAt: z.ZodNullable<z.ZodString>;
|
|
28
|
+
/** The IANA zone `completedAt` is local to, such as `Europe/Madrid`. */
|
|
29
|
+
timezone: z.ZodNullable<z.ZodString>;
|
|
30
|
+
/**
|
|
31
|
+
* The name of the plan the member trained, or null when there was none: a
|
|
32
|
+
* session logged from a connected app (Apple Health, for one) carries no plan.
|
|
33
|
+
*/
|
|
34
|
+
name: z.ZodNullable<z.ZodString>;
|
|
35
|
+
/** `USER_OWN`, `TRAINER_ASSIGNED` or `BRAND_SPECIFIC` of that plan, as the service says; null with no plan. */
|
|
36
|
+
planGroupType: z.ZodNullable<z.ZodString>;
|
|
37
|
+
/** How many exercises the workout held; null when the entry does not list them. */
|
|
38
|
+
exerciseCount: z.ZodNullable<z.ZodNumber>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
completedAt: string | null;
|
|
41
|
+
timezone: string | null;
|
|
42
|
+
name: string | null;
|
|
43
|
+
planGroupType: string | null;
|
|
44
|
+
exerciseCount: number | null;
|
|
45
|
+
}, {
|
|
46
|
+
completedAt: string | null;
|
|
47
|
+
timezone: string | null;
|
|
48
|
+
name: string | null;
|
|
49
|
+
planGroupType: string | null;
|
|
50
|
+
exerciseCount: number | null;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const workoutList: z.ZodObject<{
|
|
53
|
+
/** The window that was asked for, as ISO instants. */
|
|
54
|
+
window: z.ZodObject<{
|
|
55
|
+
from: z.ZodString;
|
|
56
|
+
to: z.ZodString;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
from: string;
|
|
59
|
+
to: string;
|
|
60
|
+
}, {
|
|
61
|
+
from: string;
|
|
62
|
+
to: string;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* How many workouts fell inside the window, before `limit` was applied.
|
|
66
|
+
*
|
|
67
|
+
* The service paginates nothing and answers every entry in the window in one
|
|
68
|
+
* response, so the tool is what bounds the output. Without this a model that sees twenty
|
|
69
|
+
* rows cannot tell a member who trained twenty times from one who trained
|
|
70
|
+
* five hundred.
|
|
71
|
+
*
|
|
72
|
+
* Counted here rather than taken from the response length, because nobody
|
|
73
|
+
* has watched the service honour the window it was asked for. Reporting what
|
|
74
|
+
* came back as what the window held would turn that mistake into a confident
|
|
75
|
+
* wrong number.
|
|
76
|
+
*/
|
|
77
|
+
total: z.ZodNumber;
|
|
78
|
+
returned: z.ZodNumber;
|
|
79
|
+
truncated: z.ZodBoolean;
|
|
80
|
+
/**
|
|
81
|
+
* Entries whose `completedAt` could not be read as a date, and which are
|
|
82
|
+
* therefore in neither count above.
|
|
83
|
+
*
|
|
84
|
+
* If the service ever sends a missing, malformed or non-date `completedAt`
|
|
85
|
+
* (epoch numbers, say), this is where that shows up instead of the tool
|
|
86
|
+
* quietly sorting and truncating the wrong rows — so a model reading a
|
|
87
|
+
* non-zero value here should say the dates could not be read rather than
|
|
88
|
+
* answer "how often did I train".
|
|
89
|
+
*/
|
|
90
|
+
undated: z.ZodNumber;
|
|
91
|
+
/** Most recent first. */
|
|
92
|
+
workouts: z.ZodArray<z.ZodObject<{
|
|
93
|
+
/**
|
|
94
|
+
* Exactly as the service reports it: the gym-local wall clock with no
|
|
95
|
+
* offset, such as `2026-11-16T19:08:17.216`. Read it together with
|
|
96
|
+
* `timezone`; it is not a UTC instant.
|
|
97
|
+
*/
|
|
98
|
+
completedAt: z.ZodNullable<z.ZodString>;
|
|
99
|
+
/** The IANA zone `completedAt` is local to, such as `Europe/Madrid`. */
|
|
100
|
+
timezone: z.ZodNullable<z.ZodString>;
|
|
101
|
+
/**
|
|
102
|
+
* The name of the plan the member trained, or null when there was none: a
|
|
103
|
+
* session logged from a connected app (Apple Health, for one) carries no plan.
|
|
104
|
+
*/
|
|
105
|
+
name: z.ZodNullable<z.ZodString>;
|
|
106
|
+
/** `USER_OWN`, `TRAINER_ASSIGNED` or `BRAND_SPECIFIC` of that plan, as the service says; null with no plan. */
|
|
107
|
+
planGroupType: z.ZodNullable<z.ZodString>;
|
|
108
|
+
/** How many exercises the workout held; null when the entry does not list them. */
|
|
109
|
+
exerciseCount: z.ZodNullable<z.ZodNumber>;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
completedAt: string | null;
|
|
112
|
+
timezone: string | null;
|
|
113
|
+
name: string | null;
|
|
114
|
+
planGroupType: string | null;
|
|
115
|
+
exerciseCount: number | null;
|
|
116
|
+
}, {
|
|
117
|
+
completedAt: string | null;
|
|
118
|
+
timezone: string | null;
|
|
119
|
+
name: string | null;
|
|
120
|
+
planGroupType: string | null;
|
|
121
|
+
exerciseCount: number | null;
|
|
122
|
+
}>, "many">;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
window: {
|
|
125
|
+
from: string;
|
|
126
|
+
to: string;
|
|
127
|
+
};
|
|
128
|
+
total: number;
|
|
129
|
+
returned: number;
|
|
130
|
+
truncated: boolean;
|
|
131
|
+
undated: number;
|
|
132
|
+
workouts: {
|
|
133
|
+
completedAt: string | null;
|
|
134
|
+
timezone: string | null;
|
|
135
|
+
name: string | null;
|
|
136
|
+
planGroupType: string | null;
|
|
137
|
+
exerciseCount: number | null;
|
|
138
|
+
}[];
|
|
139
|
+
}, {
|
|
140
|
+
window: {
|
|
141
|
+
from: string;
|
|
142
|
+
to: string;
|
|
143
|
+
};
|
|
144
|
+
total: number;
|
|
145
|
+
returned: number;
|
|
146
|
+
truncated: boolean;
|
|
147
|
+
undated: number;
|
|
148
|
+
workouts: {
|
|
149
|
+
completedAt: string | null;
|
|
150
|
+
timezone: string | null;
|
|
151
|
+
name: string | null;
|
|
152
|
+
planGroupType: string | null;
|
|
153
|
+
exerciseCount: number | null;
|
|
154
|
+
}[];
|
|
155
|
+
}>;
|
|
156
|
+
export type Workout = z.infer<typeof workout>;
|
|
157
|
+
export type WorkoutList = z.infer<typeof workoutList>;
|
|
158
|
+
/**
|
|
159
|
+
* One plan, summarised.
|
|
160
|
+
*
|
|
161
|
+
* Enough to answer "which plans do I have" and "how big is it". The embedded
|
|
162
|
+
* activities are what make the response about 1.3 MB, and the sets are per-exercise
|
|
163
|
+
* detail, so neither is here: a tool that is asked for a plan's exercises can
|
|
164
|
+
* fetch them.
|
|
165
|
+
*/
|
|
166
|
+
export declare const plan: z.ZodObject<{
|
|
167
|
+
id: z.ZodString;
|
|
168
|
+
name: z.ZodNullable<z.ZodString>;
|
|
169
|
+
/**
|
|
170
|
+
* `USER_OWN`, `TRAINER_ASSIGNED` or `BRAND_SPECIFIC` as recorded. A plain
|
|
171
|
+
* string rather than an enum: a fourth value from the service should reach
|
|
172
|
+
* the model, not fail the whole list.
|
|
173
|
+
*/
|
|
174
|
+
groupType: z.ZodNullable<z.ZodString>;
|
|
175
|
+
/** `MANUAL_INPUT` or `HISTORIC` as recorded; the same reasoning as `groupType`. */
|
|
176
|
+
exerciseValueSource: z.ZodNullable<z.ZodString>;
|
|
177
|
+
/**
|
|
178
|
+
* Whether the service says the member may change this plan, and whether they
|
|
179
|
+
* may remove it.
|
|
180
|
+
*
|
|
181
|
+
* Null is a third answer and not a no: it means the service did not say. A
|
|
182
|
+
* plan the member cannot edit and a plan nobody asked about lead somewhere
|
|
183
|
+
* different, so they are not collapsed.
|
|
184
|
+
*/
|
|
185
|
+
editable: z.ZodNullable<z.ZodBoolean>;
|
|
186
|
+
deletable: z.ZodNullable<z.ZodBoolean>;
|
|
187
|
+
/** How many exercises the plan holds; null when the entry does not list them. */
|
|
188
|
+
exerciseCount: z.ZodNullable<z.ZodNumber>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
name: string | null;
|
|
191
|
+
exerciseCount: number | null;
|
|
192
|
+
id: string;
|
|
193
|
+
groupType: string | null;
|
|
194
|
+
exerciseValueSource: string | null;
|
|
195
|
+
editable: boolean | null;
|
|
196
|
+
deletable: boolean | null;
|
|
197
|
+
}, {
|
|
198
|
+
name: string | null;
|
|
199
|
+
exerciseCount: number | null;
|
|
200
|
+
id: string;
|
|
201
|
+
groupType: string | null;
|
|
202
|
+
exerciseValueSource: string | null;
|
|
203
|
+
editable: boolean | null;
|
|
204
|
+
deletable: boolean | null;
|
|
205
|
+
}>;
|
|
206
|
+
export declare const planList: z.ZodObject<{
|
|
207
|
+
/** How many plans matched the filter, before `limit` was applied. */
|
|
208
|
+
total: z.ZodNumber;
|
|
209
|
+
returned: z.ZodNumber;
|
|
210
|
+
truncated: z.ZodBoolean;
|
|
211
|
+
/**
|
|
212
|
+
* How many plans the service sent in each group, whatever the filter.
|
|
213
|
+
*
|
|
214
|
+
* So "you have 3 of your own and the gym offers 180" can be said without
|
|
215
|
+
* 180 rows. `other` holds plans with no `groupType` or one that is not
|
|
216
|
+
* among the three recorded: above zero means the service has a group this
|
|
217
|
+
* code does not know.
|
|
218
|
+
*/
|
|
219
|
+
groups: z.ZodObject<{
|
|
220
|
+
USER_OWN: z.ZodNumber;
|
|
221
|
+
TRAINER_ASSIGNED: z.ZodNumber;
|
|
222
|
+
BRAND_SPECIFIC: z.ZodNumber;
|
|
223
|
+
other: z.ZodNumber;
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
|
+
USER_OWN: number;
|
|
226
|
+
TRAINER_ASSIGNED: number;
|
|
227
|
+
BRAND_SPECIFIC: number;
|
|
228
|
+
other: number;
|
|
229
|
+
}, {
|
|
230
|
+
USER_OWN: number;
|
|
231
|
+
TRAINER_ASSIGNED: number;
|
|
232
|
+
BRAND_SPECIFIC: number;
|
|
233
|
+
other: number;
|
|
234
|
+
}>;
|
|
235
|
+
/** The member's own plans first, then trainer-assigned, then the gym's catalogue. */
|
|
236
|
+
plans: z.ZodArray<z.ZodObject<{
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
name: z.ZodNullable<z.ZodString>;
|
|
239
|
+
/**
|
|
240
|
+
* `USER_OWN`, `TRAINER_ASSIGNED` or `BRAND_SPECIFIC` as recorded. A plain
|
|
241
|
+
* string rather than an enum: a fourth value from the service should reach
|
|
242
|
+
* the model, not fail the whole list.
|
|
243
|
+
*/
|
|
244
|
+
groupType: z.ZodNullable<z.ZodString>;
|
|
245
|
+
/** `MANUAL_INPUT` or `HISTORIC` as recorded; the same reasoning as `groupType`. */
|
|
246
|
+
exerciseValueSource: z.ZodNullable<z.ZodString>;
|
|
247
|
+
/**
|
|
248
|
+
* Whether the service says the member may change this plan, and whether they
|
|
249
|
+
* may remove it.
|
|
250
|
+
*
|
|
251
|
+
* Null is a third answer and not a no: it means the service did not say. A
|
|
252
|
+
* plan the member cannot edit and a plan nobody asked about lead somewhere
|
|
253
|
+
* different, so they are not collapsed.
|
|
254
|
+
*/
|
|
255
|
+
editable: z.ZodNullable<z.ZodBoolean>;
|
|
256
|
+
deletable: z.ZodNullable<z.ZodBoolean>;
|
|
257
|
+
/** How many exercises the plan holds; null when the entry does not list them. */
|
|
258
|
+
exerciseCount: z.ZodNullable<z.ZodNumber>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
name: string | null;
|
|
261
|
+
exerciseCount: number | null;
|
|
262
|
+
id: string;
|
|
263
|
+
groupType: string | null;
|
|
264
|
+
exerciseValueSource: string | null;
|
|
265
|
+
editable: boolean | null;
|
|
266
|
+
deletable: boolean | null;
|
|
267
|
+
}, {
|
|
268
|
+
name: string | null;
|
|
269
|
+
exerciseCount: number | null;
|
|
270
|
+
id: string;
|
|
271
|
+
groupType: string | null;
|
|
272
|
+
exerciseValueSource: string | null;
|
|
273
|
+
editable: boolean | null;
|
|
274
|
+
deletable: boolean | null;
|
|
275
|
+
}>, "many">;
|
|
276
|
+
}, "strip", z.ZodTypeAny, {
|
|
277
|
+
total: number;
|
|
278
|
+
returned: number;
|
|
279
|
+
truncated: boolean;
|
|
280
|
+
groups: {
|
|
281
|
+
USER_OWN: number;
|
|
282
|
+
TRAINER_ASSIGNED: number;
|
|
283
|
+
BRAND_SPECIFIC: number;
|
|
284
|
+
other: number;
|
|
285
|
+
};
|
|
286
|
+
plans: {
|
|
287
|
+
name: string | null;
|
|
288
|
+
exerciseCount: number | null;
|
|
289
|
+
id: string;
|
|
290
|
+
groupType: string | null;
|
|
291
|
+
exerciseValueSource: string | null;
|
|
292
|
+
editable: boolean | null;
|
|
293
|
+
deletable: boolean | null;
|
|
294
|
+
}[];
|
|
295
|
+
}, {
|
|
296
|
+
total: number;
|
|
297
|
+
returned: number;
|
|
298
|
+
truncated: boolean;
|
|
299
|
+
groups: {
|
|
300
|
+
USER_OWN: number;
|
|
301
|
+
TRAINER_ASSIGNED: number;
|
|
302
|
+
BRAND_SPECIFIC: number;
|
|
303
|
+
other: number;
|
|
304
|
+
};
|
|
305
|
+
plans: {
|
|
306
|
+
name: string | null;
|
|
307
|
+
exerciseCount: number | null;
|
|
308
|
+
id: string;
|
|
309
|
+
groupType: string | null;
|
|
310
|
+
exerciseValueSource: string | null;
|
|
311
|
+
editable: boolean | null;
|
|
312
|
+
deletable: boolean | null;
|
|
313
|
+
}[];
|
|
314
|
+
}>;
|
|
315
|
+
export type Plan = z.infer<typeof plan>;
|
|
316
|
+
export type PlanList = z.infer<typeof planList>;
|
|
317
|
+
/**
|
|
318
|
+
* One catalogue activity, summarised.
|
|
319
|
+
*
|
|
320
|
+
* Enough to find an activity and its id, and no more. The catalogue row also
|
|
321
|
+
* carries localized `name`/`description`/`synonyms` maps, `muscleMapping`,
|
|
322
|
+
* `images[]`, `videos[]` and `equipmentsV2[]`; none of it is here, for the same
|
|
323
|
+
* reason `plan` drops its embedded activities. A tool that is asked for one
|
|
324
|
+
* activity can fetch the rest.
|
|
325
|
+
*/
|
|
326
|
+
export declare const activity: z.ZodObject<{
|
|
327
|
+
/** `activityId` upstream, an integer there; it is a string here, like every id this connector returns. */
|
|
328
|
+
id: z.ZodString;
|
|
329
|
+
/** In the first language the service published, Spanish preferred. Null when none came. */
|
|
330
|
+
name: z.ZodNullable<z.ZodString>;
|
|
331
|
+
/**
|
|
332
|
+
* What the service calls this activity's `category`: `WEIGHT_MACHINE_BASED`,
|
|
333
|
+
* `EGYM_MACHINE`, `FREE_WEIGHTS`, `BODY_WEIGHT_BASED`, `FITNESS_CLASS`, `SPORT`,
|
|
334
|
+
* `STRETCHING`, `ELLIPTICAL`, `TREADMILL` or `BIKES`, as recorded.
|
|
335
|
+
*
|
|
336
|
+
* **Not the `category` the search filters by.** That one is `STRENGTH`,
|
|
337
|
+
* `COORDINATION`, `MOBILITY` or `FITNESS_CLASS`; both are the service's own
|
|
338
|
+
* words for two different things. A row read back as `FREE_WEIGHTS` from a
|
|
339
|
+
* search filtered by `STRENGTH` is the filter working, not being ignored.
|
|
340
|
+
* Kept under the service's name so a recorded field is not renamed out of
|
|
341
|
+
* sight of where it came from. A plain string, not an enum: a new value
|
|
342
|
+
* should reach the model, not fail the whole list.
|
|
343
|
+
*/
|
|
344
|
+
category: z.ZodNullable<z.ZodString>;
|
|
345
|
+
difficulty: z.ZodNullable<z.ZodString>;
|
|
346
|
+
/** The metabolic equivalent the service reports for the activity. */
|
|
347
|
+
met: z.ZodNullable<z.ZodNumber>;
|
|
348
|
+
}, "strip", z.ZodTypeAny, {
|
|
349
|
+
name: string | null;
|
|
350
|
+
id: string;
|
|
351
|
+
category: string | null;
|
|
352
|
+
difficulty: string | null;
|
|
353
|
+
met: number | null;
|
|
354
|
+
}, {
|
|
355
|
+
name: string | null;
|
|
356
|
+
id: string;
|
|
357
|
+
category: string | null;
|
|
358
|
+
difficulty: string | null;
|
|
359
|
+
met: number | null;
|
|
360
|
+
}>;
|
|
361
|
+
export declare const activityList: z.ZodObject<{
|
|
362
|
+
/**
|
|
363
|
+
* The page the service says it answered, not the page that was asked for, so
|
|
364
|
+
* a mismatch shows instead of being assumed away. When the response carries
|
|
365
|
+
* no page the requested one stands in, because there is nothing else to say.
|
|
366
|
+
*/
|
|
367
|
+
page: z.ZodNumber;
|
|
368
|
+
/**
|
|
369
|
+
* How many activities match the search, across all pages, as the service
|
|
370
|
+
* counts them. Null when the response carried no count: `returned` would
|
|
371
|
+
* turn a missing total into a confident wrong one.
|
|
372
|
+
*/
|
|
373
|
+
total: z.ZodNullable<z.ZodNumber>;
|
|
374
|
+
returned: z.ZodNumber;
|
|
375
|
+
/**
|
|
376
|
+
* Whether the service offered a next page, and only that: it is its own
|
|
377
|
+
* next-page token, never arithmetic over `total`.
|
|
378
|
+
*
|
|
379
|
+
* Which means it can be false while `total` is far above the rows in hand —
|
|
380
|
+
* and that is the ordinary last page of a large result, not a fault. The
|
|
381
|
+
* reasoning, and what the connector gives up by not inferring more, is on
|
|
382
|
+
* `toActivityList`.
|
|
383
|
+
*/
|
|
384
|
+
hasMore: z.ZodBoolean;
|
|
385
|
+
activities: z.ZodArray<z.ZodObject<{
|
|
386
|
+
/** `activityId` upstream, an integer there; it is a string here, like every id this connector returns. */
|
|
387
|
+
id: z.ZodString;
|
|
388
|
+
/** In the first language the service published, Spanish preferred. Null when none came. */
|
|
389
|
+
name: z.ZodNullable<z.ZodString>;
|
|
390
|
+
/**
|
|
391
|
+
* What the service calls this activity's `category`: `WEIGHT_MACHINE_BASED`,
|
|
392
|
+
* `EGYM_MACHINE`, `FREE_WEIGHTS`, `BODY_WEIGHT_BASED`, `FITNESS_CLASS`, `SPORT`,
|
|
393
|
+
* `STRETCHING`, `ELLIPTICAL`, `TREADMILL` or `BIKES`, as recorded.
|
|
394
|
+
*
|
|
395
|
+
* **Not the `category` the search filters by.** That one is `STRENGTH`,
|
|
396
|
+
* `COORDINATION`, `MOBILITY` or `FITNESS_CLASS`; both are the service's own
|
|
397
|
+
* words for two different things. A row read back as `FREE_WEIGHTS` from a
|
|
398
|
+
* search filtered by `STRENGTH` is the filter working, not being ignored.
|
|
399
|
+
* Kept under the service's name so a recorded field is not renamed out of
|
|
400
|
+
* sight of where it came from. A plain string, not an enum: a new value
|
|
401
|
+
* should reach the model, not fail the whole list.
|
|
402
|
+
*/
|
|
403
|
+
category: z.ZodNullable<z.ZodString>;
|
|
404
|
+
difficulty: z.ZodNullable<z.ZodString>;
|
|
405
|
+
/** The metabolic equivalent the service reports for the activity. */
|
|
406
|
+
met: z.ZodNullable<z.ZodNumber>;
|
|
407
|
+
}, "strip", z.ZodTypeAny, {
|
|
408
|
+
name: string | null;
|
|
409
|
+
id: string;
|
|
410
|
+
category: string | null;
|
|
411
|
+
difficulty: string | null;
|
|
412
|
+
met: number | null;
|
|
413
|
+
}, {
|
|
414
|
+
name: string | null;
|
|
415
|
+
id: string;
|
|
416
|
+
category: string | null;
|
|
417
|
+
difficulty: string | null;
|
|
418
|
+
met: number | null;
|
|
419
|
+
}>, "many">;
|
|
420
|
+
}, "strip", z.ZodTypeAny, {
|
|
421
|
+
total: number | null;
|
|
422
|
+
returned: number;
|
|
423
|
+
page: number;
|
|
424
|
+
hasMore: boolean;
|
|
425
|
+
activities: {
|
|
426
|
+
name: string | null;
|
|
427
|
+
id: string;
|
|
428
|
+
category: string | null;
|
|
429
|
+
difficulty: string | null;
|
|
430
|
+
met: number | null;
|
|
431
|
+
}[];
|
|
432
|
+
}, {
|
|
433
|
+
total: number | null;
|
|
434
|
+
returned: number;
|
|
435
|
+
page: number;
|
|
436
|
+
hasMore: boolean;
|
|
437
|
+
activities: {
|
|
438
|
+
name: string | null;
|
|
439
|
+
id: string;
|
|
440
|
+
category: string | null;
|
|
441
|
+
difficulty: string | null;
|
|
442
|
+
met: number | null;
|
|
443
|
+
}[];
|
|
444
|
+
}>;
|
|
445
|
+
export type Activity = z.infer<typeof activity>;
|
|
446
|
+
export type ActivityList = z.infer<typeof activityList>;
|
|
447
|
+
/**
|
|
448
|
+
* One set of a planned exercise. Fields the service left null are absent, so a
|
|
449
|
+
* cardio set reads `{ type: "TIME_BASED", durationSeconds: 300 }` and not a row
|
|
450
|
+
* of nulls.
|
|
451
|
+
*/
|
|
452
|
+
export declare const plannedSet: z.ZodObject<{
|
|
453
|
+
/** `REP_BASED` or `TIME_BASED` as recorded; a plain string so a new kind reaches the model. */
|
|
454
|
+
type: z.ZodNullable<z.ZodString>;
|
|
455
|
+
reps: z.ZodOptional<z.ZodNumber>;
|
|
456
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
457
|
+
/** Kilograms: the plans call asks for `measurementSystem=METRIC`. */
|
|
458
|
+
weightKg: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
}, "strip", z.ZodTypeAny, {
|
|
460
|
+
type: string | null;
|
|
461
|
+
reps?: number | undefined;
|
|
462
|
+
durationSeconds?: number | undefined;
|
|
463
|
+
weightKg?: number | undefined;
|
|
464
|
+
}, {
|
|
465
|
+
type: string | null;
|
|
466
|
+
reps?: number | undefined;
|
|
467
|
+
durationSeconds?: number | undefined;
|
|
468
|
+
weightKg?: number | undefined;
|
|
469
|
+
}>;
|
|
470
|
+
export declare const plannedExercise: z.ZodObject<{
|
|
471
|
+
/** The entry of this exercise in this plan (`plannedExercises[].id`), not the catalogue id. */
|
|
472
|
+
plannedExerciseId: z.ZodString;
|
|
473
|
+
/** The catalogue id, the one `duin_search_activities` returns as `id`. */
|
|
474
|
+
activityId: z.ZodString;
|
|
475
|
+
/** Spanish, then English, then any language the service sent. */
|
|
476
|
+
name: z.ZodNullable<z.ZodString>;
|
|
477
|
+
/** The activity's own `category`, such as `TREADMILL` or `EGYM_MACHINE`. */
|
|
478
|
+
category: z.ZodNullable<z.ZodString>;
|
|
479
|
+
/** The (at most) three muscles the activity loads most, strongest first. */
|
|
480
|
+
primaryMuscles: z.ZodArray<z.ZodString, "many">;
|
|
481
|
+
sets: z.ZodArray<z.ZodObject<{
|
|
482
|
+
/** `REP_BASED` or `TIME_BASED` as recorded; a plain string so a new kind reaches the model. */
|
|
483
|
+
type: z.ZodNullable<z.ZodString>;
|
|
484
|
+
reps: z.ZodOptional<z.ZodNumber>;
|
|
485
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
486
|
+
/** Kilograms: the plans call asks for `measurementSystem=METRIC`. */
|
|
487
|
+
weightKg: z.ZodOptional<z.ZodNumber>;
|
|
488
|
+
}, "strip", z.ZodTypeAny, {
|
|
489
|
+
type: string | null;
|
|
490
|
+
reps?: number | undefined;
|
|
491
|
+
durationSeconds?: number | undefined;
|
|
492
|
+
weightKg?: number | undefined;
|
|
493
|
+
}, {
|
|
494
|
+
type: string | null;
|
|
495
|
+
reps?: number | undefined;
|
|
496
|
+
durationSeconds?: number | undefined;
|
|
497
|
+
weightKg?: number | undefined;
|
|
498
|
+
}>, "many">;
|
|
499
|
+
}, "strip", z.ZodTypeAny, {
|
|
500
|
+
name: string | null;
|
|
501
|
+
category: string | null;
|
|
502
|
+
plannedExerciseId: string;
|
|
503
|
+
activityId: string;
|
|
504
|
+
primaryMuscles: string[];
|
|
505
|
+
sets: {
|
|
506
|
+
type: string | null;
|
|
507
|
+
reps?: number | undefined;
|
|
508
|
+
durationSeconds?: number | undefined;
|
|
509
|
+
weightKg?: number | undefined;
|
|
510
|
+
}[];
|
|
511
|
+
}, {
|
|
512
|
+
name: string | null;
|
|
513
|
+
category: string | null;
|
|
514
|
+
plannedExerciseId: string;
|
|
515
|
+
activityId: string;
|
|
516
|
+
primaryMuscles: string[];
|
|
517
|
+
sets: {
|
|
518
|
+
type: string | null;
|
|
519
|
+
reps?: number | undefined;
|
|
520
|
+
durationSeconds?: number | undefined;
|
|
521
|
+
weightKg?: number | undefined;
|
|
522
|
+
}[];
|
|
523
|
+
}>;
|
|
524
|
+
export declare const planDetail: z.ZodObject<{
|
|
525
|
+
id: z.ZodString;
|
|
526
|
+
name: z.ZodNullable<z.ZodString>;
|
|
527
|
+
groupType: z.ZodNullable<z.ZodString>;
|
|
528
|
+
editable: z.ZodNullable<z.ZodBoolean>;
|
|
529
|
+
deletable: z.ZodNullable<z.ZodBoolean>;
|
|
530
|
+
exercises: z.ZodArray<z.ZodObject<{
|
|
531
|
+
/** The entry of this exercise in this plan (`plannedExercises[].id`), not the catalogue id. */
|
|
532
|
+
plannedExerciseId: z.ZodString;
|
|
533
|
+
/** The catalogue id, the one `duin_search_activities` returns as `id`. */
|
|
534
|
+
activityId: z.ZodString;
|
|
535
|
+
/** Spanish, then English, then any language the service sent. */
|
|
536
|
+
name: z.ZodNullable<z.ZodString>;
|
|
537
|
+
/** The activity's own `category`, such as `TREADMILL` or `EGYM_MACHINE`. */
|
|
538
|
+
category: z.ZodNullable<z.ZodString>;
|
|
539
|
+
/** The (at most) three muscles the activity loads most, strongest first. */
|
|
540
|
+
primaryMuscles: z.ZodArray<z.ZodString, "many">;
|
|
541
|
+
sets: z.ZodArray<z.ZodObject<{
|
|
542
|
+
/** `REP_BASED` or `TIME_BASED` as recorded; a plain string so a new kind reaches the model. */
|
|
543
|
+
type: z.ZodNullable<z.ZodString>;
|
|
544
|
+
reps: z.ZodOptional<z.ZodNumber>;
|
|
545
|
+
durationSeconds: z.ZodOptional<z.ZodNumber>;
|
|
546
|
+
/** Kilograms: the plans call asks for `measurementSystem=METRIC`. */
|
|
547
|
+
weightKg: z.ZodOptional<z.ZodNumber>;
|
|
548
|
+
}, "strip", z.ZodTypeAny, {
|
|
549
|
+
type: string | null;
|
|
550
|
+
reps?: number | undefined;
|
|
551
|
+
durationSeconds?: number | undefined;
|
|
552
|
+
weightKg?: number | undefined;
|
|
553
|
+
}, {
|
|
554
|
+
type: string | null;
|
|
555
|
+
reps?: number | undefined;
|
|
556
|
+
durationSeconds?: number | undefined;
|
|
557
|
+
weightKg?: number | undefined;
|
|
558
|
+
}>, "many">;
|
|
559
|
+
}, "strip", z.ZodTypeAny, {
|
|
560
|
+
name: string | null;
|
|
561
|
+
category: string | null;
|
|
562
|
+
plannedExerciseId: string;
|
|
563
|
+
activityId: string;
|
|
564
|
+
primaryMuscles: string[];
|
|
565
|
+
sets: {
|
|
566
|
+
type: string | null;
|
|
567
|
+
reps?: number | undefined;
|
|
568
|
+
durationSeconds?: number | undefined;
|
|
569
|
+
weightKg?: number | undefined;
|
|
570
|
+
}[];
|
|
571
|
+
}, {
|
|
572
|
+
name: string | null;
|
|
573
|
+
category: string | null;
|
|
574
|
+
plannedExerciseId: string;
|
|
575
|
+
activityId: string;
|
|
576
|
+
primaryMuscles: string[];
|
|
577
|
+
sets: {
|
|
578
|
+
type: string | null;
|
|
579
|
+
reps?: number | undefined;
|
|
580
|
+
durationSeconds?: number | undefined;
|
|
581
|
+
weightKg?: number | undefined;
|
|
582
|
+
}[];
|
|
583
|
+
}>, "many">;
|
|
584
|
+
}, "strip", z.ZodTypeAny, {
|
|
585
|
+
name: string | null;
|
|
586
|
+
id: string;
|
|
587
|
+
groupType: string | null;
|
|
588
|
+
editable: boolean | null;
|
|
589
|
+
deletable: boolean | null;
|
|
590
|
+
exercises: {
|
|
591
|
+
name: string | null;
|
|
592
|
+
category: string | null;
|
|
593
|
+
plannedExerciseId: string;
|
|
594
|
+
activityId: string;
|
|
595
|
+
primaryMuscles: string[];
|
|
596
|
+
sets: {
|
|
597
|
+
type: string | null;
|
|
598
|
+
reps?: number | undefined;
|
|
599
|
+
durationSeconds?: number | undefined;
|
|
600
|
+
weightKg?: number | undefined;
|
|
601
|
+
}[];
|
|
602
|
+
}[];
|
|
603
|
+
}, {
|
|
604
|
+
name: string | null;
|
|
605
|
+
id: string;
|
|
606
|
+
groupType: string | null;
|
|
607
|
+
editable: boolean | null;
|
|
608
|
+
deletable: boolean | null;
|
|
609
|
+
exercises: {
|
|
610
|
+
name: string | null;
|
|
611
|
+
category: string | null;
|
|
612
|
+
plannedExerciseId: string;
|
|
613
|
+
activityId: string;
|
|
614
|
+
primaryMuscles: string[];
|
|
615
|
+
sets: {
|
|
616
|
+
type: string | null;
|
|
617
|
+
reps?: number | undefined;
|
|
618
|
+
durationSeconds?: number | undefined;
|
|
619
|
+
weightKg?: number | undefined;
|
|
620
|
+
}[];
|
|
621
|
+
}[];
|
|
622
|
+
}>;
|
|
623
|
+
export type PlannedSet = z.infer<typeof plannedSet>;
|
|
624
|
+
export type PlannedExercise = z.infer<typeof plannedExercise>;
|
|
625
|
+
export type PlanDetail = z.infer<typeof planDetail>;
|
|
626
|
+
//# sourceMappingURL=shapes.d.ts.map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