@nu-art/user-account-shared 0.401.9 → 0.500.0

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,8 +1,9 @@
1
- import { ApiDefResolver, BodyApi, QueryApi } from '@nu-art/thunderstorm-shared';
2
- import { DB_BaseObject, UniqueId } from '@nu-art/ts-common';
3
- import { AccountType, DB_Account, UI_Account } from './types.js';
4
- import { DB_Session, QueryParam_RedirectUrl } from '../session/index.js';
1
+ import { ApiDefResolver, BodyApi, QueryApi } from '@nu-art/api-types';
2
+ import { AccountType, DatabaseDef_Account, DB_Account, UI_Account } from './types.js';
5
3
  import { PasswordAssertionConfig } from '../../_enum/password-assertion/index.js';
4
+ import { DB_BaseObject } from '@nu-art/db-api-shared';
5
+ import { DB_Session } from '../session/types.js';
6
+ import { QueryParam_RedirectUrl } from '../session/consts.js';
6
7
  export type Response_Auth = UI_Account & DB_BaseObject;
7
8
  export type AccountEmail = {
8
9
  email: string;
@@ -22,103 +23,46 @@ export type DBAccountType = {
22
23
  export type AccountToAssertPassword = AccountEmail & Partial<PasswordWithCheck>;
23
24
  export type AccountToSpice = AccountEmail & AccountPassword;
24
25
  export type Request_RegisterAccount = DBAccountType & AccountEmailWithDevice & PasswordWithCheck;
25
- export type Account_RegisterAccount = {
26
- request: AccountEmailWithDevice & PasswordWithCheck;
27
- response: Response_Auth;
28
- };
29
- export type Account_CreateAccount = {
30
- request: DBAccountType & AccountEmail & Partial<PasswordWithCheck>;
31
- response: UI_Account & DB_BaseObject;
32
- };
33
- export type Account_ChangePassword = {
34
- request: PasswordWithCheck & {
26
+ export type API_UserAccount = {
27
+ registerAccount: BodyApi<Response_Auth, AccountEmailWithDevice & PasswordWithCheck>;
28
+ refreshSession: QueryApi<void>;
29
+ createAccount: BodyApi<UI_Account & DB_BaseObject, DBAccountType & AccountEmail & Partial<PasswordWithCheck>>;
30
+ changePassword: BodyApi<Response_Auth, PasswordWithCheck & {
35
31
  oldPassword: string;
36
- };
37
- response: Response_Auth;
38
- };
39
- export type Account_Login = {
40
- request: AccountEmailWithDevice & AccountPassword;
41
- response: Response_Auth;
42
- };
43
- export type Account_CreateToken = {
44
- request: {
45
- accountId: UniqueId;
32
+ }>;
33
+ login: BodyApi<Response_Auth, AccountEmailWithDevice & AccountPassword>;
34
+ logout: QueryApi<void>;
35
+ createToken: BodyApi<{
36
+ token: string;
37
+ }, {
38
+ accountId: DatabaseDef_Account['id'];
46
39
  ttl: number;
47
40
  label: string;
48
- };
49
- response: {
50
- token: string;
51
- };
52
- };
53
- export type Account_SetPassword = {
54
- request: PasswordWithCheck;
55
- response: Response_Auth;
56
- };
57
- export type Account_GetSessions = {
58
- request: DB_BaseObject;
59
- response: {
41
+ }>;
42
+ setPassword: BodyApi<Response_Auth, PasswordWithCheck>;
43
+ getSessions: QueryApi<{
60
44
  sessions: DB_Session[];
61
- };
62
- };
63
- export type Account_ChangeThumbnail = {
64
- request: {
65
- accountId: string;
66
- hash: string;
67
- };
68
- response: {
45
+ }, DB_BaseObject<DatabaseDef_Account['dbKey']>>;
46
+ changeThumbnail: BodyApi<{
69
47
  account: DB_Account;
70
- };
71
- };
72
- export type Account_Delete = {
73
- request: {
74
- accountId: UniqueId;
75
- };
76
- response: {
77
- account: DB_Account;
78
- };
79
- };
80
- export type Account_GetPasswordAssertionConfig = {
81
- request: void;
82
- response: {
48
+ }, {
49
+ accountId: DatabaseDef_Account['id'];
50
+ hash: string;
51
+ }>;
52
+ getPasswordAssertionConfig: QueryApi<{
83
53
  config: PasswordAssertionConfig | undefined;
84
- };
85
- };
86
- export type ApiStruct_Account = {
87
- _v1: {
88
- registerAccount: BodyApi<Account_RegisterAccount['response'], Account_RegisterAccount['request']>;
89
- refreshSession: QueryApi<void>;
90
- createAccount: BodyApi<Account_CreateAccount['response'], Account_CreateAccount['request']>;
91
- changePassword: BodyApi<Account_ChangePassword['response'], Account_ChangePassword['request']>;
92
- login: BodyApi<Account_Login['response'], Account_Login['request']>;
93
- logout: QueryApi<void>;
94
- createToken: BodyApi<Account_CreateToken['response'], Account_CreateToken['request']>;
95
- setPassword: BodyApi<Account_SetPassword['response'], Account_SetPassword['request']>;
96
- getSessions: QueryApi<Account_GetSessions['response'], Account_GetSessions['request']>;
97
- changeThumbnail: BodyApi<Account_ChangeThumbnail['response'], Account_ChangeThumbnail['request']>;
98
- getPasswordAssertionConfig: QueryApi<Account_GetPasswordAssertionConfig['response']>;
99
- deleteAccount: QueryApi<Account_Delete['response'], Account_Delete['request']>;
100
- };
54
+ }>;
101
55
  };
102
- export declare const ApiDef_Account: ApiDefResolver<ApiStruct_Account>;
103
- export type SAML_Login = {
104
- request: {
56
+ export declare const ApiDef_UserAccount: ApiDefResolver<API_UserAccount>;
57
+ export type API_SAML = {
58
+ loginSaml: QueryApi<{
59
+ loginUrl: string;
60
+ }, {
105
61
  [QueryParam_RedirectUrl]: string;
106
62
  deviceId: string;
107
- };
108
- response: {
109
- loginUrl: string;
110
- };
111
- };
112
- export type SAML_Assert = {
113
- request: {
63
+ }>;
64
+ assertSAML: BodyApi<void, {
114
65
  RelayState: string;
115
- };
116
- response: void;
117
- };
118
- export type ApiStruct_SAML = {
119
- _v1: {
120
- loginSaml: QueryApi<SAML_Login['response'], SAML_Login['request']>;
121
- assertSAML: BodyApi<SAML_Assert['response'], SAML_Assert['request']>;
122
- };
66
+ }>;
123
67
  };
124
- export declare const ApiDef_SAML: ApiDefResolver<ApiStruct_SAML>;
68
+ export declare const ApiDef_SAML: ApiDefResolver<API_SAML>;
@@ -1,25 +1,20 @@
1
- import { HttpMethod } from '@nu-art/thunderstorm-shared';
1
+ import { HttpMethod } from '@nu-art/api-types';
2
2
  import { Minute } from '@nu-art/ts-common';
3
- import { QueryParam_RedirectUrl } from '../session/index.js';
4
- export const ApiDef_Account = {
5
- _v1: {
6
- registerAccount: { method: HttpMethod.POST, path: '/v1/account/register-account' },
7
- refreshSession: { method: HttpMethod.GET, path: '/v1/account/refresh-session' },
8
- createAccount: { method: HttpMethod.POST, path: '/v1/account/create-account' },
9
- changePassword: { method: HttpMethod.POST, path: '/v1/account/change-password' },
10
- login: { method: HttpMethod.POST, path: 'v1/account/login', timeout: Minute },
11
- logout: { method: HttpMethod.GET, path: 'v1/account/logout' },
12
- createToken: { method: HttpMethod.POST, path: 'v1/account/create-token', timeout: Minute },
13
- setPassword: { method: HttpMethod.POST, path: '/v1/account/set-password' },
14
- getSessions: { method: HttpMethod.GET, path: 'v1/account/get-sessions' },
15
- changeThumbnail: { method: HttpMethod.POST, path: '/v1/account/change-thumbnail' },
16
- getPasswordAssertionConfig: { method: HttpMethod.GET, path: '/v1/account/get-password-assertion-config' },
17
- deleteAccount: { method: HttpMethod.GET, path: '/v1/account/delete-account' },
18
- }
3
+ import { QueryParam_RedirectUrl } from '../session/consts.js';
4
+ export const ApiDef_UserAccount = {
5
+ registerAccount: { method: HttpMethod.POST, path: '/v1/account/register-account' },
6
+ refreshSession: { method: HttpMethod.GET, path: '/v1/account/refresh-session' },
7
+ createAccount: { method: HttpMethod.POST, path: '/v1/account/create-account' },
8
+ changePassword: { method: HttpMethod.POST, path: '/v1/account/change-password' },
9
+ login: { method: HttpMethod.POST, path: '/v1/account/login', timeout: Minute },
10
+ logout: { method: HttpMethod.GET, path: '/v1/account/logout' },
11
+ createToken: { method: HttpMethod.POST, path: '/v1/account/create-token', timeout: Minute },
12
+ setPassword: { method: HttpMethod.POST, path: '/v1/account/set-password' },
13
+ getSessions: { method: HttpMethod.GET, path: '/v1/account/get-sessions' },
14
+ changeThumbnail: { method: HttpMethod.POST, path: '/v1/account/change-thumbnail' },
15
+ getPasswordAssertionConfig: { method: HttpMethod.GET, path: '/v1/account/get-password-assertion-config' }
19
16
  };
20
17
  export const ApiDef_SAML = {
21
- _v1: {
22
- loginSaml: { method: HttpMethod.GET, path: 'v1/account/login-saml' },
23
- assertSAML: { method: HttpMethod.POST, path: 'v1/account/assert' }
24
- }
18
+ loginSaml: { method: HttpMethod.GET, path: '/v1/account/login-saml' },
19
+ assertSAML: { method: HttpMethod.POST, path: '/v1/account/assert' }
25
20
  };
@@ -1,3 +1,3 @@
1
- import { DBDef_V3 } from '@nu-art/ts-common';
2
- import { DBProto_Account } from './types.js';
3
- export declare const DBDef_Accounts: DBDef_V3<DBProto_Account>;
1
+ import { Database } from '@nu-art/db-api-shared';
2
+ import { DatabaseDef_Account } from './types.js';
3
+ export declare const DBDef_Accounts: Database<DatabaseDef_Account>;
@@ -17,9 +17,11 @@ const generatedPropsValidator = {
17
17
  export const DBDef_Accounts = {
18
18
  dbKey: 'user-account--accounts',
19
19
  entityName: 'Account',
20
- modifiablePropsValidator: modifiablePropsValidator,
21
- generatedPropsValidator: generatedPropsValidator,
20
+ modifiablePropsValidator,
21
+ generatedPropsValidator,
22
+ generatedProps: ['_auditorId', '_newPasswordRequired', 'salt', 'saltedPassword'],
22
23
  versions: ['1.0.0'],
24
+ uniqueKeys: ['_id'],
23
25
  frontend: {
24
26
  group: accountGroupName,
25
27
  name: 'account'
@@ -1,9 +1,13 @@
1
- import { AuditableV2, DB_BaseObject, DB_Object, DBProto, Proto_DB_Object, TypedKeyValue, VersionsDeclaration } from '@nu-art/ts-common';
1
+ import { DB_BaseObject, DB_Object, DB_ProtoSeed, DB_Prototype, VersionsDeclaration } from '@nu-art/db-api-shared';
2
+ import { TypedKeyValue } from '@nu-art/ts-common';
3
+ import { AuditableV2 } from '../../utils.js';
2
4
  export declare const AccountType_User: AccountType;
3
5
  export declare const AccountType_Service: AccountType;
4
6
  export declare const _accountTypes: string[];
5
7
  export declare const accountTypes: readonly string[];
8
+ export declare const Account_DbKey = "user-account--accounts";
6
9
  export type AccountType = typeof accountTypes[number];
10
+ type DBKey = typeof Account_DbKey;
7
11
  type VersionTypes_Account = {
8
12
  '1.0.0': DB_Account;
9
13
  };
@@ -11,14 +15,9 @@ type Versions = VersionsDeclaration<['1.0.0'], VersionTypes_Account>;
11
15
  type Dependencies = {};
12
16
  type UniqueKeys = '_id';
13
17
  type GeneratedKeys = keyof AuditableV2 | '_newPasswordRequired' | 'salt' | 'saltedPassword';
14
- export declare const Account_DbKey = "user-account--accounts";
15
- type Proto = Proto_DB_Object<DB_Account, typeof Account_DbKey, GeneratedKeys, Versions, UniqueKeys, Dependencies>;
16
- export type DBProto_Account = DBProto<Proto>;
17
- export type UI_Account = DBProto_Account['uiType'];
18
- export type SafeDB_Account = UI_Account & DB_BaseObject;
19
- export type UI_SessionAccount = UI_Account & DB_BaseObject & SessionData_HasPassword;
20
- export type _SessionKey_Account = TypedKeyValue<'account', UI_SessionAccount>;
21
- export type DB_Account = DB_Object & AuditableV2 & {
18
+ export type DatabaseDef_Account = DB_Prototype<DB_ProtoSeed<DB_Account, DBKey, GeneratedKeys, Versions, UniqueKeys, Dependencies>>;
19
+ export type UI_Account = DatabaseDef_Account['uiType'];
20
+ export type DB_Account = DB_Object<DBKey> & AuditableV2 & {
22
21
  type: AccountType;
23
22
  email: string;
24
23
  displayName?: string;
@@ -28,6 +27,9 @@ export type DB_Account = DB_Object & AuditableV2 & {
28
27
  description?: string;
29
28
  _newPasswordRequired?: boolean;
30
29
  };
30
+ export type SafeDB_Account = UI_Account & DB_BaseObject<DBKey>;
31
+ export type UI_SessionAccount = UI_Account & DB_BaseObject<DBKey> & SessionData_HasPassword;
32
+ export type _SessionKey_Account = TypedKeyValue<'account', UI_SessionAccount>;
31
33
  export type SessionData_HasPassword = {
32
34
  hasPassword: boolean;
33
35
  };
@@ -1,3 +1,3 @@
1
- import { DBDef_V3 } from '@nu-art/ts-common';
2
- import { DBProto_FailedLoginAttempt } from './types.js';
3
- export declare const DBDef_FailedLoginAttempt: DBDef_V3<DBProto_FailedLoginAttempt>;
1
+ import { Database } from '@nu-art/db-api-shared';
2
+ import { DatabaseDef_FailedLoginAttempt } from './types.js';
3
+ export declare const DBDef_FailedLoginAttempt: Database<DatabaseDef_FailedLoginAttempt>;
@@ -1,5 +1,5 @@
1
1
  import { tsValidateNumber, tsValidateUniqueId } from '@nu-art/ts-common';
2
- import { accountGroupName } from '../session/index.js';
2
+ import { accountGroupName } from '../session/consts.js';
3
3
  const Validator_ModifiableProps = {
4
4
  count: tsValidateNumber(),
5
5
  accountId: tsValidateUniqueId,
@@ -12,6 +12,7 @@ export const DBDef_FailedLoginAttempt = {
12
12
  versions: ['1.0.0'],
13
13
  dbKey: 'failed-login-attempt',
14
14
  entityName: 'failed-login-attempt',
15
+ uniqueKeys: ['_id'],
15
16
  frontend: {
16
17
  group: accountGroupName,
17
18
  name: 'failed-login-attempt'
@@ -1,4 +1,5 @@
1
- import { DB_Object, DBProto, Proto_DB_Object, UniqueId, VersionsDeclaration } from '@nu-art/ts-common';
1
+ import { DB_Object, DB_ProtoSeed, DB_Prototype, VersionsDeclaration } from '@nu-art/db-api-shared';
2
+ import { DB_Account } from '../account/index.js';
2
3
  type VersionTypes_FailedLoginAttempt = {
3
4
  '1.0.0': DB_FailedLoginAttempt;
4
5
  };
@@ -7,11 +8,10 @@ type Dependencies = {};
7
8
  type UniqueKeys = '_id';
8
9
  type GeneratedProps = never;
9
10
  type DBKey = 'failed-login-attempt';
10
- type Proto = Proto_DB_Object<DB_FailedLoginAttempt, DBKey, GeneratedProps, Versions, UniqueKeys, Dependencies>;
11
- export type DBProto_FailedLoginAttempt = DBProto<Proto>;
12
- export type UI_FailedLoginAttempt = DBProto_FailedLoginAttempt['uiType'];
13
- export type DB_FailedLoginAttempt = DB_Object & {
14
- accountId: UniqueId;
11
+ export type DatabaseDef_FailedLoginAttempt = DB_Prototype<DB_ProtoSeed<DB_FailedLoginAttempt, DBKey, GeneratedProps, Versions, UniqueKeys, Dependencies>>;
12
+ export type UI_FailedLoginAttempt = DatabaseDef_FailedLoginAttempt['uiType'];
13
+ export type DB_FailedLoginAttempt = DB_Object<DBKey> & {
14
+ accountId: DB_Account['_id'];
15
15
  count: number;
16
16
  loginSuccessfulAt?: number;
17
17
  };
@@ -1,3 +1,3 @@
1
- import { DBDef_V3 } from '@nu-art/ts-common';
2
- import { DBProto_LoginAttempt } from './types.js';
3
- export declare const DBDef_LoginAttempt: DBDef_V3<DBProto_LoginAttempt>;
1
+ import { Database } from '@nu-art/db-api-shared';
2
+ import { DatabaseDef_LoginAttempt } from './types.js';
3
+ export declare const DBDef_LoginAttempt: Database<DatabaseDef_LoginAttempt>;
@@ -15,6 +15,7 @@ export const DBDef_LoginAttempt = {
15
15
  versions: ['1.0.0'],
16
16
  dbKey: 'login-attempt',
17
17
  entityName: 'login-attempt',
18
+ uniqueKeys: ['_id'],
18
19
  frontend: {
19
20
  group: 'ts-default',
20
21
  name: 'login-attempt'
@@ -1,4 +1,8 @@
1
- import { DB_Object, DBProto, Proto_DB_Object, UniqueId, VersionsDeclaration } from '@nu-art/ts-common';
1
+ import { DB_Object, DB_ProtoSeed, DB_Prototype, VersionsDeclaration } from '@nu-art/db-api-shared';
2
+ import { DB_Account } from '../account/index.js';
3
+ export declare const LoginStatus_Success = "success";
4
+ export declare const LoginStatus_Failed = "failed";
5
+ export type LoginStatus = typeof LoginStatus_Failed | typeof LoginStatus_Success;
2
6
  type VersionTypes_LoginAttempt = {
3
7
  '1.0.0': DB_LoginAttempt;
4
8
  };
@@ -7,18 +11,14 @@ type Dependencies = {};
7
11
  type UniqueKeys = '_id';
8
12
  type GeneratedProps = never;
9
13
  type DBKey = 'login-attempt';
10
- type Proto = Proto_DB_Object<DB_LoginAttempt, DBKey, GeneratedProps, Versions, UniqueKeys, Dependencies>;
11
- export type DBProto_LoginAttempt = DBProto<Proto>;
12
- export type UI_LoginAttempt = DBProto_LoginAttempt['uiType'];
13
- export declare const LoginStatus_Success = "success";
14
- export declare const LoginStatus_Failed = "failed";
15
- export type LoginStatus = typeof LoginStatus_Failed | typeof LoginStatus_Success;
14
+ export type DatabaseDef_LoginAttempt = DB_Prototype<DB_ProtoSeed<DB_LoginAttempt, DBKey, GeneratedProps, Versions, UniqueKeys, Dependencies>>;
15
+ export type UI_LoginAttempt = DatabaseDef_LoginAttempt['uiType'];
16
16
  export type LoginMetadata = {
17
17
  ipAddress?: string;
18
18
  deviceId?: string;
19
19
  };
20
- export type DB_LoginAttempt = DB_Object & {
21
- accountId: UniqueId;
20
+ export type DB_LoginAttempt = DB_Object<DBKey> & {
21
+ accountId: DB_Account['_id'];
22
22
  status: LoginStatus;
23
23
  metadata: LoginMetadata;
24
24
  };
@@ -1,4 +1,4 @@
1
- import { HeaderKey_Authorization } from '@nu-art/thunderstorm-shared';
1
+ import { HeaderKey_Authorization } from '@nu-art/api-types';
2
2
  export const accountGroupName = 'account';
3
3
  export const QueryParam_Email = 'userEmail';
4
4
  export const QueryParam_SessionId = HeaderKey_Authorization;
@@ -1,5 +1,5 @@
1
- import { DBDef_V3 } from '@nu-art/ts-common';
2
- import { DBProto_Session } from './types.js';
3
- export declare const Validator_Modifiable: DBProto_Session['modifiablePropsValidator'];
4
- export declare const Validator_Generated: DBProto_Session['generatedPropsValidator'];
5
- export declare const DBDef_Session: DBDef_V3<DBProto_Session>;
1
+ import { Database } from '@nu-art/db-api-shared';
2
+ import { DatabaseDef_Session } from './types.js';
3
+ export declare const Validator_Modifiable: DatabaseDef_Session['modifiablePropsValidator'];
4
+ export declare const Validator_Generated: DatabaseDef_Session['generatedPropsValidator'];
5
+ export declare const DBDef_Session: Database<DatabaseDef_Session>;
@@ -5,7 +5,7 @@ export const Validator_Modifiable = {
5
5
  accountId: tsValidateUniqueId,
6
6
  deviceId: tsValidateUniqueId,
7
7
  linkedSessionId: tsValidateOptionalId,
8
- validSessionJwtMd5s: tsValidateArray(tsValidateUniqueId), //array of MD5s of previous sessions.
8
+ validSessionJwtMd5s: tsValidateArray(tsValidateUniqueId),
9
9
  sessionIdJwt: tsValidateString(),
10
10
  };
11
11
  export const Validator_Generated = {};
@@ -15,11 +15,12 @@ export const DBDef_Session = {
15
15
  dbKey: 'user-account--sessions',
16
16
  entityName: 'Session',
17
17
  versions: ['1.0.0'],
18
+ uniqueKeys: ['_id', 'accountId', 'deviceId'],
18
19
  frontend: {
19
20
  group: accountGroupName,
20
21
  name: 'session',
21
22
  },
22
23
  backend: {
23
- name: 'user-account--sessions'
24
+ name: 'user-account--sessions',
24
25
  }
25
26
  };
@@ -1,21 +1,21 @@
1
- import { DB_Object, DBProto, Proto_DB_Object, TypedKeyValue, UniqueId, VersionsDeclaration } from '@nu-art/ts-common';
1
+ import { DB_Object, DB_ProtoSeed, DB_Prototype, DB_UniqueId, VersionsDeclaration } from '@nu-art/db-api-shared';
2
+ import { DatabaseDef_Account } from '../account/index.js';
2
3
  type VersionTypes = {
3
4
  '1.0.0': DB_Session;
4
5
  };
5
6
  type Versions = VersionsDeclaration<['1.0.0'], VersionTypes>;
6
- type UniqueIds = 'accountId' | 'deviceId';
7
+ type UniqueIds = '_id' | 'accountId' | 'deviceId';
7
8
  type DBKey = 'user-account--sessions';
8
- type GeneratedKeys = keyof DB_Object;
9
- type Proto = Proto_DB_Object<DB_Session, DBKey, GeneratedKeys, Versions, UniqueIds>;
10
- export type DBProto_Session = DBProto<Proto>;
11
- export type UI_Session = DBProto_Session['uiType'];
12
- export type DB_Session = DB_Object & {
13
- validSessionJwtMd5s: UniqueId[];
9
+ type GeneratedKeys = never;
10
+ type Dependencies = {};
11
+ export type DatabaseDef_Session = DB_Prototype<DB_ProtoSeed<DB_Session, DBKey, GeneratedKeys, Versions, UniqueIds, Dependencies>>;
12
+ export type UI_Session = DatabaseDef_Session['uiType'];
13
+ export type DB_Session = DB_Object<DBKey> & {
14
+ validSessionJwtMd5s: DB_UniqueId<DBKey>[];
14
15
  label?: string;
15
- accountId: UniqueId;
16
- deviceId: UniqueId;
17
- linkedSessionId?: UniqueId;
16
+ accountId: DatabaseDef_Account['id'];
17
+ deviceId: string;
18
+ linkedSessionId?: DB_UniqueId<DBKey>;
18
19
  sessionIdJwt: string;
19
20
  };
20
- export type _SessionKey_SessionId = TypedKeyValue<'_id', UniqueId>;
21
21
  export {};
package/headers.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const HeaderKey_DeviceId = "device-id";
2
+ export declare const HeaderKey_TabId = "tab-id";
package/headers.js ADDED
@@ -0,0 +1,7 @@
1
+ /*
2
+ * @nu-art/user-account-shared - HTTP header names for auth and session
3
+ * Copyright (C) 2026 Adam van der Kruk aka TacB0sS
4
+ * Licensed under the Apache License, Version 2.0
5
+ */
6
+ export const HeaderKey_DeviceId = 'device-id';
7
+ export const HeaderKey_TabId = 'tab-id';
package/index.d.ts CHANGED
@@ -1,2 +1,15 @@
1
- export * from './_enum.js';
2
- export * from './_entity.js';
1
+ export * from './_entity/account/db-def.js';
2
+ export * from './_entity/account/types.js';
3
+ export * from './_entity/account/api-def.js';
4
+ export * from './_entity/session/types.js';
5
+ export * from './_entity/session/consts.js';
6
+ export * from './_entity/session/db-def.js';
7
+ export * from './_entity/failed-login-attempt/db-def.js';
8
+ export * from './_entity/failed-login-attempt/types.js';
9
+ export * from './_entity/failed-login-attempt/consts.js';
10
+ export * from './_entity/login-attempts/db-def.js';
11
+ export * from './_entity/login-attempts/types.js';
12
+ export * from './_enum/password-assertion/types.js';
13
+ export * from './_enum/password-assertion/validator.js';
14
+ export * from './headers.js';
15
+ export * from './utils.js';
package/index.js CHANGED
@@ -1,2 +1,15 @@
1
- export * from './_enum.js';
2
- export * from './_entity.js';
1
+ export * from './_entity/account/db-def.js';
2
+ export * from './_entity/account/types.js';
3
+ export * from './_entity/account/api-def.js';
4
+ export * from './_entity/session/types.js';
5
+ export * from './_entity/session/consts.js';
6
+ export * from './_entity/session/db-def.js';
7
+ export * from './_entity/failed-login-attempt/db-def.js';
8
+ export * from './_entity/failed-login-attempt/types.js';
9
+ export * from './_entity/failed-login-attempt/consts.js';
10
+ export * from './_entity/login-attempts/db-def.js';
11
+ export * from './_entity/login-attempts/types.js';
12
+ export * from './_enum/password-assertion/types.js';
13
+ export * from './_enum/password-assertion/validator.js';
14
+ export * from './headers.js';
15
+ export * from './utils.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/user-account-shared",
3
- "version": "0.401.9",
3
+ "version": "0.500.0",
4
4
  "description": "User Account Shared",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -34,11 +34,12 @@
34
34
  "test": "ts-mocha -w -p src/test/tsconfig.json --timeout 0 --inspect=8107 --watch-files 'src/test/**/*.test.ts' src/test/**/*.test.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@nu-art/ts-common": "0.401.9",
38
- "@nu-art/firebase-shared": "0.401.9",
39
- "@nu-art/thunderstorm-shared": "0.401.9",
40
- "@nu-art/ts-styles": "0.401.9",
41
- "@nu-art/slack-shared": "0.401.9",
37
+ "@nu-art/db-api-shared": "0.500.0",
38
+ "@nu-art/api-types": "{{THUNDERSTORM_VERSION}}",
39
+ "@nu-art/ts-common": "0.500.0",
40
+ "@nu-art/firebase-shared": "0.500.0",
41
+ "@nu-art/ts-styles": "0.500.0",
42
+ "@nu-art/slack-shared": "0.500.0",
42
43
  "firebase": "^11.9.0",
43
44
  "firebase-admin": "13.4.0",
44
45
  "firebase-functions": "6.3.2",
@@ -53,6 +54,7 @@
53
54
  "@types/react": "^18.0.0",
54
55
  "@types/express": "^4.17.17",
55
56
  "@types/history": "^4.7.2",
57
+ "@types/request": "^2.48.1",
56
58
  "@types/saml2-js": "^1.6.8",
57
59
  "@types/pako": "^2.0.0",
58
60
  "@types/jsonwebtoken": "^9.0.6"
package/utils.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Simplified audit information (v2).
3
+ *
4
+ * Only stores the auditor ID, not full audit details.
5
+ */
6
+ export type AuditableV2 = {
7
+ /** ID of the user/system that made the change */
8
+ _auditorId: string;
9
+ };
10
+ export declare const tsValidator_AuditableV2: {
11
+ _auditorId: import("@nu-art/ts-common").Validator<string>;
12
+ };
package/utils.js ADDED
@@ -0,0 +1,2 @@
1
+ import { tsValidateString } from '@nu-art/ts-common';
2
+ export const tsValidator_AuditableV2 = { _auditorId: tsValidateString() };
@@ -1,3 +0,0 @@
1
- export * from './types.js';
2
- export * from './db-def.js';
3
- export * from './consts.js';
@@ -1,3 +0,0 @@
1
- export * from './types.js';
2
- export * from './db-def.js';
3
- export * from './consts.js';
package/_entity.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './_entity/account/index.js';
2
- export * from './_entity/session/index.js';
3
- export * from './_entity/login-attempts/index.js';
4
- export * from './_entity/failed-login-attempt/index.js';
package/_entity.js DELETED
@@ -1,4 +0,0 @@
1
- export * from './_entity/account/index.js';
2
- export * from './_entity/session/index.js';
3
- export * from './_entity/login-attempts/index.js';
4
- export * from './_entity/failed-login-attempt/index.js';
package/_enum.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './_enum/password-assertion/index.js';
package/_enum.js DELETED
@@ -1 +0,0 @@
1
- export * from './_enum/password-assertion/index.js';