@malevich-studio/strapi-sdk-typescript 1.1.1 → 1.1.2
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 +18 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +18 -0
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -121,6 +131,7 @@ declare class Strapi {
|
|
|
121
131
|
private readonly token;
|
|
122
132
|
constructor(url: string, token: string);
|
|
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>>;
|
|
@@ -139,4 +150,4 @@ declare class Strapi {
|
|
|
139
150
|
private baseFetch;
|
|
140
151
|
}
|
|
141
152
|
|
|
142
|
-
export { type DynamiczoneComponent, type DynamiczonePopulate, type File, type FilterValue, type Filters, type Folder, type Query, type RelationInput, Strapi };
|
|
153
|
+
export { type DynamiczoneComponent, type DynamiczonePopulate, type File, type FilterValue, type Filters, type Folder, type Locale, type Query, type RelationInput, Strapi };
|
package/dist/index.mjs
CHANGED
|
@@ -21232,6 +21232,14 @@ class Strapi {
|
|
|
21232
21232
|
} : {}),
|
|
21233
21233
|
}, params));
|
|
21234
21234
|
}
|
|
21235
|
+
async getLocales(params) {
|
|
21236
|
+
return await this.baseFetch('i18n/locales', _.merge({
|
|
21237
|
+
headers: {
|
|
21238
|
+
'Content-Type': 'application/json',
|
|
21239
|
+
},
|
|
21240
|
+
method: 'GET',
|
|
21241
|
+
}, params));
|
|
21242
|
+
}
|
|
21235
21243
|
async getDocuments(endpoint, data, params = {}) {
|
|
21236
21244
|
return await this.fetch(endpoint, data, {
|
|
21237
21245
|
method: 'GET',
|