jitz-sharepoint-utilities 1.10.65 → 1.11.0
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 +109 -109
- package/jitzHttpClient.ts +44 -44
- package/jitzSPHttpClient.ts +158 -158
- package/lib/common/IModels.d.ts +32 -32
- package/lib/common/IModels.js +2 -2
- package/lib/jitzHttpClient.d.ts +11 -11
- package/lib/jitzHttpClient.js +37 -37
- package/lib/jitzSPHttpClient.d.ts +30 -30
- package/lib/jitzSPHttpClient.js +191 -191
- package/lib/repositories/CommonRepository.d.ts +17 -16
- package/lib/repositories/CommonRepository.js +232 -213
- package/lib/repositories/ICommonRepository.d.ts +6 -6
- package/lib/repositories/ICommonRepository.js +2 -2
- package/lib/repositories/IRepository.d.ts +13 -13
- package/lib/repositories/IRepository.js +2 -2
- package/lib/repositories/Repository.d.ts +18 -18
- package/lib/repositories/Repository.js +392 -386
- package/lib/services/UserService.d.ts +15 -15
- package/lib/services/UserService.js +202 -202
- package/lib/services/UtilityService.d.ts +22 -22
- package/lib/services/UtilityService.js +149 -149
- package/package.json +2 -1
@@ -1,213 +1,232 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
var CommonRepository = /** @class */ (function () {
|
4
|
-
function CommonRepository(context) {
|
5
|
-
this.context = context;
|
6
|
-
}
|
7
|
-
CommonRepository.prototype.sendEmail = function (email) {
|
8
|
-
email.properties.__metadata = {
|
9
|
-
type: "SP.Utilities.EmailProperties",
|
10
|
-
};
|
11
|
-
// console.log(JSON.stringify(email.properties));
|
12
|
-
var requestUrl = this.context.siteUrl + "/_api/SP.Utilities.Utility.SendEmail";
|
13
|
-
return this.context.client
|
14
|
-
.post(requestUrl, email, {
|
15
|
-
Accept: "application/json;odata=nometadata",
|
16
|
-
"Content-type": "application/json;odata=verbose",
|
17
|
-
"odata-version": "",
|
18
|
-
})
|
19
|
-
.then(function (response) {
|
20
|
-
if (response.status >= 200 && response.status < 300) {
|
21
|
-
var json = response;
|
22
|
-
return json;
|
23
|
-
}
|
24
|
-
else {
|
25
|
-
return Promise.reject(new Error(JSON.stringify(response)));
|
26
|
-
}
|
27
|
-
});
|
28
|
-
};
|
29
|
-
CommonRepository.prototype.getData = function (listName, selectFields, expand, filters, orderBy, top, skipTokenUniqueField, skipTokenUniqueFieldValue) {
|
30
|
-
var queryUrlGetAllItems = "/_api/web/lists/GetByTitle('" + listName + "')/items";
|
31
|
-
if (selectFields != null && selectFields != "") {
|
32
|
-
queryUrlGetAllItems = queryUrlGetAllItems + "?$select=" + selectFields;
|
33
|
-
}
|
34
|
-
else {
|
35
|
-
queryUrlGetAllItems = queryUrlGetAllItems + "?$select=*";
|
36
|
-
}
|
37
|
-
if (expand != null && expand != "") {
|
38
|
-
queryUrlGetAllItems = queryUrlGetAllItems + "&$expand=" + expand;
|
39
|
-
}
|
40
|
-
if (filters != null && filters != "") {
|
41
|
-
queryUrlGetAllItems = queryUrlGetAllItems + "&$filter=" + filters;
|
42
|
-
}
|
43
|
-
if (orderBy != null && orderBy != "") {
|
44
|
-
queryUrlGetAllItems = queryUrlGetAllItems + "&$orderby=" + orderBy;
|
45
|
-
}
|
46
|
-
if (top != null && top != undefined && top > 0) {
|
47
|
-
queryUrlGetAllItems = queryUrlGetAllItems + "&$top=" + top;
|
48
|
-
}
|
49
|
-
if (skipTokenUniqueField != null &&
|
50
|
-
skipTokenUniqueField != undefined &&
|
51
|
-
skipTokenUniqueFieldValue != null &&
|
52
|
-
skipTokenUniqueFieldValue != undefined) {
|
53
|
-
if (skipTokenUniqueField == "Id" || skipTokenUniqueField == "id") {
|
54
|
-
skipTokenUniqueField = "ID";
|
55
|
-
}
|
56
|
-
queryUrlGetAllItems =
|
57
|
-
queryUrlGetAllItems +
|
58
|
-
("&$skiptoken=Paged=TRUE%26p_" + skipTokenUniqueField + "=" + skipTokenUniqueFieldValue);
|
59
|
-
}
|
60
|
-
return this.context.client
|
61
|
-
.get(queryUrlGetAllItems)
|
62
|
-
.then(function (response) {
|
63
|
-
if (response.status >= 200 && response.status < 300) {
|
64
|
-
return response.data.d;
|
65
|
-
}
|
66
|
-
else {
|
67
|
-
return Promise.reject(new Error(JSON.stringify(response)));
|
68
|
-
}
|
69
|
-
})
|
70
|
-
.then(function (data) {
|
71
|
-
return data;
|
72
|
-
})
|
73
|
-
.catch(function (ex) {
|
74
|
-
console.log("load Items > JitzSPHttpClient.get()...catch:", ex);
|
75
|
-
throw ex;
|
76
|
-
});
|
77
|
-
};
|
78
|
-
CommonRepository.prototype.get = function (url) {
|
79
|
-
return this.context.client
|
80
|
-
.get(url)
|
81
|
-
.then(function (response) {
|
82
|
-
if (response.status >= 200 && response.status < 300) {
|
83
|
-
return response.data.d;
|
84
|
-
}
|
85
|
-
else {
|
86
|
-
return Promise.reject(new Error(JSON.stringify(response)));
|
87
|
-
}
|
88
|
-
})
|
89
|
-
.then(function (data) {
|
90
|
-
return data;
|
91
|
-
})
|
92
|
-
.catch(function (ex) {
|
93
|
-
console.log("load Items > JitzSPHttpClient.get()...catch:", ex);
|
94
|
-
throw ex;
|
95
|
-
});
|
96
|
-
};
|
97
|
-
CommonRepository.prototype.
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
return
|
132
|
-
}
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
}
|
193
|
-
});
|
194
|
-
};
|
195
|
-
CommonRepository.prototype.
|
196
|
-
var
|
197
|
-
return
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
}
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
}
|
213
|
-
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var CommonRepository = /** @class */ (function () {
|
4
|
+
function CommonRepository(context) {
|
5
|
+
this.context = context;
|
6
|
+
}
|
7
|
+
CommonRepository.prototype.sendEmail = function (email) {
|
8
|
+
email.properties.__metadata = {
|
9
|
+
type: "SP.Utilities.EmailProperties",
|
10
|
+
};
|
11
|
+
// console.log(JSON.stringify(email.properties));
|
12
|
+
var requestUrl = this.context.siteUrl + "/_api/SP.Utilities.Utility.SendEmail";
|
13
|
+
return this.context.client
|
14
|
+
.post(requestUrl, email, {
|
15
|
+
Accept: "application/json;odata=nometadata",
|
16
|
+
"Content-type": "application/json;odata=verbose",
|
17
|
+
"odata-version": "",
|
18
|
+
})
|
19
|
+
.then(function (response) {
|
20
|
+
if (response.status >= 200 && response.status < 300) {
|
21
|
+
var json = response;
|
22
|
+
return json;
|
23
|
+
}
|
24
|
+
else {
|
25
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
26
|
+
}
|
27
|
+
});
|
28
|
+
};
|
29
|
+
CommonRepository.prototype.getData = function (listName, selectFields, expand, filters, orderBy, top, skipTokenUniqueField, skipTokenUniqueFieldValue) {
|
30
|
+
var queryUrlGetAllItems = "/_api/web/lists/GetByTitle('" + listName + "')/items";
|
31
|
+
if (selectFields != null && selectFields != "") {
|
32
|
+
queryUrlGetAllItems = queryUrlGetAllItems + "?$select=" + selectFields;
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
queryUrlGetAllItems = queryUrlGetAllItems + "?$select=*";
|
36
|
+
}
|
37
|
+
if (expand != null && expand != "") {
|
38
|
+
queryUrlGetAllItems = queryUrlGetAllItems + "&$expand=" + expand;
|
39
|
+
}
|
40
|
+
if (filters != null && filters != "") {
|
41
|
+
queryUrlGetAllItems = queryUrlGetAllItems + "&$filter=" + filters;
|
42
|
+
}
|
43
|
+
if (orderBy != null && orderBy != "") {
|
44
|
+
queryUrlGetAllItems = queryUrlGetAllItems + "&$orderby=" + orderBy;
|
45
|
+
}
|
46
|
+
if (top != null && top != undefined && top > 0) {
|
47
|
+
queryUrlGetAllItems = queryUrlGetAllItems + "&$top=" + top;
|
48
|
+
}
|
49
|
+
if (skipTokenUniqueField != null &&
|
50
|
+
skipTokenUniqueField != undefined &&
|
51
|
+
skipTokenUniqueFieldValue != null &&
|
52
|
+
skipTokenUniqueFieldValue != undefined) {
|
53
|
+
if (skipTokenUniqueField == "Id" || skipTokenUniqueField == "id") {
|
54
|
+
skipTokenUniqueField = "ID";
|
55
|
+
}
|
56
|
+
queryUrlGetAllItems =
|
57
|
+
queryUrlGetAllItems +
|
58
|
+
("&$skiptoken=Paged=TRUE%26p_" + skipTokenUniqueField + "=" + skipTokenUniqueFieldValue);
|
59
|
+
}
|
60
|
+
return this.context.client
|
61
|
+
.get(queryUrlGetAllItems)
|
62
|
+
.then(function (response) {
|
63
|
+
if (response.status >= 200 && response.status < 300) {
|
64
|
+
return response.data.d;
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
68
|
+
}
|
69
|
+
})
|
70
|
+
.then(function (data) {
|
71
|
+
return data;
|
72
|
+
})
|
73
|
+
.catch(function (ex) {
|
74
|
+
console.log("load Items > JitzSPHttpClient.get()...catch:", ex);
|
75
|
+
throw ex;
|
76
|
+
});
|
77
|
+
};
|
78
|
+
CommonRepository.prototype.get = function (url) {
|
79
|
+
return this.context.client
|
80
|
+
.get(url)
|
81
|
+
.then(function (response) {
|
82
|
+
if (response.status >= 200 && response.status < 300) {
|
83
|
+
return response.data.d;
|
84
|
+
}
|
85
|
+
else {
|
86
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
87
|
+
}
|
88
|
+
})
|
89
|
+
.then(function (data) {
|
90
|
+
return data;
|
91
|
+
})
|
92
|
+
.catch(function (ex) {
|
93
|
+
console.log("load Items > JitzSPHttpClient.get()...catch:", ex);
|
94
|
+
throw ex;
|
95
|
+
});
|
96
|
+
};
|
97
|
+
CommonRepository.prototype.post = function (url, data, header) {
|
98
|
+
return this.context.client
|
99
|
+
.post(url, data, header)
|
100
|
+
.then(function (response) {
|
101
|
+
if (response.status >= 200 && response.status < 300) {
|
102
|
+
return response.data;
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
106
|
+
}
|
107
|
+
})
|
108
|
+
.then(function (data) {
|
109
|
+
return data;
|
110
|
+
})
|
111
|
+
.catch(function (ex) {
|
112
|
+
console.log("load Items > JitzSPHttpClient.get()...catch:", ex);
|
113
|
+
throw ex;
|
114
|
+
});
|
115
|
+
};
|
116
|
+
CommonRepository.prototype.getFiles = function (libraryName, selectFields, filter, expandFields) {
|
117
|
+
var url = "/_api/web/lists/getbytitle('" + libraryName + "')/Items?$select=*,File/Name,File/ServerRelativeUrl";
|
118
|
+
if (selectFields != undefined && selectFields.length > 0) {
|
119
|
+
url = url + "," + selectFields;
|
120
|
+
}
|
121
|
+
if (filter != undefined && filter.length > 0) {
|
122
|
+
url = url + "&$filter=" + filter;
|
123
|
+
}
|
124
|
+
url = url + "&$expand=File";
|
125
|
+
if (expandFields != undefined && expandFields.length > 0) {
|
126
|
+
url = url + "," + expandFields;
|
127
|
+
}
|
128
|
+
return this.context.client.get(url).then(function (response) {
|
129
|
+
if (response.status >= 200 && response.status <= 300) {
|
130
|
+
var json = response.data.d.results;
|
131
|
+
return json;
|
132
|
+
}
|
133
|
+
else {
|
134
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
135
|
+
}
|
136
|
+
});
|
137
|
+
};
|
138
|
+
CommonRepository.prototype.uploadFile = function (libraryName, fileName, arrayBuffer) {
|
139
|
+
return this.context.client
|
140
|
+
.postWithOutStringify("/_api/Web/Lists/getByTitle('" + libraryName + "')/RootFolder/Files/Add(url='" + fileName + "', overwrite=true)", arrayBuffer, {
|
141
|
+
Accept: "application/json;odata=verbose",
|
142
|
+
"content-length": arrayBuffer.byteLength.toString(),
|
143
|
+
})
|
144
|
+
.then(function (response) {
|
145
|
+
if (response.status >= 200 && response.status <= 300) {
|
146
|
+
var json = response.data.d;
|
147
|
+
return json;
|
148
|
+
}
|
149
|
+
else {
|
150
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
151
|
+
}
|
152
|
+
});
|
153
|
+
};
|
154
|
+
CommonRepository.prototype.getFileItem = function (libraryName, fileUrl) {
|
155
|
+
// `${this._webAbsoluteUrl}/_api/web/GetFileByServerRelativeUrl('${fileUrl}')/$value`
|
156
|
+
return this.context.client
|
157
|
+
.get("/_api/web/lists/getbytitle('" + libraryName + "')/Items?$filter=FileLeafRef eq '" + fileUrl + "'&$select=Id")
|
158
|
+
.then(function (response) {
|
159
|
+
if (response.status >= 200 && response.status <= 300) {
|
160
|
+
var json = response.data.d;
|
161
|
+
return json;
|
162
|
+
}
|
163
|
+
else {
|
164
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
165
|
+
}
|
166
|
+
});
|
167
|
+
};
|
168
|
+
CommonRepository.prototype.updateMetadata = function (listName, item) {
|
169
|
+
var _this = this;
|
170
|
+
return this.getEntityType(listName).then(function (entityType) {
|
171
|
+
item.__metadata = {
|
172
|
+
//etag: "1",
|
173
|
+
type: entityType,
|
174
|
+
};
|
175
|
+
var requestUrl = "_api/web/lists/getbytitle('" + listName + "')/items(" + item.Id + ")";
|
176
|
+
return _this.context.client
|
177
|
+
.post(requestUrl, item, {
|
178
|
+
Accept: "application/json;odata=nometadata",
|
179
|
+
"Content-type": "application/json;odata=verbose",
|
180
|
+
"odata-version": "",
|
181
|
+
"IF-MATCH": "*",
|
182
|
+
"X-HTTP-Method": "MERGE",
|
183
|
+
})
|
184
|
+
.then(function (response) {
|
185
|
+
if (response.status >= 200 && response.status < 300) {
|
186
|
+
return item;
|
187
|
+
}
|
188
|
+
else {
|
189
|
+
console.log(JSON.stringify(response));
|
190
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
191
|
+
}
|
192
|
+
});
|
193
|
+
});
|
194
|
+
};
|
195
|
+
CommonRepository.prototype.deleteFile = function (listName, id) {
|
196
|
+
var requestUrl = "_api/web/lists/getbytitle('" + listName + "')/items(" + id + ")";
|
197
|
+
return this.context.client
|
198
|
+
.post(requestUrl, {}, {
|
199
|
+
Accept: "application/json;odata=nometadata",
|
200
|
+
"Content-type": "application/json;odata=verbose",
|
201
|
+
"odata-version": "",
|
202
|
+
"IF-MATCH": "*",
|
203
|
+
"X-HTTP-Method": "DELETE",
|
204
|
+
})
|
205
|
+
.then(function (response) {
|
206
|
+
if (response.status >= 200 && response.status < 300) {
|
207
|
+
return true;
|
208
|
+
}
|
209
|
+
else {
|
210
|
+
return Promise.reject(new Error(JSON.stringify(response)));
|
211
|
+
}
|
212
|
+
});
|
213
|
+
};
|
214
|
+
CommonRepository.prototype.getEntityType = function (listName) {
|
215
|
+
var _this = this;
|
216
|
+
return new Promise(function (resolve, reject) {
|
217
|
+
_this.context.client
|
218
|
+
.get("_api/web/lists/getbytitle('" + listName + "')?$select=ListItemEntityTypeFullName")
|
219
|
+
.then(function (response) {
|
220
|
+
return response;
|
221
|
+
}, function (error) {
|
222
|
+
reject(error);
|
223
|
+
})
|
224
|
+
.then(function (response) {
|
225
|
+
var _listEntityType = response.data.d.ListItemEntityTypeFullName;
|
226
|
+
resolve(_listEntityType || "");
|
227
|
+
});
|
228
|
+
});
|
229
|
+
};
|
230
|
+
return CommonRepository;
|
231
|
+
}());
|
232
|
+
exports.default = CommonRepository;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { IJitzSPContext } from "../jitzSPHttpClient";
|
2
|
-
import { IEmail } from "../common/IModels";
|
3
|
-
export interface ICommonRepository {
|
4
|
-
context: IJitzSPContext;
|
5
|
-
sendEmail(email: IEmail): Promise<boolean>;
|
6
|
-
}
|
1
|
+
import { IJitzSPContext } from "../jitzSPHttpClient";
|
2
|
+
import { IEmail } from "../common/IModels";
|
3
|
+
export interface ICommonRepository {
|
4
|
+
context: IJitzSPContext;
|
5
|
+
sendEmail(email: IEmail): Promise<boolean>;
|
6
|
+
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { IJitzSPContext } from "../jitzSPHttpClient";
|
2
|
-
import { IModel } from "../common/IModels";
|
3
|
-
export interface IRepository<T extends IModel> {
|
4
|
-
context: IJitzSPContext;
|
5
|
-
listName: string;
|
6
|
-
getAll(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, skipTokenUniqueField?: string, skipTokenUniqueFieldValue?: string): Promise<T[]>;
|
7
|
-
itemsCount(): Promise<number>;
|
8
|
-
getItemById(id: number, selectFields?: string, expand?: string): Promise<T>;
|
9
|
-
createItem(item: T): Promise<T>;
|
10
|
-
updateItem(item: T): Promise<T>;
|
11
|
-
deleteItem(id: number): Promise<boolean>;
|
12
|
-
getAllRecursive(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, maxRecursiveCount?: number): any;
|
13
|
-
}
|
1
|
+
import { IJitzSPContext } from "../jitzSPHttpClient";
|
2
|
+
import { IModel } from "../common/IModels";
|
3
|
+
export interface IRepository<T extends IModel> {
|
4
|
+
context: IJitzSPContext;
|
5
|
+
listName: string;
|
6
|
+
getAll(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, skipTokenUniqueField?: string, skipTokenUniqueFieldValue?: string): Promise<T[]>;
|
7
|
+
itemsCount(): Promise<number>;
|
8
|
+
getItemById(id: number, selectFields?: string, expand?: string): Promise<T>;
|
9
|
+
createItem(item: T): Promise<T>;
|
10
|
+
updateItem(item: T): Promise<T>;
|
11
|
+
deleteItem(id: number): Promise<boolean>;
|
12
|
+
getAllRecursive(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, maxRecursiveCount?: number): any;
|
13
|
+
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import { IRepository } from "./IRepository";
|
2
|
-
import { IModel } from "../common/IModels";
|
3
|
-
import { IJitzSPContext } from "../jitzSPHttpClient";
|
4
|
-
export default class Repository<T extends IModel> implements IRepository<T> {
|
5
|
-
private _listEntityType?;
|
6
|
-
context: IJitzSPContext;
|
7
|
-
listName: string;
|
8
|
-
constructor(context: IJitzSPContext, listName: string);
|
9
|
-
getAll(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, skipTokenUniqueField?: string, skipTokenUniqueFieldValue?: string): Promise<T[]>;
|
10
|
-
getAllRecursive(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, maxRecursiveCount?: number): Promise<T[]>;
|
11
|
-
private recursiveFetch;
|
12
|
-
itemsCount(filters?: string): any;
|
13
|
-
getItemById(id: number, selectFields?: string, expand?: string): Promise<T>;
|
14
|
-
createItem(item: T): Promise<T>;
|
15
|
-
updateItem(item: T): Promise<T>;
|
16
|
-
deleteItem(id: number): Promise<boolean>;
|
17
|
-
private getEntityType;
|
18
|
-
}
|
1
|
+
import { IRepository } from "./IRepository";
|
2
|
+
import { IModel } from "../common/IModels";
|
3
|
+
import { IJitzSPContext } from "../jitzSPHttpClient";
|
4
|
+
export default class Repository<T extends IModel> implements IRepository<T> {
|
5
|
+
private _listEntityType?;
|
6
|
+
context: IJitzSPContext;
|
7
|
+
listName: string;
|
8
|
+
constructor(context: IJitzSPContext, listName: string);
|
9
|
+
getAll(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, skipTokenUniqueField?: string, skipTokenUniqueFieldValue?: string): Promise<T[]>;
|
10
|
+
getAllRecursive(selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, maxRecursiveCount?: number): Promise<T[]>;
|
11
|
+
private recursiveFetch;
|
12
|
+
itemsCount(filters?: string): any;
|
13
|
+
getItemById(id: number, selectFields?: string, expand?: string): Promise<T>;
|
14
|
+
createItem(item: T): Promise<T>;
|
15
|
+
updateItem(item: T): Promise<T>;
|
16
|
+
deleteItem(id: number): Promise<boolean>;
|
17
|
+
private getEntityType;
|
18
|
+
}
|