Skip to content

Commit d30e07f

Browse files
Merge pull request #13 from spring-media/userinfo
SPR-4700: add userinfo a new function
2 parents bbf0ce0 + 18a12db commit d30e07f

File tree

7 files changed

+57
-41
lines changed

7 files changed

+57
-41
lines changed

.github/workflows/pull_request.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@ jobs:
1818
- name: Checkout branch
1919
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
2020
uses: actions/checkout@master
21+
22+
- name: Set Node.js 10.x
23+
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: '10.x'
2127

2228
- name: Install npm
2329
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
24-
uses: actions/npm@master
25-
with:
26-
args: install
30+
run: npm install
2731

28-
- name: Npm check
32+
- name: Npm format-check
2933
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
30-
uses: actions/npm@master
31-
with:
32-
args: run check --if-present
34+
run: npm run check
3335

3436
build:
3537
name: Build
@@ -52,20 +54,20 @@ jobs:
5254
git config --global user.email "[email protected]"
5355
git merge ${{ github.event.pull_request.head.sha }} -m"prchecker" --stat
5456
55-
- name: Install npm
57+
- name: Set Node.js 10.x
5658
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
57-
uses: actions/npm@master
59+
uses: actions/setup-node@v1
5860
with:
59-
args: install
61+
node-version: '10.x'
62+
63+
- name: Install npm
64+
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
65+
run: npm install
6066

6167
- name: Test npm
6268
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
63-
uses: actions/npm@master
64-
with:
65-
args: run test
69+
run: npm run test
6670

6771
- name: Build npm
6872
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize'
69-
uses: actions/npm@master
70-
with:
71-
args: run build
73+
run: npm run build

.github/workflows/push_master.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ jobs:
1212
- name: Checkout branch
1313
uses: actions/checkout@master
1414

15-
- name: Install npm
16-
uses: actions/npm@master
15+
- name: Set Node.js 10.x
16+
uses: actions/setup-node@v1
1717
with:
18-
args: install
18+
node-version: '10.x'
1919

20-
- name: Npm check
21-
uses: actions/npm@master
22-
with:
23-
args: run check --if-present
20+
- name: Install npm
21+
run: npm install
22+
23+
- name: Npm format-check
24+
run: npm run check --if-present
2425

2526
build:
2627
name: Build
@@ -29,18 +30,16 @@ jobs:
2930
- name: Checkout branch
3031
uses: actions/checkout@master
3132

33+
- name: Set Node.js 10.x
34+
uses: actions/setup-node@v1
35+
with:
36+
node-version: '10.x'
3237

3338
- name: Install npm
34-
uses: actions/npm@master
35-
with:
36-
args: install
39+
run: npm install
3740

3841
- name: Test npm
39-
uses: actions/npm@master
40-
with:
41-
args: run test
42+
run: npm run test
4243

4344
- name: Build npm
44-
uses: actions/npm@master
45-
with:
46-
args: run build
45+
run: npm run build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ps-web-apis is a client side library to interface with ps services on ps support
44

55
# Installation
66

7-
`npm install --save github:spring-media/ps-web-apis#v1.4.0`
7+
`npm install --save github:spring-media/ps-web-apis#v1.6.0`
88

99
# Usage
1010

dist/ps-web-apis.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
export interface WhoamiUserInfo {
2+
user_id: string;
3+
first_name?: string;
4+
last_name?: string;
5+
}
16
export interface WhoamiV1 {
27
/**
38
* will assert valid not outdated session before fetch will be done. backend credentials will be added automatically
@@ -33,5 +38,10 @@ export interface WhoamiV1 {
3338
* will update access token and therefore content entitlements to current state
3439
*/
3540
forceAccessTokenRefresh(): Promise<void>;
41+
/**
42+
* will request userinfo from whoami backend
43+
* @return {WhoamiUserInfo} some relevant userdata
44+
*/
45+
getUserInfo(): Promise<WhoamiUserInfo>;
3646
}
3747
export declare function whoamiV1(): Promise<WhoamiV1>;

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ps-web-apis",
3-
"version": "1.0.0",
3+
"version": "1.6.0",
44
"description": "",
55
"main": "dist/ps-web-apis.cjs.js",
66
"module": "dist/ps-web-apis.esm.js",

src/ps-web-apis.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ function requireApi<T>(name: string): Promise<T> {
3737
});
3838
}
3939

40+
export interface WhoamiUserInfo {
41+
user_id: string;
42+
first_name?: string;
43+
last_name?: string;
44+
}
45+
4046
export interface WhoamiV1 {
4147
/**
4248
* will assert valid not outdated session before fetch will be done. backend credentials will be added automatically
@@ -72,6 +78,11 @@ export interface WhoamiV1 {
7278
* will update access token and therefore content entitlements to current state
7379
*/
7480
forceAccessTokenRefresh(): Promise<void>;
81+
/**
82+
* will request userinfo from whoami backend
83+
* @return {WhoamiUserInfo} some relevant userdata
84+
*/
85+
getUserInfo(): Promise<WhoamiUserInfo>;
7586
}
7687

7788
export function whoamiV1(): Promise<WhoamiV1> {

0 commit comments

Comments
 (0)