@ignos/api-client 20260520.131.1 → 20260521.132.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/lib/ignosportal-api.d.ts +10 -0
- package/lib/ignosportal-api.js +36 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +46 -0
package/lib/ignosportal-api.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare class CountriesClient extends AuthorizedApiBase implements ICount
|
|
|
30
30
|
}
|
|
31
31
|
export interface ICustomersClient {
|
|
32
32
|
getCurrentCustomer(): Promise<CurrentCustomerDto>;
|
|
33
|
+
listAvailableTenants(): Promise<AvailableTenantDto[]>;
|
|
33
34
|
/**
|
|
34
35
|
* Upsert a customer.
|
|
35
36
|
* @param id Customer id
|
|
@@ -76,6 +77,8 @@ export declare class CustomersClient extends AuthorizedApiBase implements ICusto
|
|
|
76
77
|
});
|
|
77
78
|
getCurrentCustomer(): Promise<CurrentCustomerDto>;
|
|
78
79
|
protected processGetCurrentCustomer(response: Response): Promise<CurrentCustomerDto>;
|
|
80
|
+
listAvailableTenants(): Promise<AvailableTenantDto[]>;
|
|
81
|
+
protected processListAvailableTenants(response: Response): Promise<AvailableTenantDto[]>;
|
|
79
82
|
/**
|
|
80
83
|
* Upsert a customer.
|
|
81
84
|
* @param id Customer id
|
|
@@ -3448,6 +3451,13 @@ export interface CurrentCustomerDto {
|
|
|
3448
3451
|
name?: string | null;
|
|
3449
3452
|
logoUrl?: string | null;
|
|
3450
3453
|
}
|
|
3454
|
+
export interface AvailableTenantDto {
|
|
3455
|
+
tenantId?: string;
|
|
3456
|
+
name?: string | null;
|
|
3457
|
+
environment?: TenantEnvironmentDto;
|
|
3458
|
+
isRecommended?: boolean;
|
|
3459
|
+
}
|
|
3460
|
+
export type TenantEnvironmentDto = "Prod" | "QA" | "Test" | "Dev";
|
|
3451
3461
|
export interface GuestLoginInfoDto {
|
|
3452
3462
|
tenantId?: string;
|
|
3453
3463
|
customerName?: string;
|
package/lib/ignosportal-api.js
CHANGED
|
@@ -154,6 +154,42 @@ export class CustomersClient extends AuthorizedApiBase {
|
|
|
154
154
|
}
|
|
155
155
|
return Promise.resolve(null);
|
|
156
156
|
}
|
|
157
|
+
listAvailableTenants() {
|
|
158
|
+
let url_ = this.baseUrl + "/customers/available-tenants";
|
|
159
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
160
|
+
let options_ = {
|
|
161
|
+
method: "GET",
|
|
162
|
+
headers: {
|
|
163
|
+
"Accept": "application/json"
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
167
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
168
|
+
}).then((_response) => {
|
|
169
|
+
return this.processListAvailableTenants(_response);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
processListAvailableTenants(response) {
|
|
173
|
+
const status = response.status;
|
|
174
|
+
let _headers = {};
|
|
175
|
+
if (response.headers && response.headers.forEach) {
|
|
176
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
177
|
+
}
|
|
178
|
+
;
|
|
179
|
+
if (status === 200) {
|
|
180
|
+
return response.text().then((_responseText) => {
|
|
181
|
+
let result200 = null;
|
|
182
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
183
|
+
return result200;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
else if (status !== 200 && status !== 204) {
|
|
187
|
+
return response.text().then((_responseText) => {
|
|
188
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return Promise.resolve(null);
|
|
192
|
+
}
|
|
157
193
|
/**
|
|
158
194
|
* Upsert a customer.
|
|
159
195
|
* @param id Customer id
|
package/package.json
CHANGED
package/src/ignosportal-api.ts
CHANGED
|
@@ -141,6 +141,8 @@ export interface ICustomersClient {
|
|
|
141
141
|
|
|
142
142
|
getCurrentCustomer(): Promise<CurrentCustomerDto>;
|
|
143
143
|
|
|
144
|
+
listAvailableTenants(): Promise<AvailableTenantDto[]>;
|
|
145
|
+
|
|
144
146
|
/**
|
|
145
147
|
* Upsert a customer.
|
|
146
148
|
* @param id Customer id
|
|
@@ -232,6 +234,41 @@ export class CustomersClient extends AuthorizedApiBase implements ICustomersClie
|
|
|
232
234
|
return Promise.resolve<CurrentCustomerDto>(null as any);
|
|
233
235
|
}
|
|
234
236
|
|
|
237
|
+
listAvailableTenants(): Promise<AvailableTenantDto[]> {
|
|
238
|
+
let url_ = this.baseUrl + "/customers/available-tenants";
|
|
239
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
240
|
+
|
|
241
|
+
let options_: RequestInit = {
|
|
242
|
+
method: "GET",
|
|
243
|
+
headers: {
|
|
244
|
+
"Accept": "application/json"
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
249
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
250
|
+
}).then((_response: Response) => {
|
|
251
|
+
return this.processListAvailableTenants(_response);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
protected processListAvailableTenants(response: Response): Promise<AvailableTenantDto[]> {
|
|
256
|
+
const status = response.status;
|
|
257
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
258
|
+
if (status === 200) {
|
|
259
|
+
return response.text().then((_responseText) => {
|
|
260
|
+
let result200: any = null;
|
|
261
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as AvailableTenantDto[];
|
|
262
|
+
return result200;
|
|
263
|
+
});
|
|
264
|
+
} else if (status !== 200 && status !== 204) {
|
|
265
|
+
return response.text().then((_responseText) => {
|
|
266
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
return Promise.resolve<AvailableTenantDto[]>(null as any);
|
|
270
|
+
}
|
|
271
|
+
|
|
235
272
|
/**
|
|
236
273
|
* Upsert a customer.
|
|
237
274
|
* @param id Customer id
|
|
@@ -30166,6 +30203,15 @@ export interface CurrentCustomerDto {
|
|
|
30166
30203
|
logoUrl?: string | null;
|
|
30167
30204
|
}
|
|
30168
30205
|
|
|
30206
|
+
export interface AvailableTenantDto {
|
|
30207
|
+
tenantId?: string;
|
|
30208
|
+
name?: string | null;
|
|
30209
|
+
environment?: TenantEnvironmentDto;
|
|
30210
|
+
isRecommended?: boolean;
|
|
30211
|
+
}
|
|
30212
|
+
|
|
30213
|
+
export type TenantEnvironmentDto = "Prod" | "QA" | "Test" | "Dev";
|
|
30214
|
+
|
|
30169
30215
|
export interface GuestLoginInfoDto {
|
|
30170
30216
|
tenantId?: string;
|
|
30171
30217
|
customerName?: string;
|