fusio-sdk 3.1.1 → 3.1.3

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.
@@ -27,11 +27,11 @@ export declare class GeneratorTag extends TagAbstract {
27
27
  * @throws {MessageException}
28
28
  * @throws {ClientException}
29
29
  */
30
- getProviderForm(provider: string): Promise<FormContainer>;
30
+ getForm(provider: string): Promise<FormContainer>;
31
31
  /**
32
32
  * @returns {Promise<GeneratorIndexProviders>}
33
33
  * @throws {MessageException}
34
34
  * @throws {ClientException}
35
35
  */
36
- getProviders(): Promise<GeneratorIndexProviders>;
36
+ getClasses(): Promise<GeneratorIndexProviders>;
37
37
  }
@@ -88,7 +88,7 @@ export class GeneratorTag extends TagAbstract {
88
88
  * @throws {MessageException}
89
89
  * @throws {ClientException}
90
90
  */
91
- async getProviderForm(provider) {
91
+ async getForm(provider) {
92
92
  const url = this.parser.url('/backend/generator/:provider', {
93
93
  'provider': provider,
94
94
  });
@@ -125,7 +125,7 @@ export class GeneratorTag extends TagAbstract {
125
125
  * @throws {MessageException}
126
126
  * @throws {ClientException}
127
127
  */
128
- async getProviders() {
128
+ async getClasses() {
129
129
  const url = this.parser.url('/backend/generator', {});
130
130
  let params = {
131
131
  url: url,
@@ -2,6 +2,7 @@
2
2
  * Identity automatically generated by SDKgen please do not edit this file manually
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
+ import { IdentityConfig } from "./IdentityConfig";
5
6
  export interface Identity {
6
7
  id?: number;
7
8
  appId?: number;
@@ -9,13 +10,6 @@ export interface Identity {
9
10
  name?: string;
10
11
  icon?: string;
11
12
  class?: string;
12
- clientId?: string;
13
- clientSecret?: string;
14
- authorizationUri?: string;
15
- tokenUri?: string;
16
- userInfoUri?: string;
17
- idProperty?: string;
18
- nameProperty?: string;
19
- emailProperty?: string;
13
+ config?: IdentityConfig;
20
14
  allowCreate?: boolean;
21
15
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * IdentityConfig automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export declare type IdentityConfig = Record<string, any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * IdentityConfig automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * IdentityIndex automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { IdentityIndexEntry } from "./IdentityIndexEntry";
6
+ export interface IdentityIndex {
7
+ providers?: Array<IdentityIndexEntry>;
8
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * IdentityIndex automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * IdentityIndexEntry automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface IdentityIndexEntry {
6
+ name?: string;
7
+ class?: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * IdentityIndexEntry automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -3,9 +3,11 @@
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
5
  import { TagAbstract } from "sdkgen-client";
6
+ import { FormContainer } from "./FormContainer";
6
7
  import { Identity } from "./Identity";
7
8
  import { IdentityCollection } from "./IdentityCollection";
8
9
  import { IdentityCreate } from "./IdentityCreate";
10
+ import { IdentityIndex } from "./IdentityIndex";
9
11
  import { IdentityUpdate } from "./IdentityUpdate";
10
12
  import { Message } from "./Message";
11
13
  export declare class IdentityTag extends TagAbstract {
@@ -27,6 +29,18 @@ export declare class IdentityTag extends TagAbstract {
27
29
  * @throws {ClientException}
28
30
  */
29
31
  get(identityId: string): Promise<Identity>;
32
+ /**
33
+ * @returns {Promise<FormContainer>}
34
+ * @throws {MessageException}
35
+ * @throws {ClientException}
36
+ */
37
+ getForm(_class?: string): Promise<FormContainer>;
38
+ /**
39
+ * @returns {Promise<IdentityIndex>}
40
+ * @throws {MessageException}
41
+ * @throws {ClientException}
42
+ */
43
+ getClasses(): Promise<IdentityIndex>;
30
44
  /**
31
45
  * @returns {Promise<Message>}
32
46
  * @throws {MessageException}
@@ -133,6 +133,78 @@ export class IdentityTag extends TagAbstract {
133
133
  }
134
134
  }
135
135
  }
136
+ /**
137
+ * @returns {Promise<FormContainer>}
138
+ * @throws {MessageException}
139
+ * @throws {ClientException}
140
+ */
141
+ async getForm(_class) {
142
+ const url = this.parser.url('/backend/identity/form', {});
143
+ let params = {
144
+ url: url,
145
+ method: 'GET',
146
+ params: this.parser.query({
147
+ 'class': _class,
148
+ }),
149
+ };
150
+ try {
151
+ const response = await this.httpClient.request(params);
152
+ return response.data;
153
+ }
154
+ catch (error) {
155
+ if (error instanceof ClientException) {
156
+ throw error;
157
+ }
158
+ else if (axios.isAxiosError(error) && error.response) {
159
+ switch (error.response.status) {
160
+ case 401:
161
+ throw new MessageException(error.response.data);
162
+ case 500:
163
+ throw new MessageException(error.response.data);
164
+ default:
165
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
166
+ }
167
+ }
168
+ else {
169
+ throw new ClientException('An unknown error occurred: ' + String(error));
170
+ }
171
+ }
172
+ }
173
+ /**
174
+ * @returns {Promise<IdentityIndex>}
175
+ * @throws {MessageException}
176
+ * @throws {ClientException}
177
+ */
178
+ async getClasses() {
179
+ const url = this.parser.url('/backend/identity/list', {});
180
+ let params = {
181
+ url: url,
182
+ method: 'GET',
183
+ params: this.parser.query({}),
184
+ };
185
+ try {
186
+ const response = await this.httpClient.request(params);
187
+ return response.data;
188
+ }
189
+ catch (error) {
190
+ if (error instanceof ClientException) {
191
+ throw error;
192
+ }
193
+ else if (axios.isAxiosError(error) && error.response) {
194
+ switch (error.response.status) {
195
+ case 401:
196
+ throw new MessageException(error.response.data);
197
+ case 500:
198
+ throw new MessageException(error.response.data);
199
+ default:
200
+ throw new UnknownStatusCodeException('The server returned an unknown status code');
201
+ }
202
+ }
203
+ else {
204
+ throw new ClientException('An unknown error occurred: ' + String(error));
205
+ }
206
+ }
207
+ }
136
208
  /**
137
209
  * @returns {Promise<Message>}
138
210
  * @throws {MessageException}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Identity automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export interface Identity {
6
+ id?: number;
7
+ name?: string;
8
+ icon?: string;
9
+ redirect?: string;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Identity automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * IdentityCollection automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ import { Collection } from "./Collection";
6
+ import { Identity } from "./Identity";
7
+ export declare type IdentityCollection = Collection<Identity>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * IdentityCollection automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
@@ -3,24 +3,25 @@
3
3
  * {@link https://sdkgen.app}
4
4
  */
5
5
  import { TagAbstract } from "sdkgen-client";
6
- import { UserJWT } from "./UserJWT";
6
+ import { IdentityCollection } from "./IdentityCollection";
7
+ import { Passthru } from "./Passthru";
7
8
  export declare class IdentityTag extends TagAbstract {
8
9
  /**
9
- * @returns {Promise<UserJWT>}
10
+ * @returns {Promise<Passthru>}
10
11
  * @throws {MessageException}
11
12
  * @throws {ClientException}
12
13
  */
13
- redirect(identity: string): Promise<UserJWT>;
14
+ redirect(identity: string): Promise<Passthru>;
14
15
  /**
15
- * @returns {Promise<UserJWT>}
16
+ * @returns {Promise<Passthru>}
16
17
  * @throws {MessageException}
17
18
  * @throws {ClientException}
18
19
  */
19
- exchange(identity: string): Promise<UserJWT>;
20
+ exchange(identity: string): Promise<Passthru>;
20
21
  /**
21
- * @returns {Promise<UserJWT>}
22
+ * @returns {Promise<IdentityCollection>}
22
23
  * @throws {MessageException}
23
24
  * @throws {ClientException}
24
25
  */
25
- getAll(appId?: number): Promise<UserJWT>;
26
+ getAll(appId?: number): Promise<IdentityCollection>;
26
27
  }
@@ -8,7 +8,7 @@ import { ClientException, UnknownStatusCodeException } from "sdkgen-client";
8
8
  import { MessageException } from "./MessageException";
9
9
  export class IdentityTag extends TagAbstract {
10
10
  /**
11
- * @returns {Promise<UserJWT>}
11
+ * @returns {Promise<Passthru>}
12
12
  * @throws {MessageException}
13
13
  * @throws {ClientException}
14
14
  */
@@ -45,7 +45,7 @@ export class IdentityTag extends TagAbstract {
45
45
  }
46
46
  }
47
47
  /**
48
- * @returns {Promise<UserJWT>}
48
+ * @returns {Promise<Passthru>}
49
49
  * @throws {MessageException}
50
50
  * @throws {ClientException}
51
51
  */
@@ -82,7 +82,7 @@ export class IdentityTag extends TagAbstract {
82
82
  }
83
83
  }
84
84
  /**
85
- * @returns {Promise<UserJWT>}
85
+ * @returns {Promise<IdentityCollection>}
86
86
  * @throws {MessageException}
87
87
  * @throws {ClientException}
88
88
  */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Passthru automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ /**
6
+ * No schema information available
7
+ */
8
+ export declare type Passthru = Record<string, any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Passthru automatically generated by SDKgen please do not edit this file manually
3
+ * {@link https://sdkgen.app}
4
+ */
5
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fusio-sdk",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "SDK to talk to the Fusio API",
5
5
  "keywords": [
6
6
  "API",