jitz-sharepoint-utilities 2.0.15 → 2.0.16
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/data/context/List.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import IJitzContext from "../interfaces/IJitzContext";
|
2
|
+
import IJitzSPContext from "../interfaces/IJitzSPContext";
|
2
3
|
import { IList } from "../interfaces/IList";
|
3
4
|
import { IModel } from "../interfaces/IModels";
|
4
5
|
import { IRepository } from "../interfaces/IRepository";
|
@@ -9,7 +10,7 @@ interface BigObject<T> {
|
|
9
10
|
}
|
10
11
|
|
11
12
|
export default class List<T extends IModel> implements IList<T> {
|
12
|
-
context:
|
13
|
+
context: IJitzSPContext;
|
13
14
|
listName: string;
|
14
15
|
listGuid: string;
|
15
16
|
// _listId: string;
|
@@ -29,7 +30,7 @@ export default class List<T extends IModel> implements IList<T> {
|
|
29
30
|
orderBy?: string | undefined;
|
30
31
|
|
31
32
|
constructor(
|
32
|
-
|
33
|
+
jitzSPContext: IJitzSPContext,
|
33
34
|
listName: string,
|
34
35
|
simpleFields: string[],
|
35
36
|
userTypeFields: string[],
|
@@ -37,18 +38,14 @@ export default class List<T extends IModel> implements IList<T> {
|
|
37
38
|
additionalExpandFields: string[],
|
38
39
|
listGuid: string = ""
|
39
40
|
) {
|
40
|
-
this.context =
|
41
|
+
this.context = jitzSPContext;
|
41
42
|
this.listName = listName;
|
42
43
|
this.listGuid = listGuid;
|
43
44
|
this.simpleFields = simpleFields || [];
|
44
45
|
this.userTypeFields = userTypeFields || [];
|
45
46
|
this.lookUpFields = lookUpFields || [];
|
46
47
|
this.additionalExpandFields = additionalExpandFields || [];
|
47
|
-
this.repository = new Repository<T>(
|
48
|
-
this.context.spContext,
|
49
|
-
listName,
|
50
|
-
listGuid
|
51
|
-
);
|
48
|
+
this.repository = new Repository<T>(this.context, listName, listGuid);
|
52
49
|
}
|
53
50
|
|
54
51
|
getItems = async (
|
package/data/interfaces/IList.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { IModel } from "./IModels";
|
2
|
-
import
|
2
|
+
import IJitzSPContext from "../interfaces/IJitzSPContext";
|
3
3
|
import { IRepository } from "./IRepository";
|
4
4
|
|
5
5
|
export interface IList<T extends IModel> {
|
6
|
-
context:
|
6
|
+
context: IJitzSPContext;
|
7
7
|
listName: string;
|
8
8
|
repository: IRepository<T>;
|
9
9
|
getItems(
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import
|
1
|
+
import IJitzSPContext from "../interfaces/IJitzSPContext";
|
2
2
|
import { IList } from "../interfaces/IList";
|
3
3
|
import { IModel } from "../interfaces/IModels";
|
4
4
|
import { IRepository } from "../interfaces/IRepository";
|
5
5
|
export default class List<T extends IModel> implements IList<T> {
|
6
|
-
context:
|
6
|
+
context: IJitzSPContext;
|
7
7
|
listName: string;
|
8
8
|
listGuid: string;
|
9
9
|
_nextPageLink: string;
|
@@ -18,7 +18,7 @@ export default class List<T extends IModel> implements IList<T> {
|
|
18
18
|
upperId: number;
|
19
19
|
lowerId: number;
|
20
20
|
orderBy?: string | undefined;
|
21
|
-
constructor(
|
21
|
+
constructor(jitzSPContext: IJitzSPContext, listName: string, simpleFields: string[], userTypeFields: string[], lookUpFields: string[], additionalExpandFields: string[], listGuid?: string);
|
22
22
|
getItems: (filters?: string, orderby?: string, top?: number, skip?: number) => Promise<T[]>;
|
23
23
|
loadMore: () => Promise<T[]>;
|
24
24
|
getItemsIndexed: (filterQuery?: string, orderby?: string, top?: number) => Promise<T[]>;
|
package/lib/data/context/List.js
CHANGED
@@ -47,7 +47,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
48
48
|
var Repository_1 = require("./Repository");
|
49
49
|
var List = /** @class */ (function () {
|
50
|
-
function List(
|
50
|
+
function List(jitzSPContext, listName, simpleFields, userTypeFields, lookUpFields, additionalExpandFields, listGuid) {
|
51
51
|
if (listGuid === void 0) { listGuid = ""; }
|
52
52
|
var _this = this;
|
53
53
|
// items: any[];
|
@@ -449,14 +449,14 @@ var List = /** @class */ (function () {
|
|
449
449
|
selectFields = (__spreadArray(__spreadArray(__spreadArray([], _this.simpleFields, true), userTypeFields, true), lookUpFields, true) || []).join(",");
|
450
450
|
return selectFields;
|
451
451
|
};
|
452
|
-
this.context =
|
452
|
+
this.context = jitzSPContext;
|
453
453
|
this.listName = listName;
|
454
454
|
this.listGuid = listGuid;
|
455
455
|
this.simpleFields = simpleFields || [];
|
456
456
|
this.userTypeFields = userTypeFields || [];
|
457
457
|
this.lookUpFields = lookUpFields || [];
|
458
458
|
this.additionalExpandFields = additionalExpandFields || [];
|
459
|
-
this.repository = new Repository_1.default(this.context
|
459
|
+
this.repository = new Repository_1.default(this.context, listName, listGuid);
|
460
460
|
}
|
461
461
|
List.prototype.loadMoreIndexed = function () {
|
462
462
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { IModel } from "./IModels";
|
2
|
-
import
|
2
|
+
import IJitzSPContext from "../interfaces/IJitzSPContext";
|
3
3
|
import { IRepository } from "./IRepository";
|
4
4
|
export interface IList<T extends IModel> {
|
5
|
-
context:
|
5
|
+
context: IJitzSPContext;
|
6
6
|
listName: string;
|
7
7
|
repository: IRepository<T>;
|
8
8
|
getItems(filter?: string, orderby?: string, top?: number, skip?: number): Promise<T[]>;
|