Comparing version 1.0.4-3 to 1.0.4-4
@@ -64,3 +64,3 @@ # @pnp/sp/clientsidepages | ||
// add a text control to the second new column | ||
column.addControl(new ClientSideText("Be sure to check out the @pnp docs at https://pnp.github.io/pnp/")); | ||
column.addControl(new ClientSideText("Be sure to check out the @pnp docs at https://pnp.github.io/pnpjs/")); | ||
@@ -67,0 +67,0 @@ // we need to save our content changes |
@@ -112,3 +112,4 @@ # @pnp/sp | ||
* [SP.Utilities.Utility](sp-utilities-utility.md) | ||
* [Tenant Properties](tenant-properties.md) | ||
* [Views](views.md) | ||
* [Webs](webs.md) |
@@ -10,6 +10,6 @@ # @pnp/sp/items | ||
```TypeScript | ||
import pnp from "@pnp/sp"; | ||
import sp from "@pnp/sp"; | ||
// get all the items from a list | ||
pnp.sp.web.lists.getByTitle("My List").items.get().then((items: any[]) => { | ||
sp.web.lists.getByTitle("My List").items.get().then((items: any[]) => { | ||
console.log(items); | ||
@@ -19,3 +19,3 @@ }); | ||
// get a specific item by id | ||
pnp.sp.web.lists.getByTitle("My List").items.getById(1).get().then((item: any) => { | ||
sp.web.lists.getByTitle("My List").items.getById(1).get().then((item: any) => { | ||
console.log(item); | ||
@@ -25,3 +25,3 @@ }); | ||
// use odata operators for more efficient queries | ||
pnp.sp.web.lists.getByTitle("My List").items.select("Title", "Description").top(5).orderBy("Modified", true).get().then((items: any[]) => { | ||
sp.web.lists.getByTitle("My List").items.select("Title", "Description").top(5).orderBy("Modified", true).get().then((items: any[]) => { | ||
console.log(items); | ||
@@ -40,3 +40,3 @@ }); | ||
// basic usage | ||
pnp.sp.web.lists.getByTitle("BigList").items.getAll().then((allItems: any[]) => { | ||
sp.web.lists.getByTitle("BigList").items.getAll().then((allItems: any[]) => { | ||
@@ -48,3 +48,3 @@ // how many did we get | ||
// set page size | ||
pnp.sp.web.lists.getByTitle("BigList").items.getAll(4000).then((allItems: any[]) => { | ||
sp.web.lists.getByTitle("BigList").items.getAll(4000).then((allItems: any[]) => { | ||
@@ -56,3 +56,3 @@ // how many did we get | ||
// 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[]) => { | ||
sp.web.lists.getByTitle("BigList").items.select("Title").top(4000).getAll().then((allItems: any[]) => { | ||
@@ -64,3 +64,3 @@ // how many did we get | ||
// 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[]) => { | ||
sp.web.lists.getByTitle("BigList").items.select("Title").filter("Title eq 'Test'").getAll().then((allItems: any[]) => { | ||
@@ -77,7 +77,7 @@ // how many did we get | ||
```TypeScript | ||
pnp.sp.web.lists.getByTitle("LookupList").items.select("Title", "Lookup/Title", "Lookup/ID").expand("Lookup").get().then((items: any[]) => { | ||
sp.web.lists.getByTitle("LookupList").items.select("Title", "Lookup/Title", "Lookup/ID").expand("Lookup").get().then((items: any[]) => { | ||
console.log(items); | ||
}); | ||
pnp.sp.web.lists.getByTitle("LookupList").items.getById(1).select("Title", "Lookup/Title", "Lookup/ID").expand("Lookup").get().then((item: any) => { | ||
sp.web.lists.getByTitle("LookupList").items.getById(1).select("Title", "Lookup/Title", "Lookup/ID").expand("Lookup").get().then((item: any) => { | ||
console.log(item); | ||
@@ -123,6 +123,6 @@ }); | ||
```TypeScript | ||
import { default as pnp, ItemAddResult } from "@pnp/sp"; | ||
import { sp, ItemAddResult } from "@pnp/sp"; | ||
// add an item to the list | ||
pnp.sp.web.lists.getByTitle("My List").items.add({ | ||
sp.web.lists.getByTitle("My List").items.add({ | ||
Title: "Title", | ||
@@ -140,3 +140,3 @@ Description: "Description" | ||
```TypeScript | ||
pnp.sp.web.lists.getById("4D5A36EA-6E84-4160-8458-65C436DB765C").items.add({ | ||
sp.web.lists.getById("4D5A36EA-6E84-4160-8458-65C436DB765C").items.add({ | ||
Title: "Test 1", | ||
@@ -154,3 +154,3 @@ ContentTypeId: "0x01030058FD86C279252341AB303852303E4DAF" | ||
```TypeScript | ||
pnp.sp.web.lists.getByTitle("PeopleFields").items.add({ | ||
sp.web.lists.getByTitle("PeopleFields").items.add({ | ||
Title: Util.getGUID(), | ||
@@ -166,2 +166,15 @@ User1Id: 9, // allows a single user | ||
If you want to update or add user field values when using **validateUpdateListItem** you need to use the form shown below. You can specify multiple values in the array. | ||
```TypeScript | ||
const result = await sp.web.lists.getByTitle("UserFieldList").items.getById(1).validateUpdateListItem([{ | ||
FieldName: "UserField", | ||
FieldValue: JSON.stringify([{ "Key": "i:0#.f|membership|person@tenant.com" }]), | ||
}, | ||
{ | ||
FieldName: "Title", | ||
FieldValue: "Test - Updated", | ||
}]); | ||
``` | ||
### Lookup Fields | ||
@@ -177,3 +190,3 @@ | ||
```TypeScript | ||
pnp.sp.web.lists.getByTitle("LookupFields").items.add({ | ||
sp.web.lists.getByTitle("LookupFields").items.add({ | ||
Title: Util.getGUID(), | ||
@@ -190,9 +203,9 @@ LookupFieldId: 2, // allows a single lookup value | ||
```TypeScript | ||
import pnp from "@pnp/sp"; | ||
import sp from "@pnp/sp"; | ||
let list = pnp.sp.web.lists.getByTitle("rapidadd"); | ||
let list = sp.web.lists.getByTitle("rapidadd"); | ||
list.getListItemEntityTypeFullName().then(entityTypeFullName => { | ||
let batch = pnp.sp.web.createBatch(); | ||
let batch = sp.web.createBatch(); | ||
@@ -216,5 +229,5 @@ list.items.inBatch(batch).add({ Title: "Batch 6" }, entityTypeFullName).then(b => { | ||
```TypeScript | ||
import pnp from "@pnp/sp"; | ||
import sp from "@pnp/sp"; | ||
let list = pnp.sp.web.lists.getByTitle("MyList"); | ||
let list = sp.web.lists.getByTitle("MyList"); | ||
@@ -232,6 +245,6 @@ list.items.getById(1).update({ | ||
```TypeScript | ||
import pnp from "@pnp/sp"; | ||
import sp from "@pnp/sp"; | ||
// you are getting back a collection here | ||
pnp.sp.web.lists.getByTitle("MyList").items.top(1).filter("Title eq 'A Title'").get().then((items: any[]) => { | ||
sp.web.lists.getByTitle("MyList").items.top(1).filter("Title eq 'A Title'").get().then((items: any[]) => { | ||
// see if we got something | ||
@@ -254,9 +267,9 @@ if (items.length > 0) { | ||
```TypeScript | ||
import pnp from "@pnp/sp"; | ||
import sp from "@pnp/sp"; | ||
let list = pnp.sp.web.lists.getByTitle("rapidupdate"); | ||
let list = sp.web.lists.getByTitle("rapidupdate"); | ||
list.getListItemEntityTypeFullName().then(entityTypeFullName => { | ||
let batch = pnp.sp.web.createBatch(); | ||
let batch = sp.web.createBatch(); | ||
@@ -281,5 +294,5 @@ // note requirement of "*" eTag param - or use a specific eTag value as needed | ||
```TypeScript | ||
import pnp from "@pnp/sp"; | ||
import sp from "@pnp/sp"; | ||
let list = pnp.sp.web.lists.getByTitle("MyList"); | ||
let list = sp.web.lists.getByTitle("MyList"); | ||
@@ -297,3 +310,3 @@ list.items.getById(1).delete().then(_ => {}); | ||
```TypeScript | ||
pnp.sp.web.lists | ||
sp.web.lists | ||
.getByTitle('[Lists_Title]') | ||
@@ -300,0 +313,0 @@ .fields |
{ | ||
"name": "@pnp/sp", | ||
"version": "1.0.4-3", | ||
"version": "1.0.4-4", | ||
"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.4-3", | ||
"@pnp/logging": "1.0.4-3", | ||
"@pnp/odata": "1.0.4-3" | ||
"@pnp/common": "1.0.4-4", | ||
"@pnp/logging": "1.0.4-4", | ||
"@pnp/odata": "1.0.4-4" | ||
}, | ||
@@ -21,8 +21,8 @@ "author": { | ||
"bugs": { | ||
"url": "https://github.com/pnp/pnp/issues" | ||
"url": "https://github.com/pnp/pnpjs/issues" | ||
}, | ||
"homepage": "https://github.com/pnp/pnp", | ||
"homepage": "https:github.com/pnp/pnpjs", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/pnp/pnp" | ||
"url": "git:github.com/pnp/pnpjs" | ||
}, | ||
@@ -29,0 +29,0 @@ "module": "./dist/sp.es5.js", |
@@ -13,3 +13,3 @@ ![SharePoint Patterns and Practices](https://devofficecdn.azureedge.net/media/Default/PnP/sppnp.png) | ||
Please see the public site for [package documentation](https://pnp.github.io/pnp/). | ||
Please see the public site for [package documentation](https://pnp.github.io/pnpjs/). | ||
@@ -16,0 +16,0 @@ ### Code of Conduct |
@@ -6,2 +6,3 @@ import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "./sharepointqueryable"; | ||
export interface ChunkedFileUploadProgressData { | ||
uploadId: string; | ||
stage: "starting" | "continue" | "finishing"; | ||
@@ -211,3 +212,3 @@ blockNumber: number; | ||
*/ | ||
private startUpload(uploadId, fragment); | ||
protected startUpload(uploadId: string, fragment: ArrayBuffer | Blob): Promise<number>; | ||
/** | ||
@@ -224,3 +225,3 @@ * Continues the chunk upload session with an additional fragment. | ||
*/ | ||
private continueUpload(uploadId, fileOffset, fragment); | ||
protected continueUpload(uploadId: string, fileOffset: number, fragment: ArrayBuffer | Blob): Promise<number>; | ||
/** | ||
@@ -236,3 +237,3 @@ * Uploads the last file fragment and commits the file. The current file content is changed when this method completes. | ||
*/ | ||
private finishUpload(uploadId, fileOffset, fragment); | ||
protected finishUpload(uploadId: string, fileOffset: number, fragment: ArrayBuffer | Blob): Promise<FileAddResult>; | ||
} | ||
@@ -239,0 +240,0 @@ /** |
@@ -468,3 +468,3 @@ import { SharePointQueryable, SharePointQueryableInstance } from "./sharepointqueryable"; | ||
StringType = 1, | ||
Int32TYpe = 2, | ||
Int32Type = 2, | ||
BooleanType = 3, | ||
@@ -471,0 +471,0 @@ StringArrayType = 4, |
@@ -1483,1 +1483,6 @@ import { TypedHash } from "@pnp/common"; | ||
} | ||
export interface StorageEntity { | ||
Value: string | null; | ||
Comment: string | null; | ||
Description: string | null; | ||
} |
@@ -12,3 +12,3 @@ import { TypedHash } from "@pnp/common"; | ||
import { File } from "./files"; | ||
import { ChangeQuery } from "./types"; | ||
import { ChangeQuery, StorageEntity } from "./types"; | ||
import { SiteUsers, SiteUser, CurrentUser, SiteUserProps } from "./siteusers"; | ||
@@ -305,6 +305,21 @@ import { UserCustomActions } from "./usercustomactions"; | ||
* | ||
* @param key | ||
* @param key Id of storage entity to be set | ||
*/ | ||
getStorageEntity(key: string): Promise<string>; | ||
getStorageEntity(key: string): Promise<StorageEntity>; | ||
/** | ||
* This will set the storage entity identified by the given key (MUST be called in the context of the app catalog) | ||
* | ||
* @param key Id of storage entity to be set | ||
* @param value Value of storage entity to be set | ||
* @param description Description of storage entity to be set | ||
* @param comments Comments of storage entity to be set | ||
*/ | ||
setStorageEntity(key: string, value: string, description?: string, comments?: string): Promise<void>; | ||
/** | ||
* This will remove the storage entity identified by the given key | ||
* | ||
* @param key Id of storage entity to be removed | ||
*/ | ||
removeStorageEntity(key: string): Promise<void>; | ||
/** | ||
* Gets the app catalog for this web | ||
@@ -311,0 +326,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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6373694
77
45149