@syrtis-ai/syrtis-javascript-client 0.0.17 → 0.0.35
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/README.md +1 -1
- package/dist/Common/SyrtisClient.d.ts +8 -0
- package/dist/Common/SyrtisClient.js +22 -0
- package/dist/Entity/Scenario.d.ts +6 -0
- package/dist/Entity/Scenario.js +14 -0
- package/dist/Entity/Session.d.ts +6 -0
- package/dist/Entity/Session.js +14 -0
- package/dist/Entity/User.d.ts +12 -0
- package/dist/Entity/User.js +26 -0
- package/dist/Repository/ScenarioRepository.d.ts +5 -0
- package/dist/Repository/ScenarioRepository.js +13 -0
- package/dist/Repository/SessionRepository.d.ts +5 -0
- package/dist/Repository/SessionRepository.js +13 -0
- package/dist/Repository/UserRepository.d.ts +5 -0
- package/dist/Repository/UserRepository.js +13 -0
- package/dist/Vue/Mixin/EntityManipulator/ScenarioEntityManipulatorVueMixin.d.ts +7 -0
- package/dist/Vue/Mixin/EntityManipulator/ScenarioEntityManipulatorVueMixin.js +13 -0
- package/dist/Vue/Mixin/EntityManipulator/SessionEntityManipulatorVueMixin.d.ts +7 -0
- package/dist/Vue/Mixin/EntityManipulator/SessionEntityManipulatorVueMixin.js +13 -0
- package/dist/Vue/Mixin/EntityManipulator/UserEntityManipulatorVueMixin.d.ts +7 -0
- package/dist/Vue/Mixin/EntityManipulator/UserEntityManipulatorVueMixin.js +13 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ApiClientOptions } from '@wexample/js-api/Common/AbstractApiClient';
|
|
2
|
+
import AbstractApiEntitiesClient from '@wexample/js-api/Common/AbstractApiEntitiesClient';
|
|
3
|
+
import type { RepositoryClass } from '@wexample/js-api/Common/ApiEntityManager';
|
|
4
|
+
export default class SyrtisClient extends AbstractApiEntitiesClient {
|
|
5
|
+
static readonly DEFAULT_BASE_URL = "https://api.syrtis.ai/api/";
|
|
6
|
+
constructor(options?: ApiClientOptions);
|
|
7
|
+
protected getRepositoryClasses(): RepositoryClass[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AbstractApiEntitiesClient_1 = __importDefault(require("@wexample/js-api/Common/AbstractApiEntitiesClient"));
|
|
7
|
+
const ScenarioRepository_1 = __importDefault(require("../Repository/ScenarioRepository"));
|
|
8
|
+
const SessionRepository_1 = __importDefault(require("../Repository/SessionRepository"));
|
|
9
|
+
const UserRepository_1 = __importDefault(require("../Repository/UserRepository"));
|
|
10
|
+
class SyrtisClient extends AbstractApiEntitiesClient_1.default {
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
super({
|
|
13
|
+
...options,
|
|
14
|
+
baseUrl: options.baseUrl ?? SyrtisClient.DEFAULT_BASE_URL,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
getRepositoryClasses() {
|
|
18
|
+
return [ScenarioRepository_1.default, SessionRepository_1.default, UserRepository_1.default];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
SyrtisClient.DEFAULT_BASE_URL = 'https://api.syrtis.ai/api/';
|
|
22
|
+
exports.default = SyrtisClient;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AbstractApiEntity_1 = __importDefault(require("@wexample/js-api/Common/AbstractApiEntity"));
|
|
7
|
+
class Scenario extends AbstractApiEntity_1.default {
|
|
8
|
+
constructor(data = {}) {
|
|
9
|
+
super(data);
|
|
10
|
+
this.title = data['title'];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
Scenario.entityName = 'scenario';
|
|
14
|
+
exports.default = Scenario;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AbstractApiEntity_1 = __importDefault(require("@wexample/js-api/Common/AbstractApiEntity"));
|
|
7
|
+
class Session extends AbstractApiEntity_1.default {
|
|
8
|
+
constructor(data = {}) {
|
|
9
|
+
super(data);
|
|
10
|
+
this.title = data['title'];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
Session.entityName = 'session';
|
|
14
|
+
exports.default = Session;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import AbstractApiEntity, { type ApiEntityData } from '@wexample/js-api/Common/AbstractApiEntity';
|
|
2
|
+
export default class User extends AbstractApiEntity {
|
|
3
|
+
static readonly entityName = "user";
|
|
4
|
+
username?: string;
|
|
5
|
+
dateCreated?: Date | null;
|
|
6
|
+
dateLastLogin?: Date | null;
|
|
7
|
+
email?: string;
|
|
8
|
+
firstName?: string;
|
|
9
|
+
lastName?: string;
|
|
10
|
+
constructor(data?: ApiEntityData);
|
|
11
|
+
private parseDate;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AbstractApiEntity_1 = __importDefault(require("@wexample/js-api/Common/AbstractApiEntity"));
|
|
7
|
+
class User extends AbstractApiEntity_1.default {
|
|
8
|
+
constructor(data = {}) {
|
|
9
|
+
super(data);
|
|
10
|
+
this.username = data['username'];
|
|
11
|
+
this.dateCreated = this.parseDate(data['date_created']);
|
|
12
|
+
this.dateLastLogin = this.parseDate(data['date_last_login']);
|
|
13
|
+
this.email = data['email'];
|
|
14
|
+
this.firstName = data['first_name'];
|
|
15
|
+
this.lastName = data['last_name'];
|
|
16
|
+
}
|
|
17
|
+
parseDate(value) {
|
|
18
|
+
if (!value) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const date = new Date(String(value));
|
|
22
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
User.entityName = 'user';
|
|
26
|
+
exports.default = User;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AbstractApiRepository_1 = __importDefault(require("@wexample/js-api/Common/AbstractApiRepository"));
|
|
7
|
+
const Scenario_1 = __importDefault(require("../Entity/Scenario"));
|
|
8
|
+
class ScenarioRepository extends AbstractApiRepository_1.default {
|
|
9
|
+
static getEntityType() {
|
|
10
|
+
return Scenario_1.default;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.default = ScenarioRepository;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AbstractApiRepository_1 = __importDefault(require("@wexample/js-api/Common/AbstractApiRepository"));
|
|
7
|
+
const Session_1 = __importDefault(require("../Entity/Session"));
|
|
8
|
+
class SessionRepository extends AbstractApiRepository_1.default {
|
|
9
|
+
static getEntityType() {
|
|
10
|
+
return Session_1.default;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.default = SessionRepository;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const AbstractApiRepository_1 = __importDefault(require("@wexample/js-api/Common/AbstractApiRepository"));
|
|
7
|
+
const User_1 = __importDefault(require("../Entity/User"));
|
|
8
|
+
class UserRepository extends AbstractApiRepository_1.default {
|
|
9
|
+
static getEntityType() {
|
|
10
|
+
return User_1.default;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.default = UserRepository;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Scenario_1 = __importDefault(require("../../../Entity/Scenario"));
|
|
7
|
+
exports.default = {
|
|
8
|
+
methods: {
|
|
9
|
+
getEntityClass() {
|
|
10
|
+
return Scenario_1.default;
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Session_1 = __importDefault(require("../../../Entity/Session"));
|
|
7
|
+
exports.default = {
|
|
8
|
+
methods: {
|
|
9
|
+
getEntityClass() {
|
|
10
|
+
return Session_1.default;
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const User_1 = __importDefault(require("../../../Entity/User"));
|
|
7
|
+
exports.default = {
|
|
8
|
+
methods: {
|
|
9
|
+
getEntityClass() {
|
|
10
|
+
return User_1.default;
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syrtis-ai/syrtis-javascript-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "Syrtis JavaScript/TypeScript client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@wexample/js-
|
|
29
|
+
"@wexample/js-api": "0.0.7"
|
|
30
30
|
},
|
|
31
31
|
"repository": "https://github.com/Syrtis-AI/syrtis-javascript-client"
|
|
32
32
|
}
|