๐ Bug Report: Some Classes not present in Typescript Module
Y4shin opened this issue ยท 2 comments
Y4shin commented
๐ Reproduction steps
Installing the Node SDK, importing the Permission
and/or Role
class and compiling with tsc.
Import Statement
import sdk, {Permission, Role} from 'node-appwrite';
package.json
{
"name": "appwrite-function",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npx tsc"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"node-appwrite": "^8.0.0",
"typescript": "^4.8.3"
}
}
๐ Expected behavior
Import the classes.
๐ Actual Behavior
Raises an error for each of the two classes during Typescript Compilation:
user@host someFolder % npm run build
> appwrite-function@1.0.0 build
> npx tsc
src/index.ts:1:14 - error TS2305: Module '"node-appwrite"' has no exported member 'Permission'.
1 import sdk, {Permission, Role} from 'node-appwrite';
~~~~~~~~~~
src/index.ts:1:26 - error TS2305: Module '"node-appwrite"' has no exported member 'Role'.
1 import sdk, {Permission, Role} from 'node-appwrite';
~~~~
Found 2 errors in the same file, starting at: src/index.ts:1
The error does not appear, when manually adding these Lines into the index.d.ts
file after line 1719 (into the root namespace of the node-appwrite
module):
export class Permission {
static read(role: string): string;
static write(role: string): string;
static create(role: string): string;
static update(role: string): string;
static delete(role: string): string;
}
export class Role {
static any(): string;
static user(id: string, status?: string): string;
static users(status?: string): string;
static guests(): string;
static team(id, role?: string): string;
static member(id): string;
static status(status: string): string;
}
๐ฒ Appwrite version
Different version (specify in environment)
๐ป Operating system
Linux
๐งฑ Your Environment
Appwrite Version: 1.0.1
node-appwrite Version: ^8.0.0
tsc Version: 4.8.3
๐ Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
๐ข Have you read the Code of Conduct?
- I have read the Code of Conduct
stnguyen90 commented
stnguyen90 commented
Closing as this should be resolved now. Feel free to comment if it is not and I can re-open it.
Lines 1845 to 1860 in 0fac3f6