|
35 | 35 | (function(){ |
36 | 36 | // APP VERSION/BUILD |
37 | 37 | var APP_VER = "1.9.0-beta"; |
38 | | - var APP_BLD = "20181210"; |
| 38 | + var APP_BLD = "20181211"; |
39 | 39 | var DEBUG = false; // (verbose mode/lots of logging) |
40 | 40 | // ENUMERATIONS |
41 | 41 | // REF: [`SP.BaseType`](https://msdn.microsoft.com/en-us/library/office/jj246925.aspx) |
|
608 | 608 |
|
609 | 609 | // API: FOLDER |
610 | 610 | /** |
611 | | - * @param `inOpt` (object)/(string) - required - (`name` prop reqd) |
| 611 | + * SharePoint Library Folder Resource methods |
612 | 612 | * |
| 613 | + * @param `inOpt` (object)/(string) - required - (`name` prop reqd) |
613 | 614 | * @example - `sprLib.folder('SiteAssets');` |
614 | 615 | * @example - `sprLib.folder('/sites/dev/SiteAssets/');` |
615 | 616 | * @example - `sprLib.folder({ 'name':'/sites/dev/SiteAssets/' });` |
616 | | - * |
617 | 617 | * @since 1.8.0 |
618 | 618 | * @see: [File API](https://gitbrent.github.io/SpRestLib/docs/api-folder.html) |
619 | 619 | * @see: [Files and folders REST API reference](https://msdn.microsoft.com/en-us/library/office/dn450841.aspx#bk_Folder) |
|
1050 | 1050 |
|
1051 | 1051 | // API: LIST (CRUD, select, recycle) |
1052 | 1052 | /** |
| 1053 | + * SharePoint List/Library methods |
| 1054 | + * |
1053 | 1055 | * @param `inOpt` (string) - required - ListName or ListGUID |
1054 | 1056 | * @example - string - sprLib.list('Documents'); |
1055 | 1057 | * |
|
1902 | 1904 | return _newList; |
1903 | 1905 | }; |
1904 | 1906 |
|
1905 | | - // API: REST (Runs internal AJAX ops *and* provides direct/ad-hoc interface to users) |
| 1907 | + // API: REST (Runs internal AJAX ops **AND** provides direct/ad-hoc interface to users) |
1906 | 1908 | /** |
1907 | 1909 | * Execute an ad-hoc REST query to one of many endpoints |
| 1910 | + * @since 1.0.0 |
1908 | 1911 | * |
1909 | 1912 | * @example - sprLib.rest({ url:'/sites/dev/_api/web/webs', metadata:true }); |
1910 | 1913 | * @example - sprLib.rest({ url:'/sites/dev/_api/web/webs', queryCols:['ID','Title'] }); |
1911 | 1914 | * @example |
1912 | | - sprLib.rest({ |
1913 | | - url: '/sites/dev/_api/web/sitegroups', |
1914 | | - type: ['GET' | 'POST'], |
1915 | | - queryCols: { |
1916 | | - title: { dataName:'Title' }, |
1917 | | - loginName: { dataName:'LoginName' }, |
1918 | | - editAllowed: { dataName:'AllowMembersEditMembership' } |
1919 | | - }, |
1920 | | - queryFilter: "AllowMembersEditMembership eq 1", |
1921 | | - queryOrderby: "Title", |
1922 | | - queryLimit: 10 |
1923 | | - }) |
1924 | | - .then(function(arrayResults){ console.table(arrayResults) }); |
1925 | | - * |
1926 | | - * @since 1.0.0 |
| 1915 | + * sprLib.rest({ |
| 1916 | + * url: '/sites/dev/_api/web/sitegroups', |
| 1917 | + * type: ['GET' | 'POST'], |
| 1918 | + * queryCols: { |
| 1919 | + * title: { dataName:'Title' }, |
| 1920 | + * loginName: { dataName:'LoginName' }, |
| 1921 | + * editAllowed: { dataName:'AllowMembersEditMembership' } |
| 1922 | + * }, |
| 1923 | + * queryFilter: "AllowMembersEditMembership eq 1", |
| 1924 | + * queryOrderby: "Title", |
| 1925 | + * queryLimit: 10 |
| 1926 | + * }); |
1927 | 1927 | */ |
1928 | | - // sprLib.rest({ url:"/sites/dev/_api/web/sitegroups" }).then(function(data){ console.table(data); }); (data.d.results) |
1929 | | - // sprLib.rest({ url:"/_api/web/lists/getbytitle('Employees')" }).then(function(data){ console.table(data); }); (data.d) |
1930 | | - // |
1931 | | - // EX: https://siteurl.sharepoint.com/sites/dev/_api/web/lists/getbytitle('Employees')/ |
1932 | | - // EX: https://siteurl.sharepoint.com/sites/dev/_api/web/sitegroups |
1933 | 1928 | sprLib.rest = function rest(inOpt) { |
1934 | 1929 | return new Promise(function(resolve, reject) { |
1935 | 1930 | // STEP 1: Options setup |
|
2351 | 2346 |
|
2352 | 2347 | // API: SITE (or WEB) |
2353 | 2348 | /** |
| 2349 | + * SharePoint Site/Subsite methods |
| 2350 | + * @since 1.3.0 |
| 2351 | + * |
2354 | 2352 | * NOTE: `site` and `web` may be used interchangably (`/_api/site` is the top-level Web site and all its subsites) |
2355 | 2353 | * `web` is a securable web resource (aka: a SP website) |
2356 | | - * https://msdn.microsoft.com/library/microsoft.sharepoint.spsite "top-level Web site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object" |
| 2354 | + * @see: https://msdn.microsoft.com/library/microsoft.sharepoint.spsite "top-level Web site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object" |
2357 | 2355 | */ |
2358 | 2356 | sprLib.site = function site(inUrl) { |
2359 | 2357 | // Variables |
|
2826 | 2824 | } |
2827 | 2825 |
|
2828 | 2826 | // API: USER (Current or Query User by Props) |
| 2827 | + /** |
| 2828 | + * SharePoint User/Group methods |
| 2829 | + * @since 0.11.0 |
| 2830 | + * |
| 2831 | + * @param `inOpt` (object) - user query options |
| 2832 | + * @example - sprlib.user().info() |
| 2833 | + */ |
2829 | 2834 | sprLib.user = function user(inOpt) { |
2830 | 2835 | var _newUser = {}; |
2831 | 2836 | var _urlBase = "_api/Web"; |
|
0 commit comments