Comparing version 2.0.0-11 to 2.0.0-12
@@ -5,3 +5,3 @@ import { __extends } from "tslib"; | ||
import { Logger } from "@pnp/logging"; | ||
import { SPHttpClient } from "./net/sphttpclient"; | ||
import { SPHttpClient } from "./sphttpclient"; | ||
import { SPRuntimeConfig } from "./splibconfig"; | ||
@@ -151,3 +151,3 @@ import { toAbsoluteUrl } from "./utils/toabsoluteurl"; | ||
if (!headers.has("X-ClientService-ClientTag")) { | ||
headers.append("X-ClientService-ClientTag", "PnPCoreJS:@pnp-2.0.0-11"); | ||
headers.append("X-ClientService-ClientTag", "PnPCoreJS:@pnp-2.0.0-12"); | ||
} | ||
@@ -154,0 +154,0 @@ // write headers into batch body |
@@ -0,1 +1,2 @@ | ||
import { IQueryable } from "@pnp/odata"; | ||
import { TypedHash } from "@pnp/common"; | ||
@@ -124,2 +125,9 @@ import { IFile } from "../files/types"; | ||
getItem<T>(...selects: string[]): Promise<IItem & T>; | ||
/** | ||
* Extends this queryable from the provided parent | ||
* | ||
* @param parent Parent queryable from which we will derive a base url | ||
* @param path Additional path | ||
*/ | ||
protected assign(parent: IQueryable<any>, path?: string): void; | ||
protected getCanvasContent1(): string; | ||
@@ -126,0 +134,0 @@ protected getLayoutWebpartsContent(): string; |
@@ -462,2 +462,13 @@ import { __awaiter, __decorate, __extends, __generator } from "tslib"; | ||
}; | ||
/** | ||
* Extends this queryable from the provided parent | ||
* | ||
* @param parent Parent queryable from which we will derive a base url | ||
* @param path Additional path | ||
*/ | ||
_ClientsidePage.prototype.assign = function (parent, path) { | ||
this.data.parentUrl = parent.data.url; | ||
this.data.url = combine(this.data.parentUrl, path || ""); | ||
this.configureFrom(parent); | ||
}; | ||
_ClientsidePage.prototype.getCanvasContent1 = function () { | ||
@@ -464,0 +475,0 @@ return JSON.stringify(this.getControls()); |
@@ -6,3 +6,3 @@ export { ISharePointQueryable, ISharePointQueryableCollection, ISharePointQueryableInstance, SharePointQueryableInstance, SharePointQueryableCollection, ISharePointQueryableConstructor, SharePointQueryable, spInvokableFactory, ISPInvokableFactory, } from "./sharepointqueryable"; | ||
export { SPConfiguration, SPConfigurationPart, } from "./splibconfig"; | ||
export { SPHttpClient, } from "./net/sphttpclient"; | ||
export { SPHttpClient, } from "./sphttpclient"; | ||
export { SPRest, sp, } from "./rest"; | ||
@@ -9,0 +9,0 @@ export * from "./types"; |
@@ -5,3 +5,3 @@ export { SharePointQueryableInstance, SharePointQueryableCollection, SharePointQueryable, spInvokableFactory, } from "./sharepointqueryable"; | ||
export * from "./operations"; | ||
export { SPHttpClient, } from "./net/sphttpclient"; | ||
export { SPHttpClient, } from "./sphttpclient"; | ||
export { SPRest, sp, } from "./rest"; | ||
@@ -8,0 +8,0 @@ export * from "./types"; |
@@ -10,2 +10,3 @@ import { __awaiter, __decorate, __extends, __generator } from "tslib"; | ||
import { spPost } from "../operations"; | ||
import { tag } from "../telemetry"; | ||
/** | ||
@@ -26,3 +27,3 @@ * Describes a collection of Item objects | ||
_Items.prototype.getById = function (id) { | ||
return Item(this).concat("(" + id + ")"); | ||
return tag.configure(Item(this).concat("(" + id + ")"), "is.getById"); | ||
}; | ||
@@ -36,3 +37,3 @@ /** | ||
// creates an item with the parent list path and append out method call | ||
return Item(this.parentUrl, "getItemByStringId('" + stringId + "')"); | ||
return tag.configure(Item(this.parentUrl, "getItemByStringId('" + stringId + "')"), "is.getItemByStringId"); | ||
}; | ||
@@ -150,2 +151,11 @@ /** | ||
}; | ||
__decorate([ | ||
tag("is.getPaged") | ||
], _Items.prototype, "getPaged", null); | ||
__decorate([ | ||
tag("is.getAll") | ||
], _Items.prototype, "getAll", null); | ||
__decorate([ | ||
tag("is.add") | ||
], _Items.prototype, "add", null); | ||
_Items = __decorate([ | ||
@@ -175,3 +185,3 @@ defaultPath("items") | ||
get: function () { | ||
return SharePointQueryable(this, "EffectiveBasePermissions"); | ||
return tag.configure(SharePointQueryable(this, "EffectiveBasePermissions"), "i.effectiveBasePermissions"); | ||
}, | ||
@@ -187,3 +197,3 @@ enumerable: true, | ||
get: function () { | ||
return SharePointQueryable(this, "EffectiveBasePermissionsForUI"); | ||
return tag.configure(SharePointQueryable(this, "EffectiveBasePermissionsForUI"), "i.effectiveBasePermissionsForUI"); | ||
}, | ||
@@ -199,3 +209,3 @@ enumerable: true, | ||
get: function () { | ||
return SharePointQueryableInstance(this, "FieldValuesAsHTML"); | ||
return tag.configure(SharePointQueryableInstance(this, "FieldValuesAsHTML"), "i.fvHTML"); | ||
}, | ||
@@ -211,3 +221,3 @@ enumerable: true, | ||
get: function () { | ||
return SharePointQueryableInstance(this, "FieldValuesAsText"); | ||
return tag.configure(SharePointQueryableInstance(this, "FieldValuesAsText"), "i.fvText"); | ||
}, | ||
@@ -223,3 +233,3 @@ enumerable: true, | ||
get: function () { | ||
return SharePointQueryableInstance(this, "FieldValuesForEdit"); | ||
return tag.configure(SharePointQueryableInstance(this, "FieldValuesForEdit"), "i.fvEdit"); | ||
}, | ||
@@ -234,3 +244,3 @@ enumerable: true, | ||
get: function () { | ||
return ItemVersions(this); | ||
return tag.configure(ItemVersions(this), "i.versions"); | ||
}, | ||
@@ -258,3 +268,3 @@ enumerable: true, | ||
return __awaiter(this, void 0, void 0, function () { | ||
var removeDependency, listItemEntityType, postBody, data; | ||
var removeDependency, listItemEntityType, postBody, poster, data; | ||
return __generator(this, function (_a) { | ||
@@ -272,3 +282,4 @@ switch (_a.label) { | ||
removeDependency(); | ||
return [4 /*yield*/, spPost(this.clone(Item).usingParser(new ItemUpdatedParser()), postBody)]; | ||
poster = tag.configure(this.clone(Item).usingParser(new ItemUpdatedParser()), "i.update"); | ||
return [4 /*yield*/, spPost(poster, postBody)]; | ||
case 2: | ||
@@ -337,2 +348,11 @@ data = _a.sent(); | ||
}; | ||
__decorate([ | ||
tag("i.recycle") | ||
], _Item.prototype, "recycle", null); | ||
__decorate([ | ||
tag("i.getWopiFrameUrl") | ||
], _Item.prototype, "getWopiFrameUrl", null); | ||
__decorate([ | ||
tag("i.validateUpdateListItem") | ||
], _Item.prototype, "validateUpdateListItem", null); | ||
return _Item; | ||
@@ -357,3 +377,3 @@ }(_SharePointQueryableInstance)); | ||
_ItemVersions.prototype.getById = function (versionId) { | ||
return ItemVersion(this).concat("(" + versionId + ")"); | ||
return tag.configure(ItemVersion(this).concat("(" + versionId + ")"), "iv.getById"); | ||
}; | ||
@@ -406,3 +426,3 @@ _ItemVersions = __decorate([ | ||
if (this.hasNext) { | ||
var items = Items(this.nextUrl, null).configureFrom(this.parent); | ||
var items = tag.configure(Items(this.nextUrl, null).configureFrom(this.parent), "ip.getNext"); | ||
return items.getPaged(); | ||
@@ -409,0 +429,0 @@ } |
@@ -81,20 +81,31 @@ import { __awaiter, __decorate, __extends, __generator } from "tslib"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _this = this; | ||
var addOrUpdateSettings, list, data, e_1, data; | ||
return __generator(this, function (_a) { | ||
if (this.hasBatch) { | ||
throw Error("The ensure list method is not supported for use in a batch."); | ||
switch (_a.label) { | ||
case 0: | ||
if (this.hasBatch) { | ||
throw Error("The ensure list method is not supported for use in a batch."); | ||
} | ||
addOrUpdateSettings = assign(additionalSettings, { Title: title, Description: desc, ContentTypesEnabled: enableContentTypes }, true); | ||
list = this.getByTitle(addOrUpdateSettings.Title); | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 4, , 6]); | ||
// this will throw if the list doesn't exist | ||
return [4 /*yield*/, list.select("Title")()]; | ||
case 2: | ||
// this will throw if the list doesn't exist | ||
_a.sent(); | ||
return [4 /*yield*/, list.update(addOrUpdateSettings).then(function (r) { return r.data; })]; | ||
case 3: | ||
data = _a.sent(); | ||
return [2 /*return*/, { created: false, data: data, list: this.getByTitle(addOrUpdateSettings.Title) }]; | ||
case 4: | ||
e_1 = _a.sent(); | ||
return [4 /*yield*/, this.add(title, desc, template, enableContentTypes, addOrUpdateSettings).then(function (r) { return r.data; })]; | ||
case 5: | ||
data = _a.sent(); | ||
return [2 /*return*/, { created: true, data: data, list: this.getByTitle(addOrUpdateSettings.Title) }]; | ||
case 6: return [2 /*return*/]; | ||
} | ||
return [2 /*return*/, new Promise(function (resolve, reject) { | ||
var addOrUpdateSettings = assign(additionalSettings, { Title: title, Description: desc, ContentTypesEnabled: enableContentTypes }, true); | ||
var list = _this.getByTitle(addOrUpdateSettings.Title); | ||
list.get().then(function (_) { | ||
list.update(addOrUpdateSettings).then(function (d) { | ||
resolve({ created: false, data: d, list: _this.getByTitle(addOrUpdateSettings.Title) }); | ||
}).catch(function (e) { return reject(e); }); | ||
}).catch(function (_) { | ||
_this.add(title, desc, template, enableContentTypes, addOrUpdateSettings).then(function (r) { | ||
resolve({ created: true, data: r.data, list: _this.getByTitle(addOrUpdateSettings.Title) }); | ||
}).catch(function (e) { return reject(e); }); | ||
}); | ||
})]; | ||
}); | ||
@@ -101,0 +112,0 @@ }); |
import { __awaiter, __generator } from "tslib"; | ||
import { defaultPipelineBinder, cloneQueryableData, headers } from "@pnp/odata"; | ||
import { SPHttpClient } from "./net/sphttpclient"; | ||
import { SPHttpClient } from "./sphttpclient"; | ||
import { mergeOptions, objectDefinedNotNull } from "@pnp/common"; | ||
import { toAbsoluteUrl } from "./utils/toabsoluteurl"; | ||
var spClientBinder = defaultPipelineBinder(function () { return new SPHttpClient(); }); | ||
var send = function (operation) { | ||
var send = function (method) { | ||
var operation = spClientBinder(method); | ||
return function (o, options) { | ||
@@ -42,10 +43,10 @@ return __awaiter(this, void 0, void 0, function () { | ||
} | ||
return send(spClientBinder("GET"))(o, options); | ||
return send("GET")(o, options); | ||
}; | ||
export var spPost = function (o, options) { return send(spClientBinder("POST"))(o, options); }; | ||
export var spDelete = function (o, options) { return send(spClientBinder("DELETE"))(o, options); }; | ||
export var spPatch = function (o, options) { return send(spClientBinder("PATCH"))(o, options); }; | ||
export var spPost = send("POST"); | ||
export var spDelete = send("DELETE"); | ||
export var spPatch = send("PATCH"); | ||
export var spPostDelete = function (o, options) { | ||
var opts = Object.assign(headers({ "X-HTTP-Method": "DELETE" }), options); | ||
return send(spClientBinder("POST"))(o, opts); | ||
return spPost(o, opts); | ||
}; | ||
@@ -55,4 +56,4 @@ export var spPostDeleteETag = function (o, options, eTag) { | ||
var opts = Object.assign(headers({ "X-HTTP-Method": "DELETE", "IF-Match": eTag }), options); | ||
return send(spClientBinder("POST"))(o, opts); | ||
return spPost(o, opts); | ||
}; | ||
//# sourceMappingURL=operations.js.map |
{ | ||
"name": "@pnp/sp", | ||
"version": "2.0.0-11", | ||
"version": "2.0.0-12", | ||
"description": "pnp - provides a fluent api for working with SharePoint REST", | ||
@@ -9,5 +9,5 @@ "main": "./index.js", | ||
"tslib": "1.10.0", | ||
"@pnp/common": "2.0.0-11", | ||
"@pnp/logging": "2.0.0-11", | ||
"@pnp/odata": "2.0.0-11" | ||
"@pnp/common": "2.0.0-12", | ||
"@pnp/logging": "2.0.0-12", | ||
"@pnp/odata": "2.0.0-12" | ||
}, | ||
@@ -14,0 +14,0 @@ "author": { |
@@ -112,3 +112,3 @@ import { IFetchOptions } from "@pnp/common"; | ||
*/ | ||
protected _update<Return, Props = any, Data = any>(type: string, mapper: (data: Data, props: Props) => Return): (props: Props) => Promise<Return>; | ||
protected _update<Return, Props = any>(type: string, mapper: (data: any, props: Props) => Return): (props: Props) => Promise<Return>; | ||
} | ||
@@ -115,0 +115,0 @@ export interface ISharePointQueryableInstance<GetType = any> extends _SharePointQueryableInstance<GetType>, IInvokable<GetType> { |
@@ -6,3 +6,3 @@ import { __awaiter, __decorate, __extends, __generator } from "tslib"; | ||
import { hOP, jsS, assign } from "@pnp/common"; | ||
import { SPHttpClient } from "../net/sphttpclient"; | ||
import { SPHttpClient } from "../sphttpclient"; | ||
import { body, headers } from "@pnp/odata"; | ||
@@ -9,0 +9,0 @@ import { odataUrlFrom } from "../odata"; |
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
742924
18262
267
+ Added@pnp/common@2.0.0-12(transitive)
+ Added@pnp/logging@2.0.0-12(transitive)
+ Added@pnp/odata@2.0.0-12(transitive)
- Removed@pnp/common@2.0.0-11(transitive)
- Removed@pnp/logging@2.0.0-11(transitive)
- Removed@pnp/odata@2.0.0-11(transitive)
Updated@pnp/common@2.0.0-12
Updated@pnp/logging@2.0.0-12
Updated@pnp/odata@2.0.0-12