monday-sdk-js 0.5.3 → 0.5.5

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": "monday-sdk-js",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "private": false,
5
5
  "repository": "https://github.com/mondaycom/monday-sdk-js",
6
6
  "main": "src/index.js",
@@ -1,10 +1,28 @@
1
1
  import { AppFeatureContextMap, AppFeatureTypes } from "./client-context.type";
2
2
 
3
+ export type LocationResponse = Record<string, any> & {
4
+ href: string;
5
+ search: string;
6
+ };
7
+
8
+ export type FilterResponse = Record<string, any> & {
9
+ term: string;
10
+ rules: (Record<string, any> & {
11
+ column_id?: string;
12
+ compare_value?: string[];
13
+ compare_attribute?: string;
14
+ operator?: string;
15
+ })[];
16
+ operator: string | null;
17
+ };
18
+
3
19
  type SubscribableEventsResponse<AppFeatureType extends AppFeatureTypes = AppFeatureTypes> = {
4
20
  context: AppFeatureContextMap[AppFeatureType];
5
21
  settings: Record<string, any>;
6
22
  itemIds: number[];
7
23
  events: Record<string, any>;
24
+ location: LocationResponse;
25
+ filter: FilterResponse;
8
26
  };
9
27
 
10
28
  type SubscribableEvents = keyof SubscribableEventsResponse;
@@ -54,6 +72,8 @@ export type GetterResponse<AppFeatureType extends AppFeatureTypes = AppFeatureTy
54
72
  settings: Record<string, any>;
55
73
  itemIds: number[];
56
74
  sessionToken: string;
75
+ location: LocationResponse;
76
+ filter: FilterResponse;
57
77
  };
58
78
  export interface ClientData {
59
79
  /**
@@ -80,6 +100,7 @@ export interface ClientData {
80
100
  * @param typeOrTypes The type, or array of types, of events to subscribe to
81
101
  * @param callback A callback function that is fired when the listener is triggered by a client-side event
82
102
  * @param params Reserved for future use
103
+ * @return Unsubscribe/unlisten from all added during this method call
83
104
  */
84
105
  listen<
85
106
  CustomResponse,
@@ -89,7 +110,7 @@ export interface ClientData {
89
110
  typeOrTypes: T | ReadonlyArray<T>,
90
111
  callback: (res: { data: SubscribableEventsResponse<AppFeatureType>[T] & CustomResponse }) => void,
91
112
  params?: Record<string, any> & { appFeatureType?: AppFeatureType }
92
- ): void;
113
+ ): () => void;
93
114
 
94
115
  /**
95
116
  * Set data in your application, such as updating settings
package/types/index.d.ts CHANGED
@@ -1,22 +1,24 @@
1
1
  // Original Definitions were contributed by: Josh Parnham <https://github.com/josh->
2
- import { MondayClientSdk } from './client-sdk.interface';
3
- import { MondayServerSdk } from './server-sdk.interface';
2
+ import { MondayClientSdk } from "./client-sdk.interface";
3
+ import { MondayServerSdk } from "./server-sdk.interface";
4
4
 
5
5
  export as namespace mondaySdk;
6
6
 
7
7
  declare function init(
8
- config?: Partial<{
9
- clientId: string;
10
- apiToken: string;
11
- apiVersion: string;
12
- }>,
8
+ config?: Partial<{
9
+ clientId: string;
10
+ apiToken: string;
11
+ apiVersion: string;
12
+ }>
13
13
  ): MondayClientSdk;
14
14
 
15
15
  declare function init(
16
- config?: Partial<{
17
- token: string;
18
- apiVersion: string;
19
- }>,
16
+ config?: Partial<{
17
+ token: string;
18
+ apiVersion: string;
19
+ }>
20
20
  ): MondayServerSdk;
21
21
 
22
- export = init;
22
+ export { MondayClientSdk, MondayServerSdk };
23
+
24
+ export default init;