@edraj/tsdmart 1.0.9 → 1.0.11
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/CHANGELOG.md +5 -1
- package/README.md +2 -1
- package/index.ts +10 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -4,7 +4,8 @@ A TypeScript implementation of the Dmart that depends on axios.
|
|
|
4
4
|
|
|
5
5
|
## APIs
|
|
6
6
|
|
|
7
|
-
* `login(shortname: string, password: string) -> Promise<ApiResponse>` - Performs a login action.
|
|
7
|
+
* `login(shortname: string, password: string) -> Promise<ApiResponse>` - Performs a login action (shortname).
|
|
8
|
+
* `loginBy(credentials: dict, password: string) -> Promise<ApiResponse>` - Performs a login action but altering the default identifier that you can customise.
|
|
8
9
|
* `logout() -> Promise<ApiResponse>` - Performs a logout action.
|
|
9
10
|
* `create_user(request: any) -> Promise<ActionResponse>` - Creates a new user.
|
|
10
11
|
* `update_user(request: any) -> Promise<ActionResponse>` - Updates an existing user.
|
package/index.ts
CHANGED
|
@@ -121,6 +121,8 @@ export enum QueryType {
|
|
|
121
121
|
spaces = "spaces",
|
|
122
122
|
counters = "counters",
|
|
123
123
|
reports = "reports",
|
|
124
|
+
attachments = "attachments",
|
|
125
|
+
attachments_aggregation = "attachments_aggregation"
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
export enum SortyType {
|
|
@@ -186,6 +188,7 @@ export enum ResourceType {
|
|
|
186
188
|
content = "content",
|
|
187
189
|
acl = "acl",
|
|
188
190
|
comment = "comment",
|
|
191
|
+
reaction = "reaction",
|
|
189
192
|
media = "media",
|
|
190
193
|
locator = "locator",
|
|
191
194
|
relationship = "relationship",
|
|
@@ -327,12 +330,13 @@ export default class Dmart {
|
|
|
327
330
|
const {data} = await axios.post<
|
|
328
331
|
ApiResponse & { records: Array<LoginResponseRecord> }
|
|
329
332
|
>(this.baseURL + "/user/login", {shortname, password}, {headers});
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
return data;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
public static async loginBy(credentials: any, password: string) {
|
|
337
|
+
const {data} = await axios.post<
|
|
338
|
+
ApiResponse & { records: Array<LoginResponseRecord> }
|
|
339
|
+
>(this.baseURL + "/user/login", {...credentials, password}, {headers});
|
|
336
340
|
return data;
|
|
337
341
|
}
|
|
338
342
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edraj/tsdmart",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "A TypeScript implementation of the Dmart that depends on axios.",
|
|
5
5
|
"author": "Kefah T. Issa",
|
|
6
6
|
"email": "kefah.issa@gmail.com",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"typescript": "^5.4.2"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"axios": "^1.
|
|
24
|
+
"axios": "^1.7.9"
|
|
25
25
|
}
|
|
26
26
|
}
|