@salla.sa/twilight 2.12.54 → 2.12.64
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 +6 -6
- package/types/api/advertisement.ts +42 -0
- package/types/event/advertisement.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.64",
|
|
4
4
|
"description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "npx rollup --config --preserveSymlinks=true",
|
|
10
10
|
"watch": "npx rollup --watch --config --preserveSymlinks=true",
|
|
11
|
-
"test": "
|
|
11
|
+
"test": "jest --detectOpenHandles -- advertisement.test",
|
|
12
12
|
"express": "node tests/server/index.js"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"homepage": "https://salla.dev",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@salla.sa/base": "^2.12.
|
|
36
|
+
"@salla.sa/base": "^2.12.64",
|
|
37
37
|
"axios": "^0.27.2",
|
|
38
38
|
"infinite-scroll": "^4.0.1",
|
|
39
39
|
"jwt-decode": "^3.1.2",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@babel/core": "^7.18.10",
|
|
45
45
|
"@babel/preset-env": "^7.18.10",
|
|
46
|
-
"@rollup/plugin-babel": "^
|
|
46
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
47
47
|
"@rollup/plugin-commonjs": "^25.0.4",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
49
|
-
"babel-loader": "^
|
|
49
|
+
"babel-loader": "^9.1.3",
|
|
50
50
|
"form-data": "^4.0.0",
|
|
51
51
|
"jest": "^29.3.1",
|
|
52
52
|
"jest-environment-jsdom": "^29.3.1",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"webpack": "^4 || ^5"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "bb9279af324e38f9e4b4f3d1caa34bbf418a7c5a"
|
|
71
71
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {SuccessResponse} from '../common'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface Advertisement {
|
|
5
|
+
id?: number;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
type?: Type;
|
|
9
|
+
style?: Style;
|
|
10
|
+
expire_date?: ExpireDate;
|
|
11
|
+
pages?: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ExpireDate {
|
|
15
|
+
date?: Date;
|
|
16
|
+
timezone_type?: number;
|
|
17
|
+
timezone?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface Style {
|
|
21
|
+
icon?: string;
|
|
22
|
+
font_color?: string;
|
|
23
|
+
background_color?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Type {
|
|
27
|
+
id?: number;
|
|
28
|
+
name?: string;
|
|
29
|
+
link?: string;
|
|
30
|
+
url?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export namespace AdvertisementApiResponse {
|
|
35
|
+
export interface fetch extends SuccessResponse {
|
|
36
|
+
data: Advertisement
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default interface AdvertisementApi {
|
|
41
|
+
fetch: (productId: number, withRedirect: boolean) => Promise<AdvertisementApiResponse.fetch>
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RequestErrorEvent } from "../common";
|
|
2
|
+
import { AdvertisementApiResponse } from "../api/advertisement";
|
|
3
|
+
|
|
4
|
+
export default interface AdvertisementEvent {
|
|
5
|
+
onFetched: (callback: (response: AdvertisementApiResponse.fetch) => void) => void;
|
|
6
|
+
onFetchFailed: RequestErrorEvent;
|
|
7
|
+
}
|