webflow-api 1.3.0 → 1.3.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 (54) hide show
  1. package/dist/api/collection.d.ts +112 -0
  2. package/dist/api/collection.js +94 -0
  3. package/dist/api/index.d.ts +7 -0
  4. package/dist/api/index.js +23 -0
  5. package/dist/api/item.d.ts +177 -0
  6. package/dist/api/item.js +151 -0
  7. package/dist/api/meta.d.ts +53 -0
  8. package/dist/api/meta.js +25 -0
  9. package/dist/api/oauth.d.ts +71 -0
  10. package/dist/api/oauth.js +71 -0
  11. package/dist/api/site.d.ts +140 -0
  12. package/dist/api/site.js +137 -0
  13. package/dist/api/user.d.ts +143 -0
  14. package/dist/api/user.js +119 -0
  15. package/dist/api/webhook.d.ts +102 -0
  16. package/dist/api/webhook.js +80 -0
  17. package/dist/core/error.d.ts +21 -0
  18. package/dist/core/error.js +30 -0
  19. package/dist/core/index.d.ts +3 -0
  20. package/dist/core/index.js +19 -0
  21. package/dist/core/response.d.ts +32 -0
  22. package/dist/core/response.js +26 -0
  23. package/dist/core/webflow.d.ts +390 -0
  24. package/dist/core/webflow.js +518 -0
  25. package/dist/index.d.ts +2 -0
  26. package/package.json +7 -1
  27. package/yarn.lock +2840 -0
  28. package/.eslintrc +0 -31
  29. package/.github/workflows/code-quality.yml +0 -102
  30. package/.github/workflows/npm-publish.yml +0 -21
  31. package/.github/workflows/semgrep.yml +0 -24
  32. package/.prettierignore +0 -5
  33. package/.prettierrc +0 -6
  34. package/jest.config.js +0 -17
  35. package/tests/api/collection.test.ts +0 -147
  36. package/tests/api/item.test.ts +0 -180
  37. package/tests/api/meta.test.ts +0 -38
  38. package/tests/api/oauth.test.ts +0 -44
  39. package/tests/api/site.test.ts +0 -202
  40. package/tests/api/user.test.ts +0 -139
  41. package/tests/api/webhook.test.ts +0 -82
  42. package/tests/core/error.test.ts +0 -19
  43. package/tests/core/response.test.ts +0 -36
  44. package/tests/core/webflow.test.ts +0 -540
  45. package/tests/fixtures/collection.fixture.ts +0 -374
  46. package/tests/fixtures/index.ts +0 -7
  47. package/tests/fixtures/item.fixture.ts +0 -193
  48. package/tests/fixtures/meta.fixture.ts +0 -34
  49. package/tests/fixtures/oauth.fixture.ts +0 -38
  50. package/tests/fixtures/site.fixture.ts +0 -78
  51. package/tests/fixtures/user.fixture.ts +0 -175
  52. package/tests/fixtures/webhook.fixture.ts +0 -69
  53. package/tsconfig.eslint.json +0 -7
  54. package/tsconfig.json +0 -14
@@ -1,374 +0,0 @@
1
- export const CollectionFixture = {
2
- list: {
3
- parameters: {
4
- siteId: "580e63e98c9a982ac9b8b741",
5
- },
6
- response: [
7
- {
8
- _id: "580e63fc8c9a982ac9b8b745",
9
- lastUpdated: "2016-10-24T19:42:38.929Z",
10
- createdOn: "2016-10-24T19:41:48.349Z",
11
- name: "Blog Posts",
12
- slug: "post",
13
- singularName: "Blog Post",
14
- },
15
- {
16
- _id: "580e64088c9a982ac9b8b766",
17
- lastUpdated: "2016-10-24T19:42:00.799Z",
18
- createdOn: "2016-10-24T19:42:00.777Z",
19
- name: "Authors",
20
- slug: "author",
21
- singularName: "Author",
22
- },
23
- ],
24
- },
25
- getOne: {
26
- parameters: {
27
- collectionId: "580e63fc8c9a982ac9b8b745",
28
- },
29
- response: {
30
- _id: "580e63fc8c9a982ac9b8b745",
31
- lastUpdated: "2016-10-24T19:42:38.929Z",
32
- createdOn: "2016-10-24T19:41:48.349Z",
33
- name: "Blog Posts",
34
- slug: "post",
35
- singularName: "Blog Post",
36
- fields: [
37
- {
38
- id: "7f62a9781291109b9e428fb47239fd35",
39
- editable: true,
40
- required: false,
41
- type: "RichText",
42
- slug: "post-body",
43
- name: "Post Body",
44
- },
45
- {
46
- validations: {
47
- singleLine: false,
48
- },
49
- id: "ac4ffead755a78c710c44042f528b073",
50
- helpText: "A summary of the blog post that appears on blog post grid",
51
- editable: true,
52
- required: false,
53
- type: "PlainText",
54
- slug: "post-summary",
55
- name: "Post Summary",
56
- },
57
- {
58
- id: "ba1cfbdaa6b38b8e95e9b5063da8a5bd",
59
- editable: true,
60
- required: false,
61
- type: "ImageRef",
62
- slug: "main-image",
63
- name: "Main Image",
64
- },
65
- {
66
- id: "a8c6ea29b08cc5b5ef966908fa1deae2",
67
- helpText: "Smaller version of main image that is used on blog post grid",
68
- editable: true,
69
- required: false,
70
- type: "ImageRef",
71
- slug: "thumbnail-image",
72
- name: "Thumbnail image",
73
- },
74
- {
75
- id: "87e79a644a6fb5729940ec24e0012f01",
76
- editable: true,
77
- required: false,
78
- type: "Set",
79
- innerType: "ImageRef",
80
- slug: "picture-gallery",
81
- name: "Picture Gallery",
82
- },
83
- {
84
- id: "1e54974d97181032d3206ea021668e5f",
85
- editable: true,
86
- required: false,
87
- type: "Bool",
88
- slug: "featured",
89
- name: "Featured?",
90
- },
91
- {
92
- id: "648463cbc042ab079c2b99430a398ae5",
93
- editable: true,
94
- required: false,
95
- type: "Color",
96
- slug: "color",
97
- name: "Color",
98
- },
99
- {
100
- validations: {
101
- collectionId: "580e64088c9a982ac9b8b766",
102
- },
103
- id: "ea9067c48edee510de71fe503fa2fb51",
104
- editable: true,
105
- required: false,
106
- type: "ItemRef",
107
- slug: "author",
108
- name: "Author",
109
- },
110
- {
111
- validations: {
112
- maxLength: 256,
113
- },
114
- id: "60c0667e27b6d5a6daedec3a641265f6",
115
- editable: true,
116
- required: true,
117
- type: "PlainText",
118
- slug: "name",
119
- name: "Name",
120
- },
121
- {
122
- validations: {
123
- messages: {
124
- maxLength: "Must be less than 256 characters",
125
- pattern: "Must be alphanumerical and not contain any spaces or special characters",
126
- },
127
- pattern: {},
128
- maxLength: 256,
129
- },
130
- id: "8f0c953df91d10b767d66e1d7d00d631",
131
- unique: true,
132
- editable: true,
133
- required: true,
134
- type: "PlainText",
135
- slug: "slug",
136
- name: "Slug",
137
- },
138
- {
139
- default: false,
140
- id: "e4e92e700d70faffac6fa82ff2bfaece",
141
- editable: true,
142
- required: true,
143
- type: "Bool",
144
- slug: "_archived",
145
- name: "Archived",
146
- },
147
- {
148
- default: false,
149
- id: "f2675b2ac4fcef746b24d4a320887ef8",
150
- editable: true,
151
- required: true,
152
- type: "Bool",
153
- slug: "_draft",
154
- name: "Draft",
155
- },
156
- {
157
- id: "0913a35d92208bdf8fbf3ed1e39b771e",
158
- editable: false,
159
- required: false,
160
- type: "Date",
161
- slug: "created-on",
162
- name: "Created On",
163
- },
164
- {
165
- id: "3de04889465fe6d718e47b152ef5bb4d",
166
- editable: false,
167
- required: false,
168
- type: "Date",
169
- slug: "updated-on",
170
- name: "Updated On",
171
- },
172
- {
173
- id: "2a3cd866d5dbb294896130b233218626",
174
- editable: false,
175
- required: false,
176
- type: "Date",
177
- slug: "published-on",
178
- name: "Published On",
179
- },
180
- {
181
- id: "62c18561b9e89517751c6d8712d48f91",
182
- editable: false,
183
- required: false,
184
- type: "User",
185
- slug: "created-by",
186
- name: "Created By",
187
- },
188
- {
189
- id: "50918093b4e4d4eca1e83c25bcdc06a4",
190
- editable: false,
191
- required: false,
192
- type: "User",
193
- slug: "updated-by",
194
- name: "Updated By",
195
- },
196
- {
197
- id: "5c4587f18b32ef245daeaadfcba7860b",
198
- editable: false,
199
- required: false,
200
- type: "User",
201
- slug: "published-by",
202
- name: "Published By",
203
- },
204
- {
205
- id: "7f62a9781291109b9e428fb47239fd35",
206
- editable: true,
207
- required: false,
208
- type: "RichText",
209
- slug: "post-body",
210
- name: "Post Body",
211
- },
212
- {
213
- validations: {
214
- singleLine: false,
215
- },
216
- id: "ac4ffead755a78c710c44042f528b073",
217
- helpText: "A summary of the blog post that appears on blog post grid",
218
- editable: true,
219
- required: false,
220
- type: "PlainText",
221
- slug: "post-summary",
222
- name: "Post Summary",
223
- },
224
- {
225
- id: "ba1cfbdaa6b38b8e95e9b5063da8a5bd",
226
- editable: true,
227
- required: false,
228
- type: "ImageRef",
229
- slug: "main-image",
230
- name: "Main Image",
231
- },
232
- {
233
- id: "a8c6ea29b08cc5b5ef966908fa1deae2",
234
- helpText: "Smaller version of main image that is used on blog post grid",
235
- editable: true,
236
- required: false,
237
- type: "ImageRef",
238
- slug: "thumbnail-image",
239
- name: "Thumbnail image",
240
- },
241
- {
242
- id: "87e79a644a6fb5729940ec24e0012f01",
243
- editable: true,
244
- required: false,
245
- type: "Set",
246
- innerType: "ImageRef",
247
- slug: "picture-gallery",
248
- name: "Picture Gallery",
249
- },
250
- {
251
- id: "1e54974d97181032d3206ea021668e5f",
252
- editable: true,
253
- required: false,
254
- type: "Bool",
255
- slug: "featured",
256
- name: "Featured?",
257
- },
258
- {
259
- id: "648463cbc042ab079c2b99430a398ae5",
260
- editable: true,
261
- required: false,
262
- type: "Color",
263
- slug: "color",
264
- name: "Color",
265
- },
266
- {
267
- validations: {
268
- collectionId: "580e64088c9a982ac9b8b766",
269
- },
270
- id: "ea9067c48edee510de71fe503fa2fb51",
271
- editable: true,
272
- required: false,
273
- type: "ItemRef",
274
- slug: "author",
275
- name: "Author",
276
- },
277
- {
278
- validations: {
279
- maxLength: 256,
280
- },
281
- id: "60c0667e27b6d5a6daedec3a641265f6",
282
- editable: true,
283
- required: true,
284
- type: "PlainText",
285
- slug: "name",
286
- name: "Name",
287
- },
288
- {
289
- validations: {
290
- messages: {
291
- maxLength: "Must be less than 256 characters",
292
- pattern: "Must be alphanumerical and not contain any spaces or special characters",
293
- },
294
- pattern: {},
295
- maxLength: 256,
296
- },
297
- id: "8f0c953df91d10b767d66e1d7d00d631",
298
- unique: true,
299
- editable: true,
300
- required: true,
301
- type: "PlainText",
302
- slug: "slug",
303
- name: "Slug",
304
- },
305
- {
306
- default: false,
307
- id: "e4e92e700d70faffac6fa82ff2bfaece",
308
- editable: true,
309
- required: true,
310
- type: "Bool",
311
- slug: "_archived",
312
- name: "Archived",
313
- },
314
- {
315
- default: false,
316
- id: "f2675b2ac4fcef746b24d4a320887ef8",
317
- editable: true,
318
- required: true,
319
- type: "Bool",
320
- slug: "_draft",
321
- name: "Draft",
322
- },
323
- {
324
- id: "0913a35d92208bdf8fbf3ed1e39b771e",
325
- editable: false,
326
- required: false,
327
- type: "Date",
328
- slug: "created-on",
329
- name: "Created On",
330
- },
331
- {
332
- id: "3de04889465fe6d718e47b152ef5bb4d",
333
- editable: false,
334
- required: false,
335
- type: "Date",
336
- slug: "updated-on",
337
- name: "Updated On",
338
- },
339
- {
340
- id: "2a3cd866d5dbb294896130b233218626",
341
- editable: false,
342
- required: false,
343
- type: "Date",
344
- slug: "published-on",
345
- name: "Published On",
346
- },
347
- {
348
- id: "62c18561b9e89517751c6d8712d48f91",
349
- editable: false,
350
- required: false,
351
- type: "User",
352
- slug: "created-by",
353
- name: "Created By",
354
- },
355
- {
356
- id: "50918093b4e4d4eca1e83c25bcdc06a4",
357
- editable: false,
358
- required: false,
359
- type: "User",
360
- slug: "updated-by",
361
- name: "Updated By",
362
- },
363
- {
364
- id: "5c4587f18b32ef245daeaadfcba7860b",
365
- editable: false,
366
- required: false,
367
- type: "User",
368
- slug: "published-by",
369
- name: "Published By",
370
- },
371
- ],
372
- },
373
- },
374
- };
@@ -1,7 +0,0 @@
1
- export * from "./collection.fixture";
2
- export * from "./webhook.fixture";
3
- export * from "./oauth.fixture";
4
- export * from "./meta.fixture";
5
- export * from "./site.fixture";
6
- export * from "./item.fixture";
7
- export * from "./user.fixture";
@@ -1,193 +0,0 @@
1
- export const ItemFixture = {
2
- list: {
3
- parameters: {
4
- collectionId: "580e63fc8c9a982ac9b8b745",
5
- },
6
- response: {
7
- items: [
8
- {
9
- _archived: false,
10
- _draft: false,
11
- color: "#a98080",
12
- name: "Exciting blog post title",
13
- "post-body": "<p>Blog post contents...</p>",
14
- "post-summary": "Summary of exciting blog post",
15
- "main-image": {
16
- fileId: "580e63fe8c9a982ac9b8b749",
17
- url: "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg",
18
- },
19
- slug: "exciting-post",
20
- author: "580e640c8c9a982ac9b8b778",
21
- "updated-on": "2016-11-15T22:45:32.647Z",
22
- "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
23
- "created-on": "2016-11-15T22:45:32.647Z",
24
- "created-by": "Person_5660c5338e9d3b0bee3b86aa",
25
- "published-on": null,
26
- "published-by": null,
27
- _cid: "580e63fc8c9a982ac9b8b745",
28
- _id: "582b900cba19143b2bb8a759",
29
- },
30
- ],
31
- count: 1,
32
- limit: 1,
33
- offset: 0,
34
- total: 5,
35
- },
36
- },
37
- getOne: {
38
- parameters: {
39
- collectionId: "580e63fc8c9a982ac9b8b745",
40
- itemId: "582b900cba19143b2bb8a759",
41
- },
42
- response: {
43
- items: [
44
- {
45
- _archived: false,
46
- _draft: false,
47
- color: "#a98080",
48
- name: "Exciting blog post title",
49
- "post-body": "<p>Blog post contents...</p>",
50
- "post-summary": "Summary of exciting blog post",
51
- "main-image": {
52
- fileId: "580e63fe8c9a982ac9b8b749",
53
- url: "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg",
54
- },
55
- slug: "exciting-post",
56
- author: "580e640c8c9a982ac9b8b778",
57
- "updated-on": "2016-11-15T22:45:32.647Z",
58
- "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
59
- "created-on": "2016-11-15T22:45:32.647Z",
60
- "created-by": "Person_5660c5338e9d3b0bee3b86aa",
61
- "published-on": null,
62
- "published-by": null,
63
- _cid: "580e63fc8c9a982ac9b8b745",
64
- _id: "582b900cba19143b2bb8a759",
65
- },
66
- ],
67
- count: 1,
68
- limit: 1,
69
- offset: 0,
70
- total: 5,
71
- },
72
- },
73
- update: {
74
- parameters: {
75
- collectionId: "580e63fc8c9a982ac9b8b745",
76
- itemId: "582b900cba19143b2bb8a759",
77
- fields: {
78
- _archived: false,
79
- _draft: false,
80
- color: "#a98080",
81
- name: "Exciting blog post title",
82
- "post-body": "<p>Blog post contents...</p>",
83
- "post-summary": "Summary of exciting blog post",
84
- "main-image": {
85
- fileId: "580e63fe8c9a982ac9b8b749",
86
- url: "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg",
87
- },
88
- slug: "exciting-post",
89
- },
90
- },
91
- response: {
92
- _archived: false,
93
- _draft: false,
94
- color: "#a98080",
95
- name: "Exciting blog post title",
96
- "post-body": "<p>Blog post contents...</p>",
97
- "post-summary": "Summary of exciting blog post",
98
- "main-image": {
99
- fileId: "580e63fe8c9a982ac9b8b749",
100
- url: "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg",
101
- },
102
- slug: "exciting-post",
103
- author: "580e640c8c9a982ac9b8b778",
104
- "updated-on": "2016-11-15T22:45:32.647Z",
105
- "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
106
- "created-on": "2016-11-15T22:45:32.647Z",
107
- "created-by": "Person_5660c5338e9d3b0bee3b86aa",
108
- "published-on": null,
109
- "published-by": null,
110
- _cid: "580e63fc8c9a982ac9b8b745",
111
- _id: "582b900cba19143b2bb8a759",
112
- },
113
- },
114
- create: {
115
- parameters: {
116
- collectionId: "580e63fc8c9a982ac9b8b745",
117
- fields: {
118
- _archived: false,
119
- _draft: false,
120
- color: "#a98080",
121
- name: "Exciting blog post title",
122
- "post-body": "<p>Blog post contents...</p>",
123
- "post-summary": "Summary of exciting blog post",
124
- "main-image": {
125
- fileId: "580e63fe8c9a982ac9b8b749",
126
- url: "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg",
127
- },
128
- slug: "exciting-post",
129
- },
130
- },
131
- response: {
132
- _archived: false,
133
- _draft: false,
134
- color: "#a98080",
135
- name: "Exciting blog post title",
136
- "post-body": "<p>Blog post contents...</p>",
137
- "post-summary": "Summary of exciting blog post",
138
- "main-image": {
139
- fileId: "580e63fe8c9a982ac9b8b749",
140
- url: "https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg",
141
- },
142
- slug: "exciting-post",
143
- author: "580e640c8c9a982ac9b8b778",
144
- "updated-on": "2016-11-15T22:45:32.647Z",
145
- "updated-by": "Person_5660c5338e9d3b0bee3b86aa",
146
- "created-on": "2016-11-15T22:45:32.647Z",
147
- "created-by": "Person_5660c5338e9d3b0bee3b86aa",
148
- "published-on": null,
149
- "published-by": null,
150
- _cid: "580e63fc8c9a982ac9b8b745",
151
- _id: "582b900cba19143b2bb8a759",
152
- },
153
- },
154
- publish: {
155
- parameters: {
156
- live: true,
157
- collectionId: "580e63fc8c9a982ac9b8b745",
158
- itemIds: ["62aa37923cf7a9de1ca4469c", "62aa37923cf7a9de1ca44697", "62aa37923cf7a9de1ca44696"],
159
- },
160
- response: {
161
- publishedItemIds: [
162
- "62aa37923cf7a9de1ca4469c",
163
- "62aa37923cf7a9de1ca44697",
164
- "62aa37923cf7a9de1ca44696",
165
- ],
166
- errors: [],
167
- },
168
- },
169
- unpublish: {
170
- parameters: {
171
- live: true,
172
- collectionId: "580e63fc8c9a982ac9b8b745",
173
- itemIds: ["62aa37923cf7a9de1ca4469c", "62aa37923cf7a9de1ca44697", "62aa37923cf7a9de1ca44696"],
174
- },
175
- response: {
176
- deletedItemIds: [
177
- "62aa37923cf7a9de1ca4469c",
178
- "62aa37923cf7a9de1ca44697",
179
- "62aa37923cf7a9de1ca44696",
180
- ],
181
- errors: [],
182
- },
183
- },
184
- remove: {
185
- parameters: {
186
- collectionId: "580e63fc8c9a982ac9b8b745",
187
- itemId: "582b900cba19143b2bb8a759",
188
- },
189
- response: {
190
- deleted: 1,
191
- },
192
- },
193
- };
@@ -1,34 +0,0 @@
1
- export const MetaFixture = {
2
- installer: {
3
- response: {
4
- user: {
5
- _id: "545bbecb7bdd6769632504a7",
6
- email: "some@email.com",
7
- firstName: "Some",
8
- lastName: "One",
9
- },
10
- },
11
- },
12
- info: {
13
- response: {
14
- _id: "55818d58616600637b9a5786",
15
- createdOn: "2016-10-03T23:12:00.755Z",
16
- grantType: "authorization_code",
17
- lastUsed: "2016-10-10T21:41:12.736Z",
18
- sites: ["62f3b1f7eafac55d0c64ef91"],
19
- orgs: ["551ad253f0a9c0686f71ed08"],
20
- workspaces: [],
21
- users: ["545bbecb7bdd6769632504a7"],
22
- rateLimit: 60,
23
- status: "confirmed",
24
- application: {
25
- _id: "55131cd036c09f7d07883dfc",
26
- description: "OAuth Testing Application",
27
- homepage: "https://webflow.com",
28
- name: "Test App",
29
- owner: "545bbecb7bdd6769632504a7",
30
- ownerType: "Person",
31
- },
32
- },
33
- },
34
- };
@@ -1,38 +0,0 @@
1
- export const OAuthFixture = {
2
- authorize: {
3
- parameters: {
4
- client_id: "6287ec36a841b25637c663de",
5
- redirect_uri: "https://www.webflowers.com",
6
- response_type: "code",
7
- state: "1234567890",
8
- },
9
- response: {
10
- code: "6287ec36a841b25637c663de",
11
- },
12
- },
13
- access_token: {
14
- path: "/oauth/access_token",
15
- parameters: {
16
- client_id: "6287ec36a841b25637c663de",
17
- client_secret: "6287ec36a841b25637c663de",
18
- code: "6287ec36a841b25637c663de",
19
- grant_type: "authorization_code",
20
- redirect_uri: "https://www.webflowers.com",
21
- },
22
- response: {
23
- access_token: "6287ec36a841b25637c663de",
24
- token_type: "bearer",
25
- },
26
- },
27
- revoke_token: {
28
- path: "/oauth/revoke_authorization",
29
- parameters: {
30
- client_id: "6287ec36a841b25637c663de",
31
- client_secret: "6287ec36a841b25637c663de",
32
- access_token: "6287ec36a841b25637c663de",
33
- },
34
- response: {
35
- didRevoke: true,
36
- },
37
- },
38
- };