@adminforth/upload 2.15.12 → 2.15.14
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/build.log +2 -2
- package/custom/imageGenerator.vue +1 -1
- package/dist/custom/imageGenerator.vue +1 -1
- package/dist/index.d.ts +123 -0
- package/dist/types.d.ts +270 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
package/build.log
CHANGED
|
@@ -12,5 +12,5 @@ custom/preview.vue
|
|
|
12
12
|
custom/tsconfig.json
|
|
13
13
|
custom/uploader.vue
|
|
14
14
|
|
|
15
|
-
sent 68,
|
|
16
|
-
total size is 68,
|
|
15
|
+
sent 68,663 bytes received 153 bytes 137,632.00 bytes/sec
|
|
16
|
+
total size is 68,101 speedup is 0.99
|
|
@@ -210,7 +210,6 @@ import { callAdminForthApi } from '@/utils';
|
|
|
210
210
|
import { useI18n } from 'vue-i18n';
|
|
211
211
|
import adminforth from '@/adminforth';
|
|
212
212
|
import { ProgressBar } from '@/afcl';
|
|
213
|
-
import * as Handlebars from 'handlebars';
|
|
214
213
|
import { IconCloseOutline } from '@iconify-prerendered/vue-flowbite';
|
|
215
214
|
import { Tooltip, Skeleton } from '@/afcl'
|
|
216
215
|
import { useRoute } from 'vue-router';
|
|
@@ -245,6 +244,7 @@ onMounted(async () => {
|
|
|
245
244
|
}
|
|
246
245
|
// iterate over all variables in template and replace them with their values from props.record[field].
|
|
247
246
|
// if field is not present in props.record[field] then replace it with empty string and drop warning
|
|
247
|
+
const { default: Handlebars } = await import('handlebars');
|
|
248
248
|
const tpl = Handlebars.compile(template);
|
|
249
249
|
const compiledTemplate = tpl(props.record);
|
|
250
250
|
prompt.value = compiledTemplate;
|
|
@@ -210,7 +210,6 @@ import { callAdminForthApi } from '@/utils';
|
|
|
210
210
|
import { useI18n } from 'vue-i18n';
|
|
211
211
|
import adminforth from '@/adminforth';
|
|
212
212
|
import { ProgressBar } from '@/afcl';
|
|
213
|
-
import * as Handlebars from 'handlebars';
|
|
214
213
|
import { IconCloseOutline } from '@iconify-prerendered/vue-flowbite';
|
|
215
214
|
import { Tooltip, Skeleton } from '@/afcl'
|
|
216
215
|
import { useRoute } from 'vue-router';
|
|
@@ -245,6 +244,7 @@ onMounted(async () => {
|
|
|
245
244
|
}
|
|
246
245
|
// iterate over all variables in template and replace them with their values from props.record[field].
|
|
247
246
|
// if field is not present in props.record[field] then replace it with empty string and drop warning
|
|
247
|
+
const { default: Handlebars } = await import('handlebars');
|
|
248
248
|
const tpl = Handlebars.compile(template);
|
|
249
249
|
const compiledTemplate = tpl(props.record);
|
|
250
250
|
prompt.value = compiledTemplate;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { PluginOptions, UploadFromBufferParams, UploadFromBufferToExistingRecordParams, CommitUrlToUpdateExistingRecordParams, CommitUrlToNewRecordParams, GetUploadUrlParams } from './types.js';
|
|
2
|
+
import { AdminForthPlugin, AdminForthResource, IAdminForth, IHttpServer, RateLimiter } from "adminforth";
|
|
3
|
+
export default class UploadPlugin extends AdminForthPlugin {
|
|
4
|
+
options: PluginOptions;
|
|
5
|
+
adminforth: IAdminForth;
|
|
6
|
+
totalCalls: number;
|
|
7
|
+
totalDuration: number;
|
|
8
|
+
resourceConfig: AdminForthResource;
|
|
9
|
+
rateLimiter: RateLimiter;
|
|
10
|
+
getFileDownloadUrl: ((path: string) => Promise<string>);
|
|
11
|
+
getFileUploadUrl: (originalFilename: any, contentType: any, size: any, originalExtension: any, recordPk: any) => Promise<{
|
|
12
|
+
uploadUrl: string;
|
|
13
|
+
tagline?: string;
|
|
14
|
+
filePath?: string;
|
|
15
|
+
uploadExtraParams?: Record<string, string>;
|
|
16
|
+
previewUrl?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
} | {
|
|
19
|
+
error: string;
|
|
20
|
+
}>;
|
|
21
|
+
constructor(options: PluginOptions);
|
|
22
|
+
private normalizePaths;
|
|
23
|
+
private callStorageAdapter;
|
|
24
|
+
markKeyForNotDeletion(filePath: string): Promise<void>;
|
|
25
|
+
markKeyForDeletion(filePath: string): Promise<void>;
|
|
26
|
+
private generateImages;
|
|
27
|
+
isInternalUrl(url: string): Promise<boolean>;
|
|
28
|
+
instanceUniqueRepresentation(pluginOptions: any): string;
|
|
29
|
+
setupLifecycleRule(): Promise<void>;
|
|
30
|
+
genPreviewUrl(record: any): Promise<void>;
|
|
31
|
+
modifyResourceConfig(adminforth: IAdminForth, resourceConfig: AdminForthResource): Promise<void>;
|
|
32
|
+
validateConfigAfterDiscover(adminforth: IAdminForth, resourceConfig: any): void;
|
|
33
|
+
setupEndpoints(server: IHttpServer): void;
|
|
34
|
+
uploadFromBufferToNewRecord({ filename, contentType, buffer, adminUser, extra, recordAttributes, }: UploadFromBufferParams): Promise<{
|
|
35
|
+
path: string;
|
|
36
|
+
previewUrl: string;
|
|
37
|
+
newRecordPk: any;
|
|
38
|
+
}>;
|
|
39
|
+
uploadFromBufferToExistingRecord({ recordId, filename, contentType, buffer, adminUser, extra, }: UploadFromBufferToExistingRecordParams): Promise<{
|
|
40
|
+
path: string;
|
|
41
|
+
previewUrl: string;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Generates a new signed upload URL for future uploading from the frontend via a direct upload (e.g. using fetch + FormData).
|
|
45
|
+
*
|
|
46
|
+
* After the upload, file still will be marked for auto-deletion after short time, so to keep it permanently,
|
|
47
|
+
* you need to either:
|
|
48
|
+
* * Use commitUrlToExistingRecord to commit the URL to an existing record. This will replace the path in the existing record and will do a cleanup of the old
|
|
49
|
+
* file pointed in this path column.
|
|
50
|
+
* * If you want to create a new record with this URL, you can call commitUrlToNewRecord, which will create a new record and set the path column to the uploaded file path.
|
|
51
|
+
* * Write URL to special field called pathColumnName so afterSave hook installed by the plugin will automatically mark as not candidate for auto-deletion
|
|
52
|
+
*
|
|
53
|
+
* ```ts
|
|
54
|
+
* const file = input.files[0];
|
|
55
|
+
*
|
|
56
|
+
* // 1) Ask your backend to call getUploadUrlForExistingRecord
|
|
57
|
+
* const { uploadUrl, filePath, uploadExtraParams } = await fetch('/api/uploads/get-url-existing', {
|
|
58
|
+
* method: 'POST',
|
|
59
|
+
* headers: { 'Content-Type': 'application/json' },
|
|
60
|
+
* body: JSON.stringify({
|
|
61
|
+
* recordId,
|
|
62
|
+
* filename: file.name,
|
|
63
|
+
* contentType: file.type,
|
|
64
|
+
* size: file.size,
|
|
65
|
+
* }),
|
|
66
|
+
* }).then(r => r.json());
|
|
67
|
+
*
|
|
68
|
+
* const formData = new FormData();
|
|
69
|
+
* if (uploadExtraParams) {
|
|
70
|
+
* Object.entries(uploadExtraParams).forEach(([key, value]) => {
|
|
71
|
+
* formData.append(key, value as string);
|
|
72
|
+
* });
|
|
73
|
+
* }
|
|
74
|
+
* formData.append('file', file);
|
|
75
|
+
*
|
|
76
|
+
* // 2) Direct upload from the browser to storage (multipart/form-data)
|
|
77
|
+
* const uploadResp = await fetch(uploadUrl, {
|
|
78
|
+
* method: 'POST',
|
|
79
|
+
* body: formData,
|
|
80
|
+
* });
|
|
81
|
+
* if (!uploadResp.ok) {
|
|
82
|
+
* throw new Error('Upload failed');
|
|
83
|
+
* }
|
|
84
|
+
*
|
|
85
|
+
* // 3) Tell your backend to commit the URL to the record e.g. from rest API call
|
|
86
|
+
* await fetch('/api/uploads/commit-existing', {
|
|
87
|
+
* method: 'POST',
|
|
88
|
+
* headers: { 'Content-Type': 'application/json' },
|
|
89
|
+
* body: JSON.stringify({ recordId, filePath }),
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
getUploadUrl({ recordId, filename, contentType, size, }: GetUploadUrlParams): Promise<{
|
|
94
|
+
uploadUrl: string;
|
|
95
|
+
filePath: string;
|
|
96
|
+
uploadExtraParams?: Record<string, string>;
|
|
97
|
+
pathColumnName: string;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Commits a previously generated upload URL to an existing record.
|
|
101
|
+
*
|
|
102
|
+
* Never call this method from edit afterSave and beforeSave hooks of the same resource,
|
|
103
|
+
* as it would create infinite loop of record updates.
|
|
104
|
+
* You should call this method from your own custom API endpoint after the upload is done.
|
|
105
|
+
*/
|
|
106
|
+
commitUrlToUpdateExistingRecord({ recordId, filePath, adminUser, extra, }: CommitUrlToUpdateExistingRecordParams): Promise<{
|
|
107
|
+
path: string;
|
|
108
|
+
previewUrl: string;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Commits a previously generated upload URL to a new record.
|
|
112
|
+
*
|
|
113
|
+
* Never call this method from create afterSave and beforeSave hooks of the same resource,
|
|
114
|
+
* as it would create infinite loop of record creations.
|
|
115
|
+
*
|
|
116
|
+
* You should call this method from your own custom API endpoint after the upload is done.
|
|
117
|
+
*/
|
|
118
|
+
commitUrlToNewRecord({ filePath, adminUser, extra, recordAttributes, }: CommitUrlToNewRecordParams): Promise<{
|
|
119
|
+
path: string;
|
|
120
|
+
previewUrl: string;
|
|
121
|
+
newRecordPk: any;
|
|
122
|
+
}>;
|
|
123
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { AdminUser, ImageGenerationAdapter, StorageAdapter, HttpExtra } from "adminforth";
|
|
2
|
+
import { type PluginsCommonOptions } from "adminforth";
|
|
3
|
+
export interface PluginOptions extends PluginsCommonOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The name of the column where the path to the uploaded file is stored.
|
|
6
|
+
* On place of this column, a file upload field will be shown.
|
|
7
|
+
*/
|
|
8
|
+
pathColumnName: string;
|
|
9
|
+
/**
|
|
10
|
+
* the list of allowed file extensions
|
|
11
|
+
*/
|
|
12
|
+
allowedFileExtensions?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* the maximum file size in bytes
|
|
15
|
+
*/
|
|
16
|
+
maxFileSize?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The path where the file will be uploaded to the S3 bucket, same path will be stored in the database
|
|
19
|
+
* in the column specified in {@link pathColumnName}
|
|
20
|
+
*
|
|
21
|
+
* example:
|
|
22
|
+
*
|
|
23
|
+
* ```typescript
|
|
24
|
+
* s3Path: ({originalFilename}) => `/aparts/${originalFilename}`
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
filePath: ({ originalFilename, originalExtension, contentType, record }: {
|
|
29
|
+
originalFilename: string;
|
|
30
|
+
originalExtension: string;
|
|
31
|
+
contentType: string;
|
|
32
|
+
record?: any;
|
|
33
|
+
}) => string;
|
|
34
|
+
preview?: {
|
|
35
|
+
/**
|
|
36
|
+
* Whether to use preview components provided by the plugin. BY default true
|
|
37
|
+
*/
|
|
38
|
+
usePreviewComponents?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum width of the preview image
|
|
41
|
+
*/
|
|
42
|
+
maxWidth?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Maximum width of the preview image in list view
|
|
45
|
+
*/
|
|
46
|
+
maxListWidth?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum width of the preview image in show view
|
|
49
|
+
*/
|
|
50
|
+
maxShowWidth?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Minimum width of the preview image
|
|
53
|
+
*/
|
|
54
|
+
minWidth?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Minimum width of the preview image in list view
|
|
57
|
+
*/
|
|
58
|
+
minListWidth?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Minimum width of the preview image in show view
|
|
61
|
+
*/
|
|
62
|
+
minShowWidth?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Used to display preview (if it is image) in list and show views.
|
|
65
|
+
* Defaulted to the AWS S3 presigned URL if resource is private or public URL if resource is public.
|
|
66
|
+
* Can be used to generate custom e.g. CDN(e.g. Cloudflare) URL to worm up cache and deliver preview faster.
|
|
67
|
+
*
|
|
68
|
+
* Example:
|
|
69
|
+
*
|
|
70
|
+
* ```typescript
|
|
71
|
+
* previewUrl: ({record, path}) => `https://my-bucket.s3.amazonaws.com/${path}`,
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
previewUrl?: ({ filePath }: {
|
|
76
|
+
filePath: any;
|
|
77
|
+
}) => string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* AI image generation options
|
|
81
|
+
*/
|
|
82
|
+
generation?: {
|
|
83
|
+
adapter: ImageGenerationAdapter;
|
|
84
|
+
/**
|
|
85
|
+
* The size of the generated image.
|
|
86
|
+
*/
|
|
87
|
+
outputSize?: string;
|
|
88
|
+
/**
|
|
89
|
+
* The number of images to generate
|
|
90
|
+
* in one request
|
|
91
|
+
*/
|
|
92
|
+
countToGenerate: number;
|
|
93
|
+
/**
|
|
94
|
+
* Prompt which will be suggested to user during image generation. You can use record fields with mustache brackets:
|
|
95
|
+
* E.g. 'Generate a photo of car {{ model }} from {{ brand }} in {{ color }} color of {{ year }} year'. For now plugin get's these fields from open create/edit form
|
|
96
|
+
* so they should be present in the form.
|
|
97
|
+
*
|
|
98
|
+
* Reserved variables:
|
|
99
|
+
* - {{field}} - label of resource
|
|
100
|
+
* - {{resource}} - label of resource
|
|
101
|
+
*/
|
|
102
|
+
generationPrompt?: string;
|
|
103
|
+
/**
|
|
104
|
+
* If you want to use some image as reference for generation, you can use this function to get the path to the image.
|
|
105
|
+
*/
|
|
106
|
+
attachFiles?: ({ record, adminUser }: {
|
|
107
|
+
record: any;
|
|
108
|
+
adminUser: AdminUser;
|
|
109
|
+
}) => string[] | Promise<string[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Since AI generation can be expensive, we can limit the number of requests per IP.
|
|
112
|
+
*/
|
|
113
|
+
rateLimit?: {
|
|
114
|
+
/**
|
|
115
|
+
* E.g. 5/1d - 5 requests per day
|
|
116
|
+
* 3/1h - 3 requests per hour
|
|
117
|
+
*/
|
|
118
|
+
limit: string;
|
|
119
|
+
/**
|
|
120
|
+
* !Not used now
|
|
121
|
+
* Message shown to user when rate limit is reached
|
|
122
|
+
*/
|
|
123
|
+
errorMessage: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The adapter used to store the files.
|
|
128
|
+
* For now only S3 adapter is supported.
|
|
129
|
+
*/
|
|
130
|
+
storageAdapter: StorageAdapter;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Parameters for the UploadPlugin.uploadFromBuffer API.
|
|
134
|
+
* Used to upload a binary file buffer, create a record in the resource,
|
|
135
|
+
* and return the stored path and preview URL.
|
|
136
|
+
*/
|
|
137
|
+
export type UploadFromBufferParams = {
|
|
138
|
+
/**
|
|
139
|
+
* Original file name including extension, used to derive storage path
|
|
140
|
+
* and validate the file extension. Example: "photo.png".
|
|
141
|
+
*/
|
|
142
|
+
filename: string;
|
|
143
|
+
/**
|
|
144
|
+
* MIME type of the uploaded file. Will be used as Content-Type
|
|
145
|
+
* when uploading to the storage adapter. Example: "image/png".
|
|
146
|
+
*/
|
|
147
|
+
contentType: string;
|
|
148
|
+
/**
|
|
149
|
+
* Binary contents of the file. Can be a Node.js Buffer, Uint8Array,
|
|
150
|
+
* or ArrayBuffer. The plugin uploads this directly without converting
|
|
151
|
+
* to base64.
|
|
152
|
+
*/
|
|
153
|
+
buffer: Buffer | Uint8Array | ArrayBuffer;
|
|
154
|
+
/**
|
|
155
|
+
* Authenticated admin user on whose behalf the record is created.
|
|
156
|
+
* Passed through to AdminForth createResourceRecord hooks.
|
|
157
|
+
*/
|
|
158
|
+
adminUser: AdminUser;
|
|
159
|
+
/**
|
|
160
|
+
* Optional HTTP context (headers, IP, etc.) forwarded to AdminForth
|
|
161
|
+
* createResourceRecord hooks. Needed to execute hooks on creation resource record for the upload.
|
|
162
|
+
*/
|
|
163
|
+
extra?: HttpExtra;
|
|
164
|
+
/**
|
|
165
|
+
* Optional additional attributes to set on the created record
|
|
166
|
+
* together with the path column managed by the plugin.
|
|
167
|
+
* Values here do NOT affect the generated storage path.
|
|
168
|
+
*/
|
|
169
|
+
recordAttributes?: Record<string, any>;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Parameters for the UploadPlugin.uploadFromBufferToExistingRecord API.
|
|
173
|
+
* Used to upload a binary file buffer and update the path column
|
|
174
|
+
* of an already existing record identified by its primary key.
|
|
175
|
+
*/
|
|
176
|
+
export type UploadFromBufferToExistingRecordParams = UploadFromBufferParams & {
|
|
177
|
+
/**
|
|
178
|
+
* Primary key value of the existing record whose file path
|
|
179
|
+
* should be replaced.
|
|
180
|
+
*/
|
|
181
|
+
recordId: any;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Parameters for generating an upload URL for an existing record
|
|
185
|
+
* that will be uploaded directly from the browser.
|
|
186
|
+
*/
|
|
187
|
+
export type GetUploadUrlParams = {
|
|
188
|
+
/**
|
|
189
|
+
* Primary key of the record whose file is being replaced.
|
|
190
|
+
*/
|
|
191
|
+
recordId?: any;
|
|
192
|
+
/**
|
|
193
|
+
* Full file name including extension, as provided by the browser.
|
|
194
|
+
*/
|
|
195
|
+
filename: string;
|
|
196
|
+
/**
|
|
197
|
+
* MIME type reported by the browser, used as Content-Type for storage.
|
|
198
|
+
*/
|
|
199
|
+
contentType: string;
|
|
200
|
+
/**
|
|
201
|
+
* Optional file size in bytes. If provided, it will be validated
|
|
202
|
+
* against {@link PluginOptions.maxFileSize}.
|
|
203
|
+
*/
|
|
204
|
+
size?: number;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Parameters for generating an upload URL for a new record
|
|
208
|
+
* that will be uploaded directly from the browser.
|
|
209
|
+
*/
|
|
210
|
+
export type GetUploadUrlForNewRecordParams = {
|
|
211
|
+
/**
|
|
212
|
+
* Full file name including extension, as provided by the browser.
|
|
213
|
+
*/
|
|
214
|
+
filename: string;
|
|
215
|
+
/**
|
|
216
|
+
* MIME type reported by the browser, used as Content-Type for storage.
|
|
217
|
+
*/
|
|
218
|
+
contentType: string;
|
|
219
|
+
/**
|
|
220
|
+
* Optional file size in bytes. If provided, it will be validated
|
|
221
|
+
* against {@link PluginOptions.maxFileSize}.
|
|
222
|
+
*/
|
|
223
|
+
size?: number;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Parameters for committing a previously generated upload URL
|
|
227
|
+
* to an existing record. This is used after the browser finished
|
|
228
|
+
* uploading directly to the storage provider.
|
|
229
|
+
*/
|
|
230
|
+
export type CommitUrlToUpdateExistingRecordParams = {
|
|
231
|
+
/**
|
|
232
|
+
* Primary key of the record whose file is being replaced.
|
|
233
|
+
*/
|
|
234
|
+
recordId: any;
|
|
235
|
+
/**
|
|
236
|
+
* Storage path (key) that was returned by getUploadUrlForExistingRecord.
|
|
237
|
+
*/
|
|
238
|
+
filePath: string;
|
|
239
|
+
/**
|
|
240
|
+
* Authenticated admin user on whose behalf the record is updated.
|
|
241
|
+
*/
|
|
242
|
+
adminUser: AdminUser;
|
|
243
|
+
/**
|
|
244
|
+
* Optional HTTP context (headers, IP, etc.).
|
|
245
|
+
*/
|
|
246
|
+
extra?: HttpExtra;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Parameters for committing a previously generated upload URL
|
|
250
|
+
* to a new record. This is used after the browser finished
|
|
251
|
+
* uploading directly to the storage provider.
|
|
252
|
+
*/
|
|
253
|
+
export type CommitUrlToNewRecordParams = {
|
|
254
|
+
/**
|
|
255
|
+
* Storage path (key) that was returned by getUploadUrlForNewRecord.
|
|
256
|
+
*/
|
|
257
|
+
filePath: string;
|
|
258
|
+
/**
|
|
259
|
+
* Authenticated admin user on whose behalf the record is created.
|
|
260
|
+
*/
|
|
261
|
+
adminUser: AdminUser;
|
|
262
|
+
/**
|
|
263
|
+
* Optional HTTP context (headers, IP, etc.).
|
|
264
|
+
*/
|
|
265
|
+
extra?: HttpExtra;
|
|
266
|
+
/**
|
|
267
|
+
* Optional additional attributes for the new record.
|
|
268
|
+
*/
|
|
269
|
+
recordAttributes?: Record<string, any>;
|
|
270
|
+
};
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
52
52
|
|
|
53
53
|
/* Emit */
|
|
54
|
-
|
|
54
|
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
55
55
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
56
56
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
57
57
|
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|