Socket
Socket
Sign inDemoInstall

@pnp/sp

Package Overview
Dependencies
Maintainers
6
Versions
1035
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.1.4 to 1.1.5-0

src/utils/metadata.d.ts

2

docs/files.md

@@ -7,3 +7,3 @@ # @pnp/sp/files

Reading files from the client using REST is covered in the below examples. The important thing to remember is choosing which format you want the file in so you can appropriately process it. You can retrieve a file as Blob, Buffer, JSON, or Text. If you have a special requirement you could also write your [own parser](Response-Parsers).
Reading files from the client using REST is covered in the below examples. The important thing to remember is choosing which format you want the file in so you can appropriately process it. You can retrieve a file as Blob, Buffer, JSON, or Text. If you have a special requirement you could also write your [own parser](../../odata/docs/parsers.md).

@@ -10,0 +10,0 @@ ```typescript

@@ -118,4 +118,4 @@ # @pnp/sp

## UML
![Graphical UML diagram](/pnpjs/img/pnpjs-sp-uml.svg =100%x)
![Graphical UML diagram](../../documentation/img/pnpjs-sp-uml.svg)
Graphical UML diagram of @pnp/sp. Right-click the diagram and open in new tab if it is too small.

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

### Get Paged Items
Working with paging can be a challenge as it is based on skip tokens and item ids, something that is hard to guess at runtime. To simplify things you can use the getPaged method on the Items class to assist. Note that there isn't a way to move backwards in the collection, this is by design. The pattern you should use to support backwards navigation in the results is to cache the results into a local array and use the standard array operators to get previous pages. Alternatively you can append the results to the UI, but this can have performance impact for large result sets.
```TypeScript
import sp from "@pnp/sp";
// basic case to get paged items form a list
let items = await sp.web.lists.getByTitle("BigList").items.getPaged();
// you can also provide a type for the returned values instead of any
let items = await sp.web.lists.getByTitle("BigList").items.getPaged<{Title: string}[]>();
// the query also works with select to choose certain fields and top to set the page size
let items = await sp.web.lists.getByTitle("BigList").items.select("Title", "Description").top(50).getPaged<{Title: string}[]>();
// the results object will have two properties and one method:
// the results property will be an array of the items returned
if (items.results.length > 0) {
console.log("We got results!");
for (let i = 0; i < items.results.length; i++) {
// type checking works here if we specify the return type
console.log(items.results[i].Title);
}
}
// the hasNext property is used with the getNext method to handle paging
// hasNext will be true so long as there are additional results
if (items.hasNext) {
// this will carry over the type specified in the original query for the results array
items = await items.getNext();
console.log(items.results.length);
}
```
### Get All Items

@@ -30,0 +68,0 @@

@@ -5,3 +5,3 @@ # @pnp/sp - permissions

Permissions in SharePoint are assigned to the set of securable objects which include Site, Web, List, and List Item. These are the four level to which unique permissions can be assigned. As such @pnp/sp provides a set of methods defined in the [QueryableSecurable](queryablesecurable.md) class to handle these permissions. These examples all use the Web to get the values, however the methods work identically on all securables.
Permissions in SharePoint are assigned to the set of securable objects which include Site, Web, List, and List Item. These are the four level to which unique permissions can be assigned. As such @pnp/sp provides a set of methods defined in the QueryableSecurable class to handle these permissions. These examples all use the Web to get the values, however the methods work identically on all securables.

@@ -8,0 +8,0 @@ ## Get Role Assignments

@@ -81,4 +81,6 @@ # @pnp/sp/search

```TypeScript
import { SearchQueryBuilder } from "@pnp/sp";
// basic usage
let q = SearchQueryBuilder.create().text("test").rowLimit(4).enablePhonetic;
let q = SearchQueryBuilder().text("test").rowLimit(4).enablePhonetic;

@@ -88,3 +90,3 @@ sp.search(q).then(h => { /* ... */ });

// provide a default query text in the create()
let q2 = SearchQueryBuilder.create("text").rowLimit(4).enablePhonetic;
let q2 = SearchQueryBuilder("text").rowLimit(4).enablePhonetic;

@@ -101,4 +103,4 @@ sp.search(q2).then(h => { /* ... */ });

let q3 = SearchQueryBuilder.create("test", appSearchSettings).enableQueryRules;
let q4 = SearchQueryBuilder.create("financial data", appSearchSettings).enableSorting.enableStemming;
let q3 = SearchQueryBuilder("test", appSearchSettings).enableQueryRules;
let q4 = SearchQueryBuilder("financial data", appSearchSettings).enableSorting.enableStemming;
sp.search(q3).then(h => { /* ... */ });

@@ -105,0 +107,0 @@ sp.search(q4).then(h => { /* ... */ });

{
"name": "@pnp/sp",
"version": "1.1.4",
"version": "1.1.5-0",
"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.1.4",
"@pnp/logging": "1.1.4",
"@pnp/odata": "1.1.4"
"@pnp/common": "1.1.5-0",
"@pnp/logging": "1.1.5-0",
"@pnp/odata": "1.1.5-0"
},

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

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
export interface AttachmentFileInfo {

@@ -12,8 +12,2 @@ name: string;

/**
* Creates a new instance of the AttachmentFiles class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this attachments collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a Attachment File by filename

@@ -49,2 +43,3 @@ *

export declare class AttachmentFile extends SharePointQueryableInstance {
delete: (eTag?: string) => Promise<void>;
/**

@@ -74,8 +69,2 @@ * Gets the contents of the file as text

setContent(content: string | ArrayBuffer | Blob): Promise<AttachmentFile>;
/**
* Delete this attachment file
*
* @param eTag Value used in the IF-Match header, by default "*"
*/
delete(eTag?: string): Promise<void>;
private getParsed<T>(parser);

@@ -82,0 +71,0 @@ }

@@ -1,2 +0,2 @@

import { SharePointQueryableCollection, SharePointQueryable, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
export interface CommentAuthorData {

@@ -40,15 +40,4 @@ email: string;

export declare class Comments extends SharePointQueryableCollection<CommentData[]> {
getById: (id: string | number) => Comment;
/**
* Creates a new instance of the Comments class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a comment by id
*
* @param id Id of the comment to load
*/
getById(id: string | number): Comment;
/**
* Adds a new comment to this collection

@@ -87,8 +76,2 @@ *

/**
* Creates a new instance of the Comments class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Adds a new reply to this collection

@@ -95,0 +78,0 @@ *

import { TypedHash } from "@pnp/common";
import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
/**

@@ -8,13 +8,4 @@ * Describes a collection of content types

export declare class ContentTypes extends SharePointQueryableCollection {
getById: (id: {}) => ContentType;
/**
* Creates a new instance of the ContentTypes class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this content types collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a ContentType by content type id
*/
getById(id: string): ContentType;
/**
* Adds an existing contenttype to a content type collection

@@ -61,3 +52,3 @@ *

*/
delete(): Promise<void>;
delete: () => Promise<void>;
}

@@ -72,14 +63,3 @@ export interface ContentTypeAddResult {

export declare class FieldLinks extends SharePointQueryableCollection {
/**
* Creates a new instance of the ContentType class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this content type instance
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a FieldLink by GUID id
*
* @param id The GUID id of the field link
*/
getById(id: string): FieldLink;
getById: (id: {}) => FieldLink;
}

@@ -86,0 +66,0 @@ /**

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
/**

@@ -8,8 +8,2 @@ * Describes a collection of List objects

/**
* Creates a new instance of the Lists class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a list from the collection by guid id

@@ -19,3 +13,3 @@ *

*/
getById(id: string): Feature;
getById: (id: {}) => Feature;
/**

@@ -22,0 +16,0 @@ * Adds a new list to the collection

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { TypedHash } from "@pnp/common";

@@ -10,7 +10,7 @@ import { XmlSchemaFieldCreationInformation, DateTimeFieldFormatType, FieldTypes, CalendarType, UrlFieldFormatType, FieldUserSelectionMode, FieldCreationProperties, ChoiceFieldFormatType } from "./types";

/**
* Creates a new instance of the Fields class
* Gets a list from the collection by guid id
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
* @param title The Id of the list
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
getById: (id: {}) => Field;
/**

@@ -29,8 +29,2 @@ * Gets a field from the collection by title

/**
* Gets a list from the collection by guid id
*
* @param title The Id of the list
*/
getById(id: string): Field;
/**
* Creates a field based on the specified schema

@@ -164,2 +158,7 @@ */

/**
* Delete this fields
*
*/
delete: () => Promise<void>;
/**
* Updates this field intance with the supplied properties

@@ -172,7 +171,2 @@ *

/**
* Delete this fields
*
*/
delete(): Promise<void>;
/**
* Sets the value of the ShowInDisplayForm property for this field.

@@ -179,0 +173,0 @@ */

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { LimitedWebPartManager } from "./webparts";

@@ -20,8 +20,2 @@ import { Item } from "./items";

/**
* Creates a new instance of the Files class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a File by filename

@@ -242,15 +236,4 @@ *

export declare class Versions extends SharePointQueryableCollection {
getById: (id: {}) => Version;
/**
* Creates a new instance of the File class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a version by id
*
* @param versionId The id of the version to retrieve
*/
getById(versionId: number): Version;
/**
* Deletes all the file version objects in the collection.

@@ -301,3 +284,3 @@ *

*/
delete(eTag?: string): Promise<void>;
delete: (eTag?: string) => Promise<void>;
}

@@ -304,0 +287,0 @@ export declare enum CheckinType {

@@ -12,8 +12,2 @@ import { TypedHash } from "@pnp/common";

/**
* Creates a new instance of the Folders class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a folder by folder name

@@ -76,3 +70,3 @@ *

readonly uniqueContentTypeOrder: SharePointQueryableCollection;
update(properties: TypedHash<string | number | boolean>): Promise<FolderUpdateResult>;
update: (props: TypedHash<string | number | boolean>) => Promise<FolderUpdateResult>;
/**

@@ -79,0 +73,0 @@ * Delete this folder

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
/**

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

export declare class Forms extends SharePointQueryableCollection {
/**
* Creates a new instance of the Fields class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a form by id
*
* @param id The guid id of the item to retrieve
*/
getById(id: string): Form;
getById: (id: {}) => Form;
}

@@ -21,0 +10,0 @@ /**

@@ -15,15 +15,4 @@ import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";

export declare class Items extends SharePointQueryableCollection {
getById: (id: number) => Item;
/**
* Creates a new instance of the Items class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets an Item by id
*
* @param id The integer id of the item to retrieve
*/
getById(id: number): Item;
/**
* Gets BCS Item by string id

@@ -45,3 +34,3 @@ *

*/
getPaged(): Promise<PagedItemCollection<any>>;
getPaged<T = any[]>(): Promise<PagedItemCollection<T>>;
/**

@@ -51,4 +40,5 @@ * 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)
* @param acceptHeader Allows for setting the value of the Accept header for SP 2013 support
*/
getAll(requestSize?: number): Promise<any[]>;
getAll(requestSize?: number, acceptHeader?: string): Promise<any[]>;
/**

@@ -74,2 +64,8 @@ * Adds a new item to the collection

/**
* Delete this item
*
* @param eTag Value used in the IF-Match header, by default "*"
*/
delete: (eTag?: string) => Promise<void>;
/**
* Gets the set of attachments for this item

@@ -148,8 +144,2 @@ *

/**
* Delete this item
*
* @param eTag Value used in the IF-Match header, by default "*"
*/
delete(eTag?: string): Promise<void>;
/**
* Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item.

@@ -195,14 +185,3 @@ */

export declare class ItemVersions extends SharePointQueryableCollection {
/**
* Creates a new instance of the File class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a version by id
*
* @param versionId The id of the version to retrieve
*/
getById(versionId: number): ItemVersion;
getById: (id: number) => ItemVersion;
}

@@ -219,3 +198,3 @@ /**

*/
delete(): Promise<void>;
delete: (eTag?: string) => Promise<void>;
}

@@ -237,3 +216,3 @@ /**

*/
getNext(): Promise<PagedItemCollection<any>>;
getNext(): Promise<PagedItemCollection<T>>;
}

@@ -19,7 +19,7 @@ import { Items } from "./items";

/**
* Creates a new instance of the Lists class
* Gets a list from the collection by guid id
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
* @param id The Id of the list (GUID)
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
getById: (id: {}) => List;
/**

@@ -32,8 +32,2 @@ * Gets a list from the collection by title

/**
* Gets a list from the collection by guid id
*
* @param id The Id of the list (GUID)
*/
getById(id: string): List;
/**
* Adds a new list to the collection

@@ -40,0 +34,0 @@ *

@@ -16,9 +16,4 @@ import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";

export declare class NavigationNodes extends SharePointQueryableCollection {
getById: (id: number) => NavigationNode;
/**
* Gets a navigation node by id
*
* @param id The id of the node
*/
getById(id: number): NavigationNode;
/**
* Adds a new node to the collection

@@ -59,8 +54,2 @@ *

/**
* Creates a new instance of the Navigation class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of these navigation components
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets the quicklaunch navigation nodes for the current context

@@ -67,0 +56,0 @@ *

import { SPHttpClient } from "./sphttpclient";
import { Dictionary } from "@pnp/common";
export declare class CachedDigest {

@@ -10,5 +9,5 @@ expiration: Date;

private _digests;
constructor(_httpClient: SPHttpClient, _digests?: Dictionary<CachedDigest>);
constructor(_httpClient: SPHttpClient, _digests?: Map<string, CachedDigest>);
getDigest(webUrl: string): Promise<string>;
clear(): void;
}

@@ -1,6 +0,6 @@

import { FetchOptions, RequestClient } from "@pnp/common";
import { FetchOptions, RequestClient, HttpClientImpl } from "@pnp/common";
export declare class SPHttpClient implements RequestClient {
private _impl;
private _digestCache;
private _impl;
constructor();
constructor(_impl?: HttpClientImpl);
fetch(url: string, options?: FetchOptions): Promise<Response>;

@@ -7,0 +7,0 @@ fetchRaw(url: string, options?: FetchOptions): Promise<Response>;

import { SharePointQueryableConstructor } from "./sharepointqueryable";
import { ODataParser } from "@pnp/odata";
export declare function spExtractODataId(candidate: any): string;
export declare function odataUrlFrom(candidate: any): string;
export declare function spODataEntity<T, DataType = any>(factory: SharePointQueryableConstructor<T>): ODataParser<T & DataType>;
export declare function spODataEntityArray<T, DataType = any>(factory: SharePointQueryableConstructor<T>): ODataParser<(T & DataType)[]>;

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
/**

@@ -7,8 +7,2 @@ * Describes regional settings ODada object

/**
* Creates a new instance of the RegionalSettings class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this regional settings collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets the collection of languages used in a server farm.

@@ -34,3 +28,2 @@ */

export declare class InstalledLanguages extends SharePointQueryableCollection {
constructor(baseUrl: string | SharePointQueryable, path?: string);
}

@@ -41,3 +34,2 @@ /**

export declare class TimeZone extends SharePointQueryableInstance {
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**

@@ -60,3 +52,2 @@ * Gets an Local Time by UTC Time

export declare class TimeZones extends SharePointQueryableCollection {
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**

@@ -63,0 +54,0 @@ * Gets an TimeZone by id

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

export declare class RelatedItemManagerImpl extends SharePointQueryable implements RelatedItemManger {
constructor(baseUrl: string | SharePointQueryable, path?: string);
static FromUrl(url: string): RelatedItemManagerImpl;

@@ -38,0 +37,0 @@ getRelatedItems(sourceListName: string, sourceItemId: number): Promise<RelatedItem[]>;

@@ -1,2 +0,2 @@

import { SearchQuery, SearchResults, SearchQueryBuilder } from "./search";
import { SearchQuery, SearchResults, ISearchQueryBuilder } from "./search";
import { SearchSuggestQuery, SearchSuggestResult } from "./searchsuggest";

@@ -50,3 +50,3 @@ import { Site } from "./site";

*/
search(query: string | SearchQuery | SearchQueryBuilder): Promise<SearchResults>;
search(query: string | SearchQuery | ISearchQueryBuilder): Promise<SearchResults>;
/**

@@ -53,0 +53,0 @@ * Begins a site collection scoped REST request

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SiteGroups } from "./sitegroups";

@@ -11,7 +11,7 @@ import { BasePermissions } from "./types";

/**
* Creates a new instance of the RoleAssignments class
* Gets the role assignment associated with the specified principal id from the collection.
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this role assignments collection
* @param id The id of the role assignment
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
getById: (id: number) => RoleAssignment;
/**

@@ -33,8 +33,2 @@ * Adds a new role assignment with the specified principal and role definitions to the collection

remove(principalId: number, roleDefId: number): Promise<void>;
/**
* Gets the role assignment associated with the specified principal id from the collection.
*
* @param id The id of the role assignment
*/
getById(id: number): RoleAssignment;
}

@@ -60,3 +54,3 @@ /**

*/
delete(): Promise<void>;
delete: () => Promise<void>;
}

@@ -69,9 +63,2 @@ /**

/**
* Creates a new instance of the RoleDefinitions class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this role definitions collection
*
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets the role definition with the specified id from the collection

@@ -82,3 +69,3 @@ *

*/
getById(id: number): RoleDefinition;
getById: (id: number) => RoleDefinition;
/**

@@ -115,2 +102,7 @@ * Gets the role definition with the specified name

/**
* Deletes this role definition
*
*/
delete: () => Promise<void>;
/**
* Updates this role definition with the supplied properties

@@ -121,7 +113,2 @@ *

update(properties: TypedHash<any>): Promise<RoleDefinitionUpdateResult>;
/**
* Deletes this role definition
*
*/
delete(): Promise<void>;
}

@@ -149,8 +136,2 @@ /**

export declare class RoleDefinitionBindings extends SharePointQueryableCollection {
/**
* Creates a new instance of the RoleDefinitionBindings class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this role definition bindings collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
}

@@ -1,21 +0,11 @@

import { SharePointQueryable, SharePointQueryableInstance } from "./sharepointqueryable";
import { Dictionary } from "@pnp/common";
/**
* Allows for the fluent construction of search queries
*/
export declare class SearchQueryBuilder {
private _query;
constructor(queryText?: string, _query?: {});
static create(queryText?: string, queryTemplate?: SearchQuery): SearchQueryBuilder;
text(queryText: string): this;
template(template: string): this;
sourceId(id: string): this;
import { SharePointQueryableInstance } from "./sharepointqueryable";
export interface ISearchQueryBuilder {
query: any;
readonly bypassResultTypes: this;
readonly enableStemming: this;
readonly enableInterleaving: this;
readonly enableStemming: this;
readonly trimDuplicates: this;
trimDuplicatesIncludeId(n: number): this;
readonly enableFql: this;
readonly enableNicknames: this;
readonly enableFql: this;
readonly enablePhonetic: this;
readonly bypassResultTypes: this;
readonly trimDuplicates: this;
readonly processBestBets: this;

@@ -25,8 +15,14 @@ readonly enableQueryRules: this;

readonly generateBlockRankLog: this;
readonly processPersonalFavorites: this;
readonly enableOrderingHitHighlightedProperty: this;
culture(culture: number): this;
rowLimit(n: number): this;
startRow(n: number): this;
sourceId(id: string): this;
text(queryText: string): this;
template(template: string): this;
trimDuplicatesIncludeId(n: number): this;
rankingModelId(id: string): this;
startRow(n: number): this;
rowLimit(n: number): this;
rowsPerPage(n: number): this;
selectProperties(...properties: string[]): this;
culture(culture: number): this;
timeZoneId(id: number): this;

@@ -44,7 +40,5 @@ refinementFilters(...filters: string[]): this;

properties(...properties: SearchProperty[]): this;
readonly processPersonalFavorites: this;
queryTemplatePropertiesUrl(url: string): this;
reorderingRules(...rules: ReorderingRule[]): this;
hitHighlightedMultivaluePropertyLimit(limit: number): this;
readonly enableOrderingHitHighlightedProperty: this;
collapseSpecification(spec: string): this;

@@ -56,5 +50,11 @@ uiLanguage(lang: number): this;

toSearchQuery(): SearchQuery;
private extendQuery(part);
}
/**
* Creates a new instance of the SearchQueryBuilder
*
* @param queryText Initial query text
* @param _query Any initial query configuration
*/
export declare function SearchQueryBuilder(queryText?: string, _query?: {}): ISearchQueryBuilder;
/**
* Describes the search API

@@ -65,10 +65,2 @@ *

/**
* Creates a new instance of the Search class
*
* @param baseUrl The url for the search context
* @param query The SearchQuery object to execute
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* .......
* @returns Promise

@@ -356,3 +348,3 @@ */

export interface ResultTableCollection {
QueryErrors?: Dictionary<any>;
QueryErrors?: Map<string, any>;
QueryId?: string;

@@ -359,0 +351,0 @@ QueryRuleId?: string;

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableInstance } from "./sharepointqueryable";
/**

@@ -6,2 +6,3 @@ * Defines a query execute against the search/suggest endpoint (see https://msdn.microsoft.com/en-us/library/office/dn194079.aspx)

export interface SearchSuggestQuery {
[key: string]: string | number | boolean;
/**

@@ -57,12 +58,15 @@ * A string that contains the text for the search query.

export declare class SearchSuggest extends SharePointQueryableInstance {
constructor(baseUrl: string | SharePointQueryable, path?: string);
execute(query: SearchSuggestQuery): Promise<SearchSuggestResult>;
private mapQueryToQueryString(query);
}
export declare class SearchSuggestResult {
export interface SearchSuggestResult {
PeopleNames: string[];
PersonalResults: PersonalResultSuggestion[];
Queries: any[];
constructor(json: any);
}
export declare class ESearchSuggestResult {
PeopleNames: string[];
PersonalResults: PersonalResultSuggestion[];
Queries: any[];
}
export interface PersonalResultSuggestion {

@@ -69,0 +73,0 @@ HighlightedTitle?: string;

@@ -32,2 +32,14 @@ import { FetchOptions } from "@pnp/common";

/**
* Choose which fields to return
*
* @param selects One or more fields to return
*/
select(...selects: string[]): this;
/**
* Expands fields such as lookups to get additional data
*
* @param expands The Fields for which to expand the values
*/
expand(...expands: string[]): this;
/**
* Gets a parent for this instance as specified

@@ -67,14 +79,2 @@ *

/**
* Choose which fields to return
*
* @param selects One or more fields to return
*/
select(...selects: string[]): this;
/**
* Expands fields such as lookups to get additional data
*
* @param expands The Fields for which to expand the values
*/
expand(...expands: string[]): this;
/**
* Orders based on the supplied fields

@@ -98,2 +98,8 @@ *

top(top: number): this;
/**
* Curries the getById function
*
* @param factory Class to create for the id
*/
protected _getById<P, T extends SharePointQueryable>(factory: SharePointQueryableConstructor<T>): (id: P) => T;
}

@@ -106,13 +112,27 @@ /**

/**
* Choose which fields to return
* Curries the update function into the common pieces
*
* @param selects One or more fields to return
* @param type
* @param mapper
*/
select(...selects: string[]): this;
protected _update<Return, Props = any, Data = any>(type: string, mapper: (data: Data, props: Props) => Return): (props: Props) => Promise<Return>;
/**
* Expands fields such as lookups to get additional data
* Deletes this instance
*
*/
protected _delete(): Promise<void>;
/**
* Deletes this instance with an etag value in the headers
*
* @param expands The Fields for which to expand the values
* @param eTag eTag to delete
*/
expand(...expands: string[]): this;
protected _deleteWithETag(eTag?: string): Promise<void>;
}
/**
* Decorator used to specify the default path for SharePointQueryable objects
*
* @param path
*/
export declare function defaultPath(path: string): <T extends new (...args: any[]) => {}>(target: T) => {
new (...args: any[]): {};
} & T;

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableInstance } from "./sharepointqueryable";
import { Web } from "./webs";

@@ -13,8 +13,2 @@ import { UserCustomActions } from "./usercustomactions";

/**
* Creates a new instance of the Site class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this site collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets the root web of the site collection

@@ -21,0 +15,0 @@ *

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SiteUsers } from "./siteusers";

@@ -38,7 +38,7 @@ import { TypedHash } from "@pnp/common";

/**
* Creates a new instance of the SiteGroups class
* Gets a group from the collection by id
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this group collection
* @param id The id of the group to retrieve
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
getById: (id: number) => SiteGroup;
/**

@@ -57,8 +57,2 @@ * Adds a new group to the site collection

/**
* Gets a group from the collection by id
*
* @param id The id of the group to retrieve
*/
getById(id: number): SiteGroup;
/**
* Removes the group with the specified member id from the collection

@@ -86,8 +80,3 @@ *

readonly users: SiteUsers;
/**
* Updates this group instance with the supplied properties
*
* @param properties A GroupWriteableProperties object of property names and values to update for the group
*/
update(properties: TypedHash<any>): Promise<GroupUpdateResult>;
update: (props: TypedHash<any>) => Promise<GroupUpdateResult>;
}

@@ -94,0 +83,0 @@ export interface SiteGroupAddResult {

@@ -18,7 +18,7 @@ import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";

/**
* Creates a new instance of the SiteUsers class
* Gets a user from the collection by id
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this user collection
* @param id The id of the user to retrieve
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
getById: (id: number) => SiteUser;
/**

@@ -31,8 +31,2 @@ * Gets a user from the collection by email

/**
* Gets a user from the collection by id
*
* @param id The id of the user to retrieve
*/
getById(id: number): SiteUser;
/**
* Gets a user from the collection by login name

@@ -78,3 +72,3 @@ *

*/
update(properties: TypedHash<any>): Promise<UserUpdateResult>;
update: (props: TypedHash<any>) => Promise<UserUpdateResult>;
/**

@@ -84,3 +78,3 @@ * Delete this user

*/
delete(): Promise<void>;
delete: () => Promise<void>;
}

@@ -91,3 +85,2 @@ /**

export declare class CurrentUser extends SharePointQueryableInstance {
constructor(baseUrl: string | SharePointQueryable, path?: string);
}

@@ -94,0 +87,0 @@ export interface SiteUserProps {

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableInstance } from "./sharepointqueryable";
export interface SocialMethods {

@@ -14,8 +14,2 @@ my: MySocialQueryMethods;

export declare class SocialQuery extends SharePointQueryableInstance implements SocialMethods {
/**
* Creates a new instance of the SocialQuery class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this social query
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
readonly my: MySocialQueryMethods;

@@ -86,8 +80,2 @@ /**

/**
* Creates a new instance of the SocialQuery class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this social query
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets users, documents, sites, and tags that the current user is following.

@@ -94,0 +82,0 @@ *

@@ -1,2 +0,2 @@

export { spExtractODataId, spODataEntity, spODataEntityArray } from "./odata";
export { odataUrlFrom, spODataEntity, spODataEntityArray } from "./odata";
export { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection, SharePointQueryableConstructor } from "./sharepointqueryable";

@@ -23,3 +23,3 @@ export { SharePointQueryableSecurable } from "./sharepointqueryablesecurable";

export { RoleDefinitionUpdateResult, RoleDefinitionAddResult, RoleDefinitionBindings } from "./roles";
export { Search, SearchProperty, SearchPropertyValue, SearchQuery, SearchQueryBuilder, SearchResult, SearchResults, Sort, SortDirection, ReorderingRule, ReorderingRuleMatchType, QueryPropertyValueType, SearchBuiltInSourceId, SearchResponse, ResultTableCollection, ResultTable } from "./search";
export { Search, SearchProperty, SearchPropertyValue, SearchQuery, SearchQueryBuilder, ISearchQueryBuilder, SearchResult, SearchResults, Sort, SortDirection, ReorderingRule, ReorderingRuleMatchType, QueryPropertyValueType, SearchBuiltInSourceId, SearchResponse, ResultTableCollection, ResultTable } from "./search";
export { SearchSuggest, SearchSuggestQuery, SearchSuggestResult, PersonalResultSuggestion } from "./searchsuggest";

@@ -26,0 +26,0 @@ export { Site, OpenWebByIdResult } from "./site";

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
/**

@@ -8,13 +8,7 @@ * Describes a collection of webhook subscriptions

/**
* Creates a new instance of the Subscriptions class
*
* @param baseUrl - The url or SharePointQueryable which forms the parent of this webhook subscriptions collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Returns all the webhook subscriptions or the specified webhook subscription
*
* @param subscriptionId The id of a specific webhook subscription to retrieve, omit to retrieve all the webhook subscriptions
* @param id The id of a specific webhook subscription to retrieve, omit to retrieve all the webhook subscriptions
*/
getById(subscriptionId: string): Subscription;
getById: (id: {}) => Subscription;
/**

@@ -21,0 +15,0 @@ * Creates a new webhook subscription

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableInstance, SharePointQueryableCollection } from "./sharepointqueryable";
import { TypedHash } from "@pnp/common";

@@ -9,8 +9,2 @@ /**

/**
* Creates a new instance of the UserCustomActions class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this user custom actions collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Returns the user custom action with the specified id

@@ -20,3 +14,3 @@ *

*/
getById(id: string): UserCustomAction;
getById: (id: {}) => UserCustomAction;
/**

@@ -45,3 +39,3 @@ * Creates a user custom action

*/
update(properties: TypedHash<string | boolean | number>): Promise<UserCustomActionUpdateResult>;
update: (props: TypedHash<string | number | boolean>) => Promise<UserCustomActionUpdateResult>;
/**

@@ -48,0 +42,0 @@ * Removes this user custom action

@@ -1,2 +0,2 @@

import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable";
import { TypedHash } from "@pnp/common";

@@ -9,8 +9,2 @@ /**

/**
* Creates a new instance of the Views class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Gets a view by guid id

@@ -20,3 +14,3 @@ *

*/
getById(id: string): View;
getById: (id: {}) => View;
/**

@@ -48,3 +42,3 @@ * Gets a view by title (case-sensitive)

*/
update(properties: TypedHash<any>): Promise<ViewUpdateResult>;
update: (props: TypedHash<any>) => Promise<ViewUpdateResult>;
/**

@@ -54,3 +48,3 @@ * Delete this view

*/
delete(): Promise<void>;
delete: () => Promise<void>;
/**

@@ -63,3 +57,2 @@ * Returns the list view as HTML.

export declare class ViewFields extends SharePointQueryableCollection {
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**

@@ -66,0 +59,0 @@ * Gets a value that specifies the XML schema that represents the collection.

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

*/
getById(id: string): WebPartDefinition;
getById: (id: {}) => WebPartDefinition;
/**

@@ -66,9 +66,2 @@ * Gets a web part definition from the collection by storage id

export declare class WebPart extends SharePointQueryableInstance {
/**
* Creates a new instance of the WebPart class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection
* @param path Optional, if supplied will be appended to the supplied baseUrl
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
}
import { TypedHash } from "@pnp/common";
import { SharePointQueryable, SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableCollection } from "./sharepointqueryable";
import { SharePointQueryableShareableWeb } from "./sharepointqueryableshareable";

@@ -27,8 +27,2 @@ import { Folders, Folder } from "./folders";

/**
* Creates a new instance of the Webs class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this web collection
*/
constructor(baseUrl: string | SharePointQueryable, webPath?: string);
/**
* Adds a new web to the collection

@@ -50,8 +44,2 @@ *

export declare class WebInfos extends SharePointQueryableCollection {
/**
* Creates a new instance of the WebInfos class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this web infos collection
*/
constructor(baseUrl: string | SharePointQueryable, webPath?: string);
}

@@ -64,8 +52,2 @@ /**

/**
* Creates a new instance of the Web class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this web
*/
constructor(baseUrl: string | SharePointQueryable, path?: string);
/**
* Creates a new web instance from the given url by indexing the location of the /_api/

@@ -72,0 +54,0 @@ * segment. If this is not found the method creates a new web with the entire string as

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