From 8a6bcacac2d7cb0979e8ca333a43d6612d443d89 Mon Sep 17 00:00:00 2001 From: Gunjan Datta Date: Tue, 2 Oct 2018 20:27:18 -0400 Subject: [PATCH] Added the geolocation configuration field type. --- build/helper/fieldSchemaXML.js | 14 ++++++++++++++ build/helper/spCfgTypes.js | 15 ++++++++------- build/helper/types/spCfgTypes.d.ts | 1 + build/rest.js | 2 +- dist/gd-sprest.d.ts | 1 + dist/gd-sprest.js | 6 +++--- dist/gd-sprest.min.js | 2 +- package.json | 2 +- src/helper/fieldSchemaXML.ts | 18 ++++++++++++++++++ src/helper/spCfgTypes.ts | 15 ++++++++------- src/helper/types/spCfgTypes.ts | 1 + src/rest.ts | 2 +- test/test.ts | 9 ++++----- 13 files changed, 62 insertions(+), 26 deletions(-) diff --git a/build/helper/fieldSchemaXML.js b/build/helper/fieldSchemaXML.js index 3b8bb4b8..b72ff9bc 100644 --- a/build/helper/fieldSchemaXML.js +++ b/build/helper/fieldSchemaXML.js @@ -123,6 +123,16 @@ exports.FieldSchemaXML = function (fieldInfo) { // Resolve the request _resolve(schemaXml); }; + // Returns the schema xml for a geolocation field. + var createGeolocation = function (fieldInfo, props) { + var schemaXml = null; + // Set the field type + props["Type"] = "Geolocation"; + // Generate the schema + schemaXml = ""; + // Resolve the request + _resolve(schemaXml); + }; // Returns the schema xml for a lookup field. var createLookup = function (fieldInfo, props) { var schemaXml = null; @@ -371,6 +381,10 @@ exports.FieldSchemaXML = function (fieldInfo) { case spCfg_1.SPCfgFieldType.Date: createDate(fieldInfo, props); break; + // Geolocation + case spCfg_1.SPCfgFieldType.Geolocation: + createGeolocation(fieldInfo, props); + break; // Lookup case spCfg_1.SPCfgFieldType.Lookup: createLookup(fieldInfo, props); diff --git a/build/helper/spCfgTypes.js b/build/helper/spCfgTypes.js index 66af1f13..4c5eec7f 100644 --- a/build/helper/spCfgTypes.js +++ b/build/helper/spCfgTypes.js @@ -9,13 +9,14 @@ exports.SPCfgFieldType = { Choice: 2, Currency: 3, Date: 4, - Lookup: 5, - MMS: 6, - Note: 7, - Number: 8, - Text: 9, - Url: 10, - User: 11 + Geolocation: 5, + Lookup: 6, + MMS: 7, + Note: 8, + Number: 9, + Text: 10, + Url: 11, + User: 12 }; /** * SharePoint Configuration Types diff --git a/build/helper/types/spCfgTypes.d.ts b/build/helper/types/spCfgTypes.d.ts index 09ef8cd6..90b04d8a 100644 --- a/build/helper/types/spCfgTypes.d.ts +++ b/build/helper/types/spCfgTypes.d.ts @@ -5,6 +5,7 @@ export declare type ISPCfgFieldType = { Choice: number; Currency: number; Date: number; + Geolocation: number; Lookup: number; MMS: number; Note: number; diff --git a/build/rest.js b/build/rest.js index cf304ab1..5bcb4878 100644 --- a/build/rest.js +++ b/build/rest.js @@ -7,7 +7,7 @@ var Mapper = require("./mapper"); * SharePoint REST Library */ exports.$REST = { - __ver: 4.28, + __ver: 4.29, AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); }, ContextInfo: Lib.ContextInfo, DefaultRequestToHostFl: false, diff --git a/dist/gd-sprest.d.ts b/dist/gd-sprest.d.ts index 33edb56d..e5a4b723 100644 --- a/dist/gd-sprest.d.ts +++ b/dist/gd-sprest.d.ts @@ -1995,6 +1995,7 @@ declare module 'gd-sprest/helper/types/spCfgTypes' { Choice: number; Currency: number; Date: number; + Geolocation: number; Lookup: number; MMS: number; Note: number; diff --git a/dist/gd-sprest.js b/dist/gd-sprest.js index 1e5c070b..e267ae43 100644 --- a/dist/gd-sprest.js +++ b/dist/gd-sprest.js @@ -130,7 +130,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ../lib */ \"./build/lib/index.js\");\nvar __1 = __webpack_require__(/*! .. */ \"./build/index.js\");\nvar spCfg_1 = __webpack_require__(/*! ./spCfg */ \"./build/helper/spCfg.js\");\n/**\r\n * Field Schema XML\r\n * Helper class for generating the field schema xml\r\n */\nexports.FieldSchemaXML = function (fieldInfo) {\n var _resolve = null;\n // Returns the schema xml for a boolean field.\n var createBoolean = function createBoolean(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Boolean\";\n // Generate the schema\n schemaXml = \"\";\n if (fieldInfo.defaultValue) {\n schemaXml += \"\" + fieldInfo.defaultValue + \"\";\n }\n schemaXml += \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a calculated field.\n var createCalculated = function createCalculated(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Calculated\";\n // Set the result type\n switch (fieldInfo.resultType) {\n case __1.SPTypes.FieldResultType.Boolean:\n props[\"ResultType\"] = \"Boolean\";\n break;\n case __1.SPTypes.FieldResultType.Currency:\n props[\"ResultType\"] = \"Currency\";\n break;\n case __1.SPTypes.FieldResultType.DateOnly:\n props[\"Format\"] = \"DateOnly\";\n props[\"ResultType\"] = \"DateTime\";\n break;\n case __1.SPTypes.FieldResultType.DateTime:\n props[\"Format\"] = \"DateTime\";\n props[\"ResultType\"] = \"DateTime\";\n break;\n case __1.SPTypes.FieldResultType.Number:\n props[\"ResultType\"] = \"Number\";\n break;\n default:\n props[\"ResultType\"] = \"Text\";\n break;\n }\n // Generate the schema\n schemaXml = \"\";\n if (fieldInfo.formula) {\n schemaXml += \"\" + fieldInfo.formula + \"\";\n }\n if (fieldInfo.fieldRefs) {\n schemaXml += \"\";\n for (var i = 0; i < fieldInfo.fieldRefs.length; i++) {\n schemaXml += \"\";\n }\n schemaXml += \"\";\n }\n schemaXml += \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a choice field.\n var createChoice = function createChoice(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = fieldInfo.multi ? \"MultiChoice\" : \"Choice\";\n // Generate the schema\n schemaXml = \"\";\n if (fieldInfo.defaultValue) {\n schemaXml += \"\" + fieldInfo.defaultValue + \"\";\n }\n if (fieldInfo.choices) {\n schemaXml += \"\";\n for (var i = 0; i < fieldInfo.choices.length; i++) {\n schemaXml += \"\" + fieldInfo.choices[i] + \"\";\n }\n schemaXml += \"\";\n }\n schemaXml += \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a currency field.\n var createCurrency = function createCurrency(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Currency\";\n // Set the number properties\n if (fieldInfo.decimals >= 0) {\n props[\"Decimals\"] = fieldInfo.decimals;\n }\n if (fieldInfo.lcid > 0) {\n props[\"LCID\"] = fieldInfo.lcid;\n }\n if (fieldInfo.max != null) {\n props[\"Max\"] = fieldInfo.max;\n }\n if (fieldInfo.min != null) {\n props[\"Min\"] = fieldInfo.min;\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a date field.\n var createDate = function createDate(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"DateTime\";\n // Set the date/time properties\n props[\"Format\"] = fieldInfo.format == __1.SPTypes.DateFormat.DateTime ? \"DateTime\" : \"DateOnly\";\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a lookup field.\n var createLookup = function createLookup(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = fieldInfo.multi ? \"LookupMulti\" : \"Lookup\";\n // Set the lookup properties\n if (fieldInfo.fieldRef) {\n props[\"FieldRef\"] = fieldInfo.fieldRef;\n }\n if (fieldInfo.multi) {\n props[\"Mult\"] = \"TRUE\";\n }\n if (fieldInfo.showField) {\n props[\"ShowField\"] = fieldInfo.showField;\n }\n // See if the lookup name exists\n if (fieldInfo.listName) {\n // Get the web containing the list\n lib_1.Web(fieldInfo.webUrl)\n // Get the list\n .Lists(fieldInfo.listName)\n // Set the query\n .query({\n Expand: [\"ParentWeb\"]\n })\n // Execute the request\n .execute(function (list) {\n // Set the list and web ids\n props[\"List\"] = \"{\" + list.Id + \"}\";\n if (fieldInfo.webUrl) {\n props[\"WebId\"] = list.ParentWeb.Id;\n }\n // Resolve the request\n _resolve(\"\");\n });\n } else {\n // Set the list id\n props[\"List\"] = \"{\" + fieldInfo.listId.replace(/[\\{\\}]/g, \"\") + \"}\";\n // Resolve the request\n _resolve(\"\");\n }\n };\n // Returns the schema xml for a managed metadata field.\n var createMMS = function createMMS(fieldInfo, props) {\n // Create the value field\n var valueProps = {\n ID: \"{\" + lib_1.ContextInfo.generateGUID() + \"}\",\n Name: fieldInfo.name + \"_0\",\n StaticName: fieldInfo.name + \"_0\",\n DisplayName: fieldInfo.title + \" Value\",\n Type: \"Note\",\n Hidden: \"TRUE\",\n Required: \"FALSE\",\n ShowInViewForms: \"FALSE\",\n CanToggleHidden: \"TRUE\"\n };\n // Generate the value field schema xml\n var schemaXmlValue = \"\";\n // Set the mms properties\n props[\"Type\"] = \"TaxonomyFieldType\";\n props[\"ShowField\"] = \"Term\" + (fieldInfo.locale ? fieldInfo.locale.toString() : \"1033\");\n // Generate the mms field schema xml\n var schemaXml = [\"\", \"\", \"\", \"\", \"TextField\", \"\" + valueProps.ID + \"\", \"\", \"\", \"\", \"\"].join(\"\");\n // Resolve the request\n _resolve([schemaXmlValue, schemaXml]);\n };\n // Returns the schema xml for a note field.\n var createNote = function createNote(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Note\";\n // Set the note properties\n if (fieldInfo.appendFl) {\n props[\"AppendOnly\"] = \"TRUE\";\n }\n if (fieldInfo.noteType == __1.SPTypes.FieldNoteType.EnhancedRichText || fieldInfo.noteType == __1.SPTypes.FieldNoteType.RichText) {\n props[\"RichText\"] = \"TRUE\";\n }\n if (fieldInfo.noteType == __1.SPTypes.FieldNoteType.EnhancedRichText) {\n props[\"RichTextMode\"] = \"FullHtml\";\n }\n if (fieldInfo.numberOfLines > 0) {\n props[\"NumLines\"] = fieldInfo.numberOfLines;\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a number field.\n var createNumber = function createNumber(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Number\";\n // Set the number properties\n if (fieldInfo.decimals >= 0) {\n props[\"Decimals\"] = fieldInfo.decimals;\n }\n if (fieldInfo.max != null) {\n props[\"Max\"] = fieldInfo.max;\n }\n if (fieldInfo.min != null) {\n props[\"Min\"] = fieldInfo.min;\n }\n if (fieldInfo.numberType == __1.SPTypes.FieldNumberType.Integer) {\n props[\"Decimals\"] = 0;\n }\n if (fieldInfo.numberType == __1.SPTypes.FieldNumberType.Percentage) {\n props[\"ShowPercentage\"] = \"TRUE\";\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a text field.\n var createText = function createText(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Text\";\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a url field.\n var createUrl = function createUrl(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"URL\";\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a user field.\n var createUser = function createUser(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"User\";\n // Set the user properties\n if (fieldInfo.multi) {\n props[\"Mult\"] = \"TRUE\";\n }\n if (fieldInfo.selectionMode != null) {\n props[\"UserSelectionMode\"] = fieldInfo.selectionMode;\n }\n if (fieldInfo.selectionScope != null) {\n props[\"UserSelectionScope\"] = fieldInfo.selectionScope;\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Method to convert the properties to a string\n var toString = function toString(props) {\n var properties = \"\";\n // Parse the properties\n for (var key in props) {\n var value = props[key];\n // Add the property\n properties += (properties ? \" \" : \"\") + key + \"=\\\"\" + props[key] + \"\\\"\";\n }\n // Return the string value\n return properties;\n };\n // Return a promise\n return new Promise(function (resolve, reject) {\n // Set the resolve method\n _resolve = resolve;\n // See if the schema xml has been defined\n if (fieldInfo.schemaXml) {\n // Resolve the promise\n resolve(fieldInfo.schemaXml);\n } else {\n // Set the base properties\n var props = {};\n props[\"ID\"] = \"{\" + lib_1.ContextInfo.generateGUID() + \"}\";\n props[\"Name\"] = fieldInfo.name;\n props[\"StaticName\"] = fieldInfo.name;\n props[\"DisplayName\"] = fieldInfo.title || fieldInfo.name;\n // Set the optional properties\n if (typeof fieldInfo.group !== \"undefined\") {\n props[\"Group\"] = fieldInfo.group;\n }\n if (typeof fieldInfo.jslink !== \"undefined\") {\n props[\"JSLink\"] = fieldInfo.jslink;\n }\n if (typeof fieldInfo.hidden !== \"undefined\") {\n props[\"Hidden\"] = fieldInfo.hidden ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.readOnly !== \"undefined\") {\n props[\"ReadOnly\"] = fieldInfo.readOnly ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.required !== \"undefined\") {\n props[\"Required\"] = fieldInfo.required ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInDisplayForm !== \"undefined\") {\n props[\"ShowInDisplayForm\"] = fieldInfo.showInDisplayForm ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInEditForm !== \"undefined\") {\n props[\"ShowInEditForm\"] = fieldInfo.showInEditForm ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInListSettings !== \"undefined\") {\n props[\"ShowInListSettings\"] = fieldInfo.showInListSettings ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInNewForm !== \"undefined\") {\n props[\"ShowInNewForm\"] = fieldInfo.showInNewForm ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInViewForms !== \"undefined\") {\n props[\"ShowInViewForms\"] = fieldInfo.showInViewForms ? \"TRUE\" : \"FALSE\";\n }\n // Set the type\n switch (fieldInfo.type) {\n // Boolean\n case spCfg_1.SPCfgFieldType.Boolean:\n createBoolean(fieldInfo, props);\n break;\n // Calculated\n case spCfg_1.SPCfgFieldType.Calculated:\n createCalculated(fieldInfo, props);\n break;\n // Choice\n case spCfg_1.SPCfgFieldType.Choice:\n createChoice(fieldInfo, props);\n break;\n // Currency\n case spCfg_1.SPCfgFieldType.Currency:\n createCurrency(fieldInfo, props);\n break;\n // Date/Time\n case spCfg_1.SPCfgFieldType.Date:\n createDate(fieldInfo, props);\n break;\n // Lookup\n case spCfg_1.SPCfgFieldType.Lookup:\n createLookup(fieldInfo, props);\n break;\n // MMS\n case spCfg_1.SPCfgFieldType.MMS:\n createMMS(fieldInfo, props);\n break;\n // Note\n case spCfg_1.SPCfgFieldType.Note:\n createNote(fieldInfo, props);\n break;\n // Number\n case spCfg_1.SPCfgFieldType.Number:\n createNumber(fieldInfo, props);\n break;\n // Text\n case spCfg_1.SPCfgFieldType.Text:\n createText(fieldInfo, props);\n break;\n // URL\n case spCfg_1.SPCfgFieldType.Url:\n createUrl(fieldInfo, props);\n break;\n // User\n case spCfg_1.SPCfgFieldType.User:\n createUser(fieldInfo, props);\n break;\n // Field type not supported\n default:\n // Create a text field by default\n createText(fieldInfo, props);\n break;\n }\n }\n });\n};\n\n//# sourceURL=webpack:///./build/helper/fieldSchemaXML.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar lib_1 = __webpack_require__(/*! ../lib */ \"./build/lib/index.js\");\nvar __1 = __webpack_require__(/*! .. */ \"./build/index.js\");\nvar spCfg_1 = __webpack_require__(/*! ./spCfg */ \"./build/helper/spCfg.js\");\n/**\r\n * Field Schema XML\r\n * Helper class for generating the field schema xml\r\n */\nexports.FieldSchemaXML = function (fieldInfo) {\n var _resolve = null;\n // Returns the schema xml for a boolean field.\n var createBoolean = function createBoolean(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Boolean\";\n // Generate the schema\n schemaXml = \"\";\n if (fieldInfo.defaultValue) {\n schemaXml += \"\" + fieldInfo.defaultValue + \"\";\n }\n schemaXml += \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a calculated field.\n var createCalculated = function createCalculated(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Calculated\";\n // Set the result type\n switch (fieldInfo.resultType) {\n case __1.SPTypes.FieldResultType.Boolean:\n props[\"ResultType\"] = \"Boolean\";\n break;\n case __1.SPTypes.FieldResultType.Currency:\n props[\"ResultType\"] = \"Currency\";\n break;\n case __1.SPTypes.FieldResultType.DateOnly:\n props[\"Format\"] = \"DateOnly\";\n props[\"ResultType\"] = \"DateTime\";\n break;\n case __1.SPTypes.FieldResultType.DateTime:\n props[\"Format\"] = \"DateTime\";\n props[\"ResultType\"] = \"DateTime\";\n break;\n case __1.SPTypes.FieldResultType.Number:\n props[\"ResultType\"] = \"Number\";\n break;\n default:\n props[\"ResultType\"] = \"Text\";\n break;\n }\n // Generate the schema\n schemaXml = \"\";\n if (fieldInfo.formula) {\n schemaXml += \"\" + fieldInfo.formula + \"\";\n }\n if (fieldInfo.fieldRefs) {\n schemaXml += \"\";\n for (var i = 0; i < fieldInfo.fieldRefs.length; i++) {\n schemaXml += \"\";\n }\n schemaXml += \"\";\n }\n schemaXml += \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a choice field.\n var createChoice = function createChoice(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = fieldInfo.multi ? \"MultiChoice\" : \"Choice\";\n // Generate the schema\n schemaXml = \"\";\n if (fieldInfo.defaultValue) {\n schemaXml += \"\" + fieldInfo.defaultValue + \"\";\n }\n if (fieldInfo.choices) {\n schemaXml += \"\";\n for (var i = 0; i < fieldInfo.choices.length; i++) {\n schemaXml += \"\" + fieldInfo.choices[i] + \"\";\n }\n schemaXml += \"\";\n }\n schemaXml += \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a currency field.\n var createCurrency = function createCurrency(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Currency\";\n // Set the number properties\n if (fieldInfo.decimals >= 0) {\n props[\"Decimals\"] = fieldInfo.decimals;\n }\n if (fieldInfo.lcid > 0) {\n props[\"LCID\"] = fieldInfo.lcid;\n }\n if (fieldInfo.max != null) {\n props[\"Max\"] = fieldInfo.max;\n }\n if (fieldInfo.min != null) {\n props[\"Min\"] = fieldInfo.min;\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a date field.\n var createDate = function createDate(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"DateTime\";\n // Set the date/time properties\n props[\"Format\"] = fieldInfo.format == __1.SPTypes.DateFormat.DateTime ? \"DateTime\" : \"DateOnly\";\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a geolocation field.\n var createGeolocation = function createGeolocation(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Geolocation\";\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a lookup field.\n var createLookup = function createLookup(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = fieldInfo.multi ? \"LookupMulti\" : \"Lookup\";\n // Set the lookup properties\n if (fieldInfo.fieldRef) {\n props[\"FieldRef\"] = fieldInfo.fieldRef;\n }\n if (fieldInfo.multi) {\n props[\"Mult\"] = \"TRUE\";\n }\n if (fieldInfo.showField) {\n props[\"ShowField\"] = fieldInfo.showField;\n }\n // See if the lookup name exists\n if (fieldInfo.listName) {\n // Get the web containing the list\n lib_1.Web(fieldInfo.webUrl)\n // Get the list\n .Lists(fieldInfo.listName)\n // Set the query\n .query({\n Expand: [\"ParentWeb\"]\n })\n // Execute the request\n .execute(function (list) {\n // Set the list and web ids\n props[\"List\"] = \"{\" + list.Id + \"}\";\n if (fieldInfo.webUrl) {\n props[\"WebId\"] = list.ParentWeb.Id;\n }\n // Resolve the request\n _resolve(\"\");\n });\n } else {\n // Set the list id\n props[\"List\"] = \"{\" + fieldInfo.listId.replace(/[\\{\\}]/g, \"\") + \"}\";\n // Resolve the request\n _resolve(\"\");\n }\n };\n // Returns the schema xml for a managed metadata field.\n var createMMS = function createMMS(fieldInfo, props) {\n // Create the value field\n var valueProps = {\n ID: \"{\" + lib_1.ContextInfo.generateGUID() + \"}\",\n Name: fieldInfo.name + \"_0\",\n StaticName: fieldInfo.name + \"_0\",\n DisplayName: fieldInfo.title + \" Value\",\n Type: \"Note\",\n Hidden: \"TRUE\",\n Required: \"FALSE\",\n ShowInViewForms: \"FALSE\",\n CanToggleHidden: \"TRUE\"\n };\n // Generate the value field schema xml\n var schemaXmlValue = \"\";\n // Set the mms properties\n props[\"Type\"] = \"TaxonomyFieldType\";\n props[\"ShowField\"] = \"Term\" + (fieldInfo.locale ? fieldInfo.locale.toString() : \"1033\");\n // Generate the mms field schema xml\n var schemaXml = [\"\", \"\", \"\", \"\", \"TextField\", \"\" + valueProps.ID + \"\", \"\", \"\", \"\", \"\"].join(\"\");\n // Resolve the request\n _resolve([schemaXmlValue, schemaXml]);\n };\n // Returns the schema xml for a note field.\n var createNote = function createNote(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Note\";\n // Set the note properties\n if (fieldInfo.appendFl) {\n props[\"AppendOnly\"] = \"TRUE\";\n }\n if (fieldInfo.noteType == __1.SPTypes.FieldNoteType.EnhancedRichText || fieldInfo.noteType == __1.SPTypes.FieldNoteType.RichText) {\n props[\"RichText\"] = \"TRUE\";\n }\n if (fieldInfo.noteType == __1.SPTypes.FieldNoteType.EnhancedRichText) {\n props[\"RichTextMode\"] = \"FullHtml\";\n }\n if (fieldInfo.numberOfLines > 0) {\n props[\"NumLines\"] = fieldInfo.numberOfLines;\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a number field.\n var createNumber = function createNumber(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Number\";\n // Set the number properties\n if (fieldInfo.decimals >= 0) {\n props[\"Decimals\"] = fieldInfo.decimals;\n }\n if (fieldInfo.max != null) {\n props[\"Max\"] = fieldInfo.max;\n }\n if (fieldInfo.min != null) {\n props[\"Min\"] = fieldInfo.min;\n }\n if (fieldInfo.numberType == __1.SPTypes.FieldNumberType.Integer) {\n props[\"Decimals\"] = 0;\n }\n if (fieldInfo.numberType == __1.SPTypes.FieldNumberType.Percentage) {\n props[\"ShowPercentage\"] = \"TRUE\";\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a text field.\n var createText = function createText(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"Text\";\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a url field.\n var createUrl = function createUrl(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"URL\";\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Returns the schema xml for a user field.\n var createUser = function createUser(fieldInfo, props) {\n var schemaXml = null;\n // Set the field type\n props[\"Type\"] = \"User\";\n // Set the user properties\n if (fieldInfo.multi) {\n props[\"Mult\"] = \"TRUE\";\n }\n if (fieldInfo.selectionMode != null) {\n props[\"UserSelectionMode\"] = fieldInfo.selectionMode;\n }\n if (fieldInfo.selectionScope != null) {\n props[\"UserSelectionScope\"] = fieldInfo.selectionScope;\n }\n // Generate the schema\n schemaXml = \"\";\n // Resolve the request\n _resolve(schemaXml);\n };\n // Method to convert the properties to a string\n var toString = function toString(props) {\n var properties = \"\";\n // Parse the properties\n for (var key in props) {\n var value = props[key];\n // Add the property\n properties += (properties ? \" \" : \"\") + key + \"=\\\"\" + props[key] + \"\\\"\";\n }\n // Return the string value\n return properties;\n };\n // Return a promise\n return new Promise(function (resolve, reject) {\n // Set the resolve method\n _resolve = resolve;\n // See if the schema xml has been defined\n if (fieldInfo.schemaXml) {\n // Resolve the promise\n resolve(fieldInfo.schemaXml);\n } else {\n // Set the base properties\n var props = {};\n props[\"ID\"] = \"{\" + lib_1.ContextInfo.generateGUID() + \"}\";\n props[\"Name\"] = fieldInfo.name;\n props[\"StaticName\"] = fieldInfo.name;\n props[\"DisplayName\"] = fieldInfo.title || fieldInfo.name;\n // Set the optional properties\n if (typeof fieldInfo.group !== \"undefined\") {\n props[\"Group\"] = fieldInfo.group;\n }\n if (typeof fieldInfo.jslink !== \"undefined\") {\n props[\"JSLink\"] = fieldInfo.jslink;\n }\n if (typeof fieldInfo.hidden !== \"undefined\") {\n props[\"Hidden\"] = fieldInfo.hidden ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.readOnly !== \"undefined\") {\n props[\"ReadOnly\"] = fieldInfo.readOnly ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.required !== \"undefined\") {\n props[\"Required\"] = fieldInfo.required ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInDisplayForm !== \"undefined\") {\n props[\"ShowInDisplayForm\"] = fieldInfo.showInDisplayForm ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInEditForm !== \"undefined\") {\n props[\"ShowInEditForm\"] = fieldInfo.showInEditForm ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInListSettings !== \"undefined\") {\n props[\"ShowInListSettings\"] = fieldInfo.showInListSettings ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInNewForm !== \"undefined\") {\n props[\"ShowInNewForm\"] = fieldInfo.showInNewForm ? \"TRUE\" : \"FALSE\";\n }\n if (typeof fieldInfo.showInViewForms !== \"undefined\") {\n props[\"ShowInViewForms\"] = fieldInfo.showInViewForms ? \"TRUE\" : \"FALSE\";\n }\n // Set the type\n switch (fieldInfo.type) {\n // Boolean\n case spCfg_1.SPCfgFieldType.Boolean:\n createBoolean(fieldInfo, props);\n break;\n // Calculated\n case spCfg_1.SPCfgFieldType.Calculated:\n createCalculated(fieldInfo, props);\n break;\n // Choice\n case spCfg_1.SPCfgFieldType.Choice:\n createChoice(fieldInfo, props);\n break;\n // Currency\n case spCfg_1.SPCfgFieldType.Currency:\n createCurrency(fieldInfo, props);\n break;\n // Date/Time\n case spCfg_1.SPCfgFieldType.Date:\n createDate(fieldInfo, props);\n break;\n // Geolocation\n case spCfg_1.SPCfgFieldType.Geolocation:\n createGeolocation(fieldInfo, props);\n break;\n // Lookup\n case spCfg_1.SPCfgFieldType.Lookup:\n createLookup(fieldInfo, props);\n break;\n // MMS\n case spCfg_1.SPCfgFieldType.MMS:\n createMMS(fieldInfo, props);\n break;\n // Note\n case spCfg_1.SPCfgFieldType.Note:\n createNote(fieldInfo, props);\n break;\n // Number\n case spCfg_1.SPCfgFieldType.Number:\n createNumber(fieldInfo, props);\n break;\n // Text\n case spCfg_1.SPCfgFieldType.Text:\n createText(fieldInfo, props);\n break;\n // URL\n case spCfg_1.SPCfgFieldType.Url:\n createUrl(fieldInfo, props);\n break;\n // User\n case spCfg_1.SPCfgFieldType.User:\n createUser(fieldInfo, props);\n break;\n // Field type not supported\n default:\n // Create a text field by default\n createText(fieldInfo, props);\n break;\n }\n }\n });\n};\n\n//# sourceURL=webpack:///./build/helper/fieldSchemaXML.js?"); /***/ }), @@ -262,7 +262,7 @@ eval("\n\nfunction __export(m) {\n for (var p in m) {\n if (!exports.h /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\r\n * SharePoint Configuration Field Types\r\n */\nexports.SPCfgFieldType = {\n Boolean: 0,\n Calculated: 1,\n Choice: 2,\n Currency: 3,\n Date: 4,\n Lookup: 5,\n MMS: 6,\n Note: 7,\n Number: 8,\n Text: 9,\n Url: 10,\n User: 11\n};\n/**\r\n * SharePoint Configuration Types\r\n * The value determines the order to install the object type.\r\n */\nexports.SPCfgType = {\n Fields: 0,\n ContentTypes: 1,\n Lists: 2,\n SiteUserCustomActions: 3,\n WebParts: 5,\n WebUserCustomActions: 4\n};\n\n//# sourceURL=webpack:///./build/helper/spCfgTypes.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\r\n * SharePoint Configuration Field Types\r\n */\nexports.SPCfgFieldType = {\n Boolean: 0,\n Calculated: 1,\n Choice: 2,\n Currency: 3,\n Date: 4,\n Geolocation: 5,\n Lookup: 6,\n MMS: 7,\n Note: 8,\n Number: 9,\n Text: 10,\n Url: 11,\n User: 12\n};\n/**\r\n * SharePoint Configuration Types\r\n * The value determines the order to install the object type.\r\n */\nexports.SPCfgType = {\n Fields: 0,\n ContentTypes: 1,\n Lists: 2,\n SiteUserCustomActions: 3,\n WebParts: 5,\n WebUserCustomActions: 4\n};\n\n//# sourceURL=webpack:///./build/helper/spCfgTypes.js?"); /***/ }), @@ -742,7 +742,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Helper = __webpack_require__(/*! ./helper */ \"./build/helper/index.js\");\nvar Lib = __webpack_require__(/*! ./lib */ \"./build/lib/index.js\");\nvar Mapper = __webpack_require__(/*! ./mapper */ \"./build/mapper/index.js\");\n/**\r\n * SharePoint REST Library\r\n */\nexports.$REST = {\n __ver: 4.28,\n AppContext: function AppContext(siteUrl) {\n return Lib.Site.getAppContext(siteUrl);\n },\n ContextInfo: Lib.ContextInfo,\n DefaultRequestToHostFl: false,\n Graph: Lib.Graph,\n Helper: {\n App: Helper.App,\n Dependencies: Helper.Dependencies,\n createDocSet: Helper.createDocSet,\n Executor: Helper.Executor,\n FieldSchemaXML: Helper.FieldSchemaXML,\n JSLink: Helper.JSLink,\n ListForm: Helper.ListForm,\n ListFormField: Helper.ListFormField,\n Loader: Helper.Loader,\n parse: Helper.parse,\n request: Helper.request,\n RibbonLink: Helper.RibbonLink,\n SP: Helper.SP,\n SPCfgFieldType: Helper.SPCfgFieldType,\n SPCfgType: Helper.SPCfgType,\n SPConfig: Helper.SPConfig,\n SuiteBarLink: Helper.SuiteBarLink,\n Taxonomy: Helper.Taxonomy,\n WebPart: Helper.WebPart\n },\n List: Lib.List,\n ListByEntityName: Lib.List.getByEntityName,\n ListDataAsStream: Lib.List.getDataAsStream,\n Navigation: Lib.Navigation,\n PeopleManager: Lib.PeopleManager,\n PeoplePicker: Lib.PeoplePicker,\n ProfileLoader: Lib.ProfileLoader,\n RemoteWeb: function RemoteWeb(requestUrl) {\n return Lib.Web.getRemoteWeb(requestUrl);\n },\n Search: Lib.Search,\n Site: Lib.Site,\n SiteExists: function SiteExists(url) {\n return Lib.Site.exists(url);\n },\n SiteUrl: function SiteUrl(id) {\n return Lib.Site.getUrlById(id);\n },\n SPTypes: Mapper.SPTypes,\n SocialFeed: Lib.SocialFeed,\n UserProfile: Lib.UserProfile,\n Utility: Lib.Utility,\n Web: Lib.Web\n};\n// See if the library doesn't exist, or is an older version\nvar global = Lib.ContextInfo.window.$REST;\nif (global == null || global.__ver == null || global.__ver < exports.$REST.__ver) {\n // Set the global variable\n Lib.ContextInfo.window.$REST = exports.$REST;\n // Ensure the SP lib exists\n if (Lib.ContextInfo.window.SP) {\n // Alert other scripts this library is loaded\n Lib.ContextInfo.window.SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs(\"gd-sprest.js\");\n }\n}\n\n//# sourceURL=webpack:///./build/rest.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Helper = __webpack_require__(/*! ./helper */ \"./build/helper/index.js\");\nvar Lib = __webpack_require__(/*! ./lib */ \"./build/lib/index.js\");\nvar Mapper = __webpack_require__(/*! ./mapper */ \"./build/mapper/index.js\");\n/**\r\n * SharePoint REST Library\r\n */\nexports.$REST = {\n __ver: 4.29,\n AppContext: function AppContext(siteUrl) {\n return Lib.Site.getAppContext(siteUrl);\n },\n ContextInfo: Lib.ContextInfo,\n DefaultRequestToHostFl: false,\n Graph: Lib.Graph,\n Helper: {\n App: Helper.App,\n Dependencies: Helper.Dependencies,\n createDocSet: Helper.createDocSet,\n Executor: Helper.Executor,\n FieldSchemaXML: Helper.FieldSchemaXML,\n JSLink: Helper.JSLink,\n ListForm: Helper.ListForm,\n ListFormField: Helper.ListFormField,\n Loader: Helper.Loader,\n parse: Helper.parse,\n request: Helper.request,\n RibbonLink: Helper.RibbonLink,\n SP: Helper.SP,\n SPCfgFieldType: Helper.SPCfgFieldType,\n SPCfgType: Helper.SPCfgType,\n SPConfig: Helper.SPConfig,\n SuiteBarLink: Helper.SuiteBarLink,\n Taxonomy: Helper.Taxonomy,\n WebPart: Helper.WebPart\n },\n List: Lib.List,\n ListByEntityName: Lib.List.getByEntityName,\n ListDataAsStream: Lib.List.getDataAsStream,\n Navigation: Lib.Navigation,\n PeopleManager: Lib.PeopleManager,\n PeoplePicker: Lib.PeoplePicker,\n ProfileLoader: Lib.ProfileLoader,\n RemoteWeb: function RemoteWeb(requestUrl) {\n return Lib.Web.getRemoteWeb(requestUrl);\n },\n Search: Lib.Search,\n Site: Lib.Site,\n SiteExists: function SiteExists(url) {\n return Lib.Site.exists(url);\n },\n SiteUrl: function SiteUrl(id) {\n return Lib.Site.getUrlById(id);\n },\n SPTypes: Mapper.SPTypes,\n SocialFeed: Lib.SocialFeed,\n UserProfile: Lib.UserProfile,\n Utility: Lib.Utility,\n Web: Lib.Web\n};\n// See if the library doesn't exist, or is an older version\nvar global = Lib.ContextInfo.window.$REST;\nif (global == null || global.__ver == null || global.__ver < exports.$REST.__ver) {\n // Set the global variable\n Lib.ContextInfo.window.$REST = exports.$REST;\n // Ensure the SP lib exists\n if (Lib.ContextInfo.window.SP) {\n // Alert other scripts this library is loaded\n Lib.ContextInfo.window.SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs(\"gd-sprest.js\");\n }\n}\n\n//# sourceURL=webpack:///./build/rest.js?"); /***/ }), diff --git a/dist/gd-sprest.min.js b/dist/gd-sprest.min.js index 2bc08cb1..45000d86 100644 --- a/dist/gd-sprest.min.js +++ b/dist/gd-sprest.min.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=42)}([function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(78)),r(n(79)),r(n(99)),r(n(100)),r(n(101)),r(n(102)),r(n(103)),r(n(104)),r(n(105)),r(n(106));var o=n(107);t.Types=o},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(77)),r(n(108)),r(n(109)),r(n(110)),r(n(111)),r(n(112)),r(n(113)),r(n(114)),r(n(115)),r(n(116)),r(n(117)),r(n(118)),r(n(39));var o=n(119);t.Types=o},function(e,t,n){var r=n(27)("wks"),o=n(20),i=n(3).Symbol,s="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=s&&i[e]||(s?i:o)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(7);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(14),o=n(29);e.exports=n(8)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(3),o=n(5),i=n(15),s=n(20)("src"),a=Function.toString,u=(""+a).split("toString");n(9).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,n,a){var l="function"==typeof n;l&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(l&&(i(n,s)||o(n,s,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:a?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[s]||a.call(this)})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(28)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n=e.exports={version:"2.5.4"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports={}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});var o=n(18);t.Helper=o;var i=n(12);t.SPTypes=i.SPTypes;var s=n(134);t.Types=s,r(n(1)),r(n(135))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(80);t.Mapper=r;var o=n(94);t.SPTypes=o;var i=n(95);t.Types=i},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(4),o=n(45),i=n(46),s=Object.defineProperty;t.f=n(8)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(17);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(76)),r(n(120)),r(n(121)),r(n(122)),r(n(124)),r(n(125)),r(n(126)),r(n(127)),r(n(128)),r(n(41)),r(n(129)),r(n(40)),r(n(130)),r(n(131));var o=n(132);t.SP=o;var i=n(133);t.Types=i},function(e,t,n){var r=n(13),o=n(2)("toStringTag"),i="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:i?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(7),o=n(3).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(53),o=n(23);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(27)("keys"),o=n(20);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(14).f,o=n(15),i=n(2)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(3),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(31),o=n(32),i=n(6),s=n(5),a=n(10),u=n(49),l=n(26),c=n(56),p=n(2)("iterator"),d=!([].keys&&"next"in[].keys()),f=function(){return this};e.exports=function(e,t,n,y,m,g,h){u(n,t,y);var T,b,P,v=function(e){if(!d&&e in w)return w[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},I=t+" Iterator",S="values"==m,q=!1,w=e.prototype,x=w[p]||w["@@iterator"]||m&&w[m],C=x||v(m),R=m?S?v("entries"):C:void 0,_="Array"==t&&w.entries||x;if(_&&(P=c(_.call(new e)))!==Object.prototype&&P.next&&(l(P,I,!0),r||"function"==typeof P[p]||s(P,p,f)),S&&x&&"values"!==x.name&&(q=!0,C=function(){return x.call(this)}),r&&!h||!d&&!q&&w[p]||s(w,p,C),a[t]=C,a[I]=f,m)if(T={values:S?C:v("values"),keys:g?C:v("keys"),entries:R},h)for(b in T)b in w||i(w,b,T[b]);else o(o.P+o.F*(d||q),t,T);return T}},function(e,t){e.exports=!1},function(e,t,n){var r=n(3),o=n(9),i=n(5),s=n(6),a=n(16),u=function(e,t,n){var l,c,p,d,f=e&u.F,y=e&u.G,m=e&u.S,g=e&u.P,h=e&u.B,T=y?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,b=y?o:o[t]||(o[t]={}),P=b.prototype||(b.prototype={});for(l in y&&(n=t),n)p=((c=!f&&T&&void 0!==T[l])?T:n)[l],d=h&&c?a(p,r):g&&"function"==typeof p?a(Function.call,p):p,T&&s(T,l,p,e&u.U),b[l]!=p&&i(b,l,d),g&&P[l]!=p&&(P[l]=p)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(52),o=n(35);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(22),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(3).document;e.exports=r&&r.documentElement},function(e,t,n){var r,o,i,s=n(16),a=n(69),u=n(36),l=n(21),c=n(3),p=c.process,d=c.setImmediate,f=c.clearImmediate,y=c.MessageChannel,m=c.Dispatch,g=0,h={},T=function(){var e=+this;if(h.hasOwnProperty(e)){var t=h[e];delete h[e],t()}},b=function(e){T.call(e.data)};d&&f||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return h[++g]=function(){a("function"==typeof e?e:Function(e),t)},r(g),g},f=function(e){delete h[e]},"process"==n(13)(p)?r=function(e){p.nextTick(s(T,e,1))}:m&&m.now?r=function(e){m.now(s(T,e,1))}:y?(i=(o=new y).port2,o.port1.onmessage=b,r=s(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(r=function(e){c.postMessage(e+"","*")},c.addEventListener("message",b,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),T.call(e)}}:function(e){setTimeout(s(T,e,1),0)}),e.exports={set:d,clear:f}},function(e,t,n){"use strict";var r=n(17);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.Web=function(e,t){var n=new r.Base(t);return n.targetInfo.defaultToWebFl=!0,n.targetInfo.endpoint="web",e&&(n.targetInfo.url=e),n.addMethods(n,{__metadata:{type:"web"}}),n},t.Web.getRemoteWeb=function(e){return new r.Base({data:{requestUrl:e},defaultToWebFl:!0,endpoint:"SP.RemoteWeb?$expand=Web",method:"POST"})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(123));var r=n(1),o=n(11),i=n(18);t.SPConfig=function(e,t){var n=function(e,n){return new Promise(function(o,i){if(null!=n&&0!=n.length){for(var s=function(o){var s=n[o],a=u("Name",s.Name,e.results);a?(console.log("[gd-sprest][Content Type] The content type '"+s.Name+"' already exists."),s.ContentType=a):(console.log("[gd-sprest][Content Type] Creating the '"+s.Name+"' content type."),s.ParentName?r.Web(s.ParentWebUrl||t).ContentTypes().query({Filter:"Name eq '"+s.ParentName+"'"}).execute(function(t){t.results[0]?e.addAvailableContentType(t.results[0].Id.StringValue).execute(function(e){e.existsFl?new Promise(function(t,n){e.Name!=s.Name?e.update({Name:s.Name}).execute(function(){t()}):t()}).then(function(){console.log("[gd-sprest][Content Type] The content type '"+s.Name+"' was created successfully."),s.ContentType=e,s.onCreated&&s.onCreated(e)}):(console.log("[gd-sprest][Content Type] The content type '"+s.Name+"' failed to be created."),console.error("[gd-sprest][Field] Error: "+e.response))},!0):console.log("[gd-sprest][Content Type] The parent content type '"+s.Name+"' was not found.")},i):e.add({Description:s.Description,Group:s.Group,Id:{__metadata:{type:"SP.ContentTypeId"},StringValue:s.Id?s.Id.StringValue:"0x0100"+r.ContextInfo.generateGUID().replace("{","").replace("-","").replace("}","")},Name:s.Name}).execute(function(e){e.existsFl?(console.log("[gd-sprest][Content Type] The content type '"+s.Name+"' was created successfully."),s.ContentType=e,s.onCreated&&s.onCreated(e)):(console.log("[gd-sprest][Content Type] The content type '"+s.Name+"' failed to be created."),console.error("[gd-sprest][Field] Error: "+e.response))},i,!0))},a=0;a0){console.log("[gd-sprest][View] Updating the view fields for the '"+i.ViewName+"' view."),s.ViewFields().removeAllViewFields().execute(!0);for(var a=0;a=t.length&&r()})},s=0;s=f&&l()};e.Fields&&e.Fields.length>0&&(f++,console.log("[gd-sprest][Fields] Starting the requests."),y.Fields().execute(function(t){return new Promise(function(n,r){s(i.parse(t.stringify()),e.Fields).then(function(){console.log("[gd-sprest][Fields] Completed the requests."),m(),n()},r)})},c)),e.ContentTypes&&e.ContentTypes.length>0&&(f++,console.log("[gd-sprest][Content Types] Starting the requests."),y.ContentTypes().execute(function(t){n(i.parse(t.stringify()),e.ContentTypes).then(function(){console.log("[gd-sprest][Content Types] Completed the requests."),m()})},c,!0)),e.ListCfg&&e.ListCfg.length&&(f++,console.log("[gd-sprest][Lists] Starting the requests."),y.Lists().execute(function(t){(function(e,t){return new Promise(function(n,r){for(var o=function(n){var o=t[n];if(u("Title",o.ListInformation.Title,e.results))console.log("[gd-sprest][List] The list '"+o.ListInformation.Title+"' already exists.");else{console.log("[gd-sprest][List] Creating the '"+o.ListInformation.Title+"' list.");var i=o.ListInformation,s=i.Title;i.Title=s.replace(/ /g,""),e.add(i).execute(function(e){i.Title=s,e.existsFl?(e.existsFl&&e.Title!=s?e.update({Title:s}).execute(function(){console.log("[gd-sprest][List] The list '"+e.Title+"' was created successfully.")}):console.log("[gd-sprest][List] The list '"+e.Title+"' was created successfully."),o.onCreated&&o.onCreated(e)):(console.log("[gd-sprest][List] The list '"+i.Title+"' failed to be created."),console.log("[gd-sprest][List] Error: '"+e.response))},r)}},i=0;i0&&(f++,console.log("[gd-sprest][WebParts] Starting the requests."),new Promise(function(t,n){var i=e.WebPartCfg;console.log("[gd-sprest][WebPart] Creating the web parts."),r.Web(r.ContextInfo.siteServerRelativeUrl).getCatalog(o.SPTypes.ListTemplateType.WebPartCatalog).RootFolder().query({Expand:["Files"]}).execute(function(e){for(var n=0,s=function(s){var a=i[s],l=function(){++n>=i.length&&t()},c=u("Name",a.FileName,e.Files.results);if(c.existsFl)console.log("[gd-sprest][WebPart] The webpart '"+a.FileName+"' already exists."),a.onUpdated&&a.onUpdated(c),l();else{for(var p=a.XML.trim(),d=new ArrayBuffer(2*p.length),f=new Uint16Array(d),y=0;y"+e.title+"",t.id=e.id,t.onclick=e.onClick,n?r.appendChild(t):r.insertBefore(t,r.firstChild)),t}},function(e,t,n){n(43),e.exports=n(11)},function(e,t,n){n(44),n(47),n(58),n(62),e.exports=n(9).Promise},function(e,t,n){"use strict";var r=n(19),o={};o[n(2)("toStringTag")]="z",o+""!="[object z]"&&n(6)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(e,t,n){e.exports=!n(8)&&!n(28)(function(){return 7!=Object.defineProperty(n(21)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(7);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(48)(!0);n(30)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var r=n(22),o=n(23);e.exports=function(e){return function(t,n){var i,s,a=String(o(t)),u=r(n),l=a.length;return u<0||u>=l?e?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===l||(s=a.charCodeAt(u+1))<56320||s>57343?e?a.charAt(u):i:e?a.slice(u,u+2):s-56320+(i-55296<<10)+65536}}},function(e,t,n){"use strict";var r=n(50),o=n(29),i=n(26),s={};n(5)(s,n(2)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(s,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(4),o=n(51),i=n(35),s=n(25)("IE_PROTO"),a=function(){},u=function(){var e,t=n(21)("iframe"),r=i.length;for(t.style.display="none",n(36).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("