Skip to content

Commit c247b59

Browse files
committed
update readme
1 parent 3b41e2e commit c247b59

File tree

4 files changed

+36
-18
lines changed

4 files changed

+36
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ Please use public-integration to implement your use case. If it is not listed th
1010

1111
# Installation
1212

13-
`yarn install @spring-media/ps-web-apis`
13+
`yarn install @axelspringer/ps-web-apis`
1414

1515
> **Note** Also needs [ps-rosetta](https://github.com/spring-media/ps-rosetta) to be present on the website:
1616
1717
```html
18-
<script type="text/javascript" src="https://rosetta.prod.ps.(welt|bild).de/ps-rosetta.js"></script>
18+
<script type="text/javascript" src="https://rosetta.prod.ps.(welt|bild|axelspringer).de/ps-rosetta.js"></script>
1919
```
2020

2121
# Basic Usage
2222

2323
```javascript
24-
import { whoamiV1 } from "@spring-media/ps-web-apis";
24+
import { whoamiV1 } from "@axelspringer/ps-web-apis";
2525

2626
whoamiV1()
2727
.then((whoami) => {

dist/ps-web-apis.cjs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ function waitingRoomV1() {
8484
function abV1() {
8585
return requirePackage("ab:v1");
8686
}
87+
function walletV1() {
88+
return requirePackage("wallet:v1");
89+
}
8790
function CligV1() {
8891
return requirePackage("ppclig:v1");
8992
}
@@ -100,4 +103,5 @@ exports.provideApi = provideApi;
100103
exports.requireApi = requireApi;
101104
exports.utilsV1 = utilsV1;
102105
exports.waitingRoomV1 = waitingRoomV1;
106+
exports.walletV1 = walletV1;
103107
exports.whoamiV1 = whoamiV1;

dist/ps-web-apis.d.ts

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface WhoamiUserInfo {
66
last_name?: string;
77
}
88
export interface PurchaseData {
9-
entitlements: [string];
9+
entitlements: string[];
1010
}
1111
export interface ServicePassportSuccessResponse {
1212
code: string;
@@ -30,13 +30,14 @@ export declare type FetchOptions = RequestInit & {
3030
retryStatusCodes?: number[];
3131
};
3232
export declare type WaitingRoomQueueDefault = "";
33-
export declare type WaitingRoomQueue = WaitingRoomQueueDefault | "auth" | "checkout" | "lefty-in-app-purchase";
33+
export declare type WaitingRoomQueue = WaitingRoomQueueDefault | "auth" | "checkout" | "lefty-in-app-purchase" | "logora";
3434
/**
3535
* Custom fetch interface which includes the possibility to customize timeouts for fetch requests
3636
*/
3737
export declare type Fetch = (input: RequestInfo, init?: FetchOptions) => Promise<Response>;
3838
export declare type GetRosettaEnvByKey = (key: string) => string | undefined;
3939
export declare type WaitForCapacity = (queue: WaitingRoomQueue) => Promise<void>;
40+
export declare type GetUserCreditBalance = () => Promise<number>;
4041
export declare type RegisterIframeMessageListener = (eventtype: string, listener: (event: any, iframe: HTMLIFrameElement) => void) => void;
4142
export interface WhoamiV1 {
4243
/**
@@ -147,20 +148,20 @@ export interface WhoamiV1 {
147148
/**
148149
* will render the Wonderwall in the given container with the given props and call the callback after main functionality is done
149150
*
150-
* @param container - The HTML element in which the Wonderwall should be rendered.
151-
* The container should be an HTML element.
152-
*
153-
* @param {Object} props - The props that should be passed, which will be passed to the auth component.
154-
* @param {String} props.template - valid choices are "register" and "login"
155-
* @param {String} props.variant - variant of the brand that should be shown e.g bild or welt
156-
* @param {boolean} [props.abortable] - user can leave auth screen if true (not yet implemented)
157-
* @param {String} [props.loginHeadline]
158-
* @param {String} [props.registerHeadline]
159-
* @param {String} [props.loginCta]
160-
* @param {String} [props.registerCta]
151+
* @param {Object} config - config container object
152+
* @param {HTMLElement} [config.container] - The HTML element in which the Wonderwall should be rendered in. default = overlay
153+
* @param {boolean} [config.inlineRender] - Renders Wonderwall directly in container instead of as overlay. default = false
154+
* @param {Object} config.props - The props which will be passed to the Wonderwall web component.
155+
* @param {String} config.props.template - valid choices are "register" and "login"
156+
* @param {String} config.props.variant - variant of the brand that should be shown e.g bild or welt
157+
* @param {boolean} [config.props.abortable] - user can leave auth screen if true (not yet implemented)
158+
* @param {String} [config.props.loginHeadline]
159+
* @param {String} [config.props.registerHeadline]
160+
* @param {String} [config.props.loginCta]
161+
* @param {String} [config.props.registerCta]
161162
*
162163
*/
163-
renderAuthComponent(container: HTMLElement, props: WonderwallProps): Promise<AuthRes>;
164+
renderAuthComponent(config: AuthComponentConfig): Promise<AuthRes>;
164165
/**
165166
* Retrieves a service passport for the specified service.
166167
* The passport is intended to be used for authenticated communication with the service.
@@ -186,9 +187,15 @@ export declare type WonderwallProps = {
186187
loginCta?: string;
187188
registerCta?: string;
188189
};
190+
export interface AuthComponentConfig {
191+
container?: HTMLElement;
192+
inlineRender?: boolean;
193+
props: WonderwallProps;
194+
}
189195
export interface UtilsV1 {
190196
fetchWithTimeout: Fetch;
191197
getRosettaEnvByKey: GetRosettaEnvByKey;
198+
getOverwritableRosettaEnvByKey: GetRosettaEnvByKey;
192199
registerIframeMessageListener: RegisterIframeMessageListener;
193200
}
194201
export interface AbV1 {
@@ -200,6 +207,9 @@ export interface AbV1 {
200207
export interface WaitingRoomV1 {
201208
waitForCapacity: WaitForCapacity;
202209
}
210+
export interface WalletV1 {
211+
getUserCreditBalance: GetUserCreditBalance;
212+
}
203213
export declare type ILayer = "privacy" | "reject";
204214
export declare type IApp = "offerpage" | "checkout" | "cancellation";
205215
export declare type ITenant = "welt" | "bild";
@@ -231,6 +241,7 @@ export declare function whoamiV1(): Promise<WhoamiV1>;
231241
export declare function utilsV1(): Promise<UtilsV1>;
232242
export declare function waitingRoomV1(): Promise<WaitingRoomV1>;
233243
export declare function abV1(): Promise<AbV1>;
244+
export declare function walletV1(): Promise<WalletV1>;
234245
export declare function CligV1(): Promise<ICligV1>;
235246
export declare function CligV2(): Promise<ICligV2>;
236247
export declare const provideApi: typeof provide;

dist/ps-web-apis.esm.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ function waitingRoomV1() {
8080
function abV1() {
8181
return requirePackage("ab:v1");
8282
}
83+
function walletV1() {
84+
return requirePackage("wallet:v1");
85+
}
8386
function CligV1() {
8487
return requirePackage("ppclig:v1");
8588
}
@@ -89,4 +92,4 @@ function CligV2() {
8992
var provideApi = provide;
9093
var requireApi = requirePackage;
9194

92-
export { CligV1, CligV2, abV1, provideApi, requireApi, utilsV1, waitingRoomV1, whoamiV1 };
95+
export { CligV1, CligV2, abV1, provideApi, requireApi, utilsV1, waitingRoomV1, walletV1, whoamiV1 };

0 commit comments

Comments
 (0)