Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- `OneBlinkUploader.uploadAiEnvironmentAppStylesBuilderAttachment()`
- `OneBlinkUploader.uploadAiEnvironmentStylistAttachment()`

### Removed

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions src/OneBlinkUploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
UploadEmailAttachmentOptions,
UploadCustomPDFOptions,
UploadAiBuilderAttachmentOptions,
UploadAiEnvironmentAppStylesBuilderOptions,
UploadAiEnvironmentStylistAttachmentOptions,
} from './types.js'
import { SubmissionTypes } from '@oneblink/types'
import generateFormSubmissionTags from './generateFormSubmissionTags.js'
Expand Down Expand Up @@ -563,33 +563,32 @@ export default class OneBlinkUploader {
*
* ```ts
* const abortController = new AbortController()
* const result =
* await uploader.uploadAiEnvironmentAppStylesBuilderAttachment({
* onProgress: (progress) => {
* // ...
* },
* data: attachmentData,
* formsAppEnvironmentId: 1,
* abortSignal: abortController.signal,
* })
* const result = await uploader.uploadAiEnvironmentStylistAttachment({
* onProgress: (progress) => {
* // ...
* },
* data: attachmentData,
* formsAppEnvironmentId: 1,
* abortSignal: abortController.signal,
* })
* ```
*
* @param data The attachment data and options
* @returns The upload result
*/
async uploadAiEnvironmentAppStylesBuilderAttachment({
async uploadAiEnvironmentStylistAttachment({
onProgress,
abortSignal,
data,
formsAppEnvironmentId,
contentType,
fileName,
}: UploadAiEnvironmentAppStylesBuilderOptions) {
}: UploadAiEnvironmentStylistAttachmentOptions) {
return await uploadToS3({
...this,
contentType,
body: data,
key: `forms-app-environments/${formsAppEnvironmentId}/ai-builder/attachments`,
key: `forms-app-environments/${formsAppEnvironmentId}/ai-stylist/attachments`,
requestBodyHeader: {
fileName: encodeURIComponent(fileName),
},
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export type UploadAiBuilderAttachmentOptions = UploadOptions & {
fileName: string
}

export type UploadAiEnvironmentAppStylesBuilderOptions = UploadOptions & {
export type UploadAiEnvironmentStylistAttachmentOptions = UploadOptions & {
/** The file data to upload */
data: AttachmentUploadData
/** A standard MIME type describing the format of the contents */
Expand Down