monday-sdk-js 0.3.3 → 0.4.0

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.3.3",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/mondaycom/monday-sdk-js",
6
6
  "main": "src/index.js",
@@ -25,6 +25,7 @@
25
25
  "@babel/preset-env": "^7.6.0",
26
26
  "@babel/preset-react": "^7.0.0",
27
27
  "@babel/register": "^7.6.0",
28
+ "@types/source-map": "^0.5.2",
28
29
  "babel-loader": "^8.0.6",
29
30
  "chai": "^4.2.0",
30
31
  "eslint": "^6.8.0",
@@ -33,11 +34,10 @@
33
34
  "prettier": "^1.19.1",
34
35
  "sinon": "^9.0.0",
35
36
  "sinon-chai": "^3.5.0",
37
+ "typescript": "^4.9.5",
36
38
  "webpack": "^4.38.0",
37
39
  "webpack-cli": "^3.3.6",
38
- "webpack-dev-server": "^3.7.2",
39
- "@types/source-map": "^0.5.2",
40
- "typescript": "^4.9.5"
40
+ "webpack-dev-server": "^3.7.2"
41
41
  },
42
42
  "scripts": {
43
43
  "start": "webpack-dev-server",
@@ -9,6 +9,12 @@ type BlockTypes = 'normal text' | 'large title' | 'medium title' | 'small title'
9
9
  interface BlockContent { deltaFormat: Array<object> };
10
10
 
11
11
  export interface ClientExecute {
12
+ /**
13
+ * Type fallback to account for new execute methods during the AI hackathon.
14
+ * This will be removed when the 0.4.0 version goes out of beta.
15
+ */
16
+ execute (type: any, params?: any): Promise<any>;
17
+
12
18
  /**
13
19
  * Opens a popup card with information from the selected item
14
20
  * @param type Which action to perform
@@ -184,13 +190,27 @@ export interface ClientExecute {
184
190
  height?: string;
185
191
  },
186
192
  ): Promise<{ data: any }>;
193
+ /**
194
+ * Opens the provided link in a new tab.
195
+ * @param type Which action to perform
196
+ * @param params Optional parameters for the action
197
+ */
198
+ execute(
199
+ type: 'openLinkInTab',
200
+ params: {
201
+ /**
202
+ * The URL to open a new tab with
203
+ */
204
+ url: string;
205
+ },
206
+ ): Promise<{ data: Record<string, any> }>;
187
207
  /**
188
208
  * Closes the modal window.
189
209
  * @param type Which action to perform
190
210
  */
191
211
  execute(type: 'closeAppFeatureModal'): Promise<{ data: any }>;
192
212
  /**
193
- * Notifies the monday platform when a user gains a first value in your app.
213
+ * Notifies the monday platform when a user gains a first value in your app.
194
214
  * @param type Which action to perform
195
215
  */
196
216
  execute(type: 'valueCreatedForUser'): Promise<any>;
@@ -207,9 +227,9 @@ export interface ClientExecute {
207
227
  */
208
228
  type: BlockTypes;
209
229
  /**
210
- * Used to specify where in the doc the new block should go.
211
- * Provide the block's ID that will be above the new block.
212
- * Without this parameter, the block will appear at the top of the doc.
230
+ * Used to specify where in the doc the new block should go.
231
+ * Provide the block's ID that will be above the new block.
232
+ * Without this parameter, the block will appear at the top of the doc.
213
233
  */
214
234
  afterBlockId?: string | undefined;
215
235
  /**
@@ -217,7 +237,7 @@ export interface ClientExecute {
217
237
  */
218
238
  content: BlockContent;
219
239
  },
220
- ): Promise<any>;
240
+ ): Promise<any>;
221
241
  /**
222
242
  * Updates a block's content
223
243
  * @param type Which action to perform
@@ -227,7 +247,7 @@ export interface ClientExecute {
227
247
  type: 'updateDocBlock',
228
248
  params: {
229
249
  /**
230
- * The block's unique identifier.
250
+ * The block's unique identifier.
231
251
  */
232
252
  id: string;
233
253
  /**
@@ -245,11 +265,11 @@ export interface ClientExecute {
245
265
  type: 'addMultiBlocks',
246
266
  params: {
247
267
  /**
248
- * The block's unique identifier.
268
+ * The block's unique identifier.
249
269
  */
250
270
  afterBlockId?: string | undefined;
251
271
  /**
252
- * The block's content in Delta format.
272
+ * The block's content in Delta format.
253
273
  * We support the following block types
254
274
  */
255
275
  blocks: Array<{ type: BlockTypes, content: BlockContent}>;
@@ -260,4 +280,4 @@ export interface ClientExecute {
260
280
  * @param type Which action to perform
261
281
  */
262
282
  execute (type: 'closeDocModal'): Promise<any>;
263
- }
283
+ }