monday-sdk-js 0.5.6 → 0.5.7
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/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# monday.com Apps framework SDK for JavaScript
|
|
5
5
|
[](https://github.com/mondaycom/monday-sdk-js/blob/master/LICENSE) [](https://www.npmjs.com/package/monday-sdk-js) [](https://www.npmjs.com/package/monday-sdk-js) [](https://www.jsdelivr.com/package/npm/monday-sdk-js)
|
|
6
6
|
|
|
7
|
+
> **⚠️ DEPRECATION NOTICE:** The **server SDK** in this package is deprecated and will be removed in version **1.0.0**. This package will become **client-side only**. For server-side GraphQL queries (the `api()` method), please migrate to the official [@mondaydotcomorg/api](https://www.npmjs.com/package/@mondaydotcomorg/api) package.
|
|
7
8
|
|
|
8
9
|
The monday.com SDK provides a toolset for application developers to build features and solutions on top of the monday.com Work OS platform. You'll find this SDK useful if you want to:
|
|
9
10
|
|
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -6,6 +6,12 @@ const TOKEN_MISSING_ERROR = "Should send 'token' as an option or call mondaySdk.
|
|
|
6
6
|
|
|
7
7
|
class MondayServerSdk {
|
|
8
8
|
constructor(options = {}) {
|
|
9
|
+
console.warn(
|
|
10
|
+
"[DEPRECATION WARNING] The monday-sdk-js server SDK is deprecated and will be removed in version 1.0.0.\n" +
|
|
11
|
+
"The 'api()' method for GraphQL queries should be replaced with the official @mondaydotcomorg/api package: https://www.npmjs.com/package/@mondaydotcomorg/api\n" +
|
|
12
|
+
"For more information, visit: https://developer.monday.com/api-reference/docs/api-sdk"
|
|
13
|
+
);
|
|
14
|
+
|
|
9
15
|
this._token = options.token;
|
|
10
16
|
this._apiVersion = options.apiVersion;
|
|
11
17
|
|
|
@@ -37,6 +37,37 @@ export type Permissions = {
|
|
|
37
37
|
requiredScopes: string[];
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
export type AppSubscription = {
|
|
41
|
+
/**
|
|
42
|
+
* The billing period frequency: monthly or yearly
|
|
43
|
+
*/
|
|
44
|
+
billing_period: "yearly" | "monthly";
|
|
45
|
+
/**
|
|
46
|
+
* The number of days left until the subscription ends
|
|
47
|
+
*/
|
|
48
|
+
days_left: number;
|
|
49
|
+
/**
|
|
50
|
+
* Returns true if it is still a trial subscription
|
|
51
|
+
*/
|
|
52
|
+
is_trial: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The maximum number of seats allowed for seat-based plans. Returns null for feature-based plans
|
|
55
|
+
*/
|
|
56
|
+
max_units: number | null;
|
|
57
|
+
/**
|
|
58
|
+
* The subscription plan ID from the app's side
|
|
59
|
+
*/
|
|
60
|
+
plan_id: string;
|
|
61
|
+
/**
|
|
62
|
+
* The subscription's pricing version
|
|
63
|
+
*/
|
|
64
|
+
pricing_version: number;
|
|
65
|
+
/**
|
|
66
|
+
* The date when the subscription renews, in ISO 8601 format
|
|
67
|
+
*/
|
|
68
|
+
renewal_date: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
40
71
|
export type BaseContext = {
|
|
41
72
|
themeConfig?: Theme;
|
|
42
73
|
theme: string;
|
|
@@ -46,6 +77,7 @@ export type BaseContext = {
|
|
|
46
77
|
app: App;
|
|
47
78
|
appVersion: AppVersion;
|
|
48
79
|
permissions: Permissions;
|
|
80
|
+
subscription?: AppSubscription;
|
|
49
81
|
};
|
|
50
82
|
|
|
51
83
|
export type AppFeatureBoardViewContext = BaseContext & {
|
|
@@ -147,8 +147,9 @@ export interface ClientData {
|
|
|
147
147
|
* @param {any} value - The value to store
|
|
148
148
|
* @param {object=} options
|
|
149
149
|
* @param {string=} options.previous_version - Use the new version of the storage (instance-less)
|
|
150
|
+
* @param {number=} options.ttl - The time to live of the item in seconds
|
|
150
151
|
*/
|
|
151
|
-
setItem(key: string, value: any, options?: { previous_version?: string }): Promise<SetResponse>;
|
|
152
|
+
setItem(key: string, value: any, options?: { previous_version?: string, ttl?: number }): Promise<SetResponse>;
|
|
152
153
|
/***
|
|
153
154
|
* The instance storage is a key-value database that is scoped to a specific app instance.
|
|
154
155
|
* **Does not work** for instance-less apps.
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { APIOptions } from './client-api.interface';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The monday-sdk-js server SDK is deprecated and will be removed in version 1.0.0.
|
|
5
|
+
* The api() method for GraphQL queries should be replaced with @mondaydotcomorg/api: https://www.npmjs.com/package/@mondaydotcomorg/api
|
|
6
|
+
* For more information, visit: https://developer.monday.com/api-reference/docs/api-sdk
|
|
7
|
+
*/
|
|
3
8
|
export interface MondayServerSdk {
|
|
4
9
|
setToken(token: string): void;
|
|
5
10
|
|