@azrico/webobject 1.5.69 → 1.5.71
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/dist/index.d.ts +1 -1
- package/dist/src/WebObjects/ParentWebObject.d.ts +24 -24
- package/dist/src/WebObjects/ParentWebObject.js +7 -7
- package/dist/src/WebObjects/WebObject.d.ts +153 -153
- package/dist/src/WebObjects/WebObject.js +476 -561
- package/dist/src/WebObjects/WebObjectHelper.d.ts +9 -9
- package/dist/src/WebObjects/WebObjectHelper.js +4 -4
- package/dist/src/WebObjects/WebObjectHelper.test.d.ts +1 -1
- package/dist/src/WebObjects/WebObjectHelper.test.js +1 -1
- package/dist/src/WebObjects/WebObjectManager.d.ts +68 -68
- package/dist/src/WebObjects/WebObjectManager.js +303 -350
- package/dist/src/WebObjects/WebObjectPathHelper.d.ts +36 -36
- package/dist/src/WebObjects/WebObjectPathHelper.js +31 -39
- package/dist/src/WebObjects/WebObjectPathHelper.test.d.ts +1 -1
- package/dist/src/WebObjects/WebObjectPathHelper.test.js +55 -61
- package/dist/src/index.d.ts +10 -10
- package/dist/src/structs/DummyObject.d.ts +5 -5
- package/dist/src/structs/DummyObject.js +1 -1
- package/dist/src/structs/MapableObject.d.ts +43 -43
- package/dist/src/structs/MapableObject.js +3 -3
- package/dist/src/structs/MetaObject.d.ts +15 -15
- package/dist/src/structs/MetaObject.js +19 -25
- package/dist/src/structs/ObjectArray.d.ts +10 -10
- package/dist/src/structs/ObjectArray.js +1 -1
- package/dist/src/structs/ObjectManager.d.ts +140 -140
- package/dist/src/structs/ObjectManager.js +202 -223
- package/dist/src/structs/ObjectWithTemp.d.ts +17 -17
- package/dist/src/structs/ObjectWithTemp.js +13 -17
- package/dist/src/structs/SimpleObject.d.ts +318 -303
- package/dist/src/structs/SimpleObject.js +423 -467
- package/package.json +63 -82
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./src/index";
|
|
1
|
+
export * from "./src/index";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import WebObject from "./WebObject";
|
|
2
|
-
type mrow = {
|
|
3
|
-
__parent__table_id: any;
|
|
4
|
-
__table_id: any;
|
|
5
|
-
__children?: any[];
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* This web object contains some more webobjects
|
|
9
|
-
*/
|
|
10
|
-
export declare class ParentWebObject extends WebObject {
|
|
11
|
-
constructor(is_readonly?: boolean);
|
|
12
|
-
__children: WebObject[] | undefined;
|
|
13
|
-
set_children(val: WebObject[] | undefined): void;
|
|
14
|
-
private static getParentTableId;
|
|
15
|
-
private static getTableId;
|
|
16
|
-
static fixChildParentRelations<T extends mrow>(rows: T[]): T[];
|
|
17
|
-
/**
|
|
18
|
-
* assign children of row based on all_rows
|
|
19
|
-
* @param row
|
|
20
|
-
* @param all_rows
|
|
21
|
-
*/
|
|
22
|
-
private static assignChildren;
|
|
23
|
-
}
|
|
24
|
-
export default ParentWebObject;
|
|
1
|
+
import WebObject from "./WebObject";
|
|
2
|
+
type mrow = {
|
|
3
|
+
__parent__table_id: any;
|
|
4
|
+
__table_id: any;
|
|
5
|
+
__children?: any[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* This web object contains some more webobjects
|
|
9
|
+
*/
|
|
10
|
+
export declare class ParentWebObject extends WebObject {
|
|
11
|
+
constructor(is_readonly?: boolean);
|
|
12
|
+
__children: WebObject[] | undefined;
|
|
13
|
+
set_children(val: WebObject[] | undefined): void;
|
|
14
|
+
private static getParentTableId;
|
|
15
|
+
private static getTableId;
|
|
16
|
+
static fixChildParentRelations<T extends mrow>(rows: T[]): T[];
|
|
17
|
+
/**
|
|
18
|
+
* assign children of row based on all_rows
|
|
19
|
+
* @param row
|
|
20
|
+
* @param all_rows
|
|
21
|
+
*/
|
|
22
|
+
private static assignChildren;
|
|
23
|
+
}
|
|
24
|
+
export default ParentWebObject;
|
|
@@ -19,9 +19,9 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
|
|
|
19
19
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
20
20
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
21
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
-
function _toPrimitive(t,
|
|
23
|
-
/**
|
|
24
|
-
* This web object contains some more webobjects
|
|
22
|
+
function _toPrimitive(t, e) { if ("object" != _typeof(t) || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
|
|
23
|
+
/**
|
|
24
|
+
* This web object contains some more webobjects
|
|
25
25
|
*/
|
|
26
26
|
var ParentWebObject = exports.ParentWebObject = /*#__PURE__*/function (_WebObject) {
|
|
27
27
|
function ParentWebObject() {
|
|
@@ -94,10 +94,10 @@ var ParentWebObject = exports.ParentWebObject = /*#__PURE__*/function (_WebObjec
|
|
|
94
94
|
return r.data;
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
/**
|
|
98
|
-
* assign children of row based on all_rows
|
|
99
|
-
* @param row
|
|
100
|
-
* @param all_rows
|
|
97
|
+
/**
|
|
98
|
+
* assign children of row based on all_rows
|
|
99
|
+
* @param row
|
|
100
|
+
* @param all_rows
|
|
101
101
|
*/
|
|
102
102
|
}, {
|
|
103
103
|
key: "assignChildren",
|
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
import { SimpleObject, deltaParams, sendChangesType } from "../index";
|
|
2
|
-
import { WebObjectManager } from "../index";
|
|
3
|
-
export type ObjectWithUsers = Partial<{
|
|
4
|
-
_creator: string;
|
|
5
|
-
_users: string[];
|
|
6
|
-
attentions: string[];
|
|
7
|
-
}>;
|
|
8
|
-
export declare class WebObject extends SimpleObject {
|
|
9
|
-
static readonly __web_path: string;
|
|
10
|
-
static readonly __protectedProperties: string[];
|
|
11
|
-
static readonly __requiredProperties: never[];
|
|
12
|
-
meta_data: {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
};
|
|
15
|
-
_created_date?: string | Date;
|
|
16
|
-
_creator?: string;
|
|
17
|
-
_users?: string[];
|
|
18
|
-
constructor(is_readonly?: boolean);
|
|
19
|
-
/**
|
|
20
|
-
* get a list of all user ids that work on the given object
|
|
21
|
-
* _creator + _users + attentions(old)
|
|
22
|
-
* removes duplicates
|
|
23
|
-
* @returns array of ids
|
|
24
|
-
*/
|
|
25
|
-
getAllUsers(): string[];
|
|
26
|
-
/**
|
|
27
|
-
* get a unique list of all user ids that work on the given object
|
|
28
|
-
* `_creator + _users + attentions`
|
|
29
|
-
* @returns array of ids
|
|
30
|
-
*/
|
|
31
|
-
static getAllUsers(obj: ObjectWithUsers): string[];
|
|
32
|
-
/**
|
|
33
|
-
* Update meta value of this object , meta data is stored in meta_data variable
|
|
34
|
-
* @param key
|
|
35
|
-
* @param value
|
|
36
|
-
* @param sendChange
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
setMetaValue(key: string, value: any, sendChange?: sendChangesType): Promise<boolean>;
|
|
40
|
-
/**
|
|
41
|
-
* Get meta value by key
|
|
42
|
-
* @param key
|
|
43
|
-
* @returns value or undefined
|
|
44
|
-
*/
|
|
45
|
-
getMetaValue(key: string): any;
|
|
46
|
-
/**
|
|
47
|
-
* Get meta value by key
|
|
48
|
-
* @param o
|
|
49
|
-
* @param key
|
|
50
|
-
* @returns value or undefined
|
|
51
|
-
*/
|
|
52
|
-
static getMetaValue(o: WebObject | null | undefined, key: string): any | undefined;
|
|
53
|
-
static zipSaveList(svlist: any): string;
|
|
54
|
-
static unzipSaveList(svlist: any): any[];
|
|
55
|
-
static saveList(itemList: WebObject[], extraOptions?: {
|
|
56
|
-
[key: string]: any;
|
|
57
|
-
}): Promise<boolean>;
|
|
58
|
-
Save(): Promise<any>;
|
|
59
|
-
Delete(): Promise<any>;
|
|
60
|
-
Lock(): Promise<any>;
|
|
61
|
-
UnLock(): Promise<any>;
|
|
62
|
-
Archive(): Promise<any>;
|
|
63
|
-
UnArchive(): Promise<any>;
|
|
64
|
-
canSave(deltaObj?: any): true | string;
|
|
65
|
-
canDelete(): boolean;
|
|
66
|
-
canArchive(): boolean;
|
|
67
|
-
deltaIsValid(d: any): true | string;
|
|
68
|
-
/**
|
|
69
|
-
* converts this object to an basic object
|
|
70
|
-
* that can be passed into client components from server components
|
|
71
|
-
*
|
|
72
|
-
* uses `get_fullDeltaObject`
|
|
73
|
-
* @param p
|
|
74
|
-
* @returns
|
|
75
|
-
*/
|
|
76
|
-
get_basicObject(): Promise<Partial<this>>;
|
|
77
|
-
/**
|
|
78
|
-
* calls the `get_deltaObject` with
|
|
79
|
-
* `allProperties` `extraProperties`
|
|
80
|
-
* set to true
|
|
81
|
-
*
|
|
82
|
-
* @returns
|
|
83
|
-
*/
|
|
84
|
-
get_fullDeltaObject(p?: deltaParams): Promise<any>;
|
|
85
|
-
/**
|
|
86
|
-
* calls the `get_deltaObject` with
|
|
87
|
-
* `allProperties` `extraProperties` `tempProperties`
|
|
88
|
-
* set to true
|
|
89
|
-
*
|
|
90
|
-
* @returns
|
|
91
|
-
*/
|
|
92
|
-
get_fullObject(p?: deltaParams): Promise<any>;
|
|
93
|
-
/**
|
|
94
|
-
* You will post this to the server for saving
|
|
95
|
-
* automatically removes unchangeable fields
|
|
96
|
-
* @returns
|
|
97
|
-
*/
|
|
98
|
-
get_deltaObject(p?: deltaParams): Promise<any>;
|
|
99
|
-
get manager(): WebObjectManager<any> | undefined;
|
|
100
|
-
get __web_path(): string;
|
|
101
|
-
get_webpath(): string;
|
|
102
|
-
static get_webpath(): string;
|
|
103
|
-
static get_dbname(): string;
|
|
104
|
-
onDelete(...p: any): Promise<any>;
|
|
105
|
-
onArchive(...p: any): Promise<any>;
|
|
106
|
-
onUnArchive(...p: any): Promise<any>;
|
|
107
|
-
onLock(...p: any): Promise<any>;
|
|
108
|
-
onUnLock(...p: any): Promise<any>;
|
|
109
|
-
onLoad(...p: any): Promise<any>;
|
|
110
|
-
onSave(...p: any): Promise<any>;
|
|
111
|
-
onAfterSave(...p: any): Promise<any>;
|
|
112
|
-
getSaveResult(original?: boolean): any;
|
|
113
|
-
onNew(...p: any): Promise<any>;
|
|
114
|
-
saveResultHasID(s: any): any;
|
|
115
|
-
static saveResultHasID(s: any): any;
|
|
116
|
-
/**
|
|
117
|
-
* Load Id and _index_value from the given save result into our object
|
|
118
|
-
* @param o
|
|
119
|
-
* @param srObject
|
|
120
|
-
* @returns
|
|
121
|
-
*/
|
|
122
|
-
static LoadIdsFromSaveResult(o: WebObject, srObject: any): void;
|
|
123
|
-
/**
|
|
124
|
-
* get a single web object
|
|
125
|
-
* default order of parameters : search,readonly,fetchID
|
|
126
|
-
*/
|
|
127
|
-
static get_single(...p: any[]): Promise<WebObject | any | undefined>;
|
|
128
|
-
/**
|
|
129
|
-
* Get a list of web objects
|
|
130
|
-
* default order of parameters : search,readonly,fetchID
|
|
131
|
-
*/
|
|
132
|
-
static get_list(...p: any[]): Promise<Array<WebObject | any>>;
|
|
133
|
-
/**
|
|
134
|
-
* uses `get_list` and then saves the result to `gcache`
|
|
135
|
-
* then uses the `equals` function to return matched results
|
|
136
|
-
* @param search
|
|
137
|
-
* @returns
|
|
138
|
-
*/
|
|
139
|
-
static get_list_cache(search?: any): Promise<Array<WebObject>>;
|
|
140
|
-
/**
|
|
141
|
-
* uses `get_list_cache` then the `equals` function to return matched result
|
|
142
|
-
* @param search
|
|
143
|
-
* @returns
|
|
144
|
-
*/
|
|
145
|
-
static get_single_cache(search: any): Promise<WebObject | undefined>;
|
|
146
|
-
/**
|
|
147
|
-
* Get a list of web objects and convert them to basic objects
|
|
148
|
-
* can be passed to client components
|
|
149
|
-
* default order of parameters : search,readonly,fetchID
|
|
150
|
-
*/
|
|
151
|
-
static get_basicList(...p: any[]): Promise<any[]>;
|
|
152
|
-
}
|
|
153
|
-
export default WebObject;
|
|
1
|
+
import { SimpleObject, deltaParams, sendChangesType } from "../index";
|
|
2
|
+
import { WebObjectManager } from "../index";
|
|
3
|
+
export type ObjectWithUsers = Partial<{
|
|
4
|
+
_creator: string;
|
|
5
|
+
_users: string[];
|
|
6
|
+
attentions: string[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare class WebObject extends SimpleObject {
|
|
9
|
+
static readonly __web_path: string;
|
|
10
|
+
static readonly __protectedProperties: string[];
|
|
11
|
+
static readonly __requiredProperties: never[];
|
|
12
|
+
meta_data: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
_created_date?: string | Date;
|
|
16
|
+
_creator?: string;
|
|
17
|
+
_users?: string[];
|
|
18
|
+
constructor(is_readonly?: boolean);
|
|
19
|
+
/**
|
|
20
|
+
* get a list of all user ids that work on the given object
|
|
21
|
+
* _creator + _users + attentions(old)
|
|
22
|
+
* removes duplicates
|
|
23
|
+
* @returns array of ids
|
|
24
|
+
*/
|
|
25
|
+
getAllUsers(): string[];
|
|
26
|
+
/**
|
|
27
|
+
* get a unique list of all user ids that work on the given object
|
|
28
|
+
* `_creator + _users + attentions`
|
|
29
|
+
* @returns array of ids
|
|
30
|
+
*/
|
|
31
|
+
static getAllUsers(obj: ObjectWithUsers): string[];
|
|
32
|
+
/**
|
|
33
|
+
* Update meta value of this object , meta data is stored in meta_data variable
|
|
34
|
+
* @param key
|
|
35
|
+
* @param value
|
|
36
|
+
* @param sendChange
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
setMetaValue(key: string, value: any, sendChange?: sendChangesType): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Get meta value by key
|
|
42
|
+
* @param key
|
|
43
|
+
* @returns value or undefined
|
|
44
|
+
*/
|
|
45
|
+
getMetaValue(key: string): any;
|
|
46
|
+
/**
|
|
47
|
+
* Get meta value by key
|
|
48
|
+
* @param o
|
|
49
|
+
* @param key
|
|
50
|
+
* @returns value or undefined
|
|
51
|
+
*/
|
|
52
|
+
static getMetaValue(o: WebObject | null | undefined, key: string): any | undefined;
|
|
53
|
+
static zipSaveList(svlist: any): string;
|
|
54
|
+
static unzipSaveList(svlist: any): any[];
|
|
55
|
+
static saveList(itemList: WebObject[], extraOptions?: {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}): Promise<boolean>;
|
|
58
|
+
Save(): Promise<any>;
|
|
59
|
+
Delete(): Promise<any>;
|
|
60
|
+
Lock(): Promise<any>;
|
|
61
|
+
UnLock(): Promise<any>;
|
|
62
|
+
Archive(): Promise<any>;
|
|
63
|
+
UnArchive(): Promise<any>;
|
|
64
|
+
canSave(deltaObj?: any): true | string;
|
|
65
|
+
canDelete(): boolean;
|
|
66
|
+
canArchive(): boolean;
|
|
67
|
+
deltaIsValid(d: any): true | string;
|
|
68
|
+
/**
|
|
69
|
+
* converts this object to an basic object
|
|
70
|
+
* that can be passed into client components from server components
|
|
71
|
+
*
|
|
72
|
+
* uses `get_fullDeltaObject`
|
|
73
|
+
* @param p
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
get_basicObject(): Promise<Partial<this>>;
|
|
77
|
+
/**
|
|
78
|
+
* calls the `get_deltaObject` with
|
|
79
|
+
* `allProperties` `extraProperties`
|
|
80
|
+
* set to true
|
|
81
|
+
*
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
84
|
+
get_fullDeltaObject(p?: deltaParams): Promise<any>;
|
|
85
|
+
/**
|
|
86
|
+
* calls the `get_deltaObject` with
|
|
87
|
+
* `allProperties` `extraProperties` `tempProperties`
|
|
88
|
+
* set to true
|
|
89
|
+
*
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
92
|
+
get_fullObject(p?: deltaParams): Promise<any>;
|
|
93
|
+
/**
|
|
94
|
+
* You will post this to the server for saving
|
|
95
|
+
* automatically removes unchangeable fields
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
get_deltaObject(p?: deltaParams): Promise<any>;
|
|
99
|
+
get manager(): WebObjectManager<any> | undefined;
|
|
100
|
+
get __web_path(): string;
|
|
101
|
+
get_webpath(): string;
|
|
102
|
+
static get_webpath(): string;
|
|
103
|
+
static get_dbname(): string;
|
|
104
|
+
onDelete(...p: any): Promise<any>;
|
|
105
|
+
onArchive(...p: any): Promise<any>;
|
|
106
|
+
onUnArchive(...p: any): Promise<any>;
|
|
107
|
+
onLock(...p: any): Promise<any>;
|
|
108
|
+
onUnLock(...p: any): Promise<any>;
|
|
109
|
+
onLoad(...p: any): Promise<any>;
|
|
110
|
+
onSave(...p: any): Promise<any>;
|
|
111
|
+
onAfterSave(...p: any): Promise<any>;
|
|
112
|
+
getSaveResult(original?: boolean): any;
|
|
113
|
+
onNew(...p: any): Promise<any>;
|
|
114
|
+
saveResultHasID(s: any): any;
|
|
115
|
+
static saveResultHasID(s: any): any;
|
|
116
|
+
/**
|
|
117
|
+
* Load Id and _index_value from the given save result into our object
|
|
118
|
+
* @param o
|
|
119
|
+
* @param srObject
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
static LoadIdsFromSaveResult(o: WebObject, srObject: any): void;
|
|
123
|
+
/**
|
|
124
|
+
* get a single web object
|
|
125
|
+
* default order of parameters : search,readonly,fetchID
|
|
126
|
+
*/
|
|
127
|
+
static get_single(...p: any[]): Promise<WebObject | any | undefined>;
|
|
128
|
+
/**
|
|
129
|
+
* Get a list of web objects
|
|
130
|
+
* default order of parameters : search,readonly,fetchID
|
|
131
|
+
*/
|
|
132
|
+
static get_list(...p: any[]): Promise<Array<WebObject | any>>;
|
|
133
|
+
/**
|
|
134
|
+
* uses `get_list` and then saves the result to `gcache`
|
|
135
|
+
* then uses the `equals` function to return matched results
|
|
136
|
+
* @param search
|
|
137
|
+
* @returns
|
|
138
|
+
*/
|
|
139
|
+
static get_list_cache(search?: any): Promise<Array<WebObject>>;
|
|
140
|
+
/**
|
|
141
|
+
* uses `get_list_cache` then the `equals` function to return matched result
|
|
142
|
+
* @param search
|
|
143
|
+
* @returns
|
|
144
|
+
*/
|
|
145
|
+
static get_single_cache(search: any): Promise<WebObject | undefined>;
|
|
146
|
+
/**
|
|
147
|
+
* Get a list of web objects and convert them to basic objects
|
|
148
|
+
* can be passed to client components
|
|
149
|
+
* default order of parameters : search,readonly,fetchID
|
|
150
|
+
*/
|
|
151
|
+
static get_basicList(...p: any[]): Promise<any[]>;
|
|
152
|
+
}
|
|
153
|
+
export default WebObject;
|