gd-sprest 7.8.6 → 7.8.7

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
@@ -144,37 +144,47 @@ exports.List.runFlow = function (props) {
144
144
  function (flow) {
145
145
  // Get the flow information
146
146
  var flowInfo = JSON.parse(flow.SynchronizationData);
147
- // Get the flow token
148
- getFlowToken(flowInfo).then(function (token) {
149
- // Trigger the flow
150
- new utils_1.Base({
151
- accessToken: token,
152
- requestType: utils_1.RequestType.GraphPost,
153
- endpoint: flowInfo.properties.flowTriggerUri,
154
- data: {
155
- rows: [{
156
- entity: props.data
157
- }]
158
- }
159
- }).execute(
160
- // Success
161
- function () {
162
- // Resolve the request
163
- resolve({
164
- executed: true,
165
- flowToken: token
166
- });
167
- },
168
- // Error
169
- function (ex) {
170
- // Resolve the request
171
- resolve({
172
- executed: false,
173
- errorDetails: ex.response,
174
- errorMessage: "Error triggering the flow."
147
+ if (flowInfo) {
148
+ // Get the flow token
149
+ getFlowToken(flowInfo).then(function (token) {
150
+ // Trigger the flow
151
+ new utils_1.Base({
152
+ accessToken: token,
153
+ requestType: utils_1.RequestType.GraphPost,
154
+ endpoint: flowInfo.properties.flowTriggerUri,
155
+ data: {
156
+ rows: [{
157
+ entity: props.data
158
+ }]
159
+ }
160
+ }).execute(
161
+ // Success
162
+ function () {
163
+ // Resolve the request
164
+ resolve({
165
+ executed: true,
166
+ flowToken: token
167
+ });
168
+ },
169
+ // Error
170
+ function (ex) {
171
+ // Resolve the request
172
+ resolve({
173
+ executed: false,
174
+ errorDetails: ex.response,
175
+ errorMessage: "Error triggering the flow."
176
+ });
175
177
  });
176
178
  });
177
- });
179
+ }
180
+ else {
181
+ // Resolve the request
182
+ resolve({
183
+ executed: false,
184
+ errorDetails: "The flow with id " + props.id + " doesn't exist.",
185
+ errorMessage: "Error getting the flow instance."
186
+ });
187
+ }
178
188
  },
179
189
  // Error
180
190
  function (ex) {
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.86,
12
+ __ver: 7.87,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,