@malevich-studio/strapi-sdk-typescript 1.0.2 → 1.0.3
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.
|
@@ -127,12 +127,12 @@ function generateMethodsCode(contentType) {
|
|
|
127
127
|
' }',
|
|
128
128
|
].join('\n'));
|
|
129
129
|
methods.push([
|
|
130
|
-
` public async create${(0, get_content_type_name_1.getContentTypeName)(contentType.schema.singularName)}(data
|
|
130
|
+
` public async create${(0, get_content_type_name_1.getContentTypeName)(contentType.schema.singularName)}(data: ${modelName}Input, params?: RequestInit) {`,
|
|
131
131
|
` return await this.create<${modelName}, ${modelName}Input>('${contentType.schema.pluralName}', data, params);`,
|
|
132
132
|
' }',
|
|
133
133
|
].join('\n'));
|
|
134
134
|
methods.push([
|
|
135
|
-
` public async update${(0, get_content_type_name_1.getContentTypeName)(contentType.schema.singularName)}(id: string, data
|
|
135
|
+
` public async update${(0, get_content_type_name_1.getContentTypeName)(contentType.schema.singularName)}(id: string, data: ${modelName}Input, params?: RequestInit) {`,
|
|
136
136
|
` return await this.update<${modelName}, ${modelName}Input>('${contentType.schema.pluralName}', id, data, params);`,
|
|
137
137
|
' }',
|
|
138
138
|
].join('\n'));
|
package/dist/main.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { RelationInput } from "./generator/attributes/relation";
|
|
2
|
+
export type { RelationInput };
|
|
1
3
|
type Response<T> = {
|
|
2
4
|
data: T;
|
|
3
5
|
meta: {
|
|
@@ -67,4 +69,3 @@ export declare class Strapi {
|
|
|
67
69
|
update<T, Q extends object>(endpoint: string, id: string, data: Q, params?: RequestInit): Promise<Response<T>>;
|
|
68
70
|
delete<T>(endpoint: string, id: string, params?: RequestInit): Promise<Response<T>>;
|
|
69
71
|
}
|
|
70
|
-
export {};
|