@malevich-studio/strapi-sdk-typescript 1.1.1 → 1.2.0
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/cli.cjs +23 -1160
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +23 -1160
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +13 -1160
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -12
- package/dist/index.mjs +13 -1160
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.ts +10 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,16 @@ type File = {
|
|
|
51
51
|
folder?: Folder;
|
|
52
52
|
folderPath: string;
|
|
53
53
|
};
|
|
54
|
+
type Locale = {
|
|
55
|
+
id: number;
|
|
56
|
+
documentId: string;
|
|
57
|
+
name: string;
|
|
58
|
+
code: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
updatedAt: string;
|
|
61
|
+
publishedAt?: string;
|
|
62
|
+
isDefault: boolean;
|
|
63
|
+
};
|
|
54
64
|
type Folder = {
|
|
55
65
|
id?: number;
|
|
56
66
|
documentId?: string;
|
|
@@ -118,25 +128,17 @@ type DynamiczonePopulate<T> = {
|
|
|
118
128
|
};
|
|
119
129
|
declare class Strapi {
|
|
120
130
|
private readonly url;
|
|
121
|
-
private readonly token
|
|
122
|
-
constructor(url: string, token
|
|
131
|
+
private readonly token?;
|
|
132
|
+
constructor(url: string, token?: string | undefined);
|
|
123
133
|
fetch<T>(endpoint: string, data?: object | FormData, params?: RequestInit): Promise<Response<T>>;
|
|
134
|
+
getLocales(params: RequestInit): Promise<Locale[]>;
|
|
124
135
|
getDocuments<T, Q extends object>(endpoint: string, data?: Q, params?: RequestInit): Promise<Response<T[]>>;
|
|
125
136
|
getDocument<T, Q extends object>(endpoint: string, data?: Q, params?: RequestInit): Promise<Response<T>>;
|
|
126
137
|
create<T, Q extends object>(endpoint: string, data: Q, params?: RequestInit): Promise<Response<T>>;
|
|
127
138
|
update<T, Q extends object>(endpoint: string, id: string, data: Q, params?: RequestInit): Promise<Response<T>>;
|
|
128
139
|
delete<T>(endpoint: string, id: string, params?: RequestInit): Promise<Response<T>>;
|
|
129
|
-
/**
|
|
130
|
-
* For Node.js
|
|
131
|
-
*
|
|
132
|
-
* @param files list of files names which will be uploaded, example: ['/app/data/cover.js']
|
|
133
|
-
*/
|
|
134
|
-
upload(files: {
|
|
135
|
-
path: string;
|
|
136
|
-
filename?: string;
|
|
137
|
-
}[]): Promise<File[]>;
|
|
138
140
|
uploadForm(form: FormData): Promise<File[]>;
|
|
139
141
|
private baseFetch;
|
|
140
142
|
}
|
|
141
143
|
|
|
142
|
-
export { type DynamiczoneComponent, type DynamiczonePopulate, type File, type FilterValue, type Filters, type Folder, type Query, type RelationInput, Strapi };
|
|
144
|
+
export { type DynamiczoneComponent, type DynamiczonePopulate, type File, type FilterValue, type Filters, type Folder, type Locale, type Query, type RelationInput, Strapi };
|