@code.store/arcxp-sdk-ts 5.1.6 → 5.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.
@@ -15,5 +15,6 @@ export declare class ArcDraft extends ArcAbstractAPI {
15
15
  getRevision(id: string, revisionId: string, type?: string): Promise<Revision>;
16
16
  createRedirect<P extends CreateRedirectPayload, R = P extends CreateExternalRedirectPayload ? ExternalRedirect : P extends CreateDocumentRedirectPayload ? DocumentRedirect : never>(website: string, websiteUrl: string, payload: P): Promise<R>;
17
17
  getRedirect(website: string, websiteUrl: string): Promise<DocumentRedirect | ExternalRedirect>;
18
+ deleteRedirect(website: string, websiteUrl: string): Promise<DocumentRedirect | ExternalRedirect>;
18
19
  updateDraftRevision(id: string, payload: UpdateDraftRevisionPayload, type?: string): Promise<Revision>;
19
20
  }
package/dist/index.cjs CHANGED
@@ -5,6 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var axios = require('axios');
6
6
  var rateLimit = require('axios-rate-limit');
7
7
  var axiosRetry = require('axios-retry');
8
+ var fs = require('node:fs');
9
+ var path = require('node:path');
10
+ var FormData = require('form-data');
8
11
  var ws = require('ws');
9
12
  var encode = require('base32-encode');
10
13
  var uuid = require('uuid');
@@ -245,6 +248,10 @@ class ArcDraft extends ArcAbstractAPI {
245
248
  const { data } = await this.client.get(`/redirect/${website}/${websiteUrl}`);
246
249
  return data;
247
250
  }
251
+ async deleteRedirect(website, websiteUrl) {
252
+ const { data } = await this.client.delete(`/redirect/${website}/${websiteUrl}`);
253
+ return data;
254
+ }
248
255
  async updateDraftRevision(id, payload, type = 'story') {
249
256
  const { data } = await this.client.put(`/${type}/${id}/revision/draft`, payload);
250
257
  return data;
@@ -295,12 +302,10 @@ class ArcIdentity extends ArcAbstractAPI {
295
302
  }
296
303
  }
297
304
 
298
- const importNodeModule = async (moduleId) => await import(moduleId);
299
305
  const modules = {
300
- // make it like that so static analyzer of webpack won't bundle it
301
- fs: () => importNodeModule('node:fs'),
302
- path: () => importNodeModule('node:path'),
303
- form_data: () => importNodeModule('form-data'),
306
+ fs: () => Promise.resolve(fs),
307
+ path: () => Promise.resolve(path),
308
+ form_data: () => Promise.resolve(FormData),
304
309
  };
305
310
 
306
311
  var platform = {