diff --git a/package.json b/package.json index 296300f3..483479d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monday-sdk-js", - "version": "0.5.3", + "version": "0.5.4", "private": false, "repository": "https://github.com/mondaycom/monday-sdk-js", "main": "src/index.js", diff --git a/ts-tests/monday-sdk-js-module.test.ts b/ts-tests/monday-sdk-js-module.test.ts index 23b66b23..27edbd1c 100644 --- a/ts-tests/monday-sdk-js-module.test.ts +++ b/ts-tests/monday-sdk-js-module.test.ts @@ -25,6 +25,34 @@ monday.get("sessionToken").then(res => { const { data }: { data: string } = res; }); +monday.get("location").then(res => { + const { + data + }: { + data: { + href: string; + search: string; + }; + } = res; +}); + +monday.get("filter").then(res => { + const { + data + }: { + data: { + term: string; + rules: (Record & { + column_id?: string; + compare_value?: string[]; + compare_attribute?: string; + operator?: string; + })[]; + operator: string | null; + }; + } = res; +}); + monday.set("settings", { text: "this is a test", number: 23 }); monday.listen( diff --git a/types/client-data.interface.ts b/types/client-data.interface.ts index c94e96a5..f48c085b 100644 --- a/types/client-data.interface.ts +++ b/types/client-data.interface.ts @@ -1,10 +1,28 @@ import { AppFeatureContextMap, AppFeatureTypes } from "./client-context.type"; +export type LocationResponse = Record & { + href: string; + search: string; +}; + +export type FilterResponse = Record & { + term: string; + rules: (Record & { + column_id?: string; + compare_value?: string[]; + compare_attribute?: string; + operator?: string; + })[]; + operator: string | null; +}; + type SubscribableEventsResponse = { context: AppFeatureContextMap[AppFeatureType]; settings: Record; itemIds: number[]; events: Record; + location: LocationResponse; + filter: FilterResponse; }; type SubscribableEvents = keyof SubscribableEventsResponse; @@ -54,6 +72,8 @@ export type GetterResponse; itemIds: number[]; sessionToken: string; + location: LocationResponse; + filter: FilterResponse; }; export interface ClientData { /** diff --git a/types/index.d.ts b/types/index.d.ts index 6fc16a3a..51c44d73 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,22 +1,22 @@ // Original Definitions were contributed by: Josh Parnham -import { MondayClientSdk } from './client-sdk.interface'; -import { MondayServerSdk } from './server-sdk.interface'; +import { MondayClientSdk } from "./client-sdk.interface"; +import { MondayServerSdk } from "./server-sdk.interface"; export as namespace mondaySdk; declare function init( - config?: Partial<{ - clientId: string; - apiToken: string; - apiVersion: string; - }>, + config?: Partial<{ + clientId: string; + apiToken: string; + apiVersion: string; + }> ): MondayClientSdk; declare function init( - config?: Partial<{ - token: string; - apiVersion: string; - }>, + config?: Partial<{ + token: string; + apiVersion: string; + }> ): MondayServerSdk; export = init;