webflow-api 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/api/collection.d.ts +85 -24
- package/dist/api/collection.js +88 -29
- package/dist/api/index.d.ts +7 -7
- package/dist/api/index.js +9 -19
- package/dist/api/item.d.ts +141 -107
- package/dist/api/item.js +145 -125
- package/dist/api/meta.d.ts +16 -14
- package/dist/api/meta.js +20 -19
- package/dist/api/oauth.d.ts +38 -36
- package/dist/api/oauth.js +59 -59
- package/dist/api/site.d.ts +118 -43
- package/dist/api/site.js +131 -53
- package/dist/{wrapper/membership.d.ts → api/user.d.ts} +59 -33
- package/dist/api/user.js +103 -0
- package/dist/api/webhook.d.ts +77 -55
- package/dist/api/webhook.js +74 -61
- package/dist/core/error.d.ts +2 -0
- package/dist/core/error.js +8 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/response.d.ts +32 -0
- package/dist/core/response.js +26 -0
- package/dist/{webflow.d.ts → core/webflow.d.ts} +57 -52
- package/dist/{webflow.js → core/webflow.js} +102 -61
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +2 -4
- package/src/api/collection.ts +102 -35
- package/src/api/index.ts +7 -7
- package/src/api/item.ts +207 -176
- package/src/api/meta.ts +19 -18
- package/src/api/oauth.ts +62 -74
- package/src/api/site.ts +158 -55
- package/src/api/user.ts +152 -0
- package/src/api/webhook.ts +97 -80
- package/src/core/error.ts +8 -0
- package/src/core/index.ts +2 -2
- package/src/core/response.ts +50 -0
- package/src/{webflow.ts → core/webflow.ts} +132 -137
- package/src/index.ts +1 -1
- package/yarn.lock +0 -5
- package/dist/api/membership.d.ts +0 -91
- package/dist/api/membership.js +0 -80
- package/dist/core/client.d.ts +0 -40
- package/dist/core/client.js +0 -49
- package/dist/core/options.d.ts +0 -8
- package/dist/core/options.js +0 -5
- package/dist/wrapper/collection.d.ts +0 -85
- package/dist/wrapper/collection.js +0 -94
- package/dist/wrapper/index.d.ts +0 -6
- package/dist/wrapper/index.js +0 -22
- package/dist/wrapper/item.d.ts +0 -140
- package/dist/wrapper/item.js +0 -153
- package/dist/wrapper/membership.js +0 -106
- package/dist/wrapper/response.d.ts +0 -16
- package/dist/wrapper/response.js +0 -17
- package/dist/wrapper/site.d.ts +0 -119
- package/dist/wrapper/site.js +0 -136
- package/dist/wrapper/webhook.d.ts +0 -78
- package/dist/wrapper/webhook.js +0 -82
- package/src/api/membership.ts +0 -125
- package/src/core/client.ts +0 -76
- package/src/core/options.ts +0 -9
- package/src/wrapper/collection.ts +0 -115
- package/src/wrapper/index.ts +0 -6
- package/src/wrapper/item.ts +0 -218
- package/src/wrapper/membership.ts +0 -138
- package/src/wrapper/response.ts +0 -25
- package/src/wrapper/site.ts +0 -164
- package/src/wrapper/webhook.ts +0 -116
package/README.md
CHANGED
|
@@ -207,7 +207,10 @@ const updatedItem = await webflow.updateItem({
|
|
|
207
207
|
|
|
208
208
|
### Memberships
|
|
209
209
|
```javascript
|
|
210
|
-
// Get
|
|
210
|
+
// Get a site's users from the site
|
|
211
|
+
const users = await site.users();
|
|
212
|
+
|
|
213
|
+
// Get a site's users with a site id
|
|
211
214
|
const users = await webflow.users({
|
|
212
215
|
siteId: "[SITE ID]"
|
|
213
216
|
});
|
|
@@ -217,6 +220,14 @@ const user = await site.user({
|
|
|
217
220
|
siteId: "[SITE ID]",
|
|
218
221
|
userId: "[USER ID]"
|
|
219
222
|
});
|
|
223
|
+
|
|
224
|
+
// Get a site's access groups
|
|
225
|
+
const accessGroups = await site.accessGroups();
|
|
226
|
+
|
|
227
|
+
// Get a site's access groups with a site id
|
|
228
|
+
const accessGroups = await webflow.accessGroups({
|
|
229
|
+
siteId: "[SITE ID]"
|
|
230
|
+
});
|
|
220
231
|
```
|
|
221
232
|
|
|
222
233
|
### Webhooks
|
package/dist/api/collection.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { WebflowRecord } from "../core";
|
|
3
|
+
import { Item } from ".";
|
|
2
4
|
/**************************************************************
|
|
3
5
|
* Types
|
|
4
6
|
**************************************************************/
|
|
@@ -25,27 +27,86 @@ export interface ICollection {
|
|
|
25
27
|
fields: CollectionField[];
|
|
26
28
|
}
|
|
27
29
|
/**************************************************************
|
|
28
|
-
*
|
|
30
|
+
* Class
|
|
29
31
|
**************************************************************/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
export declare class Collection extends WebflowRecord<ICollection> implements ICollection {
|
|
33
|
+
fields: CollectionField[];
|
|
34
|
+
singularName: string;
|
|
35
|
+
lastUpdated: string;
|
|
36
|
+
createdOn: string;
|
|
37
|
+
_id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
/**************************************************************
|
|
41
|
+
* Static Methods
|
|
42
|
+
**************************************************************/
|
|
43
|
+
/**
|
|
44
|
+
* Get a list of Collections
|
|
45
|
+
* @param params The params for the request
|
|
46
|
+
* @param params.siteId The site ID
|
|
47
|
+
* @param client The Axios client instance
|
|
48
|
+
* @returns A list of Collections
|
|
49
|
+
*/
|
|
50
|
+
static list({ siteId }: {
|
|
51
|
+
siteId: string;
|
|
52
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<ICollection[], any>>;
|
|
53
|
+
/**
|
|
54
|
+
* Get a single Collection
|
|
55
|
+
* @param params The params for the request
|
|
56
|
+
* @param params.collectionId The collection ID
|
|
57
|
+
* @param client The Axios client instance
|
|
58
|
+
* @returns A single Collection
|
|
59
|
+
*/
|
|
60
|
+
static getOne({ collectionId }: {
|
|
61
|
+
collectionId: string;
|
|
62
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<ICollection, any>>;
|
|
63
|
+
/**************************************************************
|
|
64
|
+
* Instance Methods
|
|
65
|
+
**************************************************************/
|
|
66
|
+
/**
|
|
67
|
+
* Get a single Item
|
|
68
|
+
* @param params The params for the request
|
|
69
|
+
* @param params.itemId The Item ID
|
|
70
|
+
* @returns A single Item
|
|
71
|
+
*/
|
|
72
|
+
item({ itemId }: {
|
|
73
|
+
itemId: string;
|
|
74
|
+
}): Promise<Item>;
|
|
75
|
+
/**
|
|
76
|
+
* Get a list of Items
|
|
77
|
+
* @param params The params for the request
|
|
78
|
+
* @param params.limit The number of items to return (optional)
|
|
79
|
+
* @param params.offset The number of items to skip (optional)
|
|
80
|
+
* @returns A list of Items
|
|
81
|
+
*/
|
|
82
|
+
items({ limit, offset }?: {
|
|
83
|
+
limit?: number;
|
|
84
|
+
offset?: number;
|
|
85
|
+
}): Promise<Item[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Remove a single Item
|
|
88
|
+
* @param params The params for the request
|
|
89
|
+
* @param params.itemId The Item ID
|
|
90
|
+
* @returns The result from the removal
|
|
91
|
+
*/
|
|
92
|
+
removeItem({ itemId }: {
|
|
93
|
+
itemId: string;
|
|
94
|
+
}): Promise<import("./item").IItemDelete>;
|
|
95
|
+
/**
|
|
96
|
+
* Create a new Item
|
|
97
|
+
* @param fields The Item fields to create
|
|
98
|
+
* @returns The created Item
|
|
99
|
+
*/
|
|
100
|
+
createItem(fields: any): Promise<Item>;
|
|
101
|
+
/**
|
|
102
|
+
* Update a single Item
|
|
103
|
+
* @param params The params for the request
|
|
104
|
+
* @param params.itemId The Item ID
|
|
105
|
+
* @param params.fields The fields to update
|
|
106
|
+
* @returns The updated Item
|
|
107
|
+
*/
|
|
108
|
+
updateItem({ itemId, fields }: {
|
|
109
|
+
itemId: string;
|
|
110
|
+
fields: any;
|
|
111
|
+
}): Promise<Item>;
|
|
112
|
+
}
|
package/dist/api/collection.js
CHANGED
|
@@ -1,35 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Collection = void 0;
|
|
4
4
|
const core_1 = require("../core");
|
|
5
|
+
const _1 = require(".");
|
|
5
6
|
/**************************************************************
|
|
6
|
-
*
|
|
7
|
+
* Class
|
|
7
8
|
**************************************************************/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
class Collection extends core_1.WebflowRecord {
|
|
10
|
+
/**************************************************************
|
|
11
|
+
* Static Methods
|
|
12
|
+
**************************************************************/
|
|
13
|
+
/**
|
|
14
|
+
* Get a list of Collections
|
|
15
|
+
* @param params The params for the request
|
|
16
|
+
* @param params.siteId The site ID
|
|
17
|
+
* @param client The Axios client instance
|
|
18
|
+
* @returns A list of Collections
|
|
19
|
+
*/
|
|
20
|
+
static list({ siteId }, client) {
|
|
21
|
+
(0, core_1.requireArgs)({ siteId });
|
|
22
|
+
const path = `/sites/${siteId}/collections`;
|
|
23
|
+
return client.get(path);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a single Collection
|
|
27
|
+
* @param params The params for the request
|
|
28
|
+
* @param params.collectionId The collection ID
|
|
29
|
+
* @param client The Axios client instance
|
|
30
|
+
* @returns A single Collection
|
|
31
|
+
*/
|
|
32
|
+
static getOne({ collectionId }, client) {
|
|
33
|
+
(0, core_1.requireArgs)({ collectionId });
|
|
34
|
+
const path = `/collections/${collectionId}`;
|
|
35
|
+
return client.get(path);
|
|
36
|
+
}
|
|
37
|
+
/**************************************************************
|
|
38
|
+
* Instance Methods
|
|
39
|
+
**************************************************************/
|
|
40
|
+
/**
|
|
41
|
+
* Get a single Item
|
|
42
|
+
* @param params The params for the request
|
|
43
|
+
* @param params.itemId The Item ID
|
|
44
|
+
* @returns A single Item
|
|
45
|
+
*/
|
|
46
|
+
async item({ itemId }) {
|
|
47
|
+
const res = await _1.Item.getOne({ itemId, collectionId: this._id }, this.client);
|
|
48
|
+
const [item] = res.data.items.map((data) => new _1.Item(this.client, { ...res, data }));
|
|
49
|
+
return item;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get a list of Items
|
|
53
|
+
* @param params The params for the request
|
|
54
|
+
* @param params.limit The number of items to return (optional)
|
|
55
|
+
* @param params.offset The number of items to skip (optional)
|
|
56
|
+
* @returns A list of Items
|
|
57
|
+
*/
|
|
58
|
+
async items({ limit, offset } = {}) {
|
|
59
|
+
const res = await _1.Item.list({ collectionId: this._id, limit, offset }, this.client);
|
|
60
|
+
return res.data.items.map((data) => new _1.Item(this.client, { ...res, data }));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Remove a single Item
|
|
64
|
+
* @param params The params for the request
|
|
65
|
+
* @param params.itemId The Item ID
|
|
66
|
+
* @returns The result from the removal
|
|
67
|
+
*/
|
|
68
|
+
async removeItem({ itemId }) {
|
|
69
|
+
const res = await _1.Item.remove({ itemId, collectionId: this._id }, this.client);
|
|
70
|
+
return res.data;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Create a new Item
|
|
74
|
+
* @param fields The Item fields to create
|
|
75
|
+
* @returns The created Item
|
|
76
|
+
*/
|
|
77
|
+
async createItem(fields) {
|
|
78
|
+
const res = await _1.Item.create({ collectionId: this._id, fields }, this.client);
|
|
79
|
+
return new _1.Item(this.client, res);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Update a single Item
|
|
83
|
+
* @param params The params for the request
|
|
84
|
+
* @param params.itemId The Item ID
|
|
85
|
+
* @param params.fields The fields to update
|
|
86
|
+
* @returns The updated Item
|
|
87
|
+
*/
|
|
88
|
+
async updateItem({ itemId, fields }) {
|
|
89
|
+
const params = { itemId, collectionId: this._id, fields };
|
|
90
|
+
const res = await _1.Item.update(params, this.client);
|
|
91
|
+
return new _1.Item(this.client, res);
|
|
92
|
+
}
|
|
20
93
|
}
|
|
21
|
-
exports.
|
|
22
|
-
/**
|
|
23
|
-
* Get a single Collection
|
|
24
|
-
* @param client The Webflow client
|
|
25
|
-
* @param params The params for the request
|
|
26
|
-
* @param params.collectionId The collection ID
|
|
27
|
-
* @param params.params The query string parameters (optional)
|
|
28
|
-
* @returns A single Collection
|
|
29
|
-
*/
|
|
30
|
-
function getOne(client, { collectionId }, params) {
|
|
31
|
-
(0, core_1.requireArgs)({ collectionId });
|
|
32
|
-
const path = `/collections/${collectionId}`;
|
|
33
|
-
return client.get(path, { params });
|
|
34
|
-
}
|
|
35
|
-
exports.getOne = getOne;
|
|
94
|
+
exports.Collection = Collection;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export *
|
|
2
|
-
export *
|
|
3
|
-
export *
|
|
4
|
-
export *
|
|
5
|
-
export *
|
|
6
|
-
export *
|
|
7
|
-
export *
|
|
1
|
+
export * from "./collection";
|
|
2
|
+
export * from "./user";
|
|
3
|
+
export * from "./webhook";
|
|
4
|
+
export * from "./item";
|
|
5
|
+
export * from "./site";
|
|
6
|
+
export * from "./oauth";
|
|
7
|
+
export * from "./meta";
|
package/dist/api/index.js
CHANGED
|
@@ -10,24 +10,14 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
15
|
};
|
|
25
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
exports.Meta = __importStar(require("./meta"));
|
|
17
|
+
__exportStar(require("./collection"), exports);
|
|
18
|
+
__exportStar(require("./user"), exports);
|
|
19
|
+
__exportStar(require("./webhook"), exports);
|
|
20
|
+
__exportStar(require("./item"), exports);
|
|
21
|
+
__exportStar(require("./site"), exports);
|
|
22
|
+
__exportStar(require("./oauth"), exports);
|
|
23
|
+
__exportStar(require("./meta"), exports);
|
package/dist/api/item.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { PaginatedData, WebflowRecord } from "../core";
|
|
2
3
|
/**************************************************************
|
|
3
4
|
* Interfaces
|
|
4
5
|
**************************************************************/
|
|
@@ -34,110 +35,143 @@ export declare type PageinatedItems = PaginatedData & {
|
|
|
34
35
|
items: IItem[];
|
|
35
36
|
};
|
|
36
37
|
/**************************************************************
|
|
37
|
-
*
|
|
38
|
+
* Class
|
|
38
39
|
**************************************************************/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
collectionId:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
itemId:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
itemIds:
|
|
142
|
-
|
|
143
|
-
|
|
40
|
+
export declare class Item extends WebflowRecord<IItem> implements IItem {
|
|
41
|
+
"published-on"?: string | null;
|
|
42
|
+
"published-by"?: string | null;
|
|
43
|
+
"updated-on": string;
|
|
44
|
+
"created-on": string;
|
|
45
|
+
"updated-by": string;
|
|
46
|
+
"created-by": string;
|
|
47
|
+
_archived: boolean;
|
|
48
|
+
_draft: boolean;
|
|
49
|
+
_cid: string;
|
|
50
|
+
name: string;
|
|
51
|
+
slug: string;
|
|
52
|
+
_id: string;
|
|
53
|
+
/**************************************************************
|
|
54
|
+
* Static Methods
|
|
55
|
+
**************************************************************/
|
|
56
|
+
/**
|
|
57
|
+
* Get a single Item
|
|
58
|
+
* @param params The params for the request
|
|
59
|
+
* @param params.collectionId The Collection ID
|
|
60
|
+
* @param params.itemId The Item ID
|
|
61
|
+
* @param client The Axios client instance
|
|
62
|
+
* @returns A single Item
|
|
63
|
+
*/
|
|
64
|
+
static getOne({ collectionId, itemId }: {
|
|
65
|
+
collectionId: string;
|
|
66
|
+
itemId: string;
|
|
67
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<PageinatedItems, any>>;
|
|
68
|
+
/**
|
|
69
|
+
* Get a list of Items
|
|
70
|
+
* @param params The params for the request
|
|
71
|
+
* @param params.collectionId The Collection ID
|
|
72
|
+
* @param params.limit The number of items to return (optional)
|
|
73
|
+
* @param params.offset The number of items to skip (optional)
|
|
74
|
+
* @param client The Axios client instance
|
|
75
|
+
* @returns A list of Items
|
|
76
|
+
*/
|
|
77
|
+
static list({ collectionId, limit, offset }: {
|
|
78
|
+
collectionId: string;
|
|
79
|
+
limit?: number;
|
|
80
|
+
offset?: number;
|
|
81
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<PageinatedItems, any>>;
|
|
82
|
+
/**
|
|
83
|
+
* Create a new Item
|
|
84
|
+
* @param params The params for the request
|
|
85
|
+
* @param params.collectionId The Collection ID
|
|
86
|
+
* @param params.fields The Item fields to create
|
|
87
|
+
* @param client The Axios client instance
|
|
88
|
+
* @returns The created Item
|
|
89
|
+
*/
|
|
90
|
+
static create({ collectionId, fields }: {
|
|
91
|
+
fields: any;
|
|
92
|
+
collectionId: string;
|
|
93
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItem, any>>;
|
|
94
|
+
/**
|
|
95
|
+
* Update a single Item
|
|
96
|
+
* @param params The params for the request
|
|
97
|
+
* @param params.collectionId The Collection ID
|
|
98
|
+
* @param params.itemId The Item ID
|
|
99
|
+
* @param params.fields The fields to update
|
|
100
|
+
* @param client The Axios client instance
|
|
101
|
+
* @returns The updated Item
|
|
102
|
+
*/
|
|
103
|
+
static update({ collectionId, itemId, fields, }: {
|
|
104
|
+
fields: any;
|
|
105
|
+
itemId: string;
|
|
106
|
+
collectionId: string;
|
|
107
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItem, any>>;
|
|
108
|
+
/**
|
|
109
|
+
* Patch a single Item
|
|
110
|
+
* @param params The params for the request
|
|
111
|
+
* @param params.collectionId The Collection ID
|
|
112
|
+
* @param params.itemId The Item ID
|
|
113
|
+
* @param params.fields The fields to patch
|
|
114
|
+
* @param client The Axios client instance
|
|
115
|
+
* @returns The patched Item
|
|
116
|
+
*/
|
|
117
|
+
static patch({ collectionId, itemId, fields, }: {
|
|
118
|
+
fields: any;
|
|
119
|
+
itemId: string;
|
|
120
|
+
collectionId: string;
|
|
121
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItem, any>>;
|
|
122
|
+
/**
|
|
123
|
+
* Remove a single Item
|
|
124
|
+
* @param params The params for the request
|
|
125
|
+
* @param params.collectionId The Collection ID
|
|
126
|
+
* @param params.itemId The Item ID
|
|
127
|
+
* @param client The Axios client instance
|
|
128
|
+
* @returns The result from the removal
|
|
129
|
+
*/
|
|
130
|
+
static remove({ collectionId, itemId, }: {
|
|
131
|
+
itemId: string;
|
|
132
|
+
collectionId: string;
|
|
133
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<IItemDelete, any>>;
|
|
134
|
+
/**
|
|
135
|
+
* Unpublishes a list of Items
|
|
136
|
+
* @param params The params for the request
|
|
137
|
+
* @param params.collectionId The Collection ID
|
|
138
|
+
* @param params.live Unpublish from the live site
|
|
139
|
+
* @param client The Axios client instance
|
|
140
|
+
* @returns The result of the unpublish
|
|
141
|
+
*/
|
|
142
|
+
static unpublish({ collectionId, itemIds, live, }: {
|
|
143
|
+
live?: boolean;
|
|
144
|
+
itemIds: string[];
|
|
145
|
+
collectionId: string;
|
|
146
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<IDeletedItems, any>>;
|
|
147
|
+
/**
|
|
148
|
+
* Publishes a list of Items
|
|
149
|
+
* @param params The request parameters
|
|
150
|
+
* @param params.collectionId The Collection ID
|
|
151
|
+
* @param params.itemIds The list of Item IDs to publish
|
|
152
|
+
* @param params.live Publish to live site
|
|
153
|
+
* @param client The Axios client instance
|
|
154
|
+
* @returns The result of the publish
|
|
155
|
+
*/
|
|
156
|
+
static publish({ itemIds, live, collectionId }: {
|
|
157
|
+
live?: boolean;
|
|
158
|
+
itemIds: string[];
|
|
159
|
+
collectionId: string;
|
|
160
|
+
}, client: AxiosInstance): Promise<import("axios").AxiosResponse<IPublishItems, any>>;
|
|
161
|
+
/**************************************************************
|
|
162
|
+
* Instance Methods
|
|
163
|
+
**************************************************************/
|
|
164
|
+
/**
|
|
165
|
+
* Update a single Item
|
|
166
|
+
* @param fields The fields to update
|
|
167
|
+
* @returns The updated Item
|
|
168
|
+
*/
|
|
169
|
+
update({ ...fields }: {
|
|
170
|
+
[x: string]: any;
|
|
171
|
+
}): Promise<Item>;
|
|
172
|
+
/**
|
|
173
|
+
* Remove a single Item
|
|
174
|
+
* @returns The result from the removal
|
|
175
|
+
*/
|
|
176
|
+
remove(): Promise<IItemDelete>;
|
|
177
|
+
}
|