Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnp/sp

Package Overview
Dependencies
Maintainers
6
Versions
1072
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnp/sp - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

docs/client-side-pages.md

1

docs/index.md

@@ -100,2 +100,3 @@ # @pnp/sp

* [Attachments](attachments.md)
* [Client-side Pages](client-side-pages.md)
* [Features](features.md)

@@ -102,0 +103,0 @@ * [Fields](fields.md)

@@ -28,2 +28,39 @@ # @pnp/sp/items

### Get All Items
_Added in 1.0.2_
Using the items collection's getAll method you can get all of the items in a list regardless of the size of the list. Sample usage is shown below. Only the odata operations top, select, and filter are supported. usingCaching and inBatch are ignored - you will need to handle caching the results on your own. This method will write a warning to the Logger and should not frequently be used. Instead the standard paging operations should
be used.
```TypeScript
// basic usage
pnp.sp.web.lists.getByTitle("BigList").items.getAll().then((allItems: any[]) => {
// how many did we get
console.log(allItems.length);
});
// set page size
pnp.sp.web.lists.getByTitle("BigList").items.getAll(4000).then((allItems: any[]) => {
// how many did we get
console.log(allItems.length);
});
// use select and top. top will set page size and override the any value passed to getAll
pnp.sp.web.lists.getByTitle("BigList").items.select("Title").top(4000).getAll().then((allItems: any[]) => {
// how many did we get
console.log(allItems.length);
});
// we can also use filter as a supported odata operation, but this will likely fail on large lists
pnp.sp.web.lists.getByTitle("BigList").items.select("Title").filter("Title eq 'Test'").getAll().then((allItems: any[]) => {
// how many did we get
console.log(allItems.length);
});
```
### Retrieving Lookup Fields

@@ -30,0 +67,0 @@

8

package.json
{
"name": "@pnp/sp",
"version": "1.0.1",
"version": "1.0.2",
"description": "pnp - provides a fluent api for working with SharePoint REST",

@@ -11,5 +11,5 @@ "main": "./dist/sp.es5.umd.js",

"peerDependencies": {
"@pnp/common": "1.0.1",
"@pnp/logging": "1.0.1",
"@pnp/odata": "1.0.1"
"@pnp/common": "1.0.2",
"@pnp/logging": "1.0.2",
"@pnp/odata": "1.0.2"
},

@@ -16,0 +16,0 @@ "author": {

import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { TypedHash } from "@pnp/common";
import { XmlSchemaFieldCreationInformation, DateTimeFieldFormatType, FieldTypes, CalendarType, UrlFieldFormatType } from "./types";
import { XmlSchemaFieldCreationInformation, DateTimeFieldFormatType, FieldTypes, CalendarType, UrlFieldFormatType, FieldUserSelectionMode, FieldCreationProperties, ChoiceFieldFormatType } from "./types";
/**

@@ -38,3 +38,3 @@ * Describes a collection of Field objects

/**
* Adds a new list to the collection
* Adds a new field to the collection
*

@@ -45,3 +45,5 @@ * @param title The new field's title

*/
add(title: string, fieldType: string, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
add(title: string, fieldType: string, properties: FieldCreationProperties & {
FieldTypeKind: number;
}): Promise<FieldAddResult>;
/**

@@ -54,3 +56,3 @@ * Adds a new SP.FieldText to the collection

*/
addText(title: string, maxLength?: number, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
addText(title: string, maxLength?: number, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**

@@ -65,3 +67,3 @@ * Adds a new SP.FieldCalculated to the collection

*/
addCalculated(title: string, formula: string, dateFormat: DateTimeFieldFormatType, outputType?: FieldTypes, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
addCalculated(title: string, formula: string, dateFormat: DateTimeFieldFormatType, outputType?: FieldTypes, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**

@@ -75,3 +77,3 @@ * Adds a new SP.FieldDateTime to the collection

*/
addDateTime(title: string, displayFormat?: DateTimeFieldFormatType, calendarType?: CalendarType, friendlyDisplayFormat?: number, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
addDateTime(title: string, displayFormat?: DateTimeFieldFormatType, calendarType?: CalendarType, friendlyDisplayFormat?: number, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**

@@ -85,3 +87,3 @@ * Adds a new SP.FieldNumber to the collection

*/
addNumber(title: string, minValue?: number, maxValue?: number, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
addNumber(title: string, minValue?: number, maxValue?: number, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**

@@ -96,3 +98,3 @@ * Adds a new SP.FieldCurrency to the collection

*/
addCurrency(title: string, minValue?: number, maxValue?: number, currencyLocalId?: number, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
addCurrency(title: string, minValue?: number, maxValue?: number, currencyLocalId?: number, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**

@@ -110,3 +112,3 @@ * Adds a new SP.FieldMultiLineText to the collection

*/
addMultilineText(title: string, numberOfLines?: number, richText?: boolean, restrictedMode?: boolean, appendOnly?: boolean, allowHyperlink?: boolean, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
addMultilineText(title: string, numberOfLines?: number, richText?: boolean, restrictedMode?: boolean, appendOnly?: boolean, allowHyperlink?: boolean, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**

@@ -117,3 +119,46 @@ * Adds a new SP.FieldUrl to the collection

*/
addUrl(title: string, displayFormat?: UrlFieldFormatType, properties?: TypedHash<string | number | boolean>): Promise<FieldAddResult>;
addUrl(title: string, displayFormat?: UrlFieldFormatType, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/** Adds a user field to the colleciton
*
* @param title The new field's title
* @param selectionMode The selection mode of the field
* @param selectionGroup Value that specifies the identifier of the SharePoint group whose members can be selected as values of the field
* @param properties
*/
addUser(title: string, selectionMode: FieldUserSelectionMode, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**
* Adds a SP.FieldLookup to the collection
*
* @param title The new field's title
* @param lookupListId The guid id of the list where the source of the lookup is found
* @param lookupFieldName The internal name of the field in the source list
* @param properties Set of additional properties to set on the new field
*/
addLookup(title: string, lookupListId: string, lookupFieldName: string, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**
* Adds a new SP.FieldChoice to the collection
*
* @param title The field title.
* @param choices The choices for the field.
* @param format The display format of the available options for the field.
* @param fillIn Specifies whether the field allows fill-in values.
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
*/
addChoice(title: string, choices: string[], format?: ChoiceFieldFormatType, fillIn?: boolean, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**
* Adds a new SP.FieldMultiChoice to the collection
*
* @param title The field title.
* @param choices The choices for the field.
* @param fillIn Specifies whether the field allows fill-in values.
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
*/
addMultiChoice(title: string, choices: string[], fillIn?: boolean, properties?: FieldCreationProperties): Promise<FieldAddResult>;
/**
* Adds a new SP.FieldBoolean to the collection
*
* @param title The field title.
* @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
*/
addBoolean(title: string, properties?: FieldCreationProperties): Promise<FieldAddResult>;
}

@@ -120,0 +165,0 @@ /**

@@ -321,2 +321,3 @@ import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";

FormPage = 2,
ClientSidePage = 3,
}

@@ -44,2 +44,8 @@ import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";

/**
* Gets all the items in a list, regardless of count. Does not support batching or caching
*
* @param requestSize Number of items to return in each request (Default: 2000)
*/
getAll(requestSize?: number): Promise<any[]>;
/**
* Adds a new item to the collection

@@ -46,0 +52,0 @@ *

@@ -11,3 +11,3 @@ import { FetchOptions } from "@pnp/common";

*/
export declare class SharePointQueryable extends ODataQueryable<SPBatch> {
export declare class SharePointQueryable<GetType = any> extends ODataQueryable<SPBatch, GetType> {
/**

@@ -59,3 +59,3 @@ * Creates a new instance of the SharePointQueryable class

*/
export declare class SharePointQueryableCollection extends SharePointQueryable {
export declare class SharePointQueryableCollection<GetType = any[]> extends SharePointQueryable<GetType> {
/**

@@ -62,0 +62,0 @@ * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported)

@@ -7,2 +7,3 @@ export { spExtractODataId, spODataEntity, spODataEntityArray } from "./odata";

export { AttachmentFileAddResult, AttachmentFileInfo } from "./attachmentfiles";
export * from "./clientsidepages";
export { SPConfiguration, SPConfigurationPart } from "./config/splibconfig";

@@ -9,0 +10,0 @@ export { Field, Fields, FieldAddResult, FieldUpdateResult } from "./fields";

@@ -1275,1 +1275,22 @@ import { TypedHash } from "@pnp/common";

}
export declare enum FieldUserSelectionMode {
PeopleAndGroups = 1,
PeopleOnly = 0,
}
export interface FieldCreationProperties extends TypedHash<string | number | boolean> {
DefaultFormula?: string;
Description?: string;
EnforceUniqueValues?: boolean;
FieldTypeKind?: number;
Group?: string;
Hidden?: boolean;
Indexed?: boolean;
Required?: boolean;
Title?: string;
ValidationFormula?: string;
ValidationMessage?: string;
}
export declare enum ChoiceFieldFormatType {
Dropdown = 0,
RadioButtons = 1,
}

@@ -20,2 +20,3 @@ import { TypedHash } from "@pnp/common";

import { RegionalSettings } from "./regionalsettings";
import { ClientSidePage, ClientSidePageComponent } from "./clientsidepages";
/**

@@ -296,2 +297,14 @@ * Describes a collection of webs

getAppCatalog(url?: string | Web): AppCatalog;
/**
* Gets the collection of available client side web parts for this web instance
*/
getClientSideWebParts(): Promise<ClientSidePageComponent[]>;
/**
* Creates a new client side page
*
* @param pageName Name of the new page
* @param title Display title of the new page
* @param libraryTitle Title of the library in which to create the new page. Default: "Site Pages"
*/
addClientSidePage(pageName: string, title?: string, libraryTitle?: string): Promise<ClientSidePage>;
}

@@ -298,0 +311,0 @@ /**

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc