attlaz-client 1.13.12 → 1.13.13

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.
@@ -4,10 +4,6 @@ import { User } from '../Model/User.js';
4
4
  import { CollectionResult } from '../Model/Result/CollectionResult.js';
5
5
  export declare class UserEndpoint extends Endpoint {
6
6
  getUser(): Promise<User | null>;
7
- createAuthProvider(providerType: string, data: {
8
- code: string;
9
- state: string;
10
- }): Promise<boolean>;
11
7
  removeAuthProvider(providerId: number): Promise<boolean>;
12
8
  getAuthProviders(): Promise<CollectionResult<UserAuthProvider>>;
13
9
  getPermissions(): Promise<CollectionResult<{
@@ -7,26 +7,27 @@ export class UserEndpoint extends Endpoint {
7
7
  const rawUser = await this.requestObject(cmd, null, User.parse);
8
8
  return rawUser.getData();
9
9
  }
10
- async createAuthProvider(providerType, data) {
11
- try {
12
- const parser = (raw) => raw;
13
- const result = await this.requestObject('/users/auth/providers', {
14
- provider_type: providerType, code: data.code, state: data.state
15
- }, parser, 'POST');
16
- const re = result.getData();
17
- if (re === null) {
18
- console.log('create auth provider wrong data', { result, parsed: re });
19
- throw new Error('Unable to create auth provider: wrong response from API');
20
- }
21
- return re.created;
22
- }
23
- catch (e) {
24
- if (this.httpClient.isDebugEnabled()) {
25
- console.error('Failed to assign auth provider: ', e);
26
- }
27
- throw e;
28
- }
29
- }
10
+ // public async createAuthProvider(providerType: string, data: { code: string; state: string }): Promise<boolean> {
11
+ // try {
12
+ // const parser = (raw: any): { created: boolean } => raw;
13
+ // const result: ObjectResult<{
14
+ // created: boolean
15
+ // }> = await this.requestObject('/users/auth/providers', {
16
+ // provider_type: providerType, code: data.code, state: data.state
17
+ // }, parser, 'POST');
18
+ // const re: { created: boolean } | null = result.getData();
19
+ // if (re === null) {
20
+ // console.log('create auth provider wrong data', {result, parsed: re});
21
+ // throw new Error('Unable to create auth provider: wrong response from API');
22
+ // }
23
+ // return re.created;
24
+ // } catch (e) {
25
+ // if (this.httpClient.isDebugEnabled()) {
26
+ // console.error('Failed to assign auth provider: ', e);
27
+ // }
28
+ // throw e;
29
+ // }
30
+ // }
30
31
  async removeAuthProvider(providerId) {
31
32
  try {
32
33
  const parser = (raw) => ({ deleted: raw.deleted });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.13.12",
3
+ "version": "1.13.13",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",