1 | import { __decorate } from "tslib";
|
2 | import { body } from "@pnp/queryable";
|
3 | import { _SPCollection, _SPInstance, spInvokableFactory, SPCollection, deleteable, } from "../spqueryable.js";
|
4 | import { defaultPath } from "../decorators.js";
|
5 | import { spPost } from "../operations.js";
|
6 | let _ContentTypes = class _ContentTypes extends _SPCollection {
|
7 | |
8 |
|
9 |
|
10 |
|
11 |
|
12 | async addAvailableContentType(contentTypeId) {
|
13 | const data = await spPost(ContentTypes(this, "addAvailableContentType"), body({ "contentTypeId": contentTypeId }));
|
14 | return {
|
15 | contentType: this.getById(data.id),
|
16 | data: data,
|
17 | };
|
18 | }
|
19 | |
20 |
|
21 |
|
22 |
|
23 | getById(id) {
|
24 | return ContentType(this).concat(`('${id}')`);
|
25 | }
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | async add(id, name, description = "", group = "Custom Content Types", additionalSettings = {}) {
|
37 | const postBody = body({
|
38 | Description: description,
|
39 | Group: group,
|
40 | Id: { StringValue: id },
|
41 | Name: name,
|
42 | ...additionalSettings,
|
43 | });
|
44 | const data = await spPost(this, postBody);
|
45 | return { contentType: this.getById(data.id), data };
|
46 | }
|
47 | };
|
48 | _ContentTypes = __decorate([
|
49 | defaultPath("contenttypes")
|
50 | ], _ContentTypes);
|
51 | export { _ContentTypes };
|
52 | export const ContentTypes = spInvokableFactory(_ContentTypes);
|
53 | export class _ContentType extends _SPInstance {
|
54 | constructor() {
|
55 | super(...arguments);
|
56 | this.delete = deleteable();
|
57 | }
|
58 | |
59 |
|
60 |
|
61 | get fieldLinks() {
|
62 | return FieldLinks(this);
|
63 | }
|
64 | |
65 |
|
66 |
|
67 | get fields() {
|
68 | return SPCollection(this, "fields");
|
69 | }
|
70 | |
71 |
|
72 |
|
73 | get parent() {
|
74 | return ContentType(this, "parent");
|
75 | }
|
76 | |
77 |
|
78 |
|
79 | get workflowAssociations() {
|
80 | return SPCollection(this, "workflowAssociations");
|
81 | }
|
82 | }
|
83 | export const ContentType = spInvokableFactory(_ContentType);
|
84 | let _FieldLinks = class _FieldLinks extends _SPCollection {
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 | getById(id) {
|
91 | return FieldLink(this).concat(`(guid'${id}')`);
|
92 | }
|
93 | };
|
94 | _FieldLinks = __decorate([
|
95 | defaultPath("fieldlinks")
|
96 | ], _FieldLinks);
|
97 | export { _FieldLinks };
|
98 | export const FieldLinks = spInvokableFactory(_FieldLinks);
|
99 | export class _FieldLink extends _SPInstance {
|
100 | }
|
101 | export const FieldLink = spInvokableFactory(_FieldLink);
|
102 |
|
\ | No newline at end of file |