webflow-api 1.1.2 → 1.2.1

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.
Files changed (72) hide show
  1. package/README.md +41 -17
  2. package/dist/api/collection.d.ts +86 -25
  3. package/dist/api/collection.js +88 -29
  4. package/dist/api/index.d.ts +7 -7
  5. package/dist/api/index.js +9 -19
  6. package/dist/api/item.d.ts +141 -107
  7. package/dist/api/item.js +145 -125
  8. package/dist/api/meta.d.ts +16 -14
  9. package/dist/api/meta.js +20 -19
  10. package/dist/api/oauth.d.ts +38 -36
  11. package/dist/api/oauth.js +59 -59
  12. package/dist/api/site.d.ts +118 -43
  13. package/dist/api/site.js +131 -53
  14. package/dist/api/user.d.ts +143 -0
  15. package/dist/api/user.js +119 -0
  16. package/dist/api/webhook.d.ts +77 -55
  17. package/dist/api/webhook.js +74 -61
  18. package/dist/core/error.d.ts +2 -0
  19. package/dist/core/error.js +8 -1
  20. package/dist/core/index.d.ts +2 -2
  21. package/dist/core/index.js +2 -2
  22. package/dist/core/response.d.ts +32 -0
  23. package/dist/core/response.js +26 -0
  24. package/dist/{webflow.d.ts → core/webflow.d.ts} +66 -54
  25. package/dist/{webflow.js → core/webflow.js} +114 -65
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +2 -2
  28. package/package.json +12 -8
  29. package/src/api/collection.ts +103 -36
  30. package/src/api/index.ts +7 -7
  31. package/src/api/item.ts +217 -176
  32. package/src/api/meta.ts +19 -18
  33. package/src/api/oauth.ts +71 -74
  34. package/src/api/site.ts +161 -55
  35. package/src/api/user.ts +192 -0
  36. package/src/api/webhook.ts +103 -80
  37. package/src/core/error.ts +8 -0
  38. package/src/core/index.ts +2 -2
  39. package/src/core/response.ts +50 -0
  40. package/src/{webflow.ts → core/webflow.ts} +153 -125
  41. package/src/index.ts +1 -1
  42. package/yarn.lock +4 -9
  43. package/dist/api/membership.d.ts +0 -114
  44. package/dist/api/membership.js +0 -96
  45. package/dist/core/client.d.ts +0 -27
  46. package/dist/core/client.js +0 -60
  47. package/dist/core/options.d.ts +0 -8
  48. package/dist/core/options.js +0 -5
  49. package/dist/wrapper/collection.d.ts +0 -85
  50. package/dist/wrapper/collection.js +0 -94
  51. package/dist/wrapper/index.d.ts +0 -6
  52. package/dist/wrapper/index.js +0 -22
  53. package/dist/wrapper/item.d.ts +0 -140
  54. package/dist/wrapper/item.js +0 -153
  55. package/dist/wrapper/membership.d.ts +0 -105
  56. package/dist/wrapper/membership.js +0 -123
  57. package/dist/wrapper/response.d.ts +0 -16
  58. package/dist/wrapper/response.js +0 -17
  59. package/dist/wrapper/site.d.ts +0 -168
  60. package/dist/wrapper/site.js +0 -191
  61. package/dist/wrapper/webhook.d.ts +0 -78
  62. package/dist/wrapper/webhook.js +0 -82
  63. package/src/api/membership.ts +0 -155
  64. package/src/core/client.ts +0 -82
  65. package/src/core/options.ts +0 -9
  66. package/src/wrapper/collection.ts +0 -115
  67. package/src/wrapper/index.ts +0 -6
  68. package/src/wrapper/item.ts +0 -218
  69. package/src/wrapper/membership.ts +0 -163
  70. package/src/wrapper/response.ts +0 -25
  71. package/src/wrapper/site.ts +0 -228
  72. package/src/wrapper/webhook.ts +0 -116
@@ -1,114 +0,0 @@
1
- import { Client, PaginatedData } from "../core";
2
- /**************************************************************
3
- * Interfaces
4
- **************************************************************/
5
- export interface IUser {
6
- emailVerified: boolean;
7
- lastUpdated?: string;
8
- createdOn: string;
9
- _id: string;
10
- data: any;
11
- }
12
- export interface IAccessGroup {
13
- _id: string;
14
- name: string;
15
- shortId: string;
16
- slug: string;
17
- createdOn: string;
18
- }
19
- export interface IUserDelete {
20
- deleted: number;
21
- }
22
- /**************************************************************
23
- * Types
24
- **************************************************************/
25
- export declare type PaginatedUsers = PaginatedData & {
26
- users: IUser[];
27
- };
28
- export declare type PaginatedAccessGroups = PaginatedData & {
29
- accessGroups: IAccessGroup[];
30
- };
31
- export declare type UserIdParam = {
32
- siteId: string;
33
- userId: string;
34
- };
35
- /**************************************************************
36
- * Functions
37
- **************************************************************/
38
- /**
39
- * Get a list of Users
40
- * @param client The Webflow client
41
- * @param params The params for the request
42
- * @param params.siteId The site ID
43
- * @param params.limit The number of items to return (optional)
44
- * @param params.offset The number of items to skip (optional)
45
- * @returns A list of Users
46
- */
47
- export declare function list(client: Client, { siteId, limit, offset }: {
48
- siteId: string;
49
- limit?: number;
50
- offset?: number;
51
- }): Promise<import("axios").AxiosResponse<PaginatedUsers, any>>;
52
- /**
53
- * Get a single User
54
- * @param client The Webflow client
55
- * @param params The params for the request
56
- * @param params.siteId The site ID
57
- * @param params.userId The user ID
58
- * @returns A single User
59
- */
60
- export declare function getOne(client: Client, { siteId, userId }: {
61
- siteId: string;
62
- userId: string;
63
- }): Promise<import("axios").AxiosResponse<IUser, any>>;
64
- /**
65
- * Update a User
66
- * @param client The Webflow client
67
- * @param params The params for the request
68
- * @param params.siteId The site ID
69
- * @param params.userId The user ID
70
- * @param params.data The data to update
71
- * @returns The updated User
72
- */
73
- export declare function update(client: Client, { siteId, userId, ...data }: {
74
- siteId: string;
75
- userId: string;
76
- }): Promise<import("axios").AxiosResponse<IUser, any>>;
77
- /**
78
- * Invite a User to a site
79
- * @param client The Webflow client
80
- * @param params The params for the request
81
- * @param params.siteId The site ID
82
- * @param params.email The email address of the user to invite
83
- * @returns The newly created User
84
- */
85
- export declare function invite(client: Client, { siteId, email }: {
86
- siteId: string;
87
- email: string;
88
- }): Promise<import("axios").AxiosResponse<IUser, any>>;
89
- /**
90
- * Remove a User
91
- * @param client The Webflow client
92
- * @param params The params for the request
93
- * @param params.siteId The site ID
94
- * @param params.userId The user ID
95
- * @returns The result of the remove
96
- */
97
- export declare function remove(client: Client, { siteId, userId }: {
98
- siteId: string;
99
- userId: string;
100
- }): Promise<import("axios").AxiosResponse<IUserDelete, any>>;
101
- /**
102
- * Get a list of Access Groups
103
- * @param client The Webflow client
104
- * @param params The params for the request
105
- * @param params.siteId The Site ID
106
- * @param params.limit The number of items to return (optional)
107
- * @param params.offset The number of items to skip (optional)
108
- * @returns A list of Access Groups
109
- */
110
- export declare function accessGroups(client: Client, { siteId, limit, offset }: {
111
- siteId: string;
112
- limit?: number;
113
- offset?: number;
114
- }): Promise<import("axios").AxiosResponse<PaginatedAccessGroups, any>>;
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.accessGroups = exports.remove = exports.invite = exports.update = exports.getOne = exports.list = void 0;
4
- const core_1 = require("../core");
5
- /**************************************************************
6
- * Functions
7
- **************************************************************/
8
- /**
9
- * Get a list of Users
10
- * @param client The Webflow client
11
- * @param params The params for the request
12
- * @param params.siteId The site ID
13
- * @param params.limit The number of items to return (optional)
14
- * @param params.offset The number of items to skip (optional)
15
- * @returns A list of Users
16
- */
17
- function list(client, { siteId, limit, offset }) {
18
- (0, core_1.requireArgs)({ siteId });
19
- const params = { limit, offset };
20
- const path = `/sites/${siteId}/users`;
21
- return client.get(path, { params });
22
- }
23
- exports.list = list;
24
- /**
25
- * Get a single User
26
- * @param client The Webflow client
27
- * @param params The params for the request
28
- * @param params.siteId The site ID
29
- * @param params.userId The user ID
30
- * @returns A single User
31
- */
32
- function getOne(client, { siteId, userId }) {
33
- (0, core_1.requireArgs)({ siteId, userId });
34
- const path = `/sites/${siteId}/users/${userId}`;
35
- return client.get(path);
36
- }
37
- exports.getOne = getOne;
38
- /**
39
- * Update a User
40
- * @param client The Webflow client
41
- * @param params The params for the request
42
- * @param params.siteId The site ID
43
- * @param params.userId The user ID
44
- * @param params.data The data to update
45
- * @returns The updated User
46
- */
47
- function update(client, { siteId, userId, ...data }) {
48
- (0, core_1.requireArgs)({ siteId, userId });
49
- const path = `/sites/${siteId}/users/${userId}`;
50
- return client.patch(path, data);
51
- }
52
- exports.update = update;
53
- /**
54
- * Invite a User to a site
55
- * @param client The Webflow client
56
- * @param params The params for the request
57
- * @param params.siteId The site ID
58
- * @param params.email The email address of the user to invite
59
- * @returns The newly created User
60
- */
61
- async function invite(client, { siteId, email }) {
62
- (0, core_1.requireArgs)({ siteId, email });
63
- const path = `/sites/${siteId}/users/invite`;
64
- return client.post(path, { email });
65
- }
66
- exports.invite = invite;
67
- /**
68
- * Remove a User
69
- * @param client The Webflow client
70
- * @param params The params for the request
71
- * @param params.siteId The site ID
72
- * @param params.userId The user ID
73
- * @returns The result of the remove
74
- */
75
- function remove(client, { siteId, userId }) {
76
- (0, core_1.requireArgs)({ siteId, userId });
77
- const path = `/sites/${siteId}/users/${userId}`;
78
- return client.delete(path);
79
- }
80
- exports.remove = remove;
81
- /**
82
- * Get a list of Access Groups
83
- * @param client The Webflow client
84
- * @param params The params for the request
85
- * @param params.siteId The Site ID
86
- * @param params.limit The number of items to return (optional)
87
- * @param params.offset The number of items to skip (optional)
88
- * @returns A list of Access Groups
89
- */
90
- function accessGroups(client, { siteId, limit, offset }) {
91
- (0, core_1.requireArgs)({ siteId });
92
- const params = { limit, offset };
93
- const path = `/sites/${siteId}/users/accessgroups`;
94
- return client.get(path, { params });
95
- }
96
- exports.accessGroups = accessGroups;
@@ -1,27 +0,0 @@
1
- import { Axios } from "axios";
2
- import { Options } from "../core";
3
- /**************************************************************
4
- * Types
5
- **************************************************************/
6
- export declare type QueryString = Record<string, any>;
7
- export declare type PaginationFilter = {
8
- limit?: number;
9
- offset?: number;
10
- };
11
- /**************************************************************
12
- * Interfaces
13
- ************************************************************* */
14
- export interface PaginatedData {
15
- count: number;
16
- limit: number;
17
- offset: number;
18
- total: number;
19
- }
20
- /**************************************************************
21
- * Classes
22
- **************************************************************/
23
- export declare class Client extends Axios {
24
- constructor({ host, headers, version, token, }?: Options);
25
- set token(value: string);
26
- clearToken(): void;
27
- }
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Client = void 0;
4
- const axios_1 = require("axios");
5
- const core_1 = require("../core");
6
- /**************************************************************
7
- * Functions
8
- **************************************************************/
9
- /**
10
- * Transforms JSON response to an object
11
- * if the response is a Webflow error, it will throw an error
12
- * @param data JSON response
13
- * @returns response object
14
- */
15
- function transformResponse(data = {}) {
16
- // parse json if string
17
- if (String(data) === data)
18
- data = JSON.parse(data);
19
- // throw an error if Webflow returns an error obejct
20
- if (data.err)
21
- throw new core_1.RequestError(data);
22
- return data;
23
- }
24
- /**
25
- * Transforms POST/PUT/PATCH request data to JSON
26
- * @param data A JavaScript object
27
- * @returns JSON string
28
- */
29
- function transformRequest(data = {}) {
30
- return JSON.stringify(data);
31
- }
32
- /**************************************************************
33
- * Classes
34
- **************************************************************/
35
- class Client extends axios_1.Axios {
36
- constructor({ host = core_1.DEFAULT_HOST, headers = {}, version, token, } = {}) {
37
- super({
38
- transformRequest: [transformRequest],
39
- transformResponse: [transformResponse],
40
- baseURL: `https://api.${host}/`,
41
- headers: {
42
- "Content-Type": "application/json",
43
- "User-Agent": core_1.USER_AGENT,
44
- "Accept-Version": version,
45
- ...headers,
46
- },
47
- });
48
- if (token)
49
- this.token = token;
50
- }
51
- // set the Authorization header
52
- set token(value) {
53
- this.defaults.headers["Authorization"] = `Bearer ${value}`;
54
- }
55
- // clear the Authorization header
56
- clearToken() {
57
- delete this.defaults.headers["Authorization"];
58
- }
59
- }
60
- exports.Client = Client;
@@ -1,8 +0,0 @@
1
- export declare const DEFAULT_HOST = "webflow.com";
2
- export declare const USER_AGENT = "Webflow Javascript SDK / 1.0";
3
- export interface Options {
4
- host?: string;
5
- token?: string;
6
- version?: string;
7
- headers?: Record<string, string>;
8
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.USER_AGENT = exports.DEFAULT_HOST = void 0;
4
- exports.DEFAULT_HOST = "webflow.com";
5
- exports.USER_AGENT = "Webflow Javascript SDK / 1.0";
@@ -1,85 +0,0 @@
1
- import { ItemWrapper } from ".";
2
- import { Client, QueryString } from "../core";
3
- import { Collection } from "../api";
4
- export declare class CollectionWrapper implements Collection.ICollection {
5
- private client;
6
- fields: Collection.CollectionField[];
7
- singularName: string;
8
- lastUpdated: string;
9
- createdOn: string;
10
- _id: string;
11
- name: string;
12
- slug: string;
13
- constructor(client: Client, collection: Collection.ICollection);
14
- /**************************************************************
15
- * Static Methods
16
- **************************************************************/
17
- /**
18
- * Get a single Collection
19
- * @param client The Webflow client
20
- * @param params The Collection information
21
- * @param params.collectionId The Collection ID
22
- * @returns A single Collection
23
- */
24
- static getOne(client: Client, { collectionId }: {
25
- collectionId: string;
26
- }): Promise<import("./response").MetaResponse<CollectionWrapper>>;
27
- /**
28
- * Get a list of Collections
29
- * @param client The Webflow client
30
- * @param params1 The Site information
31
- * @param params1.siteId The Site ID
32
- * @param params The query parameters (optional)
33
- * @returns A list of Collections
34
- */
35
- static list(client: Client, { siteId }: {
36
- siteId: string;
37
- }, params?: QueryString): Promise<import("./response").MetaResponse<CollectionWrapper[]>>;
38
- /**************************************************************
39
- * Instance Methods
40
- **************************************************************/
41
- /**
42
- * Get a single Item
43
- * @param params The params for the request
44
- * @param params.itemId The Item ID
45
- * @returns A single Item
46
- */
47
- item({ itemId }: {
48
- itemId: string;
49
- }): Promise<import("./response").MetaResponse<ItemWrapper>>;
50
- /**
51
- * Get a list of Items
52
- * @param params The params for the request
53
- * @param params.limit The number of items to return (optional)
54
- * @param params.offset The number of items to skip (optional)
55
- * @returns A list of Items
56
- */
57
- items(params?: QueryString): Promise<import("./response").MetaResponse<ItemWrapper[]>>;
58
- /**
59
- * Remove a single Item
60
- * @param params The params for the request
61
- * @param params.itemId The Item ID
62
- * @returns The result from the removal
63
- */
64
- removeItem({ itemId }: {
65
- itemId: string;
66
- }): Promise<import("./response").MetaResponse<import("../api/item").IItemDelete>>;
67
- /**
68
- * Create a new Item
69
- * @param params The params for the request
70
- * @param params.fields The Item fields to create
71
- * @returns The created Item
72
- */
73
- createItem(fields: any): Promise<import("./response").MetaResponse<ItemWrapper>>;
74
- /**
75
- * Update a single Item
76
- * @param params The params for the request
77
- * @param params.itemId The Item ID
78
- * @param params.fields The fields to update
79
- * @returns The updated Item
80
- */
81
- updateItem({ itemId, fields }: {
82
- itemId: string;
83
- fields: any;
84
- }): Promise<import("./response").MetaResponse<ItemWrapper>>;
85
- }
@@ -1,94 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CollectionWrapper = void 0;
4
- const _1 = require(".");
5
- const api_1 = require("../api");
6
- class CollectionWrapper {
7
- constructor(client, collection) {
8
- this.client = client;
9
- Object.assign(this, collection);
10
- }
11
- /**************************************************************
12
- * Static Methods
13
- **************************************************************/
14
- /**
15
- * Get a single Collection
16
- * @param client The Webflow client
17
- * @param params The Collection information
18
- * @param params.collectionId The Collection ID
19
- * @returns A single Collection
20
- */
21
- static async getOne(client, { collectionId }) {
22
- const res = await api_1.Collection.getOne(client, { collectionId });
23
- const collection = new CollectionWrapper(client, res.data);
24
- return (0, _1.ResponseWrapper)(res, collection);
25
- }
26
- /**
27
- * Get a list of Collections
28
- * @param client The Webflow client
29
- * @param params1 The Site information
30
- * @param params1.siteId The Site ID
31
- * @param params The query parameters (optional)
32
- * @returns A list of Collections
33
- */
34
- static async list(client, { siteId }, params) {
35
- const res = await api_1.Collection.list(client, { siteId }, params);
36
- const collections = res.data.map((c) => new CollectionWrapper(client, c));
37
- return (0, _1.ResponseWrapper)(res, collections);
38
- }
39
- /**************************************************************
40
- * Instance Methods
41
- **************************************************************/
42
- /**
43
- * Get a single Item
44
- * @param params The params for the request
45
- * @param params.itemId The Item ID
46
- * @returns A single Item
47
- */
48
- async item({ itemId }) {
49
- return _1.ItemWrapper.getOne(this.client, { itemId, collectionId: this._id });
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(params) {
59
- return _1.ItemWrapper.list(this.client, { collectionId: this._id, ...params });
60
- }
61
- /**
62
- * Remove a single Item
63
- * @param params The params for the request
64
- * @param params.itemId The Item ID
65
- * @returns The result from the removal
66
- */
67
- async removeItem({ itemId }) {
68
- return _1.ItemWrapper.remove(this.client, { itemId, collectionId: this._id });
69
- }
70
- /**
71
- * Create a new Item
72
- * @param params The params for the request
73
- * @param params.fields The Item fields to create
74
- * @returns The created Item
75
- */
76
- async createItem(fields) {
77
- return _1.ItemWrapper.create(this.client, { collectionId: this._id, fields });
78
- }
79
- /**
80
- * Update a single Item
81
- * @param params The params for the request
82
- * @param params.itemId The Item ID
83
- * @param params.fields The fields to update
84
- * @returns The updated Item
85
- */
86
- async updateItem({ itemId, fields }) {
87
- return _1.ItemWrapper.update(this.client, {
88
- collectionId: this._id,
89
- itemId,
90
- fields,
91
- });
92
- }
93
- }
94
- exports.CollectionWrapper = CollectionWrapper;
@@ -1,6 +0,0 @@
1
- export * from "./membership";
2
- export * from "./collection";
3
- export * from "./response";
4
- export * from "./webhook";
5
- export * from "./site";
6
- export * from "./item";
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
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);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./membership"), exports);
18
- __exportStar(require("./collection"), exports);
19
- __exportStar(require("./response"), exports);
20
- __exportStar(require("./webhook"), exports);
21
- __exportStar(require("./site"), exports);
22
- __exportStar(require("./item"), exports);
@@ -1,140 +0,0 @@
1
- import { Client, QueryString, PaginationFilter } from "../core";
2
- import { Item } from "../api";
3
- export declare class ItemWrapper implements Item.IItem {
4
- private client;
5
- "published-on"?: string | null;
6
- "published-by"?: string | null;
7
- "updated-on": string;
8
- "created-on": string;
9
- "updated-by": string;
10
- "created-by": string;
11
- _archived: boolean;
12
- _draft: boolean;
13
- _cid: string;
14
- name: string;
15
- slug: string;
16
- _id: string;
17
- constructor(client: Client, item: Item.IItem);
18
- /**************************************************************
19
- * Static Methods
20
- **************************************************************/
21
- /**
22
- * Create a new Item
23
- * @param client The Webflow client
24
- * @param params The params for the request
25
- * @param params.collectionId The Collection ID
26
- * @param params.fields The Item fields to create
27
- * @returns The created Item
28
- */
29
- static create(client: Client, { collectionId, fields }: {
30
- collectionId: string;
31
- fields: any;
32
- }): Promise<import("./response").MetaResponse<ItemWrapper>>;
33
- /**
34
- * Get a single Item
35
- * @param client The Webflow client
36
- * @param params The params for the request
37
- * @param params.collectionId The Collection ID
38
- * @param params.itemId The Item ID
39
- * @returns A single Item
40
- */
41
- static getOne(client: Client, itemParams: {
42
- collectionId: string;
43
- itemId: string;
44
- }): Promise<import("./response").MetaResponse<ItemWrapper>>;
45
- /**
46
- * Get a list of Items
47
- * @param client The Webflow client
48
- * @param params The params for the request
49
- * @param params.collectionId The Collection ID
50
- * @param params.limit The number of items to return (optional)
51
- * @param params.offset The number of items to skip (optional)
52
- * @returns A list of Items
53
- */
54
- static list(client: Client, { collectionId, limit, offset }: {
55
- collectionId: string;
56
- } & PaginationFilter): Promise<import("./response").MetaResponse<ItemWrapper[]>>;
57
- /**
58
- * Remove a single Item
59
- * @param client The Webflow client
60
- * @param params The params for the request
61
- * @param params.collectionId The Collection ID
62
- * @param params.itemId The Item ID
63
- * @returns The result from the removal
64
- */
65
- static remove(client: Client, { collectionId, itemId }: {
66
- collectionId: string;
67
- itemId: string;
68
- }): Promise<import("./response").MetaResponse<Item.IItemDelete>>;
69
- /**
70
- * Publishes a list of Items
71
- * @param client The Webflow client
72
- * @param params The request parameters
73
- * @param params.collectionId The Collection ID
74
- * @param params.itemIds The list of Item IDs to publish
75
- * @param params.live Publish to live site
76
- * @returns The result of the publish
77
- */
78
- static publish(client: Client, { collectionId, itemIds, live, }: {
79
- collectionId: string;
80
- itemIds: string[];
81
- live: boolean;
82
- }): Promise<import("./response").MetaResponse<Item.IPublishItems>>;
83
- /**
84
- * Unpublishes a list of Items
85
- * @param client The Webflow client
86
- * @param params The params for the request
87
- * @param params.collectionId The Collection ID
88
- * @param params.live Unpublish from the live site
89
- * @returns The result of the unpublish
90
- */
91
- static unpublish(client: Client, { collectionId, itemIds, live, }: {
92
- collectionId: string;
93
- itemIds: string[];
94
- live: boolean;
95
- }): Promise<import("./response").MetaResponse<Item.IDeletedItems>>;
96
- /**
97
- * Update a single Item
98
- * @param client The Webflow client
99
- * @param params The params for the request
100
- * @param params.collectionId The Collection ID
101
- * @param params.itemId The Item ID
102
- * @param params.fields The fields to update
103
- * @returns The updated Item
104
- */
105
- static update(client: Client, { collectionId, itemId, fields, }: {
106
- collectionId: string;
107
- itemId: string;
108
- fields: any;
109
- }): Promise<import("./response").MetaResponse<ItemWrapper>>;
110
- /**
111
- * Patch a single Item
112
- * @param client The Webflow client
113
- * @param params The params for the request
114
- * @param params.collectionId The Collection ID
115
- * @param params.itemId The Item ID
116
- * @param params.fields The fields to patch
117
- * @returns The patched Item
118
- */
119
- static patch(client: Client, { collectionId, itemId, fields, }: {
120
- collectionId: string;
121
- itemId: string;
122
- fields: any;
123
- }, params?: QueryString): Promise<import("./response").MetaResponse<ItemWrapper>>;
124
- /**************************************************************
125
- * Instance Methods
126
- **************************************************************/
127
- /**
128
- * Update a single Item
129
- * @param fields The fields to update
130
- * @returns The updated Item
131
- */
132
- update({ ...fields }: {
133
- [x: string]: any;
134
- }): Promise<import("./response").MetaResponse<ItemWrapper>>;
135
- /**
136
- * Remove a single Item
137
- * @returns The result from the removal
138
- */
139
- remove(): Promise<import("./response").MetaResponse<Item.IItemDelete>>;
140
- }