@kinotic-ai/os-api 1.4.0 → 1.5.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/dist/index.cjs +33 -8
- package/dist/index.d.cts +69 -26
- package/dist/index.d.ts +69 -26
- package/dist/index.js +33 -8
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -78,7 +78,9 @@ __export(exports_src, {
|
|
|
78
78
|
IamUserService: () => IamUserService,
|
|
79
79
|
IamUser: () => IamUser,
|
|
80
80
|
GroupLoggerLevelsDescriptor: () => GroupLoggerLevelsDescriptor,
|
|
81
|
-
|
|
81
|
+
GitHubToken: () => GitHubToken,
|
|
82
|
+
GitHubRepoToken: () => GitHubRepoToken,
|
|
83
|
+
GitHubInstallCompletion: () => GitHubInstallCompletion,
|
|
82
84
|
GitHubAppInstallationService: () => GitHubAppInstallationService,
|
|
83
85
|
GitHubAppInstallation: () => GitHubAppInstallation,
|
|
84
86
|
FlattenedDecorator: () => FlattenedDecorator,
|
|
@@ -87,6 +89,7 @@ __export(exports_src, {
|
|
|
87
89
|
EntityDefinition: () => EntityDefinition,
|
|
88
90
|
EntityDecorator: () => EntityDecorator,
|
|
89
91
|
DiscriminatorDecorator: () => DiscriminatorDecorator,
|
|
92
|
+
DeviceApprovalService: () => DeviceApprovalService,
|
|
90
93
|
DataInsightsService: () => DataInsightsService,
|
|
91
94
|
AutoGeneratedIdDecorator: () => AutoGeneratedIdDecorator,
|
|
92
95
|
AuthType: () => AuthType,
|
|
@@ -299,9 +302,9 @@ class Project {
|
|
|
299
302
|
name;
|
|
300
303
|
description;
|
|
301
304
|
sourceOfTruth = null;
|
|
302
|
-
repoFullName
|
|
303
|
-
repoId
|
|
304
|
-
defaultBranch
|
|
305
|
+
repoFullName;
|
|
306
|
+
repoId;
|
|
307
|
+
defaultBranch;
|
|
305
308
|
repoPrivate = true;
|
|
306
309
|
updated = null;
|
|
307
310
|
constructor(id, applicationId, name, description) {
|
|
@@ -463,13 +466,21 @@ class GitHubAppInstallation {
|
|
|
463
466
|
created = null;
|
|
464
467
|
updated = null;
|
|
465
468
|
}
|
|
466
|
-
// packages/os-api/src/api/model/github/
|
|
467
|
-
class
|
|
469
|
+
// packages/os-api/src/api/model/github/GitHubToken.ts
|
|
470
|
+
class GitHubToken {
|
|
468
471
|
token = "";
|
|
469
472
|
expiresAt = 0;
|
|
473
|
+
}
|
|
474
|
+
// packages/os-api/src/api/model/github/GitHubRepoToken.ts
|
|
475
|
+
class GitHubRepoToken extends GitHubToken {
|
|
470
476
|
cloneUrl = "";
|
|
471
477
|
defaultBranch = "";
|
|
472
478
|
}
|
|
479
|
+
// packages/os-api/src/api/model/github/GitHubInstallCompletion.ts
|
|
480
|
+
class GitHubInstallCompletion {
|
|
481
|
+
installation;
|
|
482
|
+
returnTo = null;
|
|
483
|
+
}
|
|
473
484
|
// packages/os-api/src/api/model/KinoticProjectConfig.ts
|
|
474
485
|
class KinoticProjectConfig {
|
|
475
486
|
name;
|
|
@@ -723,6 +734,16 @@ class IamUserService extends import_core8.CrudServiceProxy {
|
|
|
723
734
|
return this.serviceProxy.invoke("findFirstByEmailInScopeType", [email, authScopeType]);
|
|
724
735
|
}
|
|
725
736
|
}
|
|
737
|
+
// packages/os-api/src/api/services/IDeviceApprovalService.ts
|
|
738
|
+
class DeviceApprovalService {
|
|
739
|
+
serviceProxy;
|
|
740
|
+
constructor(kinotic) {
|
|
741
|
+
this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.iam.DeviceApprovalService");
|
|
742
|
+
}
|
|
743
|
+
approve(userCode) {
|
|
744
|
+
return this.serviceProxy.invoke("approve", [userCode]);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
726
747
|
// packages/os-api/src/api/services/IGitHubAppInstallationService.ts
|
|
727
748
|
var import_core9 = require("@kinotic-ai/core");
|
|
728
749
|
|
|
@@ -730,8 +751,11 @@ class GitHubAppInstallationService extends import_core9.CrudServiceProxy {
|
|
|
730
751
|
constructor(kinotic) {
|
|
731
752
|
super(kinotic.serviceProxy("org.kinotic.github.api.services.GitHubAppInstallationService"));
|
|
732
753
|
}
|
|
733
|
-
startInstall() {
|
|
734
|
-
return this.serviceProxy.invoke("startInstall", []);
|
|
754
|
+
startInstall(returnTo) {
|
|
755
|
+
return this.serviceProxy.invoke("startInstall", [returnTo]);
|
|
756
|
+
}
|
|
757
|
+
completeInstall(installationId, state) {
|
|
758
|
+
return this.serviceProxy.invoke("completeInstall", [installationId, state]);
|
|
735
759
|
}
|
|
736
760
|
findForCurrentOrg() {
|
|
737
761
|
return this.serviceProxy.invoke("findForCurrentOrg", []);
|
|
@@ -752,6 +776,7 @@ var OsApiPlugin = {
|
|
|
752
776
|
vmNodes: new VmNodeServiceProxy(kinotic),
|
|
753
777
|
workloads: new WorkloadServiceProxy(kinotic),
|
|
754
778
|
iamUsers: new IamUserService(kinotic),
|
|
779
|
+
deviceApproval: new DeviceApprovalService(kinotic),
|
|
755
780
|
githubAppInstallations: new GitHubAppInstallationService(kinotic)
|
|
756
781
|
};
|
|
757
782
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -201,19 +201,18 @@ declare class Project implements Identifiable3<string> {
|
|
|
201
201
|
* Full name ({@code owner/repo}) of the GitHub repository backing this project.
|
|
202
202
|
* Stamped at create time by the server-side repo provisioner.
|
|
203
203
|
*/
|
|
204
|
-
repoFullName: string
|
|
204
|
+
repoFullName: string;
|
|
205
205
|
/**
|
|
206
206
|
* GitHub's stable repository id. Survives renames on the GitHub side.
|
|
207
207
|
*/
|
|
208
|
-
repoId: number
|
|
208
|
+
repoId: number;
|
|
209
209
|
/**
|
|
210
210
|
* Default branch of the backing repository at the time it was provisioned.
|
|
211
211
|
*/
|
|
212
|
-
defaultBranch: string
|
|
212
|
+
defaultBranch: string;
|
|
213
213
|
/**
|
|
214
214
|
* Visibility chosen for the backing repository at create time. The SPA sets
|
|
215
|
-
* this
|
|
216
|
-
* only — not synced back if changed on GitHub later.
|
|
215
|
+
* this before save; the platform passes it through to GitHub.
|
|
217
216
|
*/
|
|
218
217
|
repoPrivate: boolean;
|
|
219
218
|
/**
|
|
@@ -599,22 +598,38 @@ declare class GitHubAppInstallation implements Identifiable9<string> {
|
|
|
599
598
|
updated: number | null;
|
|
600
599
|
}
|
|
601
600
|
/**
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
* (epoch milliseconds).
|
|
601
|
+
* A short-lived GitHub installation access token. Mirrors the Java
|
|
602
|
+
* {@code org.kinotic.github.api.model.GitHubToken}; {@code expiresAt} is the
|
|
603
|
+
* absolute UTC instant (epoch milliseconds) at which GitHub will reject the token.
|
|
606
604
|
*/
|
|
607
|
-
declare class
|
|
608
|
-
/** Bearer token to send as {@code Authorization: Bearer <token>}
|
|
605
|
+
declare class GitHubToken {
|
|
606
|
+
/** Bearer token to send as {@code Authorization: Bearer <token>}. */
|
|
609
607
|
token: string;
|
|
610
|
-
/** Absolute expiry (epoch milliseconds).
|
|
608
|
+
/** Absolute expiry (epoch milliseconds). Do not use past this point. */
|
|
611
609
|
expiresAt: number;
|
|
612
|
-
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* A {@link GitHubToken} bundled with the repository-clone metadata a worker needs
|
|
613
|
+
* to {@code git clone} the project's backing repo. Returned by
|
|
614
|
+
* {@code GitHubProjectRepoService.issueRepoToken}.
|
|
615
|
+
*/
|
|
616
|
+
declare class GitHubRepoToken extends GitHubToken {
|
|
617
|
+
/** {@code https://github.com/<owner>/<repo>.git} for the project's repo. */
|
|
613
618
|
cloneUrl: string;
|
|
614
|
-
/** Default branch on the
|
|
619
|
+
/** Default branch on the repo (e.g. {@code main}). */
|
|
615
620
|
defaultBranch: string;
|
|
616
621
|
}
|
|
617
622
|
/**
|
|
623
|
+
* Result of finalising a GitHub install round-trip. {@code returnTo} echoes what
|
|
624
|
+
* the SPA staged when it called {@code startInstall(...)} and may carry query
|
|
625
|
+
* params (e.g. {@code /projects?openNewProject=1}) so the destination page can
|
|
626
|
+
* pick up where the user was.
|
|
627
|
+
*/
|
|
628
|
+
declare class GitHubInstallCompletion {
|
|
629
|
+
installation: GitHubAppInstallation;
|
|
630
|
+
returnTo: string | null;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
618
633
|
* Configuration for a single entities path and its corresponding repository output.
|
|
619
634
|
*/
|
|
620
635
|
type EntitiesPathConfig = {
|
|
@@ -1057,27 +1072,54 @@ declare class IamUserService extends CrudServiceProxy8<IamUser> implements IIamU
|
|
|
1057
1072
|
resetPassword(userId: string, newPassword: string): Promise<void>;
|
|
1058
1073
|
findFirstByEmailInScopeType(email: string, authScopeType: string): Promise<IamUser | null>;
|
|
1059
1074
|
}
|
|
1060
|
-
import {
|
|
1075
|
+
import { IKinotic as IKinotic12 } from "@kinotic-ai/core";
|
|
1076
|
+
/**
|
|
1077
|
+
* Browser-invoked service for the RFC 8628 device-authorization approve step. The signed-in
|
|
1078
|
+
* browser user calls {@link approve} with the user_code shown in their CLI; the gateway
|
|
1079
|
+
* binds the pending grant to the calling participant.
|
|
1080
|
+
*/
|
|
1081
|
+
interface IDeviceApprovalService {
|
|
1082
|
+
/**
|
|
1083
|
+
* Binds the calling user to the pending device-authorization grant identified by
|
|
1084
|
+
* {@code userCode}. Rejects when the code is unknown, already approved, or expired.
|
|
1085
|
+
*/
|
|
1086
|
+
approve(userCode: string): Promise<void>;
|
|
1087
|
+
}
|
|
1088
|
+
declare class DeviceApprovalService implements IDeviceApprovalService {
|
|
1089
|
+
private readonly serviceProxy;
|
|
1090
|
+
constructor(kinotic: IKinotic12);
|
|
1091
|
+
approve(userCode: string): Promise<void>;
|
|
1092
|
+
}
|
|
1093
|
+
import { CrudServiceProxy as CrudServiceProxy9, IKinotic as IKinotic13, ICrudServiceProxy as ICrudServiceProxy9 } from "@kinotic-ai/core";
|
|
1061
1094
|
interface IGitHubAppInstallationService extends ICrudServiceProxy9<GitHubAppInstallation> {
|
|
1062
1095
|
/**
|
|
1063
|
-
* Stages a single-use
|
|
1064
|
-
*
|
|
1096
|
+
* Stages a single-use state token bound to the caller's organization plus the
|
|
1097
|
+
* supplied returnTo, then returns the GitHub install URL with that state
|
|
1065
1098
|
* embedded. The SPA performs {@code window.location = url}.
|
|
1066
|
-
*
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1099
|
+
*
|
|
1100
|
+
* returnTo is echoed back from {@link completeInstall} and may carry query
|
|
1101
|
+
* params (e.g. {@code /projects?openNewProject=1}) so the destination page
|
|
1102
|
+
* can pick up where the user was.
|
|
1103
|
+
*/
|
|
1104
|
+
startInstall(returnTo: string | null): Promise<string>;
|
|
1105
|
+
/**
|
|
1106
|
+
* Finalises the install once GitHub has redirected the browser back to the SPA
|
|
1107
|
+
* callback. Consumes the staged state, fetches the install details from GitHub,
|
|
1108
|
+
* persists the {@link GitHubAppInstallation} row, and returns it along with the
|
|
1109
|
+
* original intent and returnTo.
|
|
1069
1110
|
*/
|
|
1070
|
-
|
|
1111
|
+
completeInstall(installationId: number, state: string): Promise<GitHubInstallCompletion>;
|
|
1071
1112
|
/**
|
|
1072
1113
|
* Returns the (at-most-one) installation bound to the caller's organization, or
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1114
|
+
* null if GitHub is not yet linked. Drives the "linked / not linked" indicator
|
|
1115
|
+
* in the org-settings UI.
|
|
1075
1116
|
*/
|
|
1076
1117
|
findForCurrentOrg(): Promise<GitHubAppInstallation | null>;
|
|
1077
1118
|
}
|
|
1078
1119
|
declare class GitHubAppInstallationService extends CrudServiceProxy9<GitHubAppInstallation> implements IGitHubAppInstallationService {
|
|
1079
|
-
constructor(kinotic:
|
|
1080
|
-
startInstall(): Promise<string>;
|
|
1120
|
+
constructor(kinotic: IKinotic13);
|
|
1121
|
+
startInstall(returnTo: string | null): Promise<string>;
|
|
1122
|
+
completeInstall(installationId: number, state: string): Promise<GitHubInstallCompletion>;
|
|
1081
1123
|
findForCurrentOrg(): Promise<GitHubAppInstallation | null>;
|
|
1082
1124
|
}
|
|
1083
1125
|
import { KinoticPlugin } from "@kinotic-ai/core";
|
|
@@ -1093,10 +1135,11 @@ interface IOsApiExtension {
|
|
|
1093
1135
|
vmNodes: IVmNodeService;
|
|
1094
1136
|
workloads: IWorkloadService;
|
|
1095
1137
|
iamUsers: IIamUserService;
|
|
1138
|
+
deviceApproval: IDeviceApprovalService;
|
|
1096
1139
|
githubAppInstallations: IGitHubAppInstallationService;
|
|
1097
1140
|
}
|
|
1098
1141
|
declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
|
|
1099
1142
|
declare module "@kinotic-ai/core" {
|
|
1100
1143
|
interface KinoticSingleton extends IOsApiExtension {}
|
|
1101
1144
|
}
|
|
1102
|
-
export { WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, IOrganizationService, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IGitHubAppInstallationService, IEntityDefinitionService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor,
|
|
1145
|
+
export { WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, IOrganizationService, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
|
package/dist/index.d.ts
CHANGED
|
@@ -201,19 +201,18 @@ declare class Project implements Identifiable3<string> {
|
|
|
201
201
|
* Full name ({@code owner/repo}) of the GitHub repository backing this project.
|
|
202
202
|
* Stamped at create time by the server-side repo provisioner.
|
|
203
203
|
*/
|
|
204
|
-
repoFullName: string
|
|
204
|
+
repoFullName: string;
|
|
205
205
|
/**
|
|
206
206
|
* GitHub's stable repository id. Survives renames on the GitHub side.
|
|
207
207
|
*/
|
|
208
|
-
repoId: number
|
|
208
|
+
repoId: number;
|
|
209
209
|
/**
|
|
210
210
|
* Default branch of the backing repository at the time it was provisioned.
|
|
211
211
|
*/
|
|
212
|
-
defaultBranch: string
|
|
212
|
+
defaultBranch: string;
|
|
213
213
|
/**
|
|
214
214
|
* Visibility chosen for the backing repository at create time. The SPA sets
|
|
215
|
-
* this
|
|
216
|
-
* only — not synced back if changed on GitHub later.
|
|
215
|
+
* this before save; the platform passes it through to GitHub.
|
|
217
216
|
*/
|
|
218
217
|
repoPrivate: boolean;
|
|
219
218
|
/**
|
|
@@ -599,22 +598,38 @@ declare class GitHubAppInstallation implements Identifiable9<string> {
|
|
|
599
598
|
updated: number | null;
|
|
600
599
|
}
|
|
601
600
|
/**
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
* (epoch milliseconds).
|
|
601
|
+
* A short-lived GitHub installation access token. Mirrors the Java
|
|
602
|
+
* {@code org.kinotic.github.api.model.GitHubToken}; {@code expiresAt} is the
|
|
603
|
+
* absolute UTC instant (epoch milliseconds) at which GitHub will reject the token.
|
|
606
604
|
*/
|
|
607
|
-
declare class
|
|
608
|
-
/** Bearer token to send as {@code Authorization: Bearer <token>}
|
|
605
|
+
declare class GitHubToken {
|
|
606
|
+
/** Bearer token to send as {@code Authorization: Bearer <token>}. */
|
|
609
607
|
token: string;
|
|
610
|
-
/** Absolute expiry (epoch milliseconds).
|
|
608
|
+
/** Absolute expiry (epoch milliseconds). Do not use past this point. */
|
|
611
609
|
expiresAt: number;
|
|
612
|
-
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* A {@link GitHubToken} bundled with the repository-clone metadata a worker needs
|
|
613
|
+
* to {@code git clone} the project's backing repo. Returned by
|
|
614
|
+
* {@code GitHubProjectRepoService.issueRepoToken}.
|
|
615
|
+
*/
|
|
616
|
+
declare class GitHubRepoToken extends GitHubToken {
|
|
617
|
+
/** {@code https://github.com/<owner>/<repo>.git} for the project's repo. */
|
|
613
618
|
cloneUrl: string;
|
|
614
|
-
/** Default branch on the
|
|
619
|
+
/** Default branch on the repo (e.g. {@code main}). */
|
|
615
620
|
defaultBranch: string;
|
|
616
621
|
}
|
|
617
622
|
/**
|
|
623
|
+
* Result of finalising a GitHub install round-trip. {@code returnTo} echoes what
|
|
624
|
+
* the SPA staged when it called {@code startInstall(...)} and may carry query
|
|
625
|
+
* params (e.g. {@code /projects?openNewProject=1}) so the destination page can
|
|
626
|
+
* pick up where the user was.
|
|
627
|
+
*/
|
|
628
|
+
declare class GitHubInstallCompletion {
|
|
629
|
+
installation: GitHubAppInstallation;
|
|
630
|
+
returnTo: string | null;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
618
633
|
* Configuration for a single entities path and its corresponding repository output.
|
|
619
634
|
*/
|
|
620
635
|
type EntitiesPathConfig = {
|
|
@@ -1057,27 +1072,54 @@ declare class IamUserService extends CrudServiceProxy8<IamUser> implements IIamU
|
|
|
1057
1072
|
resetPassword(userId: string, newPassword: string): Promise<void>;
|
|
1058
1073
|
findFirstByEmailInScopeType(email: string, authScopeType: string): Promise<IamUser | null>;
|
|
1059
1074
|
}
|
|
1060
|
-
import {
|
|
1075
|
+
import { IKinotic as IKinotic12 } from "@kinotic-ai/core";
|
|
1076
|
+
/**
|
|
1077
|
+
* Browser-invoked service for the RFC 8628 device-authorization approve step. The signed-in
|
|
1078
|
+
* browser user calls {@link approve} with the user_code shown in their CLI; the gateway
|
|
1079
|
+
* binds the pending grant to the calling participant.
|
|
1080
|
+
*/
|
|
1081
|
+
interface IDeviceApprovalService {
|
|
1082
|
+
/**
|
|
1083
|
+
* Binds the calling user to the pending device-authorization grant identified by
|
|
1084
|
+
* {@code userCode}. Rejects when the code is unknown, already approved, or expired.
|
|
1085
|
+
*/
|
|
1086
|
+
approve(userCode: string): Promise<void>;
|
|
1087
|
+
}
|
|
1088
|
+
declare class DeviceApprovalService implements IDeviceApprovalService {
|
|
1089
|
+
private readonly serviceProxy;
|
|
1090
|
+
constructor(kinotic: IKinotic12);
|
|
1091
|
+
approve(userCode: string): Promise<void>;
|
|
1092
|
+
}
|
|
1093
|
+
import { CrudServiceProxy as CrudServiceProxy9, IKinotic as IKinotic13, ICrudServiceProxy as ICrudServiceProxy9 } from "@kinotic-ai/core";
|
|
1061
1094
|
interface IGitHubAppInstallationService extends ICrudServiceProxy9<GitHubAppInstallation> {
|
|
1062
1095
|
/**
|
|
1063
|
-
* Stages a single-use
|
|
1064
|
-
*
|
|
1096
|
+
* Stages a single-use state token bound to the caller's organization plus the
|
|
1097
|
+
* supplied returnTo, then returns the GitHub install URL with that state
|
|
1065
1098
|
* embedded. The SPA performs {@code window.location = url}.
|
|
1066
|
-
*
|
|
1067
|
-
*
|
|
1068
|
-
*
|
|
1099
|
+
*
|
|
1100
|
+
* returnTo is echoed back from {@link completeInstall} and may carry query
|
|
1101
|
+
* params (e.g. {@code /projects?openNewProject=1}) so the destination page
|
|
1102
|
+
* can pick up where the user was.
|
|
1103
|
+
*/
|
|
1104
|
+
startInstall(returnTo: string | null): Promise<string>;
|
|
1105
|
+
/**
|
|
1106
|
+
* Finalises the install once GitHub has redirected the browser back to the SPA
|
|
1107
|
+
* callback. Consumes the staged state, fetches the install details from GitHub,
|
|
1108
|
+
* persists the {@link GitHubAppInstallation} row, and returns it along with the
|
|
1109
|
+
* original intent and returnTo.
|
|
1069
1110
|
*/
|
|
1070
|
-
|
|
1111
|
+
completeInstall(installationId: number, state: string): Promise<GitHubInstallCompletion>;
|
|
1071
1112
|
/**
|
|
1072
1113
|
* Returns the (at-most-one) installation bound to the caller's organization, or
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1114
|
+
* null if GitHub is not yet linked. Drives the "linked / not linked" indicator
|
|
1115
|
+
* in the org-settings UI.
|
|
1075
1116
|
*/
|
|
1076
1117
|
findForCurrentOrg(): Promise<GitHubAppInstallation | null>;
|
|
1077
1118
|
}
|
|
1078
1119
|
declare class GitHubAppInstallationService extends CrudServiceProxy9<GitHubAppInstallation> implements IGitHubAppInstallationService {
|
|
1079
|
-
constructor(kinotic:
|
|
1080
|
-
startInstall(): Promise<string>;
|
|
1120
|
+
constructor(kinotic: IKinotic13);
|
|
1121
|
+
startInstall(returnTo: string | null): Promise<string>;
|
|
1122
|
+
completeInstall(installationId: number, state: string): Promise<GitHubInstallCompletion>;
|
|
1081
1123
|
findForCurrentOrg(): Promise<GitHubAppInstallation | null>;
|
|
1082
1124
|
}
|
|
1083
1125
|
import { KinoticPlugin } from "@kinotic-ai/core";
|
|
@@ -1093,10 +1135,11 @@ interface IOsApiExtension {
|
|
|
1093
1135
|
vmNodes: IVmNodeService;
|
|
1094
1136
|
workloads: IWorkloadService;
|
|
1095
1137
|
iamUsers: IIamUserService;
|
|
1138
|
+
deviceApproval: IDeviceApprovalService;
|
|
1096
1139
|
githubAppInstallations: IGitHubAppInstallationService;
|
|
1097
1140
|
}
|
|
1098
1141
|
declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
|
|
1099
1142
|
declare module "@kinotic-ai/core" {
|
|
1100
1143
|
interface KinoticSingleton extends IOsApiExtension {}
|
|
1101
1144
|
}
|
|
1102
|
-
export { WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, IOrganizationService, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IGitHubAppInstallationService, IEntityDefinitionService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor,
|
|
1145
|
+
export { WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, IOrganizationService, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
|
package/dist/index.js
CHANGED
|
@@ -202,9 +202,9 @@ class Project {
|
|
|
202
202
|
name;
|
|
203
203
|
description;
|
|
204
204
|
sourceOfTruth = null;
|
|
205
|
-
repoFullName
|
|
206
|
-
repoId
|
|
207
|
-
defaultBranch
|
|
205
|
+
repoFullName;
|
|
206
|
+
repoId;
|
|
207
|
+
defaultBranch;
|
|
208
208
|
repoPrivate = true;
|
|
209
209
|
updated = null;
|
|
210
210
|
constructor(id, applicationId, name, description) {
|
|
@@ -366,13 +366,21 @@ class GitHubAppInstallation {
|
|
|
366
366
|
created = null;
|
|
367
367
|
updated = null;
|
|
368
368
|
}
|
|
369
|
-
// packages/os-api/src/api/model/github/
|
|
370
|
-
class
|
|
369
|
+
// packages/os-api/src/api/model/github/GitHubToken.ts
|
|
370
|
+
class GitHubToken {
|
|
371
371
|
token = "";
|
|
372
372
|
expiresAt = 0;
|
|
373
|
+
}
|
|
374
|
+
// packages/os-api/src/api/model/github/GitHubRepoToken.ts
|
|
375
|
+
class GitHubRepoToken extends GitHubToken {
|
|
373
376
|
cloneUrl = "";
|
|
374
377
|
defaultBranch = "";
|
|
375
378
|
}
|
|
379
|
+
// packages/os-api/src/api/model/github/GitHubInstallCompletion.ts
|
|
380
|
+
class GitHubInstallCompletion {
|
|
381
|
+
installation;
|
|
382
|
+
returnTo = null;
|
|
383
|
+
}
|
|
376
384
|
// packages/os-api/src/api/model/KinoticProjectConfig.ts
|
|
377
385
|
class KinoticProjectConfig {
|
|
378
386
|
name;
|
|
@@ -626,6 +634,16 @@ class IamUserService extends CrudServiceProxy8 {
|
|
|
626
634
|
return this.serviceProxy.invoke("findFirstByEmailInScopeType", [email, authScopeType]);
|
|
627
635
|
}
|
|
628
636
|
}
|
|
637
|
+
// packages/os-api/src/api/services/IDeviceApprovalService.ts
|
|
638
|
+
class DeviceApprovalService {
|
|
639
|
+
serviceProxy;
|
|
640
|
+
constructor(kinotic) {
|
|
641
|
+
this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.iam.DeviceApprovalService");
|
|
642
|
+
}
|
|
643
|
+
approve(userCode) {
|
|
644
|
+
return this.serviceProxy.invoke("approve", [userCode]);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
629
647
|
// packages/os-api/src/api/services/IGitHubAppInstallationService.ts
|
|
630
648
|
import { CrudServiceProxy as CrudServiceProxy9 } from "@kinotic-ai/core";
|
|
631
649
|
|
|
@@ -633,8 +651,11 @@ class GitHubAppInstallationService extends CrudServiceProxy9 {
|
|
|
633
651
|
constructor(kinotic) {
|
|
634
652
|
super(kinotic.serviceProxy("org.kinotic.github.api.services.GitHubAppInstallationService"));
|
|
635
653
|
}
|
|
636
|
-
startInstall() {
|
|
637
|
-
return this.serviceProxy.invoke("startInstall", []);
|
|
654
|
+
startInstall(returnTo) {
|
|
655
|
+
return this.serviceProxy.invoke("startInstall", [returnTo]);
|
|
656
|
+
}
|
|
657
|
+
completeInstall(installationId, state) {
|
|
658
|
+
return this.serviceProxy.invoke("completeInstall", [installationId, state]);
|
|
638
659
|
}
|
|
639
660
|
findForCurrentOrg() {
|
|
640
661
|
return this.serviceProxy.invoke("findForCurrentOrg", []);
|
|
@@ -655,6 +676,7 @@ var OsApiPlugin = {
|
|
|
655
676
|
vmNodes: new VmNodeServiceProxy(kinotic),
|
|
656
677
|
workloads: new WorkloadServiceProxy(kinotic),
|
|
657
678
|
iamUsers: new IamUserService(kinotic),
|
|
679
|
+
deviceApproval: new DeviceApprovalService(kinotic),
|
|
658
680
|
githubAppInstallations: new GitHubAppInstallationService(kinotic)
|
|
659
681
|
};
|
|
660
682
|
}
|
|
@@ -698,7 +720,9 @@ export {
|
|
|
698
720
|
IamUserService,
|
|
699
721
|
IamUser,
|
|
700
722
|
GroupLoggerLevelsDescriptor,
|
|
701
|
-
|
|
723
|
+
GitHubToken,
|
|
724
|
+
GitHubRepoToken,
|
|
725
|
+
GitHubInstallCompletion,
|
|
702
726
|
GitHubAppInstallationService,
|
|
703
727
|
GitHubAppInstallation,
|
|
704
728
|
FlattenedDecorator,
|
|
@@ -707,6 +731,7 @@ export {
|
|
|
707
731
|
EntityDefinition,
|
|
708
732
|
EntityDecorator,
|
|
709
733
|
DiscriminatorDecorator,
|
|
734
|
+
DeviceApprovalService,
|
|
710
735
|
DataInsightsService,
|
|
711
736
|
AutoGeneratedIdDecorator,
|
|
712
737
|
AuthType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/os-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"rxjs": "^7.8.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@kinotic-ai/core": "1.
|
|
44
|
+
"@kinotic-ai/core": "1.3.1",
|
|
45
45
|
"@types/node": "^25.3.2",
|
|
46
46
|
"@vitest/coverage-v8": "^4.0.18",
|
|
47
47
|
"@vitest/runner": "^4.0.18",
|