monday-sdk-js 0.5.0 → 0.5.2

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.0",
3
+ "version": "0.5.2",
4
4
  "private": false,
5
5
  "repository": "https://github.com/mondaycom/monday-sdk-js",
6
6
  "main": "src/index.js",
@@ -19,7 +19,6 @@
19
19
  "node-fetch": "^2.6.0"
20
20
  },
21
21
  "devDependencies": {
22
- "monday-ui-react-core": "^2.63.2",
23
22
  "@babel/cli": "^7.6.0",
24
23
  "@babel/core": "^7.6.0",
25
24
  "@babel/node": "^7.6.1",
@@ -38,7 +38,7 @@ export interface ClientApi {
38
38
  * Placeholders may be used, which will be substituted by the variables object passed within the options.
39
39
  * @param options
40
40
  */
41
- api(query: string, options?: APIOptions): Promise<{ data: object }>;
41
+ api<T = any>(query: string, options?: APIOptions): Promise<{ data: T, account_id: number }>;
42
42
 
43
43
  /**
44
44
  * Instead of passing the API token to the `api()` method on each request, you can set the API token once using:
@@ -58,4 +58,4 @@ export interface ClientApi {
58
58
  * @param object An object with options
59
59
  */
60
60
  oauth(object?: OAuthOptions): void;
61
- }
61
+ }
@@ -1,5 +1,4 @@
1
- import type { Theme } from "monday-ui-react-core/dist/types/components/ThemeProvider/ThemeProviderConstants";
2
-
1
+ import { Theme } from "./theme-config.type";
3
2
  type User = {
4
3
  id: string;
5
4
  isAdmin: boolean;
@@ -5,7 +5,7 @@ export interface MondayServerSdk {
5
5
 
6
6
  setApiVersion(version: string): void;
7
7
 
8
- api(query: string, options?: APIOptions): Promise<any>;
8
+ api<T = any>(query: string, options?: APIOptions): Promise<T>;
9
9
 
10
10
  oauthToken(code: string, clientId: string, clientSecret: string): Promise<any>;
11
11
  }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * System themes: dark, light, black, hacker
3
+ */
4
+ export enum SystemTheme {
5
+ LIGHT = "light",
6
+ DARK = "dark",
7
+ BLACK = "black",
8
+ HACKER = "hacker"
9
+ }
10
+
11
+ /**
12
+ * Colors which are eligible for theming
13
+ */
14
+ export enum ThemeColor {
15
+ primaryColor = "primary-color",
16
+ primaryHoverColor = "primary-hover-color",
17
+ primarySelectedColor = "primary-selected-color",
18
+ primarySelectedHoverColor = "primary-selected-hover-color",
19
+ primarySelectedOnSecondaryColor = "primary-selected-on-secondary-color",
20
+ textColorOnPrimary = "text-color-on-primary",
21
+ brandColor = "brand-color",
22
+ brandHoverColor = "brand-hover-color",
23
+ brandSelectedColor = "brand-selected-color",
24
+ brandSelectedHoverColor = "brand-selected-hover-color",
25
+ textColorOnBrand = "text-color-on-brand"
26
+ }
27
+
28
+ export type Theme = {
29
+ /**
30
+ * The name of the theme - name of css class that will be added to the children - should be unique
31
+ */
32
+ name: string;
33
+ colors: SystemThemeColorMap;
34
+ };
35
+
36
+ type SystemThemeColorMap = {
37
+ [key in SystemTheme]?: ThemeColorTokenValueMap;
38
+ };
39
+
40
+ export type ThemeColorTokenValueMap = ThemeColorTokenValue | ThemeCustomClassValue;
41
+
42
+ export type ThemeColorTokenValue = {
43
+ [key in ThemeColor]?: string;
44
+ };
45
+
46
+ type ThemeCustomClassValue = {
47
+ [key: string]: ThemeColorTokenValue | ThemeCustomClassValue;
48
+ };
49
+
50
+ export const SystemThemeClassMap: SystemThemeClassMapType = {
51
+ [SystemTheme.LIGHT]: "light-app-theme",
52
+ [SystemTheme.DARK]: "dark-app-theme",
53
+ [SystemTheme.BLACK]: "black-app-theme",
54
+ [SystemTheme.HACKER]: "hacker_theme-app-theme"
55
+ };
56
+
57
+ type SystemThemeClassMapType = {
58
+ [key in SystemTheme]: string;
59
+ };