-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7162cb4
commit 506aed6
Showing
9 changed files
with
1,408 additions
and
794 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { QlikSaaSClient } from "qlik-rest-api"; | ||
|
||
export interface IAutomationConnection { | ||
/** | ||
* The unique identifier of an automation connection. | ||
*/ | ||
id: string; | ||
/** | ||
* The name of an automation connection. | ||
*/ | ||
name: string; | ||
/** | ||
* The unique identifier of the owner of the automation connection. | ||
*/ | ||
ownerId: string; | ||
/** | ||
* The timestamp when the automation connection is created. | ||
*/ | ||
createdAt: string; | ||
/** | ||
* The timestamp when the automation connection is updated. | ||
*/ | ||
updatedAt: string; | ||
/** | ||
* The unique identifier of the connector the automation connection is created from. | ||
*/ | ||
connectorId: string; | ||
/** | ||
* Returns true if the automation connection is connected. | ||
*/ | ||
isConnected: boolean; | ||
} | ||
|
||
export class AutomationConnection { | ||
#id: string; | ||
#saasClient: QlikSaaSClient; | ||
details: IAutomationConnection; | ||
constructor( | ||
saasClient: QlikSaaSClient, | ||
id: string, | ||
details?: IAutomationConnection | ||
) { | ||
if (!id) | ||
throw new Error(`automationConnection.get: "id" parameter is required`); | ||
|
||
this.details = details ?? ({} as IAutomationConnection); | ||
this.#id = id; | ||
this.#saasClient = saasClient; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { QlikSaaSClient } from "qlik-rest-api"; | ||
import { | ||
AutomationConnection, | ||
IAutomationConnection, | ||
} from "./AutomationConnection"; | ||
|
||
export class AutomationConnections { | ||
#saasClient: QlikSaaSClient; | ||
constructor(saasClient: QlikSaaSClient) { | ||
this.#saasClient = saasClient; | ||
} | ||
|
||
async getAll( | ||
/** | ||
* One of (default is "id"): | ||
* | ||
* id | ||
* | ||
* name | ||
* | ||
* createdAt | ||
* | ||
* updatedAt | ||
* | ||
* +id | ||
* | ||
* +name | ||
* | ||
* +createdAt | ||
* | ||
* +updatedAt | ||
* | ||
* -id | ||
* | ||
* -name | ||
* | ||
* -createdAt | ||
* | ||
* -updatedAt | ||
*/ | ||
sortBy?: string | ||
) { | ||
const sortByUrlParam = sortBy ? `&sort=${sortBy}` : ""; | ||
|
||
return await this.#saasClient | ||
.Get<IAutomationConnection[]>( | ||
`automation-connections?limit=50${sortByUrlParam}` | ||
) | ||
.then((res) => res.data) | ||
.then((data) => { | ||
return data.map( | ||
(t) => new AutomationConnection(this.#saasClient, t.id, t) | ||
); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters