netlify-api 0.1.6 → 0.1.8

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/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- /* global Reflect, Promise */
15
+ /* global Reflect, Promise, SuppressedError, Symbol */
16
16
 
17
17
 
18
18
  function __classPrivateFieldGet(receiver, state, kind, f) {
@@ -26,7 +26,12 @@ function __classPrivateFieldSet(receiver, state, value, kind, f) {
26
26
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
27
27
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
28
28
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
29
- }
29
+ }
30
+
31
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
32
+ var e = new Error(message);
33
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
34
+ };
30
35
 
31
36
  const baseUrl = 'https://api.netlify.com';
32
37
  async function fetch$1({ url, method, body, headers, pathParams, queryParams, signal, token, fetchImpl, basePath }) {
@@ -226,6 +231,15 @@ const getSiteFileByPathName = (variables, signal) => fetch$1({
226
231
  ...variables,
227
232
  signal
228
233
  });
234
+ /**
235
+ * Purges cached content from Netlify's CDN. Supports purging by Cache-Tag.
236
+ */
237
+ const purgeCache = (variables, signal) => fetch$1({
238
+ url: '/purge',
239
+ method: 'post',
240
+ ...variables,
241
+ signal
242
+ });
229
243
  const listSiteSnippets = (variables, signal) => fetch$1({
230
244
  url: '/sites/{siteId}/snippets',
231
245
  method: 'get',
@@ -705,6 +719,7 @@ const operationsByTag = {
705
719
  file: { listSiteFiles, getSiteFileByPathName, uploadDeployFile },
706
720
  asset: { listSiteAssets, createSiteAsset, getSiteAssetInfo, updateSiteAsset, deleteSiteAsset },
707
721
  assetPublicSignature: { getSiteAssetPublicSignature },
722
+ purge: { purgeCache },
708
723
  snippet: { listSiteSnippets, createSiteSnippet, getSiteSnippet, updateSiteSnippet, deleteSiteSnippet },
709
724
  metadata: { getSiteMetadata, updateSiteMetadata },
710
725
  buildHook: { listSiteBuildHooks, createSiteBuildHook, getSiteBuildHook, updateSiteBuildHook, deleteSiteBuildHook },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netlify-api",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Netlify API client for Node.js",
5
5
  "author": "SferaDev",
6
6
  "license": "ISC",