mondaycom / monday-sdk-js

Node.js and JavaScript SDK for developing over the monday.com platform
https://monday.com
MIT License
87 stars 39 forks source link

Added missing types for storage.instance.deleteItem #85

Closed zivnadel closed 1 year ago

zivnadel commented 1 year ago

The types should be updated now according to the docs. Closes #84.

zivnadel commented 1 year ago

@yuhgto @gregra81

eidermaen commented 1 year ago

Hi @zivnadel,

thank you for the fix! However, unfortunately, I just saw that the interfaces are not being exported so it is not possible to use them in our own code base like import {GetResponse} from 'monday-sdk-js'. We would have to rebuilt them in our code to have it working.

Should I create for this a new issue for this or was this on purpose?

yuhgto commented 1 year ago

It was intentional – we never exported the interfaces, even in the previous version.

But it should still work if you import the whole module:

import mondaySdk from 'monday-sdk-js';
const monday = mondaySdk();

const monday.storage.instance.setItem({'foo':'bar'}, 5) // will throw typescript errors
eidermaen commented 1 year ago

@yuhgto in our code we have some interfaces like

interface SomeInterface {
    doStuff(): Promise<GetResponse>; // inside this method monday.storage.instance.setItem would be called
}

In order to add correct types here, we cannot directly import them from the sdk.

yuhgto commented 1 year ago

Oh cool! Ok, I'll discuss it internally and add an upcoming task to export these interfaces.

eidermaen commented 1 year ago

Great, thanks! 👍🏻