@loomcore/common 0.0.20 → 0.0.22
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/authorization.model.d.ts +1 -0
- package/dist/models/authorization.model.js +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/user-context.model.js +4 -2
- package/dist/models/user.model.d.ts +4 -1
- package/dist/models/user.model.js +2 -3
- package/package.json +1 -1
|
@@ -8,3 +8,4 @@ export declare const authorizationSchema: import("@sinclair/typebox").TObject<{
|
|
|
8
8
|
config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const authorizationModelSpec: import("./model-spec.interface.js").IModelSpec<import("@sinclair/typebox").TSchema>;
|
|
11
|
+
export declare const publicAuthorizationSchema: import("@sinclair/typebox").TObject<{}>;
|
|
@@ -5,3 +5,4 @@ export const authorizationSchema = Type.Object({
|
|
|
5
5
|
config: Type.Optional(Type.Object({}))
|
|
6
6
|
});
|
|
7
7
|
export const authorizationModelSpec = entityUtils.getModelSpec(authorizationSchema, { isAuditable: true });
|
|
8
|
+
export const publicAuthorizationSchema = Type.Omit(authorizationModelSpec.fullSchema, ['_id', '_orgId', '_created', '_createdBy', '_updated', '_updatedBy']);
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -15,11 +15,13 @@ export function initializeSystemUserContext(systemEmail, metaOrgId) {
|
|
|
15
15
|
_systemUserContext = {
|
|
16
16
|
user: {
|
|
17
17
|
_id: 'system',
|
|
18
|
+
_orgId: metaOrgId,
|
|
18
19
|
email: systemEmail,
|
|
19
20
|
password: '',
|
|
20
21
|
authorizations: [{
|
|
21
|
-
_id: 'system',
|
|
22
|
-
|
|
22
|
+
_id: 'system-authorization',
|
|
23
|
+
_orgId: metaOrgId,
|
|
24
|
+
feature: 'system-authorization',
|
|
23
25
|
_created: new Date(),
|
|
24
26
|
_createdBy: 'system',
|
|
25
27
|
_updated: new Date(),
|
|
@@ -23,7 +23,10 @@ export declare const UserSchema: import("@sinclair/typebox").TObject<{
|
|
|
23
23
|
lastName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
24
24
|
displayName: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
25
25
|
password: import("@sinclair/typebox").TString;
|
|
26
|
-
|
|
26
|
+
authorizations: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
27
|
+
feature: import("@sinclair/typebox").TString;
|
|
28
|
+
config: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
|
|
29
|
+
}>>;
|
|
27
30
|
_lastLoggedIn: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TString, Date>>;
|
|
28
31
|
_lastPasswordChange: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TString, Date>>;
|
|
29
32
|
}>;
|
|
@@ -2,6 +2,7 @@ import { TypeboxIsoDate } from '../validation/typebox-extensions.js';
|
|
|
2
2
|
import { Type } from '@sinclair/typebox';
|
|
3
3
|
import { entityUtils } from '../utils/entity.utils.js';
|
|
4
4
|
import { TypeCompiler } from '@sinclair/typebox/compiler';
|
|
5
|
+
import { authorizationSchema } from './authorization.model.js';
|
|
5
6
|
export const UserPasswordSchema = Type.Object({
|
|
6
7
|
password: Type.String({
|
|
7
8
|
title: 'Password',
|
|
@@ -25,9 +26,7 @@ export const UserSchema = Type.Object({
|
|
|
25
26
|
title: 'Display Name'
|
|
26
27
|
})),
|
|
27
28
|
password: UserPasswordSchema.properties.password,
|
|
28
|
-
|
|
29
|
-
title: 'Roles',
|
|
30
|
-
}))),
|
|
29
|
+
authorizations: Type.Array(authorizationSchema),
|
|
31
30
|
_lastLoggedIn: Type.Optional(TypeboxIsoDate({ title: 'Last Login Date' })),
|
|
32
31
|
_lastPasswordChange: Type.Optional(TypeboxIsoDate({ title: 'Last Password Change Date' })),
|
|
33
32
|
});
|
package/package.json
CHANGED