@knocklabs/client 0.10.14 → 0.10.15

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 26166e3: fix: update preference set types
8
+ - Updated dependencies [26166e3]
9
+ - @knocklabs/types@0.1.5
10
+
3
11
  ## 0.10.14
4
12
 
5
13
  ### Patch Changes
@@ -1,11 +1,14 @@
1
- import { ChannelType } from '@knocklabs/types';
1
+ import { ChannelType, Condition } from '@knocklabs/types';
2
2
 
3
+ export type ConditionalPreferenceSettings = {
4
+ conditions: Condition[];
5
+ };
3
6
  export type ChannelTypePreferences = {
4
- [_K in ChannelType]?: boolean;
7
+ [_K in ChannelType]?: boolean | ConditionalPreferenceSettings;
5
8
  };
6
9
  export type WorkflowPreferenceSetting = boolean | {
7
10
  channel_types: ChannelTypePreferences;
8
- };
11
+ } | ConditionalPreferenceSettings;
9
12
  export type WorkflowPreferences = Partial<Record<string, WorkflowPreferenceSetting>>;
10
13
  export interface SetPreferencesProperties {
11
14
  workflows: WorkflowPreferences;
@@ -14,9 +17,9 @@ export interface SetPreferencesProperties {
14
17
  }
15
18
  export interface PreferenceSet {
16
19
  id: string;
17
- categories: WorkflowPreferences;
18
- workflows: WorkflowPreferences;
19
- channel_types: ChannelTypePreferences;
20
+ categories: WorkflowPreferences | null;
21
+ workflows: WorkflowPreferences | null;
22
+ channel_types: ChannelTypePreferences | null;
20
23
  }
21
24
  export interface PreferenceOptions {
22
25
  preferenceSet?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/clients/preferences/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG;KAClC,EAAE,IAAI,WAAW,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C,SAAS,EAAE,mBAAmB,CAAC;IAC/B,UAAU,EAAE,mBAAmB,CAAC;IAChC,aAAa,EAAE,sBAAsB,CAAC;CACvC;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACtC,aAAa,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knocklabs/client",
3
- "version": "0.10.14",
3
+ "version": "0.10.15",
4
4
  "description": "The clientside library for interacting with Knock",
5
5
  "homepage": "https://github.com/knocklabs/javascript/tree/main/packages/client",
6
6
  "author": "@knocklabs",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/cli": "^7.25.7",
51
- "@babel/core": "^7.25.7",
51
+ "@babel/core": "^7.26.0",
52
52
  "@babel/plugin-proposal-class-properties": "^7.16.7",
53
53
  "@babel/plugin-proposal-object-rest-spread": "^7.16.7",
54
54
  "@babel/plugin-transform-runtime": "^7.25.4",
@@ -63,14 +63,14 @@
63
63
  "jsonwebtoken": "^9.0.2",
64
64
  "prettier": "^3.1.0",
65
65
  "rimraf": "^6.0.1",
66
- "rollup": "^4.22.5",
67
- "typescript": "^5.6.2",
66
+ "rollup": "^4.24.2",
67
+ "typescript": "^5.6.3",
68
68
  "vite": "^5.0.0",
69
- "vitest": "^2.0.5"
69
+ "vitest": "^2.1.4"
70
70
  },
71
71
  "dependencies": {
72
72
  "@babel/runtime": "^7.25.6",
73
- "@knocklabs/types": "^0.1.4",
73
+ "@knocklabs/types": "^0.1.5",
74
74
  "@types/phoenix": "^1.5.4",
75
75
  "axios": "^1.7.4",
76
76
  "axios-retry": "^4.5.0",
@@ -1,12 +1,17 @@
1
- import { ChannelType } from "@knocklabs/types";
1
+ import { ChannelType, Condition } from "@knocklabs/types";
2
+
3
+ export type ConditionalPreferenceSettings = {
4
+ conditions: Condition[];
5
+ };
2
6
 
3
7
  export type ChannelTypePreferences = {
4
- [_K in ChannelType]?: boolean;
8
+ [_K in ChannelType]?: boolean | ConditionalPreferenceSettings;
5
9
  };
6
10
 
7
11
  export type WorkflowPreferenceSetting =
8
12
  | boolean
9
- | { channel_types: ChannelTypePreferences };
13
+ | { channel_types: ChannelTypePreferences }
14
+ | ConditionalPreferenceSettings;
10
15
 
11
16
  export type WorkflowPreferences = Partial<
12
17
  Record<string, WorkflowPreferenceSetting>
@@ -20,9 +25,9 @@ export interface SetPreferencesProperties {
20
25
 
21
26
  export interface PreferenceSet {
22
27
  id: string;
23
- categories: WorkflowPreferences;
24
- workflows: WorkflowPreferences;
25
- channel_types: ChannelTypePreferences;
28
+ categories: WorkflowPreferences | null;
29
+ workflows: WorkflowPreferences | null;
30
+ channel_types: ChannelTypePreferences | null;
26
31
  }
27
32
 
28
33
  export interface PreferenceOptions {