flamerest 1.0.39 → 1.0.40

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.
Files changed (2) hide show
  1. package/REST.d.ts +15 -2
  2. package/package.json +1 -1
package/REST.d.ts CHANGED
@@ -63,7 +63,7 @@ export function one<T>(table: string, IDOrWhere: number | string | object, field
63
63
  * @param table
64
64
  * @param values
65
65
  */
66
- export function create<T>(table: string, values: object): Promise<T>
66
+ export function create<T>(table: string, values: object): Promise<SavedObject<T>>
67
67
 
68
68
  /**
69
69
  * Удалить запись
@@ -79,7 +79,20 @@ export function remove(table: string, id: number | string, byFields?: object): P
79
79
  * @param ID
80
80
  * @param values
81
81
  */
82
- export function edit<T>(table: string, ID: number | string, values: object): Promise<T>
82
+ export function edit<T>(table: string, ID: number | string, values: object): Promise<SavedObject<T>>
83
+
84
+
85
+ /**
86
+ * Стандартный ответ от Request с изменённой строкой
87
+ */
88
+ type SavedObject<T> = {
89
+ type: string,
90
+ status: Number,
91
+ ok: boolean,
92
+ data?: T,
93
+ errors: Object | undefined,
94
+ message: string | undefined,
95
+ }
83
96
 
84
97
  /**
85
98
  * Получить схемы всех таблиц
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flamerest",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "",
5
5
  "main": "REST.js",
6
6
  "typings": "./REST.d.ts",