Skip to content

Commit 6c5e3cf

Browse files
committed
js: Replace api/ files by generated files with minor manual changes
1 parent 4233829 commit 6c5e3cf

File tree

8 files changed

+364
-190
lines changed

8 files changed

+364
-190
lines changed

javascript/src/api/application.ts

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// this file is @generated (with the exception of getOrCreate)
12
import {
3+
Configuration,
24
ApplicationApi,
35
ApplicationIn,
46
ApplicationOut,
57
ApplicationPatch,
6-
Configuration,
78
ListResponseApplicationOut,
89
Ordering,
910
} from "../openapi";
@@ -25,18 +26,26 @@ export class Application {
2526
this.api = new ApplicationApi(config);
2627
}
2728

29+
/// List of all the organization's applications.
2830
public list(options?: ApplicationListOptions): Promise<ListResponseApplicationOut> {
29-
const iterator = options?.iterator ?? undefined;
30-
return this.api.v1ApplicationList({ ...options, iterator });
31+
return this.api.v1ApplicationList({
32+
...options,
33+
iterator: options?.iterator ?? undefined,
34+
});
3135
}
3236

37+
/// Create a new application.
3338
public create(
3439
applicationIn: ApplicationIn,
3540
options?: PostOptions
3641
): Promise<ApplicationOut> {
37-
return this.api.v1ApplicationCreate({ applicationIn, ...options });
42+
return this.api.v1ApplicationCreate({
43+
applicationIn,
44+
...options,
45+
});
3846
}
3947

48+
/// Get the application with the UID from `applicationIn`, or create it if it doesn't exist yet.
4049
public getOrCreate(
4150
applicationIn: ApplicationIn,
4251
options?: PostOptions
@@ -48,22 +57,36 @@ export class Application {
4857
});
4958
}
5059

60+
/// Get an application.
5161
public get(appId: string): Promise<ApplicationOut> {
52-
return this.api.v1ApplicationGet({ appId });
62+
return this.api.v1ApplicationGet({
63+
appId,
64+
});
5365
}
5466

67+
/// Update an application.
5568
public update(appId: string, applicationIn: ApplicationIn): Promise<ApplicationOut> {
56-
return this.api.v1ApplicationUpdate({ appId, applicationIn });
69+
return this.api.v1ApplicationUpdate({
70+
appId,
71+
applicationIn,
72+
});
73+
}
74+
75+
/// Delete an application.
76+
public delete(appId: string): Promise<void> {
77+
return this.api.v1ApplicationDelete({
78+
appId,
79+
});
5780
}
5881

82+
/// Partially update an application.
5983
public patch(
6084
appId: string,
6185
applicationPatch: ApplicationPatch
6286
): Promise<ApplicationOut> {
63-
return this.api.v1ApplicationPatch({ appId, applicationPatch });
64-
}
65-
66-
public delete(appId: string): Promise<void> {
67-
return this.api.v1ApplicationDelete({ appId });
87+
return this.api.v1ApplicationPatch({
88+
appId,
89+
applicationPatch,
90+
});
6891
}
6992
}

javascript/src/api/authentication.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
// this file is @generated (with minor manual changes)
12
import {
23
Configuration,
34
AuthenticationApi,
4-
DashboardAccessOut,
5-
AppPortalAccessOut,
65
AppPortalAccessIn,
6+
AppPortalAccessOut,
7+
ApplicationTokenExpireIn,
8+
DashboardAccessOut,
79
} from "../openapi";
810
import { PostOptions } from "../util";
911

@@ -14,6 +16,7 @@ export class Authentication {
1416
this.api = new AuthenticationApi(config);
1517
}
1618

19+
/// Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
1720
public appPortalAccess(
1821
appId: string,
1922
appPortalAccessIn: AppPortalAccessIn,
@@ -36,7 +39,25 @@ export class Authentication {
3639
});
3740
}
3841

42+
/// Expire all of the tokens associated with a specific Application
43+
public expireAll(
44+
appId: string,
45+
applicationTokenExpireIn: ApplicationTokenExpireIn,
46+
options?: PostOptions
47+
): Promise<void> {
48+
return this.api.v1AuthenticationExpireAll({
49+
appId,
50+
applicationTokenExpireIn,
51+
...options,
52+
});
53+
}
54+
55+
/// Logout an app token.
56+
///
57+
/// Trying to log out other tokens will fail.
3958
public logout(options?: PostOptions): Promise<void> {
40-
return this.api.v1AuthenticationLogout({ ...options });
59+
return this.api.v1AuthenticationLogout({
60+
...options,
61+
});
4162
}
4263
}

0 commit comments

Comments
 (0)