gd-sprest 9.7.2 → 9.7.4
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/@types/utils/base.d.ts +0 -3
- package/build/helper/executor.js +10 -20
- package/build/helper/fieldSchemaXML.js +85 -89
- package/build/helper/index.js +12 -28
- package/build/helper/jslink.js +124 -128
- package/build/helper/listForm.js +109 -118
- package/build/helper/listFormField.js +62 -65
- package/build/helper/methods/addContentEditorWebPart.js +9 -17
- package/build/helper/methods/addPermissionLevel.js +12 -16
- package/build/helper/methods/addScriptEditorWebPart.js +9 -17
- package/build/helper/methods/copyPermissionLevel.js +22 -26
- package/build/helper/methods/createContentType.js +96 -19
- package/build/helper/methods/createDocSet.js +10 -14
- package/build/helper/methods/getCurrentTheme.js +26 -31
- package/build/helper/methods/hasPermissions.js +8 -13
- package/build/helper/methods/index.js +16 -32
- package/build/helper/methods/loadSPCore.js +13 -17
- package/build/helper/methods/parse.js +5 -9
- package/build/helper/methods/request.js +4 -8
- package/build/helper/methods/setContentTypeFields.js +71 -79
- package/build/helper/methods/setGroupOwner.js +6 -10
- package/build/helper/methods/setWebProperty.js +26 -30
- package/build/helper/methods/stringify.js +3 -7
- package/build/helper/methods/webWorker.js +40 -20
- package/build/helper/ribbonLink.js +10 -14
- package/build/helper/sbLink.js +11 -15
- package/build/helper/sp/calloutManager.js +22 -25
- package/build/helper/sp/index.js +13 -16
- package/build/helper/sp/modalDialog.js +32 -35
- package/build/helper/sp/notify.js +9 -12
- package/build/helper/sp/ribbon.js +1 -4
- package/build/helper/sp/sod.js +9 -18
- package/build/helper/sp/status.js +18 -21
- package/build/helper/spCfg.js +232 -259
- package/build/helper/spCfgTypes.js +2 -5
- package/build/helper/taxonomy.js +144 -182
- package/build/helper/webpart.js +110 -94
- package/build/index.js +6 -23
- package/build/lib/apps.js +4 -7
- package/build/lib/contextInfo.js +217 -781
- package/build/lib/directorySession.js +4 -7
- package/build/lib/graph.js +16 -19
- package/build/lib/groupService.js +4 -7
- package/build/lib/groupSiteManager.js +4 -7
- package/build/lib/hubSites.js +11 -25
- package/build/lib/hubSitesUtility.js +4 -7
- package/build/lib/index.js +27 -43
- package/build/lib/list.js +49 -53
- package/build/lib/navigation.js +4 -7
- package/build/lib/peopleManager.js +4 -7
- package/build/lib/peoplePicker.js +4 -7
- package/build/lib/profileLoader.js +4 -7
- package/build/lib/search.js +30 -33
- package/build/lib/sensitivityLabels.js +6 -9
- package/build/lib/site.js +20 -35
- package/build/lib/siteIconManager.js +4 -7
- package/build/lib/siteManager.js +4 -7
- package/build/lib/sitePages.js +37 -51
- package/build/lib/socialFeed.js +13 -16
- package/build/lib/themeManager.js +4 -7
- package/build/lib/userProfile.js +4 -7
- package/build/lib/utility.js +12 -17
- package/build/lib/web.js +34 -49
- package/build/lib/webTemplateExtensions.js +4 -7
- package/build/lib/wfInstanceService.js +4 -7
- package/build/lib/wfSubscriptionService.js +4 -7
- package/build/mapper/custom/audit.js +3 -6
- package/build/mapper/custom/graph.js +13 -16
- package/build/mapper/custom/index.js +8 -24
- package/build/mapper/custom/odata.js +3 -6
- package/build/mapper/custom/old.js +42 -45
- package/build/mapper/custom/peoplePicker.js +4 -7
- package/build/mapper/custom/propertyValues.js +3 -6
- package/build/mapper/custom/utility.js +17 -20
- package/build/mapper/custom/webTemplateExtensions.js +19 -22
- package/build/mapper/def.js +1032 -989
- package/build/mapper/index.js +4 -9
- package/build/mapper/v2.js +2629 -2632
- package/build/rest.js +16 -19
- package/build/sptypes/graphtypes.js +694 -710
- package/build/sptypes/index.js +3 -7
- package/build/sptypes/sptypes.js +49 -52
- package/build/utils/base.js +20 -37
- package/build/utils/batch.js +53 -63
- package/build/utils/helper.js +79 -83
- package/build/utils/index.js +9 -25
- package/build/utils/methodInfo.js +88 -141
- package/build/utils/oData.js +62 -112
- package/build/utils/request.js +137 -155
- package/build/utils/requestType.js +1 -4
- package/build/utils/targetInfo.js +39 -52
- package/build/utils/xhrRequest.js +59 -107
- package/build/v2/drive.js +9 -13
- package/build/v2/drives.js +8 -12
- package/build/v2/index.js +3 -19
- package/build/v2/sites.js +61 -65
- package/dist/gd-sprest.d.ts +0 -3
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +2 -2
package/@types/utils/base.d.ts
CHANGED
|
@@ -76,9 +76,6 @@ export interface IBase<Type = any, Result = Type, QueryResult = Result> extends
|
|
|
76
76
|
/** Gets the property. */
|
|
77
77
|
getProperty(propertyName: string, requestType?: string);
|
|
78
78
|
|
|
79
|
-
/** Stops any requests for a batch or query. */
|
|
80
|
-
stop();
|
|
81
|
-
|
|
82
79
|
/** Updates the metdata uri. */
|
|
83
80
|
updateMetadataUri(metadata, targetInfo: ITargetInfoProps);
|
|
84
81
|
|
package/build/helper/executor.js
CHANGED
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Executor = Executor;
|
|
4
1
|
/**
|
|
5
2
|
* Executor
|
|
6
3
|
* @param methodParams - An array of parameters to execute in order synchronously.
|
|
7
4
|
* @param method - The method to execute for each method parameter provided.
|
|
8
5
|
* @param onExecuted - An optional event executed after the method completes. If a promise is returned, the executor will wait until it's resolved.
|
|
9
6
|
*/
|
|
10
|
-
function Executor(methodParams, method, onExecuted) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _resolve = null;
|
|
14
|
-
var _reject = null;
|
|
7
|
+
export function Executor(methodParams = [], method, onExecuted) {
|
|
8
|
+
let _resolve = null;
|
|
9
|
+
let _reject = null;
|
|
15
10
|
// Method to execute the methods
|
|
16
|
-
|
|
17
|
-
if (idx === void 0) { idx = 0; }
|
|
11
|
+
let executeMethods = (idx = 0) => {
|
|
18
12
|
// Execute the method and see if a promise is returned
|
|
19
|
-
|
|
13
|
+
let returnVal = idx < methodParams.length ? method(methodParams[idx]) : null;
|
|
20
14
|
if (returnVal && returnVal.then) {
|
|
21
15
|
// Wait for the method to complete
|
|
22
|
-
returnVal.then(
|
|
23
|
-
var args = [];
|
|
24
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
25
|
-
args[_i] = arguments[_i];
|
|
26
|
-
}
|
|
16
|
+
returnVal.then((...args) => {
|
|
27
17
|
// See if the on executed event exists
|
|
28
18
|
if (onExecuted) {
|
|
29
19
|
// Execute the method and see if a promise is returned
|
|
30
|
-
|
|
31
|
-
if (
|
|
20
|
+
let returnVal = onExecuted.apply(this, args);
|
|
21
|
+
if (returnVal && returnVal.then) {
|
|
32
22
|
// Wait for the method to complete
|
|
33
|
-
|
|
23
|
+
returnVal.then(() => {
|
|
34
24
|
// Execute the next method
|
|
35
25
|
executeMethods(idx + 1);
|
|
36
26
|
});
|
|
@@ -57,7 +47,7 @@ function Executor(methodParams, method, onExecuted) {
|
|
|
57
47
|
}
|
|
58
48
|
};
|
|
59
49
|
// Return a promise
|
|
60
|
-
return new Promise(
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
61
51
|
// Set the resolve reference
|
|
62
52
|
_resolve = resolve;
|
|
63
53
|
_reject = reject;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var lib_1 = require("../lib");
|
|
5
|
-
var __1 = require("..");
|
|
6
|
-
var spCfg_1 = require("./spCfg");
|
|
1
|
+
import { ContextInfo, Web } from "../lib";
|
|
2
|
+
import { SPTypes } from "..";
|
|
3
|
+
import { SPCfgFieldType } from "./spCfg";
|
|
7
4
|
/**
|
|
8
5
|
* Field Schema XML
|
|
9
6
|
* Helper class for generating the field schema xml
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export const FieldSchemaXML = (fieldInfo, targetWebUrl) => {
|
|
9
|
+
let _resolve = null;
|
|
10
|
+
let _reject = null;
|
|
14
11
|
// Returns the schema xml for a boolean field.
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
let createBoolean = (fieldInfo, props) => {
|
|
13
|
+
let schemaXml = null;
|
|
17
14
|
// Set the field type
|
|
18
15
|
props["Type"] = "Boolean";
|
|
19
16
|
// Generate the schema
|
|
@@ -26,35 +23,35 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
26
23
|
_resolve(schemaXml);
|
|
27
24
|
};
|
|
28
25
|
// Returns the schema xml for a calculated field.
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
let createCalculated = (fieldInfo, props) => {
|
|
27
|
+
let schemaXml = null;
|
|
31
28
|
// Set the field type
|
|
32
29
|
props["Type"] = "Calculated";
|
|
33
30
|
// Set the result type
|
|
34
31
|
switch (fieldInfo.resultType) {
|
|
35
|
-
case
|
|
32
|
+
case SPTypes.FieldResultType.Boolean:
|
|
36
33
|
props["ResultType"] = "Boolean";
|
|
37
34
|
break;
|
|
38
|
-
case
|
|
35
|
+
case SPTypes.FieldResultType.Currency:
|
|
39
36
|
props["ResultType"] = "Currency";
|
|
40
37
|
if (fieldInfo.lcid > 0) {
|
|
41
38
|
props["LCID"] = fieldInfo.lcid;
|
|
42
39
|
}
|
|
43
40
|
break;
|
|
44
|
-
case
|
|
41
|
+
case SPTypes.FieldResultType.DateOnly:
|
|
45
42
|
props["Format"] = "DateOnly";
|
|
46
43
|
props["ResultType"] = "DateTime";
|
|
47
44
|
break;
|
|
48
|
-
case
|
|
45
|
+
case SPTypes.FieldResultType.DateTime:
|
|
49
46
|
props["Format"] = "DateTime";
|
|
50
47
|
props["ResultType"] = "DateTime";
|
|
51
48
|
break;
|
|
52
|
-
case
|
|
49
|
+
case SPTypes.FieldResultType.Number:
|
|
53
50
|
props["ResultType"] = "Number";
|
|
54
51
|
if (fieldInfo.decimals >= 0) {
|
|
55
52
|
props["Decimals"] = fieldInfo.decimals;
|
|
56
53
|
}
|
|
57
|
-
if (fieldInfo.numberType ==
|
|
54
|
+
if (fieldInfo.numberType == SPTypes.FieldNumberType.Percentage) {
|
|
58
55
|
props["Percentage"] = "TRUE";
|
|
59
56
|
}
|
|
60
57
|
break;
|
|
@@ -69,7 +66,7 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
69
66
|
}
|
|
70
67
|
if (fieldInfo.fieldRefs) {
|
|
71
68
|
schemaXml += "<FieldRefs>";
|
|
72
|
-
for (
|
|
69
|
+
for (let i = 0; i < fieldInfo.fieldRefs.length; i++) {
|
|
73
70
|
schemaXml += "<FieldRef Name=\"" + fieldInfo.fieldRefs[i] + "\" />";
|
|
74
71
|
}
|
|
75
72
|
schemaXml += "</FieldRefs>";
|
|
@@ -79,8 +76,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
79
76
|
_resolve(schemaXml);
|
|
80
77
|
};
|
|
81
78
|
// Returns the schema xml for a choice field.
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
let createChoice = (fieldInfo, props) => {
|
|
80
|
+
let schemaXml = null;
|
|
84
81
|
// Set the field type
|
|
85
82
|
props["Type"] = fieldInfo.multi ? "MultiChoice" : "Choice";
|
|
86
83
|
// Set the fill in choice property
|
|
@@ -89,10 +86,10 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
89
86
|
}
|
|
90
87
|
// Set the result type
|
|
91
88
|
switch (fieldInfo.format) {
|
|
92
|
-
case
|
|
89
|
+
case SPTypes.ChoiceFormatType.Dropdown:
|
|
93
90
|
props["Format"] = "Dropdown";
|
|
94
91
|
break;
|
|
95
|
-
case
|
|
92
|
+
case SPTypes.ChoiceFormatType.RadioButtons:
|
|
96
93
|
props["Format"] = "RadioButtons";
|
|
97
94
|
break;
|
|
98
95
|
}
|
|
@@ -103,7 +100,7 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
103
100
|
}
|
|
104
101
|
if (fieldInfo.choices) {
|
|
105
102
|
schemaXml += "<CHOICES>";
|
|
106
|
-
for (
|
|
103
|
+
for (let i = 0; i < fieldInfo.choices.length; i++) {
|
|
107
104
|
schemaXml += "<CHOICE>" + fieldInfo.choices[i] + "</CHOICE>";
|
|
108
105
|
}
|
|
109
106
|
schemaXml += "</CHOICES>";
|
|
@@ -113,8 +110,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
113
110
|
_resolve(schemaXml);
|
|
114
111
|
};
|
|
115
112
|
// Returns the schema xml for a currency field.
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
let createCurrency = (fieldInfo, props) => {
|
|
114
|
+
let schemaXml = null;
|
|
118
115
|
// Set the field type
|
|
119
116
|
props["Type"] = "Currency";
|
|
120
117
|
// Set the number properties
|
|
@@ -140,21 +137,21 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
140
137
|
_resolve(schemaXml);
|
|
141
138
|
};
|
|
142
139
|
// Returns the schema xml for a date field.
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
let createDate = (fieldInfo, props) => {
|
|
141
|
+
let schemaXml = null;
|
|
145
142
|
// Set the field type
|
|
146
143
|
props["Type"] = "DateTime";
|
|
147
144
|
// Set the date/time properties
|
|
148
|
-
props["Format"] = fieldInfo.format ==
|
|
145
|
+
props["Format"] = fieldInfo.format == SPTypes.DateFormat.DateTime ? "DateTime" : "DateOnly";
|
|
149
146
|
// Set the date/time display
|
|
150
147
|
switch (fieldInfo.displayFormat) {
|
|
151
|
-
case
|
|
148
|
+
case SPTypes.FriendlyDateFormat.Disabled:
|
|
152
149
|
props["FriendlyDisplayFormat"] = "Disabled";
|
|
153
150
|
break;
|
|
154
|
-
case
|
|
151
|
+
case SPTypes.FriendlyDateFormat.Relative:
|
|
155
152
|
props["FriendlyDisplayFormat"] = "Relative";
|
|
156
153
|
break;
|
|
157
|
-
case
|
|
154
|
+
case SPTypes.FriendlyDateFormat.Unspecified:
|
|
158
155
|
props["FriendlyDisplayFormat"] = "Unspecified";
|
|
159
156
|
break;
|
|
160
157
|
}
|
|
@@ -174,8 +171,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
174
171
|
_resolve(schemaXml);
|
|
175
172
|
};
|
|
176
173
|
// Returns the schema xml for a geolocation field.
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
let createGeolocation = (fieldInfo, props) => {
|
|
175
|
+
let schemaXml = null;
|
|
179
176
|
// Set the field type
|
|
180
177
|
props["Type"] = "Geolocation";
|
|
181
178
|
// Generate the schema
|
|
@@ -184,8 +181,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
184
181
|
_resolve(schemaXml);
|
|
185
182
|
};
|
|
186
183
|
// Returns the schema xml for a guid field.
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
let createGuid = (fieldInfo, props) => {
|
|
185
|
+
let schemaXml = null;
|
|
189
186
|
// Set the field type
|
|
190
187
|
props["Type"] = "Guid";
|
|
191
188
|
// Generate the schema
|
|
@@ -194,8 +191,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
194
191
|
_resolve(schemaXml);
|
|
195
192
|
};
|
|
196
193
|
// Returns the schema xml for a image field.
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
let createImage = (fieldInfo, props) => {
|
|
195
|
+
let schemaXml = null;
|
|
199
196
|
// Set the field type
|
|
200
197
|
props["Type"] = "Thumbnail";
|
|
201
198
|
// Generate the schema
|
|
@@ -204,18 +201,18 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
204
201
|
_resolve(schemaXml);
|
|
205
202
|
};
|
|
206
203
|
// Returns the schema xml for a lookup field.
|
|
207
|
-
|
|
204
|
+
let createLookup = (fieldInfo, props) => {
|
|
208
205
|
// Set the field type
|
|
209
206
|
props["Type"] = fieldInfo.multi ? "LookupMulti" : "Lookup";
|
|
210
207
|
// Update the relationship behavior
|
|
211
208
|
switch (fieldInfo.relationshipBehavior) {
|
|
212
|
-
case
|
|
209
|
+
case SPTypes.RelationshipDeleteBehaviorType.Cascade:
|
|
213
210
|
props["RelationshipDeleteBehavior"] = "Cascade";
|
|
214
211
|
break;
|
|
215
|
-
case
|
|
212
|
+
case SPTypes.RelationshipDeleteBehaviorType.None:
|
|
216
213
|
props["RelationshipDeleteBehavior"] = "None";
|
|
217
214
|
break;
|
|
218
|
-
case
|
|
215
|
+
case SPTypes.RelationshipDeleteBehaviorType.Restrict:
|
|
219
216
|
props["RelationshipDeleteBehavior"] = "Restrict";
|
|
220
217
|
break;
|
|
221
218
|
}
|
|
@@ -230,7 +227,7 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
230
227
|
// See if the lookup name exists
|
|
231
228
|
if (fieldInfo.listName) {
|
|
232
229
|
// Get the web containing the list
|
|
233
|
-
|
|
230
|
+
Web(fieldInfo.webUrl || targetWebUrl, { disableCache: true })
|
|
234
231
|
// Get the list
|
|
235
232
|
.Lists(fieldInfo.listName)
|
|
236
233
|
// Set the query
|
|
@@ -238,7 +235,7 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
238
235
|
Expand: ["ParentWeb"]
|
|
239
236
|
})
|
|
240
237
|
// Execute the request
|
|
241
|
-
.execute(
|
|
238
|
+
.execute(list => {
|
|
242
239
|
// Set the list and web ids
|
|
243
240
|
props["List"] = "{" + list.Id + "}";
|
|
244
241
|
if (fieldInfo.webUrl) {
|
|
@@ -246,7 +243,7 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
246
243
|
}
|
|
247
244
|
// Resolve the request
|
|
248
245
|
_resolve("<Field " + toString(props) + " />");
|
|
249
|
-
},
|
|
246
|
+
}, () => {
|
|
250
247
|
// Error getting the lookup list
|
|
251
248
|
_reject("Error getting the lookup list.");
|
|
252
249
|
});
|
|
@@ -259,10 +256,10 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
259
256
|
}
|
|
260
257
|
};
|
|
261
258
|
// Returns the schema xml for a managed metadata field.
|
|
262
|
-
|
|
259
|
+
let createMMS = (fieldInfo, props) => {
|
|
263
260
|
// Create the value field
|
|
264
|
-
|
|
265
|
-
ID: "{" +
|
|
261
|
+
let valueProps = {
|
|
262
|
+
ID: "{" + ContextInfo.generateGUID() + "}",
|
|
266
263
|
Name: fieldInfo.name + "_0",
|
|
267
264
|
StaticName: fieldInfo.name + "_0",
|
|
268
265
|
DisplayName: fieldInfo.title + " Value",
|
|
@@ -273,12 +270,12 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
273
270
|
CanToggleHidden: "TRUE"
|
|
274
271
|
};
|
|
275
272
|
// Generate the value field schema xml
|
|
276
|
-
|
|
273
|
+
let schemaXmlValue = "<Field " + toString(valueProps) + " />";
|
|
277
274
|
// Set the mms properties
|
|
278
275
|
props["Type"] = "TaxonomyFieldType";
|
|
279
276
|
props["ShowField"] = "Term" + (fieldInfo.locale ? fieldInfo.locale.toString() : "1033");
|
|
280
277
|
// Generate the mms field schema xml
|
|
281
|
-
|
|
278
|
+
let schemaXml = [
|
|
282
279
|
"<Field " + toString(props) + ">",
|
|
283
280
|
"<Customization>",
|
|
284
281
|
"<ArrayOfProperty>",
|
|
@@ -294,18 +291,18 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
294
291
|
_resolve([schemaXmlValue, schemaXml]);
|
|
295
292
|
};
|
|
296
293
|
// Returns the schema xml for a note field.
|
|
297
|
-
|
|
298
|
-
|
|
294
|
+
let createNote = (fieldInfo, props) => {
|
|
295
|
+
let schemaXml = null;
|
|
299
296
|
// Set the field type
|
|
300
297
|
props["Type"] = "Note";
|
|
301
298
|
// Set the note properties
|
|
302
299
|
if (fieldInfo.appendFl) {
|
|
303
300
|
props["AppendOnly"] = "TRUE";
|
|
304
301
|
}
|
|
305
|
-
if (fieldInfo.noteType ==
|
|
302
|
+
if (fieldInfo.noteType == SPTypes.FieldNoteType.EnhancedRichText || fieldInfo.noteType == SPTypes.FieldNoteType.RichText) {
|
|
306
303
|
props["RichText"] = "TRUE";
|
|
307
304
|
}
|
|
308
|
-
if (fieldInfo.noteType ==
|
|
305
|
+
if (fieldInfo.noteType == SPTypes.FieldNoteType.EnhancedRichText) {
|
|
309
306
|
props["RichTextMode"] = "FullHtml";
|
|
310
307
|
}
|
|
311
308
|
if (fieldInfo.numberOfLines > 0) {
|
|
@@ -320,8 +317,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
320
317
|
_resolve(schemaXml);
|
|
321
318
|
};
|
|
322
319
|
// Returns the schema xml for a number field.
|
|
323
|
-
|
|
324
|
-
|
|
320
|
+
let createNumber = (fieldInfo, props) => {
|
|
321
|
+
let schemaXml = null;
|
|
325
322
|
// Set the field type
|
|
326
323
|
props["Type"] = "Number";
|
|
327
324
|
// Set the number properties
|
|
@@ -334,10 +331,10 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
334
331
|
if (fieldInfo.min != null) {
|
|
335
332
|
props["Min"] = fieldInfo.min;
|
|
336
333
|
}
|
|
337
|
-
if (fieldInfo.numberType ==
|
|
334
|
+
if (fieldInfo.numberType == SPTypes.FieldNumberType.Integer) {
|
|
338
335
|
props["Decimals"] = 0;
|
|
339
336
|
}
|
|
340
|
-
if (fieldInfo.numberType ==
|
|
337
|
+
if (fieldInfo.numberType == SPTypes.FieldNumberType.Percentage) {
|
|
341
338
|
props["Percentage"] = "TRUE";
|
|
342
339
|
}
|
|
343
340
|
// Generate the schema
|
|
@@ -350,8 +347,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
350
347
|
_resolve(schemaXml);
|
|
351
348
|
};
|
|
352
349
|
// Returns the schema xml for a text field.
|
|
353
|
-
|
|
354
|
-
|
|
350
|
+
let createText = (fieldInfo, props) => {
|
|
351
|
+
let schemaXml = null;
|
|
355
352
|
// Set the field type
|
|
356
353
|
props["Type"] = "Text";
|
|
357
354
|
// Set the number properties
|
|
@@ -368,20 +365,20 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
368
365
|
_resolve(schemaXml);
|
|
369
366
|
};
|
|
370
367
|
// Returns the schema xml for a url field.
|
|
371
|
-
|
|
372
|
-
|
|
368
|
+
let createUrl = (fieldInfo, props) => {
|
|
369
|
+
let schemaXml = null;
|
|
373
370
|
// Set the field type
|
|
374
371
|
props["Type"] = "URL";
|
|
375
372
|
// Set the url properties
|
|
376
|
-
props["Format"] = fieldInfo.format ==
|
|
373
|
+
props["Format"] = fieldInfo.format == SPTypes.UrlFormatType.Image ? "Image" : "Hyperlink";
|
|
377
374
|
// Generate the schema
|
|
378
375
|
schemaXml = "<Field " + toString(props) + " />";
|
|
379
376
|
// Resolve the request
|
|
380
377
|
_resolve(schemaXml);
|
|
381
378
|
};
|
|
382
379
|
// Returns the schema xml for a user field.
|
|
383
|
-
|
|
384
|
-
|
|
380
|
+
let createUser = (fieldInfo, props) => {
|
|
381
|
+
let schemaXml = null;
|
|
385
382
|
// Set the field type
|
|
386
383
|
props["Type"] = "User";
|
|
387
384
|
// Set the user properties
|
|
@@ -403,11 +400,11 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
403
400
|
_resolve(schemaXml);
|
|
404
401
|
};
|
|
405
402
|
// Method to convert the properties to a string
|
|
406
|
-
|
|
407
|
-
|
|
403
|
+
let toString = (props) => {
|
|
404
|
+
let properties = "";
|
|
408
405
|
// Parse the properties
|
|
409
|
-
for (
|
|
410
|
-
|
|
406
|
+
for (let key in props) {
|
|
407
|
+
let value = props[key];
|
|
411
408
|
// Add the property
|
|
412
409
|
properties += (properties ? " " : "") + key + "=\"" + props[key] + "\"";
|
|
413
410
|
}
|
|
@@ -415,7 +412,7 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
415
412
|
return properties;
|
|
416
413
|
};
|
|
417
414
|
// Return a promise
|
|
418
|
-
return new Promise(
|
|
415
|
+
return new Promise((resolve, reject) => {
|
|
419
416
|
// Set the resolve/reject methods
|
|
420
417
|
_resolve = resolve;
|
|
421
418
|
_reject = reject;
|
|
@@ -426,8 +423,8 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
426
423
|
}
|
|
427
424
|
else {
|
|
428
425
|
// Set the base properties
|
|
429
|
-
|
|
430
|
-
props["ID"] = fieldInfo.id || "{" +
|
|
426
|
+
let props = {};
|
|
427
|
+
props["ID"] = fieldInfo.id || "{" + ContextInfo.generateGUID() + "}";
|
|
431
428
|
props["Name"] = fieldInfo.name;
|
|
432
429
|
props["StaticName"] = fieldInfo.name;
|
|
433
430
|
props["DisplayName"] = fieldInfo.title || fieldInfo.name;
|
|
@@ -483,63 +480,63 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
483
480
|
// Set the type
|
|
484
481
|
switch (fieldInfo.type) {
|
|
485
482
|
// Boolean
|
|
486
|
-
case
|
|
483
|
+
case SPCfgFieldType.Boolean:
|
|
487
484
|
createBoolean(fieldInfo, props);
|
|
488
485
|
break;
|
|
489
486
|
// Calculated
|
|
490
|
-
case
|
|
487
|
+
case SPCfgFieldType.Calculated:
|
|
491
488
|
createCalculated(fieldInfo, props);
|
|
492
489
|
break;
|
|
493
490
|
// Choice
|
|
494
|
-
case
|
|
491
|
+
case SPCfgFieldType.Choice:
|
|
495
492
|
createChoice(fieldInfo, props);
|
|
496
493
|
break;
|
|
497
494
|
// Currency
|
|
498
|
-
case
|
|
495
|
+
case SPCfgFieldType.Currency:
|
|
499
496
|
createCurrency(fieldInfo, props);
|
|
500
497
|
break;
|
|
501
498
|
// Date/Time
|
|
502
|
-
case
|
|
499
|
+
case SPCfgFieldType.Date:
|
|
503
500
|
createDate(fieldInfo, props);
|
|
504
501
|
break;
|
|
505
502
|
// Geolocation
|
|
506
|
-
case
|
|
503
|
+
case SPCfgFieldType.Geolocation:
|
|
507
504
|
createGeolocation(fieldInfo, props);
|
|
508
505
|
break;
|
|
509
506
|
// Guid
|
|
510
|
-
case
|
|
507
|
+
case SPCfgFieldType.Guid:
|
|
511
508
|
createGuid(fieldInfo, props);
|
|
512
509
|
break;
|
|
513
510
|
// Image
|
|
514
|
-
case
|
|
511
|
+
case SPCfgFieldType.Image:
|
|
515
512
|
createImage(fieldInfo, props);
|
|
516
513
|
break;
|
|
517
514
|
// Lookup
|
|
518
|
-
case
|
|
515
|
+
case SPCfgFieldType.Lookup:
|
|
519
516
|
createLookup(fieldInfo, props);
|
|
520
517
|
break;
|
|
521
518
|
// MMS
|
|
522
|
-
case
|
|
519
|
+
case SPCfgFieldType.MMS:
|
|
523
520
|
createMMS(fieldInfo, props);
|
|
524
521
|
break;
|
|
525
522
|
// Note
|
|
526
|
-
case
|
|
523
|
+
case SPCfgFieldType.Note:
|
|
527
524
|
createNote(fieldInfo, props);
|
|
528
525
|
break;
|
|
529
526
|
// Number
|
|
530
|
-
case
|
|
527
|
+
case SPCfgFieldType.Number:
|
|
531
528
|
createNumber(fieldInfo, props);
|
|
532
529
|
break;
|
|
533
530
|
// Text
|
|
534
|
-
case
|
|
531
|
+
case SPCfgFieldType.Text:
|
|
535
532
|
createText(fieldInfo, props);
|
|
536
533
|
break;
|
|
537
534
|
// URL
|
|
538
|
-
case
|
|
535
|
+
case SPCfgFieldType.Url:
|
|
539
536
|
createUrl(fieldInfo, props);
|
|
540
537
|
break;
|
|
541
538
|
// User
|
|
542
|
-
case
|
|
539
|
+
case SPCfgFieldType.User:
|
|
543
540
|
createUser(fieldInfo, props);
|
|
544
541
|
break;
|
|
545
542
|
// Field type not supported
|
|
@@ -551,4 +548,3 @@ var FieldSchemaXML = function (fieldInfo, targetWebUrl) {
|
|
|
551
548
|
}
|
|
552
549
|
});
|
|
553
550
|
};
|
|
554
|
-
exports.FieldSchemaXML = FieldSchemaXML;
|
package/build/helper/index.js
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./executor"), exports);
|
|
18
|
-
__exportStar(require("./fieldSchemaXML"), exports);
|
|
19
|
-
__exportStar(require("./jslink"), exports);
|
|
20
|
-
__exportStar(require("./listForm"), exports);
|
|
21
|
-
__exportStar(require("./listFormField"), exports);
|
|
22
|
-
__exportStar(require("./methods"), exports);
|
|
23
|
-
__exportStar(require("./ribbonLink"), exports);
|
|
24
|
-
__exportStar(require("./sbLink"), exports);
|
|
25
|
-
__exportStar(require("./sp"), exports);
|
|
26
|
-
__exportStar(require("./spCfg"), exports);
|
|
27
|
-
__exportStar(require("./taxonomy"), exports);
|
|
28
|
-
__exportStar(require("./webpart"), exports);
|
|
1
|
+
export * from "./executor";
|
|
2
|
+
export * from "./fieldSchemaXML";
|
|
3
|
+
export * from "./jslink";
|
|
4
|
+
export * from "./listForm";
|
|
5
|
+
export * from "./listFormField";
|
|
6
|
+
export * from "./methods";
|
|
7
|
+
export * from "./ribbonLink";
|
|
8
|
+
export * from "./sbLink";
|
|
9
|
+
export * from "./sp";
|
|
10
|
+
export * from "./spCfg";
|
|
11
|
+
export * from "./taxonomy";
|
|
12
|
+
export * from "./webpart";
|