@loomcore/common 0.0.62 → 0.0.63
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/login-response.model.js +1 -1
- package/dist/models/organization.model.d.ts +1 -0
- package/dist/models/organization.model.js +3 -0
- package/dist/models/query-options.model.js +1 -1
- package/dist/models/token-response.model.js +1 -1
- package/dist/models/user-context-authorization.model.js +1 -1
- package/dist/models/user-context.model.js +2 -2
- package/package.json +1 -1
|
@@ -6,4 +6,4 @@ export const LoginResponseSchema = Type.Object({
|
|
|
6
6
|
tokens: TokenResponseSchema,
|
|
7
7
|
userContext: PublicUserContextSchema
|
|
8
8
|
});
|
|
9
|
-
export const LoginResponseSpec = entityUtils.getModelSpec(LoginResponseSchema);
|
|
9
|
+
export const LoginResponseSpec = entityUtils.getModelSpec(LoginResponseSchema, { isEntity: false });
|
|
@@ -10,6 +10,7 @@ export interface IOrganization extends IAuditable {
|
|
|
10
10
|
authToken?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const OrganizationSchema: import("@sinclair/typebox").TObject<{
|
|
13
|
+
_id: import("@sinclair/typebox").TSchema;
|
|
13
14
|
name: import("@sinclair/typebox").TString;
|
|
14
15
|
code: import("@sinclair/typebox").TString;
|
|
15
16
|
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
2
|
import { entityUtils } from '../utils/index.js';
|
|
3
|
+
import { getIdSchema } from '../validation/index.js';
|
|
4
|
+
const idSchema = getIdSchema();
|
|
3
5
|
export const OrganizationSchema = Type.Object({
|
|
6
|
+
_id: idSchema,
|
|
4
7
|
name: Type.String({
|
|
5
8
|
title: 'Name'
|
|
6
9
|
}),
|
|
@@ -29,7 +29,7 @@ export const QueryOptionsSchema = Type.Object({
|
|
|
29
29
|
pageSize: Type.Optional(Type.Number({ title: 'Page Size', minimum: 1, maximum: 1000 })),
|
|
30
30
|
filters: Type.Optional(Type.Record(Type.String(), FilterSchema, { title: 'Filters' })),
|
|
31
31
|
});
|
|
32
|
-
export const QueryOptionsSpec = entityUtils.getModelSpec(QueryOptionsSchema);
|
|
32
|
+
export const QueryOptionsSpec = entityUtils.getModelSpec(QueryOptionsSchema, { isEntity: false });
|
|
33
33
|
export const DefaultQueryOptions = {
|
|
34
34
|
sortDirection: 'asc',
|
|
35
35
|
page: 1,
|
|
@@ -5,4 +5,4 @@ export const TokenResponseSchema = Type.Object({
|
|
|
5
5
|
refreshToken: Type.String(),
|
|
6
6
|
expiresOn: Type.Number()
|
|
7
7
|
});
|
|
8
|
-
export const TokenResponseSpec = entityUtils.getModelSpec(TokenResponseSchema);
|
|
8
|
+
export const TokenResponseSpec = entityUtils.getModelSpec(TokenResponseSchema, { isEntity: false });
|
|
@@ -5,4 +5,4 @@ export const UserContextAuthorizationSchema = Type.Object({
|
|
|
5
5
|
feature: Type.String(),
|
|
6
6
|
config: Type.Optional(Type.Any())
|
|
7
7
|
});
|
|
8
|
-
export const UserContextAuthorizationSpec = entityUtils.getModelSpec(UserContextAuthorizationSchema);
|
|
8
|
+
export const UserContextAuthorizationSpec = entityUtils.getModelSpec(UserContextAuthorizationSchema, { isEntity: false });
|
|
@@ -17,14 +17,14 @@ export const UserContextSchema = Type.Object({
|
|
|
17
17
|
authorizations: Type.Array(UserContextAuthorizationSpec.fullSchema),
|
|
18
18
|
organization: OrganizationSpec.fullSchema
|
|
19
19
|
});
|
|
20
|
-
export const UserContextSpec = entityUtils.getModelSpec(UserContextSchema);
|
|
20
|
+
export const UserContextSpec = entityUtils.getModelSpec(UserContextSchema, { isEntity: false });
|
|
21
21
|
export const PublicUserContextSchema = Type.Object({
|
|
22
22
|
user: PublicUserSpec.fullSchema,
|
|
23
23
|
person: Type.Optional(personModelSpec.fullSchema),
|
|
24
24
|
authorizations: Type.Array(UserContextAuthorizationSpec.fullSchema),
|
|
25
25
|
organization: OrganizationSpec.fullSchema
|
|
26
26
|
});
|
|
27
|
-
export const PublicUserContextSpec = entityUtils.getModelSpec(PublicUserContextSchema);
|
|
27
|
+
export const PublicUserContextSpec = entityUtils.getModelSpec(PublicUserContextSchema, { isEntity: false });
|
|
28
28
|
import { getSystemUserId } from '../validation/index.js';
|
|
29
29
|
export function initializeSystemUserContext(systemEmail, metaOrg) {
|
|
30
30
|
const systemId = getSystemUserId();
|
package/package.json
CHANGED