@loomcore/common 0.0.53 → 0.0.57
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/models/address.model.d.ts +25 -0
- package/dist/models/address.model.js +17 -0
- package/dist/models/email-address.model.d.ts +1 -0
- package/dist/models/email-address.model.js +1 -0
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/person.model.d.ts +1 -0
- package/dist/models/person.model.js +3 -1
- package/dist/models/phone-number.model.d.ts +1 -0
- package/dist/models/phone-number.model.js +3 -0
- package/dist/models/user.model.d.ts +4 -2
- package/dist/models/user.model.js +1 -0
- package/package.json +1 -1
- package/dist/models/address.interface.d.ts +0 -11
- package/dist/models/address.interface.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IAuditable, IEntity } from "./index.js";
|
|
2
|
+
export interface IAddress extends IEntity, IAuditable {
|
|
3
|
+
address1?: string;
|
|
4
|
+
address2?: string;
|
|
5
|
+
address3?: string;
|
|
6
|
+
city?: string;
|
|
7
|
+
state?: string;
|
|
8
|
+
postalCode?: string;
|
|
9
|
+
countryCode?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
formattedAddress?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const addressSchema: import("@sinclair/typebox").TObject<{
|
|
14
|
+
_id: import("@sinclair/typebox").TSchema;
|
|
15
|
+
address1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
|
+
address2: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
17
|
+
address3: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
18
|
+
city: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
19
|
+
state: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
20
|
+
postalCode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
21
|
+
countryCode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
22
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
23
|
+
formattedAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const addressModelSpec: import("./model-spec.interface.js").IModelSpec<import("@sinclair/typebox").TSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { getIdSchema } from "../validation/index.js";
|
|
3
|
+
import { entityUtils } from "../utils/entity.utils.js";
|
|
4
|
+
const idSchema = getIdSchema();
|
|
5
|
+
export const addressSchema = Type.Object({
|
|
6
|
+
_id: idSchema,
|
|
7
|
+
address1: Type.Optional(Type.String()),
|
|
8
|
+
address2: Type.Optional(Type.String()),
|
|
9
|
+
address3: Type.Optional(Type.String()),
|
|
10
|
+
city: Type.Optional(Type.String()),
|
|
11
|
+
state: Type.Optional(Type.String()),
|
|
12
|
+
postalCode: Type.Optional(Type.String()),
|
|
13
|
+
countryCode: Type.Optional(Type.String()),
|
|
14
|
+
description: Type.Optional(Type.String()),
|
|
15
|
+
formattedAddress: Type.Optional(Type.String()),
|
|
16
|
+
});
|
|
17
|
+
export const addressModelSpec = entityUtils.getModelSpec(addressSchema, { isAuditable: true });
|
|
@@ -7,6 +7,7 @@ export interface IEmailAddressModel extends IEntity, IAuditable {
|
|
|
7
7
|
isDefault: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const emailAddressSchema: import("@sinclair/typebox").TObject<{
|
|
10
|
+
_id: import("@sinclair/typebox").TSchema;
|
|
10
11
|
personId: import("@sinclair/typebox").TSchema;
|
|
11
12
|
emailAddress: import("@sinclair/typebox").TString;
|
|
12
13
|
emailAddressType: import("@sinclair/typebox").TString;
|
|
@@ -3,6 +3,7 @@ import { Type } from "@sinclair/typebox";
|
|
|
3
3
|
import { getIdSchema } from "../validation/index.js";
|
|
4
4
|
const idSchema = getIdSchema();
|
|
5
5
|
export const emailAddressSchema = Type.Object({
|
|
6
|
+
_id: idSchema,
|
|
6
7
|
personId: idSchema,
|
|
7
8
|
emailAddress: Type.String(),
|
|
8
9
|
emailAddressType: Type.String(),
|
package/dist/models/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export * from './query-options.model.js';
|
|
|
10
10
|
export * from './person.model.js';
|
|
11
11
|
export * from './phone-number.model.js';
|
|
12
12
|
export * from './email-address.model.js';
|
|
13
|
-
export * from './address.
|
|
13
|
+
export * from './address.model.js';
|
|
14
14
|
export * from './api-response.interface.js';
|
|
15
15
|
export * from './auth.state.interface.js';
|
|
16
16
|
export * from './error.interface.js';
|
package/dist/models/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export * from './query-options.model.js';
|
|
|
10
10
|
export * from './person.model.js';
|
|
11
11
|
export * from './phone-number.model.js';
|
|
12
12
|
export * from './email-address.model.js';
|
|
13
|
-
export * from './address.
|
|
13
|
+
export * from './address.model.js';
|
|
14
14
|
export * from './api-response.interface.js';
|
|
15
15
|
export * from './auth.state.interface.js';
|
|
16
16
|
export * from './error.interface.js';
|
|
@@ -11,6 +11,7 @@ export interface IPersonModel extends IEntity, IAuditable {
|
|
|
11
11
|
extendedTypes?: number;
|
|
12
12
|
}
|
|
13
13
|
export declare const personSchema: import("@sinclair/typebox").TObject<{
|
|
14
|
+
_id: import("@sinclair/typebox").TSchema;
|
|
14
15
|
externalId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
16
|
firstName: import("@sinclair/typebox").TString;
|
|
16
17
|
middleName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { entityUtils } from "@loomcore/common/utils";
|
|
2
2
|
import { Type } from "@sinclair/typebox";
|
|
3
|
-
import { TypeboxIsoDate } from "../validation/typebox-extensions.js";
|
|
3
|
+
import { getIdSchema, TypeboxIsoDate } from "../validation/typebox-extensions.js";
|
|
4
|
+
const idSchema = getIdSchema();
|
|
4
5
|
export const personSchema = Type.Object({
|
|
6
|
+
_id: idSchema,
|
|
5
7
|
externalId: Type.Optional(Type.String()),
|
|
6
8
|
firstName: Type.String(),
|
|
7
9
|
middleName: Type.Optional(Type.String()),
|
|
@@ -5,6 +5,7 @@ export interface IPhoneNumberModel extends IEntity, IAuditable {
|
|
|
5
5
|
isDefault: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const phoneNumberSchema: import("@sinclair/typebox").TObject<{
|
|
8
|
+
_id: import("@sinclair/typebox").TSchema;
|
|
8
9
|
phoneNumber: import("@sinclair/typebox").TString;
|
|
9
10
|
phoneNumberType: import("@sinclair/typebox").TString;
|
|
10
11
|
isDefault: import("@sinclair/typebox").TBoolean;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { entityUtils } from "@loomcore/common/utils";
|
|
2
2
|
import { Type } from "@sinclair/typebox";
|
|
3
|
+
import { getIdSchema } from "../validation/index.js";
|
|
4
|
+
const idSchema = getIdSchema();
|
|
3
5
|
export const phoneNumberSchema = Type.Object({
|
|
6
|
+
_id: idSchema,
|
|
4
7
|
phoneNumber: Type.String(),
|
|
5
8
|
phoneNumberType: Type.String(),
|
|
6
9
|
isDefault: Type.Boolean(),
|
|
@@ -17,6 +17,7 @@ export declare const passwordValidator: import("@sinclair/typebox/compiler").Typ
|
|
|
17
17
|
password: import("@sinclair/typebox").TString;
|
|
18
18
|
}>>;
|
|
19
19
|
export declare const UserSchema: import("@sinclair/typebox").TObject<{
|
|
20
|
+
_id: import("@sinclair/typebox").TSchema;
|
|
20
21
|
externalId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
21
22
|
email: import("@sinclair/typebox").TString;
|
|
22
23
|
displayName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -27,10 +28,11 @@ export declare const UserSchema: import("@sinclair/typebox").TObject<{
|
|
|
27
28
|
}>;
|
|
28
29
|
export declare const UserSpec: import("./model-spec.interface.js").IModelSpec<import("@sinclair/typebox").TSchema>;
|
|
29
30
|
export declare const PublicUserSchema: import("@sinclair/typebox").TObject<{
|
|
30
|
-
|
|
31
|
+
_id: import("@sinclair/typebox").TSchema;
|
|
31
32
|
externalId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
|
-
|
|
33
|
+
email: import("@sinclair/typebox").TString;
|
|
33
34
|
personId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TSchema>;
|
|
35
|
+
displayName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
34
36
|
_lastLoggedIn: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TString, Date>>;
|
|
35
37
|
_lastPasswordChange: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TString, Date>>;
|
|
36
38
|
}>;
|
|
@@ -12,6 +12,7 @@ export const UserPasswordSchema = Type.Object({
|
|
|
12
12
|
export const passwordValidator = TypeCompiler.Compile(UserPasswordSchema);
|
|
13
13
|
const idSchema = getIdSchema();
|
|
14
14
|
export const UserSchema = Type.Object({
|
|
15
|
+
_id: idSchema,
|
|
15
16
|
externalId: Type.Optional(Type.String()),
|
|
16
17
|
email: Type.String({
|
|
17
18
|
title: 'Email',
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|