@trycourier/react-hooks 1.34.1 → 1.36.1-internal.293bf84.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.
@@ -15,7 +15,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
15
15
 
16
16
  var initialState = {
17
17
  preferences: undefined,
18
- recipientPreferences: undefined
18
+ recipientPreferences: undefined,
19
+ preferenceSections: undefined
19
20
  };
20
21
 
21
22
  var _default = function _default() {
@@ -33,6 +34,11 @@ var _default = function _default() {
33
34
  isUpdating: true
34
35
  });
35
36
 
37
+ case "preferences/FETCH_PREFERENCE_SECTION/PENDING":
38
+ return _objectSpread(_objectSpread({}, state), {}, {
39
+ isUpdating: true
40
+ });
41
+
36
42
  case "preferences/FETCH_RECIPIENT_PREFERENCES/DONE":
37
43
  {
38
44
  return _objectSpread(_objectSpread({}, state), {}, {
@@ -41,6 +47,14 @@ var _default = function _default() {
41
47
  });
42
48
  }
43
49
 
50
+ case "preferences/FETCH_PREFERENCE_SECTION/DONE":
51
+ {
52
+ return _objectSpread(_objectSpread({}, state), {}, {
53
+ isLoading: false,
54
+ preferenceSections: action === null || action === void 0 ? void 0 : action.payload
55
+ });
56
+ }
57
+
44
58
  case "preferences/UPDATE_RECIPIENT_PREFERENCES/DONE":
45
59
  {
46
60
  var _state$recipientPrefe;
@@ -41,6 +41,14 @@ 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
+ },
44
52
  updateRecipientPreferences: function () {
45
53
  var _updateRecipientPreferences = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_payload) {
46
54
  return _regenerator["default"].wrap(function _callee$(_context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/react-hooks",
3
- "version": "1.34.1",
3
+ "version": "1.36.1-internal.293bf84.0+293bf84",
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.34.1",
24
- "@trycourier/react-provider": "^1.34.1",
23
+ "@trycourier/client-graphql": "^1.36.1-internal.293bf84.0+293bf84",
24
+ "@trycourier/react-provider": "^1.36.1-internal.293bf84.0+293bf84",
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": "b1b848fe0f4476375462489fd8c0351286bfd533"
39
+ "gitHead": "293bf843a11cdf399ae133dea70dff17e6daa52d"
40
40
  }
@@ -4,11 +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
+ } | {
9
+ isLoading: boolean;
10
+ preferenceSections: any;
11
+ isUpdating?: boolean | undefined;
12
+ preferences?: import("./types").IPreferenceTemplate[] | undefined;
13
+ recipientPreferences?: import("./types").IRecipientPreference[] | undefined;
7
14
  } | {
8
15
  isUpdating: boolean;
9
16
  recipientPreferences: any[] | undefined;
10
17
  isLoading?: boolean | undefined;
11
18
  preferences?: import("./types").IPreferenceTemplate[] | undefined;
19
+ preferenceSections?: any[] | undefined;
12
20
  };
13
21
  export default _default;
14
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;;;;;;;;;;;;AAO1C,wBAqCE"}
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/preferences/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;AAQ1C,wBAmDE"}
@@ -3,8 +3,9 @@ export interface PreferenceState {
3
3
  isUpdating?: boolean;
4
4
  preferences?: IPreferenceTemplate[];
5
5
  recipientPreferences?: IRecipientPreference[];
6
+ preferenceSections?: Array<any>;
6
7
  }
7
- export declare type ChannelClassification = "email" | "push";
8
+ export declare type ChannelClassification = "email" | "push" | "direct_message";
8
9
  export declare type SnoozePreference = {
9
10
  start?: string;
10
11
  until: string;
@@ -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;CAC/C;AACD,oBAAY,qBAAqB,GAAG,OAAO,GAAG,MAAM,CAAC;AAErD,oBAAY,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,mBAAmB,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAA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AC,CAAC;CAClD"}
@@ -1,5 +1,6 @@
1
1
  declare const usePreferencesActions: () => {
2
2
  fetchRecipientPreferences: () => void;
3
+ fetchPreferenceSections: () => void;
3
4
  updateRecipientPreferences: (payload: any) => Promise<void>;
4
5
  };
5
6
  export default usePreferencesActions;
@@ -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;;;CA2B1B,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;;;;CAkC1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}