@toa.io/core 1.0.0-alpha.15 → 1.0.0-alpha.154

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.
@@ -0,0 +1,18 @@
1
+ import { Component } from './component'
2
+
3
+ export class Remote extends Component {
4
+ explain (endpoint: string): Promise<Explanation>
5
+ }
6
+
7
+ interface Explanation {
8
+ input: Schema | null
9
+ output: Schema | null
10
+ errors?: string[]
11
+ }
12
+
13
+ interface Schema {
14
+ type: string
15
+ properties: {
16
+ [key: string]: Schema
17
+ }
18
+ }
@@ -3,6 +3,7 @@ import { Exception } from './exception'
3
3
  export interface Query {
4
4
  id?: string
5
5
  criteria?: string
6
+ search?: string
6
7
  omit?: number
7
8
  limit?: number
8
9
  sort?: Array<string>
@@ -14,6 +15,7 @@ export interface Request {
14
15
  input?: any
15
16
  query?: Query
16
17
  authentic?: boolean
18
+ task?: boolean
17
19
  }
18
20
 
19
21
  export interface Reply {
@@ -30,36 +30,37 @@ declare namespace toa.core {
30
30
  id?: string
31
31
  version?: number
32
32
  criteria?: ast.Node
33
+ search?: string
33
34
  options?: Object
34
35
  }
35
36
 
36
37
  interface Migration {
37
- disconnect(): Promise<void>
38
+ disconnect (): Promise<void>
38
39
 
39
- database(name: string): Promise<void>
40
+ database (name: string): Promise<void>
40
41
 
41
- table(database: string, locator: Locator, schema: Object, reset?: boolean): Promise<string>
42
+ table (database: string, locator: Locator, schema: Object, reset?: boolean): Promise<string>
42
43
  }
43
44
 
44
45
  interface Factory {
45
- storage(locator: Locator, properties?: object): Storage
46
+ storage (locator: Locator, properties?: object): Storage
46
47
 
47
- migration?(driver?: string): Migration
48
+ migration? (driver?: string): Migration
48
49
  }
49
50
  }
50
51
 
51
52
  interface Storage extends Connector {
52
53
  // object observation
53
- get?(query: storages.Query): Promise<storages.Record | null>
54
+ get? (query: storages.Query): Promise<storages.Record | null>
54
55
 
55
56
  // objects observation
56
- find?(query: storages.Query): Promise<storages.Record[]>
57
+ find? (query: storages.Query): Promise<storages.Record[]>
57
58
 
58
59
  // commit
59
- store?(record: storages.Record): Promise<boolean>
60
+ store? (record: storages.Record): Promise<boolean>
60
61
 
61
62
  // assignment
62
- upsert?(query: storages.Query, changeset: Object, insert: storages.Record): Promise<storages.Record>
63
+ upsert? (query: storages.Query, changeset: Object, insert: storages.Record): Promise<storages.Record>
63
64
  }
64
65
 
65
66
  }
@@ -1,21 +0,0 @@
1
- 'use strict'
2
-
3
- const { SystemException } = require('../exceptions')
4
-
5
- class Conditions {
6
- #schema
7
-
8
- constructor (schema) {
9
- this.#schema = schema
10
- }
11
-
12
- fit (value) {
13
- const error = this.#schema.fit(value)
14
-
15
- if (error !== null) throw new this.constructor.Exception(error)
16
- }
17
-
18
- static Exception = SystemException
19
- }
20
-
21
- exports.Conditions = Conditions