jitz-sharepoint-utilities 1.10.65 → 1.10.66

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.
@@ -7,6 +7,7 @@ export default class CommonRepository implements ICommonRepository {
7
7
  sendEmail(email: IEmail): Promise<boolean>;
8
8
  getData(listName: string, selectFields?: string, expand?: string, filters?: string, orderBy?: string, top?: number, skipTokenUniqueField?: string, skipTokenUniqueFieldValue?: string): Promise<any>;
9
9
  get(url: string): Promise<any>;
10
+ post(url: string, data: any, header?: any): Promise<any>;
10
11
  getFiles(libraryName: string, selectFields: string, filter: string, expandFields: string): Promise<any>;
11
12
  uploadFile(libraryName: string, fileName: string, arrayBuffer: ArrayBuffer): Promise<any>;
12
13
  getFileItem(libraryName: string, fileUrl: string): Promise<any>;
@@ -94,6 +94,25 @@ var CommonRepository = /** @class */ (function () {
94
94
  throw ex;
95
95
  });
96
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
+ };
97
116
  CommonRepository.prototype.getFiles = function (libraryName, selectFields, filter, expandFields) {
98
117
  var url = "/_api/web/lists/getbytitle('" + libraryName + "')/Items?$select=*,File/Name,File/ServerRelativeUrl";
99
118
  if (selectFields != undefined && selectFields.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jitz-sharepoint-utilities",
3
- "version": "1.10.65",
3
+ "version": "1.10.66",
4
4
  "description": "Essential SharePoint utilities for SharePoint Add-in and SPFx development",
5
5
  "author": "Jithendra Mani",
6
6
  "license": "ISC",