@leatcom/portal-sessions 0.0.76 → 0.0.77-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -8
- package/dist/portal-sessions.es.d.ts +6 -60
- package/dist/portal-sessions.es.js +28081 -28552
- package/dist/portal-sessions.umd.js +71 -71
- package/dist/style.css +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
# Portal Sessions by Leat | Piggy
|
|
2
2
|
|
|
3
|
-
This is the Javascript SDK for integrating with Leat | Piggy using Portal Sessions. Sign up for a free Leat | Piggy
|
|
3
|
+
This is the Javascript SDK for integrating with Leat | Piggy using Portal Sessions. Sign up for a free Leat | Piggy
|
|
4
|
+
account [here](https://business.piggy.eu/sign-up).
|
|
4
5
|
|
|
5
|
-
More information on Portal Sessions and their specific API calls can be found on
|
|
6
|
+
More information on Portal Sessions and their specific API calls can be found on
|
|
7
|
+
the [API Documentation](https://docs.piggy.eu/v3/oauth/portal-sessions).
|
|
6
8
|
|
|
7
9
|
## Installation
|
|
8
10
|
|
|
9
11
|
Install using
|
|
12
|
+
|
|
10
13
|
```
|
|
11
14
|
npm install @leatcom/portal-sessions
|
|
12
15
|
```
|
|
16
|
+
|
|
13
17
|
```
|
|
14
18
|
yarn add @leatcom/portal-sessions
|
|
15
19
|
```
|
|
@@ -18,13 +22,19 @@ yarn add @leatcom/portal-sessions
|
|
|
18
22
|
|
|
19
23
|
* [API Documentation & Reference](https://docs.piggy.eu)
|
|
20
24
|
|
|
21
|
-
|
|
22
25
|
## Usage
|
|
23
26
|
|
|
24
|
-
Portal Sessions come in different types, each with their own use. To initiate a Portal Sessions, an API key is required,
|
|
27
|
+
Portal Sessions come in different types, each with their own use. To initiate a Portal Sessions, an API key is required,
|
|
28
|
+
which can be created in your [account's Dashboard](https://business.piggy.eu). A Portal BaseSession is also always
|
|
29
|
+
created for
|
|
30
|
+
a specific `Shop`, so the `shopUuid` is also required. You can find a Shop's UUID in
|
|
31
|
+
your [Dashboard](https://business.piggy.eu/settings/shop-management/shops?tab=profiles) or
|
|
32
|
+
by [API](https://docs.piggy.eu/v3/oauth/shops).
|
|
25
33
|
|
|
26
|
-
Currently, there are five Portal
|
|
27
|
-
|
|
34
|
+
Currently, there are five Portal BaseSession types:
|
|
35
|
+
|
|
36
|
+
* `PORTAL`: This is the 'default' session type, which doesn't have a predefined aim, but rather allows for flexible use.
|
|
37
|
+
See this as a way for customers to login to their own portal.
|
|
28
38
|
* `REDEEM_GIFTCARD`: A session to use and redeem gift card(s). Best used as payment option.
|
|
29
39
|
* `TOP_UP_GIFTCARD`: A session to sell and/or top up existing gift cards.
|
|
30
40
|
* `PAY_PREPAID`: A session to handle prepaid transactions.
|
|
@@ -32,7 +42,8 @@ Currently, there are five Portal Session types:
|
|
|
32
42
|
* `POINTS_TRANSACTION`: A session to handle an order and a subsequent credit reception.
|
|
33
43
|
* `VOUCHER`: A session to redeem vouchers.
|
|
34
44
|
|
|
35
|
-
Initiate a new Portal
|
|
45
|
+
Initiate a new Portal BaseSession as follows:
|
|
46
|
+
|
|
36
47
|
```
|
|
37
48
|
<PortalSession
|
|
38
49
|
apiKey={apiKey}
|
|
@@ -42,7 +53,7 @@ Initiate a new Portal Session as follows:
|
|
|
42
53
|
/>
|
|
43
54
|
```
|
|
44
55
|
|
|
45
|
-
## Portal
|
|
56
|
+
## Portal BaseSession Props
|
|
46
57
|
|
|
47
58
|
| Prop | Type | Required | Description |
|
|
48
59
|
|-------------------------------|--------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------|
|
|
@@ -63,6 +74,7 @@ Initiate a new Portal Session as follows:
|
|
|
63
74
|
## Types
|
|
64
75
|
|
|
65
76
|
`PortalType`
|
|
77
|
+
|
|
66
78
|
```javascript
|
|
67
79
|
export enum PortalType {
|
|
68
80
|
REDEEM_GIFTCARD = "REDEEM_GIFTCARD",
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
-
import { ReactElement } from 'react';
|
|
3
|
-
|
|
4
|
-
declare type Attribute = {
|
|
5
|
-
attribute: {
|
|
6
|
-
field_type: string;
|
|
7
|
-
id: number;
|
|
8
|
-
is_hard_read_only: boolean;
|
|
9
|
-
is_soft_read_only: boolean;
|
|
10
|
-
label: string;
|
|
11
|
-
name: string;
|
|
12
|
-
options: [];
|
|
13
|
-
type: any;
|
|
14
|
-
};
|
|
15
|
-
value: string;
|
|
16
|
-
};
|
|
17
2
|
|
|
18
3
|
export declare type ContactResource = {
|
|
19
|
-
id: number;
|
|
20
4
|
uuid: string;
|
|
21
5
|
email: string;
|
|
22
|
-
attributes: Array<Attribute>;
|
|
23
|
-
tier: Tier | null;
|
|
24
|
-
subscriptions: Array<Subscription>;
|
|
25
6
|
credit_balance: CreditBalance;
|
|
26
7
|
prepaid_balance: PrepaidBalance;
|
|
27
|
-
current_values: { [key: string]: string | number };
|
|
28
8
|
current_display_values: { [key: string]: string };
|
|
29
9
|
};
|
|
30
10
|
|
|
@@ -33,13 +13,6 @@ declare type CreditBalance = {
|
|
|
33
13
|
id: number;
|
|
34
14
|
};
|
|
35
15
|
|
|
36
|
-
export declare function DefaultSession({ uuid, host }: DefaultSessionProps): JSX_2.Element;
|
|
37
|
-
|
|
38
|
-
declare type DefaultSessionProps = {
|
|
39
|
-
uuid: string;
|
|
40
|
-
host?: string;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
16
|
export declare enum FacingMode {
|
|
44
17
|
USER = "user",
|
|
45
18
|
ENVIRONMENT = "environment",
|
|
@@ -69,10 +42,10 @@ declare type Media = {
|
|
|
69
42
|
value: string;
|
|
70
43
|
};
|
|
71
44
|
|
|
72
|
-
export declare function PortalSession(props: PortalSessionProps):
|
|
45
|
+
export declare function PortalSession(props: PortalSessionProps): JSX_2.Element;
|
|
73
46
|
|
|
74
47
|
declare type PortalSessionProps = {
|
|
75
|
-
type?:
|
|
48
|
+
type?: PortalType;
|
|
76
49
|
host?: string;
|
|
77
50
|
apiKey: string;
|
|
78
51
|
shopUuid: string;
|
|
@@ -107,7 +80,7 @@ declare type PrepaidBalance = {
|
|
|
107
80
|
balance_in_cents: number;
|
|
108
81
|
};
|
|
109
82
|
|
|
110
|
-
declare enum PrimaryIdentificationMethod {
|
|
83
|
+
export declare enum PrimaryIdentificationMethod {
|
|
111
84
|
IDENTIFIER = "identifier",
|
|
112
85
|
EMAIL = "email",
|
|
113
86
|
}
|
|
@@ -134,38 +107,11 @@ export declare type RewardResource = {
|
|
|
134
107
|
stock: number;
|
|
135
108
|
} & { [attributeKey: string]: string | number | boolean };
|
|
136
109
|
|
|
137
|
-
declare
|
|
138
|
-
is_subscribed: boolean;
|
|
139
|
-
status: SubscriptionStatus;
|
|
140
|
-
subscription_type: {
|
|
141
|
-
active: boolean;
|
|
142
|
-
description: string;
|
|
143
|
-
id: number;
|
|
144
|
-
name: string;
|
|
145
|
-
strategy: SubscriptionStrategy;
|
|
146
|
-
uuid: string;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
110
|
+
export declare function UuidSession({ uuid }: UuidSessionProps): JSX_2.Element;
|
|
149
111
|
|
|
150
|
-
declare
|
|
151
|
-
SUBSCRIBED = "SUBSCRIBED",
|
|
152
|
-
UNSUBSCRIBED = "UNSUBSCRIBED",
|
|
153
|
-
PENDING_CONFIRMATION = "PENDING_CONFIRMATION",
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
declare enum SubscriptionStrategy {
|
|
157
|
-
OPT_OUT = "OPT_OUT",
|
|
158
|
-
OPT_IN = "OPT_IN",
|
|
159
|
-
DOUBLE_OPT_IN = "DOUBLE_OPT_IN",
|
|
160
|
-
FUNCTIONAL = "FUNCTIONAL",
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
declare type Tier = {
|
|
164
|
-
description: string;
|
|
165
|
-
// media:
|
|
166
|
-
name: string;
|
|
167
|
-
position: number;
|
|
112
|
+
declare type UuidSessionProps = {
|
|
168
113
|
uuid: string;
|
|
114
|
+
host?: string;
|
|
169
115
|
};
|
|
170
116
|
|
|
171
117
|
export declare type VoucherResource = {
|