@trycourier/react-hooks 1.42.0 → 1.43.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.
@@ -16,7 +16,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
16
16
  var initialState = {
17
17
  preferences: undefined,
18
18
  recipientPreferences: undefined,
19
- preferenceSections: undefined,
20
19
  preferencePage: undefined
21
20
  };
22
21
 
@@ -35,11 +34,6 @@ var _default = function _default() {
35
34
  isUpdating: true
36
35
  });
37
36
 
38
- case "preferences/FETCH_PREFERENCE_SECTION/PENDING":
39
- return _objectSpread(_objectSpread({}, state), {}, {
40
- isUpdating: true
41
- });
42
-
43
37
  case "preferences/FETCH_PREFERENCE_PAGE/PENDING":
44
38
  return _objectSpread(_objectSpread({}, state), {}, {
45
39
  isUpdating: true
@@ -53,14 +47,6 @@ var _default = function _default() {
53
47
  });
54
48
  }
55
49
 
56
- case "preferences/FETCH_PREFERENCE_SECTION/DONE":
57
- {
58
- return _objectSpread(_objectSpread({}, state), {}, {
59
- isLoading: false,
60
- preferenceSections: action === null || action === void 0 ? void 0 : action.payload
61
- });
62
- }
63
-
64
50
  case "preferences/FETCH_PREFERENCE_PAGE/DONE":
65
51
  return _objectSpread(_objectSpread({}, state), {}, {
66
52
  isLoading: false,
@@ -41,14 +41,6 @@ var usePreferencesActions = function usePreferencesActions() {
41
41
  }
42
42
  });
43
43
  },
44
- fetchPreferenceSections: function fetchPreferenceSections() {
45
- dispatch({
46
- type: "preferences/FETCH_PREFERENCE_SECTION",
47
- payload: function payload() {
48
- return preferences.getPreferenceSections();
49
- }
50
- });
51
- },
52
44
  fetchPreferencePage: function fetchPreferencePage() {
53
45
  dispatch({
54
46
  type: "preferences/FETCH_PREFERENCE_PAGE",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/react-hooks",
3
- "version": "1.42.0",
3
+ "version": "1.43.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "typings/index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "concat-md": "^0.3.5"
21
21
  },
22
22
  "dependencies": {
23
- "@trycourier/client-graphql": "^1.42.0",
24
- "@trycourier/react-provider": "^1.42.0",
23
+ "@trycourier/client-graphql": "^1.43.0",
24
+ "@trycourier/react-provider": "^1.43.0",
25
25
  "deep-extend": "^0.6.0",
26
26
  "rimraf": "^3.0.2"
27
27
  },
@@ -36,5 +36,5 @@
36
36
  ".": "./dist/index.js",
37
37
  "./use-inbox": "./dist/inbox/use-inbox.js"
38
38
  },
39
- "gitHead": "1fc3164fe593d3c434d901a2069a92f75d22307c"
39
+ "gitHead": "450322399e375b61b87c1f6a582382cdc192cb30"
40
40
  }
@@ -4,22 +4,19 @@ declare const _default: (state: PreferenceState | undefined, action: any) => Pre
4
4
  recipientPreferences: any;
5
5
  isUpdating?: boolean | undefined;
6
6
  preferences?: import("./types").IPreferenceTemplate[] | undefined;
7
- preferenceSections?: any[] | undefined;
8
- preferencePage?: any;
7
+ preferencePage?: import("./types").PreferencePage | undefined;
9
8
  } | {
10
9
  isLoading: boolean;
11
- preferenceSections: any;
10
+ preferencePage: any;
12
11
  isUpdating?: boolean | undefined;
13
12
  preferences?: import("./types").IPreferenceTemplate[] | undefined;
14
13
  recipientPreferences?: import("./types").IRecipientPreference[] | undefined;
15
- preferencePage?: any;
16
14
  } | {
17
15
  isUpdating: boolean;
18
16
  recipientPreferences: any[] | undefined;
19
17
  isLoading?: boolean | undefined;
20
18
  preferences?: import("./types").IPreferenceTemplate[] | undefined;
21
- preferenceSections?: any[] | undefined;
22
- preferencePage?: any;
19
+ preferencePage?: import("./types").PreferencePage | undefined;
23
20
  };
24
21
  export default _default;
25
22
  //# sourceMappingURL=reducer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/preferences/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;AAS1C,wBAgEE"}
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/preferences/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;AAQ1C,wBAkDE"}
@@ -1,10 +1,45 @@
1
+ export declare type PreferencePage = {
2
+ showCourierFooter: boolean;
3
+ brand: {
4
+ settings: {
5
+ colors: {
6
+ primary: string;
7
+ };
8
+ };
9
+ links: {
10
+ facebook: {
11
+ url: string;
12
+ };
13
+ instagram: {
14
+ url: string;
15
+ };
16
+ linkedin: {
17
+ url: string;
18
+ };
19
+ medium: {
20
+ url: string;
21
+ };
22
+ twitter: {
23
+ url: string;
24
+ };
25
+ };
26
+ };
27
+ sections: PreferenceSection;
28
+ };
29
+ export declare type PreferenceSection = {
30
+ nodes: Array<{
31
+ name: string;
32
+ sectionId: string;
33
+ routingOptions: Array<ChannelClassification>;
34
+ topics: Array<IPreferenceTemplate>;
35
+ }>;
36
+ };
1
37
  export interface PreferenceState {
2
38
  isLoading?: boolean;
3
39
  isUpdating?: boolean;
4
40
  preferences?: IPreferenceTemplate[];
5
41
  recipientPreferences?: IRecipientPreference[];
6
- preferenceSections?: Array<any>;
7
- preferencePage?: any;
42
+ preferencePage?: PreferencePage;
8
43
  }
9
44
  export declare type ChannelClassification = "email" | "push" | "direct_message";
10
45
  export declare type SnoozePreference = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/preferences/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC9C,kBAAkB,CAAC,EAAE,KAAK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,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;CAClD"}
@@ -1,6 +1,5 @@
1
1
  declare const usePreferencesActions: () => {
2
2
  fetchRecipientPreferences: () => void;
3
- fetchPreferenceSections: () => void;
4
3
  fetchPreferencePage: () => void;
5
4
  updateRecipientPreferences: (payload: any) => Promise<void>;
6
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-preferences-actions.d.ts","sourceRoot":"","sources":["../../src/preferences/use-preferences-actions.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qBAAqB;;;;;CAuC1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"use-preferences-actions.d.ts","sourceRoot":"","sources":["../../src/preferences/use-preferences-actions.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,qBAAqB;;;;CAgC1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}