@salla.sa/twilight 2.5.0 → 2.6.0
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/dist/@salla.sa/twilight.min.js +2 -2
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/types/api/index.d.ts +2 -0
- package/types/api/loyalty.d.ts +4 -3
- package/types/event/index.d.ts +5 -1
- package/types/event/loyalty.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
51
51
|
"babel-loader": "^8.2.5",
|
|
52
52
|
"glob": "^8.0.3",
|
|
53
|
-
"rollup": "^2.
|
|
53
|
+
"rollup": "^2.78.0",
|
|
54
54
|
"rollup-plugin-cleaner": "^1.0.0",
|
|
55
55
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
56
56
|
"rollup-plugin-terser": "^7.0.2",
|
package/types/api/index.d.ts
CHANGED
package/types/api/loyalty.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {SuccessResponse} from '../common'
|
|
1
|
+
import { SuccessResponse } from '../common'
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
export interface Loyalty {
|
|
@@ -54,12 +54,12 @@ export interface Condition {
|
|
|
54
54
|
key: string;
|
|
55
55
|
points: number;
|
|
56
56
|
condition: null | string;
|
|
57
|
-
value?: 'fixed_amount'|'total_order';
|
|
57
|
+
value?: 'fixed_amount' | 'total_order';
|
|
58
58
|
op: string;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export interface Prize {
|
|
62
|
-
type: string|'free_shipping'|'free_product'|'coupon';
|
|
62
|
+
type: string | 'free_shipping' | 'free_product' | 'coupon';
|
|
63
63
|
title: string;
|
|
64
64
|
items: Item[];
|
|
65
65
|
}
|
|
@@ -222,4 +222,5 @@ export namespace LoyaltyApiResponse {
|
|
|
222
222
|
export default interface LoyaltyApi {
|
|
223
223
|
getProgram: () => Promise<LoyaltyApiResponse.program>
|
|
224
224
|
exchange: (prize_id: number, cart_id?: number) => Promise<LoyaltyApiResponse.point>
|
|
225
|
+
reset: () => Promise<SuccessResponse>
|
|
225
226
|
}
|
package/types/event/index.d.ts
CHANGED
|
@@ -56,6 +56,10 @@ export type EventName = string
|
|
|
56
56
|
| 'gift::buying.failed'
|
|
57
57
|
| 'loyalty::exchange.succeeded'
|
|
58
58
|
| 'loyalty::exchange.failed'
|
|
59
|
+
| 'loyalty::program.fetched'
|
|
60
|
+
| 'loyalty::program.not.fetched'
|
|
61
|
+
| 'loyalty::reset.succeeded'
|
|
62
|
+
| 'loyalty::reset.failed'
|
|
59
63
|
| 'order::canceled'
|
|
60
64
|
| 'order::not.canceled'
|
|
61
65
|
| 'order::re.ordered'
|
|
@@ -153,4 +157,4 @@ export default interface SallaEvent extends EventEmitter2 {
|
|
|
153
157
|
on(event: EventName, listener: (...values: any[]) => void, options?: boolean | Object): this;
|
|
154
158
|
|
|
155
159
|
once(event: EventName, listener: (...values: any[]) => void, options?: boolean | Object): this;
|
|
156
|
-
}
|
|
160
|
+
}
|
package/types/event/loyalty.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequestErrorEvent } from "../common";
|
|
1
|
+
import { RequestErrorEvent, SuccessResponse } from "../common";
|
|
2
2
|
import { LoyaltyApiResponse } from '../api/loyalty'
|
|
3
3
|
|
|
4
4
|
export default interface LoyaltyEvent {
|
|
@@ -8,4 +8,7 @@ export default interface LoyaltyEvent {
|
|
|
8
8
|
// Point
|
|
9
9
|
onExchangeFetched: (callback: (response: LoyaltyApiResponse.point, prod_id: number) => void) => void;
|
|
10
10
|
onExchangeFetchFailed: RequestErrorEvent;
|
|
11
|
+
// Reset Exchange
|
|
12
|
+
onResetSucceeded: (callback: (response: SuccessResponse) => void) => void;
|
|
13
|
+
onResetFailed: RequestErrorEvent
|
|
11
14
|
}
|