@pnp/sp 2.7.0 → 2.11.0
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/LICENSE +25 -25
- package/appcatalog/index.d.ts +8 -8
- package/appcatalog/index.js +30 -30
- package/appcatalog/types.d.ts +81 -81
- package/appcatalog/types.js +177 -177
- package/appcatalog/web.d.ts +16 -16
- package/appcatalog/web.js +6 -6
- package/attachments/index.d.ts +2 -2
- package/attachments/index.js +2 -2
- package/attachments/item.d.ts +12 -12
- package/attachments/item.js +4 -4
- package/attachments/types.d.ts +92 -92
- package/attachments/types.js +240 -240
- package/batch.d.ts +17 -17
- package/batch.js +223 -223
- package/batch.js.map +1 -1
- package/clientside-pages/funcs.d.ts +22 -22
- package/clientside-pages/funcs.js +25 -25
- package/clientside-pages/index.d.ts +2 -2
- package/clientside-pages/index.js +2 -2
- package/clientside-pages/types.d.ts +496 -494
- package/clientside-pages/types.d.ts.map +1 -1
- package/clientside-pages/types.js +1496 -1485
- package/clientside-pages/types.js.map +1 -1
- package/clientside-pages/web.d.ts +41 -41
- package/clientside-pages/web.js +57 -57
- package/column-defaults/folder.d.ts +27 -27
- package/column-defaults/folder.js +82 -82
- package/column-defaults/index.d.ts +3 -3
- package/column-defaults/index.js +2 -2
- package/column-defaults/list.d.ts +19 -19
- package/column-defaults/list.js +198 -198
- package/column-defaults/types.d.ts +21 -21
- package/column-defaults/types.js +1 -1
- package/comments/clientside-page.d.ts +57 -57
- package/comments/clientside-page.d.ts.map +1 -1
- package/comments/clientside-page.js +136 -136
- package/comments/index.d.ts +2 -2
- package/comments/index.js +2 -2
- package/comments/item.d.ts +29 -29
- package/comments/item.js +47 -47
- package/comments/types.d.ts +107 -107
- package/comments/types.d.ts.map +1 -1
- package/comments/types.js +145 -145
- package/comments/types.js.map +1 -1
- package/content-types/index.d.ts +4 -4
- package/content-types/index.js +4 -4
- package/content-types/item.d.ts +12 -12
- package/content-types/item.js +4 -4
- package/content-types/list.d.ts +12 -12
- package/content-types/list.js +4 -4
- package/content-types/types.d.ts +107 -107
- package/content-types/types.js +166 -166
- package/content-types/web.d.ts +12 -12
- package/content-types/web.js +4 -4
- package/decorators.d.ts +11 -11
- package/decorators.js +28 -28
- package/features/index.d.ts +3 -3
- package/features/index.js +3 -3
- package/features/site.d.ts +12 -12
- package/features/site.js +4 -4
- package/features/types.d.ts +47 -47
- package/features/types.js +109 -109
- package/features/web.d.ts +12 -12
- package/features/web.js +4 -4
- package/fields/index.d.ts +4 -4
- package/fields/index.js +4 -4
- package/fields/list.d.ts +12 -12
- package/fields/list.js +4 -4
- package/fields/types.d.ts +368 -361
- package/fields/types.d.ts.map +1 -1
- package/fields/types.js +624 -609
- package/fields/types.js.map +1 -1
- package/fields/web.d.ts +17 -17
- package/fields/web.js +5 -5
- package/files/folder.d.ts +12 -12
- package/files/folder.js +4 -4
- package/files/index.d.ts +4 -4
- package/files/index.js +4 -4
- package/files/item.d.ts +12 -12
- package/files/item.js +4 -4
- package/files/types.d.ts +421 -421
- package/files/types.js +853 -853
- package/files/types.js.map +1 -1
- package/files/web.d.ts +35 -35
- package/files/web.js +15 -15
- package/folders/index.d.ts +4 -4
- package/folders/index.js +4 -4
- package/folders/item.d.ts +9 -9
- package/folders/item.js +4 -4
- package/folders/list.d.ts +12 -12
- package/folders/list.js +4 -4
- package/folders/types.d.ts +207 -207
- package/folders/types.js +433 -433
- package/folders/types.js.map +1 -1
- package/folders/web.d.ts +39 -39
- package/folders/web.js +15 -15
- package/forms/index.d.ts +2 -2
- package/forms/index.js +2 -2
- package/forms/list.d.ts +9 -9
- package/forms/list.js +4 -4
- package/forms/types.d.ts +35 -35
- package/forms/types.js +41 -41
- package/hubsites/index.d.ts +12 -12
- package/hubsites/index.js +15 -15
- package/hubsites/site.d.ts +26 -26
- package/hubsites/site.js +39 -39
- package/hubsites/types.d.ts +55 -55
- package/hubsites/types.js +53 -53
- package/hubsites/web.d.ts +21 -21
- package/hubsites/web.js +23 -23
- package/index.d.ts +14 -14
- package/index.js +13 -13
- package/items/index.d.ts +2 -2
- package/items/index.js +2 -2
- package/items/list.d.ts +9 -9
- package/items/list.js +4 -4
- package/items/types.d.ts +226 -219
- package/items/types.d.ts.map +1 -1
- package/items/types.js +549 -511
- package/items/types.js.map +1 -1
- package/lists/index.d.ts +2 -2
- package/lists/index.js +2 -2
- package/lists/types.d.ts +495 -495
- package/lists/types.js +522 -522
- package/lists/types.js.map +1 -1
- package/lists/web.d.ts +43 -43
- package/lists/web.js +27 -27
- package/navigation/index.d.ts +8 -8
- package/navigation/index.js +14 -14
- package/navigation/types.d.ts +154 -154
- package/navigation/types.js +219 -219
- package/navigation/web.d.ts +13 -13
- package/navigation/web.js +4 -4
- package/odata.d.ts +5 -5
- package/odata.js +90 -90
- package/odata.js.map +1 -1
- package/operations.d.ts +9 -9
- package/operations.js +63 -63
- package/package.json +4 -4
- package/presets/all.d.ts +72 -72
- package/presets/all.js +72 -72
- package/presets/core.d.ts +11 -11
- package/presets/core.js +11 -11
- package/profiles/index.d.ts +7 -7
- package/profiles/index.js +13 -13
- package/profiles/types.d.ts +357 -357
- package/profiles/types.js +454 -454
- package/readme.md +21 -21
- package/regional-settings/content-type.d.ts +7 -7
- package/regional-settings/content-type.js +4 -4
- package/regional-settings/field.d.ts +7 -7
- package/regional-settings/field.js +4 -4
- package/regional-settings/funcs.d.ts +2 -2
- package/regional-settings/funcs.js +8 -8
- package/regional-settings/index.d.ts +6 -6
- package/regional-settings/index.js +6 -6
- package/regional-settings/list.d.ts +7 -7
- package/regional-settings/list.js +4 -4
- package/regional-settings/types.d.ts +111 -111
- package/regional-settings/types.js +159 -159
- package/regional-settings/user-custom-actions.d.ts +7 -7
- package/regional-settings/user-custom-actions.js +4 -4
- package/regional-settings/web.d.ts +12 -12
- package/regional-settings/web.js +7 -7
- package/related-items/index.d.ts +1 -1
- package/related-items/index.js +1 -1
- package/related-items/types.d.ts +76 -76
- package/related-items/types.js +103 -103
- package/related-items/web.d.ts +12 -12
- package/related-items/web.js +9 -9
- package/rest.d.ts +44 -44
- package/rest.js +72 -72
- package/search/index.d.ts +30 -30
- package/search/index.js +25 -25
- package/search/query.d.ts +62 -62
- package/search/query.js +302 -302
- package/search/suggest.d.ts +76 -76
- package/search/suggest.js +66 -66
- package/search/types.d.ts +426 -426
- package/search/types.js +57 -57
- package/security/funcs.d.ts +43 -43
- package/security/funcs.js +142 -142
- package/security/index.d.ts +4 -4
- package/security/index.js +4 -4
- package/security/item.d.ts +7 -7
- package/security/item.js +14 -14
- package/security/list.d.ts +7 -7
- package/security/list.js +14 -14
- package/security/types.d.ts +318 -318
- package/security/types.js +399 -399
- package/security/web.d.ts +9 -9
- package/security/web.js +15 -15
- package/sharepointqueryable.d.ts +135 -135
- package/sharepointqueryable.js +265 -265
- package/sharing/file.d.ts +18 -18
- package/sharing/file.d.ts.map +1 -1
- package/sharing/file.js +116 -15
- package/sharing/file.js.map +1 -1
- package/sharing/folder.d.ts +9 -9
- package/sharing/folder.js +136 -136
- package/sharing/funcs.d.ts +62 -62
- package/sharing/funcs.js +239 -239
- package/sharing/funcs.js.map +1 -1
- package/sharing/index.d.ts +5 -5
- package/sharing/index.js +5 -5
- package/sharing/item.d.ts +16 -16
- package/sharing/item.js +15 -15
- package/sharing/types.d.ts +583 -583
- package/sharing/types.js +113 -113
- package/sharing/web.d.ts +19 -19
- package/sharing/web.js +76 -76
- package/site-designs/index.d.ts +8 -8
- package/site-designs/index.js +14 -14
- package/site-designs/types.d.ts +319 -319
- package/site-designs/types.js +203 -203
- package/site-designs/web.d.ts +25 -25
- package/site-designs/web.js +11 -11
- package/site-groups/index.d.ts +2 -2
- package/site-groups/index.js +2 -2
- package/site-groups/types.d.ts +89 -89
- package/site-groups/types.js +125 -125
- package/site-groups/web.d.ts +40 -40
- package/site-groups/web.js +30 -30
- package/site-scripts/index.d.ts +9 -9
- package/site-scripts/index.js +15 -15
- package/site-scripts/list.d.ts +12 -12
- package/site-scripts/list.js +24 -24
- package/site-scripts/types.d.ts +183 -183
- package/site-scripts/types.js +141 -141
- package/site-scripts/web.d.ts +13 -13
- package/site-scripts/web.js +5 -5
- package/site-users/index.d.ts +2 -2
- package/site-users/index.js +2 -2
- package/site-users/types.d.ts +138 -138
- package/site-users/types.js +122 -122
- package/site-users/web.d.ts +31 -31
- package/site-users/web.js +27 -27
- package/sites/index.d.ts +7 -7
- package/sites/index.js +13 -13
- package/sites/types.d.ts +147 -147
- package/sites/types.js +321 -321
- package/social/index.d.ts +10 -10
- package/social/index.js +13 -13
- package/social/types.d.ts +309 -309
- package/social/types.js +322 -322
- package/sphttpclient.d.ts +18 -18
- package/sphttpclient.js +189 -189
- package/splibconfig.d.ts +22 -22
- package/splibconfig.js +13 -13
- package/sputilities/index.d.ts +7 -7
- package/sputilities/index.js +13 -13
- package/sputilities/types.d.ts +130 -130
- package/sputilities/types.js +118 -118
- package/subscriptions/index.d.ts +2 -2
- package/subscriptions/index.js +2 -2
- package/subscriptions/list.d.ts +13 -13
- package/subscriptions/list.js +4 -4
- package/subscriptions/types.d.ts +54 -54
- package/subscriptions/types.js +111 -111
- package/taxonomy/index.d.ts +7 -7
- package/taxonomy/index.js +13 -13
- package/taxonomy/types.d.ts +200 -200
- package/taxonomy/types.js +347 -347
- package/taxonomy/types.js.map +1 -1
- package/telemetry.d.ts +12 -12
- package/telemetry.js +48 -48
- package/types.d.ts +218 -218
- package/types.js +79 -79
- package/user-custom-actions/index.d.ts +4 -4
- package/user-custom-actions/index.js +4 -4
- package/user-custom-actions/list.d.ts +12 -12
- package/user-custom-actions/list.js +4 -4
- package/user-custom-actions/site.d.ts +12 -12
- package/user-custom-actions/site.js +4 -4
- package/user-custom-actions/types.d.ts +82 -82
- package/user-custom-actions/types.js +93 -93
- package/user-custom-actions/web.d.ts +15 -15
- package/user-custom-actions/web.js +4 -4
- package/utils/escapeQueryStrValue.d.ts +1 -1
- package/utils/escapeQueryStrValue.js +19 -19
- package/utils/extractweburl.d.ts +1 -1
- package/utils/extractweburl.js +15 -15
- package/utils/file-names.d.ts +17 -17
- package/utils/file-names.js +38 -38
- package/utils/metadata.d.ts +5 -5
- package/utils/metadata.js +5 -5
- package/utils/objectToSPKeyValueCollection.d.ts +20 -20
- package/utils/objectToSPKeyValueCollection.js +16 -16
- package/utils/toResourcePath.d.ts +7 -7
- package/utils/toResourcePath.js +6 -6
- package/utils/toabsoluteurl.d.ts +7 -7
- package/utils/toabsoluteurl.js +61 -61
- package/views/index.d.ts +2 -2
- package/views/index.js +2 -2
- package/views/list.d.ts +23 -23
- package/views/list.js +8 -8
- package/views/types.d.ts +140 -140
- package/views/types.js +184 -184
- package/webparts/file.d.ts +15 -15
- package/webparts/file.js +6 -6
- package/webparts/index.d.ts +2 -2
- package/webparts/index.js +2 -2
- package/webparts/types.d.ts +83 -83
- package/webparts/types.js +117 -117
- package/webs/index.d.ts +16 -16
- package/webs/index.js +16 -16
- package/webs/types.d.ts +210 -210
- package/webs/types.js +295 -295
package/fields/types.js
CHANGED
|
@@ -1,610 +1,625 @@
|
|
|
1
|
-
import { __awaiter, __decorate, __extends, __generator } from "tslib";
|
|
2
|
-
import { _SharePointQueryableInstance, _SharePointQueryableCollection, spInvokableFactory, deleteable, } from "../sharepointqueryable.js";
|
|
3
|
-
import { assign } from "@pnp/common";
|
|
4
|
-
import { metadata } from "../utils/metadata.js";
|
|
5
|
-
import { body, headers } from "@pnp/odata";
|
|
6
|
-
import { defaultPath } from "../decorators.js";
|
|
7
|
-
import { spPost } from "../operations.js";
|
|
8
|
-
import { tag } from "../telemetry.js";
|
|
9
|
-
var _Fields = /** @class */ (function (_super) {
|
|
10
|
-
__extends(_Fields, _super);
|
|
11
|
-
function _Fields() {
|
|
12
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Creates a field based on the specified schema
|
|
16
|
-
*
|
|
17
|
-
* @param xml A string or XmlSchemaFieldCreationInformation instance descrbing the field to create
|
|
18
|
-
*/
|
|
19
|
-
_Fields.prototype.createFieldAsXml = function (xml) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
21
|
-
var postBody, data;
|
|
22
|
-
return __generator(this, function (_a) {
|
|
23
|
-
switch (_a.label) {
|
|
24
|
-
case 0:
|
|
25
|
-
if (typeof xml === "string") {
|
|
26
|
-
xml = { SchemaXml: xml };
|
|
27
|
-
}
|
|
28
|
-
postBody = body({
|
|
29
|
-
"parameters": assign(metadata("SP.XmlSchemaFieldCreationInformation"), xml),
|
|
30
|
-
});
|
|
31
|
-
return [4 /*yield*/, spPost(this.clone(Fields, "createfieldasxml"), postBody)];
|
|
32
|
-
case 1:
|
|
33
|
-
data = _a.sent();
|
|
34
|
-
return [2 /*return*/, {
|
|
35
|
-
data: data,
|
|
36
|
-
field: this.getById(data.Id),
|
|
37
|
-
}];
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Gets a field from the collection by id
|
|
44
|
-
*
|
|
45
|
-
* @param id The Id of the list
|
|
46
|
-
*/
|
|
47
|
-
_Fields.prototype.getById = function (id) {
|
|
48
|
-
return tag.configure(Field(this).concat("('" + id + "')"), "fs.getById");
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Gets a field from the collection by title
|
|
52
|
-
*
|
|
53
|
-
* @param title The case-sensitive title of the field
|
|
54
|
-
*/
|
|
55
|
-
_Fields.prototype.getByTitle = function (title) {
|
|
56
|
-
return tag.configure(Field(this, "getByTitle('" + title + "')"), "fs.getByTitle");
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Gets a field from the collection by using internal name or title
|
|
60
|
-
*
|
|
61
|
-
* @param name The case-sensitive internal name or title of the field
|
|
62
|
-
*/
|
|
63
|
-
_Fields.prototype.getByInternalNameOrTitle = function (name) {
|
|
64
|
-
return tag.configure(Field(this, "getByInternalNameOrTitle('" + name + "')"), "fs.getByInternalNameOrTitle");
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Adds a new field to the collection
|
|
68
|
-
*
|
|
69
|
-
* @param title The new field's title
|
|
70
|
-
* @param fieldType The new field's type (ex: SP.FieldText)
|
|
71
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
72
|
-
*/
|
|
73
|
-
_Fields.prototype.add = function (title, fieldType, properties) {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
var postBody, data;
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
switch (_a.label) {
|
|
78
|
-
case 0:
|
|
79
|
-
postBody = body(Object.assign(metadata(fieldType), {
|
|
80
|
-
"Title": title,
|
|
81
|
-
}, properties));
|
|
82
|
-
if (!tag.isTagged(this)) {
|
|
83
|
-
tag.configure(this, "fs.add");
|
|
84
|
-
}
|
|
85
|
-
return [4 /*yield*/, spPost(this.clone(Fields, null), postBody)];
|
|
86
|
-
case 1:
|
|
87
|
-
data = _a.sent();
|
|
88
|
-
return [2 /*return*/, {
|
|
89
|
-
data: data,
|
|
90
|
-
field: this.getById(data.Id),
|
|
91
|
-
}];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Adds a new SP.FieldText to the collection
|
|
98
|
-
*
|
|
99
|
-
* @param title The field title
|
|
100
|
-
* @param maxLength The maximum number of characters allowed in the value of the field.
|
|
101
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
102
|
-
*/
|
|
103
|
-
_Fields.prototype.addText = function (title, maxLength, properties) {
|
|
104
|
-
if (maxLength === void 0) { maxLength = 255; }
|
|
105
|
-
var props = {
|
|
106
|
-
FieldTypeKind: 2,
|
|
107
|
-
MaxLength: maxLength,
|
|
108
|
-
};
|
|
109
|
-
return this.add(title, "SP.FieldText", assign(props, properties));
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Adds a new SP.FieldCalculated to the collection
|
|
113
|
-
*
|
|
114
|
-
* @param title The field title.
|
|
115
|
-
* @param formula The formula for the field.
|
|
116
|
-
* @param dateFormat The date and time format that is displayed in the field.
|
|
117
|
-
* @param outputType Specifies the output format for the field. Represents a FieldType value.
|
|
118
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
119
|
-
*/
|
|
120
|
-
_Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {
|
|
121
|
-
if (outputType === void 0) { outputType = FieldTypes.Text; }
|
|
122
|
-
var props = {
|
|
123
|
-
DateFormat: dateFormat,
|
|
124
|
-
FieldTypeKind: 17,
|
|
125
|
-
Formula: formula,
|
|
126
|
-
OutputType: outputType,
|
|
127
|
-
};
|
|
128
|
-
return this.add(title, "SP.FieldCalculated", assign(props, properties));
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Adds a new SP.FieldDateTime to the collection
|
|
132
|
-
*
|
|
133
|
-
* @param title The field title
|
|
134
|
-
* @param displayFormat The format of the date and time that is displayed in the field.
|
|
135
|
-
* @param calendarType Specifies the calendar type of the field.
|
|
136
|
-
* @param friendlyDisplayFormat The type of friendly display format that is used in the field.
|
|
137
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
138
|
-
*/
|
|
139
|
-
_Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {
|
|
140
|
-
if (displayFormat === void 0) { displayFormat = DateTimeFieldFormatType.DateOnly; }
|
|
141
|
-
if (calendarType === void 0) { calendarType = CalendarType.Gregorian; }
|
|
142
|
-
if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = DateTimeFieldFriendlyFormatType.Unspecified; }
|
|
143
|
-
var props = {
|
|
144
|
-
DateTimeCalendarType: calendarType,
|
|
145
|
-
DisplayFormat: displayFormat,
|
|
146
|
-
FieldTypeKind: 4,
|
|
147
|
-
FriendlyDisplayFormat: friendlyDisplayFormat,
|
|
148
|
-
};
|
|
149
|
-
return this.add(title, "SP.FieldDateTime", assign(props, properties));
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Adds a new SP.FieldNumber to the collection
|
|
153
|
-
*
|
|
154
|
-
* @param title The field title
|
|
155
|
-
* @param minValue The field's minimum value
|
|
156
|
-
* @param maxValue The field's maximum value
|
|
157
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
158
|
-
*/
|
|
159
|
-
_Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {
|
|
160
|
-
var props = { FieldTypeKind: 9 };
|
|
161
|
-
if (minValue !== undefined) {
|
|
162
|
-
props = assign({ MinimumValue: minValue }, props);
|
|
163
|
-
}
|
|
164
|
-
if (maxValue !== undefined) {
|
|
165
|
-
props = assign({ MaximumValue: maxValue }, props);
|
|
166
|
-
}
|
|
167
|
-
return this.add(title, "SP.FieldNumber", assign(props, properties));
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Adds a new SP.FieldCurrency to the collection
|
|
171
|
-
*
|
|
172
|
-
* @param title The field title
|
|
173
|
-
* @param minValue The field's minimum value
|
|
174
|
-
* @param maxValue The field's maximum value
|
|
175
|
-
* @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field
|
|
176
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
177
|
-
*/
|
|
178
|
-
_Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {
|
|
179
|
-
if (currencyLocalId === void 0) { currencyLocalId = 1033; }
|
|
180
|
-
var props = {
|
|
181
|
-
CurrencyLocaleId: currencyLocalId,
|
|
182
|
-
FieldTypeKind: 10,
|
|
183
|
-
};
|
|
184
|
-
if (minValue !== undefined) {
|
|
185
|
-
props = assign({ MinimumValue: minValue }, props);
|
|
186
|
-
}
|
|
187
|
-
if (maxValue !== undefined) {
|
|
188
|
-
props = assign({ MaximumValue: maxValue }, props);
|
|
189
|
-
}
|
|
190
|
-
return this.add(title, "SP.FieldCurrency", assign(props, properties));
|
|
191
|
-
};
|
|
192
|
-
/**
|
|
193
|
-
* Adds a new SP.FieldMultiLineText to the collection
|
|
194
|
-
*
|
|
195
|
-
* @param title The field title
|
|
196
|
-
* @param numberOfLines Specifies the number of lines of text to display for the field.
|
|
197
|
-
* @param richText Specifies whether the field supports rich formatting.
|
|
198
|
-
* @param restrictedMode Specifies whether the field supports a subset of rich formatting.
|
|
199
|
-
* @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms.
|
|
200
|
-
* @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field.
|
|
201
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
202
|
-
*
|
|
203
|
-
*/
|
|
204
|
-
_Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {
|
|
205
|
-
if (numberOfLines === void 0) { numberOfLines = 6; }
|
|
206
|
-
if (richText === void 0) { richText = true; }
|
|
207
|
-
if (restrictedMode === void 0) { restrictedMode = false; }
|
|
208
|
-
if (appendOnly === void 0) { appendOnly = false; }
|
|
209
|
-
if (allowHyperlink === void 0) { allowHyperlink = true; }
|
|
210
|
-
var props = {
|
|
211
|
-
AllowHyperlink: allowHyperlink,
|
|
212
|
-
AppendOnly: appendOnly,
|
|
213
|
-
FieldTypeKind: 3,
|
|
214
|
-
NumberOfLines: numberOfLines,
|
|
215
|
-
RestrictedMode: restrictedMode,
|
|
216
|
-
RichText: richText,
|
|
217
|
-
};
|
|
218
|
-
return this.add(title, "SP.FieldMultiLineText", assign(props, properties));
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Adds a new SP.FieldUrl to the collection
|
|
222
|
-
*
|
|
223
|
-
* @param title The field title
|
|
224
|
-
*/
|
|
225
|
-
_Fields.prototype.addUrl = function (title, displayFormat, properties) {
|
|
226
|
-
if (displayFormat === void 0) { displayFormat = UrlFieldFormatType.Hyperlink; }
|
|
227
|
-
var props = {
|
|
228
|
-
DisplayFormat: displayFormat,
|
|
229
|
-
FieldTypeKind: 11,
|
|
230
|
-
};
|
|
231
|
-
return this.add(title, "SP.FieldUrl", assign(props, properties));
|
|
232
|
-
};
|
|
233
|
-
/** Adds a user field to the colleciton
|
|
234
|
-
*
|
|
235
|
-
* @param title The new field's title
|
|
236
|
-
* @param selectionMode The selection mode of the field
|
|
237
|
-
* @param selectionGroup Value that specifies the identifier of the SharePoint group whose members can be selected as values of the field
|
|
238
|
-
* @param properties
|
|
239
|
-
*/
|
|
240
|
-
_Fields.prototype.addUser = function (title, selectionMode, properties) {
|
|
241
|
-
var props = {
|
|
242
|
-
FieldTypeKind: 20,
|
|
243
|
-
SelectionMode: selectionMode,
|
|
244
|
-
};
|
|
245
|
-
return this.add(title, "SP.FieldUser", assign(props, properties));
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* Adds a SP.FieldLookup to the collection
|
|
249
|
-
*
|
|
250
|
-
* @param title The new field's title
|
|
251
|
-
* @param lookupListId The guid id of the list where the source of the lookup is found
|
|
252
|
-
* @param lookupFieldName The internal name of the field in the source list
|
|
253
|
-
* @param properties Set of additional properties to set on the new field
|
|
254
|
-
*/
|
|
255
|
-
_Fields.prototype.addLookup = function (title, lookupListId, lookupFieldName, properties) {
|
|
256
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
-
var props, postBody, data;
|
|
258
|
-
return __generator(this, function (_a) {
|
|
259
|
-
switch (_a.label) {
|
|
260
|
-
case 0:
|
|
261
|
-
props = assign({
|
|
262
|
-
FieldTypeKind: 7,
|
|
263
|
-
LookupFieldName: lookupFieldName,
|
|
264
|
-
LookupListId: lookupListId,
|
|
265
|
-
Title: title,
|
|
266
|
-
}, properties);
|
|
267
|
-
postBody = body({
|
|
268
|
-
"parameters": assign(metadata("SP.FieldCreationInformation"), props),
|
|
269
|
-
});
|
|
270
|
-
return [4 /*yield*/, spPost(this.clone(Fields, "addfield"), postBody)];
|
|
271
|
-
case 1:
|
|
272
|
-
data = _a.sent();
|
|
273
|
-
return [2 /*return*/, {
|
|
274
|
-
data: data,
|
|
275
|
-
field: this.getById(data.Id),
|
|
276
|
-
}];
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
};
|
|
281
|
-
/**
|
|
282
|
-
* Adds a new SP.FieldChoice to the collection
|
|
283
|
-
*
|
|
284
|
-
* @param title The field title.
|
|
285
|
-
* @param choices The choices for the field.
|
|
286
|
-
* @param format The display format of the available options for the field.
|
|
287
|
-
* @param fillIn Specifies whether the field allows fill-in values.
|
|
288
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
289
|
-
*/
|
|
290
|
-
_Fields.prototype.addChoice = function (title, choices, format, fillIn, properties) {
|
|
291
|
-
if (format === void 0) { format = ChoiceFieldFormatType.Dropdown; }
|
|
292
|
-
var props = {
|
|
293
|
-
Choices: {
|
|
294
|
-
results: choices,
|
|
295
|
-
},
|
|
296
|
-
EditFormat: format,
|
|
297
|
-
FieldTypeKind: 6,
|
|
298
|
-
FillInChoice: fillIn,
|
|
299
|
-
};
|
|
300
|
-
return this.add(title, "SP.FieldChoice", assign(props, properties));
|
|
301
|
-
};
|
|
302
|
-
/**
|
|
303
|
-
* Adds a new SP.FieldMultiChoice to the collection
|
|
304
|
-
*
|
|
305
|
-
* @param title The field title.
|
|
306
|
-
* @param choices The choices for the field.
|
|
307
|
-
* @param fillIn Specifies whether the field allows fill-in values.
|
|
308
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
309
|
-
*/
|
|
310
|
-
_Fields.prototype.addMultiChoice = function (title, choices, fillIn, properties) {
|
|
311
|
-
var props = {
|
|
312
|
-
Choices: {
|
|
313
|
-
results: choices,
|
|
314
|
-
},
|
|
315
|
-
FieldTypeKind: 15,
|
|
316
|
-
FillInChoice: fillIn,
|
|
317
|
-
};
|
|
318
|
-
return this.add(title, "SP.FieldMultiChoice", assign(props, properties));
|
|
319
|
-
};
|
|
320
|
-
/**
|
|
321
|
-
* Adds a new SP.FieldBoolean to the collection
|
|
322
|
-
*
|
|
323
|
-
* @param title The field title.
|
|
324
|
-
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
325
|
-
*/
|
|
326
|
-
_Fields.prototype.addBoolean = function (title, properties) {
|
|
327
|
-
var props = {
|
|
328
|
-
FieldTypeKind: 8,
|
|
329
|
-
};
|
|
330
|
-
return this.add(title, "SP.Field", assign(props, properties));
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* Creates a secondary (dependent) lookup field, based on the Id of the primary lookup field.
|
|
334
|
-
*
|
|
335
|
-
* @param displayName The display name of the new field.
|
|
336
|
-
* @param primaryLookupFieldId The guid of the primary Lookup Field.
|
|
337
|
-
* @param showField Which field to show from the lookup list.
|
|
338
|
-
*/
|
|
339
|
-
_Fields.prototype.addDependentLookupField = function (displayName, primaryLookupFieldId, showField) {
|
|
340
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
341
|
-
var path, data;
|
|
342
|
-
return __generator(this, function (_a) {
|
|
343
|
-
switch (_a.label) {
|
|
344
|
-
case 0:
|
|
345
|
-
path = "adddependentlookupfield(displayName='" + displayName + "', primarylookupfieldid='" + primaryLookupFieldId + "', showfield='" + showField + "')";
|
|
346
|
-
return [4 /*yield*/, spPost(this.clone(Fields, path))];
|
|
347
|
-
case 1:
|
|
348
|
-
data = _a.sent();
|
|
349
|
-
return [2 /*return*/, {
|
|
350
|
-
data: data,
|
|
351
|
-
field: this.getById(data.Id),
|
|
352
|
-
}];
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
});
|
|
356
|
-
};
|
|
357
|
-
/**
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
_Fields.prototype.addLocation = function (title, properties) {
|
|
364
|
-
var props = { FieldTypeKind: 33 };
|
|
365
|
-
return this.add(title, "SP.FieldLocation", assign(props, properties));
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
__decorate([
|
|
380
|
-
tag("fs.
|
|
381
|
-
], _Fields.prototype, "
|
|
382
|
-
__decorate([
|
|
383
|
-
tag("fs.
|
|
384
|
-
], _Fields.prototype, "
|
|
385
|
-
__decorate([
|
|
386
|
-
tag("fs.
|
|
387
|
-
], _Fields.prototype, "
|
|
388
|
-
__decorate([
|
|
389
|
-
tag("fs.
|
|
390
|
-
], _Fields.prototype, "
|
|
391
|
-
__decorate([
|
|
392
|
-
tag("fs.
|
|
393
|
-
], _Fields.prototype, "
|
|
394
|
-
__decorate([
|
|
395
|
-
tag("fs.
|
|
396
|
-
], _Fields.prototype, "
|
|
397
|
-
__decorate([
|
|
398
|
-
tag("fs.
|
|
399
|
-
], _Fields.prototype, "
|
|
400
|
-
__decorate([
|
|
401
|
-
tag("fs.
|
|
402
|
-
], _Fields.prototype, "
|
|
403
|
-
__decorate([
|
|
404
|
-
tag("fs.
|
|
405
|
-
], _Fields.prototype, "
|
|
406
|
-
__decorate([
|
|
407
|
-
tag("fs.
|
|
408
|
-
], _Fields.prototype, "
|
|
409
|
-
__decorate([
|
|
410
|
-
tag("fs.
|
|
411
|
-
], _Fields.prototype, "
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
], _Fields);
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
return [
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
FieldTypes[FieldTypes["
|
|
516
|
-
FieldTypes[FieldTypes["
|
|
517
|
-
FieldTypes[FieldTypes["
|
|
518
|
-
FieldTypes[FieldTypes["
|
|
519
|
-
FieldTypes[FieldTypes["
|
|
520
|
-
FieldTypes[FieldTypes["
|
|
521
|
-
FieldTypes[FieldTypes["
|
|
522
|
-
FieldTypes[FieldTypes["
|
|
523
|
-
FieldTypes[FieldTypes["
|
|
524
|
-
FieldTypes[FieldTypes["
|
|
525
|
-
FieldTypes[FieldTypes["
|
|
526
|
-
FieldTypes[FieldTypes["
|
|
527
|
-
FieldTypes[FieldTypes["
|
|
528
|
-
FieldTypes[FieldTypes["
|
|
529
|
-
FieldTypes[FieldTypes["
|
|
530
|
-
FieldTypes[FieldTypes["
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
})(
|
|
1
|
+
import { __awaiter, __decorate, __extends, __generator } from "tslib";
|
|
2
|
+
import { _SharePointQueryableInstance, _SharePointQueryableCollection, spInvokableFactory, deleteable, } from "../sharepointqueryable.js";
|
|
3
|
+
import { assign } from "@pnp/common";
|
|
4
|
+
import { metadata } from "../utils/metadata.js";
|
|
5
|
+
import { body, headers } from "@pnp/odata";
|
|
6
|
+
import { defaultPath } from "../decorators.js";
|
|
7
|
+
import { spPost } from "../operations.js";
|
|
8
|
+
import { tag } from "../telemetry.js";
|
|
9
|
+
var _Fields = /** @class */ (function (_super) {
|
|
10
|
+
__extends(_Fields, _super);
|
|
11
|
+
function _Fields() {
|
|
12
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a field based on the specified schema
|
|
16
|
+
*
|
|
17
|
+
* @param xml A string or XmlSchemaFieldCreationInformation instance descrbing the field to create
|
|
18
|
+
*/
|
|
19
|
+
_Fields.prototype.createFieldAsXml = function (xml) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
21
|
+
var postBody, data;
|
|
22
|
+
return __generator(this, function (_a) {
|
|
23
|
+
switch (_a.label) {
|
|
24
|
+
case 0:
|
|
25
|
+
if (typeof xml === "string") {
|
|
26
|
+
xml = { SchemaXml: xml };
|
|
27
|
+
}
|
|
28
|
+
postBody = body({
|
|
29
|
+
"parameters": assign(metadata("SP.XmlSchemaFieldCreationInformation"), xml),
|
|
30
|
+
});
|
|
31
|
+
return [4 /*yield*/, spPost(this.clone(Fields, "createfieldasxml"), postBody)];
|
|
32
|
+
case 1:
|
|
33
|
+
data = _a.sent();
|
|
34
|
+
return [2 /*return*/, {
|
|
35
|
+
data: data,
|
|
36
|
+
field: this.getById(data.Id),
|
|
37
|
+
}];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Gets a field from the collection by id
|
|
44
|
+
*
|
|
45
|
+
* @param id The Id of the list
|
|
46
|
+
*/
|
|
47
|
+
_Fields.prototype.getById = function (id) {
|
|
48
|
+
return tag.configure(Field(this).concat("('" + id + "')"), "fs.getById");
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Gets a field from the collection by title
|
|
52
|
+
*
|
|
53
|
+
* @param title The case-sensitive title of the field
|
|
54
|
+
*/
|
|
55
|
+
_Fields.prototype.getByTitle = function (title) {
|
|
56
|
+
return tag.configure(Field(this, "getByTitle('" + title + "')"), "fs.getByTitle");
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Gets a field from the collection by using internal name or title
|
|
60
|
+
*
|
|
61
|
+
* @param name The case-sensitive internal name or title of the field
|
|
62
|
+
*/
|
|
63
|
+
_Fields.prototype.getByInternalNameOrTitle = function (name) {
|
|
64
|
+
return tag.configure(Field(this, "getByInternalNameOrTitle('" + name + "')"), "fs.getByInternalNameOrTitle");
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Adds a new field to the collection
|
|
68
|
+
*
|
|
69
|
+
* @param title The new field's title
|
|
70
|
+
* @param fieldType The new field's type (ex: SP.FieldText)
|
|
71
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
72
|
+
*/
|
|
73
|
+
_Fields.prototype.add = function (title, fieldType, properties) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
+
var postBody, data;
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
switch (_a.label) {
|
|
78
|
+
case 0:
|
|
79
|
+
postBody = body(Object.assign(metadata(fieldType), {
|
|
80
|
+
"Title": title,
|
|
81
|
+
}, properties));
|
|
82
|
+
if (!tag.isTagged(this)) {
|
|
83
|
+
tag.configure(this, "fs.add");
|
|
84
|
+
}
|
|
85
|
+
return [4 /*yield*/, spPost(this.clone(Fields, null), postBody)];
|
|
86
|
+
case 1:
|
|
87
|
+
data = _a.sent();
|
|
88
|
+
return [2 /*return*/, {
|
|
89
|
+
data: data,
|
|
90
|
+
field: this.getById(data.Id),
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Adds a new SP.FieldText to the collection
|
|
98
|
+
*
|
|
99
|
+
* @param title The field title
|
|
100
|
+
* @param maxLength The maximum number of characters allowed in the value of the field.
|
|
101
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
102
|
+
*/
|
|
103
|
+
_Fields.prototype.addText = function (title, maxLength, properties) {
|
|
104
|
+
if (maxLength === void 0) { maxLength = 255; }
|
|
105
|
+
var props = {
|
|
106
|
+
FieldTypeKind: 2,
|
|
107
|
+
MaxLength: maxLength,
|
|
108
|
+
};
|
|
109
|
+
return this.add(title, "SP.FieldText", assign(props, properties));
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Adds a new SP.FieldCalculated to the collection
|
|
113
|
+
*
|
|
114
|
+
* @param title The field title.
|
|
115
|
+
* @param formula The formula for the field.
|
|
116
|
+
* @param dateFormat The date and time format that is displayed in the field.
|
|
117
|
+
* @param outputType Specifies the output format for the field. Represents a FieldType value.
|
|
118
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
119
|
+
*/
|
|
120
|
+
_Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {
|
|
121
|
+
if (outputType === void 0) { outputType = FieldTypes.Text; }
|
|
122
|
+
var props = {
|
|
123
|
+
DateFormat: dateFormat,
|
|
124
|
+
FieldTypeKind: 17,
|
|
125
|
+
Formula: formula,
|
|
126
|
+
OutputType: outputType,
|
|
127
|
+
};
|
|
128
|
+
return this.add(title, "SP.FieldCalculated", assign(props, properties));
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Adds a new SP.FieldDateTime to the collection
|
|
132
|
+
*
|
|
133
|
+
* @param title The field title
|
|
134
|
+
* @param displayFormat The format of the date and time that is displayed in the field.
|
|
135
|
+
* @param calendarType Specifies the calendar type of the field.
|
|
136
|
+
* @param friendlyDisplayFormat The type of friendly display format that is used in the field.
|
|
137
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
138
|
+
*/
|
|
139
|
+
_Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {
|
|
140
|
+
if (displayFormat === void 0) { displayFormat = DateTimeFieldFormatType.DateOnly; }
|
|
141
|
+
if (calendarType === void 0) { calendarType = CalendarType.Gregorian; }
|
|
142
|
+
if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = DateTimeFieldFriendlyFormatType.Unspecified; }
|
|
143
|
+
var props = {
|
|
144
|
+
DateTimeCalendarType: calendarType,
|
|
145
|
+
DisplayFormat: displayFormat,
|
|
146
|
+
FieldTypeKind: 4,
|
|
147
|
+
FriendlyDisplayFormat: friendlyDisplayFormat,
|
|
148
|
+
};
|
|
149
|
+
return this.add(title, "SP.FieldDateTime", assign(props, properties));
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Adds a new SP.FieldNumber to the collection
|
|
153
|
+
*
|
|
154
|
+
* @param title The field title
|
|
155
|
+
* @param minValue The field's minimum value
|
|
156
|
+
* @param maxValue The field's maximum value
|
|
157
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
158
|
+
*/
|
|
159
|
+
_Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {
|
|
160
|
+
var props = { FieldTypeKind: 9 };
|
|
161
|
+
if (minValue !== undefined) {
|
|
162
|
+
props = assign({ MinimumValue: minValue }, props);
|
|
163
|
+
}
|
|
164
|
+
if (maxValue !== undefined) {
|
|
165
|
+
props = assign({ MaximumValue: maxValue }, props);
|
|
166
|
+
}
|
|
167
|
+
return this.add(title, "SP.FieldNumber", assign(props, properties));
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Adds a new SP.FieldCurrency to the collection
|
|
171
|
+
*
|
|
172
|
+
* @param title The field title
|
|
173
|
+
* @param minValue The field's minimum value
|
|
174
|
+
* @param maxValue The field's maximum value
|
|
175
|
+
* @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field
|
|
176
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
177
|
+
*/
|
|
178
|
+
_Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {
|
|
179
|
+
if (currencyLocalId === void 0) { currencyLocalId = 1033; }
|
|
180
|
+
var props = {
|
|
181
|
+
CurrencyLocaleId: currencyLocalId,
|
|
182
|
+
FieldTypeKind: 10,
|
|
183
|
+
};
|
|
184
|
+
if (minValue !== undefined) {
|
|
185
|
+
props = assign({ MinimumValue: minValue }, props);
|
|
186
|
+
}
|
|
187
|
+
if (maxValue !== undefined) {
|
|
188
|
+
props = assign({ MaximumValue: maxValue }, props);
|
|
189
|
+
}
|
|
190
|
+
return this.add(title, "SP.FieldCurrency", assign(props, properties));
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Adds a new SP.FieldMultiLineText to the collection
|
|
194
|
+
*
|
|
195
|
+
* @param title The field title
|
|
196
|
+
* @param numberOfLines Specifies the number of lines of text to display for the field.
|
|
197
|
+
* @param richText Specifies whether the field supports rich formatting.
|
|
198
|
+
* @param restrictedMode Specifies whether the field supports a subset of rich formatting.
|
|
199
|
+
* @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms.
|
|
200
|
+
* @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field.
|
|
201
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
202
|
+
*
|
|
203
|
+
*/
|
|
204
|
+
_Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {
|
|
205
|
+
if (numberOfLines === void 0) { numberOfLines = 6; }
|
|
206
|
+
if (richText === void 0) { richText = true; }
|
|
207
|
+
if (restrictedMode === void 0) { restrictedMode = false; }
|
|
208
|
+
if (appendOnly === void 0) { appendOnly = false; }
|
|
209
|
+
if (allowHyperlink === void 0) { allowHyperlink = true; }
|
|
210
|
+
var props = {
|
|
211
|
+
AllowHyperlink: allowHyperlink,
|
|
212
|
+
AppendOnly: appendOnly,
|
|
213
|
+
FieldTypeKind: 3,
|
|
214
|
+
NumberOfLines: numberOfLines,
|
|
215
|
+
RestrictedMode: restrictedMode,
|
|
216
|
+
RichText: richText,
|
|
217
|
+
};
|
|
218
|
+
return this.add(title, "SP.FieldMultiLineText", assign(props, properties));
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Adds a new SP.FieldUrl to the collection
|
|
222
|
+
*
|
|
223
|
+
* @param title The field title
|
|
224
|
+
*/
|
|
225
|
+
_Fields.prototype.addUrl = function (title, displayFormat, properties) {
|
|
226
|
+
if (displayFormat === void 0) { displayFormat = UrlFieldFormatType.Hyperlink; }
|
|
227
|
+
var props = {
|
|
228
|
+
DisplayFormat: displayFormat,
|
|
229
|
+
FieldTypeKind: 11,
|
|
230
|
+
};
|
|
231
|
+
return this.add(title, "SP.FieldUrl", assign(props, properties));
|
|
232
|
+
};
|
|
233
|
+
/** Adds a user field to the colleciton
|
|
234
|
+
*
|
|
235
|
+
* @param title The new field's title
|
|
236
|
+
* @param selectionMode The selection mode of the field
|
|
237
|
+
* @param selectionGroup Value that specifies the identifier of the SharePoint group whose members can be selected as values of the field
|
|
238
|
+
* @param properties
|
|
239
|
+
*/
|
|
240
|
+
_Fields.prototype.addUser = function (title, selectionMode, properties) {
|
|
241
|
+
var props = {
|
|
242
|
+
FieldTypeKind: 20,
|
|
243
|
+
SelectionMode: selectionMode,
|
|
244
|
+
};
|
|
245
|
+
return this.add(title, "SP.FieldUser", assign(props, properties));
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Adds a SP.FieldLookup to the collection
|
|
249
|
+
*
|
|
250
|
+
* @param title The new field's title
|
|
251
|
+
* @param lookupListId The guid id of the list where the source of the lookup is found
|
|
252
|
+
* @param lookupFieldName The internal name of the field in the source list
|
|
253
|
+
* @param properties Set of additional properties to set on the new field
|
|
254
|
+
*/
|
|
255
|
+
_Fields.prototype.addLookup = function (title, lookupListId, lookupFieldName, properties) {
|
|
256
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
+
var props, postBody, data;
|
|
258
|
+
return __generator(this, function (_a) {
|
|
259
|
+
switch (_a.label) {
|
|
260
|
+
case 0:
|
|
261
|
+
props = assign({
|
|
262
|
+
FieldTypeKind: 7,
|
|
263
|
+
LookupFieldName: lookupFieldName,
|
|
264
|
+
LookupListId: lookupListId,
|
|
265
|
+
Title: title,
|
|
266
|
+
}, properties);
|
|
267
|
+
postBody = body({
|
|
268
|
+
"parameters": assign(metadata("SP.FieldCreationInformation"), props),
|
|
269
|
+
});
|
|
270
|
+
return [4 /*yield*/, spPost(this.clone(Fields, "addfield"), postBody)];
|
|
271
|
+
case 1:
|
|
272
|
+
data = _a.sent();
|
|
273
|
+
return [2 /*return*/, {
|
|
274
|
+
data: data,
|
|
275
|
+
field: this.getById(data.Id),
|
|
276
|
+
}];
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Adds a new SP.FieldChoice to the collection
|
|
283
|
+
*
|
|
284
|
+
* @param title The field title.
|
|
285
|
+
* @param choices The choices for the field.
|
|
286
|
+
* @param format The display format of the available options for the field.
|
|
287
|
+
* @param fillIn Specifies whether the field allows fill-in values.
|
|
288
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
289
|
+
*/
|
|
290
|
+
_Fields.prototype.addChoice = function (title, choices, format, fillIn, properties) {
|
|
291
|
+
if (format === void 0) { format = ChoiceFieldFormatType.Dropdown; }
|
|
292
|
+
var props = {
|
|
293
|
+
Choices: {
|
|
294
|
+
results: choices,
|
|
295
|
+
},
|
|
296
|
+
EditFormat: format,
|
|
297
|
+
FieldTypeKind: 6,
|
|
298
|
+
FillInChoice: fillIn,
|
|
299
|
+
};
|
|
300
|
+
return this.add(title, "SP.FieldChoice", assign(props, properties));
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* Adds a new SP.FieldMultiChoice to the collection
|
|
304
|
+
*
|
|
305
|
+
* @param title The field title.
|
|
306
|
+
* @param choices The choices for the field.
|
|
307
|
+
* @param fillIn Specifies whether the field allows fill-in values.
|
|
308
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
309
|
+
*/
|
|
310
|
+
_Fields.prototype.addMultiChoice = function (title, choices, fillIn, properties) {
|
|
311
|
+
var props = {
|
|
312
|
+
Choices: {
|
|
313
|
+
results: choices,
|
|
314
|
+
},
|
|
315
|
+
FieldTypeKind: 15,
|
|
316
|
+
FillInChoice: fillIn,
|
|
317
|
+
};
|
|
318
|
+
return this.add(title, "SP.FieldMultiChoice", assign(props, properties));
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Adds a new SP.FieldBoolean to the collection
|
|
322
|
+
*
|
|
323
|
+
* @param title The field title.
|
|
324
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
325
|
+
*/
|
|
326
|
+
_Fields.prototype.addBoolean = function (title, properties) {
|
|
327
|
+
var props = {
|
|
328
|
+
FieldTypeKind: 8,
|
|
329
|
+
};
|
|
330
|
+
return this.add(title, "SP.Field", assign(props, properties));
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Creates a secondary (dependent) lookup field, based on the Id of the primary lookup field.
|
|
334
|
+
*
|
|
335
|
+
* @param displayName The display name of the new field.
|
|
336
|
+
* @param primaryLookupFieldId The guid of the primary Lookup Field.
|
|
337
|
+
* @param showField Which field to show from the lookup list.
|
|
338
|
+
*/
|
|
339
|
+
_Fields.prototype.addDependentLookupField = function (displayName, primaryLookupFieldId, showField) {
|
|
340
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
341
|
+
var path, data;
|
|
342
|
+
return __generator(this, function (_a) {
|
|
343
|
+
switch (_a.label) {
|
|
344
|
+
case 0:
|
|
345
|
+
path = "adddependentlookupfield(displayName='" + displayName + "', primarylookupfieldid='" + primaryLookupFieldId + "', showfield='" + showField + "')";
|
|
346
|
+
return [4 /*yield*/, spPost(this.clone(Fields, path))];
|
|
347
|
+
case 1:
|
|
348
|
+
data = _a.sent();
|
|
349
|
+
return [2 /*return*/, {
|
|
350
|
+
data: data,
|
|
351
|
+
field: this.getById(data.Id),
|
|
352
|
+
}];
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Adds a new SP.FieldLocation to the collection
|
|
359
|
+
*
|
|
360
|
+
* @param title The field title.
|
|
361
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
362
|
+
*/
|
|
363
|
+
_Fields.prototype.addLocation = function (title, properties) {
|
|
364
|
+
var props = { FieldTypeKind: 33 };
|
|
365
|
+
return this.add(title, "SP.FieldLocation", assign(props, properties));
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* Adds a new SP.FieldLocation to the collection
|
|
369
|
+
*
|
|
370
|
+
* @param title The field title.
|
|
371
|
+
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
|
|
372
|
+
*/
|
|
373
|
+
_Fields.prototype.addImageField = function (title, properties) {
|
|
374
|
+
var props = {
|
|
375
|
+
FieldTypeKind: 34,
|
|
376
|
+
};
|
|
377
|
+
return this.add(title, "SP.FieldMultiLineText", assign(props, properties));
|
|
378
|
+
};
|
|
379
|
+
__decorate([
|
|
380
|
+
tag("fs.createFieldAsXml")
|
|
381
|
+
], _Fields.prototype, "createFieldAsXml", null);
|
|
382
|
+
__decorate([
|
|
383
|
+
tag("fs.addText")
|
|
384
|
+
], _Fields.prototype, "addText", null);
|
|
385
|
+
__decorate([
|
|
386
|
+
tag("fs.addCalculated")
|
|
387
|
+
], _Fields.prototype, "addCalculated", null);
|
|
388
|
+
__decorate([
|
|
389
|
+
tag("fs.addDateTime")
|
|
390
|
+
], _Fields.prototype, "addDateTime", null);
|
|
391
|
+
__decorate([
|
|
392
|
+
tag("fs.addNumber")
|
|
393
|
+
], _Fields.prototype, "addNumber", null);
|
|
394
|
+
__decorate([
|
|
395
|
+
tag("fs.addCurrency")
|
|
396
|
+
], _Fields.prototype, "addCurrency", null);
|
|
397
|
+
__decorate([
|
|
398
|
+
tag("fs.addMultilineText")
|
|
399
|
+
], _Fields.prototype, "addMultilineText", null);
|
|
400
|
+
__decorate([
|
|
401
|
+
tag("fs.addUrl")
|
|
402
|
+
], _Fields.prototype, "addUrl", null);
|
|
403
|
+
__decorate([
|
|
404
|
+
tag("fs.addUser")
|
|
405
|
+
], _Fields.prototype, "addUser", null);
|
|
406
|
+
__decorate([
|
|
407
|
+
tag("fs.addLookup")
|
|
408
|
+
], _Fields.prototype, "addLookup", null);
|
|
409
|
+
__decorate([
|
|
410
|
+
tag("fs.addChoice")
|
|
411
|
+
], _Fields.prototype, "addChoice", null);
|
|
412
|
+
__decorate([
|
|
413
|
+
tag("fs.addMultiChoice")
|
|
414
|
+
], _Fields.prototype, "addMultiChoice", null);
|
|
415
|
+
__decorate([
|
|
416
|
+
tag("fs.addBoolean")
|
|
417
|
+
], _Fields.prototype, "addBoolean", null);
|
|
418
|
+
__decorate([
|
|
419
|
+
tag("fs.addDependentLookupField")
|
|
420
|
+
], _Fields.prototype, "addDependentLookupField", null);
|
|
421
|
+
__decorate([
|
|
422
|
+
tag("fs.addLocation")
|
|
423
|
+
], _Fields.prototype, "addLocation", null);
|
|
424
|
+
__decorate([
|
|
425
|
+
tag("fs.addImage")
|
|
426
|
+
], _Fields.prototype, "addImageField", null);
|
|
427
|
+
_Fields = __decorate([
|
|
428
|
+
defaultPath("fields")
|
|
429
|
+
], _Fields);
|
|
430
|
+
return _Fields;
|
|
431
|
+
}(_SharePointQueryableCollection));
|
|
432
|
+
export { _Fields };
|
|
433
|
+
export var Fields = spInvokableFactory(_Fields);
|
|
434
|
+
var _Field = /** @class */ (function (_super) {
|
|
435
|
+
__extends(_Field, _super);
|
|
436
|
+
function _Field() {
|
|
437
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
438
|
+
_this.delete = deleteable("f");
|
|
439
|
+
return _this;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Updates this field instance with the supplied properties
|
|
443
|
+
*
|
|
444
|
+
* @param properties A plain object hash of values to update for the list
|
|
445
|
+
* @param fieldType The type value such as SP.FieldLookup. Optional, looked up from the field if not provided
|
|
446
|
+
*/
|
|
447
|
+
_Field.prototype.update = function (properties, fieldType) {
|
|
448
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
449
|
+
var info, req, data;
|
|
450
|
+
return __generator(this, function (_a) {
|
|
451
|
+
switch (_a.label) {
|
|
452
|
+
case 0:
|
|
453
|
+
if (!(typeof fieldType === "undefined" || fieldType === null)) return [3 /*break*/, 2];
|
|
454
|
+
return [4 /*yield*/, Field(this).select("FieldTypeKind").configure({
|
|
455
|
+
headers: {
|
|
456
|
+
"Accept": "application/json",
|
|
457
|
+
},
|
|
458
|
+
})()];
|
|
459
|
+
case 1:
|
|
460
|
+
info = _a.sent();
|
|
461
|
+
fieldType = info["odata.type"];
|
|
462
|
+
_a.label = 2;
|
|
463
|
+
case 2:
|
|
464
|
+
req = body(assign(metadata(fieldType), properties), headers({ "X-HTTP-Method": "MERGE" }));
|
|
465
|
+
return [4 /*yield*/, spPost(this, req)];
|
|
466
|
+
case 3:
|
|
467
|
+
data = _a.sent();
|
|
468
|
+
return [2 /*return*/, {
|
|
469
|
+
data: data,
|
|
470
|
+
field: this,
|
|
471
|
+
}];
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Sets the value of the ShowInDisplayForm property for this field.
|
|
478
|
+
*/
|
|
479
|
+
_Field.prototype.setShowInDisplayForm = function (show) {
|
|
480
|
+
return spPost(this.clone(Field, "setshowindisplayform(" + show + ")"));
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Sets the value of the ShowInEditForm property for this field.
|
|
484
|
+
*/
|
|
485
|
+
_Field.prototype.setShowInEditForm = function (show) {
|
|
486
|
+
return spPost(this.clone(Field, "setshowineditform(" + show + ")"));
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* Sets the value of the ShowInNewForm property for this field.
|
|
490
|
+
*/
|
|
491
|
+
_Field.prototype.setShowInNewForm = function (show) {
|
|
492
|
+
return spPost(this.clone(Field, "setshowinnewform(" + show + ")"));
|
|
493
|
+
};
|
|
494
|
+
__decorate([
|
|
495
|
+
tag("f.update")
|
|
496
|
+
], _Field.prototype, "update", null);
|
|
497
|
+
__decorate([
|
|
498
|
+
tag("f.setShowInDisplayForm")
|
|
499
|
+
], _Field.prototype, "setShowInDisplayForm", null);
|
|
500
|
+
__decorate([
|
|
501
|
+
tag("f.setShowInEditForm")
|
|
502
|
+
], _Field.prototype, "setShowInEditForm", null);
|
|
503
|
+
__decorate([
|
|
504
|
+
tag("f.setShowInNewForm")
|
|
505
|
+
], _Field.prototype, "setShowInNewForm", null);
|
|
506
|
+
return _Field;
|
|
507
|
+
}(_SharePointQueryableInstance));
|
|
508
|
+
export { _Field };
|
|
509
|
+
export var Field = spInvokableFactory(_Field);
|
|
510
|
+
/**
|
|
511
|
+
* Specifies the type of the field.
|
|
512
|
+
*/
|
|
513
|
+
export var FieldTypes;
|
|
514
|
+
(function (FieldTypes) {
|
|
515
|
+
FieldTypes[FieldTypes["Invalid"] = 0] = "Invalid";
|
|
516
|
+
FieldTypes[FieldTypes["Integer"] = 1] = "Integer";
|
|
517
|
+
FieldTypes[FieldTypes["Text"] = 2] = "Text";
|
|
518
|
+
FieldTypes[FieldTypes["Note"] = 3] = "Note";
|
|
519
|
+
FieldTypes[FieldTypes["DateTime"] = 4] = "DateTime";
|
|
520
|
+
FieldTypes[FieldTypes["Counter"] = 5] = "Counter";
|
|
521
|
+
FieldTypes[FieldTypes["Choice"] = 6] = "Choice";
|
|
522
|
+
FieldTypes[FieldTypes["Lookup"] = 7] = "Lookup";
|
|
523
|
+
FieldTypes[FieldTypes["Boolean"] = 8] = "Boolean";
|
|
524
|
+
FieldTypes[FieldTypes["Number"] = 9] = "Number";
|
|
525
|
+
FieldTypes[FieldTypes["Currency"] = 10] = "Currency";
|
|
526
|
+
FieldTypes[FieldTypes["URL"] = 11] = "URL";
|
|
527
|
+
FieldTypes[FieldTypes["Computed"] = 12] = "Computed";
|
|
528
|
+
FieldTypes[FieldTypes["Threading"] = 13] = "Threading";
|
|
529
|
+
FieldTypes[FieldTypes["Guid"] = 14] = "Guid";
|
|
530
|
+
FieldTypes[FieldTypes["MultiChoice"] = 15] = "MultiChoice";
|
|
531
|
+
FieldTypes[FieldTypes["GridChoice"] = 16] = "GridChoice";
|
|
532
|
+
FieldTypes[FieldTypes["Calculated"] = 17] = "Calculated";
|
|
533
|
+
FieldTypes[FieldTypes["File"] = 18] = "File";
|
|
534
|
+
FieldTypes[FieldTypes["Attachments"] = 19] = "Attachments";
|
|
535
|
+
FieldTypes[FieldTypes["User"] = 20] = "User";
|
|
536
|
+
FieldTypes[FieldTypes["Recurrence"] = 21] = "Recurrence";
|
|
537
|
+
FieldTypes[FieldTypes["CrossProjectLink"] = 22] = "CrossProjectLink";
|
|
538
|
+
FieldTypes[FieldTypes["ModStat"] = 23] = "ModStat";
|
|
539
|
+
FieldTypes[FieldTypes["Error"] = 24] = "Error";
|
|
540
|
+
FieldTypes[FieldTypes["ContentTypeId"] = 25] = "ContentTypeId";
|
|
541
|
+
FieldTypes[FieldTypes["PageSeparator"] = 26] = "PageSeparator";
|
|
542
|
+
FieldTypes[FieldTypes["ThreadIndex"] = 27] = "ThreadIndex";
|
|
543
|
+
FieldTypes[FieldTypes["WorkflowStatus"] = 28] = "WorkflowStatus";
|
|
544
|
+
FieldTypes[FieldTypes["AllDayEvent"] = 29] = "AllDayEvent";
|
|
545
|
+
FieldTypes[FieldTypes["WorkflowEventType"] = 30] = "WorkflowEventType";
|
|
546
|
+
})(FieldTypes || (FieldTypes = {}));
|
|
547
|
+
export var DateTimeFieldFormatType;
|
|
548
|
+
(function (DateTimeFieldFormatType) {
|
|
549
|
+
DateTimeFieldFormatType[DateTimeFieldFormatType["DateOnly"] = 0] = "DateOnly";
|
|
550
|
+
DateTimeFieldFormatType[DateTimeFieldFormatType["DateTime"] = 1] = "DateTime";
|
|
551
|
+
})(DateTimeFieldFormatType || (DateTimeFieldFormatType = {}));
|
|
552
|
+
export var DateTimeFieldFriendlyFormatType;
|
|
553
|
+
(function (DateTimeFieldFriendlyFormatType) {
|
|
554
|
+
DateTimeFieldFriendlyFormatType[DateTimeFieldFriendlyFormatType["Unspecified"] = 0] = "Unspecified";
|
|
555
|
+
DateTimeFieldFriendlyFormatType[DateTimeFieldFriendlyFormatType["Disabled"] = 1] = "Disabled";
|
|
556
|
+
DateTimeFieldFriendlyFormatType[DateTimeFieldFriendlyFormatType["Relative"] = 2] = "Relative";
|
|
557
|
+
})(DateTimeFieldFriendlyFormatType || (DateTimeFieldFriendlyFormatType = {}));
|
|
558
|
+
/**
|
|
559
|
+
* Specifies the control settings while adding a field.
|
|
560
|
+
*/
|
|
561
|
+
export var AddFieldOptions;
|
|
562
|
+
(function (AddFieldOptions) {
|
|
563
|
+
/**
|
|
564
|
+
* Specify that a new field added to the list must also be added to the default content type in the site collection
|
|
565
|
+
*/
|
|
566
|
+
AddFieldOptions[AddFieldOptions["DefaultValue"] = 0] = "DefaultValue";
|
|
567
|
+
/**
|
|
568
|
+
* Specify that a new field added to the list must also be added to the default content type in the site collection.
|
|
569
|
+
*/
|
|
570
|
+
AddFieldOptions[AddFieldOptions["AddToDefaultContentType"] = 1] = "AddToDefaultContentType";
|
|
571
|
+
/**
|
|
572
|
+
* Specify that a new field must not be added to any other content type
|
|
573
|
+
*/
|
|
574
|
+
AddFieldOptions[AddFieldOptions["AddToNoContentType"] = 2] = "AddToNoContentType";
|
|
575
|
+
/**
|
|
576
|
+
* Specify that a new field that is added to the specified list must also be added to all content types in the site collection
|
|
577
|
+
*/
|
|
578
|
+
AddFieldOptions[AddFieldOptions["AddToAllContentTypes"] = 4] = "AddToAllContentTypes";
|
|
579
|
+
/**
|
|
580
|
+
* Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations
|
|
581
|
+
*/
|
|
582
|
+
AddFieldOptions[AddFieldOptions["AddFieldInternalNameHint"] = 8] = "AddFieldInternalNameHint";
|
|
583
|
+
/**
|
|
584
|
+
* Specify that a new field that is added to the specified list must also be added to the default list view
|
|
585
|
+
*/
|
|
586
|
+
AddFieldOptions[AddFieldOptions["AddFieldToDefaultView"] = 16] = "AddFieldToDefaultView";
|
|
587
|
+
/**
|
|
588
|
+
* Specify to confirm that no other field has the same display name
|
|
589
|
+
*/
|
|
590
|
+
AddFieldOptions[AddFieldOptions["AddFieldCheckDisplayName"] = 32] = "AddFieldCheckDisplayName";
|
|
591
|
+
})(AddFieldOptions || (AddFieldOptions = {}));
|
|
592
|
+
export var CalendarType;
|
|
593
|
+
(function (CalendarType) {
|
|
594
|
+
CalendarType[CalendarType["Gregorian"] = 1] = "Gregorian";
|
|
595
|
+
CalendarType[CalendarType["Japan"] = 3] = "Japan";
|
|
596
|
+
CalendarType[CalendarType["Taiwan"] = 4] = "Taiwan";
|
|
597
|
+
CalendarType[CalendarType["Korea"] = 5] = "Korea";
|
|
598
|
+
CalendarType[CalendarType["Hijri"] = 6] = "Hijri";
|
|
599
|
+
CalendarType[CalendarType["Thai"] = 7] = "Thai";
|
|
600
|
+
CalendarType[CalendarType["Hebrew"] = 8] = "Hebrew";
|
|
601
|
+
CalendarType[CalendarType["GregorianMEFrench"] = 9] = "GregorianMEFrench";
|
|
602
|
+
CalendarType[CalendarType["GregorianArabic"] = 10] = "GregorianArabic";
|
|
603
|
+
CalendarType[CalendarType["GregorianXLITEnglish"] = 11] = "GregorianXLITEnglish";
|
|
604
|
+
CalendarType[CalendarType["GregorianXLITFrench"] = 12] = "GregorianXLITFrench";
|
|
605
|
+
CalendarType[CalendarType["KoreaJapanLunar"] = 14] = "KoreaJapanLunar";
|
|
606
|
+
CalendarType[CalendarType["ChineseLunar"] = 15] = "ChineseLunar";
|
|
607
|
+
CalendarType[CalendarType["SakaEra"] = 16] = "SakaEra";
|
|
608
|
+
CalendarType[CalendarType["UmAlQura"] = 23] = "UmAlQura";
|
|
609
|
+
})(CalendarType || (CalendarType = {}));
|
|
610
|
+
export var UrlFieldFormatType;
|
|
611
|
+
(function (UrlFieldFormatType) {
|
|
612
|
+
UrlFieldFormatType[UrlFieldFormatType["Hyperlink"] = 0] = "Hyperlink";
|
|
613
|
+
UrlFieldFormatType[UrlFieldFormatType["Image"] = 1] = "Image";
|
|
614
|
+
})(UrlFieldFormatType || (UrlFieldFormatType = {}));
|
|
615
|
+
export var FieldUserSelectionMode;
|
|
616
|
+
(function (FieldUserSelectionMode) {
|
|
617
|
+
FieldUserSelectionMode[FieldUserSelectionMode["PeopleAndGroups"] = 1] = "PeopleAndGroups";
|
|
618
|
+
FieldUserSelectionMode[FieldUserSelectionMode["PeopleOnly"] = 0] = "PeopleOnly";
|
|
619
|
+
})(FieldUserSelectionMode || (FieldUserSelectionMode = {}));
|
|
620
|
+
export var ChoiceFieldFormatType;
|
|
621
|
+
(function (ChoiceFieldFormatType) {
|
|
622
|
+
ChoiceFieldFormatType[ChoiceFieldFormatType["Dropdown"] = 0] = "Dropdown";
|
|
623
|
+
ChoiceFieldFormatType[ChoiceFieldFormatType["RadioButtons"] = 1] = "RadioButtons";
|
|
624
|
+
})(ChoiceFieldFormatType || (ChoiceFieldFormatType = {}));
|
|
610
625
|
//# sourceMappingURL=types.js.map
|