@hedia/types 2.2.0 → 2.2.1-alpha.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.
@@ -0,0 +1,4 @@
1
+ export interface IRpcRoute<Request, Response> {
2
+ Request: Request;
3
+ Response: Response;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../v1/types.ts"],"names":[],"mappings":""}
@@ -4,3 +4,4 @@ export * from "./services/auth";
4
4
  export * from "./services/email";
5
5
  export * from "./services/logbook";
6
6
  export * from "./services/notification";
7
+ export * from "./services/food";
package/dist/v3/index.js CHANGED
@@ -16,4 +16,5 @@ __exportStar(require("./services/auth"), exports);
16
16
  __exportStar(require("./services/email"), exports);
17
17
  __exportStar(require("./services/logbook"), exports);
18
18
  __exportStar(require("./services/notification"), exports);
19
+ __exportStar(require("./services/food"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../v3/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,oDAAkC;AAClC,kDAAgC;AAChC,mDAAiC;AACjC,qDAAmC;AACnC,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../v3/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,oDAAkC;AAClC,kDAAgC;AAChC,mDAAiC;AACjC,qDAAmC;AACnC,0DAAwC;AACxC,kDAAgC"}
@@ -0,0 +1,78 @@
1
+ import { Languages } from "../../v1";
2
+ import { IRpcRoute } from "../../v1/types";
3
+ export declare namespace FoodService {
4
+ namespace Enums {
5
+ enum MealType {
6
+ Breakfast = "breakfast",
7
+ Lunch = "lunch",
8
+ Dinner = "dinner",
9
+ Night = "night"
10
+ }
11
+ }
12
+ namespace RPC {
13
+ namespace SearchFood {
14
+ type Post = IRpcRoute<Types.IFoodSearchRequest, Types.IFoodSearchResponse>;
15
+ }
16
+ namespace AddFood {
17
+ type Post = IRpcRoute<Types.IAddFoodRequest, Types.IAddFoodResponse>;
18
+ }
19
+ namespace RecentFood {
20
+ type Post = IRpcRoute<Array<{
21
+ foodItemsId: string;
22
+ grams: number;
23
+ }>, undefined>;
24
+ type Get = IRpcRoute<Types.IFrequentFoodsRequest, Array<Types.IFrequentFoodsResponse>>;
25
+ }
26
+ namespace FavoriteFood {
27
+ type Post = IRpcRoute<Types.IFavoriteFoodRequest, Types.IFavoriteFoodResponse>;
28
+ }
29
+ }
30
+ namespace Types {
31
+ interface IFoodSearchRequest {
32
+ language: Languages;
33
+ text: string;
34
+ }
35
+ interface IFoodSearchResponse {
36
+ results: Array<IFoodItems & Pick<IFoodNames, "foodItemsId" | "id" | "title">>;
37
+ }
38
+ type IAddFoodRequest = Omit<IFoodItems & IFoodNames, "id" | "userId" | "foodItemsId">;
39
+ type IAddFoodResponse = IFoodItems & IFoodNames;
40
+ type IFrequentFoodsRequest = undefined;
41
+ type IFrequentFoodsResponse = Pick<IFoodItems & IFoodNames, "id" | "foodItemsId">;
42
+ interface IFavoriteFoodRequest {
43
+ timestamp: Date;
44
+ }
45
+ type IFavoriteFoodResponse = Pick<IFoodItems & IFoodNames, "id" | "foodItemsId">;
46
+ interface IFrequentFoods {
47
+ id: string;
48
+ foodItemsId: string;
49
+ grams: number;
50
+ timestamp: Date;
51
+ }
52
+ interface IFoodFavorites {
53
+ id: string;
54
+ foodItemsId: string;
55
+ grams: number;
56
+ mealType: Enums.MealType;
57
+ }
58
+ interface IFoodItems {
59
+ id: string;
60
+ userId: string;
61
+ calories: number;
62
+ carbohydrates: number;
63
+ proteins: number;
64
+ sugars: number;
65
+ fibers: number;
66
+ fats: number;
67
+ saturatedFats: number;
68
+ }
69
+ interface IFoodNames {
70
+ id: string;
71
+ foodItemsId: string;
72
+ title: string;
73
+ keywords: Array<string>;
74
+ description: string;
75
+ language: keyof Languages;
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FoodService = void 0;
4
+ var FoodService;
5
+ (function (FoodService) {
6
+ let Enums;
7
+ (function (Enums) {
8
+ let MealType;
9
+ (function (MealType) {
10
+ MealType["Breakfast"] = "breakfast";
11
+ MealType["Lunch"] = "lunch";
12
+ MealType["Dinner"] = "dinner";
13
+ MealType["Night"] = "night";
14
+ })(MealType = Enums.MealType || (Enums.MealType = {}));
15
+ })(Enums = FoodService.Enums || (FoodService.Enums = {}));
16
+ })(FoodService = exports.FoodService || (exports.FoodService = {}));
17
+ //# sourceMappingURL=food.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"food.js","sourceRoot":"","sources":["../../../v3/services/food.ts"],"names":[],"mappings":";;;AAGA,IAAiB,WAAW,CAsF3B;AAtFD,WAAiB,WAAW;IAC3B,IAAiB,KAAK,CAOrB;IAPD,WAAiB,KAAK;QACrB,IAAY,QAKX;QALD,WAAY,QAAQ;YACnB,mCAAuB,CAAA;YACvB,2BAAe,CAAA;YACf,6BAAiB,CAAA;YACjB,2BAAe,CAAA;QAChB,CAAC,EALW,QAAQ,GAAR,cAAQ,KAAR,cAAQ,QAKnB;IACF,CAAC,EAPgB,KAAK,GAAL,iBAAK,KAAL,iBAAK,QAOrB;AA8EF,CAAC,EAtFgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAsF3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/types",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-alpha.1",
4
4
  "description": "Enums, interfaces, and other common types for use in Hedia's software.",
5
5
  "main": "./dist/index.js",
6
6
  "repository": {