@salla.sa/twilight 2.9.12 → 2.9.19
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 +3 -3
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/types/api/booking.d.ts +21 -0
- package/types/api/index.d.ts +9 -5
- package/types/event/booking.d.ts +7 -0
- package/types/event/index.d.ts +4 -1
- package/watcher.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.19",
|
|
4
4
|
"description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"homepage": "https://salla.dev",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@salla.sa/base": "^2.9.
|
|
35
|
-
"@salla.sa/twilight-tailwind-theme": "^2.9.
|
|
34
|
+
"@salla.sa/base": "^2.9.19",
|
|
35
|
+
"@salla.sa/twilight-tailwind-theme": "^2.9.13",
|
|
36
36
|
"axios": "^0.27.2",
|
|
37
37
|
"infinite-scroll": "^4.0.1",
|
|
38
38
|
"jwt-decode": "^3.1.2",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"webpack": "^4 || ^5"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "0e9ff15d75f2a279cc8de60dcc0e5a81dc33b87d"
|
|
65
65
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SuccessResponse } from '../common'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface RedirectPayload {
|
|
5
|
+
to: 'login' | 'booking',
|
|
6
|
+
url: null | string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Booking {
|
|
10
|
+
redirect: RedirectPayload
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export namespace BookingApiResponse {
|
|
14
|
+
export interface add extends SuccessResponse {
|
|
15
|
+
data: Booking
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default interface BookingApi {
|
|
20
|
+
add: (productId: number) => Promise<BookingApiResponse.add>
|
|
21
|
+
}
|
package/types/api/index.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ import CurrencyApi from "./currency";
|
|
|
10
10
|
import DocumentApi from "./document";
|
|
11
11
|
import WishlistApi from "./wishlist";
|
|
12
12
|
import ScopeApi from "./scope";
|
|
13
|
-
import
|
|
13
|
+
import BookingApi, { Booking } from "./booking";
|
|
14
|
+
import { ErrorResponse, SuccessResponse } from "@salla.sa/base/types/common";
|
|
14
15
|
|
|
15
16
|
export {
|
|
16
17
|
CartApi,
|
|
@@ -25,6 +26,7 @@ export {
|
|
|
25
26
|
DocumentApi,
|
|
26
27
|
WishlistApi,
|
|
27
28
|
ScopeApi,
|
|
29
|
+
BookingApi,
|
|
28
30
|
};
|
|
29
31
|
export type ApiActionName =
|
|
30
32
|
'auth.login'
|
|
@@ -73,7 +75,8 @@ export type ApiActionName =
|
|
|
73
75
|
| 'scope.get'
|
|
74
76
|
| 'scope.change'
|
|
75
77
|
| 'scope.getProductAvailability'
|
|
76
|
-
| 'withoutNotifier'
|
|
78
|
+
| 'withoutNotifier'
|
|
79
|
+
| 'booking.add';
|
|
77
80
|
|
|
78
81
|
export default interface Api {
|
|
79
82
|
cart: CartApi;
|
|
@@ -88,6 +91,7 @@ export default interface Api {
|
|
|
88
91
|
document: DocumentApi;
|
|
89
92
|
wishlist: WishlistApi;
|
|
90
93
|
scope: ScopeApi;
|
|
94
|
+
booking: BookingApi;
|
|
91
95
|
withoutNotifier: (callback: Function) => Promise<void>;
|
|
92
96
|
getHeaders: () => {
|
|
93
97
|
Accept: string | 'application/json, text/plain, */*',
|
|
@@ -99,9 +103,9 @@ export default interface Api {
|
|
|
99
103
|
Authorization?: string
|
|
100
104
|
}
|
|
101
105
|
request(endPoint: string, formData: undefined | object, method: string, options: object): Promise<any>
|
|
102
|
-
handleAfterResponseActions(response: SuccessResponse|ErrorResponse|any): void;
|
|
103
|
-
fireEventsForResponse(response: SuccessResponse|ErrorResponse|any): void;
|
|
104
|
-
showAlert(response: SuccessResponse|ErrorResponse|any): void;
|
|
106
|
+
handleAfterResponseActions(response: SuccessResponse | ErrorResponse | any): void;
|
|
107
|
+
fireEventsForResponse(response: SuccessResponse | ErrorResponse | any): void;
|
|
108
|
+
showAlert(response: SuccessResponse | ErrorResponse | any): void;
|
|
105
109
|
handleErrorResponse(error: object): void;
|
|
106
110
|
handleInvalidFields(error: object): void;
|
|
107
111
|
errorPromise(data: any): Promise<any>;
|
package/types/event/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import DocumentEvent from "./document";
|
|
|
11
11
|
import WishlistEvent from "./wishlist";
|
|
12
12
|
import InfiniteScrollEvent from "./infiniteScroll";
|
|
13
13
|
import ScopeEvents from "./scope";
|
|
14
|
+
import BookingEvent from "./booking";
|
|
14
15
|
import Emitter from "@salla.sa/base/types/event";
|
|
15
16
|
|
|
16
17
|
export type event = (symbol | string);
|
|
@@ -29,6 +30,7 @@ export {
|
|
|
29
30
|
WishlistEvent,
|
|
30
31
|
InfiniteScrollEvent,
|
|
31
32
|
ScopeEvents,
|
|
33
|
+
BookingEvent,
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export default interface TwilightEmitter extends Emitter {
|
|
@@ -43,6 +45,7 @@ export default interface TwilightEmitter extends Emitter {
|
|
|
43
45
|
currency: CurrencyEvent;
|
|
44
46
|
document: DocumentEvent;
|
|
45
47
|
wishlist: WishlistEvent;
|
|
46
|
-
scope: ScopeEvents
|
|
48
|
+
scope: ScopeEvents;
|
|
49
|
+
booking: BookingEvent;
|
|
47
50
|
infiniteScroll: InfiniteScrollEvent;
|
|
48
51
|
}
|
package/watcher.js
CHANGED
|
@@ -125,7 +125,7 @@ class WatcherPlugin {
|
|
|
125
125
|
getEntry() {
|
|
126
126
|
let viewsPath = path.join(process.cwd(), "src/views");
|
|
127
127
|
return this.isWin && this.isWebpack5
|
|
128
|
-
? viewsPath
|
|
128
|
+
? glob.sync(path.join(viewsPath, "**/*.twig").replace(/\\/g, "/"), {absolute: true}).map((file)=>file.replace(/\//g, "\\"))
|
|
129
129
|
: glob.sync(path.join(viewsPath, "**/*.twig"), {absolute: true});
|
|
130
130
|
}
|
|
131
131
|
|