webflow-api 0.5.4 → 0.7.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.
@@ -3,14 +3,21 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports["default"] = void 0;
6
7
 
7
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
9
 
9
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
+
12
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
13
 
11
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
15
 
13
- var ResponseWrapper = function () {
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
+
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
+
20
+ var ResponseWrapper = /*#__PURE__*/function () {
14
21
  function ResponseWrapper(api) {
15
22
  _classCallCheck(this, ResponseWrapper);
16
23
 
@@ -20,115 +27,145 @@ var ResponseWrapper = function () {
20
27
  _createClass(ResponseWrapper, [{
21
28
  key: "site",
22
29
  value: function site(_site) {
23
- return _extends({}, _site, {
24
-
25
- collections: this.api.collections.bind(this.api, { siteId: _site._id }),
26
- webhooks: this.api.webhooks.bind(this.api, { siteId: _site._id }),
27
- domains: this.api.domains.bind(this.api, { siteId: _site._id }),
30
+ return _objectSpread(_objectSpread({}, _site), {}, {
31
+ collections: this.api.collections.bind(this.api, {
32
+ siteId: _site._id
33
+ }),
34
+ webhooks: this.api.webhooks.bind(this.api, {
35
+ siteId: _site._id
36
+ }),
37
+ domains: this.api.domains.bind(this.api, {
38
+ siteId: _site._id
39
+ }),
28
40
  webhook: function webhook(first) {
29
- var _api;
41
+ var _this$api;
30
42
 
31
- for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
43
+ for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
44
  rest[_key - 1] = arguments[_key];
33
45
  }
34
46
 
35
- return (_api = this.api).webhook.apply(_api, [_extends({}, first, { siteId: _site._id })].concat(rest));
47
+ return (_this$api = this.api).webhook.apply(_this$api, [_objectSpread(_objectSpread({}, first), {}, {
48
+ siteId: _site._id
49
+ })].concat(rest));
36
50
  },
37
51
  createWebhook: function createWebhook(first) {
38
- var _api2;
52
+ var _this$api2;
39
53
 
40
- for (var _len2 = arguments.length, rest = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
54
+ for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
41
55
  rest[_key2 - 1] = arguments[_key2];
42
56
  }
43
57
 
44
- return (_api2 = this.api).createWebhook.apply(_api2, [_extends({}, first, { siteId: _site._id })].concat(rest));
58
+ return (_this$api2 = this.api).createWebhook.apply(_this$api2, [_objectSpread(_objectSpread({}, first), {}, {
59
+ siteId: _site._id
60
+ })].concat(rest));
45
61
  },
46
62
  removeWebhook: function removeWebhook(first) {
47
- var _api3;
63
+ var _this$api3;
48
64
 
49
- for (var _len3 = arguments.length, rest = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
65
+ for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
50
66
  rest[_key3 - 1] = arguments[_key3];
51
67
  }
52
68
 
53
- return (_api3 = this.api).removeWebhook.apply(_api3, [_extends({}, first, { siteId: _site._id })].concat(rest));
69
+ return (_this$api3 = this.api).removeWebhook.apply(_this$api3, [_objectSpread(_objectSpread({}, first), {}, {
70
+ siteId: _site._id
71
+ })].concat(rest));
54
72
  },
55
73
  publishSite: function publishSite(domains) {
56
- return this.api.publishSite({ siteId: _site._id, domains: domains });
74
+ return this.api.publishSite({
75
+ siteId: _site._id,
76
+ domains: domains
77
+ });
57
78
  }
58
79
  });
59
80
  }
60
81
  }, {
61
82
  key: "domain",
62
83
  value: function domain(_domain) {
63
- return _extends({}, _domain);
84
+ return _objectSpread({}, _domain);
64
85
  }
65
86
  }, {
66
87
  key: "collection",
67
88
  value: function collection(_collection) {
68
- return _extends({}, _collection, {
69
-
70
- items: this.api.items.bind(this.api, { collectionId: _collection._id }),
89
+ return _objectSpread(_objectSpread({}, _collection), {}, {
90
+ items: this.api.items.bind(this.api, {
91
+ collectionId: _collection._id
92
+ }),
71
93
  item: function item(first) {
72
- var _api4;
94
+ var _this$api4;
73
95
 
74
- for (var _len4 = arguments.length, rest = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
96
+ for (var _len4 = arguments.length, rest = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
75
97
  rest[_key4 - 1] = arguments[_key4];
76
98
  }
77
99
 
78
- return (_api4 = this.api).item.apply(_api4, [_extends({}, first, { collectionId: _collection._id })].concat(rest));
100
+ return (_this$api4 = this.api).item.apply(_this$api4, [_objectSpread(_objectSpread({}, first), {}, {
101
+ collectionId: _collection._id
102
+ })].concat(rest));
79
103
  },
80
104
  createItem: function createItem(first) {
81
- var _api5;
105
+ var _this$api5;
82
106
 
83
- for (var _len5 = arguments.length, rest = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
107
+ for (var _len5 = arguments.length, rest = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
84
108
  rest[_key5 - 1] = arguments[_key5];
85
109
  }
86
110
 
87
- return (_api5 = this.api).createItem.apply(_api5, [_extends({}, first, { collectionId: _collection._id })].concat(rest));
111
+ return (_this$api5 = this.api).createItem.apply(_this$api5, [_objectSpread(_objectSpread({}, first), {}, {
112
+ collectionId: _collection._id
113
+ })].concat(rest));
88
114
  },
89
115
  updateItem: function updateItem(first) {
90
- var _api6;
116
+ var _this$api6;
91
117
 
92
- for (var _len6 = arguments.length, rest = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
118
+ for (var _len6 = arguments.length, rest = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
93
119
  rest[_key6 - 1] = arguments[_key6];
94
120
  }
95
121
 
96
- return (_api6 = this.api).updateItem.apply(_api6, [_extends({}, first, { collectionId: _collection._id })].concat(rest));
122
+ return (_this$api6 = this.api).updateItem.apply(_this$api6, [_objectSpread(_objectSpread({}, first), {}, {
123
+ collectionId: _collection._id
124
+ })].concat(rest));
97
125
  },
98
126
  removeItem: function removeItem(first) {
99
- var _api7;
127
+ var _this$api7;
100
128
 
101
- for (var _len7 = arguments.length, rest = Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {
129
+ for (var _len7 = arguments.length, rest = new Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {
102
130
  rest[_key7 - 1] = arguments[_key7];
103
131
  }
104
132
 
105
- return (_api7 = this.api).removeItem.apply(_api7, [_extends({}, first, { collectionId: _collection._id })].concat(rest));
133
+ return (_this$api7 = this.api).removeItem.apply(_this$api7, [_objectSpread(_objectSpread({}, first), {}, {
134
+ collectionId: _collection._id
135
+ })].concat(rest));
106
136
  }
107
137
  });
108
138
  }
109
139
  }, {
110
140
  key: "item",
111
141
  value: function item(_item, collectionId) {
112
- return _extends({}, _item, {
142
+ return _objectSpread(_objectSpread({}, _item), {}, {
113
143
  update: function update(first) {
114
- var _api8;
144
+ var _this$api8;
115
145
 
116
- for (var _len8 = arguments.length, rest = Array(_len8 > 1 ? _len8 - 1 : 0), _key8 = 1; _key8 < _len8; _key8++) {
146
+ for (var _len8 = arguments.length, rest = new Array(_len8 > 1 ? _len8 - 1 : 0), _key8 = 1; _key8 < _len8; _key8++) {
117
147
  rest[_key8 - 1] = arguments[_key8];
118
148
  }
119
149
 
120
- return (_api8 = this.api).updateItem.apply(_api8, [_extends({}, first, { collectionId: collectionId, itemId: _item._id })].concat(rest));
150
+ return (_this$api8 = this.api).updateItem.apply(_this$api8, [_objectSpread(_objectSpread({}, first), {}, {
151
+ collectionId: collectionId,
152
+ itemId: _item._id
153
+ })].concat(rest));
121
154
  },
122
-
123
- remove: this.api.updateItem.bind(this.api, { collectionId: collectionId, itemId: _item._id })
155
+ remove: this.api.updateItem.bind(this.api, {
156
+ collectionId: collectionId,
157
+ itemId: _item._id
158
+ })
124
159
  });
125
160
  }
126
161
  }, {
127
162
  key: "webhook",
128
163
  value: function webhook(_webhook, siteId) {
129
- return _extends({}, _webhook, {
130
-
131
- remove: this.api.removeWebhook.bind(this.api, { siteId: siteId, webhookId: _webhook._id })
164
+ return _objectSpread(_objectSpread({}, _webhook), {}, {
165
+ remove: this.api.removeWebhook.bind(this.api, {
166
+ siteId: siteId,
167
+ webhookId: _webhook._id
168
+ })
132
169
  });
133
170
  }
134
171
  }]);
@@ -136,5 +173,4 @@ var ResponseWrapper = function () {
136
173
  return ResponseWrapper;
137
174
  }();
138
175
 
139
- exports.default = ResponseWrapper;
140
- module.exports = exports["default"];
176
+ exports["default"] = ResponseWrapper;