@salla.sa/twilight 2.8.6-alpha.3 → 2.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight",
3
- "version": "2.8.6-alpha.3",
3
+ "version": "2.9.0",
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/applepay": "~1.0",
35
- "@salla.sa/base": "^2.8.3-alpha.1",
34
+ "@salla.sa/base": "^2.9.0",
35
+ "@salla.sa/twilight-tailwind-theme": "^2.9.0",
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": "23c8f4d001b390dce893a7af0f72917f5107de4a"
64
+ "gitHead": "581ae32af24e59b93efe0e61f010c6655e67c240"
65
65
  }
@@ -1,4 +1,4 @@
1
- import {ProductPayload} from "../product";
1
+ import ProductPayload from "../product";
2
2
 
3
3
  export namespace CartRequest {
4
4
  export interface addItem extends ProductPayload {
@@ -42,9 +42,19 @@ export interface VerifyContactResponse extends SuccessResponse {
42
42
  }
43
43
  }
44
44
 
45
+ export interface NotificationSettingPayload {
46
+ check: Number
47
+ }
48
+
49
+ export interface AccountDeletionPayload {
50
+ user_id: Number
51
+ }
52
+
45
53
  export default interface ProfileApi {
46
54
  info: () => Promise<ProfileResponse>;
47
55
  update: (data: ProfileUpdatePayload) => Promise<ProfileResponse>;
48
56
  verify: (data: AuthRequest.verifyByMobile | AuthRequest.verifyByEmail) => Promise<VerifyContactResponse>;
49
57
  updateContacts: (data: ProfileUpdateContactPayload) => Promise<ProfileResponse>;//need to verify after success event
58
+ setNotification: (data: NotificationSettingPayload) => Promise<SuccessResponse>;
59
+ deleteAccount: (data: AccountDeletionPayload) => Promise<SuccessResponse>
50
60
  }
@@ -1,5 +1,5 @@
1
- import {ProfileResponse} from "../api/profile";
2
- import {RequestErrorEvent, SuccessResponse} from "../common";
1
+ import { ProfileResponse } from "../api/profile";
2
+ import { RequestErrorEvent, SuccessResponse } from "../common";
3
3
 
4
4
  export default interface ProfileEvent {
5
5
  onUpdated: (callback: (response: ProfileResponse) => void) => void;
@@ -10,4 +10,10 @@ export default interface ProfileEvent {
10
10
  onUpdateFailed: RequestErrorEvent;
11
11
  onUnverified: RequestErrorEvent;
12
12
  onUpdateContactsFailed: RequestErrorEvent;
13
+
14
+ onSettingsUpdated: (callback: (response: SuccessResponse) => void) => void;
15
+ onUpdateSettingsFailed: RequestErrorEvent;
16
+
17
+ onDeleted: (callback: (response: SuccessResponse) => void) => void;
18
+ onNotDeleted: RequestErrorEvent;
13
19
  }
package/types/index.d.ts CHANGED
@@ -10,6 +10,8 @@ import SallaForm from "./lib/form";
10
10
  import {TwilightConfig} from "./tiwlight-config";
11
11
 
12
12
  export default interface Salla extends SallaActions {
13
+ onReady: (callback: (event: Event) => unknown) => void; //relay on it, it will be available even salla object is not loaded yet
14
+
13
15
  api: Api;
14
16
  event: TwilightEmitter;
15
17
 
@@ -23,11 +25,10 @@ export default interface Salla extends SallaActions {
23
25
  AppHelpers: AppHelpers;
24
26
  form: SallaForm;
25
27
  isInitiated: boolean; // will be true when firing event `twilight::initiated`
26
- onReady: (callback: (event: Event) => unknown) => void; // don't relay on it because Salla may not existed yet
27
- init: (config: Config) => void; // an alias for `salla.twilight.init(config)`
28
+ init: (config: TwilightConfig) => void; // an alias for `salla.twilight.init(config)`
28
29
  call: (action: ApiActionName | string) => any;
29
30
 
30
- onInitiated: (callback) => void;
31
+ onInitiated: (callback) => void; // don't relay on it because Salla may not existed yet
31
32
  }
32
33
 
33
34
  declare global {
@@ -20,12 +20,12 @@ export interface TwilightConfig {
20
20
  maintenance?: boolean;
21
21
  debug?: boolean;
22
22
  events?: { [event_name: string]: any };
23
- sdk: {
23
+ sdk?: {
24
24
  notifier_handler_disabled: boolean
25
25
  },
26
26
  store: {
27
27
  url: string;
28
- id?: number;
28
+ id: number;
29
29
  logo?: string;
30
30
  name?: string;
31
31
  api?: string;
package/watcher.js CHANGED
@@ -93,7 +93,7 @@ class WatcherPlugin {
93
93
  */
94
94
  afterCompile(compiler) {
95
95
  compiler.hooks.afterCompile.tap('SallaAfterCompilePlugin', (compilation) => {
96
- this.connection.sendUTF(JSON.stringify({ msg: "reload" }));
96
+ if(this.connection) this.connection.sendUTF(JSON.stringify({ msg: "reload" }));
97
97
  });
98
98
  }
99
99
  /**