@drax/identity-front 0.37.0 → 0.37.1

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.37.0",
6
+ "version": "0.37.1",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -49,5 +49,5 @@
49
49
  "vite-plugin-dts": "^3.9.1",
50
50
  "vitest": "^1.4.0"
51
51
  },
52
- "gitHead": "0bca48d4b686fd9536a78d84f5befe6801238000"
52
+ "gitHead": "e4be12cd506bf5255e0f8b26b89cdd2a660a523d"
53
53
  }
@@ -3,7 +3,7 @@ import type {IRoleProvider} from "../../interfaces/IRoleProvider.ts";
3
3
  import type {IRole, IRoleBase} from "@drax/identity-share";
4
4
  import type {
5
5
  IDraxCrudProviderExportResult,
6
- IDraxExportOptions, IDraxFieldFilter,
6
+ IDraxExportOptions,
7
7
  IDraxPaginateOptions,
8
8
  IDraxPaginateResult
9
9
  } from "@drax/crud-share";
@@ -3,7 +3,7 @@ import type {ITenantProvider} from "../../interfaces/ITenantProvider.ts";
3
3
  import type {ITenant, ITenantBase} from "@drax/identity-share";
4
4
  import type {
5
5
  IDraxCrudProviderExportResult,
6
- IDraxExportOptions, IDraxFieldFilter,
6
+ IDraxExportOptions,
7
7
  IDraxPaginateOptions,
8
8
  IDraxPaginateResult
9
9
  } from "@drax/crud-share";
@@ -2,7 +2,6 @@ import type {IHttpClient} from "@drax/common-front";
2
2
  import type {
3
3
  IDraxCrudProviderExportResult,
4
4
  IDraxExportOptions,
5
- IDraxFieldFilter,
6
5
  IDraxGroupByOptions,
7
6
  IDraxPaginateOptions,
8
7
  IDraxPaginateResult
@@ -3,7 +3,7 @@ import type {IUserProvider} from "../../interfaces/IUserProvider.ts";
3
3
  import type {IUser, IUserCreate, IUserUpdate} from "@drax/identity-share";
4
4
  import type {
5
5
  IDraxCrudProviderExportResult,
6
- IDraxExportOptions, IDraxFieldFilter, IDraxGroupByOptions,
6
+ IDraxExportOptions, IDraxGroupByOptions,
7
7
  IDraxPaginateOptions,
8
8
  IDraxPaginateResult
9
9
  } from "@drax/crud-share";
@@ -40,14 +40,26 @@ class RoleSystem implements IRoleProvider {
40
40
  }
41
41
 
42
42
  async create(userPayload: IRoleBase):Promise<IRole> {
43
+ if(!this._provider.create){
44
+ throw new Error("Create method not implemented")
45
+ }
46
+
43
47
  return this._provider.create(userPayload)
44
48
  }
45
49
 
46
50
  async update(id:string, userPayload: IRoleBase):Promise<IRole> {
51
+ if(!this._provider.update){
52
+ throw new Error("Update method not implemented")
53
+ }
54
+
47
55
  return this._provider.update(id, userPayload)
48
56
  }
49
57
 
50
58
  async delete(id: string):Promise<any> {
59
+ if(!this._provider.delete){
60
+ throw new Error("Delete method not implemented")
61
+ }
62
+
51
63
  return this._provider.delete(id)
52
64
  }
53
65
 
@@ -63,7 +75,7 @@ class RoleSystem implements IRoleProvider {
63
75
  }: IDraxExportOptions): Promise<IDraxCrudProviderExportResult> {
64
76
 
65
77
  if(!this._provider.export){
66
- throw new Error(`RoleSystem.provider does not support export`) // assuming we have a custom error for this case // replace with actual error handling as needed // see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#error-handling-changes for more details on custom error classes in TypeScript 3.1+ // or use a library like 'ts-error' for a more robust and flexible error handling solution // or use a custom error type if you want to have a specific error type for this operation // or use a custom interface or class for the export result if you want to have a specific structure for the result // or use a custom function that returns the result if you want to have a specific function for the result // or use a custom interface or class if you want to have a specific structure for the result // or use a custom function that returns the result
78
+ throw new Error(`RoleSystem.provider does not support export`)
67
79
  }
68
80
 
69
81
  return this._provider.export({
@@ -43,14 +43,26 @@ class TenantSystem implements IDraxCrudProvider<ITenant, ITenantBase, ITenantBas
43
43
  }
44
44
 
45
45
  async create(userPayload: ITenantBase): Promise<ITenant> {
46
+ if(!this._provider.create){
47
+ throw new Error("Create method not implemented")
48
+ }
49
+
46
50
  return this._provider.create(userPayload)
47
51
  }
48
52
 
49
53
  async update(id: string, userPayload: ITenantBase): Promise<ITenant> {
54
+ if(!this._provider.update){
55
+ throw new Error("Update method not implemented")
56
+ }
57
+
50
58
  return this._provider.update(id, userPayload)
51
59
  }
52
60
 
53
61
  async delete(id: string): Promise<any> {
62
+ if(!this._provider.delete){
63
+ throw new Error("Delete method not implemented")
64
+ }
65
+
54
66
  return this._provider.delete(id)
55
67
  }
56
68
 
@@ -66,7 +78,7 @@ class TenantSystem implements IDraxCrudProvider<ITenant, ITenantBase, ITenantBas
66
78
  }: IDraxExportOptions): Promise<IDraxCrudProviderExportResult> {
67
79
 
68
80
  if(!this._provider.export){
69
- throw new Error(`TenantSystem.provider does not support export`) // assuming we have a custom error for this case // replace with actual error handling as needed // see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#error-handling-changes for more details on custom error classes in TypeScript 3.1+ // or use a library like 'ts-error' for a more robust and flexible error handling solution // or use a custom error type if you want to have a specific error type for this operation // or use a custom interface or class for the export result if you want to have a specific structure for the result // or use a custom function that returns the result if you want to have a specific function for the result // or use a custom interface or class if you want to have a specific structure for the result // or use a custom function that returns the result
81
+ throw new Error(`TenantSystem.provider does not support export`)
70
82
  }
71
83
 
72
84
  return this._provider.export({
@@ -27,14 +27,26 @@ class UserApiKeySystem implements IUserApiKeyProvider{
27
27
  }
28
28
 
29
29
  async create(userPayload: IUserApiKeyBase):Promise<IUserApiKey> {
30
+ if(!this._provider.create){
31
+ throw new Error("Create method not implemented")
32
+ }
33
+
30
34
  return this._provider.create(userPayload)
31
35
  }
32
36
 
33
37
  async update(id:string, userPayload: IUserApiKeyBase):Promise<IUserApiKey> {
38
+ if(!this._provider.update){
39
+ throw new Error("Update method not implemented")
40
+ }
41
+
34
42
  return this._provider.update(id, userPayload)
35
43
  }
36
44
 
37
45
  async delete(id: string):Promise<any> {
46
+ if(!this._provider.delete){
47
+ throw new Error("Delete method not implemented")
48
+ }
49
+
38
50
  return this._provider.delete(id)
39
51
  }
40
52
 
@@ -32,18 +32,34 @@ class UserSystem implements IUserProvider{
32
32
  }
33
33
 
34
34
  async create(userPayload: IUserCreate):Promise<IUser> {
35
+ if(!this._provider.create){
36
+ throw new Error("Create method not implemented")
37
+ }
38
+
35
39
  return this._provider.create(userPayload)
36
40
  }
37
41
 
38
42
  async update(id:string, userPayload: IUserUpdate):Promise<IUser> {
43
+ if(!this._provider.update){
44
+ throw new Error("Update method not implemented")
45
+ }
46
+
39
47
  return this._provider.update(id, userPayload)
40
48
  }
41
49
 
42
50
  async delete(id: string):Promise<any> {
51
+ if(!this._provider.delete){
52
+ throw new Error("Delete method not implemented")
53
+ }
54
+
43
55
  return this._provider.delete(id)
44
56
  }
45
57
 
46
58
  async changeUserPassword(userId:string, newPassword:string):Promise<boolean> {
59
+ if(!this._provider.changeUserPassword){
60
+ throw new Error("changeUserPassword method not implemented")
61
+ }
62
+
47
63
  const result: boolean = await this._provider.changeUserPassword(userId,newPassword)
48
64
  return result
49
65
  }
@@ -69,7 +85,7 @@ class UserSystem implements IUserProvider{
69
85
  }: IDraxExportOptions): Promise<IDraxCrudProviderExportResult> {
70
86
 
71
87
  if(!this._provider.export){
72
- throw new Error(`export method not implemented`) // assuming we have a custom error for this case // replace with actual error handling as needed // see: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#error-handling-changes for more details on custom error classes in TypeScript 3.1+ // or use a library like 'ts-error' for a more robust and flexible error handling solution // or use a custom error type if you want to have a specific error type for this operation // or use a custom interface or class for the export result if you want to have a specific structure for the result // or use a custom function that returns the result if you want to have a specific function for the result // or use a custom interface or class if you want to have a specific structure for the result // or use a custom function that returns the result
88
+ throw new Error(`export method not implemented`)
73
89
  }
74
90
 
75
91
  return this._provider.export({