gd-sprest 7.8.4 → 7.8.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.
package/build/lib/list.js CHANGED
@@ -59,6 +59,24 @@ exports.List.getDataAsStream = (function (listFullUrl, parameters) {
59
59
  });
60
60
  // Static method for executing a flow against a list item
61
61
  exports.List.runFlow = function (props) {
62
+ // Determine the urls
63
+ var authUrl = "";
64
+ var flowUrl = "";
65
+ switch (props.cloudEnv) {
66
+ case sptypes_1.SPTypes.CloudEnvironment.USL4:
67
+ authUrl = sptypes_1.SPTypes.CloudEnvironment.FlowHigh;
68
+ flowUrl = sptypes_1.SPTypes.CloudEnvironment.FlowHighAPI;
69
+ break;
70
+ case sptypes_1.SPTypes.CloudEnvironment.USL5:
71
+ authUrl = sptypes_1.SPTypes.CloudEnvironment.FlowDoD;
72
+ flowUrl = sptypes_1.SPTypes.CloudEnvironment.FlowDoDAPI;
73
+ break;
74
+ // Default
75
+ default:
76
+ authUrl = sptypes_1.SPTypes.CloudEnvironment.Flow;
77
+ flowUrl = sptypes_1.SPTypes.CloudEnvironment.FlowAPI;
78
+ break;
79
+ }
62
80
  // Return a promise
63
81
  return new Promise(function (resolve) {
64
82
  // Gets the graph token
@@ -66,7 +84,7 @@ exports.List.runFlow = function (props) {
66
84
  // Return a promise
67
85
  return new Promise(function (resolveAuth) {
68
86
  // Get the graph token
69
- graph_1.Graph.getAccessToken(props.cloudEnv).execute(function (auth) {
87
+ graph_1.Graph.getAccessToken(authUrl).execute(function (auth) {
70
88
  // Resolve the request
71
89
  resolveAuth(auth.access_token);
72
90
  },
@@ -93,23 +111,9 @@ exports.List.runFlow = function (props) {
93
111
  else {
94
112
  // Get the graph token
95
113
  getGraphToken().then(function (token) {
96
- // Determine the flow url
97
- var flowUrl = "";
98
- switch (props.cloudEnv) {
99
- case sptypes_1.SPTypes.CloudEnvironment.USL4:
100
- flowUrl = sptypes_1.SPTypes.CloudEnvironment.FlowHigh;
101
- break;
102
- case sptypes_1.SPTypes.CloudEnvironment.USL5:
103
- flowUrl = sptypes_1.SPTypes.CloudEnvironment.FlowDoD;
104
- break;
105
- // Default
106
- default:
107
- flowUrl = sptypes_1.SPTypes.CloudEnvironment.Flow;
108
- break;
109
- }
110
114
  // Set the url
111
115
  var authUrl = "" + flowUrl + flowInfo.properties.environment.id + "/users/me/onBehalfOfTokenBundle?api-version=2016-11-01";
112
- // Execute the request
116
+ // Get the graph token from SharePoint
113
117
  new utils_1.Base({
114
118
  endpoint: authUrl,
115
119
  method: "POST",
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: 7.84,
12
+ __ver: 7.86,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,