@timothyw/pat-common 1.0.113 → 1.0.116
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/types/id-types.d.ts +2 -2
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.js +4 -3
- package/dist/types/new/agenda-types.d.ts +116 -0
- package/dist/types/new/agenda-types.js +37 -0
- package/dist/types/new/auth-types.d.ts +153 -0
- package/dist/types/new/auth-types.js +48 -0
- package/dist/types/new/habits-types.d.ts +317 -0
- package/dist/types/new/habits-types.js +70 -0
- package/dist/types/new/index.d.ts +10 -0
- package/dist/types/new/index.js +26 -0
- package/dist/types/new/lists-types.d.ts +164 -0
- package/dist/types/new/lists-types.js +50 -0
- package/dist/types/new/misc/index.d.ts +1 -0
- package/dist/types/new/misc/index.js +17 -0
- package/dist/types/new/misc/version-types.d.ts +26 -0
- package/dist/types/new/misc/version-types.js +13 -0
- package/dist/types/new/notifications-types.d.ts +407 -0
- package/dist/types/new/notifications-types.js +91 -0
- package/dist/types/new/people-types.d.ts +285 -0
- package/dist/types/new/people-types.js +58 -0
- package/dist/types/new/program-config-types.d.ts +105 -0
- package/dist/types/new/program-config-types.js +29 -0
- package/dist/types/new/thoughts-types.d.ts +57 -0
- package/dist/types/new/thoughts-types.js +18 -0
- package/dist/types/new/user-types.d.ts +283 -0
- package/dist/types/new/user-types.js +46 -0
- package/dist/types/old/api/account/get-user-types.d.ts +5 -0
- package/dist/types/old/api/account/get-user-types.js +2 -0
- package/dist/types/old/api/account/index.d.ts +2 -0
- package/dist/types/old/api/account/index.js +18 -0
- package/dist/types/old/api/account/update-user-types.d.ts +128 -0
- package/dist/types/old/api/account/update-user-types.js +8 -0
- package/dist/types/old/api/auth/create-account-types.d.ts +24 -0
- package/dist/types/old/api/auth/create-account-types.js +10 -0
- package/dist/types/old/api/auth/index.d.ts +5 -0
- package/dist/types/old/api/auth/index.js +21 -0
- package/dist/types/old/api/auth/refresh-auth-types.d.ts +15 -0
- package/dist/types/old/api/auth/refresh-auth-types.js +7 -0
- package/dist/types/old/api/auth/resend-verification-types.d.ts +3 -0
- package/dist/types/old/api/auth/resend-verification-types.js +2 -0
- package/dist/types/old/api/auth/sign-in-types.d.ts +19 -0
- package/dist/types/old/api/auth/sign-in-types.js +8 -0
- package/dist/types/old/api/auth/verify-email-types.d.ts +3 -0
- package/dist/types/old/api/auth/verify-email-types.js +2 -0
- package/dist/types/old/api/habits/create-habit-entry-types.d.ts +19 -0
- package/dist/types/old/api/habits/create-habit-entry-types.js +10 -0
- package/dist/types/old/api/habits/create-habit-types.d.ts +26 -0
- package/dist/types/old/api/habits/create-habit-types.js +12 -0
- package/dist/types/old/api/habits/delete-habit-entry-types.d.ts +5 -0
- package/dist/types/old/api/habits/delete-habit-entry-types.js +2 -0
- package/dist/types/old/api/habits/delete-habit-types.d.ts +3 -0
- package/dist/types/old/api/habits/delete-habit-types.js +2 -0
- package/dist/types/old/api/habits/get-habits-types.d.ts +5 -0
- package/dist/types/old/api/habits/get-habits-types.js +2 -0
- package/dist/types/old/api/habits/index.d.ts +6 -0
- package/dist/types/old/api/habits/index.js +22 -0
- package/dist/types/old/api/habits/update-habit-types.d.ts +26 -0
- package/dist/types/old/api/habits/update-habit-types.js +12 -0
- package/dist/types/old/api/index.d.ts +9 -0
- package/dist/types/old/api/index.js +25 -0
- package/dist/types/old/api/items/complete-item-types.d.ts +14 -0
- package/dist/types/old/api/items/complete-item-types.js +7 -0
- package/dist/types/old/api/items/create-item-types.d.ts +29 -0
- package/dist/types/old/api/items/create-item-types.js +12 -0
- package/dist/types/old/api/items/delete-item-types.d.ts +3 -0
- package/dist/types/old/api/items/delete-item-types.js +2 -0
- package/dist/types/old/api/items/get-items-types.d.ts +5 -0
- package/dist/types/old/api/items/get-items-types.js +2 -0
- package/dist/types/old/api/items/index.d.ts +5 -0
- package/dist/types/old/api/items/index.js +21 -0
- package/dist/types/old/api/items/update-item-types.d.ts +29 -0
- package/dist/types/old/api/items/update-item-types.js +12 -0
- package/dist/types/old/api/lists/complete-list-item-types.d.ts +14 -0
- package/dist/types/old/api/lists/complete-list-item-types.js +7 -0
- package/dist/types/old/api/lists/create-list-item-types.d.ts +22 -0
- package/dist/types/old/api/lists/create-list-item-types.js +10 -0
- package/dist/types/old/api/lists/create-list-types.d.ts +17 -0
- package/dist/types/old/api/lists/create-list-types.js +9 -0
- package/dist/types/old/api/lists/get-list-item-types.d.ts +5 -0
- package/dist/types/old/api/lists/get-list-item-types.js +2 -0
- package/dist/types/old/api/lists/get-lists-types.d.ts +5 -0
- package/dist/types/old/api/lists/get-lists-types.js +2 -0
- package/dist/types/old/api/lists/index.d.ts +7 -0
- package/dist/types/old/api/lists/index.js +23 -0
- package/dist/types/old/api/lists/update-list-item-types.d.ts +23 -0
- package/dist/types/old/api/lists/update-list-item-types.js +11 -0
- package/dist/types/old/api/lists/update-list-types.d.ts +17 -0
- package/dist/types/old/api/lists/update-list-types.js +9 -0
- package/dist/types/old/api/misc/index.d.ts +1 -0
- package/dist/types/old/api/misc/index.js +17 -0
- package/dist/types/old/api/misc/version-types.d.ts +9 -0
- package/dist/types/old/api/misc/version-types.js +2 -0
- package/dist/types/old/api/notifications/create-notification-template-types.d.ts +78 -0
- package/dist/types/old/api/notifications/create-notification-template-types.js +25 -0
- package/dist/types/old/api/notifications/delete-notification-template-types.d.ts +5 -0
- package/dist/types/old/api/notifications/delete-notification-template-types.js +6 -0
- package/dist/types/old/api/notifications/get-notification-templates-types.d.ts +8 -0
- package/dist/types/old/api/notifications/get-notification-templates-types.js +6 -0
- package/dist/types/old/api/notifications/index.d.ts +6 -0
- package/dist/types/old/api/notifications/index.js +22 -0
- package/dist/types/old/api/notifications/preview-notification-template-types.d.ts +29 -0
- package/dist/types/old/api/notifications/preview-notification-template-types.js +12 -0
- package/dist/types/old/api/notifications/sync-notification-template-types.d.ts +14 -0
- package/dist/types/old/api/notifications/sync-notification-template-types.js +8 -0
- package/dist/types/old/api/notifications/update-notification-template-types.d.ts +69 -0
- package/dist/types/old/api/notifications/update-notification-template-types.js +22 -0
- package/dist/types/old/api/people/create-person-note-types.d.ts +19 -0
- package/dist/types/old/api/people/create-person-note-types.js +9 -0
- package/dist/types/old/api/people/create-person-types.d.ts +35 -0
- package/dist/types/old/api/people/create-person-types.js +13 -0
- package/dist/types/old/api/people/delete-person-notes-types.d.ts +3 -0
- package/dist/types/old/api/people/delete-person-notes-types.js +2 -0
- package/dist/types/old/api/people/delete-person-types.d.ts +3 -0
- package/dist/types/old/api/people/delete-person-types.js +2 -0
- package/dist/types/old/api/people/get-people-types.d.ts +5 -0
- package/dist/types/old/api/people/get-people-types.js +2 -0
- package/dist/types/old/api/people/get-person-notes-types.d.ts +5 -0
- package/dist/types/old/api/people/get-person-notes-types.js +2 -0
- package/dist/types/old/api/people/index.d.ts +8 -0
- package/dist/types/old/api/people/index.js +24 -0
- package/dist/types/old/api/people/update-person-note-types.d.ts +14 -0
- package/dist/types/old/api/people/update-person-note-types.js +7 -0
- package/dist/types/old/api/people/update-person-types.d.ts +35 -0
- package/dist/types/old/api/people/update-person-types.js +13 -0
- package/dist/types/old/api/thoughts/create-thought-types.d.ts +14 -0
- package/dist/types/old/api/thoughts/create-thought-types.js +7 -0
- package/dist/types/old/api/thoughts/delete-thought-types.d.ts +3 -0
- package/dist/types/old/api/thoughts/delete-thought-types.js +2 -0
- package/dist/types/old/api/thoughts/get-thoughts-types.d.ts +5 -0
- package/dist/types/old/api/thoughts/get-thoughts-types.js +2 -0
- package/dist/types/old/api/thoughts/index.d.ts +4 -0
- package/dist/types/old/api/thoughts/index.js +20 -0
- package/dist/types/old/api/thoughts/update-thought-types.d.ts +14 -0
- package/dist/types/old/api/thoughts/update-thought-types.js +7 -0
- package/dist/types/old/auth-tokens.d.ts +11 -0
- package/dist/types/old/auth-tokens.js +2 -0
- package/dist/types/old/models/auth-data.d.ts +14 -0
- package/dist/types/old/models/auth-data.js +9 -0
- package/dist/types/old/models/habit-data.d.ts +48 -0
- package/dist/types/old/models/habit-data.js +25 -0
- package/dist/types/old/models/index.d.ts +10 -0
- package/dist/types/old/models/index.js +26 -0
- package/dist/types/old/models/item-data.d.ts +14 -0
- package/dist/types/old/models/item-data.js +2 -0
- package/dist/types/old/models/list-data.d.ts +23 -0
- package/dist/types/old/models/list-data.js +8 -0
- package/dist/types/old/models/notifiable.d.ts +42 -0
- package/dist/types/old/models/notifiable.js +2 -0
- package/dist/types/old/models/notification-template-data.d.ts +224 -0
- package/dist/types/old/models/notification-template-data.js +52 -0
- package/dist/types/old/models/person-data.d.ts +31 -0
- package/dist/types/old/models/person-data.js +2 -0
- package/dist/types/old/models/program-config.d.ts +25 -0
- package/dist/types/old/models/program-config.js +2 -0
- package/dist/types/old/models/thought-data.d.ts +8 -0
- package/dist/types/old/models/thought-data.js +2 -0
- package/dist/types/old/models/user-data.d.ts +147 -0
- package/dist/types/old/models/user-data.js +42 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/type-helpers.d.ts +4 -0
- package/dist/utils/type-helpers.js +19 -0
- package/package.json +1 -1
- package/src/types/id-types.ts +2 -2
- package/src/types/index.ts +4 -3
- package/src/types/new/agenda-types.ts +69 -0
- package/src/types/new/auth-types.ts +92 -0
- package/src/types/new/habits-types.ts +112 -0
- package/src/types/new/index.ts +10 -0
- package/src/types/new/lists-types.ts +108 -0
- package/src/types/new/misc/index.ts +1 -0
- package/src/types/new/misc/version-types.ts +15 -0
- package/src/types/new/notifications-types.ts +144 -0
- package/src/types/new/people-types.ts +110 -0
- package/src/types/new/program-config-types.ts +29 -0
- package/src/types/new/thoughts-types.ts +44 -0
- package/src/types/new/user-types.ts +61 -0
- package/src/types/{api → old/api}/account/get-user-types.ts +1 -1
- package/src/types/{api → old/api}/account/update-user-types.ts +1 -1
- package/src/types/{api → old/api}/auth/create-account-types.ts +1 -1
- package/src/types/{api → old/api}/habits/create-habit-entry-types.ts +2 -2
- package/src/types/{api → old/api}/habits/create-habit-types.ts +1 -1
- package/src/types/{api → old/api}/habits/delete-habit-entry-types.ts +1 -1
- package/src/types/{api → old/api}/habits/get-habits-types.ts +1 -1
- package/src/types/{api → old/api}/habits/update-habit-types.ts +1 -1
- package/src/types/{api → old/api}/items/complete-item-types.ts +1 -1
- package/src/types/{api → old/api}/items/create-item-types.ts +1 -1
- package/src/types/{api → old/api}/items/get-items-types.ts +1 -1
- package/src/types/{api → old/api}/items/update-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/complete-list-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/create-list-item-types.ts +2 -2
- package/src/types/{api → old/api}/lists/create-list-types.ts +1 -1
- package/src/types/{api → old/api}/lists/get-list-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/get-lists-types.ts +1 -1
- package/src/types/{api → old/api}/lists/update-list-item-types.ts +2 -2
- package/src/types/{api → old/api}/lists/update-list-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/create-notification-template-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/get-notification-templates-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/sync-notification-template-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/update-notification-template-types.ts +1 -1
- package/src/types/{api → old/api}/people/create-person-note-types.ts +2 -2
- package/src/types/{api → old/api}/people/create-person-types.ts +2 -2
- package/src/types/{api → old/api}/people/get-people-types.ts +1 -1
- package/src/types/{api → old/api}/people/get-person-notes-types.ts +1 -1
- package/src/types/{api → old/api}/people/update-person-note-types.ts +1 -1
- package/src/types/{api → old/api}/people/update-person-types.ts +2 -2
- package/src/types/{api → old/api}/thoughts/create-thought-types.ts +1 -1
- package/src/types/{api → old/api}/thoughts/get-thoughts-types.ts +1 -1
- package/src/types/{api → old/api}/thoughts/update-thought-types.ts +1 -1
- package/src/types/{models → old/models}/auth-data.ts +1 -1
- package/src/types/{models → old/models}/habit-data.ts +2 -2
- package/src/types/{models → old/models}/item-data.ts +1 -1
- package/src/types/{models → old/models}/list-data.ts +1 -1
- package/src/types/{models → old/models}/notification-template-data.ts +1 -1
- package/src/types/{models → old/models}/person-data.ts +1 -1
- package/src/types/{models → old/models}/thought-data.ts +1 -1
- package/src/types/{models → old/models}/user-data.ts +2 -2
- package/src/utils/index.ts +2 -1
- package/src/utils/type-helpers.ts +19 -0
- /package/src/types/{api → old/api}/account/index.ts +0 -0
- /package/src/types/{api → old/api}/auth/index.ts +0 -0
- /package/src/types/{api → old/api}/auth/refresh-auth-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/resend-verification-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/sign-in-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/verify-email-types.ts +0 -0
- /package/src/types/{api → old/api}/habits/delete-habit-types.ts +0 -0
- /package/src/types/{api → old/api}/habits/index.ts +0 -0
- /package/src/types/{api → old/api}/index.ts +0 -0
- /package/src/types/{api → old/api}/items/delete-item-types.ts +0 -0
- /package/src/types/{api → old/api}/items/index.ts +0 -0
- /package/src/types/{api → old/api}/lists/index.ts +0 -0
- /package/src/types/{api → old/api}/misc/index.ts +0 -0
- /package/src/types/{api → old/api}/misc/version-types.ts +0 -0
- /package/src/types/{api → old/api}/notifications/delete-notification-template-types.ts +0 -0
- /package/src/types/{api → old/api}/notifications/index.ts +0 -0
- /package/src/types/{api → old/api}/notifications/preview-notification-template-types.ts +0 -0
- /package/src/types/{api → old/api}/people/delete-person-notes-types.ts +0 -0
- /package/src/types/{api → old/api}/people/delete-person-types.ts +0 -0
- /package/src/types/{api → old/api}/people/index.ts +0 -0
- /package/src/types/{api → old/api}/thoughts/delete-thought-types.ts +0 -0
- /package/src/types/{api → old/api}/thoughts/index.ts +0 -0
- /package/src/types/{auth-tokens.ts → old/auth-tokens.ts} +0 -0
- /package/src/types/{models → old/models}/index.ts +0 -0
- /package/src/types/{models → old/models}/notifiable.ts +0 -0
- /package/src/types/{models → old/models}/program-config.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DateOnlyString } from "
|
|
2
|
-
import { HabitEntryId, HabitId, UserId } from "
|
|
1
|
+
import { DateOnlyString } from "../../misc-types";
|
|
2
|
+
import { HabitEntryId, HabitId, UserId } from "../../id-types";
|
|
3
3
|
|
|
4
4
|
export enum HabitFrequency {
|
|
5
5
|
DAILY = 'daily',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { NotificationTemplateId, UserId } from "
|
|
2
|
+
import { NotificationTemplateId, UserId } from "../../id-types";
|
|
3
3
|
|
|
4
4
|
export const notificationEntityTypeSchema = z.enum([
|
|
5
5
|
// Individual entity types (notifications FOR the entity itself)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { userIdSchema } from "
|
|
3
|
-
import { ModuleType } from "
|
|
2
|
+
import { userIdSchema } from "../../id-types";
|
|
3
|
+
import { ModuleType } from "../../../enums";
|
|
4
4
|
|
|
5
5
|
const moduleSchema = z.object({
|
|
6
6
|
type: z.nativeEnum(ModuleType),
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AuthData, PublicAuthData } from '../types';
|
|
2
|
+
import { HabitData, HabitEntryData, HabitStats, Habit } from '../types';
|
|
3
|
+
|
|
4
|
+
// export type PublicAuthData = Pick<AuthData, 'email' | 'emailVerified'> & { readonly __brand: unique symbol };
|
|
5
|
+
|
|
6
|
+
export function toPublicAuthData(data: AuthData): PublicAuthData {
|
|
7
|
+
return {
|
|
8
|
+
email: data.email,
|
|
9
|
+
emailVerified: data.emailVerified
|
|
10
|
+
} as PublicAuthData;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const toHabit = (data: HabitData, entries: HabitEntryData[], stats: HabitStats): Habit => {
|
|
14
|
+
return {
|
|
15
|
+
...data,
|
|
16
|
+
entries,
|
|
17
|
+
stats
|
|
18
|
+
};
|
|
19
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|