gd-sprest 8.1.4 → 8.1.6

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.
@@ -4,5 +4,5 @@
4
4
  */
5
5
  export const loadSPCore: IloadSPCore;
6
6
  export interface IloadSPCore {
7
- (): PromiseLike<void>;
7
+ (additionalLibs?: string[]): PromiseLike<void>;
8
8
  }
@@ -5,11 +5,16 @@ var executor_1 = require("../executor");
5
5
  /**
6
6
  * Loads the core SharePoint JavaScript library for JSOM.
7
7
  */
8
- exports.loadSPCore = function () {
8
+ exports.loadSPCore = function (additionalLibs) {
9
9
  // Return a promise
10
10
  return new Promise(function (resolve) {
11
11
  // Define the core libraries to load
12
12
  var libs = ["init", "MicrosoftAjax", "SP.Runtime", "SP", "SP.Init"];
13
+ // See if we are loading additional libraries
14
+ if (additionalLibs && additionalLibs.length > 0) {
15
+ // Append the libs
16
+ libs = libs.concat(additionalLibs);
17
+ }
13
18
  // Parse the libraries
14
19
  var counter = 0;
15
20
  executor_1.Executor(libs, function (libName) {
@@ -1172,8 +1172,8 @@ exports.SPConfig = function (cfg, webUrl) {
1172
1172
  resolve(null);
1173
1173
  return;
1174
1174
  }
1175
- // Load the core lib
1176
- _1.loadSPCore().then(function () { resolve(null); });
1175
+ // Load the core and taxonomy libraries
1176
+ _1.loadSPCore(["sp.taxonomy"]).then(function () { resolve(null); });
1177
1177
  });
1178
1178
  };
1179
1179
  // Return a promise
package/build/rest.js CHANGED
@@ -9,7 +9,7 @@ var sptypes_1 = require("./sptypes");
9
9
  * SharePoint REST Library
10
10
  */
11
11
  exports.$REST = {
12
- __ver: 8.14,
12
+ __ver: 8.16,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -42,12 +42,23 @@ var Batch = /** @class */ (function () {
42
42
  }]);
43
43
  }
44
44
  else {
45
- // Append the request
46
- base.base.batchRequests[base.base.batchRequests.length - 1].push({
47
- callback: callback,
48
- changesetId: lib_1.ContextInfo.generateGUID(),
49
- targetInfo: new _1.TargetInfo(base.targetInfo)
50
- });
45
+ // Batch requests are limited to 100 per execution, so we need to add a check for this
46
+ if (base.base.batchRequests[base.base.batchRequests.length - 1].length == 100) {
47
+ // Create a new request
48
+ base.base.batchRequests.push([{
49
+ callback: callback,
50
+ changesetId: lib_1.ContextInfo.generateGUID(),
51
+ targetInfo: new _1.TargetInfo(base.targetInfo)
52
+ }]);
53
+ }
54
+ else {
55
+ // Append the request
56
+ base.base.batchRequests[base.base.batchRequests.length - 1].push({
57
+ callback: callback,
58
+ changesetId: lib_1.ContextInfo.generateGUID(),
59
+ targetInfo: new _1.TargetInfo(base.targetInfo)
60
+ });
61
+ }
51
62
  }
52
63
  // Return this object
53
64
  return base;
@@ -6906,7 +6906,7 @@ declare module 'gd-sprest/helper/methods/loadSPCore' {
6906
6906
  */
6907
6907
  export const loadSPCore: IloadSPCore;
6908
6908
  export interface IloadSPCore {
6909
- (): PromiseLike<void>;
6909
+ (additionalLibs?: string[]): PromiseLike<void>;
6910
6910
  }
6911
6911
  }
6912
6912