hevy-mcp 1.0.0 → 1.0.1
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.js +1009 -855
- package/dist/index.js.map +1 -1
- package/package.json +14 -8
package/dist/index.js
CHANGED
|
@@ -867,8 +867,455 @@ function calculateDuration(startTime, endTime) {
|
|
|
867
867
|
}
|
|
868
868
|
|
|
869
869
|
// src/utils/hevyClient.ts
|
|
870
|
+
import {
|
|
871
|
+
ApiKeyAuthenticationProvider,
|
|
872
|
+
ApiKeyLocation
|
|
873
|
+
} from "@microsoft/kiota-abstractions";
|
|
870
874
|
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
|
|
871
875
|
|
|
876
|
+
// src/generated/client/hevyClient.ts
|
|
877
|
+
import {
|
|
878
|
+
apiClientProxifier,
|
|
879
|
+
registerDefaultDeserializer,
|
|
880
|
+
registerDefaultSerializer
|
|
881
|
+
} from "@microsoft/kiota-abstractions";
|
|
882
|
+
|
|
883
|
+
// ../node_modules/@microsoft/kiota-serialization-form/dist/es/src/formParseNode.js
|
|
884
|
+
import { createBackedModelProxyHandler, DateOnly, Duration, parseGuidString, TimeOnly, isBackingStoreEnabled, getEnumValueFromStringValue } from "@microsoft/kiota-abstractions";
|
|
885
|
+
var FormParseNode = class _FormParseNode {
|
|
886
|
+
/**
|
|
887
|
+
* Creates a new instance of FormParseNode
|
|
888
|
+
* @param _rawString the raw string to parse
|
|
889
|
+
* @param backingStoreFactory the factory to create backing stores
|
|
890
|
+
*/
|
|
891
|
+
constructor(_rawString, backingStoreFactory) {
|
|
892
|
+
this._rawString = _rawString;
|
|
893
|
+
this.backingStoreFactory = backingStoreFactory;
|
|
894
|
+
this._fields = {};
|
|
895
|
+
this.normalizeKey = (key) => decodeURIComponent(key).trim();
|
|
896
|
+
this.getStringValue = () => decodeURIComponent(this._rawString);
|
|
897
|
+
this.getChildNode = (identifier) => {
|
|
898
|
+
if (this._fields[identifier]) {
|
|
899
|
+
return new _FormParseNode(this._fields[identifier], this.backingStoreFactory);
|
|
900
|
+
}
|
|
901
|
+
return void 0;
|
|
902
|
+
};
|
|
903
|
+
this.getBooleanValue = () => {
|
|
904
|
+
var _a;
|
|
905
|
+
const value = (_a = this.getStringValue()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
906
|
+
if (value === "true" || value === "1") {
|
|
907
|
+
return true;
|
|
908
|
+
} else if (value === "false" || value === "0") {
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
return void 0;
|
|
912
|
+
};
|
|
913
|
+
this.getNumberValue = () => parseFloat(this.getStringValue());
|
|
914
|
+
this.getGuidValue = () => parseGuidString(this.getStringValue());
|
|
915
|
+
this.getDateValue = () => new Date(Date.parse(this.getStringValue()));
|
|
916
|
+
this.getDateOnlyValue = () => DateOnly.parse(this.getStringValue());
|
|
917
|
+
this.getTimeOnlyValue = () => TimeOnly.parse(this.getStringValue());
|
|
918
|
+
this.getDurationValue = () => Duration.parse(this.getStringValue());
|
|
919
|
+
this.getCollectionOfPrimitiveValues = () => {
|
|
920
|
+
return this._rawString.split(",").map((x) => {
|
|
921
|
+
const currentParseNode = new _FormParseNode(x, this.backingStoreFactory);
|
|
922
|
+
const typeOfX = typeof x;
|
|
923
|
+
if (typeOfX === "boolean") {
|
|
924
|
+
return currentParseNode.getBooleanValue();
|
|
925
|
+
} else if (typeOfX === "string") {
|
|
926
|
+
return currentParseNode.getStringValue();
|
|
927
|
+
} else if (typeOfX === "number") {
|
|
928
|
+
return currentParseNode.getNumberValue();
|
|
929
|
+
} else if (x instanceof Date) {
|
|
930
|
+
return currentParseNode.getDateValue();
|
|
931
|
+
} else if (x instanceof DateOnly) {
|
|
932
|
+
return currentParseNode.getDateValue();
|
|
933
|
+
} else if (x instanceof TimeOnly) {
|
|
934
|
+
return currentParseNode.getDateValue();
|
|
935
|
+
} else if (x instanceof Duration) {
|
|
936
|
+
return currentParseNode.getDateValue();
|
|
937
|
+
} else {
|
|
938
|
+
throw new Error(`encountered an unknown type during deserialization ${typeof x}`);
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
};
|
|
942
|
+
this.getCollectionOfObjectValues = (parsableFactory) => {
|
|
943
|
+
throw new Error(`serialization of collections is not supported with URI encoding`);
|
|
944
|
+
};
|
|
945
|
+
this.getObjectValue = (parsableFactory) => {
|
|
946
|
+
const temp = {};
|
|
947
|
+
const enableBackingStore = isBackingStoreEnabled(parsableFactory(this)(temp));
|
|
948
|
+
const value = enableBackingStore && this.backingStoreFactory ? new Proxy(temp, createBackedModelProxyHandler(this.backingStoreFactory)) : temp;
|
|
949
|
+
if (this.onBeforeAssignFieldValues) {
|
|
950
|
+
this.onBeforeAssignFieldValues(value);
|
|
951
|
+
}
|
|
952
|
+
this.assignFieldValues(value, parsableFactory);
|
|
953
|
+
if (this.onAfterAssignFieldValues) {
|
|
954
|
+
this.onAfterAssignFieldValues(value);
|
|
955
|
+
}
|
|
956
|
+
return value;
|
|
957
|
+
};
|
|
958
|
+
this.getCollectionOfEnumValues = (type) => {
|
|
959
|
+
const rawValues = this.getStringValue();
|
|
960
|
+
if (!rawValues) {
|
|
961
|
+
return [];
|
|
962
|
+
}
|
|
963
|
+
return rawValues.split(",").map((x) => getEnumValueFromStringValue(x, type));
|
|
964
|
+
};
|
|
965
|
+
this.getEnumValue = (type) => {
|
|
966
|
+
const rawValue = this.getStringValue();
|
|
967
|
+
if (!rawValue) {
|
|
968
|
+
return void 0;
|
|
969
|
+
}
|
|
970
|
+
return getEnumValueFromStringValue(rawValue, type);
|
|
971
|
+
};
|
|
972
|
+
this.assignFieldValues = (model, parsableFactory) => {
|
|
973
|
+
const fields = parsableFactory(this)(model);
|
|
974
|
+
Object.entries(this._fields).filter((x) => !/^null$/i.test(x[1])).forEach(([k, v]) => {
|
|
975
|
+
const deserializer = fields[k];
|
|
976
|
+
if (deserializer) {
|
|
977
|
+
deserializer(new _FormParseNode(v, this.backingStoreFactory));
|
|
978
|
+
} else {
|
|
979
|
+
model[k] = v;
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
};
|
|
983
|
+
if (!_rawString) {
|
|
984
|
+
throw new Error("rawString cannot be undefined");
|
|
985
|
+
}
|
|
986
|
+
_rawString.split("&").map((x) => x.split("=")).filter((x) => x.length === 2).forEach((x) => {
|
|
987
|
+
const key = this.normalizeKey(x[0]);
|
|
988
|
+
if (this._fields[key]) {
|
|
989
|
+
this._fields[key] += "," + x[1];
|
|
990
|
+
} else {
|
|
991
|
+
this._fields[key] = x[1];
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
getByteArrayValue() {
|
|
996
|
+
throw new Error("serialization of byt arrays is not supported with URI encoding");
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
// ../node_modules/@microsoft/kiota-serialization-form/dist/es/src/formSerializationWriter.js
|
|
1001
|
+
import { DateOnly as DateOnly2, Duration as Duration2, TimeOnly as TimeOnly2 } from "@microsoft/kiota-abstractions";
|
|
1002
|
+
var FormSerializationWriter = class _FormSerializationWriter {
|
|
1003
|
+
constructor() {
|
|
1004
|
+
this.writer = [];
|
|
1005
|
+
this.depth = -1;
|
|
1006
|
+
this.writeStringValue = (key, value) => {
|
|
1007
|
+
if (value === null) {
|
|
1008
|
+
value = "null";
|
|
1009
|
+
}
|
|
1010
|
+
if (key && value) {
|
|
1011
|
+
this.writePropertyName(key);
|
|
1012
|
+
this.writer.push(`=${encodeURIComponent(value)}`);
|
|
1013
|
+
this.writer.push(_FormSerializationWriter.propertySeparator);
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
this.writePropertyName = (key) => {
|
|
1017
|
+
this.writer.push(encodeURIComponent(key));
|
|
1018
|
+
};
|
|
1019
|
+
this.shouldWriteValueOrNull = (key, value) => {
|
|
1020
|
+
if (value === null) {
|
|
1021
|
+
this.writeNullValue(key);
|
|
1022
|
+
return false;
|
|
1023
|
+
}
|
|
1024
|
+
return true;
|
|
1025
|
+
};
|
|
1026
|
+
this.writeBooleanValue = (key, value) => {
|
|
1027
|
+
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1028
|
+
value !== void 0 && this.writeStringValue(key, `${value}`);
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
this.writeNumberValue = (key, value) => {
|
|
1032
|
+
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1033
|
+
value && this.writeStringValue(key, `${value}`);
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1036
|
+
this.writeGuidValue = (key, value) => {
|
|
1037
|
+
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1038
|
+
value && this.writeStringValue(key, value.toString());
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
this.writeDateValue = (key, value) => {
|
|
1042
|
+
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1043
|
+
value && this.writeStringValue(key, value.toISOString());
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
this.writeDateOnlyValue = (key, value) => {
|
|
1047
|
+
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1048
|
+
value && this.writeStringValue(key, value.toString());
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
|
+
this.writeTimeOnlyValue = (key, value) => {
|
|
1052
|
+
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1053
|
+
value && this.writeStringValue(key, value.toString());
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
this.writeDurationValue = (key, value) => {
|
|
1057
|
+
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1058
|
+
value && this.writeStringValue(key, value.toString());
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
this.writeNullValue = (key) => {
|
|
1062
|
+
key && this.writeStringValue(key, null);
|
|
1063
|
+
};
|
|
1064
|
+
this.writeCollectionOfPrimitiveValues = (_key, _values) => {
|
|
1065
|
+
if (_key && _values) {
|
|
1066
|
+
_values.forEach((val) => {
|
|
1067
|
+
this.writeAnyValue(_key, val);
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
this.writeCollectionOfObjectValues = (_key, _values) => {
|
|
1072
|
+
throw new Error(`serialization of collections is not supported with URI encoding`);
|
|
1073
|
+
};
|
|
1074
|
+
this.writeObjectValue = (key, value, serializerMethod) => {
|
|
1075
|
+
if (++this.depth > 0) {
|
|
1076
|
+
throw new Error(`serialization of nested objects is not supported with URI encoding`);
|
|
1077
|
+
}
|
|
1078
|
+
if (!this.shouldWriteValueOrNull(key, value)) {
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
if (value) {
|
|
1082
|
+
if (key) {
|
|
1083
|
+
this.writePropertyName(key);
|
|
1084
|
+
}
|
|
1085
|
+
this.onBeforeObjectSerialization && this.onBeforeObjectSerialization(value);
|
|
1086
|
+
this.onStartObjectSerialization && this.onStartObjectSerialization(value, this);
|
|
1087
|
+
serializerMethod(this, value);
|
|
1088
|
+
this.onAfterObjectSerialization && this.onAfterObjectSerialization(value);
|
|
1089
|
+
if (this.writer.length > 0 && this.writer[this.writer.length - 1] === _FormSerializationWriter.propertySeparator) {
|
|
1090
|
+
this.writer.pop();
|
|
1091
|
+
}
|
|
1092
|
+
key && this.writer.push(_FormSerializationWriter.propertySeparator);
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
this.writeEnumValue = (key, ...values) => {
|
|
1096
|
+
if (values.length > 0) {
|
|
1097
|
+
const rawValues = values.filter((x) => x !== void 0).map((x) => `${x}`);
|
|
1098
|
+
if (rawValues.length > 0) {
|
|
1099
|
+
this.writeStringValue(key, rawValues.reduce((x, y) => `${x}, ${y}`));
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
this.writeCollectionOfEnumValues = (key, values) => {
|
|
1104
|
+
if (key && values && values.length > 0) {
|
|
1105
|
+
const rawValues = values.filter((x) => x !== void 0).map((x) => `${x}`);
|
|
1106
|
+
if (rawValues.length > 0) {
|
|
1107
|
+
this.writeCollectionOfPrimitiveValues(key, rawValues);
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
};
|
|
1111
|
+
this.getSerializedContent = () => {
|
|
1112
|
+
return this.convertStringToArrayBuffer(this.writer.join(``));
|
|
1113
|
+
};
|
|
1114
|
+
this.convertStringToArrayBuffer = (str) => {
|
|
1115
|
+
const encoder = new TextEncoder();
|
|
1116
|
+
const encodedString = encoder.encode(str);
|
|
1117
|
+
return encodedString.buffer;
|
|
1118
|
+
};
|
|
1119
|
+
this.writeAdditionalData = (additionalData) => {
|
|
1120
|
+
if (additionalData === void 0)
|
|
1121
|
+
return;
|
|
1122
|
+
for (const key in additionalData) {
|
|
1123
|
+
this.writeAnyValue(key, additionalData[key]);
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
this.writeAnyValue = (key, value) => {
|
|
1127
|
+
if (value === null) {
|
|
1128
|
+
return this.writeNullValue(key);
|
|
1129
|
+
}
|
|
1130
|
+
if (value !== void 0) {
|
|
1131
|
+
const valueType = typeof value;
|
|
1132
|
+
if (valueType === "boolean") {
|
|
1133
|
+
this.writeBooleanValue(key, value);
|
|
1134
|
+
} else if (valueType === "string") {
|
|
1135
|
+
this.writeStringValue(key, value);
|
|
1136
|
+
} else if (value instanceof Date) {
|
|
1137
|
+
this.writeDateValue(key, value);
|
|
1138
|
+
} else if (value instanceof DateOnly2) {
|
|
1139
|
+
this.writeDateOnlyValue(key, value);
|
|
1140
|
+
} else if (value instanceof TimeOnly2) {
|
|
1141
|
+
this.writeTimeOnlyValue(key, value);
|
|
1142
|
+
} else if (value instanceof Duration2) {
|
|
1143
|
+
this.writeDurationValue(key, value);
|
|
1144
|
+
} else if (valueType === "number") {
|
|
1145
|
+
this.writeNumberValue(key, value);
|
|
1146
|
+
} else {
|
|
1147
|
+
throw new Error(`encountered unknown ${value} value type during serialization ${valueType} for key ${key}`);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
writeByteArrayValue(key, value) {
|
|
1153
|
+
throw new Error("serialization of byt arrays is not supported with URI encoding");
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
FormSerializationWriter.propertySeparator = `&`;
|
|
1157
|
+
|
|
1158
|
+
// ../node_modules/@microsoft/kiota-serialization-form/dist/es/src/formParseNodeFactory.js
|
|
1159
|
+
var FormParseNodeFactory = class {
|
|
1160
|
+
/**
|
|
1161
|
+
* Creates an instance of JsonParseNode.
|
|
1162
|
+
* @param backingStoreFactory - The factory to create backing stores.
|
|
1163
|
+
*/
|
|
1164
|
+
constructor(backingStoreFactory) {
|
|
1165
|
+
this.backingStoreFactory = backingStoreFactory;
|
|
1166
|
+
}
|
|
1167
|
+
getValidContentType() {
|
|
1168
|
+
return "application/x-www-form-urlencoded";
|
|
1169
|
+
}
|
|
1170
|
+
getRootParseNode(contentType, content) {
|
|
1171
|
+
if (!content) {
|
|
1172
|
+
throw new Error("content cannot be undefined of empty");
|
|
1173
|
+
} else if (!contentType) {
|
|
1174
|
+
throw new Error("content type cannot be undefined or empty");
|
|
1175
|
+
} else if (this.getValidContentType() !== contentType) {
|
|
1176
|
+
throw new Error(`expected a ${this.getValidContentType()} content type`);
|
|
1177
|
+
}
|
|
1178
|
+
return new FormParseNode(this.convertArrayBufferToString(content), this.backingStoreFactory);
|
|
1179
|
+
}
|
|
1180
|
+
convertArrayBufferToString(content) {
|
|
1181
|
+
const decoder = new TextDecoder();
|
|
1182
|
+
return decoder.decode(content);
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
// ../node_modules/@microsoft/kiota-serialization-form/dist/es/src/formSerializationWriterFactory.js
|
|
1187
|
+
var FormSerializationWriterFactory = class {
|
|
1188
|
+
getValidContentType() {
|
|
1189
|
+
return "application/x-www-form-urlencoded";
|
|
1190
|
+
}
|
|
1191
|
+
getSerializationWriter(contentType) {
|
|
1192
|
+
if (!contentType) {
|
|
1193
|
+
throw new Error("content type cannot be undefined or empty");
|
|
1194
|
+
} else if (this.getValidContentType() !== contentType) {
|
|
1195
|
+
throw new Error(`expected a ${this.getValidContentType()} content type`);
|
|
1196
|
+
}
|
|
1197
|
+
return new FormSerializationWriter();
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
// src/generated/client/hevyClient.ts
|
|
1202
|
+
import {
|
|
1203
|
+
JsonParseNodeFactory,
|
|
1204
|
+
JsonSerializationWriterFactory
|
|
1205
|
+
} from "@microsoft/kiota-serialization-json";
|
|
1206
|
+
|
|
1207
|
+
// ../node_modules/@microsoft/kiota-serialization-multipart/dist/es/src/multipartSerializationWriter.js
|
|
1208
|
+
import { MultipartBody } from "@microsoft/kiota-abstractions";
|
|
1209
|
+
var MultipartSerializationWriter = class {
|
|
1210
|
+
constructor() {
|
|
1211
|
+
this.writer = new ArrayBuffer(0);
|
|
1212
|
+
this.writeStringValue = (key, value) => {
|
|
1213
|
+
if (key) {
|
|
1214
|
+
this.writeRawStringValue(key);
|
|
1215
|
+
}
|
|
1216
|
+
if (value) {
|
|
1217
|
+
if (key) {
|
|
1218
|
+
this.writeRawStringValue(": ");
|
|
1219
|
+
}
|
|
1220
|
+
this.writeRawStringValue(value);
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
this.writeRawStringValue = (value) => {
|
|
1224
|
+
if (value) {
|
|
1225
|
+
this.writeByteArrayValue(void 0, new TextEncoder().encode(value).buffer);
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
this.writeBooleanValue = (key, value) => {
|
|
1229
|
+
throw new Error(`serialization of boolean values is not supported with multipart`);
|
|
1230
|
+
};
|
|
1231
|
+
this.writeNumberValue = (key, value) => {
|
|
1232
|
+
throw new Error(`serialization of number values is not supported with multipart`);
|
|
1233
|
+
};
|
|
1234
|
+
this.writeGuidValue = (key, value) => {
|
|
1235
|
+
throw new Error(`serialization of guid values is not supported with multipart`);
|
|
1236
|
+
};
|
|
1237
|
+
this.writeDateValue = (key, value) => {
|
|
1238
|
+
throw new Error(`serialization of date values is not supported with multipart`);
|
|
1239
|
+
};
|
|
1240
|
+
this.writeDateOnlyValue = (key, value) => {
|
|
1241
|
+
throw new Error(`serialization of date only values is not supported with multipart`);
|
|
1242
|
+
};
|
|
1243
|
+
this.writeTimeOnlyValue = (key, value) => {
|
|
1244
|
+
throw new Error(`serialization of time only values is not supported with multipart`);
|
|
1245
|
+
};
|
|
1246
|
+
this.writeDurationValue = (key, value) => {
|
|
1247
|
+
throw new Error(`serialization of duration values is not supported with multipart`);
|
|
1248
|
+
};
|
|
1249
|
+
this.writeNullValue = (key) => {
|
|
1250
|
+
throw new Error(`serialization of null values is not supported with multipart`);
|
|
1251
|
+
};
|
|
1252
|
+
this.writeCollectionOfPrimitiveValues = (_key, _values) => {
|
|
1253
|
+
throw new Error(`serialization of collections is not supported with multipart`);
|
|
1254
|
+
};
|
|
1255
|
+
this.writeCollectionOfObjectValues = (_key, _values) => {
|
|
1256
|
+
throw new Error(`serialization of collections is not supported with multipart`);
|
|
1257
|
+
};
|
|
1258
|
+
this.writeObjectValue = (key, value, serializerMethod) => {
|
|
1259
|
+
if (!value) {
|
|
1260
|
+
throw new Error(`value cannot be undefined`);
|
|
1261
|
+
}
|
|
1262
|
+
if (!(value instanceof MultipartBody)) {
|
|
1263
|
+
throw new Error(`expected MultipartBody instance`);
|
|
1264
|
+
}
|
|
1265
|
+
if (!serializerMethod) {
|
|
1266
|
+
throw new Error(`serializer method cannot be undefined`);
|
|
1267
|
+
}
|
|
1268
|
+
this.onBeforeObjectSerialization && this.onBeforeObjectSerialization(value);
|
|
1269
|
+
this.onStartObjectSerialization && this.onStartObjectSerialization(value, this);
|
|
1270
|
+
serializerMethod(this, value);
|
|
1271
|
+
this.onAfterObjectSerialization && this.onAfterObjectSerialization(value);
|
|
1272
|
+
};
|
|
1273
|
+
this.writeEnumValue = (key, ...values) => {
|
|
1274
|
+
throw new Error(`serialization of enum values is not supported with multipart`);
|
|
1275
|
+
};
|
|
1276
|
+
this.writeCollectionOfEnumValues = (key, values) => {
|
|
1277
|
+
throw new Error(`serialization of collection of enum values is not supported with multipart`);
|
|
1278
|
+
};
|
|
1279
|
+
this.getSerializedContent = () => {
|
|
1280
|
+
return this.writer;
|
|
1281
|
+
};
|
|
1282
|
+
this.writeAdditionalData = (additionalData) => {
|
|
1283
|
+
throw new Error(`serialization of additional data is not supported with multipart`);
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
writeByteArrayValue(key, value) {
|
|
1287
|
+
if (!value) {
|
|
1288
|
+
throw new Error("value cannot be undefined");
|
|
1289
|
+
}
|
|
1290
|
+
const previousValue = this.writer;
|
|
1291
|
+
this.writer = new ArrayBuffer(previousValue.byteLength + value.byteLength);
|
|
1292
|
+
const pipe = new Uint8Array(this.writer);
|
|
1293
|
+
pipe.set(new Uint8Array(previousValue), 0);
|
|
1294
|
+
pipe.set(new Uint8Array(value), previousValue.byteLength);
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1298
|
+
// ../node_modules/@microsoft/kiota-serialization-multipart/dist/es/src/multipartSerializationWriterFactory.js
|
|
1299
|
+
var MultipartSerializationWriterFactory = class {
|
|
1300
|
+
getValidContentType() {
|
|
1301
|
+
return "multipart/form-data";
|
|
1302
|
+
}
|
|
1303
|
+
getSerializationWriter(contentType) {
|
|
1304
|
+
if (!contentType) {
|
|
1305
|
+
throw new Error("content type cannot be undefined or empty");
|
|
1306
|
+
} else if (this.getValidContentType() !== contentType) {
|
|
1307
|
+
throw new Error(`expected a ${this.getValidContentType()} content type`);
|
|
1308
|
+
}
|
|
1309
|
+
return new MultipartSerializationWriter();
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
|
|
1313
|
+
// src/generated/client/hevyClient.ts
|
|
1314
|
+
import {
|
|
1315
|
+
TextParseNodeFactory,
|
|
1316
|
+
TextSerializationWriterFactory
|
|
1317
|
+
} from "@microsoft/kiota-serialization-text";
|
|
1318
|
+
|
|
872
1319
|
// src/generated/client/models/index.ts
|
|
873
1320
|
function createDeletedWorkoutFromDiscriminatorValue(parseNode) {
|
|
874
1321
|
return deserializeIntoDeletedWorkout;
|
|
@@ -905,253 +1352,287 @@ function createWorkoutFromDiscriminatorValue(parseNode) {
|
|
|
905
1352
|
}
|
|
906
1353
|
function deserializeIntoDeletedWorkout(deletedWorkout = {}) {
|
|
907
1354
|
return {
|
|
908
|
-
|
|
1355
|
+
deleted_at: (n) => {
|
|
909
1356
|
deletedWorkout.deletedAt = n.getStringValue();
|
|
910
1357
|
},
|
|
911
|
-
|
|
1358
|
+
id: (n) => {
|
|
912
1359
|
deletedWorkout.id = n.getStringValue();
|
|
913
1360
|
},
|
|
914
|
-
|
|
1361
|
+
type: (n) => {
|
|
915
1362
|
deletedWorkout.type = n.getStringValue();
|
|
916
1363
|
}
|
|
917
1364
|
};
|
|
918
1365
|
}
|
|
919
1366
|
function deserializeIntoExerciseTemplate(exerciseTemplate = {}) {
|
|
920
1367
|
return {
|
|
921
|
-
|
|
1368
|
+
id: (n) => {
|
|
922
1369
|
exerciseTemplate.id = n.getStringValue();
|
|
923
1370
|
},
|
|
924
|
-
|
|
1371
|
+
is_custom: (n) => {
|
|
925
1372
|
exerciseTemplate.isCustom = n.getBooleanValue();
|
|
926
1373
|
},
|
|
927
|
-
|
|
1374
|
+
primary_muscle_group: (n) => {
|
|
928
1375
|
exerciseTemplate.primaryMuscleGroup = n.getStringValue();
|
|
929
1376
|
},
|
|
930
|
-
|
|
1377
|
+
secondary_muscle_groups: (n) => {
|
|
931
1378
|
exerciseTemplate.secondaryMuscleGroups = n.getCollectionOfPrimitiveValues();
|
|
932
1379
|
},
|
|
933
|
-
|
|
1380
|
+
title: (n) => {
|
|
934
1381
|
exerciseTemplate.title = n.getStringValue();
|
|
935
1382
|
},
|
|
936
|
-
|
|
1383
|
+
type: (n) => {
|
|
937
1384
|
exerciseTemplate.type = n.getStringValue();
|
|
938
1385
|
}
|
|
939
1386
|
};
|
|
940
1387
|
}
|
|
941
1388
|
function deserializeIntoPaginatedWorkoutEvents(paginatedWorkoutEvents = {}) {
|
|
942
1389
|
return {
|
|
943
|
-
|
|
944
|
-
paginatedWorkoutEvents.events = n.getCollectionOfObjectValues(
|
|
945
|
-
|
|
946
|
-
|
|
1390
|
+
events: (n) => {
|
|
1391
|
+
paginatedWorkoutEvents.events = n.getCollectionOfObjectValues(
|
|
1392
|
+
createDeletedWorkoutFromDiscriminatorValue
|
|
1393
|
+
) ?? n.getCollectionOfObjectValues(
|
|
1394
|
+
createUpdatedWorkoutFromDiscriminatorValue
|
|
1395
|
+
);
|
|
1396
|
+
},
|
|
1397
|
+
page: (n) => {
|
|
947
1398
|
paginatedWorkoutEvents.page = n.getNumberValue();
|
|
948
1399
|
},
|
|
949
|
-
|
|
1400
|
+
page_count: (n) => {
|
|
950
1401
|
paginatedWorkoutEvents.pageCount = n.getNumberValue();
|
|
951
1402
|
}
|
|
952
1403
|
};
|
|
953
1404
|
}
|
|
954
1405
|
function deserializeIntoRoutine(routine = {}) {
|
|
955
1406
|
return {
|
|
956
|
-
|
|
1407
|
+
created_at: (n) => {
|
|
957
1408
|
routine.createdAt = n.getStringValue();
|
|
958
1409
|
},
|
|
959
|
-
|
|
960
|
-
routine.exercises = n.getCollectionOfObjectValues(
|
|
1410
|
+
exercises: (n) => {
|
|
1411
|
+
routine.exercises = n.getCollectionOfObjectValues(
|
|
1412
|
+
createRoutine_exercisesFromDiscriminatorValue
|
|
1413
|
+
);
|
|
961
1414
|
},
|
|
962
|
-
|
|
1415
|
+
folder_id: (n) => {
|
|
963
1416
|
routine.folderId = n.getNumberValue();
|
|
964
1417
|
},
|
|
965
|
-
|
|
1418
|
+
id: (n) => {
|
|
966
1419
|
routine.id = n.getStringValue();
|
|
967
1420
|
},
|
|
968
|
-
|
|
1421
|
+
title: (n) => {
|
|
969
1422
|
routine.title = n.getStringValue();
|
|
970
1423
|
},
|
|
971
|
-
|
|
1424
|
+
updated_at: (n) => {
|
|
972
1425
|
routine.updatedAt = n.getStringValue();
|
|
973
1426
|
}
|
|
974
1427
|
};
|
|
975
1428
|
}
|
|
976
1429
|
function deserializeIntoRoutine_exercises(routine_exercises = {}) {
|
|
977
1430
|
return {
|
|
978
|
-
|
|
1431
|
+
exercise_template_id: (n) => {
|
|
979
1432
|
routine_exercises.exerciseTemplateId = n.getStringValue();
|
|
980
1433
|
},
|
|
981
|
-
|
|
1434
|
+
index: (n) => {
|
|
982
1435
|
routine_exercises.index = n.getNumberValue();
|
|
983
1436
|
},
|
|
984
|
-
|
|
1437
|
+
notes: (n) => {
|
|
985
1438
|
routine_exercises.notes = n.getStringValue();
|
|
986
1439
|
},
|
|
987
|
-
|
|
988
|
-
routine_exercises.sets = n.getCollectionOfObjectValues(
|
|
1440
|
+
sets: (n) => {
|
|
1441
|
+
routine_exercises.sets = n.getCollectionOfObjectValues(
|
|
1442
|
+
createRoutine_exercises_setsFromDiscriminatorValue
|
|
1443
|
+
);
|
|
989
1444
|
},
|
|
990
|
-
|
|
1445
|
+
supersets_id: (n) => {
|
|
991
1446
|
routine_exercises.supersetsId = n.getNumberValue();
|
|
992
1447
|
},
|
|
993
|
-
|
|
1448
|
+
title: (n) => {
|
|
994
1449
|
routine_exercises.title = n.getStringValue();
|
|
995
1450
|
}
|
|
996
1451
|
};
|
|
997
1452
|
}
|
|
998
1453
|
function deserializeIntoRoutine_exercises_sets(routine_exercises_sets = {}) {
|
|
999
1454
|
return {
|
|
1000
|
-
|
|
1455
|
+
custom_metric: (n) => {
|
|
1001
1456
|
routine_exercises_sets.customMetric = n.getNumberValue();
|
|
1002
1457
|
},
|
|
1003
|
-
|
|
1458
|
+
distance_meters: (n) => {
|
|
1004
1459
|
routine_exercises_sets.distanceMeters = n.getNumberValue();
|
|
1005
1460
|
},
|
|
1006
|
-
|
|
1461
|
+
duration_seconds: (n) => {
|
|
1007
1462
|
routine_exercises_sets.durationSeconds = n.getNumberValue();
|
|
1008
1463
|
},
|
|
1009
|
-
|
|
1464
|
+
index: (n) => {
|
|
1010
1465
|
routine_exercises_sets.index = n.getNumberValue();
|
|
1011
1466
|
},
|
|
1012
|
-
|
|
1467
|
+
reps: (n) => {
|
|
1013
1468
|
routine_exercises_sets.reps = n.getNumberValue();
|
|
1014
1469
|
},
|
|
1015
|
-
|
|
1470
|
+
rpe: (n) => {
|
|
1016
1471
|
routine_exercises_sets.rpe = n.getNumberValue();
|
|
1017
1472
|
},
|
|
1018
|
-
|
|
1473
|
+
type: (n) => {
|
|
1019
1474
|
routine_exercises_sets.type = n.getStringValue();
|
|
1020
1475
|
},
|
|
1021
|
-
|
|
1476
|
+
weight_kg: (n) => {
|
|
1022
1477
|
routine_exercises_sets.weightKg = n.getNumberValue();
|
|
1023
1478
|
}
|
|
1024
1479
|
};
|
|
1025
1480
|
}
|
|
1026
1481
|
function deserializeIntoRoutineFolder(routineFolder = {}) {
|
|
1027
1482
|
return {
|
|
1028
|
-
|
|
1483
|
+
created_at: (n) => {
|
|
1029
1484
|
routineFolder.createdAt = n.getStringValue();
|
|
1030
1485
|
},
|
|
1031
|
-
|
|
1486
|
+
id: (n) => {
|
|
1032
1487
|
routineFolder.id = n.getNumberValue();
|
|
1033
1488
|
},
|
|
1034
|
-
|
|
1489
|
+
index: (n) => {
|
|
1035
1490
|
routineFolder.index = n.getNumberValue();
|
|
1036
1491
|
},
|
|
1037
|
-
|
|
1492
|
+
title: (n) => {
|
|
1038
1493
|
routineFolder.title = n.getStringValue();
|
|
1039
1494
|
},
|
|
1040
|
-
|
|
1495
|
+
updated_at: (n) => {
|
|
1041
1496
|
routineFolder.updatedAt = n.getStringValue();
|
|
1042
1497
|
}
|
|
1043
1498
|
};
|
|
1044
1499
|
}
|
|
1045
1500
|
function deserializeIntoUpdatedWorkout(updatedWorkout = {}) {
|
|
1046
1501
|
return {
|
|
1047
|
-
|
|
1502
|
+
type: (n) => {
|
|
1048
1503
|
updatedWorkout.type = n.getStringValue();
|
|
1049
1504
|
},
|
|
1050
|
-
|
|
1051
|
-
updatedWorkout.workout = n.getObjectValue(
|
|
1505
|
+
workout: (n) => {
|
|
1506
|
+
updatedWorkout.workout = n.getObjectValue(
|
|
1507
|
+
createWorkoutFromDiscriminatorValue
|
|
1508
|
+
);
|
|
1052
1509
|
}
|
|
1053
1510
|
};
|
|
1054
1511
|
}
|
|
1055
1512
|
function deserializeIntoWorkout(workout = {}) {
|
|
1056
1513
|
return {
|
|
1057
|
-
|
|
1514
|
+
created_at: (n) => {
|
|
1058
1515
|
workout.createdAt = n.getStringValue();
|
|
1059
1516
|
},
|
|
1060
|
-
|
|
1517
|
+
description: (n) => {
|
|
1061
1518
|
workout.description = n.getStringValue();
|
|
1062
1519
|
},
|
|
1063
|
-
|
|
1520
|
+
end_time: (n) => {
|
|
1064
1521
|
workout.endTime = n.getNumberValue();
|
|
1065
1522
|
},
|
|
1066
|
-
|
|
1067
|
-
workout.exercises = n.getCollectionOfObjectValues(
|
|
1523
|
+
exercises: (n) => {
|
|
1524
|
+
workout.exercises = n.getCollectionOfObjectValues(
|
|
1525
|
+
createWorkout_exercisesFromDiscriminatorValue
|
|
1526
|
+
);
|
|
1068
1527
|
},
|
|
1069
|
-
|
|
1528
|
+
id: (n) => {
|
|
1070
1529
|
workout.id = n.getStringValue();
|
|
1071
1530
|
},
|
|
1072
|
-
|
|
1531
|
+
start_time: (n) => {
|
|
1073
1532
|
workout.startTime = n.getNumberValue();
|
|
1074
1533
|
},
|
|
1075
|
-
|
|
1534
|
+
title: (n) => {
|
|
1076
1535
|
workout.title = n.getStringValue();
|
|
1077
1536
|
},
|
|
1078
|
-
|
|
1537
|
+
updated_at: (n) => {
|
|
1079
1538
|
workout.updatedAt = n.getStringValue();
|
|
1080
1539
|
}
|
|
1081
1540
|
};
|
|
1082
1541
|
}
|
|
1083
1542
|
function deserializeIntoWorkout_exercises(workout_exercises = {}) {
|
|
1084
1543
|
return {
|
|
1085
|
-
|
|
1544
|
+
exercise_template_id: (n) => {
|
|
1086
1545
|
workout_exercises.exerciseTemplateId = n.getStringValue();
|
|
1087
1546
|
},
|
|
1088
|
-
|
|
1547
|
+
index: (n) => {
|
|
1089
1548
|
workout_exercises.index = n.getNumberValue();
|
|
1090
1549
|
},
|
|
1091
|
-
|
|
1550
|
+
notes: (n) => {
|
|
1092
1551
|
workout_exercises.notes = n.getStringValue();
|
|
1093
1552
|
},
|
|
1094
|
-
|
|
1095
|
-
workout_exercises.sets = n.getCollectionOfObjectValues(
|
|
1553
|
+
sets: (n) => {
|
|
1554
|
+
workout_exercises.sets = n.getCollectionOfObjectValues(
|
|
1555
|
+
createWorkout_exercises_setsFromDiscriminatorValue
|
|
1556
|
+
);
|
|
1096
1557
|
},
|
|
1097
|
-
|
|
1558
|
+
supersets_id: (n) => {
|
|
1098
1559
|
workout_exercises.supersetsId = n.getNumberValue();
|
|
1099
1560
|
},
|
|
1100
|
-
|
|
1561
|
+
title: (n) => {
|
|
1101
1562
|
workout_exercises.title = n.getStringValue();
|
|
1102
1563
|
}
|
|
1103
1564
|
};
|
|
1104
1565
|
}
|
|
1105
1566
|
function deserializeIntoWorkout_exercises_sets(workout_exercises_sets = {}) {
|
|
1106
1567
|
return {
|
|
1107
|
-
|
|
1568
|
+
custom_metric: (n) => {
|
|
1108
1569
|
workout_exercises_sets.customMetric = n.getNumberValue();
|
|
1109
1570
|
},
|
|
1110
|
-
|
|
1571
|
+
distance_meters: (n) => {
|
|
1111
1572
|
workout_exercises_sets.distanceMeters = n.getNumberValue();
|
|
1112
1573
|
},
|
|
1113
|
-
|
|
1574
|
+
duration_seconds: (n) => {
|
|
1114
1575
|
workout_exercises_sets.durationSeconds = n.getNumberValue();
|
|
1115
1576
|
},
|
|
1116
|
-
|
|
1577
|
+
index: (n) => {
|
|
1117
1578
|
workout_exercises_sets.index = n.getNumberValue();
|
|
1118
1579
|
},
|
|
1119
|
-
|
|
1580
|
+
reps: (n) => {
|
|
1120
1581
|
workout_exercises_sets.reps = n.getNumberValue();
|
|
1121
1582
|
},
|
|
1122
|
-
|
|
1583
|
+
rpe: (n) => {
|
|
1123
1584
|
workout_exercises_sets.rpe = n.getNumberValue();
|
|
1124
1585
|
},
|
|
1125
|
-
|
|
1586
|
+
type: (n) => {
|
|
1126
1587
|
workout_exercises_sets.type = n.getStringValue();
|
|
1127
1588
|
},
|
|
1128
|
-
|
|
1589
|
+
weight_kg: (n) => {
|
|
1129
1590
|
workout_exercises_sets.weightKg = n.getNumberValue();
|
|
1130
1591
|
}
|
|
1131
1592
|
};
|
|
1132
1593
|
}
|
|
1133
1594
|
function serializePostRoutineFolderRequestBody(writer, postRoutineFolderRequestBody = {}) {
|
|
1134
1595
|
if (postRoutineFolderRequestBody) {
|
|
1135
|
-
writer.writeObjectValue(
|
|
1596
|
+
writer.writeObjectValue(
|
|
1597
|
+
"routine_folder",
|
|
1598
|
+
postRoutineFolderRequestBody.routineFolder,
|
|
1599
|
+
serializePostRoutineFolderRequestBody_routine_folder
|
|
1600
|
+
);
|
|
1136
1601
|
writer.writeAdditionalData(postRoutineFolderRequestBody.additionalData);
|
|
1137
1602
|
}
|
|
1138
1603
|
}
|
|
1139
1604
|
function serializePostRoutineFolderRequestBody_routine_folder(writer, postRoutineFolderRequestBody_routine_folder = {}) {
|
|
1140
1605
|
if (postRoutineFolderRequestBody_routine_folder) {
|
|
1141
|
-
writer.writeStringValue(
|
|
1142
|
-
|
|
1606
|
+
writer.writeStringValue(
|
|
1607
|
+
"title",
|
|
1608
|
+
postRoutineFolderRequestBody_routine_folder.title
|
|
1609
|
+
);
|
|
1610
|
+
writer.writeAdditionalData(
|
|
1611
|
+
postRoutineFolderRequestBody_routine_folder.additionalData
|
|
1612
|
+
);
|
|
1143
1613
|
}
|
|
1144
1614
|
}
|
|
1145
1615
|
function serializePostRoutinesRequestBody(writer, postRoutinesRequestBody = {}) {
|
|
1146
1616
|
if (postRoutinesRequestBody) {
|
|
1147
|
-
writer.writeObjectValue(
|
|
1617
|
+
writer.writeObjectValue(
|
|
1618
|
+
"routine",
|
|
1619
|
+
postRoutinesRequestBody.routine,
|
|
1620
|
+
serializePostRoutinesRequestBody_routine
|
|
1621
|
+
);
|
|
1148
1622
|
writer.writeAdditionalData(postRoutinesRequestBody.additionalData);
|
|
1149
1623
|
}
|
|
1150
1624
|
}
|
|
1151
1625
|
function serializePostRoutinesRequestBody_routine(writer, postRoutinesRequestBody_routine = {}) {
|
|
1152
1626
|
if (postRoutinesRequestBody_routine) {
|
|
1153
|
-
writer.writeCollectionOfObjectValues(
|
|
1154
|
-
|
|
1627
|
+
writer.writeCollectionOfObjectValues(
|
|
1628
|
+
"exercises",
|
|
1629
|
+
postRoutinesRequestBody_routine.exercises,
|
|
1630
|
+
serializePostRoutinesRequestExercise
|
|
1631
|
+
);
|
|
1632
|
+
writer.writeNumberValue(
|
|
1633
|
+
"folder_id",
|
|
1634
|
+
postRoutinesRequestBody_routine.folderId
|
|
1635
|
+
);
|
|
1155
1636
|
writer.writeStringValue("notes", postRoutinesRequestBody_routine.notes);
|
|
1156
1637
|
writer.writeStringValue("title", postRoutinesRequestBody_routine.title);
|
|
1157
1638
|
writer.writeAdditionalData(postRoutinesRequestBody_routine.additionalData);
|
|
@@ -1159,72 +1640,147 @@ function serializePostRoutinesRequestBody_routine(writer, postRoutinesRequestBod
|
|
|
1159
1640
|
}
|
|
1160
1641
|
function serializePostRoutinesRequestExercise(writer, postRoutinesRequestExercise = {}) {
|
|
1161
1642
|
if (postRoutinesRequestExercise) {
|
|
1162
|
-
writer.writeStringValue(
|
|
1643
|
+
writer.writeStringValue(
|
|
1644
|
+
"exercise_template_id",
|
|
1645
|
+
postRoutinesRequestExercise.exerciseTemplateId
|
|
1646
|
+
);
|
|
1163
1647
|
writer.writeStringValue("notes", postRoutinesRequestExercise.notes);
|
|
1164
|
-
writer.writeNumberValue(
|
|
1165
|
-
|
|
1166
|
-
|
|
1648
|
+
writer.writeNumberValue(
|
|
1649
|
+
"rest_seconds",
|
|
1650
|
+
postRoutinesRequestExercise.restSeconds
|
|
1651
|
+
);
|
|
1652
|
+
writer.writeCollectionOfObjectValues(
|
|
1653
|
+
"sets",
|
|
1654
|
+
postRoutinesRequestExercise.sets,
|
|
1655
|
+
serializePostRoutinesRequestSet
|
|
1656
|
+
);
|
|
1657
|
+
writer.writeNumberValue(
|
|
1658
|
+
"superset_id",
|
|
1659
|
+
postRoutinesRequestExercise.supersetId
|
|
1660
|
+
);
|
|
1167
1661
|
writer.writeAdditionalData(postRoutinesRequestExercise.additionalData);
|
|
1168
1662
|
}
|
|
1169
1663
|
}
|
|
1170
1664
|
function serializePostRoutinesRequestSet(writer, postRoutinesRequestSet = {}) {
|
|
1171
1665
|
if (postRoutinesRequestSet) {
|
|
1172
|
-
writer.writeNumberValue(
|
|
1173
|
-
|
|
1174
|
-
|
|
1666
|
+
writer.writeNumberValue(
|
|
1667
|
+
"custom_metric",
|
|
1668
|
+
postRoutinesRequestSet.customMetric
|
|
1669
|
+
);
|
|
1670
|
+
writer.writeNumberValue(
|
|
1671
|
+
"distance_meters",
|
|
1672
|
+
postRoutinesRequestSet.distanceMeters
|
|
1673
|
+
);
|
|
1674
|
+
writer.writeNumberValue(
|
|
1675
|
+
"duration_seconds",
|
|
1676
|
+
postRoutinesRequestSet.durationSeconds
|
|
1677
|
+
);
|
|
1175
1678
|
writer.writeNumberValue("reps", postRoutinesRequestSet.reps);
|
|
1176
|
-
writer.writeEnumValue(
|
|
1679
|
+
writer.writeEnumValue(
|
|
1680
|
+
"type",
|
|
1681
|
+
postRoutinesRequestSet.type
|
|
1682
|
+
);
|
|
1177
1683
|
writer.writeNumberValue("weight_kg", postRoutinesRequestSet.weightKg);
|
|
1178
1684
|
writer.writeAdditionalData(postRoutinesRequestSet.additionalData);
|
|
1179
1685
|
}
|
|
1180
1686
|
}
|
|
1181
1687
|
function serializePostWorkoutsRequestBody(writer, postWorkoutsRequestBody = {}) {
|
|
1182
1688
|
if (postWorkoutsRequestBody) {
|
|
1183
|
-
writer.writeObjectValue(
|
|
1689
|
+
writer.writeObjectValue(
|
|
1690
|
+
"workout",
|
|
1691
|
+
postWorkoutsRequestBody.workout,
|
|
1692
|
+
serializePostWorkoutsRequestBody_workout
|
|
1693
|
+
);
|
|
1184
1694
|
writer.writeAdditionalData(postWorkoutsRequestBody.additionalData);
|
|
1185
1695
|
}
|
|
1186
1696
|
}
|
|
1187
1697
|
function serializePostWorkoutsRequestBody_workout(writer, postWorkoutsRequestBody_workout = {}) {
|
|
1188
1698
|
if (postWorkoutsRequestBody_workout) {
|
|
1189
|
-
writer.writeStringValue(
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
writer.writeStringValue(
|
|
1699
|
+
writer.writeStringValue(
|
|
1700
|
+
"description",
|
|
1701
|
+
postWorkoutsRequestBody_workout.description
|
|
1702
|
+
);
|
|
1703
|
+
writer.writeStringValue(
|
|
1704
|
+
"end_time",
|
|
1705
|
+
postWorkoutsRequestBody_workout.endTime
|
|
1706
|
+
);
|
|
1707
|
+
writer.writeCollectionOfObjectValues(
|
|
1708
|
+
"exercises",
|
|
1709
|
+
postWorkoutsRequestBody_workout.exercises,
|
|
1710
|
+
serializePostWorkoutsRequestExercise
|
|
1711
|
+
);
|
|
1712
|
+
writer.writeBooleanValue(
|
|
1713
|
+
"is_private",
|
|
1714
|
+
postWorkoutsRequestBody_workout.isPrivate
|
|
1715
|
+
);
|
|
1716
|
+
writer.writeStringValue(
|
|
1717
|
+
"start_time",
|
|
1718
|
+
postWorkoutsRequestBody_workout.startTime
|
|
1719
|
+
);
|
|
1194
1720
|
writer.writeStringValue("title", postWorkoutsRequestBody_workout.title);
|
|
1195
1721
|
writer.writeAdditionalData(postWorkoutsRequestBody_workout.additionalData);
|
|
1196
1722
|
}
|
|
1197
1723
|
}
|
|
1198
1724
|
function serializePostWorkoutsRequestExercise(writer, postWorkoutsRequestExercise = {}) {
|
|
1199
1725
|
if (postWorkoutsRequestExercise) {
|
|
1200
|
-
writer.writeStringValue(
|
|
1726
|
+
writer.writeStringValue(
|
|
1727
|
+
"exercise_template_id",
|
|
1728
|
+
postWorkoutsRequestExercise.exerciseTemplateId
|
|
1729
|
+
);
|
|
1201
1730
|
writer.writeStringValue("notes", postWorkoutsRequestExercise.notes);
|
|
1202
|
-
writer.writeCollectionOfObjectValues(
|
|
1203
|
-
|
|
1731
|
+
writer.writeCollectionOfObjectValues(
|
|
1732
|
+
"sets",
|
|
1733
|
+
postWorkoutsRequestExercise.sets,
|
|
1734
|
+
serializePostWorkoutsRequestSet
|
|
1735
|
+
);
|
|
1736
|
+
writer.writeNumberValue(
|
|
1737
|
+
"superset_id",
|
|
1738
|
+
postWorkoutsRequestExercise.supersetId
|
|
1739
|
+
);
|
|
1204
1740
|
writer.writeAdditionalData(postWorkoutsRequestExercise.additionalData);
|
|
1205
1741
|
}
|
|
1206
1742
|
}
|
|
1207
1743
|
function serializePostWorkoutsRequestSet(writer, postWorkoutsRequestSet = {}) {
|
|
1208
1744
|
if (postWorkoutsRequestSet) {
|
|
1209
|
-
writer.writeNumberValue(
|
|
1210
|
-
|
|
1211
|
-
|
|
1745
|
+
writer.writeNumberValue(
|
|
1746
|
+
"custom_metric",
|
|
1747
|
+
postWorkoutsRequestSet.customMetric
|
|
1748
|
+
);
|
|
1749
|
+
writer.writeNumberValue(
|
|
1750
|
+
"distance_meters",
|
|
1751
|
+
postWorkoutsRequestSet.distanceMeters
|
|
1752
|
+
);
|
|
1753
|
+
writer.writeNumberValue(
|
|
1754
|
+
"duration_seconds",
|
|
1755
|
+
postWorkoutsRequestSet.durationSeconds
|
|
1756
|
+
);
|
|
1212
1757
|
writer.writeNumberValue("reps", postWorkoutsRequestSet.reps);
|
|
1213
1758
|
writer.writeNumberValue("rpe", postWorkoutsRequestSet.rpe);
|
|
1214
|
-
writer.writeEnumValue(
|
|
1759
|
+
writer.writeEnumValue(
|
|
1760
|
+
"type",
|
|
1761
|
+
postWorkoutsRequestSet.type
|
|
1762
|
+
);
|
|
1215
1763
|
writer.writeNumberValue("weight_kg", postWorkoutsRequestSet.weightKg);
|
|
1216
1764
|
writer.writeAdditionalData(postWorkoutsRequestSet.additionalData);
|
|
1217
1765
|
}
|
|
1218
1766
|
}
|
|
1219
1767
|
function serializePutRoutinesRequestBody(writer, putRoutinesRequestBody = {}) {
|
|
1220
1768
|
if (putRoutinesRequestBody) {
|
|
1221
|
-
writer.writeObjectValue(
|
|
1769
|
+
writer.writeObjectValue(
|
|
1770
|
+
"routine",
|
|
1771
|
+
putRoutinesRequestBody.routine,
|
|
1772
|
+
serializePutRoutinesRequestBody_routine
|
|
1773
|
+
);
|
|
1222
1774
|
writer.writeAdditionalData(putRoutinesRequestBody.additionalData);
|
|
1223
1775
|
}
|
|
1224
1776
|
}
|
|
1225
1777
|
function serializePutRoutinesRequestBody_routine(writer, putRoutinesRequestBody_routine = {}) {
|
|
1226
1778
|
if (putRoutinesRequestBody_routine) {
|
|
1227
|
-
writer.writeCollectionOfObjectValues(
|
|
1779
|
+
writer.writeCollectionOfObjectValues(
|
|
1780
|
+
"exercises",
|
|
1781
|
+
putRoutinesRequestBody_routine.exercises,
|
|
1782
|
+
serializePutRoutinesRequestExercise
|
|
1783
|
+
);
|
|
1228
1784
|
writer.writeStringValue("notes", putRoutinesRequestBody_routine.notes);
|
|
1229
1785
|
writer.writeStringValue("title", putRoutinesRequestBody_routine.title);
|
|
1230
1786
|
writer.writeAdditionalData(putRoutinesRequestBody_routine.additionalData);
|
|
@@ -1232,818 +1788,420 @@ function serializePutRoutinesRequestBody_routine(writer, putRoutinesRequestBody_
|
|
|
1232
1788
|
}
|
|
1233
1789
|
function serializePutRoutinesRequestExercise(writer, putRoutinesRequestExercise = {}) {
|
|
1234
1790
|
if (putRoutinesRequestExercise) {
|
|
1235
|
-
writer.writeStringValue(
|
|
1791
|
+
writer.writeStringValue(
|
|
1792
|
+
"exercise_template_id",
|
|
1793
|
+
putRoutinesRequestExercise.exerciseTemplateId
|
|
1794
|
+
);
|
|
1236
1795
|
writer.writeStringValue("notes", putRoutinesRequestExercise.notes);
|
|
1237
|
-
writer.writeNumberValue(
|
|
1238
|
-
|
|
1239
|
-
|
|
1796
|
+
writer.writeNumberValue(
|
|
1797
|
+
"rest_seconds",
|
|
1798
|
+
putRoutinesRequestExercise.restSeconds
|
|
1799
|
+
);
|
|
1800
|
+
writer.writeCollectionOfObjectValues(
|
|
1801
|
+
"sets",
|
|
1802
|
+
putRoutinesRequestExercise.sets,
|
|
1803
|
+
serializePutRoutinesRequestSet
|
|
1804
|
+
);
|
|
1805
|
+
writer.writeNumberValue(
|
|
1806
|
+
"superset_id",
|
|
1807
|
+
putRoutinesRequestExercise.supersetId
|
|
1808
|
+
);
|
|
1240
1809
|
writer.writeAdditionalData(putRoutinesRequestExercise.additionalData);
|
|
1241
1810
|
}
|
|
1242
1811
|
}
|
|
1243
1812
|
function serializePutRoutinesRequestSet(writer, putRoutinesRequestSet = {}) {
|
|
1244
1813
|
if (putRoutinesRequestSet) {
|
|
1245
|
-
writer.writeNumberValue(
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
writer.
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
};
|
|
1265
|
-
|
|
1266
|
-
// src/generated/client/v1/exercise_templates/index.ts
|
|
1267
|
-
function createExercise_templatesGetResponseFromDiscriminatorValue(parseNode) {
|
|
1268
|
-
return deserializeIntoExercise_templatesGetResponse;
|
|
1269
|
-
}
|
|
1270
|
-
function deserializeIntoExercise_templatesGetResponse(exercise_templatesGetResponse = {}) {
|
|
1271
|
-
return {
|
|
1272
|
-
"exercise_templates": (n) => {
|
|
1273
|
-
exercise_templatesGetResponse.exerciseTemplates = n.getCollectionOfObjectValues(createExerciseTemplateFromDiscriminatorValue);
|
|
1274
|
-
},
|
|
1275
|
-
"page": (n) => {
|
|
1276
|
-
exercise_templatesGetResponse.page = n.getNumberValue();
|
|
1277
|
-
},
|
|
1278
|
-
"page_count": (n) => {
|
|
1279
|
-
exercise_templatesGetResponse.pageCount = n.getNumberValue();
|
|
1280
|
-
}
|
|
1281
|
-
};
|
|
1282
|
-
}
|
|
1283
|
-
var Exercise_templatesRequestBuilderUriTemplate = "{+baseurl}/v1/exercise_templates{?page*,pageSize*}";
|
|
1284
|
-
var Exercise_templatesRequestBuilderNavigationMetadata = {
|
|
1285
|
-
byExerciseTemplateId: {
|
|
1286
|
-
requestsMetadata: WithExerciseTemplateItemRequestBuilderRequestsMetadata,
|
|
1287
|
-
pathParametersMappings: ["exerciseTemplateId"]
|
|
1288
|
-
}
|
|
1289
|
-
};
|
|
1290
|
-
var Exercise_templatesRequestBuilderRequestsMetadata = {
|
|
1291
|
-
get: {
|
|
1292
|
-
uriTemplate: Exercise_templatesRequestBuilderUriTemplate,
|
|
1293
|
-
responseBodyContentType: "application/json",
|
|
1294
|
-
adapterMethodName: "send",
|
|
1295
|
-
responseBodyFactory: createExercise_templatesGetResponseFromDiscriminatorValue
|
|
1296
|
-
}
|
|
1297
|
-
};
|
|
1298
|
-
|
|
1299
|
-
// src/generated/client/v1/routine_folders/item/index.ts
|
|
1300
|
-
var WithFolderItemRequestBuilderUriTemplate = "{+baseurl}/v1/routine_folders/{folderId}";
|
|
1301
|
-
var WithFolderItemRequestBuilderRequestsMetadata = {
|
|
1302
|
-
get: {
|
|
1303
|
-
uriTemplate: WithFolderItemRequestBuilderUriTemplate,
|
|
1304
|
-
responseBodyContentType: "application/json",
|
|
1305
|
-
adapterMethodName: "send",
|
|
1306
|
-
responseBodyFactory: createRoutineFolderFromDiscriminatorValue
|
|
1307
|
-
}
|
|
1308
|
-
};
|
|
1309
|
-
|
|
1310
|
-
// src/generated/client/v1/routine_folders/index.ts
|
|
1311
|
-
function createRoutine_foldersGetResponseFromDiscriminatorValue(parseNode) {
|
|
1312
|
-
return deserializeIntoRoutine_foldersGetResponse;
|
|
1313
|
-
}
|
|
1314
|
-
function createRoutineFolder400ErrorFromDiscriminatorValue(parseNode) {
|
|
1315
|
-
return deserializeIntoRoutineFolder400Error;
|
|
1316
|
-
}
|
|
1317
|
-
function deserializeIntoRoutine_foldersGetResponse(routine_foldersGetResponse = {}) {
|
|
1318
|
-
return {
|
|
1319
|
-
"page": (n) => {
|
|
1320
|
-
routine_foldersGetResponse.page = n.getNumberValue();
|
|
1321
|
-
},
|
|
1322
|
-
"page_count": (n) => {
|
|
1323
|
-
routine_foldersGetResponse.pageCount = n.getNumberValue();
|
|
1324
|
-
},
|
|
1325
|
-
"routine_folders": (n) => {
|
|
1326
|
-
routine_foldersGetResponse.routineFolders = n.getCollectionOfObjectValues(createRoutineFolderFromDiscriminatorValue);
|
|
1327
|
-
}
|
|
1328
|
-
};
|
|
1329
|
-
}
|
|
1330
|
-
function deserializeIntoRoutineFolder400Error(routineFolder400Error = {}) {
|
|
1331
|
-
return {
|
|
1332
|
-
"error": (n) => {
|
|
1333
|
-
routineFolder400Error.errorEscaped = n.getStringValue();
|
|
1334
|
-
}
|
|
1335
|
-
};
|
|
1336
|
-
}
|
|
1337
|
-
var Routine_foldersRequestBuilderUriTemplate = "{+baseurl}/v1/routine_folders{?page*,pageSize*}";
|
|
1338
|
-
var Routine_foldersRequestBuilderNavigationMetadata = {
|
|
1339
|
-
byFolderId: {
|
|
1340
|
-
requestsMetadata: WithFolderItemRequestBuilderRequestsMetadata,
|
|
1341
|
-
pathParametersMappings: ["folderId"]
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
var Routine_foldersRequestBuilderRequestsMetadata = {
|
|
1345
|
-
get: {
|
|
1346
|
-
uriTemplate: Routine_foldersRequestBuilderUriTemplate,
|
|
1347
|
-
responseBodyContentType: "application/json",
|
|
1348
|
-
adapterMethodName: "send",
|
|
1349
|
-
responseBodyFactory: createRoutine_foldersGetResponseFromDiscriminatorValue
|
|
1350
|
-
},
|
|
1351
|
-
post: {
|
|
1352
|
-
uriTemplate: Routine_foldersRequestBuilderUriTemplate,
|
|
1353
|
-
responseBodyContentType: "application/json",
|
|
1354
|
-
errorMappings: {
|
|
1355
|
-
400: createRoutineFolder400ErrorFromDiscriminatorValue
|
|
1356
|
-
},
|
|
1357
|
-
adapterMethodName: "send",
|
|
1358
|
-
responseBodyFactory: createRoutineFolderFromDiscriminatorValue,
|
|
1359
|
-
requestBodyContentType: "application/json",
|
|
1360
|
-
requestBodySerializer: serializePostRoutineFolderRequestBody,
|
|
1361
|
-
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
|
|
1365
|
-
// src/generated/client/v1/routines/item/index.ts
|
|
1366
|
-
function createRoutine400ErrorFromDiscriminatorValue(parseNode) {
|
|
1367
|
-
return deserializeIntoRoutine400Error;
|
|
1368
|
-
}
|
|
1369
|
-
function createRoutine404ErrorFromDiscriminatorValue(parseNode) {
|
|
1370
|
-
return deserializeIntoRoutine404Error;
|
|
1371
|
-
}
|
|
1372
|
-
function deserializeIntoRoutine400Error(routine400Error = {}) {
|
|
1373
|
-
return {
|
|
1374
|
-
"error": (n) => {
|
|
1375
|
-
routine400Error.errorEscaped = n.getStringValue();
|
|
1376
|
-
}
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1379
|
-
function deserializeIntoRoutine404Error(routine404Error = {}) {
|
|
1380
|
-
return {
|
|
1381
|
-
"error": (n) => {
|
|
1382
|
-
routine404Error.errorEscaped = n.getStringValue();
|
|
1383
|
-
}
|
|
1384
|
-
};
|
|
1385
|
-
}
|
|
1386
|
-
var WithRoutineItemRequestBuilderUriTemplate = "{+baseurl}/v1/routines/{routineId}";
|
|
1387
|
-
var WithRoutineItemRequestBuilderRequestsMetadata = {
|
|
1388
|
-
put: {
|
|
1389
|
-
uriTemplate: WithRoutineItemRequestBuilderUriTemplate,
|
|
1390
|
-
responseBodyContentType: "application/json",
|
|
1391
|
-
errorMappings: {
|
|
1392
|
-
400: createRoutine400ErrorFromDiscriminatorValue,
|
|
1393
|
-
404: createRoutine404ErrorFromDiscriminatorValue
|
|
1394
|
-
},
|
|
1395
|
-
adapterMethodName: "send",
|
|
1396
|
-
responseBodyFactory: createRoutineFromDiscriminatorValue,
|
|
1397
|
-
requestBodyContentType: "application/json",
|
|
1398
|
-
requestBodySerializer: serializePutRoutinesRequestBody,
|
|
1399
|
-
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1400
|
-
}
|
|
1401
|
-
};
|
|
1402
|
-
|
|
1403
|
-
// src/generated/client/v1/routines/index.ts
|
|
1404
|
-
function createRoutine400ErrorFromDiscriminatorValue2(parseNode) {
|
|
1405
|
-
return deserializeIntoRoutine400Error2;
|
|
1406
|
-
}
|
|
1407
|
-
function createRoutine403ErrorFromDiscriminatorValue(parseNode) {
|
|
1408
|
-
return deserializeIntoRoutine403Error;
|
|
1409
|
-
}
|
|
1410
|
-
function createRoutinesGetResponseFromDiscriminatorValue(parseNode) {
|
|
1411
|
-
return deserializeIntoRoutinesGetResponse;
|
|
1412
|
-
}
|
|
1413
|
-
function deserializeIntoRoutine400Error2(routine400Error = {}) {
|
|
1414
|
-
return {
|
|
1415
|
-
"error": (n) => {
|
|
1416
|
-
routine400Error.errorEscaped = n.getStringValue();
|
|
1417
|
-
}
|
|
1418
|
-
};
|
|
1419
|
-
}
|
|
1420
|
-
function deserializeIntoRoutine403Error(routine403Error = {}) {
|
|
1421
|
-
return {
|
|
1422
|
-
"error": (n) => {
|
|
1423
|
-
routine403Error.errorEscaped = n.getStringValue();
|
|
1424
|
-
}
|
|
1425
|
-
};
|
|
1426
|
-
}
|
|
1427
|
-
function deserializeIntoRoutinesGetResponse(routinesGetResponse = {}) {
|
|
1428
|
-
return {
|
|
1429
|
-
"page": (n) => {
|
|
1430
|
-
routinesGetResponse.page = n.getNumberValue();
|
|
1431
|
-
},
|
|
1432
|
-
"page_count": (n) => {
|
|
1433
|
-
routinesGetResponse.pageCount = n.getNumberValue();
|
|
1434
|
-
},
|
|
1435
|
-
"routines": (n) => {
|
|
1436
|
-
routinesGetResponse.routines = n.getCollectionOfObjectValues(createRoutineFromDiscriminatorValue);
|
|
1437
|
-
}
|
|
1438
|
-
};
|
|
1439
|
-
}
|
|
1440
|
-
var RoutinesRequestBuilderUriTemplate = "{+baseurl}/v1/routines{?page*,pageSize*}";
|
|
1441
|
-
var RoutinesRequestBuilderNavigationMetadata = {
|
|
1442
|
-
byRoutineId: {
|
|
1443
|
-
requestsMetadata: WithRoutineItemRequestBuilderRequestsMetadata,
|
|
1444
|
-
pathParametersMappings: ["routineId"]
|
|
1445
|
-
}
|
|
1446
|
-
};
|
|
1447
|
-
var RoutinesRequestBuilderRequestsMetadata = {
|
|
1448
|
-
get: {
|
|
1449
|
-
uriTemplate: RoutinesRequestBuilderUriTemplate,
|
|
1450
|
-
responseBodyContentType: "application/json",
|
|
1451
|
-
adapterMethodName: "send",
|
|
1452
|
-
responseBodyFactory: createRoutinesGetResponseFromDiscriminatorValue
|
|
1453
|
-
},
|
|
1454
|
-
post: {
|
|
1455
|
-
uriTemplate: RoutinesRequestBuilderUriTemplate,
|
|
1456
|
-
responseBodyContentType: "application/json",
|
|
1457
|
-
errorMappings: {
|
|
1458
|
-
400: createRoutine400ErrorFromDiscriminatorValue2,
|
|
1459
|
-
403: createRoutine403ErrorFromDiscriminatorValue
|
|
1460
|
-
},
|
|
1461
|
-
adapterMethodName: "send",
|
|
1462
|
-
responseBodyFactory: createRoutineFromDiscriminatorValue,
|
|
1463
|
-
requestBodyContentType: "application/json",
|
|
1464
|
-
requestBodySerializer: serializePostRoutinesRequestBody,
|
|
1465
|
-
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1466
|
-
}
|
|
1467
|
-
};
|
|
1468
|
-
|
|
1469
|
-
// src/generated/client/v1/workouts/count/index.ts
|
|
1470
|
-
function createCountGetResponseFromDiscriminatorValue(parseNode) {
|
|
1471
|
-
return deserializeIntoCountGetResponse;
|
|
1472
|
-
}
|
|
1473
|
-
function deserializeIntoCountGetResponse(countGetResponse = {}) {
|
|
1474
|
-
return {
|
|
1475
|
-
"workout_count": (n) => {
|
|
1476
|
-
countGetResponse.workoutCount = n.getNumberValue();
|
|
1477
|
-
}
|
|
1478
|
-
};
|
|
1479
|
-
}
|
|
1480
|
-
var CountRequestBuilderUriTemplate = "{+baseurl}/v1/workouts/count";
|
|
1481
|
-
var CountRequestBuilderRequestsMetadata = {
|
|
1482
|
-
get: {
|
|
1483
|
-
uriTemplate: CountRequestBuilderUriTemplate,
|
|
1484
|
-
responseBodyContentType: "application/json",
|
|
1485
|
-
adapterMethodName: "send",
|
|
1486
|
-
responseBodyFactory: createCountGetResponseFromDiscriminatorValue
|
|
1814
|
+
writer.writeNumberValue(
|
|
1815
|
+
"custom_metric",
|
|
1816
|
+
putRoutinesRequestSet.customMetric
|
|
1817
|
+
);
|
|
1818
|
+
writer.writeNumberValue(
|
|
1819
|
+
"distance_meters",
|
|
1820
|
+
putRoutinesRequestSet.distanceMeters
|
|
1821
|
+
);
|
|
1822
|
+
writer.writeNumberValue(
|
|
1823
|
+
"duration_seconds",
|
|
1824
|
+
putRoutinesRequestSet.durationSeconds
|
|
1825
|
+
);
|
|
1826
|
+
writer.writeNumberValue("reps", putRoutinesRequestSet.reps);
|
|
1827
|
+
writer.writeEnumValue(
|
|
1828
|
+
"type",
|
|
1829
|
+
putRoutinesRequestSet.type
|
|
1830
|
+
);
|
|
1831
|
+
writer.writeNumberValue("weight_kg", putRoutinesRequestSet.weightKg);
|
|
1832
|
+
writer.writeAdditionalData(putRoutinesRequestSet.additionalData);
|
|
1487
1833
|
}
|
|
1488
|
-
}
|
|
1834
|
+
}
|
|
1489
1835
|
|
|
1490
|
-
// src/generated/client/v1/
|
|
1491
|
-
var
|
|
1492
|
-
var
|
|
1836
|
+
// src/generated/client/v1/exercise_templates/item/index.ts
|
|
1837
|
+
var WithExerciseTemplateItemRequestBuilderUriTemplate = "{+baseurl}/v1/exercise_templates/{exerciseTemplateId}";
|
|
1838
|
+
var WithExerciseTemplateItemRequestBuilderRequestsMetadata = {
|
|
1493
1839
|
get: {
|
|
1494
|
-
uriTemplate:
|
|
1840
|
+
uriTemplate: WithExerciseTemplateItemRequestBuilderUriTemplate,
|
|
1495
1841
|
responseBodyContentType: "application/json",
|
|
1496
1842
|
adapterMethodName: "send",
|
|
1497
|
-
responseBodyFactory:
|
|
1843
|
+
responseBodyFactory: createExerciseTemplateFromDiscriminatorValue
|
|
1498
1844
|
}
|
|
1499
1845
|
};
|
|
1500
1846
|
|
|
1501
|
-
// src/generated/client/v1/
|
|
1502
|
-
function
|
|
1503
|
-
return
|
|
1847
|
+
// src/generated/client/v1/exercise_templates/index.ts
|
|
1848
|
+
function createExercise_templatesGetResponseFromDiscriminatorValue(parseNode) {
|
|
1849
|
+
return deserializeIntoExercise_templatesGetResponse;
|
|
1504
1850
|
}
|
|
1505
|
-
function
|
|
1851
|
+
function deserializeIntoExercise_templatesGetResponse(exercise_templatesGetResponse = {}) {
|
|
1506
1852
|
return {
|
|
1507
|
-
|
|
1508
|
-
|
|
1853
|
+
exercise_templates: (n) => {
|
|
1854
|
+
exercise_templatesGetResponse.exerciseTemplates = n.getCollectionOfObjectValues(
|
|
1855
|
+
createExerciseTemplateFromDiscriminatorValue
|
|
1856
|
+
);
|
|
1857
|
+
},
|
|
1858
|
+
page: (n) => {
|
|
1859
|
+
exercise_templatesGetResponse.page = n.getNumberValue();
|
|
1860
|
+
},
|
|
1861
|
+
page_count: (n) => {
|
|
1862
|
+
exercise_templatesGetResponse.pageCount = n.getNumberValue();
|
|
1509
1863
|
}
|
|
1510
1864
|
};
|
|
1511
1865
|
}
|
|
1512
|
-
var
|
|
1513
|
-
var
|
|
1866
|
+
var Exercise_templatesRequestBuilderUriTemplate = "{+baseurl}/v1/exercise_templates{?page*,pageSize*}";
|
|
1867
|
+
var Exercise_templatesRequestBuilderNavigationMetadata = {
|
|
1868
|
+
byExerciseTemplateId: {
|
|
1869
|
+
requestsMetadata: WithExerciseTemplateItemRequestBuilderRequestsMetadata,
|
|
1870
|
+
pathParametersMappings: ["exerciseTemplateId"]
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
var Exercise_templatesRequestBuilderRequestsMetadata = {
|
|
1514
1874
|
get: {
|
|
1515
|
-
uriTemplate:
|
|
1875
|
+
uriTemplate: Exercise_templatesRequestBuilderUriTemplate,
|
|
1516
1876
|
responseBodyContentType: "application/json",
|
|
1517
1877
|
adapterMethodName: "send",
|
|
1518
|
-
responseBodyFactory:
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1521
|
-
|
|
1878
|
+
responseBodyFactory: createExercise_templatesGetResponseFromDiscriminatorValue
|
|
1879
|
+
}
|
|
1880
|
+
};
|
|
1881
|
+
|
|
1882
|
+
// src/generated/client/v1/routine_folders/item/index.ts
|
|
1883
|
+
var WithFolderItemRequestBuilderUriTemplate = "{+baseurl}/v1/routine_folders/{folderId}";
|
|
1884
|
+
var WithFolderItemRequestBuilderRequestsMetadata = {
|
|
1885
|
+
get: {
|
|
1886
|
+
uriTemplate: WithFolderItemRequestBuilderUriTemplate,
|
|
1522
1887
|
responseBodyContentType: "application/json",
|
|
1523
|
-
errorMappings: {
|
|
1524
|
-
400: createWorkout400ErrorFromDiscriminatorValue
|
|
1525
|
-
},
|
|
1526
1888
|
adapterMethodName: "send",
|
|
1527
|
-
responseBodyFactory:
|
|
1528
|
-
requestBodyContentType: "application/json",
|
|
1529
|
-
requestBodySerializer: serializePostWorkoutsRequestBody,
|
|
1530
|
-
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1889
|
+
responseBodyFactory: createRoutineFolderFromDiscriminatorValue
|
|
1531
1890
|
}
|
|
1532
1891
|
};
|
|
1533
1892
|
|
|
1534
|
-
// src/generated/client/v1/
|
|
1535
|
-
function
|
|
1536
|
-
return
|
|
1893
|
+
// src/generated/client/v1/routine_folders/index.ts
|
|
1894
|
+
function createRoutine_foldersGetResponseFromDiscriminatorValue(parseNode) {
|
|
1895
|
+
return deserializeIntoRoutine_foldersGetResponse;
|
|
1537
1896
|
}
|
|
1538
|
-
function
|
|
1539
|
-
return
|
|
1897
|
+
function createRoutineFolder400ErrorFromDiscriminatorValue(parseNode) {
|
|
1898
|
+
return deserializeIntoRoutineFolder400Error;
|
|
1540
1899
|
}
|
|
1541
|
-
function
|
|
1900
|
+
function deserializeIntoRoutine_foldersGetResponse(routine_foldersGetResponse = {}) {
|
|
1542
1901
|
return {
|
|
1543
|
-
|
|
1544
|
-
|
|
1902
|
+
page: (n) => {
|
|
1903
|
+
routine_foldersGetResponse.page = n.getNumberValue();
|
|
1904
|
+
},
|
|
1905
|
+
page_count: (n) => {
|
|
1906
|
+
routine_foldersGetResponse.pageCount = n.getNumberValue();
|
|
1907
|
+
},
|
|
1908
|
+
routine_folders: (n) => {
|
|
1909
|
+
routine_foldersGetResponse.routineFolders = n.getCollectionOfObjectValues(
|
|
1910
|
+
createRoutineFolderFromDiscriminatorValue
|
|
1911
|
+
);
|
|
1545
1912
|
}
|
|
1546
1913
|
};
|
|
1547
1914
|
}
|
|
1548
|
-
function
|
|
1915
|
+
function deserializeIntoRoutineFolder400Error(routineFolder400Error = {}) {
|
|
1549
1916
|
return {
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
},
|
|
1553
|
-
"page_count": (n) => {
|
|
1554
|
-
workoutsGetResponse.pageCount = n.getNumberValue();
|
|
1555
|
-
},
|
|
1556
|
-
"workouts": (n) => {
|
|
1557
|
-
workoutsGetResponse.workouts = n.getCollectionOfObjectValues(createWorkoutFromDiscriminatorValue);
|
|
1917
|
+
error: (n) => {
|
|
1918
|
+
routineFolder400Error.errorEscaped = n.getStringValue();
|
|
1558
1919
|
}
|
|
1559
1920
|
};
|
|
1560
1921
|
}
|
|
1561
|
-
var
|
|
1562
|
-
var
|
|
1563
|
-
|
|
1564
|
-
requestsMetadata:
|
|
1565
|
-
pathParametersMappings: ["
|
|
1566
|
-
},
|
|
1567
|
-
count: {
|
|
1568
|
-
requestsMetadata: CountRequestBuilderRequestsMetadata
|
|
1569
|
-
},
|
|
1570
|
-
events: {
|
|
1571
|
-
requestsMetadata: EventsRequestBuilderRequestsMetadata
|
|
1922
|
+
var Routine_foldersRequestBuilderUriTemplate = "{+baseurl}/v1/routine_folders{?page*,pageSize*}";
|
|
1923
|
+
var Routine_foldersRequestBuilderNavigationMetadata = {
|
|
1924
|
+
byFolderId: {
|
|
1925
|
+
requestsMetadata: WithFolderItemRequestBuilderRequestsMetadata,
|
|
1926
|
+
pathParametersMappings: ["folderId"]
|
|
1572
1927
|
}
|
|
1573
1928
|
};
|
|
1574
|
-
var
|
|
1929
|
+
var Routine_foldersRequestBuilderRequestsMetadata = {
|
|
1575
1930
|
get: {
|
|
1576
|
-
uriTemplate:
|
|
1577
|
-
responseBodyContentType: "application/json",
|
|
1578
|
-
adapterMethodName: "send",
|
|
1579
|
-
responseBodyFactory: createWorkoutsGetResponseFromDiscriminatorValue
|
|
1580
|
-
},
|
|
1581
|
-
post: {
|
|
1582
|
-
uriTemplate: WorkoutsRequestBuilderUriTemplate,
|
|
1931
|
+
uriTemplate: Routine_foldersRequestBuilderUriTemplate,
|
|
1583
1932
|
responseBodyContentType: "application/json",
|
|
1584
|
-
errorMappings: {
|
|
1585
|
-
400: createWorkout400ErrorFromDiscriminatorValue2
|
|
1586
|
-
},
|
|
1587
1933
|
adapterMethodName: "send",
|
|
1588
|
-
responseBodyFactory:
|
|
1589
|
-
requestBodyContentType: "application/json",
|
|
1590
|
-
requestBodySerializer: serializePostWorkoutsRequestBody,
|
|
1591
|
-
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1592
|
-
}
|
|
1593
|
-
};
|
|
1594
|
-
|
|
1595
|
-
// src/generated/client/v1/index.ts
|
|
1596
|
-
var V1RequestBuilderNavigationMetadata = {
|
|
1597
|
-
exercise_templates: {
|
|
1598
|
-
requestsMetadata: Exercise_templatesRequestBuilderRequestsMetadata,
|
|
1599
|
-
navigationMetadata: Exercise_templatesRequestBuilderNavigationMetadata
|
|
1600
|
-
},
|
|
1601
|
-
routines: {
|
|
1602
|
-
requestsMetadata: RoutinesRequestBuilderRequestsMetadata,
|
|
1603
|
-
navigationMetadata: RoutinesRequestBuilderNavigationMetadata
|
|
1604
|
-
},
|
|
1605
|
-
routine_folders: {
|
|
1606
|
-
requestsMetadata: Routine_foldersRequestBuilderRequestsMetadata,
|
|
1607
|
-
navigationMetadata: Routine_foldersRequestBuilderNavigationMetadata
|
|
1934
|
+
responseBodyFactory: createRoutine_foldersGetResponseFromDiscriminatorValue
|
|
1608
1935
|
},
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
var FormParseNode = class _FormParseNode {
|
|
1621
|
-
/**
|
|
1622
|
-
* Creates a new instance of FormParseNode
|
|
1623
|
-
* @param _rawString the raw string to parse
|
|
1624
|
-
* @param backingStoreFactory the factory to create backing stores
|
|
1625
|
-
*/
|
|
1626
|
-
constructor(_rawString, backingStoreFactory) {
|
|
1627
|
-
this._rawString = _rawString;
|
|
1628
|
-
this.backingStoreFactory = backingStoreFactory;
|
|
1629
|
-
this._fields = {};
|
|
1630
|
-
this.normalizeKey = (key) => decodeURIComponent(key).trim();
|
|
1631
|
-
this.getStringValue = () => decodeURIComponent(this._rawString);
|
|
1632
|
-
this.getChildNode = (identifier) => {
|
|
1633
|
-
if (this._fields[identifier]) {
|
|
1634
|
-
return new _FormParseNode(this._fields[identifier], this.backingStoreFactory);
|
|
1635
|
-
}
|
|
1636
|
-
return void 0;
|
|
1637
|
-
};
|
|
1638
|
-
this.getBooleanValue = () => {
|
|
1639
|
-
var _a;
|
|
1640
|
-
const value = (_a = this.getStringValue()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
1641
|
-
if (value === "true" || value === "1") {
|
|
1642
|
-
return true;
|
|
1643
|
-
} else if (value === "false" || value === "0") {
|
|
1644
|
-
return false;
|
|
1645
|
-
}
|
|
1646
|
-
return void 0;
|
|
1647
|
-
};
|
|
1648
|
-
this.getNumberValue = () => parseFloat(this.getStringValue());
|
|
1649
|
-
this.getGuidValue = () => parseGuidString(this.getStringValue());
|
|
1650
|
-
this.getDateValue = () => new Date(Date.parse(this.getStringValue()));
|
|
1651
|
-
this.getDateOnlyValue = () => DateOnly.parse(this.getStringValue());
|
|
1652
|
-
this.getTimeOnlyValue = () => TimeOnly.parse(this.getStringValue());
|
|
1653
|
-
this.getDurationValue = () => Duration.parse(this.getStringValue());
|
|
1654
|
-
this.getCollectionOfPrimitiveValues = () => {
|
|
1655
|
-
return this._rawString.split(",").map((x) => {
|
|
1656
|
-
const currentParseNode = new _FormParseNode(x, this.backingStoreFactory);
|
|
1657
|
-
const typeOfX = typeof x;
|
|
1658
|
-
if (typeOfX === "boolean") {
|
|
1659
|
-
return currentParseNode.getBooleanValue();
|
|
1660
|
-
} else if (typeOfX === "string") {
|
|
1661
|
-
return currentParseNode.getStringValue();
|
|
1662
|
-
} else if (typeOfX === "number") {
|
|
1663
|
-
return currentParseNode.getNumberValue();
|
|
1664
|
-
} else if (x instanceof Date) {
|
|
1665
|
-
return currentParseNode.getDateValue();
|
|
1666
|
-
} else if (x instanceof DateOnly) {
|
|
1667
|
-
return currentParseNode.getDateValue();
|
|
1668
|
-
} else if (x instanceof TimeOnly) {
|
|
1669
|
-
return currentParseNode.getDateValue();
|
|
1670
|
-
} else if (x instanceof Duration) {
|
|
1671
|
-
return currentParseNode.getDateValue();
|
|
1672
|
-
} else {
|
|
1673
|
-
throw new Error(`encountered an unknown type during deserialization ${typeof x}`);
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
};
|
|
1677
|
-
this.getCollectionOfObjectValues = (parsableFactory) => {
|
|
1678
|
-
throw new Error(`serialization of collections is not supported with URI encoding`);
|
|
1679
|
-
};
|
|
1680
|
-
this.getObjectValue = (parsableFactory) => {
|
|
1681
|
-
const temp = {};
|
|
1682
|
-
const enableBackingStore = isBackingStoreEnabled(parsableFactory(this)(temp));
|
|
1683
|
-
const value = enableBackingStore && this.backingStoreFactory ? new Proxy(temp, createBackedModelProxyHandler(this.backingStoreFactory)) : temp;
|
|
1684
|
-
if (this.onBeforeAssignFieldValues) {
|
|
1685
|
-
this.onBeforeAssignFieldValues(value);
|
|
1686
|
-
}
|
|
1687
|
-
this.assignFieldValues(value, parsableFactory);
|
|
1688
|
-
if (this.onAfterAssignFieldValues) {
|
|
1689
|
-
this.onAfterAssignFieldValues(value);
|
|
1690
|
-
}
|
|
1691
|
-
return value;
|
|
1692
|
-
};
|
|
1693
|
-
this.getCollectionOfEnumValues = (type) => {
|
|
1694
|
-
const rawValues = this.getStringValue();
|
|
1695
|
-
if (!rawValues) {
|
|
1696
|
-
return [];
|
|
1697
|
-
}
|
|
1698
|
-
return rawValues.split(",").map((x) => getEnumValueFromStringValue(x, type));
|
|
1699
|
-
};
|
|
1700
|
-
this.getEnumValue = (type) => {
|
|
1701
|
-
const rawValue = this.getStringValue();
|
|
1702
|
-
if (!rawValue) {
|
|
1703
|
-
return void 0;
|
|
1704
|
-
}
|
|
1705
|
-
return getEnumValueFromStringValue(rawValue, type);
|
|
1706
|
-
};
|
|
1707
|
-
this.assignFieldValues = (model, parsableFactory) => {
|
|
1708
|
-
const fields = parsableFactory(this)(model);
|
|
1709
|
-
Object.entries(this._fields).filter((x) => !/^null$/i.test(x[1])).forEach(([k, v]) => {
|
|
1710
|
-
const deserializer = fields[k];
|
|
1711
|
-
if (deserializer) {
|
|
1712
|
-
deserializer(new _FormParseNode(v, this.backingStoreFactory));
|
|
1713
|
-
} else {
|
|
1714
|
-
model[k] = v;
|
|
1715
|
-
}
|
|
1716
|
-
});
|
|
1717
|
-
};
|
|
1718
|
-
if (!_rawString) {
|
|
1719
|
-
throw new Error("rawString cannot be undefined");
|
|
1720
|
-
}
|
|
1721
|
-
_rawString.split("&").map((x) => x.split("=")).filter((x) => x.length === 2).forEach((x) => {
|
|
1722
|
-
const key = this.normalizeKey(x[0]);
|
|
1723
|
-
if (this._fields[key]) {
|
|
1724
|
-
this._fields[key] += "," + x[1];
|
|
1725
|
-
} else {
|
|
1726
|
-
this._fields[key] = x[1];
|
|
1727
|
-
}
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1730
|
-
getByteArrayValue() {
|
|
1731
|
-
throw new Error("serialization of byt arrays is not supported with URI encoding");
|
|
1936
|
+
post: {
|
|
1937
|
+
uriTemplate: Routine_foldersRequestBuilderUriTemplate,
|
|
1938
|
+
responseBodyContentType: "application/json",
|
|
1939
|
+
errorMappings: {
|
|
1940
|
+
400: createRoutineFolder400ErrorFromDiscriminatorValue
|
|
1941
|
+
},
|
|
1942
|
+
adapterMethodName: "send",
|
|
1943
|
+
responseBodyFactory: createRoutineFolderFromDiscriminatorValue,
|
|
1944
|
+
requestBodyContentType: "application/json",
|
|
1945
|
+
requestBodySerializer: serializePostRoutineFolderRequestBody,
|
|
1946
|
+
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1732
1947
|
}
|
|
1733
1948
|
};
|
|
1734
1949
|
|
|
1735
|
-
//
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
};
|
|
1771
|
-
this.writeGuidValue = (key, value) => {
|
|
1772
|
-
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1773
|
-
value && this.writeStringValue(key, value.toString());
|
|
1774
|
-
}
|
|
1775
|
-
};
|
|
1776
|
-
this.writeDateValue = (key, value) => {
|
|
1777
|
-
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1778
|
-
value && this.writeStringValue(key, value.toISOString());
|
|
1779
|
-
}
|
|
1780
|
-
};
|
|
1781
|
-
this.writeDateOnlyValue = (key, value) => {
|
|
1782
|
-
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1783
|
-
value && this.writeStringValue(key, value.toString());
|
|
1784
|
-
}
|
|
1785
|
-
};
|
|
1786
|
-
this.writeTimeOnlyValue = (key, value) => {
|
|
1787
|
-
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1788
|
-
value && this.writeStringValue(key, value.toString());
|
|
1789
|
-
}
|
|
1790
|
-
};
|
|
1791
|
-
this.writeDurationValue = (key, value) => {
|
|
1792
|
-
if (this.shouldWriteValueOrNull(key, value)) {
|
|
1793
|
-
value && this.writeStringValue(key, value.toString());
|
|
1794
|
-
}
|
|
1795
|
-
};
|
|
1796
|
-
this.writeNullValue = (key) => {
|
|
1797
|
-
key && this.writeStringValue(key, null);
|
|
1798
|
-
};
|
|
1799
|
-
this.writeCollectionOfPrimitiveValues = (_key, _values) => {
|
|
1800
|
-
if (_key && _values) {
|
|
1801
|
-
_values.forEach((val) => {
|
|
1802
|
-
this.writeAnyValue(_key, val);
|
|
1803
|
-
});
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
this.writeCollectionOfObjectValues = (_key, _values) => {
|
|
1807
|
-
throw new Error(`serialization of collections is not supported with URI encoding`);
|
|
1808
|
-
};
|
|
1809
|
-
this.writeObjectValue = (key, value, serializerMethod) => {
|
|
1810
|
-
if (++this.depth > 0) {
|
|
1811
|
-
throw new Error(`serialization of nested objects is not supported with URI encoding`);
|
|
1812
|
-
}
|
|
1813
|
-
if (!this.shouldWriteValueOrNull(key, value)) {
|
|
1814
|
-
return;
|
|
1815
|
-
}
|
|
1816
|
-
if (value) {
|
|
1817
|
-
if (key) {
|
|
1818
|
-
this.writePropertyName(key);
|
|
1819
|
-
}
|
|
1820
|
-
this.onBeforeObjectSerialization && this.onBeforeObjectSerialization(value);
|
|
1821
|
-
this.onStartObjectSerialization && this.onStartObjectSerialization(value, this);
|
|
1822
|
-
serializerMethod(this, value);
|
|
1823
|
-
this.onAfterObjectSerialization && this.onAfterObjectSerialization(value);
|
|
1824
|
-
if (this.writer.length > 0 && this.writer[this.writer.length - 1] === _FormSerializationWriter.propertySeparator) {
|
|
1825
|
-
this.writer.pop();
|
|
1826
|
-
}
|
|
1827
|
-
key && this.writer.push(_FormSerializationWriter.propertySeparator);
|
|
1828
|
-
}
|
|
1829
|
-
};
|
|
1830
|
-
this.writeEnumValue = (key, ...values) => {
|
|
1831
|
-
if (values.length > 0) {
|
|
1832
|
-
const rawValues = values.filter((x) => x !== void 0).map((x) => `${x}`);
|
|
1833
|
-
if (rawValues.length > 0) {
|
|
1834
|
-
this.writeStringValue(key, rawValues.reduce((x, y) => `${x}, ${y}`));
|
|
1835
|
-
}
|
|
1836
|
-
}
|
|
1837
|
-
};
|
|
1838
|
-
this.writeCollectionOfEnumValues = (key, values) => {
|
|
1839
|
-
if (key && values && values.length > 0) {
|
|
1840
|
-
const rawValues = values.filter((x) => x !== void 0).map((x) => `${x}`);
|
|
1841
|
-
if (rawValues.length > 0) {
|
|
1842
|
-
this.writeCollectionOfPrimitiveValues(key, rawValues);
|
|
1843
|
-
}
|
|
1844
|
-
}
|
|
1845
|
-
};
|
|
1846
|
-
this.getSerializedContent = () => {
|
|
1847
|
-
return this.convertStringToArrayBuffer(this.writer.join(``));
|
|
1848
|
-
};
|
|
1849
|
-
this.convertStringToArrayBuffer = (str) => {
|
|
1850
|
-
const encoder = new TextEncoder();
|
|
1851
|
-
const encodedString = encoder.encode(str);
|
|
1852
|
-
return encodedString.buffer;
|
|
1853
|
-
};
|
|
1854
|
-
this.writeAdditionalData = (additionalData) => {
|
|
1855
|
-
if (additionalData === void 0)
|
|
1856
|
-
return;
|
|
1857
|
-
for (const key in additionalData) {
|
|
1858
|
-
this.writeAnyValue(key, additionalData[key]);
|
|
1859
|
-
}
|
|
1860
|
-
};
|
|
1861
|
-
this.writeAnyValue = (key, value) => {
|
|
1862
|
-
if (value === null) {
|
|
1863
|
-
return this.writeNullValue(key);
|
|
1864
|
-
}
|
|
1865
|
-
if (value !== void 0) {
|
|
1866
|
-
const valueType = typeof value;
|
|
1867
|
-
if (valueType === "boolean") {
|
|
1868
|
-
this.writeBooleanValue(key, value);
|
|
1869
|
-
} else if (valueType === "string") {
|
|
1870
|
-
this.writeStringValue(key, value);
|
|
1871
|
-
} else if (value instanceof Date) {
|
|
1872
|
-
this.writeDateValue(key, value);
|
|
1873
|
-
} else if (value instanceof DateOnly2) {
|
|
1874
|
-
this.writeDateOnlyValue(key, value);
|
|
1875
|
-
} else if (value instanceof TimeOnly2) {
|
|
1876
|
-
this.writeTimeOnlyValue(key, value);
|
|
1877
|
-
} else if (value instanceof Duration2) {
|
|
1878
|
-
this.writeDurationValue(key, value);
|
|
1879
|
-
} else if (valueType === "number") {
|
|
1880
|
-
this.writeNumberValue(key, value);
|
|
1881
|
-
} else {
|
|
1882
|
-
throw new Error(`encountered unknown ${value} value type during serialization ${valueType} for key ${key}`);
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
};
|
|
1886
|
-
}
|
|
1887
|
-
writeByteArrayValue(key, value) {
|
|
1888
|
-
throw new Error("serialization of byt arrays is not supported with URI encoding");
|
|
1950
|
+
// src/generated/client/v1/routines/item/index.ts
|
|
1951
|
+
function createRoutine400ErrorFromDiscriminatorValue(parseNode) {
|
|
1952
|
+
return deserializeIntoRoutine400Error;
|
|
1953
|
+
}
|
|
1954
|
+
function createRoutine404ErrorFromDiscriminatorValue(parseNode) {
|
|
1955
|
+
return deserializeIntoRoutine404Error;
|
|
1956
|
+
}
|
|
1957
|
+
function deserializeIntoRoutine400Error(routine400Error = {}) {
|
|
1958
|
+
return {
|
|
1959
|
+
error: (n) => {
|
|
1960
|
+
routine400Error.errorEscaped = n.getStringValue();
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
function deserializeIntoRoutine404Error(routine404Error = {}) {
|
|
1965
|
+
return {
|
|
1966
|
+
error: (n) => {
|
|
1967
|
+
routine404Error.errorEscaped = n.getStringValue();
|
|
1968
|
+
}
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
var WithRoutineItemRequestBuilderUriTemplate = "{+baseurl}/v1/routines/{routineId}";
|
|
1972
|
+
var WithRoutineItemRequestBuilderRequestsMetadata = {
|
|
1973
|
+
put: {
|
|
1974
|
+
uriTemplate: WithRoutineItemRequestBuilderUriTemplate,
|
|
1975
|
+
responseBodyContentType: "application/json",
|
|
1976
|
+
errorMappings: {
|
|
1977
|
+
400: createRoutine400ErrorFromDiscriminatorValue,
|
|
1978
|
+
404: createRoutine404ErrorFromDiscriminatorValue
|
|
1979
|
+
},
|
|
1980
|
+
adapterMethodName: "send",
|
|
1981
|
+
responseBodyFactory: createRoutineFromDiscriminatorValue,
|
|
1982
|
+
requestBodyContentType: "application/json",
|
|
1983
|
+
requestBodySerializer: serializePutRoutinesRequestBody,
|
|
1984
|
+
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1889
1985
|
}
|
|
1890
1986
|
};
|
|
1891
|
-
FormSerializationWriter.propertySeparator = `&`;
|
|
1892
1987
|
|
|
1893
|
-
//
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1988
|
+
// src/generated/client/v1/routines/index.ts
|
|
1989
|
+
function createRoutine400ErrorFromDiscriminatorValue2(parseNode) {
|
|
1990
|
+
return deserializeIntoRoutine400Error2;
|
|
1991
|
+
}
|
|
1992
|
+
function createRoutine403ErrorFromDiscriminatorValue(parseNode) {
|
|
1993
|
+
return deserializeIntoRoutine403Error;
|
|
1994
|
+
}
|
|
1995
|
+
function createRoutinesGetResponseFromDiscriminatorValue(parseNode) {
|
|
1996
|
+
return deserializeIntoRoutinesGetResponse;
|
|
1997
|
+
}
|
|
1998
|
+
function deserializeIntoRoutine400Error2(routine400Error = {}) {
|
|
1999
|
+
return {
|
|
2000
|
+
error: (n) => {
|
|
2001
|
+
routine400Error.errorEscaped = n.getStringValue();
|
|
2002
|
+
}
|
|
2003
|
+
};
|
|
2004
|
+
}
|
|
2005
|
+
function deserializeIntoRoutine403Error(routine403Error = {}) {
|
|
2006
|
+
return {
|
|
2007
|
+
error: (n) => {
|
|
2008
|
+
routine403Error.errorEscaped = n.getStringValue();
|
|
2009
|
+
}
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
function deserializeIntoRoutinesGetResponse(routinesGetResponse = {}) {
|
|
2013
|
+
return {
|
|
2014
|
+
page: (n) => {
|
|
2015
|
+
routinesGetResponse.page = n.getNumberValue();
|
|
2016
|
+
},
|
|
2017
|
+
page_count: (n) => {
|
|
2018
|
+
routinesGetResponse.pageCount = n.getNumberValue();
|
|
2019
|
+
},
|
|
2020
|
+
routines: (n) => {
|
|
2021
|
+
routinesGetResponse.routines = n.getCollectionOfObjectValues(
|
|
2022
|
+
createRoutineFromDiscriminatorValue
|
|
2023
|
+
);
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
var RoutinesRequestBuilderUriTemplate = "{+baseurl}/v1/routines{?page*,pageSize*}";
|
|
2028
|
+
var RoutinesRequestBuilderNavigationMetadata = {
|
|
2029
|
+
byRoutineId: {
|
|
2030
|
+
requestsMetadata: WithRoutineItemRequestBuilderRequestsMetadata,
|
|
2031
|
+
pathParametersMappings: ["routineId"]
|
|
1901
2032
|
}
|
|
1902
|
-
|
|
1903
|
-
|
|
2033
|
+
};
|
|
2034
|
+
var RoutinesRequestBuilderRequestsMetadata = {
|
|
2035
|
+
get: {
|
|
2036
|
+
uriTemplate: RoutinesRequestBuilderUriTemplate,
|
|
2037
|
+
responseBodyContentType: "application/json",
|
|
2038
|
+
adapterMethodName: "send",
|
|
2039
|
+
responseBodyFactory: createRoutinesGetResponseFromDiscriminatorValue
|
|
2040
|
+
},
|
|
2041
|
+
post: {
|
|
2042
|
+
uriTemplate: RoutinesRequestBuilderUriTemplate,
|
|
2043
|
+
responseBodyContentType: "application/json",
|
|
2044
|
+
errorMappings: {
|
|
2045
|
+
400: createRoutine400ErrorFromDiscriminatorValue2,
|
|
2046
|
+
403: createRoutine403ErrorFromDiscriminatorValue
|
|
2047
|
+
},
|
|
2048
|
+
adapterMethodName: "send",
|
|
2049
|
+
responseBodyFactory: createRoutineFromDiscriminatorValue,
|
|
2050
|
+
requestBodyContentType: "application/json",
|
|
2051
|
+
requestBodySerializer: serializePostRoutinesRequestBody,
|
|
2052
|
+
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1904
2053
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
2054
|
+
};
|
|
2055
|
+
|
|
2056
|
+
// src/generated/client/v1/workouts/count/index.ts
|
|
2057
|
+
function createCountGetResponseFromDiscriminatorValue(parseNode) {
|
|
2058
|
+
return deserializeIntoCountGetResponse;
|
|
2059
|
+
}
|
|
2060
|
+
function deserializeIntoCountGetResponse(countGetResponse = {}) {
|
|
2061
|
+
return {
|
|
2062
|
+
workout_count: (n) => {
|
|
2063
|
+
countGetResponse.workoutCount = n.getNumberValue();
|
|
1912
2064
|
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
var CountRequestBuilderUriTemplate = "{+baseurl}/v1/workouts/count";
|
|
2068
|
+
var CountRequestBuilderRequestsMetadata = {
|
|
2069
|
+
get: {
|
|
2070
|
+
uriTemplate: CountRequestBuilderUriTemplate,
|
|
2071
|
+
responseBodyContentType: "application/json",
|
|
2072
|
+
adapterMethodName: "send",
|
|
2073
|
+
responseBodyFactory: createCountGetResponseFromDiscriminatorValue
|
|
1918
2074
|
}
|
|
1919
2075
|
};
|
|
1920
2076
|
|
|
1921
|
-
//
|
|
1922
|
-
var
|
|
1923
|
-
|
|
1924
|
-
|
|
2077
|
+
// src/generated/client/v1/workouts/events/index.ts
|
|
2078
|
+
var EventsRequestBuilderUriTemplate = "{+baseurl}/v1/workouts/events{?page*,pageSize*,since*}";
|
|
2079
|
+
var EventsRequestBuilderRequestsMetadata = {
|
|
2080
|
+
get: {
|
|
2081
|
+
uriTemplate: EventsRequestBuilderUriTemplate,
|
|
2082
|
+
responseBodyContentType: "application/json",
|
|
2083
|
+
adapterMethodName: "send",
|
|
2084
|
+
responseBodyFactory: createPaginatedWorkoutEventsFromDiscriminatorValue
|
|
1925
2085
|
}
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2086
|
+
};
|
|
2087
|
+
|
|
2088
|
+
// src/generated/client/v1/workouts/item/index.ts
|
|
2089
|
+
function createWorkout400ErrorFromDiscriminatorValue(parseNode) {
|
|
2090
|
+
return deserializeIntoWorkout400Error;
|
|
2091
|
+
}
|
|
2092
|
+
function deserializeIntoWorkout400Error(workout400Error = {}) {
|
|
2093
|
+
return {
|
|
2094
|
+
error: (n) => {
|
|
2095
|
+
workout400Error.errorEscaped = n.getStringValue();
|
|
1931
2096
|
}
|
|
1932
|
-
|
|
2097
|
+
};
|
|
2098
|
+
}
|
|
2099
|
+
var WithWorkoutItemRequestBuilderUriTemplate = "{+baseurl}/v1/workouts/{workoutId}";
|
|
2100
|
+
var WithWorkoutItemRequestBuilderRequestsMetadata = {
|
|
2101
|
+
get: {
|
|
2102
|
+
uriTemplate: WithWorkoutItemRequestBuilderUriTemplate,
|
|
2103
|
+
responseBodyContentType: "application/json",
|
|
2104
|
+
adapterMethodName: "send",
|
|
2105
|
+
responseBodyFactory: createWorkoutFromDiscriminatorValue
|
|
2106
|
+
},
|
|
2107
|
+
put: {
|
|
2108
|
+
uriTemplate: WithWorkoutItemRequestBuilderUriTemplate,
|
|
2109
|
+
responseBodyContentType: "application/json",
|
|
2110
|
+
errorMappings: {
|
|
2111
|
+
400: createWorkout400ErrorFromDiscriminatorValue
|
|
2112
|
+
},
|
|
2113
|
+
adapterMethodName: "send",
|
|
2114
|
+
responseBodyFactory: createWorkoutFromDiscriminatorValue,
|
|
2115
|
+
requestBodyContentType: "application/json",
|
|
2116
|
+
requestBodySerializer: serializePostWorkoutsRequestBody,
|
|
2117
|
+
requestInformationContentSetMethod: "setContentFromParsable"
|
|
1933
2118
|
}
|
|
1934
2119
|
};
|
|
1935
2120
|
|
|
1936
|
-
// src/generated/client/
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
}
|
|
1948
|
-
if (value) {
|
|
1949
|
-
if (key) {
|
|
1950
|
-
this.writeRawStringValue(": ");
|
|
1951
|
-
}
|
|
1952
|
-
this.writeRawStringValue(value);
|
|
1953
|
-
}
|
|
1954
|
-
};
|
|
1955
|
-
this.writeRawStringValue = (value) => {
|
|
1956
|
-
if (value) {
|
|
1957
|
-
this.writeByteArrayValue(void 0, new TextEncoder().encode(value).buffer);
|
|
1958
|
-
}
|
|
1959
|
-
};
|
|
1960
|
-
this.writeBooleanValue = (key, value) => {
|
|
1961
|
-
throw new Error(`serialization of boolean values is not supported with multipart`);
|
|
1962
|
-
};
|
|
1963
|
-
this.writeNumberValue = (key, value) => {
|
|
1964
|
-
throw new Error(`serialization of number values is not supported with multipart`);
|
|
1965
|
-
};
|
|
1966
|
-
this.writeGuidValue = (key, value) => {
|
|
1967
|
-
throw new Error(`serialization of guid values is not supported with multipart`);
|
|
1968
|
-
};
|
|
1969
|
-
this.writeDateValue = (key, value) => {
|
|
1970
|
-
throw new Error(`serialization of date values is not supported with multipart`);
|
|
1971
|
-
};
|
|
1972
|
-
this.writeDateOnlyValue = (key, value) => {
|
|
1973
|
-
throw new Error(`serialization of date only values is not supported with multipart`);
|
|
1974
|
-
};
|
|
1975
|
-
this.writeTimeOnlyValue = (key, value) => {
|
|
1976
|
-
throw new Error(`serialization of time only values is not supported with multipart`);
|
|
1977
|
-
};
|
|
1978
|
-
this.writeDurationValue = (key, value) => {
|
|
1979
|
-
throw new Error(`serialization of duration values is not supported with multipart`);
|
|
1980
|
-
};
|
|
1981
|
-
this.writeNullValue = (key) => {
|
|
1982
|
-
throw new Error(`serialization of null values is not supported with multipart`);
|
|
1983
|
-
};
|
|
1984
|
-
this.writeCollectionOfPrimitiveValues = (_key, _values) => {
|
|
1985
|
-
throw new Error(`serialization of collections is not supported with multipart`);
|
|
1986
|
-
};
|
|
1987
|
-
this.writeCollectionOfObjectValues = (_key, _values) => {
|
|
1988
|
-
throw new Error(`serialization of collections is not supported with multipart`);
|
|
1989
|
-
};
|
|
1990
|
-
this.writeObjectValue = (key, value, serializerMethod) => {
|
|
1991
|
-
if (!value) {
|
|
1992
|
-
throw new Error(`value cannot be undefined`);
|
|
1993
|
-
}
|
|
1994
|
-
if (!(value instanceof MultipartBody)) {
|
|
1995
|
-
throw new Error(`expected MultipartBody instance`);
|
|
1996
|
-
}
|
|
1997
|
-
if (!serializerMethod) {
|
|
1998
|
-
throw new Error(`serializer method cannot be undefined`);
|
|
1999
|
-
}
|
|
2000
|
-
this.onBeforeObjectSerialization && this.onBeforeObjectSerialization(value);
|
|
2001
|
-
this.onStartObjectSerialization && this.onStartObjectSerialization(value, this);
|
|
2002
|
-
serializerMethod(this, value);
|
|
2003
|
-
this.onAfterObjectSerialization && this.onAfterObjectSerialization(value);
|
|
2004
|
-
};
|
|
2005
|
-
this.writeEnumValue = (key, ...values) => {
|
|
2006
|
-
throw new Error(`serialization of enum values is not supported with multipart`);
|
|
2007
|
-
};
|
|
2008
|
-
this.writeCollectionOfEnumValues = (key, values) => {
|
|
2009
|
-
throw new Error(`serialization of collection of enum values is not supported with multipart`);
|
|
2010
|
-
};
|
|
2011
|
-
this.getSerializedContent = () => {
|
|
2012
|
-
return this.writer;
|
|
2013
|
-
};
|
|
2014
|
-
this.writeAdditionalData = (additionalData) => {
|
|
2015
|
-
throw new Error(`serialization of additional data is not supported with multipart`);
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
writeByteArrayValue(key, value) {
|
|
2019
|
-
if (!value) {
|
|
2020
|
-
throw new Error("value cannot be undefined");
|
|
2121
|
+
// src/generated/client/v1/workouts/index.ts
|
|
2122
|
+
function createWorkout400ErrorFromDiscriminatorValue2(parseNode) {
|
|
2123
|
+
return deserializeIntoWorkout400Error2;
|
|
2124
|
+
}
|
|
2125
|
+
function createWorkoutsGetResponseFromDiscriminatorValue(parseNode) {
|
|
2126
|
+
return deserializeIntoWorkoutsGetResponse;
|
|
2127
|
+
}
|
|
2128
|
+
function deserializeIntoWorkout400Error2(workout400Error = {}) {
|
|
2129
|
+
return {
|
|
2130
|
+
error: (n) => {
|
|
2131
|
+
workout400Error.errorEscaped = n.getStringValue();
|
|
2021
2132
|
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
function deserializeIntoWorkoutsGetResponse(workoutsGetResponse = {}) {
|
|
2136
|
+
return {
|
|
2137
|
+
page: (n) => {
|
|
2138
|
+
workoutsGetResponse.page = n.getNumberValue();
|
|
2139
|
+
},
|
|
2140
|
+
page_count: (n) => {
|
|
2141
|
+
workoutsGetResponse.pageCount = n.getNumberValue();
|
|
2142
|
+
},
|
|
2143
|
+
workouts: (n) => {
|
|
2144
|
+
workoutsGetResponse.workouts = n.getCollectionOfObjectValues(
|
|
2145
|
+
createWorkoutFromDiscriminatorValue
|
|
2146
|
+
);
|
|
2147
|
+
}
|
|
2148
|
+
};
|
|
2149
|
+
}
|
|
2150
|
+
var WorkoutsRequestBuilderUriTemplate = "{+baseurl}/v1/workouts{?page*,pageSize*}";
|
|
2151
|
+
var WorkoutsRequestBuilderNavigationMetadata = {
|
|
2152
|
+
byWorkoutId: {
|
|
2153
|
+
requestsMetadata: WithWorkoutItemRequestBuilderRequestsMetadata,
|
|
2154
|
+
pathParametersMappings: ["workoutId"]
|
|
2155
|
+
},
|
|
2156
|
+
count: {
|
|
2157
|
+
requestsMetadata: CountRequestBuilderRequestsMetadata
|
|
2158
|
+
},
|
|
2159
|
+
events: {
|
|
2160
|
+
requestsMetadata: EventsRequestBuilderRequestsMetadata
|
|
2027
2161
|
}
|
|
2028
2162
|
};
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2163
|
+
var WorkoutsRequestBuilderRequestsMetadata = {
|
|
2164
|
+
get: {
|
|
2165
|
+
uriTemplate: WorkoutsRequestBuilderUriTemplate,
|
|
2166
|
+
responseBodyContentType: "application/json",
|
|
2167
|
+
adapterMethodName: "send",
|
|
2168
|
+
responseBodyFactory: createWorkoutsGetResponseFromDiscriminatorValue
|
|
2169
|
+
},
|
|
2170
|
+
post: {
|
|
2171
|
+
uriTemplate: WorkoutsRequestBuilderUriTemplate,
|
|
2172
|
+
responseBodyContentType: "application/json",
|
|
2173
|
+
errorMappings: {
|
|
2174
|
+
400: createWorkout400ErrorFromDiscriminatorValue2
|
|
2175
|
+
},
|
|
2176
|
+
adapterMethodName: "send",
|
|
2177
|
+
responseBodyFactory: createWorkoutFromDiscriminatorValue,
|
|
2178
|
+
requestBodyContentType: "application/json",
|
|
2179
|
+
requestBodySerializer: serializePostWorkoutsRequestBody,
|
|
2180
|
+
requestInformationContentSetMethod: "setContentFromParsable"
|
|
2034
2181
|
}
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2182
|
+
};
|
|
2183
|
+
|
|
2184
|
+
// src/generated/client/v1/index.ts
|
|
2185
|
+
var V1RequestBuilderNavigationMetadata = {
|
|
2186
|
+
exercise_templates: {
|
|
2187
|
+
requestsMetadata: Exercise_templatesRequestBuilderRequestsMetadata,
|
|
2188
|
+
navigationMetadata: Exercise_templatesRequestBuilderNavigationMetadata
|
|
2189
|
+
},
|
|
2190
|
+
routines: {
|
|
2191
|
+
requestsMetadata: RoutinesRequestBuilderRequestsMetadata,
|
|
2192
|
+
navigationMetadata: RoutinesRequestBuilderNavigationMetadata
|
|
2193
|
+
},
|
|
2194
|
+
routine_folders: {
|
|
2195
|
+
requestsMetadata: Routine_foldersRequestBuilderRequestsMetadata,
|
|
2196
|
+
navigationMetadata: Routine_foldersRequestBuilderNavigationMetadata
|
|
2197
|
+
},
|
|
2198
|
+
workouts: {
|
|
2199
|
+
requestsMetadata: WorkoutsRequestBuilderRequestsMetadata,
|
|
2200
|
+
navigationMetadata: WorkoutsRequestBuilderNavigationMetadata
|
|
2042
2201
|
}
|
|
2043
2202
|
};
|
|
2044
2203
|
|
|
2045
2204
|
// src/generated/client/hevyClient.ts
|
|
2046
|
-
import { TextParseNodeFactory, TextSerializationWriterFactory } from "@microsoft/kiota-serialization-text";
|
|
2047
2205
|
function createHevyClient(requestAdapter) {
|
|
2048
2206
|
registerDefaultSerializer(JsonSerializationWriterFactory);
|
|
2049
2207
|
registerDefaultSerializer(TextSerializationWriterFactory);
|
|
@@ -2053,9 +2211,14 @@ function createHevyClient(requestAdapter) {
|
|
|
2053
2211
|
registerDefaultDeserializer(TextParseNodeFactory);
|
|
2054
2212
|
registerDefaultDeserializer(FormParseNodeFactory);
|
|
2055
2213
|
const pathParameters = {
|
|
2056
|
-
|
|
2214
|
+
baseurl: requestAdapter.baseUrl
|
|
2057
2215
|
};
|
|
2058
|
-
return apiClientProxifier(
|
|
2216
|
+
return apiClientProxifier(
|
|
2217
|
+
requestAdapter,
|
|
2218
|
+
pathParameters,
|
|
2219
|
+
HevyClientNavigationMetadata,
|
|
2220
|
+
void 0
|
|
2221
|
+
);
|
|
2059
2222
|
}
|
|
2060
2223
|
var HevyClientNavigationMetadata = {
|
|
2061
2224
|
v1: {
|
|
@@ -2064,27 +2227,18 @@ var HevyClientNavigationMetadata = {
|
|
|
2064
2227
|
};
|
|
2065
2228
|
|
|
2066
2229
|
// src/utils/hevyClient.ts
|
|
2067
|
-
var ApiKeyAuthProvider = class {
|
|
2068
|
-
apiKey;
|
|
2069
|
-
constructor(apiKey2) {
|
|
2070
|
-
this.apiKey = apiKey2;
|
|
2071
|
-
}
|
|
2072
|
-
async authenticateRequest(request) {
|
|
2073
|
-
request.headers.add("x-api-key", this.apiKey);
|
|
2074
|
-
}
|
|
2075
|
-
};
|
|
2076
2230
|
function createClient(apiKey2, baseUrl) {
|
|
2077
|
-
const authProvider = new
|
|
2231
|
+
const authProvider = new ApiKeyAuthenticationProvider(apiKey2, "api-key", ApiKeyLocation.Header);
|
|
2078
2232
|
const adapter = new FetchRequestAdapter(authProvider);
|
|
2079
2233
|
adapter.baseUrl = baseUrl;
|
|
2080
2234
|
return createHevyClient(adapter);
|
|
2081
2235
|
}
|
|
2082
2236
|
|
|
2083
2237
|
// src/index.ts
|
|
2084
|
-
var HEVY_API_BASEURL = "https://api.hevyapp.com
|
|
2238
|
+
var HEVY_API_BASEURL = "https://api.hevyapp.com";
|
|
2085
2239
|
var server = new McpServer({
|
|
2086
2240
|
name: "hevy",
|
|
2087
|
-
version: "1.0.
|
|
2241
|
+
version: "1.0.1"
|
|
2088
2242
|
});
|
|
2089
2243
|
if (!process.env.API_KEY) {
|
|
2090
2244
|
console.error("API_KEY environment variable is not set");
|