@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @syrtis-ai/syrtis-javascript-client
2
2
 
3
- Version: 0.0.17
3
+ Version: 0.0.35
4
4
 
5
5
  Syrtis JavaScript/TypeScript client
6
6
 
@@ -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,6 @@
1
+ import AbstractApiEntity, { type ApiEntityData } from '@wexample/js-api/Common/AbstractApiEntity';
2
+ export default class Scenario extends AbstractApiEntity {
3
+ static readonly entityName = "scenario";
4
+ title?: string;
5
+ constructor(data?: ApiEntityData);
6
+ }
@@ -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,6 @@
1
+ import AbstractApiEntity, { type ApiEntityData } from '@wexample/js-api/Common/AbstractApiEntity';
2
+ export default class Session extends AbstractApiEntity {
3
+ static readonly entityName = "session";
4
+ title?: string;
5
+ constructor(data?: ApiEntityData);
6
+ }
@@ -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,5 @@
1
+ import AbstractApiRepository from '@wexample/js-api/Common/AbstractApiRepository';
2
+ import Scenario from '../Entity/Scenario';
3
+ export default class ScenarioRepository extends AbstractApiRepository<Scenario> {
4
+ static getEntityType(): typeof Scenario;
5
+ }
@@ -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,5 @@
1
+ import AbstractApiRepository from '@wexample/js-api/Common/AbstractApiRepository';
2
+ import Session from '../Entity/Session';
3
+ export default class SessionRepository extends AbstractApiRepository<Session> {
4
+ static getEntityType(): typeof Session;
5
+ }
@@ -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,5 @@
1
+ import AbstractApiRepository from '@wexample/js-api/Common/AbstractApiRepository';
2
+ import User from '../Entity/User';
3
+ export default class UserRepository extends AbstractApiRepository<User> {
4
+ static getEntityType(): typeof User;
5
+ }
@@ -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,7 @@
1
+ import Scenario from '../../../Entity/Scenario';
2
+ declare const _default: {
3
+ methods: {
4
+ getEntityClass(): typeof Scenario;
5
+ };
6
+ };
7
+ export default _default;
@@ -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,7 @@
1
+ import Session from '../../../Entity/Session';
2
+ declare const _default: {
3
+ methods: {
4
+ getEntityClass(): typeof Session;
5
+ };
6
+ };
7
+ export default _default;
@@ -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,7 @@
1
+ import User from '../../../Entity/User';
2
+ declare const _default: {
3
+ methods: {
4
+ getEntityClass(): typeof User;
5
+ };
6
+ };
7
+ export default _default;
@@ -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.17",
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-app": "0.0.20"
29
+ "@wexample/js-api": "0.0.7"
30
30
  },
31
31
  "repository": "https://github.com/Syrtis-AI/syrtis-javascript-client"
32
32
  }