Skip to content

Commit cecaa8c

Browse files
Merge pull request #3 from Shivanshu-lambdatest/master
Added support for app automation
2 parents ff18193 + 7e1e849 commit cecaa8c

File tree

4 files changed

+42
-5
lines changed

4 files changed

+42
-5
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 Rest Client 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}}

lib/api_client.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { version, baseUrl } = require("./config");
1+
const { version, appVersion, baseUrl, baseUrlApp } = require("./config");
22

33
var request = require("request"),
44
logger,
@@ -34,6 +34,10 @@ var ApiClient = function(settings) {
3434
"base64"
3535
);
3636
ApiClient.settings = settings;
37+
38+
if (settings.isApp) {
39+
ApiClient.baseUrl = baseUrlApp + appVersion.latestVersion;
40+
}
3741
};
3842

3943
/**
@@ -81,4 +85,4 @@ ApiClient.request = function(options, fnCallback) {
8185
}
8286
};
8387

84-
module.exports = ApiClient;
88+
module.exports = ApiClient;

lib/config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module.exports = {
22
version: {"latestVersion": "v1", "supportedVersions": ["v1"]},
3-
baseUrl: "https://api.lambdatest.com/automation/api/"
4-
};
3+
appVersion : {"latestVersion": "v1", "supportedVersions": ["v1"]},
4+
baseUrl: "https://api.lambdatest.com/automation/api/",
5+
baseUrlApp : "https://mobile-api.lambdatest.com/mobile-automation/api/"
6+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/node-rest-client",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "LambdaTest Rest Client for Node.js",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)