Skip to content

Commit 4d30902

Browse files
initial commit
1 parent 5709d07 commit 4d30902

File tree

2,080 files changed

+206410
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,080 files changed

+206410
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
name: Publish Node Fetch Session Package
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build:
10+
if: startsWith(github.ref, 'refs/tags/prod-')
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 14
17+
- run: npm install
18+
19+
publish-npm:
20+
needs: build
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-node@v2
25+
with:
26+
node-version: 14
27+
registry-url: https://registry.npmjs.org/
28+
- run: npm install
29+
- run: npm publish --access public
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Whitespace-only changes.

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/node_modules/
2+
*.DS_Store
3+
*.log
4+
/.vscode/
5+
/.github/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- add Readme Here -->

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var lambdaSessionClient = require("./lib/fetch_sessions_client");
2+
module.exports = {
3+
FetchSessionClient: lambdaSessionClient.FetchSession,
4+
};

lib/fetch_sessions_client.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const ltClient = require("@lambdatest/node-rest-client");
2+
3+
module.exports = {
4+
FetchSession: function (options) {
5+
// read credentials from env
6+
const autoClient = ltClient.AutomationClient({
7+
username: process.env.LT_USERNAME,
8+
accessKey: process.env.LT_ACCESS_KEY,
9+
});
10+
11+
if (!autoClient.username || !autoClient.accessKey){
12+
console.error("User name and Access is required")
13+
return
14+
}
15+
16+
// read build name from env
17+
if (!process.env.LT_BUILD){
18+
console.error("Build name is required")
19+
}
20+
21+
if (!options){
22+
// using default options
23+
options = {
24+
buildLimt: 20,
25+
buildName: process.env.LT_BUILD,
26+
sessionParams: {
27+
limit: 10000,
28+
},
29+
}
30+
}
31+
const data = await autoClient.getSessionsOfBuild(options);
32+
console.log(JSON.stringify(data));
33+
return
34+
35+
},
36+
};

node_modules/.bin/sshpk-conv

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/sshpk-sign

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/sshpk-verify

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/uuid

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)