@forklaunch/interfaces-iam 0.1.4 → 0.1.5
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/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -5
- package/lib/eject/interfaces/interfaces/index.ts +0 -4
- package/lib/eject/interfaces/interfaces/organization.service.interface.ts +0 -22
- package/lib/eject/interfaces/interfaces/permission.service.interface.ts +0 -36
- package/lib/eject/interfaces/interfaces/role.service.interface.ts +0 -33
- package/lib/eject/interfaces/interfaces/user.service.interface.ts +0 -44
- package/lib/eject/types/types/index.ts +0 -4
- package/lib/eject/types/types/organization.service.types.ts +0 -24
- package/lib/eject/types/types/permission.service.types.ts +0 -23
- package/lib/eject/types/types/role.service.types.ts +0 -22
- package/lib/eject/types/types/user.service.types.ts +0 -30
- package/lib/index.d.ts +0 -3
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/interfaces-iam",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "IAM interfaces for forklaunch",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -12,17 +12,27 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "Forklift Technologies, Inc.",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./interfaces": {
|
|
17
|
+
"import": "./lib/interfaces/index.js",
|
|
18
|
+
"types": "./lib/interfaces/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./types": {
|
|
21
|
+
"import": "./lib/types/index.js",
|
|
22
|
+
"types": "./lib/types/index.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
15
25
|
"files": [
|
|
16
26
|
"lib/**"
|
|
17
27
|
],
|
|
18
28
|
"dependencies": {
|
|
19
|
-
"@forklaunch/common": "^0.2.
|
|
20
|
-
"@mikro-orm/core": "^6.4.
|
|
29
|
+
"@forklaunch/common": "^0.2.6",
|
|
30
|
+
"@mikro-orm/core": "^6.4.12"
|
|
21
31
|
},
|
|
22
32
|
"devDependencies": {
|
|
23
33
|
"depcheck": "^1.4.7",
|
|
24
34
|
"prettier": "^3.5.3",
|
|
25
|
-
"typedoc": "^0.28.
|
|
35
|
+
"typedoc": "^0.28.2"
|
|
26
36
|
},
|
|
27
37
|
"scripts": {
|
|
28
38
|
"build": "tsc && pnpm package:eject",
|
|
@@ -31,7 +41,7 @@
|
|
|
31
41
|
"format": "prettier --ignore-path=.prettierignore --config .prettierrc '**/*.{ts,tsx,json}' --write",
|
|
32
42
|
"lint": "eslint . -c eslint.config.mjs",
|
|
33
43
|
"lint:fix": "eslint . -c eslint.config.mjs --fix",
|
|
34
|
-
"package:eject": "mkdir -p lib/eject && cp -r interfaces lib/eject/interfaces && cp -r types lib/eject/types",
|
|
44
|
+
"package:eject": "rm -rf lib/eject && mkdir -p lib/eject && cp -r interfaces lib/eject/interfaces && cp -r types lib/eject/types",
|
|
35
45
|
"test": "vitest --passWithNoTests"
|
|
36
46
|
}
|
|
37
47
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
-
import { OrganizationServiceParameters } from '../types/organization.service.types';
|
|
3
|
-
|
|
4
|
-
export interface OrganizationService<
|
|
5
|
-
OrganizationStatus,
|
|
6
|
-
Params extends
|
|
7
|
-
OrganizationServiceParameters<OrganizationStatus> = OrganizationServiceParameters<OrganizationStatus>
|
|
8
|
-
> {
|
|
9
|
-
createOrganization(
|
|
10
|
-
organizationDto: Params['CreateOrganizationDto'],
|
|
11
|
-
em?: EntityManager
|
|
12
|
-
): Promise<Params['OrganizationDto']>;
|
|
13
|
-
getOrganization(
|
|
14
|
-
idDto: Params['IdDto'],
|
|
15
|
-
em?: EntityManager
|
|
16
|
-
): Promise<Params['OrganizationDto']>;
|
|
17
|
-
updateOrganization(
|
|
18
|
-
organizationDto: Params['UpdateOrganizationDto'],
|
|
19
|
-
em?: EntityManager
|
|
20
|
-
): Promise<Params['OrganizationDto']>;
|
|
21
|
-
deleteOrganization(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
22
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
-
import { PermissionServiceParameters } from '../types/permission.service.types';
|
|
3
|
-
|
|
4
|
-
export interface PermissionService<
|
|
5
|
-
Params extends PermissionServiceParameters = PermissionServiceParameters
|
|
6
|
-
> {
|
|
7
|
-
createPermission(
|
|
8
|
-
permissionDto: Params['CreatePermissionDto'],
|
|
9
|
-
em?: EntityManager
|
|
10
|
-
): Promise<Params['PermissionDto']>;
|
|
11
|
-
createBatchPermissions(
|
|
12
|
-
permissionDtos: Params['CreatePermissionDto'][],
|
|
13
|
-
em?: EntityManager
|
|
14
|
-
): Promise<Params['PermissionDto'][]>;
|
|
15
|
-
getPermission(
|
|
16
|
-
idDto: Params['IdDto'],
|
|
17
|
-
em?: EntityManager
|
|
18
|
-
): Promise<Params['PermissionDto']>;
|
|
19
|
-
getBatchPermissions(
|
|
20
|
-
idsDto: Params['IdsDto'],
|
|
21
|
-
em?: EntityManager
|
|
22
|
-
): Promise<Params['PermissionDto'][]>;
|
|
23
|
-
updatePermission(
|
|
24
|
-
permissionDto: Params['UpdatePermissionDto'],
|
|
25
|
-
em?: EntityManager
|
|
26
|
-
): Promise<Params['PermissionDto']>;
|
|
27
|
-
updateBatchPermissions(
|
|
28
|
-
permissionDtos: Params['UpdatePermissionDto'][],
|
|
29
|
-
em?: EntityManager
|
|
30
|
-
): Promise<Params['PermissionDto'][]>;
|
|
31
|
-
deletePermission(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
32
|
-
deleteBatchPermissions(
|
|
33
|
-
idsDto: Params['IdsDto'],
|
|
34
|
-
em?: EntityManager
|
|
35
|
-
): Promise<void>;
|
|
36
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
-
import { RoleServiceParameters } from '../types/role.service.types';
|
|
3
|
-
|
|
4
|
-
export interface RoleService<
|
|
5
|
-
Params extends RoleServiceParameters = RoleServiceParameters
|
|
6
|
-
> {
|
|
7
|
-
createRole(
|
|
8
|
-
roleDto: Params['CreateRoleDto'],
|
|
9
|
-
em?: EntityManager
|
|
10
|
-
): Promise<Params['RoleDto']>;
|
|
11
|
-
createBatchRoles(
|
|
12
|
-
roleDtos: Params['CreateRoleDto'][],
|
|
13
|
-
em?: EntityManager
|
|
14
|
-
): Promise<Params['RoleDto'][]>;
|
|
15
|
-
getRole(
|
|
16
|
-
idDto: Params['IdDto'],
|
|
17
|
-
em?: EntityManager
|
|
18
|
-
): Promise<Params['RoleDto']>;
|
|
19
|
-
getBatchRoles(
|
|
20
|
-
idsDto: Params['IdsDto'],
|
|
21
|
-
em?: EntityManager
|
|
22
|
-
): Promise<Params['RoleDto'][]>;
|
|
23
|
-
updateRole(
|
|
24
|
-
roleDto: Params['UpdateRoleDto'],
|
|
25
|
-
em?: EntityManager
|
|
26
|
-
): Promise<Params['RoleDto']>;
|
|
27
|
-
updateBatchRoles(
|
|
28
|
-
roleDtos: Params['UpdateRoleDto'][],
|
|
29
|
-
em?: EntityManager
|
|
30
|
-
): Promise<Params['RoleDto'][]>;
|
|
31
|
-
deleteRole(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
32
|
-
deleteBatchRoles(idsDto: Params['IdsDto'], em?: EntityManager): Promise<void>;
|
|
33
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from '@mikro-orm/core';
|
|
2
|
-
import { UserServiceParameters } from '../types/user.service.types';
|
|
3
|
-
|
|
4
|
-
export interface UserService<
|
|
5
|
-
Params extends UserServiceParameters = UserServiceParameters
|
|
6
|
-
> {
|
|
7
|
-
createUser(
|
|
8
|
-
userDto: Params['CreateUserDto'],
|
|
9
|
-
em?: EntityManager
|
|
10
|
-
): Promise<Params['UserDto']>;
|
|
11
|
-
createBatchUsers(
|
|
12
|
-
userDtos: Params['CreateUserDto'][],
|
|
13
|
-
em?: EntityManager
|
|
14
|
-
): Promise<Params['UserDto'][]>;
|
|
15
|
-
getUser(
|
|
16
|
-
idDto: Params['IdDto'],
|
|
17
|
-
em?: EntityManager
|
|
18
|
-
): Promise<Params['UserDto']>;
|
|
19
|
-
getBatchUsers(
|
|
20
|
-
idsDto: Params['IdsDto'],
|
|
21
|
-
em?: EntityManager
|
|
22
|
-
): Promise<Params['UserDto'][]>;
|
|
23
|
-
updateUser(
|
|
24
|
-
userDto: Params['UpdateUserDto'],
|
|
25
|
-
em?: EntityManager
|
|
26
|
-
): Promise<Params['UserDto']>;
|
|
27
|
-
updateBatchUsers(
|
|
28
|
-
userDtos: Params['UpdateUserDto'][],
|
|
29
|
-
em?: EntityManager
|
|
30
|
-
): Promise<Params['UserDto'][]>;
|
|
31
|
-
deleteUser(idDto: Params['IdDto'], em?: EntityManager): Promise<void>;
|
|
32
|
-
deleteBatchUsers(idsDto: Params['IdsDto'], em?: EntityManager): Promise<void>;
|
|
33
|
-
|
|
34
|
-
verifyHasRole(
|
|
35
|
-
idDto: Params['IdDto'],
|
|
36
|
-
roleId: string,
|
|
37
|
-
em?: EntityManager
|
|
38
|
-
): Promise<void>;
|
|
39
|
-
verifyHasPermission(
|
|
40
|
-
idDto: Params['IdDto'],
|
|
41
|
-
permissionId: string,
|
|
42
|
-
em?: EntityManager
|
|
43
|
-
): Promise<void>;
|
|
44
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IdDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
-
import { UserDto } from './user.service.types';
|
|
3
|
-
|
|
4
|
-
export type CreateOrganizationDto = {
|
|
5
|
-
name: string;
|
|
6
|
-
domain: string;
|
|
7
|
-
subscription: string;
|
|
8
|
-
logoUrl?: string;
|
|
9
|
-
extraFields?: unknown;
|
|
10
|
-
};
|
|
11
|
-
export type UpdateOrganizationDto = IdDto & Partial<CreateOrganizationDto>;
|
|
12
|
-
export type OrganizationDto<OrganizationStatus> = IdDto &
|
|
13
|
-
CreateOrganizationDto &
|
|
14
|
-
Partial<RecordTimingDto> & {
|
|
15
|
-
users: UserDto[];
|
|
16
|
-
status: OrganizationStatus[keyof OrganizationStatus];
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type OrganizationServiceParameters<OrganizationStatus> = {
|
|
20
|
-
CreateOrganizationDto: CreateOrganizationDto;
|
|
21
|
-
OrganizationDto: OrganizationDto<OrganizationStatus>;
|
|
22
|
-
UpdateOrganizationDto: UpdateOrganizationDto;
|
|
23
|
-
IdDto: IdDto;
|
|
24
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
-
|
|
3
|
-
export type CreatePermissionDto = {
|
|
4
|
-
slug: string;
|
|
5
|
-
addToRolesIds?: string[];
|
|
6
|
-
extraFields?: unknown;
|
|
7
|
-
};
|
|
8
|
-
export type UpdatePermissionDto = IdDto &
|
|
9
|
-
Partial<CreatePermissionDto> & {
|
|
10
|
-
removeFromRolesIds?: string[];
|
|
11
|
-
};
|
|
12
|
-
export type PermissionDto = IdDto &
|
|
13
|
-
Partial<RecordTimingDto> & {
|
|
14
|
-
slug: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type PermissionServiceParameters = {
|
|
18
|
-
CreatePermissionDto: CreatePermissionDto;
|
|
19
|
-
PermissionDto: PermissionDto;
|
|
20
|
-
UpdatePermissionDto: UpdatePermissionDto;
|
|
21
|
-
IdDto: IdDto;
|
|
22
|
-
IdsDto: IdsDto;
|
|
23
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
-
import { PermissionDto } from './permission.service.types';
|
|
3
|
-
|
|
4
|
-
export type CreateRoleDto = {
|
|
5
|
-
name: string;
|
|
6
|
-
permissionsIds?: PermissionDto[];
|
|
7
|
-
extraFields?: unknown;
|
|
8
|
-
};
|
|
9
|
-
export type UpdateRoleDto = IdDto & Partial<CreateRoleDto>;
|
|
10
|
-
export type RoleDto = IdDto &
|
|
11
|
-
Omit<CreateRoleDto, 'permissionsIds'> &
|
|
12
|
-
Partial<RecordTimingDto> & {
|
|
13
|
-
permissions: PermissionDto[];
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type RoleServiceParameters = {
|
|
17
|
-
CreateRoleDto: CreateRoleDto;
|
|
18
|
-
RoleDto: RoleDto;
|
|
19
|
-
UpdateRoleDto: UpdateRoleDto;
|
|
20
|
-
IdDto: IdDto;
|
|
21
|
-
IdsDto: IdsDto;
|
|
22
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { IdDto, IdsDto, RecordTimingDto } from '@forklaunch/common';
|
|
2
|
-
import { RoleDto } from './role.service.types';
|
|
3
|
-
|
|
4
|
-
export type CreateUserDto = {
|
|
5
|
-
email: string;
|
|
6
|
-
password: string;
|
|
7
|
-
firstName: string;
|
|
8
|
-
lastName: string;
|
|
9
|
-
organizationId: string;
|
|
10
|
-
roleIds: string[];
|
|
11
|
-
phoneNumber?: string;
|
|
12
|
-
subscription?: string;
|
|
13
|
-
extraFields?: unknown;
|
|
14
|
-
};
|
|
15
|
-
export type UpdateUserDto = IdDto &
|
|
16
|
-
Partial<Omit<CreateUserDto, 'organizationId'>>;
|
|
17
|
-
|
|
18
|
-
export type UserDto = IdDto &
|
|
19
|
-
Omit<CreateUserDto, 'roleIds' | 'password' | 'organizationId'> &
|
|
20
|
-
Partial<RecordTimingDto> & {
|
|
21
|
-
roles: RoleDto[];
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type UserServiceParameters = {
|
|
25
|
-
CreateUserDto: CreateUserDto;
|
|
26
|
-
UserDto: UserDto;
|
|
27
|
-
UpdateUserDto: UpdateUserDto;
|
|
28
|
-
IdDto: IdDto;
|
|
29
|
-
IdsDto: IdsDto;
|
|
30
|
-
};
|
package/lib/index.d.ts
DELETED
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/lib/index.js
DELETED