@malevich-studio/strapi-sdk-typescript 1.0.5 → 1.0.7

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.d.ts CHANGED
@@ -1,4 +1,17 @@
1
- export { RelationInput } from '@/generator/attributes/relation';
1
+ type RelationData = {
2
+ documentId: string;
3
+ before?: string;
4
+ after?: string;
5
+ start?: true;
6
+ end?: true;
7
+ locale?: string;
8
+ status?: 'published' | 'draft';
9
+ } | string;
10
+ type RelationInput = {
11
+ connect?: RelationData[];
12
+ disconnect?: RelationData[];
13
+ set?: RelationData[];
14
+ } | RelationData[];
2
15
 
3
16
  type Response<T> = {
4
17
  data: T;
@@ -111,9 +124,9 @@ declare class Strapi {
111
124
  upload(files: {
112
125
  path: string;
113
126
  filename?: string;
114
- }[]): Promise<File[]>;
115
- uploadForm(form: FormData): Promise<File[]>;
127
+ }[]): Promise<File>;
128
+ uploadForm(form: FormData): Promise<File>;
116
129
  private baseRequest;
117
130
  }
118
131
 
119
- export { type File, type FilterValue, type Filters, type Folder, type Query, Strapi };
132
+ export { type File, type FilterValue, type Filters, type Folder, type Query, type RelationInput, Strapi };
package/dist/index.mjs CHANGED
@@ -21277,10 +21277,10 @@ class Strapi {
21277
21277
  return await this.uploadForm(form);
21278
21278
  }
21279
21279
  async uploadForm(form) {
21280
- return await this.baseRequest('upload', {
21280
+ return (await this.baseRequest('upload', {
21281
21281
  method: 'POST',
21282
21282
  body: form,
21283
- });
21283
+ })).data;
21284
21284
  }
21285
21285
  async baseRequest(endpoint, params = {}) {
21286
21286
  const response = await fetch(`${this.url}/api/${endpoint}`, _.merge({