Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add Get FME Info activity #42

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/activities/CreateFmeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class CreateFmeService implements IActivityHandler {
return {
service: {
server: FMEServer,
url,
url: normalizedUrl,
},
};
} else if (username && password) {
Expand Down
54 changes: 54 additions & 0 deletions src/activities/GetFmeInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import type { IActivityHandler } from "@geocortex/workflow/runtime/IActivityHandler";
import { FmeService } from "../FmeService";

export interface GetFmeInfoInputs {
/**
* @displayName FME Service
* @description The FME service.
* @required
*/
service: FmeService;
}

export interface GetFmeInfoOutputs {
/**
* @description The FME server information.
*/
result: {
build?: string;
currentTime?: string;
licenseManagement?: boolean;
timeZone?: string;
version?: string;
};
}

/**
* @displayName Get FME Info
* @category FME
* @description Retrieves build, version and time information about the FME server.
* @clientOnly
* @supportedApps EXB, GWV, GVH, WAB
*/
export class GetFmeInfo implements IActivityHandler {
async execute(inputs: GetFmeInfoInputs): Promise<GetFmeInfoOutputs> {
const { service } = inputs;
if (!service) {
throw new Error("service is required");
}

return new Promise((resolve) => {
service.server.customRequest(
`${service.url}/fmerest/v3/info`,
"GET",
(result) => {
return resolve({
result,
});
},
"",
"application/x-www-form-urlencoded"
);
});
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Activities will be re-exported from this file.
export * from "./activities/CheckFmeJobStatus";
export * from "./activities/CreateFmeService";
export * from "./activities/GetFmeInfo";
export * from "./activities/GetFmeWorkspaceParameters";
export * from "./activities/RunFmeDataDownload";
export * from "./activities/RunFmeJob";
Expand Down