@hy-capital/api-habit-tracker-types 1.0.20 → 1.0.23

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.
@@ -1,6 +1,6 @@
1
1
  import { DbUser } from './user';
2
- import { DbUserStat } from './user-stat';
2
+ import { DbUserTopic } from './user-topic';
3
3
  export interface FrontendUser {
4
4
  user: DbUser;
5
- user_stats: DbUserStat[];
5
+ user_topics: DbUserTopic[];
6
6
  }
package/dist/habit.d.ts CHANGED
@@ -1,22 +1,29 @@
1
- import { StatType } from './user-stat';
1
+ import { TopicType } from './user-topic';
2
2
  export type HabitTime = 'Morning' | 'Afternoon' | 'Evening' | 'Anytime';
3
3
  export type HabitDifficulty = 1 | 2 | 3;
4
+ export type HabitFrequency = 'Daily' | 'Monthly';
5
+ export type HabitDays = 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
6
+ export declare const allHabitDays: HabitDays[];
4
7
  export interface HabitType {
5
8
  name: string;
6
9
  habitTime: HabitTime;
7
- statType: StatType;
10
+ topicType: TopicType;
8
11
  difficulty: HabitDifficulty;
9
12
  description: string;
10
13
  }
11
14
  export interface BaseHabit {
12
15
  user_id: number;
13
16
  name: string;
14
- stat_type: StatType;
17
+ topic_type: TopicType;
15
18
  done_days: string[];
16
19
  start_time: string;
17
20
  habit_time: HabitTime;
18
21
  difficulty: HabitDifficulty;
19
22
  description: string;
23
+ remind_me_at_time: string | null;
24
+ frequency: HabitFrequency;
25
+ habit_days: HabitDays[];
26
+ habit_dates: number[];
20
27
  }
21
28
  export interface DbHabit extends BaseHabit {
22
29
  id: number;
package/dist/habit.js CHANGED
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allHabitDays = void 0;
4
+ const typia_1 = require("typia");
5
+ exports.allHabitDays = (0, typia_1.literals)();
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './user';
2
- export * from './user-stat';
2
+ export * from './user-topic';
3
3
  export * from './frontend-user';
4
4
  export * from './habit';
package/dist/index.js CHANGED
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./user"), exports);
18
- __exportStar(require("./user-stat"), exports);
18
+ __exportStar(require("./user-topic"), exports);
19
19
  __exportStar(require("./frontend-user"), exports);
20
20
  __exportStar(require("./habit"), exports);
@@ -0,0 +1,13 @@
1
+ export type TopicType = 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep' | 'Custom';
2
+ export interface BaseUserTopic {
3
+ user_id: number;
4
+ type: TopicType;
5
+ initial_score: number;
6
+ current_score: number;
7
+ potential_score: number;
8
+ }
9
+ export interface DbUserTopic extends BaseUserTopic {
10
+ id: number;
11
+ created_at: string;
12
+ updated_at: string;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hy-capital/api-habit-tracker-types",
3
- "version": "1.0.20",
3
+ "version": "1.0.23",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import {DbUser} from './user';
2
- import {DbUserStat} from './user-stat';
2
+ import {DbUserTopic} from './user-topic';
3
3
 
4
4
  export interface FrontendUser {
5
5
  user: DbUser;
6
- user_stats: DbUserStat[];
6
+ user_topics: DbUserTopic[];
7
7
  }
package/src/habit.ts CHANGED
@@ -1,12 +1,16 @@
1
- import {StatType} from './user-stat';
1
+ import {TopicType} from './user-topic';
2
+ import { literals } from 'typia';
2
3
 
3
4
  export type HabitTime = 'Morning' | 'Afternoon' | 'Evening' | 'Anytime';
4
5
  export type HabitDifficulty = 1 | 2 | 3;
6
+ export type HabitFrequency = 'Daily' | 'Monthly';
7
+ export type HabitDays = 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
8
+ export const allHabitDays = literals<HabitDays>();
5
9
 
6
10
  export interface HabitType {
7
11
  name: string;
8
12
  habitTime: HabitTime;
9
- statType: StatType;
13
+ topicType: TopicType;
10
14
  difficulty: HabitDifficulty;
11
15
  description: string;
12
16
  }
@@ -14,17 +18,16 @@ export interface HabitType {
14
18
  export interface BaseHabit {
15
19
  user_id: number;
16
20
  name: string;
17
- stat_type: StatType;
21
+ topic_type: TopicType;
18
22
  done_days: string[];
19
23
  start_time: string;
20
24
  habit_time: HabitTime;
21
25
  difficulty: HabitDifficulty;
22
26
  description: string;
23
- // inspo:
24
- // after_i_do_something
25
- // remind_me_at_time
26
- // remind_me_at_location
27
- // missed_days (not needed, you can derive it based on done days)
27
+ remind_me_at_time: string | null;
28
+ frequency: HabitFrequency;
29
+ habit_days: HabitDays[];
30
+ habit_dates: number[];
28
31
  }
29
32
 
30
33
  export interface DbHabit extends BaseHabit {
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './user';
2
- export * from './user-stat';
2
+ export * from './user-topic';
3
3
  export * from './frontend-user';
4
4
  export * from './habit';
@@ -1,15 +1,15 @@
1
- export type StatType =
2
- 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep';
1
+ export type TopicType =
2
+ 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep' | 'Custom';
3
3
 
4
- export interface BaseUserStat {
4
+ export interface BaseUserTopic {
5
5
  user_id: number;
6
- type: StatType;
6
+ type: TopicType;
7
7
  initial_score: number;
8
8
  current_score: number;
9
9
  potential_score: number;
10
10
  }
11
11
 
12
- export interface DbUserStat extends BaseUserStat {
12
+ export interface DbUserTopic extends BaseUserTopic {
13
13
  id: number;
14
14
  created_at: string;
15
15
  updated_at: string;
@@ -1,13 +0,0 @@
1
- export type StatType = 'Calmness' | 'Diet' | 'Exercise' | 'Productivity' | 'Public speaking' | 'Sleep';
2
- export interface BaseUserStat {
3
- user_id: number;
4
- type: StatType;
5
- initial_score: number;
6
- current_score: number;
7
- potential_score: number;
8
- }
9
- export interface DbUserStat extends BaseUserStat {
10
- id: number;
11
- created_at: string;
12
- updated_at: string;
13
- }
File without changes