@edraj/tsdmart 1.0.16 → 2.0.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/CHANGELOG.md +1 -1
- package/README.md +2 -2
- package/a +2 -0
- package/dmart.model.ts +320 -0
- package/dmart.service.ts +483 -0
- package/index.ts +3 -770
- package/package.json +8 -8
- package/test.ts +46 -0
- package/tsconfig.json +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edraj/tsdmart",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@types/node": "^
|
|
15
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
16
|
-
"@typescript-eslint/parser": "^
|
|
17
|
-
"eslint": "^
|
|
14
|
+
"@types/node": "^22.15.3",
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
|
16
|
+
"@typescript-eslint/parser": "^8.31.1",
|
|
17
|
+
"eslint": "^9.25.1",
|
|
18
18
|
"ts-node": "^10.9.2",
|
|
19
19
|
"tsconfig-paths": "^4.2.0",
|
|
20
|
-
"tslib": "^2.
|
|
21
|
-
"typescript": "^5.
|
|
20
|
+
"tslib": "^2.8.1",
|
|
21
|
+
"typescript": "^5.8.3"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"axios": "^1.
|
|
24
|
+
"axios": "^1.9.0"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/test.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import Dmart from "./index";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Dmart.baseURL = 'http://localhost:8282';
|
|
5
|
+
|
|
6
|
+
const r = await Dmart.login('dmart', 'Test1234')
|
|
7
|
+
console.log({r});
|
|
8
|
+
const request:any = {
|
|
9
|
+
space_name: "management",
|
|
10
|
+
request_type: "update",
|
|
11
|
+
records: [
|
|
12
|
+
{
|
|
13
|
+
resource_type: "user",
|
|
14
|
+
shortname: "zainebfrontend",
|
|
15
|
+
subpath: "/users",
|
|
16
|
+
attributes: {
|
|
17
|
+
description: {
|
|
18
|
+
ar: "desc ar",
|
|
19
|
+
en: "HelloWorld en",
|
|
20
|
+
ku: "desc ku"
|
|
21
|
+
},
|
|
22
|
+
displayname: {
|
|
23
|
+
ar: "name ar",
|
|
24
|
+
en: "myName en",
|
|
25
|
+
ku: "name ku"
|
|
26
|
+
},
|
|
27
|
+
is_active: true,
|
|
28
|
+
invitation: "",
|
|
29
|
+
payload: {
|
|
30
|
+
body: {
|
|
31
|
+
email: "zainebb@gmail.com",
|
|
32
|
+
first_name: "Jo",
|
|
33
|
+
last_name: "Do",
|
|
34
|
+
mobile: "792211703",
|
|
35
|
+
language: "english"
|
|
36
|
+
},
|
|
37
|
+
content_type: "json",
|
|
38
|
+
// schema_shortname: "user"
|
|
39
|
+
},
|
|
40
|
+
tags: []
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
const u = await Dmart.request(request);
|
|
46
|
+
console.log({u});
|
package/tsconfig.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"module": "ESNext",
|
|
4
|
-
"moduleResolution": "
|
|
4
|
+
"moduleResolution": "node",
|
|
5
5
|
"target": "ESNext",
|
|
6
6
|
"esModuleInterop": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
7
8
|
// Strict Checks
|
|
8
9
|
"alwaysStrict": true,
|
|
9
10
|
"noImplicitAny": true,
|